diff --git a/js/lib/mimeExtension.js b/js/lib/mimeExtension.js index a5b3139d1e..64d91deb78 100644 --- a/js/lib/mimeExtension.js +++ b/js/lib/mimeExtension.js @@ -1,14 +1,14 @@ -var Dce=Object.create;var xj=Object.defineProperty;var Lce=Object.getOwnPropertyDescriptor;var Fce=Object.getOwnPropertyNames;var Pce=Object.getPrototypeOf,Ice=Object.prototype.hasOwnProperty;var WS=(We,oe)=>()=>{try{return oe||We((oe={exports:{}}).exports,oe),oe.exports}catch(Ie){throw oe=0,Ie}};var Rce=(We,oe,Ie,Oe)=>{if(oe&&typeof oe=="object"||typeof oe=="function")for(let Qe of Fce(oe))!Ice.call(We,Qe)&&Qe!==Ie&&xj(We,Qe,{get:()=>oe[Qe],enumerable:!(Oe=Lce(oe,Qe))||Oe.enumerable});return We};var hp=(We,oe,Ie)=>(Ie=We!=null?Dce(Pce(We)):{},Rce(oe||!We||!We.__esModule?xj(Ie,"default",{value:We,enumerable:!0}):Ie,We));var lv=WS((K2,bj)=>{(function(We,oe){typeof K2=="object"&&typeof bj<"u"?oe(K2):typeof define=="function"&&define.amd?define(["exports"],oe):(We=typeof globalThis<"u"?globalThis:We||self,oe(We.lumino_algorithm={}))})(K2,(function(We){"use strict";We.ArrayExt=void 0,(function(_i){function ia(Ta,La,ki=0,ri=-1){let Ri=Ta.length;if(Ri===0)return-1;ki<0?ki=Math.max(0,ki+Ri):ki=Math.min(ki,Ri-1),ri<0?ri=Math.max(0,ri+Ri):ri=Math.min(ri,Ri-1);let Na;ri0;){let Jo=Xo>>1,ta=xn+Jo;ki(Ta[ta],La)<0?(xn=ta+1,Xo-=Jo+1):Xo=Jo}return xn}_i.lowerBound=da;function cn(Ta,La,ki,ri=0,Ri=-1){let Na=Ta.length;if(Na===0)return 0;ri<0?ri=Math.max(0,ri+Na):ri=Math.min(ri,Na-1),Ri<0?Ri=Math.max(0,Ri+Na):Ri=Math.min(Ri,Na-1);let xn=ri,Xo=Ri-ri+1;for(;Xo>0;){let Jo=Xo>>1,ta=xn+Jo;ki(Ta[ta],La)>0?Xo=Jo:(xn=ta+1,Xo-=Jo+1)}return xn}_i.upperBound=cn;function Ss(Ta,La,ki){if(Ta===La)return!0;if(Ta.length!==La.length)return!1;for(let ri=0,Ri=Ta.length;ri=Na&&(ki=Ri<0?Na-1:Na),ri===void 0?ri=Ri<0?-1:Na:ri<0?ri=Math.max(ri+Na,Ri<0?-1:0):ri>=Na&&(ri=Ri<0?Na-1:Na);let xn;Ri<0&&ri>=ki||Ri>0&&ki>=ri?xn=0:Ri<0?xn=Math.floor((ri-ki+1)/Ri+1):xn=Math.floor((ri-ki-1)/Ri+1);let Xo=[];for(let Jo=0;Jo=ri))return;let Na=ri-ki+1;if(La>0?La=La%Na:La<0&&(La=(La%Na+Na)%Na),La===0)return;let xn=ki+La;sl(Ta,ki,xn-1),sl(Ta,xn,ri),sl(Ta,ki,ri)}_i.rotate=cu;function ah(Ta,La,ki=0,ri=-1){let Ri=Ta.length;if(Ri===0)return;ki<0?ki=Math.max(0,ki+Ri):ki=Math.min(ki,Ri-1),ri<0?ri=Math.max(0,ri+Ri):ri=Math.min(ri,Ri-1);let Na;riLa;--Ri)Ta[Ri]=Ta[Ri-1];Ta[La]=ki}_i.insert=o1;function l0(Ta,La){let ki=Ta.length;if(La<0&&(La+=ki),La<0||La>=ki)return;let ri=Ta[La];for(let Ri=La+1;Ri=ki&&xn<=ri&&Ta[xn]===La||ri=ki)&&Ta[xn]===La?Na++:Na>0&&(Ta[xn-Na]=Ta[xn]);return Na>0&&(Ta.length=Ri-Na),Na}_i.removeAllOf=mw;function u0(Ta,La,ki=0,ri=-1){let Ri,Na=Ba(Ta,La,ki,ri);return Na!==-1&&(Ri=l0(Ta,Na)),{index:Na,value:Ri}}_i.removeFirstWhere=u0;function fn(Ta,La,ki=-1,ri=0){let Ri,Na=eo(Ta,La,ki,ri);return Na!==-1&&(Ri=l0(Ta,Na)),{index:Na,value:Ri}}_i.removeLastWhere=fn;function us(Ta,La,ki=0,ri=-1){let Ri=Ta.length;if(Ri===0)return 0;ki<0?ki=Math.max(0,ki+Ri):ki=Math.min(ki,Ri-1),ri<0?ri=Math.max(0,ri+Ri):ri=Math.min(ri,Ri-1);let Na=0;for(let xn=0;xn=ki&&xn<=ri&&La(Ta[xn],xn)||ri=ki)&&La(Ta[xn],xn)?Na++:Na>0&&(Ta[xn-Na]=Ta[xn]);return Na>0&&(Ta.length=Ri-Na),Na}_i.removeAllWhere=us})(We.ArrayExt||(We.ArrayExt={}));function*oe(..._i){for(let ia of _i)yield*ia}function*Ie(){}function*Oe(_i,ia=0){for(let Yr of _i)yield[ia++,Yr]}function*Qe(_i,ia){let Yr=0;for(let Ba of _i)ia(Ba,Yr++)&&(yield Ba)}function dt(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++))return Ba}function Jt(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++))return Yr-1;return-1}function jt(_i,ia){let Yr;for(let Ba of _i){if(Yr===void 0){Yr=Ba;continue}ia(Ba,Yr)<0&&(Yr=Ba)}return Yr}function Xt(_i,ia){let Yr;for(let Ba of _i){if(Yr===void 0){Yr=Ba;continue}ia(Ba,Yr)>0&&(Yr=Ba)}return Yr}function nr(_i,ia){let Yr=!0,Ba,eo;for(let rs of _i)Yr?(Ba=rs,eo=rs,Yr=!1):ia(rs,Ba)<0?Ba=rs:ia(rs,eo)>0&&(eo=rs);return Yr?void 0:[Ba,eo]}function Ht(_i){return Array.from(_i)}function er(_i){let ia={};for(let[Yr,Ba]of _i)ia[Yr]=Ba;return ia}function ur(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++)===!1)return}function ir(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++)===!1)return!1;return!0}function Ot(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++))return!0;return!1}function*ar(_i,ia){let Yr=0;for(let Ba of _i)yield ia(Ba,Yr++)}function*Lr(_i,ia,Yr){ia===void 0?(ia=_i,_i=0,Yr=1):Yr===void 0&&(Yr=1);let Ba=Ir.rangeLength(_i,ia,Yr);for(let eo=0;eoBa&&eo>0||Yr-1;ia--)yield _i[ia]}function ti(_i){let ia=[],Yr=new Set,Ba=new Map;for(let Oo of _i)eo(Oo);for(let[Oo]of Ba)rs(Oo);return ia;function eo(Oo){let[da,cn]=Oo,Ss=Ba.get(cn);Ss?Ss.push(da):Ba.set(cn,[da])}function rs(Oo){if(Yr.has(Oo))return;Yr.add(Oo);let da=Ba.get(Oo);if(da)for(let cn of da)rs(cn);ia.push(Oo)}}function*Xr(_i,ia){let Yr=0;for(let Ba of _i)Yr++%ia===0&&(yield Ba)}We.StringExt=void 0,(function(_i){function ia(Oo,da,cn=0){let Ss=new Array(da.length);for(let is=0,Do=cn,sl=da.length;isda?1:0}_i.cmp=rs})(We.StringExt||(We.StringExt={}));function*Ki(_i,ia){if(ia<1)return;let Yr=_i[Symbol.iterator](),Ba;for(;0Ba[Symbol.iterator]()),Yr=ia.map(Ba=>Ba.next());for(;ir(Yr,Ba=>!Ba.done);Yr=ia.map(Ba=>Ba.next()))yield Yr.map(Ba=>Ba.value)}We.chain=oe,We.each=ur,We.empty=Ie,We.enumerate=Oe,We.every=ir,We.filter=Qe,We.find=dt,We.findIndex=Jt,We.map=ar,We.max=Xt,We.min=jt,We.minmax=nr,We.once=qr,We.range=Lr,We.reduce=de,We.repeat=Mr,We.retro=Vr,We.some=Ot,We.stride=Xr,We.take=Ki,We.toArray=Ht,We.toObject=er,We.topologicSort=ti,We.zip=Ia}))});var Q2=WS((J2,wj)=>{(function(We,oe){typeof J2=="object"&&typeof wj<"u"?oe(J2,lv()):typeof define=="function"&&define.amd?define(["exports","@lumino/algorithm"],oe):(We=typeof globalThis<"u"?globalThis:We||self,oe(We.lumino_coreutils={},We.lumino_algorithm))})(J2,(function(We,oe){"use strict";We.JSONExt=void 0,(function(nr){nr.emptyObject=Object.freeze({}),nr.emptyArray=Object.freeze([]);function Ht(Mr){return Mr===null||typeof Mr=="boolean"||typeof Mr=="number"||typeof Mr=="string"}nr.isPrimitive=Ht;function er(Mr){return Array.isArray(Mr)}nr.isArray=er;function ur(Mr){return!Ht(Mr)&&!er(Mr)}nr.isObject=ur;function ir(Mr,qr){if(Mr===qr)return!0;if(Ht(Mr)||Ht(qr))return!1;let Vr=er(Mr),ti=er(qr);return Vr!==ti?!1:Vr&&ti?ar(Mr,qr):Lr(Mr,qr)}nr.deepEqual=ir;function Ot(Mr){return Ht(Mr)?Mr:er(Mr)?Ir(Mr):de(Mr)}nr.deepCopy=Ot;function ar(Mr,qr){if(Mr===qr)return!0;if(Mr.length!==qr.length)return!1;for(let Vr=0,ti=Mr.length;Vr!0,this._plugins=new Map,this._services=new Map,Ht.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=Ht.validatePlugin)}get application(){return this._application}set application(Ht){if(this._application!==null)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=Ht}get deferredPlugins(){return Array.from(this._plugins).filter(([Ht,er])=>er.autoStart==="defer").map(([Ht,er])=>Ht)}getPluginDescription(Ht){var er,ur;return(ur=(er=this._plugins.get(Ht))===null||er===void 0?void 0:er.description)!==null&&ur!==void 0?ur:""}hasPlugin(Ht){return this._plugins.has(Ht)}isPluginActivated(Ht){var er,ur;return(ur=(er=this._plugins.get(Ht))===null||er===void 0?void 0:er.activated)!==null&&ur!==void 0?ur:!1}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(Ht){if(this._plugins.has(Ht.id))throw new TypeError(`Plugin '${Ht.id}' is already registered.`);if(!this._validatePlugin(Ht))throw new Error(`Plugin '${Ht.id}' is not valid.`);let er=Qe.createPluginData(Ht);Qe.ensureNoCycle(er,this._plugins,this._services),er.provides&&this._services.set(er.provides,er.id),this._plugins.set(er.id,er)}registerPlugins(Ht){for(let er of Ht)this.registerPlugin(er)}deregisterPlugin(Ht,er){let ur=this._plugins.get(Ht);if(ur){if(ur.activated&&!er)throw new Error(`Plugin '${Ht}' is still active.`);this._plugins.delete(Ht)}}async activatePlugin(Ht){let er=this._plugins.get(Ht);if(!er)throw new ReferenceError(`Plugin '${Ht}' is not registered.`);if(er.activated)return;if(er.promise)return er.promise;let ur=er.requires.map(Ot=>this.resolveRequiredService(Ot)),ir=er.optional.map(Ot=>this.resolveOptionalService(Ot));return er.promise=Promise.all([...ur,...ir]).then(Ot=>er.activate.apply(void 0,[this.application,...Ot])).then(Ot=>{er.service=Ot,er.activated=!0,er.promise=null}).catch(Ot=>{throw er.promise=null,Ot}),er.promise}async activatePlugins(Ht,er={}){switch(Ht){case"defer":{let ur=this.deferredPlugins.filter(ir=>this._plugins.get(ir).autoStart).map(ir=>this.activatePlugin(ir));await Promise.all(ur);break}case"startUp":{let ir=Qe.collectStartupPlugins(this._plugins,er).map(async Ot=>{try{return await this.activatePlugin(Ot)}catch(ar){console.error(`Plugin '${Ot}' failed to activate.`,ar)}});await Promise.all(ir);break}}}async deactivatePlugin(Ht){let er=this._plugins.get(Ht);if(!er)throw new ReferenceError(`Plugin '${Ht}' is not registered.`);if(!er.activated)return[];if(!er.deactivate)throw new TypeError(`Plugin '${Ht}'#deactivate() method missing`);let ur=Qe.findDependents(Ht,this._plugins,this._services),ir=ur.map(Ot=>this._plugins.get(Ot));for(let Ot of ir)if(!Ot.deactivate)throw new TypeError(`Plugin ${Ot.id}#deactivate() method missing (depends on ${Ht})`);for(let Ot of ir){let ar=[...Ot.requires,...Ot.optional].map(Lr=>{let Ir=this._services.get(Lr);return Ir?this._plugins.get(Ir).service:null});await Ot.deactivate(this.application,...ar),Ot.service=null,Ot.activated=!1}return ur.pop(),ur}async resolveRequiredService(Ht){let er=this._services.get(Ht);if(!er)throw new TypeError(`No provider for: ${Ht.name}.`);let ur=this._plugins.get(er);return ur.activated||await this.activatePlugin(er),ur.service}async resolveOptionalService(Ht){let er=this._services.get(Ht);if(!er)return null;let ur=this._plugins.get(er);if(!ur.activated)try{await this.activatePlugin(er)}catch(ir){return console.error(ir),null}return ur.service}}var Qe;(function(nr){class Ht{constructor(Lr){var Ir,de,Mr,qr;this._activated=!1,this._promise=null,this._service=null,this.id=Lr.id,this.description=(Ir=Lr.description)!==null&&Ir!==void 0?Ir:"",this.activate=Lr.activate,this.deactivate=(de=Lr.deactivate)!==null&&de!==void 0?de:null,this.provides=(Mr=Lr.provides)!==null&&Mr!==void 0?Mr:null,this.autoStart=(qr=Lr.autoStart)!==null&&qr!==void 0?qr:!1,this.requires=Lr.requires?Lr.requires.slice():[],this.optional=Lr.optional?Lr.optional.slice():[]}get activated(){return this._activated}set activated(Lr){this._activated=Lr}get service(){return this._service}set service(Lr){this._service=Lr}get promise(){return this._promise}set promise(Lr){this._promise=Lr}}function er(ar){return new Ht(ar)}nr.createPluginData=er;function ur(ar,Lr,Ir){let de=[...ar.requires,...ar.optional],Mr=Vr=>{if(Vr===ar.provides)return!0;let ti=Ir.get(Vr);if(!ti)return!1;let Xr=Lr.get(ti),Ki=[...Xr.requires,...Xr.optional];return Ki.length===0?!1:(qr.push(ti),Ki.some(Mr)?!0:(qr.pop(),!1))};if(!ar.provides||de.length===0)return;let qr=[ar.id];if(de.some(Mr))throw new ReferenceError(`Cycle detected: ${qr.join(" -> ")}.`)}nr.ensureNoCycle=ur;function ir(ar,Lr,Ir){let de=new Array,Mr=Ki=>{let Ia=Lr.get(Ki),_i=[...Ia.requires,...Ia.optional];de.push(..._i.reduce((ia,Yr)=>{let Ba=Ir.get(Yr);return Ba&&ia.push([Ki,Ba]),ia},[]))};for(let Ki of Lr.keys())Mr(Ki);let qr=de.filter(Ki=>Ki[1]===ar),Vr=0;for(;qr.length>Vr;){let Ki=qr.length,Ia=new Set(qr.map(_i=>_i[0]));for(let _i of Ia)de.filter(ia=>ia[1]===_i).forEach(ia=>{qr.includes(ia)||qr.push(ia)});Vr=Ki}let ti=oe.topologicSort(qr),Xr=ti.findIndex(Ki=>Ki===ar);return Xr===-1?[ar]:ti.slice(0,Xr+1)}nr.findDependents=ir;function Ot(ar,Lr){let Ir=new Set;for(let de of ar.keys())ar.get(de).autoStart===!0&&Ir.add(de);if(Lr.startPlugins)for(let de of Lr.startPlugins)Ir.add(de);if(Lr.ignorePlugins)for(let de of Lr.ignorePlugins)Ir.delete(de);return Array.from(Ir)}nr.collectStartupPlugins=Ot})(Qe||(Qe={}));class dt{constructor(){this.promise=new Promise((Ht,er)=>{this._resolve=Ht,this._reject=er})}resolve(Ht){let er=this._resolve;er(Ht)}reject(Ht){let er=this._reject;er(Ht)}}class Jt{constructor(Ht,er){this.name=Ht,this.description=er??"",this._tokenStructuralPropertyT=null}}function jt(nr){let Ht=0;for(let er=0,ur=nr.length;er>>0),nr[er]=Ht&255,Ht>>>=8}We.Random=void 0,(function(nr){nr.getRandomValues=(()=>{let Ht=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return Ht&&typeof Ht.getRandomValues=="function"?function(ur){return Ht.getRandomValues(ur)}:jt})()})(We.Random||(We.Random={}));function Xt(nr){let Ht=new Uint8Array(16),er=new Array(256);for(let ur=0;ur<16;++ur)er[ur]="0"+ur.toString(16);for(let ur=16;ur<256;++ur)er[ur]=ur.toString(16);return function(){return nr(Ht),Ht[6]=64|Ht[6]&15,Ht[8]=128|Ht[8]&63,er[Ht[0]]+er[Ht[1]]+er[Ht[2]]+er[Ht[3]]+"-"+er[Ht[4]]+er[Ht[5]]+"-"+er[Ht[6]]+er[Ht[7]]+"-"+er[Ht[8]]+er[Ht[9]]+"-"+er[Ht[10]]+er[Ht[11]]+er[Ht[12]]+er[Ht[13]]+er[Ht[14]]+er[Ht[15]]}}We.UUID=void 0,(function(nr){nr.uuid4=Xt(We.Random.getRandomValues)})(We.UUID||(We.UUID={})),We.MimeData=Ie,We.PluginRegistry=Oe,We.PromiseDelegate=dt,We.Token=Jt}))});var hU=WS((fU,pw)=>{(function(We,oe){typeof pw=="object"&&pw.exports?pw.exports=oe():We.moduleName=oe()})(typeof self<"u"?self:fU,()=>{"use strict";var We=(()=>{var oe=Object.create,Ie=Object.defineProperty,Oe=Object.defineProperties,Qe=Object.getOwnPropertyDescriptor,dt=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertyNames,jt=Object.getOwnPropertySymbols,Xt=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable,er=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),ur=e=>{throw TypeError(e)},ir=(e,r,t)=>r in e?Ie(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ot=(e,r)=>{for(var t in r||(r={}))nr.call(r,t)&&ir(e,t,r[t]);if(jt)for(var t of jt(r))Ht.call(r,t)&&ir(e,t,r[t]);return e},ar=(e,r)=>Oe(e,dt(r)),Lr=(e,r)=>{var t={};for(var i in e)nr.call(e,i)&&r.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&jt)for(var i of jt(e))r.indexOf(i)<0&&Ht.call(e,i)&&(t[i]=e[i]);return t},Ir=(e,r,t)=>function(){if(t)throw t[0];try{return e&&(r=(0,e[Jt(e)[0]])(e=0)),r}catch(a){throw t=[a],a}},de=(e,r)=>function(){try{return r||(0,e[Jt(e)[0]])((r={exports:{}}).exports,r),r.exports}catch(i){throw r=0,i}},Mr=(e,r)=>{for(var t in r)Ie(e,t,{get:r[t],enumerable:!0})},qr=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Jt(r))!nr.call(e,a)&&a!==t&&Ie(e,a,{get:()=>r[a],enumerable:!(i=Qe(r,a))||i.enumerable});return e},Vr=(e,r,t)=>(t=e!=null?oe(Xt(e)):{},qr(r||!e||!e.__esModule?Ie(t,"default",{value:e,enumerable:!0}):t,e)),ti=e=>qr(Ie({},"__esModule",{value:!0}),e),Xr=(e,r,t)=>new Promise((i,a)=>{var o=n=>{try{l(t.next(n))}catch(u){a(u)}},s=n=>{try{l(t.throw(n))}catch(u){a(u)}},l=n=>n.done?i(n.value):Promise.resolve(n.value).then(o,s);l((t=t.apply(e,r)).next())}),Ki=function(e,r){this[0]=e,this[1]=r},Ia=e=>{var r=e[er("asyncIterator")],t=!1,i,a={};return r==null?(r=e[er("iterator")](),i=o=>a[o]=s=>r[o](s)):(r=r.call(e),i=o=>a[o]=s=>{if(t){if(t=!1,o==="throw")throw s;return s}return t=!0,{done:!1,value:new Ki(new Promise(l=>{var n=r[o](s);n instanceof Object||ur("Object expected"),l(n)}),1)}}),a[er("iterator")]=()=>a,i("next"),"throw"in r?i("throw"):a.throw=o=>{throw o},"return"in r&&i("return"),a},_i=de({"src/version.js"(e){"use strict";e.version="4.1.1"}}),ia=de({"node_modules/native-promise-only/lib/npo.src.js"(e,r){(function(i,a,o){a[i]=a[i]||o(),typeof r<"u"&&r.exports&&(r.exports=a[i])})("Promise",typeof window<"u"?window:e,function(){"use strict";var i,a,o,s=Object.prototype.toString,l=typeof setImmediate<"u"?function(x){return setImmediate(x)}:setTimeout;try{Object.defineProperty({},"x",{}),i=function(x,S,M,C){return Object.defineProperty(x,S,{value:M,writable:!0,configurable:C!==!1})}}catch{i=function(S,M,C){return S[M]=C,S}}o=(function(){var x,S,M;function C(w,k){this.fn=w,this.self=k,this.next=void 0}return{add:function(k,A){M=new C(k,A),S?S.next=M:x=M,S=M,M=void 0},drain:function(){var k=x;for(x=S=a=void 0;k;)k.fn.call(k.self),k=k.next}}})();function n(v,x){o.add(v,x),a||(a=l(o.drain))}function u(v){var x,S=typeof v;return v!=null&&(S=="object"||S=="function")&&(x=v.then),typeof x=="function"?x:!1}function c(){for(var v=0;v0&&n(c,S))}catch(M){d.call(new g(S),M)}}}function d(v){var x=this;x.triggered||(x.triggered=!0,x.def&&(x=x.def),x.msg=v,x.state=2,x.chain.length>0&&n(c,x))}function p(v,x,S,M){for(var C=0;Che?1:re>=he?0:NaN}t.descending=function(re,he){return here?1:he>=re?0:NaN},t.min=function(re,he){var we=-1,Le=re.length,Re,Ne;if(arguments.length===1){for(;++we=Ne){Re=Ne;break}for(;++weNe&&(Re=Ne)}else{for(;++we=Ne){Re=Ne;break}for(;++weNe&&(Re=Ne)}return Re},t.max=function(re,he){var we=-1,Le=re.length,Re,Ne;if(arguments.length===1){for(;++we=Ne){Re=Ne;break}for(;++weRe&&(Re=Ne)}else{for(;++we=Ne){Re=Ne;break}for(;++weRe&&(Re=Ne)}return Re},t.extent=function(re,he){var we=-1,Le=re.length,Re,Ne,ut;if(arguments.length===1){for(;++we=Ne){Re=ut=Ne;break}for(;++weNe&&(Re=Ne),ut=Ne){Re=ut=Ne;break}for(;++weNe&&(Re=Ne),ut1)return ut/(_t-1)},t.deviation=function(){var re=t.variance.apply(this,arguments);return re&&Math.sqrt(re)};function m(re){return{left:function(he,we,Le,Re){for(arguments.length<3&&(Le=0),arguments.length<4&&(Re=he.length);Le>>1;re(he[Ne],we)<0?Le=Ne+1:Re=Ne}return Le},right:function(he,we,Le,Re){for(arguments.length<3&&(Le=0),arguments.length<4&&(Re=he.length);Le>>1;re(he[Ne],we)>0?Re=Ne:Le=Ne+1}return Le}}}var y=m(d);t.bisectLeft=y.left,t.bisect=t.bisectRight=y.right,t.bisector=function(re){return m(re.length===1?function(he,we){return d(re(he),we)}:re)},t.shuffle=function(re,he,we){(Le=arguments.length)<3&&(we=re.length,Le<2&&(he=0));for(var Le=we-he,Re,Ne;Le;)Ne=Math.random()*Le--|0,Re=re[Le+he],re[Le+he]=re[Ne+he],re[Ne+he]=Re;return re},t.permute=function(re,he){for(var we=he.length,Le=new Array(we);we--;)Le[we]=re[he[we]];return Le},t.pairs=function(re){for(var he=0,we=re.length-1,Le,Re=re[0],Ne=new Array(we<0?0:we);he=0;)for(ut=re[he],we=ut.length;--we>=0;)Ne[--Re]=ut[we];return Ne};var v=Math.abs;t.range=function(re,he,we){if(arguments.length<3&&(we=1,arguments.length<2&&(he=re,re=0)),(he-re)/we===1/0)throw new Error("infinite range");var Le=[],Re=x(v(we)),Ne=-1,ut;if(re*=Re,he*=Re,we*=Re,we<0)for(;(ut=re+we*++Ne)>he;)Le.push(ut/Re);else for(;(ut=re+we*++Ne)=he.length)return Re?Re.call(re,_t):Le?_t.sort(Le):_t;for(var Rt=-1,lr=_t.length,sr=he[Ft++],Fr,Or,hr,wr=new M,Cr;++Rt=he.length)return et;var Ft=[],Rt=we[_t++];return et.forEach(function(lr,sr){Ft.push({key:lr,values:ut(sr,_t)})}),Rt?Ft.sort(function(lr,sr){return Rt(lr.key,sr.key)}):Ft}return re.map=function(et,_t){return Ne(_t,et,0)},re.entries=function(et){return ut(Ne(t.map,et,0),0)},re.key=function(et){return he.push(et),re},re.sortKeys=function(et){return we[he.length-1]=et,re},re.sortValues=function(et){return Le=et,re},re.rollup=function(et){return Re=et,re},re},t.set=function(re){var he=new R;if(re)for(var we=0,Le=re.length;we=0&&(Le=re.slice(we+1),re=re.slice(0,we)),re)return arguments.length<2?this[re].on(Le):this[re].on(Le,he);if(arguments.length===2){if(he==null)for(re in this)this.hasOwnProperty(re)&&this[re].on(Le,null);return this}};function G(re){var he=[],we=new M;function Le(){for(var Re=he,Ne=-1,ut=Re.length,et;++Ne=0&&(we=re.slice(0,he))!=="xmlns"&&(re=re.slice(he+1)),te.hasOwnProperty(we)?{space:te[we],local:re}:re}},j.attr=function(re,he){if(arguments.length<2){if(typeof re=="string"){var we=this.node();return re=t.ns.qualify(re),re.local?we.getAttributeNS(re.space,re.local):we.getAttribute(re)}for(he in re)this.each(ne(he,re[he]));return this}return this.each(ne(re,he))};function ne(re,he){re=t.ns.qualify(re);function we(){this.removeAttribute(re)}function Le(){this.removeAttributeNS(re.space,re.local)}function Re(){this.setAttribute(re,he)}function Ne(){this.setAttributeNS(re.space,re.local,he)}function ut(){var _t=he.apply(this,arguments);_t==null?this.removeAttribute(re):this.setAttribute(re,_t)}function et(){var _t=he.apply(this,arguments);_t==null?this.removeAttributeNS(re.space,re.local):this.setAttributeNS(re.space,re.local,_t)}return he==null?re.local?Le:we:typeof he=="function"?re.local?et:ut:re.local?Ne:Re}function se(re){return re.trim().replace(/\s+/g," ")}j.classed=function(re,he){if(arguments.length<2){if(typeof re=="string"){var we=this.node(),Le=(re=ce(re)).length,Re=-1;if(he=we.classList){for(;++Re=0;)(Ne=we[Le])&&(Re&&Re!==Ne.nextSibling&&Re.parentNode.insertBefore(Ne,Re),Re=Ne);return this},j.sort=function(re){re=ue.apply(this,arguments);for(var he=-1,we=this.length;++he=he&&(he=Re+1);!(_t=ut[he])&&++he0&&(re=re.slice(0,Re));var ut=Ze.get(re);ut&&(re=ut,Ne=vt);function et(){var Rt=this[Le];Rt&&(this.removeEventListener(re,Rt,Rt.$),delete this[Le])}function _t(){var Rt=Ne(he,a(arguments));et.call(this),this.addEventListener(re,this[Le]=Rt,Rt.$=we),Rt._=he}function Ft(){var Rt=new RegExp("^__on([^.]+)"+t.requote(re)+"$"),lr;for(var sr in this)if(lr=sr.match(Rt)){var Fr=this[sr];this.removeEventListener(lr[1],Fr,Fr.$),delete this[sr]}}return Re?he?_t:et:he?B:Ft}var Ze=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});o&&Ze.forEach(function(re){"on"+re in o&&Ze.remove(re)});function Ke(re,he){return function(we){var Le=t.event;t.event=we,he[0]=this.__data__;try{re.apply(this,he)}finally{t.event=Le}}}function vt(re,he){var we=Ke(re,he);return function(Le){var Re=this,Ne=Le.relatedTarget;(!Ne||Ne!==Re&&!(Ne.compareDocumentPosition(Re)&8))&&we.call(Re,Le)}}var xt,Pt=0;function mt(re){var he=".dragsuppress-"+ ++Pt,we="click"+he,Le=t.select(l(re)).on("touchmove"+he,W).on("dragstart"+he,W).on("selectstart"+he,W);if(xt==null&&(xt="onselectstart"in re?!1:I(re.style,"userSelect")),xt){var Re=s(re).style,Ne=Re[xt];Re[xt]="none"}return function(ut){if(Le.on(he,null),xt&&(Re[xt]=Ne),ut){var et=function(){Le.on(we,null)};Le.on(we,function(){W(),et()},!0),setTimeout(et,0)}}}t.mouse=function(re){return lt(re,X())};var Mt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function lt(re,he){he.changedTouches&&(he=he.changedTouches[0]);var we=re.ownerSVGElement||re;if(we.createSVGPoint){var Le=we.createSVGPoint();if(Mt<0){var Re=l(re);if(Re.scrollX||Re.scrollY){we=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var Ne=we[0][0].getScreenCTM();Mt=!(Ne.f||Ne.e),we.remove()}}return Mt?(Le.x=he.pageX,Le.y=he.pageY):(Le.x=he.clientX,Le.y=he.clientY),Le=Le.matrixTransform(re.getScreenCTM().inverse()),[Le.x,Le.y]}var ut=re.getBoundingClientRect();return[he.clientX-ut.left-re.clientLeft,he.clientY-ut.top-re.clientTop]}t.touch=function(re,he,we){if(arguments.length<3&&(we=he,he=X().changedTouches),he){for(var Le=0,Re=he.length,Ne;Le0?1:re<0?-1:0}function at(re,he,we){return(he[0]-re[0])*(we[1]-re[1])-(he[1]-re[1])*(we[0]-re[0])}function rt(re){return re>1?0:re<-1?_e:Math.acos(re)}function ft(re){return re>1?Ee:re<-1?-Ee:Math.asin(re)}function At(re){return((re=Math.exp(re))-1/re)/2}function ht(re){return((re=Math.exp(re))+1/re)/2}function Gt(re){return((re=Math.exp(2*re))-1)/(re+1)}function fr(re){return(re=Math.sin(re/2))*re}var gt=Math.SQRT2,yt=2,kt=4;t.interpolateZoom=function(re,he){var we=re[0],Le=re[1],Re=re[2],Ne=he[0],ut=he[1],et=he[2],_t=Ne-we,Ft=ut-Le,Rt=_t*_t+Ft*Ft,lr,sr;if(Rt0&&(fa=fa.transition().duration(ut)),fa.call(jr.event)}function qa(){wr&&wr.domain(hr.range().map(function(fa){return(fa-re.x)/re.k}).map(hr.invert)),Nr&&Nr.domain(Cr.range().map(function(fa){return(fa-re.y)/re.k}).map(Cr.invert))}function Fa(fa){et++||fa({type:"zoomstart"})}function Nn(fa){qa(),fa({type:"zoom",scale:re.k,translate:[re.x,re.y]})}function ka(fa){--et||(fa({type:"zoomend"}),we=null)}function Sn(){var fa=this,jn=Or.of(fa,arguments),Gn=0,Po=t.select(l(fa)).on(Ft,Tl).on(Rt,Fl),As=Ar(t.mouse(fa)),Qs=mt(fa);Pn.call(fa),Fa(jn);function Tl(){Gn=1,aa(t.mouse(fa),As),Nn(jn)}function Fl(){Po.on(Ft,null).on(Rt,null),Qs(Gn),ka(jn)}}function ko(){var fa=this,jn=Or.of(fa,arguments),Gn={},Po=0,As,Qs=".zoom-"+t.event.changedTouches[0].identifier,Tl="touchmove"+Qs,Fl="touchend"+Qs,su=[],bt=t.select(fa),dr=mt(fa);Kr(),Fa(jn),bt.on(_t,null).on(sr,Kr);function _r(){var si=t.touches(fa);return As=re.k,si.forEach(function(Ni){Ni.identifier in Gn&&(Gn[Ni.identifier]=Ar(Ni))}),si}function Kr(){var si=t.event.target;t.select(si).on(Tl,ci).on(Fl,yi),su.push(si);for(var Ni=t.event.changedTouches,Ji=0,Qi=Ni.length;Ji1){var Wa=ra[0],xa=ra[1],Pi=Wa[0]-xa[0],Hr=Wa[1]-xa[1];Po=Pi*Pi+Hr*Hr}}function ci(){var si=t.touches(fa),Ni,Ji,Qi,ra;Pn.call(fa);for(var mn=0,Wa=si.length;mn1?1:he,we=we<0?0:we>1?1:we,Re=we<=.5?we*(1+he):we+he-we*he,Le=2*we-Re;function Ne(et){return et>360?et-=360:et<0&&(et+=360),et<60?Le+(Re-Le)*et/60:et<180?Re:et<240?Le+(Re-Le)*(240-et)/60:Le}function ut(et){return Math.round(Ne(et)*255)}return new Jr(ut(re+120),ut(re),ut(re-120))}t.hcl=Ur;function Ur(re,he,we){return this instanceof Ur?(this.h=+re,this.c=+he,void(this.l=+we)):arguments.length<2?re instanceof Ur?new Ur(re.h,re.c,re.l):re instanceof Qr?bi(re.l,re.a,re.b):bi((re=Yt((re=t.rgb(re)).r,re.g,re.b)).l,re.a,re.b):new Ur(re,he,we)}var Ai=Ur.prototype=new mr;Ai.brighter=function(re){return new Ur(this.h,this.c,Math.min(100,this.l+ea*(arguments.length?re:1)))},Ai.darker=function(re){return new Ur(this.h,this.c,Math.max(0,this.l-ea*(arguments.length?re:1)))},Ai.rgb=function(){return oi(this.h,this.c,this.l).rgb()};function oi(re,he,we){return isNaN(re)&&(re=0),isNaN(he)&&(he=0),new Qr(we,Math.cos(re*=De)*he,Math.sin(re)*he)}t.lab=Qr;function Qr(re,he,we){return this instanceof Qr?(this.l=+re,this.a=+he,void(this.b=+we)):arguments.length<2?re instanceof Qr?new Qr(re.l,re.a,re.b):re instanceof Ur?oi(re.h,re.c,re.l):Yt((re=Jr(re)).r,re.g,re.b):new Qr(re,he,we)}var ea=18,$i=.95047,ja=1,ya=1.08883,pa=Qr.prototype=new mr;pa.brighter=function(re){return new Qr(Math.min(100,this.l+ea*(arguments.length?re:1)),this.a,this.b)},pa.darker=function(re){return new Qr(Math.max(0,this.l-ea*(arguments.length?re:1)),this.a,this.b)},pa.rgb=function(){return xi(this.l,this.a,this.b)};function xi(re,he,we){var Le=(re+16)/116,Re=Le+he/500,Ne=Le-we/200;return Re=Ua(Re)*$i,Le=Ua(Le)*ja,Ne=Ua(Ne)*ya,new Jr(pi(3.2404542*Re-1.5371385*Le-.4985314*Ne),pi(-.969266*Re+1.8760108*Le+.041556*Ne),pi(.0556434*Re-.2040259*Le+1.0572252*Ne))}function bi(re,he,we){return re>0?new Ur(Math.atan2(we,he)*Je,Math.sqrt(he*he+we*we),re):new Ur(NaN,NaN,re)}function Ua(re){return re>.206893034?re*re*re:(re-4/29)/7.787037}function dn(re){return re>.008856?Math.pow(re,1/3):7.787037*re+4/29}function pi(re){return Math.round(255*(re<=.00304?12.92*re:1.055*Math.pow(re,1/2.4)-.055))}t.rgb=Jr;function Jr(re,he,we){return this instanceof Jr?(this.r=~~re,this.g=~~he,void(this.b=~~we)):arguments.length<2?re instanceof Jr?new Jr(re.r,re.g,re.b):zt(""+re,Jr,Tr):new Jr(re,he,we)}function Be(re){return new Jr(re>>16,re>>8&255,re&255)}function Fe(re){return Be(re)+""}var Et=Jr.prototype=new mr;Et.brighter=function(re){re=Math.pow(.7,arguments.length?re:1);var he=this.r,we=this.g,Le=this.b,Re=30;return!he&&!we&&!Le?new Jr(Re,Re,Re):(he&&he>4,Le=Le>>4|Le,Re=_t&240,Re=Re>>4|Re,Ne=_t&15,Ne=Ne<<4|Ne):re.length===7&&(Le=(_t&16711680)>>16,Re=(_t&65280)>>8,Ne=_t&255)),he(Le,Re,Ne))}function Wt(re,he,we){var Le=Math.min(re/=255,he/=255,we/=255),Re=Math.max(re,he,we),Ne=Re-Le,ut,et,_t=(Re+Le)/2;return Ne?(et=_t<.5?Ne/(Re+Le):Ne/(2-Re-Le),re==Re?ut=(he-we)/Ne+(he0&&_t<1?0:ut),new br(ut,et,_t)}function Yt(re,he,we){re=ze(re),he=ze(he),we=ze(we);var Le=dn((.4124564*re+.3575761*he+.1804375*we)/$i),Re=dn((.2126729*re+.7151522*he+.072175*we)/ja),Ne=dn((.0193339*re+.119192*he+.9503041*we)/ya);return Qr(116*Re-16,500*(Le-Re),200*(Re-Ne))}function ze(re){return(re/=255)<=.04045?re/12.92:Math.pow((re+.055)/1.055,2.4)}function tt(re){var he=parseFloat(re);return re.charAt(re.length-1)==="%"?Math.round(he*2.55):he}var ct=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ct.forEach(function(re,he){ct.set(re,Be(he))});function wt(re){return typeof re=="function"?re:function(){return re}}t.functor=wt,t.xhr=Nt(P);function Nt(re){return function(he,we,Le){return arguments.length===2&&typeof we=="function"&&(Le=we,we=null),It(he,we,re,Le)}}function It(re,he,we,Le){var Re={},Ne=t.dispatch("beforesend","progress","load","error"),ut={},et=new XMLHttpRequest,_t=null;self.XDomainRequest&&!("withCredentials"in et)&&/^(http(s)?:)?\/\//.test(re)&&(et=new XDomainRequest),"onload"in et?et.onload=et.onerror=Ft:et.onreadystatechange=function(){et.readyState>3&&Ft()};function Ft(){var Rt=et.status,lr;if(!Rt&&qt(et)||Rt>=200&&Rt<300||Rt===304){try{lr=we.call(Re,et)}catch(sr){Ne.error.call(Re,sr);return}Ne.load.call(Re,lr)}else Ne.error.call(Re,et)}return et.onprogress=function(Rt){var lr=t.event;t.event=Rt;try{Ne.progress.call(Re,et)}finally{t.event=lr}},Re.header=function(Rt,lr){return Rt=(Rt+"").toLowerCase(),arguments.length<2?ut[Rt]:(lr==null?delete ut[Rt]:ut[Rt]=lr+"",Re)},Re.mimeType=function(Rt){return arguments.length?(he=Rt==null?null:Rt+"",Re):he},Re.responseType=function(Rt){return arguments.length?(_t=Rt,Re):_t},Re.response=function(Rt){return we=Rt,Re},["get","post"].forEach(function(Rt){Re[Rt]=function(){return Re.send.apply(Re,[Rt].concat(a(arguments)))}}),Re.send=function(Rt,lr,sr){if(arguments.length===2&&typeof lr=="function"&&(sr=lr,lr=null),et.open(Rt,re,!0),he!=null&&!("accept"in ut)&&(ut.accept=he+",*/*"),et.setRequestHeader)for(var Fr in ut)et.setRequestHeader(Fr,ut[Fr]);return he!=null&&et.overrideMimeType&&et.overrideMimeType(he),_t!=null&&(et.responseType=_t),sr!=null&&Re.on("error",sr).on("load",function(Or){sr(null,Or)}),Ne.beforesend.call(Re,et),et.send(lr??null),Re},Re.abort=function(){return et.abort(),Re},t.rebind(Re,Ne,"on"),Le==null?Re:Re.get(Zt(Le))}function Zt(re){return re.length===1?function(he,we){re(he==null?we:null)}:re}function qt(re){var he=re.responseType;return he&&he!=="text"?re.response:re.responseText}t.dsv=function(re,he){var we=new RegExp('["'+re+` -]`),Le=re.charCodeAt(0);function Re(Ft,Rt,lr){arguments.length<3&&(lr=Rt,Rt=null);var sr=It(Ft,he,Rt==null?Ne:ut(Rt),lr);return sr.row=function(Fr){return arguments.length?sr.response((Rt=Fr)==null?Ne:ut(Fr)):Rt},sr}function Ne(Ft){return Re.parse(Ft.responseText)}function ut(Ft){return function(Rt){return Re.parse(Rt.responseText,Ft)}}Re.parse=function(Ft,Rt){var lr;return Re.parseRows(Ft,function(sr,Fr){if(lr)return lr(sr,Fr-1);var Or=function(hr){for(var wr={},Cr=sr.length,Nr=0;Nr=Or)return sr;if(Nr)return Nr=!1,lr;var Ci=hr;if(Ft.charCodeAt(Ci)===34){for(var Gi=Ci;Gi++()=>{try{return oe||We((oe={exports:{}}).exports,oe),oe.exports}catch(Pe){throw oe=0,Pe}};var Rce=(We,oe,Pe,Ne)=>{if(oe&&typeof oe=="object"||typeof oe=="function")for(let Ze of Fce(oe))!Ice.call(We,Ze)&&Ze!==Pe&&xj(We,Ze,{get:()=>oe[Ze],enumerable:!(Ne=Lce(oe,Ze))||Ne.enumerable});return We};var dp=(We,oe,Pe)=>(Pe=We!=null?Dce(Pce(We)):{},Rce(oe||!We||!We.__esModule?xj(Pe,"default",{value:We,enumerable:!0}):Pe,We));var uv=WS((K2,bj)=>{(function(We,oe){typeof K2=="object"&&typeof bj<"u"?oe(K2):typeof define=="function"&&define.amd?define(["exports"],oe):(We=typeof globalThis<"u"?globalThis:We||self,oe(We.lumino_algorithm={}))})(K2,(function(We){"use strict";We.ArrayExt=void 0,(function(_i){function ia(Ta,La,ki=0,ri=-1){let Ri=Ta.length;if(Ri===0)return-1;ki<0?ki=Math.max(0,ki+Ri):ki=Math.min(ki,Ri-1),ri<0?ri=Math.max(0,ri+Ri):ri=Math.min(ri,Ri-1);let Na;ri0;){let Jo=Xo>>1,ta=xn+Jo;ki(Ta[ta],La)<0?(xn=ta+1,Xo-=Jo+1):Xo=Jo}return xn}_i.lowerBound=da;function cn(Ta,La,ki,ri=0,Ri=-1){let Na=Ta.length;if(Na===0)return 0;ri<0?ri=Math.max(0,ri+Na):ri=Math.min(ri,Na-1),Ri<0?Ri=Math.max(0,Ri+Na):Ri=Math.min(Ri,Na-1);let xn=ri,Xo=Ri-ri+1;for(;Xo>0;){let Jo=Xo>>1,ta=xn+Jo;ki(Ta[ta],La)>0?Xo=Jo:(xn=ta+1,Xo-=Jo+1)}return xn}_i.upperBound=cn;function Es(Ta,La,ki){if(Ta===La)return!0;if(Ta.length!==La.length)return!1;for(let ri=0,Ri=Ta.length;ri=Na&&(ki=Ri<0?Na-1:Na),ri===void 0?ri=Ri<0?-1:Na:ri<0?ri=Math.max(ri+Na,Ri<0?-1:0):ri>=Na&&(ri=Ri<0?Na-1:Na);let xn;Ri<0&&ri>=ki||Ri>0&&ki>=ri?xn=0:Ri<0?xn=Math.floor((ri-ki+1)/Ri+1):xn=Math.floor((ri-ki-1)/Ri+1);let Xo=[];for(let Jo=0;Jo=ri))return;let Na=ri-ki+1;if(La>0?La=La%Na:La<0&&(La=(La%Na+Na)%Na),La===0)return;let xn=ki+La;sl(Ta,ki,xn-1),sl(Ta,xn,ri),sl(Ta,ki,ri)}_i.rotate=cu;function nh(Ta,La,ki=0,ri=-1){let Ri=Ta.length;if(Ri===0)return;ki<0?ki=Math.max(0,ki+Ri):ki=Math.min(ki,Ri-1),ri<0?ri=Math.max(0,ri+Ri):ri=Math.min(ri,Ri-1);let Na;riLa;--Ri)Ta[Ri]=Ta[Ri-1];Ta[La]=ki}_i.insert=s1;function u0(Ta,La){let ki=Ta.length;if(La<0&&(La+=ki),La<0||La>=ki)return;let ri=Ta[La];for(let Ri=La+1;Ri=ki&&xn<=ri&&Ta[xn]===La||ri=ki)&&Ta[xn]===La?Na++:Na>0&&(Ta[xn-Na]=Ta[xn]);return Na>0&&(Ta.length=Ri-Na),Na}_i.removeAllOf=mw;function c0(Ta,La,ki=0,ri=-1){let Ri,Na=Ba(Ta,La,ki,ri);return Na!==-1&&(Ri=u0(Ta,Na)),{index:Na,value:Ri}}_i.removeFirstWhere=c0;function fn(Ta,La,ki=-1,ri=0){let Ri,Na=eo(Ta,La,ki,ri);return Na!==-1&&(Ri=u0(Ta,Na)),{index:Na,value:Ri}}_i.removeLastWhere=fn;function us(Ta,La,ki=0,ri=-1){let Ri=Ta.length;if(Ri===0)return 0;ki<0?ki=Math.max(0,ki+Ri):ki=Math.min(ki,Ri-1),ri<0?ri=Math.max(0,ri+Ri):ri=Math.min(ri,Ri-1);let Na=0;for(let xn=0;xn=ki&&xn<=ri&&La(Ta[xn],xn)||ri=ki)&&La(Ta[xn],xn)?Na++:Na>0&&(Ta[xn-Na]=Ta[xn]);return Na>0&&(Ta.length=Ri-Na),Na}_i.removeAllWhere=us})(We.ArrayExt||(We.ArrayExt={}));function*oe(..._i){for(let ia of _i)yield*ia}function*Pe(){}function*Ne(_i,ia=0){for(let Yr of _i)yield[ia++,Yr]}function*Ze(_i,ia){let Yr=0;for(let Ba of _i)ia(Ba,Yr++)&&(yield Ba)}function ct(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++))return Ba}function Xt(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++))return Yr-1;return-1}function Ot(_i,ia){let Yr;for(let Ba of _i){if(Yr===void 0){Yr=Ba;continue}ia(Ba,Yr)<0&&(Yr=Ba)}return Yr}function Zt(_i,ia){let Yr;for(let Ba of _i){if(Yr===void 0){Yr=Ba;continue}ia(Ba,Yr)>0&&(Yr=Ba)}return Yr}function nr(_i,ia){let Yr=!0,Ba,eo;for(let rs of _i)Yr?(Ba=rs,eo=rs,Yr=!1):ia(rs,Ba)<0?Ba=rs:ia(rs,eo)>0&&(eo=rs);return Yr?void 0:[Ba,eo]}function Gt(_i){return Array.from(_i)}function er(_i){let ia={};for(let[Yr,Ba]of _i)ia[Yr]=Ba;return ia}function ur(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++)===!1)return}function ir(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++)===!1)return!1;return!0}function Nt(_i,ia){let Yr=0;for(let Ba of _i)if(ia(Ba,Yr++))return!0;return!1}function*ar(_i,ia){let Yr=0;for(let Ba of _i)yield ia(Ba,Yr++)}function*Lr(_i,ia,Yr){ia===void 0?(ia=_i,_i=0,Yr=1):Yr===void 0&&(Yr=1);let Ba=Ir.rangeLength(_i,ia,Yr);for(let eo=0;eoBa&&eo>0||Yr-1;ia--)yield _i[ia]}function ti(_i){let ia=[],Yr=new Set,Ba=new Map;for(let Oo of _i)eo(Oo);for(let[Oo]of Ba)rs(Oo);return ia;function eo(Oo){let[da,cn]=Oo,Es=Ba.get(cn);Es?Es.push(da):Ba.set(cn,[da])}function rs(Oo){if(Yr.has(Oo))return;Yr.add(Oo);let da=Ba.get(Oo);if(da)for(let cn of da)rs(cn);ia.push(Oo)}}function*Xr(_i,ia){let Yr=0;for(let Ba of _i)Yr++%ia===0&&(yield Ba)}We.StringExt=void 0,(function(_i){function ia(Oo,da,cn=0){let Es=new Array(da.length);for(let is=0,Do=cn,sl=da.length;isda?1:0}_i.cmp=rs})(We.StringExt||(We.StringExt={}));function*Ki(_i,ia){if(ia<1)return;let Yr=_i[Symbol.iterator](),Ba;for(;0Ba[Symbol.iterator]()),Yr=ia.map(Ba=>Ba.next());for(;ir(Yr,Ba=>!Ba.done);Yr=ia.map(Ba=>Ba.next()))yield Yr.map(Ba=>Ba.value)}We.chain=oe,We.each=ur,We.empty=Pe,We.enumerate=Ne,We.every=ir,We.filter=Ze,We.find=ct,We.findIndex=Xt,We.map=ar,We.max=Zt,We.min=Ot,We.minmax=nr,We.once=qr,We.range=Lr,We.reduce=de,We.repeat=Mr,We.retro=Vr,We.some=Nt,We.stride=Xr,We.take=Ki,We.toArray=Gt,We.toObject=er,We.topologicSort=ti,We.zip=Ia}))});var Q2=WS((J2,wj)=>{(function(We,oe){typeof J2=="object"&&typeof wj<"u"?oe(J2,uv()):typeof define=="function"&&define.amd?define(["exports","@lumino/algorithm"],oe):(We=typeof globalThis<"u"?globalThis:We||self,oe(We.lumino_coreutils={},We.lumino_algorithm))})(J2,(function(We,oe){"use strict";We.JSONExt=void 0,(function(nr){nr.emptyObject=Object.freeze({}),nr.emptyArray=Object.freeze([]);function Gt(Mr){return Mr===null||typeof Mr=="boolean"||typeof Mr=="number"||typeof Mr=="string"}nr.isPrimitive=Gt;function er(Mr){return Array.isArray(Mr)}nr.isArray=er;function ur(Mr){return!Gt(Mr)&&!er(Mr)}nr.isObject=ur;function ir(Mr,qr){if(Mr===qr)return!0;if(Gt(Mr)||Gt(qr))return!1;let Vr=er(Mr),ti=er(qr);return Vr!==ti?!1:Vr&&ti?ar(Mr,qr):Lr(Mr,qr)}nr.deepEqual=ir;function Nt(Mr){return Gt(Mr)?Mr:er(Mr)?Ir(Mr):de(Mr)}nr.deepCopy=Nt;function ar(Mr,qr){if(Mr===qr)return!0;if(Mr.length!==qr.length)return!1;for(let Vr=0,ti=Mr.length;Vr!0,this._plugins=new Map,this._services=new Map,Gt.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=Gt.validatePlugin)}get application(){return this._application}set application(Gt){if(this._application!==null)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=Gt}get deferredPlugins(){return Array.from(this._plugins).filter(([Gt,er])=>er.autoStart==="defer").map(([Gt,er])=>Gt)}getPluginDescription(Gt){var er,ur;return(ur=(er=this._plugins.get(Gt))===null||er===void 0?void 0:er.description)!==null&&ur!==void 0?ur:""}hasPlugin(Gt){return this._plugins.has(Gt)}isPluginActivated(Gt){var er,ur;return(ur=(er=this._plugins.get(Gt))===null||er===void 0?void 0:er.activated)!==null&&ur!==void 0?ur:!1}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(Gt){if(this._plugins.has(Gt.id))throw new TypeError(`Plugin '${Gt.id}' is already registered.`);if(!this._validatePlugin(Gt))throw new Error(`Plugin '${Gt.id}' is not valid.`);let er=Ze.createPluginData(Gt);Ze.ensureNoCycle(er,this._plugins,this._services),er.provides&&this._services.set(er.provides,er.id),this._plugins.set(er.id,er)}registerPlugins(Gt){for(let er of Gt)this.registerPlugin(er)}deregisterPlugin(Gt,er){let ur=this._plugins.get(Gt);if(ur){if(ur.activated&&!er)throw new Error(`Plugin '${Gt}' is still active.`);this._plugins.delete(Gt)}}async activatePlugin(Gt){let er=this._plugins.get(Gt);if(!er)throw new ReferenceError(`Plugin '${Gt}' is not registered.`);if(er.activated)return;if(er.promise)return er.promise;let ur=er.requires.map(Nt=>this.resolveRequiredService(Nt)),ir=er.optional.map(Nt=>this.resolveOptionalService(Nt));return er.promise=Promise.all([...ur,...ir]).then(Nt=>er.activate.apply(void 0,[this.application,...Nt])).then(Nt=>{er.service=Nt,er.activated=!0,er.promise=null}).catch(Nt=>{throw er.promise=null,Nt}),er.promise}async activatePlugins(Gt,er={}){switch(Gt){case"defer":{let ur=this.deferredPlugins.filter(ir=>this._plugins.get(ir).autoStart).map(ir=>this.activatePlugin(ir));await Promise.all(ur);break}case"startUp":{let ir=Ze.collectStartupPlugins(this._plugins,er).map(async Nt=>{try{return await this.activatePlugin(Nt)}catch(ar){console.error(`Plugin '${Nt}' failed to activate.`,ar)}});await Promise.all(ir);break}}}async deactivatePlugin(Gt){let er=this._plugins.get(Gt);if(!er)throw new ReferenceError(`Plugin '${Gt}' is not registered.`);if(!er.activated)return[];if(!er.deactivate)throw new TypeError(`Plugin '${Gt}'#deactivate() method missing`);let ur=Ze.findDependents(Gt,this._plugins,this._services),ir=ur.map(Nt=>this._plugins.get(Nt));for(let Nt of ir)if(!Nt.deactivate)throw new TypeError(`Plugin ${Nt.id}#deactivate() method missing (depends on ${Gt})`);for(let Nt of ir){let ar=[...Nt.requires,...Nt.optional].map(Lr=>{let Ir=this._services.get(Lr);return Ir?this._plugins.get(Ir).service:null});await Nt.deactivate(this.application,...ar),Nt.service=null,Nt.activated=!1}return ur.pop(),ur}async resolveRequiredService(Gt){let er=this._services.get(Gt);if(!er)throw new TypeError(`No provider for: ${Gt.name}.`);let ur=this._plugins.get(er);return ur.activated||await this.activatePlugin(er),ur.service}async resolveOptionalService(Gt){let er=this._services.get(Gt);if(!er)return null;let ur=this._plugins.get(er);if(!ur.activated)try{await this.activatePlugin(er)}catch(ir){return console.error(ir),null}return ur.service}}var Ze;(function(nr){class Gt{constructor(Lr){var Ir,de,Mr,qr;this._activated=!1,this._promise=null,this._service=null,this.id=Lr.id,this.description=(Ir=Lr.description)!==null&&Ir!==void 0?Ir:"",this.activate=Lr.activate,this.deactivate=(de=Lr.deactivate)!==null&&de!==void 0?de:null,this.provides=(Mr=Lr.provides)!==null&&Mr!==void 0?Mr:null,this.autoStart=(qr=Lr.autoStart)!==null&&qr!==void 0?qr:!1,this.requires=Lr.requires?Lr.requires.slice():[],this.optional=Lr.optional?Lr.optional.slice():[]}get activated(){return this._activated}set activated(Lr){this._activated=Lr}get service(){return this._service}set service(Lr){this._service=Lr}get promise(){return this._promise}set promise(Lr){this._promise=Lr}}function er(ar){return new Gt(ar)}nr.createPluginData=er;function ur(ar,Lr,Ir){let de=[...ar.requires,...ar.optional],Mr=Vr=>{if(Vr===ar.provides)return!0;let ti=Ir.get(Vr);if(!ti)return!1;let Xr=Lr.get(ti),Ki=[...Xr.requires,...Xr.optional];return Ki.length===0?!1:(qr.push(ti),Ki.some(Mr)?!0:(qr.pop(),!1))};if(!ar.provides||de.length===0)return;let qr=[ar.id];if(de.some(Mr))throw new ReferenceError(`Cycle detected: ${qr.join(" -> ")}.`)}nr.ensureNoCycle=ur;function ir(ar,Lr,Ir){let de=new Array,Mr=Ki=>{let Ia=Lr.get(Ki),_i=[...Ia.requires,...Ia.optional];de.push(..._i.reduce((ia,Yr)=>{let Ba=Ir.get(Yr);return Ba&&ia.push([Ki,Ba]),ia},[]))};for(let Ki of Lr.keys())Mr(Ki);let qr=de.filter(Ki=>Ki[1]===ar),Vr=0;for(;qr.length>Vr;){let Ki=qr.length,Ia=new Set(qr.map(_i=>_i[0]));for(let _i of Ia)de.filter(ia=>ia[1]===_i).forEach(ia=>{qr.includes(ia)||qr.push(ia)});Vr=Ki}let ti=oe.topologicSort(qr),Xr=ti.findIndex(Ki=>Ki===ar);return Xr===-1?[ar]:ti.slice(0,Xr+1)}nr.findDependents=ir;function Nt(ar,Lr){let Ir=new Set;for(let de of ar.keys())ar.get(de).autoStart===!0&&Ir.add(de);if(Lr.startPlugins)for(let de of Lr.startPlugins)Ir.add(de);if(Lr.ignorePlugins)for(let de of Lr.ignorePlugins)Ir.delete(de);return Array.from(Ir)}nr.collectStartupPlugins=Nt})(Ze||(Ze={}));class ct{constructor(){this.promise=new Promise((Gt,er)=>{this._resolve=Gt,this._reject=er})}resolve(Gt){let er=this._resolve;er(Gt)}reject(Gt){let er=this._reject;er(Gt)}}class Xt{constructor(Gt,er){this.name=Gt,this.description=er??"",this._tokenStructuralPropertyT=null}}function Ot(nr){let Gt=0;for(let er=0,ur=nr.length;er>>0),nr[er]=Gt&255,Gt>>>=8}We.Random=void 0,(function(nr){nr.getRandomValues=(()=>{let Gt=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return Gt&&typeof Gt.getRandomValues=="function"?function(ur){return Gt.getRandomValues(ur)}:Ot})()})(We.Random||(We.Random={}));function Zt(nr){let Gt=new Uint8Array(16),er=new Array(256);for(let ur=0;ur<16;++ur)er[ur]="0"+ur.toString(16);for(let ur=16;ur<256;++ur)er[ur]=ur.toString(16);return function(){return nr(Gt),Gt[6]=64|Gt[6]&15,Gt[8]=128|Gt[8]&63,er[Gt[0]]+er[Gt[1]]+er[Gt[2]]+er[Gt[3]]+"-"+er[Gt[4]]+er[Gt[5]]+"-"+er[Gt[6]]+er[Gt[7]]+"-"+er[Gt[8]]+er[Gt[9]]+"-"+er[Gt[10]]+er[Gt[11]]+er[Gt[12]]+er[Gt[13]]+er[Gt[14]]+er[Gt[15]]}}We.UUID=void 0,(function(nr){nr.uuid4=Zt(We.Random.getRandomValues)})(We.UUID||(We.UUID={})),We.MimeData=Pe,We.PluginRegistry=Ne,We.PromiseDelegate=ct,We.Token=Xt}))});var hU=WS((fU,pw)=>{(function(We,oe){typeof pw=="object"&&pw.exports?pw.exports=oe():We.moduleName=oe()})(typeof self<"u"?self:fU,()=>{"use strict";var We=(()=>{var oe=Object.create,Pe=Object.defineProperty,Ne=Object.defineProperties,Ze=Object.getOwnPropertyDescriptor,ct=Object.getOwnPropertyDescriptors,Xt=Object.getOwnPropertyNames,Ot=Object.getOwnPropertySymbols,Zt=Object.getPrototypeOf,nr=Object.prototype.hasOwnProperty,Gt=Object.prototype.propertyIsEnumerable,er=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),ur=e=>{throw TypeError(e)},ir=(e,r,t)=>r in e?Pe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Nt=(e,r)=>{for(var t in r||(r={}))nr.call(r,t)&&ir(e,t,r[t]);if(Ot)for(var t of Ot(r))Gt.call(r,t)&&ir(e,t,r[t]);return e},ar=(e,r)=>Ne(e,ct(r)),Lr=(e,r)=>{var t={};for(var i in e)nr.call(e,i)&&r.indexOf(i)<0&&(t[i]=e[i]);if(e!=null&&Ot)for(var i of Ot(e))r.indexOf(i)<0&&Gt.call(e,i)&&(t[i]=e[i]);return t},Ir=(e,r,t)=>function(){if(t)throw t[0];try{return e&&(r=(0,e[Xt(e)[0]])(e=0)),r}catch(a){throw t=[a],a}},de=(e,r)=>function(){try{return r||(0,e[Xt(e)[0]])((r={exports:{}}).exports,r),r.exports}catch(i){throw r=0,i}},Mr=(e,r)=>{for(var t in r)Pe(e,t,{get:r[t],enumerable:!0})},qr=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Xt(r))!nr.call(e,a)&&a!==t&&Pe(e,a,{get:()=>r[a],enumerable:!(i=Ze(r,a))||i.enumerable});return e},Vr=(e,r,t)=>(t=e!=null?oe(Zt(e)):{},qr(r||!e||!e.__esModule?Pe(t,"default",{value:e,enumerable:!0}):t,e)),ti=e=>qr(Pe({},"__esModule",{value:!0}),e),Xr=(e,r,t)=>new Promise((i,a)=>{var o=n=>{try{l(t.next(n))}catch(u){a(u)}},s=n=>{try{l(t.throw(n))}catch(u){a(u)}},l=n=>n.done?i(n.value):Promise.resolve(n.value).then(o,s);l((t=t.apply(e,r)).next())}),Ki=function(e,r){this[0]=e,this[1]=r},Ia=e=>{var r=e[er("asyncIterator")],t=!1,i,a={};return r==null?(r=e[er("iterator")](),i=o=>a[o]=s=>r[o](s)):(r=r.call(e),i=o=>a[o]=s=>{if(t){if(t=!1,o==="throw")throw s;return s}return t=!0,{done:!1,value:new Ki(new Promise(l=>{var n=r[o](s);n instanceof Object||ur("Object expected"),l(n)}),1)}}),a[er("iterator")]=()=>a,i("next"),"throw"in r?i("throw"):a.throw=o=>{throw o},"return"in r&&i("return"),a},_i=de({"src/version.js"(e){"use strict";e.version="4.1.1"}}),ia=de({"node_modules/native-promise-only/lib/npo.src.js"(e,r){(function(i,a,o){a[i]=a[i]||o(),typeof r<"u"&&r.exports&&(r.exports=a[i])})("Promise",typeof window<"u"?window:e,function(){"use strict";var i,a,o,s=Object.prototype.toString,l=typeof setImmediate<"u"?function(x){return setImmediate(x)}:setTimeout;try{Object.defineProperty({},"x",{}),i=function(x,S,M,C){return Object.defineProperty(x,S,{value:M,writable:!0,configurable:C!==!1})}}catch{i=function(S,M,C){return S[M]=C,S}}o=(function(){var x,S,M;function C(w,k){this.fn=w,this.self=k,this.next=void 0}return{add:function(k,A){M=new C(k,A),S?S.next=M:x=M,S=M,M=void 0},drain:function(){var k=x;for(x=S=a=void 0;k;)k.fn.call(k.self),k=k.next}}})();function n(v,x){o.add(v,x),a||(a=l(o.drain))}function u(v){var x,S=typeof v;return v!=null&&(S=="object"||S=="function")&&(x=v.then),typeof x=="function"?x:!1}function c(){for(var v=0;v0&&n(c,S))}catch(M){d.call(new g(S),M)}}}function d(v){var x=this;x.triggered||(x.triggered=!0,x.def&&(x=x.def),x.msg=v,x.state=2,x.chain.length>0&&n(c,x))}function p(v,x,S,M){for(var C=0;Che?1:re>=he?0:NaN}t.descending=function(re,he){return here?1:he>=re?0:NaN},t.min=function(re,he){var we=-1,Le=re.length,Re,Oe;if(arguments.length===1){for(;++we=Oe){Re=Oe;break}for(;++weOe&&(Re=Oe)}else{for(;++we=Oe){Re=Oe;break}for(;++weOe&&(Re=Oe)}return Re},t.max=function(re,he){var we=-1,Le=re.length,Re,Oe;if(arguments.length===1){for(;++we=Oe){Re=Oe;break}for(;++weRe&&(Re=Oe)}else{for(;++we=Oe){Re=Oe;break}for(;++weRe&&(Re=Oe)}return Re},t.extent=function(re,he){var we=-1,Le=re.length,Re,Oe,ut;if(arguments.length===1){for(;++we=Oe){Re=ut=Oe;break}for(;++weOe&&(Re=Oe),ut=Oe){Re=ut=Oe;break}for(;++weOe&&(Re=Oe),ut1)return ut/(_t-1)},t.deviation=function(){var re=t.variance.apply(this,arguments);return re&&Math.sqrt(re)};function m(re){return{left:function(he,we,Le,Re){for(arguments.length<3&&(Le=0),arguments.length<4&&(Re=he.length);Le>>1;re(he[Oe],we)<0?Le=Oe+1:Re=Oe}return Le},right:function(he,we,Le,Re){for(arguments.length<3&&(Le=0),arguments.length<4&&(Re=he.length);Le>>1;re(he[Oe],we)>0?Re=Oe:Le=Oe+1}return Le}}}var y=m(d);t.bisectLeft=y.left,t.bisect=t.bisectRight=y.right,t.bisector=function(re){return m(re.length===1?function(he,we){return d(re(he),we)}:re)},t.shuffle=function(re,he,we){(Le=arguments.length)<3&&(we=re.length,Le<2&&(he=0));for(var Le=we-he,Re,Oe;Le;)Oe=Math.random()*Le--|0,Re=re[Le+he],re[Le+he]=re[Oe+he],re[Oe+he]=Re;return re},t.permute=function(re,he){for(var we=he.length,Le=new Array(we);we--;)Le[we]=re[he[we]];return Le},t.pairs=function(re){for(var he=0,we=re.length-1,Le,Re=re[0],Oe=new Array(we<0?0:we);he=0;)for(ut=re[he],we=ut.length;--we>=0;)Oe[--Re]=ut[we];return Oe};var v=Math.abs;t.range=function(re,he,we){if(arguments.length<3&&(we=1,arguments.length<2&&(he=re,re=0)),(he-re)/we===1/0)throw new Error("infinite range");var Le=[],Re=x(v(we)),Oe=-1,ut;if(re*=Re,he*=Re,we*=Re,we<0)for(;(ut=re+we*++Oe)>he;)Le.push(ut/Re);else for(;(ut=re+we*++Oe)=he.length)return Re?Re.call(re,_t):Le?_t.sort(Le):_t;for(var Rt=-1,lr=_t.length,sr=he[Ft++],Fr,Or,hr,wr=new M,Cr;++Rt=he.length)return et;var Ft=[],Rt=we[_t++];return et.forEach(function(lr,sr){Ft.push({key:lr,values:ut(sr,_t)})}),Rt?Ft.sort(function(lr,sr){return Rt(lr.key,sr.key)}):Ft}return re.map=function(et,_t){return Oe(_t,et,0)},re.entries=function(et){return ut(Oe(t.map,et,0),0)},re.key=function(et){return he.push(et),re},re.sortKeys=function(et){return we[he.length-1]=et,re},re.sortValues=function(et){return Le=et,re},re.rollup=function(et){return Re=et,re},re},t.set=function(re){var he=new R;if(re)for(var we=0,Le=re.length;we=0&&(Le=re.slice(we+1),re=re.slice(0,we)),re)return arguments.length<2?this[re].on(Le):this[re].on(Le,he);if(arguments.length===2){if(he==null)for(re in this)this.hasOwnProperty(re)&&this[re].on(Le,null);return this}};function G(re){var he=[],we=new M;function Le(){for(var Re=he,Oe=-1,ut=Re.length,et;++Oe=0&&(we=re.slice(0,he))!=="xmlns"&&(re=re.slice(he+1)),te.hasOwnProperty(we)?{space:te[we],local:re}:re}},j.attr=function(re,he){if(arguments.length<2){if(typeof re=="string"){var we=this.node();return re=t.ns.qualify(re),re.local?we.getAttributeNS(re.space,re.local):we.getAttribute(re)}for(he in re)this.each(ne(he,re[he]));return this}return this.each(ne(re,he))};function ne(re,he){re=t.ns.qualify(re);function we(){this.removeAttribute(re)}function Le(){this.removeAttributeNS(re.space,re.local)}function Re(){this.setAttribute(re,he)}function Oe(){this.setAttributeNS(re.space,re.local,he)}function ut(){var _t=he.apply(this,arguments);_t==null?this.removeAttribute(re):this.setAttribute(re,_t)}function et(){var _t=he.apply(this,arguments);_t==null?this.removeAttributeNS(re.space,re.local):this.setAttributeNS(re.space,re.local,_t)}return he==null?re.local?Le:we:typeof he=="function"?re.local?et:ut:re.local?Oe:Re}function se(re){return re.trim().replace(/\s+/g," ")}j.classed=function(re,he){if(arguments.length<2){if(typeof re=="string"){var we=this.node(),Le=(re=ce(re)).length,Re=-1;if(he=we.classList){for(;++Re=0;)(Oe=we[Le])&&(Re&&Re!==Oe.nextSibling&&Re.parentNode.insertBefore(Oe,Re),Re=Oe);return this},j.sort=function(re){re=ue.apply(this,arguments);for(var he=-1,we=this.length;++he=he&&(he=Re+1);!(_t=ut[he])&&++he0&&(re=re.slice(0,Re));var ut=Ke.get(re);ut&&(re=ut,Oe=vt);function et(){var Rt=this[Le];Rt&&(this.removeEventListener(re,Rt,Rt.$),delete this[Le])}function _t(){var Rt=Oe(he,a(arguments));et.call(this),this.addEventListener(re,this[Le]=Rt,Rt.$=we),Rt._=he}function Ft(){var Rt=new RegExp("^__on([^.]+)"+t.requote(re)+"$"),lr;for(var sr in this)if(lr=sr.match(Rt)){var Fr=this[sr];this.removeEventListener(lr[1],Fr,Fr.$),delete this[sr]}}return Re?he?_t:et:he?B:Ft}var Ke=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});o&&Ke.forEach(function(re){"on"+re in o&&Ke.remove(re)});function Je(re,he){return function(we){var Le=t.event;t.event=we,he[0]=this.__data__;try{re.apply(this,he)}finally{t.event=Le}}}function vt(re,he){var we=Je(re,he);return function(Le){var Re=this,Oe=Le.relatedTarget;(!Oe||Oe!==Re&&!(Oe.compareDocumentPosition(Re)&8))&&we.call(Re,Le)}}var xt,Pt=0;function mt(re){var he=".dragsuppress-"+ ++Pt,we="click"+he,Le=t.select(l(re)).on("touchmove"+he,W).on("dragstart"+he,W).on("selectstart"+he,W);if(xt==null&&(xt="onselectstart"in re?!1:I(re.style,"userSelect")),xt){var Re=s(re).style,Oe=Re[xt];Re[xt]="none"}return function(ut){if(Le.on(he,null),xt&&(Re[xt]=Oe),ut){var et=function(){Le.on(we,null)};Le.on(we,function(){W(),et()},!0),setTimeout(et,0)}}}t.mouse=function(re){return lt(re,X())};var Mt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function lt(re,he){he.changedTouches&&(he=he.changedTouches[0]);var we=re.ownerSVGElement||re;if(we.createSVGPoint){var Le=we.createSVGPoint();if(Mt<0){var Re=l(re);if(Re.scrollX||Re.scrollY){we=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var Oe=we[0][0].getScreenCTM();Mt=!(Oe.f||Oe.e),we.remove()}}return Mt?(Le.x=he.pageX,Le.y=he.pageY):(Le.x=he.clientX,Le.y=he.clientY),Le=Le.matrixTransform(re.getScreenCTM().inverse()),[Le.x,Le.y]}var ut=re.getBoundingClientRect();return[he.clientX-ut.left-re.clientLeft,he.clientY-ut.top-re.clientTop]}t.touch=function(re,he,we){if(arguments.length<3&&(we=he,he=X().changedTouches),he){for(var Le=0,Re=he.length,Oe;Le0?1:re<0?-1:0}function at(re,he,we){return(he[0]-re[0])*(we[1]-re[1])-(he[1]-re[1])*(we[0]-re[0])}function rt(re){return re>1?0:re<-1?_e:Math.acos(re)}function ht(re){return re>1?Ee:re<-1?-Ee:Math.asin(re)}function At(re){return((re=Math.exp(re))-1/re)/2}function dt(re){return((re=Math.exp(re))+1/re)/2}function Ht(re){return((re=Math.exp(2*re))-1)/(re+1)}function fr(re){return(re=Math.sin(re/2))*re}var gt=Math.SQRT2,yt=2,kt=4;t.interpolateZoom=function(re,he){var we=re[0],Le=re[1],Re=re[2],Oe=he[0],ut=he[1],et=he[2],_t=Oe-we,Ft=ut-Le,Rt=_t*_t+Ft*Ft,lr,sr;if(Rt0&&(fa=fa.transition().duration(ut)),fa.call(jr.event)}function qa(){wr&&wr.domain(hr.range().map(function(fa){return(fa-re.x)/re.k}).map(hr.invert)),Nr&&Nr.domain(Cr.range().map(function(fa){return(fa-re.y)/re.k}).map(Cr.invert))}function Fa(fa){et++||fa({type:"zoomstart"})}function Nn(fa){qa(),fa({type:"zoom",scale:re.k,translate:[re.x,re.y]})}function ka(fa){--et||(fa({type:"zoomend"}),we=null)}function Sn(){var fa=this,jn=Or.of(fa,arguments),Gn=0,Po=t.select(l(fa)).on(Ft,Tl).on(Rt,Fl),As=Ar(t.mouse(fa)),Qs=mt(fa);Pn.call(fa),Fa(jn);function Tl(){Gn=1,aa(t.mouse(fa),As),Nn(jn)}function Fl(){Po.on(Ft,null).on(Rt,null),Qs(Gn),ka(jn)}}function ko(){var fa=this,jn=Or.of(fa,arguments),Gn={},Po=0,As,Qs=".zoom-"+t.event.changedTouches[0].identifier,Tl="touchmove"+Qs,Fl="touchend"+Qs,su=[],bt=t.select(fa),dr=mt(fa);Kr(),Fa(jn),bt.on(_t,null).on(sr,Kr);function _r(){var si=t.touches(fa);return As=re.k,si.forEach(function(Ni){Ni.identifier in Gn&&(Gn[Ni.identifier]=Ar(Ni))}),si}function Kr(){var si=t.event.target;t.select(si).on(Tl,ci).on(Fl,yi),su.push(si);for(var Ni=t.event.changedTouches,Ji=0,Qi=Ni.length;Ji1){var Wa=ra[0],xa=ra[1],Pi=Wa[0]-xa[0],Hr=Wa[1]-xa[1];Po=Pi*Pi+Hr*Hr}}function ci(){var si=t.touches(fa),Ni,Ji,Qi,ra;Pn.call(fa);for(var mn=0,Wa=si.length;mn1?1:he,we=we<0?0:we>1?1:we,Re=we<=.5?we*(1+he):we+he-we*he,Le=2*we-Re;function Oe(et){return et>360?et-=360:et<0&&(et+=360),et<60?Le+(Re-Le)*et/60:et<180?Re:et<240?Le+(Re-Le)*(240-et)/60:Le}function ut(et){return Math.round(Oe(et)*255)}return new Jr(ut(re+120),ut(re),ut(re-120))}t.hcl=Ur;function Ur(re,he,we){return this instanceof Ur?(this.h=+re,this.c=+he,void(this.l=+we)):arguments.length<2?re instanceof Ur?new Ur(re.h,re.c,re.l):re instanceof Qr?bi(re.l,re.a,re.b):bi((re=Yt((re=t.rgb(re)).r,re.g,re.b)).l,re.a,re.b):new Ur(re,he,we)}var Ai=Ur.prototype=new mr;Ai.brighter=function(re){return new Ur(this.h,this.c,Math.min(100,this.l+ea*(arguments.length?re:1)))},Ai.darker=function(re){return new Ur(this.h,this.c,Math.max(0,this.l-ea*(arguments.length?re:1)))},Ai.rgb=function(){return oi(this.h,this.c,this.l).rgb()};function oi(re,he,we){return isNaN(re)&&(re=0),isNaN(he)&&(he=0),new Qr(we,Math.cos(re*=De)*he,Math.sin(re)*he)}t.lab=Qr;function Qr(re,he,we){return this instanceof Qr?(this.l=+re,this.a=+he,void(this.b=+we)):arguments.length<2?re instanceof Qr?new Qr(re.l,re.a,re.b):re instanceof Ur?oi(re.h,re.c,re.l):Yt((re=Jr(re)).r,re.g,re.b):new Qr(re,he,we)}var ea=18,$i=.95047,ja=1,ya=1.08883,pa=Qr.prototype=new mr;pa.brighter=function(re){return new Qr(Math.min(100,this.l+ea*(arguments.length?re:1)),this.a,this.b)},pa.darker=function(re){return new Qr(Math.max(0,this.l-ea*(arguments.length?re:1)),this.a,this.b)},pa.rgb=function(){return xi(this.l,this.a,this.b)};function xi(re,he,we){var Le=(re+16)/116,Re=Le+he/500,Oe=Le-we/200;return Re=Ua(Re)*$i,Le=Ua(Le)*ja,Oe=Ua(Oe)*ya,new Jr(pi(3.2404542*Re-1.5371385*Le-.4985314*Oe),pi(-.969266*Re+1.8760108*Le+.041556*Oe),pi(.0556434*Re-.2040259*Le+1.0572252*Oe))}function bi(re,he,we){return re>0?new Ur(Math.atan2(we,he)*Qe,Math.sqrt(he*he+we*we),re):new Ur(NaN,NaN,re)}function Ua(re){return re>.206893034?re*re*re:(re-4/29)/7.787037}function dn(re){return re>.008856?Math.pow(re,1/3):7.787037*re+4/29}function pi(re){return Math.round(255*(re<=.00304?12.92*re:1.055*Math.pow(re,1/2.4)-.055))}t.rgb=Jr;function Jr(re,he,we){return this instanceof Jr?(this.r=~~re,this.g=~~he,void(this.b=~~we)):arguments.length<2?re instanceof Jr?new Jr(re.r,re.g,re.b):zt(""+re,Jr,Tr):new Jr(re,he,we)}function Be(re){return new Jr(re>>16,re>>8&255,re&255)}function Fe(re){return Be(re)+""}var Et=Jr.prototype=new mr;Et.brighter=function(re){re=Math.pow(.7,arguments.length?re:1);var he=this.r,we=this.g,Le=this.b,Re=30;return!he&&!we&&!Le?new Jr(Re,Re,Re):(he&&he>4,Le=Le>>4|Le,Re=_t&240,Re=Re>>4|Re,Oe=_t&15,Oe=Oe<<4|Oe):re.length===7&&(Le=(_t&16711680)>>16,Re=(_t&65280)>>8,Oe=_t&255)),he(Le,Re,Oe))}function Wt(re,he,we){var Le=Math.min(re/=255,he/=255,we/=255),Re=Math.max(re,he,we),Oe=Re-Le,ut,et,_t=(Re+Le)/2;return Oe?(et=_t<.5?Oe/(Re+Le):Oe/(2-Re-Le),re==Re?ut=(he-we)/Oe+(he0&&_t<1?0:ut),new br(ut,et,_t)}function Yt(re,he,we){re=ze(re),he=ze(he),we=ze(we);var Le=dn((.4124564*re+.3575761*he+.1804375*we)/$i),Re=dn((.2126729*re+.7151522*he+.072175*we)/ja),Oe=dn((.0193339*re+.119192*he+.9503041*we)/ya);return Qr(116*Re-16,500*(Le-Re),200*(Re-Oe))}function ze(re){return(re/=255)<=.04045?re/12.92:Math.pow((re+.055)/1.055,2.4)}function tt(re){var he=parseFloat(re);return re.charAt(re.length-1)==="%"?Math.round(he*2.55):he}var ft=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ft.forEach(function(re,he){ft.set(re,Be(he))});function wt(re){return typeof re=="function"?re:function(){return re}}t.functor=wt,t.xhr=jt(P);function jt(re){return function(he,we,Le){return arguments.length===2&&typeof we=="function"&&(Le=we,we=null),It(he,we,re,Le)}}function It(re,he,we,Le){var Re={},Oe=t.dispatch("beforesend","progress","load","error"),ut={},et=new XMLHttpRequest,_t=null;self.XDomainRequest&&!("withCredentials"in et)&&/^(http(s)?:)?\/\//.test(re)&&(et=new XDomainRequest),"onload"in et?et.onload=et.onerror=Ft:et.onreadystatechange=function(){et.readyState>3&&Ft()};function Ft(){var Rt=et.status,lr;if(!Rt&&qt(et)||Rt>=200&&Rt<300||Rt===304){try{lr=we.call(Re,et)}catch(sr){Oe.error.call(Re,sr);return}Oe.load.call(Re,lr)}else Oe.error.call(Re,et)}return et.onprogress=function(Rt){var lr=t.event;t.event=Rt;try{Oe.progress.call(Re,et)}finally{t.event=lr}},Re.header=function(Rt,lr){return Rt=(Rt+"").toLowerCase(),arguments.length<2?ut[Rt]:(lr==null?delete ut[Rt]:ut[Rt]=lr+"",Re)},Re.mimeType=function(Rt){return arguments.length?(he=Rt==null?null:Rt+"",Re):he},Re.responseType=function(Rt){return arguments.length?(_t=Rt,Re):_t},Re.response=function(Rt){return we=Rt,Re},["get","post"].forEach(function(Rt){Re[Rt]=function(){return Re.send.apply(Re,[Rt].concat(a(arguments)))}}),Re.send=function(Rt,lr,sr){if(arguments.length===2&&typeof lr=="function"&&(sr=lr,lr=null),et.open(Rt,re,!0),he!=null&&!("accept"in ut)&&(ut.accept=he+",*/*"),et.setRequestHeader)for(var Fr in ut)et.setRequestHeader(Fr,ut[Fr]);return he!=null&&et.overrideMimeType&&et.overrideMimeType(he),_t!=null&&(et.responseType=_t),sr!=null&&Re.on("error",sr).on("load",function(Or){sr(null,Or)}),Oe.beforesend.call(Re,et),et.send(lr??null),Re},Re.abort=function(){return et.abort(),Re},t.rebind(Re,Oe,"on"),Le==null?Re:Re.get(Kt(Le))}function Kt(re){return re.length===1?function(he,we){re(he==null?we:null)}:re}function qt(re){var he=re.responseType;return he&&he!=="text"?re.response:re.responseText}t.dsv=function(re,he){var we=new RegExp('["'+re+` +]`),Le=re.charCodeAt(0);function Re(Ft,Rt,lr){arguments.length<3&&(lr=Rt,Rt=null);var sr=It(Ft,he,Rt==null?Oe:ut(Rt),lr);return sr.row=function(Fr){return arguments.length?sr.response((Rt=Fr)==null?Oe:ut(Fr)):Rt},sr}function Oe(Ft){return Re.parse(Ft.responseText)}function ut(Ft){return function(Rt){return Re.parse(Rt.responseText,Ft)}}Re.parse=function(Ft,Rt){var lr;return Re.parseRows(Ft,function(sr,Fr){if(lr)return lr(sr,Fr-1);var Or=function(hr){for(var wr={},Cr=sr.length,Nr=0;Nr=Or)return sr;if(Nr)return Nr=!1,lr;var Ci=hr;if(Ft.charCodeAt(Ci)===34){for(var Gi=Ci;Gi++24?(isFinite(he)&&(clearTimeout(Mi),Mi=setTimeout(Hi,he)),Pr=0):(Pr=1,gi(Hi))}t.timer.flush=function(){Za(),oa()};function Za(){for(var re=Date.now(),he=vr;he;)re>=he.t&&he.c(re-he.t)&&(he.c=null),he=he.n;return re}function oa(){for(var re,he=vr,we=1/0;he;)he.c?(he.t=0;--et)hr.push(Re[Ft[lr[et]][2]]);for(et=+Fr;et1&&at(re[we[Le-2]],re[we[Le-1]],re[Re])<=0;)--Le;we[Le++]=Re}return we.slice(0,Le)}function In(re,he){return re[0]-he[0]||re[1]-he[1]}t.geom.polygon=function(re){return N(re,pn),re};var pn=t.geom.polygon.prototype=[];pn.area=function(){for(var re=-1,he=this.length,we,Le=this[he-1],Re=0;++reYe)et=et.L;else if(ut=he-Qn(et,we),ut>Ye){if(!et.R){Le=et;break}et=et.R}else{Ne>-Ye?(Le=et.P,Re=et):ut>-Ye?(Le=et,Re=et.N):Le=Re=et;break}var _t=ho(re);if(zn.insert(Le,_t),!(!Le&&!Re)){if(Le===Re){no(Le),Re=ho(Le.site),zn.insert(_t,Re),_t.edge=Re.edge=So(Le.site,_t.site),xo(Le),xo(Re);return}if(!Re){_t.edge=So(Le.site,_t.site);return}no(Le),no(Re);var Ft=Le.site,Rt=Ft.x,lr=Ft.y,sr=re.x-Rt,Fr=re.y-lr,Or=Re.site,hr=Or.x-Rt,wr=Or.y-lr,Cr=2*(sr*wr-Fr*hr),Nr=sr*sr+Fr*Fr,jr=hr*hr+wr*wr,Ar={x:(wr*Nr-Fr*jr)/Cr+Rt,y:(sr*jr-hr*Nr)/Cr+lr};vs(Re.edge,Ft,Or,Ar),_t.edge=So(Ft,re,null,Ar),Re.edge=So(re,Or,null,Ar),xo(Le),xo(Re)}}function uo(re,he){var we=re.site,Le=we.x,Re=we.y,Ne=Re-he;if(!Ne)return Le;var ut=re.P;if(!ut)return-1/0;we=ut.site;var et=we.x,_t=we.y,Ft=_t-he;if(!Ft)return et;var Rt=et-Le,lr=1/Ne-1/Ft,sr=Rt/Ft;return lr?(-sr+Math.sqrt(sr*sr-2*lr*(Rt*Rt/(-2*Ft)-_t+Ft/2+Re-Ne/2)))/lr+Le:(Le+et)/2}function Qn(re,he){var we=re.N;if(we)return uo(we,he);var Le=re.site;return Le.y===he?Le.x:1/0}function jo(re){this.site=re,this.edges=[]}jo.prototype.prepare=function(){for(var re=this.edges,he=re.length,we;he--;)we=re[he].edge,(!we.b||!we.a)&&re.splice(he,1);return re.sort(Bn),re.length};function Yn(re){for(var he=re[0][0],we=re[1][0],Le=re[0][1],Re=re[1][1],Ne,ut,et,_t,Ft=Kn,Rt=Ft.length,lr,sr,Fr,Or,hr,wr;Rt--;)if(lr=Ft[Rt],!(!lr||!lr.prepare()))for(Fr=lr.edges,Or=Fr.length,sr=0;srYe||v(_t-ut)>Ye)&&(Fr.splice(sr,0,new go(nl(lr.site,wr,v(et-he)Ye?{x:he,y:v(Ne-he)Ye?{x:v(ut-Re)Ye?{x:we,y:v(Ne-we)Ye?{x:v(ut-Le)=-me)){var sr=_t*_t+Ft*Ft,Fr=Rt*Rt+wr*wr,Or=(wr*sr-Ft*Fr)/lr,hr=(_t*Fr-Rt*sr)/lr,wr=hr+et,Cr=on.pop()||new ps;Cr.arc=re,Cr.site=Re,Cr.x=Or+ut,Cr.y=wr+Math.sqrt(Or*Or+hr*hr),Cr.cy=wr,re.circle=Cr;for(var Nr=null,jr=ln._;jr;)if(Cr.y0)){if(hr/=Fr,Fr<0){if(hr0){if(hr>sr)return;hr>lr&&(lr=hr)}if(hr=we-et,!(!Fr&&hr<0)){if(hr/=Fr,Fr<0){if(hr>sr)return;hr>lr&&(lr=hr)}else if(Fr>0){if(hr0)){if(hr/=Or,Or<0){if(hr0){if(hr>sr)return;hr>lr&&(lr=hr)}if(hr=Le-_t,!(!Or&&hr<0)){if(hr/=Or,Or<0){if(hr>sr)return;hr>lr&&(lr=hr)}else if(Or>0){if(hr0&&(Re.a={x:et+lr*Fr,y:_t+lr*Or}),sr<1&&(Re.b={x:et+sr*Fr,y:_t+sr*Or}),Re}}}}}}function Vn(re){for(var he=Mn,we=Mo(re[0][0],re[0][1],re[1][0],re[1][1]),Le=he.length,Re;Le--;)Re=he[Le],(!ts(Re,re)||!we(Re)||v(Re.a.x-Re.b.x)=Ne)return;if(Rt>sr){if(!Le)Le={x:Or,y:ut};else if(Le.y>=et)return;we={x:Or,y:et}}else{if(!Le)Le={x:Or,y:et};else if(Le.y1)if(Rt>sr){if(!Le)Le={x:(ut-Cr)/wr,y:ut};else if(Le.y>=et)return;we={x:(et-Cr)/wr,y:et}}else{if(!Le)Le={x:(et-Cr)/wr,y:et};else if(Le.y=Ne)return;we={x:Ne,y:wr*Ne+Cr}}else{if(!Le)Le={x:Ne,y:wr*Ne+Cr};else if(Le.x=Rt&&Cr.x<=sr&&Cr.y>=lr&&Cr.y<=Fr?[[Rt,Fr],[sr,Fr],[sr,lr],[Rt,lr]]:[];Nr.point=_t[hr]}),Ft}function et(_t){return _t.map(function(Ft,Rt){return{x:Math.round(Le(Ft,Rt)/Ye)*Ye,y:Math.round(Re(Ft,Rt)/Ye)*Ye,i:Rt}})}return ut.links=function(_t){return Ul(et(_t)).edges.filter(function(Ft){return Ft.l&&Ft.r}).map(function(Ft){return{source:_t[Ft.l.i],target:_t[Ft.r.i]}})},ut.triangles=function(_t){var Ft=[];return Ul(et(_t)).cells.forEach(function(Rt,lr){for(var sr=Rt.site,Fr=Rt.edges.sort(Bn),Or=-1,hr=Fr.length,wr,Cr,Nr=Fr[hr-1].edge,jr=Nr.l===sr?Nr.r:Nr.l;++Orjr&&(jr=Rt.x),Rt.y>Ar&&(Ar=Rt.y),Fr.push(Rt.x),Or.push(Rt.y);else for(hr=0;hrjr&&(jr=Ci),Gi>Ar&&(Ar=Gi),Fr.push(Ci),Or.push(Gi)}var aa=jr-Cr,ga=Ar-Nr;aa>ga?Ar=Nr+aa:jr=Cr+ga;function qa(ka,Sn,ko,Vs,Ho,fa,jn,Gn){if(!(isNaN(ko)||isNaN(Vs)))if(ka.leaf){var Po=ka.x,As=ka.y;if(Po!=null)if(v(Po-ko)+v(As-Vs)<.01)Fa(ka,Sn,ko,Vs,Ho,fa,jn,Gn);else{var Qs=ka.point;ka.x=ka.y=ka.point=null,Fa(ka,Qs,Po,As,Ho,fa,jn,Gn),Fa(ka,Sn,ko,Vs,Ho,fa,jn,Gn)}else ka.x=ko,ka.y=Vs,ka.point=Sn}else Fa(ka,Sn,ko,Vs,Ho,fa,jn,Gn)}function Fa(ka,Sn,ko,Vs,Ho,fa,jn,Gn){var Po=(Ho+jn)*.5,As=(fa+Gn)*.5,Qs=ko>=Po,Tl=Vs>=As,Fl=Tl<<1|Qs;ka.leaf=!1,ka=ka.nodes[Fl]||(ka.nodes[Fl]=Pu()),Qs?Ho=Po:jn=Po,Tl?fa=As:Gn=As,qa(ka,Sn,ko,Vs,Ho,fa,jn,Gn)}var Nn=Pu();if(Nn.add=function(ka){qa(Nn,ka,+lr(ka,++hr),+sr(ka,hr),Cr,Nr,jr,Ar)},Nn.visit=function(ka){Cl(ka,Nn,Cr,Nr,jr,Ar)},Nn.find=function(ka){return bc(Nn,ka[0],ka[1],Cr,Nr,jr,Ar)},hr=-1,he==null){for(;++hrNe||sr>ut||Fr=Ci,ga=we>=Gi,qa=ga<<1|aa,Fa=qa+4;qawe&&(Ne=he.slice(we,Ne),et[ut]?et[ut]+=Ne:et[++ut]=Ne),(Le=Le[0])===(Re=Re[0])?et[ut]?et[ut]+=Re:et[++ut]=Re:(et[++ut]=null,_t.push({i:ut,x:ms(Le,Re)})),we=wc.lastIndex;return we=0&&!(Le=t.interpolators[we](re,he)););return Le}t.interpolators=[function(re,he){var we=typeof he;return(we==="string"?ct.has(he.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(he)?Iu:ss:he instanceof mr?Iu:Array.isArray(he)?tc:we==="object"&&isNaN(he)?_l:ms)(re,he)}],t.interpolateArray=tc;function tc(re,he){var we=[],Le=[],Re=re.length,Ne=he.length,ut=Math.min(re.length,he.length),et;for(et=0;et=0?re.slice(0,he):re,Le=he>=0?re.slice(he+1):"in";return we=Th.get(we)||wh,Le=Rd.get(Le)||P,fp(Le(we.apply(null,i.call(arguments,1))))};function fp(re){return function(he){return he<=0?0:he>=1?1:re(he)}}function Ru(re){return function(he){return 1-re(1-he)}}function Ts(re){return function(he){return .5*(he<.5?re(2*he):2-re(2-2*he))}}function Ah(re){return re*re}function vf(re){return re*re*re}function Ac(re){if(re<=0)return 0;if(re>=1)return 1;var he=re*re,we=he*re;return 4*(re<.5?we:3*(re-he)+we-.75)}function Mh(re){return function(he){return Math.pow(he,re)}}function Mc(re){return 1-Math.cos(re*Ee)}function $c(re){return Math.pow(2,10*(re-1))}function zu(re){return 1-Math.sqrt(1-re*re)}function mf(re,he){var we;return arguments.length<2&&(he=.45),arguments.length?we=he/Ae*Math.asin(1/re):(re=1,we=he/4),function(Le){return 1+re*Math.pow(2,-10*Le)*Math.sin((Le-we)*Ae/he)}}function jf(re){return re||(re=1.70158),function(he){return he*he*((re+1)*he-re)}}function Sc(re){return re<1/2.75?7.5625*re*re:re<2/2.75?7.5625*(re-=1.5/2.75)*re+.75:re<2.5/2.75?7.5625*(re-=2.25/2.75)*re+.9375:7.5625*(re-=2.625/2.75)*re+.984375}t.interpolateHcl=id;function id(re,he){re=t.hcl(re),he=t.hcl(he);var we=re.h,Le=re.c,Re=re.l,Ne=he.h-we,ut=he.c-Le,et=he.l-Re;return isNaN(ut)&&(ut=0,Le=isNaN(Le)?he.c:Le),isNaN(Ne)?(Ne=0,we=isNaN(we)?he.h:we):Ne>180?Ne-=360:Ne<-180&&(Ne+=360),function(_t){return oi(we+Ne*_t,Le+ut*_t,Re+et*_t)+""}}t.interpolateHsl=Uf;function Uf(re,he){re=t.hsl(re),he=t.hsl(he);var we=re.h,Le=re.s,Re=re.l,Ne=he.h-we,ut=he.s-Le,et=he.l-Re;return isNaN(ut)&&(ut=0,Le=isNaN(Le)?he.s:Le),isNaN(Ne)?(Ne=0,we=isNaN(we)?he.h:we):Ne>180?Ne-=360:Ne<-180&&(Ne+=360),function(_t){return Tr(we+Ne*_t,Le+ut*_t,Re+et*_t)+""}}t.interpolateLab=zd;function zd(re,he){re=t.lab(re),he=t.lab(he);var we=re.l,Le=re.a,Re=re.b,Ne=he.l-we,ut=he.a-Le,et=he.b-Re;return function(_t){return xi(we+Ne*_t,Le+ut*_t,Re+et*_t)+""}}t.interpolateRound=Bu;function Bu(re,he){return he-=re,function(we){return Math.round(re+he*we)}}t.transform=function(re){var he=o.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(we){if(we!=null){he.setAttribute("transform",we);var Le=he.transform.baseVal.consolidate()}return new Sh(Le?Le.matrix:gf)})(re)};function Sh(re){var he=[re.a,re.b],we=[re.c,re.d],Le=qf(he),Re=_u(he,we),Ne=qf(Dl(we,he,-Re))||0;he[0]*we[1]180?he+=360:he-re>180&&(re+=360),Le.push({i:we.push(Ou(we)+"rotate(",null,")")-2,x:ms(re,he)})):he&&we.push(Ou(we)+"rotate("+he+")")}function Vf(re,he,we,Le){re!==he?Le.push({i:we.push(Ou(we)+"skewX(",null,")")-2,x:ms(re,he)}):he&&we.push(Ou(we)+"skewX("+he+")")}function Eh(re,he,we,Le){if(re[0]!==he[0]||re[1]!==he[1]){var Re=we.push(Ou(we)+"scale(",null,",",null,")");Le.push({i:Re-4,x:ms(re[0],he[0])},{i:Re-2,x:ms(re[1],he[1])})}else(he[0]!==1||he[1]!==1)&&we.push(Ou(we)+"scale("+he+")")}function Ec(re,he){var we=[],Le=[];return re=t.transform(re),he=t.transform(he),yf(re.translate,he.translate,we,Le),_f(re.rotate,he.rotate,we,Le),Vf(re.skew,he.skew,we,Le),Eh(re.scale,he.scale,we,Le),re=he=null,function(Re){for(var Ne=-1,ut=Le.length,et;++Ne0?Ne=Ar:(we.c=null,we.t=NaN,we=null,he.end({type:"end",alpha:Ne=0})):Ar>0&&(he.start({type:"start",alpha:Ne=Ar}),we=ba(re.tick)),re):Ne},re.start=function(){var Ar,Ci=Fr.length,Gi=Or.length,aa=Le[0],ga=Le[1],qa,Fa;for(Ar=0;Ar=0;)Ne.push(Rt=Ft[_t]),Rt.parent=et,Rt.depth=et.depth+1;we&&(et.value=0),et.children=Ft}else we&&(et.value=+we.call(Le,et,et.depth)||0),delete et.children;return Vl(Re,function(lr){var sr,Fr;re&&(sr=lr.children)&&sr.sort(re),we&&(Fr=lr.parent)&&(Fr.value+=lr.value)}),ut}return Le.sort=function(Re){return arguments.length?(re=Re,Le):re},Le.children=function(Re){return arguments.length?(he=Re,Le):he},Le.value=function(Re){return arguments.length?(we=Re,Le):we},Le.revalue=function(Re){return we&&(ql(Re,function(Ne){Ne.children&&(Ne.value=0)}),Vl(Re,function(Ne){var ut;Ne.children||(Ne.value=+we.call(Le,Ne,Ne.depth)||0),(ut=Ne.parent)&&(ut.value+=Ne.value)})),Re},Le};function ju(re,he){return t.rebind(re,he,"sort","children","value"),re.nodes=re,re.links=nu,re}function ql(re,he){for(var we=[re];(re=we.pop())!=null;)if(he(re),(Re=re.children)&&(Le=Re.length))for(var Le,Re;--Le>=0;)we.push(Re[Le])}function Vl(re,he){for(var we=[re],Le=[];(re=we.pop())!=null;)if(Le.push(re),(ut=re.children)&&(Ne=ut.length))for(var Re=-1,Ne,ut;++ReRe&&(Re=et),Le.push(et)}for(ut=0;utLe&&(we=he,Le=Re);return we}function Wf(re){return re.reduce(Xc,0)}function Xc(re,he){return re+he[1]}t.layout.histogram=function(){var re=!0,he=Number,we=ic,Le=Yf;function Re(Ne,sr){for(var et=[],_t=Ne.map(he,this),Ft=we.call(this,_t,sr),Rt=Le.call(this,Ft,_t,sr),lr,sr=-1,Fr=_t.length,Or=Rt.length-1,hr=re?1:1/Fr,wr;++sr0)for(sr=-1;++sr=Ft[0]&&wr<=Ft[1]&&(lr=et[t.bisect(Rt,wr,1,Or)-1],lr.y+=hr,lr.push(Ne[sr]));return et}return Re.value=function(Ne){return arguments.length?(he=Ne,Re):he},Re.range=function(Ne){return arguments.length?(we=wt(Ne),Re):we},Re.bins=function(Ne){return arguments.length?(Le=typeof Ne=="number"?function(ut){return Zc(ut,Ne)}:wt(Ne),Re):Le},Re.frequency=function(Ne){return arguments.length?(re=!!Ne,Re):re},Re};function Yf(re,he){return Zc(re,Math.ceil(Math.log(he.length)/Math.LN2+1))}function Zc(re,he){for(var we=-1,Le=+re[0],Re=(re[1]-Le)/he,Ne=[];++we<=he;)Ne[we]=Re*we+Le;return Ne}function ic(re){return[t.min(re),t.max(re)]}t.layout.pack=function(){var re=t.layout.hierarchy().sort(Tf),he=0,we=[1,1],Le;function Re(Ne,ut){var et=re.call(this,Ne,ut),_t=et[0],Ft=we[0],Rt=we[1],lr=Le==null?Math.sqrt:typeof Le=="function"?Le:function(){return Le};if(_t.x=_t.y=0,Vl(_t,function(Fr){Fr.r=+lr(Fr.value)}),Vl(_t,Ud),he){var sr=he*(Le?1:Math.max(2*_t.r/Ft,2*_t.r/Rt))/2;Vl(_t,function(Fr){Fr.r+=sr}),Vl(_t,Ud),Vl(_t,function(Fr){Fr.r-=sr})}return Dh(_t,Ft/2,Rt/2,Le?1:1/Math.max(2*_t.r/Ft,2*_t.r/Rt)),et}return Re.size=function(Ne){return arguments.length?(we=Ne,Re):we},Re.radius=function(Ne){return arguments.length?(Le=Ne==null||typeof Ne=="function"?Ne:+Ne,Re):Le},Re.padding=function(Ne){return arguments.length?(he=+Ne,Re):he},ju(Re,re)};function Tf(re,he){return re.value-he.value}function Xf(re,he){var we=re._pack_next;re._pack_next=he,he._pack_prev=re,he._pack_next=we,we._pack_prev=he}function sd(re,he){re._pack_next=he,he._pack_prev=re}function Ch(re,he){var we=he.x-re.x,Le=he.y-re.y,Re=re.r+he.r;return .999*Re*Re>we*we+Le*Le}function Ud(re){if(!(he=re.children)||!(sr=he.length))return;var he,we=1/0,Le=-1/0,Re=1/0,Ne=-1/0,ut,et,_t,Ft,Rt,lr,sr;function Fr(Ar){we=Math.min(Ar.x-Ar.r,we),Le=Math.max(Ar.x+Ar.r,Le),Re=Math.min(Ar.y-Ar.r,Re),Ne=Math.max(Ar.y+Ar.r,Ne)}if(he.forEach(Zf),ut=he[0],ut.x=-ut.r,ut.y=0,Fr(ut),sr>1&&(et=he[1],et.x=et.r,et.y=0,Fr(et),sr>2))for(_t=he[2],Js(ut,et,_t),Fr(_t),Xf(ut,_t),ut._pack_prev=_t,Xf(_t,et),et=ut._pack_next,Ft=3;Ftwr.x&&(wr=Ci),Ci.depth>Cr.depth&&(Cr=Ci)});var Nr=he(hr,wr)/2-hr.x,jr=we[0]/(wr.x+he(wr,hr)/2+Nr),Ar=we[1]/(Cr.depth||1);ql(Fr,function(Ci){Ci.x=(Ci.x+Nr)*jr,Ci.y=Ci.depth*Ar})}return sr}function Ne(Rt){for(var lr={A:null,children:[Rt]},sr=[lr],Fr;(Fr=sr.pop())!=null;)for(var Or=Fr.children,hr,wr=0,Cr=Or.length;wr0&&(Jf(nt(hr,Rt,sr),Rt,Ci),Cr+=Ci,Nr+=Ci),jr+=hr.m,Cr+=Fr.m,Ar+=wr.m,Nr+=Or.m;hr&&!Lh(Or)&&(Or.t=hr,Or.m+=jr-Nr),Fr&&!Kf(wr)&&(wr.t=Fr,wr.m+=Cr-Ar,sr=Rt)}return sr}function Ft(Rt){Rt.x*=we[0],Rt.y=Rt.depth*we[1]}return Re.separation=function(Rt){return arguments.length?(he=Rt,Re):he},Re.size=function(Rt){return arguments.length?(Le=(we=Rt)==null?Ft:null,Re):Le?null:we},Re.nodeSize=function(Rt){return arguments.length?(Le=(we=Rt)==null?null:Ft,Re):Le?we:null},ju(Re,re)};function ou(re,he){return re.parent==he.parent?1:2}function Kf(re){var he=re.children;return he.length?he[0]:re.t}function Lh(re){var he=re.children,we;return(we=he.length)?he[we-1]:re.t}function Jf(re,he,we){var Le=we/(he.i-re.i);he.c-=Le,he.s+=we,re.c+=Le,he.z+=we,he.m+=we}function Af(re){for(var he=0,we=0,Le=re.children,Re=Le.length,Ne;--Re>=0;)Ne=Le[Re],Ne.z+=he,Ne.m+=he,he+=Ne.s+(we+=Ne.c)}function nt(re,he,we){return re.a.parent===he.parent?re.a:we}t.layout.cluster=function(){var re=t.layout.hierarchy().sort(null).value(null),he=ou,we=[1,1],Le=!1;function Re(Ne,ut){var et=re.call(this,Ne,ut),_t=et[0],Ft,Rt=0;Vl(_t,function(hr){var wr=hr.children;wr&&wr.length?(hr.x=Kt(wr),hr.y=Tt(wr)):(hr.x=Ft?Rt+=he(hr,Ft):0,hr.y=0,Ft=hr)});var lr=Bt(_t),sr=yr(_t),Fr=lr.x-he(lr,sr)/2,Or=sr.x+he(sr,lr)/2;return Vl(_t,Le?function(hr){hr.x=(hr.x-_t.x)*we[0],hr.y=(_t.y-hr.y)*we[1]}:function(hr){hr.x=(hr.x-Fr)/(Or-Fr)*we[0],hr.y=(1-(_t.y?hr.y/_t.y:1))*we[1]}),et}return Re.separation=function(Ne){return arguments.length?(he=Ne,Re):he},Re.size=function(Ne){return arguments.length?(Le=(we=Ne)==null,Re):Le?null:we},Re.nodeSize=function(Ne){return arguments.length?(Le=(we=Ne)!=null,Re):Le?we:null},ju(Re,re)};function Tt(re){return 1+t.max(re,function(he){return he.y})}function Kt(re){return re.reduce(function(he,we){return he+we.x},0)/re.length}function Bt(re){var he=re.children;return he&&he.length?Bt(he[0]):re}function yr(re){var he=re.children,we;return he&&(we=he.length)?yr(he[we-1]):re}t.layout.treemap=function(){var re=t.layout.hierarchy(),he=Math.round,we=[1,1],Le=null,Re=zr,Ne=!1,ut,et="squarify",_t=.5*(1+Math.sqrt(5));function Ft(hr,wr){for(var Cr=-1,Nr=hr.length,jr,Ar;++Cr0;)Nr.push(Ar=jr[ga-1]),Nr.area+=Ar.area,et!=="squarify"||(Gi=sr(Nr,aa))<=Ci?(jr.pop(),Ci=Gi):(Nr.area-=Nr.pop().area,Fr(Nr,aa,Cr,!1),aa=Math.min(Cr.dx,Cr.dy),Nr.length=Nr.area=0,Ci=1/0);Nr.length&&(Fr(Nr,aa,Cr,!0),Nr.length=Nr.area=0),wr.forEach(Rt)}}function lr(hr){var wr=hr.children;if(wr&&wr.length){var Cr=Re(hr),Nr=wr.slice(),jr,Ar=[];for(Ft(Nr,Cr.dx*Cr.dy/hr.value),Ar.area=0;jr=Nr.pop();)Ar.push(jr),Ar.area+=jr.area,jr.z!=null&&(Fr(Ar,jr.z?Cr.dx:Cr.dy,Cr,!Nr.length),Ar.length=Ar.area=0);wr.forEach(lr)}}function sr(hr,wr){for(var Cr=hr.area,Nr,jr=0,Ar=1/0,Ci=-1,Gi=hr.length;++Cijr&&(jr=Nr));return Cr*=Cr,wr*=wr,Cr?Math.max(wr*jr*_t/Cr,Cr/(wr*Ar*_t)):1/0}function Fr(hr,wr,Cr,Nr){var jr=-1,Ar=hr.length,Ci=Cr.x,Gi=Cr.y,aa=wr?he(hr.area/wr):0,ga;if(wr==Cr.dx){for((Nr||aa>Cr.dy)&&(aa=Cr.dy);++jrCr.dx)&&(aa=Cr.dx);++jr1);return re+he*Le*Math.sqrt(-2*Math.log(Ne)/Ne)}},logNormal:function(){var re=t.random.normal.apply(t,arguments);return function(){return Math.exp(re())}},bates:function(re){var he=t.random.irwinHall(re);return function(){return he()/re}},irwinHall:function(re){return function(){for(var he=0,we=0;we2?Di:Fi,Ft=Le?rc:kh;return Re=_t(re,he,Ft,we),Ne=_t(he,re,Ft,Tc),et}function et(_t){return Re(_t)}return et.invert=function(_t){return Ne(_t)},et.domain=function(_t){return arguments.length?(re=_t.map(Number),ut()):re},et.range=function(_t){return arguments.length?(he=_t,ut()):he},et.rangeRound=function(_t){return et.range(_t).interpolate(Bu)},et.clamp=function(_t){return arguments.length?(Le=_t,ut()):Le},et.interpolate=function(_t){return arguments.length?(we=_t,ut()):we},et.ticks=function(_t){return rn(re,_t)},et.tickFormat=function(_t,Ft){return d3_scale_linearTickFormat(re,_t,Ft)},et.nice=function(_t){return Pa(re,_t),ut()},et.copy=function(){return Wi(re,he,we,Le)},ut()}function Oa(re,he){return t.rebind(re,he,"range","rangeRound","interpolate","clamp")}function Pa(re,he){return $r(re,ni(Ja(re,he)[2])),$r(re,ni(Ja(re,he)[2])),re}function Ja(re,he){he==null&&(he=10);var we=ii(re),Le=we[1]-we[0],Re=Math.pow(10,Math.floor(Math.log(Le/he)/Math.LN10)),Ne=he/Le*Re;return Ne<=.15?Re*=10:Ne<=.35?Re*=5:Ne<=.75&&(Re*=2),we[0]=Math.ceil(we[0]/Re)*Re,we[1]=Math.floor(we[1]/Re)*Re+Re*.5,we[2]=Re,we}function rn(re,he){return t.range.apply(t,Ja(re,he))}var Zi={s:1,g:1,p:1,r:1,e:1};function sa(re){return-Math.floor(Math.log(re)/Math.LN10+.01)}function vn(re,he){var we=sa(he[2]);return re in Zi?Math.abs(we-sa(Math.max(v(he[0]),v(he[1]))))+ +(re!=="e"):we-(re==="%")*2}t.scale.log=function(){return Dn(t.scale.linear().domain([0,1]),10,!0,[1,10])};function Dn(re,he,we,Le){function Re(et){return(we?Math.log(et<0?0:et):-Math.log(et>0?0:-et))/Math.log(he)}function Ne(et){return we?Math.pow(he,et):-Math.pow(he,-et)}function ut(et){return re(Re(et))}return ut.invert=function(et){return Ne(re.invert(et))},ut.domain=function(et){return arguments.length?(we=et[0]>=0,re.domain((Le=et.map(Number)).map(Re)),ut):Le},ut.base=function(et){return arguments.length?(he=+et,re.domain(Le.map(Re)),ut):he},ut.nice=function(){var et=$r(Le.map(Re),we?Math:po);return re.domain(et),Le=et.map(Ne),ut},ut.ticks=function(){var et=ii(Le),_t=[],Ft=et[0],Rt=et[1],lr=Math.floor(Re(Ft)),sr=Math.ceil(Re(Rt)),Fr=he%1?2:he;if(isFinite(sr-lr)){if(we){for(;lr0;Or--)_t.push(Ne(lr)*Or);for(lr=0;_t[lr]Rt;sr--);_t=_t.slice(lr,sr)}return _t},ut.copy=function(){return Dn(re.copy(),he,we,Le)},Oa(ut,re)}var po={floor:function(re){return-Math.ceil(-re)},ceil:function(re){return-Math.floor(-re)}};t.scale.pow=function(){return zo(t.scale.linear(),1,[0,1])};function zo(re,he,we){var Le=wo(he),Re=wo(1/he);function Ne(ut){return re(Le(ut))}return Ne.invert=function(ut){return Re(re.invert(ut))},Ne.domain=function(ut){return arguments.length?(re.domain((we=ut.map(Number)).map(Le)),Ne):we},Ne.ticks=function(ut){return rn(we,ut)},Ne.tickFormat=function(ut,et){return d3_scale_linearTickFormat(we,ut,et)},Ne.nice=function(ut){return Ne.domain(Pa(we,ut))},Ne.exponent=function(ut){return arguments.length?(Le=wo(he=ut),Re=wo(1/he),re.domain(we.map(Le)),Ne):he},Ne.copy=function(){return zo(re.copy(),he,we)},Oa(Ne,re)}function wo(re){return function(he){return he<0?-Math.pow(-he,re):Math.pow(he,re)}}t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return $o([],{t:"range",a:[[]]})};function $o(re,he){var we,Le,Re;function Ne(et){return Le[((we.get(et)||(he.t==="range"?we.set(et,re.push(et)):NaN))-1)%Le.length]}function ut(et,_t){return t.range(re.length).map(function(Ft){return et+_t*Ft})}return Ne.domain=function(et){if(!arguments.length)return re;re=[],we=new M;for(var _t=-1,Ft=et.length,Rt;++_t0?we[Ne-1]:re[0],Nesr?0:1;if(Rt=ke)return _t(Rt,Or)+(Ft?_t(Ft,1-Or):"")+"Z";var hr,wr,Cr,Nr,jr=0,Ar=0,Ci,Gi,aa,ga,qa,Fa,Nn,ka,Sn=[];if((Nr=(+ut.apply(this,arguments)||0)/2)&&(Cr=Le===bu?Math.sqrt(Ft*Ft+Rt*Rt):+Le.apply(this,arguments),Or||(Ar*=-1),Rt&&(Ar=ft(Cr/Rt*Math.sin(Nr))),Ft&&(jr=ft(Cr/Ft*Math.sin(Nr)))),Rt){Ci=Rt*Math.cos(lr+Ar),Gi=Rt*Math.sin(lr+Ar),aa=Rt*Math.cos(sr-Ar),ga=Rt*Math.sin(sr-Ar);var ko=Math.abs(sr-lr-2*Ar)<=_e?0:1;if(Ar&&Kc(Ci,Gi,aa,ga)===Or^ko){var Vs=(lr+sr)/2;Ci=Rt*Math.cos(Vs),Gi=Rt*Math.sin(Vs),aa=ga=null}}else Ci=Gi=0;if(Ft){qa=Ft*Math.cos(sr-jr),Fa=Ft*Math.sin(sr-jr),Nn=Ft*Math.cos(lr+jr),ka=Ft*Math.sin(lr+jr);var Ho=Math.abs(lr-sr+2*jr)<=_e?0:1;if(jr&&Kc(qa,Fa,Nn,ka)===1-Or^Ho){var fa=(lr+sr)/2;qa=Ft*Math.cos(fa),Fa=Ft*Math.sin(fa),Nn=ka=null}}else qa=Fa=0;if(Fr>Ye&&(hr=Math.min(Math.abs(Rt-Ft)/2,+we.apply(this,arguments)))>.001){wr=Ft0?0:1}function ud(re,he,we,Le,Re){var Ne=re[0]-he[0],ut=re[1]-he[1],et=(Re?Le:-Le)/Math.sqrt(Ne*Ne+ut*ut),_t=et*ut,Ft=-et*Ne,Rt=re[0]+_t,lr=re[1]+Ft,sr=he[0]+_t,Fr=he[1]+Ft,Or=(Rt+sr)/2,hr=(lr+Fr)/2,wr=sr-Rt,Cr=Fr-lr,Nr=wr*wr+Cr*Cr,jr=we-Le,Ar=Rt*Fr-sr*lr,Ci=(Cr<0?-1:1)*Math.sqrt(Math.max(0,jr*jr*Nr-Ar*Ar)),Gi=(Ar*Cr-wr*Ci)/Nr,aa=(-Ar*wr-Cr*Ci)/Nr,ga=(Ar*Cr+wr*Ci)/Nr,qa=(-Ar*wr+Cr*Ci)/Nr,Fa=Gi-Or,Nn=aa-hr,ka=ga-Or,Sn=qa-hr;return Fa*Fa+Nn*Nn>ka*ka+Sn*Sn&&(Gi=ga,aa=qa),[[Gi-_t,aa-Ft],[Gi*we/jr,aa*we/jr]]}function Qf(){return!0}function qd(re){var he=Cn,we=_n,Le=Qf,Re=Hl,Ne=Re.key,ut=.7;function et(_t){var Ft=[],Rt=[],lr=-1,sr=_t.length,Fr,Or=wt(he),hr=wt(we);function wr(){Ft.push("M",Re(re(Rt),ut))}for(;++lr1?re.join("L"):re+"Z"}function Vd(re){return re.join("L")+"Z"}function Mf(re){for(var he=0,we=re.length,Le=re[0],Re=[Le[0],",",Le[1]];++he1&&Re.push("H",Le[0]),Re.join("")}function Ph(re){for(var he=0,we=re.length,Le=re[0],Re=[Le[0],",",Le[1]];++he1){et=he[1],Ne=re[_t],_t++,Le+="C"+(Re[0]+ut[0])+","+(Re[1]+ut[1])+","+(Ne[0]-et[0])+","+(Ne[1]-et[1])+","+Ne[0]+","+Ne[1];for(var Ft=2;Ft9&&(Ne=we*3/Math.sqrt(Ne),ut[et]=Ne*Le,ut[et+1]=Ne*Re));for(et=-1;++et<=_t;)Ne=(re[Math.min(_t,et+1)][0]-re[Math.max(0,et-1)][0])/(6*(1+ut[et]*ut[et])),he.push([Ne||0,ut[et]*Ne||0]);return he}function Vt(re){return re.length<3?Hl(re):re[0]+eh(re,pt(re))}t.svg.line.radial=function(){var re=qd(tr);return re.radius=re.x,delete re.x,re.angle=re.y,delete re.y,re};function tr(re){for(var he,we=-1,Le=re.length,Re,Ne;++we_e)+",1 "+lr}function Ft(Rt,lr,sr,Fr){return"Q 0,0 "+Fr}return Ne.radius=function(Rt){return arguments.length?(we=wt(Rt),Ne):we},Ne.source=function(Rt){return arguments.length?(re=wt(Rt),Ne):re},Ne.target=function(Rt){return arguments.length?(he=wt(Rt),Ne):he},Ne.startAngle=function(Rt){return arguments.length?(Le=wt(Rt),Ne):Le},Ne.endAngle=function(Rt){return arguments.length?(Re=wt(Rt),Ne):Re},Ne};function Sr(re){return re.radius}t.svg.diagonal=function(){var re=rr,he=pr,we=Rr;function Le(Re,Ne){var ut=re.call(this,Re,Ne),et=he.call(this,Re,Ne),_t=(ut.y+et.y)/2,Ft=[ut,{x:ut.x,y:_t},{x:et.x,y:_t},et];return Ft=Ft.map(we),"M"+Ft[0]+"C"+Ft[1]+" "+Ft[2]+" "+Ft[3]}return Le.source=function(Re){return arguments.length?(re=wt(Re),Le):re},Le.target=function(Re){return arguments.length?(he=wt(Re),Le):he},Le.projection=function(Re){return arguments.length?(we=Re,Le):we},Le};function Rr(re){return[re.x,re.y]}t.svg.diagonal.radial=function(){var re=t.svg.diagonal(),he=Rr,we=re.projection;return re.projection=function(Le){return arguments.length?we(Zr(he=Le)):he},re};function Zr(re){return function(){var he=re.apply(this,arguments),we=he[0],Le=he[1]-Ee;return[we*Math.cos(Le),we*Math.sin(Le)]}}t.svg.symbol=function(){var re=qi,he=wi;function we(Le,Re){return(un.get(re.call(this,Le,Re))||Aa)(he.call(this,Le,Re))}return we.type=function(Le){return arguments.length?(re=wt(Le),we):re},we.size=function(Le){return arguments.length?(he=wt(Le),we):he},we};function wi(){return 64}function qi(){return"circle"}function Aa(re){var he=Math.sqrt(re/_e);return"M0,"+he+"A"+he+","+he+" 0 1,1 0,"+-he+"A"+he+","+he+" 0 1,1 0,"+he+"Z"}var un=t.map({circle:Aa,cross:function(re){var he=Math.sqrt(re/5)/2;return"M"+-3*he+","+-he+"H"+-he+"V"+-3*he+"H"+he+"V"+-he+"H"+3*he+"V"+he+"H"+he+"V"+3*he+"H"+-he+"V"+he+"H"+-3*he+"Z"},diamond:function(re){var he=Math.sqrt(re/(2*Tn)),we=he*Tn;return"M0,"+-he+"L"+we+",0 0,"+he+" "+-we+",0Z"},square:function(re){var he=Math.sqrt(re)/2;return"M"+-he+","+-he+"L"+he+","+-he+" "+he+","+he+" "+-he+","+he+"Z"},"triangle-down":function(re){var he=Math.sqrt(re/gn),we=he*gn/2;return"M0,"+we+"L"+he+","+-we+" "+-he+","+-we+"Z"},"triangle-up":function(re){var he=Math.sqrt(re/gn),we=he*gn/2;return"M0,"+-we+"L"+he+","+we+" "+-he+","+we+"Z"}});t.svg.symbolTypes=un.keys();var gn=Math.sqrt(3),Tn=Math.tan(30*De);j.transition=function(re){for(var he=ol||++ls,we=dl(re),Le=[],Re,Ne,ut=wl||{time:Date.now(),ease:Ac,delay:0,duration:250},et=-1,_t=this.length;++et<_t;){Le.push(Re=[]);for(var Ft=this[et],Rt=-1,lr=Ft.length;++Rt0;)lr[--Nr].call(re,Cr);if(wr>=1)return ut.event&&ut.event.end.call(re,re.__data__,he),--Ne.count?delete Ne[Le]:delete re[we],1}ut||(et=Re.time,_t=ba(sr,0,et),ut=Ne[Le]={tween:new M,time:et,timer:_t,delay:Re.delay,duration:Re.duration,ease:Re.ease,index:he},Re=null,++Ne.count)}t.svg.axis=function(){var re=t.scale.linear(),he=Tu,we=6,Le=6,Re=3,Ne=[10],ut=null,et;function _t(Ft){Ft.each(function(){var Rt=t.select(this),lr=this.__chart__||re,sr=this.__chart__=re.copy(),Fr=ut??(sr.ticks?sr.ticks.apply(sr,Ne):sr.domain()),Or=et??(sr.tickFormat?sr.tickFormat.apply(sr,Ne):P),hr=Rt.selectAll(".tick").data(Fr,sr),wr=hr.enter().insert("g",".domain").attr("class","tick").style("opacity",Ye),Cr=t.transition(hr.exit()).style("opacity",Ye).remove(),Nr=t.transition(hr.order()).style("opacity",1),jr=Math.max(we,0)+Re,Ar,Ci=li(sr),Gi=Rt.selectAll(".domain").data([0]),aa=(Gi.enter().append("path").attr("class","domain"),t.transition(Gi));wr.append("line"),wr.append("text");var ga=wr.select("line"),qa=Nr.select("line"),Fa=hr.select("text").text(Or),Nn=wr.select("text"),ka=Nr.select("text"),Sn=he==="top"||he==="left"?-1:1,ko,Vs,Ho,fa;if(he==="bottom"||he==="top"?(Ar=oc,ko="x",Ho="y",Vs="x2",fa="y2",Fa.attr("dy",Sn<0?"0em":".71em").style("text-anchor","middle"),aa.attr("d","M"+Ci[0]+","+Sn*Le+"V0H"+Ci[1]+"V"+Sn*Le)):(Ar=sc,ko="y",Ho="x",Vs="y2",fa="x2",Fa.attr("dy",".32em").style("text-anchor",Sn<0?"end":"start"),aa.attr("d","M"+Sn*Le+","+Ci[0]+"H0V"+Ci[1]+"H"+Sn*Le)),ga.attr(fa,Sn*we),Nn.attr(Ho,Sn*jr),qa.attr(Vs,0).attr(fa,Sn*we),ka.attr(ko,0).attr(Ho,Sn*jr),sr.rangeBand){var jn=sr,Gn=jn.rangeBand()/2;lr=sr=function(Po){return jn(Po)+Gn}}else lr.rangeBand?lr=sr:Cr.call(Ar,sr,lr);wr.call(Ar,lr,sr),Nr.call(Ar,sr,sr)})}return _t.scale=function(Ft){return arguments.length?(re=Ft,_t):re},_t.orient=function(Ft){return arguments.length?(he=Ft in nc?Ft+"":Tu,_t):he},_t.ticks=function(){return arguments.length?(Ne=a(arguments),_t):Ne},_t.tickValues=function(Ft){return arguments.length?(ut=Ft,_t):ut},_t.tickFormat=function(Ft){return arguments.length?(et=Ft,_t):et},_t.tickSize=function(Ft){var Rt=arguments.length;return Rt?(we=+Ft,Le=+arguments[Rt-1],_t):we},_t.innerTickSize=function(Ft){return arguments.length?(we=+Ft,_t):we},_t.outerTickSize=function(Ft){return arguments.length?(Le=+Ft,_t):Le},_t.tickPadding=function(Ft){return arguments.length?(Re=+Ft,_t):Re},_t.tickSubdivide=function(){return arguments.length&&_t},_t};var Tu="bottom",nc={top:1,right:1,bottom:1,left:1};function oc(re,he,we){re.attr("transform",function(Le){var Re=he(Le);return"translate("+(isFinite(Re)?Re:we(Le))+",0)"})}function sc(re,he,we){re.attr("transform",function(Le){var Re=he(Le);return"translate(0,"+(isFinite(Re)?Re:we(Le))+")"})}t.svg.brush=function(){var re=Z(Rt,"brushstart","brush","brushend"),he=null,we=null,Le=[0,0],Re=[0,0],Ne,ut,et=!0,_t=!0,Ft=Gu[0];function Rt(hr){hr.each(function(){var wr=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Or).on("touchstart.brush",Or),Cr=wr.selectAll(".background").data([0]);Cr.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),wr.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Nr=wr.selectAll(".resize").data(Ft,P);Nr.exit().remove(),Nr.enter().append("g").attr("class",function(Gi){return"resize "+Gi}).style("cursor",function(Gi){return Ic[Gi]}).append("rect").attr("x",function(Gi){return/[ew]$/.test(Gi)?-3:null}).attr("y",function(Gi){return/^[ns]/.test(Gi)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Nr.style("display",Rt.empty()?"none":null);var jr=t.transition(wr),Ar=t.transition(Cr),Ci;he&&(Ci=li(he),Ar.attr("x",Ci[0]).attr("width",Ci[1]-Ci[0]),sr(jr)),we&&(Ci=li(we),Ar.attr("y",Ci[0]).attr("height",Ci[1]-Ci[0]),Fr(jr)),lr(jr)})}Rt.event=function(hr){hr.each(function(){var wr=re.of(this,arguments),Cr={x:Le,y:Re,i:Ne,j:ut},Nr=this.__chart__||Cr;this.__chart__=Cr,ol?t.select(this).transition().each("start.brush",function(){Ne=Nr.i,ut=Nr.j,Le=Nr.x,Re=Nr.y,wr({type:"brushstart"})}).tween("brush:brush",function(){var jr=tc(Le,Cr.x),Ar=tc(Re,Cr.y);return Ne=ut=null,function(Ci){Le=Cr.x=jr(Ci),Re=Cr.y=Ar(Ci),wr({type:"brush",mode:"resize"})}}).each("end.brush",function(){Ne=Cr.i,ut=Cr.j,wr({type:"brush",mode:"resize"}),wr({type:"brushend"})}):(wr({type:"brushstart"}),wr({type:"brush",mode:"resize"}),wr({type:"brushend"}))})};function lr(hr){hr.selectAll(".resize").attr("transform",function(wr){return"translate("+Le[+/e$/.test(wr)]+","+Re[+/^s/.test(wr)]+")"})}function sr(hr){hr.select(".extent").attr("x",Le[0]),hr.selectAll(".extent,.n>rect,.s>rect").attr("width",Le[1]-Le[0])}function Fr(hr){hr.select(".extent").attr("y",Re[0]),hr.selectAll(".extent,.e>rect,.w>rect").attr("height",Re[1]-Re[0])}function Or(){var hr=this,wr=t.select(t.event.target),Cr=re.of(hr,arguments),Nr=t.select(hr),jr=wr.datum(),Ar=!/^(n|s)$/.test(jr)&&he,Ci=!/^(e|w)$/.test(jr)&&we,Gi=wr.classed("extent"),aa=mt(hr),ga,qa=t.mouse(hr),Fa,Nn=t.select(l(hr)).on("keydown.brush",ko).on("keyup.brush",Vs);if(t.event.changedTouches?Nn.on("touchmove.brush",Ho).on("touchend.brush",jn):Nn.on("mousemove.brush",Ho).on("mouseup.brush",jn),Nr.interrupt().selectAll("*").interrupt(),Gi)qa[0]=Le[0]-qa[0],qa[1]=Re[0]-qa[1];else if(jr){var ka=+/w$/.test(jr),Sn=+/^n/.test(jr);Fa=[Le[1-ka]-qa[0],Re[1-Sn]-qa[1]],qa[0]=Le[ka],qa[1]=Re[Sn]}else t.event.altKey&&(ga=qa.slice());Nr.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",wr.style("cursor")),Cr({type:"brushstart"}),Ho();function ko(){t.event.keyCode==32&&(Gi||(ga=null,qa[0]-=Le[1],qa[1]-=Re[1],Gi=2),W())}function Vs(){t.event.keyCode==32&&Gi==2&&(qa[0]+=Le[1],qa[1]+=Re[1],Gi=0,W())}function Ho(){var Gn=t.mouse(hr),Po=!1;Fa&&(Gn[0]+=Fa[0],Gn[1]+=Fa[1]),Gi||(t.event.altKey?(ga||(ga=[(Le[0]+Le[1])/2,(Re[0]+Re[1])/2]),qa[0]=Le[+(Gn[0]0))return Ke;do Ke.push(vt=new Date(+je)),ue(je,Ze),Q(je);while(vt=Ve)for(;Q(Ve),!je(Ve);)Ve.setTime(Ve-1)},function(Ve,Ze){if(Ve>=Ve)if(Ze<0)for(;++Ze<=0;)for(;ue(Ve,-1),!je(Ve););else for(;--Ze>=0;)for(;ue(Ve,1),!je(Ve););})},ge&&(Te.count=function(je,Ve){return i.setTime(+je),a.setTime(+Ve),Q(i),Q(a),Math.floor(ge(i,a))},Te.every=function(je){return je=Math.floor(je),!isFinite(je)||!(je>0)?null:je>1?Te.filter(Me?function(Ve){return Me(Ve)%je===0}:function(Ve){return Te.count(0,Ve)%je===0}):Te}),Te}var s=o(function(){},function(Q,ue){Q.setTime(+Q+ue)},function(Q,ue){return ue-Q});s.every=function(Q){return Q=Math.floor(Q),!isFinite(Q)||!(Q>0)?null:Q>1?o(function(ue){ue.setTime(Math.floor(ue/Q)*Q)},function(ue,ge){ue.setTime(+ue+ge*Q)},function(ue,ge){return(ge-ue)/Q}):s};var l=s.range,n=1e3,u=6e4,c=36e5,f=864e5,h=6048e5,d=o(function(Q){Q.setTime(Q-Q.getMilliseconds())},function(Q,ue){Q.setTime(+Q+ue*n)},function(Q,ue){return(ue-Q)/n},function(Q){return Q.getUTCSeconds()}),p=d.range,g=o(function(Q){Q.setTime(Q-Q.getMilliseconds()-Q.getSeconds()*n)},function(Q,ue){Q.setTime(+Q+ue*u)},function(Q,ue){return(ue-Q)/u},function(Q){return Q.getMinutes()}),m=g.range,y=o(function(Q){Q.setTime(Q-Q.getMilliseconds()-Q.getSeconds()*n-Q.getMinutes()*u)},function(Q,ue){Q.setTime(+Q+ue*c)},function(Q,ue){return(ue-Q)/c},function(Q){return Q.getHours()}),_=y.range,v=o(function(Q){Q.setHours(0,0,0,0)},function(Q,ue){Q.setDate(Q.getDate()+ue)},function(Q,ue){return(ue-Q-(ue.getTimezoneOffset()-Q.getTimezoneOffset())*u)/f},function(Q){return Q.getDate()-1}),x=v.range;function S(Q){return o(function(ue){ue.setDate(ue.getDate()-(ue.getDay()+7-Q)%7),ue.setHours(0,0,0,0)},function(ue,ge){ue.setDate(ue.getDate()+ge*7)},function(ue,ge){return(ge-ue-(ge.getTimezoneOffset()-ue.getTimezoneOffset())*u)/h})}var M=S(0),C=S(1),w=S(2),k=S(3),A=S(4),b=S(5),E=S(6),T=M.range,F=C.range,D=w.range,R=k.range,P=A.range,z=b.range,I=E.range,L=o(function(Q){Q.setDate(1),Q.setHours(0,0,0,0)},function(Q,ue){Q.setMonth(Q.getMonth()+ue)},function(Q,ue){return ue.getMonth()-Q.getMonth()+(ue.getFullYear()-Q.getFullYear())*12},function(Q){return Q.getMonth()}),B=L.range,O=o(function(Q){Q.setMonth(0,1),Q.setHours(0,0,0,0)},function(Q,ue){Q.setFullYear(Q.getFullYear()+ue)},function(Q,ue){return ue.getFullYear()-Q.getFullYear()},function(Q){return Q.getFullYear()});O.every=function(Q){return!isFinite(Q=Math.floor(Q))||!(Q>0)?null:o(function(ue){ue.setFullYear(Math.floor(ue.getFullYear()/Q)*Q),ue.setMonth(0,1),ue.setHours(0,0,0,0)},function(ue,ge){ue.setFullYear(ue.getFullYear()+ge*Q)})};var G=O.range,W=o(function(Q){Q.setUTCSeconds(0,0)},function(Q,ue){Q.setTime(+Q+ue*u)},function(Q,ue){return(ue-Q)/u},function(Q){return Q.getUTCMinutes()}),X=W.range,Z=o(function(Q){Q.setUTCMinutes(0,0,0)},function(Q,ue){Q.setTime(+Q+ue*c)},function(Q,ue){return(ue-Q)/c},function(Q){return Q.getUTCHours()}),J=Z.range,N=o(function(Q){Q.setUTCHours(0,0,0,0)},function(Q,ue){Q.setUTCDate(Q.getUTCDate()+ue)},function(Q,ue){return(ue-Q)/f},function(Q){return Q.getUTCDate()-1}),H=N.range;function $(Q){return o(function(ue){ue.setUTCDate(ue.getUTCDate()-(ue.getUTCDay()+7-Q)%7),ue.setUTCHours(0,0,0,0)},function(ue,ge){ue.setUTCDate(ue.getUTCDate()+ge*7)},function(ue,ge){return(ge-ue)/h})}var U=$(0),V=$(1),j=$(2),q=$(3),Y=$(4),K=$(5),te=$(6),ne=U.range,se=V.range,le=j.range,ce=q.range,pe=Y.range,xe=K.range,ye=te.range,fe=o(function(Q){Q.setUTCDate(1),Q.setUTCHours(0,0,0,0)},function(Q,ue){Q.setUTCMonth(Q.getUTCMonth()+ue)},function(Q,ue){return ue.getUTCMonth()-Q.getUTCMonth()+(ue.getUTCFullYear()-Q.getUTCFullYear())*12},function(Q){return Q.getUTCMonth()}),ae=fe.range,ee=o(function(Q){Q.setUTCMonth(0,1),Q.setUTCHours(0,0,0,0)},function(Q,ue){Q.setUTCFullYear(Q.getUTCFullYear()+ue)},function(Q,ue){return ue.getUTCFullYear()-Q.getUTCFullYear()},function(Q){return Q.getUTCFullYear()});ee.every=function(Q){return!isFinite(Q=Math.floor(Q))||!(Q>0)?null:o(function(ue){ue.setUTCFullYear(Math.floor(ue.getUTCFullYear()/Q)*Q),ue.setUTCMonth(0,1),ue.setUTCHours(0,0,0,0)},function(ue,ge){ue.setUTCFullYear(ue.getUTCFullYear()+ge*Q)})};var ie=ee.range;t.timeDay=v,t.timeDays=x,t.timeFriday=b,t.timeFridays=z,t.timeHour=y,t.timeHours=_,t.timeInterval=o,t.timeMillisecond=s,t.timeMilliseconds=l,t.timeMinute=g,t.timeMinutes=m,t.timeMonday=C,t.timeMondays=F,t.timeMonth=L,t.timeMonths=B,t.timeSaturday=E,t.timeSaturdays=I,t.timeSecond=d,t.timeSeconds=p,t.timeSunday=M,t.timeSundays=T,t.timeThursday=A,t.timeThursdays=P,t.timeTuesday=w,t.timeTuesdays=D,t.timeWednesday=k,t.timeWednesdays=R,t.timeWeek=M,t.timeWeeks=T,t.timeYear=O,t.timeYears=G,t.utcDay=N,t.utcDays=H,t.utcFriday=K,t.utcFridays=xe,t.utcHour=Z,t.utcHours=J,t.utcMillisecond=s,t.utcMilliseconds=l,t.utcMinute=W,t.utcMinutes=X,t.utcMonday=V,t.utcMondays=se,t.utcMonth=fe,t.utcMonths=ae,t.utcSaturday=te,t.utcSaturdays=ye,t.utcSecond=d,t.utcSeconds=p,t.utcSunday=U,t.utcSundays=ne,t.utcThursday=Y,t.utcThursdays=pe,t.utcTuesday=j,t.utcTuesdays=le,t.utcWednesday=q,t.utcWednesdays=ce,t.utcWeek=U,t.utcWeeks=ne,t.utcYear=ee,t.utcYears=ie,Object.defineProperty(t,"__esModule",{value:!0})})}}),eo=de({"node_modules/d3-time-format/dist/d3-time-format.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e,Ba()):(t=t||self,i(t.d3=t.d3||{},t.d3))})(e,function(t,i){"use strict";function a(Ee){if(0<=Ee.y&&Ee.y<100){var De=new Date(-1,Ee.m,Ee.d,Ee.H,Ee.M,Ee.S,Ee.L);return De.setFullYear(Ee.y),De}return new Date(Ee.y,Ee.m,Ee.d,Ee.H,Ee.M,Ee.S,Ee.L)}function o(Ee){if(0<=Ee.y&&Ee.y<100){var De=new Date(Date.UTC(-1,Ee.m,Ee.d,Ee.H,Ee.M,Ee.S,Ee.L));return De.setUTCFullYear(Ee.y),De}return new Date(Date.UTC(Ee.y,Ee.m,Ee.d,Ee.H,Ee.M,Ee.S,Ee.L))}function s(Ee,De,Je){return{y:Ee,m:De,d:Je,H:0,M:0,S:0,L:0}}function l(Ee){var De=Ee.dateTime,Je=Ee.date,Ue=Ee.time,at=Ee.periods,rt=Ee.days,ft=Ee.shortDays,At=Ee.months,ht=Ee.shortMonths,Gt=p(at),fr=g(at),gt=p(rt),yt=g(rt),kt=p(ft),Lt=g(ft),Ct=p(At),$t=g(At),mr=p(ht),br=g(ht),Er={a:dn,A:pi,b:Jr,B:Be,c:null,d:L,e:L,f:X,g:K,G:ne,H:B,I:O,j:G,L:W,m:Z,M:J,p:Fe,q:Et,Q:mt,s:Mt,S:N,u:H,U:$,V,w:j,W:q,x:null,X:null,y:Y,Y:te,Z:se,"%":Pt},Tr={a:St,A:zt,b:Wt,B:Yt,c:null,d:le,e:le,f:fe,g:Ze,G:vt,H:ce,I:pe,j:xe,L:ye,m:ae,M:ee,p:ze,q:tt,Q:mt,s:Mt,S:ie,u:Q,U:ue,V:Me,w:Te,W:je,x:null,X:null,y:Ve,Y:Ke,Z:xt,"%":Pt},Ur={a:$i,A:ja,b:ya,B:pa,c:xi,d:A,e:A,f:R,g:M,G:S,H:E,I:E,j:b,L:D,m:k,M:T,p:ea,q:w,Q:z,s:I,S:F,u:y,U:_,V:v,w:m,W:x,x:bi,X:Ua,y:M,Y:S,Z:C,"%":P};Er.x=Ai(Je,Er),Er.X=Ai(Ue,Er),Er.c=Ai(De,Er),Tr.x=Ai(Je,Tr),Tr.X=Ai(Ue,Tr),Tr.c=Ai(De,Tr);function Ai(ct,wt){return function(Nt){var It=[],Zt=-1,qt=0,vr=ct.length,Br,Pr,Mi;for(Nt instanceof Date||(Nt=new Date(+Nt));++Zt53)return null;"w"in It||(It.w=1),"Z"in It?(qt=o(s(It.y,0,1)),vr=qt.getUTCDay(),qt=vr>4||vr===0?i.utcMonday.ceil(qt):i.utcMonday(qt),qt=i.utcDay.offset(qt,(It.V-1)*7),It.y=qt.getUTCFullYear(),It.m=qt.getUTCMonth(),It.d=qt.getUTCDate()+(It.w+6)%7):(qt=a(s(It.y,0,1)),vr=qt.getDay(),qt=vr>4||vr===0?i.timeMonday.ceil(qt):i.timeMonday(qt),qt=i.timeDay.offset(qt,(It.V-1)*7),It.y=qt.getFullYear(),It.m=qt.getMonth(),It.d=qt.getDate()+(It.w+6)%7)}else("W"in It||"U"in It)&&("w"in It||(It.w="u"in It?It.u%7:"W"in It?1:0),vr="Z"in It?o(s(It.y,0,1)).getUTCDay():a(s(It.y,0,1)).getDay(),It.m=0,It.d="W"in It?(It.w+6)%7+It.W*7-(vr+5)%7:It.w+It.U*7-(vr+6)%7);return"Z"in It?(It.H+=It.Z/100|0,It.M+=It.Z%100,o(It)):a(It)}}function Qr(ct,wt,Nt,It){for(var Zt=0,qt=wt.length,vr=Nt.length,Br,Pr;Zt=vr)return-1;if(Br=wt.charCodeAt(Zt++),Br===37){if(Br=wt.charAt(Zt++),Pr=Ur[Br in n?wt.charAt(Zt++):Br],!Pr||(It=Pr(ct,Nt,It))<0)return-1}else if(Br!=Nt.charCodeAt(It++))return-1}return It}function ea(ct,wt,Nt){var It=Gt.exec(wt.slice(Nt));return It?(ct.p=fr[It[0].toLowerCase()],Nt+It[0].length):-1}function $i(ct,wt,Nt){var It=kt.exec(wt.slice(Nt));return It?(ct.w=Lt[It[0].toLowerCase()],Nt+It[0].length):-1}function ja(ct,wt,Nt){var It=gt.exec(wt.slice(Nt));return It?(ct.w=yt[It[0].toLowerCase()],Nt+It[0].length):-1}function ya(ct,wt,Nt){var It=mr.exec(wt.slice(Nt));return It?(ct.m=br[It[0].toLowerCase()],Nt+It[0].length):-1}function pa(ct,wt,Nt){var It=Ct.exec(wt.slice(Nt));return It?(ct.m=$t[It[0].toLowerCase()],Nt+It[0].length):-1}function xi(ct,wt,Nt){return Qr(ct,De,wt,Nt)}function bi(ct,wt,Nt){return Qr(ct,Je,wt,Nt)}function Ua(ct,wt,Nt){return Qr(ct,Ue,wt,Nt)}function dn(ct){return ft[ct.getDay()]}function pi(ct){return rt[ct.getDay()]}function Jr(ct){return ht[ct.getMonth()]}function Be(ct){return At[ct.getMonth()]}function Fe(ct){return at[+(ct.getHours()>=12)]}function Et(ct){return 1+~~(ct.getMonth()/3)}function St(ct){return ft[ct.getUTCDay()]}function zt(ct){return rt[ct.getUTCDay()]}function Wt(ct){return ht[ct.getUTCMonth()]}function Yt(ct){return At[ct.getUTCMonth()]}function ze(ct){return at[+(ct.getUTCHours()>=12)]}function tt(ct){return 1+~~(ct.getUTCMonth()/3)}return{format:function(ct){var wt=Ai(ct+="",Er);return wt.toString=function(){return ct},wt},parse:function(ct){var wt=oi(ct+="",!1);return wt.toString=function(){return ct},wt},utcFormat:function(ct){var wt=Ai(ct+="",Tr);return wt.toString=function(){return ct},wt},utcParse:function(ct){var wt=oi(ct+="",!0);return wt.toString=function(){return ct},wt}}}var n={"-":"",_:" ",0:"0"},u=/^\s*\d+/,c=/^%/,f=/[\\^$*+?|[\]().{}]/g;function h(Ee,De,Je){var Ue=Ee<0?"-":"",at=(Ue?-Ee:Ee)+"",rt=at.length;return Ue+(rt68?1900:2e3),Je+Ue[0].length):-1}function C(Ee,De,Je){var Ue=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(De.slice(Je,Je+6));return Ue?(Ee.Z=Ue[1]?0:-(Ue[2]+(Ue[3]||"00")),Je+Ue[0].length):-1}function w(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+1));return Ue?(Ee.q=Ue[0]*3-3,Je+Ue[0].length):-1}function k(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+2));return Ue?(Ee.m=Ue[0]-1,Je+Ue[0].length):-1}function A(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+2));return Ue?(Ee.d=+Ue[0],Je+Ue[0].length):-1}function b(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+3));return Ue?(Ee.m=0,Ee.d=+Ue[0],Je+Ue[0].length):-1}function E(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+2));return Ue?(Ee.H=+Ue[0],Je+Ue[0].length):-1}function T(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+2));return Ue?(Ee.M=+Ue[0],Je+Ue[0].length):-1}function F(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+2));return Ue?(Ee.S=+Ue[0],Je+Ue[0].length):-1}function D(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+3));return Ue?(Ee.L=+Ue[0],Je+Ue[0].length):-1}function R(Ee,De,Je){var Ue=u.exec(De.slice(Je,Je+6));return Ue?(Ee.L=Math.floor(Ue[0]/1e3),Je+Ue[0].length):-1}function P(Ee,De,Je){var Ue=c.exec(De.slice(Je,Je+1));return Ue?Je+Ue[0].length:-1}function z(Ee,De,Je){var Ue=u.exec(De.slice(Je));return Ue?(Ee.Q=+Ue[0],Je+Ue[0].length):-1}function I(Ee,De,Je){var Ue=u.exec(De.slice(Je));return Ue?(Ee.s=+Ue[0],Je+Ue[0].length):-1}function L(Ee,De){return h(Ee.getDate(),De,2)}function B(Ee,De){return h(Ee.getHours(),De,2)}function O(Ee,De){return h(Ee.getHours()%12||12,De,2)}function G(Ee,De){return h(1+i.timeDay.count(i.timeYear(Ee),Ee),De,3)}function W(Ee,De){return h(Ee.getMilliseconds(),De,3)}function X(Ee,De){return W(Ee,De)+"000"}function Z(Ee,De){return h(Ee.getMonth()+1,De,2)}function J(Ee,De){return h(Ee.getMinutes(),De,2)}function N(Ee,De){return h(Ee.getSeconds(),De,2)}function H(Ee){var De=Ee.getDay();return De===0?7:De}function $(Ee,De){return h(i.timeSunday.count(i.timeYear(Ee)-1,Ee),De,2)}function U(Ee){var De=Ee.getDay();return De>=4||De===0?i.timeThursday(Ee):i.timeThursday.ceil(Ee)}function V(Ee,De){return Ee=U(Ee),h(i.timeThursday.count(i.timeYear(Ee),Ee)+(i.timeYear(Ee).getDay()===4),De,2)}function j(Ee){return Ee.getDay()}function q(Ee,De){return h(i.timeMonday.count(i.timeYear(Ee)-1,Ee),De,2)}function Y(Ee,De){return h(Ee.getFullYear()%100,De,2)}function K(Ee,De){return Ee=U(Ee),h(Ee.getFullYear()%100,De,2)}function te(Ee,De){return h(Ee.getFullYear()%1e4,De,4)}function ne(Ee,De){var Je=Ee.getDay();return Ee=Je>=4||Je===0?i.timeThursday(Ee):i.timeThursday.ceil(Ee),h(Ee.getFullYear()%1e4,De,4)}function se(Ee){var De=Ee.getTimezoneOffset();return(De>0?"-":(De*=-1,"+"))+h(De/60|0,"0",2)+h(De%60,"0",2)}function le(Ee,De){return h(Ee.getUTCDate(),De,2)}function ce(Ee,De){return h(Ee.getUTCHours(),De,2)}function pe(Ee,De){return h(Ee.getUTCHours()%12||12,De,2)}function xe(Ee,De){return h(1+i.utcDay.count(i.utcYear(Ee),Ee),De,3)}function ye(Ee,De){return h(Ee.getUTCMilliseconds(),De,3)}function fe(Ee,De){return ye(Ee,De)+"000"}function ae(Ee,De){return h(Ee.getUTCMonth()+1,De,2)}function ee(Ee,De){return h(Ee.getUTCMinutes(),De,2)}function ie(Ee,De){return h(Ee.getUTCSeconds(),De,2)}function Q(Ee){var De=Ee.getUTCDay();return De===0?7:De}function ue(Ee,De){return h(i.utcSunday.count(i.utcYear(Ee)-1,Ee),De,2)}function ge(Ee){var De=Ee.getUTCDay();return De>=4||De===0?i.utcThursday(Ee):i.utcThursday.ceil(Ee)}function Me(Ee,De){return Ee=ge(Ee),h(i.utcThursday.count(i.utcYear(Ee),Ee)+(i.utcYear(Ee).getUTCDay()===4),De,2)}function Te(Ee){return Ee.getUTCDay()}function je(Ee,De){return h(i.utcMonday.count(i.utcYear(Ee)-1,Ee),De,2)}function Ve(Ee,De){return h(Ee.getUTCFullYear()%100,De,2)}function Ze(Ee,De){return Ee=ge(Ee),h(Ee.getUTCFullYear()%100,De,2)}function Ke(Ee,De){return h(Ee.getUTCFullYear()%1e4,De,4)}function vt(Ee,De){var Je=Ee.getUTCDay();return Ee=Je>=4||Je===0?i.utcThursday(Ee):i.utcThursday.ceil(Ee),h(Ee.getUTCFullYear()%1e4,De,4)}function xt(){return"+0000"}function Pt(){return"%"}function mt(Ee){return+Ee}function Mt(Ee){return Math.floor(+Ee/1e3)}var lt;qe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function qe(Ee){return lt=l(Ee),t.timeFormat=lt.format,t.timeParse=lt.parse,t.utcFormat=lt.utcFormat,t.utcParse=lt.utcParse,lt}var Ye="%Y-%m-%dT%H:%M:%S.%LZ";function me(Ee){return Ee.toISOString()}var _e=Date.prototype.toISOString?me:t.utcFormat(Ye);function Ae(Ee){var De=new Date(Ee);return isNaN(De)?null:De}var ke=+new Date("2000-01-01T00:00:00.000Z")?Ae:t.utcParse(Ye);t.isoFormat=_e,t.isoParse=ke,t.timeFormatDefaultLocale=qe,t.timeFormatLocale=l,Object.defineProperty(t,"__esModule",{value:!0})})}}),rs=de({"node_modules/d3-format/dist/d3-format.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=typeof globalThis<"u"?globalThis:t||self,i(t.d3=t.d3||{}))})(e,(function(t){"use strict";function i(k){return Math.abs(k=Math.round(k))>=1e21?k.toLocaleString("en").replace(/,/g,""):k.toString(10)}function a(k,A){if((b=(k=A?k.toExponential(A-1):k.toExponential()).indexOf("e"))<0)return null;var b,E=k.slice(0,b);return[E.length>1?E[0]+E.slice(2):E,+k.slice(b+1)]}function o(k){return k=a(Math.abs(k)),k?k[1]:NaN}function s(k,A){return function(b,E){for(var T=b.length,F=[],D=0,R=k[0],P=0;T>0&&R>0&&(P+R+1>E&&(R=Math.max(1,E-P)),F.push(b.substring(T-=R,T+R)),!((P+=R+1)>E));)R=k[D=(D+1)%k.length];return F.reverse().join(A)}}function l(k){return function(A){return A.replace(/[0-9]/g,function(b){return k[+b]})}}var n=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function u(k){if(!(A=n.exec(k)))throw new Error("invalid format: "+k);var A;return new c({fill:A[1],align:A[2],sign:A[3],symbol:A[4],zero:A[5],width:A[6],comma:A[7],precision:A[8]&&A[8].slice(1),trim:A[9],type:A[10]})}u.prototype=c.prototype;function c(k){this.fill=k.fill===void 0?" ":k.fill+"",this.align=k.align===void 0?">":k.align+"",this.sign=k.sign===void 0?"-":k.sign+"",this.symbol=k.symbol===void 0?"":k.symbol+"",this.zero=!!k.zero,this.width=k.width===void 0?void 0:+k.width,this.comma=!!k.comma,this.precision=k.precision===void 0?void 0:+k.precision,this.trim=!!k.trim,this.type=k.type===void 0?"":k.type+""}c.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function f(k){e:for(var A=k.length,b=1,E=-1,T;b0&&(E=0);break}return E>0?k.slice(0,E)+k.slice(T+1):k}var h;function d(k,A){var b=a(k,A);if(!b)return k+"";var E=b[0],T=b[1],F=T-(h=Math.max(-8,Math.min(8,Math.floor(T/3)))*3)+1,D=E.length;return F===D?E:F>D?E+new Array(F-D+1).join("0"):F>0?E.slice(0,F)+"."+E.slice(F):"0."+new Array(1-F).join("0")+a(k,Math.max(0,A+F-1))[0]}function p(k,A){var b=a(k,A);if(!b)return k+"";var E=b[0],T=b[1];return T<0?"0."+new Array(-T).join("0")+E:E.length>T+1?E.slice(0,T+1)+"."+E.slice(T+1):E+new Array(T-E.length+2).join("0")}var g={"%":function(k,A){return(k*100).toFixed(A)},b:function(k){return Math.round(k).toString(2)},c:function(k){return k+""},d:i,e:function(k,A){return k.toExponential(A)},f:function(k,A){return k.toFixed(A)},g:function(k,A){return k.toPrecision(A)},o:function(k){return Math.round(k).toString(8)},p:function(k,A){return p(k*100,A)},r:p,s:d,X:function(k){return Math.round(k).toString(16).toUpperCase()},x:function(k){return Math.round(k).toString(16)}};function m(k){return k}var y=Array.prototype.map,_=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function v(k){var A=k.grouping===void 0||k.thousands===void 0?m:s(y.call(k.grouping,Number),k.thousands+""),b=k.currency===void 0?"":k.currency[0]+"",E=k.currency===void 0?"":k.currency[1]+"",T=k.decimal===void 0?".":k.decimal+"",F=k.numerals===void 0?m:l(y.call(k.numerals,String)),D=k.percent===void 0?"%":k.percent+"",R=k.minus===void 0?"-":k.minus+"",P=k.nan===void 0?"NaN":k.nan+"";function z(L){L=u(L);var B=L.fill,O=L.align,G=L.sign,W=L.symbol,X=L.zero,Z=L.width,J=L.comma,N=L.precision,H=L.trim,$=L.type;$==="n"?(J=!0,$="g"):g[$]||(N===void 0&&(N=12),H=!0,$="g"),(X||B==="0"&&O==="=")&&(X=!0,B="0",O="=");var U=W==="$"?b:W==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",V=W==="$"?E:/[%p]/.test($)?D:"",j=g[$],q=/[defgprs%]/.test($);N=N===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function Y(K){var te=U,ne=V,se,le,ce;if($==="c")ne=j(K)+ne,K="";else{K=+K;var pe=K<0||1/K<0;if(K=isNaN(K)?P:j(Math.abs(K),N),H&&(K=f(K)),pe&&+K==0&&G!=="+"&&(pe=!1),te=(pe?G==="("?G:R:G==="-"||G==="("?"":G)+te,ne=($==="s"?_[8+h/3]:"")+ne+(pe&&G==="("?")":""),q){for(se=-1,le=K.length;++sece||ce>57){ne=(ce===46?T+K.slice(se+1):K.slice(se))+ne,K=K.slice(0,se);break}}}J&&!X&&(K=A(K,1/0));var xe=te.length+K.length+ne.length,ye=xe>1)+te+K+ne+ye.slice(xe);break;default:K=ye+te+K+ne;break}return F(K)}return Y.toString=function(){return L+""},Y}function I(L,B){var O=z((L=u(L),L.type="f",L)),G=Math.max(-8,Math.min(8,Math.floor(o(B)/3)))*3,W=Math.pow(10,-G),X=_[8+G/3];return function(Z){return O(W*Z)+X}}return{format:z,formatPrefix:I}}var x;S({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function S(k){return x=v(k),t.format=x.format,t.formatPrefix=x.formatPrefix,x}function M(k){return Math.max(0,-o(Math.abs(k)))}function C(k,A){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(o(A)/3)))*3-o(Math.abs(k)))}function w(k,A){return k=Math.abs(k),A=Math.abs(A)-k,Math.max(0,o(A)-o(k))+1}t.FormatSpecifier=c,t.formatDefaultLocale=S,t.formatLocale=v,t.formatSpecifier=u,t.precisionFixed=M,t.precisionPrefix=C,t.precisionRound=w,Object.defineProperty(t,"__esModule",{value:!0})}))}}),Oo=de({"node_modules/is-string-blank/index.js"(e,r){"use strict";r.exports=function(t){for(var i=t.length,a,o=0;o13)&&a!==32&&a!==133&&a!==160&&a!==5760&&a!==6158&&(a<8192||a>8205)&&a!==8232&&a!==8233&&a!==8239&&a!==8287&&a!==8288&&a!==12288&&a!==65279)return!1;return!0}}}),da=de({"node_modules/fast-isnumeric/index.js"(e,r){"use strict";var t=Oo();r.exports=function(i){var a=typeof i;if(a==="string"){var o=i;if(i=+i,i===0&&t(o))return!1}else if(a!=="number")return!1;return i-i<1}}}),cn=de({"src/constants/numerical.js"(e,r){"use strict";r.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}}}),Ss=de({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=typeof globalThis<"u"?globalThis:t||self,i(t["base64-arraybuffer"]={}))})(e,(function(t){"use strict";for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=typeof Uint8Array>"u"?[]:new Uint8Array(256),o=0;o>2],h+=i[(u[c]&3)<<4|u[c+1]>>4],h+=i[(u[c+1]&15)<<2|u[c+2]>>6],h+=i[u[c+2]&63];return f%3===2?h=h.substring(0,h.length-1)+"=":f%3===1&&(h=h.substring(0,h.length-2)+"=="),h},l=function(n){var u=n.length*.75,c=n.length,f,h=0,d,p,g,m;n[n.length-1]==="="&&(u--,n[n.length-2]==="="&&u--);var y=new ArrayBuffer(u),_=new Uint8Array(y);for(f=0;f>4,_[h++]=(p&15)<<4|g>>2,_[h++]=(g&3)<<6|m&63;return y};t.decode=l,t.encode=s,Object.defineProperty(t,"__esModule",{value:!0})}))}}),is=de({"src/lib/is_plain_object.js"(e,r){"use strict";r.exports=function(i){return window&&window.process&&window.process.versions?Object.prototype.toString.call(i)==="[object Object]":Object.prototype.toString.call(i)==="[object Object]"&&Object.getPrototypeOf(i).hasOwnProperty("hasOwnProperty")}}}),Do=de({"src/lib/array.js"(e){"use strict";var r=Ss().decode,t=is(),i=Array.isArray,a=ArrayBuffer,o=DataView;function s(d){return a.isView(d)&&!(d instanceof o)}e.isTypedArray=s;function l(d){return i(d)||s(d)}e.isArrayOrTypedArray=l;function n(d){return!l(d[0])}e.isArray1D=n,e.ensureArray=function(d,p){return i(d)||(d=[]),d.length=p,d};var u={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};u.uint8c=u.u1c,u.uint8=u.u1,u.int8=u.i1,u.uint16=u.u2,u.int16=u.i2,u.uint32=u.u4,u.int32=u.i4,u.float32=u.f4,u.float64=u.f8;function c(d){return d.constructor===ArrayBuffer}e.isArrayBuffer=c,e.decodeTypedArraySpec=function(d){var p=[],g=f(d),m=g.dtype,y=u[m];if(!y)throw new Error('Error in dtype: "'+m+'"');var _=y.BYTES_PER_ELEMENT,v=g.bdata;c(v)||(v=r(v));var x=g.shape===void 0?[v.byteLength/_]:(""+g.shape).split(",");x.reverse();var S=x.length,M,C,w=+x[0],k=_*w,A=0;if(S===1)p=new y(v);else if(S===2)for(M=+x[1],C=0;C2)return y[M]=y[M]|s,x.set(S,null);if(v){for(p=M;p0)return Math.log(a)/Math.LN10;var s=Math.log(Math.min(o[0],o[1]))/Math.LN10;return t(s)||(s=Math.log(Math.max(o[0],o[1]))/Math.LN10-6),s}}}),l0=de({"src/lib/relink_private.js"(e,r){"use strict";var t=Do().isArrayOrTypedArray,i=is();r.exports=function a(o,s){for(var l in s){var n=s[l],u=o[l];if(u!==n)if(l.charAt(0)==="_"||typeof n=="function"){if(l in o)continue;o[l]=n}else if(t(n)&&t(u)&&i(n[0])){if(l==="customdata"||l==="ids")continue;for(var c=Math.min(n.length,u.length),f=0;fvw,modHalf:()=>mw});function vw(e,r){let t=e%r;return t<0?t+r:t}function mw(e,r){return Math.abs(e)>r/2?e-Math.round(e/r)*r:e}var u0=Ir({"src/lib/mod.ts"(){"use strict"}}),fn=de({"src/lib/extend.js"(e){"use strict";var r=is(),t=Array.isArray;function i(o,s){var l,n;for(l=0;l{for(var Ce in be)t(ve,Ce,{get:be[Ce],enumerable:!0})},l=(ve,be,Ce,He)=>{if(be&&typeof be=="object"||typeof be=="function")for(let Xe of a(be))!o.call(ve,Xe)&&Xe!==Ce&&t(ve,Xe,{get:()=>be[Xe],enumerable:!(He=i(be,Xe))||He.enumerable});return ve},n=ve=>l(t({},"__esModule",{value:!0}),ve),u={};s(u,{a98:()=>Co,average:()=>zt,averageAngle:()=>Fe,averageNumber:()=>Et,blend:()=>tf,blerp:()=>Te,clampChroma:()=>ci,clampGamut:()=>Kr,clampRgb:()=>_r,colorsNamed:()=>d,convertA98ToXyz65:()=>lt,convertCubehelixToRgb:()=>ea,convertDlchToLab65:()=>zn,convertHsiToRgb:()=>Fo,convertHslToRgb:()=>Yn,convertHsvToRgb:()=>vs,convertHwbToRgb:()=>Uo,convertItpToXyz65:()=>fl,convertJabToJch:()=>_u,convertJabToRgb:()=>Uf,convertJabToXyz65:()=>mf,convertJchToJab:()=>Dl,convertLab65ToDlch:()=>Ea,convertLab65ToRgb:()=>Hi,convertLab65ToXyz65:()=>gi,convertLabToLch:()=>tt,convertLabToRgb:()=>xl,convertLabToXyz50:()=>Ec,convertLchToLab:()=>wt,convertLchuvToLuv:()=>Lc,convertLrgbToOklab:()=>Tt,convertLrgbToRgb:()=>at,convertLuvToLchuv:()=>Yc,convertLuvToXyz50:()=>Zf,convertOkhslToOklab:()=>Pa,convertOkhsvToOklab:()=>sa,convertOklabToLrgb:()=>zr,convertOklabToOkhsl:()=>Oa,convertOklabToOkhsv:()=>Zi,convertOklabToRgb:()=>ii,convertP3ToXyz65:()=>vo,convertProphotoToXyz50:()=>Kc,convertRec2020ToXyz65:()=>Jc,convertRgbToCubehelix:()=>oi,convertRgbToHsi:()=>uo,convertRgbToHsl:()=>Bn,convertRgbToHsv:()=>go,convertRgbToHwb:()=>kl,convertRgbToJab:()=>Sc,convertRgbToLab:()=>Hf,convertRgbToLab65:()=>Li,convertRgbToLrgb:()=>ke,convertRgbToOklab:()=>Bt,convertRgbToXyb:()=>$l,convertRgbToXyz50:()=>kc,convertRgbToXyz65:()=>De,convertRgbToYiq:()=>Zr,convertXybToRgb:()=>Ge,convertXyz50ToLab:()=>Nu,convertXyz50ToLuv:()=>ic,convertXyz50ToProphoto:()=>bl,convertXyz50ToRgb:()=>rc,convertXyz50ToXyz65:()=>rr,convertXyz65ToA98:()=>me,convertXyz65ToItp:()=>tc,convertXyz65ToJab:()=>vf,convertXyz65ToLab65:()=>Cn,convertXyz65ToP3:()=>qs,convertXyz65ToRec2020:()=>Mf,convertXyz65ToRgb:()=>ft,convertXyz65ToXyz50:()=>tr,convertYiqToRgb:()=>qi,converter:()=>L,cubehelix:()=>Rc,differenceCie76:()=>xi,differenceCie94:()=>bi,differenceCiede2000:()=>Ua,differenceCmc:()=>dn,differenceEuclidean:()=>pa,differenceHueChroma:()=>ya,differenceHueNaive:()=>ja,differenceHueSaturation:()=>$i,differenceHyab:()=>pi,differenceItp:()=>Be,differenceKotsarenkoRamos:()=>Jr,displayable:()=>bt,dlab:()=>ys,dlch:()=>Hu,easingGamma:()=>Gn,easingInOutSine:()=>yo,easingMidpoint:()=>lr,easingSmootherstep:()=>Un,easingSmoothstep:()=>Hn,easingSmoothstepInverse:()=>Ca,filterBrightness:()=>Ei,filterContrast:()=>Yi,filterDeficiencyDeuter:()=>Ga,filterDeficiencyProt:()=>va,filterDeficiencyTrit:()=>wn,filterGrayscale:()=>Da,filterHueRotate:()=>bn,filterInvert:()=>wa,filterSaturate:()=>Ui,filterSepia:()=>la,fixupAlpha:()=>vt,fixupHueDecreasing:()=>Ct,fixupHueIncreasing:()=>Lt,fixupHueLonger:()=>kt,fixupHueShorter:()=>yt,formatCss:()=>pl,formatHex:()=>Tu,formatHex8:()=>nc,formatHsl:()=>sc,formatRgb:()=>oc,getMode:()=>J,hsi:()=>lc,hsl:()=>zc,hsv:()=>Pl,hwb:()=>Il,inGamut:()=>dr,interpolate:()=>wr,interpolateWith:()=>Cr,interpolateWithPremultipliedAlpha:()=>Nr,interpolatorLinear:()=>Ke,interpolatorPiecewise:()=>Ze,interpolatorSplineBasis:()=>Ci,interpolatorSplineBasisClosed:()=>Gi,interpolatorSplineMonotone:()=>Vs,interpolatorSplineMonotone2:()=>Ho,interpolatorSplineMonotoneClosed:()=>fa,interpolatorSplineNatural:()=>ga,interpolatorSplineNaturalClosed:()=>qa,itp:()=>Yl,jab:()=>oo,jch:()=>lu,lab:()=>Ms,lab65:()=>uc,lch:()=>Bc,lch65:()=>Oc,lchuv:()=>Zn,lerp:()=>ge,lrgb:()=>Bo,luv:()=>Bs,mapAlphaDivide:()=>Ne,mapAlphaMultiply:()=>Re,mapTransferGamma:()=>et,mapTransferLinear:()=>ut,mapper:()=>Le,modeA98:()=>ht,modeCubehelix:()=>Yt,modeDlab:()=>ho,modeDlch:()=>lo,modeHsi:()=>jo,modeHsl:()=>nl,modeHsv:()=>On,modeHwb:()=>yu,modeItp:()=>Th,modeJab:()=>Bu,modeJch:()=>Ou,modeLab:()=>ql,modeLab65:()=>Nd,modeLch:()=>Wc,modeLch65:()=>bf,modeLchuv:()=>ou,modeLrgb:()=>Lh,modeLuv:()=>Af,modeOkhsl:()=>rn,modeOkhsv:()=>Dn,modeOklab:()=>$o,modeOklch:()=>Go,modeP3:()=>bu,modeProphoto:()=>Qf,modeRec2020:()=>Qc,modeRgb:()=>Pt,modeXyb:()=>st,modeXyz50:()=>pt,modeXyz65:()=>Sr,modeYiq:()=>un,nearest:()=>Ni,okhsl:()=>gr,okhsv:()=>hi,oklab:()=>di,oklch:()=>sn,p3:()=>Io,parse:()=>ae,parseHex:()=>_,parseHsl:()=>ws,parseHslLegacy:()=>Vn,parseHwb:()=>Ul,parseLab:()=>ad,parseLch:()=>nd,parseNamed:()=>g,parseOklab:()=>zo,parseOklch:()=>Us,parseRgb:()=>ie,parseRgbLegacy:()=>R,parseTransparent:()=>ue,prophoto:()=>_s,random:()=>we,rec2020:()=>an,removeParser:()=>H,rgb:()=>cr,round:()=>Pn,samples:()=>As,serializeHex:()=>wl,serializeHex8:()=>Vu,serializeHsl:()=>dl,serializeRgb:()=>Pc,toGamut:()=>yi,trilerp:()=>je,unlerp:()=>Me,useMode:()=>Z,useParser:()=>N,wcagContrast:()=>Wl,wcagLuminance:()=>Gs,xyb:()=>xr,xyz50:()=>kr,xyz65:()=>fi,yiq:()=>Ti}),r.exports=n(u);var c=(ve,be)=>{if(typeof ve=="number"){if(be===3)return{mode:"rgb",r:(ve>>8&15|ve>>4&240)/255,g:(ve>>4&15|ve&240)/255,b:(ve&15|ve<<4&240)/255};if(be===4)return{mode:"rgb",r:(ve>>12&15|ve>>8&240)/255,g:(ve>>8&15|ve>>4&240)/255,b:(ve>>4&15|ve&240)/255,alpha:(ve&15|ve<<4&240)/255};if(be===6)return{mode:"rgb",r:(ve>>16&255)/255,g:(ve>>8&255)/255,b:(ve&255)/255};if(be===8)return{mode:"rgb",r:(ve>>24&255)/255,g:(ve>>16&255)/255,b:(ve>>8&255)/255,alpha:(ve&255)/255}}},f=c,h={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},d=h,p=ve=>f(d[ve.toLowerCase()],6),g=p,m=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,y=ve=>{let be;return(be=ve.match(m))?f(parseInt(be[1],16),be[1].length):void 0},_=y,v="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",x=`(?:${v}|none)`,S=`${v}%`,M=`(?:${v}%|none)`,C=`(?:${v}%|${v})`,w=`(?:${v}%|${v}|none)`,k=`(?:${v}(deg|grad|rad|turn)|${v})`,A=`(?:${v}(deg|grad|rad|turn)|${v}|none)`,b="\\s*,\\s*",E=new RegExp("^"+w+"$"),T=new RegExp(`^rgba?\\(\\s*${v}${b}${v}${b}${v}\\s*(?:,\\s*${C}\\s*)?\\)$`),F=new RegExp(`^rgba?\\(\\s*${S}${b}${S}${b}${S}\\s*(?:,\\s*${C}\\s*)?\\)$`),D=ve=>{let be={mode:"rgb"},Ce;if(Ce=ve.match(T))Ce[1]!==void 0&&(be.r=Ce[1]/255),Ce[2]!==void 0&&(be.g=Ce[2]/255),Ce[3]!==void 0&&(be.b=Ce[3]/255);else if(Ce=ve.match(F))Ce[1]!==void 0&&(be.r=Ce[1]/100),Ce[2]!==void 0&&(be.g=Ce[2]/100),Ce[3]!==void 0&&(be.b=Ce[3]/100);else return;return Ce[4]!==void 0?be.alpha=Math.max(0,Math.min(1,Ce[4]/100)):Ce[5]!==void 0&&(be.alpha=Math.max(0,Math.min(1,+Ce[5]))),be},R=D,P=(ve,be)=>ve===void 0?void 0:typeof ve!="object"?ae(ve):ve.mode!==void 0?ve:be?ar(Ot({},ve),{mode:be}):void 0,z=P,I=(ve="rgb")=>be=>(be=z(be,ve))!==void 0?be.mode===ve?be:B[be.mode][ve]?B[be.mode][ve](be):ve==="rgb"?B[be.mode].rgb(be):B.rgb[ve](B[be.mode].rgb(be)):void 0,L=I,B={},O={},G=[],W={},X=ve=>ve,Z=ve=>(B[ve.mode]=Ot(Ot({},B[ve.mode]),ve.toMode),Object.keys(ve.fromMode||{}).forEach(be=>{B[be]||(B[be]={}),B[be][ve.mode]=ve.fromMode[be]}),ve.ranges||(ve.ranges={}),ve.difference||(ve.difference={}),ve.channels.forEach(be=>{if(ve.ranges[be]===void 0&&(ve.ranges[be]=[0,1]),!ve.interpolate[be])throw new Error(`Missing interpolator for: ${be}`);typeof ve.interpolate[be]=="function"&&(ve.interpolate[be]={use:ve.interpolate[be]}),ve.interpolate[be].fixup||(ve.interpolate[be].fixup=X)}),O[ve.mode]=ve,(ve.parse||[]).forEach(be=>{N(be,ve.mode)}),L(ve.mode)),J=ve=>O[ve],N=(ve,be)=>{if(typeof ve=="string"){if(!be)throw new Error("'mode' required when 'parser' is a string");W[ve]=be}else typeof ve=="function"&&G.indexOf(ve)<0&&G.push(ve)},H=ve=>{if(typeof ve=="string")delete W[ve];else if(typeof ve=="function"){let be=G.indexOf(ve);be>0&&G.splice(be,1)}},$=/[^\x00-\x7F]|[a-zA-Z_]/,U=/[^\x00-\x7F]|[-\w]/,V={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},j=0;function q(ve){let be=ve[j],Ce=ve[j+1];return be==="-"||be==="+"?/\d/.test(Ce)||Ce==="."&&/\d/.test(ve[j+2]):be==="."?/\d/.test(Ce):/\d/.test(be)}function Y(ve){if(j>=ve.length)return!1;let be=ve[j];if($.test(be))return!0;if(be==="-"){if(ve.length-j<2)return!1;let Ce=ve[j+1];return!!(Ce==="-"||$.test(Ce))}return!1}var K={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function te(ve){let be="";if((ve[j]==="-"||ve[j]==="+")&&(be+=ve[j++]),be+=ne(ve),ve[j]==="."&&/\d/.test(ve[j+1])&&(be+=ve[j++]+ne(ve)),(ve[j]==="e"||ve[j]==="E")&&((ve[j+1]==="-"||ve[j+1]==="+")&&/\d/.test(ve[j+2])?be+=ve[j++]+ve[j++]+ne(ve):/\d/.test(ve[j+1])&&(be+=ve[j++]+ne(ve))),Y(ve)){let Ce=se(ve);return Ce==="deg"||Ce==="rad"||Ce==="turn"||Ce==="grad"?{type:V.Hue,value:be*K[Ce]}:void 0}return ve[j]==="%"?(j++,{type:V.Percentage,value:+be}):{type:V.Number,value:+be}}function ne(ve){let be="";for(;/\d/.test(ve[j]);)be+=ve[j++];return be}function se(ve){let be="";for(;j24?(isFinite(he)&&(clearTimeout(Mi),Mi=setTimeout(Hi,he)),Pr=0):(Pr=1,gi(Hi))}t.timer.flush=function(){Za(),oa()};function Za(){for(var re=Date.now(),he=vr;he;)re>=he.t&&he.c(re-he.t)&&(he.c=null),he=he.n;return re}function oa(){for(var re,he=vr,we=1/0;he;)he.c?(he.t=0;--et)hr.push(Re[Ft[lr[et]][2]]);for(et=+Fr;et1&&at(re[we[Le-2]],re[we[Le-1]],re[Re])<=0;)--Le;we[Le++]=Re}return we.slice(0,Le)}function In(re,he){return re[0]-he[0]||re[1]-he[1]}t.geom.polygon=function(re){return N(re,pn),re};var pn=t.geom.polygon.prototype=[];pn.area=function(){for(var re=-1,he=this.length,we,Le=this[he-1],Re=0;++reYe)et=et.L;else if(ut=he-Qn(et,we),ut>Ye){if(!et.R){Le=et;break}et=et.R}else{Oe>-Ye?(Le=et.P,Re=et):ut>-Ye?(Le=et,Re=et.N):Le=Re=et;break}var _t=ho(re);if(zn.insert(Le,_t),!(!Le&&!Re)){if(Le===Re){no(Le),Re=ho(Le.site),zn.insert(_t,Re),_t.edge=Re.edge=So(Le.site,_t.site),xo(Le),xo(Re);return}if(!Re){_t.edge=So(Le.site,_t.site);return}no(Le),no(Re);var Ft=Le.site,Rt=Ft.x,lr=Ft.y,sr=re.x-Rt,Fr=re.y-lr,Or=Re.site,hr=Or.x-Rt,wr=Or.y-lr,Cr=2*(sr*wr-Fr*hr),Nr=sr*sr+Fr*Fr,jr=hr*hr+wr*wr,Ar={x:(wr*Nr-Fr*jr)/Cr+Rt,y:(sr*jr-hr*Nr)/Cr+lr};vs(Re.edge,Ft,Or,Ar),_t.edge=So(Ft,re,null,Ar),Re.edge=So(re,Or,null,Ar),xo(Le),xo(Re)}}function uo(re,he){var we=re.site,Le=we.x,Re=we.y,Oe=Re-he;if(!Oe)return Le;var ut=re.P;if(!ut)return-1/0;we=ut.site;var et=we.x,_t=we.y,Ft=_t-he;if(!Ft)return et;var Rt=et-Le,lr=1/Oe-1/Ft,sr=Rt/Ft;return lr?(-sr+Math.sqrt(sr*sr-2*lr*(Rt*Rt/(-2*Ft)-_t+Ft/2+Re-Oe/2)))/lr+Le:(Le+et)/2}function Qn(re,he){var we=re.N;if(we)return uo(we,he);var Le=re.site;return Le.y===he?Le.x:1/0}function jo(re){this.site=re,this.edges=[]}jo.prototype.prepare=function(){for(var re=this.edges,he=re.length,we;he--;)we=re[he].edge,(!we.b||!we.a)&&re.splice(he,1);return re.sort(Bn),re.length};function Yn(re){for(var he=re[0][0],we=re[1][0],Le=re[0][1],Re=re[1][1],Oe,ut,et,_t,Ft=Kn,Rt=Ft.length,lr,sr,Fr,Or,hr,wr;Rt--;)if(lr=Ft[Rt],!(!lr||!lr.prepare()))for(Fr=lr.edges,Or=Fr.length,sr=0;srYe||v(_t-ut)>Ye)&&(Fr.splice(sr,0,new go(nl(lr.site,wr,v(et-he)Ye?{x:he,y:v(Oe-he)Ye?{x:v(ut-Re)Ye?{x:we,y:v(Oe-we)Ye?{x:v(ut-Le)=-me)){var sr=_t*_t+Ft*Ft,Fr=Rt*Rt+wr*wr,Or=(wr*sr-Ft*Fr)/lr,hr=(_t*Fr-Rt*sr)/lr,wr=hr+et,Cr=on.pop()||new ps;Cr.arc=re,Cr.site=Re,Cr.x=Or+ut,Cr.y=wr+Math.sqrt(Or*Or+hr*hr),Cr.cy=wr,re.circle=Cr;for(var Nr=null,jr=ln._;jr;)if(Cr.y0)){if(hr/=Fr,Fr<0){if(hr0){if(hr>sr)return;hr>lr&&(lr=hr)}if(hr=we-et,!(!Fr&&hr<0)){if(hr/=Fr,Fr<0){if(hr>sr)return;hr>lr&&(lr=hr)}else if(Fr>0){if(hr0)){if(hr/=Or,Or<0){if(hr0){if(hr>sr)return;hr>lr&&(lr=hr)}if(hr=Le-_t,!(!Or&&hr<0)){if(hr/=Or,Or<0){if(hr>sr)return;hr>lr&&(lr=hr)}else if(Or>0){if(hr0&&(Re.a={x:et+lr*Fr,y:_t+lr*Or}),sr<1&&(Re.b={x:et+sr*Fr,y:_t+sr*Or}),Re}}}}}}function Vn(re){for(var he=Mn,we=Mo(re[0][0],re[0][1],re[1][0],re[1][1]),Le=he.length,Re;Le--;)Re=he[Le],(!ts(Re,re)||!we(Re)||v(Re.a.x-Re.b.x)=Oe)return;if(Rt>sr){if(!Le)Le={x:Or,y:ut};else if(Le.y>=et)return;we={x:Or,y:et}}else{if(!Le)Le={x:Or,y:et};else if(Le.y1)if(Rt>sr){if(!Le)Le={x:(ut-Cr)/wr,y:ut};else if(Le.y>=et)return;we={x:(et-Cr)/wr,y:et}}else{if(!Le)Le={x:(et-Cr)/wr,y:et};else if(Le.y=Oe)return;we={x:Oe,y:wr*Oe+Cr}}else{if(!Le)Le={x:Oe,y:wr*Oe+Cr};else if(Le.x=Rt&&Cr.x<=sr&&Cr.y>=lr&&Cr.y<=Fr?[[Rt,Fr],[sr,Fr],[sr,lr],[Rt,lr]]:[];Nr.point=_t[hr]}),Ft}function et(_t){return _t.map(function(Ft,Rt){return{x:Math.round(Le(Ft,Rt)/Ye)*Ye,y:Math.round(Re(Ft,Rt)/Ye)*Ye,i:Rt}})}return ut.links=function(_t){return Ul(et(_t)).edges.filter(function(Ft){return Ft.l&&Ft.r}).map(function(Ft){return{source:_t[Ft.l.i],target:_t[Ft.r.i]}})},ut.triangles=function(_t){var Ft=[];return Ul(et(_t)).cells.forEach(function(Rt,lr){for(var sr=Rt.site,Fr=Rt.edges.sort(Bn),Or=-1,hr=Fr.length,wr,Cr,Nr=Fr[hr-1].edge,jr=Nr.l===sr?Nr.r:Nr.l;++Orjr&&(jr=Rt.x),Rt.y>Ar&&(Ar=Rt.y),Fr.push(Rt.x),Or.push(Rt.y);else for(hr=0;hrjr&&(jr=Ci),Gi>Ar&&(Ar=Gi),Fr.push(Ci),Or.push(Gi)}var aa=jr-Cr,ga=Ar-Nr;aa>ga?Ar=Nr+aa:jr=Cr+ga;function qa(ka,Sn,ko,Vs,Ho,fa,jn,Gn){if(!(isNaN(ko)||isNaN(Vs)))if(ka.leaf){var Po=ka.x,As=ka.y;if(Po!=null)if(v(Po-ko)+v(As-Vs)<.01)Fa(ka,Sn,ko,Vs,Ho,fa,jn,Gn);else{var Qs=ka.point;ka.x=ka.y=ka.point=null,Fa(ka,Qs,Po,As,Ho,fa,jn,Gn),Fa(ka,Sn,ko,Vs,Ho,fa,jn,Gn)}else ka.x=ko,ka.y=Vs,ka.point=Sn}else Fa(ka,Sn,ko,Vs,Ho,fa,jn,Gn)}function Fa(ka,Sn,ko,Vs,Ho,fa,jn,Gn){var Po=(Ho+jn)*.5,As=(fa+Gn)*.5,Qs=ko>=Po,Tl=Vs>=As,Fl=Tl<<1|Qs;ka.leaf=!1,ka=ka.nodes[Fl]||(ka.nodes[Fl]=Pu()),Qs?Ho=Po:jn=Po,Tl?fa=As:Gn=As,qa(ka,Sn,ko,Vs,Ho,fa,jn,Gn)}var Nn=Pu();if(Nn.add=function(ka){qa(Nn,ka,+lr(ka,++hr),+sr(ka,hr),Cr,Nr,jr,Ar)},Nn.visit=function(ka){Cl(ka,Nn,Cr,Nr,jr,Ar)},Nn.find=function(ka){return bc(Nn,ka[0],ka[1],Cr,Nr,jr,Ar)},hr=-1,he==null){for(;++hrOe||sr>ut||Fr=Ci,ga=we>=Gi,qa=ga<<1|aa,Fa=qa+4;qawe&&(Oe=he.slice(we,Oe),et[ut]?et[ut]+=Oe:et[++ut]=Oe),(Le=Le[0])===(Re=Re[0])?et[ut]?et[ut]+=Re:et[++ut]=Re:(et[++ut]=null,_t.push({i:ut,x:ms(Le,Re)})),we=wc.lastIndex;return we=0&&!(Le=t.interpolators[we](re,he)););return Le}t.interpolators=[function(re,he){var we=typeof he;return(we==="string"?ft.has(he.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(he)?Iu:ss:he instanceof mr?Iu:Array.isArray(he)?tc:we==="object"&&isNaN(he)?_l:ms)(re,he)}],t.interpolateArray=tc;function tc(re,he){var we=[],Le=[],Re=re.length,Oe=he.length,ut=Math.min(re.length,he.length),et;for(et=0;et=0?re.slice(0,he):re,Le=he>=0?re.slice(he+1):"in";return we=Ah.get(we)||Th,Le=zd.get(Le)||P,hp(Le(we.apply(null,i.call(arguments,1))))};function hp(re){return function(he){return he<=0?0:he>=1?1:re(he)}}function Ru(re){return function(he){return 1-re(1-he)}}function Ts(re){return function(he){return .5*(he<.5?re(2*he):2-re(2-2*he))}}function Mh(re){return re*re}function vf(re){return re*re*re}function Ac(re){if(re<=0)return 0;if(re>=1)return 1;var he=re*re,we=he*re;return 4*(re<.5?we:3*(re-he)+we-.75)}function Sh(re){return function(he){return Math.pow(he,re)}}function Mc(re){return 1-Math.cos(re*Ee)}function $c(re){return Math.pow(2,10*(re-1))}function zu(re){return 1-Math.sqrt(1-re*re)}function mf(re,he){var we;return arguments.length<2&&(he=.45),arguments.length?we=he/Ae*Math.asin(1/re):(re=1,we=he/4),function(Le){return 1+re*Math.pow(2,-10*Le)*Math.sin((Le-we)*Ae/he)}}function jf(re){return re||(re=1.70158),function(he){return he*he*((re+1)*he-re)}}function Sc(re){return re<1/2.75?7.5625*re*re:re<2/2.75?7.5625*(re-=1.5/2.75)*re+.75:re<2.5/2.75?7.5625*(re-=2.25/2.75)*re+.9375:7.5625*(re-=2.625/2.75)*re+.984375}t.interpolateHcl=ad;function ad(re,he){re=t.hcl(re),he=t.hcl(he);var we=re.h,Le=re.c,Re=re.l,Oe=he.h-we,ut=he.c-Le,et=he.l-Re;return isNaN(ut)&&(ut=0,Le=isNaN(Le)?he.c:Le),isNaN(Oe)?(Oe=0,we=isNaN(we)?he.h:we):Oe>180?Oe-=360:Oe<-180&&(Oe+=360),function(_t){return oi(we+Oe*_t,Le+ut*_t,Re+et*_t)+""}}t.interpolateHsl=Uf;function Uf(re,he){re=t.hsl(re),he=t.hsl(he);var we=re.h,Le=re.s,Re=re.l,Oe=he.h-we,ut=he.s-Le,et=he.l-Re;return isNaN(ut)&&(ut=0,Le=isNaN(Le)?he.s:Le),isNaN(Oe)?(Oe=0,we=isNaN(we)?he.h:we):Oe>180?Oe-=360:Oe<-180&&(Oe+=360),function(_t){return Tr(we+Oe*_t,Le+ut*_t,Re+et*_t)+""}}t.interpolateLab=Bd;function Bd(re,he){re=t.lab(re),he=t.lab(he);var we=re.l,Le=re.a,Re=re.b,Oe=he.l-we,ut=he.a-Le,et=he.b-Re;return function(_t){return xi(we+Oe*_t,Le+ut*_t,Re+et*_t)+""}}t.interpolateRound=Bu;function Bu(re,he){return he-=re,function(we){return Math.round(re+he*we)}}t.transform=function(re){var he=o.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(we){if(we!=null){he.setAttribute("transform",we);var Le=he.transform.baseVal.consolidate()}return new Eh(Le?Le.matrix:gf)})(re)};function Eh(re){var he=[re.a,re.b],we=[re.c,re.d],Le=qf(he),Re=_u(he,we),Oe=qf(Dl(we,he,-Re))||0;he[0]*we[1]180?he+=360:he-re>180&&(re+=360),Le.push({i:we.push(Ou(we)+"rotate(",null,")")-2,x:ms(re,he)})):he&&we.push(Ou(we)+"rotate("+he+")")}function Vf(re,he,we,Le){re!==he?Le.push({i:we.push(Ou(we)+"skewX(",null,")")-2,x:ms(re,he)}):he&&we.push(Ou(we)+"skewX("+he+")")}function kh(re,he,we,Le){if(re[0]!==he[0]||re[1]!==he[1]){var Re=we.push(Ou(we)+"scale(",null,",",null,")");Le.push({i:Re-4,x:ms(re[0],he[0])},{i:Re-2,x:ms(re[1],he[1])})}else(he[0]!==1||he[1]!==1)&&we.push(Ou(we)+"scale("+he+")")}function Ec(re,he){var we=[],Le=[];return re=t.transform(re),he=t.transform(he),yf(re.translate,he.translate,we,Le),_f(re.rotate,he.rotate,we,Le),Vf(re.skew,he.skew,we,Le),kh(re.scale,he.scale,we,Le),re=he=null,function(Re){for(var Oe=-1,ut=Le.length,et;++Oe0?Oe=Ar:(we.c=null,we.t=NaN,we=null,he.end({type:"end",alpha:Oe=0})):Ar>0&&(he.start({type:"start",alpha:Oe=Ar}),we=ba(re.tick)),re):Oe},re.start=function(){var Ar,Ci=Fr.length,Gi=Or.length,aa=Le[0],ga=Le[1],qa,Fa;for(Ar=0;Ar=0;)Oe.push(Rt=Ft[_t]),Rt.parent=et,Rt.depth=et.depth+1;we&&(et.value=0),et.children=Ft}else we&&(et.value=+we.call(Le,et,et.depth)||0),delete et.children;return Vl(Re,function(lr){var sr,Fr;re&&(sr=lr.children)&&sr.sort(re),we&&(Fr=lr.parent)&&(Fr.value+=lr.value)}),ut}return Le.sort=function(Re){return arguments.length?(re=Re,Le):re},Le.children=function(Re){return arguments.length?(he=Re,Le):he},Le.value=function(Re){return arguments.length?(we=Re,Le):we},Le.revalue=function(Re){return we&&(ql(Re,function(Oe){Oe.children&&(Oe.value=0)}),Vl(Re,function(Oe){var ut;Oe.children||(Oe.value=+we.call(Le,Oe,Oe.depth)||0),(ut=Oe.parent)&&(ut.value+=Oe.value)})),Re},Le};function ju(re,he){return t.rebind(re,he,"sort","children","value"),re.nodes=re,re.links=nu,re}function ql(re,he){for(var we=[re];(re=we.pop())!=null;)if(he(re),(Re=re.children)&&(Le=Re.length))for(var Le,Re;--Le>=0;)we.push(Re[Le])}function Vl(re,he){for(var we=[re],Le=[];(re=we.pop())!=null;)if(Le.push(re),(ut=re.children)&&(Oe=ut.length))for(var Re=-1,Oe,ut;++ReRe&&(Re=et),Le.push(et)}for(ut=0;utLe&&(we=he,Le=Re);return we}function Wf(re){return re.reduce(Xc,0)}function Xc(re,he){return re+he[1]}t.layout.histogram=function(){var re=!0,he=Number,we=ic,Le=Yf;function Re(Oe,sr){for(var et=[],_t=Oe.map(he,this),Ft=we.call(this,_t,sr),Rt=Le.call(this,Ft,_t,sr),lr,sr=-1,Fr=_t.length,Or=Rt.length-1,hr=re?1:1/Fr,wr;++sr0)for(sr=-1;++sr=Ft[0]&&wr<=Ft[1]&&(lr=et[t.bisect(Rt,wr,1,Or)-1],lr.y+=hr,lr.push(Oe[sr]));return et}return Re.value=function(Oe){return arguments.length?(he=Oe,Re):he},Re.range=function(Oe){return arguments.length?(we=wt(Oe),Re):we},Re.bins=function(Oe){return arguments.length?(Le=typeof Oe=="number"?function(ut){return Zc(ut,Oe)}:wt(Oe),Re):Le},Re.frequency=function(Oe){return arguments.length?(re=!!Oe,Re):re},Re};function Yf(re,he){return Zc(re,Math.ceil(Math.log(he.length)/Math.LN2+1))}function Zc(re,he){for(var we=-1,Le=+re[0],Re=(re[1]-Le)/he,Oe=[];++we<=he;)Oe[we]=Re*we+Le;return Oe}function ic(re){return[t.min(re),t.max(re)]}t.layout.pack=function(){var re=t.layout.hierarchy().sort(Tf),he=0,we=[1,1],Le;function Re(Oe,ut){var et=re.call(this,Oe,ut),_t=et[0],Ft=we[0],Rt=we[1],lr=Le==null?Math.sqrt:typeof Le=="function"?Le:function(){return Le};if(_t.x=_t.y=0,Vl(_t,function(Fr){Fr.r=+lr(Fr.value)}),Vl(_t,qd),he){var sr=he*(Le?1:Math.max(2*_t.r/Ft,2*_t.r/Rt))/2;Vl(_t,function(Fr){Fr.r+=sr}),Vl(_t,qd),Vl(_t,function(Fr){Fr.r-=sr})}return Lh(_t,Ft/2,Rt/2,Le?1:1/Math.max(2*_t.r/Ft,2*_t.r/Rt)),et}return Re.size=function(Oe){return arguments.length?(we=Oe,Re):we},Re.radius=function(Oe){return arguments.length?(Le=Oe==null||typeof Oe=="function"?Oe:+Oe,Re):Le},Re.padding=function(Oe){return arguments.length?(he=+Oe,Re):he},ju(Re,re)};function Tf(re,he){return re.value-he.value}function Xf(re,he){var we=re._pack_next;re._pack_next=he,he._pack_prev=re,he._pack_next=we,we._pack_prev=he}function ld(re,he){re._pack_next=he,he._pack_prev=re}function Dh(re,he){var we=he.x-re.x,Le=he.y-re.y,Re=re.r+he.r;return .999*Re*Re>we*we+Le*Le}function qd(re){if(!(he=re.children)||!(sr=he.length))return;var he,we=1/0,Le=-1/0,Re=1/0,Oe=-1/0,ut,et,_t,Ft,Rt,lr,sr;function Fr(Ar){we=Math.min(Ar.x-Ar.r,we),Le=Math.max(Ar.x+Ar.r,Le),Re=Math.min(Ar.y-Ar.r,Re),Oe=Math.max(Ar.y+Ar.r,Oe)}if(he.forEach(Zf),ut=he[0],ut.x=-ut.r,ut.y=0,Fr(ut),sr>1&&(et=he[1],et.x=et.r,et.y=0,Fr(et),sr>2))for(_t=he[2],Js(ut,et,_t),Fr(_t),Xf(ut,_t),ut._pack_prev=_t,Xf(_t,et),et=ut._pack_next,Ft=3;Ftwr.x&&(wr=Ci),Ci.depth>Cr.depth&&(Cr=Ci)});var Nr=he(hr,wr)/2-hr.x,jr=we[0]/(wr.x+he(wr,hr)/2+Nr),Ar=we[1]/(Cr.depth||1);ql(Fr,function(Ci){Ci.x=(Ci.x+Nr)*jr,Ci.y=Ci.depth*Ar})}return sr}function Oe(Rt){for(var lr={A:null,children:[Rt]},sr=[lr],Fr;(Fr=sr.pop())!=null;)for(var Or=Fr.children,hr,wr=0,Cr=Or.length;wr0&&(Jf(nt(hr,Rt,sr),Rt,Ci),Cr+=Ci,Nr+=Ci),jr+=hr.m,Cr+=Fr.m,Ar+=wr.m,Nr+=Or.m;hr&&!Fh(Or)&&(Or.t=hr,Or.m+=jr-Nr),Fr&&!Kf(wr)&&(wr.t=Fr,wr.m+=Cr-Ar,sr=Rt)}return sr}function Ft(Rt){Rt.x*=we[0],Rt.y=Rt.depth*we[1]}return Re.separation=function(Rt){return arguments.length?(he=Rt,Re):he},Re.size=function(Rt){return arguments.length?(Le=(we=Rt)==null?Ft:null,Re):Le?null:we},Re.nodeSize=function(Rt){return arguments.length?(Le=(we=Rt)==null?null:Ft,Re):Le?we:null},ju(Re,re)};function ou(re,he){return re.parent==he.parent?1:2}function Kf(re){var he=re.children;return he.length?he[0]:re.t}function Fh(re){var he=re.children,we;return(we=he.length)?he[we-1]:re.t}function Jf(re,he,we){var Le=we/(he.i-re.i);he.c-=Le,he.s+=we,re.c+=Le,he.z+=we,he.m+=we}function Af(re){for(var he=0,we=0,Le=re.children,Re=Le.length,Oe;--Re>=0;)Oe=Le[Re],Oe.z+=he,Oe.m+=he,he+=Oe.s+(we+=Oe.c)}function nt(re,he,we){return re.a.parent===he.parent?re.a:we}t.layout.cluster=function(){var re=t.layout.hierarchy().sort(null).value(null),he=ou,we=[1,1],Le=!1;function Re(Oe,ut){var et=re.call(this,Oe,ut),_t=et[0],Ft,Rt=0;Vl(_t,function(hr){var wr=hr.children;wr&&wr.length?(hr.x=Jt(wr),hr.y=Tt(wr)):(hr.x=Ft?Rt+=he(hr,Ft):0,hr.y=0,Ft=hr)});var lr=Bt(_t),sr=yr(_t),Fr=lr.x-he(lr,sr)/2,Or=sr.x+he(sr,lr)/2;return Vl(_t,Le?function(hr){hr.x=(hr.x-_t.x)*we[0],hr.y=(_t.y-hr.y)*we[1]}:function(hr){hr.x=(hr.x-Fr)/(Or-Fr)*we[0],hr.y=(1-(_t.y?hr.y/_t.y:1))*we[1]}),et}return Re.separation=function(Oe){return arguments.length?(he=Oe,Re):he},Re.size=function(Oe){return arguments.length?(Le=(we=Oe)==null,Re):Le?null:we},Re.nodeSize=function(Oe){return arguments.length?(Le=(we=Oe)!=null,Re):Le?we:null},ju(Re,re)};function Tt(re){return 1+t.max(re,function(he){return he.y})}function Jt(re){return re.reduce(function(he,we){return he+we.x},0)/re.length}function Bt(re){var he=re.children;return he&&he.length?Bt(he[0]):re}function yr(re){var he=re.children,we;return he&&(we=he.length)?yr(he[we-1]):re}t.layout.treemap=function(){var re=t.layout.hierarchy(),he=Math.round,we=[1,1],Le=null,Re=zr,Oe=!1,ut,et="squarify",_t=.5*(1+Math.sqrt(5));function Ft(hr,wr){for(var Cr=-1,Nr=hr.length,jr,Ar;++Cr0;)Nr.push(Ar=jr[ga-1]),Nr.area+=Ar.area,et!=="squarify"||(Gi=sr(Nr,aa))<=Ci?(jr.pop(),Ci=Gi):(Nr.area-=Nr.pop().area,Fr(Nr,aa,Cr,!1),aa=Math.min(Cr.dx,Cr.dy),Nr.length=Nr.area=0,Ci=1/0);Nr.length&&(Fr(Nr,aa,Cr,!0),Nr.length=Nr.area=0),wr.forEach(Rt)}}function lr(hr){var wr=hr.children;if(wr&&wr.length){var Cr=Re(hr),Nr=wr.slice(),jr,Ar=[];for(Ft(Nr,Cr.dx*Cr.dy/hr.value),Ar.area=0;jr=Nr.pop();)Ar.push(jr),Ar.area+=jr.area,jr.z!=null&&(Fr(Ar,jr.z?Cr.dx:Cr.dy,Cr,!Nr.length),Ar.length=Ar.area=0);wr.forEach(lr)}}function sr(hr,wr){for(var Cr=hr.area,Nr,jr=0,Ar=1/0,Ci=-1,Gi=hr.length;++Cijr&&(jr=Nr));return Cr*=Cr,wr*=wr,Cr?Math.max(wr*jr*_t/Cr,Cr/(wr*Ar*_t)):1/0}function Fr(hr,wr,Cr,Nr){var jr=-1,Ar=hr.length,Ci=Cr.x,Gi=Cr.y,aa=wr?he(hr.area/wr):0,ga;if(wr==Cr.dx){for((Nr||aa>Cr.dy)&&(aa=Cr.dy);++jrCr.dx)&&(aa=Cr.dx);++jr1);return re+he*Le*Math.sqrt(-2*Math.log(Oe)/Oe)}},logNormal:function(){var re=t.random.normal.apply(t,arguments);return function(){return Math.exp(re())}},bates:function(re){var he=t.random.irwinHall(re);return function(){return he()/re}},irwinHall:function(re){return function(){for(var he=0,we=0;we2?Di:Fi,Ft=Le?rc:Ch;return Re=_t(re,he,Ft,we),Oe=_t(he,re,Ft,Tc),et}function et(_t){return Re(_t)}return et.invert=function(_t){return Oe(_t)},et.domain=function(_t){return arguments.length?(re=_t.map(Number),ut()):re},et.range=function(_t){return arguments.length?(he=_t,ut()):he},et.rangeRound=function(_t){return et.range(_t).interpolate(Bu)},et.clamp=function(_t){return arguments.length?(Le=_t,ut()):Le},et.interpolate=function(_t){return arguments.length?(we=_t,ut()):we},et.ticks=function(_t){return rn(re,_t)},et.tickFormat=function(_t,Ft){return d3_scale_linearTickFormat(re,_t,Ft)},et.nice=function(_t){return Pa(re,_t),ut()},et.copy=function(){return Wi(re,he,we,Le)},ut()}function Oa(re,he){return t.rebind(re,he,"range","rangeRound","interpolate","clamp")}function Pa(re,he){return $r(re,ni(Ja(re,he)[2])),$r(re,ni(Ja(re,he)[2])),re}function Ja(re,he){he==null&&(he=10);var we=ii(re),Le=we[1]-we[0],Re=Math.pow(10,Math.floor(Math.log(Le/he)/Math.LN10)),Oe=he/Le*Re;return Oe<=.15?Re*=10:Oe<=.35?Re*=5:Oe<=.75&&(Re*=2),we[0]=Math.ceil(we[0]/Re)*Re,we[1]=Math.floor(we[1]/Re)*Re+Re*.5,we[2]=Re,we}function rn(re,he){return t.range.apply(t,Ja(re,he))}var Zi={s:1,g:1,p:1,r:1,e:1};function sa(re){return-Math.floor(Math.log(re)/Math.LN10+.01)}function vn(re,he){var we=sa(he[2]);return re in Zi?Math.abs(we-sa(Math.max(v(he[0]),v(he[1]))))+ +(re!=="e"):we-(re==="%")*2}t.scale.log=function(){return Dn(t.scale.linear().domain([0,1]),10,!0,[1,10])};function Dn(re,he,we,Le){function Re(et){return(we?Math.log(et<0?0:et):-Math.log(et>0?0:-et))/Math.log(he)}function Oe(et){return we?Math.pow(he,et):-Math.pow(he,-et)}function ut(et){return re(Re(et))}return ut.invert=function(et){return Oe(re.invert(et))},ut.domain=function(et){return arguments.length?(we=et[0]>=0,re.domain((Le=et.map(Number)).map(Re)),ut):Le},ut.base=function(et){return arguments.length?(he=+et,re.domain(Le.map(Re)),ut):he},ut.nice=function(){var et=$r(Le.map(Re),we?Math:po);return re.domain(et),Le=et.map(Oe),ut},ut.ticks=function(){var et=ii(Le),_t=[],Ft=et[0],Rt=et[1],lr=Math.floor(Re(Ft)),sr=Math.ceil(Re(Rt)),Fr=he%1?2:he;if(isFinite(sr-lr)){if(we){for(;lr0;Or--)_t.push(Oe(lr)*Or);for(lr=0;_t[lr]Rt;sr--);_t=_t.slice(lr,sr)}return _t},ut.copy=function(){return Dn(re.copy(),he,we,Le)},Oa(ut,re)}var po={floor:function(re){return-Math.ceil(-re)},ceil:function(re){return-Math.floor(-re)}};t.scale.pow=function(){return zo(t.scale.linear(),1,[0,1])};function zo(re,he,we){var Le=wo(he),Re=wo(1/he);function Oe(ut){return re(Le(ut))}return Oe.invert=function(ut){return Re(re.invert(ut))},Oe.domain=function(ut){return arguments.length?(re.domain((we=ut.map(Number)).map(Le)),Oe):we},Oe.ticks=function(ut){return rn(we,ut)},Oe.tickFormat=function(ut,et){return d3_scale_linearTickFormat(we,ut,et)},Oe.nice=function(ut){return Oe.domain(Pa(we,ut))},Oe.exponent=function(ut){return arguments.length?(Le=wo(he=ut),Re=wo(1/he),re.domain(we.map(Le)),Oe):he},Oe.copy=function(){return zo(re.copy(),he,we)},Oa(Oe,re)}function wo(re){return function(he){return he<0?-Math.pow(-he,re):Math.pow(he,re)}}t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return $o([],{t:"range",a:[[]]})};function $o(re,he){var we,Le,Re;function Oe(et){return Le[((we.get(et)||(he.t==="range"?we.set(et,re.push(et)):NaN))-1)%Le.length]}function ut(et,_t){return t.range(re.length).map(function(Ft){return et+_t*Ft})}return Oe.domain=function(et){if(!arguments.length)return re;re=[],we=new M;for(var _t=-1,Ft=et.length,Rt;++_t0?we[Oe-1]:re[0],Oesr?0:1;if(Rt=ke)return _t(Rt,Or)+(Ft?_t(Ft,1-Or):"")+"Z";var hr,wr,Cr,Nr,jr=0,Ar=0,Ci,Gi,aa,ga,qa,Fa,Nn,ka,Sn=[];if((Nr=(+ut.apply(this,arguments)||0)/2)&&(Cr=Le===bu?Math.sqrt(Ft*Ft+Rt*Rt):+Le.apply(this,arguments),Or||(Ar*=-1),Rt&&(Ar=ht(Cr/Rt*Math.sin(Nr))),Ft&&(jr=ht(Cr/Ft*Math.sin(Nr)))),Rt){Ci=Rt*Math.cos(lr+Ar),Gi=Rt*Math.sin(lr+Ar),aa=Rt*Math.cos(sr-Ar),ga=Rt*Math.sin(sr-Ar);var ko=Math.abs(sr-lr-2*Ar)<=_e?0:1;if(Ar&&Kc(Ci,Gi,aa,ga)===Or^ko){var Vs=(lr+sr)/2;Ci=Rt*Math.cos(Vs),Gi=Rt*Math.sin(Vs),aa=ga=null}}else Ci=Gi=0;if(Ft){qa=Ft*Math.cos(sr-jr),Fa=Ft*Math.sin(sr-jr),Nn=Ft*Math.cos(lr+jr),ka=Ft*Math.sin(lr+jr);var Ho=Math.abs(lr-sr+2*jr)<=_e?0:1;if(jr&&Kc(qa,Fa,Nn,ka)===1-Or^Ho){var fa=(lr+sr)/2;qa=Ft*Math.cos(fa),Fa=Ft*Math.sin(fa),Nn=ka=null}}else qa=Fa=0;if(Fr>Ye&&(hr=Math.min(Math.abs(Rt-Ft)/2,+we.apply(this,arguments)))>.001){wr=Ft0?0:1}function cd(re,he,we,Le,Re){var Oe=re[0]-he[0],ut=re[1]-he[1],et=(Re?Le:-Le)/Math.sqrt(Oe*Oe+ut*ut),_t=et*ut,Ft=-et*Oe,Rt=re[0]+_t,lr=re[1]+Ft,sr=he[0]+_t,Fr=he[1]+Ft,Or=(Rt+sr)/2,hr=(lr+Fr)/2,wr=sr-Rt,Cr=Fr-lr,Nr=wr*wr+Cr*Cr,jr=we-Le,Ar=Rt*Fr-sr*lr,Ci=(Cr<0?-1:1)*Math.sqrt(Math.max(0,jr*jr*Nr-Ar*Ar)),Gi=(Ar*Cr-wr*Ci)/Nr,aa=(-Ar*wr-Cr*Ci)/Nr,ga=(Ar*Cr+wr*Ci)/Nr,qa=(-Ar*wr+Cr*Ci)/Nr,Fa=Gi-Or,Nn=aa-hr,ka=ga-Or,Sn=qa-hr;return Fa*Fa+Nn*Nn>ka*ka+Sn*Sn&&(Gi=ga,aa=qa),[[Gi-_t,aa-Ft],[Gi*we/jr,aa*we/jr]]}function Qf(){return!0}function Vd(re){var he=Cn,we=_n,Le=Qf,Re=Hl,Oe=Re.key,ut=.7;function et(_t){var Ft=[],Rt=[],lr=-1,sr=_t.length,Fr,Or=wt(he),hr=wt(we);function wr(){Ft.push("M",Re(re(Rt),ut))}for(;++lr1?re.join("L"):re+"Z"}function Gd(re){return re.join("L")+"Z"}function Mf(re){for(var he=0,we=re.length,Le=re[0],Re=[Le[0],",",Le[1]];++he1&&Re.push("H",Le[0]),Re.join("")}function Ih(re){for(var he=0,we=re.length,Le=re[0],Re=[Le[0],",",Le[1]];++he1){et=he[1],Oe=re[_t],_t++,Le+="C"+(Re[0]+ut[0])+","+(Re[1]+ut[1])+","+(Oe[0]-et[0])+","+(Oe[1]-et[1])+","+Oe[0]+","+Oe[1];for(var Ft=2;Ft9&&(Oe=we*3/Math.sqrt(Oe),ut[et]=Oe*Le,ut[et+1]=Oe*Re));for(et=-1;++et<=_t;)Oe=(re[Math.min(_t,et+1)][0]-re[Math.max(0,et-1)][0])/(6*(1+ut[et]*ut[et])),he.push([Oe||0,ut[et]*Oe||0]);return he}function Vt(re){return re.length<3?Hl(re):re[0]+eh(re,pt(re))}t.svg.line.radial=function(){var re=Vd(tr);return re.radius=re.x,delete re.x,re.angle=re.y,delete re.y,re};function tr(re){for(var he,we=-1,Le=re.length,Re,Oe;++we_e)+",1 "+lr}function Ft(Rt,lr,sr,Fr){return"Q 0,0 "+Fr}return Oe.radius=function(Rt){return arguments.length?(we=wt(Rt),Oe):we},Oe.source=function(Rt){return arguments.length?(re=wt(Rt),Oe):re},Oe.target=function(Rt){return arguments.length?(he=wt(Rt),Oe):he},Oe.startAngle=function(Rt){return arguments.length?(Le=wt(Rt),Oe):Le},Oe.endAngle=function(Rt){return arguments.length?(Re=wt(Rt),Oe):Re},Oe};function Sr(re){return re.radius}t.svg.diagonal=function(){var re=rr,he=pr,we=Rr;function Le(Re,Oe){var ut=re.call(this,Re,Oe),et=he.call(this,Re,Oe),_t=(ut.y+et.y)/2,Ft=[ut,{x:ut.x,y:_t},{x:et.x,y:_t},et];return Ft=Ft.map(we),"M"+Ft[0]+"C"+Ft[1]+" "+Ft[2]+" "+Ft[3]}return Le.source=function(Re){return arguments.length?(re=wt(Re),Le):re},Le.target=function(Re){return arguments.length?(he=wt(Re),Le):he},Le.projection=function(Re){return arguments.length?(we=Re,Le):we},Le};function Rr(re){return[re.x,re.y]}t.svg.diagonal.radial=function(){var re=t.svg.diagonal(),he=Rr,we=re.projection;return re.projection=function(Le){return arguments.length?we(Zr(he=Le)):he},re};function Zr(re){return function(){var he=re.apply(this,arguments),we=he[0],Le=he[1]-Ee;return[we*Math.cos(Le),we*Math.sin(Le)]}}t.svg.symbol=function(){var re=qi,he=wi;function we(Le,Re){return(un.get(re.call(this,Le,Re))||Aa)(he.call(this,Le,Re))}return we.type=function(Le){return arguments.length?(re=wt(Le),we):re},we.size=function(Le){return arguments.length?(he=wt(Le),we):he},we};function wi(){return 64}function qi(){return"circle"}function Aa(re){var he=Math.sqrt(re/_e);return"M0,"+he+"A"+he+","+he+" 0 1,1 0,"+-he+"A"+he+","+he+" 0 1,1 0,"+he+"Z"}var un=t.map({circle:Aa,cross:function(re){var he=Math.sqrt(re/5)/2;return"M"+-3*he+","+-he+"H"+-he+"V"+-3*he+"H"+he+"V"+-he+"H"+3*he+"V"+he+"H"+he+"V"+3*he+"H"+-he+"V"+he+"H"+-3*he+"Z"},diamond:function(re){var he=Math.sqrt(re/(2*Tn)),we=he*Tn;return"M0,"+-he+"L"+we+",0 0,"+he+" "+-we+",0Z"},square:function(re){var he=Math.sqrt(re)/2;return"M"+-he+","+-he+"L"+he+","+-he+" "+he+","+he+" "+-he+","+he+"Z"},"triangle-down":function(re){var he=Math.sqrt(re/gn),we=he*gn/2;return"M0,"+we+"L"+he+","+-we+" "+-he+","+-we+"Z"},"triangle-up":function(re){var he=Math.sqrt(re/gn),we=he*gn/2;return"M0,"+-we+"L"+he+","+we+" "+-he+","+we+"Z"}});t.svg.symbolTypes=un.keys();var gn=Math.sqrt(3),Tn=Math.tan(30*De);j.transition=function(re){for(var he=ol||++ls,we=dl(re),Le=[],Re,Oe,ut=wl||{time:Date.now(),ease:Ac,delay:0,duration:250},et=-1,_t=this.length;++et<_t;){Le.push(Re=[]);for(var Ft=this[et],Rt=-1,lr=Ft.length;++Rt0;)lr[--Nr].call(re,Cr);if(wr>=1)return ut.event&&ut.event.end.call(re,re.__data__,he),--Oe.count?delete Oe[Le]:delete re[we],1}ut||(et=Re.time,_t=ba(sr,0,et),ut=Oe[Le]={tween:new M,time:et,timer:_t,delay:Re.delay,duration:Re.duration,ease:Re.ease,index:he},Re=null,++Oe.count)}t.svg.axis=function(){var re=t.scale.linear(),he=Tu,we=6,Le=6,Re=3,Oe=[10],ut=null,et;function _t(Ft){Ft.each(function(){var Rt=t.select(this),lr=this.__chart__||re,sr=this.__chart__=re.copy(),Fr=ut??(sr.ticks?sr.ticks.apply(sr,Oe):sr.domain()),Or=et??(sr.tickFormat?sr.tickFormat.apply(sr,Oe):P),hr=Rt.selectAll(".tick").data(Fr,sr),wr=hr.enter().insert("g",".domain").attr("class","tick").style("opacity",Ye),Cr=t.transition(hr.exit()).style("opacity",Ye).remove(),Nr=t.transition(hr.order()).style("opacity",1),jr=Math.max(we,0)+Re,Ar,Ci=li(sr),Gi=Rt.selectAll(".domain").data([0]),aa=(Gi.enter().append("path").attr("class","domain"),t.transition(Gi));wr.append("line"),wr.append("text");var ga=wr.select("line"),qa=Nr.select("line"),Fa=hr.select("text").text(Or),Nn=wr.select("text"),ka=Nr.select("text"),Sn=he==="top"||he==="left"?-1:1,ko,Vs,Ho,fa;if(he==="bottom"||he==="top"?(Ar=oc,ko="x",Ho="y",Vs="x2",fa="y2",Fa.attr("dy",Sn<0?"0em":".71em").style("text-anchor","middle"),aa.attr("d","M"+Ci[0]+","+Sn*Le+"V0H"+Ci[1]+"V"+Sn*Le)):(Ar=sc,ko="y",Ho="x",Vs="y2",fa="x2",Fa.attr("dy",".32em").style("text-anchor",Sn<0?"end":"start"),aa.attr("d","M"+Sn*Le+","+Ci[0]+"H0V"+Ci[1]+"H"+Sn*Le)),ga.attr(fa,Sn*we),Nn.attr(Ho,Sn*jr),qa.attr(Vs,0).attr(fa,Sn*we),ka.attr(ko,0).attr(Ho,Sn*jr),sr.rangeBand){var jn=sr,Gn=jn.rangeBand()/2;lr=sr=function(Po){return jn(Po)+Gn}}else lr.rangeBand?lr=sr:Cr.call(Ar,sr,lr);wr.call(Ar,lr,sr),Nr.call(Ar,sr,sr)})}return _t.scale=function(Ft){return arguments.length?(re=Ft,_t):re},_t.orient=function(Ft){return arguments.length?(he=Ft in nc?Ft+"":Tu,_t):he},_t.ticks=function(){return arguments.length?(Oe=a(arguments),_t):Oe},_t.tickValues=function(Ft){return arguments.length?(ut=Ft,_t):ut},_t.tickFormat=function(Ft){return arguments.length?(et=Ft,_t):et},_t.tickSize=function(Ft){var Rt=arguments.length;return Rt?(we=+Ft,Le=+arguments[Rt-1],_t):we},_t.innerTickSize=function(Ft){return arguments.length?(we=+Ft,_t):we},_t.outerTickSize=function(Ft){return arguments.length?(Le=+Ft,_t):Le},_t.tickPadding=function(Ft){return arguments.length?(Re=+Ft,_t):Re},_t.tickSubdivide=function(){return arguments.length&&_t},_t};var Tu="bottom",nc={top:1,right:1,bottom:1,left:1};function oc(re,he,we){re.attr("transform",function(Le){var Re=he(Le);return"translate("+(isFinite(Re)?Re:we(Le))+",0)"})}function sc(re,he,we){re.attr("transform",function(Le){var Re=he(Le);return"translate(0,"+(isFinite(Re)?Re:we(Le))+")"})}t.svg.brush=function(){var re=Z(Rt,"brushstart","brush","brushend"),he=null,we=null,Le=[0,0],Re=[0,0],Oe,ut,et=!0,_t=!0,Ft=Gu[0];function Rt(hr){hr.each(function(){var wr=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Or).on("touchstart.brush",Or),Cr=wr.selectAll(".background").data([0]);Cr.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),wr.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Nr=wr.selectAll(".resize").data(Ft,P);Nr.exit().remove(),Nr.enter().append("g").attr("class",function(Gi){return"resize "+Gi}).style("cursor",function(Gi){return Ic[Gi]}).append("rect").attr("x",function(Gi){return/[ew]$/.test(Gi)?-3:null}).attr("y",function(Gi){return/^[ns]/.test(Gi)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Nr.style("display",Rt.empty()?"none":null);var jr=t.transition(wr),Ar=t.transition(Cr),Ci;he&&(Ci=li(he),Ar.attr("x",Ci[0]).attr("width",Ci[1]-Ci[0]),sr(jr)),we&&(Ci=li(we),Ar.attr("y",Ci[0]).attr("height",Ci[1]-Ci[0]),Fr(jr)),lr(jr)})}Rt.event=function(hr){hr.each(function(){var wr=re.of(this,arguments),Cr={x:Le,y:Re,i:Oe,j:ut},Nr=this.__chart__||Cr;this.__chart__=Cr,ol?t.select(this).transition().each("start.brush",function(){Oe=Nr.i,ut=Nr.j,Le=Nr.x,Re=Nr.y,wr({type:"brushstart"})}).tween("brush:brush",function(){var jr=tc(Le,Cr.x),Ar=tc(Re,Cr.y);return Oe=ut=null,function(Ci){Le=Cr.x=jr(Ci),Re=Cr.y=Ar(Ci),wr({type:"brush",mode:"resize"})}}).each("end.brush",function(){Oe=Cr.i,ut=Cr.j,wr({type:"brush",mode:"resize"}),wr({type:"brushend"})}):(wr({type:"brushstart"}),wr({type:"brush",mode:"resize"}),wr({type:"brushend"}))})};function lr(hr){hr.selectAll(".resize").attr("transform",function(wr){return"translate("+Le[+/e$/.test(wr)]+","+Re[+/^s/.test(wr)]+")"})}function sr(hr){hr.select(".extent").attr("x",Le[0]),hr.selectAll(".extent,.n>rect,.s>rect").attr("width",Le[1]-Le[0])}function Fr(hr){hr.select(".extent").attr("y",Re[0]),hr.selectAll(".extent,.e>rect,.w>rect").attr("height",Re[1]-Re[0])}function Or(){var hr=this,wr=t.select(t.event.target),Cr=re.of(hr,arguments),Nr=t.select(hr),jr=wr.datum(),Ar=!/^(n|s)$/.test(jr)&&he,Ci=!/^(e|w)$/.test(jr)&&we,Gi=wr.classed("extent"),aa=mt(hr),ga,qa=t.mouse(hr),Fa,Nn=t.select(l(hr)).on("keydown.brush",ko).on("keyup.brush",Vs);if(t.event.changedTouches?Nn.on("touchmove.brush",Ho).on("touchend.brush",jn):Nn.on("mousemove.brush",Ho).on("mouseup.brush",jn),Nr.interrupt().selectAll("*").interrupt(),Gi)qa[0]=Le[0]-qa[0],qa[1]=Re[0]-qa[1];else if(jr){var ka=+/w$/.test(jr),Sn=+/^n/.test(jr);Fa=[Le[1-ka]-qa[0],Re[1-Sn]-qa[1]],qa[0]=Le[ka],qa[1]=Re[Sn]}else t.event.altKey&&(ga=qa.slice());Nr.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",wr.style("cursor")),Cr({type:"brushstart"}),Ho();function ko(){t.event.keyCode==32&&(Gi||(ga=null,qa[0]-=Le[1],qa[1]-=Re[1],Gi=2),W())}function Vs(){t.event.keyCode==32&&Gi==2&&(qa[0]+=Le[1],qa[1]+=Re[1],Gi=0,W())}function Ho(){var Gn=t.mouse(hr),Po=!1;Fa&&(Gn[0]+=Fa[0],Gn[1]+=Fa[1]),Gi||(t.event.altKey?(ga||(ga=[(Le[0]+Le[1])/2,(Re[0]+Re[1])/2]),qa[0]=Le[+(Gn[0]0))return Je;do Je.push(vt=new Date(+je)),ue(je,Ke),Q(je);while(vt=Ve)for(;Q(Ve),!je(Ve);)Ve.setTime(Ve-1)},function(Ve,Ke){if(Ve>=Ve)if(Ke<0)for(;++Ke<=0;)for(;ue(Ve,-1),!je(Ve););else for(;--Ke>=0;)for(;ue(Ve,1),!je(Ve););})},ge&&(Te.count=function(je,Ve){return i.setTime(+je),a.setTime(+Ve),Q(i),Q(a),Math.floor(ge(i,a))},Te.every=function(je){return je=Math.floor(je),!isFinite(je)||!(je>0)?null:je>1?Te.filter(Me?function(Ve){return Me(Ve)%je===0}:function(Ve){return Te.count(0,Ve)%je===0}):Te}),Te}var s=o(function(){},function(Q,ue){Q.setTime(+Q+ue)},function(Q,ue){return ue-Q});s.every=function(Q){return Q=Math.floor(Q),!isFinite(Q)||!(Q>0)?null:Q>1?o(function(ue){ue.setTime(Math.floor(ue/Q)*Q)},function(ue,ge){ue.setTime(+ue+ge*Q)},function(ue,ge){return(ge-ue)/Q}):s};var l=s.range,n=1e3,u=6e4,c=36e5,f=864e5,h=6048e5,d=o(function(Q){Q.setTime(Q-Q.getMilliseconds())},function(Q,ue){Q.setTime(+Q+ue*n)},function(Q,ue){return(ue-Q)/n},function(Q){return Q.getUTCSeconds()}),p=d.range,g=o(function(Q){Q.setTime(Q-Q.getMilliseconds()-Q.getSeconds()*n)},function(Q,ue){Q.setTime(+Q+ue*u)},function(Q,ue){return(ue-Q)/u},function(Q){return Q.getMinutes()}),m=g.range,y=o(function(Q){Q.setTime(Q-Q.getMilliseconds()-Q.getSeconds()*n-Q.getMinutes()*u)},function(Q,ue){Q.setTime(+Q+ue*c)},function(Q,ue){return(ue-Q)/c},function(Q){return Q.getHours()}),_=y.range,v=o(function(Q){Q.setHours(0,0,0,0)},function(Q,ue){Q.setDate(Q.getDate()+ue)},function(Q,ue){return(ue-Q-(ue.getTimezoneOffset()-Q.getTimezoneOffset())*u)/f},function(Q){return Q.getDate()-1}),x=v.range;function S(Q){return o(function(ue){ue.setDate(ue.getDate()-(ue.getDay()+7-Q)%7),ue.setHours(0,0,0,0)},function(ue,ge){ue.setDate(ue.getDate()+ge*7)},function(ue,ge){return(ge-ue-(ge.getTimezoneOffset()-ue.getTimezoneOffset())*u)/h})}var M=S(0),C=S(1),w=S(2),k=S(3),A=S(4),b=S(5),E=S(6),T=M.range,F=C.range,D=w.range,R=k.range,P=A.range,z=b.range,I=E.range,L=o(function(Q){Q.setDate(1),Q.setHours(0,0,0,0)},function(Q,ue){Q.setMonth(Q.getMonth()+ue)},function(Q,ue){return ue.getMonth()-Q.getMonth()+(ue.getFullYear()-Q.getFullYear())*12},function(Q){return Q.getMonth()}),B=L.range,O=o(function(Q){Q.setMonth(0,1),Q.setHours(0,0,0,0)},function(Q,ue){Q.setFullYear(Q.getFullYear()+ue)},function(Q,ue){return ue.getFullYear()-Q.getFullYear()},function(Q){return Q.getFullYear()});O.every=function(Q){return!isFinite(Q=Math.floor(Q))||!(Q>0)?null:o(function(ue){ue.setFullYear(Math.floor(ue.getFullYear()/Q)*Q),ue.setMonth(0,1),ue.setHours(0,0,0,0)},function(ue,ge){ue.setFullYear(ue.getFullYear()+ge*Q)})};var G=O.range,W=o(function(Q){Q.setUTCSeconds(0,0)},function(Q,ue){Q.setTime(+Q+ue*u)},function(Q,ue){return(ue-Q)/u},function(Q){return Q.getUTCMinutes()}),X=W.range,Z=o(function(Q){Q.setUTCMinutes(0,0,0)},function(Q,ue){Q.setTime(+Q+ue*c)},function(Q,ue){return(ue-Q)/c},function(Q){return Q.getUTCHours()}),J=Z.range,N=o(function(Q){Q.setUTCHours(0,0,0,0)},function(Q,ue){Q.setUTCDate(Q.getUTCDate()+ue)},function(Q,ue){return(ue-Q)/f},function(Q){return Q.getUTCDate()-1}),H=N.range;function $(Q){return o(function(ue){ue.setUTCDate(ue.getUTCDate()-(ue.getUTCDay()+7-Q)%7),ue.setUTCHours(0,0,0,0)},function(ue,ge){ue.setUTCDate(ue.getUTCDate()+ge*7)},function(ue,ge){return(ge-ue)/h})}var U=$(0),V=$(1),j=$(2),q=$(3),Y=$(4),K=$(5),te=$(6),ne=U.range,se=V.range,le=j.range,ce=q.range,pe=Y.range,xe=K.range,ye=te.range,fe=o(function(Q){Q.setUTCDate(1),Q.setUTCHours(0,0,0,0)},function(Q,ue){Q.setUTCMonth(Q.getUTCMonth()+ue)},function(Q,ue){return ue.getUTCMonth()-Q.getUTCMonth()+(ue.getUTCFullYear()-Q.getUTCFullYear())*12},function(Q){return Q.getUTCMonth()}),ae=fe.range,ee=o(function(Q){Q.setUTCMonth(0,1),Q.setUTCHours(0,0,0,0)},function(Q,ue){Q.setUTCFullYear(Q.getUTCFullYear()+ue)},function(Q,ue){return ue.getUTCFullYear()-Q.getUTCFullYear()},function(Q){return Q.getUTCFullYear()});ee.every=function(Q){return!isFinite(Q=Math.floor(Q))||!(Q>0)?null:o(function(ue){ue.setUTCFullYear(Math.floor(ue.getUTCFullYear()/Q)*Q),ue.setUTCMonth(0,1),ue.setUTCHours(0,0,0,0)},function(ue,ge){ue.setUTCFullYear(ue.getUTCFullYear()+ge*Q)})};var ie=ee.range;t.timeDay=v,t.timeDays=x,t.timeFriday=b,t.timeFridays=z,t.timeHour=y,t.timeHours=_,t.timeInterval=o,t.timeMillisecond=s,t.timeMilliseconds=l,t.timeMinute=g,t.timeMinutes=m,t.timeMonday=C,t.timeMondays=F,t.timeMonth=L,t.timeMonths=B,t.timeSaturday=E,t.timeSaturdays=I,t.timeSecond=d,t.timeSeconds=p,t.timeSunday=M,t.timeSundays=T,t.timeThursday=A,t.timeThursdays=P,t.timeTuesday=w,t.timeTuesdays=D,t.timeWednesday=k,t.timeWednesdays=R,t.timeWeek=M,t.timeWeeks=T,t.timeYear=O,t.timeYears=G,t.utcDay=N,t.utcDays=H,t.utcFriday=K,t.utcFridays=xe,t.utcHour=Z,t.utcHours=J,t.utcMillisecond=s,t.utcMilliseconds=l,t.utcMinute=W,t.utcMinutes=X,t.utcMonday=V,t.utcMondays=se,t.utcMonth=fe,t.utcMonths=ae,t.utcSaturday=te,t.utcSaturdays=ye,t.utcSecond=d,t.utcSeconds=p,t.utcSunday=U,t.utcSundays=ne,t.utcThursday=Y,t.utcThursdays=pe,t.utcTuesday=j,t.utcTuesdays=le,t.utcWednesday=q,t.utcWednesdays=ce,t.utcWeek=U,t.utcWeeks=ne,t.utcYear=ee,t.utcYears=ie,Object.defineProperty(t,"__esModule",{value:!0})})}}),eo=de({"node_modules/d3-time-format/dist/d3-time-format.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e,Ba()):(t=t||self,i(t.d3=t.d3||{},t.d3))})(e,function(t,i){"use strict";function a(Ee){if(0<=Ee.y&&Ee.y<100){var De=new Date(-1,Ee.m,Ee.d,Ee.H,Ee.M,Ee.S,Ee.L);return De.setFullYear(Ee.y),De}return new Date(Ee.y,Ee.m,Ee.d,Ee.H,Ee.M,Ee.S,Ee.L)}function o(Ee){if(0<=Ee.y&&Ee.y<100){var De=new Date(Date.UTC(-1,Ee.m,Ee.d,Ee.H,Ee.M,Ee.S,Ee.L));return De.setUTCFullYear(Ee.y),De}return new Date(Date.UTC(Ee.y,Ee.m,Ee.d,Ee.H,Ee.M,Ee.S,Ee.L))}function s(Ee,De,Qe){return{y:Ee,m:De,d:Qe,H:0,M:0,S:0,L:0}}function l(Ee){var De=Ee.dateTime,Qe=Ee.date,Ue=Ee.time,at=Ee.periods,rt=Ee.days,ht=Ee.shortDays,At=Ee.months,dt=Ee.shortMonths,Ht=p(at),fr=g(at),gt=p(rt),yt=g(rt),kt=p(ht),Lt=g(ht),Ct=p(At),$t=g(At),mr=p(dt),br=g(dt),Er={a:dn,A:pi,b:Jr,B:Be,c:null,d:L,e:L,f:X,g:K,G:ne,H:B,I:O,j:G,L:W,m:Z,M:J,p:Fe,q:Et,Q:mt,s:Mt,S:N,u:H,U:$,V,w:j,W:q,x:null,X:null,y:Y,Y:te,Z:se,"%":Pt},Tr={a:St,A:zt,b:Wt,B:Yt,c:null,d:le,e:le,f:fe,g:Ke,G:vt,H:ce,I:pe,j:xe,L:ye,m:ae,M:ee,p:ze,q:tt,Q:mt,s:Mt,S:ie,u:Q,U:ue,V:Me,w:Te,W:je,x:null,X:null,y:Ve,Y:Je,Z:xt,"%":Pt},Ur={a:$i,A:ja,b:ya,B:pa,c:xi,d:A,e:A,f:R,g:M,G:S,H:E,I:E,j:b,L:D,m:k,M:T,p:ea,q:w,Q:z,s:I,S:F,u:y,U:_,V:v,w:m,W:x,x:bi,X:Ua,y:M,Y:S,Z:C,"%":P};Er.x=Ai(Qe,Er),Er.X=Ai(Ue,Er),Er.c=Ai(De,Er),Tr.x=Ai(Qe,Tr),Tr.X=Ai(Ue,Tr),Tr.c=Ai(De,Tr);function Ai(ft,wt){return function(jt){var It=[],Kt=-1,qt=0,vr=ft.length,Br,Pr,Mi;for(jt instanceof Date||(jt=new Date(+jt));++Kt53)return null;"w"in It||(It.w=1),"Z"in It?(qt=o(s(It.y,0,1)),vr=qt.getUTCDay(),qt=vr>4||vr===0?i.utcMonday.ceil(qt):i.utcMonday(qt),qt=i.utcDay.offset(qt,(It.V-1)*7),It.y=qt.getUTCFullYear(),It.m=qt.getUTCMonth(),It.d=qt.getUTCDate()+(It.w+6)%7):(qt=a(s(It.y,0,1)),vr=qt.getDay(),qt=vr>4||vr===0?i.timeMonday.ceil(qt):i.timeMonday(qt),qt=i.timeDay.offset(qt,(It.V-1)*7),It.y=qt.getFullYear(),It.m=qt.getMonth(),It.d=qt.getDate()+(It.w+6)%7)}else("W"in It||"U"in It)&&("w"in It||(It.w="u"in It?It.u%7:"W"in It?1:0),vr="Z"in It?o(s(It.y,0,1)).getUTCDay():a(s(It.y,0,1)).getDay(),It.m=0,It.d="W"in It?(It.w+6)%7+It.W*7-(vr+5)%7:It.w+It.U*7-(vr+6)%7);return"Z"in It?(It.H+=It.Z/100|0,It.M+=It.Z%100,o(It)):a(It)}}function Qr(ft,wt,jt,It){for(var Kt=0,qt=wt.length,vr=jt.length,Br,Pr;Kt=vr)return-1;if(Br=wt.charCodeAt(Kt++),Br===37){if(Br=wt.charAt(Kt++),Pr=Ur[Br in n?wt.charAt(Kt++):Br],!Pr||(It=Pr(ft,jt,It))<0)return-1}else if(Br!=jt.charCodeAt(It++))return-1}return It}function ea(ft,wt,jt){var It=Ht.exec(wt.slice(jt));return It?(ft.p=fr[It[0].toLowerCase()],jt+It[0].length):-1}function $i(ft,wt,jt){var It=kt.exec(wt.slice(jt));return It?(ft.w=Lt[It[0].toLowerCase()],jt+It[0].length):-1}function ja(ft,wt,jt){var It=gt.exec(wt.slice(jt));return It?(ft.w=yt[It[0].toLowerCase()],jt+It[0].length):-1}function ya(ft,wt,jt){var It=mr.exec(wt.slice(jt));return It?(ft.m=br[It[0].toLowerCase()],jt+It[0].length):-1}function pa(ft,wt,jt){var It=Ct.exec(wt.slice(jt));return It?(ft.m=$t[It[0].toLowerCase()],jt+It[0].length):-1}function xi(ft,wt,jt){return Qr(ft,De,wt,jt)}function bi(ft,wt,jt){return Qr(ft,Qe,wt,jt)}function Ua(ft,wt,jt){return Qr(ft,Ue,wt,jt)}function dn(ft){return ht[ft.getDay()]}function pi(ft){return rt[ft.getDay()]}function Jr(ft){return dt[ft.getMonth()]}function Be(ft){return At[ft.getMonth()]}function Fe(ft){return at[+(ft.getHours()>=12)]}function Et(ft){return 1+~~(ft.getMonth()/3)}function St(ft){return ht[ft.getUTCDay()]}function zt(ft){return rt[ft.getUTCDay()]}function Wt(ft){return dt[ft.getUTCMonth()]}function Yt(ft){return At[ft.getUTCMonth()]}function ze(ft){return at[+(ft.getUTCHours()>=12)]}function tt(ft){return 1+~~(ft.getUTCMonth()/3)}return{format:function(ft){var wt=Ai(ft+="",Er);return wt.toString=function(){return ft},wt},parse:function(ft){var wt=oi(ft+="",!1);return wt.toString=function(){return ft},wt},utcFormat:function(ft){var wt=Ai(ft+="",Tr);return wt.toString=function(){return ft},wt},utcParse:function(ft){var wt=oi(ft+="",!0);return wt.toString=function(){return ft},wt}}}var n={"-":"",_:" ",0:"0"},u=/^\s*\d+/,c=/^%/,f=/[\\^$*+?|[\]().{}]/g;function h(Ee,De,Qe){var Ue=Ee<0?"-":"",at=(Ue?-Ee:Ee)+"",rt=at.length;return Ue+(rt68?1900:2e3),Qe+Ue[0].length):-1}function C(Ee,De,Qe){var Ue=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(De.slice(Qe,Qe+6));return Ue?(Ee.Z=Ue[1]?0:-(Ue[2]+(Ue[3]||"00")),Qe+Ue[0].length):-1}function w(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+1));return Ue?(Ee.q=Ue[0]*3-3,Qe+Ue[0].length):-1}function k(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+2));return Ue?(Ee.m=Ue[0]-1,Qe+Ue[0].length):-1}function A(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+2));return Ue?(Ee.d=+Ue[0],Qe+Ue[0].length):-1}function b(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+3));return Ue?(Ee.m=0,Ee.d=+Ue[0],Qe+Ue[0].length):-1}function E(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+2));return Ue?(Ee.H=+Ue[0],Qe+Ue[0].length):-1}function T(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+2));return Ue?(Ee.M=+Ue[0],Qe+Ue[0].length):-1}function F(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+2));return Ue?(Ee.S=+Ue[0],Qe+Ue[0].length):-1}function D(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+3));return Ue?(Ee.L=+Ue[0],Qe+Ue[0].length):-1}function R(Ee,De,Qe){var Ue=u.exec(De.slice(Qe,Qe+6));return Ue?(Ee.L=Math.floor(Ue[0]/1e3),Qe+Ue[0].length):-1}function P(Ee,De,Qe){var Ue=c.exec(De.slice(Qe,Qe+1));return Ue?Qe+Ue[0].length:-1}function z(Ee,De,Qe){var Ue=u.exec(De.slice(Qe));return Ue?(Ee.Q=+Ue[0],Qe+Ue[0].length):-1}function I(Ee,De,Qe){var Ue=u.exec(De.slice(Qe));return Ue?(Ee.s=+Ue[0],Qe+Ue[0].length):-1}function L(Ee,De){return h(Ee.getDate(),De,2)}function B(Ee,De){return h(Ee.getHours(),De,2)}function O(Ee,De){return h(Ee.getHours()%12||12,De,2)}function G(Ee,De){return h(1+i.timeDay.count(i.timeYear(Ee),Ee),De,3)}function W(Ee,De){return h(Ee.getMilliseconds(),De,3)}function X(Ee,De){return W(Ee,De)+"000"}function Z(Ee,De){return h(Ee.getMonth()+1,De,2)}function J(Ee,De){return h(Ee.getMinutes(),De,2)}function N(Ee,De){return h(Ee.getSeconds(),De,2)}function H(Ee){var De=Ee.getDay();return De===0?7:De}function $(Ee,De){return h(i.timeSunday.count(i.timeYear(Ee)-1,Ee),De,2)}function U(Ee){var De=Ee.getDay();return De>=4||De===0?i.timeThursday(Ee):i.timeThursday.ceil(Ee)}function V(Ee,De){return Ee=U(Ee),h(i.timeThursday.count(i.timeYear(Ee),Ee)+(i.timeYear(Ee).getDay()===4),De,2)}function j(Ee){return Ee.getDay()}function q(Ee,De){return h(i.timeMonday.count(i.timeYear(Ee)-1,Ee),De,2)}function Y(Ee,De){return h(Ee.getFullYear()%100,De,2)}function K(Ee,De){return Ee=U(Ee),h(Ee.getFullYear()%100,De,2)}function te(Ee,De){return h(Ee.getFullYear()%1e4,De,4)}function ne(Ee,De){var Qe=Ee.getDay();return Ee=Qe>=4||Qe===0?i.timeThursday(Ee):i.timeThursday.ceil(Ee),h(Ee.getFullYear()%1e4,De,4)}function se(Ee){var De=Ee.getTimezoneOffset();return(De>0?"-":(De*=-1,"+"))+h(De/60|0,"0",2)+h(De%60,"0",2)}function le(Ee,De){return h(Ee.getUTCDate(),De,2)}function ce(Ee,De){return h(Ee.getUTCHours(),De,2)}function pe(Ee,De){return h(Ee.getUTCHours()%12||12,De,2)}function xe(Ee,De){return h(1+i.utcDay.count(i.utcYear(Ee),Ee),De,3)}function ye(Ee,De){return h(Ee.getUTCMilliseconds(),De,3)}function fe(Ee,De){return ye(Ee,De)+"000"}function ae(Ee,De){return h(Ee.getUTCMonth()+1,De,2)}function ee(Ee,De){return h(Ee.getUTCMinutes(),De,2)}function ie(Ee,De){return h(Ee.getUTCSeconds(),De,2)}function Q(Ee){var De=Ee.getUTCDay();return De===0?7:De}function ue(Ee,De){return h(i.utcSunday.count(i.utcYear(Ee)-1,Ee),De,2)}function ge(Ee){var De=Ee.getUTCDay();return De>=4||De===0?i.utcThursday(Ee):i.utcThursday.ceil(Ee)}function Me(Ee,De){return Ee=ge(Ee),h(i.utcThursday.count(i.utcYear(Ee),Ee)+(i.utcYear(Ee).getUTCDay()===4),De,2)}function Te(Ee){return Ee.getUTCDay()}function je(Ee,De){return h(i.utcMonday.count(i.utcYear(Ee)-1,Ee),De,2)}function Ve(Ee,De){return h(Ee.getUTCFullYear()%100,De,2)}function Ke(Ee,De){return Ee=ge(Ee),h(Ee.getUTCFullYear()%100,De,2)}function Je(Ee,De){return h(Ee.getUTCFullYear()%1e4,De,4)}function vt(Ee,De){var Qe=Ee.getUTCDay();return Ee=Qe>=4||Qe===0?i.utcThursday(Ee):i.utcThursday.ceil(Ee),h(Ee.getUTCFullYear()%1e4,De,4)}function xt(){return"+0000"}function Pt(){return"%"}function mt(Ee){return+Ee}function Mt(Ee){return Math.floor(+Ee/1e3)}var lt;qe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function qe(Ee){return lt=l(Ee),t.timeFormat=lt.format,t.timeParse=lt.parse,t.utcFormat=lt.utcFormat,t.utcParse=lt.utcParse,lt}var Ye="%Y-%m-%dT%H:%M:%S.%LZ";function me(Ee){return Ee.toISOString()}var _e=Date.prototype.toISOString?me:t.utcFormat(Ye);function Ae(Ee){var De=new Date(Ee);return isNaN(De)?null:De}var ke=+new Date("2000-01-01T00:00:00.000Z")?Ae:t.utcParse(Ye);t.isoFormat=_e,t.isoParse=ke,t.timeFormatDefaultLocale=qe,t.timeFormatLocale=l,Object.defineProperty(t,"__esModule",{value:!0})})}}),rs=de({"node_modules/d3-format/dist/d3-format.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=typeof globalThis<"u"?globalThis:t||self,i(t.d3=t.d3||{}))})(e,(function(t){"use strict";function i(k){return Math.abs(k=Math.round(k))>=1e21?k.toLocaleString("en").replace(/,/g,""):k.toString(10)}function a(k,A){if((b=(k=A?k.toExponential(A-1):k.toExponential()).indexOf("e"))<0)return null;var b,E=k.slice(0,b);return[E.length>1?E[0]+E.slice(2):E,+k.slice(b+1)]}function o(k){return k=a(Math.abs(k)),k?k[1]:NaN}function s(k,A){return function(b,E){for(var T=b.length,F=[],D=0,R=k[0],P=0;T>0&&R>0&&(P+R+1>E&&(R=Math.max(1,E-P)),F.push(b.substring(T-=R,T+R)),!((P+=R+1)>E));)R=k[D=(D+1)%k.length];return F.reverse().join(A)}}function l(k){return function(A){return A.replace(/[0-9]/g,function(b){return k[+b]})}}var n=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function u(k){if(!(A=n.exec(k)))throw new Error("invalid format: "+k);var A;return new c({fill:A[1],align:A[2],sign:A[3],symbol:A[4],zero:A[5],width:A[6],comma:A[7],precision:A[8]&&A[8].slice(1),trim:A[9],type:A[10]})}u.prototype=c.prototype;function c(k){this.fill=k.fill===void 0?" ":k.fill+"",this.align=k.align===void 0?">":k.align+"",this.sign=k.sign===void 0?"-":k.sign+"",this.symbol=k.symbol===void 0?"":k.symbol+"",this.zero=!!k.zero,this.width=k.width===void 0?void 0:+k.width,this.comma=!!k.comma,this.precision=k.precision===void 0?void 0:+k.precision,this.trim=!!k.trim,this.type=k.type===void 0?"":k.type+""}c.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function f(k){e:for(var A=k.length,b=1,E=-1,T;b0&&(E=0);break}return E>0?k.slice(0,E)+k.slice(T+1):k}var h;function d(k,A){var b=a(k,A);if(!b)return k+"";var E=b[0],T=b[1],F=T-(h=Math.max(-8,Math.min(8,Math.floor(T/3)))*3)+1,D=E.length;return F===D?E:F>D?E+new Array(F-D+1).join("0"):F>0?E.slice(0,F)+"."+E.slice(F):"0."+new Array(1-F).join("0")+a(k,Math.max(0,A+F-1))[0]}function p(k,A){var b=a(k,A);if(!b)return k+"";var E=b[0],T=b[1];return T<0?"0."+new Array(-T).join("0")+E:E.length>T+1?E.slice(0,T+1)+"."+E.slice(T+1):E+new Array(T-E.length+2).join("0")}var g={"%":function(k,A){return(k*100).toFixed(A)},b:function(k){return Math.round(k).toString(2)},c:function(k){return k+""},d:i,e:function(k,A){return k.toExponential(A)},f:function(k,A){return k.toFixed(A)},g:function(k,A){return k.toPrecision(A)},o:function(k){return Math.round(k).toString(8)},p:function(k,A){return p(k*100,A)},r:p,s:d,X:function(k){return Math.round(k).toString(16).toUpperCase()},x:function(k){return Math.round(k).toString(16)}};function m(k){return k}var y=Array.prototype.map,_=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function v(k){var A=k.grouping===void 0||k.thousands===void 0?m:s(y.call(k.grouping,Number),k.thousands+""),b=k.currency===void 0?"":k.currency[0]+"",E=k.currency===void 0?"":k.currency[1]+"",T=k.decimal===void 0?".":k.decimal+"",F=k.numerals===void 0?m:l(y.call(k.numerals,String)),D=k.percent===void 0?"%":k.percent+"",R=k.minus===void 0?"-":k.minus+"",P=k.nan===void 0?"NaN":k.nan+"";function z(L){L=u(L);var B=L.fill,O=L.align,G=L.sign,W=L.symbol,X=L.zero,Z=L.width,J=L.comma,N=L.precision,H=L.trim,$=L.type;$==="n"?(J=!0,$="g"):g[$]||(N===void 0&&(N=12),H=!0,$="g"),(X||B==="0"&&O==="=")&&(X=!0,B="0",O="=");var U=W==="$"?b:W==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",V=W==="$"?E:/[%p]/.test($)?D:"",j=g[$],q=/[defgprs%]/.test($);N=N===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function Y(K){var te=U,ne=V,se,le,ce;if($==="c")ne=j(K)+ne,K="";else{K=+K;var pe=K<0||1/K<0;if(K=isNaN(K)?P:j(Math.abs(K),N),H&&(K=f(K)),pe&&+K==0&&G!=="+"&&(pe=!1),te=(pe?G==="("?G:R:G==="-"||G==="("?"":G)+te,ne=($==="s"?_[8+h/3]:"")+ne+(pe&&G==="("?")":""),q){for(se=-1,le=K.length;++sece||ce>57){ne=(ce===46?T+K.slice(se+1):K.slice(se))+ne,K=K.slice(0,se);break}}}J&&!X&&(K=A(K,1/0));var xe=te.length+K.length+ne.length,ye=xe>1)+te+K+ne+ye.slice(xe);break;default:K=ye+te+K+ne;break}return F(K)}return Y.toString=function(){return L+""},Y}function I(L,B){var O=z((L=u(L),L.type="f",L)),G=Math.max(-8,Math.min(8,Math.floor(o(B)/3)))*3,W=Math.pow(10,-G),X=_[8+G/3];return function(Z){return O(W*Z)+X}}return{format:z,formatPrefix:I}}var x;S({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function S(k){return x=v(k),t.format=x.format,t.formatPrefix=x.formatPrefix,x}function M(k){return Math.max(0,-o(Math.abs(k)))}function C(k,A){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(o(A)/3)))*3-o(Math.abs(k)))}function w(k,A){return k=Math.abs(k),A=Math.abs(A)-k,Math.max(0,o(A)-o(k))+1}t.FormatSpecifier=c,t.formatDefaultLocale=S,t.formatLocale=v,t.formatSpecifier=u,t.precisionFixed=M,t.precisionPrefix=C,t.precisionRound=w,Object.defineProperty(t,"__esModule",{value:!0})}))}}),Oo=de({"node_modules/is-string-blank/index.js"(e,r){"use strict";r.exports=function(t){for(var i=t.length,a,o=0;o13)&&a!==32&&a!==133&&a!==160&&a!==5760&&a!==6158&&(a<8192||a>8205)&&a!==8232&&a!==8233&&a!==8239&&a!==8287&&a!==8288&&a!==12288&&a!==65279)return!1;return!0}}}),da=de({"node_modules/fast-isnumeric/index.js"(e,r){"use strict";var t=Oo();r.exports=function(i){var a=typeof i;if(a==="string"){var o=i;if(i=+i,i===0&&t(o))return!1}else if(a!=="number")return!1;return i-i<1}}}),cn=de({"src/constants/numerical.js"(e,r){"use strict";r.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}}}),Es=de({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=typeof globalThis<"u"?globalThis:t||self,i(t["base64-arraybuffer"]={}))})(e,(function(t){"use strict";for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=typeof Uint8Array>"u"?[]:new Uint8Array(256),o=0;o>2],h+=i[(u[c]&3)<<4|u[c+1]>>4],h+=i[(u[c+1]&15)<<2|u[c+2]>>6],h+=i[u[c+2]&63];return f%3===2?h=h.substring(0,h.length-1)+"=":f%3===1&&(h=h.substring(0,h.length-2)+"=="),h},l=function(n){var u=n.length*.75,c=n.length,f,h=0,d,p,g,m;n[n.length-1]==="="&&(u--,n[n.length-2]==="="&&u--);var y=new ArrayBuffer(u),_=new Uint8Array(y);for(f=0;f>4,_[h++]=(p&15)<<4|g>>2,_[h++]=(g&3)<<6|m&63;return y};t.decode=l,t.encode=s,Object.defineProperty(t,"__esModule",{value:!0})}))}}),is=de({"src/lib/is_plain_object.js"(e,r){"use strict";r.exports=function(i){return window&&window.process&&window.process.versions?Object.prototype.toString.call(i)==="[object Object]":Object.prototype.toString.call(i)==="[object Object]"&&Object.getPrototypeOf(i).hasOwnProperty("hasOwnProperty")}}}),Do=de({"src/lib/array.js"(e){"use strict";var r=Es().decode,t=is(),i=Array.isArray,a=ArrayBuffer,o=DataView;function s(d){return a.isView(d)&&!(d instanceof o)}e.isTypedArray=s;function l(d){return i(d)||s(d)}e.isArrayOrTypedArray=l;function n(d){return!l(d[0])}e.isArray1D=n,e.ensureArray=function(d,p){return i(d)||(d=[]),d.length=p,d};var u={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};u.uint8c=u.u1c,u.uint8=u.u1,u.int8=u.i1,u.uint16=u.u2,u.int16=u.i2,u.uint32=u.u4,u.int32=u.i4,u.float32=u.f4,u.float64=u.f8;function c(d){return d.constructor===ArrayBuffer}e.isArrayBuffer=c,e.decodeTypedArraySpec=function(d){var p=[],g=f(d),m=g.dtype,y=u[m];if(!y)throw new Error('Error in dtype: "'+m+'"');var _=y.BYTES_PER_ELEMENT,v=g.bdata;c(v)||(v=r(v));var x=g.shape===void 0?[v.byteLength/_]:(""+g.shape).split(",");x.reverse();var S=x.length,M,C,w=+x[0],k=_*w,A=0;if(S===1)p=new y(v);else if(S===2)for(M=+x[1],C=0;C2)return y[M]=y[M]|s,x.set(S,null);if(v){for(p=M;p0)return Math.log(a)/Math.LN10;var s=Math.log(Math.min(o[0],o[1]))/Math.LN10;return t(s)||(s=Math.log(Math.max(o[0],o[1]))/Math.LN10-6),s}}}),u0=de({"src/lib/relink_private.js"(e,r){"use strict";var t=Do().isArrayOrTypedArray,i=is();r.exports=function a(o,s){for(var l in s){var n=s[l],u=o[l];if(u!==n)if(l.charAt(0)==="_"||typeof n=="function"){if(l in o)continue;o[l]=n}else if(t(n)&&t(u)&&i(n[0])){if(l==="customdata"||l==="ids")continue;for(var c=Math.min(n.length,u.length),f=0;fvw,modHalf:()=>mw});function vw(e,r){let t=e%r;return t<0?t+r:t}function mw(e,r){return Math.abs(e)>r/2?e-Math.round(e/r)*r:e}var c0=Ir({"src/lib/mod.ts"(){"use strict"}}),fn=de({"src/lib/extend.js"(e){"use strict";var r=is(),t=Array.isArray;function i(o,s){var l,n;for(l=0;l{for(var Ce in be)t(ve,Ce,{get:be[Ce],enumerable:!0})},l=(ve,be,Ce,He)=>{if(be&&typeof be=="object"||typeof be=="function")for(let Xe of a(be))!o.call(ve,Xe)&&Xe!==Ce&&t(ve,Xe,{get:()=>be[Xe],enumerable:!(He=i(be,Xe))||He.enumerable});return ve},n=ve=>l(t({},"__esModule",{value:!0}),ve),u={};s(u,{a98:()=>Co,average:()=>zt,averageAngle:()=>Fe,averageNumber:()=>Et,blend:()=>tf,blerp:()=>Te,clampChroma:()=>ci,clampGamut:()=>Kr,clampRgb:()=>_r,colorsNamed:()=>d,convertA98ToXyz65:()=>lt,convertCubehelixToRgb:()=>ea,convertDlchToLab65:()=>zn,convertHsiToRgb:()=>Fo,convertHslToRgb:()=>Yn,convertHsvToRgb:()=>vs,convertHwbToRgb:()=>Uo,convertItpToXyz65:()=>fl,convertJabToJch:()=>_u,convertJabToRgb:()=>Uf,convertJabToXyz65:()=>mf,convertJchToJab:()=>Dl,convertLab65ToDlch:()=>Ea,convertLab65ToRgb:()=>Hi,convertLab65ToXyz65:()=>gi,convertLabToLch:()=>tt,convertLabToRgb:()=>xl,convertLabToXyz50:()=>Ec,convertLchToLab:()=>wt,convertLchuvToLuv:()=>Lc,convertLrgbToOklab:()=>Tt,convertLrgbToRgb:()=>at,convertLuvToLchuv:()=>Yc,convertLuvToXyz50:()=>Zf,convertOkhslToOklab:()=>Pa,convertOkhsvToOklab:()=>sa,convertOklabToLrgb:()=>zr,convertOklabToOkhsl:()=>Oa,convertOklabToOkhsv:()=>Zi,convertOklabToRgb:()=>ii,convertP3ToXyz65:()=>vo,convertProphotoToXyz50:()=>Kc,convertRec2020ToXyz65:()=>Jc,convertRgbToCubehelix:()=>oi,convertRgbToHsi:()=>uo,convertRgbToHsl:()=>Bn,convertRgbToHsv:()=>go,convertRgbToHwb:()=>kl,convertRgbToJab:()=>Sc,convertRgbToLab:()=>Hf,convertRgbToLab65:()=>Li,convertRgbToLrgb:()=>ke,convertRgbToOklab:()=>Bt,convertRgbToXyb:()=>$l,convertRgbToXyz50:()=>kc,convertRgbToXyz65:()=>De,convertRgbToYiq:()=>Zr,convertXybToRgb:()=>Ge,convertXyz50ToLab:()=>Nu,convertXyz50ToLuv:()=>ic,convertXyz50ToProphoto:()=>bl,convertXyz50ToRgb:()=>rc,convertXyz50ToXyz65:()=>rr,convertXyz65ToA98:()=>me,convertXyz65ToItp:()=>tc,convertXyz65ToJab:()=>vf,convertXyz65ToLab65:()=>Cn,convertXyz65ToP3:()=>qs,convertXyz65ToRec2020:()=>Mf,convertXyz65ToRgb:()=>ht,convertXyz65ToXyz50:()=>tr,convertYiqToRgb:()=>qi,converter:()=>L,cubehelix:()=>Rc,differenceCie76:()=>xi,differenceCie94:()=>bi,differenceCiede2000:()=>Ua,differenceCmc:()=>dn,differenceEuclidean:()=>pa,differenceHueChroma:()=>ya,differenceHueNaive:()=>ja,differenceHueSaturation:()=>$i,differenceHyab:()=>pi,differenceItp:()=>Be,differenceKotsarenkoRamos:()=>Jr,displayable:()=>bt,dlab:()=>ys,dlch:()=>Hu,easingGamma:()=>Gn,easingInOutSine:()=>yo,easingMidpoint:()=>lr,easingSmootherstep:()=>Un,easingSmoothstep:()=>Hn,easingSmoothstepInverse:()=>Ca,filterBrightness:()=>Ei,filterContrast:()=>Yi,filterDeficiencyDeuter:()=>Ga,filterDeficiencyProt:()=>va,filterDeficiencyTrit:()=>wn,filterGrayscale:()=>Da,filterHueRotate:()=>bn,filterInvert:()=>wa,filterSaturate:()=>Ui,filterSepia:()=>la,fixupAlpha:()=>vt,fixupHueDecreasing:()=>Ct,fixupHueIncreasing:()=>Lt,fixupHueLonger:()=>kt,fixupHueShorter:()=>yt,formatCss:()=>pl,formatHex:()=>Tu,formatHex8:()=>nc,formatHsl:()=>sc,formatRgb:()=>oc,getMode:()=>J,hsi:()=>lc,hsl:()=>zc,hsv:()=>Pl,hwb:()=>Il,inGamut:()=>dr,interpolate:()=>wr,interpolateWith:()=>Cr,interpolateWithPremultipliedAlpha:()=>Nr,interpolatorLinear:()=>Je,interpolatorPiecewise:()=>Ke,interpolatorSplineBasis:()=>Ci,interpolatorSplineBasisClosed:()=>Gi,interpolatorSplineMonotone:()=>Vs,interpolatorSplineMonotone2:()=>Ho,interpolatorSplineMonotoneClosed:()=>fa,interpolatorSplineNatural:()=>ga,interpolatorSplineNaturalClosed:()=>qa,itp:()=>Yl,jab:()=>oo,jch:()=>lu,lab:()=>Ms,lab65:()=>uc,lch:()=>Bc,lch65:()=>Oc,lchuv:()=>Zn,lerp:()=>ge,lrgb:()=>Bo,luv:()=>Os,mapAlphaDivide:()=>Oe,mapAlphaMultiply:()=>Re,mapTransferGamma:()=>et,mapTransferLinear:()=>ut,mapper:()=>Le,modeA98:()=>dt,modeCubehelix:()=>Yt,modeDlab:()=>ho,modeDlch:()=>lo,modeHsi:()=>jo,modeHsl:()=>nl,modeHsv:()=>On,modeHwb:()=>yu,modeItp:()=>Ah,modeJab:()=>Bu,modeJch:()=>Ou,modeLab:()=>ql,modeLab65:()=>jd,modeLch:()=>Wc,modeLch65:()=>bf,modeLchuv:()=>ou,modeLrgb:()=>Fh,modeLuv:()=>Af,modeOkhsl:()=>rn,modeOkhsv:()=>Dn,modeOklab:()=>$o,modeOklch:()=>Go,modeP3:()=>bu,modeProphoto:()=>Qf,modeRec2020:()=>Qc,modeRgb:()=>Pt,modeXyb:()=>st,modeXyz50:()=>pt,modeXyz65:()=>Sr,modeYiq:()=>un,nearest:()=>Ni,okhsl:()=>gr,okhsv:()=>hi,oklab:()=>di,oklch:()=>sn,p3:()=>Io,parse:()=>ae,parseHex:()=>_,parseHsl:()=>ws,parseHslLegacy:()=>Vn,parseHwb:()=>Ul,parseLab:()=>nd,parseLch:()=>od,parseNamed:()=>g,parseOklab:()=>zo,parseOklch:()=>Us,parseRgb:()=>ie,parseRgbLegacy:()=>R,parseTransparent:()=>ue,prophoto:()=>_s,random:()=>we,rec2020:()=>an,removeParser:()=>H,rgb:()=>cr,round:()=>Pn,samples:()=>As,serializeHex:()=>wl,serializeHex8:()=>Vu,serializeHsl:()=>dl,serializeRgb:()=>Pc,toGamut:()=>yi,trilerp:()=>je,unlerp:()=>Me,useMode:()=>Z,useParser:()=>N,wcagContrast:()=>Wl,wcagLuminance:()=>Gs,xyb:()=>xr,xyz50:()=>kr,xyz65:()=>fi,yiq:()=>Ti}),r.exports=n(u);var c=(ve,be)=>{if(typeof ve=="number"){if(be===3)return{mode:"rgb",r:(ve>>8&15|ve>>4&240)/255,g:(ve>>4&15|ve&240)/255,b:(ve&15|ve<<4&240)/255};if(be===4)return{mode:"rgb",r:(ve>>12&15|ve>>8&240)/255,g:(ve>>8&15|ve>>4&240)/255,b:(ve>>4&15|ve&240)/255,alpha:(ve&15|ve<<4&240)/255};if(be===6)return{mode:"rgb",r:(ve>>16&255)/255,g:(ve>>8&255)/255,b:(ve&255)/255};if(be===8)return{mode:"rgb",r:(ve>>24&255)/255,g:(ve>>16&255)/255,b:(ve>>8&255)/255,alpha:(ve&255)/255}}},f=c,h={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},d=h,p=ve=>f(d[ve.toLowerCase()],6),g=p,m=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,y=ve=>{let be;return(be=ve.match(m))?f(parseInt(be[1],16),be[1].length):void 0},_=y,v="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",x=`(?:${v}|none)`,S=`${v}%`,M=`(?:${v}%|none)`,C=`(?:${v}%|${v})`,w=`(?:${v}%|${v}|none)`,k=`(?:${v}(deg|grad|rad|turn)|${v})`,A=`(?:${v}(deg|grad|rad|turn)|${v}|none)`,b="\\s*,\\s*",E=new RegExp("^"+w+"$"),T=new RegExp(`^rgba?\\(\\s*${v}${b}${v}${b}${v}\\s*(?:,\\s*${C}\\s*)?\\)$`),F=new RegExp(`^rgba?\\(\\s*${S}${b}${S}${b}${S}\\s*(?:,\\s*${C}\\s*)?\\)$`),D=ve=>{let be={mode:"rgb"},Ce;if(Ce=ve.match(T))Ce[1]!==void 0&&(be.r=Ce[1]/255),Ce[2]!==void 0&&(be.g=Ce[2]/255),Ce[3]!==void 0&&(be.b=Ce[3]/255);else if(Ce=ve.match(F))Ce[1]!==void 0&&(be.r=Ce[1]/100),Ce[2]!==void 0&&(be.g=Ce[2]/100),Ce[3]!==void 0&&(be.b=Ce[3]/100);else return;return Ce[4]!==void 0?be.alpha=Math.max(0,Math.min(1,Ce[4]/100)):Ce[5]!==void 0&&(be.alpha=Math.max(0,Math.min(1,+Ce[5]))),be},R=D,P=(ve,be)=>ve===void 0?void 0:typeof ve!="object"?ae(ve):ve.mode!==void 0?ve:be?ar(Nt({},ve),{mode:be}):void 0,z=P,I=(ve="rgb")=>be=>(be=z(be,ve))!==void 0?be.mode===ve?be:B[be.mode][ve]?B[be.mode][ve](be):ve==="rgb"?B[be.mode].rgb(be):B.rgb[ve](B[be.mode].rgb(be)):void 0,L=I,B={},O={},G=[],W={},X=ve=>ve,Z=ve=>(B[ve.mode]=Nt(Nt({},B[ve.mode]),ve.toMode),Object.keys(ve.fromMode||{}).forEach(be=>{B[be]||(B[be]={}),B[be][ve.mode]=ve.fromMode[be]}),ve.ranges||(ve.ranges={}),ve.difference||(ve.difference={}),ve.channels.forEach(be=>{if(ve.ranges[be]===void 0&&(ve.ranges[be]=[0,1]),!ve.interpolate[be])throw new Error(`Missing interpolator for: ${be}`);typeof ve.interpolate[be]=="function"&&(ve.interpolate[be]={use:ve.interpolate[be]}),ve.interpolate[be].fixup||(ve.interpolate[be].fixup=X)}),O[ve.mode]=ve,(ve.parse||[]).forEach(be=>{N(be,ve.mode)}),L(ve.mode)),J=ve=>O[ve],N=(ve,be)=>{if(typeof ve=="string"){if(!be)throw new Error("'mode' required when 'parser' is a string");W[ve]=be}else typeof ve=="function"&&G.indexOf(ve)<0&&G.push(ve)},H=ve=>{if(typeof ve=="string")delete W[ve];else if(typeof ve=="function"){let be=G.indexOf(ve);be>0&&G.splice(be,1)}},$=/[^\x00-\x7F]|[a-zA-Z_]/,U=/[^\x00-\x7F]|[-\w]/,V={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},j=0;function q(ve){let be=ve[j],Ce=ve[j+1];return be==="-"||be==="+"?/\d/.test(Ce)||Ce==="."&&/\d/.test(ve[j+2]):be==="."?/\d/.test(Ce):/\d/.test(be)}function Y(ve){if(j>=ve.length)return!1;let be=ve[j];if($.test(be))return!0;if(be==="-"){if(ve.length-j<2)return!1;let Ce=ve[j+1];return!!(Ce==="-"||$.test(Ce))}return!1}var K={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function te(ve){let be="";if((ve[j]==="-"||ve[j]==="+")&&(be+=ve[j++]),be+=ne(ve),ve[j]==="."&&/\d/.test(ve[j+1])&&(be+=ve[j++]+ne(ve)),(ve[j]==="e"||ve[j]==="E")&&((ve[j+1]==="-"||ve[j+1]==="+")&&/\d/.test(ve[j+2])?be+=ve[j++]+ve[j++]+ne(ve):/\d/.test(ve[j+1])&&(be+=ve[j++]+ne(ve))),Y(ve)){let Ce=se(ve);return Ce==="deg"||Ce==="rad"||Ce==="turn"||Ce==="grad"?{type:V.Hue,value:be*K[Ce]}:void 0}return ve[j]==="%"?(j++,{type:V.Percentage,value:+be}):{type:V.Number,value:+be}}function ne(ve){let be="";for(;/\d/.test(ve[j]);)be+=ve[j++];return be}function se(ve){let be="";for(;j4)){if(Ce.length===4){if(Ce[3].type!==V.Alpha)return;Ce[3]=Ce[3].value}return Ce.length===3&&Ce.push({type:V.None,value:void 0}),Ce.every(Xe=>Xe.type!==V.Alpha)?Ce:void 0}}function ye(ve,be){ve._i=0;let Ce=ve[ve._i++];if(!Ce||Ce.type!==V.Function)return;let He=xe(ve,be);if(He)return He.unshift(Ce.value),He}var fe=ve=>{if(typeof ve!="string")return;let be=ce(ve),Ce=be?ye(be,!0):void 0,He,Xe=0,it=G.length;for(;Xeve==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,ue=Q,ge=(ve,be,Ce)=>ve+Ce*(be-ve),Me=(ve,be,Ce)=>(Ce-ve)/(be-ve),Te=(ve,be,Ce,He,Xe,it)=>ge(ge(ve,be,Xe),ge(Ce,He,Xe),it),je=(ve,be,Ce,He,Xe,it,Dt,or,Dr,vi,ai)=>ge(Te(ve,be,Ce,He,Dr,vi),Te(Xe,it,Dt,or,Dr,vi),ai),Ve=ve=>{let be=[];for(let Ce=0;Cebe=>{let Ce=Ve(be);return He=>{let Xe=He*Ce.length,it=He>=1?Ce.length-1:Math.max(Math.floor(Xe),0),Dt=Ce[it];return Dt===void 0?void 0:ve(Dt[0],Dt[1],Xe-it)}},Ke=Ze(ge),vt=ve=>{let be=!1,Ce=ve.map(He=>He!==void 0?(be=!0,He):1);return be?Ce:ve},xt={mode:"rgb",channels:["r","g","b","alpha"],parse:[ie,_,R,g,ue,"srgb"],serialize:"srgb",interpolate:{r:Ke,g:Ke,b:Ke,alpha:{use:Ke,fixup:vt}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},Pt=xt,mt=(ve=0)=>Math.pow(Math.abs(ve),563/256)*Math.sign(ve),Mt=ve=>{let be=mt(ve.r),Ce=mt(ve.g),He=mt(ve.b),Xe={mode:"xyz65",x:.5766690429101305*be+.1855582379065463*Ce+.1882286462349947*He,y:.297344975250536*be+.6273635662554661*Ce+.0752914584939979*He,z:.0270313613864123*be+.0706888525358272*Ce+.9913375368376386*He};return ve.alpha!==void 0&&(Xe.alpha=ve.alpha),Xe},lt=Mt,qe=ve=>Math.pow(Math.abs(ve),256/563)*Math.sign(ve),Ye=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"a98",r:qe(ve*2.0415879038107465-be*.5650069742788597-.3447313507783297*Ce),g:qe(ve*-.9692436362808798+be*1.8759675015077206+.0415550574071756*Ce),b:qe(ve*.0134442806320312-be*.1183623922310184+1.0151749943912058*Ce)};return He!==void 0&&(Xe.alpha=He),Xe},me=Ye,_e=(ve=0)=>{let be=Math.abs(ve);return be<=.04045?ve/12.92:(Math.sign(ve)||1)*Math.pow((be+.055)/1.055,2.4)},Ae=({r:ve,g:be,b:Ce,alpha:He})=>{let Xe={mode:"lrgb",r:_e(ve),g:_e(be),b:_e(Ce)};return He!==void 0&&(Xe.alpha=He),Xe},ke=Ae,Ee=ve=>{let{r:be,g:Ce,b:He,alpha:Xe}=ke(ve),it={mode:"xyz65",x:.4123907992659593*be+.357584339383878*Ce+.1804807884018343*He,y:.2126390058715102*be+.715168678767756*Ce+.0721923153607337*He,z:.0193308187155918*be+.119194779794626*Ce+.9505321522496607*He};return Xe!==void 0&&(it.alpha=Xe),it},De=Ee,Je=(ve=0)=>{let be=Math.abs(ve);return be>.0031308?(Math.sign(ve)||1)*(1.055*Math.pow(be,1/2.4)-.055):ve*12.92},Ue=({r:ve,g:be,b:Ce,alpha:He},Xe="rgb")=>{let it={mode:Xe,r:Je(ve),g:Je(be),b:Je(Ce)};return He!==void 0&&(it.alpha=He),it},at=Ue,rt=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=at({r:ve*3.2409699419045226-be*1.537383177570094-.4986107602930034*Ce,g:ve*-.9692436362808796+be*1.8759675015077204+.0415550574071756*Ce,b:ve*.0556300796969936-be*.2039769588889765+1.0569715142428784*Ce});return He!==void 0&&(Xe.alpha=He),Xe},ft=rt,At=ar(Ot({},Pt),{mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:ve=>me(De(ve)),xyz65:me},toMode:{rgb:ve=>ft(lt(ve)),xyz65:lt}}),ht=At,Gt=ve=>(ve=ve%360)<0?ve+360:ve,fr=Gt,gt=(ve,be)=>ve.map((Ce,He,Xe)=>{if(Ce===void 0)return Ce;let it=fr(Ce);return He===0||ve[He-1]===void 0?it:be(it-fr(Xe[He-1]))}).reduce((Ce,He)=>!Ce.length||He===void 0||Ce[Ce.length-1]===void 0?(Ce.push(He),Ce):(Ce.push(He+Ce[Ce.length-1]),Ce),[]),yt=ve=>gt(ve,be=>Math.abs(be)<=180?be:be-360*Math.sign(be)),kt=ve=>gt(ve,be=>Math.abs(be)>=180||be===0?be:be-360*Math.sign(be)),Lt=ve=>gt(ve,be=>be>=0?be:be+360),Ct=ve=>gt(ve,be=>be<=0?be:be-360),$t=[-.14861,1.78277,-.29227,-.90649,1.97294,0],mr=Math.PI/180,br=180/Math.PI,Er=$t[3]*$t[4],Tr=$t[1]*$t[4],Ur=$t[1]*$t[2]-$t[0]*$t[3],Ai=({r:ve,g:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=(Ur*Ce+ve*Er-be*Tr)/(Ur+Er-Tr),it=Ce-Xe,Dt=($t[4]*(be-Xe)-$t[2]*it)/$t[3],or={mode:"cubehelix",l:Xe,s:Xe===0||Xe===1?void 0:Math.sqrt(it*it+Dt*Dt)/($t[4]*Xe*(1-Xe))};return or.s&&(or.h=Math.atan2(Dt,it)*br-120),He!==void 0&&(or.alpha=He),or},oi=Ai,Qr=({h:ve,s:be,l:Ce,alpha:He})=>{let Xe={mode:"rgb"};ve=(ve===void 0?0:ve+120)*mr,Ce===void 0&&(Ce=0);let it=be===void 0?0:be*Ce*(1-Ce),Dt=Math.cos(ve),or=Math.sin(ve);return Xe.r=Ce+it*($t[0]*Dt+$t[1]*or),Xe.g=Ce+it*($t[2]*Dt+$t[3]*or),Xe.b=Ce+it*($t[4]*Dt+$t[5]*or),He!==void 0&&(Xe.alpha=He),Xe},ea=Qr,$i=(ve,be)=>{if(ve.h===void 0||be.h===void 0||!ve.s||!be.s)return 0;let Ce=fr(ve.h),He=fr(be.h),Xe=Math.sin((He-Ce+360)/2*Math.PI/180);return 2*Math.sqrt(ve.s*be.s)*Xe},ja=(ve,be)=>{if(ve.h===void 0||be.h===void 0)return 0;let Ce=fr(ve.h),He=fr(be.h);return Math.abs(He-Ce)>180?Ce-(He-360*Math.sign(He-Ce)):He-Ce},ya=(ve,be)=>{if(ve.h===void 0||be.h===void 0||!ve.c||!be.c)return 0;let Ce=fr(ve.h),He=fr(be.h),Xe=Math.sin((He-Ce+360)/2*Math.PI/180);return 2*Math.sqrt(ve.c*be.c)*Xe},pa=(ve="rgb",be=[1,1,1,0])=>{let Ce=J(ve),He=Ce.channels,Xe=Ce.difference,it=L(ve);return(Dt,or)=>{let Dr=it(Dt),vi=it(or);return Math.sqrt(He.reduce((ai,ei,Oi)=>{let Si=Xe[ei]?Xe[ei](Dr,vi):Dr[ei]-vi[ei];return ai+(be[Oi]||0)*Math.pow(isNaN(Si)?0:Si,2)},0))}},xi=()=>pa("lab65"),bi=(ve=1,be=.045,Ce=.015)=>{let He=L("lab65");return(Xe,it)=>{let Dt=He(Xe),or=He(it),Dr=Dt.l,vi=Dt.a,ai=Dt.b,ei=Math.sqrt(vi*vi+ai*ai),Oi=or.l,Si=or.a,zi=or.b,Vi=Math.sqrt(Si*Si+zi*zi),Xi=Math.pow(Dr-Oi,2),ha=Math.pow(ei-Vi,2),$a=Math.pow(vi-Si,2)+Math.pow(ai-zi,2)-ha;return Math.sqrt(Xi/Math.pow(ve,2)+ha/Math.pow(1+be*ei,2)+$a/Math.pow(1+Ce*ei,2))}},Ua=(ve=1,be=1,Ce=1)=>{let He=L("lab65");return(Xe,it)=>{let Dt=He(Xe),or=He(it),Dr=Dt.l,vi=Dt.a,ai=Dt.b,ei=Math.sqrt(vi*vi+ai*ai),Oi=or.l,Si=or.a,zi=or.b,Vi=Math.sqrt(Si*Si+zi*zi),Xi=(ei+Vi)/2,ha=.5*(1-Math.sqrt(Math.pow(Xi,7)/(Math.pow(Xi,7)+Math.pow(25,7)))),$a=vi*(1+ha),_o=Si*(1+ha),xs=Math.sqrt($a*$a+ai*ai),el=Math.sqrt(_o*_o+zi*zi),vl=Math.abs($a)+Math.abs(ai)===0?0:Math.atan2(ai,$a);vl+=(vl<0)*2*Math.PI;let Al=Math.abs(_o)+Math.abs(zi)===0?0:Math.atan2(zi,_o);Al+=(Al<0)*2*Math.PI;let uu=Oi-Dr,Ef=el-xs,Rh=xs*el===0?0:Al-vl;Rh-=(Rh>Math.PI)*2*Math.PI,Rh+=(Rh<-Math.PI)*2*Math.PI;let Gd=2*Math.sqrt(xs*el)*Math.sin(Rh/2),ov=(Dr+Oi)/2,sv=(xs+el)/2,kf;xs*el===0?kf=vl+Al:(kf=(vl+Al)/2,kf-=(Math.abs(vl-Al)>Math.PI)*Math.PI,kf+=(kf<0)*2*Math.PI);let Y2=Math.pow(ov-50,2),X2=1-.17*Math.cos(kf-Math.PI/6)+.24*Math.cos(2*kf)+.32*Math.cos(3*kf+Math.PI/30)-.2*Math.cos(4*kf-63*Math.PI/180),oy=1+.015*Y2/Math.sqrt(20+Y2),sy=1+.045*sv,Zm=1+.015*sv*X2,GS=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*kf-275)/25,2)),Z2=2*Math.sqrt(Math.pow(sv,7)/(Math.pow(sv,7)+Math.pow(25,7))),ly=-1*Math.sin(2*GS)*Z2;return Math.sqrt(Math.pow(uu/(ve*oy),2)+Math.pow(Ef/(be*sy),2)+Math.pow(Gd/(Ce*Zm),2)+ly*Ef/(be*sy)*Gd/(Ce*Zm))}},dn=(ve=1,be=1)=>{let Ce=L("lab65");return(He,Xe)=>{let it=Ce(He),Dt=it.l,or=it.a,Dr=it.b,vi=Math.sqrt(or*or+Dr*Dr),ai=Math.atan2(Dr,or);ai=ai+2*Math.PI*(ai<0);let ei=Ce(Xe),Oi=ei.l,Si=ei.a,zi=ei.b,Vi=Math.sqrt(Si*Si+zi*zi),Xi=Math.pow(Dt-Oi,2),ha=Math.pow(vi-Vi,2),$a=Math.pow(or-Si,2)+Math.pow(Dr-zi,2)-ha,_o=Math.sqrt(Math.pow(vi,4)/(Math.pow(vi,4)+1900)),xs=ai>=164/180*Math.PI&&ai<=345/180*Math.PI?.56+Math.abs(.2*Math.cos(ai+168/180*Math.PI)):.36+Math.abs(.4*Math.cos(ai+35/180*Math.PI)),el=Dt<16?.511:.040975*Dt/(1+.01765*Dt),vl=.0638*vi/(1+.0131*vi)+.638,Al=vl*(_o*xs+1-_o);return Math.sqrt(Xi/Math.pow(ve*el,2)+ha/Math.pow(be*vl,2)+$a/Math.pow(Al,2))}},pi=()=>{let ve=L("lab65");return(be,Ce)=>{let He=ve(be),Xe=ve(Ce),it=He.l-Xe.l,Dt=He.a-Xe.a,or=He.b-Xe.b;return Math.abs(it)+Math.sqrt(Dt*Dt+or*or)}},Jr=()=>pa("yiq",[.5053,.299,.1957]),Be=()=>pa("itp",[518400,129600,518400]),Fe=ve=>{let be=ve.reduce((He,Xe)=>{if(Xe!==void 0){let it=Xe*Math.PI/180;He.sin+=Math.sin(it),He.cos+=Math.cos(it)}return He},{sin:0,cos:0}),Ce=Math.atan2(be.sin,be.cos)*180/Math.PI;return Ce<0?360+Ce:Ce},Et=ve=>{let be=ve.filter(Ce=>Ce!==void 0);return be.length?be.reduce((Ce,He)=>Ce+He,0)/be.length:void 0},St=ve=>typeof ve=="function";function zt(ve,be="rgb",Ce){let He=J(be),Xe=ve.map(L(be));return He.channels.reduce((it,Dt)=>{let or=Xe.map(Dr=>Dr[Dt]).filter(Dr=>Dr!==void 0);if(or.length){let Dr;St(Ce)?Dr=Ce:Ce&&St(Ce[Dt])?Dr=Ce[Dt]:He.average&&St(He.average[Dt])?Dr=He.average[Dt]:Dr=Et,it[Dt]=Dr(or,Dt)}return it},{mode:be})}var Wt={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:oi},toMode:{rgb:ea},interpolate:{h:{use:Ke,fixup:yt},s:Ke,l:Ke,alpha:{use:Ke,fixup:vt}},difference:{h:$i},average:{h:Fe}},Yt=Wt,ze=({l:ve,a:be,b:Ce,alpha:He},Xe="lch")=>{be===void 0&&(be=0),Ce===void 0&&(Ce=0);let it=Math.sqrt(be*be+Ce*Ce),Dt={mode:Xe,l:ve,c:it};return it&&(Dt.h=fr(Math.atan2(Ce,be)*180/Math.PI)),He!==void 0&&(Dt.alpha=He),Dt},tt=ze,ct=({l:ve,c:be,h:Ce,alpha:He},Xe="lab")=>{Ce===void 0&&(Ce=0);let it={mode:Xe,l:ve,a:be?be*Math.cos(Ce/180*Math.PI):0,b:be?be*Math.sin(Ce/180*Math.PI):0};return He!==void 0&&(it.alpha=He),it},wt=ct,Nt=Math.pow(29,3)/Math.pow(3,3),It=Math.pow(6,3)/Math.pow(29,3),Zt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},qt={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},vr=Math.pow(29,3)/Math.pow(3,3),Br=Math.pow(6,3)/Math.pow(29,3),Pr=ve=>Math.pow(ve,3)>It?Math.pow(ve,3):(116*ve-16)/Nt,Mi=({l:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=(ve+16)/116,it=be/500+Xe,Dt=Xe-Ce/200,or={mode:"xyz65",x:Pr(it)*qt.X,y:Pr(Xe)*qt.Y,z:Pr(Dt)*qt.Z};return He!==void 0&&(or.alpha=He),or},gi=Mi,ba=ve=>ft(gi(ve)),Hi=ba,Za=ve=>ve>It?Math.cbrt(ve):(Nt*ve+16)/116,oa=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Za(ve/qt.X),it=Za(be/qt.Y),Dt=Za(Ce/qt.Z),or={mode:"lab65",l:116*it-16,a:500*(Xe-it),b:200*(it-Dt)};return He!==void 0&&(or.alpha=He),or},Cn=oa,_n=ve=>{let be=Cn(De(ve));return ve.r===ve.b&&ve.b===ve.g&&(be.a=be.b=0),be},Li=_n,In=1,pn=1,Ka=26/180*Math.PI,Rn=Math.cos(Ka),tn=Math.sin(Ka),Mn=100/Math.log(139/100),Kn=({l:ve,c:be,h:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"lab65",l:(Math.exp(ve*In/Mn)-1)/.0039},it=(Math.exp(.0435*be*pn*In)-1)/.075,Dt=it*Math.cos(Ce/180*Math.PI-Ka),or=it*Math.sin(Ce/180*Math.PI-Ka);return Xe.a=Dt*Rn-or/.83*tn,Xe.b=Dt*tn+or/.83*Rn,He!==void 0&&(Xe.alpha=He),Xe},zn=Kn,ua=({l:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=be*Rn+Ce*tn,it=.83*(Ce*Rn-be*tn),Dt=Math.sqrt(Xe*Xe+it*it),or={mode:"dlch",l:Mn/In*Math.log(1+.0039*ve),c:Math.log(1+.075*Dt)/(.0435*pn*In)};return or.c&&(or.h=fr((Math.atan2(it,Xe)+Ka)/Math.PI*180)),He!==void 0&&(or.alpha=He),or},Ea=ua,ln=ve=>zn(tt(ve,"dlch")),on=ve=>wt(Ea(ve),"dlab"),ao={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:ln,rgb:ve=>Hi(ln(ve))},fromMode:{lab65:on,rgb:ve=>on(Li(ve))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Ke,a:Ke,b:Ke,alpha:{use:Ke,fixup:vt}}},ho=ao,Jn={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:zn,dlab:ve=>wt(ve,"dlab"),rgb:ve=>Hi(zn(ve))},fromMode:{lab65:Ea,dlab:ve=>tt(ve,"dlch"),rgb:ve=>Ea(Li(ve))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Ke,c:Ke,h:{use:Ke,fixup:yt},alpha:{use:Ke,fixup:vt}},difference:{h:ya},average:{h:Fe}},lo=Jn;function Fo({h:ve,s:be,i:Ce,alpha:He}){ve=fr(ve!==void 0?ve:0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.abs(ve/60%2-1),it;switch(Math.floor(ve/60)){case 0:it={r:Ce*(1+be*(3/(2-Xe)-1)),g:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1)),b:Ce*(1-be)};break;case 1:it={r:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1)),g:Ce*(1+be*(3/(2-Xe)-1)),b:Ce*(1-be)};break;case 2:it={r:Ce*(1-be),g:Ce*(1+be*(3/(2-Xe)-1)),b:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1))};break;case 3:it={r:Ce*(1-be),g:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1)),b:Ce*(1+be*(3/(2-Xe)-1))};break;case 4:it={r:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1)),g:Ce*(1-be),b:Ce*(1+be*(3/(2-Xe)-1))};break;case 5:it={r:Ce*(1+be*(3/(2-Xe)-1)),g:Ce*(1-be),b:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1))};break;default:it={r:Ce*(1-be),g:Ce*(1-be),b:Ce*(1-be)}}return it.mode="rgb",He!==void 0&&(it.alpha=He),it}function uo({r:ve,g:be,b:Ce,alpha:He}){ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.max(ve,be,Ce),it=Math.min(ve,be,Ce),Dt={mode:"hsi",s:ve+be+Ce===0?0:1-3*it/(ve+be+Ce),i:(ve+be+Ce)/3};return Xe-it!==0&&(Dt.h=(Xe===ve?(be-Ce)/(Xe-it)+(be{switch(be){case"deg":return+ve;case"rad":return ve/Math.PI*180;case"grad":return ve/10*9;case"turn":return ve*360}},xo=ps,no=new RegExp(`^hsla?\\(\\s*${k}${b}${S}${b}${S}\\s*(?:,\\s*${C}\\s*)?\\)$`),Mo=ve=>{let be=ve.match(no);if(!be)return;let Ce={mode:"hsl"};return be[3]!==void 0?Ce.h=+be[3]:be[1]!==void 0&&be[2]!==void 0&&(Ce.h=xo(be[1],be[2])),be[4]!==void 0&&(Ce.s=Math.min(Math.max(0,be[4]/100),1)),be[5]!==void 0&&(Ce.l=Math.min(Math.max(0,be[5]/100),1)),be[6]!==void 0?Ce.alpha=Math.max(0,Math.min(1,be[6]/100)):be[7]!==void 0&&(Ce.alpha=Math.max(0,Math.min(1,+be[7]))),Ce},Vn=Mo;function ts(ve,be){if(!be||be[0]!=="hsl"&&be[0]!=="hsla")return;let Ce={mode:"hsl"},[,He,Xe,it,Dt]=be;if(He.type!==V.None){if(He.type===V.Percentage)return;Ce.h=He.value}if(Xe.type!==V.None){if(Xe.type===V.Hue)return;Ce.s=Xe.value/100}if(it.type!==V.None){if(it.type===V.Hue)return;Ce.l=it.value/100}return Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var ws=ts,So={mode:"hsl",toMode:{rgb:Yn},fromMode:{rgb:Bn},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[ws,Vn],serialize:ve=>`hsl(${ve.h!==void 0?ve.h:"none"} ${ve.s!==void 0?ve.s*100+"%":"none"} ${ve.l!==void 0?ve.l*100+"%":"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,interpolate:{h:{use:Ke,fixup:yt},s:Ke,l:Ke,alpha:{use:Ke,fixup:vt}},difference:{h:$i},average:{h:Fe}},nl=So;function vs({h:ve,s:be,v:Ce,alpha:He}){ve=fr(ve!==void 0?ve:0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.abs(ve/60%2-1),it;switch(Math.floor(ve/60)){case 0:it={r:Ce,g:Ce*(1-be*Xe),b:Ce*(1-be)};break;case 1:it={r:Ce*(1-be*Xe),g:Ce,b:Ce*(1-be)};break;case 2:it={r:Ce*(1-be),g:Ce,b:Ce*(1-be*Xe)};break;case 3:it={r:Ce*(1-be),g:Ce*(1-be*Xe),b:Ce};break;case 4:it={r:Ce*(1-be*Xe),g:Ce*(1-be),b:Ce};break;case 5:it={r:Ce,g:Ce*(1-be),b:Ce*(1-be*Xe)};break;default:it={r:Ce*(1-be),g:Ce*(1-be),b:Ce*(1-be)}}return it.mode="rgb",He!==void 0&&(it.alpha=He),it}function go({r:ve,g:be,b:Ce,alpha:He}){ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.max(ve,be,Ce),it=Math.min(ve,be,Ce),Dt={mode:"hsv",s:Xe===0?0:1-it/Xe,v:Xe};return Xe-it!==0&&(Dt.h=(Xe===ve?(be-Ce)/(Xe-it)+(be1){let Xe=be+Ce;be/=Xe,Ce/=Xe}return vs({h:ve,s:Ce===1?1:1-be/(1-Ce),v:1-Ce,alpha:He})}function kl(ve){let be=go(ve);if(be===void 0)return;let Ce=be.s!==void 0?be.s:0,He=be.v!==void 0?be.v:0,Xe={mode:"hwb",w:(1-Ce)*He,b:1-He};return be.h!==void 0&&(Xe.h=be.h),be.alpha!==void 0&&(Xe.alpha=be.alpha),Xe}function mu(ve,be){if(!be||be[0]!=="hwb")return;let Ce={mode:"hwb"},[,He,Xe,it,Dt]=be;if(He.type!==V.None){if(He.type===V.Percentage)return;Ce.h=He.value}if(Xe.type!==V.None){if(Xe.type===V.Hue)return;Ce.w=Xe.value/100}if(it.type!==V.None){if(it.type===V.Hue)return;Ce.b=it.value/100}return Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var Ul=mu,gu={mode:"hwb",toMode:{rgb:Uo},fromMode:{rgb:kl},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Ul],serialize:ve=>`hwb(${ve.h!==void 0?ve.h:"none"} ${ve.w!==void 0?ve.w*100+"%":"none"} ${ve.b!==void 0?ve.b*100+"%":"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,interpolate:{h:{use:Ke,fixup:yt},w:Ke,b:Ke,alpha:{use:Ke,fixup:vt}},difference:{h:ja},average:{h:Fe}},yu=gu,Fu=203,au=.1593017578125,xc=78.84375,Pu=.8359375,Cl=18.8515625,bc=18.6875;function Iu(ve){if(ve<0)return 0;let be=Math.pow(ve,1/xc);return 1e4*Math.pow(Math.max(0,be-Pu)/(Cl-bc*be),1/au)}function _l(ve){if(ve<0)return 0;let be=Math.pow(ve/1e4,au);return Math.pow((Pu+Cl*be)/(1+bc*be),xc)}var ms=ve=>Math.max(ve/Fu,0),ss=({i:ve,t:be,p:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Iu(ve+.008609037037932761*be+.11102962500302593*Ce),it=Iu(ve-.00860903703793275*be-.11102962500302599*Ce),Dt=Iu(ve+.5600313357106791*be-.32062717498731885*Ce),or={mode:"xyz65",x:ms(2.070152218389422*Xe-1.3263473389671556*it+.2066510476294051*Dt),y:ms(.3647385209748074*Xe+.680566024947227*it-.0453045459220346*Dt),z:ms(-.049747207535812*Xe-.0492609666966138*it+1.1880659249923042*Dt)};return He!==void 0&&(or.alpha=He),or},fl=ss,wc=(ve=0)=>Math.max(ve*Fu,0),Tc=({x:ve,y:be,z:Ce,alpha:He})=>{let Xe=wc(ve),it=wc(be),Dt=wc(Ce),or=_l(.3592832590121217*Xe+.6976051147779502*it-.0358915932320289*Dt),Dr=_l(-.1920808463704995*Xe+1.1004767970374323*it+.0753748658519118*Dt),vi=_l(.0070797844607477*Xe+.0748396662186366*it+.8433265453898765*Dt),ai=.5*or+.5*Dr,ei=1.61376953125*or-3.323486328125*Dr+1.709716796875*vi,Oi=4.378173828125*or-4.24560546875*Dr-.132568359375*vi,Si={mode:"itp",i:ai,t:ei,p:Oi};return He!==void 0&&(Si.alpha=He),Si},tc=Tc,wh={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:fl,rgb:ve=>ft(fl(ve))},fromMode:{xyz65:tc,rgb:ve=>tc(De(ve))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:Ke,t:Ke,p:Ke,alpha:{use:Ke,fixup:vt}}},Th=wh,Rd=134.03437499999998,fp=16295499532821565e-27,Ru=ve=>{if(ve<0)return 0;let be=Math.pow(ve/1e4,au);return Math.pow((Pu+Cl*be)/(1+bc*be),Rd)},Ts=(ve=0)=>Math.max(ve*203,0),Ah=({x:ve,y:be,z:Ce,alpha:He})=>{ve=Ts(ve),be=Ts(be),Ce=Ts(Ce);let Xe=1.15*ve-.15*Ce,it=.66*be+.34*ve,Dt=Ru(.41478972*Xe+.579999*it+.014648*Ce),or=Ru(-.20151*Xe+1.120649*it+.0531008*Ce),Dr=Ru(-.0166008*Xe+.2648*it+.6684799*Ce),vi=(Dt+or)/2,ai={mode:"jab",j:.44*vi/(1-.56*vi)-fp,a:3.524*Dt-4.066708*or+.542708*Dr,b:.199076*Dt+1.096799*or-1.295875*Dr};return He!==void 0&&(ai.alpha=He),ai},vf=Ah,Ac=134.03437499999998,Mh=16295499532821565e-27,Mc=ve=>{if(ve<0)return 0;let be=Math.pow(ve,1/Ac);return 1e4*Math.pow((Pu-be)/(bc*be-Cl),1/au)},$c=ve=>ve/203,zu=({j:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=(ve+Mh)/(.44+.56*(ve+Mh)),it=Mc(Xe+.13860504*be+.058047316*Ce),Dt=Mc(Xe-.13860504*be-.058047316*Ce),or=Mc(Xe-.096019242*be-.8118919*Ce),Dr={mode:"xyz65",x:$c(1.661373024652174*it-.914523081304348*Dt+.23136208173913045*or),y:$c(-.3250758611844533*it+1.571847026732543*Dt-.21825383453227928*or),z:$c(-.090982811*it-.31272829*Dt+1.5227666*or)};return He!==void 0&&(Dr.alpha=He),Dr},mf=zu,jf=ve=>{let be=vf(De(ve));return ve.r===ve.b&&ve.b===ve.g&&(be.a=be.b=0),be},Sc=jf,id=ve=>ft(mf(ve)),Uf=id,zd={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:Sc,xyz65:vf},toMode:{rgb:Uf,xyz65:mf},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:Ke,a:Ke,b:Ke,alpha:{use:Ke,fixup:vt}}},Bu=zd,Sh=({j:ve,a:be,b:Ce,alpha:He})=>{be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.sqrt(be*be+Ce*Ce),it={mode:"jch",j:ve,c:Xe};return Xe&&(it.h=fr(Math.atan2(Ce,be)*180/Math.PI)),He!==void 0&&(it.alpha=He),it},_u=Sh,qf=({j:ve,c:be,h:Ce,alpha:He})=>{Ce===void 0&&(Ce=0);let Xe={mode:"jab",j:ve,a:be?be*Math.cos(Ce/180*Math.PI):0,b:be?be*Math.sin(Ce/180*Math.PI):0};return He!==void 0&&(Xe.alpha=He),Xe},Dl=qf,gf={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Dl,rgb:ve=>Uf(Dl(ve))},fromMode:{rgb:ve=>_u(Sc(ve)),jab:_u},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:Ke,fixup:yt},c:Ke,j:Ke,alpha:{use:Ke,fixup:vt}},difference:{h:ya},average:{h:Fe}},Ou=gf,yf=Math.pow(29,3)/Math.pow(3,3),_f=Math.pow(6,3)/Math.pow(29,3),Vf=ve=>Math.pow(ve,3)>_f?Math.pow(ve,3):(116*ve-16)/yf,Eh=({l:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=(ve+16)/116,it=be/500+Xe,Dt=Xe-Ce/200,or={mode:"xyz50",x:Vf(it)*Zt.X,y:Vf(Xe)*Zt.Y,z:Vf(Dt)*Zt.Z};return He!==void 0&&(or.alpha=He),or},Ec=Eh,kh=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=at({r:ve*3.1341359569958707-be*1.6173863321612538-.4906619460083532*Ce,g:ve*-.978795502912089+be*1.916254567259524+.03344273116131949*Ce,b:ve*.07195537988411677-be*.2289768264158322+1.405386058324125*Ce});return He!==void 0&&(Xe.alpha=He),Xe},rc=kh,Bd=ve=>rc(Ec(ve)),xl=Bd,xu=ve=>{let{r:be,g:Ce,b:He,alpha:Xe}=ke(ve),it={mode:"xyz50",x:.436065742824811*be+.3851514688337912*Ce+.14307845442264197*He,y:.22249319175623702*be+.7168870538238823*Ce+.06061979053616537*He,z:.013923904500943465*be+.09708128566574634*Ce+.7140993584005155*He};return Xe!==void 0&&(it.alpha=Xe),it},kc=xu,hl=ve=>ve>_f?Math.cbrt(ve):(yf*ve+16)/116,Gf=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=hl(ve/Zt.X),it=hl(be/Zt.Y),Dt=hl(Ce/Zt.Z),or={mode:"lab",l:116*it-16,a:500*(Xe-it),b:200*(it-Dt)};return He!==void 0&&(or.alpha=He),or},Nu=Gf,Cc=ve=>{let be=Nu(kc(ve));return ve.r===ve.b&&ve.b===ve.g&&(be.a=be.b=0),be},Hf=Cc;function Od(ve,be){if(!be||be[0]!=="lab")return;let Ce={mode:"lab"},[,He,Xe,it,Dt]=be;if(!(He.type===V.Hue||Xe.type===V.Hue||it.type===V.Hue))return He.type!==V.None&&(Ce.l=Math.min(Math.max(0,He.value),100)),Xe.type!==V.None&&(Ce.a=Xe.type===V.Number?Xe.value:Xe.value*125/100),it.type!==V.None&&(Ce.b=it.type===V.Number?it.value:it.value*125/100),Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var ad=Od,ju={mode:"lab",toMode:{xyz50:Ec,rgb:xl},fromMode:{xyz50:Nu,rgb:Hf},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[ad],serialize:ve=>`lab(${ve.l!==void 0?ve.l:"none"} ${ve.a!==void 0?ve.a:"none"} ${ve.b!==void 0?ve.b:"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,interpolate:{l:Ke,a:Ke,b:Ke,alpha:{use:Ke,fixup:vt}}},ql=ju,Vl=ar(Ot({},ql),{mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:gi,rgb:Hi},fromMode:{xyz65:Cn,rgb:Li},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}}),Nd=Vl;function xf(ve,be){if(!be||be[0]!=="lch")return;let Ce={mode:"lch"},[,He,Xe,it,Dt]=be;if(He.type!==V.None){if(He.type===V.Hue)return;Ce.l=Math.min(Math.max(0,He.value),100)}if(Xe.type!==V.None&&(Ce.c=Math.max(0,Xe.type===V.Number?Xe.value:Xe.value*150/100)),it.type!==V.None){if(it.type===V.Percentage)return;Ce.h=it.value}return Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var nd=xf,nu={mode:"lch",toMode:{lab:wt,rgb:ve=>xl(wt(ve))},fromMode:{rgb:ve=>tt(Hf(ve)),lab:tt},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[nd],serialize:ve=>`lch(${ve.l!==void 0?ve.l:"none"} ${ve.c!==void 0?ve.c:"none"} ${ve.h!==void 0?ve.h:"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,interpolate:{h:{use:Ke,fixup:yt},c:Ke,l:Ke,alpha:{use:Ke,fixup:vt}},difference:{h:ya},average:{h:Fe}},Wc=nu,$f=ar(Ot({},Wc),{mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:ve=>wt(ve,"lab65"),rgb:ve=>Hi(wt(ve,"lab65"))},fromMode:{rgb:ve=>tt(Li(ve),"lch65"),lab65:ve=>tt(ve,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}}),bf=$f,jd=({l:ve,u:be,v:Ce,alpha:He})=>{be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.sqrt(be*be+Ce*Ce),it={mode:"lchuv",l:ve,c:Xe};return Xe&&(it.h=fr(Math.atan2(Ce,be)*180/Math.PI)),He!==void 0&&(it.alpha=He),it},Yc=jd,Dc=({l:ve,c:be,h:Ce,alpha:He})=>{Ce===void 0&&(Ce=0);let Xe={mode:"luv",l:ve,u:be?be*Math.cos(Ce/180*Math.PI):0,v:be?be*Math.sin(Ce/180*Math.PI):0};return He!==void 0&&(Xe.alpha=He),Xe},Lc=Dc,wf=(ve,be,Ce)=>4*ve/(ve+15*be+3*Ce),od=(ve,be,Ce)=>9*be/(ve+15*be+3*Ce),Wf=wf(Zt.X,Zt.Y,Zt.Z),Xc=od(Zt.X,Zt.Y,Zt.Z),Yf=ve=>ve<=_f?yf*ve:116*Math.cbrt(ve)-16,Zc=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Yf(be/Zt.Y),it=wf(ve,be,Ce),Dt=od(ve,be,Ce);!isFinite(it)||!isFinite(Dt)?Xe=it=Dt=0:(it=13*Xe*(it-Wf),Dt=13*Xe*(Dt-Xc));let or={mode:"luv",l:Xe,u:it,v:Dt};return He!==void 0&&(or.alpha=He),or},ic=Zc,Tf=(ve,be,Ce)=>4*ve/(ve+15*be+3*Ce),Xf=(ve,be,Ce)=>9*be/(ve+15*be+3*Ce),sd=Tf(Zt.X,Zt.Y,Zt.Z),Ch=Xf(Zt.X,Zt.Y,Zt.Z),Ud=({l:ve,u:be,v:Ce,alpha:He})=>{if(ve===void 0&&(ve=0),ve===0)return{mode:"xyz50",x:0,y:0,z:0};be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=be/(13*ve)+sd,it=Ce/(13*ve)+Ch,Dt=Zt.Y*(ve<=8?ve/yf:Math.pow((ve+16)/116,3)),or=Dt*(9*Xe)/(4*it),Dr=Dt*(12-3*Xe-20*it)/(4*it),vi={mode:"xyz50",x:or,y:Dt,z:Dr};return He!==void 0&&(vi.alpha=He),vi},Zf=Ud,ld=ve=>Yc(ic(kc(ve))),Dh=ve=>rc(Zf(Lc(ve))),Js={mode:"lchuv",toMode:{luv:Lc,rgb:Dh},fromMode:{rgb:ld,luv:Yc},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Ke,fixup:yt},c:Ke,l:Ke,alpha:{use:Ke,fixup:vt}},difference:{h:ya},average:{h:Fe}},ou=Js,Kf=ar(Ot({},Pt),{mode:"lrgb",toMode:{rgb:at},fromMode:{rgb:ke},parse:["srgb-linear"],serialize:"srgb-linear"}),Lh=Kf,Jf={mode:"luv",toMode:{xyz50:Zf,rgb:ve=>rc(Zf(ve))},fromMode:{xyz50:ic,rgb:ve=>ic(kc(ve))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:Ke,u:Ke,v:Ke,alpha:{use:Ke,fixup:vt}}},Af=Jf,nt=({r:ve,g:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.cbrt(.412221469470763*ve+.5363325372617348*be+.0514459932675022*Ce),it=Math.cbrt(.2119034958178252*ve+.6806995506452344*be+.1073969535369406*Ce),Dt=Math.cbrt(.0883024591900564*ve+.2817188391361215*be+.6299787016738222*Ce),or={mode:"oklab",l:.210454268309314*Xe+.7936177747023054*it-.0040720430116193*Dt,a:1.9779985324311684*Xe-2.42859224204858*it+.450593709617411*Dt,b:.0259040424655478*Xe+.7827717124575296*it-.8086757549230774*Dt};return He!==void 0&&(or.alpha=He),or},Tt=nt,Kt=ve=>{let be=Tt(ke(ve));return ve.r===ve.b&&ve.b===ve.g&&(be.a=be.b=0),be},Bt=Kt,yr=({l:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.pow(ve+.3963377773761749*be+.2158037573099136*Ce,3),it=Math.pow(ve-.1055613458156586*be-.0638541728258133*Ce,3),Dt=Math.pow(ve-.0894841775298119*be-1.2914855480194092*Ce,3),or={mode:"lrgb",r:4.076741636075957*Xe-3.3077115392580616*it+.2309699031821044*Dt,g:-1.2684379732850317*Xe+2.6097573492876887*it-.3413193760026573*Dt,b:-.0041960761386756*Xe-.7034186179359362*it+1.7076146940746117*Dt};return He!==void 0&&(or.alpha=He),or},zr=yr,Gr=ve=>at(zr(ve)),ii=Gr;function li(ve){let He=1.170873786407767;return .5*(He*ve-.206+Math.sqrt((He*ve-.206)*(He*ve-.206)+4*.03*He*ve))}function Fi(ve){return(ve*ve+.206*ve)/(1.170873786407767*(ve+.03))}function $r(ve,be){let Ce,He,Xe,it,Dt,or,Dr,vi;-1.88170328*ve-.80936493*be>1?(Ce=1.19086277,He=1.76576728,Xe=.59662641,it=.75515197,Dt=.56771245,or=4.0767416621,Dr=-3.3077115913,vi=.2309699292):1.81444104*ve-1.19445276*be>1?(Ce=.73956515,He=-.45954404,Xe=.08285427,it=.1254107,Dt=.14503204,or=-1.2684380046,Dr=2.6097574011,vi=-.3413193965):(Ce=1.35733652,He=-.00915799,Xe=-1.1513021,it=-.50559606,Dt=.00692167,or=-.0041960863,Dr=-.7034186147,vi=1.707614701);let ai=Ce+He*ve+Xe*be+it*ve*ve+Dt*ve*be,ei=.3963377774*ve+.2158037573*be,Oi=-.1055613458*ve-.0638541728*be,Si=-.0894841775*ve-1.291485548*be;{let zi=1+ai*ei,Vi=1+ai*Oi,Xi=1+ai*Si,ha=zi*zi*zi,$a=Vi*Vi*Vi,_o=Xi*Xi*Xi,xs=3*ei*zi*zi,el=3*Oi*Vi*Vi,vl=3*Si*Xi*Xi,Al=6*ei*ei*zi,uu=6*Oi*Oi*Vi,Ef=6*Si*Si*Xi,Rh=or*ha+Dr*$a+vi*_o,Gd=or*xs+Dr*el+vi*vl,ov=or*Al+Dr*uu+vi*Ef;ai=ai-Rh*Gd/(Gd*Gd-.5*Rh*ov)}return ai}function ni(ve,be){let Ce=$r(ve,be),He=zr({l:1,a:Ce*ve,b:Ce*be}),Xe=Math.cbrt(1/Math.max(He.r,He.g,He.b)),it=Xe*Ce;return[Xe,it]}function ui(ve,be,Ce,He,Xe,it=null){it||(it=ni(ve,be));let Dt;if((Ce-Xe)*it[1]-(it[0]-Xe)*He<=0)Dt=it[1]*Xe/(He*it[0]+it[1]*(Xe-Ce));else{Dt=it[1]*(Xe-1)/(He*(it[0]-1)+it[1]*(Xe-Ce));{let or=Ce-Xe,Dr=He,vi=.3963377774*ve+.2158037573*be,ai=-.1055613458*ve-.0638541728*be,ei=-.0894841775*ve-1.291485548*be,Oi=or+Dr*vi,Si=or+Dr*ai,zi=or+Dr*ei;{let Vi=Xe*(1-Dt)+Dt*Ce,Xi=Dt*He,ha=Vi+Xi*vi,$a=Vi+Xi*ai,_o=Vi+Xi*ei,xs=ha*ha*ha,el=$a*$a*$a,vl=_o*_o*_o,Al=3*Oi*ha*ha,uu=3*Si*$a*$a,Ef=3*zi*_o*_o,Rh=6*Oi*Oi*ha,Gd=6*Si*Si*$a,ov=6*zi*zi*_o,sv=4.0767416621*xs-3.3077115913*el+.2309699292*vl-1,kf=4.0767416621*Al-3.3077115913*uu+.2309699292*Ef,Y2=4.0767416621*Rh-3.3077115913*Gd+.2309699292*ov,X2=kf/(kf*kf-.5*sv*Y2),oy=-sv*X2,sy=-1.2684380046*xs+2.6097574011*el-.3413193965*vl-1,Zm=-1.2684380046*Al+2.6097574011*uu-.3413193965*Ef,GS=-1.2684380046*Rh+2.6097574011*Gd-.3413193965*ov,Z2=Zm/(Zm*Zm-.5*sy*GS),ly=-sy*Z2,yj=-.0041960863*xs-.7034186147*el+1.707614701*vl-1,HS=-.0041960863*Al-.7034186147*uu+1.707614701*Ef,Cce=-.0041960863*Rh-.7034186147*Gd+1.707614701*ov,_j=HS/(HS*HS-.5*yj*Cce),$S=-yj*_j;oy=X2>=0?oy:1e6,ly=Z2>=0?ly:1e6,$S=_j>=0?$S:1e6,Dt+=Math.min(oy,Math.min(ly,$S))}}}return Dt}function Di(ve,be,Ce=null){Ce||(Ce=ni(ve,be));let He=Ce[0],Xe=Ce[1];return[Xe/He,Xe/(1-He)]}function Wi(ve,be,Ce){let He=ni(be,Ce),Xe=ui(be,Ce,ve,1,ve,He),it=Di(be,Ce,He),Dt=.11516993+1/(7.4477897+4.1590124*Ce+be*(-2.19557347+1.75198401*Ce+be*(-2.13704948-10.02301043*Ce+be*(-4.24894561+5.38770819*Ce+4.69891013*be)))),or=.11239642+1/(1.6132032-.68124379*Ce+be*(.40370612+.90148123*Ce+be*(-.27087943+.6122399*Ce+be*(.00299215-.45399568*Ce-.14661872*be)))),Dr=Xe/Math.min(ve*it[0],(1-ve)*it[1]),vi=ve*Dt,ai=(1-ve)*or,ei=.9*Dr*Math.sqrt(Math.sqrt(1/(1/(vi*vi*vi*vi)+1/(ai*ai*ai*ai))));return vi=ve*.4,ai=(1-ve)*.8,[Math.sqrt(1/(1/(vi*vi)+1/(ai*ai))),ei,Xe]}function Oa(ve){let be=ve.l!==void 0?ve.l:0,Ce=ve.a!==void 0?ve.a:0,He=ve.b!==void 0?ve.b:0,Xe={mode:"okhsl",l:li(be)};ve.alpha!==void 0&&(Xe.alpha=ve.alpha);let it=Math.sqrt(Ce*Ce+He*He);if(!it)return Xe.s=0,Xe;let[Dt,or,Dr]=Wi(be,Ce/it,He/it),vi;if(itOa(Bt(ve))},toMode:{oklab:Pa,rgb:ve=>ii(Pa(ve))}}),rn=Ja;function Zi(ve){let be=ve.l!==void 0?ve.l:0,Ce=ve.a!==void 0?ve.a:0,He=ve.b!==void 0?ve.b:0,Xe=Math.sqrt(Ce*Ce+He*He),it=Xe?Ce/Xe:1,Dt=Xe?He/Xe:1,[or,Dr]=Di(it,Dt),vi=.5,ai=1-vi/or,ei=Dr/(Xe+be*Dr),Oi=ei*be,Si=ei*Xe,zi=Fi(Oi),Vi=Si*zi/Oi,Xi=zr({l:zi,a:it*Vi,b:Dt*Vi}),ha=Math.cbrt(1/Math.max(Xi.r,Xi.g,Xi.b,0));be=be/ha,Xe=Xe/ha*li(be)/be,be=li(be);let $a={mode:"okhsv",s:Xe?(vi+Dr)*Si/(Dr*vi+Dr*ai*Si):0,v:be?be/Oi:0};return $a.s&&($a.h=fr(Math.atan2(He,Ce)*180/Math.PI)),ve.alpha!==void 0&&($a.alpha=ve.alpha),$a}function sa(ve){let be={mode:"oklab"};ve.alpha!==void 0&&(be.alpha=ve.alpha);let Ce=ve.h!==void 0?ve.h:0,He=ve.s!==void 0?ve.s:0,Xe=ve.v!==void 0?ve.v:0,it=Math.cos(Ce/180*Math.PI),Dt=Math.sin(Ce/180*Math.PI),[or,Dr]=Di(it,Dt),vi=.5,ai=1-vi/or,ei=1-He*vi/(vi+Dr-Dr*ai*He),Oi=He*Dr*vi/(vi+Dr-Dr*ai*He),Si=Fi(ei),zi=Oi*Si/ei,Vi=zr({l:Si,a:it*zi,b:Dt*zi}),Xi=Math.cbrt(1/Math.max(Vi.r,Vi.g,Vi.b,0)),ha=Fi(Xe*ei),$a=Oi*ha/ei;return be.l=ha*Xi,be.a=$a*it*Xi,be.b=$a*Dt*Xi,be}var vn=ar(Ot({},On),{mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Zi,rgb:ve=>Zi(Bt(ve))},toMode:{oklab:sa,rgb:ve=>ii(sa(ve))}}),Dn=vn;function po(ve,be){if(!be||be[0]!=="oklab")return;let Ce={mode:"oklab"},[,He,Xe,it,Dt]=be;if(!(He.type===V.Hue||Xe.type===V.Hue||it.type===V.Hue))return He.type!==V.None&&(Ce.l=Math.min(Math.max(0,He.type===V.Number?He.value:He.value/100),1)),Xe.type!==V.None&&(Ce.a=Xe.type===V.Number?Xe.value:Xe.value*.4/100),it.type!==V.None&&(Ce.b=it.type===V.Number?it.value:it.value*.4/100),Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var zo=po,wo=ar(Ot({},ql),{mode:"oklab",toMode:{lrgb:zr,rgb:ii},fromMode:{lrgb:Tt,rgb:Bt},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[zo],serialize:ve=>`oklab(${ve.l!==void 0?ve.l:"none"} ${ve.a!==void 0?ve.a:"none"} ${ve.b!==void 0?ve.b:"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`}),$o=wo;function io(ve,be){if(!be||be[0]!=="oklch")return;let Ce={mode:"oklch"},[,He,Xe,it,Dt]=be;if(He.type!==V.None){if(He.type===V.Hue)return;Ce.l=Math.min(Math.max(0,He.type===V.Number?He.value:He.value/100),1)}if(Xe.type!==V.None&&(Ce.c=Math.max(0,Xe.type===V.Number?Xe.value:Xe.value*.4/100)),it.type!==V.None){if(it.type===V.Percentage)return;Ce.h=it.value}return Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var Us=io,gs=ar(Ot({},Wc),{mode:"oklch",toMode:{oklab:ve=>wt(ve,"oklab"),rgb:ve=>ii(wt(ve,"oklab"))},fromMode:{rgb:ve=>tt(Bt(ve),"oklch"),oklab:ve=>tt(ve,"oklch")},parse:[Us],serialize:ve=>`oklch(${ve.l!==void 0?ve.l:"none"} ${ve.c!==void 0?ve.c:"none"} ${ve.h!==void 0?ve.h:"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}}),Go=gs,ma=ve=>{let{r:be,g:Ce,b:He,alpha:Xe}=ke(ve),it={mode:"xyz65",x:.486570948648216*be+.265667693169093*Ce+.1982172852343625*He,y:.2289745640697487*be+.6917385218365062*Ce+.079286914093745*He,z:0*be+.0451133818589026*Ce+1.043944368900976*He};return Xe!==void 0&&(it.alpha=Xe),it},vo=ma,Ds=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=at({r:ve*2.4934969119414263-be*.9313836179191242-.402710784450717*Ce,g:ve*-.8294889695615749+be*1.7626640603183465+.0236246858419436*Ce,b:ve*.0358458302437845-be*.0761723892680418+.9568845240076871*Ce},"p3");return He!==void 0&&(Xe.alpha=He),Xe},qs=Ds,Ll=ar(Ot({},Pt),{mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:ve=>qs(De(ve)),xyz65:qs},toMode:{rgb:ve=>ft(vo(ve)),xyz65:vo}}),bu=Ll,Gl=ve=>{let be=Math.abs(ve);return be>=1/512?Math.sign(ve)*Math.pow(be,1/1.8):16*ve},ac=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"prophoto",r:Gl(ve*1.3457868816471585-be*.2555720873797946-.0511018649755453*Ce),g:Gl(ve*-.5446307051249019+be*1.5082477428451466+.0205274474364214*Ce),b:Gl(ve*0+be*0+1.2119675456389452*Ce)};return He!==void 0&&(Xe.alpha=He),Xe},bl=ac,Uu=(ve=0)=>{let be=Math.abs(ve);return be>=16/512?Math.sign(ve)*Math.pow(be,1.8):ve/16},Fc=ve=>{let be=Uu(ve.r),Ce=Uu(ve.g),He=Uu(ve.b),Xe={mode:"xyz50",x:.7977666449006423*be+.1351812974005331*Ce+.0313477341283922*He,y:.2880748288194013*be+.7118352342418731*Ce+899369387256e-16*He,z:0*be+0*Ce+.8251046025104602*He};return ve.alpha!==void 0&&(Xe.alpha=ve.alpha),Xe},Kc=Fc,ud=ar(Ot({},Pt),{mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:bl,rgb:ve=>bl(kc(ve))},toMode:{xyz50:Kc,rgb:ve=>rc(Kc(ve))}}),Qf=ud,qd=1.09929682680944,Fh=.018053968510807,Hl=ve=>{let be=Math.abs(ve);return be>Fh?(Math.sign(ve)||1)*(qd*Math.pow(be,.45)-(qd-1)):4.5*ve},Vd=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"rec2020",r:Hl(ve*1.7166511879712683-be*.3556707837763925-.2533662813736599*Ce),g:Hl(ve*-.6666843518324893+be*1.6164812366349395+.0157685458139111*Ce),b:Hl(ve*.0176398574453108-be*.0427706132578085+.9421031212354739*Ce)};return He!==void 0&&(Xe.alpha=He),Xe},Mf=Vd,Ph=1.09929682680944,Ih=.018053968510807,qu=(ve=0)=>{let be=Math.abs(ve);return be{let be=qu(ve.r),Ce=qu(ve.g),He=qu(ve.b),Xe={mode:"xyz65",x:.6369580483012911*be+.1446169035862083*Ce+.1688809751641721*He,y:.262700212011267*be+.6779980715188708*Ce+.059301716469862*He,z:0*be+.0280726930490874*Ce+1.0609850577107909*He};return ve.alpha!==void 0&&(Xe.alpha=ve.alpha),Xe},Jc=cd,eh=ar(Ot({},Pt),{mode:"rec2020",fromMode:{xyz65:Mf,rgb:ve=>Mf(De(ve))},toMode:{xyz65:Jc,rgb:ve=>ft(Jc(ve))},parse:["rec2020"],serialize:"rec2020"}),Qc=eh,wu=.0037930732552754493,ef=Math.cbrt(wu),Sf=ve=>Math.cbrt(ve)-ef,fd=ve=>{let{r:be,g:Ce,b:He,alpha:Xe}=ke(ve),it=Sf(.3*be+.622*Ce+.078*He+wu),Dt=Sf(.23*be+.692*Ce+.078*He+wu),or=Sf(.2434226892454782*be+.2047674442449682*Ce+.5518098665095535*He+wu),Dr={mode:"xyb",x:(it-Dt)/2,y:(it+Dt)/2,b:or-(it+Dt)/2};return Xe!==void 0&&(Dr.alpha=Xe),Dr},$l=fd,Se=ve=>Math.pow(ve+ef,3),Pe=({x:ve,y:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Se(ve+be)-wu,it=Se(be-ve)-wu,Dt=Se(Ce+be)-wu,or=at({r:11.031566904639861*Xe-9.866943908131562*it-.16462299650829934*Dt,g:-3.2541473810744237*Xe+4.418770377582723*it-.16462299650829934*Dt,b:-3.6588512867136815*Xe+2.7129230459360922*it+1.9459282407775895*Dt});return He!==void 0&&(or.alpha=He),or},Ge=Pe,$e={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:Ge},fromMode:{rgb:$l},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:Ke,y:Ke,b:Ke,alpha:{use:Ke,fixup:vt}}},st=$e,ot={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:rc,lab:Nu},fromMode:{rgb:kc,lab:Ec},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:Ke,y:Ke,z:Ke,alpha:{use:Ke,fixup:vt}}},pt=ot,Vt=ve=>{let{x:be,y:Ce,z:He,alpha:Xe}=ve;be===void 0&&(be=0),Ce===void 0&&(Ce=0),He===void 0&&(He=0);let it={mode:"xyz50",x:1.0479298208405488*be+.0229467933410191*Ce-.0501922295431356*He,y:.0296278156881593*be+.990434484573249*Ce-.0170738250293851*He,z:-.0092430581525912*be+.0150551448965779*Ce+.7518742899580008*He};return Xe!==void 0&&(it.alpha=Xe),it},tr=Vt,Ut=ve=>{let{x:be,y:Ce,z:He,alpha:Xe}=ve;be===void 0&&(be=0),Ce===void 0&&(Ce=0),He===void 0&&(He=0);let it={mode:"xyz65",x:.9554734527042182*be-.0230985368742614*Ce+.0632593086610217*He,y:-.0283697069632081*be+1.0099954580058226*Ce+.021041398966943*He,z:.0123140016883199*be-.0205076964334779*Ce+1.3303659366080753*He};return Xe!==void 0&&(it.alpha=Xe),it},rr=Ut,pr={mode:"xyz65",toMode:{rgb:ft,xyz50:tr},fromMode:{rgb:De,xyz50:rr},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:Ke,y:Ke,z:Ke,alpha:{use:Ke,fixup:vt}}},Sr=pr,Rr=({r:ve,g:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"yiq",y:.29889531*ve+.58662247*be+.11448223*Ce,i:.59597799*ve-.2741761*be-.32180189*Ce,q:.21147017*ve-.52261711*be+.31114694*Ce};return He!==void 0&&(Xe.alpha=He),Xe},Zr=Rr,wi=({y:ve,i:be,q:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"rgb",r:ve+.95608445*be+.6208885*Ce,g:ve-.27137664*be-.6486059*Ce,b:ve-1.10561724*be+1.70250126*Ce};return He!==void 0&&(Xe.alpha=He),Xe},qi=wi,Aa={mode:"yiq",toMode:{rgb:qi},fromMode:{rgb:Zr},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:Ke,i:Ke,q:Ke,alpha:{use:Ke,fixup:vt}}},un=Aa,gn=(ve,be)=>Math.round(ve*(be=Math.pow(10,be)))/be,Tn=(ve=4)=>be=>typeof be=="number"?gn(be,ve):be,Pn=Tn,Eo=Pn(2),qo=ve=>Math.max(0,Math.min(1,ve||0)),Wn=ve=>Math.round(qo(ve)*255),ls=L("rgb"),ol=L("hsl"),wl=ve=>{if(ve===void 0)return;let be=Wn(ve.r),Ce=Wn(ve.g),He=Wn(ve.b);return"#"+(1<<24|be<<16|Ce<<8|He).toString(16).slice(1)},Vu=ve=>{if(ve===void 0)return;let be=Wn(ve.alpha!==void 0?ve.alpha:1);return wl(ve)+(256|be).toString(16).slice(1)},Pc=ve=>{if(ve===void 0)return;let be=Wn(ve.r),Ce=Wn(ve.g),He=Wn(ve.b);return ve.alpha===void 0||ve.alpha===1?`rgb(${be}, ${Ce}, ${He})`:`rgba(${be}, ${Ce}, ${He}, ${Eo(qo(ve.alpha))})`},dl=ve=>{if(ve===void 0)return;let be=Eo(ve.h||0),Ce=Eo(qo(ve.s)*100)+"%",He=Eo(qo(ve.l)*100)+"%";return ve.alpha===void 0||ve.alpha===1?`hsl(${be}, ${Ce}, ${He})`:`hsla(${be}, ${Ce}, ${He}, ${Eo(qo(ve.alpha))})`},pl=ve=>{let be=z(ve);if(!be)return;let Ce=J(be.mode);if(!Ce.serialize||typeof Ce.serialize=="string"){let He=`color(${Ce.serialize||`--${be.mode}`} `;return Ce.channels.forEach((Xe,it)=>{Xe!=="alpha"&&(He+=(it?" ":"")+(be[Xe]!==void 0?be[Xe]:"none"))}),be.alpha!==void 0&&be.alpha<1&&(He+=` / ${be.alpha}`),He+")"}if(typeof Ce.serialize=="function")return Ce.serialize(be)},Tu=ve=>wl(ls(ve)),nc=ve=>Vu(ls(ve)),oc=ve=>Pc(ls(ve)),sc=ve=>dl(ol(ve)),Ic={normal:(ve,be)=>be,multiply:(ve,be)=>ve*be,screen:(ve,be)=>ve+be-ve*be,"hard-light":(ve,be)=>be<.5?ve*2*be:2*be*(1-ve)-1,overlay:(ve,be)=>ve<.5?be*2*ve:2*ve*(1-be)-1,darken:(ve,be)=>Math.min(ve,be),lighten:(ve,be)=>Math.max(ve,be),"color-dodge":(ve,be)=>ve===0?0:be===1?1:Math.min(1,ve/(1-be)),"color-burn":(ve,be)=>ve===1?1:be===0?0:1-Math.min(1,(1-ve)/be),"soft-light":(ve,be)=>be<.5?ve-(1-2*be)*ve*(1-ve):ve+(2*be-1)*((ve<.25?((16*ve-12)*ve+4)*ve:Math.sqrt(ve))-ve),difference:(ve,be)=>Math.abs(ve-be),exclusion:(ve,be)=>ve+be-2*ve*be},Gu=(ve,be="normal",Ce="rgb")=>{let He=typeof be=="function"?be:Ic[be],Xe=L(Ce),it=J(Ce).channels;return ve.map(or=>{let Dr=Xe(or);return Dr.alpha===void 0&&(Dr.alpha=1),Dr}).reduce((or,Dr)=>{if(or===void 0)return Dr;let vi=Dr.alpha+or.alpha*(1-Dr.alpha);return it.reduce((ai,ei)=>(ei!=="alpha"&&(vi===0?ai[ei]=0:(ai[ei]=Dr.alpha*(1-or.alpha)*Dr[ei]+Dr.alpha*or.alpha*He(or[ei],Dr[ei])+(1-Dr.alpha)*or.alpha*or[ei],ai[ei]=Math.max(0,Math.min(1,ai[ei]/vi)))),ai),{mode:Ce,alpha:vi})})},tf=Gu,th=([ve,be])=>ve+Math.random()*(be-ve),re=ve=>Object.keys(ve).reduce((be,Ce)=>{let He=ve[Ce];return be[Ce]=Array.isArray(He)?He:[He,He],be},{}),he=(ve="rgb",be={})=>{let Ce=J(ve),He=re(be);return Ce.channels.reduce((Xe,it)=>((He.alpha||it!=="alpha")&&(Xe[it]=th(He[it]||Ce.ranges[it])),Xe),{mode:ve})},we=he,Le=(ve,be="rgb",Ce=!1)=>{let He=be?J(be).channels:null,Xe=be?L(be):z;return it=>{let Dt=Xe(it);if(!Dt)return;let or=(He||J(Dt.mode).channels).reduce((vi,ai)=>{let ei=ve(Dt[ai],ai,Dt,be);return ei!==void 0&&!isNaN(ei)&&(vi[ai]=ei),vi},{mode:Dt.mode});if(!Ce)return or;let Dr=z(it);return Dr&&Dr.mode!==or.mode?L(Dr.mode)(or):or}},Re=(ve,be,Ce)=>be!=="alpha"?(ve||0)*(Ce.alpha!==void 0?Ce.alpha:1):ve,Ne=(ve,be,Ce)=>be!=="alpha"&&Ce.alpha!==0?(ve||0)/(Ce.alpha!==void 0?Ce.alpha:1):ve,ut=(ve=1,be=0)=>(Ce,He)=>He!=="alpha"?Ce*ve+be:Ce,et=(ve=1,be=1,Ce=0)=>(He,Xe)=>Xe!=="alpha"?ve*Math.pow(He,be)+Ce:He,_t=ve=>{ve[0]===void 0&&(ve[0]=0),ve[ve.length-1]===void 0&&(ve[ve.length-1]=1);let be=1,Ce,He,Xe,it;for(;bebe=>ve<=0?1:ve>=1?0:Math.pow(be,Math.log(.5)/Math.log(ve)),lr=Rt,sr=ve=>typeof ve=="function",Fr=ve=>ve&&typeof ve=="object",Or=ve=>typeof ve=="number",hr=(ve,be="rgb",Ce,He)=>{let Xe=J(be),it=L(be),Dt=[],or=[],Dr={};ve.forEach(Oi=>{Array.isArray(Oi)?(Dt.push(it(Oi[0])),or.push(Oi[1])):Or(Oi)||sr(Oi)?Dr[or.length]=Oi:(Dt.push(it(Oi)),or.push(void 0))}),Ft(or);let vi=Xe.channels.reduce((Oi,Si)=>{let zi;return Fr(Ce)&&Fr(Ce[Si])&&Ce[Si].fixup?zi=Ce[Si].fixup:Fr(Xe.interpolate[Si])&&Xe.interpolate[Si].fixup?zi=Xe.interpolate[Si].fixup:zi=Vi=>Vi,Oi[Si]=zi(Dt.map(Vi=>Vi[Si])),Oi},{});if(He){let Oi=Dt.map((Si,zi)=>Xe.channels.reduce((Vi,Xi)=>(Vi[Xi]=vi[Xi][zi],Vi),{mode:be}));vi=Xe.channels.reduce((Si,zi)=>(Si[zi]=Oi.map(Vi=>{let Xi=He(Vi[zi],zi,Vi,be);return isNaN(Xi)?void 0:Xi}),Si),{})}let ai=Xe.channels.reduce((Oi,Si)=>{let zi;return sr(Ce)?zi=Ce:Fr(Ce)&&sr(Ce[Si])?zi=Ce[Si]:Fr(Ce)&&Fr(Ce[Si])&&Ce[Si].use?zi=Ce[Si].use:sr(Xe.interpolate[Si])?zi=Xe.interpolate[Si]:Fr(Xe.interpolate[Si])&&(zi=Xe.interpolate[Si].use),Oi[Si]=zi(vi[Si]),Oi},{}),ei=Dt.length-1;return Oi=>{if(Oi=Math.min(Math.max(0,Oi),1),Oi<=or[0])return Dt[0];if(Oi>or[ei])return Dt[ei];let Si=0;for(;or[Si]{let el=ai[xs]($a);return el!==void 0&&(_o[xs]=el),_o},{mode:be})}},wr=(ve,be="rgb",Ce)=>hr(ve,be,Ce),Cr=(ve,be)=>(Ce,He="rgb",Xe)=>{let it=be?Le(be,He):void 0,Dt=hr(Ce,He,Xe,ve);return it?or=>it(Dt(or)):Dt},Nr=Cr(Re,Ne),jr=(ve,be)=>(ve+be)%be,Ar=(ve,be,Ce,He,Xe)=>{let it=Xe*Xe,Dt=it*Xe;return((1-3*Xe+3*it-Dt)*ve+(4-6*it+3*Dt)*be+(1+3*Xe+3*it-3*Dt)*Ce+Dt*He)/6},Ci=ve=>be=>{let Ce=ve.length-1,He=be>=1?Ce-1:Math.max(0,Math.floor(be*Ce));return Ar(He>0?ve[He-1]:2*ve[He]-ve[He+1],ve[He],ve[He+1],Hebe=>{let Ce=ve.length-1,He=Math.floor(be*Ce);return Ar(ve[jr(He-1,ve.length)],ve[jr(He,ve.length)],ve[jr(He+1,ve.length)],ve[jr(He+2,ve.length)],(be-He/Ce)*Ce)},aa=ve=>{let be,Ce=ve.length-1,He=new Array(Ce),Xe=new Array(Ce),it=new Array(Ce);for(He[1]=1/4,Xe[1]=(6*ve[1]-ve[0])/4,be=2;be0&&(it[Ce-1]=Xe[Ce-1]),be=Ce-2;be>0;--be)it[be]=Xe[be]-He[be]*it[be+1];return it},ga=ve=>Ci(aa(ve)),qa=ve=>Gi(aa(ve)),Fa=Math.sign,Nn=Math.min,ka=Math.abs,Sn=ve=>{let be=ve.length-1,Ce=[],He=[],Xe=[];for(let it=0;it0?.5*(ve[it+1]-ve[it-1])*be:void 0),Xe.push(it>0?(Fa(Ce[it-1])+Fa(Ce[it]))*Nn(ka(Ce[it-1]),ka(Ce[it]),.5*ka(He[it])):void 0);return[Ce,He,Xe]},ko=(ve,be,Ce)=>{let He=ve.length-1,Xe=He*He;return it=>{let Dt;it>=1?Dt=He-1:Dt=Math.max(0,Math.floor(it*He));let or=it-Dt/He,Dr=or*or,vi=Dr*or;return(be[Dt]+be[Dt+1]-2*Ce[Dt])*Xe*vi+(3*Ce[Dt]-2*be[Dt]-be[Dt+1])*He*Dr+be[Dt]*or+ve[Dt]}},Vs=ve=>{if(ve.length<3)return Ke(ve);let be=ve.length-1,[Ce,,He]=Sn(ve);return He[0]=Ce[0],He[be]=Ce[be-1],ko(ve,He,Ce)},Ho=ve=>{if(ve.length<3)return Ke(ve);let be=ve.length-1,[Ce,He,Xe]=Sn(ve);return He[0]=(ve[1]*2-ve[0]*1.5-ve[2]*.5)*be,He[be]=(ve[be]*1.5-ve[be-1]*2+ve[be-2]*.5)*be,Xe[0]=He[0]*Ce[0]<=0?0:ka(He[0])>2*ka(Ce[0])?2*Ce[0]:He[0],Xe[be]=He[be]*Ce[be-1]<=0?0:ka(He[be])>2*ka(Ce[be-1])?2*Ce[be-1]:He[be],ko(ve,Xe,Ce)},fa=ve=>{let be=ve.length-1,[Ce,He,Xe]=Sn(ve);He[0]=.5*(ve[1]-ve[be])*be,He[be]=.5*(ve[0]-ve[be-1])*be;let it=(ve[0]-ve[be])*be,Dt=it;return Xe[0]=(Fa(it)+Fa(Ce[0]))*Nn(ka(it),ka(Ce[0]),.5*ka(He[0])),Xe[be]=(Fa(Ce[be-1])+Fa(Dt))*Nn(ka(Ce[be-1]),ka(Dt),.5*ka(He[be])),ko(ve,Xe,Ce)},jn=(ve=1)=>ve===1?be=>be:be=>Math.pow(be,ve),Gn=jn,Po=(ve=2,be=1)=>{let Ce=Gn(be);if(ve<2)return ve<1?[]:[Ce(.5)];let He=[];for(let Xe=0;Xe{let be={mode:ve.mode,r:Math.max(0,Math.min(ve.r!==void 0?ve.r:0,1)),g:Math.max(0,Math.min(ve.g!==void 0?ve.g:0,1)),b:Math.max(0,Math.min(ve.b!==void 0?ve.b:0,1))};return ve.alpha!==void 0&&(be.alpha=ve.alpha),be},Fl=ve=>Tl(Qs(ve)),su=ve=>ve!==void 0&&(ve.r===void 0||ve.r>=0&&ve.r<=1)&&(ve.g===void 0||ve.g>=0&&ve.g<=1)&&(ve.b===void 0||ve.b>=0&&ve.b<=1);function bt(ve){return su(Qs(ve))}function dr(ve="rgb"){let{gamut:be}=J(ve);if(!be)return He=>!0;let Ce=L(typeof be=="string"?be:ve);return He=>su(Ce(He))}function _r(ve){return ve=z(ve),ve===void 0||bt(ve)?ve:L(ve.mode)(Fl(ve))}function Kr(ve="rgb"){let{gamut:be}=J(ve);if(!be)return it=>z(it);let Ce=typeof be=="string"?be:ve,He=L(Ce),Xe=dr(Ce);return it=>{let Dt=z(it);if(!Dt)return;let or=He(Dt);if(Xe(or))return Dt;let Dr=Tl(or);return Dt.mode===Dr.mode?Dr:L(Dt.mode)(Dr)}}function ci(ve,be="lch",Ce="rgb"){ve=z(ve);let He=Ce==="rgb"?bt:dr(Ce),Xe=Ce==="rgb"?Fl:Kr(Ce);if(ve===void 0||He(ve))return ve;let it=L(ve.mode);ve=L(be)(ve);let Dt=ar(Ot({},ve),{c:0});if(!He(Dt))return it(Xe(Dt));let or=0,Dr=ve.c!==void 0?ve.c:0,vi=J(be).ranges.c,ai=(vi[1]-vi[0])/Math.pow(2,13),ei=Dt.c;for(;Dr-or>ai;)Dt.c=or+(Dr-or)*.5,He(Dt)?(ei=Dt.c,or=Dt.c):Dr=Dt.c;return it(He(Dt)?Dt:ar(Ot({},Dt),{c:ei}))}function yi(ve="rgb",be="oklch",Ce=pa("oklch"),He=.02){let Xe=L(ve),it=J(ve);if(!it.gamut)return ai=>Xe(ai);let Dt=dr(ve),or=Kr(ve),Dr=L(be),{ranges:vi}=J(be);if(!vi.l||!vi.c)throw new Error("LCH-like space expected");return ai=>{if(ai=z(ai),ai===void 0)return;let ei=Ot({},Dr(ai));if(ei.l===void 0&&(ei.l=0),ei.c===void 0&&(ei.c=0),ei.l>=vi.l[1]){let Xi=ar(Ot({},it.white),{mode:ve});return ai.alpha!==void 0&&(Xi.alpha=ai.alpha),Xi}if(ei.l<=vi.l[0]){let Xi=ar(Ot({},it.black),{mode:ve});return ai.alpha!==void 0&&(Xi.alpha=ai.alpha),Xi}if(Dt(ei))return Xe(ei);let Oi=0,Si=ei.c,zi=(vi.c[1]-vi.c[0])/4e3,Vi=or(ei);for(;Si-Oi>zi;)ei.c=(Oi+Si)*.5,Vi=or(ei),Dt(ei)||Ce&&He>0&&Ce(ei,Vi)<=He?Oi=ei.c:Si=ei.c;return Xe(Dt(ei)?ei:Vi)}}var si=(ve,be=pa(),Ce=He=>He)=>{let He=ve.map((Xe,it)=>({color:Ce(Xe),i:it}));return(Xe,it=1,Dt=1/0)=>(isFinite(it)&&(it=Math.max(1,Math.min(it,He.length-1))),He.forEach(or=>{or.d=be(Xe,or.color)}),He.sort((or,Dr)=>or.d-Dr.d).slice(0,it).filter(or=>or.dve[or.i]))},Ni=si,Ji=ve=>Math.max(ve,0),Qi=ve=>Math.max(Math.min(ve,1),0),ra=(ve,be,Ce)=>ve===void 0||be===void 0?void 0:ve+Ce*(be-ve),mn=ve=>{let be=1-Qi(ve);return[.393+.607*be,.769-.769*be,.189-.189*be,0,.349-.349*be,.686+.314*be,.168-.168*be,0,.272-.272*be,.534-.534*be,.131+.869*be,0,0,0,0,1]},Wa=ve=>{let be=Ji(ve);return[.213+.787*be,.715-.715*be,.072-.072*be,0,.213-.213*be,.715+.285*be,.072-.072*be,0,.213-.213*be,.715-.715*be,.072+.928*be,0,0,0,0,1]},xa=ve=>{let be=1-Qi(ve);return[.2126+.7874*be,.7152-.7152*be,.0722-.0722*be,0,.2126-.2126*be,.7152+.2848*be,.0722-.0722*be,0,.2126-.2126*be,.7152-.7152*be,.0722+.9278*be,0,0,0,0,1]},Pi=ve=>{let be=Math.PI*ve/180,Ce=Math.cos(be),He=Math.sin(be);return[.213+Ce*.787-He*.213,.715-Ce*.715-He*.715,.072-Ce*.072+He*.928,0,.213-Ce*.213+He*.143,.715+Ce*.285+He*.14,.072-Ce*.072-He*.283,0,.213-Ce*.213-He*.787,.715-Ce*.715+He*.715,.072+Ce*.928+He*.072,0,0,0,0,1]},Hr=(ve,be,Ce=!1)=>{let He=L(be),Xe=J(be).channels;return it=>{let Dt=He(it);if(!Dt)return;let or={mode:be},Dr,vi=Xe.length;for(let ei=0;ei{let Ce=Ji(ve);return Le(ut(Ce),be,!0)},Yi=(ve=1,be="rgb")=>{let Ce=Ji(ve);return Le(ut(Ce,(1-Ce)/2),be,!0)},la=(ve=1,be="rgb")=>Hr(mn(ve),be,!0),Ui=(ve=1,be="rgb")=>Hr(Wa(ve),be,!0),Da=(ve=1,be="rgb")=>Hr(xa(ve),be,!0),wa=(ve=1,be="rgb")=>{let Ce=Qi(ve);return Le((He,Xe)=>Xe==="alpha"?He:ra(Ce,1-Ce,He),be,!0)},bn=(ve=0,be="rgb")=>Hr(Pi(ve),be,!0),ji=L("rgb"),Ii=[[1,0,-0,0,1,0,-0,-0,1],[.856167,.182038,-.038205,.029342,.955115,.015544,-.00288,-.001563,1.004443],[.734766,.334872,-.069637,.05184,.919198,.028963,-.004928,-.004209,1.009137],[.630323,.465641,-.095964,.069181,.890046,.040773,-.006308,-.007724,1.014032],[.539009,.579343,-.118352,.082546,.866121,.051332,-.007136,-.011959,1.019095],[.458064,.679578,-.137642,.092785,.846313,.060902,-.007494,-.016807,1.024301],[.38545,.769005,-.154455,.100526,.829802,.069673,-.007442,-.02219,1.029632],[.319627,.849633,-.169261,.106241,.815969,.07779,-.007025,-.028051,1.035076],[.259411,.923008,-.18242,.110296,.80434,.085364,-.006276,-.034346,1.040622],[.203876,.990338,-.194214,.112975,.794542,.092483,-.005222,-.041043,1.046265],[.152286,1.052583,-.204868,.114503,.786281,.099216,-.003882,-.048116,1.051998]],Va=[[1,0,-0,0,1,0,-0,-0,1],[.866435,.177704,-.044139,.049567,.939063,.01137,-.003453,.007233,.99622],[.760729,.319078,-.079807,.090568,.889315,.020117,-.006027,.013325,.992702],[.675425,.43385,-.109275,.125303,.847755,.026942,-.00795,.018572,.989378],[.605511,.52856,-.134071,.155318,.812366,.032316,-.009376,.023176,.9862],[.547494,.607765,-.155259,.181692,.781742,.036566,-.01041,.027275,.983136],[.498864,.674741,-.173604,.205199,.754872,.039929,-.011131,.030969,.980162],[.457771,.731899,-.18967,.226409,.731012,.042579,-.011595,.034333,.977261],[.422823,.781057,-.203881,.245752,.709602,.044646,-.011843,.037423,.974421],[.392952,.82361,-.216562,.263559,.69021,.046232,-.01191,.040281,.97163],[.367322,.860646,-.227968,.280085,.672501,.047413,-.01182,.04294,.968881]],_a=[[1,0,-0,0,1,0,-0,-0,1],[.92667,.092514,-.019184,.021191,.964503,.014306,.008437,.054813,.93675],[.89572,.13333,-.02905,.029997,.9454,.024603,.013027,.104707,.882266],[.905871,.127791,-.033662,.026856,.941251,.031893,.01341,.148296,.838294],[.948035,.08949,-.037526,.014364,.946792,.038844,.010853,.193991,.795156],[1.017277,.027029,-.044306,-.006113,.958479,.047634,.006379,.248708,.744913],[1.104996,-.046633,-.058363,-.032137,.971635,.060503,.001336,.317922,.680742],[1.193214,-.109812,-.083402,-.058496,.97941,.079086,-.002346,.403492,.598854],[1.257728,-.139648,-.118081,-.078003,.975409,.102594,-.003316,.501214,.502102],[1.278864,-.125333,-.153531,-.084748,.957674,.127074,-989e-6,.601151,.399838],[1.255528,-.076749,-.178779,-.078411,.930809,.147602,.004733,.691367,.3039]],ca=(ve,be)=>{let Ce=Math.max(0,Math.min(1,be)),He=Math.round(Ce/.1),Xe=Math.round(Ce%.1),it=ve[He];if(Xe>0&&Hege(it[Dr],Dt[Dr],Xe))}return Dt=>{let or=z(Dt);if(or===void 0)return;let{r:Dr,g:vi,b:ai}=ji(or),ei={mode:"rgb",r:it[0]*Dr+it[1]*vi+it[2]*ai,g:it[3]*Dr+it[4]*vi+it[5]*ai,b:it[6]*Dr+it[7]*vi+it[8]*ai};return or.alpha!==void 0&&(ei.alpha=or.alpha),L(or.mode)(ei)}},va=(ve=1)=>ca(Ii,ve),Ga=(ve=1)=>ca(Va,ve),wn=(ve=1)=>ca(_a,ve),Hn=ve=>ve*ve*(3-2*ve),Ca=ve=>.5-Math.sin(Math.asin(1-2*ve)/3),en=ve=>ve*ve*ve*(ve*(ve*6-15)+10),Un=en,qn=ve=>(1-Math.cos(ve*Math.PI))/2,yo=qn;function Gs(ve){let be=L("lrgb")(ve);return .2126*be.r+.7152*be.g+.0722*be.b}function Wl(ve,be){let Ce=Gs(ve),He=Gs(be);return(Math.max(Ce,He)+.05)/(Math.min(Ce,He)+.05)}var Co=Z(ht),Rc=Z(Yt),ys=Z(ho),Hu=Z(lo),lc=Z(jo),zc=Z(nl),Pl=Z(On),Il=Z(yu),Yl=Z(Th),oo=Z(Bu),lu=Z(Ou),Ms=Z(ql),uc=Z(Nd),Bc=Z(Wc),Oc=Z(bf),Zn=Z(ou),Bo=Z(Lh),Bs=Z(Af),gr=Z(rn),hi=Z(Dn),di=Z($o),sn=Z(Go),Io=Z(bu),_s=Z(Qf),an=Z(Qc),cr=Z(Pt),xr=Z(st),kr=Z(pt),fi=Z(Sr),Ti=Z(un)}}),Na=de({"src/plot_api/plot_config.js"(e,r){"use strict";var t={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:"https://cloud.plotly.com/newchart"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:500,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},displayNotifier:{valType:"boolean",dflt:!0},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!0},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},i={};function a(o,s){for(var l in o){var n=o[l];n.valType?s[l]=n.dflt:(s[l]||(s[l]={}),a(n,s[l]))}}a(t,i),r.exports={configAttributes:t,dfltConfig:i}}}),xn=de({"src/lib/notifier.js"(e,r){"use strict";var t=Yr(),i=da(),a=[];r.exports=function(o,s,l){var n;if(((n=l?._context)==null?void 0:n.displayNotifier)===!1||a.indexOf(o)!==-1)return;a.push(o);var u=1e3;i(s)?u=s:s==="long"&&(u=3e3);var c=t.select("body").selectAll(".plotly-notifier").data([0]);c.enter().append("div").classed("plotly-notifier",!0);var f=c.selectAll(".notifier-note").data(a);function h(d){d.duration(700).style("opacity",0).each("end",function(p){var g=a.indexOf(p);g!==-1&&a.splice(g,1),t.select(this).remove()})}f.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(d){var p=t.select(this);p.append("button").classed("notifier-close",!0).html("×").on("click",function(){p.transition().call(h)});for(var g=p.append("p"),m=d.split(//g),y=0;y1){var s=["LOG:"];for(o=0;o1){var l=[];for(o=0;o"),"long")}},a.warn=function(){var o;if(t.logging>0){var s=["WARN:"];for(o=0;o0){var l=[];for(o=0;o"),"stick")}},a.error=function(){var o;if(t.logging>0){var s=["ERROR:"];for(o=0;o0){var l=[];for(o=0;o"),"stick")}}}}),Jo=de({"src/components/color/attributes.js"(e){"use strict";e.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],e.defaultLine="#444",e.lightLine="#eee",e.background="#fff",e.borderLine="#BEC8D9",e.lightFraction=1e3/11}}),ta=de({"src/components/color/index.js"(e,r){"use strict";var{converter:t,formatHex:i,formatRgb:a,wcagContrast:o,wcagLuminance:s}=Ri(),{isArrayOrTypedArray:l}=Do(),{warn:n}=Xo(),{background:u,defaultLine:c,defaults:f,lightLine:h}=Jo(),d=t("rgb"),p=t("hsl"),g=q=>{if(typeof q!="string")return;let Y=q.trim().toLowerCase();if(!/^[0-9a-f]+$/.test(Y))try{return d(Y)}catch{return}},m=q=>q>0?q>1?1:q:0,y={mode:"rgb",r:0,g:0,b:0,alpha:1},_=q=>Math.round(q*255e6)/255e6,v=q=>ar(Ot({},q),{r:_(q.r),g:_(q.g),b:_(q.b)}),x=q=>a(v(q)),S=q=>i(v(q)),M=q=>{var Y,K,te,ne;return typeof q=="string"?`"${q}"`:l(q)?`${(K=(Y=q.constructor)==null?void 0:Y.name)!=null?K:"Array"}(${q.length})`:typeof q=="object"?(ne=(te=q.constructor)==null?void 0:te.name)!=null?ne:"Object":`${typeof q} ${q}`},C=(q,Y)=>{var K;let te=g(q);return te?((K=te.alpha)!=null||(te.alpha=1),te):(!Y&&q!=null&&n(`Invalid color specifier: ${M(q)}. Defaulting to "#000"`),y)},w=q=>x(ar(Ot({},C(q)),{alpha:1})),k=q=>q?C(q).alpha:0,A=q=>l(q)&&q.length>2&&Number.isFinite(q[0])&&Number.isFinite(q[1])&&Number.isFinite(q[2]),b=q=>{let[Y,K,te,ne]=q,se=Math.max(Y,K,te)>1?1/255:1,le=ne??1;return{mode:"rgb",r:Y*se,g:K*se,b:te*se,alpha:le>1?le/255:le}},E=(q,Y)=>{let K=A(q)?b(q):C(q,!0),te=[m(K.r),m(K.g),m(K.b),m(K.alpha)];return Y==="uint8"||Y==="uint8_clamped"?Uint8Array.from(te,ne=>Math.round(ne*255)):Y==="float32"?Float32Array.from(te):Y==="float64"?Float64Array.from(te):te},T=(q,Y)=>x(ar(Ot({},C(q)),{alpha:m(Y)})),F=(q,Y)=>{let K=C(q),te=K.alpha;if(te===1)return x(K);let ne=C(Y||u),se=ne.alpha,le=(ce,pe)=>(se===1?pe:1-se+pe*se)*(1-te)+ce*te;return x({mode:"rgb",r:le(K.r,ne.r),g:le(K.g,ne.g),b:le(K.b,ne.b)})},D=(q,Y,K)=>{let te=C(q),ne=C(Y),se=(le,ce)=>K*le+(1-K)*ce;return x({mode:"rgb",r:se(te.r,ne.r),g:se(te.g,ne.g),b:se(te.b,ne.b)})},R=(q,Y)=>{let K=C(q),te=p(K)||{mode:"hsl",h:0,s:0,l:0};return x(d(ar(Ot({},te),{l:m((te.l*100+Y)/100),alpha:K.alpha})))},P=(q,Y)=>o(C(q),C(Y)),z=q=>P(q,u)>P(q,c),I=x(C(u)),L=x(C(c)),B=(q,Y,K)=>(C(q).alpha!==1&&(q=F(q,u)),z(q)?Y?R(q,Y):I:K?R(q,-K):L),O=(q,Y)=>{q.style({stroke:w(Y),"stroke-opacity":C(Y).alpha})},G=(q,Y)=>{q.style({fill:w(Y),"fill-opacity":C(Y).alpha})},W=(q,Y)=>!!(q&&Y&&w(q)===w(Y)),X=q=>g(q)!==void 0,Z=(q,Y)=>{Y=Y===0?0:Y||10;let K=C(q),te=Y/100;return x(ar(Ot({},K),{r:m(K.r+te),g:m(K.g+te),b:m(K.b+te)}))},J=(q,Y,K)=>{let te=C(q),ne=C(Y),se=K/100,le=ne.alpha-te.alpha,ce=2*se-1,pe=((ce*le===-1?ce:(ce+le)/(1+ce*le))+1)/2,xe=1-pe,ye=(fe,ae)=>xe*fe+pe*ae;return x({mode:"rgb",r:ye(te.r,ne.r),g:ye(te.g,ne.g),b:ye(te.b,ne.b),alpha:te.alpha*(1-se)+ne.alpha*se})},N=(q,Y=["#000","#fff"])=>{let K,te=-1/0;for(let ne of Y){let se=P(q,ne);se>te&&(te=se,K=x(C(ne)))}return K},H=q=>x(C(q)),$=q=>S(C(q)).toUpperCase(),U=q=>{let Y=C(q);return[m(Y.r)*255,m(Y.g)*255,m(Y.b)*255,m(Y.alpha)]},V=([q,Y,K,te])=>x({mode:"rgb",r:q/255,g:Y/255,b:K/255,alpha:te}),j=q=>{let Y=C(q);return s({mode:"rgb",r:m(Y.r),g:m(Y.g),b:m(Y.b)})};r.exports={addOpacity:T,adjustLightness:R,background:u,brighten:Z,combine:F,contrast:B,defaultLine:c,defaults:f,equals:W,fill:G,hexString:$,interpolate:D,isChannelArray:A,isDark:z,isValid:X,lightLine:h,luminosity:j,mix:J,mostReadable:N,normalize:E,opacity:k,parse:C,rgb:w,rgbaArray:U,rgbaArrayToString:V,rgbaString:H,stroke:O,wcagContrast:P}}}),vv=de({"src/components/colorscale/scales.js"(e,r){"use strict";var t=ta(),i={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},a=i.RdBu;function o(n,u){if(u||(u=a),!n)return u;function c(){try{n=i[n]||JSON.parse(n)}catch{n=u}}return typeof n=="string"&&(c(),typeof n=="string"&&c()),s(n)?n:u}function s(n){var u=0;if(!Array.isArray(n)||n.length<2||!n[0]||!n[n.length-1]||+n[0][0]!=0||+n[n.length-1][0]!=1)return!1;for(var c=0;cpU});function pU(e,r="",t,i){let a=r+(t?"":"$"),o=i===!1?"":"^";return e==="xy"?new RegExp(o+"x"+wy+"y"+wy+a):new RegExp(o+e+wy+a)}var wy,s1=Ir({"src/lib/regex.ts"(){"use strict";wy="([2-9]|[1-9][0-9]+)?"}}),vU=de({"src/lib/coerce.js"(e){"use strict";var r=da(),t=fn().extendFlat,i=ri(),a=vv(),o=ta(),s=Ap().DESELECTDIM,l=sl(),n=(s1(),ti(mv)).counter,u=(u0(),ti(Tp)).modHalf,c=Do().isArrayOrTypedArray,f=Do().isTypedArraySpec,h=Do().decodeTypedArraySpec;e.valObjectMeta={data_array:{coerceFunction:function(p,g,m){g.set(c(p)?p:f(p)?h(p):m)}},enumerated:{coerceFunction:function(p,g,m,y){y.coerceNumber&&(p=+p),y.values.indexOf(p)===-1?g.set(m):g.set(p)},validateFunction:function(p,g){g.coerceNumber&&(p=+p);for(var m=g.values,y=0;yv===!0||v===!1;_(p)||y.arrayOk&&Array.isArray(p)&&p.length>0&&p.every(_)?g.set(p):g.set(m)}},number:{coerceFunction:function(p,g,m,y){f(p)&&(p=h(p)),!r(p)||y.min!==void 0&&py.max?g.set(m):g.set(+p)}},integer:{coerceFunction:function(p,g,m,y){if((y.extras||[]).indexOf(p)!==-1){g.set(p);return}f(p)&&(p=h(p)),p%1||!r(p)||y.min!==void 0&&py.max?g.set(m):g.set(+p)}},string:{coerceFunction:function(p,g,m,y){if(typeof p!="string"){var _=typeof p=="number";y.strict===!0||!_?g.set(m):g.set(String(p))}else y.noBlank&&!p?g.set(m):g.set(p)}},color:{coerceFunction:function(p,g,m){f(p)&&(p=h(p)),o.isValid(p)?g.set(p):g.set(m)}},colorlist:{coerceFunction:function(p,g,m){!Array.isArray(p)||!p.length?g.set(m):p.every(y=>o.isValid(y))?g.set(p):g.set(m)}},colorscale:{coerceFunction:function(p,g,m){g.set(a.get(p,m))}},angle:{coerceFunction:function(p,g,m){f(p)&&(p=h(p)),p==="auto"?g.set("auto"):r(p)?g.set(u(+p,360)):g.set(m)}},subplotid:{coerceFunction:function(p,g,m,y){var _=y.regex||n(m);let v=x=>typeof x=="string"&&_.test(x);v(p)||y.arrayOk&&c(p)&&p.length>0&&p.every(v)?g.set(p):g.set(m)},validateFunction:function(p,g){var m=g.dflt;return p===m?!0:typeof p!="string"?!1:!!n(m).test(p)}},flaglist:{coerceFunction:function(p,g,m,y){if((y.extras||[]).indexOf(p)!==-1){g.set(p);return}if(typeof p!="string"){g.set(m);return}for(var _=p.split("+"),v=0;v<_.length;){var x=_[v];y.flags.indexOf(x)===-1||_.indexOf(x)Ot({valType:"string",dflt:"",editType:o},s!==!1?{arrayOk:!0}:{}),e.texttemplateAttrs=({editType:o="calc",arrayOk:s}={},l={})=>Ot({valType:"string",dflt:"",editType:o},s!==!1?{arrayOk:!0}:{}),e.shapeTexttemplateAttrs=({editType:o="arraydraw",newshape:s}={},l={})=>({valType:"string",dflt:"",editType:o}),e.templatefallbackAttrs=({editType:o="none"}={})=>({valType:"any",dflt:"-",editType:o})}}),_w=de({"src/components/shapes/label_texttemplate.js"(e,r){"use strict";function t(M,C){return C?C.d2l(M):M}function i(M,C){return C?C.l2d(M):M}function a(M){return M.x0}function o(M){return M.x1}function s(M){return M.y0}function l(M){return M.y1}function n(M){return M.x0shift||0}function u(M){return M.x1shift||0}function c(M){return M.y0shift||0}function f(M){return M.y1shift||0}function h(M,C){return t(M.x1,C)+u(M)-t(M.x0,C)-n(M)}function d(M,C,w){return t(M.y1,w)+f(M)-t(M.y0,w)-c(M)}function p(M,C){return Math.abs(h(M,C))}function g(M,C,w){return Math.abs(d(M,C,w))}function m(M,C,w){return M.type!=="line"?void 0:Math.sqrt(Math.pow(h(M,C),2)+Math.pow(d(M,C,w),2))}function y(M,C){return i((t(M.x1,C)+u(M)+t(M.x0,C)+n(M))/2,C)}function _(M,C,w){return i((t(M.y1,w)+f(M)+t(M.y0,w)+c(M))/2,w)}function v(M,C,w){return M.type!=="line"?void 0:d(M,C,w)/h(M,C)}var x=["x0","x1","y0","y1","dy","height","ycenter"],S=["x0","x1","y0","y1","dx","width","xcenter"];r.exports={x0:a,x1:o,y0:s,y1:l,slope:v,dx:h,dy:d,width:p,height:g,length:m,xcenter:y,ycenter:_,simpleXVariables:x,simpleYVariables:S}}}),GU=de({"src/components/shapes/draw_newshape/attributes.js"(e,r){"use strict";var t=Ps().overrideAll,i=ri(),a=us(),o=fu().dash,s=fn().extendFlat,{shapeTexttemplateAttrs:l,templatefallbackAttrs:n}=Vo(),u=_w();r.exports=t({newshape:{visible:s({},i.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:s({},i.legend,{}),legendgroup:s({},i.legendgroup,{}),legendgrouptitle:{text:s({},i.legendgrouptitle.text,{}),font:a({})},legendrank:s({},i.legendrank,{}),legendwidth:s({},i.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:s({},o,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:s({},i.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:l({newshape:!0},{keys:Object.keys(u)}),texttemplatefallback:n({editType:"arraydraw"}),font:a({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),HU=de({"src/components/selections/draw_newselection/attributes.js"(e,r){"use strict";var t=fu().dash,i=fn().extendFlat;r.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},t,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),xw=de({"src/plots/pad_attributes.js"(e,r){"use strict";r.exports=function(t){var i=t.editType;return{t:{valType:"number",dflt:0,editType:i},r:{valType:"number",dflt:0,editType:i},b:{valType:"number",dflt:0,editType:i},l:{valType:"number",dflt:0,editType:i},editType:i}}}}),l1=de({"src/plots/layout_attributes.js"(e,r){"use strict";var t=us(),i=Ay(),a=Jo(),o=GU(),s=HU(),l=xw(),n=fn().extendFlat,u=t({editType:"calc"});u.family.dflt='"Open Sans", verdana, arial, sans-serif',u.size.dflt=12,u.color.dflt=a.defaultLine,r.exports={font:u,title:{text:{valType:"string",editType:"layoutstyle"},font:t({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:t({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:n(l({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:a.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:a.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:a.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:o.newshape,activeshape:o.activeshape,newselection:s.newselection,activeselection:s.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:n({},i.transition,{editType:"none"})}}}),$U=de({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("9f215cf04c5486422605d13261cb87401f4e7763b6296af81e98efbc0130da53")){var e=document.createElement("style");e.id="9f215cf04c5486422605d13261cb87401f4e7763b6296af81e98efbc0130da53",e.textContent='.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media (hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22none%22%20stroke%3D%22%23333%22%20viewBox%3D%220%200%2022%2022%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M17.5%2011c0%204.819-3.02%208.5-6.5%208.5S4.5%2015.819%204.5%2011%207.52%202.5%2011%202.5s6.5%203.681%206.5%208.5Z%22%2F%3E%3Cpath%20d%3D%22M13.5%2011c0%202.447-.331%204.64-.853%206.206-.262.785-.562%201.384-.872%201.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831%2015.64%208.5%2013.446%208.5%2011s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872%201.777.522%201.565.853%203.76.853%206.206Z%22%2F%3E%3Cpath%20d%3D%22M11%207.5c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138q.07-.058.224-.138c.299-.151.763-.302%201.379-.434C7.378%205.666%209.091%205.5%2011%205.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0%209c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138%201.3%201.3%200%200%201%20.224-.138c.299-.151.763-.302%201.379-.434C7.378%2014.666%209.091%2014.5%2011%2014.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138a1.3%201.3%200%200%201-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0-4c-2.46%200-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5%201.5%200%200%201-.39-.272.3.3%200%200%201-.047-.064.3.3%200%200%201%20.048-.064c.066-.073.189-.167.389-.272.399-.21%201.009-.413%201.805-.59C6.328%209.722%208.54%209.5%2011%209.5s4.672.222%206.256.574c.795.177%201.405.38%201.804.59.2.105.323.2.39.272a.3.3%200%200%201%20.047.064.3.3%200%200%201-.048.064%201.4%201.4%200%200%201-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0%20.018v.002zm17.002.002v-.002zm0-.018v-.002z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22none%22%20stroke%3D%22%2333b5e5%22%20viewBox%3D%220%200%2022%2022%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M17.5%2011c0%204.819-3.02%208.5-6.5%208.5S4.5%2015.819%204.5%2011%207.52%202.5%2011%202.5s6.5%203.681%206.5%208.5Z%22%2F%3E%3Cpath%20d%3D%22M13.5%2011c0%202.447-.331%204.64-.853%206.206-.262.785-.562%201.384-.872%201.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831%2015.64%208.5%2013.446%208.5%2011s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872%201.777.522%201.565.853%203.76.853%206.206Z%22%2F%3E%3Cpath%20d%3D%22M11%207.5c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138q.07-.058.224-.138c.299-.151.763-.302%201.379-.434C7.378%205.666%209.091%205.5%2011%205.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0%209c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138%201.3%201.3%200%200%201%20.224-.138c.299-.151.763-.302%201.379-.434C7.378%2014.666%209.091%2014.5%2011%2014.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138a1.3%201.3%200%200%201-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0-4c-2.46%200-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5%201.5%200%200%201-.39-.272.3.3%200%200%201-.047-.064.3.3%200%200%201%20.048-.064c.066-.073.189-.167.389-.272.399-.21%201.009-.413%201.805-.59C6.328%209.722%208.54%209.5%2011%209.5s4.672.222%206.256.574c.795.177%201.405.38%201.804.59.2.105.323.2.39.272a.3.3%200%200%201%20.047.064.3.3%200%200%201-.048.064%201.4%201.4%200%200%201-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0%20.018v.002zm17.002.002v-.002zm0-.018v-.002z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cpath%20d%3D%22m1.754%2013.406%204.453-4.851%203.09%203.09%203.281%203.277.969-.969-3.309-3.312%203.844-4.121%206.148%206.886h1.082v-.855l-7.207-8.07-4.84%205.187L6.169%206.57l-5.48%205.965v.871ZM.688%2016.844h20.625v1.375H.688Zm0%200%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cpath%20d%3D%22m1.754%2013.406%204.453-4.851%203.09%203.09%203.281%203.277.969-.969-3.309-3.312%203.844-4.121%206.148%206.886h1.082v-.855l-7.207-8.07-4.84%205.187L6.169%206.57l-5.48%205.965v.871ZM.688%2016.844h20.625v1.375H.688Zm0%200%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23aaa%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e58978%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e54e33%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23999%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e58978%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e54e33%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23666%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@media (prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:rgba(0,0,0,.4);position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}',document.head.appendChild(e)}})()}}),Ma=de({"src/registry.js"(e){"use strict";var r=Xo(),t=gw(),i=fE(),a=Ty().addStyleRule,o=fn(),s=ri(),l=l1(),n=o.extendFlat,u=o.extendDeepAll;e.modules={},e.allCategories={},e.allTypes=[],e.subplotsRegistry={},e.componentsRegistry={},e.layoutArrayContainers=[],e.layoutArrayRegexes=[],e.traceLayoutAttributes={},e.localeRegistry={},e.apiMethodRegistry={},e.collectableSubplotTypes=null,e.register=function(v){if(e.collectableSubplotTypes=null,v)v&&!Array.isArray(v)&&(v=[v]);else throw new Error("No argument passed to Plotly.register.");for(var x=0;x=v&&P<=x?P:s}if(typeof P!="string"&&typeof P!="number")return s;P=String(P);var O=y(z),G=P.charAt(0);O&&(G==="G"||G==="g")&&(P=P.slice(1),z="");var W=O&&z.slice(0,7)==="chinese",X=P.match(W?g:p);if(!X)return s;var Z=X[1],J=X[3]||"1",N=Number(X[5]||1),H=Number(X[7]||0),$=Number(X[9]||0),U=Number(X[11]||0);if(O){if(Z.length===2)return s;Z=Number(Z);var V;try{var j=h.getComponentMethod("calendars","getCal")(z);if(W){var q=J.charAt(J.length-1)==="i";J=parseInt(J,10),V=j.newDate(Z,j.toMonthIndex(Z,J,q),N)}else V=j.newDate(Z,Number(J),N)}catch{return s}return V?(V.toJD()-f)*l+H*n+$*u+U*c:s}Z.length===2?Z=(Number(Z)+2e3-m)%100+m:Z=Number(Z),J-=1;var Y=new Date(Date.UTC(2e3,J,N,H,$));return Y.setUTCFullYear(Z),Y.getUTCMonth()!==J||Y.getUTCDate()!==N?s:Y.getTime()+U*c},v=e.MIN_MS=e.dateTime2ms("-9999"),x=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(P,z){return e.dateTime2ms(P,z)!==s};function S(P,z){return String(P+Math.pow(10,z)).slice(1)}var M=90*l,C=3*n,w=5*u;e.ms2DateTime=function(P,z,I){if(typeof P!="number"||!(P>=v&&P<=x))return s;z||(z=0);var L=Math.floor(a(P+.05,1)*10),B=Math.round(P-L/10),O,G,W,X,Z,J;if(y(I)){var N=Math.floor(B/l)+f,H=Math.floor(a(P,l));try{O=h.getComponentMethod("calendars","getCal")(I).fromJD(N).formatDate("yyyy-mm-dd")}catch{O=d("G%Y-%m-%d")(new Date(B))}if(O.charAt(0)==="-")for(;O.length<11;)O="-0"+O.slice(1);else for(;O.length<10;)O="0"+O;G=z=v+l&&P<=x-l))return s;var z=Math.floor(a(P+.05,1)*10),I=new Date(Math.round(P-z/10)),L=r("%Y-%m-%d")(I),B=I.getHours(),O=I.getMinutes(),G=I.getSeconds(),W=I.getUTCMilliseconds()*10+z;return k(L,B,O,G,W)};function k(P,z,I,L,B){if((z||I||L||B)&&(P+=" "+S(z,2)+":"+S(I,2),(L||B)&&(P+=":"+S(L,2),B))){for(var O=4;B%10===0;)O-=1,B/=10;P+="."+S(B,O)}return P}e.cleanDate=function(P,z,I){if(P===s)return z;if(e.isJSDate(P)||typeof P=="number"&&isFinite(P)){if(y(I))return i.error("JS Dates and milliseconds are incompatible with world calendars",P),z;if(P=e.ms2DateTimeLocal(+P),!P&&z!==void 0)return z}else if(!e.isDateTime(P,I))return i.error("unrecognized date",P),z;return P};var A=/%\d?f/g,b=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function T(P,z,I,L){P=P.replace(A,function(O){var G=Math.min(+O.charAt(1)||6,6),W=(z/1e3%1+2).toFixed(G).slice(2).replace(/0+$/,"")||"0";return W});var B=new Date(Math.floor(z+.05));if(P=P.replace(b,function(){return E[I("%q")(B)]}),y(L))try{P=h.getComponentMethod("calendars","worldCalFmt")(P,z,L)}catch{return"Invalid"}return I(P)(B)}var F=[59,59.9,59.99,59.999,59.9999];function D(P,z){var I=a(P+.05,l),L=S(Math.floor(I/n),2)+":"+S(a(Math.floor(I/u),60),2);if(z!=="M"){t(z)||(z=0);var B=Math.min(a(P/c,60),F[z]),O=(100+B).toFixed(z).slice(1);z>0&&(O=O.replace(/0+$/,"").replace(/[\.]$/,"")),L+=":"+O}return L}e.formatDate=function(P,z,I,L,B,O){if(B=y(B)&&B,!z)if(I==="y")z=O.year;else if(I==="m")z=O.month;else if(I==="d")z=O.dayMonth+` +`||be[j]===" "||be[j]===" ");)j++;let Xe;if(q(be)&&(Xe=te(be),Xe.type!==V.Hue)){Ce.push({type:V.Alpha,value:Xe});continue}if(Y(be)&&se(be)==="none"){Ce.push({type:V.Alpha,value:{type:V.None,value:void 0}});continue}return}if(/\d/.test(He)){j--,Ce.push(te(be));continue}if($.test(He)){j--,Ce.push(le(be));continue}return}return Ce}function pe(ve){ve._i=0;let be=ve[ve._i++];if(!be||be.type!==V.Function||be.value!=="color"||(be=ve[ve._i++],be.type!==V.Ident))return;let Ce=W[be.value];if(!Ce)return;let He={mode:Ce},Xe=xe(ve,!1);if(!Xe)return;let it=J(Ce).channels;for(let Dt=0,or,Dr;Dt4)){if(Ce.length===4){if(Ce[3].type!==V.Alpha)return;Ce[3]=Ce[3].value}return Ce.length===3&&Ce.push({type:V.None,value:void 0}),Ce.every(Xe=>Xe.type!==V.Alpha)?Ce:void 0}}function ye(ve,be){ve._i=0;let Ce=ve[ve._i++];if(!Ce||Ce.type!==V.Function)return;let He=xe(ve,be);if(He)return He.unshift(Ce.value),He}var fe=ve=>{if(typeof ve!="string")return;let be=ce(ve),Ce=be?ye(be,!0):void 0,He,Xe=0,it=G.length;for(;Xeve==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,ue=Q,ge=(ve,be,Ce)=>ve+Ce*(be-ve),Me=(ve,be,Ce)=>(Ce-ve)/(be-ve),Te=(ve,be,Ce,He,Xe,it)=>ge(ge(ve,be,Xe),ge(Ce,He,Xe),it),je=(ve,be,Ce,He,Xe,it,Dt,or,Dr,vi,ai)=>ge(Te(ve,be,Ce,He,Dr,vi),Te(Xe,it,Dt,or,Dr,vi),ai),Ve=ve=>{let be=[];for(let Ce=0;Cebe=>{let Ce=Ve(be);return He=>{let Xe=He*Ce.length,it=He>=1?Ce.length-1:Math.max(Math.floor(Xe),0),Dt=Ce[it];return Dt===void 0?void 0:ve(Dt[0],Dt[1],Xe-it)}},Je=Ke(ge),vt=ve=>{let be=!1,Ce=ve.map(He=>He!==void 0?(be=!0,He):1);return be?Ce:ve},xt={mode:"rgb",channels:["r","g","b","alpha"],parse:[ie,_,R,g,ue,"srgb"],serialize:"srgb",interpolate:{r:Je,g:Je,b:Je,alpha:{use:Je,fixup:vt}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},Pt=xt,mt=(ve=0)=>Math.pow(Math.abs(ve),563/256)*Math.sign(ve),Mt=ve=>{let be=mt(ve.r),Ce=mt(ve.g),He=mt(ve.b),Xe={mode:"xyz65",x:.5766690429101305*be+.1855582379065463*Ce+.1882286462349947*He,y:.297344975250536*be+.6273635662554661*Ce+.0752914584939979*He,z:.0270313613864123*be+.0706888525358272*Ce+.9913375368376386*He};return ve.alpha!==void 0&&(Xe.alpha=ve.alpha),Xe},lt=Mt,qe=ve=>Math.pow(Math.abs(ve),256/563)*Math.sign(ve),Ye=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"a98",r:qe(ve*2.0415879038107465-be*.5650069742788597-.3447313507783297*Ce),g:qe(ve*-.9692436362808798+be*1.8759675015077206+.0415550574071756*Ce),b:qe(ve*.0134442806320312-be*.1183623922310184+1.0151749943912058*Ce)};return He!==void 0&&(Xe.alpha=He),Xe},me=Ye,_e=(ve=0)=>{let be=Math.abs(ve);return be<=.04045?ve/12.92:(Math.sign(ve)||1)*Math.pow((be+.055)/1.055,2.4)},Ae=({r:ve,g:be,b:Ce,alpha:He})=>{let Xe={mode:"lrgb",r:_e(ve),g:_e(be),b:_e(Ce)};return He!==void 0&&(Xe.alpha=He),Xe},ke=Ae,Ee=ve=>{let{r:be,g:Ce,b:He,alpha:Xe}=ke(ve),it={mode:"xyz65",x:.4123907992659593*be+.357584339383878*Ce+.1804807884018343*He,y:.2126390058715102*be+.715168678767756*Ce+.0721923153607337*He,z:.0193308187155918*be+.119194779794626*Ce+.9505321522496607*He};return Xe!==void 0&&(it.alpha=Xe),it},De=Ee,Qe=(ve=0)=>{let be=Math.abs(ve);return be>.0031308?(Math.sign(ve)||1)*(1.055*Math.pow(be,1/2.4)-.055):ve*12.92},Ue=({r:ve,g:be,b:Ce,alpha:He},Xe="rgb")=>{let it={mode:Xe,r:Qe(ve),g:Qe(be),b:Qe(Ce)};return He!==void 0&&(it.alpha=He),it},at=Ue,rt=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=at({r:ve*3.2409699419045226-be*1.537383177570094-.4986107602930034*Ce,g:ve*-.9692436362808796+be*1.8759675015077204+.0415550574071756*Ce,b:ve*.0556300796969936-be*.2039769588889765+1.0569715142428784*Ce});return He!==void 0&&(Xe.alpha=He),Xe},ht=rt,At=ar(Nt({},Pt),{mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:ve=>me(De(ve)),xyz65:me},toMode:{rgb:ve=>ht(lt(ve)),xyz65:lt}}),dt=At,Ht=ve=>(ve=ve%360)<0?ve+360:ve,fr=Ht,gt=(ve,be)=>ve.map((Ce,He,Xe)=>{if(Ce===void 0)return Ce;let it=fr(Ce);return He===0||ve[He-1]===void 0?it:be(it-fr(Xe[He-1]))}).reduce((Ce,He)=>!Ce.length||He===void 0||Ce[Ce.length-1]===void 0?(Ce.push(He),Ce):(Ce.push(He+Ce[Ce.length-1]),Ce),[]),yt=ve=>gt(ve,be=>Math.abs(be)<=180?be:be-360*Math.sign(be)),kt=ve=>gt(ve,be=>Math.abs(be)>=180||be===0?be:be-360*Math.sign(be)),Lt=ve=>gt(ve,be=>be>=0?be:be+360),Ct=ve=>gt(ve,be=>be<=0?be:be-360),$t=[-.14861,1.78277,-.29227,-.90649,1.97294,0],mr=Math.PI/180,br=180/Math.PI,Er=$t[3]*$t[4],Tr=$t[1]*$t[4],Ur=$t[1]*$t[2]-$t[0]*$t[3],Ai=({r:ve,g:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=(Ur*Ce+ve*Er-be*Tr)/(Ur+Er-Tr),it=Ce-Xe,Dt=($t[4]*(be-Xe)-$t[2]*it)/$t[3],or={mode:"cubehelix",l:Xe,s:Xe===0||Xe===1?void 0:Math.sqrt(it*it+Dt*Dt)/($t[4]*Xe*(1-Xe))};return or.s&&(or.h=Math.atan2(Dt,it)*br-120),He!==void 0&&(or.alpha=He),or},oi=Ai,Qr=({h:ve,s:be,l:Ce,alpha:He})=>{let Xe={mode:"rgb"};ve=(ve===void 0?0:ve+120)*mr,Ce===void 0&&(Ce=0);let it=be===void 0?0:be*Ce*(1-Ce),Dt=Math.cos(ve),or=Math.sin(ve);return Xe.r=Ce+it*($t[0]*Dt+$t[1]*or),Xe.g=Ce+it*($t[2]*Dt+$t[3]*or),Xe.b=Ce+it*($t[4]*Dt+$t[5]*or),He!==void 0&&(Xe.alpha=He),Xe},ea=Qr,$i=(ve,be)=>{if(ve.h===void 0||be.h===void 0||!ve.s||!be.s)return 0;let Ce=fr(ve.h),He=fr(be.h),Xe=Math.sin((He-Ce+360)/2*Math.PI/180);return 2*Math.sqrt(ve.s*be.s)*Xe},ja=(ve,be)=>{if(ve.h===void 0||be.h===void 0)return 0;let Ce=fr(ve.h),He=fr(be.h);return Math.abs(He-Ce)>180?Ce-(He-360*Math.sign(He-Ce)):He-Ce},ya=(ve,be)=>{if(ve.h===void 0||be.h===void 0||!ve.c||!be.c)return 0;let Ce=fr(ve.h),He=fr(be.h),Xe=Math.sin((He-Ce+360)/2*Math.PI/180);return 2*Math.sqrt(ve.c*be.c)*Xe},pa=(ve="rgb",be=[1,1,1,0])=>{let Ce=J(ve),He=Ce.channels,Xe=Ce.difference,it=L(ve);return(Dt,or)=>{let Dr=it(Dt),vi=it(or);return Math.sqrt(He.reduce((ai,ei,Oi)=>{let Si=Xe[ei]?Xe[ei](Dr,vi):Dr[ei]-vi[ei];return ai+(be[Oi]||0)*Math.pow(isNaN(Si)?0:Si,2)},0))}},xi=()=>pa("lab65"),bi=(ve=1,be=.045,Ce=.015)=>{let He=L("lab65");return(Xe,it)=>{let Dt=He(Xe),or=He(it),Dr=Dt.l,vi=Dt.a,ai=Dt.b,ei=Math.sqrt(vi*vi+ai*ai),Oi=or.l,Si=or.a,zi=or.b,Vi=Math.sqrt(Si*Si+zi*zi),Xi=Math.pow(Dr-Oi,2),ha=Math.pow(ei-Vi,2),$a=Math.pow(vi-Si,2)+Math.pow(ai-zi,2)-ha;return Math.sqrt(Xi/Math.pow(ve,2)+ha/Math.pow(1+be*ei,2)+$a/Math.pow(1+Ce*ei,2))}},Ua=(ve=1,be=1,Ce=1)=>{let He=L("lab65");return(Xe,it)=>{let Dt=He(Xe),or=He(it),Dr=Dt.l,vi=Dt.a,ai=Dt.b,ei=Math.sqrt(vi*vi+ai*ai),Oi=or.l,Si=or.a,zi=or.b,Vi=Math.sqrt(Si*Si+zi*zi),Xi=(ei+Vi)/2,ha=.5*(1-Math.sqrt(Math.pow(Xi,7)/(Math.pow(Xi,7)+Math.pow(25,7)))),$a=vi*(1+ha),_o=Si*(1+ha),xs=Math.sqrt($a*$a+ai*ai),el=Math.sqrt(_o*_o+zi*zi),vl=Math.abs($a)+Math.abs(ai)===0?0:Math.atan2(ai,$a);vl+=(vl<0)*2*Math.PI;let Al=Math.abs(_o)+Math.abs(zi)===0?0:Math.atan2(zi,_o);Al+=(Al<0)*2*Math.PI;let uu=Oi-Dr,Ef=el-xs,zh=xs*el===0?0:Al-vl;zh-=(zh>Math.PI)*2*Math.PI,zh+=(zh<-Math.PI)*2*Math.PI;let Hd=2*Math.sqrt(xs*el)*Math.sin(zh/2),sv=(Dr+Oi)/2,lv=(xs+el)/2,kf;xs*el===0?kf=vl+Al:(kf=(vl+Al)/2,kf-=(Math.abs(vl-Al)>Math.PI)*Math.PI,kf+=(kf<0)*2*Math.PI);let Y2=Math.pow(sv-50,2),X2=1-.17*Math.cos(kf-Math.PI/6)+.24*Math.cos(2*kf)+.32*Math.cos(3*kf+Math.PI/30)-.2*Math.cos(4*kf-63*Math.PI/180),sy=1+.015*Y2/Math.sqrt(20+Y2),ly=1+.045*lv,Km=1+.015*lv*X2,GS=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*kf-275)/25,2)),Z2=2*Math.sqrt(Math.pow(lv,7)/(Math.pow(lv,7)+Math.pow(25,7))),uy=-1*Math.sin(2*GS)*Z2;return Math.sqrt(Math.pow(uu/(ve*sy),2)+Math.pow(Ef/(be*ly),2)+Math.pow(Hd/(Ce*Km),2)+uy*Ef/(be*ly)*Hd/(Ce*Km))}},dn=(ve=1,be=1)=>{let Ce=L("lab65");return(He,Xe)=>{let it=Ce(He),Dt=it.l,or=it.a,Dr=it.b,vi=Math.sqrt(or*or+Dr*Dr),ai=Math.atan2(Dr,or);ai=ai+2*Math.PI*(ai<0);let ei=Ce(Xe),Oi=ei.l,Si=ei.a,zi=ei.b,Vi=Math.sqrt(Si*Si+zi*zi),Xi=Math.pow(Dt-Oi,2),ha=Math.pow(vi-Vi,2),$a=Math.pow(or-Si,2)+Math.pow(Dr-zi,2)-ha,_o=Math.sqrt(Math.pow(vi,4)/(Math.pow(vi,4)+1900)),xs=ai>=164/180*Math.PI&&ai<=345/180*Math.PI?.56+Math.abs(.2*Math.cos(ai+168/180*Math.PI)):.36+Math.abs(.4*Math.cos(ai+35/180*Math.PI)),el=Dt<16?.511:.040975*Dt/(1+.01765*Dt),vl=.0638*vi/(1+.0131*vi)+.638,Al=vl*(_o*xs+1-_o);return Math.sqrt(Xi/Math.pow(ve*el,2)+ha/Math.pow(be*vl,2)+$a/Math.pow(Al,2))}},pi=()=>{let ve=L("lab65");return(be,Ce)=>{let He=ve(be),Xe=ve(Ce),it=He.l-Xe.l,Dt=He.a-Xe.a,or=He.b-Xe.b;return Math.abs(it)+Math.sqrt(Dt*Dt+or*or)}},Jr=()=>pa("yiq",[.5053,.299,.1957]),Be=()=>pa("itp",[518400,129600,518400]),Fe=ve=>{let be=ve.reduce((He,Xe)=>{if(Xe!==void 0){let it=Xe*Math.PI/180;He.sin+=Math.sin(it),He.cos+=Math.cos(it)}return He},{sin:0,cos:0}),Ce=Math.atan2(be.sin,be.cos)*180/Math.PI;return Ce<0?360+Ce:Ce},Et=ve=>{let be=ve.filter(Ce=>Ce!==void 0);return be.length?be.reduce((Ce,He)=>Ce+He,0)/be.length:void 0},St=ve=>typeof ve=="function";function zt(ve,be="rgb",Ce){let He=J(be),Xe=ve.map(L(be));return He.channels.reduce((it,Dt)=>{let or=Xe.map(Dr=>Dr[Dt]).filter(Dr=>Dr!==void 0);if(or.length){let Dr;St(Ce)?Dr=Ce:Ce&&St(Ce[Dt])?Dr=Ce[Dt]:He.average&&St(He.average[Dt])?Dr=He.average[Dt]:Dr=Et,it[Dt]=Dr(or,Dt)}return it},{mode:be})}var Wt={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:oi},toMode:{rgb:ea},interpolate:{h:{use:Je,fixup:yt},s:Je,l:Je,alpha:{use:Je,fixup:vt}},difference:{h:$i},average:{h:Fe}},Yt=Wt,ze=({l:ve,a:be,b:Ce,alpha:He},Xe="lch")=>{be===void 0&&(be=0),Ce===void 0&&(Ce=0);let it=Math.sqrt(be*be+Ce*Ce),Dt={mode:Xe,l:ve,c:it};return it&&(Dt.h=fr(Math.atan2(Ce,be)*180/Math.PI)),He!==void 0&&(Dt.alpha=He),Dt},tt=ze,ft=({l:ve,c:be,h:Ce,alpha:He},Xe="lab")=>{Ce===void 0&&(Ce=0);let it={mode:Xe,l:ve,a:be?be*Math.cos(Ce/180*Math.PI):0,b:be?be*Math.sin(Ce/180*Math.PI):0};return He!==void 0&&(it.alpha=He),it},wt=ft,jt=Math.pow(29,3)/Math.pow(3,3),It=Math.pow(6,3)/Math.pow(29,3),Kt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},qt={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},vr=Math.pow(29,3)/Math.pow(3,3),Br=Math.pow(6,3)/Math.pow(29,3),Pr=ve=>Math.pow(ve,3)>It?Math.pow(ve,3):(116*ve-16)/jt,Mi=({l:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=(ve+16)/116,it=be/500+Xe,Dt=Xe-Ce/200,or={mode:"xyz65",x:Pr(it)*qt.X,y:Pr(Xe)*qt.Y,z:Pr(Dt)*qt.Z};return He!==void 0&&(or.alpha=He),or},gi=Mi,ba=ve=>ht(gi(ve)),Hi=ba,Za=ve=>ve>It?Math.cbrt(ve):(jt*ve+16)/116,oa=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Za(ve/qt.X),it=Za(be/qt.Y),Dt=Za(Ce/qt.Z),or={mode:"lab65",l:116*it-16,a:500*(Xe-it),b:200*(it-Dt)};return He!==void 0&&(or.alpha=He),or},Cn=oa,_n=ve=>{let be=Cn(De(ve));return ve.r===ve.b&&ve.b===ve.g&&(be.a=be.b=0),be},Li=_n,In=1,pn=1,Ka=26/180*Math.PI,Rn=Math.cos(Ka),tn=Math.sin(Ka),Mn=100/Math.log(139/100),Kn=({l:ve,c:be,h:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"lab65",l:(Math.exp(ve*In/Mn)-1)/.0039},it=(Math.exp(.0435*be*pn*In)-1)/.075,Dt=it*Math.cos(Ce/180*Math.PI-Ka),or=it*Math.sin(Ce/180*Math.PI-Ka);return Xe.a=Dt*Rn-or/.83*tn,Xe.b=Dt*tn+or/.83*Rn,He!==void 0&&(Xe.alpha=He),Xe},zn=Kn,ua=({l:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=be*Rn+Ce*tn,it=.83*(Ce*Rn-be*tn),Dt=Math.sqrt(Xe*Xe+it*it),or={mode:"dlch",l:Mn/In*Math.log(1+.0039*ve),c:Math.log(1+.075*Dt)/(.0435*pn*In)};return or.c&&(or.h=fr((Math.atan2(it,Xe)+Ka)/Math.PI*180)),He!==void 0&&(or.alpha=He),or},Ea=ua,ln=ve=>zn(tt(ve,"dlch")),on=ve=>wt(Ea(ve),"dlab"),ao={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:ln,rgb:ve=>Hi(ln(ve))},fromMode:{lab65:on,rgb:ve=>on(Li(ve))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Je,a:Je,b:Je,alpha:{use:Je,fixup:vt}}},ho=ao,Jn={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:zn,dlab:ve=>wt(ve,"dlab"),rgb:ve=>Hi(zn(ve))},fromMode:{lab65:Ea,dlab:ve=>tt(ve,"dlch"),rgb:ve=>Ea(Li(ve))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Je,c:Je,h:{use:Je,fixup:yt},alpha:{use:Je,fixup:vt}},difference:{h:ya},average:{h:Fe}},lo=Jn;function Fo({h:ve,s:be,i:Ce,alpha:He}){ve=fr(ve!==void 0?ve:0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.abs(ve/60%2-1),it;switch(Math.floor(ve/60)){case 0:it={r:Ce*(1+be*(3/(2-Xe)-1)),g:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1)),b:Ce*(1-be)};break;case 1:it={r:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1)),g:Ce*(1+be*(3/(2-Xe)-1)),b:Ce*(1-be)};break;case 2:it={r:Ce*(1-be),g:Ce*(1+be*(3/(2-Xe)-1)),b:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1))};break;case 3:it={r:Ce*(1-be),g:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1)),b:Ce*(1+be*(3/(2-Xe)-1))};break;case 4:it={r:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1)),g:Ce*(1-be),b:Ce*(1+be*(3/(2-Xe)-1))};break;case 5:it={r:Ce*(1+be*(3/(2-Xe)-1)),g:Ce*(1-be),b:Ce*(1+be*(3*(1-Xe)/(2-Xe)-1))};break;default:it={r:Ce*(1-be),g:Ce*(1-be),b:Ce*(1-be)}}return it.mode="rgb",He!==void 0&&(it.alpha=He),it}function uo({r:ve,g:be,b:Ce,alpha:He}){ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.max(ve,be,Ce),it=Math.min(ve,be,Ce),Dt={mode:"hsi",s:ve+be+Ce===0?0:1-3*it/(ve+be+Ce),i:(ve+be+Ce)/3};return Xe-it!==0&&(Dt.h=(Xe===ve?(be-Ce)/(Xe-it)+(be{switch(be){case"deg":return+ve;case"rad":return ve/Math.PI*180;case"grad":return ve/10*9;case"turn":return ve*360}},xo=ps,no=new RegExp(`^hsla?\\(\\s*${k}${b}${S}${b}${S}\\s*(?:,\\s*${C}\\s*)?\\)$`),Mo=ve=>{let be=ve.match(no);if(!be)return;let Ce={mode:"hsl"};return be[3]!==void 0?Ce.h=+be[3]:be[1]!==void 0&&be[2]!==void 0&&(Ce.h=xo(be[1],be[2])),be[4]!==void 0&&(Ce.s=Math.min(Math.max(0,be[4]/100),1)),be[5]!==void 0&&(Ce.l=Math.min(Math.max(0,be[5]/100),1)),be[6]!==void 0?Ce.alpha=Math.max(0,Math.min(1,be[6]/100)):be[7]!==void 0&&(Ce.alpha=Math.max(0,Math.min(1,+be[7]))),Ce},Vn=Mo;function ts(ve,be){if(!be||be[0]!=="hsl"&&be[0]!=="hsla")return;let Ce={mode:"hsl"},[,He,Xe,it,Dt]=be;if(He.type!==V.None){if(He.type===V.Percentage)return;Ce.h=He.value}if(Xe.type!==V.None){if(Xe.type===V.Hue)return;Ce.s=Xe.value/100}if(it.type!==V.None){if(it.type===V.Hue)return;Ce.l=it.value/100}return Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var ws=ts,So={mode:"hsl",toMode:{rgb:Yn},fromMode:{rgb:Bn},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[ws,Vn],serialize:ve=>`hsl(${ve.h!==void 0?ve.h:"none"} ${ve.s!==void 0?ve.s*100+"%":"none"} ${ve.l!==void 0?ve.l*100+"%":"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,interpolate:{h:{use:Je,fixup:yt},s:Je,l:Je,alpha:{use:Je,fixup:vt}},difference:{h:$i},average:{h:Fe}},nl=So;function vs({h:ve,s:be,v:Ce,alpha:He}){ve=fr(ve!==void 0?ve:0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.abs(ve/60%2-1),it;switch(Math.floor(ve/60)){case 0:it={r:Ce,g:Ce*(1-be*Xe),b:Ce*(1-be)};break;case 1:it={r:Ce*(1-be*Xe),g:Ce,b:Ce*(1-be)};break;case 2:it={r:Ce*(1-be),g:Ce,b:Ce*(1-be*Xe)};break;case 3:it={r:Ce*(1-be),g:Ce*(1-be*Xe),b:Ce};break;case 4:it={r:Ce*(1-be*Xe),g:Ce*(1-be),b:Ce};break;case 5:it={r:Ce,g:Ce*(1-be),b:Ce*(1-be*Xe)};break;default:it={r:Ce*(1-be),g:Ce*(1-be),b:Ce*(1-be)}}return it.mode="rgb",He!==void 0&&(it.alpha=He),it}function go({r:ve,g:be,b:Ce,alpha:He}){ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.max(ve,be,Ce),it=Math.min(ve,be,Ce),Dt={mode:"hsv",s:Xe===0?0:1-it/Xe,v:Xe};return Xe-it!==0&&(Dt.h=(Xe===ve?(be-Ce)/(Xe-it)+(be1){let Xe=be+Ce;be/=Xe,Ce/=Xe}return vs({h:ve,s:Ce===1?1:1-be/(1-Ce),v:1-Ce,alpha:He})}function kl(ve){let be=go(ve);if(be===void 0)return;let Ce=be.s!==void 0?be.s:0,He=be.v!==void 0?be.v:0,Xe={mode:"hwb",w:(1-Ce)*He,b:1-He};return be.h!==void 0&&(Xe.h=be.h),be.alpha!==void 0&&(Xe.alpha=be.alpha),Xe}function mu(ve,be){if(!be||be[0]!=="hwb")return;let Ce={mode:"hwb"},[,He,Xe,it,Dt]=be;if(He.type!==V.None){if(He.type===V.Percentage)return;Ce.h=He.value}if(Xe.type!==V.None){if(Xe.type===V.Hue)return;Ce.w=Xe.value/100}if(it.type!==V.None){if(it.type===V.Hue)return;Ce.b=it.value/100}return Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var Ul=mu,gu={mode:"hwb",toMode:{rgb:Uo},fromMode:{rgb:kl},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Ul],serialize:ve=>`hwb(${ve.h!==void 0?ve.h:"none"} ${ve.w!==void 0?ve.w*100+"%":"none"} ${ve.b!==void 0?ve.b*100+"%":"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,interpolate:{h:{use:Je,fixup:yt},w:Je,b:Je,alpha:{use:Je,fixup:vt}},difference:{h:ja},average:{h:Fe}},yu=gu,Fu=203,au=.1593017578125,xc=78.84375,Pu=.8359375,Cl=18.8515625,bc=18.6875;function Iu(ve){if(ve<0)return 0;let be=Math.pow(ve,1/xc);return 1e4*Math.pow(Math.max(0,be-Pu)/(Cl-bc*be),1/au)}function _l(ve){if(ve<0)return 0;let be=Math.pow(ve/1e4,au);return Math.pow((Pu+Cl*be)/(1+bc*be),xc)}var ms=ve=>Math.max(ve/Fu,0),ss=({i:ve,t:be,p:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Iu(ve+.008609037037932761*be+.11102962500302593*Ce),it=Iu(ve-.00860903703793275*be-.11102962500302599*Ce),Dt=Iu(ve+.5600313357106791*be-.32062717498731885*Ce),or={mode:"xyz65",x:ms(2.070152218389422*Xe-1.3263473389671556*it+.2066510476294051*Dt),y:ms(.3647385209748074*Xe+.680566024947227*it-.0453045459220346*Dt),z:ms(-.049747207535812*Xe-.0492609666966138*it+1.1880659249923042*Dt)};return He!==void 0&&(or.alpha=He),or},fl=ss,wc=(ve=0)=>Math.max(ve*Fu,0),Tc=({x:ve,y:be,z:Ce,alpha:He})=>{let Xe=wc(ve),it=wc(be),Dt=wc(Ce),or=_l(.3592832590121217*Xe+.6976051147779502*it-.0358915932320289*Dt),Dr=_l(-.1920808463704995*Xe+1.1004767970374323*it+.0753748658519118*Dt),vi=_l(.0070797844607477*Xe+.0748396662186366*it+.8433265453898765*Dt),ai=.5*or+.5*Dr,ei=1.61376953125*or-3.323486328125*Dr+1.709716796875*vi,Oi=4.378173828125*or-4.24560546875*Dr-.132568359375*vi,Si={mode:"itp",i:ai,t:ei,p:Oi};return He!==void 0&&(Si.alpha=He),Si},tc=Tc,Th={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:fl,rgb:ve=>ht(fl(ve))},fromMode:{xyz65:tc,rgb:ve=>tc(De(ve))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:Je,t:Je,p:Je,alpha:{use:Je,fixup:vt}}},Ah=Th,zd=134.03437499999998,hp=16295499532821565e-27,Ru=ve=>{if(ve<0)return 0;let be=Math.pow(ve/1e4,au);return Math.pow((Pu+Cl*be)/(1+bc*be),zd)},Ts=(ve=0)=>Math.max(ve*203,0),Mh=({x:ve,y:be,z:Ce,alpha:He})=>{ve=Ts(ve),be=Ts(be),Ce=Ts(Ce);let Xe=1.15*ve-.15*Ce,it=.66*be+.34*ve,Dt=Ru(.41478972*Xe+.579999*it+.014648*Ce),or=Ru(-.20151*Xe+1.120649*it+.0531008*Ce),Dr=Ru(-.0166008*Xe+.2648*it+.6684799*Ce),vi=(Dt+or)/2,ai={mode:"jab",j:.44*vi/(1-.56*vi)-hp,a:3.524*Dt-4.066708*or+.542708*Dr,b:.199076*Dt+1.096799*or-1.295875*Dr};return He!==void 0&&(ai.alpha=He),ai},vf=Mh,Ac=134.03437499999998,Sh=16295499532821565e-27,Mc=ve=>{if(ve<0)return 0;let be=Math.pow(ve,1/Ac);return 1e4*Math.pow((Pu-be)/(bc*be-Cl),1/au)},$c=ve=>ve/203,zu=({j:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=(ve+Sh)/(.44+.56*(ve+Sh)),it=Mc(Xe+.13860504*be+.058047316*Ce),Dt=Mc(Xe-.13860504*be-.058047316*Ce),or=Mc(Xe-.096019242*be-.8118919*Ce),Dr={mode:"xyz65",x:$c(1.661373024652174*it-.914523081304348*Dt+.23136208173913045*or),y:$c(-.3250758611844533*it+1.571847026732543*Dt-.21825383453227928*or),z:$c(-.090982811*it-.31272829*Dt+1.5227666*or)};return He!==void 0&&(Dr.alpha=He),Dr},mf=zu,jf=ve=>{let be=vf(De(ve));return ve.r===ve.b&&ve.b===ve.g&&(be.a=be.b=0),be},Sc=jf,ad=ve=>ht(mf(ve)),Uf=ad,Bd={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:Sc,xyz65:vf},toMode:{rgb:Uf,xyz65:mf},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:Je,a:Je,b:Je,alpha:{use:Je,fixup:vt}}},Bu=Bd,Eh=({j:ve,a:be,b:Ce,alpha:He})=>{be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.sqrt(be*be+Ce*Ce),it={mode:"jch",j:ve,c:Xe};return Xe&&(it.h=fr(Math.atan2(Ce,be)*180/Math.PI)),He!==void 0&&(it.alpha=He),it},_u=Eh,qf=({j:ve,c:be,h:Ce,alpha:He})=>{Ce===void 0&&(Ce=0);let Xe={mode:"jab",j:ve,a:be?be*Math.cos(Ce/180*Math.PI):0,b:be?be*Math.sin(Ce/180*Math.PI):0};return He!==void 0&&(Xe.alpha=He),Xe},Dl=qf,gf={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Dl,rgb:ve=>Uf(Dl(ve))},fromMode:{rgb:ve=>_u(Sc(ve)),jab:_u},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:Je,fixup:yt},c:Je,j:Je,alpha:{use:Je,fixup:vt}},difference:{h:ya},average:{h:Fe}},Ou=gf,yf=Math.pow(29,3)/Math.pow(3,3),_f=Math.pow(6,3)/Math.pow(29,3),Vf=ve=>Math.pow(ve,3)>_f?Math.pow(ve,3):(116*ve-16)/yf,kh=({l:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=(ve+16)/116,it=be/500+Xe,Dt=Xe-Ce/200,or={mode:"xyz50",x:Vf(it)*Kt.X,y:Vf(Xe)*Kt.Y,z:Vf(Dt)*Kt.Z};return He!==void 0&&(or.alpha=He),or},Ec=kh,Ch=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=at({r:ve*3.1341359569958707-be*1.6173863321612538-.4906619460083532*Ce,g:ve*-.978795502912089+be*1.916254567259524+.03344273116131949*Ce,b:ve*.07195537988411677-be*.2289768264158322+1.405386058324125*Ce});return He!==void 0&&(Xe.alpha=He),Xe},rc=Ch,Od=ve=>rc(Ec(ve)),xl=Od,xu=ve=>{let{r:be,g:Ce,b:He,alpha:Xe}=ke(ve),it={mode:"xyz50",x:.436065742824811*be+.3851514688337912*Ce+.14307845442264197*He,y:.22249319175623702*be+.7168870538238823*Ce+.06061979053616537*He,z:.013923904500943465*be+.09708128566574634*Ce+.7140993584005155*He};return Xe!==void 0&&(it.alpha=Xe),it},kc=xu,hl=ve=>ve>_f?Math.cbrt(ve):(yf*ve+16)/116,Gf=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=hl(ve/Kt.X),it=hl(be/Kt.Y),Dt=hl(Ce/Kt.Z),or={mode:"lab",l:116*it-16,a:500*(Xe-it),b:200*(it-Dt)};return He!==void 0&&(or.alpha=He),or},Nu=Gf,Cc=ve=>{let be=Nu(kc(ve));return ve.r===ve.b&&ve.b===ve.g&&(be.a=be.b=0),be},Hf=Cc;function Nd(ve,be){if(!be||be[0]!=="lab")return;let Ce={mode:"lab"},[,He,Xe,it,Dt]=be;if(!(He.type===V.Hue||Xe.type===V.Hue||it.type===V.Hue))return He.type!==V.None&&(Ce.l=Math.min(Math.max(0,He.value),100)),Xe.type!==V.None&&(Ce.a=Xe.type===V.Number?Xe.value:Xe.value*125/100),it.type!==V.None&&(Ce.b=it.type===V.Number?it.value:it.value*125/100),Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var nd=Nd,ju={mode:"lab",toMode:{xyz50:Ec,rgb:xl},fromMode:{xyz50:Nu,rgb:Hf},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[nd],serialize:ve=>`lab(${ve.l!==void 0?ve.l:"none"} ${ve.a!==void 0?ve.a:"none"} ${ve.b!==void 0?ve.b:"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,interpolate:{l:Je,a:Je,b:Je,alpha:{use:Je,fixup:vt}}},ql=ju,Vl=ar(Nt({},ql),{mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:gi,rgb:Hi},fromMode:{xyz65:Cn,rgb:Li},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}}),jd=Vl;function xf(ve,be){if(!be||be[0]!=="lch")return;let Ce={mode:"lch"},[,He,Xe,it,Dt]=be;if(He.type!==V.None){if(He.type===V.Hue)return;Ce.l=Math.min(Math.max(0,He.value),100)}if(Xe.type!==V.None&&(Ce.c=Math.max(0,Xe.type===V.Number?Xe.value:Xe.value*150/100)),it.type!==V.None){if(it.type===V.Percentage)return;Ce.h=it.value}return Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var od=xf,nu={mode:"lch",toMode:{lab:wt,rgb:ve=>xl(wt(ve))},fromMode:{rgb:ve=>tt(Hf(ve)),lab:tt},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[od],serialize:ve=>`lch(${ve.l!==void 0?ve.l:"none"} ${ve.c!==void 0?ve.c:"none"} ${ve.h!==void 0?ve.h:"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,interpolate:{h:{use:Je,fixup:yt},c:Je,l:Je,alpha:{use:Je,fixup:vt}},difference:{h:ya},average:{h:Fe}},Wc=nu,$f=ar(Nt({},Wc),{mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:ve=>wt(ve,"lab65"),rgb:ve=>Hi(wt(ve,"lab65"))},fromMode:{rgb:ve=>tt(Li(ve),"lch65"),lab65:ve=>tt(ve,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}}),bf=$f,Ud=({l:ve,u:be,v:Ce,alpha:He})=>{be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.sqrt(be*be+Ce*Ce),it={mode:"lchuv",l:ve,c:Xe};return Xe&&(it.h=fr(Math.atan2(Ce,be)*180/Math.PI)),He!==void 0&&(it.alpha=He),it},Yc=Ud,Dc=({l:ve,c:be,h:Ce,alpha:He})=>{Ce===void 0&&(Ce=0);let Xe={mode:"luv",l:ve,u:be?be*Math.cos(Ce/180*Math.PI):0,v:be?be*Math.sin(Ce/180*Math.PI):0};return He!==void 0&&(Xe.alpha=He),Xe},Lc=Dc,wf=(ve,be,Ce)=>4*ve/(ve+15*be+3*Ce),sd=(ve,be,Ce)=>9*be/(ve+15*be+3*Ce),Wf=wf(Kt.X,Kt.Y,Kt.Z),Xc=sd(Kt.X,Kt.Y,Kt.Z),Yf=ve=>ve<=_f?yf*ve:116*Math.cbrt(ve)-16,Zc=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Yf(be/Kt.Y),it=wf(ve,be,Ce),Dt=sd(ve,be,Ce);!isFinite(it)||!isFinite(Dt)?Xe=it=Dt=0:(it=13*Xe*(it-Wf),Dt=13*Xe*(Dt-Xc));let or={mode:"luv",l:Xe,u:it,v:Dt};return He!==void 0&&(or.alpha=He),or},ic=Zc,Tf=(ve,be,Ce)=>4*ve/(ve+15*be+3*Ce),Xf=(ve,be,Ce)=>9*be/(ve+15*be+3*Ce),ld=Tf(Kt.X,Kt.Y,Kt.Z),Dh=Xf(Kt.X,Kt.Y,Kt.Z),qd=({l:ve,u:be,v:Ce,alpha:He})=>{if(ve===void 0&&(ve=0),ve===0)return{mode:"xyz50",x:0,y:0,z:0};be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=be/(13*ve)+ld,it=Ce/(13*ve)+Dh,Dt=Kt.Y*(ve<=8?ve/yf:Math.pow((ve+16)/116,3)),or=Dt*(9*Xe)/(4*it),Dr=Dt*(12-3*Xe-20*it)/(4*it),vi={mode:"xyz50",x:or,y:Dt,z:Dr};return He!==void 0&&(vi.alpha=He),vi},Zf=qd,ud=ve=>Yc(ic(kc(ve))),Lh=ve=>rc(Zf(Lc(ve))),Js={mode:"lchuv",toMode:{luv:Lc,rgb:Lh},fromMode:{rgb:ud,luv:Yc},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Je,fixup:yt},c:Je,l:Je,alpha:{use:Je,fixup:vt}},difference:{h:ya},average:{h:Fe}},ou=Js,Kf=ar(Nt({},Pt),{mode:"lrgb",toMode:{rgb:at},fromMode:{rgb:ke},parse:["srgb-linear"],serialize:"srgb-linear"}),Fh=Kf,Jf={mode:"luv",toMode:{xyz50:Zf,rgb:ve=>rc(Zf(ve))},fromMode:{xyz50:ic,rgb:ve=>ic(kc(ve))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:Je,u:Je,v:Je,alpha:{use:Je,fixup:vt}}},Af=Jf,nt=({r:ve,g:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.cbrt(.412221469470763*ve+.5363325372617348*be+.0514459932675022*Ce),it=Math.cbrt(.2119034958178252*ve+.6806995506452344*be+.1073969535369406*Ce),Dt=Math.cbrt(.0883024591900564*ve+.2817188391361215*be+.6299787016738222*Ce),or={mode:"oklab",l:.210454268309314*Xe+.7936177747023054*it-.0040720430116193*Dt,a:1.9779985324311684*Xe-2.42859224204858*it+.450593709617411*Dt,b:.0259040424655478*Xe+.7827717124575296*it-.8086757549230774*Dt};return He!==void 0&&(or.alpha=He),or},Tt=nt,Jt=ve=>{let be=Tt(ke(ve));return ve.r===ve.b&&ve.b===ve.g&&(be.a=be.b=0),be},Bt=Jt,yr=({l:ve,a:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Math.pow(ve+.3963377773761749*be+.2158037573099136*Ce,3),it=Math.pow(ve-.1055613458156586*be-.0638541728258133*Ce,3),Dt=Math.pow(ve-.0894841775298119*be-1.2914855480194092*Ce,3),or={mode:"lrgb",r:4.076741636075957*Xe-3.3077115392580616*it+.2309699031821044*Dt,g:-1.2684379732850317*Xe+2.6097573492876887*it-.3413193760026573*Dt,b:-.0041960761386756*Xe-.7034186179359362*it+1.7076146940746117*Dt};return He!==void 0&&(or.alpha=He),or},zr=yr,Gr=ve=>at(zr(ve)),ii=Gr;function li(ve){let He=1.170873786407767;return .5*(He*ve-.206+Math.sqrt((He*ve-.206)*(He*ve-.206)+4*.03*He*ve))}function Fi(ve){return(ve*ve+.206*ve)/(1.170873786407767*(ve+.03))}function $r(ve,be){let Ce,He,Xe,it,Dt,or,Dr,vi;-1.88170328*ve-.80936493*be>1?(Ce=1.19086277,He=1.76576728,Xe=.59662641,it=.75515197,Dt=.56771245,or=4.0767416621,Dr=-3.3077115913,vi=.2309699292):1.81444104*ve-1.19445276*be>1?(Ce=.73956515,He=-.45954404,Xe=.08285427,it=.1254107,Dt=.14503204,or=-1.2684380046,Dr=2.6097574011,vi=-.3413193965):(Ce=1.35733652,He=-.00915799,Xe=-1.1513021,it=-.50559606,Dt=.00692167,or=-.0041960863,Dr=-.7034186147,vi=1.707614701);let ai=Ce+He*ve+Xe*be+it*ve*ve+Dt*ve*be,ei=.3963377774*ve+.2158037573*be,Oi=-.1055613458*ve-.0638541728*be,Si=-.0894841775*ve-1.291485548*be;{let zi=1+ai*ei,Vi=1+ai*Oi,Xi=1+ai*Si,ha=zi*zi*zi,$a=Vi*Vi*Vi,_o=Xi*Xi*Xi,xs=3*ei*zi*zi,el=3*Oi*Vi*Vi,vl=3*Si*Xi*Xi,Al=6*ei*ei*zi,uu=6*Oi*Oi*Vi,Ef=6*Si*Si*Xi,zh=or*ha+Dr*$a+vi*_o,Hd=or*xs+Dr*el+vi*vl,sv=or*Al+Dr*uu+vi*Ef;ai=ai-zh*Hd/(Hd*Hd-.5*zh*sv)}return ai}function ni(ve,be){let Ce=$r(ve,be),He=zr({l:1,a:Ce*ve,b:Ce*be}),Xe=Math.cbrt(1/Math.max(He.r,He.g,He.b)),it=Xe*Ce;return[Xe,it]}function ui(ve,be,Ce,He,Xe,it=null){it||(it=ni(ve,be));let Dt;if((Ce-Xe)*it[1]-(it[0]-Xe)*He<=0)Dt=it[1]*Xe/(He*it[0]+it[1]*(Xe-Ce));else{Dt=it[1]*(Xe-1)/(He*(it[0]-1)+it[1]*(Xe-Ce));{let or=Ce-Xe,Dr=He,vi=.3963377774*ve+.2158037573*be,ai=-.1055613458*ve-.0638541728*be,ei=-.0894841775*ve-1.291485548*be,Oi=or+Dr*vi,Si=or+Dr*ai,zi=or+Dr*ei;{let Vi=Xe*(1-Dt)+Dt*Ce,Xi=Dt*He,ha=Vi+Xi*vi,$a=Vi+Xi*ai,_o=Vi+Xi*ei,xs=ha*ha*ha,el=$a*$a*$a,vl=_o*_o*_o,Al=3*Oi*ha*ha,uu=3*Si*$a*$a,Ef=3*zi*_o*_o,zh=6*Oi*Oi*ha,Hd=6*Si*Si*$a,sv=6*zi*zi*_o,lv=4.0767416621*xs-3.3077115913*el+.2309699292*vl-1,kf=4.0767416621*Al-3.3077115913*uu+.2309699292*Ef,Y2=4.0767416621*zh-3.3077115913*Hd+.2309699292*sv,X2=kf/(kf*kf-.5*lv*Y2),sy=-lv*X2,ly=-1.2684380046*xs+2.6097574011*el-.3413193965*vl-1,Km=-1.2684380046*Al+2.6097574011*uu-.3413193965*Ef,GS=-1.2684380046*zh+2.6097574011*Hd-.3413193965*sv,Z2=Km/(Km*Km-.5*ly*GS),uy=-ly*Z2,yj=-.0041960863*xs-.7034186147*el+1.707614701*vl-1,HS=-.0041960863*Al-.7034186147*uu+1.707614701*Ef,Cce=-.0041960863*zh-.7034186147*Hd+1.707614701*sv,_j=HS/(HS*HS-.5*yj*Cce),$S=-yj*_j;sy=X2>=0?sy:1e6,uy=Z2>=0?uy:1e6,$S=_j>=0?$S:1e6,Dt+=Math.min(sy,Math.min(uy,$S))}}}return Dt}function Di(ve,be,Ce=null){Ce||(Ce=ni(ve,be));let He=Ce[0],Xe=Ce[1];return[Xe/He,Xe/(1-He)]}function Wi(ve,be,Ce){let He=ni(be,Ce),Xe=ui(be,Ce,ve,1,ve,He),it=Di(be,Ce,He),Dt=.11516993+1/(7.4477897+4.1590124*Ce+be*(-2.19557347+1.75198401*Ce+be*(-2.13704948-10.02301043*Ce+be*(-4.24894561+5.38770819*Ce+4.69891013*be)))),or=.11239642+1/(1.6132032-.68124379*Ce+be*(.40370612+.90148123*Ce+be*(-.27087943+.6122399*Ce+be*(.00299215-.45399568*Ce-.14661872*be)))),Dr=Xe/Math.min(ve*it[0],(1-ve)*it[1]),vi=ve*Dt,ai=(1-ve)*or,ei=.9*Dr*Math.sqrt(Math.sqrt(1/(1/(vi*vi*vi*vi)+1/(ai*ai*ai*ai))));return vi=ve*.4,ai=(1-ve)*.8,[Math.sqrt(1/(1/(vi*vi)+1/(ai*ai))),ei,Xe]}function Oa(ve){let be=ve.l!==void 0?ve.l:0,Ce=ve.a!==void 0?ve.a:0,He=ve.b!==void 0?ve.b:0,Xe={mode:"okhsl",l:li(be)};ve.alpha!==void 0&&(Xe.alpha=ve.alpha);let it=Math.sqrt(Ce*Ce+He*He);if(!it)return Xe.s=0,Xe;let[Dt,or,Dr]=Wi(be,Ce/it,He/it),vi;if(itOa(Bt(ve))},toMode:{oklab:Pa,rgb:ve=>ii(Pa(ve))}}),rn=Ja;function Zi(ve){let be=ve.l!==void 0?ve.l:0,Ce=ve.a!==void 0?ve.a:0,He=ve.b!==void 0?ve.b:0,Xe=Math.sqrt(Ce*Ce+He*He),it=Xe?Ce/Xe:1,Dt=Xe?He/Xe:1,[or,Dr]=Di(it,Dt),vi=.5,ai=1-vi/or,ei=Dr/(Xe+be*Dr),Oi=ei*be,Si=ei*Xe,zi=Fi(Oi),Vi=Si*zi/Oi,Xi=zr({l:zi,a:it*Vi,b:Dt*Vi}),ha=Math.cbrt(1/Math.max(Xi.r,Xi.g,Xi.b,0));be=be/ha,Xe=Xe/ha*li(be)/be,be=li(be);let $a={mode:"okhsv",s:Xe?(vi+Dr)*Si/(Dr*vi+Dr*ai*Si):0,v:be?be/Oi:0};return $a.s&&($a.h=fr(Math.atan2(He,Ce)*180/Math.PI)),ve.alpha!==void 0&&($a.alpha=ve.alpha),$a}function sa(ve){let be={mode:"oklab"};ve.alpha!==void 0&&(be.alpha=ve.alpha);let Ce=ve.h!==void 0?ve.h:0,He=ve.s!==void 0?ve.s:0,Xe=ve.v!==void 0?ve.v:0,it=Math.cos(Ce/180*Math.PI),Dt=Math.sin(Ce/180*Math.PI),[or,Dr]=Di(it,Dt),vi=.5,ai=1-vi/or,ei=1-He*vi/(vi+Dr-Dr*ai*He),Oi=He*Dr*vi/(vi+Dr-Dr*ai*He),Si=Fi(ei),zi=Oi*Si/ei,Vi=zr({l:Si,a:it*zi,b:Dt*zi}),Xi=Math.cbrt(1/Math.max(Vi.r,Vi.g,Vi.b,0)),ha=Fi(Xe*ei),$a=Oi*ha/ei;return be.l=ha*Xi,be.a=$a*it*Xi,be.b=$a*Dt*Xi,be}var vn=ar(Nt({},On),{mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Zi,rgb:ve=>Zi(Bt(ve))},toMode:{oklab:sa,rgb:ve=>ii(sa(ve))}}),Dn=vn;function po(ve,be){if(!be||be[0]!=="oklab")return;let Ce={mode:"oklab"},[,He,Xe,it,Dt]=be;if(!(He.type===V.Hue||Xe.type===V.Hue||it.type===V.Hue))return He.type!==V.None&&(Ce.l=Math.min(Math.max(0,He.type===V.Number?He.value:He.value/100),1)),Xe.type!==V.None&&(Ce.a=Xe.type===V.Number?Xe.value:Xe.value*.4/100),it.type!==V.None&&(Ce.b=it.type===V.Number?it.value:it.value*.4/100),Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var zo=po,wo=ar(Nt({},ql),{mode:"oklab",toMode:{lrgb:zr,rgb:ii},fromMode:{lrgb:Tt,rgb:Bt},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[zo],serialize:ve=>`oklab(${ve.l!==void 0?ve.l:"none"} ${ve.a!==void 0?ve.a:"none"} ${ve.b!==void 0?ve.b:"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`}),$o=wo;function io(ve,be){if(!be||be[0]!=="oklch")return;let Ce={mode:"oklch"},[,He,Xe,it,Dt]=be;if(He.type!==V.None){if(He.type===V.Hue)return;Ce.l=Math.min(Math.max(0,He.type===V.Number?He.value:He.value/100),1)}if(Xe.type!==V.None&&(Ce.c=Math.max(0,Xe.type===V.Number?Xe.value:Xe.value*.4/100)),it.type!==V.None){if(it.type===V.Percentage)return;Ce.h=it.value}return Dt.type!==V.None&&(Ce.alpha=Math.min(1,Math.max(0,Dt.type===V.Number?Dt.value:Dt.value/100))),Ce}var Us=io,gs=ar(Nt({},Wc),{mode:"oklch",toMode:{oklab:ve=>wt(ve,"oklab"),rgb:ve=>ii(wt(ve,"oklab"))},fromMode:{rgb:ve=>tt(Bt(ve),"oklch"),oklab:ve=>tt(ve,"oklch")},parse:[Us],serialize:ve=>`oklch(${ve.l!==void 0?ve.l:"none"} ${ve.c!==void 0?ve.c:"none"} ${ve.h!==void 0?ve.h:"none"}${ve.alpha<1?` / ${ve.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}}),Go=gs,ma=ve=>{let{r:be,g:Ce,b:He,alpha:Xe}=ke(ve),it={mode:"xyz65",x:.486570948648216*be+.265667693169093*Ce+.1982172852343625*He,y:.2289745640697487*be+.6917385218365062*Ce+.079286914093745*He,z:0*be+.0451133818589026*Ce+1.043944368900976*He};return Xe!==void 0&&(it.alpha=Xe),it},vo=ma,Ls=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=at({r:ve*2.4934969119414263-be*.9313836179191242-.402710784450717*Ce,g:ve*-.8294889695615749+be*1.7626640603183465+.0236246858419436*Ce,b:ve*.0358458302437845-be*.0761723892680418+.9568845240076871*Ce},"p3");return He!==void 0&&(Xe.alpha=He),Xe},qs=Ls,Ll=ar(Nt({},Pt),{mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:ve=>qs(De(ve)),xyz65:qs},toMode:{rgb:ve=>ht(vo(ve)),xyz65:vo}}),bu=Ll,Gl=ve=>{let be=Math.abs(ve);return be>=1/512?Math.sign(ve)*Math.pow(be,1/1.8):16*ve},ac=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"prophoto",r:Gl(ve*1.3457868816471585-be*.2555720873797946-.0511018649755453*Ce),g:Gl(ve*-.5446307051249019+be*1.5082477428451466+.0205274474364214*Ce),b:Gl(ve*0+be*0+1.2119675456389452*Ce)};return He!==void 0&&(Xe.alpha=He),Xe},bl=ac,Uu=(ve=0)=>{let be=Math.abs(ve);return be>=16/512?Math.sign(ve)*Math.pow(be,1.8):ve/16},Fc=ve=>{let be=Uu(ve.r),Ce=Uu(ve.g),He=Uu(ve.b),Xe={mode:"xyz50",x:.7977666449006423*be+.1351812974005331*Ce+.0313477341283922*He,y:.2880748288194013*be+.7118352342418731*Ce+899369387256e-16*He,z:0*be+0*Ce+.8251046025104602*He};return ve.alpha!==void 0&&(Xe.alpha=ve.alpha),Xe},Kc=Fc,cd=ar(Nt({},Pt),{mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:bl,rgb:ve=>bl(kc(ve))},toMode:{xyz50:Kc,rgb:ve=>rc(Kc(ve))}}),Qf=cd,Vd=1.09929682680944,Ph=.018053968510807,Hl=ve=>{let be=Math.abs(ve);return be>Ph?(Math.sign(ve)||1)*(Vd*Math.pow(be,.45)-(Vd-1)):4.5*ve},Gd=({x:ve,y:be,z:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"rec2020",r:Hl(ve*1.7166511879712683-be*.3556707837763925-.2533662813736599*Ce),g:Hl(ve*-.6666843518324893+be*1.6164812366349395+.0157685458139111*Ce),b:Hl(ve*.0176398574453108-be*.0427706132578085+.9421031212354739*Ce)};return He!==void 0&&(Xe.alpha=He),Xe},Mf=Gd,Ih=1.09929682680944,Rh=.018053968510807,qu=(ve=0)=>{let be=Math.abs(ve);return be{let be=qu(ve.r),Ce=qu(ve.g),He=qu(ve.b),Xe={mode:"xyz65",x:.6369580483012911*be+.1446169035862083*Ce+.1688809751641721*He,y:.262700212011267*be+.6779980715188708*Ce+.059301716469862*He,z:0*be+.0280726930490874*Ce+1.0609850577107909*He};return ve.alpha!==void 0&&(Xe.alpha=ve.alpha),Xe},Jc=fd,eh=ar(Nt({},Pt),{mode:"rec2020",fromMode:{xyz65:Mf,rgb:ve=>Mf(De(ve))},toMode:{xyz65:Jc,rgb:ve=>ht(Jc(ve))},parse:["rec2020"],serialize:"rec2020"}),Qc=eh,wu=.0037930732552754493,ef=Math.cbrt(wu),Sf=ve=>Math.cbrt(ve)-ef,hd=ve=>{let{r:be,g:Ce,b:He,alpha:Xe}=ke(ve),it=Sf(.3*be+.622*Ce+.078*He+wu),Dt=Sf(.23*be+.692*Ce+.078*He+wu),or=Sf(.2434226892454782*be+.2047674442449682*Ce+.5518098665095535*He+wu),Dr={mode:"xyb",x:(it-Dt)/2,y:(it+Dt)/2,b:or-(it+Dt)/2};return Xe!==void 0&&(Dr.alpha=Xe),Dr},$l=hd,Se=ve=>Math.pow(ve+ef,3),Ie=({x:ve,y:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe=Se(ve+be)-wu,it=Se(be-ve)-wu,Dt=Se(Ce+be)-wu,or=at({r:11.031566904639861*Xe-9.866943908131562*it-.16462299650829934*Dt,g:-3.2541473810744237*Xe+4.418770377582723*it-.16462299650829934*Dt,b:-3.6588512867136815*Xe+2.7129230459360922*it+1.9459282407775895*Dt});return He!==void 0&&(or.alpha=He),or},Ge=Ie,$e={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:Ge},fromMode:{rgb:$l},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:Je,y:Je,b:Je,alpha:{use:Je,fixup:vt}}},st=$e,ot={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:rc,lab:Nu},fromMode:{rgb:kc,lab:Ec},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:Je,y:Je,z:Je,alpha:{use:Je,fixup:vt}}},pt=ot,Vt=ve=>{let{x:be,y:Ce,z:He,alpha:Xe}=ve;be===void 0&&(be=0),Ce===void 0&&(Ce=0),He===void 0&&(He=0);let it={mode:"xyz50",x:1.0479298208405488*be+.0229467933410191*Ce-.0501922295431356*He,y:.0296278156881593*be+.990434484573249*Ce-.0170738250293851*He,z:-.0092430581525912*be+.0150551448965779*Ce+.7518742899580008*He};return Xe!==void 0&&(it.alpha=Xe),it},tr=Vt,Ut=ve=>{let{x:be,y:Ce,z:He,alpha:Xe}=ve;be===void 0&&(be=0),Ce===void 0&&(Ce=0),He===void 0&&(He=0);let it={mode:"xyz65",x:.9554734527042182*be-.0230985368742614*Ce+.0632593086610217*He,y:-.0283697069632081*be+1.0099954580058226*Ce+.021041398966943*He,z:.0123140016883199*be-.0205076964334779*Ce+1.3303659366080753*He};return Xe!==void 0&&(it.alpha=Xe),it},rr=Ut,pr={mode:"xyz65",toMode:{rgb:ht,xyz50:tr},fromMode:{rgb:De,xyz50:rr},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:Je,y:Je,z:Je,alpha:{use:Je,fixup:vt}}},Sr=pr,Rr=({r:ve,g:be,b:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"yiq",y:.29889531*ve+.58662247*be+.11448223*Ce,i:.59597799*ve-.2741761*be-.32180189*Ce,q:.21147017*ve-.52261711*be+.31114694*Ce};return He!==void 0&&(Xe.alpha=He),Xe},Zr=Rr,wi=({y:ve,i:be,q:Ce,alpha:He})=>{ve===void 0&&(ve=0),be===void 0&&(be=0),Ce===void 0&&(Ce=0);let Xe={mode:"rgb",r:ve+.95608445*be+.6208885*Ce,g:ve-.27137664*be-.6486059*Ce,b:ve-1.10561724*be+1.70250126*Ce};return He!==void 0&&(Xe.alpha=He),Xe},qi=wi,Aa={mode:"yiq",toMode:{rgb:qi},fromMode:{rgb:Zr},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:Je,i:Je,q:Je,alpha:{use:Je,fixup:vt}}},un=Aa,gn=(ve,be)=>Math.round(ve*(be=Math.pow(10,be)))/be,Tn=(ve=4)=>be=>typeof be=="number"?gn(be,ve):be,Pn=Tn,Eo=Pn(2),qo=ve=>Math.max(0,Math.min(1,ve||0)),Wn=ve=>Math.round(qo(ve)*255),ls=L("rgb"),ol=L("hsl"),wl=ve=>{if(ve===void 0)return;let be=Wn(ve.r),Ce=Wn(ve.g),He=Wn(ve.b);return"#"+(1<<24|be<<16|Ce<<8|He).toString(16).slice(1)},Vu=ve=>{if(ve===void 0)return;let be=Wn(ve.alpha!==void 0?ve.alpha:1);return wl(ve)+(256|be).toString(16).slice(1)},Pc=ve=>{if(ve===void 0)return;let be=Wn(ve.r),Ce=Wn(ve.g),He=Wn(ve.b);return ve.alpha===void 0||ve.alpha===1?`rgb(${be}, ${Ce}, ${He})`:`rgba(${be}, ${Ce}, ${He}, ${Eo(qo(ve.alpha))})`},dl=ve=>{if(ve===void 0)return;let be=Eo(ve.h||0),Ce=Eo(qo(ve.s)*100)+"%",He=Eo(qo(ve.l)*100)+"%";return ve.alpha===void 0||ve.alpha===1?`hsl(${be}, ${Ce}, ${He})`:`hsla(${be}, ${Ce}, ${He}, ${Eo(qo(ve.alpha))})`},pl=ve=>{let be=z(ve);if(!be)return;let Ce=J(be.mode);if(!Ce.serialize||typeof Ce.serialize=="string"){let He=`color(${Ce.serialize||`--${be.mode}`} `;return Ce.channels.forEach((Xe,it)=>{Xe!=="alpha"&&(He+=(it?" ":"")+(be[Xe]!==void 0?be[Xe]:"none"))}),be.alpha!==void 0&&be.alpha<1&&(He+=` / ${be.alpha}`),He+")"}if(typeof Ce.serialize=="function")return Ce.serialize(be)},Tu=ve=>wl(ls(ve)),nc=ve=>Vu(ls(ve)),oc=ve=>Pc(ls(ve)),sc=ve=>dl(ol(ve)),Ic={normal:(ve,be)=>be,multiply:(ve,be)=>ve*be,screen:(ve,be)=>ve+be-ve*be,"hard-light":(ve,be)=>be<.5?ve*2*be:2*be*(1-ve)-1,overlay:(ve,be)=>ve<.5?be*2*ve:2*ve*(1-be)-1,darken:(ve,be)=>Math.min(ve,be),lighten:(ve,be)=>Math.max(ve,be),"color-dodge":(ve,be)=>ve===0?0:be===1?1:Math.min(1,ve/(1-be)),"color-burn":(ve,be)=>ve===1?1:be===0?0:1-Math.min(1,(1-ve)/be),"soft-light":(ve,be)=>be<.5?ve-(1-2*be)*ve*(1-ve):ve+(2*be-1)*((ve<.25?((16*ve-12)*ve+4)*ve:Math.sqrt(ve))-ve),difference:(ve,be)=>Math.abs(ve-be),exclusion:(ve,be)=>ve+be-2*ve*be},Gu=(ve,be="normal",Ce="rgb")=>{let He=typeof be=="function"?be:Ic[be],Xe=L(Ce),it=J(Ce).channels;return ve.map(or=>{let Dr=Xe(or);return Dr.alpha===void 0&&(Dr.alpha=1),Dr}).reduce((or,Dr)=>{if(or===void 0)return Dr;let vi=Dr.alpha+or.alpha*(1-Dr.alpha);return it.reduce((ai,ei)=>(ei!=="alpha"&&(vi===0?ai[ei]=0:(ai[ei]=Dr.alpha*(1-or.alpha)*Dr[ei]+Dr.alpha*or.alpha*He(or[ei],Dr[ei])+(1-Dr.alpha)*or.alpha*or[ei],ai[ei]=Math.max(0,Math.min(1,ai[ei]/vi)))),ai),{mode:Ce,alpha:vi})})},tf=Gu,th=([ve,be])=>ve+Math.random()*(be-ve),re=ve=>Object.keys(ve).reduce((be,Ce)=>{let He=ve[Ce];return be[Ce]=Array.isArray(He)?He:[He,He],be},{}),he=(ve="rgb",be={})=>{let Ce=J(ve),He=re(be);return Ce.channels.reduce((Xe,it)=>((He.alpha||it!=="alpha")&&(Xe[it]=th(He[it]||Ce.ranges[it])),Xe),{mode:ve})},we=he,Le=(ve,be="rgb",Ce=!1)=>{let He=be?J(be).channels:null,Xe=be?L(be):z;return it=>{let Dt=Xe(it);if(!Dt)return;let or=(He||J(Dt.mode).channels).reduce((vi,ai)=>{let ei=ve(Dt[ai],ai,Dt,be);return ei!==void 0&&!isNaN(ei)&&(vi[ai]=ei),vi},{mode:Dt.mode});if(!Ce)return or;let Dr=z(it);return Dr&&Dr.mode!==or.mode?L(Dr.mode)(or):or}},Re=(ve,be,Ce)=>be!=="alpha"?(ve||0)*(Ce.alpha!==void 0?Ce.alpha:1):ve,Oe=(ve,be,Ce)=>be!=="alpha"&&Ce.alpha!==0?(ve||0)/(Ce.alpha!==void 0?Ce.alpha:1):ve,ut=(ve=1,be=0)=>(Ce,He)=>He!=="alpha"?Ce*ve+be:Ce,et=(ve=1,be=1,Ce=0)=>(He,Xe)=>Xe!=="alpha"?ve*Math.pow(He,be)+Ce:He,_t=ve=>{ve[0]===void 0&&(ve[0]=0),ve[ve.length-1]===void 0&&(ve[ve.length-1]=1);let be=1,Ce,He,Xe,it;for(;bebe=>ve<=0?1:ve>=1?0:Math.pow(be,Math.log(.5)/Math.log(ve)),lr=Rt,sr=ve=>typeof ve=="function",Fr=ve=>ve&&typeof ve=="object",Or=ve=>typeof ve=="number",hr=(ve,be="rgb",Ce,He)=>{let Xe=J(be),it=L(be),Dt=[],or=[],Dr={};ve.forEach(Oi=>{Array.isArray(Oi)?(Dt.push(it(Oi[0])),or.push(Oi[1])):Or(Oi)||sr(Oi)?Dr[or.length]=Oi:(Dt.push(it(Oi)),or.push(void 0))}),Ft(or);let vi=Xe.channels.reduce((Oi,Si)=>{let zi;return Fr(Ce)&&Fr(Ce[Si])&&Ce[Si].fixup?zi=Ce[Si].fixup:Fr(Xe.interpolate[Si])&&Xe.interpolate[Si].fixup?zi=Xe.interpolate[Si].fixup:zi=Vi=>Vi,Oi[Si]=zi(Dt.map(Vi=>Vi[Si])),Oi},{});if(He){let Oi=Dt.map((Si,zi)=>Xe.channels.reduce((Vi,Xi)=>(Vi[Xi]=vi[Xi][zi],Vi),{mode:be}));vi=Xe.channels.reduce((Si,zi)=>(Si[zi]=Oi.map(Vi=>{let Xi=He(Vi[zi],zi,Vi,be);return isNaN(Xi)?void 0:Xi}),Si),{})}let ai=Xe.channels.reduce((Oi,Si)=>{let zi;return sr(Ce)?zi=Ce:Fr(Ce)&&sr(Ce[Si])?zi=Ce[Si]:Fr(Ce)&&Fr(Ce[Si])&&Ce[Si].use?zi=Ce[Si].use:sr(Xe.interpolate[Si])?zi=Xe.interpolate[Si]:Fr(Xe.interpolate[Si])&&(zi=Xe.interpolate[Si].use),Oi[Si]=zi(vi[Si]),Oi},{}),ei=Dt.length-1;return Oi=>{if(Oi=Math.min(Math.max(0,Oi),1),Oi<=or[0])return Dt[0];if(Oi>or[ei])return Dt[ei];let Si=0;for(;or[Si]{let el=ai[xs]($a);return el!==void 0&&(_o[xs]=el),_o},{mode:be})}},wr=(ve,be="rgb",Ce)=>hr(ve,be,Ce),Cr=(ve,be)=>(Ce,He="rgb",Xe)=>{let it=be?Le(be,He):void 0,Dt=hr(Ce,He,Xe,ve);return it?or=>it(Dt(or)):Dt},Nr=Cr(Re,Oe),jr=(ve,be)=>(ve+be)%be,Ar=(ve,be,Ce,He,Xe)=>{let it=Xe*Xe,Dt=it*Xe;return((1-3*Xe+3*it-Dt)*ve+(4-6*it+3*Dt)*be+(1+3*Xe+3*it-3*Dt)*Ce+Dt*He)/6},Ci=ve=>be=>{let Ce=ve.length-1,He=be>=1?Ce-1:Math.max(0,Math.floor(be*Ce));return Ar(He>0?ve[He-1]:2*ve[He]-ve[He+1],ve[He],ve[He+1],Hebe=>{let Ce=ve.length-1,He=Math.floor(be*Ce);return Ar(ve[jr(He-1,ve.length)],ve[jr(He,ve.length)],ve[jr(He+1,ve.length)],ve[jr(He+2,ve.length)],(be-He/Ce)*Ce)},aa=ve=>{let be,Ce=ve.length-1,He=new Array(Ce),Xe=new Array(Ce),it=new Array(Ce);for(He[1]=1/4,Xe[1]=(6*ve[1]-ve[0])/4,be=2;be0&&(it[Ce-1]=Xe[Ce-1]),be=Ce-2;be>0;--be)it[be]=Xe[be]-He[be]*it[be+1];return it},ga=ve=>Ci(aa(ve)),qa=ve=>Gi(aa(ve)),Fa=Math.sign,Nn=Math.min,ka=Math.abs,Sn=ve=>{let be=ve.length-1,Ce=[],He=[],Xe=[];for(let it=0;it0?.5*(ve[it+1]-ve[it-1])*be:void 0),Xe.push(it>0?(Fa(Ce[it-1])+Fa(Ce[it]))*Nn(ka(Ce[it-1]),ka(Ce[it]),.5*ka(He[it])):void 0);return[Ce,He,Xe]},ko=(ve,be,Ce)=>{let He=ve.length-1,Xe=He*He;return it=>{let Dt;it>=1?Dt=He-1:Dt=Math.max(0,Math.floor(it*He));let or=it-Dt/He,Dr=or*or,vi=Dr*or;return(be[Dt]+be[Dt+1]-2*Ce[Dt])*Xe*vi+(3*Ce[Dt]-2*be[Dt]-be[Dt+1])*He*Dr+be[Dt]*or+ve[Dt]}},Vs=ve=>{if(ve.length<3)return Je(ve);let be=ve.length-1,[Ce,,He]=Sn(ve);return He[0]=Ce[0],He[be]=Ce[be-1],ko(ve,He,Ce)},Ho=ve=>{if(ve.length<3)return Je(ve);let be=ve.length-1,[Ce,He,Xe]=Sn(ve);return He[0]=(ve[1]*2-ve[0]*1.5-ve[2]*.5)*be,He[be]=(ve[be]*1.5-ve[be-1]*2+ve[be-2]*.5)*be,Xe[0]=He[0]*Ce[0]<=0?0:ka(He[0])>2*ka(Ce[0])?2*Ce[0]:He[0],Xe[be]=He[be]*Ce[be-1]<=0?0:ka(He[be])>2*ka(Ce[be-1])?2*Ce[be-1]:He[be],ko(ve,Xe,Ce)},fa=ve=>{let be=ve.length-1,[Ce,He,Xe]=Sn(ve);He[0]=.5*(ve[1]-ve[be])*be,He[be]=.5*(ve[0]-ve[be-1])*be;let it=(ve[0]-ve[be])*be,Dt=it;return Xe[0]=(Fa(it)+Fa(Ce[0]))*Nn(ka(it),ka(Ce[0]),.5*ka(He[0])),Xe[be]=(Fa(Ce[be-1])+Fa(Dt))*Nn(ka(Ce[be-1]),ka(Dt),.5*ka(He[be])),ko(ve,Xe,Ce)},jn=(ve=1)=>ve===1?be=>be:be=>Math.pow(be,ve),Gn=jn,Po=(ve=2,be=1)=>{let Ce=Gn(be);if(ve<2)return ve<1?[]:[Ce(.5)];let He=[];for(let Xe=0;Xe{let be={mode:ve.mode,r:Math.max(0,Math.min(ve.r!==void 0?ve.r:0,1)),g:Math.max(0,Math.min(ve.g!==void 0?ve.g:0,1)),b:Math.max(0,Math.min(ve.b!==void 0?ve.b:0,1))};return ve.alpha!==void 0&&(be.alpha=ve.alpha),be},Fl=ve=>Tl(Qs(ve)),su=ve=>ve!==void 0&&(ve.r===void 0||ve.r>=0&&ve.r<=1)&&(ve.g===void 0||ve.g>=0&&ve.g<=1)&&(ve.b===void 0||ve.b>=0&&ve.b<=1);function bt(ve){return su(Qs(ve))}function dr(ve="rgb"){let{gamut:be}=J(ve);if(!be)return He=>!0;let Ce=L(typeof be=="string"?be:ve);return He=>su(Ce(He))}function _r(ve){return ve=z(ve),ve===void 0||bt(ve)?ve:L(ve.mode)(Fl(ve))}function Kr(ve="rgb"){let{gamut:be}=J(ve);if(!be)return it=>z(it);let Ce=typeof be=="string"?be:ve,He=L(Ce),Xe=dr(Ce);return it=>{let Dt=z(it);if(!Dt)return;let or=He(Dt);if(Xe(or))return Dt;let Dr=Tl(or);return Dt.mode===Dr.mode?Dr:L(Dt.mode)(Dr)}}function ci(ve,be="lch",Ce="rgb"){ve=z(ve);let He=Ce==="rgb"?bt:dr(Ce),Xe=Ce==="rgb"?Fl:Kr(Ce);if(ve===void 0||He(ve))return ve;let it=L(ve.mode);ve=L(be)(ve);let Dt=ar(Nt({},ve),{c:0});if(!He(Dt))return it(Xe(Dt));let or=0,Dr=ve.c!==void 0?ve.c:0,vi=J(be).ranges.c,ai=(vi[1]-vi[0])/Math.pow(2,13),ei=Dt.c;for(;Dr-or>ai;)Dt.c=or+(Dr-or)*.5,He(Dt)?(ei=Dt.c,or=Dt.c):Dr=Dt.c;return it(He(Dt)?Dt:ar(Nt({},Dt),{c:ei}))}function yi(ve="rgb",be="oklch",Ce=pa("oklch"),He=.02){let Xe=L(ve),it=J(ve);if(!it.gamut)return ai=>Xe(ai);let Dt=dr(ve),or=Kr(ve),Dr=L(be),{ranges:vi}=J(be);if(!vi.l||!vi.c)throw new Error("LCH-like space expected");return ai=>{if(ai=z(ai),ai===void 0)return;let ei=Nt({},Dr(ai));if(ei.l===void 0&&(ei.l=0),ei.c===void 0&&(ei.c=0),ei.l>=vi.l[1]){let Xi=ar(Nt({},it.white),{mode:ve});return ai.alpha!==void 0&&(Xi.alpha=ai.alpha),Xi}if(ei.l<=vi.l[0]){let Xi=ar(Nt({},it.black),{mode:ve});return ai.alpha!==void 0&&(Xi.alpha=ai.alpha),Xi}if(Dt(ei))return Xe(ei);let Oi=0,Si=ei.c,zi=(vi.c[1]-vi.c[0])/4e3,Vi=or(ei);for(;Si-Oi>zi;)ei.c=(Oi+Si)*.5,Vi=or(ei),Dt(ei)||Ce&&He>0&&Ce(ei,Vi)<=He?Oi=ei.c:Si=ei.c;return Xe(Dt(ei)?ei:Vi)}}var si=(ve,be=pa(),Ce=He=>He)=>{let He=ve.map((Xe,it)=>({color:Ce(Xe),i:it}));return(Xe,it=1,Dt=1/0)=>(isFinite(it)&&(it=Math.max(1,Math.min(it,He.length-1))),He.forEach(or=>{or.d=be(Xe,or.color)}),He.sort((or,Dr)=>or.d-Dr.d).slice(0,it).filter(or=>or.dve[or.i]))},Ni=si,Ji=ve=>Math.max(ve,0),Qi=ve=>Math.max(Math.min(ve,1),0),ra=(ve,be,Ce)=>ve===void 0||be===void 0?void 0:ve+Ce*(be-ve),mn=ve=>{let be=1-Qi(ve);return[.393+.607*be,.769-.769*be,.189-.189*be,0,.349-.349*be,.686+.314*be,.168-.168*be,0,.272-.272*be,.534-.534*be,.131+.869*be,0,0,0,0,1]},Wa=ve=>{let be=Ji(ve);return[.213+.787*be,.715-.715*be,.072-.072*be,0,.213-.213*be,.715+.285*be,.072-.072*be,0,.213-.213*be,.715-.715*be,.072+.928*be,0,0,0,0,1]},xa=ve=>{let be=1-Qi(ve);return[.2126+.7874*be,.7152-.7152*be,.0722-.0722*be,0,.2126-.2126*be,.7152+.2848*be,.0722-.0722*be,0,.2126-.2126*be,.7152-.7152*be,.0722+.9278*be,0,0,0,0,1]},Pi=ve=>{let be=Math.PI*ve/180,Ce=Math.cos(be),He=Math.sin(be);return[.213+Ce*.787-He*.213,.715-Ce*.715-He*.715,.072-Ce*.072+He*.928,0,.213-Ce*.213+He*.143,.715+Ce*.285+He*.14,.072-Ce*.072-He*.283,0,.213-Ce*.213-He*.787,.715-Ce*.715+He*.715,.072+Ce*.928+He*.072,0,0,0,0,1]},Hr=(ve,be,Ce=!1)=>{let He=L(be),Xe=J(be).channels;return it=>{let Dt=He(it);if(!Dt)return;let or={mode:be},Dr,vi=Xe.length;for(let ei=0;ei{let Ce=Ji(ve);return Le(ut(Ce),be,!0)},Yi=(ve=1,be="rgb")=>{let Ce=Ji(ve);return Le(ut(Ce,(1-Ce)/2),be,!0)},la=(ve=1,be="rgb")=>Hr(mn(ve),be,!0),Ui=(ve=1,be="rgb")=>Hr(Wa(ve),be,!0),Da=(ve=1,be="rgb")=>Hr(xa(ve),be,!0),wa=(ve=1,be="rgb")=>{let Ce=Qi(ve);return Le((He,Xe)=>Xe==="alpha"?He:ra(Ce,1-Ce,He),be,!0)},bn=(ve=0,be="rgb")=>Hr(Pi(ve),be,!0),ji=L("rgb"),Ii=[[1,0,-0,0,1,0,-0,-0,1],[.856167,.182038,-.038205,.029342,.955115,.015544,-.00288,-.001563,1.004443],[.734766,.334872,-.069637,.05184,.919198,.028963,-.004928,-.004209,1.009137],[.630323,.465641,-.095964,.069181,.890046,.040773,-.006308,-.007724,1.014032],[.539009,.579343,-.118352,.082546,.866121,.051332,-.007136,-.011959,1.019095],[.458064,.679578,-.137642,.092785,.846313,.060902,-.007494,-.016807,1.024301],[.38545,.769005,-.154455,.100526,.829802,.069673,-.007442,-.02219,1.029632],[.319627,.849633,-.169261,.106241,.815969,.07779,-.007025,-.028051,1.035076],[.259411,.923008,-.18242,.110296,.80434,.085364,-.006276,-.034346,1.040622],[.203876,.990338,-.194214,.112975,.794542,.092483,-.005222,-.041043,1.046265],[.152286,1.052583,-.204868,.114503,.786281,.099216,-.003882,-.048116,1.051998]],Va=[[1,0,-0,0,1,0,-0,-0,1],[.866435,.177704,-.044139,.049567,.939063,.01137,-.003453,.007233,.99622],[.760729,.319078,-.079807,.090568,.889315,.020117,-.006027,.013325,.992702],[.675425,.43385,-.109275,.125303,.847755,.026942,-.00795,.018572,.989378],[.605511,.52856,-.134071,.155318,.812366,.032316,-.009376,.023176,.9862],[.547494,.607765,-.155259,.181692,.781742,.036566,-.01041,.027275,.983136],[.498864,.674741,-.173604,.205199,.754872,.039929,-.011131,.030969,.980162],[.457771,.731899,-.18967,.226409,.731012,.042579,-.011595,.034333,.977261],[.422823,.781057,-.203881,.245752,.709602,.044646,-.011843,.037423,.974421],[.392952,.82361,-.216562,.263559,.69021,.046232,-.01191,.040281,.97163],[.367322,.860646,-.227968,.280085,.672501,.047413,-.01182,.04294,.968881]],_a=[[1,0,-0,0,1,0,-0,-0,1],[.92667,.092514,-.019184,.021191,.964503,.014306,.008437,.054813,.93675],[.89572,.13333,-.02905,.029997,.9454,.024603,.013027,.104707,.882266],[.905871,.127791,-.033662,.026856,.941251,.031893,.01341,.148296,.838294],[.948035,.08949,-.037526,.014364,.946792,.038844,.010853,.193991,.795156],[1.017277,.027029,-.044306,-.006113,.958479,.047634,.006379,.248708,.744913],[1.104996,-.046633,-.058363,-.032137,.971635,.060503,.001336,.317922,.680742],[1.193214,-.109812,-.083402,-.058496,.97941,.079086,-.002346,.403492,.598854],[1.257728,-.139648,-.118081,-.078003,.975409,.102594,-.003316,.501214,.502102],[1.278864,-.125333,-.153531,-.084748,.957674,.127074,-989e-6,.601151,.399838],[1.255528,-.076749,-.178779,-.078411,.930809,.147602,.004733,.691367,.3039]],ca=(ve,be)=>{let Ce=Math.max(0,Math.min(1,be)),He=Math.round(Ce/.1),Xe=Math.round(Ce%.1),it=ve[He];if(Xe>0&&Hege(it[Dr],Dt[Dr],Xe))}return Dt=>{let or=z(Dt);if(or===void 0)return;let{r:Dr,g:vi,b:ai}=ji(or),ei={mode:"rgb",r:it[0]*Dr+it[1]*vi+it[2]*ai,g:it[3]*Dr+it[4]*vi+it[5]*ai,b:it[6]*Dr+it[7]*vi+it[8]*ai};return or.alpha!==void 0&&(ei.alpha=or.alpha),L(or.mode)(ei)}},va=(ve=1)=>ca(Ii,ve),Ga=(ve=1)=>ca(Va,ve),wn=(ve=1)=>ca(_a,ve),Hn=ve=>ve*ve*(3-2*ve),Ca=ve=>.5-Math.sin(Math.asin(1-2*ve)/3),en=ve=>ve*ve*ve*(ve*(ve*6-15)+10),Un=en,qn=ve=>(1-Math.cos(ve*Math.PI))/2,yo=qn;function Gs(ve){let be=L("lrgb")(ve);return .2126*be.r+.7152*be.g+.0722*be.b}function Wl(ve,be){let Ce=Gs(ve),He=Gs(be);return(Math.max(Ce,He)+.05)/(Math.min(Ce,He)+.05)}var Co=Z(dt),Rc=Z(Yt),ys=Z(ho),Hu=Z(lo),lc=Z(jo),zc=Z(nl),Pl=Z(On),Il=Z(yu),Yl=Z(Ah),oo=Z(Bu),lu=Z(Ou),Ms=Z(ql),uc=Z(jd),Bc=Z(Wc),Oc=Z(bf),Zn=Z(ou),Bo=Z(Fh),Os=Z(Af),gr=Z(rn),hi=Z(Dn),di=Z($o),sn=Z(Go),Io=Z(bu),_s=Z(Qf),an=Z(Qc),cr=Z(Pt),xr=Z(st),kr=Z(pt),fi=Z(Sr),Ti=Z(un)}}),Na=de({"src/plot_api/plot_config.js"(e,r){"use strict";var t={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:"https://cloud.plotly.com/newchart"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:500,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},displayNotifier:{valType:"boolean",dflt:!0},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!0},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},i={};function a(o,s){for(var l in o){var n=o[l];n.valType?s[l]=n.dflt:(s[l]||(s[l]={}),a(n,s[l]))}}a(t,i),r.exports={configAttributes:t,dfltConfig:i}}}),xn=de({"src/lib/notifier.js"(e,r){"use strict";var t=Yr(),i=da(),a=[];r.exports=function(o,s,l){var n;if(((n=l?._context)==null?void 0:n.displayNotifier)===!1||a.indexOf(o)!==-1)return;a.push(o);var u=1e3;i(s)?u=s:s==="long"&&(u=3e3);var c=t.select("body").selectAll(".plotly-notifier").data([0]);c.enter().append("div").classed("plotly-notifier",!0);var f=c.selectAll(".notifier-note").data(a);function h(d){d.duration(700).style("opacity",0).each("end",function(p){var g=a.indexOf(p);g!==-1&&a.splice(g,1),t.select(this).remove()})}f.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(d){var p=t.select(this);p.append("button").classed("notifier-close",!0).html("×").on("click",function(){p.transition().call(h)});for(var g=p.append("p"),m=d.split(//g),y=0;y1){var s=["LOG:"];for(o=0;o1){var l=[];for(o=0;o"),"long")}},a.warn=function(){var o;if(t.logging>0){var s=["WARN:"];for(o=0;o0){var l=[];for(o=0;o"),"stick")}},a.error=function(){var o;if(t.logging>0){var s=["ERROR:"];for(o=0;o0){var l=[];for(o=0;o"),"stick")}}}}),Jo=de({"src/components/color/attributes.js"(e){"use strict";e.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],e.defaultLine="#444",e.lightLine="#eee",e.background="#fff",e.borderLine="#BEC8D9",e.lightFraction=1e3/11}}),ta=de({"src/components/color/index.js"(e,r){"use strict";var{converter:t,formatHex:i,formatRgb:a,wcagContrast:o,wcagLuminance:s}=Ri(),{isArrayOrTypedArray:l}=Do(),{warn:n}=Xo(),{background:u,defaultLine:c,defaults:f,lightLine:h}=Jo(),d=t("rgb"),p=t("hsl"),g=q=>{if(typeof q!="string")return;let Y=q.trim().toLowerCase();if(!/^[0-9a-f]+$/.test(Y))try{return d(Y)}catch{return}},m=q=>q>0?q>1?1:q:0,y={mode:"rgb",r:0,g:0,b:0,alpha:1},_=q=>Math.round(q*255e6)/255e6,v=q=>ar(Nt({},q),{r:_(q.r),g:_(q.g),b:_(q.b)}),x=q=>a(v(q)),S=q=>i(v(q)),M=q=>{var Y,K,te,ne;return typeof q=="string"?`"${q}"`:l(q)?`${(K=(Y=q.constructor)==null?void 0:Y.name)!=null?K:"Array"}(${q.length})`:typeof q=="object"?(ne=(te=q.constructor)==null?void 0:te.name)!=null?ne:"Object":`${typeof q} ${q}`},C=(q,Y)=>{var K;let te=g(q);return te?((K=te.alpha)!=null||(te.alpha=1),te):(!Y&&q!=null&&n(`Invalid color specifier: ${M(q)}. Defaulting to "#000"`),y)},w=q=>x(ar(Nt({},C(q)),{alpha:1})),k=q=>q?C(q).alpha:0,A=q=>l(q)&&q.length>2&&Number.isFinite(q[0])&&Number.isFinite(q[1])&&Number.isFinite(q[2]),b=q=>{let[Y,K,te,ne]=q,se=Math.max(Y,K,te)>1?1/255:1,le=ne??1;return{mode:"rgb",r:Y*se,g:K*se,b:te*se,alpha:le>1?le/255:le}},E=(q,Y)=>{let K=A(q)?b(q):C(q,!0),te=[m(K.r),m(K.g),m(K.b),m(K.alpha)];return Y==="uint8"||Y==="uint8_clamped"?Uint8Array.from(te,ne=>Math.round(ne*255)):Y==="float32"?Float32Array.from(te):Y==="float64"?Float64Array.from(te):te},T=(q,Y)=>x(ar(Nt({},C(q)),{alpha:m(Y)})),F=(q,Y)=>{let K=C(q),te=K.alpha;if(te===1)return x(K);let ne=C(Y||u),se=ne.alpha,le=(ce,pe)=>(se===1?pe:1-se+pe*se)*(1-te)+ce*te;return x({mode:"rgb",r:le(K.r,ne.r),g:le(K.g,ne.g),b:le(K.b,ne.b)})},D=(q,Y,K)=>{let te=C(q),ne=C(Y),se=(le,ce)=>K*le+(1-K)*ce;return x({mode:"rgb",r:se(te.r,ne.r),g:se(te.g,ne.g),b:se(te.b,ne.b)})},R=(q,Y)=>{let K=C(q),te=p(K)||{mode:"hsl",h:0,s:0,l:0};return x(d(ar(Nt({},te),{l:m((te.l*100+Y)/100),alpha:K.alpha})))},P=(q,Y)=>o(C(q),C(Y)),z=q=>P(q,u)>P(q,c),I=x(C(u)),L=x(C(c)),B=(q,Y,K)=>(C(q).alpha!==1&&(q=F(q,u)),z(q)?Y?R(q,Y):I:K?R(q,-K):L),O=(q,Y)=>{q.style({stroke:w(Y),"stroke-opacity":C(Y).alpha})},G=(q,Y)=>{q.style({fill:w(Y),"fill-opacity":C(Y).alpha})},W=(q,Y)=>!!(q&&Y&&w(q)===w(Y)),X=q=>g(q)!==void 0,Z=(q,Y)=>{Y=Y===0?0:Y||10;let K=C(q),te=Y/100;return x(ar(Nt({},K),{r:m(K.r+te),g:m(K.g+te),b:m(K.b+te)}))},J=(q,Y,K)=>{let te=C(q),ne=C(Y),se=K/100,le=ne.alpha-te.alpha,ce=2*se-1,pe=((ce*le===-1?ce:(ce+le)/(1+ce*le))+1)/2,xe=1-pe,ye=(fe,ae)=>xe*fe+pe*ae;return x({mode:"rgb",r:ye(te.r,ne.r),g:ye(te.g,ne.g),b:ye(te.b,ne.b),alpha:te.alpha*(1-se)+ne.alpha*se})},N=(q,Y=["#000","#fff"])=>{let K,te=-1/0;for(let ne of Y){let se=P(q,ne);se>te&&(te=se,K=x(C(ne)))}return K},H=q=>x(C(q)),$=q=>S(C(q)).toUpperCase(),U=q=>{let Y=C(q);return[m(Y.r)*255,m(Y.g)*255,m(Y.b)*255,m(Y.alpha)]},V=([q,Y,K,te])=>x({mode:"rgb",r:q/255,g:Y/255,b:K/255,alpha:te}),j=q=>{let Y=C(q);return s({mode:"rgb",r:m(Y.r),g:m(Y.g),b:m(Y.b)})};r.exports={addOpacity:T,adjustLightness:R,background:u,brighten:Z,combine:F,contrast:B,defaultLine:c,defaults:f,equals:W,fill:G,hexString:$,interpolate:D,isChannelArray:A,isDark:z,isValid:X,lightLine:h,luminosity:j,mix:J,mostReadable:N,normalize:E,opacity:k,parse:C,rgb:w,rgbaArray:U,rgbaArrayToString:V,rgbaString:H,stroke:O,wcagContrast:P}}}),mv=de({"src/components/colorscale/scales.js"(e,r){"use strict";var t=ta(),i={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},a=i.RdBu;function o(n,u){if(u||(u=a),!n)return u;function c(){try{n=i[n]||JSON.parse(n)}catch{n=u}}return typeof n=="string"&&(c(),typeof n=="string"&&c()),s(n)?n:u}function s(n){var u=0;if(!Array.isArray(n)||n.length<2||!n[0]||!n[n.length-1]||+n[0][0]!=0||+n[n.length-1][0]!=1)return!1;for(var c=0;cpU});function pU(e,r="",t,i){let a=r+(t?"":"$"),o=i===!1?"":"^";return e==="xy"?new RegExp(o+"x"+wy+"y"+wy+a):new RegExp(o+e+wy+a)}var wy,l1=Ir({"src/lib/regex.ts"(){"use strict";wy="([2-9]|[1-9][0-9]+)?"}}),vU=de({"src/lib/coerce.js"(e){"use strict";var r=da(),t=fn().extendFlat,i=ri(),a=mv(),o=ta(),s=Mp().DESELECTDIM,l=sl(),n=(l1(),ti(gv)).counter,u=(c0(),ti(Ap)).modHalf,c=Do().isArrayOrTypedArray,f=Do().isTypedArraySpec,h=Do().decodeTypedArraySpec;e.valObjectMeta={data_array:{coerceFunction:function(p,g,m){g.set(c(p)?p:f(p)?h(p):m)}},enumerated:{coerceFunction:function(p,g,m,y){y.coerceNumber&&(p=+p),y.values.indexOf(p)===-1?g.set(m):g.set(p)},validateFunction:function(p,g){g.coerceNumber&&(p=+p);for(var m=g.values,y=0;yv===!0||v===!1;_(p)||y.arrayOk&&Array.isArray(p)&&p.length>0&&p.every(_)?g.set(p):g.set(m)}},number:{coerceFunction:function(p,g,m,y){f(p)&&(p=h(p)),!r(p)||y.min!==void 0&&py.max?g.set(m):g.set(+p)}},integer:{coerceFunction:function(p,g,m,y){if((y.extras||[]).indexOf(p)!==-1){g.set(p);return}f(p)&&(p=h(p)),p%1||!r(p)||y.min!==void 0&&py.max?g.set(m):g.set(+p)}},string:{coerceFunction:function(p,g,m,y){if(typeof p!="string"){var _=typeof p=="number";y.strict===!0||!_?g.set(m):g.set(String(p))}else y.noBlank&&!p?g.set(m):g.set(p)}},color:{coerceFunction:function(p,g,m){f(p)&&(p=h(p)),o.isValid(p)?g.set(p):g.set(m)}},colorlist:{coerceFunction:function(p,g,m){!Array.isArray(p)||!p.length?g.set(m):p.every(y=>o.isValid(y))?g.set(p):g.set(m)}},colorscale:{coerceFunction:function(p,g,m){g.set(a.get(p,m))}},angle:{coerceFunction:function(p,g,m){f(p)&&(p=h(p)),p==="auto"?g.set("auto"):r(p)?g.set(u(+p,360)):g.set(m)}},subplotid:{coerceFunction:function(p,g,m,y){var _=y.regex||n(m);let v=x=>typeof x=="string"&&_.test(x);v(p)||y.arrayOk&&c(p)&&p.length>0&&p.every(v)?g.set(p):g.set(m)},validateFunction:function(p,g){var m=g.dflt;return p===m?!0:typeof p!="string"?!1:!!n(m).test(p)}},flaglist:{coerceFunction:function(p,g,m,y){if((y.extras||[]).indexOf(p)!==-1){g.set(p);return}if(typeof p!="string"){g.set(m);return}for(var _=p.split("+"),v=0;v<_.length;){var x=_[v];y.flags.indexOf(x)===-1||_.indexOf(x)Nt({valType:"string",dflt:"",editType:o},s!==!1?{arrayOk:!0}:{}),e.texttemplateAttrs=({editType:o="calc",arrayOk:s}={},l={})=>Nt({valType:"string",dflt:"",editType:o},s!==!1?{arrayOk:!0}:{}),e.shapeTexttemplateAttrs=({editType:o="arraydraw",newshape:s}={},l={})=>({valType:"string",dflt:"",editType:o}),e.templatefallbackAttrs=({editType:o="none"}={})=>({valType:"any",dflt:"-",editType:o})}}),_w=de({"src/components/shapes/label_texttemplate.js"(e,r){"use strict";function t(M,C){return C?C.d2l(M):M}function i(M,C){return C?C.l2d(M):M}function a(M){return M.x0}function o(M){return M.x1}function s(M){return M.y0}function l(M){return M.y1}function n(M){return M.x0shift||0}function u(M){return M.x1shift||0}function c(M){return M.y0shift||0}function f(M){return M.y1shift||0}function h(M,C){return t(M.x1,C)+u(M)-t(M.x0,C)-n(M)}function d(M,C,w){return t(M.y1,w)+f(M)-t(M.y0,w)-c(M)}function p(M,C){return Math.abs(h(M,C))}function g(M,C,w){return Math.abs(d(M,C,w))}function m(M,C,w){return M.type!=="line"?void 0:Math.sqrt(Math.pow(h(M,C),2)+Math.pow(d(M,C,w),2))}function y(M,C){return i((t(M.x1,C)+u(M)+t(M.x0,C)+n(M))/2,C)}function _(M,C,w){return i((t(M.y1,w)+f(M)+t(M.y0,w)+c(M))/2,w)}function v(M,C,w){return M.type!=="line"?void 0:d(M,C,w)/h(M,C)}var x=["x0","x1","y0","y1","dy","height","ycenter"],S=["x0","x1","y0","y1","dx","width","xcenter"];r.exports={x0:a,x1:o,y0:s,y1:l,slope:v,dx:h,dy:d,width:p,height:g,length:m,xcenter:y,ycenter:_,simpleXVariables:x,simpleYVariables:S}}}),GU=de({"src/components/shapes/draw_newshape/attributes.js"(e,r){"use strict";var t=Is().overrideAll,i=ri(),a=us(),o=fu().dash,s=fn().extendFlat,{shapeTexttemplateAttrs:l,templatefallbackAttrs:n}=Vo(),u=_w();r.exports=t({newshape:{visible:s({},i.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:s({},i.legend,{}),legendgroup:s({},i.legendgroup,{}),legendgrouptitle:{text:s({},i.legendgrouptitle.text,{}),font:a({})},legendrank:s({},i.legendrank,{}),legendwidth:s({},i.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:s({},o,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:s({},i.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:l({newshape:!0},{keys:Object.keys(u)}),texttemplatefallback:n({editType:"arraydraw"}),font:a({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),HU=de({"src/components/selections/draw_newselection/attributes.js"(e,r){"use strict";var t=fu().dash,i=fn().extendFlat;r.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},t,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),xw=de({"src/plots/pad_attributes.js"(e,r){"use strict";r.exports=function(t){var i=t.editType;return{t:{valType:"number",dflt:0,editType:i},r:{valType:"number",dflt:0,editType:i},b:{valType:"number",dflt:0,editType:i},l:{valType:"number",dflt:0,editType:i},editType:i}}}}),u1=de({"src/plots/layout_attributes.js"(e,r){"use strict";var t=us(),i=Ay(),a=Jo(),o=GU(),s=HU(),l=xw(),n=fn().extendFlat,u=t({editType:"calc"});u.family.dflt='"Open Sans", verdana, arial, sans-serif',u.size.dflt=12,u.color.dflt=a.defaultLine,r.exports={font:u,title:{text:{valType:"string",editType:"layoutstyle"},font:t({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:t({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:n(l({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:a.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:a.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:a.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:o.newshape,activeshape:o.activeshape,newselection:s.newselection,activeselection:s.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:n({},i.transition,{editType:"none"})}}}),$U=de({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("9f215cf04c5486422605d13261cb87401f4e7763b6296af81e98efbc0130da53")){var e=document.createElement("style");e.id="9f215cf04c5486422605d13261cb87401f4e7763b6296af81e98efbc0130da53",e.textContent='.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media (hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22none%22%20stroke%3D%22%23333%22%20viewBox%3D%220%200%2022%2022%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M17.5%2011c0%204.819-3.02%208.5-6.5%208.5S4.5%2015.819%204.5%2011%207.52%202.5%2011%202.5s6.5%203.681%206.5%208.5Z%22%2F%3E%3Cpath%20d%3D%22M13.5%2011c0%202.447-.331%204.64-.853%206.206-.262.785-.562%201.384-.872%201.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831%2015.64%208.5%2013.446%208.5%2011s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872%201.777.522%201.565.853%203.76.853%206.206Z%22%2F%3E%3Cpath%20d%3D%22M11%207.5c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138q.07-.058.224-.138c.299-.151.763-.302%201.379-.434C7.378%205.666%209.091%205.5%2011%205.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0%209c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138%201.3%201.3%200%200%201%20.224-.138c.299-.151.763-.302%201.379-.434C7.378%2014.666%209.091%2014.5%2011%2014.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138a1.3%201.3%200%200%201-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0-4c-2.46%200-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5%201.5%200%200%201-.39-.272.3.3%200%200%201-.047-.064.3.3%200%200%201%20.048-.064c.066-.073.189-.167.389-.272.399-.21%201.009-.413%201.805-.59C6.328%209.722%208.54%209.5%2011%209.5s4.672.222%206.256.574c.795.177%201.405.38%201.804.59.2.105.323.2.39.272a.3.3%200%200%201%20.047.064.3.3%200%200%201-.048.064%201.4%201.4%200%200%201-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0%20.018v.002zm17.002.002v-.002zm0-.018v-.002z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22none%22%20stroke%3D%22%2333b5e5%22%20viewBox%3D%220%200%2022%2022%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M17.5%2011c0%204.819-3.02%208.5-6.5%208.5S4.5%2015.819%204.5%2011%207.52%202.5%2011%202.5s6.5%203.681%206.5%208.5Z%22%2F%3E%3Cpath%20d%3D%22M13.5%2011c0%202.447-.331%204.64-.853%206.206-.262.785-.562%201.384-.872%201.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831%2015.64%208.5%2013.446%208.5%2011s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872%201.777.522%201.565.853%203.76.853%206.206Z%22%2F%3E%3Cpath%20d%3D%22M11%207.5c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138q.07-.058.224-.138c.299-.151.763-.302%201.379-.434C7.378%205.666%209.091%205.5%2011%205.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0%209c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138%201.3%201.3%200%200%201%20.224-.138c.299-.151.763-.302%201.379-.434C7.378%2014.666%209.091%2014.5%2011%2014.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138a1.3%201.3%200%200%201-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0-4c-2.46%200-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5%201.5%200%200%201-.39-.272.3.3%200%200%201-.047-.064.3.3%200%200%201%20.048-.064c.066-.073.189-.167.389-.272.399-.21%201.009-.413%201.805-.59C6.328%209.722%208.54%209.5%2011%209.5s4.672.222%206.256.574c.795.177%201.405.38%201.804.59.2.105.323.2.39.272a.3.3%200%200%201%20.047.064.3.3%200%200%201-.048.064%201.4%201.4%200%200%201-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0%20.018v.002zm17.002.002v-.002zm0-.018v-.002z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cpath%20d%3D%22m1.754%2013.406%204.453-4.851%203.09%203.09%203.281%203.277.969-.969-3.309-3.312%203.844-4.121%206.148%206.886h1.082v-.855l-7.207-8.07-4.84%205.187L6.169%206.57l-5.48%205.965v.871ZM.688%2016.844h20.625v1.375H.688Zm0%200%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cpath%20d%3D%22m1.754%2013.406%204.453-4.851%203.09%203.09%203.281%203.277.969-.969-3.309-3.312%203.844-4.121%206.148%206.886h1.082v-.855l-7.207-8.07-4.84%205.187L6.169%206.57l-5.48%205.965v.871ZM.688%2016.844h20.625v1.375H.688Zm0%200%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23aaa%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e58978%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e54e33%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23999%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e58978%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e54e33%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23666%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@media (prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:rgba(0,0,0,.4);position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}',document.head.appendChild(e)}})()}}),Sa=de({"src/registry.js"(e){"use strict";var r=Xo(),t=gw(),i=fE(),a=Ty().addStyleRule,o=fn(),s=ri(),l=u1(),n=o.extendFlat,u=o.extendDeepAll;e.modules={},e.allCategories={},e.allTypes=[],e.subplotsRegistry={},e.componentsRegistry={},e.layoutArrayContainers=[],e.layoutArrayRegexes=[],e.traceLayoutAttributes={},e.localeRegistry={},e.apiMethodRegistry={},e.collectableSubplotTypes=null,e.register=function(v){if(e.collectableSubplotTypes=null,v)v&&!Array.isArray(v)&&(v=[v]);else throw new Error("No argument passed to Plotly.register.");for(var x=0;x=v&&P<=x?P:s}if(typeof P!="string"&&typeof P!="number")return s;P=String(P);var O=y(z),G=P.charAt(0);O&&(G==="G"||G==="g")&&(P=P.slice(1),z="");var W=O&&z.slice(0,7)==="chinese",X=P.match(W?g:p);if(!X)return s;var Z=X[1],J=X[3]||"1",N=Number(X[5]||1),H=Number(X[7]||0),$=Number(X[9]||0),U=Number(X[11]||0);if(O){if(Z.length===2)return s;Z=Number(Z);var V;try{var j=h.getComponentMethod("calendars","getCal")(z);if(W){var q=J.charAt(J.length-1)==="i";J=parseInt(J,10),V=j.newDate(Z,j.toMonthIndex(Z,J,q),N)}else V=j.newDate(Z,Number(J),N)}catch{return s}return V?(V.toJD()-f)*l+H*n+$*u+U*c:s}Z.length===2?Z=(Number(Z)+2e3-m)%100+m:Z=Number(Z),J-=1;var Y=new Date(Date.UTC(2e3,J,N,H,$));return Y.setUTCFullYear(Z),Y.getUTCMonth()!==J||Y.getUTCDate()!==N?s:Y.getTime()+U*c},v=e.MIN_MS=e.dateTime2ms("-9999"),x=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(P,z){return e.dateTime2ms(P,z)!==s};function S(P,z){return String(P+Math.pow(10,z)).slice(1)}var M=90*l,C=3*n,w=5*u;e.ms2DateTime=function(P,z,I){if(typeof P!="number"||!(P>=v&&P<=x))return s;z||(z=0);var L=Math.floor(a(P+.05,1)*10),B=Math.round(P-L/10),O,G,W,X,Z,J;if(y(I)){var N=Math.floor(B/l)+f,H=Math.floor(a(P,l));try{O=h.getComponentMethod("calendars","getCal")(I).fromJD(N).formatDate("yyyy-mm-dd")}catch{O=d("G%Y-%m-%d")(new Date(B))}if(O.charAt(0)==="-")for(;O.length<11;)O="-0"+O.slice(1);else for(;O.length<10;)O="0"+O;G=z=v+l&&P<=x-l))return s;var z=Math.floor(a(P+.05,1)*10),I=new Date(Math.round(P-z/10)),L=r("%Y-%m-%d")(I),B=I.getHours(),O=I.getMinutes(),G=I.getSeconds(),W=I.getUTCMilliseconds()*10+z;return k(L,B,O,G,W)};function k(P,z,I,L,B){if((z||I||L||B)&&(P+=" "+S(z,2)+":"+S(I,2),(L||B)&&(P+=":"+S(L,2),B))){for(var O=4;B%10===0;)O-=1,B/=10;P+="."+S(B,O)}return P}e.cleanDate=function(P,z,I){if(P===s)return z;if(e.isJSDate(P)||typeof P=="number"&&isFinite(P)){if(y(I))return i.error("JS Dates and milliseconds are incompatible with world calendars",P),z;if(P=e.ms2DateTimeLocal(+P),!P&&z!==void 0)return z}else if(!e.isDateTime(P,I))return i.error("unrecognized date",P),z;return P};var A=/%\d?f/g,b=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function T(P,z,I,L){P=P.replace(A,function(O){var G=Math.min(+O.charAt(1)||6,6),W=(z/1e3%1+2).toFixed(G).slice(2).replace(/0+$/,"")||"0";return W});var B=new Date(Math.floor(z+.05));if(P=P.replace(b,function(){return E[I("%q")(B)]}),y(L))try{P=h.getComponentMethod("calendars","worldCalFmt")(P,z,L)}catch{return"Invalid"}return I(P)(B)}var F=[59,59.9,59.99,59.999,59.9999];function D(P,z){var I=a(P+.05,l),L=S(Math.floor(I/n),2)+":"+S(a(Math.floor(I/u),60),2);if(z!=="M"){t(z)||(z=0);var B=Math.min(a(P/c,60),F[z]),O=(100+B).toFixed(z).slice(1);z>0&&(O=O.replace(/0+$/,"").replace(/[\.]$/,"")),L+=":"+O}return L}e.formatDate=function(P,z,I,L,B,O){if(B=y(B)&&B,!z)if(I==="y")z=O.year;else if(I==="m")z=O.month;else if(I==="d")z=O.dayMonth+` `+O.year;else return D(P,I)+` -`+T(O.dayMonthYear,P,L,B);return T(z,P,L,B)};var R=3*l;e.incrementMonth=function(P,z,I){I=y(I)&&I;var L=a(P,l);if(P=Math.round(P-L),I)try{var B=Math.round(P/l)+f,O=h.getComponentMethod("calendars","getCal")(I),G=O.fromJD(B);return z%12?O.add(G,z,"m"):O.add(G,z/12,"y"),(G.toJD()-f)*l+L}catch{i.error("invalid ms "+P+" in calendar "+I)}var W=new Date(P+R);return W.setUTCMonth(W.getUTCMonth()+z)+L-R},e.findExactDates=function(P,z){for(var I=0,L=0,B=0,O=0,G,W,X=y(z)&&h.getComponentMethod("calendars","getCal")(z),Z=0;Z1?(f[p-1]-f[0])/(p-1):1,y,_;for(m>=0?_=h?s:l:_=h?u:n,c+=m*o*(h?-1:1)*(m>=0?1:-1);d90&&t.log("Long binary search..."),d-1};function s(c,f){return cf}function u(c,f){return c>=f}e.sorterAsc=function(c,f){return c-f},e.sorterDes=function(c,f){return f-c},e.distinctVals=function(c){var f=c.slice();f.sort(e.sorterAsc);var h;for(h=f.length-1;h>-1&&f[h]===a;h--);for(var d=f[h]-f[0]||1,p=d/(h||1)/1e4,g=[],m,y=0;y<=h;y++){var _=f[y],v=_-m;m===void 0?(g.push(_),m=_):v>p&&(d=Math.min(d,v),g.push(_),m=_)}return{vals:g,minDiff:d}},e.roundUp=function(c,f,h){for(var d=0,p=f.length-1,g,m=0,y=h?0:1,_=h?1:0,v=h?Math.ceil:Math.floor;d0&&(d=1),h&&d)return c.sort(f)}return d?c:c.reverse()},e.findIndexOfMin=function(c,f){f=f||i;for(var h=1/0,d,p=0;pvE});function YU(e){return Object.keys(e).sort()}var vE,gv=Ir({"src/lib/sort_object_keys.ts"(){"use strict";vE=YU}}),XU=de({"src/lib/stats.js"(e){"use strict";var r=da(),t=Do().isArrayOrTypedArray;e.aggNums=function(i,a,o,s){var l,n;if((!s||s>o.length)&&(s=o.length),r(a)||(a=!1),t(o[0])){for(n=new Array(s),l=0;li.length-1)return i[i.length-1];var o=a%1;return o*i[Math.ceil(a)]+(1-o)*i[Math.floor(a)]}}}),ZU=de({"src/lib/angles.js"(e,r){"use strict";var t=(u0(),ti(Tp)),i=t.mod,a=t.modHalf,o=Math.PI,s=2*o;function l(_){return _/180*o}function n(_){return _/o*180}function u(_){return Math.abs(_[1]-_[0])>s-1e-14}function c(_,v){return a(v-_,s)}function f(_,v){return Math.abs(c(_,v))}function h(_,v){if(u(v))return!0;var x,S;v[0]S&&(S+=s);var M=i(_,s),C=M+s;return M>=x&&M<=S||C>=x&&C<=S}function d(_,v,x,S){if(!h(v,S))return!1;var M,C;return x[0]=M&&_<=C}function p(_,v,x,S,M,C,w){M=M||0,C=C||0;var k=u([x,S]),A,b,E,T,F;k?(A=0,b=o,E=s):x1/3&&t.x<2/3},e.isRightAnchor=function(t){return t.xanchor==="right"||t.xanchor==="auto"&&t.x>=2/3},e.isTopAnchor=function(t){return t.yanchor==="top"||t.yanchor==="auto"&&t.y>=2/3},e.isMiddleAnchor=function(t){return t.yanchor==="middle"||t.yanchor==="auto"&&t.y>1/3&&t.y<2/3},e.isBottomAnchor=function(t){return t.yanchor==="bottom"||t.yanchor==="auto"&&t.y<=1/3}}}),JU=de({"src/lib/geometry2d.js"(e){"use strict";var r=(u0(),ti(Tp)).mod;e.segmentsIntersect=t;function t(l,n,u,c,f,h,d,p){var g=u-l,m=f-l,y=d-f,_=c-n,v=h-n,x=p-h,S=g*x-y*_;if(S===0)return null;var M=(m*x-y*v)/S,C=(m*_-g*v)/S;return C<0||C>1||M<0||M>1?null:{x:l+g*M,y:n+_*M}}e.segmentDistance=function(n,u,c,f,h,d,p,g){if(t(n,u,c,f,h,d,p,g))return 0;var m=c-n,y=f-u,_=p-h,v=g-d,x=m*m+y*y,S=_*_+v*v,M=Math.min(i(m,y,x,h-n,d-u),i(m,y,x,p-n,g-u),i(_,v,S,n-h,u-d),i(_,v,S,c-h,f-d));return Math.sqrt(M)};function i(l,n,u,c,f){var h=c*l+f*n;if(h<0)return c*c+f*f;if(h>u){var d=c-l,p=f-n;return d*d+p*p}else{var g=c*n-f*l;return g*g/u}}var a,o,s;e.getTextLocation=function(n,u,c,f){if((n!==o||f!==s)&&(a={},o=n,s=f),a[c])return a[c];var h=n.getPointAtLength(r(c-f/2,u)),d=n.getPointAtLength(r(c+f/2,u)),p=Math.atan((d.y-h.y)/(d.x-h.x)),g=n.getPointAtLength(r(c,u)),m=(g.x*4+h.x+d.x)/6,y=(g.y*4+h.y+d.y)/6,_={x:m,y,theta:p};return a[c]=_,_},e.clearLocationCache=function(){o=null},e.getVisibleSegment=function(n,u,c){var f=u.left,h=u.right,d=u.top,p=u.bottom,g=0,m=n.getTotalLength(),y=m,_,v;function x(M){var C=n.getPointAtLength(M);M===0?_=C:M===m&&(v=C);var w=C.xh?C.x-h:0,k=C.yp?C.y-p:0;return Math.sqrt(w*w+k*k)}for(var S=x(g);S;){if(g+=S+c,g>y)return;S=x(g)}for(S=x(y);S;){if(y-=S+c,g>y)return;S=x(y)}return{min:g,max:y,len:y-g,total:m,isClosed:g===0&&y===m&&Math.abs(_.x-v.x)<.1&&Math.abs(_.y-v.y)<.1}},e.findPointOnPath=function(n,u,c,f){f=f||{};for(var h=f.pathLength||n.getTotalLength(),d=f.tolerance||.001,p=f.iterationLimit||30,g=n.getPointAtLength(0)[c]>n.getPointAtLength(h)[c]?-1:1,m=0,y=0,_=h,v,x,S;m0?_=v:y=v,m++}return x}}}),ww=de({"src/lib/throttle.js"(e){"use strict";var r={};e.throttle=function(a,o,s){var l=r[a],n=Date.now();if(!l){for(var u in r)r[u].tsl.ts+o){c();return}l.timer=setTimeout(function(){c(),l.timer=null},o)},e.done=function(i){var a=r[i];return!a||!a.timer?Promise.resolve():new Promise(function(o){var s=a.onDone;a.onDone=function(){s&&s(),o(),a.onDone=null}})},e.clear=function(i){if(i)t(r[i]),delete r[i];else for(var a in r)e.clear(a)};function t(i){i&&i.timer!==null&&(clearTimeout(i.timer),i.timer=null)}}}),QU=de({"src/lib/clear_responsive.js"(e,r){"use strict";r.exports=function(i){i._responsiveChartHandler&&(window.removeEventListener("resize",i._responsiveChartHandler),delete i._responsiveChartHandler)}}}),eq=de({"node_modules/is-mobile/index.js"(e,r){"use strict";r.exports=o,r.exports.isMobile=o,r.exports.default=o;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/CrOS/,a=/android|ipad|playbook|silk/i;function o(s){s||(s={});let l=s.ua;if(!l&&typeof navigator<"u"&&(l=navigator.userAgent),l&&l.headers&&typeof l.headers["user-agent"]=="string"&&(l=l.headers["user-agent"]),typeof l!="string")return!1;let n=t.test(l)&&!i.test(l)||!!s.tablet&&a.test(l);return!n&&s.tablet&&s.featureDetect&&navigator&&navigator.maxTouchPoints>1&&l.indexOf("Macintosh")!==-1&&l.indexOf("Safari")!==-1&&(n=!0),n}}}),tq=de({"src/lib/preserve_drawing_buffer.js"(e,r){"use strict";var t=da(),i=eq();r.exports=function(s){var l;if(s&&s.hasOwnProperty("userAgent")?l=s.userAgent:l=a(),typeof l!="string")return!0;var n=i({ua:{headers:{"user-agent":l}},tablet:!0,featureDetect:!1});if(!n)for(var u=l.split(" "),c=1;c-1;h--){var d=u[h];if(d.slice(0,8)==="Version/"){var p=d.slice(8).split(".")[0];if(t(p)&&(p=+p),p>=13)return!0}}}return n};function a(){var o;return typeof navigator<"u"&&(o=navigator.userAgent),o&&o.headers&&typeof o.headers["user-agent"]=="string"&&(o=o.headers["user-agent"]),o}}}),rq=de({"src/lib/make_trace_groups.js"(e,r){"use strict";var t=Yr();r.exports=function(a,o,s){var l=a.selectAll("g."+s.replace(/\s/g,".")).data(o,function(u){return u[0].trace.uid});l.exit().remove(),l.enter().append("g").attr("class",s),l.order();var n=a.classed("rangeplot")?"nodeRangePlot3":"node3";return l.each(function(u){u[0][n]=t.select(this)}),l}}}),iq=de({"src/lib/localize.js"(e,r){"use strict";var t=Ma();r.exports=function(a,o){for(var s=a._context.locale,l=0;l<2;l++){for(var n=a._context.locales,u=0;u<2;u++){var c=(n[s]||{}).dictionary;if(c){var f=c[o];if(f)return f}n=t.localeRegistry}var h=s.split("-")[0];if(h===s)break;s=h}return o}}}),mE=de({"src/lib/filter_unique.js"(e,r){"use strict";r.exports=function(i){for(var a={},o=[],s=0,l=0;l1?(o*i+o*a)/o:i+a,l=String(s).length;if(l>16){var n=String(a).length,u=String(i).length;if(l>=u+n){var c=parseFloat(s).toPrecision(12);c.indexOf("e+")===-1&&(s=+c)}}return s}}}),gE={};Mr(gE,{default:()=>bE});function oq(e){return typeof e=="string"&&(e=e.replace(xE,"")),(0,yE.default)(e)?Number(e):_E.BADNUM}var yE,_E,xE,bE,sq=Ir({"src/lib/clean_number.ts"(){"use strict";yE=Vr(da()),_E=Vr(cn()),xE=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,bE=oq}}),lq=de({"src/lib/slugify.js"(e,r){"use strict";var t=/<[^>]*>/g,i=/[\p{S}\p{P}]/gu,a=/[\p{Cc}\p{Cf}\uFE00-\uFE0F\u20E3]/gu,o=/�/g,s=/\s+/g,l="-",n=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),u=new RegExp(n+"{3,}","g"),c=new RegExp(n+"$","g"),f=60;function h(d){return typeof d.toWellFormed=="function"?d.toWellFormed():new TextDecoder().decode(new TextEncoder().encode(d))}r.exports=function(p,g=f){var m=h(p??"").replace(o,"").replace(t," ").replace(i,y=>y===l?y:"").toLowerCase().trim().replace(s,l).replace(a,"").replace(u,l);return m.length<=g?m:Array.from(m).slice(0,g).join("").replace(c,"")}}}),Qt=de({"src/lib/index.js"(e,r){"use strict";var t=Yr(),i=eo().utcFormat,a=rs().format,o=da(),s=cn(),l=s.FP_SAFE,n=-l,u=s.BADNUM,c=r.exports={};c.adjustFormat=function(j){if(!j||/^\d[.]\df/.test(j)||/[.]\d%/.test(j))return j;if(j==="0.f")return"~f";if(/^\d%/.test(j))return"~%";if(/^\ds/.test(j))return"~s";var q=(j.match(/^[+\-( ]?/)||[""])[0],Y=j.slice(q.length);return!/^[~,.0$#]/.test(Y)&&/[&fps]/.test(Y)?q+"~"+Y:j};var f={};c.warnBadFormat=function(V){var j=String(V);f[j]||(f[j]=1,c.warn('encountered bad format: "'+j+'"'))},c.noFormat=function(V){return String(V)},c.numberFormat=function(V){var j;try{j=a(c.adjustFormat(V))}catch{return c.warnBadFormat(V),c.noFormat}return j},c.nestedProperty=sl(),c.keyedContainer=cu(),c.relativeAttr=ah(),c.isPlainObject=is(),c.toLogRange=o1(),c.relinkPrivateKeys=l0();var h=Do();c.isArrayBuffer=h.isArrayBuffer,c.isTypedArray=h.isTypedArray,c.isArrayOrTypedArray=h.isArrayOrTypedArray,c.isArray1D=h.isArray1D,c.ensureArray=h.ensureArray,c.concat=h.concat,c.maxRowLength=h.maxRowLength,c.minRowLength=h.minRowLength;var d=(u0(),ti(Tp));c.mod=d.mod,c.modHalf=d.modHalf;var p=vU();c.valObjectMeta=p.valObjectMeta,c.coerce=p.coerce,c.coerce2=p.coerce2,c.coerceFont=p.coerceFont,c.coercePattern=p.coercePattern,c.coerceHoverinfo=p.coerceHoverinfo,c.coerceSelectionMarkerOpacity=p.coerceSelectionMarkerOpacity,c.validate=p.validate;var g=WU();c.dateTime2ms=g.dateTime2ms,c.isDateTime=g.isDateTime,c.ms2DateTime=g.ms2DateTime,c.ms2DateTimeLocal=g.ms2DateTimeLocal,c.cleanDate=g.cleanDate,c.isJSDate=g.isJSDate,c.formatDate=g.formatDate,c.incrementMonth=g.incrementMonth,c.dateTick0=g.dateTick0,c.dfltRange=g.dfltRange,c.findExactDates=g.findExactDates,c.MIN_MS=g.MIN_MS,c.MAX_MS=g.MAX_MS;var m=bw();c.findBin=m.findBin,c.sorterAsc=m.sorterAsc,c.sorterDes=m.sorterDes,c.distinctVals=m.distinctVals,c.roundUp=m.roundUp,c.sort=m.sort,c.findIndexOfMin=m.findIndexOfMin,c.sortObjectKeys=(gv(),ti(c0)).default;var y=XU();c.aggNums=y.aggNums,c.len=y.len,c.mean=y.mean,c.geometricMean=y.geometricMean,c.median=y.median,c.midRange=y.midRange,c.variance=y.variance,c.stdev=y.stdev,c.interp=y.interp;var _=yw();c.init2dArray=_.init2dArray,c.transposeRagged=_.transposeRagged,c.dot=_.dot,c.translationMatrix=_.translationMatrix,c.rotationMatrix=_.rotationMatrix,c.rotationXYMatrix=_.rotationXYMatrix,c.apply3DTransform=_.apply3DTransform,c.apply2DTransform=_.apply2DTransform,c.apply2DTransform2=_.apply2DTransform2,c.convertCssMatrix=_.convertCssMatrix,c.inverseTransformMatrix=_.inverseTransformMatrix;var v=ZU();c.deg2rad=v.deg2rad,c.rad2deg=v.rad2deg,c.angleDelta=v.angleDelta,c.angleDist=v.angleDist,c.isFullCircle=v.isFullCircle,c.isAngleInsideSector=v.isAngleInsideSector,c.isPtInsideSector=v.isPtInsideSector,c.pathArc=v.pathArc,c.pathSector=v.pathSector,c.pathAnnulus=v.pathAnnulus;var x=KU();c.isLeftAnchor=x.isLeftAnchor,c.isCenterAnchor=x.isCenterAnchor,c.isRightAnchor=x.isRightAnchor,c.isTopAnchor=x.isTopAnchor,c.isMiddleAnchor=x.isMiddleAnchor,c.isBottomAnchor=x.isBottomAnchor;var S=JU();c.segmentsIntersect=S.segmentsIntersect,c.segmentDistance=S.segmentDistance,c.getTextLocation=S.getTextLocation,c.clearLocationCache=S.clearLocationCache,c.getVisibleSegment=S.getVisibleSegment,c.findPointOnPath=S.findPointOnPath;var M=fn();c.extendFlat=M.extendFlat,c.extendDeep=M.extendDeep,c.extendDeepAll=M.extendDeepAll,c.extendDeepNoArrays=M.extendDeepNoArrays;var C=Xo();c.log=C.log,c.warn=C.warn,c.error=C.error;var w=(s1(),ti(mv));c.counterRegex=w.counter;var k=ww();c.throttle=k.throttle,c.throttleDone=k.done,c.clearThrottle=k.clear;var A=Ty();c.getGraphDiv=A.getGraphDiv,c.isPlotDiv=A.isPlotDiv,c.removeElement=A.removeElement,c.addStyleRule=A.addStyleRule,c.addRelatedStyleRule=A.addRelatedStyleRule,c.deleteRelatedStyleRule=A.deleteRelatedStyleRule,c.setStyleOnHover=A.setStyleOnHover,c.getFullTransformMatrix=A.getFullTransformMatrix,c.getElementTransformMatrix=A.getElementTransformMatrix,c.getElementAndAncestors=A.getElementAndAncestors,c.equalDomRects=A.equalDomRects,c.clearResponsive=QU(),c.preserveDrawingBuffer=tq(),c.makeTraceGroups=rq(),c._=iq(),c.notifier=xn(),c.filterUnique=mE(),c.filterVisible=aq(),c.pushUnique=fE(),c.increment=nq(),c.cleanNumber=(sq(),ti(gE)).default,c.slugify=lq(),c.ensureNumber=function(j){return o(j)?(j=Number(j),j>l||j=j?!1:o(V)&&V>=0&&V%1===0},c.noop=gw(),c.identity=My(),c.repeat=function(V,j){for(var q=new Array(j),Y=0;Yq?Math.max(q,Math.min(j,V)):Math.max(j,Math.min(q,V))},c.bBoxIntersect=function(V,j,q){return q=q||0,V.left<=j.right+q&&j.left<=V.right+q&&V.top<=j.bottom+q&&j.top<=V.bottom+q},c.simpleMap=function(V,j,q,Y,K){for(var te=V.length,ne=new Array(te),se=0;se=Math.pow(2,q)?K>10?(c.warn("randstr failed uniqueness"),ne):V(j,q,Y,(K||0)+1):ne},c.OptionControl=function(V,j){V||(V={}),j||(j="opt");var q={};return q.optionList=[],q._newoption=function(Y){Y[j]=V,q[Y.name]=Y,q.optionList.push(Y)},q["_"+j]=V,q},c.smooth=function(V,j){if(j=Math.round(j)||0,j<2)return V;var q=V.length,Y=2*q,K=2*j-1,te=new Array(K),ne=new Array(q),se,le,ce,pe;for(se=0;se=Y&&(ce-=Y*Math.floor(ce/Y)),ce<0?ce=-1-ce:ce>=q&&(ce=Y-1-ce),pe+=V[ce]*te[le];ne[se]=pe}return ne},c.syncOrAsync=function(V,j,q){var Y,K;function te(){return c.syncOrAsync(V,j,q)}for(;V.length;)if(K=V.splice(0,1)[0],Y=K(j),Y&&Y.then)return Y.then(te);return q&&q(j)},c.stripTrailingSlash=function(V){return V.slice(-1)==="/"?V.slice(0,-1):V},c.noneOrAll=function(V,j,q){if(V){var Y=!1,K=!0,te,ne;for(te=0;te0?K:0})},c.fillArray=function(V,j,q,Y){if(Y=Y||c.identity,c.isArrayOrTypedArray(V))for(var K=0;KF.test(window.navigator.userAgent);var D=/Firefox\/(\d+)\.\d+/;c.getFirefoxVersion=function(){var V=D.exec(window.navigator.userAgent);if(V&&V.length===2){var j=parseInt(V[1]);if(!isNaN(j))return j}return null},c.isD3Selection=function(V){return V instanceof t.selection},c.ensureSingle=function(V,j,q,Y){var K=V.select(j+(q?"."+q:""));if(K.size())return K;var te=V.append(j);return q&&te.classed(q,!0),Y&&te.call(Y),te},c.ensureSingleById=function(V,j,q,Y){var K=V.select(j+"#"+q);if(K.size())return K;var te=V.append(j).attr("id",q);return Y&&te.call(Y),te},c.objectFromPath=function(V,j){for(var q=V.split("."),Y,K=Y={},te=0;te1?K+ne[1]:"";if(te&&(ne.length>1||se.length>4||q))for(;Y.test(se);)se=se.replace(Y,"$1"+te+"$2");return se+le},c.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;c.templateString=function(V,j){var q={};return V.replace(c.TEMPLATE_STRING_REGEX,function(Y,K){var te;return I.test(K)?te=j[K]:(q[K]=q[K]||c.nestedProperty(j,K).get,te=q[K](!0)),te!==void 0?te:""})};var L={max:10,count:0,name:"hovertemplate"};c.hovertemplateString=V=>Z(ar(Ot({},V),{opts:L}));var B={max:10,count:0,name:"texttemplate"};c.texttemplateString=V=>Z(ar(Ot({},V),{opts:B}));var O=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function G(V){var j=V.match(O);return j?{key:j[1],op:j[2],number:Number(j[3])}:{key:V,op:null,number:null}}var W={max:10,count:0,name:"texttemplate",parseMultDiv:!0};c.texttemplateStringForShapes=V=>Z(ar(Ot({},V),{opts:W}));var X=/^[:|\|]/;function Z({data:V=[],locale:j,fallback:q,labels:Y={},opts:K,template:te}){return te.replace(c.TEMPLATE_STRING_REGEX,(ne,se,le)=>{let ce=["xother","yother"].includes(se),pe=["_xother","_yother"].includes(se),xe=["_xother_","_yother_"].includes(se),ye=["xother_","yother_"].includes(se),fe=ce||pe||ye||xe;(pe||xe)&&(se=se.substring(1)),(ye||xe)&&(se=se.substring(0,se.length-1));let ae=null,ee=null;if(K.parseMultDiv){var ie=G(se);se=ie.key,ae=ie.op,ee=ie.number}let Q;if(fe){if(Y[se]===void 0)return"";Q=Y[se]}else for(let Te of V)if(Te){if(Te.hasOwnProperty(se)){Q=Te[se];break}if(I.test(se)||(Q=c.nestedProperty(Te,se).get(!0)),Q!==void 0)break}if(Q===void 0){let{count:Te,max:je,name:Ve}=K,Ze=q===!1?ne:q;return Te=J&&ne<=N,ce=se>=J&&se<=N;if(le&&(Y=10*Y+ne-J),ce&&(K=10*K+se-J),!le||!ce){if(Y!==K)return Y-K;if(ne!==se)return ne-se}}return K-Y};var H=2e9;c.seedPseudoRandom=function(){H=2e9},c.pseudoRandom=function(){var V=H;return H=(69069*H+1)%4294967296,Math.abs(H-V)<429496729?c.pseudoRandom():H/4294967296},c.fillText=function(V,j,q){var Y=Array.isArray(q)?function(ne){q.push(ne)}:function(ne){q.text=ne},K=c.extractOption(V,j,"htx","hovertext");if(c.isValidTextValue(K))return Y(K);var te=c.extractOption(V,j,"tx","text");if(c.isValidTextValue(te))return Y(te)},c.isValidTextValue=function(V){return V||V===0},c.formatPercent=function(V,j){j=j||0;for(var q=(Math.round(100*V*Math.pow(10,j))*Math.pow(.1,j)).toFixed(j)+"%",Y=0;Y1&&(ce=1):ce=0,c.strTranslate(K-ce*(q+ne),te-ce*(Y+se))+c.strScale(ce)+(le?"rotate("+le+(j?"":" "+q+" "+Y)+")":"")},c.setTransormAndDisplay=function(V,j){V.attr("transform",c.getTextTransform(j)),V.style("display",j.scale?null:"none")},c.ensureUniformFontSize=function(V,j){var q=c.extendFlat({},j);return q.size=Math.max(j.size,V._fullLayout.uniformtext.minsize||0),q},c.join2=function(V,j,q){var Y=V.length;return Y>1?V.slice(0,-1).join(j)+q+V[Y-1]:V.join(j)},c.bigFont=function(V){return Math.round(1.2*V)};var $=c.getFirefoxVersion(),U=$!==null&&$<86;c.getPositionFromD3Event=function(){return U?[t.event.layerX,t.event.layerY]:[t.event.offsetX,t.event.offsetY]}}}),uq=de({"build/plotcss.js"(){"use strict";var e=Qt(),r={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .plotly-cloud-dialog":'font-family:"Open Sans",verdana,arial,sans-serif;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1001;display:flex;align-items:center;justify-content:center;background-color:rgba(0,0,0,.4);',"X .plotly-cloud-dialog .plotly-cloud-dialog-box":"box-sizing:border-box;min-width:300px;max-width:420px;padding:20px 24px;background-color:#fff;border:1px solid #e0e2e5;border-radius:4px;box-shadow:0 4px 16px rgba(0,0,0,.25);font-size:13px;color:#2a3f5f;","X .plotly-cloud-dialog .plotly-cloud-dialog-title":"font-size:16px;font-weight:bold;margin-bottom:12px;","X .plotly-cloud-dialog .plotly-cloud-dialog-message":"line-height:1.5;overflow-wrap:break-word;word-wrap:break-word;","X .plotly-cloud-dialog .plotly-cloud-dialog-message--hostname":"font-weight:bold;text-decoration:underline;","X .plotly-cloud-dialog .plotly-cloud-dialog-message--account":"margin-top:16px;padding:8px;border-radius:3px;font-size:.9em;background-color:#edf1f8;","X .plotly-cloud-dialog .plotly-cloud-dialog-buttons":"display:flex;justify-content:flex-end;margin-top:20px;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn":"font-family:inherit;font-size:13px;padding:7px 16px;margin-left:8px;border-radius:3px;border:1px solid rgba(0,0,0,0);cursor:pointer;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn:focus-visible":"outline:2px solid #447adb;outline-offset:1px;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel":"background-color:#f3f3f3;margin-left:auto;color:#777;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel:hover":"background-color:#e0e2e5;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm":"background-color:#447adb;color:#fff;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm:hover":"background-color:#1d3b84;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(i in r)t=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),e.addStyleRule(t,r[i]);var t,i}}),wE=de({"node_modules/is-browser/client.js"(e,r){r.exports=!0}}),TE=de({"node_modules/has-hover/index.js"(e,r){"use strict";var t=wE(),i;typeof window.matchMedia=="function"?i=!window.matchMedia("(hover: none)").matches:i=t,r.exports=i}}),yv=de({"node_modules/events/events.js"(e,r){"use strict";var t=typeof Reflect=="object"?Reflect:null,i=t&&typeof t.apply=="function"?t.apply:function(C,w,k){return Function.prototype.apply.call(C,w,k)},a;t&&typeof t.ownKeys=="function"?a=t.ownKeys:Object.getOwnPropertySymbols?a=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:a=function(C){return Object.getOwnPropertyNames(C)};function o(M){console&&console.warn&&console.warn(M)}var s=Number.isNaN||function(C){return C!==C};function l(){l.init.call(this)}r.exports=l,r.exports.once=v,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var n=10;function u(M){if(typeof M!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof M)}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(M){if(typeof M!="number"||M<0||s(M))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+M+".");n=M}}),l.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||s(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function c(M){return M._maxListeners===void 0?l.defaultMaxListeners:M._maxListeners}l.prototype.getMaxListeners=function(){return c(this)},l.prototype.emit=function(C){for(var w=[],k=1;k0&&(E=w[0]),E instanceof Error)throw E;var T=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw T.context=E,T}var F=b[C];if(F===void 0)return!1;if(typeof F=="function")i(F,this,w);else for(var D=F.length,R=m(F,D),k=0;k0&&E.length>A&&!E.warned){E.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=M,T.type=C,T.count=E.length,o(T)}return M}l.prototype.addListener=function(C,w){return f(this,C,w,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(C,w){return f(this,C,w,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(M,C,w){var k={fired:!1,wrapFn:void 0,target:M,type:C,listener:w},A=h.bind(k);return A.listener=w,k.wrapFn=A,A}l.prototype.once=function(C,w){return u(w),this.on(C,d(this,C,w)),this},l.prototype.prependOnceListener=function(C,w){return u(w),this.prependListener(C,d(this,C,w)),this},l.prototype.removeListener=function(C,w){var k,A,b,E,T;if(u(w),A=this._events,A===void 0)return this;if(k=A[C],k===void 0)return this;if(k===w||k.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete A[C],A.removeListener&&this.emit("removeListener",C,k.listener||w));else if(typeof k!="function"){for(b=-1,E=k.length-1;E>=0;E--)if(k[E]===w||k[E].listener===w){T=k[E].listener,b=E;break}if(b<0)return this;b===0?k.shift():y(k,b),k.length===1&&(A[C]=k[0]),A.removeListener!==void 0&&this.emit("removeListener",C,T||w)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(C){var w,k,A;if(k=this._events,k===void 0)return this;if(k.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):k[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete k[C]),this;if(arguments.length===0){var b=Object.keys(k),E;for(A=0;A=0;A--)this.removeListener(C,w[A]);return this};function p(M,C,w){var k=M._events;if(k===void 0)return[];var A=k[C];return A===void 0?[]:typeof A=="function"?w?[A.listener||A]:[A]:w?_(A):m(A,A.length)}l.prototype.listeners=function(C){return p(this,C,!0)},l.prototype.rawListeners=function(C){return p(this,C,!1)},l.listenerCount=function(M,C){return typeof M.listenerCount=="function"?M.listenerCount(C):g.call(M,C)},l.prototype.listenerCount=g;function g(M){var C=this._events;if(C!==void 0){var w=C[M];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}l.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function m(M,C){for(var w=new Array(C),k=0;k{},{passive:!0}),a},triggerHandler:function(a,o,s){var l,n=a._ev;if(!n)return;var u=n._events[o];if(!u)return;function c(h){if(h.listener){if(n.removeListener(o,h.listener),!h.fired)return h.fired=!0,h.listener.apply(n,[s])}else return h.apply(n,[s])}u=Array.isArray(u)?u:[u];var f;for(f=0;fi.queueLength&&(s.undoQueue.queue.shift(),s.undoQueue.index--)},o.startSequence=function(s){s.undoQueue=s.undoQueue||{index:0,queue:[],sequence:!1},s.undoQueue.sequence=!0,s.undoQueue.beginSequence=!0},o.stopSequence=function(s){s.undoQueue=s.undoQueue||{index:0,queue:[],sequence:!1},s.undoQueue.sequence=!1,s.undoQueue.beginSequence=!1},o.undo=function(l){var n,u;if(!(l.undoQueue===void 0||isNaN(l.undoQueue.index)||l.undoQueue.index<=0)){for(l.undoQueue.index--,n=l.undoQueue.queue[l.undoQueue.index],l.undoQueue.inSequence=!0,u=0;u=l.undoQueue.queue.length)){for(n=l.undoQueue.queue[l.undoQueue.index],l.undoQueue.inSequence=!0,u=0;u=L.length)return!1;if(D.dimensions===2){if(P++,R.length===P)return D;var B=R[P];if(!S(B))return!1;D=L[I][B]}else D=L[I]}else D=L}}return D}function S(D){return D===Math.round(D)&&D>=0}function M(D){var R,P;R=r.modules[D]._module,P=R.basePlotModule;var z={};z.type=null;var I=u({},i),L=u({},R.attributes);e.crawl(L,function(G,W,X,Z,J){h(I,J).set(void 0),G===void 0&&h(L,J).set(void 0)}),u(z,I),r.traceIs(D,"noOpacity")&&delete z.opacity,r.traceIs(D,"showLegend")||(delete z.showlegend,delete z.legendgroup),r.traceIs(D,"noHover")&&(delete z.hoverinfo,delete z.hoverlabel),R.selectPoints||delete z.selectedpoints,u(z,L),P.attributes&&u(z,P.attributes),z.type=D;var B={meta:R.meta||{},categories:R.categories||{},animatable:!!R.animatable,type:D,attributes:k(z)};if(R.layoutAttributes){var O={};u(O,R.layoutAttributes),B.layoutAttributes=k(O)}return R.animatable||e.crawl(B,function(G){e.isValObject(G)&&"anim"in G&&delete G.anim}),B}function C(){var D={},R,P;u(D,a);for(R in r.subplotsRegistry)if(P=r.subplotsRegistry[R],!!P.layoutAttributes)if(Array.isArray(P.attr))for(var z=0;z=c&&(u._input||{})._templateitemname;h&&(f=c);var d=n+"["+f+"]",p;function g(){p={},h&&(p[d]={},p[d][i]=h)}g();function m(x,S){p[x]=S}function y(x,S){h?r.nestedProperty(p[d],x).set(S):p[d+"."+x]=S}function _(){var x=p;return g(),x}function v(x,S){x&&y(x,S);var M=_();for(var C in M)r.nestedProperty(l,C).set(M[C])}return{modifyBase:m,modifyItem:y,getUpdateObj:_,applyUpdate:v}}}}),zl=de({"src/plots/cartesian/constants.js"(e,r){"use strict";var t=(s1(),ti(mv)).counter;r.exports={idRegex:{x:t("x","( domain)?"),y:t("y","( domain)?")},attrRegex:t("[xy]axis"),xAxisMatch:t("xaxis"),yAxisMatch:t("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),Hs=de({"src/plots/cartesian/axis_ids.js"(e){"use strict";var r=Ma(),t=zl();e.id2name=function(o){if(!(typeof o!="string"||!o.match(t.AX_ID_PATTERN))){var s=o.split(" ")[0].slice(1);return s==="1"&&(s=""),o.charAt(0)+"axis"+s}},e.name2id=function(o){if(o.match(t.AX_NAME_PATTERN)){var s=o.slice(5);return s==="1"&&(s=""),o.charAt(0)+s}},e.cleanId=function(o,s,l){var n=/( domain)$/.test(o);if(!(typeof o!="string"||!o.match(t.AX_ID_PATTERN))&&!(s&&o.charAt(0)!==s)&&!(n&&!l)){var u=o.split(" ")[0].slice(1).replace(/^0+/,"");return u==="1"&&(u=""),o.charAt(0)+u+(n&&l?" domain":"")}},e.list=function(a,o,s){var l=a._fullLayout;if(!l)return[];var n=e.listIds(a,o),u=new Array(n.length),c;for(c=0;cl?1:-1:+(a.slice(1)||1)-+(o.slice(1)||1)},e.ref2id=function(a){return/^[xyz]/.test(a)?a.split(" ")[0]:!1};function i(a,o){if(o&&o.length){for(var s=0;s0?".":"")+h;t.isPlainObject(d)?l(d,u,p,f+1):u(p,h,d)}})}}}),Es=de({"src/plots/plots.js"(e,r){"use strict";var t=Yr(),i=eo().timeFormatLocale,a=rs().formatLocale,o=da(),s=Ss(),l=_i().version,n=Ma(),u=c1(),c=Ro(),f=Qt(),h=ta(),d=cn().BADNUM,p=Hs(),g=f0().clearOutline,m=Tw(),y=Ay(),_=AE(),v=$u().getModuleCalcData,x=f.relinkPrivateKeys,S=f._,M=r.exports={};f.extendFlat(M,n),M.attributes=ri(),M.attributes.type.values=M.allTypes,M.fontAttrs=us(),M.layoutAttributes=l1();var C=fq();M.executeAPICommand=C.executeAPICommand,M.computeAPICommandBindings=C.computeAPICommandBindings,M.manageCommandObserver=C.manageCommandObserver,M.hasSimpleAPICommandBindings=C.hasSimpleAPICommandBindings,M.redrawText=function(N){return N=f.getGraphDiv(N),new Promise(function(H){setTimeout(function(){N._fullLayout&&(n.getComponentMethod("annotations","draw")(N),n.getComponentMethod("legend","draw")(N),n.getComponentMethod("colorbar","draw")(N),H(M.previousPromises(N)))},300)})},M.resize=function(N){N=f.getGraphDiv(N);var H,$=new Promise(function(U,V){(!N||f.isHidden(N))&&V(new Error("Resize must be passed a displayed plot div element.")),N._redrawTimer&&clearTimeout(N._redrawTimer),N._resolveResize&&(H=N._resolveResize),N._resolveResize=U,N._redrawTimer=setTimeout(function(){if(!N.layout||N.layout.width&&N.layout.height||f.isHidden(N)){U(N);return}delete N.layout.width,delete N.layout.height;var j=N.changed;N.autoplay=!0,n.call("relayout",N,{autosize:!0}).then(function(){N.changed=j,N._resolveResize===U&&(delete N._resolveResize,U(N))})},100)});return H&&H($),$},M.previousPromises=function(N){if((N._promises||[]).length)return Promise.all(N._promises).then(function(){N._promises=[]})},M.sendDataToCloud=function(N,H){N.emit("plotly_beforeexport");let $=new URL(H).origin;var U=M.graphJson(N,!1,"object");U.version=l;var V=new URL(H);V.searchParams.set("origin",window.location.origin);var j=window.open(V.href,"_blank");if(!j){console.error("Unable to open Plotly Cloud (the popup may have been blocked)"),N.emit("plotly_exportfail");return}var q=function(Y){Y.origin===$&&Y.data&&Y.data.type==="CHART_AUTH_SUCCESS"&&(j.postMessage({type:"chart",chart:U},$),window.removeEventListener("message",q),N.emit("plotly_afterexport"))};return window.addEventListener("message",q),!1};var w=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];M.supplyDefaults=function(N,H){var $=H&&H.skipUpdateCalc,U=N._fullLayout||{};if(U._skipDefaults){delete U._skipDefaults;return}var V=N._fullLayout={},j=N.layout||{},q=N._fullData||[],Y=N._fullData=[],K=N.data||[],te=N.calcdata||[],ne=N._context||{},se;N._transitionData||M.createTransitionData(N),V._dfltTitle={plot:S(N,"Click to enter Plot title"),subtitle:S(N,"Click to enter Plot subtitle"),x:S(N,"Click to enter X axis title"),y:S(N,"Click to enter Y axis title"),colorbar:S(N,"Click to enter Colorscale title"),annotation:S(N,"new text")},V._traceWord=S(N,"trace");var le=E(N,w);if(U._initialAutoSizeIsDone){var ce=U.width,pe=U.height;M.supplyLayoutGlobalDefaults(j,V,le),j.width||(V.width=ce),j.height||(V.height=pe),M.sanitizeMargins(V)}else{M.supplyLayoutGlobalDefaults(j,V,le);var xe=!j.width||!j.height,ye=V.autosize,fe=ne.autosizable,ae=xe&&(ye||fe);ae?M.plotAutoSize(N,j,V):xe&&M.sanitizeMargins(V),!ye&&xe&&(j.width=V.width,j.height=V.height)}V._d3locale=T(le,V.separators),V._extraFormat=E(N,k),V._initialAutoSizeIsDone=!0,V._dataLength=K.length,V._modules=[],V._visibleModules=[],V._basePlotModules=[];var ee=V._subplots=b(),ie=V._splomAxes={x:{},y:{}},Q=V._splomSubplots={};V._splomGridDflt={},V._scatterStackOpts={},V._firstScatter={},V._alignmentOpts={},V._colorAxes={},V._requestRangeslider={},V._traceUids=A(q,K),M.supplyDataDefaults(K,Y,j,V);var ue=Object.keys(ie.x),ge=Object.keys(ie.y);if(ue.length>1&&ge.length>1){for(n.getComponentMethod("grid","sizeDefaults")(j,V),se=0;se15&&ge.length>15&&V.shapes.length===0&&V.images.length===0,M.linkSubplots(Y,V,q,U),M.cleanPlot(Y,V,q,U);var Ze=!!(U._has&&U._has("cartesian")),Ke=!!(V._has&&V._has("cartesian")),vt=Ze,xt=Ke;vt&&!xt?U._bgLayer.remove():xt&&!vt&&(V._shouldCreateBgLayer=!0),U._zoomlayer&&!N._dragging&&g({_fullLayout:U}),F(Y,V),x(V,U),n.getComponentMethod("colorscale","crossTraceDefaults")(Y,V),V._preGUI||(V._preGUI={}),V._tracePreGUI||(V._tracePreGUI={});var Pt=V._tracePreGUI,mt={},Mt;for(Mt in Pt)mt[Mt]="old";for(se=0;se0){var ne=1-2*j;q=Math.round(ne*q),Y=Math.round(ne*Y)}}var se=M.layoutAttributes.width.min,le=M.layoutAttributes.height.min;q1,pe=!$.height&&Math.abs(U.height-Y)>1;(pe||ce)&&(ce&&(U.width=q),pe&&(U.height=Y)),H._initialAutoSize||(H._initialAutoSize={width:q,height:Y}),M.sanitizeMargins(U)},M.supplyLayoutModuleDefaults=function(N,H,$,U){var V=n.componentsRegistry,j=H._basePlotModules,q,Y,K,te=n.subplotsRegistry.cartesian;for(q in V)K=V[q],K.includeBasePlot&&K.includeBasePlot(N,H);j.length||j.push(te),H._has("cartesian")&&(n.getComponentMethod("grid","contentDefaults")(N,H),te.finalizeSubplots(N,H));for(var ne in H._subplots)H._subplots[ne].sort(f.subplotSort);for(Y=0;Y1&&($.l/=ye,$.r/=ye)}if(le){var fe=($.t+$.b)/le;fe>1&&($.t/=fe,$.b/=fe)}var ae=$.xl!==void 0?$.xl:$.x,ee=$.xr!==void 0?$.xr:$.x,ie=$.yt!==void 0?$.yt:$.y,Q=$.yb!==void 0?$.yb:$.y;ce[H]={l:{val:ae,size:$.l+xe},r:{val:ee,size:$.r+xe},b:{val:Q,size:$.b+xe},t:{val:ie,size:$.t+xe}},pe[H]=1}if(!U._replotting)return M.doAutoMargin(N)}};function L(N){if("_redrawFromAutoMarginCount"in N._fullLayout)return!1;var H=p.list(N,"",!0);for(var $ in H)if(H[$].autoshift||H[$].shift)return!0;return!1}M.doAutoMargin=function(N){var H=N._fullLayout,$=H.width,U=H.height;H._size||(H._size={}),P(H);var V=H._size,j=H.margin,q={t:0,b:0,l:0,r:0},Y=f.extendFlat({},V),K=j.l,te=j.r,ne=j.t,se=j.b,le=H._pushmargin,ce=H._pushmarginIds,pe=H.minreducedwidth,xe=H.minreducedheight;if(j.autoexpand!==!1){for(var ye in le)ce[ye]||delete le[ye];var fe=N._fullLayout._reservedMargin;for(var ae in fe)for(var ee in fe[ae]){var ie=fe[ae][ee];q[ee]=Math.max(q[ee],ie)}le.base={l:{val:0,size:K},r:{val:1,size:te},t:{val:1,size:ne},b:{val:0,size:se}};for(var Q in q){var ue=0;for(var ge in le)ge!=="base"&&o(le[ge][Q].size)&&(ue=le[ge][Q].size>ue?le[ge][Q].size:ue);var Me=Math.max(0,j[Q]-ue);q[Q]=Math.max(0,q[Q]-Me)}for(var Te in le){var je=le[Te].l||{},Ve=le[Te].b||{},Ze=je.val,Ke=je.size,vt=Ve.val,xt=Ve.size,Pt=$-q.r-q.l,mt=U-q.t-q.b;for(var Mt in le){if(o(Ke)&&le[Mt].r){var lt=le[Mt].r.val,qe=le[Mt].r.size;if(lt>Ze){var Ye=(Ke*lt+(qe-Pt)*Ze)/(lt-Ze),me=(qe*(1-Ze)+(Ke-Pt)*(1-lt))/(lt-Ze);Ye+me>K+te&&(K=Ye,te=me)}}if(o(xt)&&le[Mt].t){var _e=le[Mt].t.val,Ae=le[Mt].t.size;if(_e>vt){var ke=(xt*_e+(Ae-mt)*vt)/(_e-vt),Ee=(Ae*(1-vt)+(xt-mt)*(1-_e))/(_e-vt);ke+Ee>se+ne&&(se=ke,ne=Ee)}}}}}var De=f.constrain($-j.l-j.r,z,pe),Je=f.constrain(U-j.t-j.b,I,xe),Ue=Math.max(0,$-De),at=Math.max(0,U-Je);if(Ue){var rt=(K+te)/Ue;rt>1&&(K/=rt,te/=rt)}if(at){var ft=(se+ne)/at;ft>1&&(se/=ft,ne/=ft)}if(V.l=Math.round(K)+q.l,V.r=Math.round(te)+q.r,V.t=Math.round(ne)+q.t,V.b=Math.round(se)+q.b,V.p=Math.round(j.pad),V.w=Math.round($)-V.l-V.r,V.h=Math.round(U)-V.t-V.b,!H._replotting&&(M.didMarginChange(Y,V)||L(N))){"_redrawFromAutoMarginCount"in H?H._redrawFromAutoMarginCount++:H._redrawFromAutoMarginCount=1;var At=3*(1+Object.keys(ce).length);if(H._redrawFromAutoMarginCount1)return!0}return!1},M.graphJson=function(N,H=!1,$="json",U=!1,V=!1){(U&&H&&!N._fullData||U&&!H&&!N._fullLayout)&&M.supplyDefaults(N);var j=U?N._fullData:N.data,q=U?N._fullLayout:N.layout,Y=(N._transitionData||{})._frames;function K(se,le){if(typeof se=="function")return le?"_function_":null;if(f.isPlainObject(se)){var ce={};return Object.keys(se).sort().forEach(function(fe){if(["_","["].indexOf(fe.charAt(0))===-1){if(typeof se[fe]=="function"){le&&(ce[fe]="_function");return}ce[fe]=K(se[fe],le)}}),ce}var pe=Array.isArray(se),xe=f.isTypedArray(se);if((pe||xe)&&se.dtype&&se.shape){var ye=se.bdata;return K({dtype:se.dtype,shape:se.shape,bdata:f.isArrayBuffer(ye)?s.encode(ye):ye},le)}return pe?se.map(function(fe){return K(fe,le)}):xe?f.simpleMap(se,f.identity):f.isJSDate(se)?f.ms2DateTimeLocal(+se):se}var te={data:(j||[]).map(function(se){var le=K(se);return H&&delete le.fit,le})};if(!H&&(te.layout=K(q),U)){var ne=q._size;te.layout.computed={margin:{b:ne.b,l:ne.l,r:ne.r,t:ne.t}}}return Y&&(te.frames=K(Y)),V&&(te.config=K(N._context,!0)),$==="object"?te:JSON.stringify(te)},M.modifyFrames=function(N,H){var $,U,V,j=N._transitionData._frames,q=N._transitionData._frameHash;for($=0;$0&&(N._transitioningWithDuration=!0),N._transitionData._interruptCallbacks.push(function(){U=!0}),$.redraw&&N._transitionData._interruptCallbacks.push(function(){return n.call("redraw",N)}),N._transitionData._interruptCallbacks.push(function(){N.emit("plotly_transitioninterrupted",[])});var le=0,ce=0;function pe(){return le++,function(){ce++,!U&&ce===le&&Y(se)}}$.runFn(pe),setTimeout(pe())})}function Y(se){if(N._transitionData)return j(N._transitionData._interruptCallbacks),Promise.resolve().then(function(){if($.redraw)return n.call("redraw",N)}).then(function(){N._transitioning=!1,N._transitioningWithDuration=!1,N.emit("plotly_transitioned",[])}).then(se)}function K(){if(N._transitionData)return N._transitioning=!1,V(N._transitionData._interruptCallbacks)}var te=[M.previousPromises,K,$.prepareFn,M.rehover,M.reselect,q],ne=f.syncOrAsync(te,N);return(!ne||!ne.then)&&(ne=Promise.resolve()),ne.then(function(){return N})}M.doCalcdata=function(N,H){var $=p.list(N),U=N._fullData,V=N._fullLayout,j,q,Y,K=new Array(U.length),te=(N.calcdata||[]).slice();for(N.calcdata=K,V._numBoxes=0,V._numViolins=0,V._violinScaleGroupStats={},N._hmpixcount=0,N._hmlumcount=0,V._piecolormap={},V._sunburstcolormap={},V._treemapcolormap={},V._iciclecolormap={},V._funnelareacolormap={},Y=0;YW?W.match(s):null;e.matchTex=l,e.convertToTspans=function(W,X,Z){var J=W.text(),N=!W.attr("data-notex")&&X&&X._context.typesetMath&&l(J);N&&!g()&&(N=null);var H=r.select(W.node().parentNode);if(H.empty())return;var $=W.attr("class")?W.attr("class").split(" ")[0]:"text";$+="-math",H.selectAll("svg."+$).remove(),H.selectAll("g."+$+"-group").remove(),W.style("display",null).attr({"data-unformatted":J,"data-math":"N"});function U(){H.empty()||($=W.attr("class")+"-math",H.select("svg."+$).remove()),W.text("").style("white-space","pre");var V=L(W.node(),J);V&&W.style("pointer-events","all"),e.positionText(W),Z&&Z.call(W)}return N?(X&&X._promises||[]).push(new Promise(function(V){W.style("display","none");var j=parseInt(W.node().style.fontSize,10),q={fontSize:j},Y=W.attr("text-anchor");m(N[2],q,function(K,te,ne){H.selectAll("svg."+$).remove(),H.selectAll("g."+$+"-group").remove();var se=K&&K.select("svg");if(!se||!se.node()){U(),V();return}W.style("display","none");var le=H.append("g").classed($+"-group",!0).attr({"pointer-events":"none","data-unformatted":J,"data-math":"Y"});le.node().appendChild(se.node()),te&&te.node()&&se.node().insertBefore(te.node().cloneNode(!0),se.node().firstChild);var ce=ne.width,pe=ne.height;se.attr({class:$,height:pe,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none","font-size":q.fontSize+"px"});var xe=W.node().style.fill||"black",ye=se.select("g");ye.attr({fill:xe,stroke:xe});var fe=ye.node().getBoundingClientRect(),ae=fe.width,ee=fe.height;(ae>ce||ee>pe)&&(se.style("overflow","hidden"),fe=se.node().getBoundingClientRect(),ae=fe.width,ee=fe.height);var ie=+W.attr("x"),Q=+W.attr("y"),ue=j||W.node().getBoundingClientRect().height,ge=-ue/4;$[0]==="y"?le.attr({transform:"rotate("+[-90,ie,Q]+")"+i(-ae/2,ge-ee/2)}):$[0]==="l"?Q=ge-ee/2:$[0]==="a"&&$.indexOf("atitle")!==0?(ie=0,Q=ge):(ie=ie-ae*(Y==="middle"?.5:Y==="end"?1:0),Q=Q+ge-ee/2),se.attr({x:ie,y:Q}),Z&&Z.call(W,le),V(le)})})):U(),W};var n=/(<|<|<)/g,u=/(>|>|>)/g;function c(W){return W.replace(n,"\\lt ").replace(u,"\\gt ")}var f=null,h=()=>typeof MathJax<"u"&&MathJax.version?parseInt(MathJax.version.split(".")[0]):null,d=!1,p=!1;function g(){let W=h();return W===3||W===4?!0:(W===null?d||(d=!0,t.warn("MathJax is not loaded. Math equations will not be rendered.")):p||(p=!0,t.warn("Unsupported MathJax version:",MathJax.version)),!1)}function m(W,X,Z){let J=h();var N;let H=function(){if(!f){let j=MathJax._.output.svg_ts.SVG,q=t.extendFlat({},MathJax.config.svg,{fontCache:"local"});J===4&&(q.linebreaks=t.extendFlat({},q.linebreaks,{inline:!1})),f=MathJax._.mathjax.mathjax.document(document,t.extendFlat({},MathJax.config.options,{InputJax:MathJax.startup.input,OutputJax:new j(q)}))}let U="math-output-"+t.randstr({},64);N=r.select("body").append("div").attr({id:U}).style({visibility:"hidden",position:"absolute","font-size":X.fontSize+"px"});let V=c(W).replace(/^\$+|\$+$/g,"");return MathJax._.mathjax.mathjax.handleRetriesFor(function(){return f.convert(V,{display:!1})}).then(function(j){N.node().appendChild(j)})},$=function(){let U=N.select(".MathJax"),V=!U.empty()&&N.select("svg").node();if(!V)t.log("There was an error in the tex syntax.",W),Z();else{let j=V.getBoundingClientRect(),q=U.select("defs");Z(U,q,j)}N.remove()};Promise.resolve().then(H).then($).catch(U=>{t.log("MathJax typesetting failed.",W,U),N&&N.remove(),Z()})}var y={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},_={sub:"0.3em",sup:"-0.6em"},v={sub:"-0.21em",sup:"0.42em"},x="\u200B",S=["http:","https:","mailto:","",void 0,":"],M=e.NEWLINES=/(\r\n?|\n)/g,C=/(<[^<>]*>)/,w=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;e.BR_TAG_ALL=//gi;var A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,E=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function F(W,X){if(!W)return null;var Z=W.match(X),J=Z&&(Z[3]||Z[4]);return J&&z(J)}var D=/(^|;)\s*color:/;e.plainText=function(W,X){X=X||{};for(var Z=X.len!==void 0&&X.len!==-1?X.len:1/0,J=X.allowedTags!==void 0?X.allowedTags:["br"],N="...",H=N.length,$=W.split(C),U=[],V="",j=0,q=0;q<$.length;q++){var Y=$[q],K=Y.match(w),te=K&&K[2].toLowerCase();if(te)J.indexOf(te)!==-1&&(U.push(Y),V=te);else{var ne=Y.length;if(j+neH?U.push(Y.slice(0,Math.max(0,se-H))+N):U.push(Y.slice(0,se));break}V=""}}return U.join("")};var R={mu:"\u03BC",amp:"&",lt:"<",gt:">",nbsp:"\xA0",times:"\xD7",plusmn:"\xB1",deg:"\xB0"},P=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function z(W){return W.replace(P,function(X,Z){var J;return Z.charAt(0)==="#"?J=I(Z.charAt(1)==="x"?parseInt(Z.slice(2),16):parseInt(Z.slice(1),10)):J=R[Z],J||X})}e.convertEntities=z;function I(W){if(!(W>1114111)){var X=String.fromCodePoint;if(X)return X(W);var Z=String.fromCharCode;return W<=65535?Z(W):Z((W>>10)+55232,W%1024+56320)}}function L(W,X){X=X.replace(M," ");var Z=!1,J=[],N,H=-1;function $(){H++;var ae=document.createElementNS(a.svg,"tspan");r.select(ae).attr({class:"line",dy:H*o+"em"}),W.appendChild(ae),N=ae;var ee=J;if(J=[{node:ae}],ee.length>1)for(var ie=1;ie.",X);return}var ee=J.pop();ae!==ee.type&&t.log("Start tag <"+ee.type+"> doesnt match end tag <"+ae+">. Pretending it did match.",X),N=J[J.length-1].node}var q=k.test(X);q?$():(N=W,J=[{node:W}]);for(var Y=X.split(C),K=0;K=0;_--,v++){var x=g[_];y[v]=[1-x[0],x[1]]}return y}function d(g,m){m=m||{};for(var y=g.domain,_=g.range,v=_.length,x=new Array(v),S=0;Sy-g?g=y-(m-y):m-y=0?x=u.colorscale.sequential:x=u.colorscale.sequentialminus,d._sync("colorscale",x)}}}}),ks=de({"src/components/colorscale/index.js"(e,r){"use strict";var t=vv(),i=Wu();r.exports={moduleType:"component",name:"colorscale",attributes:cs(),layoutAttributes:ME(),supplyLayoutDefaults:hq(),handleDefaults:hu(),crossTraceDefaults:dq(),calc:hc(),scales:t.scales,defaultScale:t.defaultScale,getScale:t.get,isValidScale:t.isValid,hasColorscale:i.hasColorscale,extractOpts:i.extractOpts,extractScale:i.extractScale,flipScale:i.flipScale,makeColorScaleFunc:i.makeColorScaleFunc,makeColorScaleFuncFromTrace:i.makeColorScaleFuncFromTrace}}}),bs=de({"src/traces/scatter/subtypes.js"(e,r){"use strict";var t=Qt(),i=Do().isTypedArraySpec;r.exports={hasLines:function(a){return a.visible&&a.mode&&a.mode.indexOf("lines")!==-1},hasMarkers:function(a){return a.visible&&(a.mode&&a.mode.indexOf("markers")!==-1||a.type==="splom")},hasText:function(a){return a.visible&&a.mode&&a.mode.indexOf("text")!==-1},isBubble:function(a){var o=a.marker;return t.isPlainObject(o)&&(t.isArrayOrTypedArray(o.size)||i(o.size))}}}}),Sy=de({"src/traces/scatter/make_bubble_size_func.js"(e,r){"use strict";var t=da();r.exports=function(a,o){o||(o=2);var s=a.marker,l=s.sizeref||1,n=s.sizemin||0,u=s.sizemode==="area"?function(c){return Math.sqrt(c/l)}:function(c){return c/l};return function(c){var f=u(c/o);return t(f)&&f>0?Math.max(f,n):0}}}}),sf=de({"src/components/fx/helpers.js"(e){"use strict";var r=Qt();e.getSubplot=function(l){return l.subplot||l.xaxis+l.yaxis||l.geo},e.isTraceInSubplots=function(l,n){if(l.type==="splom"){for(var u=l.xaxes||[],c=l.yaxes||[],f=0;f=0&&u.index{let h=c.toLowerCase(),d=c,p=s(f);for(h==="m"&&p.length>2&&(n.push([d,...p.splice(0,2)]),h="l",d=d==="m"?"l":"L");;){if(p.length===t[h])return n.push([d,...p]),"";if(p.length0&&(ee=100,ae=ae.replace("-open","")),ae.indexOf("-dot")>0&&(ee+=200,ae=ae.replace("-dot","")),ae=_.symbolNames.indexOf(ae),ae>=0&&(ae+=ee)}return ae%100>=k||ae>=400?0:Math.floor(Math.max(ae,0))};function b(ae,ee,ie,Q){var ue=ae%100;return _.symbolFuncs[ue](ee,ie,Q)+(ae>=200?A:"")}var E=a("~f"),T={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};_.gradient=function(ae,ee,ie,Q,ue,ge){var Me=T[Q];return F(ae,ee,ie,Me.type,ue,ge,Me.start,Me.stop,!1,Me.reversed)};function F(ae,ee,ie,Q,ue,ge,Me,Te,je,Ve){var Ze=ue.length,Ke;Q==="linear"?Ke={node:"linearGradient",attrs:{x1:Me.x,y1:Me.y,x2:Te.x,y2:Te.y,gradientUnits:je?"userSpaceOnUse":"objectBoundingBox"},reversed:Ve}:Q==="radial"&&(Ke={node:"radialGradient",reversed:Ve});for(var vt=new Array(Ze),xt=0;xt=0&&ae.i===void 0&&(ae.i=ge.i),ee.style("opacity",Q.selectedOpacityFn?Q.selectedOpacityFn(ae):ae.mo===void 0?Me.opacity:ae.mo),Q.ms2mrc){var je;ae.ms==="various"||Me.size==="various"?je=3:je=Q.ms2mrc(ae.ms),ae.mrc=je,Q.selectedSizeFn&&(je=ae.mrc=Q.selectedSizeFn(ae));var Ve=_.symbolNumber(ae.mx||Me.symbol)||0;ae.om=Ve%200>=100;var Ze=fe(ae,ie),Ke=q(ae,ie);ee.attr("d",b(Ve,je,Ze,Ke))}var vt=!1,xt,Pt,mt;if(ae.so)mt=Te.outlierwidth,Pt=Te.outliercolor,xt=Me.outliercolor;else{var Mt=(Te||{}).width;mt=(ae.mlw+1||Mt+1||(ae.trace?(ae.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in ae?Pt=ae.mlcc=Q.lineScale(ae.mlc):i.isArrayOrTypedArray(Te.color)?Pt=l.defaultLine:Pt=Te.color,i.isArrayOrTypedArray(Me.color)&&(xt=l.defaultLine,vt=!0),"mc"in ae?xt=ae.mcc=Q.markerScale(ae.mc):xt=Me.color||Me.colors||"rgba(0,0,0,0)",Q.selectedColorFn&&(xt=Q.selectedColorFn(ae))}let lt=ae.mld||(Te||{}).dash;if(lt&&_.dashLine(ee,lt,mt),ae.om)ee.call(l.stroke,xt).style({"stroke-width":(mt||1)+"px",fill:"none"});else{ee.style("stroke-width",(ae.isBlank?0:mt)+"px");var qe=Me.gradient,Ye=ae.mgt;Ye?vt=!0:Ye=qe&&qe.type,i.isArrayOrTypedArray(Ye)&&(Ye=Ye[0],T[Ye]||(Ye=0));var me=Me.pattern,_e=_.getPatternAttr,Ae=me&&(_e(me.shape,ae.i,"")||_e(me.path,ae.i,""));if(Ye&&Ye!=="none"){var ke=ae.mgc;ke?vt=!0:ke=qe.color;var Ee=ie.uid;vt&&(Ee+="-"+ae.i),_.gradient(ee,ue,Ee,Ye,[[0,ke],[1,xt]],"fill")}else if(Ae){var De=!1,Je=me.fgcolor;!Je&&ge&&ge.color&&(Je=ge.color,De=!0);var Ue=_e(Je,ae.i,ge&&ge.color||null),at=_e(me.bgcolor,ae.i,null),rt=me.fgopacity,ft=_e(me.size,ae.i,8),At=_e(me.solidity,ae.i,.3);De=De||ae.mcc||i.isArrayOrTypedArray(me.shape)||i.isArrayOrTypedArray(me.path)||i.isArrayOrTypedArray(me.bgcolor)||i.isArrayOrTypedArray(me.fgcolor)||i.isArrayOrTypedArray(me.size)||i.isArrayOrTypedArray(me.solidity);var ht=ie.uid;De&&(ht+="-"+ae.i),_.pattern(ee,"point",ue,ht,Ae,ft,At,ae.mcc,me.fillmode,at,Ue,rt)}else i.isArrayOrTypedArray(xt)?l.fill(ee,xt[ae.i]):l.fill(ee,xt);mt&&l.stroke(ee,Pt)}},_.makePointStyleFns=function(ae){var ee={},ie=ae.marker;return ee.markerScale=_.tryColorscale(ie,""),ee.lineScale=_.tryColorscale(ie,"line"),s.traceIs(ae,"symbols")&&(ee.ms2mrc=g.isBubble(ae)?m(ae):function(){return(ie.size||6)/2}),ae.selectedpoints&&i.extendFlat(ee,_.makeSelectedPointStyleFns(ae)),ee},_.makeSelectedPointStyleFns=function(ae){var ee={},ie=ae.selected||{},Q=ae.unselected||{},ue=ae.marker||{},ge=ie.marker||{},Me=Q.marker||{},Te=ue.opacity,je=ge.opacity,Ve=Me.opacity,Ze=je!==void 0,Ke=Ve!==void 0;(i.isArrayOrTypedArray(Te)||Ze||Ke)&&(ee.selectedOpacityFn=function(me){var _e=me.mo===void 0?ue.opacity:me.mo;return me.selected?Ze?je:_e:Ke?Ve:p*_e});var vt=ue.color,xt=ge.color,Pt=Me.color;(xt||Pt)&&(ee.selectedColorFn=function(me){var _e=me.mcc||vt;return me.selected?xt||_e:Pt||_e});var mt=ue.size,Mt=ge.size,lt=Me.size,qe=Mt!==void 0,Ye=lt!==void 0;return s.traceIs(ae,"symbols")&&(qe||Ye)&&(ee.selectedSizeFn=function(me){var _e=me.mrc||mt/2;return me.selected?qe?Mt/2:_e:Ye?lt/2:_e}),ee},_.makeSelectedTextStyleFns=function(ae){var ee={},ie=ae.selected||{},Q=ae.unselected||{},ue=ae.textfont||{},ge=ie.textfont||{},Me=Q.textfont||{},Te=ue.color,je=ge.color,Ve=Me.color;return ee.selectedTextColorFn=function(Ze){var Ke=Ze.tc||Te;return Ze.selected?je||Ke:Ve||(je?Ke:l.addOpacity(Ke,p))},ee},_.selectedPointStyle=function(ae,ee){if(!(!ae.size()||!ee.selectedpoints)){var ie=_.makeSelectedPointStyleFns(ee),Q=ee.marker||{},ue=[];ie.selectedOpacityFn&&ue.push(function(ge,Me){ge.style("opacity",ie.selectedOpacityFn(Me))}),ie.selectedColorFn&&ue.push(function(ge,Me){l.fill(ge,ie.selectedColorFn(Me))}),ie.selectedSizeFn&&ue.push(function(ge,Me){var Te=Me.mx||Q.symbol||0,je=ie.selectedSizeFn(Me);ge.attr("d",b(_.symbolNumber(Te),je,fe(Me,ee),q(Me,ee))),Me.mrc2=je}),ue.length&&ae.each(function(ge){for(var Me=t.select(this),Te=0;Te0?ie:0}_.textPointStyle=function(ae,ee,ie){if(ae.size()){var Q;if(ee.selectedpoints){var ue=_.makeSelectedTextStyleFns(ee);Q=ue.selectedTextColorFn}var ge=ee.texttemplate,Me=ie._fullLayout;ae.each(function(Te){var je=t.select(this),Ve=ge?i.extractOption(Te,ee,"txt","texttemplate"):i.extractOption(Te,ee,"tx","text");if(!Ve&&Ve!==0){je.remove();return}if(ge){var Ze=ee._module.formatLabels,Ke=Ze?Ze(Te,ee,Me):{},vt={};y(vt,ee,Te.i),Ve=i.texttemplateString({data:[vt,Te,ee._meta],fallback:ee.texttemplatefallback,labels:Ke,locale:Me._d3locale,template:Ve})}var xt=Te.tp||ee.textposition,Pt=P(Te,ee),mt=Q?Q(Te):Te.tc||ee.textfont.color;je.call(_.font,{family:Te.tf||ee.textfont.family,weight:Te.tw||ee.textfont.weight,style:Te.ty||ee.textfont.style,variant:Te.tv||ee.textfont.variant,textcase:Te.tC||ee.textfont.textcase,lineposition:Te.tE||ee.textfont.lineposition,shadow:Te.tS||ee.textfont.shadow,size:Pt,color:mt}).text(Ve).call(c.convertToTspans,ie).call(R,xt,Pt,Te.mrc)})}},_.selectedTextStyle=function(ae,ee){if(!(!ae.size()||!ee.selectedpoints)){var ie=_.makeSelectedTextStyleFns(ee);ae.each(function(Q){var ue=t.select(this),ge=ie.selectedTextColorFn(Q),Me=Q.tp||ee.textposition,Te=P(Q,ee);l.fill(ue,ge);var je=s.traceIs(ee,"bar-like");R(ue,Me,Te,Q.mrc2||Q.mrc,je)})}};var z=.5;_.smoothopen=function(ae,ee){if(ae.length<3)return"M"+ae.join("L");var ie="M"+ae[0],Q=[],ue;for(ue=1;ue=je||me>=Ze&&me<=je)&&(_e<=Ke&&_e>=Ve||_e>=Ke&&_e<=Ve)&&(ae=[me,_e])}return ae}_.applyBackoff=J,_.makeTester=function(){var ae=i.ensureSingleById(t.select("body"),"svg","js-plotly-tester",function(ie){ie.attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),ee=i.ensureSingle(ae,"path","js-reference-point",function(ie){ie.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});_.tester=ae,_.testref=ee},_.savedBBoxes={};var N=0,H=1e4;_.bBox=function(ae,ee,ie){ie||(ie=$(ae));var Q;if(ie){if(Q=_.savedBBoxes[ie],Q)return i.extendFlat({},Q)}else if(ae.childNodes.length===1){var ue=ae.childNodes[0];if(ie=$(ue),ie){var ge=+ue.getAttribute("x")||0,Me=+ue.getAttribute("y")||0,Te=ue.getAttribute("transform");if(!Te){var je=_.bBox(ue,!1,ie);return ge&&(je.left+=ge,je.right+=ge),Me&&(je.top+=Me,je.bottom+=Me),je}if(ie+="~"+ge+"~"+Me+"~"+Te,Q=_.savedBBoxes[ie],Q)return i.extendFlat({},Q)}}var Ve,Ze;ee?Ve=ae:(Ze=_.tester.node(),Ve=ae.cloneNode(!0),Ze.appendChild(Ve)),t.select(Ve).attr("transform",null).call(c.positionText,0,0);var Ke=Ve.getBoundingClientRect(),vt=_.testref.node().getBoundingClientRect();ee||Ze.removeChild(Ve);var xt={height:Ke.height,width:Ke.width,left:Ke.left-vt.left,top:Ke.top-vt.top,right:Ke.right-vt.left,bottom:Ke.bottom-vt.top};return N>=H&&(_.savedBBoxes={},N=0),ie&&(_.savedBBoxes[ie]=xt),N++,i.extendFlat({},xt)};function $(ae){var ee=ae.getAttribute("data-unformatted");if(ee!==null)return ee+ae.getAttribute("data-math")+ae.getAttribute("text-anchor")+ae.getAttribute("style")}_.setClipUrl=function(ae,ee,ie){ae.attr("clip-path",U(ee,ie))};function U(ae,ee){if(!ae)return null;var ie=ee._context,Q=ie._exportedPlot?"":ie._baseUrl||"";return Q?"url('"+Q+"#"+ae+"')":"url(#"+ae+")"}_.getTranslate=function(ae){var ee=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,ie=ae.attr?"attr":"getAttribute",Q=ae[ie]("transform")||"",ue=Q.replace(ee,function(ge,Me,Te){return[Me,Te].join(" ")}).split(" ");return{x:+ue[0]||0,y:+ue[1]||0}},_.setTranslate=function(ae,ee,ie){var Q=/(\btranslate\(.*?\);?)/,ue=ae.attr?"attr":"getAttribute",ge=ae.attr?"attr":"setAttribute",Me=ae[ue]("transform")||"";return ee=ee||0,ie=ie||0,Me=Me.replace(Q,"").trim(),Me+=u(ee,ie),Me=Me.trim(),ae[ge]("transform",Me),Me},_.getScale=function(ae){var ee=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,ie=ae.attr?"attr":"getAttribute",Q=ae[ie]("transform")||"",ue=Q.replace(ee,function(ge,Me,Te){return[Me,Te].join(" ")}).split(" ");return{x:+ue[0]||1,y:+ue[1]||1}},_.setScale=function(ae,ee,ie){var Q=/(\bscale\(.*?\);?)/,ue=ae.attr?"attr":"getAttribute",ge=ae.attr?"attr":"setAttribute",Me=ae[ue]("transform")||"";return ee=ee||1,ie=ie||1,Me=Me.replace(Q,"").trim(),Me+="scale("+ee+","+ie+")",Me=Me.trim(),ae[ge]("transform",Me),Me};var V=/\s*sc.*/;_.setPointGroupScale=function(ae,ee,ie){if(ee=ee||1,ie=ie||1,!!ae){var Q=ee===1&&ie===1?"":"scale("+ee+","+ie+")";ae.each(function(){var ue=(this.getAttribute("transform")||"").replace(V,"");ue+=Q,ue=ue.trim(),this.setAttribute("transform",ue)})}};var j=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(ae,ee,ie){ae&&ae.each(function(){var Q,ue=t.select(this),ge=ue.select("text");if(ge.node()){var Me=parseFloat(ge.attr("x")||0),Te=parseFloat(ge.attr("y")||0),je=(ue.attr("transform")||"").match(j);ee===1&&ie===1?Q=[]:Q=[u(Me,Te),"scale("+ee+","+ie+")",u(-Me,-Te)],je&&Q.push(je),ue.attr("transform",Q.join(""))}})};function q(ae,ee){var ie;return ae&&(ie=ae.mf),ie===void 0&&(ie=ee.marker&&ee.marker.standoff||0),!ee._geo&&!ee._xA?-ie:ie}_.getMarkerStandoff=q;var Y=Math.atan2,K=Math.cos,te=Math.sin;function ne(ae,ee){var ie=ee[0],Q=ee[1];return[ie*K(ae)-Q*te(ae),ie*te(ae)+Q*K(ae)]}var se,le,ce,pe,xe,ye;function fe(ae,ee){var ie=ae.ma;ie===void 0&&(ie=ee.marker.angle,(!o(ie)||i.isArrayOrTypedArray(ie))&&(ie=0));var Q,ue,ge=ee.marker.angleref;if(ge==="previous"||ge==="north"){if(ee._geo){var Me=ee._geo.project(ae.lonlat);Q=Me[0],ue=Me[1]}else{var Te=ee._xA,je=ee._yA;if(Te&&je)Q=Te.c2p(ae.x),ue=je.c2p(ae.y);else return 90}if(ee._geo){var Ve=ae.lonlat[0],Ze=ae.lonlat[1],Ke=ee._geo.project([Ve,Ze+1e-5]),vt=ee._geo.project([Ve+1e-5,Ze]),xt=Y(vt[1]-ue,vt[0]-Q),Pt=Y(Ke[1]-ue,Ke[0]-Q),mt;if(ge==="north")mt=ie/180*Math.PI;else if(ge==="previous"){var Mt=Ve/180*Math.PI,lt=Ze/180*Math.PI,qe=se/180*Math.PI,Ye=le/180*Math.PI,me=qe-Mt,_e=K(Ye)*te(me),Ae=te(Ye)*K(lt)-K(Ye)*te(lt)*K(me);mt=-Y(_e,Ae)-Math.PI,se=Ve,le=Ze}var ke=ne(xt,[K(mt),0]),Ee=ne(Pt,[te(mt),0]);ie=Y(ke[1]+Ee[1],ke[0]+Ee[0])/Math.PI*180,ge==="previous"&&!(ye===ee.uid&&ae.i===xe+1)&&(ie=null)}if(ge==="previous"&&!ee._geo)if(ye===ee.uid&&ae.i===xe+1&&o(Q)&&o(ue)){var De=Q-ce,Je=ue-pe,Ue=ee.line&&ee.line.shape||"",at=Ue.slice(Ue.length-1);at==="h"&&(Je=0),at==="v"&&(De=0),ie+=Y(Je,De)/Math.PI*180+90}else ie=null}return ce=Q,pe=ue,xe=ae.i,ye=ee.uid,ie}_.getMarkerAngle=fe}}),xv=de({"src/components/titles/index.js"(e,r){"use strict";var t=Yr(),i=da(),a=Es(),o=Ma(),s=Qt(),l=s.strTranslate,n=hn(),u=ta(),c=Zo(),f=Ap(),h=Bl().OPPOSITE_SIDE,d=/ [XY][0-9]* /,p=1.6,g=1.6;function m(y,_,v){var x=y._fullLayout,S=v.propContainer,M=v.propName,C=v.placeholder,w=v.traceIndex,k=v.avoid||{},A=v.attributes,b=v.transform,E=v.containerGroup,T=1,F=S.title,D=(F&&F.text?F.text:"").trim(),R=!1,P=F&&F.font?F.font:{},z=P.family,I=P.size,L=P.color,B=P.weight,O=P.style,G=P.variant,W=P.textcase,X=P.lineposition,Z=P.shadow,J=v.subtitlePropName,N=!!J,H=v.subtitlePlaceholder,$=(S.title||{}).subtitle||{text:"",font:{}},U=($.text||"").trim(),V=!1,j=1,q=$.font,Y=q.family,K=q.size,te=q.color,ne=q.weight,se=q.style,le=q.variant,ce=q.textcase,pe=q.lineposition,xe=q.shadow,ye;M==="title.text"?ye="titleText":M.indexOf("axis")!==-1?ye="axisTitleText":M.indexOf("colorbar")!==-1&&(ye="colorbarTitleText");var fe=y._context.edits[ye];function ae(xt,Pt){return xt===void 0||Pt===void 0?!1:xt.replace(d," % ")===Pt.replace(d," % ")}D===""?T=0:ae(D,C)&&(fe||(D=""),T=.2,R=!0),N&&(U===""?j=0:ae(U,H)&&(fe||(U=""),j=.2,V=!0)),v._meta?D=s.templateString(D,v._meta):x._meta&&(D=s.templateString(D,x._meta));var ee=D||U||fe,ie;E||(E=s.ensureSingle(x._infolayer,"g","g-"+_),ie=x._hColorbarMoveTitle);var Q=E.selectAll("text."+_).data(ee?[0]:[]);Q.enter().append("text"),Q.text(D).attr("class",_),Q.exit().remove();var ue=null,ge=_+"-subtitle",Me=U||fe;if(N&&(ue=E.selectAll("text."+ge).data(Me?[0]:[]),ue.enter().append("text"),ue.text(U).attr("class",ge),ue.exit().remove()),!ee)return E;function Te(xt,Pt){s.syncOrAsync([je,Ve],{title:xt,subtitle:Pt})}function je(xt){var Pt=xt.title,mt=xt.subtitle,Mt;!b&&ie&&(b={}),b?(Mt="",b.rotate&&(Mt+="rotate("+[b.rotate,A.x,A.y]+")"),(b.offset||ie)&&(Mt+=l(0,(b.offset||0)-(ie||0)))):Mt=null,Pt.attr("transform",Mt);function lt(ke){if(ke){var Ee=t.select(ke.node().parentNode).select("."+ge);if(!Ee.empty()){var De=ke.node().getBBox();if(De.height){var Je=De.y+De.height+p*K;Ee.attr("y",Je)}}}}if(Pt.style("opacity",T*u.opacity(L)).call(n.font,{color:u.rgb(L),size:t.round(I,2),family:z,weight:B,style:O,variant:G,textcase:W,shadow:Z,lineposition:X}).attr(A).call(c.convertToTspans,y,lt),mt&&!mt.empty()){var qe=E.select("."+_+"-math-group"),Ye=Pt.node().getBBox(),me=qe.node()?qe.node().getBBox():void 0,_e=me?me.y+me.height+p*K:Ye.y+Ye.height+g*K,Ae=s.extendFlat({},A,{y:_e});mt.attr("transform",Mt),mt.style("opacity",j*u.opacity(te)).call(n.font,{color:u.rgb(te),size:t.round(K,2),family:Y,weight:ne,style:se,variant:le,textcase:ce,shadow:xe,lineposition:pe}).attr(Ae).call(c.convertToTspans,y)}return a.previousPromises(y)}function Ve(xt){var Pt=xt.title,mt=t.select(Pt.node().parentNode);if(k&&k.selection&&k.side&&D){mt.attr("transform",null);var Mt=h[k.side],lt=k.side==="left"||k.side==="top"?-1:1,qe=i(k.pad)?k.pad:2,Ye=n.bBox(mt.node()),me={t:0,b:0,l:0,r:0},_e=y._fullLayout._reservedMargin;for(var Ae in _e)for(var ke in _e[Ae]){var Ee=_e[Ae][ke];me[ke]=Math.max(me[ke],Ee)}var De={left:me.l,top:me.t,right:x.width-me.r,bottom:x.height-me.b},Je=k.maxShift||lt*(De[k.side]-Ye[k.side]),Ue=0;if(Je<0)Ue=Je;else{var at=k.offsetLeft||0,rt=k.offsetTop||0;Ye.left-=at,Ye.right-=at,Ye.top-=rt,Ye.bottom-=rt,k.selection.each(function(){var At=n.bBox(this);s.bBoxIntersect(Ye,At,qe)&&(Ue=Math.max(Ue,lt*(At[k.side]-Ye[Mt])+qe))}),Ue=Math.min(Je,Ue),S._titleScoot=Math.abs(Ue)}if(Ue>0||Je<0){var ft={left:[-Ue,0],right:[Ue,0],top:[0,-Ue],bottom:[0,Ue]}[k.side];mt.attr("transform",l(ft[0],ft[1]))}}}Q.call(Te,ue);function Ze(xt,Pt){xt.text(Pt).on("mouseover.opacity",function(){t.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){t.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}if(fe&&(D?Q.on(".opacity",null):(Ze(Q,C),R=!0),Q.call(c.makeEditable,{gd:y}).on("edit",function(xt){w!==void 0?o.call("_guiRestyle",y,M,xt,w):o.call("_guiRelayout",y,M,xt)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Te)}).on("input",function(xt){this.text(xt||" ").call(c.positionText,A.x,A.y)}),N)){if(N&&!D){var Ke=Q.node().getBBox(),vt=Ke.y+Ke.height+g*K;ue.attr("y",vt)}U?ue.on(".opacity",null):(Ze(ue,H),V=!0),ue.call(c.makeEditable,{gd:y}).on("edit",function(xt){o.call("_guiRelayout",y,"title.subtitle.text",xt)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Te)}).on("input",function(xt){this.text(xt||" ").call(c.positionText,ue.attr("x"),ue.attr("y"))})}return Q.classed("js-placeholder",R),ue&&!ue.empty()&&ue.classed("js-placeholder",V),E}r.exports={draw:m,SUBTITLE_PADDING_EM:g,SUBTITLE_PADDING_MATHJAX_EM:p}}}),Yd=de({"src/plots/cartesian/set_convert.js"(e,r){"use strict";var t=Yr(),i=eo().utcFormat,a=Qt(),o=a.numberFormat,s=da(),l=a.cleanNumber,n=a.ms2DateTime,u=a.dateTime2ms,c=a.ensureNumber,f=a.isArrayOrTypedArray,h=cn(),d=h.FP_SAFE,p=h.BADNUM,g=h.LOG_CLIP,m=h.ONEWEEK,y=h.ONEDAY,_=h.ONEHOUR,v=h.ONEMIN,x=h.ONESEC,S=Hs(),M=zl(),C=M.HOUR_PATTERN,w=M.WEEKDAY_PATTERN;function k(b){return Math.pow(10,b)}function A(b){return b!=null}r.exports=function(E,T){T=T||{};var F=E._id||"x",D=F.charAt(0);function R(U,V){if(U>0)return Math.log(U)/Math.LN10;if(U<=0&&V&&E.range&&E.range.length===2){var j=E.range[0],q=E.range[1];return .5*(j+q-2*g*Math.abs(j-q))}else return p}function P(U,V,j,q){if((q||{}).msUTC&&s(U))return+U;var Y=u(U,j||E.calendar);if(Y===p)if(s(U)){U=+U;var K=Math.floor(a.mod(U+.05,1)*10),te=Math.round(U-K/10);Y=u(new Date(te))+K/10}else return p;return Y}function z(U,V,j){return n(U,V,j||E.calendar)}function I(U){return E._categories[Math.round(U)]}function L(U){if(A(U)){if(E._categoriesMap===void 0&&(E._categoriesMap={}),E._categoriesMap[U]!==void 0)return E._categoriesMap[U];E._categories.push(typeof U=="number"?String(U):U);var V=E._categories.length-1;return E._categoriesMap[U]=V,V}return p}function B(U,V){for(var j=new Array(V),q=0;qE.range[1]&&(j=!j);for(var q=j?-1:1,Y=q*U,K=0,te=0;tese)K=te+1;else{K=Y<(ne+se)/2?te:te+1;break}}var le=E._B[K]||0;return isFinite(le)?X(U,E._m2,le):0},N=function(U){var V=E._rangebreaks.length;if(!V)return Z(U,E._m,E._b);for(var j=0,q=0;qE._rangebreaks[q].pmax&&(j=q+1);return Z(U,E._m2,E._B[j])}}E.c2l=E.type==="log"?R:c,E.l2c=E.type==="log"?k:c,E.l2p=J,E.p2l=N,E.c2p=E.type==="log"?function(U,V){return J(R(U,V))}:J,E.p2c=E.type==="log"?function(U){return k(N(U))}:N,["linear","-"].indexOf(E.type)!==-1?(E.d2r=E.r2d=E.d2c=E.r2c=E.d2l=E.r2l=l,E.c2d=E.c2r=E.l2d=E.l2r=c,E.d2p=E.r2p=function(U){return E.l2p(l(U))},E.p2d=E.p2r=N,E.cleanPos=c):E.type==="log"?(E.d2r=E.d2l=function(U,V){return R(l(U),V)},E.r2d=E.r2c=function(U){return k(l(U))},E.d2c=E.r2l=l,E.c2d=E.l2r=c,E.c2r=R,E.l2d=k,E.d2p=function(U,V){return E.l2p(E.d2r(U,V))},E.p2d=function(U){return k(N(U))},E.r2p=function(U){return E.l2p(l(U))},E.p2r=N,E.cleanPos=c):E.type==="date"?(E.d2r=E.r2d=a.identity,E.d2c=E.r2c=E.d2l=E.r2l=P,E.c2d=E.c2r=E.l2d=E.l2r=z,E.d2p=E.r2p=function(U,V,j){return E.l2p(P(U,0,j))},E.p2d=E.p2r=function(U,V,j){return z(N(U),V,j)},E.cleanPos=function(U){return a.cleanDate(U,p,E.calendar)}):E.type==="category"?(E.d2c=E.d2l=L,E.r2d=E.c2d=E.l2d=I,E.d2r=E.d2l_noadd=G,E.r2c=function(U){var V=W(U);return V!==void 0?V:E.fraction2r(.5)},E.l2r=E.c2r=c,E.r2l=W,E.d2p=function(U){return E.l2p(E.r2c(U))},E.p2d=function(U){return I(N(U))},E.r2p=E.d2p,E.p2r=N,E.cleanPos=function(U){return typeof U=="string"&&U!==""?U:c(U)}):E.type==="multicategory"&&(E.r2d=E.c2d=E.l2d=I,E.d2r=E.d2l_noadd=G,E.r2c=function(U){var V=G(U);return V!==void 0?V:E.fraction2r(.5)},E.r2c_just_indices=O,E.l2r=E.c2r=c,E.r2l=G,E.d2p=function(U){return E.l2p(E.r2c(U))},E.p2d=function(U){return I(N(U))},E.r2p=E.d2p,E.p2r=N,E.cleanPos=function(U){return Array.isArray(U)||typeof U=="string"&&U!==""?U:c(U)},E.setupMultiCategory=function(U){var V=E._traceIndices,j,q,Y=E._matchGroup;if(Y&&E._categories.length===0){for(var K in Y)if(K!==F){var te=T[S.id2name(K)];V=V.concat(te._traceIndices)}}var ne=[[0,{}],[0,{}]],se=[];for(j=0;jte[1]&&(q[K?0:1]=j,Y[1]=te[1]),Y[0]>=Y[1])if(V!==void 0){var ne=te[0]+1;j!==void 0&&(ne=Math.min(ne,te[1])),q[K?0:1]=E.l2r(ne)}else j!==void 0&&(q[K?1:0]=E.l2r(te[1]-1))}},E.cleanRange=function(U,V){E._cleanRange(U,V),E.limitRange(U)},E._cleanRange=function(U,V){V||(V={}),U||(U="range");var j=a.nestedProperty(E,U).get(),q,Y;if(E.type==="date"?Y=a.dfltRange(E.calendar):D==="y"?Y=M.DFLTRANGEY:E._name==="realaxis"?Y=[0,1]:Y=V.dfltRange||M.DFLTRANGEX,Y=Y.slice(),(E.rangemode==="tozero"||E.rangemode==="nonnegative")&&(Y[0]=0),!j||j.length!==2){a.nestedProperty(E,U).set(Y);return}var K=j[0]===null,te=j[1]===null;for(E.type==="date"&&!E.autorange&&(j[0]=a.cleanDate(j[0],p,E.calendar),j[1]=a.cleanDate(j[1],p,E.calendar)),q=0;q<2;q++)if(E.type==="date"){if(!a.isDateTime(j[q],E.calendar)){E[U]=Y;break}if(E.r2l(j[0])===E.r2l(j[1])){var ne=a.constrain(E.r2l(j[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);j[0]=E.l2r(ne-1e3),j[1]=E.l2r(ne+1e3);break}}else{if(!s(j[q]))if(!(K||te)&&s(j[1-q]))j[q]=j[1-q]*(q?10:.1);else{E[U]=Y;break}if(j[q]<-d?j[q]=-d:j[q]>d&&(j[q]=d),j[0]===j[1]){var se=Math.max(1,Math.abs(j[0]*1e-6));j[0]-=se,j[1]+=se}}},E.setScale=function(U){var V=T._size;if(E.overlaying){var j=S.getFromId({_fullLayout:T},E.overlaying);E.domain=j.domain}var q=U&&E._r?"_r":"range",Y=E.calendar;E.cleanRange(q);var K=E.r2l(E[q][0],Y),te=E.r2l(E[q][1],Y),ne=D==="y";if(ne?(E._offset=V.t+(1-E.domain[1])*V.h,E._length=V.h*(E.domain[1]-E.domain[0]),E._m=E._length/(K-te),E._b=-E._m*te):(E._offset=V.l+E.domain[0]*V.w,E._length=V.w*(E.domain[1]-E.domain[0]),E._m=E._length/(te-K),E._b=-E._m*K),E._rangebreaks=[],E._lBreaks=0,E._m2=0,E._B=[],E.rangebreaks){var se,le;if(E._rangebreaks=E.locateBreaks(Math.min(K,te),Math.max(K,te)),E._rangebreaks.length){for(se=0;sete&&(ce=!ce),ce&&E._rangebreaks.reverse();var pe=ce?-1:1;for(E._m2=pe*E._length/(Math.abs(te-K)-E._lBreaks),E._B.push(-E._m2*(ne?te:K)),se=0;seY&&(Y+=7,KY&&(Y+=24,K=q&&K=q&&U=Te.min&&(QTe.max&&(Te.max=ue),ge=!1)}ge&&te.push({min:Q,max:ue})}};for(j=0;jx*2}function h(g){return Math.max(1,(g-1)/1e3)}function d(g,m){for(var y=g.length,_=h(y),v=0,x=0,S={},M=0;Mv*2}function p(g){return o(g[0])&&o(g[1])}}}),vd=de({"src/plots/cartesian/autorange.js"(e,r){"use strict";var t=Yr(),i=da(),a=Qt(),o=cn().FP_SAFE,s=Ma(),l=hn(),n=Hs(),u=n.getFromId,c=n.isLinked;r.exports={applyAutorangeOptions:E,getAutoRange:f,makePadFn:d,doAutoRange:y,findExtremes:_,concatExtremes:m};function f(T,F){var D,R,P=[],z=T._fullLayout,I=d(z,F,0),L=d(z,F,1),B=m(T,F),O=B.min,G=B.max;if(O.length===0||G.length===0)return a.simpleMap(F.range,F.r2l);var W=O[0].val,X=G[0].val;for(D=1;D0&&(se=V-I(Y)-L(K),se>j?le/se>q&&(te=Y,ne=K,q=le/se):le/V>q&&(te={val:Y.val,nopad:1},ne={val:K.val,nopad:1},q=le/V));function ce(ae,ee){return Math.max(ae,L(ee))}if(W===X){var pe=W-1,xe=W+1;if($)if(W===0)P=[0,1];else{var ye=(W>0?G:O).reduce(ce,0),fe=W/(1-Math.min(.5,ye/V));P=W>0?[0,fe]:[fe,0]}else U?P=[Math.max(0,pe),Math.max(1,xe)]:P=[pe,xe]}else $?(te.val>=0&&(te={val:0,nopad:1}),ne.val<=0&&(ne={val:0,nopad:1})):U&&(te.val-q*I(te)<0&&(te={val:0,nopad:1}),ne.val<=0&&(ne={val:1,nopad:1})),q=(ne.val-te.val-h(F,Y.val,K.val))/(V-I(te)-L(ne)),P=[te.val-q*I(te),ne.val+q*L(ne)];return P=E(P,F),F.limitRange&&F.limitRange(),J&&P.reverse(),a.simpleMap(P,F.l2r||Number)}function h(T,F,D){var R=0;if(T.rangebreaks)for(var P=T.locateBreaks(F,D),z=0;z0?D.ppadplus:D.ppadminus)||D.ppad||0),Y=j((T._m>0?D.ppadminus:D.ppadplus)||D.ppad||0),K=j(D.vpadplus||D.vpad),te=j(D.vpadminus||D.vpad);if(!O){if(U=1/0,V=-1/0,B)for(W=0;W0&&(U=X),X>V&&X-o&&(U=X),X>V&&X=le;W--)se(W);return{min:R,max:P,opts:D}}function v(T,F,D,R){S(T,F,D,R,C)}function x(T,F,D,R){S(T,F,D,R,w)}function S(T,F,D,R,P){for(var z=R.tozero,I=R.extrapad,L=!0,B=0;B=D&&(O.extrapad||!I)){L=!1;break}else P(F,O.val)&&O.pad<=D&&(I||!O.extrapad)&&(T.splice(B,1),B--)}if(L){var G=z&&F===0;T.push({val:F,pad:G?0:D,extrapad:G?!1:I})}}function M(T){return i(T)&&Math.abs(T)=F}function k(T,F){var D=F.autorangeoptions;return D&&D.minallowed!==void 0&&b(F,D.minallowed,D.maxallowed)?D.minallowed:D&&D.clipmin!==void 0&&b(F,D.clipmin,D.clipmax)?Math.max(T,F.d2l(D.clipmin)):T}function A(T,F){var D=F.autorangeoptions;return D&&D.maxallowed!==void 0&&b(F,D.minallowed,D.maxallowed)?D.maxallowed:D&&D.clipmax!==void 0&&b(F,D.clipmin,D.clipmax)?Math.min(T,F.d2l(D.clipmax)):T}function b(T,F,D){return F!==void 0&&D!==void 0?(F=T.d2l(F),D=T.d2l(D),F=B&&(z=B,D=B),I<=B&&(I=B,R=B)}}return D=k(D,F),R=A(R,F),[D,R]}}}),nn=de({"src/plots/cartesian/axes.js"(e,r){"use strict";var t=Yr(),i=da(),a=Es(),o=Ma(),s=Qt(),l=s.strTranslate,n=Zo(),u=xv(),c=ta(),f=hn(),h=Mu(),d=EE(),p=zl(),g=cn(),m=g.ONEMAXYEAR,y=g.ONEAVGYEAR,_=g.ONEMINYEAR,v=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,S=g.ONEMINQUARTER,M=g.ONEMAXMONTH,C=g.ONEAVGMONTH,w=g.ONEMINMONTH,k=g.ONEWEEK,A=g.ONEDAY,b=A/2,E=g.ONEHOUR,T=g.ONEMIN,F=g.ONESEC,D=g.ONEMILLI,R=g.ONEMICROSEC,P=g.MINUS_SIGN,z=g.BADNUM,I={K:"zeroline"},L={K:"gridline",L:"path"},B={K:"minor-gridline",L:"path"},O={K:"tick",L:"path"},G={K:"tick",L:"text"},W={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},X=Bl(),Z=X.MID_SHIFT,J=X.CAP_SHIFT,N=X.LINE_SPACING,H=X.OPPOSITE_SIDE,$=3,U=r.exports={};U.setConvert=Yd();var V=h1(),j=Hs(),q=j.idSort,Y=j.isLinked;U.id2name=j.id2name,U.name2id=j.name2id,U.cleanId=j.cleanId,U.list=j.list,U.listIds=j.listIds,U.getFromId=j.getFromId,U.getFromTrace=j.getFromTrace;var K=vd();U.getAutoRange=K.getAutoRange,U.findExtremes=K.findExtremes;var te=1e-4;function ne(Be){var Fe=(Be[1]-Be[0])*te;return[Be[0]-Fe,Be[1]+Fe]}function se(Be,Fe,Et){if(![Et,Be,Fe].every(i)||Et===0)return Be;let St=Math.round((Be-Fe)/Et),zt=Fe+St*Et;return Be!==zt&&Math.abs(Be-zt)It+" domain")),tt=tt.concat(Wt||[]),wt.length>Yt?(s.warn("Array attribute "+ct+" has more entries than expected, truncating to "+Yt),wt=wt.slice(0,Yt)):wt.length2e-6||((Et-Be._forceTick0)/Be._minDtick%1+1.000001)%1>2e-6)&&(Be._minDtick=0))},U.saveRangeInitial=function(Be,Fe){for(var Et=U.list(Be,"",!0),St=!1,zt=0;ztNt*.3||ct(St)||ct(zt))){var It=Et.dtick/2;Be+=Be+ItYt){var ze=Number(Et.slice(1));Wt.exactYears>Yt&&ze%12===0?Be=U.tickIncrement(Be,"M6","reverse")+A*1.5:Wt.exactMonths>Yt?Be=U.tickIncrement(Be,"M1","reverse")+A*15.5:Be-=b;var tt=U.tickIncrement(Be,Et);if(tt<=St)return tt}return Be}U.prepMinorTicks=function(Be,Fe,Et){var St,zt;if(!((St=Fe.minor)!=null&&St.dtick)){delete Be.dtick;var Wt=Fe.dtick&&i(Fe._tmin),Yt;if(Wt){var ze=U.tickIncrement(Fe._tmin,Fe.dtick,!0);Yt=[Fe._tmin,ze*.99+Fe._tmin*.01]}else{var tt=s.simpleMap(Fe.range,Fe.r2l);Yt=[tt[0],.8*tt[0]+.2*tt[1]]}if(Be.range=s.simpleMap(Yt,Fe.l2r),Be._isMinor=!0,U.prepTicks(Be,Et),Wt){var ct=i(Fe.dtick),wt=i(Be.dtick),Nt=ct?Fe.dtick:+Fe.dtick.substring(1),It=wt?Be.dtick:+Be.dtick.substring(1);ct&&wt?fe(Nt,It)?Nt===2*k&&It===2*A&&(Be.dtick=k):Nt===2*k&&It===3*A?Be.dtick=k:Nt===k&&!(Fe._input.minor||{}).nticks?Be.dtick=A:ae(Nt/It,2.5)?Be.dtick=Nt/2:Be.dtick=Nt:String(Fe.dtick).charAt(0)==="M"?wt?Be.dtick="M1":fe(Nt,It)?Nt>=12&&It===2&&(Be.dtick="M3"):Be.dtick=Fe.dtick:String(Be.dtick).charAt(0)==="L"?String(Fe.dtick).charAt(0)==="L"?fe(Nt,It)||(Be.dtick=ae(Nt/It,2.5)?Fe.dtick/2:Fe.dtick):Be.dtick="D1":Be.dtick==="D2"&&+Fe.dtick>1&&(Be.dtick=1)}Be.range=Fe.range}((zt=Fe.minor)==null?void 0:zt._tick0Init)===void 0&&(Be.tick0=Fe.tick0)};function fe(Be,Fe){return Math.abs((Be/Fe+.5)%1-.5)<.001}function ae(Be,Fe){return Math.abs(Be/Fe-1)<.001}U.prepTicks=function(Be,Fe){var Et=s.simpleMap(Be.range,Be.r2l,void 0,void 0,Fe);if(Be.tickmode==="auto"||!Be.dtick){var St=Be.nticks,zt;St||(Be.type==="category"||Be.type==="multicategory"?(zt=Be.tickfont?s.bigFont(Be.tickfont.size||12):15,St=Be._length/zt):(zt=Be._id.charAt(0)==="y"?40:80,St=s.constrain(Be._length/zt,4,9)+1),Be._name==="radialaxis"&&(St*=2)),Be.minor&&Be.minor.tickmode!=="array"||Be.tickmode==="array"&&(St*=100),Be._roughDTick=Math.abs(Et[1]-Et[0])/St,U.autoTicks(Be,Be._roughDTick),Be._minDtick>0&&Be.dtick0?(Wt=St-1,Yt=St):(Wt=St,Yt=St);var ze=Be[Wt].value,tt=Be[Yt].value,ct=Math.abs(tt-ze),wt=Et||ct,Nt=0;wt>=_?ct>=_&&ct<=m?Nt=ct:Nt=y:Et===x&&wt>=S?ct>=S&&ct<=v?Nt=ct:Nt=x:wt>=w?ct>=w&&ct<=M?Nt=ct:Nt=C:Et===k&&wt>=k?Nt=k:wt>=A?Nt=A:Et===b&&wt>=b?Nt=b:Et===E&&wt>=E&&(Nt=E);var It;Nt>=ct&&(Nt=ct,It=!0);var Zt=zt+Nt;if(Fe.rangebreaks&&Nt>0){for(var qt=84,vr=0,Br=0;Brk&&(Nt=ct)}(Nt>0||St===0)&&(Be[St].periodX=zt+Nt/2)}}U.calcTicks=function(Fe,Et){for(var St=Fe.type,zt=Fe.calendar,Wt=Fe.ticklabelstep,Yt=Fe.ticklabelmode==="period",ze=Fe.range[0]>Fe.range[1],tt=!Fe.ticklabelindex||s.isArrayOrTypedArray(Fe.ticklabelindex)?Fe.ticklabelindex:[Fe.ticklabelindex],ct=s.simpleMap(Fe.range,Fe.r2l,void 0,void 0,Et),wt=ct[1]=(ba?0:1);Hi--){var Za=!Hi;Hi?(Fe._dtickInit=Fe.dtick,Fe._tick0Init=Fe.tick0):ba&&(Fe.minor._dtickInit=Fe.minor.dtick,Fe.minor._tick0Init=Fe.minor.tick0);var oa=Hi?Fe:s.extendFlat({},Fe,ba?Fe.minor:{minor:{}});if(Za?U.prepMinorTicks(oa,Fe,Et):U.prepTicks(oa,Et),oa.tickmode==="array"){Hi?(Br=[],qt=Me(Fe,!Za)):(Pr=[],vr=Me(Fe,!Za));continue}if(oa.tickmode==="sync"){Br=[],qt=ge(Fe);continue}var Cn=ne(ct),_n=Cn[0],Li=Cn[1],In=i(oa.dtick),pn=St==="log"&&!(In||oa.dtick.charAt(0)==="L"),Ka=U.tickFirst(oa,Et);if(Hi){if(Fe._tmin=Ka,Ka<_n!==wt)break;(St==="category"||St==="multicategory")&&(Li=wt?Math.max(-.5,Li):Math.min(Fe._categories.length-.5,Li))}var Rn=null,tn=Ka,Mn;if(Hi){var Kn;In?Kn=Fe.dtick:St==="date"?typeof Fe.dtick=="string"&&Fe.dtick.charAt(0)==="M"&&(Kn=C*Fe.dtick.substring(1)):Kn=Fe._roughDTick,Mn=Math.round((Fe.r2l(tn)-Fe.r2l(Fe.tick0))/Kn)-1}var zn=oa.dtick,ua=St==="linear"?oa.r2l(oa.tick0):void 0;for(oa.rangebreaks&&oa._tick0Init!==oa.tick0&&(tn=xi(tn,Fe),wt||(tn=U.tickIncrement(tn,zn,!wt,zt))),(Hi||tt)&&Yt&&(tn=U.tickIncrement(tn,zn,!wt,zt),Hi&&Mn--);wt?tn>=Li:tn<=Li;tn=U.tickIncrement(tn,zn,wt,zt)){if(Hi&&Mn++,oa.rangebreaks&&!wt){if(tn<_n)continue;if(oa.maskBreaks(tn)===z&&xi(tn,oa)>=It)break}if(Br.length>Zt||tn===Rn)break;Rn=tn;var Ea={value:se(tn,ua,zn)};Hi?(tn===Ka&&(Ea.first=!0),pn&&tn!==(tn|0)&&(Ea.simpleLabel=!0),Wt>1&&Mn%Wt&&(Ea.skipLabel=!0),Br.push(Ea)):(Ea.minor=!0,Pr.push(Ea))}}if(!Pr||Pr.length<3)tt=!1;else{var ln=(Pr[2].value-Pr[1].value)*(ze?-1:1);Jr(ln,Fe.tickformat)||(tt=!1,Pr=Pr.slice(1))}if(!tt)Mi=Br;else{var on=Br.concat(Pr);Yt&&Br.length&&(on=on.slice(1)),on=on.sort(function(go,Xn){return go.value-Xn.value}).filter(function(go,Xn,On){return Xn===0||go.value!==On[Xn-1].value});var ao=on.map(function(go,Xn){return go.minor===void 0&&!go.skipLabel?Xn:null}).filter(function(go){return go!==null});ao.forEach(function(go){tt.map(function(Xn){var On=go+Xn;On>=0&&On-1;Bn--){if(Br[Bn].drop){Br.splice(Bn,1);continue}Br[Bn].value=xi(Br[Bn].value,Fe);var Mo=Fe.c2p(Br[Bn].value);(ps?no>Mo-xo:noIt||UoIt&&(On.periodX=It),Uozt&&qtzt&&Bry)Fe/=y,St=zt(10),Be.dtick="M"+12*Pt(Fe,St,Te);else if(Wt>C)Fe/=C,Be.dtick="M"+Pt(Fe,1,je);else if(Wt>A){if(Be.dtick=Pt(Fe,A,Be._hasDayOfWeekBreaks?[1,2,7,14]:Ze),!Et){var Yt=U.getTickFormat(Be),ze=Be.ticklabelmode==="period";ze&&(Be._rawTick0=Be.tick0),/%[uVW]/.test(Yt)?Be.tick0=s.dateTick0(Be.calendar,2):Be.tick0=s.dateTick0(Be.calendar,1),ze&&(Be._dowTick0=Be.tick0)}}else Wt>E?Be.dtick=Pt(Fe,E,je):Wt>T?Be.dtick=Pt(Fe,T,Ve):Wt>F?Be.dtick=Pt(Fe,F,Ve):(St=zt(10),Be.dtick=Pt(Fe,St,Te))}else if(Be.type==="log"){Be.tick0=0;var tt=s.simpleMap(Be.range,Be.r2l);if(Be._isMinor&&(Fe*=1.5),Fe>.7)Be.dtick=Math.ceil(Fe);else if(Math.abs(tt[1]-tt[0])<1){var ct=1.5*Math.abs((tt[1]-tt[0])/Fe);Fe=Math.abs(Math.pow(10,tt[1])-Math.pow(10,tt[0]))/ct,St=zt(10),Be.dtick="L"+Pt(Fe,St,Te)}else Be.dtick=Fe>.3?"D2":"D1"}else Be.type==="category"||Be.type==="multicategory"?(Be.tick0=0,Be.dtick=Math.ceil(Math.max(Fe,1))):pa(Be)?(Be.tick0=0,St=1,Be.dtick=Pt(Fe,St,xt)):(Be.tick0=0,St=zt(10),Be.dtick=Pt(Fe,St,Te));if(Be.dtick===0&&(Be.dtick=1),!i(Be.dtick)&&typeof Be.dtick!="string"){var wt=Be.dtick;throw Be.dtick=1,"ax.dtick error: "+String(wt)}};function mt(Be){var Fe=Be.dtick;if(Be._tickexponent=0,!i(Fe)&&typeof Fe!="string"&&(Fe=1),(Be.type==="category"||Be.type==="multicategory")&&(Be._tickround=null),Be.type==="date"){var Et=Be.r2l(Be.tick0),St=Be.l2r(Et).replace(/(^-|i)/g,""),zt=St.length;if(String(Fe).charAt(0)==="M")zt>10||St.slice(5)!=="01-01"?Be._tickround="d":Be._tickround=+Fe.slice(1)%12===0?"y":"m";else if(Fe>=A&&zt<=10||Fe>=A*15)Be._tickround="d";else if(Fe>=T&&zt<=16||Fe>=E)Be._tickround="M";else if(Fe>=F&&zt<=19||Fe>=T)Be._tickround="S";else{var Wt=Be.l2r(Et+Fe).replace(/^-/,"").length;Be._tickround=Math.max(zt,Wt)-20,Be._tickround<0&&(Be._tickround=4)}}else if(i(Fe)||Fe.charAt(0)==="L"){var Yt=Be.range.map(Be.r2d||Number);i(Fe)||(Fe=Number(Fe.slice(1))),Be._tickround=2-Math.floor(Math.log(Fe)/Math.LN10+.01);var ze=Math.max(Math.abs(Yt[0]),Math.abs(Yt[1])),tt=Math.floor(Math.log(ze)/Math.LN10+.01),ct=Be.minexponent===void 0?3:Be.minexponent;Math.abs(tt)>ct&&(Je(Be.exponentformat)&&Be.exponentformat!=="SI extended"&&!Ue(tt)||Je(Be.exponentformat)&&Be.exponentformat==="SI extended"&&!at(tt)?Be._tickexponent=3*Math.round((tt-1)/3):Be._tickexponent=tt)}else Be._tickround=null}U.tickIncrement=function(Be,Fe,Et,St){var zt=Et?-1:1;if(i(Fe))return s.increment(Be,zt*Fe);var Wt=Fe.charAt(0),Yt=zt*Number(Fe.slice(1));if(Wt==="M")return s.incrementMonth(Be,Yt,St);if(Wt==="L")return Math.log(Math.pow(10,Be)+Yt)/Math.LN10;if(Wt==="D"){var ze=Fe==="D2"?vt:Ke,tt=Be+zt*.01,ct=s.roundUp(s.mod(tt,1),ze,Et);return Math.floor(tt)+Math.log(t.round(Math.pow(10,ct),1))/Math.LN10}throw"unrecognized dtick "+String(Fe)},U.tickFirst=function(Be,Fe){var Et=Be.r2l||Number,St=s.simpleMap(Be.range,Et,void 0,void 0,Fe),zt=St[1]=0&&ba<=Be._length?gi:null};if(tt&&s.isArrayOrTypedArray(Be.ticktext)){var qt=s.simpleMap(Be.range,Be.r2l),vr=(Math.abs(qt[1]-qt[0])-(Be._lBreaks||0))/1e4;for(It=0;It"+ze;else{var ct=bi(Be),wt=Be._trueSide||Be.side;(!ct&&wt==="top"||ct&&wt==="bottom")&&(Yt+="
")}Fe.text=Yt}function qe(Be,Fe,Et,St,zt){var Wt=Be.dtick,Yt=Fe.x,ze=Be.tickformat,tt=typeof Wt=="string"&&Wt.charAt(0);if(zt==="never"&&(zt=""),St&&tt!=="L"&&(Wt="L3",tt="L"),ze||tt==="L")Fe.text=ft(Math.pow(10,Yt),Be,zt,St);else if(i(Wt)||tt==="D"&&(Be.minorloglabels==="complete"||s.mod(Yt+.01,1)<.1)){var ct;Be.minorloglabels==="complete"&&!(s.mod(Yt+.01,1)<.1)&&(ct=!0,Fe.fontSize*=.75);var wt=Math.pow(10,Yt).toExponential(0),Nt=wt.split("e"),It=+Nt[1],Zt=Math.abs(It),qt=Be.exponentformat;qt==="power"||Je(qt)&&qt!=="SI extended"&&Ue(It)||Je(qt)&&qt==="SI extended"&&at(It)?(Fe.text=Nt[0],Zt>0&&(Fe.text+="x10"),Fe.text==="1x10"&&(Fe.text="10"),It!==0&&It!==1&&(Fe.text+=""+(It>0?"":P)+Zt+""),Fe.fontSize*=1.25):(qt==="e"||qt==="E")&&Zt>2?Fe.text=Nt[0]+qt+(It>0?"+":P)+Zt:(Fe.text=ft(Math.pow(10,Yt),Be,"","fakehover"),Wt==="D1"&&Be._id.charAt(0)==="y"&&(Fe.dy-=Fe.fontSize/6))}else if(tt==="D")Fe.text=Be.minorloglabels==="none"?"":String(Math.round(Math.pow(10,s.mod(Yt,1)))),Fe.fontSize*=.75;else throw"unrecognized dtick "+String(Wt);if(Be.dtick==="D1"){var vr=String(Fe.text).charAt(0);(vr==="0"||vr==="1")&&(Be._id.charAt(0)==="y"?Fe.dx-=Fe.fontSize/4:(Fe.dy+=Fe.fontSize/2,Fe.dx+=(Be.range[1]>Be.range[0]?1:-1)*Fe.fontSize*(Yt<0?.5:.25)))}}function Ye(Be,Fe){var Et=Be._categories[Math.round(Fe.x)];Et===void 0&&(Et=""),Fe.text=String(Et)}function me(Be,Fe,Et){var St=Math.round(Fe.x),zt=Be._categories[St]||[],Wt=zt[1]===void 0?"":String(zt[1]),Yt=zt[0]===void 0?"":String(zt[0]);Et?Fe.text=Yt+" - "+Wt:(Fe.text=Wt,Fe.text2=Yt)}function _e(Be,Fe,Et,St,zt){zt==="never"?zt="":Be.showexponent==="all"&&Math.abs(Fe.x/Be.dtick)<1e-6&&(zt="hide"),Fe.text=ft(Fe.x,Be,zt,St)}function Ae(Be,Fe,Et,St,zt){if(Be.thetaunit==="radians"&&!Et){var Wt=Fe.x/180;if(Wt===0)Fe.text="0";else{var Yt=ke(Wt);if(Yt[1]>=100)Fe.text=ft(s.deg2rad(Fe.x),Be,zt,St);else{var ze=Fe.x<0;Yt[1]===1?Yt[0]===1?Fe.text="\u03C0":Fe.text=Yt[0]+"\u03C0":Fe.text=["",Yt[0],"","\u2044","",Yt[1],"","\u03C0"].join(""),ze&&(Fe.text=P+Fe.text)}}}else Fe.text=ft(Fe.x,Be,zt,St)}function ke(Be){function Fe(ze,tt){return Math.abs(ze-tt)<=1e-6}function Et(ze,tt){return Fe(tt,0)?ze:Et(tt,ze%tt)}function St(ze){for(var tt=1;!Fe(Math.round(ze*tt)/tt,ze);)tt*=10;return tt}var zt=St(Be),Wt=Be*zt,Yt=Math.abs(Et(Wt,zt));return[Math.round(Wt/Yt),Math.round(zt/Yt)]}var Ee=["f","p","n","\u03BC","m","","k","M","G","T"],De=["q","r","y","z","a",...Ee,"P","E","Z","Y","R","Q"],Je=Be=>["SI","SI extended","B"].includes(Be);function Ue(Be){return Be>14||Be<-15}function at(Be){return Be>32||Be<-30}function rt(Be,Fe){return Je(Fe)?!!(Fe==="SI extended"&&at(Be)||Fe!=="SI extended"&&Ue(Be)):!1}function ft(Be,Fe,Et,St){var zt=Be<0,Wt=Fe._tickround,Yt=Et||Fe.exponentformat||"B",ze=Fe._tickexponent,tt=U.getTickFormat(Fe),ct=Fe.separatethousands;if(St){var wt={exponentformat:Yt,minexponent:Fe.minexponent,dtick:Fe.showexponent==="none"?Fe.dtick:i(Be)&&Math.abs(Be)||1,range:Fe.showexponent==="none"?Fe.range.map(Fe.r2d):[0,Be||1]};mt(wt),Wt=(Number(wt._tickround)||0)+4,ze=wt._tickexponent,Fe.hoverformat&&(tt=Fe.hoverformat)}if(tt)return Fe._numFormat(tt)(Be).replace(/-/g,P);Yt==="none"&&(ze=0),Be=Math.abs(Be);let Nt=Math.pow(10,-Wt)/2;if(Be"+It+"":Yt==="B"&&ze===9?Be+="B":Je(Yt)&&(Be+=Yt==="SI extended"?De[ze/3+10]:Ee[ze/3+5])}return zt?P+Be:Be}U.getTickFormat=function(Be){var Fe;function Et(tt){return typeof tt!="string"?tt:Number(tt.replace("M",""))*C}function St(tt,ct){var wt=["L","D"];if(typeof tt==typeof ct){if(typeof tt=="number")return tt-ct;var Nt=wt.indexOf(tt.charAt(0)),It=wt.indexOf(ct.charAt(0));return Nt===It?Number(tt.replace(/(L|D)/g,""))-Number(ct.replace(/(L|D)/g,"")):Nt-It}else return typeof tt=="number"?1:-1}function zt(tt,ct,wt){var Nt=wt||function(qt){return qt},It=ct[0],Zt=ct[1];return(!It&&typeof It!="number"||Nt(It)<=Nt(tt))&&(!Zt&&typeof Zt!="number"||Nt(Zt)>=Nt(tt))}function Wt(tt,ct){var wt=ct[0]===null,Nt=ct[1]===null,It=St(tt,ct[0])>=0,Zt=St(tt,ct[1])<=0;return(wt||It)&&(Nt||Zt)}var Yt,ze;if(Be.tickformatstops&&Be.tickformatstops.length>0)switch(Be.type){case"date":case"linear":{for(Fe=0;Fe=0&&zt.unshift(zt.splice(wt,1).shift())}});var ze={false:{left:0,right:0}};return s.syncOrAsync(zt.map(function(tt){return function(){if(tt){var ct=U.getFromId(Be,tt);Et||(Et={}),Et.axShifts=ze,Et.overlayingShiftedAx=Yt;var wt=U.drawOne(Be,ct,Et);return ct._shiftPusher&&dn(ct,ct._fullDepth||0,ze,!0),ct._r=ct.range.slice(),ct._rl=s.simpleMap(ct._r,ct.r2l),wt}}}))},U.drawOne=function(Be,Fe,Et){Et=Et||{};var St=Et.axShifts||{},zt=Et.overlayingShiftedAx||[],Wt,Yt,ze;Fe.setScale();var tt=Be._fullLayout,ct=Fe._id,wt=ct.charAt(0),Nt=U.counterLetter(ct),It=tt._plots[Fe._mainSubplot],Zt=Fe.zerolinelayer==="above traces";if(!It)return;if(Fe._shiftPusher=Fe.autoshift||zt.indexOf(Fe._id)!==-1||zt.indexOf(Fe.overlaying)!==-1,Fe._shiftPusher&Fe.anchor==="free"){var qt=Fe.linewidth/2||0;Fe.ticks==="inside"&&(qt+=Fe.ticklen),dn(Fe,qt,St,!0),dn(Fe,Fe.shift||0,St,!1)}(Et.skipTitle!==!0||Fe._shift===void 0)&&(Fe._shift=pi(Fe,St));var vr=It[wt+"axislayer"],Br=Fe._mainLinePosition,Pr=Br+=Fe._shift,Mi=Fe._mainMirrorPosition,gi=Fe._vals=U.calcTicks(Fe),ba=[Fe.mirror,Pr,Mi].join("_");for(Wt=0;Wt0?Xn.bottom-vs:0,go))));var mu=0,Ul=0;if(Fe._shiftPusher&&(mu=Math.max(go,Xn.height>0?So==="l"?vs-Xn.left:Xn.right-vs:0),Fe.title.text!==tt._dfltTitle[wt]&&(Ul=(Fe._titleStandoff||0)+(Fe._titleScoot||0),So==="l"&&(Ul+=$t(Fe))),Fe._fullDepth=Math.max(mu,Ul)),Fe.automargin){On={x:0,y:0,r:0,l:0,t:0,b:0};var gu=[0,1],yu=typeof Fe._shift=="number"?Fe._shift:0;if(wt==="x"){if(So==="b"?On[So]=Fe._depth:(On[So]=Fe._depth=Math.max(Xn.width>0?vs-Xn.top:0,go),gu.reverse()),Xn.width>0){var Fu=Xn.right-(Fe._offset+Fe._length);Fu>0&&(On.xr=1,On.r=Fu);var au=Fe._offset-Xn.left;au>0&&(On.xl=0,On.l=au)}}else if(So==="l"?(Fe._depth=Math.max(Xn.height>0?vs-Xn.left:0,go),On[So]=Fe._depth-yu):(Fe._depth=Math.max(Xn.height>0?Xn.right-vs:0,go),On[So]=Fe._depth+yu,gu.reverse()),Xn.height>0){var xc=Xn.bottom-(Fe._offset+Fe._length);xc>0&&(On.yb=0,On.b=xc);var Pu=Fe._offset-Xn.top;Pu>0&&(On.yt=1,On.t=Pu)}On[Nt]=Fe.anchor==="free"?Fe.position:Fe._anchorAxis.domain[gu[0]],Fe.title.text!==tt._dfltTitle[wt]&&(On[So]+=$t(Fe)+(Fe.title.standoff||0)),Fe.mirror&&Fe.anchor!=="free"&&(Uo={x:0,y:0,r:0,l:0,t:0,b:0},Uo[nl]=Fe.linewidth,Fe.mirror&&Fe.mirror!==!0&&(Uo[nl]+=go),Fe.mirror===!0||Fe.mirror==="ticks"?Uo[Nt]=Fe._anchorAxis.domain[gu[1]]:(Fe.mirror==="all"||Fe.mirror==="allticks")&&(Uo[Nt]=[Fe._counterDomainMin,Fe._counterDomainMax][gu[1]]))}ws&&(kl=o.getComponentMethod("rangeslider","autoMarginOpts")(Be,Fe)),typeof Fe.automargin=="string"&&(At(On,Fe.automargin),At(Uo,Fe.automargin)),a.autoMargin(Be,Ai(Fe),On),a.autoMargin(Be,oi(Fe),Uo),a.autoMargin(Be,Qr(Fe),kl)}),s.syncOrAsync(Vn)}};function At(Be,Fe){if(Be){var Et=Object.keys(W).reduce(function(St,zt){return Fe.indexOf(zt)!==-1&&W[zt].forEach(function(Wt){St[Wt]=1}),St},{});Object.keys(Be).forEach(function(St){Et[St]||(St.length===1?Be[St]=0:delete Be[St])})}}function ht(Be,Fe){var Et=[],St,zt=function(Wt,Yt){var ze=Wt.xbnd[Yt];ze!==null&&Et.push(s.extendFlat({},Wt,{x:ze}))};if(Fe.length){for(St=0;StBe.range[1],ze=Be.ticklabelposition&&Be.ticklabelposition.indexOf("inside")!==-1,tt=!ze;if(Et){var ct=Yt?-1:1;Et=Et*ct}if(St){var wt=Be.side,Nt=ze&&(wt==="top"||wt==="left")||tt&&(wt==="bottom"||wt==="right")?1:-1;St=St*Nt}return Be._id.charAt(0)==="x"?function(It){return l(zt+Be._offset+Be.l2p(yt(It))+Et,Wt+St)}:function(It){return l(Wt+St,zt+Be._offset+Be.l2p(yt(It))+Et)}};function yt(Be){return Be.periodX!==void 0?Be.periodX:Be.x}function kt(Be){var Fe=Be.ticklabelposition||"",Et=Be.tickson||"",St=function(qt){return Fe.indexOf(qt)!==-1},zt=St("top"),Wt=St("left"),Yt=St("right"),ze=St("bottom"),tt=St("inside"),ct=Et!=="boundaries"&&(ze||Wt||zt||Yt);if(!ct&&!tt)return[0,0];var wt=Be.side,Nt=ct?(Be.tickwidth||0)/2:0,It=$,Zt=Be.tickfont?Be.tickfont.size:12;return(ze||zt)&&(Nt+=Zt*J,It+=(Be.linewidth||0)/2),(Wt||Yt)&&(Nt+=(Be.linewidth||0)/2,It+=$),tt&&wt==="top"&&(It-=Zt*(1-J)),(Wt||zt)&&(Nt=-Nt),(wt==="bottom"||wt==="right")&&(It=-It),[ct?Nt:0,tt?It:0]}U.makeTickPath=function(Be,Fe,Et,St){St||(St={});var zt=St.minor;if(zt&&!Be.minor)return"";var Wt=St.len!==void 0?St.len:zt?Be.minor.ticklen:Be.ticklen,Yt=Be._id.charAt(0),ze=(Be.linewidth||1)/2;return Yt==="x"?"M0,"+(Fe+ze*Et)+"v"+Wt*Et:"M"+(Fe+ze*Et)+",0h"+Wt*Et},U.makeLabelFns=function(Be,Fe,Et){var St=Be.ticklabelposition||"",zt=Be.tickson||"",Wt=function(Ka){return St.indexOf(Ka)!==-1},Yt=Wt("top"),ze=Wt("left"),tt=Wt("right"),ct=Wt("bottom"),wt=zt!=="boundaries"&&(ct||ze||Yt||tt),Nt=Wt("inside"),It=St==="inside"&&Be.ticks==="inside"||!Nt&&Be.ticks==="outside"&&zt!=="boundaries",Zt=0,qt=0,vr=It?Be.ticklen:0;if(Nt?vr*=-1:wt&&(vr=0),It&&(Zt+=vr,Et)){var Br=s.deg2rad(Et);Zt=vr*Math.cos(Br)+1,qt=vr*Math.sin(Br)}Be.showticklabels&&(It||Be.showline)&&(Zt+=.2*Be.tickfont.size),Zt+=(Be.linewidth||1)/2*(Nt?-1:1);var Pr={labelStandoff:Zt,labelShift:qt},Mi,gi,ba,Hi,Za=0,oa=Be.side,Cn=Be._id.charAt(0),_n=Be.tickangle,Li;if(Cn==="x")Li=!Nt&&oa==="bottom"||Nt&&oa==="top",Hi=Li?1:-1,Nt&&(Hi*=-1),Mi=qt*Hi,gi=Fe+Zt*Hi,ba=Li?1:-.2,Math.abs(_n)===90&&(Nt?ba+=Z:_n===-90&&oa==="bottom"?ba=J:_n===90&&oa==="top"?ba=Z:ba=.5,Za=Z/2*(_n/90)),Pr.xFn=function(Ka){return Ka.dx+Mi+Za*Ka.fontSize},Pr.yFn=function(Ka){return Ka.dy+gi+Ka.fontSize*ba},Pr.anchorFn=function(Ka,Rn){if(wt){if(ze)return"end";if(tt)return"start"}return!i(Rn)||Rn===0||Rn===180?"middle":Rn*Hi<0!==Nt?"end":"start"},Pr.heightFn=function(Ka,Rn,tn){return Rn<-60||Rn>60?-.5*tn:Be.side==="top"!==Nt?-tn:0};else if(Cn==="y"){if(Li=!Nt&&oa==="left"||Nt&&oa==="right",Hi=Li?1:-1,Nt&&(Hi*=-1),Mi=Zt,gi=qt*Hi,ba=0,!Nt&&Math.abs(_n)===90&&(_n===-90&&oa==="left"||_n===90&&oa==="right"?ba=J:ba=.5),Nt){var In=i(_n)?+_n:0;if(In!==0){var pn=s.deg2rad(In);Za=Math.abs(Math.sin(pn))*J*Hi,ba=0}}Pr.xFn=function(Ka){return Ka.dx+Fe-(Mi+Ka.fontSize*ba)*Hi+Za*Ka.fontSize},Pr.yFn=function(Ka){return Ka.dy+gi+Ka.fontSize*Z},Pr.anchorFn=function(Ka,Rn){return i(Rn)&&Math.abs(Rn)===90?"middle":Li?"end":"start"},Pr.heightFn=function(Ka,Rn,tn){return Be.side==="right"&&(Rn*=-1),Rn<-30?-tn:Rn<30?-.5*tn:0}}return Pr};function Lt(Be){return[Be.text,Be.x,Be.axInfo,Be.font,Be.fontSize,Be.fontColor].join("_")}U.drawTicks=function(Be,Fe,Et){Et=Et||{};var St=Fe._id+"tick",zt=[].concat(Fe.minor&&Fe.minor.ticks?Et.vals.filter(function(Yt){return Yt.minor&&!Yt.noTick}):[]).concat(Fe.ticks?Et.vals.filter(function(Yt){return!Yt.minor&&!Yt.noTick}):[]),Wt=Et.layer.selectAll("path."+St).data(zt,Lt);Wt.exit().remove(),Wt.enter().append("path").classed(St,1).classed("ticks",1).classed("crisp",Et.crisp!==!1).each(function(Yt){return c.stroke(t.select(this),Yt.minor?Fe.minor.tickcolor:Fe.tickcolor)}).style("stroke-width",function(Yt){return f.crispRound(Be,Yt.minor?Fe.minor.tickwidth:Fe.tickwidth,1)+"px"}).attr("d",Et.path).style("display",null),Ua(Fe,[O]),Wt.attr("transform",Et.transFn)},U.drawGrid=function(Be,Fe,Et){if(Et=Et||{},Fe.tickmode!=="sync"){var St=Fe._id+"grid",zt=Fe.minor&&Fe.minor.showgrid,Wt=zt?Et.vals.filter(function(Pr){return Pr.minor}):[],Yt=Fe.showgrid?Et.vals.filter(function(Pr){return!Pr.minor}):[],ze=Et.counterAxis;if(ze&&U.shouldShowZeroLine(Be,Fe,ze))for(var tt=Fe.tickmode==="array",ct=0;ct=0;qt--){var vr=qt?It:Zt;if(vr){var Br=vr.selectAll("path."+St).data(qt?Yt:Wt,Lt);Br.exit().remove(),Br.enter().append("path").classed(St,1).classed("crisp",Et.crisp!==!1),Br.attr("transform",Et.transFn).attr("d",Et.path).each(function(Pr){return c.stroke(t.select(this),Pr.minor?Fe.minor.gridcolor:Fe.gridcolor||"#ddd")}).style("stroke-dasharray",function(Pr){return f.dashStyle(Pr.minor?Fe.minor.griddash:Fe.griddash,Pr.minor?Fe.minor.gridwidth:Fe.gridwidth)}).style("stroke-width",function(Pr){return(Pr.minor?Nt:Fe._gw)+"px"}).style("display",null),typeof Et.path=="function"&&Br.attr("d",Et.path)}}Ua(Fe,[L,B])}},U.drawZeroLine=function(Be,Fe,Et){Et=Et||Et;var St=Fe._id+"zl",zt=U.shouldShowZeroLine(Be,Fe,Et.counterAxis),Wt=Et.layer.selectAll("path."+St).data(zt?[{x:0,id:Fe._id}]:[]);Wt.exit().remove(),Wt.enter().append("path").classed(St,1).classed("zl",1).classed("crisp",Et.crisp!==!1).each(function(){Et.layer.selectAll("path").sort(function(Yt,ze){return q(Yt.id,ze.id)})}),Wt.attr("transform",Et.transFn).attr("d",Et.path).call(c.stroke,Fe.zerolinecolor||c.defaultLine).style("stroke-width",f.crispRound(Be,Fe.zerolinewidth,Fe._gw||1)+"px").style("display",null),Ua(Fe,[I])},U.drawLabels=function(Be,Fe,Et){Et=Et||{};var St=Be._fullLayout,zt=Fe._id,Wt=Fe.zerolinelayer==="above traces",Yt=Et.cls||zt+"tick",ze=Et.vals.filter(function(ua){return ua.text}),tt=Et.labelFns,ct=Et.secondary?0:Fe.tickangle,wt=(Fe._prevTickAngles||{})[Yt],Nt=Et.layer.selectAll("g."+Yt).data(Fe.showticklabels?ze:[],Lt),It=[];Nt.enter().append("g").classed(Yt,1).append("text").attr("text-anchor","middle").each(function(ua){var Ea=t.select(this),ln=Be._promises.length;Ea.call(n.positionText,tt.xFn(ua),tt.yFn(ua)).call(f.font,{family:ua.font,size:ua.fontSize,color:ua.fontColor,weight:ua.fontWeight,style:ua.fontStyle,variant:ua.fontVariant,textcase:ua.fontTextcase,lineposition:ua.fontLineposition,shadow:ua.fontShadow}).text(ua.text).call(n.convertToTspans,Be),Be._promises[ln]?It.push(Be._promises.pop().then(function(){Zt(Ea,ct)})):Zt(Ea,ct)}),Ua(Fe,[G]),Nt.exit().remove(),Et.repositionOnUpdate&&Nt.each(function(ua){t.select(this).select("text").call(n.positionText,tt.xFn(ua),tt.yFn(ua))});function Zt(ua,Ea){ua.each(function(ln){var on=t.select(this),ao=on.select(".text-math-group"),ho=tt.anchorFn(ln,Ea),Jn=Et.transFn.call(on.node(),ln)+(i(Ea)&&+Ea!=0?" rotate("+Ea+","+tt.xFn(ln)+","+(tt.yFn(ln)-ln.fontSize/2)+")":""),lo=n.lineCount(on),Fo=N*ln.fontSize,uo=tt.heightFn(ln,i(Ea)?+Ea:0,(lo-1)*Fo);if(uo&&(Jn+=l(0,uo)),ao.empty()){var Qn=on.select("text");Qn.attr({transform:Jn,"text-anchor":ho}),Qn.style("display",null),Fe._adjustTickLabelsOverflow&&Fe._adjustTickLabelsOverflow()}else{var jo=f.bBox(ao.node()).width,Yn=jo*{end:-.5,start:.5}[ho];ao.attr("transform",Jn+l(Yn,0))}})}Fe._adjustTickLabelsOverflow=function(){var ua=Fe.ticklabeloverflow;if(!(!ua||ua==="allow")){var Ea=ua.indexOf("hide")!==-1,ln=Fe._id.charAt(0)==="x",on=0,ao=ln?Be._fullLayout.width:Be._fullLayout.height;if(ua.indexOf("domain")!==-1){var ho=s.simpleMap(Fe.range,Fe.r2l);on=Fe.l2p(ho[0])+Fe._offset,ao=Fe.l2p(ho[1])+Fe._offset}var Jn=Math.min(on,ao),lo=Math.max(on,ao),Fo=Fe.side,uo=1/0,Qn=-1/0;Nt.each(function(ps){var xo=t.select(this),no=xo.select(".text-math-group");if(no.empty()){var Mo=f.bBox(xo.node()),Vn=0;ln?(Mo.right>lo||Mo.leftlo||Mo.top+(Fe.tickangle?0:ps.fontSize/4)Fe["_visibleLabelMin_"+ho._id]?xo.style("display","none"):lo.K==="tick"&&!Jn&&xo.node().style.display!=="none"&&xo.style("display",null)})})})})},Zt(Nt,wt+1?wt:ct);function qt(){return It.length&&Promise.all(It)}var vr=null;function Br(){if(Zt(Nt,ct),ze.length&&Fe.autotickangles&&(Fe.type!=="log"||String(Fe.dtick).charAt(0)!=="D")){vr=Fe.autotickangles[0];var ua=0,Ea=[],ln,on=1;Nt.each(function(On){ua=Math.max(ua,On.fontSize);var Uo=Fe.l2p(On.x),kl=Ur(this),mu=f.bBox(kl.node());on=Math.max(on,n.lineCount(kl)),Ea.push({top:0,bottom:10,height:10,left:Uo-mu.width/2,right:Uo+mu.width/2+2,width:mu.width+2})});var ao=(Fe.tickson==="boundaries"||Fe.showdividers)&&!Et.secondary,ho=ze.length,Jn=Math.abs((ze[ho-1].x-ze[0].x)*Fe._m)/(ho-1),lo=ao?Jn/2:Jn,Fo=ao?Fe.ticklen:ua*1.25*on,uo=Math.sqrt(Math.pow(lo,2)+Math.pow(Fo,2)),Qn=lo/uo,jo=Fe.autotickangles.map(function(On){return On*Math.PI/180}),Yn=jo.find(function(On){return Math.abs(Math.cos(On))<=Qn});Yn===void 0&&(Yn=jo.reduce(function(On,Uo){return Math.abs(Math.cos(On))Mn*tn&&(pn=tn,_n[Cn]=Li[Cn]=Ka[Cn])}var Kn=Math.abs(pn-In);Kn-Hi>0?(Kn-=Hi,Hi*=1+Hi/Kn):Hi=0,Fe._id.charAt(0)!=="y"&&(Hi=-Hi),_n[oa]=gi.p2r(gi.r2p(Li[oa])+Za*Hi),gi.autorange==="min"||gi.autorange==="max reversed"?(_n[0]=null,gi._rangeInitial0=void 0,gi._rangeInitial1=void 0):(gi.autorange==="max"||gi.autorange==="min reversed")&&(_n[1]=null,gi._rangeInitial0=void 0,gi._rangeInitial1=void 0),St._insideTickLabelsUpdaterange[gi._name+".range"]=_n}var zn=s.syncOrAsync(Pr);return zn&&zn.then&&Be._promises.push(zn),zn};function Ct(Be,Fe,Et){var St=Fe._id+"divider",zt=Et.vals,Wt=Et.layer.selectAll("path."+St).data(zt,Lt);Wt.exit().remove(),Wt.enter().insert("path",":first-child").classed(St,1).classed("crisp",1).call(c.stroke,Fe.dividercolor).style("stroke-width",f.crispRound(Be,Fe.dividerwidth,1)+"px"),Wt.attr("transform",Et.transFn).attr("d",Et.path)}U.getPxPosition=function(Be,Fe){var Et=Be._fullLayout._size,St=Fe._id.charAt(0),zt=Fe.side,Wt;if(Fe.anchor!=="free"?Wt=Fe._anchorAxis:St==="x"?Wt={_offset:Et.t+(1-(Fe.position||0))*Et.h,_length:0}:St==="y"&&(Wt={_offset:Et.l+(Fe.position||0)*Et.w+Fe._shift,_length:0}),zt==="top"||zt==="left")return Wt._offset;if(zt==="bottom"||zt==="right")return Wt._offset+Wt._length};function $t(Be){var Fe=Be.title.font.size,Et=(Be.title.text.match(n.BR_TAG_ALL)||[]).length;return Be.title.hasOwnProperty("standoff")?Fe*(J+Et*N):Et?Fe*(Et+1)*N:Fe}function mr(Be,Fe){var Et=Be._fullLayout,St=Fe._id,zt=St.charAt(0),Wt=Fe.title.font.size,Yt,ze=(Fe.title.text.match(n.BR_TAG_ALL)||[]).length;if(Fe.title.hasOwnProperty("standoff"))Fe.side==="bottom"||Fe.side==="right"?Yt=Fe._depth+Fe.title.standoff+Wt*J:(Fe.side==="top"||Fe.side==="left")&&(Yt=Fe._depth+Fe.title.standoff+Wt*(Z+ze*N));else{var tt=bi(Fe);if(Fe.type==="multicategory")Yt=Fe._depth;else{var ct=1.5*Wt;tt&&(ct=.5*Wt,Fe.ticks==="outside"&&(ct+=Fe.ticklen)),Yt=10+ct+(Fe.linewidth?Fe.linewidth-1:0)}tt||(zt==="x"?Yt+=Fe.side==="top"?Wt*(Fe.showticklabels?1:0):Wt*(Fe.showticklabels?1.5:.5):Yt+=Fe.side==="right"?Wt*(Fe.showticklabels?1:.5):Wt*(Fe.showticklabels?.5:0))}var wt=U.getPxPosition(Be,Fe),Nt,It,Zt;zt==="x"?(It=Fe._offset+Fe._length/2,Zt=Fe.side==="top"?wt-Yt:wt+Yt):(Zt=Fe._offset+Fe._length/2,It=Fe.side==="right"?wt+Yt:wt-Yt,Nt={rotate:"-90",offset:0});var qt;if(Fe.type!=="multicategory"){var vr=Fe._selections[Fe._id+"tick"];if(qt={selection:vr,side:Fe.side},vr&&vr.node()&&vr.node().parentNode){var Br=f.getTranslate(vr.node().parentNode);qt.offsetLeft=Br.x,qt.offsetTop=Br.y}Fe.title.hasOwnProperty("standoff")&&(qt.pad=0)}return Fe._titleStandoff=Yt,u.draw(Be,St+"title",{propContainer:Fe,propName:Fe._name+".title.text",placeholder:Et._dfltTitle[zt],avoid:qt,transform:Nt,attributes:{x:It,y:Zt,"text-anchor":"middle"}})}U.shouldShowZeroLine=function(Be,Fe,Et){var St=s.simpleMap(Fe.range,Fe.r2l);return St[0]*St[1]<=0&&Fe.zeroline&&(Fe.type==="linear"||Fe.type==="-")&&!(Fe.rangebreaks&&Fe.maskBreaks(0)===z)&&(br(Fe,0)||!Er(Be,Fe,Et,St)||Tr(Be,Fe))},U.clipEnds=function(Be,Fe){return Fe.filter(function(Et){return br(Be,Et.x)})};function br(Be,Fe){var Et=Be.l2p(Fe);return Et>1&&Et1)for(zt=1;zt=zt.min&&Be=R:/%L/.test(Fe)?Be>=D:/%[SX]/.test(Fe)?Be>=F:/%M/.test(Fe)?Be>=T:/%[HI]/.test(Fe)?Be>=E:/%p/.test(Fe)?Be>=b:/%[Aadejuwx]/.test(Fe)?Be>=A:/%[UVW]/.test(Fe)?Be>=k:/%[Bbm]/.test(Fe)?Be>=w:/%[q]/.test(Fe)?Be>=S:/%[Yy]/.test(Fe)?Be>=_:!0}}}),LE=de({"src/plots/cartesian/autorange_options_defaults.js"(e,r){"use strict";r.exports=function(i,a,o){var s,l;if(o){var n=a==="reversed"||a==="min reversed"||a==="max reversed";s=o[n?1:0],l=o[n?0:1]}var u=i("autorangeoptions.minallowed",l===null?s:void 0),c=i("autorangeoptions.maxallowed",s===null?l:void 0);u===void 0&&i("autorangeoptions.clipmin"),c===void 0&&i("autorangeoptions.clipmax"),i("autorangeoptions.include")}}}),FE=de({"src/plots/cartesian/range_defaults.js"(e,r){"use strict";var t=LE();r.exports=function(a,o,s,l){var n=o._template||{},u=o.type||n.type||"-";s("minallowed"),s("maxallowed");var c=s("range");if(!c){var f;!l.noInsiderange&&u!=="log"&&(f=s("insiderange"),f&&(f[0]===null||f[1]===null)&&(o.insiderange=!1,f=void 0),f&&(c=s("range",f)))}var h=o.getAutorangeDflt(c,l),d=s("autorange",h),p;c&&(c[0]===null&&c[1]===null||(c[0]===null||c[1]===null)&&(d==="reversed"||d===!0)||c[0]!==null&&(d==="min"||d==="max reversed")||c[1]!==null&&(d==="max"||d==="min reversed"))&&(c=void 0,delete o.range,o.autorange=!0,p=!0),p||(h=o.getAutorangeDflt(c,l),d=s("autorange",h)),d&&(t(s,d,c),(u==="linear"||u==="-")&&s("rangemode")),o.cleanRange()}}}),vq=de({"node_modules/mouse-event-offset/index.js"(e,r){var t={left:0,top:0};r.exports=i;function i(o,s,l){s=s||o.currentTarget||o.srcElement,Array.isArray(l)||(l=[0,0]);var n=o.clientX||0,u=o.clientY||0,c=a(s);return l[0]=n-c.left,l[1]=u-c.top,l}function a(o){return o===window||o===document||o===document.body?t:o.getBoundingClientRect()}}}),Mw=de({"node_modules/has-passive-events/index.js"(e,r){"use strict";var t=wE();function i(){var a=!1;try{var o=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("test",null,o),window.removeEventListener("test",null,o)}catch{a=!1}return a}r.exports=t&&i()}}),mq=de({"src/components/dragelement/align.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){var n=(i-o)/(s-o),u=n+a/(s-o),c=(n+u)/2;return l==="left"||l==="bottom"?n:l==="center"||l==="middle"?c:l==="right"||l==="top"?u:n<2/3-c?n:u>4/3-c?u:c}}}),gq=de({"src/components/dragelement/cursor.js"(e,r){"use strict";var t=Qt(),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];r.exports=function(o,s,l,n){return l==="left"?o=0:l==="center"?o=1:l==="right"?o=2:o=t.constrain(Math.floor(o*3),0,2),n==="bottom"?s=0:n==="middle"?s=1:n==="top"?s=2:s=t.constrain(Math.floor(s*3),0,2),i[s][o]}}}),yq=de({"src/components/dragelement/unhover.js"(e,r){"use strict";var t=u1(),i=ww(),a=Ty().getGraphDiv,o=Ta(),s=r.exports={};s.wrapped=function(l,n,u){var c;l=a(l),l._fullLayout&&i.clear(l._fullLayout._uid+o.HOVERID);let f=l._hoverdata;s.raw(l,n,u)&&l._hoverAnywhereActive&&(l._hoverAnywhereActive=!1,(c=l._fullLayout)!=null&&c.hoveranywhere&&n?.target&&!f&&l.emit("plotly_unhover",{event:n,points:[]}))},s.raw=function(n,u){var c=n._fullLayout,f=n._hoverdata;return u||(u={}),u.target&&!n._dragged&&t.triggerHandler(n,"plotly_beforehover",u)===!1?!1:(c._hoverlayer.selectAll("g").remove(),c._hoverlayer.selectAll("line").remove(),c._hoverlayer.selectAll("circle").remove(),n._hoverdata=void 0,u.target&&f&&n.emit("plotly_unhover",{event:u,points:f}),!0)}}}),Uc=de({"src/components/dragelement/index.js"(e,r){"use strict";var t=vq(),i=TE(),a=Mw(),o=Qt().removeElement,s=zl(),l=r.exports={};l.align=mq(),l.getCursor=gq();var n=yq();l.unhover=n.wrapped,l.unhoverRaw=n.raw,l.init=function(h){var d=h.gd,p=1,g=d._context.doubleClickDelay,m=h.element,y,_,v,x,S,M,C,w;d._mouseDownTime||(d._mouseDownTime=0),m.style.pointerEvents="all",m.onmousedown=b,a?(m._ontouchstart&&m.removeEventListener("touchstart",m._ontouchstart),m._ontouchstart=b,m.addEventListener("touchstart",b,{passive:!1})):m.ontouchstart=b;function k(F,D,R){return Math.abs(F)"u"&&typeof F.clientY>"u"&&(F.clientX=y,F.clientY=_),v=new Date().getTime(),v-d._mouseDownTimeg&&(p=Math.max(p-1,1)),d._dragged)h.doneFn&&h.doneFn();else{var D;M.target===C?D=M:(D={target:C,srcElement:C,toElement:C},Object.keys(M).concat(Object.keys(M.__proto__)).forEach(R=>{var P=M[R];!D[R]&&typeof P!="function"&&(D[R]=P)})),h.clickFn&&h.clickFn(p,D),w||C.dispatchEvent(new MouseEvent("click",F))}d._dragging=!1,d._dragged=!1}};function u(){var f=document.createElement("div");f.className="dragcover";var h=f.style;return h.position="fixed",h.left=0,h.right=0,h.top=0,h.bottom=0,h.zIndex=999999999,h.background="none",document.body.appendChild(f),f}l.coverSlip=u;function c(f){return t(f.changedTouches?f.changedTouches[0]:f,document.body)}}}),md=de({"src/lib/setcursor.js"(e,r){"use strict";r.exports=function(i,a){(i.attr("class")||"").split(" ").forEach(function(o){o.indexOf("cursor-")===0&&i.classed(o,!1)}),a&&i.classed("cursor-"+a,!0)}}}),_q=de({"src/lib/override_cursor.js"(e,r){"use strict";var t=md(),i="data-savedcursor",a="!!";r.exports=function(s,l){var n=s.attr(i);if(l){if(!n){for(var u=(s.attr("class")||"").split(" "),c=0;c$.legend.length)for(var j=$.legend.length;j<$._length;j++)k=!0,w++});for(var T=d.concat(b).filter(function($){return!E(x)&&c===($.legend||"legend")}),F=0;F(c==="legend"?1:0));if(R===!1&&(h[c]=void 0),R===!1&&!g.uirevision||(y("uirevision",h.uirevision),R===!1))return;y("borderwidth");var P=y("orientation"),z=y("yref"),I=y("xref"),L=P==="h",B=z==="paper",O=I==="paper",G,W,X,Z="left";L?(G=0,t.getComponentMethod("rangeslider","isVisible")(f.xaxis)?B?(W=1.1,X="bottom"):(W=1,X="top"):B?(W=-.1,X="top"):(W=0,X="bottom")):(W=1,X="auto",O?G=1.02:(G=1,Z="right")),i.coerce(g,m,{x:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:G}},"x"),i.coerce(g,m,{y:{valType:"number",editType:"legend",min:B?-2:0,max:B?3:1,dflt:W}},"y"),y("traceorder",A),n.isGrouped(h[c])&&y("tracegroupgap"),y("entrywidth"),y("entrywidthmode"),y("indentation"),y("itemsizing"),y("itemwidth"),y("itemclick"),y("itemdoubleclick");let J=y("groupclick");y("groupdoubleclick",J),y("xanchor",Z),y("yanchor",X),y("maxheight"),y("valign"),i.noneOrAll(g,m,["x","y"]);var N=y("title.text");if(N){y("title.side",L?"left":"top");var H=i.extendFlat({},_,{size:i.bigFont(_.size)});i.coerceFont(y,"title.font",H);let $=p>1;y("titleclick",$?"toggle":!1),y("titledoubleclick",$?"toggleothers":!1)}}r.exports=function(f,h,d){var p,g=d.slice(),m=h.shapes;if(m)for(p=0;pye.showlegend||ye.legendgroup);var v=y.concat(_),x=d.trace;x._isShape&&(x=h.shapes[x.index]);var S=x.legendgroup,M,C,w,k,A,b,E={},T=[],F=[],D=[];function R(ye,fe){var ae=T.indexOf(ye),ee=E.visible;return ee||(ee=E.visible=[]),T.indexOf(ye)===-1&&(T.push(ye),ae=T.length-1),ee[ae]=fe,ae}var P=(h.shapes||[]).map(function(ye){return ye._input}),z=!1;function I(ye,fe){P[ye].visible=fe,z=!0}function L(ye,fe){if(!(d.groupTitle&&!g)){var ae=ye._isShape,ee=ye.index;ee===void 0&&(ee=ye._index);var ie=ye.visible===!1?!1:fe;ae?I(ee,ie):R(ee,ie)}}var B=x.legend;if(!x._isShape&&r.traceIs(x,"pie-like")){var O=d.label,G=m.indexOf(O);if(c==="toggle")G===-1?m.push(O):m.splice(G,1);else if(c==="toggleothers"){var W=G!==-1,X=[];for(M=0;MC.showlegend||C.legendgroup),p=f.concat(d);function g(C){return(C.legend||"legend")===h}var m,y;if(u==="toggle")m=!p.some(function(w){return g(w)&&w.visible===!0}),y=!1;else{let C=p.some(function(w){return!g(w)&&w.visible===!0&&w.showlegend!==!1});m=!0,y=!C}let _={visible:[]},v=[],x=(c.shapes||[]).map(function(C){return C._input});for(var S=!1,M=0;Mz&&(R=z)}F[_][0]._groupMinRank=R,F[_][0]._preGroupSort=_}var I=function(X,Z){return X[0]._groupMinRank-Z[0]._groupMinRank||X[0]._preGroupSort-Z[0]._preGroupSort},L=function(X,Z){var J=t(X.trace.legendrank)?X.trace.legendrank[X.i]:X.trace.legendrank,N=t(Z.trace.legendrank)?Z.trace.legendrank[Z.i]:Z.trace.legendrank;return J-N||X._preSort-Z._preSort};for(F.forEach(function(X,Z){X[0]._preGroupSort=Z}),F.sort(I),_=0;_0)V=H.width;else return 0;return A?U:Math.min(V,$)};M.each(function(N){var H=t.select(this),$=a.ensureSingle(H,"g","layers");$.style("opacity",N[0].trace.opacity);var U=w.indentation,V=w.valign,j=N[0].lineHeight,q=N[0].height;if(V==="middle"&&U===0||!j||!q)$.attr("transform",null);else{var Y={top:1,bottom:-1}[V],K=Y*(.5*(j-q+3))||0,te=w.indentation;$.attr("transform",o(te,K))}var ne=$.selectAll("g.legendfill").data([N]);ne.enter().append("g").classed("legendfill",!0);var se=$.selectAll("g.legendlines").data([N]);se.enter().append("g").classed("legendlines",!0);var le=$.selectAll("g.legendsymbols").data([N]);le.enter().append("g").classed("legendsymbols",!0),le.selectAll("g.legendpoints").data([N]).enter().append("g").classed("legendpoints",!0)}).each(J).each(P).each(I).each(z).each(B).each(X).each(W).each(D).each(R).each(O).each(G);function D(N){var H=v(N),$=H.showFill,U=H.showLine,V=H.showGradientLine,j=H.showGradientFill,q=H.anyFill,Y=H.anyLine,K=N[0],te=K.trace,ne,se,le=n(te),ce=le.colorscale,pe=le.reversescale,xe=function(ue){if(ue.size())if($)s.fillGroupStyle(ue,C,!0);else{var ge="legendfill-"+te.uid;s.gradient(ue,C,ge,_(pe),ce,"fill")}},ye=function(ue){if(ue.size()){var ge="legendline-"+te.uid;s.lineGroupStyle(ue),s.gradient(ue,C,ge,_(pe),ce,"stroke")}},fe=u.hasMarkers(te)||!q?"M5,0":Y?"M5,-2":"M5,-3",ae=t.select(this),ee=ae.select(".legendfill").selectAll("path").data($||j?[N]:[]);if(ee.enter().append("path").classed("js-fill",!0),ee.exit().remove(),ee.attr("d",fe+"h"+b+"v6h-"+b+"z").call(xe),U||V){var ie=F(void 0,te.line,m,p);se=a.minExtend(te,{line:{width:ie}}),ne=[a.minExtend(K,{trace:se})]}var Q=ae.select(".legendlines").selectAll("path").data(U||V?[ne]:[]);Q.enter().append("path").classed("js-line",!0),Q.exit().remove(),Q.attr("d",fe+(V?"l"+b+",0.0001":"h"+b)).call(U?s.lineGroupStyle:ye)}function R(N){var H=v(N),$=H.anyFill,U=H.anyLine,V=H.showLine,j=H.showMarker,q=N[0],Y=q.trace,K=!j&&!U&&!$&&u.hasText(Y),te,ne;function se(ie,Q,ue,ge){var Me=a.nestedProperty(Y,ie).get(),Te=a.isArrayOrTypedArray(Me)&&Q?Q(Me):Me;if(A&&Te&&ge!==void 0&&(Te=ge),ue){if(Teue[1])return ue[1]}return Te}function le(ie){return q._distinct&&q.index&&ie[q.index]?ie[q.index]:ie[0]}if(j||K||V){var ce={},pe={};if(j){ce.mc=se("marker.color",le);var xe=Y.type==="scattermap";ce.mx=xe?"circle":se("marker.symbol",le),ce.mo=se("marker.opacity",a.mean,[.2,1]),ce.mlc=se("marker.line.color",le),ce.mlw=se("marker.line.width",a.mean,[0,5],g),ce.mld=se("marker.line.dash",le),pe.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var ye=se("marker.size",a.mean,[2,16],d);ce.ms=ye,pe.marker.size=ye}V&&(pe.line={width:se("line.width",le,[0,10],p)}),K&&(ce.tx="Aa",ce.tp=se("textposition",le),ce.ts=10,ce.tc=se("textfont.color",le),ce.tf=se("textfont.family",le),ce.tw=se("textfont.weight",le),ce.ty=se("textfont.style",le),ce.tv=se("textfont.variant",le),ce.tC=se("textfont.textcase",le),ce.tE=se("textfont.lineposition",le),ce.tS=se("textfont.shadow",le)),te=[a.minExtend(q,ce)],ne=a.minExtend(Y,pe),ne.selectedpoints=null,ne.texttemplate=null}var fe=t.select(this).select("g.legendpoints"),ae=fe.selectAll("path.scatterpts").data(j?te:[]);ae.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",T),ae.exit().remove(),ae.call(s.pointStyle,ne,C),j&&(te[0].mrc=3);var ee=fe.selectAll("g.pointtext").data(K?te:[]);ee.enter().append("g").classed("pointtext",!0).append("text").attr("transform",T),ee.exit().remove(),ee.selectAll("text").call(s.textPointStyle,ne,C)}function P(N){var H=N[0].trace,$=H.type==="waterfall";if(N[0]._distinct&&$){var U=N[0].trace[N[0].dir].marker;return N[0].mc=U.color,N[0].mlw=U.line.width,N[0].mlc=U.line.color,L(N,this,"waterfall")}var V=[];H.visible&&$&&(V=N[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var j=t.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(V);j.enter().append("path").classed("legendwaterfall",!0).attr("transform",T).style("stroke-miterlimit",1),j.exit().remove(),j.each(function(q){var Y=t.select(this),K=H[q[0]].marker,te=F(void 0,K.line,y,g);Y.attr("d",q[1]).style("stroke-width",te+"px").call(l.fill,K.color),te&&Y.call(l.stroke,K.line.color)})}function z(N){L(N,this)}function I(N){L(N,this,"funnel")}function L(N,H,$){var U=N[0].trace,V=U.marker||{},j=V.line||{},q=V.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",Y=$?U.visible&&U.type===$:i.traceIs(U,"bar"),K=t.select(H).select("g.legendpoints").selectAll("path.legend"+$).data(Y?[N]:[]);K.enter().append("path").classed("legend"+$,!0).attr("d",q).attr("transform",T),K.exit().remove(),K.each(function(te){var ne=t.select(this),se=te[0],le=F(se.mlw,V.line,y,g);ne.style("stroke-width",le+"px");var ce=se.mcc;if(!w._inHover&&"mc"in se){var pe=n(V),xe=pe.mid;xe===void 0&&(xe=(pe.max+pe.min)/2),ce=s.tryColorscale(V,"")(xe)}var ye=ce||se.mc||V.color,fe=V.pattern,ae=s.getPatternAttr,ee=fe&&(ae(fe.shape,0,"")||ae(fe.path,0,""));if(ee){var ie=ae(fe.bgcolor,0,null),Q=ae(fe.fgcolor,0,null),ue=fe.fgopacity,ge=x(fe.size,8,10),Me=x(fe.solidity,.5,1),Te="legend-"+U.uid;ne.call(s.pattern,"legend",C,Te,ee,ge,Me,ce,fe.fillmode,ie,Q,ue)}else ne.call(l.fill,ye);le&&l.stroke(ne,se.mlc||j.color)})}function B(N){var H=N[0].trace,$=t.select(this).select("g.legendpoints").selectAll("path.legendbox").data(H.visible&&i.traceIs(H,"box-violin")?[N]:[]);$.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",T),$.exit().remove(),$.each(function(){var U=t.select(this);if((H.boxpoints==="all"||H.points==="all")&&l.opacity(H.fillcolor)===0&&l.opacity((H.line||{}).color)===0){var V=a.minExtend(H,{marker:{size:A?d:a.constrain(H.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});$.call(s.pointStyle,V,C)}else{var j=F(void 0,H.line,y,g);U.style("stroke-width",j+"px").call(l.fill,H.fillcolor),j&&l.stroke(U,H.line.color)}})}function O(N){var H=N[0].trace,$=t.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(H.visible&&H.type==="candlestick"?[N,N]:[]);$.enter().append("path").classed("legendcandle",!0).attr("d",function(U,V){return V?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",T).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(U,V){var j=t.select(this),q=H[V?"increasing":"decreasing"],Y=F(void 0,q.line,y,g);j.style("stroke-width",Y+"px").call(l.fill,q.fillcolor),Y&&l.stroke(j,q.line.color)})}function G(N){var H=N[0].trace,$=t.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(H.visible&&H.type==="ohlc"?[N,N]:[]);$.enter().append("path").classed("legendohlc",!0).attr("d",function(U,V){return V?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",T).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(U,V){var j=t.select(this),q=H[V?"increasing":"decreasing"],Y=F(void 0,q.line,y,g);j.style("fill","none").call(s.dashLine,q.line.dash,Y),Y&&l.stroke(j,q.line.color)})}function W(N){Z(N,this,"pie")}function X(N){Z(N,this,"funnelarea")}function Z(N,H,$){var U=N[0],V=U.trace,j=$?V.visible&&V.type===$:i.traceIs(V,$),q=t.select(H).select("g.legendpoints").selectAll("path.legend"+$).data(j?[N]:[]);if(q.enter().append("path").classed("legend"+$,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",T),q.exit().remove(),q.size()){var Y=V.marker||{},K=F(f(Y.line.width,U.pts),Y.line,y,g),te="pieLike",ne=a.minExtend(V,{marker:{line:{width:K}}},te),se=a.minExtend(U,{trace:ne},te);c(q,se,ne,C)}}function J(N){var H=N[0].trace,$,U=[];if(H.visible)switch(H.type){case"histogram2d":case"heatmap":U=[["M-15,-2V4H15V-2Z"]],$=!0;break;case"choropleth":case"choroplethmap":U=[["M-6,-6V6H6V-6Z"]],$=!0;break;case"densitymap":U=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],$="radial";break;case"cone":U=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],$=!1;break;case"streamtube":U=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],$=!1;break;case"surface":U=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],$=!0;break;case"mesh3d":U=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!1;break;case"volume":U=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!0;break;case"isosurface":U=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],$=!1;break}var V=t.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(U);V.enter().append("path").classed("legend3dandfriends",!0).attr("transform",T).style("stroke-miterlimit",1),V.exit().remove(),V.each(function(j,q){var Y=t.select(this),K=n(H),te=K.colorscale,ne=K.reversescale,se=function(xe){if(xe.size()){var ye="legendfill-"+H.uid;s.gradient(xe,C,ye,_(ne,$==="radial"),te,"fill")}},le;if(te){if(!$){var pe=te.length;le=q===0?te[ne?pe-1:0][1]:q===1?te[ne?0:pe-1][1]:te[Math.floor((pe-1)/2)][1]}}else{var ce=H.vertexcolor||H.facecolor||H.color;le=a.isArrayOrTypedArray(ce)?ce[q]||ce[0]:ce}Y.attr("d",j[0]),le?Y.call(l.fill,le):Y.call(se)})}};function _(S,M){var C=M?"radial":"horizontal";return C+(S?"":"reversed")}function v(S){var M=S[0].trace,C=M.contours,w=u.hasLines(M)||M.visible&&M.type==="quiver",k=u.hasMarkers(M),A=M.visible&&M.fill&&M.fill!=="none",b=!1,E=!1;if(C){var T=C.coloring;T==="lines"?b=!0:w=T==="none"||T==="heatmap"||C.showlines,C.type==="constraint"?A=C._operation!=="=":(T==="fill"||T==="heatmap")&&(E=!0)}return{showMarker:k,showLine:w,showFill:A,showGradientLine:b,showGradientFill:E,anyLine:w||b,anyFill:A||E}}function x(S,M,C){return S&&a.isArrayOrTypedArray(S)?M:S>C?C:S}}}),OE=de({"src/components/legend/draw.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=Es(),o=Ma(),s=u1(),l=Uc(),n=hn(),u=ta(),c=Zo(),f=RE().handleItemClick,h=RE().handleTitleClick,d=zE(),p=Bl(),g=p.LINE_SPACING,m=p.FROM_TL,y=p.FROM_BR,_=xq(),v=BE(),x=Ey(),S=1,M=/^legend[0-9]*$/;r.exports=function(G,W){if(W)w(G,W);else{var X=G._fullLayout,Z=X._legends,J=X._infolayer.selectAll('[class^="legend"]');J.each(function(){var U=t.select(this),V=U.attr("class"),j=V.split(" ")[0];j.match(M)&&Z.indexOf(j)===-1&&U.remove()});for(var N=0;N1)}var K=X.hiddenlabels||[];if(!H&&(!X.showlegend||!$.length))return N.selectAll("."+Z).remove(),X._topdefs.select("#"+J).remove(),a.autoMargin(O,Z);var te=i.ensureSingle(N,"g",Z,function(ae){H||ae.attr("pointer-events","all")}),ne=i.ensureSingleById(X._topdefs,"clipPath",J,function(ae){ae.append("rect")}),se=i.ensureSingle(te,"rect","bg",function(ae){ae.attr("shape-rendering","crispEdges")});se.call(u.stroke,W.bordercolor).call(u.fill,W.bgcolor).style("stroke-width",W.borderwidth+"px");var le=i.ensureSingle(te,"g","scrollbox"),ce=W.title;W._titleWidth=0,W._titleHeight=0;var pe;ce.text?(pe=i.ensureSingle(le,"text",Z+"titletext"),pe.attr("text-anchor","start").call(n.font,ce.font).text(ce.text),D(pe,le,O,W,S),!H&&(W.titleclick||W.titledoubleclick)&&F(le,O,W,Z)):(le.selectAll("."+Z+"titletext").remove(),le.selectAll("."+Z+"titletoggle").remove());var xe=i.ensureSingle(te,"rect","scrollbar",function(ae){ae.attr(d.scrollBarEnterAttrs).call(u.fill,d.scrollBarColor)}),ye=le.selectAll("g.groups").data($);ye.enter().append("g").attr("class","groups"),ye.exit().remove();var fe=ye.selectAll("g.traces").data(i.identity);fe.enter().append("g").attr("class","traces"),fe.exit().remove(),fe.style("opacity",function(ae){let ee=ae[0],ie=ee.trace;if(ee.groupTitle){let Q=ie.legendgroup,ue=(X.shapes||[]).filter(function(Me){return Me.showlegend});return O._fullData.concat(ue).some(function(Me){return Me.legendgroup===Q&&(Me.legend||"legend")===Z&&Me.visible===!0})?1:.5}return o.traceIs(ie,"pie-like")?K.indexOf(ae[0].label)!==-1?.5:1:ie.visible==="legendonly"?.5:1}).each(function(){t.select(this).call(b,O,W)}).call(v,O,W).each(function(ae){H||ae[0].groupTitle&&W.groupclick==="toggleitem"||t.select(this).call(T,O,Z)}),i.syncOrAsync([a.previousPromises,function(){return z(O,ye,fe,W,le)},function(){var ae=X._size,ee=W.borderwidth,ie=W.xref==="paper",Q=W.yref==="paper";if(ce.text){let Ue=(X.shapes||[]).filter(function(rt){return rt.showlegend}),at=O._fullData.concat(Ue).some(function(rt){let ft=rt.legend||"legend";var At=Array.isArray(ft)?ft.includes(Z):ft===Z;return At&&rt.visible===!0});pe.style("opacity",at?1:.5)}if(!H){var ue,ge;ie?ue=ae.l+ae.w*W.x-m[L(W)]*W._width:ue=X.width*W.x-m[L(W)]*W._width,Q?ge=ae.t+ae.h*(1-W.y)-m[B(W)]*W._effHeight:ge=X.height*(1-W.y)-m[B(W)]*W._effHeight;var Me=I(O,Z,ue,ge);if(Me)return;if(X.margin.autoexpand){var Te=ue,je=ge;ue=ie?i.constrain(ue,0,X.width-W._width):Te,ge=Q?i.constrain(ge,0,X.height-W._effHeight):je,ue!==Te&&i.log("Constrain "+Z+".x to make legend fit inside graph"),ge!==je&&i.log("Constrain "+Z+".y to make legend fit inside graph")}n.setTranslate(te,ue,ge)}if(xe.on(".drag",null),te.on("wheel",null),H||W._height<=W._maxHeight||O._context.staticPlot){var Ve=W._effHeight;H&&(Ve=W._height),se.attr({width:W._width-ee,height:Ve-ee,x:ee/2,y:ee/2}),n.setTranslate(le,0,0),ne.select("rect").attr({width:W._width-2*ee,height:Ve-2*ee,x:ee,y:ee}),n.setClipUrl(le,J,O),n.setRect(xe,0,0,0,0),delete W._scrollY}else{var Ze=Math.max(d.scrollBarMinHeight,W._effHeight*W._effHeight/W._height),Ke=W._effHeight-Ze-2*d.scrollBarMargin,vt=W._height-W._effHeight,xt=Ke/vt,Pt=Math.min(W._scrollY||0,vt);se.attr({width:W._width-2*ee+d.scrollBarWidth+d.scrollBarMargin,height:W._effHeight-ee,x:ee/2,y:ee/2}),ne.select("rect").attr({width:W._width-2*ee+d.scrollBarWidth+d.scrollBarMargin,height:W._effHeight-2*ee,x:ee,y:ee+Pt}),n.setClipUrl(le,J,O),Ae(Pt,Ze,xt),te.on("wheel",function(){Pt=i.constrain(W._scrollY+t.event.deltaY/vt*Ke,0,vt),Ae(Pt,Ze,xt),Pt!==0&&Pt!==vt&&t.event.preventDefault()});var mt,Mt,lt,qe=function(Ue,at,rt){var ft=(rt-at)/xt+Ue;return i.constrain(ft,0,vt)},Ye=function(Ue,at,rt){var ft=(at-rt)/xt+Ue;return i.constrain(ft,0,vt)},me=t.behavior.drag().on("dragstart",function(){var Ue=t.event.sourceEvent;Ue.type==="touchstart"?mt=Ue.changedTouches[0].clientY:mt=Ue.clientY,lt=Pt}).on("drag",function(){var Ue=t.event.sourceEvent;Ue.buttons===2||Ue.ctrlKey||(Ue.type==="touchmove"?Mt=Ue.changedTouches[0].clientY:Mt=Ue.clientY,Pt=qe(lt,mt,Mt),Ae(Pt,Ze,xt))});xe.call(me);var _e=t.behavior.drag().on("dragstart",function(){var Ue=t.event.sourceEvent;Ue.type==="touchstart"&&(mt=Ue.changedTouches[0].clientY,lt=Pt)}).on("drag",function(){var Ue=t.event.sourceEvent;Ue.type==="touchmove"&&(Mt=Ue.changedTouches[0].clientY,Pt=Ye(lt,mt,Mt),Ae(Pt,Ze,xt))});le.call(_e)}function Ae(Ue,at,rt){W._scrollY=O._fullLayout[Z]._scrollY=Ue,n.setTranslate(le,0,-Ue),n.setRect(xe,W._width,d.scrollBarMargin+Ue*rt,d.scrollBarWidth,at),ne.select("rect").attr("y",ee+Ue)}if(O._context.edits.legendPosition){var ke,Ee,De,Je;te.classed("cursor-move",!0),l.init({element:te.node(),gd:O,prepFn:function(Ue){if(Ue.target!==xe.node()){var at=n.getTranslate(te);De=at.x,Je=at.y}},moveFn:function(Ue,at){if(De!==void 0&&Je!==void 0){var rt=De+Ue,ft=Je+at;n.setTranslate(te,rt,ft),ke=l.align(rt,W._width,ae.l,ae.l+ae.w,W.xanchor),Ee=l.align(ft+W._height,-W._height,ae.t+ae.h,ae.t,W.yanchor)}},doneFn:function(){if(ke!==void 0&&Ee!==void 0){var Ue={};Ue[Z+".x"]=ke,Ue[Z+".y"]=Ee,o.call("_guiRelayout",O,Ue)}},clickFn:function(Ue,at){var rt=N.selectAll("g.traces").filter(function(){var ft=this.getBoundingClientRect();return at.clientX>=ft.left&&at.clientX<=ft.right&&at.clientY>=ft.top&&at.clientY<=ft.bottom});rt.size()>0&&A(O,W,rt,Ue,at)}})}}],O)}}function k(O,G,W){var X=O[0],Z=X.width,J=G.entrywidthmode,N=X.trace.legendwidth||G.entrywidth;return J==="fraction"?G._maxWidth*N:W+(N||Z)}function A(O,G,W,X,Z){var J=O._fullLayout,N=W.data()[0][0].trace,H=G.itemclick,$=G.itemdoubleclick,U={event:Z,node:W.node(),curveNumber:N.index,expandedIndex:N.index,data:O.data,layout:O.layout,frames:O._transitionData._frames,config:O._context,fullData:O._fullData,fullLayout:J};N._group&&(U.group=N._group),o.traceIs(N,"pie-like")&&(U.label=W.datum()[0].label);var V=s.triggerHandler(O,"plotly_legendclick",U);if(X===1){if(V===!1)return;G._clickTimeout=setTimeout(function(){O._fullLayout&&H&&f(W,O,G,H,X)},O._context.doubleClickDelay)}else if(X===2){G._clickTimeout&&clearTimeout(G._clickTimeout),O._legendMouseDownTime=0;var j=s.triggerHandler(O,"plotly_legenddoubleclick",U);j!==!1&&V!==!1&&$&&f(W,O,G,$,X)}}function b(O,G,W){var X=x.getId(W),Z=O.data()[0][0],J=Z.trace,N=o.traceIs(J,"pie-like"),H=!W._inHover&&G._context.edits.legendText&&!N,$=W._maxNameLength,U,V;Z.groupTitle?(U=Z.groupTitle.text,V=Z.groupTitle.font):(V=W.font,W.entries?U=Z.text:(U=N?Z.label:J.name,J._meta&&(U=i.templateString(U,J._meta))));var j=i.ensureSingle(O,"text",X+"text");j.attr("text-anchor","start").call(n.font,V).text(H?E(U,$):U);var q=W.indentation+W.itemwidth+d.itemGap*2;c.positionText(j,q,0),H?j.call(c.makeEditable,{gd:G,text:U}).call(D,O,G,W).on("edit",function(Y){this.text(E(Y,$)).call(D,O,G,W);var K={};return K.name=Y,Z.trace._isShape?o.call("_guiRelayout",G,"shapes["+J.index+"].name",K.name):o.call("_guiRestyle",G,K,J.index)}):D(j,O,G,W)}function E(O,G){var W=Math.max(4,G);if(O&&O.trim().length>=W/2)return O;O=O||"";for(var X=W-O.length;X>0;X--)O+=" ";return O}function T(O,G,W){var X=G._context.doubleClickDelay,Z,J=1,N=i.ensureSingle(O,"rect",W+"toggle",function(H){G._context.staticPlot||H.style("cursor","pointer").attr("pointer-events","all"),H.call(u.fill,"rgba(0,0,0,0)")});G._context.staticPlot||(N.on("mousedown",function(){Z=new Date().getTime(),Z-G._legendMouseDownTimeX&&(J=Math.max(J-1,1)),A(G,H,O,J,t.event)}}))}function F(O,G,W,X){if(G._fullData.some(function(U){let V=U.legend||"legend";return(Array.isArray(V)?V.includes(X):V===X)&&o.traceIs(U,"pie-like")}))return;let J=G._context.doubleClickDelay;var N,H=1;let $=i.ensureSingle(O,"rect",X+"titletoggle",function(U){G._context.staticPlot||U.style("cursor","pointer").attr("pointer-events","all"),U.call(u.fill,"rgba(0,0,0,0)")});G._context.staticPlot||($.on("mousedown",function(){N=new Date().getTime(),N-G._legendMouseDownTimeJ&&(H=Math.max(H-1,1));let U={event:t.event,legendId:X,data:G.data,layout:G.layout,fullData:G._fullData,fullLayout:G._fullLayout};if(H===1&&W.titleclick){if(s.triggerHandler(G,"plotly_legendtitleclick",U)===!1)return;W._titleClickTimeout=setTimeout(function(){G._fullLayout&&h(G,W,W.titleclick)},J)}else H===2&&(W._titleClickTimeout&&clearTimeout(W._titleClickTimeout),G._legendMouseDownTime=0,s.triggerHandler(G,"plotly_legendtitledoubleclick",U)!==!1&&W.titledoubleclick&&h(G,W,W.titledoubleclick))}))}function D(O,G,W,X,Z){X._inHover&&O.attr("data-notex",!0),c.convertToTspans(O,W,function(){R(G,W,X,Z)})}function R(O,G,W,X){var Z=O.data()[0][0],J=Z&&Z.trace.showlegend;if(Array.isArray(J)&&(J=J[Z.i]!==!1),!W._inHover&&Z&&!J){O.remove();return}var N=O.select("g[class*=math-group]"),H=N.node(),$=x.getId(W);W||(W=G._fullLayout[$]);var U=W.borderwidth,V;X===S?V=W.title.font:Z.groupTitle?V=Z.groupTitle.font:V=W.font;var j=V.size*g,q,Y;if(H){var K=n.bBox(H);q=K.height,Y=K.width,X===S?n.setTranslate(N,U,U+q*.75):n.setTranslate(N,0,q*.25)}else{var te="."+$+(X===S?"title":"")+"text",ne=O.select(te),se=c.lineCount(ne),le=ne.node();if(q=j*se,Y=le?n.bBox(le).width:0,X===S)W.title.side==="left"&&(Y+=d.itemGap*2),c.positionText(ne,U+d.titlePad,U+j);else{var ce=d.itemGap*2+W.indentation+W.itemwidth;Z.groupTitle&&(ce=d.itemGap,Y-=W.indentation+W.itemwidth),c.positionText(ne,ce,-j*((se-1)/2-.3))}}X===S?(W._titleWidth=Y,W._titleHeight=q):(Z.lineHeight=j,Z.height=Math.max(q,16)+3,Z.width=Y)}function P(O){var G=0,W=0,X=O.title.side;return X&&(X.indexOf("left")!==-1&&(G=O._titleWidth),X.indexOf("top")!==-1&&(W=O._titleHeight)),[G,W]}function z(O,G,W,X,Z){var J=O._fullLayout,N=x.getId(X);X||(X=J[N]);var H=J._size,$=x.isVertical(X),U=x.isGrouped(X),V=X.entrywidthmode==="fraction",j=X.borderwidth,q=2*j,Y=d.itemGap,K=X.indentation+X.itemwidth+Y*2,te=2*(j+Y),ne=B(X),se=X.y<0||X.y===0&&ne==="top",le=X.y>1||X.y===1&&ne==="bottom",ce=X.tracegroupgap,pe={};let{orientation:xe,yref:ye}=X,{maxheight:fe}=X,ae=se||le||xe!=="v"||ye!=="paper";fe||(fe=ae?.5:1);let ee=ae?J.height:H.h;X._maxHeight=Math.max(fe>1?fe:fe*ee,30);var ie=0;X._width=0,X._height=0;var Q=P(X);if($)W.each(function(Ue){var at=Ue[0].height;n.setTranslate(this,j+Q[0],j+Q[1]+X._height+at/2+Y),X._height+=at,X._width=Math.max(X._width,Ue[0].width)}),ie=K+X._width,X._width+=Y+K+q,X._height+=te,U&&(G.each(function(Ue,at){n.setTranslate(this,0,at*X.tracegroupgap)}),X._height+=(X._lgroupsLength-1)*X.tracegroupgap);else{var ue=L(X),ge=X.x<0||X.x===0&&ue==="right",Me=X.x>1||X.x===1&&ue==="left",Te=le||se,je=J.width/2;X._maxWidth=Math.max(ge?Te&&ue==="left"?H.l+H.w:je:Me?Te&&ue==="right"?H.r+H.w:je:H.w,2*K);var Ve=0,Ze=0;W.each(function(Ue){var at=k(Ue,X,K);Ve=Math.max(Ve,at),Ze+=at}),ie=null;var Ke=0;if(U){var vt=0,xt=0,Pt=0;G.each(function(){var Ue=0,at=0;t.select(this).selectAll("g.traces").each(function(ft){var At=k(ft,X,K),ht=ft[0].height;n.setTranslate(this,Q[0],Q[1]+j+Y+ht/2+at),at+=ht,Ue=Math.max(Ue,At),pe[ft[0].trace.legendgroup]=Ue});var rt=Ue+Y;xt>0&&rt+j+xt>X._maxWidth?(Ke=Math.max(Ke,xt),xt=0,Pt+=vt+ce,vt=at):vt=Math.max(vt,at),n.setTranslate(this,xt,Pt),xt+=rt}),X._width=Math.max(Ke,xt)+j,X._height=Pt+vt+te}else{var mt=W.size(),Mt=Ze+q+(mt-1)*Y=X._maxWidth&&(Ke=Math.max(Ke,me),qe=0,Ye+=lt,X._height+=lt,lt=0),n.setTranslate(this,Q[0]+j+qe,Q[1]+j+Ye+at/2+Y),me=qe+rt+Y,qe+=ft,lt=Math.max(lt,at)}),Mt?(X._width=qe+q,X._height=lt+te):(X._width=Math.max(Ke,me)+q,X._height+=lt+te)}}X._width=Math.ceil(Math.max(X._width+Q[0],X._titleWidth+2*(j+d.titlePad))),X._height=Math.ceil(Math.max(X._height+Q[1],X._titleHeight+2*(j+d.itemGap))),X._effHeight=Math.min(X._height,X._maxHeight);var _e=O._context.edits,Ae=_e.legendText||_e.legendPosition;W.each(function(Ue){var at=t.select(this).select("."+N+"toggle"),rt=Ue[0].height,ft=Ue[0].trace.legendgroup,At=k(Ue,X,K);U&&ft!==""&&(At=pe[ft]);var ht=Ae?K:ie||At;!$&&!V&&(ht+=Y/2),n.setRect(at,0,-rt/2,ht,rt)});var ke=Z.select("."+N+"titletext");ke.node()&&C(ke,X,j);var Ee=Z.select("."+N+"titletoggle");if(Ee.size()&&ke.node()){var De=ke.attr("x")||0,Je=d.titlePad;n.setRect(Ee,De-Je,j,X._titleWidth+2*Je,X._titleHeight+2*Je)}}function I(O,G,W,X){var Z=O._fullLayout,J=Z[G],N=L(J),H=B(J),$=J.xref==="paper",U=J.yref==="paper";O._fullLayout._reservedMargin[G]={};var V=J.y<.5?"b":"t",j=J.x<.5?"l":"r",q={r:Z.width-W,l:W+J._width,b:Z.height-X,t:X+J._effHeight};if($&&U)return a.autoMargin(O,G,{x:J.x,y:J.y,l:J._width*m[N],r:J._width*y[N],b:J._effHeight*y[H],t:J._effHeight*m[H]});$?O._fullLayout._reservedMargin[G][V]=q[V]:U||J.orientation==="v"?O._fullLayout._reservedMargin[G][j]=q[j]:O._fullLayout._reservedMargin[G][V]=q[V]}function L(O){return i.isRightAnchor(O)?"right":i.isCenterAnchor(O)?"center":"left"}function B(O){return i.isBottomAnchor(O)?"bottom":i.isMiddleAnchor(O)?"middle":"top"}}}),NE=de({"src/components/fx/hover.js"(e){"use strict";var r=Yr(),t=da(),i=Qt(),a=i.pushUnique,o=i.strTranslate,s=i.strRotate,l=u1(),n=Zo(),u=_q(),c=hn(),f=ta(),h=Uc(),d=nn(),p=zl().zindexSeparator,g=Ma(),m=sf(),y=Ta(),_=IE(),v=OE(),x=y.YANGLE,S=Math.PI*x/180,M=1/Math.sin(S),C=Math.cos(S),w=Math.sin(S),k=y.HOVERARROWSIZE,A=y.HOVERTEXTPAD,b={box:!0,ohlc:!0,violin:!0,candlestick:!0},E={scatter:!0,scattergl:!0,splom:!0};function T(j,q){return j.distance-q.distance}e.hover=function(q,Y,K,te){q=i.getGraphDiv(q);var ne=Y.target;i.throttle(q._fullLayout._uid+y.HOVERID,y.HOVERMINTIME,function(){F(q,Y,K,te,ne)})},e.loneHover=function(q,Y){var K=!0;Array.isArray(q)||(K=!1,q=[q]);var te=Y.gd,ne=$(te),se=U(te),le=q.map(function(Q){var ue=Q._x0||Q.x0||Q.x||0,ge=Q._x1||Q.x1||Q.x||0,Me=Q._y0||Q.y0||Q.y||0,Te=Q._y1||Q.y1||Q.y||0,je=Q.eventData;if(je){var Ve=Math.min(ue,ge),Ze=Math.max(ue,ge),Ke=Math.min(Me,Te),vt=Math.max(Me,Te),xt=Q.trace;if(g.traceIs(xt,"gl3d")){var Pt=te._fullLayout[xt.scene]._scene.container,mt=Pt.offsetLeft,Mt=Pt.offsetTop;Ve+=mt,Ze+=mt,Ke+=Mt,vt+=Mt}je.bbox={x0:Ve+se,x1:Ze+se,y0:Ke+ne,y1:vt+ne},je.xPixel=(ue+ge)/2,je.yPixel=(Me+Te)/2,Y.inOut_bbox&&Y.inOut_bbox.push(je.bbox)}else je=!1;return{color:Q.color||f.defaultLine,x0:Q.x0||Q.x||0,x1:Q.x1||Q.x||0,y0:Q.y0||Q.y||0,y1:Q.y1||Q.y||0,xLabel:Q.xLabel,yLabel:Q.yLabel,zLabel:Q.zLabel,text:Q.text,name:Q.name,idealAlign:Q.idealAlign,borderColor:Q.borderColor,fontFamily:Q.fontFamily,fontSize:Q.fontSize,fontColor:Q.fontColor,fontWeight:Q.fontWeight,fontStyle:Q.fontStyle,fontVariant:Q.fontVariant,nameLength:Q.nameLength,textAlign:Q.textAlign,trace:Q.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Q.hovertemplate||!1,hovertemplateLabels:Q.hovertemplateLabels||!1,eventData:je}}),ce=!1,pe=P(le,{gd:te,hovermode:"closest",rotateLabels:ce,bgColor:Y.bgColor||f.background,container:r.select(Y.container),outerContainer:Y.outerContainer||Y.container}),xe=pe.hoverLabels,ye=5,fe=0,ae=0;xe.sort(function(Q,ue){return Q.y0-ue.y0}).each(function(Q,ue){var ge=Q.y0-Q.by/2;ge-yeZe[0]._length||kt<0||kt>Ke[0]._length)return h.unhoverRaw(j,q)}if(q.pointerX=yt+Ze[0]._offset,q.pointerY=kt+Ke[0]._offset,"xval"in q?Ye=m.flat(ne,q.xval):Ye=m.p2c(Ze,yt),"yval"in q?me=m.flat(ne,q.yval):me=m.p2c(Ke,kt),j._hoverPointerX=q.pointerX,j._hoverPointerY=q.pointerY,!t(Ye[0])||!t(me[0]))return i.warn("Fx.hover failed",q,j),h.unhoverRaw(j,q)}le.clickanywhere&&(j._hoverXVals=Ye,j._hoverYVals=me,j._hoverXAxes=Ze,j._hoverYAxes=Ke);var $t=1/0;function mr(Li,In){for(Ae=0;AeAt&&(lt.splice(0,At),$t=lt[0].distance),ye&&Mt!==0&<.length===0){ft.distance=Mt,ft.index=!1;var Mn=Ee._module.hoverPoints(ft,at,rt,"closest",{hoverLayer:le._hoverlayer});if(Mn&&(Mn=Mn.filter(function(on){return on.spikeDistance<=Mt})),Mn&&Mn.length){var Kn,zn=Mn.filter(function(on){return on.xa.showspikes&&on.xa.spikesnap!=="hovered data"});if(zn.length){var ua=zn[0];t(ua.x0)&&t(ua.y0)&&(Kn=Er(ua),(!ht.vLinePoint||ht.vLinePoint.spikeDistance>Kn.spikeDistance)&&(ht.vLinePoint=Kn))}var Ea=Mn.filter(function(on){return on.ya.showspikes&&on.ya.spikesnap!=="hovered data"});if(Ea.length){var ln=Ea[0];t(ln.x0)&&t(ln.y0)&&(Kn=Er(ln),(!ht.hLinePoint||ht.hLinePoint.spikeDistance>Kn.spikeDistance)&&(ht.hLinePoint=Kn))}}}}}mr();function br(Li,In,pn){for(var Ka=null,Rn=1/0,tn,Mn=0;MnLi.trace.index===Ua.trace.index):lt=[Ua];var dn=lt.length,pi=H("x",Ua,le),Jr=H("y",Ua,le);mr(pi,Jr);var Be=[],Fe={},Et=0,St=function(Li){var In=b[Li.trace.type]?D(Li):Li.trace.index;if(!Fe[In])Et++,Fe[In]=Et,Be.push(Li);else{var pn=Fe[In]-1,Ka=Be[pn];pn>0&&Math.abs(Li.distance)dn-1;zt--)St(lt[zt]);lt=Be,oi()}var Wt=j._hoverdata,Yt=[],ze=$(j),tt=U(j);for(let Li of lt){var ct=m.makeEventData(Li,Li.trace,Li.cd);if(Li.hovertemplate!==!1){var wt=!1;Li.cd[Li.index]&&Li.cd[Li.index].ht&&(wt=Li.cd[Li.index].ht),Li.hovertemplate=wt||Li.trace.hovertemplate||!1}if(Li.xa&&Li.ya){var Nt=Li.x0+Li.xa._offset,It=Li.x1+Li.xa._offset,Zt=Li.y0+Li.ya._offset,qt=Li.y1+Li.ya._offset,vr=Math.min(Nt,It),Br=Math.max(Nt,It),Pr=Math.min(Zt,qt),Mi=Math.max(Zt,qt);ct.bbox={x0:vr+tt,x1:Br+tt,y0:Pr+ze,y1:Mi+ze},ct.xPixel=(Nt+It)/2,ct.yPixel=(Zt+qt)/2}Li.eventData=[ct],Yt.push(ct)}j._hoverdata=Yt;var gi=fe==="y"&&(qe.length>1||lt.length>1)||fe==="closest"&&Gt&<.length>1,ba=f.combine(le.plot_bgcolor||f.background,le.paper_bgcolor),Hi=P(lt,{gd:j,hovermode:fe,rotateLabels:gi,bgColor:ba,container:le._hoverlayer,outerContainer:le._paper.node(),commonLabelOpts:le.hoverlabel,hoverdistance:le.hoverdistance}),Za=Hi.hoverLabels;if(m.isUnifiedHover(fe)||(I(Za,gi,le,Hi.commonLabelBoundingBox),O(Za,gi,le._invScaleX,le._invScaleY)),te&&te.tagName){var oa=g.getComponentMethod("annotations","hasClickToShow")(j,Yt);u(r.select(te),oa?"pointer":"")}var Cn=X(j,q,Wt);if(!te||K||!Cn&&!le.hoveranywhere)return;Wt&&Cn&&j.emit("plotly_unhover",{event:q,points:Wt}),_n(j._hoverdata);function _n(Li){j.emit("plotly_hover",{event:q,points:Li,xaxes:Ze,yaxes:Ke,xvals:m.c2dApply(Ze,Ye),yvals:m.c2dApply(Ke,me),xPixel:q.pointerX,yPixel:q.pointerY})}}function D(j){return[j.trace.index,j.index,j.x0,j.y0,j.name,j.attr,j.xa?j.xa._id:"",j.ya?j.ya._id:""].join(",")}var R=/([\s\S]*)<\/extra>/;function P(j,q){var Y=q.gd,K=Y._fullLayout,te=q.hovermode,ne=q.rotateLabels,se=q.bgColor,le=q.container,ce=q.outerContainer,pe=q.commonLabelOpts||{};if(j.length===0)return[[]];var xe=q.fontFamily||y.HOVERFONT,ye=q.fontSize||y.HOVERFONTSIZE,fe=q.fontWeight||K.font.weight,ae=q.fontStyle||K.font.style,ee=q.fontVariant||K.font.variant,ie=q.fontTextcase||K.font.textcase,Q=q.fontLineposition||K.font.lineposition,ue=q.fontShadow||K.font.shadow,ge=j[0],Me=ge.xa,Te=ge.ya,je=te.charAt(0),Ve=je+"Label",Ze=ge[Ve];if(Ze===void 0&&Me.type==="multicategory")for(var Ke=0;KeK.width-Yt&&(ze=K.width-Yt),bi.attr("d","M"+(St-ze)+",0L"+(St-ze+k)+","+Wt+k+"H"+Yt+"v"+Wt+(A*2+Et.height)+"H"+-Yt+"V"+Wt+k+"H"+(St-ze-k)+"Z"),St=ze,Ae.minX=St-Yt,Ae.maxX=St+Yt,Me.side==="top"?(Ae.minY=zt-(A*2+Et.height),Ae.maxY=zt-A):(Ae.minY=zt+A,Ae.maxY=zt+(A*2+Et.height))}else{var tt,ct,wt;Te.side==="right"?(tt="start",ct=1,wt="",St=Me._offset+Me._length):(tt="end",ct=-1,wt="-",St=Me._offset),zt=Te._offset+(ge.y0+ge.y1)/2,Ua.attr("text-anchor",tt),bi.attr("d","M0,0L"+wt+k+","+k+"V"+(A+Et.height/2)+"h"+wt+(A*2+Et.width)+"V-"+(A+Et.height/2)+"H"+wt+k+"V-"+k+"Z"),Ae.minY=zt-(A+Et.height/2),Ae.maxY=zt+(A+Et.height/2),Te.side==="right"?(Ae.minX=St+k,Ae.maxX=St+k+(A*2+Et.width)):(Ae.minX=St-k-(A*2+Et.width),Ae.maxX=St-k);var Nt=Et.height/2,It=xt-Et.top-Nt,Zt="clip"+K._uid+"commonlabel"+Te._id,qt;if(Stbi.hoverinfo!=="none");if(xi.length===0)return[];var ke=K.hoverlabel,Ee=ke.font,De=xi[0],Je=((te==="x unified"?De.xa:De.ya).unifiedhovertitle||{}).text,Ue=Je?i.hovertemplateString({data:te==="x unified"?[{xa:De.xa,x:De.xVal}]:[{ya:De.ya,y:De.yVal}],fallback:De.trace.hovertemplatefallback,locale:K._d3locale,template:Je}):Ze,at={showlegend:!0,legend:{title:{text:Ue,font:Ee},font:Ee,bgcolor:ke.bgcolor,bordercolor:ke.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:K.legend?K.legend.traceorder:void 0,orientation:"v"}},rt={font:Ee};_(at,rt,Y._fullData);var ft=rt.legend;ft.entries=[];for(var At=0;At=0?ja=oi:Qr+Ct=0?ja=Qr:ea+Ct=0?ya=Ur:Ai+$t=0?ya=Ai:$i+$t=0,(xi.idealAlign==="top"||!Pr)&&Mi?(wt-=It/2,xi.anchor="end"):Pr?(wt+=It/2,xi.anchor="start"):xi.anchor="middle",xi.crossPos=wt;else{if(xi.pos=wt,Pr=ct+Nt/2+Br<=Pt,Mi=ct-Nt/2-Br>=0,(xi.idealAlign==="left"||!Pr)&&Mi)ct-=Nt/2,xi.anchor="end";else if(Pr)ct+=Nt/2,xi.anchor="start";else{xi.anchor="middle";var gi=Br/2,ba=ct+gi-Pt,Hi=ct-gi;ba>0&&(ct-=ba),Hi<0&&(ct+=-Hi)}xi.crossPos=ct}zt.attr("text-anchor",xi.anchor),Yt&&Wt.attr("text-anchor",xi.anchor),bi.attr("transform",o(ct,wt)+(ne?s(x):""))}),{hoverLabels:pa,commonLabelBoundingBox:Ae}}function z(j,q,Y,K,te,ne){var se,le,ce="",pe="";j.nameOverride!==void 0&&(j.name=j.nameOverride),j.name&&(j.trace._meta&&(j.name=i.templateString(j.name,j.trace._meta)),ce=J(j.name,j.nameLength));var xe=Y.charAt(0),ye=xe==="x"?"y":"x";j.zLabel!==void 0?(j.xLabel!==void 0&&(pe+="x: "+j.xLabel+"
"),j.yLabel!==void 0&&(pe+="y: "+j.yLabel+"
"),j.trace.type!=="choropleth"&&j.trace.type!=="choroplethmap"&&(pe+=(pe?"z: ":"")+j.zLabel)):q&&j[xe+"Label"]===te?pe=j[ye+"Label"]||"":j.xLabel===void 0?j.yLabel!==void 0&&j.trace.type!=="scattercarpet"&&(pe=j.yLabel):j.yLabel===void 0?pe=j.xLabel:pe="("+j.xLabel+", "+j.yLabel+")",(j.text||j.text===0)&&!Array.isArray(j.text)&&(pe+=(pe?"
":"")+j.text),j.extraText!==void 0&&(pe+=(pe?"
":"")+j.extraText),ne&&pe===""&&!j.hovertemplate&&(ce===""&&ne.remove(),pe=ce),(le=(se=j.trace)==null?void 0:se.hoverlabel)!=null&&le.split&&(j.hovertemplate="");let{hovertemplate:fe=!1}=j;if(fe){let ae=j.hovertemplateLabels||j;j[xe+"Label"]!==te&&(ae[xe+"other"]=ae[xe+"Val"],ae[xe+"otherLabel"]=ae[xe+"Label"]),pe=i.hovertemplateString({data:[j.eventData[0]||{},j.trace._meta],fallback:j.trace.hovertemplatefallback,labels:ae,locale:K._d3locale,template:fe}),pe=pe.replace(R,(ee,ie)=>(ce=J(ie,j.nameLength),""))}return[pe,ce]}function I(j,q,Y,K){var te=q?"xa":"ya",ne=q?"ya":"xa",se=0,le=1,ce=j.size(),pe=new Array(ce),xe=0,ye=K.minX,fe=K.maxX,ae=K.minY,ee=K.maxY,ie=function(Ye){return Ye*Y._invScaleX},Q=function(Ye){return Ye*Y._invScaleY};j.each(function(Ye){var me=Ye[te],_e=Ye[ne],Ae=me._id.charAt(0)==="x",ke=me.range;xe===0&&ke&&ke[0]>ke[1]!==Ae&&(le=-1);var Ee=0,De=Ae?Y.width:Y.height;if(Y.hovermode==="x"||Y.hovermode==="y"){var Je=L(Ye,q),Ue=Ye.anchor,at=Ue==="end"?-1:1,rt,ft;if(Ue==="middle")rt=Ye.crossPos+(Ae?Q(Je.y-Ye.by/2):ie(Ye.bx/2+Ye.tx2width/2)),ft=rt+(Ae?Q(Ye.by):ie(Ye.bx));else if(Ae)rt=Ye.crossPos+Q(k+Je.y)-Q(Ye.by/2-k),ft=rt+Q(Ye.by);else{var At=ie(at*k+Je.x),ht=At+ie(at*Ye.bx);rt=Ye.crossPos+Math.min(At,ht),ft=Ye.crossPos+Math.max(At,ht)}Ae?ae!==void 0&&ee!==void 0&&Math.min(ft,ee)-Math.max(rt,ae)>1&&(_e.side==="left"?(Ee=_e._mainLinePosition,De=Y.width):De=_e._mainLinePosition):ye!==void 0&&fe!==void 0&&Math.min(ft,fe)-Math.max(rt,ye)>1&&(_e.side==="top"?(Ee=_e._mainLinePosition,De=Y.height):De=_e._mainLinePosition)}pe[xe++]=[{datum:Ye,traceIndex:Ye.trace.index,dp:0,pos:Ye.pos,posref:Ye.posref,size:Ye.by*(Ae?M:1)/2,pmin:Ee,pmax:De}]}),pe.sort(function(Ye,me){return Ye[0].posref-me[0].posref||le*(me[0].traceIndex-Ye[0].traceIndex)});var ue,ge,Me,Te,je,Ve,Ze;function Ke(Ye){var me=Ye[0],_e=Ye[Ye.length-1];if(ge=me.pmin-me.pos-me.dp+me.size,Me=_e.pos+_e.dp+_e.size-me.pmax,ge>.01){for(je=Ye.length-1;je>=0;je--)Ye[je].dp+=ge;ue=!1}if(!(Me<.01)){if(ge<-.01){for(je=Ye.length-1;je>=0;je--)Ye[je].dp-=Me;ue=!1}if(ue){var Ae=0;for(Te=0;Teme.pmax&&Ae++;for(Te=Ye.length-1;Te>=0&&!(Ae<=0);Te--)Ve=Ye[Te],Ve.pos>me.pmax-1&&(Ve.del=!0,Ae--);for(Te=0;Te=0;je--)Ye[je].dp-=Me;for(Te=Ye.length-1;Te>=0&&!(Ae<=0);Te--)Ve=Ye[Te],Ve.pos+Ve.dp+Ve.size>me.pmax&&(Ve.del=!0,Ae--)}}}for(;!ue&&se<=ce;){for(se++,ue=!0,Te=0;Te.01){for(je=xt.length-1;je>=0;je--)xt[je].dp+=ge;for(vt.push.apply(vt,xt),pe.splice(Te+1,1),Ze=0,je=vt.length-1;je>=0;je--)Ze+=vt[je].dp;for(Me=Ze/vt.length,je=vt.length-1;je>=0;je--)vt[je].dp-=Me;ue=!1}else Te++}pe.forEach(Ke)}for(Te=pe.length-1;Te>=0;Te--){var Mt=pe[Te];for(je=Mt.length-1;je>=0;je--){var lt=Mt[je],qe=lt.datum;qe.offset=lt.dp,qe.del=lt.del}}}function L(j,q){var Y=0,K=j.offset;return q&&(K*=-w,Y=j.offset*C),{x:Y,y:K}}function B(j){var q={start:1,end:-1,middle:0}[j.anchor],Y=q*(k+A),K=Y+q*(j.txwidth+A),te=j.anchor==="middle";return te&&(Y-=j.tx2width/2,K+=j.txwidth/2+A),{alignShift:q,textShiftX:Y,text2ShiftX:K}}function O(j,q,Y,K){var te=function(se){return se*Y},ne=function(se){return se*K};j.each(function(se){var le=r.select(this);if(se.del)return le.remove();var ce=le.select("text.nums"),pe=se.anchor,xe=pe==="end"?-1:1,ye=B(se),fe=L(se,q),ae=fe.x,ee=fe.y,ie=pe==="middle",Q="hoverlabel"in se.trace?se.trace.hoverlabel.showarrow:!0,ue;ie?ue="M-"+te(se.bx/2+se.tx2width/2)+","+ne(ee-se.by/2)+"h"+te(se.bx)+"v"+ne(se.by)+"h-"+te(se.bx)+"Z":Q?ue="M0,0L"+te(xe*k+ae)+","+ne(k+ee)+"v"+ne(se.by/2-k)+"h"+te(xe*se.bx)+"v-"+ne(se.by)+"H"+te(xe*k+ae)+"V"+ne(ee-k)+"Z":ue="M"+te(xe*k+ae)+","+ne(ee-se.by/2)+"h"+te(xe*se.bx)+"v"+ne(se.by)+"h"+te(-xe*se.bx)+"Z",le.select("path").attr("d",ue);var ge=ae+ye.textShiftX,Me=ee+se.ty0-se.by/2+A,Te=se.textAlign||"auto";Te!=="auto"&&(Te==="left"&&pe!=="start"?(ce.attr("text-anchor","start"),ge=ie?-se.bx/2-se.tx2width/2+A:-se.bx-A):Te==="right"&&pe!=="end"&&(ce.attr("text-anchor","end"),ge=ie?se.bx/2-se.tx2width/2-A:se.bx+A)),ce.call(n.positionText,te(ge),ne(Me)),se.tx2width&&(le.select("text.name").call(n.positionText,te(ye.text2ShiftX+ye.alignShift*A+ae),ne(ee+se.ty0-se.by/2+A)),le.select("rect").call(c.setRect,te(ye.text2ShiftX+(ye.alignShift-1)*se.tx2width/2+ae),ne(ee-se.by/2-1),te(se.tx2width),ne(se.by+2)))})}function G(j,q){var Y=j.index,K=j.trace||{},te=j.cd[0],ne=j.cd[Y]||{};function se(fe){return fe||t(fe)&&fe===0}var le=Array.isArray(Y)?function(fe,ae){var ee=i.castOption(te,Y,fe);return se(ee)?ee:i.extractOption({},K,"",ae)}:function(fe,ae){return i.extractOption(ne,K,fe,ae)};function ce(fe,ae,ee){var ie=le(ae,ee);se(ie)&&(j[fe]=ie)}if(ce("hoverinfo","hi","hoverinfo"),ce("bgcolor","hbg","hoverlabel.bgcolor"),ce("borderColor","hbc","hoverlabel.bordercolor"),ce("fontFamily","htf","hoverlabel.font.family"),ce("fontSize","hts","hoverlabel.font.size"),ce("fontColor","htc","hoverlabel.font.color"),ce("fontWeight","htw","hoverlabel.font.weight"),ce("fontStyle","hty","hoverlabel.font.style"),ce("fontVariant","htv","hoverlabel.font.variant"),ce("nameLength","hnl","hoverlabel.namelength"),ce("textAlign","hta","hoverlabel.align"),j.posref=q==="y"||q==="closest"&&K.orientation==="h"?j.xa._offset+(j.x0+j.x1)/2:j.ya._offset+(j.y0+j.y1)/2,j.x0=i.constrain(j.x0,0,j.xa._length),j.x1=i.constrain(j.x1,0,j.xa._length),j.y0=i.constrain(j.y0,0,j.ya._length),j.y1=i.constrain(j.y1,0,j.ya._length),j.xLabelVal!==void 0&&(j.xLabel="xLabel"in j?j.xLabel:d.hoverLabelText(j.xa,j.xLabelVal,K.xhoverformat),j.xVal=j.xa.c2d(j.xLabelVal)),j.yLabelVal!==void 0&&(j.yLabel="yLabel"in j?j.yLabel:d.hoverLabelText(j.ya,j.yLabelVal,K.yhoverformat),j.yVal=j.ya.c2d(j.yLabelVal)),j.zLabelVal!==void 0&&j.zLabel===void 0&&(j.zLabel=String(j.zLabelVal)),!isNaN(j.xerr)&&!(j.xa.type==="log"&&j.xerr<=0)){var pe=d.tickText(j.xa,j.xa.c2l(j.xerr),"hover").text;j.xerrneg!==void 0?j.xLabel+=" +"+pe+" / -"+d.tickText(j.xa,j.xa.c2l(j.xerrneg),"hover").text:j.xLabel+=" \xB1 "+pe,q==="x"&&(j.distance+=1)}if(!isNaN(j.yerr)&&!(j.ya.type==="log"&&j.yerr<=0)){var xe=d.tickText(j.ya,j.ya.c2l(j.yerr),"hover").text;j.yerrneg!==void 0?j.yLabel+=" +"+xe+" / -"+d.tickText(j.ya,j.ya.c2l(j.yerrneg),"hover").text:j.yLabel+=" \xB1 "+xe,q==="y"&&(j.distance+=1)}var ye=j.hoverinfo||j.trace.hoverinfo;return ye&&ye!=="all"&&(ye=Array.isArray(ye)?ye:ye.split("+"),ye.indexOf("x")===-1&&(j.xLabel=void 0),ye.indexOf("y")===-1&&(j.yLabel=void 0),ye.indexOf("z")===-1&&(j.zLabel=void 0),ye.indexOf("text")===-1&&(j.text=void 0),ye.indexOf("name")===-1&&(j.name=void 0)),j}function W(j,q,Y){var K=Y.container,te=Y.fullLayout,ne=te._size,se=Y.event,le=!!q.hLinePoint,ce=!!q.vLinePoint,pe,xe;if(K.selectAll(".spikeline").remove(),!!(ce||le)){var ye=f.combine(te.plot_bgcolor,te.paper_bgcolor);if(le){var fe=q.hLinePoint,ae,ee;pe=fe&&fe.xa,xe=fe&&fe.ya;var ie=xe.spikesnap;ie==="cursor"?(ae=se.pointerX,ee=se.pointerY):(ae=pe._offset+fe.x,ee=xe._offset+fe.y);var Q=f.wcagContrast(fe.color,ye)<1.5?f.contrast(ye):fe.color,ue=xe.spikemode,ge=xe.spikethickness,Me=xe.spikecolor||Q,Te=d.getPxPosition(j,xe),je,Ve;if(ue.indexOf("toaxis")!==-1||ue.indexOf("across")!==-1){if(ue.indexOf("toaxis")!==-1&&(je=Te,Ve=ae),ue.indexOf("across")!==-1){var Ze=xe._counterDomainMin,Ke=xe._counterDomainMax;xe.anchor==="free"&&(Ze=Math.min(Ze,xe.position),Ke=Math.max(Ke,xe.position)),je=ne.l+Ze*ne.w,Ve=ne.l+Ke*ne.w}K.insert("line",":first-child").attr({x1:je,x2:Ve,y1:ee,y2:ee,"stroke-width":ge,stroke:Me,"stroke-dasharray":c.dashStyle(xe.spikedash,ge)}).classed("spikeline",!0).classed("crisp",!0),K.insert("line",":first-child").attr({x1:je,x2:Ve,y1:ee,y2:ee,"stroke-width":ge+2,stroke:ye}).classed("spikeline",!0).classed("crisp",!0)}ue.indexOf("marker")!==-1&&K.insert("circle",":first-child").attr({cx:Te+(xe.side!=="right"?ge:-ge),cy:ee,r:ge,fill:Me}).classed("spikeline",!0)}if(ce){var vt=q.vLinePoint,xt,Pt;pe=vt&&vt.xa,xe=vt&&vt.ya;var mt=pe.spikesnap;mt==="cursor"?(xt=se.pointerX,Pt=se.pointerY):(xt=pe._offset+vt.x,Pt=xe._offset+vt.y);var Mt=f.wcagContrast(vt.color,ye)<1.5?f.contrast(ye):vt.color,lt=pe.spikemode,qe=pe.spikethickness,Ye=pe.spikecolor||Mt,me=d.getPxPosition(j,pe),_e,Ae;if(lt.indexOf("toaxis")!==-1||lt.indexOf("across")!==-1){if(lt.indexOf("toaxis")!==-1&&(_e=me,Ae=Pt),lt.indexOf("across")!==-1){var ke=pe._counterDomainMin,Ee=pe._counterDomainMax;pe.anchor==="free"&&(ke=Math.min(ke,pe.position),Ee=Math.max(Ee,pe.position)),_e=ne.t+(1-Ee)*ne.h,Ae=ne.t+(1-ke)*ne.h}K.insert("line",":first-child").attr({x1:xt,x2:xt,y1:_e,y2:Ae,"stroke-width":qe,stroke:Ye,"stroke-dasharray":c.dashStyle(pe.spikedash,qe)}).classed("spikeline",!0).classed("crisp",!0),K.insert("line",":first-child").attr({x1:xt,x2:xt,y1:_e,y2:Ae,"stroke-width":qe+2,stroke:ye}).classed("spikeline",!0).classed("crisp",!0)}lt.indexOf("marker")!==-1&&K.insert("circle",":first-child").attr({cx:xt,cy:me-(pe.side!=="top"?qe:-qe),r:qe,fill:Ye}).classed("spikeline",!0)}}}function X(j,q,Y){if(!Y||Y.length!==j._hoverdata.length)return!0;for(var K=Y.length-1;K>=0;K--){var te=Y[K],ne=j._hoverdata[K];if(te.curveNumber!==ne.curveNumber||String(te.pointNumber)!==String(ne.pointNumber)||String(te.pointNumbers)!==String(ne.pointNumbers)||te.binNumber!==ne.binNumber)return!0}return!1}function Z(j,q){return!q||q.vLinePoint!==j._spikepoints.vLinePoint||q.hLinePoint!==j._spikepoints.hLinePoint}function J(j,q){return n.plainText(j||"",{len:q,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function N(j,q){for(var Y=q.charAt(0),K=[],te=[],ne=[],se=0;sej.offsetTop+j.clientTop,U=j=>j.offsetLeft+j.clientLeft;function V(j,q){var Y=j._fullLayout,K=q.getBoundingClientRect(),te=K.left,ne=K.top,se=te+K.width,le=ne+K.height,ce=i.apply3DTransform(Y._invTransform)(te,ne),pe=i.apply3DTransform(Y._invTransform)(se,le),xe=ce[0],ye=ce[1],fe=pe[0],ae=pe[1];return{x:xe,y:ye,width:fe-xe,height:ae-ye,top:Math.min(ye,ae),left:Math.min(xe,fe),right:Math.max(xe,fe),bottom:Math.max(ye,ae)}}}}),ky=de({"src/components/fx/hoverlabel_defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=sf().isUnifiedHover;r.exports=function(s,l,n,u){u=u||{};var c=l.legend;function f(h){u.font[h]||(u.font[h]=c?l.legend.font[h]:l.font[h])}l&&a(l.hovermode)&&(u.font||(u.font={}),f("size"),f("family"),f("color"),f("weight"),f("style"),f("variant"),c?(u.bgcolor||(u.bgcolor=i.combine(l.legend.bgcolor,l.paper_bgcolor)),u.bordercolor||(u.bordercolor=l.legend.bordercolor)):u.bgcolor||(u.bgcolor=l.paper_bgcolor)),n("hoverlabel.bgcolor",u.bgcolor),n("hoverlabel.bordercolor",u.bordercolor),n("hoverlabel.namelength",u.namelength),n("hoverlabel.showarrow",u.showarrow),t.coerceFont(n,"hoverlabel.font",u.font),n("hoverlabel.align",u.align)}}}),wq=de({"src/components/fx/layout_global_defaults.js"(e,r){"use strict";var t=Qt(),i=ky(),a=La();r.exports=function(s,l){function n(u,c){return t.coerce(s,l,a,u,c)}i(s,l,n)}}}),Tq=de({"src/components/fx/defaults.js"(e,r){"use strict";var t=Qt(),i=ki(),a=ky();r.exports=function(s,l,n,u){function c(h,d){return t.coerce(s,l,i,h,d)}var f=t.extendFlat({},u.hoverlabel);l.hovertemplate&&(f.namelength=-1),a(s,l,c,f)}}}),jE=de({"src/components/fx/hovermode_defaults.js"(e,r){"use strict";var t=Qt(),i=La();r.exports=function(o,s){function l(n,u){return s[n]!==void 0?s[n]:t.coerce(o,s,i,n,u)}return l("clickmode"),l("hoversubplots"),l("hoveranywhere"),l("clickanywhere"),l("hovermode")}}}),Aq=de({"src/components/fx/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=La(),a=jE(),o=ky();r.exports=function(l,n){function u(g,m){return t.coerce(l,n,i,g,m)}var c=a(l,n);c&&(u("hoverdistance"),u("spikedistance"),c.indexOf("unified")!==-1&&u("hoversort"));var f=u("dragmode");f==="select"&&u("selectdirection");var h=n._has("map"),d=n._has("geo"),p=n._basePlotModules.length;n.dragmode==="zoom"&&((h||d)&&p===1||h&&d&&p===2)&&(n.dragmode="pan"),o(l,n,u),t.coerceFont(u,"hoverlabel.grouptitlefont",n.hoverlabel.font)}}}),Mq=de({"src/components/fx/calc.js"(e,r){"use strict";var t=Qt(),i=Ma();r.exports=function(s){var l=s.calcdata,n=s._fullLayout;function u(p){return function(g){return t.coerceHoverinfo({hoverinfo:g},{_module:p._module},n)}}for(var c=0;c"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),Ew=de({"src/components/shapes/draw_newshape/constants.js"(e,r){"use strict";var t=32;r.exports={CIRCLE_SIDES:t,i000:0,i090:t/4,i180:t/2,i270:t/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),kw=de({"src/components/selections/helpers.js"(e,r){"use strict";var t=Qt().strTranslate;function i(l,n){switch(l.type){case"log":return l.p2d(n);case"date":return l.p2r(n,0,l.calendar);default:return l.p2r(n)}}function a(l,n){switch(l.type){case"log":return l.d2p(n);case"date":return l.r2p(n,0,l.calendar);default:return l.r2p(n)}}function o(l){var n=l._id.charAt(0)==="y"?1:0;return function(u){return i(l,u[n])}}function s(l){return t(l.xaxis._offset,l.yaxis._offset)}r.exports={p2r:i,r2p:a,axValue:o,getTransform:s}}}),v0=de({"src/components/shapes/draw_newshape/helpers.js"(e){"use strict";var r=DE(),t=Ew(),i=t.CIRCLE_SIDES,a=t.SQRT2,o=kw(),s=o.p2r,l=o.r2p,n=[0,3,4,5,6,1,2],u=[0,3,4,1,2];e.writePaths=function(h){var d=h.length;if(!d)return"M0,0Z";for(var p="",g=0;g0&&x{let d=h.charAt(0),p=c[d].drawn!==void 0;return f+(p?1:0)},0)},e.getDataToPixel=function(s,l,n,u,c){var f=s._fullLayout._size,h;if(l)if(c==="domain")h=function(p){return l._length*(u?1-p:p)+l._offset};else{var d=e.shapePositionToRange(l);h=function(p){var g=o(l,n);return l._offset+l.r2p(d(p,!0))+g},l.type==="date"&&(h=e.decodeDate(h))}else u?h=function(p){return f.t+f.h*(1-p)}:h=function(p){return f.l+f.w*p};return h},e.getPixelToData=function(s,l,n,u){var c=s._fullLayout._size,f;if(l)if(u==="domain")f=function(d){var p=(d-l._offset)/l._length;return n?1-p:p};else{var h=e.rangeToShapePosition(l);f=function(d){return h(l.p2r(d-l._offset))}}else n?f=function(d){return 1-(d-c.t)/c.h}:f=function(d){return(d-c.l)/c.w};return f},e.roundPositionForSharpStrokeRendering=function(s,l){var n=Math.round(l%2)===1,u=Math.round(s);return n?u+.5:u},e.makeShapesOptionsAndPlotinfo=function(s,l){var n=s._fullLayout.shapes[l]||{},u=s._fullLayout._plots[n.xref+n.yref],c=!!u;return c?u._hadPlotinfo=!0:(u={},n.xref&&n.xref!=="paper"&&(u.xaxis=s._fullLayout[n.xref+"axis"]),n.yref&&n.yref!=="paper"&&(u.yaxis=s._fullLayout[n.yref+"axis"])),u.xsizemode=n.xsizemode,u.ysizemode=n.ysizemode,u.xanchor=n.xanchor,u.yanchor=n.yanchor,{options:n,plotinfo:u}},e.makeSelectionsOptionsAndPlotinfo=function(s,l){var n=s._fullLayout.selections[l]||{},u=s._fullLayout._plots[n.xref+n.yref],c=!!u;return c?u._hadPlotinfo=!0:(u={},n.xref&&(u.xaxis=s._fullLayout[n.xref+"axis"]),n.yref&&(u.yaxis=s._fullLayout[n.yref+"axis"])),{options:n,plotinfo:u}},e.getPathString=function(s,l){let n=l.type,u=i.getRefType(l.xref),c=i.getRefType(l.yref),f=s._fullLayout._size;var h,d,p,g,m,y,_,v,x,S,M,C;function w(R,P,z,I){var L;if(R)if(P==="domain")I?L=function(B){return R._offset+R._length*(1-B)}:L=function(B){return R._offset+R._length*B};else{let B=e.shapePositionToRange(R);L=function(O){return R._offset+R.r2p(B(O,!0))},z==="path"&&R.type==="date"&&(L=e.decodeDate(L))}else I?L=function(B){return f.t+f.h*(1-B)}:L=function(B){return f.l+f.w*B};return L}if(u==="array"?(_=[],h=l.xref.map(function(R){return i.getFromId(s,R)}),_=l.xref.map(function(R,P){return w(h[P],i.getRefType(R),n,!1)})):(h=i.getFromId(s,l.xref),_=w(h,u,n,!1)),c==="array"?(v=[],d=l.yref.map(function(R){return i.getFromId(s,R)}),v=l.yref.map(function(R,P){return w(d[P],i.getRefType(R),n,!0)})):(d=i.getFromId(s,l.yref),v=w(d,c,n,!0)),n==="path")return a(l,_,v);if(u==="array")p=o(h[0],l.x0shift),g=o(h[1],l.x1shift),x=_[0](l.x0)+p,S=_[1](l.x1)+g;else if(p=o(h,l.x0shift),g=o(h,l.x1shift),l.xsizemode==="pixel"){let R=_(l.xanchor);x=R+l.x0+p,S=R+l.x1+g}else x=_(l.x0)+p,S=_(l.x1)+g;if(c==="array")m=o(d[0],l.y0shift),y=o(d[1],l.y1shift),M=v[0](l.y0)+m,C=v[1](l.y1)+y;else if(m=o(d,l.y0shift),y=o(d,l.y1shift),l.ysizemode==="pixel"){let R=v(l.yanchor);M=R-l.y0+m,C=R-l.y1+y}else M=v(l.y0)+m,C=v(l.y1)+y;if(n==="line")return"M"+x+","+M+"L"+S+","+C;if(n==="rect")return"M"+x+","+M+"H"+S+"V"+C+"H"+x+"Z";var k=(x+S)/2,A=(M+C)/2,b=Math.abs(k-x),E=Math.abs(A-M),T="A"+b+","+E,F=k+b+","+A,D=k+","+(A-E);return"M"+F+T+" 0 1,1 "+D+T+" 0 0,1 "+F+"Z"};function a(s,l,n){let u=s.path,c=s.xsizemode,f=s.ysizemode,h=s.xanchor,d=s.yanchor,p=Array.isArray(s.xref),g=Array.isArray(s.yref);var m=0,y=0;return u.replace(r.segmentRE,function(_){var v=0,x=_.charAt(0),S=r.paramIsX[x],M=r.paramIsY[x],C=r.numParams[x];let w=S.drawn!==void 0,k=M.drawn!==void 0,A=p?l[m]:l,b=g?n[y]:n;var E=_.slice(1).replace(r.paramRE,function(T){return S[v]?c==="pixel"?T=A(h)+Number(T):T=A(T):M[v]&&(f==="pixel"?T=b(d)-Number(T):T=b(T)),v++,v>C&&(T="X"),T});return v>C&&(E=E.replace(/[\s,]*X.*/,""),t.log("Ignoring extra params in segment "+_)),w&&m++,k&&y++,x+E})}e.getPixelShift=o;function o(s,l){l=l||0;var n=0;return l&&s&&(s.type==="category"||s.type==="multicategory")&&(n=(s.r2p(1)-s.r2p(0))*l),n}}}),qE=de({"src/components/shapes/display_labels.js"(e,r){"use strict";var t=Qt(),i=nn(),a=Zo(),o=hn(),s=v0().readPaths,l=m0(),n=l.getPathString,u=_w(),c=Bl().FROM_TL;r.exports=function(p,g,m,y){if(y.selectAll(".shape-label").remove(),!!(m.label.text||m.label.texttemplate)){var _;if(m.label.texttemplate){var v={};if(m.type!=="path"){var x=i.getFromId(p,m.xref),S=i.getFromId(p,m.yref);let q=Array.isArray(m.xref),Y=Array.isArray(m.yref);for(var M in u){var C=typeof u[M]=="function",w=!q||u.simpleXVariables.includes(M),k=!Y||u.simpleYVariables.includes(M);if(C&&w&&k){var A=u[M](m,x,S);A!==void 0&&(v[M]=A)}}}_=t.texttemplateStringForShapes({data:[v],fallback:m.label.texttemplatefallback,locale:p._fullLayout._d3locale,template:m.label.texttemplate})}else _=m.label.text;var b={"data-index":g},E=m.label.font,T={"data-notex":1},F=y.append("g").attr(b).classed("shape-label",!0),D=F.append("text").attr(T).classed("shape-label-text",!0).text(_),R,P,z,I;if(m.path){var L=n(p,m),B=s(L,p);R=1/0,z=1/0,P=-1/0,I=-1/0;for(var O=0;Ol.getDataToPixel(p,ie,ee,!1,Q)(ae),fe=(ae,ee,ie,Q)=>l.getDataToPixel(p,ie,ee,!0,Q)(ae);if(m.xsizemode==="pixel"){let ae=ye(m.xanchor,void 0,K,le),ee=l.getPixelShift(K,m.x0shift),ie=l.getPixelShift(K,m.x1shift);R=ae+m.x0+ee,P=ae+m.x1+ie}else R=ye(m.x0,m.x0shift,K,le),P=ye(m.x1,m.x1shift,te,ce);if(m.ysizemode==="pixel"){let ae=fe(m.yanchor,void 0,ne,pe),ee=l.getPixelShift(ne,m.y0shift),ie=l.getPixelShift(ne,m.y1shift);z=ae-m.y0+ee,I=ae-m.y1+ie}else z=fe(m.y0,m.y0shift,ne,pe),I=fe(m.y1,m.y1shift,se,xe)}var N=m.label.textangle;N==="auto"&&(m.type==="line"?N=f(R,z,P,I):N=0),D.call(function(q){return q.call(o.font,E).attr({}),a.convertToTspans(q,p),q});var H=o.bBox(D.node()),$=h(R,z,P,I,m,N,H),U=$.textx,V=$.texty,j=$.xanchor;D.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[j],y:V,x:U,transform:"rotate("+N+","+U+","+V+")"}).call(a.positionText,U,V)}};function f(d,p,g,m){var y,_;return _=Math.abs(g-d),g>=d?y=p-m:y=m-p,-180/Math.PI*Math.atan2(y,_)}function h(d,p,g,m,y,_,v){var x=y.label.textposition,S=y.label.textangle,M=y.label.padding,C=y.type,w=Math.PI/180*_,k=Math.sin(w),A=Math.cos(w),b=y.label.xanchor,E=y.label.yanchor,T,F,D,R;if(C==="line"){x==="start"?(T=d,F=p):x==="end"?(T=g,F=m):(T=(d+g)/2,F=(p+m)/2),b==="auto"&&(x==="start"?S==="auto"?g>d?b="left":gd?b="right":gd?b="right":gd?b="left":g1&&!(fe.length===2&&fe[1][0]==="Z")&&(N===0&&(fe[0][0]="M"),T[J]=fe,z(),I())}}function te(fe,ae){if(fe===2){J=+ae.srcElement.getAttribute("data-i"),N=+ae.srcElement.getAttribute("data-j");var ee=T[J];!_(ee)&&!v(ee)&&K()}}function ne(fe){X=[];for(var ae=0;ae{if(!D._dragging&&D._fullLayout.hoveranywhere){let B=I(L);B&&p.hover(D,B,P.id)}}),z.addEventListener("click",L=>{if(!D._dragged&&D._fullLayout.clickanywhere){let B=I(L);B&&p.click(D,B,P.id)}})}function w(D,R,P){let z=P.xref,I=P.yref;if(Array.isArray(z)||Array.isArray(I)){let L="clip"+R._fullLayout._uid+"shape"+P._index,B=k(R,z,I);a.ensureSingleById(R._fullLayout._clips,"clipPath",L,function(O){O.append("rect")}).select("rect").attr(B),f.setClipUrl(D,L,R)}else{let L=(z+I).replace(/paper/g,"").replace(/[xyz][0-9]* *domain/g,"");f.setClipUrl(D,L?"clip"+R._fullLayout._uid+L:null,R)}}function k(D,R,P){let z=D._fullLayout._size;function I(O,G){let W=(Array.isArray(O)?O:[O]).map(J=>o.getFromId(D,J)).filter(Boolean);if(!W.length)return G?[z.t,z.t+z.h]:[z.l,z.l+z.w];let X=W.map(function(J){return J._offset}),Z=W.map(function(J){return J._offset+J._length});return[Math.min(...X),Math.max(...Z)]}let L=I(R,!1),B=I(P,!0);return{x:L[0],y:B[0],width:L[1]-L[0],height:B[1]-B[0]}}function A(D,R,P,z,I,L){var B=10,O=10,G=P.xsizemode==="pixel",W=P.ysizemode==="pixel",X=P.type==="line",Z=P.type==="path",J=L.modifyItem,N,H,$,U,V,j,q,Y,K,te,ne,se,le,ce,pe,xe=t.select(R.node().parentNode),ye=o.getFromId(D,P.xref),fe=o.getRefType(P.xref),ae=o.getFromId(D,P.yref),ee=o.getRefType(P.yref),ie=P.x0shift,Q=P.x1shift,ue=P.y0shift,ge=P.y1shift,Me=function(Ee,De){var Je=y.getDataToPixel(D,ye,De,!1,fe);return Je(Ee)},Te=function(Ee,De){var Je=y.getDataToPixel(D,ae,De,!0,ee);return Je(Ee)},je=y.getPixelToData(D,ye,!1,fe),Ve=y.getPixelToData(D,ae,!0,ee),Ze=xt(),Ke={element:Ze.node(),gd:D,prepFn:Mt,doneFn:lt,clickFn:qe},vt;d.init(Ke),Ze.node().onmousemove=mt;function xt(){return X?Pt():R}function Pt(){var Ee=10,De=Math.max(P.line.width,Ee),Je=I.append("g").attr("data-index",z).attr("drag-helper",!0);Je.append("path").attr("d",R.attr("d")).style({cursor:"move","stroke-width":De,"stroke-opacity":"0"});var Ue={"fill-opacity":"0"},at=Math.max(De/2,Ee);return Je.append("circle").attr({"data-line-point":"start-point",cx:G?Me(P.xanchor)+P.x0:Me(P.x0,ie),cy:W?Te(P.yanchor)-P.y0:Te(P.y0,ue),r:at}).style(Ue).classed("cursor-grab",!0),Je.append("circle").attr({"data-line-point":"end-point",cx:G?Me(P.xanchor)+P.x1:Me(P.x1,Q),cy:W?Te(P.yanchor)-P.y1:Te(P.y1,ge),r:at}).style(Ue).classed("cursor-grab",!0),Je}function mt(Ee){if(x(D)){vt=null;return}if(X)Ee.target.tagName==="path"?vt="move":vt=Ee.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var De=Ke.element.getBoundingClientRect(),Je=De.right-De.left,Ue=De.bottom-De.top,at=Ee.clientX-De.left,rt=Ee.clientY-De.top,ft=!Z&&Je>B&&Ue>O&&!Ee.shiftKey?d.getCursor(at/Je,1-rt/Ue):"move";g(R,ft),vt=ft.split("-")[0]}}function Mt(Ee){x(D)||(G&&(V=Me(P.xanchor)),W&&(j=Te(P.yanchor)),P.type==="path"?pe=P.path:(N=G?P.x0:Me(P.x0),H=W?P.y0:Te(P.y0),$=G?P.x1:Me(P.x1),U=W?P.y1:Te(P.y1)),N<$?(K=N,le="x0",te=$,ce="x1"):(K=$,le="x1",te=N,ce="x0"),!W&&HU?(q=H,ne="y0",Y=U,se="y1"):(q=U,ne="y1",Y=H,se="y0"),mt(Ee),_e(I,P),ke(R,P,D),Ke.moveFn=vt==="move"?Ye:me,Ke.altKey=Ee.altKey)}function lt(){x(D)||(g(R),Ae(I),w(R,D,P),i.call("_guiRelayout",D,L.getUpdateObj()))}function qe(){x(D)||Ae(I)}function Ye(Ee,De){if(P.type==="path"){var Je=function(rt){return rt},Ue=Je,at=Je;G?J("xanchor",P.xanchor=je(V+Ee)):(Ue=function(ft){return je(Me(ft)+Ee)},ye&&ye.type==="date"&&(Ue=y.encodeDate(Ue))),W?J("yanchor",P.yanchor=Ve(j+De)):(at=function(ft){return Ve(Te(ft)+De)},ae&&ae.type==="date"&&(at=y.encodeDate(at))),J("path",P.path=b(pe,Ue,at))}else G?J("xanchor",P.xanchor=je(V+Ee)):(J("x0",P.x0=je(N+Ee)),J("x1",P.x1=je($+Ee))),W?J("yanchor",P.yanchor=Ve(j+De)):(J("y0",P.y0=Ve(H+De)),J("y1",P.y1=Ve(U+De)));R.attr("d",_(D,P)),_e(I,P),n(D,z,P,xe)}function me(Ee,De){if(Z){var Je=function(br){return br},Ue=Je,at=Je;G?J("xanchor",P.xanchor=je(V+Ee)):(Ue=function(Er){return je(Me(Er)+Ee)},ye&&ye.type==="date"&&(Ue=y.encodeDate(Ue))),W?J("yanchor",P.yanchor=Ve(j+De)):(at=function(Er){return Ve(Te(Er)+De)},ae&&ae.type==="date"&&(at=y.encodeDate(at))),J("path",P.path=b(pe,Ue,at))}else if(X){if(vt==="resize-over-start-point"){var rt=N+Ee,ft=W?H-De:H+De;J("x0",P.x0=G?rt:je(rt)),J("y0",P.y0=W?ft:Ve(ft))}else if(vt==="resize-over-end-point"){var At=$+Ee,ht=W?U-De:U+De;J("x1",P.x1=G?At:je(At)),J("y1",P.y1=W?ht:Ve(ht))}}else{var Gt=function(br){return vt.indexOf(br)!==-1},fr=Gt("n"),gt=Gt("s"),yt=Gt("w"),kt=Gt("e"),Lt=fr?q+De:q,Ct=gt?Y+De:Y,$t=yt?K+Ee:K,mr=kt?te+Ee:te;W&&(fr&&(Lt=q-De),gt&&(Ct=Y-De)),(!W&&Ct-Lt>O||W&&Lt-Ct>O)&&(J(ne,P[ne]=W?Lt:Ve(Lt)),J(se,P[se]=W?Ct:Ve(Ct))),mr-$t>B&&(J(le,P[le]=G?$t:je($t)),J(ce,P[ce]=G?mr:je(mr)))}R.attr("d",_(D,P)),_e(I,P),n(D,z,P,xe)}function _e(Ee,De){(G||W)&&Je();function Je(){var Ue=De.type!=="path",at=Ee.selectAll(".visual-cue").data([0]),rt=1;at.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":rt}).classed("visual-cue",!0);var ft=Me(G?De.xanchor:a.midRange(Ue?[De.x0,De.x1]:y.extractPathCoords(De.path,m.paramIsX))),At=Te(W?De.yanchor:a.midRange(Ue?[De.y0,De.y1]:y.extractPathCoords(De.path,m.paramIsY)));if(ft=y.roundPositionForSharpStrokeRendering(ft,rt),At=y.roundPositionForSharpStrokeRendering(At,rt),G&&W){var ht="M"+(ft-1-rt)+","+(At-1-rt)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";at.attr("d",ht)}else if(G){var Gt="M"+(ft-1-rt)+","+(At-9-rt)+"v18 h2 v-18 Z";at.attr("d",Gt)}else{var fr="M"+(ft-9-rt)+","+(At-1-rt)+"h18 v2 h-18 Z";at.attr("d",fr)}}}function Ae(Ee){Ee.selectAll(".visual-cue").remove()}function ke(Ee,De,Je){var Ue=De.xref,at=De.yref,rt=o.getFromId(Je,Ue),ft=o.getFromId(Je,at),At="";Ue!=="paper"&&!rt.autorange&&(At+=Ue),at!=="paper"&&!ft.autorange&&(At+=at),f.setClipUrl(Ee,At?"clip"+Je._fullLayout._uid+At:null,Je)}}function b(D,R,P){return D.replace(m.segmentRE,function(z){var I=0,L=z.charAt(0),B=m.paramIsX[L],O=m.paramIsY[L],G=m.numParams[L],W=z.slice(1).replace(m.paramRE,function(X){return I>=G||(B[I]?X=R(X):O[I]&&(X=P(X)),I++),X});return L+W})}function E(D,R){if(S(D)){var P=R.node(),z=+P.getAttribute("data-index");if(z>=0){if(z===D._fullLayout._activeShapeIndex){T(D);return}D._fullLayout._activeShapeIndex=z,D._fullLayout._deactivateShape=T,v(D)}}}function T(D){if(S(D)){var R=D._fullLayout._activeShapeIndex;R>=0&&(u(D),delete D._fullLayout._activeShapeIndex,v(D))}}function F(D){if(S(D)){u(D);var R=D._fullLayout._activeShapeIndex,P=(D.layout||{}).shapes||[];if(R{let h=a(l),d=n.append("div").classed("plotly-cloud-dialog-box",!0);if(d.append("div").classed("plotly-cloud-dialog-title",!0).text(h.DIALOG_TITLE),u===i.plotlyServerURL){let g=d.append("div").classed("plotly-cloud-dialog-message",!0),m=new URL(u).origin,y=h.DIALOG_MESSAGE_CLOUD.split(/(\{|\})/),_=y[0],v=y[2],x=y[4];g.append("span").text(_),g.append("a").classed("plotly-cloud-dialog-message--hostname",!0).attr("href",m).attr("target","_blank").text(v),g.append("span").text(x),g.append("div").classed("plotly-cloud-dialog-message--account",!0).text(h.DIALOG_MESSAGE_CLOUD_ACCOUNT)}else{let g=new URL(u),m=g.hostname,y=g.origin,_=h.DIALOG_MESSAGE_OTHER.split(/(\{|\})/),v=_[0],x=_[4],S=d.append("div").classed("plotly-cloud-dialog-message",!0);S.append("span").text(v),S.append("a").classed("plotly-cloud-dialog-message--hostname",!0).attr("href",y).attr("target","_blank").text(m),S.append("span").text(x)}let p=d.append("div").classed("plotly-cloud-dialog-buttons",!0);p.append("button").classed("plotly-cloud-dialog-btn",!0).classed("plotly-cloud-dialog-btn--cancel",!0).text(h.DIALOG_CANCEL).on("click",f),p.append("button").classed("plotly-cloud-dialog-btn",!0).classed("plotly-cloud-dialog-btn--confirm",!0).text(h.DIALOG_CONFIRM).on("click",c)},s=(l,n,u)=>{let c=t.select(l._fullLayout._paperdiv.node());c.selectAll(".plotly-cloud-dialog").remove();let f=c.append("div").classed("plotly-cloud-dialog",!0),h=()=>{f.remove(),document.removeEventListener("keydown",d)},d=p=>{(p.key==="Escape"||p.keyCode===27)&&h()};document.addEventListener("keydown",d),f.on("click",()=>{t.event.target===f.node()&&h()}),o(l,f,n,()=>{h(),u()},h)};r.exports=s}}),VE=de({"src/components/modebar/buttons.js"(e,r){"use strict";var t=Ma(),i=Es(),a=Hs(),o=Sw(),s=Lw().eraseActiveShape,l=kq(),n=Qt(),u=n._,c=r.exports={};c.toImage={name:"toImage",title:function(w){var k=w._context.toImageButtonOptions||{},A=k.format||"png";return A==="png"?u(w,"Download plot as a PNG"):u(w,"Download plot")},icon:o.camera,click:function(w){var k=w._context.toImageButtonOptions,A={format:k.format||"png"};n.notifier(u(w,"Preparing image - this may take a few seconds"),"long",w),["filename","width","height","scale"].forEach(function(b){b in k&&(A[b]=k[b])}),t.call("downloadImage",w,A).then(function(b){n.notifier(u(w,"Image download succeeded")+" - "+b,"long",w)}).catch(function(){n.notifier(u(w,"Sorry, there was a problem downloading your image!"),"long",w)})}},c.downloadJson={name:"downloadJson",title:function(w){return u(w,"Download plot as JSON")},icon:o.curlybraces,click:function(w){t.call("downloadImage",w,{format:"full-json"}).then(function(k){n.notifier(u(w,"JSON download succeeded")+" - "+k,"long",w)}).catch(function(){n.notifier(u(w,"Sorry, there was a problem downloading your JSON file!"),"long",w)})}},c.sendChartToCloud={name:"sendChartToCloud",title:function(w){return u(w,"Share chart...")},icon:o.cloudupload,click:function(w){var k=(window.PLOTLYENV||{}).BASE_URL||w._context.plotlyServerURL;if(!k){console.error("No destination URL provided (plotlyServerURL is empty)");return}var A;try{A=new URL(k)}catch{console.error("Invalid plotlyServerURL: "+k);return}let b=["http:","https:"];if(!b.includes(A.protocol)){console.error(`Invalid protocol '${A.protocol}' in plotlyServerURL '${k}'. Must be one of: ${b.join(", ")}`);return}l(w,k,function(){i.sendDataToCloud(w,k)})}},c.zoom2d={name:"zoom2d",_cat:"zoom",title:function(w){return u(w,"Zoom")},attr:"dragmode",val:"zoom",icon:o.zoombox,click:f},c.pan2d={name:"pan2d",_cat:"pan",title:function(w){return u(w,"Pan")},attr:"dragmode",val:"pan",icon:o.pan,click:f},c.select2d={name:"select2d",_cat:"select",title:function(w){return u(w,"Box Select")},attr:"dragmode",val:"select",icon:o.selectbox,click:f},c.lasso2d={name:"lasso2d",_cat:"lasso",title:function(w){return u(w,"Lasso Select")},attr:"dragmode",val:"lasso",icon:o.lasso,click:f},c.drawclosedpath={name:"drawclosedpath",title:function(w){return u(w,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:o.drawclosedpath,click:f},c.drawopenpath={name:"drawopenpath",title:function(w){return u(w,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:o.drawopenpath,click:f},c.drawline={name:"drawline",title:function(w){return u(w,"Draw line")},attr:"dragmode",val:"drawline",icon:o.drawline,click:f},c.drawrect={name:"drawrect",title:function(w){return u(w,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:o.drawrect,click:f},c.drawcircle={name:"drawcircle",title:function(w){return u(w,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:o.drawcircle,click:f},c.eraseshape={name:"eraseshape",title:function(w){return u(w,"Erase active shape")},icon:o.eraseshape,click:s},c.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(w){return u(w,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:f},c.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(w){return u(w,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:f},c.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(w){return u(w,"Autoscale")},attr:"zoom",val:"auto",icon:o.autoscale,click:f},c.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(w){return u(w,"Reset axes")},attr:"zoom",val:"reset",icon:o.home,click:f},c.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(w){return u(w,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:f},c.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(w){return u(w,"Compare data on hover")},attr:"hovermode",val:function(w){return w._fullLayout._isHoriz?"y":"x"},icon:o.tooltip_compare,gravity:"ne",click:f};function f(w,k){var A=k.currentTarget,b=A.getAttribute("data-attr"),E=A.getAttribute("data-val")||!0,T=w._fullLayout,F={},D=a.list(w,null,!0),R=T._cartesianSpikesEnabled,P,z;if(b==="zoom"){var I=E==="in"?.5:2,L=(1+I)/2,B=(1-I)/2,O,G;for(z=0;z-$),[G,W]=I.invert(z.midPt),{minscale:X}=P.projection,Z=(A=P.projection.maxscale)!=null?A:1/0,J=Math.min(X,Z),N=Math.max(X,Z),H=T==="in"?m*L:1/m*L;H>N?H=N:H$E});var Pw,HE,$E,WE=Ir({"src/components/modebar/attributes.ts"(){"use strict";Pw=Vr(GE()),HE={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar",description:"Sets the orientation of the modebar."},bgcolor:{valType:"color",editType:"modebar",description:"Sets the background color of the modebar."},color:{valType:"color",editType:"modebar",description:"Sets the color of the icons in the modebar."},activecolor:{valType:"color",editType:"modebar",description:"Sets the color of the active or hovered on icons in the modebar."},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes related to the modebar,","including `hovermode`, `dragmode`, and `showspikes` at both the","root level and inside subplots. Defaults to `layout.uirevision`."].join(" ")},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to add.","Please note that these buttons will only be shown if they are","compatible with all trace types used in a graph.","Similar to `config.modeBarButtonsToAdd` option.",`This may include *${Pw.default.backButtons.join("*, *")}*.`].join(" ")},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to remove.","Similar to `config.modeBarButtonsToRemove` option.",`This may include *${Pw.default.foreButtons.join("*, *")}*.`].join(" ")}},$E=HE}}),Cq=de({"src/components/modebar/defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=Ro(),o=(WE(),ti(Fw)).default;r.exports=function(l,n){var u=l.modebar||{},c=a.newContainer(n,"modebar");function f(d,p){return t.coerce(u,c,o,d,p)}f("orientation"),f("bgcolor",i.addOpacity(n.paper_bgcolor,.5));var h=i.contrast(i.rgb(n.modebar.bgcolor));f("color",i.addOpacity(h,.3)),f("activecolor",i.addOpacity(h,.7)),f("uirevision",n.uirevision),f("add"),f("remove")}}}),Dq=de({"src/components/modebar/modebar.js"(e,r){"use strict";var t=Yr(),i=da(),a=Qt(),o=Sw(),s=_i().version,l=new DOMParser;function n(h){this.container=h.container,this.element=document.createElement("div"),this.update(h.graphInfo,h.buttons),this.container.appendChild(this.element)}var u=n.prototype;u.update=function(h,d){this.graphInfo=h;var p=this.graphInfo._context,g=this.graphInfo._fullLayout,m="modebar-"+g._uid;this.element.setAttribute("id",m),this.element.setAttribute("role","toolbar"),this._uid=m,this.element.className="modebar modebar--custom",p.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),g.modebar.orientation==="v"&&(this.element.className+=" vertical",d=d.reverse());var y=g.modebar,_="#"+m+" .modebar-group";document.querySelectorAll(_).forEach(function(C){C.style.backgroundColor=y.bgcolor});var v=!this.hasButtons(d),x=this.hasLogo!==p.displaylogo,S=this.locale!==p.locale;if(this.locale=p.locale,(v||x||S)&&(this.removeAllButtons(),this.updateButtons(d),p.watermark||p.displaylogo)){var M=this.getLogo();p.watermark&&(M.className=M.className+" watermark"),g.modebar.orientation==="v"?this.element.insertBefore(M,this.element.childNodes[0]):this.element.appendChild(M),this.hasLogo=!0}this.updateActiveButton(),a.setStyleOnHover("#"+m+" .modebar-btn",".active",".icon path","fill: "+y.activecolor,"fill: "+y.color,this.element)},u.updateButtons=function(h){var d=this;this.buttons=h,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(p){var g=d.createGroup();p.forEach(function(m){var y=m.name;if(!y)throw new Error("must provide button 'name' in button config");if(d.buttonsNames.indexOf(y)!==-1)throw new Error("button name '"+y+"' is taken");d.buttonsNames.push(y);var _=d.createButton(m);d.buttonElements.push(_),g.appendChild(_)}),d.element.appendChild(g)})},u.createGroup=function(){var h=document.createElement("div");h.className="modebar-group";var d=this.graphInfo._fullLayout.modebar;return h.style.backgroundColor=d.bgcolor,h},u.createButton=function(h){var d=this,p=document.createElement("button");p.setAttribute("type","button"),p.setAttribute("rel","tooltip"),p.className="modebar-btn";var g=h.title;g===void 0?g=h.name:typeof g=="function"&&(g=g(this.graphInfo)),(g||g===0)&&(p.setAttribute("data-title",g),p.setAttribute("aria-label",g)),h.attr!==void 0&&p.setAttribute("data-attr",h.attr);var m=h.val;m!==void 0&&(typeof m=="function"&&(m=m(this.graphInfo)),p.setAttribute("data-val",m));var y=h.click;if(typeof y!="function")throw new Error("must provide button 'click' function in button config");p.addEventListener("click",function(v){h.click(d.graphInfo,v),d.updateActiveButton(v.currentTarget)}),p.setAttribute("data-toggle",h.toggle||!1),h.toggle&&t.select(p).classed("active",!0);var _=h.icon;return typeof _=="function"?p.appendChild(_()):p.appendChild(this.createIcon(_||o.question)),p.setAttribute("data-gravity",h.gravity||"n"),p},u.createIcon=function(h){var d=i(h.height)?Number(h.height):h.ascent-h.descent,p="http://www.w3.org/2000/svg",g;if(h.path){g=document.createElementNS(p,"svg"),g.setAttribute("viewBox",[0,0,h.width,d].join(" ")),g.setAttribute("class","icon");var m=document.createElementNS(p,"path");m.setAttribute("d",h.path),h.transform?m.setAttribute("transform",h.transform):h.ascent!==void 0&&m.setAttribute("transform","matrix(1 0 0 -1 0 "+h.ascent+")"),g.appendChild(m)}if(h.svg){var y=l.parseFromString(h.svg,"application/xml");g=y.childNodes[0]}return g.setAttribute("height","1em"),g.setAttribute("width","1em"),g},u.updateActiveButton=function(h){var d=this.graphInfo._fullLayout,p=h!==void 0?h.getAttribute("data-attr"):null;this.buttonElements.forEach(function(g){var m=g.getAttribute("data-val")||!0,y=g.getAttribute("data-attr"),_=g.getAttribute("data-toggle")==="true",v=t.select(g),x=function(C,w){var k=d.modebar,A=C.querySelector(".icon path");A&&(w||C.matches(":hover")?A.style.fill=k.activecolor:A.style.fill=k.color)};if(_){if(y===p){var S=!v.classed("active");v.classed("active",S),x(g,S)}}else{var M=y===null?y:a.nestedProperty(d,y).get();v.classed("active",M===m),x(g,M===m)}})},u.hasButtons=function(h){var d=this.buttons;if(!d||h.length!==d.length)return!1;for(var p=0;p1?(X=["toggleHover"],Z=["resetViews"]):b?(W=["zoomInGeo","zoomOutGeo"],X=["hoverClosestGeo"],Z=["resetGeo"]):A?(X=["hoverClosest3d"],Z=["resetCameraDefault3d","resetCameraLastSave3d"]):D?(W=["zoomInMap","zoomOutMap"],X=["toggleHover"],Z=["resetViewMap"]):E?X=["hoverClosestPie"]:z?(X=["hoverClosestCartesian","hoverCompareCartesian"],Z=["resetViewSankey"]):X=["toggleHover"],k&&X.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(d(_)||L)&&(X=[]),k&&!I&&(W=["zoomIn2d","zoomOut2d","autoScale2d"],Z[0]!=="resetViews"&&(Z=["resetScale2d"])),A?J=["zoom3d","pan3d","orbitRotation","tableRotation"]:k&&!I||F?J=["zoom2d","pan2d"]:D||b?J=["pan2d"]:R&&(J=["zoom2d"]),h(_)&&J.push("select2d","lasso2d");var N=[],H=function(q){N.indexOf(q)===-1&&X.indexOf(q)!==-1&&N.push(q)};if(Array.isArray(C)){for(var $=[],U=0;US?_.slice(S):v.slice(x))+M}function p(m,y){for(var _=y._size,v=_.h/_.w,x={},S=Object.keys(m),M=0;Ml*F&&!z)){for(S=0;SN&&KZ&&(Z=K);var ne=(Z-X)/(2*J);b/=ne,X=w.l2r(X),Z=w.l2r(Z),w.range=w._input.range=O=I[1]||G[1]<=I[0])&&W[0]L[0])return!0}return!1}function M(I){var L=I._fullLayout,B=L._size,O=B.p,G=f.list(I,"",!0),W,X,Z,J,N,H;if(L._paperdiv.style({width:I._context.responsive&&L.autosize&&!I._context._hasZeroWidth&&!I.layout.width?"100%":L.width+"px",height:I._context.responsive&&L.autosize&&!I._context._hasZeroHeight&&!I.layout.height?"100%":L.height+"px"}).selectAll(".main-svg").call(n.setSize,L.width,L.height),I._context.setBackground(I,L.paper_bgcolor),e.drawMainTitle(I),c.manage(I),!L._has("cartesian"))return i.previousPromises(I);function $(me,_e,Ae){var ke=me._lw/2;if(me._id.charAt(0)==="x"){if(_e){if(Ae==="top")return _e._offset-O-ke}else return B.t+B.h*(1-(me.position||0))+ke%1;return _e._offset+_e._length+O+ke}if(_e){if(Ae==="right")return _e._offset+_e._length+O+ke}else return B.l+B.w*(me.position||0)+ke%1;return _e._offset-O-ke}for(W=0;W0){T(I,W,N,J),Z.attr({x:X,y:W,"text-anchor":O,dy:R(L.yanchor)}).call(o.positionText,X,W);var H=(L.text.match(o.BR_TAG_ALL)||[]).length;if(H){var $=h.LINE_SPACING*H+h.MID_SHIFT;L.y===0&&($=-$),Z.selectAll(".line").each(function(){var Y=+this.getAttribute("dy").slice(0,-2)-$+"em";this.setAttribute("dy",Y)})}var U=r.select(I).selectAll(".gtitle-subtitle");if(U.node()){var V=Z.node().getBBox(),j=V.y+V.height,q=j+u.SUBTITLE_PADDING_EM*L.subtitle.font.size;U.attr({x:X,y:q,"text-anchor":O,dy:R(L.yanchor)}).call(o.positionText,X,q)}}}};function A(I,L,B,O,G){var W=L.yref==="paper"?I._fullLayout._size.h:I._fullLayout.height,X=a.isTopAnchor(L)?O:O-G,Z=B==="b"?W-X:X;return a.isTopAnchor(L)&&B==="t"||a.isBottomAnchor(L)&&B==="b"?!1:Z.5?"t":"b",X=I._fullLayout.margin[W],Z=0;return L.yref==="paper"?Z=B+L.pad.t+L.pad.b:L.yref==="container"&&(Z=b(W,O,G,I._fullLayout.height,B)+L.pad.t+L.pad.b),Z>X?Z:0}function T(I,L,B,O){var G="title.automargin",W=I._fullLayout.title,X=W.y>.5?"t":"b",Z={x:W.x,y:W.y,t:0,b:0},J={};W.yref==="paper"&&A(I,W,X,L,O)?Z[X]=B:W.yref==="container"&&(J[X]=B,I._fullLayout._reservedMargin[G]=J),i.allowAutoMargin(I,G),i.autoMargin(I,G,Z)}function F(I,L){var B=I.title,O=I._size,G=0;return L===y?G=B.pad.l:L===v&&(G=-B.pad.r),B.xref==="paper"?O.l+O.w*B.x+G:I.width*B.x+G}function D(I,L){var B=I.title,O=I._size,G=0;return L==="0em"||!L?G=-B.pad.b:L===h.CAP_SHIFT+"em"&&(G=B.pad.t),B.y==="auto"?O.t/2:B.yref==="paper"?O.t+O.h-O.h*B.y+G:I.height-I.height*B.y+G}function R(I){return I==="top"?h.CAP_SHIFT+.3+"em":I==="bottom"?"-0.3em":h.MID_SHIFT+"em"}function P(I){var L=I.title,B=_;return a.isRightAnchor(L)?B=v:a.isLeftAnchor(L)&&(B=y),B}function z(I){var L=I.title,B="0em";return a.isTopAnchor(L)?B=h.CAP_SHIFT+"em":a.isMiddleAnchor(L)&&(B=h.MID_SHIFT+"em"),B}e.doTraceStyle=function(I){var L=I.calcdata,B=[],O;for(O=0;O=0;P--){var z=C.append("path").attr(k).style("opacity",P?.1:A).call(o.stroke,E).call(o.fill,b).call(s.dashLine,P?"solid":F,P?4+T:T);if(d(z,y,x),D){var I=l(y.layout,"selections",x);z.style({cursor:"move"});var L={element:z.node(),plotinfo:S,gd:y,editHelpers:I,isActiveSelection:!0},B=t(w,y);i(B,z,L)}else z.style("pointer-events",P?"all":"none");R[P]=z}var O=R[0],G=R[1];G.node().addEventListener("click",function(){return p(y,O)})}}function d(y,_,v){var x=v.xref+v.yref;s.setClipUrl(y,"clip"+_._fullLayout._uid+x,_)}function p(y,_){if(f(y)){var v=_.node(),x=+v.getAttribute("data-index");if(x>=0){if(x===y._fullLayout._activeSelectionIndex){m(y);return}y._fullLayout._activeSelectionIndex=x,y._fullLayout._deactivateSelection=m,c(y)}}}function g(y){if(f(y)){var _=y._fullLayout.selections.length-1;y._fullLayout._activeSelectionIndex=_,y._fullLayout._deactivateSelection=m,c(y)}}function m(y){if(f(y)){var _=y._fullLayout._activeSelectionIndex;_>=0&&(a(y),delete y._fullLayout._activeSelectionIndex,c(y))}}}}),Fq=de({"node_modules/polybooljs/lib/build-log.js"(e,r){function t(){var i,a=0,o=!1;function s(l,n){return i.list.push({type:l,data:n?JSON.parse(JSON.stringify(n)):void 0}),i}return i={list:[],segmentId:function(){return a++},checkIntersection:function(l,n){return s("check",{seg1:l,seg2:n})},segmentChop:function(l,n){return s("div_seg",{seg:l,pt:n}),s("chop",{seg:l,pt:n})},statusRemove:function(l){return s("pop_seg",{seg:l})},segmentUpdate:function(l){return s("seg_update",{seg:l})},segmentNew:function(l,n){return s("new_seg",{seg:l,primary:n})},segmentRemove:function(l){return s("rem_seg",{seg:l})},tempStatus:function(l,n,u){return s("temp_status",{seg:l,above:n,below:u})},rewind:function(l){return s("rewind",{seg:l})},status:function(l,n,u){return s("status",{seg:l,above:n,below:u})},vert:function(l){return l===o?i:(o=l,s("vert",{x:l}))},log:function(l){return typeof l!="string"&&(l=JSON.stringify(l,!1," ")),s("log",{txt:l})},reset:function(){return s("reset")},selected:function(l){return s("selected",{segs:l})},chainStart:function(l){return s("chain_start",{seg:l})},chainRemoveHead:function(l,n){return s("chain_rem_head",{index:l,pt:n})},chainRemoveTail:function(l,n){return s("chain_rem_tail",{index:l,pt:n})},chainNew:function(l,n){return s("chain_new",{pt1:l,pt2:n})},chainMatch:function(l){return s("chain_match",{index:l})},chainClose:function(l){return s("chain_close",{index:l})},chainAddHead:function(l,n){return s("chain_add_head",{index:l,pt:n})},chainAddTail:function(l,n){return s("chain_add_tail",{index:l,pt:n})},chainConnect:function(l,n){return s("chain_con",{index1:l,index2:n})},chainReverse:function(l){return s("chain_rev",{index:l})},chainJoin:function(l,n){return s("chain_join",{index1:l,index2:n})},done:function(){return s("done")}},i}r.exports=t}}),Pq=de({"node_modules/polybooljs/lib/epsilon.js"(e,r){function t(i){typeof i!="number"&&(i=1e-10);var a={epsilon:function(o){return typeof o=="number"&&(i=o),i},pointAboveOrOnLine:function(o,s,l){var n=s[0],u=s[1],c=l[0],f=l[1],h=o[0],d=o[1];return(c-n)*(d-u)-(f-u)*(h-n)>=-i},pointBetween:function(o,s,l){var n=o[1]-s[1],u=l[0]-s[0],c=o[0]-s[0],f=l[1]-s[1],h=c*u+n*f;if(h-i)},pointsSameX:function(o,s){return Math.abs(o[0]-s[0])i!=c-n>i&&(u-d)*(n-p)/(c-p)+d-l>i&&(f=!f),u=d,c=p}return f}};return a}r.exports=t}}),Iq=de({"node_modules/polybooljs/lib/linked-list.js"(e,r){var t={create:function(){var i={root:{root:!0,next:null},exists:function(a){return!(a===null||a===i.root)},isEmpty:function(){return i.root.next===null},getHead:function(){return i.root.next},insertBefore:function(a,o){for(var s=i.root,l=i.root.next;l!==null;){if(o(l)){a.prev=l.prev,a.next=l,l.prev.next=a,l.prev=a;return}s=l,l=l.next}s.next=a,a.prev=s,a.next=null},findTransition:function(a){for(var o=i.root,s=i.root.next;s!==null&&!a(s);)o=s,s=s.next;return{before:o===i.root?null:o,after:s,insert:function(l){return l.prev=o,l.next=s,o.next=l,s!==null&&(s.prev=l),l}}}};return i},node:function(i){return i.prev=null,i.next=null,i.remove=function(){i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.prev=null,i.next=null},i}};r.exports=t}}),Rq=de({"node_modules/polybooljs/lib/intersecter.js"(e,r){var t=Iq();function i(a,o,s){function l(_,v){return{id:s?s.segmentId():-1,start:_,end:v,myFill:{above:null,below:null},otherFill:null}}function n(_,v,x){return{id:s?s.segmentId():-1,start:_,end:v,myFill:{above:x.myFill.above,below:x.myFill.below},otherFill:null}}var u=t.create();function c(_,v,x,S,M,C){var w=o.pointsCompare(v,M);return w!==0?w:o.pointsSame(x,C)?0:_!==S?_?1:-1:o.pointAboveOrOnLine(x,S?M:C,S?C:M)?1:-1}function f(_,v){u.insertBefore(_,function(x){var S=c(_.isStart,_.pt,v,x.isStart,x.pt,x.other.pt);return S<0})}function h(_,v){var x=t.node({isStart:!0,pt:_.start,seg:_,primary:v,other:null,status:null});return f(x,_.end),x}function d(_,v,x){var S=t.node({isStart:!1,pt:v.end,seg:v,primary:x,other:_,status:null});_.other=S,f(S,_.pt)}function p(_,v){var x=h(_,v);return d(x,_,v),x}function g(_,v){s&&s.segmentChop(_.seg,v),_.other.remove(),_.seg.end=v,_.other.pt=v,f(_.other,_.pt)}function m(_,v){var x=n(v,_.seg.end,_.seg);return g(_,v),p(x,_.primary)}function y(_,v){var x=t.create();function S(I,L){var B=I.seg.start,O=I.seg.end,G=L.seg.start,W=L.seg.end;return o.pointsCollinear(B,G,W)?o.pointsCollinear(O,G,W)||o.pointAboveOrOnLine(O,G,W)?1:-1:o.pointAboveOrOnLine(B,G,W)?1:-1}function M(I){return x.findTransition(function(L){var B=S(I,L.ev);return B>0})}function C(I,L){var B=I.seg,O=L.seg,G=B.start,W=B.end,X=O.start,Z=O.end;s&&s.checkIntersection(B,O);var J=o.linesIntersect(G,W,X,Z);if(J===!1){if(!o.pointsCollinear(G,W,X)||o.pointsSame(G,Z)||o.pointsSame(W,X))return!1;var N=o.pointsSame(G,X),H=o.pointsSame(W,Z);if(N&&H)return L;var $=!N&&o.pointBetween(G,X,Z),U=!H&&o.pointBetween(W,X,Z);if(N)return U?m(L,W):m(I,Z),L;$&&(H||(U?m(L,W):m(I,Z)),m(L,G))}else J.alongA===0&&(J.alongB===-1?m(I,X):J.alongB===0?m(I,J.pt):J.alongB===1&&m(I,Z)),J.alongB===0&&(J.alongA===-1?m(L,G):J.alongA===0?m(L,J.pt):J.alongA===1&&m(L,W));return!1}for(var w=[];!u.isEmpty();){var k=u.getHead();if(s&&s.vert(k.pt[0]),k.isStart){let I=function(){if(E){var L=C(k,E);if(L)return L}return T?C(k,T):!1};var A=I;s&&s.segmentNew(k.seg,k.primary);var b=M(k),E=b.before?b.before.ev:null,T=b.after?b.after.ev:null;s&&s.tempStatus(k.seg,E?E.seg:!1,T?T.seg:!1);var F=I();if(F){if(a){var D;k.seg.myFill.below===null?D=!0:D=k.seg.myFill.above!==k.seg.myFill.below,D&&(F.seg.myFill.above=!F.seg.myFill.above)}else F.seg.otherFill=k.seg.myFill;s&&s.segmentUpdate(F.seg),k.other.remove(),k.remove()}if(u.getHead()!==k){s&&s.rewind(k.seg);continue}if(a){var D;k.seg.myFill.below===null?D=!0:D=k.seg.myFill.above!==k.seg.myFill.below,T?k.seg.myFill.below=T.seg.myFill.above:k.seg.myFill.below=_,D?k.seg.myFill.above=!k.seg.myFill.below:k.seg.myFill.above=k.seg.myFill.below}else if(k.seg.otherFill===null){var R;T?k.primary===T.primary?R=T.seg.otherFill.above:R=T.seg.myFill.above:R=k.primary?v:_,k.seg.otherFill={above:R,below:R}}s&&s.status(k.seg,E?E.seg:!1,T?T.seg:!1),k.other.status=b.insert(t.node({ev:k}))}else{var P=k.status;if(P===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(x.exists(P.prev)&&x.exists(P.next)&&C(P.prev.ev,P.next.ev),s&&s.statusRemove(P.ev.seg),P.remove(),!k.primary){var z=k.seg.myFill;k.seg.myFill=k.seg.otherFill,k.seg.otherFill=z}w.push(k.seg)}u.getHead().remove()}return s&&s.done(),w}return a?{addRegion:function(_){for(var v,x=_[_.length-1],S=0;S<_.length;S++){v=x,x=_[S];var M=o.pointsCompare(v,x);M!==0&&p(l(M<0?v:x,M<0?x:v),!0)}},calculate:function(_){return y(_,!1)}}:{calculate:function(_,v,x,S){return _.forEach(function(M){p(n(M.start,M.end,M),!0)}),x.forEach(function(M){p(n(M.start,M.end,M),!1)}),y(v,S)}}}r.exports=i}}),zq=de({"node_modules/polybooljs/lib/segment-chainer.js"(e,r){function t(i,a,o){var s=[],l=[];return i.forEach(function(n){var u=n.start,c=n.end;if(a.pointsSame(u,c)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}o&&o.chainStart(n);var f={index:0,matches_head:!1,matches_pt1:!1},h={index:0,matches_head:!1,matches_pt1:!1},d=f;function p(P,z,I){return d.index=P,d.matches_head=z,d.matches_pt1=I,d===f?(d=h,!1):(d=null,!0)}for(var g=0;gn!=m>n&&l<(g-d)*(n-p)/(m-p)+d;y&&(u=!u)}return u}}}),Fy=de({"src/lib/polygon.js"(e,r){"use strict";var t=yw().dot,i=cn().BADNUM,a=r.exports={};a.tester=function(s){var l=s.slice(),n=l[0][0],u=n,c=l[0][1],f=c,h;for((l[l.length-1][0]!==l[0][0]||l[l.length-1][1]!==l[0][1])&&l.push(l[0]),h=1;hu||M===i||Mf||x&&p(v))}function m(v,x){var S=v[0],M=v[1];if(S===i||Su||M===i||Mf)return!1;var C=l.length,w=l[0][0],k=l[0][1],A=0,b,E,T,F,D;for(b=1;bMath.max(E,w)||M>Math.max(T,k)))if(Mh||Math.abs(t(m,p))>u)return!0;return!1},a.filter=function(s,l){var n=[s[0]],u=0,c=0;function f(d){s.push(d);var p=n.length,g=u;n.splice(c+1);for(var m=g+1;m1){var h=s.pop();f(h)}return{addPt:f,raw:s,filtered:n}}}}),Uq=de({"src/components/selections/constants.js"(e,r){"use strict";r.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),qq=de({"src/components/selections/select.js"(e,r){"use strict";var t=Nq(),i=jq(),a=Ma(),o=hn().dashStyle,s=ta(),l=$s(),n=sf().makeEventData,u=Xd(),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=m0(),m=Dy(),y=Dw(),_=f0().clearOutline,v=v0(),x=v.handleEllipse,S=v.readPaths,M=Cw().newShapes,C=UE(),w=ZE().activateLastSelection,k=Qt(),A=k.sorterAsc,b=Fy(),E=ww(),T=Hs().getFromId,F=Cy(),D=Ly().redrawReglTraces,R=Uq(),P=R.MINSELECT,z=b.filter,I=b.tester,L=kw(),B=L.p2r,O=L.axValue,G=L.getTransform;function W(qe){return qe.subplot!==void 0}function X(qe,Ye,me,_e,Ae){var ke=!W(_e),Ee=c(Ae),De=f(Ae),Je=d(Ae),Ue=h(Ae),at=p(Ae),rt=Ae==="drawline",ft=Ae==="drawcircle",At=rt||ft,ht=_e.gd,Gt=ht._fullLayout,fr=at&&Gt.newselection.mode==="immediate"&&ke,gt=Gt._zoomlayer,yt=_e.element.getBoundingClientRect(),kt=_e.plotinfo,Lt=G(kt),Ct=Ye-yt.left,$t=me-yt.top;Gt._calcInverseTransform(ht);var mr=k.apply3DTransform(Gt._invTransform)(Ct,$t);Ct=mr[0],$t=mr[1];var br=Gt._invScaleX,Er=Gt._invScaleY,Tr=Ct,Ur=$t,Ai="M"+Ct+","+$t,oi=_e.xaxes[0],Qr=_e.yaxes[0],ea=oi._length,$i=Qr._length,ja=qe.altKey&&!(h(Ae)&&Je),ya,pa,xi,bi,Ua,dn,pi;U(qe,ht,_e),Ee&&(ya=z([[Ct,$t]],R.BENDPX));var Jr=gt.selectAll("path.select-outline-"+kt.id).data([1]),Be=Ue?Gt.newshape:Gt.newselection;Ue&&(_e.hasText=Be.label.text||Be.label.texttemplate);var Fe=Ue&&!Je?Be.fillcolor:"rgba(0,0,0,0)",Et=Be.line.color||(ke?s.contrast(ht._fullLayout.plot_bgcolor):"#7f7f7f");Jr.enter().append("path").attr("class","select-outline select-outline-"+kt.id).style({opacity:Ue?Be.opacity/2:1,"stroke-dasharray":o(Be.line.dash,Be.line.width),"stroke-width":Be.line.width+"px","shape-rendering":"crispEdges"}).call(s.stroke,Et).call(s.fill,Fe).attr("fill-rule","evenodd").classed("cursor-move",!!Ue).attr("transform",Lt).attr("d",Ai+"Z");var St=gt.append("path").attr("class","zoombox-corners").style({fill:s.background,stroke:s.defaultLine,"stroke-width":1}).attr("transform",Lt).attr("d","M0,0Z");if(Ue&&_e.hasText){var zt=gt.select(".label-temp");zt.empty()&&(zt=gt.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Wt=Gt._uid+R.SELECTID,Yt=[],ze=K(ht,_e.xaxes,_e.yaxes,_e.subplot);fr&&!qe.shiftKey&&(_e._clearSubplotSelections=function(){if(ke){var ct=oi._id,wt=Qr._id;Me(ht,ct,wt,ze);for(var Nt=(ht.layout||{}).selections||[],It=[],Zt=!1,qt=0;qt=0){ht._fullLayout._deactivateShape(ht);return}if(!Ue){var Nt=Gt.clickmode;E.done(Wt).then(function(){if(E.clear(Wt),ct===2){for(Jr.remove(),Ua=0;Ua-1&&Z(wt,ht,_e.xaxes,_e.yaxes,_e.subplot,_e,Jr),Nt==="event"&&Mt(ht,void 0);l.click(ht,wt,kt.id)}).catch(k.error)}},_e.doneFn=function(){St.remove(),E.done(Wt).then(function(){E.clear(Wt),!fr&&bi&&_e.selectionDefs&&(bi.subtract=ja,_e.selectionDefs.push(bi),_e.mergedPolygons.length=0,[].push.apply(_e.mergedPolygons,xi)),(fr||Ue)&&q(_e,fr),_e.doneFnCompleted&&_e.doneFnCompleted(Yt),at&&Mt(ht,pi)}).catch(k.error)}}function Z(qe,Ye,me,_e,Ae,ke,Ee){var De=Ye._hoverdata,Je=Ye._fullLayout,Ue=Je.clickmode,at=Ue.indexOf("event")>-1,rt=[],ft,At,ht,Gt,fr,gt,yt,kt,Lt,Ct;if(ne(De)){U(qe,Ye,ke),ft=K(Ye,me,_e,Ae);var $t=se(De,ft),mr=$t.pointNumbers.length>0;if(mr?ce(ft,$t):pe(ft)&&(yt=le($t))){for(Ee&&Ee.remove(),Ct=0;Ct=0}function j(qe){return qe._fullLayout._activeSelectionIndex>=0}function q(qe,Ye){var me=qe.dragmode,_e=qe.plotinfo,Ae=qe.gd;V(Ae)&&Ae._fullLayout._deactivateShape(Ae),j(Ae)&&Ae._fullLayout._deactivateSelection(Ae);var ke=Ae._fullLayout,Ee=ke._zoomlayer,De=h(me),Je=p(me);if(De||Je){var Ue=Ee.selectAll(".select-outline-"+_e.id);if(Ue&&Ae._fullLayout._outlining){var at;De&&(at=M(Ue,qe)),at&&a.call("_guiRelayout",Ae,{shapes:at});var rt;Je&&!W(qe)&&(rt=C(Ue,qe)),rt&&(Ae._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",Ae,{selections:rt}).then(function(){Ye&&w(Ae)})),Ae._fullLayout._outlining=!1}}_e.selection={},_e.selection.selectionDefs=qe.selectionDefs=[],_e.selection.mergedPolygons=qe.mergedPolygons=[]}function Y(qe){return qe._id}function K(qe,Ye,me,_e){if(!qe.calcdata)return[];var Ae=[],ke=Ye.map(Y),Ee=me.map(Y),De,Je,Ue;for(Ue=0;Ue0,ke=Ae?_e[0]:me;return Ye.selectedpoints?Ye.selectedpoints.indexOf(ke)>-1:!1}function ce(qe,Ye){var me=[],_e,Ae,ke,Ee;for(Ee=0;Ee0&&me.push(_e);if(me.length===1&&(ke=me[0]===Ye.searchInfo,ke&&(Ae=Ye.searchInfo.cd[0].trace,Ae.selectedpoints.length===Ye.pointNumbers.length))){for(Ee=0;Ee1||(Ye+=_e.selectedpoints.length,Ye>1)))return!1;return Ye===1}function xe(qe,Ye,me){var _e,Ae;for(_e=0;_e-1&&Ye;if(!Ee&&Ye){var ct=je(qe,!0);if(ct.length){var wt=ct[0].xref,Nt=ct[0].yref;if(wt&&Nt){var It=Ke(ct),Zt=xt([T(qe,wt,"x"),T(qe,Nt,"y")]);Zt(Yt,It)}}qe._fullLayout._noEmitSelectedAtStart?qe._fullLayout._noEmitSelectedAtStart=!1:tt&&Mt(qe,Yt),ft._reselect=!1}if(!Ee&&ft._deselect){var qt=ft._deselect;De=qt.xref,Je=qt.yref,ge(De,Je,at)||Me(qe,De,Je,_e),tt&&(Yt.points.length?Mt(qe,Yt):lt(qe)),ft._deselect=!1}return{eventData:Yt,selectionTesters:me}}function ue(qe){var Ye=qe.calcdata;if(Ye)for(var me=0;me=0){Be._fullLayout._deactivateShape(Be);return}var Fe=Be._fullLayout.clickmode;if(N(Be),pi===2&&!ae&&ya(),fe)Fe.indexOf("select")>-1&&k(Jr,Be,ge,Me,te.id,Ue),Fe.indexOf("event")>-1&&f.click(Be,Jr,te.id);else if(pi===1&&ae){var Et=pe?ie:ee,St=pe==="s"||xe==="w"?0:1,zt=Et._name+".range["+St+"]",Wt=I(Et,St),Yt="left",ze="middle";if(Et.fixedrange)return;pe?(ze=pe==="n"?"top":"bottom",Et.side==="right"&&(Yt="right")):xe==="e"&&(Yt="right"),Be._context.showAxisRangeEntryBoxes&&t.select(Je).call(n.makeEditable,{gd:Be,immediate:!0,background:Be._fullLayout.paper_bgcolor,text:String(Wt),fill:Et.tickfont?Et.tickfont.color:"#444",horizontalAlign:Yt,verticalAlign:ze}).on("edit",function(tt){var ct=Et.d2r(tt);ct!==void 0&&s.call("_guiRelayout",Be,zt,ct)})}}p.init(Ue);var ft,At,ht,Gt,fr,gt,yt,kt,Lt,Ct;function $t(pi,Jr,Be){var Fe=Je.getBoundingClientRect();ft=Jr-Fe.left,At=Be-Fe.top,K._fullLayout._calcInverseTransform(K);var Et=i.apply3DTransform(K._fullLayout._invTransform)(ft,At);ft=Et[0],At=Et[1],ht={l:ft,r:ft,w:0,t:At,b:At,h:0},Gt=K._hmpixcount?K._hmlumcount/K._hmpixcount:u.luminosity(K._fullLayout.plot_bgcolor),fr="M0,0H"+Ve+"V"+Ze+"H0V0",gt=!1,yt="xy",Ct=!1,kt=W(ye,Gt,Te,je,fr),Lt=X(ye,Te,je)}function mr(pi,Jr){if(K._transitioningWithDuration)return!1;var Be=Math.max(0,Math.min(Ve,Ae*pi+ft)),Fe=Math.max(0,Math.min(Ze,ke*Jr+At)),Et=Math.abs(Be-ft),St=Math.abs(Fe-At);ht.l=Math.min(ft,Be),ht.r=Math.max(ft,Be),ht.t=Math.min(At,Fe),ht.b=Math.max(At,Fe);function zt(){yt="",ht.r=ht.l,ht.t=ht.b,Lt.attr("d","M0,0Z")}if(Ke.isSubplotConstrained)Et>T||St>T?(yt="xy",Et/Ve>St/Ze?(St=Et*Ze/Ve,At>Fe?ht.t=At-St:ht.b=At+St):(Et=St*Ve/Ze,ft>Be?ht.l=ft-Et:ht.r=ft+Et),Lt.attr("d",V(ht))):zt();else if(vt.isSubplotConstrained)if(Et>T||St>T){yt="xy";var Wt=Math.min(ht.l/Ve,(Ze-ht.b)/Ze),Yt=Math.max(ht.r/Ve,(Ze-ht.t)/Ze);ht.l=Wt*Ve,ht.r=Yt*Ve,ht.b=(1-Wt)*Ze,ht.t=(1-Yt)*Ze,Lt.attr("d",V(ht))}else zt();else!Pt||St0){var tt;if(vt.isSubplotConstrained||!xt&&Pt.length===1){for(tt=0;tt1&&(zt.maxallowed!==void 0&&Mt===(zt.range[0]1&&(Wt.maxallowed!==void 0&<===(Wt.range[0]=0?Math.min(K,.9):1/(1/Math.max(K,-.3)+3.222))}function G(K,te,ne){return K?K==="nsew"?ne?"":te==="pan"?"move":"crosshair":K.toLowerCase()+"-resize":"pointer"}function W(K,te,ne,se,le){return K.append("path").attr("class","zoombox").style({fill:te>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(ne,se)).attr("d",le+"Z")}function X(K,te,ne){return K.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(te,ne)).attr("d","M0,0Z")}function Z(K,te,ne,se,le,ce){K.attr("d",se+"M"+ne.l+","+ne.t+"v"+ne.h+"h"+ne.w+"v-"+ne.h+"h-"+ne.w+"Z"),J(K,te,le,ce)}function J(K,te,ne,se){ne||(K.transition().style("fill",se>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),te.transition().style("opacity",1).duration(200))}function N(K){t.select(K).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(K){F&&K.data&&K._context.showTips&&(i.notifier(i._(K,"Double-click to zoom back out"),"long",K),F=!1)}function $(K,te){return"M"+(K.l-.5)+","+(te-T-.5)+"h-3v"+(2*T+1)+"h3ZM"+(K.r+.5)+","+(te-T-.5)+"h3v"+(2*T+1)+"h-3Z"}function U(K,te){return"M"+(te-T-.5)+","+(K.t-.5)+"v-3h"+(2*T+1)+"v3ZM"+(te-T-.5)+","+(K.b+.5)+"v3h"+(2*T+1)+"v-3Z"}function V(K){var te=Math.floor(Math.min(K.b-K.t,K.r-K.l,T)/2);return"M"+(K.l-3.5)+","+(K.t-.5+te)+"h3v"+-te+"h"+te+"v-3h-"+(te+3)+"ZM"+(K.r+3.5)+","+(K.t-.5+te)+"h-3v"+-te+"h"+-te+"v-3h"+(te+3)+"ZM"+(K.r+3.5)+","+(K.b+.5-te)+"h-3v"+te+"h"+-te+"v3h"+(te+3)+"ZM"+(K.l-3.5)+","+(K.b+.5-te)+"h3v"+te+"h"+te+"v3h-"+(te+3)+"Z"}function j(K,te,ne,se,le){for(var ce=!1,pe={},xe={},ye,fe,ae,ee,ie=(le||{}).xaHash,Q=(le||{}).yaHash,ue=0;ue1&&i.warn("Full array edits are incompatible with other edits",p);var S=f[""][""];if(l(S))c.set(null);else if(Array.isArray(S))c.set(S);else return i.warn("Unrecognized full array edit value",p,S),!0;return _?!1:(g(v,x),m(u),!0)}var M=Object.keys(f).map(Number).sort(a),C=c.get(),w=C||[],k=d(x,p).get(),A=[],b=-1,E=w.length,T,F,D,R,P,z,I,L;for(T=0;Tw.length-(I?0:1)){i.warn("index out of range",p,D);continue}if(z!==void 0)P.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",p,D),l(z)?A.push(D):I?(z==="add"&&(z={}),w.splice(D,0,z),k&&k.splice(D,0,{})):i.warn("Unrecognized full object edit value",p,D,z),b===-1&&(b=D);else for(F=0;F=0;T--)w.splice(A[T],1),k&&k.splice(A[T],1);if(w.length?C||c.set(w):c.set(null),_)return!1;if(g(v,x),y!==t){var B;if(b===-1)B=M;else{for(E=Math.max(w.length,E),B=[],T=0;T=b));T++)B.push(D);for(T=b;T0&&i.log("Clearing previous rejected promises from queue."),_._promises=[]},e.cleanLayout=function(_){var v,x;_||(_={}),_.xaxis1&&(_.xaxis||(_.xaxis=_.xaxis1),delete _.xaxis1),_.yaxis1&&(_.yaxis||(_.yaxis=_.yaxis1),delete _.yaxis1),_.scene1&&(_.scene||(_.scene=_.scene1),delete _.scene1);var S=(a.subplotsRegistry.cartesian||{}).attrRegex,M=(a.subplotsRegistry.polar||{}).attrRegex,C=(a.subplotsRegistry.ternary||{}).attrRegex,w=(a.subplotsRegistry.gl3d||{}).attrRegex,k=Object.keys(_);for(v=0;v3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),_.dragmode==="rotate"&&(_.dragmode="orbit"),_.template&&_.template.layout&&e.cleanLayout(_.template.layout),_};function c(_,v,x=!1){var S=_[v],M=v.charAt(0);x&&Array.isArray(S)||S&&S!=="paper"&&(_[v]=s(S,M,!0))}e.cleanData=function(_){for(var v=0;v<_.length;v++){var x=_[v],S;if(x.type==="histogramy"&&"xbins"in x&&!("ybins"in x)&&(x.ybins=x.xbins,delete x.xbins),x.type==="histogramy"&&e.swapXYData(x),(x.type==="histogramx"||x.type==="histogramy")&&(x.type="histogram"),"scl"in x&&!("colorscale"in x)&&(x.colorscale=x.scl,delete x.scl),"reversescl"in x&&!("reversescale"in x)&&(x.reversescale=x.reversescl,delete x.reversescl),x.xaxis&&(x.xaxis=s(x.xaxis,"x")),x.yaxis&&(x.yaxis=s(x.yaxis,"y")),n(x,"gl3d")&&x.scene&&(x.scene=a.subplotsRegistry.gl3d.cleanId(x.scene)),!n(x,"pie-like")&&!n(x,"bar-like"))if(Array.isArray(x.textposition))for(S=0;S0)return _.slice(0,v)}e.hasParent=function(_,v){for(var x=m(v);x;){if(x in _)return!0;x=m(x)}return!1},e.clearAxisTypes=function(_,v,x){for(var S=0;S{let x=(...S)=>S.every(M=>i.isPlainObject(M))||S.every(M=>Array.isArray(M));if([_,v].every(S=>Array.isArray(S))){if(_.length!==v.length)return!1;for(let S=0;S<_.length;S++){let M=_[S],C=v[S];if(M!==C&&!(x(M,C)?y(M,C):!1))return!1}return!0}else if([_,v].every(S=>i.isPlainObject(S))){if(Object.keys(_).length!==Object.keys(v).length)return!1;for(let S in _){if(S.startsWith("_"))continue;let M=_[S],C=v[S];if(M!==C&&!(x(M,C)?y(M,C):!1))return!1}return!0}return!1};e.collectionsAreEqual=y}}),Iw=de({"src/plot_api/plot_api.js"(e){"use strict";var r=Yr(),t=da(),i=TE(),a=Qt(),o=a.nestedProperty,s=u1(),l=cq(),n=Ma(),u=c1(),c=Es(),f=nn(),h=FE(),d=Mu(),p=hn(),g=ta(),m=ek().initInteractions,y=Oh(),_=Zl().clearOutline,v=Na().dfltConfig,x=$q(),S=Wq(),M=Ly(),C=Ps(),w=zl().AX_NAME_PATTERN,k=0,A=5;function b(me,_e,Ae,ke){var Ee;if(me=a.getGraphDiv(me),s.init(me),a.isPlainObject(_e)){var De=_e;_e=De.data,Ae=De.layout,ke=De.config,Ee=De.frames}var Je=s.triggerHandler(me,"plotly_beforeplot",[_e,Ae,ke]);if(Je===!1)return Promise.reject();!_e&&!Ae&&!a.isPlotDiv(me)&&a.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",me);function Ue(){if(Ee)return e.addFrames(me,Ee)}R(me,ke),Ae||(Ae={}),r.select(me).classed("js-plotly-plot",!0),p.makeTester(),Array.isArray(me._promises)||(me._promises=[]);var at=(me.data||[]).length===0&&Array.isArray(_e);Array.isArray(_e)&&(S.cleanData(_e),at?me.data=_e:me.data.push.apply(me.data,_e),me.empty=!1),(!me.layout||at)&&(me.layout=S.cleanLayout(Ae)),c.supplyDefaults(me);var rt=me._fullLayout,ft=rt._has("cartesian");rt._replotting=!0,(at||rt._shouldCreateBgLayer)&&(Ye(me),rt._shouldCreateBgLayer&&delete rt._shouldCreateBgLayer),p.initGradients(me),p.initPatterns(me),at&&f.saveShowSpikeInitial(me);var At=!me.calcdata||me.calcdata.length!==(me._fullData||[]).length;At&&c.doCalcdata(me);for(var ht=0;ht=me.data.length||Ee<-me.data.length)throw new Error(Ae+" must be valid indices for gd.data.");if(_e.indexOf(Ee,ke+1)>-1||Ee>=0&&_e.indexOf(-me.data.length+Ee)>-1||Ee<0&&_e.indexOf(me.data.length+Ee)>-1)throw new Error("each index in "+Ae+" must be unique.")}}function B(me,_e,Ae){if(!Array.isArray(me.data))throw new Error("gd.data must be an array.");if(typeof _e>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(_e)||(_e=[_e]),L(me,_e,"currentIndices"),typeof Ae<"u"&&!Array.isArray(Ae)&&(Ae=[Ae]),typeof Ae<"u"&&L(me,Ae,"newIndices"),typeof Ae<"u"&&_e.length!==Ae.length)throw new Error("current and new indices must be of equal length.")}function O(me,_e,Ae){var ke,Ee;if(!Array.isArray(me.data))throw new Error("gd.data must be an array.");if(typeof _e>"u")throw new Error("traces must be defined.");for(Array.isArray(_e)||(_e=[_e]),ke=0;ke<_e.length;ke++)if(Ee=_e[ke],typeof Ee!="object"||Array.isArray(Ee)||Ee===null)throw new Error("all values in traces array must be non-array objects");if(typeof Ae<"u"&&!Array.isArray(Ae)&&(Ae=[Ae]),typeof Ae<"u"&&Ae.length!==_e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function G(me,_e,Ae,ke){var Ee=a.isPlainObject(ke);if(!Array.isArray(me.data))throw new Error("gd.data must be an array");if(!a.isPlainObject(_e))throw new Error("update must be a key:value object");if(typeof Ae>"u")throw new Error("indices must be an integer or array of integers");L(me,Ae,"indices");for(var De in _e){if(!Array.isArray(_e[De])||_e[De].length!==Ae.length)throw new Error("attribute "+De+" must be an array of length equal to indices array length");if(Ee&&(!(De in ke)||!Array.isArray(ke[De])||ke[De].length!==_e[De].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function W(me,_e,Ae,ke){var Ee=a.isPlainObject(ke),De=[],Je,Ue,at,rt,ft;Array.isArray(Ae)||(Ae=[Ae]),Ae=I(Ae,me.data.length-1);for(var At in _e)for(var ht=0;ht=0&&ft=0&&ft"u")return rt=e.redraw(me),l.add(me,Ee,Je,De,Ue),rt;Array.isArray(Ae)||(Ae=[Ae]);try{B(me,ke,Ae)}catch(ft){throw me.data.splice(me.data.length-_e.length,_e.length),ft}return l.startSequence(me),l.add(me,Ee,Je,De,Ue),rt=e.moveTraces(me,ke,Ae),l.stopSequence(me),rt}function $(me,_e){me=a.getGraphDiv(me);var Ae=[],ke=e.addTraces,Ee=$,De=[me,Ae,_e],Je=[me,_e],Ue,at;if(typeof _e>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(_e)||(_e=[_e]),L(me,_e,"indices"),_e=I(_e,me.data.length-1),_e.sort(a.sorterDes),Ue=0;Ue<_e.length;Ue+=1)at=me.data.splice(_e[Ue],1)[0],Ae.push(at);var rt=e.redraw(me);return l.add(me,ke,De,Ee,Je),rt}function U(me,_e,Ae){me=a.getGraphDiv(me);var ke=[],Ee=[],De=U,Je=U,Ue=[me,Ae,_e],at=[me,_e,Ae],rt;if(B(me,_e,Ae),_e=Array.isArray(_e)?_e:[_e],typeof Ae>"u")for(Ae=[],rt=0;rt<_e.length;rt++)Ae.push(-_e.length+rt);for(Ae=Array.isArray(Ae)?Ae:[Ae],_e=I(_e,me.data.length-1),Ae=I(Ae,me.data.length-1),rt=0;rt0&&typeof Tr.parts[oi]!="string";)oi--;var Qr=Tr.parts[oi],ea=Tr.parts[oi-1]+"."+Qr,$i=Tr.parts.slice(0,oi).join("."),ja=o(me.layout,$i).get(),ya=o(ke,$i).get(),pa=Tr.get();if(Ur!==void 0){kt[Er]=Ur,Lt[Er]=Qr==="reverse"?Ur:j(pa);var xi=u.getLayoutValObject(ke,Tr.parts);if(xi&&xi.impliedEdits&&Ur!==null)for(var bi in xi.impliedEdits)Ct(a.relativeAttr(Er,bi),xi.impliedEdits[bi]);if(["width","height"].indexOf(Er)!==-1)if(Ur){Ct("autosize",null);var Ua=Er==="height"?"width":"height";Ct(Ua,ke[Ua])}else ke[Er]=me._initialAutoSize[Er];else if(Er==="autosize")Ct("width",Ur?null:ke.width),Ct("height",Ur?null:ke.height);else if(ea.match(ce))br(ea),o(ke,$i+"._inputRange").set(null);else if(ea.match(pe)){br(ea),o(ke,$i+"._inputRange").set(null);var dn=o(ke,$i).get();dn._inputDomain&&(dn._input.domain=dn._inputDomain.slice())}else ea.match(xe)&&o(ke,$i+"._inputDomain").set(null);if(Qr==="type"){mr=ja;var pi=ya.type==="linear"&&Ur==="log",Jr=ya.type==="log"&&Ur==="linear";if(pi||Jr){if(!mr||!mr.range)Ct($i+".autorange",!0);else if(ya.autorange)pi&&(mr.range=mr.range[1]>mr.range[0]?[1,2]:[2,1]);else{var Be=mr.range[0],Fe=mr.range[1];pi?(Be<=0&&Fe<=0&&Ct($i+".autorange",!0),Be<=0?Be=Fe/1e6:Fe<=0&&(Fe=Be/1e6),Ct($i+".range[0]",Math.log(Be)/Math.LN10),Ct($i+".range[1]",Math.log(Fe)/Math.LN10)):(Ct($i+".range[0]",Math.pow(10,Be)),Ct($i+".range[1]",Math.pow(10,Fe)))}Array.isArray(ke._subplots.polar)&&ke._subplots.polar.length&&ke[Tr.parts[0]]&&Tr.parts[1]==="radialaxis"&&delete ke[Tr.parts[0]]._subplot.viewInitial["radialaxis.range"],n.getComponentMethod("annotations","convertCoords")(me,ya,Ur,Ct),n.getComponentMethod("images","convertCoords")(me,ya,Ur,Ct)}else Ct($i+".autorange",!0),Ct($i+".range",null);o(ke,$i+"._inputRange").set(null)}else if(Qr.match(w)){var Et=o(ke,Er).get(),St=(Ur||{}).type;(!St||St==="-")&&(St="linear"),n.getComponentMethod("annotations","convertCoords")(me,Et,St,Ct),n.getComponentMethod("images","convertCoords")(me,Et,St,Ct)}var zt=x.containerArrayMatch(Er);if(zt){ft=zt.array,At=zt.index;var Wt=zt.property,Yt=xi||{editType:"calc"};At!==""&&Wt===""&&(x.isAddVal(Ur)?Lt[Er]=null:x.isRemoveVal(Ur)?Lt[Er]=(o(Ae,ft).get()||[])[At]:a.warn("unrecognized full object value",_e)),C.update(yt,Yt),rt[ft]||(rt[ft]={});var ze=rt[ft][At];ze||(ze=rt[ft][At]={}),ze[Wt]=Ur,delete _e[Er]}else Qr==="reverse"?(ja.range?ja.range.reverse():(Ct($i+".autorange",!0),ja.range=[1,0]),ya.autorange?yt.calc=!0:yt.plot=!0):(Er==="dragmode"&&(Ur===!1&&pa!==!1||Ur!==!1&&pa===!1)||ke._has("scatter-like")&&ke._has("regl")&&Er==="dragmode"&&(Ur==="lasso"||Ur==="select")&&!(pa==="lasso"||pa==="select")?yt.plot=!0:xi?C.update(yt,xi):yt.calc=!0,Tr.set(Ur))}}for(ft in rt){var tt=x.applyContainerArrayChanges(me,De(Ae,ft),rt[ft],yt,De);tt||(yt.plot=!0)}for(var ct in $t){mr=f.getFromId(me,ct);var wt=mr&&mr._constraintGroup;if(wt){yt.calc=!0;for(var Nt in wt)$t[Nt]||(f.getFromId(me,Nt)._constraintShrinkable=!0)}}(fe(me)||_e.height||_e.width)&&(yt.plot=!0);var It=ke.shapes;for(At=0;At1;)if(ke.pop(),Ae=o(_e,ke.join(".")+".uirevision").get(),Ae!==void 0)return Ae;return _e.uirevision}function Me(me,_e){for(var Ae=0;Ae<_e.length;Ae++)if(_e[Ae].uid===me)return Ae;return-1}function Te(me,_e,Ae){for(var ke=0;ke<_e.length;ke++)if(_e[ke].uid===me)return ke;return!_e[Ae]||_e[Ae].uid?-1:Ae}function je(me,_e){var Ae=a.isPlainObject(me),ke=Array.isArray(me);return Ae||ke?(Ae&&a.isPlainObject(_e)||ke&&Array.isArray(_e))&&JSON.stringify(me)===JSON.stringify(_e):me===_e}function Ve(me,_e,Ae,ke){var Ee=ke._preGUI,De,Je,Ue,at,rt,ft,At,ht,Gt,fr,gt=[],yt={},kt={};for(De in Ee){if(rt=ue(De,ie),rt){if(Gt=rt.head,fr=rt.tail,Je=rt.attr||Gt+".uirevision",Ue=o(ke,Je).get(),at=Ue&&ge(Je,_e),at&&at===Ue){if(ft=Ee[De],ft===null&&(ft=void 0),At=o(_e,De),ht=At.get(),je(ht,ft)){ht===void 0&&fr==="autorange"&>.push(Gt),At.set(j(o(ke,De).get()));continue}else if(fr==="autorange"||fr.slice(0,6)==="range["){var Lt=Ee[Gt+".range[0]"],Ct=Ee[Gt+".range[1]"],$t=Ee[Gt+".autorange"];if($t||$t===null&&Lt===null&&Ct===null){if(!(Gt in yt)){var mr=o(_e,Gt).get();yt[Gt]=mr&&(mr.autorange||mr.autorange!==!1&&(!mr.range||mr.range.length!==2))}if(yt[Gt]){At.set(j(o(ke,De).get()));continue}}}}}else a.warn("unrecognized GUI edit: "+De);delete Ee[De],rt&&rt.tail.slice(0,6)==="range["&&(kt[rt.head]=1)}for(var br=0;br[$i,me._ev.listeners($i)]);De=e.newPlot(me,_e,Ae,ke).then(()=>{for(let[$i,ja]of ea)ja.forEach(ya=>me.on($i,ya));return e.react(me,_e,Ae,ke)})}else{me.data=_e||[],S.cleanData(me.data),me.layout=Ae||{},S.cleanLayout(me.layout),Ve(me.data,me.layout,Ue,at),c.supplyDefaults(me,{skipUpdateCalc:!0});var At=me._fullData,ht=me._fullLayout,Gt=ht.datarevision===void 0,fr=ht.transition,gt=vt(me,at,ht,Gt,fr),yt=gt.newDataRevision,kt=Ke(me,Ue,At,Gt,fr,yt);if(fe(me)&&(gt.layoutReplot=!0),kt.calc||gt.calc){me.calcdata=void 0;for(var Lt=Object.getOwnPropertyNames(ht),Ct=0;Ct(ft||me.emit("plotly_react",{config:ke,data:_e,layout:Ae}),me))}function Ke(me,_e,Ae,ke,Ee,De){var Je=_e.length===Ae.length;if(!Ee&&!Je)return{fullReplot:!0,calc:!0};var Ue=C.traceFlags();Ue.arrays={},Ue.nChanges=0,Ue.nChangesAnim=0;var at,rt;function ft(Gt){var fr=u.getTraceValObject(rt,Gt);return!rt._module.animatable&&fr.anim&&(fr.anim=!1),fr}var At={getValObject:ft,flags:Ue,immutable:ke,transition:Ee,newDataRevision:De,gd:me},ht={};for(at=0;at<_e.length;at++)if(Ae[at]){if(rt=Ae[at],ht[rt.uid])continue;ht[rt.uid]=1,xt(_e[at],rt,[],At)}return(Ue.calc||Ue.plot)&&(Ue.fullReplot=!0),Ee&&Ue.nChanges&&Ue.nChangesAnim&&(Ue.anim=Ue.nChanges===Ue.nChangesAnim&&Je?"all":"some"),Ue}function vt(me,_e,Ae,ke,Ee){var De=C.layoutFlags();De.arrays={},De.rangesAltered={},De.nChanges=0,De.nChangesAnim=0;function Je(ht){return u.getLayoutValObject(Ae,ht)}for(var Ue in Ae)if(!(!Ue.startsWith("xaxis")&&!Ue.startsWith("yaxis"))&&_e[Ue]){var at=Ae[Ue].domain,rt=_e[Ue].domain,ft=_e[Ue]._inputDomain;_e[Ue]._inputDomain&&(at[0]===ft[0]&&at[1]===ft[1]?Ae[Ue].domain=_e[Ue].domain:(at[0]!==rt[0]||at[1]!==rt[1])&&(Ae[Ue]._inputDomain=null))}var At={getValObject:Je,flags:De,immutable:ke,transition:Ee,gd:me};return xt(_e,Ae,[],At),(De.plot||De.calc)&&(De.layoutReplot=!0),Ee&&De.nChanges&&De.nChangesAnim&&(De.anim=De.nChanges===De.nChangesAnim?"all":"some"),De}function xt(me,_e,Ae,ke){var Ee,De,Je,Ue=ke.getValObject,at=ke.flags,rt=ke.immutable,ft=ke.inArray,At=ke.arrayIndex;function ht(){var $i=Ee.editType;if(ft&&$i.indexOf("arraydraw")!==-1){a.pushUnique(at.arrays[ft],At);return}C.update(at,Ee),$i!=="none"&&at.nChanges++,ke.transition&&Ee.anim&&at.nChangesAnim++,(ce.test(Je)||pe.test(Je))&&(at.rangesAltered[Ae[0]]=1),De==="datarevision"&&(at.newDataRevision=1)}function Gt($i){return $i.valType==="data_array"||$i.arrayOk}for(De in me){if(at.calc&&!ke.transition)return;var fr=me[De],gt=_e[De],yt=Ae.concat(De);if(Je=yt.join("."),!(De.charAt(0)==="_"||typeof fr=="function"||fr===gt)){if((De==="tick0"||De==="dtick")&&Ae[0]!=="geo"){var kt=_e.tickmode;if(kt==="auto"||kt==="array"||!kt)continue}if(!(De==="range"&&_e.autorange)&&!((De==="zmin"||De==="zmax")&&_e.type==="contourcarpet")&&(Ee=Ue(yt),!!Ee&&!(Ee._compareAsJSON&&JSON.stringify(fr)===JSON.stringify(gt)))){var Lt=Ee.valType,Ct,$t=Gt(Ee),mr=Array.isArray(fr),br=Array.isArray(gt);if(mr&&br){var Er="_input_"+De,Tr=me[Er],Ur=_e[Er];if(Array.isArray(Tr)&&Tr===Ur)continue}if(gt===void 0)$t&&mr?at.calc=!0:ht();else if(Ee._isLinkedToArray){var Ai=[],oi=!1;ft||(at.arrays[De]=Ai);var Qr=Math.min(fr.length,gt.length),ea=Math.max(fr.length,gt.length);if(Qr!==ea)if(Ee.editType==="arraydraw")oi=!0;else{ht();continue}for(Ct=0;Ct=Ee.length?Ee[0]:Ee[rt]:Ee}function Ue(rt){return Array.isArray(De)?rt>=De.length?De[0]:De[rt]:De}function at(rt,ft){var At=0;return function(){if(rt&&++At===ft)return rt()}}return new Promise(function(rt,ft){function At(){if(ke._frameQueue.length!==0){for(;ke._frameQueue.length;){var Qr=ke._frameQueue.pop();Qr.onInterrupt&&Qr.onInterrupt()}me.emit("plotly_animationinterrupted",[])}}function ht(Qr){if(Qr.length!==0){for(var ea=0;eake._timeToNext&&fr()};Qr()}var yt=0;function kt(Qr){return Array.isArray(Ee)?yt>=Ee.length?Qr.transitionOpts=Ee[yt]:Qr.transitionOpts=Ee[0]:Qr.transitionOpts=Ee,yt++,Qr}var Lt,Ct,$t=[],mr=_e==null,br=Array.isArray(_e),Er=!mr&&!br&&a.isPlainObject(_e);if(Er)$t.push({type:"object",data:kt(a.extendFlat({},_e))});else if(mr||["string","number"].indexOf(typeof _e)!==-1)for(Lt=0;Lt0&&Ai<$t.length-1){var oi=[];for(Lt=0;Lt<$t.length;Lt++)Ct=$t[Lt],($t[Lt].type!=="byname"||Lt>Ai)&&oi.push(Ct);$t=oi}}$t.length>0?ht($t):(me.emit("plotly_animated"),rt())})}function mt(me,_e,Ae){if(me=a.getGraphDiv(me),_e==null)return Promise.resolve();if(!a.isPlotDiv(me))throw new Error("This element is not a Plotly plot: "+me+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var ke,Ee,De,Je,Ue=me._transitionData._frames,at=me._transitionData._frameHash;if(!Array.isArray(_e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+_e);var rt=Ue.length+_e.length*2,ft=[],At={};for(ke=_e.length-1;ke>=0;ke--)if(a.isPlainObject(_e[ke])){var ht=_e[ke].name,Gt=(at[ht]||At[ht]||{}).name,fr=_e[ke].name,gt=at[Gt]||At[Gt];Gt&&fr&&typeof fr=="number"&>&&kTr.index?-1:Er.index=0;ke--){if(Ee=ft[ke].frame,typeof Ee.name=="number"&&a.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Ee.name)for(;at[Ee.name="frame "+me._transitionData._counter++];);if(at[Ee.name]){for(De=0;De=0;Ae--)ke=_e[Ae],De.push({type:"delete",index:ke}),Je.unshift({type:"insert",index:ke,value:Ee[ke]});var Ue=c.modifyFrames,at=c.modifyFrames,rt=[me,Je],ft=[me,De];return l&&l.add(me,Ue,rt,at,ft),c.modifyFrames(me,De)}function lt(me){me=a.getGraphDiv(me);var _e=me._fullLayout||{},Ae=me._fullData||[];return c.cleanPlot([],{},Ae,_e),c.purge(me),s.purge(me),_e._container&&_e._container.remove(),delete me._context,me}function qe(me){var _e=me._fullLayout,Ae=me.getBoundingClientRect();if(!a.equalDomRects(Ae,_e._lastBBox)){var ke=_e._invTransform=a.inverseTransformMatrix(a.getFullTransformMatrix(me));_e._invScaleX=Math.sqrt(ke[0][0]*ke[0][0]+ke[0][1]*ke[0][1]+ke[0][2]*ke[0][2]),_e._invScaleY=Math.sqrt(ke[1][0]*ke[1][0]+ke[1][1]*ke[1][1]+ke[1][2]*ke[1][2]),_e._lastBBox=Ae}}function Ye(me){var _e=r.select(me),Ae=me._fullLayout;if(Ae._calcInverseTransform=qe,Ae._calcInverseTransform(me),Ae._container=_e.selectAll(".plot-container").data([0]),Ae._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Ae._paperdiv=Ae._container.selectAll(".svg-container").data([0]),Ae._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Ae._glcontainer=Ae._paperdiv.selectAll(".gl-container").data([{}]),Ae._glcontainer.enter().append("div").classed("gl-container",!0),Ae._paperdiv.selectAll(".main-svg").remove(),Ae._paperdiv.select(".modebar-container").remove(),Ae._paper=Ae._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Ae._toppaper=Ae._paperdiv.append("svg").classed("main-svg",!0),Ae._modebardiv=Ae._paperdiv.append("div"),delete Ae._modeBar,Ae._hoverpaper=Ae._paperdiv.append("svg").classed("main-svg",!0),!Ae._uid){var ke={};r.selectAll("defs").each(function(){this.id&&(ke[this.id.split("-")[1]]=1)}),Ae._uid=a.randstr(ke)}Ae._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),Ae._defs=Ae._paper.append("defs").attr("id","defs-"+Ae._uid),Ae._clips=Ae._defs.append("g").classed("clips",!0),Ae._topdefs=Ae._toppaper.append("defs").attr("id","topdefs-"+Ae._uid),Ae._topclips=Ae._topdefs.append("g").classed("clips",!0),Ae._bgLayer=Ae._paper.append("g").classed("bglayer",!0),Ae._draggers=Ae._paper.append("g").classed("draglayer",!0);var Ee=Ae._paper.append("g").classed("layer-below",!0);Ae._imageLowerLayer=Ee.append("g").classed("imagelayer",!0),Ae._shapeLowerLayer=Ee.append("g").classed("shapelayer",!0),Ae._cartesianlayer=Ae._paper.append("g").classed("cartesianlayer",!0),Ae._polarlayer=Ae._paper.append("g").classed("polarlayer",!0),Ae._smithlayer=Ae._paper.append("g").classed("smithlayer",!0),Ae._ternarylayer=Ae._paper.append("g").classed("ternarylayer",!0),Ae._geolayer=Ae._paper.append("g").classed("geolayer",!0),Ae._funnelarealayer=Ae._paper.append("g").classed("funnelarealayer",!0),Ae._pielayer=Ae._paper.append("g").classed("pielayer",!0),Ae._iciclelayer=Ae._paper.append("g").classed("iciclelayer",!0),Ae._treemaplayer=Ae._paper.append("g").classed("treemaplayer",!0),Ae._sunburstlayer=Ae._paper.append("g").classed("sunburstlayer",!0),Ae._indicatorlayer=Ae._toppaper.append("g").classed("indicatorlayer",!0),Ae._glimages=Ae._paper.append("g").classed("glimages",!0);var De=Ae._toppaper.append("g").classed("layer-above",!0);Ae._imageUpperLayer=De.append("g").classed("imagelayer",!0),Ae._shapeUpperLayer=De.append("g").classed("shapelayer",!0),Ae._selectionLayer=Ae._toppaper.append("g").classed("selectionlayer",!0),Ae._infolayer=Ae._toppaper.append("g").classed("infolayer",!0),Ae._menulayer=Ae._toppaper.append("g").classed("menulayer",!0),Ae._zoomlayer=Ae._toppaper.append("g").classed("zoomlayer",!0),Ae._hoverlayer=Ae._hoverpaper.append("g").classed("hoverlayer",!0),Ae._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),me.emit("plotly_framework")}e.animate=Pt,e.addFrames=mt,e.deleteFrames=Mt,e.addTraces=H,e.deleteTraces=$,e.extendTraces=J,e.moveTraces=U,e.prependTraces=N,e.newPlot=z,e._doPlot=b,e.purge=lt,e.react=Ze,e.redraw=P,e.relayout=ne,e.restyle=V,e.setPlotConfig=T,e.update=ae,e._guiRelayout=ee(ne),e._guiRestyle=ee(V),e._guiUpdate=ee(ae),e._storeDirectGUIEdit=K}}),Mp=de({"src/snapshot/helpers.js"(e){"use strict";var r=Ma();e.getDelay=function(a){return a._has&&(a._has("gl3d")||a._has("map"))?500:0},e.getRedrawFunc=function(a){return function(){r.getComponentMethod("colorbar","draw")(a)}},e.encodeSVG=function(a){return"data:image/svg+xml,"+encodeURIComponent(a)},e.encodeJSON=function(a){return"data:application/json,"+encodeURIComponent(a)};var t=window.URL||window.webkitURL;e.createObjectURL=function(a){return t.createObjectURL(a)},e.revokeObjectURL=function(a){return t.revokeObjectURL(a)},e.createBlob=function(a,o){if(o==="svg")return new window.Blob([a],{type:"image/svg+xml;charset=utf-8"});if(o==="full-json")return new window.Blob([a],{type:"application/json;charset=utf-8"});var s=i(window.atob(a));return new window.Blob([s],{type:"image/"+o})},e.octetStream=function(a){document.location.href="data:application/octet-stream"+a},e.getPlotTitle=function(a){var o,s,l,n,u=a._fullLayout;if(u){var c=(o=u.title)==null?void 0:o.text;return c===((s=u._dfltTitle)==null?void 0:s.plot)?void 0:c}return(n=(l=a.layout)==null?void 0:l.title)==null?void 0:n.text},e.getPlotSubtitle=function(a){var o,s,l,n,u,c,f=a._fullLayout;if(f){var h=(s=(o=f.title)==null?void 0:o.subtitle)==null?void 0:s.text;return h===((l=f._dfltTitle)==null?void 0:l.subtitle)?void 0:h}return(c=(u=(n=a.layout)==null?void 0:n.title)==null?void 0:u.subtitle)==null?void 0:c.text};function i(a){for(var o=a.length,s=new ArrayBuffer(o),l=new Uint8Array(s),n=0;n{let v=_.toLowerCase();return c.includes(v)?_:f.includes(v)?"<":h.includes(v)?">":_.includes("<")||_.includes(">")?"":m.html(_).text()});return m.remove(),y}function p(g){return g.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}r.exports=function(m,y,_){var v=m._fullLayout,x=v._paper,S=v._toppaper,M=v.width,C=v.height,w;x.insert("rect",":first-child").call(a.setRect,0,0,M,C).call(o.fill,v.paper_bgcolor);var k=v._basePlotModules||[];for(w=0;w1&&C.push(d("object","layout"))),i.supplyDefaults(w);for(var b=w._fullData,E=k.length,T=0;TF.length&&M.push(d("unused",C,E.concat(F.length)));var L=F.length,B=Array.isArray(I);B&&(L=Math.min(L,I.length));var O,G,W,X,Z;if(D.dimensions===2)for(G=0;GF[G].length&&M.push(d("unused",C,E.concat(G,F[G].length)));var J=F[G].length;for(O=0;O<(B?Math.min(J,I[G].length):J);O++)W=B?I[G][O]:I,X=T[G][O],Z=F[G][O],t.validate(X,W)?Z!==X&&Z!==+X&&M.push(d("dynamic",C,E.concat(G,O),X,Z)):M.push(d("value",C,E.concat(G,O),X))}else M.push(d("array",C,E.concat(G),T[G]));else for(G=0;GP?M.push({code:"unused",traceType:T,templateCount:R,dataCount:P}):P>R&&M.push({code:"reused",traceType:T,templateCount:R,dataCount:P})}}function z(I,L){for(var B in I)if(B.charAt(0)!=="_"){var O=I[B],G=d(I,B,L);t(O)?(Array.isArray(I)&&O._template===!1&&O.templateitemname&&M.push({code:"missing",path:G,templateitemname:O.templateitemname}),z(O,G)):Array.isArray(O)&&p(O)&&z(O,G)}}if(z({data:w,layout:C},""),M.length)return M.map(g)};function p(m){for(var y=0;y=0;g--){var m=s[g];if(m.type==="scatter"&&m.xaxis===d.xaxis&&m.yaxis===d.yaxis){m.opacity=void 0;break}}}}}}}),eV=de({"src/traces/scatter/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=Tw();r.exports=function(a,o){function s(n,u){return t.coerce(a,o,i,n,u)}var l=o.barmode==="group";o.scattermode==="group"&&s("scattergap",l?o.bargap:.2)}}}),xd=de({"src/plots/cartesian/align_period.js"(e,r){"use strict";var t=da(),i=Qt(),a=i.dateTime2ms,o=i.incrementMonth,s=cn(),l=s.ONEAVGMONTH;r.exports=function(u,c,f,h){if(c.type!=="date")return{vals:h};var d=u[f+"periodalignment"];if(!d)return{vals:h};var p=u[f+"period"],g;if(t(p)){if(p=+p,p<=0)return{vals:h}}else if(typeof p=="string"&&p.charAt(0)==="M"){var m=+p.substring(1);if(m>0&&Math.round(m)===m)g=m;else return{vals:h}}for(var y=c.calendar,_=d==="start",v=d==="end",x=u[f+"period0"],S=a(x,y)||0,M=[],C=[],w=[],k=h.length,A=0;Ab;)F=o(F,-g,y);for(;F<=b;)F=o(F,g,y);T=o(F,-g,y)}else{for(E=Math.round((b-S)/p),F=S+E*p;F>b;)F-=p;for(;F<=b;)F+=p;T=F-p}M[A]=_?T:v?F:(T+F)/2,C[A]=T,w[A]=F}return{vals:M,starts:C,ends:w}}}}),jh=de({"src/traces/scatter/colorscale_calc.js"(e,r){"use strict";var t=Wu().hasColorscale,i=hc(),a=bs();r.exports=function(s,l){a.hasLines(l)&&t(l,"line")&&i(s,l,{vals:l.line.color,containerStr:"line",cLetter:"c"}),a.hasMarkers(l)&&(t(l,"marker")&&i(s,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),t(l,"marker.line")&&i(s,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),Qd=de({"src/traces/scatter/arrays_to_calcdata.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){for(var s=0;sz&&T[L].gap;)L--;for(O=T[L].s,I=T.length-1;I>L;I--)T[I].s=O;for(;zX+G||!t(W))}for(var J=0;JL(O))):L(P.text);let B=P.outsidetextfont.size*c*I+u;return{ppadplus:z.some(O=>O.s<0)?B:0,ppadminus:z.some(O=>O.s>=0)?B:0}}return{ppadplus:void 0,ppadminus:void 0}}function F(P,z,I,L){for(var B=R(L),O=0;OR[y]&&y0?s:l)/(y._m*x*(y._m>0?s:l)))),rt*=1e3}if(ft===a){if(v&&(ft=y.c2p(at.y,!0)),ft===a)return!1;ft*=1e3}return[rt,ft]}function Y(Ue,at,rt,ft){var At=rt-Ue,ht=ft-at,Gt=.5-Ue,fr=.5-at,gt=At*At+ht*ht,yt=At*Gt+ht*fr;if(yt>0&&yt1||Math.abs(Gt.y-rt[0][1])>1)&&(Gt=[Gt.x,Gt.y],ft&&se(Gt,Ue)pe||Ue[1]ye)return[c(Ue[0],ce,pe),c(Ue[1],xe,ye)]}function je(Ue,at){if(Ue[0]===at[0]&&(Ue[0]===ce||Ue[0]===pe)||Ue[1]===at[1]&&(Ue[1]===xe||Ue[1]===ye))return!0}function Ve(Ue,at){var rt=[],ft=Te(Ue),At=Te(at);return ft&&At&&je(ft,At)||(ft&&rt.push(ft),At&&rt.push(At)),rt}function Ze(Ue,at,rt){return function(ft,At){var ht=Te(ft),Gt=Te(At),fr=[];if(ht&&Gt&&je(ht,Gt))return fr;ht&&fr.push(ht),Gt&&fr.push(Gt);var gt=2*n.constrain((ft[Ue]+At[Ue])/2,at,rt)-((ht||ft)[Ue]+(Gt||At)[Ue]);if(gt){var yt;ht&&Gt?yt=gt>0==ht[Ue]>Gt[Ue]?ht:Gt:yt=ht||Gt,yt[Ue]+=gt}return fr}}var Ke;A==="linear"||A==="spline"?Ke=Me:A==="hv"||A==="vh"?Ke=Ve:A==="hvh"?Ke=Ze(0,ce,pe):A==="vhv"&&(Ke=Ze(1,xe,ye));function vt(Ue,at){var rt=at[0]-Ue[0],ft=(at[1]-Ue[1])/rt,At=(Ue[1]*at[0]-at[1]*Ue[0])/rt;return At>0?[ft>0?ce:pe,ye]:[ft>0?pe:ce,xe]}function xt(Ue){var at=Ue[0],rt=Ue[1],ft=at===R[P-1][0],At=rt===R[P-1][1];if(!(ft&&At))if(P>1){var ht=at===R[P-2][0],Gt=rt===R[P-2][1];ft&&(at===ce||at===pe)&&ht?Gt?P--:R[P-1]=Ue:At&&(rt===xe||rt===ye)&&Gt?ht?P--:R[P-1]=Ue:R[P++]=Ue}else R[P++]=Ue}function Pt(Ue){R[P-1][0]!==Ue[0]&&R[P-1][1]!==Ue[1]&&xt([ie,Q]),xt(Ue),ue=null,ie=Q=0}var mt=n.isArrayOrTypedArray(C);function Mt(Ue){if(Ue&&M&&(Ue.i=z,Ue.d=d,Ue.trace=g,Ue.marker=mt?C[Ue.i]:C,Ue.backoff=M),K=Ue[0]/x,te=Ue[1]/S,ae=Ue[0]pe?pe:0,ee=Ue[1]ye?ye:0,ae||ee){if(!P)R[P++]=[ae||Ue[0],ee||Ue[1]];else if(ue){var at=Ke(ue,Ue);at.length>1&&(Pt(at[0]),R[P++]=at[1])}else ge=Ke(R[P-1],Ue)[0],R[P++]=ge;var rt=R[P-1];ae&&ee&&(rt[0]!==ae||rt[1]!==ee)?(ue&&(ie!==ae&&Q!==ee?xt(ie&&Q?vt(ue,Ue):[ie||ae,Q||ee]):ie&&Q&&xt([ie,Q])),xt([ae,ee])):ie-ae&&Q-ee&&xt([ae||ie,ee||Q]),ue=Ue,ie=ae,Q=ee}else ue&&Pt(Ke(ue,Ue)[0]),R[P++]=Ue}for(z=0;zne(G,lt))break;L=G,$=Z[0]*X[0]+Z[1]*X[1],$>N?(N=$,B=G,W=!1):$=d.length||!G)break;Mt(G),I=G}}ue&&xt([ie||ue[0],Q||ue[1]]),T.push(R.slice(0,P))}var qe=A.slice(A.length-1);if(M&&qe!=="h"&&qe!=="v"){for(var Ye=!1,me=-1,_e=[],Ae=0;Ae=0?f=m:(f=m=g,g++),f0,A=c(m,y,_);if(M=v.selectAll("g.trace").data(A,function(E){return E[0].trace.uid}),M.enter().append("g").attr("class",function(E){return"trace scatter trace"+E[0].trace.uid}).style("stroke-miterlimit",2),M.order(),h(m,M,y),k){S&&(C=S());var b=t.transition().duration(x.duration).ease(x.easing).each("end",function(){C&&C()}).each("interrupt",function(){C&&C()});b.each(function(){v.selectAll("g.trace").each(function(E,T){d(m,T,y,E,A,this,x)})})}else M.each(function(E,T){d(m,T,y,E,A,this,x)});w&&M.exit().remove(),v.selectAll("path:not([d])").remove()};function h(g,m,y){m.each(function(_){var v=o(t.select(this),"g","fills");l.setClipUrl(v,y.layerClipId,g);var x=_[0].trace;x._ownFill=null,x._nextFill=null;var S=[];x._ownfill&&S.push("_ownFill"),x._nexttrace&&S.push("_nextFill");var M=v.selectAll("g").data(S,s);M.enter().append("g"),M.exit().remove(),M.order().each(function(C){x[C]=o(t.select(this),"path","js-fill")})})}function d(g,m,y,_,v,x,S){var M=g._context.staticPlot,C;p(g,m,y,_,v);var w=!!S&&S.duration>0;function k(xt){return w?xt.transition():xt}var A=y.xaxis,b=y.yaxis,E=_[0].trace,T=E.line,F=t.select(x),D=o(F,"g","errorbars"),R=o(F,"g","lines"),P=o(F,"g","points"),z=o(F,"g","text");if(i.getComponentMethod("errorbars","plot")(g,D,y,S),E.visible!==!0)return;k(F).style("opacity",E.opacity);var I,L,B=E.fill.charAt(E.fill.length-1);B!=="x"&&B!=="y"&&(B="");var O,G;B==="y"?(O=1,G=b.c2p(0,!0)):B==="x"&&(O=0,G=A.c2p(0,!0)),_[0][y.isRangePlot?"nodeRangePlot3":"node3"]=F;var W="",X=[],Z=E._prevtrace,J=null,N=null;Z&&(W=Z._prevRevpath||"",L=Z._nextFill,X=Z._ownPolygons,J=Z._fillsegments,N=Z._fillElement);var H,$,U="",V="",j,q,Y,K,te,ne,se=[];E._polygons=[];var le=[],ce=[],pe=a.noop;if(I=E._ownFill,n.hasLines(E)||E.fill!=="none"){L&&L.datum(_),["hv","vh","hvh","vhv"].indexOf(T.shape)!==-1?(j=l.steps(T.shape),q=l.steps(T.shape.split("").reverse().join(""))):T.shape==="spline"?j=q=function(xt){var Pt=xt[xt.length-1];return xt.length>1&&xt[0][0]===Pt[0]&&xt[0][1]===Pt[1]?l.smoothclosed(xt.slice(1),T.smoothing):l.smoothopen(xt,T.smoothing)}:j=q=function(xt){return"M"+xt.join("L")},Y=function(xt){return q(xt.reverse())},ce=u(_,{xaxis:A,yaxis:b,trace:E,connectGaps:E.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:E.fill}),le=new Array(ce.length);var xe=0;for(C=0;C=M[0]&&F.x<=M[1]&&F.y>=C[0]&&F.y<=C[1]}),b=Math.ceil(A.length/k),E=0;v.forEach(function(F,D){var R=F[0].trace;n.hasMarkers(R)&&R.marker.maxdisplayed>0&&D=Math.min(Z,J)&&y<=Math.max(Z,J)?0:1/0}var N=Math.max(3,X.mrc||0),H=1-1/N,$=Math.abs(g.c2p(X.x)-y);return $=Math.min(Z,J)&&_<=Math.max(Z,J)?0:1/0}var N=Math.max(3,X.mrc||0),H=1-1/N,$=Math.abs(m.c2p(X.y)-_);return $V!=le>=V&&(te=Y[q-1][0],ne=Y[q][0],le-se&&(K=te+(ne-te)*(V-se)/(le-se),N=Math.min(N,K),H=Math.max(H,K)));return N=Math.max(N,0),H=Math.min(H,g._length),{x0:N,x1:H,y0:V,y1:V}}if(x.indexOf("fills")!==-1&&p._fillElement){var O=L(p._fillElement)&&!L(p._fillExclusionElement);if(O){var G=B(p._polygons);G===null&&(G={x0:v[0],x1:v[0],y0:v[1],y1:v[1]});var W=s.defaultLine;return s.opacity(p.fillcolor)?W=p.fillcolor:s.opacity((p.line||{}).color)&&(W=p.line.color),t.extendFlat(u,{distance:u.maxHoverDistance,x0:G.x0,x1:G.x1,y0:G.y0,y1:G.y1,color:W,hovertemplate:!1}),delete u.index,p.text&&!t.isArrayOrTypedArray(p.text)?u.text=String(p.text):u.text=p.name,[u]}}}}}),Mv=de({"src/traces/scatter/select.js"(e,r){"use strict";var t=bs();r.exports=function(a,o){var s=a.cd,l=a.xaxis,n=a.yaxis,u=[],c=s[0].trace,f,h,d,p,g=c.mode&&!t.hasMarkers(c)&&!t.hasText(c);if(g)return[];if(o===!1)for(f=0;f0&&(h["_"+c+"axes"]||{})[u])return h;if((h[c+"axis"]||c)===u){if(l(h,c))return h;if((h[c]||[]).length||h[c+"0"])return h}}}function s(n){return{v:"x",h:"y"}[n.orientation||"v"]}function l(n,u){var c=s(n),f=t(n,"box-violin");return f&&u===c&&n[c]===void 0&&n[c+"0"]===void 0}}}),Ow=de({"src/plots/cartesian/category_order_defaults.js"(e,r){"use strict";var t=Do().isTypedArraySpec;function i(a,o){var s=o.dataAttr||a._id.charAt(0),l={},n,u,c;if(o.axData)n=o.axData;else for(n=[],u=0;u0||t(u),f;c&&(f="array");var h=l("categoryorder",f),d;h==="array"&&(d=l("categoryarray")),!c&&h==="array"&&(h=s.categoryorder="trace"),h==="trace"?s._initialCategories=[]:h==="array"?s._initialCategories=d.slice():(d=i(s,n).sort(),h==="category ascending"?s._initialCategories=d:h==="category descending"&&(s._initialCategories=d.reverse()))}}}}),Ry=de({"src/plots/cartesian/line_grid_defaults.js"(e,r){"use strict";var t=ta(),i=Jo(),a=Qt();r.exports=function(s,l,n,u){u=u||{};var c=u.dfltColor;function f(T,F){return a.coerce2(s,l,u.attributes,T,F)}var h=f("linecolor",c),d=f("linewidth"),p=n("showline",u.showLine||!!h||!!d);p||(delete l.linecolor,delete l.linewidth);var g=t.mix(c,u.bgColor,u.blend||i.lightFraction),m=f("gridcolor",g),y=f("gridwidth"),_=f("griddash"),v=n("showgrid",u.showGrid||!!m||!!y||!!_);if(v||(delete l.gridcolor,delete l.gridwidth,delete l.griddash),u.hasMinor){var x=t.mix(l.gridcolor,u.bgColor,67),S=f("minor.gridcolor",x),M=f("minor.gridwidth",l.gridwidth||1),C=f("minor.griddash",l.griddash||"solid"),w=n("minor.showgrid",!!S||!!M||!!C);w||(delete l.minor.gridcolor,delete l.minor.gridwidth,delete l.minor.griddash)}if(!u.noZeroLine){var k=f("zerolinelayer"),A=f("zerolinecolor",c),b=f("zerolinewidth"),E=n("zeroline",u.showGrid||!!A||!!b);E||(delete l.zerolinelayer,delete l.zerolinecolor,delete l.zerolinewidth)}}}}),zy=de({"src/plots/cartesian/axis_defaults.js"(e,r){"use strict";var t=da(),i=Ma(),a=Qt(),o=Ro(),s=fc(),l=Mu(),n=_v(),u=f1(),c=h0(),f=d0(),h=Ow(),d=Ry(),p=FE(),g=Yd(),m=zl().WEEKDAY_PATTERN,y=zl().HOUR_PATTERN;r.exports=function(M,C,w,k,A){var b=k.letter,E=k.font||{},T=k.splomStash||{},F=w("visible",!k.visibleDflt),D=C._template||{},R=C.type||D.type||"-",P;if(R==="date"){var z=i.getComponentMethod("calendars","handleDefaults");z(M,C,"calendar",k.calendar),k.noTicklabelmode||(P=w("ticklabelmode"))}!k.noTicklabelindex&&(R==="date"||R==="linear")&&w("ticklabelindex");var I="";(!k.noTicklabelposition||R==="multicategory")&&(I=a.coerce(M,C,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:P==="period"?["outside","inside"]:b==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),k.noTicklabeloverflow||w("ticklabeloverflow",I.indexOf("inside")!==-1?"hide past domain":R==="category"||R==="multicategory"?"allow":"hide past div"),g(C,A),p(M,C,w,k),h(M,C,w,k),k.noHover||(R!=="category"&&w("hoverformat"),k.noUnifiedhovertitle||w("unifiedhovertitle.text"));var L=w("color"),B=L!==l.color.dflt?L:E.color,O=T.label||A._dfltTitle[b];if(f(M,C,w,R,k),!F)return C;w("title.text",O),a.coerceFont(w,"title.font",E,{overrideDflt:{size:a.bigFont(E.size),color:B}}),n(M,C,w,R);var G=k.hasMinor;if(G&&(o.newContainer(C,"minor"),n(M,C,w,R,{isMinor:!0})),c(M,C,w,R,k),u(M,C,w,k),G){var W=k.isMinor;k.isMinor=!0,u(M,C,w,k),k.isMinor=W}d(M,C,w,{dfltColor:L,bgColor:k.bgColor,showGrid:k.showGrid,hasMinor:G,attributes:l}),G&&C.ticklabelindex==null&&!C.minor.ticks&&!C.minor.showgrid&&delete C.minor,(C.showline||C.ticks)&&w("mirror");var X=R==="multicategory";if(!k.noTickson&&(R==="category"||X)&&(C.ticks||C.showgrid)&&(X?(w("tickson","boundaries"),delete C.ticklabelposition):w("tickson")),X){var Z=w("showdividers");Z&&(w("dividercolor"),w("dividerwidth"))}if(R==="date")if(s(M,C,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:_}),!C.rangebreaks.length)delete C.rangebreaks;else{for(var J=0;J=2){var b="",E,T;if(A.length===2){for(E=0;E<2;E++)if(T=x(A[E]),T){b=m;break}}var F=w("pattern",b);if(F===m)for(E=0;E<2;E++)T=x(A[E]),T&&(M.bounds[E]=A[E]=T-1);if(F)for(E=0;E<2;E++)switch(T=A[E],F){case m:if(!t(T)){M.enabled=!1;return}if(T=+T,T!==Math.floor(T)||T<0||T>=7){M.enabled=!1;return}M.bounds[E]=A[E]=T;break;case y:if(!t(T)){M.enabled=!1;return}if(T=+T,T<0||T>24){M.enabled=!1;return}M.bounds[E]=A[E]=T;break}if(C.autorange===!1){var D=C.range;if(D[0]D[1]){M.enabled=!1;return}}else if(A[0]>D[0]&&A[1]w[1]-1/4096&&(s.domain=g),i.noneOrAll(o.domain,s.domain,g),s.tickmode==="sync"&&(s.tickmode="auto")}return l("layer"),s}}}),aV=de({"src/plots/cartesian/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=sf().isUnifiedHover,o=jE(),s=Ro(),l=l1(),n=Mu(),u=ok(),c=zy(),f=bv(),h=Nw(),d=Hs(),p=d.id2name,g=d.name2id,m=zl().AX_ID_PATTERN,y=Ma(),_=y.traceIs,v=y.getComponentMethod;function x(S,M,C){Array.isArray(S[M])?S[M].push(C):S[M]=[C]}r.exports=function(M,C,w){var k=C.autotypenumbers,A={},b={},E={},T={},F={},D={},R={},P={},z={},I={},L,B;for(L=0;L rect").call(o.setTranslate,0,0).call(o.setScale,1,1),C.plot.call(o.setTranslate,w._offset,k._offset).call(o.setScale,1,1);var A=C.plot.selectAll(".scatterlayer .trace");A.selectAll(".point").call(o.setPointGroupScale,1,1),A.selectAll(".textpoint").call(o.setTextPointsScale,1,1),A.call(o.hideOutsideRangePoints,C)}function p(C,w){var k=C.plotinfo,A=k.xaxis,b=k.yaxis,E=A._length,T=b._length,F=!!C.xr1,D=!!C.yr1,R=[];if(F){var P=a.simpleMap(C.xr0,A.r2l),z=a.simpleMap(C.xr1,A.r2l),I=P[1]-P[0],L=z[1]-z[0];R[0]=(P[0]*(1-w)+w*z[0]-P[0])/(P[1]-P[0])*E,R[2]=E*(1-w+w*L/I),A.range[0]=A.l2r(P[0]*(1-w)+w*z[0]),A.range[1]=A.l2r(P[1]*(1-w)+w*z[1])}else R[0]=0,R[2]=E;if(D){var B=a.simpleMap(C.yr0,b.r2l),O=a.simpleMap(C.yr1,b.r2l),G=B[1]-B[0],W=O[1]-O[0];R[1]=(B[1]*(1-w)+w*O[1]-B[1])/(B[0]-B[1])*T,R[3]=T*(1-w+w*W/G),b.range[0]=A.l2r(B[0]*(1-w)+w*O[0]),b.range[1]=b.l2r(B[1]*(1-w)+w*O[1])}else R[1]=0,R[3]=T;s.drawOne(n,A,{skipTitle:!0}),s.drawOne(n,b,{skipTitle:!0}),s.redrawComponents(n,[A._id,b._id]);var X=F?E/R[2]:1,Z=D?T/R[3]:1,J=F?R[0]:0,N=D?R[1]:0,H=F?R[0]/R[2]*E:0,$=D?R[1]/R[3]*T:0,U=A._offset-H,V=b._offset-$;k.clipRect.call(o.setTranslate,J,N).call(o.setScale,1/X,1/Z),k.plot.call(o.setTranslate,U,V).call(o.setScale,X,Z),o.setPointGroupScale(k.zoomScalePts,1/X,1/Z),o.setTextPointsScale(k.zoomScaleTxt,1/X,1/Z)}var g;f&&(g=f());function m(){for(var C={},w=0;wc.duration?(m(),x=window.cancelAnimationFrame(M)):x=window.requestAnimationFrame(M)}return _=Date.now(),x=window.requestAnimationFrame(M),Promise.resolve()}}}),ml=de({"src/plots/cartesian/index.js"(e){"use strict";var r=Yr(),t=Ma(),i=Qt(),a=Es(),o=hn(),s=$u().getModuleCalcData,l=Hs(),n=zl(),u=Oh(),c=i.ensureSingle;function f(_,v,x){return i.ensureSingle(_,v,x,function(S){S.datum(x)})}var h=n.zindexSeparator;e.name="cartesian",e.attr=["xaxis","yaxis"],e.idRoot=["x","y"],e.idRegex=n.idRegex,e.attrRegex=n.attrRegex,e.attributes=iV(),e.layoutAttributes=Mu(),e.supplyLayoutDefaults=aV(),e.transitionAxes=nV(),e.finalizeSubplots=function(_,v){var x=v._subplots,S=x.xaxis,M=x.yaxis,C=x.cartesian,w=C,k={},A={},b,E,T;for(b=0;b0){var D=F.id;if(D.indexOf(h)!==-1)continue;D+=h+(b+1),F=i.extendFlat({},F,{id:D,plot:M._cartesianlayer.selectAll(".subplot").select("."+D)})}for(var R=[],P,z=0;z1&&(G+=h+O),B.push(k+G),w=0;w1,T=v.mainplotinfo;if(!v.mainplot||E)if(b)v.xlines=c(S,"path","xlines-above"),v.ylines=c(S,"path","ylines-above"),v.xaxislayer=c(S,"g","xaxislayer-above"),v.yaxislayer=c(S,"g","yaxislayer-above");else{if(!w){var F=c(S,"g","layer-subplot");v.shapelayer=c(F,"g","shapelayer"),v.imagelayer=c(F,"g","imagelayer"),T&&E?(v.minorGridlayer=T.minorGridlayer,v.gridlayer=T.gridlayer,v.zerolinelayer=T.zerolinelayer):(v.minorGridlayer=c(S,"g","minor-gridlayer"),v.gridlayer=c(S,"g","gridlayer"),v.zerolinelayer=c(S,"g","zerolinelayer"));var D=c(S,"g","layer-between");v.shapelayerBetween=c(D,"g","shapelayer"),v.imagelayerBetween=c(D,"g","imagelayer"),c(S,"path","xlines-below"),c(S,"path","ylines-below"),v.overlinesBelow=c(S,"g","overlines-below"),c(S,"g","xaxislayer-below"),c(S,"g","yaxislayer-below"),v.overaxesBelow=c(S,"g","overaxes-below")}v.overplot=c(S,"g","overplot"),v.plot=c(v.overplot,"g",M),T&&E?v.zerolinelayerAbove=T.zerolinelayerAbove:v.zerolinelayerAbove=c(S,"g","zerolinelayer-above"),w||(v.xlines=c(S,"path","xlines-above"),v.ylines=c(S,"path","ylines-above"),v.overlinesAbove=c(S,"g","overlines-above"),c(S,"g","xaxislayer-above"),c(S,"g","yaxislayer-above"),v.overaxesAbove=c(S,"g","overaxes-above"),v.xlines=S.select(".xlines-"+k),v.ylines=S.select(".ylines-"+A),v.xaxislayer=S.select(".xaxislayer-"+k),v.yaxislayer=S.select(".yaxislayer-"+A))}else{var R=T.plotgroup,P=M+"-x",z=M+"-y";v.minorGridlayer=T.minorGridlayer,v.gridlayer=T.gridlayer,v.zerolinelayer=T.zerolinelayer,v.zerolinelayerAbove=T.zerolinelayerAbove,c(T.overlinesBelow,"path",P),c(T.overlinesBelow,"path",z),c(T.overaxesBelow,"g",P),c(T.overaxesBelow,"g",z),v.plot=c(T.overplot,"g",M),c(T.overlinesAbove,"path",P),c(T.overlinesAbove,"path",z),c(T.overaxesAbove,"g",P),c(T.overaxesAbove,"g",z),v.xlines=R.select(".overlines-"+k).select("."+P),v.ylines=R.select(".overlines-"+A).select("."+z),v.xaxislayer=R.select(".overaxes-"+k).select("."+P),v.yaxislayer=R.select(".overaxes-"+A).select("."+z)}w||(b||(f(v.minorGridlayer,"g",v.xaxis._id),f(v.minorGridlayer,"g",v.yaxis._id),v.minorGridlayer.selectAll("g").map(function(I){return I[0]}).sort(l.idSort),f(v.gridlayer,"g",v.xaxis._id),f(v.gridlayer,"g",v.yaxis._id),v.gridlayer.selectAll("g").map(function(I){return I[0]}).sort(l.idSort)),v.xlines.style("fill","none").classed("crisp",!0),v.ylines.style("fill","none").classed("crisp",!0))}function m(_,v){if(_){var x={};_.each(function(A){var b=A[0],E=r.select(this);E.remove(),y(b,v),x[b]=!0});for(var S in v._plots)for(var M=v._plots[S],C=M.overlays||[],w=0;w=0,v=f.indexOf("end")>=0,x=p.backoff*m+h.standoff,S=g.backoff*y+h.startstandoff,M,C,w,k;if(d.nodeName==="line"){M={x:+c.attr("x1"),y:+c.attr("y1")},C={x:+c.attr("x2"),y:+c.attr("y2")};var A=M.x-C.x,b=M.y-C.y;if(w=Math.atan2(b,A),k=w+Math.PI,x&&S&&x+S>Math.sqrt(A*A+b*b)){G();return}if(x){if(x*x>A*A+b*b){G();return}var E=x*Math.cos(w),T=x*Math.sin(w);C.x+=E,C.y+=T,c.attr({x2:C.x,y2:C.y})}if(S){if(S*S>A*A+b*b){G();return}var F=S*Math.cos(w),D=S*Math.sin(w);M.x-=F,M.y-=D,c.attr({x1:M.x,y1:M.y})}}else if(d.nodeName==="path"){var R=d.getTotalLength(),P="";if(R2/3?Ct="right":Ct="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[Ct]}for(var ge=!1,Me=["x","y"],Te=0;Te1)&&(Ze===Ve?(De=Ke.r2fraction(S["a"+je]),(De<0||De>1)&&(ge=!0)):ge=!0),Ye=Ke._offset+Ke.r2p(S[je]),Ae=.5}else{var Je=Ee==="domain";je==="x"?(_e=S[je],Ye=Je?Ke._offset+Ke._length*_e:Ye=b.l+b.w*_e):(_e=1-S[je],Ye=Je?Ke._offset+Ke._length*_e:Ye=b.t+b.h*_e),Ae=S.showarrow?.5:_e}if(S.showarrow){qe.head=Ye;var Ue=S["a"+je];if(ke=xt*ue(.5,S.xanchor)-Pt*ue(.5,S.yanchor),Ze===Ve){var at=l.getRefType(Ze);at==="domain"?(je==="y"&&(Ue=1-Ue),qe.tail=Ke._offset+Ke._length*Ue):at==="paper"?je==="y"?(Ue=1-Ue,qe.tail=b.t+b.h*Ue):qe.tail=b.l+b.w*Ue:qe.tail=Ke._offset+Ke.r2p(Ue),me=ke}else qe.tail=Ye+Ue,me=ke+Ue;qe.text=qe.tail+ke;var rt=A[je==="x"?"width":"height"];if(Ve==="paper"&&(qe.head=o.constrain(qe.head,1,rt-1)),Ze==="pixel"){var ft=-Math.max(qe.tail-3,qe.text),At=Math.min(qe.tail+3,qe.text)-rt;ft>0?(qe.tail+=ft,qe.text+=ft):At>0&&(qe.tail-=At,qe.text-=At)}qe.tail+=lt,qe.head+=lt}else ke=mt*ue(Ae,Mt),me=ke,qe.text=Ye+ke;qe.text+=lt,ke+=lt,me+=lt,S["_"+je+"padplus"]=mt/2+me,S["_"+je+"padminus"]=mt/2-me,S["_"+je+"size"]=mt,S["_"+je+"shift"]=ke}if(ge){J.remove();return}var ht=0,Gt=0;if(S.align!=="left"&&(ht=(ae-ye)*(S.align==="center"?.5:1)),S.valign!=="top"&&(Gt=(ee-fe)*(S.valign==="middle"?.5:1)),pe)ce.select("svg").attr({x:$+ht-1,y:$+Gt}).call(u.setClipUrl,V?I:null,x);else{var fr=$+Gt-xe.top,gt=$+ht-xe.left;K.call(f.positionText,gt,fr).call(u.setClipUrl,V?I:null,x)}j.select("rect").call(u.setRect,$,$,ae,ee),U.call(u.setRect,N/2,N/2,ie-N,Q-N),J.call(u.setTranslate,Math.round(L.x.text-ie/2),Math.round(L.y.text-Q/2)),G.attr({transform:"rotate("+B+","+L.x.text+","+L.y.text+")"});var yt=function(Lt,Ct){O.selectAll(".annotation-arrow-g").remove();var $t=L.x.head,mr=L.y.head,br=L.x.tail+Lt,Er=L.y.tail+Ct,Tr=L.x.text+Lt,Ur=L.y.text+Ct,Ai=o.rotationXYMatrix(B,Tr,Ur),oi=o.apply2DTransform(Ai),Qr=o.apply2DTransform2(Ai),ea=+U.attr("width"),$i=+U.attr("height"),ja=Tr-.5*ea,ya=ja+ea,pa=Ur-.5*$i,xi=pa+$i,bi=[[ja,pa,ja,xi],[ja,xi,ya,xi],[ya,xi,ya,pa],[ya,pa,ja,pa]].map(Qr);if(!bi.reduce(function(ze,tt){return ze^!!o.segmentsIntersect($t,mr,$t+1e6,mr+1e6,tt[0],tt[1],tt[2],tt[3])},!1)){bi.forEach(function(ze){var tt=o.segmentsIntersect(br,Er,$t,mr,ze[0],ze[1],ze[2],ze[3]);tt&&(br=tt.x,Er=tt.y)});var Ua=S.arrowwidth,dn=S.arrowcolor,pi=S.arrowside,Jr=O.append("g").style({opacity:n.opacity(dn)}).classed("annotation-arrow-g",!0),Be=Jr.append("path").attr("d","M"+br+","+Er+"L"+$t+","+mr).style("stroke-width",Ua+"px").call(n.stroke,n.rgb(dn));if(g(Be,pi,S),E.annotationPosition&&Be.node().parentNode&&!C){var Fe=$t,Et=mr;if(S.standoff){var St=Math.sqrt(Math.pow($t-br,2)+Math.pow(mr-Er,2));Fe+=S.standoff*(br-$t)/St,Et+=S.standoff*(Er-mr)/St}var zt=Jr.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(br-Fe)+","+(Er-Et),transform:s(Fe,Et)}).style("stroke-width",Ua+6+"px").call(n.stroke,"rgba(0,0,0,0)").call(n.fill,"rgba(0,0,0,0)"),Wt,Yt;d.init({element:zt.node(),gd:x,prepFn:function(){var ze=u.getTranslate(J);Wt=ze.x,Yt=ze.y,w&&w.autorange&&R(w._name+".autorange",!0),k&&k.autorange&&R(k._name+".autorange",!0)},moveFn:function(ze,tt){var ct=oi(Wt,Yt),wt=ct[0]+ze,Nt=ct[1]+tt;J.call(u.setTranslate,wt,Nt),P("x",_(w,ze,"x",b,S)),P("y",_(k,tt,"y",b,S)),S.axref===S.xref&&P("ax",_(w,ze,"ax",b,S)),S.ayref===S.yref&&P("ay",_(k,tt,"ay",b,S)),Jr.attr("transform",s(ze,tt)),G.attr({transform:"rotate("+B+","+wt+","+Nt+")"})},doneFn:function(){i.call("_guiRelayout",x,z());var ze=document.querySelector(".js-notes-box-panel");ze&&ze.redraw(ze.selectedObj)}})}}};if(S.showarrow&&yt(0,0),W){var kt;d.init({element:J.node(),gd:x,prepFn:function(){kt=G.attr("transform")},moveFn:function(Lt,Ct){var $t="pointer";if(S.showarrow)S.axref===S.xref?P("ax",_(w,Lt,"ax",b,S)):P("ax",S.ax+Lt),S.ayref===S.yref?P("ay",_(k,Ct,"ay",b.w,S)):P("ay",S.ay+Ct),yt(Lt,Ct);else{if(C)return;var mr,br;if(w)mr=_(w,Lt,"x",b,S);else{var Er=S._xsize/b.w,Tr=S.x+(S._xshift-S.xshift)/b.w-Er/2;mr=d.align(Tr+Lt/b.w,Er,0,1,S.xanchor)}if(k)br=_(k,Ct,"y",b,S);else{var Ur=S._ysize/b.h,Ai=S.y-(S._yshift+S.yshift)/b.h-Ur/2;br=d.align(Ai-Ct/b.h,Ur,0,1,S.yanchor)}P("x",mr),P("y",br),(!w||!k)&&($t=d.getCursor(w?.5:mr,k?.5:br,S.xanchor,S.yanchor))}G.attr({transform:s(Lt,Ct)+kt}),h(J,$t)},clickFn:function(Lt,Ct){S.captureevents&&x.emit("plotly_clickannotation",Z(Ct))},doneFn:function(){h(J),i.call("_guiRelayout",x,z());var Lt=document.querySelector(".js-notes-box-panel");Lt&&Lt.redraw(Lt.selectedObj)}})}}E.annotationText?K.call(f.makeEditable,{delegate:J,gd:x}).call(te).on("edit",function(se){S.text=se,this.call(te),P("text",se),w&&w.autorange&&R(w._name+".autorange",!0),k&&k.autorange&&R(k._name+".autorange",!0),i.call("_guiRelayout",x,z())}):K.call(te)}}}),lV=de({"src/components/annotations/click.js"(e,r){"use strict";var t=Qt(),i=Ma(),a=Ro().arrayEditor;r.exports={hasClickToShow:o,onClick:s};function o(u,c){var f=l(u,c);return f.on.length>0||f.explicitOff.length>0}function s(u,c){var f=l(u,c),h=f.on,d=f.off.concat(f.explicitOff),p={},g=u._fullLayout.annotations,m,y;if(h.length||d.length){for(m=0;m1){h=!0;break}}h?s.fullLayout._infolayer.select(".annotation-"+s.id+'[data-index="'+c+'"]').remove():(f._pdata=i(s.glplot.cameraParams,[l.xaxis.r2l(f.x)*n[0],l.yaxis.r2l(f.y)*n[1],l.zaxis.r2l(f.z)*n[2]]),t(s.graphDiv,f,c,s.id,f._xa,f._ya))}}}}),mV=de({"src/components/annotations3d/index.js"(e,r){"use strict";var t=Ma(),i=Qt();r.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Uw()}}},layoutAttributes:Uw(),handleDefaults:dV(),includeBasePlot:a,convert:pV(),draw:vV()};function a(o,s){var l=t.subplotsRegistry.gl3d;if(l)for(var n=l.attrRegex,u=Object.keys(o),c=0;c{var T=E+"anchor",F=E==="x"?x:S,D={_fullLayout:f},R,P,z,I;let L=E+"ref",B=u[L];if(Array.isArray(B)&&B.length>0){let O=s.countDefiningCoords(y,g,E);I=i.coerceRefArray(u,c,D,E,void 0,"paper",O),c["_"+E+"refArray"]=!0}else I=i.coerceRef(u,c,D,E,void 0,"paper");if(Array.isArray(I))I.forEach(function(O){i.getRefType(O)==="range"&&(R=i.getFromId(D,O),R&&R._shapeIndices.indexOf(c._index)===-1&&R._shapeIndices.push(c._index))}),_&&[0,1].forEach(function(O){let G=I[O];i.getRefType(G)==="range"?(R=i.getFromId(D,G),P=s.shapePositionToRange(R),z=s.rangeToShapePosition(R),(R.type==="category"||R.type==="multicategory")&&h(E+O+"shift")):P=z=t.identity;let X=E+O,Z=u[X];if(u[X]=P(u[X],!0),F==="pixel"?h(X,C[O]):i.coercePosition(c,D,h,G,X,M[O]),c[X]=z(c[X]),u[X]=Z,O===0&&F==="pixel"){let J=u[T];u[T]=P(u[T],!0),i.coercePosition(c,D,h,G,T,.25),c[T]=z(c[T]),u[T]=J}});else{if(i.getRefType(I)==="range"?(R=i.getFromId(D,I),R._shapeIndices.push(c._index),z=s.rangeToShapePosition(R),P=s.shapePositionToRange(R),_&&(R.type==="category"||R.type==="multicategory")&&(h(E+"0shift"),h(E+"1shift"))):P=z=t.identity,_){let G=E+"0",W=E+"1",X=u[G],Z=u[W];u[G]=P(u[G],!0),u[W]=P(u[W],!0),F==="pixel"?(h(G,C[0]),h(W,C[1])):(i.coercePosition(c,D,h,I,G,M[0]),i.coercePosition(c,D,h,I,W,M[1])),c[G]=z(c[G]),c[W]=z(c[W]),u[G]=X,u[W]=Z}if(F==="pixel"){let G=u[T];u[T]=P(u[T],!0),i.coercePosition(c,D,h,I,T,.25),c[T]=z(c[T]),u[T]=G}}}),_&&t.noneOrAll(u,c,["x0","x1","y0","y1"]);var w=y==="line",k,A;if(_&&(k=h("label.texttemplate"),h("label.texttemplatefallback")),k||(A=h("label.text")),A||k){h("label.textangle");var b=h("label.textposition",w?"middle":"middle center");h("label.xanchor"),h("label.yanchor",l(w,b)),h("label.padding"),t.coerceFont(h,"label.font",f.font)}}}}),yV=de({"src/components/shapes/draw_newshape/defaults.js"(e,r){"use strict";var t=ta(),i=Qt();function a(o,s){return o?"bottom":s.indexOf("top")!==-1?"top":s.indexOf("bottom")!==-1?"bottom":"middle"}r.exports=function(s,l,n){n("newshape.visible"),n("newshape.name"),n("newshape.showlegend"),n("newshape.legend"),n("newshape.legendwidth"),n("newshape.legendgroup"),n("newshape.legendgrouptitle.text"),i.coerceFont(n,"newshape.legendgrouptitle.font"),n("newshape.legendrank"),n("newshape.drawdirection"),n("newshape.layer"),n("newshape.fillcolor"),n("newshape.fillrule"),n("newshape.opacity");var u=n("newshape.line.width");if(u){var c=(s||{}).plot_bgcolor||"#FFF";n("newshape.line.color",t.contrast(c)),n("newshape.line.dash")}var f=s.dragmode==="drawline",h=n("newshape.label.text"),d=n("newshape.label.texttemplate");if(n("newshape.label.texttemplatefallback"),h||d){n("newshape.label.textangle");var p=n("newshape.label.textposition",f?"middle":"middle center");n("newshape.label.xanchor"),n("newshape.label.yanchor",a(f,p)),n("newshape.label.padding"),i.coerceFont(n,"newshape.label.font",l.font)}n("activeshape.fillcolor"),n("activeshape.opacity")}}}),_V=de({"src/components/shapes/calc_autorange.js"(e,r){"use strict";var t=Qt(),i=nn(),a=Dy(),o=m0();r.exports=function(h){var d=h._fullLayout,p=t.filterVisible(d.shapes);if(!(!p.length||!h._fullData.length))for(var g=0;g{y=i.getFromId(h,M),m._extremes[y._id]=i.findExtremes(y,C,l(m))})}else m.xref!=="paper"&&v!=="domain"&&(y=i.getFromId(h,m.xref),_=c(y,m,a.paramIsX),_&&(m._extremes[y._id]=i.findExtremes(y,_,l(m))));if(x==="array"){let S=s(h,m,"y");Object.entries(S).forEach(([M,C])=>{y=i.getFromId(h,M),m._extremes[y._id]=i.findExtremes(y,C,n(m))})}else m.yref!=="paper"&&x!=="domain"&&(y=i.getFromId(h,m.yref),_=c(y,m,a.paramIsY),_&&(m._extremes[y._id]=i.findExtremes(y,_,n(m))))}};function s(f,h,d){let p=h[d+"ref"],g=d==="x"?a.paramIsX:a.paramIsY;function m(M,C){M==="paper"||i.getRefType(M)==="domain"||(y[M]||(y[M]=[]),y[M].push(C))}let y={};if(h.type==="path"&&h.path){let M=h.path.match(a.segmentRE)||[];for(var _=0,v=0;vk&&(m(p[_],A[k]),_++)}}else m(p[0],h[d+"0"]),m(p[1],h[d+"1"]);let x={};for(let M in y){let C=i.getFromId(f,M);if(C){var S=C.type==="category"||C.type==="multicategory"?C.r2c:C.d2c;C.type==="date"&&(S=o.decodeDate(S)),x[C._id]=y[M].map(S)}}return x}function l(f){return u(f.line.width,f.xsizemode,f.x0,f.x1,f.path,!1)}function n(f){return u(f.line.width,f.ysizemode,f.y0,f.y1,f.path,!0)}function u(f,h,d,p,g,m){var y=f/2,_=m;if(h==="pixel"){var v=g?o.extractPathCoords(g,m?a.paramIsY:a.paramIsX):[d,p],x=t.aggNums(Math.max,null,v),S=t.aggNums(Math.min,null,v),M=S<0?Math.abs(S)+y:y,C=x>0?x+y:y;return{ppad:y,ppadplus:_?M:C,ppadminus:_?C:M}}else return{ppad:y}}function c(f,h,d){var p=f._id.charAt(0)==="x"?"x":"y",g=f.type==="category"||f.type==="multicategory",m,y,_=0,v=0,x=g?f.r2c:f.d2c,S=h[p+"sizemode"]==="scaled";if(S?(m=h[p+"0"],y=h[p+"1"],g&&(_=h[p+"0shift"],v=h[p+"1shift"])):(m=h[p+"anchor"],y=h[p+"anchor"]),m!==void 0)return[x(m)+_,x(y)+v];if(h.path){var M=1/0,C=-1/0,w=h.path.match(a.segmentRE),k,A,b,E,T;for(f.type==="date"&&(x=o.decodeDate(x)),k=0;kC&&(C=T)));if(C>=M)return[M,C]}}}}),xV=de({"src/components/shapes/index.js"(e,r){"use strict";var t=Lw();r.exports={moduleType:"component",name:"shapes",layoutAttributes:uk(),supplyLayoutDefaults:gV(),supplyDrawNewShapeDefaults:yV(),includeBasePlot:Iy()("shapes"),calcAutorange:_V(),draw:t.draw,drawOne:t.drawOne}}}),ck=de({"src/components/images/attributes.js"(e,r){"use strict";var t=zl(),i=Ro().templatedArray,a=Py();r.exports=i("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",t.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",t.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),bV=de({"src/components/images/defaults.js"(e,r){"use strict";var t=Qt(),i=nn(),a=fc(),o=ck(),s="images";r.exports=function(u,c){var f={name:s,handleItemDefaults:l};a(u,c,f)};function l(n,u,c){function f(x,S){return t.coerce(n,u,o,x,S)}var h=f("source"),d=f("visible",!!h);if(!d)return u;f("layer"),f("xanchor"),f("yanchor"),f("sizex"),f("sizey"),f("sizing"),f("opacity");for(var p={_fullLayout:c},g=["x","y"],m=0;m<2;m++){var y=g[m],_=i.coerceRef(n,u,p,y,"paper",void 0);if(_!=="paper"){var v=i.getFromId(p,_);v._imgIndices.push(u._index)}i.coercePosition(u,p,f,_,y,0)}return u}}}),wV=de({"src/components/images/draw.js"(e,r){"use strict";var t=Yr(),i=hn(),a=nn(),o=Hs(),s=Oh();r.exports=function(n){var u=n._fullLayout,c=[],f={},h=[],d,p;for(p=0;p0);g&&(d("active"),d("direction"),d("type"),d("showactive"),d("x"),d("y"),t.noneOrAll(c,f,["x","y"]),d("xanchor"),d("yanchor"),d("pad.t"),d("pad.r"),d("pad.b"),d("pad.l"),t.coerceFont(d,"font",h.font),d("bgcolor",h.paper_bgcolor),d("bordercolor"),d("borderwidth"))}function u(c,f){function h(p,g){return t.coerce(c,f,l,p,g)}var d=h("visible",c.method==="skip"||Array.isArray(c.args));d&&(h("method"),h("args"),h("args2"),h("label"),h("execute"))}}}),SV=de({"src/components/updatemenus/scrollbox.js"(e,r){"use strict";r.exports=s;var t=Yr(),i=ta(),a=hn(),o=Qt();function s(l,n,u){this.gd=l,this.container=n,this.id=u,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(n,u,c){var f=this.gd._fullLayout,h=f.width,d=f.height;this.position=n;var p=this.position.l,g=this.position.w,m=this.position.t,y=this.position.h,_=this.position.direction,v=_==="down",x=_==="left",S=_==="right",M=_==="up",C=g,w=y,k,A,b,E;!v&&!x&&!S&&!M&&(this.position.direction="down",v=!0);var T=v||M;T?(k=p,A=k+C,v?(b=m,E=Math.min(b+w,d),w=E-b):(E=m+w,b=Math.max(E-w,0),w=E-b)):(b=m,E=b+w,x?(A=p+C,k=Math.max(A-C,0),C=A-k):(k=p,A=Math.min(k+C,h),C=A-k)),this._box={l:k,t:b,w:C,h:w};var F=g>C,D=s.barLength+2*s.barPad,R=s.barWidth+2*s.barPad,P=p,z=m+y;z+R>d&&(z=d-R);var I=this.container.selectAll("rect.scrollbar-horizontal").data(F?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),F?(this.hbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:z,width:D,height:R}),this._hbarXMin=P+D/2,this._hbarTranslateMax=C-D):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=y>w,B=s.barWidth+2*s.barPad,O=s.barLength+2*s.barPad,G=p+g,W=m;G+B>h&&(G=h-B);var X=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);X.exit().on(".drag",null).remove(),X.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),L?(this.vbar=X.attr({rx:s.barRadius,ry:s.barRadius,x:G,y:W,width:B,height:O}),this._vbarYMin=W+O/2,this._vbarTranslateMax=w-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var Z=this.id,J=k-.5,N=L?A+B+.5:A+.5,H=b-.5,$=F?E+R+.5:E+.5,U=f._topdefs.selectAll("#"+Z).data(F||L?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",Z).append("rect"),F||L?(this._clipRect=U.select("rect").attr({x:Math.floor(J),y:Math.floor(H),width:Math.ceil(N)-Math.floor(J),height:Math.ceil($)-Math.floor(H)}),this.container.call(a.setClipUrl,Z,this.gd),this.bg.attr({x:p,y:m,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),F||L){var V=t.behavior.drag().on("dragstart",function(){t.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var j=t.behavior.drag().on("dragstart",function(){t.event.sourceEvent.preventDefault(),t.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));F&&this.hbar.on(".drag",null).call(j),L&&this.vbar.on(".drag",null).call(j)}this.setTranslate(u,c)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var n=this.translateX,u=this.translateY;this.hbar&&(n-=t.event.dx),this.vbar&&(u-=t.event.dy),this.setTranslate(n,u)},s.prototype._onBoxWheel=function(){var n=this.translateX,u=this.translateY;this.hbar&&(n+=t.event.deltaY),this.vbar&&(u+=t.event.deltaY),this.setTranslate(n,u)},s.prototype._onBarDrag=function(){var n=this.translateX,u=this.translateY;if(this.hbar){var c=n+this._hbarXMin,f=c+this._hbarTranslateMax,h=o.constrain(t.event.x,c,f),d=(h-c)/(f-c),p=this.position.w-this._box.w;n=d*p}if(this.vbar){var g=u+this._vbarYMin,m=g+this._vbarTranslateMax,y=o.constrain(t.event.y,g,m),_=(y-g)/(m-g),v=this.position.h-this._box.h;u=_*v}this.setTranslate(n,u)},s.prototype.setTranslate=function(n,u){var c=this.position.w-this._box.w,f=this.position.h-this._box.h;if(n=o.constrain(n||0,0,c),u=o.constrain(u||0,0,f),this.translateX=n,this.translateY=u,this.container.call(a.setTranslate,this._box.l-this.position.l-n,this._box.t-this.position.t-u),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+n-.5),y:Math.floor(this.position.t+u-.5)}),this.hbar){var h=n/c;this.hbar.call(a.setTranslate,n+h*this._hbarTranslateMax,u)}if(this.vbar){var d=u/f;this.vbar.call(a.setTranslate,n,u+d*this._vbarTranslateMax)}}}}),EV=de({"src/components/updatemenus/draw.js"(e,r){"use strict";var t=Yr(),i=Es(),a=ta(),o=hn(),s=Qt(),l=Zo(),n=Ro().arrayEditor,u=Bl().LINE_SPACING,c=qw(),f=SV();r.exports=function(D){var R=D._fullLayout,P=s.filterVisible(R[c.name]);function z(Z){i.autoMargin(D,b(Z))}var I=R._menulayer.selectAll("g."+c.containerClassName).data(P.length>0?[0]:[]);if(I.enter().append("g").classed(c.containerClassName,!0).style("cursor","pointer"),I.exit().each(function(){t.select(this).selectAll("g."+c.headerGroupClassName).each(z)}).remove(),P.length!==0){var L=I.selectAll("g."+c.headerGroupClassName).data(P,h);L.enter().append("g").classed(c.headerGroupClassName,!0);for(var B=s.ensureSingle(I,"g",c.dropdownButtonGroupClassName,function(Z){Z.style("pointer-events","all")}),O=0;O0?[0]:[]);G.enter().append("g").classed(c.containerClassName,!0).style("cursor",L?null:"ew-resize");function W(N){N._commandObserver&&(N._commandObserver.remove(),delete N._commandObserver),i.autoMargin(I,g(N))}if(G.exit().each(function(){t.select(this).selectAll("g."+c.groupClassName).each(W)}).remove(),O.length!==0){var X=G.selectAll("g."+c.groupClassName).data(O,y);X.enter().append("g").classed(c.groupClassName,!0),X.exit().each(W).remove();for(var Z=0;Z0&&(X=X.transition().duration(I.transition.duration).ease(I.transition.easing)),X.attr("transform",l(W-c.gripWidth*.5,I._dims.currentValueTotalHeight))}}function F(z,I){var L=z._dims;return L.inputAreaStart+c.stepInset+(L.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,I))}function D(z,I){var L=z._dims;return Math.min(1,Math.max(0,(I-c.stepInset-L.inputAreaStart)/(L.inputAreaLength-2*c.stepInset-2*L.inputAreaStart)))}function R(z,I,L){var B=L._dims,O=s.ensureSingle(z,"rect",c.railTouchRectClass,function(G){G.call(A,I,z,L).style("pointer-events","all")});O.attr({width:B.inputAreaLength,height:Math.max(B.inputAreaWidth,c.tickOffset+L.ticklen+B.labelHeight)}).call(a.fill,L.bgcolor).attr("opacity",0),o.setTranslate(O,0,B.currentValueTotalHeight)}function P(z,I){var L=I._dims,B=L.inputAreaLength-c.railInset*2,O=s.ensureSingle(z,"rect",c.railRectClass);O.attr({width:B,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,I.bordercolor).call(a.fill,I.bgcolor).style("stroke-width",I.borderwidth+"px"),o.setTranslate(O,c.railInset,(L.inputAreaWidth-c.railWidth)*.5+L.currentValueTotalHeight)}}}),LV=de({"src/components/sliders/index.js"(e,r){"use strict";var t=By();r.exports={moduleType:"component",name:t.name,layoutAttributes:hk(),supplyLayoutDefaults:CV(),draw:DV()}}}),Vw=de({"src/components/rangeslider/attributes.js"(e,r){"use strict";var t=Jo();r.exports={bgcolor:{valType:"color",dflt:t.background,editType:"plot"},bordercolor:{valType:"color",dflt:t.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),dk=de({"src/components/rangeslider/oppaxis_attributes.js"(e,r){"use strict";r.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),Gw=de({"src/components/rangeslider/constants.js"(e,r){"use strict";r.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),FV=de({"src/components/rangeslider/helpers.js"(e){"use strict";var r=Hs(),t=Zo(),i=Gw(),a=Bl().LINE_SPACING,o=i.name;function s(l){var n=l&&l[o];return n&&n.visible}e.isVisible=s,e.makeData=function(l){for(var n=r.list({_fullLayout:l},"x",!0),u=l.margin,c=[],f=0;f=ye.max)pe=te[xe+1];else if(ce=ye.pmax)pe=te[xe+1];else if(ce0?A.touches[0].clientX:0}function m(A,b,E,T){if(b._context.staticPlot)return;var F=A.select("rect."+p.slideBoxClassName).node(),D=A.select("rect."+p.grabAreaMinClassName).node(),R=A.select("rect."+p.grabAreaMaxClassName).node();function P(){var z=t.event,I=z.target,L=g(z),B=L-A.node().getBoundingClientRect().left,O=T.d2p(E._rl[0]),G=T.d2p(E._rl[1]),W=h.coverSlip();this.addEventListener("touchmove",X),this.addEventListener("touchend",Z),W.addEventListener("mousemove",X),W.addEventListener("mouseup",Z);function X(J){var N=g(J),H=+N-L,$,U,V;switch(I){case F:if(V="ew-resize",O+H>E._length||G+H<0)return;$=O+H,U=G+H;break;case D:if(V="col-resize",O+H>E._length)return;$=O+H,U=G;break;case R:if(V="col-resize",G+H<0)return;$=O,U=G+H;break;default:V="ew-resize",$=B,U=B+H;break}if(U<$){var j=U;U=$,$=j}T._pixelMin=$,T._pixelMax=U,d(t.select(W),V),y(A,b,E,T)}function Z(){W.removeEventListener("mousemove",X),W.removeEventListener("mouseup",Z),this.removeEventListener("touchmove",X),this.removeEventListener("touchend",Z),o.removeElement(W)}}A.on("mousedown",P),A.on("touchstart",P)}function y(A,b,E,T){function F(P){return E.l2r(o.constrain(P,T._rl[0],T._rl[1]))}var D=F(T.p2d(T._pixelMin)),R=F(T.p2d(T._pixelMax));window.requestAnimationFrame(function(){i.call("_guiRelayout",b,E._name+".range",[D,R])})}function _(A,b,E,T,F,D){var R=p.handleWidth/2;function P(J){return o.constrain(J,0,T._width)}function z(J){return o.constrain(J,0,T._height)}function I(J){return o.constrain(J,-R,T._width+R)}var L=P(T.d2p(E._rl[0])),B=P(T.d2p(E._rl[1]));if(A.select("rect."+p.slideBoxClassName).attr("x",L).attr("width",B-L),A.select("rect."+p.maskMinClassName).attr("width",L),A.select("rect."+p.maskMaxClassName).attr("x",B).attr("width",T._width-B),D.rangemode!=="match"){var O=T._height-z(T.d2pOppAxis(F._rl[1])),G=T._height-z(T.d2pOppAxis(F._rl[0]));A.select("rect."+p.maskMinOppAxisClassName).attr("x",L).attr("height",O).attr("width",B-L),A.select("rect."+p.maskMaxOppAxisClassName).attr("x",L).attr("y",G).attr("height",T._height-G).attr("width",B-L),A.select("rect."+p.slideBoxClassName).attr("y",O).attr("height",G-O)}var W=.5,X=Math.round(I(L-R))-W,Z=Math.round(I(B-R))+W;A.select("g."+p.grabberMinClassName).attr("transform",s(X,W)),A.select("g."+p.grabberMaxClassName).attr("transform",s(Z,W))}function v(A,b,E,T){var F=o.ensureSingle(A,"rect",p.bgClassName,function(z){z.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),D=T.borderwidth%2===0?T.borderwidth:T.borderwidth-1,R=-T._offsetShift,P=l.crispRound(b,T.borderwidth);F.attr({width:T._width+D,height:T._height+D,transform:s(R,R),"stroke-width":P}).call(n.stroke,T.bordercolor).call(n.fill,T.bgcolor)}function x(A,b,E,T){var F=b._fullLayout,D=o.ensureSingleById(F._topdefs,"clipPath",T._clipId,function(R){R.append("rect").attr({x:0,y:0})});D.select("rect").attr({width:T._width,height:T._height})}function S(A,b,E,T){var F=b.calcdata,D=A.selectAll("g."+p.rangePlotClassName).data(E._subplotsWith,o.identity);D.enter().append("g").attr("class",function(P){return p.rangePlotClassName+" "+P}).call(l.setClipUrl,T._clipId,b),D.order(),D.exit().remove();var R;D.each(function(P,z){var I=t.select(this),L=z===0,B=f.getFromId(b,P,"y"),O=B._name,G=T[O],W={data:[],layout:{xaxis:{type:E.type,domain:[0,1],range:T.range.slice(),calendar:E.calendar},width:T._width,height:T._height,margin:{t:0,b:0,l:0,r:0}},_context:b._context};E.rangebreaks&&(W.layout.xaxis.rangebreaks=E.rangebreaks),W.layout[O]={type:B.type,domain:[0,1],range:G.rangemode!=="match"?G.range.slice():B.range.slice(),calendar:B.calendar},B.rangebreaks&&(W.layout[O].rangebreaks=B.rangebreaks),a.supplyDefaults(W);var X=W._fullLayout.xaxis,Z=W._fullLayout[O];X.clearCalc(),X.setScale(),Z.clearCalc(),Z.setScale();var J={id:P,plotgroup:I,xaxis:X,yaxis:Z,isRangePlot:!0};L?R=J:(J.mainplot="xy",J.mainplotinfo=R),c.rangePlot(b,J,M(F,P))})}function M(A,b){for(var E=[],T=0;T0);if(x){var S=u(h,d,p);_("x",S[0]),_("y",S[1]),t.noneOrAll(f,h,["x","y"]),_("xanchor"),_("yanchor"),t.coerceFont(_,"font",d.font);var M=_("bgcolor");_("activecolor",i.contrast(M,l.lightAmount,l.darkAmount)),_("bordercolor"),_("borderwidth")}};function n(c,f,h,d){var p=d.calendar;function g(_,v){return t.coerce(c,f,s.buttons,_,v)}var m=g("visible");if(m){var y=g("step");y!=="all"&&(p&&p!=="gregorian"&&(y==="month"||y==="year")?f.stepmode="backward":g("stepmode"),g("count")),g("label")}}function u(c,f,h){for(var d=h.filter(function(y){return f[y].anchor===c._id}),p=0,g=0;g1)){delete p.grid;return}if(!_&&!v&&!x){var E=k("pattern")==="independent";E&&(_=!0)}w._hasSubplotGrid=_;var T=k("roworder"),F=T==="top to bottom",D=_?.2:.1,R=_?.3:.1,P,z;S&&p._splomGridDflt&&(P=p._splomGridDflt.xside,z=p._splomGridDflt.yside),w._domains={x:c("x",k,D,P,b),y:c("y",k,R,z,A,F)}}function c(d,p,g,m,y,_){var v=p(d+"gap",g),x=p("domain."+d);p(d+"side",m);for(var S=new Array(y),M=x[0],C=(x[1]-M)/(y-v),w=C*(1-v),k=0;k0,m=n._context.staticPlot;u.each(function(y){var _=y[0].trace,v=_.error_x||{},x=_.error_y||{},S;_.ids&&(S=function(k){return k.id});var M=o.hasMarkers(_)&&_.marker.maxdisplayed>0;!x.visible&&!v.visible&&(y=[]);var C=t.select(this).selectAll("g.errorbar").data(y,S);if(C.exit().remove(),!!y.length){v.visible||C.selectAll("path.xerror").remove(),x.visible||C.selectAll("path.yerror").remove(),C.style("opacity",1);var w=C.enter().append("g").classed("errorbar",!0);g&&w.style("opacity",0).transition().duration(f.duration).style("opacity",1),a.setClipUrl(C,c.layerClipId,n),C.each(function(k){var A=t.select(this),b=s(k,d,p);if(!(M&&!k.vis)){var E,T=A.select("path.yerror");if(x.visible&&i(b.x)&&i(b.yh)&&i(b.ys)){var F=x.width;E="M"+(b.x-F)+","+b.yh+"h"+2*F+"m-"+F+",0V"+b.ys,b.noYS||(E+="m-"+F+",0h"+2*F),h=!T.size(),h?T=A.append("path").style("vector-effect",m?"none":"non-scaling-stroke").classed("yerror",!0):g&&(T=T.transition().duration(f.duration).ease(f.easing)),T.attr("d",E)}else T.remove();var D=A.select("path.xerror");if(v.visible&&i(b.y)&&i(b.xh)&&i(b.xs)){var R=(v.copy_ystyle?x:v).width;E="M"+b.xh+","+(b.y-R)+"v"+2*R+"m0,-"+R+"H"+b.xs,b.noXS||(E+="m0,-"+R+"v"+2*R),h=!D.size(),h?D=A.append("path").style("vector-effect",m?"none":"non-scaling-stroke").classed("xerror",!0):g&&(D=D.transition().duration(f.duration).ease(f.easing)),D.attr("d",E)}else D.remove()}})}})};function s(l,n,u){var c={x:n.c2p(l.x),y:u.c2p(l.y)};return l.yh!==void 0&&(c.yh=u.c2p(l.yh),c.ys=u.c2p(l.ys),i(c.ys)||(c.noYS=!0,c.ys=u.c2p(l.ys,!0))),l.xh!==void 0&&(c.xh=n.c2p(l.xh),c.xs=n.c2p(l.xs),i(c.xs)||(c.noXS=!0,c.xs=n.c2p(l.xs,!0))),c}}}),GV=de({"src/components/errorbars/style.js"(e,r){"use strict";var t=Yr(),i=ta();r.exports=function(o){o.each(function(s){var l=s[0].trace,n=l.error_y||{},u=l.error_x||{},c=t.select(this);c.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(i.stroke,n.color),u.copy_ystyle&&(u=n),c.selectAll("path.xerror").style("stroke-width",u.thickness+"px").call(i.stroke,u.color)})}}}),HV=de({"src/components/errorbars/index.js"(e,r){"use strict";var t=Qt(),i=Ps().overrideAll,a=mk(),o={error_x:t.extendFlat({},a),error_y:t.extendFlat({},a)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var s={error_x:t.extendFlat({},a),error_y:t.extendFlat({},a),error_z:t.extendFlat({},a)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,r.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:i(s,"calc","nested"),scattergl:i(o,"calc","nested")}},supplyDefaults:UV(),calc:qV(),makeComputeError:gk(),plot:VV(),style:GV(),hoverInfo:l};function l(n,u,c){(u.error_y||{}).visible&&(c.yerr=n.yh-n.y,u.error_y.symmetric||(c.yerrneg=n.y-n.ys)),(u.error_x||{}).visible&&(c.xerr=n.xh-n.x,u.error_x.symmetric||(c.xerrneg=n.x-n.xs))}}}),$V=de({"src/components/colorbar/constants.js"(e,r){"use strict";r.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),WV=de({"src/components/colorbar/draw.js"(e,r){"use strict";var t=Yr(),i=Es(),a=Ma(),o=nn(),s=Uc(),l=Qt(),n=l.strTranslate,u=fn().extendFlat,c=md(),f=hn(),h=ta(),d=xv(),p=Zo(),g=Wu().flipScale,m=zy(),y=Nw(),_=Mu(),v=Bl(),x=v.LINE_SPACING,S=v.FROM_TL,M=v.FROM_BR,C=$V().cn;function w(R){var P=R._fullLayout,z=P._infolayer.selectAll("g."+C.colorbar).data(k(R),function(I){return I._id});z.enter().append("g").attr("class",function(I){return I._id}).classed(C.colorbar,!0),z.each(function(I){var L=t.select(this);l.ensureSingle(L,"rect",C.cbbg),l.ensureSingle(L,"g",C.cbfills),l.ensureSingle(L,"g",C.cblines),l.ensureSingle(L,"g",C.cbaxis,function(O){O.classed(C.crisp,!0)}),l.ensureSingle(L,"g",C.cbtitleunshift,function(O){O.append("g").classed(C.cbtitle,!0)}),l.ensureSingle(L,"rect",C.cboutline);var B=E(L,I,R);B&&B.then&&(R._promises||[]).push(B),R._context.edits.colorbarPosition&&T(L,I,R)}),z.exit().each(function(I){i.autoMargin(R,I._id)}).remove(),z.order()}function k(R){var P=R._fullLayout,z=R.calcdata,I=[],L,B,O,G;function W(Y){return u(Y,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function X(){typeof G.calc=="function"?G.calc(R,O,L):(L._fillgradient=B.reversescale?g(B.colorscale):B.colorscale,L._zrange=[B[G.min],B[G.max]])}for(var Z=0;Z[Math.min(R[0]+P,R[1]),R[1]],b=(R,P)=>[R[0],Math.max(R[1]-P,R[0])];function E(R,P,z){var I=P.orientation==="v",L=P.len,B=P.lenmode,O=P.thickness,G=P.thicknessmode,W=P.outlinewidth,X=P.borderwidth,Z=P.bgcolor,J=P.xanchor,N=P.yanchor,H=P.xpad,$=P.ypad,U=P.x,V=I?P.y:1-P.y,j=P.yref==="paper",q=P.xref==="paper",Y=z._fullLayout,K=Y._size,te=P._fillcolor,ne=P._line,se=P.title,le=se.side,ce=P._zrange||t.extent((typeof te=="function"?te:ne.color).domain()),pe=typeof ne.color=="function"?ne.color:function(){return ne.color},xe=typeof te=="function"?te:function(){return te},ye=P._levels,fe=F(z,P,ce),ae=fe.fill,ee=fe.line,ie=Math.round(O*(G==="fraction"?I?K.w:K.h:1)),Q=ie/(I?K.w:K.h),ue=Math.round(L*(B==="fraction"?I?K.h:K.w:1)),ge=ue/(I?K.h:K.w),Me=q?K.w:z._fullLayout.width,Te=j?K.h:z._fullLayout.height,je=Math.round(I?U*Me+H:V*Te+$),Ve={center:.5,right:1}[J]||0,Ze={top:1,middle:.5}[N]||0,Ke=I?U-Ve*Q:V-Ze*Q,vt=I?V-Ze*ge:U-Ve*ge,xt=Math.round(I?Te*(1-vt):Me*vt);P._lenFrac=ge,P._thickFrac=Q,P._uFrac=Ke,P._vFrac=vt;var Pt=P._axis=D(z,P,ce);Pt.position=Q+(I?U+H/K.w:V+$/K.h);var mt=["top","bottom"].indexOf(le)!==-1;if(I&&mt&&(Pt.title.side=le,Pt.titlex=U+H/K.w,Pt.titley=vt+(se.side==="top"?ge-$/K.h:$/K.h)),!I&&!mt&&(Pt.title.side=le,Pt.titley=V+$/K.h,Pt.titlex=vt+H/K.w),ne.color&&P.tickmode==="auto"){Pt.tickmode="linear",Pt.tick0=ye.start;var Mt=ye.size,lt=l.constrain(ue/50,4,15)+1,qe=(ce[1]-ce[0])/((P.nticks||lt)*Mt);if(qe>1){var Ye=Math.pow(10,Math.floor(Math.log(qe)/Math.LN10));Mt*=Ye*l.roundUp(qe/Ye,[2,5,10]),(Math.abs(ye.start)/ye.size+1e-6)%1<2e-6&&(Pt.tick0=0)}Pt.dtick=Mt}var me=I?$/K.h:H/K.w;Pt.domain=b(A([vt,vt+ge],me),me),Pt.setScale(),R.attr("transform",n(Math.round(K.l),Math.round(K.t)));var _e=R.select("."+C.cbtitleunshift).attr("transform",n(-Math.round(K.l),-Math.round(K.t))),Ae=Pt.ticklabelposition,ke=Pt.title.font.size,Ee=R.select("."+C.cbaxis),De,Je=0,Ue=0;function at(Gt,fr){var gt={propContainer:Pt,propName:P._propPrefix+"title.text",traceIndex:P._traceIndex,_meta:P._meta,placeholder:Y._dfltTitle.colorbar,containerGroup:R.select("."+C.cbtitle)},yt=Gt.charAt(0)==="h"?Gt.slice(1):"h"+Gt;R.selectAll("."+yt+",."+yt+"-math-group").remove(),d.draw(z,Gt,u(gt,fr||{}))}function rt(){if(I&&mt||!I&&!mt){var Gt,fr;le==="top"&&(Gt=H+K.l+Me*U,fr=$+K.t+Te*(1-vt-ge)+3+ke*.75),le==="bottom"&&(Gt=H+K.l+Me*U,fr=$+K.t+Te*(1-vt)-3-ke*.25),le==="right"&&(fr=$+K.t+Te*V+3+ke*.75,Gt=H+K.l+Me*vt),at(Pt._id+"title",{attributes:{x:Gt,y:fr,"text-anchor":I?"start":"middle"}})}}function ft(){if(I&&!mt||!I&&mt){var Gt=Pt.position||0,fr=Pt._offset+Pt._length/2,gt,yt;if(le==="right")yt=fr,gt=K.l+Me*Gt+10+ke*(Pt.showticklabels?1:.5);else if(gt=fr,le==="bottom"&&(yt=K.t+Te*Gt+10+(Ae.indexOf("inside")===-1?Pt.tickfont.size:0)+(Pt.ticks!=="inside"&&P.ticklen||0)),le==="top"){var kt=se.text.split("
").length;yt=K.t+Te*Gt+10-ie-x*ke*kt}at((I?"h":"v")+Pt._id+"title",{avoid:{selection:t.select(z).selectAll("g."+Pt._id+"tick"),side:le,offsetTop:I?0:K.t,offsetLeft:I?K.l:0,maxShift:I?Y.width:Y.height},attributes:{x:gt,y:yt,"text-anchor":"middle"},transform:{rotate:I?-90:0,offset:0}})}}function At(){if(!I&&!mt||I&&mt){var Gt=R.select("."+C.cbtitle),fr=Gt.select("text"),gt=[-W/2,W/2],yt=Gt.select(".h"+Pt._id+"title-math-group").node(),kt=15.6;fr.node()&&(kt=parseInt(fr.node().style.fontSize,10)*x);var Lt;if(yt?(Lt=f.bBox(yt),Ue=Lt.width,Je=Lt.height,Je>kt&&(gt[1]-=(Je-kt)/2)):fr.node()&&!fr.classed(C.jsPlaceholder)&&(Lt=f.bBox(fr.node()),Ue=Lt.width,Je=Lt.height),I){if(Je){if(Je+=5,le==="top")Pt.domain=b(Pt.domain,Je/K.h),gt[1]*=-1;else{Pt.domain=A(Pt.domain,Je/K.h);var Ct=p.lineCount(fr);gt[1]+=(1-Ct)*kt}Gt.attr("transform",n(gt[0],gt[1])),Pt.setScale()}}else Ue&&(le==="right"&&(Pt.domain=A(Pt.domain,(Ue+ke/2)/K.w)),Gt.attr("transform",n(gt[0],gt[1])),Pt.setScale())}R.selectAll("."+C.cbfills+",."+C.cblines).attr("transform",I?n(0,Math.round(K.h*(1-Pt.domain[1]))):n(Math.round(K.w*Pt.domain[0]),0)),Ee.attr("transform",I?n(0,Math.round(-K.t)):n(Math.round(-K.l),0));var $t=R.select("."+C.cbfills).selectAll("rect."+C.cbfill).attr("style","").data(ae);$t.enter().append("rect").classed(C.cbfill,!0).attr("style",""),$t.exit().remove();var mr=ce.map(Pt.c2p).map(Math.round).sort(function(Ai,oi){return Ai-oi});$t.each(function(Ai,oi){var Qr=[oi===0?ce[0]:(ae[oi]+ae[oi-1])/2,oi===ae.length-1?ce[1]:(ae[oi]+ae[oi+1])/2].map(Pt.c2p).map(Math.round);I&&(Qr[1]=l.constrain(Qr[1]+(Qr[1]>Qr[0])?1:-1,mr[0],mr[1]));var ea=t.select(this).attr(I?"x":"y",je).attr(I?"y":"x",t.min(Qr)).attr(I?"width":"height",Math.max(ie,2)).attr(I?"height":"width",Math.max(t.max(Qr)-t.min(Qr),2));if(P._fillgradient)f.gradient(ea,z,P._id,I?"vertical":"horizontalreversed",P._fillgradient,"fill");else{var $i=xe(Ai).replace("e-","");ea.attr("fill",h.hexString($i))}});var br=R.select("."+C.cblines).selectAll("path."+C.cbline).data(ne.color&&ne.width?ee:[]);br.enter().append("path").classed(C.cbline,!0),br.exit().remove(),br.each(function(Ai){var oi=je,Qr=Math.round(Pt.c2p(Ai))+ne.width/2%1;t.select(this).attr("d","M"+(I?oi+","+Qr:Qr+","+oi)+(I?"h":"v")+ie).call(f.lineGroupStyle,ne.width,pe(Ai),ne.dash)}),Ee.selectAll("g."+Pt._id+"tick,path").remove();var Er=je+ie+(W||0)/2-(P.ticks==="outside"?1:0),Tr=o.calcTicks(Pt),Ur=o.getTickSigns(Pt)[2];return o.drawTicks(z,Pt,{vals:Pt.ticks==="inside"?o.clipEnds(Pt,Tr):Tr,layer:Ee,path:o.makeTickPath(Pt,Er,Ur),transFn:o.makeTransTickFn(Pt)}),o.drawLabels(z,Pt,{vals:Tr,layer:Ee,transFn:o.makeTransTickLabelFn(Pt),labelFns:o.makeLabelFns(Pt,Er)})}function ht(){var Gt,fr=ie+W/2;Ae.indexOf("inside")===-1&&(Gt=f.bBox(Ee.node()),fr+=I?Gt.width:Gt.height),De=_e.select("text");var gt=0,yt=I&&le==="top",kt=!I&&le==="right",Lt=0;if(De.node()&&!De.classed(C.jsPlaceholder)){var Ct,$t=_e.select(".h"+Pt._id+"title-math-group").node();$t&&(I&&mt||!I&&!mt)?(Gt=f.bBox($t),gt=Gt.width,Ct=Gt.height):(Gt=f.bBox(_e.node()),gt=Gt.right-K.l-(I?je:xt),Ct=Gt.bottom-K.t-(I?xt:je),!I&&le==="top"&&(fr+=Gt.height,Lt=Gt.height)),kt&&(De.attr("transform",n(gt/2+ke/2,0)),gt*=2),fr=Math.max(fr,I?gt:Ct)}var mr=(I?H:$)*2+fr+X+W/2,br=0;!I&&se.text&&N==="bottom"&&V<=0&&(br=mr/2,mr+=br,Lt+=br),Y._hColorbarMoveTitle=br,Y._hColorbarMoveCBTitle=Lt;var Er=X+W,Tr=(I?je:xt)-Er/2-(I?H:0),Ur=(I?xt:je)-(I?ue:$+Lt-br);R.select("."+C.cbbg).attr("x",Tr).attr("y",Ur).attr(I?"width":"height",Math.max(mr-br,2)).attr(I?"height":"width",Math.max(ue+Er,2)).call(h.fill,Z).call(h.stroke,P.bordercolor).style("stroke-width",X);var Ai=kt?Math.max(gt-10,0):0;R.selectAll("."+C.cboutline).attr("x",(I?je:xt+H)+Ai).attr("y",(I?xt+$-ue:je)+(yt?Je:0)).attr(I?"width":"height",Math.max(ie,2)).attr(I?"height":"width",Math.max(ue-(I?2*$+Je:2*H+Ai),2)).call(h.stroke,P.outlinecolor).style({fill:"none","stroke-width":W});var oi=I?Ve*mr:0,Qr=I?0:(1-Ze)*mr-Lt;if(oi=q?K.l-oi:-oi,Qr=j?K.t-Qr:-Qr,R.attr("transform",n(oi,Qr)),!I&&(X||h.opacity(Z)&&!h.equals(Y.paper_bgcolor,Z))){var ea=Ee.selectAll("text"),$i=ea[0].length,ja=R.select("."+C.cbbg).node(),ya=f.bBox(ja),pa=f.getTranslate(R),xi=2;ea.each(function(zt,Wt){var Yt=0,ze=$i-1;if(Wt===Yt||Wt===ze){var tt=f.bBox(this),ct=f.getTranslate(this),wt;if(Wt===ze){var Nt=tt.right+ct.x,It=ya.right+pa.x+xt-X-xi+U;wt=It-Nt,wt>0&&(wt=0)}else if(Wt===Yt){var Zt=tt.left+ct.x,qt=ya.left+pa.x+xt+X+xi;wt=qt-Zt,wt<0&&(wt=0)}wt&&($i<3?this.setAttribute("transform","translate("+wt+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var bi={},Ua=S[J],dn=M[J],pi=S[N],Jr=M[N],Be=mr-ie;I?(B==="pixels"?(bi.y=V,bi.t=ue*pi,bi.b=ue*Jr):(bi.t=bi.b=0,bi.yt=V+L*pi,bi.yb=V-L*Jr),G==="pixels"?(bi.x=U,bi.l=mr*Ua,bi.r=mr*dn):(bi.l=Be*Ua,bi.r=Be*dn,bi.xl=U-O*Ua,bi.xr=U+O*dn)):(B==="pixels"?(bi.x=U,bi.l=ue*Ua,bi.r=ue*dn):(bi.l=bi.r=0,bi.xl=U+L*Ua,bi.xr=U-L*dn),G==="pixels"?(bi.y=1-V,bi.t=mr*pi,bi.b=mr*Jr):(bi.t=Be*pi,bi.b=Be*Jr,bi.yt=V-O*pi,bi.yb=V+O*Jr));var Fe=P.y<.5?"b":"t",Et=P.x<.5?"l":"r";z._fullLayout._reservedMargin[P._id]={};var St={r:Y.width-Tr-oi,l:Tr+bi.r,b:Y.height-Ur-Qr,t:Ur+bi.b};q&&j?i.autoMargin(z,P._id,bi):q?z._fullLayout._reservedMargin[P._id][Fe]=St[Fe]:j||I?z._fullLayout._reservedMargin[P._id][Et]=St[Et]:z._fullLayout._reservedMargin[P._id][Fe]=St[Fe]}return l.syncOrAsync([i.previousPromises,rt,At,ft,i.previousPromises,ht],z)}function T(R,P,z){var I=P.orientation==="v",L=z._fullLayout,B=L._size,O,G,W;s.init({element:R.node(),gd:z,prepFn:function(){O=R.attr("transform"),c(R)},moveFn:function(X,Z){R.attr("transform",O+n(X,Z)),G=s.align((I?P._uFrac:P._vFrac)+X/B.w,I?P._thickFrac:P._lenFrac,0,1,P.xanchor),W=s.align((I?P._vFrac:1-P._uFrac)-Z/B.h,I?P._lenFrac:P._thickFrac,0,1,P.yanchor);var J=s.getCursor(G,W,P.xanchor,P.yanchor);c(R,J)},doneFn:function(){if(c(R),G!==void 0&&W!==void 0){var X={};X[P._propPrefix+"x"]=G,X[P._propPrefix+"y"]=W,P._traceIndex!==void 0?a.call("_guiRestyle",z,X,P._traceIndex):a.call("_guiRelayout",z,X)}}})}function F(R,P,z){var I=P._levels,L=[],B=[],O,G,W=I.end+I.size/100,X=I.size,Z=1.001*z[0]-.001*z[1],J=1.001*z[1]-.001*z[0];for(G=0;G<1e5&&(O=I.start+G*X,!(X>0?O>=W:O<=W));G++)O>Z&&O0?O>=W:O<=W));G++)O>z[0]&&O-1}r.exports=function(u,c){var f,h=u.data,d=u.layout,p=o([],h),g=o({},d,s(c.tileClass)),m=u._context||{};if(c.width&&(g.width=c.width),c.height&&(g.height=c.height),c.tileClass==="thumbnail"||c.tileClass==="themes__thumb"){g.annotations=[];var y=Object.keys(g);for(f=0;f=0)return m}else if(typeof m=="string"&&(m=m.trim(),m.slice(-1)==="%"&&t(m.slice(0,-1))&&(m=+m.slice(0,-1),m>=0)))return m+"%"}function g(m,y,_,v,x,S){S=S||{};var M=S.moduleHasSelected!==!1,C=S.moduleHasUnselected!==!1,w=S.moduleHasConstrain!==!1,k=S.moduleHasCliponaxis!==!1,A=S.moduleHasTextangle!==!1,b=S.moduleHasInsideanchor!==!1,E=!!S.hasPathbar,T=Array.isArray(x)||x==="auto",F=T||x==="inside",D=T||x==="outside";if(F||D){var R=f(v,"textfont",_.font),P=i.extendFlat({},R),z=m.textfont&&m.textfont.color,I=!z;if(I&&delete P.color,f(v,"insidetextfont",P),E){var L=i.extendFlat({},R);I&&delete L.color,f(v,"pathbar.textfont",L)}D&&f(v,"outsidetextfont",R),M&&v("selected.textfont.color"),C&&v("unselected.textfont.color"),w&&v("constraintext"),k&&v("cliponaxis"),A&&v("textangle"),v("texttemplate"),v("texttemplatefallback")}F&&b&&v("insidetextanchor")}r.exports={supplyDefaults:h,crossTraceDefaults:d,handleText:g,validateCornerradius:p}}}),_k=de({"src/traces/bar/layout_defaults.js"(e,r){"use strict";var t=Ma(),i=nn(),a=Qt(),o=$w(),s=oh().validateCornerradius;r.exports=function(l,n,u){function c(M,C){return a.coerce(l,n,o,M,C)}for(var f=!1,h=!1,d=!1,p={},g=c("barmode"),m=g==="group",y=0;y0&&!p[v]&&(d=!0),p[v]=!0),_.visible&&_.type==="histogram"){var x=i.getFromId({_fullLayout:n},_[_.orientation==="v"?"xaxis":"yaxis"]);x.type!=="category"&&(h=!0)}}if(!f){delete n.barmode;return}g!=="overlay"&&c("barnorm"),c("bargap",h&&!d?0:.2),c("bargroupgap");var S=c("barcornerradius");n.barcornerradius=s(S)}}}),Oy=de({"src/traces/bar/arrays_to_calcdata.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){for(var s=0;sn;if(!u)return o}return s!==void 0?s:a.dflt},e.coerceColor=function(a,o,s){return r.isValid(o)?o:s!==void 0?s:a.dflt},e.coerceEnumerated=function(a,o,s){return a.coerceNumber&&(o=+o),a.values.indexOf(o)!==-1?o:s!==void 0?s:a.dflt},e.getValue=function(a,o){var s;return i(a)?o1||E.bargap===0&&E.bargroupgap===0&&!T[0].trace.marker.line.width)&&t.select(this).attr("shape-rendering","crispEdges")}),A.selectAll("g.points").each(function(T){var F=t.select(this),D=T[0].trace;p(F,D,k)}),s.getComponentMethod("errorbars","style")(A)}function p(k,A,b){a.pointStyle(k.selectAll("path"),A,b),g(k,A,b)}function g(k,A,b){k.selectAll("text").each(function(E){var T=t.select(this),F=o.ensureUniformFontSize(b,v(T,E,A,b));a.font(T,F)})}function m(k,A,b){var E=A[0].trace;E.selectedpoints?y(b,E,k):(p(b,E,k),s.getComponentMethod("errorbars","style")(b))}function y(k,A,b){a.selectedPointStyle(k.selectAll("path"),A),_(k.selectAll("text"),A,b)}function _(k,A,b){k.each(function(E){var T=t.select(this),F;if(E.selected){F=o.ensureUniformFontSize(b,v(T,E,A,b));var D=A.selected.textfont&&A.selected.textfont.color;D&&(F.color=D),a.font(T,F)}else a.selectedTextStyle(T,A)})}function v(k,A,b,E){var T=E._fullLayout.font,F=b.textfont;if(k.classed("bartext-inside")){var D=w(A,b);F=S(b,A.i,T,D)}else k.classed("bartext-outside")&&(F=M(b,A.i,T));return F}function x(k,A,b){return C(u,k.textfont,A,b)}function S(k,A,b,E){var T=x(k,A,b),F=k._input.textfont===void 0||k._input.textfont.color===void 0||Array.isArray(k.textfont.color)&&k.textfont.color[A]===void 0;return F&&(T={color:i.contrast(E),family:T.family,size:T.size,weight:T.weight,style:T.style,variant:T.variant,textcase:T.textcase,lineposition:T.lineposition,shadow:T.shadow}),C(c,k.insidetextfont,A,T)}function M(k,A,b){var E=x(k,A,b);return C(f,k.outsidetextfont,A,E)}function C(k,A,b,E){A=A||{};var T=h.getValue(A.family,b),F=h.getValue(A.size,b),D=h.getValue(A.color,b),R=h.getValue(A.weight,b),P=h.getValue(A.style,b),z=h.getValue(A.variant,b),I=h.getValue(A.textcase,b),L=h.getValue(A.lineposition,b),B=h.getValue(A.shadow,b);return{family:h.coerceString(k.family,T,E.family),size:h.coerceNumber(k.size,F,E.size),color:h.coerceColor(k.color,D,E.color),weight:h.coerceString(k.weight,R,E.weight),style:h.coerceString(k.style,P,E.style),variant:h.coerceString(k.variant,z,E.variant),textcase:h.coerceString(k.variant,I,E.textcase),lineposition:h.coerceString(k.variant,L,E.lineposition),shadow:h.coerceString(k.variant,B,E.shadow)}}function w(k,A){return A.type==="waterfall"?A[k.dir].marker.color:k.mcc||k.mc||A.marker.color}r.exports={style:d,styleTextPoints:g,styleOnSelect:m,getInsideTextFont:S,getOutsideTextFont:M,getBarColor:w,resizeText:l}}}),Sv=de({"src/traces/bar/plot.js"(e,r){"use strict";var t=Yr(),i=da(),a=Qt(),o=Zo(),s=ta(),l=hn(),n=Ma(),u=nn().tickText,c=dc(),f=c.recordMinTextSize,h=c.clearMinTextSize,d=qh(),p=Yw(),g=y0(),m=ep(),y=m.text,_=m.textposition,v=sf().appendArrayPointValue,x=g.TEXTPAD;function S(X){return X.id}function M(X){if(X.ids)return S}function C(X){return(X>0)-(X<0)}function w(X,Z){return X0}function E(X,Z,J,N,H,$){var U=Z.xaxis,V=Z.yaxis,j=X._fullLayout,q=X._context.staticPlot;H||(H={mode:j.barmode,norm:j.barmode,gap:j.bargap,groupgap:j.bargroupgap},h("bar",j));var Y=a.makeTraceGroups(N,J,"trace bars").each(function(K){var te=t.select(this),ne=K[0].trace,se=K[0].t,le=ne.type==="waterfall",ce=ne.type==="funnel",pe=ne.type==="histogram",xe=ne.type==="bar",ye=xe||ce,fe=0;le&&ne.connector.visible&&ne.connector.mode==="between"&&(fe=ne.connector.line.width/2);var ae=ne.orientation==="h",ee=b(H),ie=a.ensureSingle(te,"g","points"),Q=M(ne),ue=ie.selectAll("g.point").data(a.identity,Q);ue.enter().append("g").classed("point",!0),ue.exit().remove(),ue.each(function(Me,Te){var je=t.select(this),Ve=k(Me,U,V,ae),Ze=Ve[0][0],Ke=Ve[0][1],vt=Ve[1][0],xt=Ve[1][1],Pt=(ae?Ke-Ze:xt-vt)===0;Pt&&ye&&p.getLineWidth(ne,Me)&&(Pt=!1),Pt||(Pt=!i(Ze)||!i(Ke)||!i(vt)||!i(xt)),Me.isBlank=Pt,Pt&&(ae?Ke=Ze:xt=vt),fe&&!Pt&&(ae?(Ze-=w(Ze,Ke)*fe,Ke+=w(Ze,Ke)*fe):(vt-=w(vt,xt)*fe,xt+=w(vt,xt)*fe));var mt,Mt;if(ne.type==="waterfall"){if(!Pt){var lt=ne[Me.dir].marker;mt=lt.line.width,Mt=lt.color}}else mt=p.getLineWidth(ne,Me),Mt=Me.mc||ne.marker.color;function qe(br){var Er=t.round(mt/2%1,2);return H.gap===0&&H.groupgap===0?t.round(Math.round(br)-Er,2):br}function Ye(br,Er,Tr){return Tr&&br===Er?br:Math.abs(br-Er)>=2?qe(br):br>Er?Math.ceil(br):Math.floor(br)}var me=s.opacity(Mt),_e=me<1||mt>.01?qe:Ye;X._context.staticPlot||(Ze=_e(Ze,Ke,ae),Ke=_e(Ke,Ze,ae),vt=_e(vt,xt,!ae),xt=_e(xt,vt,!ae));var Ae=ae?U.c2p:V.c2p,ke;Me.s0>0?ke=Me._sMax:Me.s0<0?ke=Me._sMin:ke=Me.s1>0?Me._sMax:Me._sMin;function Ee(br,Er){if(!br)return 0;var Tr=Math.abs(ae?xt-vt:Ke-Ze),Ur=Math.abs(ae?Ke-Ze:xt-vt),Ai=_e(Math.abs(Ae(ke,!0)-Ae(0,!0))),oi=Me.hasB?Math.min(Tr/2,Ur/2):Math.min(Tr/2,Ai),Qr;if(Er==="%"){var ea=Math.min(50,br);Qr=Tr*(ea/100)}else Qr=br;return _e(Math.max(Math.min(Qr,oi),0))}var De=xe||pe?Ee(se.cornerradiusvalue,se.cornerradiusform):0,Je,Ue,at="M"+Ze+","+vt+"V"+xt+"H"+Ke+"V"+vt+"Z",rt=0;if(De&&Me.s){var ft=C(Me.s0)===0||C(Me.s)===C(Me.s0)?Me.s1:Me.s0;if(rt=_e(Me.hasB?0:Math.abs(Ae(ke,!0)-Ae(ft,!0))),rt0?Math.sqrt(rt*(2*De-rt)):0,yt=At>0?Math.max:Math.min;Je="M"+Ze+","+vt+"V"+(xt-fr*ht)+"H"+yt(Ke-(De-rt)*At,Ze)+"A "+De+","+De+" 0 0 "+Gt+" "+Ke+","+(xt-De*ht-gt)+"V"+(vt+De*ht+gt)+"A "+De+","+De+" 0 0 "+Gt+" "+yt(Ke-(De-rt)*At,Ze)+","+(vt+fr*ht)+"Z"}else if(Me.hasB)Je="M"+(Ze+De*At)+","+vt+"A "+De+","+De+" 0 0 "+Gt+" "+Ze+","+(vt+De*ht)+"V"+(xt-De*ht)+"A "+De+","+De+" 0 0 "+Gt+" "+(Ze+De*At)+","+xt+"H"+(Ke-De*At)+"A "+De+","+De+" 0 0 "+Gt+" "+Ke+","+(xt-De*ht)+"V"+(vt+De*ht)+"A "+De+","+De+" 0 0 "+Gt+" "+(Ke-De*At)+","+vt+"Z";else{Ue=Math.abs(xt-vt)+rt;var kt=Ue0?Math.sqrt(rt*(2*De-rt)):0,Ct=ht>0?Math.max:Math.min;Je="M"+(Ze+kt*At)+","+vt+"V"+Ct(xt-(De-rt)*ht,vt)+"A "+De+","+De+" 0 0 "+Gt+" "+(Ze+De*At-Lt)+","+xt+"H"+(Ke-De*At+Lt)+"A "+De+","+De+" 0 0 "+Gt+" "+(Ke-kt*At)+","+Ct(xt-(De-rt)*ht,vt)+"V"+vt+"Z"}}else Je=at}else Je=at;var $t=A(a.ensureSingle(je,"path"),j,H,$);if($t.style("vector-effect",q?"none":"non-scaling-stroke").attr("d",isNaN((Ke-Ze)*(xt-vt))||Pt&&X._context.staticPlot?"M0,0Z":Je).call(l.setClipUrl,Z.layerClipId,X),!j.uniformtext.mode&&ee){var mr=l.makePointStyleFns(ne);l.singlePointStyle(Me,$t,ne,mr,X)}T(X,Z,je,K,Te,Ze,Ke,vt,xt,De,rt,H,$),Z.layerClipId&&l.hideOutsideRangePoint(Me,je.select("text"),U,V,ne.xcalendar,ne.ycalendar)});var ge=ne.cliponaxis===!1;l.setClipUrl(te,ge?null:Z.layerClipId,X)});n.getComponentMethod("errorbars","plot")(X,Y,Z,H)}function T(X,Z,J,N,H,$,U,V,j,q,Y,K,te){var ne=Z.xaxis,se=Z.yaxis,le=X._fullLayout,ce;function pe(at,rt,ft){var At=a.ensureSingle(at,"text").text(rt).attr({class:"bartext bartext-"+ce,"text-anchor":"middle","data-notex":1}).call(l.font,ft).call(o.convertToTspans,X);return At}var xe=N[0].trace,ye=xe.orientation==="h",fe=O(N,ye,ne,se),ae=L(le,N,H,ne,se);ce=B(xe,H);var ee=K.mode==="stack"||K.mode==="relative",ie=N[H],Q=!ee||ie._outmost,ue=ie.hasB,ge=q&&q-Y>x;if(!ae||ce==="none"||(ie.isBlank||$===U||V===j)&&(ce==="auto"||ce==="inside")){J.select("text").remove();return}var Me=le.font,Te=d.getBarColor(N[H],xe),je=d.getInsideTextFont(xe,H,Me,Te),Ve=d.getOutsideTextFont(xe,H,Me),Ze=xe.insidetextanchor||"end",Ke=J.datum();ye?ne.type==="log"&&Ke.s0<=0&&(ne.range[0]0&&Ye>0,Ae;ge?ue?Ae=F(Pt-2*q,mt,qe,Ye,ye)||F(Pt,mt-2*q,qe,Ye,ye):ye?Ae=F(Pt-(q-Y),mt,qe,Ye,ye)||F(Pt,mt-2*(q-Y),qe,Ye,ye):Ae=F(Pt,mt-(q-Y),qe,Ye,ye)||F(Pt-2*(q-Y),mt,qe,Ye,ye):Ae=F(Pt,mt,qe,Ye,ye),_e&&Ae?ce="inside":(ce="outside",Mt.remove(),Mt=null)}else ce="inside";if(!Mt){me=a.ensureUniformFontSize(X,ce==="outside"?Ve:je),Mt=pe(J,ae,me);var ke=Mt.attr("transform");if(Mt.attr("transform",""),lt=l.bBox(Mt.node()),qe=lt.width,Ye=lt.height,Mt.attr("transform",ke),qe<=0||Ye<=0){Mt.remove();return}}var Ee=xe.textangle,De,Je;ce==="outside"?(Je=xe.constraintext==="both"||xe.constraintext==="outside",De=I($,U,V,j,lt,{isHorizontal:ye,constrained:Je,angle:Ee,zeroBarDir:fe})):(Je=xe.constraintext==="both"||xe.constraintext==="inside",De=P($,U,V,j,lt,{isHorizontal:ye,constrained:Je,angle:Ee,anchor:Ze,hasB:ue,r:q,overhead:Y})),De.fontSize=me.size,f(xe.type==="histogram"?"bar":xe.type,De,le),ie.transform=De;var Ue=A(Mt,le,K,te);a.setTransormAndDisplay(Ue,De)}function F(X,Z,J,N,H){if(X<0||Z<0)return!1;var $=J<=X&&N<=Z,U=J<=Z&&N<=X,V=H?X>=J*(Z/N):Z>=N*(X/J);return $||U||V}function D(X){return X==="auto"?0:X}function R(X,Z){var J=Math.PI/180*Z,N=Math.abs(Math.sin(J)),H=Math.abs(Math.cos(J));return{x:X.width*H+X.height*N,y:X.width*N+X.height*H}}function P(X,Z,J,N,H,$){var U=!!$.isHorizontal,V=!!$.constrained,j=$.angle||0,q=$.anchor,Y=q==="end",K=q==="start",te=$.leftToRight||0,ne=(te+1)/2,se=1-ne,le=$.hasB,ce=$.r,pe=$.overhead,xe=H.width,ye=H.height,fe=Math.abs(Z-X),ae=Math.abs(N-J),ee=fe>2*x&&ae>2*x?x:0;fe-=2*ee,ae-=2*ee;var ie=D(j);j==="auto"&&!(xe<=fe&&ye<=ae)&&(xe>fe||ye>ae)&&(!(xe>ae||ye>fe)||xex){var Me=z(X,Z,J,N,Q,ce,pe,U,le);ue=Me.scale,ge=Me.pad}else ue=1,V&&(ue=Math.min(1,fe/Q.x,ae/Q.y)),ge=0;var Te=H.left*se+H.right*ne,je=(H.top+H.bottom)/2,Ve=(X+x)*se+(Z-x)*ne,Ze=(J+N)/2,Ke=0,vt=0;if(K||Y){var xt=(U?Q.x:Q.y)/2;ce&&(Y||le)&&(ee+=ge);var Pt=U?w(X,Z):w(J,N);U?K?(Ve=X+Pt*ee,Ke=-Pt*xt):(Ve=Z-Pt*ee,Ke=Pt*xt):K?(Ze=J+Pt*ee,vt=-Pt*xt):(Ze=N-Pt*ee,vt=Pt*xt)}return{textX:Te,textY:je,targetX:Ve,targetY:Ze,anchorX:Ke,anchorY:vt,scale:ue,rotate:ie}}function z(X,Z,J,N,H,$,U,V,j){var q=Math.max(0,Math.abs(Z-X)-2*x),Y=Math.max(0,Math.abs(N-J)-2*x),K=$-x,te=U?K-Math.sqrt(K*K-(K-U)*(K-U)):K,ne=j?K*2:V?K-U:2*te,se=j?K*2:V?2*te:K-U,le,ce,pe,xe,ye;return H.y/H.x>=Y/(q-ne)?xe=Y/H.y:H.y/H.x<=(Y-se)/q?xe=q/H.x:!j&&V?(le=H.x*H.x+H.y*H.y/4,ce=-2*H.x*(q-K)-H.y*(Y/2-K),pe=(q-K)*(q-K)+(Y/2-K)*(Y/2-K)-K*K,xe=(-ce+Math.sqrt(ce*ce-4*le*pe))/(2*le)):j?(le=(H.x*H.x+H.y*H.y)/4,ce=-H.x*(q/2-K)-H.y*(Y/2-K),pe=(q/2-K)*(q/2-K)+(Y/2-K)*(Y/2-K)-K*K,xe=(-ce+Math.sqrt(ce*ce-4*le*pe))/(2*le)):(le=H.x*H.x/4+H.y*H.y,ce=-H.x*(q/2-K)-2*H.y*(Y-K),pe=(q/2-K)*(q/2-K)+(Y-K)*(Y-K)-K*K,xe=(-ce+Math.sqrt(ce*ce-4*le*pe))/(2*le)),xe=Math.min(1,xe),V?ye=Math.max(0,K-Math.sqrt(Math.max(0,K*K-(K-(Y-H.y*xe)/2)*(K-(Y-H.y*xe)/2)))-U):ye=Math.max(0,K-Math.sqrt(Math.max(0,K*K-(K-(q-H.x*xe)/2)*(K-(q-H.x*xe)/2)))-U),{scale:xe,pad:ye}}function I(X,Z,J,N,H,$){var U=!!$.isHorizontal,V=!!$.constrained,j=$.angle||0,q=H.width,Y=H.height,K=Math.abs(Z-X),te=Math.abs(N-J),ne;U?ne=te>2*x?x:0:ne=K>2*x?x:0;var se=1;V&&(se=U?Math.min(1,te/Y):Math.min(1,K/q));var le=D(j),ce=R(H,le),pe=(U?ce.x:ce.y)/2,xe=(H.left+H.right)/2,ye=(H.top+H.bottom)/2,fe=(X+Z)/2,ae=(J+N)/2,ee=0,ie=0,Q;return(U?X===Z:J===N)&&$.zeroBarDir?Q=$.zeroBarDir:Q=U?w(Z,X):w(J,N),U?(fe=Z-Q*ne,ee=Q*pe):(ae=N+Q*ne,ie=-Q*pe),{textX:xe,textY:ye,targetX:fe,targetY:ae,anchorX:ee,anchorY:ie,scale:se,rotate:le}}function L(X,Z,J,N,H){var $=Z[0].trace,U=$.texttemplate,V;return U?V=G(X,Z,J,N,H):$.textinfo?V=W(Z,J,N,H):V=p.getValue($.text,J),p.coerceString(y,V)}function B(X,Z){var J=p.getValue(X.textposition,Z);return p.coerceEnumerated(_,J)}function O(X,Z,J,N){for(var H=!1,$=!1,U=0;U0?H=!0:V<0&&($=!0),H&&$)return 0}var j=Z?J:N,q=-w(j.range[0],j.range[1]);return $?H?0:-q:q}function G(X,Z,J,N,H){var $=Z[0].trace,U=a.castOption($,J,"texttemplate");if(!U)return"";var V=$.type==="histogram",j=$.type==="waterfall",q=$.type==="funnel",Y=$.orientation==="h",K,te,ne,se;Y?(K="y",te=H,ne="x",se=N):(K="x",te=N,ne="y",se=H);function le(ee){return u(te,te.c2l(ee),!0).text}function ce(ee){return u(se,se.c2l(ee),!0).text}var pe=Z[J],xe={};xe.label=pe.p,xe.labelLabel=xe[K+"Label"]=le(pe.p);var ye=a.castOption($,pe.i,"text");(ye===0||ye)&&(xe.text=ye),xe.value=pe.s,xe.valueLabel=xe[ne+"Label"]=ce(pe.s);var fe={};v(fe,$,pe.i),(V||fe.x===void 0)&&(fe.x=Y?xe.value:xe.label),(V||fe.y===void 0)&&(fe.y=Y?xe.label:xe.value),(V||fe.xLabel===void 0)&&(fe.xLabel=Y?xe.valueLabel:xe.labelLabel),(V||fe.yLabel===void 0)&&(fe.yLabel=Y?xe.labelLabel:xe.valueLabel),j&&(xe.delta=+pe.rawS||pe.s,xe.deltaLabel=ce(xe.delta),xe.final=pe.v,xe.finalLabel=ce(xe.final),xe.initial=xe.final-xe.delta,xe.initialLabel=ce(xe.initial)),q&&(xe.value=pe.s,xe.valueLabel=ce(xe.value),xe.percentInitial=pe.begR,xe.percentInitialLabel=a.formatPercent(pe.begR),xe.percentPrevious=pe.difR,xe.percentPreviousLabel=a.formatPercent(pe.difR),xe.percentTotal=pe.sumR,xe.percenTotalLabel=a.formatPercent(pe.sumR));var ae=a.castOption($,pe.i,"customdata");return ae&&(xe.customdata=ae),a.texttemplateString({data:[fe,xe,$._meta],fallback:$.texttemplatefallback,labels:xe,locale:X._d3locale,template:U})}function W(X,Z,J,N){var H=X[0].trace,$=H.orientation==="h",U=H.type==="waterfall",V=H.type==="funnel";function j(ae){var ee=$?N:J;return u(ee,ae,!0).text}function q(ae){var ee=$?J:N;return u(ee,+ae,!0).text}var Y=H.textinfo,K=X[Z],te=Y.split("+"),ne=[],se,le=function(ae){return te.indexOf(ae)!==-1};if(le("label")&&ne.push(j(X[Z].p)),le("text")&&(se=a.castOption(H,K.i,"text"),(se===0||se)&&ne.push(se)),U){var ce=+K.rawS||K.s,pe=K.v,xe=pe-ce;le("initial")&&ne.push(q(xe)),le("delta")&&ne.push(q(ce)),le("final")&&ne.push(q(pe))}if(V){le("value")&&ne.push(q(K.s));var ye=0;le("percent initial")&&ye++,le("percent previous")&&ye++,le("percent total")&&ye++;var fe=ye>1;le("percent initial")&&(se=a.formatPercent(K.begR),fe&&(se+=" of initial"),ne.push(se)),le("percent previous")&&(se=a.formatPercent(K.difR),fe&&(se+=" of previous"),ne.push(se)),le("percent total")&&(se=a.formatPercent(K.sumR),fe&&(se+=" of total"),ne.push(se))}return ne.join("
")}r.exports={plot:E,toMoveInsideBar:P}}}),y1=de({"src/traces/bar/hover.js"(e,r){"use strict";var t=$s(),i=Ma(),a=ta(),o=Qt().fillText,s=Yw().getLineWidth,l=nn().hoverLabelText,n=cn().BADNUM;function u(h,d,p,g,m){var y=c(h,d,p,g,m);if(y){var _=y.cd,v=_[0].trace,x=_[y.index];return y.color=f(v,x),i.getComponentMethod("errorbars","hoverInfo")(x,v,y),[y]}}function c(h,d,p,g,m){var y=h.cd,_=y[0].trace,v=y[0].t,x=g==="closest",S=_.type==="waterfall",M=h.maxHoverDistance,C=h.maxSpikeDistance,w,k,A,b,E,T,F;_.orientation==="h"?(w=p,k=d,A="y",b="x",E=J,T=W):(w=d,k=p,A="x",b="y",T=J,E=W);var D=_[A+"period"],R=x||D;function P(ne){return I(ne,-1)}function z(ne){return I(ne,1)}function I(ne,se){var le=ne.w;return ne[A]+se*le/2}function L(ne){return ne[A+"End"]-ne[A+"Start"]}var B=x?P:D?function(ne){return ne.p-L(ne)/2}:function(ne){return Math.min(P(ne),ne.p-v.bardelta/2)},O=x?z:D?function(ne){return ne.p+L(ne)/2}:function(ne){return Math.max(z(ne),ne.p+v.bardelta/2)};function G(ne,se,le){return m.finiteRange&&(le=0),t.inbox(ne-w,se-w,le+Math.min(1,Math.abs(se-ne)/F)-1)}function W(ne){return G(B(ne),O(ne),M)}function X(ne){return G(P(ne),z(ne),C)}function Z(ne){var se=ne[b];if(S){var le=Math.abs(ne.rawS)||0;k>0?se+=le:k<0&&(se-=le)}return se}function J(ne){var se=k,le=ne.b,ce=Z(ne);return t.inbox(le-se,ce-se,M+(ce-se)/(ce-le)-1)}function N(ne){var se=k,le=ne.b,ce=Z(ne);return t.inbox(le-se,ce-se,C+(ce-se)/(ce-le)-1)}var H=h[A+"a"],$=h[b+"a"];F=Math.abs(H.r2c(H.range[1])-H.r2c(H.range[0]));function U(ne){return(E(ne)+T(ne))/2}var V=t.getDistanceFunction(g,E,T,U);if(t.getClosest(y,V,h),h.index!==!1&&y[h.index].p!==n){R||(B=function(ne){return Math.min(P(ne),ne.p-v.bargroupwidth/2)},O=function(ne){return Math.max(z(ne),ne.p+v.bargroupwidth/2)});var j=h.index,q=y[j],Y=_.base?q.b+q.s:q.s;h[b+"0"]=h[b+"1"]=$.c2p(q[b],!0),h[b+"LabelVal"]=Y;var K=v.extents[v.extents.round(q.p)];h[A+"0"]=H.c2p(x?B(q):K[0],!0),h[A+"1"]=H.c2p(x?O(q):K[1],!0);var te=q.orig_p!==void 0;return h[A+"LabelVal"]=te?q.orig_p:q.p,h.labelLabel=l(H,h[A+"LabelVal"],_[A+"hoverformat"]),h.valueLabel=l($,h[b+"LabelVal"],_[b+"hoverformat"]),h.baseLabel=l($,q.b,_[b+"hoverformat"]),h.spikeDistance=(N(q)+X(q))/2,h[A+"Spike"]=H.c2p(q.p,!0),o(q,_,h),h.hovertemplate=_.hovertemplate,h}}function f(h,d){var p=d.mcc||h.marker.color,g=d.mlcc||h.marker.line.color,m=s(h,d);if(a.opacity(p))return p;if(a.opacity(g)&&m)return g}r.exports={hoverPoints:u,hoverOnBars:c,getTraceColor:f}}}),iG=de({"src/traces/bar/event_data.js"(e,r){"use strict";r.exports=function(i,a,o){return i.x="xVal"in a?a.xVal:a.x,i.y="yVal"in a?a.yVal:a.y,a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),o.orientation==="h"?(i.label=i.y,i.value=i.x):(i.label=i.x,i.value=i.y),i}}}),_1=de({"src/traces/bar/select.js"(e,r){"use strict";r.exports=function(a,o){var s=a.cd,l=a.xaxis,n=a.yaxis,u=s[0].trace,c=u.type==="funnel",f=u.orientation==="h",h=[],d;if(o===!1)for(d=0;d0?(D="v",A>0?R=Math.min(E,b):R=Math.min(b)):A>0?(D="h",R=Math.min(E)):R=0;if(!R){p.visible=!1;return}p._length=R;var B=g("orientation",D);p._hasPreCompStats?B==="v"&&A===0?(g("x0",0),g("dx",1)):B==="h"&&k===0&&(g("y0",0),g("dy",1)):B==="v"&&A===0?g("x0"):B==="h"&&k===0&&g("y0");var O=i.getComponentMethod("calendars","handleTraceDefaults");O(d,p,["x","y"],m)}function f(d,p,g,m){var y=m.prefix,_=t.coerce2(d,p,n,"marker.outliercolor"),v=g("marker.line.outliercolor"),x="outliers";p._hasPreCompStats?x="all":(_||v)&&(x="suspectedoutliers");var S=g(y+"points",x);S?(g("jitter",S==="all"?.3:0),g("pointpos",S==="all"?-1.5:0),g("marker.symbol"),g("marker.opacity"),g("marker.size"),g("marker.angle"),g("marker.color",p.line.color),g("marker.line.color"),g("marker.line.width"),S==="suspectedoutliers"&&(g("marker.line.outliercolor",p.marker.color),g("marker.line.outlierwidth")),g("selected.marker.color"),g("unselected.marker.color"),g("selected.marker.size"),g("unselected.marker.size"),g("text"),g("hovertext")):delete p.marker;var M=g("hoveron");(M==="all"||M.indexOf("points")!==-1)&&(g("hovertemplate"),g("hovertemplatefallback")),t.coerceSelectionMarkerOpacity(p,g)}function h(d,p){var g,m;function y(S){return t.coerce(m._input,m,n,S)}for(var _=0;_Z.uf};if(C._hasPreCompStats){var j=C[R],q=function(xt){return D.d2c((C[xt]||[])[T])},Y=1/0,K=-1/0;for(T=0;T=Z.q1&&Z.q3>=Z.med){var ne=q("lowerfence");Z.lf=ne!==s&&ne<=Z.q1?ne:m(Z,N,H);var se=q("upperfence");Z.uf=se!==s&&se>=Z.q3?se:y(Z,N,H);var le=q("mean");Z.mean=le!==s?le:H?o.mean(N,H):(Z.q1+Z.q3)/2;var ce=q("sd");Z.sd=le!==s&&ce>=0?ce:H?o.stdev(N,H,Z.mean):Z.q3-Z.q1,Z.lo=_(Z),Z.uo=v(Z);var pe=q("notchspan");pe=pe!==s&&pe>0?pe:x(Z,H),Z.ln=Z.med-pe,Z.un=Z.med+pe;var xe=Z.lf,ye=Z.uf;C.boxpoints&&N.length&&(xe=Math.min(xe,N[0]),ye=Math.max(ye,N[H-1])),C.notched&&(xe=Math.min(xe,Z.ln),ye=Math.max(ye,Z.un)),Z.min=xe,Z.max=ye}else{o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+Z.q1,"median = "+Z.med,"q3 = "+Z.q3].join(` -`));var fe;Z.med!==s?fe=Z.med:Z.q1!==s?Z.q3!==s?fe=(Z.q1+Z.q3)/2:fe=Z.q1:Z.q3!==s?fe=Z.q3:fe=0,Z.med=fe,Z.q1=Z.q3=fe,Z.lf=Z.uf=fe,Z.mean=Z.sd=fe,Z.ln=Z.un=fe,Z.min=Z.max=fe}Y=Math.min(Y,Z.min),K=Math.max(K,Z.max),Z.pts2=J.filter(V),b.push(Z)}}C._extremes[D._id]=i.findExtremes(D,[Y,K],{padded:!0})}else{var ae=D.makeCalcdata(C,R),ee=u(W,X),ie=W.length,Q=c(ie);for(T=0;T=0&&ue0){if(Z={},Z.pos=Z[z]=W[T],J=Z.pts=Q[T].sort(p),N=Z[R]=J.map(g),H=N.length,Z.min=N[0],Z.max=N[H-1],Z.mean=o.mean(N,H),Z.sd=o.stdev(N,H,Z.mean)*C.sdmultiple,Z.med=o.interp(N,.5),H%2&&(je||Ve)){var Ze,Ke;je?(Ze=N.slice(0,H/2),Ke=N.slice(H/2+1)):Ve&&(Ze=N.slice(0,H/2+1),Ke=N.slice(H/2)),Z.q1=o.interp(Ze,.5),Z.q3=o.interp(Ke,.5)}else Z.q1=o.interp(N,.25),Z.q3=o.interp(N,.75);Z.lf=m(Z,N,H),Z.uf=y(Z,N,H),Z.lo=_(Z),Z.uo=v(Z);var vt=x(Z,H);Z.ln=Z.med-vt,Z.un=Z.med+vt,ge=Math.min(ge,Z.ln),Me=Math.max(Me,Z.un),Z.pts2=J.filter(V),b.push(Z)}C.notched&&o.isTypedArray(ae)&&(ae=Array.from(ae)),C._extremes[D._id]=i.findExtremes(D,C.notched?ae.concat([ge,Me]):ae,{padded:!0})}return d(b,C),b.length>0?(b[0].t={num:w[E],dPos:X,posLetter:z,valLetter:R,labels:{med:l(M,"median:"),min:l(M,"min:"),q1:l(M,"q1:"),q3:l(M,"q3:"),max:l(M,"max:"),mean:C.boxmean==="sd"||C.sizemode==="sd"?l(M,"mean \xB1 \u03C3:").replace("\u03C3",C.sdmultiple===1?"\u03C3":C.sdmultiple+"\u03C3"):l(M,"mean:"),lf:l(M,"lower fence:"),uf:l(M,"upper fence:")}},w[E]++,b):[{t:{empty:!0}}]};function n(S,M,C,w){var k=M in S,A=M+"0"in S,b="d"+M in S;if(k||A&&b){var E=C.makeCalcdata(S,M),T=a(S,C,M,E).vals;return[T,E]}var F;A?F=S[M+"0"]:"name"in S&&(C.type==="category"||t(S.name)&&["linear","log"].indexOf(C.type)!==-1||o.isDateTime(S.name)&&C.type==="date")?F=S.name:F=w;for(var D=C.type==="multicategory"?C.r2c_just_indices(F):C.d2c(F,0,S[M+"calendar"]),R=S._length,P=new Array(R),z=0;z1,A=1-d[n+"gap"],b=1-d[n+"groupgap"];for(m=0;m0;if(D==="positive"?(Z=R*(F?1:.5),H=N,J=H=z):D==="negative"?(Z=H=z,J=R*(F?1:.5),$=N):(Z=J=R,H=$=N),K){var te=E.pointpos,ne=E.jitter,se=E.marker.size/2,le=0;te+ne>=0&&(le=N*(te+ne),le>Z?(Y=!0,j=se,U=le):le>H&&(j=se,U=Z)),le<=Z&&(U=Z);var ce=0;te-ne<=0&&(ce=-N*(te-ne),ce>J?(Y=!0,q=se,V=ce):ce>$&&(q=se,V=J)),ce<=J&&(V=J)}else U=Z,V=J;var pe=new Array(_.length);for(y=0;y<_.length;y++)pe[y]=_[y].pos;E._extremes[p]=t.findExtremes(f,pe,{padded:Y,vpadminus:V,vpadplus:U,vpadLinearized:!0,ppadminus:{x:q,y:j}[g],ppadplus:{x:j,y:q}[g]})}}}r.exports={crossTraceCalc:s,setPositionOffset:l}}}),Kw=de({"src/traces/box/plot.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=hn(),o=5,s=.01;function l(f,h,d,p){var g=f._context.staticPlot,m=h.xaxis,y=h.yaxis;i.makeTraceGroups(p,d,"trace boxes").each(function(_){var v=t.select(this),x=_[0],S=x.t,M=x.trace;if(S.wdPos=S.bdPos*M.whiskerwidth,M.visible!==!0||S.empty){v.remove();return}var C,w;M.orientation==="h"?(C=y,w=m):(C=m,w=y),n(v,{pos:C,val:w},M,S,g),u(v,{x:m,y},M,S),c(v,{pos:C,val:w},M,S)})}function n(f,h,d,p,g){var m=d.orientation==="h",y=h.val,_=h.pos,v=!!_.rangebreaks,x=p.bPos,S=p.wdPos||0,M=p.bPosPxOffset||0,C=d.whiskerwidth||0,w=d.showwhiskers!==!1,k=d.notched||!1,A=k?1-2*d.notchwidth:1,b,E;Array.isArray(p.bdPos)?(b=p.bdPos[0],E=p.bdPos[1]):(b=p.bdPos,E=p.bdPos);var T=f.selectAll("path.box").data(d.type!=="violin"||d.box.visible?i.identity:[]);T.enter().append("path").style("vector-effect",g?"none":"non-scaling-stroke").attr("class","box"),T.exit().remove(),T.each(function(F){if(F.empty)return t.select(this).attr("d","M0,0Z");var D=_.c2l(F.pos+x,!0),R=_.l2p(D-b)+M,P=_.l2p(D+E)+M,z=v?(R+P)/2:_.l2p(D)+M,I=d.whiskerwidth,L=v?R*I+(1-I)*z:_.l2p(D-S)+M,B=v?P*I+(1-I)*z:_.l2p(D+S)+M,O=_.l2p(D-b*A)+M,G=_.l2p(D+E*A)+M,W=d.sizemode==="sd",X=y.c2p(W?F.mean-F.sd:F.q1,!0),Z=W?y.c2p(F.mean+F.sd,!0):y.c2p(F.q3,!0),J=i.constrain(W?y.c2p(F.mean,!0):y.c2p(F.med,!0),Math.min(X,Z)+1,Math.max(X,Z)-1),N=F.lf===void 0||d.boxpoints===!1||W,H=y.c2p(N?F.min:F.lf,!0),$=y.c2p(N?F.max:F.uf,!0),U=y.c2p(F.ln,!0),V=y.c2p(F.un,!0);m?t.select(this).attr("d","M"+J+","+O+"V"+G+"M"+X+","+R+"V"+P+(k?"H"+U+"L"+J+","+G+"L"+V+","+P:"")+"H"+Z+"V"+R+(k?"H"+V+"L"+J+","+O+"L"+U+","+R:"")+"Z"+(w?"M"+X+","+z+"H"+H+"M"+Z+","+z+"H"+$+(C===0?"":"M"+H+","+L+"V"+B+"M"+$+","+L+"V"+B):"")):t.select(this).attr("d","M"+O+","+J+"H"+G+"M"+R+","+X+"H"+P+(k?"V"+U+"L"+G+","+J+"L"+P+","+V:"")+"V"+Z+"H"+R+(k?"V"+V+"L"+O+","+J+"L"+R+","+U:"")+"Z"+(w?"M"+z+","+X+"V"+H+"M"+z+","+Z+"V"+$+(C===0?"":"M"+L+","+H+"H"+B+"M"+L+","+$+"H"+B):""))})}function u(f,h,d,p){var g=h.x,m=h.y,y=p.bdPos,_=p.bPos,v=d.boxpoints||d.points;i.seedPseudoRandom();var x=function(C){return C.forEach(function(w){w.t=p,w.trace=d}),C},S=f.selectAll("g.points").data(v?x:[]);S.enter().append("g").attr("class","points"),S.exit().remove();var M=S.selectAll("path").data(function(C){var w,k=C.pts2,A=Math.max((C.max-C.min)/10,C.q3-C.q1),b=A*1e-9,E=A*s,T=[],F=0,D;if(d.jitter){if(A===0)for(F=1,T=new Array(k.length),w=0;wC.lo&&(B.so=!0)}return k});M.enter().append("path").classed("point",!0),M.exit().remove(),M.call(a.translatePoints,g,m)}function c(f,h,d,p){var g=h.val,m=h.pos,y=!!m.rangebreaks,_=p.bPos,v=p.bPosPxOffset||0,x=d.boxmean||(d.meanline||{}).visible,S,M;Array.isArray(p.bdPos)?(S=p.bdPos[0],M=p.bdPos[1]):(S=p.bdPos,M=p.bdPos);var C=f.selectAll("path.mean").data(d.type==="box"&&d.boxmean||d.type==="violin"&&d.box.visible&&d.meanline.visible?i.identity:[]);C.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),C.exit().remove(),C.each(function(w){var k=m.c2l(w.pos+_,!0),A=m.l2p(k-S)+v,b=m.l2p(k+M)+v,E=y?(A+b)/2:m.l2p(k)+v,T=g.c2p(w.mean,!0),F=g.c2p(w.mean-w.sd,!0),D=g.c2p(w.mean+w.sd,!0);d.orientation==="h"?t.select(this).attr("d","M"+T+","+A+"V"+b+(x==="sd"?"m0,0L"+F+","+E+"L"+T+","+A+"L"+D+","+E+"Z":"")):t.select(this).attr("d","M"+A+","+T+"H"+b+(x==="sd"?"m0,0L"+E+","+F+"L"+A+","+T+"L"+E+","+D+"Z":""))})}r.exports={plot:l,plotBoxAndWhiskers:n,plotPoints:u,plotBoxMean:c}}}),Jw=de({"src/traces/box/style.js"(e,r){"use strict";var t=Yr(),i=ta(),a=hn();function o(l,n,u){var c=u||t.select(l).selectAll("g.trace.boxes");c.style("opacity",function(f){return f[0].trace.opacity}),c.each(function(f){var h=t.select(this),d=f[0].trace,p=d.line.width;function g(_,v,x,S){_.style("stroke-width",v+"px").call(i.stroke,x).call(i.fill,S)}var m=h.selectAll("path.box");if(d.type==="candlestick")m.each(function(_){if(!_.empty){var v=t.select(this),x=d[_.dir];g(v,x.line.width,x.line.color,x.fillcolor),v.style("opacity",d.selectedpoints&&!_.selected?.3:1)}});else{g(m,p,d.line.color,d.fillcolor),h.selectAll("path.mean").style({"stroke-width":p,"stroke-dasharray":2*p+"px,"+p+"px"}).call(i.stroke,d.line.color);var y=h.selectAll("path.point");a.pointStyle(y,d,l)}})}function s(l,n,u){var c=n[0].trace,f=u.selectAll("path.point");c.selectedpoints?a.selectedPointStyle(f,c):a.pointStyle(f,c,l)}r.exports={style:o,styleOnSelect:s}}}),bk=de({"src/traces/box/hover.js"(e,r){"use strict";var t=nn(),i=Qt(),a=$s(),o=ta(),s=i.fillText;function l(c,f,h,d){var p=c.cd,g=p[0].trace,m=g.hoveron,y=[],_;return m.indexOf("boxes")!==-1&&(y=y.concat(n(c,f,h,d))),m.indexOf("points")!==-1&&(_=u(c,f,h)),d==="closest"?_?[_]:y:(_&&y.push(_),y)}function n(c,f,h,d){var p=c.cd,g=c.xa,m=c.ya,y=p[0].trace,_=p[0].t,v=y.type==="violin",x,S,M,C,w,k,A,b,E,T,F,D=_.bdPos,R,P,z=_.wHover,I=function(ce){return M.c2l(ce.pos)+_.bPos-M.c2l(k)};v&&y.side!=="both"?(y.side==="positive"&&(E=function(ce){var pe=I(ce);return a.inbox(pe,pe+z,T)},R=D,P=0),y.side==="negative"&&(E=function(ce){var pe=I(ce);return a.inbox(pe-z,pe,T)},R=0,P=D)):(E=function(ce){var pe=I(ce);return a.inbox(pe-z,pe+z,T)},R=P=D);var L;v?L=function(ce){return a.inbox(ce.span[0]-w,ce.span[1]-w,T)}:L=function(ce){return a.inbox(ce.min-w,ce.max-w,T)},y.orientation==="h"?(w=f,k=h,A=L,b=E,x="y",M=m,S="x",C=g):(w=h,k=f,A=E,b=L,x="x",M=g,S="y",C=m);var B=Math.min(1,D/Math.abs(M.r2c(M.range[1])-M.r2c(M.range[0])));T=c.maxHoverDistance-B,F=c.maxSpikeDistance-B;function O(ce){return(A(ce)+b(ce))/2}var G=a.getDistanceFunction(d,A,b,O);if(a.getClosest(p,G,c),c.index===!1)return[];var W=p[c.index],X=y.line.color,Z=(y.marker||{}).color;o.opacity(X)&&y.line.width?c.color=X:o.opacity(Z)&&y.boxpoints?c.color=Z:c.color=y.fillcolor,c[x+"0"]=M.c2p(W.pos+_.bPos-P,!0),c[x+"1"]=M.c2p(W.pos+_.bPos+R,!0),c[x+"LabelVal"]=W.orig_p!==void 0?W.orig_p:W.pos;var J=x+"Spike";c.spikeDistance=O(W)*F/T,c[J]=M.c2p(W.pos,!0);var N=y.boxmean||y.sizemode==="sd"||(y.meanline||{}).visible,H=y.boxpoints||y.points,$=H&&N?["max","uf","q3","med","mean","q1","lf","min"]:H&&!N?["max","uf","q3","med","q1","lf","min"]:!H&&N?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=C.range[1]0&&(u=!0);for(var d=0;dl){var n=l-o[i];return o[i]=l,n}}else return o[i]=l,l;return 0},max:function(i,a,o,s){var l=s[a];if(t(l))if(l=Number(l),t(o[i])){if(o[i]A&&Ao){var T=b===i?1:6,F=b===i?"M12":"M1";return function(D,R){var P=_.c2d(D,i,v),z=P.indexOf("-",T);z>0&&(P=P.slice(0,z));var I=_.d2c(P,0,v);if(In?p>o?p>i*1.1?i:p>a*1.1?a:o:p>s?s:p>l?l:n:Math.pow(10,Math.floor(Math.log(p)/Math.LN10))}function h(p,g,m,y,_,v){if(y&&p>o){var x=d(g,_,v),S=d(m,_,v),M=p===i?0:1;return x[M]!==S[M]}return Math.floor(m/p)-Math.floor(g/p)>.1}function d(p,g,m){var y=g.c2d(p,i,m).split("-");return y[0]===""&&(y.unshift(),y[0]="-"+y[0]),y}}}),kk=de({"src/traces/histogram/calc.js"(e,r){"use strict";var t=da(),i=Qt(),a=Ma(),o=nn(),{hasColorscale:s}=Wu(),l=hc(),n=Oy(),u=Ak(),c=Mk(),f=Sk(),h=Ek();function d(_,v){var x=[],S=[],M=v.orientation==="h",C=o.getFromId(_,M?v.yaxis:v.xaxis),w=M?"y":"x",k={x:"y",y:"x"}[w],A=v[w+"calendar"],b=v.cumulative,E,T=p(_,v,C,w),F=T[0],D=T[1],R=typeof F.size=="string",P=[],z=R?P:F,I=[],L=[],B=[],O=0,G=v.histnorm,W=v.histfunc,X=G.indexOf("density")!==-1,Z,J,N;b.enabled&&X&&(G=G.replace(/ ?density$/,""),X=!1);var H=W==="max"||W==="min",$=H?null:0,U=u.count,V=c[G],j=!1,q=function(ue){return C.r2c(ue,0,A)},Y;for(i.isArrayOrTypedArray(v[k])&&W!=="count"&&(Y=v[k],j=W==="avg",U=u[W]),E=q(F.start),J=q(F.end)+(E-o.tickIncrement(E,F.size,!1,A))/1e6;E=0&&N=ee;E--)if(S[E]){ie=E;break}for(E=ee;E<=ie;E++)if(t(x[E])&&t(S[E])){var Q={p:x[E],s:S[E],b:0};b.enabled||(Q.pts=B[E],se?Q.ph0=Q.ph1=B[E].length?D[B[E][0]]:x[E]:(v._computePh=!0,Q.ph0=ye(P[E]),Q.ph1=ye(P[E+1],!0))),ae.push(Q)}return ae.length===1&&(ae[0].width1=o.tickIncrement(ae[0].p,F.size,!1,A)-ae[0].p),s(v,"marker")&&l(_,v,{vals:v.marker.color,containerStr:"marker",cLetter:"c"}),s(v,"marker.line")&&l(_,v,{vals:v.marker.line.color,containerStr:"marker.line",cLetter:"c"}),n(ae,v),i.isArrayOrTypedArray(v.selectedpoints)&&i.tagSelected(ae,v,pe),ae}function p(_,v,x,S,M){var C,w=S+"bins",k=_._fullLayout,A=v["_"+S+"bingroup"],b=k._histogramBinOpts[A],E=k.barmode==="overlay",T,F,D,R,P,z,I,L=function(ye){return x.r2c(ye,0,R)},B=function(ye){return x.c2r(ye,0,R)},O=x.type==="date"?function(ye){return ye||ye===0?i.cleanDate(ye,null,R):null}:function(ye){return t(ye)?Number(ye):null};function G(ye,fe,ae){fe[ye+"Found"]?(fe[ye]=O(fe[ye]),fe[ye]===null&&(fe[ye]=ae[ye])):(z[ye]=fe[ye]=ae[ye],i.nestedProperty(F[0],w+"."+ye).set(ae[ye]))}if(v["_"+S+"autoBinFinished"])delete v["_"+S+"autoBinFinished"];else{F=b.traces;var W=[],X=!0,Z=!1,J=!1;for(T=0;Tx.r2l(K)&&(ne=o.tickIncrement(ne,b.size,!0,R)),V.start=x.l2r(ne),Y||i.nestedProperty(v,w+".start").set(V.start)}var se=b.end,le=x.r2l(U.end),ce=le!==void 0;if((b.endFound||ce)&&le!==x.r2l(se)){var pe=ce?le:i.aggNums(Math.max,null,P);V.end=x.l2r(pe),ce||i.nestedProperty(v,w+".start").set(V.end)}var xe="autobin"+S;return v._input[xe]===!1&&(v._input[w]=i.extendFlat({},v[w]||{}),delete v._input[xe],delete v[xe]),[V,P]}function g(_,v,x,S,M){var C=_._fullLayout,w=m(_,v),k=!1,A=1/0,b=[v],E,T,F;for(E=0;E=0;S--)k(S);else if(v==="increasing"){for(S=1;S<_.length;S++)_[S]+=_[S-1];x==="exclude"&&(_.unshift(0),_.pop())}else{for(S=_.length-2;S>=0;S--)_[S]+=_[S+1];x==="exclude"&&(_.push(0),_.shift())}}r.exports={calc:d,calcAllAutoBins:p}}}),cG=de({"src/traces/histogram2d/calc.js"(e,r){"use strict";var t=Qt(),i=nn(),a=Ak(),o=Mk(),s=Sk(),l=Ek(),n=kk().calcAllAutoBins;r.exports=function(d,p){var g=i.getFromId(d,p.xaxis),m=i.getFromId(d,p.yaxis),y=p.xcalendar,_=p.ycalendar,v=function(qe){return g.r2c(qe,0,y)},x=function(qe){return m.r2c(qe,0,_)},S=function(qe){return g.c2r(qe,0,y)},M=function(qe){return m.c2r(qe,0,_)},C,w,k,A,b=n(d,p,g,"x"),E=b[0],T=b[1],F=n(d,p,m,"y"),D=F[0],R=F[1],P=p._length;T.length>P&&T.splice(P,T.length-P),R.length>P&&R.splice(P,R.length-P);var z=[],I=[],L=[],B=typeof E.size=="string",O=typeof D.size=="string",G=[],W=[],X=B?G:E,Z=O?W:D,J=0,N=[],H=[],$=p.histnorm,U=p.histfunc,V=$.indexOf("density")!==-1,j=U==="max"||U==="min",q=j?null:0,Y=a.count,K=o[$],te=!1,ne=[],se=[],le="z"in p?p.z:"marker"in p&&Array.isArray(p.marker.color)?p.marker.color:"";le&&U!=="count"&&(te=U==="avg",Y=a[U]);var ce=E.size,pe=v(E.start),xe=v(E.end)+(pe-i.tickIncrement(pe,ce,!1,y))/1e6;for(C=pe;C=0&&k=0&&Ai;f++)c=s(n,u,o(c));return c>i&&t.log("interp2d didn't converge quickly",c),n};function s(l,n,u){var c=0,f,h,d,p,g,m,y,_,v,x,S,M,C;for(p=0;pM&&(c=Math.max(c,Math.abs(l[h][d]-S)/(C-M))))}return c}}}),i3=de({"src/traces/heatmap/find_empties.js"(e,r){"use strict";var t=Qt().maxRowLength;r.exports=function(a){var o=[],s={},l=[],n=a[0],u=[],c=[0,0,0],f=t(a),h,d,p,g,m,y,_,v;for(d=0;d=0;m--)g=l[m],d=g[0],p=g[1],y=((s[[d-1,p]]||c)[2]+(s[[d+1,p]]||c)[2]+(s[[d,p-1]]||c)[2]+(s[[d,p+1]]||c)[2])/20,y&&(_[g]=[d,p,y],l.splice(m,1),v=!0);if(!v)throw"findEmpties iterated with no new neighbors";for(g in _)s[g]=_[g],o.push(_[g])}return o.sort(function(x,S){return S[2]-x[2]})}}}),Ck=de({"src/traces/heatmap/make_bound_array.js"(e,r){"use strict";var t=Ma(),i=Qt().isArrayOrTypedArray;r.exports=function(o,s,l,n,u,c){var f=[],h=t.traceIs(o,"contour"),d=t.traceIs(o,"histogram"),p,g,m,y=i(s)&&s.length>1;if(y&&!d&&c.type!=="category"){var _=s.length;if(_<=u){if(h)f=Array.from(s).slice(0,u);else if(u===1)c.type==="log"?f=[.5*s[0],2*s[0]]:f=[s[0]-.5,s[0]+.5];else if(c.type==="log"){for(f=[Math.pow(s[0],1.5)/Math.pow(s[1],.5)],m=1;m<_;m++)f.push(Math.sqrt(s[m-1]*s[m]));f.push(Math.pow(s[_-1],1.5)/Math.pow(s[_-2],.5))}else{for(f=[1.5*s[0]-.5*s[1]],m=1;m<_;m++)f.push((s[m-1]+s[m])*.5);f.push(1.5*s[_-1]-.5*s[_-2])}if(_1){var $=(H[H.length-1]-H[0])/(H.length-1),U=Math.abs($/100);for(P=0;PU)return!1}return!0}_._islinear=!1,v.type==="log"||x.type==="log"?C==="fast"&&L("log axis found"):B(w)?B(E)?_._islinear=!0:C==="fast"&&L("y scale is not linear"):C==="fast"&&L("x scale is not linear");var O=i.maxRowLength(R),G=_.xtype==="scaled"?"":w,W=h(_,G,k,A,O,v),X=_.ytype==="scaled"?"":E,Z=h(_,X,T,F,R.length,x);_._extremes[v._id]=a.findExtremes(v,W),_._extremes[x._id]=a.findExtremes(x,Z);var J={x:W,y:Z,z:R,text:_._text||_.text,hovertext:_._hovertext||_.hovertext};if(_.xperiodalignment&&b&&(J.orig_x=b),_.yperiodalignment&&D&&(J.orig_y=D),G&&G.length===W.length-1&&(J.xCenter=G),X&&X.length===Z.length-1&&(J.yCenter=X),M&&(J.xRanges=z.xRanges,J.yRanges=z.yRanges,J.pts=z.pts),S||l(y,_,{vals:R,cLetter:"z"}),S&&_.contours&&_.contours.coloring==="heatmap"){var N={type:_.type==="contour"?"heatmap":"histogram2d",xcalendar:_.xcalendar,ycalendar:_.ycalendar};J.xfill=h(N,G,k,A,O,v),J.yfill=h(N,X,T,F,R.length,x)}return[J]};function p(m){for(var y=[],_=m.length,v=0;v<_;v++){var x=m[v];x!==d&&y.push(x)}return y}function g(m,y,_){for(var v=[],x=-1,S=0;S<_.length;S++)if(y[S]!==d){x++,v[x]=[];for(var M=0;M<_[S].length;M++)m[M]!==d&&v[x].push(_[S][M])}return v}}}),n3=de({"src/constants/pixelated_image.js"(e){"use strict";e.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],e.STYLE=e.CSS_DECLARATIONS.map(function(r){return r.join(": ")+"; "}).join("")}}),Dk=de({"src/lib/supports_pixelated_image.js"(e,r){"use strict";var t=n3(),i=hn(),a=Qt(),o=null;function s(){if(o!==null)return o;o=!1;var l=a.isSafari()||a.isMacWKWebView()||a.isIOS();if(window.navigator.userAgent&&!l){var n=Array.from(t.CSS_DECLARATIONS).reverse(),u=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof u=="function")o=n.some(function(d){return u.apply(null,d)});else{var c=i.tester.append("image").attr("style",t.STYLE),f=window.getComputedStyle(c.node()),h=f.imageRendering;o=n.some(function(d){var p=d[1];return h===p||h===p.toLowerCase()}),c.remove()}}return o}r.exports=s}}),o3=de({"src/traces/heatmap/plot.js"(e,r){"use strict";var t=Yr(),i=Ma(),a=hn(),o=nn(),s=Qt(),l=Zo(),n=Bw(),u=ta(),c=ks().extractOpts,f=ks().makeColorScaleFuncFromTrace,h=Oh(),d=Bl(),p=d.LINE_SPACING,g=Dk(),m=n3().STYLE,y="heatmap-label";function _(C){return C.selectAll("g."+y)}function v(C){_(C).remove()}r.exports=function(C,w,k,A){var b=w.xaxis,E=w.yaxis;s.makeTraceGroups(A,k,"hm").each(function(T){var F=t.select(this),D=T[0],R=D.trace,P=R.xgap||0,z=R.ygap||0,I=D.z,L=D.x,B=D.y,O=D.xCenter,G=D.yCenter,W=i.traceIs(R,"contour"),X=W?"best":R.zsmooth,Z=I.length,J=s.maxRowLength(I),N=!1,H=!1,$,U,V,j,q,Y,K,te;for(Y=0;$===void 0&&Y0;)U=b.c2p(L[Y]),Y--;for(U<$&&(V=U,U=$,$=V,N=!0),Y=0;j===void 0&&Y0;)q=E.c2p(B[Y]),Y--;q=b._length||U<=0||j>=E._length||q<=0;if(pe){var xe=F.selectAll("image").data([]);xe.exit().remove(),v(F);return}var ye,fe;ne==="fast"?(ye=J,fe=Z):(ye=le,fe=ce);var ae=document.createElement("canvas");ae.width=ye,ae.height=fe;var ee=ae.getContext("2d",{willReadFrequently:!0}),ie=f(R,{noNumericCheck:!0,returnArray:!0}),Q,ue;ne==="fast"?(Q=N?function(Zt){return J-1-Zt}:s.identity,ue=H?function(Zt){return Z-1-Zt}:s.identity):(Q=function(Zt){return s.constrain(Math.round(b.c2p(L[Zt])-$),0,le)},ue=function(Zt){return s.constrain(Math.round(E.c2p(B[Zt])-j),0,ce)});var ge=ue(0),Me=[ge,ge],Te=N?0:1,je=H?0:1,Ve=0,Ze=0,Ke=0,vt=0,xt,Pt,mt,Mt,lt;function qe(Zt,qt=0){if(Zt===void 0)return[0,0,0,0];var vr=ie(Zt);return vr[0]=Math.round(vr[0]),vr[1]=Math.round(vr[1]),vr[2]=Math.round(vr[2]),Ve+=qt,Ze+=vr[0]*qt,Ke+=vr[1]*qt,vt+=vr[2]*qt,vr}function Ye(Zt,qt,vr,Br){var Pr=Zt[vr.bin0];if(Pr===void 0)return qe(void 0,1);var Mi=Zt[vr.bin1],gi=qt[vr.bin0],ba=qt[vr.bin1],Hi=Mi-Pr||0,Za=gi-Pr||0,oa;return Mi===void 0?ba===void 0?oa=0:gi===void 0?oa=2*(ba-Pr):oa=(2*ba-gi-Pr)*2/3:ba===void 0?gi===void 0?oa=0:oa=(2*Pr-Mi-gi)*2/3:gi===void 0?oa=(2*ba-Mi-Pr)*2/3:oa=ba+Pr-Mi-gi,qe(Pr+vr.frac*Hi+Br.frac*(Za+vr.frac*oa))}if(ne!=="default"){var me=0,_e;try{_e=new Uint8Array(ye*fe*4)}catch{_e=new Array(ye*fe*4)}if(ne==="smooth"){var Ae=O||L,ke=G||B,Ee=new Array(Ae.length),De=new Array(ke.length),Je=new Array(le),Ue=O?S:x,at=G?S:x,rt,ft,At;for(Y=0;Yea||ea>E._length))for(K=Ur;Kja||ja>b._length)){var ya=n({x:$i,y:Qr},R,C._fullLayout);ya.x=$i,ya.y=Qr;var pa=D.z[Y][K];pa===void 0?(ya.z="",ya.zLabel=""):(ya.z=pa,ya.zLabel=o.tickText($t,pa,"hover").text);var xi=D.text&&D.text[Y]&&D.text[Y][K];(xi===void 0||xi===!1)&&(xi=""),ya.text=xi;var bi=s.texttemplateString({data:[ya,R._meta],fallback:R.texttemplatefallback,labels:ya,locale:C._fullLayout._d3locale,template:Lt});if(bi){var Ua=bi.split("
"),dn=Ua.length,pi=0;for(te=0;te=x[0].length||F<0||F>x.length)return}else{if(t.inbox(u-_[0],u-_[_.length-1],0)>0||t.inbox(c-v[0],c-v[v.length-1],0)>0)return;if(d){var D;for(k=[2*_[0]-_[1]],D=1;D<_.length;D++)k.push((_[D]+_[D-1])/2);for(k.push([2*_[_.length-1]-_[_.length-2]]),A=[2*v[0]-v[1]],D=1;D=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),Vy=de({"src/traces/contour/attributes.js"(e,r){"use strict";var t=x1(),i=tl(),a=Ns(),o=a.axisHoverFormat,s=a.descriptionOnlyNumbers,l=cs(),n=fu().dash,u=us(),c=fn().extendFlat,f=h3(),h=f.COMPARISON_OPS2,d=f.INTERVAL_OPS,p=i.line;r.exports=c({z:t.z,x:t.x,x0:t.x0,dx:t.dx,y:t.y,y0:t.y0,dy:t.dy,xperiod:t.xperiod,yperiod:t.yperiod,xperiod0:i.xperiod0,yperiod0:i.yperiod0,xperiodalignment:t.xperiodalignment,yperiodalignment:t.yperiodalignment,text:t.text,hovertext:t.hovertext,transpose:t.transpose,xtype:t.xtype,ytype:t.ytype,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:t.hovertemplate,hovertemplatefallback:t.hovertemplatefallback,texttemplate:c({},t.texttemplate,{}),texttemplatefallback:t.texttemplatefallback,textfont:c({},t.textfont,{}),hoverongaps:t.hoverongaps,connectgaps:c({},t.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:u({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:s("contour label")},operation:{valType:"enumerated",values:[].concat(h).concat(d),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:c({},p.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:n,smoothing:c({},p.smoothing,{}),editType:"plot"},zorder:i.zorder},l("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),Ik=de({"src/traces/histogram2dcontour/attributes.js"(e,r){"use strict";var t=f3(),i=Vy(),a=cs(),o=Ns().axisHoverFormat,s=fn().extendFlat;r.exports=s({x:t.x,y:t.y,z:t.z,marker:t.marker,histnorm:t.histnorm,histfunc:t.histfunc,nbinsx:t.nbinsx,xbins:t.xbins,nbinsy:t.nbinsy,ybins:t.ybins,autobinx:t.autobinx,autobiny:t.autobiny,bingroup:t.bingroup,xbingroup:t.xbingroup,ybingroup:t.ybingroup,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:{color:i.line.color,width:s({},i.line.width,{dflt:.5}),dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:t.hovertemplate,hovertemplatefallback:t.hovertemplatefallback,texttemplate:i.texttemplate,texttemplatefallback:i.texttemplatefallback,textfont:i.textfont},a("",{cLetter:"z",editTypeOverride:"calc"}))}}),d3=de({"src/traces/contour/contours_defaults.js"(e,r){"use strict";r.exports=function(i,a,o,s){var l=s("contours.start"),n=s("contours.end"),u=l===!1||n===!1,c=o("contours.size"),f;u?f=a.autocontour=!0:f=o("autocontour",!1),(f||!c)&&o("ncontours")}}}),Rk=de({"src/traces/contour/label_defaults.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o,s,l){l||(l={});var n=a("contours.showlabels");if(n){var u=o.font;t.coerceFont(a,"contours.labelfont",u,{overrideDflt:{color:s}}),a("contours.labelformat")}l.hasHover!==!1&&a("zhoverformat")}}}),p3=de({"src/traces/contour/style_defaults.js"(e,r){"use strict";var t=hu(),i=Rk();r.exports=function(o,s,l,n,u){var c=l("contours.coloring"),f,h="";c==="fill"&&(f=l("contours.showlines")),f!==!1&&(c!=="lines"&&(h=l("line.color","#000")),l("line.width",.5),l("line.dash")),c!=="none"&&(o.showlegend!==!0&&(s.showlegend=!1),s._dfltShowLegend=!1,t(o,s,n,l,{prefix:"",cLetter:"z"})),l("line.smoothing"),i(l,n,h,u)}}}),wG=de({"src/traces/histogram2dcontour/defaults.js"(e,r){"use strict";var t=Qt(),i=Pk(),a=d3(),o=p3(),s=qy(),l=Ik();r.exports=function(u,c,f,h){function d(g,m){return t.coerce(u,c,l,g,m)}function p(g){return t.coerce2(u,c,l,g)}i(u,c,d,h),c.visible!==!1&&(a(u,c,d,p),o(u,c,d,h),d("xhoverformat"),d("yhoverformat"),d("hovertemplate"),d("hovertemplatefallback"),c.contours&&c.contours.coloring==="heatmap"&&s(d,h))}}}),zk=de({"src/traces/contour/set_contours.js"(e,r){"use strict";var t=nn(),i=Qt();r.exports=function(s,l){var n=s.contours;if(s.autocontour){var u=s.zmin,c=s.zmax;(s.zauto||u===void 0)&&(u=i.aggNums(Math.min,null,l)),(s.zauto||c===void 0)&&(c=i.aggNums(Math.max,null,l));var f=a(u,c,s.ncontours);n.size=f.dtick,n.start=t.tickFirst(f),f.range.reverse(),n.end=t.tickFirst(f),n.start===u&&(n.start+=n.size),n.end===c&&(n.end-=n.size),n.start>n.end&&(n.start=n.end=(n.start+n.end)/2),s._input.contours||(s._input.contours={}),i.extendFlat(s._input.contours,{start:n.start,end:n.end,size:n.size}),s._input.autocontour=!0}else if(n.type!=="constraint"){var h=n.start,d=n.end,p=s._input.contours;if(h>d&&(n.start=p.start=d,d=n.end=p.end=h,h=n.start),!(n.size>0)){var g;h===d?g=1:g=a(h,d,s.ncontours).dtick,p.size=n.size=g}}};function a(o,s,l){var n={type:"linear",range:[o,s]};return t.autoTicks(n,(s-o)/(l||15)),n}}}),Gy=de({"src/traces/contour/end_plus.js"(e,r){"use strict";r.exports=function(i){return i.end+i.size/1e6}}}),Bk=de({"src/traces/contour/calc.js"(e,r){"use strict";var t=ks(),i=a3(),a=zk(),o=Gy();r.exports=function(l,n){var u=i(l,n),c=u[0].z;a(n,c);var f=n.contours,h=t.extractOpts(n),d;if(f.coloring==="heatmap"&&h.auto&&n.autocontour===!1){var p=f.start,g=o(f),m=f.size||1,y=Math.floor((g-p)/m)+1;isFinite(m)||(m=1,y=1);var _=p-m/2,v=_+y*m;d=[_,v]}else d=c;return t.calc(l,n,{vals:d,cLetter:"z"}),u}}}),Hy=de({"src/traces/contour/constants.js"(e,r){"use strict";r.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),Ok=de({"src/traces/contour/make_crossings.js"(e,r){"use strict";var t=Hy();r.exports=function(o){var s=o[0].z,l=s.length,n=s[0].length,u=l===2||n===2,c,f,h,d,p,g,m,y,_;for(f=0;fa?0:1)+(o[0][1]>a?0:2)+(o[1][1]>a?0:4)+(o[1][0]>a?0:8);if(s===5||s===10){var l=(o[0][0]+o[0][1]+o[1][0]+o[1][1])/4;return a>l?s===5?713:1114:s===5?104:208}return s===15?0:s}}}),Nk=de({"src/traces/contour/find_all_paths.js"(e,r){"use strict";var t=Qt(),i=Hy();r.exports=function(c,f,h){var d,p,g,m,y;for(f=f||.01,h=h||.01,g=0;g20?(g=i.CHOOSESADDLE[g][(m[0]||m[1])<0?0:1],u.crossings[p]=i.SADDLEREMAINDER[g]):delete u.crossings[p],m=i.NEWDELTA[g],!m){t.log("Found bad marching index:",g,c,u.level);break}y.push(n(u,c,m)),c[0]+=m[0],c[1]+=m[1],p=c.join(","),a(y[y.length-1],y[y.length-2],h,d)&&y.pop();var C=m[0]&&(c[0]<0||c[0]>v-2)||m[1]&&(c[1]<0||c[1]>_-2),w=c[0]===x[0]&&c[1]===x[1]&&m[0]===S[0]&&m[1]===S[1];if(w||f&&C)break;g=u.crossings[p]}M===1e4&&t.log("Infinite loop in contour?");var k=a(y[0],y[y.length-1],h,d),A=0,b=.2*u.smoothing,E=[],T=0,F,D,R,P,z,I,L,B,O,G,W;for(M=1;M=T;M--)if(F=E[M],F=T&&F+E[D]B&&O--,u.edgepaths[O]=W.concat(y,G));break}N||(u.edgepaths[B]=y.concat(G))}for(B=0;B20&&c?u===208||u===1114?h=f[0]===0?1:-1:d=f[1]===0?1:-1:i.BOTTOMSTART.indexOf(u)!==-1?d=1:i.LEFTSTART.indexOf(u)!==-1?h=1:i.TOPSTART.indexOf(u)!==-1?d=-1:h=-1,[h,d]}function n(u,c,f){var h=c[0]+Math.max(f[0],0),d=c[1]+Math.max(f[1],0),p=u.z[d][h],g=u.xaxis,m=u.yaxis;if(f[1]){var y=(u.level-p)/(u.z[d][h+1]-p),_=(y!==1?(1-y)*g.c2l(u.x[h]):0)+(y!==0?y*g.c2l(u.x[h+1]):0);return[g.c2p(g.l2c(_),!0),m.c2p(u.y[d],!0),h+y,d]}else{var v=(u.level-p)/(u.z[d+1][h]-p),x=(v!==1?(1-v)*m.c2l(u.y[d]):0)+(v!==0?v*m.c2l(u.y[d+1]):0);return[g.c2p(u.x[h],!0),m.c2p(m.l2c(x),!0),h,d+v]}}}}),TG=de({"src/traces/contour/constraint_mapping.js"(e,r){"use strict";var t=h3(),i=da();r.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")};function a(l,n){var u=Array.isArray(n),c;function f(h){return i(h)?+h:null}return t.COMPARISON_OPS2.indexOf(l)!==-1?c=f(u?n[0]:n):t.INTERVAL_OPS.indexOf(l)!==-1?c=u?[f(n[0]),f(n[1])]:[f(n),f(n)]:t.SET_OPS.indexOf(l)!==-1&&(c=u?n.map(f):[f(n)]),c}function o(l){return function(n){n=a(l,n);var u=Math.min(n[0],n[1]),c=Math.max(n[0],n[1]);return{start:u,end:c,size:c-u}}}function s(l){return function(n){return n=a(l,n),{start:n,end:1/0,size:1/0}}}}}),jk=de({"src/traces/contour/empty_pathinfo.js"(e,r){"use strict";var t=Qt(),i=TG(),a=Gy();r.exports=function(s,l,n){for(var u=s.type==="constraint"?i[s._operation](s.value):s,c=u.size,f=[],h=a(u),d=n.trace._carpetTrace,p=d?{xaxis:d.aaxis,yaxis:d.baxis,x:n.a,y:n.b}:{xaxis:l.xaxis,yaxis:l.yaxis,x:n.x,y:n.y},g=u.start;g1e3){t.warn("Too many contours, clipping at 1000",s);break}return f}}}),Uk=de({"src/traces/contour/convert_to_constraints.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){var s,l,n,u=function(h){return h.reverse()},c=function(h){return h};switch(o){case"=":case"<":return a;case">":for(a.length!==1&&t.warn("Contour data invalid for the specified inequality operation."),l=a[0],s=0;sn.level||n.starts.length&&l===n.level)}break;case"constraint":if(a.prefixBoundary=!1,a.edgepaths.length)return;var u=a.x.length,c=a.y.length,f=-1/0,h=1/0;for(s=0;s":d>f&&(a.prefixBoundary=!0);break;case"<":(df||a.starts.length&&g===h)&&(a.prefixBoundary=!0);break;case"][":p=Math.min(d[0],d[1]),g=Math.max(d[0],d[1]),pf&&(a.prefixBoundary=!0);break}break}}}}),v3=de({"src/traces/contour/plot.js"(e){"use strict";var r=Yr(),t=Qt(),i=hn(),a=ks(),o=Zo(),s=nn(),l=Yd(),n=o3(),u=Ok(),c=Nk(),f=jk(),h=Uk(),d=qk(),p=Hy(),g=p.LABELOPTIMIZER;e.plot=function(w,k,A,b){var E=k.xaxis,T=k.yaxis;t.makeTraceGroups(b,A,"contour").each(function(F){var D=r.select(this),R=F[0],P=R.trace,z=R.x,I=R.y,L=P.contours,B=f(L,k,R),O=t.ensureSingle(D,"g","heatmapcoloring"),G=[];L.coloring==="heatmap"&&(G=[F]),n(w,k,G,O),u(B),c(B);var W=E.c2p(z[0],!0),X=E.c2p(z[z.length-1],!0),Z=T.c2p(I[0],!0),J=T.c2p(I[I.length-1],!0),N=[[W,J],[X,J],[X,Z],[W,Z]],H=B;L.type==="constraint"&&(H=h(B,L._operation)),m(D,N,L),y(D,H,N,L),v(D,B,w,R,L),S(D,k,w,R,N)})};function m(C,w,k){var A=t.ensureSingle(C,"g","contourbg"),b=A.selectAll("path").data(k.coloring==="fill"?[0]:[]);b.enter().append("path"),b.exit().remove(),b.attr("d","M"+w.join("L")+"Z").style("stroke","none")}function y(C,w,k,A){var b=A.coloring==="fill"||A.type==="constraint"&&A._operation!=="=",E="M"+k.join("L")+"Z";b&&d(w,A);var T=t.ensureSingle(C,"g","contourfill"),F=T.selectAll("path").data(b?w:[]);F.enter().append("path"),F.exit().remove(),F.each(function(D){var R=(D.prefixBoundary?E:"")+_(D,k);R?r.select(this).attr("d",R).style("stroke","none"):r.select(this).remove()})}function _(C,w){var k="",A=0,b=C.edgepaths.map(function(W,X){return X}),E=!0,T,F,D,R,P,z;function I(W){return Math.abs(W[1]-w[0][1])<.01}function L(W){return Math.abs(W[1]-w[2][1])<.01}function B(W){return Math.abs(W[0]-w[0][0])<.01}function O(W){return Math.abs(W[0]-w[2][0])<.01}for(;b.length;){for(z=i.smoothopen(C.edgepaths[A],C.smoothing),k+=E?z:z.replace(/^M/,"L"),b.splice(b.indexOf(A),1),T=C.edgepaths[A][C.edgepaths[A].length-1],R=-1,D=0;D<4;D++){if(!T){t.log("Missing end?",A,C);break}for(I(T)&&!O(T)?F=w[1]:B(T)?F=w[0]:L(T)?F=w[3]:O(T)&&(F=w[2]),P=0;P=0&&(F=G,R=P):Math.abs(T[1]-F[1])<.01?Math.abs(T[1]-G[1])<.01&&(G[0]-T[0])*(F[0]-G[0])>=0&&(F=G,R=P):t.log("endpt to newendpt is not vert. or horz.",T,F,G)}if(T=F,R>=0)break;k+="L"+F}if(R===C.edgepaths.length){t.log("unclosed perimeter path");break}A=R,E=b.indexOf(A)===-1,E&&(A=b[0],k+="Z")}for(A=0;Ag.MAXCOST*2)break;I&&(F/=2),T=R-F/2,D=T+F*1.5}if(z<=g.MAXCOST)return P};function x(C,w,k,A){var b=w.width/2,E=w.height/2,T=C.x,F=C.y,D=C.theta,R=Math.cos(D)*b,P=Math.sin(D)*b,z=(T>A.center?A.right-T:T-A.left)/(R+Math.abs(Math.sin(D)*E)),I=(F>A.middle?A.bottom-F:F-A.top)/(Math.abs(P)+Math.cos(D)*E);if(z<1||I<1)return 1/0;var L=g.EDGECOST*(1/(z-1)+1/(I-1));L+=g.ANGLECOST*D*D;for(var B=T-R,O=F-P,G=T+R,W=F+P,X=0;X=S)&&(n<=x&&(n=x),u>=S&&(u=S),f=Math.floor((u-n)/c)+1,h=0),v=0;vx&&(m.unshift(x),y.unshift(y[0])),m[m.length-1]2?d.value=d.value.slice(2):d.length===0?d.value=[0,1]:d.length<2?(p=parseFloat(d.value[0]),d.value=[p,p+1]):d.value=[parseFloat(d.value[0]),parseFloat(d.value[1])]:t(d.value)&&(p=parseFloat(d.value),d.value=[p,p+1])):(h("contours.value",0),t(d.value)||(n(d.value)?d.value=parseFloat(d.value[0]):d.value=0))}}}),SG=de({"src/traces/contour/defaults.js"(e,r){"use strict";var t=Qt(),i=Qw(),a=gd(),o=Hk(),s=d3(),l=p3(),n=qy(),u=Vy();r.exports=function(f,h,d,p){function g(v,x){return t.coerce(f,h,u,v,x)}function m(v){return t.coerce2(f,h,u,v)}var y=i(f,h,g,p);if(!y){h.visible=!1;return}a(f,h,p,g),g("xhoverformat"),g("yhoverformat"),g("text"),g("hovertext"),g("hoverongaps"),g("hovertemplate"),g("hovertemplatefallback");var _=g("contours.type")==="constraint";g("connectgaps",t.isArray1D(h.z)),_?o(f,h,g,p,d):(s(f,h,g,m),l(f,h,g,p)),h.contours&&h.contours.coloring==="heatmap"&&n(g,p),g("zorder")}}}),EG=de({"src/traces/contour/index.js"(e,r){"use strict";r.exports={attributes:Vy(),supplyDefaults:SG(),calc:Bk(),plot:v3().plot,style:m3(),colorbar:g3(),hoverPoints:Gk(),moduleType:"trace",name:"contour",basePlotModule:ml(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),kG=de({"lib/contour.js"(e,r){"use strict";r.exports=EG()}}),$k=de({"src/traces/scatterternary/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,texttemplateAttrs:i,templatefallbackAttrs:a}=Vo(),o=Kd(),s=tl(),l=ri(),n=cs(),u=fu().dash,c=fn().extendFlat,f=s.marker,h=s.line,d=f.line;r.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},s.mode,{dflt:"markers"}),text:c({},s.text,{}),texttemplate:i({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:a({editType:"plot"}),hovertext:c({},s.hovertext,{}),line:{color:h.color,width:h.width,dash:u,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:s.connectgaps,cliponaxis:s.cliponaxis,fill:c({},s.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o(),marker:c({symbol:f.symbol,opacity:f.opacity,angle:f.angle,angleref:f.angleref,standoff:f.standoff,maxdisplayed:f.maxdisplayed,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,line:c({width:d.width,dash:d.dash,editType:"calc"},n("marker.line")),gradient:f.gradient,editType:"calc"},n("marker")),textfont:s.textfont,textposition:s.textposition,selected:s.selected,unselected:s.unselected,hoverinfo:c({},l.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:s.hoveron,hovertemplate:t(),hovertemplatefallback:a()}}}),CG=de({"src/traces/scatterternary/defaults.js"(e,r){"use strict";var t=Qt(),i=Zd(),a=bs(),o=Nh(),s=yd(),l=p1(),n=_d(),u=Jd(),c=$k();r.exports=function(h,d,p,g){function m(C,w){return t.coerce(h,d,c,C,w)}var y=m("a"),_=m("b"),v=m("c"),x;if(y?(x=y.length,_?(x=Math.min(x,_.length),v&&(x=Math.min(x,v.length))):v?x=Math.min(x,v.length):x=0):_&&v&&(x=Math.min(_.length,v.length)),!x){d.visible=!1;return}d._length=x,m("sum"),m("text"),m("hovertext"),d.hoveron!=="fills"&&(m("hovertemplate"),m("hovertemplatefallback"));var S=x"),u.hovertemplate=g.hovertemplate,n}}}),IG=de({"src/traces/scatterternary/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){if(a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),s[l]){var n=s[l];i.a=n.a,i.b=n.b,i.c=n.c}else i.a=a.a,i.b=a.b,i.c=a.c;return i}}}),RG=de({"src/plots/ternary/ternary.js"(e,r){"use strict";var t=Yr(),i=Ma(),a=Qt(),o=a.strTranslate,s=a._,l=ta(),n=hn(),u=Yd(),c=fn().extendFlat,f=Es(),h=nn(),d=Uc(),p=$s(),g=Xd(),m=g.freeMode,y=g.rectMode,_=xv(),v=Zl().prepSelect,x=Zl().selectOnClick,S=Zl().clearOutline,M=Zl().clearSelectionsCache,C=zl();function w(I,L){this.id=I.id,this.graphDiv=I.graphDiv,this.init(L),this.makeFramework(L),this.updateFx(L),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}r.exports=w;var k=w.prototype;k.init=function(I){this.container=I._ternarylayer,this.defs=I._defs,this.layoutId=I._uid,this.traceHash={},this.layers={}},k.plot=function(I,L){var B=this,O=L[B.id],G=L._size;B._hasClipOnAxisFalse=!1;for(var W=0;WA*N?(K=N,Y=K*A):(Y=J,K=Y/A),te=X*Y/J,ne=Z*K/N,j=L.l+L.w*G-Y/2,q=L.t+L.h*(1-W)-K/2,B.x0=j,B.y0=q,B.w=Y,B.h=K,B.sum=H,B.xaxis={type:"linear",range:[$+2*V-H,H-$-2*U],domain:[G-te/2,G+te/2],_id:"x"},u(B.xaxis,B.graphDiv._fullLayout),B.xaxis.setScale(),B.xaxis.isPtWithinRange=function(Q){return Q.a>=B.aaxis.range[0]&&Q.a<=B.aaxis.range[1]&&Q.b>=B.baxis.range[1]&&Q.b<=B.baxis.range[0]&&Q.c>=B.caxis.range[1]&&Q.c<=B.caxis.range[0]},B.yaxis={type:"linear",range:[$,H-U-V],domain:[W-ne/2,W+ne/2],_id:"y"},u(B.yaxis,B.graphDiv._fullLayout),B.yaxis.setScale(),B.yaxis.isPtWithinRange=function(){return!0};var se=B.yaxis.domain[0],le=B.aaxis=c({},I.aaxis,{range:[$,H-U-V],side:"left",tickangle:(+I.aaxis.tickangle||0)-30,domain:[se,se+ne*A],anchor:"free",position:0,_id:"y",_length:Y});u(le,B.graphDiv._fullLayout),le.setScale();var ce=B.baxis=c({},I.baxis,{range:[H-$-V,U],side:"bottom",domain:B.xaxis.domain,anchor:"free",position:0,_id:"x",_length:Y});u(ce,B.graphDiv._fullLayout),ce.setScale();var pe=B.caxis=c({},I.caxis,{range:[H-$-U,V],side:"right",tickangle:(+I.caxis.tickangle||0)+30,domain:[se,se+ne*A],anchor:"free",position:0,_id:"y",_length:Y});u(pe,B.graphDiv._fullLayout),pe.setScale();var xe="M"+j+","+(q+K)+"h"+Y+"l-"+Y/2+",-"+K+"Z";B.clipDef.select("path").attr("d",xe),B.layers.plotbg.select("path").attr("d",xe);var ye="M0,"+K+"h"+Y+"l-"+Y/2+",-"+K+"Z";B.clipDefRelative.select("path").attr("d",ye);var fe=o(j,q);B.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",fe),B.clipDefRelative.select("path").attr("transform",null);var ae=o(j-ce._offset,q+K);B.layers.baxis.attr("transform",ae),B.layers.bgrid.attr("transform",ae);var ee=o(j+Y/2,q)+"rotate(30)"+o(0,-le._offset);B.layers.aaxis.attr("transform",ee),B.layers.agrid.attr("transform",ee);var ie=o(j+Y/2,q)+"rotate(-30)"+o(0,-pe._offset);B.layers.caxis.attr("transform",ie),B.layers.cgrid.attr("transform",ie),B.drawAxes(!0),B.layers.aline.select("path").attr("d",le.showline?"M"+j+","+(q+K)+"l"+Y/2+",-"+K:"M0,0").call(l.stroke,le.linecolor||"#000").style("stroke-width",(le.linewidth||0)+"px"),B.layers.bline.select("path").attr("d",ce.showline?"M"+j+","+(q+K)+"h"+Y:"M0,0").call(l.stroke,ce.linecolor||"#000").style("stroke-width",(ce.linewidth||0)+"px"),B.layers.cline.select("path").attr("d",pe.showline?"M"+(j+Y/2)+","+q+"l"+Y/2+","+K:"M0,0").call(l.stroke,pe.linecolor||"#000").style("stroke-width",(pe.linewidth||0)+"px"),B.graphDiv._context.staticPlot||B.initInteractions(),n.setClipUrl(B.layers.frontplot,B._hasClipOnAxisFalse?null:B.clipId,B.graphDiv)},k.drawAxes=function(I){var L=this,B=L.graphDiv,O=L.id.slice(7)+"title",G=L.layers,W=L.aaxis,X=L.baxis,Z=L.caxis;if(L.drawAx(W),L.drawAx(X),L.drawAx(Z),I){var J=Math.max(W.showticklabels?W.tickfont.size/2:0,(Z.showticklabels?Z.tickfont.size*.75:0)+(Z.ticks==="outside"?Z.ticklen*.87:0)),N=(X.showticklabels?X.tickfont.size:0)+(X.ticks==="outside"?X.ticklen:0)+3;G["a-title"]=_.draw(B,"a"+O,{propContainer:W,propName:L.id+".aaxis.title.text",placeholder:s(B,"Click to enter Component A title"),attributes:{x:L.x0+L.w/2,y:L.y0-W.title.font.size/3-J,"text-anchor":"middle"}}),G["b-title"]=_.draw(B,"b"+O,{propContainer:X,propName:L.id+".baxis.title.text",placeholder:s(B,"Click to enter Component B title"),attributes:{x:L.x0-N,y:L.y0+L.h+X.title.font.size*.83+N,"text-anchor":"middle"}}),G["c-title"]=_.draw(B,"c"+O,{propContainer:Z,propName:L.id+".caxis.title.text",placeholder:s(B,"Click to enter Component C title"),attributes:{x:L.x0+L.w+N,y:L.y0+L.h+Z.title.font.size*.83+N,"text-anchor":"middle"}})}},k.drawAx=function(I){var L=this,B=L.graphDiv,O=I._name,G=O.charAt(0),W=I._id,X=L.layers[O],Z=30,J=G+"tickLayout",N=b(I);L[J]!==N&&(X.selectAll("."+W+"tick").remove(),L[J]=N),I.setScale();var H=h.calcTicks(I),$=h.clipEnds(I,H),U=h.makeTransTickFn(I),V=h.getTickSigns(I)[2],j=a.deg2rad(Z),q=V*(I.linewidth||1)/2,Y=V*I.ticklen,K=L.w,te=L.h,ne=G==="b"?"M0,"+q+"l"+Math.sin(j)*Y+","+Math.cos(j)*Y:"M"+q+",0l"+Math.cos(j)*Y+","+-Math.sin(j)*Y,se={a:"M0,0l"+te+",-"+K/2,b:"M0,0l-"+K/2+",-"+te,c:"M0,0l-"+te+","+K/2}[G];h.drawTicks(B,I,{vals:I.ticks==="inside"?$:H,layer:X,path:ne,transFn:U,crisp:!1}),h.drawGrid(B,I,{vals:$,layer:L.layers[G+"grid"],path:se,transFn:U,crisp:!1}),h.drawLabels(B,I,{vals:H,layer:X,transFn:U,labelFns:h.makeLabelFns(I,0,Z)})};function b(I){return I.ticks+String(I.ticklen)+String(I.showticklabels)}var E=C.MINZOOM/2+.87,T="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(E*.87+4.5)+"l2.6,1.5l-"+E/2+","+E*.87+"Z",F="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(E*.87+4.5)+"l-2.6,1.5l"+E/2+","+E*.87+"Z",D="m0,1l"+E/2+","+E*.87+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(E*.87+4.5)+"l-"+(E/2+2.6)+","+(E*.87+4.5)+"l2.6,1.5l"+E/2+",-"+E*.87+"Z",R="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",P=!0;k.clearOutline=function(){M(this.dragOptions),S(this.dragOptions.gd)},k.initInteractions=function(){var I=this,L=I.layers.plotbg.select("path").node(),B=I.graphDiv,O=B._fullLayout._zoomlayer,G,W;this.dragOptions={element:L,gd:B,plotinfo:{id:I.id,domain:B._fullLayout[I.id].domain,xaxis:I.xaxis,yaxis:I.yaxis},subplot:I.id,prepFn:function(ae,ee,ie){I.dragOptions.xaxes=[I.xaxis],I.dragOptions.yaxes=[I.yaxis],G=B._fullLayout._invScaleX,W=B._fullLayout._invScaleY;var Q=I.dragOptions.dragmode=B._fullLayout.dragmode;m(Q)?I.dragOptions.minDrag=1:I.dragOptions.minDrag=void 0,Q==="zoom"?(I.dragOptions.moveFn=ce,I.dragOptions.clickFn=K,I.dragOptions.doneFn=pe,te(ae,ee,ie)):Q==="pan"?(I.dragOptions.moveFn=ye,I.dragOptions.clickFn=K,I.dragOptions.doneFn=fe,xe(),I.clearOutline(B)):(y(Q)||m(Q))&&v(ae,ee,ie,I.dragOptions,Q)}};var X,Z,J,N,H,$,U,V,j,q;function Y(ae){var ee={};return ee[I.id+".aaxis.min"]=ae.a,ee[I.id+".baxis.min"]=ae.b,ee[I.id+".caxis.min"]=ae.c,ee}function K(ae,ee){var ie=B._fullLayout.clickmode;z(B),ae===2&&(B.emit("plotly_doubleclick",null),i.call("_guiRelayout",B,Y({a:0,b:0,c:0}))),ie.indexOf("select")>-1&&ae===1&&x(ee,B,[I.xaxis],[I.yaxis],I.id,I.dragOptions),ie.indexOf("event")>-1&&p.click(B,ee,I.id)}function te(ae,ee,ie){var Q=L.getBoundingClientRect();X=ee-Q.left,Z=ie-Q.top,B._fullLayout._calcInverseTransform(B);var ue=B._fullLayout._invTransform,ge=a.apply3DTransform(ue)(X,Z);X=ge[0],Z=ge[1],J={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},H=J,N=I.aaxis.range[1]-J.a,$=l.luminosity(I.graphDiv._fullLayout[I.id].bgcolor),U="M0,"+I.h+"L"+I.w/2+", 0L"+I.w+","+I.h+"Z",V=!1,j=O.append("path").attr("class","zoombox").attr("transform",o(I.x0,I.y0)).style({fill:$>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",U),q=O.append("path").attr("class","zoombox-corners").attr("transform",o(I.x0,I.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),I.clearOutline(B)}function ne(ae,ee){return 1-ee/I.h}function se(ae,ee){return 1-(ae+(I.h-ee)/Math.sqrt(3))/I.w}function le(ae,ee){return(ae-(I.h-ee)/Math.sqrt(3))/I.w}function ce(ae,ee){var ie=X+ae*G,Q=Z+ee*W,ue=Math.max(0,Math.min(1,ne(X,Z),ne(ie,Q))),ge=Math.max(0,Math.min(1,se(X,Z),se(ie,Q))),Me=Math.max(0,Math.min(1,le(X,Z),le(ie,Q))),Te=(ue/2+Me)*I.w,je=(1-ue/2-ge)*I.w,Ve=(Te+je)/2,Ze=je-Te,Ke=(1-ue)*I.h,vt=Ke-Ze/A;Ze.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),q.transition().style("opacity",1).duration(200),V=!0),B.emit("plotly_relayouting",Y(H))}function pe(){z(B),H!==J&&(i.call("_guiRelayout",B,Y(H)),P&&B.data&&B._context.showTips&&(a.notifier(s(B,"Double-click to zoom back out"),"long",B),P=!1))}function xe(){J={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},H=J}function ye(ae,ee){var ie=ae/I.xaxis._m,Q=ee/I.yaxis._m;H={a:J.a-Q,b:J.b+(ie+Q)/2,c:J.c-(ie-Q)/2};var ue=[H.a,H.b,H.c].sort(a.sorterAsc),ge={a:ue.indexOf(H.a),b:ue.indexOf(H.b),c:ue.indexOf(H.c)};ue[0]<0&&(ue[1]+ue[0]/2<0?(ue[2]+=ue[0]+ue[1],ue[0]=ue[1]=0):(ue[2]+=ue[0]/2,ue[1]+=ue[0]/2,ue[0]=0),H={a:ue[ge.a],b:ue[ge.b],c:ue[ge.c]},ee=(J.a-H.a)*I.yaxis._m,ae=(J.c-H.c-J.b+H.b)*I.xaxis._m);var Me=o(I.x0+ae,I.y0+ee);I.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Me);var Te=o(-ae,-ee);I.clipDefRelative.select("path").attr("transform",Te),I.aaxis.range=[H.a,I.sum-H.b-H.c],I.baxis.range=[I.sum-H.a-H.c,H.b],I.caxis.range=[I.sum-H.a-H.b,H.c],I.drawAxes(!1),I._hasClipOnAxisFalse&&I.plotContainer.select(".scatterlayer").selectAll(".trace").call(n.hideOutsideRangePoints,I),B.emit("plotly_relayouting",Y(H))}function fe(){i.call("_guiRelayout",B,Y(H))}L.onmousemove=function(ae){p.hover(B,ae,I.id),B._fullLayout._lasthover=L,B._fullLayout._hoversubplot=I.id},L.onmouseout=function(ae){B._dragging||d.unhover(B,ae)},d.init(this.dragOptions)};function z(I){t.select(I).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),Wk=de({"src/plots/ternary/layout_attributes.js"(e,r){"use strict";var t=Jo(),i=Is().attributes,a=Mu(),o=Ps().overrideAll,s=fn().extendFlat,l={title:{text:a.title.text,font:a.title.font},color:a.color,tickmode:a.minor.tickmode,nticks:s({},a.nticks,{dflt:6,min:1}),tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:a.ticks,ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,ticklabelstep:a.ticklabelstep,showticklabels:a.showticklabels,labelalias:a.labelalias,showtickprefix:a.showtickprefix,tickprefix:a.tickprefix,showticksuffix:a.showticksuffix,ticksuffix:a.ticksuffix,showexponent:a.showexponent,exponentformat:a.exponentformat,minexponent:a.minexponent,separatethousands:a.separatethousands,tickfont:a.tickfont,tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,hoverformat:a.hoverformat,showline:s({},a.showline,{dflt:!0}),linecolor:a.linecolor,linewidth:a.linewidth,showgrid:s({},a.showgrid,{dflt:!0}),gridcolor:a.gridcolor,gridwidth:a.gridwidth,griddash:a.griddash,layer:a.layer,min:{valType:"number",dflt:0,min:0}},n=r.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:t.background},sum:{valType:"number",dflt:1,min:0},aaxis:l,baxis:l,caxis:l},"plot","from-root");n.uirevision={valType:"any",editType:"none"},n.aaxis.uirevision=n.baxis.uirevision=n.caxis.uirevision={valType:"any",editType:"none"}}}),Ev=de({"src/plots/subplot_defaults.js"(e,r){"use strict";var t=Qt(),i=Ro(),a=Is().defaults;r.exports=function(s,l,n,u){var c=u.type,f=u.attributes,h=u.handleDefaults,d=u.partition||"x",p=l._subplots[c],g=p.length,m=g&&p[0].replace(/\d+$/,""),y,_;function v(C,w){return t.coerce(y,_,f,C,w)}for(var x=0;x=x&&(k.min=0,A.min=0,b.min=0,g.aaxis&&delete g.aaxis.min,g.baxis&&delete g.baxis.min,g.caxis&&delete g.caxis.min)}function p(g,m,y,_){var v=f[m._name];function x(E,T){return a.coerce(g,m,v,E,T)}x("uirevision",_.uirevision),m.type="linear";var S=x("color"),M=S!==v.color.dflt?S:y.font.color,C=m._name,w=C.charAt(0).toUpperCase(),k="Component "+w,A=x("title.text",k);m._hovertitle=A===k?A:w,a.coerceFont(x,"title.font",y.font,{overrideDflt:{size:a.bigFont(y.font.size),color:M}}),x("min"),u(g,m,x,"linear"),l(g,m,x,"linear"),s(g,m,x,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),n(g,m,x,{outerTicks:!0});var b=x("showticklabels");b&&(a.coerceFont(x,"tickfont",y.font,{overrideDflt:{color:M}}),x("tickangle"),x("tickformat")),c(g,m,x,{dfltColor:S,bgColor:y.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:v}),x("hoverformat"),x("layer")}}}),BG=de({"src/plots/ternary/index.js"(e){"use strict";var r=RG(),t=$u().getSubplotCalcData,i=Qt().counterRegex,a="ternary";e.name=a;var o=e.attr="subplot";e.idRoot=a,e.idRegex=e.attrRegex=i(a);var s=e.attributes={};s[o]={valType:"subplotid",dflt:"ternary",editType:"calc"},e.layoutAttributes=Wk(),e.supplyLayoutDefaults=zG(),e.plot=function(n){for(var u=n._fullLayout,c=n.calcdata,f=u._subplots[a],h=0;h0){var C=n.xa,w=n.ya,k,A,b,E,T;g.orientation==="h"?(T=u,k="y",b=w,A="x",E=C):(T=c,k="x",b=C,A="y",E=w);var F=p[n.index];if(T>=F.span[0]&&T<=F.span[1]){var D=i.extendFlat({},n),R=E.c2p(T,!0),P=s.getKdeValue(F,g,T),z=s.getPositionOnKdePath(F,g,R),I=b._offset,L=b._length;D[k+"0"]=z[0],D[k+"1"]=z[1],D[A+"0"]=D[A+"1"]=R,D[A+"Label"]=A+": "+a.hoverLabelText(E,T,g[A+"hoverformat"])+", "+p[0].t.labels.kde+" "+P.toFixed(3);for(var B=0,O=0;O path").each(function(y){if(!y.isBlank){var _=m.marker;t.select(this).call(a.fill,y.mc||_.color).call(a.stroke,y.mlc||_.line.color).call(i.dashLine,_.line.dash,y.mlw||_.line.width).style("opacity",m.selectedpoints&&!y.selected?o:1)}}),n(g,m,c),g.selectAll(".regions").each(function(){t.select(this).selectAll("path").style("stroke-width",0).call(a.fill,m.connector.fillcolor)}),g.selectAll(".lines").each(function(){var y=m.connector.line;i.lineGroupStyle(t.select(this).selectAll("path"),y.width,y.color,y.dash)})})}r.exports={style:u}}}),rH=de({"src/traces/funnel/hover.js"(e,r){"use strict";var t=ta().opacity,i=y1().hoverOnBars,a=Qt().formatPercent;r.exports=function(l,n,u,c,f){var h=i(l,n,u,c,f);if(h){var d=h.cd,p=d[0].trace,g=p.orientation==="h",m=h.index,y=d[m],_=g?"x":"y";h[_+"LabelVal"]=y.s,h.percentInitial=y.begR,h.percentInitialLabel=a(y.begR,1),h.percentPrevious=y.difR,h.percentPreviousLabel=a(y.difR,1),h.percentTotal=y.sumR,h.percentTotalLabel=a(y.sumR,1);var v=y.hi||p.hoverinfo,x=[];if(v&&v!=="none"&&v!=="skip"){var S=v==="all",M=v.split("+"),C=function(w){return S||M.indexOf(w)!==-1};C("percent initial")&&x.push(h.percentInitialLabel+" of initial"),C("percent previous")&&x.push(h.percentPreviousLabel+" of previous"),C("percent total")&&x.push(h.percentTotalLabel+" of total")}return h.extraText=x.join("
"),h.color=o(p,y),[h]}};function o(s,l){var n=s.marker,u=l.mc||n.color,c=l.mlc||n.line.color,f=l.mlw||n.line.width;if(t(u))return u;if(t(c)&&f)return c}}}),iH=de({"src/traces/funnel/event_data.js"(e,r){"use strict";r.exports=function(i,a){return i.x="xVal"in a?a.xVal:a.x,i.y="yVal"in a?a.yVal:a.y,"percentInitial"in a&&(i.percentInitial=a.percentInitial),"percentPrevious"in a&&(i.percentPrevious=a.percentPrevious),"percentTotal"in a&&(i.percentTotal=a.percentTotal),a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),i}}}),aH=de({"src/traces/funnel/index.js"(e,r){"use strict";r.exports={attributes:Zk(),layoutAttributes:Kk(),supplyDefaults:Jk().supplyDefaults,crossTraceDefaults:Jk().crossTraceDefaults,supplyLayoutDefaults:ZG(),calc:JG(),crossTraceCalc:QG(),plot:eH(),style:tH().style,hoverPoints:rH(),eventData:iH(),selectPoints:_1(),moduleType:"trace",name:"funnel",basePlotModule:ml(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),nH=de({"lib/funnel.js"(e,r){"use strict";r.exports=aH()}}),oH=de({"src/traces/waterfall/constants.js"(e,r){"use strict";r.exports={eventDataKeys:["initial","delta","final"]}}}),Qk=de({"src/traces/waterfall/attributes.js"(e,r){"use strict";var t=ep(),i=tl().line,a=ri(),o=Ns().axisHoverFormat,{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:n}=Vo(),u=oH(),c=fn().extendFlat,f=ta();function h(d){return{marker:{color:c({},t.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},t.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},t.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}r.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:t.x,x0:t.x0,dx:t.dx,y:t.y,y0:t.y0,dy:t.dy,xperiod:t.xperiod,yperiod:t.yperiod,xperiod0:t.xperiod0,yperiod0:t.yperiod0,xperiodalignment:t.xperiodalignment,yperiodalignment:t.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),hovertext:t.hovertext,hovertemplate:s({},{keys:u.eventDataKeys}),hovertemplatefallback:n(),hoverinfo:c({},a.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:l({editType:"plot"},{keys:u.eventDataKeys.concat(["label"])}),texttemplatefallback:n({editType:"plot"}),text:t.text,textposition:t.textposition,insidetextanchor:t.insidetextanchor,textangle:t.textangle,textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:t.outsidetextfont,constraintext:t.constraintext,cliponaxis:t.cliponaxis,orientation:t.orientation,offset:t.offset,width:t.width,increasing:h("increasing"),decreasing:h("decreasing"),totals:h("intermediate sums and total"),connector:{line:{color:c({},i.color,{dflt:f.defaultLine}),width:c({},i.width,{editType:"plot"}),dash:i.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:t.offsetgroup,alignmentgroup:t.alignmentgroup,zorder:t.zorder}}}),eC=de({"src/traces/waterfall/layout_attributes.js"(e,r){"use strict";r.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),w1=de({"src/constants/delta.js"(e,r){"use strict";r.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25B2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25BC"}}}}),tC=de({"src/traces/waterfall/defaults.js"(e,r){"use strict";var t=Qt(),i=Tv(),a=oh().handleText,o=wv(),s=gd(),l=Qk(),n=ta(),u=w1(),c=u.INCREASING.COLOR,f=u.DECREASING.COLOR,h="#4499FF";function d(m,y,_){m(y+".marker.color",_),m(y+".marker.line.color",n.defaultLine),m(y+".marker.line.width")}function p(m,y,_,v){function x(k,A){return t.coerce(m,y,l,k,A)}var S=o(m,y,v,x);if(!S){y.visible=!1;return}s(m,y,v,x),x("xhoverformat"),x("yhoverformat"),x("measure"),x("orientation",y.x&&!y.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var M=x("textposition");a(m,y,v,x,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),y.textposition!=="none"&&(x("texttemplate"),x("texttemplatefallback"),y.texttemplate||x("textinfo")),d(x,"increasing",c),d(x,"decreasing",f),d(x,"totals",h);var C=x("connector.visible");if(C){x("connector.mode");var w=x("connector.line.width");w&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function g(m,y){var _,v;function x(M){return t.coerce(v._input,v,l,M)}if(y.waterfallmode==="group")for(var S=0;S0&&(x?T+="M"+b[0]+","+E[1]+"V"+E[0]:T+="M"+b[1]+","+E[0]+"H"+b[0]),S!=="between"&&(w.isSum||k path").each(function(y){if(!y.isBlank){var _=m[y.dir].marker;t.select(this).call(a.fill,_.color).call(a.stroke,_.line.color).call(i.dashLine,_.line.dash,_.line.width).style("opacity",m.selectedpoints&&!y.selected?o:1)}}),n(g,m,c),g.selectAll(".lines").each(function(){var y=m.connector.line;i.lineGroupStyle(t.select(this).selectAll("path"),y.width,y.color,y.dash)})})}r.exports={style:u}}}),hH=de({"src/traces/waterfall/hover.js"(e,r){"use strict";var t=nn().hoverLabelText,i=ta().opacity,a=y1().hoverOnBars,o=w1(),s={increasing:o.INCREASING.SYMBOL,decreasing:o.DECREASING.SYMBOL};r.exports=function(u,c,f,h,d){var p=a(u,c,f,h,d);if(!p)return;var g=p.cd,m=g[0].trace,y=m.orientation==="h",_=y?"x":"y",v=y?u.xa:u.ya;function x(F){return t(v,F,m[_+"hoverformat"])}var S=p.index,M=g[S],C=M.isSum?M.b+M.s:M.rawS;p.initial=M.b+M.s-C,p.delta=C,p.final=p.initial+p.delta;var w=x(Math.abs(p.delta));p.deltaLabel=C<0?"("+w+")":w,p.finalLabel=x(p.final),p.initialLabel=x(p.initial);var k=M.hi||m.hoverinfo,A=[];if(k&&k!=="none"&&k!=="skip"){var b=k==="all",E=k.split("+"),T=function(F){return b||E.indexOf(F)!==-1};M.isSum||(T("final")&&(y?!T("x"):!T("y"))&&A.push(p.finalLabel),T("delta")&&(C<0?A.push(p.deltaLabel+" "+s.decreasing):A.push(p.deltaLabel+" "+s.increasing)),T("initial")&&A.push("Initial: "+p.initialLabel))}return A.length&&(p.extraText=A.join("
")),p.color=l(m,M),[p]};function l(n,u){var c=n[u.dir].marker,f=c.color,h=c.line.color,d=c.line.width;if(i(f))return f;if(i(h)&&d)return h}}}),dH=de({"src/traces/waterfall/event_data.js"(e,r){"use strict";r.exports=function(i,a){return i.x="xVal"in a?a.xVal:a.x,i.y="yVal"in a?a.yVal:a.y,"initial"in a&&(i.initial=a.initial),"delta"in a&&(i.delta=a.delta),"final"in a&&(i.final=a.final),a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),i}}}),pH=de({"src/traces/waterfall/index.js"(e,r){"use strict";r.exports={attributes:Qk(),layoutAttributes:eC(),supplyDefaults:tC().supplyDefaults,crossTraceDefaults:tC().crossTraceDefaults,supplyLayoutDefaults:sH(),calc:lH(),crossTraceCalc:uH(),plot:cH(),style:fH().style,hoverPoints:hH(),eventData:dH(),selectPoints:_1(),moduleType:"trace",name:"waterfall",basePlotModule:ml(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),vH=de({"lib/waterfall.js"(e,r){"use strict";r.exports=pH()}}),T1=de({"src/traces/image/constants.js"(e,r){"use strict";r.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var i=t.slice(0,3);return i[1]=i[1]+"%",i[2]=i[2]+"%",i},suffix:["\xB0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var i=t.slice(0,4);return i[1]=i[1]+"%",i[2]=i[2]+"%",i},suffix:["\xB0","%","%",""]}}}}}),_3={};Mr(_3,{default:()=>sC});var rC,iC,x3,aC,nC,b3,w3,T3,oC,sC,lC=Ir({"src/traces/image/attributes.ts"(){"use strict";rC=Vr(fn()),iC=Vr(ri()),x3=Vr(Vo()),aC=Vr(tl()),nC=Vr(T1()),b3=["rgb","rgba","rgba256","hsl","hsla"],w3=[],T3=[];for(let e of b3){let r=nC.colormodel[e];w3.push(`For the \`${e}\` colormodel, it is [${(r.zminDflt||r.min).join(", ")}].`),T3.push(`For the \`${e}\` colormodel, it is [${(r.zmaxDflt||r.max).join(", ")}].`)}oC={source:{valType:"string",editType:"calc",description:["Specifies the data URI of the image to be visualized.",'The URI consists of "data:image/[][;base64\\\\],"'].join(" ")},z:{valType:"data_array",editType:"calc",description:["A 2-dimensional array in which each element is an array of 3 or 4 numbers representing a color."].join(" ")},colormodel:{valType:"enumerated",values:b3,editType:"calc",description:["Color model used to map the numerical color components described in `z` into colors.","If `source` is specified, this attribute will be set to `rgba256`","otherwise it defaults to `rgb`."].join(" ")},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot",description:["Picks a smoothing algorithm used to smooth `z` data.","This only applies for image traces that use the `source` attribute."].join(" ")},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["Array defining the lower bound for each color component.","Note that the default value will depend on the colormodel.",w3.join(" ")].join(" ")},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["Array defining the higher bound for each color component.","Note that the default value will depend on the colormodel.",T3.join(" ")].join(" ")},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",description:["Set the image's x position. The left edge of the image","(or the right edge if the x axis is reversed or dx is negative)","will be found at xmin=x0-dx/2"].join(" ")},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",description:["Set the image's y position. The top edge of the image","(or the bottom edge if the y axis is NOT reversed or if dy is negative)","will be found at ymin=y0-dy/2. By default when an image trace is","included, the y axis will be reversed so that the image is right-side-up,","but you can disable this by setting yaxis.autorange=true or by providing","an explicit y axis range."].join(" ")},dx:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's horizontal size."},dy:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's vertical size"},text:{valType:"data_array",editType:"plot",description:"Sets the text elements associated with each z value."},hovertext:{valType:"data_array",editType:"plot",description:"Same as `text`."},hoverinfo:(0,rC.extendFlat)({},iC.default.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:(0,x3.hovertemplateAttrs)({},{keys:["z","color","colormodel"]}),hovertemplatefallback:(0,x3.templatefallbackAttrs)(),zorder:aC.zorder},sC=oC}}),mH=de({"src/traces/image/defaults.js"(e,r){"use strict";var t=Qt(),i=(lC(),ti(_3)).default,a=T1(),o=Mp().IMAGE_URL_PREFIX;r.exports=function(l,n){function u(h,d){return t.coerce(l,n,i,h,d)}u("source"),n.source&&!n.source.match(o)&&delete n.source,n._hasSource=!!n.source;var c=u("z");if(n._hasZ=!(c===void 0||!c.length||!c[0]||!c[0].length),!n._hasZ&&!n._hasSource){n.visible=!1;return}u("x0"),u("y0"),u("dx"),u("dy");var f;n._hasZ?(u("colormodel","rgb"),f=a.colormodel[n.colormodel],u("zmin",f.zminDflt||f.min),u("zmax",f.zmaxDflt||f.max)):n._hasSource&&(n.colormodel="rgba256",f=a.colormodel[n.colormodel],n.zmin=f.zminDflt,n.zmax=f.zmaxDflt),u("zsmooth"),u("text"),u("hovertext"),u("hovertemplate"),u("hovertemplatefallback"),n._length=null,u("zorder")}}}),Sp=de({"node_modules/inherits/inherits_browser.js"(e,r){typeof Object.create=="function"?r.exports=function(i,a){a&&(i.super_=a,i.prototype=Object.create(a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(i,a){if(a){i.super_=a;var o=function(){};o.prototype=a.prototype,i.prototype=new o,i.prototype.constructor=i}}}}),uC=de({"node_modules/readable-stream/lib/internal/streams/stream-browser.js"(e,r){r.exports=yv().EventEmitter}}),gH=de({"node_modules/base64-js/index.js"(e){"use strict";e.byteLength=n,e.toByteArray=c,e.fromByteArray=d;var r=[],t=[],i=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var m=p.indexOf("=");m===-1&&(m=g);var y=m===g?0:4-m%4;return[m,y]}function n(p){var g=l(p),m=g[0],y=g[1];return(m+y)*3/4-y}function u(p,g,m){return(g+m)*3/4-m}function c(p){var g,m=l(p),y=m[0],_=m[1],v=new i(u(p,y,_)),x=0,S=_>0?y-4:y,M;for(M=0;M>16&255,v[x++]=g>>8&255,v[x++]=g&255;return _===2&&(g=t[p.charCodeAt(M)]<<2|t[p.charCodeAt(M+1)]>>4,v[x++]=g&255),_===1&&(g=t[p.charCodeAt(M)]<<10|t[p.charCodeAt(M+1)]<<4|t[p.charCodeAt(M+2)]>>2,v[x++]=g>>8&255,v[x++]=g&255),v}function f(p){return r[p>>18&63]+r[p>>12&63]+r[p>>6&63]+r[p&63]}function h(p,g,m){for(var y,_=[],v=g;vS?S:x+v));return y===1?(g=p[m-1],_.push(r[g>>2]+r[g<<4&63]+"==")):y===2&&(g=(p[m-2]<<8)+p[m-1],_.push(r[g>>10]+r[g>>4&63]+r[g<<2&63]+"=")),_.join("")}}}),yH=de({"node_modules/ieee754/index.js"(e){e.read=function(r,t,i,a,o){var s,l,n=o*8-a-1,u=(1<>1,f=-7,h=i?o-1:0,d=i?-1:1,p=r[t+h];for(h+=d,s=p&(1<<-f)-1,p>>=-f,f+=n;f>0;s=s*256+r[t+h],h+=d,f-=8);for(l=s&(1<<-f)-1,s>>=-f,f+=a;f>0;l=l*256+r[t+h],h+=d,f-=8);if(s===0)s=1-c;else{if(s===u)return l?NaN:(p?-1:1)*(1/0);l=l+Math.pow(2,a),s=s-c}return(p?-1:1)*l*Math.pow(2,s-a)},e.write=function(r,t,i,a,o,s){var l,n,u,c=s*8-o-1,f=(1<>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=a?0:s-1,g=a?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(n=isNaN(t)?1:0,l=f):(l=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-l))<1&&(l--,u*=2),l+h>=1?t+=d/u:t+=d*Math.pow(2,1-h),t*u>=2&&(l++,u/=2),l+h>=f?(n=0,l=f):l+h>=1?(n=(t*u-1)*Math.pow(2,o),l=l+h):(n=t*Math.pow(2,h-1)*Math.pow(2,o),l=0));o>=8;r[i+p]=n&255,p+=g,n/=256,o-=8);for(l=l<0;r[i+p]=l&255,p+=g,l/=256,c-=8);r[i+p-g]|=m*128}}}),kv=de({"node_modules/buffer/index.js"(e){"use strict";var r=gH(),t=yH(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=_,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=o(),!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{let ee=new Uint8Array(1),ie={foo:function(){return 42}};return Object.setPrototypeOf(ie,Uint8Array.prototype),Object.setPrototypeOf(ee,ie),ee.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function s(ee){if(ee>a)throw new RangeError('The value "'+ee+'" is invalid for option "size"');let ie=new Uint8Array(ee);return Object.setPrototypeOf(ie,l.prototype),ie}function l(ee,ie,Q){if(typeof ee=="number"){if(typeof ie=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(ee)}return n(ee,ie,Q)}l.poolSize=8192;function n(ee,ie,Q){if(typeof ee=="string")return h(ee,ie);if(ArrayBuffer.isView(ee))return p(ee);if(ee==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee);if(pe(ee,ArrayBuffer)||ee&&pe(ee.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pe(ee,SharedArrayBuffer)||ee&&pe(ee.buffer,SharedArrayBuffer)))return g(ee,ie,Q);if(typeof ee=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ue=ee.valueOf&&ee.valueOf();if(ue!=null&&ue!==ee)return l.from(ue,ie,Q);let ge=m(ee);if(ge)return ge;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ee[Symbol.toPrimitive]=="function")return l.from(ee[Symbol.toPrimitive]("string"),ie,Q);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee)}l.from=function(ee,ie,Q){return n(ee,ie,Q)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function u(ee){if(typeof ee!="number")throw new TypeError('"size" argument must be of type number');if(ee<0)throw new RangeError('The value "'+ee+'" is invalid for option "size"')}function c(ee,ie,Q){return u(ee),ee<=0?s(ee):ie!==void 0?typeof Q=="string"?s(ee).fill(ie,Q):s(ee).fill(ie):s(ee)}l.alloc=function(ee,ie,Q){return c(ee,ie,Q)};function f(ee){return u(ee),s(ee<0?0:y(ee)|0)}l.allocUnsafe=function(ee){return f(ee)},l.allocUnsafeSlow=function(ee){return f(ee)};function h(ee,ie){if((typeof ie!="string"||ie==="")&&(ie="utf8"),!l.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);let Q=v(ee,ie)|0,ue=s(Q),ge=ue.write(ee,ie);return ge!==Q&&(ue=ue.slice(0,ge)),ue}function d(ee){let ie=ee.length<0?0:y(ee.length)|0,Q=s(ie);for(let ue=0;ue=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return ee|0}function _(ee){return+ee!=ee&&(ee=0),l.alloc(+ee)}l.isBuffer=function(ie){return ie!=null&&ie._isBuffer===!0&&ie!==l.prototype},l.compare=function(ie,Q){if(pe(ie,Uint8Array)&&(ie=l.from(ie,ie.offset,ie.byteLength)),pe(Q,Uint8Array)&&(Q=l.from(Q,Q.offset,Q.byteLength)),!l.isBuffer(ie)||!l.isBuffer(Q))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ie===Q)return 0;let ue=ie.length,ge=Q.length;for(let Me=0,Te=Math.min(ue,ge);Mege.length?(l.isBuffer(Te)||(Te=l.from(Te)),Te.copy(ge,Me)):Uint8Array.prototype.set.call(ge,Te,Me);else if(l.isBuffer(Te))Te.copy(ge,Me);else throw new TypeError('"list" argument must be an Array of Buffers');Me+=Te.length}return ge};function v(ee,ie){if(l.isBuffer(ee))return ee.length;if(ArrayBuffer.isView(ee)||pe(ee,ArrayBuffer))return ee.byteLength;if(typeof ee!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ee);let Q=ee.length,ue=arguments.length>2&&arguments[2]===!0;if(!ue&&Q===0)return 0;let ge=!1;for(;;)switch(ie){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":return te(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return le(ee).length;default:if(ge)return ue?-1:te(ee).length;ie=(""+ie).toLowerCase(),ge=!0}}l.byteLength=v;function x(ee,ie,Q){let ue=!1;if((ie===void 0||ie<0)&&(ie=0),ie>this.length||((Q===void 0||Q>this.length)&&(Q=this.length),Q<=0)||(Q>>>=0,ie>>>=0,Q<=ie))return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return I(this,ie,Q);case"utf8":case"utf-8":return F(this,ie,Q);case"ascii":return P(this,ie,Q);case"latin1":case"binary":return z(this,ie,Q);case"base64":return T(this,ie,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,ie,Q);default:if(ue)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),ue=!0}}l.prototype._isBuffer=!0;function S(ee,ie,Q){let ue=ee[ie];ee[ie]=ee[Q],ee[Q]=ue}l.prototype.swap16=function(){let ie=this.length;if(ie%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Q=0;QQ&&(ie+=" ... "),""},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(ie,Q,ue,ge,Me){if(pe(ie,Uint8Array)&&(ie=l.from(ie,ie.offset,ie.byteLength)),!l.isBuffer(ie))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ie);if(Q===void 0&&(Q=0),ue===void 0&&(ue=ie?ie.length:0),ge===void 0&&(ge=0),Me===void 0&&(Me=this.length),Q<0||ue>ie.length||ge<0||Me>this.length)throw new RangeError("out of range index");if(ge>=Me&&Q>=ue)return 0;if(ge>=Me)return-1;if(Q>=ue)return 1;if(Q>>>=0,ue>>>=0,ge>>>=0,Me>>>=0,this===ie)return 0;let Te=Me-ge,je=ue-Q,Ve=Math.min(Te,je),Ze=this.slice(ge,Me),Ke=ie.slice(Q,ue);for(let vt=0;vt2147483647?Q=2147483647:Q<-2147483648&&(Q=-2147483648),Q=+Q,xe(Q)&&(Q=ge?0:ee.length-1),Q<0&&(Q=ee.length+Q),Q>=ee.length){if(ge)return-1;Q=ee.length-1}else if(Q<0)if(ge)Q=0;else return-1;if(typeof ie=="string"&&(ie=l.from(ie,ue)),l.isBuffer(ie))return ie.length===0?-1:C(ee,ie,Q,ue,ge);if(typeof ie=="number")return ie=ie&255,typeof Uint8Array.prototype.indexOf=="function"?ge?Uint8Array.prototype.indexOf.call(ee,ie,Q):Uint8Array.prototype.lastIndexOf.call(ee,ie,Q):C(ee,[ie],Q,ue,ge);throw new TypeError("val must be string, number or Buffer")}function C(ee,ie,Q,ue,ge){let Me=1,Te=ee.length,je=ie.length;if(ue!==void 0&&(ue=String(ue).toLowerCase(),ue==="ucs2"||ue==="ucs-2"||ue==="utf16le"||ue==="utf-16le")){if(ee.length<2||ie.length<2)return-1;Me=2,Te/=2,je/=2,Q/=2}function Ve(Ke,vt){return Me===1?Ke[vt]:Ke.readUInt16BE(vt*Me)}let Ze;if(ge){let Ke=-1;for(Ze=Q;ZeTe&&(Q=Te-je),Ze=Q;Ze>=0;Ze--){let Ke=!0;for(let vt=0;vtge&&(ue=ge)):ue=ge;let Me=ie.length;ue>Me/2&&(ue=Me/2);let Te;for(Te=0;Te>>0,isFinite(ue)?(ue=ue>>>0,ge===void 0&&(ge="utf8")):(ge=ue,ue=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Me=this.length-Q;if((ue===void 0||ue>Me)&&(ue=Me),ie.length>0&&(ue<0||Q<0)||Q>this.length)throw new RangeError("Attempt to write outside buffer bounds");ge||(ge="utf8");let Te=!1;for(;;)switch(ge){case"hex":return w(this,ie,Q,ue);case"utf8":case"utf-8":return k(this,ie,Q,ue);case"ascii":case"latin1":case"binary":return A(this,ie,Q,ue);case"base64":return b(this,ie,Q,ue);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,ie,Q,ue);default:if(Te)throw new TypeError("Unknown encoding: "+ge);ge=(""+ge).toLowerCase(),Te=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(ee,ie,Q){return ie===0&&Q===ee.length?r.fromByteArray(ee):r.fromByteArray(ee.slice(ie,Q))}function F(ee,ie,Q){Q=Math.min(ee.length,Q);let ue=[],ge=ie;for(;ge239?4:Me>223?3:Me>191?2:1;if(ge+je<=Q){let Ve,Ze,Ke,vt;switch(je){case 1:Me<128&&(Te=Me);break;case 2:Ve=ee[ge+1],(Ve&192)===128&&(vt=(Me&31)<<6|Ve&63,vt>127&&(Te=vt));break;case 3:Ve=ee[ge+1],Ze=ee[ge+2],(Ve&192)===128&&(Ze&192)===128&&(vt=(Me&15)<<12|(Ve&63)<<6|Ze&63,vt>2047&&(vt<55296||vt>57343)&&(Te=vt));break;case 4:Ve=ee[ge+1],Ze=ee[ge+2],Ke=ee[ge+3],(Ve&192)===128&&(Ze&192)===128&&(Ke&192)===128&&(vt=(Me&15)<<18|(Ve&63)<<12|(Ze&63)<<6|Ke&63,vt>65535&&vt<1114112&&(Te=vt))}}Te===null?(Te=65533,je=1):Te>65535&&(Te-=65536,ue.push(Te>>>10&1023|55296),Te=56320|Te&1023),ue.push(Te),ge+=je}return R(ue)}var D=4096;function R(ee){let ie=ee.length;if(ie<=D)return String.fromCharCode.apply(String,ee);let Q="",ue=0;for(;ueue)&&(Q=ue);let ge="";for(let Me=ie;Meue&&(ie=ue),Q<0?(Q+=ue,Q<0&&(Q=0)):Q>ue&&(Q=ue),QQ)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(ie,Q,ue){ie=ie>>>0,Q=Q>>>0,ue||B(ie,Q,this.length);let ge=this[ie],Me=1,Te=0;for(;++Te>>0,Q=Q>>>0,ue||B(ie,Q,this.length);let ge=this[ie+--Q],Me=1;for(;Q>0&&(Me*=256);)ge+=this[ie+--Q]*Me;return ge},l.prototype.readUint8=l.prototype.readUInt8=function(ie,Q){return ie=ie>>>0,Q||B(ie,1,this.length),this[ie]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(ie,Q){return ie=ie>>>0,Q||B(ie,2,this.length),this[ie]|this[ie+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(ie,Q){return ie=ie>>>0,Q||B(ie,2,this.length),this[ie]<<8|this[ie+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),(this[ie]|this[ie+1]<<8|this[ie+2]<<16)+this[ie+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),this[ie]*16777216+(this[ie+1]<<16|this[ie+2]<<8|this[ie+3])},l.prototype.readBigUInt64LE=fe(function(ie){ie=ie>>>0,j(ie,"offset");let Q=this[ie],ue=this[ie+7];(Q===void 0||ue===void 0)&&q(ie,this.length-8);let ge=Q+this[++ie]*2**8+this[++ie]*2**16+this[++ie]*2**24,Me=this[++ie]+this[++ie]*2**8+this[++ie]*2**16+ue*2**24;return BigInt(ge)+(BigInt(Me)<>>0,j(ie,"offset");let Q=this[ie],ue=this[ie+7];(Q===void 0||ue===void 0)&&q(ie,this.length-8);let ge=Q*2**24+this[++ie]*2**16+this[++ie]*2**8+this[++ie],Me=this[++ie]*2**24+this[++ie]*2**16+this[++ie]*2**8+ue;return(BigInt(ge)<>>0,Q=Q>>>0,ue||B(ie,Q,this.length);let ge=this[ie],Me=1,Te=0;for(;++Te=Me&&(ge-=Math.pow(2,8*Q)),ge},l.prototype.readIntBE=function(ie,Q,ue){ie=ie>>>0,Q=Q>>>0,ue||B(ie,Q,this.length);let ge=Q,Me=1,Te=this[ie+--ge];for(;ge>0&&(Me*=256);)Te+=this[ie+--ge]*Me;return Me*=128,Te>=Me&&(Te-=Math.pow(2,8*Q)),Te},l.prototype.readInt8=function(ie,Q){return ie=ie>>>0,Q||B(ie,1,this.length),this[ie]&128?(255-this[ie]+1)*-1:this[ie]},l.prototype.readInt16LE=function(ie,Q){ie=ie>>>0,Q||B(ie,2,this.length);let ue=this[ie]|this[ie+1]<<8;return ue&32768?ue|4294901760:ue},l.prototype.readInt16BE=function(ie,Q){ie=ie>>>0,Q||B(ie,2,this.length);let ue=this[ie+1]|this[ie]<<8;return ue&32768?ue|4294901760:ue},l.prototype.readInt32LE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),this[ie]|this[ie+1]<<8|this[ie+2]<<16|this[ie+3]<<24},l.prototype.readInt32BE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),this[ie]<<24|this[ie+1]<<16|this[ie+2]<<8|this[ie+3]},l.prototype.readBigInt64LE=fe(function(ie){ie=ie>>>0,j(ie,"offset");let Q=this[ie],ue=this[ie+7];(Q===void 0||ue===void 0)&&q(ie,this.length-8);let ge=this[ie+4]+this[ie+5]*2**8+this[ie+6]*2**16+(ue<<24);return(BigInt(ge)<>>0,j(ie,"offset");let Q=this[ie],ue=this[ie+7];(Q===void 0||ue===void 0)&&q(ie,this.length-8);let ge=(Q<<24)+this[++ie]*2**16+this[++ie]*2**8+this[++ie];return(BigInt(ge)<>>0,Q||B(ie,4,this.length),t.read(this,ie,!0,23,4)},l.prototype.readFloatBE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),t.read(this,ie,!1,23,4)},l.prototype.readDoubleLE=function(ie,Q){return ie=ie>>>0,Q||B(ie,8,this.length),t.read(this,ie,!0,52,8)},l.prototype.readDoubleBE=function(ie,Q){return ie=ie>>>0,Q||B(ie,8,this.length),t.read(this,ie,!1,52,8)};function O(ee,ie,Q,ue,ge,Me){if(!l.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(ie>ge||ieee.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(ie,Q,ue,ge){if(ie=+ie,Q=Q>>>0,ue=ue>>>0,!ge){let je=Math.pow(2,8*ue)-1;O(this,ie,Q,ue,je,0)}let Me=1,Te=0;for(this[Q]=ie&255;++Te>>0,ue=ue>>>0,!ge){let je=Math.pow(2,8*ue)-1;O(this,ie,Q,ue,je,0)}let Me=ue-1,Te=1;for(this[Q+Me]=ie&255;--Me>=0&&(Te*=256);)this[Q+Me]=ie/Te&255;return Q+ue},l.prototype.writeUint8=l.prototype.writeUInt8=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,1,255,0),this[Q]=ie&255,Q+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,2,65535,0),this[Q]=ie&255,this[Q+1]=ie>>>8,Q+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,2,65535,0),this[Q]=ie>>>8,this[Q+1]=ie&255,Q+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,4,4294967295,0),this[Q+3]=ie>>>24,this[Q+2]=ie>>>16,this[Q+1]=ie>>>8,this[Q]=ie&255,Q+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,4,4294967295,0),this[Q]=ie>>>24,this[Q+1]=ie>>>16,this[Q+2]=ie>>>8,this[Q+3]=ie&255,Q+4};function G(ee,ie,Q,ue,ge){V(ie,ue,ge,ee,Q,7);let Me=Number(ie&BigInt(4294967295));ee[Q++]=Me,Me=Me>>8,ee[Q++]=Me,Me=Me>>8,ee[Q++]=Me,Me=Me>>8,ee[Q++]=Me;let Te=Number(ie>>BigInt(32)&BigInt(4294967295));return ee[Q++]=Te,Te=Te>>8,ee[Q++]=Te,Te=Te>>8,ee[Q++]=Te,Te=Te>>8,ee[Q++]=Te,Q}function W(ee,ie,Q,ue,ge){V(ie,ue,ge,ee,Q,7);let Me=Number(ie&BigInt(4294967295));ee[Q+7]=Me,Me=Me>>8,ee[Q+6]=Me,Me=Me>>8,ee[Q+5]=Me,Me=Me>>8,ee[Q+4]=Me;let Te=Number(ie>>BigInt(32)&BigInt(4294967295));return ee[Q+3]=Te,Te=Te>>8,ee[Q+2]=Te,Te=Te>>8,ee[Q+1]=Te,Te=Te>>8,ee[Q]=Te,Q+8}l.prototype.writeBigUInt64LE=fe(function(ie,Q=0){return G(this,ie,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=fe(function(ie,Q=0){return W(this,ie,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(ie,Q,ue,ge){if(ie=+ie,Q=Q>>>0,!ge){let Ve=Math.pow(2,8*ue-1);O(this,ie,Q,ue,Ve-1,-Ve)}let Me=0,Te=1,je=0;for(this[Q]=ie&255;++Me>0)-je&255;return Q+ue},l.prototype.writeIntBE=function(ie,Q,ue,ge){if(ie=+ie,Q=Q>>>0,!ge){let Ve=Math.pow(2,8*ue-1);O(this,ie,Q,ue,Ve-1,-Ve)}let Me=ue-1,Te=1,je=0;for(this[Q+Me]=ie&255;--Me>=0&&(Te*=256);)ie<0&&je===0&&this[Q+Me+1]!==0&&(je=1),this[Q+Me]=(ie/Te>>0)-je&255;return Q+ue},l.prototype.writeInt8=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,1,127,-128),ie<0&&(ie=255+ie+1),this[Q]=ie&255,Q+1},l.prototype.writeInt16LE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,2,32767,-32768),this[Q]=ie&255,this[Q+1]=ie>>>8,Q+2},l.prototype.writeInt16BE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,2,32767,-32768),this[Q]=ie>>>8,this[Q+1]=ie&255,Q+2},l.prototype.writeInt32LE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,4,2147483647,-2147483648),this[Q]=ie&255,this[Q+1]=ie>>>8,this[Q+2]=ie>>>16,this[Q+3]=ie>>>24,Q+4},l.prototype.writeInt32BE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,4,2147483647,-2147483648),ie<0&&(ie=4294967295+ie+1),this[Q]=ie>>>24,this[Q+1]=ie>>>16,this[Q+2]=ie>>>8,this[Q+3]=ie&255,Q+4},l.prototype.writeBigInt64LE=fe(function(ie,Q=0){return G(this,ie,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=fe(function(ie,Q=0){return W(this,ie,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function X(ee,ie,Q,ue,ge,Me){if(Q+ue>ee.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("Index out of range")}function Z(ee,ie,Q,ue,ge){return ie=+ie,Q=Q>>>0,ge||X(ee,ie,Q,4,34028234663852886e22,-34028234663852886e22),t.write(ee,ie,Q,ue,23,4),Q+4}l.prototype.writeFloatLE=function(ie,Q,ue){return Z(this,ie,Q,!0,ue)},l.prototype.writeFloatBE=function(ie,Q,ue){return Z(this,ie,Q,!1,ue)};function J(ee,ie,Q,ue,ge){return ie=+ie,Q=Q>>>0,ge||X(ee,ie,Q,8,17976931348623157e292,-17976931348623157e292),t.write(ee,ie,Q,ue,52,8),Q+8}l.prototype.writeDoubleLE=function(ie,Q,ue){return J(this,ie,Q,!0,ue)},l.prototype.writeDoubleBE=function(ie,Q,ue){return J(this,ie,Q,!1,ue)},l.prototype.copy=function(ie,Q,ue,ge){if(!l.isBuffer(ie))throw new TypeError("argument should be a Buffer");if(ue||(ue=0),!ge&&ge!==0&&(ge=this.length),Q>=ie.length&&(Q=ie.length),Q||(Q=0),ge>0&&ge=this.length)throw new RangeError("Index out of range");if(ge<0)throw new RangeError("sourceEnd out of bounds");ge>this.length&&(ge=this.length),ie.length-Q>>0,ue=ue===void 0?this.length:ue>>>0,ie||(ie=0);let Me;if(typeof ie=="number")for(Me=Q;Me2**32?ge=$(String(Q)):typeof Q=="bigint"&&(ge=String(Q),(Q>BigInt(2)**BigInt(32)||Q<-(BigInt(2)**BigInt(32)))&&(ge=$(ge)),ge+="n"),ue+=` It must be ${ie}. Received ${ge}`,ue},RangeError);function $(ee){let ie="",Q=ee.length,ue=ee[0]==="-"?1:0;for(;Q>=ue+4;Q-=3)ie=`_${ee.slice(Q-3,Q)}${ie}`;return`${ee.slice(0,Q)}${ie}`}function U(ee,ie,Q){j(ie,"offset"),(ee[ie]===void 0||ee[ie+Q]===void 0)&&q(ie,ee.length-(Q+1))}function V(ee,ie,Q,ue,ge,Me){if(ee>Q||ee3?ie===0||ie===BigInt(0)?je=`>= 0${Te} and < 2${Te} ** ${(Me+1)*8}${Te}`:je=`>= -(2${Te} ** ${(Me+1)*8-1}${Te}) and < 2 ** ${(Me+1)*8-1}${Te}`:je=`>= ${ie}${Te} and <= ${Q}${Te}`,new N.ERR_OUT_OF_RANGE("value",je,ee)}U(ue,ge,Me)}function j(ee,ie){if(typeof ee!="number")throw new N.ERR_INVALID_ARG_TYPE(ie,"number",ee)}function q(ee,ie,Q){throw Math.floor(ee)!==ee?(j(ee,Q),new N.ERR_OUT_OF_RANGE(Q||"offset","an integer",ee)):ie<0?new N.ERR_BUFFER_OUT_OF_BOUNDS:new N.ERR_OUT_OF_RANGE(Q||"offset",`>= ${Q?1:0} and <= ${ie}`,ee)}var Y=/[^+/0-9A-Za-z-_]/g;function K(ee){if(ee=ee.split("=")[0],ee=ee.trim().replace(Y,""),ee.length<2)return"";for(;ee.length%4!==0;)ee=ee+"=";return ee}function te(ee,ie){ie=ie||1/0;let Q,ue=ee.length,ge=null,Me=[];for(let Te=0;Te55295&&Q<57344){if(!ge){if(Q>56319){(ie-=3)>-1&&Me.push(239,191,189);continue}else if(Te+1===ue){(ie-=3)>-1&&Me.push(239,191,189);continue}ge=Q;continue}if(Q<56320){(ie-=3)>-1&&Me.push(239,191,189),ge=Q;continue}Q=(ge-55296<<10|Q-56320)+65536}else ge&&(ie-=3)>-1&&Me.push(239,191,189);if(ge=null,Q<128){if((ie-=1)<0)break;Me.push(Q)}else if(Q<2048){if((ie-=2)<0)break;Me.push(Q>>6|192,Q&63|128)}else if(Q<65536){if((ie-=3)<0)break;Me.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if((ie-=4)<0)break;Me.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw new Error("Invalid code point")}return Me}function ne(ee){let ie=[];for(let Q=0;Q>8,ge=Q%256,Me.push(ge),Me.push(ue);return Me}function le(ee){return r.toByteArray(K(ee))}function ce(ee,ie,Q,ue){let ge;for(ge=0;ge=ie.length||ge>=ee.length);++ge)ie[ge+Q]=ee[ge];return ge}function pe(ee,ie){return ee instanceof ie||ee!=null&&ee.constructor!=null&&ee.constructor.name!=null&&ee.constructor.name===ie.name}function xe(ee){return ee!==ee}var ye=(function(){let ee="0123456789abcdef",ie=new Array(256);for(let Q=0;Q<16;++Q){let ue=Q*16;for(let ge=0;ge<16;++ge)ie[ue+ge]=ee[Q]+ee[ge]}return ie})();function fe(ee){return typeof BigInt>"u"?ae:ee}function ae(){throw new Error("BigInt not supported")}}}),A3=de({"node_modules/has-symbols/shams.js"(e,r){"use strict";r.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},a=Symbol("test"),o=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var s=42;i[a]=s;for(var l in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var n=Object.getOwnPropertySymbols(i);if(n.length!==1||n[0]!==a||!Object.prototype.propertyIsEnumerable.call(i,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(i,a);if(u.value!==s||u.enumerable!==!0)return!1}return!0}}}),$y=de({"node_modules/has-tostringtag/shams.js"(e,r){"use strict";var t=A3();r.exports=function(){return t()&&!!Symbol.toStringTag}}}),M3=de({"node_modules/es-object-atoms/index.js"(e,r){"use strict";r.exports=Object}}),_H=de({"node_modules/es-errors/index.js"(e,r){"use strict";r.exports=Error}}),xH=de({"node_modules/es-errors/eval.js"(e,r){"use strict";r.exports=EvalError}}),bH=de({"node_modules/es-errors/range.js"(e,r){"use strict";r.exports=RangeError}}),wH=de({"node_modules/es-errors/ref.js"(e,r){"use strict";r.exports=ReferenceError}}),cC=de({"node_modules/es-errors/syntax.js"(e,r){"use strict";r.exports=SyntaxError}}),A1=de({"node_modules/es-errors/type.js"(e,r){"use strict";r.exports=TypeError}}),TH=de({"node_modules/es-errors/uri.js"(e,r){"use strict";r.exports=URIError}}),AH=de({"node_modules/math-intrinsics/abs.js"(e,r){"use strict";r.exports=Math.abs}}),MH=de({"node_modules/math-intrinsics/floor.js"(e,r){"use strict";r.exports=Math.floor}}),SH=de({"node_modules/math-intrinsics/max.js"(e,r){"use strict";r.exports=Math.max}}),EH=de({"node_modules/math-intrinsics/min.js"(e,r){"use strict";r.exports=Math.min}}),kH=de({"node_modules/math-intrinsics/pow.js"(e,r){"use strict";r.exports=Math.pow}}),CH=de({"node_modules/math-intrinsics/round.js"(e,r){"use strict";r.exports=Math.round}}),DH=de({"node_modules/math-intrinsics/isNaN.js"(e,r){"use strict";r.exports=Number.isNaN||function(i){return i!==i}}}),LH=de({"node_modules/math-intrinsics/sign.js"(e,r){"use strict";var t=DH();r.exports=function(a){return t(a)||a===0?a:a<0?-1:1}}}),FH=de({"node_modules/gopd/gOPD.js"(e,r){"use strict";r.exports=Object.getOwnPropertyDescriptor}}),Cv=de({"node_modules/gopd/index.js"(e,r){"use strict";var t=FH();if(t)try{t([],"length")}catch{t=null}r.exports=t}}),Wy=de({"node_modules/es-define-property/index.js"(e,r){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}r.exports=t}}),PH=de({"node_modules/has-symbols/index.js"(e,r){"use strict";var t=typeof Symbol<"u"&&Symbol,i=A3();r.exports=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()}}}),fC=de({"node_modules/get-proto/Reflect.getPrototypeOf.js"(e,r){"use strict";r.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),hC=de({"node_modules/get-proto/Object.getPrototypeOf.js"(e,r){"use strict";var t=M3();r.exports=t.getPrototypeOf||null}}),IH=de({"node_modules/function-bind/implementation.js"(e,r){"use strict";var t="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,a=Math.max,o="[object Function]",s=function(c,f){for(var h=[],d=0;d"u"||!k?t:k(Uint8Array),R={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":w&&k?k([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":F,"%AsyncGenerator%":F,"%AsyncGeneratorFunction%":F,"%AsyncIteratorPrototype%":F,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":F,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&k?k(k([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!w||!k?t:k(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":s,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!w||!k?t:k(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&k?k(""[Symbol.iterator]()):t,"%Symbol%":w?Symbol:t,"%SyntaxError%":n,"%ThrowTypeError%":C,"%TypedArray%":D,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":E,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":A,"%Math.abs%":f,"%Math.floor%":h,"%Math.max%":d,"%Math.min%":p,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":y,"%Reflect.getPrototypeOf%":b};if(k)try{null.error}catch(U){P=k(k(U)),R["%Error.prototype%"]=P}var P,z=function U(V){var j;if(V==="%AsyncFunction%")j=v("async function () {}");else if(V==="%GeneratorFunction%")j=v("function* () {}");else if(V==="%AsyncGeneratorFunction%")j=v("async function* () {}");else if(V==="%AsyncGenerator%"){var q=U("%AsyncGeneratorFunction%");q&&(j=q.prototype)}else if(V==="%AsyncIteratorPrototype%"){var Y=U("%AsyncGenerator%");Y&&k&&(j=k(Y.prototype))}return R[V]=j,j},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=M1(),B=pC(),O=L.call(T,Array.prototype.concat),G=L.call(E,Array.prototype.splice),W=L.call(T,String.prototype.replace),X=L.call(T,String.prototype.slice),Z=L.call(T,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,H=function(V){var j=X(V,0,1),q=X(V,-1);if(j==="%"&&q!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");if(q==="%"&&j!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var Y=[];return W(V,J,function(K,te,ne,se){Y[Y.length]=ne?W(se,N,"$1"):te||K}),Y},$=function(V,j){var q=V,Y;if(B(I,q)&&(Y=I[q],q="%"+Y[0]+"%"),B(R,q)){var K=R[q];if(K===F&&(K=z(q)),typeof K>"u"&&!j)throw new u("intrinsic "+V+" exists, but is not available. Please file an issue!");return{alias:Y,name:q,value:K}}throw new n("intrinsic "+V+" does not exist!")};r.exports=function(V,j){if(typeof V!="string"||V.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof j!="boolean")throw new u('"allowMissing" argument must be a boolean');if(Z(/^%?[^%]*%?$/,V)===null)throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var q=H(V),Y=q.length>0?q[0]:"",K=$("%"+Y+"%",j),te=K.name,ne=K.value,se=!1,le=K.alias;le&&(Y=le[0],G(q,O([0,1],le)));for(var ce=1,pe=!0;ce=q.length){var ae=x(ne,xe);pe=!!ae,pe&&"get"in ae&&!("originalValue"in ae.get)?ne=ae.get:ne=ne[xe]}else pe=B(ne,xe),ne=ne[xe];pe&&!se&&(R[te]=ne)}}return ne}}}),Dv=de({"node_modules/call-bound/index.js"(e,r){"use strict";var t=D3(),i=k3(),a=i([t("%String.prototype.indexOf%")]);r.exports=function(s,l){var n=t(s,!!l);return typeof n=="function"&&a(s,".prototype.")>-1?i([n]):n}}}),BH=de({"node_modules/is-arguments/index.js"(e,r){"use strict";var t=$y()(),i=Dv(),a=i("Object.prototype.toString"),o=function(u){return t&&u&&typeof u=="object"&&Symbol.toStringTag in u?!1:a(u)==="[object Arguments]"},s=function(u){return o(u)?!0:u!==null&&typeof u=="object"&&"length"in u&&typeof u.length=="number"&&u.length>=0&&a(u)!=="[object Array]"&&"callee"in u&&a(u.callee)==="[object Function]"},l=(function(){return o(arguments)})();o.isLegacyArguments=s,r.exports=l?o:s}}),OH=de({"node_modules/is-regex/index.js"(e,r){"use strict";var t=Dv(),i=$y()(),a=pC(),o=Cv(),s;i?(l=t("RegExp.prototype.exec"),n={},u=function(){throw n},c={toString:u,valueOf:u},typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=u),s=function(p){if(!p||typeof p!="object")return!1;var g=o(p,"lastIndex"),m=g&&a(g,"value");if(!m)return!1;try{l(p,c)}catch(y){return y===n}}):(f=t("Object.prototype.toString"),h="[object RegExp]",s=function(p){return!p||typeof p!="object"&&typeof p!="function"?!1:f(p)===h});var l,n,u,c,f,h;r.exports=s}}),NH=de({"node_modules/safe-regex-test/index.js"(e,r){"use strict";var t=Dv(),i=OH(),a=t("RegExp.prototype.exec"),o=A1();r.exports=function(l){if(!i(l))throw new o("`regex` must be a RegExp");return function(u){return a(l,u)!==null}}}}),jH=de({"node_modules/generator-function/index.js"(e,r){"use strict";var t=function*(){}.constructor;r.exports=()=>t}}),UH=de({"node_modules/is-generator-function/index.js"(e,r){"use strict";var t=Dv(),i=NH(),a=i(/^\s*(?:function)?\*/),o=$y()(),s=C3(),l=t("Object.prototype.toString"),n=t("Function.prototype.toString"),u=jH();r.exports=function(f){if(typeof f!="function")return!1;if(a(n(f)))return!0;if(!o){var h=l(f);return h==="[object GeneratorFunction]"}if(!s)return!1;var d=u();return d&&s(f)===d.prototype}}}),qH=de({"node_modules/is-callable/index.js"(e,r){"use strict";var t=Function.prototype.toString,i=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,a,o;if(typeof i=="function"&&typeof Object.defineProperty=="function")try{a=Object.defineProperty({},"length",{get:function(){throw o}}),o={},i(function(){throw 42},null,a)}catch(x){x!==o&&(i=null)}else i=null;var s=/^\s*class\b/,l=function(S){try{var M=t.call(S);return s.test(M)}catch{return!1}},n=function(S){try{return l(S)?!1:(t.call(S),!0)}catch{return!1}},u=Object.prototype.toString,c="[object Object]",f="[object Function]",h="[object GeneratorFunction]",d="[object HTMLAllCollection]",p="[object HTML document.all class]",g="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,y=!(0 in[,]),_=function(){return!1};typeof document=="object"&&(v=document.all,u.call(v)===u.call(document.all)&&(_=function(S){if((y||!S)&&(typeof S>"u"||typeof S=="object"))try{var M=u.call(S);return(M===d||M===p||M===g||M===c)&&S("")==null}catch{}return!1}));var v;r.exports=i?function(S){if(_(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;try{i(S,null,a)}catch(M){if(M!==o)return!1}return!l(S)&&n(S)}:function(S){if(_(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;if(m)return n(S);if(l(S))return!1;var M=u.call(S);return M!==f&&M!==h&&!/^\[object HTML/.test(M)?!1:n(S)}}}),VH=de({"node_modules/for-each/index.js"(e,r){"use strict";var t=qH(),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty,o=function(c,f,h){for(var d=0,p=c.length;d=3&&(d=h),n(c)?o(c,f,d):typeof c=="string"?s(c,f,d):l(c,f,d)}}}),GH=de({"node_modules/possible-typed-array-names/index.js"(e,r){"use strict";r.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}}),HH=de({"node_modules/available-typed-arrays/index.js"(e,r){"use strict";var t=GH(),i=typeof globalThis>"u"?window:globalThis;r.exports=function(){for(var o=[],s=0;s3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new a("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,p=!!o&&o(l,n);if(t)t(l,n,{configurable:h===null&&p?p.configurable:!h,enumerable:c===null&&p?p.enumerable:!c,value:u,writable:f===null&&p?p.writable:!f});else if(d||!c&&!f&&!h)l[n]=u;else throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),mC=de({"node_modules/has-property-descriptors/index.js"(e,r){"use strict";var t=Wy(),i=function(){return!!t};i.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},r.exports=i}}),$H=de({"node_modules/set-function-length/index.js"(e,r){"use strict";var t=D3(),i=vC(),a=mC()(),o=Cv(),s=A1(),l=t("%Math.floor%");r.exports=function(u,c){if(typeof u!="function")throw new s("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||l(c)!==c)throw new s("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,d=!0;if("length"in u&&o){var p=o(u,"length");p&&!p.configurable&&(h=!1),p&&!p.writable&&(d=!1)}return(h||d||!f)&&(a?i(u,"length",c,!0,!0):i(u,"length",c)),u}}}),WH=de({"node_modules/call-bind-apply-helpers/applyBind.js"(e,r){"use strict";var t=M1(),i=E3(),a=dC();r.exports=function(){return a(t,i,arguments)}}}),Yy=de({"node_modules/call-bind/index.js"(e,r){"use strict";var t=$H(),i=Wy(),a=k3(),o=WH();r.exports=function(l){var n=a(arguments),u=1+l.length-(arguments.length-1);return t(n,u>0?u:0,!0)},i?i(r.exports,"apply",{value:o}):r.exports.apply=o}}),gC=de({"node_modules/which-typed-array/index.js"(e,r){"use strict";var t=VH(),i=HH(),a=Yy(),o=Dv(),s=Cv(),l=C3(),n=o("Object.prototype.toString"),u=$y()(),c=typeof globalThis>"u"?window:globalThis,f=i(),h=o("String.prototype.slice"),d=o("Array.prototype.indexOf",!0)||function(v,x){for(var S=0;S-1}r.exports=function(v){if(!v||typeof v!="object")return!1;if(!u){var x=h(n(v),8,-1);return y(x)?x:x!=="Object"?!1:m(v)}return s?g(v):null}}}),YH=de({"node_modules/is-typed-array/index.js"(e,r){"use strict";var t=gC();r.exports=function(a){return!!t(a)}}}),yC=de({"node_modules/util/support/types.js"(e){"use strict";var r=BH(),t=UH(),i=gC(),a=YH();function o(se){return se.call.bind(se)}var s=typeof BigInt<"u",l=typeof Symbol<"u",n=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),f=o(Boolean.prototype.valueOf);s&&(h=o(BigInt.prototype.valueOf));var h;l&&(d=o(Symbol.prototype.valueOf));var d;function p(se,le){if(typeof se!="object")return!1;try{return le(se),!0}catch{return!1}}e.isArgumentsObject=r,e.isGeneratorFunction=t,e.isTypedArray=a;function g(se){return typeof Promise<"u"&&se instanceof Promise||se!==null&&typeof se=="object"&&typeof se.then=="function"&&typeof se.catch=="function"}e.isPromise=g;function m(se){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(se):a(se)||G(se)}e.isArrayBufferView=m;function y(se){return i(se)==="Uint8Array"}e.isUint8Array=y;function _(se){return i(se)==="Uint8ClampedArray"}e.isUint8ClampedArray=_;function v(se){return i(se)==="Uint16Array"}e.isUint16Array=v;function x(se){return i(se)==="Uint32Array"}e.isUint32Array=x;function S(se){return i(se)==="Int8Array"}e.isInt8Array=S;function M(se){return i(se)==="Int16Array"}e.isInt16Array=M;function C(se){return i(se)==="Int32Array"}e.isInt32Array=C;function w(se){return i(se)==="Float32Array"}e.isFloat32Array=w;function k(se){return i(se)==="Float64Array"}e.isFloat64Array=k;function A(se){return i(se)==="BigInt64Array"}e.isBigInt64Array=A;function b(se){return i(se)==="BigUint64Array"}e.isBigUint64Array=b;function E(se){return n(se)==="[object Map]"}E.working=typeof Map<"u"&&E(new Map);function T(se){return typeof Map>"u"?!1:E.working?E(se):se instanceof Map}e.isMap=T;function F(se){return n(se)==="[object Set]"}F.working=typeof Set<"u"&&F(new Set);function D(se){return typeof Set>"u"?!1:F.working?F(se):se instanceof Set}e.isSet=D;function R(se){return n(se)==="[object WeakMap]"}R.working=typeof WeakMap<"u"&&R(new WeakMap);function P(se){return typeof WeakMap>"u"?!1:R.working?R(se):se instanceof WeakMap}e.isWeakMap=P;function z(se){return n(se)==="[object WeakSet]"}z.working=typeof WeakSet<"u"&&z(new WeakSet);function I(se){return z(se)}e.isWeakSet=I;function L(se){return n(se)==="[object ArrayBuffer]"}L.working=typeof ArrayBuffer<"u"&&L(new ArrayBuffer);function B(se){return typeof ArrayBuffer>"u"?!1:L.working?L(se):se instanceof ArrayBuffer}e.isArrayBuffer=B;function O(se){return n(se)==="[object DataView]"}O.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&O(new DataView(new ArrayBuffer(1),0,1));function G(se){return typeof DataView>"u"?!1:O.working?O(se):se instanceof DataView}e.isDataView=G;var W=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function X(se){return n(se)==="[object SharedArrayBuffer]"}function Z(se){return typeof W>"u"?!1:(typeof X.working>"u"&&(X.working=X(new W)),X.working?X(se):se instanceof W)}e.isSharedArrayBuffer=Z;function J(se){return n(se)==="[object AsyncFunction]"}e.isAsyncFunction=J;function N(se){return n(se)==="[object Map Iterator]"}e.isMapIterator=N;function H(se){return n(se)==="[object Set Iterator]"}e.isSetIterator=H;function $(se){return n(se)==="[object Generator]"}e.isGeneratorObject=$;function U(se){return n(se)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=U;function V(se){return p(se,u)}e.isNumberObject=V;function j(se){return p(se,c)}e.isStringObject=j;function q(se){return p(se,f)}e.isBooleanObject=q;function Y(se){return s&&p(se,h)}e.isBigIntObject=Y;function K(se){return l&&p(se,d)}e.isSymbolObject=K;function te(se){return V(se)||j(se)||q(se)||Y(se)||K(se)}e.isBoxedPrimitive=te;function ne(se){return typeof Uint8Array<"u"&&(B(se)||Z(se))}e.isAnyArrayBuffer=ne,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(se){Object.defineProperty(e,se,{enumerable:!1,value:function(){throw new Error(se+" is not supported in userland")}})})}}),_C=de({"node_modules/util/support/isBufferBrowser.js"(e,r){r.exports=function(i){return i&&typeof i=="object"&&typeof i.copy=="function"&&typeof i.fill=="function"&&typeof i.readUInt8=="function"}}}),xC=de({"(disabled):node_modules/util/util.js"(e){var r=Object.getOwnPropertyDescriptors||function(G){for(var W=Object.keys(G),X={},Z=0;Z=Z)return H;switch(H){case"%s":return String(X[W++]);case"%d":return Number(X[W++]);case"%j":try{return JSON.stringify(X[W++])}catch{return"[Circular]"}default:return H}}),N=X[W];W"u")return function(){return e.deprecate(O,G).apply(this,arguments)};var W=!1;function X(){if(!W){if(process.throwDeprecation)throw new Error(G);process.traceDeprecation?console.trace(G):console.error(G),W=!0}return O.apply(this,arguments)}return X};var i={},a=/^$/;o="false",o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i");var o;e.debuglog=function(O){if(O=O.toUpperCase(),!i[O])if(a.test(O)){var G=process.pid;i[O]=function(){var W=e.format.apply(e,arguments);console.error("%s %d: %s",O,G,W)}}else i[O]=function(){};return i[O]};function s(O,G){var W={seen:[],stylize:n};return arguments.length>=3&&(W.depth=arguments[2]),arguments.length>=4&&(W.colors=arguments[3]),y(G)?W.showHidden=G:G&&e._extend(W,G),C(W.showHidden)&&(W.showHidden=!1),C(W.depth)&&(W.depth=2),C(W.colors)&&(W.colors=!1),C(W.customInspect)&&(W.customInspect=!0),W.colors&&(W.stylize=l),c(W,O,W.depth)}e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(O,G){var W=s.styles[G];return W?"\x1B["+s.colors[W][0]+"m"+O+"\x1B["+s.colors[W][1]+"m":O}function n(O,G){return O}function u(O){var G={};return O.forEach(function(W,X){G[W]=!0}),G}function c(O,G,W){if(O.customInspect&&G&&E(G.inspect)&&G.inspect!==e.inspect&&!(G.constructor&&G.constructor.prototype===G)){var X=G.inspect(W,O);return S(X)||(X=c(O,X,W)),X}var Z=f(O,G);if(Z)return Z;var J=Object.keys(G),N=u(J);if(O.showHidden&&(J=Object.getOwnPropertyNames(G)),b(G)&&(J.indexOf("message")>=0||J.indexOf("description")>=0))return h(G);if(J.length===0){if(E(G)){var H=G.name?": "+G.name:"";return O.stylize("[Function"+H+"]","special")}if(w(G))return O.stylize(RegExp.prototype.toString.call(G),"regexp");if(A(G))return O.stylize(Date.prototype.toString.call(G),"date");if(b(G))return h(G)}var $="",U=!1,V=["{","}"];if(m(G)&&(U=!0,V=["[","]"]),E(G)){var j=G.name?": "+G.name:"";$=" [Function"+j+"]"}if(w(G)&&($=" "+RegExp.prototype.toString.call(G)),A(G)&&($=" "+Date.prototype.toUTCString.call(G)),b(G)&&($=" "+h(G)),J.length===0&&(!U||G.length==0))return V[0]+$+V[1];if(W<0)return w(G)?O.stylize(RegExp.prototype.toString.call(G),"regexp"):O.stylize("[Object]","special");O.seen.push(G);var q;return U?q=d(O,G,W,N,J):q=J.map(function(Y){return p(O,G,W,N,Y,U)}),O.seen.pop(),g(q,$,V)}function f(O,G){if(C(G))return O.stylize("undefined","undefined");if(S(G)){var W="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return O.stylize(W,"string")}if(x(G))return O.stylize(""+G,"number");if(y(G))return O.stylize(""+G,"boolean");if(_(G))return O.stylize("null","null")}function h(O){return"["+Error.prototype.toString.call(O)+"]"}function d(O,G,W,X,Z){for(var J=[],N=0,H=G.length;N1?(f[p-1]-f[0])/(p-1):1,y,_;for(m>=0?_=h?s:l:_=h?u:n,c+=m*o*(h?-1:1)*(m>=0?1:-1);d90&&t.log("Long binary search..."),d-1};function s(c,f){return cf}function u(c,f){return c>=f}e.sorterAsc=function(c,f){return c-f},e.sorterDes=function(c,f){return f-c},e.distinctVals=function(c){var f=c.slice();f.sort(e.sorterAsc);var h;for(h=f.length-1;h>-1&&f[h]===a;h--);for(var d=f[h]-f[0]||1,p=d/(h||1)/1e4,g=[],m,y=0;y<=h;y++){var _=f[y],v=_-m;m===void 0?(g.push(_),m=_):v>p&&(d=Math.min(d,v),g.push(_),m=_)}return{vals:g,minDiff:d}},e.roundUp=function(c,f,h){for(var d=0,p=f.length-1,g,m=0,y=h?0:1,_=h?1:0,v=h?Math.ceil:Math.floor;d0&&(d=1),h&&d)return c.sort(f)}return d?c:c.reverse()},e.findIndexOfMin=function(c,f){f=f||i;for(var h=1/0,d,p=0;pvE});function YU(e){return Object.keys(e).sort()}var vE,yv=Ir({"src/lib/sort_object_keys.ts"(){"use strict";vE=YU}}),XU=de({"src/lib/stats.js"(e){"use strict";var r=da(),t=Do().isArrayOrTypedArray;e.aggNums=function(i,a,o,s){var l,n;if((!s||s>o.length)&&(s=o.length),r(a)||(a=!1),t(o[0])){for(n=new Array(s),l=0;li.length-1)return i[i.length-1];var o=a%1;return o*i[Math.ceil(a)]+(1-o)*i[Math.floor(a)]}}}),ZU=de({"src/lib/angles.js"(e,r){"use strict";var t=(c0(),ti(Ap)),i=t.mod,a=t.modHalf,o=Math.PI,s=2*o;function l(_){return _/180*o}function n(_){return _/o*180}function u(_){return Math.abs(_[1]-_[0])>s-1e-14}function c(_,v){return a(v-_,s)}function f(_,v){return Math.abs(c(_,v))}function h(_,v){if(u(v))return!0;var x,S;v[0]S&&(S+=s);var M=i(_,s),C=M+s;return M>=x&&M<=S||C>=x&&C<=S}function d(_,v,x,S){if(!h(v,S))return!1;var M,C;return x[0]=M&&_<=C}function p(_,v,x,S,M,C,w){M=M||0,C=C||0;var k=u([x,S]),A,b,E,T,F;k?(A=0,b=o,E=s):x1/3&&t.x<2/3},e.isRightAnchor=function(t){return t.xanchor==="right"||t.xanchor==="auto"&&t.x>=2/3},e.isTopAnchor=function(t){return t.yanchor==="top"||t.yanchor==="auto"&&t.y>=2/3},e.isMiddleAnchor=function(t){return t.yanchor==="middle"||t.yanchor==="auto"&&t.y>1/3&&t.y<2/3},e.isBottomAnchor=function(t){return t.yanchor==="bottom"||t.yanchor==="auto"&&t.y<=1/3}}}),JU=de({"src/lib/geometry2d.js"(e){"use strict";var r=(c0(),ti(Ap)).mod;e.segmentsIntersect=t;function t(l,n,u,c,f,h,d,p){var g=u-l,m=f-l,y=d-f,_=c-n,v=h-n,x=p-h,S=g*x-y*_;if(S===0)return null;var M=(m*x-y*v)/S,C=(m*_-g*v)/S;return C<0||C>1||M<0||M>1?null:{x:l+g*M,y:n+_*M}}e.segmentDistance=function(n,u,c,f,h,d,p,g){if(t(n,u,c,f,h,d,p,g))return 0;var m=c-n,y=f-u,_=p-h,v=g-d,x=m*m+y*y,S=_*_+v*v,M=Math.min(i(m,y,x,h-n,d-u),i(m,y,x,p-n,g-u),i(_,v,S,n-h,u-d),i(_,v,S,c-h,f-d));return Math.sqrt(M)};function i(l,n,u,c,f){var h=c*l+f*n;if(h<0)return c*c+f*f;if(h>u){var d=c-l,p=f-n;return d*d+p*p}else{var g=c*n-f*l;return g*g/u}}var a,o,s;e.getTextLocation=function(n,u,c,f){if((n!==o||f!==s)&&(a={},o=n,s=f),a[c])return a[c];var h=n.getPointAtLength(r(c-f/2,u)),d=n.getPointAtLength(r(c+f/2,u)),p=Math.atan((d.y-h.y)/(d.x-h.x)),g=n.getPointAtLength(r(c,u)),m=(g.x*4+h.x+d.x)/6,y=(g.y*4+h.y+d.y)/6,_={x:m,y,theta:p};return a[c]=_,_},e.clearLocationCache=function(){o=null},e.getVisibleSegment=function(n,u,c){var f=u.left,h=u.right,d=u.top,p=u.bottom,g=0,m=n.getTotalLength(),y=m,_,v;function x(M){var C=n.getPointAtLength(M);M===0?_=C:M===m&&(v=C);var w=C.xh?C.x-h:0,k=C.yp?C.y-p:0;return Math.sqrt(w*w+k*k)}for(var S=x(g);S;){if(g+=S+c,g>y)return;S=x(g)}for(S=x(y);S;){if(y-=S+c,g>y)return;S=x(y)}return{min:g,max:y,len:y-g,total:m,isClosed:g===0&&y===m&&Math.abs(_.x-v.x)<.1&&Math.abs(_.y-v.y)<.1}},e.findPointOnPath=function(n,u,c,f){f=f||{};for(var h=f.pathLength||n.getTotalLength(),d=f.tolerance||.001,p=f.iterationLimit||30,g=n.getPointAtLength(0)[c]>n.getPointAtLength(h)[c]?-1:1,m=0,y=0,_=h,v,x,S;m0?_=v:y=v,m++}return x}}}),ww=de({"src/lib/throttle.js"(e){"use strict";var r={};e.throttle=function(a,o,s){var l=r[a],n=Date.now();if(!l){for(var u in r)r[u].tsl.ts+o){c();return}l.timer=setTimeout(function(){c(),l.timer=null},o)},e.done=function(i){var a=r[i];return!a||!a.timer?Promise.resolve():new Promise(function(o){var s=a.onDone;a.onDone=function(){s&&s(),o(),a.onDone=null}})},e.clear=function(i){if(i)t(r[i]),delete r[i];else for(var a in r)e.clear(a)};function t(i){i&&i.timer!==null&&(clearTimeout(i.timer),i.timer=null)}}}),QU=de({"src/lib/clear_responsive.js"(e,r){"use strict";r.exports=function(i){i._responsiveChartHandler&&(window.removeEventListener("resize",i._responsiveChartHandler),delete i._responsiveChartHandler)}}}),eq=de({"node_modules/is-mobile/index.js"(e,r){"use strict";r.exports=o,r.exports.isMobile=o,r.exports.default=o;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/CrOS/,a=/android|ipad|playbook|silk/i;function o(s){s||(s={});let l=s.ua;if(!l&&typeof navigator<"u"&&(l=navigator.userAgent),l&&l.headers&&typeof l.headers["user-agent"]=="string"&&(l=l.headers["user-agent"]),typeof l!="string")return!1;let n=t.test(l)&&!i.test(l)||!!s.tablet&&a.test(l);return!n&&s.tablet&&s.featureDetect&&navigator&&navigator.maxTouchPoints>1&&l.indexOf("Macintosh")!==-1&&l.indexOf("Safari")!==-1&&(n=!0),n}}}),tq=de({"src/lib/preserve_drawing_buffer.js"(e,r){"use strict";var t=da(),i=eq();r.exports=function(s){var l;if(s&&s.hasOwnProperty("userAgent")?l=s.userAgent:l=a(),typeof l!="string")return!0;var n=i({ua:{headers:{"user-agent":l}},tablet:!0,featureDetect:!1});if(!n)for(var u=l.split(" "),c=1;c-1;h--){var d=u[h];if(d.slice(0,8)==="Version/"){var p=d.slice(8).split(".")[0];if(t(p)&&(p=+p),p>=13)return!0}}}return n};function a(){var o;return typeof navigator<"u"&&(o=navigator.userAgent),o&&o.headers&&typeof o.headers["user-agent"]=="string"&&(o=o.headers["user-agent"]),o}}}),rq=de({"src/lib/make_trace_groups.js"(e,r){"use strict";var t=Yr();r.exports=function(a,o,s){var l=a.selectAll("g."+s.replace(/\s/g,".")).data(o,function(u){return u[0].trace.uid});l.exit().remove(),l.enter().append("g").attr("class",s),l.order();var n=a.classed("rangeplot")?"nodeRangePlot3":"node3";return l.each(function(u){u[0][n]=t.select(this)}),l}}}),iq=de({"src/lib/localize.js"(e,r){"use strict";var t=Sa();r.exports=function(a,o){for(var s=a._context.locale,l=0;l<2;l++){for(var n=a._context.locales,u=0;u<2;u++){var c=(n[s]||{}).dictionary;if(c){var f=c[o];if(f)return f}n=t.localeRegistry}var h=s.split("-")[0];if(h===s)break;s=h}return o}}}),mE=de({"src/lib/filter_unique.js"(e,r){"use strict";r.exports=function(i){for(var a={},o=[],s=0,l=0;l1?(o*i+o*a)/o:i+a,l=String(s).length;if(l>16){var n=String(a).length,u=String(i).length;if(l>=u+n){var c=parseFloat(s).toPrecision(12);c.indexOf("e+")===-1&&(s=+c)}}return s}}}),gE={};Mr(gE,{default:()=>bE});function oq(e){return typeof e=="string"&&(e=e.replace(xE,"")),(0,yE.default)(e)?Number(e):_E.BADNUM}var yE,_E,xE,bE,sq=Ir({"src/lib/clean_number.ts"(){"use strict";yE=Vr(da()),_E=Vr(cn()),xE=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,bE=oq}}),lq=de({"src/lib/slugify.js"(e,r){"use strict";var t=/<[^>]*>/g,i=/[\p{S}\p{P}]/gu,a=/[\p{Cc}\p{Cf}\uFE00-\uFE0F\u20E3]/gu,o=/�/g,s=/\s+/g,l="-",n=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),u=new RegExp(n+"{3,}","g"),c=new RegExp(n+"$","g"),f=60;function h(d){return typeof d.toWellFormed=="function"?d.toWellFormed():new TextDecoder().decode(new TextEncoder().encode(d))}r.exports=function(p,g=f){var m=h(p??"").replace(o,"").replace(t," ").replace(i,y=>y===l?y:"").toLowerCase().trim().replace(s,l).replace(a,"").replace(u,l);return m.length<=g?m:Array.from(m).slice(0,g).join("").replace(c,"")}}}),Qt=de({"src/lib/index.js"(e,r){"use strict";var t=Yr(),i=eo().utcFormat,a=rs().format,o=da(),s=cn(),l=s.FP_SAFE,n=-l,u=s.BADNUM,c=r.exports={};c.adjustFormat=function(j){if(!j||/^\d[.]\df/.test(j)||/[.]\d%/.test(j))return j;if(j==="0.f")return"~f";if(/^\d%/.test(j))return"~%";if(/^\ds/.test(j))return"~s";var q=(j.match(/^[+\-( ]?/)||[""])[0],Y=j.slice(q.length);return!/^[~,.0$#]/.test(Y)&&/[&fps]/.test(Y)?q+"~"+Y:j};var f={};c.warnBadFormat=function(V){var j=String(V);f[j]||(f[j]=1,c.warn('encountered bad format: "'+j+'"'))},c.noFormat=function(V){return String(V)},c.numberFormat=function(V){var j;try{j=a(c.adjustFormat(V))}catch{return c.warnBadFormat(V),c.noFormat}return j},c.nestedProperty=sl(),c.keyedContainer=cu(),c.relativeAttr=nh(),c.isPlainObject=is(),c.toLogRange=s1(),c.relinkPrivateKeys=u0();var h=Do();c.isArrayBuffer=h.isArrayBuffer,c.isTypedArray=h.isTypedArray,c.isArrayOrTypedArray=h.isArrayOrTypedArray,c.isArray1D=h.isArray1D,c.ensureArray=h.ensureArray,c.concat=h.concat,c.maxRowLength=h.maxRowLength,c.minRowLength=h.minRowLength;var d=(c0(),ti(Ap));c.mod=d.mod,c.modHalf=d.modHalf;var p=vU();c.valObjectMeta=p.valObjectMeta,c.coerce=p.coerce,c.coerce2=p.coerce2,c.coerceFont=p.coerceFont,c.coercePattern=p.coercePattern,c.coerceHoverinfo=p.coerceHoverinfo,c.coerceSelectionMarkerOpacity=p.coerceSelectionMarkerOpacity,c.validate=p.validate;var g=WU();c.dateTime2ms=g.dateTime2ms,c.isDateTime=g.isDateTime,c.ms2DateTime=g.ms2DateTime,c.ms2DateTimeLocal=g.ms2DateTimeLocal,c.cleanDate=g.cleanDate,c.isJSDate=g.isJSDate,c.formatDate=g.formatDate,c.incrementMonth=g.incrementMonth,c.dateTick0=g.dateTick0,c.dfltRange=g.dfltRange,c.findExactDates=g.findExactDates,c.MIN_MS=g.MIN_MS,c.MAX_MS=g.MAX_MS;var m=bw();c.findBin=m.findBin,c.sorterAsc=m.sorterAsc,c.sorterDes=m.sorterDes,c.distinctVals=m.distinctVals,c.roundUp=m.roundUp,c.sort=m.sort,c.findIndexOfMin=m.findIndexOfMin,c.sortObjectKeys=(yv(),ti(f0)).default;var y=XU();c.aggNums=y.aggNums,c.len=y.len,c.mean=y.mean,c.geometricMean=y.geometricMean,c.median=y.median,c.midRange=y.midRange,c.variance=y.variance,c.stdev=y.stdev,c.interp=y.interp;var _=yw();c.init2dArray=_.init2dArray,c.transposeRagged=_.transposeRagged,c.dot=_.dot,c.translationMatrix=_.translationMatrix,c.rotationMatrix=_.rotationMatrix,c.rotationXYMatrix=_.rotationXYMatrix,c.apply3DTransform=_.apply3DTransform,c.apply2DTransform=_.apply2DTransform,c.apply2DTransform2=_.apply2DTransform2,c.convertCssMatrix=_.convertCssMatrix,c.inverseTransformMatrix=_.inverseTransformMatrix;var v=ZU();c.deg2rad=v.deg2rad,c.rad2deg=v.rad2deg,c.angleDelta=v.angleDelta,c.angleDist=v.angleDist,c.isFullCircle=v.isFullCircle,c.isAngleInsideSector=v.isAngleInsideSector,c.isPtInsideSector=v.isPtInsideSector,c.pathArc=v.pathArc,c.pathSector=v.pathSector,c.pathAnnulus=v.pathAnnulus;var x=KU();c.isLeftAnchor=x.isLeftAnchor,c.isCenterAnchor=x.isCenterAnchor,c.isRightAnchor=x.isRightAnchor,c.isTopAnchor=x.isTopAnchor,c.isMiddleAnchor=x.isMiddleAnchor,c.isBottomAnchor=x.isBottomAnchor;var S=JU();c.segmentsIntersect=S.segmentsIntersect,c.segmentDistance=S.segmentDistance,c.getTextLocation=S.getTextLocation,c.clearLocationCache=S.clearLocationCache,c.getVisibleSegment=S.getVisibleSegment,c.findPointOnPath=S.findPointOnPath;var M=fn();c.extendFlat=M.extendFlat,c.extendDeep=M.extendDeep,c.extendDeepAll=M.extendDeepAll,c.extendDeepNoArrays=M.extendDeepNoArrays;var C=Xo();c.log=C.log,c.warn=C.warn,c.error=C.error;var w=(l1(),ti(gv));c.counterRegex=w.counter;var k=ww();c.throttle=k.throttle,c.throttleDone=k.done,c.clearThrottle=k.clear;var A=Ty();c.getGraphDiv=A.getGraphDiv,c.isPlotDiv=A.isPlotDiv,c.removeElement=A.removeElement,c.addStyleRule=A.addStyleRule,c.addRelatedStyleRule=A.addRelatedStyleRule,c.deleteRelatedStyleRule=A.deleteRelatedStyleRule,c.setStyleOnHover=A.setStyleOnHover,c.getFullTransformMatrix=A.getFullTransformMatrix,c.getElementTransformMatrix=A.getElementTransformMatrix,c.getElementAndAncestors=A.getElementAndAncestors,c.equalDomRects=A.equalDomRects,c.clearResponsive=QU(),c.preserveDrawingBuffer=tq(),c.makeTraceGroups=rq(),c._=iq(),c.notifier=xn(),c.filterUnique=mE(),c.filterVisible=aq(),c.pushUnique=fE(),c.increment=nq(),c.cleanNumber=(sq(),ti(gE)).default,c.slugify=lq(),c.ensureNumber=function(j){return o(j)?(j=Number(j),j>l||j=j?!1:o(V)&&V>=0&&V%1===0},c.noop=gw(),c.identity=My(),c.repeat=function(V,j){for(var q=new Array(j),Y=0;Yq?Math.max(q,Math.min(j,V)):Math.max(j,Math.min(q,V))},c.bBoxIntersect=function(V,j,q){return q=q||0,V.left<=j.right+q&&j.left<=V.right+q&&V.top<=j.bottom+q&&j.top<=V.bottom+q},c.simpleMap=function(V,j,q,Y,K){for(var te=V.length,ne=new Array(te),se=0;se=Math.pow(2,q)?K>10?(c.warn("randstr failed uniqueness"),ne):V(j,q,Y,(K||0)+1):ne},c.OptionControl=function(V,j){V||(V={}),j||(j="opt");var q={};return q.optionList=[],q._newoption=function(Y){Y[j]=V,q[Y.name]=Y,q.optionList.push(Y)},q["_"+j]=V,q},c.smooth=function(V,j){if(j=Math.round(j)||0,j<2)return V;var q=V.length,Y=2*q,K=2*j-1,te=new Array(K),ne=new Array(q),se,le,ce,pe;for(se=0;se=Y&&(ce-=Y*Math.floor(ce/Y)),ce<0?ce=-1-ce:ce>=q&&(ce=Y-1-ce),pe+=V[ce]*te[le];ne[se]=pe}return ne},c.syncOrAsync=function(V,j,q){var Y,K;function te(){return c.syncOrAsync(V,j,q)}for(;V.length;)if(K=V.splice(0,1)[0],Y=K(j),Y&&Y.then)return Y.then(te);return q&&q(j)},c.stripTrailingSlash=function(V){return V.slice(-1)==="/"?V.slice(0,-1):V},c.noneOrAll=function(V,j,q){if(V){var Y=!1,K=!0,te,ne;for(te=0;te0?K:0})},c.fillArray=function(V,j,q,Y){if(Y=Y||c.identity,c.isArrayOrTypedArray(V))for(var K=0;KF.test(window.navigator.userAgent);var D=/Firefox\/(\d+)\.\d+/;c.getFirefoxVersion=function(){var V=D.exec(window.navigator.userAgent);if(V&&V.length===2){var j=parseInt(V[1]);if(!isNaN(j))return j}return null},c.isD3Selection=function(V){return V instanceof t.selection},c.ensureSingle=function(V,j,q,Y){var K=V.select(j+(q?"."+q:""));if(K.size())return K;var te=V.append(j);return q&&te.classed(q,!0),Y&&te.call(Y),te},c.ensureSingleById=function(V,j,q,Y){var K=V.select(j+"#"+q);if(K.size())return K;var te=V.append(j).attr("id",q);return Y&&te.call(Y),te},c.objectFromPath=function(V,j){for(var q=V.split("."),Y,K=Y={},te=0;te1?K+ne[1]:"";if(te&&(ne.length>1||se.length>4||q))for(;Y.test(se);)se=se.replace(Y,"$1"+te+"$2");return se+le},c.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;c.templateString=function(V,j){var q={};return V.replace(c.TEMPLATE_STRING_REGEX,function(Y,K){var te;return I.test(K)?te=j[K]:(q[K]=q[K]||c.nestedProperty(j,K).get,te=q[K](!0)),te!==void 0?te:""})};var L={max:10,count:0,name:"hovertemplate"};c.hovertemplateString=V=>Z(ar(Nt({},V),{opts:L}));var B={max:10,count:0,name:"texttemplate"};c.texttemplateString=V=>Z(ar(Nt({},V),{opts:B}));var O=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function G(V){var j=V.match(O);return j?{key:j[1],op:j[2],number:Number(j[3])}:{key:V,op:null,number:null}}var W={max:10,count:0,name:"texttemplate",parseMultDiv:!0};c.texttemplateStringForShapes=V=>Z(ar(Nt({},V),{opts:W}));var X=/^[:|\|]/;function Z({data:V=[],locale:j,fallback:q,labels:Y={},opts:K,template:te}){return te.replace(c.TEMPLATE_STRING_REGEX,(ne,se,le)=>{let ce=["xother","yother"].includes(se),pe=["_xother","_yother"].includes(se),xe=["_xother_","_yother_"].includes(se),ye=["xother_","yother_"].includes(se),fe=ce||pe||ye||xe;(pe||xe)&&(se=se.substring(1)),(ye||xe)&&(se=se.substring(0,se.length-1));let ae=null,ee=null;if(K.parseMultDiv){var ie=G(se);se=ie.key,ae=ie.op,ee=ie.number}let Q;if(fe){if(Y[se]===void 0)return"";Q=Y[se]}else for(let Te of V)if(Te){if(Te.hasOwnProperty(se)){Q=Te[se];break}if(I.test(se)||(Q=c.nestedProperty(Te,se).get(!0)),Q!==void 0)break}if(Q===void 0){let{count:Te,max:je,name:Ve}=K,Ke=q===!1?ne:q;return Te=J&&ne<=N,ce=se>=J&&se<=N;if(le&&(Y=10*Y+ne-J),ce&&(K=10*K+se-J),!le||!ce){if(Y!==K)return Y-K;if(ne!==se)return ne-se}}return K-Y};var H=2e9;c.seedPseudoRandom=function(){H=2e9},c.pseudoRandom=function(){var V=H;return H=(69069*H+1)%4294967296,Math.abs(H-V)<429496729?c.pseudoRandom():H/4294967296},c.fillText=function(V,j,q){var Y=Array.isArray(q)?function(ne){q.push(ne)}:function(ne){q.text=ne},K=c.extractOption(V,j,"htx","hovertext");if(c.isValidTextValue(K))return Y(K);var te=c.extractOption(V,j,"tx","text");if(c.isValidTextValue(te))return Y(te)},c.isValidTextValue=function(V){return V||V===0},c.formatPercent=function(V,j){j=j||0;for(var q=(Math.round(100*V*Math.pow(10,j))*Math.pow(.1,j)).toFixed(j)+"%",Y=0;Y1&&(ce=1):ce=0,c.strTranslate(K-ce*(q+ne),te-ce*(Y+se))+c.strScale(ce)+(le?"rotate("+le+(j?"":" "+q+" "+Y)+")":"")},c.setTransormAndDisplay=function(V,j){V.attr("transform",c.getTextTransform(j)),V.style("display",j.scale?null:"none")},c.ensureUniformFontSize=function(V,j){var q=c.extendFlat({},j);return q.size=Math.max(j.size,V._fullLayout.uniformtext.minsize||0),q},c.join2=function(V,j,q){var Y=V.length;return Y>1?V.slice(0,-1).join(j)+q+V[Y-1]:V.join(j)},c.bigFont=function(V){return Math.round(1.2*V)};var $=c.getFirefoxVersion(),U=$!==null&&$<86;c.getPositionFromD3Event=function(){return U?[t.event.layerX,t.event.layerY]:[t.event.offsetX,t.event.offsetY]}}}),uq=de({"build/plotcss.js"(){"use strict";var e=Qt(),r={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .plotly-cloud-dialog":'font-family:"Open Sans",verdana,arial,sans-serif;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1001;display:flex;align-items:center;justify-content:center;background-color:rgba(0,0,0,.4);',"X .plotly-cloud-dialog .plotly-cloud-dialog-box":"box-sizing:border-box;min-width:300px;max-width:420px;padding:20px 24px;background-color:#fff;border:1px solid #e0e2e5;border-radius:4px;box-shadow:0 4px 16px rgba(0,0,0,.25);font-size:13px;color:#2a3f5f;","X .plotly-cloud-dialog .plotly-cloud-dialog-title":"font-size:16px;font-weight:bold;margin-bottom:12px;","X .plotly-cloud-dialog .plotly-cloud-dialog-message":"line-height:1.5;overflow-wrap:break-word;word-wrap:break-word;","X .plotly-cloud-dialog .plotly-cloud-dialog-message--hostname":"font-weight:bold;text-decoration:underline;","X .plotly-cloud-dialog .plotly-cloud-dialog-message--account":"margin-top:16px;padding:8px;border-radius:3px;font-size:.9em;background-color:#edf1f8;","X .plotly-cloud-dialog .plotly-cloud-dialog-buttons":"display:flex;justify-content:flex-end;margin-top:20px;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn":"font-family:inherit;font-size:13px;padding:7px 16px;margin-left:8px;border-radius:3px;border:1px solid rgba(0,0,0,0);cursor:pointer;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn:focus-visible":"outline:2px solid #447adb;outline-offset:1px;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel":"background-color:#f3f3f3;margin-left:auto;color:#777;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel:hover":"background-color:#e0e2e5;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm":"background-color:#447adb;color:#fff;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm:hover":"background-color:#1d3b84;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(i in r)t=i.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),e.addStyleRule(t,r[i]);var t,i}}),wE=de({"node_modules/is-browser/client.js"(e,r){r.exports=!0}}),TE=de({"node_modules/has-hover/index.js"(e,r){"use strict";var t=wE(),i;typeof window.matchMedia=="function"?i=!window.matchMedia("(hover: none)").matches:i=t,r.exports=i}}),_v=de({"node_modules/events/events.js"(e,r){"use strict";var t=typeof Reflect=="object"?Reflect:null,i=t&&typeof t.apply=="function"?t.apply:function(C,w,k){return Function.prototype.apply.call(C,w,k)},a;t&&typeof t.ownKeys=="function"?a=t.ownKeys:Object.getOwnPropertySymbols?a=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:a=function(C){return Object.getOwnPropertyNames(C)};function o(M){console&&console.warn&&console.warn(M)}var s=Number.isNaN||function(C){return C!==C};function l(){l.init.call(this)}r.exports=l,r.exports.once=v,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var n=10;function u(M){if(typeof M!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof M)}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(M){if(typeof M!="number"||M<0||s(M))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+M+".");n=M}}),l.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||s(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function c(M){return M._maxListeners===void 0?l.defaultMaxListeners:M._maxListeners}l.prototype.getMaxListeners=function(){return c(this)},l.prototype.emit=function(C){for(var w=[],k=1;k0&&(E=w[0]),E instanceof Error)throw E;var T=new Error("Unhandled error."+(E?" ("+E.message+")":""));throw T.context=E,T}var F=b[C];if(F===void 0)return!1;if(typeof F=="function")i(F,this,w);else for(var D=F.length,R=m(F,D),k=0;k0&&E.length>A&&!E.warned){E.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=M,T.type=C,T.count=E.length,o(T)}return M}l.prototype.addListener=function(C,w){return f(this,C,w,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(C,w){return f(this,C,w,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(M,C,w){var k={fired:!1,wrapFn:void 0,target:M,type:C,listener:w},A=h.bind(k);return A.listener=w,k.wrapFn=A,A}l.prototype.once=function(C,w){return u(w),this.on(C,d(this,C,w)),this},l.prototype.prependOnceListener=function(C,w){return u(w),this.prependListener(C,d(this,C,w)),this},l.prototype.removeListener=function(C,w){var k,A,b,E,T;if(u(w),A=this._events,A===void 0)return this;if(k=A[C],k===void 0)return this;if(k===w||k.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete A[C],A.removeListener&&this.emit("removeListener",C,k.listener||w));else if(typeof k!="function"){for(b=-1,E=k.length-1;E>=0;E--)if(k[E]===w||k[E].listener===w){T=k[E].listener,b=E;break}if(b<0)return this;b===0?k.shift():y(k,b),k.length===1&&(A[C]=k[0]),A.removeListener!==void 0&&this.emit("removeListener",C,T||w)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(C){var w,k,A;if(k=this._events,k===void 0)return this;if(k.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):k[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete k[C]),this;if(arguments.length===0){var b=Object.keys(k),E;for(A=0;A=0;A--)this.removeListener(C,w[A]);return this};function p(M,C,w){var k=M._events;if(k===void 0)return[];var A=k[C];return A===void 0?[]:typeof A=="function"?w?[A.listener||A]:[A]:w?_(A):m(A,A.length)}l.prototype.listeners=function(C){return p(this,C,!0)},l.prototype.rawListeners=function(C){return p(this,C,!1)},l.listenerCount=function(M,C){return typeof M.listenerCount=="function"?M.listenerCount(C):g.call(M,C)},l.prototype.listenerCount=g;function g(M){var C=this._events;if(C!==void 0){var w=C[M];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}l.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function m(M,C){for(var w=new Array(C),k=0;k{},{passive:!0}),a},triggerHandler:function(a,o,s){var l,n=a._ev;if(!n)return;var u=n._events[o];if(!u)return;function c(h){if(h.listener){if(n.removeListener(o,h.listener),!h.fired)return h.fired=!0,h.listener.apply(n,[s])}else return h.apply(n,[s])}u=Array.isArray(u)?u:[u];var f;for(f=0;fi.queueLength&&(s.undoQueue.queue.shift(),s.undoQueue.index--)},o.startSequence=function(s){s.undoQueue=s.undoQueue||{index:0,queue:[],sequence:!1},s.undoQueue.sequence=!0,s.undoQueue.beginSequence=!0},o.stopSequence=function(s){s.undoQueue=s.undoQueue||{index:0,queue:[],sequence:!1},s.undoQueue.sequence=!1,s.undoQueue.beginSequence=!1},o.undo=function(l){var n,u;if(!(l.undoQueue===void 0||isNaN(l.undoQueue.index)||l.undoQueue.index<=0)){for(l.undoQueue.index--,n=l.undoQueue.queue[l.undoQueue.index],l.undoQueue.inSequence=!0,u=0;u=l.undoQueue.queue.length)){for(n=l.undoQueue.queue[l.undoQueue.index],l.undoQueue.inSequence=!0,u=0;u=L.length)return!1;if(D.dimensions===2){if(P++,R.length===P)return D;var B=R[P];if(!S(B))return!1;D=L[I][B]}else D=L[I]}else D=L}}return D}function S(D){return D===Math.round(D)&&D>=0}function M(D){var R,P;R=r.modules[D]._module,P=R.basePlotModule;var z={};z.type=null;var I=u({},i),L=u({},R.attributes);e.crawl(L,function(G,W,X,Z,J){h(I,J).set(void 0),G===void 0&&h(L,J).set(void 0)}),u(z,I),r.traceIs(D,"noOpacity")&&delete z.opacity,r.traceIs(D,"showLegend")||(delete z.showlegend,delete z.legendgroup),r.traceIs(D,"noHover")&&(delete z.hoverinfo,delete z.hoverlabel),R.selectPoints||delete z.selectedpoints,u(z,L),P.attributes&&u(z,P.attributes),z.type=D;var B={meta:R.meta||{},categories:R.categories||{},animatable:!!R.animatable,type:D,attributes:k(z)};if(R.layoutAttributes){var O={};u(O,R.layoutAttributes),B.layoutAttributes=k(O)}return R.animatable||e.crawl(B,function(G){e.isValObject(G)&&"anim"in G&&delete G.anim}),B}function C(){var D={},R,P;u(D,a);for(R in r.subplotsRegistry)if(P=r.subplotsRegistry[R],!!P.layoutAttributes)if(Array.isArray(P.attr))for(var z=0;z=c&&(u._input||{})._templateitemname;h&&(f=c);var d=n+"["+f+"]",p;function g(){p={},h&&(p[d]={},p[d][i]=h)}g();function m(x,S){p[x]=S}function y(x,S){h?r.nestedProperty(p[d],x).set(S):p[d+"."+x]=S}function _(){var x=p;return g(),x}function v(x,S){x&&y(x,S);var M=_();for(var C in M)r.nestedProperty(l,C).set(M[C])}return{modifyBase:m,modifyItem:y,getUpdateObj:_,applyUpdate:v}}}}),zl=de({"src/plots/cartesian/constants.js"(e,r){"use strict";var t=(l1(),ti(gv)).counter;r.exports={idRegex:{x:t("x","( domain)?"),y:t("y","( domain)?")},attrRegex:t("[xy]axis"),xAxisMatch:t("xaxis"),yAxisMatch:t("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),Hs=de({"src/plots/cartesian/axis_ids.js"(e){"use strict";var r=Sa(),t=zl();e.id2name=function(o){if(!(typeof o!="string"||!o.match(t.AX_ID_PATTERN))){var s=o.split(" ")[0].slice(1);return s==="1"&&(s=""),o.charAt(0)+"axis"+s}},e.name2id=function(o){if(o.match(t.AX_NAME_PATTERN)){var s=o.slice(5);return s==="1"&&(s=""),o.charAt(0)+s}},e.cleanId=function(o,s,l){var n=/( domain)$/.test(o);if(!(typeof o!="string"||!o.match(t.AX_ID_PATTERN))&&!(s&&o.charAt(0)!==s)&&!(n&&!l)){var u=o.split(" ")[0].slice(1).replace(/^0+/,"");return u==="1"&&(u=""),o.charAt(0)+u+(n&&l?" domain":"")}},e.list=function(a,o,s){var l=a._fullLayout;if(!l)return[];var n=e.listIds(a,o),u=new Array(n.length),c;for(c=0;cl?1:-1:+(a.slice(1)||1)-+(o.slice(1)||1)},e.ref2id=function(a){return/^[xyz]/.test(a)?a.split(" ")[0]:!1};function i(a,o){if(o&&o.length){for(var s=0;s0?".":"")+h;t.isPlainObject(d)?l(d,u,p,f+1):u(p,h,d)}})}}}),ks=de({"src/plots/plots.js"(e,r){"use strict";var t=Yr(),i=eo().timeFormatLocale,a=rs().formatLocale,o=da(),s=Es(),l=_i().version,n=Sa(),u=f1(),c=Ro(),f=Qt(),h=ta(),d=cn().BADNUM,p=Hs(),g=h0().clearOutline,m=Tw(),y=Ay(),_=AE(),v=$u().getModuleCalcData,x=f.relinkPrivateKeys,S=f._,M=r.exports={};f.extendFlat(M,n),M.attributes=ri(),M.attributes.type.values=M.allTypes,M.fontAttrs=us(),M.layoutAttributes=u1();var C=fq();M.executeAPICommand=C.executeAPICommand,M.computeAPICommandBindings=C.computeAPICommandBindings,M.manageCommandObserver=C.manageCommandObserver,M.hasSimpleAPICommandBindings=C.hasSimpleAPICommandBindings,M.redrawText=function(N){return N=f.getGraphDiv(N),new Promise(function(H){setTimeout(function(){N._fullLayout&&(n.getComponentMethod("annotations","draw")(N),n.getComponentMethod("legend","draw")(N),n.getComponentMethod("colorbar","draw")(N),H(M.previousPromises(N)))},300)})},M.resize=function(N){N=f.getGraphDiv(N);var H,$=new Promise(function(U,V){(!N||f.isHidden(N))&&V(new Error("Resize must be passed a displayed plot div element.")),N._redrawTimer&&clearTimeout(N._redrawTimer),N._resolveResize&&(H=N._resolveResize),N._resolveResize=U,N._redrawTimer=setTimeout(function(){if(!N.layout||N.layout.width&&N.layout.height||f.isHidden(N)){U(N);return}delete N.layout.width,delete N.layout.height;var j=N.changed;N.autoplay=!0,n.call("relayout",N,{autosize:!0}).then(function(){N.changed=j,N._resolveResize===U&&(delete N._resolveResize,U(N))})},100)});return H&&H($),$},M.previousPromises=function(N){if((N._promises||[]).length)return Promise.all(N._promises).then(function(){N._promises=[]})},M.sendDataToCloud=function(N,H){N.emit("plotly_beforeexport");let $=new URL(H).origin;var U=M.graphJson(N,!1,"object");U.version=l;var V=new URL(H);V.searchParams.set("origin",window.location.origin);var j=window.open(V.href,"_blank");if(!j){console.error("Unable to open Plotly Cloud (the popup may have been blocked)"),N.emit("plotly_exportfail");return}var q=function(Y){Y.origin===$&&Y.data&&Y.data.type==="CHART_AUTH_SUCCESS"&&(j.postMessage({type:"chart",chart:U},$),window.removeEventListener("message",q),N.emit("plotly_afterexport"))};return window.addEventListener("message",q),!1};var w=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];M.supplyDefaults=function(N,H){var $=H&&H.skipUpdateCalc,U=N._fullLayout||{};if(U._skipDefaults){delete U._skipDefaults;return}var V=N._fullLayout={},j=N.layout||{},q=N._fullData||[],Y=N._fullData=[],K=N.data||[],te=N.calcdata||[],ne=N._context||{},se;N._transitionData||M.createTransitionData(N),V._dfltTitle={plot:S(N,"Click to enter Plot title"),subtitle:S(N,"Click to enter Plot subtitle"),x:S(N,"Click to enter X axis title"),y:S(N,"Click to enter Y axis title"),colorbar:S(N,"Click to enter Colorscale title"),annotation:S(N,"new text")},V._traceWord=S(N,"trace");var le=E(N,w);if(U._initialAutoSizeIsDone){var ce=U.width,pe=U.height;M.supplyLayoutGlobalDefaults(j,V,le),j.width||(V.width=ce),j.height||(V.height=pe),M.sanitizeMargins(V)}else{M.supplyLayoutGlobalDefaults(j,V,le);var xe=!j.width||!j.height,ye=V.autosize,fe=ne.autosizable,ae=xe&&(ye||fe);ae?M.plotAutoSize(N,j,V):xe&&M.sanitizeMargins(V),!ye&&xe&&(j.width=V.width,j.height=V.height)}V._d3locale=T(le,V.separators),V._extraFormat=E(N,k),V._initialAutoSizeIsDone=!0,V._dataLength=K.length,V._modules=[],V._visibleModules=[],V._basePlotModules=[];var ee=V._subplots=b(),ie=V._splomAxes={x:{},y:{}},Q=V._splomSubplots={};V._splomGridDflt={},V._scatterStackOpts={},V._firstScatter={},V._alignmentOpts={},V._colorAxes={},V._requestRangeslider={},V._traceUids=A(q,K),M.supplyDataDefaults(K,Y,j,V);var ue=Object.keys(ie.x),ge=Object.keys(ie.y);if(ue.length>1&&ge.length>1){for(n.getComponentMethod("grid","sizeDefaults")(j,V),se=0;se15&&ge.length>15&&V.shapes.length===0&&V.images.length===0,M.linkSubplots(Y,V,q,U),M.cleanPlot(Y,V,q,U);var Ke=!!(U._has&&U._has("cartesian")),Je=!!(V._has&&V._has("cartesian")),vt=Ke,xt=Je;vt&&!xt?U._bgLayer.remove():xt&&!vt&&(V._shouldCreateBgLayer=!0),U._zoomlayer&&!N._dragging&&g({_fullLayout:U}),F(Y,V),x(V,U),n.getComponentMethod("colorscale","crossTraceDefaults")(Y,V),V._preGUI||(V._preGUI={}),V._tracePreGUI||(V._tracePreGUI={});var Pt=V._tracePreGUI,mt={},Mt;for(Mt in Pt)mt[Mt]="old";for(se=0;se0){var ne=1-2*j;q=Math.round(ne*q),Y=Math.round(ne*Y)}}var se=M.layoutAttributes.width.min,le=M.layoutAttributes.height.min;q1,pe=!$.height&&Math.abs(U.height-Y)>1;(pe||ce)&&(ce&&(U.width=q),pe&&(U.height=Y)),H._initialAutoSize||(H._initialAutoSize={width:q,height:Y}),M.sanitizeMargins(U)},M.supplyLayoutModuleDefaults=function(N,H,$,U){var V=n.componentsRegistry,j=H._basePlotModules,q,Y,K,te=n.subplotsRegistry.cartesian;for(q in V)K=V[q],K.includeBasePlot&&K.includeBasePlot(N,H);j.length||j.push(te),H._has("cartesian")&&(n.getComponentMethod("grid","contentDefaults")(N,H),te.finalizeSubplots(N,H));for(var ne in H._subplots)H._subplots[ne].sort(f.subplotSort);for(Y=0;Y1&&($.l/=ye,$.r/=ye)}if(le){var fe=($.t+$.b)/le;fe>1&&($.t/=fe,$.b/=fe)}var ae=$.xl!==void 0?$.xl:$.x,ee=$.xr!==void 0?$.xr:$.x,ie=$.yt!==void 0?$.yt:$.y,Q=$.yb!==void 0?$.yb:$.y;ce[H]={l:{val:ae,size:$.l+xe},r:{val:ee,size:$.r+xe},b:{val:Q,size:$.b+xe},t:{val:ie,size:$.t+xe}},pe[H]=1}if(!U._replotting)return M.doAutoMargin(N)}};function L(N){if("_redrawFromAutoMarginCount"in N._fullLayout)return!1;var H=p.list(N,"",!0);for(var $ in H)if(H[$].autoshift||H[$].shift)return!0;return!1}M.doAutoMargin=function(N){var H=N._fullLayout,$=H.width,U=H.height;H._size||(H._size={}),P(H);var V=H._size,j=H.margin,q={t:0,b:0,l:0,r:0},Y=f.extendFlat({},V),K=j.l,te=j.r,ne=j.t,se=j.b,le=H._pushmargin,ce=H._pushmarginIds,pe=H.minreducedwidth,xe=H.minreducedheight;if(j.autoexpand!==!1){for(var ye in le)ce[ye]||delete le[ye];var fe=N._fullLayout._reservedMargin;for(var ae in fe)for(var ee in fe[ae]){var ie=fe[ae][ee];q[ee]=Math.max(q[ee],ie)}le.base={l:{val:0,size:K},r:{val:1,size:te},t:{val:1,size:ne},b:{val:0,size:se}};for(var Q in q){var ue=0;for(var ge in le)ge!=="base"&&o(le[ge][Q].size)&&(ue=le[ge][Q].size>ue?le[ge][Q].size:ue);var Me=Math.max(0,j[Q]-ue);q[Q]=Math.max(0,q[Q]-Me)}for(var Te in le){var je=le[Te].l||{},Ve=le[Te].b||{},Ke=je.val,Je=je.size,vt=Ve.val,xt=Ve.size,Pt=$-q.r-q.l,mt=U-q.t-q.b;for(var Mt in le){if(o(Je)&&le[Mt].r){var lt=le[Mt].r.val,qe=le[Mt].r.size;if(lt>Ke){var Ye=(Je*lt+(qe-Pt)*Ke)/(lt-Ke),me=(qe*(1-Ke)+(Je-Pt)*(1-lt))/(lt-Ke);Ye+me>K+te&&(K=Ye,te=me)}}if(o(xt)&&le[Mt].t){var _e=le[Mt].t.val,Ae=le[Mt].t.size;if(_e>vt){var ke=(xt*_e+(Ae-mt)*vt)/(_e-vt),Ee=(Ae*(1-vt)+(xt-mt)*(1-_e))/(_e-vt);ke+Ee>se+ne&&(se=ke,ne=Ee)}}}}}var De=f.constrain($-j.l-j.r,z,pe),Qe=f.constrain(U-j.t-j.b,I,xe),Ue=Math.max(0,$-De),at=Math.max(0,U-Qe);if(Ue){var rt=(K+te)/Ue;rt>1&&(K/=rt,te/=rt)}if(at){var ht=(se+ne)/at;ht>1&&(se/=ht,ne/=ht)}if(V.l=Math.round(K)+q.l,V.r=Math.round(te)+q.r,V.t=Math.round(ne)+q.t,V.b=Math.round(se)+q.b,V.p=Math.round(j.pad),V.w=Math.round($)-V.l-V.r,V.h=Math.round(U)-V.t-V.b,!H._replotting&&(M.didMarginChange(Y,V)||L(N))){"_redrawFromAutoMarginCount"in H?H._redrawFromAutoMarginCount++:H._redrawFromAutoMarginCount=1;var At=3*(1+Object.keys(ce).length);if(H._redrawFromAutoMarginCount1)return!0}return!1},M.graphJson=function(N,H=!1,$="json",U=!1,V=!1){(U&&H&&!N._fullData||U&&!H&&!N._fullLayout)&&M.supplyDefaults(N);var j=U?N._fullData:N.data,q=U?N._fullLayout:N.layout,Y=(N._transitionData||{})._frames;function K(se,le){if(typeof se=="function")return le?"_function_":null;if(f.isPlainObject(se)){var ce={};return Object.keys(se).sort().forEach(function(fe){if(["_","["].indexOf(fe.charAt(0))===-1){if(typeof se[fe]=="function"){le&&(ce[fe]="_function");return}ce[fe]=K(se[fe],le)}}),ce}var pe=Array.isArray(se),xe=f.isTypedArray(se);if((pe||xe)&&se.dtype&&se.shape){var ye=se.bdata;return K({dtype:se.dtype,shape:se.shape,bdata:f.isArrayBuffer(ye)?s.encode(ye):ye},le)}return pe?se.map(function(fe){return K(fe,le)}):xe?f.simpleMap(se,f.identity):f.isJSDate(se)?f.ms2DateTimeLocal(+se):se}var te={data:(j||[]).map(function(se){var le=K(se);return H&&delete le.fit,le})};if(!H&&(te.layout=K(q),U)){var ne=q._size;te.layout.computed={margin:{b:ne.b,l:ne.l,r:ne.r,t:ne.t}}}return Y&&(te.frames=K(Y)),V&&(te.config=K(N._context,!0)),$==="object"?te:JSON.stringify(te)},M.modifyFrames=function(N,H){var $,U,V,j=N._transitionData._frames,q=N._transitionData._frameHash;for($=0;$0&&(N._transitioningWithDuration=!0),N._transitionData._interruptCallbacks.push(function(){U=!0}),$.redraw&&N._transitionData._interruptCallbacks.push(function(){return n.call("redraw",N)}),N._transitionData._interruptCallbacks.push(function(){N.emit("plotly_transitioninterrupted",[])});var le=0,ce=0;function pe(){return le++,function(){ce++,!U&&ce===le&&Y(se)}}$.runFn(pe),setTimeout(pe())})}function Y(se){if(N._transitionData)return j(N._transitionData._interruptCallbacks),Promise.resolve().then(function(){if($.redraw)return n.call("redraw",N)}).then(function(){N._transitioning=!1,N._transitioningWithDuration=!1,N.emit("plotly_transitioned",[])}).then(se)}function K(){if(N._transitionData)return N._transitioning=!1,V(N._transitionData._interruptCallbacks)}var te=[M.previousPromises,K,$.prepareFn,M.rehover,M.reselect,q],ne=f.syncOrAsync(te,N);return(!ne||!ne.then)&&(ne=Promise.resolve()),ne.then(function(){return N})}M.doCalcdata=function(N,H){var $=p.list(N),U=N._fullData,V=N._fullLayout,j,q,Y,K=new Array(U.length),te=(N.calcdata||[]).slice();for(N.calcdata=K,V._numBoxes=0,V._numViolins=0,V._violinScaleGroupStats={},N._hmpixcount=0,N._hmlumcount=0,V._piecolormap={},V._sunburstcolormap={},V._treemapcolormap={},V._iciclecolormap={},V._funnelareacolormap={},Y=0;YW?W.match(s):null;e.matchTex=l,e.convertToTspans=function(W,X,Z){var J=W.text(),N=!W.attr("data-notex")&&X&&X._context.typesetMath&&l(J);N&&!g()&&(N=null);var H=r.select(W.node().parentNode);if(H.empty())return;var $=W.attr("class")?W.attr("class").split(" ")[0]:"text";$+="-math",H.selectAll("svg."+$).remove(),H.selectAll("g."+$+"-group").remove(),W.style("display",null).attr({"data-unformatted":J,"data-math":"N"});function U(){H.empty()||($=W.attr("class")+"-math",H.select("svg."+$).remove()),W.text("").style("white-space","pre");var V=L(W.node(),J);V&&W.style("pointer-events","all"),e.positionText(W),Z&&Z.call(W)}return N?(X&&X._promises||[]).push(new Promise(function(V){W.style("display","none");var j=parseInt(W.node().style.fontSize,10),q={fontSize:j},Y=W.attr("text-anchor");m(N[2],q,function(K,te,ne){H.selectAll("svg."+$).remove(),H.selectAll("g."+$+"-group").remove();var se=K&&K.select("svg");if(!se||!se.node()){U(),V();return}W.style("display","none");var le=H.append("g").classed($+"-group",!0).attr({"pointer-events":"none","data-unformatted":J,"data-math":"Y"});le.node().appendChild(se.node()),te&&te.node()&&se.node().insertBefore(te.node().cloneNode(!0),se.node().firstChild);var ce=ne.width,pe=ne.height;se.attr({class:$,height:pe,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none","font-size":q.fontSize+"px"});var xe=W.node().style.fill||"black",ye=se.select("g");ye.attr({fill:xe,stroke:xe});var fe=ye.node().getBoundingClientRect(),ae=fe.width,ee=fe.height;(ae>ce||ee>pe)&&(se.style("overflow","hidden"),fe=se.node().getBoundingClientRect(),ae=fe.width,ee=fe.height);var ie=+W.attr("x"),Q=+W.attr("y"),ue=j||W.node().getBoundingClientRect().height,ge=-ue/4;$[0]==="y"?le.attr({transform:"rotate("+[-90,ie,Q]+")"+i(-ae/2,ge-ee/2)}):$[0]==="l"?Q=ge-ee/2:$[0]==="a"&&$.indexOf("atitle")!==0?(ie=0,Q=ge):(ie=ie-ae*(Y==="middle"?.5:Y==="end"?1:0),Q=Q+ge-ee/2),se.attr({x:ie,y:Q}),Z&&Z.call(W,le),V(le)})})):U(),W};var n=/(<|<|<)/g,u=/(>|>|>)/g;function c(W){return W.replace(n,"\\lt ").replace(u,"\\gt ")}var f=null,h=()=>typeof MathJax<"u"&&MathJax.version?parseInt(MathJax.version.split(".")[0]):null,d=!1,p=!1;function g(){let W=h();return W===3||W===4?!0:(W===null?d||(d=!0,t.warn("MathJax is not loaded. Math equations will not be rendered.")):p||(p=!0,t.warn("Unsupported MathJax version:",MathJax.version)),!1)}function m(W,X,Z){let J=h();var N;let H=function(){if(!f){let j=MathJax._.output.svg_ts.SVG,q=t.extendFlat({},MathJax.config.svg,{fontCache:"local"});J===4&&(q.linebreaks=t.extendFlat({},q.linebreaks,{inline:!1})),f=MathJax._.mathjax.mathjax.document(document,t.extendFlat({},MathJax.config.options,{InputJax:MathJax.startup.input,OutputJax:new j(q)}))}let U="math-output-"+t.randstr({},64);N=r.select("body").append("div").attr({id:U}).style({visibility:"hidden",position:"absolute","font-size":X.fontSize+"px"});let V=c(W).replace(/^\$+|\$+$/g,"");return MathJax._.mathjax.mathjax.handleRetriesFor(function(){return f.convert(V,{display:!1})}).then(function(j){N.node().appendChild(j)})},$=function(){let U=N.select(".MathJax"),V=!U.empty()&&N.select("svg").node();if(!V)t.log("There was an error in the tex syntax.",W),Z();else{let j=V.getBoundingClientRect(),q=U.select("defs");Z(U,q,j)}N.remove()};Promise.resolve().then(H).then($).catch(U=>{t.log("MathJax typesetting failed.",W,U),N&&N.remove(),Z()})}var y={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},_={sub:"0.3em",sup:"-0.6em"},v={sub:"-0.21em",sup:"0.42em"},x="\u200B",S=["http:","https:","mailto:","",void 0,":"],M=e.NEWLINES=/(\r\n?|\n)/g,C=/(<[^<>]*>)/,w=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;e.BR_TAG_ALL=//gi;var A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,E=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function F(W,X){if(!W)return null;var Z=W.match(X),J=Z&&(Z[3]||Z[4]);return J&&z(J)}var D=/(^|;)\s*color:/;e.plainText=function(W,X){X=X||{};for(var Z=X.len!==void 0&&X.len!==-1?X.len:1/0,J=X.allowedTags!==void 0?X.allowedTags:["br"],N="...",H=N.length,$=W.split(C),U=[],V="",j=0,q=0;q<$.length;q++){var Y=$[q],K=Y.match(w),te=K&&K[2].toLowerCase();if(te)J.indexOf(te)!==-1&&(U.push(Y),V=te);else{var ne=Y.length;if(j+neH?U.push(Y.slice(0,Math.max(0,se-H))+N):U.push(Y.slice(0,se));break}V=""}}return U.join("")};var R={mu:"\u03BC",amp:"&",lt:"<",gt:">",nbsp:"\xA0",times:"\xD7",plusmn:"\xB1",deg:"\xB0"},P=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function z(W){return W.replace(P,function(X,Z){var J;return Z.charAt(0)==="#"?J=I(Z.charAt(1)==="x"?parseInt(Z.slice(2),16):parseInt(Z.slice(1),10)):J=R[Z],J||X})}e.convertEntities=z;function I(W){if(!(W>1114111)){var X=String.fromCodePoint;if(X)return X(W);var Z=String.fromCharCode;return W<=65535?Z(W):Z((W>>10)+55232,W%1024+56320)}}function L(W,X){X=X.replace(M," ");var Z=!1,J=[],N,H=-1;function $(){H++;var ae=document.createElementNS(a.svg,"tspan");r.select(ae).attr({class:"line",dy:H*o+"em"}),W.appendChild(ae),N=ae;var ee=J;if(J=[{node:ae}],ee.length>1)for(var ie=1;ie.",X);return}var ee=J.pop();ae!==ee.type&&t.log("Start tag <"+ee.type+"> doesnt match end tag <"+ae+">. Pretending it did match.",X),N=J[J.length-1].node}var q=k.test(X);q?$():(N=W,J=[{node:W}]);for(var Y=X.split(C),K=0;K=0;_--,v++){var x=g[_];y[v]=[1-x[0],x[1]]}return y}function d(g,m){m=m||{};for(var y=g.domain,_=g.range,v=_.length,x=new Array(v),S=0;Sy-g?g=y-(m-y):m-y=0?x=u.colorscale.sequential:x=u.colorscale.sequentialminus,d._sync("colorscale",x)}}}}),Cs=de({"src/components/colorscale/index.js"(e,r){"use strict";var t=mv(),i=Wu();r.exports={moduleType:"component",name:"colorscale",attributes:cs(),layoutAttributes:ME(),supplyLayoutDefaults:hq(),handleDefaults:hu(),crossTraceDefaults:dq(),calc:hc(),scales:t.scales,defaultScale:t.defaultScale,getScale:t.get,isValidScale:t.isValid,hasColorscale:i.hasColorscale,extractOpts:i.extractOpts,extractScale:i.extractScale,flipScale:i.flipScale,makeColorScaleFunc:i.makeColorScaleFunc,makeColorScaleFuncFromTrace:i.makeColorScaleFuncFromTrace}}}),bs=de({"src/traces/scatter/subtypes.js"(e,r){"use strict";var t=Qt(),i=Do().isTypedArraySpec;r.exports={hasLines:function(a){return a.visible&&a.mode&&a.mode.indexOf("lines")!==-1},hasMarkers:function(a){return a.visible&&(a.mode&&a.mode.indexOf("markers")!==-1||a.type==="splom")},hasText:function(a){return a.visible&&a.mode&&a.mode.indexOf("text")!==-1},isBubble:function(a){var o=a.marker;return t.isPlainObject(o)&&(t.isArrayOrTypedArray(o.size)||i(o.size))}}}}),Sy=de({"src/traces/scatter/make_bubble_size_func.js"(e,r){"use strict";var t=da();r.exports=function(a,o){o||(o=2);var s=a.marker,l=s.sizeref||1,n=s.sizemin||0,u=s.sizemode==="area"?function(c){return Math.sqrt(c/l)}:function(c){return c/l};return function(c){var f=u(c/o);return t(f)&&f>0?Math.max(f,n):0}}}}),sf=de({"src/components/fx/helpers.js"(e){"use strict";var r=Qt();e.getSubplot=function(l){return l.subplot||l.xaxis+l.yaxis||l.geo},e.isTraceInSubplots=function(l,n){if(l.type==="splom"){for(var u=l.xaxes||[],c=l.yaxes||[],f=0;f=0&&u.index{let h=c.toLowerCase(),d=c,p=s(f);for(h==="m"&&p.length>2&&(n.push([d,...p.splice(0,2)]),h="l",d=d==="m"?"l":"L");;){if(p.length===t[h])return n.push([d,...p]),"";if(p.length0&&(ee=100,ae=ae.replace("-open","")),ae.indexOf("-dot")>0&&(ee+=200,ae=ae.replace("-dot","")),ae=_.symbolNames.indexOf(ae),ae>=0&&(ae+=ee)}return ae%100>=k||ae>=400?0:Math.floor(Math.max(ae,0))};function b(ae,ee,ie,Q){var ue=ae%100;return _.symbolFuncs[ue](ee,ie,Q)+(ae>=200?A:"")}var E=a("~f"),T={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};_.gradient=function(ae,ee,ie,Q,ue,ge){var Me=T[Q];return F(ae,ee,ie,Me.type,ue,ge,Me.start,Me.stop,!1,Me.reversed)};function F(ae,ee,ie,Q,ue,ge,Me,Te,je,Ve){var Ke=ue.length,Je;Q==="linear"?Je={node:"linearGradient",attrs:{x1:Me.x,y1:Me.y,x2:Te.x,y2:Te.y,gradientUnits:je?"userSpaceOnUse":"objectBoundingBox"},reversed:Ve}:Q==="radial"&&(Je={node:"radialGradient",reversed:Ve});for(var vt=new Array(Ke),xt=0;xt=0&&ae.i===void 0&&(ae.i=ge.i),ee.style("opacity",Q.selectedOpacityFn?Q.selectedOpacityFn(ae):ae.mo===void 0?Me.opacity:ae.mo),Q.ms2mrc){var je;ae.ms==="various"||Me.size==="various"?je=3:je=Q.ms2mrc(ae.ms),ae.mrc=je,Q.selectedSizeFn&&(je=ae.mrc=Q.selectedSizeFn(ae));var Ve=_.symbolNumber(ae.mx||Me.symbol)||0;ae.om=Ve%200>=100;var Ke=fe(ae,ie),Je=q(ae,ie);ee.attr("d",b(Ve,je,Ke,Je))}var vt=!1,xt,Pt,mt;if(ae.so)mt=Te.outlierwidth,Pt=Te.outliercolor,xt=Me.outliercolor;else{var Mt=(Te||{}).width;mt=(ae.mlw+1||Mt+1||(ae.trace?(ae.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in ae?Pt=ae.mlcc=Q.lineScale(ae.mlc):i.isArrayOrTypedArray(Te.color)?Pt=l.defaultLine:Pt=Te.color,i.isArrayOrTypedArray(Me.color)&&(xt=l.defaultLine,vt=!0),"mc"in ae?xt=ae.mcc=Q.markerScale(ae.mc):xt=Me.color||Me.colors||"rgba(0,0,0,0)",Q.selectedColorFn&&(xt=Q.selectedColorFn(ae))}let lt=ae.mld||(Te||{}).dash;if(lt&&_.dashLine(ee,lt,mt),ae.om)ee.call(l.stroke,xt).style({"stroke-width":(mt||1)+"px",fill:"none"});else{ee.style("stroke-width",(ae.isBlank?0:mt)+"px");var qe=Me.gradient,Ye=ae.mgt;Ye?vt=!0:Ye=qe&&qe.type,i.isArrayOrTypedArray(Ye)&&(Ye=Ye[0],T[Ye]||(Ye=0));var me=Me.pattern,_e=_.getPatternAttr,Ae=me&&(_e(me.shape,ae.i,"")||_e(me.path,ae.i,""));if(Ye&&Ye!=="none"){var ke=ae.mgc;ke?vt=!0:ke=qe.color;var Ee=ie.uid;vt&&(Ee+="-"+ae.i),_.gradient(ee,ue,Ee,Ye,[[0,ke],[1,xt]],"fill")}else if(Ae){var De=!1,Qe=me.fgcolor;!Qe&&ge&&ge.color&&(Qe=ge.color,De=!0);var Ue=_e(Qe,ae.i,ge&&ge.color||null),at=_e(me.bgcolor,ae.i,null),rt=me.fgopacity,ht=_e(me.size,ae.i,8),At=_e(me.solidity,ae.i,.3);De=De||ae.mcc||i.isArrayOrTypedArray(me.shape)||i.isArrayOrTypedArray(me.path)||i.isArrayOrTypedArray(me.bgcolor)||i.isArrayOrTypedArray(me.fgcolor)||i.isArrayOrTypedArray(me.size)||i.isArrayOrTypedArray(me.solidity);var dt=ie.uid;De&&(dt+="-"+ae.i),_.pattern(ee,"point",ue,dt,Ae,ht,At,ae.mcc,me.fillmode,at,Ue,rt)}else i.isArrayOrTypedArray(xt)?l.fill(ee,xt[ae.i]):l.fill(ee,xt);mt&&l.stroke(ee,Pt)}},_.makePointStyleFns=function(ae){var ee={},ie=ae.marker;return ee.markerScale=_.tryColorscale(ie,""),ee.lineScale=_.tryColorscale(ie,"line"),s.traceIs(ae,"symbols")&&(ee.ms2mrc=g.isBubble(ae)?m(ae):function(){return(ie.size||6)/2}),ae.selectedpoints&&i.extendFlat(ee,_.makeSelectedPointStyleFns(ae)),ee},_.makeSelectedPointStyleFns=function(ae){var ee={},ie=ae.selected||{},Q=ae.unselected||{},ue=ae.marker||{},ge=ie.marker||{},Me=Q.marker||{},Te=ue.opacity,je=ge.opacity,Ve=Me.opacity,Ke=je!==void 0,Je=Ve!==void 0;(i.isArrayOrTypedArray(Te)||Ke||Je)&&(ee.selectedOpacityFn=function(me){var _e=me.mo===void 0?ue.opacity:me.mo;return me.selected?Ke?je:_e:Je?Ve:p*_e});var vt=ue.color,xt=ge.color,Pt=Me.color;(xt||Pt)&&(ee.selectedColorFn=function(me){var _e=me.mcc||vt;return me.selected?xt||_e:Pt||_e});var mt=ue.size,Mt=ge.size,lt=Me.size,qe=Mt!==void 0,Ye=lt!==void 0;return s.traceIs(ae,"symbols")&&(qe||Ye)&&(ee.selectedSizeFn=function(me){var _e=me.mrc||mt/2;return me.selected?qe?Mt/2:_e:Ye?lt/2:_e}),ee},_.makeSelectedTextStyleFns=function(ae){var ee={},ie=ae.selected||{},Q=ae.unselected||{},ue=ae.textfont||{},ge=ie.textfont||{},Me=Q.textfont||{},Te=ue.color,je=ge.color,Ve=Me.color;return ee.selectedTextColorFn=function(Ke){var Je=Ke.tc||Te;return Ke.selected?je||Je:Ve||(je?Je:l.addOpacity(Je,p))},ee},_.selectedPointStyle=function(ae,ee){if(!(!ae.size()||!ee.selectedpoints)){var ie=_.makeSelectedPointStyleFns(ee),Q=ee.marker||{},ue=[];ie.selectedOpacityFn&&ue.push(function(ge,Me){ge.style("opacity",ie.selectedOpacityFn(Me))}),ie.selectedColorFn&&ue.push(function(ge,Me){l.fill(ge,ie.selectedColorFn(Me))}),ie.selectedSizeFn&&ue.push(function(ge,Me){var Te=Me.mx||Q.symbol||0,je=ie.selectedSizeFn(Me);ge.attr("d",b(_.symbolNumber(Te),je,fe(Me,ee),q(Me,ee))),Me.mrc2=je}),ue.length&&ae.each(function(ge){for(var Me=t.select(this),Te=0;Te0?ie:0}_.textPointStyle=function(ae,ee,ie){if(ae.size()){var Q;if(ee.selectedpoints){var ue=_.makeSelectedTextStyleFns(ee);Q=ue.selectedTextColorFn}var ge=ee.texttemplate,Me=ie._fullLayout;ae.each(function(Te){var je=t.select(this),Ve=ge?i.extractOption(Te,ee,"txt","texttemplate"):i.extractOption(Te,ee,"tx","text");if(!Ve&&Ve!==0){je.remove();return}if(ge){var Ke=ee._module.formatLabels,Je=Ke?Ke(Te,ee,Me):{},vt={};y(vt,ee,Te.i),Ve=i.texttemplateString({data:[vt,Te,ee._meta],fallback:ee.texttemplatefallback,labels:Je,locale:Me._d3locale,template:Ve})}var xt=Te.tp||ee.textposition,Pt=P(Te,ee),mt=Q?Q(Te):Te.tc||ee.textfont.color;je.call(_.font,{family:Te.tf||ee.textfont.family,weight:Te.tw||ee.textfont.weight,style:Te.ty||ee.textfont.style,variant:Te.tv||ee.textfont.variant,textcase:Te.tC||ee.textfont.textcase,lineposition:Te.tE||ee.textfont.lineposition,shadow:Te.tS||ee.textfont.shadow,size:Pt,color:mt}).text(Ve).call(c.convertToTspans,ie).call(R,xt,Pt,Te.mrc)})}},_.selectedTextStyle=function(ae,ee){if(!(!ae.size()||!ee.selectedpoints)){var ie=_.makeSelectedTextStyleFns(ee);ae.each(function(Q){var ue=t.select(this),ge=ie.selectedTextColorFn(Q),Me=Q.tp||ee.textposition,Te=P(Q,ee);l.fill(ue,ge);var je=s.traceIs(ee,"bar-like");R(ue,Me,Te,Q.mrc2||Q.mrc,je)})}};var z=.5;_.smoothopen=function(ae,ee){if(ae.length<3)return"M"+ae.join("L");var ie="M"+ae[0],Q=[],ue;for(ue=1;ue=je||me>=Ke&&me<=je)&&(_e<=Je&&_e>=Ve||_e>=Je&&_e<=Ve)&&(ae=[me,_e])}return ae}_.applyBackoff=J,_.makeTester=function(){var ae=i.ensureSingleById(t.select("body"),"svg","js-plotly-tester",function(ie){ie.attr(f.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),ee=i.ensureSingle(ae,"path","js-reference-point",function(ie){ie.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});_.tester=ae,_.testref=ee},_.savedBBoxes={};var N=0,H=1e4;_.bBox=function(ae,ee,ie){ie||(ie=$(ae));var Q;if(ie){if(Q=_.savedBBoxes[ie],Q)return i.extendFlat({},Q)}else if(ae.childNodes.length===1){var ue=ae.childNodes[0];if(ie=$(ue),ie){var ge=+ue.getAttribute("x")||0,Me=+ue.getAttribute("y")||0,Te=ue.getAttribute("transform");if(!Te){var je=_.bBox(ue,!1,ie);return ge&&(je.left+=ge,je.right+=ge),Me&&(je.top+=Me,je.bottom+=Me),je}if(ie+="~"+ge+"~"+Me+"~"+Te,Q=_.savedBBoxes[ie],Q)return i.extendFlat({},Q)}}var Ve,Ke;ee?Ve=ae:(Ke=_.tester.node(),Ve=ae.cloneNode(!0),Ke.appendChild(Ve)),t.select(Ve).attr("transform",null).call(c.positionText,0,0);var Je=Ve.getBoundingClientRect(),vt=_.testref.node().getBoundingClientRect();ee||Ke.removeChild(Ve);var xt={height:Je.height,width:Je.width,left:Je.left-vt.left,top:Je.top-vt.top,right:Je.right-vt.left,bottom:Je.bottom-vt.top};return N>=H&&(_.savedBBoxes={},N=0),ie&&(_.savedBBoxes[ie]=xt),N++,i.extendFlat({},xt)};function $(ae){var ee=ae.getAttribute("data-unformatted");if(ee!==null)return ee+ae.getAttribute("data-math")+ae.getAttribute("text-anchor")+ae.getAttribute("style")}_.setClipUrl=function(ae,ee,ie){ae.attr("clip-path",U(ee,ie))};function U(ae,ee){if(!ae)return null;var ie=ee._context,Q=ie._exportedPlot?"":ie._baseUrl||"";return Q?"url('"+Q+"#"+ae+"')":"url(#"+ae+")"}_.getTranslate=function(ae){var ee=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,ie=ae.attr?"attr":"getAttribute",Q=ae[ie]("transform")||"",ue=Q.replace(ee,function(ge,Me,Te){return[Me,Te].join(" ")}).split(" ");return{x:+ue[0]||0,y:+ue[1]||0}},_.setTranslate=function(ae,ee,ie){var Q=/(\btranslate\(.*?\);?)/,ue=ae.attr?"attr":"getAttribute",ge=ae.attr?"attr":"setAttribute",Me=ae[ue]("transform")||"";return ee=ee||0,ie=ie||0,Me=Me.replace(Q,"").trim(),Me+=u(ee,ie),Me=Me.trim(),ae[ge]("transform",Me),Me},_.getScale=function(ae){var ee=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,ie=ae.attr?"attr":"getAttribute",Q=ae[ie]("transform")||"",ue=Q.replace(ee,function(ge,Me,Te){return[Me,Te].join(" ")}).split(" ");return{x:+ue[0]||1,y:+ue[1]||1}},_.setScale=function(ae,ee,ie){var Q=/(\bscale\(.*?\);?)/,ue=ae.attr?"attr":"getAttribute",ge=ae.attr?"attr":"setAttribute",Me=ae[ue]("transform")||"";return ee=ee||1,ie=ie||1,Me=Me.replace(Q,"").trim(),Me+="scale("+ee+","+ie+")",Me=Me.trim(),ae[ge]("transform",Me),Me};var V=/\s*sc.*/;_.setPointGroupScale=function(ae,ee,ie){if(ee=ee||1,ie=ie||1,!!ae){var Q=ee===1&&ie===1?"":"scale("+ee+","+ie+")";ae.each(function(){var ue=(this.getAttribute("transform")||"").replace(V,"");ue+=Q,ue=ue.trim(),this.setAttribute("transform",ue)})}};var j=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(ae,ee,ie){ae&&ae.each(function(){var Q,ue=t.select(this),ge=ue.select("text");if(ge.node()){var Me=parseFloat(ge.attr("x")||0),Te=parseFloat(ge.attr("y")||0),je=(ue.attr("transform")||"").match(j);ee===1&&ie===1?Q=[]:Q=[u(Me,Te),"scale("+ee+","+ie+")",u(-Me,-Te)],je&&Q.push(je),ue.attr("transform",Q.join(""))}})};function q(ae,ee){var ie;return ae&&(ie=ae.mf),ie===void 0&&(ie=ee.marker&&ee.marker.standoff||0),!ee._geo&&!ee._xA?-ie:ie}_.getMarkerStandoff=q;var Y=Math.atan2,K=Math.cos,te=Math.sin;function ne(ae,ee){var ie=ee[0],Q=ee[1];return[ie*K(ae)-Q*te(ae),ie*te(ae)+Q*K(ae)]}var se,le,ce,pe,xe,ye;function fe(ae,ee){var ie=ae.ma;ie===void 0&&(ie=ee.marker.angle,(!o(ie)||i.isArrayOrTypedArray(ie))&&(ie=0));var Q,ue,ge=ee.marker.angleref;if(ge==="previous"||ge==="north"){if(ee._geo){var Me=ee._geo.project(ae.lonlat);Q=Me[0],ue=Me[1]}else{var Te=ee._xA,je=ee._yA;if(Te&&je)Q=Te.c2p(ae.x),ue=je.c2p(ae.y);else return 90}if(ee._geo){var Ve=ae.lonlat[0],Ke=ae.lonlat[1],Je=ee._geo.project([Ve,Ke+1e-5]),vt=ee._geo.project([Ve+1e-5,Ke]),xt=Y(vt[1]-ue,vt[0]-Q),Pt=Y(Je[1]-ue,Je[0]-Q),mt;if(ge==="north")mt=ie/180*Math.PI;else if(ge==="previous"){var Mt=Ve/180*Math.PI,lt=Ke/180*Math.PI,qe=se/180*Math.PI,Ye=le/180*Math.PI,me=qe-Mt,_e=K(Ye)*te(me),Ae=te(Ye)*K(lt)-K(Ye)*te(lt)*K(me);mt=-Y(_e,Ae)-Math.PI,se=Ve,le=Ke}var ke=ne(xt,[K(mt),0]),Ee=ne(Pt,[te(mt),0]);ie=Y(ke[1]+Ee[1],ke[0]+Ee[0])/Math.PI*180,ge==="previous"&&!(ye===ee.uid&&ae.i===xe+1)&&(ie=null)}if(ge==="previous"&&!ee._geo)if(ye===ee.uid&&ae.i===xe+1&&o(Q)&&o(ue)){var De=Q-ce,Qe=ue-pe,Ue=ee.line&&ee.line.shape||"",at=Ue.slice(Ue.length-1);at==="h"&&(Qe=0),at==="v"&&(De=0),ie+=Y(Qe,De)/Math.PI*180+90}else ie=null}return ce=Q,pe=ue,xe=ae.i,ye=ee.uid,ie}_.getMarkerAngle=fe}}),bv=de({"src/components/titles/index.js"(e,r){"use strict";var t=Yr(),i=da(),a=ks(),o=Sa(),s=Qt(),l=s.strTranslate,n=hn(),u=ta(),c=Zo(),f=Mp(),h=Bl().OPPOSITE_SIDE,d=/ [XY][0-9]* /,p=1.6,g=1.6;function m(y,_,v){var x=y._fullLayout,S=v.propContainer,M=v.propName,C=v.placeholder,w=v.traceIndex,k=v.avoid||{},A=v.attributes,b=v.transform,E=v.containerGroup,T=1,F=S.title,D=(F&&F.text?F.text:"").trim(),R=!1,P=F&&F.font?F.font:{},z=P.family,I=P.size,L=P.color,B=P.weight,O=P.style,G=P.variant,W=P.textcase,X=P.lineposition,Z=P.shadow,J=v.subtitlePropName,N=!!J,H=v.subtitlePlaceholder,$=(S.title||{}).subtitle||{text:"",font:{}},U=($.text||"").trim(),V=!1,j=1,q=$.font,Y=q.family,K=q.size,te=q.color,ne=q.weight,se=q.style,le=q.variant,ce=q.textcase,pe=q.lineposition,xe=q.shadow,ye;M==="title.text"?ye="titleText":M.indexOf("axis")!==-1?ye="axisTitleText":M.indexOf("colorbar")!==-1&&(ye="colorbarTitleText");var fe=y._context.edits[ye];function ae(xt,Pt){return xt===void 0||Pt===void 0?!1:xt.replace(d," % ")===Pt.replace(d," % ")}D===""?T=0:ae(D,C)&&(fe||(D=""),T=.2,R=!0),N&&(U===""?j=0:ae(U,H)&&(fe||(U=""),j=.2,V=!0)),v._meta?D=s.templateString(D,v._meta):x._meta&&(D=s.templateString(D,x._meta));var ee=D||U||fe,ie;E||(E=s.ensureSingle(x._infolayer,"g","g-"+_),ie=x._hColorbarMoveTitle);var Q=E.selectAll("text."+_).data(ee?[0]:[]);Q.enter().append("text"),Q.text(D).attr("class",_),Q.exit().remove();var ue=null,ge=_+"-subtitle",Me=U||fe;if(N&&(ue=E.selectAll("text."+ge).data(Me?[0]:[]),ue.enter().append("text"),ue.text(U).attr("class",ge),ue.exit().remove()),!ee)return E;function Te(xt,Pt){s.syncOrAsync([je,Ve],{title:xt,subtitle:Pt})}function je(xt){var Pt=xt.title,mt=xt.subtitle,Mt;!b&&ie&&(b={}),b?(Mt="",b.rotate&&(Mt+="rotate("+[b.rotate,A.x,A.y]+")"),(b.offset||ie)&&(Mt+=l(0,(b.offset||0)-(ie||0)))):Mt=null,Pt.attr("transform",Mt);function lt(ke){if(ke){var Ee=t.select(ke.node().parentNode).select("."+ge);if(!Ee.empty()){var De=ke.node().getBBox();if(De.height){var Qe=De.y+De.height+p*K;Ee.attr("y",Qe)}}}}if(Pt.style("opacity",T*u.opacity(L)).call(n.font,{color:u.rgb(L),size:t.round(I,2),family:z,weight:B,style:O,variant:G,textcase:W,shadow:Z,lineposition:X}).attr(A).call(c.convertToTspans,y,lt),mt&&!mt.empty()){var qe=E.select("."+_+"-math-group"),Ye=Pt.node().getBBox(),me=qe.node()?qe.node().getBBox():void 0,_e=me?me.y+me.height+p*K:Ye.y+Ye.height+g*K,Ae=s.extendFlat({},A,{y:_e});mt.attr("transform",Mt),mt.style("opacity",j*u.opacity(te)).call(n.font,{color:u.rgb(te),size:t.round(K,2),family:Y,weight:ne,style:se,variant:le,textcase:ce,shadow:xe,lineposition:pe}).attr(Ae).call(c.convertToTspans,y)}return a.previousPromises(y)}function Ve(xt){var Pt=xt.title,mt=t.select(Pt.node().parentNode);if(k&&k.selection&&k.side&&D){mt.attr("transform",null);var Mt=h[k.side],lt=k.side==="left"||k.side==="top"?-1:1,qe=i(k.pad)?k.pad:2,Ye=n.bBox(mt.node()),me={t:0,b:0,l:0,r:0},_e=y._fullLayout._reservedMargin;for(var Ae in _e)for(var ke in _e[Ae]){var Ee=_e[Ae][ke];me[ke]=Math.max(me[ke],Ee)}var De={left:me.l,top:me.t,right:x.width-me.r,bottom:x.height-me.b},Qe=k.maxShift||lt*(De[k.side]-Ye[k.side]),Ue=0;if(Qe<0)Ue=Qe;else{var at=k.offsetLeft||0,rt=k.offsetTop||0;Ye.left-=at,Ye.right-=at,Ye.top-=rt,Ye.bottom-=rt,k.selection.each(function(){var At=n.bBox(this);s.bBoxIntersect(Ye,At,qe)&&(Ue=Math.max(Ue,lt*(At[k.side]-Ye[Mt])+qe))}),Ue=Math.min(Qe,Ue),S._titleScoot=Math.abs(Ue)}if(Ue>0||Qe<0){var ht={left:[-Ue,0],right:[Ue,0],top:[0,-Ue],bottom:[0,Ue]}[k.side];mt.attr("transform",l(ht[0],ht[1]))}}}Q.call(Te,ue);function Ke(xt,Pt){xt.text(Pt).on("mouseover.opacity",function(){t.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){t.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}if(fe&&(D?Q.on(".opacity",null):(Ke(Q,C),R=!0),Q.call(c.makeEditable,{gd:y}).on("edit",function(xt){w!==void 0?o.call("_guiRestyle",y,M,xt,w):o.call("_guiRelayout",y,M,xt)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Te)}).on("input",function(xt){this.text(xt||" ").call(c.positionText,A.x,A.y)}),N)){if(N&&!D){var Je=Q.node().getBBox(),vt=Je.y+Je.height+g*K;ue.attr("y",vt)}U?ue.on(".opacity",null):(Ke(ue,H),V=!0),ue.call(c.makeEditable,{gd:y}).on("edit",function(xt){o.call("_guiRelayout",y,"title.subtitle.text",xt)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Te)}).on("input",function(xt){this.text(xt||" ").call(c.positionText,ue.attr("x"),ue.attr("y"))})}return Q.classed("js-placeholder",R),ue&&!ue.empty()&&ue.classed("js-placeholder",V),E}r.exports={draw:m,SUBTITLE_PADDING_EM:g,SUBTITLE_PADDING_MATHJAX_EM:p}}}),Xd=de({"src/plots/cartesian/set_convert.js"(e,r){"use strict";var t=Yr(),i=eo().utcFormat,a=Qt(),o=a.numberFormat,s=da(),l=a.cleanNumber,n=a.ms2DateTime,u=a.dateTime2ms,c=a.ensureNumber,f=a.isArrayOrTypedArray,h=cn(),d=h.FP_SAFE,p=h.BADNUM,g=h.LOG_CLIP,m=h.ONEWEEK,y=h.ONEDAY,_=h.ONEHOUR,v=h.ONEMIN,x=h.ONESEC,S=Hs(),M=zl(),C=M.HOUR_PATTERN,w=M.WEEKDAY_PATTERN;function k(b){return Math.pow(10,b)}function A(b){return b!=null}r.exports=function(E,T){T=T||{};var F=E._id||"x",D=F.charAt(0);function R(U,V){if(U>0)return Math.log(U)/Math.LN10;if(U<=0&&V&&E.range&&E.range.length===2){var j=E.range[0],q=E.range[1];return .5*(j+q-2*g*Math.abs(j-q))}else return p}function P(U,V,j,q){if((q||{}).msUTC&&s(U))return+U;var Y=u(U,j||E.calendar);if(Y===p)if(s(U)){U=+U;var K=Math.floor(a.mod(U+.05,1)*10),te=Math.round(U-K/10);Y=u(new Date(te))+K/10}else return p;return Y}function z(U,V,j){return n(U,V,j||E.calendar)}function I(U){return E._categories[Math.round(U)]}function L(U){if(A(U)){if(E._categoriesMap===void 0&&(E._categoriesMap={}),E._categoriesMap[U]!==void 0)return E._categoriesMap[U];E._categories.push(typeof U=="number"?String(U):U);var V=E._categories.length-1;return E._categoriesMap[U]=V,V}return p}function B(U,V){for(var j=new Array(V),q=0;qE.range[1]&&(j=!j);for(var q=j?-1:1,Y=q*U,K=0,te=0;tese)K=te+1;else{K=Y<(ne+se)/2?te:te+1;break}}var le=E._B[K]||0;return isFinite(le)?X(U,E._m2,le):0},N=function(U){var V=E._rangebreaks.length;if(!V)return Z(U,E._m,E._b);for(var j=0,q=0;qE._rangebreaks[q].pmax&&(j=q+1);return Z(U,E._m2,E._B[j])}}E.c2l=E.type==="log"?R:c,E.l2c=E.type==="log"?k:c,E.l2p=J,E.p2l=N,E.c2p=E.type==="log"?function(U,V){return J(R(U,V))}:J,E.p2c=E.type==="log"?function(U){return k(N(U))}:N,["linear","-"].indexOf(E.type)!==-1?(E.d2r=E.r2d=E.d2c=E.r2c=E.d2l=E.r2l=l,E.c2d=E.c2r=E.l2d=E.l2r=c,E.d2p=E.r2p=function(U){return E.l2p(l(U))},E.p2d=E.p2r=N,E.cleanPos=c):E.type==="log"?(E.d2r=E.d2l=function(U,V){return R(l(U),V)},E.r2d=E.r2c=function(U){return k(l(U))},E.d2c=E.r2l=l,E.c2d=E.l2r=c,E.c2r=R,E.l2d=k,E.d2p=function(U,V){return E.l2p(E.d2r(U,V))},E.p2d=function(U){return k(N(U))},E.r2p=function(U){return E.l2p(l(U))},E.p2r=N,E.cleanPos=c):E.type==="date"?(E.d2r=E.r2d=a.identity,E.d2c=E.r2c=E.d2l=E.r2l=P,E.c2d=E.c2r=E.l2d=E.l2r=z,E.d2p=E.r2p=function(U,V,j){return E.l2p(P(U,0,j))},E.p2d=E.p2r=function(U,V,j){return z(N(U),V,j)},E.cleanPos=function(U){return a.cleanDate(U,p,E.calendar)}):E.type==="category"?(E.d2c=E.d2l=L,E.r2d=E.c2d=E.l2d=I,E.d2r=E.d2l_noadd=G,E.r2c=function(U){var V=W(U);return V!==void 0?V:E.fraction2r(.5)},E.l2r=E.c2r=c,E.r2l=W,E.d2p=function(U){return E.l2p(E.r2c(U))},E.p2d=function(U){return I(N(U))},E.r2p=E.d2p,E.p2r=N,E.cleanPos=function(U){return typeof U=="string"&&U!==""?U:c(U)}):E.type==="multicategory"&&(E.r2d=E.c2d=E.l2d=I,E.d2r=E.d2l_noadd=G,E.r2c=function(U){var V=G(U);return V!==void 0?V:E.fraction2r(.5)},E.r2c_just_indices=O,E.l2r=E.c2r=c,E.r2l=G,E.d2p=function(U){return E.l2p(E.r2c(U))},E.p2d=function(U){return I(N(U))},E.r2p=E.d2p,E.p2r=N,E.cleanPos=function(U){return Array.isArray(U)||typeof U=="string"&&U!==""?U:c(U)},E.setupMultiCategory=function(U){var V=E._traceIndices,j,q,Y=E._matchGroup;if(Y&&E._categories.length===0){for(var K in Y)if(K!==F){var te=T[S.id2name(K)];V=V.concat(te._traceIndices)}}var ne=[[0,{}],[0,{}]],se=[];for(j=0;jte[1]&&(q[K?0:1]=j,Y[1]=te[1]),Y[0]>=Y[1])if(V!==void 0){var ne=te[0]+1;j!==void 0&&(ne=Math.min(ne,te[1])),q[K?0:1]=E.l2r(ne)}else j!==void 0&&(q[K?1:0]=E.l2r(te[1]-1))}},E.cleanRange=function(U,V){E._cleanRange(U,V),E.limitRange(U)},E._cleanRange=function(U,V){V||(V={}),U||(U="range");var j=a.nestedProperty(E,U).get(),q,Y;if(E.type==="date"?Y=a.dfltRange(E.calendar):D==="y"?Y=M.DFLTRANGEY:E._name==="realaxis"?Y=[0,1]:Y=V.dfltRange||M.DFLTRANGEX,Y=Y.slice(),(E.rangemode==="tozero"||E.rangemode==="nonnegative")&&(Y[0]=0),!j||j.length!==2){a.nestedProperty(E,U).set(Y);return}var K=j[0]===null,te=j[1]===null;for(E.type==="date"&&!E.autorange&&(j[0]=a.cleanDate(j[0],p,E.calendar),j[1]=a.cleanDate(j[1],p,E.calendar)),q=0;q<2;q++)if(E.type==="date"){if(!a.isDateTime(j[q],E.calendar)){E[U]=Y;break}if(E.r2l(j[0])===E.r2l(j[1])){var ne=a.constrain(E.r2l(j[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);j[0]=E.l2r(ne-1e3),j[1]=E.l2r(ne+1e3);break}}else{if(!s(j[q]))if(!(K||te)&&s(j[1-q]))j[q]=j[1-q]*(q?10:.1);else{E[U]=Y;break}if(j[q]<-d?j[q]=-d:j[q]>d&&(j[q]=d),j[0]===j[1]){var se=Math.max(1,Math.abs(j[0]*1e-6));j[0]-=se,j[1]+=se}}},E.setScale=function(U){var V=T._size;if(E.overlaying){var j=S.getFromId({_fullLayout:T},E.overlaying);E.domain=j.domain}var q=U&&E._r?"_r":"range",Y=E.calendar;E.cleanRange(q);var K=E.r2l(E[q][0],Y),te=E.r2l(E[q][1],Y),ne=D==="y";if(ne?(E._offset=V.t+(1-E.domain[1])*V.h,E._length=V.h*(E.domain[1]-E.domain[0]),E._m=E._length/(K-te),E._b=-E._m*te):(E._offset=V.l+E.domain[0]*V.w,E._length=V.w*(E.domain[1]-E.domain[0]),E._m=E._length/(te-K),E._b=-E._m*K),E._rangebreaks=[],E._lBreaks=0,E._m2=0,E._B=[],E.rangebreaks){var se,le;if(E._rangebreaks=E.locateBreaks(Math.min(K,te),Math.max(K,te)),E._rangebreaks.length){for(se=0;sete&&(ce=!ce),ce&&E._rangebreaks.reverse();var pe=ce?-1:1;for(E._m2=pe*E._length/(Math.abs(te-K)-E._lBreaks),E._B.push(-E._m2*(ne?te:K)),se=0;seY&&(Y+=7,KY&&(Y+=24,K=q&&K=q&&U=Te.min&&(QTe.max&&(Te.max=ue),ge=!1)}ge&&te.push({min:Q,max:ue})}};for(j=0;jx*2}function h(g){return Math.max(1,(g-1)/1e3)}function d(g,m){for(var y=g.length,_=h(y),v=0,x=0,S={},M=0;Mv*2}function p(g){return o(g[0])&&o(g[1])}}}),md=de({"src/plots/cartesian/autorange.js"(e,r){"use strict";var t=Yr(),i=da(),a=Qt(),o=cn().FP_SAFE,s=Sa(),l=hn(),n=Hs(),u=n.getFromId,c=n.isLinked;r.exports={applyAutorangeOptions:E,getAutoRange:f,makePadFn:d,doAutoRange:y,findExtremes:_,concatExtremes:m};function f(T,F){var D,R,P=[],z=T._fullLayout,I=d(z,F,0),L=d(z,F,1),B=m(T,F),O=B.min,G=B.max;if(O.length===0||G.length===0)return a.simpleMap(F.range,F.r2l);var W=O[0].val,X=G[0].val;for(D=1;D0&&(se=V-I(Y)-L(K),se>j?le/se>q&&(te=Y,ne=K,q=le/se):le/V>q&&(te={val:Y.val,nopad:1},ne={val:K.val,nopad:1},q=le/V));function ce(ae,ee){return Math.max(ae,L(ee))}if(W===X){var pe=W-1,xe=W+1;if($)if(W===0)P=[0,1];else{var ye=(W>0?G:O).reduce(ce,0),fe=W/(1-Math.min(.5,ye/V));P=W>0?[0,fe]:[fe,0]}else U?P=[Math.max(0,pe),Math.max(1,xe)]:P=[pe,xe]}else $?(te.val>=0&&(te={val:0,nopad:1}),ne.val<=0&&(ne={val:0,nopad:1})):U&&(te.val-q*I(te)<0&&(te={val:0,nopad:1}),ne.val<=0&&(ne={val:1,nopad:1})),q=(ne.val-te.val-h(F,Y.val,K.val))/(V-I(te)-L(ne)),P=[te.val-q*I(te),ne.val+q*L(ne)];return P=E(P,F),F.limitRange&&F.limitRange(),J&&P.reverse(),a.simpleMap(P,F.l2r||Number)}function h(T,F,D){var R=0;if(T.rangebreaks)for(var P=T.locateBreaks(F,D),z=0;z0?D.ppadplus:D.ppadminus)||D.ppad||0),Y=j((T._m>0?D.ppadminus:D.ppadplus)||D.ppad||0),K=j(D.vpadplus||D.vpad),te=j(D.vpadminus||D.vpad);if(!O){if(U=1/0,V=-1/0,B)for(W=0;W0&&(U=X),X>V&&X-o&&(U=X),X>V&&X=le;W--)se(W);return{min:R,max:P,opts:D}}function v(T,F,D,R){S(T,F,D,R,C)}function x(T,F,D,R){S(T,F,D,R,w)}function S(T,F,D,R,P){for(var z=R.tozero,I=R.extrapad,L=!0,B=0;B=D&&(O.extrapad||!I)){L=!1;break}else P(F,O.val)&&O.pad<=D&&(I||!O.extrapad)&&(T.splice(B,1),B--)}if(L){var G=z&&F===0;T.push({val:F,pad:G?0:D,extrapad:G?!1:I})}}function M(T){return i(T)&&Math.abs(T)=F}function k(T,F){var D=F.autorangeoptions;return D&&D.minallowed!==void 0&&b(F,D.minallowed,D.maxallowed)?D.minallowed:D&&D.clipmin!==void 0&&b(F,D.clipmin,D.clipmax)?Math.max(T,F.d2l(D.clipmin)):T}function A(T,F){var D=F.autorangeoptions;return D&&D.maxallowed!==void 0&&b(F,D.minallowed,D.maxallowed)?D.maxallowed:D&&D.clipmax!==void 0&&b(F,D.clipmin,D.clipmax)?Math.min(T,F.d2l(D.clipmax)):T}function b(T,F,D){return F!==void 0&&D!==void 0?(F=T.d2l(F),D=T.d2l(D),F=B&&(z=B,D=B),I<=B&&(I=B,R=B)}}return D=k(D,F),R=A(R,F),[D,R]}}}),nn=de({"src/plots/cartesian/axes.js"(e,r){"use strict";var t=Yr(),i=da(),a=ks(),o=Sa(),s=Qt(),l=s.strTranslate,n=Zo(),u=bv(),c=ta(),f=hn(),h=Mu(),d=EE(),p=zl(),g=cn(),m=g.ONEMAXYEAR,y=g.ONEAVGYEAR,_=g.ONEMINYEAR,v=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,S=g.ONEMINQUARTER,M=g.ONEMAXMONTH,C=g.ONEAVGMONTH,w=g.ONEMINMONTH,k=g.ONEWEEK,A=g.ONEDAY,b=A/2,E=g.ONEHOUR,T=g.ONEMIN,F=g.ONESEC,D=g.ONEMILLI,R=g.ONEMICROSEC,P=g.MINUS_SIGN,z=g.BADNUM,I={K:"zeroline"},L={K:"gridline",L:"path"},B={K:"minor-gridline",L:"path"},O={K:"tick",L:"path"},G={K:"tick",L:"text"},W={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},X=Bl(),Z=X.MID_SHIFT,J=X.CAP_SHIFT,N=X.LINE_SPACING,H=X.OPPOSITE_SIDE,$=3,U=r.exports={};U.setConvert=Xd();var V=d1(),j=Hs(),q=j.idSort,Y=j.isLinked;U.id2name=j.id2name,U.name2id=j.name2id,U.cleanId=j.cleanId,U.list=j.list,U.listIds=j.listIds,U.getFromId=j.getFromId,U.getFromTrace=j.getFromTrace;var K=md();U.getAutoRange=K.getAutoRange,U.findExtremes=K.findExtremes;var te=1e-4;function ne(Be){var Fe=(Be[1]-Be[0])*te;return[Be[0]-Fe,Be[1]+Fe]}function se(Be,Fe,Et){if(![Et,Be,Fe].every(i)||Et===0)return Be;let St=Math.round((Be-Fe)/Et),zt=Fe+St*Et;return Be!==zt&&Math.abs(Be-zt)It+" domain")),tt=tt.concat(Wt||[]),wt.length>Yt?(s.warn("Array attribute "+ft+" has more entries than expected, truncating to "+Yt),wt=wt.slice(0,Yt)):wt.length2e-6||((Et-Be._forceTick0)/Be._minDtick%1+1.000001)%1>2e-6)&&(Be._minDtick=0))},U.saveRangeInitial=function(Be,Fe){for(var Et=U.list(Be,"",!0),St=!1,zt=0;ztjt*.3||ft(St)||ft(zt))){var It=Et.dtick/2;Be+=Be+ItYt){var ze=Number(Et.slice(1));Wt.exactYears>Yt&&ze%12===0?Be=U.tickIncrement(Be,"M6","reverse")+A*1.5:Wt.exactMonths>Yt?Be=U.tickIncrement(Be,"M1","reverse")+A*15.5:Be-=b;var tt=U.tickIncrement(Be,Et);if(tt<=St)return tt}return Be}U.prepMinorTicks=function(Be,Fe,Et){var St,zt;if(!((St=Fe.minor)!=null&&St.dtick)){delete Be.dtick;var Wt=Fe.dtick&&i(Fe._tmin),Yt;if(Wt){var ze=U.tickIncrement(Fe._tmin,Fe.dtick,!0);Yt=[Fe._tmin,ze*.99+Fe._tmin*.01]}else{var tt=s.simpleMap(Fe.range,Fe.r2l);Yt=[tt[0],.8*tt[0]+.2*tt[1]]}if(Be.range=s.simpleMap(Yt,Fe.l2r),Be._isMinor=!0,U.prepTicks(Be,Et),Wt){var ft=i(Fe.dtick),wt=i(Be.dtick),jt=ft?Fe.dtick:+Fe.dtick.substring(1),It=wt?Be.dtick:+Be.dtick.substring(1);ft&&wt?fe(jt,It)?jt===2*k&&It===2*A&&(Be.dtick=k):jt===2*k&&It===3*A?Be.dtick=k:jt===k&&!(Fe._input.minor||{}).nticks?Be.dtick=A:ae(jt/It,2.5)?Be.dtick=jt/2:Be.dtick=jt:String(Fe.dtick).charAt(0)==="M"?wt?Be.dtick="M1":fe(jt,It)?jt>=12&&It===2&&(Be.dtick="M3"):Be.dtick=Fe.dtick:String(Be.dtick).charAt(0)==="L"?String(Fe.dtick).charAt(0)==="L"?fe(jt,It)||(Be.dtick=ae(jt/It,2.5)?Fe.dtick/2:Fe.dtick):Be.dtick="D1":Be.dtick==="D2"&&+Fe.dtick>1&&(Be.dtick=1)}Be.range=Fe.range}((zt=Fe.minor)==null?void 0:zt._tick0Init)===void 0&&(Be.tick0=Fe.tick0)};function fe(Be,Fe){return Math.abs((Be/Fe+.5)%1-.5)<.001}function ae(Be,Fe){return Math.abs(Be/Fe-1)<.001}U.prepTicks=function(Be,Fe){var Et=s.simpleMap(Be.range,Be.r2l,void 0,void 0,Fe);if(Be.tickmode==="auto"||!Be.dtick){var St=Be.nticks,zt;St||(Be.type==="category"||Be.type==="multicategory"?(zt=Be.tickfont?s.bigFont(Be.tickfont.size||12):15,St=Be._length/zt):(zt=Be._id.charAt(0)==="y"?40:80,St=s.constrain(Be._length/zt,4,9)+1),Be._name==="radialaxis"&&(St*=2)),Be.minor&&Be.minor.tickmode!=="array"||Be.tickmode==="array"&&(St*=100),Be._roughDTick=Math.abs(Et[1]-Et[0])/St,U.autoTicks(Be,Be._roughDTick),Be._minDtick>0&&Be.dtick0?(Wt=St-1,Yt=St):(Wt=St,Yt=St);var ze=Be[Wt].value,tt=Be[Yt].value,ft=Math.abs(tt-ze),wt=Et||ft,jt=0;wt>=_?ft>=_&&ft<=m?jt=ft:jt=y:Et===x&&wt>=S?ft>=S&&ft<=v?jt=ft:jt=x:wt>=w?ft>=w&&ft<=M?jt=ft:jt=C:Et===k&&wt>=k?jt=k:wt>=A?jt=A:Et===b&&wt>=b?jt=b:Et===E&&wt>=E&&(jt=E);var It;jt>=ft&&(jt=ft,It=!0);var Kt=zt+jt;if(Fe.rangebreaks&&jt>0){for(var qt=84,vr=0,Br=0;Brk&&(jt=ft)}(jt>0||St===0)&&(Be[St].periodX=zt+jt/2)}}U.calcTicks=function(Fe,Et){for(var St=Fe.type,zt=Fe.calendar,Wt=Fe.ticklabelstep,Yt=Fe.ticklabelmode==="period",ze=Fe.range[0]>Fe.range[1],tt=!Fe.ticklabelindex||s.isArrayOrTypedArray(Fe.ticklabelindex)?Fe.ticklabelindex:[Fe.ticklabelindex],ft=s.simpleMap(Fe.range,Fe.r2l,void 0,void 0,Et),wt=ft[1]=(ba?0:1);Hi--){var Za=!Hi;Hi?(Fe._dtickInit=Fe.dtick,Fe._tick0Init=Fe.tick0):ba&&(Fe.minor._dtickInit=Fe.minor.dtick,Fe.minor._tick0Init=Fe.minor.tick0);var oa=Hi?Fe:s.extendFlat({},Fe,ba?Fe.minor:{minor:{}});if(Za?U.prepMinorTicks(oa,Fe,Et):U.prepTicks(oa,Et),oa.tickmode==="array"){Hi?(Br=[],qt=Me(Fe,!Za)):(Pr=[],vr=Me(Fe,!Za));continue}if(oa.tickmode==="sync"){Br=[],qt=ge(Fe);continue}var Cn=ne(ft),_n=Cn[0],Li=Cn[1],In=i(oa.dtick),pn=St==="log"&&!(In||oa.dtick.charAt(0)==="L"),Ka=U.tickFirst(oa,Et);if(Hi){if(Fe._tmin=Ka,Ka<_n!==wt)break;(St==="category"||St==="multicategory")&&(Li=wt?Math.max(-.5,Li):Math.min(Fe._categories.length-.5,Li))}var Rn=null,tn=Ka,Mn;if(Hi){var Kn;In?Kn=Fe.dtick:St==="date"?typeof Fe.dtick=="string"&&Fe.dtick.charAt(0)==="M"&&(Kn=C*Fe.dtick.substring(1)):Kn=Fe._roughDTick,Mn=Math.round((Fe.r2l(tn)-Fe.r2l(Fe.tick0))/Kn)-1}var zn=oa.dtick,ua=St==="linear"?oa.r2l(oa.tick0):void 0;for(oa.rangebreaks&&oa._tick0Init!==oa.tick0&&(tn=xi(tn,Fe),wt||(tn=U.tickIncrement(tn,zn,!wt,zt))),(Hi||tt)&&Yt&&(tn=U.tickIncrement(tn,zn,!wt,zt),Hi&&Mn--);wt?tn>=Li:tn<=Li;tn=U.tickIncrement(tn,zn,wt,zt)){if(Hi&&Mn++,oa.rangebreaks&&!wt){if(tn<_n)continue;if(oa.maskBreaks(tn)===z&&xi(tn,oa)>=It)break}if(Br.length>Kt||tn===Rn)break;Rn=tn;var Ea={value:se(tn,ua,zn)};Hi?(tn===Ka&&(Ea.first=!0),pn&&tn!==(tn|0)&&(Ea.simpleLabel=!0),Wt>1&&Mn%Wt&&(Ea.skipLabel=!0),Br.push(Ea)):(Ea.minor=!0,Pr.push(Ea))}}if(!Pr||Pr.length<3)tt=!1;else{var ln=(Pr[2].value-Pr[1].value)*(ze?-1:1);Jr(ln,Fe.tickformat)||(tt=!1,Pr=Pr.slice(1))}if(!tt)Mi=Br;else{var on=Br.concat(Pr);Yt&&Br.length&&(on=on.slice(1)),on=on.sort(function(go,Xn){return go.value-Xn.value}).filter(function(go,Xn,On){return Xn===0||go.value!==On[Xn-1].value});var ao=on.map(function(go,Xn){return go.minor===void 0&&!go.skipLabel?Xn:null}).filter(function(go){return go!==null});ao.forEach(function(go){tt.map(function(Xn){var On=go+Xn;On>=0&&On-1;Bn--){if(Br[Bn].drop){Br.splice(Bn,1);continue}Br[Bn].value=xi(Br[Bn].value,Fe);var Mo=Fe.c2p(Br[Bn].value);(ps?no>Mo-xo:noIt||UoIt&&(On.periodX=It),Uozt&&qtzt&&Bry)Fe/=y,St=zt(10),Be.dtick="M"+12*Pt(Fe,St,Te);else if(Wt>C)Fe/=C,Be.dtick="M"+Pt(Fe,1,je);else if(Wt>A){if(Be.dtick=Pt(Fe,A,Be._hasDayOfWeekBreaks?[1,2,7,14]:Ke),!Et){var Yt=U.getTickFormat(Be),ze=Be.ticklabelmode==="period";ze&&(Be._rawTick0=Be.tick0),/%[uVW]/.test(Yt)?Be.tick0=s.dateTick0(Be.calendar,2):Be.tick0=s.dateTick0(Be.calendar,1),ze&&(Be._dowTick0=Be.tick0)}}else Wt>E?Be.dtick=Pt(Fe,E,je):Wt>T?Be.dtick=Pt(Fe,T,Ve):Wt>F?Be.dtick=Pt(Fe,F,Ve):(St=zt(10),Be.dtick=Pt(Fe,St,Te))}else if(Be.type==="log"){Be.tick0=0;var tt=s.simpleMap(Be.range,Be.r2l);if(Be._isMinor&&(Fe*=1.5),Fe>.7)Be.dtick=Math.ceil(Fe);else if(Math.abs(tt[1]-tt[0])<1){var ft=1.5*Math.abs((tt[1]-tt[0])/Fe);Fe=Math.abs(Math.pow(10,tt[1])-Math.pow(10,tt[0]))/ft,St=zt(10),Be.dtick="L"+Pt(Fe,St,Te)}else Be.dtick=Fe>.3?"D2":"D1"}else Be.type==="category"||Be.type==="multicategory"?(Be.tick0=0,Be.dtick=Math.ceil(Math.max(Fe,1))):pa(Be)?(Be.tick0=0,St=1,Be.dtick=Pt(Fe,St,xt)):(Be.tick0=0,St=zt(10),Be.dtick=Pt(Fe,St,Te));if(Be.dtick===0&&(Be.dtick=1),!i(Be.dtick)&&typeof Be.dtick!="string"){var wt=Be.dtick;throw Be.dtick=1,"ax.dtick error: "+String(wt)}};function mt(Be){var Fe=Be.dtick;if(Be._tickexponent=0,!i(Fe)&&typeof Fe!="string"&&(Fe=1),(Be.type==="category"||Be.type==="multicategory")&&(Be._tickround=null),Be.type==="date"){var Et=Be.r2l(Be.tick0),St=Be.l2r(Et).replace(/(^-|i)/g,""),zt=St.length;if(String(Fe).charAt(0)==="M")zt>10||St.slice(5)!=="01-01"?Be._tickround="d":Be._tickround=+Fe.slice(1)%12===0?"y":"m";else if(Fe>=A&&zt<=10||Fe>=A*15)Be._tickround="d";else if(Fe>=T&&zt<=16||Fe>=E)Be._tickround="M";else if(Fe>=F&&zt<=19||Fe>=T)Be._tickround="S";else{var Wt=Be.l2r(Et+Fe).replace(/^-/,"").length;Be._tickround=Math.max(zt,Wt)-20,Be._tickround<0&&(Be._tickround=4)}}else if(i(Fe)||Fe.charAt(0)==="L"){var Yt=Be.range.map(Be.r2d||Number);i(Fe)||(Fe=Number(Fe.slice(1))),Be._tickround=2-Math.floor(Math.log(Fe)/Math.LN10+.01);var ze=Math.max(Math.abs(Yt[0]),Math.abs(Yt[1])),tt=Math.floor(Math.log(ze)/Math.LN10+.01),ft=Be.minexponent===void 0?3:Be.minexponent;Math.abs(tt)>ft&&(Qe(Be.exponentformat)&&Be.exponentformat!=="SI extended"&&!Ue(tt)||Qe(Be.exponentformat)&&Be.exponentformat==="SI extended"&&!at(tt)?Be._tickexponent=3*Math.round((tt-1)/3):Be._tickexponent=tt)}else Be._tickround=null}U.tickIncrement=function(Be,Fe,Et,St){var zt=Et?-1:1;if(i(Fe))return s.increment(Be,zt*Fe);var Wt=Fe.charAt(0),Yt=zt*Number(Fe.slice(1));if(Wt==="M")return s.incrementMonth(Be,Yt,St);if(Wt==="L")return Math.log(Math.pow(10,Be)+Yt)/Math.LN10;if(Wt==="D"){var ze=Fe==="D2"?vt:Je,tt=Be+zt*.01,ft=s.roundUp(s.mod(tt,1),ze,Et);return Math.floor(tt)+Math.log(t.round(Math.pow(10,ft),1))/Math.LN10}throw"unrecognized dtick "+String(Fe)},U.tickFirst=function(Be,Fe){var Et=Be.r2l||Number,St=s.simpleMap(Be.range,Et,void 0,void 0,Fe),zt=St[1]=0&&ba<=Be._length?gi:null};if(tt&&s.isArrayOrTypedArray(Be.ticktext)){var qt=s.simpleMap(Be.range,Be.r2l),vr=(Math.abs(qt[1]-qt[0])-(Be._lBreaks||0))/1e4;for(It=0;It"+ze;else{var ft=bi(Be),wt=Be._trueSide||Be.side;(!ft&&wt==="top"||ft&&wt==="bottom")&&(Yt+="
")}Fe.text=Yt}function qe(Be,Fe,Et,St,zt){var Wt=Be.dtick,Yt=Fe.x,ze=Be.tickformat,tt=typeof Wt=="string"&&Wt.charAt(0);if(zt==="never"&&(zt=""),St&&tt!=="L"&&(Wt="L3",tt="L"),ze||tt==="L")Fe.text=ht(Math.pow(10,Yt),Be,zt,St);else if(i(Wt)||tt==="D"&&(Be.minorloglabels==="complete"||s.mod(Yt+.01,1)<.1)){var ft;Be.minorloglabels==="complete"&&!(s.mod(Yt+.01,1)<.1)&&(ft=!0,Fe.fontSize*=.75);var wt=Math.pow(10,Yt).toExponential(0),jt=wt.split("e"),It=+jt[1],Kt=Math.abs(It),qt=Be.exponentformat;qt==="power"||Qe(qt)&&qt!=="SI extended"&&Ue(It)||Qe(qt)&&qt==="SI extended"&&at(It)?(Fe.text=jt[0],Kt>0&&(Fe.text+="x10"),Fe.text==="1x10"&&(Fe.text="10"),It!==0&&It!==1&&(Fe.text+=""+(It>0?"":P)+Kt+""),Fe.fontSize*=1.25):(qt==="e"||qt==="E")&&Kt>2?Fe.text=jt[0]+qt+(It>0?"+":P)+Kt:(Fe.text=ht(Math.pow(10,Yt),Be,"","fakehover"),Wt==="D1"&&Be._id.charAt(0)==="y"&&(Fe.dy-=Fe.fontSize/6))}else if(tt==="D")Fe.text=Be.minorloglabels==="none"?"":String(Math.round(Math.pow(10,s.mod(Yt,1)))),Fe.fontSize*=.75;else throw"unrecognized dtick "+String(Wt);if(Be.dtick==="D1"){var vr=String(Fe.text).charAt(0);(vr==="0"||vr==="1")&&(Be._id.charAt(0)==="y"?Fe.dx-=Fe.fontSize/4:(Fe.dy+=Fe.fontSize/2,Fe.dx+=(Be.range[1]>Be.range[0]?1:-1)*Fe.fontSize*(Yt<0?.5:.25)))}}function Ye(Be,Fe){var Et=Be._categories[Math.round(Fe.x)];Et===void 0&&(Et=""),Fe.text=String(Et)}function me(Be,Fe,Et){var St=Math.round(Fe.x),zt=Be._categories[St]||[],Wt=zt[1]===void 0?"":String(zt[1]),Yt=zt[0]===void 0?"":String(zt[0]);Et?Fe.text=Yt+" - "+Wt:(Fe.text=Wt,Fe.text2=Yt)}function _e(Be,Fe,Et,St,zt){zt==="never"?zt="":Be.showexponent==="all"&&Math.abs(Fe.x/Be.dtick)<1e-6&&(zt="hide"),Fe.text=ht(Fe.x,Be,zt,St)}function Ae(Be,Fe,Et,St,zt){if(Be.thetaunit==="radians"&&!Et){var Wt=Fe.x/180;if(Wt===0)Fe.text="0";else{var Yt=ke(Wt);if(Yt[1]>=100)Fe.text=ht(s.deg2rad(Fe.x),Be,zt,St);else{var ze=Fe.x<0;Yt[1]===1?Yt[0]===1?Fe.text="\u03C0":Fe.text=Yt[0]+"\u03C0":Fe.text=["",Yt[0],"","\u2044","",Yt[1],"","\u03C0"].join(""),ze&&(Fe.text=P+Fe.text)}}}else Fe.text=ht(Fe.x,Be,zt,St)}function ke(Be){function Fe(ze,tt){return Math.abs(ze-tt)<=1e-6}function Et(ze,tt){return Fe(tt,0)?ze:Et(tt,ze%tt)}function St(ze){for(var tt=1;!Fe(Math.round(ze*tt)/tt,ze);)tt*=10;return tt}var zt=St(Be),Wt=Be*zt,Yt=Math.abs(Et(Wt,zt));return[Math.round(Wt/Yt),Math.round(zt/Yt)]}var Ee=["f","p","n","\u03BC","m","","k","M","G","T"],De=["q","r","y","z","a",...Ee,"P","E","Z","Y","R","Q"],Qe=Be=>["SI","SI extended","B"].includes(Be);function Ue(Be){return Be>14||Be<-15}function at(Be){return Be>32||Be<-30}function rt(Be,Fe){return Qe(Fe)?!!(Fe==="SI extended"&&at(Be)||Fe!=="SI extended"&&Ue(Be)):!1}function ht(Be,Fe,Et,St){var zt=Be<0,Wt=Fe._tickround,Yt=Et||Fe.exponentformat||"B",ze=Fe._tickexponent,tt=U.getTickFormat(Fe),ft=Fe.separatethousands;if(St){var wt={exponentformat:Yt,minexponent:Fe.minexponent,dtick:Fe.showexponent==="none"?Fe.dtick:i(Be)&&Math.abs(Be)||1,range:Fe.showexponent==="none"?Fe.range.map(Fe.r2d):[0,Be||1]};mt(wt),Wt=(Number(wt._tickround)||0)+4,ze=wt._tickexponent,Fe.hoverformat&&(tt=Fe.hoverformat)}if(tt)return Fe._numFormat(tt)(Be).replace(/-/g,P);Yt==="none"&&(ze=0),Be=Math.abs(Be);let jt=Math.pow(10,-Wt)/2;if(Be"+It+"":Yt==="B"&&ze===9?Be+="B":Qe(Yt)&&(Be+=Yt==="SI extended"?De[ze/3+10]:Ee[ze/3+5])}return zt?P+Be:Be}U.getTickFormat=function(Be){var Fe;function Et(tt){return typeof tt!="string"?tt:Number(tt.replace("M",""))*C}function St(tt,ft){var wt=["L","D"];if(typeof tt==typeof ft){if(typeof tt=="number")return tt-ft;var jt=wt.indexOf(tt.charAt(0)),It=wt.indexOf(ft.charAt(0));return jt===It?Number(tt.replace(/(L|D)/g,""))-Number(ft.replace(/(L|D)/g,"")):jt-It}else return typeof tt=="number"?1:-1}function zt(tt,ft,wt){var jt=wt||function(qt){return qt},It=ft[0],Kt=ft[1];return(!It&&typeof It!="number"||jt(It)<=jt(tt))&&(!Kt&&typeof Kt!="number"||jt(Kt)>=jt(tt))}function Wt(tt,ft){var wt=ft[0]===null,jt=ft[1]===null,It=St(tt,ft[0])>=0,Kt=St(tt,ft[1])<=0;return(wt||It)&&(jt||Kt)}var Yt,ze;if(Be.tickformatstops&&Be.tickformatstops.length>0)switch(Be.type){case"date":case"linear":{for(Fe=0;Fe=0&&zt.unshift(zt.splice(wt,1).shift())}});var ze={false:{left:0,right:0}};return s.syncOrAsync(zt.map(function(tt){return function(){if(tt){var ft=U.getFromId(Be,tt);Et||(Et={}),Et.axShifts=ze,Et.overlayingShiftedAx=Yt;var wt=U.drawOne(Be,ft,Et);return ft._shiftPusher&&dn(ft,ft._fullDepth||0,ze,!0),ft._r=ft.range.slice(),ft._rl=s.simpleMap(ft._r,ft.r2l),wt}}}))},U.drawOne=function(Be,Fe,Et){Et=Et||{};var St=Et.axShifts||{},zt=Et.overlayingShiftedAx||[],Wt,Yt,ze;Fe.setScale();var tt=Be._fullLayout,ft=Fe._id,wt=ft.charAt(0),jt=U.counterLetter(ft),It=tt._plots[Fe._mainSubplot],Kt=Fe.zerolinelayer==="above traces";if(!It)return;if(Fe._shiftPusher=Fe.autoshift||zt.indexOf(Fe._id)!==-1||zt.indexOf(Fe.overlaying)!==-1,Fe._shiftPusher&Fe.anchor==="free"){var qt=Fe.linewidth/2||0;Fe.ticks==="inside"&&(qt+=Fe.ticklen),dn(Fe,qt,St,!0),dn(Fe,Fe.shift||0,St,!1)}(Et.skipTitle!==!0||Fe._shift===void 0)&&(Fe._shift=pi(Fe,St));var vr=It[wt+"axislayer"],Br=Fe._mainLinePosition,Pr=Br+=Fe._shift,Mi=Fe._mainMirrorPosition,gi=Fe._vals=U.calcTicks(Fe),ba=[Fe.mirror,Pr,Mi].join("_");for(Wt=0;Wt0?Xn.bottom-vs:0,go))));var mu=0,Ul=0;if(Fe._shiftPusher&&(mu=Math.max(go,Xn.height>0?So==="l"?vs-Xn.left:Xn.right-vs:0),Fe.title.text!==tt._dfltTitle[wt]&&(Ul=(Fe._titleStandoff||0)+(Fe._titleScoot||0),So==="l"&&(Ul+=$t(Fe))),Fe._fullDepth=Math.max(mu,Ul)),Fe.automargin){On={x:0,y:0,r:0,l:0,t:0,b:0};var gu=[0,1],yu=typeof Fe._shift=="number"?Fe._shift:0;if(wt==="x"){if(So==="b"?On[So]=Fe._depth:(On[So]=Fe._depth=Math.max(Xn.width>0?vs-Xn.top:0,go),gu.reverse()),Xn.width>0){var Fu=Xn.right-(Fe._offset+Fe._length);Fu>0&&(On.xr=1,On.r=Fu);var au=Fe._offset-Xn.left;au>0&&(On.xl=0,On.l=au)}}else if(So==="l"?(Fe._depth=Math.max(Xn.height>0?vs-Xn.left:0,go),On[So]=Fe._depth-yu):(Fe._depth=Math.max(Xn.height>0?Xn.right-vs:0,go),On[So]=Fe._depth+yu,gu.reverse()),Xn.height>0){var xc=Xn.bottom-(Fe._offset+Fe._length);xc>0&&(On.yb=0,On.b=xc);var Pu=Fe._offset-Xn.top;Pu>0&&(On.yt=1,On.t=Pu)}On[jt]=Fe.anchor==="free"?Fe.position:Fe._anchorAxis.domain[gu[0]],Fe.title.text!==tt._dfltTitle[wt]&&(On[So]+=$t(Fe)+(Fe.title.standoff||0)),Fe.mirror&&Fe.anchor!=="free"&&(Uo={x:0,y:0,r:0,l:0,t:0,b:0},Uo[nl]=Fe.linewidth,Fe.mirror&&Fe.mirror!==!0&&(Uo[nl]+=go),Fe.mirror===!0||Fe.mirror==="ticks"?Uo[jt]=Fe._anchorAxis.domain[gu[1]]:(Fe.mirror==="all"||Fe.mirror==="allticks")&&(Uo[jt]=[Fe._counterDomainMin,Fe._counterDomainMax][gu[1]]))}ws&&(kl=o.getComponentMethod("rangeslider","autoMarginOpts")(Be,Fe)),typeof Fe.automargin=="string"&&(At(On,Fe.automargin),At(Uo,Fe.automargin)),a.autoMargin(Be,Ai(Fe),On),a.autoMargin(Be,oi(Fe),Uo),a.autoMargin(Be,Qr(Fe),kl)}),s.syncOrAsync(Vn)}};function At(Be,Fe){if(Be){var Et=Object.keys(W).reduce(function(St,zt){return Fe.indexOf(zt)!==-1&&W[zt].forEach(function(Wt){St[Wt]=1}),St},{});Object.keys(Be).forEach(function(St){Et[St]||(St.length===1?Be[St]=0:delete Be[St])})}}function dt(Be,Fe){var Et=[],St,zt=function(Wt,Yt){var ze=Wt.xbnd[Yt];ze!==null&&Et.push(s.extendFlat({},Wt,{x:ze}))};if(Fe.length){for(St=0;StBe.range[1],ze=Be.ticklabelposition&&Be.ticklabelposition.indexOf("inside")!==-1,tt=!ze;if(Et){var ft=Yt?-1:1;Et=Et*ft}if(St){var wt=Be.side,jt=ze&&(wt==="top"||wt==="left")||tt&&(wt==="bottom"||wt==="right")?1:-1;St=St*jt}return Be._id.charAt(0)==="x"?function(It){return l(zt+Be._offset+Be.l2p(yt(It))+Et,Wt+St)}:function(It){return l(Wt+St,zt+Be._offset+Be.l2p(yt(It))+Et)}};function yt(Be){return Be.periodX!==void 0?Be.periodX:Be.x}function kt(Be){var Fe=Be.ticklabelposition||"",Et=Be.tickson||"",St=function(qt){return Fe.indexOf(qt)!==-1},zt=St("top"),Wt=St("left"),Yt=St("right"),ze=St("bottom"),tt=St("inside"),ft=Et!=="boundaries"&&(ze||Wt||zt||Yt);if(!ft&&!tt)return[0,0];var wt=Be.side,jt=ft?(Be.tickwidth||0)/2:0,It=$,Kt=Be.tickfont?Be.tickfont.size:12;return(ze||zt)&&(jt+=Kt*J,It+=(Be.linewidth||0)/2),(Wt||Yt)&&(jt+=(Be.linewidth||0)/2,It+=$),tt&&wt==="top"&&(It-=Kt*(1-J)),(Wt||zt)&&(jt=-jt),(wt==="bottom"||wt==="right")&&(It=-It),[ft?jt:0,tt?It:0]}U.makeTickPath=function(Be,Fe,Et,St){St||(St={});var zt=St.minor;if(zt&&!Be.minor)return"";var Wt=St.len!==void 0?St.len:zt?Be.minor.ticklen:Be.ticklen,Yt=Be._id.charAt(0),ze=(Be.linewidth||1)/2;return Yt==="x"?"M0,"+(Fe+ze*Et)+"v"+Wt*Et:"M"+(Fe+ze*Et)+",0h"+Wt*Et},U.makeLabelFns=function(Be,Fe,Et){var St=Be.ticklabelposition||"",zt=Be.tickson||"",Wt=function(Ka){return St.indexOf(Ka)!==-1},Yt=Wt("top"),ze=Wt("left"),tt=Wt("right"),ft=Wt("bottom"),wt=zt!=="boundaries"&&(ft||ze||Yt||tt),jt=Wt("inside"),It=St==="inside"&&Be.ticks==="inside"||!jt&&Be.ticks==="outside"&&zt!=="boundaries",Kt=0,qt=0,vr=It?Be.ticklen:0;if(jt?vr*=-1:wt&&(vr=0),It&&(Kt+=vr,Et)){var Br=s.deg2rad(Et);Kt=vr*Math.cos(Br)+1,qt=vr*Math.sin(Br)}Be.showticklabels&&(It||Be.showline)&&(Kt+=.2*Be.tickfont.size),Kt+=(Be.linewidth||1)/2*(jt?-1:1);var Pr={labelStandoff:Kt,labelShift:qt},Mi,gi,ba,Hi,Za=0,oa=Be.side,Cn=Be._id.charAt(0),_n=Be.tickangle,Li;if(Cn==="x")Li=!jt&&oa==="bottom"||jt&&oa==="top",Hi=Li?1:-1,jt&&(Hi*=-1),Mi=qt*Hi,gi=Fe+Kt*Hi,ba=Li?1:-.2,Math.abs(_n)===90&&(jt?ba+=Z:_n===-90&&oa==="bottom"?ba=J:_n===90&&oa==="top"?ba=Z:ba=.5,Za=Z/2*(_n/90)),Pr.xFn=function(Ka){return Ka.dx+Mi+Za*Ka.fontSize},Pr.yFn=function(Ka){return Ka.dy+gi+Ka.fontSize*ba},Pr.anchorFn=function(Ka,Rn){if(wt){if(ze)return"end";if(tt)return"start"}return!i(Rn)||Rn===0||Rn===180?"middle":Rn*Hi<0!==jt?"end":"start"},Pr.heightFn=function(Ka,Rn,tn){return Rn<-60||Rn>60?-.5*tn:Be.side==="top"!==jt?-tn:0};else if(Cn==="y"){if(Li=!jt&&oa==="left"||jt&&oa==="right",Hi=Li?1:-1,jt&&(Hi*=-1),Mi=Kt,gi=qt*Hi,ba=0,!jt&&Math.abs(_n)===90&&(_n===-90&&oa==="left"||_n===90&&oa==="right"?ba=J:ba=.5),jt){var In=i(_n)?+_n:0;if(In!==0){var pn=s.deg2rad(In);Za=Math.abs(Math.sin(pn))*J*Hi,ba=0}}Pr.xFn=function(Ka){return Ka.dx+Fe-(Mi+Ka.fontSize*ba)*Hi+Za*Ka.fontSize},Pr.yFn=function(Ka){return Ka.dy+gi+Ka.fontSize*Z},Pr.anchorFn=function(Ka,Rn){return i(Rn)&&Math.abs(Rn)===90?"middle":Li?"end":"start"},Pr.heightFn=function(Ka,Rn,tn){return Be.side==="right"&&(Rn*=-1),Rn<-30?-tn:Rn<30?-.5*tn:0}}return Pr};function Lt(Be){return[Be.text,Be.x,Be.axInfo,Be.font,Be.fontSize,Be.fontColor].join("_")}U.drawTicks=function(Be,Fe,Et){Et=Et||{};var St=Fe._id+"tick",zt=[].concat(Fe.minor&&Fe.minor.ticks?Et.vals.filter(function(Yt){return Yt.minor&&!Yt.noTick}):[]).concat(Fe.ticks?Et.vals.filter(function(Yt){return!Yt.minor&&!Yt.noTick}):[]),Wt=Et.layer.selectAll("path."+St).data(zt,Lt);Wt.exit().remove(),Wt.enter().append("path").classed(St,1).classed("ticks",1).classed("crisp",Et.crisp!==!1).each(function(Yt){return c.stroke(t.select(this),Yt.minor?Fe.minor.tickcolor:Fe.tickcolor)}).style("stroke-width",function(Yt){return f.crispRound(Be,Yt.minor?Fe.minor.tickwidth:Fe.tickwidth,1)+"px"}).attr("d",Et.path).style("display",null),Ua(Fe,[O]),Wt.attr("transform",Et.transFn)},U.drawGrid=function(Be,Fe,Et){if(Et=Et||{},Fe.tickmode!=="sync"){var St=Fe._id+"grid",zt=Fe.minor&&Fe.minor.showgrid,Wt=zt?Et.vals.filter(function(Pr){return Pr.minor}):[],Yt=Fe.showgrid?Et.vals.filter(function(Pr){return!Pr.minor}):[],ze=Et.counterAxis;if(ze&&U.shouldShowZeroLine(Be,Fe,ze))for(var tt=Fe.tickmode==="array",ft=0;ft=0;qt--){var vr=qt?It:Kt;if(vr){var Br=vr.selectAll("path."+St).data(qt?Yt:Wt,Lt);Br.exit().remove(),Br.enter().append("path").classed(St,1).classed("crisp",Et.crisp!==!1),Br.attr("transform",Et.transFn).attr("d",Et.path).each(function(Pr){return c.stroke(t.select(this),Pr.minor?Fe.minor.gridcolor:Fe.gridcolor||"#ddd")}).style("stroke-dasharray",function(Pr){return f.dashStyle(Pr.minor?Fe.minor.griddash:Fe.griddash,Pr.minor?Fe.minor.gridwidth:Fe.gridwidth)}).style("stroke-width",function(Pr){return(Pr.minor?jt:Fe._gw)+"px"}).style("display",null),typeof Et.path=="function"&&Br.attr("d",Et.path)}}Ua(Fe,[L,B])}},U.drawZeroLine=function(Be,Fe,Et){Et=Et||Et;var St=Fe._id+"zl",zt=U.shouldShowZeroLine(Be,Fe,Et.counterAxis),Wt=Et.layer.selectAll("path."+St).data(zt?[{x:0,id:Fe._id}]:[]);Wt.exit().remove(),Wt.enter().append("path").classed(St,1).classed("zl",1).classed("crisp",Et.crisp!==!1).each(function(){Et.layer.selectAll("path").sort(function(Yt,ze){return q(Yt.id,ze.id)})}),Wt.attr("transform",Et.transFn).attr("d",Et.path).call(c.stroke,Fe.zerolinecolor||c.defaultLine).style("stroke-width",f.crispRound(Be,Fe.zerolinewidth,Fe._gw||1)+"px").style("display",null),Ua(Fe,[I])},U.drawLabels=function(Be,Fe,Et){Et=Et||{};var St=Be._fullLayout,zt=Fe._id,Wt=Fe.zerolinelayer==="above traces",Yt=Et.cls||zt+"tick",ze=Et.vals.filter(function(ua){return ua.text}),tt=Et.labelFns,ft=Et.secondary?0:Fe.tickangle,wt=(Fe._prevTickAngles||{})[Yt],jt=Et.layer.selectAll("g."+Yt).data(Fe.showticklabels?ze:[],Lt),It=[];jt.enter().append("g").classed(Yt,1).append("text").attr("text-anchor","middle").each(function(ua){var Ea=t.select(this),ln=Be._promises.length;Ea.call(n.positionText,tt.xFn(ua),tt.yFn(ua)).call(f.font,{family:ua.font,size:ua.fontSize,color:ua.fontColor,weight:ua.fontWeight,style:ua.fontStyle,variant:ua.fontVariant,textcase:ua.fontTextcase,lineposition:ua.fontLineposition,shadow:ua.fontShadow}).text(ua.text).call(n.convertToTspans,Be),Be._promises[ln]?It.push(Be._promises.pop().then(function(){Kt(Ea,ft)})):Kt(Ea,ft)}),Ua(Fe,[G]),jt.exit().remove(),Et.repositionOnUpdate&&jt.each(function(ua){t.select(this).select("text").call(n.positionText,tt.xFn(ua),tt.yFn(ua))});function Kt(ua,Ea){ua.each(function(ln){var on=t.select(this),ao=on.select(".text-math-group"),ho=tt.anchorFn(ln,Ea),Jn=Et.transFn.call(on.node(),ln)+(i(Ea)&&+Ea!=0?" rotate("+Ea+","+tt.xFn(ln)+","+(tt.yFn(ln)-ln.fontSize/2)+")":""),lo=n.lineCount(on),Fo=N*ln.fontSize,uo=tt.heightFn(ln,i(Ea)?+Ea:0,(lo-1)*Fo);if(uo&&(Jn+=l(0,uo)),ao.empty()){var Qn=on.select("text");Qn.attr({transform:Jn,"text-anchor":ho}),Qn.style("display",null),Fe._adjustTickLabelsOverflow&&Fe._adjustTickLabelsOverflow()}else{var jo=f.bBox(ao.node()).width,Yn=jo*{end:-.5,start:.5}[ho];ao.attr("transform",Jn+l(Yn,0))}})}Fe._adjustTickLabelsOverflow=function(){var ua=Fe.ticklabeloverflow;if(!(!ua||ua==="allow")){var Ea=ua.indexOf("hide")!==-1,ln=Fe._id.charAt(0)==="x",on=0,ao=ln?Be._fullLayout.width:Be._fullLayout.height;if(ua.indexOf("domain")!==-1){var ho=s.simpleMap(Fe.range,Fe.r2l);on=Fe.l2p(ho[0])+Fe._offset,ao=Fe.l2p(ho[1])+Fe._offset}var Jn=Math.min(on,ao),lo=Math.max(on,ao),Fo=Fe.side,uo=1/0,Qn=-1/0;jt.each(function(ps){var xo=t.select(this),no=xo.select(".text-math-group");if(no.empty()){var Mo=f.bBox(xo.node()),Vn=0;ln?(Mo.right>lo||Mo.leftlo||Mo.top+(Fe.tickangle?0:ps.fontSize/4)Fe["_visibleLabelMin_"+ho._id]?xo.style("display","none"):lo.K==="tick"&&!Jn&&xo.node().style.display!=="none"&&xo.style("display",null)})})})})},Kt(jt,wt+1?wt:ft);function qt(){return It.length&&Promise.all(It)}var vr=null;function Br(){if(Kt(jt,ft),ze.length&&Fe.autotickangles&&(Fe.type!=="log"||String(Fe.dtick).charAt(0)!=="D")){vr=Fe.autotickangles[0];var ua=0,Ea=[],ln,on=1;jt.each(function(On){ua=Math.max(ua,On.fontSize);var Uo=Fe.l2p(On.x),kl=Ur(this),mu=f.bBox(kl.node());on=Math.max(on,n.lineCount(kl)),Ea.push({top:0,bottom:10,height:10,left:Uo-mu.width/2,right:Uo+mu.width/2+2,width:mu.width+2})});var ao=(Fe.tickson==="boundaries"||Fe.showdividers)&&!Et.secondary,ho=ze.length,Jn=Math.abs((ze[ho-1].x-ze[0].x)*Fe._m)/(ho-1),lo=ao?Jn/2:Jn,Fo=ao?Fe.ticklen:ua*1.25*on,uo=Math.sqrt(Math.pow(lo,2)+Math.pow(Fo,2)),Qn=lo/uo,jo=Fe.autotickangles.map(function(On){return On*Math.PI/180}),Yn=jo.find(function(On){return Math.abs(Math.cos(On))<=Qn});Yn===void 0&&(Yn=jo.reduce(function(On,Uo){return Math.abs(Math.cos(On))Mn*tn&&(pn=tn,_n[Cn]=Li[Cn]=Ka[Cn])}var Kn=Math.abs(pn-In);Kn-Hi>0?(Kn-=Hi,Hi*=1+Hi/Kn):Hi=0,Fe._id.charAt(0)!=="y"&&(Hi=-Hi),_n[oa]=gi.p2r(gi.r2p(Li[oa])+Za*Hi),gi.autorange==="min"||gi.autorange==="max reversed"?(_n[0]=null,gi._rangeInitial0=void 0,gi._rangeInitial1=void 0):(gi.autorange==="max"||gi.autorange==="min reversed")&&(_n[1]=null,gi._rangeInitial0=void 0,gi._rangeInitial1=void 0),St._insideTickLabelsUpdaterange[gi._name+".range"]=_n}var zn=s.syncOrAsync(Pr);return zn&&zn.then&&Be._promises.push(zn),zn};function Ct(Be,Fe,Et){var St=Fe._id+"divider",zt=Et.vals,Wt=Et.layer.selectAll("path."+St).data(zt,Lt);Wt.exit().remove(),Wt.enter().insert("path",":first-child").classed(St,1).classed("crisp",1).call(c.stroke,Fe.dividercolor).style("stroke-width",f.crispRound(Be,Fe.dividerwidth,1)+"px"),Wt.attr("transform",Et.transFn).attr("d",Et.path)}U.getPxPosition=function(Be,Fe){var Et=Be._fullLayout._size,St=Fe._id.charAt(0),zt=Fe.side,Wt;if(Fe.anchor!=="free"?Wt=Fe._anchorAxis:St==="x"?Wt={_offset:Et.t+(1-(Fe.position||0))*Et.h,_length:0}:St==="y"&&(Wt={_offset:Et.l+(Fe.position||0)*Et.w+Fe._shift,_length:0}),zt==="top"||zt==="left")return Wt._offset;if(zt==="bottom"||zt==="right")return Wt._offset+Wt._length};function $t(Be){var Fe=Be.title.font.size,Et=(Be.title.text.match(n.BR_TAG_ALL)||[]).length;return Be.title.hasOwnProperty("standoff")?Fe*(J+Et*N):Et?Fe*(Et+1)*N:Fe}function mr(Be,Fe){var Et=Be._fullLayout,St=Fe._id,zt=St.charAt(0),Wt=Fe.title.font.size,Yt,ze=(Fe.title.text.match(n.BR_TAG_ALL)||[]).length;if(Fe.title.hasOwnProperty("standoff"))Fe.side==="bottom"||Fe.side==="right"?Yt=Fe._depth+Fe.title.standoff+Wt*J:(Fe.side==="top"||Fe.side==="left")&&(Yt=Fe._depth+Fe.title.standoff+Wt*(Z+ze*N));else{var tt=bi(Fe);if(Fe.type==="multicategory")Yt=Fe._depth;else{var ft=1.5*Wt;tt&&(ft=.5*Wt,Fe.ticks==="outside"&&(ft+=Fe.ticklen)),Yt=10+ft+(Fe.linewidth?Fe.linewidth-1:0)}tt||(zt==="x"?Yt+=Fe.side==="top"?Wt*(Fe.showticklabels?1:0):Wt*(Fe.showticklabels?1.5:.5):Yt+=Fe.side==="right"?Wt*(Fe.showticklabels?1:.5):Wt*(Fe.showticklabels?.5:0))}var wt=U.getPxPosition(Be,Fe),jt,It,Kt;zt==="x"?(It=Fe._offset+Fe._length/2,Kt=Fe.side==="top"?wt-Yt:wt+Yt):(Kt=Fe._offset+Fe._length/2,It=Fe.side==="right"?wt+Yt:wt-Yt,jt={rotate:"-90",offset:0});var qt;if(Fe.type!=="multicategory"){var vr=Fe._selections[Fe._id+"tick"];if(qt={selection:vr,side:Fe.side},vr&&vr.node()&&vr.node().parentNode){var Br=f.getTranslate(vr.node().parentNode);qt.offsetLeft=Br.x,qt.offsetTop=Br.y}Fe.title.hasOwnProperty("standoff")&&(qt.pad=0)}return Fe._titleStandoff=Yt,u.draw(Be,St+"title",{propContainer:Fe,propName:Fe._name+".title.text",placeholder:Et._dfltTitle[zt],avoid:qt,transform:jt,attributes:{x:It,y:Kt,"text-anchor":"middle"}})}U.shouldShowZeroLine=function(Be,Fe,Et){var St=s.simpleMap(Fe.range,Fe.r2l);return St[0]*St[1]<=0&&Fe.zeroline&&(Fe.type==="linear"||Fe.type==="-")&&!(Fe.rangebreaks&&Fe.maskBreaks(0)===z)&&(br(Fe,0)||!Er(Be,Fe,Et,St)||Tr(Be,Fe))},U.clipEnds=function(Be,Fe){return Fe.filter(function(Et){return br(Be,Et.x)})};function br(Be,Fe){var Et=Be.l2p(Fe);return Et>1&&Et1)for(zt=1;zt=zt.min&&Be=R:/%L/.test(Fe)?Be>=D:/%[SX]/.test(Fe)?Be>=F:/%M/.test(Fe)?Be>=T:/%[HI]/.test(Fe)?Be>=E:/%p/.test(Fe)?Be>=b:/%[Aadejuwx]/.test(Fe)?Be>=A:/%[UVW]/.test(Fe)?Be>=k:/%[Bbm]/.test(Fe)?Be>=w:/%[q]/.test(Fe)?Be>=S:/%[Yy]/.test(Fe)?Be>=_:!0}}}),LE=de({"src/plots/cartesian/autorange_options_defaults.js"(e,r){"use strict";r.exports=function(i,a,o){var s,l;if(o){var n=a==="reversed"||a==="min reversed"||a==="max reversed";s=o[n?1:0],l=o[n?0:1]}var u=i("autorangeoptions.minallowed",l===null?s:void 0),c=i("autorangeoptions.maxallowed",s===null?l:void 0);u===void 0&&i("autorangeoptions.clipmin"),c===void 0&&i("autorangeoptions.clipmax"),i("autorangeoptions.include")}}}),FE=de({"src/plots/cartesian/range_defaults.js"(e,r){"use strict";var t=LE();r.exports=function(a,o,s,l){var n=o._template||{},u=o.type||n.type||"-";s("minallowed"),s("maxallowed");var c=s("range");if(!c){var f;!l.noInsiderange&&u!=="log"&&(f=s("insiderange"),f&&(f[0]===null||f[1]===null)&&(o.insiderange=!1,f=void 0),f&&(c=s("range",f)))}var h=o.getAutorangeDflt(c,l),d=s("autorange",h),p;c&&(c[0]===null&&c[1]===null||(c[0]===null||c[1]===null)&&(d==="reversed"||d===!0)||c[0]!==null&&(d==="min"||d==="max reversed")||c[1]!==null&&(d==="max"||d==="min reversed"))&&(c=void 0,delete o.range,o.autorange=!0,p=!0),p||(h=o.getAutorangeDflt(c,l),d=s("autorange",h)),d&&(t(s,d,c),(u==="linear"||u==="-")&&s("rangemode")),o.cleanRange()}}}),vq=de({"node_modules/mouse-event-offset/index.js"(e,r){var t={left:0,top:0};r.exports=i;function i(o,s,l){s=s||o.currentTarget||o.srcElement,Array.isArray(l)||(l=[0,0]);var n=o.clientX||0,u=o.clientY||0,c=a(s);return l[0]=n-c.left,l[1]=u-c.top,l}function a(o){return o===window||o===document||o===document.body?t:o.getBoundingClientRect()}}}),Mw=de({"node_modules/has-passive-events/index.js"(e,r){"use strict";var t=wE();function i(){var a=!1;try{var o=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("test",null,o),window.removeEventListener("test",null,o)}catch{a=!1}return a}r.exports=t&&i()}}),mq=de({"src/components/dragelement/align.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){var n=(i-o)/(s-o),u=n+a/(s-o),c=(n+u)/2;return l==="left"||l==="bottom"?n:l==="center"||l==="middle"?c:l==="right"||l==="top"?u:n<2/3-c?n:u>4/3-c?u:c}}}),gq=de({"src/components/dragelement/cursor.js"(e,r){"use strict";var t=Qt(),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];r.exports=function(o,s,l,n){return l==="left"?o=0:l==="center"?o=1:l==="right"?o=2:o=t.constrain(Math.floor(o*3),0,2),n==="bottom"?s=0:n==="middle"?s=1:n==="top"?s=2:s=t.constrain(Math.floor(s*3),0,2),i[s][o]}}}),yq=de({"src/components/dragelement/unhover.js"(e,r){"use strict";var t=c1(),i=ww(),a=Ty().getGraphDiv,o=Ta(),s=r.exports={};s.wrapped=function(l,n,u){var c;l=a(l),l._fullLayout&&i.clear(l._fullLayout._uid+o.HOVERID);let f=l._hoverdata;s.raw(l,n,u)&&l._hoverAnywhereActive&&(l._hoverAnywhereActive=!1,(c=l._fullLayout)!=null&&c.hoveranywhere&&n?.target&&!f&&l.emit("plotly_unhover",{event:n,points:[]}))},s.raw=function(n,u){var c=n._fullLayout,f=n._hoverdata;return u||(u={}),u.target&&!n._dragged&&t.triggerHandler(n,"plotly_beforehover",u)===!1?!1:(c._hoverlayer.selectAll("g").remove(),c._hoverlayer.selectAll("line").remove(),c._hoverlayer.selectAll("circle").remove(),n._hoverdata=void 0,u.target&&f&&n.emit("plotly_unhover",{event:u,points:f}),!0)}}}),Uc=de({"src/components/dragelement/index.js"(e,r){"use strict";var t=vq(),i=TE(),a=Mw(),o=Qt().removeElement,s=zl(),l=r.exports={};l.align=mq(),l.getCursor=gq();var n=yq();l.unhover=n.wrapped,l.unhoverRaw=n.raw,l.init=function(h){var d=h.gd,p=1,g=d._context.doubleClickDelay,m=h.element,y,_,v,x,S,M,C,w;d._mouseDownTime||(d._mouseDownTime=0),m.style.pointerEvents="all",m.onmousedown=b,a?(m._ontouchstart&&m.removeEventListener("touchstart",m._ontouchstart),m._ontouchstart=b,m.addEventListener("touchstart",b,{passive:!1})):m.ontouchstart=b;function k(F,D,R){return Math.abs(F)"u"&&typeof F.clientY>"u"&&(F.clientX=y,F.clientY=_),v=new Date().getTime(),v-d._mouseDownTimeg&&(p=Math.max(p-1,1)),d._dragged)h.doneFn&&h.doneFn();else{var D;M.target===C?D=M:(D={target:C,srcElement:C,toElement:C},Object.keys(M).concat(Object.keys(M.__proto__)).forEach(R=>{var P=M[R];!D[R]&&typeof P!="function"&&(D[R]=P)})),h.clickFn&&h.clickFn(p,D),w||C.dispatchEvent(new MouseEvent("click",F))}d._dragging=!1,d._dragged=!1}};function u(){var f=document.createElement("div");f.className="dragcover";var h=f.style;return h.position="fixed",h.left=0,h.right=0,h.top=0,h.bottom=0,h.zIndex=999999999,h.background="none",document.body.appendChild(f),f}l.coverSlip=u;function c(f){return t(f.changedTouches?f.changedTouches[0]:f,document.body)}}}),gd=de({"src/lib/setcursor.js"(e,r){"use strict";r.exports=function(i,a){(i.attr("class")||"").split(" ").forEach(function(o){o.indexOf("cursor-")===0&&i.classed(o,!1)}),a&&i.classed("cursor-"+a,!0)}}}),_q=de({"src/lib/override_cursor.js"(e,r){"use strict";var t=gd(),i="data-savedcursor",a="!!";r.exports=function(s,l){var n=s.attr(i);if(l){if(!n){for(var u=(s.attr("class")||"").split(" "),c=0;c$.legend.length)for(var j=$.legend.length;j<$._length;j++)k=!0,w++});for(var T=d.concat(b).filter(function($){return!E(x)&&c===($.legend||"legend")}),F=0;F(c==="legend"?1:0));if(R===!1&&(h[c]=void 0),R===!1&&!g.uirevision||(y("uirevision",h.uirevision),R===!1))return;y("borderwidth");var P=y("orientation"),z=y("yref"),I=y("xref"),L=P==="h",B=z==="paper",O=I==="paper",G,W,X,Z="left";L?(G=0,t.getComponentMethod("rangeslider","isVisible")(f.xaxis)?B?(W=1.1,X="bottom"):(W=1,X="top"):B?(W=-.1,X="top"):(W=0,X="bottom")):(W=1,X="auto",O?G=1.02:(G=1,Z="right")),i.coerce(g,m,{x:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:G}},"x"),i.coerce(g,m,{y:{valType:"number",editType:"legend",min:B?-2:0,max:B?3:1,dflt:W}},"y"),y("traceorder",A),n.isGrouped(h[c])&&y("tracegroupgap"),y("entrywidth"),y("entrywidthmode"),y("indentation"),y("itemsizing"),y("itemwidth"),y("itemclick"),y("itemdoubleclick");let J=y("groupclick");y("groupdoubleclick",J),y("xanchor",Z),y("yanchor",X),y("maxheight"),y("valign"),i.noneOrAll(g,m,["x","y"]);var N=y("title.text");if(N){y("title.side",L?"left":"top");var H=i.extendFlat({},_,{size:i.bigFont(_.size)});i.coerceFont(y,"title.font",H);let $=p>1;y("titleclick",$?"toggle":!1),y("titledoubleclick",$?"toggleothers":!1)}}r.exports=function(f,h,d){var p,g=d.slice(),m=h.shapes;if(m)for(p=0;pye.showlegend||ye.legendgroup);var v=y.concat(_),x=d.trace;x._isShape&&(x=h.shapes[x.index]);var S=x.legendgroup,M,C,w,k,A,b,E={},T=[],F=[],D=[];function R(ye,fe){var ae=T.indexOf(ye),ee=E.visible;return ee||(ee=E.visible=[]),T.indexOf(ye)===-1&&(T.push(ye),ae=T.length-1),ee[ae]=fe,ae}var P=(h.shapes||[]).map(function(ye){return ye._input}),z=!1;function I(ye,fe){P[ye].visible=fe,z=!0}function L(ye,fe){if(!(d.groupTitle&&!g)){var ae=ye._isShape,ee=ye.index;ee===void 0&&(ee=ye._index);var ie=ye.visible===!1?!1:fe;ae?I(ee,ie):R(ee,ie)}}var B=x.legend;if(!x._isShape&&r.traceIs(x,"pie-like")){var O=d.label,G=m.indexOf(O);if(c==="toggle")G===-1?m.push(O):m.splice(G,1);else if(c==="toggleothers"){var W=G!==-1,X=[];for(M=0;MC.showlegend||C.legendgroup),p=f.concat(d);function g(C){return(C.legend||"legend")===h}var m,y;if(u==="toggle")m=!p.some(function(w){return g(w)&&w.visible===!0}),y=!1;else{let C=p.some(function(w){return!g(w)&&w.visible===!0&&w.showlegend!==!1});m=!0,y=!C}let _={visible:[]},v=[],x=(c.shapes||[]).map(function(C){return C._input});for(var S=!1,M=0;Mz&&(R=z)}F[_][0]._groupMinRank=R,F[_][0]._preGroupSort=_}var I=function(X,Z){return X[0]._groupMinRank-Z[0]._groupMinRank||X[0]._preGroupSort-Z[0]._preGroupSort},L=function(X,Z){var J=t(X.trace.legendrank)?X.trace.legendrank[X.i]:X.trace.legendrank,N=t(Z.trace.legendrank)?Z.trace.legendrank[Z.i]:Z.trace.legendrank;return J-N||X._preSort-Z._preSort};for(F.forEach(function(X,Z){X[0]._preGroupSort=Z}),F.sort(I),_=0;_0)V=H.width;else return 0;return A?U:Math.min(V,$)};M.each(function(N){var H=t.select(this),$=a.ensureSingle(H,"g","layers");$.style("opacity",N[0].trace.opacity);var U=w.indentation,V=w.valign,j=N[0].lineHeight,q=N[0].height;if(V==="middle"&&U===0||!j||!q)$.attr("transform",null);else{var Y={top:1,bottom:-1}[V],K=Y*(.5*(j-q+3))||0,te=w.indentation;$.attr("transform",o(te,K))}var ne=$.selectAll("g.legendfill").data([N]);ne.enter().append("g").classed("legendfill",!0);var se=$.selectAll("g.legendlines").data([N]);se.enter().append("g").classed("legendlines",!0);var le=$.selectAll("g.legendsymbols").data([N]);le.enter().append("g").classed("legendsymbols",!0),le.selectAll("g.legendpoints").data([N]).enter().append("g").classed("legendpoints",!0)}).each(J).each(P).each(I).each(z).each(B).each(X).each(W).each(D).each(R).each(O).each(G);function D(N){var H=v(N),$=H.showFill,U=H.showLine,V=H.showGradientLine,j=H.showGradientFill,q=H.anyFill,Y=H.anyLine,K=N[0],te=K.trace,ne,se,le=n(te),ce=le.colorscale,pe=le.reversescale,xe=function(ue){if(ue.size())if($)s.fillGroupStyle(ue,C,!0);else{var ge="legendfill-"+te.uid;s.gradient(ue,C,ge,_(pe),ce,"fill")}},ye=function(ue){if(ue.size()){var ge="legendline-"+te.uid;s.lineGroupStyle(ue),s.gradient(ue,C,ge,_(pe),ce,"stroke")}},fe=u.hasMarkers(te)||!q?"M5,0":Y?"M5,-2":"M5,-3",ae=t.select(this),ee=ae.select(".legendfill").selectAll("path").data($||j?[N]:[]);if(ee.enter().append("path").classed("js-fill",!0),ee.exit().remove(),ee.attr("d",fe+"h"+b+"v6h-"+b+"z").call(xe),U||V){var ie=F(void 0,te.line,m,p);se=a.minExtend(te,{line:{width:ie}}),ne=[a.minExtend(K,{trace:se})]}var Q=ae.select(".legendlines").selectAll("path").data(U||V?[ne]:[]);Q.enter().append("path").classed("js-line",!0),Q.exit().remove(),Q.attr("d",fe+(V?"l"+b+",0.0001":"h"+b)).call(U?s.lineGroupStyle:ye)}function R(N){var H=v(N),$=H.anyFill,U=H.anyLine,V=H.showLine,j=H.showMarker,q=N[0],Y=q.trace,K=!j&&!U&&!$&&u.hasText(Y),te,ne;function se(ie,Q,ue,ge){var Me=a.nestedProperty(Y,ie).get(),Te=a.isArrayOrTypedArray(Me)&&Q?Q(Me):Me;if(A&&Te&&ge!==void 0&&(Te=ge),ue){if(Teue[1])return ue[1]}return Te}function le(ie){return q._distinct&&q.index&&ie[q.index]?ie[q.index]:ie[0]}if(j||K||V){var ce={},pe={};if(j){ce.mc=se("marker.color",le);var xe=Y.type==="scattermap";ce.mx=xe?"circle":se("marker.symbol",le),ce.mo=se("marker.opacity",a.mean,[.2,1]),ce.mlc=se("marker.line.color",le),ce.mlw=se("marker.line.width",a.mean,[0,5],g),ce.mld=se("marker.line.dash",le),pe.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var ye=se("marker.size",a.mean,[2,16],d);ce.ms=ye,pe.marker.size=ye}V&&(pe.line={width:se("line.width",le,[0,10],p)}),K&&(ce.tx="Aa",ce.tp=se("textposition",le),ce.ts=10,ce.tc=se("textfont.color",le),ce.tf=se("textfont.family",le),ce.tw=se("textfont.weight",le),ce.ty=se("textfont.style",le),ce.tv=se("textfont.variant",le),ce.tC=se("textfont.textcase",le),ce.tE=se("textfont.lineposition",le),ce.tS=se("textfont.shadow",le)),te=[a.minExtend(q,ce)],ne=a.minExtend(Y,pe),ne.selectedpoints=null,ne.texttemplate=null}var fe=t.select(this).select("g.legendpoints"),ae=fe.selectAll("path.scatterpts").data(j?te:[]);ae.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",T),ae.exit().remove(),ae.call(s.pointStyle,ne,C),j&&(te[0].mrc=3);var ee=fe.selectAll("g.pointtext").data(K?te:[]);ee.enter().append("g").classed("pointtext",!0).append("text").attr("transform",T),ee.exit().remove(),ee.selectAll("text").call(s.textPointStyle,ne,C)}function P(N){var H=N[0].trace,$=H.type==="waterfall";if(N[0]._distinct&&$){var U=N[0].trace[N[0].dir].marker;return N[0].mc=U.color,N[0].mlw=U.line.width,N[0].mlc=U.line.color,L(N,this,"waterfall")}var V=[];H.visible&&$&&(V=N[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var j=t.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(V);j.enter().append("path").classed("legendwaterfall",!0).attr("transform",T).style("stroke-miterlimit",1),j.exit().remove(),j.each(function(q){var Y=t.select(this),K=H[q[0]].marker,te=F(void 0,K.line,y,g);Y.attr("d",q[1]).style("stroke-width",te+"px").call(l.fill,K.color),te&&Y.call(l.stroke,K.line.color)})}function z(N){L(N,this)}function I(N){L(N,this,"funnel")}function L(N,H,$){var U=N[0].trace,V=U.marker||{},j=V.line||{},q=V.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",Y=$?U.visible&&U.type===$:i.traceIs(U,"bar"),K=t.select(H).select("g.legendpoints").selectAll("path.legend"+$).data(Y?[N]:[]);K.enter().append("path").classed("legend"+$,!0).attr("d",q).attr("transform",T),K.exit().remove(),K.each(function(te){var ne=t.select(this),se=te[0],le=F(se.mlw,V.line,y,g);ne.style("stroke-width",le+"px");var ce=se.mcc;if(!w._inHover&&"mc"in se){var pe=n(V),xe=pe.mid;xe===void 0&&(xe=(pe.max+pe.min)/2),ce=s.tryColorscale(V,"")(xe)}var ye=ce||se.mc||V.color,fe=V.pattern,ae=s.getPatternAttr,ee=fe&&(ae(fe.shape,0,"")||ae(fe.path,0,""));if(ee){var ie=ae(fe.bgcolor,0,null),Q=ae(fe.fgcolor,0,null),ue=fe.fgopacity,ge=x(fe.size,8,10),Me=x(fe.solidity,.5,1),Te="legend-"+U.uid;ne.call(s.pattern,"legend",C,Te,ee,ge,Me,ce,fe.fillmode,ie,Q,ue)}else ne.call(l.fill,ye);le&&l.stroke(ne,se.mlc||j.color)})}function B(N){var H=N[0].trace,$=t.select(this).select("g.legendpoints").selectAll("path.legendbox").data(H.visible&&i.traceIs(H,"box-violin")?[N]:[]);$.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",T),$.exit().remove(),$.each(function(){var U=t.select(this);if((H.boxpoints==="all"||H.points==="all")&&l.opacity(H.fillcolor)===0&&l.opacity((H.line||{}).color)===0){var V=a.minExtend(H,{marker:{size:A?d:a.constrain(H.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});$.call(s.pointStyle,V,C)}else{var j=F(void 0,H.line,y,g);U.style("stroke-width",j+"px").call(l.fill,H.fillcolor),j&&l.stroke(U,H.line.color)}})}function O(N){var H=N[0].trace,$=t.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(H.visible&&H.type==="candlestick"?[N,N]:[]);$.enter().append("path").classed("legendcandle",!0).attr("d",function(U,V){return V?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",T).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(U,V){var j=t.select(this),q=H[V?"increasing":"decreasing"],Y=F(void 0,q.line,y,g);j.style("stroke-width",Y+"px").call(l.fill,q.fillcolor),Y&&l.stroke(j,q.line.color)})}function G(N){var H=N[0].trace,$=t.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(H.visible&&H.type==="ohlc"?[N,N]:[]);$.enter().append("path").classed("legendohlc",!0).attr("d",function(U,V){return V?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",T).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(U,V){var j=t.select(this),q=H[V?"increasing":"decreasing"],Y=F(void 0,q.line,y,g);j.style("fill","none").call(s.dashLine,q.line.dash,Y),Y&&l.stroke(j,q.line.color)})}function W(N){Z(N,this,"pie")}function X(N){Z(N,this,"funnelarea")}function Z(N,H,$){var U=N[0],V=U.trace,j=$?V.visible&&V.type===$:i.traceIs(V,$),q=t.select(H).select("g.legendpoints").selectAll("path.legend"+$).data(j?[N]:[]);if(q.enter().append("path").classed("legend"+$,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",T),q.exit().remove(),q.size()){var Y=V.marker||{},K=F(f(Y.line.width,U.pts),Y.line,y,g),te="pieLike",ne=a.minExtend(V,{marker:{line:{width:K}}},te),se=a.minExtend(U,{trace:ne},te);c(q,se,ne,C)}}function J(N){var H=N[0].trace,$,U=[];if(H.visible)switch(H.type){case"histogram2d":case"heatmap":U=[["M-15,-2V4H15V-2Z"]],$=!0;break;case"choropleth":case"choroplethmap":U=[["M-6,-6V6H6V-6Z"]],$=!0;break;case"densitymap":U=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],$="radial";break;case"cone":U=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],$=!1;break;case"streamtube":U=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],$=!1;break;case"surface":U=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],$=!0;break;case"mesh3d":U=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!1;break;case"volume":U=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!0;break;case"isosurface":U=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],$=!1;break}var V=t.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(U);V.enter().append("path").classed("legend3dandfriends",!0).attr("transform",T).style("stroke-miterlimit",1),V.exit().remove(),V.each(function(j,q){var Y=t.select(this),K=n(H),te=K.colorscale,ne=K.reversescale,se=function(xe){if(xe.size()){var ye="legendfill-"+H.uid;s.gradient(xe,C,ye,_(ne,$==="radial"),te,"fill")}},le;if(te){if(!$){var pe=te.length;le=q===0?te[ne?pe-1:0][1]:q===1?te[ne?0:pe-1][1]:te[Math.floor((pe-1)/2)][1]}}else{var ce=H.vertexcolor||H.facecolor||H.color;le=a.isArrayOrTypedArray(ce)?ce[q]||ce[0]:ce}Y.attr("d",j[0]),le?Y.call(l.fill,le):Y.call(se)})}};function _(S,M){var C=M?"radial":"horizontal";return C+(S?"":"reversed")}function v(S){var M=S[0].trace,C=M.contours,w=u.hasLines(M)||M.visible&&M.type==="quiver",k=u.hasMarkers(M),A=M.visible&&M.fill&&M.fill!=="none",b=!1,E=!1;if(C){var T=C.coloring;T==="lines"?b=!0:w=T==="none"||T==="heatmap"||C.showlines,C.type==="constraint"?A=C._operation!=="=":(T==="fill"||T==="heatmap")&&(E=!0)}return{showMarker:k,showLine:w,showFill:A,showGradientLine:b,showGradientFill:E,anyLine:w||b,anyFill:A||E}}function x(S,M,C){return S&&a.isArrayOrTypedArray(S)?M:S>C?C:S}}}),OE=de({"src/components/legend/draw.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=ks(),o=Sa(),s=c1(),l=Uc(),n=hn(),u=ta(),c=Zo(),f=RE().handleItemClick,h=RE().handleTitleClick,d=zE(),p=Bl(),g=p.LINE_SPACING,m=p.FROM_TL,y=p.FROM_BR,_=xq(),v=BE(),x=Ey(),S=1,M=/^legend[0-9]*$/;r.exports=function(G,W){if(W)w(G,W);else{var X=G._fullLayout,Z=X._legends,J=X._infolayer.selectAll('[class^="legend"]');J.each(function(){var U=t.select(this),V=U.attr("class"),j=V.split(" ")[0];j.match(M)&&Z.indexOf(j)===-1&&U.remove()});for(var N=0;N1)}var K=X.hiddenlabels||[];if(!H&&(!X.showlegend||!$.length))return N.selectAll("."+Z).remove(),X._topdefs.select("#"+J).remove(),a.autoMargin(O,Z);var te=i.ensureSingle(N,"g",Z,function(ae){H||ae.attr("pointer-events","all")}),ne=i.ensureSingleById(X._topdefs,"clipPath",J,function(ae){ae.append("rect")}),se=i.ensureSingle(te,"rect","bg",function(ae){ae.attr("shape-rendering","crispEdges")});se.call(u.stroke,W.bordercolor).call(u.fill,W.bgcolor).style("stroke-width",W.borderwidth+"px");var le=i.ensureSingle(te,"g","scrollbox"),ce=W.title;W._titleWidth=0,W._titleHeight=0;var pe;ce.text?(pe=i.ensureSingle(le,"text",Z+"titletext"),pe.attr("text-anchor","start").call(n.font,ce.font).text(ce.text),D(pe,le,O,W,S),!H&&(W.titleclick||W.titledoubleclick)&&F(le,O,W,Z)):(le.selectAll("."+Z+"titletext").remove(),le.selectAll("."+Z+"titletoggle").remove());var xe=i.ensureSingle(te,"rect","scrollbar",function(ae){ae.attr(d.scrollBarEnterAttrs).call(u.fill,d.scrollBarColor)}),ye=le.selectAll("g.groups").data($);ye.enter().append("g").attr("class","groups"),ye.exit().remove();var fe=ye.selectAll("g.traces").data(i.identity);fe.enter().append("g").attr("class","traces"),fe.exit().remove(),fe.style("opacity",function(ae){let ee=ae[0],ie=ee.trace;if(ee.groupTitle){let Q=ie.legendgroup,ue=(X.shapes||[]).filter(function(Me){return Me.showlegend});return O._fullData.concat(ue).some(function(Me){return Me.legendgroup===Q&&(Me.legend||"legend")===Z&&Me.visible===!0})?1:.5}return o.traceIs(ie,"pie-like")?K.indexOf(ae[0].label)!==-1?.5:1:ie.visible==="legendonly"?.5:1}).each(function(){t.select(this).call(b,O,W)}).call(v,O,W).each(function(ae){H||ae[0].groupTitle&&W.groupclick==="toggleitem"||t.select(this).call(T,O,Z)}),i.syncOrAsync([a.previousPromises,function(){return z(O,ye,fe,W,le)},function(){var ae=X._size,ee=W.borderwidth,ie=W.xref==="paper",Q=W.yref==="paper";if(ce.text){let Ue=(X.shapes||[]).filter(function(rt){return rt.showlegend}),at=O._fullData.concat(Ue).some(function(rt){let ht=rt.legend||"legend";var At=Array.isArray(ht)?ht.includes(Z):ht===Z;return At&&rt.visible===!0});pe.style("opacity",at?1:.5)}if(!H){var ue,ge;ie?ue=ae.l+ae.w*W.x-m[L(W)]*W._width:ue=X.width*W.x-m[L(W)]*W._width,Q?ge=ae.t+ae.h*(1-W.y)-m[B(W)]*W._effHeight:ge=X.height*(1-W.y)-m[B(W)]*W._effHeight;var Me=I(O,Z,ue,ge);if(Me)return;if(X.margin.autoexpand){var Te=ue,je=ge;ue=ie?i.constrain(ue,0,X.width-W._width):Te,ge=Q?i.constrain(ge,0,X.height-W._effHeight):je,ue!==Te&&i.log("Constrain "+Z+".x to make legend fit inside graph"),ge!==je&&i.log("Constrain "+Z+".y to make legend fit inside graph")}n.setTranslate(te,ue,ge)}if(xe.on(".drag",null),te.on("wheel",null),H||W._height<=W._maxHeight||O._context.staticPlot){var Ve=W._effHeight;H&&(Ve=W._height),se.attr({width:W._width-ee,height:Ve-ee,x:ee/2,y:ee/2}),n.setTranslate(le,0,0),ne.select("rect").attr({width:W._width-2*ee,height:Ve-2*ee,x:ee,y:ee}),n.setClipUrl(le,J,O),n.setRect(xe,0,0,0,0),delete W._scrollY}else{var Ke=Math.max(d.scrollBarMinHeight,W._effHeight*W._effHeight/W._height),Je=W._effHeight-Ke-2*d.scrollBarMargin,vt=W._height-W._effHeight,xt=Je/vt,Pt=Math.min(W._scrollY||0,vt);se.attr({width:W._width-2*ee+d.scrollBarWidth+d.scrollBarMargin,height:W._effHeight-ee,x:ee/2,y:ee/2}),ne.select("rect").attr({width:W._width-2*ee+d.scrollBarWidth+d.scrollBarMargin,height:W._effHeight-2*ee,x:ee,y:ee+Pt}),n.setClipUrl(le,J,O),Ae(Pt,Ke,xt),te.on("wheel",function(){Pt=i.constrain(W._scrollY+t.event.deltaY/vt*Je,0,vt),Ae(Pt,Ke,xt),Pt!==0&&Pt!==vt&&t.event.preventDefault()});var mt,Mt,lt,qe=function(Ue,at,rt){var ht=(rt-at)/xt+Ue;return i.constrain(ht,0,vt)},Ye=function(Ue,at,rt){var ht=(at-rt)/xt+Ue;return i.constrain(ht,0,vt)},me=t.behavior.drag().on("dragstart",function(){var Ue=t.event.sourceEvent;Ue.type==="touchstart"?mt=Ue.changedTouches[0].clientY:mt=Ue.clientY,lt=Pt}).on("drag",function(){var Ue=t.event.sourceEvent;Ue.buttons===2||Ue.ctrlKey||(Ue.type==="touchmove"?Mt=Ue.changedTouches[0].clientY:Mt=Ue.clientY,Pt=qe(lt,mt,Mt),Ae(Pt,Ke,xt))});xe.call(me);var _e=t.behavior.drag().on("dragstart",function(){var Ue=t.event.sourceEvent;Ue.type==="touchstart"&&(mt=Ue.changedTouches[0].clientY,lt=Pt)}).on("drag",function(){var Ue=t.event.sourceEvent;Ue.type==="touchmove"&&(Mt=Ue.changedTouches[0].clientY,Pt=Ye(lt,mt,Mt),Ae(Pt,Ke,xt))});le.call(_e)}function Ae(Ue,at,rt){W._scrollY=O._fullLayout[Z]._scrollY=Ue,n.setTranslate(le,0,-Ue),n.setRect(xe,W._width,d.scrollBarMargin+Ue*rt,d.scrollBarWidth,at),ne.select("rect").attr("y",ee+Ue)}if(O._context.edits.legendPosition){var ke,Ee,De,Qe;te.classed("cursor-move",!0),l.init({element:te.node(),gd:O,prepFn:function(Ue){if(Ue.target!==xe.node()){var at=n.getTranslate(te);De=at.x,Qe=at.y}},moveFn:function(Ue,at){if(De!==void 0&&Qe!==void 0){var rt=De+Ue,ht=Qe+at;n.setTranslate(te,rt,ht),ke=l.align(rt,W._width,ae.l,ae.l+ae.w,W.xanchor),Ee=l.align(ht+W._height,-W._height,ae.t+ae.h,ae.t,W.yanchor)}},doneFn:function(){if(ke!==void 0&&Ee!==void 0){var Ue={};Ue[Z+".x"]=ke,Ue[Z+".y"]=Ee,o.call("_guiRelayout",O,Ue)}},clickFn:function(Ue,at){var rt=N.selectAll("g.traces").filter(function(){var ht=this.getBoundingClientRect();return at.clientX>=ht.left&&at.clientX<=ht.right&&at.clientY>=ht.top&&at.clientY<=ht.bottom});rt.size()>0&&A(O,W,rt,Ue,at)}})}}],O)}}function k(O,G,W){var X=O[0],Z=X.width,J=G.entrywidthmode,N=X.trace.legendwidth||G.entrywidth;return J==="fraction"?G._maxWidth*N:W+(N||Z)}function A(O,G,W,X,Z){var J=O._fullLayout,N=W.data()[0][0].trace,H=G.itemclick,$=G.itemdoubleclick,U={event:Z,node:W.node(),curveNumber:N.index,expandedIndex:N.index,data:O.data,layout:O.layout,frames:O._transitionData._frames,config:O._context,fullData:O._fullData,fullLayout:J};N._group&&(U.group=N._group),o.traceIs(N,"pie-like")&&(U.label=W.datum()[0].label);var V=s.triggerHandler(O,"plotly_legendclick",U);if(X===1){if(V===!1)return;G._clickTimeout=setTimeout(function(){O._fullLayout&&H&&f(W,O,G,H,X)},O._context.doubleClickDelay)}else if(X===2){G._clickTimeout&&clearTimeout(G._clickTimeout),O._legendMouseDownTime=0;var j=s.triggerHandler(O,"plotly_legenddoubleclick",U);j!==!1&&V!==!1&&$&&f(W,O,G,$,X)}}function b(O,G,W){var X=x.getId(W),Z=O.data()[0][0],J=Z.trace,N=o.traceIs(J,"pie-like"),H=!W._inHover&&G._context.edits.legendText&&!N,$=W._maxNameLength,U,V;Z.groupTitle?(U=Z.groupTitle.text,V=Z.groupTitle.font):(V=W.font,W.entries?U=Z.text:(U=N?Z.label:J.name,J._meta&&(U=i.templateString(U,J._meta))));var j=i.ensureSingle(O,"text",X+"text");j.attr("text-anchor","start").call(n.font,V).text(H?E(U,$):U);var q=W.indentation+W.itemwidth+d.itemGap*2;c.positionText(j,q,0),H?j.call(c.makeEditable,{gd:G,text:U}).call(D,O,G,W).on("edit",function(Y){this.text(E(Y,$)).call(D,O,G,W);var K={};return K.name=Y,Z.trace._isShape?o.call("_guiRelayout",G,"shapes["+J.index+"].name",K.name):o.call("_guiRestyle",G,K,J.index)}):D(j,O,G,W)}function E(O,G){var W=Math.max(4,G);if(O&&O.trim().length>=W/2)return O;O=O||"";for(var X=W-O.length;X>0;X--)O+=" ";return O}function T(O,G,W){var X=G._context.doubleClickDelay,Z,J=1,N=i.ensureSingle(O,"rect",W+"toggle",function(H){G._context.staticPlot||H.style("cursor","pointer").attr("pointer-events","all"),H.call(u.fill,"rgba(0,0,0,0)")});G._context.staticPlot||(N.on("mousedown",function(){Z=new Date().getTime(),Z-G._legendMouseDownTimeX&&(J=Math.max(J-1,1)),A(G,H,O,J,t.event)}}))}function F(O,G,W,X){if(G._fullData.some(function(U){let V=U.legend||"legend";return(Array.isArray(V)?V.includes(X):V===X)&&o.traceIs(U,"pie-like")}))return;let J=G._context.doubleClickDelay;var N,H=1;let $=i.ensureSingle(O,"rect",X+"titletoggle",function(U){G._context.staticPlot||U.style("cursor","pointer").attr("pointer-events","all"),U.call(u.fill,"rgba(0,0,0,0)")});G._context.staticPlot||($.on("mousedown",function(){N=new Date().getTime(),N-G._legendMouseDownTimeJ&&(H=Math.max(H-1,1));let U={event:t.event,legendId:X,data:G.data,layout:G.layout,fullData:G._fullData,fullLayout:G._fullLayout};if(H===1&&W.titleclick){if(s.triggerHandler(G,"plotly_legendtitleclick",U)===!1)return;W._titleClickTimeout=setTimeout(function(){G._fullLayout&&h(G,W,W.titleclick)},J)}else H===2&&(W._titleClickTimeout&&clearTimeout(W._titleClickTimeout),G._legendMouseDownTime=0,s.triggerHandler(G,"plotly_legendtitledoubleclick",U)!==!1&&W.titledoubleclick&&h(G,W,W.titledoubleclick))}))}function D(O,G,W,X,Z){X._inHover&&O.attr("data-notex",!0),c.convertToTspans(O,W,function(){R(G,W,X,Z)})}function R(O,G,W,X){var Z=O.data()[0][0],J=Z&&Z.trace.showlegend;if(Array.isArray(J)&&(J=J[Z.i]!==!1),!W._inHover&&Z&&!J){O.remove();return}var N=O.select("g[class*=math-group]"),H=N.node(),$=x.getId(W);W||(W=G._fullLayout[$]);var U=W.borderwidth,V;X===S?V=W.title.font:Z.groupTitle?V=Z.groupTitle.font:V=W.font;var j=V.size*g,q,Y;if(H){var K=n.bBox(H);q=K.height,Y=K.width,X===S?n.setTranslate(N,U,U+q*.75):n.setTranslate(N,0,q*.25)}else{var te="."+$+(X===S?"title":"")+"text",ne=O.select(te),se=c.lineCount(ne),le=ne.node();if(q=j*se,Y=le?n.bBox(le).width:0,X===S)W.title.side==="left"&&(Y+=d.itemGap*2),c.positionText(ne,U+d.titlePad,U+j);else{var ce=d.itemGap*2+W.indentation+W.itemwidth;Z.groupTitle&&(ce=d.itemGap,Y-=W.indentation+W.itemwidth),c.positionText(ne,ce,-j*((se-1)/2-.3))}}X===S?(W._titleWidth=Y,W._titleHeight=q):(Z.lineHeight=j,Z.height=Math.max(q,16)+3,Z.width=Y)}function P(O){var G=0,W=0,X=O.title.side;return X&&(X.indexOf("left")!==-1&&(G=O._titleWidth),X.indexOf("top")!==-1&&(W=O._titleHeight)),[G,W]}function z(O,G,W,X,Z){var J=O._fullLayout,N=x.getId(X);X||(X=J[N]);var H=J._size,$=x.isVertical(X),U=x.isGrouped(X),V=X.entrywidthmode==="fraction",j=X.borderwidth,q=2*j,Y=d.itemGap,K=X.indentation+X.itemwidth+Y*2,te=2*(j+Y),ne=B(X),se=X.y<0||X.y===0&&ne==="top",le=X.y>1||X.y===1&&ne==="bottom",ce=X.tracegroupgap,pe={};let{orientation:xe,yref:ye}=X,{maxheight:fe}=X,ae=se||le||xe!=="v"||ye!=="paper";fe||(fe=ae?.5:1);let ee=ae?J.height:H.h;X._maxHeight=Math.max(fe>1?fe:fe*ee,30);var ie=0;X._width=0,X._height=0;var Q=P(X);if($)W.each(function(Ue){var at=Ue[0].height;n.setTranslate(this,j+Q[0],j+Q[1]+X._height+at/2+Y),X._height+=at,X._width=Math.max(X._width,Ue[0].width)}),ie=K+X._width,X._width+=Y+K+q,X._height+=te,U&&(G.each(function(Ue,at){n.setTranslate(this,0,at*X.tracegroupgap)}),X._height+=(X._lgroupsLength-1)*X.tracegroupgap);else{var ue=L(X),ge=X.x<0||X.x===0&&ue==="right",Me=X.x>1||X.x===1&&ue==="left",Te=le||se,je=J.width/2;X._maxWidth=Math.max(ge?Te&&ue==="left"?H.l+H.w:je:Me?Te&&ue==="right"?H.r+H.w:je:H.w,2*K);var Ve=0,Ke=0;W.each(function(Ue){var at=k(Ue,X,K);Ve=Math.max(Ve,at),Ke+=at}),ie=null;var Je=0;if(U){var vt=0,xt=0,Pt=0;G.each(function(){var Ue=0,at=0;t.select(this).selectAll("g.traces").each(function(ht){var At=k(ht,X,K),dt=ht[0].height;n.setTranslate(this,Q[0],Q[1]+j+Y+dt/2+at),at+=dt,Ue=Math.max(Ue,At),pe[ht[0].trace.legendgroup]=Ue});var rt=Ue+Y;xt>0&&rt+j+xt>X._maxWidth?(Je=Math.max(Je,xt),xt=0,Pt+=vt+ce,vt=at):vt=Math.max(vt,at),n.setTranslate(this,xt,Pt),xt+=rt}),X._width=Math.max(Je,xt)+j,X._height=Pt+vt+te}else{var mt=W.size(),Mt=Ke+q+(mt-1)*Y=X._maxWidth&&(Je=Math.max(Je,me),qe=0,Ye+=lt,X._height+=lt,lt=0),n.setTranslate(this,Q[0]+j+qe,Q[1]+j+Ye+at/2+Y),me=qe+rt+Y,qe+=ht,lt=Math.max(lt,at)}),Mt?(X._width=qe+q,X._height=lt+te):(X._width=Math.max(Je,me)+q,X._height+=lt+te)}}X._width=Math.ceil(Math.max(X._width+Q[0],X._titleWidth+2*(j+d.titlePad))),X._height=Math.ceil(Math.max(X._height+Q[1],X._titleHeight+2*(j+d.itemGap))),X._effHeight=Math.min(X._height,X._maxHeight);var _e=O._context.edits,Ae=_e.legendText||_e.legendPosition;W.each(function(Ue){var at=t.select(this).select("."+N+"toggle"),rt=Ue[0].height,ht=Ue[0].trace.legendgroup,At=k(Ue,X,K);U&&ht!==""&&(At=pe[ht]);var dt=Ae?K:ie||At;!$&&!V&&(dt+=Y/2),n.setRect(at,0,-rt/2,dt,rt)});var ke=Z.select("."+N+"titletext");ke.node()&&C(ke,X,j);var Ee=Z.select("."+N+"titletoggle");if(Ee.size()&&ke.node()){var De=ke.attr("x")||0,Qe=d.titlePad;n.setRect(Ee,De-Qe,j,X._titleWidth+2*Qe,X._titleHeight+2*Qe)}}function I(O,G,W,X){var Z=O._fullLayout,J=Z[G],N=L(J),H=B(J),$=J.xref==="paper",U=J.yref==="paper";O._fullLayout._reservedMargin[G]={};var V=J.y<.5?"b":"t",j=J.x<.5?"l":"r",q={r:Z.width-W,l:W+J._width,b:Z.height-X,t:X+J._effHeight};if($&&U)return a.autoMargin(O,G,{x:J.x,y:J.y,l:J._width*m[N],r:J._width*y[N],b:J._effHeight*y[H],t:J._effHeight*m[H]});$?O._fullLayout._reservedMargin[G][V]=q[V]:U||J.orientation==="v"?O._fullLayout._reservedMargin[G][j]=q[j]:O._fullLayout._reservedMargin[G][V]=q[V]}function L(O){return i.isRightAnchor(O)?"right":i.isCenterAnchor(O)?"center":"left"}function B(O){return i.isBottomAnchor(O)?"bottom":i.isMiddleAnchor(O)?"middle":"top"}}}),NE=de({"src/components/fx/hover.js"(e){"use strict";var r=Yr(),t=da(),i=Qt(),a=i.pushUnique,o=i.strTranslate,s=i.strRotate,l=c1(),n=Zo(),u=_q(),c=hn(),f=ta(),h=Uc(),d=nn(),p=zl().zindexSeparator,g=Sa(),m=sf(),y=Ta(),_=IE(),v=OE(),x=y.YANGLE,S=Math.PI*x/180,M=1/Math.sin(S),C=Math.cos(S),w=Math.sin(S),k=y.HOVERARROWSIZE,A=y.HOVERTEXTPAD,b={box:!0,ohlc:!0,violin:!0,candlestick:!0},E={scatter:!0,scattergl:!0,splom:!0};function T(j,q){return j.distance-q.distance}e.hover=function(q,Y,K,te){q=i.getGraphDiv(q);var ne=Y.target;i.throttle(q._fullLayout._uid+y.HOVERID,y.HOVERMINTIME,function(){F(q,Y,K,te,ne)})},e.loneHover=function(q,Y){var K=!0;Array.isArray(q)||(K=!1,q=[q]);var te=Y.gd,ne=$(te),se=U(te),le=q.map(function(Q){var ue=Q._x0||Q.x0||Q.x||0,ge=Q._x1||Q.x1||Q.x||0,Me=Q._y0||Q.y0||Q.y||0,Te=Q._y1||Q.y1||Q.y||0,je=Q.eventData;if(je){var Ve=Math.min(ue,ge),Ke=Math.max(ue,ge),Je=Math.min(Me,Te),vt=Math.max(Me,Te),xt=Q.trace;if(g.traceIs(xt,"gl3d")){var Pt=te._fullLayout[xt.scene]._scene.container,mt=Pt.offsetLeft,Mt=Pt.offsetTop;Ve+=mt,Ke+=mt,Je+=Mt,vt+=Mt}je.bbox={x0:Ve+se,x1:Ke+se,y0:Je+ne,y1:vt+ne},je.xPixel=(ue+ge)/2,je.yPixel=(Me+Te)/2,Y.inOut_bbox&&Y.inOut_bbox.push(je.bbox)}else je=!1;return{color:Q.color||f.defaultLine,x0:Q.x0||Q.x||0,x1:Q.x1||Q.x||0,y0:Q.y0||Q.y||0,y1:Q.y1||Q.y||0,xLabel:Q.xLabel,yLabel:Q.yLabel,zLabel:Q.zLabel,text:Q.text,name:Q.name,idealAlign:Q.idealAlign,borderColor:Q.borderColor,fontFamily:Q.fontFamily,fontSize:Q.fontSize,fontColor:Q.fontColor,fontWeight:Q.fontWeight,fontStyle:Q.fontStyle,fontVariant:Q.fontVariant,nameLength:Q.nameLength,textAlign:Q.textAlign,trace:Q.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Q.hovertemplate||!1,hovertemplateLabels:Q.hovertemplateLabels||!1,eventData:je}}),ce=!1,pe=P(le,{gd:te,hovermode:"closest",rotateLabels:ce,bgColor:Y.bgColor||f.background,container:r.select(Y.container),outerContainer:Y.outerContainer||Y.container}),xe=pe.hoverLabels,ye=5,fe=0,ae=0;xe.sort(function(Q,ue){return Q.y0-ue.y0}).each(function(Q,ue){var ge=Q.y0-Q.by/2;ge-yeKe[0]._length||kt<0||kt>Je[0]._length)return h.unhoverRaw(j,q)}if(q.pointerX=yt+Ke[0]._offset,q.pointerY=kt+Je[0]._offset,"xval"in q?Ye=m.flat(ne,q.xval):Ye=m.p2c(Ke,yt),"yval"in q?me=m.flat(ne,q.yval):me=m.p2c(Je,kt),j._hoverPointerX=q.pointerX,j._hoverPointerY=q.pointerY,!t(Ye[0])||!t(me[0]))return i.warn("Fx.hover failed",q,j),h.unhoverRaw(j,q)}le.clickanywhere&&(j._hoverXVals=Ye,j._hoverYVals=me,j._hoverXAxes=Ke,j._hoverYAxes=Je);var $t=1/0;function mr(Li,In){for(Ae=0;AeAt&&(lt.splice(0,At),$t=lt[0].distance),ye&&Mt!==0&<.length===0){ht.distance=Mt,ht.index=!1;var Mn=Ee._module.hoverPoints(ht,at,rt,"closest",{hoverLayer:le._hoverlayer});if(Mn&&(Mn=Mn.filter(function(on){return on.spikeDistance<=Mt})),Mn&&Mn.length){var Kn,zn=Mn.filter(function(on){return on.xa.showspikes&&on.xa.spikesnap!=="hovered data"});if(zn.length){var ua=zn[0];t(ua.x0)&&t(ua.y0)&&(Kn=Er(ua),(!dt.vLinePoint||dt.vLinePoint.spikeDistance>Kn.spikeDistance)&&(dt.vLinePoint=Kn))}var Ea=Mn.filter(function(on){return on.ya.showspikes&&on.ya.spikesnap!=="hovered data"});if(Ea.length){var ln=Ea[0];t(ln.x0)&&t(ln.y0)&&(Kn=Er(ln),(!dt.hLinePoint||dt.hLinePoint.spikeDistance>Kn.spikeDistance)&&(dt.hLinePoint=Kn))}}}}}mr();function br(Li,In,pn){for(var Ka=null,Rn=1/0,tn,Mn=0;MnLi.trace.index===Ua.trace.index):lt=[Ua];var dn=lt.length,pi=H("x",Ua,le),Jr=H("y",Ua,le);mr(pi,Jr);var Be=[],Fe={},Et=0,St=function(Li){var In=b[Li.trace.type]?D(Li):Li.trace.index;if(!Fe[In])Et++,Fe[In]=Et,Be.push(Li);else{var pn=Fe[In]-1,Ka=Be[pn];pn>0&&Math.abs(Li.distance)dn-1;zt--)St(lt[zt]);lt=Be,oi()}var Wt=j._hoverdata,Yt=[],ze=$(j),tt=U(j);for(let Li of lt){var ft=m.makeEventData(Li,Li.trace,Li.cd);if(Li.hovertemplate!==!1){var wt=!1;Li.cd[Li.index]&&Li.cd[Li.index].ht&&(wt=Li.cd[Li.index].ht),Li.hovertemplate=wt||Li.trace.hovertemplate||!1}if(Li.xa&&Li.ya){var jt=Li.x0+Li.xa._offset,It=Li.x1+Li.xa._offset,Kt=Li.y0+Li.ya._offset,qt=Li.y1+Li.ya._offset,vr=Math.min(jt,It),Br=Math.max(jt,It),Pr=Math.min(Kt,qt),Mi=Math.max(Kt,qt);ft.bbox={x0:vr+tt,x1:Br+tt,y0:Pr+ze,y1:Mi+ze},ft.xPixel=(jt+It)/2,ft.yPixel=(Kt+qt)/2}Li.eventData=[ft],Yt.push(ft)}j._hoverdata=Yt;var gi=fe==="y"&&(qe.length>1||lt.length>1)||fe==="closest"&&Ht&<.length>1,ba=f.combine(le.plot_bgcolor||f.background,le.paper_bgcolor),Hi=P(lt,{gd:j,hovermode:fe,rotateLabels:gi,bgColor:ba,container:le._hoverlayer,outerContainer:le._paper.node(),commonLabelOpts:le.hoverlabel,hoverdistance:le.hoverdistance}),Za=Hi.hoverLabels;if(m.isUnifiedHover(fe)||(I(Za,gi,le,Hi.commonLabelBoundingBox),O(Za,gi,le._invScaleX,le._invScaleY)),te&&te.tagName){var oa=g.getComponentMethod("annotations","hasClickToShow")(j,Yt);u(r.select(te),oa?"pointer":"")}var Cn=X(j,q,Wt);if(!te||K||!Cn&&!le.hoveranywhere)return;Wt&&Cn&&j.emit("plotly_unhover",{event:q,points:Wt}),_n(j._hoverdata);function _n(Li){j.emit("plotly_hover",{event:q,points:Li,xaxes:Ke,yaxes:Je,xvals:m.c2dApply(Ke,Ye),yvals:m.c2dApply(Je,me),xPixel:q.pointerX,yPixel:q.pointerY})}}function D(j){return[j.trace.index,j.index,j.x0,j.y0,j.name,j.attr,j.xa?j.xa._id:"",j.ya?j.ya._id:""].join(",")}var R=/([\s\S]*)<\/extra>/;function P(j,q){var Y=q.gd,K=Y._fullLayout,te=q.hovermode,ne=q.rotateLabels,se=q.bgColor,le=q.container,ce=q.outerContainer,pe=q.commonLabelOpts||{};if(j.length===0)return[[]];var xe=q.fontFamily||y.HOVERFONT,ye=q.fontSize||y.HOVERFONTSIZE,fe=q.fontWeight||K.font.weight,ae=q.fontStyle||K.font.style,ee=q.fontVariant||K.font.variant,ie=q.fontTextcase||K.font.textcase,Q=q.fontLineposition||K.font.lineposition,ue=q.fontShadow||K.font.shadow,ge=j[0],Me=ge.xa,Te=ge.ya,je=te.charAt(0),Ve=je+"Label",Ke=ge[Ve];if(Ke===void 0&&Me.type==="multicategory")for(var Je=0;JeK.width-Yt&&(ze=K.width-Yt),bi.attr("d","M"+(St-ze)+",0L"+(St-ze+k)+","+Wt+k+"H"+Yt+"v"+Wt+(A*2+Et.height)+"H"+-Yt+"V"+Wt+k+"H"+(St-ze-k)+"Z"),St=ze,Ae.minX=St-Yt,Ae.maxX=St+Yt,Me.side==="top"?(Ae.minY=zt-(A*2+Et.height),Ae.maxY=zt-A):(Ae.minY=zt+A,Ae.maxY=zt+(A*2+Et.height))}else{var tt,ft,wt;Te.side==="right"?(tt="start",ft=1,wt="",St=Me._offset+Me._length):(tt="end",ft=-1,wt="-",St=Me._offset),zt=Te._offset+(ge.y0+ge.y1)/2,Ua.attr("text-anchor",tt),bi.attr("d","M0,0L"+wt+k+","+k+"V"+(A+Et.height/2)+"h"+wt+(A*2+Et.width)+"V-"+(A+Et.height/2)+"H"+wt+k+"V-"+k+"Z"),Ae.minY=zt-(A+Et.height/2),Ae.maxY=zt+(A+Et.height/2),Te.side==="right"?(Ae.minX=St+k,Ae.maxX=St+k+(A*2+Et.width)):(Ae.minX=St-k-(A*2+Et.width),Ae.maxX=St-k);var jt=Et.height/2,It=xt-Et.top-jt,Kt="clip"+K._uid+"commonlabel"+Te._id,qt;if(Stbi.hoverinfo!=="none");if(xi.length===0)return[];var ke=K.hoverlabel,Ee=ke.font,De=xi[0],Qe=((te==="x unified"?De.xa:De.ya).unifiedhovertitle||{}).text,Ue=Qe?i.hovertemplateString({data:te==="x unified"?[{xa:De.xa,x:De.xVal}]:[{ya:De.ya,y:De.yVal}],fallback:De.trace.hovertemplatefallback,locale:K._d3locale,template:Qe}):Ke,at={showlegend:!0,legend:{title:{text:Ue,font:Ee},font:Ee,bgcolor:ke.bgcolor,bordercolor:ke.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:K.legend?K.legend.traceorder:void 0,orientation:"v"}},rt={font:Ee};_(at,rt,Y._fullData);var ht=rt.legend;ht.entries=[];for(var At=0;At=0?ja=oi:Qr+Ct=0?ja=Qr:ea+Ct=0?ya=Ur:Ai+$t=0?ya=Ai:$i+$t=0,(xi.idealAlign==="top"||!Pr)&&Mi?(wt-=It/2,xi.anchor="end"):Pr?(wt+=It/2,xi.anchor="start"):xi.anchor="middle",xi.crossPos=wt;else{if(xi.pos=wt,Pr=ft+jt/2+Br<=Pt,Mi=ft-jt/2-Br>=0,(xi.idealAlign==="left"||!Pr)&&Mi)ft-=jt/2,xi.anchor="end";else if(Pr)ft+=jt/2,xi.anchor="start";else{xi.anchor="middle";var gi=Br/2,ba=ft+gi-Pt,Hi=ft-gi;ba>0&&(ft-=ba),Hi<0&&(ft+=-Hi)}xi.crossPos=ft}zt.attr("text-anchor",xi.anchor),Yt&&Wt.attr("text-anchor",xi.anchor),bi.attr("transform",o(ft,wt)+(ne?s(x):""))}),{hoverLabels:pa,commonLabelBoundingBox:Ae}}function z(j,q,Y,K,te,ne){var se,le,ce="",pe="";j.nameOverride!==void 0&&(j.name=j.nameOverride),j.name&&(j.trace._meta&&(j.name=i.templateString(j.name,j.trace._meta)),ce=J(j.name,j.nameLength));var xe=Y.charAt(0),ye=xe==="x"?"y":"x";j.zLabel!==void 0?(j.xLabel!==void 0&&(pe+="x: "+j.xLabel+"
"),j.yLabel!==void 0&&(pe+="y: "+j.yLabel+"
"),j.trace.type!=="choropleth"&&j.trace.type!=="choroplethmap"&&(pe+=(pe?"z: ":"")+j.zLabel)):q&&j[xe+"Label"]===te?pe=j[ye+"Label"]||"":j.xLabel===void 0?j.yLabel!==void 0&&j.trace.type!=="scattercarpet"&&(pe=j.yLabel):j.yLabel===void 0?pe=j.xLabel:pe="("+j.xLabel+", "+j.yLabel+")",(j.text||j.text===0)&&!Array.isArray(j.text)&&(pe+=(pe?"
":"")+j.text),j.extraText!==void 0&&(pe+=(pe?"
":"")+j.extraText),ne&&pe===""&&!j.hovertemplate&&(ce===""&&ne.remove(),pe=ce),(le=(se=j.trace)==null?void 0:se.hoverlabel)!=null&&le.split&&(j.hovertemplate="");let{hovertemplate:fe=!1}=j;if(fe){let ae=j.hovertemplateLabels||j;j[xe+"Label"]!==te&&(ae[xe+"other"]=ae[xe+"Val"],ae[xe+"otherLabel"]=ae[xe+"Label"]),pe=i.hovertemplateString({data:[j.eventData[0]||{},j.trace._meta],fallback:j.trace.hovertemplatefallback,labels:ae,locale:K._d3locale,template:fe}),pe=pe.replace(R,(ee,ie)=>(ce=J(ie,j.nameLength),""))}return[pe,ce]}function I(j,q,Y,K){var te=q?"xa":"ya",ne=q?"ya":"xa",se=0,le=1,ce=j.size(),pe=new Array(ce),xe=0,ye=K.minX,fe=K.maxX,ae=K.minY,ee=K.maxY,ie=function(Ye){return Ye*Y._invScaleX},Q=function(Ye){return Ye*Y._invScaleY};j.each(function(Ye){var me=Ye[te],_e=Ye[ne],Ae=me._id.charAt(0)==="x",ke=me.range;xe===0&&ke&&ke[0]>ke[1]!==Ae&&(le=-1);var Ee=0,De=Ae?Y.width:Y.height;if(Y.hovermode==="x"||Y.hovermode==="y"){var Qe=L(Ye,q),Ue=Ye.anchor,at=Ue==="end"?-1:1,rt,ht;if(Ue==="middle")rt=Ye.crossPos+(Ae?Q(Qe.y-Ye.by/2):ie(Ye.bx/2+Ye.tx2width/2)),ht=rt+(Ae?Q(Ye.by):ie(Ye.bx));else if(Ae)rt=Ye.crossPos+Q(k+Qe.y)-Q(Ye.by/2-k),ht=rt+Q(Ye.by);else{var At=ie(at*k+Qe.x),dt=At+ie(at*Ye.bx);rt=Ye.crossPos+Math.min(At,dt),ht=Ye.crossPos+Math.max(At,dt)}Ae?ae!==void 0&&ee!==void 0&&Math.min(ht,ee)-Math.max(rt,ae)>1&&(_e.side==="left"?(Ee=_e._mainLinePosition,De=Y.width):De=_e._mainLinePosition):ye!==void 0&&fe!==void 0&&Math.min(ht,fe)-Math.max(rt,ye)>1&&(_e.side==="top"?(Ee=_e._mainLinePosition,De=Y.height):De=_e._mainLinePosition)}pe[xe++]=[{datum:Ye,traceIndex:Ye.trace.index,dp:0,pos:Ye.pos,posref:Ye.posref,size:Ye.by*(Ae?M:1)/2,pmin:Ee,pmax:De}]}),pe.sort(function(Ye,me){return Ye[0].posref-me[0].posref||le*(me[0].traceIndex-Ye[0].traceIndex)});var ue,ge,Me,Te,je,Ve,Ke;function Je(Ye){var me=Ye[0],_e=Ye[Ye.length-1];if(ge=me.pmin-me.pos-me.dp+me.size,Me=_e.pos+_e.dp+_e.size-me.pmax,ge>.01){for(je=Ye.length-1;je>=0;je--)Ye[je].dp+=ge;ue=!1}if(!(Me<.01)){if(ge<-.01){for(je=Ye.length-1;je>=0;je--)Ye[je].dp-=Me;ue=!1}if(ue){var Ae=0;for(Te=0;Teme.pmax&&Ae++;for(Te=Ye.length-1;Te>=0&&!(Ae<=0);Te--)Ve=Ye[Te],Ve.pos>me.pmax-1&&(Ve.del=!0,Ae--);for(Te=0;Te=0;je--)Ye[je].dp-=Me;for(Te=Ye.length-1;Te>=0&&!(Ae<=0);Te--)Ve=Ye[Te],Ve.pos+Ve.dp+Ve.size>me.pmax&&(Ve.del=!0,Ae--)}}}for(;!ue&&se<=ce;){for(se++,ue=!0,Te=0;Te.01){for(je=xt.length-1;je>=0;je--)xt[je].dp+=ge;for(vt.push.apply(vt,xt),pe.splice(Te+1,1),Ke=0,je=vt.length-1;je>=0;je--)Ke+=vt[je].dp;for(Me=Ke/vt.length,je=vt.length-1;je>=0;je--)vt[je].dp-=Me;ue=!1}else Te++}pe.forEach(Je)}for(Te=pe.length-1;Te>=0;Te--){var Mt=pe[Te];for(je=Mt.length-1;je>=0;je--){var lt=Mt[je],qe=lt.datum;qe.offset=lt.dp,qe.del=lt.del}}}function L(j,q){var Y=0,K=j.offset;return q&&(K*=-w,Y=j.offset*C),{x:Y,y:K}}function B(j){var q={start:1,end:-1,middle:0}[j.anchor],Y=q*(k+A),K=Y+q*(j.txwidth+A),te=j.anchor==="middle";return te&&(Y-=j.tx2width/2,K+=j.txwidth/2+A),{alignShift:q,textShiftX:Y,text2ShiftX:K}}function O(j,q,Y,K){var te=function(se){return se*Y},ne=function(se){return se*K};j.each(function(se){var le=r.select(this);if(se.del)return le.remove();var ce=le.select("text.nums"),pe=se.anchor,xe=pe==="end"?-1:1,ye=B(se),fe=L(se,q),ae=fe.x,ee=fe.y,ie=pe==="middle",Q="hoverlabel"in se.trace?se.trace.hoverlabel.showarrow:!0,ue;ie?ue="M-"+te(se.bx/2+se.tx2width/2)+","+ne(ee-se.by/2)+"h"+te(se.bx)+"v"+ne(se.by)+"h-"+te(se.bx)+"Z":Q?ue="M0,0L"+te(xe*k+ae)+","+ne(k+ee)+"v"+ne(se.by/2-k)+"h"+te(xe*se.bx)+"v-"+ne(se.by)+"H"+te(xe*k+ae)+"V"+ne(ee-k)+"Z":ue="M"+te(xe*k+ae)+","+ne(ee-se.by/2)+"h"+te(xe*se.bx)+"v"+ne(se.by)+"h"+te(-xe*se.bx)+"Z",le.select("path").attr("d",ue);var ge=ae+ye.textShiftX,Me=ee+se.ty0-se.by/2+A,Te=se.textAlign||"auto";Te!=="auto"&&(Te==="left"&&pe!=="start"?(ce.attr("text-anchor","start"),ge=ie?-se.bx/2-se.tx2width/2+A:-se.bx-A):Te==="right"&&pe!=="end"&&(ce.attr("text-anchor","end"),ge=ie?se.bx/2-se.tx2width/2-A:se.bx+A)),ce.call(n.positionText,te(ge),ne(Me)),se.tx2width&&(le.select("text.name").call(n.positionText,te(ye.text2ShiftX+ye.alignShift*A+ae),ne(ee+se.ty0-se.by/2+A)),le.select("rect").call(c.setRect,te(ye.text2ShiftX+(ye.alignShift-1)*se.tx2width/2+ae),ne(ee-se.by/2-1),te(se.tx2width),ne(se.by+2)))})}function G(j,q){var Y=j.index,K=j.trace||{},te=j.cd[0],ne=j.cd[Y]||{};function se(fe){return fe||t(fe)&&fe===0}var le=Array.isArray(Y)?function(fe,ae){var ee=i.castOption(te,Y,fe);return se(ee)?ee:i.extractOption({},K,"",ae)}:function(fe,ae){return i.extractOption(ne,K,fe,ae)};function ce(fe,ae,ee){var ie=le(ae,ee);se(ie)&&(j[fe]=ie)}if(ce("hoverinfo","hi","hoverinfo"),ce("bgcolor","hbg","hoverlabel.bgcolor"),ce("borderColor","hbc","hoverlabel.bordercolor"),ce("fontFamily","htf","hoverlabel.font.family"),ce("fontSize","hts","hoverlabel.font.size"),ce("fontColor","htc","hoverlabel.font.color"),ce("fontWeight","htw","hoverlabel.font.weight"),ce("fontStyle","hty","hoverlabel.font.style"),ce("fontVariant","htv","hoverlabel.font.variant"),ce("nameLength","hnl","hoverlabel.namelength"),ce("textAlign","hta","hoverlabel.align"),j.posref=q==="y"||q==="closest"&&K.orientation==="h"?j.xa._offset+(j.x0+j.x1)/2:j.ya._offset+(j.y0+j.y1)/2,j.x0=i.constrain(j.x0,0,j.xa._length),j.x1=i.constrain(j.x1,0,j.xa._length),j.y0=i.constrain(j.y0,0,j.ya._length),j.y1=i.constrain(j.y1,0,j.ya._length),j.xLabelVal!==void 0&&(j.xLabel="xLabel"in j?j.xLabel:d.hoverLabelText(j.xa,j.xLabelVal,K.xhoverformat),j.xVal=j.xa.c2d(j.xLabelVal)),j.yLabelVal!==void 0&&(j.yLabel="yLabel"in j?j.yLabel:d.hoverLabelText(j.ya,j.yLabelVal,K.yhoverformat),j.yVal=j.ya.c2d(j.yLabelVal)),j.zLabelVal!==void 0&&j.zLabel===void 0&&(j.zLabel=String(j.zLabelVal)),!isNaN(j.xerr)&&!(j.xa.type==="log"&&j.xerr<=0)){var pe=d.tickText(j.xa,j.xa.c2l(j.xerr),"hover").text;j.xerrneg!==void 0?j.xLabel+=" +"+pe+" / -"+d.tickText(j.xa,j.xa.c2l(j.xerrneg),"hover").text:j.xLabel+=" \xB1 "+pe,q==="x"&&(j.distance+=1)}if(!isNaN(j.yerr)&&!(j.ya.type==="log"&&j.yerr<=0)){var xe=d.tickText(j.ya,j.ya.c2l(j.yerr),"hover").text;j.yerrneg!==void 0?j.yLabel+=" +"+xe+" / -"+d.tickText(j.ya,j.ya.c2l(j.yerrneg),"hover").text:j.yLabel+=" \xB1 "+xe,q==="y"&&(j.distance+=1)}var ye=j.hoverinfo||j.trace.hoverinfo;return ye&&ye!=="all"&&(ye=Array.isArray(ye)?ye:ye.split("+"),ye.indexOf("x")===-1&&(j.xLabel=void 0),ye.indexOf("y")===-1&&(j.yLabel=void 0),ye.indexOf("z")===-1&&(j.zLabel=void 0),ye.indexOf("text")===-1&&(j.text=void 0),ye.indexOf("name")===-1&&(j.name=void 0)),j}function W(j,q,Y){var K=Y.container,te=Y.fullLayout,ne=te._size,se=Y.event,le=!!q.hLinePoint,ce=!!q.vLinePoint,pe,xe;if(K.selectAll(".spikeline").remove(),!!(ce||le)){var ye=f.combine(te.plot_bgcolor,te.paper_bgcolor);if(le){var fe=q.hLinePoint,ae,ee;pe=fe&&fe.xa,xe=fe&&fe.ya;var ie=xe.spikesnap;ie==="cursor"?(ae=se.pointerX,ee=se.pointerY):(ae=pe._offset+fe.x,ee=xe._offset+fe.y);var Q=f.wcagContrast(fe.color,ye)<1.5?f.contrast(ye):fe.color,ue=xe.spikemode,ge=xe.spikethickness,Me=xe.spikecolor||Q,Te=d.getPxPosition(j,xe),je,Ve;if(ue.indexOf("toaxis")!==-1||ue.indexOf("across")!==-1){if(ue.indexOf("toaxis")!==-1&&(je=Te,Ve=ae),ue.indexOf("across")!==-1){var Ke=xe._counterDomainMin,Je=xe._counterDomainMax;xe.anchor==="free"&&(Ke=Math.min(Ke,xe.position),Je=Math.max(Je,xe.position)),je=ne.l+Ke*ne.w,Ve=ne.l+Je*ne.w}K.insert("line",":first-child").attr({x1:je,x2:Ve,y1:ee,y2:ee,"stroke-width":ge,stroke:Me,"stroke-dasharray":c.dashStyle(xe.spikedash,ge)}).classed("spikeline",!0).classed("crisp",!0),K.insert("line",":first-child").attr({x1:je,x2:Ve,y1:ee,y2:ee,"stroke-width":ge+2,stroke:ye}).classed("spikeline",!0).classed("crisp",!0)}ue.indexOf("marker")!==-1&&K.insert("circle",":first-child").attr({cx:Te+(xe.side!=="right"?ge:-ge),cy:ee,r:ge,fill:Me}).classed("spikeline",!0)}if(ce){var vt=q.vLinePoint,xt,Pt;pe=vt&&vt.xa,xe=vt&&vt.ya;var mt=pe.spikesnap;mt==="cursor"?(xt=se.pointerX,Pt=se.pointerY):(xt=pe._offset+vt.x,Pt=xe._offset+vt.y);var Mt=f.wcagContrast(vt.color,ye)<1.5?f.contrast(ye):vt.color,lt=pe.spikemode,qe=pe.spikethickness,Ye=pe.spikecolor||Mt,me=d.getPxPosition(j,pe),_e,Ae;if(lt.indexOf("toaxis")!==-1||lt.indexOf("across")!==-1){if(lt.indexOf("toaxis")!==-1&&(_e=me,Ae=Pt),lt.indexOf("across")!==-1){var ke=pe._counterDomainMin,Ee=pe._counterDomainMax;pe.anchor==="free"&&(ke=Math.min(ke,pe.position),Ee=Math.max(Ee,pe.position)),_e=ne.t+(1-Ee)*ne.h,Ae=ne.t+(1-ke)*ne.h}K.insert("line",":first-child").attr({x1:xt,x2:xt,y1:_e,y2:Ae,"stroke-width":qe,stroke:Ye,"stroke-dasharray":c.dashStyle(pe.spikedash,qe)}).classed("spikeline",!0).classed("crisp",!0),K.insert("line",":first-child").attr({x1:xt,x2:xt,y1:_e,y2:Ae,"stroke-width":qe+2,stroke:ye}).classed("spikeline",!0).classed("crisp",!0)}lt.indexOf("marker")!==-1&&K.insert("circle",":first-child").attr({cx:xt,cy:me-(pe.side!=="top"?qe:-qe),r:qe,fill:Ye}).classed("spikeline",!0)}}}function X(j,q,Y){if(!Y||Y.length!==j._hoverdata.length)return!0;for(var K=Y.length-1;K>=0;K--){var te=Y[K],ne=j._hoverdata[K];if(te.curveNumber!==ne.curveNumber||String(te.pointNumber)!==String(ne.pointNumber)||String(te.pointNumbers)!==String(ne.pointNumbers)||te.binNumber!==ne.binNumber)return!0}return!1}function Z(j,q){return!q||q.vLinePoint!==j._spikepoints.vLinePoint||q.hLinePoint!==j._spikepoints.hLinePoint}function J(j,q){return n.plainText(j||"",{len:q,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function N(j,q){for(var Y=q.charAt(0),K=[],te=[],ne=[],se=0;sej.offsetTop+j.clientTop,U=j=>j.offsetLeft+j.clientLeft;function V(j,q){var Y=j._fullLayout,K=q.getBoundingClientRect(),te=K.left,ne=K.top,se=te+K.width,le=ne+K.height,ce=i.apply3DTransform(Y._invTransform)(te,ne),pe=i.apply3DTransform(Y._invTransform)(se,le),xe=ce[0],ye=ce[1],fe=pe[0],ae=pe[1];return{x:xe,y:ye,width:fe-xe,height:ae-ye,top:Math.min(ye,ae),left:Math.min(xe,fe),right:Math.max(xe,fe),bottom:Math.max(ye,ae)}}}}),ky=de({"src/components/fx/hoverlabel_defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=sf().isUnifiedHover;r.exports=function(s,l,n,u){u=u||{};var c=l.legend;function f(h){u.font[h]||(u.font[h]=c?l.legend.font[h]:l.font[h])}l&&a(l.hovermode)&&(u.font||(u.font={}),f("size"),f("family"),f("color"),f("weight"),f("style"),f("variant"),c?(u.bgcolor||(u.bgcolor=i.combine(l.legend.bgcolor,l.paper_bgcolor)),u.bordercolor||(u.bordercolor=l.legend.bordercolor)):u.bgcolor||(u.bgcolor=l.paper_bgcolor)),n("hoverlabel.bgcolor",u.bgcolor),n("hoverlabel.bordercolor",u.bordercolor),n("hoverlabel.namelength",u.namelength),n("hoverlabel.showarrow",u.showarrow),t.coerceFont(n,"hoverlabel.font",u.font),n("hoverlabel.align",u.align)}}}),wq=de({"src/components/fx/layout_global_defaults.js"(e,r){"use strict";var t=Qt(),i=ky(),a=La();r.exports=function(s,l){function n(u,c){return t.coerce(s,l,a,u,c)}i(s,l,n)}}}),Tq=de({"src/components/fx/defaults.js"(e,r){"use strict";var t=Qt(),i=ki(),a=ky();r.exports=function(s,l,n,u){function c(h,d){return t.coerce(s,l,i,h,d)}var f=t.extendFlat({},u.hoverlabel);l.hovertemplate&&(f.namelength=-1),a(s,l,c,f)}}}),jE=de({"src/components/fx/hovermode_defaults.js"(e,r){"use strict";var t=Qt(),i=La();r.exports=function(o,s){function l(n,u){return s[n]!==void 0?s[n]:t.coerce(o,s,i,n,u)}return l("clickmode"),l("hoversubplots"),l("hoveranywhere"),l("clickanywhere"),l("hovermode")}}}),Aq=de({"src/components/fx/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=La(),a=jE(),o=ky();r.exports=function(l,n){function u(g,m){return t.coerce(l,n,i,g,m)}var c=a(l,n);c&&(u("hoverdistance"),u("spikedistance"),c.indexOf("unified")!==-1&&u("hoversort"));var f=u("dragmode");f==="select"&&u("selectdirection");var h=n._has("map"),d=n._has("geo"),p=n._basePlotModules.length;n.dragmode==="zoom"&&((h||d)&&p===1||h&&d&&p===2)&&(n.dragmode="pan"),o(l,n,u),t.coerceFont(u,"hoverlabel.grouptitlefont",n.hoverlabel.font)}}}),Mq=de({"src/components/fx/calc.js"(e,r){"use strict";var t=Qt(),i=Sa();r.exports=function(s){var l=s.calcdata,n=s._fullLayout;function u(p){return function(g){return t.coerceHoverinfo({hoverinfo:g},{_module:p._module},n)}}for(var c=0;c"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),Ew=de({"src/components/shapes/draw_newshape/constants.js"(e,r){"use strict";var t=32;r.exports={CIRCLE_SIDES:t,i000:0,i090:t/4,i180:t/2,i270:t/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),kw=de({"src/components/selections/helpers.js"(e,r){"use strict";var t=Qt().strTranslate;function i(l,n){switch(l.type){case"log":return l.p2d(n);case"date":return l.p2r(n,0,l.calendar);default:return l.p2r(n)}}function a(l,n){switch(l.type){case"log":return l.d2p(n);case"date":return l.r2p(n,0,l.calendar);default:return l.r2p(n)}}function o(l){var n=l._id.charAt(0)==="y"?1:0;return function(u){return i(l,u[n])}}function s(l){return t(l.xaxis._offset,l.yaxis._offset)}r.exports={p2r:i,r2p:a,axValue:o,getTransform:s}}}),m0=de({"src/components/shapes/draw_newshape/helpers.js"(e){"use strict";var r=DE(),t=Ew(),i=t.CIRCLE_SIDES,a=t.SQRT2,o=kw(),s=o.p2r,l=o.r2p,n=[0,3,4,5,6,1,2],u=[0,3,4,1,2];e.writePaths=function(h){var d=h.length;if(!d)return"M0,0Z";for(var p="",g=0;g0&&x{let d=h.charAt(0),p=c[d].drawn!==void 0;return f+(p?1:0)},0)},e.getDataToPixel=function(s,l,n,u,c){var f=s._fullLayout._size,h;if(l)if(c==="domain")h=function(p){return l._length*(u?1-p:p)+l._offset};else{var d=e.shapePositionToRange(l);h=function(p){var g=o(l,n);return l._offset+l.r2p(d(p,!0))+g},l.type==="date"&&(h=e.decodeDate(h))}else u?h=function(p){return f.t+f.h*(1-p)}:h=function(p){return f.l+f.w*p};return h},e.getPixelToData=function(s,l,n,u){var c=s._fullLayout._size,f;if(l)if(u==="domain")f=function(d){var p=(d-l._offset)/l._length;return n?1-p:p};else{var h=e.rangeToShapePosition(l);f=function(d){return h(l.p2r(d-l._offset))}}else n?f=function(d){return 1-(d-c.t)/c.h}:f=function(d){return(d-c.l)/c.w};return f},e.roundPositionForSharpStrokeRendering=function(s,l){var n=Math.round(l%2)===1,u=Math.round(s);return n?u+.5:u},e.makeShapesOptionsAndPlotinfo=function(s,l){var n=s._fullLayout.shapes[l]||{},u=s._fullLayout._plots[n.xref+n.yref],c=!!u;return c?u._hadPlotinfo=!0:(u={},n.xref&&n.xref!=="paper"&&(u.xaxis=s._fullLayout[n.xref+"axis"]),n.yref&&n.yref!=="paper"&&(u.yaxis=s._fullLayout[n.yref+"axis"])),u.xsizemode=n.xsizemode,u.ysizemode=n.ysizemode,u.xanchor=n.xanchor,u.yanchor=n.yanchor,{options:n,plotinfo:u}},e.makeSelectionsOptionsAndPlotinfo=function(s,l){var n=s._fullLayout.selections[l]||{},u=s._fullLayout._plots[n.xref+n.yref],c=!!u;return c?u._hadPlotinfo=!0:(u={},n.xref&&(u.xaxis=s._fullLayout[n.xref+"axis"]),n.yref&&(u.yaxis=s._fullLayout[n.yref+"axis"])),{options:n,plotinfo:u}},e.getPathString=function(s,l){let n=l.type,u=i.getRefType(l.xref),c=i.getRefType(l.yref),f=s._fullLayout._size;var h,d,p,g,m,y,_,v,x,S,M,C;function w(R,P,z,I){var L;if(R)if(P==="domain")I?L=function(B){return R._offset+R._length*(1-B)}:L=function(B){return R._offset+R._length*B};else{let B=e.shapePositionToRange(R);L=function(O){return R._offset+R.r2p(B(O,!0))},z==="path"&&R.type==="date"&&(L=e.decodeDate(L))}else I?L=function(B){return f.t+f.h*(1-B)}:L=function(B){return f.l+f.w*B};return L}if(u==="array"?(_=[],h=l.xref.map(function(R){return i.getFromId(s,R)}),_=l.xref.map(function(R,P){return w(h[P],i.getRefType(R),n,!1)})):(h=i.getFromId(s,l.xref),_=w(h,u,n,!1)),c==="array"?(v=[],d=l.yref.map(function(R){return i.getFromId(s,R)}),v=l.yref.map(function(R,P){return w(d[P],i.getRefType(R),n,!0)})):(d=i.getFromId(s,l.yref),v=w(d,c,n,!0)),n==="path")return a(l,_,v);if(u==="array")p=o(h[0],l.x0shift),g=o(h[1],l.x1shift),x=_[0](l.x0)+p,S=_[1](l.x1)+g;else if(p=o(h,l.x0shift),g=o(h,l.x1shift),l.xsizemode==="pixel"){let R=_(l.xanchor);x=R+l.x0+p,S=R+l.x1+g}else x=_(l.x0)+p,S=_(l.x1)+g;if(c==="array")m=o(d[0],l.y0shift),y=o(d[1],l.y1shift),M=v[0](l.y0)+m,C=v[1](l.y1)+y;else if(m=o(d,l.y0shift),y=o(d,l.y1shift),l.ysizemode==="pixel"){let R=v(l.yanchor);M=R-l.y0+m,C=R-l.y1+y}else M=v(l.y0)+m,C=v(l.y1)+y;if(n==="line")return"M"+x+","+M+"L"+S+","+C;if(n==="rect")return"M"+x+","+M+"H"+S+"V"+C+"H"+x+"Z";var k=(x+S)/2,A=(M+C)/2,b=Math.abs(k-x),E=Math.abs(A-M),T="A"+b+","+E,F=k+b+","+A,D=k+","+(A-E);return"M"+F+T+" 0 1,1 "+D+T+" 0 0,1 "+F+"Z"};function a(s,l,n){let u=s.path,c=s.xsizemode,f=s.ysizemode,h=s.xanchor,d=s.yanchor,p=Array.isArray(s.xref),g=Array.isArray(s.yref);var m=0,y=0;return u.replace(r.segmentRE,function(_){var v=0,x=_.charAt(0),S=r.paramIsX[x],M=r.paramIsY[x],C=r.numParams[x];let w=S.drawn!==void 0,k=M.drawn!==void 0,A=p?l[m]:l,b=g?n[y]:n;var E=_.slice(1).replace(r.paramRE,function(T){return S[v]?c==="pixel"?T=A(h)+Number(T):T=A(T):M[v]&&(f==="pixel"?T=b(d)-Number(T):T=b(T)),v++,v>C&&(T="X"),T});return v>C&&(E=E.replace(/[\s,]*X.*/,""),t.log("Ignoring extra params in segment "+_)),w&&m++,k&&y++,x+E})}e.getPixelShift=o;function o(s,l){l=l||0;var n=0;return l&&s&&(s.type==="category"||s.type==="multicategory")&&(n=(s.r2p(1)-s.r2p(0))*l),n}}}),qE=de({"src/components/shapes/display_labels.js"(e,r){"use strict";var t=Qt(),i=nn(),a=Zo(),o=hn(),s=m0().readPaths,l=g0(),n=l.getPathString,u=_w(),c=Bl().FROM_TL;r.exports=function(p,g,m,y){if(y.selectAll(".shape-label").remove(),!!(m.label.text||m.label.texttemplate)){var _;if(m.label.texttemplate){var v={};if(m.type!=="path"){var x=i.getFromId(p,m.xref),S=i.getFromId(p,m.yref);let q=Array.isArray(m.xref),Y=Array.isArray(m.yref);for(var M in u){var C=typeof u[M]=="function",w=!q||u.simpleXVariables.includes(M),k=!Y||u.simpleYVariables.includes(M);if(C&&w&&k){var A=u[M](m,x,S);A!==void 0&&(v[M]=A)}}}_=t.texttemplateStringForShapes({data:[v],fallback:m.label.texttemplatefallback,locale:p._fullLayout._d3locale,template:m.label.texttemplate})}else _=m.label.text;var b={"data-index":g},E=m.label.font,T={"data-notex":1},F=y.append("g").attr(b).classed("shape-label",!0),D=F.append("text").attr(T).classed("shape-label-text",!0).text(_),R,P,z,I;if(m.path){var L=n(p,m),B=s(L,p);R=1/0,z=1/0,P=-1/0,I=-1/0;for(var O=0;Ol.getDataToPixel(p,ie,ee,!1,Q)(ae),fe=(ae,ee,ie,Q)=>l.getDataToPixel(p,ie,ee,!0,Q)(ae);if(m.xsizemode==="pixel"){let ae=ye(m.xanchor,void 0,K,le),ee=l.getPixelShift(K,m.x0shift),ie=l.getPixelShift(K,m.x1shift);R=ae+m.x0+ee,P=ae+m.x1+ie}else R=ye(m.x0,m.x0shift,K,le),P=ye(m.x1,m.x1shift,te,ce);if(m.ysizemode==="pixel"){let ae=fe(m.yanchor,void 0,ne,pe),ee=l.getPixelShift(ne,m.y0shift),ie=l.getPixelShift(ne,m.y1shift);z=ae-m.y0+ee,I=ae-m.y1+ie}else z=fe(m.y0,m.y0shift,ne,pe),I=fe(m.y1,m.y1shift,se,xe)}var N=m.label.textangle;N==="auto"&&(m.type==="line"?N=f(R,z,P,I):N=0),D.call(function(q){return q.call(o.font,E).attr({}),a.convertToTspans(q,p),q});var H=o.bBox(D.node()),$=h(R,z,P,I,m,N,H),U=$.textx,V=$.texty,j=$.xanchor;D.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[j],y:V,x:U,transform:"rotate("+N+","+U+","+V+")"}).call(a.positionText,U,V)}};function f(d,p,g,m){var y,_;return _=Math.abs(g-d),g>=d?y=p-m:y=m-p,-180/Math.PI*Math.atan2(y,_)}function h(d,p,g,m,y,_,v){var x=y.label.textposition,S=y.label.textangle,M=y.label.padding,C=y.type,w=Math.PI/180*_,k=Math.sin(w),A=Math.cos(w),b=y.label.xanchor,E=y.label.yanchor,T,F,D,R;if(C==="line"){x==="start"?(T=d,F=p):x==="end"?(T=g,F=m):(T=(d+g)/2,F=(p+m)/2),b==="auto"&&(x==="start"?S==="auto"?g>d?b="left":gd?b="right":gd?b="right":gd?b="left":g1&&!(fe.length===2&&fe[1][0]==="Z")&&(N===0&&(fe[0][0]="M"),T[J]=fe,z(),I())}}function te(fe,ae){if(fe===2){J=+ae.srcElement.getAttribute("data-i"),N=+ae.srcElement.getAttribute("data-j");var ee=T[J];!_(ee)&&!v(ee)&&K()}}function ne(fe){X=[];for(var ae=0;ae{if(!D._dragging&&D._fullLayout.hoveranywhere){let B=I(L);B&&p.hover(D,B,P.id)}}),z.addEventListener("click",L=>{if(!D._dragged&&D._fullLayout.clickanywhere){let B=I(L);B&&p.click(D,B,P.id)}})}function w(D,R,P){let z=P.xref,I=P.yref;if(Array.isArray(z)||Array.isArray(I)){let L="clip"+R._fullLayout._uid+"shape"+P._index,B=k(R,z,I);a.ensureSingleById(R._fullLayout._clips,"clipPath",L,function(O){O.append("rect")}).select("rect").attr(B),f.setClipUrl(D,L,R)}else{let L=(z+I).replace(/paper/g,"").replace(/[xyz][0-9]* *domain/g,"");f.setClipUrl(D,L?"clip"+R._fullLayout._uid+L:null,R)}}function k(D,R,P){let z=D._fullLayout._size;function I(O,G){let W=(Array.isArray(O)?O:[O]).map(J=>o.getFromId(D,J)).filter(Boolean);if(!W.length)return G?[z.t,z.t+z.h]:[z.l,z.l+z.w];let X=W.map(function(J){return J._offset}),Z=W.map(function(J){return J._offset+J._length});return[Math.min(...X),Math.max(...Z)]}let L=I(R,!1),B=I(P,!0);return{x:L[0],y:B[0],width:L[1]-L[0],height:B[1]-B[0]}}function A(D,R,P,z,I,L){var B=10,O=10,G=P.xsizemode==="pixel",W=P.ysizemode==="pixel",X=P.type==="line",Z=P.type==="path",J=L.modifyItem,N,H,$,U,V,j,q,Y,K,te,ne,se,le,ce,pe,xe=t.select(R.node().parentNode),ye=o.getFromId(D,P.xref),fe=o.getRefType(P.xref),ae=o.getFromId(D,P.yref),ee=o.getRefType(P.yref),ie=P.x0shift,Q=P.x1shift,ue=P.y0shift,ge=P.y1shift,Me=function(Ee,De){var Qe=y.getDataToPixel(D,ye,De,!1,fe);return Qe(Ee)},Te=function(Ee,De){var Qe=y.getDataToPixel(D,ae,De,!0,ee);return Qe(Ee)},je=y.getPixelToData(D,ye,!1,fe),Ve=y.getPixelToData(D,ae,!0,ee),Ke=xt(),Je={element:Ke.node(),gd:D,prepFn:Mt,doneFn:lt,clickFn:qe},vt;d.init(Je),Ke.node().onmousemove=mt;function xt(){return X?Pt():R}function Pt(){var Ee=10,De=Math.max(P.line.width,Ee),Qe=I.append("g").attr("data-index",z).attr("drag-helper",!0);Qe.append("path").attr("d",R.attr("d")).style({cursor:"move","stroke-width":De,"stroke-opacity":"0"});var Ue={"fill-opacity":"0"},at=Math.max(De/2,Ee);return Qe.append("circle").attr({"data-line-point":"start-point",cx:G?Me(P.xanchor)+P.x0:Me(P.x0,ie),cy:W?Te(P.yanchor)-P.y0:Te(P.y0,ue),r:at}).style(Ue).classed("cursor-grab",!0),Qe.append("circle").attr({"data-line-point":"end-point",cx:G?Me(P.xanchor)+P.x1:Me(P.x1,Q),cy:W?Te(P.yanchor)-P.y1:Te(P.y1,ge),r:at}).style(Ue).classed("cursor-grab",!0),Qe}function mt(Ee){if(x(D)){vt=null;return}if(X)Ee.target.tagName==="path"?vt="move":vt=Ee.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var De=Je.element.getBoundingClientRect(),Qe=De.right-De.left,Ue=De.bottom-De.top,at=Ee.clientX-De.left,rt=Ee.clientY-De.top,ht=!Z&&Qe>B&&Ue>O&&!Ee.shiftKey?d.getCursor(at/Qe,1-rt/Ue):"move";g(R,ht),vt=ht.split("-")[0]}}function Mt(Ee){x(D)||(G&&(V=Me(P.xanchor)),W&&(j=Te(P.yanchor)),P.type==="path"?pe=P.path:(N=G?P.x0:Me(P.x0),H=W?P.y0:Te(P.y0),$=G?P.x1:Me(P.x1),U=W?P.y1:Te(P.y1)),N<$?(K=N,le="x0",te=$,ce="x1"):(K=$,le="x1",te=N,ce="x0"),!W&&HU?(q=H,ne="y0",Y=U,se="y1"):(q=U,ne="y1",Y=H,se="y0"),mt(Ee),_e(I,P),ke(R,P,D),Je.moveFn=vt==="move"?Ye:me,Je.altKey=Ee.altKey)}function lt(){x(D)||(g(R),Ae(I),w(R,D,P),i.call("_guiRelayout",D,L.getUpdateObj()))}function qe(){x(D)||Ae(I)}function Ye(Ee,De){if(P.type==="path"){var Qe=function(rt){return rt},Ue=Qe,at=Qe;G?J("xanchor",P.xanchor=je(V+Ee)):(Ue=function(ht){return je(Me(ht)+Ee)},ye&&ye.type==="date"&&(Ue=y.encodeDate(Ue))),W?J("yanchor",P.yanchor=Ve(j+De)):(at=function(ht){return Ve(Te(ht)+De)},ae&&ae.type==="date"&&(at=y.encodeDate(at))),J("path",P.path=b(pe,Ue,at))}else G?J("xanchor",P.xanchor=je(V+Ee)):(J("x0",P.x0=je(N+Ee)),J("x1",P.x1=je($+Ee))),W?J("yanchor",P.yanchor=Ve(j+De)):(J("y0",P.y0=Ve(H+De)),J("y1",P.y1=Ve(U+De)));R.attr("d",_(D,P)),_e(I,P),n(D,z,P,xe)}function me(Ee,De){if(Z){var Qe=function(br){return br},Ue=Qe,at=Qe;G?J("xanchor",P.xanchor=je(V+Ee)):(Ue=function(Er){return je(Me(Er)+Ee)},ye&&ye.type==="date"&&(Ue=y.encodeDate(Ue))),W?J("yanchor",P.yanchor=Ve(j+De)):(at=function(Er){return Ve(Te(Er)+De)},ae&&ae.type==="date"&&(at=y.encodeDate(at))),J("path",P.path=b(pe,Ue,at))}else if(X){if(vt==="resize-over-start-point"){var rt=N+Ee,ht=W?H-De:H+De;J("x0",P.x0=G?rt:je(rt)),J("y0",P.y0=W?ht:Ve(ht))}else if(vt==="resize-over-end-point"){var At=$+Ee,dt=W?U-De:U+De;J("x1",P.x1=G?At:je(At)),J("y1",P.y1=W?dt:Ve(dt))}}else{var Ht=function(br){return vt.indexOf(br)!==-1},fr=Ht("n"),gt=Ht("s"),yt=Ht("w"),kt=Ht("e"),Lt=fr?q+De:q,Ct=gt?Y+De:Y,$t=yt?K+Ee:K,mr=kt?te+Ee:te;W&&(fr&&(Lt=q-De),gt&&(Ct=Y-De)),(!W&&Ct-Lt>O||W&&Lt-Ct>O)&&(J(ne,P[ne]=W?Lt:Ve(Lt)),J(se,P[se]=W?Ct:Ve(Ct))),mr-$t>B&&(J(le,P[le]=G?$t:je($t)),J(ce,P[ce]=G?mr:je(mr)))}R.attr("d",_(D,P)),_e(I,P),n(D,z,P,xe)}function _e(Ee,De){(G||W)&&Qe();function Qe(){var Ue=De.type!=="path",at=Ee.selectAll(".visual-cue").data([0]),rt=1;at.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":rt}).classed("visual-cue",!0);var ht=Me(G?De.xanchor:a.midRange(Ue?[De.x0,De.x1]:y.extractPathCoords(De.path,m.paramIsX))),At=Te(W?De.yanchor:a.midRange(Ue?[De.y0,De.y1]:y.extractPathCoords(De.path,m.paramIsY)));if(ht=y.roundPositionForSharpStrokeRendering(ht,rt),At=y.roundPositionForSharpStrokeRendering(At,rt),G&&W){var dt="M"+(ht-1-rt)+","+(At-1-rt)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";at.attr("d",dt)}else if(G){var Ht="M"+(ht-1-rt)+","+(At-9-rt)+"v18 h2 v-18 Z";at.attr("d",Ht)}else{var fr="M"+(ht-9-rt)+","+(At-1-rt)+"h18 v2 h-18 Z";at.attr("d",fr)}}}function Ae(Ee){Ee.selectAll(".visual-cue").remove()}function ke(Ee,De,Qe){var Ue=De.xref,at=De.yref,rt=o.getFromId(Qe,Ue),ht=o.getFromId(Qe,at),At="";Ue!=="paper"&&!rt.autorange&&(At+=Ue),at!=="paper"&&!ht.autorange&&(At+=at),f.setClipUrl(Ee,At?"clip"+Qe._fullLayout._uid+At:null,Qe)}}function b(D,R,P){return D.replace(m.segmentRE,function(z){var I=0,L=z.charAt(0),B=m.paramIsX[L],O=m.paramIsY[L],G=m.numParams[L],W=z.slice(1).replace(m.paramRE,function(X){return I>=G||(B[I]?X=R(X):O[I]&&(X=P(X)),I++),X});return L+W})}function E(D,R){if(S(D)){var P=R.node(),z=+P.getAttribute("data-index");if(z>=0){if(z===D._fullLayout._activeShapeIndex){T(D);return}D._fullLayout._activeShapeIndex=z,D._fullLayout._deactivateShape=T,v(D)}}}function T(D){if(S(D)){var R=D._fullLayout._activeShapeIndex;R>=0&&(u(D),delete D._fullLayout._activeShapeIndex,v(D))}}function F(D){if(S(D)){u(D);var R=D._fullLayout._activeShapeIndex,P=(D.layout||{}).shapes||[];if(R{let h=a(l),d=n.append("div").classed("plotly-cloud-dialog-box",!0);if(d.append("div").classed("plotly-cloud-dialog-title",!0).text(h.DIALOG_TITLE),u===i.plotlyServerURL){let g=d.append("div").classed("plotly-cloud-dialog-message",!0),m=new URL(u).origin,y=h.DIALOG_MESSAGE_CLOUD.split(/(\{|\})/),_=y[0],v=y[2],x=y[4];g.append("span").text(_),g.append("a").classed("plotly-cloud-dialog-message--hostname",!0).attr("href",m).attr("target","_blank").text(v),g.append("span").text(x),g.append("div").classed("plotly-cloud-dialog-message--account",!0).text(h.DIALOG_MESSAGE_CLOUD_ACCOUNT)}else{let g=new URL(u),m=g.hostname,y=g.origin,_=h.DIALOG_MESSAGE_OTHER.split(/(\{|\})/),v=_[0],x=_[4],S=d.append("div").classed("plotly-cloud-dialog-message",!0);S.append("span").text(v),S.append("a").classed("plotly-cloud-dialog-message--hostname",!0).attr("href",y).attr("target","_blank").text(m),S.append("span").text(x)}let p=d.append("div").classed("plotly-cloud-dialog-buttons",!0);p.append("button").classed("plotly-cloud-dialog-btn",!0).classed("plotly-cloud-dialog-btn--cancel",!0).text(h.DIALOG_CANCEL).on("click",f),p.append("button").classed("plotly-cloud-dialog-btn",!0).classed("plotly-cloud-dialog-btn--confirm",!0).text(h.DIALOG_CONFIRM).on("click",c)},s=(l,n,u)=>{let c=t.select(l._fullLayout._paperdiv.node());c.selectAll(".plotly-cloud-dialog").remove();let f=c.append("div").classed("plotly-cloud-dialog",!0),h=()=>{f.remove(),document.removeEventListener("keydown",d)},d=p=>{(p.key==="Escape"||p.keyCode===27)&&h()};document.addEventListener("keydown",d),f.on("click",()=>{t.event.target===f.node()&&h()}),o(l,f,n,()=>{h(),u()},h)};r.exports=s}}),VE=de({"src/components/modebar/buttons.js"(e,r){"use strict";var t=Sa(),i=ks(),a=Hs(),o=Sw(),s=Lw().eraseActiveShape,l=kq(),n=Qt(),u=n._,c=r.exports={};c.toImage={name:"toImage",title:function(w){var k=w._context.toImageButtonOptions||{},A=k.format||"png";return A==="png"?u(w,"Download plot as a PNG"):u(w,"Download plot")},icon:o.camera,click:function(w){var k=w._context.toImageButtonOptions,A={format:k.format||"png"};n.notifier(u(w,"Preparing image - this may take a few seconds"),"long",w),["filename","width","height","scale"].forEach(function(b){b in k&&(A[b]=k[b])}),t.call("downloadImage",w,A).then(function(b){n.notifier(u(w,"Image download succeeded")+" - "+b,"long",w)}).catch(function(){n.notifier(u(w,"Sorry, there was a problem downloading your image!"),"long",w)})}},c.downloadJson={name:"downloadJson",title:function(w){return u(w,"Download plot as JSON")},icon:o.curlybraces,click:function(w){t.call("downloadImage",w,{format:"full-json"}).then(function(k){n.notifier(u(w,"JSON download succeeded")+" - "+k,"long",w)}).catch(function(){n.notifier(u(w,"Sorry, there was a problem downloading your JSON file!"),"long",w)})}},c.sendChartToCloud={name:"sendChartToCloud",title:function(w){return u(w,"Share chart...")},icon:o.cloudupload,click:function(w){var k=(window.PLOTLYENV||{}).BASE_URL||w._context.plotlyServerURL;if(!k){console.error("No destination URL provided (plotlyServerURL is empty)");return}var A;try{A=new URL(k)}catch{console.error("Invalid plotlyServerURL: "+k);return}let b=["http:","https:"];if(!b.includes(A.protocol)){console.error(`Invalid protocol '${A.protocol}' in plotlyServerURL '${k}'. Must be one of: ${b.join(", ")}`);return}l(w,k,function(){i.sendDataToCloud(w,k)})}},c.zoom2d={name:"zoom2d",_cat:"zoom",title:function(w){return u(w,"Zoom")},attr:"dragmode",val:"zoom",icon:o.zoombox,click:f},c.pan2d={name:"pan2d",_cat:"pan",title:function(w){return u(w,"Pan")},attr:"dragmode",val:"pan",icon:o.pan,click:f},c.select2d={name:"select2d",_cat:"select",title:function(w){return u(w,"Box Select")},attr:"dragmode",val:"select",icon:o.selectbox,click:f},c.lasso2d={name:"lasso2d",_cat:"lasso",title:function(w){return u(w,"Lasso Select")},attr:"dragmode",val:"lasso",icon:o.lasso,click:f},c.drawclosedpath={name:"drawclosedpath",title:function(w){return u(w,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:o.drawclosedpath,click:f},c.drawopenpath={name:"drawopenpath",title:function(w){return u(w,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:o.drawopenpath,click:f},c.drawline={name:"drawline",title:function(w){return u(w,"Draw line")},attr:"dragmode",val:"drawline",icon:o.drawline,click:f},c.drawrect={name:"drawrect",title:function(w){return u(w,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:o.drawrect,click:f},c.drawcircle={name:"drawcircle",title:function(w){return u(w,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:o.drawcircle,click:f},c.eraseshape={name:"eraseshape",title:function(w){return u(w,"Erase active shape")},icon:o.eraseshape,click:s},c.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(w){return u(w,"Zoom in")},attr:"zoom",val:"in",icon:o.zoom_plus,click:f},c.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(w){return u(w,"Zoom out")},attr:"zoom",val:"out",icon:o.zoom_minus,click:f},c.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(w){return u(w,"Autoscale")},attr:"zoom",val:"auto",icon:o.autoscale,click:f},c.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(w){return u(w,"Reset axes")},attr:"zoom",val:"reset",icon:o.home,click:f},c.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(w){return u(w,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:o.tooltip_basic,gravity:"ne",click:f},c.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(w){return u(w,"Compare data on hover")},attr:"hovermode",val:function(w){return w._fullLayout._isHoriz?"y":"x"},icon:o.tooltip_compare,gravity:"ne",click:f};function f(w,k){var A=k.currentTarget,b=A.getAttribute("data-attr"),E=A.getAttribute("data-val")||!0,T=w._fullLayout,F={},D=a.list(w,null,!0),R=T._cartesianSpikesEnabled,P,z;if(b==="zoom"){var I=E==="in"?.5:2,L=(1+I)/2,B=(1-I)/2,O,G;for(z=0;z-$),[G,W]=I.invert(z.midPt),{minscale:X}=P.projection,Z=(A=P.projection.maxscale)!=null?A:1/0,J=Math.min(X,Z),N=Math.max(X,Z),H=T==="in"?m*L:1/m*L;H>N?H=N:H$E});var Pw,HE,$E,WE=Ir({"src/components/modebar/attributes.ts"(){"use strict";Pw=Vr(GE()),HE={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar",description:"Sets the orientation of the modebar."},bgcolor:{valType:"color",editType:"modebar",description:"Sets the background color of the modebar."},color:{valType:"color",editType:"modebar",description:"Sets the color of the icons in the modebar."},activecolor:{valType:"color",editType:"modebar",description:"Sets the color of the active or hovered on icons in the modebar."},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes related to the modebar,","including `hovermode`, `dragmode`, and `showspikes` at both the","root level and inside subplots. Defaults to `layout.uirevision`."].join(" ")},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to add.","Please note that these buttons will only be shown if they are","compatible with all trace types used in a graph.","Similar to `config.modeBarButtonsToAdd` option.",`This may include *${Pw.default.backButtons.join("*, *")}*.`].join(" ")},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to remove.","Similar to `config.modeBarButtonsToRemove` option.",`This may include *${Pw.default.foreButtons.join("*, *")}*.`].join(" ")}},$E=HE}}),Cq=de({"src/components/modebar/defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=Ro(),o=(WE(),ti(Fw)).default;r.exports=function(l,n){var u=l.modebar||{},c=a.newContainer(n,"modebar");function f(d,p){return t.coerce(u,c,o,d,p)}f("orientation"),f("bgcolor",i.addOpacity(n.paper_bgcolor,.5));var h=i.contrast(i.rgb(n.modebar.bgcolor));f("color",i.addOpacity(h,.3)),f("activecolor",i.addOpacity(h,.7)),f("uirevision",n.uirevision),f("add"),f("remove")}}}),Dq=de({"src/components/modebar/modebar.js"(e,r){"use strict";var t=Yr(),i=da(),a=Qt(),o=Sw(),s=_i().version,l=new DOMParser;function n(h){this.container=h.container,this.element=document.createElement("div"),this.update(h.graphInfo,h.buttons),this.container.appendChild(this.element)}var u=n.prototype;u.update=function(h,d){this.graphInfo=h;var p=this.graphInfo._context,g=this.graphInfo._fullLayout,m="modebar-"+g._uid;this.element.setAttribute("id",m),this.element.setAttribute("role","toolbar"),this._uid=m,this.element.className="modebar modebar--custom",p.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),g.modebar.orientation==="v"&&(this.element.className+=" vertical",d=d.reverse());var y=g.modebar,_="#"+m+" .modebar-group";document.querySelectorAll(_).forEach(function(C){C.style.backgroundColor=y.bgcolor});var v=!this.hasButtons(d),x=this.hasLogo!==p.displaylogo,S=this.locale!==p.locale;if(this.locale=p.locale,(v||x||S)&&(this.removeAllButtons(),this.updateButtons(d),p.watermark||p.displaylogo)){var M=this.getLogo();p.watermark&&(M.className=M.className+" watermark"),g.modebar.orientation==="v"?this.element.insertBefore(M,this.element.childNodes[0]):this.element.appendChild(M),this.hasLogo=!0}this.updateActiveButton(),a.setStyleOnHover("#"+m+" .modebar-btn",".active",".icon path","fill: "+y.activecolor,"fill: "+y.color,this.element)},u.updateButtons=function(h){var d=this;this.buttons=h,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(p){var g=d.createGroup();p.forEach(function(m){var y=m.name;if(!y)throw new Error("must provide button 'name' in button config");if(d.buttonsNames.indexOf(y)!==-1)throw new Error("button name '"+y+"' is taken");d.buttonsNames.push(y);var _=d.createButton(m);d.buttonElements.push(_),g.appendChild(_)}),d.element.appendChild(g)})},u.createGroup=function(){var h=document.createElement("div");h.className="modebar-group";var d=this.graphInfo._fullLayout.modebar;return h.style.backgroundColor=d.bgcolor,h},u.createButton=function(h){var d=this,p=document.createElement("button");p.setAttribute("type","button"),p.setAttribute("rel","tooltip"),p.className="modebar-btn";var g=h.title;g===void 0?g=h.name:typeof g=="function"&&(g=g(this.graphInfo)),(g||g===0)&&(p.setAttribute("data-title",g),p.setAttribute("aria-label",g)),h.attr!==void 0&&p.setAttribute("data-attr",h.attr);var m=h.val;m!==void 0&&(typeof m=="function"&&(m=m(this.graphInfo)),p.setAttribute("data-val",m));var y=h.click;if(typeof y!="function")throw new Error("must provide button 'click' function in button config");p.addEventListener("click",function(v){h.click(d.graphInfo,v),d.updateActiveButton(v.currentTarget)}),p.setAttribute("data-toggle",h.toggle||!1),h.toggle&&t.select(p).classed("active",!0);var _=h.icon;return typeof _=="function"?p.appendChild(_()):p.appendChild(this.createIcon(_||o.question)),p.setAttribute("data-gravity",h.gravity||"n"),p},u.createIcon=function(h){var d=i(h.height)?Number(h.height):h.ascent-h.descent,p="http://www.w3.org/2000/svg",g;if(h.path){g=document.createElementNS(p,"svg"),g.setAttribute("viewBox",[0,0,h.width,d].join(" ")),g.setAttribute("class","icon");var m=document.createElementNS(p,"path");m.setAttribute("d",h.path),h.transform?m.setAttribute("transform",h.transform):h.ascent!==void 0&&m.setAttribute("transform","matrix(1 0 0 -1 0 "+h.ascent+")"),g.appendChild(m)}if(h.svg){var y=l.parseFromString(h.svg,"application/xml");g=y.childNodes[0]}return g.setAttribute("height","1em"),g.setAttribute("width","1em"),g},u.updateActiveButton=function(h){var d=this.graphInfo._fullLayout,p=h!==void 0?h.getAttribute("data-attr"):null;this.buttonElements.forEach(function(g){var m=g.getAttribute("data-val")||!0,y=g.getAttribute("data-attr"),_=g.getAttribute("data-toggle")==="true",v=t.select(g),x=function(C,w){var k=d.modebar,A=C.querySelector(".icon path");A&&(w||C.matches(":hover")?A.style.fill=k.activecolor:A.style.fill=k.color)};if(_){if(y===p){var S=!v.classed("active");v.classed("active",S),x(g,S)}}else{var M=y===null?y:a.nestedProperty(d,y).get();v.classed("active",M===m),x(g,M===m)}})},u.hasButtons=function(h){var d=this.buttons;if(!d||h.length!==d.length)return!1;for(var p=0;p1?(X=["toggleHover"],Z=["resetViews"]):b?(W=["zoomInGeo","zoomOutGeo"],X=["hoverClosestGeo"],Z=["resetGeo"]):A?(X=["hoverClosest3d"],Z=["resetCameraDefault3d","resetCameraLastSave3d"]):D?(W=["zoomInMap","zoomOutMap"],X=["toggleHover"],Z=["resetViewMap"]):E?X=["hoverClosestPie"]:z?(X=["hoverClosestCartesian","hoverCompareCartesian"],Z=["resetViewSankey"]):X=["toggleHover"],k&&X.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(d(_)||L)&&(X=[]),k&&!I&&(W=["zoomIn2d","zoomOut2d","autoScale2d"],Z[0]!=="resetViews"&&(Z=["resetScale2d"])),A?J=["zoom3d","pan3d","orbitRotation","tableRotation"]:k&&!I||F?J=["zoom2d","pan2d"]:D||b?J=["pan2d"]:R&&(J=["zoom2d"]),h(_)&&J.push("select2d","lasso2d");var N=[],H=function(q){N.indexOf(q)===-1&&X.indexOf(q)!==-1&&N.push(q)};if(Array.isArray(C)){for(var $=[],U=0;US?_.slice(S):v.slice(x))+M}function p(m,y){for(var _=y._size,v=_.h/_.w,x={},S=Object.keys(m),M=0;Ml*F&&!z)){for(S=0;SN&&KZ&&(Z=K);var ne=(Z-X)/(2*J);b/=ne,X=w.l2r(X),Z=w.l2r(Z),w.range=w._input.range=O=I[1]||G[1]<=I[0])&&W[0]L[0])return!0}return!1}function M(I){var L=I._fullLayout,B=L._size,O=B.p,G=f.list(I,"",!0),W,X,Z,J,N,H;if(L._paperdiv.style({width:I._context.responsive&&L.autosize&&!I._context._hasZeroWidth&&!I.layout.width?"100%":L.width+"px",height:I._context.responsive&&L.autosize&&!I._context._hasZeroHeight&&!I.layout.height?"100%":L.height+"px"}).selectAll(".main-svg").call(n.setSize,L.width,L.height),I._context.setBackground(I,L.paper_bgcolor),e.drawMainTitle(I),c.manage(I),!L._has("cartesian"))return i.previousPromises(I);function $(me,_e,Ae){var ke=me._lw/2;if(me._id.charAt(0)==="x"){if(_e){if(Ae==="top")return _e._offset-O-ke}else return B.t+B.h*(1-(me.position||0))+ke%1;return _e._offset+_e._length+O+ke}if(_e){if(Ae==="right")return _e._offset+_e._length+O+ke}else return B.l+B.w*(me.position||0)+ke%1;return _e._offset-O-ke}for(W=0;W0){T(I,W,N,J),Z.attr({x:X,y:W,"text-anchor":O,dy:R(L.yanchor)}).call(o.positionText,X,W);var H=(L.text.match(o.BR_TAG_ALL)||[]).length;if(H){var $=h.LINE_SPACING*H+h.MID_SHIFT;L.y===0&&($=-$),Z.selectAll(".line").each(function(){var Y=+this.getAttribute("dy").slice(0,-2)-$+"em";this.setAttribute("dy",Y)})}var U=r.select(I).selectAll(".gtitle-subtitle");if(U.node()){var V=Z.node().getBBox(),j=V.y+V.height,q=j+u.SUBTITLE_PADDING_EM*L.subtitle.font.size;U.attr({x:X,y:q,"text-anchor":O,dy:R(L.yanchor)}).call(o.positionText,X,q)}}}};function A(I,L,B,O,G){var W=L.yref==="paper"?I._fullLayout._size.h:I._fullLayout.height,X=a.isTopAnchor(L)?O:O-G,Z=B==="b"?W-X:X;return a.isTopAnchor(L)&&B==="t"||a.isBottomAnchor(L)&&B==="b"?!1:Z.5?"t":"b",X=I._fullLayout.margin[W],Z=0;return L.yref==="paper"?Z=B+L.pad.t+L.pad.b:L.yref==="container"&&(Z=b(W,O,G,I._fullLayout.height,B)+L.pad.t+L.pad.b),Z>X?Z:0}function T(I,L,B,O){var G="title.automargin",W=I._fullLayout.title,X=W.y>.5?"t":"b",Z={x:W.x,y:W.y,t:0,b:0},J={};W.yref==="paper"&&A(I,W,X,L,O)?Z[X]=B:W.yref==="container"&&(J[X]=B,I._fullLayout._reservedMargin[G]=J),i.allowAutoMargin(I,G),i.autoMargin(I,G,Z)}function F(I,L){var B=I.title,O=I._size,G=0;return L===y?G=B.pad.l:L===v&&(G=-B.pad.r),B.xref==="paper"?O.l+O.w*B.x+G:I.width*B.x+G}function D(I,L){var B=I.title,O=I._size,G=0;return L==="0em"||!L?G=-B.pad.b:L===h.CAP_SHIFT+"em"&&(G=B.pad.t),B.y==="auto"?O.t/2:B.yref==="paper"?O.t+O.h-O.h*B.y+G:I.height-I.height*B.y+G}function R(I){return I==="top"?h.CAP_SHIFT+.3+"em":I==="bottom"?"-0.3em":h.MID_SHIFT+"em"}function P(I){var L=I.title,B=_;return a.isRightAnchor(L)?B=v:a.isLeftAnchor(L)&&(B=y),B}function z(I){var L=I.title,B="0em";return a.isTopAnchor(L)?B=h.CAP_SHIFT+"em":a.isMiddleAnchor(L)&&(B=h.MID_SHIFT+"em"),B}e.doTraceStyle=function(I){var L=I.calcdata,B=[],O;for(O=0;O=0;P--){var z=C.append("path").attr(k).style("opacity",P?.1:A).call(o.stroke,E).call(o.fill,b).call(s.dashLine,P?"solid":F,P?4+T:T);if(d(z,y,x),D){var I=l(y.layout,"selections",x);z.style({cursor:"move"});var L={element:z.node(),plotinfo:S,gd:y,editHelpers:I,isActiveSelection:!0},B=t(w,y);i(B,z,L)}else z.style("pointer-events",P?"all":"none");R[P]=z}var O=R[0],G=R[1];G.node().addEventListener("click",function(){return p(y,O)})}}function d(y,_,v){var x=v.xref+v.yref;s.setClipUrl(y,"clip"+_._fullLayout._uid+x,_)}function p(y,_){if(f(y)){var v=_.node(),x=+v.getAttribute("data-index");if(x>=0){if(x===y._fullLayout._activeSelectionIndex){m(y);return}y._fullLayout._activeSelectionIndex=x,y._fullLayout._deactivateSelection=m,c(y)}}}function g(y){if(f(y)){var _=y._fullLayout.selections.length-1;y._fullLayout._activeSelectionIndex=_,y._fullLayout._deactivateSelection=m,c(y)}}function m(y){if(f(y)){var _=y._fullLayout._activeSelectionIndex;_>=0&&(a(y),delete y._fullLayout._activeSelectionIndex,c(y))}}}}),Fq=de({"node_modules/polybooljs/lib/build-log.js"(e,r){function t(){var i,a=0,o=!1;function s(l,n){return i.list.push({type:l,data:n?JSON.parse(JSON.stringify(n)):void 0}),i}return i={list:[],segmentId:function(){return a++},checkIntersection:function(l,n){return s("check",{seg1:l,seg2:n})},segmentChop:function(l,n){return s("div_seg",{seg:l,pt:n}),s("chop",{seg:l,pt:n})},statusRemove:function(l){return s("pop_seg",{seg:l})},segmentUpdate:function(l){return s("seg_update",{seg:l})},segmentNew:function(l,n){return s("new_seg",{seg:l,primary:n})},segmentRemove:function(l){return s("rem_seg",{seg:l})},tempStatus:function(l,n,u){return s("temp_status",{seg:l,above:n,below:u})},rewind:function(l){return s("rewind",{seg:l})},status:function(l,n,u){return s("status",{seg:l,above:n,below:u})},vert:function(l){return l===o?i:(o=l,s("vert",{x:l}))},log:function(l){return typeof l!="string"&&(l=JSON.stringify(l,!1," ")),s("log",{txt:l})},reset:function(){return s("reset")},selected:function(l){return s("selected",{segs:l})},chainStart:function(l){return s("chain_start",{seg:l})},chainRemoveHead:function(l,n){return s("chain_rem_head",{index:l,pt:n})},chainRemoveTail:function(l,n){return s("chain_rem_tail",{index:l,pt:n})},chainNew:function(l,n){return s("chain_new",{pt1:l,pt2:n})},chainMatch:function(l){return s("chain_match",{index:l})},chainClose:function(l){return s("chain_close",{index:l})},chainAddHead:function(l,n){return s("chain_add_head",{index:l,pt:n})},chainAddTail:function(l,n){return s("chain_add_tail",{index:l,pt:n})},chainConnect:function(l,n){return s("chain_con",{index1:l,index2:n})},chainReverse:function(l){return s("chain_rev",{index:l})},chainJoin:function(l,n){return s("chain_join",{index1:l,index2:n})},done:function(){return s("done")}},i}r.exports=t}}),Pq=de({"node_modules/polybooljs/lib/epsilon.js"(e,r){function t(i){typeof i!="number"&&(i=1e-10);var a={epsilon:function(o){return typeof o=="number"&&(i=o),i},pointAboveOrOnLine:function(o,s,l){var n=s[0],u=s[1],c=l[0],f=l[1],h=o[0],d=o[1];return(c-n)*(d-u)-(f-u)*(h-n)>=-i},pointBetween:function(o,s,l){var n=o[1]-s[1],u=l[0]-s[0],c=o[0]-s[0],f=l[1]-s[1],h=c*u+n*f;if(h-i)},pointsSameX:function(o,s){return Math.abs(o[0]-s[0])i!=c-n>i&&(u-d)*(n-p)/(c-p)+d-l>i&&(f=!f),u=d,c=p}return f}};return a}r.exports=t}}),Iq=de({"node_modules/polybooljs/lib/linked-list.js"(e,r){var t={create:function(){var i={root:{root:!0,next:null},exists:function(a){return!(a===null||a===i.root)},isEmpty:function(){return i.root.next===null},getHead:function(){return i.root.next},insertBefore:function(a,o){for(var s=i.root,l=i.root.next;l!==null;){if(o(l)){a.prev=l.prev,a.next=l,l.prev.next=a,l.prev=a;return}s=l,l=l.next}s.next=a,a.prev=s,a.next=null},findTransition:function(a){for(var o=i.root,s=i.root.next;s!==null&&!a(s);)o=s,s=s.next;return{before:o===i.root?null:o,after:s,insert:function(l){return l.prev=o,l.next=s,o.next=l,s!==null&&(s.prev=l),l}}}};return i},node:function(i){return i.prev=null,i.next=null,i.remove=function(){i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.prev=null,i.next=null},i}};r.exports=t}}),Rq=de({"node_modules/polybooljs/lib/intersecter.js"(e,r){var t=Iq();function i(a,o,s){function l(_,v){return{id:s?s.segmentId():-1,start:_,end:v,myFill:{above:null,below:null},otherFill:null}}function n(_,v,x){return{id:s?s.segmentId():-1,start:_,end:v,myFill:{above:x.myFill.above,below:x.myFill.below},otherFill:null}}var u=t.create();function c(_,v,x,S,M,C){var w=o.pointsCompare(v,M);return w!==0?w:o.pointsSame(x,C)?0:_!==S?_?1:-1:o.pointAboveOrOnLine(x,S?M:C,S?C:M)?1:-1}function f(_,v){u.insertBefore(_,function(x){var S=c(_.isStart,_.pt,v,x.isStart,x.pt,x.other.pt);return S<0})}function h(_,v){var x=t.node({isStart:!0,pt:_.start,seg:_,primary:v,other:null,status:null});return f(x,_.end),x}function d(_,v,x){var S=t.node({isStart:!1,pt:v.end,seg:v,primary:x,other:_,status:null});_.other=S,f(S,_.pt)}function p(_,v){var x=h(_,v);return d(x,_,v),x}function g(_,v){s&&s.segmentChop(_.seg,v),_.other.remove(),_.seg.end=v,_.other.pt=v,f(_.other,_.pt)}function m(_,v){var x=n(v,_.seg.end,_.seg);return g(_,v),p(x,_.primary)}function y(_,v){var x=t.create();function S(I,L){var B=I.seg.start,O=I.seg.end,G=L.seg.start,W=L.seg.end;return o.pointsCollinear(B,G,W)?o.pointsCollinear(O,G,W)||o.pointAboveOrOnLine(O,G,W)?1:-1:o.pointAboveOrOnLine(B,G,W)?1:-1}function M(I){return x.findTransition(function(L){var B=S(I,L.ev);return B>0})}function C(I,L){var B=I.seg,O=L.seg,G=B.start,W=B.end,X=O.start,Z=O.end;s&&s.checkIntersection(B,O);var J=o.linesIntersect(G,W,X,Z);if(J===!1){if(!o.pointsCollinear(G,W,X)||o.pointsSame(G,Z)||o.pointsSame(W,X))return!1;var N=o.pointsSame(G,X),H=o.pointsSame(W,Z);if(N&&H)return L;var $=!N&&o.pointBetween(G,X,Z),U=!H&&o.pointBetween(W,X,Z);if(N)return U?m(L,W):m(I,Z),L;$&&(H||(U?m(L,W):m(I,Z)),m(L,G))}else J.alongA===0&&(J.alongB===-1?m(I,X):J.alongB===0?m(I,J.pt):J.alongB===1&&m(I,Z)),J.alongB===0&&(J.alongA===-1?m(L,G):J.alongA===0?m(L,J.pt):J.alongA===1&&m(L,W));return!1}for(var w=[];!u.isEmpty();){var k=u.getHead();if(s&&s.vert(k.pt[0]),k.isStart){let I=function(){if(E){var L=C(k,E);if(L)return L}return T?C(k,T):!1};var A=I;s&&s.segmentNew(k.seg,k.primary);var b=M(k),E=b.before?b.before.ev:null,T=b.after?b.after.ev:null;s&&s.tempStatus(k.seg,E?E.seg:!1,T?T.seg:!1);var F=I();if(F){if(a){var D;k.seg.myFill.below===null?D=!0:D=k.seg.myFill.above!==k.seg.myFill.below,D&&(F.seg.myFill.above=!F.seg.myFill.above)}else F.seg.otherFill=k.seg.myFill;s&&s.segmentUpdate(F.seg),k.other.remove(),k.remove()}if(u.getHead()!==k){s&&s.rewind(k.seg);continue}if(a){var D;k.seg.myFill.below===null?D=!0:D=k.seg.myFill.above!==k.seg.myFill.below,T?k.seg.myFill.below=T.seg.myFill.above:k.seg.myFill.below=_,D?k.seg.myFill.above=!k.seg.myFill.below:k.seg.myFill.above=k.seg.myFill.below}else if(k.seg.otherFill===null){var R;T?k.primary===T.primary?R=T.seg.otherFill.above:R=T.seg.myFill.above:R=k.primary?v:_,k.seg.otherFill={above:R,below:R}}s&&s.status(k.seg,E?E.seg:!1,T?T.seg:!1),k.other.status=b.insert(t.node({ev:k}))}else{var P=k.status;if(P===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(x.exists(P.prev)&&x.exists(P.next)&&C(P.prev.ev,P.next.ev),s&&s.statusRemove(P.ev.seg),P.remove(),!k.primary){var z=k.seg.myFill;k.seg.myFill=k.seg.otherFill,k.seg.otherFill=z}w.push(k.seg)}u.getHead().remove()}return s&&s.done(),w}return a?{addRegion:function(_){for(var v,x=_[_.length-1],S=0;S<_.length;S++){v=x,x=_[S];var M=o.pointsCompare(v,x);M!==0&&p(l(M<0?v:x,M<0?x:v),!0)}},calculate:function(_){return y(_,!1)}}:{calculate:function(_,v,x,S){return _.forEach(function(M){p(n(M.start,M.end,M),!0)}),x.forEach(function(M){p(n(M.start,M.end,M),!1)}),y(v,S)}}}r.exports=i}}),zq=de({"node_modules/polybooljs/lib/segment-chainer.js"(e,r){function t(i,a,o){var s=[],l=[];return i.forEach(function(n){var u=n.start,c=n.end;if(a.pointsSame(u,c)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}o&&o.chainStart(n);var f={index:0,matches_head:!1,matches_pt1:!1},h={index:0,matches_head:!1,matches_pt1:!1},d=f;function p(P,z,I){return d.index=P,d.matches_head=z,d.matches_pt1=I,d===f?(d=h,!1):(d=null,!0)}for(var g=0;gn!=m>n&&l<(g-d)*(n-p)/(m-p)+d;y&&(u=!u)}return u}}}),Fy=de({"src/lib/polygon.js"(e,r){"use strict";var t=yw().dot,i=cn().BADNUM,a=r.exports={};a.tester=function(s){var l=s.slice(),n=l[0][0],u=n,c=l[0][1],f=c,h;for((l[l.length-1][0]!==l[0][0]||l[l.length-1][1]!==l[0][1])&&l.push(l[0]),h=1;hu||M===i||Mf||x&&p(v))}function m(v,x){var S=v[0],M=v[1];if(S===i||Su||M===i||Mf)return!1;var C=l.length,w=l[0][0],k=l[0][1],A=0,b,E,T,F,D;for(b=1;bMath.max(E,w)||M>Math.max(T,k)))if(Mh||Math.abs(t(m,p))>u)return!0;return!1},a.filter=function(s,l){var n=[s[0]],u=0,c=0;function f(d){s.push(d);var p=n.length,g=u;n.splice(c+1);for(var m=g+1;m1){var h=s.pop();f(h)}return{addPt:f,raw:s,filtered:n}}}}),Uq=de({"src/components/selections/constants.js"(e,r){"use strict";r.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),qq=de({"src/components/selections/select.js"(e,r){"use strict";var t=Nq(),i=jq(),a=Sa(),o=hn().dashStyle,s=ta(),l=$s(),n=sf().makeEventData,u=Zd(),c=u.freeMode,f=u.rectMode,h=u.drawMode,d=u.openMode,p=u.selectMode,g=g0(),m=Dy(),y=Dw(),_=h0().clearOutline,v=m0(),x=v.handleEllipse,S=v.readPaths,M=Cw().newShapes,C=UE(),w=ZE().activateLastSelection,k=Qt(),A=k.sorterAsc,b=Fy(),E=ww(),T=Hs().getFromId,F=Cy(),D=Ly().redrawReglTraces,R=Uq(),P=R.MINSELECT,z=b.filter,I=b.tester,L=kw(),B=L.p2r,O=L.axValue,G=L.getTransform;function W(qe){return qe.subplot!==void 0}function X(qe,Ye,me,_e,Ae){var ke=!W(_e),Ee=c(Ae),De=f(Ae),Qe=d(Ae),Ue=h(Ae),at=p(Ae),rt=Ae==="drawline",ht=Ae==="drawcircle",At=rt||ht,dt=_e.gd,Ht=dt._fullLayout,fr=at&&Ht.newselection.mode==="immediate"&&ke,gt=Ht._zoomlayer,yt=_e.element.getBoundingClientRect(),kt=_e.plotinfo,Lt=G(kt),Ct=Ye-yt.left,$t=me-yt.top;Ht._calcInverseTransform(dt);var mr=k.apply3DTransform(Ht._invTransform)(Ct,$t);Ct=mr[0],$t=mr[1];var br=Ht._invScaleX,Er=Ht._invScaleY,Tr=Ct,Ur=$t,Ai="M"+Ct+","+$t,oi=_e.xaxes[0],Qr=_e.yaxes[0],ea=oi._length,$i=Qr._length,ja=qe.altKey&&!(h(Ae)&&Qe),ya,pa,xi,bi,Ua,dn,pi;U(qe,dt,_e),Ee&&(ya=z([[Ct,$t]],R.BENDPX));var Jr=gt.selectAll("path.select-outline-"+kt.id).data([1]),Be=Ue?Ht.newshape:Ht.newselection;Ue&&(_e.hasText=Be.label.text||Be.label.texttemplate);var Fe=Ue&&!Qe?Be.fillcolor:"rgba(0,0,0,0)",Et=Be.line.color||(ke?s.contrast(dt._fullLayout.plot_bgcolor):"#7f7f7f");Jr.enter().append("path").attr("class","select-outline select-outline-"+kt.id).style({opacity:Ue?Be.opacity/2:1,"stroke-dasharray":o(Be.line.dash,Be.line.width),"stroke-width":Be.line.width+"px","shape-rendering":"crispEdges"}).call(s.stroke,Et).call(s.fill,Fe).attr("fill-rule","evenodd").classed("cursor-move",!!Ue).attr("transform",Lt).attr("d",Ai+"Z");var St=gt.append("path").attr("class","zoombox-corners").style({fill:s.background,stroke:s.defaultLine,"stroke-width":1}).attr("transform",Lt).attr("d","M0,0Z");if(Ue&&_e.hasText){var zt=gt.select(".label-temp");zt.empty()&&(zt=gt.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Wt=Ht._uid+R.SELECTID,Yt=[],ze=K(dt,_e.xaxes,_e.yaxes,_e.subplot);fr&&!qe.shiftKey&&(_e._clearSubplotSelections=function(){if(ke){var ft=oi._id,wt=Qr._id;Me(dt,ft,wt,ze);for(var jt=(dt.layout||{}).selections||[],It=[],Kt=!1,qt=0;qt=0){dt._fullLayout._deactivateShape(dt);return}if(!Ue){var jt=Ht.clickmode;E.done(Wt).then(function(){if(E.clear(Wt),ft===2){for(Jr.remove(),Ua=0;Ua-1&&Z(wt,dt,_e.xaxes,_e.yaxes,_e.subplot,_e,Jr),jt==="event"&&Mt(dt,void 0);l.click(dt,wt,kt.id)}).catch(k.error)}},_e.doneFn=function(){St.remove(),E.done(Wt).then(function(){E.clear(Wt),!fr&&bi&&_e.selectionDefs&&(bi.subtract=ja,_e.selectionDefs.push(bi),_e.mergedPolygons.length=0,[].push.apply(_e.mergedPolygons,xi)),(fr||Ue)&&q(_e,fr),_e.doneFnCompleted&&_e.doneFnCompleted(Yt),at&&Mt(dt,pi)}).catch(k.error)}}function Z(qe,Ye,me,_e,Ae,ke,Ee){var De=Ye._hoverdata,Qe=Ye._fullLayout,Ue=Qe.clickmode,at=Ue.indexOf("event")>-1,rt=[],ht,At,dt,Ht,fr,gt,yt,kt,Lt,Ct;if(ne(De)){U(qe,Ye,ke),ht=K(Ye,me,_e,Ae);var $t=se(De,ht),mr=$t.pointNumbers.length>0;if(mr?ce(ht,$t):pe(ht)&&(yt=le($t))){for(Ee&&Ee.remove(),Ct=0;Ct=0}function j(qe){return qe._fullLayout._activeSelectionIndex>=0}function q(qe,Ye){var me=qe.dragmode,_e=qe.plotinfo,Ae=qe.gd;V(Ae)&&Ae._fullLayout._deactivateShape(Ae),j(Ae)&&Ae._fullLayout._deactivateSelection(Ae);var ke=Ae._fullLayout,Ee=ke._zoomlayer,De=h(me),Qe=p(me);if(De||Qe){var Ue=Ee.selectAll(".select-outline-"+_e.id);if(Ue&&Ae._fullLayout._outlining){var at;De&&(at=M(Ue,qe)),at&&a.call("_guiRelayout",Ae,{shapes:at});var rt;Qe&&!W(qe)&&(rt=C(Ue,qe)),rt&&(Ae._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",Ae,{selections:rt}).then(function(){Ye&&w(Ae)})),Ae._fullLayout._outlining=!1}}_e.selection={},_e.selection.selectionDefs=qe.selectionDefs=[],_e.selection.mergedPolygons=qe.mergedPolygons=[]}function Y(qe){return qe._id}function K(qe,Ye,me,_e){if(!qe.calcdata)return[];var Ae=[],ke=Ye.map(Y),Ee=me.map(Y),De,Qe,Ue;for(Ue=0;Ue0,ke=Ae?_e[0]:me;return Ye.selectedpoints?Ye.selectedpoints.indexOf(ke)>-1:!1}function ce(qe,Ye){var me=[],_e,Ae,ke,Ee;for(Ee=0;Ee0&&me.push(_e);if(me.length===1&&(ke=me[0]===Ye.searchInfo,ke&&(Ae=Ye.searchInfo.cd[0].trace,Ae.selectedpoints.length===Ye.pointNumbers.length))){for(Ee=0;Ee1||(Ye+=_e.selectedpoints.length,Ye>1)))return!1;return Ye===1}function xe(qe,Ye,me){var _e,Ae;for(_e=0;_e-1&&Ye;if(!Ee&&Ye){var ft=je(qe,!0);if(ft.length){var wt=ft[0].xref,jt=ft[0].yref;if(wt&&jt){var It=Je(ft),Kt=xt([T(qe,wt,"x"),T(qe,jt,"y")]);Kt(Yt,It)}}qe._fullLayout._noEmitSelectedAtStart?qe._fullLayout._noEmitSelectedAtStart=!1:tt&&Mt(qe,Yt),ht._reselect=!1}if(!Ee&&ht._deselect){var qt=ht._deselect;De=qt.xref,Qe=qt.yref,ge(De,Qe,at)||Me(qe,De,Qe,_e),tt&&(Yt.points.length?Mt(qe,Yt):lt(qe)),ht._deselect=!1}return{eventData:Yt,selectionTesters:me}}function ue(qe){var Ye=qe.calcdata;if(Ye)for(var me=0;me=0){Be._fullLayout._deactivateShape(Be);return}var Fe=Be._fullLayout.clickmode;if(N(Be),pi===2&&!ae&&ya(),fe)Fe.indexOf("select")>-1&&k(Jr,Be,ge,Me,te.id,Ue),Fe.indexOf("event")>-1&&f.click(Be,Jr,te.id);else if(pi===1&&ae){var Et=pe?ie:ee,St=pe==="s"||xe==="w"?0:1,zt=Et._name+".range["+St+"]",Wt=I(Et,St),Yt="left",ze="middle";if(Et.fixedrange)return;pe?(ze=pe==="n"?"top":"bottom",Et.side==="right"&&(Yt="right")):xe==="e"&&(Yt="right"),Be._context.showAxisRangeEntryBoxes&&t.select(Qe).call(n.makeEditable,{gd:Be,immediate:!0,background:Be._fullLayout.paper_bgcolor,text:String(Wt),fill:Et.tickfont?Et.tickfont.color:"#444",horizontalAlign:Yt,verticalAlign:ze}).on("edit",function(tt){var ft=Et.d2r(tt);ft!==void 0&&s.call("_guiRelayout",Be,zt,ft)})}}p.init(Ue);var ht,At,dt,Ht,fr,gt,yt,kt,Lt,Ct;function $t(pi,Jr,Be){var Fe=Qe.getBoundingClientRect();ht=Jr-Fe.left,At=Be-Fe.top,K._fullLayout._calcInverseTransform(K);var Et=i.apply3DTransform(K._fullLayout._invTransform)(ht,At);ht=Et[0],At=Et[1],dt={l:ht,r:ht,w:0,t:At,b:At,h:0},Ht=K._hmpixcount?K._hmlumcount/K._hmpixcount:u.luminosity(K._fullLayout.plot_bgcolor),fr="M0,0H"+Ve+"V"+Ke+"H0V0",gt=!1,yt="xy",Ct=!1,kt=W(ye,Ht,Te,je,fr),Lt=X(ye,Te,je)}function mr(pi,Jr){if(K._transitioningWithDuration)return!1;var Be=Math.max(0,Math.min(Ve,Ae*pi+ht)),Fe=Math.max(0,Math.min(Ke,ke*Jr+At)),Et=Math.abs(Be-ht),St=Math.abs(Fe-At);dt.l=Math.min(ht,Be),dt.r=Math.max(ht,Be),dt.t=Math.min(At,Fe),dt.b=Math.max(At,Fe);function zt(){yt="",dt.r=dt.l,dt.t=dt.b,Lt.attr("d","M0,0Z")}if(Je.isSubplotConstrained)Et>T||St>T?(yt="xy",Et/Ve>St/Ke?(St=Et*Ke/Ve,At>Fe?dt.t=At-St:dt.b=At+St):(Et=St*Ve/Ke,ht>Be?dt.l=ht-Et:dt.r=ht+Et),Lt.attr("d",V(dt))):zt();else if(vt.isSubplotConstrained)if(Et>T||St>T){yt="xy";var Wt=Math.min(dt.l/Ve,(Ke-dt.b)/Ke),Yt=Math.max(dt.r/Ve,(Ke-dt.t)/Ke);dt.l=Wt*Ve,dt.r=Yt*Ve,dt.b=(1-Wt)*Ke,dt.t=(1-Yt)*Ke,Lt.attr("d",V(dt))}else zt();else!Pt||St0){var tt;if(vt.isSubplotConstrained||!xt&&Pt.length===1){for(tt=0;tt1&&(zt.maxallowed!==void 0&&Mt===(zt.range[0]1&&(Wt.maxallowed!==void 0&<===(Wt.range[0]=0?Math.min(K,.9):1/(1/Math.max(K,-.3)+3.222))}function G(K,te,ne){return K?K==="nsew"?ne?"":te==="pan"?"move":"crosshair":K.toLowerCase()+"-resize":"pointer"}function W(K,te,ne,se,le){return K.append("path").attr("class","zoombox").style({fill:te>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(ne,se)).attr("d",le+"Z")}function X(K,te,ne){return K.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(te,ne)).attr("d","M0,0Z")}function Z(K,te,ne,se,le,ce){K.attr("d",se+"M"+ne.l+","+ne.t+"v"+ne.h+"h"+ne.w+"v-"+ne.h+"h-"+ne.w+"Z"),J(K,te,le,ce)}function J(K,te,ne,se){ne||(K.transition().style("fill",se>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),te.transition().style("opacity",1).duration(200))}function N(K){t.select(K).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(K){F&&K.data&&K._context.showTips&&(i.notifier(i._(K,"Double-click to zoom back out"),"long",K),F=!1)}function $(K,te){return"M"+(K.l-.5)+","+(te-T-.5)+"h-3v"+(2*T+1)+"h3ZM"+(K.r+.5)+","+(te-T-.5)+"h3v"+(2*T+1)+"h-3Z"}function U(K,te){return"M"+(te-T-.5)+","+(K.t-.5)+"v-3h"+(2*T+1)+"v3ZM"+(te-T-.5)+","+(K.b+.5)+"v3h"+(2*T+1)+"v-3Z"}function V(K){var te=Math.floor(Math.min(K.b-K.t,K.r-K.l,T)/2);return"M"+(K.l-3.5)+","+(K.t-.5+te)+"h3v"+-te+"h"+te+"v-3h-"+(te+3)+"ZM"+(K.r+3.5)+","+(K.t-.5+te)+"h-3v"+-te+"h"+-te+"v-3h"+(te+3)+"ZM"+(K.r+3.5)+","+(K.b+.5-te)+"h-3v"+te+"h"+-te+"v3h"+(te+3)+"ZM"+(K.l-3.5)+","+(K.b+.5-te)+"h3v"+te+"h"+te+"v3h-"+(te+3)+"Z"}function j(K,te,ne,se,le){for(var ce=!1,pe={},xe={},ye,fe,ae,ee,ie=(le||{}).xaHash,Q=(le||{}).yaHash,ue=0;ue1&&i.warn("Full array edits are incompatible with other edits",p);var S=f[""][""];if(l(S))c.set(null);else if(Array.isArray(S))c.set(S);else return i.warn("Unrecognized full array edit value",p,S),!0;return _?!1:(g(v,x),m(u),!0)}var M=Object.keys(f).map(Number).sort(a),C=c.get(),w=C||[],k=d(x,p).get(),A=[],b=-1,E=w.length,T,F,D,R,P,z,I,L;for(T=0;Tw.length-(I?0:1)){i.warn("index out of range",p,D);continue}if(z!==void 0)P.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",p,D),l(z)?A.push(D):I?(z==="add"&&(z={}),w.splice(D,0,z),k&&k.splice(D,0,{})):i.warn("Unrecognized full object edit value",p,D,z),b===-1&&(b=D);else for(F=0;F=0;T--)w.splice(A[T],1),k&&k.splice(A[T],1);if(w.length?C||c.set(w):c.set(null),_)return!1;if(g(v,x),y!==t){var B;if(b===-1)B=M;else{for(E=Math.max(w.length,E),B=[],T=0;T=b));T++)B.push(D);for(T=b;T0&&i.log("Clearing previous rejected promises from queue."),_._promises=[]},e.cleanLayout=function(_){var v,x;_||(_={}),_.xaxis1&&(_.xaxis||(_.xaxis=_.xaxis1),delete _.xaxis1),_.yaxis1&&(_.yaxis||(_.yaxis=_.yaxis1),delete _.yaxis1),_.scene1&&(_.scene||(_.scene=_.scene1),delete _.scene1);var S=(a.subplotsRegistry.cartesian||{}).attrRegex,M=(a.subplotsRegistry.polar||{}).attrRegex,C=(a.subplotsRegistry.ternary||{}).attrRegex,w=(a.subplotsRegistry.gl3d||{}).attrRegex,k=Object.keys(_);for(v=0;v3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),_.dragmode==="rotate"&&(_.dragmode="orbit"),_.template&&_.template.layout&&e.cleanLayout(_.template.layout),_};function c(_,v,x=!1){var S=_[v],M=v.charAt(0);x&&Array.isArray(S)||S&&S!=="paper"&&(_[v]=s(S,M,!0))}e.cleanData=function(_){for(var v=0;v<_.length;v++){var x=_[v],S;if(x.type==="histogramy"&&"xbins"in x&&!("ybins"in x)&&(x.ybins=x.xbins,delete x.xbins),x.type==="histogramy"&&e.swapXYData(x),(x.type==="histogramx"||x.type==="histogramy")&&(x.type="histogram"),"scl"in x&&!("colorscale"in x)&&(x.colorscale=x.scl,delete x.scl),"reversescl"in x&&!("reversescale"in x)&&(x.reversescale=x.reversescl,delete x.reversescl),x.xaxis&&(x.xaxis=s(x.xaxis,"x")),x.yaxis&&(x.yaxis=s(x.yaxis,"y")),n(x,"gl3d")&&x.scene&&(x.scene=a.subplotsRegistry.gl3d.cleanId(x.scene)),!n(x,"pie-like")&&!n(x,"bar-like"))if(Array.isArray(x.textposition))for(S=0;S0)return _.slice(0,v)}e.hasParent=function(_,v){for(var x=m(v);x;){if(x in _)return!0;x=m(x)}return!1},e.clearAxisTypes=function(_,v,x){for(var S=0;S{let x=(...S)=>S.every(M=>i.isPlainObject(M))||S.every(M=>Array.isArray(M));if([_,v].every(S=>Array.isArray(S))){if(_.length!==v.length)return!1;for(let S=0;S<_.length;S++){let M=_[S],C=v[S];if(M!==C&&!(x(M,C)?y(M,C):!1))return!1}return!0}else if([_,v].every(S=>i.isPlainObject(S))){if(Object.keys(_).length!==Object.keys(v).length)return!1;for(let S in _){if(S.startsWith("_"))continue;let M=_[S],C=v[S];if(M!==C&&!(x(M,C)?y(M,C):!1))return!1}return!0}return!1};e.collectionsAreEqual=y}}),Iw=de({"src/plot_api/plot_api.js"(e){"use strict";var r=Yr(),t=da(),i=TE(),a=Qt(),o=a.nestedProperty,s=c1(),l=cq(),n=Sa(),u=f1(),c=ks(),f=nn(),h=FE(),d=Mu(),p=hn(),g=ta(),m=ek().initInteractions,y=Nh(),_=Zl().clearOutline,v=Na().dfltConfig,x=$q(),S=Wq(),M=Ly(),C=Is(),w=zl().AX_NAME_PATTERN,k=0,A=5;function b(me,_e,Ae,ke){var Ee;if(me=a.getGraphDiv(me),s.init(me),a.isPlainObject(_e)){var De=_e;_e=De.data,Ae=De.layout,ke=De.config,Ee=De.frames}var Qe=s.triggerHandler(me,"plotly_beforeplot",[_e,Ae,ke]);if(Qe===!1)return Promise.reject();!_e&&!Ae&&!a.isPlotDiv(me)&&a.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",me);function Ue(){if(Ee)return e.addFrames(me,Ee)}R(me,ke),Ae||(Ae={}),r.select(me).classed("js-plotly-plot",!0),p.makeTester(),Array.isArray(me._promises)||(me._promises=[]);var at=(me.data||[]).length===0&&Array.isArray(_e);Array.isArray(_e)&&(S.cleanData(_e),at?me.data=_e:me.data.push.apply(me.data,_e),me.empty=!1),(!me.layout||at)&&(me.layout=S.cleanLayout(Ae)),c.supplyDefaults(me);var rt=me._fullLayout,ht=rt._has("cartesian");rt._replotting=!0,(at||rt._shouldCreateBgLayer)&&(Ye(me),rt._shouldCreateBgLayer&&delete rt._shouldCreateBgLayer),p.initGradients(me),p.initPatterns(me),at&&f.saveShowSpikeInitial(me);var At=!me.calcdata||me.calcdata.length!==(me._fullData||[]).length;At&&c.doCalcdata(me);for(var dt=0;dt=me.data.length||Ee<-me.data.length)throw new Error(Ae+" must be valid indices for gd.data.");if(_e.indexOf(Ee,ke+1)>-1||Ee>=0&&_e.indexOf(-me.data.length+Ee)>-1||Ee<0&&_e.indexOf(me.data.length+Ee)>-1)throw new Error("each index in "+Ae+" must be unique.")}}function B(me,_e,Ae){if(!Array.isArray(me.data))throw new Error("gd.data must be an array.");if(typeof _e>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(_e)||(_e=[_e]),L(me,_e,"currentIndices"),typeof Ae<"u"&&!Array.isArray(Ae)&&(Ae=[Ae]),typeof Ae<"u"&&L(me,Ae,"newIndices"),typeof Ae<"u"&&_e.length!==Ae.length)throw new Error("current and new indices must be of equal length.")}function O(me,_e,Ae){var ke,Ee;if(!Array.isArray(me.data))throw new Error("gd.data must be an array.");if(typeof _e>"u")throw new Error("traces must be defined.");for(Array.isArray(_e)||(_e=[_e]),ke=0;ke<_e.length;ke++)if(Ee=_e[ke],typeof Ee!="object"||Array.isArray(Ee)||Ee===null)throw new Error("all values in traces array must be non-array objects");if(typeof Ae<"u"&&!Array.isArray(Ae)&&(Ae=[Ae]),typeof Ae<"u"&&Ae.length!==_e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function G(me,_e,Ae,ke){var Ee=a.isPlainObject(ke);if(!Array.isArray(me.data))throw new Error("gd.data must be an array");if(!a.isPlainObject(_e))throw new Error("update must be a key:value object");if(typeof Ae>"u")throw new Error("indices must be an integer or array of integers");L(me,Ae,"indices");for(var De in _e){if(!Array.isArray(_e[De])||_e[De].length!==Ae.length)throw new Error("attribute "+De+" must be an array of length equal to indices array length");if(Ee&&(!(De in ke)||!Array.isArray(ke[De])||ke[De].length!==_e[De].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function W(me,_e,Ae,ke){var Ee=a.isPlainObject(ke),De=[],Qe,Ue,at,rt,ht;Array.isArray(Ae)||(Ae=[Ae]),Ae=I(Ae,me.data.length-1);for(var At in _e)for(var dt=0;dt=0&&ht=0&&ht"u")return rt=e.redraw(me),l.add(me,Ee,Qe,De,Ue),rt;Array.isArray(Ae)||(Ae=[Ae]);try{B(me,ke,Ae)}catch(ht){throw me.data.splice(me.data.length-_e.length,_e.length),ht}return l.startSequence(me),l.add(me,Ee,Qe,De,Ue),rt=e.moveTraces(me,ke,Ae),l.stopSequence(me),rt}function $(me,_e){me=a.getGraphDiv(me);var Ae=[],ke=e.addTraces,Ee=$,De=[me,Ae,_e],Qe=[me,_e],Ue,at;if(typeof _e>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(_e)||(_e=[_e]),L(me,_e,"indices"),_e=I(_e,me.data.length-1),_e.sort(a.sorterDes),Ue=0;Ue<_e.length;Ue+=1)at=me.data.splice(_e[Ue],1)[0],Ae.push(at);var rt=e.redraw(me);return l.add(me,ke,De,Ee,Qe),rt}function U(me,_e,Ae){me=a.getGraphDiv(me);var ke=[],Ee=[],De=U,Qe=U,Ue=[me,Ae,_e],at=[me,_e,Ae],rt;if(B(me,_e,Ae),_e=Array.isArray(_e)?_e:[_e],typeof Ae>"u")for(Ae=[],rt=0;rt<_e.length;rt++)Ae.push(-_e.length+rt);for(Ae=Array.isArray(Ae)?Ae:[Ae],_e=I(_e,me.data.length-1),Ae=I(Ae,me.data.length-1),rt=0;rt0&&typeof Tr.parts[oi]!="string";)oi--;var Qr=Tr.parts[oi],ea=Tr.parts[oi-1]+"."+Qr,$i=Tr.parts.slice(0,oi).join("."),ja=o(me.layout,$i).get(),ya=o(ke,$i).get(),pa=Tr.get();if(Ur!==void 0){kt[Er]=Ur,Lt[Er]=Qr==="reverse"?Ur:j(pa);var xi=u.getLayoutValObject(ke,Tr.parts);if(xi&&xi.impliedEdits&&Ur!==null)for(var bi in xi.impliedEdits)Ct(a.relativeAttr(Er,bi),xi.impliedEdits[bi]);if(["width","height"].indexOf(Er)!==-1)if(Ur){Ct("autosize",null);var Ua=Er==="height"?"width":"height";Ct(Ua,ke[Ua])}else ke[Er]=me._initialAutoSize[Er];else if(Er==="autosize")Ct("width",Ur?null:ke.width),Ct("height",Ur?null:ke.height);else if(ea.match(ce))br(ea),o(ke,$i+"._inputRange").set(null);else if(ea.match(pe)){br(ea),o(ke,$i+"._inputRange").set(null);var dn=o(ke,$i).get();dn._inputDomain&&(dn._input.domain=dn._inputDomain.slice())}else ea.match(xe)&&o(ke,$i+"._inputDomain").set(null);if(Qr==="type"){mr=ja;var pi=ya.type==="linear"&&Ur==="log",Jr=ya.type==="log"&&Ur==="linear";if(pi||Jr){if(!mr||!mr.range)Ct($i+".autorange",!0);else if(ya.autorange)pi&&(mr.range=mr.range[1]>mr.range[0]?[1,2]:[2,1]);else{var Be=mr.range[0],Fe=mr.range[1];pi?(Be<=0&&Fe<=0&&Ct($i+".autorange",!0),Be<=0?Be=Fe/1e6:Fe<=0&&(Fe=Be/1e6),Ct($i+".range[0]",Math.log(Be)/Math.LN10),Ct($i+".range[1]",Math.log(Fe)/Math.LN10)):(Ct($i+".range[0]",Math.pow(10,Be)),Ct($i+".range[1]",Math.pow(10,Fe)))}Array.isArray(ke._subplots.polar)&&ke._subplots.polar.length&&ke[Tr.parts[0]]&&Tr.parts[1]==="radialaxis"&&delete ke[Tr.parts[0]]._subplot.viewInitial["radialaxis.range"],n.getComponentMethod("annotations","convertCoords")(me,ya,Ur,Ct),n.getComponentMethod("images","convertCoords")(me,ya,Ur,Ct)}else Ct($i+".autorange",!0),Ct($i+".range",null);o(ke,$i+"._inputRange").set(null)}else if(Qr.match(w)){var Et=o(ke,Er).get(),St=(Ur||{}).type;(!St||St==="-")&&(St="linear"),n.getComponentMethod("annotations","convertCoords")(me,Et,St,Ct),n.getComponentMethod("images","convertCoords")(me,Et,St,Ct)}var zt=x.containerArrayMatch(Er);if(zt){ht=zt.array,At=zt.index;var Wt=zt.property,Yt=xi||{editType:"calc"};At!==""&&Wt===""&&(x.isAddVal(Ur)?Lt[Er]=null:x.isRemoveVal(Ur)?Lt[Er]=(o(Ae,ht).get()||[])[At]:a.warn("unrecognized full object value",_e)),C.update(yt,Yt),rt[ht]||(rt[ht]={});var ze=rt[ht][At];ze||(ze=rt[ht][At]={}),ze[Wt]=Ur,delete _e[Er]}else Qr==="reverse"?(ja.range?ja.range.reverse():(Ct($i+".autorange",!0),ja.range=[1,0]),ya.autorange?yt.calc=!0:yt.plot=!0):(Er==="dragmode"&&(Ur===!1&&pa!==!1||Ur!==!1&&pa===!1)||ke._has("scatter-like")&&ke._has("regl")&&Er==="dragmode"&&(Ur==="lasso"||Ur==="select")&&!(pa==="lasso"||pa==="select")?yt.plot=!0:xi?C.update(yt,xi):yt.calc=!0,Tr.set(Ur))}}for(ht in rt){var tt=x.applyContainerArrayChanges(me,De(Ae,ht),rt[ht],yt,De);tt||(yt.plot=!0)}for(var ft in $t){mr=f.getFromId(me,ft);var wt=mr&&mr._constraintGroup;if(wt){yt.calc=!0;for(var jt in wt)$t[jt]||(f.getFromId(me,jt)._constraintShrinkable=!0)}}(fe(me)||_e.height||_e.width)&&(yt.plot=!0);var It=ke.shapes;for(At=0;At1;)if(ke.pop(),Ae=o(_e,ke.join(".")+".uirevision").get(),Ae!==void 0)return Ae;return _e.uirevision}function Me(me,_e){for(var Ae=0;Ae<_e.length;Ae++)if(_e[Ae].uid===me)return Ae;return-1}function Te(me,_e,Ae){for(var ke=0;ke<_e.length;ke++)if(_e[ke].uid===me)return ke;return!_e[Ae]||_e[Ae].uid?-1:Ae}function je(me,_e){var Ae=a.isPlainObject(me),ke=Array.isArray(me);return Ae||ke?(Ae&&a.isPlainObject(_e)||ke&&Array.isArray(_e))&&JSON.stringify(me)===JSON.stringify(_e):me===_e}function Ve(me,_e,Ae,ke){var Ee=ke._preGUI,De,Qe,Ue,at,rt,ht,At,dt,Ht,fr,gt=[],yt={},kt={};for(De in Ee){if(rt=ue(De,ie),rt){if(Ht=rt.head,fr=rt.tail,Qe=rt.attr||Ht+".uirevision",Ue=o(ke,Qe).get(),at=Ue&&ge(Qe,_e),at&&at===Ue){if(ht=Ee[De],ht===null&&(ht=void 0),At=o(_e,De),dt=At.get(),je(dt,ht)){dt===void 0&&fr==="autorange"&>.push(Ht),At.set(j(o(ke,De).get()));continue}else if(fr==="autorange"||fr.slice(0,6)==="range["){var Lt=Ee[Ht+".range[0]"],Ct=Ee[Ht+".range[1]"],$t=Ee[Ht+".autorange"];if($t||$t===null&&Lt===null&&Ct===null){if(!(Ht in yt)){var mr=o(_e,Ht).get();yt[Ht]=mr&&(mr.autorange||mr.autorange!==!1&&(!mr.range||mr.range.length!==2))}if(yt[Ht]){At.set(j(o(ke,De).get()));continue}}}}}else a.warn("unrecognized GUI edit: "+De);delete Ee[De],rt&&rt.tail.slice(0,6)==="range["&&(kt[rt.head]=1)}for(var br=0;br[$i,me._ev.listeners($i)]);De=e.newPlot(me,_e,Ae,ke).then(()=>{for(let[$i,ja]of ea)ja.forEach(ya=>me.on($i,ya));return e.react(me,_e,Ae,ke)})}else{me.data=_e||[],S.cleanData(me.data),me.layout=Ae||{},S.cleanLayout(me.layout),Ve(me.data,me.layout,Ue,at),c.supplyDefaults(me,{skipUpdateCalc:!0});var At=me._fullData,dt=me._fullLayout,Ht=dt.datarevision===void 0,fr=dt.transition,gt=vt(me,at,dt,Ht,fr),yt=gt.newDataRevision,kt=Je(me,Ue,At,Ht,fr,yt);if(fe(me)&&(gt.layoutReplot=!0),kt.calc||gt.calc){me.calcdata=void 0;for(var Lt=Object.getOwnPropertyNames(dt),Ct=0;Ct(ht||me.emit("plotly_react",{config:ke,data:_e,layout:Ae}),me))}function Je(me,_e,Ae,ke,Ee,De){var Qe=_e.length===Ae.length;if(!Ee&&!Qe)return{fullReplot:!0,calc:!0};var Ue=C.traceFlags();Ue.arrays={},Ue.nChanges=0,Ue.nChangesAnim=0;var at,rt;function ht(Ht){var fr=u.getTraceValObject(rt,Ht);return!rt._module.animatable&&fr.anim&&(fr.anim=!1),fr}var At={getValObject:ht,flags:Ue,immutable:ke,transition:Ee,newDataRevision:De,gd:me},dt={};for(at=0;at<_e.length;at++)if(Ae[at]){if(rt=Ae[at],dt[rt.uid])continue;dt[rt.uid]=1,xt(_e[at],rt,[],At)}return(Ue.calc||Ue.plot)&&(Ue.fullReplot=!0),Ee&&Ue.nChanges&&Ue.nChangesAnim&&(Ue.anim=Ue.nChanges===Ue.nChangesAnim&&Qe?"all":"some"),Ue}function vt(me,_e,Ae,ke,Ee){var De=C.layoutFlags();De.arrays={},De.rangesAltered={},De.nChanges=0,De.nChangesAnim=0;function Qe(dt){return u.getLayoutValObject(Ae,dt)}for(var Ue in Ae)if(!(!Ue.startsWith("xaxis")&&!Ue.startsWith("yaxis"))&&_e[Ue]){var at=Ae[Ue].domain,rt=_e[Ue].domain,ht=_e[Ue]._inputDomain;_e[Ue]._inputDomain&&(at[0]===ht[0]&&at[1]===ht[1]?Ae[Ue].domain=_e[Ue].domain:(at[0]!==rt[0]||at[1]!==rt[1])&&(Ae[Ue]._inputDomain=null))}var At={getValObject:Qe,flags:De,immutable:ke,transition:Ee,gd:me};return xt(_e,Ae,[],At),(De.plot||De.calc)&&(De.layoutReplot=!0),Ee&&De.nChanges&&De.nChangesAnim&&(De.anim=De.nChanges===De.nChangesAnim?"all":"some"),De}function xt(me,_e,Ae,ke){var Ee,De,Qe,Ue=ke.getValObject,at=ke.flags,rt=ke.immutable,ht=ke.inArray,At=ke.arrayIndex;function dt(){var $i=Ee.editType;if(ht&&$i.indexOf("arraydraw")!==-1){a.pushUnique(at.arrays[ht],At);return}C.update(at,Ee),$i!=="none"&&at.nChanges++,ke.transition&&Ee.anim&&at.nChangesAnim++,(ce.test(Qe)||pe.test(Qe))&&(at.rangesAltered[Ae[0]]=1),De==="datarevision"&&(at.newDataRevision=1)}function Ht($i){return $i.valType==="data_array"||$i.arrayOk}for(De in me){if(at.calc&&!ke.transition)return;var fr=me[De],gt=_e[De],yt=Ae.concat(De);if(Qe=yt.join("."),!(De.charAt(0)==="_"||typeof fr=="function"||fr===gt)){if((De==="tick0"||De==="dtick")&&Ae[0]!=="geo"){var kt=_e.tickmode;if(kt==="auto"||kt==="array"||!kt)continue}if(!(De==="range"&&_e.autorange)&&!((De==="zmin"||De==="zmax")&&_e.type==="contourcarpet")&&(Ee=Ue(yt),!!Ee&&!(Ee._compareAsJSON&&JSON.stringify(fr)===JSON.stringify(gt)))){var Lt=Ee.valType,Ct,$t=Ht(Ee),mr=Array.isArray(fr),br=Array.isArray(gt);if(mr&&br){var Er="_input_"+De,Tr=me[Er],Ur=_e[Er];if(Array.isArray(Tr)&&Tr===Ur)continue}if(gt===void 0)$t&&mr?at.calc=!0:dt();else if(Ee._isLinkedToArray){var Ai=[],oi=!1;ht||(at.arrays[De]=Ai);var Qr=Math.min(fr.length,gt.length),ea=Math.max(fr.length,gt.length);if(Qr!==ea)if(Ee.editType==="arraydraw")oi=!0;else{dt();continue}for(Ct=0;Ct=Ee.length?Ee[0]:Ee[rt]:Ee}function Ue(rt){return Array.isArray(De)?rt>=De.length?De[0]:De[rt]:De}function at(rt,ht){var At=0;return function(){if(rt&&++At===ht)return rt()}}return new Promise(function(rt,ht){function At(){if(ke._frameQueue.length!==0){for(;ke._frameQueue.length;){var Qr=ke._frameQueue.pop();Qr.onInterrupt&&Qr.onInterrupt()}me.emit("plotly_animationinterrupted",[])}}function dt(Qr){if(Qr.length!==0){for(var ea=0;eake._timeToNext&&fr()};Qr()}var yt=0;function kt(Qr){return Array.isArray(Ee)?yt>=Ee.length?Qr.transitionOpts=Ee[yt]:Qr.transitionOpts=Ee[0]:Qr.transitionOpts=Ee,yt++,Qr}var Lt,Ct,$t=[],mr=_e==null,br=Array.isArray(_e),Er=!mr&&!br&&a.isPlainObject(_e);if(Er)$t.push({type:"object",data:kt(a.extendFlat({},_e))});else if(mr||["string","number"].indexOf(typeof _e)!==-1)for(Lt=0;Lt0&&Ai<$t.length-1){var oi=[];for(Lt=0;Lt<$t.length;Lt++)Ct=$t[Lt],($t[Lt].type!=="byname"||Lt>Ai)&&oi.push(Ct);$t=oi}}$t.length>0?dt($t):(me.emit("plotly_animated"),rt())})}function mt(me,_e,Ae){if(me=a.getGraphDiv(me),_e==null)return Promise.resolve();if(!a.isPlotDiv(me))throw new Error("This element is not a Plotly plot: "+me+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var ke,Ee,De,Qe,Ue=me._transitionData._frames,at=me._transitionData._frameHash;if(!Array.isArray(_e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+_e);var rt=Ue.length+_e.length*2,ht=[],At={};for(ke=_e.length-1;ke>=0;ke--)if(a.isPlainObject(_e[ke])){var dt=_e[ke].name,Ht=(at[dt]||At[dt]||{}).name,fr=_e[ke].name,gt=at[Ht]||At[Ht];Ht&&fr&&typeof fr=="number"&>&&kTr.index?-1:Er.index=0;ke--){if(Ee=ht[ke].frame,typeof Ee.name=="number"&&a.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Ee.name)for(;at[Ee.name="frame "+me._transitionData._counter++];);if(at[Ee.name]){for(De=0;De=0;Ae--)ke=_e[Ae],De.push({type:"delete",index:ke}),Qe.unshift({type:"insert",index:ke,value:Ee[ke]});var Ue=c.modifyFrames,at=c.modifyFrames,rt=[me,Qe],ht=[me,De];return l&&l.add(me,Ue,rt,at,ht),c.modifyFrames(me,De)}function lt(me){me=a.getGraphDiv(me);var _e=me._fullLayout||{},Ae=me._fullData||[];return c.cleanPlot([],{},Ae,_e),c.purge(me),s.purge(me),_e._container&&_e._container.remove(),delete me._context,me}function qe(me){var _e=me._fullLayout,Ae=me.getBoundingClientRect();if(!a.equalDomRects(Ae,_e._lastBBox)){var ke=_e._invTransform=a.inverseTransformMatrix(a.getFullTransformMatrix(me));_e._invScaleX=Math.sqrt(ke[0][0]*ke[0][0]+ke[0][1]*ke[0][1]+ke[0][2]*ke[0][2]),_e._invScaleY=Math.sqrt(ke[1][0]*ke[1][0]+ke[1][1]*ke[1][1]+ke[1][2]*ke[1][2]),_e._lastBBox=Ae}}function Ye(me){var _e=r.select(me),Ae=me._fullLayout;if(Ae._calcInverseTransform=qe,Ae._calcInverseTransform(me),Ae._container=_e.selectAll(".plot-container").data([0]),Ae._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Ae._paperdiv=Ae._container.selectAll(".svg-container").data([0]),Ae._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Ae._glcontainer=Ae._paperdiv.selectAll(".gl-container").data([{}]),Ae._glcontainer.enter().append("div").classed("gl-container",!0),Ae._paperdiv.selectAll(".main-svg").remove(),Ae._paperdiv.select(".modebar-container").remove(),Ae._paper=Ae._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Ae._toppaper=Ae._paperdiv.append("svg").classed("main-svg",!0),Ae._modebardiv=Ae._paperdiv.append("div"),delete Ae._modeBar,Ae._hoverpaper=Ae._paperdiv.append("svg").classed("main-svg",!0),!Ae._uid){var ke={};r.selectAll("defs").each(function(){this.id&&(ke[this.id.split("-")[1]]=1)}),Ae._uid=a.randstr(ke)}Ae._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),Ae._defs=Ae._paper.append("defs").attr("id","defs-"+Ae._uid),Ae._clips=Ae._defs.append("g").classed("clips",!0),Ae._topdefs=Ae._toppaper.append("defs").attr("id","topdefs-"+Ae._uid),Ae._topclips=Ae._topdefs.append("g").classed("clips",!0),Ae._bgLayer=Ae._paper.append("g").classed("bglayer",!0),Ae._draggers=Ae._paper.append("g").classed("draglayer",!0);var Ee=Ae._paper.append("g").classed("layer-below",!0);Ae._imageLowerLayer=Ee.append("g").classed("imagelayer",!0),Ae._shapeLowerLayer=Ee.append("g").classed("shapelayer",!0),Ae._cartesianlayer=Ae._paper.append("g").classed("cartesianlayer",!0),Ae._polarlayer=Ae._paper.append("g").classed("polarlayer",!0),Ae._smithlayer=Ae._paper.append("g").classed("smithlayer",!0),Ae._ternarylayer=Ae._paper.append("g").classed("ternarylayer",!0),Ae._geolayer=Ae._paper.append("g").classed("geolayer",!0),Ae._funnelarealayer=Ae._paper.append("g").classed("funnelarealayer",!0),Ae._pielayer=Ae._paper.append("g").classed("pielayer",!0),Ae._iciclelayer=Ae._paper.append("g").classed("iciclelayer",!0),Ae._treemaplayer=Ae._paper.append("g").classed("treemaplayer",!0),Ae._sunburstlayer=Ae._paper.append("g").classed("sunburstlayer",!0),Ae._indicatorlayer=Ae._toppaper.append("g").classed("indicatorlayer",!0),Ae._glimages=Ae._paper.append("g").classed("glimages",!0);var De=Ae._toppaper.append("g").classed("layer-above",!0);Ae._imageUpperLayer=De.append("g").classed("imagelayer",!0),Ae._shapeUpperLayer=De.append("g").classed("shapelayer",!0),Ae._selectionLayer=Ae._toppaper.append("g").classed("selectionlayer",!0),Ae._infolayer=Ae._toppaper.append("g").classed("infolayer",!0),Ae._menulayer=Ae._toppaper.append("g").classed("menulayer",!0),Ae._zoomlayer=Ae._toppaper.append("g").classed("zoomlayer",!0),Ae._hoverlayer=Ae._hoverpaper.append("g").classed("hoverlayer",!0),Ae._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),me.emit("plotly_framework")}e.animate=Pt,e.addFrames=mt,e.deleteFrames=Mt,e.addTraces=H,e.deleteTraces=$,e.extendTraces=J,e.moveTraces=U,e.prependTraces=N,e.newPlot=z,e._doPlot=b,e.purge=lt,e.react=Ke,e.redraw=P,e.relayout=ne,e.restyle=V,e.setPlotConfig=T,e.update=ae,e._guiRelayout=ee(ne),e._guiRestyle=ee(V),e._guiUpdate=ee(ae),e._storeDirectGUIEdit=K}}),Sp=de({"src/snapshot/helpers.js"(e){"use strict";var r=Sa();e.getDelay=function(a){return a._has&&(a._has("gl3d")||a._has("map"))?500:0},e.getRedrawFunc=function(a){return function(){r.getComponentMethod("colorbar","draw")(a)}},e.encodeSVG=function(a){return"data:image/svg+xml,"+encodeURIComponent(a)},e.encodeJSON=function(a){return"data:application/json,"+encodeURIComponent(a)};var t=window.URL||window.webkitURL;e.createObjectURL=function(a){return t.createObjectURL(a)},e.revokeObjectURL=function(a){return t.revokeObjectURL(a)},e.createBlob=function(a,o){if(o==="svg")return new window.Blob([a],{type:"image/svg+xml;charset=utf-8"});if(o==="full-json")return new window.Blob([a],{type:"application/json;charset=utf-8"});var s=i(window.atob(a));return new window.Blob([s],{type:"image/"+o})},e.octetStream=function(a){document.location.href="data:application/octet-stream"+a},e.getPlotTitle=function(a){var o,s,l,n,u=a._fullLayout;if(u){var c=(o=u.title)==null?void 0:o.text;return c===((s=u._dfltTitle)==null?void 0:s.plot)?void 0:c}return(n=(l=a.layout)==null?void 0:l.title)==null?void 0:n.text},e.getPlotSubtitle=function(a){var o,s,l,n,u,c,f=a._fullLayout;if(f){var h=(s=(o=f.title)==null?void 0:o.subtitle)==null?void 0:s.text;return h===((l=f._dfltTitle)==null?void 0:l.subtitle)?void 0:h}return(c=(u=(n=a.layout)==null?void 0:n.title)==null?void 0:u.subtitle)==null?void 0:c.text};function i(a){for(var o=a.length,s=new ArrayBuffer(o),l=new Uint8Array(s),n=0;n{let v=_.toLowerCase();return c.includes(v)?_:f.includes(v)?"<":h.includes(v)?">":_.includes("<")||_.includes(">")?"":m.html(_).text()});return m.remove(),y}function p(g){return g.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}r.exports=function(m,y,_){var v=m._fullLayout,x=v._paper,S=v._toppaper,M=v.width,C=v.height,w;x.insert("rect",":first-child").call(a.setRect,0,0,M,C).call(o.fill,v.paper_bgcolor);var k=v._basePlotModules||[];for(w=0;w1&&C.push(d("object","layout"))),i.supplyDefaults(w);for(var b=w._fullData,E=k.length,T=0;TF.length&&M.push(d("unused",C,E.concat(F.length)));var L=F.length,B=Array.isArray(I);B&&(L=Math.min(L,I.length));var O,G,W,X,Z;if(D.dimensions===2)for(G=0;GF[G].length&&M.push(d("unused",C,E.concat(G,F[G].length)));var J=F[G].length;for(O=0;O<(B?Math.min(J,I[G].length):J);O++)W=B?I[G][O]:I,X=T[G][O],Z=F[G][O],t.validate(X,W)?Z!==X&&Z!==+X&&M.push(d("dynamic",C,E.concat(G,O),X,Z)):M.push(d("value",C,E.concat(G,O),X))}else M.push(d("array",C,E.concat(G),T[G]));else for(G=0;GP?M.push({code:"unused",traceType:T,templateCount:R,dataCount:P}):P>R&&M.push({code:"reused",traceType:T,templateCount:R,dataCount:P})}}function z(I,L){for(var B in I)if(B.charAt(0)!=="_"){var O=I[B],G=d(I,B,L);t(O)?(Array.isArray(I)&&O._template===!1&&O.templateitemname&&M.push({code:"missing",path:G,templateitemname:O.templateitemname}),z(O,G)):Array.isArray(O)&&p(O)&&z(O,G)}}if(z({data:w,layout:C},""),M.length)return M.map(g)};function p(m){for(var y=0;y=0;g--){var m=s[g];if(m.type==="scatter"&&m.xaxis===d.xaxis&&m.yaxis===d.yaxis){m.opacity=void 0;break}}}}}}}),eV=de({"src/traces/scatter/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=Tw();r.exports=function(a,o){function s(n,u){return t.coerce(a,o,i,n,u)}var l=o.barmode==="group";o.scattermode==="group"&&s("scattergap",l?o.bargap:.2)}}}),bd=de({"src/plots/cartesian/align_period.js"(e,r){"use strict";var t=da(),i=Qt(),a=i.dateTime2ms,o=i.incrementMonth,s=cn(),l=s.ONEAVGMONTH;r.exports=function(u,c,f,h){if(c.type!=="date")return{vals:h};var d=u[f+"periodalignment"];if(!d)return{vals:h};var p=u[f+"period"],g;if(t(p)){if(p=+p,p<=0)return{vals:h}}else if(typeof p=="string"&&p.charAt(0)==="M"){var m=+p.substring(1);if(m>0&&Math.round(m)===m)g=m;else return{vals:h}}for(var y=c.calendar,_=d==="start",v=d==="end",x=u[f+"period0"],S=a(x,y)||0,M=[],C=[],w=[],k=h.length,A=0;Ab;)F=o(F,-g,y);for(;F<=b;)F=o(F,g,y);T=o(F,-g,y)}else{for(E=Math.round((b-S)/p),F=S+E*p;F>b;)F-=p;for(;F<=b;)F+=p;T=F-p}M[A]=_?T:v?F:(T+F)/2,C[A]=T,w[A]=F}return{vals:M,starts:C,ends:w}}}}),Uh=de({"src/traces/scatter/colorscale_calc.js"(e,r){"use strict";var t=Wu().hasColorscale,i=hc(),a=bs();r.exports=function(s,l){a.hasLines(l)&&t(l,"line")&&i(s,l,{vals:l.line.color,containerStr:"line",cLetter:"c"}),a.hasMarkers(l)&&(t(l,"marker")&&i(s,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),t(l,"marker.line")&&i(s,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),ep=de({"src/traces/scatter/arrays_to_calcdata.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){for(var s=0;sz&&T[L].gap;)L--;for(O=T[L].s,I=T.length-1;I>L;I--)T[I].s=O;for(;zX+G||!t(W))}for(var J=0;JL(O))):L(P.text);let B=P.outsidetextfont.size*c*I+u;return{ppadplus:z.some(O=>O.s<0)?B:0,ppadminus:z.some(O=>O.s>=0)?B:0}}return{ppadplus:void 0,ppadminus:void 0}}function F(P,z,I,L){for(var B=R(L),O=0;OR[y]&&y0?s:l)/(y._m*x*(y._m>0?s:l)))),rt*=1e3}if(ht===a){if(v&&(ht=y.c2p(at.y,!0)),ht===a)return!1;ht*=1e3}return[rt,ht]}function Y(Ue,at,rt,ht){var At=rt-Ue,dt=ht-at,Ht=.5-Ue,fr=.5-at,gt=At*At+dt*dt,yt=At*Ht+dt*fr;if(yt>0&&yt1||Math.abs(Ht.y-rt[0][1])>1)&&(Ht=[Ht.x,Ht.y],ht&&se(Ht,Ue)pe||Ue[1]ye)return[c(Ue[0],ce,pe),c(Ue[1],xe,ye)]}function je(Ue,at){if(Ue[0]===at[0]&&(Ue[0]===ce||Ue[0]===pe)||Ue[1]===at[1]&&(Ue[1]===xe||Ue[1]===ye))return!0}function Ve(Ue,at){var rt=[],ht=Te(Ue),At=Te(at);return ht&&At&&je(ht,At)||(ht&&rt.push(ht),At&&rt.push(At)),rt}function Ke(Ue,at,rt){return function(ht,At){var dt=Te(ht),Ht=Te(At),fr=[];if(dt&&Ht&&je(dt,Ht))return fr;dt&&fr.push(dt),Ht&&fr.push(Ht);var gt=2*n.constrain((ht[Ue]+At[Ue])/2,at,rt)-((dt||ht)[Ue]+(Ht||At)[Ue]);if(gt){var yt;dt&&Ht?yt=gt>0==dt[Ue]>Ht[Ue]?dt:Ht:yt=dt||Ht,yt[Ue]+=gt}return fr}}var Je;A==="linear"||A==="spline"?Je=Me:A==="hv"||A==="vh"?Je=Ve:A==="hvh"?Je=Ke(0,ce,pe):A==="vhv"&&(Je=Ke(1,xe,ye));function vt(Ue,at){var rt=at[0]-Ue[0],ht=(at[1]-Ue[1])/rt,At=(Ue[1]*at[0]-at[1]*Ue[0])/rt;return At>0?[ht>0?ce:pe,ye]:[ht>0?pe:ce,xe]}function xt(Ue){var at=Ue[0],rt=Ue[1],ht=at===R[P-1][0],At=rt===R[P-1][1];if(!(ht&&At))if(P>1){var dt=at===R[P-2][0],Ht=rt===R[P-2][1];ht&&(at===ce||at===pe)&&dt?Ht?P--:R[P-1]=Ue:At&&(rt===xe||rt===ye)&&Ht?dt?P--:R[P-1]=Ue:R[P++]=Ue}else R[P++]=Ue}function Pt(Ue){R[P-1][0]!==Ue[0]&&R[P-1][1]!==Ue[1]&&xt([ie,Q]),xt(Ue),ue=null,ie=Q=0}var mt=n.isArrayOrTypedArray(C);function Mt(Ue){if(Ue&&M&&(Ue.i=z,Ue.d=d,Ue.trace=g,Ue.marker=mt?C[Ue.i]:C,Ue.backoff=M),K=Ue[0]/x,te=Ue[1]/S,ae=Ue[0]pe?pe:0,ee=Ue[1]ye?ye:0,ae||ee){if(!P)R[P++]=[ae||Ue[0],ee||Ue[1]];else if(ue){var at=Je(ue,Ue);at.length>1&&(Pt(at[0]),R[P++]=at[1])}else ge=Je(R[P-1],Ue)[0],R[P++]=ge;var rt=R[P-1];ae&&ee&&(rt[0]!==ae||rt[1]!==ee)?(ue&&(ie!==ae&&Q!==ee?xt(ie&&Q?vt(ue,Ue):[ie||ae,Q||ee]):ie&&Q&&xt([ie,Q])),xt([ae,ee])):ie-ae&&Q-ee&&xt([ae||ie,ee||Q]),ue=Ue,ie=ae,Q=ee}else ue&&Pt(Je(ue,Ue)[0]),R[P++]=Ue}for(z=0;zne(G,lt))break;L=G,$=Z[0]*X[0]+Z[1]*X[1],$>N?(N=$,B=G,W=!1):$=d.length||!G)break;Mt(G),I=G}}ue&&xt([ie||ue[0],Q||ue[1]]),T.push(R.slice(0,P))}var qe=A.slice(A.length-1);if(M&&qe!=="h"&&qe!=="v"){for(var Ye=!1,me=-1,_e=[],Ae=0;Ae=0?f=m:(f=m=g,g++),f0,A=c(m,y,_);if(M=v.selectAll("g.trace").data(A,function(E){return E[0].trace.uid}),M.enter().append("g").attr("class",function(E){return"trace scatter trace"+E[0].trace.uid}).style("stroke-miterlimit",2),M.order(),h(m,M,y),k){S&&(C=S());var b=t.transition().duration(x.duration).ease(x.easing).each("end",function(){C&&C()}).each("interrupt",function(){C&&C()});b.each(function(){v.selectAll("g.trace").each(function(E,T){d(m,T,y,E,A,this,x)})})}else M.each(function(E,T){d(m,T,y,E,A,this,x)});w&&M.exit().remove(),v.selectAll("path:not([d])").remove()};function h(g,m,y){m.each(function(_){var v=o(t.select(this),"g","fills");l.setClipUrl(v,y.layerClipId,g);var x=_[0].trace;x._ownFill=null,x._nextFill=null;var S=[];x._ownfill&&S.push("_ownFill"),x._nexttrace&&S.push("_nextFill");var M=v.selectAll("g").data(S,s);M.enter().append("g"),M.exit().remove(),M.order().each(function(C){x[C]=o(t.select(this),"path","js-fill")})})}function d(g,m,y,_,v,x,S){var M=g._context.staticPlot,C;p(g,m,y,_,v);var w=!!S&&S.duration>0;function k(xt){return w?xt.transition():xt}var A=y.xaxis,b=y.yaxis,E=_[0].trace,T=E.line,F=t.select(x),D=o(F,"g","errorbars"),R=o(F,"g","lines"),P=o(F,"g","points"),z=o(F,"g","text");if(i.getComponentMethod("errorbars","plot")(g,D,y,S),E.visible!==!0)return;k(F).style("opacity",E.opacity);var I,L,B=E.fill.charAt(E.fill.length-1);B!=="x"&&B!=="y"&&(B="");var O,G;B==="y"?(O=1,G=b.c2p(0,!0)):B==="x"&&(O=0,G=A.c2p(0,!0)),_[0][y.isRangePlot?"nodeRangePlot3":"node3"]=F;var W="",X=[],Z=E._prevtrace,J=null,N=null;Z&&(W=Z._prevRevpath||"",L=Z._nextFill,X=Z._ownPolygons,J=Z._fillsegments,N=Z._fillElement);var H,$,U="",V="",j,q,Y,K,te,ne,se=[];E._polygons=[];var le=[],ce=[],pe=a.noop;if(I=E._ownFill,n.hasLines(E)||E.fill!=="none"){L&&L.datum(_),["hv","vh","hvh","vhv"].indexOf(T.shape)!==-1?(j=l.steps(T.shape),q=l.steps(T.shape.split("").reverse().join(""))):T.shape==="spline"?j=q=function(xt){var Pt=xt[xt.length-1];return xt.length>1&&xt[0][0]===Pt[0]&&xt[0][1]===Pt[1]?l.smoothclosed(xt.slice(1),T.smoothing):l.smoothopen(xt,T.smoothing)}:j=q=function(xt){return"M"+xt.join("L")},Y=function(xt){return q(xt.reverse())},ce=u(_,{xaxis:A,yaxis:b,trace:E,connectGaps:E.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:E.fill}),le=new Array(ce.length);var xe=0;for(C=0;C=M[0]&&F.x<=M[1]&&F.y>=C[0]&&F.y<=C[1]}),b=Math.ceil(A.length/k),E=0;v.forEach(function(F,D){var R=F[0].trace;n.hasMarkers(R)&&R.marker.maxdisplayed>0&&D=Math.min(Z,J)&&y<=Math.max(Z,J)?0:1/0}var N=Math.max(3,X.mrc||0),H=1-1/N,$=Math.abs(g.c2p(X.x)-y);return $=Math.min(Z,J)&&_<=Math.max(Z,J)?0:1/0}var N=Math.max(3,X.mrc||0),H=1-1/N,$=Math.abs(m.c2p(X.y)-_);return $V!=le>=V&&(te=Y[q-1][0],ne=Y[q][0],le-se&&(K=te+(ne-te)*(V-se)/(le-se),N=Math.min(N,K),H=Math.max(H,K)));return N=Math.max(N,0),H=Math.min(H,g._length),{x0:N,x1:H,y0:V,y1:V}}if(x.indexOf("fills")!==-1&&p._fillElement){var O=L(p._fillElement)&&!L(p._fillExclusionElement);if(O){var G=B(p._polygons);G===null&&(G={x0:v[0],x1:v[0],y0:v[1],y1:v[1]});var W=s.defaultLine;return s.opacity(p.fillcolor)?W=p.fillcolor:s.opacity((p.line||{}).color)&&(W=p.line.color),t.extendFlat(u,{distance:u.maxHoverDistance,x0:G.x0,x1:G.x1,y0:G.y0,y1:G.y1,color:W,hovertemplate:!1}),delete u.index,p.text&&!t.isArrayOrTypedArray(p.text)?u.text=String(p.text):u.text=p.name,[u]}}}}}),Sv=de({"src/traces/scatter/select.js"(e,r){"use strict";var t=bs();r.exports=function(a,o){var s=a.cd,l=a.xaxis,n=a.yaxis,u=[],c=s[0].trace,f,h,d,p,g=c.mode&&!t.hasMarkers(c)&&!t.hasText(c);if(g)return[];if(o===!1)for(f=0;f0&&(h["_"+c+"axes"]||{})[u])return h;if((h[c+"axis"]||c)===u){if(l(h,c))return h;if((h[c]||[]).length||h[c+"0"])return h}}}function s(n){return{v:"x",h:"y"}[n.orientation||"v"]}function l(n,u){var c=s(n),f=t(n,"box-violin");return f&&u===c&&n[c]===void 0&&n[c+"0"]===void 0}}}),Ow=de({"src/plots/cartesian/category_order_defaults.js"(e,r){"use strict";var t=Do().isTypedArraySpec;function i(a,o){var s=o.dataAttr||a._id.charAt(0),l={},n,u,c;if(o.axData)n=o.axData;else for(n=[],u=0;u0||t(u),f;c&&(f="array");var h=l("categoryorder",f),d;h==="array"&&(d=l("categoryarray")),!c&&h==="array"&&(h=s.categoryorder="trace"),h==="trace"?s._initialCategories=[]:h==="array"?s._initialCategories=d.slice():(d=i(s,n).sort(),h==="category ascending"?s._initialCategories=d:h==="category descending"&&(s._initialCategories=d.reverse()))}}}}),Ry=de({"src/plots/cartesian/line_grid_defaults.js"(e,r){"use strict";var t=ta(),i=Jo(),a=Qt();r.exports=function(s,l,n,u){u=u||{};var c=u.dfltColor;function f(T,F){return a.coerce2(s,l,u.attributes,T,F)}var h=f("linecolor",c),d=f("linewidth"),p=n("showline",u.showLine||!!h||!!d);p||(delete l.linecolor,delete l.linewidth);var g=t.mix(c,u.bgColor,u.blend||i.lightFraction),m=f("gridcolor",g),y=f("gridwidth"),_=f("griddash"),v=n("showgrid",u.showGrid||!!m||!!y||!!_);if(v||(delete l.gridcolor,delete l.gridwidth,delete l.griddash),u.hasMinor){var x=t.mix(l.gridcolor,u.bgColor,67),S=f("minor.gridcolor",x),M=f("minor.gridwidth",l.gridwidth||1),C=f("minor.griddash",l.griddash||"solid"),w=n("minor.showgrid",!!S||!!M||!!C);w||(delete l.minor.gridcolor,delete l.minor.gridwidth,delete l.minor.griddash)}if(!u.noZeroLine){var k=f("zerolinelayer"),A=f("zerolinecolor",c),b=f("zerolinewidth"),E=n("zeroline",u.showGrid||!!A||!!b);E||(delete l.zerolinelayer,delete l.zerolinecolor,delete l.zerolinewidth)}}}}),zy=de({"src/plots/cartesian/axis_defaults.js"(e,r){"use strict";var t=da(),i=Sa(),a=Qt(),o=Ro(),s=fc(),l=Mu(),n=xv(),u=h1(),c=d0(),f=p0(),h=Ow(),d=Ry(),p=FE(),g=Xd(),m=zl().WEEKDAY_PATTERN,y=zl().HOUR_PATTERN;r.exports=function(M,C,w,k,A){var b=k.letter,E=k.font||{},T=k.splomStash||{},F=w("visible",!k.visibleDflt),D=C._template||{},R=C.type||D.type||"-",P;if(R==="date"){var z=i.getComponentMethod("calendars","handleDefaults");z(M,C,"calendar",k.calendar),k.noTicklabelmode||(P=w("ticklabelmode"))}!k.noTicklabelindex&&(R==="date"||R==="linear")&&w("ticklabelindex");var I="";(!k.noTicklabelposition||R==="multicategory")&&(I=a.coerce(M,C,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:P==="period"?["outside","inside"]:b==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),k.noTicklabeloverflow||w("ticklabeloverflow",I.indexOf("inside")!==-1?"hide past domain":R==="category"||R==="multicategory"?"allow":"hide past div"),g(C,A),p(M,C,w,k),h(M,C,w,k),k.noHover||(R!=="category"&&w("hoverformat"),k.noUnifiedhovertitle||w("unifiedhovertitle.text"));var L=w("color"),B=L!==l.color.dflt?L:E.color,O=T.label||A._dfltTitle[b];if(f(M,C,w,R,k),!F)return C;w("title.text",O),a.coerceFont(w,"title.font",E,{overrideDflt:{size:a.bigFont(E.size),color:B}}),n(M,C,w,R);var G=k.hasMinor;if(G&&(o.newContainer(C,"minor"),n(M,C,w,R,{isMinor:!0})),c(M,C,w,R,k),u(M,C,w,k),G){var W=k.isMinor;k.isMinor=!0,u(M,C,w,k),k.isMinor=W}d(M,C,w,{dfltColor:L,bgColor:k.bgColor,showGrid:k.showGrid,hasMinor:G,attributes:l}),G&&C.ticklabelindex==null&&!C.minor.ticks&&!C.minor.showgrid&&delete C.minor,(C.showline||C.ticks)&&w("mirror");var X=R==="multicategory";if(!k.noTickson&&(R==="category"||X)&&(C.ticks||C.showgrid)&&(X?(w("tickson","boundaries"),delete C.ticklabelposition):w("tickson")),X){var Z=w("showdividers");Z&&(w("dividercolor"),w("dividerwidth"))}if(R==="date")if(s(M,C,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:_}),!C.rangebreaks.length)delete C.rangebreaks;else{for(var J=0;J=2){var b="",E,T;if(A.length===2){for(E=0;E<2;E++)if(T=x(A[E]),T){b=m;break}}var F=w("pattern",b);if(F===m)for(E=0;E<2;E++)T=x(A[E]),T&&(M.bounds[E]=A[E]=T-1);if(F)for(E=0;E<2;E++)switch(T=A[E],F){case m:if(!t(T)){M.enabled=!1;return}if(T=+T,T!==Math.floor(T)||T<0||T>=7){M.enabled=!1;return}M.bounds[E]=A[E]=T;break;case y:if(!t(T)){M.enabled=!1;return}if(T=+T,T<0||T>24){M.enabled=!1;return}M.bounds[E]=A[E]=T;break}if(C.autorange===!1){var D=C.range;if(D[0]D[1]){M.enabled=!1;return}}else if(A[0]>D[0]&&A[1]w[1]-1/4096&&(s.domain=g),i.noneOrAll(o.domain,s.domain,g),s.tickmode==="sync"&&(s.tickmode="auto")}return l("layer"),s}}}),aV=de({"src/plots/cartesian/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=sf().isUnifiedHover,o=jE(),s=Ro(),l=u1(),n=Mu(),u=ok(),c=zy(),f=wv(),h=Nw(),d=Hs(),p=d.id2name,g=d.name2id,m=zl().AX_ID_PATTERN,y=Sa(),_=y.traceIs,v=y.getComponentMethod;function x(S,M,C){Array.isArray(S[M])?S[M].push(C):S[M]=[C]}r.exports=function(M,C,w){var k=C.autotypenumbers,A={},b={},E={},T={},F={},D={},R={},P={},z={},I={},L,B;for(L=0;L rect").call(o.setTranslate,0,0).call(o.setScale,1,1),C.plot.call(o.setTranslate,w._offset,k._offset).call(o.setScale,1,1);var A=C.plot.selectAll(".scatterlayer .trace");A.selectAll(".point").call(o.setPointGroupScale,1,1),A.selectAll(".textpoint").call(o.setTextPointsScale,1,1),A.call(o.hideOutsideRangePoints,C)}function p(C,w){var k=C.plotinfo,A=k.xaxis,b=k.yaxis,E=A._length,T=b._length,F=!!C.xr1,D=!!C.yr1,R=[];if(F){var P=a.simpleMap(C.xr0,A.r2l),z=a.simpleMap(C.xr1,A.r2l),I=P[1]-P[0],L=z[1]-z[0];R[0]=(P[0]*(1-w)+w*z[0]-P[0])/(P[1]-P[0])*E,R[2]=E*(1-w+w*L/I),A.range[0]=A.l2r(P[0]*(1-w)+w*z[0]),A.range[1]=A.l2r(P[1]*(1-w)+w*z[1])}else R[0]=0,R[2]=E;if(D){var B=a.simpleMap(C.yr0,b.r2l),O=a.simpleMap(C.yr1,b.r2l),G=B[1]-B[0],W=O[1]-O[0];R[1]=(B[1]*(1-w)+w*O[1]-B[1])/(B[0]-B[1])*T,R[3]=T*(1-w+w*W/G),b.range[0]=A.l2r(B[0]*(1-w)+w*O[0]),b.range[1]=b.l2r(B[1]*(1-w)+w*O[1])}else R[1]=0,R[3]=T;s.drawOne(n,A,{skipTitle:!0}),s.drawOne(n,b,{skipTitle:!0}),s.redrawComponents(n,[A._id,b._id]);var X=F?E/R[2]:1,Z=D?T/R[3]:1,J=F?R[0]:0,N=D?R[1]:0,H=F?R[0]/R[2]*E:0,$=D?R[1]/R[3]*T:0,U=A._offset-H,V=b._offset-$;k.clipRect.call(o.setTranslate,J,N).call(o.setScale,1/X,1/Z),k.plot.call(o.setTranslate,U,V).call(o.setScale,X,Z),o.setPointGroupScale(k.zoomScalePts,1/X,1/Z),o.setTextPointsScale(k.zoomScaleTxt,1/X,1/Z)}var g;f&&(g=f());function m(){for(var C={},w=0;wc.duration?(m(),x=window.cancelAnimationFrame(M)):x=window.requestAnimationFrame(M)}return _=Date.now(),x=window.requestAnimationFrame(M),Promise.resolve()}}}),ml=de({"src/plots/cartesian/index.js"(e){"use strict";var r=Yr(),t=Sa(),i=Qt(),a=ks(),o=hn(),s=$u().getModuleCalcData,l=Hs(),n=zl(),u=Nh(),c=i.ensureSingle;function f(_,v,x){return i.ensureSingle(_,v,x,function(S){S.datum(x)})}var h=n.zindexSeparator;e.name="cartesian",e.attr=["xaxis","yaxis"],e.idRoot=["x","y"],e.idRegex=n.idRegex,e.attrRegex=n.attrRegex,e.attributes=iV(),e.layoutAttributes=Mu(),e.supplyLayoutDefaults=aV(),e.transitionAxes=nV(),e.finalizeSubplots=function(_,v){var x=v._subplots,S=x.xaxis,M=x.yaxis,C=x.cartesian,w=C,k={},A={},b,E,T;for(b=0;b0){var D=F.id;if(D.indexOf(h)!==-1)continue;D+=h+(b+1),F=i.extendFlat({},F,{id:D,plot:M._cartesianlayer.selectAll(".subplot").select("."+D)})}for(var R=[],P,z=0;z1&&(G+=h+O),B.push(k+G),w=0;w1,T=v.mainplotinfo;if(!v.mainplot||E)if(b)v.xlines=c(S,"path","xlines-above"),v.ylines=c(S,"path","ylines-above"),v.xaxislayer=c(S,"g","xaxislayer-above"),v.yaxislayer=c(S,"g","yaxislayer-above");else{if(!w){var F=c(S,"g","layer-subplot");v.shapelayer=c(F,"g","shapelayer"),v.imagelayer=c(F,"g","imagelayer"),T&&E?(v.minorGridlayer=T.minorGridlayer,v.gridlayer=T.gridlayer,v.zerolinelayer=T.zerolinelayer):(v.minorGridlayer=c(S,"g","minor-gridlayer"),v.gridlayer=c(S,"g","gridlayer"),v.zerolinelayer=c(S,"g","zerolinelayer"));var D=c(S,"g","layer-between");v.shapelayerBetween=c(D,"g","shapelayer"),v.imagelayerBetween=c(D,"g","imagelayer"),c(S,"path","xlines-below"),c(S,"path","ylines-below"),v.overlinesBelow=c(S,"g","overlines-below"),c(S,"g","xaxislayer-below"),c(S,"g","yaxislayer-below"),v.overaxesBelow=c(S,"g","overaxes-below")}v.overplot=c(S,"g","overplot"),v.plot=c(v.overplot,"g",M),T&&E?v.zerolinelayerAbove=T.zerolinelayerAbove:v.zerolinelayerAbove=c(S,"g","zerolinelayer-above"),w||(v.xlines=c(S,"path","xlines-above"),v.ylines=c(S,"path","ylines-above"),v.overlinesAbove=c(S,"g","overlines-above"),c(S,"g","xaxislayer-above"),c(S,"g","yaxislayer-above"),v.overaxesAbove=c(S,"g","overaxes-above"),v.xlines=S.select(".xlines-"+k),v.ylines=S.select(".ylines-"+A),v.xaxislayer=S.select(".xaxislayer-"+k),v.yaxislayer=S.select(".yaxislayer-"+A))}else{var R=T.plotgroup,P=M+"-x",z=M+"-y";v.minorGridlayer=T.minorGridlayer,v.gridlayer=T.gridlayer,v.zerolinelayer=T.zerolinelayer,v.zerolinelayerAbove=T.zerolinelayerAbove,c(T.overlinesBelow,"path",P),c(T.overlinesBelow,"path",z),c(T.overaxesBelow,"g",P),c(T.overaxesBelow,"g",z),v.plot=c(T.overplot,"g",M),c(T.overlinesAbove,"path",P),c(T.overlinesAbove,"path",z),c(T.overaxesAbove,"g",P),c(T.overaxesAbove,"g",z),v.xlines=R.select(".overlines-"+k).select("."+P),v.ylines=R.select(".overlines-"+A).select("."+z),v.xaxislayer=R.select(".overaxes-"+k).select("."+P),v.yaxislayer=R.select(".overaxes-"+A).select("."+z)}w||(b||(f(v.minorGridlayer,"g",v.xaxis._id),f(v.minorGridlayer,"g",v.yaxis._id),v.minorGridlayer.selectAll("g").map(function(I){return I[0]}).sort(l.idSort),f(v.gridlayer,"g",v.xaxis._id),f(v.gridlayer,"g",v.yaxis._id),v.gridlayer.selectAll("g").map(function(I){return I[0]}).sort(l.idSort)),v.xlines.style("fill","none").classed("crisp",!0),v.ylines.style("fill","none").classed("crisp",!0))}function m(_,v){if(_){var x={};_.each(function(A){var b=A[0],E=r.select(this);E.remove(),y(b,v),x[b]=!0});for(var S in v._plots)for(var M=v._plots[S],C=M.overlays||[],w=0;w=0,v=f.indexOf("end")>=0,x=p.backoff*m+h.standoff,S=g.backoff*y+h.startstandoff,M,C,w,k;if(d.nodeName==="line"){M={x:+c.attr("x1"),y:+c.attr("y1")},C={x:+c.attr("x2"),y:+c.attr("y2")};var A=M.x-C.x,b=M.y-C.y;if(w=Math.atan2(b,A),k=w+Math.PI,x&&S&&x+S>Math.sqrt(A*A+b*b)){G();return}if(x){if(x*x>A*A+b*b){G();return}var E=x*Math.cos(w),T=x*Math.sin(w);C.x+=E,C.y+=T,c.attr({x2:C.x,y2:C.y})}if(S){if(S*S>A*A+b*b){G();return}var F=S*Math.cos(w),D=S*Math.sin(w);M.x-=F,M.y-=D,c.attr({x1:M.x,y1:M.y})}}else if(d.nodeName==="path"){var R=d.getTotalLength(),P="";if(R2/3?Ct="right":Ct="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[Ct]}for(var ge=!1,Me=["x","y"],Te=0;Te1)&&(Ke===Ve?(De=Je.r2fraction(S["a"+je]),(De<0||De>1)&&(ge=!0)):ge=!0),Ye=Je._offset+Je.r2p(S[je]),Ae=.5}else{var Qe=Ee==="domain";je==="x"?(_e=S[je],Ye=Qe?Je._offset+Je._length*_e:Ye=b.l+b.w*_e):(_e=1-S[je],Ye=Qe?Je._offset+Je._length*_e:Ye=b.t+b.h*_e),Ae=S.showarrow?.5:_e}if(S.showarrow){qe.head=Ye;var Ue=S["a"+je];if(ke=xt*ue(.5,S.xanchor)-Pt*ue(.5,S.yanchor),Ke===Ve){var at=l.getRefType(Ke);at==="domain"?(je==="y"&&(Ue=1-Ue),qe.tail=Je._offset+Je._length*Ue):at==="paper"?je==="y"?(Ue=1-Ue,qe.tail=b.t+b.h*Ue):qe.tail=b.l+b.w*Ue:qe.tail=Je._offset+Je.r2p(Ue),me=ke}else qe.tail=Ye+Ue,me=ke+Ue;qe.text=qe.tail+ke;var rt=A[je==="x"?"width":"height"];if(Ve==="paper"&&(qe.head=o.constrain(qe.head,1,rt-1)),Ke==="pixel"){var ht=-Math.max(qe.tail-3,qe.text),At=Math.min(qe.tail+3,qe.text)-rt;ht>0?(qe.tail+=ht,qe.text+=ht):At>0&&(qe.tail-=At,qe.text-=At)}qe.tail+=lt,qe.head+=lt}else ke=mt*ue(Ae,Mt),me=ke,qe.text=Ye+ke;qe.text+=lt,ke+=lt,me+=lt,S["_"+je+"padplus"]=mt/2+me,S["_"+je+"padminus"]=mt/2-me,S["_"+je+"size"]=mt,S["_"+je+"shift"]=ke}if(ge){J.remove();return}var dt=0,Ht=0;if(S.align!=="left"&&(dt=(ae-ye)*(S.align==="center"?.5:1)),S.valign!=="top"&&(Ht=(ee-fe)*(S.valign==="middle"?.5:1)),pe)ce.select("svg").attr({x:$+dt-1,y:$+Ht}).call(u.setClipUrl,V?I:null,x);else{var fr=$+Ht-xe.top,gt=$+dt-xe.left;K.call(f.positionText,gt,fr).call(u.setClipUrl,V?I:null,x)}j.select("rect").call(u.setRect,$,$,ae,ee),U.call(u.setRect,N/2,N/2,ie-N,Q-N),J.call(u.setTranslate,Math.round(L.x.text-ie/2),Math.round(L.y.text-Q/2)),G.attr({transform:"rotate("+B+","+L.x.text+","+L.y.text+")"});var yt=function(Lt,Ct){O.selectAll(".annotation-arrow-g").remove();var $t=L.x.head,mr=L.y.head,br=L.x.tail+Lt,Er=L.y.tail+Ct,Tr=L.x.text+Lt,Ur=L.y.text+Ct,Ai=o.rotationXYMatrix(B,Tr,Ur),oi=o.apply2DTransform(Ai),Qr=o.apply2DTransform2(Ai),ea=+U.attr("width"),$i=+U.attr("height"),ja=Tr-.5*ea,ya=ja+ea,pa=Ur-.5*$i,xi=pa+$i,bi=[[ja,pa,ja,xi],[ja,xi,ya,xi],[ya,xi,ya,pa],[ya,pa,ja,pa]].map(Qr);if(!bi.reduce(function(ze,tt){return ze^!!o.segmentsIntersect($t,mr,$t+1e6,mr+1e6,tt[0],tt[1],tt[2],tt[3])},!1)){bi.forEach(function(ze){var tt=o.segmentsIntersect(br,Er,$t,mr,ze[0],ze[1],ze[2],ze[3]);tt&&(br=tt.x,Er=tt.y)});var Ua=S.arrowwidth,dn=S.arrowcolor,pi=S.arrowside,Jr=O.append("g").style({opacity:n.opacity(dn)}).classed("annotation-arrow-g",!0),Be=Jr.append("path").attr("d","M"+br+","+Er+"L"+$t+","+mr).style("stroke-width",Ua+"px").call(n.stroke,n.rgb(dn));if(g(Be,pi,S),E.annotationPosition&&Be.node().parentNode&&!C){var Fe=$t,Et=mr;if(S.standoff){var St=Math.sqrt(Math.pow($t-br,2)+Math.pow(mr-Er,2));Fe+=S.standoff*(br-$t)/St,Et+=S.standoff*(Er-mr)/St}var zt=Jr.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(br-Fe)+","+(Er-Et),transform:s(Fe,Et)}).style("stroke-width",Ua+6+"px").call(n.stroke,"rgba(0,0,0,0)").call(n.fill,"rgba(0,0,0,0)"),Wt,Yt;d.init({element:zt.node(),gd:x,prepFn:function(){var ze=u.getTranslate(J);Wt=ze.x,Yt=ze.y,w&&w.autorange&&R(w._name+".autorange",!0),k&&k.autorange&&R(k._name+".autorange",!0)},moveFn:function(ze,tt){var ft=oi(Wt,Yt),wt=ft[0]+ze,jt=ft[1]+tt;J.call(u.setTranslate,wt,jt),P("x",_(w,ze,"x",b,S)),P("y",_(k,tt,"y",b,S)),S.axref===S.xref&&P("ax",_(w,ze,"ax",b,S)),S.ayref===S.yref&&P("ay",_(k,tt,"ay",b,S)),Jr.attr("transform",s(ze,tt)),G.attr({transform:"rotate("+B+","+wt+","+jt+")"})},doneFn:function(){i.call("_guiRelayout",x,z());var ze=document.querySelector(".js-notes-box-panel");ze&&ze.redraw(ze.selectedObj)}})}}};if(S.showarrow&&yt(0,0),W){var kt;d.init({element:J.node(),gd:x,prepFn:function(){kt=G.attr("transform")},moveFn:function(Lt,Ct){var $t="pointer";if(S.showarrow)S.axref===S.xref?P("ax",_(w,Lt,"ax",b,S)):P("ax",S.ax+Lt),S.ayref===S.yref?P("ay",_(k,Ct,"ay",b.w,S)):P("ay",S.ay+Ct),yt(Lt,Ct);else{if(C)return;var mr,br;if(w)mr=_(w,Lt,"x",b,S);else{var Er=S._xsize/b.w,Tr=S.x+(S._xshift-S.xshift)/b.w-Er/2;mr=d.align(Tr+Lt/b.w,Er,0,1,S.xanchor)}if(k)br=_(k,Ct,"y",b,S);else{var Ur=S._ysize/b.h,Ai=S.y-(S._yshift+S.yshift)/b.h-Ur/2;br=d.align(Ai-Ct/b.h,Ur,0,1,S.yanchor)}P("x",mr),P("y",br),(!w||!k)&&($t=d.getCursor(w?.5:mr,k?.5:br,S.xanchor,S.yanchor))}G.attr({transform:s(Lt,Ct)+kt}),h(J,$t)},clickFn:function(Lt,Ct){S.captureevents&&x.emit("plotly_clickannotation",Z(Ct))},doneFn:function(){h(J),i.call("_guiRelayout",x,z());var Lt=document.querySelector(".js-notes-box-panel");Lt&&Lt.redraw(Lt.selectedObj)}})}}E.annotationText?K.call(f.makeEditable,{delegate:J,gd:x}).call(te).on("edit",function(se){S.text=se,this.call(te),P("text",se),w&&w.autorange&&R(w._name+".autorange",!0),k&&k.autorange&&R(k._name+".autorange",!0),i.call("_guiRelayout",x,z())}):K.call(te)}}}),lV=de({"src/components/annotations/click.js"(e,r){"use strict";var t=Qt(),i=Sa(),a=Ro().arrayEditor;r.exports={hasClickToShow:o,onClick:s};function o(u,c){var f=l(u,c);return f.on.length>0||f.explicitOff.length>0}function s(u,c){var f=l(u,c),h=f.on,d=f.off.concat(f.explicitOff),p={},g=u._fullLayout.annotations,m,y;if(h.length||d.length){for(m=0;m1){h=!0;break}}h?s.fullLayout._infolayer.select(".annotation-"+s.id+'[data-index="'+c+'"]').remove():(f._pdata=i(s.glplot.cameraParams,[l.xaxis.r2l(f.x)*n[0],l.yaxis.r2l(f.y)*n[1],l.zaxis.r2l(f.z)*n[2]]),t(s.graphDiv,f,c,s.id,f._xa,f._ya))}}}}),mV=de({"src/components/annotations3d/index.js"(e,r){"use strict";var t=Sa(),i=Qt();r.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Uw()}}},layoutAttributes:Uw(),handleDefaults:dV(),includeBasePlot:a,convert:pV(),draw:vV()};function a(o,s){var l=t.subplotsRegistry.gl3d;if(l)for(var n=l.attrRegex,u=Object.keys(o),c=0;c{var T=E+"anchor",F=E==="x"?x:S,D={_fullLayout:f},R,P,z,I;let L=E+"ref",B=u[L];if(Array.isArray(B)&&B.length>0){let O=s.countDefiningCoords(y,g,E);I=i.coerceRefArray(u,c,D,E,void 0,"paper",O),c["_"+E+"refArray"]=!0}else I=i.coerceRef(u,c,D,E,void 0,"paper");if(Array.isArray(I))I.forEach(function(O){i.getRefType(O)==="range"&&(R=i.getFromId(D,O),R&&R._shapeIndices.indexOf(c._index)===-1&&R._shapeIndices.push(c._index))}),_&&[0,1].forEach(function(O){let G=I[O];i.getRefType(G)==="range"?(R=i.getFromId(D,G),P=s.shapePositionToRange(R),z=s.rangeToShapePosition(R),(R.type==="category"||R.type==="multicategory")&&h(E+O+"shift")):P=z=t.identity;let X=E+O,Z=u[X];if(u[X]=P(u[X],!0),F==="pixel"?h(X,C[O]):i.coercePosition(c,D,h,G,X,M[O]),c[X]=z(c[X]),u[X]=Z,O===0&&F==="pixel"){let J=u[T];u[T]=P(u[T],!0),i.coercePosition(c,D,h,G,T,.25),c[T]=z(c[T]),u[T]=J}});else{if(i.getRefType(I)==="range"?(R=i.getFromId(D,I),R._shapeIndices.push(c._index),z=s.rangeToShapePosition(R),P=s.shapePositionToRange(R),_&&(R.type==="category"||R.type==="multicategory")&&(h(E+"0shift"),h(E+"1shift"))):P=z=t.identity,_){let G=E+"0",W=E+"1",X=u[G],Z=u[W];u[G]=P(u[G],!0),u[W]=P(u[W],!0),F==="pixel"?(h(G,C[0]),h(W,C[1])):(i.coercePosition(c,D,h,I,G,M[0]),i.coercePosition(c,D,h,I,W,M[1])),c[G]=z(c[G]),c[W]=z(c[W]),u[G]=X,u[W]=Z}if(F==="pixel"){let G=u[T];u[T]=P(u[T],!0),i.coercePosition(c,D,h,I,T,.25),c[T]=z(c[T]),u[T]=G}}}),_&&t.noneOrAll(u,c,["x0","x1","y0","y1"]);var w=y==="line",k,A;if(_&&(k=h("label.texttemplate"),h("label.texttemplatefallback")),k||(A=h("label.text")),A||k){h("label.textangle");var b=h("label.textposition",w?"middle":"middle center");h("label.xanchor"),h("label.yanchor",l(w,b)),h("label.padding"),t.coerceFont(h,"label.font",f.font)}}}}),yV=de({"src/components/shapes/draw_newshape/defaults.js"(e,r){"use strict";var t=ta(),i=Qt();function a(o,s){return o?"bottom":s.indexOf("top")!==-1?"top":s.indexOf("bottom")!==-1?"bottom":"middle"}r.exports=function(s,l,n){n("newshape.visible"),n("newshape.name"),n("newshape.showlegend"),n("newshape.legend"),n("newshape.legendwidth"),n("newshape.legendgroup"),n("newshape.legendgrouptitle.text"),i.coerceFont(n,"newshape.legendgrouptitle.font"),n("newshape.legendrank"),n("newshape.drawdirection"),n("newshape.layer"),n("newshape.fillcolor"),n("newshape.fillrule"),n("newshape.opacity");var u=n("newshape.line.width");if(u){var c=(s||{}).plot_bgcolor||"#FFF";n("newshape.line.color",t.contrast(c)),n("newshape.line.dash")}var f=s.dragmode==="drawline",h=n("newshape.label.text"),d=n("newshape.label.texttemplate");if(n("newshape.label.texttemplatefallback"),h||d){n("newshape.label.textangle");var p=n("newshape.label.textposition",f?"middle":"middle center");n("newshape.label.xanchor"),n("newshape.label.yanchor",a(f,p)),n("newshape.label.padding"),i.coerceFont(n,"newshape.label.font",l.font)}n("activeshape.fillcolor"),n("activeshape.opacity")}}}),_V=de({"src/components/shapes/calc_autorange.js"(e,r){"use strict";var t=Qt(),i=nn(),a=Dy(),o=g0();r.exports=function(h){var d=h._fullLayout,p=t.filterVisible(d.shapes);if(!(!p.length||!h._fullData.length))for(var g=0;g{y=i.getFromId(h,M),m._extremes[y._id]=i.findExtremes(y,C,l(m))})}else m.xref!=="paper"&&v!=="domain"&&(y=i.getFromId(h,m.xref),_=c(y,m,a.paramIsX),_&&(m._extremes[y._id]=i.findExtremes(y,_,l(m))));if(x==="array"){let S=s(h,m,"y");Object.entries(S).forEach(([M,C])=>{y=i.getFromId(h,M),m._extremes[y._id]=i.findExtremes(y,C,n(m))})}else m.yref!=="paper"&&x!=="domain"&&(y=i.getFromId(h,m.yref),_=c(y,m,a.paramIsY),_&&(m._extremes[y._id]=i.findExtremes(y,_,n(m))))}};function s(f,h,d){let p=h[d+"ref"],g=d==="x"?a.paramIsX:a.paramIsY;function m(M,C){M==="paper"||i.getRefType(M)==="domain"||(y[M]||(y[M]=[]),y[M].push(C))}let y={};if(h.type==="path"&&h.path){let M=h.path.match(a.segmentRE)||[];for(var _=0,v=0;vk&&(m(p[_],A[k]),_++)}}else m(p[0],h[d+"0"]),m(p[1],h[d+"1"]);let x={};for(let M in y){let C=i.getFromId(f,M);if(C){var S=C.type==="category"||C.type==="multicategory"?C.r2c:C.d2c;C.type==="date"&&(S=o.decodeDate(S)),x[C._id]=y[M].map(S)}}return x}function l(f){return u(f.line.width,f.xsizemode,f.x0,f.x1,f.path,!1)}function n(f){return u(f.line.width,f.ysizemode,f.y0,f.y1,f.path,!0)}function u(f,h,d,p,g,m){var y=f/2,_=m;if(h==="pixel"){var v=g?o.extractPathCoords(g,m?a.paramIsY:a.paramIsX):[d,p],x=t.aggNums(Math.max,null,v),S=t.aggNums(Math.min,null,v),M=S<0?Math.abs(S)+y:y,C=x>0?x+y:y;return{ppad:y,ppadplus:_?M:C,ppadminus:_?C:M}}else return{ppad:y}}function c(f,h,d){var p=f._id.charAt(0)==="x"?"x":"y",g=f.type==="category"||f.type==="multicategory",m,y,_=0,v=0,x=g?f.r2c:f.d2c,S=h[p+"sizemode"]==="scaled";if(S?(m=h[p+"0"],y=h[p+"1"],g&&(_=h[p+"0shift"],v=h[p+"1shift"])):(m=h[p+"anchor"],y=h[p+"anchor"]),m!==void 0)return[x(m)+_,x(y)+v];if(h.path){var M=1/0,C=-1/0,w=h.path.match(a.segmentRE),k,A,b,E,T;for(f.type==="date"&&(x=o.decodeDate(x)),k=0;kC&&(C=T)));if(C>=M)return[M,C]}}}}),xV=de({"src/components/shapes/index.js"(e,r){"use strict";var t=Lw();r.exports={moduleType:"component",name:"shapes",layoutAttributes:uk(),supplyLayoutDefaults:gV(),supplyDrawNewShapeDefaults:yV(),includeBasePlot:Iy()("shapes"),calcAutorange:_V(),draw:t.draw,drawOne:t.drawOne}}}),ck=de({"src/components/images/attributes.js"(e,r){"use strict";var t=zl(),i=Ro().templatedArray,a=Py();r.exports=i("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",t.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",t.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),bV=de({"src/components/images/defaults.js"(e,r){"use strict";var t=Qt(),i=nn(),a=fc(),o=ck(),s="images";r.exports=function(u,c){var f={name:s,handleItemDefaults:l};a(u,c,f)};function l(n,u,c){function f(x,S){return t.coerce(n,u,o,x,S)}var h=f("source"),d=f("visible",!!h);if(!d)return u;f("layer"),f("xanchor"),f("yanchor"),f("sizex"),f("sizey"),f("sizing"),f("opacity");for(var p={_fullLayout:c},g=["x","y"],m=0;m<2;m++){var y=g[m],_=i.coerceRef(n,u,p,y,"paper",void 0);if(_!=="paper"){var v=i.getFromId(p,_);v._imgIndices.push(u._index)}i.coercePosition(u,p,f,_,y,0)}return u}}}),wV=de({"src/components/images/draw.js"(e,r){"use strict";var t=Yr(),i=hn(),a=nn(),o=Hs(),s=Nh();r.exports=function(n){var u=n._fullLayout,c=[],f={},h=[],d,p;for(p=0;p0);g&&(d("active"),d("direction"),d("type"),d("showactive"),d("x"),d("y"),t.noneOrAll(c,f,["x","y"]),d("xanchor"),d("yanchor"),d("pad.t"),d("pad.r"),d("pad.b"),d("pad.l"),t.coerceFont(d,"font",h.font),d("bgcolor",h.paper_bgcolor),d("bordercolor"),d("borderwidth"))}function u(c,f){function h(p,g){return t.coerce(c,f,l,p,g)}var d=h("visible",c.method==="skip"||Array.isArray(c.args));d&&(h("method"),h("args"),h("args2"),h("label"),h("execute"))}}}),SV=de({"src/components/updatemenus/scrollbox.js"(e,r){"use strict";r.exports=s;var t=Yr(),i=ta(),a=hn(),o=Qt();function s(l,n,u){this.gd=l,this.container=n,this.id=u,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(n,u,c){var f=this.gd._fullLayout,h=f.width,d=f.height;this.position=n;var p=this.position.l,g=this.position.w,m=this.position.t,y=this.position.h,_=this.position.direction,v=_==="down",x=_==="left",S=_==="right",M=_==="up",C=g,w=y,k,A,b,E;!v&&!x&&!S&&!M&&(this.position.direction="down",v=!0);var T=v||M;T?(k=p,A=k+C,v?(b=m,E=Math.min(b+w,d),w=E-b):(E=m+w,b=Math.max(E-w,0),w=E-b)):(b=m,E=b+w,x?(A=p+C,k=Math.max(A-C,0),C=A-k):(k=p,A=Math.min(k+C,h),C=A-k)),this._box={l:k,t:b,w:C,h:w};var F=g>C,D=s.barLength+2*s.barPad,R=s.barWidth+2*s.barPad,P=p,z=m+y;z+R>d&&(z=d-R);var I=this.container.selectAll("rect.scrollbar-horizontal").data(F?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),F?(this.hbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:z,width:D,height:R}),this._hbarXMin=P+D/2,this._hbarTranslateMax=C-D):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=y>w,B=s.barWidth+2*s.barPad,O=s.barLength+2*s.barPad,G=p+g,W=m;G+B>h&&(G=h-B);var X=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);X.exit().on(".drag",null).remove(),X.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),L?(this.vbar=X.attr({rx:s.barRadius,ry:s.barRadius,x:G,y:W,width:B,height:O}),this._vbarYMin=W+O/2,this._vbarTranslateMax=w-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var Z=this.id,J=k-.5,N=L?A+B+.5:A+.5,H=b-.5,$=F?E+R+.5:E+.5,U=f._topdefs.selectAll("#"+Z).data(F||L?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",Z).append("rect"),F||L?(this._clipRect=U.select("rect").attr({x:Math.floor(J),y:Math.floor(H),width:Math.ceil(N)-Math.floor(J),height:Math.ceil($)-Math.floor(H)}),this.container.call(a.setClipUrl,Z,this.gd),this.bg.attr({x:p,y:m,width:g,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),F||L){var V=t.behavior.drag().on("dragstart",function(){t.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var j=t.behavior.drag().on("dragstart",function(){t.event.sourceEvent.preventDefault(),t.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));F&&this.hbar.on(".drag",null).call(j),L&&this.vbar.on(".drag",null).call(j)}this.setTranslate(u,c)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var n=this.translateX,u=this.translateY;this.hbar&&(n-=t.event.dx),this.vbar&&(u-=t.event.dy),this.setTranslate(n,u)},s.prototype._onBoxWheel=function(){var n=this.translateX,u=this.translateY;this.hbar&&(n+=t.event.deltaY),this.vbar&&(u+=t.event.deltaY),this.setTranslate(n,u)},s.prototype._onBarDrag=function(){var n=this.translateX,u=this.translateY;if(this.hbar){var c=n+this._hbarXMin,f=c+this._hbarTranslateMax,h=o.constrain(t.event.x,c,f),d=(h-c)/(f-c),p=this.position.w-this._box.w;n=d*p}if(this.vbar){var g=u+this._vbarYMin,m=g+this._vbarTranslateMax,y=o.constrain(t.event.y,g,m),_=(y-g)/(m-g),v=this.position.h-this._box.h;u=_*v}this.setTranslate(n,u)},s.prototype.setTranslate=function(n,u){var c=this.position.w-this._box.w,f=this.position.h-this._box.h;if(n=o.constrain(n||0,0,c),u=o.constrain(u||0,0,f),this.translateX=n,this.translateY=u,this.container.call(a.setTranslate,this._box.l-this.position.l-n,this._box.t-this.position.t-u),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+n-.5),y:Math.floor(this.position.t+u-.5)}),this.hbar){var h=n/c;this.hbar.call(a.setTranslate,n+h*this._hbarTranslateMax,u)}if(this.vbar){var d=u/f;this.vbar.call(a.setTranslate,n,u+d*this._vbarTranslateMax)}}}}),EV=de({"src/components/updatemenus/draw.js"(e,r){"use strict";var t=Yr(),i=ks(),a=ta(),o=hn(),s=Qt(),l=Zo(),n=Ro().arrayEditor,u=Bl().LINE_SPACING,c=qw(),f=SV();r.exports=function(D){var R=D._fullLayout,P=s.filterVisible(R[c.name]);function z(Z){i.autoMargin(D,b(Z))}var I=R._menulayer.selectAll("g."+c.containerClassName).data(P.length>0?[0]:[]);if(I.enter().append("g").classed(c.containerClassName,!0).style("cursor","pointer"),I.exit().each(function(){t.select(this).selectAll("g."+c.headerGroupClassName).each(z)}).remove(),P.length!==0){var L=I.selectAll("g."+c.headerGroupClassName).data(P,h);L.enter().append("g").classed(c.headerGroupClassName,!0);for(var B=s.ensureSingle(I,"g",c.dropdownButtonGroupClassName,function(Z){Z.style("pointer-events","all")}),O=0;O0?[0]:[]);G.enter().append("g").classed(c.containerClassName,!0).style("cursor",L?null:"ew-resize");function W(N){N._commandObserver&&(N._commandObserver.remove(),delete N._commandObserver),i.autoMargin(I,g(N))}if(G.exit().each(function(){t.select(this).selectAll("g."+c.groupClassName).each(W)}).remove(),O.length!==0){var X=G.selectAll("g."+c.groupClassName).data(O,y);X.enter().append("g").classed(c.groupClassName,!0),X.exit().each(W).remove();for(var Z=0;Z0&&(X=X.transition().duration(I.transition.duration).ease(I.transition.easing)),X.attr("transform",l(W-c.gripWidth*.5,I._dims.currentValueTotalHeight))}}function F(z,I){var L=z._dims;return L.inputAreaStart+c.stepInset+(L.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,I))}function D(z,I){var L=z._dims;return Math.min(1,Math.max(0,(I-c.stepInset-L.inputAreaStart)/(L.inputAreaLength-2*c.stepInset-2*L.inputAreaStart)))}function R(z,I,L){var B=L._dims,O=s.ensureSingle(z,"rect",c.railTouchRectClass,function(G){G.call(A,I,z,L).style("pointer-events","all")});O.attr({width:B.inputAreaLength,height:Math.max(B.inputAreaWidth,c.tickOffset+L.ticklen+B.labelHeight)}).call(a.fill,L.bgcolor).attr("opacity",0),o.setTranslate(O,0,B.currentValueTotalHeight)}function P(z,I){var L=I._dims,B=L.inputAreaLength-c.railInset*2,O=s.ensureSingle(z,"rect",c.railRectClass);O.attr({width:B,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,I.bordercolor).call(a.fill,I.bgcolor).style("stroke-width",I.borderwidth+"px"),o.setTranslate(O,c.railInset,(L.inputAreaWidth-c.railWidth)*.5+L.currentValueTotalHeight)}}}),LV=de({"src/components/sliders/index.js"(e,r){"use strict";var t=By();r.exports={moduleType:"component",name:t.name,layoutAttributes:hk(),supplyLayoutDefaults:CV(),draw:DV()}}}),Vw=de({"src/components/rangeslider/attributes.js"(e,r){"use strict";var t=Jo();r.exports={bgcolor:{valType:"color",dflt:t.background,editType:"plot"},bordercolor:{valType:"color",dflt:t.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),dk=de({"src/components/rangeslider/oppaxis_attributes.js"(e,r){"use strict";r.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),Gw=de({"src/components/rangeslider/constants.js"(e,r){"use strict";r.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),FV=de({"src/components/rangeslider/helpers.js"(e){"use strict";var r=Hs(),t=Zo(),i=Gw(),a=Bl().LINE_SPACING,o=i.name;function s(l){var n=l&&l[o];return n&&n.visible}e.isVisible=s,e.makeData=function(l){for(var n=r.list({_fullLayout:l},"x",!0),u=l.margin,c=[],f=0;f=ye.max)pe=te[xe+1];else if(ce=ye.pmax)pe=te[xe+1];else if(ce0?A.touches[0].clientX:0}function m(A,b,E,T){if(b._context.staticPlot)return;var F=A.select("rect."+p.slideBoxClassName).node(),D=A.select("rect."+p.grabAreaMinClassName).node(),R=A.select("rect."+p.grabAreaMaxClassName).node();function P(){var z=t.event,I=z.target,L=g(z),B=L-A.node().getBoundingClientRect().left,O=T.d2p(E._rl[0]),G=T.d2p(E._rl[1]),W=h.coverSlip();this.addEventListener("touchmove",X),this.addEventListener("touchend",Z),W.addEventListener("mousemove",X),W.addEventListener("mouseup",Z);function X(J){var N=g(J),H=+N-L,$,U,V;switch(I){case F:if(V="ew-resize",O+H>E._length||G+H<0)return;$=O+H,U=G+H;break;case D:if(V="col-resize",O+H>E._length)return;$=O+H,U=G;break;case R:if(V="col-resize",G+H<0)return;$=O,U=G+H;break;default:V="ew-resize",$=B,U=B+H;break}if(U<$){var j=U;U=$,$=j}T._pixelMin=$,T._pixelMax=U,d(t.select(W),V),y(A,b,E,T)}function Z(){W.removeEventListener("mousemove",X),W.removeEventListener("mouseup",Z),this.removeEventListener("touchmove",X),this.removeEventListener("touchend",Z),o.removeElement(W)}}A.on("mousedown",P),A.on("touchstart",P)}function y(A,b,E,T){function F(P){return E.l2r(o.constrain(P,T._rl[0],T._rl[1]))}var D=F(T.p2d(T._pixelMin)),R=F(T.p2d(T._pixelMax));window.requestAnimationFrame(function(){i.call("_guiRelayout",b,E._name+".range",[D,R])})}function _(A,b,E,T,F,D){var R=p.handleWidth/2;function P(J){return o.constrain(J,0,T._width)}function z(J){return o.constrain(J,0,T._height)}function I(J){return o.constrain(J,-R,T._width+R)}var L=P(T.d2p(E._rl[0])),B=P(T.d2p(E._rl[1]));if(A.select("rect."+p.slideBoxClassName).attr("x",L).attr("width",B-L),A.select("rect."+p.maskMinClassName).attr("width",L),A.select("rect."+p.maskMaxClassName).attr("x",B).attr("width",T._width-B),D.rangemode!=="match"){var O=T._height-z(T.d2pOppAxis(F._rl[1])),G=T._height-z(T.d2pOppAxis(F._rl[0]));A.select("rect."+p.maskMinOppAxisClassName).attr("x",L).attr("height",O).attr("width",B-L),A.select("rect."+p.maskMaxOppAxisClassName).attr("x",L).attr("y",G).attr("height",T._height-G).attr("width",B-L),A.select("rect."+p.slideBoxClassName).attr("y",O).attr("height",G-O)}var W=.5,X=Math.round(I(L-R))-W,Z=Math.round(I(B-R))+W;A.select("g."+p.grabberMinClassName).attr("transform",s(X,W)),A.select("g."+p.grabberMaxClassName).attr("transform",s(Z,W))}function v(A,b,E,T){var F=o.ensureSingle(A,"rect",p.bgClassName,function(z){z.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),D=T.borderwidth%2===0?T.borderwidth:T.borderwidth-1,R=-T._offsetShift,P=l.crispRound(b,T.borderwidth);F.attr({width:T._width+D,height:T._height+D,transform:s(R,R),"stroke-width":P}).call(n.stroke,T.bordercolor).call(n.fill,T.bgcolor)}function x(A,b,E,T){var F=b._fullLayout,D=o.ensureSingleById(F._topdefs,"clipPath",T._clipId,function(R){R.append("rect").attr({x:0,y:0})});D.select("rect").attr({width:T._width,height:T._height})}function S(A,b,E,T){var F=b.calcdata,D=A.selectAll("g."+p.rangePlotClassName).data(E._subplotsWith,o.identity);D.enter().append("g").attr("class",function(P){return p.rangePlotClassName+" "+P}).call(l.setClipUrl,T._clipId,b),D.order(),D.exit().remove();var R;D.each(function(P,z){var I=t.select(this),L=z===0,B=f.getFromId(b,P,"y"),O=B._name,G=T[O],W={data:[],layout:{xaxis:{type:E.type,domain:[0,1],range:T.range.slice(),calendar:E.calendar},width:T._width,height:T._height,margin:{t:0,b:0,l:0,r:0}},_context:b._context};E.rangebreaks&&(W.layout.xaxis.rangebreaks=E.rangebreaks),W.layout[O]={type:B.type,domain:[0,1],range:G.rangemode!=="match"?G.range.slice():B.range.slice(),calendar:B.calendar},B.rangebreaks&&(W.layout[O].rangebreaks=B.rangebreaks),a.supplyDefaults(W);var X=W._fullLayout.xaxis,Z=W._fullLayout[O];X.clearCalc(),X.setScale(),Z.clearCalc(),Z.setScale();var J={id:P,plotgroup:I,xaxis:X,yaxis:Z,isRangePlot:!0};L?R=J:(J.mainplot="xy",J.mainplotinfo=R),c.rangePlot(b,J,M(F,P))})}function M(A,b){for(var E=[],T=0;T0);if(x){var S=u(h,d,p);_("x",S[0]),_("y",S[1]),t.noneOrAll(f,h,["x","y"]),_("xanchor"),_("yanchor"),t.coerceFont(_,"font",d.font);var M=_("bgcolor");_("activecolor",i.contrast(M,l.lightAmount,l.darkAmount)),_("bordercolor"),_("borderwidth")}};function n(c,f,h,d){var p=d.calendar;function g(_,v){return t.coerce(c,f,s.buttons,_,v)}var m=g("visible");if(m){var y=g("step");y!=="all"&&(p&&p!=="gregorian"&&(y==="month"||y==="year")?f.stepmode="backward":g("stepmode"),g("count")),g("label")}}function u(c,f,h){for(var d=h.filter(function(y){return f[y].anchor===c._id}),p=0,g=0;g1)){delete p.grid;return}if(!_&&!v&&!x){var E=k("pattern")==="independent";E&&(_=!0)}w._hasSubplotGrid=_;var T=k("roworder"),F=T==="top to bottom",D=_?.2:.1,R=_?.3:.1,P,z;S&&p._splomGridDflt&&(P=p._splomGridDflt.xside,z=p._splomGridDflt.yside),w._domains={x:c("x",k,D,P,b),y:c("y",k,R,z,A,F)}}function c(d,p,g,m,y,_){var v=p(d+"gap",g),x=p("domain."+d);p(d+"side",m);for(var S=new Array(y),M=x[0],C=(x[1]-M)/(y-v),w=C*(1-v),k=0;k0,m=n._context.staticPlot;u.each(function(y){var _=y[0].trace,v=_.error_x||{},x=_.error_y||{},S;_.ids&&(S=function(k){return k.id});var M=o.hasMarkers(_)&&_.marker.maxdisplayed>0;!x.visible&&!v.visible&&(y=[]);var C=t.select(this).selectAll("g.errorbar").data(y,S);if(C.exit().remove(),!!y.length){v.visible||C.selectAll("path.xerror").remove(),x.visible||C.selectAll("path.yerror").remove(),C.style("opacity",1);var w=C.enter().append("g").classed("errorbar",!0);g&&w.style("opacity",0).transition().duration(f.duration).style("opacity",1),a.setClipUrl(C,c.layerClipId,n),C.each(function(k){var A=t.select(this),b=s(k,d,p);if(!(M&&!k.vis)){var E,T=A.select("path.yerror");if(x.visible&&i(b.x)&&i(b.yh)&&i(b.ys)){var F=x.width;E="M"+(b.x-F)+","+b.yh+"h"+2*F+"m-"+F+",0V"+b.ys,b.noYS||(E+="m-"+F+",0h"+2*F),h=!T.size(),h?T=A.append("path").style("vector-effect",m?"none":"non-scaling-stroke").classed("yerror",!0):g&&(T=T.transition().duration(f.duration).ease(f.easing)),T.attr("d",E)}else T.remove();var D=A.select("path.xerror");if(v.visible&&i(b.y)&&i(b.xh)&&i(b.xs)){var R=(v.copy_ystyle?x:v).width;E="M"+b.xh+","+(b.y-R)+"v"+2*R+"m0,-"+R+"H"+b.xs,b.noXS||(E+="m0,-"+R+"v"+2*R),h=!D.size(),h?D=A.append("path").style("vector-effect",m?"none":"non-scaling-stroke").classed("xerror",!0):g&&(D=D.transition().duration(f.duration).ease(f.easing)),D.attr("d",E)}else D.remove()}})}})};function s(l,n,u){var c={x:n.c2p(l.x),y:u.c2p(l.y)};return l.yh!==void 0&&(c.yh=u.c2p(l.yh),c.ys=u.c2p(l.ys),i(c.ys)||(c.noYS=!0,c.ys=u.c2p(l.ys,!0))),l.xh!==void 0&&(c.xh=n.c2p(l.xh),c.xs=n.c2p(l.xs),i(c.xs)||(c.noXS=!0,c.xs=n.c2p(l.xs,!0))),c}}}),GV=de({"src/components/errorbars/style.js"(e,r){"use strict";var t=Yr(),i=ta();r.exports=function(o){o.each(function(s){var l=s[0].trace,n=l.error_y||{},u=l.error_x||{},c=t.select(this);c.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(i.stroke,n.color),u.copy_ystyle&&(u=n),c.selectAll("path.xerror").style("stroke-width",u.thickness+"px").call(i.stroke,u.color)})}}}),HV=de({"src/components/errorbars/index.js"(e,r){"use strict";var t=Qt(),i=Is().overrideAll,a=mk(),o={error_x:t.extendFlat({},a),error_y:t.extendFlat({},a)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var s={error_x:t.extendFlat({},a),error_y:t.extendFlat({},a),error_z:t.extendFlat({},a)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,r.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:i(s,"calc","nested"),scattergl:i(o,"calc","nested")}},supplyDefaults:UV(),calc:qV(),makeComputeError:gk(),plot:VV(),style:GV(),hoverInfo:l};function l(n,u,c){(u.error_y||{}).visible&&(c.yerr=n.yh-n.y,u.error_y.symmetric||(c.yerrneg=n.y-n.ys)),(u.error_x||{}).visible&&(c.xerr=n.xh-n.x,u.error_x.symmetric||(c.xerrneg=n.x-n.xs))}}}),$V=de({"src/components/colorbar/constants.js"(e,r){"use strict";r.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),WV=de({"src/components/colorbar/draw.js"(e,r){"use strict";var t=Yr(),i=ks(),a=Sa(),o=nn(),s=Uc(),l=Qt(),n=l.strTranslate,u=fn().extendFlat,c=gd(),f=hn(),h=ta(),d=bv(),p=Zo(),g=Wu().flipScale,m=zy(),y=Nw(),_=Mu(),v=Bl(),x=v.LINE_SPACING,S=v.FROM_TL,M=v.FROM_BR,C=$V().cn;function w(R){var P=R._fullLayout,z=P._infolayer.selectAll("g."+C.colorbar).data(k(R),function(I){return I._id});z.enter().append("g").attr("class",function(I){return I._id}).classed(C.colorbar,!0),z.each(function(I){var L=t.select(this);l.ensureSingle(L,"rect",C.cbbg),l.ensureSingle(L,"g",C.cbfills),l.ensureSingle(L,"g",C.cblines),l.ensureSingle(L,"g",C.cbaxis,function(O){O.classed(C.crisp,!0)}),l.ensureSingle(L,"g",C.cbtitleunshift,function(O){O.append("g").classed(C.cbtitle,!0)}),l.ensureSingle(L,"rect",C.cboutline);var B=E(L,I,R);B&&B.then&&(R._promises||[]).push(B),R._context.edits.colorbarPosition&&T(L,I,R)}),z.exit().each(function(I){i.autoMargin(R,I._id)}).remove(),z.order()}function k(R){var P=R._fullLayout,z=R.calcdata,I=[],L,B,O,G;function W(Y){return u(Y,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function X(){typeof G.calc=="function"?G.calc(R,O,L):(L._fillgradient=B.reversescale?g(B.colorscale):B.colorscale,L._zrange=[B[G.min],B[G.max]])}for(var Z=0;Z[Math.min(R[0]+P,R[1]),R[1]],b=(R,P)=>[R[0],Math.max(R[1]-P,R[0])];function E(R,P,z){var I=P.orientation==="v",L=P.len,B=P.lenmode,O=P.thickness,G=P.thicknessmode,W=P.outlinewidth,X=P.borderwidth,Z=P.bgcolor,J=P.xanchor,N=P.yanchor,H=P.xpad,$=P.ypad,U=P.x,V=I?P.y:1-P.y,j=P.yref==="paper",q=P.xref==="paper",Y=z._fullLayout,K=Y._size,te=P._fillcolor,ne=P._line,se=P.title,le=se.side,ce=P._zrange||t.extent((typeof te=="function"?te:ne.color).domain()),pe=typeof ne.color=="function"?ne.color:function(){return ne.color},xe=typeof te=="function"?te:function(){return te},ye=P._levels,fe=F(z,P,ce),ae=fe.fill,ee=fe.line,ie=Math.round(O*(G==="fraction"?I?K.w:K.h:1)),Q=ie/(I?K.w:K.h),ue=Math.round(L*(B==="fraction"?I?K.h:K.w:1)),ge=ue/(I?K.h:K.w),Me=q?K.w:z._fullLayout.width,Te=j?K.h:z._fullLayout.height,je=Math.round(I?U*Me+H:V*Te+$),Ve={center:.5,right:1}[J]||0,Ke={top:1,middle:.5}[N]||0,Je=I?U-Ve*Q:V-Ke*Q,vt=I?V-Ke*ge:U-Ve*ge,xt=Math.round(I?Te*(1-vt):Me*vt);P._lenFrac=ge,P._thickFrac=Q,P._uFrac=Je,P._vFrac=vt;var Pt=P._axis=D(z,P,ce);Pt.position=Q+(I?U+H/K.w:V+$/K.h);var mt=["top","bottom"].indexOf(le)!==-1;if(I&&mt&&(Pt.title.side=le,Pt.titlex=U+H/K.w,Pt.titley=vt+(se.side==="top"?ge-$/K.h:$/K.h)),!I&&!mt&&(Pt.title.side=le,Pt.titley=V+$/K.h,Pt.titlex=vt+H/K.w),ne.color&&P.tickmode==="auto"){Pt.tickmode="linear",Pt.tick0=ye.start;var Mt=ye.size,lt=l.constrain(ue/50,4,15)+1,qe=(ce[1]-ce[0])/((P.nticks||lt)*Mt);if(qe>1){var Ye=Math.pow(10,Math.floor(Math.log(qe)/Math.LN10));Mt*=Ye*l.roundUp(qe/Ye,[2,5,10]),(Math.abs(ye.start)/ye.size+1e-6)%1<2e-6&&(Pt.tick0=0)}Pt.dtick=Mt}var me=I?$/K.h:H/K.w;Pt.domain=b(A([vt,vt+ge],me),me),Pt.setScale(),R.attr("transform",n(Math.round(K.l),Math.round(K.t)));var _e=R.select("."+C.cbtitleunshift).attr("transform",n(-Math.round(K.l),-Math.round(K.t))),Ae=Pt.ticklabelposition,ke=Pt.title.font.size,Ee=R.select("."+C.cbaxis),De,Qe=0,Ue=0;function at(Ht,fr){var gt={propContainer:Pt,propName:P._propPrefix+"title.text",traceIndex:P._traceIndex,_meta:P._meta,placeholder:Y._dfltTitle.colorbar,containerGroup:R.select("."+C.cbtitle)},yt=Ht.charAt(0)==="h"?Ht.slice(1):"h"+Ht;R.selectAll("."+yt+",."+yt+"-math-group").remove(),d.draw(z,Ht,u(gt,fr||{}))}function rt(){if(I&&mt||!I&&!mt){var Ht,fr;le==="top"&&(Ht=H+K.l+Me*U,fr=$+K.t+Te*(1-vt-ge)+3+ke*.75),le==="bottom"&&(Ht=H+K.l+Me*U,fr=$+K.t+Te*(1-vt)-3-ke*.25),le==="right"&&(fr=$+K.t+Te*V+3+ke*.75,Ht=H+K.l+Me*vt),at(Pt._id+"title",{attributes:{x:Ht,y:fr,"text-anchor":I?"start":"middle"}})}}function ht(){if(I&&!mt||!I&&mt){var Ht=Pt.position||0,fr=Pt._offset+Pt._length/2,gt,yt;if(le==="right")yt=fr,gt=K.l+Me*Ht+10+ke*(Pt.showticklabels?1:.5);else if(gt=fr,le==="bottom"&&(yt=K.t+Te*Ht+10+(Ae.indexOf("inside")===-1?Pt.tickfont.size:0)+(Pt.ticks!=="inside"&&P.ticklen||0)),le==="top"){var kt=se.text.split("
").length;yt=K.t+Te*Ht+10-ie-x*ke*kt}at((I?"h":"v")+Pt._id+"title",{avoid:{selection:t.select(z).selectAll("g."+Pt._id+"tick"),side:le,offsetTop:I?0:K.t,offsetLeft:I?K.l:0,maxShift:I?Y.width:Y.height},attributes:{x:gt,y:yt,"text-anchor":"middle"},transform:{rotate:I?-90:0,offset:0}})}}function At(){if(!I&&!mt||I&&mt){var Ht=R.select("."+C.cbtitle),fr=Ht.select("text"),gt=[-W/2,W/2],yt=Ht.select(".h"+Pt._id+"title-math-group").node(),kt=15.6;fr.node()&&(kt=parseInt(fr.node().style.fontSize,10)*x);var Lt;if(yt?(Lt=f.bBox(yt),Ue=Lt.width,Qe=Lt.height,Qe>kt&&(gt[1]-=(Qe-kt)/2)):fr.node()&&!fr.classed(C.jsPlaceholder)&&(Lt=f.bBox(fr.node()),Ue=Lt.width,Qe=Lt.height),I){if(Qe){if(Qe+=5,le==="top")Pt.domain=b(Pt.domain,Qe/K.h),gt[1]*=-1;else{Pt.domain=A(Pt.domain,Qe/K.h);var Ct=p.lineCount(fr);gt[1]+=(1-Ct)*kt}Ht.attr("transform",n(gt[0],gt[1])),Pt.setScale()}}else Ue&&(le==="right"&&(Pt.domain=A(Pt.domain,(Ue+ke/2)/K.w)),Ht.attr("transform",n(gt[0],gt[1])),Pt.setScale())}R.selectAll("."+C.cbfills+",."+C.cblines).attr("transform",I?n(0,Math.round(K.h*(1-Pt.domain[1]))):n(Math.round(K.w*Pt.domain[0]),0)),Ee.attr("transform",I?n(0,Math.round(-K.t)):n(Math.round(-K.l),0));var $t=R.select("."+C.cbfills).selectAll("rect."+C.cbfill).attr("style","").data(ae);$t.enter().append("rect").classed(C.cbfill,!0).attr("style",""),$t.exit().remove();var mr=ce.map(Pt.c2p).map(Math.round).sort(function(Ai,oi){return Ai-oi});$t.each(function(Ai,oi){var Qr=[oi===0?ce[0]:(ae[oi]+ae[oi-1])/2,oi===ae.length-1?ce[1]:(ae[oi]+ae[oi+1])/2].map(Pt.c2p).map(Math.round);I&&(Qr[1]=l.constrain(Qr[1]+(Qr[1]>Qr[0])?1:-1,mr[0],mr[1]));var ea=t.select(this).attr(I?"x":"y",je).attr(I?"y":"x",t.min(Qr)).attr(I?"width":"height",Math.max(ie,2)).attr(I?"height":"width",Math.max(t.max(Qr)-t.min(Qr),2));if(P._fillgradient)f.gradient(ea,z,P._id,I?"vertical":"horizontalreversed",P._fillgradient,"fill");else{var $i=xe(Ai).replace("e-","");ea.attr("fill",h.hexString($i))}});var br=R.select("."+C.cblines).selectAll("path."+C.cbline).data(ne.color&&ne.width?ee:[]);br.enter().append("path").classed(C.cbline,!0),br.exit().remove(),br.each(function(Ai){var oi=je,Qr=Math.round(Pt.c2p(Ai))+ne.width/2%1;t.select(this).attr("d","M"+(I?oi+","+Qr:Qr+","+oi)+(I?"h":"v")+ie).call(f.lineGroupStyle,ne.width,pe(Ai),ne.dash)}),Ee.selectAll("g."+Pt._id+"tick,path").remove();var Er=je+ie+(W||0)/2-(P.ticks==="outside"?1:0),Tr=o.calcTicks(Pt),Ur=o.getTickSigns(Pt)[2];return o.drawTicks(z,Pt,{vals:Pt.ticks==="inside"?o.clipEnds(Pt,Tr):Tr,layer:Ee,path:o.makeTickPath(Pt,Er,Ur),transFn:o.makeTransTickFn(Pt)}),o.drawLabels(z,Pt,{vals:Tr,layer:Ee,transFn:o.makeTransTickLabelFn(Pt),labelFns:o.makeLabelFns(Pt,Er)})}function dt(){var Ht,fr=ie+W/2;Ae.indexOf("inside")===-1&&(Ht=f.bBox(Ee.node()),fr+=I?Ht.width:Ht.height),De=_e.select("text");var gt=0,yt=I&&le==="top",kt=!I&&le==="right",Lt=0;if(De.node()&&!De.classed(C.jsPlaceholder)){var Ct,$t=_e.select(".h"+Pt._id+"title-math-group").node();$t&&(I&&mt||!I&&!mt)?(Ht=f.bBox($t),gt=Ht.width,Ct=Ht.height):(Ht=f.bBox(_e.node()),gt=Ht.right-K.l-(I?je:xt),Ct=Ht.bottom-K.t-(I?xt:je),!I&&le==="top"&&(fr+=Ht.height,Lt=Ht.height)),kt&&(De.attr("transform",n(gt/2+ke/2,0)),gt*=2),fr=Math.max(fr,I?gt:Ct)}var mr=(I?H:$)*2+fr+X+W/2,br=0;!I&&se.text&&N==="bottom"&&V<=0&&(br=mr/2,mr+=br,Lt+=br),Y._hColorbarMoveTitle=br,Y._hColorbarMoveCBTitle=Lt;var Er=X+W,Tr=(I?je:xt)-Er/2-(I?H:0),Ur=(I?xt:je)-(I?ue:$+Lt-br);R.select("."+C.cbbg).attr("x",Tr).attr("y",Ur).attr(I?"width":"height",Math.max(mr-br,2)).attr(I?"height":"width",Math.max(ue+Er,2)).call(h.fill,Z).call(h.stroke,P.bordercolor).style("stroke-width",X);var Ai=kt?Math.max(gt-10,0):0;R.selectAll("."+C.cboutline).attr("x",(I?je:xt+H)+Ai).attr("y",(I?xt+$-ue:je)+(yt?Qe:0)).attr(I?"width":"height",Math.max(ie,2)).attr(I?"height":"width",Math.max(ue-(I?2*$+Qe:2*H+Ai),2)).call(h.stroke,P.outlinecolor).style({fill:"none","stroke-width":W});var oi=I?Ve*mr:0,Qr=I?0:(1-Ke)*mr-Lt;if(oi=q?K.l-oi:-oi,Qr=j?K.t-Qr:-Qr,R.attr("transform",n(oi,Qr)),!I&&(X||h.opacity(Z)&&!h.equals(Y.paper_bgcolor,Z))){var ea=Ee.selectAll("text"),$i=ea[0].length,ja=R.select("."+C.cbbg).node(),ya=f.bBox(ja),pa=f.getTranslate(R),xi=2;ea.each(function(zt,Wt){var Yt=0,ze=$i-1;if(Wt===Yt||Wt===ze){var tt=f.bBox(this),ft=f.getTranslate(this),wt;if(Wt===ze){var jt=tt.right+ft.x,It=ya.right+pa.x+xt-X-xi+U;wt=It-jt,wt>0&&(wt=0)}else if(Wt===Yt){var Kt=tt.left+ft.x,qt=ya.left+pa.x+xt+X+xi;wt=qt-Kt,wt<0&&(wt=0)}wt&&($i<3?this.setAttribute("transform","translate("+wt+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var bi={},Ua=S[J],dn=M[J],pi=S[N],Jr=M[N],Be=mr-ie;I?(B==="pixels"?(bi.y=V,bi.t=ue*pi,bi.b=ue*Jr):(bi.t=bi.b=0,bi.yt=V+L*pi,bi.yb=V-L*Jr),G==="pixels"?(bi.x=U,bi.l=mr*Ua,bi.r=mr*dn):(bi.l=Be*Ua,bi.r=Be*dn,bi.xl=U-O*Ua,bi.xr=U+O*dn)):(B==="pixels"?(bi.x=U,bi.l=ue*Ua,bi.r=ue*dn):(bi.l=bi.r=0,bi.xl=U+L*Ua,bi.xr=U-L*dn),G==="pixels"?(bi.y=1-V,bi.t=mr*pi,bi.b=mr*Jr):(bi.t=Be*pi,bi.b=Be*Jr,bi.yt=V-O*pi,bi.yb=V+O*Jr));var Fe=P.y<.5?"b":"t",Et=P.x<.5?"l":"r";z._fullLayout._reservedMargin[P._id]={};var St={r:Y.width-Tr-oi,l:Tr+bi.r,b:Y.height-Ur-Qr,t:Ur+bi.b};q&&j?i.autoMargin(z,P._id,bi):q?z._fullLayout._reservedMargin[P._id][Fe]=St[Fe]:j||I?z._fullLayout._reservedMargin[P._id][Et]=St[Et]:z._fullLayout._reservedMargin[P._id][Fe]=St[Fe]}return l.syncOrAsync([i.previousPromises,rt,At,ht,i.previousPromises,dt],z)}function T(R,P,z){var I=P.orientation==="v",L=z._fullLayout,B=L._size,O,G,W;s.init({element:R.node(),gd:z,prepFn:function(){O=R.attr("transform"),c(R)},moveFn:function(X,Z){R.attr("transform",O+n(X,Z)),G=s.align((I?P._uFrac:P._vFrac)+X/B.w,I?P._thickFrac:P._lenFrac,0,1,P.xanchor),W=s.align((I?P._vFrac:1-P._uFrac)-Z/B.h,I?P._lenFrac:P._thickFrac,0,1,P.yanchor);var J=s.getCursor(G,W,P.xanchor,P.yanchor);c(R,J)},doneFn:function(){if(c(R),G!==void 0&&W!==void 0){var X={};X[P._propPrefix+"x"]=G,X[P._propPrefix+"y"]=W,P._traceIndex!==void 0?a.call("_guiRestyle",z,X,P._traceIndex):a.call("_guiRelayout",z,X)}}})}function F(R,P,z){var I=P._levels,L=[],B=[],O,G,W=I.end+I.size/100,X=I.size,Z=1.001*z[0]-.001*z[1],J=1.001*z[1]-.001*z[0];for(G=0;G<1e5&&(O=I.start+G*X,!(X>0?O>=W:O<=W));G++)O>Z&&O0?O>=W:O<=W));G++)O>z[0]&&O-1}r.exports=function(u,c){var f,h=u.data,d=u.layout,p=o([],h),g=o({},d,s(c.tileClass)),m=u._context||{};if(c.width&&(g.width=c.width),c.height&&(g.height=c.height),c.tileClass==="thumbnail"||c.tileClass==="themes__thumb"){g.annotations=[];var y=Object.keys(g);for(f=0;f=0)return m}else if(typeof m=="string"&&(m=m.trim(),m.slice(-1)==="%"&&t(m.slice(0,-1))&&(m=+m.slice(0,-1),m>=0)))return m+"%"}function g(m,y,_,v,x,S){S=S||{};var M=S.moduleHasSelected!==!1,C=S.moduleHasUnselected!==!1,w=S.moduleHasConstrain!==!1,k=S.moduleHasCliponaxis!==!1,A=S.moduleHasTextangle!==!1,b=S.moduleHasInsideanchor!==!1,E=!!S.hasPathbar,T=Array.isArray(x)||x==="auto",F=T||x==="inside",D=T||x==="outside";if(F||D){var R=f(v,"textfont",_.font),P=i.extendFlat({},R),z=m.textfont&&m.textfont.color,I=!z;if(I&&delete P.color,f(v,"insidetextfont",P),E){var L=i.extendFlat({},R);I&&delete L.color,f(v,"pathbar.textfont",L)}D&&f(v,"outsidetextfont",R),M&&v("selected.textfont.color"),C&&v("unselected.textfont.color"),w&&v("constraintext"),k&&v("cliponaxis"),A&&v("textangle"),v("texttemplate"),v("texttemplatefallback")}F&&b&&v("insidetextanchor")}r.exports={supplyDefaults:h,crossTraceDefaults:d,handleText:g,validateCornerradius:p}}}),_k=de({"src/traces/bar/layout_defaults.js"(e,r){"use strict";var t=Sa(),i=nn(),a=Qt(),o=$w(),s=sh().validateCornerradius;r.exports=function(l,n,u){function c(M,C){return a.coerce(l,n,o,M,C)}for(var f=!1,h=!1,d=!1,p={},g=c("barmode"),m=g==="group",y=0;y0&&!p[v]&&(d=!0),p[v]=!0),_.visible&&_.type==="histogram"){var x=i.getFromId({_fullLayout:n},_[_.orientation==="v"?"xaxis":"yaxis"]);x.type!=="category"&&(h=!0)}}if(!f){delete n.barmode;return}g!=="overlay"&&c("barnorm"),c("bargap",h&&!d?0:.2),c("bargroupgap");var S=c("barcornerradius");n.barcornerradius=s(S)}}}),Oy=de({"src/traces/bar/arrays_to_calcdata.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){for(var s=0;sn;if(!u)return o}return s!==void 0?s:a.dflt},e.coerceColor=function(a,o,s){return r.isValid(o)?o:s!==void 0?s:a.dflt},e.coerceEnumerated=function(a,o,s){return a.coerceNumber&&(o=+o),a.values.indexOf(o)!==-1?o:s!==void 0?s:a.dflt},e.getValue=function(a,o){var s;return i(a)?o1||E.bargap===0&&E.bargroupgap===0&&!T[0].trace.marker.line.width)&&t.select(this).attr("shape-rendering","crispEdges")}),A.selectAll("g.points").each(function(T){var F=t.select(this),D=T[0].trace;p(F,D,k)}),s.getComponentMethod("errorbars","style")(A)}function p(k,A,b){a.pointStyle(k.selectAll("path"),A,b),g(k,A,b)}function g(k,A,b){k.selectAll("text").each(function(E){var T=t.select(this),F=o.ensureUniformFontSize(b,v(T,E,A,b));a.font(T,F)})}function m(k,A,b){var E=A[0].trace;E.selectedpoints?y(b,E,k):(p(b,E,k),s.getComponentMethod("errorbars","style")(b))}function y(k,A,b){a.selectedPointStyle(k.selectAll("path"),A),_(k.selectAll("text"),A,b)}function _(k,A,b){k.each(function(E){var T=t.select(this),F;if(E.selected){F=o.ensureUniformFontSize(b,v(T,E,A,b));var D=A.selected.textfont&&A.selected.textfont.color;D&&(F.color=D),a.font(T,F)}else a.selectedTextStyle(T,A)})}function v(k,A,b,E){var T=E._fullLayout.font,F=b.textfont;if(k.classed("bartext-inside")){var D=w(A,b);F=S(b,A.i,T,D)}else k.classed("bartext-outside")&&(F=M(b,A.i,T));return F}function x(k,A,b){return C(u,k.textfont,A,b)}function S(k,A,b,E){var T=x(k,A,b),F=k._input.textfont===void 0||k._input.textfont.color===void 0||Array.isArray(k.textfont.color)&&k.textfont.color[A]===void 0;return F&&(T={color:i.contrast(E),family:T.family,size:T.size,weight:T.weight,style:T.style,variant:T.variant,textcase:T.textcase,lineposition:T.lineposition,shadow:T.shadow}),C(c,k.insidetextfont,A,T)}function M(k,A,b){var E=x(k,A,b);return C(f,k.outsidetextfont,A,E)}function C(k,A,b,E){A=A||{};var T=h.getValue(A.family,b),F=h.getValue(A.size,b),D=h.getValue(A.color,b),R=h.getValue(A.weight,b),P=h.getValue(A.style,b),z=h.getValue(A.variant,b),I=h.getValue(A.textcase,b),L=h.getValue(A.lineposition,b),B=h.getValue(A.shadow,b);return{family:h.coerceString(k.family,T,E.family),size:h.coerceNumber(k.size,F,E.size),color:h.coerceColor(k.color,D,E.color),weight:h.coerceString(k.weight,R,E.weight),style:h.coerceString(k.style,P,E.style),variant:h.coerceString(k.variant,z,E.variant),textcase:h.coerceString(k.variant,I,E.textcase),lineposition:h.coerceString(k.variant,L,E.lineposition),shadow:h.coerceString(k.variant,B,E.shadow)}}function w(k,A){return A.type==="waterfall"?A[k.dir].marker.color:k.mcc||k.mc||A.marker.color}r.exports={style:d,styleTextPoints:g,styleOnSelect:m,getInsideTextFont:S,getOutsideTextFont:M,getBarColor:w,resizeText:l}}}),Ev=de({"src/traces/bar/plot.js"(e,r){"use strict";var t=Yr(),i=da(),a=Qt(),o=Zo(),s=ta(),l=hn(),n=Sa(),u=nn().tickText,c=dc(),f=c.recordMinTextSize,h=c.clearMinTextSize,d=Vh(),p=Yw(),g=_0(),m=tp(),y=m.text,_=m.textposition,v=sf().appendArrayPointValue,x=g.TEXTPAD;function S(X){return X.id}function M(X){if(X.ids)return S}function C(X){return(X>0)-(X<0)}function w(X,Z){return X0}function E(X,Z,J,N,H,$){var U=Z.xaxis,V=Z.yaxis,j=X._fullLayout,q=X._context.staticPlot;H||(H={mode:j.barmode,norm:j.barmode,gap:j.bargap,groupgap:j.bargroupgap},h("bar",j));var Y=a.makeTraceGroups(N,J,"trace bars").each(function(K){var te=t.select(this),ne=K[0].trace,se=K[0].t,le=ne.type==="waterfall",ce=ne.type==="funnel",pe=ne.type==="histogram",xe=ne.type==="bar",ye=xe||ce,fe=0;le&&ne.connector.visible&&ne.connector.mode==="between"&&(fe=ne.connector.line.width/2);var ae=ne.orientation==="h",ee=b(H),ie=a.ensureSingle(te,"g","points"),Q=M(ne),ue=ie.selectAll("g.point").data(a.identity,Q);ue.enter().append("g").classed("point",!0),ue.exit().remove(),ue.each(function(Me,Te){var je=t.select(this),Ve=k(Me,U,V,ae),Ke=Ve[0][0],Je=Ve[0][1],vt=Ve[1][0],xt=Ve[1][1],Pt=(ae?Je-Ke:xt-vt)===0;Pt&&ye&&p.getLineWidth(ne,Me)&&(Pt=!1),Pt||(Pt=!i(Ke)||!i(Je)||!i(vt)||!i(xt)),Me.isBlank=Pt,Pt&&(ae?Je=Ke:xt=vt),fe&&!Pt&&(ae?(Ke-=w(Ke,Je)*fe,Je+=w(Ke,Je)*fe):(vt-=w(vt,xt)*fe,xt+=w(vt,xt)*fe));var mt,Mt;if(ne.type==="waterfall"){if(!Pt){var lt=ne[Me.dir].marker;mt=lt.line.width,Mt=lt.color}}else mt=p.getLineWidth(ne,Me),Mt=Me.mc||ne.marker.color;function qe(br){var Er=t.round(mt/2%1,2);return H.gap===0&&H.groupgap===0?t.round(Math.round(br)-Er,2):br}function Ye(br,Er,Tr){return Tr&&br===Er?br:Math.abs(br-Er)>=2?qe(br):br>Er?Math.ceil(br):Math.floor(br)}var me=s.opacity(Mt),_e=me<1||mt>.01?qe:Ye;X._context.staticPlot||(Ke=_e(Ke,Je,ae),Je=_e(Je,Ke,ae),vt=_e(vt,xt,!ae),xt=_e(xt,vt,!ae));var Ae=ae?U.c2p:V.c2p,ke;Me.s0>0?ke=Me._sMax:Me.s0<0?ke=Me._sMin:ke=Me.s1>0?Me._sMax:Me._sMin;function Ee(br,Er){if(!br)return 0;var Tr=Math.abs(ae?xt-vt:Je-Ke),Ur=Math.abs(ae?Je-Ke:xt-vt),Ai=_e(Math.abs(Ae(ke,!0)-Ae(0,!0))),oi=Me.hasB?Math.min(Tr/2,Ur/2):Math.min(Tr/2,Ai),Qr;if(Er==="%"){var ea=Math.min(50,br);Qr=Tr*(ea/100)}else Qr=br;return _e(Math.max(Math.min(Qr,oi),0))}var De=xe||pe?Ee(se.cornerradiusvalue,se.cornerradiusform):0,Qe,Ue,at="M"+Ke+","+vt+"V"+xt+"H"+Je+"V"+vt+"Z",rt=0;if(De&&Me.s){var ht=C(Me.s0)===0||C(Me.s)===C(Me.s0)?Me.s1:Me.s0;if(rt=_e(Me.hasB?0:Math.abs(Ae(ke,!0)-Ae(ht,!0))),rt0?Math.sqrt(rt*(2*De-rt)):0,yt=At>0?Math.max:Math.min;Qe="M"+Ke+","+vt+"V"+(xt-fr*dt)+"H"+yt(Je-(De-rt)*At,Ke)+"A "+De+","+De+" 0 0 "+Ht+" "+Je+","+(xt-De*dt-gt)+"V"+(vt+De*dt+gt)+"A "+De+","+De+" 0 0 "+Ht+" "+yt(Je-(De-rt)*At,Ke)+","+(vt+fr*dt)+"Z"}else if(Me.hasB)Qe="M"+(Ke+De*At)+","+vt+"A "+De+","+De+" 0 0 "+Ht+" "+Ke+","+(vt+De*dt)+"V"+(xt-De*dt)+"A "+De+","+De+" 0 0 "+Ht+" "+(Ke+De*At)+","+xt+"H"+(Je-De*At)+"A "+De+","+De+" 0 0 "+Ht+" "+Je+","+(xt-De*dt)+"V"+(vt+De*dt)+"A "+De+","+De+" 0 0 "+Ht+" "+(Je-De*At)+","+vt+"Z";else{Ue=Math.abs(xt-vt)+rt;var kt=Ue0?Math.sqrt(rt*(2*De-rt)):0,Ct=dt>0?Math.max:Math.min;Qe="M"+(Ke+kt*At)+","+vt+"V"+Ct(xt-(De-rt)*dt,vt)+"A "+De+","+De+" 0 0 "+Ht+" "+(Ke+De*At-Lt)+","+xt+"H"+(Je-De*At+Lt)+"A "+De+","+De+" 0 0 "+Ht+" "+(Je-kt*At)+","+Ct(xt-(De-rt)*dt,vt)+"V"+vt+"Z"}}else Qe=at}else Qe=at;var $t=A(a.ensureSingle(je,"path"),j,H,$);if($t.style("vector-effect",q?"none":"non-scaling-stroke").attr("d",isNaN((Je-Ke)*(xt-vt))||Pt&&X._context.staticPlot?"M0,0Z":Qe).call(l.setClipUrl,Z.layerClipId,X),!j.uniformtext.mode&&ee){var mr=l.makePointStyleFns(ne);l.singlePointStyle(Me,$t,ne,mr,X)}T(X,Z,je,K,Te,Ke,Je,vt,xt,De,rt,H,$),Z.layerClipId&&l.hideOutsideRangePoint(Me,je.select("text"),U,V,ne.xcalendar,ne.ycalendar)});var ge=ne.cliponaxis===!1;l.setClipUrl(te,ge?null:Z.layerClipId,X)});n.getComponentMethod("errorbars","plot")(X,Y,Z,H)}function T(X,Z,J,N,H,$,U,V,j,q,Y,K,te){var ne=Z.xaxis,se=Z.yaxis,le=X._fullLayout,ce;function pe(at,rt,ht){var At=a.ensureSingle(at,"text").text(rt).attr({class:"bartext bartext-"+ce,"text-anchor":"middle","data-notex":1}).call(l.font,ht).call(o.convertToTspans,X);return At}var xe=N[0].trace,ye=xe.orientation==="h",fe=O(N,ye,ne,se),ae=L(le,N,H,ne,se);ce=B(xe,H);var ee=K.mode==="stack"||K.mode==="relative",ie=N[H],Q=!ee||ie._outmost,ue=ie.hasB,ge=q&&q-Y>x;if(!ae||ce==="none"||(ie.isBlank||$===U||V===j)&&(ce==="auto"||ce==="inside")){J.select("text").remove();return}var Me=le.font,Te=d.getBarColor(N[H],xe),je=d.getInsideTextFont(xe,H,Me,Te),Ve=d.getOutsideTextFont(xe,H,Me),Ke=xe.insidetextanchor||"end",Je=J.datum();ye?ne.type==="log"&&Je.s0<=0&&(ne.range[0]0&&Ye>0,Ae;ge?ue?Ae=F(Pt-2*q,mt,qe,Ye,ye)||F(Pt,mt-2*q,qe,Ye,ye):ye?Ae=F(Pt-(q-Y),mt,qe,Ye,ye)||F(Pt,mt-2*(q-Y),qe,Ye,ye):Ae=F(Pt,mt-(q-Y),qe,Ye,ye)||F(Pt-2*(q-Y),mt,qe,Ye,ye):Ae=F(Pt,mt,qe,Ye,ye),_e&&Ae?ce="inside":(ce="outside",Mt.remove(),Mt=null)}else ce="inside";if(!Mt){me=a.ensureUniformFontSize(X,ce==="outside"?Ve:je),Mt=pe(J,ae,me);var ke=Mt.attr("transform");if(Mt.attr("transform",""),lt=l.bBox(Mt.node()),qe=lt.width,Ye=lt.height,Mt.attr("transform",ke),qe<=0||Ye<=0){Mt.remove();return}}var Ee=xe.textangle,De,Qe;ce==="outside"?(Qe=xe.constraintext==="both"||xe.constraintext==="outside",De=I($,U,V,j,lt,{isHorizontal:ye,constrained:Qe,angle:Ee,zeroBarDir:fe})):(Qe=xe.constraintext==="both"||xe.constraintext==="inside",De=P($,U,V,j,lt,{isHorizontal:ye,constrained:Qe,angle:Ee,anchor:Ke,hasB:ue,r:q,overhead:Y})),De.fontSize=me.size,f(xe.type==="histogram"?"bar":xe.type,De,le),ie.transform=De;var Ue=A(Mt,le,K,te);a.setTransormAndDisplay(Ue,De)}function F(X,Z,J,N,H){if(X<0||Z<0)return!1;var $=J<=X&&N<=Z,U=J<=Z&&N<=X,V=H?X>=J*(Z/N):Z>=N*(X/J);return $||U||V}function D(X){return X==="auto"?0:X}function R(X,Z){var J=Math.PI/180*Z,N=Math.abs(Math.sin(J)),H=Math.abs(Math.cos(J));return{x:X.width*H+X.height*N,y:X.width*N+X.height*H}}function P(X,Z,J,N,H,$){var U=!!$.isHorizontal,V=!!$.constrained,j=$.angle||0,q=$.anchor,Y=q==="end",K=q==="start",te=$.leftToRight||0,ne=(te+1)/2,se=1-ne,le=$.hasB,ce=$.r,pe=$.overhead,xe=H.width,ye=H.height,fe=Math.abs(Z-X),ae=Math.abs(N-J),ee=fe>2*x&&ae>2*x?x:0;fe-=2*ee,ae-=2*ee;var ie=D(j);j==="auto"&&!(xe<=fe&&ye<=ae)&&(xe>fe||ye>ae)&&(!(xe>ae||ye>fe)||xex){var Me=z(X,Z,J,N,Q,ce,pe,U,le);ue=Me.scale,ge=Me.pad}else ue=1,V&&(ue=Math.min(1,fe/Q.x,ae/Q.y)),ge=0;var Te=H.left*se+H.right*ne,je=(H.top+H.bottom)/2,Ve=(X+x)*se+(Z-x)*ne,Ke=(J+N)/2,Je=0,vt=0;if(K||Y){var xt=(U?Q.x:Q.y)/2;ce&&(Y||le)&&(ee+=ge);var Pt=U?w(X,Z):w(J,N);U?K?(Ve=X+Pt*ee,Je=-Pt*xt):(Ve=Z-Pt*ee,Je=Pt*xt):K?(Ke=J+Pt*ee,vt=-Pt*xt):(Ke=N-Pt*ee,vt=Pt*xt)}return{textX:Te,textY:je,targetX:Ve,targetY:Ke,anchorX:Je,anchorY:vt,scale:ue,rotate:ie}}function z(X,Z,J,N,H,$,U,V,j){var q=Math.max(0,Math.abs(Z-X)-2*x),Y=Math.max(0,Math.abs(N-J)-2*x),K=$-x,te=U?K-Math.sqrt(K*K-(K-U)*(K-U)):K,ne=j?K*2:V?K-U:2*te,se=j?K*2:V?2*te:K-U,le,ce,pe,xe,ye;return H.y/H.x>=Y/(q-ne)?xe=Y/H.y:H.y/H.x<=(Y-se)/q?xe=q/H.x:!j&&V?(le=H.x*H.x+H.y*H.y/4,ce=-2*H.x*(q-K)-H.y*(Y/2-K),pe=(q-K)*(q-K)+(Y/2-K)*(Y/2-K)-K*K,xe=(-ce+Math.sqrt(ce*ce-4*le*pe))/(2*le)):j?(le=(H.x*H.x+H.y*H.y)/4,ce=-H.x*(q/2-K)-H.y*(Y/2-K),pe=(q/2-K)*(q/2-K)+(Y/2-K)*(Y/2-K)-K*K,xe=(-ce+Math.sqrt(ce*ce-4*le*pe))/(2*le)):(le=H.x*H.x/4+H.y*H.y,ce=-H.x*(q/2-K)-2*H.y*(Y-K),pe=(q/2-K)*(q/2-K)+(Y-K)*(Y-K)-K*K,xe=(-ce+Math.sqrt(ce*ce-4*le*pe))/(2*le)),xe=Math.min(1,xe),V?ye=Math.max(0,K-Math.sqrt(Math.max(0,K*K-(K-(Y-H.y*xe)/2)*(K-(Y-H.y*xe)/2)))-U):ye=Math.max(0,K-Math.sqrt(Math.max(0,K*K-(K-(q-H.x*xe)/2)*(K-(q-H.x*xe)/2)))-U),{scale:xe,pad:ye}}function I(X,Z,J,N,H,$){var U=!!$.isHorizontal,V=!!$.constrained,j=$.angle||0,q=H.width,Y=H.height,K=Math.abs(Z-X),te=Math.abs(N-J),ne;U?ne=te>2*x?x:0:ne=K>2*x?x:0;var se=1;V&&(se=U?Math.min(1,te/Y):Math.min(1,K/q));var le=D(j),ce=R(H,le),pe=(U?ce.x:ce.y)/2,xe=(H.left+H.right)/2,ye=(H.top+H.bottom)/2,fe=(X+Z)/2,ae=(J+N)/2,ee=0,ie=0,Q;return(U?X===Z:J===N)&&$.zeroBarDir?Q=$.zeroBarDir:Q=U?w(Z,X):w(J,N),U?(fe=Z-Q*ne,ee=Q*pe):(ae=N+Q*ne,ie=-Q*pe),{textX:xe,textY:ye,targetX:fe,targetY:ae,anchorX:ee,anchorY:ie,scale:se,rotate:le}}function L(X,Z,J,N,H){var $=Z[0].trace,U=$.texttemplate,V;return U?V=G(X,Z,J,N,H):$.textinfo?V=W(Z,J,N,H):V=p.getValue($.text,J),p.coerceString(y,V)}function B(X,Z){var J=p.getValue(X.textposition,Z);return p.coerceEnumerated(_,J)}function O(X,Z,J,N){for(var H=!1,$=!1,U=0;U0?H=!0:V<0&&($=!0),H&&$)return 0}var j=Z?J:N,q=-w(j.range[0],j.range[1]);return $?H?0:-q:q}function G(X,Z,J,N,H){var $=Z[0].trace,U=a.castOption($,J,"texttemplate");if(!U)return"";var V=$.type==="histogram",j=$.type==="waterfall",q=$.type==="funnel",Y=$.orientation==="h",K,te,ne,se;Y?(K="y",te=H,ne="x",se=N):(K="x",te=N,ne="y",se=H);function le(ee){return u(te,te.c2l(ee),!0).text}function ce(ee){return u(se,se.c2l(ee),!0).text}var pe=Z[J],xe={};xe.label=pe.p,xe.labelLabel=xe[K+"Label"]=le(pe.p);var ye=a.castOption($,pe.i,"text");(ye===0||ye)&&(xe.text=ye),xe.value=pe.s,xe.valueLabel=xe[ne+"Label"]=ce(pe.s);var fe={};v(fe,$,pe.i),(V||fe.x===void 0)&&(fe.x=Y?xe.value:xe.label),(V||fe.y===void 0)&&(fe.y=Y?xe.label:xe.value),(V||fe.xLabel===void 0)&&(fe.xLabel=Y?xe.valueLabel:xe.labelLabel),(V||fe.yLabel===void 0)&&(fe.yLabel=Y?xe.labelLabel:xe.valueLabel),j&&(xe.delta=+pe.rawS||pe.s,xe.deltaLabel=ce(xe.delta),xe.final=pe.v,xe.finalLabel=ce(xe.final),xe.initial=xe.final-xe.delta,xe.initialLabel=ce(xe.initial)),q&&(xe.value=pe.s,xe.valueLabel=ce(xe.value),xe.percentInitial=pe.begR,xe.percentInitialLabel=a.formatPercent(pe.begR),xe.percentPrevious=pe.difR,xe.percentPreviousLabel=a.formatPercent(pe.difR),xe.percentTotal=pe.sumR,xe.percenTotalLabel=a.formatPercent(pe.sumR));var ae=a.castOption($,pe.i,"customdata");return ae&&(xe.customdata=ae),a.texttemplateString({data:[fe,xe,$._meta],fallback:$.texttemplatefallback,labels:xe,locale:X._d3locale,template:U})}function W(X,Z,J,N){var H=X[0].trace,$=H.orientation==="h",U=H.type==="waterfall",V=H.type==="funnel";function j(ae){var ee=$?N:J;return u(ee,ae,!0).text}function q(ae){var ee=$?J:N;return u(ee,+ae,!0).text}var Y=H.textinfo,K=X[Z],te=Y.split("+"),ne=[],se,le=function(ae){return te.indexOf(ae)!==-1};if(le("label")&&ne.push(j(X[Z].p)),le("text")&&(se=a.castOption(H,K.i,"text"),(se===0||se)&&ne.push(se)),U){var ce=+K.rawS||K.s,pe=K.v,xe=pe-ce;le("initial")&&ne.push(q(xe)),le("delta")&&ne.push(q(ce)),le("final")&&ne.push(q(pe))}if(V){le("value")&&ne.push(q(K.s));var ye=0;le("percent initial")&&ye++,le("percent previous")&&ye++,le("percent total")&&ye++;var fe=ye>1;le("percent initial")&&(se=a.formatPercent(K.begR),fe&&(se+=" of initial"),ne.push(se)),le("percent previous")&&(se=a.formatPercent(K.difR),fe&&(se+=" of previous"),ne.push(se)),le("percent total")&&(se=a.formatPercent(K.sumR),fe&&(se+=" of total"),ne.push(se))}return ne.join("
")}r.exports={plot:E,toMoveInsideBar:P}}}),_1=de({"src/traces/bar/hover.js"(e,r){"use strict";var t=$s(),i=Sa(),a=ta(),o=Qt().fillText,s=Yw().getLineWidth,l=nn().hoverLabelText,n=cn().BADNUM;function u(h,d,p,g,m){var y=c(h,d,p,g,m);if(y){var _=y.cd,v=_[0].trace,x=_[y.index];return y.color=f(v,x),i.getComponentMethod("errorbars","hoverInfo")(x,v,y),[y]}}function c(h,d,p,g,m){var y=h.cd,_=y[0].trace,v=y[0].t,x=g==="closest",S=_.type==="waterfall",M=h.maxHoverDistance,C=h.maxSpikeDistance,w,k,A,b,E,T,F;_.orientation==="h"?(w=p,k=d,A="y",b="x",E=J,T=W):(w=d,k=p,A="x",b="y",T=J,E=W);var D=_[A+"period"],R=x||D;function P(ne){return I(ne,-1)}function z(ne){return I(ne,1)}function I(ne,se){var le=ne.w;return ne[A]+se*le/2}function L(ne){return ne[A+"End"]-ne[A+"Start"]}var B=x?P:D?function(ne){return ne.p-L(ne)/2}:function(ne){return Math.min(P(ne),ne.p-v.bardelta/2)},O=x?z:D?function(ne){return ne.p+L(ne)/2}:function(ne){return Math.max(z(ne),ne.p+v.bardelta/2)};function G(ne,se,le){return m.finiteRange&&(le=0),t.inbox(ne-w,se-w,le+Math.min(1,Math.abs(se-ne)/F)-1)}function W(ne){return G(B(ne),O(ne),M)}function X(ne){return G(P(ne),z(ne),C)}function Z(ne){var se=ne[b];if(S){var le=Math.abs(ne.rawS)||0;k>0?se+=le:k<0&&(se-=le)}return se}function J(ne){var se=k,le=ne.b,ce=Z(ne);return t.inbox(le-se,ce-se,M+(ce-se)/(ce-le)-1)}function N(ne){var se=k,le=ne.b,ce=Z(ne);return t.inbox(le-se,ce-se,C+(ce-se)/(ce-le)-1)}var H=h[A+"a"],$=h[b+"a"];F=Math.abs(H.r2c(H.range[1])-H.r2c(H.range[0]));function U(ne){return(E(ne)+T(ne))/2}var V=t.getDistanceFunction(g,E,T,U);if(t.getClosest(y,V,h),h.index!==!1&&y[h.index].p!==n){R||(B=function(ne){return Math.min(P(ne),ne.p-v.bargroupwidth/2)},O=function(ne){return Math.max(z(ne),ne.p+v.bargroupwidth/2)});var j=h.index,q=y[j],Y=_.base?q.b+q.s:q.s;h[b+"0"]=h[b+"1"]=$.c2p(q[b],!0),h[b+"LabelVal"]=Y;var K=v.extents[v.extents.round(q.p)];h[A+"0"]=H.c2p(x?B(q):K[0],!0),h[A+"1"]=H.c2p(x?O(q):K[1],!0);var te=q.orig_p!==void 0;return h[A+"LabelVal"]=te?q.orig_p:q.p,h.labelLabel=l(H,h[A+"LabelVal"],_[A+"hoverformat"]),h.valueLabel=l($,h[b+"LabelVal"],_[b+"hoverformat"]),h.baseLabel=l($,q.b,_[b+"hoverformat"]),h.spikeDistance=(N(q)+X(q))/2,h[A+"Spike"]=H.c2p(q.p,!0),o(q,_,h),h.hovertemplate=_.hovertemplate,h}}function f(h,d){var p=d.mcc||h.marker.color,g=d.mlcc||h.marker.line.color,m=s(h,d);if(a.opacity(p))return p;if(a.opacity(g)&&m)return g}r.exports={hoverPoints:u,hoverOnBars:c,getTraceColor:f}}}),iG=de({"src/traces/bar/event_data.js"(e,r){"use strict";r.exports=function(i,a,o){return i.x="xVal"in a?a.xVal:a.x,i.y="yVal"in a?a.yVal:a.y,a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),o.orientation==="h"?(i.label=i.y,i.value=i.x):(i.label=i.x,i.value=i.y),i}}}),x1=de({"src/traces/bar/select.js"(e,r){"use strict";r.exports=function(a,o){var s=a.cd,l=a.xaxis,n=a.yaxis,u=s[0].trace,c=u.type==="funnel",f=u.orientation==="h",h=[],d;if(o===!1)for(d=0;d0?(D="v",A>0?R=Math.min(E,b):R=Math.min(b)):A>0?(D="h",R=Math.min(E)):R=0;if(!R){p.visible=!1;return}p._length=R;var B=g("orientation",D);p._hasPreCompStats?B==="v"&&A===0?(g("x0",0),g("dx",1)):B==="h"&&k===0&&(g("y0",0),g("dy",1)):B==="v"&&A===0?g("x0"):B==="h"&&k===0&&g("y0");var O=i.getComponentMethod("calendars","handleTraceDefaults");O(d,p,["x","y"],m)}function f(d,p,g,m){var y=m.prefix,_=t.coerce2(d,p,n,"marker.outliercolor"),v=g("marker.line.outliercolor"),x="outliers";p._hasPreCompStats?x="all":(_||v)&&(x="suspectedoutliers");var S=g(y+"points",x);S?(g("jitter",S==="all"?.3:0),g("pointpos",S==="all"?-1.5:0),g("marker.symbol"),g("marker.opacity"),g("marker.size"),g("marker.angle"),g("marker.color",p.line.color),g("marker.line.color"),g("marker.line.width"),S==="suspectedoutliers"&&(g("marker.line.outliercolor",p.marker.color),g("marker.line.outlierwidth")),g("selected.marker.color"),g("unselected.marker.color"),g("selected.marker.size"),g("unselected.marker.size"),g("text"),g("hovertext")):delete p.marker;var M=g("hoveron");(M==="all"||M.indexOf("points")!==-1)&&(g("hovertemplate"),g("hovertemplatefallback")),t.coerceSelectionMarkerOpacity(p,g)}function h(d,p){var g,m;function y(S){return t.coerce(m._input,m,n,S)}for(var _=0;_Z.uf};if(C._hasPreCompStats){var j=C[R],q=function(xt){return D.d2c((C[xt]||[])[T])},Y=1/0,K=-1/0;for(T=0;T=Z.q1&&Z.q3>=Z.med){var ne=q("lowerfence");Z.lf=ne!==s&&ne<=Z.q1?ne:m(Z,N,H);var se=q("upperfence");Z.uf=se!==s&&se>=Z.q3?se:y(Z,N,H);var le=q("mean");Z.mean=le!==s?le:H?o.mean(N,H):(Z.q1+Z.q3)/2;var ce=q("sd");Z.sd=le!==s&&ce>=0?ce:H?o.stdev(N,H,Z.mean):Z.q3-Z.q1,Z.lo=_(Z),Z.uo=v(Z);var pe=q("notchspan");pe=pe!==s&&pe>0?pe:x(Z,H),Z.ln=Z.med-pe,Z.un=Z.med+pe;var xe=Z.lf,ye=Z.uf;C.boxpoints&&N.length&&(xe=Math.min(xe,N[0]),ye=Math.max(ye,N[H-1])),C.notched&&(xe=Math.min(xe,Z.ln),ye=Math.max(ye,Z.un)),Z.min=xe,Z.max=ye}else{o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+Z.q1,"median = "+Z.med,"q3 = "+Z.q3].join(` +`));var fe;Z.med!==s?fe=Z.med:Z.q1!==s?Z.q3!==s?fe=(Z.q1+Z.q3)/2:fe=Z.q1:Z.q3!==s?fe=Z.q3:fe=0,Z.med=fe,Z.q1=Z.q3=fe,Z.lf=Z.uf=fe,Z.mean=Z.sd=fe,Z.ln=Z.un=fe,Z.min=Z.max=fe}Y=Math.min(Y,Z.min),K=Math.max(K,Z.max),Z.pts2=J.filter(V),b.push(Z)}}C._extremes[D._id]=i.findExtremes(D,[Y,K],{padded:!0})}else{var ae=D.makeCalcdata(C,R),ee=u(W,X),ie=W.length,Q=c(ie);for(T=0;T=0&&ue0){if(Z={},Z.pos=Z[z]=W[T],J=Z.pts=Q[T].sort(p),N=Z[R]=J.map(g),H=N.length,Z.min=N[0],Z.max=N[H-1],Z.mean=o.mean(N,H),Z.sd=o.stdev(N,H,Z.mean)*C.sdmultiple,Z.med=o.interp(N,.5),H%2&&(je||Ve)){var Ke,Je;je?(Ke=N.slice(0,H/2),Je=N.slice(H/2+1)):Ve&&(Ke=N.slice(0,H/2+1),Je=N.slice(H/2)),Z.q1=o.interp(Ke,.5),Z.q3=o.interp(Je,.5)}else Z.q1=o.interp(N,.25),Z.q3=o.interp(N,.75);Z.lf=m(Z,N,H),Z.uf=y(Z,N,H),Z.lo=_(Z),Z.uo=v(Z);var vt=x(Z,H);Z.ln=Z.med-vt,Z.un=Z.med+vt,ge=Math.min(ge,Z.ln),Me=Math.max(Me,Z.un),Z.pts2=J.filter(V),b.push(Z)}C.notched&&o.isTypedArray(ae)&&(ae=Array.from(ae)),C._extremes[D._id]=i.findExtremes(D,C.notched?ae.concat([ge,Me]):ae,{padded:!0})}return d(b,C),b.length>0?(b[0].t={num:w[E],dPos:X,posLetter:z,valLetter:R,labels:{med:l(M,"median:"),min:l(M,"min:"),q1:l(M,"q1:"),q3:l(M,"q3:"),max:l(M,"max:"),mean:C.boxmean==="sd"||C.sizemode==="sd"?l(M,"mean \xB1 \u03C3:").replace("\u03C3",C.sdmultiple===1?"\u03C3":C.sdmultiple+"\u03C3"):l(M,"mean:"),lf:l(M,"lower fence:"),uf:l(M,"upper fence:")}},w[E]++,b):[{t:{empty:!0}}]};function n(S,M,C,w){var k=M in S,A=M+"0"in S,b="d"+M in S;if(k||A&&b){var E=C.makeCalcdata(S,M),T=a(S,C,M,E).vals;return[T,E]}var F;A?F=S[M+"0"]:"name"in S&&(C.type==="category"||t(S.name)&&["linear","log"].indexOf(C.type)!==-1||o.isDateTime(S.name)&&C.type==="date")?F=S.name:F=w;for(var D=C.type==="multicategory"?C.r2c_just_indices(F):C.d2c(F,0,S[M+"calendar"]),R=S._length,P=new Array(R),z=0;z1,A=1-d[n+"gap"],b=1-d[n+"groupgap"];for(m=0;m0;if(D==="positive"?(Z=R*(F?1:.5),H=N,J=H=z):D==="negative"?(Z=H=z,J=R*(F?1:.5),$=N):(Z=J=R,H=$=N),K){var te=E.pointpos,ne=E.jitter,se=E.marker.size/2,le=0;te+ne>=0&&(le=N*(te+ne),le>Z?(Y=!0,j=se,U=le):le>H&&(j=se,U=Z)),le<=Z&&(U=Z);var ce=0;te-ne<=0&&(ce=-N*(te-ne),ce>J?(Y=!0,q=se,V=ce):ce>$&&(q=se,V=J)),ce<=J&&(V=J)}else U=Z,V=J;var pe=new Array(_.length);for(y=0;y<_.length;y++)pe[y]=_[y].pos;E._extremes[p]=t.findExtremes(f,pe,{padded:Y,vpadminus:V,vpadplus:U,vpadLinearized:!0,ppadminus:{x:q,y:j}[g],ppadplus:{x:j,y:q}[g]})}}}r.exports={crossTraceCalc:s,setPositionOffset:l}}}),Kw=de({"src/traces/box/plot.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=hn(),o=5,s=.01;function l(f,h,d,p){var g=f._context.staticPlot,m=h.xaxis,y=h.yaxis;i.makeTraceGroups(p,d,"trace boxes").each(function(_){var v=t.select(this),x=_[0],S=x.t,M=x.trace;if(S.wdPos=S.bdPos*M.whiskerwidth,M.visible!==!0||S.empty){v.remove();return}var C,w;M.orientation==="h"?(C=y,w=m):(C=m,w=y),n(v,{pos:C,val:w},M,S,g),u(v,{x:m,y},M,S),c(v,{pos:C,val:w},M,S)})}function n(f,h,d,p,g){var m=d.orientation==="h",y=h.val,_=h.pos,v=!!_.rangebreaks,x=p.bPos,S=p.wdPos||0,M=p.bPosPxOffset||0,C=d.whiskerwidth||0,w=d.showwhiskers!==!1,k=d.notched||!1,A=k?1-2*d.notchwidth:1,b,E;Array.isArray(p.bdPos)?(b=p.bdPos[0],E=p.bdPos[1]):(b=p.bdPos,E=p.bdPos);var T=f.selectAll("path.box").data(d.type!=="violin"||d.box.visible?i.identity:[]);T.enter().append("path").style("vector-effect",g?"none":"non-scaling-stroke").attr("class","box"),T.exit().remove(),T.each(function(F){if(F.empty)return t.select(this).attr("d","M0,0Z");var D=_.c2l(F.pos+x,!0),R=_.l2p(D-b)+M,P=_.l2p(D+E)+M,z=v?(R+P)/2:_.l2p(D)+M,I=d.whiskerwidth,L=v?R*I+(1-I)*z:_.l2p(D-S)+M,B=v?P*I+(1-I)*z:_.l2p(D+S)+M,O=_.l2p(D-b*A)+M,G=_.l2p(D+E*A)+M,W=d.sizemode==="sd",X=y.c2p(W?F.mean-F.sd:F.q1,!0),Z=W?y.c2p(F.mean+F.sd,!0):y.c2p(F.q3,!0),J=i.constrain(W?y.c2p(F.mean,!0):y.c2p(F.med,!0),Math.min(X,Z)+1,Math.max(X,Z)-1),N=F.lf===void 0||d.boxpoints===!1||W,H=y.c2p(N?F.min:F.lf,!0),$=y.c2p(N?F.max:F.uf,!0),U=y.c2p(F.ln,!0),V=y.c2p(F.un,!0);m?t.select(this).attr("d","M"+J+","+O+"V"+G+"M"+X+","+R+"V"+P+(k?"H"+U+"L"+J+","+G+"L"+V+","+P:"")+"H"+Z+"V"+R+(k?"H"+V+"L"+J+","+O+"L"+U+","+R:"")+"Z"+(w?"M"+X+","+z+"H"+H+"M"+Z+","+z+"H"+$+(C===0?"":"M"+H+","+L+"V"+B+"M"+$+","+L+"V"+B):"")):t.select(this).attr("d","M"+O+","+J+"H"+G+"M"+R+","+X+"H"+P+(k?"V"+U+"L"+G+","+J+"L"+P+","+V:"")+"V"+Z+"H"+R+(k?"V"+V+"L"+O+","+J+"L"+R+","+U:"")+"Z"+(w?"M"+z+","+X+"V"+H+"M"+z+","+Z+"V"+$+(C===0?"":"M"+L+","+H+"H"+B+"M"+L+","+$+"H"+B):""))})}function u(f,h,d,p){var g=h.x,m=h.y,y=p.bdPos,_=p.bPos,v=d.boxpoints||d.points;i.seedPseudoRandom();var x=function(C){return C.forEach(function(w){w.t=p,w.trace=d}),C},S=f.selectAll("g.points").data(v?x:[]);S.enter().append("g").attr("class","points"),S.exit().remove();var M=S.selectAll("path").data(function(C){var w,k=C.pts2,A=Math.max((C.max-C.min)/10,C.q3-C.q1),b=A*1e-9,E=A*s,T=[],F=0,D;if(d.jitter){if(A===0)for(F=1,T=new Array(k.length),w=0;wC.lo&&(B.so=!0)}return k});M.enter().append("path").classed("point",!0),M.exit().remove(),M.call(a.translatePoints,g,m)}function c(f,h,d,p){var g=h.val,m=h.pos,y=!!m.rangebreaks,_=p.bPos,v=p.bPosPxOffset||0,x=d.boxmean||(d.meanline||{}).visible,S,M;Array.isArray(p.bdPos)?(S=p.bdPos[0],M=p.bdPos[1]):(S=p.bdPos,M=p.bdPos);var C=f.selectAll("path.mean").data(d.type==="box"&&d.boxmean||d.type==="violin"&&d.box.visible&&d.meanline.visible?i.identity:[]);C.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),C.exit().remove(),C.each(function(w){var k=m.c2l(w.pos+_,!0),A=m.l2p(k-S)+v,b=m.l2p(k+M)+v,E=y?(A+b)/2:m.l2p(k)+v,T=g.c2p(w.mean,!0),F=g.c2p(w.mean-w.sd,!0),D=g.c2p(w.mean+w.sd,!0);d.orientation==="h"?t.select(this).attr("d","M"+T+","+A+"V"+b+(x==="sd"?"m0,0L"+F+","+E+"L"+T+","+A+"L"+D+","+E+"Z":"")):t.select(this).attr("d","M"+A+","+T+"H"+b+(x==="sd"?"m0,0L"+E+","+F+"L"+A+","+T+"L"+E+","+D+"Z":""))})}r.exports={plot:l,plotBoxAndWhiskers:n,plotPoints:u,plotBoxMean:c}}}),Jw=de({"src/traces/box/style.js"(e,r){"use strict";var t=Yr(),i=ta(),a=hn();function o(l,n,u){var c=u||t.select(l).selectAll("g.trace.boxes");c.style("opacity",function(f){return f[0].trace.opacity}),c.each(function(f){var h=t.select(this),d=f[0].trace,p=d.line.width;function g(_,v,x,S){_.style("stroke-width",v+"px").call(i.stroke,x).call(i.fill,S)}var m=h.selectAll("path.box");if(d.type==="candlestick")m.each(function(_){if(!_.empty){var v=t.select(this),x=d[_.dir];g(v,x.line.width,x.line.color,x.fillcolor),v.style("opacity",d.selectedpoints&&!_.selected?.3:1)}});else{g(m,p,d.line.color,d.fillcolor),h.selectAll("path.mean").style({"stroke-width":p,"stroke-dasharray":2*p+"px,"+p+"px"}).call(i.stroke,d.line.color);var y=h.selectAll("path.point");a.pointStyle(y,d,l)}})}function s(l,n,u){var c=n[0].trace,f=u.selectAll("path.point");c.selectedpoints?a.selectedPointStyle(f,c):a.pointStyle(f,c,l)}r.exports={style:o,styleOnSelect:s}}}),bk=de({"src/traces/box/hover.js"(e,r){"use strict";var t=nn(),i=Qt(),a=$s(),o=ta(),s=i.fillText;function l(c,f,h,d){var p=c.cd,g=p[0].trace,m=g.hoveron,y=[],_;return m.indexOf("boxes")!==-1&&(y=y.concat(n(c,f,h,d))),m.indexOf("points")!==-1&&(_=u(c,f,h)),d==="closest"?_?[_]:y:(_&&y.push(_),y)}function n(c,f,h,d){var p=c.cd,g=c.xa,m=c.ya,y=p[0].trace,_=p[0].t,v=y.type==="violin",x,S,M,C,w,k,A,b,E,T,F,D=_.bdPos,R,P,z=_.wHover,I=function(ce){return M.c2l(ce.pos)+_.bPos-M.c2l(k)};v&&y.side!=="both"?(y.side==="positive"&&(E=function(ce){var pe=I(ce);return a.inbox(pe,pe+z,T)},R=D,P=0),y.side==="negative"&&(E=function(ce){var pe=I(ce);return a.inbox(pe-z,pe,T)},R=0,P=D)):(E=function(ce){var pe=I(ce);return a.inbox(pe-z,pe+z,T)},R=P=D);var L;v?L=function(ce){return a.inbox(ce.span[0]-w,ce.span[1]-w,T)}:L=function(ce){return a.inbox(ce.min-w,ce.max-w,T)},y.orientation==="h"?(w=f,k=h,A=L,b=E,x="y",M=m,S="x",C=g):(w=h,k=f,A=E,b=L,x="x",M=g,S="y",C=m);var B=Math.min(1,D/Math.abs(M.r2c(M.range[1])-M.r2c(M.range[0])));T=c.maxHoverDistance-B,F=c.maxSpikeDistance-B;function O(ce){return(A(ce)+b(ce))/2}var G=a.getDistanceFunction(d,A,b,O);if(a.getClosest(p,G,c),c.index===!1)return[];var W=p[c.index],X=y.line.color,Z=(y.marker||{}).color;o.opacity(X)&&y.line.width?c.color=X:o.opacity(Z)&&y.boxpoints?c.color=Z:c.color=y.fillcolor,c[x+"0"]=M.c2p(W.pos+_.bPos-P,!0),c[x+"1"]=M.c2p(W.pos+_.bPos+R,!0),c[x+"LabelVal"]=W.orig_p!==void 0?W.orig_p:W.pos;var J=x+"Spike";c.spikeDistance=O(W)*F/T,c[J]=M.c2p(W.pos,!0);var N=y.boxmean||y.sizemode==="sd"||(y.meanline||{}).visible,H=y.boxpoints||y.points,$=H&&N?["max","uf","q3","med","mean","q1","lf","min"]:H&&!N?["max","uf","q3","med","q1","lf","min"]:!H&&N?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=C.range[1]0&&(u=!0);for(var d=0;dl){var n=l-o[i];return o[i]=l,n}}else return o[i]=l,l;return 0},max:function(i,a,o,s){var l=s[a];if(t(l))if(l=Number(l),t(o[i])){if(o[i]A&&Ao){var T=b===i?1:6,F=b===i?"M12":"M1";return function(D,R){var P=_.c2d(D,i,v),z=P.indexOf("-",T);z>0&&(P=P.slice(0,z));var I=_.d2c(P,0,v);if(In?p>o?p>i*1.1?i:p>a*1.1?a:o:p>s?s:p>l?l:n:Math.pow(10,Math.floor(Math.log(p)/Math.LN10))}function h(p,g,m,y,_,v){if(y&&p>o){var x=d(g,_,v),S=d(m,_,v),M=p===i?0:1;return x[M]!==S[M]}return Math.floor(m/p)-Math.floor(g/p)>.1}function d(p,g,m){var y=g.c2d(p,i,m).split("-");return y[0]===""&&(y.unshift(),y[0]="-"+y[0]),y}}}),kk=de({"src/traces/histogram/calc.js"(e,r){"use strict";var t=da(),i=Qt(),a=Sa(),o=nn(),{hasColorscale:s}=Wu(),l=hc(),n=Oy(),u=Ak(),c=Mk(),f=Sk(),h=Ek();function d(_,v){var x=[],S=[],M=v.orientation==="h",C=o.getFromId(_,M?v.yaxis:v.xaxis),w=M?"y":"x",k={x:"y",y:"x"}[w],A=v[w+"calendar"],b=v.cumulative,E,T=p(_,v,C,w),F=T[0],D=T[1],R=typeof F.size=="string",P=[],z=R?P:F,I=[],L=[],B=[],O=0,G=v.histnorm,W=v.histfunc,X=G.indexOf("density")!==-1,Z,J,N;b.enabled&&X&&(G=G.replace(/ ?density$/,""),X=!1);var H=W==="max"||W==="min",$=H?null:0,U=u.count,V=c[G],j=!1,q=function(ue){return C.r2c(ue,0,A)},Y;for(i.isArrayOrTypedArray(v[k])&&W!=="count"&&(Y=v[k],j=W==="avg",U=u[W]),E=q(F.start),J=q(F.end)+(E-o.tickIncrement(E,F.size,!1,A))/1e6;E=0&&N=ee;E--)if(S[E]){ie=E;break}for(E=ee;E<=ie;E++)if(t(x[E])&&t(S[E])){var Q={p:x[E],s:S[E],b:0};b.enabled||(Q.pts=B[E],se?Q.ph0=Q.ph1=B[E].length?D[B[E][0]]:x[E]:(v._computePh=!0,Q.ph0=ye(P[E]),Q.ph1=ye(P[E+1],!0))),ae.push(Q)}return ae.length===1&&(ae[0].width1=o.tickIncrement(ae[0].p,F.size,!1,A)-ae[0].p),s(v,"marker")&&l(_,v,{vals:v.marker.color,containerStr:"marker",cLetter:"c"}),s(v,"marker.line")&&l(_,v,{vals:v.marker.line.color,containerStr:"marker.line",cLetter:"c"}),n(ae,v),i.isArrayOrTypedArray(v.selectedpoints)&&i.tagSelected(ae,v,pe),ae}function p(_,v,x,S,M){var C,w=S+"bins",k=_._fullLayout,A=v["_"+S+"bingroup"],b=k._histogramBinOpts[A],E=k.barmode==="overlay",T,F,D,R,P,z,I,L=function(ye){return x.r2c(ye,0,R)},B=function(ye){return x.c2r(ye,0,R)},O=x.type==="date"?function(ye){return ye||ye===0?i.cleanDate(ye,null,R):null}:function(ye){return t(ye)?Number(ye):null};function G(ye,fe,ae){fe[ye+"Found"]?(fe[ye]=O(fe[ye]),fe[ye]===null&&(fe[ye]=ae[ye])):(z[ye]=fe[ye]=ae[ye],i.nestedProperty(F[0],w+"."+ye).set(ae[ye]))}if(v["_"+S+"autoBinFinished"])delete v["_"+S+"autoBinFinished"];else{F=b.traces;var W=[],X=!0,Z=!1,J=!1;for(T=0;Tx.r2l(K)&&(ne=o.tickIncrement(ne,b.size,!0,R)),V.start=x.l2r(ne),Y||i.nestedProperty(v,w+".start").set(V.start)}var se=b.end,le=x.r2l(U.end),ce=le!==void 0;if((b.endFound||ce)&&le!==x.r2l(se)){var pe=ce?le:i.aggNums(Math.max,null,P);V.end=x.l2r(pe),ce||i.nestedProperty(v,w+".start").set(V.end)}var xe="autobin"+S;return v._input[xe]===!1&&(v._input[w]=i.extendFlat({},v[w]||{}),delete v._input[xe],delete v[xe]),[V,P]}function g(_,v,x,S,M){var C=_._fullLayout,w=m(_,v),k=!1,A=1/0,b=[v],E,T,F;for(E=0;E=0;S--)k(S);else if(v==="increasing"){for(S=1;S<_.length;S++)_[S]+=_[S-1];x==="exclude"&&(_.unshift(0),_.pop())}else{for(S=_.length-2;S>=0;S--)_[S]+=_[S+1];x==="exclude"&&(_.push(0),_.shift())}}r.exports={calc:d,calcAllAutoBins:p}}}),cG=de({"src/traces/histogram2d/calc.js"(e,r){"use strict";var t=Qt(),i=nn(),a=Ak(),o=Mk(),s=Sk(),l=Ek(),n=kk().calcAllAutoBins;r.exports=function(d,p){var g=i.getFromId(d,p.xaxis),m=i.getFromId(d,p.yaxis),y=p.xcalendar,_=p.ycalendar,v=function(qe){return g.r2c(qe,0,y)},x=function(qe){return m.r2c(qe,0,_)},S=function(qe){return g.c2r(qe,0,y)},M=function(qe){return m.c2r(qe,0,_)},C,w,k,A,b=n(d,p,g,"x"),E=b[0],T=b[1],F=n(d,p,m,"y"),D=F[0],R=F[1],P=p._length;T.length>P&&T.splice(P,T.length-P),R.length>P&&R.splice(P,R.length-P);var z=[],I=[],L=[],B=typeof E.size=="string",O=typeof D.size=="string",G=[],W=[],X=B?G:E,Z=O?W:D,J=0,N=[],H=[],$=p.histnorm,U=p.histfunc,V=$.indexOf("density")!==-1,j=U==="max"||U==="min",q=j?null:0,Y=a.count,K=o[$],te=!1,ne=[],se=[],le="z"in p?p.z:"marker"in p&&Array.isArray(p.marker.color)?p.marker.color:"";le&&U!=="count"&&(te=U==="avg",Y=a[U]);var ce=E.size,pe=v(E.start),xe=v(E.end)+(pe-i.tickIncrement(pe,ce,!1,y))/1e6;for(C=pe;C=0&&k=0&&Ai;f++)c=s(n,u,o(c));return c>i&&t.log("interp2d didn't converge quickly",c),n};function s(l,n,u){var c=0,f,h,d,p,g,m,y,_,v,x,S,M,C;for(p=0;pM&&(c=Math.max(c,Math.abs(l[h][d]-S)/(C-M))))}return c}}}),i3=de({"src/traces/heatmap/find_empties.js"(e,r){"use strict";var t=Qt().maxRowLength;r.exports=function(a){var o=[],s={},l=[],n=a[0],u=[],c=[0,0,0],f=t(a),h,d,p,g,m,y,_,v;for(d=0;d=0;m--)g=l[m],d=g[0],p=g[1],y=((s[[d-1,p]]||c)[2]+(s[[d+1,p]]||c)[2]+(s[[d,p-1]]||c)[2]+(s[[d,p+1]]||c)[2])/20,y&&(_[g]=[d,p,y],l.splice(m,1),v=!0);if(!v)throw"findEmpties iterated with no new neighbors";for(g in _)s[g]=_[g],o.push(_[g])}return o.sort(function(x,S){return S[2]-x[2]})}}}),Ck=de({"src/traces/heatmap/make_bound_array.js"(e,r){"use strict";var t=Sa(),i=Qt().isArrayOrTypedArray;r.exports=function(o,s,l,n,u,c){var f=[],h=t.traceIs(o,"contour"),d=t.traceIs(o,"histogram"),p,g,m,y=i(s)&&s.length>1;if(y&&!d&&c.type!=="category"){var _=s.length;if(_<=u){if(h)f=Array.from(s).slice(0,u);else if(u===1)c.type==="log"?f=[.5*s[0],2*s[0]]:f=[s[0]-.5,s[0]+.5];else if(c.type==="log"){for(f=[Math.pow(s[0],1.5)/Math.pow(s[1],.5)],m=1;m<_;m++)f.push(Math.sqrt(s[m-1]*s[m]));f.push(Math.pow(s[_-1],1.5)/Math.pow(s[_-2],.5))}else{for(f=[1.5*s[0]-.5*s[1]],m=1;m<_;m++)f.push((s[m-1]+s[m])*.5);f.push(1.5*s[_-1]-.5*s[_-2])}if(_1){var $=(H[H.length-1]-H[0])/(H.length-1),U=Math.abs($/100);for(P=0;PU)return!1}return!0}_._islinear=!1,v.type==="log"||x.type==="log"?C==="fast"&&L("log axis found"):B(w)?B(E)?_._islinear=!0:C==="fast"&&L("y scale is not linear"):C==="fast"&&L("x scale is not linear");var O=i.maxRowLength(R),G=_.xtype==="scaled"?"":w,W=h(_,G,k,A,O,v),X=_.ytype==="scaled"?"":E,Z=h(_,X,T,F,R.length,x);_._extremes[v._id]=a.findExtremes(v,W),_._extremes[x._id]=a.findExtremes(x,Z);var J={x:W,y:Z,z:R,text:_._text||_.text,hovertext:_._hovertext||_.hovertext};if(_.xperiodalignment&&b&&(J.orig_x=b),_.yperiodalignment&&D&&(J.orig_y=D),G&&G.length===W.length-1&&(J.xCenter=G),X&&X.length===Z.length-1&&(J.yCenter=X),M&&(J.xRanges=z.xRanges,J.yRanges=z.yRanges,J.pts=z.pts),S||l(y,_,{vals:R,cLetter:"z"}),S&&_.contours&&_.contours.coloring==="heatmap"){var N={type:_.type==="contour"?"heatmap":"histogram2d",xcalendar:_.xcalendar,ycalendar:_.ycalendar};J.xfill=h(N,G,k,A,O,v),J.yfill=h(N,X,T,F,R.length,x)}return[J]};function p(m){for(var y=[],_=m.length,v=0;v<_;v++){var x=m[v];x!==d&&y.push(x)}return y}function g(m,y,_){for(var v=[],x=-1,S=0;S<_.length;S++)if(y[S]!==d){x++,v[x]=[];for(var M=0;M<_[S].length;M++)m[M]!==d&&v[x].push(_[S][M])}return v}}}),n3=de({"src/constants/pixelated_image.js"(e){"use strict";e.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],e.STYLE=e.CSS_DECLARATIONS.map(function(r){return r.join(": ")+"; "}).join("")}}),Dk=de({"src/lib/supports_pixelated_image.js"(e,r){"use strict";var t=n3(),i=hn(),a=Qt(),o=null;function s(){if(o!==null)return o;o=!1;var l=a.isSafari()||a.isMacWKWebView()||a.isIOS();if(window.navigator.userAgent&&!l){var n=Array.from(t.CSS_DECLARATIONS).reverse(),u=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof u=="function")o=n.some(function(d){return u.apply(null,d)});else{var c=i.tester.append("image").attr("style",t.STYLE),f=window.getComputedStyle(c.node()),h=f.imageRendering;o=n.some(function(d){var p=d[1];return h===p||h===p.toLowerCase()}),c.remove()}}return o}r.exports=s}}),o3=de({"src/traces/heatmap/plot.js"(e,r){"use strict";var t=Yr(),i=Sa(),a=hn(),o=nn(),s=Qt(),l=Zo(),n=Bw(),u=ta(),c=Cs().extractOpts,f=Cs().makeColorScaleFuncFromTrace,h=Nh(),d=Bl(),p=d.LINE_SPACING,g=Dk(),m=n3().STYLE,y="heatmap-label";function _(C){return C.selectAll("g."+y)}function v(C){_(C).remove()}r.exports=function(C,w,k,A){var b=w.xaxis,E=w.yaxis;s.makeTraceGroups(A,k,"hm").each(function(T){var F=t.select(this),D=T[0],R=D.trace,P=R.xgap||0,z=R.ygap||0,I=D.z,L=D.x,B=D.y,O=D.xCenter,G=D.yCenter,W=i.traceIs(R,"contour"),X=W?"best":R.zsmooth,Z=I.length,J=s.maxRowLength(I),N=!1,H=!1,$,U,V,j,q,Y,K,te;for(Y=0;$===void 0&&Y0;)U=b.c2p(L[Y]),Y--;for(U<$&&(V=U,U=$,$=V,N=!0),Y=0;j===void 0&&Y0;)q=E.c2p(B[Y]),Y--;q=b._length||U<=0||j>=E._length||q<=0;if(pe){var xe=F.selectAll("image").data([]);xe.exit().remove(),v(F);return}var ye,fe;ne==="fast"?(ye=J,fe=Z):(ye=le,fe=ce);var ae=document.createElement("canvas");ae.width=ye,ae.height=fe;var ee=ae.getContext("2d",{willReadFrequently:!0}),ie=f(R,{noNumericCheck:!0,returnArray:!0}),Q,ue;ne==="fast"?(Q=N?function(Kt){return J-1-Kt}:s.identity,ue=H?function(Kt){return Z-1-Kt}:s.identity):(Q=function(Kt){return s.constrain(Math.round(b.c2p(L[Kt])-$),0,le)},ue=function(Kt){return s.constrain(Math.round(E.c2p(B[Kt])-j),0,ce)});var ge=ue(0),Me=[ge,ge],Te=N?0:1,je=H?0:1,Ve=0,Ke=0,Je=0,vt=0,xt,Pt,mt,Mt,lt;function qe(Kt,qt=0){if(Kt===void 0)return[0,0,0,0];var vr=ie(Kt);return vr[0]=Math.round(vr[0]),vr[1]=Math.round(vr[1]),vr[2]=Math.round(vr[2]),Ve+=qt,Ke+=vr[0]*qt,Je+=vr[1]*qt,vt+=vr[2]*qt,vr}function Ye(Kt,qt,vr,Br){var Pr=Kt[vr.bin0];if(Pr===void 0)return qe(void 0,1);var Mi=Kt[vr.bin1],gi=qt[vr.bin0],ba=qt[vr.bin1],Hi=Mi-Pr||0,Za=gi-Pr||0,oa;return Mi===void 0?ba===void 0?oa=0:gi===void 0?oa=2*(ba-Pr):oa=(2*ba-gi-Pr)*2/3:ba===void 0?gi===void 0?oa=0:oa=(2*Pr-Mi-gi)*2/3:gi===void 0?oa=(2*ba-Mi-Pr)*2/3:oa=ba+Pr-Mi-gi,qe(Pr+vr.frac*Hi+Br.frac*(Za+vr.frac*oa))}if(ne!=="default"){var me=0,_e;try{_e=new Uint8Array(ye*fe*4)}catch{_e=new Array(ye*fe*4)}if(ne==="smooth"){var Ae=O||L,ke=G||B,Ee=new Array(Ae.length),De=new Array(ke.length),Qe=new Array(le),Ue=O?S:x,at=G?S:x,rt,ht,At;for(Y=0;Yea||ea>E._length))for(K=Ur;Kja||ja>b._length)){var ya=n({x:$i,y:Qr},R,C._fullLayout);ya.x=$i,ya.y=Qr;var pa=D.z[Y][K];pa===void 0?(ya.z="",ya.zLabel=""):(ya.z=pa,ya.zLabel=o.tickText($t,pa,"hover").text);var xi=D.text&&D.text[Y]&&D.text[Y][K];(xi===void 0||xi===!1)&&(xi=""),ya.text=xi;var bi=s.texttemplateString({data:[ya,R._meta],fallback:R.texttemplatefallback,labels:ya,locale:C._fullLayout._d3locale,template:Lt});if(bi){var Ua=bi.split("
"),dn=Ua.length,pi=0;for(te=0;te=x[0].length||F<0||F>x.length)return}else{if(t.inbox(u-_[0],u-_[_.length-1],0)>0||t.inbox(c-v[0],c-v[v.length-1],0)>0)return;if(d){var D;for(k=[2*_[0]-_[1]],D=1;D<_.length;D++)k.push((_[D]+_[D-1])/2);for(k.push([2*_[_.length-1]-_[_.length-2]]),A=[2*v[0]-v[1]],D=1;D=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),Vy=de({"src/traces/contour/attributes.js"(e,r){"use strict";var t=b1(),i=tl(),a=Ns(),o=a.axisHoverFormat,s=a.descriptionOnlyNumbers,l=cs(),n=fu().dash,u=us(),c=fn().extendFlat,f=h3(),h=f.COMPARISON_OPS2,d=f.INTERVAL_OPS,p=i.line;r.exports=c({z:t.z,x:t.x,x0:t.x0,dx:t.dx,y:t.y,y0:t.y0,dy:t.dy,xperiod:t.xperiod,yperiod:t.yperiod,xperiod0:i.xperiod0,yperiod0:i.yperiod0,xperiodalignment:t.xperiodalignment,yperiodalignment:t.yperiodalignment,text:t.text,hovertext:t.hovertext,transpose:t.transpose,xtype:t.xtype,ytype:t.ytype,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:t.hovertemplate,hovertemplatefallback:t.hovertemplatefallback,texttemplate:c({},t.texttemplate,{}),texttemplatefallback:t.texttemplatefallback,textfont:c({},t.textfont,{}),hoverongaps:t.hoverongaps,connectgaps:c({},t.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:u({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:s("contour label")},operation:{valType:"enumerated",values:[].concat(h).concat(d),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:c({},p.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:n,smoothing:c({},p.smoothing,{}),editType:"plot"},zorder:i.zorder},l("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),Ik=de({"src/traces/histogram2dcontour/attributes.js"(e,r){"use strict";var t=f3(),i=Vy(),a=cs(),o=Ns().axisHoverFormat,s=fn().extendFlat;r.exports=s({x:t.x,y:t.y,z:t.z,marker:t.marker,histnorm:t.histnorm,histfunc:t.histfunc,nbinsx:t.nbinsx,xbins:t.xbins,nbinsy:t.nbinsy,ybins:t.ybins,autobinx:t.autobinx,autobiny:t.autobiny,bingroup:t.bingroup,xbingroup:t.xbingroup,ybingroup:t.ybingroup,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:{color:i.line.color,width:s({},i.line.width,{dflt:.5}),dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:t.hovertemplate,hovertemplatefallback:t.hovertemplatefallback,texttemplate:i.texttemplate,texttemplatefallback:i.texttemplatefallback,textfont:i.textfont},a("",{cLetter:"z",editTypeOverride:"calc"}))}}),d3=de({"src/traces/contour/contours_defaults.js"(e,r){"use strict";r.exports=function(i,a,o,s){var l=s("contours.start"),n=s("contours.end"),u=l===!1||n===!1,c=o("contours.size"),f;u?f=a.autocontour=!0:f=o("autocontour",!1),(f||!c)&&o("ncontours")}}}),Rk=de({"src/traces/contour/label_defaults.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o,s,l){l||(l={});var n=a("contours.showlabels");if(n){var u=o.font;t.coerceFont(a,"contours.labelfont",u,{overrideDflt:{color:s}}),a("contours.labelformat")}l.hasHover!==!1&&a("zhoverformat")}}}),p3=de({"src/traces/contour/style_defaults.js"(e,r){"use strict";var t=hu(),i=Rk();r.exports=function(o,s,l,n,u){var c=l("contours.coloring"),f,h="";c==="fill"&&(f=l("contours.showlines")),f!==!1&&(c!=="lines"&&(h=l("line.color","#000")),l("line.width",.5),l("line.dash")),c!=="none"&&(o.showlegend!==!0&&(s.showlegend=!1),s._dfltShowLegend=!1,t(o,s,n,l,{prefix:"",cLetter:"z"})),l("line.smoothing"),i(l,n,h,u)}}}),wG=de({"src/traces/histogram2dcontour/defaults.js"(e,r){"use strict";var t=Qt(),i=Pk(),a=d3(),o=p3(),s=qy(),l=Ik();r.exports=function(u,c,f,h){function d(g,m){return t.coerce(u,c,l,g,m)}function p(g){return t.coerce2(u,c,l,g)}i(u,c,d,h),c.visible!==!1&&(a(u,c,d,p),o(u,c,d,h),d("xhoverformat"),d("yhoverformat"),d("hovertemplate"),d("hovertemplatefallback"),c.contours&&c.contours.coloring==="heatmap"&&s(d,h))}}}),zk=de({"src/traces/contour/set_contours.js"(e,r){"use strict";var t=nn(),i=Qt();r.exports=function(s,l){var n=s.contours;if(s.autocontour){var u=s.zmin,c=s.zmax;(s.zauto||u===void 0)&&(u=i.aggNums(Math.min,null,l)),(s.zauto||c===void 0)&&(c=i.aggNums(Math.max,null,l));var f=a(u,c,s.ncontours);n.size=f.dtick,n.start=t.tickFirst(f),f.range.reverse(),n.end=t.tickFirst(f),n.start===u&&(n.start+=n.size),n.end===c&&(n.end-=n.size),n.start>n.end&&(n.start=n.end=(n.start+n.end)/2),s._input.contours||(s._input.contours={}),i.extendFlat(s._input.contours,{start:n.start,end:n.end,size:n.size}),s._input.autocontour=!0}else if(n.type!=="constraint"){var h=n.start,d=n.end,p=s._input.contours;if(h>d&&(n.start=p.start=d,d=n.end=p.end=h,h=n.start),!(n.size>0)){var g;h===d?g=1:g=a(h,d,s.ncontours).dtick,p.size=n.size=g}}};function a(o,s,l){var n={type:"linear",range:[o,s]};return t.autoTicks(n,(s-o)/(l||15)),n}}}),Gy=de({"src/traces/contour/end_plus.js"(e,r){"use strict";r.exports=function(i){return i.end+i.size/1e6}}}),Bk=de({"src/traces/contour/calc.js"(e,r){"use strict";var t=Cs(),i=a3(),a=zk(),o=Gy();r.exports=function(l,n){var u=i(l,n),c=u[0].z;a(n,c);var f=n.contours,h=t.extractOpts(n),d;if(f.coloring==="heatmap"&&h.auto&&n.autocontour===!1){var p=f.start,g=o(f),m=f.size||1,y=Math.floor((g-p)/m)+1;isFinite(m)||(m=1,y=1);var _=p-m/2,v=_+y*m;d=[_,v]}else d=c;return t.calc(l,n,{vals:d,cLetter:"z"}),u}}}),Hy=de({"src/traces/contour/constants.js"(e,r){"use strict";r.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),Ok=de({"src/traces/contour/make_crossings.js"(e,r){"use strict";var t=Hy();r.exports=function(o){var s=o[0].z,l=s.length,n=s[0].length,u=l===2||n===2,c,f,h,d,p,g,m,y,_;for(f=0;fa?0:1)+(o[0][1]>a?0:2)+(o[1][1]>a?0:4)+(o[1][0]>a?0:8);if(s===5||s===10){var l=(o[0][0]+o[0][1]+o[1][0]+o[1][1])/4;return a>l?s===5?713:1114:s===5?104:208}return s===15?0:s}}}),Nk=de({"src/traces/contour/find_all_paths.js"(e,r){"use strict";var t=Qt(),i=Hy();r.exports=function(c,f,h){var d,p,g,m,y;for(f=f||.01,h=h||.01,g=0;g20?(g=i.CHOOSESADDLE[g][(m[0]||m[1])<0?0:1],u.crossings[p]=i.SADDLEREMAINDER[g]):delete u.crossings[p],m=i.NEWDELTA[g],!m){t.log("Found bad marching index:",g,c,u.level);break}y.push(n(u,c,m)),c[0]+=m[0],c[1]+=m[1],p=c.join(","),a(y[y.length-1],y[y.length-2],h,d)&&y.pop();var C=m[0]&&(c[0]<0||c[0]>v-2)||m[1]&&(c[1]<0||c[1]>_-2),w=c[0]===x[0]&&c[1]===x[1]&&m[0]===S[0]&&m[1]===S[1];if(w||f&&C)break;g=u.crossings[p]}M===1e4&&t.log("Infinite loop in contour?");var k=a(y[0],y[y.length-1],h,d),A=0,b=.2*u.smoothing,E=[],T=0,F,D,R,P,z,I,L,B,O,G,W;for(M=1;M=T;M--)if(F=E[M],F=T&&F+E[D]B&&O--,u.edgepaths[O]=W.concat(y,G));break}N||(u.edgepaths[B]=y.concat(G))}for(B=0;B20&&c?u===208||u===1114?h=f[0]===0?1:-1:d=f[1]===0?1:-1:i.BOTTOMSTART.indexOf(u)!==-1?d=1:i.LEFTSTART.indexOf(u)!==-1?h=1:i.TOPSTART.indexOf(u)!==-1?d=-1:h=-1,[h,d]}function n(u,c,f){var h=c[0]+Math.max(f[0],0),d=c[1]+Math.max(f[1],0),p=u.z[d][h],g=u.xaxis,m=u.yaxis;if(f[1]){var y=(u.level-p)/(u.z[d][h+1]-p),_=(y!==1?(1-y)*g.c2l(u.x[h]):0)+(y!==0?y*g.c2l(u.x[h+1]):0);return[g.c2p(g.l2c(_),!0),m.c2p(u.y[d],!0),h+y,d]}else{var v=(u.level-p)/(u.z[d+1][h]-p),x=(v!==1?(1-v)*m.c2l(u.y[d]):0)+(v!==0?v*m.c2l(u.y[d+1]):0);return[g.c2p(u.x[h],!0),m.c2p(m.l2c(x),!0),h,d+v]}}}}),TG=de({"src/traces/contour/constraint_mapping.js"(e,r){"use strict";var t=h3(),i=da();r.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")};function a(l,n){var u=Array.isArray(n),c;function f(h){return i(h)?+h:null}return t.COMPARISON_OPS2.indexOf(l)!==-1?c=f(u?n[0]:n):t.INTERVAL_OPS.indexOf(l)!==-1?c=u?[f(n[0]),f(n[1])]:[f(n),f(n)]:t.SET_OPS.indexOf(l)!==-1&&(c=u?n.map(f):[f(n)]),c}function o(l){return function(n){n=a(l,n);var u=Math.min(n[0],n[1]),c=Math.max(n[0],n[1]);return{start:u,end:c,size:c-u}}}function s(l){return function(n){return n=a(l,n),{start:n,end:1/0,size:1/0}}}}}),jk=de({"src/traces/contour/empty_pathinfo.js"(e,r){"use strict";var t=Qt(),i=TG(),a=Gy();r.exports=function(s,l,n){for(var u=s.type==="constraint"?i[s._operation](s.value):s,c=u.size,f=[],h=a(u),d=n.trace._carpetTrace,p=d?{xaxis:d.aaxis,yaxis:d.baxis,x:n.a,y:n.b}:{xaxis:l.xaxis,yaxis:l.yaxis,x:n.x,y:n.y},g=u.start;g1e3){t.warn("Too many contours, clipping at 1000",s);break}return f}}}),Uk=de({"src/traces/contour/convert_to_constraints.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){var s,l,n,u=function(h){return h.reverse()},c=function(h){return h};switch(o){case"=":case"<":return a;case">":for(a.length!==1&&t.warn("Contour data invalid for the specified inequality operation."),l=a[0],s=0;sn.level||n.starts.length&&l===n.level)}break;case"constraint":if(a.prefixBoundary=!1,a.edgepaths.length)return;var u=a.x.length,c=a.y.length,f=-1/0,h=1/0;for(s=0;s":d>f&&(a.prefixBoundary=!0);break;case"<":(df||a.starts.length&&g===h)&&(a.prefixBoundary=!0);break;case"][":p=Math.min(d[0],d[1]),g=Math.max(d[0],d[1]),pf&&(a.prefixBoundary=!0);break}break}}}}),v3=de({"src/traces/contour/plot.js"(e){"use strict";var r=Yr(),t=Qt(),i=hn(),a=Cs(),o=Zo(),s=nn(),l=Xd(),n=o3(),u=Ok(),c=Nk(),f=jk(),h=Uk(),d=qk(),p=Hy(),g=p.LABELOPTIMIZER;e.plot=function(w,k,A,b){var E=k.xaxis,T=k.yaxis;t.makeTraceGroups(b,A,"contour").each(function(F){var D=r.select(this),R=F[0],P=R.trace,z=R.x,I=R.y,L=P.contours,B=f(L,k,R),O=t.ensureSingle(D,"g","heatmapcoloring"),G=[];L.coloring==="heatmap"&&(G=[F]),n(w,k,G,O),u(B),c(B);var W=E.c2p(z[0],!0),X=E.c2p(z[z.length-1],!0),Z=T.c2p(I[0],!0),J=T.c2p(I[I.length-1],!0),N=[[W,J],[X,J],[X,Z],[W,Z]],H=B;L.type==="constraint"&&(H=h(B,L._operation)),m(D,N,L),y(D,H,N,L),v(D,B,w,R,L),S(D,k,w,R,N)})};function m(C,w,k){var A=t.ensureSingle(C,"g","contourbg"),b=A.selectAll("path").data(k.coloring==="fill"?[0]:[]);b.enter().append("path"),b.exit().remove(),b.attr("d","M"+w.join("L")+"Z").style("stroke","none")}function y(C,w,k,A){var b=A.coloring==="fill"||A.type==="constraint"&&A._operation!=="=",E="M"+k.join("L")+"Z";b&&d(w,A);var T=t.ensureSingle(C,"g","contourfill"),F=T.selectAll("path").data(b?w:[]);F.enter().append("path"),F.exit().remove(),F.each(function(D){var R=(D.prefixBoundary?E:"")+_(D,k);R?r.select(this).attr("d",R).style("stroke","none"):r.select(this).remove()})}function _(C,w){var k="",A=0,b=C.edgepaths.map(function(W,X){return X}),E=!0,T,F,D,R,P,z;function I(W){return Math.abs(W[1]-w[0][1])<.01}function L(W){return Math.abs(W[1]-w[2][1])<.01}function B(W){return Math.abs(W[0]-w[0][0])<.01}function O(W){return Math.abs(W[0]-w[2][0])<.01}for(;b.length;){for(z=i.smoothopen(C.edgepaths[A],C.smoothing),k+=E?z:z.replace(/^M/,"L"),b.splice(b.indexOf(A),1),T=C.edgepaths[A][C.edgepaths[A].length-1],R=-1,D=0;D<4;D++){if(!T){t.log("Missing end?",A,C);break}for(I(T)&&!O(T)?F=w[1]:B(T)?F=w[0]:L(T)?F=w[3]:O(T)&&(F=w[2]),P=0;P=0&&(F=G,R=P):Math.abs(T[1]-F[1])<.01?Math.abs(T[1]-G[1])<.01&&(G[0]-T[0])*(F[0]-G[0])>=0&&(F=G,R=P):t.log("endpt to newendpt is not vert. or horz.",T,F,G)}if(T=F,R>=0)break;k+="L"+F}if(R===C.edgepaths.length){t.log("unclosed perimeter path");break}A=R,E=b.indexOf(A)===-1,E&&(A=b[0],k+="Z")}for(A=0;Ag.MAXCOST*2)break;I&&(F/=2),T=R-F/2,D=T+F*1.5}if(z<=g.MAXCOST)return P};function x(C,w,k,A){var b=w.width/2,E=w.height/2,T=C.x,F=C.y,D=C.theta,R=Math.cos(D)*b,P=Math.sin(D)*b,z=(T>A.center?A.right-T:T-A.left)/(R+Math.abs(Math.sin(D)*E)),I=(F>A.middle?A.bottom-F:F-A.top)/(Math.abs(P)+Math.cos(D)*E);if(z<1||I<1)return 1/0;var L=g.EDGECOST*(1/(z-1)+1/(I-1));L+=g.ANGLECOST*D*D;for(var B=T-R,O=F-P,G=T+R,W=F+P,X=0;X=S)&&(n<=x&&(n=x),u>=S&&(u=S),f=Math.floor((u-n)/c)+1,h=0),v=0;vx&&(m.unshift(x),y.unshift(y[0])),m[m.length-1]2?d.value=d.value.slice(2):d.length===0?d.value=[0,1]:d.length<2?(p=parseFloat(d.value[0]),d.value=[p,p+1]):d.value=[parseFloat(d.value[0]),parseFloat(d.value[1])]:t(d.value)&&(p=parseFloat(d.value),d.value=[p,p+1])):(h("contours.value",0),t(d.value)||(n(d.value)?d.value=parseFloat(d.value[0]):d.value=0))}}}),SG=de({"src/traces/contour/defaults.js"(e,r){"use strict";var t=Qt(),i=Qw(),a=yd(),o=Hk(),s=d3(),l=p3(),n=qy(),u=Vy();r.exports=function(f,h,d,p){function g(v,x){return t.coerce(f,h,u,v,x)}function m(v){return t.coerce2(f,h,u,v)}var y=i(f,h,g,p);if(!y){h.visible=!1;return}a(f,h,p,g),g("xhoverformat"),g("yhoverformat"),g("text"),g("hovertext"),g("hoverongaps"),g("hovertemplate"),g("hovertemplatefallback");var _=g("contours.type")==="constraint";g("connectgaps",t.isArray1D(h.z)),_?o(f,h,g,p,d):(s(f,h,g,m),l(f,h,g,p)),h.contours&&h.contours.coloring==="heatmap"&&n(g,p),g("zorder")}}}),EG=de({"src/traces/contour/index.js"(e,r){"use strict";r.exports={attributes:Vy(),supplyDefaults:SG(),calc:Bk(),plot:v3().plot,style:m3(),colorbar:g3(),hoverPoints:Gk(),moduleType:"trace",name:"contour",basePlotModule:ml(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),kG=de({"lib/contour.js"(e,r){"use strict";r.exports=EG()}}),$k=de({"src/traces/scatterternary/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,texttemplateAttrs:i,templatefallbackAttrs:a}=Vo(),o=Jd(),s=tl(),l=ri(),n=cs(),u=fu().dash,c=fn().extendFlat,f=s.marker,h=s.line,d=f.line;r.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},s.mode,{dflt:"markers"}),text:c({},s.text,{}),texttemplate:i({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:a({editType:"plot"}),hovertext:c({},s.hovertext,{}),line:{color:h.color,width:h.width,dash:u,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:s.connectgaps,cliponaxis:s.cliponaxis,fill:c({},s.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o(),marker:c({symbol:f.symbol,opacity:f.opacity,angle:f.angle,angleref:f.angleref,standoff:f.standoff,maxdisplayed:f.maxdisplayed,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,line:c({width:d.width,dash:d.dash,editType:"calc"},n("marker.line")),gradient:f.gradient,editType:"calc"},n("marker")),textfont:s.textfont,textposition:s.textposition,selected:s.selected,unselected:s.unselected,hoverinfo:c({},l.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:s.hoveron,hovertemplate:t(),hovertemplatefallback:a()}}}),CG=de({"src/traces/scatterternary/defaults.js"(e,r){"use strict";var t=Qt(),i=Kd(),a=bs(),o=jh(),s=_d(),l=v1(),n=xd(),u=Qd(),c=$k();r.exports=function(h,d,p,g){function m(C,w){return t.coerce(h,d,c,C,w)}var y=m("a"),_=m("b"),v=m("c"),x;if(y?(x=y.length,_?(x=Math.min(x,_.length),v&&(x=Math.min(x,v.length))):v?x=Math.min(x,v.length):x=0):_&&v&&(x=Math.min(_.length,v.length)),!x){d.visible=!1;return}d._length=x,m("sum"),m("text"),m("hovertext"),d.hoveron!=="fills"&&(m("hovertemplate"),m("hovertemplatefallback"));var S=x"),u.hovertemplate=g.hovertemplate,n}}}),IG=de({"src/traces/scatterternary/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){if(a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),s[l]){var n=s[l];i.a=n.a,i.b=n.b,i.c=n.c}else i.a=a.a,i.b=a.b,i.c=a.c;return i}}}),RG=de({"src/plots/ternary/ternary.js"(e,r){"use strict";var t=Yr(),i=Sa(),a=Qt(),o=a.strTranslate,s=a._,l=ta(),n=hn(),u=Xd(),c=fn().extendFlat,f=ks(),h=nn(),d=Uc(),p=$s(),g=Zd(),m=g.freeMode,y=g.rectMode,_=bv(),v=Zl().prepSelect,x=Zl().selectOnClick,S=Zl().clearOutline,M=Zl().clearSelectionsCache,C=zl();function w(I,L){this.id=I.id,this.graphDiv=I.graphDiv,this.init(L),this.makeFramework(L),this.updateFx(L),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}r.exports=w;var k=w.prototype;k.init=function(I){this.container=I._ternarylayer,this.defs=I._defs,this.layoutId=I._uid,this.traceHash={},this.layers={}},k.plot=function(I,L){var B=this,O=L[B.id],G=L._size;B._hasClipOnAxisFalse=!1;for(var W=0;WA*N?(K=N,Y=K*A):(Y=J,K=Y/A),te=X*Y/J,ne=Z*K/N,j=L.l+L.w*G-Y/2,q=L.t+L.h*(1-W)-K/2,B.x0=j,B.y0=q,B.w=Y,B.h=K,B.sum=H,B.xaxis={type:"linear",range:[$+2*V-H,H-$-2*U],domain:[G-te/2,G+te/2],_id:"x"},u(B.xaxis,B.graphDiv._fullLayout),B.xaxis.setScale(),B.xaxis.isPtWithinRange=function(Q){return Q.a>=B.aaxis.range[0]&&Q.a<=B.aaxis.range[1]&&Q.b>=B.baxis.range[1]&&Q.b<=B.baxis.range[0]&&Q.c>=B.caxis.range[1]&&Q.c<=B.caxis.range[0]},B.yaxis={type:"linear",range:[$,H-U-V],domain:[W-ne/2,W+ne/2],_id:"y"},u(B.yaxis,B.graphDiv._fullLayout),B.yaxis.setScale(),B.yaxis.isPtWithinRange=function(){return!0};var se=B.yaxis.domain[0],le=B.aaxis=c({},I.aaxis,{range:[$,H-U-V],side:"left",tickangle:(+I.aaxis.tickangle||0)-30,domain:[se,se+ne*A],anchor:"free",position:0,_id:"y",_length:Y});u(le,B.graphDiv._fullLayout),le.setScale();var ce=B.baxis=c({},I.baxis,{range:[H-$-V,U],side:"bottom",domain:B.xaxis.domain,anchor:"free",position:0,_id:"x",_length:Y});u(ce,B.graphDiv._fullLayout),ce.setScale();var pe=B.caxis=c({},I.caxis,{range:[H-$-U,V],side:"right",tickangle:(+I.caxis.tickangle||0)+30,domain:[se,se+ne*A],anchor:"free",position:0,_id:"y",_length:Y});u(pe,B.graphDiv._fullLayout),pe.setScale();var xe="M"+j+","+(q+K)+"h"+Y+"l-"+Y/2+",-"+K+"Z";B.clipDef.select("path").attr("d",xe),B.layers.plotbg.select("path").attr("d",xe);var ye="M0,"+K+"h"+Y+"l-"+Y/2+",-"+K+"Z";B.clipDefRelative.select("path").attr("d",ye);var fe=o(j,q);B.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",fe),B.clipDefRelative.select("path").attr("transform",null);var ae=o(j-ce._offset,q+K);B.layers.baxis.attr("transform",ae),B.layers.bgrid.attr("transform",ae);var ee=o(j+Y/2,q)+"rotate(30)"+o(0,-le._offset);B.layers.aaxis.attr("transform",ee),B.layers.agrid.attr("transform",ee);var ie=o(j+Y/2,q)+"rotate(-30)"+o(0,-pe._offset);B.layers.caxis.attr("transform",ie),B.layers.cgrid.attr("transform",ie),B.drawAxes(!0),B.layers.aline.select("path").attr("d",le.showline?"M"+j+","+(q+K)+"l"+Y/2+",-"+K:"M0,0").call(l.stroke,le.linecolor||"#000").style("stroke-width",(le.linewidth||0)+"px"),B.layers.bline.select("path").attr("d",ce.showline?"M"+j+","+(q+K)+"h"+Y:"M0,0").call(l.stroke,ce.linecolor||"#000").style("stroke-width",(ce.linewidth||0)+"px"),B.layers.cline.select("path").attr("d",pe.showline?"M"+(j+Y/2)+","+q+"l"+Y/2+","+K:"M0,0").call(l.stroke,pe.linecolor||"#000").style("stroke-width",(pe.linewidth||0)+"px"),B.graphDiv._context.staticPlot||B.initInteractions(),n.setClipUrl(B.layers.frontplot,B._hasClipOnAxisFalse?null:B.clipId,B.graphDiv)},k.drawAxes=function(I){var L=this,B=L.graphDiv,O=L.id.slice(7)+"title",G=L.layers,W=L.aaxis,X=L.baxis,Z=L.caxis;if(L.drawAx(W),L.drawAx(X),L.drawAx(Z),I){var J=Math.max(W.showticklabels?W.tickfont.size/2:0,(Z.showticklabels?Z.tickfont.size*.75:0)+(Z.ticks==="outside"?Z.ticklen*.87:0)),N=(X.showticklabels?X.tickfont.size:0)+(X.ticks==="outside"?X.ticklen:0)+3;G["a-title"]=_.draw(B,"a"+O,{propContainer:W,propName:L.id+".aaxis.title.text",placeholder:s(B,"Click to enter Component A title"),attributes:{x:L.x0+L.w/2,y:L.y0-W.title.font.size/3-J,"text-anchor":"middle"}}),G["b-title"]=_.draw(B,"b"+O,{propContainer:X,propName:L.id+".baxis.title.text",placeholder:s(B,"Click to enter Component B title"),attributes:{x:L.x0-N,y:L.y0+L.h+X.title.font.size*.83+N,"text-anchor":"middle"}}),G["c-title"]=_.draw(B,"c"+O,{propContainer:Z,propName:L.id+".caxis.title.text",placeholder:s(B,"Click to enter Component C title"),attributes:{x:L.x0+L.w+N,y:L.y0+L.h+Z.title.font.size*.83+N,"text-anchor":"middle"}})}},k.drawAx=function(I){var L=this,B=L.graphDiv,O=I._name,G=O.charAt(0),W=I._id,X=L.layers[O],Z=30,J=G+"tickLayout",N=b(I);L[J]!==N&&(X.selectAll("."+W+"tick").remove(),L[J]=N),I.setScale();var H=h.calcTicks(I),$=h.clipEnds(I,H),U=h.makeTransTickFn(I),V=h.getTickSigns(I)[2],j=a.deg2rad(Z),q=V*(I.linewidth||1)/2,Y=V*I.ticklen,K=L.w,te=L.h,ne=G==="b"?"M0,"+q+"l"+Math.sin(j)*Y+","+Math.cos(j)*Y:"M"+q+",0l"+Math.cos(j)*Y+","+-Math.sin(j)*Y,se={a:"M0,0l"+te+",-"+K/2,b:"M0,0l-"+K/2+",-"+te,c:"M0,0l-"+te+","+K/2}[G];h.drawTicks(B,I,{vals:I.ticks==="inside"?$:H,layer:X,path:ne,transFn:U,crisp:!1}),h.drawGrid(B,I,{vals:$,layer:L.layers[G+"grid"],path:se,transFn:U,crisp:!1}),h.drawLabels(B,I,{vals:H,layer:X,transFn:U,labelFns:h.makeLabelFns(I,0,Z)})};function b(I){return I.ticks+String(I.ticklen)+String(I.showticklabels)}var E=C.MINZOOM/2+.87,T="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(E*.87+4.5)+"l2.6,1.5l-"+E/2+","+E*.87+"Z",F="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(E*.87+4.5)+"l-2.6,1.5l"+E/2+","+E*.87+"Z",D="m0,1l"+E/2+","+E*.87+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(E*.87+4.5)+"l-"+(E/2+2.6)+","+(E*.87+4.5)+"l2.6,1.5l"+E/2+",-"+E*.87+"Z",R="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",P=!0;k.clearOutline=function(){M(this.dragOptions),S(this.dragOptions.gd)},k.initInteractions=function(){var I=this,L=I.layers.plotbg.select("path").node(),B=I.graphDiv,O=B._fullLayout._zoomlayer,G,W;this.dragOptions={element:L,gd:B,plotinfo:{id:I.id,domain:B._fullLayout[I.id].domain,xaxis:I.xaxis,yaxis:I.yaxis},subplot:I.id,prepFn:function(ae,ee,ie){I.dragOptions.xaxes=[I.xaxis],I.dragOptions.yaxes=[I.yaxis],G=B._fullLayout._invScaleX,W=B._fullLayout._invScaleY;var Q=I.dragOptions.dragmode=B._fullLayout.dragmode;m(Q)?I.dragOptions.minDrag=1:I.dragOptions.minDrag=void 0,Q==="zoom"?(I.dragOptions.moveFn=ce,I.dragOptions.clickFn=K,I.dragOptions.doneFn=pe,te(ae,ee,ie)):Q==="pan"?(I.dragOptions.moveFn=ye,I.dragOptions.clickFn=K,I.dragOptions.doneFn=fe,xe(),I.clearOutline(B)):(y(Q)||m(Q))&&v(ae,ee,ie,I.dragOptions,Q)}};var X,Z,J,N,H,$,U,V,j,q;function Y(ae){var ee={};return ee[I.id+".aaxis.min"]=ae.a,ee[I.id+".baxis.min"]=ae.b,ee[I.id+".caxis.min"]=ae.c,ee}function K(ae,ee){var ie=B._fullLayout.clickmode;z(B),ae===2&&(B.emit("plotly_doubleclick",null),i.call("_guiRelayout",B,Y({a:0,b:0,c:0}))),ie.indexOf("select")>-1&&ae===1&&x(ee,B,[I.xaxis],[I.yaxis],I.id,I.dragOptions),ie.indexOf("event")>-1&&p.click(B,ee,I.id)}function te(ae,ee,ie){var Q=L.getBoundingClientRect();X=ee-Q.left,Z=ie-Q.top,B._fullLayout._calcInverseTransform(B);var ue=B._fullLayout._invTransform,ge=a.apply3DTransform(ue)(X,Z);X=ge[0],Z=ge[1],J={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},H=J,N=I.aaxis.range[1]-J.a,$=l.luminosity(I.graphDiv._fullLayout[I.id].bgcolor),U="M0,"+I.h+"L"+I.w/2+", 0L"+I.w+","+I.h+"Z",V=!1,j=O.append("path").attr("class","zoombox").attr("transform",o(I.x0,I.y0)).style({fill:$>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",U),q=O.append("path").attr("class","zoombox-corners").attr("transform",o(I.x0,I.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),I.clearOutline(B)}function ne(ae,ee){return 1-ee/I.h}function se(ae,ee){return 1-(ae+(I.h-ee)/Math.sqrt(3))/I.w}function le(ae,ee){return(ae-(I.h-ee)/Math.sqrt(3))/I.w}function ce(ae,ee){var ie=X+ae*G,Q=Z+ee*W,ue=Math.max(0,Math.min(1,ne(X,Z),ne(ie,Q))),ge=Math.max(0,Math.min(1,se(X,Z),se(ie,Q))),Me=Math.max(0,Math.min(1,le(X,Z),le(ie,Q))),Te=(ue/2+Me)*I.w,je=(1-ue/2-ge)*I.w,Ve=(Te+je)/2,Ke=je-Te,Je=(1-ue)*I.h,vt=Je-Ke/A;Ke.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),q.transition().style("opacity",1).duration(200),V=!0),B.emit("plotly_relayouting",Y(H))}function pe(){z(B),H!==J&&(i.call("_guiRelayout",B,Y(H)),P&&B.data&&B._context.showTips&&(a.notifier(s(B,"Double-click to zoom back out"),"long",B),P=!1))}function xe(){J={a:I.aaxis.range[0],b:I.baxis.range[1],c:I.caxis.range[1]},H=J}function ye(ae,ee){var ie=ae/I.xaxis._m,Q=ee/I.yaxis._m;H={a:J.a-Q,b:J.b+(ie+Q)/2,c:J.c-(ie-Q)/2};var ue=[H.a,H.b,H.c].sort(a.sorterAsc),ge={a:ue.indexOf(H.a),b:ue.indexOf(H.b),c:ue.indexOf(H.c)};ue[0]<0&&(ue[1]+ue[0]/2<0?(ue[2]+=ue[0]+ue[1],ue[0]=ue[1]=0):(ue[2]+=ue[0]/2,ue[1]+=ue[0]/2,ue[0]=0),H={a:ue[ge.a],b:ue[ge.b],c:ue[ge.c]},ee=(J.a-H.a)*I.yaxis._m,ae=(J.c-H.c-J.b+H.b)*I.xaxis._m);var Me=o(I.x0+ae,I.y0+ee);I.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Me);var Te=o(-ae,-ee);I.clipDefRelative.select("path").attr("transform",Te),I.aaxis.range=[H.a,I.sum-H.b-H.c],I.baxis.range=[I.sum-H.a-H.c,H.b],I.caxis.range=[I.sum-H.a-H.b,H.c],I.drawAxes(!1),I._hasClipOnAxisFalse&&I.plotContainer.select(".scatterlayer").selectAll(".trace").call(n.hideOutsideRangePoints,I),B.emit("plotly_relayouting",Y(H))}function fe(){i.call("_guiRelayout",B,Y(H))}L.onmousemove=function(ae){p.hover(B,ae,I.id),B._fullLayout._lasthover=L,B._fullLayout._hoversubplot=I.id},L.onmouseout=function(ae){B._dragging||d.unhover(B,ae)},d.init(this.dragOptions)};function z(I){t.select(I).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),Wk=de({"src/plots/ternary/layout_attributes.js"(e,r){"use strict";var t=Jo(),i=Rs().attributes,a=Mu(),o=Is().overrideAll,s=fn().extendFlat,l={title:{text:a.title.text,font:a.title.font},color:a.color,tickmode:a.minor.tickmode,nticks:s({},a.nticks,{dflt:6,min:1}),tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:a.ticks,ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,ticklabelstep:a.ticklabelstep,showticklabels:a.showticklabels,labelalias:a.labelalias,showtickprefix:a.showtickprefix,tickprefix:a.tickprefix,showticksuffix:a.showticksuffix,ticksuffix:a.ticksuffix,showexponent:a.showexponent,exponentformat:a.exponentformat,minexponent:a.minexponent,separatethousands:a.separatethousands,tickfont:a.tickfont,tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,hoverformat:a.hoverformat,showline:s({},a.showline,{dflt:!0}),linecolor:a.linecolor,linewidth:a.linewidth,showgrid:s({},a.showgrid,{dflt:!0}),gridcolor:a.gridcolor,gridwidth:a.gridwidth,griddash:a.griddash,layer:a.layer,min:{valType:"number",dflt:0,min:0}},n=r.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:t.background},sum:{valType:"number",dflt:1,min:0},aaxis:l,baxis:l,caxis:l},"plot","from-root");n.uirevision={valType:"any",editType:"none"},n.aaxis.uirevision=n.baxis.uirevision=n.caxis.uirevision={valType:"any",editType:"none"}}}),kv=de({"src/plots/subplot_defaults.js"(e,r){"use strict";var t=Qt(),i=Ro(),a=Rs().defaults;r.exports=function(s,l,n,u){var c=u.type,f=u.attributes,h=u.handleDefaults,d=u.partition||"x",p=l._subplots[c],g=p.length,m=g&&p[0].replace(/\d+$/,""),y,_;function v(C,w){return t.coerce(y,_,f,C,w)}for(var x=0;x=x&&(k.min=0,A.min=0,b.min=0,g.aaxis&&delete g.aaxis.min,g.baxis&&delete g.baxis.min,g.caxis&&delete g.caxis.min)}function p(g,m,y,_){var v=f[m._name];function x(E,T){return a.coerce(g,m,v,E,T)}x("uirevision",_.uirevision),m.type="linear";var S=x("color"),M=S!==v.color.dflt?S:y.font.color,C=m._name,w=C.charAt(0).toUpperCase(),k="Component "+w,A=x("title.text",k);m._hovertitle=A===k?A:w,a.coerceFont(x,"title.font",y.font,{overrideDflt:{size:a.bigFont(y.font.size),color:M}}),x("min"),u(g,m,x,"linear"),l(g,m,x,"linear"),s(g,m,x,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),n(g,m,x,{outerTicks:!0});var b=x("showticklabels");b&&(a.coerceFont(x,"tickfont",y.font,{overrideDflt:{color:M}}),x("tickangle"),x("tickformat")),c(g,m,x,{dfltColor:S,bgColor:y.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:v}),x("hoverformat"),x("layer")}}}),BG=de({"src/plots/ternary/index.js"(e){"use strict";var r=RG(),t=$u().getSubplotCalcData,i=Qt().counterRegex,a="ternary";e.name=a;var o=e.attr="subplot";e.idRoot=a,e.idRegex=e.attrRegex=i(a);var s=e.attributes={};s[o]={valType:"subplotid",dflt:"ternary",editType:"calc"},e.layoutAttributes=Wk(),e.supplyLayoutDefaults=zG(),e.plot=function(n){for(var u=n._fullLayout,c=n.calcdata,f=u._subplots[a],h=0;h0){var C=n.xa,w=n.ya,k,A,b,E,T;g.orientation==="h"?(T=u,k="y",b=w,A="x",E=C):(T=c,k="x",b=C,A="y",E=w);var F=p[n.index];if(T>=F.span[0]&&T<=F.span[1]){var D=i.extendFlat({},n),R=E.c2p(T,!0),P=s.getKdeValue(F,g,T),z=s.getPositionOnKdePath(F,g,R),I=b._offset,L=b._length;D[k+"0"]=z[0],D[k+"1"]=z[1],D[A+"0"]=D[A+"1"]=R,D[A+"Label"]=A+": "+a.hoverLabelText(E,T,g[A+"hoverformat"])+", "+p[0].t.labels.kde+" "+P.toFixed(3);for(var B=0,O=0;O path").each(function(y){if(!y.isBlank){var _=m.marker;t.select(this).call(a.fill,y.mc||_.color).call(a.stroke,y.mlc||_.line.color).call(i.dashLine,_.line.dash,y.mlw||_.line.width).style("opacity",m.selectedpoints&&!y.selected?o:1)}}),n(g,m,c),g.selectAll(".regions").each(function(){t.select(this).selectAll("path").style("stroke-width",0).call(a.fill,m.connector.fillcolor)}),g.selectAll(".lines").each(function(){var y=m.connector.line;i.lineGroupStyle(t.select(this).selectAll("path"),y.width,y.color,y.dash)})})}r.exports={style:u}}}),rH=de({"src/traces/funnel/hover.js"(e,r){"use strict";var t=ta().opacity,i=_1().hoverOnBars,a=Qt().formatPercent;r.exports=function(l,n,u,c,f){var h=i(l,n,u,c,f);if(h){var d=h.cd,p=d[0].trace,g=p.orientation==="h",m=h.index,y=d[m],_=g?"x":"y";h[_+"LabelVal"]=y.s,h.percentInitial=y.begR,h.percentInitialLabel=a(y.begR,1),h.percentPrevious=y.difR,h.percentPreviousLabel=a(y.difR,1),h.percentTotal=y.sumR,h.percentTotalLabel=a(y.sumR,1);var v=y.hi||p.hoverinfo,x=[];if(v&&v!=="none"&&v!=="skip"){var S=v==="all",M=v.split("+"),C=function(w){return S||M.indexOf(w)!==-1};C("percent initial")&&x.push(h.percentInitialLabel+" of initial"),C("percent previous")&&x.push(h.percentPreviousLabel+" of previous"),C("percent total")&&x.push(h.percentTotalLabel+" of total")}return h.extraText=x.join("
"),h.color=o(p,y),[h]}};function o(s,l){var n=s.marker,u=l.mc||n.color,c=l.mlc||n.line.color,f=l.mlw||n.line.width;if(t(u))return u;if(t(c)&&f)return c}}}),iH=de({"src/traces/funnel/event_data.js"(e,r){"use strict";r.exports=function(i,a){return i.x="xVal"in a?a.xVal:a.x,i.y="yVal"in a?a.yVal:a.y,"percentInitial"in a&&(i.percentInitial=a.percentInitial),"percentPrevious"in a&&(i.percentPrevious=a.percentPrevious),"percentTotal"in a&&(i.percentTotal=a.percentTotal),a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),i}}}),aH=de({"src/traces/funnel/index.js"(e,r){"use strict";r.exports={attributes:Zk(),layoutAttributes:Kk(),supplyDefaults:Jk().supplyDefaults,crossTraceDefaults:Jk().crossTraceDefaults,supplyLayoutDefaults:ZG(),calc:JG(),crossTraceCalc:QG(),plot:eH(),style:tH().style,hoverPoints:rH(),eventData:iH(),selectPoints:x1(),moduleType:"trace",name:"funnel",basePlotModule:ml(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),nH=de({"lib/funnel.js"(e,r){"use strict";r.exports=aH()}}),oH=de({"src/traces/waterfall/constants.js"(e,r){"use strict";r.exports={eventDataKeys:["initial","delta","final"]}}}),Qk=de({"src/traces/waterfall/attributes.js"(e,r){"use strict";var t=tp(),i=tl().line,a=ri(),o=Ns().axisHoverFormat,{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:n}=Vo(),u=oH(),c=fn().extendFlat,f=ta();function h(d){return{marker:{color:c({},t.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},t.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},t.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}r.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:t.x,x0:t.x0,dx:t.dx,y:t.y,y0:t.y0,dy:t.dy,xperiod:t.xperiod,yperiod:t.yperiod,xperiod0:t.xperiod0,yperiod0:t.yperiod0,xperiodalignment:t.xperiodalignment,yperiodalignment:t.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),hovertext:t.hovertext,hovertemplate:s({},{keys:u.eventDataKeys}),hovertemplatefallback:n(),hoverinfo:c({},a.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:l({editType:"plot"},{keys:u.eventDataKeys.concat(["label"])}),texttemplatefallback:n({editType:"plot"}),text:t.text,textposition:t.textposition,insidetextanchor:t.insidetextanchor,textangle:t.textangle,textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:t.outsidetextfont,constraintext:t.constraintext,cliponaxis:t.cliponaxis,orientation:t.orientation,offset:t.offset,width:t.width,increasing:h("increasing"),decreasing:h("decreasing"),totals:h("intermediate sums and total"),connector:{line:{color:c({},i.color,{dflt:f.defaultLine}),width:c({},i.width,{editType:"plot"}),dash:i.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:t.offsetgroup,alignmentgroup:t.alignmentgroup,zorder:t.zorder}}}),eC=de({"src/traces/waterfall/layout_attributes.js"(e,r){"use strict";r.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),T1=de({"src/constants/delta.js"(e,r){"use strict";r.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25B2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25BC"}}}}),tC=de({"src/traces/waterfall/defaults.js"(e,r){"use strict";var t=Qt(),i=Av(),a=sh().handleText,o=Tv(),s=yd(),l=Qk(),n=ta(),u=T1(),c=u.INCREASING.COLOR,f=u.DECREASING.COLOR,h="#4499FF";function d(m,y,_){m(y+".marker.color",_),m(y+".marker.line.color",n.defaultLine),m(y+".marker.line.width")}function p(m,y,_,v){function x(k,A){return t.coerce(m,y,l,k,A)}var S=o(m,y,v,x);if(!S){y.visible=!1;return}s(m,y,v,x),x("xhoverformat"),x("yhoverformat"),x("measure"),x("orientation",y.x&&!y.y?"h":"v"),x("base"),x("offset"),x("width"),x("text"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var M=x("textposition");a(m,y,v,x,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),y.textposition!=="none"&&(x("texttemplate"),x("texttemplatefallback"),y.texttemplate||x("textinfo")),d(x,"increasing",c),d(x,"decreasing",f),d(x,"totals",h);var C=x("connector.visible");if(C){x("connector.mode");var w=x("connector.line.width");w&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function g(m,y){var _,v;function x(M){return t.coerce(v._input,v,l,M)}if(y.waterfallmode==="group")for(var S=0;S0&&(x?T+="M"+b[0]+","+E[1]+"V"+E[0]:T+="M"+b[1]+","+E[0]+"H"+b[0]),S!=="between"&&(w.isSum||k path").each(function(y){if(!y.isBlank){var _=m[y.dir].marker;t.select(this).call(a.fill,_.color).call(a.stroke,_.line.color).call(i.dashLine,_.line.dash,_.line.width).style("opacity",m.selectedpoints&&!y.selected?o:1)}}),n(g,m,c),g.selectAll(".lines").each(function(){var y=m.connector.line;i.lineGroupStyle(t.select(this).selectAll("path"),y.width,y.color,y.dash)})})}r.exports={style:u}}}),hH=de({"src/traces/waterfall/hover.js"(e,r){"use strict";var t=nn().hoverLabelText,i=ta().opacity,a=_1().hoverOnBars,o=T1(),s={increasing:o.INCREASING.SYMBOL,decreasing:o.DECREASING.SYMBOL};r.exports=function(u,c,f,h,d){var p=a(u,c,f,h,d);if(!p)return;var g=p.cd,m=g[0].trace,y=m.orientation==="h",_=y?"x":"y",v=y?u.xa:u.ya;function x(F){return t(v,F,m[_+"hoverformat"])}var S=p.index,M=g[S],C=M.isSum?M.b+M.s:M.rawS;p.initial=M.b+M.s-C,p.delta=C,p.final=p.initial+p.delta;var w=x(Math.abs(p.delta));p.deltaLabel=C<0?"("+w+")":w,p.finalLabel=x(p.final),p.initialLabel=x(p.initial);var k=M.hi||m.hoverinfo,A=[];if(k&&k!=="none"&&k!=="skip"){var b=k==="all",E=k.split("+"),T=function(F){return b||E.indexOf(F)!==-1};M.isSum||(T("final")&&(y?!T("x"):!T("y"))&&A.push(p.finalLabel),T("delta")&&(C<0?A.push(p.deltaLabel+" "+s.decreasing):A.push(p.deltaLabel+" "+s.increasing)),T("initial")&&A.push("Initial: "+p.initialLabel))}return A.length&&(p.extraText=A.join("
")),p.color=l(m,M),[p]};function l(n,u){var c=n[u.dir].marker,f=c.color,h=c.line.color,d=c.line.width;if(i(f))return f;if(i(h)&&d)return h}}}),dH=de({"src/traces/waterfall/event_data.js"(e,r){"use strict";r.exports=function(i,a){return i.x="xVal"in a?a.xVal:a.x,i.y="yVal"in a?a.yVal:a.y,"initial"in a&&(i.initial=a.initial),"delta"in a&&(i.delta=a.delta),"final"in a&&(i.final=a.final),a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),i}}}),pH=de({"src/traces/waterfall/index.js"(e,r){"use strict";r.exports={attributes:Qk(),layoutAttributes:eC(),supplyDefaults:tC().supplyDefaults,crossTraceDefaults:tC().crossTraceDefaults,supplyLayoutDefaults:sH(),calc:lH(),crossTraceCalc:uH(),plot:cH(),style:fH().style,hoverPoints:hH(),eventData:dH(),selectPoints:x1(),moduleType:"trace",name:"waterfall",basePlotModule:ml(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),vH=de({"lib/waterfall.js"(e,r){"use strict";r.exports=pH()}}),A1=de({"src/traces/image/constants.js"(e,r){"use strict";r.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var i=t.slice(0,3);return i[1]=i[1]+"%",i[2]=i[2]+"%",i},suffix:["\xB0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var i=t.slice(0,4);return i[1]=i[1]+"%",i[2]=i[2]+"%",i},suffix:["\xB0","%","%",""]}}}}}),_3={};Mr(_3,{default:()=>sC});var rC,iC,x3,aC,nC,b3,w3,T3,oC,sC,lC=Ir({"src/traces/image/attributes.ts"(){"use strict";rC=Vr(fn()),iC=Vr(ri()),x3=Vr(Vo()),aC=Vr(tl()),nC=Vr(A1()),b3=["rgb","rgba","rgba256","hsl","hsla"],w3=[],T3=[];for(let e of b3){let r=nC.colormodel[e];w3.push(`For the \`${e}\` colormodel, it is [${(r.zminDflt||r.min).join(", ")}].`),T3.push(`For the \`${e}\` colormodel, it is [${(r.zmaxDflt||r.max).join(", ")}].`)}oC={source:{valType:"string",editType:"calc",description:["Specifies the data URI of the image to be visualized.",'The URI consists of "data:image/[][;base64\\\\],"'].join(" ")},z:{valType:"data_array",editType:"calc",description:["A 2-dimensional array in which each element is an array of 3 or 4 numbers representing a color."].join(" ")},colormodel:{valType:"enumerated",values:b3,editType:"calc",description:["Color model used to map the numerical color components described in `z` into colors.","If `source` is specified, this attribute will be set to `rgba256`","otherwise it defaults to `rgb`."].join(" ")},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot",description:["Picks a smoothing algorithm used to smooth `z` data.","This only applies for image traces that use the `source` attribute."].join(" ")},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["Array defining the lower bound for each color component.","Note that the default value will depend on the colormodel.",w3.join(" ")].join(" ")},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["Array defining the higher bound for each color component.","Note that the default value will depend on the colormodel.",T3.join(" ")].join(" ")},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",description:["Set the image's x position. The left edge of the image","(or the right edge if the x axis is reversed or dx is negative)","will be found at xmin=x0-dx/2"].join(" ")},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",description:["Set the image's y position. The top edge of the image","(or the bottom edge if the y axis is NOT reversed or if dy is negative)","will be found at ymin=y0-dy/2. By default when an image trace is","included, the y axis will be reversed so that the image is right-side-up,","but you can disable this by setting yaxis.autorange=true or by providing","an explicit y axis range."].join(" ")},dx:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's horizontal size."},dy:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's vertical size"},text:{valType:"data_array",editType:"plot",description:"Sets the text elements associated with each z value."},hovertext:{valType:"data_array",editType:"plot",description:"Same as `text`."},hoverinfo:(0,rC.extendFlat)({},iC.default.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:(0,x3.hovertemplateAttrs)({},{keys:["z","color","colormodel"]}),hovertemplatefallback:(0,x3.templatefallbackAttrs)(),zorder:aC.zorder},sC=oC}}),mH=de({"src/traces/image/defaults.js"(e,r){"use strict";var t=Qt(),i=(lC(),ti(_3)).default,a=A1(),o=Sp().IMAGE_URL_PREFIX;r.exports=function(l,n){function u(h,d){return t.coerce(l,n,i,h,d)}u("source"),n.source&&!n.source.match(o)&&delete n.source,n._hasSource=!!n.source;var c=u("z");if(n._hasZ=!(c===void 0||!c.length||!c[0]||!c[0].length),!n._hasZ&&!n._hasSource){n.visible=!1;return}u("x0"),u("y0"),u("dx"),u("dy");var f;n._hasZ?(u("colormodel","rgb"),f=a.colormodel[n.colormodel],u("zmin",f.zminDflt||f.min),u("zmax",f.zmaxDflt||f.max)):n._hasSource&&(n.colormodel="rgba256",f=a.colormodel[n.colormodel],n.zmin=f.zminDflt,n.zmax=f.zmaxDflt),u("zsmooth"),u("text"),u("hovertext"),u("hovertemplate"),u("hovertemplatefallback"),n._length=null,u("zorder")}}}),Ep=de({"node_modules/inherits/inherits_browser.js"(e,r){typeof Object.create=="function"?r.exports=function(i,a){a&&(i.super_=a,i.prototype=Object.create(a.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(i,a){if(a){i.super_=a;var o=function(){};o.prototype=a.prototype,i.prototype=new o,i.prototype.constructor=i}}}}),uC=de({"node_modules/readable-stream/lib/internal/streams/stream-browser.js"(e,r){r.exports=_v().EventEmitter}}),gH=de({"node_modules/base64-js/index.js"(e){"use strict";e.byteLength=n,e.toByteArray=c,e.fromByteArray=d;var r=[],t=[],i=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var m=p.indexOf("=");m===-1&&(m=g);var y=m===g?0:4-m%4;return[m,y]}function n(p){var g=l(p),m=g[0],y=g[1];return(m+y)*3/4-y}function u(p,g,m){return(g+m)*3/4-m}function c(p){var g,m=l(p),y=m[0],_=m[1],v=new i(u(p,y,_)),x=0,S=_>0?y-4:y,M;for(M=0;M>16&255,v[x++]=g>>8&255,v[x++]=g&255;return _===2&&(g=t[p.charCodeAt(M)]<<2|t[p.charCodeAt(M+1)]>>4,v[x++]=g&255),_===1&&(g=t[p.charCodeAt(M)]<<10|t[p.charCodeAt(M+1)]<<4|t[p.charCodeAt(M+2)]>>2,v[x++]=g>>8&255,v[x++]=g&255),v}function f(p){return r[p>>18&63]+r[p>>12&63]+r[p>>6&63]+r[p&63]}function h(p,g,m){for(var y,_=[],v=g;vS?S:x+v));return y===1?(g=p[m-1],_.push(r[g>>2]+r[g<<4&63]+"==")):y===2&&(g=(p[m-2]<<8)+p[m-1],_.push(r[g>>10]+r[g>>4&63]+r[g<<2&63]+"=")),_.join("")}}}),yH=de({"node_modules/ieee754/index.js"(e){e.read=function(r,t,i,a,o){var s,l,n=o*8-a-1,u=(1<>1,f=-7,h=i?o-1:0,d=i?-1:1,p=r[t+h];for(h+=d,s=p&(1<<-f)-1,p>>=-f,f+=n;f>0;s=s*256+r[t+h],h+=d,f-=8);for(l=s&(1<<-f)-1,s>>=-f,f+=a;f>0;l=l*256+r[t+h],h+=d,f-=8);if(s===0)s=1-c;else{if(s===u)return l?NaN:(p?-1:1)*(1/0);l=l+Math.pow(2,a),s=s-c}return(p?-1:1)*l*Math.pow(2,s-a)},e.write=function(r,t,i,a,o,s){var l,n,u,c=s*8-o-1,f=(1<>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=a?0:s-1,g=a?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(n=isNaN(t)?1:0,l=f):(l=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-l))<1&&(l--,u*=2),l+h>=1?t+=d/u:t+=d*Math.pow(2,1-h),t*u>=2&&(l++,u/=2),l+h>=f?(n=0,l=f):l+h>=1?(n=(t*u-1)*Math.pow(2,o),l=l+h):(n=t*Math.pow(2,h-1)*Math.pow(2,o),l=0));o>=8;r[i+p]=n&255,p+=g,n/=256,o-=8);for(l=l<0;r[i+p]=l&255,p+=g,l/=256,c-=8);r[i+p-g]|=m*128}}}),Cv=de({"node_modules/buffer/index.js"(e){"use strict";var r=gH(),t=yH(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=_,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=o(),!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{let ee=new Uint8Array(1),ie={foo:function(){return 42}};return Object.setPrototypeOf(ie,Uint8Array.prototype),Object.setPrototypeOf(ee,ie),ee.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function s(ee){if(ee>a)throw new RangeError('The value "'+ee+'" is invalid for option "size"');let ie=new Uint8Array(ee);return Object.setPrototypeOf(ie,l.prototype),ie}function l(ee,ie,Q){if(typeof ee=="number"){if(typeof ie=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(ee)}return n(ee,ie,Q)}l.poolSize=8192;function n(ee,ie,Q){if(typeof ee=="string")return h(ee,ie);if(ArrayBuffer.isView(ee))return p(ee);if(ee==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee);if(pe(ee,ArrayBuffer)||ee&&pe(ee.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pe(ee,SharedArrayBuffer)||ee&&pe(ee.buffer,SharedArrayBuffer)))return g(ee,ie,Q);if(typeof ee=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ue=ee.valueOf&&ee.valueOf();if(ue!=null&&ue!==ee)return l.from(ue,ie,Q);let ge=m(ee);if(ge)return ge;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ee[Symbol.toPrimitive]=="function")return l.from(ee[Symbol.toPrimitive]("string"),ie,Q);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee)}l.from=function(ee,ie,Q){return n(ee,ie,Q)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function u(ee){if(typeof ee!="number")throw new TypeError('"size" argument must be of type number');if(ee<0)throw new RangeError('The value "'+ee+'" is invalid for option "size"')}function c(ee,ie,Q){return u(ee),ee<=0?s(ee):ie!==void 0?typeof Q=="string"?s(ee).fill(ie,Q):s(ee).fill(ie):s(ee)}l.alloc=function(ee,ie,Q){return c(ee,ie,Q)};function f(ee){return u(ee),s(ee<0?0:y(ee)|0)}l.allocUnsafe=function(ee){return f(ee)},l.allocUnsafeSlow=function(ee){return f(ee)};function h(ee,ie){if((typeof ie!="string"||ie==="")&&(ie="utf8"),!l.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);let Q=v(ee,ie)|0,ue=s(Q),ge=ue.write(ee,ie);return ge!==Q&&(ue=ue.slice(0,ge)),ue}function d(ee){let ie=ee.length<0?0:y(ee.length)|0,Q=s(ie);for(let ue=0;ue=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return ee|0}function _(ee){return+ee!=ee&&(ee=0),l.alloc(+ee)}l.isBuffer=function(ie){return ie!=null&&ie._isBuffer===!0&&ie!==l.prototype},l.compare=function(ie,Q){if(pe(ie,Uint8Array)&&(ie=l.from(ie,ie.offset,ie.byteLength)),pe(Q,Uint8Array)&&(Q=l.from(Q,Q.offset,Q.byteLength)),!l.isBuffer(ie)||!l.isBuffer(Q))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ie===Q)return 0;let ue=ie.length,ge=Q.length;for(let Me=0,Te=Math.min(ue,ge);Mege.length?(l.isBuffer(Te)||(Te=l.from(Te)),Te.copy(ge,Me)):Uint8Array.prototype.set.call(ge,Te,Me);else if(l.isBuffer(Te))Te.copy(ge,Me);else throw new TypeError('"list" argument must be an Array of Buffers');Me+=Te.length}return ge};function v(ee,ie){if(l.isBuffer(ee))return ee.length;if(ArrayBuffer.isView(ee)||pe(ee,ArrayBuffer))return ee.byteLength;if(typeof ee!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ee);let Q=ee.length,ue=arguments.length>2&&arguments[2]===!0;if(!ue&&Q===0)return 0;let ge=!1;for(;;)switch(ie){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":return te(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return le(ee).length;default:if(ge)return ue?-1:te(ee).length;ie=(""+ie).toLowerCase(),ge=!0}}l.byteLength=v;function x(ee,ie,Q){let ue=!1;if((ie===void 0||ie<0)&&(ie=0),ie>this.length||((Q===void 0||Q>this.length)&&(Q=this.length),Q<=0)||(Q>>>=0,ie>>>=0,Q<=ie))return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return I(this,ie,Q);case"utf8":case"utf-8":return F(this,ie,Q);case"ascii":return P(this,ie,Q);case"latin1":case"binary":return z(this,ie,Q);case"base64":return T(this,ie,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,ie,Q);default:if(ue)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),ue=!0}}l.prototype._isBuffer=!0;function S(ee,ie,Q){let ue=ee[ie];ee[ie]=ee[Q],ee[Q]=ue}l.prototype.swap16=function(){let ie=this.length;if(ie%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Q=0;QQ&&(ie+=" ... "),""},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(ie,Q,ue,ge,Me){if(pe(ie,Uint8Array)&&(ie=l.from(ie,ie.offset,ie.byteLength)),!l.isBuffer(ie))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ie);if(Q===void 0&&(Q=0),ue===void 0&&(ue=ie?ie.length:0),ge===void 0&&(ge=0),Me===void 0&&(Me=this.length),Q<0||ue>ie.length||ge<0||Me>this.length)throw new RangeError("out of range index");if(ge>=Me&&Q>=ue)return 0;if(ge>=Me)return-1;if(Q>=ue)return 1;if(Q>>>=0,ue>>>=0,ge>>>=0,Me>>>=0,this===ie)return 0;let Te=Me-ge,je=ue-Q,Ve=Math.min(Te,je),Ke=this.slice(ge,Me),Je=ie.slice(Q,ue);for(let vt=0;vt2147483647?Q=2147483647:Q<-2147483648&&(Q=-2147483648),Q=+Q,xe(Q)&&(Q=ge?0:ee.length-1),Q<0&&(Q=ee.length+Q),Q>=ee.length){if(ge)return-1;Q=ee.length-1}else if(Q<0)if(ge)Q=0;else return-1;if(typeof ie=="string"&&(ie=l.from(ie,ue)),l.isBuffer(ie))return ie.length===0?-1:C(ee,ie,Q,ue,ge);if(typeof ie=="number")return ie=ie&255,typeof Uint8Array.prototype.indexOf=="function"?ge?Uint8Array.prototype.indexOf.call(ee,ie,Q):Uint8Array.prototype.lastIndexOf.call(ee,ie,Q):C(ee,[ie],Q,ue,ge);throw new TypeError("val must be string, number or Buffer")}function C(ee,ie,Q,ue,ge){let Me=1,Te=ee.length,je=ie.length;if(ue!==void 0&&(ue=String(ue).toLowerCase(),ue==="ucs2"||ue==="ucs-2"||ue==="utf16le"||ue==="utf-16le")){if(ee.length<2||ie.length<2)return-1;Me=2,Te/=2,je/=2,Q/=2}function Ve(Je,vt){return Me===1?Je[vt]:Je.readUInt16BE(vt*Me)}let Ke;if(ge){let Je=-1;for(Ke=Q;KeTe&&(Q=Te-je),Ke=Q;Ke>=0;Ke--){let Je=!0;for(let vt=0;vtge&&(ue=ge)):ue=ge;let Me=ie.length;ue>Me/2&&(ue=Me/2);let Te;for(Te=0;Te>>0,isFinite(ue)?(ue=ue>>>0,ge===void 0&&(ge="utf8")):(ge=ue,ue=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Me=this.length-Q;if((ue===void 0||ue>Me)&&(ue=Me),ie.length>0&&(ue<0||Q<0)||Q>this.length)throw new RangeError("Attempt to write outside buffer bounds");ge||(ge="utf8");let Te=!1;for(;;)switch(ge){case"hex":return w(this,ie,Q,ue);case"utf8":case"utf-8":return k(this,ie,Q,ue);case"ascii":case"latin1":case"binary":return A(this,ie,Q,ue);case"base64":return b(this,ie,Q,ue);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,ie,Q,ue);default:if(Te)throw new TypeError("Unknown encoding: "+ge);ge=(""+ge).toLowerCase(),Te=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(ee,ie,Q){return ie===0&&Q===ee.length?r.fromByteArray(ee):r.fromByteArray(ee.slice(ie,Q))}function F(ee,ie,Q){Q=Math.min(ee.length,Q);let ue=[],ge=ie;for(;ge239?4:Me>223?3:Me>191?2:1;if(ge+je<=Q){let Ve,Ke,Je,vt;switch(je){case 1:Me<128&&(Te=Me);break;case 2:Ve=ee[ge+1],(Ve&192)===128&&(vt=(Me&31)<<6|Ve&63,vt>127&&(Te=vt));break;case 3:Ve=ee[ge+1],Ke=ee[ge+2],(Ve&192)===128&&(Ke&192)===128&&(vt=(Me&15)<<12|(Ve&63)<<6|Ke&63,vt>2047&&(vt<55296||vt>57343)&&(Te=vt));break;case 4:Ve=ee[ge+1],Ke=ee[ge+2],Je=ee[ge+3],(Ve&192)===128&&(Ke&192)===128&&(Je&192)===128&&(vt=(Me&15)<<18|(Ve&63)<<12|(Ke&63)<<6|Je&63,vt>65535&&vt<1114112&&(Te=vt))}}Te===null?(Te=65533,je=1):Te>65535&&(Te-=65536,ue.push(Te>>>10&1023|55296),Te=56320|Te&1023),ue.push(Te),ge+=je}return R(ue)}var D=4096;function R(ee){let ie=ee.length;if(ie<=D)return String.fromCharCode.apply(String,ee);let Q="",ue=0;for(;ueue)&&(Q=ue);let ge="";for(let Me=ie;Meue&&(ie=ue),Q<0?(Q+=ue,Q<0&&(Q=0)):Q>ue&&(Q=ue),QQ)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(ie,Q,ue){ie=ie>>>0,Q=Q>>>0,ue||B(ie,Q,this.length);let ge=this[ie],Me=1,Te=0;for(;++Te>>0,Q=Q>>>0,ue||B(ie,Q,this.length);let ge=this[ie+--Q],Me=1;for(;Q>0&&(Me*=256);)ge+=this[ie+--Q]*Me;return ge},l.prototype.readUint8=l.prototype.readUInt8=function(ie,Q){return ie=ie>>>0,Q||B(ie,1,this.length),this[ie]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(ie,Q){return ie=ie>>>0,Q||B(ie,2,this.length),this[ie]|this[ie+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(ie,Q){return ie=ie>>>0,Q||B(ie,2,this.length),this[ie]<<8|this[ie+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),(this[ie]|this[ie+1]<<8|this[ie+2]<<16)+this[ie+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),this[ie]*16777216+(this[ie+1]<<16|this[ie+2]<<8|this[ie+3])},l.prototype.readBigUInt64LE=fe(function(ie){ie=ie>>>0,j(ie,"offset");let Q=this[ie],ue=this[ie+7];(Q===void 0||ue===void 0)&&q(ie,this.length-8);let ge=Q+this[++ie]*2**8+this[++ie]*2**16+this[++ie]*2**24,Me=this[++ie]+this[++ie]*2**8+this[++ie]*2**16+ue*2**24;return BigInt(ge)+(BigInt(Me)<>>0,j(ie,"offset");let Q=this[ie],ue=this[ie+7];(Q===void 0||ue===void 0)&&q(ie,this.length-8);let ge=Q*2**24+this[++ie]*2**16+this[++ie]*2**8+this[++ie],Me=this[++ie]*2**24+this[++ie]*2**16+this[++ie]*2**8+ue;return(BigInt(ge)<>>0,Q=Q>>>0,ue||B(ie,Q,this.length);let ge=this[ie],Me=1,Te=0;for(;++Te=Me&&(ge-=Math.pow(2,8*Q)),ge},l.prototype.readIntBE=function(ie,Q,ue){ie=ie>>>0,Q=Q>>>0,ue||B(ie,Q,this.length);let ge=Q,Me=1,Te=this[ie+--ge];for(;ge>0&&(Me*=256);)Te+=this[ie+--ge]*Me;return Me*=128,Te>=Me&&(Te-=Math.pow(2,8*Q)),Te},l.prototype.readInt8=function(ie,Q){return ie=ie>>>0,Q||B(ie,1,this.length),this[ie]&128?(255-this[ie]+1)*-1:this[ie]},l.prototype.readInt16LE=function(ie,Q){ie=ie>>>0,Q||B(ie,2,this.length);let ue=this[ie]|this[ie+1]<<8;return ue&32768?ue|4294901760:ue},l.prototype.readInt16BE=function(ie,Q){ie=ie>>>0,Q||B(ie,2,this.length);let ue=this[ie+1]|this[ie]<<8;return ue&32768?ue|4294901760:ue},l.prototype.readInt32LE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),this[ie]|this[ie+1]<<8|this[ie+2]<<16|this[ie+3]<<24},l.prototype.readInt32BE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),this[ie]<<24|this[ie+1]<<16|this[ie+2]<<8|this[ie+3]},l.prototype.readBigInt64LE=fe(function(ie){ie=ie>>>0,j(ie,"offset");let Q=this[ie],ue=this[ie+7];(Q===void 0||ue===void 0)&&q(ie,this.length-8);let ge=this[ie+4]+this[ie+5]*2**8+this[ie+6]*2**16+(ue<<24);return(BigInt(ge)<>>0,j(ie,"offset");let Q=this[ie],ue=this[ie+7];(Q===void 0||ue===void 0)&&q(ie,this.length-8);let ge=(Q<<24)+this[++ie]*2**16+this[++ie]*2**8+this[++ie];return(BigInt(ge)<>>0,Q||B(ie,4,this.length),t.read(this,ie,!0,23,4)},l.prototype.readFloatBE=function(ie,Q){return ie=ie>>>0,Q||B(ie,4,this.length),t.read(this,ie,!1,23,4)},l.prototype.readDoubleLE=function(ie,Q){return ie=ie>>>0,Q||B(ie,8,this.length),t.read(this,ie,!0,52,8)},l.prototype.readDoubleBE=function(ie,Q){return ie=ie>>>0,Q||B(ie,8,this.length),t.read(this,ie,!1,52,8)};function O(ee,ie,Q,ue,ge,Me){if(!l.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(ie>ge||ieee.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(ie,Q,ue,ge){if(ie=+ie,Q=Q>>>0,ue=ue>>>0,!ge){let je=Math.pow(2,8*ue)-1;O(this,ie,Q,ue,je,0)}let Me=1,Te=0;for(this[Q]=ie&255;++Te>>0,ue=ue>>>0,!ge){let je=Math.pow(2,8*ue)-1;O(this,ie,Q,ue,je,0)}let Me=ue-1,Te=1;for(this[Q+Me]=ie&255;--Me>=0&&(Te*=256);)this[Q+Me]=ie/Te&255;return Q+ue},l.prototype.writeUint8=l.prototype.writeUInt8=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,1,255,0),this[Q]=ie&255,Q+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,2,65535,0),this[Q]=ie&255,this[Q+1]=ie>>>8,Q+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,2,65535,0),this[Q]=ie>>>8,this[Q+1]=ie&255,Q+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,4,4294967295,0),this[Q+3]=ie>>>24,this[Q+2]=ie>>>16,this[Q+1]=ie>>>8,this[Q]=ie&255,Q+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,4,4294967295,0),this[Q]=ie>>>24,this[Q+1]=ie>>>16,this[Q+2]=ie>>>8,this[Q+3]=ie&255,Q+4};function G(ee,ie,Q,ue,ge){V(ie,ue,ge,ee,Q,7);let Me=Number(ie&BigInt(4294967295));ee[Q++]=Me,Me=Me>>8,ee[Q++]=Me,Me=Me>>8,ee[Q++]=Me,Me=Me>>8,ee[Q++]=Me;let Te=Number(ie>>BigInt(32)&BigInt(4294967295));return ee[Q++]=Te,Te=Te>>8,ee[Q++]=Te,Te=Te>>8,ee[Q++]=Te,Te=Te>>8,ee[Q++]=Te,Q}function W(ee,ie,Q,ue,ge){V(ie,ue,ge,ee,Q,7);let Me=Number(ie&BigInt(4294967295));ee[Q+7]=Me,Me=Me>>8,ee[Q+6]=Me,Me=Me>>8,ee[Q+5]=Me,Me=Me>>8,ee[Q+4]=Me;let Te=Number(ie>>BigInt(32)&BigInt(4294967295));return ee[Q+3]=Te,Te=Te>>8,ee[Q+2]=Te,Te=Te>>8,ee[Q+1]=Te,Te=Te>>8,ee[Q]=Te,Q+8}l.prototype.writeBigUInt64LE=fe(function(ie,Q=0){return G(this,ie,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=fe(function(ie,Q=0){return W(this,ie,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(ie,Q,ue,ge){if(ie=+ie,Q=Q>>>0,!ge){let Ve=Math.pow(2,8*ue-1);O(this,ie,Q,ue,Ve-1,-Ve)}let Me=0,Te=1,je=0;for(this[Q]=ie&255;++Me>0)-je&255;return Q+ue},l.prototype.writeIntBE=function(ie,Q,ue,ge){if(ie=+ie,Q=Q>>>0,!ge){let Ve=Math.pow(2,8*ue-1);O(this,ie,Q,ue,Ve-1,-Ve)}let Me=ue-1,Te=1,je=0;for(this[Q+Me]=ie&255;--Me>=0&&(Te*=256);)ie<0&&je===0&&this[Q+Me+1]!==0&&(je=1),this[Q+Me]=(ie/Te>>0)-je&255;return Q+ue},l.prototype.writeInt8=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,1,127,-128),ie<0&&(ie=255+ie+1),this[Q]=ie&255,Q+1},l.prototype.writeInt16LE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,2,32767,-32768),this[Q]=ie&255,this[Q+1]=ie>>>8,Q+2},l.prototype.writeInt16BE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,2,32767,-32768),this[Q]=ie>>>8,this[Q+1]=ie&255,Q+2},l.prototype.writeInt32LE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,4,2147483647,-2147483648),this[Q]=ie&255,this[Q+1]=ie>>>8,this[Q+2]=ie>>>16,this[Q+3]=ie>>>24,Q+4},l.prototype.writeInt32BE=function(ie,Q,ue){return ie=+ie,Q=Q>>>0,ue||O(this,ie,Q,4,2147483647,-2147483648),ie<0&&(ie=4294967295+ie+1),this[Q]=ie>>>24,this[Q+1]=ie>>>16,this[Q+2]=ie>>>8,this[Q+3]=ie&255,Q+4},l.prototype.writeBigInt64LE=fe(function(ie,Q=0){return G(this,ie,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=fe(function(ie,Q=0){return W(this,ie,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function X(ee,ie,Q,ue,ge,Me){if(Q+ue>ee.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("Index out of range")}function Z(ee,ie,Q,ue,ge){return ie=+ie,Q=Q>>>0,ge||X(ee,ie,Q,4,34028234663852886e22,-34028234663852886e22),t.write(ee,ie,Q,ue,23,4),Q+4}l.prototype.writeFloatLE=function(ie,Q,ue){return Z(this,ie,Q,!0,ue)},l.prototype.writeFloatBE=function(ie,Q,ue){return Z(this,ie,Q,!1,ue)};function J(ee,ie,Q,ue,ge){return ie=+ie,Q=Q>>>0,ge||X(ee,ie,Q,8,17976931348623157e292,-17976931348623157e292),t.write(ee,ie,Q,ue,52,8),Q+8}l.prototype.writeDoubleLE=function(ie,Q,ue){return J(this,ie,Q,!0,ue)},l.prototype.writeDoubleBE=function(ie,Q,ue){return J(this,ie,Q,!1,ue)},l.prototype.copy=function(ie,Q,ue,ge){if(!l.isBuffer(ie))throw new TypeError("argument should be a Buffer");if(ue||(ue=0),!ge&&ge!==0&&(ge=this.length),Q>=ie.length&&(Q=ie.length),Q||(Q=0),ge>0&&ge=this.length)throw new RangeError("Index out of range");if(ge<0)throw new RangeError("sourceEnd out of bounds");ge>this.length&&(ge=this.length),ie.length-Q>>0,ue=ue===void 0?this.length:ue>>>0,ie||(ie=0);let Me;if(typeof ie=="number")for(Me=Q;Me2**32?ge=$(String(Q)):typeof Q=="bigint"&&(ge=String(Q),(Q>BigInt(2)**BigInt(32)||Q<-(BigInt(2)**BigInt(32)))&&(ge=$(ge)),ge+="n"),ue+=` It must be ${ie}. Received ${ge}`,ue},RangeError);function $(ee){let ie="",Q=ee.length,ue=ee[0]==="-"?1:0;for(;Q>=ue+4;Q-=3)ie=`_${ee.slice(Q-3,Q)}${ie}`;return`${ee.slice(0,Q)}${ie}`}function U(ee,ie,Q){j(ie,"offset"),(ee[ie]===void 0||ee[ie+Q]===void 0)&&q(ie,ee.length-(Q+1))}function V(ee,ie,Q,ue,ge,Me){if(ee>Q||ee3?ie===0||ie===BigInt(0)?je=`>= 0${Te} and < 2${Te} ** ${(Me+1)*8}${Te}`:je=`>= -(2${Te} ** ${(Me+1)*8-1}${Te}) and < 2 ** ${(Me+1)*8-1}${Te}`:je=`>= ${ie}${Te} and <= ${Q}${Te}`,new N.ERR_OUT_OF_RANGE("value",je,ee)}U(ue,ge,Me)}function j(ee,ie){if(typeof ee!="number")throw new N.ERR_INVALID_ARG_TYPE(ie,"number",ee)}function q(ee,ie,Q){throw Math.floor(ee)!==ee?(j(ee,Q),new N.ERR_OUT_OF_RANGE(Q||"offset","an integer",ee)):ie<0?new N.ERR_BUFFER_OUT_OF_BOUNDS:new N.ERR_OUT_OF_RANGE(Q||"offset",`>= ${Q?1:0} and <= ${ie}`,ee)}var Y=/[^+/0-9A-Za-z-_]/g;function K(ee){if(ee=ee.split("=")[0],ee=ee.trim().replace(Y,""),ee.length<2)return"";for(;ee.length%4!==0;)ee=ee+"=";return ee}function te(ee,ie){ie=ie||1/0;let Q,ue=ee.length,ge=null,Me=[];for(let Te=0;Te55295&&Q<57344){if(!ge){if(Q>56319){(ie-=3)>-1&&Me.push(239,191,189);continue}else if(Te+1===ue){(ie-=3)>-1&&Me.push(239,191,189);continue}ge=Q;continue}if(Q<56320){(ie-=3)>-1&&Me.push(239,191,189),ge=Q;continue}Q=(ge-55296<<10|Q-56320)+65536}else ge&&(ie-=3)>-1&&Me.push(239,191,189);if(ge=null,Q<128){if((ie-=1)<0)break;Me.push(Q)}else if(Q<2048){if((ie-=2)<0)break;Me.push(Q>>6|192,Q&63|128)}else if(Q<65536){if((ie-=3)<0)break;Me.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if((ie-=4)<0)break;Me.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw new Error("Invalid code point")}return Me}function ne(ee){let ie=[];for(let Q=0;Q>8,ge=Q%256,Me.push(ge),Me.push(ue);return Me}function le(ee){return r.toByteArray(K(ee))}function ce(ee,ie,Q,ue){let ge;for(ge=0;ge=ie.length||ge>=ee.length);++ge)ie[ge+Q]=ee[ge];return ge}function pe(ee,ie){return ee instanceof ie||ee!=null&&ee.constructor!=null&&ee.constructor.name!=null&&ee.constructor.name===ie.name}function xe(ee){return ee!==ee}var ye=(function(){let ee="0123456789abcdef",ie=new Array(256);for(let Q=0;Q<16;++Q){let ue=Q*16;for(let ge=0;ge<16;++ge)ie[ue+ge]=ee[Q]+ee[ge]}return ie})();function fe(ee){return typeof BigInt>"u"?ae:ee}function ae(){throw new Error("BigInt not supported")}}}),A3=de({"node_modules/has-symbols/shams.js"(e,r){"use strict";r.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},a=Symbol("test"),o=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var s=42;i[a]=s;for(var l in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var n=Object.getOwnPropertySymbols(i);if(n.length!==1||n[0]!==a||!Object.prototype.propertyIsEnumerable.call(i,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(i,a);if(u.value!==s||u.enumerable!==!0)return!1}return!0}}}),$y=de({"node_modules/has-tostringtag/shams.js"(e,r){"use strict";var t=A3();r.exports=function(){return t()&&!!Symbol.toStringTag}}}),M3=de({"node_modules/es-object-atoms/index.js"(e,r){"use strict";r.exports=Object}}),_H=de({"node_modules/es-errors/index.js"(e,r){"use strict";r.exports=Error}}),xH=de({"node_modules/es-errors/eval.js"(e,r){"use strict";r.exports=EvalError}}),bH=de({"node_modules/es-errors/range.js"(e,r){"use strict";r.exports=RangeError}}),wH=de({"node_modules/es-errors/ref.js"(e,r){"use strict";r.exports=ReferenceError}}),cC=de({"node_modules/es-errors/syntax.js"(e,r){"use strict";r.exports=SyntaxError}}),M1=de({"node_modules/es-errors/type.js"(e,r){"use strict";r.exports=TypeError}}),TH=de({"node_modules/es-errors/uri.js"(e,r){"use strict";r.exports=URIError}}),AH=de({"node_modules/math-intrinsics/abs.js"(e,r){"use strict";r.exports=Math.abs}}),MH=de({"node_modules/math-intrinsics/floor.js"(e,r){"use strict";r.exports=Math.floor}}),SH=de({"node_modules/math-intrinsics/max.js"(e,r){"use strict";r.exports=Math.max}}),EH=de({"node_modules/math-intrinsics/min.js"(e,r){"use strict";r.exports=Math.min}}),kH=de({"node_modules/math-intrinsics/pow.js"(e,r){"use strict";r.exports=Math.pow}}),CH=de({"node_modules/math-intrinsics/round.js"(e,r){"use strict";r.exports=Math.round}}),DH=de({"node_modules/math-intrinsics/isNaN.js"(e,r){"use strict";r.exports=Number.isNaN||function(i){return i!==i}}}),LH=de({"node_modules/math-intrinsics/sign.js"(e,r){"use strict";var t=DH();r.exports=function(a){return t(a)||a===0?a:a<0?-1:1}}}),FH=de({"node_modules/gopd/gOPD.js"(e,r){"use strict";r.exports=Object.getOwnPropertyDescriptor}}),Dv=de({"node_modules/gopd/index.js"(e,r){"use strict";var t=FH();if(t)try{t([],"length")}catch{t=null}r.exports=t}}),Wy=de({"node_modules/es-define-property/index.js"(e,r){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}r.exports=t}}),PH=de({"node_modules/has-symbols/index.js"(e,r){"use strict";var t=typeof Symbol<"u"&&Symbol,i=A3();r.exports=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()}}}),fC=de({"node_modules/get-proto/Reflect.getPrototypeOf.js"(e,r){"use strict";r.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),hC=de({"node_modules/get-proto/Object.getPrototypeOf.js"(e,r){"use strict";var t=M3();r.exports=t.getPrototypeOf||null}}),IH=de({"node_modules/function-bind/implementation.js"(e,r){"use strict";var t="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,a=Math.max,o="[object Function]",s=function(c,f){for(var h=[],d=0;d"u"||!k?t:k(Uint8Array),R={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":w&&k?k([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":F,"%AsyncGenerator%":F,"%AsyncGeneratorFunction%":F,"%AsyncIteratorPrototype%":F,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":F,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&k?k(k([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!w||!k?t:k(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":s,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!w||!k?t:k(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&k?k(""[Symbol.iterator]()):t,"%Symbol%":w?Symbol:t,"%SyntaxError%":n,"%ThrowTypeError%":C,"%TypedArray%":D,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":E,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":A,"%Math.abs%":f,"%Math.floor%":h,"%Math.max%":d,"%Math.min%":p,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":y,"%Reflect.getPrototypeOf%":b};if(k)try{null.error}catch(U){P=k(k(U)),R["%Error.prototype%"]=P}var P,z=function U(V){var j;if(V==="%AsyncFunction%")j=v("async function () {}");else if(V==="%GeneratorFunction%")j=v("function* () {}");else if(V==="%AsyncGeneratorFunction%")j=v("async function* () {}");else if(V==="%AsyncGenerator%"){var q=U("%AsyncGeneratorFunction%");q&&(j=q.prototype)}else if(V==="%AsyncIteratorPrototype%"){var Y=U("%AsyncGenerator%");Y&&k&&(j=k(Y.prototype))}return R[V]=j,j},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=S1(),B=pC(),O=L.call(T,Array.prototype.concat),G=L.call(E,Array.prototype.splice),W=L.call(T,String.prototype.replace),X=L.call(T,String.prototype.slice),Z=L.call(T,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,H=function(V){var j=X(V,0,1),q=X(V,-1);if(j==="%"&&q!=="%")throw new n("invalid intrinsic syntax, expected closing `%`");if(q==="%"&&j!=="%")throw new n("invalid intrinsic syntax, expected opening `%`");var Y=[];return W(V,J,function(K,te,ne,se){Y[Y.length]=ne?W(se,N,"$1"):te||K}),Y},$=function(V,j){var q=V,Y;if(B(I,q)&&(Y=I[q],q="%"+Y[0]+"%"),B(R,q)){var K=R[q];if(K===F&&(K=z(q)),typeof K>"u"&&!j)throw new u("intrinsic "+V+" exists, but is not available. Please file an issue!");return{alias:Y,name:q,value:K}}throw new n("intrinsic "+V+" does not exist!")};r.exports=function(V,j){if(typeof V!="string"||V.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof j!="boolean")throw new u('"allowMissing" argument must be a boolean');if(Z(/^%?[^%]*%?$/,V)===null)throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var q=H(V),Y=q.length>0?q[0]:"",K=$("%"+Y+"%",j),te=K.name,ne=K.value,se=!1,le=K.alias;le&&(Y=le[0],G(q,O([0,1],le)));for(var ce=1,pe=!0;ce=q.length){var ae=x(ne,xe);pe=!!ae,pe&&"get"in ae&&!("originalValue"in ae.get)?ne=ae.get:ne=ne[xe]}else pe=B(ne,xe),ne=ne[xe];pe&&!se&&(R[te]=ne)}}return ne}}}),Lv=de({"node_modules/call-bound/index.js"(e,r){"use strict";var t=D3(),i=k3(),a=i([t("%String.prototype.indexOf%")]);r.exports=function(s,l){var n=t(s,!!l);return typeof n=="function"&&a(s,".prototype.")>-1?i([n]):n}}}),BH=de({"node_modules/is-arguments/index.js"(e,r){"use strict";var t=$y()(),i=Lv(),a=i("Object.prototype.toString"),o=function(u){return t&&u&&typeof u=="object"&&Symbol.toStringTag in u?!1:a(u)==="[object Arguments]"},s=function(u){return o(u)?!0:u!==null&&typeof u=="object"&&"length"in u&&typeof u.length=="number"&&u.length>=0&&a(u)!=="[object Array]"&&"callee"in u&&a(u.callee)==="[object Function]"},l=(function(){return o(arguments)})();o.isLegacyArguments=s,r.exports=l?o:s}}),OH=de({"node_modules/is-regex/index.js"(e,r){"use strict";var t=Lv(),i=$y()(),a=pC(),o=Dv(),s;i?(l=t("RegExp.prototype.exec"),n={},u=function(){throw n},c={toString:u,valueOf:u},typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=u),s=function(p){if(!p||typeof p!="object")return!1;var g=o(p,"lastIndex"),m=g&&a(g,"value");if(!m)return!1;try{l(p,c)}catch(y){return y===n}}):(f=t("Object.prototype.toString"),h="[object RegExp]",s=function(p){return!p||typeof p!="object"&&typeof p!="function"?!1:f(p)===h});var l,n,u,c,f,h;r.exports=s}}),NH=de({"node_modules/safe-regex-test/index.js"(e,r){"use strict";var t=Lv(),i=OH(),a=t("RegExp.prototype.exec"),o=M1();r.exports=function(l){if(!i(l))throw new o("`regex` must be a RegExp");return function(u){return a(l,u)!==null}}}}),jH=de({"node_modules/generator-function/index.js"(e,r){"use strict";var t=function*(){}.constructor;r.exports=()=>t}}),UH=de({"node_modules/is-generator-function/index.js"(e,r){"use strict";var t=Lv(),i=NH(),a=i(/^\s*(?:function)?\*/),o=$y()(),s=C3(),l=t("Object.prototype.toString"),n=t("Function.prototype.toString"),u=jH();r.exports=function(f){if(typeof f!="function")return!1;if(a(n(f)))return!0;if(!o){var h=l(f);return h==="[object GeneratorFunction]"}if(!s)return!1;var d=u();return d&&s(f)===d.prototype}}}),qH=de({"node_modules/is-callable/index.js"(e,r){"use strict";var t=Function.prototype.toString,i=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,a,o;if(typeof i=="function"&&typeof Object.defineProperty=="function")try{a=Object.defineProperty({},"length",{get:function(){throw o}}),o={},i(function(){throw 42},null,a)}catch(x){x!==o&&(i=null)}else i=null;var s=/^\s*class\b/,l=function(S){try{var M=t.call(S);return s.test(M)}catch{return!1}},n=function(S){try{return l(S)?!1:(t.call(S),!0)}catch{return!1}},u=Object.prototype.toString,c="[object Object]",f="[object Function]",h="[object GeneratorFunction]",d="[object HTMLAllCollection]",p="[object HTML document.all class]",g="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,y=!(0 in[,]),_=function(){return!1};typeof document=="object"&&(v=document.all,u.call(v)===u.call(document.all)&&(_=function(S){if((y||!S)&&(typeof S>"u"||typeof S=="object"))try{var M=u.call(S);return(M===d||M===p||M===g||M===c)&&S("")==null}catch{}return!1}));var v;r.exports=i?function(S){if(_(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;try{i(S,null,a)}catch(M){if(M!==o)return!1}return!l(S)&&n(S)}:function(S){if(_(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;if(m)return n(S);if(l(S))return!1;var M=u.call(S);return M!==f&&M!==h&&!/^\[object HTML/.test(M)?!1:n(S)}}}),VH=de({"node_modules/for-each/index.js"(e,r){"use strict";var t=qH(),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty,o=function(c,f,h){for(var d=0,p=c.length;d=3&&(d=h),n(c)?o(c,f,d):typeof c=="string"?s(c,f,d):l(c,f,d)}}}),GH=de({"node_modules/possible-typed-array-names/index.js"(e,r){"use strict";r.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}}),HH=de({"node_modules/available-typed-arrays/index.js"(e,r){"use strict";var t=GH(),i=typeof globalThis>"u"?window:globalThis;r.exports=function(){for(var o=[],s=0;s3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new a("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,p=!!o&&o(l,n);if(t)t(l,n,{configurable:h===null&&p?p.configurable:!h,enumerable:c===null&&p?p.enumerable:!c,value:u,writable:f===null&&p?p.writable:!f});else if(d||!c&&!f&&!h)l[n]=u;else throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),mC=de({"node_modules/has-property-descriptors/index.js"(e,r){"use strict";var t=Wy(),i=function(){return!!t};i.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},r.exports=i}}),$H=de({"node_modules/set-function-length/index.js"(e,r){"use strict";var t=D3(),i=vC(),a=mC()(),o=Dv(),s=M1(),l=t("%Math.floor%");r.exports=function(u,c){if(typeof u!="function")throw new s("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||l(c)!==c)throw new s("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,d=!0;if("length"in u&&o){var p=o(u,"length");p&&!p.configurable&&(h=!1),p&&!p.writable&&(d=!1)}return(h||d||!f)&&(a?i(u,"length",c,!0,!0):i(u,"length",c)),u}}}),WH=de({"node_modules/call-bind-apply-helpers/applyBind.js"(e,r){"use strict";var t=S1(),i=E3(),a=dC();r.exports=function(){return a(t,i,arguments)}}}),Yy=de({"node_modules/call-bind/index.js"(e,r){"use strict";var t=$H(),i=Wy(),a=k3(),o=WH();r.exports=function(l){var n=a(arguments),u=1+l.length-(arguments.length-1);return t(n,u>0?u:0,!0)},i?i(r.exports,"apply",{value:o}):r.exports.apply=o}}),gC=de({"node_modules/which-typed-array/index.js"(e,r){"use strict";var t=VH(),i=HH(),a=Yy(),o=Lv(),s=Dv(),l=C3(),n=o("Object.prototype.toString"),u=$y()(),c=typeof globalThis>"u"?window:globalThis,f=i(),h=o("String.prototype.slice"),d=o("Array.prototype.indexOf",!0)||function(v,x){for(var S=0;S-1}r.exports=function(v){if(!v||typeof v!="object")return!1;if(!u){var x=h(n(v),8,-1);return y(x)?x:x!=="Object"?!1:m(v)}return s?g(v):null}}}),YH=de({"node_modules/is-typed-array/index.js"(e,r){"use strict";var t=gC();r.exports=function(a){return!!t(a)}}}),yC=de({"node_modules/util/support/types.js"(e){"use strict";var r=BH(),t=UH(),i=gC(),a=YH();function o(se){return se.call.bind(se)}var s=typeof BigInt<"u",l=typeof Symbol<"u",n=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),f=o(Boolean.prototype.valueOf);s&&(h=o(BigInt.prototype.valueOf));var h;l&&(d=o(Symbol.prototype.valueOf));var d;function p(se,le){if(typeof se!="object")return!1;try{return le(se),!0}catch{return!1}}e.isArgumentsObject=r,e.isGeneratorFunction=t,e.isTypedArray=a;function g(se){return typeof Promise<"u"&&se instanceof Promise||se!==null&&typeof se=="object"&&typeof se.then=="function"&&typeof se.catch=="function"}e.isPromise=g;function m(se){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(se):a(se)||G(se)}e.isArrayBufferView=m;function y(se){return i(se)==="Uint8Array"}e.isUint8Array=y;function _(se){return i(se)==="Uint8ClampedArray"}e.isUint8ClampedArray=_;function v(se){return i(se)==="Uint16Array"}e.isUint16Array=v;function x(se){return i(se)==="Uint32Array"}e.isUint32Array=x;function S(se){return i(se)==="Int8Array"}e.isInt8Array=S;function M(se){return i(se)==="Int16Array"}e.isInt16Array=M;function C(se){return i(se)==="Int32Array"}e.isInt32Array=C;function w(se){return i(se)==="Float32Array"}e.isFloat32Array=w;function k(se){return i(se)==="Float64Array"}e.isFloat64Array=k;function A(se){return i(se)==="BigInt64Array"}e.isBigInt64Array=A;function b(se){return i(se)==="BigUint64Array"}e.isBigUint64Array=b;function E(se){return n(se)==="[object Map]"}E.working=typeof Map<"u"&&E(new Map);function T(se){return typeof Map>"u"?!1:E.working?E(se):se instanceof Map}e.isMap=T;function F(se){return n(se)==="[object Set]"}F.working=typeof Set<"u"&&F(new Set);function D(se){return typeof Set>"u"?!1:F.working?F(se):se instanceof Set}e.isSet=D;function R(se){return n(se)==="[object WeakMap]"}R.working=typeof WeakMap<"u"&&R(new WeakMap);function P(se){return typeof WeakMap>"u"?!1:R.working?R(se):se instanceof WeakMap}e.isWeakMap=P;function z(se){return n(se)==="[object WeakSet]"}z.working=typeof WeakSet<"u"&&z(new WeakSet);function I(se){return z(se)}e.isWeakSet=I;function L(se){return n(se)==="[object ArrayBuffer]"}L.working=typeof ArrayBuffer<"u"&&L(new ArrayBuffer);function B(se){return typeof ArrayBuffer>"u"?!1:L.working?L(se):se instanceof ArrayBuffer}e.isArrayBuffer=B;function O(se){return n(se)==="[object DataView]"}O.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&O(new DataView(new ArrayBuffer(1),0,1));function G(se){return typeof DataView>"u"?!1:O.working?O(se):se instanceof DataView}e.isDataView=G;var W=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function X(se){return n(se)==="[object SharedArrayBuffer]"}function Z(se){return typeof W>"u"?!1:(typeof X.working>"u"&&(X.working=X(new W)),X.working?X(se):se instanceof W)}e.isSharedArrayBuffer=Z;function J(se){return n(se)==="[object AsyncFunction]"}e.isAsyncFunction=J;function N(se){return n(se)==="[object Map Iterator]"}e.isMapIterator=N;function H(se){return n(se)==="[object Set Iterator]"}e.isSetIterator=H;function $(se){return n(se)==="[object Generator]"}e.isGeneratorObject=$;function U(se){return n(se)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=U;function V(se){return p(se,u)}e.isNumberObject=V;function j(se){return p(se,c)}e.isStringObject=j;function q(se){return p(se,f)}e.isBooleanObject=q;function Y(se){return s&&p(se,h)}e.isBigIntObject=Y;function K(se){return l&&p(se,d)}e.isSymbolObject=K;function te(se){return V(se)||j(se)||q(se)||Y(se)||K(se)}e.isBoxedPrimitive=te;function ne(se){return typeof Uint8Array<"u"&&(B(se)||Z(se))}e.isAnyArrayBuffer=ne,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(se){Object.defineProperty(e,se,{enumerable:!1,value:function(){throw new Error(se+" is not supported in userland")}})})}}),_C=de({"node_modules/util/support/isBufferBrowser.js"(e,r){r.exports=function(i){return i&&typeof i=="object"&&typeof i.copy=="function"&&typeof i.fill=="function"&&typeof i.readUInt8=="function"}}}),xC=de({"(disabled):node_modules/util/util.js"(e){var r=Object.getOwnPropertyDescriptors||function(G){for(var W=Object.keys(G),X={},Z=0;Z=Z)return H;switch(H){case"%s":return String(X[W++]);case"%d":return Number(X[W++]);case"%j":try{return JSON.stringify(X[W++])}catch{return"[Circular]"}default:return H}}),N=X[W];W"u")return function(){return e.deprecate(O,G).apply(this,arguments)};var W=!1;function X(){if(!W){if(process.throwDeprecation)throw new Error(G);process.traceDeprecation?console.trace(G):console.error(G),W=!0}return O.apply(this,arguments)}return X};var i={},a=/^$/;o="false",o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i");var o;e.debuglog=function(O){if(O=O.toUpperCase(),!i[O])if(a.test(O)){var G=process.pid;i[O]=function(){var W=e.format.apply(e,arguments);console.error("%s %d: %s",O,G,W)}}else i[O]=function(){};return i[O]};function s(O,G){var W={seen:[],stylize:n};return arguments.length>=3&&(W.depth=arguments[2]),arguments.length>=4&&(W.colors=arguments[3]),y(G)?W.showHidden=G:G&&e._extend(W,G),C(W.showHidden)&&(W.showHidden=!1),C(W.depth)&&(W.depth=2),C(W.colors)&&(W.colors=!1),C(W.customInspect)&&(W.customInspect=!0),W.colors&&(W.stylize=l),c(W,O,W.depth)}e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(O,G){var W=s.styles[G];return W?"\x1B["+s.colors[W][0]+"m"+O+"\x1B["+s.colors[W][1]+"m":O}function n(O,G){return O}function u(O){var G={};return O.forEach(function(W,X){G[W]=!0}),G}function c(O,G,W){if(O.customInspect&&G&&E(G.inspect)&&G.inspect!==e.inspect&&!(G.constructor&&G.constructor.prototype===G)){var X=G.inspect(W,O);return S(X)||(X=c(O,X,W)),X}var Z=f(O,G);if(Z)return Z;var J=Object.keys(G),N=u(J);if(O.showHidden&&(J=Object.getOwnPropertyNames(G)),b(G)&&(J.indexOf("message")>=0||J.indexOf("description")>=0))return h(G);if(J.length===0){if(E(G)){var H=G.name?": "+G.name:"";return O.stylize("[Function"+H+"]","special")}if(w(G))return O.stylize(RegExp.prototype.toString.call(G),"regexp");if(A(G))return O.stylize(Date.prototype.toString.call(G),"date");if(b(G))return h(G)}var $="",U=!1,V=["{","}"];if(m(G)&&(U=!0,V=["[","]"]),E(G)){var j=G.name?": "+G.name:"";$=" [Function"+j+"]"}if(w(G)&&($=" "+RegExp.prototype.toString.call(G)),A(G)&&($=" "+Date.prototype.toUTCString.call(G)),b(G)&&($=" "+h(G)),J.length===0&&(!U||G.length==0))return V[0]+$+V[1];if(W<0)return w(G)?O.stylize(RegExp.prototype.toString.call(G),"regexp"):O.stylize("[Object]","special");O.seen.push(G);var q;return U?q=d(O,G,W,N,J):q=J.map(function(Y){return p(O,G,W,N,Y,U)}),O.seen.pop(),g(q,$,V)}function f(O,G){if(C(G))return O.stylize("undefined","undefined");if(S(G)){var W="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return O.stylize(W,"string")}if(x(G))return O.stylize(""+G,"number");if(y(G))return O.stylize(""+G,"boolean");if(_(G))return O.stylize("null","null")}function h(O){return"["+Error.prototype.toString.call(O)+"]"}function d(O,G,W,X,Z){for(var J=[],N=0,H=G.length;N-1&&(J?H=H.split(` `).map(function(U){return" "+U}).join(` `).slice(2):H=` @@ -17,7 +17,7 @@ var Dce=Object.create;var xj=Object.defineProperty;var Lce=Object.getOwnProperty `))):H=O.stylize("[Circular]","special")),C(N)){if(J&&Z.match(/^\d+$/))return H;N=JSON.stringify(""+Z),N.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(N=N.slice(1,-1),N=O.stylize(N,"name")):(N=N.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),N=O.stylize(N,"string"))}return N+": "+H}function g(O,G,W){var X=0,Z=O.reduce(function(J,N){return X++,N.indexOf(` `)>=0&&X++,J+N.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Z>60?W[0]+(G===""?"":G+` `)+" "+O.join(`, - `)+" "+W[1]:W[0]+G+" "+O.join(", ")+" "+W[1]}e.types=yC();function m(O){return Array.isArray(O)}e.isArray=m;function y(O){return typeof O=="boolean"}e.isBoolean=y;function _(O){return O===null}e.isNull=_;function v(O){return O==null}e.isNullOrUndefined=v;function x(O){return typeof O=="number"}e.isNumber=x;function S(O){return typeof O=="string"}e.isString=S;function M(O){return typeof O=="symbol"}e.isSymbol=M;function C(O){return O===void 0}e.isUndefined=C;function w(O){return k(O)&&F(O)==="[object RegExp]"}e.isRegExp=w,e.types.isRegExp=w;function k(O){return typeof O=="object"&&O!==null}e.isObject=k;function A(O){return k(O)&&F(O)==="[object Date]"}e.isDate=A,e.types.isDate=A;function b(O){return k(O)&&(F(O)==="[object Error]"||O instanceof Error)}e.isError=b,e.types.isNativeError=b;function E(O){return typeof O=="function"}e.isFunction=E;function T(O){return O===null||typeof O=="boolean"||typeof O=="number"||typeof O=="string"||typeof O=="symbol"||typeof O>"u"}e.isPrimitive=T,e.isBuffer=_C();function F(O){return Object.prototype.toString.call(O)}function D(O){return O<10?"0"+O.toString(10):O.toString(10)}var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var O=new Date,G=[D(O.getHours()),D(O.getMinutes()),D(O.getSeconds())].join(":");return[O.getDate(),R[O.getMonth()],G].join(" ")}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=Sp(),e._extend=function(O,G){if(!G||!k(G))return O;for(var W=Object.keys(G),X=W.length;X--;)O[W[X]]=G[W[X]];return O};function z(O,G){return Object.prototype.hasOwnProperty.call(O,G)}var I=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(I&&G[I]){var W=G[I];if(typeof W!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(W,I,{value:W,enumerable:!1,writable:!1,configurable:!0}),W}function W(){for(var X,Z,J=new Promise(function($,U){X=$,Z=U}),N=[],H=0;H0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(_){var v={data:_,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var _=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,_}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(_){if(this.length===0)return"";for(var v=this.head,x=""+v.data;v=v.next;)x+=_+v.data;return x}},{key:"concat",value:function(_){if(this.length===0)return f.alloc(0);for(var v=f.allocUnsafe(_>>>0),x=this.head,S=0;x;)g(x.data,v,S),S+=x.data.length,x=x.next;return v}},{key:"consume",value:function(_,v){var x;return _M.length?M.length:_;if(C===M.length?S+=M:S+=M.slice(0,_),_-=C,_===0){C===M.length?(++x,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=M.slice(C));break}++x}return this.length-=x,S}},{key:"_getBuffer",value:function(_){var v=f.allocUnsafe(_),x=this.head,S=1;for(x.data.copy(v),_-=x.data.length;x=x.next;){var M=x.data,C=_>M.length?M.length:_;if(M.copy(v,v.length-_,0,C),_-=C,_===0){C===M.length?(++S,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=M.slice(C));break}++S}return this.length-=S,v}},{key:p,value:function(_,v){return d(this,i(i({},v),{},{depth:0,customInspect:!1}))}}]),m})()}}),bC=de({"node_modules/readable-stream/lib/internal/streams/destroy.js"(e,r){"use strict";function t(n,u){var c=this,f=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return f||h?(u?u(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(s,this,n)):process.nextTick(s,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(d){!u&&d?c._writableState?c._writableState.errorEmitted?process.nextTick(a,c):(c._writableState.errorEmitted=!0,process.nextTick(i,c,d)):process.nextTick(i,c,d):u?(process.nextTick(a,c),u(d)):process.nextTick(a,c)}),this)}function i(n,u){s(n,u),a(n)}function a(n){n._writableState&&!n._writableState.emitClose||n._readableState&&!n._readableState.emitClose||n.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(n,u){n.emit("error",u)}function l(n,u){var c=n._readableState,f=n._writableState;c&&c.autoDestroy||f&&f.autoDestroy?n.destroy(u):n.emit("error",u)}r.exports={destroy:t,undestroy:o,errorOrDestroy:l}}}),Lv=de({"node_modules/readable-stream/errors-browser.js"(e,r){"use strict";function t(u,c){u.prototype=Object.create(c.prototype),u.prototype.constructor=u,u.__proto__=c}var i={};function a(u,c,f){f||(f=Error);function h(p,g,m){return typeof c=="string"?c:c(p,g,m)}var d=(function(p){t(g,p);function g(m,y,_){return p.call(this,h(m,y,_))||this}return g})(f);d.prototype.name=f.name,d.prototype.code=u,i[u]=d}function o(u,c){if(Array.isArray(u)){var f=u.length;return u=u.map(function(h){return String(h)}),f>2?"one of ".concat(c," ").concat(u.slice(0,f-1).join(", "),", or ")+u[f-1]:f===2?"one of ".concat(c," ").concat(u[0]," or ").concat(u[1]):"of ".concat(c," ").concat(u[0])}else return"of ".concat(c," ").concat(String(u))}function s(u,c,f){return u.substr(!f||f<0?0:+f,c.length)===c}function l(u,c,f){return(f===void 0||f>u.length)&&(f=u.length),u.substring(f-c.length,f)===c}function n(u,c,f){return typeof f!="number"&&(f=0),f+c.length>u.length?!1:u.indexOf(c,f)!==-1}a("ERR_INVALID_OPT_VALUE",function(u,c){return'The value "'+c+'" is invalid for option "'+u+'"'},TypeError),a("ERR_INVALID_ARG_TYPE",function(u,c,f){var h;typeof c=="string"&&s(c,"not ")?(h="must not be",c=c.replace(/^not /,"")):h="must be";var d;if(l(u," argument"))d="The ".concat(u," ").concat(h," ").concat(o(c,"type"));else{var p=n(u,".")?"property":"argument";d='The "'.concat(u,'" ').concat(p," ").concat(h," ").concat(o(c,"type"))}return d+=". Received type ".concat(typeof f),d},TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),r.exports.codes=i}}),wC=de({"node_modules/readable-stream/lib/internal/streams/state.js"(e,r){"use strict";var t=Lv().codes.ERR_INVALID_OPT_VALUE;function i(o,s,l){return o.highWaterMark!=null?o.highWaterMark:s?o[l]:null}function a(o,s,l,n){var u=i(s,n,l);if(u!=null){if(!(isFinite(u)&&Math.floor(u)===u)||u<0){var c=n?l:"highWaterMark";throw new t(c,u)}return Math.floor(u)}return o.objectMode?16:16*1024}r.exports={getHighWaterMark:a}}}),ZH=de({"node_modules/util-deprecate/browser.js"(e,r){r.exports=t;function t(a,o){if(i("noDeprecation"))return a;var s=!1;function l(){if(!s){if(i("throwDeprecation"))throw new Error(o);i("traceDeprecation")?console.trace(o):console.warn(o),s=!0}return a.apply(this,arguments)}return l}function i(a){try{if(!window.localStorage)return!1}catch{return!1}var o=window.localStorage[a];return o==null?!1:String(o).toLowerCase()==="true"}}}),TC=de({"node_modules/readable-stream/lib/_stream_writable.js"(e,r){"use strict";r.exports=A;function t(N){var H=this;this.next=null,this.entry=null,this.finish=function(){J(H,N)}}var i;A.WritableState=w;var a={deprecate:ZH()},o=uC(),s=kv().Buffer,l=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function n(N){return s.from(N)}function u(N){return s.isBuffer(N)||N instanceof l}var c=bC(),f=wC(),h=f.getHighWaterMark,d=Lv().codes,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,_=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,x=d.ERR_STREAM_WRITE_AFTER_END,S=d.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;Sp()(A,o);function C(){}function w(N,H,$){i=i||Fv(),N=N||{},typeof $!="boolean"&&($=H instanceof i),this.objectMode=!!N.objectMode,$&&(this.objectMode=this.objectMode||!!N.writableObjectMode),this.highWaterMark=h(this,N,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=N.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){z(H,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=N.emitClose!==!1,this.autoDestroy=!!N.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}w.prototype.getBuffer=function(){for(var H=this.bufferedRequest,$=[];H;)$.push(H),H=H.next;return $},(function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var k;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(k=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(H){return k.call(this,H)?!0:this!==A?!1:H&&H._writableState instanceof w}})):k=function(H){return H instanceof this};function A(N){i=i||Fv();var H=this instanceof i;if(!H&&!k.call(A,this))return new A(N);this._writableState=new w(N,this,H),this.writable=!0,N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final)),o.call(this)}A.prototype.pipe=function(){M(this,new y)};function b(N,H){var $=new x;M(N,$),process.nextTick(H,$)}function E(N,H,$,U){var V;return $===null?V=new v:typeof $!="string"&&!H.objectMode&&(V=new p("chunk",["string","Buffer"],$)),V?(M(N,V),process.nextTick(U,V),!1):!0}A.prototype.write=function(N,H,$){var U=this._writableState,V=!1,j=!U.objectMode&&u(N);return j&&!s.isBuffer(N)&&(N=n(N)),typeof H=="function"&&($=H,H=null),j?H="buffer":H||(H=U.defaultEncoding),typeof $!="function"&&($=C),U.ending?b(this,$):(j||E(this,U,N,$))&&(U.pendingcb++,V=F(this,U,j,N,H,$)),V},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,!N.writing&&!N.corked&&!N.bufferProcessing&&N.bufferedRequest&&B(this,N))},A.prototype.setDefaultEncoding=function(H){if(typeof H=="string"&&(H=H.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((H+"").toLowerCase())>-1))throw new S(H);return this._writableState.defaultEncoding=H,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function T(N,H,$){return!N.objectMode&&N.decodeStrings!==!1&&typeof H=="string"&&(H=s.from(H,$)),H}Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(N,H,$,U,V,j){if(!$){var q=T(H,U,V);U!==q&&($=!0,V="buffer",U=q)}var Y=H.objectMode?1:U.length;H.length+=Y;var K=H.length>5===6?2:_>>4===14?3:_>>3===30?4:_>>6===2?-1:-2}function l(_,v,x){var S=v.length-1;if(S=0?(M>0&&(_.lastNeed=M-1),M):--S=0?(M>0&&(_.lastNeed=M-2),M):--S=0?(M>0&&(M===2?M=0:_.lastNeed=M-3),M):0))}function n(_,v,x){if((v[0]&192)!==128)return _.lastNeed=0,"\uFFFD";if(_.lastNeed>1&&v.length>1){if((v[1]&192)!==128)return _.lastNeed=1,"\uFFFD";if(_.lastNeed>2&&v.length>2&&(v[2]&192)!==128)return _.lastNeed=2,"\uFFFD"}}function u(_){var v=this.lastTotal-this.lastNeed,x=n(this,_,v);if(x!==void 0)return x;if(this.lastNeed<=_.length)return _.copy(this.lastChar,v,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,v,0,_.length),this.lastNeed-=_.length}function c(_,v){var x=l(this,_,v);if(!this.lastNeed)return _.toString("utf8",v);this.lastTotal=x;var S=_.length-(x-this.lastNeed);return _.copy(this.lastChar,0,S),_.toString("utf8",v,S)}function f(_){var v=_&&_.length?this.write(_):"";return this.lastNeed?v+"\uFFFD":v}function h(_,v){if((_.length-v)%2===0){var x=_.toString("utf16le",v);if(x){var S=x.charCodeAt(x.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",v,_.length-1)}function d(_){var v=_&&_.length?this.write(_):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return v+this.lastChar.toString("utf16le",0,x)}return v}function p(_,v){var x=(_.length-v)%3;return x===0?_.toString("base64",v):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",v,_.length-x))}function g(_){var v=_&&_.length?this.write(_):"";return this.lastNeed?v+this.lastChar.toString("base64",0,3-this.lastNeed):v}function m(_){return _.toString(this.encoding)}function y(_){return _&&_.length?this.write(_):""}}}),L3=de({"node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(e,r){"use strict";var t=Lv().codes.ERR_STREAM_PREMATURE_CLOSE;function i(l){var n=!1;return function(){if(!n){n=!0;for(var u=arguments.length,c=new Array(u),f=0;f0)if(typeof Y!="string"&&!se.objectMode&&Object.getPrototypeOf(Y)!==s.prototype&&(Y=n(Y)),te)se.endEmitted?w(q,new x):F(q,se,Y,!0);else if(se.ended)w(q,new _);else{if(se.destroyed)return!1;se.reading=!1,se.decoder&&!K?(Y=se.decoder.write(Y),se.objectMode||Y.length!==0?F(q,se,Y,!1):O(q,se)):F(q,se,Y,!1)}else te||(se.reading=!1,O(q,se))}return!se.ended&&(se.length=R?q=R:(q--,q|=q>>>1,q|=q>>>2,q|=q>>>4,q|=q>>>8,q|=q>>>16,q++),q}function z(q,Y){return q<=0||Y.length===0&&Y.ended?0:Y.objectMode?1:q!==q?Y.flowing&&Y.length?Y.buffer.head.data.length:Y.length:(q>Y.highWaterMark&&(Y.highWaterMark=P(q)),q<=Y.length?q:Y.ended?Y.length:(Y.needReadable=!0,0))}E.prototype.read=function(q){f("read",q),q=parseInt(q,10);var Y=this._readableState,K=q;if(q!==0&&(Y.emittedReadable=!1),q===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended))return f("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended?U(this):L(this),null;if(q=z(q,Y),q===0&&Y.ended)return Y.length===0&&U(this),null;var te=Y.needReadable;f("need readable",te),(Y.length===0||Y.length-q0?ne=$(q,Y):ne=null,ne===null?(Y.needReadable=Y.length<=Y.highWaterMark,q=0):(Y.length-=q,Y.awaitDrain=0),Y.length===0&&(Y.ended||(Y.needReadable=!0),K!==q&&Y.ended&&U(this)),ne!==null&&this.emit("data",ne),ne};function I(q,Y){if(f("onEofChunk"),!Y.ended){if(Y.decoder){var K=Y.decoder.end();K&&K.length&&(Y.buffer.push(K),Y.length+=Y.objectMode?1:K.length)}Y.ended=!0,Y.sync?L(q):(Y.needReadable=!1,Y.emittedReadable||(Y.emittedReadable=!0,B(q)))}}function L(q){var Y=q._readableState;f("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,Y.emittedReadable||(f("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(B,q))}function B(q){var Y=q._readableState;f("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended)&&(q.emit("readable"),Y.emittedReadable=!1),Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,H(q)}function O(q,Y){Y.readingMore||(Y.readingMore=!0,process.nextTick(G,q,Y))}function G(q,Y){for(;!Y.reading&&!Y.ended&&(Y.length1&&j(te.pipes,q)!==-1)&&!xe&&(f("false write response, pause",te.awaitDrain),te.awaitDrain++),K.pause())}function ae(ue){f("onerror",ue),Q(),q.removeListener("error",ae),a(q,"error")===0&&w(q,ue)}A(q,"error",ae);function ee(){q.removeListener("finish",ie),Q()}q.once("close",ee);function ie(){f("onfinish"),q.removeListener("close",ee),Q()}q.once("finish",ie);function Q(){f("unpipe"),K.unpipe(q)}return q.emit("pipe",K),te.flowing||(f("pipe resume"),K.resume()),q};function W(q){return function(){var K=q._readableState;f("pipeOnDrain",K.awaitDrain),K.awaitDrain&&K.awaitDrain--,K.awaitDrain===0&&a(q,"data")&&(K.flowing=!0,H(q))}}E.prototype.unpipe=function(q){var Y=this._readableState,K={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1)return q&&q!==Y.pipes?this:(q||(q=Y.pipes),Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,q&&q.emit("unpipe",this,K),this);if(!q){var te=Y.pipes,ne=Y.pipesCount;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var se=0;se0,te.flowing!==!1&&this.resume()):q==="readable"&&!te.endEmitted&&!te.readableListening&&(te.readableListening=te.needReadable=!0,te.flowing=!1,te.emittedReadable=!1,f("on readable",te.length,te.reading),te.length?L(this):te.reading||process.nextTick(Z,this)),K},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(q,Y){var K=o.prototype.removeListener.call(this,q,Y);return q==="readable"&&process.nextTick(X,this),K},E.prototype.removeAllListeners=function(q){var Y=o.prototype.removeAllListeners.apply(this,arguments);return(q==="readable"||q===void 0)&&process.nextTick(X,this),Y};function X(q){var Y=q._readableState;Y.readableListening=q.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused?Y.flowing=!0:q.listenerCount("data")>0&&q.resume()}function Z(q){f("readable nexttick read 0"),q.read(0)}E.prototype.resume=function(){var q=this._readableState;return q.flowing||(f("resume"),q.flowing=!q.readableListening,J(this,q)),q.paused=!1,this};function J(q,Y){Y.resumeScheduled||(Y.resumeScheduled=!0,process.nextTick(N,q,Y))}function N(q,Y){f("resume",Y.reading),Y.reading||q.read(0),Y.resumeScheduled=!1,q.emit("resume"),H(q),Y.flowing&&!Y.reading&&q.read(0)}E.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function H(q){var Y=q._readableState;for(f("flow",Y.flowing);Y.flowing&&q.read()!==null;);}E.prototype.wrap=function(q){var Y=this,K=this._readableState,te=!1;q.on("end",function(){if(f("wrapped end"),K.decoder&&!K.ended){var le=K.decoder.end();le&&le.length&&Y.push(le)}Y.push(null)}),q.on("data",function(le){if(f("wrapped data"),K.decoder&&(le=K.decoder.write(le)),!(K.objectMode&&le==null)&&!(!K.objectMode&&(!le||!le.length))){var ce=Y.push(le);ce||(te=!0,q.pause())}});for(var ne in q)this[ne]===void 0&&typeof q[ne]=="function"&&(this[ne]=(function(ce){return function(){return q[ce].apply(q,arguments)}})(ne));for(var se=0;se=Y.length?(Y.decoder?K=Y.buffer.join(""):Y.buffer.length===1?K=Y.buffer.first():K=Y.buffer.concat(Y.length),Y.buffer.clear()):K=Y.buffer.consume(q,Y.decoder),K}function U(q){var Y=q._readableState;f("endReadable",Y.endEmitted),Y.endEmitted||(Y.ended=!0,process.nextTick(V,Y,q))}function V(q,Y){if(f("endReadableNT",q.endEmitted,q.length),!q.endEmitted&&q.length===0&&(q.endEmitted=!0,Y.readable=!1,Y.emit("end"),q.autoDestroy)){var K=Y._writableState;(!K||K.autoDestroy&&K.finished)&&Y.destroy()}}typeof Symbol=="function"&&(E.from=function(q,Y){return C===void 0&&(C=QH()),C(E,q,Y)});function j(q,Y){for(var K=0,te=q.length;K0;return u(x,M,C,function(w){_||(_=w),w&&v.forEach(c),!M&&(v.forEach(c),y(_))})});return g.reduce(f)}r.exports=d}}),r$=de({"node_modules/stream-browserify/index.js"(e,r){r.exports=a;var t=yv().EventEmitter,i=Sp();i(a,t),a.Readable=MC(),a.Writable=TC(),a.Duplex=Fv(),a.Transform=SC(),a.PassThrough=e$(),a.finished=L3(),a.pipeline=t$(),a.Stream=a;function a(){t.call(this)}a.prototype.pipe=function(o,s){var l=this;function n(g){o.writable&&o.write(g)===!1&&l.pause&&l.pause()}l.on("data",n);function u(){l.readable&&l.resume&&l.resume()}o.on("drain",u),!o._isStdio&&(!s||s.end!==!1)&&(l.on("end",f),l.on("close",h));var c=!1;function f(){c||(c=!0,o.end())}function h(){c||(c=!0,typeof o.destroy=="function"&&o.destroy())}function d(g){if(p(),t.listenerCount(this,"error")===0)throw g}l.on("error",d),o.on("error",d);function p(){l.removeListener("data",n),o.removeListener("drain",u),l.removeListener("end",f),l.removeListener("close",h),l.removeListener("error",d),o.removeListener("error",d),l.removeListener("end",p),l.removeListener("close",p),o.removeListener("close",p)}return l.on("end",p),l.on("close",p),o.on("close",p),o.emit("pipe",l),o}}}),S1=de({"node_modules/util/util.js"(e){var r=Object.getOwnPropertyDescriptors||function(G){for(var W=Object.keys(G),X={},Z=0;Z=Z)return H;switch(H){case"%s":return String(X[W++]);case"%d":return Number(X[W++]);case"%j":try{return JSON.stringify(X[W++])}catch{return"[Circular]"}default:return H}}),N=X[W];W"u")return function(){return e.deprecate(O,G).apply(this,arguments)};var W=!1;function X(){if(!W){if(process.throwDeprecation)throw new Error(G);process.traceDeprecation?console.trace(G):console.error(G),W=!0}return O.apply(this,arguments)}return X};var i={},a=/^$/;o="false",o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i");var o;e.debuglog=function(O){if(O=O.toUpperCase(),!i[O])if(a.test(O)){var G=process.pid;i[O]=function(){var W=e.format.apply(e,arguments);console.error("%s %d: %s",O,G,W)}}else i[O]=function(){};return i[O]};function s(O,G){var W={seen:[],stylize:n};return arguments.length>=3&&(W.depth=arguments[2]),arguments.length>=4&&(W.colors=arguments[3]),y(G)?W.showHidden=G:G&&e._extend(W,G),C(W.showHidden)&&(W.showHidden=!1),C(W.depth)&&(W.depth=2),C(W.colors)&&(W.colors=!1),C(W.customInspect)&&(W.customInspect=!0),W.colors&&(W.stylize=l),c(W,O,W.depth)}e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(O,G){var W=s.styles[G];return W?"\x1B["+s.colors[W][0]+"m"+O+"\x1B["+s.colors[W][1]+"m":O}function n(O,G){return O}function u(O){var G={};return O.forEach(function(W,X){G[W]=!0}),G}function c(O,G,W){if(O.customInspect&&G&&E(G.inspect)&&G.inspect!==e.inspect&&!(G.constructor&&G.constructor.prototype===G)){var X=G.inspect(W,O);return S(X)||(X=c(O,X,W)),X}var Z=f(O,G);if(Z)return Z;var J=Object.keys(G),N=u(J);if(O.showHidden&&(J=Object.getOwnPropertyNames(G)),b(G)&&(J.indexOf("message")>=0||J.indexOf("description")>=0))return h(G);if(J.length===0){if(E(G)){var H=G.name?": "+G.name:"";return O.stylize("[Function"+H+"]","special")}if(w(G))return O.stylize(RegExp.prototype.toString.call(G),"regexp");if(A(G))return O.stylize(Date.prototype.toString.call(G),"date");if(b(G))return h(G)}var $="",U=!1,V=["{","}"];if(m(G)&&(U=!0,V=["[","]"]),E(G)){var j=G.name?": "+G.name:"";$=" [Function"+j+"]"}if(w(G)&&($=" "+RegExp.prototype.toString.call(G)),A(G)&&($=" "+Date.prototype.toUTCString.call(G)),b(G)&&($=" "+h(G)),J.length===0&&(!U||G.length==0))return V[0]+$+V[1];if(W<0)return w(G)?O.stylize(RegExp.prototype.toString.call(G),"regexp"):O.stylize("[Object]","special");O.seen.push(G);var q;return U?q=d(O,G,W,N,J):q=J.map(function(Y){return p(O,G,W,N,Y,U)}),O.seen.pop(),g(q,$,V)}function f(O,G){if(C(G))return O.stylize("undefined","undefined");if(S(G)){var W="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return O.stylize(W,"string")}if(x(G))return O.stylize(""+G,"number");if(y(G))return O.stylize(""+G,"boolean");if(_(G))return O.stylize("null","null")}function h(O){return"["+Error.prototype.toString.call(O)+"]"}function d(O,G,W,X,Z){for(var J=[],N=0,H=G.length;N"u"}e.isPrimitive=T,e.isBuffer=_C();function F(O){return Object.prototype.toString.call(O)}function D(O){return O<10?"0"+O.toString(10):O.toString(10)}var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var O=new Date,G=[D(O.getHours()),D(O.getMinutes()),D(O.getSeconds())].join(":");return[O.getDate(),R[O.getMonth()],G].join(" ")}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=Ep(),e._extend=function(O,G){if(!G||!k(G))return O;for(var W=Object.keys(G),X=W.length;X--;)O[W[X]]=G[W[X]];return O};function z(O,G){return Object.prototype.hasOwnProperty.call(O,G)}var I=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(I&&G[I]){var W=G[I];if(typeof W!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(W,I,{value:W,enumerable:!1,writable:!1,configurable:!0}),W}function W(){for(var X,Z,J=new Promise(function($,U){X=$,Z=U}),N=[],H=0;H0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(_){var v={data:_,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var _=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,_}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(_){if(this.length===0)return"";for(var v=this.head,x=""+v.data;v=v.next;)x+=_+v.data;return x}},{key:"concat",value:function(_){if(this.length===0)return f.alloc(0);for(var v=f.allocUnsafe(_>>>0),x=this.head,S=0;x;)g(x.data,v,S),S+=x.data.length,x=x.next;return v}},{key:"consume",value:function(_,v){var x;return _M.length?M.length:_;if(C===M.length?S+=M:S+=M.slice(0,_),_-=C,_===0){C===M.length?(++x,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=M.slice(C));break}++x}return this.length-=x,S}},{key:"_getBuffer",value:function(_){var v=f.allocUnsafe(_),x=this.head,S=1;for(x.data.copy(v),_-=x.data.length;x=x.next;){var M=x.data,C=_>M.length?M.length:_;if(M.copy(v,v.length-_,0,C),_-=C,_===0){C===M.length?(++S,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=M.slice(C));break}++S}return this.length-=S,v}},{key:p,value:function(_,v){return d(this,i(i({},v),{},{depth:0,customInspect:!1}))}}]),m})()}}),bC=de({"node_modules/readable-stream/lib/internal/streams/destroy.js"(e,r){"use strict";function t(n,u){var c=this,f=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return f||h?(u?u(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(s,this,n)):process.nextTick(s,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(d){!u&&d?c._writableState?c._writableState.errorEmitted?process.nextTick(a,c):(c._writableState.errorEmitted=!0,process.nextTick(i,c,d)):process.nextTick(i,c,d):u?(process.nextTick(a,c),u(d)):process.nextTick(a,c)}),this)}function i(n,u){s(n,u),a(n)}function a(n){n._writableState&&!n._writableState.emitClose||n._readableState&&!n._readableState.emitClose||n.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(n,u){n.emit("error",u)}function l(n,u){var c=n._readableState,f=n._writableState;c&&c.autoDestroy||f&&f.autoDestroy?n.destroy(u):n.emit("error",u)}r.exports={destroy:t,undestroy:o,errorOrDestroy:l}}}),Fv=de({"node_modules/readable-stream/errors-browser.js"(e,r){"use strict";function t(u,c){u.prototype=Object.create(c.prototype),u.prototype.constructor=u,u.__proto__=c}var i={};function a(u,c,f){f||(f=Error);function h(p,g,m){return typeof c=="string"?c:c(p,g,m)}var d=(function(p){t(g,p);function g(m,y,_){return p.call(this,h(m,y,_))||this}return g})(f);d.prototype.name=f.name,d.prototype.code=u,i[u]=d}function o(u,c){if(Array.isArray(u)){var f=u.length;return u=u.map(function(h){return String(h)}),f>2?"one of ".concat(c," ").concat(u.slice(0,f-1).join(", "),", or ")+u[f-1]:f===2?"one of ".concat(c," ").concat(u[0]," or ").concat(u[1]):"of ".concat(c," ").concat(u[0])}else return"of ".concat(c," ").concat(String(u))}function s(u,c,f){return u.substr(!f||f<0?0:+f,c.length)===c}function l(u,c,f){return(f===void 0||f>u.length)&&(f=u.length),u.substring(f-c.length,f)===c}function n(u,c,f){return typeof f!="number"&&(f=0),f+c.length>u.length?!1:u.indexOf(c,f)!==-1}a("ERR_INVALID_OPT_VALUE",function(u,c){return'The value "'+c+'" is invalid for option "'+u+'"'},TypeError),a("ERR_INVALID_ARG_TYPE",function(u,c,f){var h;typeof c=="string"&&s(c,"not ")?(h="must not be",c=c.replace(/^not /,"")):h="must be";var d;if(l(u," argument"))d="The ".concat(u," ").concat(h," ").concat(o(c,"type"));else{var p=n(u,".")?"property":"argument";d='The "'.concat(u,'" ').concat(p," ").concat(h," ").concat(o(c,"type"))}return d+=". Received type ".concat(typeof f),d},TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),r.exports.codes=i}}),wC=de({"node_modules/readable-stream/lib/internal/streams/state.js"(e,r){"use strict";var t=Fv().codes.ERR_INVALID_OPT_VALUE;function i(o,s,l){return o.highWaterMark!=null?o.highWaterMark:s?o[l]:null}function a(o,s,l,n){var u=i(s,n,l);if(u!=null){if(!(isFinite(u)&&Math.floor(u)===u)||u<0){var c=n?l:"highWaterMark";throw new t(c,u)}return Math.floor(u)}return o.objectMode?16:16*1024}r.exports={getHighWaterMark:a}}}),ZH=de({"node_modules/util-deprecate/browser.js"(e,r){r.exports=t;function t(a,o){if(i("noDeprecation"))return a;var s=!1;function l(){if(!s){if(i("throwDeprecation"))throw new Error(o);i("traceDeprecation")?console.trace(o):console.warn(o),s=!0}return a.apply(this,arguments)}return l}function i(a){try{if(!window.localStorage)return!1}catch{return!1}var o=window.localStorage[a];return o==null?!1:String(o).toLowerCase()==="true"}}}),TC=de({"node_modules/readable-stream/lib/_stream_writable.js"(e,r){"use strict";r.exports=A;function t(N){var H=this;this.next=null,this.entry=null,this.finish=function(){J(H,N)}}var i;A.WritableState=w;var a={deprecate:ZH()},o=uC(),s=Cv().Buffer,l=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function n(N){return s.from(N)}function u(N){return s.isBuffer(N)||N instanceof l}var c=bC(),f=wC(),h=f.getHighWaterMark,d=Fv().codes,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,_=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,x=d.ERR_STREAM_WRITE_AFTER_END,S=d.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;Ep()(A,o);function C(){}function w(N,H,$){i=i||Pv(),N=N||{},typeof $!="boolean"&&($=H instanceof i),this.objectMode=!!N.objectMode,$&&(this.objectMode=this.objectMode||!!N.writableObjectMode),this.highWaterMark=h(this,N,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=N.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){z(H,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=N.emitClose!==!1,this.autoDestroy=!!N.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}w.prototype.getBuffer=function(){for(var H=this.bufferedRequest,$=[];H;)$.push(H),H=H.next;return $},(function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var k;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(k=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(H){return k.call(this,H)?!0:this!==A?!1:H&&H._writableState instanceof w}})):k=function(H){return H instanceof this};function A(N){i=i||Pv();var H=this instanceof i;if(!H&&!k.call(A,this))return new A(N);this._writableState=new w(N,this,H),this.writable=!0,N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final)),o.call(this)}A.prototype.pipe=function(){M(this,new y)};function b(N,H){var $=new x;M(N,$),process.nextTick(H,$)}function E(N,H,$,U){var V;return $===null?V=new v:typeof $!="string"&&!H.objectMode&&(V=new p("chunk",["string","Buffer"],$)),V?(M(N,V),process.nextTick(U,V),!1):!0}A.prototype.write=function(N,H,$){var U=this._writableState,V=!1,j=!U.objectMode&&u(N);return j&&!s.isBuffer(N)&&(N=n(N)),typeof H=="function"&&($=H,H=null),j?H="buffer":H||(H=U.defaultEncoding),typeof $!="function"&&($=C),U.ending?b(this,$):(j||E(this,U,N,$))&&(U.pendingcb++,V=F(this,U,j,N,H,$)),V},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,!N.writing&&!N.corked&&!N.bufferProcessing&&N.bufferedRequest&&B(this,N))},A.prototype.setDefaultEncoding=function(H){if(typeof H=="string"&&(H=H.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((H+"").toLowerCase())>-1))throw new S(H);return this._writableState.defaultEncoding=H,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function T(N,H,$){return!N.objectMode&&N.decodeStrings!==!1&&typeof H=="string"&&(H=s.from(H,$)),H}Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F(N,H,$,U,V,j){if(!$){var q=T(H,U,V);U!==q&&($=!0,V="buffer",U=q)}var Y=H.objectMode?1:U.length;H.length+=Y;var K=H.length>5===6?2:_>>4===14?3:_>>3===30?4:_>>6===2?-1:-2}function l(_,v,x){var S=v.length-1;if(S=0?(M>0&&(_.lastNeed=M-1),M):--S=0?(M>0&&(_.lastNeed=M-2),M):--S=0?(M>0&&(M===2?M=0:_.lastNeed=M-3),M):0))}function n(_,v,x){if((v[0]&192)!==128)return _.lastNeed=0,"\uFFFD";if(_.lastNeed>1&&v.length>1){if((v[1]&192)!==128)return _.lastNeed=1,"\uFFFD";if(_.lastNeed>2&&v.length>2&&(v[2]&192)!==128)return _.lastNeed=2,"\uFFFD"}}function u(_){var v=this.lastTotal-this.lastNeed,x=n(this,_,v);if(x!==void 0)return x;if(this.lastNeed<=_.length)return _.copy(this.lastChar,v,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,v,0,_.length),this.lastNeed-=_.length}function c(_,v){var x=l(this,_,v);if(!this.lastNeed)return _.toString("utf8",v);this.lastTotal=x;var S=_.length-(x-this.lastNeed);return _.copy(this.lastChar,0,S),_.toString("utf8",v,S)}function f(_){var v=_&&_.length?this.write(_):"";return this.lastNeed?v+"\uFFFD":v}function h(_,v){if((_.length-v)%2===0){var x=_.toString("utf16le",v);if(x){var S=x.charCodeAt(x.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",v,_.length-1)}function d(_){var v=_&&_.length?this.write(_):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return v+this.lastChar.toString("utf16le",0,x)}return v}function p(_,v){var x=(_.length-v)%3;return x===0?_.toString("base64",v):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",v,_.length-x))}function g(_){var v=_&&_.length?this.write(_):"";return this.lastNeed?v+this.lastChar.toString("base64",0,3-this.lastNeed):v}function m(_){return _.toString(this.encoding)}function y(_){return _&&_.length?this.write(_):""}}}),L3=de({"node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(e,r){"use strict";var t=Fv().codes.ERR_STREAM_PREMATURE_CLOSE;function i(l){var n=!1;return function(){if(!n){n=!0;for(var u=arguments.length,c=new Array(u),f=0;f0)if(typeof Y!="string"&&!se.objectMode&&Object.getPrototypeOf(Y)!==s.prototype&&(Y=n(Y)),te)se.endEmitted?w(q,new x):F(q,se,Y,!0);else if(se.ended)w(q,new _);else{if(se.destroyed)return!1;se.reading=!1,se.decoder&&!K?(Y=se.decoder.write(Y),se.objectMode||Y.length!==0?F(q,se,Y,!1):O(q,se)):F(q,se,Y,!1)}else te||(se.reading=!1,O(q,se))}return!se.ended&&(se.length=R?q=R:(q--,q|=q>>>1,q|=q>>>2,q|=q>>>4,q|=q>>>8,q|=q>>>16,q++),q}function z(q,Y){return q<=0||Y.length===0&&Y.ended?0:Y.objectMode?1:q!==q?Y.flowing&&Y.length?Y.buffer.head.data.length:Y.length:(q>Y.highWaterMark&&(Y.highWaterMark=P(q)),q<=Y.length?q:Y.ended?Y.length:(Y.needReadable=!0,0))}E.prototype.read=function(q){f("read",q),q=parseInt(q,10);var Y=this._readableState,K=q;if(q!==0&&(Y.emittedReadable=!1),q===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended))return f("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended?U(this):L(this),null;if(q=z(q,Y),q===0&&Y.ended)return Y.length===0&&U(this),null;var te=Y.needReadable;f("need readable",te),(Y.length===0||Y.length-q0?ne=$(q,Y):ne=null,ne===null?(Y.needReadable=Y.length<=Y.highWaterMark,q=0):(Y.length-=q,Y.awaitDrain=0),Y.length===0&&(Y.ended||(Y.needReadable=!0),K!==q&&Y.ended&&U(this)),ne!==null&&this.emit("data",ne),ne};function I(q,Y){if(f("onEofChunk"),!Y.ended){if(Y.decoder){var K=Y.decoder.end();K&&K.length&&(Y.buffer.push(K),Y.length+=Y.objectMode?1:K.length)}Y.ended=!0,Y.sync?L(q):(Y.needReadable=!1,Y.emittedReadable||(Y.emittedReadable=!0,B(q)))}}function L(q){var Y=q._readableState;f("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,Y.emittedReadable||(f("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(B,q))}function B(q){var Y=q._readableState;f("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended)&&(q.emit("readable"),Y.emittedReadable=!1),Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,H(q)}function O(q,Y){Y.readingMore||(Y.readingMore=!0,process.nextTick(G,q,Y))}function G(q,Y){for(;!Y.reading&&!Y.ended&&(Y.length1&&j(te.pipes,q)!==-1)&&!xe&&(f("false write response, pause",te.awaitDrain),te.awaitDrain++),K.pause())}function ae(ue){f("onerror",ue),Q(),q.removeListener("error",ae),a(q,"error")===0&&w(q,ue)}A(q,"error",ae);function ee(){q.removeListener("finish",ie),Q()}q.once("close",ee);function ie(){f("onfinish"),q.removeListener("close",ee),Q()}q.once("finish",ie);function Q(){f("unpipe"),K.unpipe(q)}return q.emit("pipe",K),te.flowing||(f("pipe resume"),K.resume()),q};function W(q){return function(){var K=q._readableState;f("pipeOnDrain",K.awaitDrain),K.awaitDrain&&K.awaitDrain--,K.awaitDrain===0&&a(q,"data")&&(K.flowing=!0,H(q))}}E.prototype.unpipe=function(q){var Y=this._readableState,K={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1)return q&&q!==Y.pipes?this:(q||(q=Y.pipes),Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,q&&q.emit("unpipe",this,K),this);if(!q){var te=Y.pipes,ne=Y.pipesCount;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var se=0;se0,te.flowing!==!1&&this.resume()):q==="readable"&&!te.endEmitted&&!te.readableListening&&(te.readableListening=te.needReadable=!0,te.flowing=!1,te.emittedReadable=!1,f("on readable",te.length,te.reading),te.length?L(this):te.reading||process.nextTick(Z,this)),K},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(q,Y){var K=o.prototype.removeListener.call(this,q,Y);return q==="readable"&&process.nextTick(X,this),K},E.prototype.removeAllListeners=function(q){var Y=o.prototype.removeAllListeners.apply(this,arguments);return(q==="readable"||q===void 0)&&process.nextTick(X,this),Y};function X(q){var Y=q._readableState;Y.readableListening=q.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused?Y.flowing=!0:q.listenerCount("data")>0&&q.resume()}function Z(q){f("readable nexttick read 0"),q.read(0)}E.prototype.resume=function(){var q=this._readableState;return q.flowing||(f("resume"),q.flowing=!q.readableListening,J(this,q)),q.paused=!1,this};function J(q,Y){Y.resumeScheduled||(Y.resumeScheduled=!0,process.nextTick(N,q,Y))}function N(q,Y){f("resume",Y.reading),Y.reading||q.read(0),Y.resumeScheduled=!1,q.emit("resume"),H(q),Y.flowing&&!Y.reading&&q.read(0)}E.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function H(q){var Y=q._readableState;for(f("flow",Y.flowing);Y.flowing&&q.read()!==null;);}E.prototype.wrap=function(q){var Y=this,K=this._readableState,te=!1;q.on("end",function(){if(f("wrapped end"),K.decoder&&!K.ended){var le=K.decoder.end();le&&le.length&&Y.push(le)}Y.push(null)}),q.on("data",function(le){if(f("wrapped data"),K.decoder&&(le=K.decoder.write(le)),!(K.objectMode&&le==null)&&!(!K.objectMode&&(!le||!le.length))){var ce=Y.push(le);ce||(te=!0,q.pause())}});for(var ne in q)this[ne]===void 0&&typeof q[ne]=="function"&&(this[ne]=(function(ce){return function(){return q[ce].apply(q,arguments)}})(ne));for(var se=0;se=Y.length?(Y.decoder?K=Y.buffer.join(""):Y.buffer.length===1?K=Y.buffer.first():K=Y.buffer.concat(Y.length),Y.buffer.clear()):K=Y.buffer.consume(q,Y.decoder),K}function U(q){var Y=q._readableState;f("endReadable",Y.endEmitted),Y.endEmitted||(Y.ended=!0,process.nextTick(V,Y,q))}function V(q,Y){if(f("endReadableNT",q.endEmitted,q.length),!q.endEmitted&&q.length===0&&(q.endEmitted=!0,Y.readable=!1,Y.emit("end"),q.autoDestroy)){var K=Y._writableState;(!K||K.autoDestroy&&K.finished)&&Y.destroy()}}typeof Symbol=="function"&&(E.from=function(q,Y){return C===void 0&&(C=QH()),C(E,q,Y)});function j(q,Y){for(var K=0,te=q.length;K0;return u(x,M,C,function(w){_||(_=w),w&&v.forEach(c),!M&&(v.forEach(c),y(_))})});return g.reduce(f)}r.exports=d}}),r$=de({"node_modules/stream-browserify/index.js"(e,r){r.exports=a;var t=_v().EventEmitter,i=Ep();i(a,t),a.Readable=MC(),a.Writable=TC(),a.Duplex=Pv(),a.Transform=SC(),a.PassThrough=e$(),a.finished=L3(),a.pipeline=t$(),a.Stream=a;function a(){t.call(this)}a.prototype.pipe=function(o,s){var l=this;function n(g){o.writable&&o.write(g)===!1&&l.pause&&l.pause()}l.on("data",n);function u(){l.readable&&l.resume&&l.resume()}o.on("drain",u),!o._isStdio&&(!s||s.end!==!1)&&(l.on("end",f),l.on("close",h));var c=!1;function f(){c||(c=!0,o.end())}function h(){c||(c=!0,typeof o.destroy=="function"&&o.destroy())}function d(g){if(p(),t.listenerCount(this,"error")===0)throw g}l.on("error",d),o.on("error",d);function p(){l.removeListener("data",n),o.removeListener("drain",u),l.removeListener("end",f),l.removeListener("close",h),l.removeListener("error",d),o.removeListener("error",d),l.removeListener("end",p),l.removeListener("close",p),o.removeListener("close",p)}return l.on("end",p),l.on("close",p),o.on("close",p),o.emit("pipe",l),o}}}),E1=de({"node_modules/util/util.js"(e){var r=Object.getOwnPropertyDescriptors||function(G){for(var W=Object.keys(G),X={},Z=0;Z=Z)return H;switch(H){case"%s":return String(X[W++]);case"%d":return Number(X[W++]);case"%j":try{return JSON.stringify(X[W++])}catch{return"[Circular]"}default:return H}}),N=X[W];W"u")return function(){return e.deprecate(O,G).apply(this,arguments)};var W=!1;function X(){if(!W){if(process.throwDeprecation)throw new Error(G);process.traceDeprecation?console.trace(G):console.error(G),W=!0}return O.apply(this,arguments)}return X};var i={},a=/^$/;o="false",o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+o+"$","i");var o;e.debuglog=function(O){if(O=O.toUpperCase(),!i[O])if(a.test(O)){var G=process.pid;i[O]=function(){var W=e.format.apply(e,arguments);console.error("%s %d: %s",O,G,W)}}else i[O]=function(){};return i[O]};function s(O,G){var W={seen:[],stylize:n};return arguments.length>=3&&(W.depth=arguments[2]),arguments.length>=4&&(W.colors=arguments[3]),y(G)?W.showHidden=G:G&&e._extend(W,G),C(W.showHidden)&&(W.showHidden=!1),C(W.depth)&&(W.depth=2),C(W.colors)&&(W.colors=!1),C(W.customInspect)&&(W.customInspect=!0),W.colors&&(W.stylize=l),c(W,O,W.depth)}e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(O,G){var W=s.styles[G];return W?"\x1B["+s.colors[W][0]+"m"+O+"\x1B["+s.colors[W][1]+"m":O}function n(O,G){return O}function u(O){var G={};return O.forEach(function(W,X){G[W]=!0}),G}function c(O,G,W){if(O.customInspect&&G&&E(G.inspect)&&G.inspect!==e.inspect&&!(G.constructor&&G.constructor.prototype===G)){var X=G.inspect(W,O);return S(X)||(X=c(O,X,W)),X}var Z=f(O,G);if(Z)return Z;var J=Object.keys(G),N=u(J);if(O.showHidden&&(J=Object.getOwnPropertyNames(G)),b(G)&&(J.indexOf("message")>=0||J.indexOf("description")>=0))return h(G);if(J.length===0){if(E(G)){var H=G.name?": "+G.name:"";return O.stylize("[Function"+H+"]","special")}if(w(G))return O.stylize(RegExp.prototype.toString.call(G),"regexp");if(A(G))return O.stylize(Date.prototype.toString.call(G),"date");if(b(G))return h(G)}var $="",U=!1,V=["{","}"];if(m(G)&&(U=!0,V=["[","]"]),E(G)){var j=G.name?": "+G.name:"";$=" [Function"+j+"]"}if(w(G)&&($=" "+RegExp.prototype.toString.call(G)),A(G)&&($=" "+Date.prototype.toUTCString.call(G)),b(G)&&($=" "+h(G)),J.length===0&&(!U||G.length==0))return V[0]+$+V[1];if(W<0)return w(G)?O.stylize(RegExp.prototype.toString.call(G),"regexp"):O.stylize("[Object]","special");O.seen.push(G);var q;return U?q=d(O,G,W,N,J):q=J.map(function(Y){return p(O,G,W,N,Y,U)}),O.seen.pop(),g(q,$,V)}function f(O,G){if(C(G))return O.stylize("undefined","undefined");if(S(G)){var W="'"+JSON.stringify(G).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return O.stylize(W,"string")}if(x(G))return O.stylize(""+G,"number");if(y(G))return O.stylize(""+G,"boolean");if(_(G))return O.stylize("null","null")}function h(O){return"["+Error.prototype.toString.call(O)+"]"}function d(O,G,W,X,Z){for(var J=[],N=0,H=G.length;N-1&&(J?H=H.split(` `).map(function(U){return" "+U}).join(` `).slice(2):H=` @@ -26,7 +26,7 @@ var Dce=Object.create;var xj=Object.defineProperty;var Lce=Object.getOwnProperty `))):H=O.stylize("[Circular]","special")),C(N)){if(J&&Z.match(/^\d+$/))return H;N=JSON.stringify(""+Z),N.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(N=N.slice(1,-1),N=O.stylize(N,"name")):(N=N.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),N=O.stylize(N,"string"))}return N+": "+H}function g(O,G,W){var X=0,Z=O.reduce(function(J,N){return X++,N.indexOf(` `)>=0&&X++,J+N.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Z>60?W[0]+(G===""?"":G+` `)+" "+O.join(`, - `)+" "+W[1]:W[0]+G+" "+O.join(", ")+" "+W[1]}e.types=yC();function m(O){return Array.isArray(O)}e.isArray=m;function y(O){return typeof O=="boolean"}e.isBoolean=y;function _(O){return O===null}e.isNull=_;function v(O){return O==null}e.isNullOrUndefined=v;function x(O){return typeof O=="number"}e.isNumber=x;function S(O){return typeof O=="string"}e.isString=S;function M(O){return typeof O=="symbol"}e.isSymbol=M;function C(O){return O===void 0}e.isUndefined=C;function w(O){return k(O)&&F(O)==="[object RegExp]"}e.isRegExp=w,e.types.isRegExp=w;function k(O){return typeof O=="object"&&O!==null}e.isObject=k;function A(O){return k(O)&&F(O)==="[object Date]"}e.isDate=A,e.types.isDate=A;function b(O){return k(O)&&(F(O)==="[object Error]"||O instanceof Error)}e.isError=b,e.types.isNativeError=b;function E(O){return typeof O=="function"}e.isFunction=E;function T(O){return O===null||typeof O=="boolean"||typeof O=="number"||typeof O=="string"||typeof O=="symbol"||typeof O>"u"}e.isPrimitive=T,e.isBuffer=_C();function F(O){return Object.prototype.toString.call(O)}function D(O){return O<10?"0"+O.toString(10):O.toString(10)}var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var O=new Date,G=[D(O.getHours()),D(O.getMinutes()),D(O.getSeconds())].join(":");return[O.getDate(),R[O.getMonth()],G].join(" ")}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=Sp(),e._extend=function(O,G){if(!G||!k(G))return O;for(var W=Object.keys(G),X=W.length;X--;)O[W[X]]=G[W[X]];return O};function z(O,G){return Object.prototype.hasOwnProperty.call(O,G)}var I=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(I&&G[I]){var W=G[I];if(typeof W!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(W,I,{value:W,enumerable:!1,writable:!1,configurable:!0}),W}function W(){for(var X,Z,J=new Promise(function($,U){X=$,Z=U}),N=[],H=0;H"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function p(C){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(k){return k.__proto__||Object.getPrototypeOf(k)},p(C)}var g={},m,y;function _(C,w,k){k||(k=Error);function A(E,T,F){return typeof w=="string"?w:w(E,T,F)}var b=(function(E){n(F,E);var T=c(F);function F(D,R,P){var z;return l(this,F),z=T.call(this,A(D,R,P)),z.code=C,z}return a(F)})(k);g[C]=b}function v(C,w){if(Array.isArray(C)){var k=C.length;return C=C.map(function(A){return String(A)}),k>2?"one of ".concat(w," ").concat(C.slice(0,k-1).join(", "),", or ")+C[k-1]:k===2?"one of ".concat(w," ").concat(C[0]," or ").concat(C[1]):"of ".concat(w," ").concat(C[0])}else return"of ".concat(w," ").concat(String(C))}function x(C,w,k){return C.substr(!k||k<0?0:+k,w.length)===w}function S(C,w,k){return(k===void 0||k>C.length)&&(k=C.length),C.substring(k-w.length,k)===w}function M(C,w,k){return typeof k!="number"&&(k=0),k+w.length>C.length?!1:C.indexOf(w,k)!==-1}_("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),_("ERR_INVALID_ARG_TYPE",function(C,w,k){m===void 0&&(m=P3()),m(typeof C=="string","'name' must be a string");var A;typeof w=="string"&&x(w,"not ")?(A="must not be",w=w.replace(/^not /,"")):A="must be";var b;if(S(C," argument"))b="The ".concat(C," ").concat(A," ").concat(v(w,"type"));else{var E=M(C,".")?"property":"argument";b='The "'.concat(C,'" ').concat(E," ").concat(A," ").concat(v(w,"type"))}return b+=". Received type ".concat(t(k)),b},TypeError),_("ERR_INVALID_ARG_VALUE",function(C,w){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=S1());var A=y.inspect(w);return A.length>128&&(A="".concat(A.slice(0,128),"...")),"The argument '".concat(C,"' ").concat(k,". Received ").concat(A)},TypeError,RangeError),_("ERR_INVALID_RETURN_VALUE",function(C,w,k){var A;return k&&k.constructor&&k.constructor.name?A="instance of ".concat(k.constructor.name):A="type ".concat(t(k)),"Expected ".concat(C,' to be returned from the "').concat(w,'"')+" function but got ".concat(A,".")},TypeError),_("ERR_MISSING_ARGS",function(){for(var C=arguments.length,w=new Array(C),k=0;k0,"At least one arg needs to be specified");var A="The ",b=w.length;switch(w=w.map(function(E){return'"'.concat(E,'"')}),b){case 1:A+="".concat(w[0]," argument");break;case 2:A+="".concat(w[0]," and ").concat(w[1]," arguments");break;default:A+=w.slice(0,b-1).join(", "),A+=", and ".concat(w[b-1]," arguments");break}return"".concat(A," must be specified")},TypeError),r.exports.codes=g}}),i$=de({"node_modules/assert/build/internal/assert/assertion_error.js"(e,r){"use strict";function t(B,O){var G=Object.keys(B);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(B);O&&(W=W.filter(function(X){return Object.getOwnPropertyDescriptor(B,X).enumerable})),G.push.apply(G,W)}return G}function i(B){for(var O=1;O"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y(B){return Function.toString.call(B).indexOf("[native code]")!==-1}function _(B,O){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(W,X){return W.__proto__=X,W},_(B,O)}function v(B){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(G){return G.__proto__||Object.getPrototypeOf(G)},v(B)}function x(B){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},x(B)}var S=S1(),M=S.inspect,C=EC(),w=C.codes.ERR_INVALID_ARG_TYPE;function k(B,O,G){return(G===void 0||G>B.length)&&(G=B.length),B.substring(G-O.length,G)===O}function A(B,O){if(O=Math.floor(O),B.length==0||O==0)return"";var G=B.length*O;for(O=Math.floor(Math.log(O)/Math.log(2));O;)B+=B,O--;return B+=B.substring(0,G-B.length),B}var b="",E="",T="",F="",D={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},R=10;function P(B){var O=Object.keys(B),G=Object.create(Object.getPrototypeOf(B));return O.forEach(function(W){G[W]=B[W]}),Object.defineProperty(G,"message",{value:B.message}),G}function z(B){return M(B,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function I(B,O,G){var W="",X="",Z=0,J="",N=!1,H=z(B),$=H.split(` + `)+" "+W[1]:W[0]+G+" "+O.join(", ")+" "+W[1]}e.types=yC();function m(O){return Array.isArray(O)}e.isArray=m;function y(O){return typeof O=="boolean"}e.isBoolean=y;function _(O){return O===null}e.isNull=_;function v(O){return O==null}e.isNullOrUndefined=v;function x(O){return typeof O=="number"}e.isNumber=x;function S(O){return typeof O=="string"}e.isString=S;function M(O){return typeof O=="symbol"}e.isSymbol=M;function C(O){return O===void 0}e.isUndefined=C;function w(O){return k(O)&&F(O)==="[object RegExp]"}e.isRegExp=w,e.types.isRegExp=w;function k(O){return typeof O=="object"&&O!==null}e.isObject=k;function A(O){return k(O)&&F(O)==="[object Date]"}e.isDate=A,e.types.isDate=A;function b(O){return k(O)&&(F(O)==="[object Error]"||O instanceof Error)}e.isError=b,e.types.isNativeError=b;function E(O){return typeof O=="function"}e.isFunction=E;function T(O){return O===null||typeof O=="boolean"||typeof O=="number"||typeof O=="string"||typeof O=="symbol"||typeof O>"u"}e.isPrimitive=T,e.isBuffer=_C();function F(O){return Object.prototype.toString.call(O)}function D(O){return O<10?"0"+O.toString(10):O.toString(10)}var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var O=new Date,G=[D(O.getHours()),D(O.getMinutes()),D(O.getSeconds())].join(":");return[O.getDate(),R[O.getMonth()],G].join(" ")}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=Ep(),e._extend=function(O,G){if(!G||!k(G))return O;for(var W=Object.keys(G),X=W.length;X--;)O[W[X]]=G[W[X]];return O};function z(O,G){return Object.prototype.hasOwnProperty.call(O,G)}var I=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(I&&G[I]){var W=G[I];if(typeof W!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(W,I,{value:W,enumerable:!1,writable:!1,configurable:!0}),W}function W(){for(var X,Z,J=new Promise(function($,U){X=$,Z=U}),N=[],H=0;H"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function p(C){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(k){return k.__proto__||Object.getPrototypeOf(k)},p(C)}var g={},m,y;function _(C,w,k){k||(k=Error);function A(E,T,F){return typeof w=="string"?w:w(E,T,F)}var b=(function(E){n(F,E);var T=c(F);function F(D,R,P){var z;return l(this,F),z=T.call(this,A(D,R,P)),z.code=C,z}return a(F)})(k);g[C]=b}function v(C,w){if(Array.isArray(C)){var k=C.length;return C=C.map(function(A){return String(A)}),k>2?"one of ".concat(w," ").concat(C.slice(0,k-1).join(", "),", or ")+C[k-1]:k===2?"one of ".concat(w," ").concat(C[0]," or ").concat(C[1]):"of ".concat(w," ").concat(C[0])}else return"of ".concat(w," ").concat(String(C))}function x(C,w,k){return C.substr(!k||k<0?0:+k,w.length)===w}function S(C,w,k){return(k===void 0||k>C.length)&&(k=C.length),C.substring(k-w.length,k)===w}function M(C,w,k){return typeof k!="number"&&(k=0),k+w.length>C.length?!1:C.indexOf(w,k)!==-1}_("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),_("ERR_INVALID_ARG_TYPE",function(C,w,k){m===void 0&&(m=P3()),m(typeof C=="string","'name' must be a string");var A;typeof w=="string"&&x(w,"not ")?(A="must not be",w=w.replace(/^not /,"")):A="must be";var b;if(S(C," argument"))b="The ".concat(C," ").concat(A," ").concat(v(w,"type"));else{var E=M(C,".")?"property":"argument";b='The "'.concat(C,'" ').concat(E," ").concat(A," ").concat(v(w,"type"))}return b+=". Received type ".concat(t(k)),b},TypeError),_("ERR_INVALID_ARG_VALUE",function(C,w){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=E1());var A=y.inspect(w);return A.length>128&&(A="".concat(A.slice(0,128),"...")),"The argument '".concat(C,"' ").concat(k,". Received ").concat(A)},TypeError,RangeError),_("ERR_INVALID_RETURN_VALUE",function(C,w,k){var A;return k&&k.constructor&&k.constructor.name?A="instance of ".concat(k.constructor.name):A="type ".concat(t(k)),"Expected ".concat(C,' to be returned from the "').concat(w,'"')+" function but got ".concat(A,".")},TypeError),_("ERR_MISSING_ARGS",function(){for(var C=arguments.length,w=new Array(C),k=0;k0,"At least one arg needs to be specified");var A="The ",b=w.length;switch(w=w.map(function(E){return'"'.concat(E,'"')}),b){case 1:A+="".concat(w[0]," argument");break;case 2:A+="".concat(w[0]," and ").concat(w[1]," arguments");break;default:A+=w.slice(0,b-1).join(", "),A+=", and ".concat(w[b-1]," arguments");break}return"".concat(A," must be specified")},TypeError),r.exports.codes=g}}),i$=de({"node_modules/assert/build/internal/assert/assertion_error.js"(e,r){"use strict";function t(B,O){var G=Object.keys(B);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(B);O&&(W=W.filter(function(X){return Object.getOwnPropertyDescriptor(B,X).enumerable})),G.push.apply(G,W)}return G}function i(B){for(var O=1;O"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y(B){return Function.toString.call(B).indexOf("[native code]")!==-1}function _(B,O){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(W,X){return W.__proto__=X,W},_(B,O)}function v(B){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(G){return G.__proto__||Object.getPrototypeOf(G)},v(B)}function x(B){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},x(B)}var S=E1(),M=S.inspect,C=EC(),w=C.codes.ERR_INVALID_ARG_TYPE;function k(B,O,G){return(G===void 0||G>B.length)&&(G=B.length),B.substring(G-O.length,G)===O}function A(B,O){if(O=Math.floor(O),B.length==0||O==0)return"";var G=B.length*O;for(O=Math.floor(Math.log(O)/Math.log(2));O;)B+=B,O--;return B+=B.substring(0,G-B.length),B}var b="",E="",T="",F="",D={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},R=10;function P(B){var O=Object.keys(B),G=Object.create(Object.getPrototypeOf(B));return O.forEach(function(W){G[W]=B[W]}),Object.defineProperty(G,"message",{value:B.message}),G}function z(B){return M(B,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function I(B,O,G){var W="",X="",Z=0,J="",N=!1,H=z(B),$=H.split(` `),U=z(O).split(` `),V=0,j="";if(G==="strictEqual"&&x(B)==="object"&&x(O)==="object"&&B!==null&&O!==null&&(G="strictEqualObject"),$.length===1&&U.length===1&&$[0]!==U[0]){var q=$[0].length+U[0].length;if(q<=R){if((x(B)!=="object"||B===null)&&(x(O)!=="object"||O===null)&&(B!==0||O!==0))return"".concat(D[G],` @@ -72,8 +72,8 @@ var Dce=Object.create;var xj=Object.defineProperty;var Lce=Object.getOwnProperty should equal -`):K=" ".concat(N," ").concat(K)),Z=G.call(this,"".concat(Y).concat(K))}return Error.stackTraceLimit=V,Z.generatedMessage=!J,Object.defineProperty(d(Z),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),Z.code="ERR_ASSERTION",Z.actual=$,Z.expected=U,Z.operator=N,Error.captureStackTrace&&Error.captureStackTrace(d(Z),H),Z.stack,Z.name="AssertionError",h(Z)}return l(W,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:O,value:function(Z,J){return M(this,i(i({},J),{},{customInspect:!1,depth:0}))}}]),W})(p(Error),M.custom);r.exports=L}}),kC=de({"node_modules/object-keys/isArguments.js"(e,r){"use strict";var t=Object.prototype.toString;r.exports=function(a){var o=t.call(a),s=o==="[object Arguments]";return s||(s=o!=="[object Array]"&&a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&t.call(a.callee)==="[object Function]"),s}}}),a$=de({"node_modules/object-keys/implementation.js"(e,r){"use strict";var t;Object.keys||(i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=kC(),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),n=s.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(p){var g=p.constructor;return g&&g.prototype===p},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=(function(){if(typeof window>"u")return!1;for(var p in window)try{if(!f["$"+p]&&i.call(window,p)&&window[p]!==null&&typeof window[p]=="object")try{c(window[p])}catch{return!0}}catch{return!0}return!1})(),d=function(p){if(typeof window>"u"||!h)return c(p);try{return c(p)}catch{return!1}},t=function(g){var m=g!==null&&typeof g=="object",y=a.call(g)==="[object Function]",_=o(g),v=m&&a.call(g)==="[object String]",x=[];if(!m&&!y&&!_)throw new TypeError("Object.keys called on a non-object");var S=n&&y;if(v&&g.length>0&&!i.call(g,0))for(var M=0;M0)for(var C=0;C-1?i(n):n}}}),Xy=de({"node_modules/define-properties/index.js"(e,r){"use strict";var t=CC(),i=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",a=Object.prototype.toString,o=Array.prototype.concat,s=vC(),l=function(f){return typeof f=="function"&&a.call(f)==="[object Function]"},n=mC()(),u=function(f,h,d,p){if(h in f){if(p===!0){if(f[h]===d)return}else if(!l(p)||!p())return}n?s(f,h,d,!0):s(f,h,d)},c=function(f,h){var d=arguments.length>2?arguments[2]:{},p=t(h);i&&(p=o.call(p,Object.getOwnPropertySymbols(h)));for(var g=0;gee.length)&&(ie=ee.length);for(var Q=0,ue=new Array(ie);Q10)return!0;for(var ie=0;ie57)return!0}return ee.length===10&&ee>=Math.pow(2,32)}function L(ee){return Object.keys(ee).filter(I).concat(d(ee).filter(Object.prototype.propertyIsEnumerable.bind(ee)))}function B(ee,ie){if(ee===ie)return 0;for(var Q=ee.length,ue=ie.length,ge=0,Me=Math.min(Q,ue);ge=0&&t.call(a.callee)==="[object Function]"),s}}}),a$=de({"node_modules/object-keys/implementation.js"(e,r){"use strict";var t;Object.keys||(i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=kC(),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),n=s.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(p){var g=p.constructor;return g&&g.prototype===p},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=(function(){if(typeof window>"u")return!1;for(var p in window)try{if(!f["$"+p]&&i.call(window,p)&&window[p]!==null&&typeof window[p]=="object")try{c(window[p])}catch{return!0}}catch{return!0}return!1})(),d=function(p){if(typeof window>"u"||!h)return c(p);try{return c(p)}catch{return!1}},t=function(g){var m=g!==null&&typeof g=="object",y=a.call(g)==="[object Function]",_=o(g),v=m&&a.call(g)==="[object String]",x=[];if(!m&&!y&&!_)throw new TypeError("Object.keys called on a non-object");var S=n&&y;if(v&&g.length>0&&!i.call(g,0))for(var M=0;M0)for(var C=0;C-1?i(n):n}}}),Xy=de({"node_modules/define-properties/index.js"(e,r){"use strict";var t=CC(),i=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",a=Object.prototype.toString,o=Array.prototype.concat,s=vC(),l=function(f){return typeof f=="function"&&a.call(f)==="[object Function]"},n=mC()(),u=function(f,h,d,p){if(h in f){if(p===!0){if(f[h]===d)return}else if(!l(p)||!p())return}n?s(f,h,d,!0):s(f,h,d)},c=function(f,h){var d=arguments.length>2?arguments[2]:{},p=t(h);i&&(p=o.call(p,Object.getOwnPropertySymbols(h)));for(var g=0;gee.length)&&(ie=ee.length);for(var Q=0,ue=new Array(ie);Q10)return!0;for(var ie=0;ie57)return!0}return ee.length===10&&ee>=Math.pow(2,32)}function L(ee){return Object.keys(ee).filter(I).concat(d(ee).filter(Object.prototype.propertyIsEnumerable.bind(ee)))}function B(ee,ie){if(ee===ie)return 0;for(var Q=ee.length,ue=ie.length,ge=0,Me=Math.min(Q,ue);ge1?U-1:0),j=1;j1?U-1:0),j=1;j1?U-1:0),j=1;j1?U-1:0),j=1;j0)return l(f);if(d==="number"&&isNaN(f)===!1)return h.long?u(f):n(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function l(f){if(f=String(f),!(f.length>100)){var h=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(f);if(h){var d=parseFloat(h[1]),p=(h[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"days":case"day":case"d":return d*o;case"hours":case"hour":case"hrs":case"hr":case"h":return d*a;case"minutes":case"minute":case"mins":case"min":case"m":return d*i;case"seconds":case"second":case"secs":case"sec":case"s":return d*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function n(f){return f>=o?Math.round(f/o)+"d":f>=a?Math.round(f/a)+"h":f>=i?Math.round(f/i)+"m":f>=t?Math.round(f/t)+"s":f+"ms"}function u(f){return c(f,o,"day")||c(f,a,"hour")||c(f,i,"minute")||c(f,t,"second")||f+" ms"}function c(f,h,d){if(!(f=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(n){try{return JSON.stringify(n)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}};function i(n){var u=this.useColors;if(n[0]=(u?"%c":"")+this.namespace+(u?" %c":" ")+n[0]+(u?"%c ":" ")+"+"+e.humanize(this.diff),!!u){var c="color: "+this.color;n.splice(1,0,c,"color: inherit");var f=0,h=0;n[0].replace(/%[a-zA-Z%]/g,function(d){d!=="%%"&&(f++,d==="%c"&&(h=f))}),n.splice(h,0,c)}}function a(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(n){try{n==null?e.storage.removeItem("debug"):e.storage.debug=n}catch{}}function s(){var n;try{n=e.storage.debug}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=process.env.DEBUG),n}e.enable(s());function l(){try{return window.localStorage}catch{}}}}),m$=de({"node_modules/stream-parser/index.js"(e,r){var t=P3(),i=v$()("stream-parser");r.exports=n;var a=-1,o=0,s=1,l=2;function n(v){var x=v&&typeof v._transform=="function",S=v&&typeof v._write=="function";if(!x&&!S)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),v._bytes=c,v._skipBytes=f,x&&(v._passthrough=h),x?v._transform=p:v._write=d}function u(v){i("initializing parser stream"),v._parserBytesLeft=0,v._parserBuffers=[],v._parserBuffered=0,v._parserState=a,v._parserCallback=null,typeof v.push=="function"&&(v._parserOutput=v.push.bind(v)),v._parserInit=!0}function c(v,x){t(!this._parserCallback,'there is already a "callback" set!'),t(isFinite(v)&&v>0,'can only buffer a finite number of bytes > 0, got "'+v+'"'),this._parserInit||u(this),i("buffering %o bytes",v),this._parserBytesLeft=v,this._parserCallback=x,this._parserState=o}function f(v,x){t(!this._parserCallback,'there is already a "callback" set!'),t(v>0,'can only skip > 0 bytes, got "'+v+'"'),this._parserInit||u(this),i("skipping %o bytes",v),this._parserBytesLeft=v,this._parserCallback=x,this._parserState=s}function h(v,x){t(!this._parserCallback,'There is already a "callback" set!'),t(v>0,'can only pass through > 0 bytes, got "'+v+'"'),this._parserInit||u(this),i("passing through %o bytes",v),this._parserBytesLeft=v,this._parserCallback=x,this._parserState=l}function d(v,x,S){this._parserInit||u(this),i("write(%o bytes)",v.length),typeof x=="function"&&(S=x),y(this,v,null,S)}function p(v,x,S){this._parserInit||u(this),i("transform(%o bytes)",v.length),typeof x!="function"&&(x=this._parserOutput),y(this,v,x,S)}function g(v,x,S,M){return v._parserBytesLeft<=0?M(new Error("got data but not currently parsing anything")):x.length<=v._parserBytesLeft?function(){return m(v,x,S,M)}:function(){var C=x.slice(0,v._parserBytesLeft);return m(v,C,S,function(w){if(w)return M(w);if(x.length>C.length)return function(){return g(v,x.slice(C.length),S,M)}})}}function m(v,x,S,M){if(v._parserBytesLeft-=x.length,i("%o bytes left for stream piece",v._parserBytesLeft),v._parserState===o?(v._parserBuffers.push(x),v._parserBuffered+=x.length):v._parserState===l&&S(x),v._parserBytesLeft===0){var C=v._parserCallback;if(C&&v._parserState===o&&v._parserBuffers.length>1&&(x=Buffer.concat(v._parserBuffers,v._parserBuffered)),v._parserState!==o&&(x=null),v._parserCallback=null,v._parserBuffered=0,v._parserState=a,v._parserBuffers.splice(0),C){var w=[];x&&w.push(x),S&&w.push(S);var k=C.length>w.length;k&&w.push(_(M));var A=C.apply(v,w);if(!k||M===A)return M}}else return M}var y=_(g);function _(v){return function(){for(var x=v.apply(this,arguments);typeof x=="function";)x=x();return x}}}}),as=de({"node_modules/probe-image-size/lib/common.js"(e){"use strict";var r=r$().Transform,t=m$();function i(){r.call(this,{readableObjectMode:!0})}i.prototype=Object.create(r.prototype),i.prototype.constructor=i,t(i.prototype),e.ParserStream=i,e.sliceEq=function(o,s,l){for(var n=s,u=0;u>16},e.readInt16BE=function(o,s){return e.readUInt16BE(o,s)<<16>>16},e.readUInt32LE=function(o,s){return(o[s]|o[s+1]<<8|o[s+2]<<16)+o[s+3]*16777216},e.readUInt32BE=function(o,s){return o[s]*16777216+(o[s+1]<<16|o[s+2]<<8|o[s+3])},e.readInt32LE=function(o,s){return e.readUInt32LE(o,s)|0},e.readInt32BE=function(o,s){return e.readUInt32BE(o,s)|0};function a(o,s,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||"",this.name=this.constructor.name,this.message=o,s&&(this.code=s),l&&(this.statusCode=l)}a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,e.ProbeError=a}}),g$=de({"node_modules/probe-image-size/lib/miaf_utils.js"(e,r){"use strict";var t=as().readUInt16BE,i=as().readUInt32BE;function a(h,d){if(h.length<4+d)return null;var p=i(h,d);return h.length>4&15,g=h[4]&15,m=h[5]>>4&15,y=t(h,6),_=8,v=0;vy.width||m.width===y.width&&m.height>y.height?m:y}),p=h.reduce(function(m,y){return m.height>y.height||m.height===y.height&&m.width>y.width?m:y}),g;return d.width>p.height||d.width===p.height&&d.height>p.width?g=d:g=p,g}r.exports.readSizeFromMeta=function(h){var d={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(c(h,d),!!d.sizes.length){var p=f(d.sizes),g=1;d.transforms.forEach(function(y){var _={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},v={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(y.type==="imir"&&(y.value===0?g=v[g]:(g=v[g],g=_[g],g=_[g])),y.type==="irot")for(var x=0;x0&&!this.aborted;){var l=this.ifds_to_read.shift();l.offset&&this.scan_ifd(l.id,l.offset,o)}},a.prototype.read_uint16=function(o){var s=this.input;if(o+2>s.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?s[o]*256+s[o+1]:s[o]+s[o+1]*256},a.prototype.read_uint32=function(o){var s=this.input;if(o+4>s.length)throw t("unexpected EOF","EBADDATA");return this.big_endian?s[o]*16777216+s[o+1]*65536+s[o+2]*256+s[o+3]:s[o]+s[o+1]*256+s[o+2]*65536+s[o+3]*16777216},a.prototype.is_subifd_link=function(o,s){return o===0&&s===34665||o===0&&s===34853||o===34665&&s===40965},a.prototype.exif_format_length=function(o){switch(o){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(o,s){var l;switch(o){case 1:case 2:return l=this.input[s],l;case 6:return l=this.input[s],l|(l&128)*33554430;case 3:return l=this.read_uint16(s),l;case 8:return l=this.read_uint16(s),l|(l&32768)*131070;case 4:return l=this.read_uint32(s),l;case 9:return l=this.read_uint32(s),l|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},a.prototype.scan_ifd=function(o,s,l){var n=this.read_uint16(s);s+=2;for(var u=0;uthis.input.length)throw t("unexpected EOF","EBADDATA");for(var y=[],_=g,v=0;v0&&(this.ifds_to_read.push({id:c,offset:y[0]}),m=!0);var S={is_big_endian:this.big_endian,ifd:o,tag:c,format:f,count:h,entry_offset:s+this.start,data_length:p,data_offset:g+this.start,value:y,is_subifd_link:m};if(l(S)===!1){this.aborted=!0;return}s+=12}o===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(s)})},r.exports.ExifParser=a,r.exports.get_orientation=function(o){var s=0;try{return new a(o,0,o.length).each(function(l){if(l.ifd===0&&l.tag===274&&Array.isArray(l.value))return s=l.value[0],!1}),s}catch{return-1}}}}),y$=de({"node_modules/probe-image-size/lib/parse_sync/avif.js"(e,r){"use strict";var t=as().str2arr,i=as().sliceEq,a=as().readUInt32BE,o=g$(),s=I3(),l=t("ftyp");r.exports=function(n){if(i(n,4,l)){var u=o.unbox(n,0);if(u){var c=o.getMimeType(u.data);if(c){for(var f,h=u.end;;){var d=o.unbox(n,h);if(!d)break;if(h=d.end,d.boxtype==="mdat")return;if(d.boxtype==="meta"){f=d.data;break}}if(f){var p=o.readSizeFromMeta(f);if(p){var g={width:p.width,height:p.height,type:c.type,mime:c.mime,wUnits:"px",hUnits:"px"};if(p.variants.length>1&&(g.variants=p.variants),p.orientation&&(g.orientation=p.orientation),p.exif_location&&p.exif_location.offset+p.exif_location.length<=n.length){var m=a(n,p.exif_location.offset),y=n.slice(p.exif_location.offset+m+4,p.exif_location.offset+p.exif_location.length),_=s.get_orientation(y);_>0&&(g.orientation=_)}return g}}}}}}}}),_$=de({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(e,r){"use strict";var t=as().str2arr,i=as().sliceEq,a=as().readInt16LE,o=as().readInt32LE,s=as().readUInt32LE,l=t("BM");r.exports=function(n){if(!(n.length<26)&&i(n,0,l)){var u,c,f=s(n,14);if(f===12)c=a(n,18),u=a(n,20);else if(f>12)c=o(n,18),u=o(n,22);else return;return{width:c,height:Math.abs(u),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}}),x$=de({"node_modules/probe-image-size/lib/parse_sync/gif.js"(e,r){"use strict";var t=as().str2arr,i=as().sliceEq,a=as().readUInt16LE,o=t("GIF87a"),s=t("GIF89a");r.exports=function(l){if(!(l.length<10)&&!(!i(l,0,o)&&!i(l,0,s)))return{width:a(l,6),height:a(l,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),b$=de({"node_modules/probe-image-size/lib/parse_sync/ico.js"(e,r){"use strict";var t=as().readUInt16LE,i=0,a=1,o=16;r.exports=function(s){var l=t(s,0),n=t(s,2),u=t(s,4);if(!(l!==i||n!==a||!u)&&!(s.length<6+u*o)){for(var c=[],f={width:0,height:0},h=0;hf.width||p>f.height)&&(f=g)}return{width:f.width,height:f.height,variants:c,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),w$=de({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(e,r){"use strict";var t=as().readUInt16BE,i=as().str2arr,a=as().sliceEq,o=I3(),s=i("Exif\0\0");r.exports=function(l){if(!(l.length<2)&&!(l[0]!==255||l[1]!==216||l[2]!==255))for(var n=2;;){for(;;){if(l.length-n<2)return;if(l[n++]===255)break}for(var u=l[n++],c;u===255;)u=l[n++];if(u>=208&&u<=217||u===1)c=0;else if(u>=192&&u<=254){if(l.length-n<2)return;c=t(l,n)-2,n+=2}else return;if(u===217||u===218)return;var f;if(u===225&&c>=10&&a(l,n,s)&&(f=o.get_orientation(l.slice(n+6,n+c))),c>=5&&u>=192&&u<=207&&u!==196&&u!==200&&u!==204){if(l.length-n0&&(h.orientation=f),h}n+=c}}}}),T$=de({"node_modules/probe-image-size/lib/parse_sync/png.js"(e,r){"use strict";var t=as().str2arr,i=as().sliceEq,a=as().readUInt32BE,o=t(`\x89PNG\r  -`),s=t("IHDR");r.exports=function(l){if(!(l.length<24)&&i(l,0,o)&&i(l,12,s))return{width:a(l,16),height:a(l,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),A$=de({"node_modules/probe-image-size/lib/parse_sync/psd.js"(e,r){"use strict";var t=as().str2arr,i=as().sliceEq,a=as().readUInt32BE,o=t("8BPS\0");r.exports=function(s){if(!(s.length<22)&&i(s,0,o))return{width:a(s,18),height:a(s,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),M$=de({"node_modules/probe-image-size/lib/parse_sync/svg.js"(e,r){"use strict";function t(d){return d===32||d===9||d===13||d===10}function i(d){return typeof d=="number"&&isFinite(d)&&d>0}function a(d){var p=0,g=d.length;for(d[0]===239&&d[1]===187&&d[2]===191&&(p=3);p]*>/,s=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,l=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,n=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,u=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function f(d){var p=d.match(l),g=d.match(n),m=d.match(u);return{width:p&&(p[1]||p[2]),height:g&&(g[1]||g[2]),viewbox:m&&(m[1]||m[2])}}function h(d){return c.test(d)?d.match(c)[0]:"px"}r.exports=function(d){if(a(d)){for(var p="",g=0;g>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function f(h,d){return{width:(h[d+6]<<16|h[d+5]<<8|h[d+4])+1,height:(h[d+9]<<16|h[d+8]<<8|h[d+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}r.exports=function(h){if(!(h.length<16)&&!(!i(h,0,l)||!i(h,8,n))){var d=12,p=null,g=0,m=o(h,4)+8;if(!(m>h.length)){for(;d+8=10?p=p||u(h,d+8):y==="VP8L"&&_>=5?p=p||c(h,d+8):y==="VP8X"&&_>=10?p=p||f(h,d+8):y==="EXIF"&&(g=s.get_orientation(h.slice(d+8,d+8+_)),d=1/0),d+=8+_}if(p)return g>0&&(p.orientation=g),p}}}}}),k$=de({"node_modules/probe-image-size/lib/parsers_sync.js"(e,r){"use strict";r.exports={avif:y$(),bmp:_$(),gif:x$(),ico:b$(),jpeg:w$(),png:T$(),psd:A$(),svg:M$(),tiff:S$(),webp:E$()}}}),C$=de({"node_modules/probe-image-size/sync.js"(e,r){"use strict";var t=k$();function i(a){for(var o=Object.keys(t),s=0;s0&&l.height>0?l:null}return null}r.exports=function(o){return i(o)},r.exports.parsers=t}}),D$=de({"src/traces/image/helpers.js"(e){"use strict";var r=C$(),t=Mp().IMAGE_URL_PREFIX,i=kv().Buffer;e.getImageSize=function(a){var o=a.replace(t,""),s=new i(o,"base64");return r(s)}}}),L$=de({"src/traces/image/calc.js"(e,r){"use strict";var t=Qt(),i=T1(),a=da(),o=nn(),s=Qt().maxRowLength,l=D$().getImageSize;r.exports=function(h,d){var p,g;if(d._hasZ)p=d.z.length,g=s(d.z);else if(d._hasSource){var m=l(d.source);p=m.height,g=m.width}var y=o.getFromId(h,d.xaxis||"x"),_=o.getFromId(h,d.yaxis||"y"),v=y.d2c(d.x0)-d.dx/2,x=_.d2c(d.y0)-d.dy/2,S,M=[v,v+g*d.dx],C=[x,x+p*d.dy];if(y&&y.type==="log")for(S=0;S0;)F=p.c2p(C+z*b),z--;for(z=0;R===void 0&&z0;)P=g.c2p(w+z*E),z--;if(FN[0];if(H||$){var U=T+L/2,V=R+B/2;Z+="transform:"+a(U+"px",V+"px")+"scale("+(H?-1:1)+","+($?-1:1)+")"+a(-U+"px",-V+"px")+";"}}X.attr("style",Z);var j=new Promise(function(q){if(x._hasZ)q();else if(x._hasSource)if(x._canvas&&x._canvas.el.width===k&&x._canvas.el.height===A&&x._canvas.source===x.source)q();else{var Y=document.createElement("canvas");Y.width=k,Y.height=A;var K=Y.getContext("2d",{willReadFrequently:!0});x._image=x._image||new Image;var te=x._image;te.onload=function(){K.drawImage(te,0,0),x._canvas={el:Y,source:x.source},q()},te.setAttribute("src",x.source)}}).then(function(){var q,Y;if(x._hasZ)Y=W(function(ne,se){var le=M[se][ne];return i.isTypedArray(le)&&(le=Array.from(le)),le}),q=Y.toDataURL("image/png");else if(x._hasSource)if(S)q=x.source;else{var K=x._canvas.el.getContext("2d",{willReadFrequently:!0}),te=K.getImageData(0,0,k,A).data;Y=W(function(ne,se){var le=4*(se*k+ne);return[te[le],te[le+1],te[le+2],te[le+3]]}),q=Y.toDataURL("image/png")}X.attr({"xlink:href":q,height:B,width:L,x:T,y:R})});c._promises.push(j)})}}}),P$=de({"src/traces/image/style.js"(e,r){"use strict";var t=Yr();r.exports=function(a){t.select(a).selectAll(".im image").style("opacity",function(o){return o[0].trace.opacity})}}}),I$=de({"src/traces/image/hover.js"(e,r){"use strict";var t=$s(),i=Qt(),a=i.isArrayOrTypedArray,o=T1();r.exports=function(l,n,u){var c=l.cd[0],f=c.trace,h=l.xa,d=l.ya;if(!(t.inbox(n-c.x0,n-(c.x0+c.w*f.dx),0)>0||t.inbox(u-c.y0,u-(c.y0+c.h*f.dy),0)>0)){var p=Math.floor((n-c.x0)/f.dx),g=Math.floor(Math.abs(u-c.y0)/f.dy),m;if(f._hasZ?m=c.z[g][p]:f._hasSource&&(m=f._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(p,g,1,1).data),!!m){var y=c.hi||f.hoverinfo,_;if(y){var v=y.split("+");v.indexOf("all")!==-1&&(v=["color"]),v.indexOf("color")!==-1&&(_=!0)}var x=o.colormodel[f.colormodel],S=x.colormodel||f.colormodel,M=S.length,C=f._scaler(m),w=x.suffix,k=[];(f.hovertemplate||_)&&(k.push("["+[C[0]+w[0],C[1]+w[1],C[2]+w[2]].join(", ")),M===4&&k.push(", "+C[3]+w[3]),k.push("]"),k=k.join(""),l.extraText=S.toUpperCase()+": "+k);var A;a(f.hovertext)&&a(f.hovertext[g])?A=f.hovertext[g][p]:a(f.text)&&a(f.text[g])&&(A=f.text[g][p]);var b=d.c2p(c.y0+(g+.5)*f.dy),E=c.x0+(p+.5)*f.dx,T=c.y0+(g+.5)*f.dy,F="["+m.slice(0,f.colormodel.length).join(", ")+"]";return[i.extendFlat(l,{index:[g,p],x0:h.c2p(c.x0+p*f.dx),x1:h.c2p(c.x0+(p+1)*f.dx),y0:b,y1:b,color:C,xVal:E,xLabelVal:E,yVal:T,yLabelVal:T,zLabelVal:F,text:A,hovertemplateLabels:{zLabel:F,colorLabel:k,"color[0]Label":C[0]+w[0],"color[1]Label":C[1]+w[1],"color[2]Label":C[2]+w[2],"color[3]Label":C[3]+w[3]}})]}}}}}),R$=de({"src/traces/image/event_data.js"(e,r){"use strict";r.exports=function(i,a){return"xVal"in a&&(i.x=a.xVal),"yVal"in a&&(i.y=a.yVal),a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),i.color=a.color,i.colormodel=a.trace.colormodel,i.z||(i.z=a.color),i}}}),z$=de({"src/traces/image/index.js"(e,r){"use strict";r.exports={attributes:(lC(),ti(_3)).default,supplyDefaults:mH(),calc:L$(),plot:F$(),style:P$(),hoverPoints:I$(),eventData:R$(),moduleType:"trace",name:"image",basePlotModule:ml(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),B$=de({"lib/image.js"(e,r){"use strict";r.exports=z$()}}),Pv=de({"src/traces/pie/attributes.js"(e,r){"use strict";var t=ri(),i=Is().attributes,a=us(),o=Jo(),{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:n}=Vo(),u=fn().extendFlat,c=fu().pattern,f=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});r.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},t.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:n(),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:n({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},f,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},f,{}),outsidetextfont:u({},f,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:u({},t.showlegend,{arrayOk:!0}),legend:u({},t.legend,{arrayOk:!0}),legendrank:u({},t.legendrank,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},f,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Iv=de({"src/traces/pie/defaults.js"(e,r){"use strict";var t=da(),i=Qt(),a=Pv(),o=Is().defaults,s=oh().handleText,l=Qt().coercePattern;function n(f,h){var d=i.isArrayOrTypedArray(f),p=i.isArrayOrTypedArray(h),g=Math.min(d?f.length:1/0,p?h.length:1/0);if(isFinite(g)||(g=0),g&&p){for(var m,y=0;y0){m=!0;break}}m||(g=0)}return{hasLabels:d,hasValues:p,len:g}}function u(f,h,d,p,g){var m=p("marker.line.width");m&&p("marker.line.color",g?void 0:d.paper_bgcolor);var y=p("marker.colors");l(p,"marker.pattern",y),f.marker&&!h.marker.pattern.fgcolor&&(h.marker.pattern.fgcolor=f.marker.colors),h.marker.pattern.bgcolor||(h.marker.pattern.bgcolor=d.paper_bgcolor)}function c(f,h,d,p){function g(T,F){return i.coerce(f,h,a,T,F)}var m=g("labels"),y=g("values"),_=n(m,y),v=_.len;if(h._hasLabels=_.hasLabels,h._hasValues=_.hasValues,!h._hasLabels&&h._hasValues&&(g("label0"),g("dlabel")),!v){h.visible=!1;return}h._length=v,u(f,h,p,g,!0),g("scalegroup");var x=g("text"),S=g("texttemplate");g("texttemplatefallback");var M;if(S||(M=g("textinfo",i.isArrayOrTypedArray(x)?"text+percent":"percent")),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback"),S||M&&M!=="none"){var C=g("textposition");s(f,h,p,g,C,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var w=Array.isArray(C)||C==="auto",k=w||C==="outside";k&&g("automargin"),(C==="inside"||C==="auto"||Array.isArray(C))&&g("insidetextorientation")}else M==="none"&&g("textposition","none");o(h,p,g);var A=g("hole"),b=g("title.text");if(b){var E=g("title.position",A?"middle center":"top center");!A&&E==="middle center"&&(h.title.position="top center"),i.coerceFont(g,"title.font",p.font)}g("sort"),g("direction"),g("rotation"),g("pull")}r.exports={handleLabelsAndValues:n,handleMarkerDefaults:u,supplyDefaults:c}}}),R3=de({"src/traces/pie/layout_attributes.js"(e,r){"use strict";r.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),O$=de({"src/traces/pie/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=R3();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("hiddenlabels"),l("piecolorway",s.colorway),l("extendpiecolors")}}}),E1=de({"src/traces/pie/calc.js"(e,r){"use strict";var t=da(),i=ta(),a={};function o(u,c){var f=[],h=u._fullLayout,d=h.hiddenlabels||[],p=c.labels,g=c.marker.colors||[],m=c.values,y=c._length,_=c._hasValues&&y,v,x;if(c.dlabel)for(p=new Array(y),v=0;v=0});var T=c.type==="funnelarea"?w:c.sort;return T&&f.sort(function(F,D){return D.v-F.v}),f[0]&&(f[0].vTotal=C),f}function s(u){return function(f,h){if(!f||!i.isValid(f))return!1;let d=i.rgbaString(f);return u[h]||(u[h]=d),d}}function l(u,c){var f=(c||{}).type;f||(f="pie");var h=u._fullLayout,d=u.calcdata,p=h[f+"colorway"],g=h["_"+f+"colormap"];h["extend"+f+"colors"]&&(p=n(p,a));for(var m=0,y=0;y0&&(ge+=Ve*Q.pxmid[0],Me+=Ve*Q.pxmid[1])}Q.cxFinal=ge,Q.cyFinal=Me;function Ze(lt,qe,Ye,me){var _e=me*(qe[0]-lt[0]),Ae=me*(qe[1]-lt[1]);return"a"+me*te.r+","+me*te.r+" 0 "+Q.largeArc+(Ye?" 1 ":" 0 ")+_e+","+Ae}var Ke=ne.hole;if(Q.v===te.vTotal){var vt="M"+(ge+Q.px0[0])+","+(Me+Q.px0[1])+Ze(Q.px0,Q.pxmid,!0,1)+Ze(Q.pxmid,Q.px0,!0,1)+"Z";Ke?je.attr("d","M"+(ge+Ke*Q.px0[0])+","+(Me+Ke*Q.px0[1])+Ze(Q.px0,Q.pxmid,!1,Ke)+Ze(Q.pxmid,Q.px0,!1,Ke)+"Z"+vt):je.attr("d",vt)}else{var xt=Ze(Q.px0,Q.px1,!0,1);if(Ke){var Pt=1-Ke;je.attr("d","M"+(ge+Ke*Q.px1[0])+","+(Me+Ke*Q.px1[1])+Ze(Q.px1,Q.px0,!1,Ke)+"l"+Pt*Q.px0[0]+","+Pt*Q.px0[1]+xt+"Z")}else je.attr("d","M"+ge+","+Me+"l"+Q.px0[0]+","+Q.px0[1]+xt+"Z")}J(H,Q,te);var mt=g.castOption(ne.textposition,Q.pts),Mt=Te.selectAll("g.slicetext").data(Q.text&&mt!=="none"?[0]:[]);Mt.enter().append("g").classed("slicetext",!0),Mt.exit().remove(),Mt.each(function(){var lt=l.ensureSingle(t.select(this),"text","",function(De){De.attr("data-notex",1)}),qe=l.ensureUniformFontSize(H,mt==="outside"?S(ne,Q,V.font):M(ne,Q,V.font));lt.text(Q.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,qe).call(c.convertToTspans,H);var Ye=s.bBox(lt.node()),me;if(mt==="outside")me=R(Ye,Q);else if(me=w(Ye,Q,te),mt==="auto"&&me.scale<1){var _e=l.ensureUniformFontSize(H,ne.outsidetextfont);lt.call(s.font,_e),Ye=s.bBox(lt.node()),me=R(Ye,Q)}var Ae=me.textPosAngle,ke=Ae===void 0?Q.pxmid:Z(te.r,Ae);if(me.targetX=ge+ke[0]*me.rCenter+(me.x||0),me.targetY=Me+ke[1]*me.rCenter+(me.y||0),N(me,Ye),me.outside){var Ee=me.targetY;Q.yLabelMin=Ee-Ye.height/2,Q.yLabelMid=Ee,Q.yLabelMax=Ee+Ye.height/2,Q.labelExtraX=0,Q.labelExtraY=0,ce=!0}me.fontSize=qe.size,h(ne.type,me,V),Y[ue].transform=me,l.setTransormAndDisplay(lt,me)})});var pe=t.select(this).selectAll("g.titletext").data(ne.title.text?[0]:[]);if(pe.enter().append("g").classed("titletext",!0),pe.exit().remove(),pe.each(function(){var Q=l.ensureSingle(t.select(this),"text","",function(Me){Me.attr("data-notex",1)}),ue=ne.title.text;ne._meta&&(ue=l.templateString(ue,ne._meta)),Q.text(ue).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,ne.title.font).call(c.convertToTspans,H);var ge;ne.title.position==="middle center"?ge=P(te):ge=z(te,j),Q.attr("transform",u(ge.x,ge.y)+n(Math.min(1,ge.scale))+u(ge.tx,ge.ty))}),ce&&O(le,ne),v(se,ne),ce&&ne.automargin){var xe=s.bBox(K.node()),ye=ne.domain,fe=j.w*(ye.x[1]-ye.x[0]),ae=j.h*(ye.y[1]-ye.y[0]),ee=(.5*fe-te.r)/j.w,ie=(.5*ae-te.r)/j.h;i.autoMargin(H,"pie."+ne.uid+".automargin",{xl:ye.x[0]-ee,xr:ye.x[1]+ee,yb:ye.y[0]-ie,yt:ye.y[1]+ie,l:Math.max(te.cx-te.r-xe.left,0),r:Math.max(xe.right-(te.cx+te.r),0),b:Math.max(xe.bottom-(te.cy+te.r),0),t:Math.max(te.cy-te.r-xe.top,0),pad:5})}})});setTimeout(function(){q.selectAll("tspan").each(function(){var Y=t.select(this);Y.attr("dy")&&Y.attr("dy",Y.attr("dy"))})},0)}function v(H,$){H.each(function(U){var V=t.select(this);if(!U.labelExtraX&&!U.labelExtraY){V.select("path.textline").remove();return}var j=V.select("g.slicetext text");U.transform.targetX+=U.labelExtraX,U.transform.targetY+=U.labelExtraY,l.setTransormAndDisplay(j,U.transform);var q=U.cxFinal+U.pxmid[0],Y=U.cyFinal+U.pxmid[1],K="M"+q+","+Y,te=(U.yLabelMax-U.yLabelMin)*(U.pxmid[0]<0?-1:1)/4;if(U.labelExtraX){var ne=U.labelExtraX*U.pxmid[1]/U.pxmid[0],se=U.yLabelMid+U.labelExtraY-(U.cyFinal+U.pxmid[1]);Math.abs(ne)>Math.abs(se)?K+="l"+se*U.pxmid[0]/U.pxmid[1]+","+se+"H"+(q+U.labelExtraX+te):K+="l"+U.labelExtraX+","+ne+"v"+(se-ne)+"h"+te}else K+="V"+(U.yLabelMid+U.labelExtraY)+"h"+te;l.ensureSingle(V,"path","textline").call(o.stroke,$.outsidetextfont.color).attr({"stroke-width":Math.min(2,$.outsidetextfont.size/8),d:K,fill:"none"})})}function x(H,$,U){var V=U[0],j=V.cx,q=V.cy,Y=V.trace,K=Y.type==="funnelarea";"_hasHoverLabel"in Y||(Y._hasHoverLabel=!1),"_hasHoverEvent"in Y||(Y._hasHoverEvent=!1),H.on("mouseover",function(te){var ne=$._fullLayout,se=$._fullData[Y.index];if(!($._dragging||ne.hovermode===!1)){var le=se.hoverinfo;if(Array.isArray(le)&&(le=a.castHoverinfo({hoverinfo:[g.castOption(le,te.pts)],_module:Y._module},ne,0)),le==="all"&&(le="label+text+value+percent+name"),se.hovertemplate||le!=="none"&&le!=="skip"&&le){var ce=te.rInscribed||0,pe=j+te.pxmid[0]*(1-ce),xe=q+te.pxmid[1]*(1-ce),ye=ne.separators,fe=[];if(le&&le.indexOf("label")!==-1&&fe.push(te.label),te.text=g.castOption(se.hovertext||se.text,te.pts),le&&le.indexOf("text")!==-1){var ae=te.text;l.isValidTextValue(ae)&&fe.push(ae)}te.value=te.v,te.valueLabel=g.formatPieValue(te.v,ye),le&&le.indexOf("value")!==-1&&fe.push(te.valueLabel),te.percent=te.v/V.vTotal,te.percentLabel=g.formatPiePercent(te.percent,ye),le&&le.indexOf("percent")!==-1&&fe.push(te.percentLabel);var ee=se.hoverlabel,ie=ee.font,Q=[];a.loneHover({trace:Y,x0:pe-ce*V.r,x1:pe+ce*V.r,y:xe,_x0:K?j+te.TL[0]:pe-ce*V.r,_x1:K?j+te.TR[0]:pe+ce*V.r,_y0:K?q+te.TL[1]:xe-ce*V.r,_y1:K?q+te.BL[1]:xe+ce*V.r,text:fe.join("
"),name:se.hovertemplate||le.indexOf("name")!==-1?se.name:void 0,idealAlign:te.pxmid[0]<0?"left":"right",color:g.castOption(ee.bgcolor,te.pts)||te.color,borderColor:g.castOption(ee.bordercolor,te.pts),fontFamily:g.castOption(ie.family,te.pts),fontSize:g.castOption(ie.size,te.pts),fontColor:g.castOption(ie.color,te.pts),nameLength:g.castOption(ee.namelength,te.pts),textAlign:g.castOption(ee.align,te.pts),hovertemplate:g.castOption(se.hovertemplate,te.pts),hovertemplateLabels:te,eventData:[m(te,se)]},{container:ne._hoverlayer.node(),outerContainer:ne._paper.node(),gd:$,inOut_bbox:Q}),te.bbox=Q[0],Y._hasHoverLabel=!0}Y._hasHoverEvent=!0,$.emit("plotly_hover",{points:[m(te,se)],event:t.event})}}),H.on("mouseout",function(te){var ne=$._fullLayout,se=$._fullData[Y.index],le=t.select(this).datum();Y._hasHoverEvent&&(te.originalEvent=t.event,$.emit("plotly_unhover",{points:[m(le,se)],event:t.event}),Y._hasHoverEvent=!1),Y._hasHoverLabel&&(a.loneUnhover(ne._hoverlayer.node()),Y._hasHoverLabel=!1)}),H.on("click",function(te){var ne=$._fullLayout,se=$._fullData[Y.index];$._dragging||ne.hovermode===!1||($._hoverdata=[m(te,se)],a.click($,t.event))})}function S(H,$,U){var V=g.castOption(H.outsidetextfont.color,$.pts)||g.castOption(H.textfont.color,$.pts)||U.color,j=g.castOption(H.outsidetextfont.family,$.pts)||g.castOption(H.textfont.family,$.pts)||U.family,q=g.castOption(H.outsidetextfont.size,$.pts)||g.castOption(H.textfont.size,$.pts)||U.size,Y=g.castOption(H.outsidetextfont.weight,$.pts)||g.castOption(H.textfont.weight,$.pts)||U.weight,K=g.castOption(H.outsidetextfont.style,$.pts)||g.castOption(H.textfont.style,$.pts)||U.style,te=g.castOption(H.outsidetextfont.variant,$.pts)||g.castOption(H.textfont.variant,$.pts)||U.variant,ne=g.castOption(H.outsidetextfont.textcase,$.pts)||g.castOption(H.textfont.textcase,$.pts)||U.textcase,se=g.castOption(H.outsidetextfont.lineposition,$.pts)||g.castOption(H.textfont.lineposition,$.pts)||U.lineposition,le=g.castOption(H.outsidetextfont.shadow,$.pts)||g.castOption(H.textfont.shadow,$.pts)||U.shadow;return{color:V,family:j,size:q,weight:Y,style:K,variant:te,textcase:ne,lineposition:se,shadow:le}}function M(H,$,U){var V=g.castOption(H.insidetextfont.color,$.pts);!V&&H._input.textfont&&(V=g.castOption(H._input.textfont.color,$.pts));var j=g.castOption(H.insidetextfont.family,$.pts)||g.castOption(H.textfont.family,$.pts)||U.family,q=g.castOption(H.insidetextfont.size,$.pts)||g.castOption(H.textfont.size,$.pts)||U.size,Y=g.castOption(H.insidetextfont.weight,$.pts)||g.castOption(H.textfont.weight,$.pts)||U.weight,K=g.castOption(H.insidetextfont.style,$.pts)||g.castOption(H.textfont.style,$.pts)||U.style,te=g.castOption(H.insidetextfont.variant,$.pts)||g.castOption(H.textfont.variant,$.pts)||U.variant,ne=g.castOption(H.insidetextfont.textcase,$.pts)||g.castOption(H.textfont.textcase,$.pts)||U.textcase,se=g.castOption(H.insidetextfont.lineposition,$.pts)||g.castOption(H.textfont.lineposition,$.pts)||U.lineposition,le=g.castOption(H.insidetextfont.shadow,$.pts)||g.castOption(H.textfont.shadow,$.pts)||U.shadow;return{color:V||o.contrast($.color),family:j,size:q,weight:Y,style:K,variant:te,textcase:ne,lineposition:se,shadow:le}}function C(H,$){for(var U,V,j=0;j=-4;ee-=2)ae(Math.PI*ee,"tan");for(ee=4;ee>=-4;ee-=2)ae(Math.PI*(ee+1),"tan")}if(le||pe){for(ee=4;ee>=-4;ee-=2)ae(Math.PI*(ee+1.5),"rad");for(ee=4;ee>=-4;ee-=2)ae(Math.PI*(ee+.5),"rad")}}if(K||xe||le){var ie=Math.sqrt(H.width*H.width+H.height*H.height);if(fe={scale:j*V*2/ie,rCenter:1-j,rotate:0},fe.textPosAngle=($.startangle+$.stopangle)/2,fe.scale>=1)return fe;ye.push(fe)}(xe||pe)&&(fe=A(H,V,Y,te,ne),fe.textPosAngle=($.startangle+$.stopangle)/2,ye.push(fe)),(xe||ce)&&(fe=b(H,V,Y,te,ne),fe.textPosAngle=($.startangle+$.stopangle)/2,ye.push(fe));for(var Q=0,ue=0,ge=0;ge=1)break}return ye[Q]}function k(H,$){var U=H.startangle,V=H.stopangle;return U>$&&$>V||U<$&&$0?1:-1)/2,y:q/(1+U*U/(V*V)),outside:!0}}function P(H){var $=Math.sqrt(H.titleBox.width*H.titleBox.width+H.titleBox.height*H.titleBox.height);return{x:H.cx,y:H.cy,scale:H.trace.hole*H.r*2/$,tx:0,ty:-H.titleBox.height/2+H.trace.title.font.size}}function z(H,$){var U=1,V=1,j,q=H.trace,Y={x:H.cx,y:H.cy},K={tx:0,ty:0};K.ty+=q.title.font.size,j=B(q),q.title.position.indexOf("top")!==-1?(Y.y-=(1+j)*H.r,K.ty-=H.titleBox.height):q.title.position.indexOf("bottom")!==-1&&(Y.y+=(1+j)*H.r);var te=I(H.r,H.trace.aspectratio),ne=$.w*(q.domain.x[1]-q.domain.x[0])/2;return q.title.position.indexOf("left")!==-1?(ne=ne+te,Y.x-=(1+j)*te,K.tx+=H.titleBox.width/2):q.title.position.indexOf("center")!==-1?ne*=2:q.title.position.indexOf("right")!==-1&&(ne=ne+te,Y.x+=(1+j)*te,K.tx-=H.titleBox.width/2),U=ne/H.titleBox.width,V=L(H,$)/H.titleBox.height,{x:Y.x,y:Y.y,scale:Math.min(U,V),tx:K.tx,ty:K.ty}}function I(H,$){return H/($===void 0?1:$)}function L(H,$){var U=H.trace,V=$.h*(U.domain.y[1]-U.domain.y[0]);return Math.min(H.titleBox.height,V/2)}function B(H){var $=H.pull;if(!$)return 0;var U;if(l.isArrayOrTypedArray($))for($=0,U=0;U$&&($=H.pull[U]);return $}function O(H,$){var U,V,j,q,Y,K,te,ne,se,le,ce,pe,xe;function ye(ie,Q){return ie.pxmid[1]-Q.pxmid[1]}function fe(ie,Q){return Q.pxmid[1]-ie.pxmid[1]}function ae(ie,Q){Q||(Q={});var ue=Q.labelExtraY+(V?Q.yLabelMax:Q.yLabelMin),ge=V?ie.yLabelMin:ie.yLabelMax,Me=V?ie.yLabelMax:ie.yLabelMin,Te=ie.cyFinal+Y(ie.px0[1],ie.px1[1]),je=ue-ge,Ve,Ze,Ke,vt,xt,Pt;if(je*te>0&&(ie.labelExtraY=je),!!l.isArrayOrTypedArray($.pull))for(Ze=0;Ze=(g.castOption($.pull,Ke.pts)||0))&&((ie.pxmid[1]-Ke.pxmid[1])*te>0?(vt=Ke.cyFinal+Y(Ke.px0[1],Ke.px1[1]),je=vt-ge-ie.labelExtraY,je*te>0&&(ie.labelExtraY+=je)):(Me+ie.labelExtraY-Te)*te>0&&(Ve=3*K*Math.abs(Ze-le.indexOf(ie)),xt=Ke.cxFinal+q(Ke.px0[0],Ke.px1[0]),Pt=xt+Ve-(ie.cxFinal+ie.pxmid[0])-ie.labelExtraX,Pt*K>0&&(ie.labelExtraX+=Pt)))}for(V=0;V<2;V++)for(j=V?ye:fe,Y=V?Math.max:Math.min,te=V?1:-1,U=0;U<2;U++){for(q=U?Math.max:Math.min,K=U?1:-1,ne=H[V][U],ne.sort(j),se=H[1-V][U],le=se.concat(ne),pe=[],ce=0;ce1?(ne=U.r,se=ne/j.aspectratio):(se=U.r,ne=se*j.aspectratio),ne*=(1+j.baseratio)/2,te=ne*se}Y=Math.min(Y,te/U.vTotal)}for(V=0;V$.vTotal/2?1:0,ne.halfangle=Math.PI*Math.min(ne.v/$.vTotal,.5),ne.ring=1-V.hole,ne.rInscribed=D(ne,$))}function Z(H,$){return[H*Math.sin($),-H*Math.cos($)]}function J(H,$,U){var V=H._fullLayout,j=U.trace,q=j.texttemplate,Y=j.textinfo;if(!q&&Y&&Y!=="none"){var K=Y.split("+"),te=function(Q){return K.indexOf(Q)!==-1},ne=te("label"),se=te("text"),le=te("value"),ce=te("percent"),pe=V.separators,xe;if(xe=ne?[$.label]:[],se){var ye=g.getFirstFilled(j.text,$.pts);y(ye)&&xe.push(ye)}le&&xe.push(g.formatPieValue($.v,pe)),ce&&xe.push(g.formatPiePercent($.v/U.vTotal,pe)),$.text=xe.join("
")}function fe(Q){return{label:Q.label,value:Q.v,valueLabel:g.formatPieValue(Q.v,V.separators),percent:Q.v/U.vTotal,percentLabel:g.formatPiePercent(Q.v/U.vTotal,V.separators),color:Q.color,text:Q.text,customdata:l.castOption(j,Q.i,"customdata")}}if(q){var ae=l.castOption(j,$.i,"texttemplate");if(!ae)$.text="";else{var ee=fe($),ie=g.getFirstFilled(j.text,$.pts);(y(ie)||ie==="")&&(ee.text=ie),$.text=l.texttemplateString({data:[ee,j._meta],fallback:j.texttemplatefallback,labels:ee,locale:H._fullLayout._d3locale,template:ae})}}}function N(H,$){var U=H.rotate*Math.PI/180,V=Math.cos(U),j=Math.sin(U),q=($.left+$.right)/2,Y=($.top+$.bottom)/2;H.textX=q*V-Y*j,H.textY=q*j+Y*V,H.noCenter=!0}r.exports={plot:_,formatSliceLabel:J,transformInsideText:w,determineInsideTextFont:M,positionTitleOutside:z,prerenderTitles:C,layoutAreas:G,attachFxHandlers:x,computeTransform:N}}}),j$=de({"src/traces/pie/style.js"(e,r){"use strict";var t=Yr(),i=d1(),a=dc().resizeText;r.exports=function(s){var l=s._fullLayout._pielayer.selectAll(".trace");a(s,l,"pie"),l.each(function(n){var u=n[0],c=u.trace,f=t.select(this);f.style({opacity:c.opacity}),f.selectAll("path.surface").each(function(h){t.select(this).call(i,h,c,s)})})}}}),U$=de({"src/traces/pie/base_plot.js"(e){"use strict";var r=Es();e.name="pie",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),q$=de({"src/traces/pie/index.js"(e,r){"use strict";r.exports={attributes:Pv(),supplyDefaults:Iv().supplyDefaults,supplyLayoutDefaults:O$(),layoutAttributes:R3(),calc:E1().calc,crossTraceCalc:E1().crossTraceCalc,plot:z3().plot,style:j$(),styleOne:d1(),moduleType:"trace",name:"pie",basePlotModule:U$(),categories:["pie-like","pie","showLegend"],meta:{}}}}),V$=de({"lib/pie.js"(e,r){"use strict";r.exports=q$()}}),G$=de({"src/traces/sunburst/base_plot.js"(e){"use strict";var r=Es();e.name="sunburst",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),PC=de({"src/traces/sunburst/constants.js"(e,r){"use strict";r.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),Zy=de({"src/traces/sunburst/attributes.js"(e,r){"use strict";var t=ri(),{hovertemplateAttrs:i,texttemplateAttrs:a,templatefallbackAttrs:o}=Vo(),s=cs(),l=Is().attributes,n=Pv(),u=PC(),c=fn().extendFlat,f=fu().pattern;r.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},n.marker.line.color,{dflt:null}),width:c({},n.marker.line.width,{dflt:1}),editType:"calc"},pattern:f,editType:"calc"},s("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:n.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:a({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),texttemplatefallback:o({editType:"plot"}),hovertext:n.hovertext,hoverinfo:c({},t.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:i({},{keys:u.eventDataKeys}),hovertemplatefallback:o(),textfont:n.textfont,insidetextorientation:n.insidetextorientation,insidetextfont:n.insidetextfont,outsidetextfont:c({},n.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:n.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:l({name:"sunburst",trace:!0,editType:"calc"})}}}),IC=de({"src/traces/sunburst/layout_attributes.js"(e,r){"use strict";r.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),H$=de({"src/traces/sunburst/defaults.js"(e,r){"use strict";var t=Qt(),i=Zy(),a=Is().defaults,o=oh().handleText,s=Iv().handleMarkerDefaults,l=ks(),n=l.hasColorscale,u=l.handleDefaults;r.exports=function(f,h,d,p){function g(M,C){return t.coerce(f,h,i,M,C)}var m=g("labels"),y=g("parents");if(!m||!m.length||!y||!y.length){h.visible=!1;return}var _=g("values");_&&_.length?g("branchvalues"):g("count"),g("level"),g("maxdepth"),s(f,h,p,g);var v=h._hasColorscale=n(f,"marker","colors")||(f.marker||{}).coloraxis;v&&u(f,h,p,g,{prefix:"marker.",cLetter:"c"}),g("leaf.opacity",v?1:.7);var x=g("text");g("texttemplate"),g("texttemplatefallback"),h.texttemplate||g("textinfo",t.isArrayOrTypedArray(x)?"text+label":"label"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var S="auto";o(f,h,p,g,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),g("insidetextorientation"),g("sort"),g("rotation"),g("root.color"),a(h,p,g),h._length=null}}}),$$=de({"src/traces/sunburst/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=IC();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("sunburstcolorway",s.colorway),l("extendsunburstcolors")}}}),Ky=de({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=t||self,i(t.d3=t.d3||{}))})(e,function(t){"use strict";function i(me,_e){return me.parent===_e.parent?1:2}function a(me){return me.reduce(o,0)/me.length}function o(me,_e){return me+_e.x}function s(me){return 1+me.reduce(l,0)}function l(me,_e){return Math.max(me,_e.y)}function n(me){for(var _e;_e=me.children;)me=_e[0];return me}function u(me){for(var _e;_e=me.children;)me=_e[_e.length-1];return me}function c(){var me=i,_e=1,Ae=1,ke=!1;function Ee(De){var Je,Ue=0;De.eachAfter(function(ht){var Gt=ht.children;Gt?(ht.x=a(Gt),ht.y=s(Gt)):(ht.x=Je?Ue+=me(ht,Je):0,ht.y=0,Je=ht)});var at=n(De),rt=u(De),ft=at.x-me(at,rt)/2,At=rt.x+me(rt,at)/2;return De.eachAfter(ke?function(ht){ht.x=(ht.x-De.x)*_e,ht.y=(De.y-ht.y)*Ae}:function(ht){ht.x=(ht.x-ft)/(At-ft)*_e,ht.y=(1-(De.y?ht.y/De.y:1))*Ae})}return Ee.separation=function(De){return arguments.length?(me=De,Ee):me},Ee.size=function(De){return arguments.length?(ke=!1,_e=+De[0],Ae=+De[1],Ee):ke?null:[_e,Ae]},Ee.nodeSize=function(De){return arguments.length?(ke=!0,_e=+De[0],Ae=+De[1],Ee):ke?[_e,Ae]:null},Ee}function f(me){var _e=0,Ae=me.children,ke=Ae&&Ae.length;if(!ke)_e=1;else for(;--ke>=0;)_e+=Ae[ke].value;me.value=_e}function h(){return this.eachAfter(f)}function d(me){var _e=this,Ae,ke=[_e],Ee,De,Je;do for(Ae=ke.reverse(),ke=[];_e=Ae.pop();)if(me(_e),Ee=_e.children,Ee)for(De=0,Je=Ee.length;De=0;--Ee)Ae.push(ke[Ee]);return this}function g(me){for(var _e=this,Ae=[_e],ke=[],Ee,De,Je;_e=Ae.pop();)if(ke.push(_e),Ee=_e.children,Ee)for(De=0,Je=Ee.length;De=0;)Ae+=ke[Ee].value;_e.value=Ae})}function y(me){return this.eachBefore(function(_e){_e.children&&_e.children.sort(me)})}function _(me){for(var _e=this,Ae=v(_e,me),ke=[_e];_e!==Ae;)_e=_e.parent,ke.push(_e);for(var Ee=ke.length;me!==Ae;)ke.splice(Ee,0,me),me=me.parent;return ke}function v(me,_e){if(me===_e)return me;var Ae=me.ancestors(),ke=_e.ancestors(),Ee=null;for(me=Ae.pop(),_e=ke.pop();me===_e;)Ee=me,me=Ae.pop(),_e=ke.pop();return Ee}function x(){for(var me=this,_e=[me];me=me.parent;)_e.push(me);return _e}function S(){var me=[];return this.each(function(_e){me.push(_e)}),me}function M(){var me=[];return this.eachBefore(function(_e){_e.children||me.push(_e)}),me}function C(){var me=this,_e=[];return me.each(function(Ae){Ae!==me&&_e.push({source:Ae.parent,target:Ae})}),_e}function w(me,_e){var Ae=new T(me),ke=+me.value&&(Ae.value=me.value),Ee,De=[Ae],Je,Ue,at,rt;for(_e==null&&(_e=A);Ee=De.pop();)if(ke&&(Ee.value=+Ee.data.value),(Ue=_e(Ee.data))&&(rt=Ue.length))for(Ee.children=new Array(rt),at=rt-1;at>=0;--at)De.push(Je=Ee.children[at]=new T(Ue[at])),Je.parent=Ee,Je.depth=Ee.depth+1;return Ae.eachBefore(E)}function k(){return w(this).eachBefore(b)}function A(me){return me.children}function b(me){me.data=me.data.data}function E(me){var _e=0;do me.height=_e;while((me=me.parent)&&me.height<++_e)}function T(me){this.data=me,this.depth=this.height=0,this.parent=null}T.prototype=w.prototype={constructor:T,count:h,each:d,eachAfter:g,eachBefore:p,sum:m,sort:y,path:_,ancestors:x,descendants:S,leaves:M,links:C,copy:k};var F=Array.prototype.slice;function D(me){for(var _e=me.length,Ae,ke;_e;)ke=Math.random()*_e--|0,Ae=me[_e],me[_e]=me[ke],me[ke]=Ae;return me}function R(me){for(var _e=0,Ae=(me=D(F.call(me))).length,ke=[],Ee,De;_e0&&Ae*Ae>ke*ke+Ee*Ee}function L(me,_e){for(var Ae=0;Ae<_e.length;++Ae)if(!I(me,_e[Ae]))return!1;return!0}function B(me){switch(me.length){case 1:return O(me[0]);case 2:return G(me[0],me[1]);case 3:return W(me[0],me[1],me[2])}}function O(me){return{x:me.x,y:me.y,r:me.r}}function G(me,_e){var Ae=me.x,ke=me.y,Ee=me.r,De=_e.x,Je=_e.y,Ue=_e.r,at=De-Ae,rt=Je-ke,ft=Ue-Ee,At=Math.sqrt(at*at+rt*rt);return{x:(Ae+De+at/At*ft)/2,y:(ke+Je+rt/At*ft)/2,r:(At+Ee+Ue)/2}}function W(me,_e,Ae){var ke=me.x,Ee=me.y,De=me.r,Je=_e.x,Ue=_e.y,at=_e.r,rt=Ae.x,ft=Ae.y,At=Ae.r,ht=ke-Je,Gt=ke-rt,fr=Ee-Ue,gt=Ee-ft,yt=at-De,kt=At-De,Lt=ke*ke+Ee*Ee-De*De,Ct=Lt-Je*Je-Ue*Ue+at*at,$t=Lt-rt*rt-ft*ft+At*At,mr=Gt*fr-ht*gt,br=(fr*$t-gt*Ct)/(mr*2)-ke,Er=(gt*yt-fr*kt)/mr,Tr=(Gt*Ct-ht*$t)/(mr*2)-Ee,Ur=(ht*kt-Gt*yt)/mr,Ai=Er*Er+Ur*Ur-1,oi=2*(De+br*Er+Tr*Ur),Qr=br*br+Tr*Tr-De*De,ea=-(Ai?(oi+Math.sqrt(oi*oi-4*Ai*Qr))/(2*Ai):Qr/oi);return{x:ke+br+Er*ea,y:Ee+Tr+Ur*ea,r:ea}}function X(me,_e,Ae){var ke=me.x-_e.x,Ee,De,Je=me.y-_e.y,Ue,at,rt=ke*ke+Je*Je;rt?(De=_e.r+Ae.r,De*=De,at=me.r+Ae.r,at*=at,De>at?(Ee=(rt+at-De)/(2*rt),Ue=Math.sqrt(Math.max(0,at/rt-Ee*Ee)),Ae.x=me.x-Ee*ke-Ue*Je,Ae.y=me.y-Ee*Je+Ue*ke):(Ee=(rt+De-at)/(2*rt),Ue=Math.sqrt(Math.max(0,De/rt-Ee*Ee)),Ae.x=_e.x+Ee*ke-Ue*Je,Ae.y=_e.y+Ee*Je+Ue*ke)):(Ae.x=_e.x+Ae.r,Ae.y=_e.y)}function Z(me,_e){var Ae=me.r+_e.r-1e-6,ke=_e.x-me.x,Ee=_e.y-me.y;return Ae>0&&Ae*Ae>ke*ke+Ee*Ee}function J(me){var _e=me._,Ae=me.next._,ke=_e.r+Ae.r,Ee=(_e.x*Ae.r+Ae.x*_e.r)/ke,De=(_e.y*Ae.r+Ae.y*_e.r)/ke;return Ee*Ee+De*De}function N(me){this._=me,this.next=null,this.previous=null}function H(me){if(!(Ee=me.length))return 0;var _e,Ae,ke,Ee,De,Je,Ue,at,rt,ft,At;if(_e=me[0],_e.x=0,_e.y=0,!(Ee>1))return _e.r;if(Ae=me[1],_e.x=-Ae.r,Ae.x=_e.r,Ae.y=0,!(Ee>2))return _e.r+Ae.r;X(Ae,_e,ke=me[2]),_e=new N(_e),Ae=new N(Ae),ke=new N(ke),_e.next=ke.previous=Ae,Ae.next=_e.previous=ke,ke.next=Ae.previous=_e;e:for(Ue=3;Ue0)throw new Error("cycle");return Ue}return Ae.id=function(ke){return arguments.length?(me=V(ke),Ae):me},Ae.parentId=function(ke){return arguments.length?(_e=V(ke),Ae):_e},Ae}function Q(me,_e){return me.parent===_e.parent?1:2}function ue(me){var _e=me.children;return _e?_e[0]:me.t}function ge(me){var _e=me.children;return _e?_e[_e.length-1]:me.t}function Me(me,_e,Ae){var ke=Ae/(_e.i-me.i);_e.c-=ke,_e.s+=Ae,me.c+=ke,_e.z+=Ae,_e.m+=Ae}function Te(me){for(var _e=0,Ae=0,ke=me.children,Ee=ke.length,De;--Ee>=0;)De=ke[Ee],De.z+=_e,De.m+=_e,_e+=De.s+(Ae+=De.c)}function je(me,_e,Ae){return me.a.parent===_e.parent?me.a:Ae}function Ve(me,_e){this._=me,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=_e}Ve.prototype=Object.create(T.prototype);function Ze(me){for(var _e=new Ve(me,0),Ae,ke=[_e],Ee,De,Je,Ue;Ae=ke.pop();)if(De=Ae._.children)for(Ae.children=new Array(Ue=De.length),Je=Ue-1;Je>=0;--Je)ke.push(Ee=Ae.children[Je]=new Ve(De[Je],Je)),Ee.parent=Ae;return(_e.parent=new Ve(null,0)).children=[_e],_e}function Ke(){var me=Q,_e=1,Ae=1,ke=null;function Ee(rt){var ft=Ze(rt);if(ft.eachAfter(De),ft.parent.m=-ft.z,ft.eachBefore(Je),ke)rt.eachBefore(at);else{var At=rt,ht=rt,Gt=rt;rt.eachBefore(function(Lt){Lt.xht.x&&(ht=Lt),Lt.depth>Gt.depth&&(Gt=Lt)});var fr=At===ht?1:me(At,ht)/2,gt=fr-At.x,yt=_e/(ht.x+fr+gt),kt=Ae/(Gt.depth||1);rt.eachBefore(function(Lt){Lt.x=(Lt.x+gt)*yt,Lt.y=Lt.depth*kt})}return rt}function De(rt){var ft=rt.children,At=rt.parent.children,ht=rt.i?At[rt.i-1]:null;if(ft){Te(rt);var Gt=(ft[0].z+ft[ft.length-1].z)/2;ht?(rt.z=ht.z+me(rt._,ht._),rt.m=rt.z-Gt):rt.z=Gt}else ht&&(rt.z=ht.z+me(rt._,ht._));rt.parent.A=Ue(rt,ht,rt.parent.A||At[0])}function Je(rt){rt._.x=rt.z+rt.parent.m,rt.m+=rt.parent.m}function Ue(rt,ft,At){if(ft){for(var ht=rt,Gt=rt,fr=ft,gt=ht.parent.children[0],yt=ht.m,kt=Gt.m,Lt=fr.m,Ct=gt.m,$t;fr=ge(fr),ht=ue(ht),fr&&ht;)gt=ue(gt),Gt=ge(Gt),Gt.a=rt,$t=fr.z+Lt-ht.z-yt+me(fr._,ht._),$t>0&&(Me(je(fr,rt,At),rt,$t),yt+=$t,kt+=$t),Lt+=fr.m,yt+=ht.m,Ct+=gt.m,kt+=Gt.m;fr&&!ge(Gt)&&(Gt.t=fr,Gt.m+=Lt-kt),ht&&!ue(gt)&&(gt.t=ht,gt.m+=yt-Ct,At=rt)}return At}function at(rt){rt.x*=_e,rt.y=rt.depth*Ae}return Ee.separation=function(rt){return arguments.length?(me=rt,Ee):me},Ee.size=function(rt){return arguments.length?(ke=!1,_e=+rt[0],Ae=+rt[1],Ee):ke?null:[_e,Ae]},Ee.nodeSize=function(rt){return arguments.length?(ke=!0,_e=+rt[0],Ae=+rt[1],Ee):ke?[_e,Ae]:null},Ee}function vt(me,_e,Ae,ke,Ee){for(var De=me.children,Je,Ue=-1,at=De.length,rt=me.value&&(Ee-Ae)/me.value;++UeLt&&(Lt=rt),br=yt*yt*mr,Ct=Math.max(Lt/br,br/kt),Ct>$t){yt-=rt;break}$t=Ct}Je.push(at={value:yt,dice:Gt1?ke:1)},Ae})(xt);function Mt(){var me=mt,_e=!1,Ae=1,ke=1,Ee=[0],De=j,Je=j,Ue=j,at=j,rt=j;function ft(ht){return ht.x0=ht.y0=0,ht.x1=Ae,ht.y1=ke,ht.eachBefore(At),Ee=[0],_e&&ht.eachBefore(le),ht}function At(ht){var Gt=Ee[ht.depth],fr=ht.x0+Gt,gt=ht.y0+Gt,yt=ht.x1-Gt,kt=ht.y1-Gt;yt=ht-1){var Lt=De[At];Lt.x0=fr,Lt.y0=gt,Lt.x1=yt,Lt.y1=kt;return}for(var Ct=rt[At],$t=Gt/2+Ct,mr=At+1,br=ht-1;mr>>1;rt[Er]<$t?mr=Er+1:br=Er}$t-rt[mr-1]kt-gt){var Ai=(fr*Ur+yt*Tr)/Gt;ft(At,mr,Tr,fr,gt,Ai,kt),ft(mr,ht,Ur,Ai,gt,yt,kt)}else{var oi=(gt*Ur+kt*Tr)/Gt;ft(At,mr,Tr,fr,gt,yt,oi),ft(mr,ht,Ur,fr,oi,yt,kt)}}}function qe(me,_e,Ae,ke,Ee){(me.depth&1?vt:ce)(me,_e,Ae,ke,Ee)}var Ye=(function me(_e){function Ae(ke,Ee,De,Je,Ue){if((at=ke._squarify)&&at.ratio===_e)for(var at,rt,ft,At,ht=-1,Gt,fr=at.length,gt=ke.value;++ht1?ke:1)},Ae})(xt);t.cluster=c,t.hierarchy=w,t.pack=K,t.packEnclose=R,t.packSiblings=$,t.partition=pe,t.stratify=ie,t.tree=Ke,t.treemap=Mt,t.treemapBinary=lt,t.treemapDice=ce,t.treemapResquarify=Ye,t.treemapSlice=vt,t.treemapSliceDice=qe,t.treemapSquarify=mt,Object.defineProperty(t,"__esModule",{value:!0})})}}),Jy=de({"src/traces/sunburst/calc.js"(e){"use strict";var r=Ky(),t=da(),i=Qt(),a=ks().makeColorScaleFuncFromTrace,o=E1().makePullColorFn,s=E1().generateExtendedColors,l=ks().calc,n=cn().ALMOST_EQUAL,u={},c={},f={};e.calc=function(d,p){var g=d._fullLayout,m=p.ids,y=i.isArrayOrTypedArray(m),_=p.labels,v=p.parents,x=p.values,S=i.isArrayOrTypedArray(x),M=[],C={},w={},k=function($,U){C[$]?C[$].push(U):C[$]=[U],w[U]=1},A=function($){return $||typeof $=="number"},b=function($){return!S||t(x[$])&&x[$]>=0},E,T,F;y?(E=Math.min(m.length,v.length),T=function($){return A(m[$])&&b($)},F=function($){return String(m[$])}):(E=Math.min(_.length,v.length),T=function($){return A(_[$])&&b($)},F=function($){return String(_[$])}),S&&(E=Math.min(E,x.length));for(var D=0;D1){for(var B=i.randstr(),O=0;O0}function a(d){var p=0,g=d.length;for(d[0]===239&&d[1]===187&&d[2]===191&&(p=3);p]*>/,s=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,l=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,n=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,u=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function f(d){var p=d.match(l),g=d.match(n),m=d.match(u);return{width:p&&(p[1]||p[2]),height:g&&(g[1]||g[2]),viewbox:m&&(m[1]||m[2])}}function h(d){return c.test(d)?d.match(c)[0]:"px"}r.exports=function(d){if(a(d)){for(var p="",g=0;g>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function f(h,d){return{width:(h[d+6]<<16|h[d+5]<<8|h[d+4])+1,height:(h[d+9]<<16|h[d+8]<<8|h[d+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}r.exports=function(h){if(!(h.length<16)&&!(!i(h,0,l)||!i(h,8,n))){var d=12,p=null,g=0,m=o(h,4)+8;if(!(m>h.length)){for(;d+8=10?p=p||u(h,d+8):y==="VP8L"&&_>=5?p=p||c(h,d+8):y==="VP8X"&&_>=10?p=p||f(h,d+8):y==="EXIF"&&(g=s.get_orientation(h.slice(d+8,d+8+_)),d=1/0),d+=8+_}if(p)return g>0&&(p.orientation=g),p}}}}}),k$=de({"node_modules/probe-image-size/lib/parsers_sync.js"(e,r){"use strict";r.exports={avif:y$(),bmp:_$(),gif:x$(),ico:b$(),jpeg:w$(),png:T$(),psd:A$(),svg:M$(),tiff:S$(),webp:E$()}}}),C$=de({"node_modules/probe-image-size/sync.js"(e,r){"use strict";var t=k$();function i(a){for(var o=Object.keys(t),s=0;s0&&l.height>0?l:null}return null}r.exports=function(o){return i(o)},r.exports.parsers=t}}),D$=de({"src/traces/image/helpers.js"(e){"use strict";var r=C$(),t=Sp().IMAGE_URL_PREFIX,i=Cv().Buffer;e.getImageSize=function(a){var o=a.replace(t,""),s=new i(o,"base64");return r(s)}}}),L$=de({"src/traces/image/calc.js"(e,r){"use strict";var t=Qt(),i=A1(),a=da(),o=nn(),s=Qt().maxRowLength,l=D$().getImageSize;r.exports=function(h,d){var p,g;if(d._hasZ)p=d.z.length,g=s(d.z);else if(d._hasSource){var m=l(d.source);p=m.height,g=m.width}var y=o.getFromId(h,d.xaxis||"x"),_=o.getFromId(h,d.yaxis||"y"),v=y.d2c(d.x0)-d.dx/2,x=_.d2c(d.y0)-d.dy/2,S,M=[v,v+g*d.dx],C=[x,x+p*d.dy];if(y&&y.type==="log")for(S=0;S0;)F=p.c2p(C+z*b),z--;for(z=0;R===void 0&&z0;)P=g.c2p(w+z*E),z--;if(FN[0];if(H||$){var U=T+L/2,V=R+B/2;Z+="transform:"+a(U+"px",V+"px")+"scale("+(H?-1:1)+","+($?-1:1)+")"+a(-U+"px",-V+"px")+";"}}X.attr("style",Z);var j=new Promise(function(q){if(x._hasZ)q();else if(x._hasSource)if(x._canvas&&x._canvas.el.width===k&&x._canvas.el.height===A&&x._canvas.source===x.source)q();else{var Y=document.createElement("canvas");Y.width=k,Y.height=A;var K=Y.getContext("2d",{willReadFrequently:!0});x._image=x._image||new Image;var te=x._image;te.onload=function(){K.drawImage(te,0,0),x._canvas={el:Y,source:x.source},q()},te.setAttribute("src",x.source)}}).then(function(){var q,Y;if(x._hasZ)Y=W(function(ne,se){var le=M[se][ne];return i.isTypedArray(le)&&(le=Array.from(le)),le}),q=Y.toDataURL("image/png");else if(x._hasSource)if(S)q=x.source;else{var K=x._canvas.el.getContext("2d",{willReadFrequently:!0}),te=K.getImageData(0,0,k,A).data;Y=W(function(ne,se){var le=4*(se*k+ne);return[te[le],te[le+1],te[le+2],te[le+3]]}),q=Y.toDataURL("image/png")}X.attr({"xlink:href":q,height:B,width:L,x:T,y:R})});c._promises.push(j)})}}}),P$=de({"src/traces/image/style.js"(e,r){"use strict";var t=Yr();r.exports=function(a){t.select(a).selectAll(".im image").style("opacity",function(o){return o[0].trace.opacity})}}}),I$=de({"src/traces/image/hover.js"(e,r){"use strict";var t=$s(),i=Qt(),a=i.isArrayOrTypedArray,o=A1();r.exports=function(l,n,u){var c=l.cd[0],f=c.trace,h=l.xa,d=l.ya;if(!(t.inbox(n-c.x0,n-(c.x0+c.w*f.dx),0)>0||t.inbox(u-c.y0,u-(c.y0+c.h*f.dy),0)>0)){var p=Math.floor((n-c.x0)/f.dx),g=Math.floor(Math.abs(u-c.y0)/f.dy),m;if(f._hasZ?m=c.z[g][p]:f._hasSource&&(m=f._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(p,g,1,1).data),!!m){var y=c.hi||f.hoverinfo,_;if(y){var v=y.split("+");v.indexOf("all")!==-1&&(v=["color"]),v.indexOf("color")!==-1&&(_=!0)}var x=o.colormodel[f.colormodel],S=x.colormodel||f.colormodel,M=S.length,C=f._scaler(m),w=x.suffix,k=[];(f.hovertemplate||_)&&(k.push("["+[C[0]+w[0],C[1]+w[1],C[2]+w[2]].join(", ")),M===4&&k.push(", "+C[3]+w[3]),k.push("]"),k=k.join(""),l.extraText=S.toUpperCase()+": "+k);var A;a(f.hovertext)&&a(f.hovertext[g])?A=f.hovertext[g][p]:a(f.text)&&a(f.text[g])&&(A=f.text[g][p]);var b=d.c2p(c.y0+(g+.5)*f.dy),E=c.x0+(p+.5)*f.dx,T=c.y0+(g+.5)*f.dy,F="["+m.slice(0,f.colormodel.length).join(", ")+"]";return[i.extendFlat(l,{index:[g,p],x0:h.c2p(c.x0+p*f.dx),x1:h.c2p(c.x0+(p+1)*f.dx),y0:b,y1:b,color:C,xVal:E,xLabelVal:E,yVal:T,yLabelVal:T,zLabelVal:F,text:A,hovertemplateLabels:{zLabel:F,colorLabel:k,"color[0]Label":C[0]+w[0],"color[1]Label":C[1]+w[1],"color[2]Label":C[2]+w[2],"color[3]Label":C[3]+w[3]}})]}}}}}),R$=de({"src/traces/image/event_data.js"(e,r){"use strict";r.exports=function(i,a){return"xVal"in a&&(i.x=a.xVal),"yVal"in a&&(i.y=a.yVal),a.xa&&(i.xaxis=a.xa),a.ya&&(i.yaxis=a.ya),i.color=a.color,i.colormodel=a.trace.colormodel,i.z||(i.z=a.color),i}}}),z$=de({"src/traces/image/index.js"(e,r){"use strict";r.exports={attributes:(lC(),ti(_3)).default,supplyDefaults:mH(),calc:L$(),plot:F$(),style:P$(),hoverPoints:I$(),eventData:R$(),moduleType:"trace",name:"image",basePlotModule:ml(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),B$=de({"lib/image.js"(e,r){"use strict";r.exports=z$()}}),Iv=de({"src/traces/pie/attributes.js"(e,r){"use strict";var t=ri(),i=Rs().attributes,a=us(),o=Jo(),{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:n}=Vo(),u=fn().extendFlat,c=fu().pattern,f=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});r.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},t.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:n(),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:n({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},f,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},f,{}),outsidetextfont:u({},f,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:u({},t.showlegend,{arrayOk:!0}),legend:u({},t.legend,{arrayOk:!0}),legendrank:u({},t.legendrank,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},f,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Rv=de({"src/traces/pie/defaults.js"(e,r){"use strict";var t=da(),i=Qt(),a=Iv(),o=Rs().defaults,s=sh().handleText,l=Qt().coercePattern;function n(f,h){var d=i.isArrayOrTypedArray(f),p=i.isArrayOrTypedArray(h),g=Math.min(d?f.length:1/0,p?h.length:1/0);if(isFinite(g)||(g=0),g&&p){for(var m,y=0;y0){m=!0;break}}m||(g=0)}return{hasLabels:d,hasValues:p,len:g}}function u(f,h,d,p,g){var m=p("marker.line.width");m&&p("marker.line.color",g?void 0:d.paper_bgcolor);var y=p("marker.colors");l(p,"marker.pattern",y),f.marker&&!h.marker.pattern.fgcolor&&(h.marker.pattern.fgcolor=f.marker.colors),h.marker.pattern.bgcolor||(h.marker.pattern.bgcolor=d.paper_bgcolor)}function c(f,h,d,p){function g(T,F){return i.coerce(f,h,a,T,F)}var m=g("labels"),y=g("values"),_=n(m,y),v=_.len;if(h._hasLabels=_.hasLabels,h._hasValues=_.hasValues,!h._hasLabels&&h._hasValues&&(g("label0"),g("dlabel")),!v){h.visible=!1;return}h._length=v,u(f,h,p,g,!0),g("scalegroup");var x=g("text"),S=g("texttemplate");g("texttemplatefallback");var M;if(S||(M=g("textinfo",i.isArrayOrTypedArray(x)?"text+percent":"percent")),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback"),S||M&&M!=="none"){var C=g("textposition");s(f,h,p,g,C,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var w=Array.isArray(C)||C==="auto",k=w||C==="outside";k&&g("automargin"),(C==="inside"||C==="auto"||Array.isArray(C))&&g("insidetextorientation")}else M==="none"&&g("textposition","none");o(h,p,g);var A=g("hole"),b=g("title.text");if(b){var E=g("title.position",A?"middle center":"top center");!A&&E==="middle center"&&(h.title.position="top center"),i.coerceFont(g,"title.font",p.font)}g("sort"),g("direction"),g("rotation"),g("pull")}r.exports={handleLabelsAndValues:n,handleMarkerDefaults:u,supplyDefaults:c}}}),R3=de({"src/traces/pie/layout_attributes.js"(e,r){"use strict";r.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),O$=de({"src/traces/pie/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=R3();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("hiddenlabels"),l("piecolorway",s.colorway),l("extendpiecolors")}}}),k1=de({"src/traces/pie/calc.js"(e,r){"use strict";var t=da(),i=ta(),a={};function o(u,c){var f=[],h=u._fullLayout,d=h.hiddenlabels||[],p=c.labels,g=c.marker.colors||[],m=c.values,y=c._length,_=c._hasValues&&y,v,x;if(c.dlabel)for(p=new Array(y),v=0;v=0});var T=c.type==="funnelarea"?w:c.sort;return T&&f.sort(function(F,D){return D.v-F.v}),f[0]&&(f[0].vTotal=C),f}function s(u){return function(f,h){if(!f||!i.isValid(f))return!1;let d=i.rgbaString(f);return u[h]||(u[h]=d),d}}function l(u,c){var f=(c||{}).type;f||(f="pie");var h=u._fullLayout,d=u.calcdata,p=h[f+"colorway"],g=h["_"+f+"colormap"];h["extend"+f+"colors"]&&(p=n(p,a));for(var m=0,y=0;y0&&(ge+=Ve*Q.pxmid[0],Me+=Ve*Q.pxmid[1])}Q.cxFinal=ge,Q.cyFinal=Me;function Ke(lt,qe,Ye,me){var _e=me*(qe[0]-lt[0]),Ae=me*(qe[1]-lt[1]);return"a"+me*te.r+","+me*te.r+" 0 "+Q.largeArc+(Ye?" 1 ":" 0 ")+_e+","+Ae}var Je=ne.hole;if(Q.v===te.vTotal){var vt="M"+(ge+Q.px0[0])+","+(Me+Q.px0[1])+Ke(Q.px0,Q.pxmid,!0,1)+Ke(Q.pxmid,Q.px0,!0,1)+"Z";Je?je.attr("d","M"+(ge+Je*Q.px0[0])+","+(Me+Je*Q.px0[1])+Ke(Q.px0,Q.pxmid,!1,Je)+Ke(Q.pxmid,Q.px0,!1,Je)+"Z"+vt):je.attr("d",vt)}else{var xt=Ke(Q.px0,Q.px1,!0,1);if(Je){var Pt=1-Je;je.attr("d","M"+(ge+Je*Q.px1[0])+","+(Me+Je*Q.px1[1])+Ke(Q.px1,Q.px0,!1,Je)+"l"+Pt*Q.px0[0]+","+Pt*Q.px0[1]+xt+"Z")}else je.attr("d","M"+ge+","+Me+"l"+Q.px0[0]+","+Q.px0[1]+xt+"Z")}J(H,Q,te);var mt=g.castOption(ne.textposition,Q.pts),Mt=Te.selectAll("g.slicetext").data(Q.text&&mt!=="none"?[0]:[]);Mt.enter().append("g").classed("slicetext",!0),Mt.exit().remove(),Mt.each(function(){var lt=l.ensureSingle(t.select(this),"text","",function(De){De.attr("data-notex",1)}),qe=l.ensureUniformFontSize(H,mt==="outside"?S(ne,Q,V.font):M(ne,Q,V.font));lt.text(Q.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,qe).call(c.convertToTspans,H);var Ye=s.bBox(lt.node()),me;if(mt==="outside")me=R(Ye,Q);else if(me=w(Ye,Q,te),mt==="auto"&&me.scale<1){var _e=l.ensureUniformFontSize(H,ne.outsidetextfont);lt.call(s.font,_e),Ye=s.bBox(lt.node()),me=R(Ye,Q)}var Ae=me.textPosAngle,ke=Ae===void 0?Q.pxmid:Z(te.r,Ae);if(me.targetX=ge+ke[0]*me.rCenter+(me.x||0),me.targetY=Me+ke[1]*me.rCenter+(me.y||0),N(me,Ye),me.outside){var Ee=me.targetY;Q.yLabelMin=Ee-Ye.height/2,Q.yLabelMid=Ee,Q.yLabelMax=Ee+Ye.height/2,Q.labelExtraX=0,Q.labelExtraY=0,ce=!0}me.fontSize=qe.size,h(ne.type,me,V),Y[ue].transform=me,l.setTransormAndDisplay(lt,me)})});var pe=t.select(this).selectAll("g.titletext").data(ne.title.text?[0]:[]);if(pe.enter().append("g").classed("titletext",!0),pe.exit().remove(),pe.each(function(){var Q=l.ensureSingle(t.select(this),"text","",function(Me){Me.attr("data-notex",1)}),ue=ne.title.text;ne._meta&&(ue=l.templateString(ue,ne._meta)),Q.text(ue).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,ne.title.font).call(c.convertToTspans,H);var ge;ne.title.position==="middle center"?ge=P(te):ge=z(te,j),Q.attr("transform",u(ge.x,ge.y)+n(Math.min(1,ge.scale))+u(ge.tx,ge.ty))}),ce&&O(le,ne),v(se,ne),ce&&ne.automargin){var xe=s.bBox(K.node()),ye=ne.domain,fe=j.w*(ye.x[1]-ye.x[0]),ae=j.h*(ye.y[1]-ye.y[0]),ee=(.5*fe-te.r)/j.w,ie=(.5*ae-te.r)/j.h;i.autoMargin(H,"pie."+ne.uid+".automargin",{xl:ye.x[0]-ee,xr:ye.x[1]+ee,yb:ye.y[0]-ie,yt:ye.y[1]+ie,l:Math.max(te.cx-te.r-xe.left,0),r:Math.max(xe.right-(te.cx+te.r),0),b:Math.max(xe.bottom-(te.cy+te.r),0),t:Math.max(te.cy-te.r-xe.top,0),pad:5})}})});setTimeout(function(){q.selectAll("tspan").each(function(){var Y=t.select(this);Y.attr("dy")&&Y.attr("dy",Y.attr("dy"))})},0)}function v(H,$){H.each(function(U){var V=t.select(this);if(!U.labelExtraX&&!U.labelExtraY){V.select("path.textline").remove();return}var j=V.select("g.slicetext text");U.transform.targetX+=U.labelExtraX,U.transform.targetY+=U.labelExtraY,l.setTransormAndDisplay(j,U.transform);var q=U.cxFinal+U.pxmid[0],Y=U.cyFinal+U.pxmid[1],K="M"+q+","+Y,te=(U.yLabelMax-U.yLabelMin)*(U.pxmid[0]<0?-1:1)/4;if(U.labelExtraX){var ne=U.labelExtraX*U.pxmid[1]/U.pxmid[0],se=U.yLabelMid+U.labelExtraY-(U.cyFinal+U.pxmid[1]);Math.abs(ne)>Math.abs(se)?K+="l"+se*U.pxmid[0]/U.pxmid[1]+","+se+"H"+(q+U.labelExtraX+te):K+="l"+U.labelExtraX+","+ne+"v"+(se-ne)+"h"+te}else K+="V"+(U.yLabelMid+U.labelExtraY)+"h"+te;l.ensureSingle(V,"path","textline").call(o.stroke,$.outsidetextfont.color).attr({"stroke-width":Math.min(2,$.outsidetextfont.size/8),d:K,fill:"none"})})}function x(H,$,U){var V=U[0],j=V.cx,q=V.cy,Y=V.trace,K=Y.type==="funnelarea";"_hasHoverLabel"in Y||(Y._hasHoverLabel=!1),"_hasHoverEvent"in Y||(Y._hasHoverEvent=!1),H.on("mouseover",function(te){var ne=$._fullLayout,se=$._fullData[Y.index];if(!($._dragging||ne.hovermode===!1)){var le=se.hoverinfo;if(Array.isArray(le)&&(le=a.castHoverinfo({hoverinfo:[g.castOption(le,te.pts)],_module:Y._module},ne,0)),le==="all"&&(le="label+text+value+percent+name"),se.hovertemplate||le!=="none"&&le!=="skip"&&le){var ce=te.rInscribed||0,pe=j+te.pxmid[0]*(1-ce),xe=q+te.pxmid[1]*(1-ce),ye=ne.separators,fe=[];if(le&&le.indexOf("label")!==-1&&fe.push(te.label),te.text=g.castOption(se.hovertext||se.text,te.pts),le&&le.indexOf("text")!==-1){var ae=te.text;l.isValidTextValue(ae)&&fe.push(ae)}te.value=te.v,te.valueLabel=g.formatPieValue(te.v,ye),le&&le.indexOf("value")!==-1&&fe.push(te.valueLabel),te.percent=te.v/V.vTotal,te.percentLabel=g.formatPiePercent(te.percent,ye),le&&le.indexOf("percent")!==-1&&fe.push(te.percentLabel);var ee=se.hoverlabel,ie=ee.font,Q=[];a.loneHover({trace:Y,x0:pe-ce*V.r,x1:pe+ce*V.r,y:xe,_x0:K?j+te.TL[0]:pe-ce*V.r,_x1:K?j+te.TR[0]:pe+ce*V.r,_y0:K?q+te.TL[1]:xe-ce*V.r,_y1:K?q+te.BL[1]:xe+ce*V.r,text:fe.join("
"),name:se.hovertemplate||le.indexOf("name")!==-1?se.name:void 0,idealAlign:te.pxmid[0]<0?"left":"right",color:g.castOption(ee.bgcolor,te.pts)||te.color,borderColor:g.castOption(ee.bordercolor,te.pts),fontFamily:g.castOption(ie.family,te.pts),fontSize:g.castOption(ie.size,te.pts),fontColor:g.castOption(ie.color,te.pts),nameLength:g.castOption(ee.namelength,te.pts),textAlign:g.castOption(ee.align,te.pts),hovertemplate:g.castOption(se.hovertemplate,te.pts),hovertemplateLabels:te,eventData:[m(te,se)]},{container:ne._hoverlayer.node(),outerContainer:ne._paper.node(),gd:$,inOut_bbox:Q}),te.bbox=Q[0],Y._hasHoverLabel=!0}Y._hasHoverEvent=!0,$.emit("plotly_hover",{points:[m(te,se)],event:t.event})}}),H.on("mouseout",function(te){var ne=$._fullLayout,se=$._fullData[Y.index],le=t.select(this).datum();Y._hasHoverEvent&&(te.originalEvent=t.event,$.emit("plotly_unhover",{points:[m(le,se)],event:t.event}),Y._hasHoverEvent=!1),Y._hasHoverLabel&&(a.loneUnhover(ne._hoverlayer.node()),Y._hasHoverLabel=!1)}),H.on("click",function(te){var ne=$._fullLayout,se=$._fullData[Y.index];$._dragging||ne.hovermode===!1||($._hoverdata=[m(te,se)],a.click($,t.event))})}function S(H,$,U){var V=g.castOption(H.outsidetextfont.color,$.pts)||g.castOption(H.textfont.color,$.pts)||U.color,j=g.castOption(H.outsidetextfont.family,$.pts)||g.castOption(H.textfont.family,$.pts)||U.family,q=g.castOption(H.outsidetextfont.size,$.pts)||g.castOption(H.textfont.size,$.pts)||U.size,Y=g.castOption(H.outsidetextfont.weight,$.pts)||g.castOption(H.textfont.weight,$.pts)||U.weight,K=g.castOption(H.outsidetextfont.style,$.pts)||g.castOption(H.textfont.style,$.pts)||U.style,te=g.castOption(H.outsidetextfont.variant,$.pts)||g.castOption(H.textfont.variant,$.pts)||U.variant,ne=g.castOption(H.outsidetextfont.textcase,$.pts)||g.castOption(H.textfont.textcase,$.pts)||U.textcase,se=g.castOption(H.outsidetextfont.lineposition,$.pts)||g.castOption(H.textfont.lineposition,$.pts)||U.lineposition,le=g.castOption(H.outsidetextfont.shadow,$.pts)||g.castOption(H.textfont.shadow,$.pts)||U.shadow;return{color:V,family:j,size:q,weight:Y,style:K,variant:te,textcase:ne,lineposition:se,shadow:le}}function M(H,$,U){var V=g.castOption(H.insidetextfont.color,$.pts);!V&&H._input.textfont&&(V=g.castOption(H._input.textfont.color,$.pts));var j=g.castOption(H.insidetextfont.family,$.pts)||g.castOption(H.textfont.family,$.pts)||U.family,q=g.castOption(H.insidetextfont.size,$.pts)||g.castOption(H.textfont.size,$.pts)||U.size,Y=g.castOption(H.insidetextfont.weight,$.pts)||g.castOption(H.textfont.weight,$.pts)||U.weight,K=g.castOption(H.insidetextfont.style,$.pts)||g.castOption(H.textfont.style,$.pts)||U.style,te=g.castOption(H.insidetextfont.variant,$.pts)||g.castOption(H.textfont.variant,$.pts)||U.variant,ne=g.castOption(H.insidetextfont.textcase,$.pts)||g.castOption(H.textfont.textcase,$.pts)||U.textcase,se=g.castOption(H.insidetextfont.lineposition,$.pts)||g.castOption(H.textfont.lineposition,$.pts)||U.lineposition,le=g.castOption(H.insidetextfont.shadow,$.pts)||g.castOption(H.textfont.shadow,$.pts)||U.shadow;return{color:V||o.contrast($.color),family:j,size:q,weight:Y,style:K,variant:te,textcase:ne,lineposition:se,shadow:le}}function C(H,$){for(var U,V,j=0;j=-4;ee-=2)ae(Math.PI*ee,"tan");for(ee=4;ee>=-4;ee-=2)ae(Math.PI*(ee+1),"tan")}if(le||pe){for(ee=4;ee>=-4;ee-=2)ae(Math.PI*(ee+1.5),"rad");for(ee=4;ee>=-4;ee-=2)ae(Math.PI*(ee+.5),"rad")}}if(K||xe||le){var ie=Math.sqrt(H.width*H.width+H.height*H.height);if(fe={scale:j*V*2/ie,rCenter:1-j,rotate:0},fe.textPosAngle=($.startangle+$.stopangle)/2,fe.scale>=1)return fe;ye.push(fe)}(xe||pe)&&(fe=A(H,V,Y,te,ne),fe.textPosAngle=($.startangle+$.stopangle)/2,ye.push(fe)),(xe||ce)&&(fe=b(H,V,Y,te,ne),fe.textPosAngle=($.startangle+$.stopangle)/2,ye.push(fe));for(var Q=0,ue=0,ge=0;ge=1)break}return ye[Q]}function k(H,$){var U=H.startangle,V=H.stopangle;return U>$&&$>V||U<$&&$0?1:-1)/2,y:q/(1+U*U/(V*V)),outside:!0}}function P(H){var $=Math.sqrt(H.titleBox.width*H.titleBox.width+H.titleBox.height*H.titleBox.height);return{x:H.cx,y:H.cy,scale:H.trace.hole*H.r*2/$,tx:0,ty:-H.titleBox.height/2+H.trace.title.font.size}}function z(H,$){var U=1,V=1,j,q=H.trace,Y={x:H.cx,y:H.cy},K={tx:0,ty:0};K.ty+=q.title.font.size,j=B(q),q.title.position.indexOf("top")!==-1?(Y.y-=(1+j)*H.r,K.ty-=H.titleBox.height):q.title.position.indexOf("bottom")!==-1&&(Y.y+=(1+j)*H.r);var te=I(H.r,H.trace.aspectratio),ne=$.w*(q.domain.x[1]-q.domain.x[0])/2;return q.title.position.indexOf("left")!==-1?(ne=ne+te,Y.x-=(1+j)*te,K.tx+=H.titleBox.width/2):q.title.position.indexOf("center")!==-1?ne*=2:q.title.position.indexOf("right")!==-1&&(ne=ne+te,Y.x+=(1+j)*te,K.tx-=H.titleBox.width/2),U=ne/H.titleBox.width,V=L(H,$)/H.titleBox.height,{x:Y.x,y:Y.y,scale:Math.min(U,V),tx:K.tx,ty:K.ty}}function I(H,$){return H/($===void 0?1:$)}function L(H,$){var U=H.trace,V=$.h*(U.domain.y[1]-U.domain.y[0]);return Math.min(H.titleBox.height,V/2)}function B(H){var $=H.pull;if(!$)return 0;var U;if(l.isArrayOrTypedArray($))for($=0,U=0;U$&&($=H.pull[U]);return $}function O(H,$){var U,V,j,q,Y,K,te,ne,se,le,ce,pe,xe;function ye(ie,Q){return ie.pxmid[1]-Q.pxmid[1]}function fe(ie,Q){return Q.pxmid[1]-ie.pxmid[1]}function ae(ie,Q){Q||(Q={});var ue=Q.labelExtraY+(V?Q.yLabelMax:Q.yLabelMin),ge=V?ie.yLabelMin:ie.yLabelMax,Me=V?ie.yLabelMax:ie.yLabelMin,Te=ie.cyFinal+Y(ie.px0[1],ie.px1[1]),je=ue-ge,Ve,Ke,Je,vt,xt,Pt;if(je*te>0&&(ie.labelExtraY=je),!!l.isArrayOrTypedArray($.pull))for(Ke=0;Ke=(g.castOption($.pull,Je.pts)||0))&&((ie.pxmid[1]-Je.pxmid[1])*te>0?(vt=Je.cyFinal+Y(Je.px0[1],Je.px1[1]),je=vt-ge-ie.labelExtraY,je*te>0&&(ie.labelExtraY+=je)):(Me+ie.labelExtraY-Te)*te>0&&(Ve=3*K*Math.abs(Ke-le.indexOf(ie)),xt=Je.cxFinal+q(Je.px0[0],Je.px1[0]),Pt=xt+Ve-(ie.cxFinal+ie.pxmid[0])-ie.labelExtraX,Pt*K>0&&(ie.labelExtraX+=Pt)))}for(V=0;V<2;V++)for(j=V?ye:fe,Y=V?Math.max:Math.min,te=V?1:-1,U=0;U<2;U++){for(q=U?Math.max:Math.min,K=U?1:-1,ne=H[V][U],ne.sort(j),se=H[1-V][U],le=se.concat(ne),pe=[],ce=0;ce1?(ne=U.r,se=ne/j.aspectratio):(se=U.r,ne=se*j.aspectratio),ne*=(1+j.baseratio)/2,te=ne*se}Y=Math.min(Y,te/U.vTotal)}for(V=0;V$.vTotal/2?1:0,ne.halfangle=Math.PI*Math.min(ne.v/$.vTotal,.5),ne.ring=1-V.hole,ne.rInscribed=D(ne,$))}function Z(H,$){return[H*Math.sin($),-H*Math.cos($)]}function J(H,$,U){var V=H._fullLayout,j=U.trace,q=j.texttemplate,Y=j.textinfo;if(!q&&Y&&Y!=="none"){var K=Y.split("+"),te=function(Q){return K.indexOf(Q)!==-1},ne=te("label"),se=te("text"),le=te("value"),ce=te("percent"),pe=V.separators,xe;if(xe=ne?[$.label]:[],se){var ye=g.getFirstFilled(j.text,$.pts);y(ye)&&xe.push(ye)}le&&xe.push(g.formatPieValue($.v,pe)),ce&&xe.push(g.formatPiePercent($.v/U.vTotal,pe)),$.text=xe.join("
")}function fe(Q){return{label:Q.label,value:Q.v,valueLabel:g.formatPieValue(Q.v,V.separators),percent:Q.v/U.vTotal,percentLabel:g.formatPiePercent(Q.v/U.vTotal,V.separators),color:Q.color,text:Q.text,customdata:l.castOption(j,Q.i,"customdata")}}if(q){var ae=l.castOption(j,$.i,"texttemplate");if(!ae)$.text="";else{var ee=fe($),ie=g.getFirstFilled(j.text,$.pts);(y(ie)||ie==="")&&(ee.text=ie),$.text=l.texttemplateString({data:[ee,j._meta],fallback:j.texttemplatefallback,labels:ee,locale:H._fullLayout._d3locale,template:ae})}}}function N(H,$){var U=H.rotate*Math.PI/180,V=Math.cos(U),j=Math.sin(U),q=($.left+$.right)/2,Y=($.top+$.bottom)/2;H.textX=q*V-Y*j,H.textY=q*j+Y*V,H.noCenter=!0}r.exports={plot:_,formatSliceLabel:J,transformInsideText:w,determineInsideTextFont:M,positionTitleOutside:z,prerenderTitles:C,layoutAreas:G,attachFxHandlers:x,computeTransform:N}}}),j$=de({"src/traces/pie/style.js"(e,r){"use strict";var t=Yr(),i=p1(),a=dc().resizeText;r.exports=function(s){var l=s._fullLayout._pielayer.selectAll(".trace");a(s,l,"pie"),l.each(function(n){var u=n[0],c=u.trace,f=t.select(this);f.style({opacity:c.opacity}),f.selectAll("path.surface").each(function(h){t.select(this).call(i,h,c,s)})})}}}),U$=de({"src/traces/pie/base_plot.js"(e){"use strict";var r=ks();e.name="pie",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),q$=de({"src/traces/pie/index.js"(e,r){"use strict";r.exports={attributes:Iv(),supplyDefaults:Rv().supplyDefaults,supplyLayoutDefaults:O$(),layoutAttributes:R3(),calc:k1().calc,crossTraceCalc:k1().crossTraceCalc,plot:z3().plot,style:j$(),styleOne:p1(),moduleType:"trace",name:"pie",basePlotModule:U$(),categories:["pie-like","pie","showLegend"],meta:{}}}}),V$=de({"lib/pie.js"(e,r){"use strict";r.exports=q$()}}),G$=de({"src/traces/sunburst/base_plot.js"(e){"use strict";var r=ks();e.name="sunburst",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),PC=de({"src/traces/sunburst/constants.js"(e,r){"use strict";r.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),Zy=de({"src/traces/sunburst/attributes.js"(e,r){"use strict";var t=ri(),{hovertemplateAttrs:i,texttemplateAttrs:a,templatefallbackAttrs:o}=Vo(),s=cs(),l=Rs().attributes,n=Iv(),u=PC(),c=fn().extendFlat,f=fu().pattern;r.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},n.marker.line.color,{dflt:null}),width:c({},n.marker.line.width,{dflt:1}),editType:"calc"},pattern:f,editType:"calc"},s("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:n.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:a({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),texttemplatefallback:o({editType:"plot"}),hovertext:n.hovertext,hoverinfo:c({},t.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:i({},{keys:u.eventDataKeys}),hovertemplatefallback:o(),textfont:n.textfont,insidetextorientation:n.insidetextorientation,insidetextfont:n.insidetextfont,outsidetextfont:c({},n.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:n.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:l({name:"sunburst",trace:!0,editType:"calc"})}}}),IC=de({"src/traces/sunburst/layout_attributes.js"(e,r){"use strict";r.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),H$=de({"src/traces/sunburst/defaults.js"(e,r){"use strict";var t=Qt(),i=Zy(),a=Rs().defaults,o=sh().handleText,s=Rv().handleMarkerDefaults,l=Cs(),n=l.hasColorscale,u=l.handleDefaults;r.exports=function(f,h,d,p){function g(M,C){return t.coerce(f,h,i,M,C)}var m=g("labels"),y=g("parents");if(!m||!m.length||!y||!y.length){h.visible=!1;return}var _=g("values");_&&_.length?g("branchvalues"):g("count"),g("level"),g("maxdepth"),s(f,h,p,g);var v=h._hasColorscale=n(f,"marker","colors")||(f.marker||{}).coloraxis;v&&u(f,h,p,g,{prefix:"marker.",cLetter:"c"}),g("leaf.opacity",v?1:.7);var x=g("text");g("texttemplate"),g("texttemplatefallback"),h.texttemplate||g("textinfo",t.isArrayOrTypedArray(x)?"text+label":"label"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var S="auto";o(f,h,p,g,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),g("insidetextorientation"),g("sort"),g("rotation"),g("root.color"),a(h,p,g),h._length=null}}}),$$=de({"src/traces/sunburst/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=IC();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("sunburstcolorway",s.colorway),l("extendsunburstcolors")}}}),Ky=de({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=t||self,i(t.d3=t.d3||{}))})(e,function(t){"use strict";function i(me,_e){return me.parent===_e.parent?1:2}function a(me){return me.reduce(o,0)/me.length}function o(me,_e){return me+_e.x}function s(me){return 1+me.reduce(l,0)}function l(me,_e){return Math.max(me,_e.y)}function n(me){for(var _e;_e=me.children;)me=_e[0];return me}function u(me){for(var _e;_e=me.children;)me=_e[_e.length-1];return me}function c(){var me=i,_e=1,Ae=1,ke=!1;function Ee(De){var Qe,Ue=0;De.eachAfter(function(dt){var Ht=dt.children;Ht?(dt.x=a(Ht),dt.y=s(Ht)):(dt.x=Qe?Ue+=me(dt,Qe):0,dt.y=0,Qe=dt)});var at=n(De),rt=u(De),ht=at.x-me(at,rt)/2,At=rt.x+me(rt,at)/2;return De.eachAfter(ke?function(dt){dt.x=(dt.x-De.x)*_e,dt.y=(De.y-dt.y)*Ae}:function(dt){dt.x=(dt.x-ht)/(At-ht)*_e,dt.y=(1-(De.y?dt.y/De.y:1))*Ae})}return Ee.separation=function(De){return arguments.length?(me=De,Ee):me},Ee.size=function(De){return arguments.length?(ke=!1,_e=+De[0],Ae=+De[1],Ee):ke?null:[_e,Ae]},Ee.nodeSize=function(De){return arguments.length?(ke=!0,_e=+De[0],Ae=+De[1],Ee):ke?[_e,Ae]:null},Ee}function f(me){var _e=0,Ae=me.children,ke=Ae&&Ae.length;if(!ke)_e=1;else for(;--ke>=0;)_e+=Ae[ke].value;me.value=_e}function h(){return this.eachAfter(f)}function d(me){var _e=this,Ae,ke=[_e],Ee,De,Qe;do for(Ae=ke.reverse(),ke=[];_e=Ae.pop();)if(me(_e),Ee=_e.children,Ee)for(De=0,Qe=Ee.length;De=0;--Ee)Ae.push(ke[Ee]);return this}function g(me){for(var _e=this,Ae=[_e],ke=[],Ee,De,Qe;_e=Ae.pop();)if(ke.push(_e),Ee=_e.children,Ee)for(De=0,Qe=Ee.length;De=0;)Ae+=ke[Ee].value;_e.value=Ae})}function y(me){return this.eachBefore(function(_e){_e.children&&_e.children.sort(me)})}function _(me){for(var _e=this,Ae=v(_e,me),ke=[_e];_e!==Ae;)_e=_e.parent,ke.push(_e);for(var Ee=ke.length;me!==Ae;)ke.splice(Ee,0,me),me=me.parent;return ke}function v(me,_e){if(me===_e)return me;var Ae=me.ancestors(),ke=_e.ancestors(),Ee=null;for(me=Ae.pop(),_e=ke.pop();me===_e;)Ee=me,me=Ae.pop(),_e=ke.pop();return Ee}function x(){for(var me=this,_e=[me];me=me.parent;)_e.push(me);return _e}function S(){var me=[];return this.each(function(_e){me.push(_e)}),me}function M(){var me=[];return this.eachBefore(function(_e){_e.children||me.push(_e)}),me}function C(){var me=this,_e=[];return me.each(function(Ae){Ae!==me&&_e.push({source:Ae.parent,target:Ae})}),_e}function w(me,_e){var Ae=new T(me),ke=+me.value&&(Ae.value=me.value),Ee,De=[Ae],Qe,Ue,at,rt;for(_e==null&&(_e=A);Ee=De.pop();)if(ke&&(Ee.value=+Ee.data.value),(Ue=_e(Ee.data))&&(rt=Ue.length))for(Ee.children=new Array(rt),at=rt-1;at>=0;--at)De.push(Qe=Ee.children[at]=new T(Ue[at])),Qe.parent=Ee,Qe.depth=Ee.depth+1;return Ae.eachBefore(E)}function k(){return w(this).eachBefore(b)}function A(me){return me.children}function b(me){me.data=me.data.data}function E(me){var _e=0;do me.height=_e;while((me=me.parent)&&me.height<++_e)}function T(me){this.data=me,this.depth=this.height=0,this.parent=null}T.prototype=w.prototype={constructor:T,count:h,each:d,eachAfter:g,eachBefore:p,sum:m,sort:y,path:_,ancestors:x,descendants:S,leaves:M,links:C,copy:k};var F=Array.prototype.slice;function D(me){for(var _e=me.length,Ae,ke;_e;)ke=Math.random()*_e--|0,Ae=me[_e],me[_e]=me[ke],me[ke]=Ae;return me}function R(me){for(var _e=0,Ae=(me=D(F.call(me))).length,ke=[],Ee,De;_e0&&Ae*Ae>ke*ke+Ee*Ee}function L(me,_e){for(var Ae=0;Ae<_e.length;++Ae)if(!I(me,_e[Ae]))return!1;return!0}function B(me){switch(me.length){case 1:return O(me[0]);case 2:return G(me[0],me[1]);case 3:return W(me[0],me[1],me[2])}}function O(me){return{x:me.x,y:me.y,r:me.r}}function G(me,_e){var Ae=me.x,ke=me.y,Ee=me.r,De=_e.x,Qe=_e.y,Ue=_e.r,at=De-Ae,rt=Qe-ke,ht=Ue-Ee,At=Math.sqrt(at*at+rt*rt);return{x:(Ae+De+at/At*ht)/2,y:(ke+Qe+rt/At*ht)/2,r:(At+Ee+Ue)/2}}function W(me,_e,Ae){var ke=me.x,Ee=me.y,De=me.r,Qe=_e.x,Ue=_e.y,at=_e.r,rt=Ae.x,ht=Ae.y,At=Ae.r,dt=ke-Qe,Ht=ke-rt,fr=Ee-Ue,gt=Ee-ht,yt=at-De,kt=At-De,Lt=ke*ke+Ee*Ee-De*De,Ct=Lt-Qe*Qe-Ue*Ue+at*at,$t=Lt-rt*rt-ht*ht+At*At,mr=Ht*fr-dt*gt,br=(fr*$t-gt*Ct)/(mr*2)-ke,Er=(gt*yt-fr*kt)/mr,Tr=(Ht*Ct-dt*$t)/(mr*2)-Ee,Ur=(dt*kt-Ht*yt)/mr,Ai=Er*Er+Ur*Ur-1,oi=2*(De+br*Er+Tr*Ur),Qr=br*br+Tr*Tr-De*De,ea=-(Ai?(oi+Math.sqrt(oi*oi-4*Ai*Qr))/(2*Ai):Qr/oi);return{x:ke+br+Er*ea,y:Ee+Tr+Ur*ea,r:ea}}function X(me,_e,Ae){var ke=me.x-_e.x,Ee,De,Qe=me.y-_e.y,Ue,at,rt=ke*ke+Qe*Qe;rt?(De=_e.r+Ae.r,De*=De,at=me.r+Ae.r,at*=at,De>at?(Ee=(rt+at-De)/(2*rt),Ue=Math.sqrt(Math.max(0,at/rt-Ee*Ee)),Ae.x=me.x-Ee*ke-Ue*Qe,Ae.y=me.y-Ee*Qe+Ue*ke):(Ee=(rt+De-at)/(2*rt),Ue=Math.sqrt(Math.max(0,De/rt-Ee*Ee)),Ae.x=_e.x+Ee*ke-Ue*Qe,Ae.y=_e.y+Ee*Qe+Ue*ke)):(Ae.x=_e.x+Ae.r,Ae.y=_e.y)}function Z(me,_e){var Ae=me.r+_e.r-1e-6,ke=_e.x-me.x,Ee=_e.y-me.y;return Ae>0&&Ae*Ae>ke*ke+Ee*Ee}function J(me){var _e=me._,Ae=me.next._,ke=_e.r+Ae.r,Ee=(_e.x*Ae.r+Ae.x*_e.r)/ke,De=(_e.y*Ae.r+Ae.y*_e.r)/ke;return Ee*Ee+De*De}function N(me){this._=me,this.next=null,this.previous=null}function H(me){if(!(Ee=me.length))return 0;var _e,Ae,ke,Ee,De,Qe,Ue,at,rt,ht,At;if(_e=me[0],_e.x=0,_e.y=0,!(Ee>1))return _e.r;if(Ae=me[1],_e.x=-Ae.r,Ae.x=_e.r,Ae.y=0,!(Ee>2))return _e.r+Ae.r;X(Ae,_e,ke=me[2]),_e=new N(_e),Ae=new N(Ae),ke=new N(ke),_e.next=ke.previous=Ae,Ae.next=_e.previous=ke,ke.next=Ae.previous=_e;e:for(Ue=3;Ue0)throw new Error("cycle");return Ue}return Ae.id=function(ke){return arguments.length?(me=V(ke),Ae):me},Ae.parentId=function(ke){return arguments.length?(_e=V(ke),Ae):_e},Ae}function Q(me,_e){return me.parent===_e.parent?1:2}function ue(me){var _e=me.children;return _e?_e[0]:me.t}function ge(me){var _e=me.children;return _e?_e[_e.length-1]:me.t}function Me(me,_e,Ae){var ke=Ae/(_e.i-me.i);_e.c-=ke,_e.s+=Ae,me.c+=ke,_e.z+=Ae,_e.m+=Ae}function Te(me){for(var _e=0,Ae=0,ke=me.children,Ee=ke.length,De;--Ee>=0;)De=ke[Ee],De.z+=_e,De.m+=_e,_e+=De.s+(Ae+=De.c)}function je(me,_e,Ae){return me.a.parent===_e.parent?me.a:Ae}function Ve(me,_e){this._=me,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=_e}Ve.prototype=Object.create(T.prototype);function Ke(me){for(var _e=new Ve(me,0),Ae,ke=[_e],Ee,De,Qe,Ue;Ae=ke.pop();)if(De=Ae._.children)for(Ae.children=new Array(Ue=De.length),Qe=Ue-1;Qe>=0;--Qe)ke.push(Ee=Ae.children[Qe]=new Ve(De[Qe],Qe)),Ee.parent=Ae;return(_e.parent=new Ve(null,0)).children=[_e],_e}function Je(){var me=Q,_e=1,Ae=1,ke=null;function Ee(rt){var ht=Ke(rt);if(ht.eachAfter(De),ht.parent.m=-ht.z,ht.eachBefore(Qe),ke)rt.eachBefore(at);else{var At=rt,dt=rt,Ht=rt;rt.eachBefore(function(Lt){Lt.xdt.x&&(dt=Lt),Lt.depth>Ht.depth&&(Ht=Lt)});var fr=At===dt?1:me(At,dt)/2,gt=fr-At.x,yt=_e/(dt.x+fr+gt),kt=Ae/(Ht.depth||1);rt.eachBefore(function(Lt){Lt.x=(Lt.x+gt)*yt,Lt.y=Lt.depth*kt})}return rt}function De(rt){var ht=rt.children,At=rt.parent.children,dt=rt.i?At[rt.i-1]:null;if(ht){Te(rt);var Ht=(ht[0].z+ht[ht.length-1].z)/2;dt?(rt.z=dt.z+me(rt._,dt._),rt.m=rt.z-Ht):rt.z=Ht}else dt&&(rt.z=dt.z+me(rt._,dt._));rt.parent.A=Ue(rt,dt,rt.parent.A||At[0])}function Qe(rt){rt._.x=rt.z+rt.parent.m,rt.m+=rt.parent.m}function Ue(rt,ht,At){if(ht){for(var dt=rt,Ht=rt,fr=ht,gt=dt.parent.children[0],yt=dt.m,kt=Ht.m,Lt=fr.m,Ct=gt.m,$t;fr=ge(fr),dt=ue(dt),fr&&dt;)gt=ue(gt),Ht=ge(Ht),Ht.a=rt,$t=fr.z+Lt-dt.z-yt+me(fr._,dt._),$t>0&&(Me(je(fr,rt,At),rt,$t),yt+=$t,kt+=$t),Lt+=fr.m,yt+=dt.m,Ct+=gt.m,kt+=Ht.m;fr&&!ge(Ht)&&(Ht.t=fr,Ht.m+=Lt-kt),dt&&!ue(gt)&&(gt.t=dt,gt.m+=yt-Ct,At=rt)}return At}function at(rt){rt.x*=_e,rt.y=rt.depth*Ae}return Ee.separation=function(rt){return arguments.length?(me=rt,Ee):me},Ee.size=function(rt){return arguments.length?(ke=!1,_e=+rt[0],Ae=+rt[1],Ee):ke?null:[_e,Ae]},Ee.nodeSize=function(rt){return arguments.length?(ke=!0,_e=+rt[0],Ae=+rt[1],Ee):ke?[_e,Ae]:null},Ee}function vt(me,_e,Ae,ke,Ee){for(var De=me.children,Qe,Ue=-1,at=De.length,rt=me.value&&(Ee-Ae)/me.value;++UeLt&&(Lt=rt),br=yt*yt*mr,Ct=Math.max(Lt/br,br/kt),Ct>$t){yt-=rt;break}$t=Ct}Qe.push(at={value:yt,dice:Ht1?ke:1)},Ae})(xt);function Mt(){var me=mt,_e=!1,Ae=1,ke=1,Ee=[0],De=j,Qe=j,Ue=j,at=j,rt=j;function ht(dt){return dt.x0=dt.y0=0,dt.x1=Ae,dt.y1=ke,dt.eachBefore(At),Ee=[0],_e&&dt.eachBefore(le),dt}function At(dt){var Ht=Ee[dt.depth],fr=dt.x0+Ht,gt=dt.y0+Ht,yt=dt.x1-Ht,kt=dt.y1-Ht;yt=dt-1){var Lt=De[At];Lt.x0=fr,Lt.y0=gt,Lt.x1=yt,Lt.y1=kt;return}for(var Ct=rt[At],$t=Ht/2+Ct,mr=At+1,br=dt-1;mr>>1;rt[Er]<$t?mr=Er+1:br=Er}$t-rt[mr-1]kt-gt){var Ai=(fr*Ur+yt*Tr)/Ht;ht(At,mr,Tr,fr,gt,Ai,kt),ht(mr,dt,Ur,Ai,gt,yt,kt)}else{var oi=(gt*Ur+kt*Tr)/Ht;ht(At,mr,Tr,fr,gt,yt,oi),ht(mr,dt,Ur,fr,oi,yt,kt)}}}function qe(me,_e,Ae,ke,Ee){(me.depth&1?vt:ce)(me,_e,Ae,ke,Ee)}var Ye=(function me(_e){function Ae(ke,Ee,De,Qe,Ue){if((at=ke._squarify)&&at.ratio===_e)for(var at,rt,ht,At,dt=-1,Ht,fr=at.length,gt=ke.value;++dt1?ke:1)},Ae})(xt);t.cluster=c,t.hierarchy=w,t.pack=K,t.packEnclose=R,t.packSiblings=$,t.partition=pe,t.stratify=ie,t.tree=Je,t.treemap=Mt,t.treemapBinary=lt,t.treemapDice=ce,t.treemapResquarify=Ye,t.treemapSlice=vt,t.treemapSliceDice=qe,t.treemapSquarify=mt,Object.defineProperty(t,"__esModule",{value:!0})})}}),Jy=de({"src/traces/sunburst/calc.js"(e){"use strict";var r=Ky(),t=da(),i=Qt(),a=Cs().makeColorScaleFuncFromTrace,o=k1().makePullColorFn,s=k1().generateExtendedColors,l=Cs().calc,n=cn().ALMOST_EQUAL,u={},c={},f={};e.calc=function(d,p){var g=d._fullLayout,m=p.ids,y=i.isArrayOrTypedArray(m),_=p.labels,v=p.parents,x=p.values,S=i.isArrayOrTypedArray(x),M=[],C={},w={},k=function($,U){C[$]?C[$].push(U):C[$]=[U],w[U]=1},A=function($){return $||typeof $=="number"},b=function($){return!S||t(x[$])&&x[$]>=0},E,T,F;y?(E=Math.min(m.length,v.length),T=function($){return A(m[$])&&b($)},F=function($){return String(m[$])}):(E=Math.min(_.length,v.length),T=function($){return A(_[$])&&b($)},F=function($){return String(_[$])}),S&&(E=Math.min(E,x.length));for(var D=0;D1){for(var B=i.randstr(),O=0;O>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?Qy(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?Qy(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=GC.exec(e))?new Su(r[1],r[2],r[3],1):(r=HC.exec(e))?new Su(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=$C.exec(e))?Qy(r[1],r[2],r[3],r[4]):(r=WC.exec(e))?Qy(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=YC.exec(e))?jC(r[1],r[2]/100,r[3]/100,1):(r=XC.exec(e))?jC(r[1],r[2]/100,r[3]/100,r[4]):U3.hasOwnProperty(e)?BC(U3[e]):e==="transparent"?new Su(NaN,NaN,NaN,0):null}function BC(e){return new Su(e>>16&255,e>>8&255,e&255,1)}function Qy(e,r,t,i){return i<=0&&(e=r=t=NaN),new Su(e,r,t,i)}function O3(e){return e instanceof Ep||(e=C1(e)),e?(e=e.rgb(),new Su(e.r,e.g,e.b,e.opacity)):new Su}function e_(e,r,t,i){return arguments.length===1?O3(e):new Su(e,r,t,i??1)}function Su(e,r,t,i){this.r=+e,this.g=+r,this.b=+t,this.opacity=+i}function OC(){return`#${x0(this.r)}${x0(this.g)}${x0(this.b)}`}function X$(){return`#${x0(this.r)}${x0(this.g)}${x0(this.b)}${x0((isNaN(this.opacity)?1:this.opacity)*255)}`}function NC(){let e=t_(this.opacity);return`${e===1?"rgb(":"rgba("}${_0(this.r)}, ${_0(this.g)}, ${_0(this.b)}${e===1?")":`, ${e})`}`}function t_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _0(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function x0(e){return e=_0(e),(e<16?"0":"")+e.toString(16)}function jC(e,r,t,i){return i<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new Vh(e,r,t,i)}function UC(e){if(e instanceof Vh)return new Vh(e.h,e.s,e.l,e.opacity);if(e instanceof Ep||(e=C1(e)),!e)return new Vh;if(e instanceof Vh)return e;e=e.rgb();var r=e.r/255,t=e.g/255,i=e.b/255,a=Math.min(r,t,i),o=Math.max(r,t,i),s=NaN,l=o-a,n=(o+a)/2;return l?(r===o?s=(t-i)/l+(t0&&n<1?0:s,new Vh(s,l,n,e.opacity)}function N3(e,r,t,i){return arguments.length===1?UC(e):new Vh(e,r,t,i??1)}function Vh(e,r,t,i){this.h=+e,this.s=+r,this.l=+t,this.opacity=+i}function qC(e){return e=(e||0)%360,e<0?e+360:e}function r_(e){return Math.max(0,Math.min(1,e||0))}function j3(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}var kp,b0,w0,zv,Gh,VC,GC,HC,$C,WC,YC,XC,U3,q3=Ir({"node_modules/d3-color/src/color.js"(){B3(),kp=.7,b0=1/kp,w0="\\s*([+-]?\\d+)\\s*",zv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",VC=/^#([0-9a-f]{3,8})$/,GC=new RegExp(`^rgb\\(${w0},${w0},${w0}\\)$`),HC=new RegExp(`^rgb\\(${Gh},${Gh},${Gh}\\)$`),$C=new RegExp(`^rgba\\(${w0},${w0},${w0},${zv}\\)$`),WC=new RegExp(`^rgba\\(${Gh},${Gh},${Gh},${zv}\\)$`),YC=new RegExp(`^hsl\\(${zv},${Gh},${Gh}\\)$`),XC=new RegExp(`^hsla\\(${zv},${Gh},${Gh},${zv}\\)$`),U3={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Rv(Ep,C1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:RC,formatHex:RC,formatHex8:W$,formatHsl:Y$,formatRgb:zC,toString:zC}),Rv(Su,e_,k1(Ep,{brighter(e){return e=e==null?b0:Math.pow(b0,e),new Su(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Su(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Su(_0(this.r),_0(this.g),_0(this.b),t_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:OC,formatHex:OC,formatHex8:X$,formatRgb:NC,toString:NC})),Rv(Vh,N3,k1(Ep,{brighter(e){return e=e==null?b0:Math.pow(b0,e),new Vh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kp:Math.pow(kp,e),new Vh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*r,a=2*t-i;return new Su(j3(e>=240?e-240:e+120,a,i),j3(e,a,i),j3(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new Vh(qC(this.h),r_(this.s),r_(this.l),t_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=t_(this.opacity);return`${e===1?"hsl(":"hsla("}${qC(this.h)}, ${r_(this.s)*100}%, ${r_(this.l)*100}%${e===1?")":`, ${e})`}`}}))}}),V3,G3,ZC=Ir({"node_modules/d3-color/src/math.js"(){V3=Math.PI/180,G3=180/Math.PI}});function KC(e){if(e instanceof bd)return new bd(e.l,e.a,e.b,e.opacity);if(e instanceof tp)return JC(e);e instanceof Su||(e=O3(e));var r=X3(e.r),t=X3(e.g),i=X3(e.b),a=$3((.2225045*r+.7168786*t+.0606169*i)/J3),o,s;return r===t&&t===i?o=s=a:(o=$3((.4360747*r+.3850649*t+.1430804*i)/K3),s=$3((.0139322*r+.0971045*t+.7141733*i)/Q3)),new bd(116*a-16,500*(o-a),200*(a-s),e.opacity)}function H3(e,r,t,i){return arguments.length===1?KC(e):new bd(e,r,t,i??1)}function bd(e,r,t,i){this.l=+e,this.a=+r,this.b=+t,this.opacity=+i}function $3(e){return e>QC?Math.pow(e,.3333333333333333):e/t4+e4}function W3(e){return e>T0?e*e*e:t4*(e-e4)}function Y3(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055)}function X3(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Z$(e){if(e instanceof tp)return new tp(e.h,e.c,e.l,e.opacity);if(e instanceof bd||(e=KC(e)),e.a===0&&e.b===0)return new tp(NaN,0=1?(t=1,r-1):Math.floor(t*r),a=e[i],o=e[i+1],s=i>0?e[i-1]:2*a-o,l=i()=>e}});function nD(e,r){return function(t){return e+t*r}}function eW(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(i){return Math.pow(e+i*r,t)}}function n_(e,r){var t=r-e;return t?nD(e,t>180||t<-180?t-360*Math.round(t/360):t):F1(isNaN(e)?r:e)}function tW(e){return(e=+e)==1?Eu:function(r,t){return t-r?eW(r,t,e):F1(isNaN(r)?t:r)}}function Eu(e,r){var t=r-e;return t?nD(e,t):F1(isNaN(e)?r:e)}var Nv=Ir({"node_modules/d3-interpolate/src/color.js"(){aD()}});function oD(e){return function(r){var t=r.length,i=new Array(t),a=new Array(t),o=new Array(t),s,l;for(s=0;st&&(o=r.slice(t,o),l[s]?l[s]+=o:l[++s]=o),(i=i[0])===(a=a[0])?l[s]?l[s]+=a:l[++s]=a:(l[++s]=null,n.push({i:s,x:wd(i,a)})),t=u_.lastIndex;return t180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(a(f)+"rotate(",null,i)-2,x:wd(u,c)})):c&&f.push(a(f)+"rotate("+c+i)}function l(u,c,f,h){u!==c?h.push({i:f.push(a(f)+"skewX(",null,i)-2,x:wd(u,c)}):c&&f.push(a(f)+"skewX("+c+i)}function n(u,c,f,h,d,p){if(u!==f||c!==h){var g=d.push(a(d)+"scale(",null,",",null,")");p.push({i:g-4,x:wd(u,f)},{i:g-2,x:wd(c,h)})}else(f!==1||h!==1)&&d.push(a(d)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,h),s(u.rotate,c.rotate,f,h),l(u.skewX,c.skewX,f,h),n(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(d){for(var p=-1,g=h.length,m;++pc_,interpolateArray:()=>rW,interpolateBasis:()=>tD,interpolateBasisClosed:()=>rD,interpolateCubehelix:()=>PD,interpolateCubehelixLong:()=>ID,interpolateDate:()=>dD,interpolateDiscrete:()=>nW,interpolateHcl:()=>DD,interpolateHclLong:()=>LD,interpolateHsl:()=>ED,interpolateHslLong:()=>kD,interpolateHue:()=>sW,interpolateLab:()=>xW,interpolateNumber:()=>wd,interpolateNumberArray:()=>l4,interpolateObject:()=>vD,interpolateRgb:()=>o_,interpolateRgbBasis:()=>sD,interpolateRgbBasisClosed:()=>lD,interpolateRound:()=>uW,interpolateString:()=>gD,interpolateTransformCss:()=>bD,interpolateTransformSvg:()=>wD,interpolateZoom:()=>MD,piecewise:()=>AW,quantize:()=>SW});var jv=Ir({"node_modules/d3-interpolate/src/index.js"(){f_(),hD(),s4(),iD(),pD(),oW(),lW(),s_(),u4(),mD(),cW(),yD(),vW(),yW(),uD(),_W(),bW(),wW(),TW(),MW(),EW()}}),f4=de({"src/traces/sunburst/fill_one.js"(e,r){"use strict";var t=hn(),i=ta();r.exports=function(o,s,l,n,u){var c=s.data.data,f=c.i,h=u||c.color;if(f>=0){s.i=c.i;var d=l.marker;d.pattern?(!d.colors||!d.pattern.shape)&&(d.color=h,s.color=h):(d.color=h,s.color=h),t.pointStyle(o,l,n,s)}else i.fill(o,h)}}}),RD=de({"src/traces/sunburst/style.js"(e,r){"use strict";var t=Yr(),i=ta(),a=Qt(),o=dc().resizeText,s=f4();function l(u){var c=u._fullLayout._sunburstlayer.selectAll(".trace");o(u,c,"sunburst"),c.each(function(f){var h=t.select(this),d=f[0],p=d.trace;h.style("opacity",p.opacity),h.selectAll("path.surface").each(function(g){t.select(this).call(n,g,p,u)})})}function n(u,c,f,h){var d=c.data.data,p=!c.children,g=d.i,m=a.castOption(f,g,"marker.line.color")||i.defaultLine,y=a.castOption(f,g,"marker.line.width")||0;u.call(s,c,f,h).style("stroke-width",y).call(i.stroke,m).style("opacity",p?f.leaf.opacity:null)}r.exports={style:l,styleOne:n}}}),Cp=de({"src/traces/sunburst/helpers.js"(e){"use strict";var r=Qt(),t=ta(),i=md(),a=p0();e.findEntryWithLevel=function(n,u){var c;return u&&n.eachAfter(function(f){if(e.getPtId(f)===u)return c=f.copy()}),c||n},e.findEntryWithChild=function(n,u){var c;return n.eachAfter(function(f){for(var h=f.children||[],d=0;d0)},e.getMaxDepth=function(n){return n.maxdepth>=0?n.maxdepth:1/0},e.isHeader=function(n,u){return!(e.isLeaf(n)||n.depth===u._maxDepth-1)};function l(n){return n.data.data.pid}e.getParent=function(n,u){return e.findEntryWithLevel(n,l(u))},e.listPath=function(n,u){var c=n.parent;if(!c)return[];var f=u?[c.data[u]]:[c];return e.listPath(c,u).concat(f)},e.getPath=function(n){return e.listPath(n,"label").join("/")+"/"},e.formatValue=a.formatPieValue,e.formatPercent=function(n,u){var c=r.formatPercent(n,0);return c==="0%"&&(c=a.formatPiePercent(n,u)),c}}}),p_=de({"src/traces/sunburst/fx.js"(e,r){"use strict";var t=Yr(),i=Ma(),a=sf().appendArrayPointValue,o=$s(),s=Qt(),l=u1(),n=Cp(),u=p0(),c=u.formatPieValue;r.exports=function(d,p,g,m,y){var _=m[0],v=_.trace,x=_.hierarchy,S=v.type==="sunburst",M=v.type==="treemap"||v.type==="icicle";"_hasHoverLabel"in v||(v._hasHoverLabel=!1),"_hasHoverEvent"in v||(v._hasHoverEvent=!1);var C=function(A){var b=g._fullLayout;if(!(g._dragging||b.hovermode===!1)){var E=g._fullData[v.index],T=A.data.data,F=T.i,D=n.isHierarchyRoot(A),R=n.getParent(x,A),P=n.getValue(A),z=function(Y){return s.castOption(E,F,Y)},I=z("hovertemplate"),L=o.castHoverinfo(E,b,F),B=b.separators,O;if(I||L&&L!=="none"&&L!=="skip"){var G,W;S&&(G=_.cx+A.pxmid[0]*(1-A.rInscribed),W=_.cy+A.pxmid[1]*(1-A.rInscribed)),M&&(G=A._hoverX,W=A._hoverY);var X={},Z=[],J=[],N=function(Y){return Z.indexOf(Y)!==-1};L&&(Z=L==="all"?E._module.attributes.hoverinfo.flags:L.split("+")),X.label=T.label,N("label")&&X.label&&J.push(X.label),T.hasOwnProperty("v")&&(X.value=T.v,X.valueLabel=c(X.value,B),N("value")&&J.push(X.valueLabel)),X.currentPath=A.currentPath=n.getPath(A.data),N("current path")&&!D&&J.push(X.currentPath);var H,$=[],U=function(){$.indexOf(H)===-1&&(J.push(H),$.push(H))};X.percentParent=A.percentParent=P/n.getValue(R),X.parent=A.parentString=n.getPtLabel(R),N("percent parent")&&(H=n.formatPercent(X.percentParent,B)+" of "+X.parent,U()),X.percentEntry=A.percentEntry=P/n.getValue(p),X.entry=A.entry=n.getPtLabel(p),N("percent entry")&&!D&&!A.onPathbar&&(H=n.formatPercent(X.percentEntry,B)+" of "+X.entry,U()),X.percentRoot=A.percentRoot=P/n.getValue(x),X.root=A.root=n.getPtLabel(x),N("percent root")&&!D&&(H=n.formatPercent(X.percentRoot,B)+" of "+X.root,U()),X.text=z("hovertext")||z("text"),N("text")&&(H=X.text,s.isValidTextValue(H)&&J.push(H)),O=[f(A,E,y.eventDataKeys)];var V={trace:E,y:W,_x0:A._x0,_x1:A._x1,_y0:A._y0,_y1:A._y1,text:J.join("
"),name:I||N("name")?E.name:void 0,color:z("hoverlabel.bgcolor")||T.color,borderColor:z("hoverlabel.bordercolor"),fontFamily:z("hoverlabel.font.family"),fontSize:z("hoverlabel.font.size"),fontColor:z("hoverlabel.font.color"),fontWeight:z("hoverlabel.font.weight"),fontStyle:z("hoverlabel.font.style"),fontVariant:z("hoverlabel.font.variant"),nameLength:z("hoverlabel.namelength"),textAlign:z("hoverlabel.align"),hovertemplate:I,hovertemplateLabels:X,eventData:O};S&&(V.x0=G-A.rInscribed*A.rpx1,V.x1=G+A.rInscribed*A.rpx1,V.idealAlign=A.pxmid[0]<0?"left":"right"),M&&(V.x=G,V.idealAlign=G<0?"left":"right");var j=[];o.loneHover(V,{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:g,inOut_bbox:j}),O[0].bbox=j[0],v._hasHoverLabel=!0}if(M){var q=d.select("path.surface");y.styleOne(q,A,E,g,{hovered:!0})}v._hasHoverEvent=!0,g.emit("plotly_hover",{points:O||[f(A,E,y.eventDataKeys)],event:t.event})}},w=function(A){var b=g._fullLayout,E=g._fullData[v.index],T=t.select(this).datum();if(v._hasHoverEvent&&(A.originalEvent=t.event,g.emit("plotly_unhover",{points:[f(T,E,y.eventDataKeys)],event:t.event}),v._hasHoverEvent=!1),v._hasHoverLabel&&(o.loneUnhover(b._hoverlayer.node()),v._hasHoverLabel=!1),M){var F=d.select("path.surface");y.styleOne(F,T,E,g,{hovered:!1})}},k=function(A){var b=g._fullLayout,E=g._fullData[v.index],T=S&&(n.isHierarchyRoot(A)||n.isLeaf(A)),F=n.getPtId(A),D=n.isEntry(A)?n.findEntryWithChild(x,F):n.findEntryWithLevel(x,F),R=n.getPtId(D),P={points:[f(A,E,y.eventDataKeys)],event:t.event};T||(P.nextLevel=R);var z=l.triggerHandler(g,"plotly_"+v.type+"click",P);if(z!==!1&&b.hovermode&&(g._hoverdata=[f(A,E,y.eventDataKeys)],o.click(g,t.event)),!T&&z!==!1&&!g._dragging&&!g._transitioning){i.call("_storeDirectGUIEdit",E,b._tracePreGUI[E.uid],{level:E.level});var I={data:[{level:R}],traces:[v.index]},L={frame:{redraw:!1,duration:y.transitionTime},transition:{duration:y.transitionTime,easing:y.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(b._hoverlayer.node()),i.call("animate",g,I,L)}};d.on("mouseover",C),d.on("mouseout",w),d.on("click",k)};function f(h,d,p){for(var g=h.data.data,m={curveNumber:d.index,pointNumber:g.i,data:d._input,fullData:d},y=0;yMe.x1?2*Math.PI:0)+Y;Te=Q.rpx1pe?2*Math.PI:0)+Y;ge={x0:Te,x1:Te}}else ge={rpx0:Z,rpx1:Z},o.extendFlat(ge,ie(Q));else ge={rpx0:0,rpx1:0};else ge={x0:Y,x1:Y};return i(ge,Me)}function ee(Q){var ue=$[_.getPtId(Q)],ge,Me=Q.transform;if(ue)ge=ue;else if(ge={rpx1:Q.rpx1,transform:{textPosAngle:Me.textPosAngle,scale:0,rotate:Me.rotate,rCenter:Me.rCenter,x:Me.x,y:Me.y}},H)if(Q.parent)if(pe){var Te=Q.x1>pe?2*Math.PI:0;ge.x0=ge.x1=Te}else o.extendFlat(ge,ie(Q));else ge.x0=ge.x1=Y;else ge.x0=ge.x1=Y;var je=i(ge.transform.textPosAngle,Q.transform.textPosAngle),Ve=i(ge.rpx1,Q.rpx1),Ze=i(ge.x0,Q.x0),Ke=i(ge.x1,Q.x1),vt=i(ge.transform.scale,Me.scale),xt=i(ge.transform.rotate,Me.rotate),Pt=Me.rCenter===0?3:ge.transform.rCenter===0?1/3:1,mt=i(ge.transform.rCenter,Me.rCenter),Mt=function(lt){return mt(Math.pow(lt,Pt))};return function(lt){var qe=Ve(lt),Ye=Ze(lt),me=Ke(lt),_e=Mt(lt),Ae=ne(qe,(Ye+me)/2),ke=je(lt),Ee={pxmid:Ae,rpx1:qe,transform:{textPosAngle:ke,rCenter:_e,x:Me.x,y:Me.y}};return n(z.type,Me,T),{transform:{targetX:le(Ee),targetY:ce(Ee),scale:vt(lt),rotate:xt(lt),rCenter:_e}}}}function ie(Q){var ue=Q.parent,ge=$[_.getPtId(ue)],Me={};if(ge){var Te=ue.children,je=Te.indexOf(Q),Ve=Te.length,Ze=i(ge.x0,ge.x1);Me.x0=Ze(je/Ve),Me.x1=Ze(je/Ve)}else Me.x0=Me.x1=0;return Me}}function x(w){return t.partition().size([2*Math.PI,w.height+1])(w)}e.formatSliceLabel=function(w,k,A,b,E){var T=A.texttemplate,F=A.textinfo;if(!T&&(!F||F==="none"))return"";var D=E.separators,R=b[0],P=w.data.data,z=R.hierarchy,I=_.isHierarchyRoot(w),L=_.getParent(z,w),B=_.getValue(w);if(!T){var O=F.split("+"),G=function(j){return O.indexOf(j)!==-1},W=[],X;if(G("label")&&P.label&&W.push(P.label),P.hasOwnProperty("v")&&G("value")&&W.push(_.formatValue(P.v,D)),!I){G("current path")&&W.push(_.getPath(w.data));var Z=0;G("percent parent")&&Z++,G("percent entry")&&Z++,G("percent root")&&Z++;var J=Z>1;if(Z){var N,H=function(j){X=_.formatPercent(N,D),J&&(X+=" of "+j),W.push(X)};G("percent parent")&&!I&&(N=B/_.getValue(L),H("parent")),G("percent entry")&&(N=B/_.getValue(k),H("entry")),G("percent root")&&(N=B/_.getValue(z),H("root"))}}return G("text")&&(X=o.castOption(A,P.i,"text"),o.isValidTextValue(X)&&W.push(X)),W.join("
")}var $=o.castOption(A,P.i,"texttemplate");if(!$)return"";var U={};P.label&&(U.label=P.label),P.hasOwnProperty("v")&&(U.value=P.v,U.valueLabel=_.formatValue(P.v,D)),U.currentPath=_.getPath(w.data),I||(U.percentParent=B/_.getValue(L),U.percentParentLabel=_.formatPercent(U.percentParent,D),U.parent=_.getPtLabel(L)),U.percentEntry=B/_.getValue(k),U.percentEntryLabel=_.formatPercent(U.percentEntry,D),U.entry=_.getPtLabel(k),U.percentRoot=B/_.getValue(z),U.percentRootLabel=_.formatPercent(U.percentRoot,D),U.root=_.getPtLabel(z),P.hasOwnProperty("color")&&(U.color=P.color);var V=o.castOption(A,P.i,"text");return(o.isValidTextValue(V)||V==="")&&(U.text=V),U.customdata=o.castOption(A,P.i,"customdata"),o.texttemplateString({data:[U,A._meta],fallback:A.texttemplatefallback,labels:U,locale:E._d3locale,template:$})};function S(w){return w.rpx0===0&&o.isFullCircle([w.x0,w.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(w.halfangle)),w.ring/2))}function M(w){return C(w.rpx1,w.transform.textPosAngle)}function C(w,k){return[w*Math.sin(k),-w*Math.cos(k)]}}}),kW=de({"src/traces/sunburst/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"sunburst",basePlotModule:G$(),categories:[],animatable:!0,attributes:Zy(),layoutAttributes:IC(),supplyDefaults:H$(),supplyLayoutDefaults:$$(),calc:Jy().calc,crossTraceCalc:Jy().crossTraceCalc,plot:h4().plot,style:RD().style,colorbar:Yu(),meta:{}}}}),CW=de({"lib/sunburst.js"(e,r){"use strict";r.exports=kW()}}),DW=de({"src/traces/treemap/base_plot.js"(e){"use strict";var r=Es();e.name="treemap",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),Uv=de({"src/traces/treemap/constants.js"(e,r){"use strict";r.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),d4=de({"src/traces/treemap/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,texttemplateAttrs:i,templatefallbackAttrs:a}=Vo(),o=cs(),s=Is().attributes,l=Pv(),n=Zy(),u=Uv(),c=fn().extendFlat,f=fu().pattern;r.exports={labels:n.labels,parents:n.parents,values:n.values,branchvalues:n.branchvalues,count:n.count,level:n.level,maxdepth:n.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:c({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:n.marker.colors,pattern:f,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:n.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},l.textfont,{}),editType:"calc"},text:l.text,textinfo:n.textinfo,texttemplate:i({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),hovertext:l.hovertext,hoverinfo:n.hoverinfo,hovertemplate:t({},{keys:u.eventDataKeys}),hovertemplatefallback:a(),textfont:l.textfont,insidetextfont:l.insidetextfont,outsidetextfont:c({},l.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:l.sort,root:n.root,domain:s({name:"treemap",trace:!0,editType:"calc"})}}}),zD=de({"src/traces/treemap/layout_attributes.js"(e,r){"use strict";r.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),LW=de({"src/traces/treemap/defaults.js"(e,r){"use strict";var t=Qt(),i=d4(),a=ta(),o=Is().defaults,s=oh().handleText,l=y0().TEXTPAD,n=Iv().handleMarkerDefaults,u=ks(),c=u.hasColorscale,f=u.handleDefaults;r.exports=function(d,p,g,m){function y(E,T){return t.coerce(d,p,i,E,T)}var _=y("labels"),v=y("parents");if(!_||!_.length||!v||!v.length){p.visible=!1;return}var x=y("values");x&&x.length?y("branchvalues"):y("count"),y("level"),y("maxdepth");var S=y("tiling.packing");S==="squarify"&&y("tiling.squarifyratio"),y("tiling.flip"),y("tiling.pad");var M=y("text");y("texttemplate"),y("texttemplatefallback"),p.texttemplate||y("textinfo",t.isArrayOrTypedArray(M)?"text+label":"label"),y("hovertext"),y("hovertemplate"),y("hovertemplatefallback");var C=y("pathbar.visible"),w="auto";s(d,p,m,y,w,{hasPathbar:C,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),y("textposition");var k=p.textposition.indexOf("bottom")!==-1;n(d,p,m,y);var A=p._hasColorscale=c(d,"marker","colors")||(d.marker||{}).coloraxis;A?f(d,p,m,y,{prefix:"marker.",cLetter:"c"}):y("marker.depthfade",!(p.marker.colors||[]).length);var b=p.textfont.size*2;y("marker.pad.t",k?b/4:b),y("marker.pad.l",b/4),y("marker.pad.r",b/4),y("marker.pad.b",k?b:b/4),y("marker.cornerradius"),p._hovered={marker:{line:{width:2,color:a.contrast(m.paper_bgcolor)}}},C&&(y("pathbar.thickness",p.pathbar.textfont.size+2*l),y("pathbar.side"),y("pathbar.edgeshape")),y("sort"),y("root.color"),o(p,m,y),p._length=null}}}),FW=de({"src/traces/treemap/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=zD();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("treemapcolorway",s.colorway),l("extendtreemapcolors")}}}),BD=de({"src/traces/treemap/calc.js"(e){"use strict";var r=Jy();e.calc=function(t,i){return r.calc(t,i)},e.crossTraceCalc=function(t){return r._runCrossTraceCalc("treemap",t)}}}),OD=de({"src/traces/treemap/flip_tree.js"(e,r){"use strict";r.exports=function t(i,a,o){var s;o.swapXY&&(s=i.x0,i.x0=i.y0,i.y0=s,s=i.x1,i.x1=i.y1,i.y1=s),o.flipX&&(s=i.x0,i.x0=a[0]-i.x1,i.x1=a[0]-s),o.flipY&&(s=i.y0,i.y0=a[1]-i.y1,i.y1=a[1]-s);var l=i.children;if(l)for(var n=0;n0)for(var b=0;b").join(" ")||"";var J=i.ensureSingle(X,"g","slicetext"),N=i.ensureSingle(J,"text","",function($){$.attr("data-notex",1)}),H=i.ensureUniformFontSize(d,u.determineTextFont(z,W,R.font,{onPathbar:!0}));N.text(W._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,H).call(o.convertToTspans,d),W.textBB=a.bBox(N.node()),W.transform=w(W,{fontSize:H.size,onPathbar:!0}),W.transform.fontSize=H.size,A?N.transition().attrTween("transform",function($){var U=T($,f,F,[v,x]);return function(V){return k(U(V))}}):N.attr("transform",k(W))})}}}),IW=de({"src/traces/treemap/plot_one.js"(e,r){"use strict";var t=Yr(),i=(jv(),ti(M0)).interpolate,a=Cp(),o=Qt(),s=y0().TEXTPAD,l=Sv(),n=l.toMoveInsideBar,u=dc(),c=u.recordMinTextSize,f=Uv(),h=PW();function d(p){return a.isHierarchyRoot(p)?"":a.getPtId(p)}r.exports=function(g,m,y,_,v){var x=g._fullLayout,S=m[0],M=S.trace,C=M.type,w=C==="icicle",k=S.hierarchy,A=a.findEntryWithLevel(k,M.level),b=t.select(y),E=b.selectAll("g.pathbar"),T=b.selectAll("g.slice");if(!A){E.remove(),T.remove();return}var F=a.isHierarchyRoot(A),D=!x.uniformtext.mode&&a.hasTransition(_),R=a.getMaxDepth(M),P=function(mt){return mt.data.depth-A.data.depth-1?B+W:-(G+W):0,Z={x0:O,x1:O,y0:X,y1:X+G},J=function(mt,Mt,lt){var qe=M.tiling.pad,Ye=function(ke){return ke-qe<=Mt.x0},me=function(ke){return ke+qe>=Mt.x1},_e=function(ke){return ke-qe<=Mt.y0},Ae=function(ke){return ke+qe>=Mt.y1};return mt.x0===Mt.x0&&mt.x1===Mt.x1&&mt.y0===Mt.y0&&mt.y1===Mt.y1?{x0:mt.x0,x1:mt.x1,y0:mt.y0,y1:mt.y1}:{x0:Ye(mt.x0-qe)?0:me(mt.x0-qe)?lt[0]:mt.x0,x1:Ye(mt.x1+qe)?0:me(mt.x1+qe)?lt[0]:mt.x1,y0:_e(mt.y0-qe)?0:Ae(mt.y0-qe)?lt[1]:mt.y0,y1:_e(mt.y1+qe)?0:Ae(mt.y1+qe)?lt[1]:mt.y1}},N=null,H={},$={},U=null,V=function(mt,Mt){return Mt?H[d(mt)]:$[d(mt)]},j=function(mt,Mt,lt,qe){if(Mt)return H[d(k)]||Z;var Ye=$[M.level]||lt;return P(mt)?J(mt,Ye,qe):{}};S.hasMultipleRoots&&F&&R++,M._maxDepth=R,M._backgroundColor=x.paper_bgcolor,M._entryDepth=A.data.depth,M._atRootLevel=F;var q=-L/2+z.l+z.w*(I.x[1]+I.x[0])/2,Y=-B/2+z.t+z.h*(1-(I.y[1]+I.y[0])/2),K=function(mt){return q+mt},te=function(mt){return Y+mt},ne=te(0),se=K(0),le=function(mt){return se+mt},ce=function(mt){return ne+mt};function pe(mt,Mt){return mt+","+Mt}var xe=le(0),ye=function(mt){mt.x=Math.max(xe,mt.x)},fe=M.pathbar.edgeshape,ae=function(mt){var Mt=le(Math.max(Math.min(mt.x0,mt.x0),0)),lt=le(Math.min(Math.max(mt.x1,mt.x1),O)),qe=ce(mt.y0),Ye=ce(mt.y1),me=G/2,_e={},Ae={};_e.x=Mt,Ae.x=lt,_e.y=Ae.y=(qe+Ye)/2;var ke={x:Mt,y:qe},Ee={x:lt,y:qe},De={x:lt,y:Ye},Je={x:Mt,y:Ye};return fe===">"?(ke.x-=me,Ee.x-=me,De.x-=me,Je.x-=me):fe==="/"?(De.x-=me,Je.x-=me,_e.x-=me/2,Ae.x-=me/2):fe==="\\"?(ke.x-=me,Ee.x-=me,_e.x-=me/2,Ae.x-=me/2):fe==="<"&&(_e.x-=me,Ae.x-=me),ye(ke),ye(Je),ye(_e),ye(Ee),ye(De),ye(Ae),"M"+pe(ke.x,ke.y)+"L"+pe(Ee.x,Ee.y)+"L"+pe(Ae.x,Ae.y)+"L"+pe(De.x,De.y)+"L"+pe(Je.x,Je.y)+"L"+pe(_e.x,_e.y)+"Z"},ee=M[w?"tiling":"marker"].pad,ie=function(mt){return M.textposition.indexOf(mt)!==-1},Q=ie("top"),ue=ie("left"),ge=ie("right"),Me=ie("bottom"),Te=function(mt){var Mt=K(mt.x0),lt=K(mt.x1),qe=te(mt.y0),Ye=te(mt.y1),me=lt-Mt,_e=Ye-qe;if(!me||!_e)return"";var Ae=M.marker.cornerradius||0,ke=Math.min(Ae,me/2,_e/2);ke&&mt.data&&mt.data.data&&mt.data.data.label&&(Q&&(ke=Math.min(ke,ee.t)),ue&&(ke=Math.min(ke,ee.l)),ge&&(ke=Math.min(ke,ee.r)),Me&&(ke=Math.min(ke,ee.b)));var Ee=function(De,Je){return ke?"a"+pe(ke,ke)+" 0 0 1 "+pe(De,Je):""};return"M"+pe(Mt,qe+ke)+Ee(ke,-ke)+"L"+pe(lt-ke,qe)+Ee(ke,ke)+"L"+pe(lt,Ye-ke)+Ee(-ke,ke)+"L"+pe(Mt+ke,Ye)+Ee(-ke,-ke)+"Z"},je=function(mt,Mt){var lt=mt.x0,qe=mt.x1,Ye=mt.y0,me=mt.y1,_e=mt.textBB,Ae=Q||Mt.isHeader&&!Me,ke=Ae?"start":Me?"end":"middle",Ee=ie("right"),De=ie("left")||Mt.onPathbar,Je=De?-1:Ee?1:0;if(Mt.isHeader){if(lt+=(w?ee:ee.l)-s,qe-=(w?ee:ee.r)-s,lt>=qe){var Ue=(lt+qe)/2;lt=Ue,qe=Ue}var at;Me?(at=me-(w?ee:ee.b),Ye-1,flipY:I.tiling.flip.indexOf("y")>-1,pad:{inner:I.tiling.pad,top:I.marker.pad.t,left:I.marker.pad.l,right:I.marker.pad.r,bottom:I.marker.pad.b}}),X=W.descendants(),Z=1/0,J=-1/0;X.forEach(function(V){var j=V.depth;j>=I._maxDepth?(V.x0=V.x1=(V.x0+V.x1)/2,V.y0=V.y1=(V.y0+V.y1)/2):(Z=Math.min(Z,j),J=Math.max(J,j))}),y=y.data(X,u.getPtId),I._maxVisibleLayers=isFinite(J)?J-Z+1:0,y.enter().append("g").classed("slice",!0),b(y,h,D,[v,x],C),y.order();var N=null;if(A&&F){var H=u.getPtId(F);y.each(function(V){N===null&&u.getPtId(V)===H&&(N={x0:V.x0,x1:V.x1,y0:V.y0,y1:V.y1})})}var $=function(){return N||{x0:0,x1:v,y0:0,y1:x}},U=y;return A&&(U=U.transition().each("end",function(){var V=t.select(this);u.setSliceCursor(V,p,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),U.each(function(V){var j=u.isHeader(V,I);V._x0=S(V.x0),V._x1=S(V.x1),V._y0=M(V.y0),V._y1=M(V.y1),V._hoverX=S(V.x1-I.marker.pad.r),V._hoverY=M(O?V.y1-I.marker.pad.b/2:V.y0+I.marker.pad.t/2);var q=t.select(this),Y=i.ensureSingle(q,"path","surface",function(ce){ce.style("pointer-events",R?"none":"all")});A?Y.transition().attrTween("d",function(ce){var pe=E(ce,h,$(),[v,x]);return function(xe){return C(pe(xe))}}):Y.attr("d",C),q.call(c,m,p,g,{styleOne:l,eventDataKeys:n.eventDataKeys,transitionTime:n.CLICK_TRANSITION_TIME,transitionEasing:n.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,p,{isTransitioning:p._transitioning}),Y.call(l,V,I,p,{hovered:!1}),V.x0===V.x1||V.y0===V.y1?V._text="":j?V._text=G?"":u.getPtLabel(V)||"":V._text=f(V,m,I,g,P)||"";var K=i.ensureSingle(q,"g","slicetext"),te=i.ensureSingle(K,"text","",function(ce){ce.attr("data-notex",1)}),ne=i.ensureUniformFontSize(p,u.determineTextFont(I,V,P.font)),se=V._text||" ",le=j&&se.indexOf("
")===-1;te.text(se).classed("slicetext",!0).attr("text-anchor",B?"end":L||le?"start":"middle").call(a.font,ne).call(o.convertToTspans,p),V.textBB=a.bBox(te.node()),V.transform=w(V,{fontSize:ne.size,isHeader:j}),V.transform.fontSize=ne.size,A?te.transition().attrTween("transform",function(ce){var pe=T(ce,h,$(),[v,x]);return function(xe){return k(pe(xe))}}):te.attr("transform",k(V))}),N}}}),zW=de({"src/traces/treemap/plot.js"(e,r){"use strict";var t=jD(),i=RW();r.exports=function(o,s,l,n){return t(o,s,l,n,{type:"treemap",drawDescendants:i})}}}),BW=de({"src/traces/treemap/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"treemap",basePlotModule:DW(),categories:[],animatable:!0,attributes:d4(),layoutAttributes:zD(),supplyDefaults:LW(),supplyLayoutDefaults:FW(),calc:BD().calc,crossTraceCalc:BD().crossTraceCalc,plot:zW(),style:p4().style,colorbar:Yu(),meta:{}}}}),OW=de({"lib/treemap.js"(e,r){"use strict";r.exports=BW()}}),NW=de({"src/traces/icicle/base_plot.js"(e){"use strict";var r=Es();e.name="icicle",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),UD=de({"src/traces/icicle/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,texttemplateAttrs:i,templatefallbackAttrs:a}=Vo(),o=cs(),s=Is().attributes,l=Pv(),n=Zy(),u=d4(),c=Uv(),f=fn().extendFlat,h=fu().pattern;r.exports={labels:n.labels,parents:n.parents,values:n.values,branchvalues:n.branchvalues,count:n.count,level:n.level,maxdepth:n.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:u.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:f({colors:n.marker.colors,line:n.marker.line,pattern:h,editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),leaf:n.leaf,pathbar:u.pathbar,text:l.text,textinfo:n.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),hovertext:l.hovertext,hoverinfo:n.hoverinfo,hovertemplate:t({},{keys:c.eventDataKeys}),hovertemplatefallback:a(),textfont:l.textfont,insidetextfont:l.insidetextfont,outsidetextfont:u.outsidetextfont,textposition:u.textposition,sort:l.sort,root:n.root,domain:s({name:"icicle",trace:!0,editType:"calc"})}}}),qD=de({"src/traces/icicle/layout_attributes.js"(e,r){"use strict";r.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),jW=de({"src/traces/icicle/defaults.js"(e,r){"use strict";var t=Qt(),i=UD(),a=ta(),o=Is().defaults,s=oh().handleText,l=y0().TEXTPAD,n=Iv().handleMarkerDefaults,u=ks(),c=u.hasColorscale,f=u.handleDefaults;r.exports=function(d,p,g,m){function y(k,A){return t.coerce(d,p,i,k,A)}var _=y("labels"),v=y("parents");if(!_||!_.length||!v||!v.length){p.visible=!1;return}var x=y("values");x&&x.length?y("branchvalues"):y("count"),y("level"),y("maxdepth"),y("tiling.orientation"),y("tiling.flip"),y("tiling.pad");var S=y("text");y("texttemplate"),y("texttemplatefallback"),p.texttemplate||y("textinfo",t.isArrayOrTypedArray(S)?"text+label":"label"),y("hovertext"),y("hovertemplate"),y("hovertemplatefallback");var M=y("pathbar.visible"),C="auto";s(d,p,m,y,C,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),y("textposition"),n(d,p,m,y);var w=p._hasColorscale=c(d,"marker","colors")||(d.marker||{}).coloraxis;w&&f(d,p,m,y,{prefix:"marker.",cLetter:"c"}),y("leaf.opacity",w?1:.7),p._hovered={marker:{line:{width:2,color:a.contrast(m.paper_bgcolor)}}},M&&(y("pathbar.thickness",p.pathbar.textfont.size+2*l),y("pathbar.side"),y("pathbar.edgeshape")),y("sort"),y("root.color"),o(p,m,y),p._length=null}}}),UW=de({"src/traces/icicle/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=qD();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("iciclecolorway",s.colorway),l("extendiciclecolors")}}}),VD=de({"src/traces/icicle/calc.js"(e){"use strict";var r=Jy();e.calc=function(t,i){return r.calc(t,i)},e.crossTraceCalc=function(t){return r._runCrossTraceCalc("icicle",t)}}}),qW=de({"src/traces/icicle/partition.js"(e,r){"use strict";var t=Ky(),i=OD();r.exports=function(o,s,l){var n=l.flipX,u=l.flipY,c=l.orientation==="h",f=l.maxDepth,h=s[0],d=s[1];f&&(h=(o.height+1)*s[0]/Math.min(o.height+1,f),d=(o.height+1)*s[1]/Math.min(o.height+1,f));var p=t.partition().padding(l.pad.inner).size(c?[s[1],h]:[s[0],d])(o);return(c||n||u)&&i(p,s,{swapXY:c,flipX:n,flipY:u}),p}}}),GD=de({"src/traces/icicle/style.js"(e,r){"use strict";var t=Yr(),i=ta(),a=Qt(),o=dc().resizeText,s=f4();function l(u){var c=u._fullLayout._iciclelayer.selectAll(".trace");o(u,c,"icicle"),c.each(function(f){var h=t.select(this),d=f[0],p=d.trace;h.style("opacity",p.opacity),h.selectAll("path.surface").each(function(g){t.select(this).call(n,g,p,u)})})}function n(u,c,f,h){var d=c.data.data,p=!c.children,g=d.i,m=a.castOption(f,g,"marker.line.color")||i.defaultLine,y=a.castOption(f,g,"marker.line.width")||0;u.call(s,c,f,h).style("stroke-width",y).call(i.stroke,m).style("opacity",p?f.leaf.opacity:null)}r.exports={style:l,styleOne:n}}}),VW=de({"src/traces/icicle/draw_descendants.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=hn(),o=Zo(),s=qW(),l=GD().styleOne,n=Uv(),u=Cp(),c=p_(),f=h4().formatSliceLabel,h=!1;r.exports=function(p,g,m,y,_){var v=_.width,x=_.height,S=_.viewX,M=_.viewY,C=_.pathSlice,w=_.toMoveInsideSlice,k=_.strTransform,A=_.hasTransition,b=_.handleSlicesExit,E=_.makeUpdateSliceInterpolator,T=_.makeUpdateTextInterpolator,F=_.prevEntry,D={},R=p._context.staticPlot,P=p._fullLayout,z=g[0],I=z.trace,L=I.textposition.indexOf("left")!==-1,B=I.textposition.indexOf("right")!==-1,O=I.textposition.indexOf("bottom")!==-1,G=s(m,[v,x],{flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,orientation:I.tiling.orientation,pad:{inner:I.tiling.pad},maxDepth:I._maxDepth}),W=G.descendants(),X=1/0,Z=-1/0;W.forEach(function(U){var V=U.depth;V>=I._maxDepth?(U.x0=U.x1=(U.x0+U.x1)/2,U.y0=U.y1=(U.y0+U.y1)/2):(X=Math.min(X,V),Z=Math.max(Z,V))}),y=y.data(W,u.getPtId),I._maxVisibleLayers=isFinite(Z)?Z-X+1:0,y.enter().append("g").classed("slice",!0),b(y,h,D,[v,x],C),y.order();var J=null;if(A&&F){var N=u.getPtId(F);y.each(function(U){J===null&&u.getPtId(U)===N&&(J={x0:U.x0,x1:U.x1,y0:U.y0,y1:U.y1})})}var H=function(){return J||{x0:0,x1:v,y0:0,y1:x}},$=y;return A&&($=$.transition().each("end",function(){var U=t.select(this);u.setSliceCursor(U,p,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),$.each(function(U){U._x0=S(U.x0),U._x1=S(U.x1),U._y0=M(U.y0),U._y1=M(U.y1),U._hoverX=S(U.x1-I.tiling.pad),U._hoverY=M(O?U.y1-I.tiling.pad/2:U.y0+I.tiling.pad/2);var V=t.select(this),j=i.ensureSingle(V,"path","surface",function(te){te.style("pointer-events",R?"none":"all")});A?j.transition().attrTween("d",function(te){var ne=E(te,h,H(),[v,x],{orientation:I.tiling.orientation,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1});return function(se){return C(ne(se))}}):j.attr("d",C),V.call(c,m,p,g,{styleOne:l,eventDataKeys:n.eventDataKeys,transitionTime:n.CLICK_TRANSITION_TIME,transitionEasing:n.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,p,{isTransitioning:p._transitioning}),j.call(l,U,I,p,{hovered:!1}),U.x0===U.x1||U.y0===U.y1?U._text="":U._text=f(U,m,I,g,P)||"";var q=i.ensureSingle(V,"g","slicetext"),Y=i.ensureSingle(q,"text","",function(te){te.attr("data-notex",1)}),K=i.ensureUniformFontSize(p,u.determineTextFont(I,U,P.font));Y.text(U._text||" ").classed("slicetext",!0).attr("text-anchor",B?"end":L?"start":"middle").call(a.font,K).call(o.convertToTspans,p),U.textBB=a.bBox(Y.node()),U.transform=w(U,{fontSize:K.size}),U.transform.fontSize=K.size,A?Y.transition().attrTween("transform",function(te){var ne=T(te,h,H(),[v,x]);return function(se){return k(ne(se))}}):Y.attr("transform",k(U))}),J}}}),GW=de({"src/traces/icicle/plot.js"(e,r){"use strict";var t=jD(),i=VW();r.exports=function(o,s,l,n){return t(o,s,l,n,{type:"icicle",drawDescendants:i})}}}),HW=de({"src/traces/icicle/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"icicle",basePlotModule:NW(),categories:[],animatable:!0,attributes:UD(),layoutAttributes:qD(),supplyDefaults:jW(),supplyLayoutDefaults:UW(),calc:VD().calc,crossTraceCalc:VD().crossTraceCalc,plot:GW(),style:GD().style,colorbar:Yu(),meta:{}}}}),$W=de({"lib/icicle.js"(e,r){"use strict";r.exports=HW()}}),WW=de({"src/traces/funnelarea/base_plot.js"(e){"use strict";var r=Es();e.name="funnelarea",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),HD=de({"src/traces/funnelarea/attributes.js"(e,r){"use strict";var t=Pv(),i=ri(),a=Is().attributes,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=Vo(),n=fn().extendFlat;r.exports={labels:t.labels,label0:t.label0,dlabel:t.dlabel,values:t.values,marker:{colors:t.marker.colors,line:{color:n({},t.marker.line.color,{dflt:null}),width:n({},t.marker.line.width,{dflt:1}),editType:"calc"},pattern:t.marker.pattern,editType:"calc"},text:t.text,hovertext:t.hovertext,scalegroup:n({},t.scalegroup,{}),textinfo:n({},t.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:l({editType:"plot"}),hoverinfo:n({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:l(),textposition:n({},t.textposition,{values:["inside","none"],dflt:"inside"}),textfont:t.textfont,insidetextfont:t.insidetextfont,title:{text:t.title.text,font:t.title.font,position:n({},t.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),$D=de({"src/traces/funnelarea/layout_attributes.js"(e,r){"use strict";var t=R3().hiddenlabels;r.exports={hiddenlabels:t,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),YW=de({"src/traces/funnelarea/defaults.js"(e,r){"use strict";var t=Qt(),i=HD(),a=Is().defaults,o=oh().handleText,s=Iv().handleLabelsAndValues,l=Iv().handleMarkerDefaults;r.exports=function(u,c,f,h){function d(C,w){return t.coerce(u,c,i,C,w)}var p=d("labels"),g=d("values"),m=s(p,g),y=m.len;if(c._hasLabels=m.hasLabels,c._hasValues=m.hasValues,!c._hasLabels&&c._hasValues&&(d("label0"),d("dlabel")),!y){c.visible=!1;return}c._length=y,l(u,c,h,d),d("scalegroup");var _=d("text"),v=d("texttemplate");d("texttemplatefallback");var x;if(v||(x=d("textinfo",Array.isArray(_)?"text+percent":"percent")),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback"),v||x&&x!=="none"){var S=d("textposition");o(u,c,h,d,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else x==="none"&&d("textposition","none");a(c,h,d);var M=d("title.text");M&&(d("title.position"),t.coerceFont(d,"title.font",h.font)),d("aspectratio"),d("baseratio")}}}),XW=de({"src/traces/funnelarea/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=$D();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("hiddenlabels"),l("funnelareacolorway",s.colorway),l("extendfunnelareacolors")}}}),WD=de({"src/traces/funnelarea/calc.js"(e,r){"use strict";var t=E1();function i(o,s){return t.calc(o,s)}function a(o){t.crossTraceCalc(o,{type:"funnelarea"})}r.exports={calc:i,crossTraceCalc:a}}}),ZW=de({"src/traces/funnelarea/plot.js"(e,r){"use strict";var t=Yr(),i=hn(),a=Qt(),o=a.strScale,s=a.strTranslate,l=Zo(),n=Sv(),u=n.toMoveInsideBar,c=dc(),f=c.recordMinTextSize,h=c.clearMinTextSize,d=p0(),p=z3(),g=p.attachFxHandlers,m=p.determineInsideTextFont,y=p.layoutAreas,_=p.prerenderTitles,v=p.positionTitleOutside,x=p.formatSliceLabel;r.exports=function(k,A){var b=k._context.staticPlot,E=k._fullLayout;h("funnelarea",E),_(A,k),y(A,E._size),a.makeTraceGroups(E._funnelarealayer,A,"trace").each(function(T){var F=t.select(this),D=T[0],R=D.trace;C(T),F.each(function(){var P=t.select(this).selectAll("g.slice").data(T);P.enter().append("g").classed("slice",!0),P.exit().remove(),P.each(function(I,L){if(I.hidden){t.select(this).selectAll("path,g").remove();return}I.pointNumber=I.i,I.curveNumber=R.index;var B=D.cx,O=D.cy,G=t.select(this),W=G.selectAll("path.surface").data([I]);W.enter().append("path").classed("surface",!0).style({"pointer-events":b?"none":"all"}),G.call(g,k,T);var X="M"+(B+I.TR[0])+","+(O+I.TR[1])+S(I.TR,I.BR)+S(I.BR,I.BL)+S(I.BL,I.TL)+"Z";W.attr("d",X),x(k,I,D);var Z=d.castOption(R.textposition,I.pts),J=G.selectAll("g.slicetext").data(I.text&&Z!=="none"?[0]:[]);J.enter().append("g").classed("slicetext",!0),J.exit().remove(),J.each(function(){var N=a.ensureSingle(t.select(this),"text","",function(K){K.attr("data-notex",1)}),H=a.ensureUniformFontSize(k,m(R,I,E.font));N.text(I.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,H).call(l.convertToTspans,k);var $=i.bBox(N.node()),U,V,j,q=Math.min(I.BL[1],I.BR[1])+O,Y=Math.max(I.TL[1],I.TR[1])+O;V=Math.max(I.TL[0],I.BL[0])+B,j=Math.min(I.TR[0],I.BR[0])+B,U=u(V,j,q,Y,$,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),U.fontSize=H.size,f(R.type,U,E),T[L].transform=U,a.setTransormAndDisplay(N,U)})});var z=t.select(this).selectAll("g.titletext").data(R.title.text?[0]:[]);z.enter().append("g").classed("titletext",!0),z.exit().remove(),z.each(function(){var I=a.ensureSingle(t.select(this),"text","",function(O){O.attr("data-notex",1)}),L=R.title.text;R._meta&&(L=a.templateString(L,R._meta)),I.text(L).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,R.title.font).call(l.convertToTspans,k);var B=v(D,E._size);I.attr("transform",s(B.x,B.y)+o(Math.min(1,B.scale))+s(B.tx,B.ty))})})})};function S(w,k){var A=k[0]-w[0],b=k[1]-w[1];return"l"+A+","+b}function M(w,k){return[.5*(w[0]+k[0]),.5*(w[1]+k[1])]}function C(w){if(!w.length)return;var k=w[0],A=k.trace,b=A.aspectratio,E=A.baseratio;E>.999&&(E=.999);var T=Math.pow(E,2),F=k.vTotal,D=F*T/(1-T),R=F,P=D/F;function z(){var te=Math.sqrt(P);return{x:te,y:-te}}function I(){var te=z();return[te.x,te.y]}var L,B=[];B.push(I());var O,G;for(O=w.length-1;O>-1;O--)if(G=w[O],!G.hidden){var W=G.v/R;P+=W,B.push(I())}var X=1/0,Z=-1/0;for(O=0;O-1;O--)if(G=w[O],!G.hidden){q+=1;var Y=B[q][0],K=B[q][1];G.TL=[-Y,K],G.TR=[Y,K],G.BL=V,G.BR=j,G.pxmid=M(G.TR,G.BR),V=G.TL,j=G.TR}}}}),KW=de({"src/traces/funnelarea/style.js"(e,r){"use strict";var t=Yr(),i=d1(),a=dc().resizeText;r.exports=function(s){var l=s._fullLayout._funnelarealayer.selectAll(".trace");a(s,l,"funnelarea"),l.each(function(n){var u=n[0],c=u.trace,f=t.select(this);f.style({opacity:c.opacity}),f.selectAll("path.surface").each(function(h){t.select(this).call(i,h,c,s)})})}}}),JW=de({"src/traces/funnelarea/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"funnelarea",basePlotModule:WW(),categories:["pie-like","funnelarea","showLegend"],attributes:HD(),layoutAttributes:$D(),supplyDefaults:YW(),supplyLayoutDefaults:XW(),calc:WD().calc,crossTraceCalc:WD().crossTraceCalc,plot:ZW(),style:KW(),styleOne:d1(),meta:{}}}}),QW=de({"lib/funnelarea.js"(e,r){"use strict";r.exports=JW()}}),ku=de({"stackgl_modules/index.js"(e,r){"use strict";(()=>{var t={3065(s,l,n){s.exports={alpha_shape:n(3502),convex_hull:n(7352),delaunay_triangulate:n(7642),gl_cone3d:n(6405),gl_error3d:n(9165),gl_line3d:n(5714),gl_mesh3d:n(7201),gl_plot3d:n(4100),gl_scatter3d:n(8418),gl_streamtube3d:n(7815),gl_surface3d:n(9499),ndarray:n(9618),ndarray_linear_interpolate:n(4317)}},6296(s,l,n){"use strict";s.exports=p;var u=n(7261),c=n(9977),f=n(1811);function h(g,m){this._controllerNames=Object.keys(g),this._controllerList=this._controllerNames.map(function(y){return g[y]}),this._mode=m,this._active=g[m],this._active||(this._mode="turntable",this._active=g.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var d=h.prototype;d.flush=function(g){for(var m=this._controllerList,y=0;y"u"?n(1538):WeakMap,c=n(2762),f=n(8116),h=new u;function d(p){var g=h.get(p),m=g&&(g._triangleBuffer.handle||g._triangleBuffer.buffer);if(!m||!p.isBuffer(m)){var y=c(p,new Float32Array([-1,-1,-1,4,4,-1]));g=f(p,[{buffer:y,type:p.FLOAT,size:2}]),g._triangleBuffer=y,h.set(p,g)}g.bind(),p.drawArrays(p.TRIANGLES,0,3),g.unbind()}s.exports=d},1085(s,l,n){var u=n(1371);s.exports=c;function c(f,h,d){h=typeof h=="number"?h:1,d=d||": ";var p=f.split(/\r?\n/),g=String(p.length+h-1).length;return p.map(function(m,y){var _=y+h,v=String(_).length,x=u(_,g-v);return x+d+m}).join(` -`)}},3952(s,l,n){"use strict";s.exports=f;var u=n(3250);function c(h,d){for(var p=new Array(d+1),g=0;g0)throw new Error("Invalid string. Length must be a multiple of 4");var C=S.indexOf("=");C===-1&&(C=M);var w=C===M?0:4-C%4;return[C,w]}function g(S){var M=p(S),C=M[0],w=M[1];return(C+w)*3/4-w}function m(S,M,C){return(M+C)*3/4-C}function y(S){var M,C=p(S),w=C[0],k=C[1],A=new c(m(S,w,k)),b=0,E=k>0?w-4:w,T;for(T=0;T>16&255,A[b++]=M>>8&255,A[b++]=M&255;return k===2&&(M=u[S.charCodeAt(T)]<<2|u[S.charCodeAt(T+1)]>>4,A[b++]=M&255),k===1&&(M=u[S.charCodeAt(T)]<<10|u[S.charCodeAt(T+1)]<<4|u[S.charCodeAt(T+2)]>>2,A[b++]=M>>8&255,A[b++]=M&255),A}function _(S){return n[S>>18&63]+n[S>>12&63]+n[S>>6&63]+n[S&63]}function v(S,M,C){for(var w,k=[],A=M;AE?E:b+A));return w===1?(M=S[C-1],k.push(n[M>>2]+n[M<<4&63]+"==")):w===2&&(M=(S[C-2]<<8)+S[C-1],k.push(n[M>>10]+n[M>>4&63]+n[M<<2&63]+"=")),k.join("")}},3865(s,l,n){"use strict";var u=n(869);s.exports=c;function c(f,h){return u(f[0].mul(h[1]).add(h[0].mul(f[1])),f[1].mul(h[1]))}},1318(s){"use strict";s.exports=l;function l(n,u){return n[0].mul(u[1]).cmp(u[0].mul(n[1]))}},8697(s,l,n){"use strict";var u=n(869);s.exports=c;function c(f,h){return u(f[0].mul(h[1]),f[1].mul(h[0]))}},7842(s,l,n){"use strict";var u=n(6330),c=n(1533),f=n(2651),h=n(6768),d=n(869),p=n(8697);s.exports=g;function g(m,y){if(u(m))return y?p(m,g(y)):[m[0].clone(),m[1].clone()];var _=0,v,x;if(c(m))v=m.clone();else if(typeof m=="string")v=h(m);else{if(m===0)return[f(0),f(1)];if(m===Math.floor(m))v=f(m);else{for(;m!==Math.floor(m);)m=m*Math.pow(2,256),_-=256;v=f(m)}}if(u(y))v.mul(y[1]),x=y[0].clone();else if(c(y))x=y.clone();else if(typeof y=="string")x=h(y);else if(!y)x=f(1);else if(y===Math.floor(y))x=f(y);else{for(;y!==Math.floor(y);)y=y*Math.pow(2,256),_+=256;x=f(y)}return _>0?v=v.ushln(_):_<0&&(x=x.ushln(-_)),d(v,x)}},6330(s,l,n){"use strict";var u=n(1533);s.exports=c;function c(f){return Array.isArray(f)&&f.length===2&&u(f[0])&&u(f[1])}},5716(s,l,n){"use strict";var u=n(6859);s.exports=c;function c(f){return f.cmp(new u(0))}},1369(s,l,n){"use strict";var u=n(5716);s.exports=c;function c(f){var h=f.length,d=f.words,p=0;if(h===1)p=d[0];else if(h===2)p=d[0]+d[1]*67108864;else for(var g=0;g20?52:p+32}},1533(s,l,n){"use strict";var u=n(6859);s.exports=c;function c(f){return f&&typeof f=="object"&&!!f.words}},2651(s,l,n){"use strict";var u=n(6859),c=n(2361);s.exports=f;function f(h){var d=c.exponent(h);return d<52?new u(h):new u(h*Math.pow(2,52-d)).ushln(d-52)}},869(s,l,n){"use strict";var u=n(2651),c=n(5716);s.exports=f;function f(h,d){var p=c(h),g=c(d);if(p===0)return[u(0),u(1)];if(g===0)return[u(0),u(0)];g<0&&(h=h.neg(),d=d.neg());var m=h.gcd(d);return m.cmpn(1)?[h.div(m),d.div(m)]:[h,d]}},6768(s,l,n){"use strict";var u=n(6859);s.exports=c;function c(f){return new u(f)}},6504(s,l,n){"use strict";var u=n(869);s.exports=c;function c(f,h){return u(f[0].mul(h[0]),f[1].mul(h[1]))}},7721(s,l,n){"use strict";var u=n(5716);s.exports=c;function c(f){return u(f[0])*u(f[1])}},5572(s,l,n){"use strict";var u=n(869);s.exports=c;function c(f,h){return u(f[0].mul(h[1]).sub(f[1].mul(h[0])),f[1].mul(h[1]))}},946(s,l,n){"use strict";var u=n(1369),c=n(4025);s.exports=f;function f(h){var d=h[0],p=h[1];if(d.cmpn(0)===0)return 0;var g=d.abs().divmod(p.abs()),m=g.div,y=u(m),_=g.mod,v=d.negative!==p.negative?-1:1;if(_.cmpn(0)===0)return v*y;if(y){var x=c(y)+4,S=u(_.ushln(x).divRound(p));return v*(y+S*Math.pow(2,-x))}else{var M=p.bitLength()-_.bitLength()+53,S=u(_.ushln(M).divRound(p));return M<1023?v*S*Math.pow(2,-M):(S*=Math.pow(2,-1023),v*S*Math.pow(2,1023-M))}}},2478(s){"use strict";function l(d,p,g,m,y){for(var _=y+1;m<=y;){var v=m+y>>>1,x=d[v],S=g!==void 0?g(x,p):x-p;S>=0?(_=v,y=v-1):m=v+1}return _}function n(d,p,g,m,y){for(var _=y+1;m<=y;){var v=m+y>>>1,x=d[v],S=g!==void 0?g(x,p):x-p;S>0?(_=v,y=v-1):m=v+1}return _}function u(d,p,g,m,y){for(var _=m-1;m<=y;){var v=m+y>>>1,x=d[v],S=g!==void 0?g(x,p):x-p;S<0?(_=v,m=v+1):y=v-1}return _}function c(d,p,g,m,y){for(var _=m-1;m<=y;){var v=m+y>>>1,x=d[v],S=g!==void 0?g(x,p):x-p;S<=0?(_=v,m=v+1):y=v-1}return _}function f(d,p,g,m,y){for(;m<=y;){var _=m+y>>>1,v=d[_],x=g!==void 0?g(v,p):v-p;if(x===0)return _;x<=0?m=_+1:y=_-1}return-1}function h(d,p,g,m,y,_){return typeof g=="function"?_(d,p,g,m===void 0?0:m|0,y===void 0?d.length-1:y|0):_(d,p,void 0,g===void 0?0:g|0,m===void 0?d.length-1:m|0)}s.exports={ge:function(d,p,g,m,y){return h(d,p,g,m,y,l)},gt:function(d,p,g,m,y){return h(d,p,g,m,y,n)},lt:function(d,p,g,m,y){return h(d,p,g,m,y,u)},le:function(d,p,g,m,y){return h(d,p,g,m,y,c)},eq:function(d,p,g,m,y){return h(d,p,g,m,y,f)}}},8828(s,l){"use strict";"use restrict";var n=32;l.INT_BITS=n,l.INT_MAX=2147483647,l.INT_MIN=-1<0)-(f<0)},l.abs=function(f){var h=f>>n-1;return(f^h)-h},l.min=function(f,h){return h^(f^h)&-(f65535)<<4,f>>>=h,d=(f>255)<<3,f>>>=d,h|=d,d=(f>15)<<2,f>>>=d,h|=d,d=(f>3)<<1,f>>>=d,h|=d,h|f>>1},l.log10=function(f){return f>=1e9?9:f>=1e8?8:f>=1e7?7:f>=1e6?6:f>=1e5?5:f>=1e4?4:f>=1e3?3:f>=100?2:f>=10?1:0},l.popCount=function(f){return f=f-(f>>>1&1431655765),f=(f&858993459)+(f>>>2&858993459),(f+(f>>>4)&252645135)*16843009>>>24};function u(f){var h=32;return f&=-f,f&&h--,f&65535&&(h-=16),f&16711935&&(h-=8),f&252645135&&(h-=4),f&858993459&&(h-=2),f&1431655765&&(h-=1),h}l.countTrailingZeros=u,l.nextPow2=function(f){return f+=f===0,--f,f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f+1},l.prevPow2=function(f){return f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f-(f>>>1)},l.parity=function(f){return f^=f>>>16,f^=f>>>8,f^=f>>>4,f&=15,27030>>>f&1};var c=new Array(256);(function(f){for(var h=0;h<256;++h){var d=h,p=h,g=7;for(d>>>=1;d;d>>>=1)p<<=1,p|=d&1,--g;f[h]=p<>>8&255]<<16|c[f>>>16&255]<<8|c[f>>>24&255]},l.interleave2=function(f,h){return f&=65535,f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,h&=65535,h=(h|h<<8)&16711935,h=(h|h<<4)&252645135,h=(h|h<<2)&858993459,h=(h|h<<1)&1431655765,f|h<<1},l.deinterleave2=function(f,h){return f=f>>>h&1431655765,f=(f|f>>>1)&858993459,f=(f|f>>>2)&252645135,f=(f|f>>>4)&16711935,f=(f|f>>>16)&65535,f<<16>>16},l.interleave3=function(f,h,d){return f&=1023,f=(f|f<<16)&4278190335,f=(f|f<<8)&251719695,f=(f|f<<4)&3272356035,f=(f|f<<2)&1227133513,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,f|=h<<1,d&=1023,d=(d|d<<16)&4278190335,d=(d|d<<8)&251719695,d=(d|d<<4)&3272356035,d=(d|d<<2)&1227133513,f|d<<2},l.deinterleave3=function(f,h){return f=f>>>h&1227133513,f=(f|f>>>2)&3272356035,f=(f|f>>>4)&251719695,f=(f|f>>>8)&4278190335,f=(f|f>>>16)&1023,f<<22>>22},l.nextCombination=function(f){var h=f|f-1;return h+1|(~h&-~h)-1>>>u(f)+1}},6859(s,l,n){s=n.nmd(s),(function(u,c){"use strict";function f(I,L){if(!I)throw new Error(L||"Assertion failed")}function h(I,L){I.super_=L;var B=function(){};B.prototype=L.prototype,I.prototype=new B,I.prototype.constructor=I}function d(I,L,B){if(d.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((L==="le"||L==="be")&&(B=L,L=10),this._init(I||0,L||10,B||"be"))}typeof u=="object"?u.exports=d:c.BN=d,d.BN=d,d.wordSize=26;var p;try{typeof window<"u"&&typeof window.Buffer<"u"?p=window.Buffer:p=n(7790).Buffer}catch{}d.isBN=function(L){return L instanceof d?!0:L!==null&&typeof L=="object"&&L.constructor.wordSize===d.wordSize&&Array.isArray(L.words)},d.max=function(L,B){return L.cmp(B)>0?L:B},d.min=function(L,B){return L.cmp(B)<0?L:B},d.prototype._init=function(L,B,O){if(typeof L=="number")return this._initNumber(L,B,O);if(typeof L=="object")return this._initArray(L,B,O);B==="hex"&&(B=16),f(B===(B|0)&&B>=2&&B<=36),L=L.toString().replace(/\s+/g,"");var G=0;L[0]==="-"&&(G++,this.negative=1),G=0;G-=3)X=L[G]|L[G-1]<<8|L[G-2]<<16,this.words[W]|=X<>>26-Z&67108863,Z+=24,Z>=26&&(Z-=26,W++);else if(O==="le")for(G=0,W=0;G>>26-Z&67108863,Z+=24,Z>=26&&(Z-=26,W++);return this.strip()};function g(I,L){var B=I.charCodeAt(L);return B>=65&&B<=70?B-55:B>=97&&B<=102?B-87:B-48&15}function m(I,L,B){var O=g(I,B);return B-1>=L&&(O|=g(I,B-1)<<4),O}d.prototype._parseHex=function(L,B,O){this.length=Math.ceil((L.length-B)/6),this.words=new Array(this.length);for(var G=0;G=B;G-=2)Z=m(L,B,G)<=18?(W-=18,X+=1,this.words[X]|=Z>>>26):W+=8;else{var J=L.length-B;for(G=J%2===0?B+1:B;G=18?(W-=18,X+=1,this.words[X]|=Z>>>26):W+=8}this.strip()};function y(I,L,B,O){for(var G=0,W=Math.min(I.length,B),X=L;X=49?G+=Z-49+10:Z>=17?G+=Z-17+10:G+=Z}return G}d.prototype._parseBase=function(L,B,O){this.words=[0],this.length=1;for(var G=0,W=1;W<=67108863;W*=B)G++;G--,W=W/B|0;for(var X=L.length-O,Z=X%G,J=Math.min(X,X-Z)+O,N=0,H=O;H1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},d.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],v=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];d.prototype.toString=function(L,B){L=L||10,B=B|0||1;var O;if(L===16||L==="hex"){O="";for(var G=0,W=0,X=0;X>>24-G&16777215,G+=2,G>=26&&(G-=26,X--),W!==0||X!==this.length-1?O=_[6-J.length]+J+O:O=J+O}for(W!==0&&(O=W.toString(16)+O);O.length%B!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}if(L===(L|0)&&L>=2&&L<=36){var N=v[L],H=x[L];O="";var $=this.clone();for($.negative=0;!$.isZero();){var U=$.modn(H).toString(L);$=$.idivn(H),$.isZero()?O=U+O:O=_[N-U.length]+U+O}for(this.isZero()&&(O="0"+O);O.length%B!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}f(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var L=this.words[0];return this.length===2?L+=this.words[1]*67108864:this.length===3&&this.words[2]===1?L+=4503599627370496+this.words[1]*67108864:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-L:L},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(L,B){return f(typeof p<"u"),this.toArrayLike(p,L,B)},d.prototype.toArray=function(L,B){return this.toArrayLike(Array,L,B)},d.prototype.toArrayLike=function(L,B,O){var G=this.byteLength(),W=O||Math.max(1,G);f(G<=W,"byte array longer than desired length"),f(W>0,"Requested array length <= 0"),this.strip();var X=B==="le",Z=new L(W),J,N,H=this.clone();if(X){for(N=0;!H.isZero();N++)J=H.andln(255),H.iushrn(8),Z[N]=J;for(;N=4096&&(O+=13,B>>>=13),B>=64&&(O+=7,B>>>=7),B>=8&&(O+=4,B>>>=4),B>=2&&(O+=2,B>>>=2),O+B},d.prototype._zeroBits=function(L){if(L===0)return 26;var B=L,O=0;return(B&8191)===0&&(O+=13,B>>>=13),(B&127)===0&&(O+=7,B>>>=7),(B&15)===0&&(O+=4,B>>>=4),(B&3)===0&&(O+=2,B>>>=2),(B&1)===0&&O++,O},d.prototype.bitLength=function(){var L=this.words[this.length-1],B=this._countBits(L);return(this.length-1)*26+B};function S(I){for(var L=new Array(I.bitLength()),B=0;B>>G}return L}d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var L=0,B=0;BL.length?this.clone().ior(L):L.clone().ior(this)},d.prototype.uor=function(L){return this.length>L.length?this.clone().iuor(L):L.clone().iuor(this)},d.prototype.iuand=function(L){var B;this.length>L.length?B=L:B=this;for(var O=0;OL.length?this.clone().iand(L):L.clone().iand(this)},d.prototype.uand=function(L){return this.length>L.length?this.clone().iuand(L):L.clone().iuand(this)},d.prototype.iuxor=function(L){var B,O;this.length>L.length?(B=this,O=L):(B=L,O=this);for(var G=0;GL.length?this.clone().ixor(L):L.clone().ixor(this)},d.prototype.uxor=function(L){return this.length>L.length?this.clone().iuxor(L):L.clone().iuxor(this)},d.prototype.inotn=function(L){f(typeof L=="number"&&L>=0);var B=Math.ceil(L/26)|0,O=L%26;this._expand(B),O>0&&B--;for(var G=0;G0&&(this.words[G]=~this.words[G]&67108863>>26-O,G++);G=0);var O=L/26|0,G=L%26;return this._expand(O+1),B?this.words[O]=this.words[O]|1<L.length?(O=this,G=L):(O=L,G=this);for(var W=0,X=0;X>>26;for(;W!==0&&X>>26;if(this.length=O.length,W!==0)this.words[this.length]=W,this.length++;else if(O!==this)for(;XL.length?this.clone().iadd(L):L.clone().iadd(this)},d.prototype.isub=function(L){if(L.negative!==0){L.negative=0;var B=this.iadd(L);return L.negative=1,B._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(L),this.negative=1,this._normSign();var O=this.cmp(L);if(O===0)return this.negative=0,this.length=1,this.words[0]=0,this;var G,W;O>0?(G=this,W=L):(G=L,W=this);for(var X=0,Z=0;Z>26,this.words[Z]=B&67108863;for(;X!==0&&Z>26,this.words[Z]=B&67108863;if(X===0&&Z>>26,$=J&67108863,U=Math.min(N,L.length-1),V=Math.max(0,N-I.length+1);V<=U;V++){var j=N-V|0;G=I.words[j]|0,W=L.words[V]|0,X=G*W+$,H+=X/67108864|0,$=X&67108863}B.words[N]=$|0,J=H|0}return J!==0?B.words[N]=J|0:B.length--,B.strip()}var C=function(L,B,O){var G=L.words,W=B.words,X=O.words,Z=0,J,N,H,$=G[0]|0,U=$&8191,V=$>>>13,j=G[1]|0,q=j&8191,Y=j>>>13,K=G[2]|0,te=K&8191,ne=K>>>13,se=G[3]|0,le=se&8191,ce=se>>>13,pe=G[4]|0,xe=pe&8191,ye=pe>>>13,fe=G[5]|0,ae=fe&8191,ee=fe>>>13,ie=G[6]|0,Q=ie&8191,ue=ie>>>13,ge=G[7]|0,Me=ge&8191,Te=ge>>>13,je=G[8]|0,Ve=je&8191,Ze=je>>>13,Ke=G[9]|0,vt=Ke&8191,xt=Ke>>>13,Pt=W[0]|0,mt=Pt&8191,Mt=Pt>>>13,lt=W[1]|0,qe=lt&8191,Ye=lt>>>13,me=W[2]|0,_e=me&8191,Ae=me>>>13,ke=W[3]|0,Ee=ke&8191,De=ke>>>13,Je=W[4]|0,Ue=Je&8191,at=Je>>>13,rt=W[5]|0,ft=rt&8191,At=rt>>>13,ht=W[6]|0,Gt=ht&8191,fr=ht>>>13,gt=W[7]|0,yt=gt&8191,kt=gt>>>13,Lt=W[8]|0,Ct=Lt&8191,$t=Lt>>>13,mr=W[9]|0,br=mr&8191,Er=mr>>>13;O.negative=L.negative^B.negative,O.length=19,J=Math.imul(U,mt),N=Math.imul(U,Mt),N=N+Math.imul(V,mt)|0,H=Math.imul(V,Mt);var Tr=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,J=Math.imul(q,mt),N=Math.imul(q,Mt),N=N+Math.imul(Y,mt)|0,H=Math.imul(Y,Mt),J=J+Math.imul(U,qe)|0,N=N+Math.imul(U,Ye)|0,N=N+Math.imul(V,qe)|0,H=H+Math.imul(V,Ye)|0;var Ur=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,J=Math.imul(te,mt),N=Math.imul(te,Mt),N=N+Math.imul(ne,mt)|0,H=Math.imul(ne,Mt),J=J+Math.imul(q,qe)|0,N=N+Math.imul(q,Ye)|0,N=N+Math.imul(Y,qe)|0,H=H+Math.imul(Y,Ye)|0,J=J+Math.imul(U,_e)|0,N=N+Math.imul(U,Ae)|0,N=N+Math.imul(V,_e)|0,H=H+Math.imul(V,Ae)|0;var Ai=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Ai>>>26)|0,Ai&=67108863,J=Math.imul(le,mt),N=Math.imul(le,Mt),N=N+Math.imul(ce,mt)|0,H=Math.imul(ce,Mt),J=J+Math.imul(te,qe)|0,N=N+Math.imul(te,Ye)|0,N=N+Math.imul(ne,qe)|0,H=H+Math.imul(ne,Ye)|0,J=J+Math.imul(q,_e)|0,N=N+Math.imul(q,Ae)|0,N=N+Math.imul(Y,_e)|0,H=H+Math.imul(Y,Ae)|0,J=J+Math.imul(U,Ee)|0,N=N+Math.imul(U,De)|0,N=N+Math.imul(V,Ee)|0,H=H+Math.imul(V,De)|0;var oi=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(oi>>>26)|0,oi&=67108863,J=Math.imul(xe,mt),N=Math.imul(xe,Mt),N=N+Math.imul(ye,mt)|0,H=Math.imul(ye,Mt),J=J+Math.imul(le,qe)|0,N=N+Math.imul(le,Ye)|0,N=N+Math.imul(ce,qe)|0,H=H+Math.imul(ce,Ye)|0,J=J+Math.imul(te,_e)|0,N=N+Math.imul(te,Ae)|0,N=N+Math.imul(ne,_e)|0,H=H+Math.imul(ne,Ae)|0,J=J+Math.imul(q,Ee)|0,N=N+Math.imul(q,De)|0,N=N+Math.imul(Y,Ee)|0,H=H+Math.imul(Y,De)|0,J=J+Math.imul(U,Ue)|0,N=N+Math.imul(U,at)|0,N=N+Math.imul(V,Ue)|0,H=H+Math.imul(V,at)|0;var Qr=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,J=Math.imul(ae,mt),N=Math.imul(ae,Mt),N=N+Math.imul(ee,mt)|0,H=Math.imul(ee,Mt),J=J+Math.imul(xe,qe)|0,N=N+Math.imul(xe,Ye)|0,N=N+Math.imul(ye,qe)|0,H=H+Math.imul(ye,Ye)|0,J=J+Math.imul(le,_e)|0,N=N+Math.imul(le,Ae)|0,N=N+Math.imul(ce,_e)|0,H=H+Math.imul(ce,Ae)|0,J=J+Math.imul(te,Ee)|0,N=N+Math.imul(te,De)|0,N=N+Math.imul(ne,Ee)|0,H=H+Math.imul(ne,De)|0,J=J+Math.imul(q,Ue)|0,N=N+Math.imul(q,at)|0,N=N+Math.imul(Y,Ue)|0,H=H+Math.imul(Y,at)|0,J=J+Math.imul(U,ft)|0,N=N+Math.imul(U,At)|0,N=N+Math.imul(V,ft)|0,H=H+Math.imul(V,At)|0;var ea=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(ea>>>26)|0,ea&=67108863,J=Math.imul(Q,mt),N=Math.imul(Q,Mt),N=N+Math.imul(ue,mt)|0,H=Math.imul(ue,Mt),J=J+Math.imul(ae,qe)|0,N=N+Math.imul(ae,Ye)|0,N=N+Math.imul(ee,qe)|0,H=H+Math.imul(ee,Ye)|0,J=J+Math.imul(xe,_e)|0,N=N+Math.imul(xe,Ae)|0,N=N+Math.imul(ye,_e)|0,H=H+Math.imul(ye,Ae)|0,J=J+Math.imul(le,Ee)|0,N=N+Math.imul(le,De)|0,N=N+Math.imul(ce,Ee)|0,H=H+Math.imul(ce,De)|0,J=J+Math.imul(te,Ue)|0,N=N+Math.imul(te,at)|0,N=N+Math.imul(ne,Ue)|0,H=H+Math.imul(ne,at)|0,J=J+Math.imul(q,ft)|0,N=N+Math.imul(q,At)|0,N=N+Math.imul(Y,ft)|0,H=H+Math.imul(Y,At)|0,J=J+Math.imul(U,Gt)|0,N=N+Math.imul(U,fr)|0,N=N+Math.imul(V,Gt)|0,H=H+Math.imul(V,fr)|0;var $i=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+($i>>>26)|0,$i&=67108863,J=Math.imul(Me,mt),N=Math.imul(Me,Mt),N=N+Math.imul(Te,mt)|0,H=Math.imul(Te,Mt),J=J+Math.imul(Q,qe)|0,N=N+Math.imul(Q,Ye)|0,N=N+Math.imul(ue,qe)|0,H=H+Math.imul(ue,Ye)|0,J=J+Math.imul(ae,_e)|0,N=N+Math.imul(ae,Ae)|0,N=N+Math.imul(ee,_e)|0,H=H+Math.imul(ee,Ae)|0,J=J+Math.imul(xe,Ee)|0,N=N+Math.imul(xe,De)|0,N=N+Math.imul(ye,Ee)|0,H=H+Math.imul(ye,De)|0,J=J+Math.imul(le,Ue)|0,N=N+Math.imul(le,at)|0,N=N+Math.imul(ce,Ue)|0,H=H+Math.imul(ce,at)|0,J=J+Math.imul(te,ft)|0,N=N+Math.imul(te,At)|0,N=N+Math.imul(ne,ft)|0,H=H+Math.imul(ne,At)|0,J=J+Math.imul(q,Gt)|0,N=N+Math.imul(q,fr)|0,N=N+Math.imul(Y,Gt)|0,H=H+Math.imul(Y,fr)|0,J=J+Math.imul(U,yt)|0,N=N+Math.imul(U,kt)|0,N=N+Math.imul(V,yt)|0,H=H+Math.imul(V,kt)|0;var ja=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(ja>>>26)|0,ja&=67108863,J=Math.imul(Ve,mt),N=Math.imul(Ve,Mt),N=N+Math.imul(Ze,mt)|0,H=Math.imul(Ze,Mt),J=J+Math.imul(Me,qe)|0,N=N+Math.imul(Me,Ye)|0,N=N+Math.imul(Te,qe)|0,H=H+Math.imul(Te,Ye)|0,J=J+Math.imul(Q,_e)|0,N=N+Math.imul(Q,Ae)|0,N=N+Math.imul(ue,_e)|0,H=H+Math.imul(ue,Ae)|0,J=J+Math.imul(ae,Ee)|0,N=N+Math.imul(ae,De)|0,N=N+Math.imul(ee,Ee)|0,H=H+Math.imul(ee,De)|0,J=J+Math.imul(xe,Ue)|0,N=N+Math.imul(xe,at)|0,N=N+Math.imul(ye,Ue)|0,H=H+Math.imul(ye,at)|0,J=J+Math.imul(le,ft)|0,N=N+Math.imul(le,At)|0,N=N+Math.imul(ce,ft)|0,H=H+Math.imul(ce,At)|0,J=J+Math.imul(te,Gt)|0,N=N+Math.imul(te,fr)|0,N=N+Math.imul(ne,Gt)|0,H=H+Math.imul(ne,fr)|0,J=J+Math.imul(q,yt)|0,N=N+Math.imul(q,kt)|0,N=N+Math.imul(Y,yt)|0,H=H+Math.imul(Y,kt)|0,J=J+Math.imul(U,Ct)|0,N=N+Math.imul(U,$t)|0,N=N+Math.imul(V,Ct)|0,H=H+Math.imul(V,$t)|0;var ya=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(ya>>>26)|0,ya&=67108863,J=Math.imul(vt,mt),N=Math.imul(vt,Mt),N=N+Math.imul(xt,mt)|0,H=Math.imul(xt,Mt),J=J+Math.imul(Ve,qe)|0,N=N+Math.imul(Ve,Ye)|0,N=N+Math.imul(Ze,qe)|0,H=H+Math.imul(Ze,Ye)|0,J=J+Math.imul(Me,_e)|0,N=N+Math.imul(Me,Ae)|0,N=N+Math.imul(Te,_e)|0,H=H+Math.imul(Te,Ae)|0,J=J+Math.imul(Q,Ee)|0,N=N+Math.imul(Q,De)|0,N=N+Math.imul(ue,Ee)|0,H=H+Math.imul(ue,De)|0,J=J+Math.imul(ae,Ue)|0,N=N+Math.imul(ae,at)|0,N=N+Math.imul(ee,Ue)|0,H=H+Math.imul(ee,at)|0,J=J+Math.imul(xe,ft)|0,N=N+Math.imul(xe,At)|0,N=N+Math.imul(ye,ft)|0,H=H+Math.imul(ye,At)|0,J=J+Math.imul(le,Gt)|0,N=N+Math.imul(le,fr)|0,N=N+Math.imul(ce,Gt)|0,H=H+Math.imul(ce,fr)|0,J=J+Math.imul(te,yt)|0,N=N+Math.imul(te,kt)|0,N=N+Math.imul(ne,yt)|0,H=H+Math.imul(ne,kt)|0,J=J+Math.imul(q,Ct)|0,N=N+Math.imul(q,$t)|0,N=N+Math.imul(Y,Ct)|0,H=H+Math.imul(Y,$t)|0,J=J+Math.imul(U,br)|0,N=N+Math.imul(U,Er)|0,N=N+Math.imul(V,br)|0,H=H+Math.imul(V,Er)|0;var pa=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(pa>>>26)|0,pa&=67108863,J=Math.imul(vt,qe),N=Math.imul(vt,Ye),N=N+Math.imul(xt,qe)|0,H=Math.imul(xt,Ye),J=J+Math.imul(Ve,_e)|0,N=N+Math.imul(Ve,Ae)|0,N=N+Math.imul(Ze,_e)|0,H=H+Math.imul(Ze,Ae)|0,J=J+Math.imul(Me,Ee)|0,N=N+Math.imul(Me,De)|0,N=N+Math.imul(Te,Ee)|0,H=H+Math.imul(Te,De)|0,J=J+Math.imul(Q,Ue)|0,N=N+Math.imul(Q,at)|0,N=N+Math.imul(ue,Ue)|0,H=H+Math.imul(ue,at)|0,J=J+Math.imul(ae,ft)|0,N=N+Math.imul(ae,At)|0,N=N+Math.imul(ee,ft)|0,H=H+Math.imul(ee,At)|0,J=J+Math.imul(xe,Gt)|0,N=N+Math.imul(xe,fr)|0,N=N+Math.imul(ye,Gt)|0,H=H+Math.imul(ye,fr)|0,J=J+Math.imul(le,yt)|0,N=N+Math.imul(le,kt)|0,N=N+Math.imul(ce,yt)|0,H=H+Math.imul(ce,kt)|0,J=J+Math.imul(te,Ct)|0,N=N+Math.imul(te,$t)|0,N=N+Math.imul(ne,Ct)|0,H=H+Math.imul(ne,$t)|0,J=J+Math.imul(q,br)|0,N=N+Math.imul(q,Er)|0,N=N+Math.imul(Y,br)|0,H=H+Math.imul(Y,Er)|0;var xi=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(xi>>>26)|0,xi&=67108863,J=Math.imul(vt,_e),N=Math.imul(vt,Ae),N=N+Math.imul(xt,_e)|0,H=Math.imul(xt,Ae),J=J+Math.imul(Ve,Ee)|0,N=N+Math.imul(Ve,De)|0,N=N+Math.imul(Ze,Ee)|0,H=H+Math.imul(Ze,De)|0,J=J+Math.imul(Me,Ue)|0,N=N+Math.imul(Me,at)|0,N=N+Math.imul(Te,Ue)|0,H=H+Math.imul(Te,at)|0,J=J+Math.imul(Q,ft)|0,N=N+Math.imul(Q,At)|0,N=N+Math.imul(ue,ft)|0,H=H+Math.imul(ue,At)|0,J=J+Math.imul(ae,Gt)|0,N=N+Math.imul(ae,fr)|0,N=N+Math.imul(ee,Gt)|0,H=H+Math.imul(ee,fr)|0,J=J+Math.imul(xe,yt)|0,N=N+Math.imul(xe,kt)|0,N=N+Math.imul(ye,yt)|0,H=H+Math.imul(ye,kt)|0,J=J+Math.imul(le,Ct)|0,N=N+Math.imul(le,$t)|0,N=N+Math.imul(ce,Ct)|0,H=H+Math.imul(ce,$t)|0,J=J+Math.imul(te,br)|0,N=N+Math.imul(te,Er)|0,N=N+Math.imul(ne,br)|0,H=H+Math.imul(ne,Er)|0;var bi=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(bi>>>26)|0,bi&=67108863,J=Math.imul(vt,Ee),N=Math.imul(vt,De),N=N+Math.imul(xt,Ee)|0,H=Math.imul(xt,De),J=J+Math.imul(Ve,Ue)|0,N=N+Math.imul(Ve,at)|0,N=N+Math.imul(Ze,Ue)|0,H=H+Math.imul(Ze,at)|0,J=J+Math.imul(Me,ft)|0,N=N+Math.imul(Me,At)|0,N=N+Math.imul(Te,ft)|0,H=H+Math.imul(Te,At)|0,J=J+Math.imul(Q,Gt)|0,N=N+Math.imul(Q,fr)|0,N=N+Math.imul(ue,Gt)|0,H=H+Math.imul(ue,fr)|0,J=J+Math.imul(ae,yt)|0,N=N+Math.imul(ae,kt)|0,N=N+Math.imul(ee,yt)|0,H=H+Math.imul(ee,kt)|0,J=J+Math.imul(xe,Ct)|0,N=N+Math.imul(xe,$t)|0,N=N+Math.imul(ye,Ct)|0,H=H+Math.imul(ye,$t)|0,J=J+Math.imul(le,br)|0,N=N+Math.imul(le,Er)|0,N=N+Math.imul(ce,br)|0,H=H+Math.imul(ce,Er)|0;var Ua=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Ua>>>26)|0,Ua&=67108863,J=Math.imul(vt,Ue),N=Math.imul(vt,at),N=N+Math.imul(xt,Ue)|0,H=Math.imul(xt,at),J=J+Math.imul(Ve,ft)|0,N=N+Math.imul(Ve,At)|0,N=N+Math.imul(Ze,ft)|0,H=H+Math.imul(Ze,At)|0,J=J+Math.imul(Me,Gt)|0,N=N+Math.imul(Me,fr)|0,N=N+Math.imul(Te,Gt)|0,H=H+Math.imul(Te,fr)|0,J=J+Math.imul(Q,yt)|0,N=N+Math.imul(Q,kt)|0,N=N+Math.imul(ue,yt)|0,H=H+Math.imul(ue,kt)|0,J=J+Math.imul(ae,Ct)|0,N=N+Math.imul(ae,$t)|0,N=N+Math.imul(ee,Ct)|0,H=H+Math.imul(ee,$t)|0,J=J+Math.imul(xe,br)|0,N=N+Math.imul(xe,Er)|0,N=N+Math.imul(ye,br)|0,H=H+Math.imul(ye,Er)|0;var dn=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(dn>>>26)|0,dn&=67108863,J=Math.imul(vt,ft),N=Math.imul(vt,At),N=N+Math.imul(xt,ft)|0,H=Math.imul(xt,At),J=J+Math.imul(Ve,Gt)|0,N=N+Math.imul(Ve,fr)|0,N=N+Math.imul(Ze,Gt)|0,H=H+Math.imul(Ze,fr)|0,J=J+Math.imul(Me,yt)|0,N=N+Math.imul(Me,kt)|0,N=N+Math.imul(Te,yt)|0,H=H+Math.imul(Te,kt)|0,J=J+Math.imul(Q,Ct)|0,N=N+Math.imul(Q,$t)|0,N=N+Math.imul(ue,Ct)|0,H=H+Math.imul(ue,$t)|0,J=J+Math.imul(ae,br)|0,N=N+Math.imul(ae,Er)|0,N=N+Math.imul(ee,br)|0,H=H+Math.imul(ee,Er)|0;var pi=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(pi>>>26)|0,pi&=67108863,J=Math.imul(vt,Gt),N=Math.imul(vt,fr),N=N+Math.imul(xt,Gt)|0,H=Math.imul(xt,fr),J=J+Math.imul(Ve,yt)|0,N=N+Math.imul(Ve,kt)|0,N=N+Math.imul(Ze,yt)|0,H=H+Math.imul(Ze,kt)|0,J=J+Math.imul(Me,Ct)|0,N=N+Math.imul(Me,$t)|0,N=N+Math.imul(Te,Ct)|0,H=H+Math.imul(Te,$t)|0,J=J+Math.imul(Q,br)|0,N=N+Math.imul(Q,Er)|0,N=N+Math.imul(ue,br)|0,H=H+Math.imul(ue,Er)|0;var Jr=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,J=Math.imul(vt,yt),N=Math.imul(vt,kt),N=N+Math.imul(xt,yt)|0,H=Math.imul(xt,kt),J=J+Math.imul(Ve,Ct)|0,N=N+Math.imul(Ve,$t)|0,N=N+Math.imul(Ze,Ct)|0,H=H+Math.imul(Ze,$t)|0,J=J+Math.imul(Me,br)|0,N=N+Math.imul(Me,Er)|0,N=N+Math.imul(Te,br)|0,H=H+Math.imul(Te,Er)|0;var Be=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Be>>>26)|0,Be&=67108863,J=Math.imul(vt,Ct),N=Math.imul(vt,$t),N=N+Math.imul(xt,Ct)|0,H=Math.imul(xt,$t),J=J+Math.imul(Ve,br)|0,N=N+Math.imul(Ve,Er)|0,N=N+Math.imul(Ze,br)|0,H=H+Math.imul(Ze,Er)|0;var Fe=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,J=Math.imul(vt,br),N=Math.imul(vt,Er),N=N+Math.imul(xt,br)|0,H=Math.imul(xt,Er);var Et=(Z+J|0)+((N&8191)<<13)|0;return Z=(H+(N>>>13)|0)+(Et>>>26)|0,Et&=67108863,X[0]=Tr,X[1]=Ur,X[2]=Ai,X[3]=oi,X[4]=Qr,X[5]=ea,X[6]=$i,X[7]=ja,X[8]=ya,X[9]=pa,X[10]=xi,X[11]=bi,X[12]=Ua,X[13]=dn,X[14]=pi,X[15]=Jr,X[16]=Be,X[17]=Fe,X[18]=Et,Z!==0&&(X[19]=Z,O.length++),O};Math.imul||(C=M);function w(I,L,B){B.negative=L.negative^I.negative,B.length=I.length+L.length;for(var O=0,G=0,W=0;W>>26)|0,G+=X>>>26,X&=67108863}B.words[W]=Z,O=X,X=G}return O!==0?B.words[W]=O:B.length--,B.strip()}function k(I,L,B){var O=new A;return O.mulp(I,L,B)}d.prototype.mulTo=function(L,B){var O,G=this.length+L.length;return this.length===10&&L.length===10?O=C(this,L,B):G<63?O=M(this,L,B):G<1024?O=w(this,L,B):O=k(this,L,B),O};function A(I,L){this.x=I,this.y=L}A.prototype.makeRBT=function(L){for(var B=new Array(L),O=d.prototype._countBits(L)-1,G=0;G>=1;return G},A.prototype.permute=function(L,B,O,G,W,X){for(var Z=0;Z>>1)W++;return 1<>>13,O[2*X+1]=W&8191,W=W>>>13;for(X=2*B;X>=26,B+=G/67108864|0,B+=W>>>26,this.words[O]=W&67108863}return B!==0&&(this.words[O]=B,this.length++),L===0&&(this.length=1,this._normSign()),this},d.prototype.muln=function(L){return this.clone().imuln(L)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(L){var B=S(L);if(B.length===0)return new d(1);for(var O=this,G=0;G=0);var B=L%26,O=(L-B)/26,G=67108863>>>26-B<<26-B,W;if(B!==0){var X=0;for(W=0;W>>26-B}X&&(this.words[W]=X,this.length++)}if(O!==0){for(W=this.length-1;W>=0;W--)this.words[W+O]=this.words[W];for(W=0;W=0);var G;B?G=(B-B%26)/26:G=0;var W=L%26,X=Math.min((L-W)/26,this.length),Z=67108863^67108863>>>W<X)for(this.length-=X,N=0;N=0&&(H!==0||N>=G);N--){var $=this.words[N]|0;this.words[N]=H<<26-W|$>>>W,H=$&Z}return J&&H!==0&&(J.words[J.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(L,B,O){return f(this.negative===0),this.iushrn(L,B,O)},d.prototype.shln=function(L){return this.clone().ishln(L)},d.prototype.ushln=function(L){return this.clone().iushln(L)},d.prototype.shrn=function(L){return this.clone().ishrn(L)},d.prototype.ushrn=function(L){return this.clone().iushrn(L)},d.prototype.testn=function(L){f(typeof L=="number"&&L>=0);var B=L%26,O=(L-B)/26,G=1<=0);var B=L%26,O=(L-B)/26;if(f(this.negative===0,"imaskn works only with positive numbers"),this.length<=O)return this;if(B!==0&&O++,this.length=Math.min(O,this.length),B!==0){var G=67108863^67108863>>>B<=67108864;B++)this.words[B]-=67108864,B===this.length-1?this.words[B+1]=1:this.words[B+1]++;return this.length=Math.max(this.length,B+1),this},d.prototype.isubn=function(L){if(f(typeof L=="number"),f(L<67108864),L<0)return this.iaddn(-L);if(this.negative!==0)return this.negative=0,this.iaddn(L),this.negative=1,this;if(this.words[0]-=L,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var B=0;B>26)-(J/67108864|0),this.words[W+O]=X&67108863}for(;W>26,this.words[W+O]=X&67108863;if(Z===0)return this.strip();for(f(Z===-1),Z=0,W=0;W>26,this.words[W]=X&67108863;return this.negative=1,this.strip()},d.prototype._wordDiv=function(L,B){var O=this.length-L.length,G=this.clone(),W=L,X=W.words[W.length-1]|0,Z=this._countBits(X);O=26-Z,O!==0&&(W=W.ushln(O),G.iushln(O),X=W.words[W.length-1]|0);var J=G.length-W.length,N;if(B!=="mod"){N=new d(null),N.length=J+1,N.words=new Array(N.length);for(var H=0;H=0;U--){var V=(G.words[W.length+U]|0)*67108864+(G.words[W.length+U-1]|0);for(V=Math.min(V/X|0,67108863),G._ishlnsubmul(W,V,U);G.negative!==0;)V--,G.negative=0,G._ishlnsubmul(W,1,U),G.isZero()||(G.negative^=1);N&&(N.words[U]=V)}return N&&N.strip(),G.strip(),B!=="div"&&O!==0&&G.iushrn(O),{div:N||null,mod:G}},d.prototype.divmod=function(L,B,O){if(f(!L.isZero()),this.isZero())return{div:new d(0),mod:new d(0)};var G,W,X;return this.negative!==0&&L.negative===0?(X=this.neg().divmod(L,B),B!=="mod"&&(G=X.div.neg()),B!=="div"&&(W=X.mod.neg(),O&&W.negative!==0&&W.iadd(L)),{div:G,mod:W}):this.negative===0&&L.negative!==0?(X=this.divmod(L.neg(),B),B!=="mod"&&(G=X.div.neg()),{div:G,mod:X.mod}):(this.negative&L.negative)!==0?(X=this.neg().divmod(L.neg(),B),B!=="div"&&(W=X.mod.neg(),O&&W.negative!==0&&W.isub(L)),{div:X.div,mod:W}):L.length>this.length||this.cmp(L)<0?{div:new d(0),mod:this}:L.length===1?B==="div"?{div:this.divn(L.words[0]),mod:null}:B==="mod"?{div:null,mod:new d(this.modn(L.words[0]))}:{div:this.divn(L.words[0]),mod:new d(this.modn(L.words[0]))}:this._wordDiv(L,B)},d.prototype.div=function(L){return this.divmod(L,"div",!1).div},d.prototype.mod=function(L){return this.divmod(L,"mod",!1).mod},d.prototype.umod=function(L){return this.divmod(L,"mod",!0).mod},d.prototype.divRound=function(L){var B=this.divmod(L);if(B.mod.isZero())return B.div;var O=B.mod.abs(),G=L.abs().iushrn(1),W=L.words[0]&1,X=O.cmp(G);if(X<0||W===1&&X===0)return B.div;var Z=new d(1);return Z.negative=this.negative^L.negative,B.div.iadd(Z)},d.prototype.modn=function(L){f(L<=67108863);for(var B=(1<<26)%L,O=0,G=this.length-1;G>=0;G--)O=(B*O+(this.words[G]|0))%L;return O},d.prototype.idivn=function(L){f(L<=67108863);for(var B=0,O=this.length-1;O>=0;O--){var G=(this.words[O]|0)+B*67108864;this.words[O]=G/L|0,B=G%L}return this.strip()},d.prototype.divn=function(L){return this.clone().idivn(L)},d.prototype.egcd=function(L){f(L.negative===0),f(!L.isZero());var B=this,O=L.clone();B.negative!==0?B=B.umod(L):B=B.clone();for(var G=new d(1),W=new d(0),X=new d(0),Z=new d(1),J=0;B.isEven()&&O.isEven();)B.iushrn(1),O.iushrn(1),++J;for(var N=O.clone(),H=B.clone();!B.isZero();){for(var $=0,U=1;(B.words[0]&U)===0&&$<26;++$,U<<=1);if($>0)for(B.iushrn($);$-- >0;)(G.isOdd()||W.isOdd())&&(G.iadd(N),W.isub(H)),G.iushrn(1),W.iushrn(1);for(var V=0,j=1;(O.words[0]&j)===0&&V<26;++V,j<<=1);if(V>0)for(O.iushrn(V);V-- >0;)(X.isOdd()||Z.isOdd())&&(X.iadd(N),Z.isub(H)),X.iushrn(1),Z.iushrn(1);B.cmp(O)>=0?(B.isub(O),G.isub(X),W.isub(Z)):(O.isub(B),X.isub(G),Z.isub(W))}return{a:X,b:Z,gcd:O.iushln(J)}},d.prototype._invmp=function(L){f(L.negative===0),f(!L.isZero());var B=this,O=L.clone();B.negative!==0?B=B.umod(L):B=B.clone();for(var G=new d(1),W=new d(0),X=O.clone();B.cmpn(1)>0&&O.cmpn(1)>0;){for(var Z=0,J=1;(B.words[0]&J)===0&&Z<26;++Z,J<<=1);if(Z>0)for(B.iushrn(Z);Z-- >0;)G.isOdd()&&G.iadd(X),G.iushrn(1);for(var N=0,H=1;(O.words[0]&H)===0&&N<26;++N,H<<=1);if(N>0)for(O.iushrn(N);N-- >0;)W.isOdd()&&W.iadd(X),W.iushrn(1);B.cmp(O)>=0?(B.isub(O),G.isub(W)):(O.isub(B),W.isub(G))}var $;return B.cmpn(1)===0?$=G:$=W,$.cmpn(0)<0&&$.iadd(L),$},d.prototype.gcd=function(L){if(this.isZero())return L.abs();if(L.isZero())return this.abs();var B=this.clone(),O=L.clone();B.negative=0,O.negative=0;for(var G=0;B.isEven()&&O.isEven();G++)B.iushrn(1),O.iushrn(1);do{for(;B.isEven();)B.iushrn(1);for(;O.isEven();)O.iushrn(1);var W=B.cmp(O);if(W<0){var X=B;B=O,O=X}else if(W===0||O.cmpn(1)===0)break;B.isub(O)}while(!0);return O.iushln(G)},d.prototype.invm=function(L){return this.egcd(L).a.umod(L)},d.prototype.isEven=function(){return(this.words[0]&1)===0},d.prototype.isOdd=function(){return(this.words[0]&1)===1},d.prototype.andln=function(L){return this.words[0]&L},d.prototype.bincn=function(L){f(typeof L=="number");var B=L%26,O=(L-B)/26,G=1<>>26,Z&=67108863,this.words[X]=Z}return W!==0&&(this.words[X]=W,this.length++),this},d.prototype.isZero=function(){return this.length===1&&this.words[0]===0},d.prototype.cmpn=function(L){var B=L<0;if(this.negative!==0&&!B)return-1;if(this.negative===0&&B)return 1;this.strip();var O;if(this.length>1)O=1;else{B&&(L=-L),f(L<=67108863,"Number is too big");var G=this.words[0]|0;O=G===L?0:GL.length)return 1;if(this.length=0;O--){var G=this.words[O]|0,W=L.words[O]|0;if(G!==W){GW&&(B=1);break}}return B},d.prototype.gtn=function(L){return this.cmpn(L)===1},d.prototype.gt=function(L){return this.cmp(L)===1},d.prototype.gten=function(L){return this.cmpn(L)>=0},d.prototype.gte=function(L){return this.cmp(L)>=0},d.prototype.ltn=function(L){return this.cmpn(L)===-1},d.prototype.lt=function(L){return this.cmp(L)===-1},d.prototype.lten=function(L){return this.cmpn(L)<=0},d.prototype.lte=function(L){return this.cmp(L)<=0},d.prototype.eqn=function(L){return this.cmpn(L)===0},d.prototype.eq=function(L){return this.cmp(L)===0},d.red=function(L){return new P(L)},d.prototype.toRed=function(L){return f(!this.red,"Already a number in reduction context"),f(this.negative===0,"red works only with positives"),L.convertTo(this)._forceRed(L)},d.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(L){return this.red=L,this},d.prototype.forceRed=function(L){return f(!this.red,"Already a number in reduction context"),this._forceRed(L)},d.prototype.redAdd=function(L){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,L)},d.prototype.redIAdd=function(L){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,L)},d.prototype.redSub=function(L){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,L)},d.prototype.redISub=function(L){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,L)},d.prototype.redShl=function(L){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,L)},d.prototype.redMul=function(L){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.mul(this,L)},d.prototype.redIMul=function(L){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.imul(this,L)},d.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(L){return f(this.red&&!L.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,L)};var b={k256:null,p224:null,p192:null,p25519:null};function E(I,L){this.name=I,this.p=new d(L,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}E.prototype._tmp=function(){var L=new d(null);return L.words=new Array(Math.ceil(this.n/13)),L},E.prototype.ireduce=function(L){var B=L,O;do this.split(B,this.tmp),B=this.imulK(B),B=B.iadd(this.tmp),O=B.bitLength();while(O>this.n);var G=O0?B.isub(this.p):B.strip!==void 0?B.strip():B._strip(),B},E.prototype.split=function(L,B){L.iushrn(this.n,0,B)},E.prototype.imulK=function(L){return L.imul(this.k)};function T(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}h(T,E),T.prototype.split=function(L,B){for(var O=4194303,G=Math.min(L.length,9),W=0;W>>22,X=Z}X>>>=22,L.words[W-10]=X,X===0&&L.length>10?L.length-=10:L.length-=9},T.prototype.imulK=function(L){L.words[L.length]=0,L.words[L.length+1]=0,L.length+=2;for(var B=0,O=0;O>>=26,L.words[O]=W,B=G}return B!==0&&(L.words[L.length++]=B),L},d._prime=function(L){if(b[L])return b[L];var B;if(L==="k256")B=new T;else if(L==="p224")B=new F;else if(L==="p192")B=new D;else if(L==="p25519")B=new R;else throw new Error("Unknown prime "+L);return b[L]=B,B};function P(I){if(typeof I=="string"){var L=d._prime(I);this.m=L.p,this.prime=L}else f(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}P.prototype._verify1=function(L){f(L.negative===0,"red works only with positives"),f(L.red,"red works only with red numbers")},P.prototype._verify2=function(L,B){f((L.negative|B.negative)===0,"red works only with positives"),f(L.red&&L.red===B.red,"red works only with red numbers")},P.prototype.imod=function(L){return this.prime?this.prime.ireduce(L)._forceRed(this):L.umod(this.m)._forceRed(this)},P.prototype.neg=function(L){return L.isZero()?L.clone():this.m.sub(L)._forceRed(this)},P.prototype.add=function(L,B){this._verify2(L,B);var O=L.add(B);return O.cmp(this.m)>=0&&O.isub(this.m),O._forceRed(this)},P.prototype.iadd=function(L,B){this._verify2(L,B);var O=L.iadd(B);return O.cmp(this.m)>=0&&O.isub(this.m),O},P.prototype.sub=function(L,B){this._verify2(L,B);var O=L.sub(B);return O.cmpn(0)<0&&O.iadd(this.m),O._forceRed(this)},P.prototype.isub=function(L,B){this._verify2(L,B);var O=L.isub(B);return O.cmpn(0)<0&&O.iadd(this.m),O},P.prototype.shl=function(L,B){return this._verify1(L),this.imod(L.ushln(B))},P.prototype.imul=function(L,B){return this._verify2(L,B),this.imod(L.imul(B))},P.prototype.mul=function(L,B){return this._verify2(L,B),this.imod(L.mul(B))},P.prototype.isqr=function(L){return this.imul(L,L.clone())},P.prototype.sqr=function(L){return this.mul(L,L)},P.prototype.sqrt=function(L){if(L.isZero())return L.clone();var B=this.m.andln(3);if(f(B%2===1),B===3){var O=this.m.add(new d(1)).iushrn(2);return this.pow(L,O)}for(var G=this.m.subn(1),W=0;!G.isZero()&&G.andln(1)===0;)W++,G.iushrn(1);f(!G.isZero());var X=new d(1).toRed(this),Z=X.redNeg(),J=this.m.subn(1).iushrn(1),N=this.m.bitLength();for(N=new d(2*N*N).toRed(this);this.pow(N,J).cmp(Z)!==0;)N.redIAdd(Z);for(var H=this.pow(N,G),$=this.pow(L,G.addn(1).iushrn(1)),U=this.pow(L,G),V=W;U.cmp(X)!==0;){for(var j=U,q=0;j.cmp(X)!==0;q++)j=j.redSqr();f(q=0;W--){for(var H=B.words[W],$=N-1;$>=0;$--){var U=H>>$&1;if(X!==G[0]&&(X=this.sqr(X)),U===0&&Z===0){J=0;continue}Z<<=1,Z|=U,J++,!(J!==O&&(W!==0||$!==0))&&(X=this.mul(X,G[Z]),J=0,Z=0)}N=26}return X},P.prototype.convertTo=function(L){var B=L.umod(this.m);return B===L?B.clone():B},P.prototype.convertFrom=function(L){var B=L.clone();return B.red=null,B},d.mont=function(L){return new z(L)};function z(I){P.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new d(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}h(z,P),z.prototype.convertTo=function(L){return this.imod(L.ushln(this.shift))},z.prototype.convertFrom=function(L){var B=this.imod(L.mul(this.rinv));return B.red=null,B},z.prototype.imul=function(L,B){if(L.isZero()||B.isZero())return L.words[0]=0,L.length=1,L;var O=L.imul(B),G=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),W=O.isub(G).iushrn(this.shift),X=W;return W.cmp(this.m)>=0?X=W.isub(this.m):W.cmpn(0)<0&&(X=W.iadd(this.m)),X._forceRed(this)},z.prototype.mul=function(L,B){if(L.isZero()||B.isZero())return new d(0)._forceRed(this);var O=L.mul(B),G=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),W=O.isub(G).iushrn(this.shift),X=W;return W.cmp(this.m)>=0?X=W.isub(this.m):W.cmpn(0)<0&&(X=W.iadd(this.m)),X._forceRed(this)},z.prototype.invm=function(L){var B=this.imod(L._invmp(this.m).mul(this.r2));return B._forceRed(this)}})(s,this)},6204(s){"use strict";s.exports=l;function l(n){var u,c,f,h=n.length,d=0;for(u=0;u>>1;if(!(A<=0)){var b,E=u.mallocDouble(2*A*w),T=u.mallocInt32(w);if(w=d(x,A,E,T),w>0){if(A===1&&C)c.init(w),b=c.sweepComplete(A,M,0,w,E,T,0,w,E,T);else{var F=u.mallocDouble(2*A*k),D=u.mallocInt32(k);k=d(S,A,F,D),k>0&&(c.init(w+k),A===1?b=c.sweepBipartite(A,M,0,w,E,T,0,k,F,D):b=f(A,M,C,w,E,T,k,F,D),u.free(F),u.free(D))}u.free(E),u.free(T)}return b}}}var g;function m(x,S){g.push([x,S])}function y(x){return g=[],p(x,x,m,!0),g}function _(x,S){return g=[],p(x,S,m,!1),g}function v(x,S,M){switch(arguments.length){case 1:return y(x);case 2:return typeof S=="function"?p(x,x,S,!0):_(x,S);case 3:return p(x,S,M,!1);default:throw new Error("box-intersect: Invalid arguments")}}},2455(s,l){"use strict";function n(){function f(p,g,m,y,_,v,x,S,M,C,w){for(var k=2*p,A=y,b=k*y;A<_;++A,b+=k){var E=v[g+b],T=v[g+b+p],F=x[A];e:for(var D=S,R=k*S;DM-S?f(p,g,m,y,_,v,x,S,M,C,w):h(p,g,m,y,_,v,x,S,M,C,w)}return d}function u(){function f(m,y,_,v,x,S,M,C,w,k,A){for(var b=2*m,E=v,T=b*v;Ek-w?v?f(m,y,_,x,S,M,C,w,k,A,b):h(m,y,_,x,S,M,C,w,k,A,b):v?d(m,y,_,x,S,M,C,w,k,A,b):p(m,y,_,x,S,M,C,w,k,A,b)}return g}function c(f){return f?n():u()}l.partial=c(!1),l.full=c(!0)},7150(s,l,n){"use strict";s.exports=I;var u=n(1888),c=n(8828),f=n(2455),h=f.partial,d=f.full,p=n(855),g=n(3545),m=n(8105),y=128,_=1<<22,v=1<<22,x=m("!(lo>=p0)&&!(p1>=hi)"),S=m("lo===p0"),M=m("lo0;){H-=1;var V=H*A,j=T[V],q=T[V+1],Y=T[V+2],K=T[V+3],te=T[V+4],ne=T[V+5],se=H*b,le=F[se],ce=F[se+1],pe=ne&1,xe=!!(ne&16),ye=W,fe=X,ae=J,ee=N;if(pe&&(ye=J,fe=N,ae=W,ee=X),!(ne&2&&(Y=M(L,j,q,Y,ye,fe,ce),q>=Y))&&!(ne&4&&(q=C(L,j,q,Y,ye,fe,le),q>=Y))){var ie=Y-q,Q=te-K;if(xe){if(L*ie*(ie+Q)m&&_[k+g]>C;--w,k-=x){for(var A=k,b=k+x,E=0;E>>1,C=2*p,w=M,k=_[C*M+g];x=F?(w=T,k=F):E>=R?(w=b,k=E):(w=D,k=R):F>=R?(w=T,k=F):R>=E?(w=b,k=E):(w=D,k=R);for(var I=C*(S-1),L=C*w,P=0;P=p0)&&!(p1>=hi)":g};function n(m){return l[m]}function u(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+b];if(F===M)if(A===T)A+=1,k+=C;else{for(var D=0;C>D;++D){var R=x[w+D];x[w+D]=x[k],x[k++]=R}var P=S[T];S[T]=S[A],S[A++]=P}}return A}function c(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+b];if(FD;++D){var R=x[w+D];x[w+D]=x[k],x[k++]=R}var P=S[T];S[T]=S[A],S[A++]=P}}return A}function f(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+E];if(F<=M)if(A===T)A+=1,k+=C;else{for(var D=0;C>D;++D){var R=x[w+D];x[w+D]=x[k],x[k++]=R}var P=S[T];S[T]=S[A],S[A++]=P}}return A}function h(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+E];if(F<=M)if(A===T)A+=1,k+=C;else{for(var D=0;C>D;++D){var R=x[w+D];x[w+D]=x[k],x[k++]=R}var P=S[T];S[T]=S[A],S[A++]=P}}return A}function d(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+b],D=x[w+E];if(F<=M&&M<=D)if(A===T)A+=1,k+=C;else{for(var R=0;C>R;++R){var P=x[w+R];x[w+R]=x[k],x[k++]=P}var z=S[T];S[T]=S[A],S[A++]=z}}return A}function p(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+b],D=x[w+E];if(FR;++R){var P=x[w+R];x[w+R]=x[k],x[k++]=P}var z=S[T];S[T]=S[A],S[A++]=z}}return A}function g(m,y,_,v,x,S,M,C){for(var w=2*m,k=w*_,A=k,b=_,E=y,T=m+y,F=_;v>F;++F,k+=w){var D=x[k+E],R=x[k+T];if(!(D>=M)&&!(C>=R))if(b===F)b+=1,A+=w;else{for(var P=0;w>P;++P){var z=x[k+P];x[k+P]=x[A],x[A++]=z}var I=S[F];S[F]=S[b],S[b++]=I}}return b}},4192(s){"use strict";s.exports=n;var l=32;function n(y,_){_<=4*l?u(0,_-1,y):m(0,_-1,y)}function u(y,_,v){for(var x=2*(y+1),S=y+1;S<=_;++S){for(var M=v[x++],C=v[x++],w=S,k=x-2;w-- >y;){var A=v[k-2],b=v[k-1];if(Av[_+1]:!0}function g(y,_,v,x){y*=2;var S=x[y];return S<_?!0:S===_?x[y+1]>1,w=C-x,k=C+x,A=S,b=w,E=C,T=k,F=M,D=y+1,R=_-1,P=0;p(A,b,v)&&(P=A,A=b,b=P),p(T,F,v)&&(P=T,T=F,F=P),p(A,E,v)&&(P=A,A=E,E=P),p(b,E,v)&&(P=b,b=E,E=P),p(A,T,v)&&(P=A,A=T,T=P),p(E,T,v)&&(P=E,E=T,T=P),p(b,F,v)&&(P=b,b=F,F=P),p(b,E,v)&&(P=b,b=E,E=P),p(T,F,v)&&(P=T,T=F,F=P);for(var z=v[2*b],I=v[2*b+1],L=v[2*T],B=v[2*T+1],O=2*A,G=2*E,W=2*F,X=2*S,Z=2*C,J=2*M,N=0;N<2;++N){var H=v[O+N],$=v[G+N],U=v[W+N];v[X+N]=H,v[Z+N]=$,v[J+N]=U}f(w,y,v),f(k,_,v);for(var V=D;V<=R;++V)if(g(V,z,I,v))V!==D&&c(V,D,v),++D;else if(!g(V,L,B,v))for(;;)if(g(R,L,B,v)){g(R,z,I,v)?(h(V,D,R,v),++D,--R):(c(V,R,v),--R);break}else{if(--R>>1;f(x,$);for(var U=0,V=0,Z=0;Z<$;++Z){var j=x[2*Z+1]|0;if(j>=h)j=j-h|0,M(m,y,V--,j);else if(j>=0)M(p,g,U--,j);else if(j<=-h){j=-j-h|0;for(var q=0;q>>1;f(x,$);for(var U=0,V=0,j=0,Z=0;Z<$;++Z){var q=x[2*Z+1]|0,Y=q&1;if(Z<$-1&&q>>1===x[2*Z+3]>>1&&(Y=2,Z+=1),q<0){for(var K=-(q>>1)-1,te=0;te>1)-1;Y===0?M(p,g,U--,K):Y===1?M(m,y,V--,K):Y===2&&M(_,v,j--,K)}}}function A(E,T,F,D,R,P,z,I,L,B,O,G){var W=0,X=2*E,Z=T,J=T+E,N=1,H=1;D?H=h:N=h;for(var $=R;$>>1;f(x,q);for(var Y=0,$=0;$=h?(te=!D,U-=h):(te=!!D,U-=1),te)C(p,g,Y++,U);else{var ne=G[U],se=X*U,le=O[se+T+1],ce=O[se+T+1+E];e:for(var pe=0;pe>>1;f(x,U);for(var V=0,J=0;J=h)p[V++]=N-h;else{N-=1;var q=O[N],Y=W*N,K=B[Y+T+1],te=B[Y+T+1+E];e:for(var ne=0;ne=0;--ne)if(p[ne]===N){for(var pe=ne+1;ped)throw new RangeError('The value "'+fe+'" is invalid for option "size"');var ae=new Uint8Array(fe);return Object.setPrototypeOf(ae,m.prototype),ae}function m(fe,ae,ee){if(typeof fe=="number"){if(typeof ae=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(fe)}return y(fe,ae,ee)}m.poolSize=8192;function y(fe,ae,ee){if(typeof fe=="string")return S(fe,ae);if(ArrayBuffer.isView(fe))return C(fe);if(fe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe);if(pe(fe,ArrayBuffer)||fe&&pe(fe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pe(fe,SharedArrayBuffer)||fe&&pe(fe.buffer,SharedArrayBuffer)))return w(fe,ae,ee);if(typeof fe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ie=fe.valueOf&&fe.valueOf();if(ie!=null&&ie!==fe)return m.from(ie,ae,ee);var Q=k(fe);if(Q)return Q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof fe[Symbol.toPrimitive]=="function")return m.from(fe[Symbol.toPrimitive]("string"),ae,ee);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe)}m.from=function(fe,ae,ee){return y(fe,ae,ee)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array);function _(fe){if(typeof fe!="number")throw new TypeError('"size" argument must be of type number');if(fe<0)throw new RangeError('The value "'+fe+'" is invalid for option "size"')}function v(fe,ae,ee){return _(fe),fe<=0?g(fe):ae!==void 0?typeof ee=="string"?g(fe).fill(ae,ee):g(fe).fill(ae):g(fe)}m.alloc=function(fe,ae,ee){return v(fe,ae,ee)};function x(fe){return _(fe),g(fe<0?0:A(fe)|0)}m.allocUnsafe=function(fe){return x(fe)},m.allocUnsafeSlow=function(fe){return x(fe)};function S(fe,ae){if((typeof ae!="string"||ae==="")&&(ae="utf8"),!m.isEncoding(ae))throw new TypeError("Unknown encoding: "+ae);var ee=E(fe,ae)|0,ie=g(ee),Q=ie.write(fe,ae);return Q!==ee&&(ie=ie.slice(0,Q)),ie}function M(fe){for(var ae=fe.length<0?0:A(fe.length)|0,ee=g(ae),ie=0;ie=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return fe|0}function b(fe){return+fe!=fe&&(fe=0),m.alloc(+fe)}m.isBuffer=function(ae){return ae!=null&&ae._isBuffer===!0&&ae!==m.prototype},m.compare=function(ae,ee){if(pe(ae,Uint8Array)&&(ae=m.from(ae,ae.offset,ae.byteLength)),pe(ee,Uint8Array)&&(ee=m.from(ee,ee.offset,ee.byteLength)),!m.isBuffer(ae)||!m.isBuffer(ee))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ae===ee)return 0;for(var ie=ae.length,Q=ee.length,ue=0,ge=Math.min(ie,Q);ueQ.length?m.from(ge).copy(Q,ue):Uint8Array.prototype.set.call(Q,ge,ue);else if(m.isBuffer(ge))ge.copy(Q,ue);else throw new TypeError('"list" argument must be an Array of Buffers');ue+=ge.length}return Q};function E(fe,ae){if(m.isBuffer(fe))return fe.length;if(ArrayBuffer.isView(fe)||pe(fe,ArrayBuffer))return fe.byteLength;if(typeof fe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof fe);var ee=fe.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&ee===0)return 0;for(var Q=!1;;)switch(ae){case"ascii":case"latin1":case"binary":return ee;case"utf8":case"utf-8":return te(fe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee*2;case"hex":return ee>>>1;case"base64":return le(fe).length;default:if(Q)return ie?-1:te(fe).length;ae=(""+ae).toLowerCase(),Q=!0}}m.byteLength=E;function T(fe,ae,ee){var ie=!1;if((ae===void 0||ae<0)&&(ae=0),ae>this.length||((ee===void 0||ee>this.length)&&(ee=this.length),ee<=0)||(ee>>>=0,ae>>>=0,ee<=ae))return"";for(fe||(fe="utf8");;)switch(fe){case"hex":return N(this,ae,ee);case"utf8":case"utf-8":return G(this,ae,ee);case"ascii":return Z(this,ae,ee);case"latin1":case"binary":return J(this,ae,ee);case"base64":return O(this,ae,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,ae,ee);default:if(ie)throw new TypeError("Unknown encoding: "+fe);fe=(fe+"").toLowerCase(),ie=!0}}m.prototype._isBuffer=!0;function F(fe,ae,ee){var ie=fe[ae];fe[ae]=fe[ee],fe[ee]=ie}m.prototype.swap16=function(){var ae=this.length;if(ae%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ee=0;eeee&&(ae+=" ... "),""},h&&(m.prototype[h]=m.prototype.inspect),m.prototype.compare=function(ae,ee,ie,Q,ue){if(pe(ae,Uint8Array)&&(ae=m.from(ae,ae.offset,ae.byteLength)),!m.isBuffer(ae))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ae);if(ee===void 0&&(ee=0),ie===void 0&&(ie=ae?ae.length:0),Q===void 0&&(Q=0),ue===void 0&&(ue=this.length),ee<0||ie>ae.length||Q<0||ue>this.length)throw new RangeError("out of range index");if(Q>=ue&&ee>=ie)return 0;if(Q>=ue)return-1;if(ee>=ie)return 1;if(ee>>>=0,ie>>>=0,Q>>>=0,ue>>>=0,this===ae)return 0;for(var ge=ue-Q,Me=ie-ee,Te=Math.min(ge,Me),je=this.slice(Q,ue),Ve=ae.slice(ee,ie),Ze=0;Ze2147483647?ee=2147483647:ee<-2147483648&&(ee=-2147483648),ee=+ee,xe(ee)&&(ee=Q?0:fe.length-1),ee<0&&(ee=fe.length+ee),ee>=fe.length){if(Q)return-1;ee=fe.length-1}else if(ee<0)if(Q)ee=0;else return-1;if(typeof ae=="string"&&(ae=m.from(ae,ie)),m.isBuffer(ae))return ae.length===0?-1:R(fe,ae,ee,ie,Q);if(typeof ae=="number")return ae=ae&255,typeof Uint8Array.prototype.indexOf=="function"?Q?Uint8Array.prototype.indexOf.call(fe,ae,ee):Uint8Array.prototype.lastIndexOf.call(fe,ae,ee):R(fe,[ae],ee,ie,Q);throw new TypeError("val must be string, number or Buffer")}function R(fe,ae,ee,ie,Q){var ue=1,ge=fe.length,Me=ae.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(fe.length<2||ae.length<2)return-1;ue=2,ge/=2,Me/=2,ee/=2}function Te(vt,xt){return ue===1?vt[xt]:vt.readUInt16BE(xt*ue)}var je;if(Q){var Ve=-1;for(je=ee;jege&&(ee=ge-Me),je=ee;je>=0;je--){for(var Ze=!0,Ke=0;KeQ&&(ie=Q)):ie=Q;var ue=ae.length;ie>ue/2&&(ie=ue/2);for(var ge=0;ge>>0,isFinite(ie)?(ie=ie>>>0,Q===void 0&&(Q="utf8")):(Q=ie,ie=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ue=this.length-ee;if((ie===void 0||ie>ue)&&(ie=ue),ae.length>0&&(ie<0||ee<0)||ee>this.length)throw new RangeError("Attempt to write outside buffer bounds");Q||(Q="utf8");for(var ge=!1;;)switch(Q){case"hex":return P(this,ae,ee,ie);case"utf8":case"utf-8":return z(this,ae,ee,ie);case"ascii":case"latin1":case"binary":return I(this,ae,ee,ie);case"base64":return L(this,ae,ee,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,ae,ee,ie);default:if(ge)throw new TypeError("Unknown encoding: "+Q);Q=(""+Q).toLowerCase(),ge=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(fe,ae,ee){return ae===0&&ee===fe.length?c.fromByteArray(fe):c.fromByteArray(fe.slice(ae,ee))}function G(fe,ae,ee){ee=Math.min(fe.length,ee);for(var ie=[],Q=ae;Q239?4:ue>223?3:ue>191?2:1;if(Q+Me<=ee){var Te,je,Ve,Ze;switch(Me){case 1:ue<128&&(ge=ue);break;case 2:Te=fe[Q+1],(Te&192)===128&&(Ze=(ue&31)<<6|Te&63,Ze>127&&(ge=Ze));break;case 3:Te=fe[Q+1],je=fe[Q+2],(Te&192)===128&&(je&192)===128&&(Ze=(ue&15)<<12|(Te&63)<<6|je&63,Ze>2047&&(Ze<55296||Ze>57343)&&(ge=Ze));break;case 4:Te=fe[Q+1],je=fe[Q+2],Ve=fe[Q+3],(Te&192)===128&&(je&192)===128&&(Ve&192)===128&&(Ze=(ue&15)<<18|(Te&63)<<12|(je&63)<<6|Ve&63,Ze>65535&&Ze<1114112&&(ge=Ze))}}ge===null?(ge=65533,Me=1):ge>65535&&(ge-=65536,ie.push(ge>>>10&1023|55296),ge=56320|ge&1023),ie.push(ge),Q+=Me}return X(ie)}var W=4096;function X(fe){var ae=fe.length;if(ae<=W)return String.fromCharCode.apply(String,fe);for(var ee="",ie=0;ieie)&&(ee=ie);for(var Q="",ue=ae;ueie&&(ae=ie),ee<0?(ee+=ie,ee<0&&(ee=0)):ee>ie&&(ee=ie),eeee)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(ae,ee,ie){ae=ae>>>0,ee=ee>>>0,ie||$(ae,ee,this.length);for(var Q=this[ae],ue=1,ge=0;++ge>>0,ee=ee>>>0,ie||$(ae,ee,this.length);for(var Q=this[ae+--ee],ue=1;ee>0&&(ue*=256);)Q+=this[ae+--ee]*ue;return Q},m.prototype.readUint8=m.prototype.readUInt8=function(ae,ee){return ae=ae>>>0,ee||$(ae,1,this.length),this[ae]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(ae,ee){return ae=ae>>>0,ee||$(ae,2,this.length),this[ae]|this[ae+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(ae,ee){return ae=ae>>>0,ee||$(ae,2,this.length),this[ae]<<8|this[ae+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),(this[ae]|this[ae+1]<<8|this[ae+2]<<16)+this[ae+3]*16777216},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),this[ae]*16777216+(this[ae+1]<<16|this[ae+2]<<8|this[ae+3])},m.prototype.readIntLE=function(ae,ee,ie){ae=ae>>>0,ee=ee>>>0,ie||$(ae,ee,this.length);for(var Q=this[ae],ue=1,ge=0;++ge=ue&&(Q-=Math.pow(2,8*ee)),Q},m.prototype.readIntBE=function(ae,ee,ie){ae=ae>>>0,ee=ee>>>0,ie||$(ae,ee,this.length);for(var Q=ee,ue=1,ge=this[ae+--Q];Q>0&&(ue*=256);)ge+=this[ae+--Q]*ue;return ue*=128,ge>=ue&&(ge-=Math.pow(2,8*ee)),ge},m.prototype.readInt8=function(ae,ee){return ae=ae>>>0,ee||$(ae,1,this.length),this[ae]&128?(255-this[ae]+1)*-1:this[ae]},m.prototype.readInt16LE=function(ae,ee){ae=ae>>>0,ee||$(ae,2,this.length);var ie=this[ae]|this[ae+1]<<8;return ie&32768?ie|4294901760:ie},m.prototype.readInt16BE=function(ae,ee){ae=ae>>>0,ee||$(ae,2,this.length);var ie=this[ae+1]|this[ae]<<8;return ie&32768?ie|4294901760:ie},m.prototype.readInt32LE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),this[ae]|this[ae+1]<<8|this[ae+2]<<16|this[ae+3]<<24},m.prototype.readInt32BE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),this[ae]<<24|this[ae+1]<<16|this[ae+2]<<8|this[ae+3]},m.prototype.readFloatLE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),f.read(this,ae,!0,23,4)},m.prototype.readFloatBE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),f.read(this,ae,!1,23,4)},m.prototype.readDoubleLE=function(ae,ee){return ae=ae>>>0,ee||$(ae,8,this.length),f.read(this,ae,!0,52,8)},m.prototype.readDoubleBE=function(ae,ee){return ae=ae>>>0,ee||$(ae,8,this.length),f.read(this,ae,!1,52,8)};function U(fe,ae,ee,ie,Q,ue){if(!m.isBuffer(fe))throw new TypeError('"buffer" argument must be a Buffer instance');if(ae>Q||aefe.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(ae,ee,ie,Q){if(ae=+ae,ee=ee>>>0,ie=ie>>>0,!Q){var ue=Math.pow(2,8*ie)-1;U(this,ae,ee,ie,ue,0)}var ge=1,Me=0;for(this[ee]=ae&255;++Me>>0,ie=ie>>>0,!Q){var ue=Math.pow(2,8*ie)-1;U(this,ae,ee,ie,ue,0)}var ge=ie-1,Me=1;for(this[ee+ge]=ae&255;--ge>=0&&(Me*=256);)this[ee+ge]=ae/Me&255;return ee+ie},m.prototype.writeUint8=m.prototype.writeUInt8=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,1,255,0),this[ee]=ae&255,ee+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,2,65535,0),this[ee]=ae&255,this[ee+1]=ae>>>8,ee+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,2,65535,0),this[ee]=ae>>>8,this[ee+1]=ae&255,ee+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,4,4294967295,0),this[ee+3]=ae>>>24,this[ee+2]=ae>>>16,this[ee+1]=ae>>>8,this[ee]=ae&255,ee+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,4,4294967295,0),this[ee]=ae>>>24,this[ee+1]=ae>>>16,this[ee+2]=ae>>>8,this[ee+3]=ae&255,ee+4},m.prototype.writeIntLE=function(ae,ee,ie,Q){if(ae=+ae,ee=ee>>>0,!Q){var ue=Math.pow(2,8*ie-1);U(this,ae,ee,ie,ue-1,-ue)}var ge=0,Me=1,Te=0;for(this[ee]=ae&255;++ge>0)-Te&255;return ee+ie},m.prototype.writeIntBE=function(ae,ee,ie,Q){if(ae=+ae,ee=ee>>>0,!Q){var ue=Math.pow(2,8*ie-1);U(this,ae,ee,ie,ue-1,-ue)}var ge=ie-1,Me=1,Te=0;for(this[ee+ge]=ae&255;--ge>=0&&(Me*=256);)ae<0&&Te===0&&this[ee+ge+1]!==0&&(Te=1),this[ee+ge]=(ae/Me>>0)-Te&255;return ee+ie},m.prototype.writeInt8=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,1,127,-128),ae<0&&(ae=255+ae+1),this[ee]=ae&255,ee+1},m.prototype.writeInt16LE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,2,32767,-32768),this[ee]=ae&255,this[ee+1]=ae>>>8,ee+2},m.prototype.writeInt16BE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,2,32767,-32768),this[ee]=ae>>>8,this[ee+1]=ae&255,ee+2},m.prototype.writeInt32LE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,4,2147483647,-2147483648),this[ee]=ae&255,this[ee+1]=ae>>>8,this[ee+2]=ae>>>16,this[ee+3]=ae>>>24,ee+4},m.prototype.writeInt32BE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,4,2147483647,-2147483648),ae<0&&(ae=4294967295+ae+1),this[ee]=ae>>>24,this[ee+1]=ae>>>16,this[ee+2]=ae>>>8,this[ee+3]=ae&255,ee+4};function V(fe,ae,ee,ie,Q,ue){if(ee+ie>fe.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("Index out of range")}function j(fe,ae,ee,ie,Q){return ae=+ae,ee=ee>>>0,Q||V(fe,ae,ee,4,34028234663852886e22,-34028234663852886e22),f.write(fe,ae,ee,ie,23,4),ee+4}m.prototype.writeFloatLE=function(ae,ee,ie){return j(this,ae,ee,!0,ie)},m.prototype.writeFloatBE=function(ae,ee,ie){return j(this,ae,ee,!1,ie)};function q(fe,ae,ee,ie,Q){return ae=+ae,ee=ee>>>0,Q||V(fe,ae,ee,8,17976931348623157e292,-17976931348623157e292),f.write(fe,ae,ee,ie,52,8),ee+8}m.prototype.writeDoubleLE=function(ae,ee,ie){return q(this,ae,ee,!0,ie)},m.prototype.writeDoubleBE=function(ae,ee,ie){return q(this,ae,ee,!1,ie)},m.prototype.copy=function(ae,ee,ie,Q){if(!m.isBuffer(ae))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!Q&&Q!==0&&(Q=this.length),ee>=ae.length&&(ee=ae.length),ee||(ee=0),Q>0&&Q=this.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("sourceEnd out of bounds");Q>this.length&&(Q=this.length),ae.length-ee>>0,ie=ie===void 0?this.length:ie>>>0,ae||(ae=0);var ge;if(typeof ae=="number")for(ge=ee;ge55295&&ee<57344){if(!Q){if(ee>56319){(ae-=3)>-1&&ue.push(239,191,189);continue}else if(ge+1===ie){(ae-=3)>-1&&ue.push(239,191,189);continue}Q=ee;continue}if(ee<56320){(ae-=3)>-1&&ue.push(239,191,189),Q=ee;continue}ee=(Q-55296<<10|ee-56320)+65536}else Q&&(ae-=3)>-1&&ue.push(239,191,189);if(Q=null,ee<128){if((ae-=1)<0)break;ue.push(ee)}else if(ee<2048){if((ae-=2)<0)break;ue.push(ee>>6|192,ee&63|128)}else if(ee<65536){if((ae-=3)<0)break;ue.push(ee>>12|224,ee>>6&63|128,ee&63|128)}else if(ee<1114112){if((ae-=4)<0)break;ue.push(ee>>18|240,ee>>12&63|128,ee>>6&63|128,ee&63|128)}else throw new Error("Invalid code point")}return ue}function ne(fe){for(var ae=[],ee=0;ee>8,Q=ee%256,ue.push(Q),ue.push(ie);return ue}function le(fe){return c.toByteArray(K(fe))}function ce(fe,ae,ee,ie){for(var Q=0;Q=ae.length||Q>=fe.length);++Q)ae[Q+ee]=fe[Q];return Q}function pe(fe,ae){return fe instanceof ae||fe!=null&&fe.constructor!=null&&fe.constructor.name!=null&&fe.constructor.name===ae.name}function xe(fe){return fe!==fe}var ye=(function(){for(var fe="0123456789abcdef",ae=new Array(256),ee=0;ee<16;++ee)for(var ie=ee*16,Q=0;Q<16;++Q)ae[ie+Q]=fe[ee]+fe[Q];return ae})()},2538(s,l,n){"use strict";var u=n(8902),c=n(5542),f=n(2272),h=n(5023);s.exports=y;function d(_){return[Math.min(_[0],_[1]),Math.max(_[0],_[1])]}function p(_,v){return _[0]-v[0]||_[1]-v[1]}function g(_){return _.map(d).sort(p)}function m(_,v,x){return v in _?_[v]:x}function y(_,v,x){Array.isArray(v)?(x=x||{},v=v||[]):(x=v||{},v=[]);var S=!!m(x,"delaunay",!0),M=!!m(x,"interior",!0),C=!!m(x,"exterior",!0),w=!!m(x,"infinity",!1);if(!M&&!C||_.length===0)return[];var k=u(_,v);if(S||M!==C||w){for(var A=c(_.length,g(v)),b=0;b0;){for(var S=g.pop(),_=g.pop(),M=-1,C=-1,v=y[_],k=1;k=0||(p.flip(_,S),f(d,p,g,M,_,C),f(d,p,g,_,C,M),f(d,p,g,C,S,M),f(d,p,g,S,M,C))}}},5023(s,l,n){"use strict";var u=n(2478);s.exports=g;function c(m,y,_,v,x,S,M){this.cells=m,this.neighbor=y,this.flags=v,this.constraint=_,this.active=x,this.next=S,this.boundary=M}var f=c.prototype;function h(m,y){return m[0]-y[0]||m[1]-y[1]||m[2]-y[2]}f.locate=(function(){var m=[0,0,0];return function(y,_,v){var x=y,S=_,M=v;return _0||M.length>0;){for(;S.length>0;){var b=S.pop();if(C[b]!==-x){C[b]=x;for(var E=w[b],T=0;T<3;++T){var F=A[3*b+T];F>=0&&C[F]===0&&(k[3*b+T]?M.push(F):(S.push(F),C[F]=x))}}}var D=M;M=S,S=D,M.length=0,x=-x}var R=p(w,C,y);return _?R.concat(v.boundary):R}},8902(s,l,n){"use strict";var u=n(2478),c=n(3250)[3],f=0,h=1,d=2;s.exports=M;function p(C,w,k,A,b){this.a=C,this.b=w,this.idx=k,this.lowerIds=A,this.upperIds=b}function g(C,w,k,A){this.a=C,this.b=w,this.type=k,this.idx=A}function m(C,w){var k=C.a[0]-w.a[0]||C.a[1]-w.a[1]||C.type-w.type;return k||C.type!==f&&(k=c(C.a,C.b,w.b),k)?k:C.idx-w.idx}function y(C,w){return c(C.a,C.b,w)}function _(C,w,k,A,b){for(var E=u.lt(w,A,y),T=u.gt(w,A,y),F=E;F1&&c(k[R[z-2]],k[R[z-1]],A)>0;)C.push([R[z-1],R[z-2],b]),z-=1;R.length=z,R.push(b);for(var P=D.upperIds,z=P.length;z>1&&c(k[P[z-2]],k[P[z-1]],A)<0;)C.push([P[z-2],P[z-1],b]),z-=1;P.length=z,P.push(b)}}function v(C,w){var k;return C.a[0]D[0]&&b.push(new g(D,F,d,E),new g(F,D,h,E))}b.sort(m);for(var R=b[0].a[0]-(1+Math.abs(b[0].a[0]))*Math.pow(2,-52),P=[new p([R,1],[R,0],-1,[],[],[],[])],z=[],E=0,I=b.length;E=0}})(),f.removeTriangle=function(p,g,m){var y=this.stars;h(y[p],g,m),h(y[g],m,p),h(y[m],p,g)},f.addTriangle=function(p,g,m){var y=this.stars;y[p].push(g,m),y[g].push(m,p),y[m].push(p,g)},f.opposite=function(p,g){for(var m=this.stars[g],y=1,_=m.length;y<_;y+=2)if(m[y]===p)return m[y-1];return-1},f.flip=function(p,g){var m=this.opposite(p,g),y=this.opposite(g,p);this.removeTriangle(p,g,m),this.removeTriangle(g,p,y),this.addTriangle(p,y,m),this.addTriangle(g,m,y)},f.edges=function(){for(var p=this.stars,g=[],m=0,y=p.length;m=0;--L){var H=z[L];B=H[0];var $=R[B],U=$[0],V=$[1],j=D[U],q=D[V];if((j[0]-q[0]||j[1]-q[1])<0){var Y=U;U=V,V=Y}$[0]=U;var K=$[1]=H[1],te;for(I&&(te=$[2]);L>0&&z[L-1][0]===B;){var H=z[--L],ne=H[1];I?R.push([K,ne,te]):R.push([K,ne]),K=ne}I?R.push([K,V,te]):R.push([K,V])}return O}function w(D,R,P){for(var z=R.length,I=new u(z),L=[],B=0;BR[2]?1:0)}function b(D,R,P){if(D.length!==0){if(R)for(var z=0;z0||B.length>0}function F(D,R,P){var z;if(P){z=R;for(var I=new Array(R.length),L=0;LC+1)throw new Error(S+" map requires nshades to be at least size "+x.length);Array.isArray(g.alpha)?g.alpha.length!==2?w=[1,1]:w=g.alpha.slice():typeof g.alpha=="number"?w=[g.alpha,g.alpha]:w=[1,1],m=x.map(function(F){return Math.round(F.index*C)}),w[0]=Math.min(Math.max(w[0],0),1),w[1]=Math.min(Math.max(w[1],0),1);var A=x.map(function(F,D){var R=x[D].index,P=x[D].rgb.slice();return P.length===4&&P[3]>=0&&P[3]<=1||(P[3]=w[0]+(w[1]-w[0])*R),P}),b=[];for(k=0;k=0}function g(m,y,_,v){var x=u(y,_,v);if(x===0){var S=c(u(m,y,_)),M=c(u(m,y,v));if(S===M){if(S===0){var C=p(m,y,_),w=p(m,y,v);return C===w?0:C?1:-1}return 0}else{if(M===0)return S>0||p(m,y,v)?-1:1;if(S===0)return M>0||p(m,y,_)?1:-1}return c(M-S)}var k=u(m,y,_);if(k>0)return x>0&&u(m,y,v)>0?1:-1;if(k<0)return x>0||u(m,y,v)>0?1:-1;var A=u(m,y,v);return A>0||p(m,y,_)?1:-1}},8572(s){"use strict";s.exports=function(n){return n<0?-1:n>0?1:0}},8507(s){s.exports=u;var l=Math.min;function n(c,f){return c-f}function u(c,f){var h=c.length,d=c.length-f.length;if(d)return d;switch(h){case 0:return 0;case 1:return c[0]-f[0];case 2:return c[0]+c[1]-f[0]-f[1]||l(c[0],c[1])-l(f[0],f[1]);case 3:var p=c[0]+c[1],g=f[0]+f[1];if(d=p+c[2]-(g+f[2]),d)return d;var m=l(c[0],c[1]),y=l(f[0],f[1]);return l(m,c[2])-l(y,f[2])||l(m+c[2],p)-l(y+f[2],g);case 4:var _=c[0],v=c[1],x=c[2],S=c[3],M=f[0],C=f[1],w=f[2],k=f[3];return _+v+x+S-(M+C+w+k)||l(_,v,x,S)-l(M,C,w,k,M)||l(_+v,_+x,_+S,v+x,v+S,x+S)-l(M+C,M+w,M+k,C+w,C+k,w+k)||l(_+v+x,_+v+S,_+x+S,v+x+S)-l(M+C+w,M+C+k,M+w+k,C+w+k);default:for(var A=c.slice().sort(n),b=f.slice().sort(n),E=0;En[c][0]&&(c=f);return uc?[[c],[u]]:[[u]]}},4750(s,l,n){"use strict";s.exports=c;var u=n(3090);function c(f){var h=u(f),d=h.length;if(d<=2)return[];for(var p=new Array(d),g=h[d-1],m=0;m=g[M]&&(S+=1);v[x]=S}}return p}function d(p,g){try{return u(p,!0)}catch{var m=c(p);if(m.length<=g)return[];var y=f(p,m),_=u(y,!0);return h(_,m)}}},4769(s){"use strict";function l(u,c,f,h,d,p){var g=6*d*d-6*d,m=3*d*d-4*d+1,y=-6*d*d+6*d,_=3*d*d-2*d;if(u.length){p||(p=new Array(u.length));for(var v=u.length-1;v>=0;--v)p[v]=g*u[v]+m*c[v]+y*f[v]+_*h[v];return p}return g*u+m*c+y*f[v]+_*h}function n(u,c,f,h,d,p){var g=d-1,m=d*d,y=g*g,_=(1+2*d)*y,v=d*y,x=m*(3-2*d),S=m*g;if(u.length){p||(p=new Array(u.length));for(var M=u.length-1;M>=0;--M)p[M]=_*u[M]+v*c[M]+x*f[M]+S*h[M];return p}return _*u+v*c+x*f+S*h}s.exports=n,s.exports.derivative=l},7642(s,l,n){"use strict";var u=n(8954),c=n(1682);s.exports=p;function f(g,m){this.point=g,this.index=m}function h(g,m){for(var y=g.point,_=m.point,v=y.length,x=0;x=2)return!1;P[I]=L}return!0}):R=R.filter(function(P){for(var z=0;z<=_;++z){var I=E[P[z]];if(I<0)return!1;P[z]=I}return!0}),_&1)for(var S=0;S>>31},s.exports.exponent=function(x){var S=s.exports.hi(x);return(S<<1>>>21)-1023},s.exports.fraction=function(x){var S=s.exports.lo(x),M=s.exports.hi(x),C=M&(1<<20)-1;return M&2146435072&&(C+=1048576),[S,C]},s.exports.denormalized=function(x){var S=s.exports.hi(x);return!(S&2146435072)}},1338(s){"use strict";function l(c,f,h){var d=c[h]|0;if(d<=0)return[];var p=new Array(d),g;if(h===c.length-1)for(g=0;g"u"&&(f=0),typeof c){case"number":if(c>0)return n(c|0,f);break;case"object":if(typeof c.length=="number")return l(c,f,0);break}return[]}s.exports=u},3134(s,l,n){"use strict";s.exports=c;var u=n(1682);function c(f,h){var d=f.length;if(typeof h!="number"){h=0;for(var p=0;p=_-1)for(var k=S.length-1,b=m-y[_-1],A=0;A=_-1)for(var w=S.length-1,k=m-y[_-1],A=0;A=0;--_)if(m[--y])return!1;return!0},d.jump=function(m){var y=this.lastT(),_=this.dimension;if(!(m0;--A)v.push(f(C[A-1],w[A-1],arguments[A])),x.push(0)}},d.push=function(m){var y=this.lastT(),_=this.dimension;if(!(m1e-6?1/M:0;this._time.push(m);for(var b=_;b>0;--b){var E=f(w[b-1],k[b-1],arguments[b]);v.push(E),x.push((E-v[S++])*A)}}},d.set=function(m){var y=this.dimension;if(!(m0;--C)_.push(f(S[C-1],M[C-1],arguments[C])),v.push(0)}},d.move=function(m){var y=this.lastT(),_=this.dimension;if(!(m<=y||arguments.length!==_+1)){var v=this._state,x=this._velocity,S=v.length-this.dimension,M=this.bounds,C=M[0],w=M[1],k=m-y,A=k>1e-6?1/k:0;this._time.push(m);for(var b=_;b>0;--b){var E=arguments[b];v.push(f(C[b-1],w[b-1],v[S++]+E)),x.push(E*A)}}},d.idle=function(m){var y=this.lastT();if(!(m=0;--A)v.push(f(C[A],w[A],v[S]+k*x[S])),x.push(0),S+=1}};function p(m){for(var y=new Array(m),_=0;_=0;--D){var b=E[D];T[D]<=0?E[D]=new u(b._color,b.key,b.value,E[D+1],b.right,b._count+1):E[D]=new u(b._color,b.key,b.value,b.left,E[D+1],b._count+1)}for(var D=E.length-1;D>1;--D){var R=E[D-1],b=E[D];if(R._color===n||b._color===n)break;var P=E[D-2];if(P.left===R)if(R.left===b){var z=P.right;if(z&&z._color===l)R._color=n,P.right=f(n,z),P._color=l,D-=1;else{if(P._color=l,P.left=R.right,R._color=n,R.right=P,E[D-2]=R,E[D-1]=b,h(P),h(R),D>=3){var I=E[D-3];I.left===P?I.left=R:I.right=R}break}}else{var z=P.right;if(z&&z._color===l)R._color=n,P.right=f(n,z),P._color=l,D-=1;else{if(R.right=b.left,P._color=l,P.left=b.right,b._color=n,b.left=R,b.right=P,E[D-2]=b,E[D-1]=R,h(P),h(R),h(b),D>=3){var I=E[D-3];I.left===P?I.left=b:I.right=b}break}}else if(R.right===b){var z=P.left;if(z&&z._color===l)R._color=n,P.left=f(n,z),P._color=l,D-=1;else{if(P._color=l,P.right=R.left,R._color=n,R.left=P,E[D-2]=R,E[D-1]=b,h(P),h(R),D>=3){var I=E[D-3];I.right===P?I.right=R:I.left=R}break}}else{var z=P.left;if(z&&z._color===l)R._color=n,P.left=f(n,z),P._color=l,D-=1;else{if(R.left=b.right,P._color=l,P.right=b.left,b._color=n,b.right=R,b.left=P,E[D-2]=b,E[D-1]=R,h(P),h(R),h(b),D>=3){var I=E[D-3];I.right===P?I.right=b:I.left=b}break}}}return E[0]._color=n,new d(A,E[0])};function g(w,k){if(k.left){var A=g(w,k.left);if(A)return A}var A=w(k.key,k.value);if(A)return A;if(k.right)return g(w,k.right)}function m(w,k,A,b){var E=k(w,b.key);if(E<=0){if(b.left){var T=m(w,k,A,b.left);if(T)return T}var T=A(b.key,b.value);if(T)return T}if(b.right)return m(w,k,A,b.right)}function y(w,k,A,b,E){var T=A(w,E.key),F=A(k,E.key),D;if(T<=0&&(E.left&&(D=y(w,k,A,b,E.left),D)||F>0&&(D=b(E.key,E.value),D)))return D;if(F>0&&E.right)return y(w,k,A,b,E.right)}p.forEach=function(k,A,b){if(this.root)switch(arguments.length){case 1:return g(k,this.root);case 2:return m(A,this._compare,k,this.root);case 3:return this._compare(A,b)>=0?void 0:y(A,b,this._compare,k,this.root)}},Object.defineProperty(p,"begin",{get:function(){for(var w=[],k=this.root;k;)w.push(k),k=k.left;return new _(this,w)}}),Object.defineProperty(p,"end",{get:function(){for(var w=[],k=this.root;k;)w.push(k),k=k.right;return new _(this,w)}}),p.at=function(w){if(w<0)return new _(this,[]);for(var k=this.root,A=[];;){if(A.push(k),k.left){if(w=k.right._count)break;k=k.right}else break}return new _(this,[])},p.ge=function(w){for(var k=this._compare,A=this.root,b=[],E=0;A;){var T=k(w,A.key);b.push(A),T<=0&&(E=b.length),T<=0?A=A.left:A=A.right}return b.length=E,new _(this,b)},p.gt=function(w){for(var k=this._compare,A=this.root,b=[],E=0;A;){var T=k(w,A.key);b.push(A),T<0&&(E=b.length),T<0?A=A.left:A=A.right}return b.length=E,new _(this,b)},p.lt=function(w){for(var k=this._compare,A=this.root,b=[],E=0;A;){var T=k(w,A.key);b.push(A),T>0&&(E=b.length),T<=0?A=A.left:A=A.right}return b.length=E,new _(this,b)},p.le=function(w){for(var k=this._compare,A=this.root,b=[],E=0;A;){var T=k(w,A.key);b.push(A),T>=0&&(E=b.length),T<0?A=A.left:A=A.right}return b.length=E,new _(this,b)},p.find=function(w){for(var k=this._compare,A=this.root,b=[];A;){var E=k(w,A.key);if(b.push(A),E===0)return new _(this,b);E<=0?A=A.left:A=A.right}return new _(this,[])},p.remove=function(w){var k=this.find(w);return k?k.remove():this},p.get=function(w){for(var k=this._compare,A=this.root;A;){var b=k(w,A.key);if(b===0)return A.value;b<=0?A=A.left:A=A.right}};function _(w,k){this.tree=w,this._stack=k}var v=_.prototype;Object.defineProperty(v,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(v,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),v.clone=function(){return new _(this.tree,this._stack.slice())};function x(w,k){w.key=k.key,w.value=k.value,w.left=k.left,w.right=k.right,w._color=k._color,w._count=k._count}function S(w){for(var k,A,b,E,T=w.length-1;T>=0;--T){if(k=w[T],T===0){k._color=n;return}if(A=w[T-1],A.left===k){if(b=A.right,b.right&&b.right._color===l){if(b=A.right=c(b),E=b.right=c(b.right),A.right=b.left,b.left=A,b.right=E,b._color=A._color,k._color=n,A._color=n,E._color=n,h(A),h(b),T>1){var F=w[T-2];F.left===A?F.left=b:F.right=b}w[T-1]=b;return}else if(b.left&&b.left._color===l){if(b=A.right=c(b),E=b.left=c(b.left),A.right=E.left,b.left=E.right,E.left=A,E.right=b,E._color=A._color,A._color=n,b._color=n,k._color=n,h(A),h(b),h(E),T>1){var F=w[T-2];F.left===A?F.left=E:F.right=E}w[T-1]=E;return}if(b._color===n)if(A._color===l){A._color=n,A.right=f(l,b);return}else{A.right=f(l,b);continue}else{if(b=c(b),A.right=b.left,b.left=A,b._color=A._color,A._color=l,h(A),h(b),T>1){var F=w[T-2];F.left===A?F.left=b:F.right=b}w[T-1]=b,w[T]=A,T+11){var F=w[T-2];F.right===A?F.right=b:F.left=b}w[T-1]=b;return}else if(b.right&&b.right._color===l){if(b=A.left=c(b),E=b.right=c(b.right),A.left=E.right,b.right=E.left,E.right=A,E.left=b,E._color=A._color,A._color=n,b._color=n,k._color=n,h(A),h(b),h(E),T>1){var F=w[T-2];F.right===A?F.right=E:F.left=E}w[T-1]=E;return}if(b._color===n)if(A._color===l){A._color=n,A.left=f(l,b);return}else{A.left=f(l,b);continue}else{if(b=c(b),A.left=b.right,b.right=A,b._color=A._color,A._color=l,h(A),h(b),T>1){var F=w[T-2];F.right===A?F.right=b:F.left=b}w[T-1]=b,w[T]=A,T+1=0;--b){var A=w[b];A.left===w[b+1]?k[b]=new u(A._color,A.key,A.value,k[b+1],A.right,A._count):k[b]=new u(A._color,A.key,A.value,A.left,k[b+1],A._count)}if(A=k[k.length-1],A.left&&A.right){var E=k.length;for(A=A.left;A.right;)k.push(A),A=A.right;var T=k[E-1];k.push(new u(A._color,T.key,T.value,A.left,A.right,A._count)),k[E-1].key=A.key,k[E-1].value=A.value;for(var b=k.length-2;b>=E;--b)A=k[b],k[b]=new u(A._color,A.key,A.value,A.left,k[b+1],A._count);k[E-1].left=k[E]}if(A=k[k.length-1],A._color===l){var F=k[k.length-2];F.left===A?F.left=null:F.right===A&&(F.right=null),k.pop();for(var b=0;b0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(v,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(v,"index",{get:function(){var w=0,k=this._stack;if(k.length===0){var A=this.tree.root;return A?A._count:0}else k[k.length-1].left&&(w=k[k.length-1].left._count);for(var b=k.length-2;b>=0;--b)k[b+1]===k[b].right&&(++w,k[b].left&&(w+=k[b].left._count));return w},enumerable:!0}),v.next=function(){var w=this._stack;if(w.length!==0){var k=w[w.length-1];if(k.right)for(k=k.right;k;)w.push(k),k=k.left;else for(w.pop();w.length>0&&w[w.length-1].right===k;)k=w[w.length-1],w.pop()}},Object.defineProperty(v,"hasNext",{get:function(){var w=this._stack;if(w.length===0)return!1;if(w[w.length-1].right)return!0;for(var k=w.length-1;k>0;--k)if(w[k-1].left===w[k])return!0;return!1}}),v.update=function(w){var k=this._stack;if(k.length===0)throw new Error("Can't update empty node!");var A=new Array(k.length),b=k[k.length-1];A[A.length-1]=new u(b._color,b.key,w,b.left,b.right,b._count);for(var E=k.length-2;E>=0;--E)b=k[E],b.left===k[E+1]?A[E]=new u(b._color,b.key,b.value,A[E+1],b.right,b._count):A[E]=new u(b._color,b.key,b.value,b.left,A[E+1],b._count);return new d(this.tree._compare,A[0])},v.prev=function(){var w=this._stack;if(w.length!==0){var k=w[w.length-1];if(k.left)for(k=k.left;k;)w.push(k),k=k.right;else for(w.pop();w.length>0&&w[w.length-1].left===k;)k=w[w.length-1],w.pop()}},Object.defineProperty(v,"hasPrev",{get:function(){var w=this._stack;if(w.length===0)return!1;if(w[w.length-1].left)return!0;for(var k=w.length-1;k>0;--k)if(w[k-1].right===w[k])return!0;return!1}});function M(w,k){return wk?1:0}function C(w){return new d(w||M,null)}},3837(s,l,n){"use strict";s.exports=D;var u=n(4935),c=n(501),f=n(5304),h=n(6429),d=n(6444),p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),g=ArrayBuffer,m=DataView;function y(R){return g.isView(R)&&!(R instanceof m)}function _(R){return Array.isArray(R)||y(R)}function v(R,P){return R[0]=P[0],R[1]=P[1],R[2]=P[2],R}function x(R){this.gl=R,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=f(R)}var S=x.prototype;S.update=function(R){R=R||{};function P(U,V,j){if(j in R){var q=R[j],Y=this[j],K;(U?_(q)&&_(q[0]):_(q))?this[j]=K=[V(q[0]),V(q[1]),V(q[2])]:this[j]=K=[V(q),V(q),V(q)];for(var te=0;te<3;++te)if(K[te]!==Y[te])return!0}return!1}var z=P.bind(this,!1,Number),I=P.bind(this,!1,Boolean),L=P.bind(this,!1,String),B=P.bind(this,!0,function(U){if(_(U)){if(U.length===3)return[+U[0],+U[1],+U[2],1];if(U.length===4)return[+U[0],+U[1],+U[2],+U[3]]}return[0,0,0,1]}),O,G=!1,W=!1;if("bounds"in R)for(var X=R.bounds,Z=0;Z<2;++Z)for(var J=0;J<3;++J)X[Z][J]!==this.bounds[Z][J]&&(W=!0),this.bounds[Z][J]=X[Z][J];if("ticks"in R){O=R.ticks,G=!0,this.autoTicks=!1;for(var Z=0;Z<3;++Z)this.tickSpacing[Z]=0}else z("tickSpacing")&&(this.autoTicks=!0,W=!0);if(this._firstInit&&("ticks"in R||"tickSpacing"in R||(this.autoTicks=!0),W=!0,G=!0,this._firstInit=!1),W&&this.autoTicks&&(O=d.create(this.bounds,this.tickSpacing),G=!0),G){for(var Z=0;Z<3;++Z)O[Z].sort(function(V,j){return V.x-j.x});d.equal(O,this.ticks)?G=!1:this.ticks=O}I("tickEnable"),L("tickFont")&&(G=!0),L("tickFontStyle")&&(G=!0),L("tickFontWeight")&&(G=!0),L("tickFontVariant")&&(G=!0),z("tickSize"),z("tickAngle"),z("tickPad"),B("tickColor");var N=L("labels");L("labelFont")&&(N=!0),L("labelFontStyle")&&(N=!0),L("labelFontWeight")&&(N=!0),L("labelFontVariant")&&(N=!0),I("labelEnable"),z("labelSize"),z("labelPad"),B("labelColor"),I("lineEnable"),I("lineMirror"),z("lineWidth"),B("lineColor"),I("lineTickEnable"),I("lineTickMirror"),z("lineTickLength"),z("lineTickWidth"),B("lineTickColor"),I("gridEnable"),z("gridWidth"),B("gridColor"),I("zeroEnable"),B("zeroLineColor"),z("zeroLineWidth"),I("backgroundEnable"),B("backgroundColor");var H=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],$=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(N||G)&&this._text.update(this.bounds,this.labels,H,this.ticks,$):this._text=u(this.gl,this.bounds,this.labels,H,this.ticks,$),this._lines&&G&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=c(this.gl,this.bounds,this.ticks))};function M(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var C=[new M,new M,new M];function w(R,P,z,I,L){for(var B=R.primalOffset,O=R.primalMinor,G=R.mirrorOffset,W=R.mirrorMinor,X=I[P],Z=0;Z<3;++Z)if(P!==Z){var J=B,N=G,H=O,$=W;X&1<0?(H[Z]=-1,$[Z]=0):(H[Z]=0,$[Z]=1)}}var k=[0,0,0],A={model:p,view:p,projection:p,_ortho:!1};S.isOpaque=function(){return!0},S.isTransparent=function(){return!1},S.drawTransparent=function(R){};var b=0,E=[0,0,0],T=[0,0,0],F=[0,0,0];S.draw=function(R){R=R||A;for(var j=this.gl,P=R.model||p,z=R.view||p,I=R.projection||p,L=this.bounds,B=R._ortho||!1,O=h(P,z,I,L,B),G=O.cubeEdges,W=O.axis,X=z[12],Z=z[13],J=z[14],N=z[15],H=B?2:1,$=H*this.pixelRatio*(I[3]*X+I[7]*Z+I[11]*J+I[15]*N)/j.drawingBufferHeight,U=0;U<3;++U)this.lastCubeProps.cubeEdges[U]=G[U],this.lastCubeProps.axis[U]=W[U];for(var V=C,U=0;U<3;++U)w(C[U],U,this.bounds,G,W);for(var j=this.gl,q=k,U=0;U<3;++U)this.backgroundEnable[U]?q[U]=W[U]:q[U]=0;this._background.draw(P,z,I,L,q,this.backgroundColor),this._lines.bind(P,z,I,this);for(var U=0;U<3;++U){var Y=[0,0,0];W[U]>0?Y[U]=L[1][U]:Y[U]=L[0][U];for(var K=0;K<2;++K){var te=(U+1+K)%3,ne=(U+1+(K^1))%3;this.gridEnable[te]&&this._lines.drawGrid(te,ne,this.bounds,Y,this.gridColor[te],this.gridWidth[te]*this.pixelRatio)}for(var K=0;K<2;++K){var te=(U+1+K)%3,ne=(U+1+(K^1))%3;this.zeroEnable[ne]&&Math.min(L[0][ne],L[1][ne])<=0&&Math.max(L[0][ne],L[1][ne])>=0&&this._lines.drawZero(te,ne,this.bounds,Y,this.zeroLineColor[ne],this.zeroLineWidth[ne]*this.pixelRatio)}}for(var U=0;U<3;++U){this.lineEnable[U]&&this._lines.drawAxisLine(U,this.bounds,V[U].primalOffset,this.lineColor[U],this.lineWidth[U]*this.pixelRatio),this.lineMirror[U]&&this._lines.drawAxisLine(U,this.bounds,V[U].mirrorOffset,this.lineColor[U],this.lineWidth[U]*this.pixelRatio);for(var se=v(E,V[U].primalMinor),le=v(T,V[U].mirrorMinor),ce=this.lineTickLength,K=0;K<3;++K){var pe=$/P[5*K];se[K]*=ce[K]*pe,le[K]*=ce[K]*pe}this.lineTickEnable[U]&&this._lines.drawAxisTicks(U,V[U].primalOffset,se,this.lineTickColor[U],this.lineTickWidth[U]*this.pixelRatio),this.lineTickMirror[U]&&this._lines.drawAxisTicks(U,V[U].mirrorOffset,le,this.lineTickColor[U],this.lineTickWidth[U]*this.pixelRatio)}this._lines.unbind(),this._text.bind(P,z,I,this.pixelRatio);var xe,ye=.5,fe,ae;function ee(Te){ae=[0,0,0],ae[Te]=1}function ie(Te,je,Ve){var Ze=(Te+1)%3,Ke=(Te+2)%3,vt=je[Ze],xt=je[Ke],Pt=Ve[Ze],mt=Ve[Ke];if(vt>0&&mt>0){ee(Ze);return}else if(vt>0&&mt<0){ee(Ze);return}else if(vt<0&&mt>0){ee(Ze);return}else if(vt<0&&mt<0){ee(Ze);return}else if(xt>0&&Pt>0){ee(Ke);return}else if(xt>0&&Pt<0){ee(Ke);return}else if(xt<0&&Pt>0){ee(Ke);return}else if(xt<0&&Pt<0){ee(Ke);return}}for(var U=0;U<3;++U){for(var Q=V[U].primalMinor,ue=V[U].mirrorMinor,ge=v(F,V[U].primalOffset),K=0;K<3;++K)this.lineTickEnable[U]&&(ge[K]+=$*Q[K]*Math.max(this.lineTickLength[K],0)/P[5*K]);var Me=[0,0,0];if(Me[U]=1,this.tickEnable[U]){this.tickAngle[U]===-3600?(this.tickAngle[U]=0,this.tickAlign[U]="auto"):this.tickAlign[U]=-1,fe=1,xe=[this.tickAlign[U],ye,fe],xe[0]==="auto"?xe[0]=b:xe[0]=parseInt(""+xe[0]),ae=[0,0,0],ie(U,Q,ue);for(var K=0;K<3;++K)ge[K]+=$*Q[K]*this.tickPad[K]/P[5*K];this._text.drawTicks(U,this.tickSize[U],this.tickAngle[U],ge,this.tickColor[U],Me,ae,xe)}if(this.labelEnable[U]){fe=0,ae=[0,0,0],this.labels[U].length>4&&(ee(U),fe=1),xe=[this.labelAlign[U],ye,fe],xe[0]==="auto"?xe[0]=b:xe[0]=parseInt(""+xe[0]);for(var K=0;K<3;++K)ge[K]+=$*Q[K]*this.labelPad[K]/P[5*K];ge[U]+=.5*(L[0][U]+L[1][U]),this._text.drawLabel(U,this.labelSize[U],this.labelAngle[U],ge,this.labelColor[U],[0,0,0],ae,xe)}}this._text.unbind()},S.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function D(R,P){var z=new x(R);return z.update(P),z}},5304(s,l,n){"use strict";s.exports=p;var u=n(2762),c=n(8116),f=n(1879).bg;function h(g,m,y,_){this.gl=g,this.buffer=m,this.vao=y,this.shader=_}var d=h.prototype;d.draw=function(g,m,y,_,v,x){for(var S=!1,M=0;M<3;++M)S=S||v[M];if(S){var C=this.gl;C.enable(C.POLYGON_OFFSET_FILL),C.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:g,view:m,projection:y,bounds:_,enable:v,colors:x},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),C.disable(C.POLYGON_OFFSET_FILL)}},d.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function p(g){for(var m=[],y=[],_=0,v=0;v<3;++v)for(var x=(v+1)%3,S=(v+2)%3,M=[0,0,0],C=[0,0,0],w=-1;w<=1;w+=2){y.push(_,_+2,_+1,_+1,_+2,_+3),M[v]=w,C[v]=w;for(var k=-1;k<=1;k+=2){M[x]=k;for(var A=-1;A<=1;A+=2)M[S]=A,m.push(M[0],M[1],M[2],C[0],C[1],C[2]),_+=1}var b=x;x=S,S=b}var E=u(g,new Float32Array(m)),T=u(g,new Uint16Array(y),g.ELEMENT_ARRAY_BUFFER),F=c(g,[{buffer:E,type:g.FLOAT,size:3,offset:0,stride:24},{buffer:E,type:g.FLOAT,size:3,offset:12,stride:24}],T),D=f(g);return D.attributes.position.location=0,D.attributes.normal.location=1,new h(g,E,F,D)}},6429(s,l,n){"use strict";s.exports=w;var u=n(8828),c=n(6760),f=n(5202),h=n(3250),d=new Array(16),p=new Array(8),g=new Array(8),m=new Array(3),y=[0,0,0];(function(){for(var k=0;k<8;++k)p[k]=[1,1,1,1],g[k]=[1,1,1]})();function _(k,A,b){for(var E=0;E<4;++E){k[E]=b[12+E];for(var T=0;T<3;++T)k[E]+=A[T]*b[4*T+E]}}var v=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function x(k){for(var A=0;AW&&(z|=1<W){z|=1<g[D][1])&&(V=D);for(var j=-1,D=0;D<3;++D){var q=V^1<g[Y][0]&&(Y=q)}}var K=S;K[0]=K[1]=K[2]=0,K[u.log2(j^V)]=V&j,K[u.log2(V^Y)]=V&Y;var te=Y^7;te===z||te===U?(te=j^7,K[u.log2(Y^te)]=te&Y):K[u.log2(j^te)]=te&j;for(var ne=M,se=z,B=0;B<3;++B)se&1<>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?Qy(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?Qy(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=GC.exec(e))?new Su(r[1],r[2],r[3],1):(r=HC.exec(e))?new Su(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=$C.exec(e))?Qy(r[1],r[2],r[3],r[4]):(r=WC.exec(e))?Qy(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=YC.exec(e))?jC(r[1],r[2]/100,r[3]/100,1):(r=XC.exec(e))?jC(r[1],r[2]/100,r[3]/100,r[4]):U3.hasOwnProperty(e)?BC(U3[e]):e==="transparent"?new Su(NaN,NaN,NaN,0):null}function BC(e){return new Su(e>>16&255,e>>8&255,e&255,1)}function Qy(e,r,t,i){return i<=0&&(e=r=t=NaN),new Su(e,r,t,i)}function O3(e){return e instanceof kp||(e=D1(e)),e?(e=e.rgb(),new Su(e.r,e.g,e.b,e.opacity)):new Su}function e_(e,r,t,i){return arguments.length===1?O3(e):new Su(e,r,t,i??1)}function Su(e,r,t,i){this.r=+e,this.g=+r,this.b=+t,this.opacity=+i}function OC(){return`#${b0(this.r)}${b0(this.g)}${b0(this.b)}`}function X$(){return`#${b0(this.r)}${b0(this.g)}${b0(this.b)}${b0((isNaN(this.opacity)?1:this.opacity)*255)}`}function NC(){let e=t_(this.opacity);return`${e===1?"rgb(":"rgba("}${x0(this.r)}, ${x0(this.g)}, ${x0(this.b)}${e===1?")":`, ${e})`}`}function t_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function x0(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function b0(e){return e=x0(e),(e<16?"0":"")+e.toString(16)}function jC(e,r,t,i){return i<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new Gh(e,r,t,i)}function UC(e){if(e instanceof Gh)return new Gh(e.h,e.s,e.l,e.opacity);if(e instanceof kp||(e=D1(e)),!e)return new Gh;if(e instanceof Gh)return e;e=e.rgb();var r=e.r/255,t=e.g/255,i=e.b/255,a=Math.min(r,t,i),o=Math.max(r,t,i),s=NaN,l=o-a,n=(o+a)/2;return l?(r===o?s=(t-i)/l+(t0&&n<1?0:s,new Gh(s,l,n,e.opacity)}function N3(e,r,t,i){return arguments.length===1?UC(e):new Gh(e,r,t,i??1)}function Gh(e,r,t,i){this.h=+e,this.s=+r,this.l=+t,this.opacity=+i}function qC(e){return e=(e||0)%360,e<0?e+360:e}function r_(e){return Math.max(0,Math.min(1,e||0))}function j3(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}var Cp,w0,T0,Bv,Hh,VC,GC,HC,$C,WC,YC,XC,U3,q3=Ir({"node_modules/d3-color/src/color.js"(){B3(),Cp=.7,w0=1/Cp,T0="\\s*([+-]?\\d+)\\s*",Bv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",VC=/^#([0-9a-f]{3,8})$/,GC=new RegExp(`^rgb\\(${T0},${T0},${T0}\\)$`),HC=new RegExp(`^rgb\\(${Hh},${Hh},${Hh}\\)$`),$C=new RegExp(`^rgba\\(${T0},${T0},${T0},${Bv}\\)$`),WC=new RegExp(`^rgba\\(${Hh},${Hh},${Hh},${Bv}\\)$`),YC=new RegExp(`^hsl\\(${Bv},${Hh},${Hh}\\)$`),XC=new RegExp(`^hsla\\(${Bv},${Hh},${Hh},${Bv}\\)$`),U3={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},zv(kp,D1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:RC,formatHex:RC,formatHex8:W$,formatHsl:Y$,formatRgb:zC,toString:zC}),zv(Su,e_,C1(kp,{brighter(e){return e=e==null?w0:Math.pow(w0,e),new Su(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cp:Math.pow(Cp,e),new Su(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Su(x0(this.r),x0(this.g),x0(this.b),t_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:OC,formatHex:OC,formatHex8:X$,formatRgb:NC,toString:NC})),zv(Gh,N3,C1(kp,{brighter(e){return e=e==null?w0:Math.pow(w0,e),new Gh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cp:Math.pow(Cp,e),new Gh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*r,a=2*t-i;return new Su(j3(e>=240?e-240:e+120,a,i),j3(e,a,i),j3(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new Gh(qC(this.h),r_(this.s),r_(this.l),t_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=t_(this.opacity);return`${e===1?"hsl(":"hsla("}${qC(this.h)}, ${r_(this.s)*100}%, ${r_(this.l)*100}%${e===1?")":`, ${e})`}`}}))}}),V3,G3,ZC=Ir({"node_modules/d3-color/src/math.js"(){V3=Math.PI/180,G3=180/Math.PI}});function KC(e){if(e instanceof wd)return new wd(e.l,e.a,e.b,e.opacity);if(e instanceof rp)return JC(e);e instanceof Su||(e=O3(e));var r=X3(e.r),t=X3(e.g),i=X3(e.b),a=$3((.2225045*r+.7168786*t+.0606169*i)/J3),o,s;return r===t&&t===i?o=s=a:(o=$3((.4360747*r+.3850649*t+.1430804*i)/K3),s=$3((.0139322*r+.0971045*t+.7141733*i)/Q3)),new wd(116*a-16,500*(o-a),200*(a-s),e.opacity)}function H3(e,r,t,i){return arguments.length===1?KC(e):new wd(e,r,t,i??1)}function wd(e,r,t,i){this.l=+e,this.a=+r,this.b=+t,this.opacity=+i}function $3(e){return e>QC?Math.pow(e,.3333333333333333):e/t4+e4}function W3(e){return e>A0?e*e*e:t4*(e-e4)}function Y3(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055)}function X3(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Z$(e){if(e instanceof rp)return new rp(e.h,e.c,e.l,e.opacity);if(e instanceof wd||(e=KC(e)),e.a===0&&e.b===0)return new rp(NaN,0=1?(t=1,r-1):Math.floor(t*r),a=e[i],o=e[i+1],s=i>0?e[i-1]:2*a-o,l=i()=>e}});function nD(e,r){return function(t){return e+t*r}}function eW(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(i){return Math.pow(e+i*r,t)}}function n_(e,r){var t=r-e;return t?nD(e,t>180||t<-180?t-360*Math.round(t/360):t):P1(isNaN(e)?r:e)}function tW(e){return(e=+e)==1?Eu:function(r,t){return t-r?eW(r,t,e):P1(isNaN(r)?t:r)}}function Eu(e,r){var t=r-e;return t?nD(e,t):P1(isNaN(e)?r:e)}var jv=Ir({"node_modules/d3-interpolate/src/color.js"(){aD()}});function oD(e){return function(r){var t=r.length,i=new Array(t),a=new Array(t),o=new Array(t),s,l;for(s=0;st&&(o=r.slice(t,o),l[s]?l[s]+=o:l[++s]=o),(i=i[0])===(a=a[0])?l[s]?l[s]+=a:l[++s]=a:(l[++s]=null,n.push({i:s,x:Td(i,a)})),t=u_.lastIndex;return t180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(a(f)+"rotate(",null,i)-2,x:Td(u,c)})):c&&f.push(a(f)+"rotate("+c+i)}function l(u,c,f,h){u!==c?h.push({i:f.push(a(f)+"skewX(",null,i)-2,x:Td(u,c)}):c&&f.push(a(f)+"skewX("+c+i)}function n(u,c,f,h,d,p){if(u!==f||c!==h){var g=d.push(a(d)+"scale(",null,",",null,")");p.push({i:g-4,x:Td(u,f)},{i:g-2,x:Td(c,h)})}else(f!==1||h!==1)&&d.push(a(d)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,h),s(u.rotate,c.rotate,f,h),l(u.skewX,c.skewX,f,h),n(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(d){for(var p=-1,g=h.length,m;++pc_,interpolateArray:()=>rW,interpolateBasis:()=>tD,interpolateBasisClosed:()=>rD,interpolateCubehelix:()=>PD,interpolateCubehelixLong:()=>ID,interpolateDate:()=>dD,interpolateDiscrete:()=>nW,interpolateHcl:()=>DD,interpolateHclLong:()=>LD,interpolateHsl:()=>ED,interpolateHslLong:()=>kD,interpolateHue:()=>sW,interpolateLab:()=>xW,interpolateNumber:()=>Td,interpolateNumberArray:()=>l4,interpolateObject:()=>vD,interpolateRgb:()=>o_,interpolateRgbBasis:()=>sD,interpolateRgbBasisClosed:()=>lD,interpolateRound:()=>uW,interpolateString:()=>gD,interpolateTransformCss:()=>bD,interpolateTransformSvg:()=>wD,interpolateZoom:()=>MD,piecewise:()=>AW,quantize:()=>SW});var Uv=Ir({"node_modules/d3-interpolate/src/index.js"(){f_(),hD(),s4(),iD(),pD(),oW(),lW(),s_(),u4(),mD(),cW(),yD(),vW(),yW(),uD(),_W(),bW(),wW(),TW(),MW(),EW()}}),f4=de({"src/traces/sunburst/fill_one.js"(e,r){"use strict";var t=hn(),i=ta();r.exports=function(o,s,l,n,u){var c=s.data.data,f=c.i,h=u||c.color;if(f>=0){s.i=c.i;var d=l.marker;d.pattern?(!d.colors||!d.pattern.shape)&&(d.color=h,s.color=h):(d.color=h,s.color=h),t.pointStyle(o,l,n,s)}else i.fill(o,h)}}}),RD=de({"src/traces/sunburst/style.js"(e,r){"use strict";var t=Yr(),i=ta(),a=Qt(),o=dc().resizeText,s=f4();function l(u){var c=u._fullLayout._sunburstlayer.selectAll(".trace");o(u,c,"sunburst"),c.each(function(f){var h=t.select(this),d=f[0],p=d.trace;h.style("opacity",p.opacity),h.selectAll("path.surface").each(function(g){t.select(this).call(n,g,p,u)})})}function n(u,c,f,h){var d=c.data.data,p=!c.children,g=d.i,m=a.castOption(f,g,"marker.line.color")||i.defaultLine,y=a.castOption(f,g,"marker.line.width")||0;u.call(s,c,f,h).style("stroke-width",y).call(i.stroke,m).style("opacity",p?f.leaf.opacity:null)}r.exports={style:l,styleOne:n}}}),Dp=de({"src/traces/sunburst/helpers.js"(e){"use strict";var r=Qt(),t=ta(),i=gd(),a=v0();e.findEntryWithLevel=function(n,u){var c;return u&&n.eachAfter(function(f){if(e.getPtId(f)===u)return c=f.copy()}),c||n},e.findEntryWithChild=function(n,u){var c;return n.eachAfter(function(f){for(var h=f.children||[],d=0;d0)},e.getMaxDepth=function(n){return n.maxdepth>=0?n.maxdepth:1/0},e.isHeader=function(n,u){return!(e.isLeaf(n)||n.depth===u._maxDepth-1)};function l(n){return n.data.data.pid}e.getParent=function(n,u){return e.findEntryWithLevel(n,l(u))},e.listPath=function(n,u){var c=n.parent;if(!c)return[];var f=u?[c.data[u]]:[c];return e.listPath(c,u).concat(f)},e.getPath=function(n){return e.listPath(n,"label").join("/")+"/"},e.formatValue=a.formatPieValue,e.formatPercent=function(n,u){var c=r.formatPercent(n,0);return c==="0%"&&(c=a.formatPiePercent(n,u)),c}}}),p_=de({"src/traces/sunburst/fx.js"(e,r){"use strict";var t=Yr(),i=Sa(),a=sf().appendArrayPointValue,o=$s(),s=Qt(),l=c1(),n=Dp(),u=v0(),c=u.formatPieValue;r.exports=function(d,p,g,m,y){var _=m[0],v=_.trace,x=_.hierarchy,S=v.type==="sunburst",M=v.type==="treemap"||v.type==="icicle";"_hasHoverLabel"in v||(v._hasHoverLabel=!1),"_hasHoverEvent"in v||(v._hasHoverEvent=!1);var C=function(A){var b=g._fullLayout;if(!(g._dragging||b.hovermode===!1)){var E=g._fullData[v.index],T=A.data.data,F=T.i,D=n.isHierarchyRoot(A),R=n.getParent(x,A),P=n.getValue(A),z=function(Y){return s.castOption(E,F,Y)},I=z("hovertemplate"),L=o.castHoverinfo(E,b,F),B=b.separators,O;if(I||L&&L!=="none"&&L!=="skip"){var G,W;S&&(G=_.cx+A.pxmid[0]*(1-A.rInscribed),W=_.cy+A.pxmid[1]*(1-A.rInscribed)),M&&(G=A._hoverX,W=A._hoverY);var X={},Z=[],J=[],N=function(Y){return Z.indexOf(Y)!==-1};L&&(Z=L==="all"?E._module.attributes.hoverinfo.flags:L.split("+")),X.label=T.label,N("label")&&X.label&&J.push(X.label),T.hasOwnProperty("v")&&(X.value=T.v,X.valueLabel=c(X.value,B),N("value")&&J.push(X.valueLabel)),X.currentPath=A.currentPath=n.getPath(A.data),N("current path")&&!D&&J.push(X.currentPath);var H,$=[],U=function(){$.indexOf(H)===-1&&(J.push(H),$.push(H))};X.percentParent=A.percentParent=P/n.getValue(R),X.parent=A.parentString=n.getPtLabel(R),N("percent parent")&&(H=n.formatPercent(X.percentParent,B)+" of "+X.parent,U()),X.percentEntry=A.percentEntry=P/n.getValue(p),X.entry=A.entry=n.getPtLabel(p),N("percent entry")&&!D&&!A.onPathbar&&(H=n.formatPercent(X.percentEntry,B)+" of "+X.entry,U()),X.percentRoot=A.percentRoot=P/n.getValue(x),X.root=A.root=n.getPtLabel(x),N("percent root")&&!D&&(H=n.formatPercent(X.percentRoot,B)+" of "+X.root,U()),X.text=z("hovertext")||z("text"),N("text")&&(H=X.text,s.isValidTextValue(H)&&J.push(H)),O=[f(A,E,y.eventDataKeys)];var V={trace:E,y:W,_x0:A._x0,_x1:A._x1,_y0:A._y0,_y1:A._y1,text:J.join("
"),name:I||N("name")?E.name:void 0,color:z("hoverlabel.bgcolor")||T.color,borderColor:z("hoverlabel.bordercolor"),fontFamily:z("hoverlabel.font.family"),fontSize:z("hoverlabel.font.size"),fontColor:z("hoverlabel.font.color"),fontWeight:z("hoverlabel.font.weight"),fontStyle:z("hoverlabel.font.style"),fontVariant:z("hoverlabel.font.variant"),nameLength:z("hoverlabel.namelength"),textAlign:z("hoverlabel.align"),hovertemplate:I,hovertemplateLabels:X,eventData:O};S&&(V.x0=G-A.rInscribed*A.rpx1,V.x1=G+A.rInscribed*A.rpx1,V.idealAlign=A.pxmid[0]<0?"left":"right"),M&&(V.x=G,V.idealAlign=G<0?"left":"right");var j=[];o.loneHover(V,{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:g,inOut_bbox:j}),O[0].bbox=j[0],v._hasHoverLabel=!0}if(M){var q=d.select("path.surface");y.styleOne(q,A,E,g,{hovered:!0})}v._hasHoverEvent=!0,g.emit("plotly_hover",{points:O||[f(A,E,y.eventDataKeys)],event:t.event})}},w=function(A){var b=g._fullLayout,E=g._fullData[v.index],T=t.select(this).datum();if(v._hasHoverEvent&&(A.originalEvent=t.event,g.emit("plotly_unhover",{points:[f(T,E,y.eventDataKeys)],event:t.event}),v._hasHoverEvent=!1),v._hasHoverLabel&&(o.loneUnhover(b._hoverlayer.node()),v._hasHoverLabel=!1),M){var F=d.select("path.surface");y.styleOne(F,T,E,g,{hovered:!1})}},k=function(A){var b=g._fullLayout,E=g._fullData[v.index],T=S&&(n.isHierarchyRoot(A)||n.isLeaf(A)),F=n.getPtId(A),D=n.isEntry(A)?n.findEntryWithChild(x,F):n.findEntryWithLevel(x,F),R=n.getPtId(D),P={points:[f(A,E,y.eventDataKeys)],event:t.event};T||(P.nextLevel=R);var z=l.triggerHandler(g,"plotly_"+v.type+"click",P);if(z!==!1&&b.hovermode&&(g._hoverdata=[f(A,E,y.eventDataKeys)],o.click(g,t.event)),!T&&z!==!1&&!g._dragging&&!g._transitioning){i.call("_storeDirectGUIEdit",E,b._tracePreGUI[E.uid],{level:E.level});var I={data:[{level:R}],traces:[v.index]},L={frame:{redraw:!1,duration:y.transitionTime},transition:{duration:y.transitionTime,easing:y.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(b._hoverlayer.node()),i.call("animate",g,I,L)}};d.on("mouseover",C),d.on("mouseout",w),d.on("click",k)};function f(h,d,p){for(var g=h.data.data,m={curveNumber:d.index,pointNumber:g.i,data:d._input,fullData:d},y=0;yMe.x1?2*Math.PI:0)+Y;Te=Q.rpx1pe?2*Math.PI:0)+Y;ge={x0:Te,x1:Te}}else ge={rpx0:Z,rpx1:Z},o.extendFlat(ge,ie(Q));else ge={rpx0:0,rpx1:0};else ge={x0:Y,x1:Y};return i(ge,Me)}function ee(Q){var ue=$[_.getPtId(Q)],ge,Me=Q.transform;if(ue)ge=ue;else if(ge={rpx1:Q.rpx1,transform:{textPosAngle:Me.textPosAngle,scale:0,rotate:Me.rotate,rCenter:Me.rCenter,x:Me.x,y:Me.y}},H)if(Q.parent)if(pe){var Te=Q.x1>pe?2*Math.PI:0;ge.x0=ge.x1=Te}else o.extendFlat(ge,ie(Q));else ge.x0=ge.x1=Y;else ge.x0=ge.x1=Y;var je=i(ge.transform.textPosAngle,Q.transform.textPosAngle),Ve=i(ge.rpx1,Q.rpx1),Ke=i(ge.x0,Q.x0),Je=i(ge.x1,Q.x1),vt=i(ge.transform.scale,Me.scale),xt=i(ge.transform.rotate,Me.rotate),Pt=Me.rCenter===0?3:ge.transform.rCenter===0?1/3:1,mt=i(ge.transform.rCenter,Me.rCenter),Mt=function(lt){return mt(Math.pow(lt,Pt))};return function(lt){var qe=Ve(lt),Ye=Ke(lt),me=Je(lt),_e=Mt(lt),Ae=ne(qe,(Ye+me)/2),ke=je(lt),Ee={pxmid:Ae,rpx1:qe,transform:{textPosAngle:ke,rCenter:_e,x:Me.x,y:Me.y}};return n(z.type,Me,T),{transform:{targetX:le(Ee),targetY:ce(Ee),scale:vt(lt),rotate:xt(lt),rCenter:_e}}}}function ie(Q){var ue=Q.parent,ge=$[_.getPtId(ue)],Me={};if(ge){var Te=ue.children,je=Te.indexOf(Q),Ve=Te.length,Ke=i(ge.x0,ge.x1);Me.x0=Ke(je/Ve),Me.x1=Ke(je/Ve)}else Me.x0=Me.x1=0;return Me}}function x(w){return t.partition().size([2*Math.PI,w.height+1])(w)}e.formatSliceLabel=function(w,k,A,b,E){var T=A.texttemplate,F=A.textinfo;if(!T&&(!F||F==="none"))return"";var D=E.separators,R=b[0],P=w.data.data,z=R.hierarchy,I=_.isHierarchyRoot(w),L=_.getParent(z,w),B=_.getValue(w);if(!T){var O=F.split("+"),G=function(j){return O.indexOf(j)!==-1},W=[],X;if(G("label")&&P.label&&W.push(P.label),P.hasOwnProperty("v")&&G("value")&&W.push(_.formatValue(P.v,D)),!I){G("current path")&&W.push(_.getPath(w.data));var Z=0;G("percent parent")&&Z++,G("percent entry")&&Z++,G("percent root")&&Z++;var J=Z>1;if(Z){var N,H=function(j){X=_.formatPercent(N,D),J&&(X+=" of "+j),W.push(X)};G("percent parent")&&!I&&(N=B/_.getValue(L),H("parent")),G("percent entry")&&(N=B/_.getValue(k),H("entry")),G("percent root")&&(N=B/_.getValue(z),H("root"))}}return G("text")&&(X=o.castOption(A,P.i,"text"),o.isValidTextValue(X)&&W.push(X)),W.join("
")}var $=o.castOption(A,P.i,"texttemplate");if(!$)return"";var U={};P.label&&(U.label=P.label),P.hasOwnProperty("v")&&(U.value=P.v,U.valueLabel=_.formatValue(P.v,D)),U.currentPath=_.getPath(w.data),I||(U.percentParent=B/_.getValue(L),U.percentParentLabel=_.formatPercent(U.percentParent,D),U.parent=_.getPtLabel(L)),U.percentEntry=B/_.getValue(k),U.percentEntryLabel=_.formatPercent(U.percentEntry,D),U.entry=_.getPtLabel(k),U.percentRoot=B/_.getValue(z),U.percentRootLabel=_.formatPercent(U.percentRoot,D),U.root=_.getPtLabel(z),P.hasOwnProperty("color")&&(U.color=P.color);var V=o.castOption(A,P.i,"text");return(o.isValidTextValue(V)||V==="")&&(U.text=V),U.customdata=o.castOption(A,P.i,"customdata"),o.texttemplateString({data:[U,A._meta],fallback:A.texttemplatefallback,labels:U,locale:E._d3locale,template:$})};function S(w){return w.rpx0===0&&o.isFullCircle([w.x0,w.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(w.halfangle)),w.ring/2))}function M(w){return C(w.rpx1,w.transform.textPosAngle)}function C(w,k){return[w*Math.sin(k),-w*Math.cos(k)]}}}),kW=de({"src/traces/sunburst/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"sunburst",basePlotModule:G$(),categories:[],animatable:!0,attributes:Zy(),layoutAttributes:IC(),supplyDefaults:H$(),supplyLayoutDefaults:$$(),calc:Jy().calc,crossTraceCalc:Jy().crossTraceCalc,plot:h4().plot,style:RD().style,colorbar:Yu(),meta:{}}}}),CW=de({"lib/sunburst.js"(e,r){"use strict";r.exports=kW()}}),DW=de({"src/traces/treemap/base_plot.js"(e){"use strict";var r=ks();e.name="treemap",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),qv=de({"src/traces/treemap/constants.js"(e,r){"use strict";r.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),d4=de({"src/traces/treemap/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,texttemplateAttrs:i,templatefallbackAttrs:a}=Vo(),o=cs(),s=Rs().attributes,l=Iv(),n=Zy(),u=qv(),c=fn().extendFlat,f=fu().pattern;r.exports={labels:n.labels,parents:n.parents,values:n.values,branchvalues:n.branchvalues,count:n.count,level:n.level,maxdepth:n.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:c({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:n.marker.colors,pattern:f,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:n.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},l.textfont,{}),editType:"calc"},text:l.text,textinfo:n.textinfo,texttemplate:i({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),hovertext:l.hovertext,hoverinfo:n.hoverinfo,hovertemplate:t({},{keys:u.eventDataKeys}),hovertemplatefallback:a(),textfont:l.textfont,insidetextfont:l.insidetextfont,outsidetextfont:c({},l.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:l.sort,root:n.root,domain:s({name:"treemap",trace:!0,editType:"calc"})}}}),zD=de({"src/traces/treemap/layout_attributes.js"(e,r){"use strict";r.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),LW=de({"src/traces/treemap/defaults.js"(e,r){"use strict";var t=Qt(),i=d4(),a=ta(),o=Rs().defaults,s=sh().handleText,l=_0().TEXTPAD,n=Rv().handleMarkerDefaults,u=Cs(),c=u.hasColorscale,f=u.handleDefaults;r.exports=function(d,p,g,m){function y(E,T){return t.coerce(d,p,i,E,T)}var _=y("labels"),v=y("parents");if(!_||!_.length||!v||!v.length){p.visible=!1;return}var x=y("values");x&&x.length?y("branchvalues"):y("count"),y("level"),y("maxdepth");var S=y("tiling.packing");S==="squarify"&&y("tiling.squarifyratio"),y("tiling.flip"),y("tiling.pad");var M=y("text");y("texttemplate"),y("texttemplatefallback"),p.texttemplate||y("textinfo",t.isArrayOrTypedArray(M)?"text+label":"label"),y("hovertext"),y("hovertemplate"),y("hovertemplatefallback");var C=y("pathbar.visible"),w="auto";s(d,p,m,y,w,{hasPathbar:C,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),y("textposition");var k=p.textposition.indexOf("bottom")!==-1;n(d,p,m,y);var A=p._hasColorscale=c(d,"marker","colors")||(d.marker||{}).coloraxis;A?f(d,p,m,y,{prefix:"marker.",cLetter:"c"}):y("marker.depthfade",!(p.marker.colors||[]).length);var b=p.textfont.size*2;y("marker.pad.t",k?b/4:b),y("marker.pad.l",b/4),y("marker.pad.r",b/4),y("marker.pad.b",k?b:b/4),y("marker.cornerradius"),p._hovered={marker:{line:{width:2,color:a.contrast(m.paper_bgcolor)}}},C&&(y("pathbar.thickness",p.pathbar.textfont.size+2*l),y("pathbar.side"),y("pathbar.edgeshape")),y("sort"),y("root.color"),o(p,m,y),p._length=null}}}),FW=de({"src/traces/treemap/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=zD();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("treemapcolorway",s.colorway),l("extendtreemapcolors")}}}),BD=de({"src/traces/treemap/calc.js"(e){"use strict";var r=Jy();e.calc=function(t,i){return r.calc(t,i)},e.crossTraceCalc=function(t){return r._runCrossTraceCalc("treemap",t)}}}),OD=de({"src/traces/treemap/flip_tree.js"(e,r){"use strict";r.exports=function t(i,a,o){var s;o.swapXY&&(s=i.x0,i.x0=i.y0,i.y0=s,s=i.x1,i.x1=i.y1,i.y1=s),o.flipX&&(s=i.x0,i.x0=a[0]-i.x1,i.x1=a[0]-s),o.flipY&&(s=i.y0,i.y0=a[1]-i.y1,i.y1=a[1]-s);var l=i.children;if(l)for(var n=0;n0)for(var b=0;b").join(" ")||"";var J=i.ensureSingle(X,"g","slicetext"),N=i.ensureSingle(J,"text","",function($){$.attr("data-notex",1)}),H=i.ensureUniformFontSize(d,u.determineTextFont(z,W,R.font,{onPathbar:!0}));N.text(W._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,H).call(o.convertToTspans,d),W.textBB=a.bBox(N.node()),W.transform=w(W,{fontSize:H.size,onPathbar:!0}),W.transform.fontSize=H.size,A?N.transition().attrTween("transform",function($){var U=T($,f,F,[v,x]);return function(V){return k(U(V))}}):N.attr("transform",k(W))})}}}),IW=de({"src/traces/treemap/plot_one.js"(e,r){"use strict";var t=Yr(),i=(Uv(),ti(S0)).interpolate,a=Dp(),o=Qt(),s=_0().TEXTPAD,l=Ev(),n=l.toMoveInsideBar,u=dc(),c=u.recordMinTextSize,f=qv(),h=PW();function d(p){return a.isHierarchyRoot(p)?"":a.getPtId(p)}r.exports=function(g,m,y,_,v){var x=g._fullLayout,S=m[0],M=S.trace,C=M.type,w=C==="icicle",k=S.hierarchy,A=a.findEntryWithLevel(k,M.level),b=t.select(y),E=b.selectAll("g.pathbar"),T=b.selectAll("g.slice");if(!A){E.remove(),T.remove();return}var F=a.isHierarchyRoot(A),D=!x.uniformtext.mode&&a.hasTransition(_),R=a.getMaxDepth(M),P=function(mt){return mt.data.depth-A.data.depth-1?B+W:-(G+W):0,Z={x0:O,x1:O,y0:X,y1:X+G},J=function(mt,Mt,lt){var qe=M.tiling.pad,Ye=function(ke){return ke-qe<=Mt.x0},me=function(ke){return ke+qe>=Mt.x1},_e=function(ke){return ke-qe<=Mt.y0},Ae=function(ke){return ke+qe>=Mt.y1};return mt.x0===Mt.x0&&mt.x1===Mt.x1&&mt.y0===Mt.y0&&mt.y1===Mt.y1?{x0:mt.x0,x1:mt.x1,y0:mt.y0,y1:mt.y1}:{x0:Ye(mt.x0-qe)?0:me(mt.x0-qe)?lt[0]:mt.x0,x1:Ye(mt.x1+qe)?0:me(mt.x1+qe)?lt[0]:mt.x1,y0:_e(mt.y0-qe)?0:Ae(mt.y0-qe)?lt[1]:mt.y0,y1:_e(mt.y1+qe)?0:Ae(mt.y1+qe)?lt[1]:mt.y1}},N=null,H={},$={},U=null,V=function(mt,Mt){return Mt?H[d(mt)]:$[d(mt)]},j=function(mt,Mt,lt,qe){if(Mt)return H[d(k)]||Z;var Ye=$[M.level]||lt;return P(mt)?J(mt,Ye,qe):{}};S.hasMultipleRoots&&F&&R++,M._maxDepth=R,M._backgroundColor=x.paper_bgcolor,M._entryDepth=A.data.depth,M._atRootLevel=F;var q=-L/2+z.l+z.w*(I.x[1]+I.x[0])/2,Y=-B/2+z.t+z.h*(1-(I.y[1]+I.y[0])/2),K=function(mt){return q+mt},te=function(mt){return Y+mt},ne=te(0),se=K(0),le=function(mt){return se+mt},ce=function(mt){return ne+mt};function pe(mt,Mt){return mt+","+Mt}var xe=le(0),ye=function(mt){mt.x=Math.max(xe,mt.x)},fe=M.pathbar.edgeshape,ae=function(mt){var Mt=le(Math.max(Math.min(mt.x0,mt.x0),0)),lt=le(Math.min(Math.max(mt.x1,mt.x1),O)),qe=ce(mt.y0),Ye=ce(mt.y1),me=G/2,_e={},Ae={};_e.x=Mt,Ae.x=lt,_e.y=Ae.y=(qe+Ye)/2;var ke={x:Mt,y:qe},Ee={x:lt,y:qe},De={x:lt,y:Ye},Qe={x:Mt,y:Ye};return fe===">"?(ke.x-=me,Ee.x-=me,De.x-=me,Qe.x-=me):fe==="/"?(De.x-=me,Qe.x-=me,_e.x-=me/2,Ae.x-=me/2):fe==="\\"?(ke.x-=me,Ee.x-=me,_e.x-=me/2,Ae.x-=me/2):fe==="<"&&(_e.x-=me,Ae.x-=me),ye(ke),ye(Qe),ye(_e),ye(Ee),ye(De),ye(Ae),"M"+pe(ke.x,ke.y)+"L"+pe(Ee.x,Ee.y)+"L"+pe(Ae.x,Ae.y)+"L"+pe(De.x,De.y)+"L"+pe(Qe.x,Qe.y)+"L"+pe(_e.x,_e.y)+"Z"},ee=M[w?"tiling":"marker"].pad,ie=function(mt){return M.textposition.indexOf(mt)!==-1},Q=ie("top"),ue=ie("left"),ge=ie("right"),Me=ie("bottom"),Te=function(mt){var Mt=K(mt.x0),lt=K(mt.x1),qe=te(mt.y0),Ye=te(mt.y1),me=lt-Mt,_e=Ye-qe;if(!me||!_e)return"";var Ae=M.marker.cornerradius||0,ke=Math.min(Ae,me/2,_e/2);ke&&mt.data&&mt.data.data&&mt.data.data.label&&(Q&&(ke=Math.min(ke,ee.t)),ue&&(ke=Math.min(ke,ee.l)),ge&&(ke=Math.min(ke,ee.r)),Me&&(ke=Math.min(ke,ee.b)));var Ee=function(De,Qe){return ke?"a"+pe(ke,ke)+" 0 0 1 "+pe(De,Qe):""};return"M"+pe(Mt,qe+ke)+Ee(ke,-ke)+"L"+pe(lt-ke,qe)+Ee(ke,ke)+"L"+pe(lt,Ye-ke)+Ee(-ke,ke)+"L"+pe(Mt+ke,Ye)+Ee(-ke,-ke)+"Z"},je=function(mt,Mt){var lt=mt.x0,qe=mt.x1,Ye=mt.y0,me=mt.y1,_e=mt.textBB,Ae=Q||Mt.isHeader&&!Me,ke=Ae?"start":Me?"end":"middle",Ee=ie("right"),De=ie("left")||Mt.onPathbar,Qe=De?-1:Ee?1:0;if(Mt.isHeader){if(lt+=(w?ee:ee.l)-s,qe-=(w?ee:ee.r)-s,lt>=qe){var Ue=(lt+qe)/2;lt=Ue,qe=Ue}var at;Me?(at=me-(w?ee:ee.b),Ye-1,flipY:I.tiling.flip.indexOf("y")>-1,pad:{inner:I.tiling.pad,top:I.marker.pad.t,left:I.marker.pad.l,right:I.marker.pad.r,bottom:I.marker.pad.b}}),X=W.descendants(),Z=1/0,J=-1/0;X.forEach(function(V){var j=V.depth;j>=I._maxDepth?(V.x0=V.x1=(V.x0+V.x1)/2,V.y0=V.y1=(V.y0+V.y1)/2):(Z=Math.min(Z,j),J=Math.max(J,j))}),y=y.data(X,u.getPtId),I._maxVisibleLayers=isFinite(J)?J-Z+1:0,y.enter().append("g").classed("slice",!0),b(y,h,D,[v,x],C),y.order();var N=null;if(A&&F){var H=u.getPtId(F);y.each(function(V){N===null&&u.getPtId(V)===H&&(N={x0:V.x0,x1:V.x1,y0:V.y0,y1:V.y1})})}var $=function(){return N||{x0:0,x1:v,y0:0,y1:x}},U=y;return A&&(U=U.transition().each("end",function(){var V=t.select(this);u.setSliceCursor(V,p,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),U.each(function(V){var j=u.isHeader(V,I);V._x0=S(V.x0),V._x1=S(V.x1),V._y0=M(V.y0),V._y1=M(V.y1),V._hoverX=S(V.x1-I.marker.pad.r),V._hoverY=M(O?V.y1-I.marker.pad.b/2:V.y0+I.marker.pad.t/2);var q=t.select(this),Y=i.ensureSingle(q,"path","surface",function(ce){ce.style("pointer-events",R?"none":"all")});A?Y.transition().attrTween("d",function(ce){var pe=E(ce,h,$(),[v,x]);return function(xe){return C(pe(xe))}}):Y.attr("d",C),q.call(c,m,p,g,{styleOne:l,eventDataKeys:n.eventDataKeys,transitionTime:n.CLICK_TRANSITION_TIME,transitionEasing:n.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,p,{isTransitioning:p._transitioning}),Y.call(l,V,I,p,{hovered:!1}),V.x0===V.x1||V.y0===V.y1?V._text="":j?V._text=G?"":u.getPtLabel(V)||"":V._text=f(V,m,I,g,P)||"";var K=i.ensureSingle(q,"g","slicetext"),te=i.ensureSingle(K,"text","",function(ce){ce.attr("data-notex",1)}),ne=i.ensureUniformFontSize(p,u.determineTextFont(I,V,P.font)),se=V._text||" ",le=j&&se.indexOf("
")===-1;te.text(se).classed("slicetext",!0).attr("text-anchor",B?"end":L||le?"start":"middle").call(a.font,ne).call(o.convertToTspans,p),V.textBB=a.bBox(te.node()),V.transform=w(V,{fontSize:ne.size,isHeader:j}),V.transform.fontSize=ne.size,A?te.transition().attrTween("transform",function(ce){var pe=T(ce,h,$(),[v,x]);return function(xe){return k(pe(xe))}}):te.attr("transform",k(V))}),N}}}),zW=de({"src/traces/treemap/plot.js"(e,r){"use strict";var t=jD(),i=RW();r.exports=function(o,s,l,n){return t(o,s,l,n,{type:"treemap",drawDescendants:i})}}}),BW=de({"src/traces/treemap/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"treemap",basePlotModule:DW(),categories:[],animatable:!0,attributes:d4(),layoutAttributes:zD(),supplyDefaults:LW(),supplyLayoutDefaults:FW(),calc:BD().calc,crossTraceCalc:BD().crossTraceCalc,plot:zW(),style:p4().style,colorbar:Yu(),meta:{}}}}),OW=de({"lib/treemap.js"(e,r){"use strict";r.exports=BW()}}),NW=de({"src/traces/icicle/base_plot.js"(e){"use strict";var r=ks();e.name="icicle",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),UD=de({"src/traces/icicle/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,texttemplateAttrs:i,templatefallbackAttrs:a}=Vo(),o=cs(),s=Rs().attributes,l=Iv(),n=Zy(),u=d4(),c=qv(),f=fn().extendFlat,h=fu().pattern;r.exports={labels:n.labels,parents:n.parents,values:n.values,branchvalues:n.branchvalues,count:n.count,level:n.level,maxdepth:n.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:u.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:f({colors:n.marker.colors,line:n.marker.line,pattern:h,editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),leaf:n.leaf,pathbar:u.pathbar,text:l.text,textinfo:n.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),hovertext:l.hovertext,hoverinfo:n.hoverinfo,hovertemplate:t({},{keys:c.eventDataKeys}),hovertemplatefallback:a(),textfont:l.textfont,insidetextfont:l.insidetextfont,outsidetextfont:u.outsidetextfont,textposition:u.textposition,sort:l.sort,root:n.root,domain:s({name:"icicle",trace:!0,editType:"calc"})}}}),qD=de({"src/traces/icicle/layout_attributes.js"(e,r){"use strict";r.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),jW=de({"src/traces/icicle/defaults.js"(e,r){"use strict";var t=Qt(),i=UD(),a=ta(),o=Rs().defaults,s=sh().handleText,l=_0().TEXTPAD,n=Rv().handleMarkerDefaults,u=Cs(),c=u.hasColorscale,f=u.handleDefaults;r.exports=function(d,p,g,m){function y(k,A){return t.coerce(d,p,i,k,A)}var _=y("labels"),v=y("parents");if(!_||!_.length||!v||!v.length){p.visible=!1;return}var x=y("values");x&&x.length?y("branchvalues"):y("count"),y("level"),y("maxdepth"),y("tiling.orientation"),y("tiling.flip"),y("tiling.pad");var S=y("text");y("texttemplate"),y("texttemplatefallback"),p.texttemplate||y("textinfo",t.isArrayOrTypedArray(S)?"text+label":"label"),y("hovertext"),y("hovertemplate"),y("hovertemplatefallback");var M=y("pathbar.visible"),C="auto";s(d,p,m,y,C,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),y("textposition"),n(d,p,m,y);var w=p._hasColorscale=c(d,"marker","colors")||(d.marker||{}).coloraxis;w&&f(d,p,m,y,{prefix:"marker.",cLetter:"c"}),y("leaf.opacity",w?1:.7),p._hovered={marker:{line:{width:2,color:a.contrast(m.paper_bgcolor)}}},M&&(y("pathbar.thickness",p.pathbar.textfont.size+2*l),y("pathbar.side"),y("pathbar.edgeshape")),y("sort"),y("root.color"),o(p,m,y),p._length=null}}}),UW=de({"src/traces/icicle/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=qD();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("iciclecolorway",s.colorway),l("extendiciclecolors")}}}),VD=de({"src/traces/icicle/calc.js"(e){"use strict";var r=Jy();e.calc=function(t,i){return r.calc(t,i)},e.crossTraceCalc=function(t){return r._runCrossTraceCalc("icicle",t)}}}),qW=de({"src/traces/icicle/partition.js"(e,r){"use strict";var t=Ky(),i=OD();r.exports=function(o,s,l){var n=l.flipX,u=l.flipY,c=l.orientation==="h",f=l.maxDepth,h=s[0],d=s[1];f&&(h=(o.height+1)*s[0]/Math.min(o.height+1,f),d=(o.height+1)*s[1]/Math.min(o.height+1,f));var p=t.partition().padding(l.pad.inner).size(c?[s[1],h]:[s[0],d])(o);return(c||n||u)&&i(p,s,{swapXY:c,flipX:n,flipY:u}),p}}}),GD=de({"src/traces/icicle/style.js"(e,r){"use strict";var t=Yr(),i=ta(),a=Qt(),o=dc().resizeText,s=f4();function l(u){var c=u._fullLayout._iciclelayer.selectAll(".trace");o(u,c,"icicle"),c.each(function(f){var h=t.select(this),d=f[0],p=d.trace;h.style("opacity",p.opacity),h.selectAll("path.surface").each(function(g){t.select(this).call(n,g,p,u)})})}function n(u,c,f,h){var d=c.data.data,p=!c.children,g=d.i,m=a.castOption(f,g,"marker.line.color")||i.defaultLine,y=a.castOption(f,g,"marker.line.width")||0;u.call(s,c,f,h).style("stroke-width",y).call(i.stroke,m).style("opacity",p?f.leaf.opacity:null)}r.exports={style:l,styleOne:n}}}),VW=de({"src/traces/icicle/draw_descendants.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=hn(),o=Zo(),s=qW(),l=GD().styleOne,n=qv(),u=Dp(),c=p_(),f=h4().formatSliceLabel,h=!1;r.exports=function(p,g,m,y,_){var v=_.width,x=_.height,S=_.viewX,M=_.viewY,C=_.pathSlice,w=_.toMoveInsideSlice,k=_.strTransform,A=_.hasTransition,b=_.handleSlicesExit,E=_.makeUpdateSliceInterpolator,T=_.makeUpdateTextInterpolator,F=_.prevEntry,D={},R=p._context.staticPlot,P=p._fullLayout,z=g[0],I=z.trace,L=I.textposition.indexOf("left")!==-1,B=I.textposition.indexOf("right")!==-1,O=I.textposition.indexOf("bottom")!==-1,G=s(m,[v,x],{flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1,orientation:I.tiling.orientation,pad:{inner:I.tiling.pad},maxDepth:I._maxDepth}),W=G.descendants(),X=1/0,Z=-1/0;W.forEach(function(U){var V=U.depth;V>=I._maxDepth?(U.x0=U.x1=(U.x0+U.x1)/2,U.y0=U.y1=(U.y0+U.y1)/2):(X=Math.min(X,V),Z=Math.max(Z,V))}),y=y.data(W,u.getPtId),I._maxVisibleLayers=isFinite(Z)?Z-X+1:0,y.enter().append("g").classed("slice",!0),b(y,h,D,[v,x],C),y.order();var J=null;if(A&&F){var N=u.getPtId(F);y.each(function(U){J===null&&u.getPtId(U)===N&&(J={x0:U.x0,x1:U.x1,y0:U.y0,y1:U.y1})})}var H=function(){return J||{x0:0,x1:v,y0:0,y1:x}},$=y;return A&&($=$.transition().each("end",function(){var U=t.select(this);u.setSliceCursor(U,p,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),$.each(function(U){U._x0=S(U.x0),U._x1=S(U.x1),U._y0=M(U.y0),U._y1=M(U.y1),U._hoverX=S(U.x1-I.tiling.pad),U._hoverY=M(O?U.y1-I.tiling.pad/2:U.y0+I.tiling.pad/2);var V=t.select(this),j=i.ensureSingle(V,"path","surface",function(te){te.style("pointer-events",R?"none":"all")});A?j.transition().attrTween("d",function(te){var ne=E(te,h,H(),[v,x],{orientation:I.tiling.orientation,flipX:I.tiling.flip.indexOf("x")>-1,flipY:I.tiling.flip.indexOf("y")>-1});return function(se){return C(ne(se))}}):j.attr("d",C),V.call(c,m,p,g,{styleOne:l,eventDataKeys:n.eventDataKeys,transitionTime:n.CLICK_TRANSITION_TIME,transitionEasing:n.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,p,{isTransitioning:p._transitioning}),j.call(l,U,I,p,{hovered:!1}),U.x0===U.x1||U.y0===U.y1?U._text="":U._text=f(U,m,I,g,P)||"";var q=i.ensureSingle(V,"g","slicetext"),Y=i.ensureSingle(q,"text","",function(te){te.attr("data-notex",1)}),K=i.ensureUniformFontSize(p,u.determineTextFont(I,U,P.font));Y.text(U._text||" ").classed("slicetext",!0).attr("text-anchor",B?"end":L?"start":"middle").call(a.font,K).call(o.convertToTspans,p),U.textBB=a.bBox(Y.node()),U.transform=w(U,{fontSize:K.size}),U.transform.fontSize=K.size,A?Y.transition().attrTween("transform",function(te){var ne=T(te,h,H(),[v,x]);return function(se){return k(ne(se))}}):Y.attr("transform",k(U))}),J}}}),GW=de({"src/traces/icicle/plot.js"(e,r){"use strict";var t=jD(),i=VW();r.exports=function(o,s,l,n){return t(o,s,l,n,{type:"icicle",drawDescendants:i})}}}),HW=de({"src/traces/icicle/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"icicle",basePlotModule:NW(),categories:[],animatable:!0,attributes:UD(),layoutAttributes:qD(),supplyDefaults:jW(),supplyLayoutDefaults:UW(),calc:VD().calc,crossTraceCalc:VD().crossTraceCalc,plot:GW(),style:GD().style,colorbar:Yu(),meta:{}}}}),$W=de({"lib/icicle.js"(e,r){"use strict";r.exports=HW()}}),WW=de({"src/traces/funnelarea/base_plot.js"(e){"use strict";var r=ks();e.name="funnelarea",e.plot=function(t,i,a,o){r.plotBasePlot(e.name,t,i,a,o)},e.clean=function(t,i,a,o){r.cleanBasePlot(e.name,t,i,a,o)}}}),HD=de({"src/traces/funnelarea/attributes.js"(e,r){"use strict";var t=Iv(),i=ri(),a=Rs().attributes,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=Vo(),n=fn().extendFlat;r.exports={labels:t.labels,label0:t.label0,dlabel:t.dlabel,values:t.values,marker:{colors:t.marker.colors,line:{color:n({},t.marker.line.color,{dflt:null}),width:n({},t.marker.line.width,{dflt:1}),editType:"calc"},pattern:t.marker.pattern,editType:"calc"},text:t.text,hovertext:t.hovertext,scalegroup:n({},t.scalegroup,{}),textinfo:n({},t.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:l({editType:"plot"}),hoverinfo:n({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:l(),textposition:n({},t.textposition,{values:["inside","none"],dflt:"inside"}),textfont:t.textfont,insidetextfont:t.insidetextfont,title:{text:t.title.text,font:t.title.font,position:n({},t.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),$D=de({"src/traces/funnelarea/layout_attributes.js"(e,r){"use strict";var t=R3().hiddenlabels;r.exports={hiddenlabels:t,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),YW=de({"src/traces/funnelarea/defaults.js"(e,r){"use strict";var t=Qt(),i=HD(),a=Rs().defaults,o=sh().handleText,s=Rv().handleLabelsAndValues,l=Rv().handleMarkerDefaults;r.exports=function(u,c,f,h){function d(C,w){return t.coerce(u,c,i,C,w)}var p=d("labels"),g=d("values"),m=s(p,g),y=m.len;if(c._hasLabels=m.hasLabels,c._hasValues=m.hasValues,!c._hasLabels&&c._hasValues&&(d("label0"),d("dlabel")),!y){c.visible=!1;return}c._length=y,l(u,c,h,d),d("scalegroup");var _=d("text"),v=d("texttemplate");d("texttemplatefallback");var x;if(v||(x=d("textinfo",Array.isArray(_)?"text+percent":"percent")),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback"),v||x&&x!=="none"){var S=d("textposition");o(u,c,h,d,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else x==="none"&&d("textposition","none");a(c,h,d);var M=d("title.text");M&&(d("title.position"),t.coerceFont(d,"title.font",h.font)),d("aspectratio"),d("baseratio")}}}),XW=de({"src/traces/funnelarea/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=$D();r.exports=function(o,s){function l(n,u){return t.coerce(o,s,i,n,u)}l("hiddenlabels"),l("funnelareacolorway",s.colorway),l("extendfunnelareacolors")}}}),WD=de({"src/traces/funnelarea/calc.js"(e,r){"use strict";var t=k1();function i(o,s){return t.calc(o,s)}function a(o){t.crossTraceCalc(o,{type:"funnelarea"})}r.exports={calc:i,crossTraceCalc:a}}}),ZW=de({"src/traces/funnelarea/plot.js"(e,r){"use strict";var t=Yr(),i=hn(),a=Qt(),o=a.strScale,s=a.strTranslate,l=Zo(),n=Ev(),u=n.toMoveInsideBar,c=dc(),f=c.recordMinTextSize,h=c.clearMinTextSize,d=v0(),p=z3(),g=p.attachFxHandlers,m=p.determineInsideTextFont,y=p.layoutAreas,_=p.prerenderTitles,v=p.positionTitleOutside,x=p.formatSliceLabel;r.exports=function(k,A){var b=k._context.staticPlot,E=k._fullLayout;h("funnelarea",E),_(A,k),y(A,E._size),a.makeTraceGroups(E._funnelarealayer,A,"trace").each(function(T){var F=t.select(this),D=T[0],R=D.trace;C(T),F.each(function(){var P=t.select(this).selectAll("g.slice").data(T);P.enter().append("g").classed("slice",!0),P.exit().remove(),P.each(function(I,L){if(I.hidden){t.select(this).selectAll("path,g").remove();return}I.pointNumber=I.i,I.curveNumber=R.index;var B=D.cx,O=D.cy,G=t.select(this),W=G.selectAll("path.surface").data([I]);W.enter().append("path").classed("surface",!0).style({"pointer-events":b?"none":"all"}),G.call(g,k,T);var X="M"+(B+I.TR[0])+","+(O+I.TR[1])+S(I.TR,I.BR)+S(I.BR,I.BL)+S(I.BL,I.TL)+"Z";W.attr("d",X),x(k,I,D);var Z=d.castOption(R.textposition,I.pts),J=G.selectAll("g.slicetext").data(I.text&&Z!=="none"?[0]:[]);J.enter().append("g").classed("slicetext",!0),J.exit().remove(),J.each(function(){var N=a.ensureSingle(t.select(this),"text","",function(K){K.attr("data-notex",1)}),H=a.ensureUniformFontSize(k,m(R,I,E.font));N.text(I.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,H).call(l.convertToTspans,k);var $=i.bBox(N.node()),U,V,j,q=Math.min(I.BL[1],I.BR[1])+O,Y=Math.max(I.TL[1],I.TR[1])+O;V=Math.max(I.TL[0],I.BL[0])+B,j=Math.min(I.TR[0],I.BR[0])+B,U=u(V,j,q,Y,$,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),U.fontSize=H.size,f(R.type,U,E),T[L].transform=U,a.setTransormAndDisplay(N,U)})});var z=t.select(this).selectAll("g.titletext").data(R.title.text?[0]:[]);z.enter().append("g").classed("titletext",!0),z.exit().remove(),z.each(function(){var I=a.ensureSingle(t.select(this),"text","",function(O){O.attr("data-notex",1)}),L=R.title.text;R._meta&&(L=a.templateString(L,R._meta)),I.text(L).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,R.title.font).call(l.convertToTspans,k);var B=v(D,E._size);I.attr("transform",s(B.x,B.y)+o(Math.min(1,B.scale))+s(B.tx,B.ty))})})})};function S(w,k){var A=k[0]-w[0],b=k[1]-w[1];return"l"+A+","+b}function M(w,k){return[.5*(w[0]+k[0]),.5*(w[1]+k[1])]}function C(w){if(!w.length)return;var k=w[0],A=k.trace,b=A.aspectratio,E=A.baseratio;E>.999&&(E=.999);var T=Math.pow(E,2),F=k.vTotal,D=F*T/(1-T),R=F,P=D/F;function z(){var te=Math.sqrt(P);return{x:te,y:-te}}function I(){var te=z();return[te.x,te.y]}var L,B=[];B.push(I());var O,G;for(O=w.length-1;O>-1;O--)if(G=w[O],!G.hidden){var W=G.v/R;P+=W,B.push(I())}var X=1/0,Z=-1/0;for(O=0;O-1;O--)if(G=w[O],!G.hidden){q+=1;var Y=B[q][0],K=B[q][1];G.TL=[-Y,K],G.TR=[Y,K],G.BL=V,G.BR=j,G.pxmid=M(G.TR,G.BR),V=G.TL,j=G.TR}}}}),KW=de({"src/traces/funnelarea/style.js"(e,r){"use strict";var t=Yr(),i=p1(),a=dc().resizeText;r.exports=function(s){var l=s._fullLayout._funnelarealayer.selectAll(".trace");a(s,l,"funnelarea"),l.each(function(n){var u=n[0],c=u.trace,f=t.select(this);f.style({opacity:c.opacity}),f.selectAll("path.surface").each(function(h){t.select(this).call(i,h,c,s)})})}}}),JW=de({"src/traces/funnelarea/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"funnelarea",basePlotModule:WW(),categories:["pie-like","funnelarea","showLegend"],attributes:HD(),layoutAttributes:$D(),supplyDefaults:YW(),supplyLayoutDefaults:XW(),calc:WD().calc,crossTraceCalc:WD().crossTraceCalc,plot:ZW(),style:KW(),styleOne:p1(),meta:{}}}}),QW=de({"lib/funnelarea.js"(e,r){"use strict";r.exports=JW()}}),ku=de({"stackgl_modules/index.js"(e,r){"use strict";(()=>{var t={3065(s,l,n){s.exports={alpha_shape:n(3502),convex_hull:n(7352),delaunay_triangulate:n(7642),gl_cone3d:n(6405),gl_error3d:n(9165),gl_line3d:n(5714),gl_mesh3d:n(7201),gl_plot3d:n(4100),gl_scatter3d:n(8418),gl_streamtube3d:n(7815),gl_surface3d:n(9499),ndarray:n(9618),ndarray_linear_interpolate:n(4317)}},6296(s,l,n){"use strict";s.exports=p;var u=n(7261),c=n(9977),f=n(1811);function h(g,m){this._controllerNames=Object.keys(g),this._controllerList=this._controllerNames.map(function(y){return g[y]}),this._mode=m,this._active=g[m],this._active||(this._mode="turntable",this._active=g.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var d=h.prototype;d.flush=function(g){for(var m=this._controllerList,y=0;y"u"?n(1538):WeakMap,c=n(2762),f=n(8116),h=new u;function d(p){var g=h.get(p),m=g&&(g._triangleBuffer.handle||g._triangleBuffer.buffer);if(!m||!p.isBuffer(m)){var y=c(p,new Float32Array([-1,-1,-1,4,4,-1]));g=f(p,[{buffer:y,type:p.FLOAT,size:2}]),g._triangleBuffer=y,h.set(p,g)}g.bind(),p.drawArrays(p.TRIANGLES,0,3),g.unbind()}s.exports=d},1085(s,l,n){var u=n(1371);s.exports=c;function c(f,h,d){h=typeof h=="number"?h:1,d=d||": ";var p=f.split(/\r?\n/),g=String(p.length+h-1).length;return p.map(function(m,y){var _=y+h,v=String(_).length,x=u(_,g-v);return x+d+m}).join(` +`)}},3952(s,l,n){"use strict";s.exports=f;var u=n(3250);function c(h,d){for(var p=new Array(d+1),g=0;g0)throw new Error("Invalid string. Length must be a multiple of 4");var C=S.indexOf("=");C===-1&&(C=M);var w=C===M?0:4-C%4;return[C,w]}function g(S){var M=p(S),C=M[0],w=M[1];return(C+w)*3/4-w}function m(S,M,C){return(M+C)*3/4-C}function y(S){var M,C=p(S),w=C[0],k=C[1],A=new c(m(S,w,k)),b=0,E=k>0?w-4:w,T;for(T=0;T>16&255,A[b++]=M>>8&255,A[b++]=M&255;return k===2&&(M=u[S.charCodeAt(T)]<<2|u[S.charCodeAt(T+1)]>>4,A[b++]=M&255),k===1&&(M=u[S.charCodeAt(T)]<<10|u[S.charCodeAt(T+1)]<<4|u[S.charCodeAt(T+2)]>>2,A[b++]=M>>8&255,A[b++]=M&255),A}function _(S){return n[S>>18&63]+n[S>>12&63]+n[S>>6&63]+n[S&63]}function v(S,M,C){for(var w,k=[],A=M;AE?E:b+A));return w===1?(M=S[C-1],k.push(n[M>>2]+n[M<<4&63]+"==")):w===2&&(M=(S[C-2]<<8)+S[C-1],k.push(n[M>>10]+n[M>>4&63]+n[M<<2&63]+"=")),k.join("")}},3865(s,l,n){"use strict";var u=n(869);s.exports=c;function c(f,h){return u(f[0].mul(h[1]).add(h[0].mul(f[1])),f[1].mul(h[1]))}},1318(s){"use strict";s.exports=l;function l(n,u){return n[0].mul(u[1]).cmp(u[0].mul(n[1]))}},8697(s,l,n){"use strict";var u=n(869);s.exports=c;function c(f,h){return u(f[0].mul(h[1]),f[1].mul(h[0]))}},7842(s,l,n){"use strict";var u=n(6330),c=n(1533),f=n(2651),h=n(6768),d=n(869),p=n(8697);s.exports=g;function g(m,y){if(u(m))return y?p(m,g(y)):[m[0].clone(),m[1].clone()];var _=0,v,x;if(c(m))v=m.clone();else if(typeof m=="string")v=h(m);else{if(m===0)return[f(0),f(1)];if(m===Math.floor(m))v=f(m);else{for(;m!==Math.floor(m);)m=m*Math.pow(2,256),_-=256;v=f(m)}}if(u(y))v.mul(y[1]),x=y[0].clone();else if(c(y))x=y.clone();else if(typeof y=="string")x=h(y);else if(!y)x=f(1);else if(y===Math.floor(y))x=f(y);else{for(;y!==Math.floor(y);)y=y*Math.pow(2,256),_+=256;x=f(y)}return _>0?v=v.ushln(_):_<0&&(x=x.ushln(-_)),d(v,x)}},6330(s,l,n){"use strict";var u=n(1533);s.exports=c;function c(f){return Array.isArray(f)&&f.length===2&&u(f[0])&&u(f[1])}},5716(s,l,n){"use strict";var u=n(6859);s.exports=c;function c(f){return f.cmp(new u(0))}},1369(s,l,n){"use strict";var u=n(5716);s.exports=c;function c(f){var h=f.length,d=f.words,p=0;if(h===1)p=d[0];else if(h===2)p=d[0]+d[1]*67108864;else for(var g=0;g20?52:p+32}},1533(s,l,n){"use strict";var u=n(6859);s.exports=c;function c(f){return f&&typeof f=="object"&&!!f.words}},2651(s,l,n){"use strict";var u=n(6859),c=n(2361);s.exports=f;function f(h){var d=c.exponent(h);return d<52?new u(h):new u(h*Math.pow(2,52-d)).ushln(d-52)}},869(s,l,n){"use strict";var u=n(2651),c=n(5716);s.exports=f;function f(h,d){var p=c(h),g=c(d);if(p===0)return[u(0),u(1)];if(g===0)return[u(0),u(0)];g<0&&(h=h.neg(),d=d.neg());var m=h.gcd(d);return m.cmpn(1)?[h.div(m),d.div(m)]:[h,d]}},6768(s,l,n){"use strict";var u=n(6859);s.exports=c;function c(f){return new u(f)}},6504(s,l,n){"use strict";var u=n(869);s.exports=c;function c(f,h){return u(f[0].mul(h[0]),f[1].mul(h[1]))}},7721(s,l,n){"use strict";var u=n(5716);s.exports=c;function c(f){return u(f[0])*u(f[1])}},5572(s,l,n){"use strict";var u=n(869);s.exports=c;function c(f,h){return u(f[0].mul(h[1]).sub(f[1].mul(h[0])),f[1].mul(h[1]))}},946(s,l,n){"use strict";var u=n(1369),c=n(4025);s.exports=f;function f(h){var d=h[0],p=h[1];if(d.cmpn(0)===0)return 0;var g=d.abs().divmod(p.abs()),m=g.div,y=u(m),_=g.mod,v=d.negative!==p.negative?-1:1;if(_.cmpn(0)===0)return v*y;if(y){var x=c(y)+4,S=u(_.ushln(x).divRound(p));return v*(y+S*Math.pow(2,-x))}else{var M=p.bitLength()-_.bitLength()+53,S=u(_.ushln(M).divRound(p));return M<1023?v*S*Math.pow(2,-M):(S*=Math.pow(2,-1023),v*S*Math.pow(2,1023-M))}}},2478(s){"use strict";function l(d,p,g,m,y){for(var _=y+1;m<=y;){var v=m+y>>>1,x=d[v],S=g!==void 0?g(x,p):x-p;S>=0?(_=v,y=v-1):m=v+1}return _}function n(d,p,g,m,y){for(var _=y+1;m<=y;){var v=m+y>>>1,x=d[v],S=g!==void 0?g(x,p):x-p;S>0?(_=v,y=v-1):m=v+1}return _}function u(d,p,g,m,y){for(var _=m-1;m<=y;){var v=m+y>>>1,x=d[v],S=g!==void 0?g(x,p):x-p;S<0?(_=v,m=v+1):y=v-1}return _}function c(d,p,g,m,y){for(var _=m-1;m<=y;){var v=m+y>>>1,x=d[v],S=g!==void 0?g(x,p):x-p;S<=0?(_=v,m=v+1):y=v-1}return _}function f(d,p,g,m,y){for(;m<=y;){var _=m+y>>>1,v=d[_],x=g!==void 0?g(v,p):v-p;if(x===0)return _;x<=0?m=_+1:y=_-1}return-1}function h(d,p,g,m,y,_){return typeof g=="function"?_(d,p,g,m===void 0?0:m|0,y===void 0?d.length-1:y|0):_(d,p,void 0,g===void 0?0:g|0,m===void 0?d.length-1:m|0)}s.exports={ge:function(d,p,g,m,y){return h(d,p,g,m,y,l)},gt:function(d,p,g,m,y){return h(d,p,g,m,y,n)},lt:function(d,p,g,m,y){return h(d,p,g,m,y,u)},le:function(d,p,g,m,y){return h(d,p,g,m,y,c)},eq:function(d,p,g,m,y){return h(d,p,g,m,y,f)}}},8828(s,l){"use strict";"use restrict";var n=32;l.INT_BITS=n,l.INT_MAX=2147483647,l.INT_MIN=-1<0)-(f<0)},l.abs=function(f){var h=f>>n-1;return(f^h)-h},l.min=function(f,h){return h^(f^h)&-(f65535)<<4,f>>>=h,d=(f>255)<<3,f>>>=d,h|=d,d=(f>15)<<2,f>>>=d,h|=d,d=(f>3)<<1,f>>>=d,h|=d,h|f>>1},l.log10=function(f){return f>=1e9?9:f>=1e8?8:f>=1e7?7:f>=1e6?6:f>=1e5?5:f>=1e4?4:f>=1e3?3:f>=100?2:f>=10?1:0},l.popCount=function(f){return f=f-(f>>>1&1431655765),f=(f&858993459)+(f>>>2&858993459),(f+(f>>>4)&252645135)*16843009>>>24};function u(f){var h=32;return f&=-f,f&&h--,f&65535&&(h-=16),f&16711935&&(h-=8),f&252645135&&(h-=4),f&858993459&&(h-=2),f&1431655765&&(h-=1),h}l.countTrailingZeros=u,l.nextPow2=function(f){return f+=f===0,--f,f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f+1},l.prevPow2=function(f){return f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f-(f>>>1)},l.parity=function(f){return f^=f>>>16,f^=f>>>8,f^=f>>>4,f&=15,27030>>>f&1};var c=new Array(256);(function(f){for(var h=0;h<256;++h){var d=h,p=h,g=7;for(d>>>=1;d;d>>>=1)p<<=1,p|=d&1,--g;f[h]=p<>>8&255]<<16|c[f>>>16&255]<<8|c[f>>>24&255]},l.interleave2=function(f,h){return f&=65535,f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,h&=65535,h=(h|h<<8)&16711935,h=(h|h<<4)&252645135,h=(h|h<<2)&858993459,h=(h|h<<1)&1431655765,f|h<<1},l.deinterleave2=function(f,h){return f=f>>>h&1431655765,f=(f|f>>>1)&858993459,f=(f|f>>>2)&252645135,f=(f|f>>>4)&16711935,f=(f|f>>>16)&65535,f<<16>>16},l.interleave3=function(f,h,d){return f&=1023,f=(f|f<<16)&4278190335,f=(f|f<<8)&251719695,f=(f|f<<4)&3272356035,f=(f|f<<2)&1227133513,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,f|=h<<1,d&=1023,d=(d|d<<16)&4278190335,d=(d|d<<8)&251719695,d=(d|d<<4)&3272356035,d=(d|d<<2)&1227133513,f|d<<2},l.deinterleave3=function(f,h){return f=f>>>h&1227133513,f=(f|f>>>2)&3272356035,f=(f|f>>>4)&251719695,f=(f|f>>>8)&4278190335,f=(f|f>>>16)&1023,f<<22>>22},l.nextCombination=function(f){var h=f|f-1;return h+1|(~h&-~h)-1>>>u(f)+1}},6859(s,l,n){s=n.nmd(s),(function(u,c){"use strict";function f(I,L){if(!I)throw new Error(L||"Assertion failed")}function h(I,L){I.super_=L;var B=function(){};B.prototype=L.prototype,I.prototype=new B,I.prototype.constructor=I}function d(I,L,B){if(d.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((L==="le"||L==="be")&&(B=L,L=10),this._init(I||0,L||10,B||"be"))}typeof u=="object"?u.exports=d:c.BN=d,d.BN=d,d.wordSize=26;var p;try{typeof window<"u"&&typeof window.Buffer<"u"?p=window.Buffer:p=n(7790).Buffer}catch{}d.isBN=function(L){return L instanceof d?!0:L!==null&&typeof L=="object"&&L.constructor.wordSize===d.wordSize&&Array.isArray(L.words)},d.max=function(L,B){return L.cmp(B)>0?L:B},d.min=function(L,B){return L.cmp(B)<0?L:B},d.prototype._init=function(L,B,O){if(typeof L=="number")return this._initNumber(L,B,O);if(typeof L=="object")return this._initArray(L,B,O);B==="hex"&&(B=16),f(B===(B|0)&&B>=2&&B<=36),L=L.toString().replace(/\s+/g,"");var G=0;L[0]==="-"&&(G++,this.negative=1),G=0;G-=3)X=L[G]|L[G-1]<<8|L[G-2]<<16,this.words[W]|=X<>>26-Z&67108863,Z+=24,Z>=26&&(Z-=26,W++);else if(O==="le")for(G=0,W=0;G>>26-Z&67108863,Z+=24,Z>=26&&(Z-=26,W++);return this.strip()};function g(I,L){var B=I.charCodeAt(L);return B>=65&&B<=70?B-55:B>=97&&B<=102?B-87:B-48&15}function m(I,L,B){var O=g(I,B);return B-1>=L&&(O|=g(I,B-1)<<4),O}d.prototype._parseHex=function(L,B,O){this.length=Math.ceil((L.length-B)/6),this.words=new Array(this.length);for(var G=0;G=B;G-=2)Z=m(L,B,G)<=18?(W-=18,X+=1,this.words[X]|=Z>>>26):W+=8;else{var J=L.length-B;for(G=J%2===0?B+1:B;G=18?(W-=18,X+=1,this.words[X]|=Z>>>26):W+=8}this.strip()};function y(I,L,B,O){for(var G=0,W=Math.min(I.length,B),X=L;X=49?G+=Z-49+10:Z>=17?G+=Z-17+10:G+=Z}return G}d.prototype._parseBase=function(L,B,O){this.words=[0],this.length=1;for(var G=0,W=1;W<=67108863;W*=B)G++;G--,W=W/B|0;for(var X=L.length-O,Z=X%G,J=Math.min(X,X-Z)+O,N=0,H=O;H1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},d.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?""};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],v=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];d.prototype.toString=function(L,B){L=L||10,B=B|0||1;var O;if(L===16||L==="hex"){O="";for(var G=0,W=0,X=0;X>>24-G&16777215,G+=2,G>=26&&(G-=26,X--),W!==0||X!==this.length-1?O=_[6-J.length]+J+O:O=J+O}for(W!==0&&(O=W.toString(16)+O);O.length%B!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}if(L===(L|0)&&L>=2&&L<=36){var N=v[L],H=x[L];O="";var $=this.clone();for($.negative=0;!$.isZero();){var U=$.modn(H).toString(L);$=$.idivn(H),$.isZero()?O=U+O:O=_[N-U.length]+U+O}for(this.isZero()&&(O="0"+O);O.length%B!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}f(!1,"Base should be between 2 and 36")},d.prototype.toNumber=function(){var L=this.words[0];return this.length===2?L+=this.words[1]*67108864:this.length===3&&this.words[2]===1?L+=4503599627370496+this.words[1]*67108864:this.length>2&&f(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-L:L},d.prototype.toJSON=function(){return this.toString(16)},d.prototype.toBuffer=function(L,B){return f(typeof p<"u"),this.toArrayLike(p,L,B)},d.prototype.toArray=function(L,B){return this.toArrayLike(Array,L,B)},d.prototype.toArrayLike=function(L,B,O){var G=this.byteLength(),W=O||Math.max(1,G);f(G<=W,"byte array longer than desired length"),f(W>0,"Requested array length <= 0"),this.strip();var X=B==="le",Z=new L(W),J,N,H=this.clone();if(X){for(N=0;!H.isZero();N++)J=H.andln(255),H.iushrn(8),Z[N]=J;for(;N=4096&&(O+=13,B>>>=13),B>=64&&(O+=7,B>>>=7),B>=8&&(O+=4,B>>>=4),B>=2&&(O+=2,B>>>=2),O+B},d.prototype._zeroBits=function(L){if(L===0)return 26;var B=L,O=0;return(B&8191)===0&&(O+=13,B>>>=13),(B&127)===0&&(O+=7,B>>>=7),(B&15)===0&&(O+=4,B>>>=4),(B&3)===0&&(O+=2,B>>>=2),(B&1)===0&&O++,O},d.prototype.bitLength=function(){var L=this.words[this.length-1],B=this._countBits(L);return(this.length-1)*26+B};function S(I){for(var L=new Array(I.bitLength()),B=0;B>>G}return L}d.prototype.zeroBits=function(){if(this.isZero())return 0;for(var L=0,B=0;BL.length?this.clone().ior(L):L.clone().ior(this)},d.prototype.uor=function(L){return this.length>L.length?this.clone().iuor(L):L.clone().iuor(this)},d.prototype.iuand=function(L){var B;this.length>L.length?B=L:B=this;for(var O=0;OL.length?this.clone().iand(L):L.clone().iand(this)},d.prototype.uand=function(L){return this.length>L.length?this.clone().iuand(L):L.clone().iuand(this)},d.prototype.iuxor=function(L){var B,O;this.length>L.length?(B=this,O=L):(B=L,O=this);for(var G=0;GL.length?this.clone().ixor(L):L.clone().ixor(this)},d.prototype.uxor=function(L){return this.length>L.length?this.clone().iuxor(L):L.clone().iuxor(this)},d.prototype.inotn=function(L){f(typeof L=="number"&&L>=0);var B=Math.ceil(L/26)|0,O=L%26;this._expand(B),O>0&&B--;for(var G=0;G0&&(this.words[G]=~this.words[G]&67108863>>26-O,G++);G=0);var O=L/26|0,G=L%26;return this._expand(O+1),B?this.words[O]=this.words[O]|1<L.length?(O=this,G=L):(O=L,G=this);for(var W=0,X=0;X>>26;for(;W!==0&&X>>26;if(this.length=O.length,W!==0)this.words[this.length]=W,this.length++;else if(O!==this)for(;XL.length?this.clone().iadd(L):L.clone().iadd(this)},d.prototype.isub=function(L){if(L.negative!==0){L.negative=0;var B=this.iadd(L);return L.negative=1,B._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(L),this.negative=1,this._normSign();var O=this.cmp(L);if(O===0)return this.negative=0,this.length=1,this.words[0]=0,this;var G,W;O>0?(G=this,W=L):(G=L,W=this);for(var X=0,Z=0;Z>26,this.words[Z]=B&67108863;for(;X!==0&&Z>26,this.words[Z]=B&67108863;if(X===0&&Z>>26,$=J&67108863,U=Math.min(N,L.length-1),V=Math.max(0,N-I.length+1);V<=U;V++){var j=N-V|0;G=I.words[j]|0,W=L.words[V]|0,X=G*W+$,H+=X/67108864|0,$=X&67108863}B.words[N]=$|0,J=H|0}return J!==0?B.words[N]=J|0:B.length--,B.strip()}var C=function(L,B,O){var G=L.words,W=B.words,X=O.words,Z=0,J,N,H,$=G[0]|0,U=$&8191,V=$>>>13,j=G[1]|0,q=j&8191,Y=j>>>13,K=G[2]|0,te=K&8191,ne=K>>>13,se=G[3]|0,le=se&8191,ce=se>>>13,pe=G[4]|0,xe=pe&8191,ye=pe>>>13,fe=G[5]|0,ae=fe&8191,ee=fe>>>13,ie=G[6]|0,Q=ie&8191,ue=ie>>>13,ge=G[7]|0,Me=ge&8191,Te=ge>>>13,je=G[8]|0,Ve=je&8191,Ke=je>>>13,Je=G[9]|0,vt=Je&8191,xt=Je>>>13,Pt=W[0]|0,mt=Pt&8191,Mt=Pt>>>13,lt=W[1]|0,qe=lt&8191,Ye=lt>>>13,me=W[2]|0,_e=me&8191,Ae=me>>>13,ke=W[3]|0,Ee=ke&8191,De=ke>>>13,Qe=W[4]|0,Ue=Qe&8191,at=Qe>>>13,rt=W[5]|0,ht=rt&8191,At=rt>>>13,dt=W[6]|0,Ht=dt&8191,fr=dt>>>13,gt=W[7]|0,yt=gt&8191,kt=gt>>>13,Lt=W[8]|0,Ct=Lt&8191,$t=Lt>>>13,mr=W[9]|0,br=mr&8191,Er=mr>>>13;O.negative=L.negative^B.negative,O.length=19,J=Math.imul(U,mt),N=Math.imul(U,Mt),N=N+Math.imul(V,mt)|0,H=Math.imul(V,Mt);var Tr=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,J=Math.imul(q,mt),N=Math.imul(q,Mt),N=N+Math.imul(Y,mt)|0,H=Math.imul(Y,Mt),J=J+Math.imul(U,qe)|0,N=N+Math.imul(U,Ye)|0,N=N+Math.imul(V,qe)|0,H=H+Math.imul(V,Ye)|0;var Ur=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,J=Math.imul(te,mt),N=Math.imul(te,Mt),N=N+Math.imul(ne,mt)|0,H=Math.imul(ne,Mt),J=J+Math.imul(q,qe)|0,N=N+Math.imul(q,Ye)|0,N=N+Math.imul(Y,qe)|0,H=H+Math.imul(Y,Ye)|0,J=J+Math.imul(U,_e)|0,N=N+Math.imul(U,Ae)|0,N=N+Math.imul(V,_e)|0,H=H+Math.imul(V,Ae)|0;var Ai=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Ai>>>26)|0,Ai&=67108863,J=Math.imul(le,mt),N=Math.imul(le,Mt),N=N+Math.imul(ce,mt)|0,H=Math.imul(ce,Mt),J=J+Math.imul(te,qe)|0,N=N+Math.imul(te,Ye)|0,N=N+Math.imul(ne,qe)|0,H=H+Math.imul(ne,Ye)|0,J=J+Math.imul(q,_e)|0,N=N+Math.imul(q,Ae)|0,N=N+Math.imul(Y,_e)|0,H=H+Math.imul(Y,Ae)|0,J=J+Math.imul(U,Ee)|0,N=N+Math.imul(U,De)|0,N=N+Math.imul(V,Ee)|0,H=H+Math.imul(V,De)|0;var oi=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(oi>>>26)|0,oi&=67108863,J=Math.imul(xe,mt),N=Math.imul(xe,Mt),N=N+Math.imul(ye,mt)|0,H=Math.imul(ye,Mt),J=J+Math.imul(le,qe)|0,N=N+Math.imul(le,Ye)|0,N=N+Math.imul(ce,qe)|0,H=H+Math.imul(ce,Ye)|0,J=J+Math.imul(te,_e)|0,N=N+Math.imul(te,Ae)|0,N=N+Math.imul(ne,_e)|0,H=H+Math.imul(ne,Ae)|0,J=J+Math.imul(q,Ee)|0,N=N+Math.imul(q,De)|0,N=N+Math.imul(Y,Ee)|0,H=H+Math.imul(Y,De)|0,J=J+Math.imul(U,Ue)|0,N=N+Math.imul(U,at)|0,N=N+Math.imul(V,Ue)|0,H=H+Math.imul(V,at)|0;var Qr=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,J=Math.imul(ae,mt),N=Math.imul(ae,Mt),N=N+Math.imul(ee,mt)|0,H=Math.imul(ee,Mt),J=J+Math.imul(xe,qe)|0,N=N+Math.imul(xe,Ye)|0,N=N+Math.imul(ye,qe)|0,H=H+Math.imul(ye,Ye)|0,J=J+Math.imul(le,_e)|0,N=N+Math.imul(le,Ae)|0,N=N+Math.imul(ce,_e)|0,H=H+Math.imul(ce,Ae)|0,J=J+Math.imul(te,Ee)|0,N=N+Math.imul(te,De)|0,N=N+Math.imul(ne,Ee)|0,H=H+Math.imul(ne,De)|0,J=J+Math.imul(q,Ue)|0,N=N+Math.imul(q,at)|0,N=N+Math.imul(Y,Ue)|0,H=H+Math.imul(Y,at)|0,J=J+Math.imul(U,ht)|0,N=N+Math.imul(U,At)|0,N=N+Math.imul(V,ht)|0,H=H+Math.imul(V,At)|0;var ea=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(ea>>>26)|0,ea&=67108863,J=Math.imul(Q,mt),N=Math.imul(Q,Mt),N=N+Math.imul(ue,mt)|0,H=Math.imul(ue,Mt),J=J+Math.imul(ae,qe)|0,N=N+Math.imul(ae,Ye)|0,N=N+Math.imul(ee,qe)|0,H=H+Math.imul(ee,Ye)|0,J=J+Math.imul(xe,_e)|0,N=N+Math.imul(xe,Ae)|0,N=N+Math.imul(ye,_e)|0,H=H+Math.imul(ye,Ae)|0,J=J+Math.imul(le,Ee)|0,N=N+Math.imul(le,De)|0,N=N+Math.imul(ce,Ee)|0,H=H+Math.imul(ce,De)|0,J=J+Math.imul(te,Ue)|0,N=N+Math.imul(te,at)|0,N=N+Math.imul(ne,Ue)|0,H=H+Math.imul(ne,at)|0,J=J+Math.imul(q,ht)|0,N=N+Math.imul(q,At)|0,N=N+Math.imul(Y,ht)|0,H=H+Math.imul(Y,At)|0,J=J+Math.imul(U,Ht)|0,N=N+Math.imul(U,fr)|0,N=N+Math.imul(V,Ht)|0,H=H+Math.imul(V,fr)|0;var $i=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+($i>>>26)|0,$i&=67108863,J=Math.imul(Me,mt),N=Math.imul(Me,Mt),N=N+Math.imul(Te,mt)|0,H=Math.imul(Te,Mt),J=J+Math.imul(Q,qe)|0,N=N+Math.imul(Q,Ye)|0,N=N+Math.imul(ue,qe)|0,H=H+Math.imul(ue,Ye)|0,J=J+Math.imul(ae,_e)|0,N=N+Math.imul(ae,Ae)|0,N=N+Math.imul(ee,_e)|0,H=H+Math.imul(ee,Ae)|0,J=J+Math.imul(xe,Ee)|0,N=N+Math.imul(xe,De)|0,N=N+Math.imul(ye,Ee)|0,H=H+Math.imul(ye,De)|0,J=J+Math.imul(le,Ue)|0,N=N+Math.imul(le,at)|0,N=N+Math.imul(ce,Ue)|0,H=H+Math.imul(ce,at)|0,J=J+Math.imul(te,ht)|0,N=N+Math.imul(te,At)|0,N=N+Math.imul(ne,ht)|0,H=H+Math.imul(ne,At)|0,J=J+Math.imul(q,Ht)|0,N=N+Math.imul(q,fr)|0,N=N+Math.imul(Y,Ht)|0,H=H+Math.imul(Y,fr)|0,J=J+Math.imul(U,yt)|0,N=N+Math.imul(U,kt)|0,N=N+Math.imul(V,yt)|0,H=H+Math.imul(V,kt)|0;var ja=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(ja>>>26)|0,ja&=67108863,J=Math.imul(Ve,mt),N=Math.imul(Ve,Mt),N=N+Math.imul(Ke,mt)|0,H=Math.imul(Ke,Mt),J=J+Math.imul(Me,qe)|0,N=N+Math.imul(Me,Ye)|0,N=N+Math.imul(Te,qe)|0,H=H+Math.imul(Te,Ye)|0,J=J+Math.imul(Q,_e)|0,N=N+Math.imul(Q,Ae)|0,N=N+Math.imul(ue,_e)|0,H=H+Math.imul(ue,Ae)|0,J=J+Math.imul(ae,Ee)|0,N=N+Math.imul(ae,De)|0,N=N+Math.imul(ee,Ee)|0,H=H+Math.imul(ee,De)|0,J=J+Math.imul(xe,Ue)|0,N=N+Math.imul(xe,at)|0,N=N+Math.imul(ye,Ue)|0,H=H+Math.imul(ye,at)|0,J=J+Math.imul(le,ht)|0,N=N+Math.imul(le,At)|0,N=N+Math.imul(ce,ht)|0,H=H+Math.imul(ce,At)|0,J=J+Math.imul(te,Ht)|0,N=N+Math.imul(te,fr)|0,N=N+Math.imul(ne,Ht)|0,H=H+Math.imul(ne,fr)|0,J=J+Math.imul(q,yt)|0,N=N+Math.imul(q,kt)|0,N=N+Math.imul(Y,yt)|0,H=H+Math.imul(Y,kt)|0,J=J+Math.imul(U,Ct)|0,N=N+Math.imul(U,$t)|0,N=N+Math.imul(V,Ct)|0,H=H+Math.imul(V,$t)|0;var ya=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(ya>>>26)|0,ya&=67108863,J=Math.imul(vt,mt),N=Math.imul(vt,Mt),N=N+Math.imul(xt,mt)|0,H=Math.imul(xt,Mt),J=J+Math.imul(Ve,qe)|0,N=N+Math.imul(Ve,Ye)|0,N=N+Math.imul(Ke,qe)|0,H=H+Math.imul(Ke,Ye)|0,J=J+Math.imul(Me,_e)|0,N=N+Math.imul(Me,Ae)|0,N=N+Math.imul(Te,_e)|0,H=H+Math.imul(Te,Ae)|0,J=J+Math.imul(Q,Ee)|0,N=N+Math.imul(Q,De)|0,N=N+Math.imul(ue,Ee)|0,H=H+Math.imul(ue,De)|0,J=J+Math.imul(ae,Ue)|0,N=N+Math.imul(ae,at)|0,N=N+Math.imul(ee,Ue)|0,H=H+Math.imul(ee,at)|0,J=J+Math.imul(xe,ht)|0,N=N+Math.imul(xe,At)|0,N=N+Math.imul(ye,ht)|0,H=H+Math.imul(ye,At)|0,J=J+Math.imul(le,Ht)|0,N=N+Math.imul(le,fr)|0,N=N+Math.imul(ce,Ht)|0,H=H+Math.imul(ce,fr)|0,J=J+Math.imul(te,yt)|0,N=N+Math.imul(te,kt)|0,N=N+Math.imul(ne,yt)|0,H=H+Math.imul(ne,kt)|0,J=J+Math.imul(q,Ct)|0,N=N+Math.imul(q,$t)|0,N=N+Math.imul(Y,Ct)|0,H=H+Math.imul(Y,$t)|0,J=J+Math.imul(U,br)|0,N=N+Math.imul(U,Er)|0,N=N+Math.imul(V,br)|0,H=H+Math.imul(V,Er)|0;var pa=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(pa>>>26)|0,pa&=67108863,J=Math.imul(vt,qe),N=Math.imul(vt,Ye),N=N+Math.imul(xt,qe)|0,H=Math.imul(xt,Ye),J=J+Math.imul(Ve,_e)|0,N=N+Math.imul(Ve,Ae)|0,N=N+Math.imul(Ke,_e)|0,H=H+Math.imul(Ke,Ae)|0,J=J+Math.imul(Me,Ee)|0,N=N+Math.imul(Me,De)|0,N=N+Math.imul(Te,Ee)|0,H=H+Math.imul(Te,De)|0,J=J+Math.imul(Q,Ue)|0,N=N+Math.imul(Q,at)|0,N=N+Math.imul(ue,Ue)|0,H=H+Math.imul(ue,at)|0,J=J+Math.imul(ae,ht)|0,N=N+Math.imul(ae,At)|0,N=N+Math.imul(ee,ht)|0,H=H+Math.imul(ee,At)|0,J=J+Math.imul(xe,Ht)|0,N=N+Math.imul(xe,fr)|0,N=N+Math.imul(ye,Ht)|0,H=H+Math.imul(ye,fr)|0,J=J+Math.imul(le,yt)|0,N=N+Math.imul(le,kt)|0,N=N+Math.imul(ce,yt)|0,H=H+Math.imul(ce,kt)|0,J=J+Math.imul(te,Ct)|0,N=N+Math.imul(te,$t)|0,N=N+Math.imul(ne,Ct)|0,H=H+Math.imul(ne,$t)|0,J=J+Math.imul(q,br)|0,N=N+Math.imul(q,Er)|0,N=N+Math.imul(Y,br)|0,H=H+Math.imul(Y,Er)|0;var xi=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(xi>>>26)|0,xi&=67108863,J=Math.imul(vt,_e),N=Math.imul(vt,Ae),N=N+Math.imul(xt,_e)|0,H=Math.imul(xt,Ae),J=J+Math.imul(Ve,Ee)|0,N=N+Math.imul(Ve,De)|0,N=N+Math.imul(Ke,Ee)|0,H=H+Math.imul(Ke,De)|0,J=J+Math.imul(Me,Ue)|0,N=N+Math.imul(Me,at)|0,N=N+Math.imul(Te,Ue)|0,H=H+Math.imul(Te,at)|0,J=J+Math.imul(Q,ht)|0,N=N+Math.imul(Q,At)|0,N=N+Math.imul(ue,ht)|0,H=H+Math.imul(ue,At)|0,J=J+Math.imul(ae,Ht)|0,N=N+Math.imul(ae,fr)|0,N=N+Math.imul(ee,Ht)|0,H=H+Math.imul(ee,fr)|0,J=J+Math.imul(xe,yt)|0,N=N+Math.imul(xe,kt)|0,N=N+Math.imul(ye,yt)|0,H=H+Math.imul(ye,kt)|0,J=J+Math.imul(le,Ct)|0,N=N+Math.imul(le,$t)|0,N=N+Math.imul(ce,Ct)|0,H=H+Math.imul(ce,$t)|0,J=J+Math.imul(te,br)|0,N=N+Math.imul(te,Er)|0,N=N+Math.imul(ne,br)|0,H=H+Math.imul(ne,Er)|0;var bi=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(bi>>>26)|0,bi&=67108863,J=Math.imul(vt,Ee),N=Math.imul(vt,De),N=N+Math.imul(xt,Ee)|0,H=Math.imul(xt,De),J=J+Math.imul(Ve,Ue)|0,N=N+Math.imul(Ve,at)|0,N=N+Math.imul(Ke,Ue)|0,H=H+Math.imul(Ke,at)|0,J=J+Math.imul(Me,ht)|0,N=N+Math.imul(Me,At)|0,N=N+Math.imul(Te,ht)|0,H=H+Math.imul(Te,At)|0,J=J+Math.imul(Q,Ht)|0,N=N+Math.imul(Q,fr)|0,N=N+Math.imul(ue,Ht)|0,H=H+Math.imul(ue,fr)|0,J=J+Math.imul(ae,yt)|0,N=N+Math.imul(ae,kt)|0,N=N+Math.imul(ee,yt)|0,H=H+Math.imul(ee,kt)|0,J=J+Math.imul(xe,Ct)|0,N=N+Math.imul(xe,$t)|0,N=N+Math.imul(ye,Ct)|0,H=H+Math.imul(ye,$t)|0,J=J+Math.imul(le,br)|0,N=N+Math.imul(le,Er)|0,N=N+Math.imul(ce,br)|0,H=H+Math.imul(ce,Er)|0;var Ua=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Ua>>>26)|0,Ua&=67108863,J=Math.imul(vt,Ue),N=Math.imul(vt,at),N=N+Math.imul(xt,Ue)|0,H=Math.imul(xt,at),J=J+Math.imul(Ve,ht)|0,N=N+Math.imul(Ve,At)|0,N=N+Math.imul(Ke,ht)|0,H=H+Math.imul(Ke,At)|0,J=J+Math.imul(Me,Ht)|0,N=N+Math.imul(Me,fr)|0,N=N+Math.imul(Te,Ht)|0,H=H+Math.imul(Te,fr)|0,J=J+Math.imul(Q,yt)|0,N=N+Math.imul(Q,kt)|0,N=N+Math.imul(ue,yt)|0,H=H+Math.imul(ue,kt)|0,J=J+Math.imul(ae,Ct)|0,N=N+Math.imul(ae,$t)|0,N=N+Math.imul(ee,Ct)|0,H=H+Math.imul(ee,$t)|0,J=J+Math.imul(xe,br)|0,N=N+Math.imul(xe,Er)|0,N=N+Math.imul(ye,br)|0,H=H+Math.imul(ye,Er)|0;var dn=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(dn>>>26)|0,dn&=67108863,J=Math.imul(vt,ht),N=Math.imul(vt,At),N=N+Math.imul(xt,ht)|0,H=Math.imul(xt,At),J=J+Math.imul(Ve,Ht)|0,N=N+Math.imul(Ve,fr)|0,N=N+Math.imul(Ke,Ht)|0,H=H+Math.imul(Ke,fr)|0,J=J+Math.imul(Me,yt)|0,N=N+Math.imul(Me,kt)|0,N=N+Math.imul(Te,yt)|0,H=H+Math.imul(Te,kt)|0,J=J+Math.imul(Q,Ct)|0,N=N+Math.imul(Q,$t)|0,N=N+Math.imul(ue,Ct)|0,H=H+Math.imul(ue,$t)|0,J=J+Math.imul(ae,br)|0,N=N+Math.imul(ae,Er)|0,N=N+Math.imul(ee,br)|0,H=H+Math.imul(ee,Er)|0;var pi=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(pi>>>26)|0,pi&=67108863,J=Math.imul(vt,Ht),N=Math.imul(vt,fr),N=N+Math.imul(xt,Ht)|0,H=Math.imul(xt,fr),J=J+Math.imul(Ve,yt)|0,N=N+Math.imul(Ve,kt)|0,N=N+Math.imul(Ke,yt)|0,H=H+Math.imul(Ke,kt)|0,J=J+Math.imul(Me,Ct)|0,N=N+Math.imul(Me,$t)|0,N=N+Math.imul(Te,Ct)|0,H=H+Math.imul(Te,$t)|0,J=J+Math.imul(Q,br)|0,N=N+Math.imul(Q,Er)|0,N=N+Math.imul(ue,br)|0,H=H+Math.imul(ue,Er)|0;var Jr=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,J=Math.imul(vt,yt),N=Math.imul(vt,kt),N=N+Math.imul(xt,yt)|0,H=Math.imul(xt,kt),J=J+Math.imul(Ve,Ct)|0,N=N+Math.imul(Ve,$t)|0,N=N+Math.imul(Ke,Ct)|0,H=H+Math.imul(Ke,$t)|0,J=J+Math.imul(Me,br)|0,N=N+Math.imul(Me,Er)|0,N=N+Math.imul(Te,br)|0,H=H+Math.imul(Te,Er)|0;var Be=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Be>>>26)|0,Be&=67108863,J=Math.imul(vt,Ct),N=Math.imul(vt,$t),N=N+Math.imul(xt,Ct)|0,H=Math.imul(xt,$t),J=J+Math.imul(Ve,br)|0,N=N+Math.imul(Ve,Er)|0,N=N+Math.imul(Ke,br)|0,H=H+Math.imul(Ke,Er)|0;var Fe=(Z+J|0)+((N&8191)<<13)|0;Z=(H+(N>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,J=Math.imul(vt,br),N=Math.imul(vt,Er),N=N+Math.imul(xt,br)|0,H=Math.imul(xt,Er);var Et=(Z+J|0)+((N&8191)<<13)|0;return Z=(H+(N>>>13)|0)+(Et>>>26)|0,Et&=67108863,X[0]=Tr,X[1]=Ur,X[2]=Ai,X[3]=oi,X[4]=Qr,X[5]=ea,X[6]=$i,X[7]=ja,X[8]=ya,X[9]=pa,X[10]=xi,X[11]=bi,X[12]=Ua,X[13]=dn,X[14]=pi,X[15]=Jr,X[16]=Be,X[17]=Fe,X[18]=Et,Z!==0&&(X[19]=Z,O.length++),O};Math.imul||(C=M);function w(I,L,B){B.negative=L.negative^I.negative,B.length=I.length+L.length;for(var O=0,G=0,W=0;W>>26)|0,G+=X>>>26,X&=67108863}B.words[W]=Z,O=X,X=G}return O!==0?B.words[W]=O:B.length--,B.strip()}function k(I,L,B){var O=new A;return O.mulp(I,L,B)}d.prototype.mulTo=function(L,B){var O,G=this.length+L.length;return this.length===10&&L.length===10?O=C(this,L,B):G<63?O=M(this,L,B):G<1024?O=w(this,L,B):O=k(this,L,B),O};function A(I,L){this.x=I,this.y=L}A.prototype.makeRBT=function(L){for(var B=new Array(L),O=d.prototype._countBits(L)-1,G=0;G>=1;return G},A.prototype.permute=function(L,B,O,G,W,X){for(var Z=0;Z>>1)W++;return 1<>>13,O[2*X+1]=W&8191,W=W>>>13;for(X=2*B;X>=26,B+=G/67108864|0,B+=W>>>26,this.words[O]=W&67108863}return B!==0&&(this.words[O]=B,this.length++),L===0&&(this.length=1,this._normSign()),this},d.prototype.muln=function(L){return this.clone().imuln(L)},d.prototype.sqr=function(){return this.mul(this)},d.prototype.isqr=function(){return this.imul(this.clone())},d.prototype.pow=function(L){var B=S(L);if(B.length===0)return new d(1);for(var O=this,G=0;G=0);var B=L%26,O=(L-B)/26,G=67108863>>>26-B<<26-B,W;if(B!==0){var X=0;for(W=0;W>>26-B}X&&(this.words[W]=X,this.length++)}if(O!==0){for(W=this.length-1;W>=0;W--)this.words[W+O]=this.words[W];for(W=0;W=0);var G;B?G=(B-B%26)/26:G=0;var W=L%26,X=Math.min((L-W)/26,this.length),Z=67108863^67108863>>>W<X)for(this.length-=X,N=0;N=0&&(H!==0||N>=G);N--){var $=this.words[N]|0;this.words[N]=H<<26-W|$>>>W,H=$&Z}return J&&H!==0&&(J.words[J.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},d.prototype.ishrn=function(L,B,O){return f(this.negative===0),this.iushrn(L,B,O)},d.prototype.shln=function(L){return this.clone().ishln(L)},d.prototype.ushln=function(L){return this.clone().iushln(L)},d.prototype.shrn=function(L){return this.clone().ishrn(L)},d.prototype.ushrn=function(L){return this.clone().iushrn(L)},d.prototype.testn=function(L){f(typeof L=="number"&&L>=0);var B=L%26,O=(L-B)/26,G=1<=0);var B=L%26,O=(L-B)/26;if(f(this.negative===0,"imaskn works only with positive numbers"),this.length<=O)return this;if(B!==0&&O++,this.length=Math.min(O,this.length),B!==0){var G=67108863^67108863>>>B<=67108864;B++)this.words[B]-=67108864,B===this.length-1?this.words[B+1]=1:this.words[B+1]++;return this.length=Math.max(this.length,B+1),this},d.prototype.isubn=function(L){if(f(typeof L=="number"),f(L<67108864),L<0)return this.iaddn(-L);if(this.negative!==0)return this.negative=0,this.iaddn(L),this.negative=1,this;if(this.words[0]-=L,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var B=0;B>26)-(J/67108864|0),this.words[W+O]=X&67108863}for(;W>26,this.words[W+O]=X&67108863;if(Z===0)return this.strip();for(f(Z===-1),Z=0,W=0;W>26,this.words[W]=X&67108863;return this.negative=1,this.strip()},d.prototype._wordDiv=function(L,B){var O=this.length-L.length,G=this.clone(),W=L,X=W.words[W.length-1]|0,Z=this._countBits(X);O=26-Z,O!==0&&(W=W.ushln(O),G.iushln(O),X=W.words[W.length-1]|0);var J=G.length-W.length,N;if(B!=="mod"){N=new d(null),N.length=J+1,N.words=new Array(N.length);for(var H=0;H=0;U--){var V=(G.words[W.length+U]|0)*67108864+(G.words[W.length+U-1]|0);for(V=Math.min(V/X|0,67108863),G._ishlnsubmul(W,V,U);G.negative!==0;)V--,G.negative=0,G._ishlnsubmul(W,1,U),G.isZero()||(G.negative^=1);N&&(N.words[U]=V)}return N&&N.strip(),G.strip(),B!=="div"&&O!==0&&G.iushrn(O),{div:N||null,mod:G}},d.prototype.divmod=function(L,B,O){if(f(!L.isZero()),this.isZero())return{div:new d(0),mod:new d(0)};var G,W,X;return this.negative!==0&&L.negative===0?(X=this.neg().divmod(L,B),B!=="mod"&&(G=X.div.neg()),B!=="div"&&(W=X.mod.neg(),O&&W.negative!==0&&W.iadd(L)),{div:G,mod:W}):this.negative===0&&L.negative!==0?(X=this.divmod(L.neg(),B),B!=="mod"&&(G=X.div.neg()),{div:G,mod:X.mod}):(this.negative&L.negative)!==0?(X=this.neg().divmod(L.neg(),B),B!=="div"&&(W=X.mod.neg(),O&&W.negative!==0&&W.isub(L)),{div:X.div,mod:W}):L.length>this.length||this.cmp(L)<0?{div:new d(0),mod:this}:L.length===1?B==="div"?{div:this.divn(L.words[0]),mod:null}:B==="mod"?{div:null,mod:new d(this.modn(L.words[0]))}:{div:this.divn(L.words[0]),mod:new d(this.modn(L.words[0]))}:this._wordDiv(L,B)},d.prototype.div=function(L){return this.divmod(L,"div",!1).div},d.prototype.mod=function(L){return this.divmod(L,"mod",!1).mod},d.prototype.umod=function(L){return this.divmod(L,"mod",!0).mod},d.prototype.divRound=function(L){var B=this.divmod(L);if(B.mod.isZero())return B.div;var O=B.mod.abs(),G=L.abs().iushrn(1),W=L.words[0]&1,X=O.cmp(G);if(X<0||W===1&&X===0)return B.div;var Z=new d(1);return Z.negative=this.negative^L.negative,B.div.iadd(Z)},d.prototype.modn=function(L){f(L<=67108863);for(var B=(1<<26)%L,O=0,G=this.length-1;G>=0;G--)O=(B*O+(this.words[G]|0))%L;return O},d.prototype.idivn=function(L){f(L<=67108863);for(var B=0,O=this.length-1;O>=0;O--){var G=(this.words[O]|0)+B*67108864;this.words[O]=G/L|0,B=G%L}return this.strip()},d.prototype.divn=function(L){return this.clone().idivn(L)},d.prototype.egcd=function(L){f(L.negative===0),f(!L.isZero());var B=this,O=L.clone();B.negative!==0?B=B.umod(L):B=B.clone();for(var G=new d(1),W=new d(0),X=new d(0),Z=new d(1),J=0;B.isEven()&&O.isEven();)B.iushrn(1),O.iushrn(1),++J;for(var N=O.clone(),H=B.clone();!B.isZero();){for(var $=0,U=1;(B.words[0]&U)===0&&$<26;++$,U<<=1);if($>0)for(B.iushrn($);$-- >0;)(G.isOdd()||W.isOdd())&&(G.iadd(N),W.isub(H)),G.iushrn(1),W.iushrn(1);for(var V=0,j=1;(O.words[0]&j)===0&&V<26;++V,j<<=1);if(V>0)for(O.iushrn(V);V-- >0;)(X.isOdd()||Z.isOdd())&&(X.iadd(N),Z.isub(H)),X.iushrn(1),Z.iushrn(1);B.cmp(O)>=0?(B.isub(O),G.isub(X),W.isub(Z)):(O.isub(B),X.isub(G),Z.isub(W))}return{a:X,b:Z,gcd:O.iushln(J)}},d.prototype._invmp=function(L){f(L.negative===0),f(!L.isZero());var B=this,O=L.clone();B.negative!==0?B=B.umod(L):B=B.clone();for(var G=new d(1),W=new d(0),X=O.clone();B.cmpn(1)>0&&O.cmpn(1)>0;){for(var Z=0,J=1;(B.words[0]&J)===0&&Z<26;++Z,J<<=1);if(Z>0)for(B.iushrn(Z);Z-- >0;)G.isOdd()&&G.iadd(X),G.iushrn(1);for(var N=0,H=1;(O.words[0]&H)===0&&N<26;++N,H<<=1);if(N>0)for(O.iushrn(N);N-- >0;)W.isOdd()&&W.iadd(X),W.iushrn(1);B.cmp(O)>=0?(B.isub(O),G.isub(W)):(O.isub(B),W.isub(G))}var $;return B.cmpn(1)===0?$=G:$=W,$.cmpn(0)<0&&$.iadd(L),$},d.prototype.gcd=function(L){if(this.isZero())return L.abs();if(L.isZero())return this.abs();var B=this.clone(),O=L.clone();B.negative=0,O.negative=0;for(var G=0;B.isEven()&&O.isEven();G++)B.iushrn(1),O.iushrn(1);do{for(;B.isEven();)B.iushrn(1);for(;O.isEven();)O.iushrn(1);var W=B.cmp(O);if(W<0){var X=B;B=O,O=X}else if(W===0||O.cmpn(1)===0)break;B.isub(O)}while(!0);return O.iushln(G)},d.prototype.invm=function(L){return this.egcd(L).a.umod(L)},d.prototype.isEven=function(){return(this.words[0]&1)===0},d.prototype.isOdd=function(){return(this.words[0]&1)===1},d.prototype.andln=function(L){return this.words[0]&L},d.prototype.bincn=function(L){f(typeof L=="number");var B=L%26,O=(L-B)/26,G=1<>>26,Z&=67108863,this.words[X]=Z}return W!==0&&(this.words[X]=W,this.length++),this},d.prototype.isZero=function(){return this.length===1&&this.words[0]===0},d.prototype.cmpn=function(L){var B=L<0;if(this.negative!==0&&!B)return-1;if(this.negative===0&&B)return 1;this.strip();var O;if(this.length>1)O=1;else{B&&(L=-L),f(L<=67108863,"Number is too big");var G=this.words[0]|0;O=G===L?0:GL.length)return 1;if(this.length=0;O--){var G=this.words[O]|0,W=L.words[O]|0;if(G!==W){GW&&(B=1);break}}return B},d.prototype.gtn=function(L){return this.cmpn(L)===1},d.prototype.gt=function(L){return this.cmp(L)===1},d.prototype.gten=function(L){return this.cmpn(L)>=0},d.prototype.gte=function(L){return this.cmp(L)>=0},d.prototype.ltn=function(L){return this.cmpn(L)===-1},d.prototype.lt=function(L){return this.cmp(L)===-1},d.prototype.lten=function(L){return this.cmpn(L)<=0},d.prototype.lte=function(L){return this.cmp(L)<=0},d.prototype.eqn=function(L){return this.cmpn(L)===0},d.prototype.eq=function(L){return this.cmp(L)===0},d.red=function(L){return new P(L)},d.prototype.toRed=function(L){return f(!this.red,"Already a number in reduction context"),f(this.negative===0,"red works only with positives"),L.convertTo(this)._forceRed(L)},d.prototype.fromRed=function(){return f(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},d.prototype._forceRed=function(L){return this.red=L,this},d.prototype.forceRed=function(L){return f(!this.red,"Already a number in reduction context"),this._forceRed(L)},d.prototype.redAdd=function(L){return f(this.red,"redAdd works only with red numbers"),this.red.add(this,L)},d.prototype.redIAdd=function(L){return f(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,L)},d.prototype.redSub=function(L){return f(this.red,"redSub works only with red numbers"),this.red.sub(this,L)},d.prototype.redISub=function(L){return f(this.red,"redISub works only with red numbers"),this.red.isub(this,L)},d.prototype.redShl=function(L){return f(this.red,"redShl works only with red numbers"),this.red.shl(this,L)},d.prototype.redMul=function(L){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.mul(this,L)},d.prototype.redIMul=function(L){return f(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.imul(this,L)},d.prototype.redSqr=function(){return f(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},d.prototype.redISqr=function(){return f(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},d.prototype.redSqrt=function(){return f(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},d.prototype.redInvm=function(){return f(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},d.prototype.redNeg=function(){return f(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},d.prototype.redPow=function(L){return f(this.red&&!L.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,L)};var b={k256:null,p224:null,p192:null,p25519:null};function E(I,L){this.name=I,this.p=new d(L,16),this.n=this.p.bitLength(),this.k=new d(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}E.prototype._tmp=function(){var L=new d(null);return L.words=new Array(Math.ceil(this.n/13)),L},E.prototype.ireduce=function(L){var B=L,O;do this.split(B,this.tmp),B=this.imulK(B),B=B.iadd(this.tmp),O=B.bitLength();while(O>this.n);var G=O0?B.isub(this.p):B.strip!==void 0?B.strip():B._strip(),B},E.prototype.split=function(L,B){L.iushrn(this.n,0,B)},E.prototype.imulK=function(L){return L.imul(this.k)};function T(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}h(T,E),T.prototype.split=function(L,B){for(var O=4194303,G=Math.min(L.length,9),W=0;W>>22,X=Z}X>>>=22,L.words[W-10]=X,X===0&&L.length>10?L.length-=10:L.length-=9},T.prototype.imulK=function(L){L.words[L.length]=0,L.words[L.length+1]=0,L.length+=2;for(var B=0,O=0;O>>=26,L.words[O]=W,B=G}return B!==0&&(L.words[L.length++]=B),L},d._prime=function(L){if(b[L])return b[L];var B;if(L==="k256")B=new T;else if(L==="p224")B=new F;else if(L==="p192")B=new D;else if(L==="p25519")B=new R;else throw new Error("Unknown prime "+L);return b[L]=B,B};function P(I){if(typeof I=="string"){var L=d._prime(I);this.m=L.p,this.prime=L}else f(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}P.prototype._verify1=function(L){f(L.negative===0,"red works only with positives"),f(L.red,"red works only with red numbers")},P.prototype._verify2=function(L,B){f((L.negative|B.negative)===0,"red works only with positives"),f(L.red&&L.red===B.red,"red works only with red numbers")},P.prototype.imod=function(L){return this.prime?this.prime.ireduce(L)._forceRed(this):L.umod(this.m)._forceRed(this)},P.prototype.neg=function(L){return L.isZero()?L.clone():this.m.sub(L)._forceRed(this)},P.prototype.add=function(L,B){this._verify2(L,B);var O=L.add(B);return O.cmp(this.m)>=0&&O.isub(this.m),O._forceRed(this)},P.prototype.iadd=function(L,B){this._verify2(L,B);var O=L.iadd(B);return O.cmp(this.m)>=0&&O.isub(this.m),O},P.prototype.sub=function(L,B){this._verify2(L,B);var O=L.sub(B);return O.cmpn(0)<0&&O.iadd(this.m),O._forceRed(this)},P.prototype.isub=function(L,B){this._verify2(L,B);var O=L.isub(B);return O.cmpn(0)<0&&O.iadd(this.m),O},P.prototype.shl=function(L,B){return this._verify1(L),this.imod(L.ushln(B))},P.prototype.imul=function(L,B){return this._verify2(L,B),this.imod(L.imul(B))},P.prototype.mul=function(L,B){return this._verify2(L,B),this.imod(L.mul(B))},P.prototype.isqr=function(L){return this.imul(L,L.clone())},P.prototype.sqr=function(L){return this.mul(L,L)},P.prototype.sqrt=function(L){if(L.isZero())return L.clone();var B=this.m.andln(3);if(f(B%2===1),B===3){var O=this.m.add(new d(1)).iushrn(2);return this.pow(L,O)}for(var G=this.m.subn(1),W=0;!G.isZero()&&G.andln(1)===0;)W++,G.iushrn(1);f(!G.isZero());var X=new d(1).toRed(this),Z=X.redNeg(),J=this.m.subn(1).iushrn(1),N=this.m.bitLength();for(N=new d(2*N*N).toRed(this);this.pow(N,J).cmp(Z)!==0;)N.redIAdd(Z);for(var H=this.pow(N,G),$=this.pow(L,G.addn(1).iushrn(1)),U=this.pow(L,G),V=W;U.cmp(X)!==0;){for(var j=U,q=0;j.cmp(X)!==0;q++)j=j.redSqr();f(q=0;W--){for(var H=B.words[W],$=N-1;$>=0;$--){var U=H>>$&1;if(X!==G[0]&&(X=this.sqr(X)),U===0&&Z===0){J=0;continue}Z<<=1,Z|=U,J++,!(J!==O&&(W!==0||$!==0))&&(X=this.mul(X,G[Z]),J=0,Z=0)}N=26}return X},P.prototype.convertTo=function(L){var B=L.umod(this.m);return B===L?B.clone():B},P.prototype.convertFrom=function(L){var B=L.clone();return B.red=null,B},d.mont=function(L){return new z(L)};function z(I){P.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new d(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}h(z,P),z.prototype.convertTo=function(L){return this.imod(L.ushln(this.shift))},z.prototype.convertFrom=function(L){var B=this.imod(L.mul(this.rinv));return B.red=null,B},z.prototype.imul=function(L,B){if(L.isZero()||B.isZero())return L.words[0]=0,L.length=1,L;var O=L.imul(B),G=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),W=O.isub(G).iushrn(this.shift),X=W;return W.cmp(this.m)>=0?X=W.isub(this.m):W.cmpn(0)<0&&(X=W.iadd(this.m)),X._forceRed(this)},z.prototype.mul=function(L,B){if(L.isZero()||B.isZero())return new d(0)._forceRed(this);var O=L.mul(B),G=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),W=O.isub(G).iushrn(this.shift),X=W;return W.cmp(this.m)>=0?X=W.isub(this.m):W.cmpn(0)<0&&(X=W.iadd(this.m)),X._forceRed(this)},z.prototype.invm=function(L){var B=this.imod(L._invmp(this.m).mul(this.r2));return B._forceRed(this)}})(s,this)},6204(s){"use strict";s.exports=l;function l(n){var u,c,f,h=n.length,d=0;for(u=0;u>>1;if(!(A<=0)){var b,E=u.mallocDouble(2*A*w),T=u.mallocInt32(w);if(w=d(x,A,E,T),w>0){if(A===1&&C)c.init(w),b=c.sweepComplete(A,M,0,w,E,T,0,w,E,T);else{var F=u.mallocDouble(2*A*k),D=u.mallocInt32(k);k=d(S,A,F,D),k>0&&(c.init(w+k),A===1?b=c.sweepBipartite(A,M,0,w,E,T,0,k,F,D):b=f(A,M,C,w,E,T,k,F,D),u.free(F),u.free(D))}u.free(E),u.free(T)}return b}}}var g;function m(x,S){g.push([x,S])}function y(x){return g=[],p(x,x,m,!0),g}function _(x,S){return g=[],p(x,S,m,!1),g}function v(x,S,M){switch(arguments.length){case 1:return y(x);case 2:return typeof S=="function"?p(x,x,S,!0):_(x,S);case 3:return p(x,S,M,!1);default:throw new Error("box-intersect: Invalid arguments")}}},2455(s,l){"use strict";function n(){function f(p,g,m,y,_,v,x,S,M,C,w){for(var k=2*p,A=y,b=k*y;A<_;++A,b+=k){var E=v[g+b],T=v[g+b+p],F=x[A];e:for(var D=S,R=k*S;DM-S?f(p,g,m,y,_,v,x,S,M,C,w):h(p,g,m,y,_,v,x,S,M,C,w)}return d}function u(){function f(m,y,_,v,x,S,M,C,w,k,A){for(var b=2*m,E=v,T=b*v;Ek-w?v?f(m,y,_,x,S,M,C,w,k,A,b):h(m,y,_,x,S,M,C,w,k,A,b):v?d(m,y,_,x,S,M,C,w,k,A,b):p(m,y,_,x,S,M,C,w,k,A,b)}return g}function c(f){return f?n():u()}l.partial=c(!1),l.full=c(!0)},7150(s,l,n){"use strict";s.exports=I;var u=n(1888),c=n(8828),f=n(2455),h=f.partial,d=f.full,p=n(855),g=n(3545),m=n(8105),y=128,_=1<<22,v=1<<22,x=m("!(lo>=p0)&&!(p1>=hi)"),S=m("lo===p0"),M=m("lo0;){H-=1;var V=H*A,j=T[V],q=T[V+1],Y=T[V+2],K=T[V+3],te=T[V+4],ne=T[V+5],se=H*b,le=F[se],ce=F[se+1],pe=ne&1,xe=!!(ne&16),ye=W,fe=X,ae=J,ee=N;if(pe&&(ye=J,fe=N,ae=W,ee=X),!(ne&2&&(Y=M(L,j,q,Y,ye,fe,ce),q>=Y))&&!(ne&4&&(q=C(L,j,q,Y,ye,fe,le),q>=Y))){var ie=Y-q,Q=te-K;if(xe){if(L*ie*(ie+Q)m&&_[k+g]>C;--w,k-=x){for(var A=k,b=k+x,E=0;E>>1,C=2*p,w=M,k=_[C*M+g];x=F?(w=T,k=F):E>=R?(w=b,k=E):(w=D,k=R):F>=R?(w=T,k=F):R>=E?(w=b,k=E):(w=D,k=R);for(var I=C*(S-1),L=C*w,P=0;P=p0)&&!(p1>=hi)":g};function n(m){return l[m]}function u(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+b];if(F===M)if(A===T)A+=1,k+=C;else{for(var D=0;C>D;++D){var R=x[w+D];x[w+D]=x[k],x[k++]=R}var P=S[T];S[T]=S[A],S[A++]=P}}return A}function c(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+b];if(FD;++D){var R=x[w+D];x[w+D]=x[k],x[k++]=R}var P=S[T];S[T]=S[A],S[A++]=P}}return A}function f(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+E];if(F<=M)if(A===T)A+=1,k+=C;else{for(var D=0;C>D;++D){var R=x[w+D];x[w+D]=x[k],x[k++]=R}var P=S[T];S[T]=S[A],S[A++]=P}}return A}function h(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+E];if(F<=M)if(A===T)A+=1,k+=C;else{for(var D=0;C>D;++D){var R=x[w+D];x[w+D]=x[k],x[k++]=R}var P=S[T];S[T]=S[A],S[A++]=P}}return A}function d(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+b],D=x[w+E];if(F<=M&&M<=D)if(A===T)A+=1,k+=C;else{for(var R=0;C>R;++R){var P=x[w+R];x[w+R]=x[k],x[k++]=P}var z=S[T];S[T]=S[A],S[A++]=z}}return A}function p(m,y,_,v,x,S,M){for(var C=2*m,w=C*_,k=w,A=_,b=y,E=m+y,T=_;v>T;++T,w+=C){var F=x[w+b],D=x[w+E];if(FR;++R){var P=x[w+R];x[w+R]=x[k],x[k++]=P}var z=S[T];S[T]=S[A],S[A++]=z}}return A}function g(m,y,_,v,x,S,M,C){for(var w=2*m,k=w*_,A=k,b=_,E=y,T=m+y,F=_;v>F;++F,k+=w){var D=x[k+E],R=x[k+T];if(!(D>=M)&&!(C>=R))if(b===F)b+=1,A+=w;else{for(var P=0;w>P;++P){var z=x[k+P];x[k+P]=x[A],x[A++]=z}var I=S[F];S[F]=S[b],S[b++]=I}}return b}},4192(s){"use strict";s.exports=n;var l=32;function n(y,_){_<=4*l?u(0,_-1,y):m(0,_-1,y)}function u(y,_,v){for(var x=2*(y+1),S=y+1;S<=_;++S){for(var M=v[x++],C=v[x++],w=S,k=x-2;w-- >y;){var A=v[k-2],b=v[k-1];if(Av[_+1]:!0}function g(y,_,v,x){y*=2;var S=x[y];return S<_?!0:S===_?x[y+1]>1,w=C-x,k=C+x,A=S,b=w,E=C,T=k,F=M,D=y+1,R=_-1,P=0;p(A,b,v)&&(P=A,A=b,b=P),p(T,F,v)&&(P=T,T=F,F=P),p(A,E,v)&&(P=A,A=E,E=P),p(b,E,v)&&(P=b,b=E,E=P),p(A,T,v)&&(P=A,A=T,T=P),p(E,T,v)&&(P=E,E=T,T=P),p(b,F,v)&&(P=b,b=F,F=P),p(b,E,v)&&(P=b,b=E,E=P),p(T,F,v)&&(P=T,T=F,F=P);for(var z=v[2*b],I=v[2*b+1],L=v[2*T],B=v[2*T+1],O=2*A,G=2*E,W=2*F,X=2*S,Z=2*C,J=2*M,N=0;N<2;++N){var H=v[O+N],$=v[G+N],U=v[W+N];v[X+N]=H,v[Z+N]=$,v[J+N]=U}f(w,y,v),f(k,_,v);for(var V=D;V<=R;++V)if(g(V,z,I,v))V!==D&&c(V,D,v),++D;else if(!g(V,L,B,v))for(;;)if(g(R,L,B,v)){g(R,z,I,v)?(h(V,D,R,v),++D,--R):(c(V,R,v),--R);break}else{if(--R>>1;f(x,$);for(var U=0,V=0,Z=0;Z<$;++Z){var j=x[2*Z+1]|0;if(j>=h)j=j-h|0,M(m,y,V--,j);else if(j>=0)M(p,g,U--,j);else if(j<=-h){j=-j-h|0;for(var q=0;q>>1;f(x,$);for(var U=0,V=0,j=0,Z=0;Z<$;++Z){var q=x[2*Z+1]|0,Y=q&1;if(Z<$-1&&q>>1===x[2*Z+3]>>1&&(Y=2,Z+=1),q<0){for(var K=-(q>>1)-1,te=0;te>1)-1;Y===0?M(p,g,U--,K):Y===1?M(m,y,V--,K):Y===2&&M(_,v,j--,K)}}}function A(E,T,F,D,R,P,z,I,L,B,O,G){var W=0,X=2*E,Z=T,J=T+E,N=1,H=1;D?H=h:N=h;for(var $=R;$>>1;f(x,q);for(var Y=0,$=0;$=h?(te=!D,U-=h):(te=!!D,U-=1),te)C(p,g,Y++,U);else{var ne=G[U],se=X*U,le=O[se+T+1],ce=O[se+T+1+E];e:for(var pe=0;pe>>1;f(x,U);for(var V=0,J=0;J=h)p[V++]=N-h;else{N-=1;var q=O[N],Y=W*N,K=B[Y+T+1],te=B[Y+T+1+E];e:for(var ne=0;ne=0;--ne)if(p[ne]===N){for(var pe=ne+1;ped)throw new RangeError('The value "'+fe+'" is invalid for option "size"');var ae=new Uint8Array(fe);return Object.setPrototypeOf(ae,m.prototype),ae}function m(fe,ae,ee){if(typeof fe=="number"){if(typeof ae=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(fe)}return y(fe,ae,ee)}m.poolSize=8192;function y(fe,ae,ee){if(typeof fe=="string")return S(fe,ae);if(ArrayBuffer.isView(fe))return C(fe);if(fe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe);if(pe(fe,ArrayBuffer)||fe&&pe(fe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pe(fe,SharedArrayBuffer)||fe&&pe(fe.buffer,SharedArrayBuffer)))return w(fe,ae,ee);if(typeof fe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ie=fe.valueOf&&fe.valueOf();if(ie!=null&&ie!==fe)return m.from(ie,ae,ee);var Q=k(fe);if(Q)return Q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof fe[Symbol.toPrimitive]=="function")return m.from(fe[Symbol.toPrimitive]("string"),ae,ee);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe)}m.from=function(fe,ae,ee){return y(fe,ae,ee)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array);function _(fe){if(typeof fe!="number")throw new TypeError('"size" argument must be of type number');if(fe<0)throw new RangeError('The value "'+fe+'" is invalid for option "size"')}function v(fe,ae,ee){return _(fe),fe<=0?g(fe):ae!==void 0?typeof ee=="string"?g(fe).fill(ae,ee):g(fe).fill(ae):g(fe)}m.alloc=function(fe,ae,ee){return v(fe,ae,ee)};function x(fe){return _(fe),g(fe<0?0:A(fe)|0)}m.allocUnsafe=function(fe){return x(fe)},m.allocUnsafeSlow=function(fe){return x(fe)};function S(fe,ae){if((typeof ae!="string"||ae==="")&&(ae="utf8"),!m.isEncoding(ae))throw new TypeError("Unknown encoding: "+ae);var ee=E(fe,ae)|0,ie=g(ee),Q=ie.write(fe,ae);return Q!==ee&&(ie=ie.slice(0,Q)),ie}function M(fe){for(var ae=fe.length<0?0:A(fe.length)|0,ee=g(ae),ie=0;ie=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return fe|0}function b(fe){return+fe!=fe&&(fe=0),m.alloc(+fe)}m.isBuffer=function(ae){return ae!=null&&ae._isBuffer===!0&&ae!==m.prototype},m.compare=function(ae,ee){if(pe(ae,Uint8Array)&&(ae=m.from(ae,ae.offset,ae.byteLength)),pe(ee,Uint8Array)&&(ee=m.from(ee,ee.offset,ee.byteLength)),!m.isBuffer(ae)||!m.isBuffer(ee))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ae===ee)return 0;for(var ie=ae.length,Q=ee.length,ue=0,ge=Math.min(ie,Q);ueQ.length?m.from(ge).copy(Q,ue):Uint8Array.prototype.set.call(Q,ge,ue);else if(m.isBuffer(ge))ge.copy(Q,ue);else throw new TypeError('"list" argument must be an Array of Buffers');ue+=ge.length}return Q};function E(fe,ae){if(m.isBuffer(fe))return fe.length;if(ArrayBuffer.isView(fe)||pe(fe,ArrayBuffer))return fe.byteLength;if(typeof fe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof fe);var ee=fe.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&ee===0)return 0;for(var Q=!1;;)switch(ae){case"ascii":case"latin1":case"binary":return ee;case"utf8":case"utf-8":return te(fe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee*2;case"hex":return ee>>>1;case"base64":return le(fe).length;default:if(Q)return ie?-1:te(fe).length;ae=(""+ae).toLowerCase(),Q=!0}}m.byteLength=E;function T(fe,ae,ee){var ie=!1;if((ae===void 0||ae<0)&&(ae=0),ae>this.length||((ee===void 0||ee>this.length)&&(ee=this.length),ee<=0)||(ee>>>=0,ae>>>=0,ee<=ae))return"";for(fe||(fe="utf8");;)switch(fe){case"hex":return N(this,ae,ee);case"utf8":case"utf-8":return G(this,ae,ee);case"ascii":return Z(this,ae,ee);case"latin1":case"binary":return J(this,ae,ee);case"base64":return O(this,ae,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,ae,ee);default:if(ie)throw new TypeError("Unknown encoding: "+fe);fe=(fe+"").toLowerCase(),ie=!0}}m.prototype._isBuffer=!0;function F(fe,ae,ee){var ie=fe[ae];fe[ae]=fe[ee],fe[ee]=ie}m.prototype.swap16=function(){var ae=this.length;if(ae%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ee=0;eeee&&(ae+=" ... "),""},h&&(m.prototype[h]=m.prototype.inspect),m.prototype.compare=function(ae,ee,ie,Q,ue){if(pe(ae,Uint8Array)&&(ae=m.from(ae,ae.offset,ae.byteLength)),!m.isBuffer(ae))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ae);if(ee===void 0&&(ee=0),ie===void 0&&(ie=ae?ae.length:0),Q===void 0&&(Q=0),ue===void 0&&(ue=this.length),ee<0||ie>ae.length||Q<0||ue>this.length)throw new RangeError("out of range index");if(Q>=ue&&ee>=ie)return 0;if(Q>=ue)return-1;if(ee>=ie)return 1;if(ee>>>=0,ie>>>=0,Q>>>=0,ue>>>=0,this===ae)return 0;for(var ge=ue-Q,Me=ie-ee,Te=Math.min(ge,Me),je=this.slice(Q,ue),Ve=ae.slice(ee,ie),Ke=0;Ke2147483647?ee=2147483647:ee<-2147483648&&(ee=-2147483648),ee=+ee,xe(ee)&&(ee=Q?0:fe.length-1),ee<0&&(ee=fe.length+ee),ee>=fe.length){if(Q)return-1;ee=fe.length-1}else if(ee<0)if(Q)ee=0;else return-1;if(typeof ae=="string"&&(ae=m.from(ae,ie)),m.isBuffer(ae))return ae.length===0?-1:R(fe,ae,ee,ie,Q);if(typeof ae=="number")return ae=ae&255,typeof Uint8Array.prototype.indexOf=="function"?Q?Uint8Array.prototype.indexOf.call(fe,ae,ee):Uint8Array.prototype.lastIndexOf.call(fe,ae,ee):R(fe,[ae],ee,ie,Q);throw new TypeError("val must be string, number or Buffer")}function R(fe,ae,ee,ie,Q){var ue=1,ge=fe.length,Me=ae.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(fe.length<2||ae.length<2)return-1;ue=2,ge/=2,Me/=2,ee/=2}function Te(vt,xt){return ue===1?vt[xt]:vt.readUInt16BE(xt*ue)}var je;if(Q){var Ve=-1;for(je=ee;jege&&(ee=ge-Me),je=ee;je>=0;je--){for(var Ke=!0,Je=0;JeQ&&(ie=Q)):ie=Q;var ue=ae.length;ie>ue/2&&(ie=ue/2);for(var ge=0;ge>>0,isFinite(ie)?(ie=ie>>>0,Q===void 0&&(Q="utf8")):(Q=ie,ie=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ue=this.length-ee;if((ie===void 0||ie>ue)&&(ie=ue),ae.length>0&&(ie<0||ee<0)||ee>this.length)throw new RangeError("Attempt to write outside buffer bounds");Q||(Q="utf8");for(var ge=!1;;)switch(Q){case"hex":return P(this,ae,ee,ie);case"utf8":case"utf-8":return z(this,ae,ee,ie);case"ascii":case"latin1":case"binary":return I(this,ae,ee,ie);case"base64":return L(this,ae,ee,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,ae,ee,ie);default:if(ge)throw new TypeError("Unknown encoding: "+Q);Q=(""+Q).toLowerCase(),ge=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(fe,ae,ee){return ae===0&&ee===fe.length?c.fromByteArray(fe):c.fromByteArray(fe.slice(ae,ee))}function G(fe,ae,ee){ee=Math.min(fe.length,ee);for(var ie=[],Q=ae;Q239?4:ue>223?3:ue>191?2:1;if(Q+Me<=ee){var Te,je,Ve,Ke;switch(Me){case 1:ue<128&&(ge=ue);break;case 2:Te=fe[Q+1],(Te&192)===128&&(Ke=(ue&31)<<6|Te&63,Ke>127&&(ge=Ke));break;case 3:Te=fe[Q+1],je=fe[Q+2],(Te&192)===128&&(je&192)===128&&(Ke=(ue&15)<<12|(Te&63)<<6|je&63,Ke>2047&&(Ke<55296||Ke>57343)&&(ge=Ke));break;case 4:Te=fe[Q+1],je=fe[Q+2],Ve=fe[Q+3],(Te&192)===128&&(je&192)===128&&(Ve&192)===128&&(Ke=(ue&15)<<18|(Te&63)<<12|(je&63)<<6|Ve&63,Ke>65535&&Ke<1114112&&(ge=Ke))}}ge===null?(ge=65533,Me=1):ge>65535&&(ge-=65536,ie.push(ge>>>10&1023|55296),ge=56320|ge&1023),ie.push(ge),Q+=Me}return X(ie)}var W=4096;function X(fe){var ae=fe.length;if(ae<=W)return String.fromCharCode.apply(String,fe);for(var ee="",ie=0;ieie)&&(ee=ie);for(var Q="",ue=ae;ueie&&(ae=ie),ee<0?(ee+=ie,ee<0&&(ee=0)):ee>ie&&(ee=ie),eeee)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(ae,ee,ie){ae=ae>>>0,ee=ee>>>0,ie||$(ae,ee,this.length);for(var Q=this[ae],ue=1,ge=0;++ge>>0,ee=ee>>>0,ie||$(ae,ee,this.length);for(var Q=this[ae+--ee],ue=1;ee>0&&(ue*=256);)Q+=this[ae+--ee]*ue;return Q},m.prototype.readUint8=m.prototype.readUInt8=function(ae,ee){return ae=ae>>>0,ee||$(ae,1,this.length),this[ae]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(ae,ee){return ae=ae>>>0,ee||$(ae,2,this.length),this[ae]|this[ae+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(ae,ee){return ae=ae>>>0,ee||$(ae,2,this.length),this[ae]<<8|this[ae+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),(this[ae]|this[ae+1]<<8|this[ae+2]<<16)+this[ae+3]*16777216},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),this[ae]*16777216+(this[ae+1]<<16|this[ae+2]<<8|this[ae+3])},m.prototype.readIntLE=function(ae,ee,ie){ae=ae>>>0,ee=ee>>>0,ie||$(ae,ee,this.length);for(var Q=this[ae],ue=1,ge=0;++ge=ue&&(Q-=Math.pow(2,8*ee)),Q},m.prototype.readIntBE=function(ae,ee,ie){ae=ae>>>0,ee=ee>>>0,ie||$(ae,ee,this.length);for(var Q=ee,ue=1,ge=this[ae+--Q];Q>0&&(ue*=256);)ge+=this[ae+--Q]*ue;return ue*=128,ge>=ue&&(ge-=Math.pow(2,8*ee)),ge},m.prototype.readInt8=function(ae,ee){return ae=ae>>>0,ee||$(ae,1,this.length),this[ae]&128?(255-this[ae]+1)*-1:this[ae]},m.prototype.readInt16LE=function(ae,ee){ae=ae>>>0,ee||$(ae,2,this.length);var ie=this[ae]|this[ae+1]<<8;return ie&32768?ie|4294901760:ie},m.prototype.readInt16BE=function(ae,ee){ae=ae>>>0,ee||$(ae,2,this.length);var ie=this[ae+1]|this[ae]<<8;return ie&32768?ie|4294901760:ie},m.prototype.readInt32LE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),this[ae]|this[ae+1]<<8|this[ae+2]<<16|this[ae+3]<<24},m.prototype.readInt32BE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),this[ae]<<24|this[ae+1]<<16|this[ae+2]<<8|this[ae+3]},m.prototype.readFloatLE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),f.read(this,ae,!0,23,4)},m.prototype.readFloatBE=function(ae,ee){return ae=ae>>>0,ee||$(ae,4,this.length),f.read(this,ae,!1,23,4)},m.prototype.readDoubleLE=function(ae,ee){return ae=ae>>>0,ee||$(ae,8,this.length),f.read(this,ae,!0,52,8)},m.prototype.readDoubleBE=function(ae,ee){return ae=ae>>>0,ee||$(ae,8,this.length),f.read(this,ae,!1,52,8)};function U(fe,ae,ee,ie,Q,ue){if(!m.isBuffer(fe))throw new TypeError('"buffer" argument must be a Buffer instance');if(ae>Q||aefe.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(ae,ee,ie,Q){if(ae=+ae,ee=ee>>>0,ie=ie>>>0,!Q){var ue=Math.pow(2,8*ie)-1;U(this,ae,ee,ie,ue,0)}var ge=1,Me=0;for(this[ee]=ae&255;++Me>>0,ie=ie>>>0,!Q){var ue=Math.pow(2,8*ie)-1;U(this,ae,ee,ie,ue,0)}var ge=ie-1,Me=1;for(this[ee+ge]=ae&255;--ge>=0&&(Me*=256);)this[ee+ge]=ae/Me&255;return ee+ie},m.prototype.writeUint8=m.prototype.writeUInt8=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,1,255,0),this[ee]=ae&255,ee+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,2,65535,0),this[ee]=ae&255,this[ee+1]=ae>>>8,ee+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,2,65535,0),this[ee]=ae>>>8,this[ee+1]=ae&255,ee+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,4,4294967295,0),this[ee+3]=ae>>>24,this[ee+2]=ae>>>16,this[ee+1]=ae>>>8,this[ee]=ae&255,ee+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,4,4294967295,0),this[ee]=ae>>>24,this[ee+1]=ae>>>16,this[ee+2]=ae>>>8,this[ee+3]=ae&255,ee+4},m.prototype.writeIntLE=function(ae,ee,ie,Q){if(ae=+ae,ee=ee>>>0,!Q){var ue=Math.pow(2,8*ie-1);U(this,ae,ee,ie,ue-1,-ue)}var ge=0,Me=1,Te=0;for(this[ee]=ae&255;++ge>0)-Te&255;return ee+ie},m.prototype.writeIntBE=function(ae,ee,ie,Q){if(ae=+ae,ee=ee>>>0,!Q){var ue=Math.pow(2,8*ie-1);U(this,ae,ee,ie,ue-1,-ue)}var ge=ie-1,Me=1,Te=0;for(this[ee+ge]=ae&255;--ge>=0&&(Me*=256);)ae<0&&Te===0&&this[ee+ge+1]!==0&&(Te=1),this[ee+ge]=(ae/Me>>0)-Te&255;return ee+ie},m.prototype.writeInt8=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,1,127,-128),ae<0&&(ae=255+ae+1),this[ee]=ae&255,ee+1},m.prototype.writeInt16LE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,2,32767,-32768),this[ee]=ae&255,this[ee+1]=ae>>>8,ee+2},m.prototype.writeInt16BE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,2,32767,-32768),this[ee]=ae>>>8,this[ee+1]=ae&255,ee+2},m.prototype.writeInt32LE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,4,2147483647,-2147483648),this[ee]=ae&255,this[ee+1]=ae>>>8,this[ee+2]=ae>>>16,this[ee+3]=ae>>>24,ee+4},m.prototype.writeInt32BE=function(ae,ee,ie){return ae=+ae,ee=ee>>>0,ie||U(this,ae,ee,4,2147483647,-2147483648),ae<0&&(ae=4294967295+ae+1),this[ee]=ae>>>24,this[ee+1]=ae>>>16,this[ee+2]=ae>>>8,this[ee+3]=ae&255,ee+4};function V(fe,ae,ee,ie,Q,ue){if(ee+ie>fe.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("Index out of range")}function j(fe,ae,ee,ie,Q){return ae=+ae,ee=ee>>>0,Q||V(fe,ae,ee,4,34028234663852886e22,-34028234663852886e22),f.write(fe,ae,ee,ie,23,4),ee+4}m.prototype.writeFloatLE=function(ae,ee,ie){return j(this,ae,ee,!0,ie)},m.prototype.writeFloatBE=function(ae,ee,ie){return j(this,ae,ee,!1,ie)};function q(fe,ae,ee,ie,Q){return ae=+ae,ee=ee>>>0,Q||V(fe,ae,ee,8,17976931348623157e292,-17976931348623157e292),f.write(fe,ae,ee,ie,52,8),ee+8}m.prototype.writeDoubleLE=function(ae,ee,ie){return q(this,ae,ee,!0,ie)},m.prototype.writeDoubleBE=function(ae,ee,ie){return q(this,ae,ee,!1,ie)},m.prototype.copy=function(ae,ee,ie,Q){if(!m.isBuffer(ae))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!Q&&Q!==0&&(Q=this.length),ee>=ae.length&&(ee=ae.length),ee||(ee=0),Q>0&&Q=this.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("sourceEnd out of bounds");Q>this.length&&(Q=this.length),ae.length-ee>>0,ie=ie===void 0?this.length:ie>>>0,ae||(ae=0);var ge;if(typeof ae=="number")for(ge=ee;ge55295&&ee<57344){if(!Q){if(ee>56319){(ae-=3)>-1&&ue.push(239,191,189);continue}else if(ge+1===ie){(ae-=3)>-1&&ue.push(239,191,189);continue}Q=ee;continue}if(ee<56320){(ae-=3)>-1&&ue.push(239,191,189),Q=ee;continue}ee=(Q-55296<<10|ee-56320)+65536}else Q&&(ae-=3)>-1&&ue.push(239,191,189);if(Q=null,ee<128){if((ae-=1)<0)break;ue.push(ee)}else if(ee<2048){if((ae-=2)<0)break;ue.push(ee>>6|192,ee&63|128)}else if(ee<65536){if((ae-=3)<0)break;ue.push(ee>>12|224,ee>>6&63|128,ee&63|128)}else if(ee<1114112){if((ae-=4)<0)break;ue.push(ee>>18|240,ee>>12&63|128,ee>>6&63|128,ee&63|128)}else throw new Error("Invalid code point")}return ue}function ne(fe){for(var ae=[],ee=0;ee>8,Q=ee%256,ue.push(Q),ue.push(ie);return ue}function le(fe){return c.toByteArray(K(fe))}function ce(fe,ae,ee,ie){for(var Q=0;Q=ae.length||Q>=fe.length);++Q)ae[Q+ee]=fe[Q];return Q}function pe(fe,ae){return fe instanceof ae||fe!=null&&fe.constructor!=null&&fe.constructor.name!=null&&fe.constructor.name===ae.name}function xe(fe){return fe!==fe}var ye=(function(){for(var fe="0123456789abcdef",ae=new Array(256),ee=0;ee<16;++ee)for(var ie=ee*16,Q=0;Q<16;++Q)ae[ie+Q]=fe[ee]+fe[Q];return ae})()},2538(s,l,n){"use strict";var u=n(8902),c=n(5542),f=n(2272),h=n(5023);s.exports=y;function d(_){return[Math.min(_[0],_[1]),Math.max(_[0],_[1])]}function p(_,v){return _[0]-v[0]||_[1]-v[1]}function g(_){return _.map(d).sort(p)}function m(_,v,x){return v in _?_[v]:x}function y(_,v,x){Array.isArray(v)?(x=x||{},v=v||[]):(x=v||{},v=[]);var S=!!m(x,"delaunay",!0),M=!!m(x,"interior",!0),C=!!m(x,"exterior",!0),w=!!m(x,"infinity",!1);if(!M&&!C||_.length===0)return[];var k=u(_,v);if(S||M!==C||w){for(var A=c(_.length,g(v)),b=0;b0;){for(var S=g.pop(),_=g.pop(),M=-1,C=-1,v=y[_],k=1;k=0||(p.flip(_,S),f(d,p,g,M,_,C),f(d,p,g,_,C,M),f(d,p,g,C,S,M),f(d,p,g,S,M,C))}}},5023(s,l,n){"use strict";var u=n(2478);s.exports=g;function c(m,y,_,v,x,S,M){this.cells=m,this.neighbor=y,this.flags=v,this.constraint=_,this.active=x,this.next=S,this.boundary=M}var f=c.prototype;function h(m,y){return m[0]-y[0]||m[1]-y[1]||m[2]-y[2]}f.locate=(function(){var m=[0,0,0];return function(y,_,v){var x=y,S=_,M=v;return _0||M.length>0;){for(;S.length>0;){var b=S.pop();if(C[b]!==-x){C[b]=x;for(var E=w[b],T=0;T<3;++T){var F=A[3*b+T];F>=0&&C[F]===0&&(k[3*b+T]?M.push(F):(S.push(F),C[F]=x))}}}var D=M;M=S,S=D,M.length=0,x=-x}var R=p(w,C,y);return _?R.concat(v.boundary):R}},8902(s,l,n){"use strict";var u=n(2478),c=n(3250)[3],f=0,h=1,d=2;s.exports=M;function p(C,w,k,A,b){this.a=C,this.b=w,this.idx=k,this.lowerIds=A,this.upperIds=b}function g(C,w,k,A){this.a=C,this.b=w,this.type=k,this.idx=A}function m(C,w){var k=C.a[0]-w.a[0]||C.a[1]-w.a[1]||C.type-w.type;return k||C.type!==f&&(k=c(C.a,C.b,w.b),k)?k:C.idx-w.idx}function y(C,w){return c(C.a,C.b,w)}function _(C,w,k,A,b){for(var E=u.lt(w,A,y),T=u.gt(w,A,y),F=E;F1&&c(k[R[z-2]],k[R[z-1]],A)>0;)C.push([R[z-1],R[z-2],b]),z-=1;R.length=z,R.push(b);for(var P=D.upperIds,z=P.length;z>1&&c(k[P[z-2]],k[P[z-1]],A)<0;)C.push([P[z-2],P[z-1],b]),z-=1;P.length=z,P.push(b)}}function v(C,w){var k;return C.a[0]D[0]&&b.push(new g(D,F,d,E),new g(F,D,h,E))}b.sort(m);for(var R=b[0].a[0]-(1+Math.abs(b[0].a[0]))*Math.pow(2,-52),P=[new p([R,1],[R,0],-1,[],[],[],[])],z=[],E=0,I=b.length;E=0}})(),f.removeTriangle=function(p,g,m){var y=this.stars;h(y[p],g,m),h(y[g],m,p),h(y[m],p,g)},f.addTriangle=function(p,g,m){var y=this.stars;y[p].push(g,m),y[g].push(m,p),y[m].push(p,g)},f.opposite=function(p,g){for(var m=this.stars[g],y=1,_=m.length;y<_;y+=2)if(m[y]===p)return m[y-1];return-1},f.flip=function(p,g){var m=this.opposite(p,g),y=this.opposite(g,p);this.removeTriangle(p,g,m),this.removeTriangle(g,p,y),this.addTriangle(p,y,m),this.addTriangle(g,m,y)},f.edges=function(){for(var p=this.stars,g=[],m=0,y=p.length;m=0;--L){var H=z[L];B=H[0];var $=R[B],U=$[0],V=$[1],j=D[U],q=D[V];if((j[0]-q[0]||j[1]-q[1])<0){var Y=U;U=V,V=Y}$[0]=U;var K=$[1]=H[1],te;for(I&&(te=$[2]);L>0&&z[L-1][0]===B;){var H=z[--L],ne=H[1];I?R.push([K,ne,te]):R.push([K,ne]),K=ne}I?R.push([K,V,te]):R.push([K,V])}return O}function w(D,R,P){for(var z=R.length,I=new u(z),L=[],B=0;BR[2]?1:0)}function b(D,R,P){if(D.length!==0){if(R)for(var z=0;z0||B.length>0}function F(D,R,P){var z;if(P){z=R;for(var I=new Array(R.length),L=0;LC+1)throw new Error(S+" map requires nshades to be at least size "+x.length);Array.isArray(g.alpha)?g.alpha.length!==2?w=[1,1]:w=g.alpha.slice():typeof g.alpha=="number"?w=[g.alpha,g.alpha]:w=[1,1],m=x.map(function(F){return Math.round(F.index*C)}),w[0]=Math.min(Math.max(w[0],0),1),w[1]=Math.min(Math.max(w[1],0),1);var A=x.map(function(F,D){var R=x[D].index,P=x[D].rgb.slice();return P.length===4&&P[3]>=0&&P[3]<=1||(P[3]=w[0]+(w[1]-w[0])*R),P}),b=[];for(k=0;k=0}function g(m,y,_,v){var x=u(y,_,v);if(x===0){var S=c(u(m,y,_)),M=c(u(m,y,v));if(S===M){if(S===0){var C=p(m,y,_),w=p(m,y,v);return C===w?0:C?1:-1}return 0}else{if(M===0)return S>0||p(m,y,v)?-1:1;if(S===0)return M>0||p(m,y,_)?1:-1}return c(M-S)}var k=u(m,y,_);if(k>0)return x>0&&u(m,y,v)>0?1:-1;if(k<0)return x>0||u(m,y,v)>0?1:-1;var A=u(m,y,v);return A>0||p(m,y,_)?1:-1}},8572(s){"use strict";s.exports=function(n){return n<0?-1:n>0?1:0}},8507(s){s.exports=u;var l=Math.min;function n(c,f){return c-f}function u(c,f){var h=c.length,d=c.length-f.length;if(d)return d;switch(h){case 0:return 0;case 1:return c[0]-f[0];case 2:return c[0]+c[1]-f[0]-f[1]||l(c[0],c[1])-l(f[0],f[1]);case 3:var p=c[0]+c[1],g=f[0]+f[1];if(d=p+c[2]-(g+f[2]),d)return d;var m=l(c[0],c[1]),y=l(f[0],f[1]);return l(m,c[2])-l(y,f[2])||l(m+c[2],p)-l(y+f[2],g);case 4:var _=c[0],v=c[1],x=c[2],S=c[3],M=f[0],C=f[1],w=f[2],k=f[3];return _+v+x+S-(M+C+w+k)||l(_,v,x,S)-l(M,C,w,k,M)||l(_+v,_+x,_+S,v+x,v+S,x+S)-l(M+C,M+w,M+k,C+w,C+k,w+k)||l(_+v+x,_+v+S,_+x+S,v+x+S)-l(M+C+w,M+C+k,M+w+k,C+w+k);default:for(var A=c.slice().sort(n),b=f.slice().sort(n),E=0;En[c][0]&&(c=f);return uc?[[c],[u]]:[[u]]}},4750(s,l,n){"use strict";s.exports=c;var u=n(3090);function c(f){var h=u(f),d=h.length;if(d<=2)return[];for(var p=new Array(d),g=h[d-1],m=0;m=g[M]&&(S+=1);v[x]=S}}return p}function d(p,g){try{return u(p,!0)}catch{var m=c(p);if(m.length<=g)return[];var y=f(p,m),_=u(y,!0);return h(_,m)}}},4769(s){"use strict";function l(u,c,f,h,d,p){var g=6*d*d-6*d,m=3*d*d-4*d+1,y=-6*d*d+6*d,_=3*d*d-2*d;if(u.length){p||(p=new Array(u.length));for(var v=u.length-1;v>=0;--v)p[v]=g*u[v]+m*c[v]+y*f[v]+_*h[v];return p}return g*u+m*c+y*f[v]+_*h}function n(u,c,f,h,d,p){var g=d-1,m=d*d,y=g*g,_=(1+2*d)*y,v=d*y,x=m*(3-2*d),S=m*g;if(u.length){p||(p=new Array(u.length));for(var M=u.length-1;M>=0;--M)p[M]=_*u[M]+v*c[M]+x*f[M]+S*h[M];return p}return _*u+v*c+x*f+S*h}s.exports=n,s.exports.derivative=l},7642(s,l,n){"use strict";var u=n(8954),c=n(1682);s.exports=p;function f(g,m){this.point=g,this.index=m}function h(g,m){for(var y=g.point,_=m.point,v=y.length,x=0;x=2)return!1;P[I]=L}return!0}):R=R.filter(function(P){for(var z=0;z<=_;++z){var I=E[P[z]];if(I<0)return!1;P[z]=I}return!0}),_&1)for(var S=0;S>>31},s.exports.exponent=function(x){var S=s.exports.hi(x);return(S<<1>>>21)-1023},s.exports.fraction=function(x){var S=s.exports.lo(x),M=s.exports.hi(x),C=M&(1<<20)-1;return M&2146435072&&(C+=1048576),[S,C]},s.exports.denormalized=function(x){var S=s.exports.hi(x);return!(S&2146435072)}},1338(s){"use strict";function l(c,f,h){var d=c[h]|0;if(d<=0)return[];var p=new Array(d),g;if(h===c.length-1)for(g=0;g"u"&&(f=0),typeof c){case"number":if(c>0)return n(c|0,f);break;case"object":if(typeof c.length=="number")return l(c,f,0);break}return[]}s.exports=u},3134(s,l,n){"use strict";s.exports=c;var u=n(1682);function c(f,h){var d=f.length;if(typeof h!="number"){h=0;for(var p=0;p=_-1)for(var k=S.length-1,b=m-y[_-1],A=0;A=_-1)for(var w=S.length-1,k=m-y[_-1],A=0;A=0;--_)if(m[--y])return!1;return!0},d.jump=function(m){var y=this.lastT(),_=this.dimension;if(!(m0;--A)v.push(f(C[A-1],w[A-1],arguments[A])),x.push(0)}},d.push=function(m){var y=this.lastT(),_=this.dimension;if(!(m1e-6?1/M:0;this._time.push(m);for(var b=_;b>0;--b){var E=f(w[b-1],k[b-1],arguments[b]);v.push(E),x.push((E-v[S++])*A)}}},d.set=function(m){var y=this.dimension;if(!(m0;--C)_.push(f(S[C-1],M[C-1],arguments[C])),v.push(0)}},d.move=function(m){var y=this.lastT(),_=this.dimension;if(!(m<=y||arguments.length!==_+1)){var v=this._state,x=this._velocity,S=v.length-this.dimension,M=this.bounds,C=M[0],w=M[1],k=m-y,A=k>1e-6?1/k:0;this._time.push(m);for(var b=_;b>0;--b){var E=arguments[b];v.push(f(C[b-1],w[b-1],v[S++]+E)),x.push(E*A)}}},d.idle=function(m){var y=this.lastT();if(!(m=0;--A)v.push(f(C[A],w[A],v[S]+k*x[S])),x.push(0),S+=1}};function p(m){for(var y=new Array(m),_=0;_=0;--D){var b=E[D];T[D]<=0?E[D]=new u(b._color,b.key,b.value,E[D+1],b.right,b._count+1):E[D]=new u(b._color,b.key,b.value,b.left,E[D+1],b._count+1)}for(var D=E.length-1;D>1;--D){var R=E[D-1],b=E[D];if(R._color===n||b._color===n)break;var P=E[D-2];if(P.left===R)if(R.left===b){var z=P.right;if(z&&z._color===l)R._color=n,P.right=f(n,z),P._color=l,D-=1;else{if(P._color=l,P.left=R.right,R._color=n,R.right=P,E[D-2]=R,E[D-1]=b,h(P),h(R),D>=3){var I=E[D-3];I.left===P?I.left=R:I.right=R}break}}else{var z=P.right;if(z&&z._color===l)R._color=n,P.right=f(n,z),P._color=l,D-=1;else{if(R.right=b.left,P._color=l,P.left=b.right,b._color=n,b.left=R,b.right=P,E[D-2]=b,E[D-1]=R,h(P),h(R),h(b),D>=3){var I=E[D-3];I.left===P?I.left=b:I.right=b}break}}else if(R.right===b){var z=P.left;if(z&&z._color===l)R._color=n,P.left=f(n,z),P._color=l,D-=1;else{if(P._color=l,P.right=R.left,R._color=n,R.left=P,E[D-2]=R,E[D-1]=b,h(P),h(R),D>=3){var I=E[D-3];I.right===P?I.right=R:I.left=R}break}}else{var z=P.left;if(z&&z._color===l)R._color=n,P.left=f(n,z),P._color=l,D-=1;else{if(R.left=b.right,P._color=l,P.right=b.left,b._color=n,b.right=R,b.left=P,E[D-2]=b,E[D-1]=R,h(P),h(R),h(b),D>=3){var I=E[D-3];I.right===P?I.right=b:I.left=b}break}}}return E[0]._color=n,new d(A,E[0])};function g(w,k){if(k.left){var A=g(w,k.left);if(A)return A}var A=w(k.key,k.value);if(A)return A;if(k.right)return g(w,k.right)}function m(w,k,A,b){var E=k(w,b.key);if(E<=0){if(b.left){var T=m(w,k,A,b.left);if(T)return T}var T=A(b.key,b.value);if(T)return T}if(b.right)return m(w,k,A,b.right)}function y(w,k,A,b,E){var T=A(w,E.key),F=A(k,E.key),D;if(T<=0&&(E.left&&(D=y(w,k,A,b,E.left),D)||F>0&&(D=b(E.key,E.value),D)))return D;if(F>0&&E.right)return y(w,k,A,b,E.right)}p.forEach=function(k,A,b){if(this.root)switch(arguments.length){case 1:return g(k,this.root);case 2:return m(A,this._compare,k,this.root);case 3:return this._compare(A,b)>=0?void 0:y(A,b,this._compare,k,this.root)}},Object.defineProperty(p,"begin",{get:function(){for(var w=[],k=this.root;k;)w.push(k),k=k.left;return new _(this,w)}}),Object.defineProperty(p,"end",{get:function(){for(var w=[],k=this.root;k;)w.push(k),k=k.right;return new _(this,w)}}),p.at=function(w){if(w<0)return new _(this,[]);for(var k=this.root,A=[];;){if(A.push(k),k.left){if(w=k.right._count)break;k=k.right}else break}return new _(this,[])},p.ge=function(w){for(var k=this._compare,A=this.root,b=[],E=0;A;){var T=k(w,A.key);b.push(A),T<=0&&(E=b.length),T<=0?A=A.left:A=A.right}return b.length=E,new _(this,b)},p.gt=function(w){for(var k=this._compare,A=this.root,b=[],E=0;A;){var T=k(w,A.key);b.push(A),T<0&&(E=b.length),T<0?A=A.left:A=A.right}return b.length=E,new _(this,b)},p.lt=function(w){for(var k=this._compare,A=this.root,b=[],E=0;A;){var T=k(w,A.key);b.push(A),T>0&&(E=b.length),T<=0?A=A.left:A=A.right}return b.length=E,new _(this,b)},p.le=function(w){for(var k=this._compare,A=this.root,b=[],E=0;A;){var T=k(w,A.key);b.push(A),T>=0&&(E=b.length),T<0?A=A.left:A=A.right}return b.length=E,new _(this,b)},p.find=function(w){for(var k=this._compare,A=this.root,b=[];A;){var E=k(w,A.key);if(b.push(A),E===0)return new _(this,b);E<=0?A=A.left:A=A.right}return new _(this,[])},p.remove=function(w){var k=this.find(w);return k?k.remove():this},p.get=function(w){for(var k=this._compare,A=this.root;A;){var b=k(w,A.key);if(b===0)return A.value;b<=0?A=A.left:A=A.right}};function _(w,k){this.tree=w,this._stack=k}var v=_.prototype;Object.defineProperty(v,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(v,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),v.clone=function(){return new _(this.tree,this._stack.slice())};function x(w,k){w.key=k.key,w.value=k.value,w.left=k.left,w.right=k.right,w._color=k._color,w._count=k._count}function S(w){for(var k,A,b,E,T=w.length-1;T>=0;--T){if(k=w[T],T===0){k._color=n;return}if(A=w[T-1],A.left===k){if(b=A.right,b.right&&b.right._color===l){if(b=A.right=c(b),E=b.right=c(b.right),A.right=b.left,b.left=A,b.right=E,b._color=A._color,k._color=n,A._color=n,E._color=n,h(A),h(b),T>1){var F=w[T-2];F.left===A?F.left=b:F.right=b}w[T-1]=b;return}else if(b.left&&b.left._color===l){if(b=A.right=c(b),E=b.left=c(b.left),A.right=E.left,b.left=E.right,E.left=A,E.right=b,E._color=A._color,A._color=n,b._color=n,k._color=n,h(A),h(b),h(E),T>1){var F=w[T-2];F.left===A?F.left=E:F.right=E}w[T-1]=E;return}if(b._color===n)if(A._color===l){A._color=n,A.right=f(l,b);return}else{A.right=f(l,b);continue}else{if(b=c(b),A.right=b.left,b.left=A,b._color=A._color,A._color=l,h(A),h(b),T>1){var F=w[T-2];F.left===A?F.left=b:F.right=b}w[T-1]=b,w[T]=A,T+11){var F=w[T-2];F.right===A?F.right=b:F.left=b}w[T-1]=b;return}else if(b.right&&b.right._color===l){if(b=A.left=c(b),E=b.right=c(b.right),A.left=E.right,b.right=E.left,E.right=A,E.left=b,E._color=A._color,A._color=n,b._color=n,k._color=n,h(A),h(b),h(E),T>1){var F=w[T-2];F.right===A?F.right=E:F.left=E}w[T-1]=E;return}if(b._color===n)if(A._color===l){A._color=n,A.left=f(l,b);return}else{A.left=f(l,b);continue}else{if(b=c(b),A.left=b.right,b.right=A,b._color=A._color,A._color=l,h(A),h(b),T>1){var F=w[T-2];F.right===A?F.right=b:F.left=b}w[T-1]=b,w[T]=A,T+1=0;--b){var A=w[b];A.left===w[b+1]?k[b]=new u(A._color,A.key,A.value,k[b+1],A.right,A._count):k[b]=new u(A._color,A.key,A.value,A.left,k[b+1],A._count)}if(A=k[k.length-1],A.left&&A.right){var E=k.length;for(A=A.left;A.right;)k.push(A),A=A.right;var T=k[E-1];k.push(new u(A._color,T.key,T.value,A.left,A.right,A._count)),k[E-1].key=A.key,k[E-1].value=A.value;for(var b=k.length-2;b>=E;--b)A=k[b],k[b]=new u(A._color,A.key,A.value,A.left,k[b+1],A._count);k[E-1].left=k[E]}if(A=k[k.length-1],A._color===l){var F=k[k.length-2];F.left===A?F.left=null:F.right===A&&(F.right=null),k.pop();for(var b=0;b0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(v,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(v,"index",{get:function(){var w=0,k=this._stack;if(k.length===0){var A=this.tree.root;return A?A._count:0}else k[k.length-1].left&&(w=k[k.length-1].left._count);for(var b=k.length-2;b>=0;--b)k[b+1]===k[b].right&&(++w,k[b].left&&(w+=k[b].left._count));return w},enumerable:!0}),v.next=function(){var w=this._stack;if(w.length!==0){var k=w[w.length-1];if(k.right)for(k=k.right;k;)w.push(k),k=k.left;else for(w.pop();w.length>0&&w[w.length-1].right===k;)k=w[w.length-1],w.pop()}},Object.defineProperty(v,"hasNext",{get:function(){var w=this._stack;if(w.length===0)return!1;if(w[w.length-1].right)return!0;for(var k=w.length-1;k>0;--k)if(w[k-1].left===w[k])return!0;return!1}}),v.update=function(w){var k=this._stack;if(k.length===0)throw new Error("Can't update empty node!");var A=new Array(k.length),b=k[k.length-1];A[A.length-1]=new u(b._color,b.key,w,b.left,b.right,b._count);for(var E=k.length-2;E>=0;--E)b=k[E],b.left===k[E+1]?A[E]=new u(b._color,b.key,b.value,A[E+1],b.right,b._count):A[E]=new u(b._color,b.key,b.value,b.left,A[E+1],b._count);return new d(this.tree._compare,A[0])},v.prev=function(){var w=this._stack;if(w.length!==0){var k=w[w.length-1];if(k.left)for(k=k.left;k;)w.push(k),k=k.right;else for(w.pop();w.length>0&&w[w.length-1].left===k;)k=w[w.length-1],w.pop()}},Object.defineProperty(v,"hasPrev",{get:function(){var w=this._stack;if(w.length===0)return!1;if(w[w.length-1].left)return!0;for(var k=w.length-1;k>0;--k)if(w[k-1].right===w[k])return!0;return!1}});function M(w,k){return wk?1:0}function C(w){return new d(w||M,null)}},3837(s,l,n){"use strict";s.exports=D;var u=n(4935),c=n(501),f=n(5304),h=n(6429),d=n(6444),p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),g=ArrayBuffer,m=DataView;function y(R){return g.isView(R)&&!(R instanceof m)}function _(R){return Array.isArray(R)||y(R)}function v(R,P){return R[0]=P[0],R[1]=P[1],R[2]=P[2],R}function x(R){this.gl=R,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=f(R)}var S=x.prototype;S.update=function(R){R=R||{};function P(U,V,j){if(j in R){var q=R[j],Y=this[j],K;(U?_(q)&&_(q[0]):_(q))?this[j]=K=[V(q[0]),V(q[1]),V(q[2])]:this[j]=K=[V(q),V(q),V(q)];for(var te=0;te<3;++te)if(K[te]!==Y[te])return!0}return!1}var z=P.bind(this,!1,Number),I=P.bind(this,!1,Boolean),L=P.bind(this,!1,String),B=P.bind(this,!0,function(U){if(_(U)){if(U.length===3)return[+U[0],+U[1],+U[2],1];if(U.length===4)return[+U[0],+U[1],+U[2],+U[3]]}return[0,0,0,1]}),O,G=!1,W=!1;if("bounds"in R)for(var X=R.bounds,Z=0;Z<2;++Z)for(var J=0;J<3;++J)X[Z][J]!==this.bounds[Z][J]&&(W=!0),this.bounds[Z][J]=X[Z][J];if("ticks"in R){O=R.ticks,G=!0,this.autoTicks=!1;for(var Z=0;Z<3;++Z)this.tickSpacing[Z]=0}else z("tickSpacing")&&(this.autoTicks=!0,W=!0);if(this._firstInit&&("ticks"in R||"tickSpacing"in R||(this.autoTicks=!0),W=!0,G=!0,this._firstInit=!1),W&&this.autoTicks&&(O=d.create(this.bounds,this.tickSpacing),G=!0),G){for(var Z=0;Z<3;++Z)O[Z].sort(function(V,j){return V.x-j.x});d.equal(O,this.ticks)?G=!1:this.ticks=O}I("tickEnable"),L("tickFont")&&(G=!0),L("tickFontStyle")&&(G=!0),L("tickFontWeight")&&(G=!0),L("tickFontVariant")&&(G=!0),z("tickSize"),z("tickAngle"),z("tickPad"),B("tickColor");var N=L("labels");L("labelFont")&&(N=!0),L("labelFontStyle")&&(N=!0),L("labelFontWeight")&&(N=!0),L("labelFontVariant")&&(N=!0),I("labelEnable"),z("labelSize"),z("labelPad"),B("labelColor"),I("lineEnable"),I("lineMirror"),z("lineWidth"),B("lineColor"),I("lineTickEnable"),I("lineTickMirror"),z("lineTickLength"),z("lineTickWidth"),B("lineTickColor"),I("gridEnable"),z("gridWidth"),B("gridColor"),I("zeroEnable"),B("zeroLineColor"),z("zeroLineWidth"),I("backgroundEnable"),B("backgroundColor");var H=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],$=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(N||G)&&this._text.update(this.bounds,this.labels,H,this.ticks,$):this._text=u(this.gl,this.bounds,this.labels,H,this.ticks,$),this._lines&&G&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=c(this.gl,this.bounds,this.ticks))};function M(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var C=[new M,new M,new M];function w(R,P,z,I,L){for(var B=R.primalOffset,O=R.primalMinor,G=R.mirrorOffset,W=R.mirrorMinor,X=I[P],Z=0;Z<3;++Z)if(P!==Z){var J=B,N=G,H=O,$=W;X&1<0?(H[Z]=-1,$[Z]=0):(H[Z]=0,$[Z]=1)}}var k=[0,0,0],A={model:p,view:p,projection:p,_ortho:!1};S.isOpaque=function(){return!0},S.isTransparent=function(){return!1},S.drawTransparent=function(R){};var b=0,E=[0,0,0],T=[0,0,0],F=[0,0,0];S.draw=function(R){R=R||A;for(var j=this.gl,P=R.model||p,z=R.view||p,I=R.projection||p,L=this.bounds,B=R._ortho||!1,O=h(P,z,I,L,B),G=O.cubeEdges,W=O.axis,X=z[12],Z=z[13],J=z[14],N=z[15],H=B?2:1,$=H*this.pixelRatio*(I[3]*X+I[7]*Z+I[11]*J+I[15]*N)/j.drawingBufferHeight,U=0;U<3;++U)this.lastCubeProps.cubeEdges[U]=G[U],this.lastCubeProps.axis[U]=W[U];for(var V=C,U=0;U<3;++U)w(C[U],U,this.bounds,G,W);for(var j=this.gl,q=k,U=0;U<3;++U)this.backgroundEnable[U]?q[U]=W[U]:q[U]=0;this._background.draw(P,z,I,L,q,this.backgroundColor),this._lines.bind(P,z,I,this);for(var U=0;U<3;++U){var Y=[0,0,0];W[U]>0?Y[U]=L[1][U]:Y[U]=L[0][U];for(var K=0;K<2;++K){var te=(U+1+K)%3,ne=(U+1+(K^1))%3;this.gridEnable[te]&&this._lines.drawGrid(te,ne,this.bounds,Y,this.gridColor[te],this.gridWidth[te]*this.pixelRatio)}for(var K=0;K<2;++K){var te=(U+1+K)%3,ne=(U+1+(K^1))%3;this.zeroEnable[ne]&&Math.min(L[0][ne],L[1][ne])<=0&&Math.max(L[0][ne],L[1][ne])>=0&&this._lines.drawZero(te,ne,this.bounds,Y,this.zeroLineColor[ne],this.zeroLineWidth[ne]*this.pixelRatio)}}for(var U=0;U<3;++U){this.lineEnable[U]&&this._lines.drawAxisLine(U,this.bounds,V[U].primalOffset,this.lineColor[U],this.lineWidth[U]*this.pixelRatio),this.lineMirror[U]&&this._lines.drawAxisLine(U,this.bounds,V[U].mirrorOffset,this.lineColor[U],this.lineWidth[U]*this.pixelRatio);for(var se=v(E,V[U].primalMinor),le=v(T,V[U].mirrorMinor),ce=this.lineTickLength,K=0;K<3;++K){var pe=$/P[5*K];se[K]*=ce[K]*pe,le[K]*=ce[K]*pe}this.lineTickEnable[U]&&this._lines.drawAxisTicks(U,V[U].primalOffset,se,this.lineTickColor[U],this.lineTickWidth[U]*this.pixelRatio),this.lineTickMirror[U]&&this._lines.drawAxisTicks(U,V[U].mirrorOffset,le,this.lineTickColor[U],this.lineTickWidth[U]*this.pixelRatio)}this._lines.unbind(),this._text.bind(P,z,I,this.pixelRatio);var xe,ye=.5,fe,ae;function ee(Te){ae=[0,0,0],ae[Te]=1}function ie(Te,je,Ve){var Ke=(Te+1)%3,Je=(Te+2)%3,vt=je[Ke],xt=je[Je],Pt=Ve[Ke],mt=Ve[Je];if(vt>0&&mt>0){ee(Ke);return}else if(vt>0&&mt<0){ee(Ke);return}else if(vt<0&&mt>0){ee(Ke);return}else if(vt<0&&mt<0){ee(Ke);return}else if(xt>0&&Pt>0){ee(Je);return}else if(xt>0&&Pt<0){ee(Je);return}else if(xt<0&&Pt>0){ee(Je);return}else if(xt<0&&Pt<0){ee(Je);return}}for(var U=0;U<3;++U){for(var Q=V[U].primalMinor,ue=V[U].mirrorMinor,ge=v(F,V[U].primalOffset),K=0;K<3;++K)this.lineTickEnable[U]&&(ge[K]+=$*Q[K]*Math.max(this.lineTickLength[K],0)/P[5*K]);var Me=[0,0,0];if(Me[U]=1,this.tickEnable[U]){this.tickAngle[U]===-3600?(this.tickAngle[U]=0,this.tickAlign[U]="auto"):this.tickAlign[U]=-1,fe=1,xe=[this.tickAlign[U],ye,fe],xe[0]==="auto"?xe[0]=b:xe[0]=parseInt(""+xe[0]),ae=[0,0,0],ie(U,Q,ue);for(var K=0;K<3;++K)ge[K]+=$*Q[K]*this.tickPad[K]/P[5*K];this._text.drawTicks(U,this.tickSize[U],this.tickAngle[U],ge,this.tickColor[U],Me,ae,xe)}if(this.labelEnable[U]){fe=0,ae=[0,0,0],this.labels[U].length>4&&(ee(U),fe=1),xe=[this.labelAlign[U],ye,fe],xe[0]==="auto"?xe[0]=b:xe[0]=parseInt(""+xe[0]);for(var K=0;K<3;++K)ge[K]+=$*Q[K]*this.labelPad[K]/P[5*K];ge[U]+=.5*(L[0][U]+L[1][U]),this._text.drawLabel(U,this.labelSize[U],this.labelAngle[U],ge,this.labelColor[U],[0,0,0],ae,xe)}}this._text.unbind()},S.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function D(R,P){var z=new x(R);return z.update(P),z}},5304(s,l,n){"use strict";s.exports=p;var u=n(2762),c=n(8116),f=n(1879).bg;function h(g,m,y,_){this.gl=g,this.buffer=m,this.vao=y,this.shader=_}var d=h.prototype;d.draw=function(g,m,y,_,v,x){for(var S=!1,M=0;M<3;++M)S=S||v[M];if(S){var C=this.gl;C.enable(C.POLYGON_OFFSET_FILL),C.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:g,view:m,projection:y,bounds:_,enable:v,colors:x},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),C.disable(C.POLYGON_OFFSET_FILL)}},d.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function p(g){for(var m=[],y=[],_=0,v=0;v<3;++v)for(var x=(v+1)%3,S=(v+2)%3,M=[0,0,0],C=[0,0,0],w=-1;w<=1;w+=2){y.push(_,_+2,_+1,_+1,_+2,_+3),M[v]=w,C[v]=w;for(var k=-1;k<=1;k+=2){M[x]=k;for(var A=-1;A<=1;A+=2)M[S]=A,m.push(M[0],M[1],M[2],C[0],C[1],C[2]),_+=1}var b=x;x=S,S=b}var E=u(g,new Float32Array(m)),T=u(g,new Uint16Array(y),g.ELEMENT_ARRAY_BUFFER),F=c(g,[{buffer:E,type:g.FLOAT,size:3,offset:0,stride:24},{buffer:E,type:g.FLOAT,size:3,offset:12,stride:24}],T),D=f(g);return D.attributes.position.location=0,D.attributes.normal.location=1,new h(g,E,F,D)}},6429(s,l,n){"use strict";s.exports=w;var u=n(8828),c=n(6760),f=n(5202),h=n(3250),d=new Array(16),p=new Array(8),g=new Array(8),m=new Array(3),y=[0,0,0];(function(){for(var k=0;k<8;++k)p[k]=[1,1,1,1],g[k]=[1,1,1]})();function _(k,A,b){for(var E=0;E<4;++E){k[E]=b[12+E];for(var T=0;T<3;++T)k[E]+=A[T]*b[4*T+E]}}var v=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function x(k){for(var A=0;AW&&(z|=1<W){z|=1<g[D][1])&&(V=D);for(var j=-1,D=0;D<3;++D){var q=V^1<g[Y][0]&&(Y=q)}}var K=S;K[0]=K[1]=K[2]=0,K[u.log2(j^V)]=V&j,K[u.log2(V^Y)]=V&Y;var te=Y^7;te===z||te===U?(te=j^7,K[u.log2(Y^te)]=te&Y):K[u.log2(j^te)]=te&j;for(var ne=M,se=z,B=0;B<3;++B)se&1<J&&H>0){var $=(N[H][0]-J)/(N[H][0]-N[H-1][0]);return N[H][1]*(1-$)+$*N[H-1][1]}}return 1}function z(J,N){for(var H=v({colormap:J,nshades:256,format:"rgba"}),$=new Uint8Array(256*4),U=0;U<256;++U){for(var V=H[U],j=0;j<3;++j)$[4*U+j]=V[j];N?$[4*U+3]=255*P(U/255,N):$[4*U+3]=255*V[3]}return _($,[256,256,4],[4,0,1])}function I(J){for(var N=J.length,H=new Array(N),$=0;$0){var se=this.triShader;se.bind(),se.uniforms=q,this.triangleVAO.bind(),N.drawArrays(N.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var se=this.lineShader;se.bind(),se.uniforms=q,this.edgeVAO.bind(),N.lineWidth(this.lineWidth*this.pixelRatio),N.drawArrays(N.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var se=this.pointShader;se.bind(),se.uniforms=q,this.pointVAO.bind(),N.drawArrays(N.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var se=this.contourShader;se.bind(),se.uniforms=q,this.contourVAO.bind(),N.drawArrays(N.LINES,0,this.contourCount),this.contourVAO.unbind()}},R.drawPick=function(J){J=J||{};for(var N=this.gl,H=J.model||F,$=J.view||F,U=J.projection||F,V=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],j=0;j<3;++j)V[0][j]=Math.max(V[0][j],this.clipBounds[0][j]),V[1][j]=Math.min(V[1][j],this.clipBounds[1][j]);this._model=[].slice.call(H),this._view=[].slice.call($),this._projection=[].slice.call(U),this._resolution=[N.drawingBufferWidth,N.drawingBufferHeight];var q={model:H,view:$,projection:U,clipBounds:V,pickId:this.pickId/255},Y=this.pickShader;if(Y.bind(),Y.uniforms=q,this.triangleCount>0&&(this.triangleVAO.bind(),N.drawArrays(N.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),N.lineWidth(this.lineWidth*this.pixelRatio),N.drawArrays(N.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var Y=this.pointPickShader;Y.bind(),Y.uniforms=q,this.pointVAO.bind(),N.drawArrays(N.POINTS,0,this.pointCount),this.pointVAO.unbind()}},R.pick=function(J){if(!J||J.id!==this.pickId)return null;for(var N=J.value[0]+256*J.value[1]+65536*J.value[2],H=this.cells[N],$=this.positions,U=new Array(H.length),V=0;VMath.abs(b))v.rotate(F,0,0,-A*E*Math.PI*w.rotateSpeed/window.innerWidth);else if(!w._ortho){var D=-w.zoomSpeed*T*b/window.innerHeight*(F-v.lastT())/20;v.pan(F,0,0,S*(Math.exp(D)-1))}}},!0)},w.enableMouseListeners(),w}},799(s,l,n){var u=n(3236),c=n(9405),f=u([`precision mediump float; +`]);l.meshShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},l.wireShader={vertex:h,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},l.pointShader={vertex:p,fragment:g,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},l.pickShader={vertex:m,fragment:y,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},l.pointPickShader={vertex:_,fragment:y,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},l.contourShader={vertex:v,fragment:x,attributes:[{name:"position",type:"vec3"}]}},7201(s,l,n){"use strict";var u=1e-6,c=1e-6,f=n(9405),h=n(2762),d=n(8116),p=n(7766),g=n(8406),m=n(6760),y=n(7608),_=n(9618),v=n(6729),x=n(7765),S=n(1888),M=n(840),C=n(7626),w=M.meshShader,k=M.wireShader,A=M.pointShader,b=M.pickShader,E=M.pointPickShader,T=M.contourShader,F=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function D(J,N,H,$,U,V,j,q,Y,K,te,ne,se,le,ce,pe,xe,ye,fe,ae,ee,ie,Q,ue,ge,Me,Te){this.gl=J,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=N,this.dirty=!0,this.triShader=H,this.lineShader=$,this.pointShader=U,this.pickShader=V,this.pointPickShader=j,this.contourShader=q,this.trianglePositions=Y,this.triangleColors=te,this.triangleNormals=se,this.triangleUVs=ne,this.triangleIds=K,this.triangleVAO=le,this.triangleCount=0,this.lineWidth=1,this.edgePositions=ce,this.edgeColors=xe,this.edgeUVs=ye,this.edgeIds=pe,this.edgeVAO=fe,this.edgeCount=0,this.pointPositions=ae,this.pointColors=ie,this.pointUVs=Q,this.pointSizes=ue,this.pointIds=ee,this.pointVAO=ge,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=Me,this.contourVAO=Te,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=F,this._view=F,this._projection=F,this._resolution=[1,1]}var R=D.prototype;R.isOpaque=function(){return!this.hasAlpha},R.isTransparent=function(){return this.hasAlpha},R.pickSlots=1,R.setPickBase=function(J){this.pickId=J};function P(J,N){if(!N||!N.length)return 1;for(var H=0;HJ&&H>0){var $=(N[H][0]-J)/(N[H][0]-N[H-1][0]);return N[H][1]*(1-$)+$*N[H-1][1]}}return 1}function z(J,N){for(var H=v({colormap:J,nshades:256,format:"rgba"}),$=new Uint8Array(256*4),U=0;U<256;++U){for(var V=H[U],j=0;j<3;++j)$[4*U+j]=V[j];N?$[4*U+3]=255*P(U/255,N):$[4*U+3]=255*V[3]}return _($,[256,256,4],[4,0,1])}function I(J){for(var N=J.length,H=new Array(N),$=0;$0){var se=this.triShader;se.bind(),se.uniforms=q,this.triangleVAO.bind(),N.drawArrays(N.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var se=this.lineShader;se.bind(),se.uniforms=q,this.edgeVAO.bind(),N.lineWidth(this.lineWidth*this.pixelRatio),N.drawArrays(N.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var se=this.pointShader;se.bind(),se.uniforms=q,this.pointVAO.bind(),N.drawArrays(N.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var se=this.contourShader;se.bind(),se.uniforms=q,this.contourVAO.bind(),N.drawArrays(N.LINES,0,this.contourCount),this.contourVAO.unbind()}},R.drawPick=function(J){J=J||{};for(var N=this.gl,H=J.model||F,$=J.view||F,U=J.projection||F,V=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],j=0;j<3;++j)V[0][j]=Math.max(V[0][j],this.clipBounds[0][j]),V[1][j]=Math.min(V[1][j],this.clipBounds[1][j]);this._model=[].slice.call(H),this._view=[].slice.call($),this._projection=[].slice.call(U),this._resolution=[N.drawingBufferWidth,N.drawingBufferHeight];var q={model:H,view:$,projection:U,clipBounds:V,pickId:this.pickId/255},Y=this.pickShader;if(Y.bind(),Y.uniforms=q,this.triangleCount>0&&(this.triangleVAO.bind(),N.drawArrays(N.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),N.lineWidth(this.lineWidth*this.pixelRatio),N.drawArrays(N.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var Y=this.pointPickShader;Y.bind(),Y.uniforms=q,this.pointVAO.bind(),N.drawArrays(N.POINTS,0,this.pointCount),this.pointVAO.unbind()}},R.pick=function(J){if(!J||J.id!==this.pickId)return null;for(var N=J.value[0]+256*J.value[1]+65536*J.value[2],H=this.cells[N],$=this.positions,U=new Array(H.length),V=0;VMath.abs(b))v.rotate(F,0,0,-A*E*Math.PI*w.rotateSpeed/window.innerWidth);else if(!w._ortho){var D=-w.zoomSpeed*T*b/window.innerHeight*(F-v.lastT())/20;v.pan(F,0,0,S*(Math.exp(D)-1))}}},!0)},w.enableMouseListeners(),w}},799(s,l,n){var u=n(3236),c=n(9405),f=u([`precision mediump float; #define GLSLIFY 1 attribute vec2 position; varying vec2 uv; @@ -1241,7 +1241,7 @@ varying vec2 uv; void main() { vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); gl_FragColor = min(vec4(1,1,1,1), accum); -}`]);s.exports=function(d){return c(d,f,h,null,[{name:"position",type:"vec2"}])}},4100(s,l,n){"use strict";var u=n(4437),c=n(3837),f=n(5445),h=n(4449),d=n(3589),p=n(2260),g=n(7169),m=n(351),y=n(4772),_=n(4040),v=n(799),x=n(2431)({tablet:!0,featureDetect:!0});s.exports={createScene:k,createCamera:u};function S(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function M(b,E){var T=null;try{T=b.getContext("webgl",E),T||(T=b.getContext("experimental-webgl",E))}catch{return null}return T}function C(b){var E=Math.round(Math.log(Math.abs(b))/Math.log(10));if(E<0){var T=Math.round(Math.pow(10,-E));return Math.ceil(b*T)/T}else if(E>0){var T=Math.round(Math.pow(10,E));return Math.ceil(b/T)*T}return Math.ceil(b)}function w(b){return typeof b=="boolean"?b:!0}function k(b){b=b||{},b.camera=b.camera||{};var E=b.canvas;if(!E)if(E=document.createElement("canvas"),b.container){var T=b.container;T.appendChild(E)}else document.body.appendChild(E);var F=b.gl;if(F||(b.glOptions&&(x=!!b.glOptions.preserveDrawingBuffer),F=M(E,b.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:x})),!F)throw new Error("webgl not supported");var D=b.bounds||[[-10,-10,-10],[10,10,10]],R=new S,P=p(F,F.drawingBufferWidth,F.drawingBufferHeight,{preferFloat:!x}),z=v(F),I=b.cameraObject&&b.cameraObject._ortho===!0||b.camera.projection&&b.camera.projection.type==="orthographic"||!1,L={eye:b.camera.eye||[2,0,0],center:b.camera.center||[0,0,0],up:b.camera.up||[0,1,0],zoomMin:b.camera.zoomMax||.1,zoomMax:b.camera.zoomMin||100,mode:b.camera.mode||"turntable",_ortho:I},B=b.axes||{},O=c(F,B);O.enable=!B.disable;var G=b.spikes||{},W=h(F,G),X=[],Z=[],J=[],N=[],H=!0,j=!0,$=new Array(16),U=new Array(16),V={view:null,projection:$,model:U,_ortho:!1},j=!0,q=[F.drawingBufferWidth,F.drawingBufferHeight],Y=b.cameraObject||u(E,L),K={gl:F,contextLost:!1,pixelRatio:b.pixelRatio||1,canvas:E,selection:R,camera:Y,axes:O,axesPixels:null,spikes:W,bounds:D,objects:X,shape:q,aspect:b.aspectRatio||[1,1,1],pickRadius:b.pickRadius||10,zNear:b.zNear||.01,zFar:b.zFar||1e3,fovy:b.fovy||Math.PI/4,clearColor:b.clearColor||[0,0,0,0],autoResize:w(b.autoResize),autoBounds:w(b.autoBounds),autoScale:!!b.autoScale,autoCenter:w(b.autoCenter),clipToBounds:w(b.clipToBounds),snapToData:!!b.snapToData,onselect:b.onselect||null,onrender:b.onrender||null,onclick:b.onclick||null,cameraParams:V,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(ae){this.aspect[0]=ae.x,this.aspect[1]=ae.y,this.aspect[2]=ae.z,j=!0},setBounds:function(ae,ee){this.bounds[0][ae]=ee.min,this.bounds[1][ae]=ee.max},setClearColor:function(ae){this.clearColor=ae},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},te=[F.drawingBufferWidth/K.pixelRatio|0,F.drawingBufferHeight/K.pixelRatio|0];function ne(){if(!K._stopped&&K.autoResize){var ae=E.parentNode,ee=1,ie=1;ae&&ae!==document.body?(ee=ae.clientWidth,ie=ae.clientHeight):(ee=window.innerWidth,ie=window.innerHeight);var Q=Math.ceil(ee*K.pixelRatio)|0,ue=Math.ceil(ie*K.pixelRatio)|0;if(Q!==E.width||ue!==E.height){E.width=Q,E.height=ue;var ge=E.style;ge.position=ge.position||"absolute",ge.left="0px",ge.top="0px",ge.width=ee+"px",ge.height=ie+"px",H=!0}}}K.autoResize&&ne(),window.addEventListener("resize",ne);function se(){for(var ae=X.length,ee=N.length,ie=0;ie0&&J[ee-1]===0;)J.pop(),N.pop().dispose()}K.update=function(ae){K._stopped||(ae=ae||{},H=!0,j=!0)},K.add=function(ae){K._stopped||(ae.axes=O,X.push(ae),Z.push(-1),H=!0,j=!0,se())},K.remove=function(ae){if(!K._stopped){var ee=X.indexOf(ae);ee<0||(X.splice(ee,1),Z.pop(),H=!0,j=!0,se())}},K.dispose=function(){if(!K._stopped&&(K._stopped=!0,window.removeEventListener("resize",ne),E.removeEventListener("webglcontextlost",le),K.mouseListener.enabled=!1,!K.contextLost)){O.dispose(),W.dispose();for(var ae=0;aeR.distance)continue;for(var Ve=0;Ve1e-6?(x=Math.acos(S),M=Math.sin(x),C=Math.sin((1-f)*x)/M,w=Math.sin(f*x)/M):(C=1-f,w=f),n[0]=C*h+w*m,n[1]=C*d+w*y,n[2]=C*p+w*_,n[3]=C*g+w*v,n}},5964(s){"use strict";s.exports=function(l){return!l&&l!==0?"":l.toString()}},9366(s,l,n){"use strict";var u=n(4359);s.exports=f;var c={};function f(h,d,p){var g=[d.style,d.weight,d.variant,d.family].join("_"),m=c[g];if(m||(m=c[g]={}),h in m)return m[h];var y={textAlign:"center",textBaseline:"middle",lineHeight:1,font:d.family,fontStyle:d.style,fontWeight:d.weight,fontVariant:d.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};y.triangles=!0;var _=u(h,y);y.triangles=!1;var v=u(h,y),x,S;if(p&&p!==1){for(x=0;x<_.positions.length;++x)for(S=0;S<_.positions[x].length;++S)_.positions[x][S]/=p;for(x=0;x0){var T=Math.round(Math.pow(10,E));return Math.ceil(b/T)*T}return Math.ceil(b)}function w(b){return typeof b=="boolean"?b:!0}function k(b){b=b||{},b.camera=b.camera||{};var E=b.canvas;if(!E)if(E=document.createElement("canvas"),b.container){var T=b.container;T.appendChild(E)}else document.body.appendChild(E);var F=b.gl;if(F||(b.glOptions&&(x=!!b.glOptions.preserveDrawingBuffer),F=M(E,b.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:x})),!F)throw new Error("webgl not supported");var D=b.bounds||[[-10,-10,-10],[10,10,10]],R=new S,P=p(F,F.drawingBufferWidth,F.drawingBufferHeight,{preferFloat:!x}),z=v(F),I=b.cameraObject&&b.cameraObject._ortho===!0||b.camera.projection&&b.camera.projection.type==="orthographic"||!1,L={eye:b.camera.eye||[2,0,0],center:b.camera.center||[0,0,0],up:b.camera.up||[0,1,0],zoomMin:b.camera.zoomMax||.1,zoomMax:b.camera.zoomMin||100,mode:b.camera.mode||"turntable",_ortho:I},B=b.axes||{},O=c(F,B);O.enable=!B.disable;var G=b.spikes||{},W=h(F,G),X=[],Z=[],J=[],N=[],H=!0,j=!0,$=new Array(16),U=new Array(16),V={view:null,projection:$,model:U,_ortho:!1},j=!0,q=[F.drawingBufferWidth,F.drawingBufferHeight],Y=b.cameraObject||u(E,L),K={gl:F,contextLost:!1,pixelRatio:b.pixelRatio||1,canvas:E,selection:R,camera:Y,axes:O,axesPixels:null,spikes:W,bounds:D,objects:X,shape:q,aspect:b.aspectRatio||[1,1,1],pickRadius:b.pickRadius||10,zNear:b.zNear||.01,zFar:b.zFar||1e3,fovy:b.fovy||Math.PI/4,clearColor:b.clearColor||[0,0,0,0],autoResize:w(b.autoResize),autoBounds:w(b.autoBounds),autoScale:!!b.autoScale,autoCenter:w(b.autoCenter),clipToBounds:w(b.clipToBounds),snapToData:!!b.snapToData,onselect:b.onselect||null,onrender:b.onrender||null,onclick:b.onclick||null,cameraParams:V,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(ae){this.aspect[0]=ae.x,this.aspect[1]=ae.y,this.aspect[2]=ae.z,j=!0},setBounds:function(ae,ee){this.bounds[0][ae]=ee.min,this.bounds[1][ae]=ee.max},setClearColor:function(ae){this.clearColor=ae},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},te=[F.drawingBufferWidth/K.pixelRatio|0,F.drawingBufferHeight/K.pixelRatio|0];function ne(){if(!K._stopped&&K.autoResize){var ae=E.parentNode,ee=1,ie=1;ae&&ae!==document.body?(ee=ae.clientWidth,ie=ae.clientHeight):(ee=window.innerWidth,ie=window.innerHeight);var Q=Math.ceil(ee*K.pixelRatio)|0,ue=Math.ceil(ie*K.pixelRatio)|0;if(Q!==E.width||ue!==E.height){E.width=Q,E.height=ue;var ge=E.style;ge.position=ge.position||"absolute",ge.left="0px",ge.top="0px",ge.width=ee+"px",ge.height=ie+"px",H=!0}}}K.autoResize&&ne(),window.addEventListener("resize",ne);function se(){for(var ae=X.length,ee=N.length,ie=0;ie0&&J[ee-1]===0;)J.pop(),N.pop().dispose()}K.update=function(ae){K._stopped||(ae=ae||{},H=!0,j=!0)},K.add=function(ae){K._stopped||(ae.axes=O,X.push(ae),Z.push(-1),H=!0,j=!0,se())},K.remove=function(ae){if(!K._stopped){var ee=X.indexOf(ae);ee<0||(X.splice(ee,1),Z.pop(),H=!0,j=!0,se())}},K.dispose=function(){if(!K._stopped&&(K._stopped=!0,window.removeEventListener("resize",ne),E.removeEventListener("webglcontextlost",le),K.mouseListener.enabled=!1,!K.contextLost)){O.dispose(),W.dispose();for(var ae=0;aeR.distance)continue;for(var Ve=0;Ve1e-6?(x=Math.acos(S),M=Math.sin(x),C=Math.sin((1-f)*x)/M,w=Math.sin(f*x)/M):(C=1-f,w=f),n[0]=C*h+w*m,n[1]=C*d+w*y,n[2]=C*p+w*_,n[3]=C*g+w*v,n}},5964(s){"use strict";s.exports=function(l){return!l&&l!==0?"":l.toString()}},9366(s,l,n){"use strict";var u=n(4359);s.exports=f;var c={};function f(h,d,p){var g=[d.style,d.weight,d.variant,d.family].join("_"),m=c[g];if(m||(m=c[g]={}),h in m)return m[h];var y={textAlign:"center",textBaseline:"middle",lineHeight:1,font:d.family,fontStyle:d.style,fontWeight:d.weight,fontVariant:d.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};y.triangles=!0;var _=u(h,y);y.triangles=!1;var v=u(h,y),x,S;if(p&&p!==1){for(x=0;x<_.positions.length;++x)for(S=0;S<_.positions[x].length;++S)_.positions[x][S]/=p;for(x=0;x1?1:U}function A(U,V,j,q,Y,K,te,ne,se,le,ce,pe){this.gl=U,this.pixelRatio=1,this.shader=V,this.orthoShader=j,this.projectShader=q,this.pointBuffer=Y,this.colorBuffer=K,this.glyphBuffer=te,this.idBuffer=ne,this.vao=se,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=le,this.pickOrthoShader=ce,this.pickProjectShader=pe,this.points=[],this._selectResult=new w(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var b=A.prototype;b.pickSlots=1,b.setPickBase=function(U){this.pickId=U},b.isTransparent=function(){if(this.hasAlpha)return!0;for(var U=0;U<3;++U)if(this.axesProject[U]&&this.projectHasAlpha)return!0;return!1},b.isOpaque=function(){if(!this.hasAlpha)return!0;for(var U=0;U<3;++U)if(this.axesProject[U]&&!this.projectHasAlpha)return!0;return!1};var E=[0,0],T=[0,0,0],F=[0,0,0],D=[0,0,0,1],R=[0,0,0,1],P=y.slice(),z=[0,0,0],I=[[0,0,0],[0,0,0]];function L(U){return U[0]=U[1]=U[2]=0,U}function B(U,V){return U[0]=V[0],U[1]=V[1],U[2]=V[2],U[3]=1,U}function O(U,V,j,q){return U[0]=V[0],U[1]=V[1],U[2]=V[2],U[j]=q,U}function G(U){for(var V=I,j=0;j<2;++j)for(var q=0;q<3;++q)V[j][q]=Math.max(Math.min(U[j][q],1e8),-1e8);return V}function W(U,V,j,q){var Y=V.axesProject,K=V.gl,te=U.uniforms,ne=j.model||y,se=j.view||y,le=j.projection||y,ce=V.axesBounds,pe=G(V.clipBounds),xe;V.axes&&V.axes.lastCubeProps?xe=V.axes.lastCubeProps.axis:xe=[1,1,1],E[0]=2/K.drawingBufferWidth,E[1]=2/K.drawingBufferHeight,U.bind(),te.view=se,te.projection=le,te.screenSize=E,te.highlightId=V.highlightId,te.highlightScale=V.highlightScale,te.clipBounds=pe,te.pickGroup=V.pickId/255,te.pixelRatio=q;for(var ye=0;ye<3;++ye)if(Y[ye]){te.scale=V.projectScale[ye],te.opacity=V.projectOpacity[ye];for(var fe=P,ae=0;ae<16;++ae)fe[ae]=0;for(var ae=0;ae<4;++ae)fe[5*ae]=1;fe[5*ye]=0,xe[ye]<0?fe[12+ye]=ce[0][ye]:fe[12+ye]=ce[1][ye],d(fe,ne,fe),te.model=fe;var ee=(ye+1)%3,ie=(ye+2)%3,Q=L(T),ue=L(F);Q[ee]=1,ue[ie]=1;var ge=C(le,se,ne,B(D,Q)),Me=C(le,se,ne,B(R,ue));if(Math.abs(ge[1])>Math.abs(Me[1])){var Te=ge;ge=Me,Me=Te,Te=Q,Q=ue,ue=Te;var je=ee;ee=ie,ie=je}ge[0]<0&&(Q[ee]=-1),Me[1]>0&&(ue[ie]=-1);for(var Ve=0,Ze=0,ae=0;ae<4;++ae)Ve+=Math.pow(ne[4*ee+ae],2),Ze+=Math.pow(ne[4*ie+ae],2);Q[ee]/=Math.sqrt(Ve),ue[ie]/=Math.sqrt(Ze),te.axes[0]=Q,te.axes[1]=ue,te.fragClipBounds[0]=O(z,pe[0],ye,-1e8),te.fragClipBounds[1]=O(z,pe[1],ye,1e8),V.vao.bind(),V.vao.draw(K.TRIANGLES,V.vertexCount),V.lineWidth>0&&(K.lineWidth(V.lineWidth*q),V.vao.draw(K.LINES,V.lineVertexCount,V.vertexCount)),V.vao.unbind()}}var X=[-1e8,-1e8,-1e8],Z=[1e8,1e8,1e8],J=[X,Z];function N(U,V,j,q,Y,K,te){var ne=j.gl;if((K===j.projectHasAlpha||te)&&W(V,j,q,Y),K===j.hasAlpha||te){U.bind();var se=U.uniforms;se.model=q.model||y,se.view=q.view||y,se.projection=q.projection||y,E[0]=2/ne.drawingBufferWidth,E[1]=2/ne.drawingBufferHeight,se.screenSize=E,se.highlightId=j.highlightId,se.highlightScale=j.highlightScale,se.fragClipBounds=J,se.clipBounds=j.axes.bounds,se.opacity=j.opacity,se.pickGroup=j.pickId/255,se.pixelRatio=Y,j.vao.bind(),j.vao.draw(ne.TRIANGLES,j.vertexCount),j.lineWidth>0&&(ne.lineWidth(j.lineWidth*Y),j.vao.draw(ne.LINES,j.lineVertexCount,j.vertexCount)),j.vao.unbind()}}b.draw=function(U){var V=this.useOrtho?this.orthoShader:this.shader;N(V,this.projectShader,this,U,this.pixelRatio,!1,!1)},b.drawTransparent=function(U){var V=this.useOrtho?this.orthoShader:this.shader;N(V,this.projectShader,this,U,this.pixelRatio,!0,!1)},b.drawPick=function(U){var V=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;N(V,this.pickProjectShader,this,U,1,!0,!0)},b.pick=function(U){if(!U||U.id!==this.pickId)return null;var V=U.value[2]+(U.value[1]<<8)+(U.value[0]<<16);if(V>=this.pointCount||V<0)return null;var j=this.points[V],q=this._selectResult;q.index=V;for(var Y=0;Y<3;++Y)q.position[Y]=q.dataCoordinate[Y]=j[Y];return q},b.highlight=function(U){if(!U)this.highlightId=[1,1,1,1];else{var V=U.index,j=V&255,q=V>>8&255,Y=V>>16&255;this.highlightId=[j/255,q/255,Y/255,0]}};function H(U,V,j,q){var Y;S(U)?V0){var Mt=0,lt=ie,qe=[0,0,0,1],Ye=[0,0,0,1],me=S(xe)&&S(xe[0]),_e=S(ae)&&S(ae[0]);e:for(var q=0;q0?1-Ze[0][0]:at<0?1+Ze[1][0]:1,rt*=rt>0?1-Ze[0][1]:rt<0?1+Ze[1][1]:1;for(var ft=[at,rt],gt=je.cells||[],yt=je.positions||[],Me=0;Methis.buffer.length){c.free(this.buffer);for(var S=this.buffer=c.mallocUint8(h(x*v*4)),M=0;MS)for(v=S;vx)for(v=x;v=0){for(var I=z.type.charAt(z.type.length-1)|0,L=new Array(I),B=0;B=0;)O+=1;R[P]=O}var G=new Array(S.length);function W(){w.program=h.program(k,w._vref,w._fref,D,R);for(var X=0;X1?1:U}function A(U,V,j,q,Y,K,te,ne,se,le,ce,pe){this.gl=U,this.pixelRatio=1,this.shader=V,this.orthoShader=j,this.projectShader=q,this.pointBuffer=Y,this.colorBuffer=K,this.glyphBuffer=te,this.idBuffer=ne,this.vao=se,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=le,this.pickOrthoShader=ce,this.pickProjectShader=pe,this.points=[],this._selectResult=new w(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var b=A.prototype;b.pickSlots=1,b.setPickBase=function(U){this.pickId=U},b.isTransparent=function(){if(this.hasAlpha)return!0;for(var U=0;U<3;++U)if(this.axesProject[U]&&this.projectHasAlpha)return!0;return!1},b.isOpaque=function(){if(!this.hasAlpha)return!0;for(var U=0;U<3;++U)if(this.axesProject[U]&&!this.projectHasAlpha)return!0;return!1};var E=[0,0],T=[0,0,0],F=[0,0,0],D=[0,0,0,1],R=[0,0,0,1],P=y.slice(),z=[0,0,0],I=[[0,0,0],[0,0,0]];function L(U){return U[0]=U[1]=U[2]=0,U}function B(U,V){return U[0]=V[0],U[1]=V[1],U[2]=V[2],U[3]=1,U}function O(U,V,j,q){return U[0]=V[0],U[1]=V[1],U[2]=V[2],U[j]=q,U}function G(U){for(var V=I,j=0;j<2;++j)for(var q=0;q<3;++q)V[j][q]=Math.max(Math.min(U[j][q],1e8),-1e8);return V}function W(U,V,j,q){var Y=V.axesProject,K=V.gl,te=U.uniforms,ne=j.model||y,se=j.view||y,le=j.projection||y,ce=V.axesBounds,pe=G(V.clipBounds),xe;V.axes&&V.axes.lastCubeProps?xe=V.axes.lastCubeProps.axis:xe=[1,1,1],E[0]=2/K.drawingBufferWidth,E[1]=2/K.drawingBufferHeight,U.bind(),te.view=se,te.projection=le,te.screenSize=E,te.highlightId=V.highlightId,te.highlightScale=V.highlightScale,te.clipBounds=pe,te.pickGroup=V.pickId/255,te.pixelRatio=q;for(var ye=0;ye<3;++ye)if(Y[ye]){te.scale=V.projectScale[ye],te.opacity=V.projectOpacity[ye];for(var fe=P,ae=0;ae<16;++ae)fe[ae]=0;for(var ae=0;ae<4;++ae)fe[5*ae]=1;fe[5*ye]=0,xe[ye]<0?fe[12+ye]=ce[0][ye]:fe[12+ye]=ce[1][ye],d(fe,ne,fe),te.model=fe;var ee=(ye+1)%3,ie=(ye+2)%3,Q=L(T),ue=L(F);Q[ee]=1,ue[ie]=1;var ge=C(le,se,ne,B(D,Q)),Me=C(le,se,ne,B(R,ue));if(Math.abs(ge[1])>Math.abs(Me[1])){var Te=ge;ge=Me,Me=Te,Te=Q,Q=ue,ue=Te;var je=ee;ee=ie,ie=je}ge[0]<0&&(Q[ee]=-1),Me[1]>0&&(ue[ie]=-1);for(var Ve=0,Ke=0,ae=0;ae<4;++ae)Ve+=Math.pow(ne[4*ee+ae],2),Ke+=Math.pow(ne[4*ie+ae],2);Q[ee]/=Math.sqrt(Ve),ue[ie]/=Math.sqrt(Ke),te.axes[0]=Q,te.axes[1]=ue,te.fragClipBounds[0]=O(z,pe[0],ye,-1e8),te.fragClipBounds[1]=O(z,pe[1],ye,1e8),V.vao.bind(),V.vao.draw(K.TRIANGLES,V.vertexCount),V.lineWidth>0&&(K.lineWidth(V.lineWidth*q),V.vao.draw(K.LINES,V.lineVertexCount,V.vertexCount)),V.vao.unbind()}}var X=[-1e8,-1e8,-1e8],Z=[1e8,1e8,1e8],J=[X,Z];function N(U,V,j,q,Y,K,te){var ne=j.gl;if((K===j.projectHasAlpha||te)&&W(V,j,q,Y),K===j.hasAlpha||te){U.bind();var se=U.uniforms;se.model=q.model||y,se.view=q.view||y,se.projection=q.projection||y,E[0]=2/ne.drawingBufferWidth,E[1]=2/ne.drawingBufferHeight,se.screenSize=E,se.highlightId=j.highlightId,se.highlightScale=j.highlightScale,se.fragClipBounds=J,se.clipBounds=j.axes.bounds,se.opacity=j.opacity,se.pickGroup=j.pickId/255,se.pixelRatio=Y,j.vao.bind(),j.vao.draw(ne.TRIANGLES,j.vertexCount),j.lineWidth>0&&(ne.lineWidth(j.lineWidth*Y),j.vao.draw(ne.LINES,j.lineVertexCount,j.vertexCount)),j.vao.unbind()}}b.draw=function(U){var V=this.useOrtho?this.orthoShader:this.shader;N(V,this.projectShader,this,U,this.pixelRatio,!1,!1)},b.drawTransparent=function(U){var V=this.useOrtho?this.orthoShader:this.shader;N(V,this.projectShader,this,U,this.pixelRatio,!0,!1)},b.drawPick=function(U){var V=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;N(V,this.pickProjectShader,this,U,1,!0,!0)},b.pick=function(U){if(!U||U.id!==this.pickId)return null;var V=U.value[2]+(U.value[1]<<8)+(U.value[0]<<16);if(V>=this.pointCount||V<0)return null;var j=this.points[V],q=this._selectResult;q.index=V;for(var Y=0;Y<3;++Y)q.position[Y]=q.dataCoordinate[Y]=j[Y];return q},b.highlight=function(U){if(!U)this.highlightId=[1,1,1,1];else{var V=U.index,j=V&255,q=V>>8&255,Y=V>>16&255;this.highlightId=[j/255,q/255,Y/255,0]}};function H(U,V,j,q){var Y;S(U)?V0){var Mt=0,lt=ie,qe=[0,0,0,1],Ye=[0,0,0,1],me=S(xe)&&S(xe[0]),_e=S(ae)&&S(ae[0]);e:for(var q=0;q0?1-Ke[0][0]:at<0?1+Ke[1][0]:1,rt*=rt>0?1-Ke[0][1]:rt<0?1+Ke[1][1]:1;for(var ht=[at,rt],gt=je.cells||[],yt=je.positions||[],Me=0;Methis.buffer.length){c.free(this.buffer);for(var S=this.buffer=c.mallocUint8(h(x*v*4)),M=0;MS)for(v=S;vx)for(v=x;v=0){for(var I=z.type.charAt(z.type.length-1)|0,L=new Array(I),B=0;B=0;)O+=1;R[P]=O}var G=new Array(S.length);function W(){w.program=h.program(k,w._vref,w._fref,D,R);for(var X=0;X=0){var b=k.charCodeAt(k.length-1)-48;if(b<2||b>4)throw new u("","Invalid data type for attribute "+w+": "+k);d(m,y,A[0],v,b,x,w)}else if(k.indexOf("mat")>=0){var b=k.charCodeAt(k.length-1)-48;if(b<2||b>4)throw new u("","Invalid data type for attribute "+w+": "+k);p(m,y,A,v,b,x,w)}else throw new u("","Unknown data type for attribute "+w+": "+k);break}}return x}},3327(s,l,n){"use strict";var u=n(216),c=n(8866);s.exports=d;function f(p){return function(){return p}}function h(p,g){for(var m=new Array(p),y=0;y4)throw new c("","Invalid data type");switch(O.charAt(0)){case"b":case"i":p["uniform"+G+"iv"](y[R],P);break;case"v":p["uniform"+G+"fv"](y[R],P);break;default:throw new c("","Unrecognized data type for vector "+name+": "+O)}}else if(O.indexOf("mat")===0&&O.length===4){if(G=O.charCodeAt(O.length-1)-48,G<2||G>4)throw new c("","Invalid uniform dimension type for matrix "+name+": "+O);p["uniformMatrix"+G+"fv"](y[R],!1,P);break}else throw new c("","Unknown uniform data type for "+name+": "+O)}}}}}function x(k,A){if(typeof A!="object")return[[k,A]];var b=[];for(var E in A){var T=A[E],F=k;parseInt(E)+""===E?F+="["+E+"]":F+="."+E,typeof T=="object"?b.push.apply(b,x(F,T)):b.push([F,T])}return b}function S(k){switch(k){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var A=k.indexOf("vec");if(0<=A&&A<=1&&k.length===4+A){var b=k.charCodeAt(k.length-1)-48;if(b<2||b>4)throw new c("","Invalid data type");return k.charAt(0)==="b"?h(b,!1):h(b,0)}else if(k.indexOf("mat")===0&&k.length===4){var b=k.charCodeAt(k.length-1)-48;if(b<2||b>4)throw new c("","Invalid uniform dimension type for matrix "+name+": "+k);return h(b*b,0)}else throw new c("","Unknown uniform data type for "+name+": "+k)}}function M(k,A,b){if(typeof b=="object"){var E=C(b);Object.defineProperty(k,A,{get:f(E),set:v(b),enumerable:!0,configurable:!1})}else y[b]?Object.defineProperty(k,A,{get:_(b),set:v(b),enumerable:!0,configurable:!1}):k[A]=S(m[b].type)}function C(k){var A;if(Array.isArray(k)){A=new Array(k.length);for(var b=0;b1){m[0]in p||(p[m[0]]=[]),p=p[m[0]];for(var y=1;y1)for(var x=0;x<_.size;++x)m.push({name:_.name.replace("[0]","["+x+"]"),type:v});else m.push({name:_.name,type:v})}}return m}function h(d,p){for(var g=d.getProgramParameter(p,d.ACTIVE_ATTRIBUTES),m=[],y=0;y"u"?n(606):WeakMap,h=new f,d=0;function p(M,C,w,k,A,b,E){this.id=M,this.src=C,this.type=w,this.shader=k,this.count=b,this.programs=[],this.cache=E}p.prototype.dispose=function(){if(--this.count===0){for(var M=this.cache,C=M.gl,w=this.programs,k=0,A=w.length;kj&&Y>0){var K=(q[Y][0]-j)/(q[Y][0]-q[Y-1][0]);return q[Y][1]*(1-K)+K*q[Y-1][1]}}return 1}var B=[0,0,0],O={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function G(j,q){var Y,K,te,ne=q.axes&&q.axes.lastCubeProps.axis||B,se=q.showSurface,le=q.showContour;for(Y=0;Y<3;++Y)for(se=se||q.surfaceProject[Y],K=0;K<3;++K)le=le||q.contourProject[Y][K];for(Y=0;Y<3;++Y){var ce=O.projections[Y];for(K=0;K<16;++K)ce[K]=0;for(K=0;K<4;++K)ce[5*K]=1;ce[5*Y]=0,ce[12+Y]=q.axesBounds[+(ne[Y]>0)][Y],v(ce,j.model,ce);var pe=O.clipBounds[Y];for(te=0;te<2;++te)for(K=0;K<3;++K)pe[te][K]=j.clipBounds[te][K];pe[0][Y]=-1e8,pe[1][Y]=1e8}return O.showSurface=se,O.showContour=le,O}var W={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},X=T.slice(),Z=[1,0,0,0,1,0,0,0,1];function J(j,q){j=j||{};var Y=this.gl;Y.disable(Y.CULL_FACE),this._colorMap.bind(0);var K=W;K.model=j.model||T,K.view=j.view||T,K.projection=j.projection||T,K.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],K.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],K.objectOffset=this.objectOffset,K.contourColor=this.contourColor[0],K.inverseModel=x(K.inverseModel,K.model);for(var te=0;te<2;++te)for(var ne=K.clipBounds[te],se=0;se<3;++se)ne[se]=Math.min(Math.max(this.clipBounds[te][se],-1e8),1e8);K.kambient=this.ambientLight,K.kdiffuse=this.diffuseLight,K.kspecular=this.specularLight,K.roughness=this.roughness,K.fresnel=this.fresnel,K.opacity=this.opacity,K.height=0,K.permutation=Z,K.vertexColor=this.vertexColor;var le=X;for(v(le,K.view,K.model),v(le,K.projection,le),x(le,le),te=0;te<3;++te)K.eyePosition[te]=le[12+te]/le[15];var ce=le[15];for(te=0;te<3;++te)ce+=this.lightPosition[te]*le[4*te+3];for(te=0;te<3;++te){var pe=le[12+te];for(se=0;se<3;++se)pe+=le[4*se+te]*this.lightPosition[se];K.lightPosition[te]=pe/ce}var xe=G(K,this);if(xe.showSurface){for(this._shader.bind(),this._shader.uniforms=K,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(Y.TRIANGLES,this._vertexCount),te=0;te<3;++te)!this.surfaceProject[te]||!this.vertexCount||(this._shader.uniforms.model=xe.projections[te],this._shader.uniforms.clipBounds=xe.clipBounds[te],this._vao.draw(Y.TRIANGLES,this._vertexCount));this._vao.unbind()}if(xe.showContour){var ye=this._contourShader;K.kambient=1,K.kdiffuse=0,K.kspecular=0,K.opacity=1,ye.bind(),ye.uniforms=K;var fe=this._contourVAO;for(fe.bind(),te=0;te<3;++te)for(ye.uniforms.permutation=D[te],Y.lineWidth(this.contourWidth[te]*this.pixelRatio),se=0;se>4)/16)/255,te=Math.floor(K),ne=K-te,se=q[1]*(j.value[1]+(j.value[2]&15)/16)/255,le=Math.floor(se),ce=se-le;te+=1,le+=1;var pe=Y.position;pe[0]=pe[1]=pe[2]=0;for(var xe=0;xe<2;++xe)for(var ye=xe?ne:1-ne,fe=0;fe<2;++fe)for(var ae=fe?ce:1-ce,ee=te+xe,ie=le+fe,Q=ye*ae,ue=0;ue<3;++ue)pe[ue]+=this._field[ue].get(ee,ie)*Q;for(var ge=this._pickResult.level,Me=0;Me<3;++Me)if(ge[Me]=S.le(this.contourLevels[Me],pe[Me]),ge[Me]<0)this.contourLevels[Me].length>0&&(ge[Me]=0);else if(ge[Me]Math.abs(je-pe[Me])&&(ge[Me]+=1)}for(Y.index[0]=ne<.5?te:te+1,Y.index[1]=ce<.5?le:le+1,Y.uv[0]=K/q[0],Y.uv[1]=se/q[1],ue=0;ue<3;++ue)Y.dataCoordinate[ue]=this._field[ue].get(Y.index[0],Y.index[1]);return Y},I.padField=function(j,q){var Y=q.shape.slice(),K=j.shape.slice();g.assign(j.lo(1,1).hi(Y[0],Y[1]),q),g.assign(j.lo(1).hi(Y[0],1),q.hi(Y[0],1)),g.assign(j.lo(1,K[1]-1).hi(Y[0],1),q.lo(0,Y[1]-1).hi(Y[0],1)),g.assign(j.lo(0,1).hi(1,Y[1]),q.hi(1)),g.assign(j.lo(K[0]-1,1).hi(1,Y[1]),q.lo(Y[0]-1)),j.set(0,0,q.get(0,0)),j.set(0,K[1]-1,q.get(0,Y[1]-1)),j.set(K[0]-1,0,q.get(Y[0]-1,0)),j.set(K[0]-1,K[1]-1,q.get(Y[0]-1,Y[1]-1))};function H(j,q){return Array.isArray(j)?[q(j[0]),q(j[1]),q(j[2])]:[q(j),q(j),q(j)]}function $(j){return Array.isArray(j)?j.length===3?[j[0],j[1],j[2],1]:[j[0],j[1],j[2],j[3]]:[0,0,0,1]}function U(j){if(Array.isArray(j)){if(Array.isArray(j))return[$(j[0]),$(j[1]),$(j[2])];var q=$(j);return[q.slice(),q.slice(),q.slice()]}}I.update=function(j){j=j||{},this.objectOffset=j.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in j&&(this.contourWidth=H(j.contourWidth,Number)),"showContour"in j&&(this.showContour=H(j.showContour,Boolean)),"showSurface"in j&&(this.showSurface=!!j.showSurface),"contourTint"in j&&(this.contourTint=H(j.contourTint,Boolean)),"contourColor"in j&&(this.contourColor=U(j.contourColor)),"contourProject"in j&&(this.contourProject=H(j.contourProject,function(xi){return H(xi,Boolean)})),"surfaceProject"in j&&(this.surfaceProject=j.surfaceProject),"dynamicColor"in j&&(this.dynamicColor=U(j.dynamicColor)),"dynamicTint"in j&&(this.dynamicTint=H(j.dynamicTint,Number)),"dynamicWidth"in j&&(this.dynamicWidth=H(j.dynamicWidth,Number)),"opacity"in j&&(this.opacity=j.opacity),"opacityscale"in j&&(this.opacityscale=j.opacityscale),"colorBounds"in j&&(this.colorBounds=j.colorBounds),"vertexColor"in j&&(this.vertexColor=j.vertexColor?1:0),"colormap"in j&&this._colorMap.setPixels(this.genColormap(j.colormap,this.opacityscale));var q=j.field||j.coords&&j.coords[2]||null,Y=!1;if(q||(this._field[2].shape[0]||this._field[2].shape[2]?q=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):q=this._field[2].hi(0,0)),"field"in j||"coords"in j){var K=(q.shape[0]+2)*(q.shape[1]+2);K>this._field[2].data.length&&(d.freeFloat(this._field[2].data),this._field[2].data=d.mallocFloat(u.nextPow2(K))),this._field[2]=y(this._field[2].data,[q.shape[0]+2,q.shape[1]+2]),this.padField(this._field[2],q),this.shape=q.shape.slice();for(var te=this.shape,ne=0;ne<2;++ne)this._field[2].size>this._field[ne].data.length&&(d.freeFloat(this._field[ne].data),this._field[ne].data=d.mallocFloat(this._field[2].size)),this._field[ne]=y(this._field[ne].data,[te[0]+2,te[1]+2]);if(j.coords){var se=j.coords;if(!Array.isArray(se)||se.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(ne=0;ne<2;++ne){var le=se[ne];for(fe=0;fe<2;++fe)if(le.shape[fe]!==te[fe])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[ne],le)}}else if(j.ticks){var ce=j.ticks;if(!Array.isArray(ce)||ce.length!==2)throw new Error("gl-surface: invalid ticks");for(ne=0;ne<2;++ne){var pe=ce[ne];if((Array.isArray(pe)||pe.length)&&(pe=y(pe)),pe.shape[0]!==te[ne])throw new Error("gl-surface: invalid tick length");var xe=y(pe.data,te);xe.stride[ne]=pe.stride[0],xe.stride[ne^1]=0,this.padField(this._field[ne],xe)}}else{for(ne=0;ne<2;++ne){var ye=[0,0];ye[ne]=1,this._field[ne]=y(this._field[ne].data,[te[0]+2,te[1]+2],ye,0)}this._field[0].set(0,0,0);for(var fe=0;fe0){for(var ya=0;ya<5;++ya)At.pop();me-=1}continue e}}}gt.push(me)}this._contourOffsets[ht]=fr,this._contourCounts[ht]=gt}var pa=d.mallocFloat(At.length);for(ne=0;neR||F<0||F>R)throw new Error("gl-texture2d: Invalid texture size");return E._shape=[T,F],E.bind(),D.texImage2D(D.TEXTURE_2D,0,E.format,T,F,0,E.format,E.type,null),E._mipLevels=[0],E}function v(E,T,F,D,R,P){this.gl=E,this.handle=T,this.format=R,this.type=P,this._shape=[F,D],this._mipLevels=[0],this._magFilter=E.NEAREST,this._minFilter=E.NEAREST,this._wrapS=E.CLAMP_TO_EDGE,this._wrapT=E.CLAMP_TO_EDGE,this._anisoSamples=1;var z=this,I=[this._wrapS,this._wrapT];Object.defineProperties(I,[{get:function(){return z._wrapS},set:function(B){return z.wrapS=B}},{get:function(){return z._wrapT},set:function(B){return z.wrapT=B}}]),this._wrapVector=I;var L=[this._shape[0],this._shape[1]];Object.defineProperties(L,[{get:function(){return z._shape[0]},set:function(B){return z.width=B}},{get:function(){return z._shape[1]},set:function(B){return z.height=B}}]),this._shapeVector=L}var x=v.prototype;Object.defineProperties(x,{minFilter:{get:function(){return this._minFilter},set:function(E){this.bind();var T=this.gl;if(this.type===T.FLOAT&&h.indexOf(E)>=0&&(T.getExtension("OES_texture_float_linear")||(E=T.NEAREST)),d.indexOf(E)<0)throw new Error("gl-texture2d: Unknown filter mode "+E);return T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MIN_FILTER,E),this._minFilter=E}},magFilter:{get:function(){return this._magFilter},set:function(E){this.bind();var T=this.gl;if(this.type===T.FLOAT&&h.indexOf(E)>=0&&(T.getExtension("OES_texture_float_linear")||(E=T.NEAREST)),d.indexOf(E)<0)throw new Error("gl-texture2d: Unknown filter mode "+E);return T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MAG_FILTER,E),this._magFilter=E}},mipSamples:{get:function(){return this._anisoSamples},set:function(E){var T=this._anisoSamples;if(this._anisoSamples=Math.max(E,1)|0,T!==this._anisoSamples){var F=this.gl.getExtension("EXT_texture_filter_anisotropic");F&&this.gl.texParameterf(this.gl.TEXTURE_2D,F.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(E){if(this.bind(),p.indexOf(E)<0)throw new Error("gl-texture2d: Unknown wrap mode "+E);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,E),this._wrapS=E}},wrapT:{get:function(){return this._wrapT},set:function(E){if(this.bind(),p.indexOf(E)<0)throw new Error("gl-texture2d: Unknown wrap mode "+E);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,E),this._wrapT=E}},wrap:{get:function(){return this._wrapVector},set:function(E){if(Array.isArray(E)||(E=[E,E]),E.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var T=0;T<2;++T)if(p.indexOf(E[T])<0)throw new Error("gl-texture2d: Unknown wrap mode "+E);this._wrapS=E[0],this._wrapT=E[1];var F=this.gl;return this.bind(),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,this._wrapS),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,this._wrapT),E}},shape:{get:function(){return this._shapeVector},set:function(E){if(!Array.isArray(E))E=[E|0,E|0];else if(E.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return _(this,E[0]|0,E[1]|0),[E[0]|0,E[1]|0]}},width:{get:function(){return this._shape[0]},set:function(E){return E=E|0,_(this,E,this._shape[1]),E}},height:{get:function(){return this._shape[1]},set:function(E){return E=E|0,_(this,this._shape[0],E),E}}}),x.bind=function(E){var T=this.gl;return E!==void 0&&T.activeTexture(T.TEXTURE0+(E|0)),T.bindTexture(T.TEXTURE_2D,this.handle),E!==void 0?E|0:T.getParameter(T.ACTIVE_TEXTURE)-T.TEXTURE0},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var E=Math.min(this._shape[0],this._shape[1]),T=0;E>0;++T,E>>>=1)this._mipLevels.indexOf(T)<0&&this._mipLevels.push(T)},x.setPixels=function(E,T,F,D){var R=this.gl;this.bind(),Array.isArray(T)?(D=F,F=T[1]|0,T=T[0]|0):(T=T||0,F=F||0),D=D||0;var P=m(E)?E:E.raw;if(P){var z=this._mipLevels.indexOf(D)<0;z?(R.texImage2D(R.TEXTURE_2D,0,this.format,this.format,this.type,P),this._mipLevels.push(D)):R.texSubImage2D(R.TEXTURE_2D,D,T,F,this.format,this.type,P)}else if(E.shape&&E.stride&&E.data){if(E.shape.length<2||T+E.shape[1]>this._shape[1]>>>D||F+E.shape[0]>this._shape[0]>>>D||T<0||F<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");M(R,T,F,D,this.format,this.type,this._mipLevels,E)}else throw new Error("gl-texture2d: Unsupported data type")};function S(E,T){return E.length===3?T[2]===1&&T[1]===E[0]*E[2]&&T[0]===E[2]:T[0]===1&&T[1]===E[0]}function M(E,T,F,D,R,P,z,I){var L=I.dtype,B=I.shape.slice();if(B.length<2||B.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var O=0,G=0,W=S(B,I.stride.slice());L==="float32"?O=E.FLOAT:L==="float64"?(O=E.FLOAT,W=!1,L="float32"):L==="uint8"?O=E.UNSIGNED_BYTE:(O=E.UNSIGNED_BYTE,W=!1,L="uint8");var X=1;if(B.length===2)G=E.LUMINANCE,B=[B[0],B[1],1],I=u(I.data,B,[I.stride[0],I.stride[1],1],I.offset);else if(B.length===3){if(B[2]===1)G=E.ALPHA;else if(B[2]===2)G=E.LUMINANCE_ALPHA;else if(B[2]===3)G=E.RGB;else if(B[2]===4)G=E.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");X=B[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((G===E.LUMINANCE||G===E.ALPHA)&&(R===E.LUMINANCE||R===E.ALPHA)&&(G=R),G!==R)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var Z=I.size,J=z.indexOf(D)<0;if(J&&z.push(D),O===P&&W)I.offset===0&&I.data.length===Z?J?E.texImage2D(E.TEXTURE_2D,D,R,B[0],B[1],0,R,P,I.data):E.texSubImage2D(E.TEXTURE_2D,D,T,F,B[0],B[1],R,P,I.data):J?E.texImage2D(E.TEXTURE_2D,D,R,B[0],B[1],0,R,P,I.data.subarray(I.offset,I.offset+Z)):E.texSubImage2D(E.TEXTURE_2D,D,T,F,B[0],B[1],R,P,I.data.subarray(I.offset,I.offset+Z));else{var N;P===E.FLOAT?N=f.mallocFloat32(Z):N=f.mallocUint8(Z);var H=u(N,B,[B[2],B[2]*B[0],1]);O===E.FLOAT&&P===E.UNSIGNED_BYTE?y(H,I):c.assign(H,I),J?E.texImage2D(E.TEXTURE_2D,D,R,B[0],B[1],0,R,P,N.subarray(0,Z)):E.texSubImage2D(E.TEXTURE_2D,D,T,F,B[0],B[1],R,P,N.subarray(0,Z)),P===E.FLOAT?f.freeFloat32(N):f.freeUint8(N)}}function C(E){var T=E.createTexture();return E.bindTexture(E.TEXTURE_2D,T),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MIN_FILTER,E.NEAREST),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MAG_FILTER,E.NEAREST),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.CLAMP_TO_EDGE),T}function w(E,T,F,D,R){var P=E.getParameter(E.MAX_TEXTURE_SIZE);if(T<0||T>P||F<0||F>P)throw new Error("gl-texture2d: Invalid texture shape");if(R===E.FLOAT&&!E.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var z=C(E);return E.texImage2D(E.TEXTURE_2D,0,D,T,F,0,D,R,null),new v(E,z,T,F,D,R)}function k(E,T,F,D,R,P){var z=C(E);return E.texImage2D(E.TEXTURE_2D,0,R,R,P,T),new v(E,z,F,D,R,P)}function A(E,T){var F=T.dtype,D=T.shape.slice(),R=E.getParameter(E.MAX_TEXTURE_SIZE);if(D[0]<0||D[0]>R||D[1]<0||D[1]>R)throw new Error("gl-texture2d: Invalid texture size");var P=S(D,T.stride.slice()),z=0;F==="float32"?z=E.FLOAT:F==="float64"?(z=E.FLOAT,P=!1,F="float32"):F==="uint8"?z=E.UNSIGNED_BYTE:(z=E.UNSIGNED_BYTE,P=!1,F="uint8");var I=0;if(D.length===2)I=E.LUMINANCE,D=[D[0],D[1],1],T=u(T.data,D,[T.stride[0],T.stride[1],1],T.offset);else if(D.length===3)if(D[2]===1)I=E.ALPHA;else if(D[2]===2)I=E.LUMINANCE_ALPHA;else if(D[2]===3)I=E.RGB;else if(D[2]===4)I=E.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");z===E.FLOAT&&!E.getExtension("OES_texture_float")&&(z=E.UNSIGNED_BYTE,P=!1);var L,B,O=T.size;if(P)T.offset===0&&T.data.length===O?L=T.data:L=T.data.subarray(T.offset,T.offset+O);else{var G=[D[2],D[2]*D[0],1];B=f.malloc(O,F);var W=u(B,D,G,0);(F==="float32"||F==="float64")&&z===E.UNSIGNED_BYTE?y(W,T):c.assign(W,T),L=B.subarray(0,O)}var X=C(E);return E.texImage2D(E.TEXTURE_2D,0,I,D[0],D[1],0,I,z,L),P||f.free(B),new v(E,X,D[0],D[1],I,z)}function b(E){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(h||g(E),typeof arguments[1]=="number")return w(E,arguments[1],arguments[2],arguments[3]||E.RGBA,arguments[4]||E.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return w(E,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||E.RGBA,arguments[3]||E.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var T=arguments[1],F=m(T)?T:T.raw;if(F)return k(E,F,T.width|0,T.height|0,arguments[2]||E.RGBA,arguments[3]||E.UNSIGNED_BYTE);if(T.shape&&T.data&&T.stride)return A(E,T)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},1433(s){"use strict";function l(n,u,c){u?u.bind():n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,null);var f=n.getParameter(n.MAX_VERTEX_ATTRIBS)|0;if(c){if(c.length>f)throw new Error("gl-vao: Too many vertex attributes");for(var h=0;h1?0:Math.acos(y)}},9226(s){s.exports=l;function l(n,u){return n[0]=Math.ceil(u[0]),n[1]=Math.ceil(u[1]),n[2]=Math.ceil(u[2]),n}},3126(s){s.exports=l;function l(n){var u=new Float32Array(3);return u[0]=n[0],u[1]=n[1],u[2]=n[2],u}},3990(s){s.exports=l;function l(n,u){return n[0]=u[0],n[1]=u[1],n[2]=u[2],n}},1091(s){s.exports=l;function l(){var n=new Float32Array(3);return n[0]=0,n[1]=0,n[2]=0,n}},5911(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=c[0],g=c[1],m=c[2];return n[0]=h*m-d*g,n[1]=d*p-f*m,n[2]=f*g-h*p,n}},5455(s,l,n){s.exports=n(7056)},7056(s){s.exports=l;function l(n,u){var c=u[0]-n[0],f=u[1]-n[1],h=u[2]-n[2];return Math.sqrt(c*c+f*f+h*h)}},4008(s,l,n){s.exports=n(6690)},6690(s){s.exports=l;function l(n,u,c){return n[0]=u[0]/c[0],n[1]=u[1]/c[1],n[2]=u[2]/c[2],n}},244(s){s.exports=l;function l(n,u){return n[0]*u[0]+n[1]*u[1]+n[2]*u[2]}},2613(s){s.exports=1e-6},9922(s,l,n){s.exports=c;var u=n(2613);function c(f,h){var d=f[0],p=f[1],g=f[2],m=h[0],y=h[1],_=h[2];return Math.abs(d-m)<=u*Math.max(1,Math.abs(d),Math.abs(m))&&Math.abs(p-y)<=u*Math.max(1,Math.abs(p),Math.abs(y))&&Math.abs(g-_)<=u*Math.max(1,Math.abs(g),Math.abs(_))}},9265(s){s.exports=l;function l(n,u){return n[0]===u[0]&&n[1]===u[1]&&n[2]===u[2]}},2681(s){s.exports=l;function l(n,u){return n[0]=Math.floor(u[0]),n[1]=Math.floor(u[1]),n[2]=Math.floor(u[2]),n}},5137(s,l,n){s.exports=c;var u=n(1091)();function c(f,h,d,p,g,m){var y,_;for(h||(h=3),d||(d=0),p?_=Math.min(p*h+d,f.length):_=f.length,y=d;y<_;y+=h)u[0]=f[y],u[1]=f[y+1],u[2]=f[y+2],g(u,u,m),f[y]=u[0],f[y+1]=u[1],f[y+2]=u[2];return f}},2825(s){s.exports=l;function l(n,u,c){var f=new Float32Array(3);return f[0]=n,f[1]=u,f[2]=c,f}},2931(s,l,n){s.exports={EPSILON:n(2613),create:n(1091),clone:n(3126),angle:n(8192),fromValues:n(2825),copy:n(3990),set:n(1463),equals:n(9922),exactEquals:n(9265),add:n(5632),subtract:n(6843),sub:n(2229),multiply:n(5847),mul:n(4505),divide:n(6690),div:n(4008),min:n(8107),max:n(7417),floor:n(2681),ceil:n(9226),round:n(2447),scale:n(6621),scaleAndAdd:n(8489),distance:n(7056),dist:n(5455),squaredDistance:n(2953),sqrDist:n(6141),length:n(1387),len:n(868),squaredLength:n(3066),sqrLen:n(5486),negate:n(5093),inverse:n(811),normalize:n(3536),dot:n(244),cross:n(5911),lerp:n(6658),random:n(7636),transformMat4:n(5673),transformMat3:n(492),transformQuat:n(264),rotateX:n(6894),rotateY:n(109),rotateZ:n(8692),forEach:n(5137)}},811(s){s.exports=l;function l(n,u){return n[0]=1/u[0],n[1]=1/u[1],n[2]=1/u[2],n}},868(s,l,n){s.exports=n(1387)},1387(s){s.exports=l;function l(n){var u=n[0],c=n[1],f=n[2];return Math.sqrt(u*u+c*c+f*f)}},6658(s){s.exports=l;function l(n,u,c,f){var h=u[0],d=u[1],p=u[2];return n[0]=h+f*(c[0]-h),n[1]=d+f*(c[1]-d),n[2]=p+f*(c[2]-p),n}},7417(s){s.exports=l;function l(n,u,c){return n[0]=Math.max(u[0],c[0]),n[1]=Math.max(u[1],c[1]),n[2]=Math.max(u[2],c[2]),n}},8107(s){s.exports=l;function l(n,u,c){return n[0]=Math.min(u[0],c[0]),n[1]=Math.min(u[1],c[1]),n[2]=Math.min(u[2],c[2]),n}},4505(s,l,n){s.exports=n(5847)},5847(s){s.exports=l;function l(n,u,c){return n[0]=u[0]*c[0],n[1]=u[1]*c[1],n[2]=u[2]*c[2],n}},5093(s){s.exports=l;function l(n,u){return n[0]=-u[0],n[1]=-u[1],n[2]=-u[2],n}},3536(s){s.exports=l;function l(n,u){var c=u[0],f=u[1],h=u[2],d=c*c+f*f+h*h;return d>0&&(d=1/Math.sqrt(d),n[0]=u[0]*d,n[1]=u[1]*d,n[2]=u[2]*d),n}},7636(s){s.exports=l;function l(n,u){u=u||1;var c=Math.random()*2*Math.PI,f=Math.random()*2-1,h=Math.sqrt(1-f*f)*u;return n[0]=Math.cos(c)*h,n[1]=Math.sin(c)*h,n[2]=f*u,n}},6894(s){s.exports=l;function l(n,u,c,f){var h=c[1],d=c[2],p=u[1]-h,g=u[2]-d,m=Math.sin(f),y=Math.cos(f);return n[0]=u[0],n[1]=h+p*y-g*m,n[2]=d+p*m+g*y,n}},109(s){s.exports=l;function l(n,u,c,f){var h=c[0],d=c[2],p=u[0]-h,g=u[2]-d,m=Math.sin(f),y=Math.cos(f);return n[0]=h+g*m+p*y,n[1]=u[1],n[2]=d+g*y-p*m,n}},8692(s){s.exports=l;function l(n,u,c,f){var h=c[0],d=c[1],p=u[0]-h,g=u[1]-d,m=Math.sin(f),y=Math.cos(f);return n[0]=h+p*y-g*m,n[1]=d+p*m+g*y,n[2]=u[2],n}},2447(s){s.exports=l;function l(n,u){return n[0]=Math.round(u[0]),n[1]=Math.round(u[1]),n[2]=Math.round(u[2]),n}},6621(s){s.exports=l;function l(n,u,c){return n[0]=u[0]*c,n[1]=u[1]*c,n[2]=u[2]*c,n}},8489(s){s.exports=l;function l(n,u,c,f){return n[0]=u[0]+c[0]*f,n[1]=u[1]+c[1]*f,n[2]=u[2]+c[2]*f,n}},1463(s){s.exports=l;function l(n,u,c,f){return n[0]=u,n[1]=c,n[2]=f,n}},6141(s,l,n){s.exports=n(2953)},5486(s,l,n){s.exports=n(3066)},2953(s){s.exports=l;function l(n,u){var c=u[0]-n[0],f=u[1]-n[1],h=u[2]-n[2];return c*c+f*f+h*h}},3066(s){s.exports=l;function l(n){var u=n[0],c=n[1],f=n[2];return u*u+c*c+f*f}},2229(s,l,n){s.exports=n(6843)},6843(s){s.exports=l;function l(n,u,c){return n[0]=u[0]-c[0],n[1]=u[1]-c[1],n[2]=u[2]-c[2],n}},492(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2];return n[0]=f*c[0]+h*c[3]+d*c[6],n[1]=f*c[1]+h*c[4]+d*c[7],n[2]=f*c[2]+h*c[5]+d*c[8],n}},5673(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=c[3]*f+c[7]*h+c[11]*d+c[15];return p=p||1,n[0]=(c[0]*f+c[4]*h+c[8]*d+c[12])/p,n[1]=(c[1]*f+c[5]*h+c[9]*d+c[13])/p,n[2]=(c[2]*f+c[6]*h+c[10]*d+c[14])/p,n}},264(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=c[0],g=c[1],m=c[2],y=c[3],_=g*d-m*h,v=m*f-p*d,x=p*h-g*f;return _*=2,v*=2,x*=2,n[0]=f+y*_+g*x-m*v,n[1]=h+y*v+m*_-p*x,n[2]=d+y*x+p*v-g*_,n}},4361(s){s.exports=l;function l(n,u,c){return n[0]=u[0]+c[0],n[1]=u[1]+c[1],n[2]=u[2]+c[2],n[3]=u[3]+c[3],n}},2335(s){s.exports=l;function l(n){var u=new Float32Array(4);return u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],u}},2933(s){s.exports=l;function l(n,u){return n[0]=u[0],n[1]=u[1],n[2]=u[2],n[3]=u[3],n}},7536(s){s.exports=l;function l(){var n=new Float32Array(4);return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n}},4691(s){s.exports=l;function l(n,u){var c=u[0]-n[0],f=u[1]-n[1],h=u[2]-n[2],d=u[3]-n[3];return Math.sqrt(c*c+f*f+h*h+d*d)}},1373(s){s.exports=l;function l(n,u,c){return n[0]=u[0]/c[0],n[1]=u[1]/c[1],n[2]=u[2]/c[2],n[3]=u[3]/c[3],n}},3750(s){s.exports=l;function l(n,u){return n[0]*u[0]+n[1]*u[1]+n[2]*u[2]+n[3]*u[3]}},3390(s){s.exports=l;function l(n,u,c,f){var h=new Float32Array(4);return h[0]=n,h[1]=u,h[2]=c,h[3]=f,h}},9970(s,l,n){s.exports={create:n(7536),clone:n(2335),fromValues:n(3390),copy:n(2933),set:n(4578),add:n(4361),subtract:n(6860),multiply:n(3576),divide:n(1373),min:n(2334),max:n(160),scale:n(9288),scaleAndAdd:n(4844),distance:n(4691),squaredDistance:n(7960),length:n(6808),squaredLength:n(483),negate:n(1498),inverse:n(4494),normalize:n(5177),dot:n(3750),lerp:n(2573),random:n(9131),transformMat4:n(5352),transformQuat:n(4041)}},4494(s){s.exports=l;function l(n,u){return n[0]=1/u[0],n[1]=1/u[1],n[2]=1/u[2],n[3]=1/u[3],n}},6808(s){s.exports=l;function l(n){var u=n[0],c=n[1],f=n[2],h=n[3];return Math.sqrt(u*u+c*c+f*f+h*h)}},2573(s){s.exports=l;function l(n,u,c,f){var h=u[0],d=u[1],p=u[2],g=u[3];return n[0]=h+f*(c[0]-h),n[1]=d+f*(c[1]-d),n[2]=p+f*(c[2]-p),n[3]=g+f*(c[3]-g),n}},160(s){s.exports=l;function l(n,u,c){return n[0]=Math.max(u[0],c[0]),n[1]=Math.max(u[1],c[1]),n[2]=Math.max(u[2],c[2]),n[3]=Math.max(u[3],c[3]),n}},2334(s){s.exports=l;function l(n,u,c){return n[0]=Math.min(u[0],c[0]),n[1]=Math.min(u[1],c[1]),n[2]=Math.min(u[2],c[2]),n[3]=Math.min(u[3],c[3]),n}},3576(s){s.exports=l;function l(n,u,c){return n[0]=u[0]*c[0],n[1]=u[1]*c[1],n[2]=u[2]*c[2],n[3]=u[3]*c[3],n}},1498(s){s.exports=l;function l(n,u){return n[0]=-u[0],n[1]=-u[1],n[2]=-u[2],n[3]=-u[3],n}},5177(s){s.exports=l;function l(n,u){var c=u[0],f=u[1],h=u[2],d=u[3],p=c*c+f*f+h*h+d*d;return p>0&&(p=1/Math.sqrt(p),n[0]=c*p,n[1]=f*p,n[2]=h*p,n[3]=d*p),n}},9131(s,l,n){var u=n(5177),c=n(9288);s.exports=f;function f(h,d){return d=d||1,h[0]=Math.random(),h[1]=Math.random(),h[2]=Math.random(),h[3]=Math.random(),u(h,h),c(h,h,d),h}},9288(s){s.exports=l;function l(n,u,c){return n[0]=u[0]*c,n[1]=u[1]*c,n[2]=u[2]*c,n[3]=u[3]*c,n}},4844(s){s.exports=l;function l(n,u,c,f){return n[0]=u[0]+c[0]*f,n[1]=u[1]+c[1]*f,n[2]=u[2]+c[2]*f,n[3]=u[3]+c[3]*f,n}},4578(s){s.exports=l;function l(n,u,c,f,h){return n[0]=u,n[1]=c,n[2]=f,n[3]=h,n}},7960(s){s.exports=l;function l(n,u){var c=u[0]-n[0],f=u[1]-n[1],h=u[2]-n[2],d=u[3]-n[3];return c*c+f*f+h*h+d*d}},483(s){s.exports=l;function l(n){var u=n[0],c=n[1],f=n[2],h=n[3];return u*u+c*c+f*f+h*h}},6860(s){s.exports=l;function l(n,u,c){return n[0]=u[0]-c[0],n[1]=u[1]-c[1],n[2]=u[2]-c[2],n[3]=u[3]-c[3],n}},5352(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=u[3];return n[0]=c[0]*f+c[4]*h+c[8]*d+c[12]*p,n[1]=c[1]*f+c[5]*h+c[9]*d+c[13]*p,n[2]=c[2]*f+c[6]*h+c[10]*d+c[14]*p,n[3]=c[3]*f+c[7]*h+c[11]*d+c[15]*p,n}},4041(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=c[0],g=c[1],m=c[2],y=c[3],_=y*f+g*d-m*h,v=y*h+m*f-p*d,x=y*d+p*h-g*f,S=-p*f-g*h-m*d;return n[0]=_*y+S*-p+v*-m-x*-g,n[1]=v*y+S*-g+x*-p-_*-m,n[2]=x*y+S*-m+_*-g-v*-p,n[3]=u[3],n}},1848(s,l,n){var u=n(4905),c=n(6468);s.exports=f;function f(h){for(var d=Array.isArray(h)?h:u(h),p=0;pj&&Y>0){var K=(q[Y][0]-j)/(q[Y][0]-q[Y-1][0]);return q[Y][1]*(1-K)+K*q[Y-1][1]}}return 1}var B=[0,0,0],O={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function G(j,q){var Y,K,te,ne=q.axes&&q.axes.lastCubeProps.axis||B,se=q.showSurface,le=q.showContour;for(Y=0;Y<3;++Y)for(se=se||q.surfaceProject[Y],K=0;K<3;++K)le=le||q.contourProject[Y][K];for(Y=0;Y<3;++Y){var ce=O.projections[Y];for(K=0;K<16;++K)ce[K]=0;for(K=0;K<4;++K)ce[5*K]=1;ce[5*Y]=0,ce[12+Y]=q.axesBounds[+(ne[Y]>0)][Y],v(ce,j.model,ce);var pe=O.clipBounds[Y];for(te=0;te<2;++te)for(K=0;K<3;++K)pe[te][K]=j.clipBounds[te][K];pe[0][Y]=-1e8,pe[1][Y]=1e8}return O.showSurface=se,O.showContour=le,O}var W={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},X=T.slice(),Z=[1,0,0,0,1,0,0,0,1];function J(j,q){j=j||{};var Y=this.gl;Y.disable(Y.CULL_FACE),this._colorMap.bind(0);var K=W;K.model=j.model||T,K.view=j.view||T,K.projection=j.projection||T,K.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],K.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],K.objectOffset=this.objectOffset,K.contourColor=this.contourColor[0],K.inverseModel=x(K.inverseModel,K.model);for(var te=0;te<2;++te)for(var ne=K.clipBounds[te],se=0;se<3;++se)ne[se]=Math.min(Math.max(this.clipBounds[te][se],-1e8),1e8);K.kambient=this.ambientLight,K.kdiffuse=this.diffuseLight,K.kspecular=this.specularLight,K.roughness=this.roughness,K.fresnel=this.fresnel,K.opacity=this.opacity,K.height=0,K.permutation=Z,K.vertexColor=this.vertexColor;var le=X;for(v(le,K.view,K.model),v(le,K.projection,le),x(le,le),te=0;te<3;++te)K.eyePosition[te]=le[12+te]/le[15];var ce=le[15];for(te=0;te<3;++te)ce+=this.lightPosition[te]*le[4*te+3];for(te=0;te<3;++te){var pe=le[12+te];for(se=0;se<3;++se)pe+=le[4*se+te]*this.lightPosition[se];K.lightPosition[te]=pe/ce}var xe=G(K,this);if(xe.showSurface){for(this._shader.bind(),this._shader.uniforms=K,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(Y.TRIANGLES,this._vertexCount),te=0;te<3;++te)!this.surfaceProject[te]||!this.vertexCount||(this._shader.uniforms.model=xe.projections[te],this._shader.uniforms.clipBounds=xe.clipBounds[te],this._vao.draw(Y.TRIANGLES,this._vertexCount));this._vao.unbind()}if(xe.showContour){var ye=this._contourShader;K.kambient=1,K.kdiffuse=0,K.kspecular=0,K.opacity=1,ye.bind(),ye.uniforms=K;var fe=this._contourVAO;for(fe.bind(),te=0;te<3;++te)for(ye.uniforms.permutation=D[te],Y.lineWidth(this.contourWidth[te]*this.pixelRatio),se=0;se>4)/16)/255,te=Math.floor(K),ne=K-te,se=q[1]*(j.value[1]+(j.value[2]&15)/16)/255,le=Math.floor(se),ce=se-le;te+=1,le+=1;var pe=Y.position;pe[0]=pe[1]=pe[2]=0;for(var xe=0;xe<2;++xe)for(var ye=xe?ne:1-ne,fe=0;fe<2;++fe)for(var ae=fe?ce:1-ce,ee=te+xe,ie=le+fe,Q=ye*ae,ue=0;ue<3;++ue)pe[ue]+=this._field[ue].get(ee,ie)*Q;for(var ge=this._pickResult.level,Me=0;Me<3;++Me)if(ge[Me]=S.le(this.contourLevels[Me],pe[Me]),ge[Me]<0)this.contourLevels[Me].length>0&&(ge[Me]=0);else if(ge[Me]Math.abs(je-pe[Me])&&(ge[Me]+=1)}for(Y.index[0]=ne<.5?te:te+1,Y.index[1]=ce<.5?le:le+1,Y.uv[0]=K/q[0],Y.uv[1]=se/q[1],ue=0;ue<3;++ue)Y.dataCoordinate[ue]=this._field[ue].get(Y.index[0],Y.index[1]);return Y},I.padField=function(j,q){var Y=q.shape.slice(),K=j.shape.slice();g.assign(j.lo(1,1).hi(Y[0],Y[1]),q),g.assign(j.lo(1).hi(Y[0],1),q.hi(Y[0],1)),g.assign(j.lo(1,K[1]-1).hi(Y[0],1),q.lo(0,Y[1]-1).hi(Y[0],1)),g.assign(j.lo(0,1).hi(1,Y[1]),q.hi(1)),g.assign(j.lo(K[0]-1,1).hi(1,Y[1]),q.lo(Y[0]-1)),j.set(0,0,q.get(0,0)),j.set(0,K[1]-1,q.get(0,Y[1]-1)),j.set(K[0]-1,0,q.get(Y[0]-1,0)),j.set(K[0]-1,K[1]-1,q.get(Y[0]-1,Y[1]-1))};function H(j,q){return Array.isArray(j)?[q(j[0]),q(j[1]),q(j[2])]:[q(j),q(j),q(j)]}function $(j){return Array.isArray(j)?j.length===3?[j[0],j[1],j[2],1]:[j[0],j[1],j[2],j[3]]:[0,0,0,1]}function U(j){if(Array.isArray(j)){if(Array.isArray(j))return[$(j[0]),$(j[1]),$(j[2])];var q=$(j);return[q.slice(),q.slice(),q.slice()]}}I.update=function(j){j=j||{},this.objectOffset=j.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in j&&(this.contourWidth=H(j.contourWidth,Number)),"showContour"in j&&(this.showContour=H(j.showContour,Boolean)),"showSurface"in j&&(this.showSurface=!!j.showSurface),"contourTint"in j&&(this.contourTint=H(j.contourTint,Boolean)),"contourColor"in j&&(this.contourColor=U(j.contourColor)),"contourProject"in j&&(this.contourProject=H(j.contourProject,function(xi){return H(xi,Boolean)})),"surfaceProject"in j&&(this.surfaceProject=j.surfaceProject),"dynamicColor"in j&&(this.dynamicColor=U(j.dynamicColor)),"dynamicTint"in j&&(this.dynamicTint=H(j.dynamicTint,Number)),"dynamicWidth"in j&&(this.dynamicWidth=H(j.dynamicWidth,Number)),"opacity"in j&&(this.opacity=j.opacity),"opacityscale"in j&&(this.opacityscale=j.opacityscale),"colorBounds"in j&&(this.colorBounds=j.colorBounds),"vertexColor"in j&&(this.vertexColor=j.vertexColor?1:0),"colormap"in j&&this._colorMap.setPixels(this.genColormap(j.colormap,this.opacityscale));var q=j.field||j.coords&&j.coords[2]||null,Y=!1;if(q||(this._field[2].shape[0]||this._field[2].shape[2]?q=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):q=this._field[2].hi(0,0)),"field"in j||"coords"in j){var K=(q.shape[0]+2)*(q.shape[1]+2);K>this._field[2].data.length&&(d.freeFloat(this._field[2].data),this._field[2].data=d.mallocFloat(u.nextPow2(K))),this._field[2]=y(this._field[2].data,[q.shape[0]+2,q.shape[1]+2]),this.padField(this._field[2],q),this.shape=q.shape.slice();for(var te=this.shape,ne=0;ne<2;++ne)this._field[2].size>this._field[ne].data.length&&(d.freeFloat(this._field[ne].data),this._field[ne].data=d.mallocFloat(this._field[2].size)),this._field[ne]=y(this._field[ne].data,[te[0]+2,te[1]+2]);if(j.coords){var se=j.coords;if(!Array.isArray(se)||se.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(ne=0;ne<2;++ne){var le=se[ne];for(fe=0;fe<2;++fe)if(le.shape[fe]!==te[fe])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[ne],le)}}else if(j.ticks){var ce=j.ticks;if(!Array.isArray(ce)||ce.length!==2)throw new Error("gl-surface: invalid ticks");for(ne=0;ne<2;++ne){var pe=ce[ne];if((Array.isArray(pe)||pe.length)&&(pe=y(pe)),pe.shape[0]!==te[ne])throw new Error("gl-surface: invalid tick length");var xe=y(pe.data,te);xe.stride[ne]=pe.stride[0],xe.stride[ne^1]=0,this.padField(this._field[ne],xe)}}else{for(ne=0;ne<2;++ne){var ye=[0,0];ye[ne]=1,this._field[ne]=y(this._field[ne].data,[te[0]+2,te[1]+2],ye,0)}this._field[0].set(0,0,0);for(var fe=0;fe0){for(var ya=0;ya<5;++ya)At.pop();me-=1}continue e}}}gt.push(me)}this._contourOffsets[dt]=fr,this._contourCounts[dt]=gt}var pa=d.mallocFloat(At.length);for(ne=0;neR||F<0||F>R)throw new Error("gl-texture2d: Invalid texture size");return E._shape=[T,F],E.bind(),D.texImage2D(D.TEXTURE_2D,0,E.format,T,F,0,E.format,E.type,null),E._mipLevels=[0],E}function v(E,T,F,D,R,P){this.gl=E,this.handle=T,this.format=R,this.type=P,this._shape=[F,D],this._mipLevels=[0],this._magFilter=E.NEAREST,this._minFilter=E.NEAREST,this._wrapS=E.CLAMP_TO_EDGE,this._wrapT=E.CLAMP_TO_EDGE,this._anisoSamples=1;var z=this,I=[this._wrapS,this._wrapT];Object.defineProperties(I,[{get:function(){return z._wrapS},set:function(B){return z.wrapS=B}},{get:function(){return z._wrapT},set:function(B){return z.wrapT=B}}]),this._wrapVector=I;var L=[this._shape[0],this._shape[1]];Object.defineProperties(L,[{get:function(){return z._shape[0]},set:function(B){return z.width=B}},{get:function(){return z._shape[1]},set:function(B){return z.height=B}}]),this._shapeVector=L}var x=v.prototype;Object.defineProperties(x,{minFilter:{get:function(){return this._minFilter},set:function(E){this.bind();var T=this.gl;if(this.type===T.FLOAT&&h.indexOf(E)>=0&&(T.getExtension("OES_texture_float_linear")||(E=T.NEAREST)),d.indexOf(E)<0)throw new Error("gl-texture2d: Unknown filter mode "+E);return T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MIN_FILTER,E),this._minFilter=E}},magFilter:{get:function(){return this._magFilter},set:function(E){this.bind();var T=this.gl;if(this.type===T.FLOAT&&h.indexOf(E)>=0&&(T.getExtension("OES_texture_float_linear")||(E=T.NEAREST)),d.indexOf(E)<0)throw new Error("gl-texture2d: Unknown filter mode "+E);return T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MAG_FILTER,E),this._magFilter=E}},mipSamples:{get:function(){return this._anisoSamples},set:function(E){var T=this._anisoSamples;if(this._anisoSamples=Math.max(E,1)|0,T!==this._anisoSamples){var F=this.gl.getExtension("EXT_texture_filter_anisotropic");F&&this.gl.texParameterf(this.gl.TEXTURE_2D,F.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(E){if(this.bind(),p.indexOf(E)<0)throw new Error("gl-texture2d: Unknown wrap mode "+E);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,E),this._wrapS=E}},wrapT:{get:function(){return this._wrapT},set:function(E){if(this.bind(),p.indexOf(E)<0)throw new Error("gl-texture2d: Unknown wrap mode "+E);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,E),this._wrapT=E}},wrap:{get:function(){return this._wrapVector},set:function(E){if(Array.isArray(E)||(E=[E,E]),E.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var T=0;T<2;++T)if(p.indexOf(E[T])<0)throw new Error("gl-texture2d: Unknown wrap mode "+E);this._wrapS=E[0],this._wrapT=E[1];var F=this.gl;return this.bind(),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,this._wrapS),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,this._wrapT),E}},shape:{get:function(){return this._shapeVector},set:function(E){if(!Array.isArray(E))E=[E|0,E|0];else if(E.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return _(this,E[0]|0,E[1]|0),[E[0]|0,E[1]|0]}},width:{get:function(){return this._shape[0]},set:function(E){return E=E|0,_(this,E,this._shape[1]),E}},height:{get:function(){return this._shape[1]},set:function(E){return E=E|0,_(this,this._shape[0],E),E}}}),x.bind=function(E){var T=this.gl;return E!==void 0&&T.activeTexture(T.TEXTURE0+(E|0)),T.bindTexture(T.TEXTURE_2D,this.handle),E!==void 0?E|0:T.getParameter(T.ACTIVE_TEXTURE)-T.TEXTURE0},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var E=Math.min(this._shape[0],this._shape[1]),T=0;E>0;++T,E>>>=1)this._mipLevels.indexOf(T)<0&&this._mipLevels.push(T)},x.setPixels=function(E,T,F,D){var R=this.gl;this.bind(),Array.isArray(T)?(D=F,F=T[1]|0,T=T[0]|0):(T=T||0,F=F||0),D=D||0;var P=m(E)?E:E.raw;if(P){var z=this._mipLevels.indexOf(D)<0;z?(R.texImage2D(R.TEXTURE_2D,0,this.format,this.format,this.type,P),this._mipLevels.push(D)):R.texSubImage2D(R.TEXTURE_2D,D,T,F,this.format,this.type,P)}else if(E.shape&&E.stride&&E.data){if(E.shape.length<2||T+E.shape[1]>this._shape[1]>>>D||F+E.shape[0]>this._shape[0]>>>D||T<0||F<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");M(R,T,F,D,this.format,this.type,this._mipLevels,E)}else throw new Error("gl-texture2d: Unsupported data type")};function S(E,T){return E.length===3?T[2]===1&&T[1]===E[0]*E[2]&&T[0]===E[2]:T[0]===1&&T[1]===E[0]}function M(E,T,F,D,R,P,z,I){var L=I.dtype,B=I.shape.slice();if(B.length<2||B.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var O=0,G=0,W=S(B,I.stride.slice());L==="float32"?O=E.FLOAT:L==="float64"?(O=E.FLOAT,W=!1,L="float32"):L==="uint8"?O=E.UNSIGNED_BYTE:(O=E.UNSIGNED_BYTE,W=!1,L="uint8");var X=1;if(B.length===2)G=E.LUMINANCE,B=[B[0],B[1],1],I=u(I.data,B,[I.stride[0],I.stride[1],1],I.offset);else if(B.length===3){if(B[2]===1)G=E.ALPHA;else if(B[2]===2)G=E.LUMINANCE_ALPHA;else if(B[2]===3)G=E.RGB;else if(B[2]===4)G=E.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");X=B[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((G===E.LUMINANCE||G===E.ALPHA)&&(R===E.LUMINANCE||R===E.ALPHA)&&(G=R),G!==R)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var Z=I.size,J=z.indexOf(D)<0;if(J&&z.push(D),O===P&&W)I.offset===0&&I.data.length===Z?J?E.texImage2D(E.TEXTURE_2D,D,R,B[0],B[1],0,R,P,I.data):E.texSubImage2D(E.TEXTURE_2D,D,T,F,B[0],B[1],R,P,I.data):J?E.texImage2D(E.TEXTURE_2D,D,R,B[0],B[1],0,R,P,I.data.subarray(I.offset,I.offset+Z)):E.texSubImage2D(E.TEXTURE_2D,D,T,F,B[0],B[1],R,P,I.data.subarray(I.offset,I.offset+Z));else{var N;P===E.FLOAT?N=f.mallocFloat32(Z):N=f.mallocUint8(Z);var H=u(N,B,[B[2],B[2]*B[0],1]);O===E.FLOAT&&P===E.UNSIGNED_BYTE?y(H,I):c.assign(H,I),J?E.texImage2D(E.TEXTURE_2D,D,R,B[0],B[1],0,R,P,N.subarray(0,Z)):E.texSubImage2D(E.TEXTURE_2D,D,T,F,B[0],B[1],R,P,N.subarray(0,Z)),P===E.FLOAT?f.freeFloat32(N):f.freeUint8(N)}}function C(E){var T=E.createTexture();return E.bindTexture(E.TEXTURE_2D,T),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MIN_FILTER,E.NEAREST),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MAG_FILTER,E.NEAREST),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.CLAMP_TO_EDGE),T}function w(E,T,F,D,R){var P=E.getParameter(E.MAX_TEXTURE_SIZE);if(T<0||T>P||F<0||F>P)throw new Error("gl-texture2d: Invalid texture shape");if(R===E.FLOAT&&!E.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var z=C(E);return E.texImage2D(E.TEXTURE_2D,0,D,T,F,0,D,R,null),new v(E,z,T,F,D,R)}function k(E,T,F,D,R,P){var z=C(E);return E.texImage2D(E.TEXTURE_2D,0,R,R,P,T),new v(E,z,F,D,R,P)}function A(E,T){var F=T.dtype,D=T.shape.slice(),R=E.getParameter(E.MAX_TEXTURE_SIZE);if(D[0]<0||D[0]>R||D[1]<0||D[1]>R)throw new Error("gl-texture2d: Invalid texture size");var P=S(D,T.stride.slice()),z=0;F==="float32"?z=E.FLOAT:F==="float64"?(z=E.FLOAT,P=!1,F="float32"):F==="uint8"?z=E.UNSIGNED_BYTE:(z=E.UNSIGNED_BYTE,P=!1,F="uint8");var I=0;if(D.length===2)I=E.LUMINANCE,D=[D[0],D[1],1],T=u(T.data,D,[T.stride[0],T.stride[1],1],T.offset);else if(D.length===3)if(D[2]===1)I=E.ALPHA;else if(D[2]===2)I=E.LUMINANCE_ALPHA;else if(D[2]===3)I=E.RGB;else if(D[2]===4)I=E.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");z===E.FLOAT&&!E.getExtension("OES_texture_float")&&(z=E.UNSIGNED_BYTE,P=!1);var L,B,O=T.size;if(P)T.offset===0&&T.data.length===O?L=T.data:L=T.data.subarray(T.offset,T.offset+O);else{var G=[D[2],D[2]*D[0],1];B=f.malloc(O,F);var W=u(B,D,G,0);(F==="float32"||F==="float64")&&z===E.UNSIGNED_BYTE?y(W,T):c.assign(W,T),L=B.subarray(0,O)}var X=C(E);return E.texImage2D(E.TEXTURE_2D,0,I,D[0],D[1],0,I,z,L),P||f.free(B),new v(E,X,D[0],D[1],I,z)}function b(E){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(h||g(E),typeof arguments[1]=="number")return w(E,arguments[1],arguments[2],arguments[3]||E.RGBA,arguments[4]||E.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return w(E,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||E.RGBA,arguments[3]||E.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var T=arguments[1],F=m(T)?T:T.raw;if(F)return k(E,F,T.width|0,T.height|0,arguments[2]||E.RGBA,arguments[3]||E.UNSIGNED_BYTE);if(T.shape&&T.data&&T.stride)return A(E,T)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},1433(s){"use strict";function l(n,u,c){u?u.bind():n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,null);var f=n.getParameter(n.MAX_VERTEX_ATTRIBS)|0;if(c){if(c.length>f)throw new Error("gl-vao: Too many vertex attributes");for(var h=0;h1?0:Math.acos(y)}},9226(s){s.exports=l;function l(n,u){return n[0]=Math.ceil(u[0]),n[1]=Math.ceil(u[1]),n[2]=Math.ceil(u[2]),n}},3126(s){s.exports=l;function l(n){var u=new Float32Array(3);return u[0]=n[0],u[1]=n[1],u[2]=n[2],u}},3990(s){s.exports=l;function l(n,u){return n[0]=u[0],n[1]=u[1],n[2]=u[2],n}},1091(s){s.exports=l;function l(){var n=new Float32Array(3);return n[0]=0,n[1]=0,n[2]=0,n}},5911(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=c[0],g=c[1],m=c[2];return n[0]=h*m-d*g,n[1]=d*p-f*m,n[2]=f*g-h*p,n}},5455(s,l,n){s.exports=n(7056)},7056(s){s.exports=l;function l(n,u){var c=u[0]-n[0],f=u[1]-n[1],h=u[2]-n[2];return Math.sqrt(c*c+f*f+h*h)}},4008(s,l,n){s.exports=n(6690)},6690(s){s.exports=l;function l(n,u,c){return n[0]=u[0]/c[0],n[1]=u[1]/c[1],n[2]=u[2]/c[2],n}},244(s){s.exports=l;function l(n,u){return n[0]*u[0]+n[1]*u[1]+n[2]*u[2]}},2613(s){s.exports=1e-6},9922(s,l,n){s.exports=c;var u=n(2613);function c(f,h){var d=f[0],p=f[1],g=f[2],m=h[0],y=h[1],_=h[2];return Math.abs(d-m)<=u*Math.max(1,Math.abs(d),Math.abs(m))&&Math.abs(p-y)<=u*Math.max(1,Math.abs(p),Math.abs(y))&&Math.abs(g-_)<=u*Math.max(1,Math.abs(g),Math.abs(_))}},9265(s){s.exports=l;function l(n,u){return n[0]===u[0]&&n[1]===u[1]&&n[2]===u[2]}},2681(s){s.exports=l;function l(n,u){return n[0]=Math.floor(u[0]),n[1]=Math.floor(u[1]),n[2]=Math.floor(u[2]),n}},5137(s,l,n){s.exports=c;var u=n(1091)();function c(f,h,d,p,g,m){var y,_;for(h||(h=3),d||(d=0),p?_=Math.min(p*h+d,f.length):_=f.length,y=d;y<_;y+=h)u[0]=f[y],u[1]=f[y+1],u[2]=f[y+2],g(u,u,m),f[y]=u[0],f[y+1]=u[1],f[y+2]=u[2];return f}},2825(s){s.exports=l;function l(n,u,c){var f=new Float32Array(3);return f[0]=n,f[1]=u,f[2]=c,f}},2931(s,l,n){s.exports={EPSILON:n(2613),create:n(1091),clone:n(3126),angle:n(8192),fromValues:n(2825),copy:n(3990),set:n(1463),equals:n(9922),exactEquals:n(9265),add:n(5632),subtract:n(6843),sub:n(2229),multiply:n(5847),mul:n(4505),divide:n(6690),div:n(4008),min:n(8107),max:n(7417),floor:n(2681),ceil:n(9226),round:n(2447),scale:n(6621),scaleAndAdd:n(8489),distance:n(7056),dist:n(5455),squaredDistance:n(2953),sqrDist:n(6141),length:n(1387),len:n(868),squaredLength:n(3066),sqrLen:n(5486),negate:n(5093),inverse:n(811),normalize:n(3536),dot:n(244),cross:n(5911),lerp:n(6658),random:n(7636),transformMat4:n(5673),transformMat3:n(492),transformQuat:n(264),rotateX:n(6894),rotateY:n(109),rotateZ:n(8692),forEach:n(5137)}},811(s){s.exports=l;function l(n,u){return n[0]=1/u[0],n[1]=1/u[1],n[2]=1/u[2],n}},868(s,l,n){s.exports=n(1387)},1387(s){s.exports=l;function l(n){var u=n[0],c=n[1],f=n[2];return Math.sqrt(u*u+c*c+f*f)}},6658(s){s.exports=l;function l(n,u,c,f){var h=u[0],d=u[1],p=u[2];return n[0]=h+f*(c[0]-h),n[1]=d+f*(c[1]-d),n[2]=p+f*(c[2]-p),n}},7417(s){s.exports=l;function l(n,u,c){return n[0]=Math.max(u[0],c[0]),n[1]=Math.max(u[1],c[1]),n[2]=Math.max(u[2],c[2]),n}},8107(s){s.exports=l;function l(n,u,c){return n[0]=Math.min(u[0],c[0]),n[1]=Math.min(u[1],c[1]),n[2]=Math.min(u[2],c[2]),n}},4505(s,l,n){s.exports=n(5847)},5847(s){s.exports=l;function l(n,u,c){return n[0]=u[0]*c[0],n[1]=u[1]*c[1],n[2]=u[2]*c[2],n}},5093(s){s.exports=l;function l(n,u){return n[0]=-u[0],n[1]=-u[1],n[2]=-u[2],n}},3536(s){s.exports=l;function l(n,u){var c=u[0],f=u[1],h=u[2],d=c*c+f*f+h*h;return d>0&&(d=1/Math.sqrt(d),n[0]=u[0]*d,n[1]=u[1]*d,n[2]=u[2]*d),n}},7636(s){s.exports=l;function l(n,u){u=u||1;var c=Math.random()*2*Math.PI,f=Math.random()*2-1,h=Math.sqrt(1-f*f)*u;return n[0]=Math.cos(c)*h,n[1]=Math.sin(c)*h,n[2]=f*u,n}},6894(s){s.exports=l;function l(n,u,c,f){var h=c[1],d=c[2],p=u[1]-h,g=u[2]-d,m=Math.sin(f),y=Math.cos(f);return n[0]=u[0],n[1]=h+p*y-g*m,n[2]=d+p*m+g*y,n}},109(s){s.exports=l;function l(n,u,c,f){var h=c[0],d=c[2],p=u[0]-h,g=u[2]-d,m=Math.sin(f),y=Math.cos(f);return n[0]=h+g*m+p*y,n[1]=u[1],n[2]=d+g*y-p*m,n}},8692(s){s.exports=l;function l(n,u,c,f){var h=c[0],d=c[1],p=u[0]-h,g=u[1]-d,m=Math.sin(f),y=Math.cos(f);return n[0]=h+p*y-g*m,n[1]=d+p*m+g*y,n[2]=u[2],n}},2447(s){s.exports=l;function l(n,u){return n[0]=Math.round(u[0]),n[1]=Math.round(u[1]),n[2]=Math.round(u[2]),n}},6621(s){s.exports=l;function l(n,u,c){return n[0]=u[0]*c,n[1]=u[1]*c,n[2]=u[2]*c,n}},8489(s){s.exports=l;function l(n,u,c,f){return n[0]=u[0]+c[0]*f,n[1]=u[1]+c[1]*f,n[2]=u[2]+c[2]*f,n}},1463(s){s.exports=l;function l(n,u,c,f){return n[0]=u,n[1]=c,n[2]=f,n}},6141(s,l,n){s.exports=n(2953)},5486(s,l,n){s.exports=n(3066)},2953(s){s.exports=l;function l(n,u){var c=u[0]-n[0],f=u[1]-n[1],h=u[2]-n[2];return c*c+f*f+h*h}},3066(s){s.exports=l;function l(n){var u=n[0],c=n[1],f=n[2];return u*u+c*c+f*f}},2229(s,l,n){s.exports=n(6843)},6843(s){s.exports=l;function l(n,u,c){return n[0]=u[0]-c[0],n[1]=u[1]-c[1],n[2]=u[2]-c[2],n}},492(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2];return n[0]=f*c[0]+h*c[3]+d*c[6],n[1]=f*c[1]+h*c[4]+d*c[7],n[2]=f*c[2]+h*c[5]+d*c[8],n}},5673(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=c[3]*f+c[7]*h+c[11]*d+c[15];return p=p||1,n[0]=(c[0]*f+c[4]*h+c[8]*d+c[12])/p,n[1]=(c[1]*f+c[5]*h+c[9]*d+c[13])/p,n[2]=(c[2]*f+c[6]*h+c[10]*d+c[14])/p,n}},264(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=c[0],g=c[1],m=c[2],y=c[3],_=g*d-m*h,v=m*f-p*d,x=p*h-g*f;return _*=2,v*=2,x*=2,n[0]=f+y*_+g*x-m*v,n[1]=h+y*v+m*_-p*x,n[2]=d+y*x+p*v-g*_,n}},4361(s){s.exports=l;function l(n,u,c){return n[0]=u[0]+c[0],n[1]=u[1]+c[1],n[2]=u[2]+c[2],n[3]=u[3]+c[3],n}},2335(s){s.exports=l;function l(n){var u=new Float32Array(4);return u[0]=n[0],u[1]=n[1],u[2]=n[2],u[3]=n[3],u}},2933(s){s.exports=l;function l(n,u){return n[0]=u[0],n[1]=u[1],n[2]=u[2],n[3]=u[3],n}},7536(s){s.exports=l;function l(){var n=new Float32Array(4);return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n}},4691(s){s.exports=l;function l(n,u){var c=u[0]-n[0],f=u[1]-n[1],h=u[2]-n[2],d=u[3]-n[3];return Math.sqrt(c*c+f*f+h*h+d*d)}},1373(s){s.exports=l;function l(n,u,c){return n[0]=u[0]/c[0],n[1]=u[1]/c[1],n[2]=u[2]/c[2],n[3]=u[3]/c[3],n}},3750(s){s.exports=l;function l(n,u){return n[0]*u[0]+n[1]*u[1]+n[2]*u[2]+n[3]*u[3]}},3390(s){s.exports=l;function l(n,u,c,f){var h=new Float32Array(4);return h[0]=n,h[1]=u,h[2]=c,h[3]=f,h}},9970(s,l,n){s.exports={create:n(7536),clone:n(2335),fromValues:n(3390),copy:n(2933),set:n(4578),add:n(4361),subtract:n(6860),multiply:n(3576),divide:n(1373),min:n(2334),max:n(160),scale:n(9288),scaleAndAdd:n(4844),distance:n(4691),squaredDistance:n(7960),length:n(6808),squaredLength:n(483),negate:n(1498),inverse:n(4494),normalize:n(5177),dot:n(3750),lerp:n(2573),random:n(9131),transformMat4:n(5352),transformQuat:n(4041)}},4494(s){s.exports=l;function l(n,u){return n[0]=1/u[0],n[1]=1/u[1],n[2]=1/u[2],n[3]=1/u[3],n}},6808(s){s.exports=l;function l(n){var u=n[0],c=n[1],f=n[2],h=n[3];return Math.sqrt(u*u+c*c+f*f+h*h)}},2573(s){s.exports=l;function l(n,u,c,f){var h=u[0],d=u[1],p=u[2],g=u[3];return n[0]=h+f*(c[0]-h),n[1]=d+f*(c[1]-d),n[2]=p+f*(c[2]-p),n[3]=g+f*(c[3]-g),n}},160(s){s.exports=l;function l(n,u,c){return n[0]=Math.max(u[0],c[0]),n[1]=Math.max(u[1],c[1]),n[2]=Math.max(u[2],c[2]),n[3]=Math.max(u[3],c[3]),n}},2334(s){s.exports=l;function l(n,u,c){return n[0]=Math.min(u[0],c[0]),n[1]=Math.min(u[1],c[1]),n[2]=Math.min(u[2],c[2]),n[3]=Math.min(u[3],c[3]),n}},3576(s){s.exports=l;function l(n,u,c){return n[0]=u[0]*c[0],n[1]=u[1]*c[1],n[2]=u[2]*c[2],n[3]=u[3]*c[3],n}},1498(s){s.exports=l;function l(n,u){return n[0]=-u[0],n[1]=-u[1],n[2]=-u[2],n[3]=-u[3],n}},5177(s){s.exports=l;function l(n,u){var c=u[0],f=u[1],h=u[2],d=u[3],p=c*c+f*f+h*h+d*d;return p>0&&(p=1/Math.sqrt(p),n[0]=c*p,n[1]=f*p,n[2]=h*p,n[3]=d*p),n}},9131(s,l,n){var u=n(5177),c=n(9288);s.exports=f;function f(h,d){return d=d||1,h[0]=Math.random(),h[1]=Math.random(),h[2]=Math.random(),h[3]=Math.random(),u(h,h),c(h,h,d),h}},9288(s){s.exports=l;function l(n,u,c){return n[0]=u[0]*c,n[1]=u[1]*c,n[2]=u[2]*c,n[3]=u[3]*c,n}},4844(s){s.exports=l;function l(n,u,c,f){return n[0]=u[0]+c[0]*f,n[1]=u[1]+c[1]*f,n[2]=u[2]+c[2]*f,n[3]=u[3]+c[3]*f,n}},4578(s){s.exports=l;function l(n,u,c,f,h){return n[0]=u,n[1]=c,n[2]=f,n[3]=h,n}},7960(s){s.exports=l;function l(n,u){var c=u[0]-n[0],f=u[1]-n[1],h=u[2]-n[2],d=u[3]-n[3];return c*c+f*f+h*h+d*d}},483(s){s.exports=l;function l(n){var u=n[0],c=n[1],f=n[2],h=n[3];return u*u+c*c+f*f+h*h}},6860(s){s.exports=l;function l(n,u,c){return n[0]=u[0]-c[0],n[1]=u[1]-c[1],n[2]=u[2]-c[2],n[3]=u[3]-c[3],n}},5352(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=u[3];return n[0]=c[0]*f+c[4]*h+c[8]*d+c[12]*p,n[1]=c[1]*f+c[5]*h+c[9]*d+c[13]*p,n[2]=c[2]*f+c[6]*h+c[10]*d+c[14]*p,n[3]=c[3]*f+c[7]*h+c[11]*d+c[15]*p,n}},4041(s){s.exports=l;function l(n,u,c){var f=u[0],h=u[1],d=u[2],p=c[0],g=c[1],m=c[2],y=c[3],_=y*f+g*d-m*h,v=y*h+m*f-p*d,x=y*d+p*h-g*f,S=-p*f-g*h-m*d;return n[0]=_*y+S*-p+v*-m-x*-g,n[1]=v*y+S*-g+x*-p-_*-m,n[2]=x*y+S*-m+_*-g-v*-p,n[3]=u[3],n}},1848(s,l,n){var u=n(4905),c=n(6468);s.exports=f;function f(h){for(var d=Array.isArray(h)?h:u(h),p=0;p0)continue;Me=Q.slice(0,1).join("")}return Y(Me),Z+=Me.length,L=L.slice(Me.length),L.length}while(!0)}function fe(){return/[^a-fA-F0-9]/.test(z)?(Y(L.join("")),P=p,D):(L.push(z),I=z,D+1)}function ae(){return z==="."||/[eE]/.test(z)?(L.push(z),P=S,I=z,D+1):z==="x"&&L.length===1&&L[0]==="0"?(P=b,L.push(z),I=z,D+1):/[^\d]/.test(z)?(Y(L.join("")),P=p,D):(L.push(z),I=z,D+1)}function ee(){return z==="f"&&(L.push(z),I=z,D+=1),/[eE]/.test(z)||(z==="-"||z==="+")&&/[eE]/.test(I)?(L.push(z),I=z,D+1):/[^\d]/.test(z)?(Y(L.join("")),P=p,D):(L.push(z),I=z,D+1)}function ie(){if(/[^\d\w_]/.test(z)){var Q=L.join("");return q[Q]?P=w:j[Q]?P=C:P=M,Y(L.join("")),P=p,D}return L.push(z),I=z,D+1}}},3508(s,l,n){var u=n(6852);u=u.slice().filter(function(c){return!/^(gl\_|texture)/.test(c)}),s.exports=u.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852(s){s.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932(s,l,n){var u=n(620);s.exports=u.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620(s){s.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827(s){s.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905(s,l,n){var u=n(5874);s.exports=c;function c(f,h){var d=u(h),p=[];return p=p.concat(d(f)),p=p.concat(d(null)),p}},3236(s){s.exports=function(l){typeof l=="string"&&(l=[l]);for(var n=[].slice.call(arguments,1),u=[],c=0;c>1,_=-7,v=c?h-1:0,x=c?-1:1,S=n[u+v];for(v+=x,d=S&(1<<-_)-1,S>>=-_,_+=g;_>0;d=d*256+n[u+v],v+=x,_-=8);for(p=d&(1<<-_)-1,d>>=-_,_+=f;_>0;p=p*256+n[u+v],v+=x,_-=8);if(d===0)d=1-y;else{if(d===m)return p?NaN:(S?-1:1)*(1/0);p=p+Math.pow(2,f),d=d-y}return(S?-1:1)*p*Math.pow(2,d-f)},l.write=function(n,u,c,f,h,d){var p,g,m,y=d*8-h-1,_=(1<>1,x=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=f?0:d-1,M=f?1:-1,C=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===1/0?(g=isNaN(u)?1:0,p=_):(p=Math.floor(Math.log(u)/Math.LN2),u*(m=Math.pow(2,-p))<1&&(p--,m*=2),p+v>=1?u+=x/m:u+=x*Math.pow(2,1-v),u*m>=2&&(p++,m/=2),p+v>=_?(g=0,p=_):p+v>=1?(g=(u*m-1)*Math.pow(2,h),p=p+v):(g=u*Math.pow(2,v-1)*Math.pow(2,h),p=0));h>=8;n[c+S]=g&255,S+=M,g/=256,h-=8);for(p=p<0;n[c+S]=p&255,S+=M,p/=256,y-=8);n[c+S-M]|=C*128}},8954(s,l,n){"use strict";s.exports=v;var u=n(3250),c=n(6803).Fw;function f(x,S,M){this.vertices=x,this.adjacent=S,this.boundary=M,this.lastVisited=-1}f.prototype.flip=function(){var x=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=x;var S=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=S};function h(x,S,M){this.vertices=x,this.cell=S,this.index=M}function d(x,S){return c(x.vertices,S.vertices)}function p(x){return function(){var S=this.tuple;return x.apply(this,S)}}function g(x){var S=u[x+1];return S||(S=u),p(S)}var m=[];function y(x,S,M){this.dimension=x,this.vertices=S,this.simplices=M,this.interior=M.filter(function(k){return!k.boundary}),this.tuple=new Array(x+1);for(var C=0;C<=x;++C)this.tuple[C]=this.vertices[C];var w=m[x];w||(w=m[x]=g(x)),this.orient=w}var _=y.prototype;_.handleBoundaryDegeneracy=function(x,S){var M=this.dimension,C=this.vertices.length-1,w=this.tuple,k=this.vertices,A=[x];for(x.lastVisited=-C;A.length>0;){x=A.pop();for(var b=x.adjacent,E=0;E<=M;++E){var T=b[E];if(!(!T.boundary||T.lastVisited<=-C)){for(var F=T.vertices,D=0;D<=M;++D){var R=F[D];R<0?w[D]=S:w[D]=k[R]}var P=this.orient();if(P>0)return T;T.lastVisited=-C,P===0&&A.push(T)}}}return null},_.walk=function(x,S){var M=this.vertices.length-1,C=this.dimension,w=this.vertices,k=this.tuple,A=S?this.interior.length*Math.random()|0:this.interior.length-1,b=this.interior[A];e:for(;!b.boundary;){for(var E=b.vertices,T=b.adjacent,F=0;F<=C;++F)k[F]=w[E[F]];b.lastVisited=M;for(var F=0;F<=C;++F){var D=T[F];if(!(D.lastVisited>=M)){var R=k[F];k[F]=x;var P=this.orient();if(k[F]=R,P<0){b=D;continue e}else D.boundary?D.lastVisited=-M:D.lastVisited=M}}return}return b},_.addPeaks=function(x,S){var M=this.vertices.length-1,C=this.dimension,w=this.vertices,k=this.tuple,A=this.interior,b=this.simplices,E=[S];S.lastVisited=M,S.vertices[S.vertices.indexOf(-1)]=M,S.boundary=!1,A.push(S);for(var T=[];E.length>0;){var S=E.pop(),F=S.vertices,D=S.adjacent,R=F.indexOf(M);if(!(R<0)){for(var P=0;P<=C;++P)if(P!==R){var z=D[P];if(!(!z.boundary||z.lastVisited>=M)){var I=z.vertices;if(z.lastVisited!==-M){for(var L=0,B=0;B<=C;++B)I[B]<0?(L=B,k[B]=x):k[B]=w[I[B]];var O=this.orient();if(O>0){I[L]=M,z.boundary=!1,A.push(z),E.push(z),z.lastVisited=M;continue}else z.lastVisited=-M}var G=z.adjacent,W=F.slice(),X=D.slice(),Z=new f(W,X,!0);b.push(Z);var J=G.indexOf(S);if(!(J<0)){G[J]=Z,X[R]=z,W[P]=-1,X[P]=S,D[P]=Z,Z.flip();for(var B=0;B<=C;++B){var N=W[B];if(!(N<0||N===M)){for(var H=new Array(C-1),$=0,U=0;U<=C;++U){var V=W[U];V<0||U===B||(H[$++]=V)}T.push(new h(H,Z,B))}}}}}}}T.sort(d);for(var P=0;P+1=0?A[E++]=b[F]:T=F&1;if(T===(x&1)){var D=A[0];A[0]=A[1],A[1]=D}S.push(A)}}return S};function v(x,S){var M=x.length;if(M===0)throw new Error("Must have at least d+1 points");var C=x[0].length;if(M<=C)throw new Error("Must input at least d+1 points");var w=x.slice(0,C+1),k=u.apply(void 0,w);if(k===0)throw new Error("Input not in general position");for(var A=new Array(C+1),b=0;b<=C;++b)A[b]=b;k<0&&(A[0]=1,A[1]=0);for(var E=new f(A,new Array(C+1),!1),T=E.adjacent,F=new Array(C+2),b=0;b<=C;++b){for(var D=A.slice(),R=0;R<=C;++R)R===b&&(D[R]=-1);var P=D[0];D[0]=D[1],D[1]=P;var z=new f(D,new Array(C+1),!0);T[b]=z,F[b]=z}F[C+1]=E;for(var b=0;b<=C;++b)for(var D=T[b].vertices,I=T[b].adjacent,R=0;R<=C;++R){var L=D[R];if(L<0){I[R]=E;continue}for(var B=0;B<=C;++B)T[B].vertices.indexOf(L)<0&&(I[R]=T[B])}for(var O=new y(C,w,F),G=!!S,b=C+1;b3*(F+1)?y(this,T):this.left.insert(T):this.left=k([T]);else if(T[0]>this.mid)this.right?4*(this.right.count+1)>3*(F+1)?y(this,T):this.right.insert(T):this.right=k([T]);else{var D=u.ge(this.leftPoints,T,C),R=u.ge(this.rightPoints,T,w);this.leftPoints.splice(D,0,T),this.rightPoints.splice(R,0,T)}},p.remove=function(T){var F=this.count-this.leftPoints;if(T[1]3*(F-1))return _(this,T);var R=this.left.remove(T);return R===h?(this.left=null,this.count-=1,f):(R===f&&(this.count-=1),R)}else if(T[0]>this.mid){if(!this.right)return c;var P=this.left?this.left.count:0;if(4*P>3*(F-1))return _(this,T);var R=this.right.remove(T);return R===h?(this.right=null,this.count-=1,f):(R===f&&(this.count-=1),R)}else{if(this.count===1)return this.leftPoints[0]===T?h:c;if(this.leftPoints.length===1&&this.leftPoints[0]===T){if(this.left&&this.right){for(var z=this,I=this.left;I.right;)z=I,I=I.right;if(z===this)I.right=this.right;else{var L=this.left,R=this.right;z.count-=I.count,z.right=I.left,I.left=L,I.right=R}g(this,I),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?g(this,this.left):g(this,this.right);return f}for(var L=u.ge(this.leftPoints,T,C);L=0&&T[R][1]>=F;--R){var P=D(T[R]);if(P)return P}}function S(T,F){for(var D=0;Dthis.mid){if(this.right){var D=this.right.queryPoint(T,F);if(D)return D}return x(this.rightPoints,T,F)}else return S(this.leftPoints,F)},p.queryInterval=function(T,F,D){if(Tthis.mid&&this.right){var R=this.right.queryInterval(T,F,D);if(R)return R}return Fthis.mid?x(this.rightPoints,T,D):S(this.leftPoints,D)};function M(T,F){return T-F}function C(T,F){var D=T[0]-F[0];return D||T[1]-F[1]}function w(T,F){var D=T[1]-F[1];return D||T[0]-F[0]}function k(T){if(T.length===0)return null;for(var F=[],D=0;D>1],P=[],z=[],I=[],D=0;D1&&h.indexOf("Macintosh")!==-1&&h.indexOf("Safari")!==-1&&(d=!0),d}},5219(s){"use strict";s.exports=function(l){for(var n=l.length,u,c=0;c13)&&u!==32&&u!==133&&u!==160&&u!==5760&&u!==6158&&(u<8192||u>8205)&&u!==8232&&u!==8233&&u!==8239&&u!==8287&&u!==8288&&u!==12288&&u!==65279)return!1;return!0}},395(s){function l(n,u,c){return n*(1-c)+u*c}s.exports=l},2652(s,l,n){var u=n(4335),c=n(6864),f=n(1903),h=n(9921),d=n(7608),p=n(5665),g={length:n(1387),normalize:n(3536),dot:n(244),cross:n(5911)},m=c(),y=c(),_=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],x=[0,0,0];s.exports=function(k,A,b,E,T,F){if(A||(A=[0,0,0]),b||(b=[0,0,0]),E||(E=[0,0,0]),T||(T=[0,0,0,1]),F||(F=[0,0,0,1]),!u(m,k)||(f(y,m),y[3]=0,y[7]=0,y[11]=0,y[15]=1,Math.abs(h(y)<1e-8)))return!1;var D=m[3],R=m[7],P=m[11],z=m[12],I=m[13],L=m[14],B=m[15];if(D!==0||R!==0||P!==0){_[0]=D,_[1]=R,_[2]=P,_[3]=B;var O=d(y,y);if(!O)return!1;p(y,y),S(T,_,y)}else T[0]=T[1]=T[2]=0,T[3]=1;if(A[0]=z,A[1]=I,A[2]=L,M(v,m),b[0]=g.length(v[0]),g.normalize(v[0],v[0]),E[0]=g.dot(v[0],v[1]),C(v[1],v[1],v[0],1,-E[0]),b[1]=g.length(v[1]),g.normalize(v[1],v[1]),E[0]/=b[1],E[1]=g.dot(v[0],v[2]),C(v[2],v[2],v[0],1,-E[1]),E[2]=g.dot(v[1],v[2]),C(v[2],v[2],v[1],1,-E[2]),b[2]=g.length(v[2]),g.normalize(v[2],v[2]),E[1]/=b[2],E[2]/=b[2],g.cross(x,v[1],v[2]),g.dot(v[0],x)<0)for(var G=0;G<3;G++)b[G]*=-1,v[G][0]*=-1,v[G][1]*=-1,v[G][2]*=-1;return F[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),F[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),F[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),F[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(F[0]=-F[0]),v[0][2]>v[2][0]&&(F[1]=-F[1]),v[1][0]>v[0][1]&&(F[2]=-F[2]),!0};function S(w,k,A){var b=k[0],E=k[1],T=k[2],F=k[3];return w[0]=A[0]*b+A[4]*E+A[8]*T+A[12]*F,w[1]=A[1]*b+A[5]*E+A[9]*T+A[13]*F,w[2]=A[2]*b+A[6]*E+A[10]*T+A[14]*F,w[3]=A[3]*b+A[7]*E+A[11]*T+A[15]*F,w}function M(w,k){w[0][0]=k[0],w[0][1]=k[1],w[0][2]=k[2],w[1][0]=k[4],w[1][1]=k[5],w[1][2]=k[6],w[2][0]=k[8],w[2][1]=k[9],w[2][2]=k[10]}function C(w,k,A,b,E){w[0]=k[0]*b+A[0]*E,w[1]=k[1]*b+A[1]*E,w[2]=k[2]*b+A[2]*E}},4335(s){s.exports=function(n,u){var c=u[15];if(c===0)return!1;for(var f=1/c,h=0;h<16;h++)n[h]=u[h]*f;return!0}},7442(s,l,n){var u=n(6658),c=n(7182),f=n(2652),h=n(9921),d=n(8648),p=_(),g=_(),m=_();s.exports=y;function y(S,M,C,w){if(h(M)===0||h(C)===0)return!1;var k=f(M,p.translate,p.scale,p.skew,p.perspective,p.quaternion),A=f(C,g.translate,g.scale,g.skew,g.perspective,g.quaternion);return!k||!A?!1:(u(m.translate,p.translate,g.translate,w),u(m.skew,p.skew,g.skew,w),u(m.scale,p.scale,g.scale,w),u(m.perspective,p.perspective,g.perspective,w),d(m.quaternion,p.quaternion,g.quaternion,w),c(S,m.translate,m.scale,m.skew,m.perspective,m.quaternion),!0)}function _(){return{translate:v(),scale:v(1),skew:v(),perspective:x(),quaternion:x()}}function v(S){return[S||0,S||0,S||0]}function x(){return[0,0,0,1]}},7182(s,l,n){var u={identity:n(7894),translate:n(7656),multiply:n(6760),create:n(6864),scale:n(2504),fromRotationTranslation:n(6743)},c=u.create(),f=u.create();s.exports=function(d,p,g,m,y,_){return u.identity(d),u.fromRotationTranslation(d,_,p),d[3]=y[0],d[7]=y[1],d[11]=y[2],d[15]=y[3],u.identity(f),m[2]!==0&&(f[9]=m[2],u.multiply(d,d,f)),m[1]!==0&&(f[9]=0,f[8]=m[1],u.multiply(d,d,f)),m[0]!==0&&(f[8]=0,f[4]=m[0],u.multiply(d,d,f)),u.scale(d,d,g),d}},1811(s,l,n){"use strict";var u=n(2478),c=n(7442),f=n(7608),h=n(5567),d=n(2408),p=n(7089),g=n(6582),m=n(7656),y=n(2504),_=n(3536),v=[0,0,0];s.exports=C;function x(w){this._components=w.slice(),this._time=[0],this.prevMatrix=w.slice(),this.nextMatrix=w.slice(),this.computedMatrix=w.slice(),this.computedInverse=w.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}var S=x.prototype;S.recalcMatrix=function(w){var k=this._time,A=u.le(k,w),b=this.computedMatrix;if(!(A<0)){var E=this._components;if(A===k.length-1)for(var T=16*A,F=0;F<16;++F)b[F]=E[T++];else{for(var D=k[A+1]-k[A],T=16*A,R=this.prevMatrix,P=!0,F=0;F<16;++F)R[F]=E[T++];for(var z=this.nextMatrix,F=0;F<16;++F)z[F]=E[T++],P=P&&R[F]===z[F];if(D<1e-6||P)for(var F=0;F<16;++F)b[F]=R[F];else c(b,R,z,(w-k[A])/D)}var I=this.computedUp;I[0]=b[1],I[1]=b[5],I[2]=b[9],_(I,I);var L=this.computedInverse;f(L,b);var B=this.computedEye,O=L[15];B[0]=L[12]/O,B[1]=L[13]/O,B[2]=L[14]/O;for(var G=this.computedCenter,W=Math.exp(this.computedRadius[0]),F=0;F<3;++F)G[F]=B[F]-b[2+4*F]*W}},S.idle=function(w){if(!(w1&&u(f[g[v-2]],f[g[v-1]],_)<=0;)v-=1,g.pop();for(g.push(y),v=m.length;v>1&&u(f[m[v-2]],f[m[v-1]],_)>=0;)v-=1,m.pop();m.push(y)}for(var x=new Array(m.length+g.length-2),S=0,d=0,M=g.length;d0;--C)x[S++]=m[C];return x}},351(s,l,n){"use strict";s.exports=c;var u=n(4687);function c(f,h){h||(h=f,f=window);var d=0,p=0,g=0,m={shift:!1,alt:!1,control:!1,meta:!1},y=!1;function _(T){var F=!1;return"altKey"in T&&(F=F||T.altKey!==m.alt,m.alt=!!T.altKey),"shiftKey"in T&&(F=F||T.shiftKey!==m.shift,m.shift=!!T.shiftKey),"ctrlKey"in T&&(F=F||T.ctrlKey!==m.control,m.control=!!T.ctrlKey),"metaKey"in T&&(F=F||T.metaKey!==m.meta,m.meta=!!T.metaKey),F}function v(T,F){var D=u.x(F),R=u.y(F);"buttons"in F&&(T=F.buttons|0),(T!==d||D!==p||R!==g||_(F))&&(d=T|0,p=D||0,g=R||0,h&&h(d,p,g,m))}function x(T){v(0,T)}function S(){(d||p||g||m.shift||m.alt||m.meta||m.control)&&(p=g=0,d=0,m.shift=m.alt=m.control=m.meta=!1,h&&h(0,0,0,m))}function M(T){_(T)&&h&&h(d,p,g,m)}function C(T){u.buttons(T)===0?v(0,T):v(d,T)}function w(T){v(d|u.buttons(T),T)}function k(T){v(d&~u.buttons(T),T)}function A(){y||(y=!0,f.addEventListener("mousemove",C),f.addEventListener("mousedown",w),f.addEventListener("mouseup",k),f.addEventListener("mouseleave",x),f.addEventListener("mouseenter",x),f.addEventListener("mouseout",x),f.addEventListener("mouseover",x),f.addEventListener("blur",S),f.addEventListener("keyup",M),f.addEventListener("keydown",M),f.addEventListener("keypress",M),f!==window&&(window.addEventListener("blur",S),window.addEventListener("keyup",M),window.addEventListener("keydown",M),window.addEventListener("keypress",M)))}function b(){y&&(y=!1,f.removeEventListener("mousemove",C),f.removeEventListener("mousedown",w),f.removeEventListener("mouseup",k),f.removeEventListener("mouseleave",x),f.removeEventListener("mouseenter",x),f.removeEventListener("mouseout",x),f.removeEventListener("mouseover",x),f.removeEventListener("blur",S),f.removeEventListener("keyup",M),f.removeEventListener("keydown",M),f.removeEventListener("keypress",M),f!==window&&(window.removeEventListener("blur",S),window.removeEventListener("keyup",M),window.removeEventListener("keydown",M),window.removeEventListener("keypress",M)))}A();var E={element:f};return Object.defineProperties(E,{enabled:{get:function(){return y},set:function(T){T?A():b()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return g},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),E}},24(s){var l={left:0,top:0};s.exports=n;function n(c,f,h){f=f||c.currentTarget||c.srcElement,Array.isArray(h)||(h=[0,0]);var d=c.clientX||0,p=c.clientY||0,g=u(f);return h[0]=d-g.left,h[1]=p-g.top,h}function u(c){return c===window||c===document||c===document.body?l:c.getBoundingClientRect()}},4687(s,l){"use strict";function n(h){if(typeof h=="object"){if("buttons"in h)return h.buttons;if("which"in h){var d=h.which;if(d===2)return 4;if(d===3)return 2;if(d>0)return 1<=0)return 1<0){if(X=1,N[$++]=m(A[F],S,M,C),F+=O,w>0)for(W=1,D=A[F],U=N[$]=m(D,S,M,C),q=N[$+V],te=N[$+Y],le=N[$+ne],(U!==q||U!==te||U!==le)&&(P=A[F+R],I=A[F+z],B=A[F+L],p(W,X,D,P,I,B,U,q,te,le,S,M,C),ce=H[$]=Z++),$+=1,F+=O,W=2;W0)for(W=1,D=A[F],U=N[$]=m(D,S,M,C),q=N[$+V],te=N[$+Y],le=N[$+ne],(U!==q||U!==te||U!==le)&&(P=A[F+R],I=A[F+z],B=A[F+L],p(W,X,D,P,I,B,U,q,te,le,S,M,C),ce=H[$]=Z++,le!==te&&g(H[$+Y],ce,I,B,te,le,S,M,C)),$+=1,F+=O,W=2;W0){if(W=1,N[$++]=m(A[F],S,M,C),F+=O,k>0)for(X=1,D=A[F],U=N[$]=m(D,S,M,C),te=N[$+Y],q=N[$+V],le=N[$+ne],(U!==te||U!==q||U!==le)&&(P=A[F+R],I=A[F+z],B=A[F+L],p(W,X,D,P,I,B,U,te,q,le,S,M,C),ce=H[$]=Z++),$+=1,F+=O,X=2;X0)for(X=1,D=A[F],U=N[$]=m(D,S,M,C),te=N[$+Y],q=N[$+V],le=N[$+ne],(U!==te||U!==q||U!==le)&&(P=A[F+R],I=A[F+z],B=A[F+L],p(W,X,D,P,I,B,U,te,q,le,S,M,C),ce=H[$]=Z++,le!==te&&g(H[$+Y],ce,B,P,le,te,S,M,C)),$+=1,F+=O,X=2;X 0"),typeof d.vertex!="function"&&p("Must specify vertex creation function"),typeof d.cell!="function"&&p("Must specify cell creation function"),typeof d.phase!="function"&&p("Must specify phase function");for(var _=d.getters||[],v=new Array(m),x=0;x=0?v[x]=!0:v[x]=!1;return f(d.vertex,d.cell,d.phase,y,g,v)}},6199(s,l,n){"use strict";var u=n(1338),c={zero:function(C,w,k,A){var b=C[0],E=k[0];A|=0;var T=0,F=E;for(T=0;T2&&T[1]>2&&A(E.pick(-1,-1).lo(1,1).hi(T[0]-2,T[1]-2),b.pick(-1,-1,0).lo(1,1).hi(T[0]-2,T[1]-2),b.pick(-1,-1,1).lo(1,1).hi(T[0]-2,T[1]-2)),T[1]>2&&(k(E.pick(0,-1).lo(1).hi(T[1]-2),b.pick(0,-1,1).lo(1).hi(T[1]-2)),w(b.pick(0,-1,0).lo(1).hi(T[1]-2))),T[1]>2&&(k(E.pick(T[0]-1,-1).lo(1).hi(T[1]-2),b.pick(T[0]-1,-1,1).lo(1).hi(T[1]-2)),w(b.pick(T[0]-1,-1,0).lo(1).hi(T[1]-2))),T[0]>2&&(k(E.pick(-1,0).lo(1).hi(T[0]-2),b.pick(-1,0,0).lo(1).hi(T[0]-2)),w(b.pick(-1,0,1).lo(1).hi(T[0]-2))),T[0]>2&&(k(E.pick(-1,T[1]-1).lo(1).hi(T[0]-2),b.pick(-1,T[1]-1,0).lo(1).hi(T[0]-2)),w(b.pick(-1,T[1]-1,1).lo(1).hi(T[0]-2))),b.set(0,0,0,0),b.set(0,0,1,0),b.set(T[0]-1,0,0,0),b.set(T[0]-1,0,1,0),b.set(0,T[1]-1,0,0),b.set(0,T[1]-1,1,0),b.set(T[0]-1,T[1]-1,0,0),b.set(T[0]-1,T[1]-1,1,0),b}}function M(C){var w=C.join(),T=m[w];if(T)return T;for(var k=C.length,A=[_,v],b=1;b<=k;++b)A.push(x(b));var E=S,T=E.apply(void 0,A);return m[w]=T,T}s.exports=function(w,k,A){if(Array.isArray(A)||(typeof A=="string"?A=u(k.dimension,A):A=u(k.dimension,"clamp")),k.size===0)return w;if(k.dimension===0)return w.set(0),w;var b=M(A);return b(w,k)}},4317(s){"use strict";function l(h,d){var p=Math.floor(d),g=d-p,m=0<=p&&p0;){I<64?(w=I,I=0):(w=64,I-=64);for(var L=m[1]|0;L>0;){L<64?(k=L,L=0):(k=64,L-=64),v=P+I*b+L*E,M=z+I*F+L*D;var B=0,O=0,G=0,W=T,X=b-A*T,Z=E-w*b,J=R,N=F-A*R,H=D-w*F;for(G=0;G0;){D<64?(w=D,D=0):(w=64,D-=64);for(var R=m[0]|0;R>0;){R<64?(C=R,R=0):(C=64,R-=64),v=T+D*A+R*k,M=F+D*E+R*b;var P=0,z=0,I=A,L=k-w*A,B=E,O=b-w*E;for(z=0;z0;){z<64?(k=z,z=0):(k=64,z-=64);for(var I=m[0]|0;I>0;){I<64?(C=I,I=0):(C=64,I-=64);for(var L=m[1]|0;L>0;){L<64?(w=L,L=0):(w=64,L-=64),v=R+z*E+I*A+L*b,M=P+z*D+I*T+L*F;var B=0,O=0,G=0,W=E,X=A-k*E,Z=b-C*A,J=D,N=T-k*D,H=F-C*T;for(G=0;Gx;){B=0,O=P-w;t:for(I=0;IW)break t;O+=T,B+=F}for(B=P,O=P-w,I=0;I>1,L=I-R,B=I+R,O=P,G=L,W=I,X=B,Z=z,J=S+1,N=M-1,H=!0,$,U,V,j,q,Y,K,te,ne,se=0,le=0,ce=0,pe,xe,ye,fe,ae,ee,ie,Q,ue,ge,Me,Te,je,Ve,Ze,Ke,vt=E,xt=_(vt),Pt=_(vt);xe=k*O,ye=k*G,Ke=w;e:for(pe=0;pe0){U=O,O=G,G=U;break e}if(ce<0)break e;Ke+=F}xe=k*X,ye=k*Z,Ke=w;e:for(pe=0;pe0){U=X,X=Z,Z=U;break e}if(ce<0)break e;Ke+=F}xe=k*O,ye=k*W,Ke=w;e:for(pe=0;pe0){U=O,O=W,W=U;break e}if(ce<0)break e;Ke+=F}xe=k*G,ye=k*W,Ke=w;e:for(pe=0;pe0){U=G,G=W,W=U;break e}if(ce<0)break e;Ke+=F}xe=k*O,ye=k*X,Ke=w;e:for(pe=0;pe0){U=O,O=X,X=U;break e}if(ce<0)break e;Ke+=F}xe=k*W,ye=k*X,Ke=w;e:for(pe=0;pe0){U=W,W=X,X=U;break e}if(ce<0)break e;Ke+=F}xe=k*G,ye=k*Z,Ke=w;e:for(pe=0;pe0){U=G,G=Z,Z=U;break e}if(ce<0)break e;Ke+=F}xe=k*G,ye=k*W,Ke=w;e:for(pe=0;pe0){U=G,G=W,W=U;break e}if(ce<0)break e;Ke+=F}xe=k*X,ye=k*Z,Ke=w;e:for(pe=0;pe0){U=X,X=Z,Z=U;break e}if(ce<0)break e;Ke+=F}for(xe=k*O,ye=k*G,fe=k*W,ae=k*X,ee=k*Z,ie=k*P,Q=k*I,ue=k*z,Ze=0,Ke=w,pe=0;pe0)N--;else if(ce<0){for(xe=k*Y,ye=k*J,fe=k*N,Ke=w,pe=0;pe0)for(;;){K=w+N*k,Ze=0;e:for(pe=0;pe0){if(--Nz){e:for(;;){for(K=w+J*k,Ze=0,Ke=w,pe=0;pe1&&x?M(v,x[0],x[1]):M(v)}var g={"uint32,1,0":function(y,_){return function(v){var x=v.data,S=v.offset|0,M=v.shape,C=v.stride,w=C[0]|0,k=M[0]|0,A=C[1]|0,b=M[1]|0,E=A,T=A,F=1;k<=32?y(0,k-1,x,S,w,A,k,b,E,T,F):_(0,k-1,x,S,w,A,k,b,E,T,F)}}};function m(y,_){var v=[_,y].join(","),x=g[v],S=h(y,_),M=p(y,_,S);return x(S,M)}s.exports=m},446(s,l,n){"use strict";var u=n(7640),c={};function f(h){var d=h.order,p=h.dtype,g=[d,p],m=g.join(":"),y=c[m];return y||(c[m]=y=u(d,p)),y(h),h}s.exports=f},9618(s,l,n){var u=n(7163),c=typeof Float64Array<"u";function f(_,v){return _[0]-v[0]}function h(){var _=this.stride,v=new Array(_.length),x;for(x=0;x=0&&(A=w|0,k+=E*A,b-=A),new S(this.data,b,E,k)},M.step=function(w){var k=this.shape[0],A=this.stride[0],b=this.offset,E=0,T=Math.ceil;return typeof w=="number"&&(E=w|0,E<0?(b+=A*(k-1),k=T(-k/E)):k=T(k/E),A*=E),new S(this.data,k,A,b)},M.transpose=function(w){w=w===void 0?0:w|0;var k=this.shape,A=this.stride;return new S(this.data,k[w],A[w],this.offset)},M.pick=function(w){var k=[],A=[],b=this.offset;typeof w=="number"&&w>=0?b=b+this.stride[0]*w|0:(k.push(this.shape[0]),A.push(this.stride[0]));var E=v[k.length+1];return E(this.data,k,A,b)},function(w,k,A,b){return new S(w,k[0],A[0],b)}},2:function(_,v,x){function S(C,w,k,A,b,E){this.data=C,this.shape=[w,k],this.stride=[A,b],this.offset=E|0}var M=S.prototype;return M.dtype=_,M.dimension=2,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(M,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),M.set=function(w,k,A){return _==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*k,A):this.data[this.offset+this.stride[0]*w+this.stride[1]*k]=A},M.get=function(w,k){return _==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*k):this.data[this.offset+this.stride[0]*w+this.stride[1]*k]},M.index=function(w,k){return this.offset+this.stride[0]*w+this.stride[1]*k},M.hi=function(w,k){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof k!="number"||k<0?this.shape[1]:k|0,this.stride[0],this.stride[1],this.offset)},M.lo=function(w,k){var A=this.offset,b=0,E=this.shape[0],T=this.shape[1],F=this.stride[0],D=this.stride[1];return typeof w=="number"&&w>=0&&(b=w|0,A+=F*b,E-=b),typeof k=="number"&&k>=0&&(b=k|0,A+=D*b,T-=b),new S(this.data,E,T,F,D,A)},M.step=function(w,k){var A=this.shape[0],b=this.shape[1],E=this.stride[0],T=this.stride[1],F=this.offset,D=0,R=Math.ceil;return typeof w=="number"&&(D=w|0,D<0?(F+=E*(A-1),A=R(-A/D)):A=R(A/D),E*=D),typeof k=="number"&&(D=k|0,D<0?(F+=T*(b-1),b=R(-b/D)):b=R(b/D),T*=D),new S(this.data,A,b,E,T,F)},M.transpose=function(w,k){w=w===void 0?0:w|0,k=k===void 0?1:k|0;var A=this.shape,b=this.stride;return new S(this.data,A[w],A[k],b[w],b[k],this.offset)},M.pick=function(w,k){var A=[],b=[],E=this.offset;typeof w=="number"&&w>=0?E=E+this.stride[0]*w|0:(A.push(this.shape[0]),b.push(this.stride[0])),typeof k=="number"&&k>=0?E=E+this.stride[1]*k|0:(A.push(this.shape[1]),b.push(this.stride[1]));var T=v[A.length+1];return T(this.data,A,b,E)},function(w,k,A,b){return new S(w,k[0],k[1],A[0],A[1],b)}},3:function(_,v,x){function S(C,w,k,A,b,E,T,F){this.data=C,this.shape=[w,k,A],this.stride=[b,E,T],this.offset=F|0}var M=S.prototype;return M.dtype=_,M.dimension=3,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(M,"order",{get:function(){var w=Math.abs(this.stride[0]),k=Math.abs(this.stride[1]),A=Math.abs(this.stride[2]);return w>k?k>A?[2,1,0]:w>A?[1,2,0]:[1,0,2]:w>A?[2,0,1]:A>k?[0,1,2]:[0,2,1]}}),M.set=function(w,k,A,b){return _==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A,b):this.data[this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A]=b},M.get=function(w,k,A){return _==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A):this.data[this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A]},M.index=function(w,k,A){return this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A},M.hi=function(w,k,A){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof k!="number"||k<0?this.shape[1]:k|0,typeof A!="number"||A<0?this.shape[2]:A|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},M.lo=function(w,k,A){var b=this.offset,E=0,T=this.shape[0],F=this.shape[1],D=this.shape[2],R=this.stride[0],P=this.stride[1],z=this.stride[2];return typeof w=="number"&&w>=0&&(E=w|0,b+=R*E,T-=E),typeof k=="number"&&k>=0&&(E=k|0,b+=P*E,F-=E),typeof A=="number"&&A>=0&&(E=A|0,b+=z*E,D-=E),new S(this.data,T,F,D,R,P,z,b)},M.step=function(w,k,A){var b=this.shape[0],E=this.shape[1],T=this.shape[2],F=this.stride[0],D=this.stride[1],R=this.stride[2],P=this.offset,z=0,I=Math.ceil;return typeof w=="number"&&(z=w|0,z<0?(P+=F*(b-1),b=I(-b/z)):b=I(b/z),F*=z),typeof k=="number"&&(z=k|0,z<0?(P+=D*(E-1),E=I(-E/z)):E=I(E/z),D*=z),typeof A=="number"&&(z=A|0,z<0?(P+=R*(T-1),T=I(-T/z)):T=I(T/z),R*=z),new S(this.data,b,E,T,F,D,R,P)},M.transpose=function(w,k,A){w=w===void 0?0:w|0,k=k===void 0?1:k|0,A=A===void 0?2:A|0;var b=this.shape,E=this.stride;return new S(this.data,b[w],b[k],b[A],E[w],E[k],E[A],this.offset)},M.pick=function(w,k,A){var b=[],E=[],T=this.offset;typeof w=="number"&&w>=0?T=T+this.stride[0]*w|0:(b.push(this.shape[0]),E.push(this.stride[0])),typeof k=="number"&&k>=0?T=T+this.stride[1]*k|0:(b.push(this.shape[1]),E.push(this.stride[1])),typeof A=="number"&&A>=0?T=T+this.stride[2]*A|0:(b.push(this.shape[2]),E.push(this.stride[2]));var F=v[b.length+1];return F(this.data,b,E,T)},function(w,k,A,b){return new S(w,k[0],k[1],k[2],A[0],A[1],A[2],b)}},4:function(_,v,x){function S(C,w,k,A,b,E,T,F,D,R){this.data=C,this.shape=[w,k,A,b],this.stride=[E,T,F,D],this.offset=R|0}var M=S.prototype;return M.dtype=_,M.dimension=4,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(M,"order",{get:x}),M.set=function(w,k,A,b,E){return _==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b,E):this.data[this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b]=E},M.get=function(w,k,A,b){return _==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b):this.data[this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b]},M.index=function(w,k,A,b){return this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b},M.hi=function(w,k,A,b){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof k!="number"||k<0?this.shape[1]:k|0,typeof A!="number"||A<0?this.shape[2]:A|0,typeof b!="number"||b<0?this.shape[3]:b|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},M.lo=function(w,k,A,b){var E=this.offset,T=0,F=this.shape[0],D=this.shape[1],R=this.shape[2],P=this.shape[3],z=this.stride[0],I=this.stride[1],L=this.stride[2],B=this.stride[3];return typeof w=="number"&&w>=0&&(T=w|0,E+=z*T,F-=T),typeof k=="number"&&k>=0&&(T=k|0,E+=I*T,D-=T),typeof A=="number"&&A>=0&&(T=A|0,E+=L*T,R-=T),typeof b=="number"&&b>=0&&(T=b|0,E+=B*T,P-=T),new S(this.data,F,D,R,P,z,I,L,B,E)},M.step=function(w,k,A,b){var E=this.shape[0],T=this.shape[1],F=this.shape[2],D=this.shape[3],R=this.stride[0],P=this.stride[1],z=this.stride[2],I=this.stride[3],L=this.offset,B=0,O=Math.ceil;return typeof w=="number"&&(B=w|0,B<0?(L+=R*(E-1),E=O(-E/B)):E=O(E/B),R*=B),typeof k=="number"&&(B=k|0,B<0?(L+=P*(T-1),T=O(-T/B)):T=O(T/B),P*=B),typeof A=="number"&&(B=A|0,B<0?(L+=z*(F-1),F=O(-F/B)):F=O(F/B),z*=B),typeof b=="number"&&(B=b|0,B<0?(L+=I*(D-1),D=O(-D/B)):D=O(D/B),I*=B),new S(this.data,E,T,F,D,R,P,z,I,L)},M.transpose=function(w,k,A,b){w=w===void 0?0:w|0,k=k===void 0?1:k|0,A=A===void 0?2:A|0,b=b===void 0?3:b|0;var E=this.shape,T=this.stride;return new S(this.data,E[w],E[k],E[A],E[b],T[w],T[k],T[A],T[b],this.offset)},M.pick=function(w,k,A,b){var E=[],T=[],F=this.offset;typeof w=="number"&&w>=0?F=F+this.stride[0]*w|0:(E.push(this.shape[0]),T.push(this.stride[0])),typeof k=="number"&&k>=0?F=F+this.stride[1]*k|0:(E.push(this.shape[1]),T.push(this.stride[1])),typeof A=="number"&&A>=0?F=F+this.stride[2]*A|0:(E.push(this.shape[2]),T.push(this.stride[2])),typeof b=="number"&&b>=0?F=F+this.stride[3]*b|0:(E.push(this.shape[3]),T.push(this.stride[3]));var D=v[E.length+1];return D(this.data,E,T,F)},function(w,k,A,b){return new S(w,k[0],k[1],k[2],k[3],A[0],A[1],A[2],A[3],b)}},5:function(v,x,S){function M(w,k,A,b,E,T,F,D,R,P,z,I){this.data=w,this.shape=[k,A,b,E,T],this.stride=[F,D,R,P,z],this.offset=I|0}var C=M.prototype;return C.dtype=v,C.dimension=5,Object.defineProperty(C,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(C,"order",{get:S}),C.set=function(k,A,b,E,T,F){return v==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T,F):this.data[this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T]=F},C.get=function(k,A,b,E,T){return v==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T):this.data[this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T]},C.index=function(k,A,b,E,T){return this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T},C.hi=function(k,A,b,E,T){return new M(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof A!="number"||A<0?this.shape[1]:A|0,typeof b!="number"||b<0?this.shape[2]:b|0,typeof E!="number"||E<0?this.shape[3]:E|0,typeof T!="number"||T<0?this.shape[4]:T|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},C.lo=function(k,A,b,E,T){var F=this.offset,D=0,R=this.shape[0],P=this.shape[1],z=this.shape[2],I=this.shape[3],L=this.shape[4],B=this.stride[0],O=this.stride[1],G=this.stride[2],W=this.stride[3],X=this.stride[4];return typeof k=="number"&&k>=0&&(D=k|0,F+=B*D,R-=D),typeof A=="number"&&A>=0&&(D=A|0,F+=O*D,P-=D),typeof b=="number"&&b>=0&&(D=b|0,F+=G*D,z-=D),typeof E=="number"&&E>=0&&(D=E|0,F+=W*D,I-=D),typeof T=="number"&&T>=0&&(D=T|0,F+=X*D,L-=D),new M(this.data,R,P,z,I,L,B,O,G,W,X,F)},C.step=function(k,A,b,E,T){var F=this.shape[0],D=this.shape[1],R=this.shape[2],P=this.shape[3],z=this.shape[4],I=this.stride[0],L=this.stride[1],B=this.stride[2],O=this.stride[3],G=this.stride[4],W=this.offset,X=0,Z=Math.ceil;return typeof k=="number"&&(X=k|0,X<0?(W+=I*(F-1),F=Z(-F/X)):F=Z(F/X),I*=X),typeof A=="number"&&(X=A|0,X<0?(W+=L*(D-1),D=Z(-D/X)):D=Z(D/X),L*=X),typeof b=="number"&&(X=b|0,X<0?(W+=B*(R-1),R=Z(-R/X)):R=Z(R/X),B*=X),typeof E=="number"&&(X=E|0,X<0?(W+=O*(P-1),P=Z(-P/X)):P=Z(P/X),O*=X),typeof T=="number"&&(X=T|0,X<0?(W+=G*(z-1),z=Z(-z/X)):z=Z(z/X),G*=X),new M(this.data,F,D,R,P,z,I,L,B,O,G,W)},C.transpose=function(k,A,b,E,T){k=k===void 0?0:k|0,A=A===void 0?1:A|0,b=b===void 0?2:b|0,E=E===void 0?3:E|0,T=T===void 0?4:T|0;var F=this.shape,D=this.stride;return new M(this.data,F[k],F[A],F[b],F[E],F[T],D[k],D[A],D[b],D[E],D[T],this.offset)},C.pick=function(k,A,b,E,T){var F=[],D=[],R=this.offset;typeof k=="number"&&k>=0?R=R+this.stride[0]*k|0:(F.push(this.shape[0]),D.push(this.stride[0])),typeof A=="number"&&A>=0?R=R+this.stride[1]*A|0:(F.push(this.shape[1]),D.push(this.stride[1])),typeof b=="number"&&b>=0?R=R+this.stride[2]*b|0:(F.push(this.shape[2]),D.push(this.stride[2])),typeof E=="number"&&E>=0?R=R+this.stride[3]*E|0:(F.push(this.shape[3]),D.push(this.stride[3])),typeof T=="number"&&T>=0?R=R+this.stride[4]*T|0:(F.push(this.shape[4]),D.push(this.stride[4]));var P=x[F.length+1];return P(this.data,F,D,R)},function(k,A,b,E){return new M(k,A[0],A[1],A[2],A[3],A[4],b[0],b[1],b[2],b[3],b[4],E)}}};function p(_,v){var x=v===-1?"T":String(v),S=d[x];return v===-1?S(_):v===0?S(_,m[_][0]):S(_,m[_],h)}function g(_){if(u(_))return"buffer";if(c)switch(Object.prototype.toString.call(_)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(_)?"array":"generic"}var m={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function y(_,v,x,S){if(_===void 0){var b=m.array[0];return b([])}else typeof _=="number"&&(_=[_]);v===void 0&&(v=[_.length]);var M=v.length;if(x===void 0){x=new Array(M);for(var C=M-1,w=1;C>=0;--C)x[C]=w,w*=v[C]}if(S===void 0){S=0;for(var C=0;C>>0;s.exports=h;function h(d,p){if(isNaN(d)||isNaN(p))return NaN;if(d===p)return d;if(d===0)return p<0?-c:c;var g=u.hi(d),m=u.lo(d);return p>d==d>0?m===f?(g+=1,m=0):m+=1:m===0?(m=f,g-=1):m-=1,u.pack(m,g)}},8406(s,l){var n=1e-6,u=1e-6;l.vertexNormals=function(c,f,h){for(var d=f.length,p=new Array(d),g=h===void 0?n:h,m=0;mg)for(var F=p[v],D=1/Math.sqrt(A*E),T=0;T<3;++T){var R=(T+1)%3,P=(T+2)%3;F[T]+=D*(b[R]*k[P]-b[P]*k[R])}}for(var m=0;mg)for(var D=1/Math.sqrt(z),T=0;T<3;++T)F[T]*=D;else for(var T=0;T<3;++T)F[T]=0}return p},l.faceNormals=function(c,f,h){for(var d=c.length,p=new Array(d),g=h===void 0?u:h,m=0;mg?C=1/Math.sqrt(C):C=0;for(var v=0;v<3;++v)M[v]*=C;p[m]=M}return p}},4081(s){"use strict";s.exports=l;function l(n,u,c,f,h,d,p,g,m,y){var _=u+d+y;if(v>0){var v=Math.sqrt(_+1);n[0]=.5*(p-m)/v,n[1]=.5*(g-f)/v,n[2]=.5*(c-d)/v,n[3]=.5*v}else{var x=Math.max(u,d,y),v=Math.sqrt(2*x-_+1);u>=x?(n[0]=.5*v,n[1]=.5*(h+c)/v,n[2]=.5*(g+f)/v,n[3]=.5*(p-m)/v):d>=x?(n[0]=.5*(c+h)/v,n[1]=.5*v,n[2]=.5*(m+p)/v,n[3]=.5*(g-f)/v):(n[0]=.5*(f+g)/v,n[1]=.5*(p+m)/v,n[2]=.5*v,n[3]=.5*(c-h)/v)}return n}},9977(s,l,n){"use strict";s.exports=v;var u=n(9215),c=n(6582),f=n(7399),h=n(7608),d=n(4081);function p(x,S,M){return Math.sqrt(Math.pow(x,2)+Math.pow(S,2)+Math.pow(M,2))}function g(x,S,M,C){return Math.sqrt(Math.pow(x,2)+Math.pow(S,2)+Math.pow(M,2)+Math.pow(C,2))}function m(x,S){var M=S[0],C=S[1],w=S[2],k=S[3],A=g(M,C,w,k);A>1e-6?(x[0]=M/A,x[1]=C/A,x[2]=w/A,x[3]=k/A):(x[0]=x[1]=x[2]=0,x[3]=1)}function y(x,S,M){this.radius=u([M]),this.center=u(S),this.rotation=u(x),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var _=y.prototype;_.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},_.recalcMatrix=function(x){this.radius.curve(x),this.center.curve(x),this.rotation.curve(x);var S=this.computedRotation;m(S,S);var M=this.computedMatrix;f(M,S);var C=this.computedCenter,w=this.computedEye,k=this.computedUp,A=Math.exp(this.computedRadius[0]);w[0]=C[0]+A*M[2],w[1]=C[1]+A*M[6],w[2]=C[2]+A*M[10],k[0]=M[1],k[1]=M[5],k[2]=M[9];for(var b=0;b<3;++b){for(var E=0,T=0;T<3;++T)E+=M[b+4*T]*w[T];M[12+b]=-E}},_.getMatrix=function(x,S){this.recalcMatrix(x);var M=this.computedMatrix;if(S){for(var C=0;C<16;++C)S[C]=M[C];return S}return M},_.idle=function(x){this.center.idle(x),this.radius.idle(x),this.rotation.idle(x)},_.flush=function(x){this.center.flush(x),this.radius.flush(x),this.rotation.flush(x)},_.pan=function(x,S,M,C){S=S||0,M=M||0,C=C||0,this.recalcMatrix(x);var w=this.computedMatrix,k=w[1],A=w[5],b=w[9],E=p(k,A,b);k/=E,A/=E,b/=E;var T=w[0],F=w[4],D=w[8],R=T*k+F*A+D*b;T-=k*R,F-=A*R,D-=b*R;var P=p(T,F,D);T/=P,F/=P,D/=P;var z=w[2],I=w[6],L=w[10],B=z*k+I*A+L*b,O=z*T+I*F+L*D;z-=B*k+O*T,I-=B*A+O*F,L-=B*b+O*D;var G=p(z,I,L);z/=G,I/=G,L/=G;var W=T*S+k*M,X=F*S+A*M,Z=D*S+b*M;this.center.move(x,W,X,Z);var J=Math.exp(this.computedRadius[0]);J=Math.max(1e-4,J+C),this.radius.set(x,Math.log(J))},_.rotate=function(x,S,M,C){this.recalcMatrix(x),S=S||0,M=M||0;var w=this.computedMatrix,k=w[0],A=w[4],b=w[8],E=w[1],T=w[5],F=w[9],D=w[2],R=w[6],P=w[10],z=S*k+M*E,I=S*A+M*T,L=S*b+M*F,B=-(R*L-P*I),O=-(P*z-D*L),G=-(D*I-R*z),W=Math.sqrt(Math.max(0,1-Math.pow(B,2)-Math.pow(O,2)-Math.pow(G,2))),X=g(B,O,G,W);X>1e-6?(B/=X,O/=X,G/=X,W/=X):(B=O=G=0,W=1);var Z=this.computedRotation,J=Z[0],N=Z[1],H=Z[2],$=Z[3],U=J*W+$*B+N*G-H*O,V=N*W+$*O+H*B-J*G,j=H*W+$*G+J*O-N*B,q=$*W-J*B-N*O-H*G;if(C){B=D,O=R,G=P;var Y=Math.sin(C)/p(B,O,G);B*=Y,O*=Y,G*=Y,W=Math.cos(S),U=U*W+q*B+V*G-j*O,V=V*W+q*O+j*B-U*G,j=j*W+q*G+U*O-V*B,q=q*W-U*B-V*O-j*G}var K=g(U,V,j,q);K>1e-6?(U/=K,V/=K,j/=K,q/=K):(U=V=j=0,q=1),this.rotation.set(x,U,V,j,q)},_.lookAt=function(x,S,M,C){this.recalcMatrix(x),M=M||this.computedCenter,S=S||this.computedEye,C=C||this.computedUp;var w=this.computedMatrix;c(w,S,M,C);var k=this.computedRotation;d(k,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),m(k,k),this.rotation.set(x,k[0],k[1],k[2],k[3]);for(var A=0,b=0;b<3;++b)A+=Math.pow(M[b]-S[b],2);this.radius.set(x,.5*Math.log(Math.max(A,1e-6))),this.center.set(x,M[0],M[1],M[2])},_.translate=function(x,S,M,C){this.center.move(x,S||0,M||0,C||0)},_.setMatrix=function(x,S){var M=this.computedRotation;d(M,S[0],S[1],S[2],S[4],S[5],S[6],S[8],S[9],S[10]),m(M,M),this.rotation.set(x,M[0],M[1],M[2],M[3]);var C=this.computedMatrix;h(C,S);var w=C[15];if(Math.abs(w)>1e-6){var k=C[12]/w,A=C[13]/w,b=C[14]/w;this.recalcMatrix(x);var E=Math.exp(this.computedRadius[0]);this.center.set(x,k-C[2]*E,A-C[6]*E,b-C[10]*E),this.radius.idle(x)}else this.center.idle(x),this.radius.idle(x)},_.setDistance=function(x,S){S>0&&this.radius.set(x,Math.log(S))},_.setDistanceLimits=function(x,S){x>0?x=Math.log(x):x=-1/0,S>0?S=Math.log(S):S=1/0,S=Math.max(S,x),this.radius.bounds[0][0]=x,this.radius.bounds[1][0]=S},_.getDistanceLimits=function(x){var S=this.radius.bounds;return x?(x[0]=Math.exp(S[0][0]),x[1]=Math.exp(S[1][0]),x):[Math.exp(S[0][0]),Math.exp(S[1][0])]},_.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},_.fromJSON=function(x){var S=this.lastT(),M=x.center;M&&this.center.set(S,M[0],M[1],M[2]);var C=x.rotation;C&&this.rotation.set(S,C[0],C[1],C[2],C[3]);var w=x.distance;w&&w>0&&this.radius.set(S,Math.log(w)),this.setDistanceLimits(x.zoomMin,x.zoomMax)};function v(x){x=x||{};var S=x.center||[0,0,0],M=x.rotation||[0,0,0,1],C=x.radius||1;S=[].slice.call(S,0,3),M=[].slice.call(M,0,4),m(M,M);var w=new y(M,S,Math.log(C));return w.setDistanceLimits(x.zoomMin,x.zoomMax),("eye"in x||"up"in x)&&w.lookAt(0,x.eye,x.center,x.up),w}},1371(s,l,n){"use strict";var u=n(3233);s.exports=function(f,h,d){return d=typeof d<"u"?d+"":" ",u(d,h)+f}},3202(s){s.exports=function(n,u){u||(u=[0,""]),n=String(n);var c=parseFloat(n,10);return u[0]=c,u[1]=n.match(/[\d.\-\+]*\s*(.*)/)[1]||"",u}},3088(s,l,n){"use strict";s.exports=c;var u=n(3140);function c(f,h){for(var d=h.length|0,p=f.length,g=[new Array(d),new Array(d)],m=0;m0){F=g[P][E][0],R=P;break}D=F[R^1];for(var z=0;z<2;++z)for(var I=g[z][E],L=0;L0&&(F=B,D=O,R=z)}return T||F&&v(F,R),D}function S(b,E){var T=g[E][b][0],F=[b];v(T,E);for(var D=T[E^1],R=E;;){for(;D!==b;)F.push(D),D=x(F[F.length-2],D,!1);if(g[0][b].length+g[1][b].length===0)break;var P=F[F.length-1],z=b,I=F[1],L=x(P,z,!0);if(u(h[P],h[z],h[I],h[L])<0)break;F.push(b),D=x(P,z)}return F}function M(b,E){return E[1]===E[E.length-1]}for(var m=0;m0;){var k=g[0][m].length,A=S(m,C);M(w,A)?w.push.apply(w,A):(w.length>0&&_.push(w),w=A)}w.length>0&&_.push(w)}return _}},5609(s,l,n){"use strict";s.exports=c;var u=n(3134);function c(f,h){for(var d=u(f,h.length),p=new Array(h.length),g=new Array(h.length),m=[],y=0;y0;){var v=m.pop();p[v]=!1;for(var x=d[v],y=0;y0}k=k.filter(A);for(var b=k.length,E=new Array(b),T=new Array(b),w=0;w0;){var K=j.pop(),te=X[K];p(te,function(pe,xe){return pe-xe});var ne=te.length,se=q[K],le;if(se===0){var I=k[K];le=[I]}for(var w=0;w=0)&&(q[ce]=se^1,j.push(ce),se===0)){var I=k[ce];V(I)||(I.reverse(),le.push(I))}}se===0&&Y.push(le)}return Y}},5085(s,l,n){s.exports=x;var u=n(3250)[3],c=n(4209),f=n(3352),h=n(2478);function d(){return!0}function p(S){return function(M,C){var w=S[M];return w?!!w.queryPoint(C,d):!1}}function g(S){for(var M={},C=0;C0&&M[w]===C[0])k=S[w-1];else return 1;for(var A=1;k;){var b=k.key,E=u(C,b[0],b[1]);if(b[0][0]0)A=-1,k=k.right;else return 0;else if(E>0)k=k.left;else if(E<0)A=1,k=k.right;else return 0}return A}}function y(S){return 1}function _(S){return function(C){return S(C[0],C[1])?0:1}}function v(S,M){return function(w){return S(w[0],w[1])?0:M(w)}}function x(S){for(var M=S.length,C=[],w=[],k=0,A=0;A=y?(b=1,T=y+2*x+M):(b=-x/y,T=x*b+M)):(b=0,S>=0?(E=0,T=M):-S>=v?(E=1,T=v+2*S+M):(E=-S/v,T=S*E+M));else if(E<0)E=0,x>=0?(b=0,T=M):-x>=y?(b=1,T=y+2*x+M):(b=-x/y,T=x*b+M);else{var F=1/A;b*=F,E*=F,T=b*(y*b+_*E+2*x)+E*(_*b+v*E+2*S)+M}else{var D,R,P,z;b<0?(D=_+x,R=v+S,R>D?(P=R-D,z=y-2*_+v,P>=z?(b=1,E=0,T=y+2*x+M):(b=P/z,E=1-b,T=b*(y*b+_*E+2*x)+E*(_*b+v*E+2*S)+M)):(b=0,R<=0?(E=1,T=v+2*S+M):S>=0?(E=0,T=M):(E=-S/v,T=S*E+M))):E<0?(D=_+S,R=y+x,R>D?(P=R-D,z=y-2*_+v,P>=z?(E=1,b=0,T=v+2*S+M):(E=P/z,b=1-E,T=b*(y*b+_*E+2*x)+E*(_*b+v*E+2*S)+M)):(E=0,R<=0?(b=1,T=y+2*x+M):x>=0?(b=0,T=M):(b=-x/y,T=x*b+M))):(P=v+S-_-x,P<=0?(b=0,E=1,T=v+2*S+M):(z=y-2*_+v,P>=z?(b=1,E=0,T=y+2*x+M):(b=P/z,E=1-b,T=b*(y*b+_*E+2*x)+E*(_*b+v*E+2*S)+M)))}for(var I=1-b-E,m=0;m0){var v=d[g-1];if(u(y,v)===0&&f(v)!==_){g-=1;continue}}d[g++]=y}}return d.length=g,d}},3233(s){"use strict";var l="",n;s.exports=u;function u(c,f){if(typeof c!="string")throw new TypeError("expected a string");if(f===1)return c;if(f===2)return c+c;var h=c.length*f;if(n!==c||typeof n>"u")n=c,l="";else if(l.length>=h)return l.substr(0,h);for(;h>l.length&&f>1;)f&1&&(l+=c),f>>=1,c+=c;return l+=c,l=l.substr(0,h),l}},3025(s,l,n){s.exports=n.g.performance&&n.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004(s){"use strict";s.exports=l;function l(n){for(var u=n.length,c=n[n.length-1],f=u,h=u-2;h>=0;--h){var d=c,p=n[h];c=d+p;var g=c-d,m=p-g;m&&(n[--f]=c,c=m)}for(var y=0,h=f;h0){if(R<=0)return P;z=D+R}else if(D<0){if(R>=0)return P;z=-(D+R)}else return P;var I=g*z;return P>=I||P<=-I?P:S(E,T,F)},function(E,T,F,D){var R=E[0]-D[0],P=T[0]-D[0],z=F[0]-D[0],I=E[1]-D[1],L=T[1]-D[1],B=F[1]-D[1],O=E[2]-D[2],G=T[2]-D[2],W=F[2]-D[2],X=P*B,Z=z*L,J=z*I,N=R*B,H=R*L,$=P*I,U=O*(X-Z)+G*(J-N)+W*(H-$),V=(Math.abs(X)+Math.abs(Z))*Math.abs(O)+(Math.abs(J)+Math.abs(N))*Math.abs(G)+(Math.abs(H)+Math.abs($))*Math.abs(W),j=m*V;return U>j||-U>j?U:M(E,T,F,D)}];function w(b){var E=C[b.length];return E||(E=C[b.length]=x(b.length)),E.apply(void 0,b)}function k(b,E,T,F,D,R,P){return function(I,L,B,O,G){switch(arguments.length){case 0:case 1:return 0;case 2:return F(I,L);case 3:return D(I,L,B);case 4:return R(I,L,B,O);case 5:return P(I,L,B,O,G)}for(var W=new Array(arguments.length),X=0;X0&&y>0||m<0&&y<0)return!1;var _=u(p,h,d),v=u(g,h,d);return _>0&&v>0||_<0&&v<0?!1:m===0&&y===0&&_===0&&v===0?c(h,d,p,g):!0}},8545(s){"use strict";s.exports=n;function l(u,c){var f=u+c,h=f-u,d=f-h,p=c-h,g=u-d,m=g+p;return m?[m,f]:[f]}function n(u,c){var f=u.length|0,h=c.length|0;if(f===1&&h===1)return l(u[0],-c[0]);var d=f+h,p=new Array(d),g=0,m=0,y=0,_=Math.abs,v=u[m],x=_(v),S=-c[y],M=_(S),C,w;x=h?(C=v,m+=1,m=h?(C=v,m+=1,m"u"&&(C=d(x));var w=x.length;if(w===0||C<1)return{cells:[],vertexIds:[],vertexWeights:[]};var k=p(S,+M),A=g(x,C),b=m(A,S,k,+M),E=y(A,S.length|0),T=h(C)(x,A.data,E,k),F=_(A),D=[].slice.call(b.data,0,b.shape[0]);return c.free(k),c.free(A.data),c.free(b.data),c.free(E),{cells:T,vertexIds:F,vertexWeights:D}}},1570(s){"use strict";s.exports=n;var l=[function(){function c(h,d,p,g){for(var m=Math.min(p,g)|0,y=Math.max(p,g)|0,_=h[2*m],v=h[2*m+1];_>1,S=d[2*x+1];if(S===y)return x;y>1,S=d[2*x+1];if(S===y)return x;y>1,S=d[2*x+1];if(S===y)return x;y>1,S=d[2*x+1];if(S===y)return x;y>1,z=g(E[P],T);z<=0?(z===0&&(R=P),F=P+1):z>0&&(D=P-1)}return R}u=v;function x(E,T){for(var F=new Array(E.length),D=0,R=F.length;D=E.length||g(E[X],P)!==0););}return F}u=x;function S(E,T){if(!T)return x(_(C(E,0)),E,0);for(var F=new Array(T),D=0;D>>B&1&&L.push(R[B]);T.push(L)}return y(T)}u=M;function C(E,T){if(T<0)return[];for(var F=[],D=(1<0)-(f<0)},l.abs=function(f){var h=f>>n-1;return(f^h)-h},l.min=function(f,h){return h^(f^h)&-(f65535)<<4,f>>>=h,d=(f>255)<<3,f>>>=d,h|=d,d=(f>15)<<2,f>>>=d,h|=d,d=(f>3)<<1,f>>>=d,h|=d,h|f>>1},l.log10=function(f){return f>=1e9?9:f>=1e8?8:f>=1e7?7:f>=1e6?6:f>=1e5?5:f>=1e4?4:f>=1e3?3:f>=100?2:f>=10?1:0},l.popCount=function(f){return f=f-(f>>>1&1431655765),f=(f&858993459)+(f>>>2&858993459),(f+(f>>>4)&252645135)*16843009>>>24};function u(f){var h=32;return f&=-f,f&&h--,f&65535&&(h-=16),f&16711935&&(h-=8),f&252645135&&(h-=4),f&858993459&&(h-=2),f&1431655765&&(h-=1),h}l.countTrailingZeros=u,l.nextPow2=function(f){return f+=f===0,--f,f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f+1},l.prevPow2=function(f){return f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f-(f>>>1)},l.parity=function(f){return f^=f>>>16,f^=f>>>8,f^=f>>>4,f&=15,27030>>>f&1};var c=new Array(256);(function(f){for(var h=0;h<256;++h){var d=h,p=h,g=7;for(d>>>=1;d;d>>>=1)p<<=1,p|=d&1,--g;f[h]=p<>>8&255]<<16|c[f>>>16&255]<<8|c[f>>>24&255]},l.interleave2=function(f,h){return f&=65535,f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,h&=65535,h=(h|h<<8)&16711935,h=(h|h<<4)&252645135,h=(h|h<<2)&858993459,h=(h|h<<1)&1431655765,f|h<<1},l.deinterleave2=function(f,h){return f=f>>>h&1431655765,f=(f|f>>>1)&858993459,f=(f|f>>>2)&252645135,f=(f|f>>>4)&16711935,f=(f|f>>>16)&65535,f<<16>>16},l.interleave3=function(f,h,d){return f&=1023,f=(f|f<<16)&4278190335,f=(f|f<<8)&251719695,f=(f|f<<4)&3272356035,f=(f|f<<2)&1227133513,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,f|=h<<1,d&=1023,d=(d|d<<16)&4278190335,d=(d|d<<8)&251719695,d=(d|d<<4)&3272356035,d=(d|d<<2)&1227133513,f|d<<2},l.deinterleave3=function(f,h){return f=f>>>h&1227133513,f=(f|f>>>2)&3272356035,f=(f|f>>>4)&251719695,f=(f|f>>>8)&4278190335,f=(f|f>>>16)&1023,f<<22>>22},l.nextCombination=function(f){var h=f|f-1;return h+1|(~h&-~h)-1>>>u(f)+1}},2014(s,l,n){"use strict";"use restrict";var u=n(3105),c=n(4623);function f(b){for(var E=0,T=Math.max,F=0,D=b.length;F>1,P=p(b[R],E);P<=0?(P===0&&(D=R),T=R+1):P>0&&(F=R-1)}return D}l.findCell=_;function v(b,E){for(var T=new Array(b.length),F=0,D=T.length;F=b.length||p(b[W],R)!==0););}return T}l.incidence=v;function x(b,E){if(!E)return v(y(M(b,0)),b,0);for(var T=new Array(E),F=0;F>>L&1&&I.push(D[L]);E.push(I)}return m(E)}l.explode=S;function M(b,E){if(E<0)return[];for(var T=[],F=(1<>1:(N>>1)-1}function F(N){for(var H=E(N);;){var $=H,U=2*N+1,V=2*(N+1),j=N;if(U0;){var $=T(N);if($>=0){var U=E($);if(H0){var N=I[0];return b(0,O-1),O-=1,F(0),N}return-1}function P(N,H){var $=I[N];return x[$]===H?N:(x[$]=-1/0,D(N),R(),x[$]=H,O+=1,D(O-1))}function z(N){if(!S[N]){S[N]=!0;var H=_[N],$=v[N];_[$]>=0&&(_[$]=H),v[H]>=0&&(v[H]=$),L[H]>=0&&P(L[H],A(H)),L[$]>=0&&P(L[$],A($))}}for(var I=[],L=new Array(m),M=0;M>1;M>=0;--M)F(M);for(;;){var G=R();if(G<0||x[G]>g)break;z(G)}for(var W=[],M=0;M=0&&$>=0&&H!==$){var U=L[H],V=L[$];U!==V&&J.push([U,V])}}),c.unique(c.normalize(J)),{positions:W,edges:J}}},1303(s,l,n){"use strict";s.exports=f;var u=n(3250);function c(h,d){var p,g;if(d[0][0]d[1][0])p=d[1],g=d[0];else{var m=Math.min(h[0][1],h[1][1]),y=Math.max(h[0][1],h[1][1]),_=Math.min(d[0][1],d[1][1]),v=Math.max(d[0][1],d[1][1]);return y<_?y-_:m>v?m-v:y-v}var x,S;h[0][1]d[1][0])p=d[1],g=d[0];else return c(d,h);var m,y;if(h[0][0]h[1][0])m=h[1],y=h[0];else return-c(h,d);var _=u(p,g,y),v=u(p,g,m);if(_<0){if(v<=0)return _}else if(_>0){if(v>=0)return _}else if(v)return v;if(_=u(y,m,g),v=u(y,m,p),_<0){if(v<=0)return _}else if(_>0){if(v>=0)return _}else if(v)return v;return g[0]-y[0]}},4209(s,l,n){"use strict";s.exports=v;var u=n(2478),c=n(3840),f=n(3250),h=n(1303);function d(x,S,M){this.slabs=x,this.coordinates=S,this.horizontal=M}var p=d.prototype;function g(x,S){return x.y-S}function m(x,S){for(var M=null;x;){var C=x.key,w,k;C[0][0]0)if(S[0]!==C[1][0])M=x,x=x.right;else{var b=m(x.right,S);if(b)return b;x=x.left}else{if(S[0]!==C[1][0])return x;var b=m(x.right,S);if(b)return b;x=x.left}}return M}p.castUp=function(x){var S=u.le(this.coordinates,x[0]);if(S<0)return-1;var M=this.slabs[S],C=m(this.slabs[S],x),w=-1;if(C&&(w=C.value),this.coordinates[S]===x[0]){var k=null;if(C&&(k=C.key),S>0){var A=m(this.slabs[S-1],x);A&&(k?h(A.key,k)>0&&(k=A.key,w=A.value):(w=A.value,k=A.key))}var b=this.horizontal[S];if(b.length>0){var E=u.ge(b,x[1],g);if(E=b.length)return w;T=b[E]}}if(T.start)if(k){var F=f(k[0],k[1],[x[0],T.y]);k[0][0]>k[1][0]&&(F=-F),F>0&&(w=T.index)}else w=T.index;else T.y!==x[1]&&(w=T.index)}}}return w};function y(x,S,M,C){this.y=x,this.index=S,this.start=M,this.closed=C}function _(x,S,M,C){this.x=x,this.segment=S,this.create=M,this.index=C}function v(x){for(var S=x.length,M=2*S,C=new Array(M),w=0;w1&&(S=1);for(var M=1-S,C=m.length,w=new Array(C),k=0;k0||x>0&&w<0){var k=h(S,w,M,x);_.push(k),v.push(k.slice())}w<0?v.push(M.slice()):w>0?_.push(M.slice()):(_.push(M.slice()),v.push(M.slice())),x=w}return{positive:_,negative:v}}function p(m,y){for(var _=[],v=f(m[m.length-1],y),x=m[m.length-1],S=m[0],M=0;M0||v>0&&C<0)&&_.push(h(x,C,S,v)),C>=0&&_.push(S.slice()),v=C}return _}function g(m,y){for(var _=[],v=f(m[m.length-1],y),x=m[m.length-1],S=m[0],M=0;M0||v>0&&C<0)&&_.push(h(x,C,S,v)),C<=0&&_.push(S.slice()),v=C}return _}},3387(s,l,n){var u;(function(){"use strict";var c={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function f(m){return d(g(m),arguments)}function h(m,y){return f.apply(null,[m].concat(y||[]))}function d(m,y){var _=1,v=m.length,x,S="",M,C,w,k,A,b,E,T;for(M=0;M=0),w.type){case"b":x=parseInt(x,10).toString(2);break;case"c":x=String.fromCharCode(parseInt(x,10));break;case"d":case"i":x=parseInt(x,10);break;case"j":x=JSON.stringify(x,null,w.width?parseInt(w.width):0);break;case"e":x=w.precision?parseFloat(x).toExponential(w.precision):parseFloat(x).toExponential();break;case"f":x=w.precision?parseFloat(x).toFixed(w.precision):parseFloat(x);break;case"g":x=w.precision?String(Number(x.toPrecision(w.precision))):parseFloat(x);break;case"o":x=(parseInt(x,10)>>>0).toString(8);break;case"s":x=String(x),x=w.precision?x.substring(0,w.precision):x;break;case"t":x=String(!!x),x=w.precision?x.substring(0,w.precision):x;break;case"T":x=Object.prototype.toString.call(x).slice(8,-1).toLowerCase(),x=w.precision?x.substring(0,w.precision):x;break;case"u":x=parseInt(x,10)>>>0;break;case"v":x=x.valueOf(),x=w.precision?x.substring(0,w.precision):x;break;case"x":x=(parseInt(x,10)>>>0).toString(16);break;case"X":x=(parseInt(x,10)>>>0).toString(16).toUpperCase();break}c.json.test(w.type)?S+=x:(c.number.test(w.type)&&(!E||w.sign)?(T=E?"+":"-",x=x.toString().replace(c.sign,"")):T="",A=w.pad_char?w.pad_char==="0"?"0":w.pad_char.charAt(1):" ",b=w.width-(T+x).length,k=w.width&&b>0?A.repeat(b):"",S+=w.align?T+x+k:A==="0"?T+k+x:k+T+x)}return S}var p=Object.create(null);function g(m){if(p[m])return p[m];for(var y=m,_,v=[],x=0;y;){if((_=c.text.exec(y))!==null)v.push(_[0]);else if((_=c.modulo.exec(y))!==null)v.push("%");else if((_=c.placeholder.exec(y))!==null){if(_[2]){x|=1;var S=[],M=_[2],C=[];if((C=c.key.exec(M))!==null)for(S.push(C[1]);(M=M.substring(C[0].length))!=="";)if((C=c.key_access.exec(M))!==null)S.push(C[1]);else if((C=c.index_access.exec(M))!==null)S.push(C[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");_[2]=S}else x|=2;if(x===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");v.push({placeholder:_[0],param_no:_[1],keys:_[2],sign:_[3],pad_char:_[4],align:_[5],width:_[6],precision:_[7],type:_[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");y=y.substring(_[0].length)}return p[m]=v}l.sprintf=f,l.vsprintf=h,typeof window<"u"&&(window.sprintf=f,window.vsprintf=h,u=(function(){return{sprintf:f,vsprintf:h}}).call(l,n,l,s),u!==void 0&&(s.exports=u))})()},3711(s,l,n){"use strict";s.exports=g;var u=n(2640),c=n(781),f={"2d":function(m,y,_){var v=m({order:y,scalarArguments:3,getters:_==="generic"?[0]:void 0,phase:function(S,M,C,w){return S>w|0},vertex:function(S,M,C,w,k,A,b,E,T,F,D,R,P){var z=(b<<0)+(E<<1)+(T<<2)+(F<<3)|0;if(!(z===0||z===15))switch(z){case 0:D.push([S-.5,M-.5]);break;case 1:D.push([S-.25-.25*(w+C-2*P)/(C-w),M-.25-.25*(k+C-2*P)/(C-k)]);break;case 2:D.push([S-.75-.25*(-w-C+2*P)/(w-C),M-.25-.25*(A+w-2*P)/(w-A)]);break;case 3:D.push([S-.5,M-.5-.5*(k+C+A+w-4*P)/(C-k+w-A)]);break;case 4:D.push([S-.25-.25*(A+k-2*P)/(k-A),M-.75-.25*(-k-C+2*P)/(k-C)]);break;case 5:D.push([S-.5-.5*(w+C+A+k-4*P)/(C-w+k-A),M-.5]);break;case 6:D.push([S-.5-.25*(-w-C+A+k)/(w-C+k-A),M-.5-.25*(-k-C+A+w)/(k-C+w-A)]);break;case 7:D.push([S-.75-.25*(A+k-2*P)/(k-A),M-.75-.25*(A+w-2*P)/(w-A)]);break;case 8:D.push([S-.75-.25*(-A-k+2*P)/(A-k),M-.75-.25*(-A-w+2*P)/(A-w)]);break;case 9:D.push([S-.5-.25*(w+C+-A-k)/(C-w+A-k),M-.5-.25*(k+C+-A-w)/(C-k+A-w)]);break;case 10:D.push([S-.5-.5*(-w-C+-A-k+4*P)/(w-C+A-k),M-.5]);break;case 11:D.push([S-.25-.25*(-A-k+2*P)/(A-k),M-.75-.25*(k+C-2*P)/(C-k)]);break;case 12:D.push([S-.5,M-.5-.5*(-k-C+-A-w+4*P)/(k-C+A-w)]);break;case 13:D.push([S-.75-.25*(w+C-2*P)/(C-w),M-.25-.25*(-A-w+2*P)/(A-w)]);break;case 14:D.push([S-.25-.25*(-w-C+2*P)/(w-C),M-.25-.25*(-k-C+2*P)/(k-C)]);break;case 15:D.push([S-.5,M-.5]);break}},cell:function(S,M,C,w,k,A,b,E,T){k?E.push([S,M]):E.push([M,S])}});return function(x,S){var M=[],C=[];return v(x,M,C,S),{positions:M,cells:C}}}};function h(m,y){var _=m.length+"d",v=f[_];if(v)return v(u,m,y)}function d(m,y){for(var _=c(m,y),v=_.length,x=new Array(v),S=new Array(v),M=0;MMath.max(w,k)?A[2]=1:w>Math.max(C,k)?A[0]=1:A[1]=1;for(var b=0,E=0,T=0;T<3;++T)b+=M[T]*M[T],E+=A[T]*M[T];for(var T=0;T<3;++T)A[T]-=E/b*M[T];return d(A,A),A}function _(M,C,w,k,A,b,E,T){this.center=u(w),this.up=u(k),this.right=u(A),this.radius=u([b]),this.angle=u([E,T]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(M,C),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var F=0;F<16;++F)this.computedMatrix[F]=.5;this.recalcMatrix(0)}var v=_.prototype;v.setDistanceLimits=function(M,C){M>0?M=Math.log(M):M=-1/0,C>0?C=Math.log(C):C=1/0,C=Math.max(C,M),this.radius.bounds[0][0]=M,this.radius.bounds[1][0]=C},v.getDistanceLimits=function(M){var C=this.radius.bounds[0];return M?(M[0]=Math.exp(C[0][0]),M[1]=Math.exp(C[1][0]),M):[Math.exp(C[0][0]),Math.exp(C[1][0])]},v.recalcMatrix=function(M){this.center.curve(M),this.up.curve(M),this.right.curve(M),this.radius.curve(M),this.angle.curve(M);for(var C=this.computedUp,w=this.computedRight,k=0,A=0,b=0;b<3;++b)A+=C[b]*w[b],k+=C[b]*C[b];for(var E=Math.sqrt(k),T=0,b=0;b<3;++b)w[b]-=C[b]*A/k,T+=w[b]*w[b],C[b]/=E;for(var F=Math.sqrt(T),b=0;b<3;++b)w[b]/=F;var D=this.computedToward;h(D,C,w),d(D,D);for(var R=Math.exp(this.computedRadius[0]),P=this.computedAngle[0],z=this.computedAngle[1],I=Math.cos(P),L=Math.sin(P),B=Math.cos(z),O=Math.sin(z),G=this.computedCenter,W=I*B,X=L*B,Z=O,J=-I*O,N=-L*O,H=B,$=this.computedEye,U=this.computedMatrix,b=0;b<3;++b){var V=W*w[b]+X*D[b]+Z*C[b];U[4*b+1]=J*w[b]+N*D[b]+H*C[b],U[4*b+2]=V,U[4*b+3]=0}var j=U[1],q=U[5],Y=U[9],K=U[2],te=U[6],ne=U[10],se=q*ne-Y*te,le=Y*K-j*ne,ce=j*te-q*K,pe=g(se,le,ce);se/=pe,le/=pe,ce/=pe,U[0]=se,U[4]=le,U[8]=ce;for(var b=0;b<3;++b)$[b]=G[b]+U[2+4*b]*R;for(var b=0;b<3;++b){for(var T=0,xe=0;xe<3;++xe)T+=U[b+4*xe]*$[xe];U[12+b]=-T}U[15]=1},v.getMatrix=function(M,C){this.recalcMatrix(M);var w=this.computedMatrix;if(C){for(var k=0;k<16;++k)C[k]=w[k];return C}return w};var x=[0,0,0];v.rotate=function(M,C,w,k){if(this.angle.move(M,C,w),k){this.recalcMatrix(M);var A=this.computedMatrix;x[0]=A[2],x[1]=A[6],x[2]=A[10];for(var b=this.computedUp,E=this.computedRight,T=this.computedToward,F=0;F<3;++F)A[4*F]=b[F],A[4*F+1]=E[F],A[4*F+2]=T[F];f(A,A,k,x);for(var F=0;F<3;++F)b[F]=A[4*F],E[F]=A[4*F+1];this.up.set(M,b[0],b[1],b[2]),this.right.set(M,E[0],E[1],E[2])}},v.pan=function(M,C,w,k){C=C||0,w=w||0,k=k||0,this.recalcMatrix(M);var A=this.computedMatrix,b=Math.exp(this.computedRadius[0]),E=A[1],T=A[5],F=A[9],D=g(E,T,F);E/=D,T/=D,F/=D;var R=A[0],P=A[4],z=A[8],I=R*E+P*T+z*F;R-=E*I,P-=T*I,z-=F*I;var L=g(R,P,z);R/=L,P/=L,z/=L;var B=R*C+E*w,O=P*C+T*w,G=z*C+F*w;this.center.move(M,B,O,G);var W=Math.exp(this.computedRadius[0]);W=Math.max(1e-4,W+k),this.radius.set(M,Math.log(W))},v.translate=function(M,C,w,k){this.center.move(M,C||0,w||0,k||0)},v.setMatrix=function(M,C,w,k){var A=1;typeof w=="number"&&(A=w|0),(A<0||A>3)&&(A=1);var b=(A+2)%3,E=(A+1)%3;C||(this.recalcMatrix(M),C=this.computedMatrix);var T=C[A],F=C[A+4],D=C[A+8];if(k){var P=Math.abs(T),z=Math.abs(F),I=Math.abs(D),L=Math.max(P,z,I);P===L?(T=T<0?-1:1,F=D=0):I===L?(D=D<0?-1:1,T=F=0):(F=F<0?-1:1,T=D=0)}else{var R=g(T,F,D);T/=R,F/=R,D/=R}var B=C[b],O=C[b+4],G=C[b+8],W=B*T+O*F+G*D;B-=T*W,O-=F*W,G-=D*W;var X=g(B,O,G);B/=X,O/=X,G/=X;var Z=F*G-D*O,J=D*B-T*G,N=T*O-F*B,H=g(Z,J,N);Z/=H,J/=H,N/=H,this.center.jump(M,ie,Q,ue),this.radius.idle(M),this.up.jump(M,T,F,D),this.right.jump(M,B,O,G);var $,U;if(A===2){var V=C[1],j=C[5],q=C[9],Y=V*B+j*O+q*G,K=V*Z+j*J+q*N;le<0?$=-Math.PI/2:$=Math.PI/2,U=Math.atan2(K,Y)}else{var te=C[2],ne=C[6],se=C[10],le=te*T+ne*F+se*D,ce=te*B+ne*O+se*G,pe=te*Z+ne*J+se*N;$=Math.asin(m(le)),U=Math.atan2(pe,ce)}this.angle.jump(M,U,$),this.recalcMatrix(M);var xe=C[2],ye=C[6],fe=C[10],ae=this.computedMatrix;c(ae,C);var ee=ae[15],ie=ae[12]/ee,Q=ae[13]/ee,ue=ae[14]/ee,ge=Math.exp(this.computedRadius[0]);this.center.jump(M,ie-xe*ge,Q-ye*ge,ue-fe*ge)},v.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},v.idle=function(M){this.center.idle(M),this.up.idle(M),this.right.idle(M),this.radius.idle(M),this.angle.idle(M)},v.flush=function(M){this.center.flush(M),this.up.flush(M),this.right.flush(M),this.radius.flush(M),this.angle.flush(M)},v.setDistance=function(M,C){C>0&&this.radius.set(M,Math.log(C))},v.lookAt=function(M,C,w,k){this.recalcMatrix(M),C=C||this.computedEye,w=w||this.computedCenter,k=k||this.computedUp;var A=k[0],b=k[1],E=k[2],T=g(A,b,E);if(!(T<1e-6)){A/=T,b/=T,E/=T;var F=C[0]-w[0],D=C[1]-w[1],R=C[2]-w[2],P=g(F,D,R);if(!(P<1e-6)){F/=P,D/=P,R/=P;var z=this.computedRight,I=z[0],L=z[1],B=z[2],O=A*I+b*L+E*B;I-=O*A,L-=O*b,B-=O*E;var G=g(I,L,B);if(!(G<.01&&(I=b*R-E*D,L=E*F-A*R,B=A*D-b*F,G=g(I,L,B),G<1e-6))){I/=G,L/=G,B/=G,this.up.set(M,A,b,E),this.right.set(M,I,L,B),this.center.set(M,w[0],w[1],w[2]),this.radius.set(M,Math.log(P));var W=b*B-E*L,X=E*I-A*B,Z=A*L-b*I,J=g(W,X,Z);W/=J,X/=J,Z/=J;var N=A*F+b*D+E*R,H=I*F+L*D+B*R,$=W*F+X*D+Z*R,U=Math.asin(m(N)),V=Math.atan2($,H),j=this.angle._state,q=j[j.length-1],Y=j[j.length-2];q=q%(2*Math.PI);var K=Math.abs(q+2*Math.PI-V),te=Math.abs(q-V),ne=Math.abs(q-2*Math.PI-V);K0?B.pop():new ArrayBuffer(I)}l.mallocArrayBuffer=x;function S(z){return new Uint8Array(x(z),0,z)}l.mallocUint8=S;function M(z){return new Uint16Array(x(2*z),0,z)}l.mallocUint16=M;function C(z){return new Uint32Array(x(4*z),0,z)}l.mallocUint32=C;function w(z){return new Int8Array(x(z),0,z)}l.mallocInt8=w;function k(z){return new Int16Array(x(2*z),0,z)}l.mallocInt16=k;function A(z){return new Int32Array(x(4*z),0,z)}l.mallocInt32=A;function b(z){return new Float32Array(x(4*z),0,z)}l.mallocFloat32=l.mallocFloat=b;function E(z){return new Float64Array(x(8*z),0,z)}l.mallocFloat64=l.mallocDouble=E;function T(z){return h?new Uint8ClampedArray(x(z),0,z):S(z)}l.mallocUint8Clamped=T;function F(z){return d?new BigUint64Array(x(8*z),0,z):null}l.mallocBigUint64=F;function D(z){return p?new BigInt64Array(x(8*z),0,z):null}l.mallocBigInt64=D;function R(z){return new DataView(x(z),0,z)}l.mallocDataView=R;function P(z){z=u.nextPow2(z);var I=u.log2(z),L=y[I];return L.length>0?L.pop():new f(z)}l.mallocBuffer=P,l.clearCache=function(){for(var I=0;I<32;++I)g.UINT8[I].length=0,g.UINT16[I].length=0,g.UINT32[I].length=0,g.INT8[I].length=0,g.INT16[I].length=0,g.INT32[I].length=0,g.FLOAT[I].length=0,g.DOUBLE[I].length=0,g.BIGUINT64[I].length=0,g.BIGINT64[I].length=0,g.UINT8C[I].length=0,m[I].length=0,y[I].length=0}},1755(s){"use strict";"use restrict";s.exports=l;function l(u){this.roots=new Array(u),this.ranks=new Array(u);for(var c=0;c",B="",O=L.length,G=B.length,W=P[0]===x||P[0]===C,X=0,Z=-G;X>-1&&(X=z.indexOf(L,X),!(X===-1||(Z=z.indexOf(B,X+O),Z===-1)||Z<=X));){for(var J=X;J=Z)I[J]=null,z=z.substr(0,J)+" "+z.substr(J+1);else if(I[J]!==null){var N=I[J].indexOf(P[0]);N===-1?I[J]+=P:W&&(I[J]=I[J].substr(0,N+1)+(1+parseInt(I[J][N+1]))+I[J].substr(N+2))}var H=X+O,$=z.substr(H,Z-H),U=$.indexOf(L);U!==-1?X=U:X=Z+G}return I}function A(R,P,z){for(var I=P.textAlign||"start",L=P.textBaseline||"alphabetic",B=[1<<30,1<<30],O=[0,0],G=R.length,W=0;W/g,` +`)&&I!=="\\"?(Y(L.join("")),P=p,D):(L.push(z),I=z,D+1)}function ce(){return le()}function pe(){return z==="/"&&I==="*"?(L.push(z),Y(L.join("")),P=p,D+1):(L.push(z),I=z,D+1)}function xe(){if(I==="."&&/\d/.test(z))return P=S,D;if(I==="/"&&z==="*")return P=m,D;if(I==="/"&&z==="/")return P=y,D;if(z==="."&&L.length){for(;ye(L););return P=S,D}if(z===";"||z===")"||z==="("){if(L.length)for(;ye(L););return Y(z),P=p,D+1}var Q=L.length===2&&z!=="=";if(/[\w_\d\s]/.test(z)||Q){for(;ye(L););return P=p,D}return L.push(z),I=z,D+1}function ye(Q){var ue=0,ge,Me;do{if(ge=c.indexOf(Q.slice(0,Q.length+ue).join("")),Me=c[ge],ge===-1){if(ue--+Q.length>0)continue;Me=Q.slice(0,1).join("")}return Y(Me),Z+=Me.length,L=L.slice(Me.length),L.length}while(!0)}function fe(){return/[^a-fA-F0-9]/.test(z)?(Y(L.join("")),P=p,D):(L.push(z),I=z,D+1)}function ae(){return z==="."||/[eE]/.test(z)?(L.push(z),P=S,I=z,D+1):z==="x"&&L.length===1&&L[0]==="0"?(P=b,L.push(z),I=z,D+1):/[^\d]/.test(z)?(Y(L.join("")),P=p,D):(L.push(z),I=z,D+1)}function ee(){return z==="f"&&(L.push(z),I=z,D+=1),/[eE]/.test(z)||(z==="-"||z==="+")&&/[eE]/.test(I)?(L.push(z),I=z,D+1):/[^\d]/.test(z)?(Y(L.join("")),P=p,D):(L.push(z),I=z,D+1)}function ie(){if(/[^\d\w_]/.test(z)){var Q=L.join("");return q[Q]?P=w:j[Q]?P=C:P=M,Y(L.join("")),P=p,D}return L.push(z),I=z,D+1}}},3508(s,l,n){var u=n(6852);u=u.slice().filter(function(c){return!/^(gl\_|texture)/.test(c)}),s.exports=u.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852(s){s.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932(s,l,n){var u=n(620);s.exports=u.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620(s){s.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827(s){s.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905(s,l,n){var u=n(5874);s.exports=c;function c(f,h){var d=u(h),p=[];return p=p.concat(d(f)),p=p.concat(d(null)),p}},3236(s){s.exports=function(l){typeof l=="string"&&(l=[l]);for(var n=[].slice.call(arguments,1),u=[],c=0;c>1,_=-7,v=c?h-1:0,x=c?-1:1,S=n[u+v];for(v+=x,d=S&(1<<-_)-1,S>>=-_,_+=g;_>0;d=d*256+n[u+v],v+=x,_-=8);for(p=d&(1<<-_)-1,d>>=-_,_+=f;_>0;p=p*256+n[u+v],v+=x,_-=8);if(d===0)d=1-y;else{if(d===m)return p?NaN:(S?-1:1)*(1/0);p=p+Math.pow(2,f),d=d-y}return(S?-1:1)*p*Math.pow(2,d-f)},l.write=function(n,u,c,f,h,d){var p,g,m,y=d*8-h-1,_=(1<>1,x=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=f?0:d-1,M=f?1:-1,C=u<0||u===0&&1/u<0?1:0;for(u=Math.abs(u),isNaN(u)||u===1/0?(g=isNaN(u)?1:0,p=_):(p=Math.floor(Math.log(u)/Math.LN2),u*(m=Math.pow(2,-p))<1&&(p--,m*=2),p+v>=1?u+=x/m:u+=x*Math.pow(2,1-v),u*m>=2&&(p++,m/=2),p+v>=_?(g=0,p=_):p+v>=1?(g=(u*m-1)*Math.pow(2,h),p=p+v):(g=u*Math.pow(2,v-1)*Math.pow(2,h),p=0));h>=8;n[c+S]=g&255,S+=M,g/=256,h-=8);for(p=p<0;n[c+S]=p&255,S+=M,p/=256,y-=8);n[c+S-M]|=C*128}},8954(s,l,n){"use strict";s.exports=v;var u=n(3250),c=n(6803).Fw;function f(x,S,M){this.vertices=x,this.adjacent=S,this.boundary=M,this.lastVisited=-1}f.prototype.flip=function(){var x=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=x;var S=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=S};function h(x,S,M){this.vertices=x,this.cell=S,this.index=M}function d(x,S){return c(x.vertices,S.vertices)}function p(x){return function(){var S=this.tuple;return x.apply(this,S)}}function g(x){var S=u[x+1];return S||(S=u),p(S)}var m=[];function y(x,S,M){this.dimension=x,this.vertices=S,this.simplices=M,this.interior=M.filter(function(k){return!k.boundary}),this.tuple=new Array(x+1);for(var C=0;C<=x;++C)this.tuple[C]=this.vertices[C];var w=m[x];w||(w=m[x]=g(x)),this.orient=w}var _=y.prototype;_.handleBoundaryDegeneracy=function(x,S){var M=this.dimension,C=this.vertices.length-1,w=this.tuple,k=this.vertices,A=[x];for(x.lastVisited=-C;A.length>0;){x=A.pop();for(var b=x.adjacent,E=0;E<=M;++E){var T=b[E];if(!(!T.boundary||T.lastVisited<=-C)){for(var F=T.vertices,D=0;D<=M;++D){var R=F[D];R<0?w[D]=S:w[D]=k[R]}var P=this.orient();if(P>0)return T;T.lastVisited=-C,P===0&&A.push(T)}}}return null},_.walk=function(x,S){var M=this.vertices.length-1,C=this.dimension,w=this.vertices,k=this.tuple,A=S?this.interior.length*Math.random()|0:this.interior.length-1,b=this.interior[A];e:for(;!b.boundary;){for(var E=b.vertices,T=b.adjacent,F=0;F<=C;++F)k[F]=w[E[F]];b.lastVisited=M;for(var F=0;F<=C;++F){var D=T[F];if(!(D.lastVisited>=M)){var R=k[F];k[F]=x;var P=this.orient();if(k[F]=R,P<0){b=D;continue e}else D.boundary?D.lastVisited=-M:D.lastVisited=M}}return}return b},_.addPeaks=function(x,S){var M=this.vertices.length-1,C=this.dimension,w=this.vertices,k=this.tuple,A=this.interior,b=this.simplices,E=[S];S.lastVisited=M,S.vertices[S.vertices.indexOf(-1)]=M,S.boundary=!1,A.push(S);for(var T=[];E.length>0;){var S=E.pop(),F=S.vertices,D=S.adjacent,R=F.indexOf(M);if(!(R<0)){for(var P=0;P<=C;++P)if(P!==R){var z=D[P];if(!(!z.boundary||z.lastVisited>=M)){var I=z.vertices;if(z.lastVisited!==-M){for(var L=0,B=0;B<=C;++B)I[B]<0?(L=B,k[B]=x):k[B]=w[I[B]];var O=this.orient();if(O>0){I[L]=M,z.boundary=!1,A.push(z),E.push(z),z.lastVisited=M;continue}else z.lastVisited=-M}var G=z.adjacent,W=F.slice(),X=D.slice(),Z=new f(W,X,!0);b.push(Z);var J=G.indexOf(S);if(!(J<0)){G[J]=Z,X[R]=z,W[P]=-1,X[P]=S,D[P]=Z,Z.flip();for(var B=0;B<=C;++B){var N=W[B];if(!(N<0||N===M)){for(var H=new Array(C-1),$=0,U=0;U<=C;++U){var V=W[U];V<0||U===B||(H[$++]=V)}T.push(new h(H,Z,B))}}}}}}}T.sort(d);for(var P=0;P+1=0?A[E++]=b[F]:T=F&1;if(T===(x&1)){var D=A[0];A[0]=A[1],A[1]=D}S.push(A)}}return S};function v(x,S){var M=x.length;if(M===0)throw new Error("Must have at least d+1 points");var C=x[0].length;if(M<=C)throw new Error("Must input at least d+1 points");var w=x.slice(0,C+1),k=u.apply(void 0,w);if(k===0)throw new Error("Input not in general position");for(var A=new Array(C+1),b=0;b<=C;++b)A[b]=b;k<0&&(A[0]=1,A[1]=0);for(var E=new f(A,new Array(C+1),!1),T=E.adjacent,F=new Array(C+2),b=0;b<=C;++b){for(var D=A.slice(),R=0;R<=C;++R)R===b&&(D[R]=-1);var P=D[0];D[0]=D[1],D[1]=P;var z=new f(D,new Array(C+1),!0);T[b]=z,F[b]=z}F[C+1]=E;for(var b=0;b<=C;++b)for(var D=T[b].vertices,I=T[b].adjacent,R=0;R<=C;++R){var L=D[R];if(L<0){I[R]=E;continue}for(var B=0;B<=C;++B)T[B].vertices.indexOf(L)<0&&(I[R]=T[B])}for(var O=new y(C,w,F),G=!!S,b=C+1;b3*(F+1)?y(this,T):this.left.insert(T):this.left=k([T]);else if(T[0]>this.mid)this.right?4*(this.right.count+1)>3*(F+1)?y(this,T):this.right.insert(T):this.right=k([T]);else{var D=u.ge(this.leftPoints,T,C),R=u.ge(this.rightPoints,T,w);this.leftPoints.splice(D,0,T),this.rightPoints.splice(R,0,T)}},p.remove=function(T){var F=this.count-this.leftPoints;if(T[1]3*(F-1))return _(this,T);var R=this.left.remove(T);return R===h?(this.left=null,this.count-=1,f):(R===f&&(this.count-=1),R)}else if(T[0]>this.mid){if(!this.right)return c;var P=this.left?this.left.count:0;if(4*P>3*(F-1))return _(this,T);var R=this.right.remove(T);return R===h?(this.right=null,this.count-=1,f):(R===f&&(this.count-=1),R)}else{if(this.count===1)return this.leftPoints[0]===T?h:c;if(this.leftPoints.length===1&&this.leftPoints[0]===T){if(this.left&&this.right){for(var z=this,I=this.left;I.right;)z=I,I=I.right;if(z===this)I.right=this.right;else{var L=this.left,R=this.right;z.count-=I.count,z.right=I.left,I.left=L,I.right=R}g(this,I),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?g(this,this.left):g(this,this.right);return f}for(var L=u.ge(this.leftPoints,T,C);L=0&&T[R][1]>=F;--R){var P=D(T[R]);if(P)return P}}function S(T,F){for(var D=0;Dthis.mid){if(this.right){var D=this.right.queryPoint(T,F);if(D)return D}return x(this.rightPoints,T,F)}else return S(this.leftPoints,F)},p.queryInterval=function(T,F,D){if(Tthis.mid&&this.right){var R=this.right.queryInterval(T,F,D);if(R)return R}return Fthis.mid?x(this.rightPoints,T,D):S(this.leftPoints,D)};function M(T,F){return T-F}function C(T,F){var D=T[0]-F[0];return D||T[1]-F[1]}function w(T,F){var D=T[1]-F[1];return D||T[0]-F[0]}function k(T){if(T.length===0)return null;for(var F=[],D=0;D>1],P=[],z=[],I=[],D=0;D1&&h.indexOf("Macintosh")!==-1&&h.indexOf("Safari")!==-1&&(d=!0),d}},5219(s){"use strict";s.exports=function(l){for(var n=l.length,u,c=0;c13)&&u!==32&&u!==133&&u!==160&&u!==5760&&u!==6158&&(u<8192||u>8205)&&u!==8232&&u!==8233&&u!==8239&&u!==8287&&u!==8288&&u!==12288&&u!==65279)return!1;return!0}},395(s){function l(n,u,c){return n*(1-c)+u*c}s.exports=l},2652(s,l,n){var u=n(4335),c=n(6864),f=n(1903),h=n(9921),d=n(7608),p=n(5665),g={length:n(1387),normalize:n(3536),dot:n(244),cross:n(5911)},m=c(),y=c(),_=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],x=[0,0,0];s.exports=function(k,A,b,E,T,F){if(A||(A=[0,0,0]),b||(b=[0,0,0]),E||(E=[0,0,0]),T||(T=[0,0,0,1]),F||(F=[0,0,0,1]),!u(m,k)||(f(y,m),y[3]=0,y[7]=0,y[11]=0,y[15]=1,Math.abs(h(y)<1e-8)))return!1;var D=m[3],R=m[7],P=m[11],z=m[12],I=m[13],L=m[14],B=m[15];if(D!==0||R!==0||P!==0){_[0]=D,_[1]=R,_[2]=P,_[3]=B;var O=d(y,y);if(!O)return!1;p(y,y),S(T,_,y)}else T[0]=T[1]=T[2]=0,T[3]=1;if(A[0]=z,A[1]=I,A[2]=L,M(v,m),b[0]=g.length(v[0]),g.normalize(v[0],v[0]),E[0]=g.dot(v[0],v[1]),C(v[1],v[1],v[0],1,-E[0]),b[1]=g.length(v[1]),g.normalize(v[1],v[1]),E[0]/=b[1],E[1]=g.dot(v[0],v[2]),C(v[2],v[2],v[0],1,-E[1]),E[2]=g.dot(v[1],v[2]),C(v[2],v[2],v[1],1,-E[2]),b[2]=g.length(v[2]),g.normalize(v[2],v[2]),E[1]/=b[2],E[2]/=b[2],g.cross(x,v[1],v[2]),g.dot(v[0],x)<0)for(var G=0;G<3;G++)b[G]*=-1,v[G][0]*=-1,v[G][1]*=-1,v[G][2]*=-1;return F[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),F[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),F[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),F[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(F[0]=-F[0]),v[0][2]>v[2][0]&&(F[1]=-F[1]),v[1][0]>v[0][1]&&(F[2]=-F[2]),!0};function S(w,k,A){var b=k[0],E=k[1],T=k[2],F=k[3];return w[0]=A[0]*b+A[4]*E+A[8]*T+A[12]*F,w[1]=A[1]*b+A[5]*E+A[9]*T+A[13]*F,w[2]=A[2]*b+A[6]*E+A[10]*T+A[14]*F,w[3]=A[3]*b+A[7]*E+A[11]*T+A[15]*F,w}function M(w,k){w[0][0]=k[0],w[0][1]=k[1],w[0][2]=k[2],w[1][0]=k[4],w[1][1]=k[5],w[1][2]=k[6],w[2][0]=k[8],w[2][1]=k[9],w[2][2]=k[10]}function C(w,k,A,b,E){w[0]=k[0]*b+A[0]*E,w[1]=k[1]*b+A[1]*E,w[2]=k[2]*b+A[2]*E}},4335(s){s.exports=function(n,u){var c=u[15];if(c===0)return!1;for(var f=1/c,h=0;h<16;h++)n[h]=u[h]*f;return!0}},7442(s,l,n){var u=n(6658),c=n(7182),f=n(2652),h=n(9921),d=n(8648),p=_(),g=_(),m=_();s.exports=y;function y(S,M,C,w){if(h(M)===0||h(C)===0)return!1;var k=f(M,p.translate,p.scale,p.skew,p.perspective,p.quaternion),A=f(C,g.translate,g.scale,g.skew,g.perspective,g.quaternion);return!k||!A?!1:(u(m.translate,p.translate,g.translate,w),u(m.skew,p.skew,g.skew,w),u(m.scale,p.scale,g.scale,w),u(m.perspective,p.perspective,g.perspective,w),d(m.quaternion,p.quaternion,g.quaternion,w),c(S,m.translate,m.scale,m.skew,m.perspective,m.quaternion),!0)}function _(){return{translate:v(),scale:v(1),skew:v(),perspective:x(),quaternion:x()}}function v(S){return[S||0,S||0,S||0]}function x(){return[0,0,0,1]}},7182(s,l,n){var u={identity:n(7894),translate:n(7656),multiply:n(6760),create:n(6864),scale:n(2504),fromRotationTranslation:n(6743)},c=u.create(),f=u.create();s.exports=function(d,p,g,m,y,_){return u.identity(d),u.fromRotationTranslation(d,_,p),d[3]=y[0],d[7]=y[1],d[11]=y[2],d[15]=y[3],u.identity(f),m[2]!==0&&(f[9]=m[2],u.multiply(d,d,f)),m[1]!==0&&(f[9]=0,f[8]=m[1],u.multiply(d,d,f)),m[0]!==0&&(f[8]=0,f[4]=m[0],u.multiply(d,d,f)),u.scale(d,d,g),d}},1811(s,l,n){"use strict";var u=n(2478),c=n(7442),f=n(7608),h=n(5567),d=n(2408),p=n(7089),g=n(6582),m=n(7656),y=n(2504),_=n(3536),v=[0,0,0];s.exports=C;function x(w){this._components=w.slice(),this._time=[0],this.prevMatrix=w.slice(),this.nextMatrix=w.slice(),this.computedMatrix=w.slice(),this.computedInverse=w.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}var S=x.prototype;S.recalcMatrix=function(w){var k=this._time,A=u.le(k,w),b=this.computedMatrix;if(!(A<0)){var E=this._components;if(A===k.length-1)for(var T=16*A,F=0;F<16;++F)b[F]=E[T++];else{for(var D=k[A+1]-k[A],T=16*A,R=this.prevMatrix,P=!0,F=0;F<16;++F)R[F]=E[T++];for(var z=this.nextMatrix,F=0;F<16;++F)z[F]=E[T++],P=P&&R[F]===z[F];if(D<1e-6||P)for(var F=0;F<16;++F)b[F]=R[F];else c(b,R,z,(w-k[A])/D)}var I=this.computedUp;I[0]=b[1],I[1]=b[5],I[2]=b[9],_(I,I);var L=this.computedInverse;f(L,b);var B=this.computedEye,O=L[15];B[0]=L[12]/O,B[1]=L[13]/O,B[2]=L[14]/O;for(var G=this.computedCenter,W=Math.exp(this.computedRadius[0]),F=0;F<3;++F)G[F]=B[F]-b[2+4*F]*W}},S.idle=function(w){if(!(w1&&u(f[g[v-2]],f[g[v-1]],_)<=0;)v-=1,g.pop();for(g.push(y),v=m.length;v>1&&u(f[m[v-2]],f[m[v-1]],_)>=0;)v-=1,m.pop();m.push(y)}for(var x=new Array(m.length+g.length-2),S=0,d=0,M=g.length;d0;--C)x[S++]=m[C];return x}},351(s,l,n){"use strict";s.exports=c;var u=n(4687);function c(f,h){h||(h=f,f=window);var d=0,p=0,g=0,m={shift:!1,alt:!1,control:!1,meta:!1},y=!1;function _(T){var F=!1;return"altKey"in T&&(F=F||T.altKey!==m.alt,m.alt=!!T.altKey),"shiftKey"in T&&(F=F||T.shiftKey!==m.shift,m.shift=!!T.shiftKey),"ctrlKey"in T&&(F=F||T.ctrlKey!==m.control,m.control=!!T.ctrlKey),"metaKey"in T&&(F=F||T.metaKey!==m.meta,m.meta=!!T.metaKey),F}function v(T,F){var D=u.x(F),R=u.y(F);"buttons"in F&&(T=F.buttons|0),(T!==d||D!==p||R!==g||_(F))&&(d=T|0,p=D||0,g=R||0,h&&h(d,p,g,m))}function x(T){v(0,T)}function S(){(d||p||g||m.shift||m.alt||m.meta||m.control)&&(p=g=0,d=0,m.shift=m.alt=m.control=m.meta=!1,h&&h(0,0,0,m))}function M(T){_(T)&&h&&h(d,p,g,m)}function C(T){u.buttons(T)===0?v(0,T):v(d,T)}function w(T){v(d|u.buttons(T),T)}function k(T){v(d&~u.buttons(T),T)}function A(){y||(y=!0,f.addEventListener("mousemove",C),f.addEventListener("mousedown",w),f.addEventListener("mouseup",k),f.addEventListener("mouseleave",x),f.addEventListener("mouseenter",x),f.addEventListener("mouseout",x),f.addEventListener("mouseover",x),f.addEventListener("blur",S),f.addEventListener("keyup",M),f.addEventListener("keydown",M),f.addEventListener("keypress",M),f!==window&&(window.addEventListener("blur",S),window.addEventListener("keyup",M),window.addEventListener("keydown",M),window.addEventListener("keypress",M)))}function b(){y&&(y=!1,f.removeEventListener("mousemove",C),f.removeEventListener("mousedown",w),f.removeEventListener("mouseup",k),f.removeEventListener("mouseleave",x),f.removeEventListener("mouseenter",x),f.removeEventListener("mouseout",x),f.removeEventListener("mouseover",x),f.removeEventListener("blur",S),f.removeEventListener("keyup",M),f.removeEventListener("keydown",M),f.removeEventListener("keypress",M),f!==window&&(window.removeEventListener("blur",S),window.removeEventListener("keyup",M),window.removeEventListener("keydown",M),window.removeEventListener("keypress",M)))}A();var E={element:f};return Object.defineProperties(E,{enabled:{get:function(){return y},set:function(T){T?A():b()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return g},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),E}},24(s){var l={left:0,top:0};s.exports=n;function n(c,f,h){f=f||c.currentTarget||c.srcElement,Array.isArray(h)||(h=[0,0]);var d=c.clientX||0,p=c.clientY||0,g=u(f);return h[0]=d-g.left,h[1]=p-g.top,h}function u(c){return c===window||c===document||c===document.body?l:c.getBoundingClientRect()}},4687(s,l){"use strict";function n(h){if(typeof h=="object"){if("buttons"in h)return h.buttons;if("which"in h){var d=h.which;if(d===2)return 4;if(d===3)return 2;if(d>0)return 1<=0)return 1<0){if(X=1,N[$++]=m(A[F],S,M,C),F+=O,w>0)for(W=1,D=A[F],U=N[$]=m(D,S,M,C),q=N[$+V],te=N[$+Y],le=N[$+ne],(U!==q||U!==te||U!==le)&&(P=A[F+R],I=A[F+z],B=A[F+L],p(W,X,D,P,I,B,U,q,te,le,S,M,C),ce=H[$]=Z++),$+=1,F+=O,W=2;W0)for(W=1,D=A[F],U=N[$]=m(D,S,M,C),q=N[$+V],te=N[$+Y],le=N[$+ne],(U!==q||U!==te||U!==le)&&(P=A[F+R],I=A[F+z],B=A[F+L],p(W,X,D,P,I,B,U,q,te,le,S,M,C),ce=H[$]=Z++,le!==te&&g(H[$+Y],ce,I,B,te,le,S,M,C)),$+=1,F+=O,W=2;W0){if(W=1,N[$++]=m(A[F],S,M,C),F+=O,k>0)for(X=1,D=A[F],U=N[$]=m(D,S,M,C),te=N[$+Y],q=N[$+V],le=N[$+ne],(U!==te||U!==q||U!==le)&&(P=A[F+R],I=A[F+z],B=A[F+L],p(W,X,D,P,I,B,U,te,q,le,S,M,C),ce=H[$]=Z++),$+=1,F+=O,X=2;X0)for(X=1,D=A[F],U=N[$]=m(D,S,M,C),te=N[$+Y],q=N[$+V],le=N[$+ne],(U!==te||U!==q||U!==le)&&(P=A[F+R],I=A[F+z],B=A[F+L],p(W,X,D,P,I,B,U,te,q,le,S,M,C),ce=H[$]=Z++,le!==te&&g(H[$+Y],ce,B,P,le,te,S,M,C)),$+=1,F+=O,X=2;X 0"),typeof d.vertex!="function"&&p("Must specify vertex creation function"),typeof d.cell!="function"&&p("Must specify cell creation function"),typeof d.phase!="function"&&p("Must specify phase function");for(var _=d.getters||[],v=new Array(m),x=0;x=0?v[x]=!0:v[x]=!1;return f(d.vertex,d.cell,d.phase,y,g,v)}},6199(s,l,n){"use strict";var u=n(1338),c={zero:function(C,w,k,A){var b=C[0],E=k[0];A|=0;var T=0,F=E;for(T=0;T2&&T[1]>2&&A(E.pick(-1,-1).lo(1,1).hi(T[0]-2,T[1]-2),b.pick(-1,-1,0).lo(1,1).hi(T[0]-2,T[1]-2),b.pick(-1,-1,1).lo(1,1).hi(T[0]-2,T[1]-2)),T[1]>2&&(k(E.pick(0,-1).lo(1).hi(T[1]-2),b.pick(0,-1,1).lo(1).hi(T[1]-2)),w(b.pick(0,-1,0).lo(1).hi(T[1]-2))),T[1]>2&&(k(E.pick(T[0]-1,-1).lo(1).hi(T[1]-2),b.pick(T[0]-1,-1,1).lo(1).hi(T[1]-2)),w(b.pick(T[0]-1,-1,0).lo(1).hi(T[1]-2))),T[0]>2&&(k(E.pick(-1,0).lo(1).hi(T[0]-2),b.pick(-1,0,0).lo(1).hi(T[0]-2)),w(b.pick(-1,0,1).lo(1).hi(T[0]-2))),T[0]>2&&(k(E.pick(-1,T[1]-1).lo(1).hi(T[0]-2),b.pick(-1,T[1]-1,0).lo(1).hi(T[0]-2)),w(b.pick(-1,T[1]-1,1).lo(1).hi(T[0]-2))),b.set(0,0,0,0),b.set(0,0,1,0),b.set(T[0]-1,0,0,0),b.set(T[0]-1,0,1,0),b.set(0,T[1]-1,0,0),b.set(0,T[1]-1,1,0),b.set(T[0]-1,T[1]-1,0,0),b.set(T[0]-1,T[1]-1,1,0),b}}function M(C){var w=C.join(),T=m[w];if(T)return T;for(var k=C.length,A=[_,v],b=1;b<=k;++b)A.push(x(b));var E=S,T=E.apply(void 0,A);return m[w]=T,T}s.exports=function(w,k,A){if(Array.isArray(A)||(typeof A=="string"?A=u(k.dimension,A):A=u(k.dimension,"clamp")),k.size===0)return w;if(k.dimension===0)return w.set(0),w;var b=M(A);return b(w,k)}},4317(s){"use strict";function l(h,d){var p=Math.floor(d),g=d-p,m=0<=p&&p0;){I<64?(w=I,I=0):(w=64,I-=64);for(var L=m[1]|0;L>0;){L<64?(k=L,L=0):(k=64,L-=64),v=P+I*b+L*E,M=z+I*F+L*D;var B=0,O=0,G=0,W=T,X=b-A*T,Z=E-w*b,J=R,N=F-A*R,H=D-w*F;for(G=0;G0;){D<64?(w=D,D=0):(w=64,D-=64);for(var R=m[0]|0;R>0;){R<64?(C=R,R=0):(C=64,R-=64),v=T+D*A+R*k,M=F+D*E+R*b;var P=0,z=0,I=A,L=k-w*A,B=E,O=b-w*E;for(z=0;z0;){z<64?(k=z,z=0):(k=64,z-=64);for(var I=m[0]|0;I>0;){I<64?(C=I,I=0):(C=64,I-=64);for(var L=m[1]|0;L>0;){L<64?(w=L,L=0):(w=64,L-=64),v=R+z*E+I*A+L*b,M=P+z*D+I*T+L*F;var B=0,O=0,G=0,W=E,X=A-k*E,Z=b-C*A,J=D,N=T-k*D,H=F-C*T;for(G=0;Gx;){B=0,O=P-w;t:for(I=0;IW)break t;O+=T,B+=F}for(B=P,O=P-w,I=0;I>1,L=I-R,B=I+R,O=P,G=L,W=I,X=B,Z=z,J=S+1,N=M-1,H=!0,$,U,V,j,q,Y,K,te,ne,se=0,le=0,ce=0,pe,xe,ye,fe,ae,ee,ie,Q,ue,ge,Me,Te,je,Ve,Ke,Je,vt=E,xt=_(vt),Pt=_(vt);xe=k*O,ye=k*G,Je=w;e:for(pe=0;pe0){U=O,O=G,G=U;break e}if(ce<0)break e;Je+=F}xe=k*X,ye=k*Z,Je=w;e:for(pe=0;pe0){U=X,X=Z,Z=U;break e}if(ce<0)break e;Je+=F}xe=k*O,ye=k*W,Je=w;e:for(pe=0;pe0){U=O,O=W,W=U;break e}if(ce<0)break e;Je+=F}xe=k*G,ye=k*W,Je=w;e:for(pe=0;pe0){U=G,G=W,W=U;break e}if(ce<0)break e;Je+=F}xe=k*O,ye=k*X,Je=w;e:for(pe=0;pe0){U=O,O=X,X=U;break e}if(ce<0)break e;Je+=F}xe=k*W,ye=k*X,Je=w;e:for(pe=0;pe0){U=W,W=X,X=U;break e}if(ce<0)break e;Je+=F}xe=k*G,ye=k*Z,Je=w;e:for(pe=0;pe0){U=G,G=Z,Z=U;break e}if(ce<0)break e;Je+=F}xe=k*G,ye=k*W,Je=w;e:for(pe=0;pe0){U=G,G=W,W=U;break e}if(ce<0)break e;Je+=F}xe=k*X,ye=k*Z,Je=w;e:for(pe=0;pe0){U=X,X=Z,Z=U;break e}if(ce<0)break e;Je+=F}for(xe=k*O,ye=k*G,fe=k*W,ae=k*X,ee=k*Z,ie=k*P,Q=k*I,ue=k*z,Ke=0,Je=w,pe=0;pe0)N--;else if(ce<0){for(xe=k*Y,ye=k*J,fe=k*N,Je=w,pe=0;pe0)for(;;){K=w+N*k,Ke=0;e:for(pe=0;pe0){if(--Nz){e:for(;;){for(K=w+J*k,Ke=0,Je=w,pe=0;pe1&&x?M(v,x[0],x[1]):M(v)}var g={"uint32,1,0":function(y,_){return function(v){var x=v.data,S=v.offset|0,M=v.shape,C=v.stride,w=C[0]|0,k=M[0]|0,A=C[1]|0,b=M[1]|0,E=A,T=A,F=1;k<=32?y(0,k-1,x,S,w,A,k,b,E,T,F):_(0,k-1,x,S,w,A,k,b,E,T,F)}}};function m(y,_){var v=[_,y].join(","),x=g[v],S=h(y,_),M=p(y,_,S);return x(S,M)}s.exports=m},446(s,l,n){"use strict";var u=n(7640),c={};function f(h){var d=h.order,p=h.dtype,g=[d,p],m=g.join(":"),y=c[m];return y||(c[m]=y=u(d,p)),y(h),h}s.exports=f},9618(s,l,n){var u=n(7163),c=typeof Float64Array<"u";function f(_,v){return _[0]-v[0]}function h(){var _=this.stride,v=new Array(_.length),x;for(x=0;x=0&&(A=w|0,k+=E*A,b-=A),new S(this.data,b,E,k)},M.step=function(w){var k=this.shape[0],A=this.stride[0],b=this.offset,E=0,T=Math.ceil;return typeof w=="number"&&(E=w|0,E<0?(b+=A*(k-1),k=T(-k/E)):k=T(k/E),A*=E),new S(this.data,k,A,b)},M.transpose=function(w){w=w===void 0?0:w|0;var k=this.shape,A=this.stride;return new S(this.data,k[w],A[w],this.offset)},M.pick=function(w){var k=[],A=[],b=this.offset;typeof w=="number"&&w>=0?b=b+this.stride[0]*w|0:(k.push(this.shape[0]),A.push(this.stride[0]));var E=v[k.length+1];return E(this.data,k,A,b)},function(w,k,A,b){return new S(w,k[0],A[0],b)}},2:function(_,v,x){function S(C,w,k,A,b,E){this.data=C,this.shape=[w,k],this.stride=[A,b],this.offset=E|0}var M=S.prototype;return M.dtype=_,M.dimension=2,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(M,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),M.set=function(w,k,A){return _==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*k,A):this.data[this.offset+this.stride[0]*w+this.stride[1]*k]=A},M.get=function(w,k){return _==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*k):this.data[this.offset+this.stride[0]*w+this.stride[1]*k]},M.index=function(w,k){return this.offset+this.stride[0]*w+this.stride[1]*k},M.hi=function(w,k){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof k!="number"||k<0?this.shape[1]:k|0,this.stride[0],this.stride[1],this.offset)},M.lo=function(w,k){var A=this.offset,b=0,E=this.shape[0],T=this.shape[1],F=this.stride[0],D=this.stride[1];return typeof w=="number"&&w>=0&&(b=w|0,A+=F*b,E-=b),typeof k=="number"&&k>=0&&(b=k|0,A+=D*b,T-=b),new S(this.data,E,T,F,D,A)},M.step=function(w,k){var A=this.shape[0],b=this.shape[1],E=this.stride[0],T=this.stride[1],F=this.offset,D=0,R=Math.ceil;return typeof w=="number"&&(D=w|0,D<0?(F+=E*(A-1),A=R(-A/D)):A=R(A/D),E*=D),typeof k=="number"&&(D=k|0,D<0?(F+=T*(b-1),b=R(-b/D)):b=R(b/D),T*=D),new S(this.data,A,b,E,T,F)},M.transpose=function(w,k){w=w===void 0?0:w|0,k=k===void 0?1:k|0;var A=this.shape,b=this.stride;return new S(this.data,A[w],A[k],b[w],b[k],this.offset)},M.pick=function(w,k){var A=[],b=[],E=this.offset;typeof w=="number"&&w>=0?E=E+this.stride[0]*w|0:(A.push(this.shape[0]),b.push(this.stride[0])),typeof k=="number"&&k>=0?E=E+this.stride[1]*k|0:(A.push(this.shape[1]),b.push(this.stride[1]));var T=v[A.length+1];return T(this.data,A,b,E)},function(w,k,A,b){return new S(w,k[0],k[1],A[0],A[1],b)}},3:function(_,v,x){function S(C,w,k,A,b,E,T,F){this.data=C,this.shape=[w,k,A],this.stride=[b,E,T],this.offset=F|0}var M=S.prototype;return M.dtype=_,M.dimension=3,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(M,"order",{get:function(){var w=Math.abs(this.stride[0]),k=Math.abs(this.stride[1]),A=Math.abs(this.stride[2]);return w>k?k>A?[2,1,0]:w>A?[1,2,0]:[1,0,2]:w>A?[2,0,1]:A>k?[0,1,2]:[0,2,1]}}),M.set=function(w,k,A,b){return _==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A,b):this.data[this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A]=b},M.get=function(w,k,A){return _==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A):this.data[this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A]},M.index=function(w,k,A){return this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A},M.hi=function(w,k,A){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof k!="number"||k<0?this.shape[1]:k|0,typeof A!="number"||A<0?this.shape[2]:A|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},M.lo=function(w,k,A){var b=this.offset,E=0,T=this.shape[0],F=this.shape[1],D=this.shape[2],R=this.stride[0],P=this.stride[1],z=this.stride[2];return typeof w=="number"&&w>=0&&(E=w|0,b+=R*E,T-=E),typeof k=="number"&&k>=0&&(E=k|0,b+=P*E,F-=E),typeof A=="number"&&A>=0&&(E=A|0,b+=z*E,D-=E),new S(this.data,T,F,D,R,P,z,b)},M.step=function(w,k,A){var b=this.shape[0],E=this.shape[1],T=this.shape[2],F=this.stride[0],D=this.stride[1],R=this.stride[2],P=this.offset,z=0,I=Math.ceil;return typeof w=="number"&&(z=w|0,z<0?(P+=F*(b-1),b=I(-b/z)):b=I(b/z),F*=z),typeof k=="number"&&(z=k|0,z<0?(P+=D*(E-1),E=I(-E/z)):E=I(E/z),D*=z),typeof A=="number"&&(z=A|0,z<0?(P+=R*(T-1),T=I(-T/z)):T=I(T/z),R*=z),new S(this.data,b,E,T,F,D,R,P)},M.transpose=function(w,k,A){w=w===void 0?0:w|0,k=k===void 0?1:k|0,A=A===void 0?2:A|0;var b=this.shape,E=this.stride;return new S(this.data,b[w],b[k],b[A],E[w],E[k],E[A],this.offset)},M.pick=function(w,k,A){var b=[],E=[],T=this.offset;typeof w=="number"&&w>=0?T=T+this.stride[0]*w|0:(b.push(this.shape[0]),E.push(this.stride[0])),typeof k=="number"&&k>=0?T=T+this.stride[1]*k|0:(b.push(this.shape[1]),E.push(this.stride[1])),typeof A=="number"&&A>=0?T=T+this.stride[2]*A|0:(b.push(this.shape[2]),E.push(this.stride[2]));var F=v[b.length+1];return F(this.data,b,E,T)},function(w,k,A,b){return new S(w,k[0],k[1],k[2],A[0],A[1],A[2],b)}},4:function(_,v,x){function S(C,w,k,A,b,E,T,F,D,R){this.data=C,this.shape=[w,k,A,b],this.stride=[E,T,F,D],this.offset=R|0}var M=S.prototype;return M.dtype=_,M.dimension=4,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(M,"order",{get:x}),M.set=function(w,k,A,b,E){return _==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b,E):this.data[this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b]=E},M.get=function(w,k,A,b){return _==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b):this.data[this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b]},M.index=function(w,k,A,b){return this.offset+this.stride[0]*w+this.stride[1]*k+this.stride[2]*A+this.stride[3]*b},M.hi=function(w,k,A,b){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof k!="number"||k<0?this.shape[1]:k|0,typeof A!="number"||A<0?this.shape[2]:A|0,typeof b!="number"||b<0?this.shape[3]:b|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},M.lo=function(w,k,A,b){var E=this.offset,T=0,F=this.shape[0],D=this.shape[1],R=this.shape[2],P=this.shape[3],z=this.stride[0],I=this.stride[1],L=this.stride[2],B=this.stride[3];return typeof w=="number"&&w>=0&&(T=w|0,E+=z*T,F-=T),typeof k=="number"&&k>=0&&(T=k|0,E+=I*T,D-=T),typeof A=="number"&&A>=0&&(T=A|0,E+=L*T,R-=T),typeof b=="number"&&b>=0&&(T=b|0,E+=B*T,P-=T),new S(this.data,F,D,R,P,z,I,L,B,E)},M.step=function(w,k,A,b){var E=this.shape[0],T=this.shape[1],F=this.shape[2],D=this.shape[3],R=this.stride[0],P=this.stride[1],z=this.stride[2],I=this.stride[3],L=this.offset,B=0,O=Math.ceil;return typeof w=="number"&&(B=w|0,B<0?(L+=R*(E-1),E=O(-E/B)):E=O(E/B),R*=B),typeof k=="number"&&(B=k|0,B<0?(L+=P*(T-1),T=O(-T/B)):T=O(T/B),P*=B),typeof A=="number"&&(B=A|0,B<0?(L+=z*(F-1),F=O(-F/B)):F=O(F/B),z*=B),typeof b=="number"&&(B=b|0,B<0?(L+=I*(D-1),D=O(-D/B)):D=O(D/B),I*=B),new S(this.data,E,T,F,D,R,P,z,I,L)},M.transpose=function(w,k,A,b){w=w===void 0?0:w|0,k=k===void 0?1:k|0,A=A===void 0?2:A|0,b=b===void 0?3:b|0;var E=this.shape,T=this.stride;return new S(this.data,E[w],E[k],E[A],E[b],T[w],T[k],T[A],T[b],this.offset)},M.pick=function(w,k,A,b){var E=[],T=[],F=this.offset;typeof w=="number"&&w>=0?F=F+this.stride[0]*w|0:(E.push(this.shape[0]),T.push(this.stride[0])),typeof k=="number"&&k>=0?F=F+this.stride[1]*k|0:(E.push(this.shape[1]),T.push(this.stride[1])),typeof A=="number"&&A>=0?F=F+this.stride[2]*A|0:(E.push(this.shape[2]),T.push(this.stride[2])),typeof b=="number"&&b>=0?F=F+this.stride[3]*b|0:(E.push(this.shape[3]),T.push(this.stride[3]));var D=v[E.length+1];return D(this.data,E,T,F)},function(w,k,A,b){return new S(w,k[0],k[1],k[2],k[3],A[0],A[1],A[2],A[3],b)}},5:function(v,x,S){function M(w,k,A,b,E,T,F,D,R,P,z,I){this.data=w,this.shape=[k,A,b,E,T],this.stride=[F,D,R,P,z],this.offset=I|0}var C=M.prototype;return C.dtype=v,C.dimension=5,Object.defineProperty(C,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(C,"order",{get:S}),C.set=function(k,A,b,E,T,F){return v==="generic"?this.data.set(this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T,F):this.data[this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T]=F},C.get=function(k,A,b,E,T){return v==="generic"?this.data.get(this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T):this.data[this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T]},C.index=function(k,A,b,E,T){return this.offset+this.stride[0]*k+this.stride[1]*A+this.stride[2]*b+this.stride[3]*E+this.stride[4]*T},C.hi=function(k,A,b,E,T){return new M(this.data,typeof k!="number"||k<0?this.shape[0]:k|0,typeof A!="number"||A<0?this.shape[1]:A|0,typeof b!="number"||b<0?this.shape[2]:b|0,typeof E!="number"||E<0?this.shape[3]:E|0,typeof T!="number"||T<0?this.shape[4]:T|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},C.lo=function(k,A,b,E,T){var F=this.offset,D=0,R=this.shape[0],P=this.shape[1],z=this.shape[2],I=this.shape[3],L=this.shape[4],B=this.stride[0],O=this.stride[1],G=this.stride[2],W=this.stride[3],X=this.stride[4];return typeof k=="number"&&k>=0&&(D=k|0,F+=B*D,R-=D),typeof A=="number"&&A>=0&&(D=A|0,F+=O*D,P-=D),typeof b=="number"&&b>=0&&(D=b|0,F+=G*D,z-=D),typeof E=="number"&&E>=0&&(D=E|0,F+=W*D,I-=D),typeof T=="number"&&T>=0&&(D=T|0,F+=X*D,L-=D),new M(this.data,R,P,z,I,L,B,O,G,W,X,F)},C.step=function(k,A,b,E,T){var F=this.shape[0],D=this.shape[1],R=this.shape[2],P=this.shape[3],z=this.shape[4],I=this.stride[0],L=this.stride[1],B=this.stride[2],O=this.stride[3],G=this.stride[4],W=this.offset,X=0,Z=Math.ceil;return typeof k=="number"&&(X=k|0,X<0?(W+=I*(F-1),F=Z(-F/X)):F=Z(F/X),I*=X),typeof A=="number"&&(X=A|0,X<0?(W+=L*(D-1),D=Z(-D/X)):D=Z(D/X),L*=X),typeof b=="number"&&(X=b|0,X<0?(W+=B*(R-1),R=Z(-R/X)):R=Z(R/X),B*=X),typeof E=="number"&&(X=E|0,X<0?(W+=O*(P-1),P=Z(-P/X)):P=Z(P/X),O*=X),typeof T=="number"&&(X=T|0,X<0?(W+=G*(z-1),z=Z(-z/X)):z=Z(z/X),G*=X),new M(this.data,F,D,R,P,z,I,L,B,O,G,W)},C.transpose=function(k,A,b,E,T){k=k===void 0?0:k|0,A=A===void 0?1:A|0,b=b===void 0?2:b|0,E=E===void 0?3:E|0,T=T===void 0?4:T|0;var F=this.shape,D=this.stride;return new M(this.data,F[k],F[A],F[b],F[E],F[T],D[k],D[A],D[b],D[E],D[T],this.offset)},C.pick=function(k,A,b,E,T){var F=[],D=[],R=this.offset;typeof k=="number"&&k>=0?R=R+this.stride[0]*k|0:(F.push(this.shape[0]),D.push(this.stride[0])),typeof A=="number"&&A>=0?R=R+this.stride[1]*A|0:(F.push(this.shape[1]),D.push(this.stride[1])),typeof b=="number"&&b>=0?R=R+this.stride[2]*b|0:(F.push(this.shape[2]),D.push(this.stride[2])),typeof E=="number"&&E>=0?R=R+this.stride[3]*E|0:(F.push(this.shape[3]),D.push(this.stride[3])),typeof T=="number"&&T>=0?R=R+this.stride[4]*T|0:(F.push(this.shape[4]),D.push(this.stride[4]));var P=x[F.length+1];return P(this.data,F,D,R)},function(k,A,b,E){return new M(k,A[0],A[1],A[2],A[3],A[4],b[0],b[1],b[2],b[3],b[4],E)}}};function p(_,v){var x=v===-1?"T":String(v),S=d[x];return v===-1?S(_):v===0?S(_,m[_][0]):S(_,m[_],h)}function g(_){if(u(_))return"buffer";if(c)switch(Object.prototype.toString.call(_)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(_)?"array":"generic"}var m={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function y(_,v,x,S){if(_===void 0){var b=m.array[0];return b([])}else typeof _=="number"&&(_=[_]);v===void 0&&(v=[_.length]);var M=v.length;if(x===void 0){x=new Array(M);for(var C=M-1,w=1;C>=0;--C)x[C]=w,w*=v[C]}if(S===void 0){S=0;for(var C=0;C>>0;s.exports=h;function h(d,p){if(isNaN(d)||isNaN(p))return NaN;if(d===p)return d;if(d===0)return p<0?-c:c;var g=u.hi(d),m=u.lo(d);return p>d==d>0?m===f?(g+=1,m=0):m+=1:m===0?(m=f,g-=1):m-=1,u.pack(m,g)}},8406(s,l){var n=1e-6,u=1e-6;l.vertexNormals=function(c,f,h){for(var d=f.length,p=new Array(d),g=h===void 0?n:h,m=0;mg)for(var F=p[v],D=1/Math.sqrt(A*E),T=0;T<3;++T){var R=(T+1)%3,P=(T+2)%3;F[T]+=D*(b[R]*k[P]-b[P]*k[R])}}for(var m=0;mg)for(var D=1/Math.sqrt(z),T=0;T<3;++T)F[T]*=D;else for(var T=0;T<3;++T)F[T]=0}return p},l.faceNormals=function(c,f,h){for(var d=c.length,p=new Array(d),g=h===void 0?u:h,m=0;mg?C=1/Math.sqrt(C):C=0;for(var v=0;v<3;++v)M[v]*=C;p[m]=M}return p}},4081(s){"use strict";s.exports=l;function l(n,u,c,f,h,d,p,g,m,y){var _=u+d+y;if(v>0){var v=Math.sqrt(_+1);n[0]=.5*(p-m)/v,n[1]=.5*(g-f)/v,n[2]=.5*(c-d)/v,n[3]=.5*v}else{var x=Math.max(u,d,y),v=Math.sqrt(2*x-_+1);u>=x?(n[0]=.5*v,n[1]=.5*(h+c)/v,n[2]=.5*(g+f)/v,n[3]=.5*(p-m)/v):d>=x?(n[0]=.5*(c+h)/v,n[1]=.5*v,n[2]=.5*(m+p)/v,n[3]=.5*(g-f)/v):(n[0]=.5*(f+g)/v,n[1]=.5*(p+m)/v,n[2]=.5*v,n[3]=.5*(c-h)/v)}return n}},9977(s,l,n){"use strict";s.exports=v;var u=n(9215),c=n(6582),f=n(7399),h=n(7608),d=n(4081);function p(x,S,M){return Math.sqrt(Math.pow(x,2)+Math.pow(S,2)+Math.pow(M,2))}function g(x,S,M,C){return Math.sqrt(Math.pow(x,2)+Math.pow(S,2)+Math.pow(M,2)+Math.pow(C,2))}function m(x,S){var M=S[0],C=S[1],w=S[2],k=S[3],A=g(M,C,w,k);A>1e-6?(x[0]=M/A,x[1]=C/A,x[2]=w/A,x[3]=k/A):(x[0]=x[1]=x[2]=0,x[3]=1)}function y(x,S,M){this.radius=u([M]),this.center=u(S),this.rotation=u(x),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var _=y.prototype;_.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},_.recalcMatrix=function(x){this.radius.curve(x),this.center.curve(x),this.rotation.curve(x);var S=this.computedRotation;m(S,S);var M=this.computedMatrix;f(M,S);var C=this.computedCenter,w=this.computedEye,k=this.computedUp,A=Math.exp(this.computedRadius[0]);w[0]=C[0]+A*M[2],w[1]=C[1]+A*M[6],w[2]=C[2]+A*M[10],k[0]=M[1],k[1]=M[5],k[2]=M[9];for(var b=0;b<3;++b){for(var E=0,T=0;T<3;++T)E+=M[b+4*T]*w[T];M[12+b]=-E}},_.getMatrix=function(x,S){this.recalcMatrix(x);var M=this.computedMatrix;if(S){for(var C=0;C<16;++C)S[C]=M[C];return S}return M},_.idle=function(x){this.center.idle(x),this.radius.idle(x),this.rotation.idle(x)},_.flush=function(x){this.center.flush(x),this.radius.flush(x),this.rotation.flush(x)},_.pan=function(x,S,M,C){S=S||0,M=M||0,C=C||0,this.recalcMatrix(x);var w=this.computedMatrix,k=w[1],A=w[5],b=w[9],E=p(k,A,b);k/=E,A/=E,b/=E;var T=w[0],F=w[4],D=w[8],R=T*k+F*A+D*b;T-=k*R,F-=A*R,D-=b*R;var P=p(T,F,D);T/=P,F/=P,D/=P;var z=w[2],I=w[6],L=w[10],B=z*k+I*A+L*b,O=z*T+I*F+L*D;z-=B*k+O*T,I-=B*A+O*F,L-=B*b+O*D;var G=p(z,I,L);z/=G,I/=G,L/=G;var W=T*S+k*M,X=F*S+A*M,Z=D*S+b*M;this.center.move(x,W,X,Z);var J=Math.exp(this.computedRadius[0]);J=Math.max(1e-4,J+C),this.radius.set(x,Math.log(J))},_.rotate=function(x,S,M,C){this.recalcMatrix(x),S=S||0,M=M||0;var w=this.computedMatrix,k=w[0],A=w[4],b=w[8],E=w[1],T=w[5],F=w[9],D=w[2],R=w[6],P=w[10],z=S*k+M*E,I=S*A+M*T,L=S*b+M*F,B=-(R*L-P*I),O=-(P*z-D*L),G=-(D*I-R*z),W=Math.sqrt(Math.max(0,1-Math.pow(B,2)-Math.pow(O,2)-Math.pow(G,2))),X=g(B,O,G,W);X>1e-6?(B/=X,O/=X,G/=X,W/=X):(B=O=G=0,W=1);var Z=this.computedRotation,J=Z[0],N=Z[1],H=Z[2],$=Z[3],U=J*W+$*B+N*G-H*O,V=N*W+$*O+H*B-J*G,j=H*W+$*G+J*O-N*B,q=$*W-J*B-N*O-H*G;if(C){B=D,O=R,G=P;var Y=Math.sin(C)/p(B,O,G);B*=Y,O*=Y,G*=Y,W=Math.cos(S),U=U*W+q*B+V*G-j*O,V=V*W+q*O+j*B-U*G,j=j*W+q*G+U*O-V*B,q=q*W-U*B-V*O-j*G}var K=g(U,V,j,q);K>1e-6?(U/=K,V/=K,j/=K,q/=K):(U=V=j=0,q=1),this.rotation.set(x,U,V,j,q)},_.lookAt=function(x,S,M,C){this.recalcMatrix(x),M=M||this.computedCenter,S=S||this.computedEye,C=C||this.computedUp;var w=this.computedMatrix;c(w,S,M,C);var k=this.computedRotation;d(k,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),m(k,k),this.rotation.set(x,k[0],k[1],k[2],k[3]);for(var A=0,b=0;b<3;++b)A+=Math.pow(M[b]-S[b],2);this.radius.set(x,.5*Math.log(Math.max(A,1e-6))),this.center.set(x,M[0],M[1],M[2])},_.translate=function(x,S,M,C){this.center.move(x,S||0,M||0,C||0)},_.setMatrix=function(x,S){var M=this.computedRotation;d(M,S[0],S[1],S[2],S[4],S[5],S[6],S[8],S[9],S[10]),m(M,M),this.rotation.set(x,M[0],M[1],M[2],M[3]);var C=this.computedMatrix;h(C,S);var w=C[15];if(Math.abs(w)>1e-6){var k=C[12]/w,A=C[13]/w,b=C[14]/w;this.recalcMatrix(x);var E=Math.exp(this.computedRadius[0]);this.center.set(x,k-C[2]*E,A-C[6]*E,b-C[10]*E),this.radius.idle(x)}else this.center.idle(x),this.radius.idle(x)},_.setDistance=function(x,S){S>0&&this.radius.set(x,Math.log(S))},_.setDistanceLimits=function(x,S){x>0?x=Math.log(x):x=-1/0,S>0?S=Math.log(S):S=1/0,S=Math.max(S,x),this.radius.bounds[0][0]=x,this.radius.bounds[1][0]=S},_.getDistanceLimits=function(x){var S=this.radius.bounds;return x?(x[0]=Math.exp(S[0][0]),x[1]=Math.exp(S[1][0]),x):[Math.exp(S[0][0]),Math.exp(S[1][0])]},_.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},_.fromJSON=function(x){var S=this.lastT(),M=x.center;M&&this.center.set(S,M[0],M[1],M[2]);var C=x.rotation;C&&this.rotation.set(S,C[0],C[1],C[2],C[3]);var w=x.distance;w&&w>0&&this.radius.set(S,Math.log(w)),this.setDistanceLimits(x.zoomMin,x.zoomMax)};function v(x){x=x||{};var S=x.center||[0,0,0],M=x.rotation||[0,0,0,1],C=x.radius||1;S=[].slice.call(S,0,3),M=[].slice.call(M,0,4),m(M,M);var w=new y(M,S,Math.log(C));return w.setDistanceLimits(x.zoomMin,x.zoomMax),("eye"in x||"up"in x)&&w.lookAt(0,x.eye,x.center,x.up),w}},1371(s,l,n){"use strict";var u=n(3233);s.exports=function(f,h,d){return d=typeof d<"u"?d+"":" ",u(d,h)+f}},3202(s){s.exports=function(n,u){u||(u=[0,""]),n=String(n);var c=parseFloat(n,10);return u[0]=c,u[1]=n.match(/[\d.\-\+]*\s*(.*)/)[1]||"",u}},3088(s,l,n){"use strict";s.exports=c;var u=n(3140);function c(f,h){for(var d=h.length|0,p=f.length,g=[new Array(d),new Array(d)],m=0;m0){F=g[P][E][0],R=P;break}D=F[R^1];for(var z=0;z<2;++z)for(var I=g[z][E],L=0;L0&&(F=B,D=O,R=z)}return T||F&&v(F,R),D}function S(b,E){var T=g[E][b][0],F=[b];v(T,E);for(var D=T[E^1],R=E;;){for(;D!==b;)F.push(D),D=x(F[F.length-2],D,!1);if(g[0][b].length+g[1][b].length===0)break;var P=F[F.length-1],z=b,I=F[1],L=x(P,z,!0);if(u(h[P],h[z],h[I],h[L])<0)break;F.push(b),D=x(P,z)}return F}function M(b,E){return E[1]===E[E.length-1]}for(var m=0;m0;){var k=g[0][m].length,A=S(m,C);M(w,A)?w.push.apply(w,A):(w.length>0&&_.push(w),w=A)}w.length>0&&_.push(w)}return _}},5609(s,l,n){"use strict";s.exports=c;var u=n(3134);function c(f,h){for(var d=u(f,h.length),p=new Array(h.length),g=new Array(h.length),m=[],y=0;y0;){var v=m.pop();p[v]=!1;for(var x=d[v],y=0;y0}k=k.filter(A);for(var b=k.length,E=new Array(b),T=new Array(b),w=0;w0;){var K=j.pop(),te=X[K];p(te,function(pe,xe){return pe-xe});var ne=te.length,se=q[K],le;if(se===0){var I=k[K];le=[I]}for(var w=0;w=0)&&(q[ce]=se^1,j.push(ce),se===0)){var I=k[ce];V(I)||(I.reverse(),le.push(I))}}se===0&&Y.push(le)}return Y}},5085(s,l,n){s.exports=x;var u=n(3250)[3],c=n(4209),f=n(3352),h=n(2478);function d(){return!0}function p(S){return function(M,C){var w=S[M];return w?!!w.queryPoint(C,d):!1}}function g(S){for(var M={},C=0;C0&&M[w]===C[0])k=S[w-1];else return 1;for(var A=1;k;){var b=k.key,E=u(C,b[0],b[1]);if(b[0][0]0)A=-1,k=k.right;else return 0;else if(E>0)k=k.left;else if(E<0)A=1,k=k.right;else return 0}return A}}function y(S){return 1}function _(S){return function(C){return S(C[0],C[1])?0:1}}function v(S,M){return function(w){return S(w[0],w[1])?0:M(w)}}function x(S){for(var M=S.length,C=[],w=[],k=0,A=0;A=y?(b=1,T=y+2*x+M):(b=-x/y,T=x*b+M)):(b=0,S>=0?(E=0,T=M):-S>=v?(E=1,T=v+2*S+M):(E=-S/v,T=S*E+M));else if(E<0)E=0,x>=0?(b=0,T=M):-x>=y?(b=1,T=y+2*x+M):(b=-x/y,T=x*b+M);else{var F=1/A;b*=F,E*=F,T=b*(y*b+_*E+2*x)+E*(_*b+v*E+2*S)+M}else{var D,R,P,z;b<0?(D=_+x,R=v+S,R>D?(P=R-D,z=y-2*_+v,P>=z?(b=1,E=0,T=y+2*x+M):(b=P/z,E=1-b,T=b*(y*b+_*E+2*x)+E*(_*b+v*E+2*S)+M)):(b=0,R<=0?(E=1,T=v+2*S+M):S>=0?(E=0,T=M):(E=-S/v,T=S*E+M))):E<0?(D=_+S,R=y+x,R>D?(P=R-D,z=y-2*_+v,P>=z?(E=1,b=0,T=v+2*S+M):(E=P/z,b=1-E,T=b*(y*b+_*E+2*x)+E*(_*b+v*E+2*S)+M)):(E=0,R<=0?(b=1,T=y+2*x+M):x>=0?(b=0,T=M):(b=-x/y,T=x*b+M))):(P=v+S-_-x,P<=0?(b=0,E=1,T=v+2*S+M):(z=y-2*_+v,P>=z?(b=1,E=0,T=y+2*x+M):(b=P/z,E=1-b,T=b*(y*b+_*E+2*x)+E*(_*b+v*E+2*S)+M)))}for(var I=1-b-E,m=0;m0){var v=d[g-1];if(u(y,v)===0&&f(v)!==_){g-=1;continue}}d[g++]=y}}return d.length=g,d}},3233(s){"use strict";var l="",n;s.exports=u;function u(c,f){if(typeof c!="string")throw new TypeError("expected a string");if(f===1)return c;if(f===2)return c+c;var h=c.length*f;if(n!==c||typeof n>"u")n=c,l="";else if(l.length>=h)return l.substr(0,h);for(;h>l.length&&f>1;)f&1&&(l+=c),f>>=1,c+=c;return l+=c,l=l.substr(0,h),l}},3025(s,l,n){s.exports=n.g.performance&&n.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004(s){"use strict";s.exports=l;function l(n){for(var u=n.length,c=n[n.length-1],f=u,h=u-2;h>=0;--h){var d=c,p=n[h];c=d+p;var g=c-d,m=p-g;m&&(n[--f]=c,c=m)}for(var y=0,h=f;h0){if(R<=0)return P;z=D+R}else if(D<0){if(R>=0)return P;z=-(D+R)}else return P;var I=g*z;return P>=I||P<=-I?P:S(E,T,F)},function(E,T,F,D){var R=E[0]-D[0],P=T[0]-D[0],z=F[0]-D[0],I=E[1]-D[1],L=T[1]-D[1],B=F[1]-D[1],O=E[2]-D[2],G=T[2]-D[2],W=F[2]-D[2],X=P*B,Z=z*L,J=z*I,N=R*B,H=R*L,$=P*I,U=O*(X-Z)+G*(J-N)+W*(H-$),V=(Math.abs(X)+Math.abs(Z))*Math.abs(O)+(Math.abs(J)+Math.abs(N))*Math.abs(G)+(Math.abs(H)+Math.abs($))*Math.abs(W),j=m*V;return U>j||-U>j?U:M(E,T,F,D)}];function w(b){var E=C[b.length];return E||(E=C[b.length]=x(b.length)),E.apply(void 0,b)}function k(b,E,T,F,D,R,P){return function(I,L,B,O,G){switch(arguments.length){case 0:case 1:return 0;case 2:return F(I,L);case 3:return D(I,L,B);case 4:return R(I,L,B,O);case 5:return P(I,L,B,O,G)}for(var W=new Array(arguments.length),X=0;X0&&y>0||m<0&&y<0)return!1;var _=u(p,h,d),v=u(g,h,d);return _>0&&v>0||_<0&&v<0?!1:m===0&&y===0&&_===0&&v===0?c(h,d,p,g):!0}},8545(s){"use strict";s.exports=n;function l(u,c){var f=u+c,h=f-u,d=f-h,p=c-h,g=u-d,m=g+p;return m?[m,f]:[f]}function n(u,c){var f=u.length|0,h=c.length|0;if(f===1&&h===1)return l(u[0],-c[0]);var d=f+h,p=new Array(d),g=0,m=0,y=0,_=Math.abs,v=u[m],x=_(v),S=-c[y],M=_(S),C,w;x=h?(C=v,m+=1,m=h?(C=v,m+=1,m"u"&&(C=d(x));var w=x.length;if(w===0||C<1)return{cells:[],vertexIds:[],vertexWeights:[]};var k=p(S,+M),A=g(x,C),b=m(A,S,k,+M),E=y(A,S.length|0),T=h(C)(x,A.data,E,k),F=_(A),D=[].slice.call(b.data,0,b.shape[0]);return c.free(k),c.free(A.data),c.free(b.data),c.free(E),{cells:T,vertexIds:F,vertexWeights:D}}},1570(s){"use strict";s.exports=n;var l=[function(){function c(h,d,p,g){for(var m=Math.min(p,g)|0,y=Math.max(p,g)|0,_=h[2*m],v=h[2*m+1];_>1,S=d[2*x+1];if(S===y)return x;y>1,S=d[2*x+1];if(S===y)return x;y>1,S=d[2*x+1];if(S===y)return x;y>1,S=d[2*x+1];if(S===y)return x;y>1,z=g(E[P],T);z<=0?(z===0&&(R=P),F=P+1):z>0&&(D=P-1)}return R}u=v;function x(E,T){for(var F=new Array(E.length),D=0,R=F.length;D=E.length||g(E[X],P)!==0););}return F}u=x;function S(E,T){if(!T)return x(_(C(E,0)),E,0);for(var F=new Array(T),D=0;D>>B&1&&L.push(R[B]);T.push(L)}return y(T)}u=M;function C(E,T){if(T<0)return[];for(var F=[],D=(1<0)-(f<0)},l.abs=function(f){var h=f>>n-1;return(f^h)-h},l.min=function(f,h){return h^(f^h)&-(f65535)<<4,f>>>=h,d=(f>255)<<3,f>>>=d,h|=d,d=(f>15)<<2,f>>>=d,h|=d,d=(f>3)<<1,f>>>=d,h|=d,h|f>>1},l.log10=function(f){return f>=1e9?9:f>=1e8?8:f>=1e7?7:f>=1e6?6:f>=1e5?5:f>=1e4?4:f>=1e3?3:f>=100?2:f>=10?1:0},l.popCount=function(f){return f=f-(f>>>1&1431655765),f=(f&858993459)+(f>>>2&858993459),(f+(f>>>4)&252645135)*16843009>>>24};function u(f){var h=32;return f&=-f,f&&h--,f&65535&&(h-=16),f&16711935&&(h-=8),f&252645135&&(h-=4),f&858993459&&(h-=2),f&1431655765&&(h-=1),h}l.countTrailingZeros=u,l.nextPow2=function(f){return f+=f===0,--f,f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f+1},l.prevPow2=function(f){return f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f-(f>>>1)},l.parity=function(f){return f^=f>>>16,f^=f>>>8,f^=f>>>4,f&=15,27030>>>f&1};var c=new Array(256);(function(f){for(var h=0;h<256;++h){var d=h,p=h,g=7;for(d>>>=1;d;d>>>=1)p<<=1,p|=d&1,--g;f[h]=p<>>8&255]<<16|c[f>>>16&255]<<8|c[f>>>24&255]},l.interleave2=function(f,h){return f&=65535,f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,h&=65535,h=(h|h<<8)&16711935,h=(h|h<<4)&252645135,h=(h|h<<2)&858993459,h=(h|h<<1)&1431655765,f|h<<1},l.deinterleave2=function(f,h){return f=f>>>h&1431655765,f=(f|f>>>1)&858993459,f=(f|f>>>2)&252645135,f=(f|f>>>4)&16711935,f=(f|f>>>16)&65535,f<<16>>16},l.interleave3=function(f,h,d){return f&=1023,f=(f|f<<16)&4278190335,f=(f|f<<8)&251719695,f=(f|f<<4)&3272356035,f=(f|f<<2)&1227133513,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,f|=h<<1,d&=1023,d=(d|d<<16)&4278190335,d=(d|d<<8)&251719695,d=(d|d<<4)&3272356035,d=(d|d<<2)&1227133513,f|d<<2},l.deinterleave3=function(f,h){return f=f>>>h&1227133513,f=(f|f>>>2)&3272356035,f=(f|f>>>4)&251719695,f=(f|f>>>8)&4278190335,f=(f|f>>>16)&1023,f<<22>>22},l.nextCombination=function(f){var h=f|f-1;return h+1|(~h&-~h)-1>>>u(f)+1}},2014(s,l,n){"use strict";"use restrict";var u=n(3105),c=n(4623);function f(b){for(var E=0,T=Math.max,F=0,D=b.length;F>1,P=p(b[R],E);P<=0?(P===0&&(D=R),T=R+1):P>0&&(F=R-1)}return D}l.findCell=_;function v(b,E){for(var T=new Array(b.length),F=0,D=T.length;F=b.length||p(b[W],R)!==0););}return T}l.incidence=v;function x(b,E){if(!E)return v(y(M(b,0)),b,0);for(var T=new Array(E),F=0;F>>L&1&&I.push(D[L]);E.push(I)}return m(E)}l.explode=S;function M(b,E){if(E<0)return[];for(var T=[],F=(1<>1:(N>>1)-1}function F(N){for(var H=E(N);;){var $=H,U=2*N+1,V=2*(N+1),j=N;if(U0;){var $=T(N);if($>=0){var U=E($);if(H0){var N=I[0];return b(0,O-1),O-=1,F(0),N}return-1}function P(N,H){var $=I[N];return x[$]===H?N:(x[$]=-1/0,D(N),R(),x[$]=H,O+=1,D(O-1))}function z(N){if(!S[N]){S[N]=!0;var H=_[N],$=v[N];_[$]>=0&&(_[$]=H),v[H]>=0&&(v[H]=$),L[H]>=0&&P(L[H],A(H)),L[$]>=0&&P(L[$],A($))}}for(var I=[],L=new Array(m),M=0;M>1;M>=0;--M)F(M);for(;;){var G=R();if(G<0||x[G]>g)break;z(G)}for(var W=[],M=0;M=0&&$>=0&&H!==$){var U=L[H],V=L[$];U!==V&&J.push([U,V])}}),c.unique(c.normalize(J)),{positions:W,edges:J}}},1303(s,l,n){"use strict";s.exports=f;var u=n(3250);function c(h,d){var p,g;if(d[0][0]d[1][0])p=d[1],g=d[0];else{var m=Math.min(h[0][1],h[1][1]),y=Math.max(h[0][1],h[1][1]),_=Math.min(d[0][1],d[1][1]),v=Math.max(d[0][1],d[1][1]);return y<_?y-_:m>v?m-v:y-v}var x,S;h[0][1]d[1][0])p=d[1],g=d[0];else return c(d,h);var m,y;if(h[0][0]h[1][0])m=h[1],y=h[0];else return-c(h,d);var _=u(p,g,y),v=u(p,g,m);if(_<0){if(v<=0)return _}else if(_>0){if(v>=0)return _}else if(v)return v;if(_=u(y,m,g),v=u(y,m,p),_<0){if(v<=0)return _}else if(_>0){if(v>=0)return _}else if(v)return v;return g[0]-y[0]}},4209(s,l,n){"use strict";s.exports=v;var u=n(2478),c=n(3840),f=n(3250),h=n(1303);function d(x,S,M){this.slabs=x,this.coordinates=S,this.horizontal=M}var p=d.prototype;function g(x,S){return x.y-S}function m(x,S){for(var M=null;x;){var C=x.key,w,k;C[0][0]0)if(S[0]!==C[1][0])M=x,x=x.right;else{var b=m(x.right,S);if(b)return b;x=x.left}else{if(S[0]!==C[1][0])return x;var b=m(x.right,S);if(b)return b;x=x.left}}return M}p.castUp=function(x){var S=u.le(this.coordinates,x[0]);if(S<0)return-1;var M=this.slabs[S],C=m(this.slabs[S],x),w=-1;if(C&&(w=C.value),this.coordinates[S]===x[0]){var k=null;if(C&&(k=C.key),S>0){var A=m(this.slabs[S-1],x);A&&(k?h(A.key,k)>0&&(k=A.key,w=A.value):(w=A.value,k=A.key))}var b=this.horizontal[S];if(b.length>0){var E=u.ge(b,x[1],g);if(E=b.length)return w;T=b[E]}}if(T.start)if(k){var F=f(k[0],k[1],[x[0],T.y]);k[0][0]>k[1][0]&&(F=-F),F>0&&(w=T.index)}else w=T.index;else T.y!==x[1]&&(w=T.index)}}}return w};function y(x,S,M,C){this.y=x,this.index=S,this.start=M,this.closed=C}function _(x,S,M,C){this.x=x,this.segment=S,this.create=M,this.index=C}function v(x){for(var S=x.length,M=2*S,C=new Array(M),w=0;w1&&(S=1);for(var M=1-S,C=m.length,w=new Array(C),k=0;k0||x>0&&w<0){var k=h(S,w,M,x);_.push(k),v.push(k.slice())}w<0?v.push(M.slice()):w>0?_.push(M.slice()):(_.push(M.slice()),v.push(M.slice())),x=w}return{positive:_,negative:v}}function p(m,y){for(var _=[],v=f(m[m.length-1],y),x=m[m.length-1],S=m[0],M=0;M0||v>0&&C<0)&&_.push(h(x,C,S,v)),C>=0&&_.push(S.slice()),v=C}return _}function g(m,y){for(var _=[],v=f(m[m.length-1],y),x=m[m.length-1],S=m[0],M=0;M0||v>0&&C<0)&&_.push(h(x,C,S,v)),C<=0&&_.push(S.slice()),v=C}return _}},3387(s,l,n){var u;(function(){"use strict";var c={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function f(m){return d(g(m),arguments)}function h(m,y){return f.apply(null,[m].concat(y||[]))}function d(m,y){var _=1,v=m.length,x,S="",M,C,w,k,A,b,E,T;for(M=0;M=0),w.type){case"b":x=parseInt(x,10).toString(2);break;case"c":x=String.fromCharCode(parseInt(x,10));break;case"d":case"i":x=parseInt(x,10);break;case"j":x=JSON.stringify(x,null,w.width?parseInt(w.width):0);break;case"e":x=w.precision?parseFloat(x).toExponential(w.precision):parseFloat(x).toExponential();break;case"f":x=w.precision?parseFloat(x).toFixed(w.precision):parseFloat(x);break;case"g":x=w.precision?String(Number(x.toPrecision(w.precision))):parseFloat(x);break;case"o":x=(parseInt(x,10)>>>0).toString(8);break;case"s":x=String(x),x=w.precision?x.substring(0,w.precision):x;break;case"t":x=String(!!x),x=w.precision?x.substring(0,w.precision):x;break;case"T":x=Object.prototype.toString.call(x).slice(8,-1).toLowerCase(),x=w.precision?x.substring(0,w.precision):x;break;case"u":x=parseInt(x,10)>>>0;break;case"v":x=x.valueOf(),x=w.precision?x.substring(0,w.precision):x;break;case"x":x=(parseInt(x,10)>>>0).toString(16);break;case"X":x=(parseInt(x,10)>>>0).toString(16).toUpperCase();break}c.json.test(w.type)?S+=x:(c.number.test(w.type)&&(!E||w.sign)?(T=E?"+":"-",x=x.toString().replace(c.sign,"")):T="",A=w.pad_char?w.pad_char==="0"?"0":w.pad_char.charAt(1):" ",b=w.width-(T+x).length,k=w.width&&b>0?A.repeat(b):"",S+=w.align?T+x+k:A==="0"?T+k+x:k+T+x)}return S}var p=Object.create(null);function g(m){if(p[m])return p[m];for(var y=m,_,v=[],x=0;y;){if((_=c.text.exec(y))!==null)v.push(_[0]);else if((_=c.modulo.exec(y))!==null)v.push("%");else if((_=c.placeholder.exec(y))!==null){if(_[2]){x|=1;var S=[],M=_[2],C=[];if((C=c.key.exec(M))!==null)for(S.push(C[1]);(M=M.substring(C[0].length))!=="";)if((C=c.key_access.exec(M))!==null)S.push(C[1]);else if((C=c.index_access.exec(M))!==null)S.push(C[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");_[2]=S}else x|=2;if(x===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");v.push({placeholder:_[0],param_no:_[1],keys:_[2],sign:_[3],pad_char:_[4],align:_[5],width:_[6],precision:_[7],type:_[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");y=y.substring(_[0].length)}return p[m]=v}l.sprintf=f,l.vsprintf=h,typeof window<"u"&&(window.sprintf=f,window.vsprintf=h,u=(function(){return{sprintf:f,vsprintf:h}}).call(l,n,l,s),u!==void 0&&(s.exports=u))})()},3711(s,l,n){"use strict";s.exports=g;var u=n(2640),c=n(781),f={"2d":function(m,y,_){var v=m({order:y,scalarArguments:3,getters:_==="generic"?[0]:void 0,phase:function(S,M,C,w){return S>w|0},vertex:function(S,M,C,w,k,A,b,E,T,F,D,R,P){var z=(b<<0)+(E<<1)+(T<<2)+(F<<3)|0;if(!(z===0||z===15))switch(z){case 0:D.push([S-.5,M-.5]);break;case 1:D.push([S-.25-.25*(w+C-2*P)/(C-w),M-.25-.25*(k+C-2*P)/(C-k)]);break;case 2:D.push([S-.75-.25*(-w-C+2*P)/(w-C),M-.25-.25*(A+w-2*P)/(w-A)]);break;case 3:D.push([S-.5,M-.5-.5*(k+C+A+w-4*P)/(C-k+w-A)]);break;case 4:D.push([S-.25-.25*(A+k-2*P)/(k-A),M-.75-.25*(-k-C+2*P)/(k-C)]);break;case 5:D.push([S-.5-.5*(w+C+A+k-4*P)/(C-w+k-A),M-.5]);break;case 6:D.push([S-.5-.25*(-w-C+A+k)/(w-C+k-A),M-.5-.25*(-k-C+A+w)/(k-C+w-A)]);break;case 7:D.push([S-.75-.25*(A+k-2*P)/(k-A),M-.75-.25*(A+w-2*P)/(w-A)]);break;case 8:D.push([S-.75-.25*(-A-k+2*P)/(A-k),M-.75-.25*(-A-w+2*P)/(A-w)]);break;case 9:D.push([S-.5-.25*(w+C+-A-k)/(C-w+A-k),M-.5-.25*(k+C+-A-w)/(C-k+A-w)]);break;case 10:D.push([S-.5-.5*(-w-C+-A-k+4*P)/(w-C+A-k),M-.5]);break;case 11:D.push([S-.25-.25*(-A-k+2*P)/(A-k),M-.75-.25*(k+C-2*P)/(C-k)]);break;case 12:D.push([S-.5,M-.5-.5*(-k-C+-A-w+4*P)/(k-C+A-w)]);break;case 13:D.push([S-.75-.25*(w+C-2*P)/(C-w),M-.25-.25*(-A-w+2*P)/(A-w)]);break;case 14:D.push([S-.25-.25*(-w-C+2*P)/(w-C),M-.25-.25*(-k-C+2*P)/(k-C)]);break;case 15:D.push([S-.5,M-.5]);break}},cell:function(S,M,C,w,k,A,b,E,T){k?E.push([S,M]):E.push([M,S])}});return function(x,S){var M=[],C=[];return v(x,M,C,S),{positions:M,cells:C}}}};function h(m,y){var _=m.length+"d",v=f[_];if(v)return v(u,m,y)}function d(m,y){for(var _=c(m,y),v=_.length,x=new Array(v),S=new Array(v),M=0;MMath.max(w,k)?A[2]=1:w>Math.max(C,k)?A[0]=1:A[1]=1;for(var b=0,E=0,T=0;T<3;++T)b+=M[T]*M[T],E+=A[T]*M[T];for(var T=0;T<3;++T)A[T]-=E/b*M[T];return d(A,A),A}function _(M,C,w,k,A,b,E,T){this.center=u(w),this.up=u(k),this.right=u(A),this.radius=u([b]),this.angle=u([E,T]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(M,C),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var F=0;F<16;++F)this.computedMatrix[F]=.5;this.recalcMatrix(0)}var v=_.prototype;v.setDistanceLimits=function(M,C){M>0?M=Math.log(M):M=-1/0,C>0?C=Math.log(C):C=1/0,C=Math.max(C,M),this.radius.bounds[0][0]=M,this.radius.bounds[1][0]=C},v.getDistanceLimits=function(M){var C=this.radius.bounds[0];return M?(M[0]=Math.exp(C[0][0]),M[1]=Math.exp(C[1][0]),M):[Math.exp(C[0][0]),Math.exp(C[1][0])]},v.recalcMatrix=function(M){this.center.curve(M),this.up.curve(M),this.right.curve(M),this.radius.curve(M),this.angle.curve(M);for(var C=this.computedUp,w=this.computedRight,k=0,A=0,b=0;b<3;++b)A+=C[b]*w[b],k+=C[b]*C[b];for(var E=Math.sqrt(k),T=0,b=0;b<3;++b)w[b]-=C[b]*A/k,T+=w[b]*w[b],C[b]/=E;for(var F=Math.sqrt(T),b=0;b<3;++b)w[b]/=F;var D=this.computedToward;h(D,C,w),d(D,D);for(var R=Math.exp(this.computedRadius[0]),P=this.computedAngle[0],z=this.computedAngle[1],I=Math.cos(P),L=Math.sin(P),B=Math.cos(z),O=Math.sin(z),G=this.computedCenter,W=I*B,X=L*B,Z=O,J=-I*O,N=-L*O,H=B,$=this.computedEye,U=this.computedMatrix,b=0;b<3;++b){var V=W*w[b]+X*D[b]+Z*C[b];U[4*b+1]=J*w[b]+N*D[b]+H*C[b],U[4*b+2]=V,U[4*b+3]=0}var j=U[1],q=U[5],Y=U[9],K=U[2],te=U[6],ne=U[10],se=q*ne-Y*te,le=Y*K-j*ne,ce=j*te-q*K,pe=g(se,le,ce);se/=pe,le/=pe,ce/=pe,U[0]=se,U[4]=le,U[8]=ce;for(var b=0;b<3;++b)$[b]=G[b]+U[2+4*b]*R;for(var b=0;b<3;++b){for(var T=0,xe=0;xe<3;++xe)T+=U[b+4*xe]*$[xe];U[12+b]=-T}U[15]=1},v.getMatrix=function(M,C){this.recalcMatrix(M);var w=this.computedMatrix;if(C){for(var k=0;k<16;++k)C[k]=w[k];return C}return w};var x=[0,0,0];v.rotate=function(M,C,w,k){if(this.angle.move(M,C,w),k){this.recalcMatrix(M);var A=this.computedMatrix;x[0]=A[2],x[1]=A[6],x[2]=A[10];for(var b=this.computedUp,E=this.computedRight,T=this.computedToward,F=0;F<3;++F)A[4*F]=b[F],A[4*F+1]=E[F],A[4*F+2]=T[F];f(A,A,k,x);for(var F=0;F<3;++F)b[F]=A[4*F],E[F]=A[4*F+1];this.up.set(M,b[0],b[1],b[2]),this.right.set(M,E[0],E[1],E[2])}},v.pan=function(M,C,w,k){C=C||0,w=w||0,k=k||0,this.recalcMatrix(M);var A=this.computedMatrix,b=Math.exp(this.computedRadius[0]),E=A[1],T=A[5],F=A[9],D=g(E,T,F);E/=D,T/=D,F/=D;var R=A[0],P=A[4],z=A[8],I=R*E+P*T+z*F;R-=E*I,P-=T*I,z-=F*I;var L=g(R,P,z);R/=L,P/=L,z/=L;var B=R*C+E*w,O=P*C+T*w,G=z*C+F*w;this.center.move(M,B,O,G);var W=Math.exp(this.computedRadius[0]);W=Math.max(1e-4,W+k),this.radius.set(M,Math.log(W))},v.translate=function(M,C,w,k){this.center.move(M,C||0,w||0,k||0)},v.setMatrix=function(M,C,w,k){var A=1;typeof w=="number"&&(A=w|0),(A<0||A>3)&&(A=1);var b=(A+2)%3,E=(A+1)%3;C||(this.recalcMatrix(M),C=this.computedMatrix);var T=C[A],F=C[A+4],D=C[A+8];if(k){var P=Math.abs(T),z=Math.abs(F),I=Math.abs(D),L=Math.max(P,z,I);P===L?(T=T<0?-1:1,F=D=0):I===L?(D=D<0?-1:1,T=F=0):(F=F<0?-1:1,T=D=0)}else{var R=g(T,F,D);T/=R,F/=R,D/=R}var B=C[b],O=C[b+4],G=C[b+8],W=B*T+O*F+G*D;B-=T*W,O-=F*W,G-=D*W;var X=g(B,O,G);B/=X,O/=X,G/=X;var Z=F*G-D*O,J=D*B-T*G,N=T*O-F*B,H=g(Z,J,N);Z/=H,J/=H,N/=H,this.center.jump(M,ie,Q,ue),this.radius.idle(M),this.up.jump(M,T,F,D),this.right.jump(M,B,O,G);var $,U;if(A===2){var V=C[1],j=C[5],q=C[9],Y=V*B+j*O+q*G,K=V*Z+j*J+q*N;le<0?$=-Math.PI/2:$=Math.PI/2,U=Math.atan2(K,Y)}else{var te=C[2],ne=C[6],se=C[10],le=te*T+ne*F+se*D,ce=te*B+ne*O+se*G,pe=te*Z+ne*J+se*N;$=Math.asin(m(le)),U=Math.atan2(pe,ce)}this.angle.jump(M,U,$),this.recalcMatrix(M);var xe=C[2],ye=C[6],fe=C[10],ae=this.computedMatrix;c(ae,C);var ee=ae[15],ie=ae[12]/ee,Q=ae[13]/ee,ue=ae[14]/ee,ge=Math.exp(this.computedRadius[0]);this.center.jump(M,ie-xe*ge,Q-ye*ge,ue-fe*ge)},v.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},v.idle=function(M){this.center.idle(M),this.up.idle(M),this.right.idle(M),this.radius.idle(M),this.angle.idle(M)},v.flush=function(M){this.center.flush(M),this.up.flush(M),this.right.flush(M),this.radius.flush(M),this.angle.flush(M)},v.setDistance=function(M,C){C>0&&this.radius.set(M,Math.log(C))},v.lookAt=function(M,C,w,k){this.recalcMatrix(M),C=C||this.computedEye,w=w||this.computedCenter,k=k||this.computedUp;var A=k[0],b=k[1],E=k[2],T=g(A,b,E);if(!(T<1e-6)){A/=T,b/=T,E/=T;var F=C[0]-w[0],D=C[1]-w[1],R=C[2]-w[2],P=g(F,D,R);if(!(P<1e-6)){F/=P,D/=P,R/=P;var z=this.computedRight,I=z[0],L=z[1],B=z[2],O=A*I+b*L+E*B;I-=O*A,L-=O*b,B-=O*E;var G=g(I,L,B);if(!(G<.01&&(I=b*R-E*D,L=E*F-A*R,B=A*D-b*F,G=g(I,L,B),G<1e-6))){I/=G,L/=G,B/=G,this.up.set(M,A,b,E),this.right.set(M,I,L,B),this.center.set(M,w[0],w[1],w[2]),this.radius.set(M,Math.log(P));var W=b*B-E*L,X=E*I-A*B,Z=A*L-b*I,J=g(W,X,Z);W/=J,X/=J,Z/=J;var N=A*F+b*D+E*R,H=I*F+L*D+B*R,$=W*F+X*D+Z*R,U=Math.asin(m(N)),V=Math.atan2($,H),j=this.angle._state,q=j[j.length-1],Y=j[j.length-2];q=q%(2*Math.PI);var K=Math.abs(q+2*Math.PI-V),te=Math.abs(q-V),ne=Math.abs(q-2*Math.PI-V);K0?B.pop():new ArrayBuffer(I)}l.mallocArrayBuffer=x;function S(z){return new Uint8Array(x(z),0,z)}l.mallocUint8=S;function M(z){return new Uint16Array(x(2*z),0,z)}l.mallocUint16=M;function C(z){return new Uint32Array(x(4*z),0,z)}l.mallocUint32=C;function w(z){return new Int8Array(x(z),0,z)}l.mallocInt8=w;function k(z){return new Int16Array(x(2*z),0,z)}l.mallocInt16=k;function A(z){return new Int32Array(x(4*z),0,z)}l.mallocInt32=A;function b(z){return new Float32Array(x(4*z),0,z)}l.mallocFloat32=l.mallocFloat=b;function E(z){return new Float64Array(x(8*z),0,z)}l.mallocFloat64=l.mallocDouble=E;function T(z){return h?new Uint8ClampedArray(x(z),0,z):S(z)}l.mallocUint8Clamped=T;function F(z){return d?new BigUint64Array(x(8*z),0,z):null}l.mallocBigUint64=F;function D(z){return p?new BigInt64Array(x(8*z),0,z):null}l.mallocBigInt64=D;function R(z){return new DataView(x(z),0,z)}l.mallocDataView=R;function P(z){z=u.nextPow2(z);var I=u.log2(z),L=y[I];return L.length>0?L.pop():new f(z)}l.mallocBuffer=P,l.clearCache=function(){for(var I=0;I<32;++I)g.UINT8[I].length=0,g.UINT16[I].length=0,g.UINT32[I].length=0,g.INT8[I].length=0,g.INT16[I].length=0,g.INT32[I].length=0,g.FLOAT[I].length=0,g.DOUBLE[I].length=0,g.BIGUINT64[I].length=0,g.BIGINT64[I].length=0,g.UINT8C[I].length=0,m[I].length=0,y[I].length=0}},1755(s){"use strict";"use restrict";s.exports=l;function l(u){this.roots=new Array(u),this.ranks=new Array(u);for(var c=0;c",B="",O=L.length,G=B.length,W=P[0]===x||P[0]===C,X=0,Z=-G;X>-1&&(X=z.indexOf(L,X),!(X===-1||(Z=z.indexOf(B,X+O),Z===-1)||Z<=X));){for(var J=X;J=Z)I[J]=null,z=z.substr(0,J)+" "+z.substr(J+1);else if(I[J]!==null){var N=I[J].indexOf(P[0]);N===-1?I[J]+=P:W&&(I[J]=I[J].substr(0,N+1)+(1+parseInt(I[J][N+1]))+I[J].substr(N+2))}var H=X+O,$=z.substr(H,Z-H),U=$.indexOf(L);U!==-1?X=U:X=Z+G}return I}function A(R,P,z){for(var I=P.textAlign||"start",L=P.textBaseline||"alphabetic",B=[1<<30,1<<30],O=[0,0],G=R.length,W=0;W/g,` `):z=z.replace(/\/g," ");var O="",G=[];for(q=0;q-1?parseInt(Q[1+Me]):0,Ve=Te>-1?parseInt(ue[1+Te]):0;je!==Ve&&(ge=ge.replace(ce(),"?px "),te*=Math.pow(.75,Ve-je),ge=ge.replace("?px ",ce())),K+=.25*N*(Ve-je)}if(B.superscripts===!0){var Ze=Q.indexOf(x),Ke=ue.indexOf(x),vt=Ze>-1?parseInt(Q[1+Ze]):0,xt=Ke>-1?parseInt(ue[1+Ke]):0;vt!==xt&&(ge=ge.replace(ce(),"?px "),te*=Math.pow(.75,xt-vt),ge=ge.replace("?px ",ce())),K-=.25*N*(xt-vt)}if(B.bolds===!0){var Pt=Q.indexOf(m)>-1,mt=ue.indexOf(m)>-1;!Pt&&mt&&(Mt?ge=ge.replace("italic ","italic bold "):ge="bold "+ge),Pt&&!mt&&(ge=ge.replace("bold ",""))}if(B.italics===!0){var Mt=Q.indexOf(_)>-1,lt=ue.indexOf(_)>-1;!Mt&<&&(ge="italic "+ge),Mt&&!lt&&(ge=ge.replace("italic ",""))}P.font=ge}for(j=0;j0&&(L=I.size),I.lineSpacing&&I.lineSpacing>0&&(B=I.lineSpacing),I.styletags&&I.styletags.breaklines&&(O.breaklines=!!I.styletags.breaklines),I.styletags&&I.styletags.bolds&&(O.bolds=!!I.styletags.bolds),I.styletags&&I.styletags.italics&&(O.italics=!!I.styletags.italics),I.styletags&&I.styletags.subscripts&&(O.subscripts=!!I.styletags.subscripts),I.styletags&&I.styletags.superscripts&&(O.superscripts=!!I.styletags.superscripts)),z.font=[I.fontStyle,I.fontVariant,I.fontWeight,L+"px",I.font].filter(function(W){return W}).join(" "),z.textAlign="start",z.textBaseline="alphabetic",z.direction="ltr";var G=b(P,z,R,L,B,O);return F(G,I,L)}},1538(s){(function(){"use strict";if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function n(T){T.permitHostObjects___&&T.permitHostObjects___(n)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=n);var u=!1;if(typeof WeakMap=="function"){var c=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var f=new c,h=Object.freeze({});if(f.set(h,1),f.get(h)!==1)u=!0;else{s.exports=WeakMap;return}}}var d=Object.prototype.hasOwnProperty,p=Object.getOwnPropertyNames,g=Object.defineProperty,m=Object.isExtensible,y="weakmap:",_=y+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var v=new ArrayBuffer(25),x=new Uint8Array(v);crypto.getRandomValues(x),_=y+"rand:"+Array.prototype.map.call(x,function(T){return(T%36).toString(36)}).join("")+"___"}function S(T){return!(T.substr(0,y.length)==y&&T.substr(T.length-3)==="___")}if(g(Object,"getOwnPropertyNames",{value:function(F){return p(F).filter(S)}}),"getPropertyNames"in Object){var M=Object.getPropertyNames;g(Object,"getPropertyNames",{value:function(F){return M(F).filter(S)}})}function C(T){if(T!==Object(T))throw new TypeError("Not an object: "+T);var F=T[_];if(F&&F.key===T)return F;if(m(T)){F={key:T};try{return g(T,_,{value:F,writable:!1,enumerable:!1,configurable:!1}),F}catch{return}}}(function(){var T=Object.freeze;g(Object,"freeze",{value:function(P){return C(P),T(P)}});var F=Object.seal;g(Object,"seal",{value:function(P){return C(P),F(P)}});var D=Object.preventExtensions;g(Object,"preventExtensions",{value:function(P){return C(P),D(P)}})})();function w(T){return T.prototype=null,Object.freeze(T)}var k=!1;function A(){!k&&typeof console<"u"&&(k=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var b=0,E=function(){this instanceof E||A();var T=[],F=[],D=b++;function R(L,B){var O,G=C(L);return G?D in G?G[D]:B:(O=T.indexOf(L),O>=0?F[O]:B)}function P(L){var B=C(L);return B?D in B:T.indexOf(L)>=0}function z(L,B){var O,G=C(L);return G?G[D]=B:(O=T.indexOf(L),O>=0?F[O]=B:(O=T.length,F[O]=B,T[O]=L)),this}function I(L){var B=C(L),O,G;return B?D in B&&delete B[D]:(O=T.indexOf(L),O<0?!1:(G=T.length-1,T[O]=void 0,F[O]=F[G],T[O]=T[G],T.length=G,F.length=G,!0))}return Object.create(E.prototype,{get___:{value:w(R)},has___:{value:w(P)},set___:{value:w(z)},delete___:{value:w(I)}})};E.prototype=Object.create(Object.prototype,{get:{value:function(F,D){return this.get___(F,D)},writable:!0,configurable:!0},has:{value:function(F){return this.has___(F)},writable:!0,configurable:!0},set:{value:function(F,D){return this.set___(F,D)},writable:!0,configurable:!0},delete:{value:function(F){return this.delete___(F)},writable:!0,configurable:!0}}),typeof c=="function"?(function(){u&&typeof Proxy<"u"&&(Proxy=void 0);function T(){this instanceof E||A();var F=new c,D=void 0,R=!1;function P(B,O){return D?F.has(B)?F.get(B):D.get___(B,O):F.get(B,O)}function z(B){return F.has(B)||(D?D.has___(B):!1)}var I;u?I=function(B,O){return F.set(B,O),F.has(B)||(D||(D=new E),D.set(B,O)),this}:I=function(B,O){if(R)try{F.set(B,O)}catch{D||(D=new E),D.set___(B,O)}else F.set(B,O);return this};function L(B){var O=!!F.delete(B);return D&&D.delete___(B)||O}return Object.create(E.prototype,{get___:{value:w(P)},has___:{value:w(z)},set___:{value:w(I)},delete___:{value:w(L)},permitHostObjects___:{value:w(function(B){if(B===n)R=!0;else throw new Error("bogus call to permitHostObjects___")})}})}T.prototype=E.prototype,s.exports=T,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),s.exports=E)})()},236(s,l,n){var u=n(8284);s.exports=c;function c(){var f={};return function(h){if((typeof h!="object"||h===null)&&typeof h!="function")throw new Error("Weakmap-shim: Key must be object");var d=h.valueOf(f);return d&&d.identity===f?d:u(h,f)}}},8284(s){s.exports=l;function l(n,u){var c={identity:u},f=n.valueOf;return Object.defineProperty(n,"valueOf",{value:function(h){return h!==u?f.apply(this,arguments):c},writable:!0}),c}},606(s,l,n){var u=n(236);s.exports=c;function c(){var f=u();return{get:function(h,d){var p=f(h);return p.hasOwnProperty("value")?p.value:d},set:function(h,d){return f(h).value=d,this},has:function(h){return"value"in f(h)},delete:function(h){return delete f(h).value}}}},3349(s){"use strict";function l(){return function(d,p,g,m,y,_){var v=d[0],x=g[0],S=[0],M=x;m|=0;var C=0,w=x;for(C=0;C=0!=A>=0&&y.push(S[0]+.5+.5*(k+A)/(k-A))}m+=w,++S[0]}}}function n(){return l()}var u=n;function c(d){var p={};return function(m,y,_){var v=m.dtype,x=m.order,S=[v,x.join()].join(),M=p[S];return M||(p[S]=M=d([v,x])),M(m.shape.slice(0),m.data,m.stride,m.offset|0,y,_)}}function f(d){return c(u.bind(void 0,d))}function h(d){return f({funcName:d.funcName})}s.exports=h({funcName:"zeroCrossings"})},781(s,l,n){"use strict";s.exports=c;var u=n(3349);function c(f,h){var d=[];return h=+h||0,u(f.hi(f.shape[0]-1),d,h),d}},7790(){}};let i={};function a(s){let l=i[s];if(l!==void 0)return l.exports;let n=i[s]={id:s,loaded:!1,exports:{}};return t[s].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),a.nmd=s=>(s.paths=[],s.children||(s.children=[]),s);let o=a(3065);r.exports=o})()}}),Dp=de({"src/lib/str2rgbarray.js"(e,r){"use strict";var{normalize:t}=ta();function i(a){return a?t(a):[0,0,0,1]}r.exports=i}}),Lp=de({"src/lib/gl_format_color.js"(e,r){"use strict";var t=da(),i=ks(),a=ta(),o=Jo().defaultLine,s=Do().isArrayOrTypedArray,l=a.normalize(o),n=1;function u(p,g){return[p[0],p[1],p[2],p[3]*g]}function c(p){return t(p)||!a.isChannelArray(p)&&!a.isValid(p)?l:a.normalize(p)}function f(p){return t(p)?p:n}function h(p,g,m){var y=p.color;y&&y._inputArray&&(y=y._inputArray);var _=s(y),v=s(g),x=i.extractOpts(p),S=[],M,C,w,k,A;if(x.colorscale!==void 0?M=i.makeColorScaleFuncFromTrace(p):M=c,_?C=(E,T)=>E[T]===void 0?l:x.colorscale===void 0?M(E[T]):a.normalize(M(E[T])):C=c,v?w=function(E,T){return E[T]===void 0?n:f(E[T])}:w=f,_||v)for(var b=0;b0){var y=u.c2l(g);u._lowerLogErrorBound||(u._lowerLogErrorBound=y),u._lowerErrorBound=Math.min(u._lowerLogErrorBound,y)}}else f[h]=[-d[0]*n,d[1]*n]}return f}function a(s){for(var l=0;l-1?-1:F.indexOf("right")>-1?1:0}function S(F){return F==null?0:F.indexOf("top")>-1?-1:F.indexOf("bottom")>-1?1:0}function M(F){var D=0,R=0,P=[D,R];if(Array.isArray(F))for(var z=0;z=0){var G=_(B.position,B.delaunayColor,B.delaunayAxis);G.opacity=F.opacity,this.delaunayMesh?this.delaunayMesh.update(G):(G.gl=D,this.delaunayMesh=o(G),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},y.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function T(F,D){var R=new m(F,D.uid);return R.update(D),R}r.exports=T}}),XD=de({"src/traces/scatter3d/attributes.js"(e,r){"use strict";var t=tl(),i=us(),a=cs(),o=Ns().axisHoverFormat,{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:n}=Vo(),u=ri(),c=YD(),f=v4(),h=fn().extendFlat,d=Ps().overrideAll,p=(gv(),ti(c0)).default,g=t.line,m=t.marker,y=m.line,_=h({width:g.width,dash:{valType:"enumerated",values:p(c),dflt:"solid"}},a("line"));function v(S){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var x=r.exports=d({x:t.x,y:t.y,z:{valType:"data_array"},text:h({},t.text,{}),texttemplate:l(),texttemplatefallback:n({editType:"calc"}),hovertext:h({},t.hovertext,{}),hovertemplate:s(),hovertemplatefallback:n(),xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z"),mode:h({},t.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:v("x"),y:v("y"),z:v("z")},connectgaps:t.connectgaps,line:_,marker:h({symbol:{valType:"enumerated",values:p(f),dflt:"circle",arrayOk:!0},size:h({},m.size,{dflt:8}),sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode,opacity:h({},m.opacity,{arrayOk:!1}),colorbar:m.colorbar,line:h({width:h({},y.width,{arrayOk:!1})},a("marker.line"))},a("marker")),textposition:h({},t.textposition,{dflt:"top center"}),textfont:i({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:u.opacity,hoverinfo:h({},u.hoverinfo)},"calc","nested");x.x.editType=x.y.editType=x.z.editType="calc+clearAxisTypes"}}),rY=de({"src/traces/scatter3d/defaults.js"(e,r){"use strict";var t=Ma(),i=Qt(),a=bs(),o=Nh(),s=yd(),l=_d(),n=XD();r.exports=function(f,h,d,p){function g(C,w){return i.coerce(f,h,n,C,w)}var m=u(f,h,g,p);if(!m){h.visible=!1;return}g("text"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback"),g("xhoverformat"),g("yhoverformat"),g("zhoverformat"),g("mode"),a.hasMarkers(h)&&o(f,h,d,p,g,{noAngle:!0,noLineDash:!0,noSelect:!0}),a.hasLines(h)&&(g("connectgaps"),s(f,h,d,p,g)),a.hasText(h)&&(g("texttemplate"),g("texttemplatefallback"),l(f,h,p,g,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var y=(h.line||{}).color,_=(h.marker||{}).color;g("surfaceaxis")>=0&&g("surfacecolor",y||_);for(var v=["x","y","z"],x=0;x<3;++x){var S="projection."+v[x];g(S+".show")&&(g(S+".opacity"),g(S+".scale"))}var M=t.getComponentMethod("errorbars","supplyDefaults");M(f,h,y||_||d,{axis:"z"}),M(f,h,y||_||d,{axis:"y",inherit:"z"}),M(f,h,y||_||d,{axis:"x",inherit:"z"})};function u(c,f,h,d){var p=0,g=h("x"),m=h("y"),y=h("z"),_=t.getComponentMethod("calendars","handleTraceDefaults");return _(c,f,["x","y","z"],d),g&&m&&y&&(p=Math.min(g.length,m.length,y.length),f._length=f._xlength=f._ylength=f._zlength=p),p}}}),iY=de({"src/traces/scatter3d/calc.js"(e,r){"use strict";var t=Qd(),i=jh();r.exports=function(o,s){var l=[{x:!1,y:!1,trace:s,t:{}}];return t(l,s),i(o,s),l}}}),aY=de({"node_modules/get-canvas-context/index.js"(e,r){r.exports=t;function t(i,a){if(typeof i!="string")throw new TypeError("must specify type string");if(a=a||{},typeof document>"u"&&!a.canvas)return null;var o=a.canvas||document.createElement("canvas");typeof a.width=="number"&&(o.width=a.width),typeof a.height=="number"&&(o.height=a.height);var s=a,l;try{var n=[i];i.indexOf("webgl")===0&&n.push("experimental-"+i);for(var u=0;u/g," "));h[d]=y,p.tickmode=g}}u.ticks=h;for(var d=0;d<3;++d){o[d]=.5*(n.glplot.bounds[0][d]+n.glplot.bounds[1][d]);for(var _=0;_<2;++_)u.bounds[_][d]=n.glplot.bounds[_][d]}n.contourLevels=s(h)}}}),uY=de({"src/plots/gl3d/scene.js"(e,r){"use strict";var t=ku().gl_plot3d,i=t.createCamera,a=t.createScene,o=nY(),s=Mw(),l=Ma(),n=Qt(),u=n.preserveDrawingBuffer(),c=nn(),f=$s(),h=Dp(),d=ZD(),p=lk(),g=oY(),m=sY(),y=lY(),_=vd().applyAutorangeOptions,v,x,S=!1;function M(R,P){var z=document.createElement("div"),I=R.container;this.graphDiv=R.graphDiv;var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.style.position="absolute",L.style.top=L.style.left="0px",L.style.width=L.style.height="100%",L.style["z-index"]=20,L.style["pointer-events"]="none",z.appendChild(L),this.svgContainer=L,z.id=R.id,z.style.position="absolute",z.style.top=z.style.left="0px",z.style.width=z.style.height="100%",I.appendChild(z),this.fullLayout=P,this.id=R.id||"scene",this.fullSceneLayout=P[this.id],this.plotArgs=[[],{},{}],this.axesOptions=g(P,P[this.id]),this.spikeOptions=m(P[this.id]),this.container=z,this.staticMode=!!R.staticPlot,this.pixelRatio=this.pixelRatio||R.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=l.getComponentMethod("annotations3d","convert"),this.drawAnnotations=l.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var C=M.prototype;C.prepareOptions=function(){var R=this,P={canvas:R.canvas,gl:R.gl,glOptions:{preserveDrawingBuffer:u,premultipliedAlpha:!0,antialias:!0},container:R.container,axes:R.axesOptions,spikes:R.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:R.camera,pixelRatio:R.pixelRatio};if(R.staticMode){if(!x&&(v=document.createElement("canvas"),x=o({canvas:v,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!x))throw new Error("error creating static canvas/context for image server");P.gl=x,P.canvas=v}return P};var w=!0;C.tryCreatePlot=function(){var R=this,P=R.prepareOptions(),z=!0;try{R.glplot=a(P)}catch{if(R.staticMode||!w||u)z=!1;else{n.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{u=P.glOptions.preserveDrawingBuffer=!0,R.glplot=a(P)}catch{u=P.glOptions.preserveDrawingBuffer=!1,z=!1}}}return w=!1,z},C.initializeGLCamera=function(){var R=this,P=R.fullSceneLayout.camera,z=P.projection.type==="orthographic";R.camera=i(R.container,{center:[P.center.x,P.center.y,P.center.z],eye:[P.eye.x,P.eye.y,P.eye.z],up:[P.up.x,P.up.y,P.up.z],_ortho:z,zoomMin:.01,zoomMax:100,mode:"orbit"})},C.initializeGLPlot=function(){var R=this;R.initializeGLCamera();var P=R.tryCreatePlot();if(!P)return d(R);R.traces={},R.make4thDimension();var z=R.graphDiv,I=z.layout,L=function(){var O={};return R.isCameraChanged(I)&&(O[R.id+".camera"]=R.getCamera()),R.isAspectChanged(I)&&(O[R.id+".aspectratio"]=R.glplot.getAspectratio(),I[R.id].aspectmode!=="manual"&&(R.fullSceneLayout.aspectmode=I[R.id].aspectmode=O[R.id+".aspectmode"]="manual")),O},B=function(O){if(O.fullSceneLayout.dragmode!==!1){var G=L();O.saveLayout(I),O.graphDiv.emit("plotly_relayout",G)}};return R.glplot.canvas&&(R.glplot.canvas.addEventListener("mouseup",function(){B(R)}),R.glplot.canvas.addEventListener("touchstart",function(){S=!0}),R.glplot.canvas.addEventListener("wheel",function(O){if(z._context._scrollZoom.gl3d){if(R.camera._ortho){var G=O.deltaX>O.deltaY?1.1:.9090909090909091,W=R.glplot.getAspectratio();R.glplot.setAspectratio({x:G*W.x,y:G*W.y,z:G*W.z})}B(R)}},s?{passive:!1}:!1),R.glplot.canvas.addEventListener("mousemove",function(){if(R.fullSceneLayout.dragmode!==!1&&R.camera.mouseListener.buttons!==0){var O=L();R.graphDiv.emit("plotly_relayouting",O)}}),R.staticMode||R.glplot.canvas.addEventListener("webglcontextlost",function(O){z&&z.emit&&z.emit("plotly_webglcontextlost",{event:O,layer:R.id})},!1)),R.glplot.oncontextloss=function(){R.recoverContext()},R.glplot.onrender=function(){R.render()},!0},C.render=function(){var R=this,P=R.graphDiv,z,I=R.svgContainer,L=R.container.getBoundingClientRect();P._fullLayout._calcInverseTransform(P);var B=P._fullLayout._invScaleX,O=P._fullLayout._invScaleY,G=L.width*B,W=L.height*O;I.setAttributeNS(null,"viewBox","0 0 "+G+" "+W),I.setAttributeNS(null,"width",G),I.setAttributeNS(null,"height",W),y(R),R.glplot.axes.update(R.axesOptions);for(var X=Object.keys(R.traces),Z=null,J=R.glplot.selection,N=0;N")):z.type==="isosurface"||z.type==="volume"?(j.valueLabel=c.hoverLabelText(R._mockAxis,R._mockAxis.d2l(J.traceCoordinate[3]),z.valuehoverformat),ne.push("value: "+j.valueLabel),J.textLabel&&ne.push(J.textLabel),te=ne.join("
")):te=J.textLabel;var se={x:J.traceCoordinate[0],y:J.traceCoordinate[1],z:J.traceCoordinate[2],data:U._input,fullData:U,curveNumber:U.index,pointNumber:V};f.appendArrayPointValue(se,U,V),z._module.eventData&&(se=U._module.eventData(se,J,U,{},V));var le={points:[se]};if(R.fullSceneLayout.hovermode){var ce=[];f.loneHover({trace:U,x:(.5+.5*$[0]/$[3])*G,y:(.5-.5*$[1]/$[3])*W,xLabel:j.xLabel,yLabel:j.yLabel,zLabel:j.zLabel,text:te,name:Z.name,color:f.castHoverOption(U,V,"bgcolor")||Z.color,borderColor:f.castHoverOption(U,V,"bordercolor"),fontFamily:f.castHoverOption(U,V,"font.family"),fontSize:f.castHoverOption(U,V,"font.size"),fontColor:f.castHoverOption(U,V,"font.color"),nameLength:f.castHoverOption(U,V,"namelength"),textAlign:f.castHoverOption(U,V,"align"),hovertemplate:n.castOption(U,V,"hovertemplate"),hovertemplateLabels:n.extendFlat({},se,j),eventData:[se]},{container:I,gd:P,inOut_bbox:ce}),se.bbox=ce[0]}J.distance<5&&(J.buttons||S)?P.emit("plotly_click",le):P.emit("plotly_hover",le),this.oldEventData=le}else f.loneUnhover(I),this.oldEventData&&P.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;R.drawAnnotations(R)},C.recoverContext=function(){var R=this;R.glplot.dispose();var P=function(){if(R.glplot.gl.isContextLost()){requestAnimationFrame(P);return}if(!R.initializeGLPlot()){n.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}R.plot.apply(R,R.plotArgs)};requestAnimationFrame(P)};var k=["xaxis","yaxis","zaxis"];function A(R,P,z){for(var I=R.fullSceneLayout,L=0;L<3;L++){var B=k[L],O=B.charAt(0),G=I[B],W=P[O],X=P[O+"calendar"],Z=P["_"+O+"length"];if(!n.isArrayOrTypedArray(W))z[0][L]=Math.min(z[0][L],0),z[1][L]=Math.max(z[1][L],Z-1);else for(var J,N=0;N<(Z||W.length);N++)if(n.isArrayOrTypedArray(W[N]))for(var H=0;HU[1][O])U[0][O]=-1,U[1][O]=1;else{var xe=U[1][O]-U[0][O];U[0][O]-=xe/32,U[1][O]+=xe/32}if(q=[U[0][O],U[1][O]],q=_(q,W),U[0][O]=q[0],U[1][O]=q[1],W.isReversed()){var ye=U[0][O];U[0][O]=U[1][O],U[1][O]=ye}}else q=W.range,U[0][O]=W.r2l(q[0]),U[1][O]=W.r2l(q[1]);U[0][O]===U[1][O]&&(U[0][O]-=1,U[1][O]+=1),V[O]=U[1][O]-U[0][O],W.range=[U[0][O],U[1][O]],W.limitRange(),I.glplot.setBounds(O,{min:W.range[0]*H[O],max:W.range[1]*H[O]})}var fe,ae=Z.aspectmode;if(ae==="cube")fe=[1,1,1];else if(ae==="manual"){var ee=Z.aspectratio;fe=[ee.x,ee.y,ee.z]}else if(ae==="auto"||ae==="data"){var ie=[1,1,1];for(O=0;O<3;++O){W=Z[k[O]],X=W.type;var Q=j[X];ie[O]=Math.pow(Q.acc,1/Q.count)/H[O]}ae==="data"||Math.max.apply(null,ie)/Math.min.apply(null,ie)<=4?fe=ie:fe=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");Z.aspectratio.x=J.aspectratio.x=fe[0],Z.aspectratio.y=J.aspectratio.y=fe[1],Z.aspectratio.z=J.aspectratio.z=fe[2],I.glplot.setAspectratio(Z.aspectratio),I.viewInitial.aspectratio||(I.viewInitial.aspectratio={x:Z.aspectratio.x,y:Z.aspectratio.y,z:Z.aspectratio.z}),I.viewInitial.aspectmode||(I.viewInitial.aspectmode=Z.aspectmode);var ue=Z.domain||null,ge=P._size||null;if(ue&&ge){var Me=I.container.style;Me.position="absolute",Me.left=ge.l+ue.x[0]*ge.w+"px",Me.top=ge.t+(1-ue.y[1])*ge.h+"px",Me.width=ge.w*(ue.x[1]-ue.x[0])+"px",Me.height=ge.h*(ue.y[1]-ue.y[0])+"px"}I.glplot.redraw()}},C.destroy=function(){var R=this;R.glplot&&(R.camera.mouseListener.enabled=!1,R.container.removeEventListener("wheel",R.camera.wheelListener),R.camera=null,R.glplot.dispose(),R.container.parentNode.removeChild(R.container),R.glplot=null)};function E(R){return[[R.eye.x,R.eye.y,R.eye.z],[R.center.x,R.center.y,R.center.z],[R.up.x,R.up.y,R.up.z]]}function T(R){return{up:{x:R.up[0],y:R.up[1],z:R.up[2]},center:{x:R.center[0],y:R.center[1],z:R.center[2]},eye:{x:R.eye[0],y:R.eye[1],z:R.eye[2]},projection:{type:R._ortho===!0?"orthographic":"perspective"}}}C.getCamera=function(){var R=this;return R.camera.view.recalcMatrix(R.camera.view.lastT()),T(R.camera)},C.setViewport=function(R){var P=this,z=R.camera;P.camera.lookAt.apply(this,E(z)),P.glplot.setAspectratio(R.aspectratio);var I=z.projection.type==="orthographic",L=P.camera._ortho;I!==L&&(P.glplot.redraw(),P.glplot.clearRGBA(),P.glplot.dispose(),P.initializeGLPlot())},C.isCameraChanged=function(R){var P=this,z=P.getCamera(),I=n.nestedProperty(R,P.id+".camera"),L=I.get();function B(X,Z,J,N){var H=["up","center","eye"],$=["x","y","z"];return Z[H[J]]&&X[H[J]][$[N]]===Z[H[J]][$[N]]}var O=!1;if(L===void 0)O=!0;else{for(var G=0;G<3;G++)for(var W=0;W<3;W++)if(!B(z,L,G,W)){O=!0;break}(!L.projection||z.projection&&z.projection.type!==L.projection.type)&&(O=!0)}return O},C.isAspectChanged=function(R){var P=this,z=P.glplot.getAspectratio(),I=n.nestedProperty(R,P.id+".aspectratio"),L=I.get();return L===void 0||L.x!==z.x||L.y!==z.y||L.z!==z.z},C.saveLayout=function(R){var P=this,z=P.fullLayout,I,L,B,O,G,W,X=P.isCameraChanged(R),Z=P.isAspectChanged(R),J=X||Z;if(J){var N={};if(X&&(I=P.getCamera(),L=n.nestedProperty(R,P.id+".camera"),B=L.get(),N[P.id+".camera"]=B),Z&&(O=P.glplot.getAspectratio(),G=n.nestedProperty(R,P.id+".aspectratio"),W=G.get(),N[P.id+".aspectratio"]=W),l.call("_storeDirectGUIEdit",R,z._preGUI,N),X){L.set(I);var H=n.nestedProperty(z,P.id+".camera");H.set(I)}if(Z){G.set(O);var $=n.nestedProperty(z,P.id+".aspectratio");$.set(O),P.glplot.redraw()}}return J},C.updateFx=function(R,P){var z=this,I=z.camera;if(I)if(R==="orbit")I.mode="orbit",I.keyBindingMode="rotate";else if(R==="turntable"){I.up=[0,0,1],I.mode="turntable",I.keyBindingMode="rotate";var L=z.graphDiv,B=L._fullLayout,O=z.fullSceneLayout.camera,G=O.up.x,W=O.up.y,X=O.up.z;if(X/Math.sqrt(G*G+W*W+X*X)<.999){var Z=z.id+".camera.up",J={x:0,y:0,z:1},N={};N[Z]=J;var H=L.layout;l.call("_storeDirectGUIEdit",H,B._preGUI,N),O.up=J,n.nestedProperty(H,Z).set(J)}}else I.keyBindingMode=R;z.fullSceneLayout.hovermode=P};function F(R,P,z){for(var I=0,L=z-1;I0)for(var G=255/O,W=0;W<3;++W)R[B+W]=Math.min(G*R[B+W],255)}}C.toImage=function(R){var P=this;R||(R="png"),P.staticMode&&P.container.appendChild(v),P.glplot.redraw();var z=P.glplot.gl,I=z.drawingBufferWidth,L=z.drawingBufferHeight;z.bindFramebuffer(z.FRAMEBUFFER,null);var B=new Uint8Array(I*L*4);z.readPixels(0,0,I,L,z.RGBA,z.UNSIGNED_BYTE,B),F(B,I,L),D(B,I,L);var O=document.createElement("canvas");O.width=I,O.height=L;var G=O.getContext("2d",{willReadFrequently:!0}),W=G.createImageData(I,L);W.data.set(B),G.putImageData(W,0,0);var X;switch(R){case"jpeg":X=O.toDataURL("image/jpeg");break;case"webp":X=O.toDataURL("image/webp");break;default:X=O.toDataURL("image/png")}return P.staticMode&&P.container.removeChild(v),X},C.setConvert=function(){for(var R=this,P=0;P<3;P++){var z=R.fullSceneLayout[k[P]];c.setConvert(z,R.fullLayout),z.setScale=n.noop}},C.make4thDimension=function(){var R=this,P=R.graphDiv,z=P._fullLayout;R._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(R._mockAxis,z)},r.exports=M}}),cY=de({"src/plots/gl3d/layout/attributes.js"(e,r){"use strict";r.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),KD=de({"src/plots/gl3d/layout/axis_attributes.js"(e,r){"use strict";var t=ta(),i=Mu(),a=fn().extendFlat,o=Ps().overrideAll;r.exports=o({visible:i.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:t.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:i.color,categoryorder:i.categoryorder,categoryarray:i.categoryarray,title:{text:i.title.text,font:i.title.font},type:a({},i.type,{values:["-","linear","log","date","category"]}),autotypenumbers:i.autotypenumbers,autorange:i.autorange,autorangeoptions:{minallowed:i.autorangeoptions.minallowed,maxallowed:i.autorangeoptions.maxallowed,clipmin:i.autorangeoptions.clipmin,clipmax:i.autorangeoptions.clipmax,include:i.autorangeoptions.include,editType:"plot"},rangemode:i.rangemode,minallowed:i.minallowed,maxallowed:i.maxallowed,range:a({},i.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:i.minor.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,mirror:i.mirror,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,labelalias:i.labelalias,tickfont:i.tickfont,tickangle:i.tickangle,tickprefix:i.tickprefix,showtickprefix:i.showtickprefix,ticksuffix:i.ticksuffix,showticksuffix:i.showticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:a({},i.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth},"plot","from-root")}}),JD=de({"src/plots/gl3d/layout/layout_attributes.js"(e,r){"use strict";var t=KD(),i=Is().attributes,a=fn().extendFlat,o=Qt().counterRegex;function s(l,n,u){return{x:{valType:"number",dflt:l,editType:"camera"},y:{valType:"number",dflt:n,editType:"camera"},z:{valType:"number",dflt:u,editType:"camera"},editType:"camera"}}r.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:t,yaxis:t,zaxis:t,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),fY=de({"src/plots/gl3d/layout/axis_defaults.js"(e,r){"use strict";var t=ta(),i=Qt(),a=Ro(),o=KD(),s=ok(),l=zy(),n=["xaxis","yaxis","zaxis"],u=13600/187;r.exports=function(f,h,d){var p,g;function m(v,x){return i.coerce(p,g,o,v,x)}for(var y=0;y1;function m(y){if(!g){var _=t.validate(h[y],l[y]);if(_)return h[y]}}o(h,d,p,{type:u,attributes:l,handleDefaults:c,fullLayout:d,font:d.font,fullData:p,getDfltFromLayout:m,autotypenumbersDflt:d.autotypenumbers,paper_bgcolor:d.paper_bgcolor,calendar:d.calendar})};function c(f,h,d,p){for(var g=d("bgcolor"),m=i.combine(g,p.paper_bgcolor),y=["up","center","eye"],_=0;_.999)&&(C="turntable")}else C="turntable";d("dragmode",C),d("hovermode",p.getDfltFromLayout("hovermode"))}}}),S0=de({"src/plots/gl3d/index.js"(e){"use strict";var r=Ps().overrideAll,t=La(),i=uY(),a=$u().getSubplotData,o=Qt(),s=Oh(),l="gl3d",n="scene";e.name=l,e.attr=n,e.idRoot=n,e.idRegex=e.attrRegex=o.counterRegex("scene"),e.attributes=cY(),e.layoutAttributes=JD(),e.baseLayoutAttrOverrides=r({hoverlabel:t.hoverlabel},"plot","nested"),e.supplyLayoutDefaults=hY(),e.plot=function(c){for(var f=c._fullLayout,h=c._fullData,d=f._subplots[l],p=0;p0){F=p[D];break}return F}function _(E,T){if(!(E<1||T<1)){for(var F=m(E),D=m(T),R=1,P=0;PM;)D--,D/=y(D),D++,D1?R:1};function C(E,T,F){var D=F[8]+F[2]*T[0]+F[5]*T[1];return E[0]=(F[6]+F[0]*T[0]+F[3]*T[1])/D,E[1]=(F[7]+F[1]*T[0]+F[4]*T[1])/D,E}function w(E,T,F){return k(E,T,C,F),E}function k(E,T,F,D){for(var R=[0,0],P=E.shape[0],z=E.shape[1],I=0;I0&&this.contourStart[D]!==null&&this.contourEnd[D]!==null&&this.contourEnd[D]>this.contourStart[D]))for(T[D]=!0,R=this.contourStart[D];RW&&(this.minValues[B]=W),this.maxValues[B]p&&(u.isomin=null,u.isomax=null);var g=h("x"),m=h("y"),y=h("z"),_=h("value");if(!g||!g.length||!m||!m.length||!y||!y.length||!_||!_.length){u.visible=!1;return}var v=i.getComponentMethod("calendars","handleTraceDefaults");v(n,u,["x","y","z"],f),h("valuehoverformat"),["x","y","z"].forEach(function(C){h(C+"hoverformat");var w="caps."+C,k=h(w+".show");k&&h(w+".fill");var A="slices."+C,b=h(A+".show");b&&(h(A+".fill"),h(A+".locations"))});var x=h("spaceframe.show");x&&h("spaceframe.fill");var S=h("surface.show");S&&(h("surface.count"),h("surface.fill"),h("surface.pattern"));var M=h("contour.show");M&&(h("contour.color"),h("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(C){h(C)}),o(n,u,f,h,{prefix:"",cLetter:"c"}),u._length=null}r.exports={supplyDefaults:s,supplyIsoDefaults:l}}}),g4=de({"src/traces/streamtube/calc.js"(e,r){"use strict";var t=Qt(),i=hc();function a(n,u){u._len=Math.min(u.u.length,u.v.length,u.w.length,u.x.length,u.y.length,u.z.length),u._u=l(u.u,u._len),u._v=l(u.v,u._len),u._w=l(u.w,u._len),u._x=l(u.x,u._len),u._y=l(u.y,u._len),u._z=l(u.z,u._len);var c=o(u);u._gridFill=c.fill,u._Xs=c.Xs,u._Ys=c.Ys,u._Zs=c.Zs,u._len=c.len;var f=0,h,d,p;u.starts&&(h=l(u.starts.x||[]),d=l(u.starts.y||[]),p=l(u.starts.z||[]),f=Math.min(h.length,d.length,p.length)),u._startsX=h||[],u._startsY=d||[],u._startsZ=p||[];var g=0,m=1/0,y;for(y=0;y1&&(b=u[h-1],T=c[h-1],D=f[h-1]),d=0;db?"-":"+")+"x"),M=M.replace("y",(E>T?"-":"+")+"y"),M=M.replace("z",(F>D?"-":"+")+"z");var I=function(){h=0,R=[],P=[],z=[]};(!h||h0;m--){var y=Math.min(g[m],g[m-1]),_=Math.max(g[m],g[m-1]);if(_>y&&y-1}function Y(lt,qe){return lt===null?qe:lt}function K(lt,qe,Ye){X();var me=[qe],_e=[Ye];if(U>=1)me=[qe],_e=[Ye];else if(U>0){var Ae=j(qe,Ye);me=Ae.xyzv,_e=Ae.abc}for(var ke=0;ke-1?Ye[De]:W(Je,Ue,at);ft>-1?Ee[De]=ft:Ee[De]=J(Je,Ue,at,Y(lt,rt))}N(Ee[0],Ee[1],Ee[2])}}function te(lt,qe,Ye){var me=function(_e,Ae,ke){K(lt,[qe[_e],qe[Ae],qe[ke]],[Ye[_e],Ye[Ae],Ye[ke]])};me(0,1,2),me(2,3,0)}function ne(lt,qe,Ye){var me=function(_e,Ae,ke){K(lt,[qe[_e],qe[Ae],qe[ke]],[Ye[_e],Ye[Ae],Ye[ke]])};me(0,1,2),me(3,0,1),me(2,3,0),me(1,2,3)}function se(lt,qe,Ye,me){var _e=lt[3];_eme&&(_e=me);for(var Ae=(lt[3]-_e)/(lt[3]-qe[3]+1e-9),ke=[],Ee=0;Ee<4;Ee++)ke[Ee]=(1-Ae)*lt[Ee]+Ae*qe[Ee];return ke}function le(lt,qe,Ye){return lt>=qe&<<=Ye}function ce(lt){var qe=.001*(I-z);return lt>=z-qe&<<=I+qe}function pe(lt){for(var qe=[],Ye=0;Ye<4;Ye++){var me=lt[Ye];qe.push([p._x[me],p._y[me],p._z[me],p._value[me]])}return qe}var xe=3;function ye(lt,qe,Ye,me,_e,Ae){Ae||(Ae=1),Ye=[-1,-1,-1];var ke=!1,Ee=[le(qe[0][3],me,_e),le(qe[1][3],me,_e),le(qe[2][3],me,_e)];if(!Ee[0]&&!Ee[1]&&!Ee[2])return!1;var De=function(Ue,at,rt){return ce(at[0][3])&&ce(at[1][3])&&ce(at[2][3])?(K(Ue,at,rt),!0):AeEe?[R,Ae]:[Ae,P];Ze(qe,De[0],De[1])}}var Je=[[Math.min(z,P),Math.max(z,P)],[Math.min(R,I),Math.max(R,I)]];["x","y","z"].forEach(function(Ue){for(var at=[],rt=0;rt0&&(gt.push(Lt.id),Ue==="x"?yt.push([Lt.distRatio,0,0]):Ue==="y"?yt.push([0,Lt.distRatio,0]):yt.push([0,0,Lt.distRatio]))}else Ue==="x"?fr=Pt(1,b-1):Ue==="y"?fr=Pt(1,E-1):fr=Pt(1,T-1);gt.length>0&&(Ue==="x"?at[ft]=Ke(lt,gt,At,ht,yt,at[ft]):Ue==="y"?at[ft]=vt(lt,gt,At,ht,yt,at[ft]):at[ft]=xt(lt,gt,At,ht,yt,at[ft]),ft++),fr.length>0&&(Ue==="x"?at[ft]=ge(lt,fr,At,ht,at[ft]):Ue==="y"?at[ft]=Me(lt,fr,At,ht,at[ft]):at[ft]=Te(lt,fr,At,ht,at[ft]),ft++)}var Ct=p.caps[Ue];Ct.show&&Ct.fill&&(V(Ct.fill),Ue==="x"?at[ft]=ge(lt,[0,b-1],At,ht,at[ft]):Ue==="y"?at[ft]=Me(lt,[0,E-1],At,ht,at[ft]):at[ft]=Te(lt,[0,T-1],At,ht,at[ft]),ft++)}}),S===0&&Z(),p._meshX=L,p._meshY=B,p._meshZ=O,p._meshIntensity=G,p._Xs=w,p._Ys=k,p._Zs=A}return Mt(),p}function d(p,g){var m=p.glplot.gl,y=t({gl:m}),_=new u(p,y,g.uid);return y._trace=_,_.update(g),p.glplot.add(y),_}r.exports={findNearestOnAxis:n,generateIsoMeshes:h,createIsosurfaceTrace:d}}}),_Y=de({"src/traces/isosurface/index.js"(e,r){"use strict";r.exports={attributes:m4(),supplyDefaults:e7().supplyDefaults,calc:t7(),colorbar:{min:"cmin",max:"cmax"},plot:y4().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:S0(),categories:["gl3d","showLegend"],meta:{}}}}),xY=de({"lib/isosurface.js"(e,r){"use strict";r.exports=_Y()}}),r7=de({"src/traces/volume/attributes.js"(e,r){"use strict";var t=cs(),i=m4(),a=v_(),o=ri(),s=fn().extendFlat,l=Ps().overrideAll,n=r.exports=l(s({x:i.x,y:i.y,z:i.z,value:i.value,isomin:i.isomin,isomax:i.isomax,surface:i.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:i.slices,caps:i.caps,text:i.text,hovertext:i.hovertext,xhoverformat:i.xhoverformat,yhoverformat:i.yhoverformat,zhoverformat:i.zhoverformat,valuehoverformat:i.valuehoverformat,hovertemplate:i.hovertemplate,hovertemplatefallback:i.hovertemplatefallback},t("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:i.colorbar,opacity:i.opacity,opacityscale:a.opacityscale,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");n.x.editType=n.y.editType=n.z.editType=n.value.editType="calc+clearAxisTypes"}}),bY=de({"src/traces/volume/defaults.js"(e,r){"use strict";var t=Qt(),i=r7(),a=e7().supplyIsoDefaults,o=QD().opacityscaleDefaults;r.exports=function(l,n,u,c){function f(h,d){return t.coerce(l,n,i,h,d)}a(l,n,u,c,f),o(l,n,c,f)}}}),wY=de({"src/traces/volume/convert.js"(e,r){"use strict";var t=ku().gl_mesh3d,i=Lp().parseColorScale,a=Qt().isArrayOrTypedArray,o=Dp(),s=ks().extractOpts,l=I1(),n=y4().findNearestOnAxis,u=y4().generateIsoMeshes;function c(d,p,g){this.scene=d,this.uid=g,this.mesh=p,this.name="",this.data=null,this.showContour=!1}var f=c.prototype;f.handlePick=function(d){if(d.object===this.mesh){var p=d.data.index,g=this.data._meshX[p],m=this.data._meshY[p],y=this.data._meshZ[p],_=this.data._Ys.length,v=this.data._Zs.length,x=n(g,this.data._Xs).id,S=n(m,this.data._Ys).id,M=n(y,this.data._Zs).id,C=d.index=M+v*S+v*_*x;d.traceCoordinate=[this.data._meshX[C],this.data._meshY[C],this.data._meshZ[C],this.data._value[C]];var w=this.data.hovertext||this.data.text;return a(w)&&w[C]!==void 0?d.textLabel=w[C]:w&&(d.textLabel=w),!0}},f.update=function(d){var p=this.scene,g=p.fullSceneLayout;this.data=u(d);function m(S,M,C,w){return M.map(function(k){return S.d2l(k,0,w)*C})}var y=l(m(g.xaxis,d._meshX,p.dataScale[0],d.xcalendar),m(g.yaxis,d._meshY,p.dataScale[1],d.ycalendar),m(g.zaxis,d._meshZ,p.dataScale[2],d.zcalendar)),_=l(d._meshI,d._meshJ,d._meshK),v={positions:y,cells:_,lightPosition:[d.lightposition.x,d.lightposition.y,d.lightposition.z],ambient:d.lighting.ambient,diffuse:d.lighting.diffuse,specular:d.lighting.specular,roughness:d.lighting.roughness,fresnel:d.lighting.fresnel,vertexNormalsEpsilon:d.lighting.vertexnormalsepsilon,faceNormalsEpsilon:d.lighting.facenormalsepsilon,opacity:d.opacity,opacityscale:d.opacityscale,contourEnable:d.contour.show,contourColor:o(d.contour.color).slice(0,3),contourWidth:d.contour.width,useFacetNormals:d.flatshading},x=s(d);v.vertexIntensity=d._meshIntensity,v.vertexIntensityBounds=[x.min,x.max],v.colormap=i(d),this.mesh.update(v)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function h(d,p){var g=d.glplot.gl,m=t({gl:g}),y=new c(d,m,p.uid);return m._trace=y,y.update(p),d.glplot.add(m),y}r.exports=h}}),TY=de({"src/traces/volume/index.js"(e,r){"use strict";r.exports={attributes:r7(),supplyDefaults:bY(),calc:t7(),colorbar:{min:"cmin",max:"cmax"},plot:wY(),moduleType:"trace",name:"volume",basePlotModule:S0(),categories:["gl3d","showLegend"],meta:{}}}}),AY=de({"lib/volume.js"(e,r){"use strict";r.exports=TY()}}),MY=de({"src/traces/mesh3d/defaults.js"(e,r){"use strict";var t=Ma(),i=Qt(),a=hu(),o=P1();r.exports=function(l,n,u,c){function f(m,y){return i.coerce(l,n,o,m,y)}function h(m){var y=m.map(function(_){var v=f(_);return v&&i.isArrayOrTypedArray(v)?v:null});return y.every(function(_){return _&&_.length===y[0].length})&&y}var d=h(["x","y","z"]);if(!d){n.visible=!1;return}if(h(["i","j","k"]),n.i&&(!n.j||!n.k)||n.j&&(!n.k||!n.i)||n.k&&(!n.i||!n.j)){n.visible=!1;return}var p=t.getComponentMethod("calendars","handleTraceDefaults");p(l,n,["x","y","z"],c),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(m){f(m)});var g=f("contour.show");g&&(f("contour.color"),f("contour.width")),"intensity"in l?(f("intensity"),f("intensitymode"),a(l,n,c,f,{prefix:"",cLetter:"c"})):(n.showscale=!1,"facecolor"in l?f("facecolor"):"vertexcolor"in l?f("vertexcolor"):f("color",u)),f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),n._length=null}}}),SY=de({"src/traces/mesh3d/calc.js"(e,r){"use strict";var t=hc();r.exports=function(a,o){o.intensity&&t(a,o,{vals:o.intensity,containerStr:"",cLetter:"c"})}}}),EY=de({"src/traces/mesh3d/convert.js"(e,r){"use strict";var t=ku().gl_mesh3d,i=ku().delaunay_triangulate,a=ku().alpha_shape,o=ku().convex_hull,s=Lp().parseColorScale,l=Qt().isArrayOrTypedArray,n=Dp(),u=ks().extractOpts,c=I1();function f(v,x,S){this.scene=v,this.uid=S,this.mesh=x,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;h.handlePick=function(v){if(v.object===this.mesh){var x=v.index=v.data.index;v.data._cellCenter?v.traceCoordinate=v.data.dataCoordinate:v.traceCoordinate=[this.data.x[x],this.data.y[x],this.data.z[x]];var S=this.data.hovertext||this.data.text;return l(S)&&S[x]!==void 0?v.textLabel=S[x]:S&&(v.textLabel=S),!0}};function d(v){for(var x=[],S=v.length,M=0;M=x-.5)return!1;return!0}h.update=function(v){var x=this.scene,S=x.fullSceneLayout;this.data=v;var M=v.x.length,C=c(p(S.xaxis,v.x,x.dataScale[0],v.xcalendar),p(S.yaxis,v.y,x.dataScale[1],v.ycalendar),p(S.zaxis,v.z,x.dataScale[2],v.zcalendar)),w;if(v.i&&v.j&&v.k){if(v.i.length!==v.j.length||v.j.length!==v.k.length||!y(v.i,M)||!y(v.j,M)||!y(v.k,M))return;w=c(g(v.i),g(v.j),g(v.k))}else v.alphahull===0?w=o(C):v.alphahull>0?w=a(v.alphahull,C):w=m(v.delaunayaxis,C);var k={positions:C,cells:w,lightPosition:[v.lightposition.x,v.lightposition.y,v.lightposition.z],ambient:v.lighting.ambient,diffuse:v.lighting.diffuse,specular:v.lighting.specular,roughness:v.lighting.roughness,fresnel:v.lighting.fresnel,vertexNormalsEpsilon:v.lighting.vertexnormalsepsilon,faceNormalsEpsilon:v.lighting.facenormalsepsilon,opacity:v.opacity,contourEnable:v.contour.show,contourColor:n(v.contour.color).slice(0,3),contourWidth:v.contour.width,useFacetNormals:v.flatshading};if(v.intensity){var A=u(v);this.color="#fff";var b=v.intensitymode;k[b+"Intensity"]=v.intensity,k[b+"IntensityBounds"]=[A.min,A.max],k.colormap=s(v)}else v.vertexcolor?(this.color=v.vertexcolor[0],k.vertexColors=d(v.vertexcolor)):v.facecolor?(this.color=v.facecolor[0],k.cellColors=d(v.facecolor)):(this.color=v.color,k.meshColor=n(v.color));this.mesh.update(k)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function _(v,x){var S=v.glplot.gl,M=t({gl:S}),C=new f(v,M,x.uid);return M._trace=C,C.update(x),v.glplot.add(M),C}r.exports=_}}),kY=de({"src/traces/mesh3d/index.js"(e,r){"use strict";r.exports={attributes:P1(),supplyDefaults:MY(),calc:SY(),colorbar:{min:"cmin",max:"cmax"},plot:EY(),moduleType:"trace",name:"mesh3d",basePlotModule:S0(),categories:["gl3d","showLegend"],meta:{}}}}),CY=de({"lib/mesh3d.js"(e,r){"use strict";r.exports=kY()}}),i7=de({"src/traces/cone/attributes.js"(e,r){"use strict";var t=cs(),i=Ns().axisHoverFormat,{hovertemplateAttrs:a,templatefallbackAttrs:o}=Vo(),s=P1(),l=ri(),n=fn().extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:o({editType:"calc"}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:n({},l.showlegend,{dflt:!1})};n(u,t("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var c=["opacity","lightposition","lighting"];c.forEach(function(f){u[f]=s[f]}),u.hoverinfo=n({},l.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),r.exports=u}}),DY=de({"src/traces/cone/defaults.js"(e,r){"use strict";var t=Qt(),i=hu(),a=i7();r.exports=function(s,l,n,u){function c(_,v){return t.coerce(s,l,a,_,v)}var f=c("u"),h=c("v"),d=c("w"),p=c("x"),g=c("y"),m=c("z");if(!f||!f.length||!h||!h.length||!d||!d.length||!p||!p.length||!g||!g.length||!m||!m.length){l.visible=!1;return}var y=c("sizemode");c("sizeref",y==="raw"?1:.5),c("anchor"),c("lighting.ambient"),c("lighting.diffuse"),c("lighting.specular"),c("lighting.roughness"),c("lighting.fresnel"),c("lightposition.x"),c("lightposition.y"),c("lightposition.z"),i(s,l,u,c,{prefix:"",cLetter:"c"}),c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("uhoverformat"),c("vhoverformat"),c("whoverformat"),c("xhoverformat"),c("yhoverformat"),c("zhoverformat"),l._length=null}}}),LY=de({"src/traces/cone/calc.js"(e,r){"use strict";var t=hc();r.exports=function(a,o){for(var s=o.u,l=o.v,n=o.w,u=Math.min(o.x.length,o.y.length,o.z.length,s.length,l.length,n.length),c=-1/0,f=1/0,h=0;h2?y=g.slice(1,m-1):m===2?y=[(g[0]+g[1])/2]:y=g,y}function h(g){var m=g.length;return m===1?[.5,.5]:[g[1]-g[0],g[m-1]-g[m-2]]}function d(g,m){var y=g.fullSceneLayout,_=g.dataScale,v=m._len,x={};function S(J,N){var H=y[N],$=_[n[N]];return a.simpleMap(J,function(U){return H.d2l(U)*$})}if(x.vectors=l(S(m._u,"xaxis"),S(m._v,"yaxis"),S(m._w,"zaxis"),v),!v)return{positions:[],cells:[]};var M=S(m._Xs,"xaxis"),C=S(m._Ys,"yaxis"),w=S(m._Zs,"zaxis");x.meshgrid=[M,C,w],x.gridFill=m._gridFill;var k=m._slen;if(k)x.startingPositions=l(S(m._startsX,"xaxis"),S(m._startsY,"yaxis"),S(m._startsZ,"zaxis"));else{for(var A=C[0],b=f(M),E=f(w),T=new Array(b.length*E.length),F=0,D=0;DA&&(A=F[0]),F[1]b&&(b=F[1])}function T(F){switch(F.type){case"GeometryCollection":F.geometries.forEach(T);break;case"Point":E(F.coordinates);break;case"MultiPoint":F.coordinates.forEach(E);break}}S.arcs.forEach(function(F){for(var D=-1,R=F.length,P;++DA&&(A=P[0]),P[1]b&&(b=P[1])});for(C in S.objects)T(S.objects[C]);return[w,k,A,b]}function s(S,M){for(var C,w=S.length,k=w-M;k<--w;)C=S[k],S[k++]=S[w],S[w]=C}function l(S,M){return typeof M=="string"&&(M=S.objects[M]),M.type==="GeometryCollection"?{type:"FeatureCollection",features:M.geometries.map(function(C){return n(S,C)})}:n(S,M)}function n(S,M){var C=M.id,w=M.bbox,k=M.properties==null?{}:M.properties,A=u(S,M);return C==null&&w==null?{type:"Feature",properties:k,geometry:A}:w==null?{type:"Feature",id:C,properties:k,geometry:A}:{type:"Feature",id:C,bbox:w,properties:k,geometry:A}}function u(S,M){var C=a(S.transform),w=S.arcs;function k(D,R){R.length&&R.pop();for(var P=w[D<0?~D:D],z=0,I=P.length;z1)w=d(S,M,C);else for(k=0,w=new Array(A=S.arcs.length);k1)for(var R=1,P=E(F[0]),z,I;RP&&(I=F[0],F[0]=F[R],F[R]=I,P=z);return F}).filter(function(T){return T.length>0})}}function y(S,M){for(var C=0,w=S.length;C>>1;S[k]=2))throw new Error("n must be \u22652");T=S.bbox||o(S);var C=T[0],w=T[1],k=T[2],A=T[3],b;M={scale:[k-C?(k-C)/(b-1):1,A-w?(A-w)/(b-1):1],translate:[C,w]}}else T=S.bbox;var E=v(M),T,F,D=S.objects,R={};function P(L){return E(L)}function z(L){var B;switch(L.type){case"GeometryCollection":B={type:"GeometryCollection",geometries:L.geometries.map(z)};break;case"Point":B={type:"Point",coordinates:P(L.coordinates)};break;case"MultiPoint":B={type:"MultiPoint",coordinates:L.coordinates.map(P)};break;default:return L}return L.id!=null&&(B.id=L.id),L.bbox!=null&&(B.bbox=L.bbox),L.properties!=null&&(B.properties=L.properties),B}function I(L){var B=0,O=1,G=L.length,W,X=new Array(G);for(X[0]=E(L[0],0);++B0&&(o.push(s),s=[])}return s.length>0&&o.push(s),o},e.makeLine=function(t){return t.length===1?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},e.makePolygon=function(t){if(t.length===1)return{type:"Polygon",coordinates:t};for(var i=new Array(t.length),a=0;a{for(var S in x)t(v,S,{get:x[S],enumerable:!0})},l=(v,x,S,M)=>{if(x&&typeof x=="object"||typeof x=="function")for(let C of a(x))!o.call(v,C)&&C!==S&&t(v,C,{get:()=>x[C],enumerable:!(M=i(x,C))||M.enumerable});return v},n=v=>l(t({},"__esModule",{value:!0}),v),u={};s(u,{COUNTRIES:()=>c,byAlpha2:()=>y,byAlpha3:()=>m,byM49:()=>_,createLookup:()=>h,lookup:()=>p,lookupAlpha3:()=>g,sanitize:()=>f}),r.exports=n(u);var c=[{iso3:"ABW",iso2:"AW",m49:"533",name:"Aruba",aliases:["\u{1F1E6}\u{1F1FC}","country of aruba","land aruba","pais aruba"]},{iso3:"AFG",iso2:"AF",m49:"004",name:"Afghanistan",aliases:["\u{1F1E6}\u{1F1EB}","affghanistan","affghanisthan","affghaunistan","afghania","afghanisthan","afghaunistan","afghaunistaun","afgoniston","de afghanistan islami jumhuriyat","owganystan","\u0430\u0444\u0493\u043E\u043D\u0438\u0441\u0442\u043E\u043D","\u0623\u0641\u063A\u0627\u0646\u0633\u062A\u0627\u0646","\u0627\u0641\u063A\u0627\u0646\u0633\u062A\u0627\u0646","\u062F \u0627\u0641\u063A\u0627\u0646\u0633\u062A\u0627\u0646 \u0627\u0633\u0644\u0627\u0645\u06CC \u062C\u0645\u0647\u0648\u0631\u06CC\u062A"]},{iso3:"AGO",iso2:"AO",m49:"024",name:"Angola",aliases:["\u{1F1E6}\u{1F1F4}","republic of angola","republica de angola"]},{iso3:"AIA",iso2:"AI",m49:"660",name:"Anguilla",aliases:["\u{1F1E6}\u{1F1EE}","malliouhana"]},{iso3:"ALA",iso2:"AX",m49:"248",name:"\xC5land Islands",aliases:["\u{1F1E6}\u{1F1FD}","aaland","aaland islands","ahvenanmaa","aland","aland isles","aland region","alands lan","landskapet aland"]},{iso3:"ALB",iso2:"AL",m49:"008",name:"Albania",aliases:["\u{1F1E6}\u{1F1F1}","peoples republic of albania","peoples socialist republic of albania","republic of albania","republika e shqiperise","shqiperi","shqiperia","shqiperise","socialist republic of albania"]},{iso3:"AND",iso2:"AD",m49:"020",name:"Andorra",aliases:["\u{1F1E6}\u{1F1E9}","el pais dels pirineus","les valls dandorra","principality of andorra","principality of the valleys of andorra","principat dandorra","valls dandorra"]},{iso3:"ARE",iso2:"AE",m49:"784",name:"United Arab Emirates",aliases:["\u{1F1E6}\u{1F1EA}","emirates","uae","\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062A","\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062A \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0645\u062A\u062D\u062F\u0629","\u0627\u0644\u0627\u0645\u0627\u0631\u0627\u062A","\u0627\u0644\u0627\u0645\u0627\u0631\u0627\u062A \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0645\u062A\u062D\u062F\u0629","\u062F\u0648\u0644\u0629 \u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062A \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0645\u062A\u062D\u062F\u0629"]},{iso3:"ARG",iso2:"AR",m49:"032",name:"Argentina",aliases:["\u{1F1E6}\u{1F1F7}","argentine republic","nacion argentina","republic of argentina","republica argentina"]},{iso3:"ARM",iso2:"AM",m49:"051",name:"Armenia",aliases:["\u{1F1E6}\u{1F1F2}","hayastan","hayastani hanrapetutyun","republic of armenia","\u0570\u0561\u0575\u0561\u057D\u057F\u0561\u0576","\u0570\u0561\u0575\u0561\u057D\u057F\u0561\u0576\u056B \u0570\u0561\u0576\u0580\u0561\u057A\u0565\u057F\u0578\u0582\u0569\u0575\u0578\u0582\u0576","\u0570\u0561\u0575\u0584","\u0570\u0570"]},{iso3:"ASM",iso2:"AS",m49:"016",name:"American Samoa",aliases:["\u{1F1E6}\u{1F1F8}","amerika samoa","east samoa","samoa american","samoa united states","territory of american samoa","us samoa"]},{iso3:"ATA",iso2:"AQ",m49:"010",name:"Antarctica",aliases:["\u{1F1E6}\u{1F1F6}","antarctica treaty area"]},{iso3:"ATF",iso2:"TF",m49:"260",name:"French Southern Territories",aliases:["\u{1F1F9}\u{1F1EB}","taaf","terres australes et antarctiques francaises","terres australes francaises","terres australes francaises les","territoire des terres australes et antarctiques francaises"]},{iso3:"ATG",iso2:"AG",m49:"028",name:"Antigua and Barbuda",aliases:["\u{1F1E6}\u{1F1EC}","antigua","antigua barbuda","barbuda"]},{iso3:"AUS",iso2:"AU",m49:"036",name:"Australia",aliases:["\u{1F1E6}\u{1F1FA}","commonwealth of australia","new holland","new hollandia","nova hollandia"]},{iso3:"AUT",iso2:"AT",m49:"040",name:"Austria",aliases:["\u{1F1E6}\u{1F1F9}","osterreich","republic of austria","republik osterreich","zweite republik"]},{iso3:"AZE",iso2:"AZ",m49:"031",name:"Azerbaijan",aliases:["\u{1F1E6}\u{1F1FF}","az\u0259rbaycan","az\u0259rbaycan respublikas\u0131","republic of azerbaijan"]},{iso3:"BDI",iso2:"BI",m49:"108",name:"Burundi",aliases:["\u{1F1E7}\u{1F1EE}","gouvernement du burundi","la republique du burundi","republic of burundi","republika yu burundi","republika yuburundi","republique du burundi","repuburika yuburundi","uburundi"]},{iso3:"BEL",iso2:"BE",m49:"056",name:"Belgium",aliases:["\u{1F1E7}\u{1F1EA}","belg","belgie","belgien","belgique","kingdom of belgium","konigreich belgien","koninkrijk belgie","royaume de belgique"]},{iso3:"BEN",iso2:"BJ",m49:"204",name:"Benin",aliases:["\u{1F1E7}\u{1F1EF}","dahomey","la republique du benin","republic of benin","republique du benin"]},{iso3:"BES",iso2:"BQ",m49:"535",name:"Bonaire, Sint Eustatius and Saba",aliases:["\u{1F1E7}\u{1F1F6}","bes eilanden","bes islands","bijzondere gemeente","bonaire","bonaire saint eustatius and saba","bonaire sint eustatius en saba","caraibisch nederland","caribbean netherlands","caribisch nederland","hulanda karibense","islanan bes","netherlands antilles","saba","sint eustatius"]},{iso3:"BFA",iso2:"BF",m49:"854",name:"Burkina Faso",aliases:["\u{1F1E7}\u{1F1EB}","republic of burkina faso","republic of upper volta"]},{iso3:"BGD",iso2:"BD",m49:"050",name:"Bangladesh",aliases:["\u{1F1E7}\u{1F1E9}","bangla desh","east pakistan","gonaoprojatontri bangladesh","peoples republic of bangladesh","\u0997\u09A3\u09AA\u09CD\u09B0\u099C\u09BE\u09A4\u09A8\u09CD\u09A4\u09CD\u09B0\u09C0 \u09AC\u09BE\u0982\u09B2\u09BE\u09A6\u09C7\u09B6","\u09AC\u09BE\u0982\u09B2\u09BE \u09A6\u09C7\u09B6","\u09AC\u09BE\u0982\u09B2\u09BE\u09A6\u09C7\u09B6","\u09AC\u09BF\u09A1\u09BF"]},{iso3:"BGR",iso2:"BG",m49:"100",name:"Bulgaria",aliases:["\u{1F1E7}\u{1F1EC}","bulgarian republic","republic of bulgaria","republika bulgaria","republika bulgariya","\u0431\u0433","\u0431\u044A\u043B\u0433\u0430\u0440\u0438\u044F","\u0440\u0435\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u0431\u044A\u043B\u0433\u0430\u0440\u0438\u044F"]},{iso3:"BHR",iso2:"BH",m49:"048",name:"Bahrain",aliases:["\u{1F1E7}\u{1F1ED}","bahrein islands","kingdom of bahrain","\u0627\u0644\u0628\u062D\u0631\u064A\u0646","\u062F\u0648\u0644\u0629 \u0627\u0644\u0628\u062D\u0631\u064A\u0646","\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0628\u062D\u0631\u064A\u0646"]},{iso3:"BHS",iso2:"BS",m49:"044",name:"Bahamas",aliases:["\u{1F1E7}\u{1F1F8}","bahama islands","bahamas the","commonwealth of the bahamas"]},{iso3:"BIH",iso2:"BA",m49:"070",name:"Bosnia and Herzegovina",aliases:["\u{1F1E7}\u{1F1E6}","bosna","bosna i hercegovina","bosnia","bosnia and hercegovina","bosnia herzegovina","hercegovina","herzegovina","\u0431\u0438\u0445","\u0431\u043E\u0441\u043D\u0430","\u0431\u043E\u0441\u043D\u0430 \u0438 \u0445\u0435\u0440\u0446\u0435\u0433\u043E\u0432\u0438\u043D\u0430","\u0431\u0445"]},{iso3:"BLM",iso2:"BL",m49:"652",name:"Saint Barth\xE9lemy",aliases:["\u{1F1E7}\u{1F1F1}","collectivite doutre mer de saint barthelemy","collectivite territoriale de saint barthelemy","collectivity of saint barthelemy","saint barth","saint barths","saint barts","saint bartz"]},{iso3:"BLR",iso2:"BY",m49:"112",name:"Belarus",aliases:["\u{1F1E7}\u{1F1FE}","republic of belarus","respublika belarus","respublika byelarus","\u0431\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F \u0440\u044D\u0441\u043F\u0443\u0431\u043B\u0456\u043A\u0430","\u0431\u0435\u043B\u0430\u0440\u0443\u0441\u044C","\u0431\u0435\u043B\u0430\u044F \u0440\u0443\u0441\u044C","\u0431\u0435\u043B\u043E\u0440\u0443\u0441\u0441\u0438\u044F","\u0440\u0431","\u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u0431\u0435\u043B\u0430\u0440\u0443\u0441\u044C","\u0440\u044D\u0441\u043F\u0443\u0431\u043B\u0456\u043A\u0430 \u0431\u0435\u043B\u0430\u0440\u0443\u0441\u044C"]},{iso3:"BLZ",iso2:"BZ",m49:"084",name:"Belize",aliases:["\u{1F1E7}\u{1F1FF}"]},{iso3:"BMU",iso2:"BM",m49:"060",name:"Bermuda",aliases:["\u{1F1E7}\u{1F1F2}","barmuda","barmuda i","barmuda isl","barmuda islands","barmudas","bermoothes","bermuda islands","bermudas","bermudian islands","colony of bermuda","devils isles","isle of devils","somers islands","somers isles","summers isles","territory of bermuda","virgineola"]},{iso3:"BOL",iso2:"BO",m49:"068",name:"Bolivia (Plurinational State of)",aliases:["\u{1F1E7}\u{1F1F4}","bolivia","bulibiya","estado plurinacional de bolivia","plurinational state of bolivia","puliwya","republic of bolivia","republica de bolivia","volivia","wuliwiya","wuliwya"]},{iso3:"BRA",iso2:"BR",m49:"076",name:"Brazil",aliases:["\u{1F1E7}\u{1F1F7}","brasil","federative republic of brazil","pindorama","republica federativa do brasil"]},{iso3:"BRB",iso2:"BB",m49:"052",name:"Barbados",aliases:["\u{1F1E7}\u{1F1E7}","barbadoes"]},{iso3:"BRN",iso2:"BN",m49:"096",name:"Brunei Darussalam",aliases:["\u{1F1E7}\u{1F1F3}","brunei","nation of brunei the abode of peace","negara brunei darussalam"]},{iso3:"BTN",iso2:"BT",m49:"064",name:"Bhutan",aliases:["\u{1F1E7}\u{1F1F9}","kingdom of bhutan","\u0F60\u0F56\u0FB2\u0F74\u0F42","\u0F60\u0F56\u0FB2\u0F74\u0F42\u0F0B\u0F61\u0F74\u0F63\u0F0B","\u0F60\u0F56\u0FB2\u0F74\u0F42\u0F61\u0F74\u0F63\u0F0B\u0F0B"]},{iso3:"BVT",iso2:"BV",m49:"074",name:"Bouvet Island",aliases:["\u{1F1E7}\u{1F1FB}"]},{iso3:"BWA",iso2:"BW",m49:"072",name:"Botswana",aliases:["\u{1F1E7}\u{1F1FC}","lefatshe la botswana","republic of botswana"]},{iso3:"CAF",iso2:"CF",m49:"140",name:"Central African Republic",aliases:["\u{1F1E8}\u{1F1EB}","centrafricaine republique","centrafrique","central africa","kodorosese ti beafrika","la republique","rep centrafrique","republique centrafricaine"]},{iso3:"CAN",iso2:"CA",m49:"124",name:"Canada",aliases:["\u{1F1E8}\u{1F1E6}","le canada"]},{iso3:"CCK",iso2:"CC",m49:"166",name:"Cocos (Keeling) Islands",aliases:["\u{1F1E8}\u{1F1E8}","cocos islands","keeling islands","territory of the cocos keeling islands"]},{iso3:"CHE",iso2:"CH",m49:"756",name:"Switzerland",aliases:["\u{1F1E8}\u{1F1ED}","confederation helvetique","confederation suisse","confederazione elvetica","confederazione svizzera","confederaziun svizra","confoederatio helvetica","conf\u0153deratio helvetica","eidgenossenschaft","elvezia","helvetie","la confederation suisse","schweiz","schweizerische eidgenossenschaft","suisse","svizra","svizzera","swiss","swiss confederation"]},{iso3:"CHL",iso2:"CL",m49:"152",name:"Chile",aliases:["\u{1F1E8}\u{1F1F1}","republic of chile","republica de chile"]},{iso3:"CHN",iso2:"CN",m49:"156",name:"China",aliases:["\u{1F1E8}\u{1F1F3}","china pr","peoples republic of china","pr china","prc","\u4E2D\u534E\u4EBA\u6C11\u5171\u548C\u56FD","\u4E2D\u56FD"]},{iso3:"CIV",iso2:"CI",m49:"384",name:"C\xF4te d'Ivoire",aliases:["\u{1F1E8}\u{1F1EE}","cote ivoire","ivory coast","republic of cote divoire","republic of ivory coast","republic of the ivory coast","republique de cote divoire"]},{iso3:"CMR",iso2:"CM",m49:"120",name:"Cameroon",aliases:["\u{1F1E8}\u{1F1F2}","cameroun","la republique du cameroun","republic of cameroon","republique du cameroun"]},{iso3:"COD",iso2:"CD",m49:"180",name:"Democratic Republic of the Congo",aliases:["\u{1F1E8}\u{1F1E9}","congo belge","congo democratic republic of the","congo kinshasa","dem rep congo","dem republic of congo","dem republic of the congo","democratic republic of congo","dr congo","drc","rd congo","rep demcongo","republic of the congo","republique democratique du congo","republique du zaire","zaire"]},{iso3:"COG",iso2:"CG",m49:"178",name:"Congo",aliases:["\u{1F1E8}\u{1F1EC}","congo brazza","congo brazzaville","congo republic","rep congo","republic of congo","republique du congo"]},{iso3:"COK",iso2:"CK",m49:"184",name:"Cook Islands",aliases:["\u{1F1E8}\u{1F1F0}","cook group","hervey islands"]},{iso3:"COL",iso2:"CO",m49:"170",name:"Colombia",aliases:["\u{1F1E8}\u{1F1F4}","republic of colombia","republica de colombia"]},{iso3:"COM",iso2:"KM",m49:"174",name:"Comoros",aliases:["\u{1F1F0}\u{1F1F2}","comores","comores archipel","etat comorien","lunion des comores","republique des comores","republique federale et islamique des comores","republique federale islamique des comores","territoire des comores","union des comores","union of the comoros","\u0625\u062A\u062D\u0627\u062F \u0627\u0644\u0642\u0645\u0631","\u0627\u062A\u062D\u0627\u062F \u062C\u0632\u0631 \u0627\u0644\u0642\u0645\u0631","\u0627\u0644\u0627\u062A\u062D\u0627\u062F \u0627\u0644\u0642\u0645\u0631\u064A","\u0627\u0644\u0642\u0645\u0631","\u062C\u0632\u0631 \u0627\u0644\u0642\u0645\u0631","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0642\u0645\u0631 \u0627\u0644\u0645\u062A\u062D\u062F\u0629","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u062C\u0632\u0631 \u0627\u0644\u0642\u0645\u0631 \u0627\u0644\u0627\u062A\u062D\u0627\u062F\u064A\u0629 \u0627\u0644\u0625\u0633\u0644\u0627\u0645\u064A\u0629","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u062C\u0632\u0631\u0627\u0644\u0642\u0645\u0631 \u0627\u0644\u0645\u062A\u062D\u062F\u0629"]},{iso3:"CPV",iso2:"CV",m49:"132",name:"Cabo Verde",aliases:["\u{1F1E8}\u{1F1FB}","cape verde","cape verde islands","kab verd","kabu verdi","kauberdi","republic of cabo verde","republic of cape verde","republica de cabo verde"]},{iso3:"CRI",iso2:"CR",m49:"188",name:"Costa Rica",aliases:["\u{1F1E8}\u{1F1F7}","republic of costa rica","republica de costa rica"]},{iso3:"CUB",iso2:"CU",m49:"192",name:"Cuba",aliases:["\u{1F1E8}\u{1F1FA}","isla juana","republic of cuba","republica de cuba"]},{iso3:"CUW",iso2:"CW",m49:"531",name:"Cura\xE7ao",aliases:["\u{1F1E8}\u{1F1FC}","corsou","corsouw","corsow","country of curacao","curacau","curacoa","curazao","cura\u03C2ao","curocao","island territory of curacao","korsou","land curacao","pais korsou"]},{iso3:"CXR",iso2:"CX",m49:"162",name:"Christmas Island",aliases:["\u{1F1E8}\u{1F1FD}","christmas island other territories","christmas island other territories australia","territory of christmas island"]},{iso3:"CYM",iso2:"KY",m49:"136",name:"Cayman Islands",aliases:["\u{1F1F0}\u{1F1FE}","caymans"]},{iso3:"CYP",iso2:"CY",m49:"196",name:"Cyprus",aliases:["\u{1F1E8}\u{1F1FE}","greek administration of southern cyprus","greek cypriot state","guney k\u0131br\u0131s","guney k\u0131br\u0131s rum cumhuriyeti","guney k\u0131br\u0131s rum kesimi","guney k\u0131br\u0131s rum yonetimi","kipriaki dhimokratia","k\u0131br\u0131s","k\u0131br\u0131s cumhuriyeti","k\u0131br\u0131s rum kesimi","kypriaki dimokratia","kypros","republic of cyprus","\u03BA\u03C5\u03C0\u03C1\u03B9\u03B1\u03BA\u03B7 \u03B4\u03B7\u03BC\u03BF\u03BA\u03C1\u03B1\u03C4\u03B9\u03B1","\u03BA\u03C5\u03C0\u03C1\u03BF\u03C2"]},{iso3:"CZE",iso2:"CZ",m49:"203",name:"Czechia",aliases:["\u{1F1E8}\u{1F1FF}","ceska republika","ceske kraje","ceske uzemi","ceske zeme","cesko","cr","czech republic"]},{iso3:"DEU",iso2:"DE",m49:"276",name:"Germany",aliases:["\u{1F1E9}\u{1F1EA}","br deutschland","bundesrepublik","bundesrepublik deutschland","deutschland","federal republic of germany"]},{iso3:"DJI",iso2:"DJ",m49:"262",name:"Djibouti",aliases:["\u{1F1E9}\u{1F1EF}","la republique de djibouti","republic of djibouti","republique de djibouti","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u062C\u064A\u0628\u0648\u062A\u064A","\u062C\u064A\u0628\u0648\u062A\u064A"]},{iso3:"DMA",iso2:"DM",m49:"212",name:"Dominica",aliases:["\u{1F1E9}\u{1F1F2}","commonwealth of dominica","island of dominica","waitu kubuli"]},{iso3:"DNK",iso2:"DK",m49:"208",name:"Denmark",aliases:["\u{1F1E9}\u{1F1F0}","dania","danmark","denmark proper","kongeriget danmark","metropolitan denmark"]},{iso3:"DOM",iso2:"DO",m49:"214",name:"Dominican Republic",aliases:["\u{1F1E9}\u{1F1F4}","dominicana","domrep","haiti espanol","quisqueya","republica de santo domingo","republica dominicana","santo domingo"]},{iso3:"DZA",iso2:"DZ",m49:"012",name:"Algeria",aliases:["\u{1F1E9}\u{1F1FF}","peoples democratic republic of algeria","\u0627\u0644\u062C\u0632\u0627\u0626\u0631","\u0627\u0644\u062C\u0632\u0627\u064A\u0631","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u062C\u0632\u0627\u0626\u0631\u064A\u0629 \u0627\u0644\u062F\u064A\u0645\u0642\u0631\u0627\u0637\u064A\u0629 \u0627\u0644\u0634\u0639\u0628\u064A\u0629","\u0627\u0644\u062F\u0632\u0627\u064A\u0631","\u062F\u0632\u0627\u064A\u0631"]},{iso3:"ECU",iso2:"EC",m49:"218",name:"Ecuador",aliases:["\u{1F1EA}\u{1F1E8}","ecuadorian state","el ecuador","estado ecuatoriano","republic of ecuador","republic of equator","republic of the equator","republica del ecuador"]},{iso3:"EGY",iso2:"EG",m49:"818",name:"Egypt",aliases:["\u{1F1EA}\u{1F1EC}","arab rep egypt","arab republic of egypt","rep egypt","republic of egypt","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0645\u0635\u0631 \u0627\u0644\u0639\u0631\u0628\u064A\u0629","\u0645\u0635\u0631"]},{iso3:"ERI",iso2:"ER",m49:"232",name:"Eritrea",aliases:["\u{1F1EA}\u{1F1F7}","ertra","hagere ertra","hagere iertra","iertra","iritriya","state of eritrea","\u0625\u0631\u062A\u0631\u064A\u0627","\u0625\u0631\u064A\u062A\u0631\u064A\u0627","\u0627\u0631\u062A\u0631\u064A\u0627","\u0627\u0631\u062A\u064A\u0631\u064A\u0627","\u0627\u0631\u064A\u062A\u0631\u064A\u0627","\u062F\u0648\u0644\u0629 \u0625\u0631\u062A\u0631\u064A\u0627","\u062F\u0648\u0644\u0629 \u0625\u0631\u064A\u062A\u0631\u064A\u0627","\u1203\u1308\u1228 \u12A4\u122D\u1275\u122B","\u12A4\u122D\u1275\u122B"]},{iso3:"ESH",iso2:"EH",m49:"732",name:"Western Sahara",aliases:["\u{1F1EA}\u{1F1ED}","southern provinces","spanish sahara","west sahara"]},{iso3:"ESP",iso2:"ES",m49:"724",name:"Spain",aliases:["\u{1F1EA}\u{1F1F8}","espana","estado espanol","kingdom of spain","reino de espana"]},{iso3:"EST",iso2:"EE",m49:"233",name:"Estonia",aliases:["\u{1F1EA}\u{1F1EA}","eesti","eesti noukogude sotsialistlik vabariik","eesti vabariik","estland","republic of estonia"]},{iso3:"ETH",iso2:"ET",m49:"231",name:"Ethiopia",aliases:["\u{1F1EA}\u{1F1F9}","federal democratic republic of ethiopia","ityopiya","yeityopiya federalawi demokrasiyawi ripeblik","yeityopiya hizbawi dimokrasiyawi ripublik","\u12A2\u1275\u12EE\u1335\u12EB","\u12E8\u12A2\u1275\u12EE\u1335\u12EB \u134C\u12F4\u122B\u120B\u12CA \u12F4\u121E\u12AD\u122B\u1232\u12EB\u12CA \u122A\u1350\u1265\u120A\u12AD"]},{iso3:"FIN",iso2:"FI",m49:"246",name:"Finland",aliases:["\u{1F1EB}\u{1F1EE}","republic of finland","republiken finland","suomen tasavalta","suomi"]},{iso3:"FJI",iso2:"FJ",m49:"242",name:"Fiji",aliases:["\u{1F1EB}\u{1F1EF}","fiji ganarajya","matanitu ko viti","matanitu tugalala o viti","republic of fiji","republic of the fiji islands","viti"]},{iso3:"FLK",iso2:"FK",m49:"238",name:"Falkland Islands (Malvinas)",aliases:["\u{1F1EB}\u{1F1F0}","colony of the falkland islands","falkland islands","falklands","islas malvinas","malvinas","malvinas islands"]},{iso3:"FRA",iso2:"FR",m49:"250",name:"France",aliases:["\u{1F1EB}\u{1F1F7}","fr","french republic","la france","la republique francaise","lhexagone","republique francaise"]},{iso3:"FRO",iso2:"FO",m49:"234",name:"Faroe Islands",aliases:["\u{1F1EB}\u{1F1F4}","faer oer","f\xE6r\xF8","faeroe is","faeroe islands","faeroe isles","f\xE6r\xF8erne","faeroes","far oer","faroe island","faroe isles","faroes","faroese islands","f\xF8roya","f\xF8royar","f\xF8royum"]},{iso3:"FSM",iso2:"FM",m49:"583",name:"Micronesia (Federated States of)",aliases:["\u{1F1EB}\u{1F1F2}","fed sts micronesia","fed sts of micronesia","federated states of micronesia","federated states of micronesia fsm","micronesia"]},{iso3:"GAB",iso2:"GA",m49:"266",name:"Gabon",aliases:["\u{1F1EC}\u{1F1E6}","gabonese republic","la republique gabonaise","le gabon","republique du gabon","republique gabonaise"]},{iso3:"GBR",iso2:"GB",m49:"826",name:"United Kingdom of Great Britain and Northern Ireland",aliases:["\u{1F1EC}\u{1F1E7}","britain","england","great britain","great britain and northern ireland","northern ireland","scotland","uk","united kingdom","wales"]},{iso3:"GEO",iso2:"GE",m49:"268",name:"Georgia",aliases:["\u{1F1EC}\u{1F1EA}","georgia country","republic of georgia","sakartvelo","\u049B\u044B\u0440\u04AD\u0442\u04D9\u044B\u043B\u0430","\u10E1\u10D0\u10E5\u10D0\u10E0\u10D7\u10D5\u10D4\u10DA\u10DD","\u10E1\u10D0\u10E5\u10D0\u10E0\u10D7\u10D5\u10D4\u10DA\u10DD\u10E1 \u10E0\u10D4\u10E1\u10DE\u10E3\u10D1\u10DA\u10D8\u10D9\u10D0"]},{iso3:"GGY",iso2:"GG",m49:"831",name:"Guernsey",aliases:["\u{1F1EC}\u{1F1EC}","bailiwick of guernsey","bailliage de guernesey","bailliage de guernesi","giernesi","great britain guernsey","guernesey","lisia"]},{iso3:"GHA",iso2:"GH",m49:"288",name:"Ghana",aliases:["\u{1F1EC}\u{1F1ED}","republic of ghana"]},{iso3:"GIB",iso2:"GI",m49:"292",name:"Gibraltar",aliases:["\u{1F1EC}\u{1F1EE}","rock of gibraltar"]},{iso3:"GIN",iso2:"GN",m49:"324",name:"Guinea",aliases:["\u{1F1EC}\u{1F1F3}","guinee","guinee conakry","republic of guinea","republique de guinee"]},{iso3:"GLP",iso2:"GP",m49:"312",name:"Guadeloupe",aliases:["\u{1F1EC}\u{1F1F5}"]},{iso3:"GMB",iso2:"GM",m49:"270",name:"Gambia",aliases:["\u{1F1EC}\u{1F1F2}","islamic republic of the gambia","republic of the gambia"]},{iso3:"GNB",iso2:"GW",m49:"624",name:"Guinea-Bissau",aliases:["\u{1F1EC}\u{1F1FC}","guine bissau","republic of guinea bissau","republica da guine bissau"]},{iso3:"GNQ",iso2:"GQ",m49:"226",name:"Equatorial Guinea",aliases:["\u{1F1EC}\u{1F1F6}","guine equatorial","guinea ecuatorial","guinea espanola","guinee equat","guinee equatoriale","la republique de guinee equatoriale","posesiones espanolas del golfo de guinea","provincia de la guinea ecuatorial","republic of equatorial guinea","republica da guine equatorial","republica de guinea ecuatorial","territorios espanoles del golfo de guinea"]},{iso3:"GRC",iso2:"GR",m49:"300",name:"Greece",aliases:["\u{1F1EC}\u{1F1F7}","ellada","ellas","elliniki dhimokratia","elliniki dimokratia","greek republic","hellas","hellas greece","hellenic republic","vasilion tis ellados","\u03B4\u03B7\u03BC\u03BF\u03BA\u03C1\u03B1\u03C4\u03B9\u03B1 \u03C4\u03B7\u03C2 \u03B5\u03BB\u03BB\u03B1\u03B4\u03B1\u03C2","\u03B4\u03B7\u03BC\u03BF\u03BA\u03C1\u03B1\u03C4\u03B9\u03B1 \u03C4\u03B7\u03C2 \u03B5\u03BB\u03BB\u03B1\u03B4\u03BF\u03C2","\u03B5\u03BB\u03BB\u03B1\u03B4\u03B1","\u03B5\u03BB\u03BB\u03B1\u03C2","\u03B5\u03BB\u03BB\u03B1\u03C2 \u03B5\u03BB\u03BB\u03B1\u03B4\u03B1","\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03B7 \u03B4\u03B7\u03BC\u03BF\u03BA\u03C1\u03B1\u03C4\u03B9\u03B1"]},{iso3:"GRD",iso2:"GD",m49:"308",name:"Grenada",aliases:["\u{1F1EC}\u{1F1E9}"]},{iso3:"GRL",iso2:"GL",m49:"304",name:"Greenland",aliases:["\u{1F1EC}\u{1F1F1}","kalaallit nunaat"]},{iso3:"GTM",iso2:"GT",m49:"320",name:"Guatemala",aliases:["\u{1F1EC}\u{1F1F9}","republic of guatemala","republica de guatemala"]},{iso3:"GUF",iso2:"GF",m49:"254",name:"French Guiana",aliases:["\u{1F1EC}\u{1F1EB}","fr 973","guiana","guiana france","guyane","guyane francaise","gwiyann","gwiyann franse","lagwiyann"]},{iso3:"GUM",iso2:"GU",m49:"316",name:"Guam",aliases:["\u{1F1EC}\u{1F1FA}","guahan","guam usa","islan guahan","island of guam","territory of guam"]},{iso3:"GUY",iso2:"GY",m49:"328",name:"Guyana",aliases:["\u{1F1EC}\u{1F1FE}","co operative republic of guyana","republic of guyana"]},{iso3:"HKG",iso2:"HK",m49:"344",name:"Hong Kong",aliases:["\u{1F1ED}\u{1F1F0}","hksar","hong kong sar","hong kong special administrative region","hong kong special administrative region of the peoples republic of china","hongkong"]},{iso3:"HMD",iso2:"HM",m49:"334",name:"Heard Island and McDonald Islands",aliases:["\u{1F1ED}\u{1F1F2}","heard","heard & mcdonald islands","heard and macdonald islands","heard island","himi","mcdonald","mcdonald island","territory of heard island and mcdonald islands"]},{iso3:"HND",iso2:"HN",m49:"340",name:"Honduras",aliases:["\u{1F1ED}\u{1F1F3}","guaymuras","higueras","honduran republic","republic of honduras","republica de honduras"]},{iso3:"HRV",iso2:"HR",m49:"191",name:"Croatia",aliases:["\u{1F1ED}\u{1F1F7}","hrvatska","republic of croatia","republika hrvatska"]},{iso3:"HTI",iso2:"HT",m49:"332",name:"Haiti",aliases:["\u{1F1ED}\u{1F1F9}","ayiti","haitian republic","la republique dhaiti","repiblik d ayiti","republic of haiti","republique dhaiti"]},{iso3:"HUN",iso2:"HU",m49:"348",name:"Hungary",aliases:["\u{1F1ED}\u{1F1FA}","a magyar koztarsasag","a magyar nepkoztarsasag","harmadik magyar koztarsasag","magyar koztarsasag","magyar nepkoztarsasag","magyarorszag","mo"]},{iso3:"IDN",iso2:"ID",m49:"360",name:"Indonesia",aliases:["\u{1F1EE}\u{1F1E9}","negara kesatuan republik indonesia","nkri","republic of indonesia","republik indonesia"]},{iso3:"IMN",iso2:"IM",m49:"833",name:"Isle of Man",aliases:["\u{1F1EE}\u{1F1F2}","ellan vannin","i man","i mann","i mannin","isle of mann","mann","mannin","manx"]},{iso3:"IND",iso2:"IN",m49:"356",name:"India",aliases:["\u{1F1EE}\u{1F1F3}","al hind","bharat","bharat ganarajya","bharata","bharatvarsh","hindoostan","hindustan","indostan","republic of india","tenjiku","tianzhu","\u0906\u0930\u094D\u092F\u0935\u0930\u094D\u0924","\u0907\u0902\u0921\u093F\u092F\u093E","\u0907\u0923\u094D\u0921\u093F\u092F\u093E","\u092D\u093E\u0930\u0924","\u092D\u093E\u0930\u0924 \u0917\u0923\u0930\u093E\u091C\u094D\u092F","\u092D\u093E\u0930\u0924\u0935\u0930\u094D\u0937","\u0939\u093F\u0902\u0926\u0941\u0938\u094D\u0924\u093E\u0928","\u0939\u093F\u0928\u094D\u0926\u0941\u0938\u094D\u0924\u093E\u0928","\u0939\u093F\u0928\u094D\u0926\u094B\u0938\u094D\u0924\u093E\u0928"]},{iso3:"IOT",iso2:"IO",m49:"086",name:"British Indian Ocean Territory",aliases:["\u{1F1EE}\u{1F1F4}","biot"]},{iso3:"IRL",iso2:"IE",m49:"372",name:"Ireland",aliases:["\u{1F1EE}\u{1F1EA}","eire","hibernia","irish republic","poblacht na heireann","republic of ireland","southern ireland"]},{iso3:"IRN",iso2:"IR",m49:"364",name:"Iran (Islamic Republic of)",aliases:["\u{1F1EE}\u{1F1F7}","iran","islamic rep iran","islamic republic of iran","persia","\u0627\u06CC\u0631\u0627\u0646","\u0627\u06CC\u0631\u0627\u0646\u0632\u0645\u06CC\u0646","\u067E\u0627\u0631\u0633","\u062C\u0645\u0647\u0648\u0631\u06CC \u0627\u0633\u0644\u0627\u0645\u06CC \u0627\u064A\u0631\u0627\u0646","\u062C\u0645\u0647\u0648\u0631\u06CC \u0627\u0633\u0644\u0627\u0645\u06CC \u0627\u06CC\u0631\u0627\u0646","\u0643\u0634\u0648\u0631 \u0634\u0627\u0647\u0646\u0634\u0627\u0647\u06CC \u0627\u064A\u0631\u0627\u0646"]},{iso3:"IRQ",iso2:"IQ",m49:"368",name:"Iraq",aliases:["\u{1F1EE}\u{1F1F6}","eraq","iraqe","komar i eraq","republic of iraq","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0639\u0631\u0627\u0642\u064A\u0629","\u0627\u0644\u0639\u0631\u0627\u0642","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0639\u0631\u0627\u0642","\u0639\u0631\u0627\u0642","\u0639\u06CE\u0631\u0627\u0642"]},{iso3:"ISL",iso2:"IS",m49:"352",name:"Iceland",aliases:["\u{1F1EE}\u{1F1F8}","icelandic republic","island","ly\xF0veldi\xF0 island","republic of iceland","ysland"]},{iso3:"ISR",iso2:"IL",m49:"376",name:"Israel",aliases:["\u{1F1EE}\u{1F1F1}","erez yisrael","medinat yisrael","state of israel","yisrael","\u05D9\u05E9\u05E8\u05D0\u05DC","\u05DE\u05D3\u05D9\u05E0\u05EA \u05D9\u05E9\u05E8\u05D0\u05DC"]},{iso3:"ITA",iso2:"IT",m49:"380",name:"Italy",aliases:["\u{1F1EE}\u{1F1F9}","il bel paese","italia","italian republic","repubblica italiana","republic of italy"]},{iso3:"JAM",iso2:"JM",m49:"388",name:"Jamaica",aliases:["\u{1F1EF}\u{1F1F2}","commonwealth of jamaica","jamieka","jomieka","jumieka"]},{iso3:"JEY",iso2:"JE",m49:"832",name:"Jersey",aliases:["\u{1F1EF}\u{1F1EA}","bailliage de jerri","bailliage de jersey","balliwick of jersey","i iersey","i jersey","iersey","iersey i","isle of jersey","jerri","jersey i","jersey island"]},{iso3:"JOR",iso2:"JO",m49:"400",name:"Jordan",aliases:["\u{1F1EF}\u{1F1F4}","giordania","hashemite kingdom of jordan","kingdom of jordan","state of jordan","yarden","\u0627\u0644\u0623\u0631\u062F\u0646","\u0627\u0644\u0627\u0631\u062F\u0646","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0623\u0631\u062F\u0646\u064A\u0629 \u0627\u0644\u0647\u0627\u0634\u0645\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0627\u0631\u062F\u0646\u064A\u0629 \u0627\u0644\u0647\u0627\u0634\u0645\u064A\u0629"]},{iso3:"JPN",iso2:"JP",m49:"392",name:"Japan",aliases:["\u{1F1EF}\u{1F1F5}","state of japan","\u3042\u304D\u3064\u3057\u307E","\u304A\u304A\u3084\u3057\u307E","\u3057\u304D\u3057\u307E","\u30B8\u30E3\u30D1\u30F3","\u3057\u3093\u3057\u3085\u3046","\u306B\u3063\u307D\u3093","\u306B\u3063\u307D\u3093\u3053\u304F","\u306B\u307B\u3093","\u306B\u307B\u3093\u3053\u304F","\u3072\u3044\u305A\u308B\u304F\u306B","\u3075\u305D\u3046","\u5927\u516B\u5DDE","\u6276\u6728\u4E4B\u5730","\u6276\u6851","\u6276\u6851\u56FD","\u6577\u5CF6","\u65E5\u51FA\u308B\u56FD","\u65E5\u672C","\u6991\u6728\u4E4B\u5730","\u745E\u7A42\u56FD","\u795E\u5DDE","\u79CB\u6D25\u5CF6","\u8466\u539F\u4E2D\u56FD"]},{iso3:"KAZ",iso2:"KZ",m49:"398",name:"Kazakhstan",aliases:["\u{1F1F0}\u{1F1FF}","qazaqstan","qazaqstan respublikasy","republic of kazakhstan","\u043A\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043D","\u049B\u0430\u0437\u0430\u049B\u0441\u0442\u0430\u043D","\u049B\u0430\u0437\u0430\u049B\u0441\u0442\u0430\u043D \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u0441\u044B","\u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u043A\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043D","\u0440\u043A"]},{iso3:"KEN",iso2:"KE",m49:"404",name:"Kenya",aliases:["\u{1F1F0}\u{1F1EA}","jamhuri ya kenya","republic of kenya"]},{iso3:"KGZ",iso2:"KG",m49:"417",name:"Kyrgyzstan",aliases:["\u{1F1F0}\u{1F1EC}","kyrgyz republic","kyrgyz respublikasy","kyrgyzstan respublikasy","\u043A\u0440","\u043A\u044B\u0440\u0433\u044B\u0437 \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u0441\u044B","\u043A\u044B\u0440\u0433\u044B\u0437\u0441\u0442\u0430\u043D"]},{iso3:"KHM",iso2:"KH",m49:"116",name:"Cambodia",aliases:["\u{1F1F0}\u{1F1ED}","camboya","campuchia","kambodzha","kamboja","kampuchea","kingdom of cambodia","\u1780\u1798\u17D2\u1796\u17BB\u1787\u17B6","\u1796\u17D2\u179A\u17C7\u179A\u17B6\u1787\u17B6\u178E\u17B6\u1785\u1780\u17D2\u179A\u1780\u1798\u17D2\u1796\u17BB\u1787\u17B6"]},{iso3:"KIR",iso2:"KI",m49:"296",name:"Kiribati",aliases:["\u{1F1F0}\u{1F1EE}","republic of kiribati"]},{iso3:"KNA",iso2:"KN",m49:"659",name:"Saint Kitts and Nevis",aliases:["\u{1F1F0}\u{1F1F3}","federation of saint christopher and nevis","federation of saint kitts and nevis","kitts & nevis","nevis","saint christopher","saint christopher and nevis","saint kitts"]},{iso3:"KOR",iso2:"KR",m49:"410",name:"Republic of Korea",aliases:["\u{1F1F0}\u{1F1F7}","korea","korea republic","korea republic of","korea south","rep korea","s korea","south korea","taehan minguk","\uB0A8\uC870\uC120","\uB0A8\uD55C","\uB300\uD55C","\uB300\uD55C\uBBFC\uAD6D","\uCF54\uB9AC\uC544","\uD55C\uAD6D"]},{iso3:"KWT",iso2:"KW",m49:"414",name:"Kuwait",aliases:["\u{1F1F0}\u{1F1FC}","state of kuwait","\u0627\u0644\u0643\u0648\u064A\u062A","\u062F\u0648\u0644\u0629 \u0627\u0644\u0643\u0648\u064A\u062A"]},{iso3:"LAO",iso2:"LA",m49:"418",name:"Lao People's Democratic Republic",aliases:["\u{1F1F1}\u{1F1E6}","laos","sathalanalat paxathipatai paxaxon lao","\u0EAA\u0EB2\u0E97\u0EB2\u0EA5\u0EB0\u0E99\u0EB0\u0EA5\u0EB1\u0E94 \u0E9B\u0EB0\u0E8A\u0EB2\u0E97\u0EB4\u0E9B\u0EB0\u0EC4\u0E95 \u0E9B\u0EB0\u0E8A\u0EB2\u0E8A\u0EBB\u0E99\u0EA5\u0EB2\u0EA7","\u0E9B\u0EB0\u0EC0\u0E97\u0E94\u0EA5\u0EB2\u0EA7","\u0EA5\u0EB2\u0EA7"]},{iso3:"LBN",iso2:"LB",m49:"422",name:"Lebanon",aliases:["\u{1F1F1}\u{1F1E7}","lebanese republic","republic of lebanon","state of lebanon","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0644\u0628\u0646\u0627\u0646\u064A\u0629","\u0644\u0628\u0646\u0627\u0646"]},{iso3:"LBR",iso2:"LR",m49:"430",name:"Liberia",aliases:["\u{1F1F1}\u{1F1F7}","liber","republic of liberia"]},{iso3:"LBY",iso2:"LY",m49:"434",name:"Libya",aliases:["\u{1F1F1}\u{1F1FE}","state of libya","\u0627\u0644\u062C\u0645\u0627\u0647\u064A\u0631\u064A\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0644\u064A\u0628\u064A\u0629 \u0627\u0644\u0634\u0639\u0628\u064A\u0629 \u0627\u0644\u0625\u0634\u062A\u0631\u0627\u0643\u064A\u0629","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0644\u064A\u0628\u064A\u0629","\u0627\u0644\u0644\u064A\u0628\u064A","\u0627\u0644\u0644\u064A\u0628\u064A\u0629","\u0627\u0644\u0644\u064A\u0628\u064A\u0646","\u062F\u0648\u0644\u0629 \u0644\u064A\u0628\u064A\u0627","\u0644\u064A\u0628\u0628\u064A\u0627","\u0644\u064A\u0628\u064A","\u0644\u064A\u0628\u064A\u0627","\u0644\u064A\u0628\u064A\u0629"]},{iso3:"LCA",iso2:"LC",m49:"662",name:"Saint Lucia",aliases:["\u{1F1F1}\u{1F1E8}","hewanorra","iyonola"]},{iso3:"LIE",iso2:"LI",m49:"438",name:"Liechtenstein",aliases:["\u{1F1F1}\u{1F1EE}","furstentum lichtenstein","furstentum liechtenstein","principality of liechtenstein"]},{iso3:"LKA",iso2:"LK",m49:"144",name:"Sri Lanka",aliases:["\u{1F1F1}\u{1F1F0}","ceylan","ceylon","democratic socialist republic of sri lanka","ilankaic cananayaka cocalicak kutiyarcu","lankava","prajatantravadi samajavadi janarajaya sri lanka","serendib","srilanka","taprobane","\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8","\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8 \u0B9A\u0BA9\u0BA8\u0BBE\u0BAF\u0B95 \u0B9A\u0BCB\u0B9A\u0BB2\u0BBF\u0B9A\u0B95\u0BCD \u0B95\u0BC1\u0B9F\u0BBF\u0BAF\u0BB0\u0B9A\u0BC1","\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8 \u0B9A\u0BA9\u0BA8\u0BBE\u0BAF\u0B95 \u0B9A\u0BCB\u0BB7\u0BB2\u0BBF\u0B9A\u0B95\u0BCD \u0B95\u0BC1\u0B9F\u0BBF\u0BAF\u0BB0\u0B9A\u0BC1","\u0B88\u0BB4\u0BAE\u0BCD","\u0B9A\u0BBF\u0BB2\u0BCB\u0BA9\u0BCD","\u0DBD\u0D82\u0D9A\u0DCF\u0DC0","\u0DC1\u0DCA\u0DBB\u0DD3 \u0DBD\u0D82\u0D9A\u0DCF \u0DB4\u0DCA\u0DBB\u0DA2\u0DCF\u0DAD\u0DB1\u0DCA\u0DAD\u0DCA\u0DBB\u0DC0\u0DCF\u0DAF\u0DD3 \u0DC3\u0DB8\u0DCF\u0DA2\u0DC0\u0DCF\u0DAF\u0DD3 \u0DA2\u0DB1\u0DBB\u0DA2\u0DBA","\u0DC1\u0DCA\u0DBB\u0DD3 \u0DBD\u0D82\u0D9A\u0DCF\u0DC0","\u0DC1\u0DCA\u200D\u0DBB\u0DD3 \u0DBD\u0D82\u0D9A\u0DCF\u0DC0"]},{iso3:"LSO",iso2:"LS",m49:"426",name:"Lesotho",aliases:["\u{1F1F1}\u{1F1F8}","kingdom of lesotho","mmuso wa lesotho","mountain kingdom"]},{iso3:"LTU",iso2:"LT",m49:"440",name:"Lithuania",aliases:["\u{1F1F1}\u{1F1F9}","lietuva","lietuvos respublika","republic of lithuania"]},{iso3:"LUX",iso2:"LU",m49:"442",name:"Luxembourg",aliases:["\u{1F1F1}\u{1F1FA}","grand duche","grand duche de luxembourg","grand duchy of luxembourg","gro\xDFherzogtum luxemburg","groussherzogtum letzebuerg","le grand duche de luxembourg","letzebuerg","letzebuerger land","lux","luxemburg"]},{iso3:"LVA",iso2:"LV",m49:"428",name:"Latvia",aliases:["\u{1F1F1}\u{1F1FB}","latveja","latvejas republika","latvian republic","latvija","latvijas republika","letm\u043E","letm\u043E vabam\u043E","republic of latvia"]},{iso3:"MAC",iso2:"MO",m49:"446",name:"Macao",aliases:["\u{1F1F2}\u{1F1F4}","aomen","macao sar","macao special administrative region","macao special administrative region of the peoples republic of china","macau","macau rae da china","macau sar","macau special administrative region","macau special administrative region of the peoples republic of china","raem","regiao administrativa especial de macau","regiao administrativa especial de macau da republica popular da china","\u4E2D\u570B\u6FB3\u9580\u7279\u5225\u884C\u653F\u5340","\u6FB3\u9580"]},{iso3:"MAF",iso2:"MF",m49:"663",name:"Saint Martin (French Part)",aliases:["\u{1F1F2}\u{1F1EB}","collectivite de saint martin","collectivity of saint martin","saint martin","saint martin antilles francaises","saint martin france"]},{iso3:"MAR",iso2:"MA",m49:"504",name:"Morocco",aliases:["\u{1F1F2}\u{1F1E6}","kingdom of morocco","\u0627\u0644\u0645\u063A\u0631\u0628","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0645\u063A\u0631\u0628\u064A\u0629","\u2D30\u2D4E\u2D53\u2D54 \u2D4F \u2D61\u2D30\u2D3D\u2D53\u2D5B","\u2D30\u2D4E\u2D55\u2D55\u2D53\u2D3D","\u2D4D\u2D4E\u2D55\u2D55\u2D53\u2D3D","\u2D4D\u2D4E\u2D56\u2D54\u2D49\u2D31","\u2D5C\u2D30\u2D33\u2D4D\u2D37\u2D49\u2D5C \u2D4F \u2D4D\u2D4E\u2D56\u2D54\u2D49\u2D31"]},{iso3:"MCO",iso2:"MC",m49:"492",name:"Monaco",aliases:["\u{1F1F2}\u{1F1E8}","fort hercule","la principaute de monaco","monaco rattachee au district de menton en 1793","munegu","principality and diocese of monaco","principality of monaco","principatu de munegu","principaute de monaco"]},{iso3:"MDA",iso2:"MD",m49:"498",name:"Republic of Moldova",aliases:["\u{1F1F2}\u{1F1E9}","moldavia","moldova","moldova republic of","moldova republica","r moldova","rep moldova","republica moldova","\u043C\u043E\u043B\u0434\u043E\u0432\u0430"]},{iso3:"MDG",iso2:"MG",m49:"450",name:"Madagascar",aliases:["\u{1F1F2}\u{1F1EC}","la republique de madagascar","madagasikara","repoblikani madagasikara","republic of madagascar","republique de madagascar"]},{iso3:"MDV",iso2:"MV",m49:"462",name:"Maldives",aliases:["\u{1F1F2}\u{1F1FB}","dhivehi raajjeyge jumhooriyyaa","republic of maldives","\u078B\u07A8\u0788\u07AC\u0780\u07A8 \u0783\u07A7\u0787\u07B0\u0796\u07AC","\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0783\u07A7\u0787\u07B0\u0796\u07AC","\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0783\u07A7\u0787\u07B0\u0796\u07AD\u078E\u07AC \u0796\u07AA\u0789\u07AA\u0780\u07AB\u0783\u07A8\u0787\u07B0\u0794\u07A7","\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0783\u07A7\u0787\u07B0\u0796\u07AD\u078E\u07AC \u0796\u07AA\u0789\u07B0\u0780\u07AB\u0783\u07A8\u0787\u07B0\u0794\u07A7"]},{iso3:"MEX",iso2:"MX",m49:"484",name:"Mexico",aliases:["\u{1F1F2}\u{1F1FD}","estados unidos mejicanos","estados unidos mexicanos","mejico","mexican republic","mexican united states","mexihco","mexihko","mexika sentik wexteyowalko","mexiko","mexko","mexko axkayotl","mexko tlalli","nueva espana","republica mejicana","republica mexicana","united mexican states","united states of mexico"]},{iso3:"MHL",iso2:"MH",m49:"584",name:"Marshall Islands",aliases:["\u{1F1F2}\u{1F1ED}","aelon kein ad","aolepan aorokin majel","jolet jen anij","majel","majol","republic of the marshall islands"]},{iso3:"MKD",iso2:"MK",m49:"807",name:"North Macedonia",aliases:["\u{1F1F2}\u{1F1F0}","former yugoslav republic of macedonia","fyr macedonia","fyrom","irjm","ish republika jugosllave e maqedonise","macedonia","macedonia former yugoslav republic of","macedonia fyr","maqedoni","maqedonia","maqedonia e veriut","republic of macedonia","republic of north macedonia","republika e maqedonise","republika e maqedonise se veriut","\u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430","\u0440\u0435\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430","\u0440\u0435\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u0441\u0435\u0432\u0435\u0440\u043D\u0430 \u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430","\u0440\u043C","\u0440\u0441\u043C","\u0441\u0435\u0432\u0435\u0440\u043D\u0430 \u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430"]},{iso3:"MLI",iso2:"ML",m49:"466",name:"Mali",aliases:["\u{1F1F2}\u{1F1F1}","maali","republic of mali"]},{iso3:"MLT",iso2:"MT",m49:"470",name:"Malta",aliases:["\u{1F1F2}\u{1F1F9}","malta island","repubblika ta malta","republic of malta"]},{iso3:"MMR",iso2:"MM",m49:"104",name:"Myanmar",aliases:["\u{1F1F2}\u{1F1F2}","burma","pyidaungzu myanma naingngandaw","pyidaungzu thammada myanma naingngandaw","republic of the union of myanmar","union of burma","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F \u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F \u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F \u101E\u1019\u1039\u1019\u1010 \u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F \u101E\u1019\u1039\u1019\u1010 \u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F\u101E\u1019\u1039\u1019\u1010\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1015\u103C\u200C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F\u101E\u1019\u1039\u1019\u1010\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F\u101E\u1019\u1039\u1019\u1010\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1017\u1019\u102C\u1015\u103C\u100A\u103A","\u1019\u103C\u1014\u103A\u1019\u102C","\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1019\u103C\u1014\u103A\u1019\u102C\u1015\u103C\u100A\u103A"]},{iso3:"MNE",iso2:"ME",m49:"499",name:"Montenegro",aliases:["\u{1F1F2}\u{1F1EA}","crna cora","\u0446\u0440\u043D\u0430 \u0433\u043E\u0440\u0430"]},{iso3:"MNG",iso2:"MN",m49:"496",name:"Mongolia",aliases:["\u{1F1F2}\u{1F1F3}","bugd nayramdah mongol ard uls","mongol uls","state of mongolia","\u043C\u043E\u043D\u0433\u043E\u043B","\u043C\u043E\u043D\u0433\u043E\u043B \u0443\u043B\u0441","\u182E\u1824\u1829\u182D\u1824\u182F \u1824\u182F\u1824\u1830"]},{iso3:"MNP",iso2:"MP",m49:"580",name:"Northern Mariana Islands",aliases:["\u{1F1F2}\u{1F1F5}","cnmi","commonwealth of the northern maria islands","commonwealth of the northern mariana islands","northern marianas","notte marianas","sankattan siha na islas marianas"]},{iso3:"MOZ",iso2:"MZ",m49:"508",name:"Mozambique",aliases:["\u{1F1F2}\u{1F1FF}","mocambique","republic of mozambique","republica de mocambique"]},{iso3:"MRT",iso2:"MR",m49:"478",name:"Mauritania",aliases:["\u{1F1F2}\u{1F1F7}","islamic republic of mauritania","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0625\u0633\u0644\u0627\u0645\u064A\u0629 \u0627\u0644\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0629","\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627"]},{iso3:"MSR",iso2:"MS",m49:"500",name:"Montserrat",aliases:["\u{1F1F2}\u{1F1F8}","island of montserrat"]},{iso3:"MTQ",iso2:"MQ",m49:"474",name:"Martinique",aliases:["\u{1F1F2}\u{1F1F6}","territorial collectivity of martinique"]},{iso3:"MUS",iso2:"MU",m49:"480",name:"Mauritius",aliases:["\u{1F1F2}\u{1F1FA}","ile maurice","la republique de maurice","maurice","moris","republic of mauritius","republique de maurice"]},{iso3:"MWI",iso2:"MW",m49:"454",name:"Malawi",aliases:["\u{1F1F2}\u{1F1FC}","republic of malawi"]},{iso3:"MYS",iso2:"MY",m49:"458",name:"Malaysia",aliases:["\u{1F1F2}\u{1F1FE}","federation of malaysia","malaysia federation","negara seberang tambak","persekutuan malaysia"]},{iso3:"MYT",iso2:"YT",m49:"175",name:"Mayotte",aliases:["\u{1F1FE}\u{1F1F9}","departement de mayotte","departement region de mayotte","department of mayotte"]},{iso3:"NAM",iso2:"NA",m49:"516",name:"Namibia",aliases:["\u{1F1F3}\u{1F1E6}","republic of namibia"]},{iso3:"NCL",iso2:"NC",m49:"540",name:"New Caledonia",aliases:["\u{1F1F3}\u{1F1E8}","caledonie","kanaky","kanaky nouvelle caledonie","nouvelle caledonie","territoire de la nouvelle caledonie et dependances","territoire des nouvelle caledonie et dependances","territory of new caledonia and dependencies"]},{iso3:"NER",iso2:"NE",m49:"562",name:"Niger",aliases:["\u{1F1F3}\u{1F1EA}","jamhuriyar nijar","nijar","republic niger","republic of niger","republic of the niger"]},{iso3:"NFK",iso2:"NF",m49:"574",name:"Norfolk Island",aliases:["\u{1F1F3}\u{1F1EB}","norfolk island australia","norfolk island other territories","norfolk island other territories australia","territory of norfolk island"]},{iso3:"NGA",iso2:"NG",m49:"566",name:"Nigeria",aliases:["\u{1F1F3}\u{1F1EC}","federal republic of nigeria","naija"]},{iso3:"NIC",iso2:"NI",m49:"558",name:"Nicaragua",aliases:["\u{1F1F3}\u{1F1EE}","republic of nicaragua","republica de nicaragua"]},{iso3:"NIU",iso2:"NU",m49:"570",name:"Niue",aliases:["\u{1F1F3}\u{1F1FA}"]},{iso3:"NLD",iso2:"NL",m49:"528",name:"Kingdom of the Netherlands",aliases:["\u{1F1F3}\u{1F1F1}","hollandt","kingdom of netherlands","koninkrijk der nederlanden","nederland","nederlanden","nederlandt","netherlands","netherlands kingdom of the"]},{iso3:"NOR",iso2:"NO",m49:"578",name:"Norway",aliases:["\u{1F1F3}\u{1F1F4}","kingdom of norway","kongeriket noreg","kongeriket norge","noreg","norge"]},{iso3:"NPL",iso2:"NP",m49:"524",name:"Nepal",aliases:["\u{1F1F3}\u{1F1F5}","bal bo","bal poi yul","bal yul","balbo","balpo","balpo yul","nipal","sanghiya loktantrik ganatantra nepal","\u0928\u0947\u092A\u093E\u0932","\u0938\u0902\u0918\u093F\u092F \u0932\u094B\u0915\u0924\u093E\u0928\u094D\u0924\u094D\u0930\u093F\u0915 \u0917\u0923\u0924\u0928\u094D\u0924\u094D\u0930 \u0928\u0947\u092A\u093E\u0932","\u0938\u0902\u0918\u093F\u092F \u0932\u094B\u0915\u0924\u093E\u0928\u094D\u0924\u094D\u0930\u093F\u0915 \u0917\u0923\u0924\u0928\u094D\u0924\u094D\u0930\u093E\u0924\u094D\u092E\u0915 \u0928\u0947\u092A\u093E\u0932","\u0938\u0902\u0918\u0940\u092F \u0932\u094B\u0915\u0924\u093E\u0928\u094D\u0924\u094D\u0930\u093F\u0915 \u0917\u0923\u0924\u0928\u094D\u0924\u094D\u0930 \u0928\u0947\u092A\u093E\u0932"]},{iso3:"NRU",iso2:"NR",m49:"520",name:"Naoero",aliases:["\u{1F1F3}\u{1F1F7}","nauru","pleasant island","republic of naoero","republic of nauru"]},{iso3:"NZL",iso2:"NZ",m49:"554",name:"New Zealand",aliases:["\u{1F1F3}\u{1F1FF}","aotearoa","aotearoa new zealand","dominion of new zealand"]},{iso3:"OMN",iso2:"OM",m49:"512",name:"Oman",aliases:["\u{1F1F4}\u{1F1F2}","sultanate of oman","uman","\u0633\u0644\u0637\u0646\u0629 \u0639\u0645\u0627\u0646","\u0639\u0645\u0627\u0646"]},{iso3:"PAK",iso2:"PK",m49:"586",name:"Pakistan",aliases:["\u{1F1F5}\u{1F1F0}","hoi quoc","islamic republic of pakistan","republic of pakistan","tay hoi","\u0627\u0633\u0644\u0627\u0645\u06CC \u062C\u0645\u06C1\u0648\u0631\u06CC\u06C1 \u067E\u0627\u06A9\u0633\u062A\u0627\u0646","\u0628\u0627\u06A9\u0633\u062A\u0627\u0646","\u067E\u0627\u06A9\u0633\u062A\u0627\u0646"]},{iso3:"PAN",iso2:"PA",m49:"591",name:"Panama",aliases:["\u{1F1F5}\u{1F1E6}","republic of panama","republica de panama"]},{iso3:"PCN",iso2:"PN",m49:"612",name:"Pitcairn",aliases:["\u{1F1F5}\u{1F1F3}","occas island","pisskern ali\u0435n","pitcairn henderson ducie and oeno islands","pitcairn island","pitcairn islands","pitkern ailen"]},{iso3:"PER",iso2:"PE",m49:"604",name:"Peru",aliases:["\u{1F1F5}\u{1F1EA}","piruw","piruw ripuwlika","republic of peru","republica del peru"]},{iso3:"PHL",iso2:"PH",m49:"608",name:"Philippines",aliases:["\u{1F1F5}\u{1F1ED}","philippine islands","republic of the philippines"]},{iso3:"PLW",iso2:"PW",m49:"585",name:"Palau",aliases:["\u{1F1F5}\u{1F1FC}","belau","peeloo","pelew","pelew islands","pellew","republic of belau","republic of palau","\u30D1\u30E9\u30AA","\u30D1\u30E9\u30AA\u5171\u548C\u56FD"]},{iso3:"PNG",iso2:"PG",m49:"598",name:"Papua New Guinea",aliases:["\u{1F1F5}\u{1F1EC}","independent state of papua new guinea","papua niugini"]},{iso3:"POL",iso2:"PL",m49:"616",name:"Poland",aliases:["\u{1F1F5}\u{1F1F1}","polska","republic of poland","rzeczpospolita polska"]},{iso3:"PRI",iso2:"PR",m49:"630",name:"Puerto Rico",aliases:["\u{1F1F5}\u{1F1F7}","boriken","borinquen","boriquen","commonwealth of puerto rico","estado libre asociado de puerto rico","free associated state of puerto rico","isla del encanto","island of enchantment","isle of enchantment","mancomunidad de puerto rico","porto rico","territorio de puerto rico","territorio estadounidense de puerto rico","territory of porto rico","territory of puerto rico"]},{iso3:"PRK",iso2:"KP",m49:"408",name:"Democratic People's Republic of Korea",aliases:["\u{1F1F0}\u{1F1F5}","choson minjujuui inmin konghwaguk","dpr korea","dprk","korea democratic peoples republic of","n korea","north korea","\uACF5\uD654\uAD6D","\uBD81\uC870\uC120","\uBD81\uD55C","\uC870\uC120","\uC870\uC120\uBBFC\uC8FC\uC8FC\uC758\uC778\uBBFC\uACF5\uD654\uAD6D"]},{iso3:"PRT",iso2:"PT",m49:"620",name:"Portugal",aliases:["\u{1F1F5}\u{1F1F9}","republica portuguesa"]},{iso3:"PRY",iso2:"PY",m49:"600",name:"Paraguay",aliases:["\u{1F1F5}\u{1F1FE}","paraguai","republic of paraguay","republica del paraguay","teta paraguai"]},{iso3:"PSE",iso2:"PS",m49:"275",name:"State of Palestine",aliases:["\u{1F1F5}\u{1F1F8}","palestine","palestine state of","palestinian authority","palestinian national authority","palestinian territory","west bank and gaza","\u0623\u0631\u0627\u0636\u064A \u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u0623\u0631\u0627\u0636\u064A \u0627\u0644\u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u062F\u0648\u0644\u0629 \u0627\u0644\u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u0633\u0644\u0637\u0629 \u0627\u0644\u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u0633\u0644\u0637\u0629 \u0627\u0644\u0648\u0637\u0646\u064A\u0629 \u0627\u0644\u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u0636\u0641\u0629 \u0627\u0644\u063A\u0631\u0628\u064A\u0629 \u0648\u0642\u0637\u0627\u0639 \u063A\u0632\u0629","\u062F\u0648\u0644\u0629 \u0641\u0644\u0633\u0637\u064A\u0646","\u0641\u0644\u0633\u0637\u064A\u0646"]},{iso3:"PYF",iso2:"PF",m49:"258",name:"French Polynesia",aliases:["\u{1F1F5}\u{1F1EB}","f oh","french establishments in oceania","french oceania","french settlements in oceania","polynesie francaise","territoire de la polynesie francaise","territory of french polynesia"]},{iso3:"QAT",iso2:"QA",m49:"634",name:"Qatar",aliases:["\u{1F1F6}\u{1F1E6}","state of qatar","\u0625\u0645\u0627\u0631\u0629 \u0642\u0637\u0631","\u062F\u0648\u0644\u0629 \u0642\u0637\u0631","\u0642\u0637\u0631"]},{iso3:"REU",iso2:"RE",m49:"638",name:"R\xE9union",aliases:["\u{1F1F7}\u{1F1EA}","ile bourbon","ile de la reunion","la reunion","re","region reunion","reunion island"]},{iso3:"ROU",iso2:"RO",m49:"642",name:"Romania",aliases:["\u{1F1F7}\u{1F1F4}"]},{iso3:"RUS",iso2:"RU",m49:"643",name:"Russian Federation",aliases:["\u{1F1F7}\u{1F1FA}","federation of russia","russia","\u0440\u043E\u0441\u0441\u0438\u0438\u0441\u043A\u0430\u044F \u0444\u0435\u0434\u0435\u0440\u0430\u0446\u0438\u044F","\u0440\u043E\u0441\u0441\u0438\u044F","\u0440\u0444"]},{iso3:"RWA",iso2:"RW",m49:"646",name:"Rwanda",aliases:["\u{1F1F7}\u{1F1FC}","igihugu cyimisozi igihumbi","jamhuri ya rwanda","la republique du rwanda","land of a thousand hills","republic of rwanda","republika yu rwanda","republique du rwanda","republique rwandaise","repubulika yu rwanda","u rwanda"]},{iso3:"SAU",iso2:"SA",m49:"682",name:"Saudi Arabia",aliases:["\u{1F1F8}\u{1F1E6}","kingdom of saudi arabia","\u0627\u0644\u062F\u0648\u0644\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u062F\u0648\u0644\u0647 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0647","\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0647","\u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0647","\u0627\u0644\u0645\u0645\u0644\u0643\u0647 \u0627\u0644\u0639\u0631\u0628\u064A\u0647 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0647","\u0628\u0644\u0627\u062F \u0627\u0644\u062D\u0631\u0645\u064A\u0646 \u0627\u0644\u0634\u0631\u064A\u0641\u064A\u0646","\u062F\u0648\u0644\u0629 \u0622\u0644 \u0633\u0639\u0648\u062F","\u0633\u0639\u0648\u062F\u064A\u0629","\u0633\u0639\u0648\u062F\u064A\u0647","\u0645\u0646\u0628\u0639 \u0627\u0644\u0631\u0633\u0627\u0644\u0629","\u0645\u0647\u0628\u0637 \u0627\u0644\u0648\u062D\u064A"]},{iso3:"SDN",iso2:"SD",m49:"729",name:"Sudan",aliases:["\u{1F1F8}\u{1F1E9}","al sudan","as sudan","north sudan","republic of sudan","republic of the sudan","soudan","\u0627\u0644\u0633\u0648\u062F\u0627\u0646","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0633\u0648\u062F\u0627\u0646"]},{iso3:"SEN",iso2:"SN",m49:"686",name:"Senegal",aliases:["\u{1F1F8}\u{1F1F3}","la republique du senegal","republic of senegal","republique du senegal","sen","senegaal"]},{iso3:"SGP",iso2:"SG",m49:"702",name:"Singapore",aliases:["\u{1F1F8}\u{1F1EC}","garden city","lion city","republic of singapore","republik singapura","singapore city","singapura","spore","\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD","\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD \u0B95\u0BC1\u0B9F\u0BBF\u0BAF\u0BB0\u0B9A\u0BC1","\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BC8","\u0BB8\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BC2\u0BB0\u0BCD"]},{iso3:"SGS",iso2:"GS",m49:"239",name:"South Georgia and the South Sandwich Islands",aliases:["\u{1F1EC}\u{1F1F8}","falkland islands dependencies","sgssi","south georgia","south georgia & south sandwich islands","south sandwich islands"]},{iso3:"SHN",iso2:"SH",m49:"654",name:"Saint Helena",aliases:["\u{1F1F8}\u{1F1ED}","ascension","saint helena and dependencies","saint helena ascension and tristan da cunha","tristan da cunha"]},{iso3:"SJM",iso2:"SJ",m49:"744",name:"Svalbard and Jan Mayen Islands",aliases:["\u{1F1F8}\u{1F1EF}","jan mayen","svalbard","svalbard and jan mayen","svalbard og jan mayen"]},{iso3:"SLB",iso2:"SB",m49:"090",name:"Solomon Islands",aliases:["\u{1F1F8}\u{1F1E7}"]},{iso3:"SLE",iso2:"SL",m49:"694",name:"Sierra Leone",aliases:["\u{1F1F8}\u{1F1F1}","republic of sierra leone"]},{iso3:"SLV",iso2:"SV",m49:"222",name:"El Salvador",aliases:["\u{1F1F8}\u{1F1FB}","republic of el salvador","republica de el salvador","salvador"]},{iso3:"SMR",iso2:"SM",m49:"674",name:"San Marino",aliases:["\u{1F1F8}\u{1F1F2}","most serene republic of san marino","repubblica di san marino","serenissima repubblica di san marino"]},{iso3:"SOM",iso2:"SO",m49:"706",name:"Somalia",aliases:["\u{1F1F8}\u{1F1F4}","as sumal","federal republic of somalia","jamhuuriyadda federaalka soomaaliya","jamhuuriyadda soomaaliyeed","soomaaliya","soomaaliyeey toosoo","\u0627\u0644\u0635\u0648\u0645\u0627\u0644","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0635\u0648\u0645\u0627\u0644","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0635\u0648\u0645\u0627\u0644 \u0627\u0644\u062F\u064A\u0645\u0648\u0642\u0631\u0627\u0637\u064A\u0629","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0635\u0648\u0645\u0627\u0644 \u0627\u0644\u0641\u064A\u062F\u0631\u0627\u0644\u064A\u0629","\u0635\u0648\u0645\u0627\u0644"]},{iso3:"SPM",iso2:"PM",m49:"666",name:"Saint Pierre and Miquelon",aliases:["\u{1F1F5}\u{1F1F2}","collectivite territoriale de saint pierre et miquelon","miquelon","saint pierre","saint pierre et miquelon","territorial collectivity of saint pierre and miquelon"]},{iso3:"SRB",iso2:"RS",m49:"688",name:"Serbia",aliases:["\u{1F1F7}\u{1F1F8}","republic of serbia","republika srbija","\u0440\u0435\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u0441\u0440\u0431\u0438\u0458\u0430","\u0441\u0440\u0431\u0438\u0458\u0430"]},{iso3:"SSD",iso2:"SS",m49:"728",name:"South Sudan",aliases:["\u{1F1F8}\u{1F1F8}","republic of south sudan","southern sudan"]},{iso3:"STP",iso2:"ST",m49:"678",name:"Sao Tome and Principe",aliases:["\u{1F1F8}\u{1F1F9}","democratic republic of sao tome and principe","principe","republica democratica de sao tome e principe","sao tome","sao tome e principe","sao tome og principe"]},{iso3:"SUR",iso2:"SR",m49:"740",name:"Suriname",aliases:["\u{1F1F8}\u{1F1F7}","dutch guiana","republic of surinam","republic of suriname","republiek suriname","surinam","surrinam"]},{iso3:"SVK",iso2:"SK",m49:"703",name:"Slovakia",aliases:["\u{1F1F8}\u{1F1F0}","slovak republic","slovenska republika","slovensko"]},{iso3:"SVN",iso2:"SI",m49:"705",name:"Slovenia",aliases:["\u{1F1F8}\u{1F1EE}","republic of slovenia","republika slovenija","slovenija"]},{iso3:"SWE",iso2:"SE",m49:"752",name:"Sweden",aliases:["\u{1F1F8}\u{1F1EA}","kingdom of sweden","konungadomet sverige","konungariket sverige","kungadomet sverige","kungariket sverige","sverige","swedish kingdom"]},{iso3:"SWZ",iso2:"SZ",m49:"748",name:"Eswatini",aliases:["\u{1F1F8}\u{1F1FF}","kingdom of eswatini","kingdom of swaziland","swaziland","umbuso weswatini"]},{iso3:"SXM",iso2:"SX",m49:"534",name:"Sint Maarten (Dutch part)",aliases:["\u{1F1F8}\u{1F1FD}","country of sint maarten","eilandgebied sint maarten","land sint maarten","saint maarten","saint martin dutch part","sint maarten","sint martin"]},{iso3:"SYC",iso2:"SC",m49:"690",name:"Seychelles",aliases:["\u{1F1F8}\u{1F1E8}","la republique des seychelles","repiblik sesel","republic of seychelles","republique des seychelles"]},{iso3:"SYR",iso2:"SY",m49:"760",name:"Syrian Arab Republic",aliases:["\u{1F1F8}\u{1F1FE}","surya","syria","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0633\u0648\u0631\u064A\u0629","\u0627\u0644\u0634\u0627\u0645","\u0633\u0648\u0631\u064A\u0627","\u0633\u0648\u0631\u064A\u0629"]},{iso3:"TCA",iso2:"TC",m49:"796",name:"Turks and Caicos Islands",aliases:["\u{1F1F9}\u{1F1E8}","caicos","caicos islands","turks","turks & caicos","turks islands"]},{iso3:"TCD",iso2:"TD",m49:"148",name:"Chad",aliases:["\u{1F1F9}\u{1F1E9}","la republique du tchad","republic of chad","republique du tchad","tchad","\u062A\u0634\u0627\u062F","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u062A\u0634\u0627\u062F"]},{iso3:"TGO",iso2:"TG",m49:"768",name:"Togo",aliases:["\u{1F1F9}\u{1F1EC}","la republique togolaise","republique togolaise","togolese republic"]},{iso3:"THA",iso2:"TH",m49:"764",name:"Thailand",aliases:["\u{1F1F9}\u{1F1ED}","kingdom of siam","kingdom of thailand","siam","thai","\u0E44\u0E17\u0E22","\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E44\u0E17\u0E22","\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E2A\u0E22\u0E32\u0E21","\u0E40\u0E21\u0E37\u0E2D\u0E07\u0E44\u0E17\u0E22","\u0E23\u0E32\u0E0A\u0E2D\u0E32\u0E13\u0E32\u0E08\u0E31\u0E01\u0E23\u0E44\u0E17\u0E22","\u0E23\u0E32\u0E0A\u0E2D\u0E32\u0E13\u0E32\u0E08\u0E31\u0E01\u0E23\u0E2A\u0E22\u0E32\u0E21","\u0E2A\u0E22\u0E32\u0E21"]},{iso3:"TJK",iso2:"TJ",m49:"762",name:"Tajikistan",aliases:["\u{1F1F9}\u{1F1EF}","jumhurii tojikiston","republic of tajikistan","\u0442\u043E\u04B7\u0438\u043A\u0438\u0441\u0442\u043E\u043D","\u0442\u04B7","\u0442\u04B7\u043A","\u04B7\u0442","\u04B7\u0443\u043C\u04B3\u0443\u0440\u0438\u0438 \u0442\u043E\u04B7\u0438\u043A\u0438\u0441\u0442\u043E\u043D"]},{iso3:"TKL",iso2:"TK",m49:"772",name:"Tokelau",aliases:["\u{1F1F9}\u{1F1F0}","tokelau islands","union islands"]},{iso3:"TKM",iso2:"TM",m49:"795",name:"Turkmenistan",aliases:["\u{1F1F9}\u{1F1F2}"]},{iso3:"TLS",iso2:"TL",m49:"626",name:"Timor-Leste",aliases:["\u{1F1F9}\u{1F1F1}","democratic republic of timor leste","east timor","republica democratica de timor leste","republika demokratika timor lorosae","timor loro sae","timor lorosae"]},{iso3:"TON",iso2:"TO",m49:"776",name:"Tonga",aliases:["\u{1F1F9}\u{1F1F4}","friendly islands","kingdom of tonga","puleanga fakatui o tonga","tonga islands"]},{iso3:"TTO",iso2:"TT",m49:"780",name:"Trinidad and Tobago",aliases:["\u{1F1F9}\u{1F1F9}","republic of trinidad and tobago","tobago","trinidad"]},{iso3:"TUN",iso2:"TN",m49:"788",name:"Tunisia",aliases:["\u{1F1F9}\u{1F1F3}","republic of tunisia","tunisian republic","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u062A\u0648\u0646\u0633\u064A\u0629","\u062A\u0648\u0646\u0633","\u062A\u0648\u0646\u0633 \u0627\u0644\u062E\u0636\u0631\u0627\u0621"]},{iso3:"TUR",iso2:"TR",m49:"792",name:"T\xFCrkiye",aliases:["\u{1F1F9}\u{1F1F7}","republic of turkey","republic of turkiye","turkey","turkiye cumhuriyeti"]},{iso3:"TUV",iso2:"TV",m49:"798",name:"Tuvalu",aliases:["\u{1F1F9}\u{1F1FB}","ellice islands"]},{iso3:"TWN",iso2:"TW",m49:"158",name:"Taiwan",aliases:["\u{1F1F9}\u{1F1FC}","chinese republic","chinese taipei","chunghwa minkuo","chunghwa minkwo","conghwaminku","cunghwa minkwo","cyukamingkok","formosa","nanasian","nationalist china","republic of china","republic of china taiwan","roc","taivang","taiwan province of china","taiwan roc","taywan","taywang","teywan","\u4E2D\u83EF\u6C11\u570B","\u4E2D\u83EF\u6C11\u570B\uFF08\u81FA\u7063\uFF09","\u4E2D\u83EF\u81FA\u5317","\u53F0\u7063","\u81FA\u6F8E\u91D1\u99AC","\u81FA\u7063"]},{iso3:"TZA",iso2:"TZ",m49:"834",name:"United Republic of Tanzania",aliases:["\u{1F1F9}\u{1F1FF}","jamhuri ya muungano wa tanganyika na zanzibar","jamhuri ya muungano wa tanzania","tanzania","tanzania jamhuri ya muungano wa","tanzania united republic of","united republic of tanganyika and zanzibar"]},{iso3:"UGA",iso2:"UG",m49:"800",name:"Uganda",aliases:["\u{1F1FA}\u{1F1EC}","jamhuri ya uganda","lulu ya afrika","ouganda","pearl of africa","republic of uganda","ugandah"]},{iso3:"UKR",iso2:"UA",m49:"804",name:"Ukraine",aliases:["\u{1F1FA}\u{1F1E6}","ukr","ukraina","ukrainia","ukrayina","\u0432\u043A\u0440\u0430\u0456\u043D\u0430","\u0443\u043A\u0440\u0430\u0456\u043D\u0430"]},{iso3:"UMI",iso2:"UM",m49:"581",name:"United States Minor Outlying Islands",aliases:["\u{1F1FA}\u{1F1F2}","us minor outlying islands","us outlying islands","usmoi"]},{iso3:"URY",iso2:"UY",m49:"858",name:"Uruguay",aliases:["\u{1F1FA}\u{1F1FE}","eastern republic of uruguay","oriental republic of uruguay"]},{iso3:"USA",iso2:"US",m49:"840",name:"United States of America",aliases:["\u{1F1FA}\u{1F1F8}","amelika","amelika hui pu ia","amelika huipuia","amelika mokuaina hui pu ia","america","eeuu","eeuu de america","estados unidos","estados unidos de america","los estados","los estados unidos","los estados unidos de america","mokuaina hui pu ia","union americana","united states","us","us of a","us of america","usa"]},{iso3:"UZB",iso2:"UZ",m49:"860",name:"Uzbekistan",aliases:["\u{1F1FA}\u{1F1FF}","ozbek","ozbekiston","ozbekiston respublikasi","republic of uzbekistan","uzbekiston respublikasi"]},{iso3:"VAT",iso2:"VA",m49:"336",name:"Holy See",aliases:["\u{1F1FB}\u{1F1E6}","citta del vaticano","civitas vaticana","colle vaticano","papal state","santa sede citta del vaticano","state of vatican city","stato della citta del vaticano","status civitatis vaticanae","status civitatis vatican\xE6","vatican","vatican city","vatican city state","vaticano"]},{iso3:"VCT",iso2:"VC",m49:"670",name:"Saint Vincent and the Grenadines",aliases:["\u{1F1FB}\u{1F1E8}","grenadines","saint vincent","saint vincent and grenadines"]},{iso3:"VEN",iso2:"VE",m49:"862",name:"Venezuela (Bolivarian Republic of)",aliases:["\u{1F1FB}\u{1F1EA}","bolivarian republic of venezuela","br venezuela","estados unidos de venezuela","rb venezuela","republic of venezuela","republica bolivariana de venezuela","republica de venezuela","venezuela"]},{iso3:"VGB",iso2:"VG",m49:"092",name:"British Virgin Islands",aliases:["\u{1F1FB}\u{1F1EC}","bvi","virgin islands british","virgin islands of the united kingdom","virgin islands united kingdom"]},{iso3:"VIR",iso2:"VI",m49:"850",name:"United States Virgin Islands",aliases:["\u{1F1FB}\u{1F1EE}","american virgin islands","us virgin islands","virgin islands of the united states","virgin islands us"]},{iso3:"VNM",iso2:"VN",m49:"704",name:"Viet Nam",aliases:["\u{1F1FB}\u{1F1F3}","chxhcn viet nam","chxhcnvn","cong hoa xa hoi chu nghia viet nam","socialist republic of viet nam","socialist republic of vietnam","vietnam"]},{iso3:"VUT",iso2:"VU",m49:"548",name:"Vanuatu",aliases:["\u{1F1FB}\u{1F1FA}","la republique du vanuatu","republic of vanuatu","republique de vanuatu","ripablik blong vanuatu"]},{iso3:"WLF",iso2:"WF",m49:"876",name:"Wallis and Futuna Islands",aliases:["\u{1F1FC}\u{1F1EB}","collectivite des iles wallis et futuna","emeni simete","futuna","iles wallis et futuna","makape papilio","territoire de wallis et futuna","territoire des iles wallis et futuna","wallis","wallis & futuna","wallis et futuna"]},{iso3:"WSM",iso2:"WS",m49:"882",name:"Samoa",aliases:["\u{1F1FC}\u{1F1F8}","independent state of samoa","malo saoloto tutoatasi o samoa","samoa i sisifo","western samoa"]},{iso3:"YEM",iso2:"YE",m49:"887",name:"Yemen",aliases:["\u{1F1FE}\u{1F1EA}","rep yemen","republic of yemen","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u064A\u0645\u0646\u064A\u0629","\u0627\u0644\u064A\u0645\u0646","\u062F\u0648\u0644\u0629 \u0627\u0644\u064A\u0645\u0646"]},{iso3:"ZAF",iso2:"ZA",m49:"710",name:"South Africa",aliases:["\u{1F1FF}\u{1F1E6}","aferika borwa","aforika borwa","afrika boroa","afrika borwa","afrika dzonga","afurika tshipembe","emzantsi afrika","iningizimu afrika","iriphabhulikhi ye ningizimu afrika","iriphabhulikhi yeningizimu afrika","iriphabhuliki yase ningizimu afrika","iriphabliki yasemzantsi afrika","iriphabliki yaseningizimu afrika","iriphabliki yom zantsi afrika","isewula afrika","repabliki ya afrika borwa","rephaboliki ya aforika borwa","rephaboliki ya afrika borwa","republic of south africa","republiek van suid afrika","riphabliki ra afrika dzonga","rsa","suid afrika","umzansi","umzantsi afrika","unie van suid afrika","union of south africa"]},{iso3:"ZMB",iso2:"ZM",m49:"894",name:"Zambia",aliases:["\u{1F1FF}\u{1F1F2}","northern rhodesia","republic of zambia"]},{iso3:"ZWE",iso2:"ZW",m49:"716",name:"Zimbabwe",aliases:["\u{1F1FF}\u{1F1FC}","ezimbabwe","izimbabwe","republic of zimbabwe","rhodesia","southern rhodesia","zimbabwe rhodesia","zimbagwe"]}];function f(v){return v.normalize("NFD").replace(/[\u0300-\u036F]/g,"").normalize("NFC").toLowerCase().replace(/[\u064B-\u065F]/g,"").replace(/['\u2018\u2019\u02BB\u02BC\u02BD\u02C8\u2032`]/g,"").replace(/&/g," and ").replace(/([,(])\s*the\b/g,"$1").replace(/[.(),[\]]/g,"").replace(/[-\u2013\u2014]/g," ").replace(/\bst\b/g,"saint").trim().replace(/\s+/g," ").replace(/^the\s+/,"")}function h(v){let x=new Map,S=new Map,M=new Map;for(let A of v)x.set(A.iso3,A),A.iso2&&S.set(A.iso2,A),A.m49&&M.set(A.m49,A);let C=new Map;for(let A of v)for(let b of[A.name,...A.aliases]){let E=f(b),T=C.get(E);if(T!==void 0&&T!==A.iso3)throw new Error(`Duplicate name/alias "${E}": ${T} vs ${A.iso3}`);C.set(E,A.iso3)}function w(A){if(A==null)return;let b=String(A).trim();if(!b)return;if(/^\d+$/.test(b)){let T=M.get(String(parseInt(b,10)).padStart(3,"0"));if(T)return T}if(/^[A-Za-z]{2}$/.test(b)){let T=S.get(b.toUpperCase());if(T)return T}if(/^[A-Za-z]{3}$/.test(b)){let T=x.get(b.toUpperCase());if(T)return T}let E=C.get(f(b));return E===void 0?void 0:x.get(E)}function k(A){var b;return(b=w(A))==null?void 0:b.iso3}return{lookup:w,lookupAlpha3:k,byAlpha3:x,byAlpha2:S,byM49:M}}var d=h(c),p=d.lookup,g=d.lookupAlpha3,m=d.byAlpha3,y=d.byAlpha2,_=d.byM49}}),x4=de({"node_modules/@turf/helpers/dist/cjs/index.cjs"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=63710088e-1,t={centimeters:r*100,centimetres:r*100,degrees:360/(2*Math.PI),feet:r*3.28084,inches:r*39.37,kilometers:r/1e3,kilometres:r/1e3,meters:r,metres:r,miles:r/1609.344,millimeters:r*1e3,millimetres:r*1e3,nauticalmiles:r/1852,radians:1,yards:r*1.0936},i={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function a(D,R,P={}){let z={type:"Feature"};return(P.id===0||P.id)&&(z.id=P.id),P.bbox&&(z.bbox=P.bbox),z.properties=R||{},z.geometry=D,z}function o(D,R,P={}){switch(D){case"Point":return s(R).geometry;case"LineString":return c(R).geometry;case"Polygon":return n(R).geometry;case"MultiPoint":return p(R).geometry;case"MultiLineString":return d(R).geometry;case"MultiPolygon":return g(R).geometry;default:throw new Error(D+" is invalid")}}function s(D,R,P={}){if(!D)throw new Error("coordinates is required");if(!Array.isArray(D))throw new Error("coordinates must be an Array");if(D.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(D[0])||!b(D[1]))throw new Error("coordinates must contain numbers");return a({type:"Point",coordinates:D},R,P)}function l(D,R,P={}){return h(D.map(z=>s(z,R)),P)}function n(D,R,P={}){for(let I of D){if(I.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(I[I.length-1].length!==I[0].length)throw new Error("First and last Position are not equivalent.");for(let L=0;Ln(z,R)),P)}function c(D,R,P={}){if(D.length<2)throw new Error("coordinates must be an array of two or more positions");return a({type:"LineString",coordinates:D},R,P)}function f(D,R,P={}){return h(D.map(z=>c(z,R)),P)}function h(D,R={}){let P={type:"FeatureCollection"};return R.id&&(P.id=R.id),R.bbox&&(P.bbox=R.bbox),P.features=D,P}function d(D,R,P={}){return a({type:"MultiLineString",coordinates:D},R,P)}function p(D,R,P={}){return a({type:"MultiPoint",coordinates:D},R,P)}function g(D,R,P={}){return a({type:"MultiPolygon",coordinates:D},R,P)}function m(D,R,P={}){return a({type:"GeometryCollection",geometries:D},R,P)}function y(D,R=0){if(R&&!(R>=0))throw new Error("precision must be a positive number");let P=Math.pow(10,R||0);return Math.round(D*P)/P}function _(D,R="kilometers"){let P=t[R];if(!P)throw new Error(R+" units is invalid");return D*P}function v(D,R="kilometers"){let P=t[R];if(!P)throw new Error(R+" units is invalid");return D/P}function x(D,R){return C(v(D,R))}function S(D){let R=D%360;return R<0&&(R+=360),R}function M(D){return D=D%360,D>180?D-360:D<-180?D+360:D}function C(D){return D%(2*Math.PI)*180/Math.PI}function w(D){return D%360*Math.PI/180}function k(D,R="kilometers",P="kilometers"){if(!(D>=0))throw new Error("length must be a positive number");return _(v(D,R),P)}function A(D,R="meters",P="kilometers"){if(!(D>=0))throw new Error("area must be a positive number");let z=i[R];if(!z)throw new Error("invalid original units");let I=i[P];if(!I)throw new Error("invalid final units");return D/z*I}function b(D){return!isNaN(D)&&D!==null&&!Array.isArray(D)}function E(D){return D!==null&&typeof D=="object"&&!Array.isArray(D)}function T(D){if(!D)throw new Error("bbox is required");if(!Array.isArray(D))throw new Error("bbox must be an Array");if(D.length!==4&&D.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");D.forEach(R=>{if(!b(R))throw new Error("bbox must only contain numbers")})}function F(D){if(!D)throw new Error("id is required");if(["string","number"].indexOf(typeof D)===-1)throw new Error("id must be a number or a string")}e.areaFactors=i,e.azimuthToBearing=M,e.bearingToAzimuth=S,e.convertArea=A,e.convertLength=k,e.degreesToRadians=w,e.earthRadius=r,e.factors=t,e.feature=a,e.featureCollection=h,e.geometry=o,e.geometryCollection=m,e.isNumber=b,e.isObject=E,e.lengthToDegrees=x,e.lengthToRadians=v,e.lineString=c,e.lineStrings=f,e.multiLineString=d,e.multiPoint=p,e.multiPolygon=g,e.point=s,e.points=l,e.polygon=n,e.polygons=u,e.radiansToDegrees=C,e.radiansToLength=_,e.round=y,e.validateBBox=T,e.validateId=F}}),b4=de({"node_modules/@turf/meta/dist/cjs/index.cjs"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=x4();function t(v,x,S){if(v!==null)for(var M,C,w,k,A,b,E,T=0,F=0,D,R=v.type,P=R==="FeatureCollection",z=R==="Feature",I=P?v.features.length:1,L=0;Lb||P>E||z>T){A=F,b=M,E=P,T=z,w=0;return}var I=r.lineString.call(void 0,[A,F],S.properties);if(x(I,M,C,z,w)===!1)return!1;w++,A=F})===!1)return!1}}})}function p(v,x,S){var M=S,C=!1;return d(v,function(w,k,A,b,E){C===!1&&S===void 0?M=w:M=x(M,w,k,A,b,E),C=!0}),M}function g(v,x){if(!v)throw new Error("geojson is required");f(v,function(S,M,C){if(S.geometry!==null){var w=S.geometry.type,k=S.geometry.coordinates;switch(w){case"LineString":if(x(S,M,C,0,0)===!1)return!1;break;case"Polygon":for(var A=0;Af+a(h),0)}function a(c){let f=0,h;switch(c.type){case"Polygon":return o(c.coordinates);case"MultiPolygon":for(h=0;h0){f+=Math.abs(n(c[0]));for(let h=1;h=f?(d+2)%f:d+2],y=p[0]*l,_=g[1]*l,v=m[0]*l;h+=(v-y)*Math.sin(_),d++}return h*s}var u=i;e.area=i,e.default=u}}),VY=de({"node_modules/@turf/centroid/dist/cjs/index.cjs"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=x4(),t=b4();function i(o,s={}){let l=0,n=0,u=0;return t.coordEach.call(void 0,o,function(c){l+=c[0],n+=c[1],u++},!0),r.point.call(void 0,[l/u,n/u],s.properties)}var a=i;e.centroid=i,e.default=a}}),GY=de({"node_modules/d3-geo/node_modules/d3-array/dist/d3-array.js"(e,r){(function(t,i){i(typeof e=="object"&&typeof r<"u"?e:t.d3=t.d3||{})})(e,(function(t){"use strict";function i($,U){return $U?1:$>=U?0:NaN}function a($){return $.length===1&&($=o($)),{left:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)<0?j=Y+1:q=Y}return j},right:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)>0?q=Y:j=Y+1}return j}}}function o($){return function(U,V){return i($(U),V)}}var s=a(i),l=s.right,n=s.left;function u($,U){U==null&&(U=c);for(var V=0,j=$.length-1,q=$[0],Y=new Array(j<0?0:j);V$?1:U>=$?0:NaN}function d($){return $===null?NaN:+$}function p($,U){var V=$.length,j=0,q=-1,Y=0,K,te,ne=0;if(U==null)for(;++q1)return ne/(j-1)}function g($,U){var V=p($,U);return V&&Math.sqrt(V)}function m($,U){var V=$.length,j=-1,q,Y,K;if(U==null){for(;++j=q)for(Y=K=q;++jq&&(Y=q),K=q)for(Y=K=q;++jq&&(Y=q),K0)return[$];if((j=U<$)&&(Y=$,$=U,U=Y),(te=b($,U,V))===0||!isFinite(te))return[];if(te>0)for($=Math.ceil($/te),U=Math.floor(U/te),K=new Array(Y=Math.ceil(U-$+1));++q=0?(Y>=C?10:Y>=w?5:Y>=k?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(Y>=C?10:Y>=w?5:Y>=k?2:1)}function E($,U,V){var j=Math.abs(U-$)/Math.max(0,V),q=Math.pow(10,Math.floor(Math.log(j)/Math.LN10)),Y=j/q;return Y>=C?q*=10:Y>=w?q*=5:Y>=k&&(q*=2),U<$?-q:q}function T($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function F(){var $=S,U=m,V=T;function j(q){var Y,K=q.length,te,ne=new Array(K);for(Y=0;Yce;)pe.pop(),--xe;var ye=new Array(xe+1),fe;for(Y=0;Y<=xe;++Y)fe=ye[Y]=[],fe.x0=Y>0?pe[Y-1]:le,fe.x1=Y=1)return+V($[j-1],j-1,$);var j,q=(j-1)*U,Y=Math.floor(q),K=+V($[Y],Y,$),te=+V($[Y+1],Y+1,$);return K+(te-K)*(q-Y)}}function R($,U,V){return $=v.call($,d).sort(i),Math.ceil((V-U)/(2*(D($,.75)-D($,.25))*Math.pow($.length,-1/3)))}function P($,U,V){return Math.ceil((V-U)/(3.5*g($)*Math.pow($.length,-1/3)))}function z($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jY&&(Y=q)}else for(;++j=q)for(Y=q;++jY&&(Y=q);return Y}function I($,U){var V=$.length,j=V,q=-1,Y,K=0;if(U==null)for(;++q=0;)for(K=$[U],V=K.length;--V>=0;)Y[--q]=K[V];return Y}function O($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jq&&(Y=q)}else for(;++j=q)for(Y=q;++jq&&(Y=q);return Y}function G($,U){for(var V=U.length,j=new Array(V);V--;)j[V]=$[U[V]];return j}function W($,U){if(V=$.length){var V,j=0,q=0,Y,K=$[q];for(U==null&&(U=i);++j0?1:nt<0?-1:0},A=Math.sqrt,b=Math.tan;function E(nt){return nt>1?0:nt<-1?c:Math.acos(nt)}function T(nt){return nt>1?f:nt<-1?-f:Math.asin(nt)}function F(nt){return(nt=w(nt/2))*nt}function D(){}function R(nt,Tt){nt&&z.hasOwnProperty(nt.type)&&z[nt.type](nt,Tt)}var P={Feature:function(nt,Tt){R(nt.geometry,Tt)},FeatureCollection:function(nt,Tt){for(var Kt=nt.features,Bt=-1,yr=Kt.length;++Bt=0?1:-1,yr=Bt*Kt,zr=v(Tt),Gr=w(Tt),ii=N*Gr,li=J*zr+ii*v(yr),Fi=ii*Bt*w(yr);O.add(_(Fi,li)),Z=nt,J=zr,N=Gr}function q(nt){return G.reset(),B(nt,H),G*2}function Y(nt){return[_(nt[1],nt[0]),T(nt[2])]}function K(nt){var Tt=nt[0],Kt=nt[1],Bt=v(Kt);return[Bt*v(Tt),Bt*w(Tt),w(Kt)]}function te(nt,Tt){return nt[0]*Tt[0]+nt[1]*Tt[1]+nt[2]*Tt[2]}function ne(nt,Tt){return[nt[1]*Tt[2]-nt[2]*Tt[1],nt[2]*Tt[0]-nt[0]*Tt[2],nt[0]*Tt[1]-nt[1]*Tt[0]]}function se(nt,Tt){nt[0]+=Tt[0],nt[1]+=Tt[1],nt[2]+=Tt[2]}function le(nt,Tt){return[nt[0]*Tt,nt[1]*Tt,nt[2]*Tt]}function ce(nt){var Tt=A(nt[0]*nt[0]+nt[1]*nt[1]+nt[2]*nt[2]);nt[0]/=Tt,nt[1]/=Tt,nt[2]/=Tt}var pe,xe,ye,fe,ae,ee,ie,Q,ue=a(),ge,Me,Te={point:je,lineStart:Ze,lineEnd:Ke,polygonStart:function(){Te.point=vt,Te.lineStart=xt,Te.lineEnd=Pt,ue.reset(),H.polygonStart()},polygonEnd:function(){H.polygonEnd(),Te.point=je,Te.lineStart=Ze,Te.lineEnd=Ke,O<0?(pe=-(ye=180),xe=-(fe=90)):ue>n?fe=90:ue<-n&&(xe=-90),Me[0]=pe,Me[1]=ye},sphere:function(){pe=-(ye=180),xe=-(fe=90)}};function je(nt,Tt){ge.push(Me=[pe=nt,ye=nt]),Ttfe&&(fe=Tt)}function Ve(nt,Tt){var Kt=K([nt*g,Tt*g]);if(Q){var Bt=ne(Q,Kt),yr=[Bt[1],-Bt[0],0],zr=ne(yr,Bt);ce(zr),zr=Y(zr);var Gr=nt-ae,ii=Gr>0?1:-1,li=zr[0]*p*ii,Fi,$r=m(Gr)>180;$r^(ii*aefe&&(fe=Fi)):(li=(li+360)%360-180,$r^(ii*aefe&&(fe=Tt))),$r?ntmt(pe,ye)&&(ye=nt):mt(nt,ye)>mt(pe,ye)&&(pe=nt):ye>=pe?(ntye&&(ye=nt)):nt>ae?mt(pe,nt)>mt(pe,ye)&&(ye=nt):mt(nt,ye)>mt(pe,ye)&&(pe=nt)}else ge.push(Me=[pe=nt,ye=nt]);Ttfe&&(fe=Tt),Q=Kt,ae=nt}function Ze(){Te.point=Ve}function Ke(){Me[0]=pe,Me[1]=ye,Te.point=je,Q=null}function vt(nt,Tt){if(Q){var Kt=nt-ae;ue.add(m(Kt)>180?Kt+(Kt>0?360:-360):Kt)}else ee=nt,ie=Tt;H.point(nt,Tt),Ve(nt,Tt)}function xt(){H.lineStart()}function Pt(){vt(ee,ie),H.lineEnd(),m(ue)>n&&(pe=-(ye=180)),Me[0]=pe,Me[1]=ye,Q=null}function mt(nt,Tt){return(Tt-=nt)<0?Tt+360:Tt}function Mt(nt,Tt){return nt[0]-Tt[0]}function lt(nt,Tt){return nt[0]<=nt[1]?nt[0]<=Tt&&Tt<=nt[1]:Ttmt(Bt[0],Bt[1])&&(Bt[1]=yr[1]),mt(yr[0],Bt[1])>mt(Bt[0],Bt[1])&&(Bt[0]=yr[0])):zr.push(Bt=yr);for(Gr=-1/0,Kt=zr.length-1,Tt=0,Bt=zr[Kt];Tt<=Kt;Bt=yr,++Tt)yr=zr[Tt],(ii=mt(Bt[1],yr[0]))>Gr&&(Gr=ii,pe=yr[0],ye=Bt[1])}return ge=Me=null,pe===1/0||xe===1/0?[[NaN,NaN],[NaN,NaN]]:[[pe,xe],[ye,fe]]}var Ye,me,_e,Ae,ke,Ee,De,Je,Ue,at,rt,ft,At,ht,Gt,fr,gt={sphere:D,point:yt,lineStart:Lt,lineEnd:mr,polygonStart:function(){gt.lineStart=br,gt.lineEnd=Er},polygonEnd:function(){gt.lineStart=Lt,gt.lineEnd=mr}};function yt(nt,Tt){nt*=g,Tt*=g;var Kt=v(Tt);kt(Kt*v(nt),Kt*w(nt),w(Tt))}function kt(nt,Tt,Kt){++Ye,_e+=(nt-_e)/Ye,Ae+=(Tt-Ae)/Ye,ke+=(Kt-ke)/Ye}function Lt(){gt.point=Ct}function Ct(nt,Tt){nt*=g,Tt*=g;var Kt=v(Tt);ht=Kt*v(nt),Gt=Kt*w(nt),fr=w(Tt),gt.point=$t,kt(ht,Gt,fr)}function $t(nt,Tt){nt*=g,Tt*=g;var Kt=v(Tt),Bt=Kt*v(nt),yr=Kt*w(nt),zr=w(Tt),Gr=_(A((Gr=Gt*zr-fr*yr)*Gr+(Gr=fr*Bt-ht*zr)*Gr+(Gr=ht*yr-Gt*Bt)*Gr),ht*Bt+Gt*yr+fr*zr);me+=Gr,Ee+=Gr*(ht+(ht=Bt)),De+=Gr*(Gt+(Gt=yr)),Je+=Gr*(fr+(fr=zr)),kt(ht,Gt,fr)}function mr(){gt.point=yt}function br(){gt.point=Tr}function Er(){Ur(ft,At),gt.point=yt}function Tr(nt,Tt){ft=nt,At=Tt,nt*=g,Tt*=g,gt.point=Ur;var Kt=v(Tt);ht=Kt*v(nt),Gt=Kt*w(nt),fr=w(Tt),kt(ht,Gt,fr)}function Ur(nt,Tt){nt*=g,Tt*=g;var Kt=v(Tt),Bt=Kt*v(nt),yr=Kt*w(nt),zr=w(Tt),Gr=Gt*zr-fr*yr,ii=fr*Bt-ht*zr,li=ht*yr-Gt*Bt,Fi=A(Gr*Gr+ii*ii+li*li),$r=T(Fi),ni=Fi&&-$r/Fi;Ue+=ni*Gr,at+=ni*ii,rt+=ni*li,me+=$r,Ee+=$r*(ht+(ht=Bt)),De+=$r*(Gt+(Gt=yr)),Je+=$r*(fr+(fr=zr)),kt(ht,Gt,fr)}function Ai(nt){Ye=me=_e=Ae=ke=Ee=De=Je=Ue=at=rt=0,B(nt,gt);var Tt=Ue,Kt=at,Bt=rt,yr=Tt*Tt+Kt*Kt+Bt*Bt;return yrc?nt+Math.round(-nt/d)*d:nt,Tt]}ea.invert=ea;function $i(nt,Tt,Kt){return(nt%=d)?Tt||Kt?Qr(ya(nt),pa(Tt,Kt)):ya(nt):Tt||Kt?pa(Tt,Kt):ea}function ja(nt){return function(Tt,Kt){return Tt+=nt,[Tt>c?Tt-d:Tt<-c?Tt+d:Tt,Kt]}}function ya(nt){var Tt=ja(nt);return Tt.invert=ja(-nt),Tt}function pa(nt,Tt){var Kt=v(nt),Bt=w(nt),yr=v(Tt),zr=w(Tt);function Gr(ii,li){var Fi=v(li),$r=v(ii)*Fi,ni=w(ii)*Fi,ui=w(li),Di=ui*Kt+$r*Bt;return[_(ni*yr-Di*zr,$r*Kt-ui*Bt),T(Di*yr+ni*zr)]}return Gr.invert=function(ii,li){var Fi=v(li),$r=v(ii)*Fi,ni=w(ii)*Fi,ui=w(li),Di=ui*yr-ni*zr;return[_(ni*yr+ui*zr,$r*Kt+Di*Bt),T(Di*Kt-$r*Bt)]},Gr}function xi(nt){nt=$i(nt[0]*g,nt[1]*g,nt.length>2?nt[2]*g:0);function Tt(Kt){return Kt=nt(Kt[0]*g,Kt[1]*g),Kt[0]*=p,Kt[1]*=p,Kt}return Tt.invert=function(Kt){return Kt=nt.invert(Kt[0]*g,Kt[1]*g),Kt[0]*=p,Kt[1]*=p,Kt},Tt}function bi(nt,Tt,Kt,Bt,yr,zr){if(Kt){var Gr=v(Tt),ii=w(Tt),li=Bt*Kt;yr==null?(yr=Tt+Bt*d,zr=Tt-li/2):(yr=Ua(Gr,yr),zr=Ua(Gr,zr),(Bt>0?yrzr)&&(yr+=Bt*d));for(var Fi,$r=yr;Bt>0?$r>zr:$r1&&nt.push(nt.pop().concat(nt.shift()))},result:function(){var Kt=nt;return nt=[],Tt=null,Kt}}}function Jr(nt,Tt){return m(nt[0]-Tt[0])=0;--ii)yr.point((ni=$r[ii])[0],ni[1]);else Bt(ui.x,ui.p.x,-1,yr);ui=ui.p}ui=ui.o,$r=ui.z,Di=!Di}while(!ui.v);yr.lineEnd()}}}function Et(nt){if(Tt=nt.length){for(var Tt,Kt=0,Bt=nt[0],yr;++Kt=0?1:-1,wo=zo*po,$o=wo>c,io=Oa*vn;if(St.add(_(io*zo*w(wo),Pa*Dn+io*v(wo))),Gr+=$o?po+zo*d:po,$o^Di>=Kt^Zi>=Kt){var Us=ne(K(ui),K(rn));ce(Us);var gs=ne(zr,Us);ce(gs);var Go=($o^po>=0?-1:1)*T(gs[2]);(Bt>Go||Bt===Go&&(Us[0]||Us[1]))&&(ii+=$o^po>=0?1:-1)}}return(Gr<-n||Gr0){for(li||(yr.polygonStart(),li=!0),yr.lineStart(),Dn=0;Dn1&&sa&2&&vn.push(vn.pop().concat(vn.shift())),$r.push(vn.filter(ze))}}return ui}}function ze(nt){return nt.length>1}function tt(nt,Tt){return((nt=nt.x)[0]<0?nt[1]-f-n:f-nt[1])-((Tt=Tt.x)[0]<0?Tt[1]-f-n:f-Tt[1])}var ct=Yt(function(){return!0},wt,It,[-c,-f]);function wt(nt){var Tt=NaN,Kt=NaN,Bt=NaN,yr;return{lineStart:function(){nt.lineStart(),yr=1},point:function(zr,Gr){var ii=zr>0?c:-c,li=m(zr-Tt);m(li-c)0?f:-f),nt.point(Bt,Kt),nt.lineEnd(),nt.lineStart(),nt.point(ii,Kt),nt.point(zr,Kt),yr=0):Bt!==ii&&li>=c&&(m(Tt-Bt)n?y((w(Tt)*(zr=v(Bt))*w(Kt)-w(Bt)*(yr=v(Tt))*w(nt))/(yr*zr*Gr)):(Tt+Bt)/2}function It(nt,Tt,Kt,Bt){var yr;if(nt==null)yr=Kt*f,Bt.point(-c,yr),Bt.point(0,yr),Bt.point(c,yr),Bt.point(c,0),Bt.point(c,-yr),Bt.point(0,-yr),Bt.point(-c,-yr),Bt.point(-c,0),Bt.point(-c,yr);else if(m(nt[0]-Tt[0])>n){var zr=nt[0]0,yr=m(Tt)>n;function zr($r,ni,ui,Di){bi(Di,nt,Kt,ui,$r,ni)}function Gr($r,ni){return v($r)*v(ni)>Tt}function ii($r){var ni,ui,Di,Wi,Oa;return{lineStart:function(){Wi=Di=!1,Oa=1},point:function(Pa,Ja){var rn=[Pa,Ja],Zi,sa=Gr(Pa,Ja),vn=Bt?sa?0:Fi(Pa,Ja):sa?Fi(Pa+(Pa<0?c:-c),Ja):0;if(!ni&&(Wi=Di=sa)&&$r.lineStart(),sa!==Di&&(Zi=li(ni,rn),(!Zi||Jr(ni,Zi)||Jr(rn,Zi))&&(rn[2]=1)),sa!==Di)Oa=0,sa?($r.lineStart(),Zi=li(rn,ni),$r.point(Zi[0],Zi[1])):(Zi=li(ni,rn),$r.point(Zi[0],Zi[1],2),$r.lineEnd()),ni=Zi;else if(yr&&ni&&Bt^sa){var Dn;!(vn&ui)&&(Dn=li(rn,ni,!0))&&(Oa=0,Bt?($r.lineStart(),$r.point(Dn[0][0],Dn[0][1]),$r.point(Dn[1][0],Dn[1][1]),$r.lineEnd()):($r.point(Dn[1][0],Dn[1][1]),$r.lineEnd(),$r.lineStart(),$r.point(Dn[0][0],Dn[0][1],3)))}sa&&(!ni||!Jr(ni,rn))&&$r.point(rn[0],rn[1]),ni=rn,Di=sa,ui=vn},lineEnd:function(){Di&&$r.lineEnd(),ni=null},clean:function(){return Oa|(Wi&&Di)<<1}}}function li($r,ni,ui){var Di=K($r),Wi=K(ni),Oa=[1,0,0],Pa=ne(Di,Wi),Ja=te(Pa,Pa),rn=Pa[0],Zi=Ja-rn*rn;if(!Zi)return!ui&&$r;var sa=Tt*Ja/Zi,vn=-Tt*rn/Zi,Dn=ne(Oa,Pa),po=le(Oa,sa),zo=le(Pa,vn);se(po,zo);var wo=Dn,$o=te(po,wo),io=te(wo,wo),Us=$o*$o-io*(te(po,po)-1);if(!(Us<0)){var gs=A(Us),Go=le(wo,(-$o-gs)/io);if(se(Go,po),Go=Y(Go),!ui)return Go;var ma=$r[0],vo=ni[0],Ds=$r[1],qs=ni[1],Ll;vo0^Go[1]<(m(Go[0]-ma)c^(ma<=Go[0]&&Go[0]<=vo)){var bl=le(wo,(-$o+gs)/io);return se(bl,po),[Go,Y(bl)]}}}function Fi($r,ni){var ui=Bt?nt:c-nt,Di=0;return $r<-ui?Di|=1:$r>ui&&(Di|=2),ni<-ui?Di|=4:ni>ui&&(Di|=8),Di}return Yt(Gr,ii,zr,Bt?[0,-nt]:[-c,nt-c])}function qt(nt,Tt,Kt,Bt,yr,zr){var Gr=nt[0],ii=nt[1],li=Tt[0],Fi=Tt[1],$r=0,ni=1,ui=li-Gr,Di=Fi-ii,Wi;if(Wi=Kt-Gr,!(!ui&&Wi>0)){if(Wi/=ui,ui<0){if(Wi<$r)return;Wi0){if(Wi>ni)return;Wi>$r&&($r=Wi)}if(Wi=yr-Gr,!(!ui&&Wi<0)){if(Wi/=ui,ui<0){if(Wi>ni)return;Wi>$r&&($r=Wi)}else if(ui>0){if(Wi<$r)return;Wi0)){if(Wi/=Di,Di<0){if(Wi<$r)return;Wi0){if(Wi>ni)return;Wi>$r&&($r=Wi)}if(Wi=zr-ii,!(!Di&&Wi<0)){if(Wi/=Di,Di<0){if(Wi>ni)return;Wi>$r&&($r=Wi)}else if(Di>0){if(Wi<$r)return;Wi0&&(nt[0]=Gr+$r*ui,nt[1]=ii+$r*Di),ni<1&&(Tt[0]=Gr+ni*ui,Tt[1]=ii+ni*Di),!0}}}}}var vr=1e9,Br=-vr;function Pr(nt,Tt,Kt,Bt){function yr(Fi,$r){return nt<=Fi&&Fi<=Kt&&Tt<=$r&&$r<=Bt}function zr(Fi,$r,ni,ui){var Di=0,Wi=0;if(Fi==null||(Di=Gr(Fi,ni))!==(Wi=Gr($r,ni))||li(Fi,$r)<0^ni>0)do ui.point(Di===0||Di===3?nt:Kt,Di>1?Bt:Tt);while((Di=(Di+ni+4)%4)!==Wi);else ui.point($r[0],$r[1])}function Gr(Fi,$r){return m(Fi[0]-nt)0?0:3:m(Fi[0]-Kt)0?2:1:m(Fi[1]-Tt)0?1:0:$r>0?3:2}function ii(Fi,$r){return li(Fi.x,$r.x)}function li(Fi,$r){var ni=Gr(Fi,1),ui=Gr($r,1);return ni!==ui?ni-ui:ni===0?$r[1]-Fi[1]:ni===1?Fi[0]-$r[0]:ni===2?Fi[1]-$r[1]:$r[0]-Fi[0]}return function(Fi){var $r=Fi,ni=pi(),ui,Di,Wi,Oa,Pa,Ja,rn,Zi,sa,vn,Dn,po={point:zo,lineStart:Us,lineEnd:gs,polygonStart:$o,polygonEnd:io};function zo(ma,vo){yr(ma,vo)&&$r.point(ma,vo)}function wo(){for(var ma=0,vo=0,Ds=Di.length;voBt&&(Uu-ac)*(Bt-bl)>(Fc-bl)*(nt-ac)&&++ma:Fc<=Bt&&(Uu-ac)*(Bt-bl)<(Fc-bl)*(nt-ac)&&--ma;return ma}function $o(){$r=ni,ui=[],Di=[],Dn=!0}function io(){var ma=wo(),vo=Dn&&ma,Ds=(ui=i.merge(ui)).length;(vo||Ds)&&(Fi.polygonStart(),vo&&(Fi.lineStart(),zr(null,null,1,Fi),Fi.lineEnd()),Ds&&Fe(ui,ii,ma,zr,Fi),Fi.polygonEnd()),$r=Fi,ui=Di=Wi=null}function Us(){po.point=Go,Di&&Di.push(Wi=[]),vn=!0,sa=!1,rn=Zi=NaN}function gs(){ui&&(Go(Oa,Pa),Ja&&sa&&ni.rejoin(),ui.push(ni.result())),po.point=zo,sa&&$r.lineEnd()}function Go(ma,vo){var Ds=yr(ma,vo);if(Di&&Wi.push([ma,vo]),vn)Oa=ma,Pa=vo,Ja=Ds,vn=!1,Ds&&($r.lineStart(),$r.point(ma,vo));else if(Ds&&sa)$r.point(ma,vo);else{var qs=[rn=Math.max(Br,Math.min(vr,rn)),Zi=Math.max(Br,Math.min(vr,Zi))],Ll=[ma=Math.max(Br,Math.min(vr,ma)),vo=Math.max(Br,Math.min(vr,vo))];qt(qs,Ll,nt,Tt,Kt,Bt)?(sa||($r.lineStart(),$r.point(qs[0],qs[1])),$r.point(Ll[0],Ll[1]),Ds||$r.lineEnd(),Dn=!1):Ds&&($r.lineStart(),$r.point(ma,vo),Dn=!1)}rn=ma,Zi=vo,sa=Ds}return po}}function Mi(){var nt=0,Tt=0,Kt=960,Bt=500,yr,zr,Gr;return Gr={stream:function(ii){return yr&&zr===ii?yr:yr=Pr(nt,Tt,Kt,Bt)(zr=ii)},extent:function(ii){return arguments.length?(nt=+ii[0][0],Tt=+ii[0][1],Kt=+ii[1][0],Bt=+ii[1][1],yr=zr=null,Gr):[[nt,Tt],[Kt,Bt]]}}}var gi=a(),ba,Hi,Za,oa={sphere:D,point:D,lineStart:Cn,lineEnd:D,polygonStart:D,polygonEnd:D};function Cn(){oa.point=Li,oa.lineEnd=_n}function _n(){oa.point=oa.lineEnd=D}function Li(nt,Tt){nt*=g,Tt*=g,ba=nt,Hi=w(Tt),Za=v(Tt),oa.point=In}function In(nt,Tt){nt*=g,Tt*=g;var Kt=w(Tt),Bt=v(Tt),yr=m(nt-ba),zr=v(yr),Gr=w(yr),ii=Bt*Gr,li=Za*Kt-Hi*Bt*zr,Fi=Hi*Kt+Za*Bt*zr;gi.add(_(A(ii*ii+li*li),Fi)),ba=nt,Hi=Kt,Za=Bt}function pn(nt){return gi.reset(),B(nt,oa),+gi}var Ka=[null,null],Rn={type:"LineString",coordinates:Ka};function tn(nt,Tt){return Ka[0]=nt,Ka[1]=Tt,pn(Rn)}var Mn={Feature:function(nt,Tt){return zn(nt.geometry,Tt)},FeatureCollection:function(nt,Tt){for(var Kt=nt.features,Bt=-1,yr=Kt.length;++Bt0&&(yr=tn(nt[zr],nt[zr-1]),yr>0&&Kt<=yr&&Bt<=yr&&(Kt+Bt-yr)*(1-Math.pow((Kt-Bt)/yr,2))n}).map(ui)).concat(i.range(x(zr/Fi)*Fi,yr,Fi).filter(function(Zi){return m(Zi%ni)>n}).map(Di))}return Ja.lines=function(){return rn().map(function(Zi){return{type:"LineString",coordinates:Zi}})},Ja.outline=function(){return{type:"Polygon",coordinates:[Wi(Bt).concat(Oa(Gr).slice(1),Wi(Kt).reverse().slice(1),Oa(ii).reverse().slice(1))]}},Ja.extent=function(Zi){return arguments.length?Ja.extentMajor(Zi).extentMinor(Zi):Ja.extentMinor()},Ja.extentMajor=function(Zi){return arguments.length?(Bt=+Zi[0][0],Kt=+Zi[1][0],ii=+Zi[0][1],Gr=+Zi[1][1],Bt>Kt&&(Zi=Bt,Bt=Kt,Kt=Zi),ii>Gr&&(Zi=ii,ii=Gr,Gr=Zi),Ja.precision(Pa)):[[Bt,ii],[Kt,Gr]]},Ja.extentMinor=function(Zi){return arguments.length?(Tt=+Zi[0][0],nt=+Zi[1][0],zr=+Zi[0][1],yr=+Zi[1][1],Tt>nt&&(Zi=Tt,Tt=nt,nt=Zi),zr>yr&&(Zi=zr,zr=yr,yr=Zi),Ja.precision(Pa)):[[Tt,zr],[nt,yr]]},Ja.step=function(Zi){return arguments.length?Ja.stepMajor(Zi).stepMinor(Zi):Ja.stepMinor()},Ja.stepMajor=function(Zi){return arguments.length?($r=+Zi[0],ni=+Zi[1],Ja):[$r,ni]},Ja.stepMinor=function(Zi){return arguments.length?(li=+Zi[0],Fi=+Zi[1],Ja):[li,Fi]},Ja.precision=function(Zi){return arguments.length?(Pa=+Zi,ui=Jn(zr,yr,90),Di=lo(Tt,nt,Pa),Wi=Jn(ii,Gr,90),Oa=lo(Bt,Kt,Pa),Ja):Pa},Ja.extentMajor([[-180,-90+n],[180,90-n]]).extentMinor([[-180,-80-n],[180,80+n]])}function uo(){return Fo()()}function Qn(nt,Tt){var Kt=nt[0]*g,Bt=nt[1]*g,yr=Tt[0]*g,zr=Tt[1]*g,Gr=v(Bt),ii=w(Bt),li=v(zr),Fi=w(zr),$r=Gr*v(Kt),ni=Gr*w(Kt),ui=li*v(yr),Di=li*w(yr),Wi=2*T(A(F(zr-Bt)+Gr*li*F(yr-Kt))),Oa=w(Wi),Pa=Wi?function(Ja){var rn=w(Ja*=Wi)/Oa,Zi=w(Wi-Ja)/Oa,sa=Zi*$r+rn*ui,vn=Zi*ni+rn*Di,Dn=Zi*ii+rn*Fi;return[_(vn,sa)*p,_(Dn,A(sa*sa+vn*vn))*p]}:function(){return[Kt*p,Bt*p]};return Pa.distance=Wi,Pa}function jo(nt){return nt}var Yn=a(),Bn=a(),ps,xo,no,Mo,Vn={point:D,lineStart:D,lineEnd:D,polygonStart:function(){Vn.lineStart=ts,Vn.lineEnd=nl},polygonEnd:function(){Vn.lineStart=Vn.lineEnd=Vn.point=D,Yn.add(m(Bn)),Bn.reset()},result:function(){var nt=Yn/2;return Yn.reset(),nt}};function ts(){Vn.point=ws}function ws(nt,Tt){Vn.point=So,ps=no=nt,xo=Mo=Tt}function So(nt,Tt){Bn.add(Mo*nt-no*Tt),no=nt,Mo=Tt}function nl(){So(ps,xo)}var vs=1/0,go=vs,Xn=-vs,On=Xn,Uo={point:kl,lineStart:D,lineEnd:D,polygonStart:D,polygonEnd:D,result:function(){var nt=[[vs,go],[Xn,On]];return Xn=On=-(go=vs=1/0),nt}};function kl(nt,Tt){ntXn&&(Xn=nt),TtOn&&(On=Tt)}var mu=0,Ul=0,gu=0,yu=0,Fu=0,au=0,xc=0,Pu=0,Cl=0,bc,Iu,_l,ms,ss={point:fl,lineStart:wc,lineEnd:wh,polygonStart:function(){ss.lineStart=Th,ss.lineEnd=Rd},polygonEnd:function(){ss.point=fl,ss.lineStart=wc,ss.lineEnd=wh},result:function(){var nt=Cl?[xc/Cl,Pu/Cl]:au?[yu/au,Fu/au]:gu?[mu/gu,Ul/gu]:[NaN,NaN];return mu=Ul=gu=yu=Fu=au=xc=Pu=Cl=0,nt}};function fl(nt,Tt){mu+=nt,Ul+=Tt,++gu}function wc(){ss.point=Tc}function Tc(nt,Tt){ss.point=tc,fl(_l=nt,ms=Tt)}function tc(nt,Tt){var Kt=nt-_l,Bt=Tt-ms,yr=A(Kt*Kt+Bt*Bt);yu+=yr*(_l+nt)/2,Fu+=yr*(ms+Tt)/2,au+=yr,fl(_l=nt,ms=Tt)}function wh(){ss.point=fl}function Th(){ss.point=fp}function Rd(){Ru(bc,Iu)}function fp(nt,Tt){ss.point=Ru,fl(bc=_l=nt,Iu=ms=Tt)}function Ru(nt,Tt){var Kt=nt-_l,Bt=Tt-ms,yr=A(Kt*Kt+Bt*Bt);yu+=yr*(_l+nt)/2,Fu+=yr*(ms+Tt)/2,au+=yr,yr=ms*nt-_l*Tt,xc+=yr*(_l+nt),Pu+=yr*(ms+Tt),Cl+=yr*3,fl(_l=nt,ms=Tt)}function Ts(nt){this._context=nt}Ts.prototype={_radius:4.5,pointRadius:function(nt){return this._radius=nt,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(nt,Tt){switch(this._point){case 0:{this._context.moveTo(nt,Tt),this._point=1;break}case 1:{this._context.lineTo(nt,Tt);break}default:{this._context.moveTo(nt+this._radius,Tt),this._context.arc(nt,Tt,this._radius,0,d);break}}},result:D};var Ah=a(),vf,Ac,Mh,Mc,$c,zu={point:D,lineStart:function(){zu.point=mf},lineEnd:function(){vf&&jf(Ac,Mh),zu.point=D},polygonStart:function(){vf=!0},polygonEnd:function(){vf=null},result:function(){var nt=+Ah;return Ah.reset(),nt}};function mf(nt,Tt){zu.point=jf,Ac=Mc=nt,Mh=$c=Tt}function jf(nt,Tt){Mc-=nt,$c-=Tt,Ah.add(A(Mc*Mc+$c*$c)),Mc=nt,$c=Tt}function Sc(){this._string=[]}Sc.prototype={_radius:4.5,_circle:id(4.5),pointRadius:function(nt){return(nt=+nt)!==this._radius&&(this._radius=nt,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(nt,Tt){switch(this._point){case 0:{this._string.push("M",nt,",",Tt),this._point=1;break}case 1:{this._string.push("L",nt,",",Tt);break}default:{this._circle==null&&(this._circle=id(this._radius)),this._string.push("M",nt,",",Tt,this._circle);break}}},result:function(){if(this._string.length){var nt=this._string.join("");return this._string=[],nt}else return null}};function id(nt){return"m0,"+nt+"a"+nt+","+nt+" 0 1,1 0,"+-2*nt+"a"+nt+","+nt+" 0 1,1 0,"+2*nt+"z"}function Uf(nt,Tt){var Kt=4.5,Bt,yr;function zr(Gr){return Gr&&(typeof Kt=="function"&&yr.pointRadius(+Kt.apply(this,arguments)),B(Gr,Bt(yr))),yr.result()}return zr.area=function(Gr){return B(Gr,Bt(Vn)),Vn.result()},zr.measure=function(Gr){return B(Gr,Bt(zu)),zu.result()},zr.bounds=function(Gr){return B(Gr,Bt(Uo)),Uo.result()},zr.centroid=function(Gr){return B(Gr,Bt(ss)),ss.result()},zr.projection=function(Gr){return arguments.length?(Bt=Gr==null?(nt=null,jo):(nt=Gr).stream,zr):nt},zr.context=function(Gr){return arguments.length?(yr=Gr==null?(Tt=null,new Sc):new Ts(Tt=Gr),typeof Kt!="function"&&yr.pointRadius(Kt),zr):Tt},zr.pointRadius=function(Gr){return arguments.length?(Kt=typeof Gr=="function"?Gr:(yr.pointRadius(+Gr),+Gr),zr):Kt},zr.projection(nt).context(Tt)}function zd(nt){return{stream:Bu(nt)}}function Bu(nt){return function(Tt){var Kt=new Sh;for(var Bt in nt)Kt[Bt]=nt[Bt];return Kt.stream=Tt,Kt}}function Sh(){}Sh.prototype={constructor:Sh,point:function(nt,Tt){this.stream.point(nt,Tt)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function _u(nt,Tt,Kt){var Bt=nt.clipExtent&&nt.clipExtent();return nt.scale(150).translate([0,0]),Bt!=null&&nt.clipExtent(null),B(Kt,nt.stream(Uo)),Tt(Uo.result()),Bt!=null&&nt.clipExtent(Bt),nt}function qf(nt,Tt,Kt){return _u(nt,function(Bt){var yr=Tt[1][0]-Tt[0][0],zr=Tt[1][1]-Tt[0][1],Gr=Math.min(yr/(Bt[1][0]-Bt[0][0]),zr/(Bt[1][1]-Bt[0][1])),ii=+Tt[0][0]+(yr-Gr*(Bt[1][0]+Bt[0][0]))/2,li=+Tt[0][1]+(zr-Gr*(Bt[1][1]+Bt[0][1]))/2;nt.scale(150*Gr).translate([ii,li])},Kt)}function Dl(nt,Tt,Kt){return qf(nt,[[0,0],Tt],Kt)}function gf(nt,Tt,Kt){return _u(nt,function(Bt){var yr=+Tt,zr=yr/(Bt[1][0]-Bt[0][0]),Gr=(yr-zr*(Bt[1][0]+Bt[0][0]))/2,ii=-zr*Bt[0][1];nt.scale(150*zr).translate([Gr,ii])},Kt)}function Ou(nt,Tt,Kt){return _u(nt,function(Bt){var yr=+Tt,zr=yr/(Bt[1][1]-Bt[0][1]),Gr=-zr*Bt[0][0],ii=(yr-zr*(Bt[1][1]+Bt[0][1]))/2;nt.scale(150*zr).translate([Gr,ii])},Kt)}var yf=16,_f=v(30*g);function Vf(nt,Tt){return+Tt?Ec(nt,Tt):Eh(nt)}function Eh(nt){return Bu({point:function(Tt,Kt){Tt=nt(Tt,Kt),this.stream.point(Tt[0],Tt[1])}})}function Ec(nt,Tt){function Kt(Bt,yr,zr,Gr,ii,li,Fi,$r,ni,ui,Di,Wi,Oa,Pa){var Ja=Fi-Bt,rn=$r-yr,Zi=Ja*Ja+rn*rn;if(Zi>4*Tt&&Oa--){var sa=Gr+ui,vn=ii+Di,Dn=li+Wi,po=A(sa*sa+vn*vn+Dn*Dn),zo=T(Dn/=po),wo=m(m(Dn)-1)Tt||m((Ja*gs+rn*Go)/Zi-.5)>.3||Gr*ui+ii*Di+li*Wi<_f)&&(Kt(Bt,yr,zr,Gr,ii,li,io,Us,wo,sa/=po,vn/=po,Dn,Oa,Pa),Pa.point(io,Us),Kt(io,Us,wo,sa,vn,Dn,Fi,$r,ni,ui,Di,Wi,Oa,Pa))}}return function(Bt){var yr,zr,Gr,ii,li,Fi,$r,ni,ui,Di,Wi,Oa,Pa={point:Ja,lineStart:rn,lineEnd:sa,polygonStart:function(){Bt.polygonStart(),Pa.lineStart=vn},polygonEnd:function(){Bt.polygonEnd(),Pa.lineStart=rn}};function Ja(zo,wo){zo=nt(zo,wo),Bt.point(zo[0],zo[1])}function rn(){ni=NaN,Pa.point=Zi,Bt.lineStart()}function Zi(zo,wo){var $o=K([zo,wo]),io=nt(zo,wo);Kt(ni,ui,$r,Di,Wi,Oa,ni=io[0],ui=io[1],$r=zo,Di=$o[0],Wi=$o[1],Oa=$o[2],yf,Bt),Bt.point(ni,ui)}function sa(){Pa.point=Ja,Bt.lineEnd()}function vn(){rn(),Pa.point=Dn,Pa.lineEnd=po}function Dn(zo,wo){Zi(yr=zo,wo),zr=ni,Gr=ui,ii=Di,li=Wi,Fi=Oa,Pa.point=Zi}function po(){Kt(ni,ui,$r,Di,Wi,Oa,zr,Gr,yr,ii,li,Fi,yf,Bt),Pa.lineEnd=sa,sa()}return Pa}}var kh=Bu({point:function(nt,Tt){this.stream.point(nt*g,Tt*g)}});function rc(nt){return Bu({point:function(Tt,Kt){var Bt=nt(Tt,Kt);return this.stream.point(Bt[0],Bt[1])}})}function Bd(nt,Tt,Kt,Bt,yr){function zr(Gr,ii){return Gr*=Bt,ii*=yr,[Tt+nt*Gr,Kt-nt*ii]}return zr.invert=function(Gr,ii){return[(Gr-Tt)/nt*Bt,(Kt-ii)/nt*yr]},zr}function xl(nt,Tt,Kt,Bt,yr,zr){var Gr=v(zr),ii=w(zr),li=Gr*nt,Fi=ii*nt,$r=Gr/nt,ni=ii/nt,ui=(ii*Kt-Gr*Tt)/nt,Di=(ii*Tt+Gr*Kt)/nt;function Wi(Oa,Pa){return Oa*=Bt,Pa*=yr,[li*Oa-Fi*Pa+Tt,Kt-Fi*Oa-li*Pa]}return Wi.invert=function(Oa,Pa){return[Bt*($r*Oa-ni*Pa+ui),yr*(Di-ni*Oa-$r*Pa)]},Wi}function xu(nt){return kc(function(){return nt})()}function kc(nt){var Tt,Kt=150,Bt=480,yr=250,zr=0,Gr=0,ii=0,li=0,Fi=0,$r,ni=0,ui=1,Di=1,Wi=null,Oa=ct,Pa=null,Ja,rn,Zi,sa=jo,vn=.5,Dn,po,zo,wo,$o;function io(ma){return zo(ma[0]*g,ma[1]*g)}function Us(ma){return ma=zo.invert(ma[0],ma[1]),ma&&[ma[0]*p,ma[1]*p]}io.stream=function(ma){return wo&&$o===ma?wo:wo=kh(rc($r)(Oa(Dn(sa($o=ma)))))},io.preclip=function(ma){return arguments.length?(Oa=ma,Wi=void 0,Go()):Oa},io.postclip=function(ma){return arguments.length?(sa=ma,Pa=Ja=rn=Zi=null,Go()):sa},io.clipAngle=function(ma){return arguments.length?(Oa=+ma?Zt(Wi=ma*g):(Wi=null,ct),Go()):Wi*p},io.clipExtent=function(ma){return arguments.length?(sa=ma==null?(Pa=Ja=rn=Zi=null,jo):Pr(Pa=+ma[0][0],Ja=+ma[0][1],rn=+ma[1][0],Zi=+ma[1][1]),Go()):Pa==null?null:[[Pa,Ja],[rn,Zi]]},io.scale=function(ma){return arguments.length?(Kt=+ma,gs()):Kt},io.translate=function(ma){return arguments.length?(Bt=+ma[0],yr=+ma[1],gs()):[Bt,yr]},io.center=function(ma){return arguments.length?(zr=ma[0]%360*g,Gr=ma[1]%360*g,gs()):[zr*p,Gr*p]},io.rotate=function(ma){return arguments.length?(ii=ma[0]%360*g,li=ma[1]%360*g,Fi=ma.length>2?ma[2]%360*g:0,gs()):[ii*p,li*p,Fi*p]},io.angle=function(ma){return arguments.length?(ni=ma%360*g,gs()):ni*p},io.reflectX=function(ma){return arguments.length?(ui=ma?-1:1,gs()):ui<0},io.reflectY=function(ma){return arguments.length?(Di=ma?-1:1,gs()):Di<0},io.precision=function(ma){return arguments.length?(Dn=Vf(po,vn=ma*ma),Go()):A(vn)},io.fitExtent=function(ma,vo){return qf(io,ma,vo)},io.fitSize=function(ma,vo){return Dl(io,ma,vo)},io.fitWidth=function(ma,vo){return gf(io,ma,vo)},io.fitHeight=function(ma,vo){return Ou(io,ma,vo)};function gs(){var ma=xl(Kt,0,0,ui,Di,ni).apply(null,Tt(zr,Gr)),vo=(ni?xl:Bd)(Kt,Bt-ma[0],yr-ma[1],ui,Di,ni);return $r=$i(ii,li,Fi),po=Qr(Tt,vo),zo=Qr($r,po),Dn=Vf(po,vn),Go()}function Go(){return wo=$o=null,io}return function(){return Tt=nt.apply(this,arguments),io.invert=Tt.invert&&Us,gs()}}function hl(nt){var Tt=0,Kt=c/3,Bt=kc(nt),yr=Bt(Tt,Kt);return yr.parallels=function(zr){return arguments.length?Bt(Tt=zr[0]*g,Kt=zr[1]*g):[Tt*p,Kt*p]},yr}function Gf(nt){var Tt=v(nt);function Kt(Bt,yr){return[Bt*Tt,w(yr)/Tt]}return Kt.invert=function(Bt,yr){return[Bt/Tt,T(yr*Tt)]},Kt}function Nu(nt,Tt){var Kt=w(nt),Bt=(Kt+w(Tt))/2;if(m(Bt)=.12&&Pa<.234&&Oa>=-.425&&Oa<-.214?yr:Pa>=.166&&Pa<.234&&Oa>=-.214&&Oa<-.115?Gr:Kt).invert(ui)},$r.stream=function(ui){return nt&&Tt===ui?nt:nt=Od([Kt.stream(Tt=ui),yr.stream(ui),Gr.stream(ui)])},$r.precision=function(ui){return arguments.length?(Kt.precision(ui),yr.precision(ui),Gr.precision(ui),ni()):Kt.precision()},$r.scale=function(ui){return arguments.length?(Kt.scale(ui),yr.scale(ui*.35),Gr.scale(ui),$r.translate(Kt.translate())):Kt.scale()},$r.translate=function(ui){if(!arguments.length)return Kt.translate();var Di=Kt.scale(),Wi=+ui[0],Oa=+ui[1];return Bt=Kt.translate(ui).clipExtent([[Wi-.455*Di,Oa-.238*Di],[Wi+.455*Di,Oa+.238*Di]]).stream(Fi),zr=yr.translate([Wi-.307*Di,Oa+.201*Di]).clipExtent([[Wi-.425*Di+n,Oa+.12*Di+n],[Wi-.214*Di-n,Oa+.234*Di-n]]).stream(Fi),ii=Gr.translate([Wi-.205*Di,Oa+.212*Di]).clipExtent([[Wi-.214*Di+n,Oa+.166*Di+n],[Wi-.115*Di-n,Oa+.234*Di-n]]).stream(Fi),ni()},$r.fitExtent=function(ui,Di){return qf($r,ui,Di)},$r.fitSize=function(ui,Di){return Dl($r,ui,Di)},$r.fitWidth=function(ui,Di){return gf($r,ui,Di)},$r.fitHeight=function(ui,Di){return Ou($r,ui,Di)};function ni(){return nt=Tt=null,$r}return $r.scale(1070)}function ju(nt){return function(Tt,Kt){var Bt=v(Tt),yr=v(Kt),zr=nt(Bt*yr);return[zr*yr*w(Tt),zr*w(Kt)]}}function ql(nt){return function(Tt,Kt){var Bt=A(Tt*Tt+Kt*Kt),yr=nt(Bt),zr=w(yr),Gr=v(yr);return[_(Tt*zr,Bt*Gr),T(Bt&&Kt*zr/Bt)]}}var Vl=ju(function(nt){return A(2/(1+nt))});Vl.invert=ql(function(nt){return 2*T(nt/2)});function Nd(){return xu(Vl).scale(124.75).clipAngle(180-.001)}var xf=ju(function(nt){return(nt=E(nt))&&nt/w(nt)});xf.invert=ql(function(nt){return nt});function nd(){return xu(xf).scale(79.4188).clipAngle(180-.001)}function nu(nt,Tt){return[nt,M(b((f+Tt)/2))]}nu.invert=function(nt,Tt){return[nt,2*y(S(Tt))-f]};function Wc(){return $f(nu).scale(961/d)}function $f(nt){var Tt=xu(nt),Kt=Tt.center,Bt=Tt.scale,yr=Tt.translate,zr=Tt.clipExtent,Gr=null,ii,li,Fi;Tt.scale=function(ni){return arguments.length?(Bt(ni),$r()):Bt()},Tt.translate=function(ni){return arguments.length?(yr(ni),$r()):yr()},Tt.center=function(ni){return arguments.length?(Kt(ni),$r()):Kt()},Tt.clipExtent=function(ni){return arguments.length?(ni==null?Gr=ii=li=Fi=null:(Gr=+ni[0][0],ii=+ni[0][1],li=+ni[1][0],Fi=+ni[1][1]),$r()):Gr==null?null:[[Gr,ii],[li,Fi]]};function $r(){var ni=c*Bt(),ui=Tt(xi(Tt.rotate()).invert([0,0]));return zr(Gr==null?[[ui[0]-ni,ui[1]-ni],[ui[0]+ni,ui[1]+ni]]:nt===nu?[[Math.max(ui[0]-ni,Gr),ii],[Math.min(ui[0]+ni,li),Fi]]:[[Gr,Math.max(ui[1]-ni,ii)],[li,Math.min(ui[1]+ni,Fi)]])}return $r()}function bf(nt){return b((f+nt)/2)}function jd(nt,Tt){var Kt=v(nt),Bt=nt===Tt?w(nt):M(Kt/v(Tt))/M(bf(Tt)/bf(nt)),yr=Kt*C(bf(nt),Bt)/Bt;if(!Bt)return nu;function zr(Gr,ii){yr>0?ii<-f+n&&(ii=-f+n):ii>f-n&&(ii=f-n);var li=yr/C(bf(ii),Bt);return[li*w(Bt*Gr),yr-li*v(Bt*Gr)]}return zr.invert=function(Gr,ii){var li=yr-ii,Fi=k(Bt)*A(Gr*Gr+li*li),$r=_(Gr,m(li))*k(li);return li*Bt<0&&($r-=c*k(Gr)*k(li)),[$r/Bt,2*y(C(yr/Fi,1/Bt))-f]},zr}function Yc(){return hl(jd).scale(109.5).parallels([30,30])}function Dc(nt,Tt){return[nt,Tt]}Dc.invert=Dc;function Lc(){return xu(Dc).scale(152.63)}function wf(nt,Tt){var Kt=v(nt),Bt=nt===Tt?w(nt):(Kt-v(Tt))/(Tt-nt),yr=Kt/Bt+nt;if(m(Bt)n&&--Bt>0);return[nt/(.8707+(zr=Kt*Kt)*(-.131979+zr*(-.013791+zr*zr*zr*(.003971-.001529*zr)))),Kt]};function Dh(){return xu(ld).scale(175.295)}function Js(nt,Tt){return[v(Tt)*w(nt),w(Tt)]}Js.invert=ql(T);function ou(){return xu(Js).scale(249.5).clipAngle(90+n)}function Kf(nt,Tt){var Kt=v(Tt),Bt=1+v(nt)*Kt;return[Kt*w(nt)/Bt,w(Tt)/Bt]}Kf.invert=ql(function(nt){return 2*y(nt)});function Lh(){return xu(Kf).scale(250).clipAngle(142)}function Jf(nt,Tt){return[M(b((f+Tt)/2)),-nt]}Jf.invert=function(nt,Tt){return[-Tt,2*y(S(nt))-f]};function Af(){var nt=$f(Jf),Tt=nt.center,Kt=nt.rotate;return nt.center=function(Bt){return arguments.length?Tt([-Bt[1],Bt[0]]):(Bt=Tt(),[Bt[1],-Bt[0]])},nt.rotate=function(Bt){return arguments.length?Kt([Bt[0],Bt[1],Bt.length>2?Bt[2]+90:90]):(Bt=Kt(),[Bt[0],Bt[1],Bt[2]-90])},Kt([0,0,90]).scale(159.155)}t.geoAlbers=Hf,t.geoAlbersUsa=ad,t.geoArea=q,t.geoAzimuthalEqualArea=Nd,t.geoAzimuthalEqualAreaRaw=Vl,t.geoAzimuthalEquidistant=nd,t.geoAzimuthalEquidistantRaw=xf,t.geoBounds=qe,t.geoCentroid=Ai,t.geoCircle=dn,t.geoClipAntimeridian=ct,t.geoClipCircle=Zt,t.geoClipExtent=Mi,t.geoClipRectangle=Pr,t.geoConicConformal=Yc,t.geoConicConformalRaw=jd,t.geoConicEqualArea=Cc,t.geoConicEqualAreaRaw=Nu,t.geoConicEquidistant=od,t.geoConicEquidistantRaw=wf,t.geoContains=ho,t.geoDistance=tn,t.geoEqualEarth=sd,t.geoEqualEarthRaw=Xf,t.geoEquirectangular=Lc,t.geoEquirectangularRaw=Dc,t.geoGnomonic=Ud,t.geoGnomonicRaw=Ch,t.geoGraticule=Fo,t.geoGraticule10=uo,t.geoIdentity=Zf,t.geoInterpolate=Qn,t.geoLength=pn,t.geoMercator=Wc,t.geoMercatorRaw=nu,t.geoNaturalEarth1=Dh,t.geoNaturalEarth1Raw=ld,t.geoOrthographic=ou,t.geoOrthographicRaw=Js,t.geoPath=Uf,t.geoProjection=xu,t.geoProjectionMutator=kc,t.geoRotation=xi,t.geoStereographic=Lh,t.geoStereographicRaw=Kf,t.geoStream=B,t.geoTransform=zd,t.geoTransverseMercator=Af,t.geoTransverseMercatorRaw=Jf,Object.defineProperty(t,"__esModule",{value:!0})}))}}),HY=de({"src/lib/usa_location_names.js"(e,r){"use strict";var t={alabama:"AL",alaska:"AK",arizona:"AZ",arkansas:"AR",california:"CA",colorado:"CO",connecticut:"CT",delaware:"DE","district of columbia":"DC",florida:"FL",georgia:"GA",hawaii:"HI",idaho:"ID",illinois:"IL",indiana:"IN",iowa:"IA",kansas:"KS",kentucky:"KY",louisiana:"LA",maine:"ME",maryland:"MD",massachusetts:"MA",michigan:"MI",minnesota:"MN",mississippi:"MS",missouri:"MO",montana:"MT",nebraska:"NE",nevada:"NV","new hampshire":"NH","new jersey":"NJ","new mexico":"NM","new york":"NY","north carolina":"NC","north dakota":"ND",ohio:"OH",oklahoma:"OK",oregon:"OR",pennsylvania:"PA","rhode island":"RI","south carolina":"SC","south dakota":"SD",tennessee:"TN",texas:"TX",utah:"UT",vermont:"VT",virginia:"VA",washington:"WA","washington dc":"DC","washington d.c.":"DC","west virginia":"WV",wisconsin:"WI",wyoming:"WY"},i=new Set(Object.values(t));r.exports={usaLocationAbbreviations:i,usaLocationList:t}}}),s7={};Mr(s7,{COUNTRIES_X:()=>l7});var l7,$Y=Ir({"src/lib/custom_country_codes.ts"(){"use strict";l7=[{iso3:"XAC",iso2:"",m49:"",name:"Aksai Chin",aliases:[]},{iso3:"XAP",iso2:"",m49:"",name:"Arunachal Pradesh",aliases:[]},{iso3:"XBT",iso2:"",m49:"",name:"Bir Tawil",aliases:[]},{iso3:"XHT",iso2:"",m49:"",name:"Halaib Triangle",aliases:[]},{iso3:"XIT",iso2:"",m49:"",name:"Ilemi Triangle",aliases:[]},{iso3:"XJK",iso2:"",m49:"",name:"Jammu and Kashmir",aliases:[]}]}}),Fp=de({"src/lib/geo_location_utils.js"(e,r){"use strict";var t=Yr(),{COUNTRIES:i,createLookup:a}=UY(),{area:o}=qY(),{centroid:s}=VY(),{coordAll:l}=b4(),{geoBounds:n}=w4(),u=My(),c=Xo(),f=is(),h=sl(),d=Fy(),{usaLocationAbbreviations:p,usaLocationList:g}=HY(),{COUNTRIES_X:m}=($Y(),ti(s7)),{lookupAlpha3:y}=a([...i,...m]),_={"ISO-3":u,"USA-states":x,"country names":v};function v(L){let B=y(L);return B||(c.log("Unrecognized country name: "+L+"."),!1)}function x(L){L=L.trim();let B=p.has(L.toUpperCase())?L.toUpperCase():g[L.toLowerCase()];return B||(c.log("Unrecognized US location: "+L+"."),!1)}function S(L,B,O){var G;if(!B||typeof B!="string")return!1;let W=_[L](B);if(W){let X;if(L==="USA-states"){X=[];for(let Z of O)((G=Z?.properties)==null?void 0:G.gu)==="USA"&&X.push(Z)}else X=O;for(let Z of X)if(Z.id===W)return Z;c.log(`Location with id ${W} does not have a matching topojson feature at this resolution.`)}return!1}var M=360;function C(L){for(let B=0;B0&&L[B+1][0]<0)return B;return null}function w(L){var B=L.geometry,O=B.coordinates,G=L.id,W=[],X,Z,J,N;switch(G==="RUS"||G==="FJI"?X=function(H){var $;if(C(H)===null)$=H;else for($=new Array(H.length),N=0;N$?U[V++]=[H[N][0]+M,H[N][1]]:N===$?(U[V++]=H[N],U[V++]=[H[N][0],-90]):U[V++]=H[N];var j=d.tester(U);j.pts.pop(),W.push(j)}:X=function(H){W.push(d.tester(H))},B.type){case"MultiPolygon":for(Z=0;ZW&&(W=J,O=Z)}else O=B;return!O||!O.coordinates.some(N=>N.length>0)?[NaN,NaN]:s(O).geometry.coordinates}function E(L){var B=window.PlotlyGeoAssets||{},O=[];function G(N){return new Promise(function(H,$){t.json(N,function(U,V){if(U){delete B[N];var j=U.status===404?'GeoJSON at URL "'+N+'" does not exist.':"Unexpected error while fetching from "+N;return $(new Error(j))}return B[N]=V,H(V)})})}function W(N){return new Promise(function(H,$){var U=0,V=setInterval(function(){if(B[N]&&B[N]!=="pending")return clearInterval(V),H(B[N]);if(U>100)return clearInterval(V),$("Unexpected error while fetching from "+N);U++},50)})}for(var X=0;XD(F(L));function F(L){try{return l(L)}catch{return[]}}function D(L){if(L.length===0)return null;if(L.length===1){let[X,Z]=L[0];return[X,Z,X,Z]}let[[B,O],[G,W]]=n({type:"MultiPoint",coordinates:L});return[B,O,I([B,G])[1],W]}var R=(L,B)=>B.fitbounds==="geojson"&&L.locationmode==="geojson-id",P=(L,B)=>R(L,B)?F(k(L)):[],z=(L,B)=>D(P(L,B));function I([L,B]){return[L,L>B?B+M:B]}r.exports={locationToFeature:S,feature2polygons:w,getTraceGeojson:k,extractTraceFeature:A,fetchTraceGeoData:E,boundsOfCoords:D,computeBbox:T,coordsOf:F,doesCrossAntiMeridian:C,fitGeojsonBbox:z,fitGeojsonCoords:P,unwrapLonRange:I,ANTIMERIDIAN_LON_SHIFT:M}}}),u7=de({"src/traces/scattergeo/style.js"(e,r){"use strict";var t=Yr(),i=hn(),a=ta(),o=lf(),s=o.stylePoints,l=o.styleText;r.exports=function(c,f){f&&n(c,f)};function n(u,c){var f=c[0].trace,h=c[0].node3;h.style("opacity",c[0].trace.opacity),s(h,f,u),l(h,f,u),h.selectAll("path.js-line").style("fill","none").each(function(d){var p=t.select(this),g=d.trace,m=g.line||{};p.call(a.stroke,m.color).call(i.dashLine,m.dash||"",m.width||0),g.fill!=="none"&&p.call(a.fill,g.fillcolor)})}}}),T4=de({"src/traces/scattergeo/plot.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=_4().getTopojsonFeatures,o=g_(),s=Fp(),l=vd().findExtremes,n=cn().BADNUM,u=Uh().calcMarkerSize,c=bs(),f=u7();function h(g,m,y){var _=m.layers.frontplot.select(".scatterlayer"),v=i.makeTraceGroups(_,y,"trace scattergeo");function x(S,M){S.lonlat[0]===n&&t.select(M).remove()}v.selectAll("*").remove(),v.each(function(S){var M=t.select(this),C=S[0].trace;if(c.hasLines(C)||C.fill!=="none"){var w=o.calcTraceToLineCoords(S),k=C.fill!=="none"?o.makePolygon(w):o.makeLine(w);M.selectAll("path.js-line").data([{geojson:k,trace:C}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}c.hasMarkers(C)&&M.selectAll("path.point").data(i.identity).enter().append("path").classed("point",!0).each(function(A){x(A,this)}),c.hasText(C)&&M.selectAll("g").data(i.identity).enter().append("g").append("text").each(function(A){x(A,this)}),f(g,S)})}function d(g,m){var y=g[0].trace,_=m[y.geo],v=_._subplot,x=y._length,S,M;if(i.isArrayOrTypedArray(y.locations)){var C=y.locationmode,w=C==="geojson-id"?s.extractTraceFeature(g):a(y,v.topojson);for(S=0;S")}}}),YY=de({"src/traces/scattergeo/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){i.lon=a.lon,i.lat=a.lat,i.location=a.loc?a.loc:null;var n=s[l];return n.fIn&&n.fIn.properties&&(i.properties=n.fIn.properties),i}}}),XY=de({"src/traces/scattergeo/select.js"(e,r){"use strict";var t=bs(),i=cn().BADNUM;r.exports=function(o,s){var l=o.cd,n=o.xaxis,u=o.yaxis,c=[],f=l[0].trace,h,d,p,g,m,y=!t.hasMarkers(f)&&!t.hasText(f);if(y)return[];if(s===!1)for(m=0;mU?1:$>=U?0:NaN}function a($){return $.length===1&&($=o($)),{left:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)<0?j=Y+1:q=Y}return j},right:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)>0?q=Y:j=Y+1}return j}}}function o($){return function(U,V){return i($(U),V)}}var s=a(i),l=s.right,n=s.left;function u($,U){U==null&&(U=c);for(var V=0,j=$.length-1,q=$[0],Y=new Array(j<0?0:j);V$?1:U>=$?0:NaN}function d($){return $===null?NaN:+$}function p($,U){var V=$.length,j=0,q=-1,Y=0,K,te,ne=0;if(U==null)for(;++q1)return ne/(j-1)}function g($,U){var V=p($,U);return V&&Math.sqrt(V)}function m($,U){var V=$.length,j=-1,q,Y,K;if(U==null){for(;++j=q)for(Y=K=q;++jq&&(Y=q),K=q)for(Y=K=q;++jq&&(Y=q),K0)return[$];if((j=U<$)&&(Y=$,$=U,U=Y),(te=b($,U,V))===0||!isFinite(te))return[];if(te>0)for($=Math.ceil($/te),U=Math.floor(U/te),K=new Array(Y=Math.ceil(U-$+1));++q=0?(Y>=C?10:Y>=w?5:Y>=k?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(Y>=C?10:Y>=w?5:Y>=k?2:1)}function E($,U,V){var j=Math.abs(U-$)/Math.max(0,V),q=Math.pow(10,Math.floor(Math.log(j)/Math.LN10)),Y=j/q;return Y>=C?q*=10:Y>=w?q*=5:Y>=k&&(q*=2),U<$?-q:q}function T($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function F(){var $=S,U=m,V=T;function j(q){var Y,K=q.length,te,ne=new Array(K);for(Y=0;Yce;)pe.pop(),--xe;var ye=new Array(xe+1),fe;for(Y=0;Y<=xe;++Y)fe=ye[Y]=[],fe.x0=Y>0?pe[Y-1]:le,fe.x1=Y=1)return+V($[j-1],j-1,$);var j,q=(j-1)*U,Y=Math.floor(q),K=+V($[Y],Y,$),te=+V($[Y+1],Y+1,$);return K+(te-K)*(q-Y)}}function R($,U,V){return $=v.call($,d).sort(i),Math.ceil((V-U)/(2*(D($,.75)-D($,.25))*Math.pow($.length,-1/3)))}function P($,U,V){return Math.ceil((V-U)/(3.5*g($)*Math.pow($.length,-1/3)))}function z($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jY&&(Y=q)}else for(;++j=q)for(Y=q;++jY&&(Y=q);return Y}function I($,U){var V=$.length,j=V,q=-1,Y,K=0;if(U==null)for(;++q=0;)for(K=$[U],V=K.length;--V>=0;)Y[--q]=K[V];return Y}function O($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jq&&(Y=q)}else for(;++j=q)for(Y=q;++jq&&(Y=q);return Y}function G($,U){for(var V=U.length,j=new Array(V);V--;)j[V]=$[U[V]];return j}function W($,U){if(V=$.length){var V,j=0,q=0,Y,K=$[q];for(U==null&&(U=i);++j0?1:Se<0?-1:0},y=Math.sin,_=Math.tan,v=1e-6,x=1e-12,S=Math.PI,M=S/2,C=S/4,w=Math.SQRT1_2,k=P(2),A=P(S),b=S*2,E=180/S,T=S/180;function F(Se){return Se?Se/Math.sin(Se):1}function D(Se){return Se>1?M:Se<-1?-M:Math.asin(Se)}function R(Se){return Se>1?0:Se<-1?S:Math.acos(Se)}function P(Se){return Se>0?Math.sqrt(Se):0}function z(Se){return Se=u(2*Se),(Se-1)/(Se+1)}function I(Se){return(u(Se)-u(-Se))/2}function L(Se){return(u(Se)+u(-Se))/2}function B(Se){return f(Se+P(Se*Se+1))}function O(Se){return f(Se+P(Se*Se-1))}function G(Se){var Pe=_(Se/2),Ge=2*f(n(Se/2))/(Pe*Pe);function $e(st,ot){var pt=n(st),Vt=n(ot),tr=y(ot),Ut=Vt*pt,rr=-((1-Ut?f((1+Ut)/2)/(1-Ut):-.5)+Ge/(1+Ut));return[rr*Vt*y(st),rr*tr]}return $e.invert=function(st,ot){var pt=P(st*st+ot*ot),Vt=-Se/2,tr=50,Ut;if(!pt)return[0,0];do{var rr=Vt/2,pr=n(rr),Sr=y(rr),Rr=Sr/pr,Zr=-f(o(pr));Vt-=Ut=(2/Rr*Zr-Ge*Rr-pt)/(-Zr/(Sr*Sr)+1-Ge/(2*pr*pr))*(pr<0?.7:1)}while(o(Ut)>v&&--tr>0);var wi=y(Vt);return[l(st*wi,pt*n(Vt)),D(ot*wi/pt)]},$e}function W(){var Se=M,Pe=i.geoProjectionMutator(G),Ge=Pe(Se);return Ge.radius=function($e){return arguments.length?Pe(Se=$e*T):Se*E},Ge.scale(179.976).clipAngle(147)}function X(Se,Pe){var Ge=n(Pe),$e=F(R(Ge*n(Se/=2)));return[2*Ge*y(Se)*$e,y(Pe)*$e]}X.invert=function(Se,Pe){if(!(Se*Se+4*Pe*Pe>S*S+v)){var Ge=Se,$e=Pe,st=25;do{var ot=y(Ge),pt=y(Ge/2),Vt=n(Ge/2),tr=y($e),Ut=n($e),rr=y(2*$e),pr=tr*tr,Sr=Ut*Ut,Rr=pt*pt,Zr=1-Sr*Vt*Vt,wi=Zr?R(Ut*Vt)*P(qi=1/Zr):qi=0,qi,Aa=2*wi*Ut*pt-Se,un=wi*tr-Pe,gn=qi*(Sr*Rr+wi*Ut*Vt*pr),Tn=qi*(.5*ot*rr-wi*2*tr*pt),Pn=qi*.25*(rr*pt-wi*tr*Sr*ot),Eo=qi*(pr*Vt+wi*Rr*Ut),qo=Tn*Pn-Eo*gn;if(!qo)break;var Wn=(un*Tn-Aa*Eo)/qo,ls=(Aa*Pn-un*gn)/qo;Ge-=Wn,$e-=ls}while((o(Wn)>v||o(ls)>v)&&--st>0);return[Ge,$e]}};function Z(){return i.geoProjection(X).scale(152.63)}function J(Se){var Pe=y(Se),Ge=n(Se),$e=Se>=0?1:-1,st=_($e*Se),ot=(1+Pe-Ge)/2;function pt(Vt,tr){var Ut=n(tr),rr=n(Vt/=2);return[(1+Ut)*y(Vt),($e*tr>-l(rr,st)-.001?0:-$e*10)+ot+y(tr)*Ge-(1+Ut)*Pe*rr]}return pt.invert=function(Vt,tr){var Ut=0,rr=0,pr=50;do{var Sr=n(Ut),Rr=y(Ut),Zr=n(rr),wi=y(rr),qi=1+Zr,Aa=qi*Rr-Vt,un=ot+wi*Ge-qi*Pe*Sr-tr,gn=qi*Sr/2,Tn=-Rr*wi,Pn=Pe*qi*Rr/2,Eo=Ge*Zr+Pe*Sr*wi,qo=Tn*Pn-Eo*gn,Wn=(un*Tn-Aa*Eo)/qo/2,ls=(Aa*Pn-un*gn)/qo;o(ls)>2&&(ls/=2),Ut-=Wn,rr-=ls}while((o(Wn)>v||o(ls)>v)&&--pr>0);return $e*rr>-l(n(Ut),st)-.001?[Ut*2,rr]:null},pt}function N(){var Se=20*T,Pe=Se>=0?1:-1,Ge=_(Pe*Se),$e=i.geoProjectionMutator(J),st=$e(Se),ot=st.stream;return st.parallel=function(pt){return arguments.length?(Ge=_((Pe=(Se=pt*T)>=0?1:-1)*Se),$e(Se)):Se*E},st.stream=function(pt){var Vt=st.rotate(),tr=ot(pt),Ut=(st.rotate([0,0]),ot(pt)),rr=st.precision();return st.rotate(Vt),tr.sphere=function(){Ut.polygonStart(),Ut.lineStart();for(var pr=Pe*-180;Pe*pr<180;pr+=Pe*90)Ut.point(pr,Pe*90);if(Se)for(;Pe*(pr-=3*Pe*rr)>=-180;)Ut.point(pr,Pe*-l(n(pr*T/2),Ge)*E);Ut.lineEnd(),Ut.polygonEnd()},tr},st.scale(218.695).center([0,28.0974])}function H(Se,Pe){var Ge=_(Pe/2),$e=P(1-Ge*Ge),st=1+$e*n(Se/=2),ot=y(Se)*$e/st,pt=Ge/st,Vt=ot*ot,tr=pt*pt;return[4/3*ot*(3+Vt-3*tr),4/3*pt*(3+3*Vt-tr)]}H.invert=function(Se,Pe){if(Se*=3/8,Pe*=3/8,!Se&&o(Pe)>1)return null;var Ge=Se*Se,$e=Pe*Pe,st=1+Ge+$e,ot=P((st-P(st*st-4*Pe*Pe))/2),pt=D(ot)/3,Vt=ot?O(o(Pe/ot))/3:B(o(Se))/3,tr=n(pt),Ut=L(Vt),rr=Ut*Ut-tr*tr;return[m(Se)*2*l(I(Vt)*tr,.25-rr),m(Pe)*2*l(Ut*y(pt),.25+rr)]};function $(){return i.geoProjection(H).scale(66.1603)}var U=P(8),V=f(1+k);function j(Se,Pe){var Ge=o(Pe);return Gex&&--$e>0);return[Se/(n(Ge)*(U-1/y(Ge))),m(Pe)*Ge]};function q(){return i.geoProjection(j).scale(112.314)}function Y(Se){var Pe=2*S/Se;function Ge($e,st){var ot=i.geoAzimuthalEquidistantRaw($e,st);if(o($e)>M){var pt=l(ot[1],ot[0]),Vt=P(ot[0]*ot[0]+ot[1]*ot[1]),tr=Pe*g((pt-M)/Pe)+M,Ut=l(y(pt-=tr),2-n(pt));pt=tr+D(S/Vt*y(Ut))-Ut,ot[0]=Vt*n(pt),ot[1]=Vt*y(pt)}return ot}return Ge.invert=function($e,st){var ot=P($e*$e+st*st);if(ot>M){var pt=l(st,$e),Vt=Pe*g((pt-M)/Pe)+M,tr=pt>Vt?-1:1,Ut=ot*n(Vt-pt),rr=1/_(tr*R((Ut-S)/P(S*(S-2*Ut)+ot*ot)));pt=Vt+2*s((rr+tr*P(rr*rr-3))/3),$e=ot*n(pt),st=ot*y(pt)}return i.geoAzimuthalEquidistantRaw.invert($e,st)},Ge}function K(){var Se=5,Pe=i.geoProjectionMutator(Y),Ge=Pe(Se),$e=Ge.stream,st=.01,ot=-n(st*T),pt=y(st*T);return Ge.lobes=function(Vt){return arguments.length?Pe(Se=+Vt):Se},Ge.stream=function(Vt){var tr=Ge.rotate(),Ut=$e(Vt),rr=(Ge.rotate([0,0]),$e(Vt));return Ge.rotate(tr),Ut.sphere=function(){rr.polygonStart(),rr.lineStart();for(var pr=0,Sr=360/Se,Rr=2*S/Se,Zr=90-180/Se,wi=M;pr0&&o(st)>v);return $e<0?NaN:Ge}function ce(Se,Pe,Ge){return Pe===void 0&&(Pe=40),Ge===void 0&&(Ge=x),function($e,st,ot,pt){var Vt,tr,Ut;ot=ot===void 0?0:+ot,pt=pt===void 0?0:+pt;for(var rr=0;rrVt){ot-=tr/=2,pt-=Ut/=2;continue}Vt=Zr;var wi=(ot>0?-1:1)*Ge,qi=(pt>0?-1:1)*Ge,Aa=Se(ot+wi,pt),un=Se(ot,pt+qi),gn=(Aa[0]-pr[0])/wi,Tn=(Aa[1]-pr[1])/wi,Pn=(un[0]-pr[0])/qi,Eo=(un[1]-pr[1])/qi,qo=Eo*gn-Tn*Pn,Wn=(o(qo)<.5?.5:1)/qo;if(tr=(Rr*Pn-Sr*Eo)*Wn,Ut=(Sr*Tn-Rr*gn)*Wn,ot+=tr,pt+=Ut,o(tr)0&&(Vt[1]*=1+tr/1.5*Vt[0]*Vt[0]),Vt}return $e.invert=ce($e),$e}function xe(){return i.geoProjection(pe()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ye(Se,Pe){var Ge=Se*y(Pe),$e=30,st;do Pe-=st=(Pe+y(Pe)-Ge)/(1+n(Pe));while(o(st)>v&&--$e>0);return Pe/2}function fe(Se,Pe,Ge){function $e(st,ot){return[Se*st*n(ot=ye(Ge,ot)),Pe*y(ot)]}return $e.invert=function(st,ot){return ot=D(ot/Pe),[st/(Se*n(ot)),D((2*ot+y(2*ot))/Ge)]},$e}var ae=fe(k/M,k,S);function ee(){return i.geoProjection(ae).scale(169.529)}var ie=2.00276,Q=1.11072;function ue(Se,Pe){var Ge=ye(S,Pe);return[ie*Se/(1/n(Pe)+Q/n(Ge)),(Pe+k*y(Ge))/ie]}ue.invert=function(Se,Pe){var Ge=ie*Pe,$e=Pe<0?-C:C,st=25,ot,pt;do pt=Ge-k*y($e),$e-=ot=(y(2*$e)+2*$e-S*y(pt))/(2*n(2*$e)+2+S*n(pt)*k*n($e));while(o(ot)>v&&--st>0);return pt=Ge-k*y($e),[Se*(1/n(pt)+Q/n($e))/ie,pt]};function ge(){return i.geoProjection(ue).scale(160.857)}function Me(Se){var Pe=0,Ge=i.geoProjectionMutator(Se),$e=Ge(Pe);return $e.parallel=function(st){return arguments.length?Ge(Pe=st*T):Pe*E},$e}function Te(Se,Pe){return[Se*n(Pe),Pe]}Te.invert=function(Se,Pe){return[Se/n(Pe),Pe]};function je(){return i.geoProjection(Te).scale(152.63)}function Ve(Se){if(!Se)return Te;var Pe=1/_(Se);function Ge($e,st){var ot=Pe+Se-st,pt=ot&&$e*n(st)/ot;return[ot*y(pt),Pe-ot*n(pt)]}return Ge.invert=function($e,st){var ot=P($e*$e+(st=Pe-st)*st),pt=Pe+Se-ot;return[ot/n(pt)*l($e,st),pt]},Ge}function Ze(){return Me(Ve).scale(123.082).center([0,26.1441]).parallel(45)}function Ke(Se){function Pe(Ge,$e){var st=M-$e,ot=st&&Ge*Se*y(st)/st;return[st*y(ot)/Se,M-st*n(ot)]}return Pe.invert=function(Ge,$e){var st=Ge*Se,ot=M-$e,pt=P(st*st+ot*ot),Vt=l(st,ot);return[(pt?pt/y(pt):1)*Vt/Se,M-pt]},Pe}function vt(){var Se=.5,Pe=i.geoProjectionMutator(Ke),Ge=Pe(Se);return Ge.fraction=function($e){return arguments.length?Pe(Se=+$e):Se},Ge.scale(158.837)}var xt=fe(1,4/S,S);function Pt(){return i.geoProjection(xt).scale(152.63)}function mt(Se,Pe,Ge,$e,st,ot){var pt=n(ot),Vt;if(o(Se)>1||o(ot)>1)Vt=R(Ge*st+Pe*$e*pt);else{var tr=y(Se/2),Ut=y(ot/2);Vt=2*D(P(tr*tr+Pe*$e*Ut*Ut))}return o(Vt)>v?[Vt,l($e*y(ot),Pe*st-Ge*$e*pt)]:[0,0]}function Mt(Se,Pe,Ge){return R((Se*Se+Pe*Pe-Ge*Ge)/(2*Se*Pe))}function lt(Se){return Se-2*S*c((Se+S)/(2*S))}function qe(Se,Pe,Ge){for(var $e=[[Se[0],Se[1],y(Se[1]),n(Se[1])],[Pe[0],Pe[1],y(Pe[1]),n(Pe[1])],[Ge[0],Ge[1],y(Ge[1]),n(Ge[1])]],st=$e[2],ot,pt=0;pt<3;++pt,st=ot)ot=$e[pt],st.v=mt(ot[1]-st[1],st[3],st[2],ot[3],ot[2],ot[0]-st[0]),st.point=[0,0];var Vt=Mt($e[0].v[0],$e[2].v[0],$e[1].v[0]),tr=Mt($e[0].v[0],$e[1].v[0],$e[2].v[0]),Ut=S-Vt;$e[2].point[1]=0,$e[0].point[0]=-($e[1].point[0]=$e[0].v[0]/2);var rr=[$e[2].point[0]=$e[0].point[0]+$e[2].v[0]*n(Vt),2*($e[0].point[1]=$e[1].point[1]=$e[2].v[0]*y(Vt))];function pr(Sr,Rr){var Zr=y(Rr),wi=n(Rr),qi=new Array(3),Aa;for(Aa=0;Aa<3;++Aa){var un=$e[Aa];if(qi[Aa]=mt(Rr-un[1],un[3],un[2],wi,Zr,Sr-un[0]),!qi[Aa][0])return un.point;qi[Aa][1]=lt(qi[Aa][1]-un.v[1])}var gn=rr.slice();for(Aa=0;Aa<3;++Aa){var Tn=Aa==2?0:Aa+1,Pn=Mt($e[Aa].v[0],qi[Aa][0],qi[Tn][0]);qi[Aa][1]<0&&(Pn=-Pn),Aa?Aa==1?(Pn=tr-Pn,gn[0]-=qi[Aa][0]*n(Pn),gn[1]-=qi[Aa][0]*y(Pn)):(Pn=Ut-Pn,gn[0]+=qi[Aa][0]*n(Pn),gn[1]+=qi[Aa][0]*y(Pn)):(gn[0]+=qi[Aa][0]*n(Pn),gn[1]-=qi[Aa][0]*y(Pn))}return gn[0]/=3,gn[1]/=3,gn}return pr}function Ye(Se){return Se[0]*=T,Se[1]*=T,Se}function me(){return _e([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function _e(Se,Pe,Ge){var $e=i.geoCentroid({type:"MultiPoint",coordinates:[Se,Pe,Ge]}),st=[-$e[0],-$e[1]],ot=i.geoRotation(st),pt=qe(Ye(ot(Se)),Ye(ot(Pe)),Ye(ot(Ge)));pt.invert=ce(pt);var Vt=i.geoProjection(pt).rotate(st),tr=Vt.center;return delete Vt.rotate,Vt.center=function(Ut){return arguments.length?tr(ot(Ut)):ot.invert(tr())},Vt.clipAngle(90)}function Ae(Se,Pe){var Ge=P(1-y(Pe));return[2/A*Se*Ge,A*(1-Ge)]}Ae.invert=function(Se,Pe){var Ge=(Ge=Pe/A-1)*Ge;return[Ge>0?Se*P(S/Ge)/2:0,D(1-Ge)]};function ke(){return i.geoProjection(Ae).scale(95.6464).center([0,30])}function Ee(Se){var Pe=_(Se);function Ge($e,st){return[$e,($e?$e/y($e):1)*(y(st)*n($e)-Pe*n(st))]}return Ge.invert=Pe?function($e,st){$e&&(st*=y($e)/$e);var ot=n($e);return[$e,2*l(P(ot*ot+Pe*Pe-st*st)-ot,Pe-st)]}:function($e,st){return[$e,D($e?st*_($e)/$e:st)]},Ge}function De(){return Me(Ee).scale(249.828).clipAngle(90)}var Je=P(3);function Ue(Se,Pe){return[Je*Se*(2*n(2*Pe/3)-1)/A,Je*A*y(Pe/3)]}Ue.invert=function(Se,Pe){var Ge=3*D(Pe/(Je*A));return[A*Se/(Je*(2*n(2*Ge/3)-1)),Ge]};function at(){return i.geoProjection(Ue).scale(156.19)}function rt(Se){var Pe=n(Se);function Ge($e,st){return[$e*Pe,y(st)/Pe]}return Ge.invert=function($e,st){return[$e/Pe,D(st*Pe)]},Ge}function ft(){return Me(rt).parallel(38.58).scale(195.044)}function At(Se){var Pe=n(Se);function Ge($e,st){return[$e*Pe,(1+Pe)*_(st/2)]}return Ge.invert=function($e,st){return[$e/Pe,s(st/(1+Pe))*2]},Ge}function ht(){return Me(At).scale(124.75)}function Gt(Se,Pe){var Ge=P(8/(3*S));return[Ge*Se*(1-o(Pe)/S),Ge*Pe]}Gt.invert=function(Se,Pe){var Ge=P(8/(3*S)),$e=Pe/Ge;return[Se/(Ge*(1-o($e)/S)),$e]};function fr(){return i.geoProjection(Gt).scale(165.664)}function gt(Se,Pe){var Ge=P(4-3*y(o(Pe)));return[2/P(6*S)*Se*Ge,m(Pe)*P(2*S/3)*(2-Ge)]}gt.invert=function(Se,Pe){var Ge=2-o(Pe)/P(2*S/3);return[Se*P(6*S)/(2*Ge),m(Pe)*D((4-Ge*Ge)/3)]};function yt(){return i.geoProjection(gt).scale(165.664)}function kt(Se,Pe){var Ge=P(S*(4+S));return[2/Ge*Se*(1+P(1-4*Pe*Pe/(S*S))),4/Ge*Pe]}kt.invert=function(Se,Pe){var Ge=P(S*(4+S))/2;return[Se*Ge/(1+P(1-Pe*Pe*(4+S)/(4*S))),Pe*Ge/2]};function Lt(){return i.geoProjection(kt).scale(180.739)}function Ct(Se,Pe){var Ge=(2+M)*y(Pe);Pe/=2;for(var $e=0,st=1/0;$e<10&&o(st)>v;$e++){var ot=n(Pe);Pe-=st=(Pe+y(Pe)*(ot+2)-Ge)/(2*ot*(1+ot))}return[2/P(S*(4+S))*Se*(1+n(Pe)),2*P(S/(4+S))*y(Pe)]}Ct.invert=function(Se,Pe){var Ge=Pe*P((4+S)/S)/2,$e=D(Ge),st=n($e);return[Se/(2/P(S*(4+S))*(1+st)),D(($e+Ge*(st+2))/(2+M))]};function $t(){return i.geoProjection(Ct).scale(180.739)}function mr(Se,Pe){return[Se*(1+n(Pe))/P(2+S),2*Pe/P(2+S)]}mr.invert=function(Se,Pe){var Ge=P(2+S),$e=Pe*Ge/2;return[Ge*Se/(1+n($e)),$e]};function br(){return i.geoProjection(mr).scale(173.044)}function Er(Se,Pe){for(var Ge=(1+M)*y(Pe),$e=0,st=1/0;$e<10&&o(st)>v;$e++)Pe-=st=(Pe+y(Pe)-Ge)/(1+n(Pe));return Ge=P(2+S),[Se*(1+n(Pe))/Ge,2*Pe/Ge]}Er.invert=function(Se,Pe){var Ge=1+M,$e=P(Ge/2);return[Se*2*$e/(1+n(Pe*=$e)),D((Pe+y(Pe))/Ge)]};function Tr(){return i.geoProjection(Er).scale(173.044)}var Ur=3+2*k;function Ai(Se,Pe){var Ge=y(Se/=2),$e=n(Se),st=P(n(Pe)),ot=n(Pe/=2),pt=y(Pe)/(ot+k*$e*st),Vt=P(2/(1+pt*pt)),tr=P((k*ot+($e+Ge)*st)/(k*ot+($e-Ge)*st));return[Ur*(Vt*(tr-1/tr)-2*f(tr)),Ur*(Vt*pt*(tr+1/tr)-2*s(pt))]}Ai.invert=function(Se,Pe){if(!(ot=H.invert(Se/1.2,Pe*1.065)))return null;var Ge=ot[0],$e=ot[1],st=20,ot;Se/=Ur,Pe/=Ur;do{var pt=Ge/2,Vt=$e/2,tr=y(pt),Ut=n(pt),rr=y(Vt),pr=n(Vt),Sr=n($e),Rr=P(Sr),Zr=rr/(pr+k*Ut*Rr),wi=Zr*Zr,qi=P(2/(1+wi)),Aa=k*pr+(Ut+tr)*Rr,un=k*pr+(Ut-tr)*Rr,gn=Aa/un,Tn=P(gn),Pn=Tn-1/Tn,Eo=Tn+1/Tn,qo=qi*Pn-2*f(Tn)-Se,Wn=qi*Zr*Eo-2*s(Zr)-Pe,ls=rr&&w*Rr*tr*wi/rr,ol=(k*Ut*pr+Rr)/(2*(pr+k*Ut*Rr)*(pr+k*Ut*Rr)*Rr),wl=-.5*Zr*qi*qi*qi,Vu=wl*ls,Pc=wl*ol,dl=(dl=2*pr+k*Rr*(Ut-tr))*dl*Tn,pl=(k*Ut*pr*Rr+Sr)/dl,Tu=-(k*tr*rr)/(Rr*dl),nc=Pn*Vu-2*pl/Tn+qi*(pl+pl/gn),oc=Pn*Pc-2*Tu/Tn+qi*(Tu+Tu/gn),sc=Zr*Eo*Vu-2*ls/(1+wi)+qi*Eo*ls+qi*Zr*(pl-pl/gn),Ic=Zr*Eo*Pc-2*ol/(1+wi)+qi*Eo*ol+qi*Zr*(Tu-Tu/gn),Gu=oc*sc-Ic*nc;if(!Gu)break;var tf=(Wn*oc-qo*Ic)/Gu,th=(qo*sc-Wn*nc)/Gu;Ge-=tf,$e=h(-M,d(M,$e-th))}while((o(tf)>v||o(th)>v)&&--st>0);return o(o($e)-M)$e){var pr=P(rr),Sr=l(Ut,tr),Rr=Ge*g(Sr/Ge),Zr=Sr-Rr,wi=Se*n(Zr),qi=(Se*y(Zr)-Zr*y(wi))/(M-wi),Aa=Jr(Zr,qi),un=(S-Se)/Be(Aa,wi,S);tr=pr;var gn=50,Tn;do tr-=Tn=(Se+Be(Aa,wi,tr)*un-pr)/(Aa(tr)*un);while(o(Tn)>v&&--gn>0);Ut=Zr*y(tr),tr$e){var tr=P(Vt),Ut=l(pt,ot),rr=Ge*g(Ut/Ge),pr=Ut-rr;ot=tr*n(pr),pt=tr*y(pr);for(var Sr=ot-M,Rr=y(ot),Zr=pt/Rr,wi=otv||o(Zr)>v)&&--wi>0);return[pr,Sr]},tr}var St=Et(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function zt(){return i.geoProjection(St).scale(149.995)}var Wt=Et(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Yt(){return i.geoProjection(Wt).scale(153.93)}var ze=Et(5/6*S,-.62636,-.0344,0,1.3493,-.05524,0,.045);function tt(){return i.geoProjection(ze).scale(130.945)}function ct(Se,Pe){var Ge=Se*Se,$e=Pe*Pe;return[Se*(1-.162388*$e)*(.87-952426e-9*Ge*Ge),Pe*(1+$e/12)]}ct.invert=function(Se,Pe){var Ge=Se,$e=Pe,st=50,ot;do{var pt=$e*$e;$e-=ot=($e*(1+pt/12)-Pe)/(1+pt/4)}while(o(ot)>v&&--st>0);st=50,Se/=1-.162388*pt;do{var Vt=(Vt=Ge*Ge)*Vt;Ge-=ot=(Ge*(.87-952426e-9*Vt)-Se)/(.87-.00476213*Vt)}while(o(ot)>v&&--st>0);return[Ge,$e]};function wt(){return i.geoProjection(ct).scale(131.747)}var Nt=Et(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function It(){return i.geoProjection(Nt).scale(131.087)}function Zt(Se){var Pe=Se(M,0)[0]-Se(-M,0)[0];function Ge($e,st){var ot=$e>0?-.5:.5,pt=Se($e+ot*S,st);return pt[0]-=ot*Pe,pt}return Se.invert&&(Ge.invert=function($e,st){var ot=$e>0?-.5:.5,pt=Se.invert($e+ot*Pe,st),Vt=pt[0]-ot*S;return Vt<-S?Vt+=2*S:Vt>S&&(Vt-=2*S),pt[0]=Vt,pt}),Ge}function qt(Se,Pe){var Ge=m(Se),$e=m(Pe),st=n(Pe),ot=n(Se)*st,pt=y(Se)*st,Vt=y($e*Pe);Se=o(l(pt,Vt)),Pe=D(ot),o(Se-M)>v&&(Se%=M);var tr=vr(Se>S/4?M-Se:Se,Pe);return Se>S/4&&(Vt=tr[0],tr[0]=-tr[1],tr[1]=-Vt),tr[0]*=Ge,tr[1]*=-$e,tr}qt.invert=function(Se,Pe){o(Se)>1&&(Se=m(Se)*2-Se),o(Pe)>1&&(Pe=m(Pe)*2-Pe);var Ge=m(Se),$e=m(Pe),st=-Ge*Se,ot=-$e*Pe,pt=ot/st<1,Vt=Br(pt?ot:st,pt?st:ot),tr=Vt[0],Ut=Vt[1],rr=n(Ut);return pt&&(tr=-M-tr),[Ge*(l(y(tr)*rr,-y(Ut))+S),$e*D(n(tr)*rr)]};function vr(Se,Pe){if(Pe===M)return[0,0];var Ge=y(Pe),$e=Ge*Ge,st=$e*$e,ot=1+st,pt=1+3*st,Vt=1-st,tr=D(1/P(ot)),Ut=Vt+$e*ot*tr,rr=(1-Ge)/Ut,pr=P(rr),Sr=rr*ot,Rr=P(Sr),Zr=pr*Vt,wi,qi;if(Se===0)return[0,-(Zr+$e*Rr)];var Aa=n(Pe),un=1/Aa,gn=2*Ge*Aa,Tn=(-3*$e+tr*pt)*gn,Pn=(-Ut*Aa-(1-Ge)*Tn)/(Ut*Ut),Eo=.5*Pn/pr,qo=Vt*Eo-2*$e*pr*gn,Wn=$e*ot*Pn+rr*pt*gn,ls=-un*gn,ol=-un*Wn,wl=-2*un*qo,Vu=4*Se/S,Pc;if(Se>.222*S||Pe.175*S){if(wi=(Zr+$e*P(Sr*(1+st)-Zr*Zr))/(1+st),Se>S/4)return[wi,wi];var dl=wi,pl=.5*wi;wi=.5*(pl+dl),qi=50;do{var Tu=P(Sr-wi*wi),nc=wi*(wl+ls*Tu)+ol*D(wi/Rr)-Vu;if(!nc)break;nc<0?pl=wi:dl=wi,wi=.5*(pl+dl)}while(o(dl-pl)>v&&--qi>0)}else{wi=v,qi=25;do{var oc=wi*wi,sc=P(Sr-oc),Ic=wl+ls*sc,Gu=wi*Ic+ol*D(wi/Rr)-Vu,tf=Ic+(ol-ls*oc)/sc;wi-=Pc=sc?Gu/tf:0}while(o(Pc)>v&&--qi>0)}return[wi,-Zr-$e*P(Sr-wi*wi)]}function Br(Se,Pe){for(var Ge=0,$e=1,st=.5,ot=50;;){var pt=st*st,Vt=P(st),tr=D(1/P(1+pt)),Ut=1-pt+st*(1+pt)*tr,rr=(1-Vt)/Ut,pr=P(rr),Sr=rr*(1+pt),Rr=pr*(1-pt),Zr=Sr-Se*Se,wi=P(Zr),qi=Pe+Rr+st*wi;if(o($e-Ge)0?Ge=st:$e=st,st=.5*(Ge+$e)}if(!ot)return null;var Aa=D(Vt),un=n(Aa),gn=1/un,Tn=2*Vt*un,Pn=(-3*st+tr*(1+3*pt))*Tn,Eo=(-Ut*un-(1-Vt)*Pn)/(Ut*Ut),qo=.5*Eo/pr,Wn=(1-pt)*qo-2*st*pr*Tn,ls=-2*gn*Wn,ol=-gn*Tn,wl=-gn*(st*(1+pt)*Eo+rr*(1+3*pt)*Tn);return[S/4*(Se*(ls+ol*wi)+wl*D(Se/P(Sr))),Aa]}function Pr(){return i.geoProjection(Zt(qt)).scale(239.75)}function Mi(Se,Pe,Ge){var $e,st,ot;return Se?($e=gi(Se,Ge),Pe?(st=gi(Pe,1-Ge),ot=st[1]*st[1]+Ge*$e[0]*$e[0]*st[0]*st[0],[[$e[0]*st[2]/ot,$e[1]*$e[2]*st[0]*st[1]/ot],[$e[1]*st[1]/ot,-$e[0]*$e[2]*st[0]*st[2]/ot],[$e[2]*st[1]*st[2]/ot,-Ge*$e[0]*$e[1]*st[0]/ot]]):[[$e[0],0],[$e[1],0],[$e[2],0]]):(st=gi(Pe,1-Ge),[[0,st[0]/st[1]],[1/st[1],0],[st[2]/st[1],0]])}function gi(Se,Pe){var Ge,$e,st,ot,pt;if(Pe=1-v)return Ge=(1-Pe)/4,$e=L(Se),ot=z(Se),st=1/$e,pt=$e*I(Se),[ot+Ge*(pt-Se)/($e*$e),st-Ge*ot*st*(pt-Se),st+Ge*ot*st*(pt+Se),2*s(u(Se))-M+Ge*(pt-Se)/$e];var Vt=[1,0,0,0,0,0,0,0,0],tr=[P(Pe),0,0,0,0,0,0,0,0],Ut=0;for($e=P(1-Pe),pt=1;o(tr[Ut]/Vt[Ut])>v&&Ut<8;)Ge=Vt[Ut++],tr[Ut]=(Ge-$e)/2,Vt[Ut]=(Ge+$e)/2,$e=P(Ge*$e),pt*=2;st=pt*Vt[Ut]*Se;do ot=tr[Ut]*y($e=st)/Vt[Ut],st=(D(ot)+st)/2;while(--Ut);return[y(st),ot=n(st),ot/n(st-$e),st]}function ba(Se,Pe,Ge){var $e=o(Se),st=o(Pe),ot=I(st);if($e){var pt=1/y($e),Vt=1/(_($e)*_($e)),tr=-(Vt+Ge*(ot*ot*pt*pt)-1+Ge),Ut=(Ge-1)*Vt,rr=(-tr+P(tr*tr-4*Ut))/2;return[Hi(s(1/P(rr)),Ge)*m(Se),Hi(s(P((rr/Vt-1)/Ge)),1-Ge)*m(Pe)]}return[0,Hi(s(ot),1-Ge)*m(Pe)]}function Hi(Se,Pe){if(!Pe)return Se;if(Pe===1)return f(_(Se/2+C));for(var Ge=1,$e=P(1-Pe),st=P(Pe),ot=0;o(st)>v;ot++){if(Se%S){var pt=s($e*_(Se)/Ge);pt<0&&(pt+=S),Se+=pt+~~(Se/S)*S}else Se+=Se;st=(Ge+$e)/2,$e=P(Ge*$e),st=((Ge=st)-$e)/2}return Se/(p(2,ot)*Ge)}function Za(Se,Pe){var Ge=(k-1)/(k+1),$e=P(1-Ge*Ge),st=Hi(M,$e*$e),ot=-1,pt=f(_(S/4+o(Pe)/2)),Vt=u(ot*pt)/P(Ge),tr=oa(Vt*n(ot*Se),Vt*y(ot*Se)),Ut=ba(tr[0],tr[1],$e*$e);return[-Ut[1],(Pe>=0?1:-1)*(.5*st-Ut[0])]}function oa(Se,Pe){var Ge=Se*Se,$e=Pe+1,st=1-Ge-Pe*Pe;return[.5*((Se>=0?M:-M)-l(st,2*Se)),-.25*f(st*st+4*Ge)+.5*f($e*$e+Ge)]}function Cn(Se,Pe){var Ge=Pe[0]*Pe[0]+Pe[1]*Pe[1];return[(Se[0]*Pe[0]+Se[1]*Pe[1])/Ge,(Se[1]*Pe[0]-Se[0]*Pe[1])/Ge]}Za.invert=function(Se,Pe){var Ge=(k-1)/(k+1),$e=P(1-Ge*Ge),st=Hi(M,$e*$e),ot=-1,pt=Mi(.5*st-Pe,-Se,$e*$e),Vt=Cn(pt[0],pt[1]),tr=l(Vt[1],Vt[0])/ot;return[tr,2*s(u(.5/ot*f(Ge*Vt[0]*Vt[0]+Ge*Vt[1]*Vt[1])))-M]};function _n(){return i.geoProjection(Zt(Za)).scale(151.496)}function Li(Se){var Pe=y(Se),Ge=n(Se),$e=In(Se);$e.invert=In(-Se);function st(ot,pt){var Vt=$e(ot,pt);ot=Vt[0],pt=Vt[1];var tr=y(pt),Ut=n(pt),rr=n(ot),pr=R(Pe*tr+Ge*Ut*rr),Sr=y(pr),Rr=o(Sr)>v?pr/Sr:1;return[Rr*Ge*y(ot),(o(ot)>M?Rr:-Rr)*(Pe*Ut-Ge*tr*rr)]}return st.invert=function(ot,pt){var Vt=P(ot*ot+pt*pt),tr=-y(Vt),Ut=n(Vt),rr=Vt*Ut,pr=-pt*tr,Sr=Vt*Pe,Rr=P(rr*rr+pr*pr-Sr*Sr),Zr=l(rr*Sr+pr*Rr,pr*Sr-rr*Rr),wi=(Vt>M?-1:1)*l(ot*tr,Vt*n(Zr)*Ut+pt*y(Zr)*tr);return $e.invert(wi,Zr)},st}function In(Se){var Pe=y(Se),Ge=n(Se);return function($e,st){var ot=n(st),pt=n($e)*ot,Vt=y($e)*ot,tr=y(st);return[l(Vt,pt*Ge-tr*Pe),D(tr*Ge+pt*Pe)]}}function pn(){var Se=0,Pe=i.geoProjectionMutator(Li),Ge=Pe(Se),$e=Ge.rotate,st=Ge.stream,ot=i.geoCircle();return Ge.parallel=function(pt){if(!arguments.length)return Se*E;var Vt=Ge.rotate();return Pe(Se=pt*T).rotate(Vt)},Ge.rotate=function(pt){return arguments.length?($e.call(Ge,[pt[0],pt[1]-Se*E]),ot.center([-pt[0],-pt[1]]),Ge):(pt=$e.call(Ge),pt[1]+=Se*E,pt)},Ge.stream=function(pt){return pt=st(pt),pt.sphere=function(){pt.polygonStart();var Vt=.01,tr=ot.radius(90-Vt)().coordinates[0],Ut=tr.length-1,rr=-1,pr;for(pt.lineStart();++rr=0;)pt.point((pr=tr[rr])[0],pr[1]);pt.lineEnd(),pt.polygonEnd()},pt},Ge.scale(79.4187).parallel(45).clipAngle(180-.001)}var Ka=3,Rn=D(1-1/Ka)*E,tn=rt(0);function Mn(Se){var Pe=Rn*T,Ge=Ae(S,Pe)[0]-Ae(-S,Pe)[0],$e=tn(0,Pe)[1],st=Ae(0,Pe)[1],ot=A-st,pt=b/Se,Vt=4/b,tr=$e+ot*ot*4/b;function Ut(rr,pr){var Sr,Rr=o(pr);if(Rr>Pe){var Zr=d(Se-1,h(0,c((rr+S)/pt)));rr+=S*(Se-1)/Se-Zr*pt,Sr=Ae(rr,Rr),Sr[0]=Sr[0]*b/Ge-b*(Se-1)/(2*Se)+Zr*b/Se,Sr[1]=$e+(Sr[1]-st)*4*ot/b,pr<0&&(Sr[1]=-Sr[1])}else Sr=tn(rr,pr);return Sr[0]*=Vt,Sr[1]/=tr,Sr}return Ut.invert=function(rr,pr){rr/=Vt,pr*=tr;var Sr=o(pr);if(Sr>$e){var Rr=d(Se-1,h(0,c((rr+S)/pt)));rr=(rr+S*(Se-1)/Se-Rr*pt)*Ge/b;var Zr=Ae.invert(rr,.25*(Sr-$e)*b/ot+st);return Zr[0]-=S*(Se-1)/Se-Rr*pt,pr<0&&(Zr[1]=-Zr[1]),Zr}return tn.invert(rr,pr)},Ut}function Kn(Se,Pe){return[Se,Pe&1?90-v:Rn]}function zn(Se,Pe){return[Se,Pe&1?-90+v:-Rn]}function ua(Se){return[Se[0]*(1-v),Se[1]]}function Ea(Se){var Pe=[].concat(a.range(-180,180+Se/2,Se).map(Kn),a.range(180,-180-Se/2,-Se).map(zn));return{type:"Polygon",coordinates:[Se===180?Pe.map(ua):Pe]}}function ln(){var Se=4,Pe=i.geoProjectionMutator(Mn),Ge=Pe(Se),$e=Ge.stream;return Ge.lobes=function(st){return arguments.length?Pe(Se=+st):Se},Ge.stream=function(st){var ot=Ge.rotate(),pt=$e(st),Vt=(Ge.rotate([0,0]),$e(st));return Ge.rotate(ot),pt.sphere=function(){i.geoStream(Ea(180/Se),Vt)},pt},Ge.scale(239.75)}function on(Se){var Pe=1+Se,Ge=y(1/Pe),$e=D(Ge),st=2*P(S/(ot=S+4*$e*Pe)),ot,pt=.5*st*(Pe+P(Se*(2+Se))),Vt=Se*Se,tr=Pe*Pe;function Ut(rr,pr){var Sr=1-y(pr),Rr,Zr;if(Sr&&Sr<2){var wi=M-pr,qi=25,Aa;do{var un=y(wi),gn=n(wi),Tn=$e+l(un,Pe-gn),Pn=1+tr-2*Pe*gn;wi-=Aa=(wi-Vt*$e-Pe*un+Pn*Tn-.5*Sr*ot)/(2*Pe*un*Tn)}while(o(Aa)>x&&--qi>0);Rr=st*P(Pn),Zr=rr*Tn/S}else Rr=st*(Se+Sr),Zr=rr*$e/S;return[Rr*y(Zr),pt-Rr*n(Zr)]}return Ut.invert=function(rr,pr){var Sr=rr*rr+(pr-=pt)*pr,Rr=(1+tr-Sr/(st*st))/(2*Pe),Zr=R(Rr),wi=y(Zr),qi=$e+l(wi,Pe-Rr);return[D(rr/P(Sr))*S/qi,D(1-2*(Zr-Vt*$e-Pe*wi+(1+tr-2*Pe*Rr)*qi)/ot)]},Ut}function ao(){var Se=1,Pe=i.geoProjectionMutator(on),Ge=Pe(Se);return Ge.ratio=function($e){return arguments.length?Pe(Se=+$e):Se},Ge.scale(167.774).center([0,18.67])}var ho=.7109889596207567,Jn=.0528035274542;function lo(Se,Pe){return Pe>-ho?(Se=ae(Se,Pe),Se[1]+=Jn,Se):Te(Se,Pe)}lo.invert=function(Se,Pe){return Pe>-ho?ae.invert(Se,Pe-Jn):Te.invert(Se,Pe)};function Fo(){return i.geoProjection(lo).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function uo(Se,Pe){return o(Pe)>ho?(Se=ae(Se,Pe),Se[1]-=Pe>0?Jn:-Jn,Se):Te(Se,Pe)}uo.invert=function(Se,Pe){return o(Pe)>ho?ae.invert(Se,Pe+(Pe>0?Jn:-Jn)):Te.invert(Se,Pe)};function Qn(){return i.geoProjection(uo).scale(152.63)}function jo(Se,Pe,Ge,$e){var st=P(4*S/(2*Ge+(1+Se-Pe/2)*y(2*Ge)+(Se+Pe)/2*y(4*Ge)+Pe/2*y(6*Ge))),ot=P($e*y(Ge)*P((1+Se*n(2*Ge)+Pe*n(4*Ge))/(1+Se+Pe))),pt=Ge*tr(1);function Vt(pr){return P(1+Se*n(2*pr)+Pe*n(4*pr))}function tr(pr){var Sr=pr*Ge;return(2*Sr+(1+Se-Pe/2)*y(2*Sr)+(Se+Pe)/2*y(4*Sr)+Pe/2*y(6*Sr))/Ge}function Ut(pr){return Vt(pr)*y(pr)}var rr=function(pr,Sr){var Rr=Ge*le(tr,pt*y(Sr)/Ge,Sr/S);isNaN(Rr)&&(Rr=Ge*m(Sr));var Zr=st*Vt(Rr);return[Zr*ot*pr/S*n(Rr),Zr/ot*y(Rr)]};return rr.invert=function(pr,Sr){var Rr=le(Ut,Sr*ot/st);return[pr*S/(n(Rr)*st*ot*Vt(Rr)),D(Ge*tr(Rr/Ge)/pt)]},Ge===0&&(st=P($e/S),rr=function(pr,Sr){return[pr*st,y(Sr)/st]},rr.invert=function(pr,Sr){return[pr/st,D(Sr*st)]}),rr}function Yn(){var Se=1,Pe=0,Ge=45*T,$e=2,st=i.geoProjectionMutator(jo),ot=st(Se,Pe,Ge,$e);return ot.a=function(pt){return arguments.length?st(Se=+pt,Pe,Ge,$e):Se},ot.b=function(pt){return arguments.length?st(Se,Pe=+pt,Ge,$e):Pe},ot.psiMax=function(pt){return arguments.length?st(Se,Pe,Ge=+pt*T,$e):Ge*E},ot.ratio=function(pt){return arguments.length?st(Se,Pe,Ge,$e=+pt):$e},ot.scale(180.739)}function Bn(Se,Pe,Ge,$e,st,ot,pt,Vt,tr,Ut,rr){if(rr.nanEncountered)return NaN;var pr,Sr,Rr,Zr,wi,qi,Aa,un,gn,Tn;if(pr=Ge-Pe,Sr=Se(Pe+pr*.25),Rr=Se(Ge-pr*.25),isNaN(Sr)){rr.nanEncountered=!0;return}if(isNaN(Rr)){rr.nanEncountered=!0;return}return Zr=pr*($e+4*Sr+st)/12,wi=pr*(st+4*Rr+ot)/12,qi=Zr+wi,Tn=(qi-pt)/15,Ut>tr?(rr.maxDepthCount++,qi+Tn):Math.abs(Tn)>1;do tr[qi]>Rr?wi=qi:Zr=qi,qi=Zr+wi>>1;while(qi>Zr);var Aa=tr[qi+1]-tr[qi];return Aa&&(Aa=(Rr-tr[qi+1])/Aa),(qi+1+Aa)/pt}var pr=2*rr(1)/S*ot/Ge,Sr=function(Rr,Zr){var wi=rr(o(y(Zr))),qi=$e(wi)*Rr;return wi/=pr,[qi,Zr>=0?wi:-wi]};return Sr.invert=function(Rr,Zr){var wi;return Zr*=pr,o(Zr)<1&&(wi=m(Zr)*D(st(o(Zr))*ot)),[Rr/$e(o(Zr)),wi]},Sr}function no(){var Se=0,Pe=2.5,Ge=1.183136,$e=i.geoProjectionMutator(xo),st=$e(Se,Pe,Ge);return st.alpha=function(ot){return arguments.length?$e(Se=+ot,Pe,Ge):Se},st.k=function(ot){return arguments.length?$e(Se,Pe=+ot,Ge):Pe},st.gamma=function(ot){return arguments.length?$e(Se,Pe,Ge=+ot):Ge},st.scale(152.63)}function Mo(Se,Pe){return o(Se[0]-Pe[0])=0;--tr)Ge=Se[1][tr],$e=Ge[0][0],st=Ge[0][1],ot=Ge[1][1],pt=Ge[2][0],Vt=Ge[2][1],Pe.push(Vn([[pt-v,Vt-v],[pt-v,ot+v],[$e+v,ot+v],[$e+v,st-v]],30));return{type:"Polygon",coordinates:[a.merge(Pe)]}}function ws(Se,Pe,Ge){var $e,st;function ot(tr,Ut){for(var rr=Ut<0?-1:1,pr=Pe[+(Ut<0)],Sr=0,Rr=pr.length-1;Srpr[Sr][2][0];++Sr);var Zr=Se(tr-pr[Sr][1][0],Ut);return Zr[0]+=Se(pr[Sr][1][0],rr*Ut>rr*pr[Sr][0][1]?pr[Sr][0][1]:Ut)[0],Zr}Ge?ot.invert=Ge(ot):Se.invert&&(ot.invert=function(tr,Ut){for(var rr=st[+(Ut<0)],pr=Pe[+(Ut<0)],Sr=0,Rr=rr.length;SrZr&&(wi=Rr,Rr=Zr,Zr=wi),[[pr,Rr],[Sr,Zr]]})}),pt):Pe.map(function(Ut){return Ut.map(function(rr){return[[rr[0][0]*E,rr[0][1]*E],[rr[1][0]*E,rr[1][1]*E],[rr[2][0]*E,rr[2][1]*E]]})})},Pe!=null&&pt.lobes(Pe),pt}var So=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function nl(){return ws(ue,So).scale(160.857)}var vs=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function go(){return ws(uo,vs).scale(152.63)}var Xn=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function On(){return ws(ae,Xn).scale(169.529)}var Uo=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function kl(){return ws(ae,Uo).scale(169.529).rotate([20,0])}var mu=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Ul(){return ws(lo,mu,ce).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var gu=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function yu(){return ws(Te,gu).scale(152.63).rotate([-20,0])}function Fu(Se,Pe){return[3/b*Se*P(S*S/3-Pe*Pe),Pe]}Fu.invert=function(Se,Pe){return[b/3*Se/P(S*S/3-Pe*Pe),Pe]};function au(){return i.geoProjection(Fu).scale(158.837)}function xc(Se){function Pe(Ge,$e){if(o(o($e)-M)2)return null;Ge/=2,$e/=2;var ot=Ge*Ge,pt=$e*$e,Vt=2*$e/(1+ot+pt);return Vt=p((1+Vt)/(1-Vt),1/Se),[l(2*Ge,1-ot-pt)/Se,D((Vt-1)/(Vt+1))]},Pe}function Pu(){var Se=.5,Pe=i.geoProjectionMutator(xc),Ge=Pe(Se);return Ge.spacing=function($e){return arguments.length?Pe(Se=+$e):Se},Ge.scale(124.75)}var Cl=S/k;function bc(Se,Pe){return[Se*(1+P(n(Pe)))/2,Pe/(n(Pe/2)*n(Se/6))]}bc.invert=function(Se,Pe){var Ge=o(Se),$e=o(Pe),st=v,ot=M;$ev||o(qi)>v)&&--st>0);return st&&[Ge,$e]};function ms(){return i.geoProjection(_l).scale(139.98)}function ss(Se,Pe){return[y(Se)/n(Pe),_(Pe)*n(Se)]}ss.invert=function(Se,Pe){var Ge=Se*Se,$e=Pe*Pe,st=$e+1,ot=Ge+st,pt=Se?w*P((ot-P(ot*ot-4*Ge))/Ge):1/P(st);return[D(Se*pt),m(Pe)*R(pt)]};function fl(){return i.geoProjection(ss).scale(144.049).clipAngle(90-.001)}function wc(Se){var Pe=n(Se),Ge=_(C+Se/2);function $e(st,ot){var pt=ot-Se,Vt=o(pt)=0;)rr=Se[Ut],pr=rr[0]+Vt*(Rr=pr)-tr*Sr,Sr=rr[1]+Vt*Sr+tr*Rr;return pr=Vt*(Rr=pr)-tr*Sr,Sr=Vt*Sr+tr*Rr,[pr,Sr]}return Ge.invert=function($e,st){var ot=20,pt=$e,Vt=st;do{for(var tr=Pe,Ut=Se[tr],rr=Ut[0],pr=Ut[1],Sr=0,Rr=0,Zr;--tr>=0;)Ut=Se[tr],Sr=rr+pt*(Zr=Sr)-Vt*Rr,Rr=pr+pt*Rr+Vt*Zr,rr=Ut[0]+pt*(Zr=rr)-Vt*pr,pr=Ut[1]+pt*pr+Vt*Zr;Sr=rr+pt*(Zr=Sr)-Vt*Rr,Rr=pr+pt*Rr+Vt*Zr,rr=pt*(Zr=rr)-Vt*pr-$e,pr=pt*pr+Vt*Zr-st;var wi=Sr*Sr+Rr*Rr,qi,Aa;pt-=qi=(rr*Sr+pr*Rr)/wi,Vt-=Aa=(pr*Sr-rr*Rr)/wi}while(o(qi)+o(Aa)>v*v&&--ot>0);if(ot){var un=P(pt*pt+Vt*Vt),gn=2*s(un*.5),Tn=y(gn);return[l(pt*Tn,un*n(gn)),un?D(Vt*Tn/un):0]}},Ge}var Rd=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],fp=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ru=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Ts=[[.9245,0],[0,0],[.01943,0]],Ah=[[.721316,0],[0,0],[-.00881625,-.00617325]];function vf(){return zu(Rd,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Ac(){return zu(fp,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Mh(){return zu(Ru,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Mc(){return zu(Ts,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function $c(){return zu(Ah,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function zu(Se,Pe){var Ge=i.geoProjection(Th(Se)).rotate(Pe).clipAngle(90),$e=i.geoRotation(Pe),st=Ge.center;return delete Ge.rotate,Ge.center=function(ot){return arguments.length?st($e(ot)):$e.invert(st())},Ge}var mf=P(6),jf=P(7);function Sc(Se,Pe){var Ge=D(7*y(Pe)/(3*mf));return[mf*Se*(2*n(2*Ge/3)-1)/jf,9*y(Ge/3)/jf]}Sc.invert=function(Se,Pe){var Ge=3*D(Pe*jf/9);return[Se*jf/(mf*(2*n(2*Ge/3)-1)),D(y(Ge)*3*mf/7)]};function id(){return i.geoProjection(Sc).scale(164.859)}function Uf(Se,Pe){for(var Ge=(1+w)*y(Pe),$e=Pe,st=0,ot;st<25&&($e-=ot=(y($e/2)+y($e)-Ge)/(.5*n($e/2)+n($e)),!(o(ot)x&&--$e>0);return ot=Ge*Ge,pt=ot*ot,Vt=ot*pt,[Se/(.84719-.13063*ot+Vt*Vt*(-.04515+.05494*ot-.02326*pt+.00331*Vt)),Ge]};function qf(){return i.geoProjection(_u).scale(175.295)}function Dl(Se,Pe){return[Se*(1+n(Pe))/2,2*(Pe-_(Pe/2))]}Dl.invert=function(Se,Pe){for(var Ge=Pe/2,$e=0,st=1/0;$e<10&&o(st)>v;++$e){var ot=n(Pe/2);Pe-=st=(Pe-_(Pe/2)-Ge)/(1-.5/(ot*ot))}return[2*Se/(1+n(Pe)),Pe]};function gf(){return i.geoProjection(Dl).scale(152.63)}var Ou=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function yf(){return ws(te(1/0),Ou).rotate([20,0]).scale(152.63)}function _f(Se,Pe){var Ge=y(Pe),$e=n(Pe),st=m(Se);if(Se===0||o(Pe)===M)return[0,Pe];if(Pe===0)return[Se,0];if(o(Se)===M)return[Se*$e,M*Ge];var ot=S/(2*Se)-2*Se/S,pt=2*Pe/S,Vt=(1-pt*pt)/(Ge-pt),tr=ot*ot,Ut=Vt*Vt,rr=1+tr/Ut,pr=1+Ut/tr,Sr=(ot*Ge/Vt-ot/2)/rr,Rr=(Ut*Ge/tr+Vt/2)/pr,Zr=Sr*Sr+$e*$e/rr,wi=Rr*Rr-(Ut*Ge*Ge/tr+Vt*Ge-1)/pr;return[M*(Sr+P(Zr)*st),M*(Rr+P(wi<0?0:wi)*m(-Pe*ot)*st)]}_f.invert=function(Se,Pe){Se/=M,Pe/=M;var Ge=Se*Se,$e=Pe*Pe,st=Ge+$e,ot=S*S;return[Se?(st-1+P((1-st)*(1-st)+4*Ge))/(2*Se)*M:0,le(function(pt){return st*(S*y(pt)-2*pt)*S+4*pt*pt*(Pe-y(pt))+2*S*pt-ot*Pe},0)]};function Vf(){return i.geoProjection(_f).scale(127.267)}var Eh=1.0148,Ec=.23185,kh=-.14499,rc=.02406,Bd=Eh,xl=5*Ec,xu=7*kh,kc=9*rc,hl=1.790857183;function Gf(Se,Pe){var Ge=Pe*Pe;return[Se,Pe*(Eh+Ge*Ge*(Ec+Ge*(kh+rc*Ge)))]}Gf.invert=function(Se,Pe){Pe>hl?Pe=hl:Pe<-hl&&(Pe=-hl);var Ge=Pe,$e;do{var st=Ge*Ge;Ge-=$e=(Ge*(Eh+st*st*(Ec+st*(kh+rc*st)))-Pe)/(Bd+st*st*(xl+st*(xu+kc*st)))}while(o($e)>v);return[Se,Ge]};function Nu(){return i.geoProjection(Gf).scale(139.319)}function Cc(Se,Pe){if(o(Pe)v&&--st>0);return pt=_($e),[(o(Pe)=0;)if($e=Pe[Vt],Ge[0]===$e[0]&&Ge[1]===$e[1]){if(ot)return[ot,Ge];ot=Ge}}}function $f(Se){for(var Pe=Se.length,Ge=[],$e=Se[Pe-1],st=0;st0?[-$e[0],0]:[180-$e[0],180])};var Pe=Yc.map(function(Ge){return{face:Ge,project:Se(Ge)}});return[-1,0,0,1,0,1,4,5].forEach(function(Ge,$e){var st=Pe[Ge];st&&(st.children||(st.children=[])).push(Pe[$e])}),xf(Pe[0],function(Ge,$e){return Pe[Ge<-S/2?$e<0?6:4:Ge<0?$e<0?2:0:Ge$e^Rr>$e&&Ge<(Sr-Ut)*($e-rr)/(Rr-rr)+Ut&&(st=!st)}return st}function Ch(Se,Pe){var Ge=Pe.stream,$e;if(!Ge)throw new Error("invalid projection");switch(Se&&Se.type){case"Feature":$e=Zf;break;case"FeatureCollection":$e=Ud;break;default:$e=Dh;break}return $e(Se,Ge)}function Ud(Se,Pe){return{type:"FeatureCollection",features:Se.features.map(function(Ge){return Zf(Ge,Pe)})}}function Zf(Se,Pe){return{type:"Feature",id:Se.id,properties:Se.properties,geometry:Dh(Se.geometry,Pe)}}function ld(Se,Pe){return{type:"GeometryCollection",geometries:Se.geometries.map(function(Ge){return Dh(Ge,Pe)})}}function Dh(Se,Pe){if(!Se)return null;if(Se.type==="GeometryCollection")return ld(Se,Pe);var Ge;switch(Se.type){case"Point":Ge=Kf;break;case"MultiPoint":Ge=Kf;break;case"LineString":Ge=Lh;break;case"MultiLineString":Ge=Lh;break;case"Polygon":Ge=Jf;break;case"MultiPolygon":Ge=Jf;break;case"Sphere":Ge=Jf;break;default:return null}return i.geoStream(Se,Pe(Ge)),Ge.result()}var Js=[],ou=[],Kf={point:function(Se,Pe){Js.push([Se,Pe])},result:function(){var Se=Js.length?Js.length<2?{type:"Point",coordinates:Js[0]}:{type:"MultiPoint",coordinates:Js}:null;return Js=[],Se}},Lh={lineStart:Tf,point:function(Se,Pe){Js.push([Se,Pe])},lineEnd:function(){Js.length&&(ou.push(Js),Js=[])},result:function(){var Se=ou.length?ou.length<2?{type:"LineString",coordinates:ou[0]}:{type:"MultiLineString",coordinates:ou}:null;return ou=[],Se}},Jf={polygonStart:Tf,lineStart:Tf,point:function(Se,Pe){Js.push([Se,Pe])},lineEnd:function(){var Se=Js.length;if(Se){do Js.push(Js[0].slice());while(++Se<4);ou.push(Js),Js=[]}},polygonEnd:Tf,result:function(){if(!ou.length)return null;var Se=[],Pe=[];return ou.forEach(function(Ge){Xf(Ge)?Se.push([Ge]):Pe.push(Ge)}),Pe.forEach(function(Ge){var $e=Ge[0];Se.some(function(st){if(sd(st[0],$e))return st.push(Ge),!0})||Se.push([Ge])}),ou=[],Se.length?Se.length>1?{type:"MultiPolygon",coordinates:Se}:{type:"Polygon",coordinates:Se[0]}:null}};function Af(Se){var Pe=Se(M,0)[0]-Se(-M,0)[0];function Ge($e,st){var ot=o($e)0?$e-S:$e+S,st),Vt=(pt[0]-pt[1])*w,tr=(pt[0]+pt[1])*w;if(ot)return[Vt,tr];var Ut=Pe*w,rr=Vt>0^tr>0?-1:1;return[rr*Vt-m(tr)*Ut,rr*tr-m(Vt)*Ut]}return Se.invert&&(Ge.invert=function($e,st){var ot=($e+st)*w,pt=(st-$e)*w,Vt=o(ot)<.5*Pe&&o(pt)<.5*Pe;if(!Vt){var tr=Pe*w,Ut=ot>0^pt>0?-1:1,rr=-Ut*$e+(pt>0?1:-1)*tr,pr=-Ut*st+(ot>0?1:-1)*tr;ot=(-rr-pr)*w,pt=(rr-pr)*w}var Sr=Se.invert(ot,pt);return Vt||(Sr[0]+=ot>0?S:-S),Sr}),i.geoProjection(Ge).rotate([-90,-90,45]).clipAngle(180-.001)}function nt(){return Af(qt).scale(176.423)}function Tt(){return Af(Za).scale(111.48)}function Kt(Se,Pe){if(!(0<=(Pe=+Pe)&&Pe<=20))throw new Error("invalid digits");function Ge(Ut){var rr=Ut.length,pr=2,Sr=new Array(rr);for(Sr[0]=+Ut[0].toFixed(Pe),Sr[1]=+Ut[1].toFixed(Pe);pr2||Rr[0]!=rr[0]||Rr[1]!=rr[1])&&(pr.push(Rr),rr=Rr)}return pr.length===1&&Ut.length>1&&pr.push(Ge(Ut[Ut.length-1])),pr}function ot(Ut){return Ut.map(st)}function pt(Ut){if(Ut==null)return Ut;var rr;switch(Ut.type){case"GeometryCollection":rr={type:"GeometryCollection",geometries:Ut.geometries.map(pt)};break;case"Point":rr={type:"Point",coordinates:Ge(Ut.coordinates)};break;case"MultiPoint":rr={type:Ut.type,coordinates:$e(Ut.coordinates)};break;case"LineString":rr={type:Ut.type,coordinates:st(Ut.coordinates)};break;case"MultiLineString":case"Polygon":rr={type:Ut.type,coordinates:ot(Ut.coordinates)};break;case"MultiPolygon":rr={type:"MultiPolygon",coordinates:Ut.coordinates.map(ot)};break;default:return Ut}return Ut.bbox!=null&&(rr.bbox=Ut.bbox),rr}function Vt(Ut){var rr={type:"Feature",properties:Ut.properties,geometry:pt(Ut.geometry)};return Ut.id!=null&&(rr.id=Ut.id),Ut.bbox!=null&&(rr.bbox=Ut.bbox),rr}if(Se!=null)switch(Se.type){case"Feature":return Vt(Se);case"FeatureCollection":{var tr={type:"FeatureCollection",features:Se.features.map(Vt)};return Se.bbox!=null&&(tr.bbox=Se.bbox),tr}default:return pt(Se)}return Se}function Bt(Se){var Pe=y(Se);function Ge($e,st){var ot=Pe?_($e*Pe/2)/Pe:$e/2;if(!st)return[2*ot,-Se];var pt=2*s(ot*y(st)),Vt=1/_(st);return[y(pt)*Vt,st+(1-n(pt))*Vt-Se]}return Ge.invert=function($e,st){if(o(st+=Se)v&&--Vt>0);var Sr=$e*(Ut=_(pt)),Rr=_(o(st)0?M:-M)*(tr+st*(rr-pt)/2+st*st*(rr-2*tr+pt)/2)]}Gr.invert=function(Se,Pe){var Ge=Pe/M,$e=Ge*90,st=d(18,o($e/5)),ot=h(0,c(st));do{var pt=zr[ot][1],Vt=zr[ot+1][1],tr=zr[d(19,ot+2)][1],Ut=tr-pt,rr=tr-2*Vt+pt,pr=2*(o(Ge)-Vt)/Ut,Sr=rr/Ut,Rr=pr*(1-Sr*pr*(1-2*Sr*pr));if(Rr>=0||ot===1){$e=(Pe>=0?5:-5)*(Rr+st);var Zr=50,wi;do st=d(18,o($e)/5),ot=c(st),Rr=st-ot,pt=zr[ot][1],Vt=zr[ot+1][1],tr=zr[d(19,ot+2)][1],$e-=(wi=(Pe>=0?M:-M)*(Vt+Rr*(tr-pt)/2+Rr*Rr*(tr-2*Vt+pt)/2)-Pe)*E;while(o(wi)>x&&--Zr>0);break}}while(--ot>=0);var qi=zr[ot][0],Aa=zr[ot+1][0],un=zr[d(19,ot+2)][0];return[Se/(Aa+Rr*(un-qi)/2+Rr*Rr*(un-2*Aa+qi)/2),$e*T]};function ii(){return i.geoProjection(Gr).scale(152.63)}function li(Se){function Pe(Ge,$e){var st=n($e),ot=(Se-1)/(Se-st*n(Ge));return[ot*st*y(Ge),ot*y($e)]}return Pe.invert=function(Ge,$e){var st=Ge*Ge+$e*$e,ot=P(st),pt=(Se-P(1-st*(Se+1)/(Se-1)))/((Se-1)/ot+ot/(Se-1));return[l(Ge*pt,ot*P(1-pt*pt)),ot?D($e*pt/ot):0]},Pe}function Fi(Se,Pe){var Ge=li(Se);if(!Pe)return Ge;var $e=n(Pe),st=y(Pe);function ot(pt,Vt){var tr=Ge(pt,Vt),Ut=tr[1],rr=Ut*st/(Se-1)+$e;return[tr[0]*$e/rr,Ut/rr]}return ot.invert=function(pt,Vt){var tr=(Se-1)/(Se-1-Vt*st);return Ge.invert(tr*pt,tr*Vt*$e)},ot}function $r(){var Se=2,Pe=0,Ge=i.geoProjectionMutator(Fi),$e=Ge(Se,Pe);return $e.distance=function(st){return arguments.length?Ge(Se=+st,Pe):Se},$e.tilt=function(st){return arguments.length?Ge(Se,Pe=st*T):Pe*E},$e.scale(432.147).clipAngle(R(1/Se)*E-1e-6)}var ni=1e-4,ui=1e4,Di=-180,Wi=Di+ni,Oa=180,Pa=Oa-ni,Ja=-90,rn=Ja+ni,Zi=90,sa=Zi-ni;function vn(Se){return Se.length>0}function Dn(Se){return Math.floor(Se*ui)/ui}function po(Se){return Se===Ja||Se===Zi?[0,Se]:[Di,Dn(Se)]}function zo(Se){var Pe=Se[0],Ge=Se[1],$e=!1;return Pe<=Wi?(Pe=Di,$e=!0):Pe>=Pa&&(Pe=Oa,$e=!0),Ge<=rn?(Ge=Ja,$e=!0):Ge>=sa&&(Ge=Zi,$e=!0),$e?[Pe,Ge]:Se}function wo(Se){return Se.map(zo)}function $o(Se,Pe,Ge){for(var $e=0,st=Se.length;$e=Pa||rr<=rn||rr>=sa){ot[pt]=zo(tr);for(var pr=pt+1;prWi&&Rrrn&&Zr=Vt)break;Ge.push({index:-1,polygon:Pe,ring:ot=ot.slice(pr-1)}),ot[0]=po(ot[0][1]),pt=-1,Vt=ot.length}}}}function io(Se){var Pe,Ge=Se.length,$e={},st={},ot,pt,Vt,tr,Ut;for(Pe=0;Pe0?S-Vt:Vt)*E],Ut=i.geoProjection(Se(pt)).rotate(tr),rr=i.geoRotation(tr),pr=Ut.center;return delete Ut.rotate,Ut.center=function(Sr){return arguments.length?pr(rr(Sr)):rr.invert(pr())},Ut.clipAngle(90)}function qs(Se){var Pe=n(Se);function Ge($e,st){var ot=i.geoGnomonicRaw($e,st);return ot[0]*=Pe,ot}return Ge.invert=function($e,st){return i.geoGnomonicRaw.invert($e/Pe,st)},Ge}function Ll(){return bu([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function bu(Se,Pe){return Ds(qs,Se,Pe)}function Gl(Se){if(!(Se*=2))return i.geoAzimuthalEquidistantRaw;var Pe=-Se/2,Ge=-Pe,$e=Se*Se,st=_(Ge),ot=.5/y(Ge);function pt(Vt,tr){var Ut=R(n(tr)*n(Vt-Pe)),rr=R(n(tr)*n(Vt-Ge)),pr=tr<0?-1:1;return Ut*=Ut,rr*=rr,[(Ut-rr)/(2*Se),pr*P(4*$e*rr-($e-Ut+rr)*($e-Ut+rr))/(2*Se)]}return pt.invert=function(Vt,tr){var Ut=tr*tr,rr=n(P(Ut+(Sr=Vt+Pe)*Sr)),pr=n(P(Ut+(Sr=Vt+Ge)*Sr)),Sr,Rr;return[l(Rr=rr-pr,Sr=(rr+pr)*st),(tr<0?-1:1)*R(P(Sr*Sr+Rr*Rr)*ot)]},pt}function ac(){return bl([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function bl(Se,Pe){return Ds(Gl,Se,Pe)}function Uu(Se,Pe){if(o(Pe)v&&--Vt>0);return[m(Se)*(P(st*st+4)+st)*S/4,M*pt]};function Hl(){return i.geoProjection(Fh).scale(127.16)}function Vd(Se,Pe,Ge,$e,st){function ot(pt,Vt){var tr=Ge*y($e*Vt),Ut=P(1-tr*tr),rr=P(2/(1+Ut*n(pt*=st)));return[Se*Ut*rr*y(pt),Pe*tr*rr]}return ot.invert=function(pt,Vt){var tr=pt/Se,Ut=Vt/Pe,rr=P(tr*tr+Ut*Ut),pr=2*D(rr/2);return[l(pt*_(pr),Se*rr)/st,rr&&D(Vt*y(pr)/(Pe*Ge*rr))/$e]},ot}function Mf(Se,Pe,Ge,$e){var st=S/3;Se=h(Se,v),Pe=h(Pe,v),Se=d(Se,M),Pe=d(Pe,S-v),Ge=h(Ge,0),Ge=d(Ge,100-v),$e=h($e,v);var ot=Ge/100+1,pt=$e/100,Vt=R(ot*n(st))/st,tr=y(Se)/y(Vt*M),Ut=Pe/S,rr=P(pt*y(Se/2)/y(Pe/2)),pr=rr/P(Ut*tr*Vt),Sr=1/(rr*P(Ut*tr*Vt));return Vd(pr,Sr,tr,Vt,Ut)}function Ph(){var Se=65*T,Pe=60*T,Ge=20,$e=200,st=i.geoProjectionMutator(Mf),ot=st(Se,Pe,Ge,$e);return ot.poleline=function(pt){return arguments.length?st(Se=+pt*T,Pe,Ge,$e):Se*E},ot.parallels=function(pt){return arguments.length?st(Se,Pe=+pt*T,Ge,$e):Pe*E},ot.inflation=function(pt){return arguments.length?st(Se,Pe,Ge=+pt,$e):Ge},ot.ratio=function(pt){return arguments.length?st(Se,Pe,Ge,$e=+pt):$e},ot.scale(163.775)}function Ih(){return Ph().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var qu=4*S+3*P(3),cd=2*P(2*S*P(3)/qu),Jc=fe(cd*P(3)/S,cd,qu/6);function eh(){return i.geoProjection(Jc).scale(176.84)}function Qc(Se,Pe){return[Se*P(1-3*Pe*Pe/(S*S)),Pe]}Qc.invert=function(Se,Pe){return[Se/P(1-3*Pe*Pe/(S*S)),Pe]};function wu(){return i.geoProjection(Qc).scale(152.63)}function ef(Se,Pe){var Ge=n(Pe),$e=n(Se)*Ge,st=1-$e,ot=n(Se=l(y(Se)*Ge,-y(Pe))),pt=y(Se);return Ge=P(1-$e*$e),[pt*Ge-ot*st,-ot*Ge-pt*st]}ef.invert=function(Se,Pe){var Ge=(Se*Se+Pe*Pe)/-2,$e=P(-Ge*(2+Ge)),st=Pe*Ge+Se*$e,ot=Se*Ge-Pe*$e,pt=P(ot*ot+st*st);return[l($e*st,pt*(1+Ge)),pt?-D($e*ot/pt):0]};function Sf(){return i.geoProjection(ef).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function fd(Se,Pe){var Ge=X(Se,Pe);return[(Ge[0]+Se/M)/2,(Ge[1]+Pe)/2]}fd.invert=function(Se,Pe){var Ge=Se,$e=Pe,st=25;do{var ot=n($e),pt=y($e),Vt=y(2*$e),tr=pt*pt,Ut=ot*ot,rr=y(Ge),pr=n(Ge/2),Sr=y(Ge/2),Rr=Sr*Sr,Zr=1-Ut*pr*pr,wi=Zr?R(ot*pr)*P(qi=1/Zr):qi=0,qi,Aa=.5*(2*wi*ot*Sr+Ge/M)-Se,un=.5*(wi*pt+$e)-Pe,gn=.5*qi*(Ut*Rr+wi*ot*pr*tr)+.5/M,Tn=qi*(rr*Vt/4-wi*pt*Sr),Pn=.125*qi*(Vt*Sr-wi*pt*Ut*rr),Eo=.5*qi*(tr*pr+wi*Rr*ot)+.5,qo=Tn*Pn-Eo*gn,Wn=(un*Tn-Aa*Eo)/qo,ls=(Aa*Pn-un*gn)/qo;Ge-=Wn,$e-=ls}while((o(Wn)>v||o(ls)>v)&&--st>0);return[Ge,$e]};function $l(){return i.geoProjection(fd).scale(158.837)}t.geoNaturalEarth=i.geoNaturalEarth1,t.geoNaturalEarthRaw=i.geoNaturalEarth1Raw,t.geoAiry=W,t.geoAiryRaw=G,t.geoAitoff=Z,t.geoAitoffRaw=X,t.geoArmadillo=N,t.geoArmadilloRaw=J,t.geoAugust=$,t.geoAugustRaw=H,t.geoBaker=q,t.geoBakerRaw=j,t.geoBerghaus=K,t.geoBerghausRaw=Y,t.geoBertin1953=xe,t.geoBertin1953Raw=pe,t.geoBoggs=ge,t.geoBoggsRaw=ue,t.geoBonne=Ze,t.geoBonneRaw=Ve,t.geoBottomley=vt,t.geoBottomleyRaw=Ke,t.geoBromley=Pt,t.geoBromleyRaw=xt,t.geoChamberlin=_e,t.geoChamberlinRaw=qe,t.geoChamberlinAfrica=me,t.geoCollignon=ke,t.geoCollignonRaw=Ae,t.geoCraig=De,t.geoCraigRaw=Ee,t.geoCraster=at,t.geoCrasterRaw=Ue,t.geoCylindricalEqualArea=ft,t.geoCylindricalEqualAreaRaw=rt,t.geoCylindricalStereographic=ht,t.geoCylindricalStereographicRaw=At,t.geoEckert1=fr,t.geoEckert1Raw=Gt,t.geoEckert2=yt,t.geoEckert2Raw=gt,t.geoEckert3=Lt,t.geoEckert3Raw=kt,t.geoEckert4=$t,t.geoEckert4Raw=Ct,t.geoEckert5=br,t.geoEckert5Raw=mr,t.geoEckert6=Tr,t.geoEckert6Raw=Er,t.geoEisenlohr=oi,t.geoEisenlohrRaw=Ai,t.geoFahey=$i,t.geoFaheyRaw=ea,t.geoFoucaut=ya,t.geoFoucautRaw=ja,t.geoFoucautSinusoidal=xi,t.geoFoucautSinusoidalRaw=pa,t.geoGilbert=dn,t.geoGingery=Fe,t.geoGingeryRaw=pi,t.geoGinzburg4=zt,t.geoGinzburg4Raw=St,t.geoGinzburg5=Yt,t.geoGinzburg5Raw=Wt,t.geoGinzburg6=tt,t.geoGinzburg6Raw=ze,t.geoGinzburg8=wt,t.geoGinzburg8Raw=ct,t.geoGinzburg9=It,t.geoGinzburg9Raw=Nt,t.geoGringorten=Pr,t.geoGringortenRaw=qt,t.geoGuyou=_n,t.geoGuyouRaw=Za,t.geoHammer=se,t.geoHammerRaw=te,t.geoHammerRetroazimuthal=pn,t.geoHammerRetroazimuthalRaw=Li,t.geoHealpix=ln,t.geoHealpixRaw=Mn,t.geoHill=ao,t.geoHillRaw=on,t.geoHomolosine=Qn,t.geoHomolosineRaw=uo,t.geoHufnagel=Yn,t.geoHufnagelRaw=jo,t.geoHyperelliptical=no,t.geoHyperellipticalRaw=xo,t.geoInterrupt=ws,t.geoInterruptedBoggs=nl,t.geoInterruptedHomolosine=go,t.geoInterruptedMollweide=On,t.geoInterruptedMollweideHemispheres=kl,t.geoInterruptedSinuMollweide=Ul,t.geoInterruptedSinusoidal=yu,t.geoKavrayskiy7=au,t.geoKavrayskiy7Raw=Fu,t.geoLagrange=Pu,t.geoLagrangeRaw=xc,t.geoLarrivee=Iu,t.geoLarriveeRaw=bc,t.geoLaskowski=ms,t.geoLaskowskiRaw=_l,t.geoLittrow=fl,t.geoLittrowRaw=ss,t.geoLoximuthal=Tc,t.geoLoximuthalRaw=wc,t.geoMiller=wh,t.geoMillerRaw=tc,t.geoModifiedStereographic=zu,t.geoModifiedStereographicRaw=Th,t.geoModifiedStereographicAlaska=vf,t.geoModifiedStereographicGs48=Ac,t.geoModifiedStereographicGs50=Mh,t.geoModifiedStereographicMiller=Mc,t.geoModifiedStereographicLee=$c,t.geoMollweide=ee,t.geoMollweideRaw=ae,t.geoMtFlatPolarParabolic=id,t.geoMtFlatPolarParabolicRaw=Sc,t.geoMtFlatPolarQuartic=zd,t.geoMtFlatPolarQuarticRaw=Uf,t.geoMtFlatPolarSinusoidal=Sh,t.geoMtFlatPolarSinusoidalRaw=Bu,t.geoNaturalEarth2=qf,t.geoNaturalEarth2Raw=_u,t.geoNellHammer=gf,t.geoNellHammerRaw=Dl,t.geoInterruptedQuarticAuthalic=yf,t.geoNicolosi=Vf,t.geoNicolosiRaw=_f,t.geoPatterson=Nu,t.geoPattersonRaw=Gf,t.geoPolyconic=Hf,t.geoPolyconicRaw=Cc,t.geoPolyhedral=xf,t.geoPolyhedralButterfly=Dc,t.geoPolyhedralCollignon=od,t.geoPolyhedralWaterman=Wf,t.geoProject=Ch,t.geoGringortenQuincuncial=nt,t.geoPeirceQuincuncial=Tt,t.geoPierceQuincuncial=Tt,t.geoQuantize=Kt,t.geoQuincuncial=Af,t.geoRectangularPolyconic=yr,t.geoRectangularPolyconicRaw=Bt,t.geoRobinson=ii,t.geoRobinsonRaw=Gr,t.geoSatellite=$r,t.geoSatelliteRaw=Fi,t.geoSinuMollweide=Fo,t.geoSinuMollweideRaw=lo,t.geoSinusoidal=je,t.geoSinusoidalRaw=Te,t.geoStitch=Go,t.geoTimes=vo,t.geoTimesRaw=ma,t.geoTwoPointAzimuthal=bu,t.geoTwoPointAzimuthalRaw=qs,t.geoTwoPointAzimuthalUsa=Ll,t.geoTwoPointEquidistant=bl,t.geoTwoPointEquidistantRaw=Gl,t.geoTwoPointEquidistantUsa=ac,t.geoVanDerGrinten=Fc,t.geoVanDerGrintenRaw=Uu,t.geoVanDerGrinten2=ud,t.geoVanDerGrinten2Raw=Kc,t.geoVanDerGrinten3=qd,t.geoVanDerGrinten3Raw=Qf,t.geoVanDerGrinten4=Hl,t.geoVanDerGrinten4Raw=Fh,t.geoWagner=Ph,t.geoWagner7=Ih,t.geoWagnerRaw=Mf,t.geoWagner4=eh,t.geoWagner4Raw=Jc,t.geoWagner6=wu,t.geoWagner6Raw=Qc,t.geoWiechel=Sf,t.geoWiechelRaw=ef,t.geoWinkel3=$l,t.geoWinkel3Raw=fd,Object.defineProperty(t,"__esModule",{value:!0})}))}}),JY=de({"src/plots/geo/zoom.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=Ma(),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},n={cursor:"auto"};function u(E,T){var F=E.projection,D;return T._isScoped?D=h:T._isClipped?D=p:D=d,D(E,F)}r.exports=u;function c(E,T){return t.behavior.zoom().translate(T.translate()).scaleExtent(T.scaleExtent()).scale(T.scale())}function f(E,T,F){var D=E.id,R=E.graphDiv,P=R.layout,z=P[D],I=R._fullLayout,L=I[D],B={},O={};function G(W,X){B[D+"."+W]=i.nestedProperty(z,W).get(),a.call("_storeDirectGUIEdit",P,I._preGUI,B);var Z=i.nestedProperty(L,W);Z.get()!==X&&(Z.set(X),i.nestedProperty(z,W).set(X),O[D+"."+W]=X)}F(G),G("projection.scale",T.scale()/E.fitScale),G("fitbounds",!1),R.emit("plotly_relayout",O)}function h(E,T){var F=c(E,T);function D(){t.select(this).style(l)}function R(){T.scale(t.event.scale).translate(t.event.translate),E.render(!0);var I=T.invert(E.midPt);E.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/E.fitScale,"geo.center.lon":I[0],"geo.center.lat":I[1]})}function P(I){var L=T.invert(E.midPt);I("center.lon",L[0]),I("center.lat",L[1])}function z(){t.select(this).style(n),f(E,T,P)}return F.on("zoomstart",D).on("zoom",R).on("zoomend",z),F}function d(E,T){var F=c(E,T),D=2,R,P,z,I,L,B,O,G,W;function X(U){return T.invert(U)}function Z(U){var V=X(U);if(!V)return!0;var j=T(V);return Math.abs(j[0]-U[0])>D||Math.abs(j[1]-U[1])>D}function J(){t.select(this).style(l);let{x:U,y:V,width:j,height:q}=this.getBBox();R=t.event.sourceEvent?t.mouse(this):[U+j/2,V+q/2],P=T.rotate(),z=T.translate(),I=P,L=X(R)}function N(){let{x:U,y:V,width:j,height:q}=this.getBBox();if(B=t.event.sourceEvent?t.mouse(this):[U+j/2,V+q/2],Z(R)){F.scale(T.scale()),F.translate(T.translate());return}T.scale(t.event.scale),T.translate([z[0],t.event.translate[1]]),L?X(B)&&(G=X(B),O=[I[0]+(G[0]-L[0]),P[1],P[2]],T.rotate(O),I=O):(R=B,L=X(R)),W=!0,E.render(!0);var Y=T.rotate(),K=T.invert(E.midPt);E.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/E.fitScale,"geo.center.lon":K[0],"geo.center.lat":K[1],"geo.projection.rotation.lon":-Y[0]})}function H(){t.select(this).style(n),W&&f(E,T,$)}function $(U){var V=T.rotate(),j=T.invert(E.midPt);U("projection.rotation.lon",-V[0]),U("center.lon",j[0]),U("center.lat",j[1])}return F.on("zoomstart",J).on("zoom",N).on("zoomend",H),F}function p(E,T){var F={r:T.rotate(),k:T.scale()},D=c(E,T),R=b(D,"zoomstart","zoom","zoomend"),P=0,z=D.on,I;D.on("zoomstart",function(){t.select(this).style(l);let{x:W,y:X,width:Z,height:J}=this.getBBox(),N=t.event.sourceEvent?t.mouse(this):[W+Z/2,X+J/2],H=T.rotate(),$=H,U=T.translate(),V=m(H);I=g(T,N),z.call(D,"zoom",function(){let{x:j,y:q,width:Y,height:K}=this.getBBox(),te=t.event.sourceEvent?t.mouse(this):[j+Y/2,q+K/2];if(T.scale(F.k=t.event.scale),!I)N=te,I=g(T,N);else if(g(T,te)){T.rotate(H).translate(U);var ne=g(T,te),se=_(I,ne),le=C(y(V,se)),ce=F.r=v(le,I,$);(!isFinite(ce[0])||!isFinite(ce[1])||!isFinite(ce[2]))&&(ce=$),T.rotate(ce),$=ce}B(R.of(this,arguments))}),L(R.of(this,arguments))}).on("zoomend",function(){t.select(this).style(n),z.call(D,"zoom",null),O(R.of(this,arguments)),f(E,T,G)}).on("zoom.redraw",function(){E.render(!0);var W=T.rotate();E.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/E.fitScale,"geo.projection.rotation.lon":-W[0],"geo.projection.rotation.lat":-W[1]})});function L(W){P++||W({type:"zoomstart"})}function B(W){W({type:"zoom"})}function O(W){--P||W({type:"zoomend"})}function G(W){var X=T.rotate();W("projection.rotation.lon",-X[0]),W("projection.rotation.lat",-X[1])}return t.rebind(D,R,"on")}function g(E,T){var F=E.invert(T);return F&&isFinite(F[0])&&isFinite(F[1])&&w(F)}function m(E){var T=.5*E[0]*o,F=.5*E[1]*o,D=.5*E[2]*o,R=Math.sin(T),P=Math.cos(T),z=Math.sin(F),I=Math.cos(F),L=Math.sin(D),B=Math.cos(D);return[P*I*B+R*z*L,R*I*B-P*z*L,P*z*B+R*I*L,P*I*L-R*z*B]}function y(E,T){var F=E[0],D=E[1],R=E[2],P=E[3],z=T[0],I=T[1],L=T[2],B=T[3];return[F*z-D*I-R*L-P*B,F*I+D*z+R*B-P*L,F*L-D*B+R*z+P*I,F*B+D*L-R*I+P*z]}function _(E,T){if(!(!E||!T)){var F=A(E,T),D=Math.sqrt(k(F,F)),R=.5*Math.acos(Math.max(-1,Math.min(1,k(E,T)))),P=Math.sin(R)/D;return D&&[Math.cos(R),F[2]*P,-F[1]*P,F[0]*P]}}function v(E,T,F){var D=M(T,2,E[0]);D=M(D,1,E[1]),D=M(D,0,E[2]-F[2]);var R=T[0],P=T[1],z=T[2],I=D[0],L=D[1],B=D[2],O=Math.atan2(P,R)*s,G=Math.sqrt(R*R+P*P),W,X;Math.abs(L)>G?(X=(L>0?90:-90)-O,W=0):(X=Math.asin(L/G)*s-O,W=Math.sqrt(G*G-L*L));var Z=180-X-2*O,J=(Math.atan2(B,I)-Math.atan2(z,W))*s,N=(Math.atan2(B,I)-Math.atan2(z,-W))*s,H=x(F[0],F[1],X,J),$=x(F[0],F[1],Z,N);return H<=$?[X,J,F[2]]:[Z,N,F[2]]}function x(E,T,F,D){var R=S(F-E),P=S(D-T);return Math.sqrt(R*R+P*P)}function S(E){return(E%360+540)%360-180}function M(E,T,F){var D=F*o,R=E.slice(),P=T===0?1:0,z=T===2?1:2,I=Math.cos(D),L=Math.sin(D);return R[P]=E[P]*I-E[z]*L,R[z]=E[z]*I+E[P]*L,R}function C(E){return[Math.atan2(2*(E[0]*E[1]+E[2]*E[3]),1-2*(E[1]*E[1]+E[2]*E[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(E[0]*E[2]-E[3]*E[1]))))*s,Math.atan2(2*(E[0]*E[3]+E[1]*E[2]),1-2*(E[2]*E[2]+E[3]*E[3]))*s]}function w(E){var T=E[0]*o,F=E[1]*o,D=Math.cos(F);return[D*Math.cos(T),D*Math.sin(T),Math.sin(F)]}function k(E,T){for(var F=0,D=0,R=E.length;D0&&G._module.calcGeoJSON(O,z)}if(!I){var W=this.updateProjection(P,z);if(W)return;(!this.viewInitial||this.scope!==L.scope)&&this.saveViewInitial(L)}this.scope=L.scope,this.updateBaseLayers(z,L),this.updateDims(z,L),this.updateFx(z,L),d.generalUpdatePerTraceModule(this.graphDiv,this,P,L);var X=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=X.selectAll(".point"),this.dataPoints.text=X.selectAll("text"),this.dataPaths.line=X.selectAll(".js-line");var Z=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=Z.selectAll("path"),this._render()},T.updateProjection=function(P,z){var I=this.graphDiv,L=z[this.id],B=z._size,O=L.domain,G=L.projection,W=L.lonaxis,X=L.lataxis,Z=W._ax,J=X._ax,N=this.projection=F(L),H=[[B.l+B.w*O.x[0],B.t+B.h*(1-O.y[1])],[B.l+B.w*O.x[1],B.t+B.h*(1-O.y[0])]],$=L.center||{},U=G.rotation||{},V=W.range||[],j=X.range||[];if(L.fitbounds){Z._length=H[1][0]-H[0][0],J._length=H[1][1]-H[0][1],Z.range=m(I,Z),J.range=m(I,J);let ie=[];for(let vt of P){let xt=vt[0].trace;xt.visible===!0&&xt._module.fitCoords&&ie.push(xt._module.fitCoords(vt,L))}let Q=g(I,Z),ue=Q.min.reduce((vt,{val:xt})=>Math.min(vt,xt),1/0),Me=Q.max.reduce((vt,{val:xt})=>Math.max(vt,xt),-1/0)-ue,Te=w.boundsOfCoords(ie.flat()),[je,,Ve]=Te||[],Ze=Ve-je;if(!!Te&&(Me>360||Me<360&&ZeMath.max(Ye,vt(me)),0),mt=Q.max.reduce((Ye,me)=>Math.max(Ye,xt(me)),0),Mt=Z._length-Pt-mt,lt=Mt>Z._length/10?Ze*Z._length/Mt:Ze,qe=(je+Ve)/2;Z.range=[qe-lt/2,qe+lt/2]}var q=(Z.range[0]+Z.range[1])/2,Y=(J.range[0]+J.range[1])/2;if(L._isScoped)$={lon:q,lat:Y};else if(L._isClipped){$={lon:q,lat:Y},U={lon:q,lat:Y,roll:U.roll};var K=G.type,te=C.lonaxisSpan[K]/2||180,ne=C.lataxisSpan[K]/2||90;V=[q-te,q+te],j=[Y-ne,Y+ne]}else $={lon:q,lat:Y},U={lon:q,lat:U.lat,roll:U.roll}}N.center([$.lon-U.lon,$.lat-U.lat]).rotate([-U.lon,-U.lat,U.roll]).parallels(G.parallels);var se=R(V,j);N.fitExtent(H,se);var le=this.bounds=N.getBounds(se),ce=this.fitScale=N.scale(),pe=N.translate();if(N.scaleExtent=()=>{var ie;let{minscale:Q}=G,ue=(ie=G.maxscale)!=null?ie:1/0;return[ce*Math.min(Q,ue),ce*Math.max(Q,ue)]},L.fitbounds){var xe=N.getBounds(R(Z.range,J.range)),ye=Math.min((le[1][0]-le[0][0])/(xe[1][0]-xe[0][0]),(le[1][1]-le[0][1])/(xe[1][1]-xe[0][1]));isFinite(ye)?N.scale(ye*ce):n.warn("Something went wrong during"+this.id+"fitbounds computations.")}else N.scale(G.scale*ce);var fe=this.midPt=[(le[0][0]+le[1][0])/2,(le[0][1]+le[1][1])/2];if(N.translate([pe[0]+(fe[0]-pe[0]),pe[1]+(fe[1]-pe[1])]).clipExtent(le),L._isAlbersUsa){var ae=N([$.lon,$.lat]);if(ae){var ee=N.translate();N.translate([ee[0]-(ae[0]-ee[0]),ee[1]-(ae[1]-ee[1])])}}},T.updateBaseLayers=function(P,z){var I=this,L=I.topojson,B=I.layers,O=I.basePaths;function G(H){return H==="lonaxis"||H==="lataxis"}function W(H){return!!C.lineLayers[H]}function X(H){return!!C.fillLayers[H]}var Z=this.hasChoropleth?C.layersForChoropleth:C.layers,J=Z.filter(function(H){return W(H)||X(H)?z["show"+H]:G(H)?z[H].showgrid:!0}),N=I.framework.selectAll(".layer").data(J,String);N.exit().each(function(H){delete B[H],delete O[H],t.select(this).remove()}),N.enter().append("g").attr("class",function(H){return"layer "+H}).each(function(H){var $=B[H]=t.select(this);H==="bg"?I.bgRect=$.append("rect").style("pointer-events","all"):G(H)?O[H]=$.append("path").style("fill","none"):H==="backplot"?$.append("g").classed("choroplethlayer",!0):H==="frontplot"?$.append("g").classed("scatterlayer",!0):W(H)?O[H]=$.append("path").style("fill","none").style("stroke-miterlimit",2):X(H)&&(O[H]=$.append("path").style("stroke","none"))}),N.order(),N.each(function(H){var $=O[H],U=C.layerNameToAdjective[H];H==="frame"?$.datum(C.sphereSVG):W(H)||X(H)?$.datum(b(L,L.objects[H])):G(H)&&$.datum(D(H,z,P)).call(c.stroke,z[H].gridcolor).call(f.dashLine,z[H].griddash,z[H].gridwidth),W(H)?$.call(c.stroke,z[U+"color"]).call(f.dashLine,"",z[U+"width"]):X(H)&&$.call(c.fill,z[U+"color"])})},T.updateDims=function(P,z){var I=this.bounds,L=(z.framewidth||0)/2,B=I[0][0]-L,O=I[0][1]-L,G=I[1][0]-B+L,W=I[1][1]-O+L;f.setRect(this.clipRect,B,O,G,W),this.bgRect.call(f.setRect,B,O,G,W).call(c.fill,z.bgcolor),this.xaxis._offset=B,this.xaxis._length=G,this.yaxis._offset=O,this.yaxis._length=W},T.updateFx=function(P,z){var I=this,L=I.graphDiv,B=I.bgRect,O=P.dragmode,G=P.clickmode;if(I.isStatic)return;function W(){var N=I.viewInitial,H={};for(var $ in N)H[I.id+"."+$]=N[$];l.call("_guiRelayout",L,H),L.emit("plotly_doubleclick",null)}function X(N){return I.projection.invert([N[0]+I.xaxis._offset,N[1]+I.yaxis._offset])}var Z=function(N,H){if(H.isRect){var $=N.range={};$[I.id]=[X([H.xmin,H.ymin]),X([H.xmax,H.ymax])]}else{var U=N.lassoPoints={};U[I.id]=H.map(X)}},J={element:I.bgRect.node(),gd:L,plotinfo:{id:I.id,xaxis:I.xaxis,yaxis:I.yaxis,fillRangeItems:Z},xaxes:[I.xaxis],yaxes:[I.yaxis],subplot:I.id,clickFn:function(N){N===2&&x(L)}};if(O==="pan"){B.node().onmousedown=null;let N=M(I,z);if(B.call(N),!t.event){let H=I.projection.scale(),[$,U]=I.projection.scaleExtent();(H<$||H>U)&&N.event(B)}B.on("dblclick.zoom",W),L._context._scrollZoom.geo||B.on("wheel.zoom",null)}else(O==="select"||O==="lasso")&&(B.on(".zoom",null),J.prepFn=function(N,H,$){v(N,H,$,J,O)},_.init(J));B.on("mousemove",function(){var N=I.projection.invert(n.getPositionFromD3Event());if(!N)return _.unhover(L,t.event);I.xaxis.p2c=function(){return N[0]},I.yaxis.p2c=function(){return N[1]},h.hover(L,t.event,I.id)}),B.on("mouseout",function(){L._dragging||_.unhover(L,t.event)}),B.on("click",function(){O!=="select"&&O!=="lasso"&&(G.indexOf("select")>-1&&S(t.event,L,[I.xaxis],[I.yaxis],I.id,J),G.indexOf("event")>-1&&h.click(L,t.event))})},T.makeFramework=function(){var P=this,z=P.graphDiv,I=z._fullLayout,L="clip"+I._uid+P.id;P.clipDef=I._clips.append("clipPath").attr("id",L),P.clipRect=P.clipDef.append("rect"),P.framework=t.select(P.container).append("g").attr("class","geo "+P.id).call(f.setClipUrl,L,z),P.project=function(B){var O=P.projection(B);return O?[O[0]-P.xaxis._offset,O[1]-P.yaxis._offset]:[null,null]},P.xaxis={_id:"x",c2p:function(B){return P.project(B)[0]}},P.yaxis={_id:"y",c2p:function(B){return P.project(B)[1]}},P.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(P.mockAxis,I)},T.saveViewInitial=function(P){var z=P.center||{},I=P.projection,L=I.rotation||{};this.viewInitial={fitbounds:P.fitbounds,"projection.scale":I.scale};var B;P._isScoped?B={"center.lon":z.lon,"center.lat":z.lat}:P._isClipped?B={"projection.rotation.lon":L.lon,"projection.rotation.lat":L.lat,"center.lon":z.lon,"center.lat":z.lat}:B={"center.lon":z.lon,"center.lat":z.lat,"projection.rotation.lon":L.lon},n.extendFlat(this.viewInitial,B)},T.render=function(P){this._hasMarkerAngles&&P?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},T._render=function(){var P=this.projection,z=P.getPath(),I;function L(O){var G=P(O.lonlat);return G?u(G[0],G[1]):null}function B(O){return P.isLonLatOverEdges(O.lonlat)?"none":null}for(I in this.basePaths)this.basePaths[I].attr("d",z);for(I in this.dataPaths)this.dataPaths[I].attr("d",function(O){return z(O.geojson)});for(I in this.dataPoints)this.dataPoints[I].attr("display",B).attr("transform",L)};function F(P){var z=P.projection,I=z.type,L=C.projNames[I];L="geo"+n.titleCase(L);for(var B=i[L]||s[L],O=B(),G=P._isSatellite?Math.acos(1/z.distance)*180/Math.PI:P._isClipped?C.lonaxisSpan[I]/2:null,W=["center","rotate","parallels","clipExtent"],X=function(N){return N?O:[]},Z=0;ZU}else return!1},O.getPath=function(){return a().projection(O)},O.getBounds=function(N){return O.getPath().bounds(N)},O.precision(C.precision),P._isSatellite&&O.tilt(z.tilt).distance(z.distance),G&&O.clipAngle(G-C.clipPad),O}function D(P,z,I){var L=1e-6,B=2.5,O=z[P],G=C.scopeDefaults[z.scope],W,X,Z;P==="lonaxis"?(W=G.lonaxisRange,X=G.lataxisRange,Z=function(Y,K){return[Y,K]}):P==="lataxis"&&(W=G.lataxisRange,X=G.lonaxisRange,Z=function(Y,K){return[K,Y]});var J={type:"linear",range:[W[0],W[1]-L],tick0:O.tick0,dtick:O.dtick};p.setConvert(J,I);var N=p.calcTicks(J);!z.isScoped&&P==="lonaxis"&&N.pop();for(var H=N.length,$=new Array(H),U=0;Ute[ne]!=null)||s.fitboundsIncompatible.has(v)?f.fitbounds=!1:Y.forEach(({dst:te,key:ne})=>te&&(te[ne]=null))}}}}),f7=de({"src/plots/geo/index.js"(e,r){"use strict";var t=$u().getSubplotCalcData,i=Qt().counterRegex,a=QY(),o="geo",s=i(o),l={};l[o]={valType:"subplotid",dflt:o,editType:"calc"};function n(f){for(var h=f._fullLayout,d=f.calcdata,p=h._subplots[o],g=0;g")}}}}),p7=de({"src/traces/choropleth/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){i.location=a.location,i.z=a.z;var n=s[l];return n.fIn&&n.fIn.properties&&(i.properties=n.fIn.properties),i.ct=n.ct,i}}}),v7=de({"src/traces/choropleth/select.js"(e,r){"use strict";r.exports=function(i,a){var o=i.cd,s=i.xaxis,l=i.yaxis,n=[],u,c,f,h,d;if(a===!1)for(u=0;u=Math.min(G,W)&&v<=Math.max(G,W)?0:1/0}if(R=Math.min(X,Z)&&x<=Math.max(X,Z)?0:1/0}I=Math.sqrt(R*R+P*P),E=M[D]}}}else for(D=M.length-1;D>-1;D--)b=M[D],T=y[b],F=_[b],R=g.c2p(T)-v,P=m.c2p(F)-x,z=Math.sqrt(R*R+P*P),z100},e.isDotSymbol=function(t){return typeof t=="string"?r.DOT_RE.test(t):t>200}}}),oX=de({"src/traces/scattergl/defaults.js"(e,r){"use strict";var t=Qt(),i=Ma(),a=E4(),o=__(),s=Zd(),l=bs(),n=wv(),u=gd(),c=Nh(),f=yd(),h=Jd(),d=_d();r.exports=function(g,m,y,_){function v(b,E){return t.coerce(g,m,o,b,E)}var x=g.marker?a.isOpenSymbol(g.marker.symbol):!1,S=l.isBubble(g),M=n(g,m,_,v);if(!M){m.visible=!1;return}u(g,m,_,v),v("xhoverformat"),v("yhoverformat");var C=M>>1,g=n[p],m=c!==void 0?c(g,u):g-u;m>=0?(d=p,h=p-1):f=p+1}return d}function i(n,u,c,f,h){for(var d=h+1;f<=h;){var p=f+h>>>1,g=n[p],m=c!==void 0?c(g,u):g-u;m>0?(d=p,h=p-1):f=p+1}return d}function a(n,u,c,f,h){for(var d=f-1;f<=h;){var p=f+h>>>1,g=n[p],m=c!==void 0?c(g,u):g-u;m<0?(d=p,f=p+1):h=p-1}return d}function o(n,u,c,f,h){for(var d=f-1;f<=h;){var p=f+h>>>1,g=n[p],m=c!==void 0?c(g,u):g-u;m<=0?(d=p,f=p+1):h=p-1}return d}function s(n,u,c,f,h){for(;f<=h;){var d=f+h>>>1,p=n[d],g=c!==void 0?c(p,u):p-u;if(g===0)return d;g<=0?f=d+1:h=d-1}return-1}function l(n,u,c,f,h,d){return typeof c=="function"?d(n,u,c,f===void 0?0:f|0,h===void 0?n.length-1:h|0):d(n,u,void 0,c===void 0?0:c|0,f===void 0?n.length-1:f|0)}r.exports={ge:function(n,u,c,f,h){return l(n,u,c,f,h,t)},gt:function(n,u,c,f,h){return l(n,u,c,f,h,i)},lt:function(n,u,c,f,h){return l(n,u,c,f,h,a)},le:function(n,u,c,f,h){return l(n,u,c,f,h,o)},eq:function(n,u,c,f,h){return l(n,u,c,f,h,s)}}}}),m7=de({"node_modules/clamp/index.js"(e,r){r.exports=t;function t(i,a,o){return ao?o:i:ia?a:i}}}),rp=de({"node_modules/pick-by-alias/index.js"(e,r){"use strict";r.exports=function(o,s,l){var n={},u,c;if(typeof s=="string"&&(s=i(s)),Array.isArray(s)){var f={};for(c=0;c1&&(a=arguments),typeof a=="string"?a=a.split(/\s/).map(parseFloat):typeof a=="number"&&(a=[a]),a.length&&typeof a[0]=="number"?a.length===1?o={width:a[0],height:a[0],x:0,y:0}:a.length===2?o={width:a[0],height:a[1],x:0,y:0}:o={x:a[0],y:a[1],width:a[2]-a[0]||0,height:a[3]-a[1]||0}:a&&(a=t(a,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),o={x:a.left||0,y:a.top||0},a.width==null?a.right?o.width=a.right-o.x:o.width=0:o.width=a.width,a.height==null?a.bottom?o.height=a.bottom-o.y:o.height=0:o.height=a.height),o}}}),qv=de({"node_modules/array-bounds/index.js"(e,r){"use strict";r.exports=t;function t(i,a){if(!i||i.length==null)throw Error("Argument should be an array");a==null?a=1:a=Math.floor(a);for(var o=Array(a*2),s=0;sl&&(l=i[u]),i[u]>>1,S;m.dtype||(m.dtype="array"),typeof m.dtype=="string"?S=new(c(m.dtype))(x):m.dtype&&(S=m.dtype,Array.isArray(S)&&(S.length=x));for(let D=0;Dy||L>h){for(let V=0;VK||G>te||W<$||X=Z||q===Y)return;let ne=M[j];Y===void 0&&(Y=ne.length);for(let ee=q;ee=z&&Q<=L&&ue>=I&&ue<=B&&J.push(ie)}let se=C[j],le=se[q*4+0],ce=se[q*4+1],pe=se[q*4+2],xe=se[q*4+3],ye=H(se,q+1),fe=V*.5,ae=j+1;N($,U,fe,ae,le,ce||pe||xe||ye),N($,U+fe,fe,ae,ce,pe||xe||ye),N($+fe,U,fe,ae,pe,xe||ye),N($+fe,U+fe,fe,ae,xe,ye)}function H($,U){let V=null,j=0;for(;V===null;)if(V=$[U*4+j],j++,j>$.length)return null;return V}return J}function T(D,R,P,z,I){let L=[];for(let B=0;B2&&(n.push([c].concat(f.splice(0,2))),h="l",c=c=="m"?"l":"L");;){if(f.length==t[h])return f.unshift(c),n.push(f);if(f.length1&&(g=1),g<-1&&(g=-1),p*Math.acos(g)},l=function(c,f,h,d,p,g,m,y,_,v,x,S){var M=Math.pow(p,2),C=Math.pow(g,2),w=Math.pow(x,2),k=Math.pow(S,2),A=M*C-M*k-C*w;A<0&&(A=0),A/=M*k+C*w,A=Math.sqrt(A)*(m===y?-1:1);var b=A*p/g*S,E=A*-g/p*x,T=v*b-_*E+(c+h)/2,F=_*b+v*E+(f+d)/2,D=(x-b)/p,R=(S-E)/g,P=(-x-b)/p,z=(-S-E)/g,I=s(1,0,D,R),L=s(D,R,P,z);return y===0&&L>0&&(L-=i),y===1&&L<0&&(L+=i),[T,F,I,L]},n=function(c){var f=c.px,h=c.py,d=c.cx,p=c.cy,g=c.rx,m=c.ry,y=c.xAxisRotation,_=y===void 0?0:y,v=c.largeArcFlag,x=v===void 0?0:v,S=c.sweepFlag,M=S===void 0?0:S,C=[];if(g===0||m===0)return[];var w=Math.sin(_*i/360),k=Math.cos(_*i/360),A=k*(f-d)/2+w*(h-p)/2,b=-w*(f-d)/2+k*(h-p)/2;if(A===0&&b===0)return[];g=Math.abs(g),m=Math.abs(m);var E=Math.pow(A,2)/Math.pow(g,2)+Math.pow(b,2)/Math.pow(m,2);E>1&&(g*=Math.sqrt(E),m*=Math.sqrt(E));var T=l(f,h,d,p,g,m,x,M,w,k,A,b),F=t(T,4),D=F[0],R=F[1],P=F[2],z=F[3],I=Math.abs(z)/(i/4);Math.abs(1-I)<1e-7&&(I=1);var L=Math.max(Math.ceil(I),1);z/=L;for(var B=0;B4?(u=v[v.length-4],c=v[v.length-3]):(u=g,c=m),n.push(v)}return n}function a(s,l,n,u){return["C",s,l,n,u,n,u]}function o(s,l,n,u,c,f){return["C",s/3+2/3*n,l/3+2/3*u,c/3+2/3*n,f/3+2/3*u,c,f]}}}),g7=de({"node_modules/is-svg-path/index.js"(e,r){"use strict";r.exports=function(i){return typeof i!="string"?!1:(i=i.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(i)&&/[\dz]$/i.test(i)&&i.length>4))}}}),gX=de({"node_modules/svg-path-bounds/index.js"(e,r){"use strict";var t=dX(),i=pX(),a=mX(),o=g7();r.exports=s;function s(l){if(Array.isArray(l)&&l.length===1&&typeof l[0]=="string"&&(l=l[0]),typeof l=="string"){if(!o(l))throw Error("String is not an SVG path.");l=t(l)}if(!Array.isArray(l))throw Error("Argument should be a string or an array of path segments.");if(l=i(l),l=a(l),!l.length)return[0,0,0,0];for(var n=[1/0,1/0,-1/0,-1/0],u=0,c=l.length;un[2]&&(n[2]=f[h+0]),f[h+1]>n[3]&&(n[3]=f[h+1]);return n}}}),yX=de({"node_modules/bitmap-sdf/index.js"(e,r){"use strict";r.exports=i;var t=1e20;function i(s,l){l||(l={});var n=l.cutoff==null?.25:l.cutoff,u=l.radius==null?8:l.radius,c=l.channel||0,f,h,d,p,g,m,y,_,v,x,S;if(ArrayBuffer.isView(s)||Array.isArray(s)){if(!l.width||!l.height)throw Error("For raw data width and height should be provided by options");f=l.width,h=l.height,p=s,l.stride?m=l.stride:m=Math.floor(s.length/f/h)}else window.HTMLCanvasElement&&s instanceof window.HTMLCanvasElement?(_=s,y=_.getContext("2d"),f=_.width,h=_.height,v=y.getImageData(0,0,f,h),p=v.data,m=4):window.CanvasRenderingContext2D&&s instanceof window.CanvasRenderingContext2D?(_=s.canvas,y=s,f=_.width,h=_.height,v=y.getImageData(0,0,f,h),p=v.data,m=4):window.ImageData&&s instanceof window.ImageData&&(v=s,f=s.width,h=s.height,p=v.data,m=4);if(d=Math.max(f,h),window.Uint8ClampedArray&&p instanceof window.Uint8ClampedArray||window.Uint8Array&&p instanceof window.Uint8Array)for(g=p,p=Array(f*h),x=0,S=Math.floor(g.length/m);x_X});function _X(e,r={}){if(!(0,x7.default)(e))throw Error("Invalid SVG path");let t,i;r.shape||Array.isArray(r)?[t,i]=r.shape||r:(t=x_.width=r.width||r.w||200,i=x_.height=r.height||r.h||200);let a=Math.min(t,i),o=r.stroke||0,s=r.viewbox||r.viewBox||(0,_7.default)(e),l=[t/(s[2]-s[0]),i/(s[3]-s[1])],n=Math.min(l[0]||0,l[1]||0)/2;sh.fillStyle="black",sh.fillRect(0,0,t,i),sh.fillStyle="white",o&&(typeof o!="number"&&(o=1),sh.strokeStyle=o>0?"white":"black",sh.lineWidth=Math.abs(o)),sh.translate(t*.5,i*.5),sh.scale(n,n);let u=new Path2D(e);return sh.fill(u),o&&sh.stroke(u),sh.setTransform(1,0,0,1,0,0),(0,b7.default)(sh,{cutoff:r.cutoff!=null?r.cutoff:.5,radius:r.radius!=null?r.radius:a*.5})}var _7,x7,b7,x_,sh,xX=Ir({"node_modules/svg-path-sdf/svg-path-sdf.js"(){_7=Vr(gX()),x7=Vr(g7()),b7=Vr(yX()),x_=document.createElement("canvas"),sh=x_.getContext("2d",{willReadFrequently:!0})}}),Gv=de({"src/traces/scattergl/convert.js"(e,r){"use strict";var t=da(),i=(xX(),ti(y7)).default,{normalize:a}=ta(),o=Ma(),s=Qt(),l=s.isArrayOrTypedArray,n=hn(),u=Hs(),c=Lp().formatColor,f=bs(),h=Sy(),d=E4(),p=E0(),g=Ap().DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=sf().appendArrayPointValue;function _(z,I){var L,B={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},O=z._context.plotGlPixelRatio;if(I.visible!==!0)return B;if(f.hasText(I)&&(B.text=v(z,I),B.textSel=C(z,I,I.selected),B.textUnsel=C(z,I,I.unselected)),f.hasMarkers(I)&&(B.marker=S(z,I),B.markerSel=M(z,I,I.selected),B.markerUnsel=M(z,I,I.unselected),!I.unselected&&l(I.marker.opacity))){var G=I.marker.opacity;for(B.markerUnsel.opacity=new Array(G.length),L=0;L500?"bold":"normal":z}function S(z,I){var L=I._length,B=I.marker,O={},G,W=l(B.symbol),X=l(B.angle),Z=l(B.color),J=l(B.line.color),N=l(B.opacity),H=l(B.size),$=l(B.line.width),U;if(W||(U=d.isOpenSymbol(B.symbol)),W||Z||J||N||X){O.symbols=new Array(L),O.angles=new Array(L),O.colors=new Array(L),O.borderColors=new Array(L);var V=B.symbol,j=B.angle,q=c(B,B.opacity,L),Y=c(B.line,B.opacity,L);if(!l(Y[0])){var K=Y;for(Y=Array(L),G=0;Gp.TOO_MANY_POINTS||f.hasMarkers(I)?"rect":"round";if(J&&I.connectgaps){var H=G[0],$=G[1];for(W=0;W1?Z[W]:Z[0]:Z,U=l(J)?J.length>1?J[W]:J[0]:J,V=m[$],j=m[U],q=N?N/.8+1:0,Y=-j*q-j*.5;G.offset[W]=[V*q/H,Y/H]}}return G}r.exports={style:_,markerStyle:S,markerSelection:M,linePositions:D,errorBarPositions:R,textPosition:P}}}),w7=de({"src/traces/scattergl/scene_update.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){var s=o._scene,l={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},n={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return o._scene||(s=o._scene={},s.init=function(){t.extendFlat(s,n,l)},s.init(),s.update=function(c){var f=t.repeat(c,s.count);if(s.fill2d&&s.fill2d.update(f),s.scatter2d&&s.scatter2d.update(f),s.line2d&&s.line2d.update(f),s.error2d&&s.error2d.update(f.concat(f)),s.select2d&&s.select2d.update(f),s.glText)for(var h=0;h=g,b=k*2,E={},T,F=M.makeCalcdata(x,"x"),D=C.makeCalcdata(x,"y"),R=s(x,M,"x",F),P=s(x,C,"y",D),z=R.vals,I=P.vals;x._x=z,x._y=I,x.xperiodalignment&&(x._origX=F,x._xStarts=R.starts,x._xEnds=R.ends),x.yperiodalignment&&(x._origY=D,x._yStarts=P.starts,x._yEnds=P.ends);var L=new Array(b),B=new Array(k);for(T=0;T1&&i.extendFlat(w.line,h.linePositions(_,x,S)),w.errorX||w.errorY){var k=h.errorBarPositions(_,x,S,M,C);w.errorX&&i.extendFlat(w.errorX,k.x),w.errorY&&i.extendFlat(w.errorY,k.y)}return w.text&&(i.extendFlat(w.text,{positions:S},h.textPosition(_,x,w.text,w.marker)),i.extendFlat(w.textSel,{positions:S},h.textPosition(_,x,w.text,w.markerSel)),i.extendFlat(w.textUnsel,{positions:S},h.textPosition(_,x,w.text,w.markerUnsel))),w}}}),T7=de({"src/traces/scattergl/edit_style.js"(e,r){"use strict";var t=Qt(),i=ta(),a=Ap().DESELECTDIM;function o(s){var l=s[0],n=l.trace,u=l.t,c=u._scene,f=u.index,h=c.selectBatch[f],d=c.unselectBatch[f],p=c.textOptions[f],g=c.textSelectedOptions[f]||{},m=c.textUnselectedOptions[f]||{},y=t.extendFlat({},p),_,v;if(h.length||d.length){var x=g.color,S=m.color,M=p.color,C=t.isArrayOrTypedArray(M);for(y.color=new Array(n._length),_=0;_10&&/[0-9](?:\s|\/)/.test(o)&&(l=o.match(/([0-9]+)/g).map(function(g){return parseFloat(g)}),u=o.match(/([a-z])/ig).join("").toLowerCase());else isNaN(o)?Array.isArray(o)||o.length?(l=[o[0],o[1],o[2]],u="rgb",n=o.length===4?o[3]:1):o instanceof Object&&(o.r!=null||o.red!=null||o.R!=null?(u="rgb",l=[o.r||o.red||o.R||0,o.g||o.green||o.G||0,o.b||o.blue||o.B||0]):(u="hsl",l=[o.h||o.hue||o.H||0,o.s||o.saturation||o.S||0,o.l||o.lightness||o.L||o.b||o.brightness]),n=o.a||o.alpha||o.opacity||1,o.opacity!=null&&(n/=100)):(u="rgb",l=[o>>>16,(o&65280)>>>8,o&255]);return{space:u,values:l,alpha:n}}}}),MX=de({"node_modules/color-rgba/index.js"(e,r){"use strict";var t=AX();r.exports=function(o){Array.isArray(o)&&o.raw&&(o=String.raw.apply(null,arguments));var s,l,n,u=t(o);if(!u.space)return[];var c=[0,0,0],f=u.space[0]==="h"?[360,100,100]:[255,255,255];return s=Array(3),s[0]=Math.min(Math.max(u.values[0],c[0]),f[0]),s[1]=Math.min(Math.max(u.values[1],c[1]),f[1]),s[2]=Math.min(Math.max(u.values[2],c[2]),f[2]),u.space[0]==="h"&&(s=i(s)),s.push(Math.min(Math.max(u.alpha,0),1)),s};function i(a){var o=a[0]/360,s=a[1]/100,l=a[2]/100,n,u,c,f,h,d=0;if(s===0)return h=l*255,[h,h,h];for(u=l<.5?l*(1+s):l+s-l*s,n=2*l-u,f=[0,0,0];d<3;)c=o+1/3*-(d-1),c<0?c++:c>1&&c--,h=6*c<1?n+(u-n)*6*c:2*c<1?u:3*c<2?n+(u-n)*(2/3-c)*6:n,f[d++]=h*255;return f}}}),b_=de({"node_modules/color-normalize/index.js"(e,r){"use strict";var t=MX(),i=k4();r.exports=function(s,l){(l==="float"||!l)&&(l="array"),l==="uint"&&(l="uint8"),l==="uint_clamped"&&(l="uint8_clamped");var n=i(l),u=new n(4),c=l!=="uint8"&&l!=="uint8_clamped";return(!s.length||typeof s=="string")&&(s=t(s),s[0]/=255,s[1]/=255,s[2]/=255),a(s)?(u[0]=s[0],u[1]=s[1],u[2]=s[2],u[3]=s[3]!=null?s[3]:255,c&&(u[0]/=255,u[1]/=255,u[2]/=255,u[3]/=255),u):(c?(u[0]=s[0],u[1]=s[1],u[2]=s[2],u[3]=s[3]!=null?s[3]:1):(u[0]=Math.min(Math.max(Math.floor(s[0]*255),0),255),u[1]=Math.min(Math.max(Math.floor(s[1]*255),0),255),u[2]=Math.min(Math.max(Math.floor(s[2]*255),0),255),u[3]=s[3]==null?255:Math.min(Math.max(Math.floor(s[3]*255),0),255)),u)};function a(o){return!!(o instanceof Uint8Array||o instanceof Uint8ClampedArray||Array.isArray(o)&&(o[0]>1||o[0]===0)&&(o[1]>1||o[1]===0)&&(o[2]>1||o[2]===0)&&(!o[3]||o[3]>1))}}}),SX=de({"node_modules/color-id/index.js"(e,r){"use strict";var t=m7();r.exports=i,r.exports.to=i,r.exports.from=a;function i(o,s){s==null&&(s=!0);var l=o[0],n=o[1],u=o[2],c=o[3];c==null&&(c=s?1:255),s&&(l*=255,n*=255,u*=255,c*=255),l=t(l,0,255)&255,n=t(n,0,255)&255,u=t(u,0,255)&255,c=t(c,0,255)&255;var f=l*16777216+(n<<16)+(u<<8)+c;return f}function a(o,s){o=+o;var l=o>>>24,n=(o&16711680)>>>16,u=(o&65280)>>>8,c=o&255;return s===!1?[l,n,u,c]:[l/255,n/255,u/255,c/255]}}}),EX=de({"node_modules/glslify/browser.js"(e,r){r.exports=function(t){typeof t=="string"&&(t=[t]);for(var i=[].slice.call(arguments,1),a=[],o=0;o[this.tooManyColors?0:w,_.height],pixelRatio:g.context("pixelRatio"),scale:g.prop("scale"),scaleFract:g.prop("scaleFract"),translate:g.prop("translate"),translateFract:g.prop("translateFract"),markerTexture:g.prop("markerTexture"),paletteTexture:_},attributes:{x:(T,F)=>F.xAttr||{buffer:F.positionBuffer,stride:8,offset:0},y:(T,F)=>F.yAttr||{buffer:F.positionBuffer,stride:8,offset:4},xFract:(T,F)=>F.xAttr?{constant:[0,0]}:{buffer:F.positionFractBuffer,stride:8,offset:0},yFract:(T,F)=>F.yAttr?{constant:[0,0]}:{buffer:F.positionFractBuffer,stride:8,offset:4},size:(T,F)=>F.size.length?{buffer:F.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(F.size*255/this.maxSize)]},borderSize:(T,F)=>F.borderSize.length?{buffer:F.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(F.borderSize*255/this.maxSize)]},colorId:(T,F)=>F.color.length?{buffer:F.colorBuffer,stride:this.tooManyColors?8:4,offset:0}:{constant:this.tooManyColors?v.slice(F.color*4,F.color*4+4):[F.color]},borderColorId:(T,F)=>F.borderColor.length?{buffer:F.colorBuffer,stride:this.tooManyColors?8:4,offset:this.tooManyColors?4:2}:{constant:this.tooManyColors?v.slice(F.borderColor*4,F.borderColor*4+4):[F.borderColor]},isActive:(T,F)=>F.activation===!0?{constant:[1]}:F.activation?F.activation:{constant:[0]}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:g.prop("viewport")},viewport:g.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:g.prop("elements"),count:g.prop("count"),offset:g.prop("offset"),primitive:"points"},b=Object.assign({},A);b.frag=s([`precision highp float; +`),J=Z.length,N=Math.round(L*I),H=I,$=I*2,U=0,V=J*N+$;R.height-1?parseInt(Q[1+Me]):0,Ve=Te>-1?parseInt(ue[1+Te]):0;je!==Ve&&(ge=ge.replace(ce(),"?px "),te*=Math.pow(.75,Ve-je),ge=ge.replace("?px ",ce())),K+=.25*N*(Ve-je)}if(B.superscripts===!0){var Ke=Q.indexOf(x),Je=ue.indexOf(x),vt=Ke>-1?parseInt(Q[1+Ke]):0,xt=Je>-1?parseInt(ue[1+Je]):0;vt!==xt&&(ge=ge.replace(ce(),"?px "),te*=Math.pow(.75,xt-vt),ge=ge.replace("?px ",ce())),K-=.25*N*(xt-vt)}if(B.bolds===!0){var Pt=Q.indexOf(m)>-1,mt=ue.indexOf(m)>-1;!Pt&&mt&&(Mt?ge=ge.replace("italic ","italic bold "):ge="bold "+ge),Pt&&!mt&&(ge=ge.replace("bold ",""))}if(B.italics===!0){var Mt=Q.indexOf(_)>-1,lt=ue.indexOf(_)>-1;!Mt&<&&(ge="italic "+ge),Mt&&!lt&&(ge=ge.replace("italic ",""))}P.font=ge}for(j=0;j0&&(L=I.size),I.lineSpacing&&I.lineSpacing>0&&(B=I.lineSpacing),I.styletags&&I.styletags.breaklines&&(O.breaklines=!!I.styletags.breaklines),I.styletags&&I.styletags.bolds&&(O.bolds=!!I.styletags.bolds),I.styletags&&I.styletags.italics&&(O.italics=!!I.styletags.italics),I.styletags&&I.styletags.subscripts&&(O.subscripts=!!I.styletags.subscripts),I.styletags&&I.styletags.superscripts&&(O.superscripts=!!I.styletags.superscripts)),z.font=[I.fontStyle,I.fontVariant,I.fontWeight,L+"px",I.font].filter(function(W){return W}).join(" "),z.textAlign="start",z.textBaseline="alphabetic",z.direction="ltr";var G=b(P,z,R,L,B,O);return F(G,I,L)}},1538(s){(function(){"use strict";if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function n(T){T.permitHostObjects___&&T.permitHostObjects___(n)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=n);var u=!1;if(typeof WeakMap=="function"){var c=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var f=new c,h=Object.freeze({});if(f.set(h,1),f.get(h)!==1)u=!0;else{s.exports=WeakMap;return}}}var d=Object.prototype.hasOwnProperty,p=Object.getOwnPropertyNames,g=Object.defineProperty,m=Object.isExtensible,y="weakmap:",_=y+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var v=new ArrayBuffer(25),x=new Uint8Array(v);crypto.getRandomValues(x),_=y+"rand:"+Array.prototype.map.call(x,function(T){return(T%36).toString(36)}).join("")+"___"}function S(T){return!(T.substr(0,y.length)==y&&T.substr(T.length-3)==="___")}if(g(Object,"getOwnPropertyNames",{value:function(F){return p(F).filter(S)}}),"getPropertyNames"in Object){var M=Object.getPropertyNames;g(Object,"getPropertyNames",{value:function(F){return M(F).filter(S)}})}function C(T){if(T!==Object(T))throw new TypeError("Not an object: "+T);var F=T[_];if(F&&F.key===T)return F;if(m(T)){F={key:T};try{return g(T,_,{value:F,writable:!1,enumerable:!1,configurable:!1}),F}catch{return}}}(function(){var T=Object.freeze;g(Object,"freeze",{value:function(P){return C(P),T(P)}});var F=Object.seal;g(Object,"seal",{value:function(P){return C(P),F(P)}});var D=Object.preventExtensions;g(Object,"preventExtensions",{value:function(P){return C(P),D(P)}})})();function w(T){return T.prototype=null,Object.freeze(T)}var k=!1;function A(){!k&&typeof console<"u"&&(k=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var b=0,E=function(){this instanceof E||A();var T=[],F=[],D=b++;function R(L,B){var O,G=C(L);return G?D in G?G[D]:B:(O=T.indexOf(L),O>=0?F[O]:B)}function P(L){var B=C(L);return B?D in B:T.indexOf(L)>=0}function z(L,B){var O,G=C(L);return G?G[D]=B:(O=T.indexOf(L),O>=0?F[O]=B:(O=T.length,F[O]=B,T[O]=L)),this}function I(L){var B=C(L),O,G;return B?D in B&&delete B[D]:(O=T.indexOf(L),O<0?!1:(G=T.length-1,T[O]=void 0,F[O]=F[G],T[O]=T[G],T.length=G,F.length=G,!0))}return Object.create(E.prototype,{get___:{value:w(R)},has___:{value:w(P)},set___:{value:w(z)},delete___:{value:w(I)}})};E.prototype=Object.create(Object.prototype,{get:{value:function(F,D){return this.get___(F,D)},writable:!0,configurable:!0},has:{value:function(F){return this.has___(F)},writable:!0,configurable:!0},set:{value:function(F,D){return this.set___(F,D)},writable:!0,configurable:!0},delete:{value:function(F){return this.delete___(F)},writable:!0,configurable:!0}}),typeof c=="function"?(function(){u&&typeof Proxy<"u"&&(Proxy=void 0);function T(){this instanceof E||A();var F=new c,D=void 0,R=!1;function P(B,O){return D?F.has(B)?F.get(B):D.get___(B,O):F.get(B,O)}function z(B){return F.has(B)||(D?D.has___(B):!1)}var I;u?I=function(B,O){return F.set(B,O),F.has(B)||(D||(D=new E),D.set(B,O)),this}:I=function(B,O){if(R)try{F.set(B,O)}catch{D||(D=new E),D.set___(B,O)}else F.set(B,O);return this};function L(B){var O=!!F.delete(B);return D&&D.delete___(B)||O}return Object.create(E.prototype,{get___:{value:w(P)},has___:{value:w(z)},set___:{value:w(I)},delete___:{value:w(L)},permitHostObjects___:{value:w(function(B){if(B===n)R=!0;else throw new Error("bogus call to permitHostObjects___")})}})}T.prototype=E.prototype,s.exports=T,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),s.exports=E)})()},236(s,l,n){var u=n(8284);s.exports=c;function c(){var f={};return function(h){if((typeof h!="object"||h===null)&&typeof h!="function")throw new Error("Weakmap-shim: Key must be object");var d=h.valueOf(f);return d&&d.identity===f?d:u(h,f)}}},8284(s){s.exports=l;function l(n,u){var c={identity:u},f=n.valueOf;return Object.defineProperty(n,"valueOf",{value:function(h){return h!==u?f.apply(this,arguments):c},writable:!0}),c}},606(s,l,n){var u=n(236);s.exports=c;function c(){var f=u();return{get:function(h,d){var p=f(h);return p.hasOwnProperty("value")?p.value:d},set:function(h,d){return f(h).value=d,this},has:function(h){return"value"in f(h)},delete:function(h){return delete f(h).value}}}},3349(s){"use strict";function l(){return function(d,p,g,m,y,_){var v=d[0],x=g[0],S=[0],M=x;m|=0;var C=0,w=x;for(C=0;C=0!=A>=0&&y.push(S[0]+.5+.5*(k+A)/(k-A))}m+=w,++S[0]}}}function n(){return l()}var u=n;function c(d){var p={};return function(m,y,_){var v=m.dtype,x=m.order,S=[v,x.join()].join(),M=p[S];return M||(p[S]=M=d([v,x])),M(m.shape.slice(0),m.data,m.stride,m.offset|0,y,_)}}function f(d){return c(u.bind(void 0,d))}function h(d){return f({funcName:d.funcName})}s.exports=h({funcName:"zeroCrossings"})},781(s,l,n){"use strict";s.exports=c;var u=n(3349);function c(f,h){var d=[];return h=+h||0,u(f.hi(f.shape[0]-1),d,h),d}},7790(){}};let i={};function a(s){let l=i[s];if(l!==void 0)return l.exports;let n=i[s]={id:s,loaded:!1,exports:{}};return t[s].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),a.nmd=s=>(s.paths=[],s.children||(s.children=[]),s);let o=a(3065);r.exports=o})()}}),Lp=de({"src/lib/str2rgbarray.js"(e,r){"use strict";var{normalize:t}=ta();function i(a){return a?t(a):[0,0,0,1]}r.exports=i}}),Fp=de({"src/lib/gl_format_color.js"(e,r){"use strict";var t=da(),i=Cs(),a=ta(),o=Jo().defaultLine,s=Do().isArrayOrTypedArray,l=a.normalize(o),n=1;function u(p,g){return[p[0],p[1],p[2],p[3]*g]}function c(p){return t(p)||!a.isChannelArray(p)&&!a.isValid(p)?l:a.normalize(p)}function f(p){return t(p)?p:n}function h(p,g,m){var y=p.color;y&&y._inputArray&&(y=y._inputArray);var _=s(y),v=s(g),x=i.extractOpts(p),S=[],M,C,w,k,A;if(x.colorscale!==void 0?M=i.makeColorScaleFuncFromTrace(p):M=c,_?C=(E,T)=>E[T]===void 0?l:x.colorscale===void 0?M(E[T]):a.normalize(M(E[T])):C=c,v?w=function(E,T){return E[T]===void 0?n:f(E[T])}:w=f,_||v)for(var b=0;b0){var y=u.c2l(g);u._lowerLogErrorBound||(u._lowerLogErrorBound=y),u._lowerErrorBound=Math.min(u._lowerLogErrorBound,y)}}else f[h]=[-d[0]*n,d[1]*n]}return f}function a(s){for(var l=0;l-1?-1:F.indexOf("right")>-1?1:0}function S(F){return F==null?0:F.indexOf("top")>-1?-1:F.indexOf("bottom")>-1?1:0}function M(F){var D=0,R=0,P=[D,R];if(Array.isArray(F))for(var z=0;z=0){var G=_(B.position,B.delaunayColor,B.delaunayAxis);G.opacity=F.opacity,this.delaunayMesh?this.delaunayMesh.update(G):(G.gl=D,this.delaunayMesh=o(G),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},y.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function T(F,D){var R=new m(F,D.uid);return R.update(D),R}r.exports=T}}),XD=de({"src/traces/scatter3d/attributes.js"(e,r){"use strict";var t=tl(),i=us(),a=cs(),o=Ns().axisHoverFormat,{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:n}=Vo(),u=ri(),c=YD(),f=v4(),h=fn().extendFlat,d=Is().overrideAll,p=(yv(),ti(f0)).default,g=t.line,m=t.marker,y=m.line,_=h({width:g.width,dash:{valType:"enumerated",values:p(c),dflt:"solid"}},a("line"));function v(S){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var x=r.exports=d({x:t.x,y:t.y,z:{valType:"data_array"},text:h({},t.text,{}),texttemplate:l(),texttemplatefallback:n({editType:"calc"}),hovertext:h({},t.hovertext,{}),hovertemplate:s(),hovertemplatefallback:n(),xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z"),mode:h({},t.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:v("x"),y:v("y"),z:v("z")},connectgaps:t.connectgaps,line:_,marker:h({symbol:{valType:"enumerated",values:p(f),dflt:"circle",arrayOk:!0},size:h({},m.size,{dflt:8}),sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode,opacity:h({},m.opacity,{arrayOk:!1}),colorbar:m.colorbar,line:h({width:h({},y.width,{arrayOk:!1})},a("marker.line"))},a("marker")),textposition:h({},t.textposition,{dflt:"top center"}),textfont:i({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:u.opacity,hoverinfo:h({},u.hoverinfo)},"calc","nested");x.x.editType=x.y.editType=x.z.editType="calc+clearAxisTypes"}}),rY=de({"src/traces/scatter3d/defaults.js"(e,r){"use strict";var t=Sa(),i=Qt(),a=bs(),o=jh(),s=_d(),l=xd(),n=XD();r.exports=function(f,h,d,p){function g(C,w){return i.coerce(f,h,n,C,w)}var m=u(f,h,g,p);if(!m){h.visible=!1;return}g("text"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback"),g("xhoverformat"),g("yhoverformat"),g("zhoverformat"),g("mode"),a.hasMarkers(h)&&o(f,h,d,p,g,{noAngle:!0,noLineDash:!0,noSelect:!0}),a.hasLines(h)&&(g("connectgaps"),s(f,h,d,p,g)),a.hasText(h)&&(g("texttemplate"),g("texttemplatefallback"),l(f,h,p,g,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var y=(h.line||{}).color,_=(h.marker||{}).color;g("surfaceaxis")>=0&&g("surfacecolor",y||_);for(var v=["x","y","z"],x=0;x<3;++x){var S="projection."+v[x];g(S+".show")&&(g(S+".opacity"),g(S+".scale"))}var M=t.getComponentMethod("errorbars","supplyDefaults");M(f,h,y||_||d,{axis:"z"}),M(f,h,y||_||d,{axis:"y",inherit:"z"}),M(f,h,y||_||d,{axis:"x",inherit:"z"})};function u(c,f,h,d){var p=0,g=h("x"),m=h("y"),y=h("z"),_=t.getComponentMethod("calendars","handleTraceDefaults");return _(c,f,["x","y","z"],d),g&&m&&y&&(p=Math.min(g.length,m.length,y.length),f._length=f._xlength=f._ylength=f._zlength=p),p}}}),iY=de({"src/traces/scatter3d/calc.js"(e,r){"use strict";var t=ep(),i=Uh();r.exports=function(o,s){var l=[{x:!1,y:!1,trace:s,t:{}}];return t(l,s),i(o,s),l}}}),aY=de({"node_modules/get-canvas-context/index.js"(e,r){r.exports=t;function t(i,a){if(typeof i!="string")throw new TypeError("must specify type string");if(a=a||{},typeof document>"u"&&!a.canvas)return null;var o=a.canvas||document.createElement("canvas");typeof a.width=="number"&&(o.width=a.width),typeof a.height=="number"&&(o.height=a.height);var s=a,l;try{var n=[i];i.indexOf("webgl")===0&&n.push("experimental-"+i);for(var u=0;u/g," "));h[d]=y,p.tickmode=g}}u.ticks=h;for(var d=0;d<3;++d){o[d]=.5*(n.glplot.bounds[0][d]+n.glplot.bounds[1][d]);for(var _=0;_<2;++_)u.bounds[_][d]=n.glplot.bounds[_][d]}n.contourLevels=s(h)}}}),uY=de({"src/plots/gl3d/scene.js"(e,r){"use strict";var t=ku().gl_plot3d,i=t.createCamera,a=t.createScene,o=nY(),s=Mw(),l=Sa(),n=Qt(),u=n.preserveDrawingBuffer(),c=nn(),f=$s(),h=Lp(),d=ZD(),p=lk(),g=oY(),m=sY(),y=lY(),_=md().applyAutorangeOptions,v,x,S=!1;function M(R,P){var z=document.createElement("div"),I=R.container;this.graphDiv=R.graphDiv;var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.style.position="absolute",L.style.top=L.style.left="0px",L.style.width=L.style.height="100%",L.style["z-index"]=20,L.style["pointer-events"]="none",z.appendChild(L),this.svgContainer=L,z.id=R.id,z.style.position="absolute",z.style.top=z.style.left="0px",z.style.width=z.style.height="100%",I.appendChild(z),this.fullLayout=P,this.id=R.id||"scene",this.fullSceneLayout=P[this.id],this.plotArgs=[[],{},{}],this.axesOptions=g(P,P[this.id]),this.spikeOptions=m(P[this.id]),this.container=z,this.staticMode=!!R.staticPlot,this.pixelRatio=this.pixelRatio||R.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=l.getComponentMethod("annotations3d","convert"),this.drawAnnotations=l.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var C=M.prototype;C.prepareOptions=function(){var R=this,P={canvas:R.canvas,gl:R.gl,glOptions:{preserveDrawingBuffer:u,premultipliedAlpha:!0,antialias:!0},container:R.container,axes:R.axesOptions,spikes:R.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:R.camera,pixelRatio:R.pixelRatio};if(R.staticMode){if(!x&&(v=document.createElement("canvas"),x=o({canvas:v,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!x))throw new Error("error creating static canvas/context for image server");P.gl=x,P.canvas=v}return P};var w=!0;C.tryCreatePlot=function(){var R=this,P=R.prepareOptions(),z=!0;try{R.glplot=a(P)}catch{if(R.staticMode||!w||u)z=!1;else{n.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{u=P.glOptions.preserveDrawingBuffer=!0,R.glplot=a(P)}catch{u=P.glOptions.preserveDrawingBuffer=!1,z=!1}}}return w=!1,z},C.initializeGLCamera=function(){var R=this,P=R.fullSceneLayout.camera,z=P.projection.type==="orthographic";R.camera=i(R.container,{center:[P.center.x,P.center.y,P.center.z],eye:[P.eye.x,P.eye.y,P.eye.z],up:[P.up.x,P.up.y,P.up.z],_ortho:z,zoomMin:.01,zoomMax:100,mode:"orbit"})},C.initializeGLPlot=function(){var R=this;R.initializeGLCamera();var P=R.tryCreatePlot();if(!P)return d(R);R.traces={},R.make4thDimension();var z=R.graphDiv,I=z.layout,L=function(){var O={};return R.isCameraChanged(I)&&(O[R.id+".camera"]=R.getCamera()),R.isAspectChanged(I)&&(O[R.id+".aspectratio"]=R.glplot.getAspectratio(),I[R.id].aspectmode!=="manual"&&(R.fullSceneLayout.aspectmode=I[R.id].aspectmode=O[R.id+".aspectmode"]="manual")),O},B=function(O){if(O.fullSceneLayout.dragmode!==!1){var G=L();O.saveLayout(I),O.graphDiv.emit("plotly_relayout",G)}};return R.glplot.canvas&&(R.glplot.canvas.addEventListener("mouseup",function(){B(R)}),R.glplot.canvas.addEventListener("touchstart",function(){S=!0}),R.glplot.canvas.addEventListener("wheel",function(O){if(z._context._scrollZoom.gl3d){if(R.camera._ortho){var G=O.deltaX>O.deltaY?1.1:.9090909090909091,W=R.glplot.getAspectratio();R.glplot.setAspectratio({x:G*W.x,y:G*W.y,z:G*W.z})}B(R)}},s?{passive:!1}:!1),R.glplot.canvas.addEventListener("mousemove",function(){if(R.fullSceneLayout.dragmode!==!1&&R.camera.mouseListener.buttons!==0){var O=L();R.graphDiv.emit("plotly_relayouting",O)}}),R.staticMode||R.glplot.canvas.addEventListener("webglcontextlost",function(O){z&&z.emit&&z.emit("plotly_webglcontextlost",{event:O,layer:R.id})},!1)),R.glplot.oncontextloss=function(){R.recoverContext()},R.glplot.onrender=function(){R.render()},!0},C.render=function(){var R=this,P=R.graphDiv,z,I=R.svgContainer,L=R.container.getBoundingClientRect();P._fullLayout._calcInverseTransform(P);var B=P._fullLayout._invScaleX,O=P._fullLayout._invScaleY,G=L.width*B,W=L.height*O;I.setAttributeNS(null,"viewBox","0 0 "+G+" "+W),I.setAttributeNS(null,"width",G),I.setAttributeNS(null,"height",W),y(R),R.glplot.axes.update(R.axesOptions);for(var X=Object.keys(R.traces),Z=null,J=R.glplot.selection,N=0;N")):z.type==="isosurface"||z.type==="volume"?(j.valueLabel=c.hoverLabelText(R._mockAxis,R._mockAxis.d2l(J.traceCoordinate[3]),z.valuehoverformat),ne.push("value: "+j.valueLabel),J.textLabel&&ne.push(J.textLabel),te=ne.join("
")):te=J.textLabel;var se={x:J.traceCoordinate[0],y:J.traceCoordinate[1],z:J.traceCoordinate[2],data:U._input,fullData:U,curveNumber:U.index,pointNumber:V};f.appendArrayPointValue(se,U,V),z._module.eventData&&(se=U._module.eventData(se,J,U,{},V));var le={points:[se]};if(R.fullSceneLayout.hovermode){var ce=[];f.loneHover({trace:U,x:(.5+.5*$[0]/$[3])*G,y:(.5-.5*$[1]/$[3])*W,xLabel:j.xLabel,yLabel:j.yLabel,zLabel:j.zLabel,text:te,name:Z.name,color:f.castHoverOption(U,V,"bgcolor")||Z.color,borderColor:f.castHoverOption(U,V,"bordercolor"),fontFamily:f.castHoverOption(U,V,"font.family"),fontSize:f.castHoverOption(U,V,"font.size"),fontColor:f.castHoverOption(U,V,"font.color"),nameLength:f.castHoverOption(U,V,"namelength"),textAlign:f.castHoverOption(U,V,"align"),hovertemplate:n.castOption(U,V,"hovertemplate"),hovertemplateLabels:n.extendFlat({},se,j),eventData:[se]},{container:I,gd:P,inOut_bbox:ce}),se.bbox=ce[0]}J.distance<5&&(J.buttons||S)?P.emit("plotly_click",le):P.emit("plotly_hover",le),this.oldEventData=le}else f.loneUnhover(I),this.oldEventData&&P.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;R.drawAnnotations(R)},C.recoverContext=function(){var R=this;R.glplot.dispose();var P=function(){if(R.glplot.gl.isContextLost()){requestAnimationFrame(P);return}if(!R.initializeGLPlot()){n.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}R.plot.apply(R,R.plotArgs)};requestAnimationFrame(P)};var k=["xaxis","yaxis","zaxis"];function A(R,P,z){for(var I=R.fullSceneLayout,L=0;L<3;L++){var B=k[L],O=B.charAt(0),G=I[B],W=P[O],X=P[O+"calendar"],Z=P["_"+O+"length"];if(!n.isArrayOrTypedArray(W))z[0][L]=Math.min(z[0][L],0),z[1][L]=Math.max(z[1][L],Z-1);else for(var J,N=0;N<(Z||W.length);N++)if(n.isArrayOrTypedArray(W[N]))for(var H=0;HU[1][O])U[0][O]=-1,U[1][O]=1;else{var xe=U[1][O]-U[0][O];U[0][O]-=xe/32,U[1][O]+=xe/32}if(q=[U[0][O],U[1][O]],q=_(q,W),U[0][O]=q[0],U[1][O]=q[1],W.isReversed()){var ye=U[0][O];U[0][O]=U[1][O],U[1][O]=ye}}else q=W.range,U[0][O]=W.r2l(q[0]),U[1][O]=W.r2l(q[1]);U[0][O]===U[1][O]&&(U[0][O]-=1,U[1][O]+=1),V[O]=U[1][O]-U[0][O],W.range=[U[0][O],U[1][O]],W.limitRange(),I.glplot.setBounds(O,{min:W.range[0]*H[O],max:W.range[1]*H[O]})}var fe,ae=Z.aspectmode;if(ae==="cube")fe=[1,1,1];else if(ae==="manual"){var ee=Z.aspectratio;fe=[ee.x,ee.y,ee.z]}else if(ae==="auto"||ae==="data"){var ie=[1,1,1];for(O=0;O<3;++O){W=Z[k[O]],X=W.type;var Q=j[X];ie[O]=Math.pow(Q.acc,1/Q.count)/H[O]}ae==="data"||Math.max.apply(null,ie)/Math.min.apply(null,ie)<=4?fe=ie:fe=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");Z.aspectratio.x=J.aspectratio.x=fe[0],Z.aspectratio.y=J.aspectratio.y=fe[1],Z.aspectratio.z=J.aspectratio.z=fe[2],I.glplot.setAspectratio(Z.aspectratio),I.viewInitial.aspectratio||(I.viewInitial.aspectratio={x:Z.aspectratio.x,y:Z.aspectratio.y,z:Z.aspectratio.z}),I.viewInitial.aspectmode||(I.viewInitial.aspectmode=Z.aspectmode);var ue=Z.domain||null,ge=P._size||null;if(ue&&ge){var Me=I.container.style;Me.position="absolute",Me.left=ge.l+ue.x[0]*ge.w+"px",Me.top=ge.t+(1-ue.y[1])*ge.h+"px",Me.width=ge.w*(ue.x[1]-ue.x[0])+"px",Me.height=ge.h*(ue.y[1]-ue.y[0])+"px"}I.glplot.redraw()}},C.destroy=function(){var R=this;R.glplot&&(R.camera.mouseListener.enabled=!1,R.container.removeEventListener("wheel",R.camera.wheelListener),R.camera=null,R.glplot.dispose(),R.container.parentNode.removeChild(R.container),R.glplot=null)};function E(R){return[[R.eye.x,R.eye.y,R.eye.z],[R.center.x,R.center.y,R.center.z],[R.up.x,R.up.y,R.up.z]]}function T(R){return{up:{x:R.up[0],y:R.up[1],z:R.up[2]},center:{x:R.center[0],y:R.center[1],z:R.center[2]},eye:{x:R.eye[0],y:R.eye[1],z:R.eye[2]},projection:{type:R._ortho===!0?"orthographic":"perspective"}}}C.getCamera=function(){var R=this;return R.camera.view.recalcMatrix(R.camera.view.lastT()),T(R.camera)},C.setViewport=function(R){var P=this,z=R.camera;P.camera.lookAt.apply(this,E(z)),P.glplot.setAspectratio(R.aspectratio);var I=z.projection.type==="orthographic",L=P.camera._ortho;I!==L&&(P.glplot.redraw(),P.glplot.clearRGBA(),P.glplot.dispose(),P.initializeGLPlot())},C.isCameraChanged=function(R){var P=this,z=P.getCamera(),I=n.nestedProperty(R,P.id+".camera"),L=I.get();function B(X,Z,J,N){var H=["up","center","eye"],$=["x","y","z"];return Z[H[J]]&&X[H[J]][$[N]]===Z[H[J]][$[N]]}var O=!1;if(L===void 0)O=!0;else{for(var G=0;G<3;G++)for(var W=0;W<3;W++)if(!B(z,L,G,W)){O=!0;break}(!L.projection||z.projection&&z.projection.type!==L.projection.type)&&(O=!0)}return O},C.isAspectChanged=function(R){var P=this,z=P.glplot.getAspectratio(),I=n.nestedProperty(R,P.id+".aspectratio"),L=I.get();return L===void 0||L.x!==z.x||L.y!==z.y||L.z!==z.z},C.saveLayout=function(R){var P=this,z=P.fullLayout,I,L,B,O,G,W,X=P.isCameraChanged(R),Z=P.isAspectChanged(R),J=X||Z;if(J){var N={};if(X&&(I=P.getCamera(),L=n.nestedProperty(R,P.id+".camera"),B=L.get(),N[P.id+".camera"]=B),Z&&(O=P.glplot.getAspectratio(),G=n.nestedProperty(R,P.id+".aspectratio"),W=G.get(),N[P.id+".aspectratio"]=W),l.call("_storeDirectGUIEdit",R,z._preGUI,N),X){L.set(I);var H=n.nestedProperty(z,P.id+".camera");H.set(I)}if(Z){G.set(O);var $=n.nestedProperty(z,P.id+".aspectratio");$.set(O),P.glplot.redraw()}}return J},C.updateFx=function(R,P){var z=this,I=z.camera;if(I)if(R==="orbit")I.mode="orbit",I.keyBindingMode="rotate";else if(R==="turntable"){I.up=[0,0,1],I.mode="turntable",I.keyBindingMode="rotate";var L=z.graphDiv,B=L._fullLayout,O=z.fullSceneLayout.camera,G=O.up.x,W=O.up.y,X=O.up.z;if(X/Math.sqrt(G*G+W*W+X*X)<.999){var Z=z.id+".camera.up",J={x:0,y:0,z:1},N={};N[Z]=J;var H=L.layout;l.call("_storeDirectGUIEdit",H,B._preGUI,N),O.up=J,n.nestedProperty(H,Z).set(J)}}else I.keyBindingMode=R;z.fullSceneLayout.hovermode=P};function F(R,P,z){for(var I=0,L=z-1;I0)for(var G=255/O,W=0;W<3;++W)R[B+W]=Math.min(G*R[B+W],255)}}C.toImage=function(R){var P=this;R||(R="png"),P.staticMode&&P.container.appendChild(v),P.glplot.redraw();var z=P.glplot.gl,I=z.drawingBufferWidth,L=z.drawingBufferHeight;z.bindFramebuffer(z.FRAMEBUFFER,null);var B=new Uint8Array(I*L*4);z.readPixels(0,0,I,L,z.RGBA,z.UNSIGNED_BYTE,B),F(B,I,L),D(B,I,L);var O=document.createElement("canvas");O.width=I,O.height=L;var G=O.getContext("2d",{willReadFrequently:!0}),W=G.createImageData(I,L);W.data.set(B),G.putImageData(W,0,0);var X;switch(R){case"jpeg":X=O.toDataURL("image/jpeg");break;case"webp":X=O.toDataURL("image/webp");break;default:X=O.toDataURL("image/png")}return P.staticMode&&P.container.removeChild(v),X},C.setConvert=function(){for(var R=this,P=0;P<3;P++){var z=R.fullSceneLayout[k[P]];c.setConvert(z,R.fullLayout),z.setScale=n.noop}},C.make4thDimension=function(){var R=this,P=R.graphDiv,z=P._fullLayout;R._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(R._mockAxis,z)},r.exports=M}}),cY=de({"src/plots/gl3d/layout/attributes.js"(e,r){"use strict";r.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),KD=de({"src/plots/gl3d/layout/axis_attributes.js"(e,r){"use strict";var t=ta(),i=Mu(),a=fn().extendFlat,o=Is().overrideAll;r.exports=o({visible:i.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:t.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:i.color,categoryorder:i.categoryorder,categoryarray:i.categoryarray,title:{text:i.title.text,font:i.title.font},type:a({},i.type,{values:["-","linear","log","date","category"]}),autotypenumbers:i.autotypenumbers,autorange:i.autorange,autorangeoptions:{minallowed:i.autorangeoptions.minallowed,maxallowed:i.autorangeoptions.maxallowed,clipmin:i.autorangeoptions.clipmin,clipmax:i.autorangeoptions.clipmax,include:i.autorangeoptions.include,editType:"plot"},rangemode:i.rangemode,minallowed:i.minallowed,maxallowed:i.maxallowed,range:a({},i.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:i.minor.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,mirror:i.mirror,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,labelalias:i.labelalias,tickfont:i.tickfont,tickangle:i.tickangle,tickprefix:i.tickprefix,showtickprefix:i.showtickprefix,ticksuffix:i.ticksuffix,showticksuffix:i.showticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:a({},i.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth},"plot","from-root")}}),JD=de({"src/plots/gl3d/layout/layout_attributes.js"(e,r){"use strict";var t=KD(),i=Rs().attributes,a=fn().extendFlat,o=Qt().counterRegex;function s(l,n,u){return{x:{valType:"number",dflt:l,editType:"camera"},y:{valType:"number",dflt:n,editType:"camera"},z:{valType:"number",dflt:u,editType:"camera"},editType:"camera"}}r.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:t,yaxis:t,zaxis:t,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),fY=de({"src/plots/gl3d/layout/axis_defaults.js"(e,r){"use strict";var t=ta(),i=Qt(),a=Ro(),o=KD(),s=ok(),l=zy(),n=["xaxis","yaxis","zaxis"],u=13600/187;r.exports=function(f,h,d){var p,g;function m(v,x){return i.coerce(p,g,o,v,x)}for(var y=0;y1;function m(y){if(!g){var _=t.validate(h[y],l[y]);if(_)return h[y]}}o(h,d,p,{type:u,attributes:l,handleDefaults:c,fullLayout:d,font:d.font,fullData:p,getDfltFromLayout:m,autotypenumbersDflt:d.autotypenumbers,paper_bgcolor:d.paper_bgcolor,calendar:d.calendar})};function c(f,h,d,p){for(var g=d("bgcolor"),m=i.combine(g,p.paper_bgcolor),y=["up","center","eye"],_=0;_.999)&&(C="turntable")}else C="turntable";d("dragmode",C),d("hovermode",p.getDfltFromLayout("hovermode"))}}}),E0=de({"src/plots/gl3d/index.js"(e){"use strict";var r=Is().overrideAll,t=La(),i=uY(),a=$u().getSubplotData,o=Qt(),s=Nh(),l="gl3d",n="scene";e.name=l,e.attr=n,e.idRoot=n,e.idRegex=e.attrRegex=o.counterRegex("scene"),e.attributes=cY(),e.layoutAttributes=JD(),e.baseLayoutAttrOverrides=r({hoverlabel:t.hoverlabel},"plot","nested"),e.supplyLayoutDefaults=hY(),e.plot=function(c){for(var f=c._fullLayout,h=c._fullData,d=f._subplots[l],p=0;p0){F=p[D];break}return F}function _(E,T){if(!(E<1||T<1)){for(var F=m(E),D=m(T),R=1,P=0;PM;)D--,D/=y(D),D++,D1?R:1};function C(E,T,F){var D=F[8]+F[2]*T[0]+F[5]*T[1];return E[0]=(F[6]+F[0]*T[0]+F[3]*T[1])/D,E[1]=(F[7]+F[1]*T[0]+F[4]*T[1])/D,E}function w(E,T,F){return k(E,T,C,F),E}function k(E,T,F,D){for(var R=[0,0],P=E.shape[0],z=E.shape[1],I=0;I0&&this.contourStart[D]!==null&&this.contourEnd[D]!==null&&this.contourEnd[D]>this.contourStart[D]))for(T[D]=!0,R=this.contourStart[D];RW&&(this.minValues[B]=W),this.maxValues[B]p&&(u.isomin=null,u.isomax=null);var g=h("x"),m=h("y"),y=h("z"),_=h("value");if(!g||!g.length||!m||!m.length||!y||!y.length||!_||!_.length){u.visible=!1;return}var v=i.getComponentMethod("calendars","handleTraceDefaults");v(n,u,["x","y","z"],f),h("valuehoverformat"),["x","y","z"].forEach(function(C){h(C+"hoverformat");var w="caps."+C,k=h(w+".show");k&&h(w+".fill");var A="slices."+C,b=h(A+".show");b&&(h(A+".fill"),h(A+".locations"))});var x=h("spaceframe.show");x&&h("spaceframe.fill");var S=h("surface.show");S&&(h("surface.count"),h("surface.fill"),h("surface.pattern"));var M=h("contour.show");M&&(h("contour.color"),h("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(C){h(C)}),o(n,u,f,h,{prefix:"",cLetter:"c"}),u._length=null}r.exports={supplyDefaults:s,supplyIsoDefaults:l}}}),g4=de({"src/traces/streamtube/calc.js"(e,r){"use strict";var t=Qt(),i=hc();function a(n,u){u._len=Math.min(u.u.length,u.v.length,u.w.length,u.x.length,u.y.length,u.z.length),u._u=l(u.u,u._len),u._v=l(u.v,u._len),u._w=l(u.w,u._len),u._x=l(u.x,u._len),u._y=l(u.y,u._len),u._z=l(u.z,u._len);var c=o(u);u._gridFill=c.fill,u._Xs=c.Xs,u._Ys=c.Ys,u._Zs=c.Zs,u._len=c.len;var f=0,h,d,p;u.starts&&(h=l(u.starts.x||[]),d=l(u.starts.y||[]),p=l(u.starts.z||[]),f=Math.min(h.length,d.length,p.length)),u._startsX=h||[],u._startsY=d||[],u._startsZ=p||[];var g=0,m=1/0,y;for(y=0;y1&&(b=u[h-1],T=c[h-1],D=f[h-1]),d=0;db?"-":"+")+"x"),M=M.replace("y",(E>T?"-":"+")+"y"),M=M.replace("z",(F>D?"-":"+")+"z");var I=function(){h=0,R=[],P=[],z=[]};(!h||h0;m--){var y=Math.min(g[m],g[m-1]),_=Math.max(g[m],g[m-1]);if(_>y&&y-1}function Y(lt,qe){return lt===null?qe:lt}function K(lt,qe,Ye){X();var me=[qe],_e=[Ye];if(U>=1)me=[qe],_e=[Ye];else if(U>0){var Ae=j(qe,Ye);me=Ae.xyzv,_e=Ae.abc}for(var ke=0;ke-1?Ye[De]:W(Qe,Ue,at);ht>-1?Ee[De]=ht:Ee[De]=J(Qe,Ue,at,Y(lt,rt))}N(Ee[0],Ee[1],Ee[2])}}function te(lt,qe,Ye){var me=function(_e,Ae,ke){K(lt,[qe[_e],qe[Ae],qe[ke]],[Ye[_e],Ye[Ae],Ye[ke]])};me(0,1,2),me(2,3,0)}function ne(lt,qe,Ye){var me=function(_e,Ae,ke){K(lt,[qe[_e],qe[Ae],qe[ke]],[Ye[_e],Ye[Ae],Ye[ke]])};me(0,1,2),me(3,0,1),me(2,3,0),me(1,2,3)}function se(lt,qe,Ye,me){var _e=lt[3];_eme&&(_e=me);for(var Ae=(lt[3]-_e)/(lt[3]-qe[3]+1e-9),ke=[],Ee=0;Ee<4;Ee++)ke[Ee]=(1-Ae)*lt[Ee]+Ae*qe[Ee];return ke}function le(lt,qe,Ye){return lt>=qe&<<=Ye}function ce(lt){var qe=.001*(I-z);return lt>=z-qe&<<=I+qe}function pe(lt){for(var qe=[],Ye=0;Ye<4;Ye++){var me=lt[Ye];qe.push([p._x[me],p._y[me],p._z[me],p._value[me]])}return qe}var xe=3;function ye(lt,qe,Ye,me,_e,Ae){Ae||(Ae=1),Ye=[-1,-1,-1];var ke=!1,Ee=[le(qe[0][3],me,_e),le(qe[1][3],me,_e),le(qe[2][3],me,_e)];if(!Ee[0]&&!Ee[1]&&!Ee[2])return!1;var De=function(Ue,at,rt){return ce(at[0][3])&&ce(at[1][3])&&ce(at[2][3])?(K(Ue,at,rt),!0):AeEe?[R,Ae]:[Ae,P];Ke(qe,De[0],De[1])}}var Qe=[[Math.min(z,P),Math.max(z,P)],[Math.min(R,I),Math.max(R,I)]];["x","y","z"].forEach(function(Ue){for(var at=[],rt=0;rt0&&(gt.push(Lt.id),Ue==="x"?yt.push([Lt.distRatio,0,0]):Ue==="y"?yt.push([0,Lt.distRatio,0]):yt.push([0,0,Lt.distRatio]))}else Ue==="x"?fr=Pt(1,b-1):Ue==="y"?fr=Pt(1,E-1):fr=Pt(1,T-1);gt.length>0&&(Ue==="x"?at[ht]=Je(lt,gt,At,dt,yt,at[ht]):Ue==="y"?at[ht]=vt(lt,gt,At,dt,yt,at[ht]):at[ht]=xt(lt,gt,At,dt,yt,at[ht]),ht++),fr.length>0&&(Ue==="x"?at[ht]=ge(lt,fr,At,dt,at[ht]):Ue==="y"?at[ht]=Me(lt,fr,At,dt,at[ht]):at[ht]=Te(lt,fr,At,dt,at[ht]),ht++)}var Ct=p.caps[Ue];Ct.show&&Ct.fill&&(V(Ct.fill),Ue==="x"?at[ht]=ge(lt,[0,b-1],At,dt,at[ht]):Ue==="y"?at[ht]=Me(lt,[0,E-1],At,dt,at[ht]):at[ht]=Te(lt,[0,T-1],At,dt,at[ht]),ht++)}}),S===0&&Z(),p._meshX=L,p._meshY=B,p._meshZ=O,p._meshIntensity=G,p._Xs=w,p._Ys=k,p._Zs=A}return Mt(),p}function d(p,g){var m=p.glplot.gl,y=t({gl:m}),_=new u(p,y,g.uid);return y._trace=_,_.update(g),p.glplot.add(y),_}r.exports={findNearestOnAxis:n,generateIsoMeshes:h,createIsosurfaceTrace:d}}}),_Y=de({"src/traces/isosurface/index.js"(e,r){"use strict";r.exports={attributes:m4(),supplyDefaults:e7().supplyDefaults,calc:t7(),colorbar:{min:"cmin",max:"cmax"},plot:y4().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:E0(),categories:["gl3d","showLegend"],meta:{}}}}),xY=de({"lib/isosurface.js"(e,r){"use strict";r.exports=_Y()}}),r7=de({"src/traces/volume/attributes.js"(e,r){"use strict";var t=cs(),i=m4(),a=v_(),o=ri(),s=fn().extendFlat,l=Is().overrideAll,n=r.exports=l(s({x:i.x,y:i.y,z:i.z,value:i.value,isomin:i.isomin,isomax:i.isomax,surface:i.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:i.slices,caps:i.caps,text:i.text,hovertext:i.hovertext,xhoverformat:i.xhoverformat,yhoverformat:i.yhoverformat,zhoverformat:i.zhoverformat,valuehoverformat:i.valuehoverformat,hovertemplate:i.hovertemplate,hovertemplatefallback:i.hovertemplatefallback},t("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:i.colorbar,opacity:i.opacity,opacityscale:a.opacityscale,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");n.x.editType=n.y.editType=n.z.editType=n.value.editType="calc+clearAxisTypes"}}),bY=de({"src/traces/volume/defaults.js"(e,r){"use strict";var t=Qt(),i=r7(),a=e7().supplyIsoDefaults,o=QD().opacityscaleDefaults;r.exports=function(l,n,u,c){function f(h,d){return t.coerce(l,n,i,h,d)}a(l,n,u,c,f),o(l,n,c,f)}}}),wY=de({"src/traces/volume/convert.js"(e,r){"use strict";var t=ku().gl_mesh3d,i=Fp().parseColorScale,a=Qt().isArrayOrTypedArray,o=Lp(),s=Cs().extractOpts,l=R1(),n=y4().findNearestOnAxis,u=y4().generateIsoMeshes;function c(d,p,g){this.scene=d,this.uid=g,this.mesh=p,this.name="",this.data=null,this.showContour=!1}var f=c.prototype;f.handlePick=function(d){if(d.object===this.mesh){var p=d.data.index,g=this.data._meshX[p],m=this.data._meshY[p],y=this.data._meshZ[p],_=this.data._Ys.length,v=this.data._Zs.length,x=n(g,this.data._Xs).id,S=n(m,this.data._Ys).id,M=n(y,this.data._Zs).id,C=d.index=M+v*S+v*_*x;d.traceCoordinate=[this.data._meshX[C],this.data._meshY[C],this.data._meshZ[C],this.data._value[C]];var w=this.data.hovertext||this.data.text;return a(w)&&w[C]!==void 0?d.textLabel=w[C]:w&&(d.textLabel=w),!0}},f.update=function(d){var p=this.scene,g=p.fullSceneLayout;this.data=u(d);function m(S,M,C,w){return M.map(function(k){return S.d2l(k,0,w)*C})}var y=l(m(g.xaxis,d._meshX,p.dataScale[0],d.xcalendar),m(g.yaxis,d._meshY,p.dataScale[1],d.ycalendar),m(g.zaxis,d._meshZ,p.dataScale[2],d.zcalendar)),_=l(d._meshI,d._meshJ,d._meshK),v={positions:y,cells:_,lightPosition:[d.lightposition.x,d.lightposition.y,d.lightposition.z],ambient:d.lighting.ambient,diffuse:d.lighting.diffuse,specular:d.lighting.specular,roughness:d.lighting.roughness,fresnel:d.lighting.fresnel,vertexNormalsEpsilon:d.lighting.vertexnormalsepsilon,faceNormalsEpsilon:d.lighting.facenormalsepsilon,opacity:d.opacity,opacityscale:d.opacityscale,contourEnable:d.contour.show,contourColor:o(d.contour.color).slice(0,3),contourWidth:d.contour.width,useFacetNormals:d.flatshading},x=s(d);v.vertexIntensity=d._meshIntensity,v.vertexIntensityBounds=[x.min,x.max],v.colormap=i(d),this.mesh.update(v)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function h(d,p){var g=d.glplot.gl,m=t({gl:g}),y=new c(d,m,p.uid);return m._trace=y,y.update(p),d.glplot.add(m),y}r.exports=h}}),TY=de({"src/traces/volume/index.js"(e,r){"use strict";r.exports={attributes:r7(),supplyDefaults:bY(),calc:t7(),colorbar:{min:"cmin",max:"cmax"},plot:wY(),moduleType:"trace",name:"volume",basePlotModule:E0(),categories:["gl3d","showLegend"],meta:{}}}}),AY=de({"lib/volume.js"(e,r){"use strict";r.exports=TY()}}),MY=de({"src/traces/mesh3d/defaults.js"(e,r){"use strict";var t=Sa(),i=Qt(),a=hu(),o=I1();r.exports=function(l,n,u,c){function f(m,y){return i.coerce(l,n,o,m,y)}function h(m){var y=m.map(function(_){var v=f(_);return v&&i.isArrayOrTypedArray(v)?v:null});return y.every(function(_){return _&&_.length===y[0].length})&&y}var d=h(["x","y","z"]);if(!d){n.visible=!1;return}if(h(["i","j","k"]),n.i&&(!n.j||!n.k)||n.j&&(!n.k||!n.i)||n.k&&(!n.i||!n.j)){n.visible=!1;return}var p=t.getComponentMethod("calendars","handleTraceDefaults");p(l,n,["x","y","z"],c),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(m){f(m)});var g=f("contour.show");g&&(f("contour.color"),f("contour.width")),"intensity"in l?(f("intensity"),f("intensitymode"),a(l,n,c,f,{prefix:"",cLetter:"c"})):(n.showscale=!1,"facecolor"in l?f("facecolor"):"vertexcolor"in l?f("vertexcolor"):f("color",u)),f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),n._length=null}}}),SY=de({"src/traces/mesh3d/calc.js"(e,r){"use strict";var t=hc();r.exports=function(a,o){o.intensity&&t(a,o,{vals:o.intensity,containerStr:"",cLetter:"c"})}}}),EY=de({"src/traces/mesh3d/convert.js"(e,r){"use strict";var t=ku().gl_mesh3d,i=ku().delaunay_triangulate,a=ku().alpha_shape,o=ku().convex_hull,s=Fp().parseColorScale,l=Qt().isArrayOrTypedArray,n=Lp(),u=Cs().extractOpts,c=R1();function f(v,x,S){this.scene=v,this.uid=S,this.mesh=x,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;h.handlePick=function(v){if(v.object===this.mesh){var x=v.index=v.data.index;v.data._cellCenter?v.traceCoordinate=v.data.dataCoordinate:v.traceCoordinate=[this.data.x[x],this.data.y[x],this.data.z[x]];var S=this.data.hovertext||this.data.text;return l(S)&&S[x]!==void 0?v.textLabel=S[x]:S&&(v.textLabel=S),!0}};function d(v){for(var x=[],S=v.length,M=0;M=x-.5)return!1;return!0}h.update=function(v){var x=this.scene,S=x.fullSceneLayout;this.data=v;var M=v.x.length,C=c(p(S.xaxis,v.x,x.dataScale[0],v.xcalendar),p(S.yaxis,v.y,x.dataScale[1],v.ycalendar),p(S.zaxis,v.z,x.dataScale[2],v.zcalendar)),w;if(v.i&&v.j&&v.k){if(v.i.length!==v.j.length||v.j.length!==v.k.length||!y(v.i,M)||!y(v.j,M)||!y(v.k,M))return;w=c(g(v.i),g(v.j),g(v.k))}else v.alphahull===0?w=o(C):v.alphahull>0?w=a(v.alphahull,C):w=m(v.delaunayaxis,C);var k={positions:C,cells:w,lightPosition:[v.lightposition.x,v.lightposition.y,v.lightposition.z],ambient:v.lighting.ambient,diffuse:v.lighting.diffuse,specular:v.lighting.specular,roughness:v.lighting.roughness,fresnel:v.lighting.fresnel,vertexNormalsEpsilon:v.lighting.vertexnormalsepsilon,faceNormalsEpsilon:v.lighting.facenormalsepsilon,opacity:v.opacity,contourEnable:v.contour.show,contourColor:n(v.contour.color).slice(0,3),contourWidth:v.contour.width,useFacetNormals:v.flatshading};if(v.intensity){var A=u(v);this.color="#fff";var b=v.intensitymode;k[b+"Intensity"]=v.intensity,k[b+"IntensityBounds"]=[A.min,A.max],k.colormap=s(v)}else v.vertexcolor?(this.color=v.vertexcolor[0],k.vertexColors=d(v.vertexcolor)):v.facecolor?(this.color=v.facecolor[0],k.cellColors=d(v.facecolor)):(this.color=v.color,k.meshColor=n(v.color));this.mesh.update(k)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function _(v,x){var S=v.glplot.gl,M=t({gl:S}),C=new f(v,M,x.uid);return M._trace=C,C.update(x),v.glplot.add(M),C}r.exports=_}}),kY=de({"src/traces/mesh3d/index.js"(e,r){"use strict";r.exports={attributes:I1(),supplyDefaults:MY(),calc:SY(),colorbar:{min:"cmin",max:"cmax"},plot:EY(),moduleType:"trace",name:"mesh3d",basePlotModule:E0(),categories:["gl3d","showLegend"],meta:{}}}}),CY=de({"lib/mesh3d.js"(e,r){"use strict";r.exports=kY()}}),i7=de({"src/traces/cone/attributes.js"(e,r){"use strict";var t=cs(),i=Ns().axisHoverFormat,{hovertemplateAttrs:a,templatefallbackAttrs:o}=Vo(),s=I1(),l=ri(),n=fn().extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:o({editType:"calc"}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:n({},l.showlegend,{dflt:!1})};n(u,t("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var c=["opacity","lightposition","lighting"];c.forEach(function(f){u[f]=s[f]}),u.hoverinfo=n({},l.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),r.exports=u}}),DY=de({"src/traces/cone/defaults.js"(e,r){"use strict";var t=Qt(),i=hu(),a=i7();r.exports=function(s,l,n,u){function c(_,v){return t.coerce(s,l,a,_,v)}var f=c("u"),h=c("v"),d=c("w"),p=c("x"),g=c("y"),m=c("z");if(!f||!f.length||!h||!h.length||!d||!d.length||!p||!p.length||!g||!g.length||!m||!m.length){l.visible=!1;return}var y=c("sizemode");c("sizeref",y==="raw"?1:.5),c("anchor"),c("lighting.ambient"),c("lighting.diffuse"),c("lighting.specular"),c("lighting.roughness"),c("lighting.fresnel"),c("lightposition.x"),c("lightposition.y"),c("lightposition.z"),i(s,l,u,c,{prefix:"",cLetter:"c"}),c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("uhoverformat"),c("vhoverformat"),c("whoverformat"),c("xhoverformat"),c("yhoverformat"),c("zhoverformat"),l._length=null}}}),LY=de({"src/traces/cone/calc.js"(e,r){"use strict";var t=hc();r.exports=function(a,o){for(var s=o.u,l=o.v,n=o.w,u=Math.min(o.x.length,o.y.length,o.z.length,s.length,l.length,n.length),c=-1/0,f=1/0,h=0;h2?y=g.slice(1,m-1):m===2?y=[(g[0]+g[1])/2]:y=g,y}function h(g){var m=g.length;return m===1?[.5,.5]:[g[1]-g[0],g[m-1]-g[m-2]]}function d(g,m){var y=g.fullSceneLayout,_=g.dataScale,v=m._len,x={};function S(J,N){var H=y[N],$=_[n[N]];return a.simpleMap(J,function(U){return H.d2l(U)*$})}if(x.vectors=l(S(m._u,"xaxis"),S(m._v,"yaxis"),S(m._w,"zaxis"),v),!v)return{positions:[],cells:[]};var M=S(m._Xs,"xaxis"),C=S(m._Ys,"yaxis"),w=S(m._Zs,"zaxis");x.meshgrid=[M,C,w],x.gridFill=m._gridFill;var k=m._slen;if(k)x.startingPositions=l(S(m._startsX,"xaxis"),S(m._startsY,"yaxis"),S(m._startsZ,"zaxis"));else{for(var A=C[0],b=f(M),E=f(w),T=new Array(b.length*E.length),F=0,D=0;DA&&(A=F[0]),F[1]b&&(b=F[1])}function T(F){switch(F.type){case"GeometryCollection":F.geometries.forEach(T);break;case"Point":E(F.coordinates);break;case"MultiPoint":F.coordinates.forEach(E);break}}S.arcs.forEach(function(F){for(var D=-1,R=F.length,P;++DA&&(A=P[0]),P[1]b&&(b=P[1])});for(C in S.objects)T(S.objects[C]);return[w,k,A,b]}function s(S,M){for(var C,w=S.length,k=w-M;k<--w;)C=S[k],S[k++]=S[w],S[w]=C}function l(S,M){return typeof M=="string"&&(M=S.objects[M]),M.type==="GeometryCollection"?{type:"FeatureCollection",features:M.geometries.map(function(C){return n(S,C)})}:n(S,M)}function n(S,M){var C=M.id,w=M.bbox,k=M.properties==null?{}:M.properties,A=u(S,M);return C==null&&w==null?{type:"Feature",properties:k,geometry:A}:w==null?{type:"Feature",id:C,properties:k,geometry:A}:{type:"Feature",id:C,bbox:w,properties:k,geometry:A}}function u(S,M){var C=a(S.transform),w=S.arcs;function k(D,R){R.length&&R.pop();for(var P=w[D<0?~D:D],z=0,I=P.length;z1)w=d(S,M,C);else for(k=0,w=new Array(A=S.arcs.length);k1)for(var R=1,P=E(F[0]),z,I;RP&&(I=F[0],F[0]=F[R],F[R]=I,P=z);return F}).filter(function(T){return T.length>0})}}function y(S,M){for(var C=0,w=S.length;C>>1;S[k]=2))throw new Error("n must be \u22652");T=S.bbox||o(S);var C=T[0],w=T[1],k=T[2],A=T[3],b;M={scale:[k-C?(k-C)/(b-1):1,A-w?(A-w)/(b-1):1],translate:[C,w]}}else T=S.bbox;var E=v(M),T,F,D=S.objects,R={};function P(L){return E(L)}function z(L){var B;switch(L.type){case"GeometryCollection":B={type:"GeometryCollection",geometries:L.geometries.map(z)};break;case"Point":B={type:"Point",coordinates:P(L.coordinates)};break;case"MultiPoint":B={type:"MultiPoint",coordinates:L.coordinates.map(P)};break;default:return L}return L.id!=null&&(B.id=L.id),L.bbox!=null&&(B.bbox=L.bbox),L.properties!=null&&(B.properties=L.properties),B}function I(L){var B=0,O=1,G=L.length,W,X=new Array(G);for(X[0]=E(L[0],0);++B0&&(o.push(s),s=[])}return s.length>0&&o.push(s),o},e.makeLine=function(t){return t.length===1?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},e.makePolygon=function(t){if(t.length===1)return{type:"Polygon",coordinates:t};for(var i=new Array(t.length),a=0;a{for(var S in x)t(v,S,{get:x[S],enumerable:!0})},l=(v,x,S,M)=>{if(x&&typeof x=="object"||typeof x=="function")for(let C of a(x))!o.call(v,C)&&C!==S&&t(v,C,{get:()=>x[C],enumerable:!(M=i(x,C))||M.enumerable});return v},n=v=>l(t({},"__esModule",{value:!0}),v),u={};s(u,{COUNTRIES:()=>c,byAlpha2:()=>y,byAlpha3:()=>m,byM49:()=>_,createLookup:()=>h,lookup:()=>p,lookupAlpha3:()=>g,sanitize:()=>f}),r.exports=n(u);var c=[{iso3:"ABW",iso2:"AW",m49:"533",name:"Aruba",aliases:["\u{1F1E6}\u{1F1FC}","country of aruba","land aruba","pais aruba"]},{iso3:"AFG",iso2:"AF",m49:"004",name:"Afghanistan",aliases:["\u{1F1E6}\u{1F1EB}","affghanistan","affghanisthan","affghaunistan","afghania","afghanisthan","afghaunistan","afghaunistaun","afgoniston","de afghanistan islami jumhuriyat","owganystan","\u0430\u0444\u0493\u043E\u043D\u0438\u0441\u0442\u043E\u043D","\u0623\u0641\u063A\u0627\u0646\u0633\u062A\u0627\u0646","\u0627\u0641\u063A\u0627\u0646\u0633\u062A\u0627\u0646","\u062F \u0627\u0641\u063A\u0627\u0646\u0633\u062A\u0627\u0646 \u0627\u0633\u0644\u0627\u0645\u06CC \u062C\u0645\u0647\u0648\u0631\u06CC\u062A"]},{iso3:"AGO",iso2:"AO",m49:"024",name:"Angola",aliases:["\u{1F1E6}\u{1F1F4}","republic of angola","republica de angola"]},{iso3:"AIA",iso2:"AI",m49:"660",name:"Anguilla",aliases:["\u{1F1E6}\u{1F1EE}","malliouhana"]},{iso3:"ALA",iso2:"AX",m49:"248",name:"\xC5land Islands",aliases:["\u{1F1E6}\u{1F1FD}","aaland","aaland islands","ahvenanmaa","aland","aland isles","aland region","alands lan","landskapet aland"]},{iso3:"ALB",iso2:"AL",m49:"008",name:"Albania",aliases:["\u{1F1E6}\u{1F1F1}","peoples republic of albania","peoples socialist republic of albania","republic of albania","republika e shqiperise","shqiperi","shqiperia","shqiperise","socialist republic of albania"]},{iso3:"AND",iso2:"AD",m49:"020",name:"Andorra",aliases:["\u{1F1E6}\u{1F1E9}","el pais dels pirineus","les valls dandorra","principality of andorra","principality of the valleys of andorra","principat dandorra","valls dandorra"]},{iso3:"ARE",iso2:"AE",m49:"784",name:"United Arab Emirates",aliases:["\u{1F1E6}\u{1F1EA}","emirates","uae","\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062A","\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062A \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0645\u062A\u062D\u062F\u0629","\u0627\u0644\u0627\u0645\u0627\u0631\u0627\u062A","\u0627\u0644\u0627\u0645\u0627\u0631\u0627\u062A \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0645\u062A\u062D\u062F\u0629","\u062F\u0648\u0644\u0629 \u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062A \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0645\u062A\u062D\u062F\u0629"]},{iso3:"ARG",iso2:"AR",m49:"032",name:"Argentina",aliases:["\u{1F1E6}\u{1F1F7}","argentine republic","nacion argentina","republic of argentina","republica argentina"]},{iso3:"ARM",iso2:"AM",m49:"051",name:"Armenia",aliases:["\u{1F1E6}\u{1F1F2}","hayastan","hayastani hanrapetutyun","republic of armenia","\u0570\u0561\u0575\u0561\u057D\u057F\u0561\u0576","\u0570\u0561\u0575\u0561\u057D\u057F\u0561\u0576\u056B \u0570\u0561\u0576\u0580\u0561\u057A\u0565\u057F\u0578\u0582\u0569\u0575\u0578\u0582\u0576","\u0570\u0561\u0575\u0584","\u0570\u0570"]},{iso3:"ASM",iso2:"AS",m49:"016",name:"American Samoa",aliases:["\u{1F1E6}\u{1F1F8}","amerika samoa","east samoa","samoa american","samoa united states","territory of american samoa","us samoa"]},{iso3:"ATA",iso2:"AQ",m49:"010",name:"Antarctica",aliases:["\u{1F1E6}\u{1F1F6}","antarctica treaty area"]},{iso3:"ATF",iso2:"TF",m49:"260",name:"French Southern Territories",aliases:["\u{1F1F9}\u{1F1EB}","taaf","terres australes et antarctiques francaises","terres australes francaises","terres australes francaises les","territoire des terres australes et antarctiques francaises"]},{iso3:"ATG",iso2:"AG",m49:"028",name:"Antigua and Barbuda",aliases:["\u{1F1E6}\u{1F1EC}","antigua","antigua barbuda","barbuda"]},{iso3:"AUS",iso2:"AU",m49:"036",name:"Australia",aliases:["\u{1F1E6}\u{1F1FA}","commonwealth of australia","new holland","new hollandia","nova hollandia"]},{iso3:"AUT",iso2:"AT",m49:"040",name:"Austria",aliases:["\u{1F1E6}\u{1F1F9}","osterreich","republic of austria","republik osterreich","zweite republik"]},{iso3:"AZE",iso2:"AZ",m49:"031",name:"Azerbaijan",aliases:["\u{1F1E6}\u{1F1FF}","az\u0259rbaycan","az\u0259rbaycan respublikas\u0131","republic of azerbaijan"]},{iso3:"BDI",iso2:"BI",m49:"108",name:"Burundi",aliases:["\u{1F1E7}\u{1F1EE}","gouvernement du burundi","la republique du burundi","republic of burundi","republika yu burundi","republika yuburundi","republique du burundi","repuburika yuburundi","uburundi"]},{iso3:"BEL",iso2:"BE",m49:"056",name:"Belgium",aliases:["\u{1F1E7}\u{1F1EA}","belg","belgie","belgien","belgique","kingdom of belgium","konigreich belgien","koninkrijk belgie","royaume de belgique"]},{iso3:"BEN",iso2:"BJ",m49:"204",name:"Benin",aliases:["\u{1F1E7}\u{1F1EF}","dahomey","la republique du benin","republic of benin","republique du benin"]},{iso3:"BES",iso2:"BQ",m49:"535",name:"Bonaire, Sint Eustatius and Saba",aliases:["\u{1F1E7}\u{1F1F6}","bes eilanden","bes islands","bijzondere gemeente","bonaire","bonaire saint eustatius and saba","bonaire sint eustatius en saba","caraibisch nederland","caribbean netherlands","caribisch nederland","hulanda karibense","islanan bes","netherlands antilles","saba","sint eustatius"]},{iso3:"BFA",iso2:"BF",m49:"854",name:"Burkina Faso",aliases:["\u{1F1E7}\u{1F1EB}","republic of burkina faso","republic of upper volta"]},{iso3:"BGD",iso2:"BD",m49:"050",name:"Bangladesh",aliases:["\u{1F1E7}\u{1F1E9}","bangla desh","east pakistan","gonaoprojatontri bangladesh","peoples republic of bangladesh","\u0997\u09A3\u09AA\u09CD\u09B0\u099C\u09BE\u09A4\u09A8\u09CD\u09A4\u09CD\u09B0\u09C0 \u09AC\u09BE\u0982\u09B2\u09BE\u09A6\u09C7\u09B6","\u09AC\u09BE\u0982\u09B2\u09BE \u09A6\u09C7\u09B6","\u09AC\u09BE\u0982\u09B2\u09BE\u09A6\u09C7\u09B6","\u09AC\u09BF\u09A1\u09BF"]},{iso3:"BGR",iso2:"BG",m49:"100",name:"Bulgaria",aliases:["\u{1F1E7}\u{1F1EC}","bulgarian republic","republic of bulgaria","republika bulgaria","republika bulgariya","\u0431\u0433","\u0431\u044A\u043B\u0433\u0430\u0440\u0438\u044F","\u0440\u0435\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u0431\u044A\u043B\u0433\u0430\u0440\u0438\u044F"]},{iso3:"BHR",iso2:"BH",m49:"048",name:"Bahrain",aliases:["\u{1F1E7}\u{1F1ED}","bahrein islands","kingdom of bahrain","\u0627\u0644\u0628\u062D\u0631\u064A\u0646","\u062F\u0648\u0644\u0629 \u0627\u0644\u0628\u062D\u0631\u064A\u0646","\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0628\u062D\u0631\u064A\u0646"]},{iso3:"BHS",iso2:"BS",m49:"044",name:"Bahamas",aliases:["\u{1F1E7}\u{1F1F8}","bahama islands","bahamas the","commonwealth of the bahamas"]},{iso3:"BIH",iso2:"BA",m49:"070",name:"Bosnia and Herzegovina",aliases:["\u{1F1E7}\u{1F1E6}","bosna","bosna i hercegovina","bosnia","bosnia and hercegovina","bosnia herzegovina","hercegovina","herzegovina","\u0431\u0438\u0445","\u0431\u043E\u0441\u043D\u0430","\u0431\u043E\u0441\u043D\u0430 \u0438 \u0445\u0435\u0440\u0446\u0435\u0433\u043E\u0432\u0438\u043D\u0430","\u0431\u0445"]},{iso3:"BLM",iso2:"BL",m49:"652",name:"Saint Barth\xE9lemy",aliases:["\u{1F1E7}\u{1F1F1}","collectivite doutre mer de saint barthelemy","collectivite territoriale de saint barthelemy","collectivity of saint barthelemy","saint barth","saint barths","saint barts","saint bartz"]},{iso3:"BLR",iso2:"BY",m49:"112",name:"Belarus",aliases:["\u{1F1E7}\u{1F1FE}","republic of belarus","respublika belarus","respublika byelarus","\u0431\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F \u0440\u044D\u0441\u043F\u0443\u0431\u043B\u0456\u043A\u0430","\u0431\u0435\u043B\u0430\u0440\u0443\u0441\u044C","\u0431\u0435\u043B\u0430\u044F \u0440\u0443\u0441\u044C","\u0431\u0435\u043B\u043E\u0440\u0443\u0441\u0441\u0438\u044F","\u0440\u0431","\u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u0431\u0435\u043B\u0430\u0440\u0443\u0441\u044C","\u0440\u044D\u0441\u043F\u0443\u0431\u043B\u0456\u043A\u0430 \u0431\u0435\u043B\u0430\u0440\u0443\u0441\u044C"]},{iso3:"BLZ",iso2:"BZ",m49:"084",name:"Belize",aliases:["\u{1F1E7}\u{1F1FF}"]},{iso3:"BMU",iso2:"BM",m49:"060",name:"Bermuda",aliases:["\u{1F1E7}\u{1F1F2}","barmuda","barmuda i","barmuda isl","barmuda islands","barmudas","bermoothes","bermuda islands","bermudas","bermudian islands","colony of bermuda","devils isles","isle of devils","somers islands","somers isles","summers isles","territory of bermuda","virgineola"]},{iso3:"BOL",iso2:"BO",m49:"068",name:"Bolivia (Plurinational State of)",aliases:["\u{1F1E7}\u{1F1F4}","bolivia","bulibiya","estado plurinacional de bolivia","plurinational state of bolivia","puliwya","republic of bolivia","republica de bolivia","volivia","wuliwiya","wuliwya"]},{iso3:"BRA",iso2:"BR",m49:"076",name:"Brazil",aliases:["\u{1F1E7}\u{1F1F7}","brasil","federative republic of brazil","pindorama","republica federativa do brasil"]},{iso3:"BRB",iso2:"BB",m49:"052",name:"Barbados",aliases:["\u{1F1E7}\u{1F1E7}","barbadoes"]},{iso3:"BRN",iso2:"BN",m49:"096",name:"Brunei Darussalam",aliases:["\u{1F1E7}\u{1F1F3}","brunei","nation of brunei the abode of peace","negara brunei darussalam"]},{iso3:"BTN",iso2:"BT",m49:"064",name:"Bhutan",aliases:["\u{1F1E7}\u{1F1F9}","kingdom of bhutan","\u0F60\u0F56\u0FB2\u0F74\u0F42","\u0F60\u0F56\u0FB2\u0F74\u0F42\u0F0B\u0F61\u0F74\u0F63\u0F0B","\u0F60\u0F56\u0FB2\u0F74\u0F42\u0F61\u0F74\u0F63\u0F0B\u0F0B"]},{iso3:"BVT",iso2:"BV",m49:"074",name:"Bouvet Island",aliases:["\u{1F1E7}\u{1F1FB}"]},{iso3:"BWA",iso2:"BW",m49:"072",name:"Botswana",aliases:["\u{1F1E7}\u{1F1FC}","lefatshe la botswana","republic of botswana"]},{iso3:"CAF",iso2:"CF",m49:"140",name:"Central African Republic",aliases:["\u{1F1E8}\u{1F1EB}","centrafricaine republique","centrafrique","central africa","kodorosese ti beafrika","la republique","rep centrafrique","republique centrafricaine"]},{iso3:"CAN",iso2:"CA",m49:"124",name:"Canada",aliases:["\u{1F1E8}\u{1F1E6}","le canada"]},{iso3:"CCK",iso2:"CC",m49:"166",name:"Cocos (Keeling) Islands",aliases:["\u{1F1E8}\u{1F1E8}","cocos islands","keeling islands","territory of the cocos keeling islands"]},{iso3:"CHE",iso2:"CH",m49:"756",name:"Switzerland",aliases:["\u{1F1E8}\u{1F1ED}","confederation helvetique","confederation suisse","confederazione elvetica","confederazione svizzera","confederaziun svizra","confoederatio helvetica","conf\u0153deratio helvetica","eidgenossenschaft","elvezia","helvetie","la confederation suisse","schweiz","schweizerische eidgenossenschaft","suisse","svizra","svizzera","swiss","swiss confederation"]},{iso3:"CHL",iso2:"CL",m49:"152",name:"Chile",aliases:["\u{1F1E8}\u{1F1F1}","republic of chile","republica de chile"]},{iso3:"CHN",iso2:"CN",m49:"156",name:"China",aliases:["\u{1F1E8}\u{1F1F3}","china pr","peoples republic of china","pr china","prc","\u4E2D\u534E\u4EBA\u6C11\u5171\u548C\u56FD","\u4E2D\u56FD"]},{iso3:"CIV",iso2:"CI",m49:"384",name:"C\xF4te d'Ivoire",aliases:["\u{1F1E8}\u{1F1EE}","cote ivoire","ivory coast","republic of cote divoire","republic of ivory coast","republic of the ivory coast","republique de cote divoire"]},{iso3:"CMR",iso2:"CM",m49:"120",name:"Cameroon",aliases:["\u{1F1E8}\u{1F1F2}","cameroun","la republique du cameroun","republic of cameroon","republique du cameroun"]},{iso3:"COD",iso2:"CD",m49:"180",name:"Democratic Republic of the Congo",aliases:["\u{1F1E8}\u{1F1E9}","congo belge","congo democratic republic of the","congo kinshasa","dem rep congo","dem republic of congo","dem republic of the congo","democratic republic of congo","dr congo","drc","rd congo","rep demcongo","republic of the congo","republique democratique du congo","republique du zaire","zaire"]},{iso3:"COG",iso2:"CG",m49:"178",name:"Congo",aliases:["\u{1F1E8}\u{1F1EC}","congo brazza","congo brazzaville","congo republic","rep congo","republic of congo","republique du congo"]},{iso3:"COK",iso2:"CK",m49:"184",name:"Cook Islands",aliases:["\u{1F1E8}\u{1F1F0}","cook group","hervey islands"]},{iso3:"COL",iso2:"CO",m49:"170",name:"Colombia",aliases:["\u{1F1E8}\u{1F1F4}","republic of colombia","republica de colombia"]},{iso3:"COM",iso2:"KM",m49:"174",name:"Comoros",aliases:["\u{1F1F0}\u{1F1F2}","comores","comores archipel","etat comorien","lunion des comores","republique des comores","republique federale et islamique des comores","republique federale islamique des comores","territoire des comores","union des comores","union of the comoros","\u0625\u062A\u062D\u0627\u062F \u0627\u0644\u0642\u0645\u0631","\u0627\u062A\u062D\u0627\u062F \u062C\u0632\u0631 \u0627\u0644\u0642\u0645\u0631","\u0627\u0644\u0627\u062A\u062D\u0627\u062F \u0627\u0644\u0642\u0645\u0631\u064A","\u0627\u0644\u0642\u0645\u0631","\u062C\u0632\u0631 \u0627\u0644\u0642\u0645\u0631","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0642\u0645\u0631 \u0627\u0644\u0645\u062A\u062D\u062F\u0629","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u062C\u0632\u0631 \u0627\u0644\u0642\u0645\u0631 \u0627\u0644\u0627\u062A\u062D\u0627\u062F\u064A\u0629 \u0627\u0644\u0625\u0633\u0644\u0627\u0645\u064A\u0629","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u062C\u0632\u0631\u0627\u0644\u0642\u0645\u0631 \u0627\u0644\u0645\u062A\u062D\u062F\u0629"]},{iso3:"CPV",iso2:"CV",m49:"132",name:"Cabo Verde",aliases:["\u{1F1E8}\u{1F1FB}","cape verde","cape verde islands","kab verd","kabu verdi","kauberdi","republic of cabo verde","republic of cape verde","republica de cabo verde"]},{iso3:"CRI",iso2:"CR",m49:"188",name:"Costa Rica",aliases:["\u{1F1E8}\u{1F1F7}","republic of costa rica","republica de costa rica"]},{iso3:"CUB",iso2:"CU",m49:"192",name:"Cuba",aliases:["\u{1F1E8}\u{1F1FA}","isla juana","republic of cuba","republica de cuba"]},{iso3:"CUW",iso2:"CW",m49:"531",name:"Cura\xE7ao",aliases:["\u{1F1E8}\u{1F1FC}","corsou","corsouw","corsow","country of curacao","curacau","curacoa","curazao","cura\u03C2ao","curocao","island territory of curacao","korsou","land curacao","pais korsou"]},{iso3:"CXR",iso2:"CX",m49:"162",name:"Christmas Island",aliases:["\u{1F1E8}\u{1F1FD}","christmas island other territories","christmas island other territories australia","territory of christmas island"]},{iso3:"CYM",iso2:"KY",m49:"136",name:"Cayman Islands",aliases:["\u{1F1F0}\u{1F1FE}","caymans"]},{iso3:"CYP",iso2:"CY",m49:"196",name:"Cyprus",aliases:["\u{1F1E8}\u{1F1FE}","greek administration of southern cyprus","greek cypriot state","guney k\u0131br\u0131s","guney k\u0131br\u0131s rum cumhuriyeti","guney k\u0131br\u0131s rum kesimi","guney k\u0131br\u0131s rum yonetimi","kipriaki dhimokratia","k\u0131br\u0131s","k\u0131br\u0131s cumhuriyeti","k\u0131br\u0131s rum kesimi","kypriaki dimokratia","kypros","republic of cyprus","\u03BA\u03C5\u03C0\u03C1\u03B9\u03B1\u03BA\u03B7 \u03B4\u03B7\u03BC\u03BF\u03BA\u03C1\u03B1\u03C4\u03B9\u03B1","\u03BA\u03C5\u03C0\u03C1\u03BF\u03C2"]},{iso3:"CZE",iso2:"CZ",m49:"203",name:"Czechia",aliases:["\u{1F1E8}\u{1F1FF}","ceska republika","ceske kraje","ceske uzemi","ceske zeme","cesko","cr","czech republic"]},{iso3:"DEU",iso2:"DE",m49:"276",name:"Germany",aliases:["\u{1F1E9}\u{1F1EA}","br deutschland","bundesrepublik","bundesrepublik deutschland","deutschland","federal republic of germany"]},{iso3:"DJI",iso2:"DJ",m49:"262",name:"Djibouti",aliases:["\u{1F1E9}\u{1F1EF}","la republique de djibouti","republic of djibouti","republique de djibouti","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u062C\u064A\u0628\u0648\u062A\u064A","\u062C\u064A\u0628\u0648\u062A\u064A"]},{iso3:"DMA",iso2:"DM",m49:"212",name:"Dominica",aliases:["\u{1F1E9}\u{1F1F2}","commonwealth of dominica","island of dominica","waitu kubuli"]},{iso3:"DNK",iso2:"DK",m49:"208",name:"Denmark",aliases:["\u{1F1E9}\u{1F1F0}","dania","danmark","denmark proper","kongeriget danmark","metropolitan denmark"]},{iso3:"DOM",iso2:"DO",m49:"214",name:"Dominican Republic",aliases:["\u{1F1E9}\u{1F1F4}","dominicana","domrep","haiti espanol","quisqueya","republica de santo domingo","republica dominicana","santo domingo"]},{iso3:"DZA",iso2:"DZ",m49:"012",name:"Algeria",aliases:["\u{1F1E9}\u{1F1FF}","peoples democratic republic of algeria","\u0627\u0644\u062C\u0632\u0627\u0626\u0631","\u0627\u0644\u062C\u0632\u0627\u064A\u0631","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u062C\u0632\u0627\u0626\u0631\u064A\u0629 \u0627\u0644\u062F\u064A\u0645\u0642\u0631\u0627\u0637\u064A\u0629 \u0627\u0644\u0634\u0639\u0628\u064A\u0629","\u0627\u0644\u062F\u0632\u0627\u064A\u0631","\u062F\u0632\u0627\u064A\u0631"]},{iso3:"ECU",iso2:"EC",m49:"218",name:"Ecuador",aliases:["\u{1F1EA}\u{1F1E8}","ecuadorian state","el ecuador","estado ecuatoriano","republic of ecuador","republic of equator","republic of the equator","republica del ecuador"]},{iso3:"EGY",iso2:"EG",m49:"818",name:"Egypt",aliases:["\u{1F1EA}\u{1F1EC}","arab rep egypt","arab republic of egypt","rep egypt","republic of egypt","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0645\u0635\u0631 \u0627\u0644\u0639\u0631\u0628\u064A\u0629","\u0645\u0635\u0631"]},{iso3:"ERI",iso2:"ER",m49:"232",name:"Eritrea",aliases:["\u{1F1EA}\u{1F1F7}","ertra","hagere ertra","hagere iertra","iertra","iritriya","state of eritrea","\u0625\u0631\u062A\u0631\u064A\u0627","\u0625\u0631\u064A\u062A\u0631\u064A\u0627","\u0627\u0631\u062A\u0631\u064A\u0627","\u0627\u0631\u062A\u064A\u0631\u064A\u0627","\u0627\u0631\u064A\u062A\u0631\u064A\u0627","\u062F\u0648\u0644\u0629 \u0625\u0631\u062A\u0631\u064A\u0627","\u062F\u0648\u0644\u0629 \u0625\u0631\u064A\u062A\u0631\u064A\u0627","\u1203\u1308\u1228 \u12A4\u122D\u1275\u122B","\u12A4\u122D\u1275\u122B"]},{iso3:"ESH",iso2:"EH",m49:"732",name:"Western Sahara",aliases:["\u{1F1EA}\u{1F1ED}","southern provinces","spanish sahara","west sahara"]},{iso3:"ESP",iso2:"ES",m49:"724",name:"Spain",aliases:["\u{1F1EA}\u{1F1F8}","espana","estado espanol","kingdom of spain","reino de espana"]},{iso3:"EST",iso2:"EE",m49:"233",name:"Estonia",aliases:["\u{1F1EA}\u{1F1EA}","eesti","eesti noukogude sotsialistlik vabariik","eesti vabariik","estland","republic of estonia"]},{iso3:"ETH",iso2:"ET",m49:"231",name:"Ethiopia",aliases:["\u{1F1EA}\u{1F1F9}","federal democratic republic of ethiopia","ityopiya","yeityopiya federalawi demokrasiyawi ripeblik","yeityopiya hizbawi dimokrasiyawi ripublik","\u12A2\u1275\u12EE\u1335\u12EB","\u12E8\u12A2\u1275\u12EE\u1335\u12EB \u134C\u12F4\u122B\u120B\u12CA \u12F4\u121E\u12AD\u122B\u1232\u12EB\u12CA \u122A\u1350\u1265\u120A\u12AD"]},{iso3:"FIN",iso2:"FI",m49:"246",name:"Finland",aliases:["\u{1F1EB}\u{1F1EE}","republic of finland","republiken finland","suomen tasavalta","suomi"]},{iso3:"FJI",iso2:"FJ",m49:"242",name:"Fiji",aliases:["\u{1F1EB}\u{1F1EF}","fiji ganarajya","matanitu ko viti","matanitu tugalala o viti","republic of fiji","republic of the fiji islands","viti"]},{iso3:"FLK",iso2:"FK",m49:"238",name:"Falkland Islands (Malvinas)",aliases:["\u{1F1EB}\u{1F1F0}","colony of the falkland islands","falkland islands","falklands","islas malvinas","malvinas","malvinas islands"]},{iso3:"FRA",iso2:"FR",m49:"250",name:"France",aliases:["\u{1F1EB}\u{1F1F7}","fr","french republic","la france","la republique francaise","lhexagone","republique francaise"]},{iso3:"FRO",iso2:"FO",m49:"234",name:"Faroe Islands",aliases:["\u{1F1EB}\u{1F1F4}","faer oer","f\xE6r\xF8","faeroe is","faeroe islands","faeroe isles","f\xE6r\xF8erne","faeroes","far oer","faroe island","faroe isles","faroes","faroese islands","f\xF8roya","f\xF8royar","f\xF8royum"]},{iso3:"FSM",iso2:"FM",m49:"583",name:"Micronesia (Federated States of)",aliases:["\u{1F1EB}\u{1F1F2}","fed sts micronesia","fed sts of micronesia","federated states of micronesia","federated states of micronesia fsm","micronesia"]},{iso3:"GAB",iso2:"GA",m49:"266",name:"Gabon",aliases:["\u{1F1EC}\u{1F1E6}","gabonese republic","la republique gabonaise","le gabon","republique du gabon","republique gabonaise"]},{iso3:"GBR",iso2:"GB",m49:"826",name:"United Kingdom of Great Britain and Northern Ireland",aliases:["\u{1F1EC}\u{1F1E7}","britain","england","great britain","great britain and northern ireland","northern ireland","scotland","uk","united kingdom","wales"]},{iso3:"GEO",iso2:"GE",m49:"268",name:"Georgia",aliases:["\u{1F1EC}\u{1F1EA}","georgia country","republic of georgia","sakartvelo","\u049B\u044B\u0440\u04AD\u0442\u04D9\u044B\u043B\u0430","\u10E1\u10D0\u10E5\u10D0\u10E0\u10D7\u10D5\u10D4\u10DA\u10DD","\u10E1\u10D0\u10E5\u10D0\u10E0\u10D7\u10D5\u10D4\u10DA\u10DD\u10E1 \u10E0\u10D4\u10E1\u10DE\u10E3\u10D1\u10DA\u10D8\u10D9\u10D0"]},{iso3:"GGY",iso2:"GG",m49:"831",name:"Guernsey",aliases:["\u{1F1EC}\u{1F1EC}","bailiwick of guernsey","bailliage de guernesey","bailliage de guernesi","giernesi","great britain guernsey","guernesey","lisia"]},{iso3:"GHA",iso2:"GH",m49:"288",name:"Ghana",aliases:["\u{1F1EC}\u{1F1ED}","republic of ghana"]},{iso3:"GIB",iso2:"GI",m49:"292",name:"Gibraltar",aliases:["\u{1F1EC}\u{1F1EE}","rock of gibraltar"]},{iso3:"GIN",iso2:"GN",m49:"324",name:"Guinea",aliases:["\u{1F1EC}\u{1F1F3}","guinee","guinee conakry","republic of guinea","republique de guinee"]},{iso3:"GLP",iso2:"GP",m49:"312",name:"Guadeloupe",aliases:["\u{1F1EC}\u{1F1F5}"]},{iso3:"GMB",iso2:"GM",m49:"270",name:"Gambia",aliases:["\u{1F1EC}\u{1F1F2}","islamic republic of the gambia","republic of the gambia"]},{iso3:"GNB",iso2:"GW",m49:"624",name:"Guinea-Bissau",aliases:["\u{1F1EC}\u{1F1FC}","guine bissau","republic of guinea bissau","republica da guine bissau"]},{iso3:"GNQ",iso2:"GQ",m49:"226",name:"Equatorial Guinea",aliases:["\u{1F1EC}\u{1F1F6}","guine equatorial","guinea ecuatorial","guinea espanola","guinee equat","guinee equatoriale","la republique de guinee equatoriale","posesiones espanolas del golfo de guinea","provincia de la guinea ecuatorial","republic of equatorial guinea","republica da guine equatorial","republica de guinea ecuatorial","territorios espanoles del golfo de guinea"]},{iso3:"GRC",iso2:"GR",m49:"300",name:"Greece",aliases:["\u{1F1EC}\u{1F1F7}","ellada","ellas","elliniki dhimokratia","elliniki dimokratia","greek republic","hellas","hellas greece","hellenic republic","vasilion tis ellados","\u03B4\u03B7\u03BC\u03BF\u03BA\u03C1\u03B1\u03C4\u03B9\u03B1 \u03C4\u03B7\u03C2 \u03B5\u03BB\u03BB\u03B1\u03B4\u03B1\u03C2","\u03B4\u03B7\u03BC\u03BF\u03BA\u03C1\u03B1\u03C4\u03B9\u03B1 \u03C4\u03B7\u03C2 \u03B5\u03BB\u03BB\u03B1\u03B4\u03BF\u03C2","\u03B5\u03BB\u03BB\u03B1\u03B4\u03B1","\u03B5\u03BB\u03BB\u03B1\u03C2","\u03B5\u03BB\u03BB\u03B1\u03C2 \u03B5\u03BB\u03BB\u03B1\u03B4\u03B1","\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03B7 \u03B4\u03B7\u03BC\u03BF\u03BA\u03C1\u03B1\u03C4\u03B9\u03B1"]},{iso3:"GRD",iso2:"GD",m49:"308",name:"Grenada",aliases:["\u{1F1EC}\u{1F1E9}"]},{iso3:"GRL",iso2:"GL",m49:"304",name:"Greenland",aliases:["\u{1F1EC}\u{1F1F1}","kalaallit nunaat"]},{iso3:"GTM",iso2:"GT",m49:"320",name:"Guatemala",aliases:["\u{1F1EC}\u{1F1F9}","republic of guatemala","republica de guatemala"]},{iso3:"GUF",iso2:"GF",m49:"254",name:"French Guiana",aliases:["\u{1F1EC}\u{1F1EB}","fr 973","guiana","guiana france","guyane","guyane francaise","gwiyann","gwiyann franse","lagwiyann"]},{iso3:"GUM",iso2:"GU",m49:"316",name:"Guam",aliases:["\u{1F1EC}\u{1F1FA}","guahan","guam usa","islan guahan","island of guam","territory of guam"]},{iso3:"GUY",iso2:"GY",m49:"328",name:"Guyana",aliases:["\u{1F1EC}\u{1F1FE}","co operative republic of guyana","republic of guyana"]},{iso3:"HKG",iso2:"HK",m49:"344",name:"Hong Kong",aliases:["\u{1F1ED}\u{1F1F0}","hksar","hong kong sar","hong kong special administrative region","hong kong special administrative region of the peoples republic of china","hongkong"]},{iso3:"HMD",iso2:"HM",m49:"334",name:"Heard Island and McDonald Islands",aliases:["\u{1F1ED}\u{1F1F2}","heard","heard & mcdonald islands","heard and macdonald islands","heard island","himi","mcdonald","mcdonald island","territory of heard island and mcdonald islands"]},{iso3:"HND",iso2:"HN",m49:"340",name:"Honduras",aliases:["\u{1F1ED}\u{1F1F3}","guaymuras","higueras","honduran republic","republic of honduras","republica de honduras"]},{iso3:"HRV",iso2:"HR",m49:"191",name:"Croatia",aliases:["\u{1F1ED}\u{1F1F7}","hrvatska","republic of croatia","republika hrvatska"]},{iso3:"HTI",iso2:"HT",m49:"332",name:"Haiti",aliases:["\u{1F1ED}\u{1F1F9}","ayiti","haitian republic","la republique dhaiti","repiblik d ayiti","republic of haiti","republique dhaiti"]},{iso3:"HUN",iso2:"HU",m49:"348",name:"Hungary",aliases:["\u{1F1ED}\u{1F1FA}","a magyar koztarsasag","a magyar nepkoztarsasag","harmadik magyar koztarsasag","magyar koztarsasag","magyar nepkoztarsasag","magyarorszag","mo"]},{iso3:"IDN",iso2:"ID",m49:"360",name:"Indonesia",aliases:["\u{1F1EE}\u{1F1E9}","negara kesatuan republik indonesia","nkri","republic of indonesia","republik indonesia"]},{iso3:"IMN",iso2:"IM",m49:"833",name:"Isle of Man",aliases:["\u{1F1EE}\u{1F1F2}","ellan vannin","i man","i mann","i mannin","isle of mann","mann","mannin","manx"]},{iso3:"IND",iso2:"IN",m49:"356",name:"India",aliases:["\u{1F1EE}\u{1F1F3}","al hind","bharat","bharat ganarajya","bharata","bharatvarsh","hindoostan","hindustan","indostan","republic of india","tenjiku","tianzhu","\u0906\u0930\u094D\u092F\u0935\u0930\u094D\u0924","\u0907\u0902\u0921\u093F\u092F\u093E","\u0907\u0923\u094D\u0921\u093F\u092F\u093E","\u092D\u093E\u0930\u0924","\u092D\u093E\u0930\u0924 \u0917\u0923\u0930\u093E\u091C\u094D\u092F","\u092D\u093E\u0930\u0924\u0935\u0930\u094D\u0937","\u0939\u093F\u0902\u0926\u0941\u0938\u094D\u0924\u093E\u0928","\u0939\u093F\u0928\u094D\u0926\u0941\u0938\u094D\u0924\u093E\u0928","\u0939\u093F\u0928\u094D\u0926\u094B\u0938\u094D\u0924\u093E\u0928"]},{iso3:"IOT",iso2:"IO",m49:"086",name:"British Indian Ocean Territory",aliases:["\u{1F1EE}\u{1F1F4}","biot"]},{iso3:"IRL",iso2:"IE",m49:"372",name:"Ireland",aliases:["\u{1F1EE}\u{1F1EA}","eire","hibernia","irish republic","poblacht na heireann","republic of ireland","southern ireland"]},{iso3:"IRN",iso2:"IR",m49:"364",name:"Iran (Islamic Republic of)",aliases:["\u{1F1EE}\u{1F1F7}","iran","islamic rep iran","islamic republic of iran","persia","\u0627\u06CC\u0631\u0627\u0646","\u0627\u06CC\u0631\u0627\u0646\u0632\u0645\u06CC\u0646","\u067E\u0627\u0631\u0633","\u062C\u0645\u0647\u0648\u0631\u06CC \u0627\u0633\u0644\u0627\u0645\u06CC \u0627\u064A\u0631\u0627\u0646","\u062C\u0645\u0647\u0648\u0631\u06CC \u0627\u0633\u0644\u0627\u0645\u06CC \u0627\u06CC\u0631\u0627\u0646","\u0643\u0634\u0648\u0631 \u0634\u0627\u0647\u0646\u0634\u0627\u0647\u06CC \u0627\u064A\u0631\u0627\u0646"]},{iso3:"IRQ",iso2:"IQ",m49:"368",name:"Iraq",aliases:["\u{1F1EE}\u{1F1F6}","eraq","iraqe","komar i eraq","republic of iraq","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0639\u0631\u0627\u0642\u064A\u0629","\u0627\u0644\u0639\u0631\u0627\u0642","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0639\u0631\u0627\u0642","\u0639\u0631\u0627\u0642","\u0639\u06CE\u0631\u0627\u0642"]},{iso3:"ISL",iso2:"IS",m49:"352",name:"Iceland",aliases:["\u{1F1EE}\u{1F1F8}","icelandic republic","island","ly\xF0veldi\xF0 island","republic of iceland","ysland"]},{iso3:"ISR",iso2:"IL",m49:"376",name:"Israel",aliases:["\u{1F1EE}\u{1F1F1}","erez yisrael","medinat yisrael","state of israel","yisrael","\u05D9\u05E9\u05E8\u05D0\u05DC","\u05DE\u05D3\u05D9\u05E0\u05EA \u05D9\u05E9\u05E8\u05D0\u05DC"]},{iso3:"ITA",iso2:"IT",m49:"380",name:"Italy",aliases:["\u{1F1EE}\u{1F1F9}","il bel paese","italia","italian republic","repubblica italiana","republic of italy"]},{iso3:"JAM",iso2:"JM",m49:"388",name:"Jamaica",aliases:["\u{1F1EF}\u{1F1F2}","commonwealth of jamaica","jamieka","jomieka","jumieka"]},{iso3:"JEY",iso2:"JE",m49:"832",name:"Jersey",aliases:["\u{1F1EF}\u{1F1EA}","bailliage de jerri","bailliage de jersey","balliwick of jersey","i iersey","i jersey","iersey","iersey i","isle of jersey","jerri","jersey i","jersey island"]},{iso3:"JOR",iso2:"JO",m49:"400",name:"Jordan",aliases:["\u{1F1EF}\u{1F1F4}","giordania","hashemite kingdom of jordan","kingdom of jordan","state of jordan","yarden","\u0627\u0644\u0623\u0631\u062F\u0646","\u0627\u0644\u0627\u0631\u062F\u0646","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0623\u0631\u062F\u0646\u064A\u0629 \u0627\u0644\u0647\u0627\u0634\u0645\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0627\u0631\u062F\u0646\u064A\u0629 \u0627\u0644\u0647\u0627\u0634\u0645\u064A\u0629"]},{iso3:"JPN",iso2:"JP",m49:"392",name:"Japan",aliases:["\u{1F1EF}\u{1F1F5}","state of japan","\u3042\u304D\u3064\u3057\u307E","\u304A\u304A\u3084\u3057\u307E","\u3057\u304D\u3057\u307E","\u30B8\u30E3\u30D1\u30F3","\u3057\u3093\u3057\u3085\u3046","\u306B\u3063\u307D\u3093","\u306B\u3063\u307D\u3093\u3053\u304F","\u306B\u307B\u3093","\u306B\u307B\u3093\u3053\u304F","\u3072\u3044\u305A\u308B\u304F\u306B","\u3075\u305D\u3046","\u5927\u516B\u5DDE","\u6276\u6728\u4E4B\u5730","\u6276\u6851","\u6276\u6851\u56FD","\u6577\u5CF6","\u65E5\u51FA\u308B\u56FD","\u65E5\u672C","\u6991\u6728\u4E4B\u5730","\u745E\u7A42\u56FD","\u795E\u5DDE","\u79CB\u6D25\u5CF6","\u8466\u539F\u4E2D\u56FD"]},{iso3:"KAZ",iso2:"KZ",m49:"398",name:"Kazakhstan",aliases:["\u{1F1F0}\u{1F1FF}","qazaqstan","qazaqstan respublikasy","republic of kazakhstan","\u043A\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043D","\u049B\u0430\u0437\u0430\u049B\u0441\u0442\u0430\u043D","\u049B\u0430\u0437\u0430\u049B\u0441\u0442\u0430\u043D \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u0441\u044B","\u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u043A\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043D","\u0440\u043A"]},{iso3:"KEN",iso2:"KE",m49:"404",name:"Kenya",aliases:["\u{1F1F0}\u{1F1EA}","jamhuri ya kenya","republic of kenya"]},{iso3:"KGZ",iso2:"KG",m49:"417",name:"Kyrgyzstan",aliases:["\u{1F1F0}\u{1F1EC}","kyrgyz republic","kyrgyz respublikasy","kyrgyzstan respublikasy","\u043A\u0440","\u043A\u044B\u0440\u0433\u044B\u0437 \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u0441\u044B","\u043A\u044B\u0440\u0433\u044B\u0437\u0441\u0442\u0430\u043D"]},{iso3:"KHM",iso2:"KH",m49:"116",name:"Cambodia",aliases:["\u{1F1F0}\u{1F1ED}","camboya","campuchia","kambodzha","kamboja","kampuchea","kingdom of cambodia","\u1780\u1798\u17D2\u1796\u17BB\u1787\u17B6","\u1796\u17D2\u179A\u17C7\u179A\u17B6\u1787\u17B6\u178E\u17B6\u1785\u1780\u17D2\u179A\u1780\u1798\u17D2\u1796\u17BB\u1787\u17B6"]},{iso3:"KIR",iso2:"KI",m49:"296",name:"Kiribati",aliases:["\u{1F1F0}\u{1F1EE}","republic of kiribati"]},{iso3:"KNA",iso2:"KN",m49:"659",name:"Saint Kitts and Nevis",aliases:["\u{1F1F0}\u{1F1F3}","federation of saint christopher and nevis","federation of saint kitts and nevis","kitts & nevis","nevis","saint christopher","saint christopher and nevis","saint kitts"]},{iso3:"KOR",iso2:"KR",m49:"410",name:"Republic of Korea",aliases:["\u{1F1F0}\u{1F1F7}","korea","korea republic","korea republic of","korea south","rep korea","s korea","south korea","taehan minguk","\uB0A8\uC870\uC120","\uB0A8\uD55C","\uB300\uD55C","\uB300\uD55C\uBBFC\uAD6D","\uCF54\uB9AC\uC544","\uD55C\uAD6D"]},{iso3:"KWT",iso2:"KW",m49:"414",name:"Kuwait",aliases:["\u{1F1F0}\u{1F1FC}","state of kuwait","\u0627\u0644\u0643\u0648\u064A\u062A","\u062F\u0648\u0644\u0629 \u0627\u0644\u0643\u0648\u064A\u062A"]},{iso3:"LAO",iso2:"LA",m49:"418",name:"Lao People's Democratic Republic",aliases:["\u{1F1F1}\u{1F1E6}","laos","sathalanalat paxathipatai paxaxon lao","\u0EAA\u0EB2\u0E97\u0EB2\u0EA5\u0EB0\u0E99\u0EB0\u0EA5\u0EB1\u0E94 \u0E9B\u0EB0\u0E8A\u0EB2\u0E97\u0EB4\u0E9B\u0EB0\u0EC4\u0E95 \u0E9B\u0EB0\u0E8A\u0EB2\u0E8A\u0EBB\u0E99\u0EA5\u0EB2\u0EA7","\u0E9B\u0EB0\u0EC0\u0E97\u0E94\u0EA5\u0EB2\u0EA7","\u0EA5\u0EB2\u0EA7"]},{iso3:"LBN",iso2:"LB",m49:"422",name:"Lebanon",aliases:["\u{1F1F1}\u{1F1E7}","lebanese republic","republic of lebanon","state of lebanon","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0644\u0628\u0646\u0627\u0646\u064A\u0629","\u0644\u0628\u0646\u0627\u0646"]},{iso3:"LBR",iso2:"LR",m49:"430",name:"Liberia",aliases:["\u{1F1F1}\u{1F1F7}","liber","republic of liberia"]},{iso3:"LBY",iso2:"LY",m49:"434",name:"Libya",aliases:["\u{1F1F1}\u{1F1FE}","state of libya","\u0627\u0644\u062C\u0645\u0627\u0647\u064A\u0631\u064A\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0644\u064A\u0628\u064A\u0629 \u0627\u0644\u0634\u0639\u0628\u064A\u0629 \u0627\u0644\u0625\u0634\u062A\u0631\u0627\u0643\u064A\u0629","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0644\u064A\u0628\u064A\u0629","\u0627\u0644\u0644\u064A\u0628\u064A","\u0627\u0644\u0644\u064A\u0628\u064A\u0629","\u0627\u0644\u0644\u064A\u0628\u064A\u0646","\u062F\u0648\u0644\u0629 \u0644\u064A\u0628\u064A\u0627","\u0644\u064A\u0628\u0628\u064A\u0627","\u0644\u064A\u0628\u064A","\u0644\u064A\u0628\u064A\u0627","\u0644\u064A\u0628\u064A\u0629"]},{iso3:"LCA",iso2:"LC",m49:"662",name:"Saint Lucia",aliases:["\u{1F1F1}\u{1F1E8}","hewanorra","iyonola"]},{iso3:"LIE",iso2:"LI",m49:"438",name:"Liechtenstein",aliases:["\u{1F1F1}\u{1F1EE}","furstentum lichtenstein","furstentum liechtenstein","principality of liechtenstein"]},{iso3:"LKA",iso2:"LK",m49:"144",name:"Sri Lanka",aliases:["\u{1F1F1}\u{1F1F0}","ceylan","ceylon","democratic socialist republic of sri lanka","ilankaic cananayaka cocalicak kutiyarcu","lankava","prajatantravadi samajavadi janarajaya sri lanka","serendib","srilanka","taprobane","\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8","\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8 \u0B9A\u0BA9\u0BA8\u0BBE\u0BAF\u0B95 \u0B9A\u0BCB\u0B9A\u0BB2\u0BBF\u0B9A\u0B95\u0BCD \u0B95\u0BC1\u0B9F\u0BBF\u0BAF\u0BB0\u0B9A\u0BC1","\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8 \u0B9A\u0BA9\u0BA8\u0BBE\u0BAF\u0B95 \u0B9A\u0BCB\u0BB7\u0BB2\u0BBF\u0B9A\u0B95\u0BCD \u0B95\u0BC1\u0B9F\u0BBF\u0BAF\u0BB0\u0B9A\u0BC1","\u0B88\u0BB4\u0BAE\u0BCD","\u0B9A\u0BBF\u0BB2\u0BCB\u0BA9\u0BCD","\u0DBD\u0D82\u0D9A\u0DCF\u0DC0","\u0DC1\u0DCA\u0DBB\u0DD3 \u0DBD\u0D82\u0D9A\u0DCF \u0DB4\u0DCA\u0DBB\u0DA2\u0DCF\u0DAD\u0DB1\u0DCA\u0DAD\u0DCA\u0DBB\u0DC0\u0DCF\u0DAF\u0DD3 \u0DC3\u0DB8\u0DCF\u0DA2\u0DC0\u0DCF\u0DAF\u0DD3 \u0DA2\u0DB1\u0DBB\u0DA2\u0DBA","\u0DC1\u0DCA\u0DBB\u0DD3 \u0DBD\u0D82\u0D9A\u0DCF\u0DC0","\u0DC1\u0DCA\u200D\u0DBB\u0DD3 \u0DBD\u0D82\u0D9A\u0DCF\u0DC0"]},{iso3:"LSO",iso2:"LS",m49:"426",name:"Lesotho",aliases:["\u{1F1F1}\u{1F1F8}","kingdom of lesotho","mmuso wa lesotho","mountain kingdom"]},{iso3:"LTU",iso2:"LT",m49:"440",name:"Lithuania",aliases:["\u{1F1F1}\u{1F1F9}","lietuva","lietuvos respublika","republic of lithuania"]},{iso3:"LUX",iso2:"LU",m49:"442",name:"Luxembourg",aliases:["\u{1F1F1}\u{1F1FA}","grand duche","grand duche de luxembourg","grand duchy of luxembourg","gro\xDFherzogtum luxemburg","groussherzogtum letzebuerg","le grand duche de luxembourg","letzebuerg","letzebuerger land","lux","luxemburg"]},{iso3:"LVA",iso2:"LV",m49:"428",name:"Latvia",aliases:["\u{1F1F1}\u{1F1FB}","latveja","latvejas republika","latvian republic","latvija","latvijas republika","letm\u043E","letm\u043E vabam\u043E","republic of latvia"]},{iso3:"MAC",iso2:"MO",m49:"446",name:"Macao",aliases:["\u{1F1F2}\u{1F1F4}","aomen","macao sar","macao special administrative region","macao special administrative region of the peoples republic of china","macau","macau rae da china","macau sar","macau special administrative region","macau special administrative region of the peoples republic of china","raem","regiao administrativa especial de macau","regiao administrativa especial de macau da republica popular da china","\u4E2D\u570B\u6FB3\u9580\u7279\u5225\u884C\u653F\u5340","\u6FB3\u9580"]},{iso3:"MAF",iso2:"MF",m49:"663",name:"Saint Martin (French Part)",aliases:["\u{1F1F2}\u{1F1EB}","collectivite de saint martin","collectivity of saint martin","saint martin","saint martin antilles francaises","saint martin france"]},{iso3:"MAR",iso2:"MA",m49:"504",name:"Morocco",aliases:["\u{1F1F2}\u{1F1E6}","kingdom of morocco","\u0627\u0644\u0645\u063A\u0631\u0628","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0645\u063A\u0631\u0628\u064A\u0629","\u2D30\u2D4E\u2D53\u2D54 \u2D4F \u2D61\u2D30\u2D3D\u2D53\u2D5B","\u2D30\u2D4E\u2D55\u2D55\u2D53\u2D3D","\u2D4D\u2D4E\u2D55\u2D55\u2D53\u2D3D","\u2D4D\u2D4E\u2D56\u2D54\u2D49\u2D31","\u2D5C\u2D30\u2D33\u2D4D\u2D37\u2D49\u2D5C \u2D4F \u2D4D\u2D4E\u2D56\u2D54\u2D49\u2D31"]},{iso3:"MCO",iso2:"MC",m49:"492",name:"Monaco",aliases:["\u{1F1F2}\u{1F1E8}","fort hercule","la principaute de monaco","monaco rattachee au district de menton en 1793","munegu","principality and diocese of monaco","principality of monaco","principatu de munegu","principaute de monaco"]},{iso3:"MDA",iso2:"MD",m49:"498",name:"Republic of Moldova",aliases:["\u{1F1F2}\u{1F1E9}","moldavia","moldova","moldova republic of","moldova republica","r moldova","rep moldova","republica moldova","\u043C\u043E\u043B\u0434\u043E\u0432\u0430"]},{iso3:"MDG",iso2:"MG",m49:"450",name:"Madagascar",aliases:["\u{1F1F2}\u{1F1EC}","la republique de madagascar","madagasikara","repoblikani madagasikara","republic of madagascar","republique de madagascar"]},{iso3:"MDV",iso2:"MV",m49:"462",name:"Maldives",aliases:["\u{1F1F2}\u{1F1FB}","dhivehi raajjeyge jumhooriyyaa","republic of maldives","\u078B\u07A8\u0788\u07AC\u0780\u07A8 \u0783\u07A7\u0787\u07B0\u0796\u07AC","\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0783\u07A7\u0787\u07B0\u0796\u07AC","\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0783\u07A7\u0787\u07B0\u0796\u07AD\u078E\u07AC \u0796\u07AA\u0789\u07AA\u0780\u07AB\u0783\u07A8\u0787\u07B0\u0794\u07A7","\u078B\u07A8\u0788\u07AC\u0780\u07A8\u0783\u07A7\u0787\u07B0\u0796\u07AD\u078E\u07AC \u0796\u07AA\u0789\u07B0\u0780\u07AB\u0783\u07A8\u0787\u07B0\u0794\u07A7"]},{iso3:"MEX",iso2:"MX",m49:"484",name:"Mexico",aliases:["\u{1F1F2}\u{1F1FD}","estados unidos mejicanos","estados unidos mexicanos","mejico","mexican republic","mexican united states","mexihco","mexihko","mexika sentik wexteyowalko","mexiko","mexko","mexko axkayotl","mexko tlalli","nueva espana","republica mejicana","republica mexicana","united mexican states","united states of mexico"]},{iso3:"MHL",iso2:"MH",m49:"584",name:"Marshall Islands",aliases:["\u{1F1F2}\u{1F1ED}","aelon kein ad","aolepan aorokin majel","jolet jen anij","majel","majol","republic of the marshall islands"]},{iso3:"MKD",iso2:"MK",m49:"807",name:"North Macedonia",aliases:["\u{1F1F2}\u{1F1F0}","former yugoslav republic of macedonia","fyr macedonia","fyrom","irjm","ish republika jugosllave e maqedonise","macedonia","macedonia former yugoslav republic of","macedonia fyr","maqedoni","maqedonia","maqedonia e veriut","republic of macedonia","republic of north macedonia","republika e maqedonise","republika e maqedonise se veriut","\u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430","\u0440\u0435\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430","\u0440\u0435\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u0441\u0435\u0432\u0435\u0440\u043D\u0430 \u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430","\u0440\u043C","\u0440\u0441\u043C","\u0441\u0435\u0432\u0435\u0440\u043D\u0430 \u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430"]},{iso3:"MLI",iso2:"ML",m49:"466",name:"Mali",aliases:["\u{1F1F2}\u{1F1F1}","maali","republic of mali"]},{iso3:"MLT",iso2:"MT",m49:"470",name:"Malta",aliases:["\u{1F1F2}\u{1F1F9}","malta island","repubblika ta malta","republic of malta"]},{iso3:"MMR",iso2:"MM",m49:"104",name:"Myanmar",aliases:["\u{1F1F2}\u{1F1F2}","burma","pyidaungzu myanma naingngandaw","pyidaungzu thammada myanma naingngandaw","republic of the union of myanmar","union of burma","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F \u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F \u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F \u101E\u1019\u1039\u1019\u1010 \u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F \u101E\u1019\u1039\u1019\u1010 \u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F\u101E\u1019\u1039\u1019\u1010\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1015\u103C\u200C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F\u101E\u1019\u1039\u1019\u1010\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1015\u103C\u100A\u103A\u1011\u1031\u102C\u1004\u103A\u1005\u102F\u101E\u1019\u1039\u1019\u1010\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1017\u1019\u102C\u1015\u103C\u100A\u103A","\u1019\u103C\u1014\u103A\u1019\u102C","\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036","\u1019\u103C\u1014\u103A\u1019\u102C\u1014\u102D\u102F\u1004\u103A\u1004\u1036\u1010\u1031\u102C\u103A","\u1019\u103C\u1014\u103A\u1019\u102C\u1015\u103C\u100A\u103A"]},{iso3:"MNE",iso2:"ME",m49:"499",name:"Montenegro",aliases:["\u{1F1F2}\u{1F1EA}","crna cora","\u0446\u0440\u043D\u0430 \u0433\u043E\u0440\u0430"]},{iso3:"MNG",iso2:"MN",m49:"496",name:"Mongolia",aliases:["\u{1F1F2}\u{1F1F3}","bugd nayramdah mongol ard uls","mongol uls","state of mongolia","\u043C\u043E\u043D\u0433\u043E\u043B","\u043C\u043E\u043D\u0433\u043E\u043B \u0443\u043B\u0441","\u182E\u1824\u1829\u182D\u1824\u182F \u1824\u182F\u1824\u1830"]},{iso3:"MNP",iso2:"MP",m49:"580",name:"Northern Mariana Islands",aliases:["\u{1F1F2}\u{1F1F5}","cnmi","commonwealth of the northern maria islands","commonwealth of the northern mariana islands","northern marianas","notte marianas","sankattan siha na islas marianas"]},{iso3:"MOZ",iso2:"MZ",m49:"508",name:"Mozambique",aliases:["\u{1F1F2}\u{1F1FF}","mocambique","republic of mozambique","republica de mocambique"]},{iso3:"MRT",iso2:"MR",m49:"478",name:"Mauritania",aliases:["\u{1F1F2}\u{1F1F7}","islamic republic of mauritania","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0625\u0633\u0644\u0627\u0645\u064A\u0629 \u0627\u0644\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0629","\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627"]},{iso3:"MSR",iso2:"MS",m49:"500",name:"Montserrat",aliases:["\u{1F1F2}\u{1F1F8}","island of montserrat"]},{iso3:"MTQ",iso2:"MQ",m49:"474",name:"Martinique",aliases:["\u{1F1F2}\u{1F1F6}","territorial collectivity of martinique"]},{iso3:"MUS",iso2:"MU",m49:"480",name:"Mauritius",aliases:["\u{1F1F2}\u{1F1FA}","ile maurice","la republique de maurice","maurice","moris","republic of mauritius","republique de maurice"]},{iso3:"MWI",iso2:"MW",m49:"454",name:"Malawi",aliases:["\u{1F1F2}\u{1F1FC}","republic of malawi"]},{iso3:"MYS",iso2:"MY",m49:"458",name:"Malaysia",aliases:["\u{1F1F2}\u{1F1FE}","federation of malaysia","malaysia federation","negara seberang tambak","persekutuan malaysia"]},{iso3:"MYT",iso2:"YT",m49:"175",name:"Mayotte",aliases:["\u{1F1FE}\u{1F1F9}","departement de mayotte","departement region de mayotte","department of mayotte"]},{iso3:"NAM",iso2:"NA",m49:"516",name:"Namibia",aliases:["\u{1F1F3}\u{1F1E6}","republic of namibia"]},{iso3:"NCL",iso2:"NC",m49:"540",name:"New Caledonia",aliases:["\u{1F1F3}\u{1F1E8}","caledonie","kanaky","kanaky nouvelle caledonie","nouvelle caledonie","territoire de la nouvelle caledonie et dependances","territoire des nouvelle caledonie et dependances","territory of new caledonia and dependencies"]},{iso3:"NER",iso2:"NE",m49:"562",name:"Niger",aliases:["\u{1F1F3}\u{1F1EA}","jamhuriyar nijar","nijar","republic niger","republic of niger","republic of the niger"]},{iso3:"NFK",iso2:"NF",m49:"574",name:"Norfolk Island",aliases:["\u{1F1F3}\u{1F1EB}","norfolk island australia","norfolk island other territories","norfolk island other territories australia","territory of norfolk island"]},{iso3:"NGA",iso2:"NG",m49:"566",name:"Nigeria",aliases:["\u{1F1F3}\u{1F1EC}","federal republic of nigeria","naija"]},{iso3:"NIC",iso2:"NI",m49:"558",name:"Nicaragua",aliases:["\u{1F1F3}\u{1F1EE}","republic of nicaragua","republica de nicaragua"]},{iso3:"NIU",iso2:"NU",m49:"570",name:"Niue",aliases:["\u{1F1F3}\u{1F1FA}"]},{iso3:"NLD",iso2:"NL",m49:"528",name:"Kingdom of the Netherlands",aliases:["\u{1F1F3}\u{1F1F1}","hollandt","kingdom of netherlands","koninkrijk der nederlanden","nederland","nederlanden","nederlandt","netherlands","netherlands kingdom of the"]},{iso3:"NOR",iso2:"NO",m49:"578",name:"Norway",aliases:["\u{1F1F3}\u{1F1F4}","kingdom of norway","kongeriket noreg","kongeriket norge","noreg","norge"]},{iso3:"NPL",iso2:"NP",m49:"524",name:"Nepal",aliases:["\u{1F1F3}\u{1F1F5}","bal bo","bal poi yul","bal yul","balbo","balpo","balpo yul","nipal","sanghiya loktantrik ganatantra nepal","\u0928\u0947\u092A\u093E\u0932","\u0938\u0902\u0918\u093F\u092F \u0932\u094B\u0915\u0924\u093E\u0928\u094D\u0924\u094D\u0930\u093F\u0915 \u0917\u0923\u0924\u0928\u094D\u0924\u094D\u0930 \u0928\u0947\u092A\u093E\u0932","\u0938\u0902\u0918\u093F\u092F \u0932\u094B\u0915\u0924\u093E\u0928\u094D\u0924\u094D\u0930\u093F\u0915 \u0917\u0923\u0924\u0928\u094D\u0924\u094D\u0930\u093E\u0924\u094D\u092E\u0915 \u0928\u0947\u092A\u093E\u0932","\u0938\u0902\u0918\u0940\u092F \u0932\u094B\u0915\u0924\u093E\u0928\u094D\u0924\u094D\u0930\u093F\u0915 \u0917\u0923\u0924\u0928\u094D\u0924\u094D\u0930 \u0928\u0947\u092A\u093E\u0932"]},{iso3:"NRU",iso2:"NR",m49:"520",name:"Naoero",aliases:["\u{1F1F3}\u{1F1F7}","nauru","pleasant island","republic of naoero","republic of nauru"]},{iso3:"NZL",iso2:"NZ",m49:"554",name:"New Zealand",aliases:["\u{1F1F3}\u{1F1FF}","aotearoa","aotearoa new zealand","dominion of new zealand"]},{iso3:"OMN",iso2:"OM",m49:"512",name:"Oman",aliases:["\u{1F1F4}\u{1F1F2}","sultanate of oman","uman","\u0633\u0644\u0637\u0646\u0629 \u0639\u0645\u0627\u0646","\u0639\u0645\u0627\u0646"]},{iso3:"PAK",iso2:"PK",m49:"586",name:"Pakistan",aliases:["\u{1F1F5}\u{1F1F0}","hoi quoc","islamic republic of pakistan","republic of pakistan","tay hoi","\u0627\u0633\u0644\u0627\u0645\u06CC \u062C\u0645\u06C1\u0648\u0631\u06CC\u06C1 \u067E\u0627\u06A9\u0633\u062A\u0627\u0646","\u0628\u0627\u06A9\u0633\u062A\u0627\u0646","\u067E\u0627\u06A9\u0633\u062A\u0627\u0646"]},{iso3:"PAN",iso2:"PA",m49:"591",name:"Panama",aliases:["\u{1F1F5}\u{1F1E6}","republic of panama","republica de panama"]},{iso3:"PCN",iso2:"PN",m49:"612",name:"Pitcairn",aliases:["\u{1F1F5}\u{1F1F3}","occas island","pisskern ali\u0435n","pitcairn henderson ducie and oeno islands","pitcairn island","pitcairn islands","pitkern ailen"]},{iso3:"PER",iso2:"PE",m49:"604",name:"Peru",aliases:["\u{1F1F5}\u{1F1EA}","piruw","piruw ripuwlika","republic of peru","republica del peru"]},{iso3:"PHL",iso2:"PH",m49:"608",name:"Philippines",aliases:["\u{1F1F5}\u{1F1ED}","philippine islands","republic of the philippines"]},{iso3:"PLW",iso2:"PW",m49:"585",name:"Palau",aliases:["\u{1F1F5}\u{1F1FC}","belau","peeloo","pelew","pelew islands","pellew","republic of belau","republic of palau","\u30D1\u30E9\u30AA","\u30D1\u30E9\u30AA\u5171\u548C\u56FD"]},{iso3:"PNG",iso2:"PG",m49:"598",name:"Papua New Guinea",aliases:["\u{1F1F5}\u{1F1EC}","independent state of papua new guinea","papua niugini"]},{iso3:"POL",iso2:"PL",m49:"616",name:"Poland",aliases:["\u{1F1F5}\u{1F1F1}","polska","republic of poland","rzeczpospolita polska"]},{iso3:"PRI",iso2:"PR",m49:"630",name:"Puerto Rico",aliases:["\u{1F1F5}\u{1F1F7}","boriken","borinquen","boriquen","commonwealth of puerto rico","estado libre asociado de puerto rico","free associated state of puerto rico","isla del encanto","island of enchantment","isle of enchantment","mancomunidad de puerto rico","porto rico","territorio de puerto rico","territorio estadounidense de puerto rico","territory of porto rico","territory of puerto rico"]},{iso3:"PRK",iso2:"KP",m49:"408",name:"Democratic People's Republic of Korea",aliases:["\u{1F1F0}\u{1F1F5}","choson minjujuui inmin konghwaguk","dpr korea","dprk","korea democratic peoples republic of","n korea","north korea","\uACF5\uD654\uAD6D","\uBD81\uC870\uC120","\uBD81\uD55C","\uC870\uC120","\uC870\uC120\uBBFC\uC8FC\uC8FC\uC758\uC778\uBBFC\uACF5\uD654\uAD6D"]},{iso3:"PRT",iso2:"PT",m49:"620",name:"Portugal",aliases:["\u{1F1F5}\u{1F1F9}","republica portuguesa"]},{iso3:"PRY",iso2:"PY",m49:"600",name:"Paraguay",aliases:["\u{1F1F5}\u{1F1FE}","paraguai","republic of paraguay","republica del paraguay","teta paraguai"]},{iso3:"PSE",iso2:"PS",m49:"275",name:"State of Palestine",aliases:["\u{1F1F5}\u{1F1F8}","palestine","palestine state of","palestinian authority","palestinian national authority","palestinian territory","west bank and gaza","\u0623\u0631\u0627\u0636\u064A \u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u0623\u0631\u0627\u0636\u064A \u0627\u0644\u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u062F\u0648\u0644\u0629 \u0627\u0644\u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u0633\u0644\u0637\u0629 \u0627\u0644\u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u0633\u0644\u0637\u0629 \u0627\u0644\u0648\u0637\u0646\u064A\u0629 \u0627\u0644\u0641\u0644\u0633\u0637\u064A\u0646\u064A\u0629","\u0627\u0644\u0636\u0641\u0629 \u0627\u0644\u063A\u0631\u0628\u064A\u0629 \u0648\u0642\u0637\u0627\u0639 \u063A\u0632\u0629","\u062F\u0648\u0644\u0629 \u0641\u0644\u0633\u0637\u064A\u0646","\u0641\u0644\u0633\u0637\u064A\u0646"]},{iso3:"PYF",iso2:"PF",m49:"258",name:"French Polynesia",aliases:["\u{1F1F5}\u{1F1EB}","f oh","french establishments in oceania","french oceania","french settlements in oceania","polynesie francaise","territoire de la polynesie francaise","territory of french polynesia"]},{iso3:"QAT",iso2:"QA",m49:"634",name:"Qatar",aliases:["\u{1F1F6}\u{1F1E6}","state of qatar","\u0625\u0645\u0627\u0631\u0629 \u0642\u0637\u0631","\u062F\u0648\u0644\u0629 \u0642\u0637\u0631","\u0642\u0637\u0631"]},{iso3:"REU",iso2:"RE",m49:"638",name:"R\xE9union",aliases:["\u{1F1F7}\u{1F1EA}","ile bourbon","ile de la reunion","la reunion","re","region reunion","reunion island"]},{iso3:"ROU",iso2:"RO",m49:"642",name:"Romania",aliases:["\u{1F1F7}\u{1F1F4}"]},{iso3:"RUS",iso2:"RU",m49:"643",name:"Russian Federation",aliases:["\u{1F1F7}\u{1F1FA}","federation of russia","russia","\u0440\u043E\u0441\u0441\u0438\u0438\u0441\u043A\u0430\u044F \u0444\u0435\u0434\u0435\u0440\u0430\u0446\u0438\u044F","\u0440\u043E\u0441\u0441\u0438\u044F","\u0440\u0444"]},{iso3:"RWA",iso2:"RW",m49:"646",name:"Rwanda",aliases:["\u{1F1F7}\u{1F1FC}","igihugu cyimisozi igihumbi","jamhuri ya rwanda","la republique du rwanda","land of a thousand hills","republic of rwanda","republika yu rwanda","republique du rwanda","republique rwandaise","repubulika yu rwanda","u rwanda"]},{iso3:"SAU",iso2:"SA",m49:"682",name:"Saudi Arabia",aliases:["\u{1F1F8}\u{1F1E6}","kingdom of saudi arabia","\u0627\u0644\u062F\u0648\u0644\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u062F\u0648\u0644\u0647 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0647","\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0647","\u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629","\u0627\u0644\u0645\u0645\u0644\u0643\u0647","\u0627\u0644\u0645\u0645\u0644\u0643\u0647 \u0627\u0644\u0639\u0631\u0628\u064A\u0647 \u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0647","\u0628\u0644\u0627\u062F \u0627\u0644\u062D\u0631\u0645\u064A\u0646 \u0627\u0644\u0634\u0631\u064A\u0641\u064A\u0646","\u062F\u0648\u0644\u0629 \u0622\u0644 \u0633\u0639\u0648\u062F","\u0633\u0639\u0648\u062F\u064A\u0629","\u0633\u0639\u0648\u062F\u064A\u0647","\u0645\u0646\u0628\u0639 \u0627\u0644\u0631\u0633\u0627\u0644\u0629","\u0645\u0647\u0628\u0637 \u0627\u0644\u0648\u062D\u064A"]},{iso3:"SDN",iso2:"SD",m49:"729",name:"Sudan",aliases:["\u{1F1F8}\u{1F1E9}","al sudan","as sudan","north sudan","republic of sudan","republic of the sudan","soudan","\u0627\u0644\u0633\u0648\u062F\u0627\u0646","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0633\u0648\u062F\u0627\u0646"]},{iso3:"SEN",iso2:"SN",m49:"686",name:"Senegal",aliases:["\u{1F1F8}\u{1F1F3}","la republique du senegal","republic of senegal","republique du senegal","sen","senegaal"]},{iso3:"SGP",iso2:"SG",m49:"702",name:"Singapore",aliases:["\u{1F1F8}\u{1F1EC}","garden city","lion city","republic of singapore","republik singapura","singapore city","singapura","spore","\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD","\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD \u0B95\u0BC1\u0B9F\u0BBF\u0BAF\u0BB0\u0B9A\u0BC1","\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BC8","\u0BB8\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BC2\u0BB0\u0BCD"]},{iso3:"SGS",iso2:"GS",m49:"239",name:"South Georgia and the South Sandwich Islands",aliases:["\u{1F1EC}\u{1F1F8}","falkland islands dependencies","sgssi","south georgia","south georgia & south sandwich islands","south sandwich islands"]},{iso3:"SHN",iso2:"SH",m49:"654",name:"Saint Helena",aliases:["\u{1F1F8}\u{1F1ED}","ascension","saint helena and dependencies","saint helena ascension and tristan da cunha","tristan da cunha"]},{iso3:"SJM",iso2:"SJ",m49:"744",name:"Svalbard and Jan Mayen Islands",aliases:["\u{1F1F8}\u{1F1EF}","jan mayen","svalbard","svalbard and jan mayen","svalbard og jan mayen"]},{iso3:"SLB",iso2:"SB",m49:"090",name:"Solomon Islands",aliases:["\u{1F1F8}\u{1F1E7}"]},{iso3:"SLE",iso2:"SL",m49:"694",name:"Sierra Leone",aliases:["\u{1F1F8}\u{1F1F1}","republic of sierra leone"]},{iso3:"SLV",iso2:"SV",m49:"222",name:"El Salvador",aliases:["\u{1F1F8}\u{1F1FB}","republic of el salvador","republica de el salvador","salvador"]},{iso3:"SMR",iso2:"SM",m49:"674",name:"San Marino",aliases:["\u{1F1F8}\u{1F1F2}","most serene republic of san marino","repubblica di san marino","serenissima repubblica di san marino"]},{iso3:"SOM",iso2:"SO",m49:"706",name:"Somalia",aliases:["\u{1F1F8}\u{1F1F4}","as sumal","federal republic of somalia","jamhuuriyadda federaalka soomaaliya","jamhuuriyadda soomaaliyeed","soomaaliya","soomaaliyeey toosoo","\u0627\u0644\u0635\u0648\u0645\u0627\u0644","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0635\u0648\u0645\u0627\u0644","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0635\u0648\u0645\u0627\u0644 \u0627\u0644\u062F\u064A\u0645\u0648\u0642\u0631\u0627\u0637\u064A\u0629","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0635\u0648\u0645\u0627\u0644 \u0627\u0644\u0641\u064A\u062F\u0631\u0627\u0644\u064A\u0629","\u0635\u0648\u0645\u0627\u0644"]},{iso3:"SPM",iso2:"PM",m49:"666",name:"Saint Pierre and Miquelon",aliases:["\u{1F1F5}\u{1F1F2}","collectivite territoriale de saint pierre et miquelon","miquelon","saint pierre","saint pierre et miquelon","territorial collectivity of saint pierre and miquelon"]},{iso3:"SRB",iso2:"RS",m49:"688",name:"Serbia",aliases:["\u{1F1F7}\u{1F1F8}","republic of serbia","republika srbija","\u0440\u0435\u043F\u0443\u0431\u043B\u0438\u043A\u0430 \u0441\u0440\u0431\u0438\u0458\u0430","\u0441\u0440\u0431\u0438\u0458\u0430"]},{iso3:"SSD",iso2:"SS",m49:"728",name:"South Sudan",aliases:["\u{1F1F8}\u{1F1F8}","republic of south sudan","southern sudan"]},{iso3:"STP",iso2:"ST",m49:"678",name:"Sao Tome and Principe",aliases:["\u{1F1F8}\u{1F1F9}","democratic republic of sao tome and principe","principe","republica democratica de sao tome e principe","sao tome","sao tome e principe","sao tome og principe"]},{iso3:"SUR",iso2:"SR",m49:"740",name:"Suriname",aliases:["\u{1F1F8}\u{1F1F7}","dutch guiana","republic of surinam","republic of suriname","republiek suriname","surinam","surrinam"]},{iso3:"SVK",iso2:"SK",m49:"703",name:"Slovakia",aliases:["\u{1F1F8}\u{1F1F0}","slovak republic","slovenska republika","slovensko"]},{iso3:"SVN",iso2:"SI",m49:"705",name:"Slovenia",aliases:["\u{1F1F8}\u{1F1EE}","republic of slovenia","republika slovenija","slovenija"]},{iso3:"SWE",iso2:"SE",m49:"752",name:"Sweden",aliases:["\u{1F1F8}\u{1F1EA}","kingdom of sweden","konungadomet sverige","konungariket sverige","kungadomet sverige","kungariket sverige","sverige","swedish kingdom"]},{iso3:"SWZ",iso2:"SZ",m49:"748",name:"Eswatini",aliases:["\u{1F1F8}\u{1F1FF}","kingdom of eswatini","kingdom of swaziland","swaziland","umbuso weswatini"]},{iso3:"SXM",iso2:"SX",m49:"534",name:"Sint Maarten (Dutch part)",aliases:["\u{1F1F8}\u{1F1FD}","country of sint maarten","eilandgebied sint maarten","land sint maarten","saint maarten","saint martin dutch part","sint maarten","sint martin"]},{iso3:"SYC",iso2:"SC",m49:"690",name:"Seychelles",aliases:["\u{1F1F8}\u{1F1E8}","la republique des seychelles","repiblik sesel","republic of seychelles","republique des seychelles"]},{iso3:"SYR",iso2:"SY",m49:"760",name:"Syrian Arab Republic",aliases:["\u{1F1F8}\u{1F1FE}","surya","syria","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629 \u0627\u0644\u0633\u0648\u0631\u064A\u0629","\u0627\u0644\u0634\u0627\u0645","\u0633\u0648\u0631\u064A\u0627","\u0633\u0648\u0631\u064A\u0629"]},{iso3:"TCA",iso2:"TC",m49:"796",name:"Turks and Caicos Islands",aliases:["\u{1F1F9}\u{1F1E8}","caicos","caicos islands","turks","turks & caicos","turks islands"]},{iso3:"TCD",iso2:"TD",m49:"148",name:"Chad",aliases:["\u{1F1F9}\u{1F1E9}","la republique du tchad","republic of chad","republique du tchad","tchad","\u062A\u0634\u0627\u062F","\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u062A\u0634\u0627\u062F"]},{iso3:"TGO",iso2:"TG",m49:"768",name:"Togo",aliases:["\u{1F1F9}\u{1F1EC}","la republique togolaise","republique togolaise","togolese republic"]},{iso3:"THA",iso2:"TH",m49:"764",name:"Thailand",aliases:["\u{1F1F9}\u{1F1ED}","kingdom of siam","kingdom of thailand","siam","thai","\u0E44\u0E17\u0E22","\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E44\u0E17\u0E22","\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E2A\u0E22\u0E32\u0E21","\u0E40\u0E21\u0E37\u0E2D\u0E07\u0E44\u0E17\u0E22","\u0E23\u0E32\u0E0A\u0E2D\u0E32\u0E13\u0E32\u0E08\u0E31\u0E01\u0E23\u0E44\u0E17\u0E22","\u0E23\u0E32\u0E0A\u0E2D\u0E32\u0E13\u0E32\u0E08\u0E31\u0E01\u0E23\u0E2A\u0E22\u0E32\u0E21","\u0E2A\u0E22\u0E32\u0E21"]},{iso3:"TJK",iso2:"TJ",m49:"762",name:"Tajikistan",aliases:["\u{1F1F9}\u{1F1EF}","jumhurii tojikiston","republic of tajikistan","\u0442\u043E\u04B7\u0438\u043A\u0438\u0441\u0442\u043E\u043D","\u0442\u04B7","\u0442\u04B7\u043A","\u04B7\u0442","\u04B7\u0443\u043C\u04B3\u0443\u0440\u0438\u0438 \u0442\u043E\u04B7\u0438\u043A\u0438\u0441\u0442\u043E\u043D"]},{iso3:"TKL",iso2:"TK",m49:"772",name:"Tokelau",aliases:["\u{1F1F9}\u{1F1F0}","tokelau islands","union islands"]},{iso3:"TKM",iso2:"TM",m49:"795",name:"Turkmenistan",aliases:["\u{1F1F9}\u{1F1F2}"]},{iso3:"TLS",iso2:"TL",m49:"626",name:"Timor-Leste",aliases:["\u{1F1F9}\u{1F1F1}","democratic republic of timor leste","east timor","republica democratica de timor leste","republika demokratika timor lorosae","timor loro sae","timor lorosae"]},{iso3:"TON",iso2:"TO",m49:"776",name:"Tonga",aliases:["\u{1F1F9}\u{1F1F4}","friendly islands","kingdom of tonga","puleanga fakatui o tonga","tonga islands"]},{iso3:"TTO",iso2:"TT",m49:"780",name:"Trinidad and Tobago",aliases:["\u{1F1F9}\u{1F1F9}","republic of trinidad and tobago","tobago","trinidad"]},{iso3:"TUN",iso2:"TN",m49:"788",name:"Tunisia",aliases:["\u{1F1F9}\u{1F1F3}","republic of tunisia","tunisian republic","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u062A\u0648\u0646\u0633\u064A\u0629","\u062A\u0648\u0646\u0633","\u062A\u0648\u0646\u0633 \u0627\u0644\u062E\u0636\u0631\u0627\u0621"]},{iso3:"TUR",iso2:"TR",m49:"792",name:"T\xFCrkiye",aliases:["\u{1F1F9}\u{1F1F7}","republic of turkey","republic of turkiye","turkey","turkiye cumhuriyeti"]},{iso3:"TUV",iso2:"TV",m49:"798",name:"Tuvalu",aliases:["\u{1F1F9}\u{1F1FB}","ellice islands"]},{iso3:"TWN",iso2:"TW",m49:"158",name:"Taiwan",aliases:["\u{1F1F9}\u{1F1FC}","chinese republic","chinese taipei","chunghwa minkuo","chunghwa minkwo","conghwaminku","cunghwa minkwo","cyukamingkok","formosa","nanasian","nationalist china","republic of china","republic of china taiwan","roc","taivang","taiwan province of china","taiwan roc","taywan","taywang","teywan","\u4E2D\u83EF\u6C11\u570B","\u4E2D\u83EF\u6C11\u570B\uFF08\u81FA\u7063\uFF09","\u4E2D\u83EF\u81FA\u5317","\u53F0\u7063","\u81FA\u6F8E\u91D1\u99AC","\u81FA\u7063"]},{iso3:"TZA",iso2:"TZ",m49:"834",name:"United Republic of Tanzania",aliases:["\u{1F1F9}\u{1F1FF}","jamhuri ya muungano wa tanganyika na zanzibar","jamhuri ya muungano wa tanzania","tanzania","tanzania jamhuri ya muungano wa","tanzania united republic of","united republic of tanganyika and zanzibar"]},{iso3:"UGA",iso2:"UG",m49:"800",name:"Uganda",aliases:["\u{1F1FA}\u{1F1EC}","jamhuri ya uganda","lulu ya afrika","ouganda","pearl of africa","republic of uganda","ugandah"]},{iso3:"UKR",iso2:"UA",m49:"804",name:"Ukraine",aliases:["\u{1F1FA}\u{1F1E6}","ukr","ukraina","ukrainia","ukrayina","\u0432\u043A\u0440\u0430\u0456\u043D\u0430","\u0443\u043A\u0440\u0430\u0456\u043D\u0430"]},{iso3:"UMI",iso2:"UM",m49:"581",name:"United States Minor Outlying Islands",aliases:["\u{1F1FA}\u{1F1F2}","us minor outlying islands","us outlying islands","usmoi"]},{iso3:"URY",iso2:"UY",m49:"858",name:"Uruguay",aliases:["\u{1F1FA}\u{1F1FE}","eastern republic of uruguay","oriental republic of uruguay"]},{iso3:"USA",iso2:"US",m49:"840",name:"United States of America",aliases:["\u{1F1FA}\u{1F1F8}","amelika","amelika hui pu ia","amelika huipuia","amelika mokuaina hui pu ia","america","eeuu","eeuu de america","estados unidos","estados unidos de america","los estados","los estados unidos","los estados unidos de america","mokuaina hui pu ia","union americana","united states","us","us of a","us of america","usa"]},{iso3:"UZB",iso2:"UZ",m49:"860",name:"Uzbekistan",aliases:["\u{1F1FA}\u{1F1FF}","ozbek","ozbekiston","ozbekiston respublikasi","republic of uzbekistan","uzbekiston respublikasi"]},{iso3:"VAT",iso2:"VA",m49:"336",name:"Holy See",aliases:["\u{1F1FB}\u{1F1E6}","citta del vaticano","civitas vaticana","colle vaticano","papal state","santa sede citta del vaticano","state of vatican city","stato della citta del vaticano","status civitatis vaticanae","status civitatis vatican\xE6","vatican","vatican city","vatican city state","vaticano"]},{iso3:"VCT",iso2:"VC",m49:"670",name:"Saint Vincent and the Grenadines",aliases:["\u{1F1FB}\u{1F1E8}","grenadines","saint vincent","saint vincent and grenadines"]},{iso3:"VEN",iso2:"VE",m49:"862",name:"Venezuela (Bolivarian Republic of)",aliases:["\u{1F1FB}\u{1F1EA}","bolivarian republic of venezuela","br venezuela","estados unidos de venezuela","rb venezuela","republic of venezuela","republica bolivariana de venezuela","republica de venezuela","venezuela"]},{iso3:"VGB",iso2:"VG",m49:"092",name:"British Virgin Islands",aliases:["\u{1F1FB}\u{1F1EC}","bvi","virgin islands british","virgin islands of the united kingdom","virgin islands united kingdom"]},{iso3:"VIR",iso2:"VI",m49:"850",name:"United States Virgin Islands",aliases:["\u{1F1FB}\u{1F1EE}","american virgin islands","us virgin islands","virgin islands of the united states","virgin islands us"]},{iso3:"VNM",iso2:"VN",m49:"704",name:"Viet Nam",aliases:["\u{1F1FB}\u{1F1F3}","chxhcn viet nam","chxhcnvn","cong hoa xa hoi chu nghia viet nam","socialist republic of viet nam","socialist republic of vietnam","vietnam"]},{iso3:"VUT",iso2:"VU",m49:"548",name:"Vanuatu",aliases:["\u{1F1FB}\u{1F1FA}","la republique du vanuatu","republic of vanuatu","republique de vanuatu","ripablik blong vanuatu"]},{iso3:"WLF",iso2:"WF",m49:"876",name:"Wallis and Futuna Islands",aliases:["\u{1F1FC}\u{1F1EB}","collectivite des iles wallis et futuna","emeni simete","futuna","iles wallis et futuna","makape papilio","territoire de wallis et futuna","territoire des iles wallis et futuna","wallis","wallis & futuna","wallis et futuna"]},{iso3:"WSM",iso2:"WS",m49:"882",name:"Samoa",aliases:["\u{1F1FC}\u{1F1F8}","independent state of samoa","malo saoloto tutoatasi o samoa","samoa i sisifo","western samoa"]},{iso3:"YEM",iso2:"YE",m49:"887",name:"Yemen",aliases:["\u{1F1FE}\u{1F1EA}","rep yemen","republic of yemen","\u0627\u0644\u062C\u0645\u0647\u0648\u0631\u064A\u0629 \u0627\u0644\u064A\u0645\u0646\u064A\u0629","\u0627\u0644\u064A\u0645\u0646","\u062F\u0648\u0644\u0629 \u0627\u0644\u064A\u0645\u0646"]},{iso3:"ZAF",iso2:"ZA",m49:"710",name:"South Africa",aliases:["\u{1F1FF}\u{1F1E6}","aferika borwa","aforika borwa","afrika boroa","afrika borwa","afrika dzonga","afurika tshipembe","emzantsi afrika","iningizimu afrika","iriphabhulikhi ye ningizimu afrika","iriphabhulikhi yeningizimu afrika","iriphabhuliki yase ningizimu afrika","iriphabliki yasemzantsi afrika","iriphabliki yaseningizimu afrika","iriphabliki yom zantsi afrika","isewula afrika","repabliki ya afrika borwa","rephaboliki ya aforika borwa","rephaboliki ya afrika borwa","republic of south africa","republiek van suid afrika","riphabliki ra afrika dzonga","rsa","suid afrika","umzansi","umzantsi afrika","unie van suid afrika","union of south africa"]},{iso3:"ZMB",iso2:"ZM",m49:"894",name:"Zambia",aliases:["\u{1F1FF}\u{1F1F2}","northern rhodesia","republic of zambia"]},{iso3:"ZWE",iso2:"ZW",m49:"716",name:"Zimbabwe",aliases:["\u{1F1FF}\u{1F1FC}","ezimbabwe","izimbabwe","republic of zimbabwe","rhodesia","southern rhodesia","zimbabwe rhodesia","zimbagwe"]}];function f(v){return v.normalize("NFD").replace(/[\u0300-\u036F]/g,"").normalize("NFC").toLowerCase().replace(/[\u064B-\u065F]/g,"").replace(/['\u2018\u2019\u02BB\u02BC\u02BD\u02C8\u2032`]/g,"").replace(/&/g," and ").replace(/([,(])\s*the\b/g,"$1").replace(/[.(),[\]]/g,"").replace(/[-\u2013\u2014]/g," ").replace(/\bst\b/g,"saint").trim().replace(/\s+/g," ").replace(/^the\s+/,"")}function h(v){let x=new Map,S=new Map,M=new Map;for(let A of v)x.set(A.iso3,A),A.iso2&&S.set(A.iso2,A),A.m49&&M.set(A.m49,A);let C=new Map;for(let A of v)for(let b of[A.name,...A.aliases]){let E=f(b),T=C.get(E);if(T!==void 0&&T!==A.iso3)throw new Error(`Duplicate name/alias "${E}": ${T} vs ${A.iso3}`);C.set(E,A.iso3)}function w(A){if(A==null)return;let b=String(A).trim();if(!b)return;if(/^\d+$/.test(b)){let T=M.get(String(parseInt(b,10)).padStart(3,"0"));if(T)return T}if(/^[A-Za-z]{2}$/.test(b)){let T=S.get(b.toUpperCase());if(T)return T}if(/^[A-Za-z]{3}$/.test(b)){let T=x.get(b.toUpperCase());if(T)return T}let E=C.get(f(b));return E===void 0?void 0:x.get(E)}function k(A){var b;return(b=w(A))==null?void 0:b.iso3}return{lookup:w,lookupAlpha3:k,byAlpha3:x,byAlpha2:S,byM49:M}}var d=h(c),p=d.lookup,g=d.lookupAlpha3,m=d.byAlpha3,y=d.byAlpha2,_=d.byM49}}),x4=de({"node_modules/@turf/helpers/dist/cjs/index.cjs"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=63710088e-1,t={centimeters:r*100,centimetres:r*100,degrees:360/(2*Math.PI),feet:r*3.28084,inches:r*39.37,kilometers:r/1e3,kilometres:r/1e3,meters:r,metres:r,miles:r/1609.344,millimeters:r*1e3,millimetres:r*1e3,nauticalmiles:r/1852,radians:1,yards:r*1.0936},i={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function a(D,R,P={}){let z={type:"Feature"};return(P.id===0||P.id)&&(z.id=P.id),P.bbox&&(z.bbox=P.bbox),z.properties=R||{},z.geometry=D,z}function o(D,R,P={}){switch(D){case"Point":return s(R).geometry;case"LineString":return c(R).geometry;case"Polygon":return n(R).geometry;case"MultiPoint":return p(R).geometry;case"MultiLineString":return d(R).geometry;case"MultiPolygon":return g(R).geometry;default:throw new Error(D+" is invalid")}}function s(D,R,P={}){if(!D)throw new Error("coordinates is required");if(!Array.isArray(D))throw new Error("coordinates must be an Array");if(D.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(D[0])||!b(D[1]))throw new Error("coordinates must contain numbers");return a({type:"Point",coordinates:D},R,P)}function l(D,R,P={}){return h(D.map(z=>s(z,R)),P)}function n(D,R,P={}){for(let I of D){if(I.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(I[I.length-1].length!==I[0].length)throw new Error("First and last Position are not equivalent.");for(let L=0;Ln(z,R)),P)}function c(D,R,P={}){if(D.length<2)throw new Error("coordinates must be an array of two or more positions");return a({type:"LineString",coordinates:D},R,P)}function f(D,R,P={}){return h(D.map(z=>c(z,R)),P)}function h(D,R={}){let P={type:"FeatureCollection"};return R.id&&(P.id=R.id),R.bbox&&(P.bbox=R.bbox),P.features=D,P}function d(D,R,P={}){return a({type:"MultiLineString",coordinates:D},R,P)}function p(D,R,P={}){return a({type:"MultiPoint",coordinates:D},R,P)}function g(D,R,P={}){return a({type:"MultiPolygon",coordinates:D},R,P)}function m(D,R,P={}){return a({type:"GeometryCollection",geometries:D},R,P)}function y(D,R=0){if(R&&!(R>=0))throw new Error("precision must be a positive number");let P=Math.pow(10,R||0);return Math.round(D*P)/P}function _(D,R="kilometers"){let P=t[R];if(!P)throw new Error(R+" units is invalid");return D*P}function v(D,R="kilometers"){let P=t[R];if(!P)throw new Error(R+" units is invalid");return D/P}function x(D,R){return C(v(D,R))}function S(D){let R=D%360;return R<0&&(R+=360),R}function M(D){return D=D%360,D>180?D-360:D<-180?D+360:D}function C(D){return D%(2*Math.PI)*180/Math.PI}function w(D){return D%360*Math.PI/180}function k(D,R="kilometers",P="kilometers"){if(!(D>=0))throw new Error("length must be a positive number");return _(v(D,R),P)}function A(D,R="meters",P="kilometers"){if(!(D>=0))throw new Error("area must be a positive number");let z=i[R];if(!z)throw new Error("invalid original units");let I=i[P];if(!I)throw new Error("invalid final units");return D/z*I}function b(D){return!isNaN(D)&&D!==null&&!Array.isArray(D)}function E(D){return D!==null&&typeof D=="object"&&!Array.isArray(D)}function T(D){if(!D)throw new Error("bbox is required");if(!Array.isArray(D))throw new Error("bbox must be an Array");if(D.length!==4&&D.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");D.forEach(R=>{if(!b(R))throw new Error("bbox must only contain numbers")})}function F(D){if(!D)throw new Error("id is required");if(["string","number"].indexOf(typeof D)===-1)throw new Error("id must be a number or a string")}e.areaFactors=i,e.azimuthToBearing=M,e.bearingToAzimuth=S,e.convertArea=A,e.convertLength=k,e.degreesToRadians=w,e.earthRadius=r,e.factors=t,e.feature=a,e.featureCollection=h,e.geometry=o,e.geometryCollection=m,e.isNumber=b,e.isObject=E,e.lengthToDegrees=x,e.lengthToRadians=v,e.lineString=c,e.lineStrings=f,e.multiLineString=d,e.multiPoint=p,e.multiPolygon=g,e.point=s,e.points=l,e.polygon=n,e.polygons=u,e.radiansToDegrees=C,e.radiansToLength=_,e.round=y,e.validateBBox=T,e.validateId=F}}),b4=de({"node_modules/@turf/meta/dist/cjs/index.cjs"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=x4();function t(v,x,S){if(v!==null)for(var M,C,w,k,A,b,E,T=0,F=0,D,R=v.type,P=R==="FeatureCollection",z=R==="Feature",I=P?v.features.length:1,L=0;Lb||P>E||z>T){A=F,b=M,E=P,T=z,w=0;return}var I=r.lineString.call(void 0,[A,F],S.properties);if(x(I,M,C,z,w)===!1)return!1;w++,A=F})===!1)return!1}}})}function p(v,x,S){var M=S,C=!1;return d(v,function(w,k,A,b,E){C===!1&&S===void 0?M=w:M=x(M,w,k,A,b,E),C=!0}),M}function g(v,x){if(!v)throw new Error("geojson is required");f(v,function(S,M,C){if(S.geometry!==null){var w=S.geometry.type,k=S.geometry.coordinates;switch(w){case"LineString":if(x(S,M,C,0,0)===!1)return!1;break;case"Polygon":for(var A=0;Af+a(h),0)}function a(c){let f=0,h;switch(c.type){case"Polygon":return o(c.coordinates);case"MultiPolygon":for(h=0;h0){f+=Math.abs(n(c[0]));for(let h=1;h=f?(d+2)%f:d+2],y=p[0]*l,_=g[1]*l,v=m[0]*l;h+=(v-y)*Math.sin(_),d++}return h*s}var u=i;e.area=i,e.default=u}}),VY=de({"node_modules/@turf/centroid/dist/cjs/index.cjs"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=x4(),t=b4();function i(o,s={}){let l=0,n=0,u=0;return t.coordEach.call(void 0,o,function(c){l+=c[0],n+=c[1],u++},!0),r.point.call(void 0,[l/u,n/u],s.properties)}var a=i;e.centroid=i,e.default=a}}),GY=de({"node_modules/d3-geo/node_modules/d3-array/dist/d3-array.js"(e,r){(function(t,i){i(typeof e=="object"&&typeof r<"u"?e:t.d3=t.d3||{})})(e,(function(t){"use strict";function i($,U){return $U?1:$>=U?0:NaN}function a($){return $.length===1&&($=o($)),{left:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)<0?j=Y+1:q=Y}return j},right:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)>0?q=Y:j=Y+1}return j}}}function o($){return function(U,V){return i($(U),V)}}var s=a(i),l=s.right,n=s.left;function u($,U){U==null&&(U=c);for(var V=0,j=$.length-1,q=$[0],Y=new Array(j<0?0:j);V$?1:U>=$?0:NaN}function d($){return $===null?NaN:+$}function p($,U){var V=$.length,j=0,q=-1,Y=0,K,te,ne=0;if(U==null)for(;++q1)return ne/(j-1)}function g($,U){var V=p($,U);return V&&Math.sqrt(V)}function m($,U){var V=$.length,j=-1,q,Y,K;if(U==null){for(;++j=q)for(Y=K=q;++jq&&(Y=q),K=q)for(Y=K=q;++jq&&(Y=q),K0)return[$];if((j=U<$)&&(Y=$,$=U,U=Y),(te=b($,U,V))===0||!isFinite(te))return[];if(te>0)for($=Math.ceil($/te),U=Math.floor(U/te),K=new Array(Y=Math.ceil(U-$+1));++q=0?(Y>=C?10:Y>=w?5:Y>=k?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(Y>=C?10:Y>=w?5:Y>=k?2:1)}function E($,U,V){var j=Math.abs(U-$)/Math.max(0,V),q=Math.pow(10,Math.floor(Math.log(j)/Math.LN10)),Y=j/q;return Y>=C?q*=10:Y>=w?q*=5:Y>=k&&(q*=2),U<$?-q:q}function T($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function F(){var $=S,U=m,V=T;function j(q){var Y,K=q.length,te,ne=new Array(K);for(Y=0;Yce;)pe.pop(),--xe;var ye=new Array(xe+1),fe;for(Y=0;Y<=xe;++Y)fe=ye[Y]=[],fe.x0=Y>0?pe[Y-1]:le,fe.x1=Y=1)return+V($[j-1],j-1,$);var j,q=(j-1)*U,Y=Math.floor(q),K=+V($[Y],Y,$),te=+V($[Y+1],Y+1,$);return K+(te-K)*(q-Y)}}function R($,U,V){return $=v.call($,d).sort(i),Math.ceil((V-U)/(2*(D($,.75)-D($,.25))*Math.pow($.length,-1/3)))}function P($,U,V){return Math.ceil((V-U)/(3.5*g($)*Math.pow($.length,-1/3)))}function z($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jY&&(Y=q)}else for(;++j=q)for(Y=q;++jY&&(Y=q);return Y}function I($,U){var V=$.length,j=V,q=-1,Y,K=0;if(U==null)for(;++q=0;)for(K=$[U],V=K.length;--V>=0;)Y[--q]=K[V];return Y}function O($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jq&&(Y=q)}else for(;++j=q)for(Y=q;++jq&&(Y=q);return Y}function G($,U){for(var V=U.length,j=new Array(V);V--;)j[V]=$[U[V]];return j}function W($,U){if(V=$.length){var V,j=0,q=0,Y,K=$[q];for(U==null&&(U=i);++j0?1:nt<0?-1:0},A=Math.sqrt,b=Math.tan;function E(nt){return nt>1?0:nt<-1?c:Math.acos(nt)}function T(nt){return nt>1?f:nt<-1?-f:Math.asin(nt)}function F(nt){return(nt=w(nt/2))*nt}function D(){}function R(nt,Tt){nt&&z.hasOwnProperty(nt.type)&&z[nt.type](nt,Tt)}var P={Feature:function(nt,Tt){R(nt.geometry,Tt)},FeatureCollection:function(nt,Tt){for(var Jt=nt.features,Bt=-1,yr=Jt.length;++Bt=0?1:-1,yr=Bt*Jt,zr=v(Tt),Gr=w(Tt),ii=N*Gr,li=J*zr+ii*v(yr),Fi=ii*Bt*w(yr);O.add(_(Fi,li)),Z=nt,J=zr,N=Gr}function q(nt){return G.reset(),B(nt,H),G*2}function Y(nt){return[_(nt[1],nt[0]),T(nt[2])]}function K(nt){var Tt=nt[0],Jt=nt[1],Bt=v(Jt);return[Bt*v(Tt),Bt*w(Tt),w(Jt)]}function te(nt,Tt){return nt[0]*Tt[0]+nt[1]*Tt[1]+nt[2]*Tt[2]}function ne(nt,Tt){return[nt[1]*Tt[2]-nt[2]*Tt[1],nt[2]*Tt[0]-nt[0]*Tt[2],nt[0]*Tt[1]-nt[1]*Tt[0]]}function se(nt,Tt){nt[0]+=Tt[0],nt[1]+=Tt[1],nt[2]+=Tt[2]}function le(nt,Tt){return[nt[0]*Tt,nt[1]*Tt,nt[2]*Tt]}function ce(nt){var Tt=A(nt[0]*nt[0]+nt[1]*nt[1]+nt[2]*nt[2]);nt[0]/=Tt,nt[1]/=Tt,nt[2]/=Tt}var pe,xe,ye,fe,ae,ee,ie,Q,ue=a(),ge,Me,Te={point:je,lineStart:Ke,lineEnd:Je,polygonStart:function(){Te.point=vt,Te.lineStart=xt,Te.lineEnd=Pt,ue.reset(),H.polygonStart()},polygonEnd:function(){H.polygonEnd(),Te.point=je,Te.lineStart=Ke,Te.lineEnd=Je,O<0?(pe=-(ye=180),xe=-(fe=90)):ue>n?fe=90:ue<-n&&(xe=-90),Me[0]=pe,Me[1]=ye},sphere:function(){pe=-(ye=180),xe=-(fe=90)}};function je(nt,Tt){ge.push(Me=[pe=nt,ye=nt]),Ttfe&&(fe=Tt)}function Ve(nt,Tt){var Jt=K([nt*g,Tt*g]);if(Q){var Bt=ne(Q,Jt),yr=[Bt[1],-Bt[0],0],zr=ne(yr,Bt);ce(zr),zr=Y(zr);var Gr=nt-ae,ii=Gr>0?1:-1,li=zr[0]*p*ii,Fi,$r=m(Gr)>180;$r^(ii*aefe&&(fe=Fi)):(li=(li+360)%360-180,$r^(ii*aefe&&(fe=Tt))),$r?ntmt(pe,ye)&&(ye=nt):mt(nt,ye)>mt(pe,ye)&&(pe=nt):ye>=pe?(ntye&&(ye=nt)):nt>ae?mt(pe,nt)>mt(pe,ye)&&(ye=nt):mt(nt,ye)>mt(pe,ye)&&(pe=nt)}else ge.push(Me=[pe=nt,ye=nt]);Ttfe&&(fe=Tt),Q=Jt,ae=nt}function Ke(){Te.point=Ve}function Je(){Me[0]=pe,Me[1]=ye,Te.point=je,Q=null}function vt(nt,Tt){if(Q){var Jt=nt-ae;ue.add(m(Jt)>180?Jt+(Jt>0?360:-360):Jt)}else ee=nt,ie=Tt;H.point(nt,Tt),Ve(nt,Tt)}function xt(){H.lineStart()}function Pt(){vt(ee,ie),H.lineEnd(),m(ue)>n&&(pe=-(ye=180)),Me[0]=pe,Me[1]=ye,Q=null}function mt(nt,Tt){return(Tt-=nt)<0?Tt+360:Tt}function Mt(nt,Tt){return nt[0]-Tt[0]}function lt(nt,Tt){return nt[0]<=nt[1]?nt[0]<=Tt&&Tt<=nt[1]:Ttmt(Bt[0],Bt[1])&&(Bt[1]=yr[1]),mt(yr[0],Bt[1])>mt(Bt[0],Bt[1])&&(Bt[0]=yr[0])):zr.push(Bt=yr);for(Gr=-1/0,Jt=zr.length-1,Tt=0,Bt=zr[Jt];Tt<=Jt;Bt=yr,++Tt)yr=zr[Tt],(ii=mt(Bt[1],yr[0]))>Gr&&(Gr=ii,pe=yr[0],ye=Bt[1])}return ge=Me=null,pe===1/0||xe===1/0?[[NaN,NaN],[NaN,NaN]]:[[pe,xe],[ye,fe]]}var Ye,me,_e,Ae,ke,Ee,De,Qe,Ue,at,rt,ht,At,dt,Ht,fr,gt={sphere:D,point:yt,lineStart:Lt,lineEnd:mr,polygonStart:function(){gt.lineStart=br,gt.lineEnd=Er},polygonEnd:function(){gt.lineStart=Lt,gt.lineEnd=mr}};function yt(nt,Tt){nt*=g,Tt*=g;var Jt=v(Tt);kt(Jt*v(nt),Jt*w(nt),w(Tt))}function kt(nt,Tt,Jt){++Ye,_e+=(nt-_e)/Ye,Ae+=(Tt-Ae)/Ye,ke+=(Jt-ke)/Ye}function Lt(){gt.point=Ct}function Ct(nt,Tt){nt*=g,Tt*=g;var Jt=v(Tt);dt=Jt*v(nt),Ht=Jt*w(nt),fr=w(Tt),gt.point=$t,kt(dt,Ht,fr)}function $t(nt,Tt){nt*=g,Tt*=g;var Jt=v(Tt),Bt=Jt*v(nt),yr=Jt*w(nt),zr=w(Tt),Gr=_(A((Gr=Ht*zr-fr*yr)*Gr+(Gr=fr*Bt-dt*zr)*Gr+(Gr=dt*yr-Ht*Bt)*Gr),dt*Bt+Ht*yr+fr*zr);me+=Gr,Ee+=Gr*(dt+(dt=Bt)),De+=Gr*(Ht+(Ht=yr)),Qe+=Gr*(fr+(fr=zr)),kt(dt,Ht,fr)}function mr(){gt.point=yt}function br(){gt.point=Tr}function Er(){Ur(ht,At),gt.point=yt}function Tr(nt,Tt){ht=nt,At=Tt,nt*=g,Tt*=g,gt.point=Ur;var Jt=v(Tt);dt=Jt*v(nt),Ht=Jt*w(nt),fr=w(Tt),kt(dt,Ht,fr)}function Ur(nt,Tt){nt*=g,Tt*=g;var Jt=v(Tt),Bt=Jt*v(nt),yr=Jt*w(nt),zr=w(Tt),Gr=Ht*zr-fr*yr,ii=fr*Bt-dt*zr,li=dt*yr-Ht*Bt,Fi=A(Gr*Gr+ii*ii+li*li),$r=T(Fi),ni=Fi&&-$r/Fi;Ue+=ni*Gr,at+=ni*ii,rt+=ni*li,me+=$r,Ee+=$r*(dt+(dt=Bt)),De+=$r*(Ht+(Ht=yr)),Qe+=$r*(fr+(fr=zr)),kt(dt,Ht,fr)}function Ai(nt){Ye=me=_e=Ae=ke=Ee=De=Qe=Ue=at=rt=0,B(nt,gt);var Tt=Ue,Jt=at,Bt=rt,yr=Tt*Tt+Jt*Jt+Bt*Bt;return yrc?nt+Math.round(-nt/d)*d:nt,Tt]}ea.invert=ea;function $i(nt,Tt,Jt){return(nt%=d)?Tt||Jt?Qr(ya(nt),pa(Tt,Jt)):ya(nt):Tt||Jt?pa(Tt,Jt):ea}function ja(nt){return function(Tt,Jt){return Tt+=nt,[Tt>c?Tt-d:Tt<-c?Tt+d:Tt,Jt]}}function ya(nt){var Tt=ja(nt);return Tt.invert=ja(-nt),Tt}function pa(nt,Tt){var Jt=v(nt),Bt=w(nt),yr=v(Tt),zr=w(Tt);function Gr(ii,li){var Fi=v(li),$r=v(ii)*Fi,ni=w(ii)*Fi,ui=w(li),Di=ui*Jt+$r*Bt;return[_(ni*yr-Di*zr,$r*Jt-ui*Bt),T(Di*yr+ni*zr)]}return Gr.invert=function(ii,li){var Fi=v(li),$r=v(ii)*Fi,ni=w(ii)*Fi,ui=w(li),Di=ui*yr-ni*zr;return[_(ni*yr+ui*zr,$r*Jt+Di*Bt),T(Di*Jt-$r*Bt)]},Gr}function xi(nt){nt=$i(nt[0]*g,nt[1]*g,nt.length>2?nt[2]*g:0);function Tt(Jt){return Jt=nt(Jt[0]*g,Jt[1]*g),Jt[0]*=p,Jt[1]*=p,Jt}return Tt.invert=function(Jt){return Jt=nt.invert(Jt[0]*g,Jt[1]*g),Jt[0]*=p,Jt[1]*=p,Jt},Tt}function bi(nt,Tt,Jt,Bt,yr,zr){if(Jt){var Gr=v(Tt),ii=w(Tt),li=Bt*Jt;yr==null?(yr=Tt+Bt*d,zr=Tt-li/2):(yr=Ua(Gr,yr),zr=Ua(Gr,zr),(Bt>0?yrzr)&&(yr+=Bt*d));for(var Fi,$r=yr;Bt>0?$r>zr:$r1&&nt.push(nt.pop().concat(nt.shift()))},result:function(){var Jt=nt;return nt=[],Tt=null,Jt}}}function Jr(nt,Tt){return m(nt[0]-Tt[0])=0;--ii)yr.point((ni=$r[ii])[0],ni[1]);else Bt(ui.x,ui.p.x,-1,yr);ui=ui.p}ui=ui.o,$r=ui.z,Di=!Di}while(!ui.v);yr.lineEnd()}}}function Et(nt){if(Tt=nt.length){for(var Tt,Jt=0,Bt=nt[0],yr;++Jt=0?1:-1,wo=zo*po,$o=wo>c,io=Oa*vn;if(St.add(_(io*zo*w(wo),Pa*Dn+io*v(wo))),Gr+=$o?po+zo*d:po,$o^Di>=Jt^Zi>=Jt){var Us=ne(K(ui),K(rn));ce(Us);var gs=ne(zr,Us);ce(gs);var Go=($o^po>=0?-1:1)*T(gs[2]);(Bt>Go||Bt===Go&&(Us[0]||Us[1]))&&(ii+=$o^po>=0?1:-1)}}return(Gr<-n||Gr0){for(li||(yr.polygonStart(),li=!0),yr.lineStart(),Dn=0;Dn1&&sa&2&&vn.push(vn.pop().concat(vn.shift())),$r.push(vn.filter(ze))}}return ui}}function ze(nt){return nt.length>1}function tt(nt,Tt){return((nt=nt.x)[0]<0?nt[1]-f-n:f-nt[1])-((Tt=Tt.x)[0]<0?Tt[1]-f-n:f-Tt[1])}var ft=Yt(function(){return!0},wt,It,[-c,-f]);function wt(nt){var Tt=NaN,Jt=NaN,Bt=NaN,yr;return{lineStart:function(){nt.lineStart(),yr=1},point:function(zr,Gr){var ii=zr>0?c:-c,li=m(zr-Tt);m(li-c)0?f:-f),nt.point(Bt,Jt),nt.lineEnd(),nt.lineStart(),nt.point(ii,Jt),nt.point(zr,Jt),yr=0):Bt!==ii&&li>=c&&(m(Tt-Bt)n?y((w(Tt)*(zr=v(Bt))*w(Jt)-w(Bt)*(yr=v(Tt))*w(nt))/(yr*zr*Gr)):(Tt+Bt)/2}function It(nt,Tt,Jt,Bt){var yr;if(nt==null)yr=Jt*f,Bt.point(-c,yr),Bt.point(0,yr),Bt.point(c,yr),Bt.point(c,0),Bt.point(c,-yr),Bt.point(0,-yr),Bt.point(-c,-yr),Bt.point(-c,0),Bt.point(-c,yr);else if(m(nt[0]-Tt[0])>n){var zr=nt[0]0,yr=m(Tt)>n;function zr($r,ni,ui,Di){bi(Di,nt,Jt,ui,$r,ni)}function Gr($r,ni){return v($r)*v(ni)>Tt}function ii($r){var ni,ui,Di,Wi,Oa;return{lineStart:function(){Wi=Di=!1,Oa=1},point:function(Pa,Ja){var rn=[Pa,Ja],Zi,sa=Gr(Pa,Ja),vn=Bt?sa?0:Fi(Pa,Ja):sa?Fi(Pa+(Pa<0?c:-c),Ja):0;if(!ni&&(Wi=Di=sa)&&$r.lineStart(),sa!==Di&&(Zi=li(ni,rn),(!Zi||Jr(ni,Zi)||Jr(rn,Zi))&&(rn[2]=1)),sa!==Di)Oa=0,sa?($r.lineStart(),Zi=li(rn,ni),$r.point(Zi[0],Zi[1])):(Zi=li(ni,rn),$r.point(Zi[0],Zi[1],2),$r.lineEnd()),ni=Zi;else if(yr&&ni&&Bt^sa){var Dn;!(vn&ui)&&(Dn=li(rn,ni,!0))&&(Oa=0,Bt?($r.lineStart(),$r.point(Dn[0][0],Dn[0][1]),$r.point(Dn[1][0],Dn[1][1]),$r.lineEnd()):($r.point(Dn[1][0],Dn[1][1]),$r.lineEnd(),$r.lineStart(),$r.point(Dn[0][0],Dn[0][1],3)))}sa&&(!ni||!Jr(ni,rn))&&$r.point(rn[0],rn[1]),ni=rn,Di=sa,ui=vn},lineEnd:function(){Di&&$r.lineEnd(),ni=null},clean:function(){return Oa|(Wi&&Di)<<1}}}function li($r,ni,ui){var Di=K($r),Wi=K(ni),Oa=[1,0,0],Pa=ne(Di,Wi),Ja=te(Pa,Pa),rn=Pa[0],Zi=Ja-rn*rn;if(!Zi)return!ui&&$r;var sa=Tt*Ja/Zi,vn=-Tt*rn/Zi,Dn=ne(Oa,Pa),po=le(Oa,sa),zo=le(Pa,vn);se(po,zo);var wo=Dn,$o=te(po,wo),io=te(wo,wo),Us=$o*$o-io*(te(po,po)-1);if(!(Us<0)){var gs=A(Us),Go=le(wo,(-$o-gs)/io);if(se(Go,po),Go=Y(Go),!ui)return Go;var ma=$r[0],vo=ni[0],Ls=$r[1],qs=ni[1],Ll;vo0^Go[1]<(m(Go[0]-ma)c^(ma<=Go[0]&&Go[0]<=vo)){var bl=le(wo,(-$o+gs)/io);return se(bl,po),[Go,Y(bl)]}}}function Fi($r,ni){var ui=Bt?nt:c-nt,Di=0;return $r<-ui?Di|=1:$r>ui&&(Di|=2),ni<-ui?Di|=4:ni>ui&&(Di|=8),Di}return Yt(Gr,ii,zr,Bt?[0,-nt]:[-c,nt-c])}function qt(nt,Tt,Jt,Bt,yr,zr){var Gr=nt[0],ii=nt[1],li=Tt[0],Fi=Tt[1],$r=0,ni=1,ui=li-Gr,Di=Fi-ii,Wi;if(Wi=Jt-Gr,!(!ui&&Wi>0)){if(Wi/=ui,ui<0){if(Wi<$r)return;Wi0){if(Wi>ni)return;Wi>$r&&($r=Wi)}if(Wi=yr-Gr,!(!ui&&Wi<0)){if(Wi/=ui,ui<0){if(Wi>ni)return;Wi>$r&&($r=Wi)}else if(ui>0){if(Wi<$r)return;Wi0)){if(Wi/=Di,Di<0){if(Wi<$r)return;Wi0){if(Wi>ni)return;Wi>$r&&($r=Wi)}if(Wi=zr-ii,!(!Di&&Wi<0)){if(Wi/=Di,Di<0){if(Wi>ni)return;Wi>$r&&($r=Wi)}else if(Di>0){if(Wi<$r)return;Wi0&&(nt[0]=Gr+$r*ui,nt[1]=ii+$r*Di),ni<1&&(Tt[0]=Gr+ni*ui,Tt[1]=ii+ni*Di),!0}}}}}var vr=1e9,Br=-vr;function Pr(nt,Tt,Jt,Bt){function yr(Fi,$r){return nt<=Fi&&Fi<=Jt&&Tt<=$r&&$r<=Bt}function zr(Fi,$r,ni,ui){var Di=0,Wi=0;if(Fi==null||(Di=Gr(Fi,ni))!==(Wi=Gr($r,ni))||li(Fi,$r)<0^ni>0)do ui.point(Di===0||Di===3?nt:Jt,Di>1?Bt:Tt);while((Di=(Di+ni+4)%4)!==Wi);else ui.point($r[0],$r[1])}function Gr(Fi,$r){return m(Fi[0]-nt)0?0:3:m(Fi[0]-Jt)0?2:1:m(Fi[1]-Tt)0?1:0:$r>0?3:2}function ii(Fi,$r){return li(Fi.x,$r.x)}function li(Fi,$r){var ni=Gr(Fi,1),ui=Gr($r,1);return ni!==ui?ni-ui:ni===0?$r[1]-Fi[1]:ni===1?Fi[0]-$r[0]:ni===2?Fi[1]-$r[1]:$r[0]-Fi[0]}return function(Fi){var $r=Fi,ni=pi(),ui,Di,Wi,Oa,Pa,Ja,rn,Zi,sa,vn,Dn,po={point:zo,lineStart:Us,lineEnd:gs,polygonStart:$o,polygonEnd:io};function zo(ma,vo){yr(ma,vo)&&$r.point(ma,vo)}function wo(){for(var ma=0,vo=0,Ls=Di.length;voBt&&(Uu-ac)*(Bt-bl)>(Fc-bl)*(nt-ac)&&++ma:Fc<=Bt&&(Uu-ac)*(Bt-bl)<(Fc-bl)*(nt-ac)&&--ma;return ma}function $o(){$r=ni,ui=[],Di=[],Dn=!0}function io(){var ma=wo(),vo=Dn&&ma,Ls=(ui=i.merge(ui)).length;(vo||Ls)&&(Fi.polygonStart(),vo&&(Fi.lineStart(),zr(null,null,1,Fi),Fi.lineEnd()),Ls&&Fe(ui,ii,ma,zr,Fi),Fi.polygonEnd()),$r=Fi,ui=Di=Wi=null}function Us(){po.point=Go,Di&&Di.push(Wi=[]),vn=!0,sa=!1,rn=Zi=NaN}function gs(){ui&&(Go(Oa,Pa),Ja&&sa&&ni.rejoin(),ui.push(ni.result())),po.point=zo,sa&&$r.lineEnd()}function Go(ma,vo){var Ls=yr(ma,vo);if(Di&&Wi.push([ma,vo]),vn)Oa=ma,Pa=vo,Ja=Ls,vn=!1,Ls&&($r.lineStart(),$r.point(ma,vo));else if(Ls&&sa)$r.point(ma,vo);else{var qs=[rn=Math.max(Br,Math.min(vr,rn)),Zi=Math.max(Br,Math.min(vr,Zi))],Ll=[ma=Math.max(Br,Math.min(vr,ma)),vo=Math.max(Br,Math.min(vr,vo))];qt(qs,Ll,nt,Tt,Jt,Bt)?(sa||($r.lineStart(),$r.point(qs[0],qs[1])),$r.point(Ll[0],Ll[1]),Ls||$r.lineEnd(),Dn=!1):Ls&&($r.lineStart(),$r.point(ma,vo),Dn=!1)}rn=ma,Zi=vo,sa=Ls}return po}}function Mi(){var nt=0,Tt=0,Jt=960,Bt=500,yr,zr,Gr;return Gr={stream:function(ii){return yr&&zr===ii?yr:yr=Pr(nt,Tt,Jt,Bt)(zr=ii)},extent:function(ii){return arguments.length?(nt=+ii[0][0],Tt=+ii[0][1],Jt=+ii[1][0],Bt=+ii[1][1],yr=zr=null,Gr):[[nt,Tt],[Jt,Bt]]}}}var gi=a(),ba,Hi,Za,oa={sphere:D,point:D,lineStart:Cn,lineEnd:D,polygonStart:D,polygonEnd:D};function Cn(){oa.point=Li,oa.lineEnd=_n}function _n(){oa.point=oa.lineEnd=D}function Li(nt,Tt){nt*=g,Tt*=g,ba=nt,Hi=w(Tt),Za=v(Tt),oa.point=In}function In(nt,Tt){nt*=g,Tt*=g;var Jt=w(Tt),Bt=v(Tt),yr=m(nt-ba),zr=v(yr),Gr=w(yr),ii=Bt*Gr,li=Za*Jt-Hi*Bt*zr,Fi=Hi*Jt+Za*Bt*zr;gi.add(_(A(ii*ii+li*li),Fi)),ba=nt,Hi=Jt,Za=Bt}function pn(nt){return gi.reset(),B(nt,oa),+gi}var Ka=[null,null],Rn={type:"LineString",coordinates:Ka};function tn(nt,Tt){return Ka[0]=nt,Ka[1]=Tt,pn(Rn)}var Mn={Feature:function(nt,Tt){return zn(nt.geometry,Tt)},FeatureCollection:function(nt,Tt){for(var Jt=nt.features,Bt=-1,yr=Jt.length;++Bt0&&(yr=tn(nt[zr],nt[zr-1]),yr>0&&Jt<=yr&&Bt<=yr&&(Jt+Bt-yr)*(1-Math.pow((Jt-Bt)/yr,2))n}).map(ui)).concat(i.range(x(zr/Fi)*Fi,yr,Fi).filter(function(Zi){return m(Zi%ni)>n}).map(Di))}return Ja.lines=function(){return rn().map(function(Zi){return{type:"LineString",coordinates:Zi}})},Ja.outline=function(){return{type:"Polygon",coordinates:[Wi(Bt).concat(Oa(Gr).slice(1),Wi(Jt).reverse().slice(1),Oa(ii).reverse().slice(1))]}},Ja.extent=function(Zi){return arguments.length?Ja.extentMajor(Zi).extentMinor(Zi):Ja.extentMinor()},Ja.extentMajor=function(Zi){return arguments.length?(Bt=+Zi[0][0],Jt=+Zi[1][0],ii=+Zi[0][1],Gr=+Zi[1][1],Bt>Jt&&(Zi=Bt,Bt=Jt,Jt=Zi),ii>Gr&&(Zi=ii,ii=Gr,Gr=Zi),Ja.precision(Pa)):[[Bt,ii],[Jt,Gr]]},Ja.extentMinor=function(Zi){return arguments.length?(Tt=+Zi[0][0],nt=+Zi[1][0],zr=+Zi[0][1],yr=+Zi[1][1],Tt>nt&&(Zi=Tt,Tt=nt,nt=Zi),zr>yr&&(Zi=zr,zr=yr,yr=Zi),Ja.precision(Pa)):[[Tt,zr],[nt,yr]]},Ja.step=function(Zi){return arguments.length?Ja.stepMajor(Zi).stepMinor(Zi):Ja.stepMinor()},Ja.stepMajor=function(Zi){return arguments.length?($r=+Zi[0],ni=+Zi[1],Ja):[$r,ni]},Ja.stepMinor=function(Zi){return arguments.length?(li=+Zi[0],Fi=+Zi[1],Ja):[li,Fi]},Ja.precision=function(Zi){return arguments.length?(Pa=+Zi,ui=Jn(zr,yr,90),Di=lo(Tt,nt,Pa),Wi=Jn(ii,Gr,90),Oa=lo(Bt,Jt,Pa),Ja):Pa},Ja.extentMajor([[-180,-90+n],[180,90-n]]).extentMinor([[-180,-80-n],[180,80+n]])}function uo(){return Fo()()}function Qn(nt,Tt){var Jt=nt[0]*g,Bt=nt[1]*g,yr=Tt[0]*g,zr=Tt[1]*g,Gr=v(Bt),ii=w(Bt),li=v(zr),Fi=w(zr),$r=Gr*v(Jt),ni=Gr*w(Jt),ui=li*v(yr),Di=li*w(yr),Wi=2*T(A(F(zr-Bt)+Gr*li*F(yr-Jt))),Oa=w(Wi),Pa=Wi?function(Ja){var rn=w(Ja*=Wi)/Oa,Zi=w(Wi-Ja)/Oa,sa=Zi*$r+rn*ui,vn=Zi*ni+rn*Di,Dn=Zi*ii+rn*Fi;return[_(vn,sa)*p,_(Dn,A(sa*sa+vn*vn))*p]}:function(){return[Jt*p,Bt*p]};return Pa.distance=Wi,Pa}function jo(nt){return nt}var Yn=a(),Bn=a(),ps,xo,no,Mo,Vn={point:D,lineStart:D,lineEnd:D,polygonStart:function(){Vn.lineStart=ts,Vn.lineEnd=nl},polygonEnd:function(){Vn.lineStart=Vn.lineEnd=Vn.point=D,Yn.add(m(Bn)),Bn.reset()},result:function(){var nt=Yn/2;return Yn.reset(),nt}};function ts(){Vn.point=ws}function ws(nt,Tt){Vn.point=So,ps=no=nt,xo=Mo=Tt}function So(nt,Tt){Bn.add(Mo*nt-no*Tt),no=nt,Mo=Tt}function nl(){So(ps,xo)}var vs=1/0,go=vs,Xn=-vs,On=Xn,Uo={point:kl,lineStart:D,lineEnd:D,polygonStart:D,polygonEnd:D,result:function(){var nt=[[vs,go],[Xn,On]];return Xn=On=-(go=vs=1/0),nt}};function kl(nt,Tt){ntXn&&(Xn=nt),TtOn&&(On=Tt)}var mu=0,Ul=0,gu=0,yu=0,Fu=0,au=0,xc=0,Pu=0,Cl=0,bc,Iu,_l,ms,ss={point:fl,lineStart:wc,lineEnd:Th,polygonStart:function(){ss.lineStart=Ah,ss.lineEnd=zd},polygonEnd:function(){ss.point=fl,ss.lineStart=wc,ss.lineEnd=Th},result:function(){var nt=Cl?[xc/Cl,Pu/Cl]:au?[yu/au,Fu/au]:gu?[mu/gu,Ul/gu]:[NaN,NaN];return mu=Ul=gu=yu=Fu=au=xc=Pu=Cl=0,nt}};function fl(nt,Tt){mu+=nt,Ul+=Tt,++gu}function wc(){ss.point=Tc}function Tc(nt,Tt){ss.point=tc,fl(_l=nt,ms=Tt)}function tc(nt,Tt){var Jt=nt-_l,Bt=Tt-ms,yr=A(Jt*Jt+Bt*Bt);yu+=yr*(_l+nt)/2,Fu+=yr*(ms+Tt)/2,au+=yr,fl(_l=nt,ms=Tt)}function Th(){ss.point=fl}function Ah(){ss.point=hp}function zd(){Ru(bc,Iu)}function hp(nt,Tt){ss.point=Ru,fl(bc=_l=nt,Iu=ms=Tt)}function Ru(nt,Tt){var Jt=nt-_l,Bt=Tt-ms,yr=A(Jt*Jt+Bt*Bt);yu+=yr*(_l+nt)/2,Fu+=yr*(ms+Tt)/2,au+=yr,yr=ms*nt-_l*Tt,xc+=yr*(_l+nt),Pu+=yr*(ms+Tt),Cl+=yr*3,fl(_l=nt,ms=Tt)}function Ts(nt){this._context=nt}Ts.prototype={_radius:4.5,pointRadius:function(nt){return this._radius=nt,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(nt,Tt){switch(this._point){case 0:{this._context.moveTo(nt,Tt),this._point=1;break}case 1:{this._context.lineTo(nt,Tt);break}default:{this._context.moveTo(nt+this._radius,Tt),this._context.arc(nt,Tt,this._radius,0,d);break}}},result:D};var Mh=a(),vf,Ac,Sh,Mc,$c,zu={point:D,lineStart:function(){zu.point=mf},lineEnd:function(){vf&&jf(Ac,Sh),zu.point=D},polygonStart:function(){vf=!0},polygonEnd:function(){vf=null},result:function(){var nt=+Mh;return Mh.reset(),nt}};function mf(nt,Tt){zu.point=jf,Ac=Mc=nt,Sh=$c=Tt}function jf(nt,Tt){Mc-=nt,$c-=Tt,Mh.add(A(Mc*Mc+$c*$c)),Mc=nt,$c=Tt}function Sc(){this._string=[]}Sc.prototype={_radius:4.5,_circle:ad(4.5),pointRadius:function(nt){return(nt=+nt)!==this._radius&&(this._radius=nt,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(nt,Tt){switch(this._point){case 0:{this._string.push("M",nt,",",Tt),this._point=1;break}case 1:{this._string.push("L",nt,",",Tt);break}default:{this._circle==null&&(this._circle=ad(this._radius)),this._string.push("M",nt,",",Tt,this._circle);break}}},result:function(){if(this._string.length){var nt=this._string.join("");return this._string=[],nt}else return null}};function ad(nt){return"m0,"+nt+"a"+nt+","+nt+" 0 1,1 0,"+-2*nt+"a"+nt+","+nt+" 0 1,1 0,"+2*nt+"z"}function Uf(nt,Tt){var Jt=4.5,Bt,yr;function zr(Gr){return Gr&&(typeof Jt=="function"&&yr.pointRadius(+Jt.apply(this,arguments)),B(Gr,Bt(yr))),yr.result()}return zr.area=function(Gr){return B(Gr,Bt(Vn)),Vn.result()},zr.measure=function(Gr){return B(Gr,Bt(zu)),zu.result()},zr.bounds=function(Gr){return B(Gr,Bt(Uo)),Uo.result()},zr.centroid=function(Gr){return B(Gr,Bt(ss)),ss.result()},zr.projection=function(Gr){return arguments.length?(Bt=Gr==null?(nt=null,jo):(nt=Gr).stream,zr):nt},zr.context=function(Gr){return arguments.length?(yr=Gr==null?(Tt=null,new Sc):new Ts(Tt=Gr),typeof Jt!="function"&&yr.pointRadius(Jt),zr):Tt},zr.pointRadius=function(Gr){return arguments.length?(Jt=typeof Gr=="function"?Gr:(yr.pointRadius(+Gr),+Gr),zr):Jt},zr.projection(nt).context(Tt)}function Bd(nt){return{stream:Bu(nt)}}function Bu(nt){return function(Tt){var Jt=new Eh;for(var Bt in nt)Jt[Bt]=nt[Bt];return Jt.stream=Tt,Jt}}function Eh(){}Eh.prototype={constructor:Eh,point:function(nt,Tt){this.stream.point(nt,Tt)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function _u(nt,Tt,Jt){var Bt=nt.clipExtent&&nt.clipExtent();return nt.scale(150).translate([0,0]),Bt!=null&&nt.clipExtent(null),B(Jt,nt.stream(Uo)),Tt(Uo.result()),Bt!=null&&nt.clipExtent(Bt),nt}function qf(nt,Tt,Jt){return _u(nt,function(Bt){var yr=Tt[1][0]-Tt[0][0],zr=Tt[1][1]-Tt[0][1],Gr=Math.min(yr/(Bt[1][0]-Bt[0][0]),zr/(Bt[1][1]-Bt[0][1])),ii=+Tt[0][0]+(yr-Gr*(Bt[1][0]+Bt[0][0]))/2,li=+Tt[0][1]+(zr-Gr*(Bt[1][1]+Bt[0][1]))/2;nt.scale(150*Gr).translate([ii,li])},Jt)}function Dl(nt,Tt,Jt){return qf(nt,[[0,0],Tt],Jt)}function gf(nt,Tt,Jt){return _u(nt,function(Bt){var yr=+Tt,zr=yr/(Bt[1][0]-Bt[0][0]),Gr=(yr-zr*(Bt[1][0]+Bt[0][0]))/2,ii=-zr*Bt[0][1];nt.scale(150*zr).translate([Gr,ii])},Jt)}function Ou(nt,Tt,Jt){return _u(nt,function(Bt){var yr=+Tt,zr=yr/(Bt[1][1]-Bt[0][1]),Gr=-zr*Bt[0][0],ii=(yr-zr*(Bt[1][1]+Bt[0][1]))/2;nt.scale(150*zr).translate([Gr,ii])},Jt)}var yf=16,_f=v(30*g);function Vf(nt,Tt){return+Tt?Ec(nt,Tt):kh(nt)}function kh(nt){return Bu({point:function(Tt,Jt){Tt=nt(Tt,Jt),this.stream.point(Tt[0],Tt[1])}})}function Ec(nt,Tt){function Jt(Bt,yr,zr,Gr,ii,li,Fi,$r,ni,ui,Di,Wi,Oa,Pa){var Ja=Fi-Bt,rn=$r-yr,Zi=Ja*Ja+rn*rn;if(Zi>4*Tt&&Oa--){var sa=Gr+ui,vn=ii+Di,Dn=li+Wi,po=A(sa*sa+vn*vn+Dn*Dn),zo=T(Dn/=po),wo=m(m(Dn)-1)Tt||m((Ja*gs+rn*Go)/Zi-.5)>.3||Gr*ui+ii*Di+li*Wi<_f)&&(Jt(Bt,yr,zr,Gr,ii,li,io,Us,wo,sa/=po,vn/=po,Dn,Oa,Pa),Pa.point(io,Us),Jt(io,Us,wo,sa,vn,Dn,Fi,$r,ni,ui,Di,Wi,Oa,Pa))}}return function(Bt){var yr,zr,Gr,ii,li,Fi,$r,ni,ui,Di,Wi,Oa,Pa={point:Ja,lineStart:rn,lineEnd:sa,polygonStart:function(){Bt.polygonStart(),Pa.lineStart=vn},polygonEnd:function(){Bt.polygonEnd(),Pa.lineStart=rn}};function Ja(zo,wo){zo=nt(zo,wo),Bt.point(zo[0],zo[1])}function rn(){ni=NaN,Pa.point=Zi,Bt.lineStart()}function Zi(zo,wo){var $o=K([zo,wo]),io=nt(zo,wo);Jt(ni,ui,$r,Di,Wi,Oa,ni=io[0],ui=io[1],$r=zo,Di=$o[0],Wi=$o[1],Oa=$o[2],yf,Bt),Bt.point(ni,ui)}function sa(){Pa.point=Ja,Bt.lineEnd()}function vn(){rn(),Pa.point=Dn,Pa.lineEnd=po}function Dn(zo,wo){Zi(yr=zo,wo),zr=ni,Gr=ui,ii=Di,li=Wi,Fi=Oa,Pa.point=Zi}function po(){Jt(ni,ui,$r,Di,Wi,Oa,zr,Gr,yr,ii,li,Fi,yf,Bt),Pa.lineEnd=sa,sa()}return Pa}}var Ch=Bu({point:function(nt,Tt){this.stream.point(nt*g,Tt*g)}});function rc(nt){return Bu({point:function(Tt,Jt){var Bt=nt(Tt,Jt);return this.stream.point(Bt[0],Bt[1])}})}function Od(nt,Tt,Jt,Bt,yr){function zr(Gr,ii){return Gr*=Bt,ii*=yr,[Tt+nt*Gr,Jt-nt*ii]}return zr.invert=function(Gr,ii){return[(Gr-Tt)/nt*Bt,(Jt-ii)/nt*yr]},zr}function xl(nt,Tt,Jt,Bt,yr,zr){var Gr=v(zr),ii=w(zr),li=Gr*nt,Fi=ii*nt,$r=Gr/nt,ni=ii/nt,ui=(ii*Jt-Gr*Tt)/nt,Di=(ii*Tt+Gr*Jt)/nt;function Wi(Oa,Pa){return Oa*=Bt,Pa*=yr,[li*Oa-Fi*Pa+Tt,Jt-Fi*Oa-li*Pa]}return Wi.invert=function(Oa,Pa){return[Bt*($r*Oa-ni*Pa+ui),yr*(Di-ni*Oa-$r*Pa)]},Wi}function xu(nt){return kc(function(){return nt})()}function kc(nt){var Tt,Jt=150,Bt=480,yr=250,zr=0,Gr=0,ii=0,li=0,Fi=0,$r,ni=0,ui=1,Di=1,Wi=null,Oa=ft,Pa=null,Ja,rn,Zi,sa=jo,vn=.5,Dn,po,zo,wo,$o;function io(ma){return zo(ma[0]*g,ma[1]*g)}function Us(ma){return ma=zo.invert(ma[0],ma[1]),ma&&[ma[0]*p,ma[1]*p]}io.stream=function(ma){return wo&&$o===ma?wo:wo=Ch(rc($r)(Oa(Dn(sa($o=ma)))))},io.preclip=function(ma){return arguments.length?(Oa=ma,Wi=void 0,Go()):Oa},io.postclip=function(ma){return arguments.length?(sa=ma,Pa=Ja=rn=Zi=null,Go()):sa},io.clipAngle=function(ma){return arguments.length?(Oa=+ma?Kt(Wi=ma*g):(Wi=null,ft),Go()):Wi*p},io.clipExtent=function(ma){return arguments.length?(sa=ma==null?(Pa=Ja=rn=Zi=null,jo):Pr(Pa=+ma[0][0],Ja=+ma[0][1],rn=+ma[1][0],Zi=+ma[1][1]),Go()):Pa==null?null:[[Pa,Ja],[rn,Zi]]},io.scale=function(ma){return arguments.length?(Jt=+ma,gs()):Jt},io.translate=function(ma){return arguments.length?(Bt=+ma[0],yr=+ma[1],gs()):[Bt,yr]},io.center=function(ma){return arguments.length?(zr=ma[0]%360*g,Gr=ma[1]%360*g,gs()):[zr*p,Gr*p]},io.rotate=function(ma){return arguments.length?(ii=ma[0]%360*g,li=ma[1]%360*g,Fi=ma.length>2?ma[2]%360*g:0,gs()):[ii*p,li*p,Fi*p]},io.angle=function(ma){return arguments.length?(ni=ma%360*g,gs()):ni*p},io.reflectX=function(ma){return arguments.length?(ui=ma?-1:1,gs()):ui<0},io.reflectY=function(ma){return arguments.length?(Di=ma?-1:1,gs()):Di<0},io.precision=function(ma){return arguments.length?(Dn=Vf(po,vn=ma*ma),Go()):A(vn)},io.fitExtent=function(ma,vo){return qf(io,ma,vo)},io.fitSize=function(ma,vo){return Dl(io,ma,vo)},io.fitWidth=function(ma,vo){return gf(io,ma,vo)},io.fitHeight=function(ma,vo){return Ou(io,ma,vo)};function gs(){var ma=xl(Jt,0,0,ui,Di,ni).apply(null,Tt(zr,Gr)),vo=(ni?xl:Od)(Jt,Bt-ma[0],yr-ma[1],ui,Di,ni);return $r=$i(ii,li,Fi),po=Qr(Tt,vo),zo=Qr($r,po),Dn=Vf(po,vn),Go()}function Go(){return wo=$o=null,io}return function(){return Tt=nt.apply(this,arguments),io.invert=Tt.invert&&Us,gs()}}function hl(nt){var Tt=0,Jt=c/3,Bt=kc(nt),yr=Bt(Tt,Jt);return yr.parallels=function(zr){return arguments.length?Bt(Tt=zr[0]*g,Jt=zr[1]*g):[Tt*p,Jt*p]},yr}function Gf(nt){var Tt=v(nt);function Jt(Bt,yr){return[Bt*Tt,w(yr)/Tt]}return Jt.invert=function(Bt,yr){return[Bt/Tt,T(yr*Tt)]},Jt}function Nu(nt,Tt){var Jt=w(nt),Bt=(Jt+w(Tt))/2;if(m(Bt)=.12&&Pa<.234&&Oa>=-.425&&Oa<-.214?yr:Pa>=.166&&Pa<.234&&Oa>=-.214&&Oa<-.115?Gr:Jt).invert(ui)},$r.stream=function(ui){return nt&&Tt===ui?nt:nt=Nd([Jt.stream(Tt=ui),yr.stream(ui),Gr.stream(ui)])},$r.precision=function(ui){return arguments.length?(Jt.precision(ui),yr.precision(ui),Gr.precision(ui),ni()):Jt.precision()},$r.scale=function(ui){return arguments.length?(Jt.scale(ui),yr.scale(ui*.35),Gr.scale(ui),$r.translate(Jt.translate())):Jt.scale()},$r.translate=function(ui){if(!arguments.length)return Jt.translate();var Di=Jt.scale(),Wi=+ui[0],Oa=+ui[1];return Bt=Jt.translate(ui).clipExtent([[Wi-.455*Di,Oa-.238*Di],[Wi+.455*Di,Oa+.238*Di]]).stream(Fi),zr=yr.translate([Wi-.307*Di,Oa+.201*Di]).clipExtent([[Wi-.425*Di+n,Oa+.12*Di+n],[Wi-.214*Di-n,Oa+.234*Di-n]]).stream(Fi),ii=Gr.translate([Wi-.205*Di,Oa+.212*Di]).clipExtent([[Wi-.214*Di+n,Oa+.166*Di+n],[Wi-.115*Di-n,Oa+.234*Di-n]]).stream(Fi),ni()},$r.fitExtent=function(ui,Di){return qf($r,ui,Di)},$r.fitSize=function(ui,Di){return Dl($r,ui,Di)},$r.fitWidth=function(ui,Di){return gf($r,ui,Di)},$r.fitHeight=function(ui,Di){return Ou($r,ui,Di)};function ni(){return nt=Tt=null,$r}return $r.scale(1070)}function ju(nt){return function(Tt,Jt){var Bt=v(Tt),yr=v(Jt),zr=nt(Bt*yr);return[zr*yr*w(Tt),zr*w(Jt)]}}function ql(nt){return function(Tt,Jt){var Bt=A(Tt*Tt+Jt*Jt),yr=nt(Bt),zr=w(yr),Gr=v(yr);return[_(Tt*zr,Bt*Gr),T(Bt&&Jt*zr/Bt)]}}var Vl=ju(function(nt){return A(2/(1+nt))});Vl.invert=ql(function(nt){return 2*T(nt/2)});function jd(){return xu(Vl).scale(124.75).clipAngle(180-.001)}var xf=ju(function(nt){return(nt=E(nt))&&nt/w(nt)});xf.invert=ql(function(nt){return nt});function od(){return xu(xf).scale(79.4188).clipAngle(180-.001)}function nu(nt,Tt){return[nt,M(b((f+Tt)/2))]}nu.invert=function(nt,Tt){return[nt,2*y(S(Tt))-f]};function Wc(){return $f(nu).scale(961/d)}function $f(nt){var Tt=xu(nt),Jt=Tt.center,Bt=Tt.scale,yr=Tt.translate,zr=Tt.clipExtent,Gr=null,ii,li,Fi;Tt.scale=function(ni){return arguments.length?(Bt(ni),$r()):Bt()},Tt.translate=function(ni){return arguments.length?(yr(ni),$r()):yr()},Tt.center=function(ni){return arguments.length?(Jt(ni),$r()):Jt()},Tt.clipExtent=function(ni){return arguments.length?(ni==null?Gr=ii=li=Fi=null:(Gr=+ni[0][0],ii=+ni[0][1],li=+ni[1][0],Fi=+ni[1][1]),$r()):Gr==null?null:[[Gr,ii],[li,Fi]]};function $r(){var ni=c*Bt(),ui=Tt(xi(Tt.rotate()).invert([0,0]));return zr(Gr==null?[[ui[0]-ni,ui[1]-ni],[ui[0]+ni,ui[1]+ni]]:nt===nu?[[Math.max(ui[0]-ni,Gr),ii],[Math.min(ui[0]+ni,li),Fi]]:[[Gr,Math.max(ui[1]-ni,ii)],[li,Math.min(ui[1]+ni,Fi)]])}return $r()}function bf(nt){return b((f+nt)/2)}function Ud(nt,Tt){var Jt=v(nt),Bt=nt===Tt?w(nt):M(Jt/v(Tt))/M(bf(Tt)/bf(nt)),yr=Jt*C(bf(nt),Bt)/Bt;if(!Bt)return nu;function zr(Gr,ii){yr>0?ii<-f+n&&(ii=-f+n):ii>f-n&&(ii=f-n);var li=yr/C(bf(ii),Bt);return[li*w(Bt*Gr),yr-li*v(Bt*Gr)]}return zr.invert=function(Gr,ii){var li=yr-ii,Fi=k(Bt)*A(Gr*Gr+li*li),$r=_(Gr,m(li))*k(li);return li*Bt<0&&($r-=c*k(Gr)*k(li)),[$r/Bt,2*y(C(yr/Fi,1/Bt))-f]},zr}function Yc(){return hl(Ud).scale(109.5).parallels([30,30])}function Dc(nt,Tt){return[nt,Tt]}Dc.invert=Dc;function Lc(){return xu(Dc).scale(152.63)}function wf(nt,Tt){var Jt=v(nt),Bt=nt===Tt?w(nt):(Jt-v(Tt))/(Tt-nt),yr=Jt/Bt+nt;if(m(Bt)n&&--Bt>0);return[nt/(.8707+(zr=Jt*Jt)*(-.131979+zr*(-.013791+zr*zr*zr*(.003971-.001529*zr)))),Jt]};function Lh(){return xu(ud).scale(175.295)}function Js(nt,Tt){return[v(Tt)*w(nt),w(Tt)]}Js.invert=ql(T);function ou(){return xu(Js).scale(249.5).clipAngle(90+n)}function Kf(nt,Tt){var Jt=v(Tt),Bt=1+v(nt)*Jt;return[Jt*w(nt)/Bt,w(Tt)/Bt]}Kf.invert=ql(function(nt){return 2*y(nt)});function Fh(){return xu(Kf).scale(250).clipAngle(142)}function Jf(nt,Tt){return[M(b((f+Tt)/2)),-nt]}Jf.invert=function(nt,Tt){return[-Tt,2*y(S(nt))-f]};function Af(){var nt=$f(Jf),Tt=nt.center,Jt=nt.rotate;return nt.center=function(Bt){return arguments.length?Tt([-Bt[1],Bt[0]]):(Bt=Tt(),[Bt[1],-Bt[0]])},nt.rotate=function(Bt){return arguments.length?Jt([Bt[0],Bt[1],Bt.length>2?Bt[2]+90:90]):(Bt=Jt(),[Bt[0],Bt[1],Bt[2]-90])},Jt([0,0,90]).scale(159.155)}t.geoAlbers=Hf,t.geoAlbersUsa=nd,t.geoArea=q,t.geoAzimuthalEqualArea=jd,t.geoAzimuthalEqualAreaRaw=Vl,t.geoAzimuthalEquidistant=od,t.geoAzimuthalEquidistantRaw=xf,t.geoBounds=qe,t.geoCentroid=Ai,t.geoCircle=dn,t.geoClipAntimeridian=ft,t.geoClipCircle=Kt,t.geoClipExtent=Mi,t.geoClipRectangle=Pr,t.geoConicConformal=Yc,t.geoConicConformalRaw=Ud,t.geoConicEqualArea=Cc,t.geoConicEqualAreaRaw=Nu,t.geoConicEquidistant=sd,t.geoConicEquidistantRaw=wf,t.geoContains=ho,t.geoDistance=tn,t.geoEqualEarth=ld,t.geoEqualEarthRaw=Xf,t.geoEquirectangular=Lc,t.geoEquirectangularRaw=Dc,t.geoGnomonic=qd,t.geoGnomonicRaw=Dh,t.geoGraticule=Fo,t.geoGraticule10=uo,t.geoIdentity=Zf,t.geoInterpolate=Qn,t.geoLength=pn,t.geoMercator=Wc,t.geoMercatorRaw=nu,t.geoNaturalEarth1=Lh,t.geoNaturalEarth1Raw=ud,t.geoOrthographic=ou,t.geoOrthographicRaw=Js,t.geoPath=Uf,t.geoProjection=xu,t.geoProjectionMutator=kc,t.geoRotation=xi,t.geoStereographic=Fh,t.geoStereographicRaw=Kf,t.geoStream=B,t.geoTransform=Bd,t.geoTransverseMercator=Af,t.geoTransverseMercatorRaw=Jf,Object.defineProperty(t,"__esModule",{value:!0})}))}}),HY=de({"src/lib/usa_location_names.js"(e,r){"use strict";var t={alabama:"AL",alaska:"AK",arizona:"AZ",arkansas:"AR",california:"CA",colorado:"CO",connecticut:"CT",delaware:"DE","district of columbia":"DC",florida:"FL",georgia:"GA",hawaii:"HI",idaho:"ID",illinois:"IL",indiana:"IN",iowa:"IA",kansas:"KS",kentucky:"KY",louisiana:"LA",maine:"ME",maryland:"MD",massachusetts:"MA",michigan:"MI",minnesota:"MN",mississippi:"MS",missouri:"MO",montana:"MT",nebraska:"NE",nevada:"NV","new hampshire":"NH","new jersey":"NJ","new mexico":"NM","new york":"NY","north carolina":"NC","north dakota":"ND",ohio:"OH",oklahoma:"OK",oregon:"OR",pennsylvania:"PA","rhode island":"RI","south carolina":"SC","south dakota":"SD",tennessee:"TN",texas:"TX",utah:"UT",vermont:"VT",virginia:"VA",washington:"WA","washington dc":"DC","washington d.c.":"DC","west virginia":"WV",wisconsin:"WI",wyoming:"WY"},i=new Set(Object.values(t));r.exports={usaLocationAbbreviations:i,usaLocationList:t}}}),s7={};Mr(s7,{COUNTRIES_X:()=>l7});var l7,$Y=Ir({"src/lib/custom_country_codes.ts"(){"use strict";l7=[{iso3:"XAC",iso2:"",m49:"",name:"Aksai Chin",aliases:[]},{iso3:"XAP",iso2:"",m49:"",name:"Arunachal Pradesh",aliases:[]},{iso3:"XBT",iso2:"",m49:"",name:"Bir Tawil",aliases:[]},{iso3:"XHT",iso2:"",m49:"",name:"Halaib Triangle",aliases:[]},{iso3:"XIT",iso2:"",m49:"",name:"Ilemi Triangle",aliases:[]},{iso3:"XJK",iso2:"",m49:"",name:"Jammu and Kashmir",aliases:[]}]}}),Pp=de({"src/lib/geo_location_utils.js"(e,r){"use strict";var t=Yr(),{COUNTRIES:i,createLookup:a}=UY(),{area:o}=qY(),{centroid:s}=VY(),{coordAll:l}=b4(),{geoBounds:n}=w4(),u=My(),c=Xo(),f=is(),h=sl(),d=Fy(),{usaLocationAbbreviations:p,usaLocationList:g}=HY(),{COUNTRIES_X:m}=($Y(),ti(s7)),{lookupAlpha3:y}=a([...i,...m]),_={"ISO-3":u,"USA-states":x,"country names":v};function v(L){let B=y(L);return B||(c.log("Unrecognized country name: "+L+"."),!1)}function x(L){L=L.trim();let B=p.has(L.toUpperCase())?L.toUpperCase():g[L.toLowerCase()];return B||(c.log("Unrecognized US location: "+L+"."),!1)}function S(L,B,O){var G;if(!B||typeof B!="string")return!1;let W=_[L](B);if(W){let X;if(L==="USA-states"){X=[];for(let Z of O)((G=Z?.properties)==null?void 0:G.gu)==="USA"&&X.push(Z)}else X=O;for(let Z of X)if(Z.id===W)return Z;c.log(`Location with id ${W} does not have a matching topojson feature at this resolution.`)}return!1}var M=360;function C(L){for(let B=0;B0&&L[B+1][0]<0)return B;return null}function w(L){var B=L.geometry,O=B.coordinates,G=L.id,W=[],X,Z,J,N;switch(G==="RUS"||G==="FJI"?X=function(H){var $;if(C(H)===null)$=H;else for($=new Array(H.length),N=0;N$?U[V++]=[H[N][0]+M,H[N][1]]:N===$?(U[V++]=H[N],U[V++]=[H[N][0],-90]):U[V++]=H[N];var j=d.tester(U);j.pts.pop(),W.push(j)}:X=function(H){W.push(d.tester(H))},B.type){case"MultiPolygon":for(Z=0;ZW&&(W=J,O=Z)}else O=B;return!O||!O.coordinates.some(N=>N.length>0)?[NaN,NaN]:s(O).geometry.coordinates}function E(L){var B=window.PlotlyGeoAssets||{},O=[];function G(N){return new Promise(function(H,$){t.json(N,function(U,V){if(U){delete B[N];var j=U.status===404?'GeoJSON at URL "'+N+'" does not exist.':"Unexpected error while fetching from "+N;return $(new Error(j))}return B[N]=V,H(V)})})}function W(N){return new Promise(function(H,$){var U=0,V=setInterval(function(){if(B[N]&&B[N]!=="pending")return clearInterval(V),H(B[N]);if(U>100)return clearInterval(V),$("Unexpected error while fetching from "+N);U++},50)})}for(var X=0;XD(F(L));function F(L){try{return l(L)}catch{return[]}}function D(L){if(L.length===0)return null;if(L.length===1){let[X,Z]=L[0];return[X,Z,X,Z]}let[[B,O],[G,W]]=n({type:"MultiPoint",coordinates:L});return[B,O,I([B,G])[1],W]}var R=(L,B)=>B.fitbounds==="geojson"&&L.locationmode==="geojson-id",P=(L,B)=>R(L,B)?F(k(L)):[],z=(L,B)=>D(P(L,B));function I([L,B]){return[L,L>B?B+M:B]}r.exports={locationToFeature:S,feature2polygons:w,getTraceGeojson:k,extractTraceFeature:A,fetchTraceGeoData:E,boundsOfCoords:D,computeBbox:T,coordsOf:F,doesCrossAntiMeridian:C,fitGeojsonBbox:z,fitGeojsonCoords:P,unwrapLonRange:I,ANTIMERIDIAN_LON_SHIFT:M}}}),u7=de({"src/traces/scattergeo/style.js"(e,r){"use strict";var t=Yr(),i=hn(),a=ta(),o=lf(),s=o.stylePoints,l=o.styleText;r.exports=function(c,f){f&&n(c,f)};function n(u,c){var f=c[0].trace,h=c[0].node3;h.style("opacity",c[0].trace.opacity),s(h,f,u),l(h,f,u),h.selectAll("path.js-line").style("fill","none").each(function(d){var p=t.select(this),g=d.trace,m=g.line||{};p.call(a.stroke,m.color).call(i.dashLine,m.dash||"",m.width||0),g.fill!=="none"&&p.call(a.fill,g.fillcolor)})}}}),T4=de({"src/traces/scattergeo/plot.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=_4().getTopojsonFeatures,o=g_(),s=Pp(),l=md().findExtremes,n=cn().BADNUM,u=qh().calcMarkerSize,c=bs(),f=u7();function h(g,m,y){var _=m.layers.frontplot.select(".scatterlayer"),v=i.makeTraceGroups(_,y,"trace scattergeo");function x(S,M){S.lonlat[0]===n&&t.select(M).remove()}v.selectAll("*").remove(),v.each(function(S){var M=t.select(this),C=S[0].trace;if(c.hasLines(C)||C.fill!=="none"){var w=o.calcTraceToLineCoords(S),k=C.fill!=="none"?o.makePolygon(w):o.makeLine(w);M.selectAll("path.js-line").data([{geojson:k,trace:C}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}c.hasMarkers(C)&&M.selectAll("path.point").data(i.identity).enter().append("path").classed("point",!0).each(function(A){x(A,this)}),c.hasText(C)&&M.selectAll("g").data(i.identity).enter().append("g").append("text").each(function(A){x(A,this)}),f(g,S)})}function d(g,m){var y=g[0].trace,_=m[y.geo],v=_._subplot,x=y._length,S,M;if(i.isArrayOrTypedArray(y.locations)){var C=y.locationmode,w=C==="geojson-id"?s.extractTraceFeature(g):a(y,v.topojson);for(S=0;S")}}}),YY=de({"src/traces/scattergeo/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){i.lon=a.lon,i.lat=a.lat,i.location=a.loc?a.loc:null;var n=s[l];return n.fIn&&n.fIn.properties&&(i.properties=n.fIn.properties),i}}}),XY=de({"src/traces/scattergeo/select.js"(e,r){"use strict";var t=bs(),i=cn().BADNUM;r.exports=function(o,s){var l=o.cd,n=o.xaxis,u=o.yaxis,c=[],f=l[0].trace,h,d,p,g,m,y=!t.hasMarkers(f)&&!t.hasText(f);if(y)return[];if(s===!1)for(m=0;mU?1:$>=U?0:NaN}function a($){return $.length===1&&($=o($)),{left:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)<0?j=Y+1:q=Y}return j},right:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)>0?q=Y:j=Y+1}return j}}}function o($){return function(U,V){return i($(U),V)}}var s=a(i),l=s.right,n=s.left;function u($,U){U==null&&(U=c);for(var V=0,j=$.length-1,q=$[0],Y=new Array(j<0?0:j);V$?1:U>=$?0:NaN}function d($){return $===null?NaN:+$}function p($,U){var V=$.length,j=0,q=-1,Y=0,K,te,ne=0;if(U==null)for(;++q1)return ne/(j-1)}function g($,U){var V=p($,U);return V&&Math.sqrt(V)}function m($,U){var V=$.length,j=-1,q,Y,K;if(U==null){for(;++j=q)for(Y=K=q;++jq&&(Y=q),K=q)for(Y=K=q;++jq&&(Y=q),K0)return[$];if((j=U<$)&&(Y=$,$=U,U=Y),(te=b($,U,V))===0||!isFinite(te))return[];if(te>0)for($=Math.ceil($/te),U=Math.floor(U/te),K=new Array(Y=Math.ceil(U-$+1));++q=0?(Y>=C?10:Y>=w?5:Y>=k?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(Y>=C?10:Y>=w?5:Y>=k?2:1)}function E($,U,V){var j=Math.abs(U-$)/Math.max(0,V),q=Math.pow(10,Math.floor(Math.log(j)/Math.LN10)),Y=j/q;return Y>=C?q*=10:Y>=w?q*=5:Y>=k&&(q*=2),U<$?-q:q}function T($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function F(){var $=S,U=m,V=T;function j(q){var Y,K=q.length,te,ne=new Array(K);for(Y=0;Yce;)pe.pop(),--xe;var ye=new Array(xe+1),fe;for(Y=0;Y<=xe;++Y)fe=ye[Y]=[],fe.x0=Y>0?pe[Y-1]:le,fe.x1=Y=1)return+V($[j-1],j-1,$);var j,q=(j-1)*U,Y=Math.floor(q),K=+V($[Y],Y,$),te=+V($[Y+1],Y+1,$);return K+(te-K)*(q-Y)}}function R($,U,V){return $=v.call($,d).sort(i),Math.ceil((V-U)/(2*(D($,.75)-D($,.25))*Math.pow($.length,-1/3)))}function P($,U,V){return Math.ceil((V-U)/(3.5*g($)*Math.pow($.length,-1/3)))}function z($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jY&&(Y=q)}else for(;++j=q)for(Y=q;++jY&&(Y=q);return Y}function I($,U){var V=$.length,j=V,q=-1,Y,K=0;if(U==null)for(;++q=0;)for(K=$[U],V=K.length;--V>=0;)Y[--q]=K[V];return Y}function O($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jq&&(Y=q)}else for(;++j=q)for(Y=q;++jq&&(Y=q);return Y}function G($,U){for(var V=U.length,j=new Array(V);V--;)j[V]=$[U[V]];return j}function W($,U){if(V=$.length){var V,j=0,q=0,Y,K=$[q];for(U==null&&(U=i);++j0?1:Se<0?-1:0},y=Math.sin,_=Math.tan,v=1e-6,x=1e-12,S=Math.PI,M=S/2,C=S/4,w=Math.SQRT1_2,k=P(2),A=P(S),b=S*2,E=180/S,T=S/180;function F(Se){return Se?Se/Math.sin(Se):1}function D(Se){return Se>1?M:Se<-1?-M:Math.asin(Se)}function R(Se){return Se>1?0:Se<-1?S:Math.acos(Se)}function P(Se){return Se>0?Math.sqrt(Se):0}function z(Se){return Se=u(2*Se),(Se-1)/(Se+1)}function I(Se){return(u(Se)-u(-Se))/2}function L(Se){return(u(Se)+u(-Se))/2}function B(Se){return f(Se+P(Se*Se+1))}function O(Se){return f(Se+P(Se*Se-1))}function G(Se){var Ie=_(Se/2),Ge=2*f(n(Se/2))/(Ie*Ie);function $e(st,ot){var pt=n(st),Vt=n(ot),tr=y(ot),Ut=Vt*pt,rr=-((1-Ut?f((1+Ut)/2)/(1-Ut):-.5)+Ge/(1+Ut));return[rr*Vt*y(st),rr*tr]}return $e.invert=function(st,ot){var pt=P(st*st+ot*ot),Vt=-Se/2,tr=50,Ut;if(!pt)return[0,0];do{var rr=Vt/2,pr=n(rr),Sr=y(rr),Rr=Sr/pr,Zr=-f(o(pr));Vt-=Ut=(2/Rr*Zr-Ge*Rr-pt)/(-Zr/(Sr*Sr)+1-Ge/(2*pr*pr))*(pr<0?.7:1)}while(o(Ut)>v&&--tr>0);var wi=y(Vt);return[l(st*wi,pt*n(Vt)),D(ot*wi/pt)]},$e}function W(){var Se=M,Ie=i.geoProjectionMutator(G),Ge=Ie(Se);return Ge.radius=function($e){return arguments.length?Ie(Se=$e*T):Se*E},Ge.scale(179.976).clipAngle(147)}function X(Se,Ie){var Ge=n(Ie),$e=F(R(Ge*n(Se/=2)));return[2*Ge*y(Se)*$e,y(Ie)*$e]}X.invert=function(Se,Ie){if(!(Se*Se+4*Ie*Ie>S*S+v)){var Ge=Se,$e=Ie,st=25;do{var ot=y(Ge),pt=y(Ge/2),Vt=n(Ge/2),tr=y($e),Ut=n($e),rr=y(2*$e),pr=tr*tr,Sr=Ut*Ut,Rr=pt*pt,Zr=1-Sr*Vt*Vt,wi=Zr?R(Ut*Vt)*P(qi=1/Zr):qi=0,qi,Aa=2*wi*Ut*pt-Se,un=wi*tr-Ie,gn=qi*(Sr*Rr+wi*Ut*Vt*pr),Tn=qi*(.5*ot*rr-wi*2*tr*pt),Pn=qi*.25*(rr*pt-wi*tr*Sr*ot),Eo=qi*(pr*Vt+wi*Rr*Ut),qo=Tn*Pn-Eo*gn;if(!qo)break;var Wn=(un*Tn-Aa*Eo)/qo,ls=(Aa*Pn-un*gn)/qo;Ge-=Wn,$e-=ls}while((o(Wn)>v||o(ls)>v)&&--st>0);return[Ge,$e]}};function Z(){return i.geoProjection(X).scale(152.63)}function J(Se){var Ie=y(Se),Ge=n(Se),$e=Se>=0?1:-1,st=_($e*Se),ot=(1+Ie-Ge)/2;function pt(Vt,tr){var Ut=n(tr),rr=n(Vt/=2);return[(1+Ut)*y(Vt),($e*tr>-l(rr,st)-.001?0:-$e*10)+ot+y(tr)*Ge-(1+Ut)*Ie*rr]}return pt.invert=function(Vt,tr){var Ut=0,rr=0,pr=50;do{var Sr=n(Ut),Rr=y(Ut),Zr=n(rr),wi=y(rr),qi=1+Zr,Aa=qi*Rr-Vt,un=ot+wi*Ge-qi*Ie*Sr-tr,gn=qi*Sr/2,Tn=-Rr*wi,Pn=Ie*qi*Rr/2,Eo=Ge*Zr+Ie*Sr*wi,qo=Tn*Pn-Eo*gn,Wn=(un*Tn-Aa*Eo)/qo/2,ls=(Aa*Pn-un*gn)/qo;o(ls)>2&&(ls/=2),Ut-=Wn,rr-=ls}while((o(Wn)>v||o(ls)>v)&&--pr>0);return $e*rr>-l(n(Ut),st)-.001?[Ut*2,rr]:null},pt}function N(){var Se=20*T,Ie=Se>=0?1:-1,Ge=_(Ie*Se),$e=i.geoProjectionMutator(J),st=$e(Se),ot=st.stream;return st.parallel=function(pt){return arguments.length?(Ge=_((Ie=(Se=pt*T)>=0?1:-1)*Se),$e(Se)):Se*E},st.stream=function(pt){var Vt=st.rotate(),tr=ot(pt),Ut=(st.rotate([0,0]),ot(pt)),rr=st.precision();return st.rotate(Vt),tr.sphere=function(){Ut.polygonStart(),Ut.lineStart();for(var pr=Ie*-180;Ie*pr<180;pr+=Ie*90)Ut.point(pr,Ie*90);if(Se)for(;Ie*(pr-=3*Ie*rr)>=-180;)Ut.point(pr,Ie*-l(n(pr*T/2),Ge)*E);Ut.lineEnd(),Ut.polygonEnd()},tr},st.scale(218.695).center([0,28.0974])}function H(Se,Ie){var Ge=_(Ie/2),$e=P(1-Ge*Ge),st=1+$e*n(Se/=2),ot=y(Se)*$e/st,pt=Ge/st,Vt=ot*ot,tr=pt*pt;return[4/3*ot*(3+Vt-3*tr),4/3*pt*(3+3*Vt-tr)]}H.invert=function(Se,Ie){if(Se*=3/8,Ie*=3/8,!Se&&o(Ie)>1)return null;var Ge=Se*Se,$e=Ie*Ie,st=1+Ge+$e,ot=P((st-P(st*st-4*Ie*Ie))/2),pt=D(ot)/3,Vt=ot?O(o(Ie/ot))/3:B(o(Se))/3,tr=n(pt),Ut=L(Vt),rr=Ut*Ut-tr*tr;return[m(Se)*2*l(I(Vt)*tr,.25-rr),m(Ie)*2*l(Ut*y(pt),.25+rr)]};function $(){return i.geoProjection(H).scale(66.1603)}var U=P(8),V=f(1+k);function j(Se,Ie){var Ge=o(Ie);return Gex&&--$e>0);return[Se/(n(Ge)*(U-1/y(Ge))),m(Ie)*Ge]};function q(){return i.geoProjection(j).scale(112.314)}function Y(Se){var Ie=2*S/Se;function Ge($e,st){var ot=i.geoAzimuthalEquidistantRaw($e,st);if(o($e)>M){var pt=l(ot[1],ot[0]),Vt=P(ot[0]*ot[0]+ot[1]*ot[1]),tr=Ie*g((pt-M)/Ie)+M,Ut=l(y(pt-=tr),2-n(pt));pt=tr+D(S/Vt*y(Ut))-Ut,ot[0]=Vt*n(pt),ot[1]=Vt*y(pt)}return ot}return Ge.invert=function($e,st){var ot=P($e*$e+st*st);if(ot>M){var pt=l(st,$e),Vt=Ie*g((pt-M)/Ie)+M,tr=pt>Vt?-1:1,Ut=ot*n(Vt-pt),rr=1/_(tr*R((Ut-S)/P(S*(S-2*Ut)+ot*ot)));pt=Vt+2*s((rr+tr*P(rr*rr-3))/3),$e=ot*n(pt),st=ot*y(pt)}return i.geoAzimuthalEquidistantRaw.invert($e,st)},Ge}function K(){var Se=5,Ie=i.geoProjectionMutator(Y),Ge=Ie(Se),$e=Ge.stream,st=.01,ot=-n(st*T),pt=y(st*T);return Ge.lobes=function(Vt){return arguments.length?Ie(Se=+Vt):Se},Ge.stream=function(Vt){var tr=Ge.rotate(),Ut=$e(Vt),rr=(Ge.rotate([0,0]),$e(Vt));return Ge.rotate(tr),Ut.sphere=function(){rr.polygonStart(),rr.lineStart();for(var pr=0,Sr=360/Se,Rr=2*S/Se,Zr=90-180/Se,wi=M;pr0&&o(st)>v);return $e<0?NaN:Ge}function ce(Se,Ie,Ge){return Ie===void 0&&(Ie=40),Ge===void 0&&(Ge=x),function($e,st,ot,pt){var Vt,tr,Ut;ot=ot===void 0?0:+ot,pt=pt===void 0?0:+pt;for(var rr=0;rrVt){ot-=tr/=2,pt-=Ut/=2;continue}Vt=Zr;var wi=(ot>0?-1:1)*Ge,qi=(pt>0?-1:1)*Ge,Aa=Se(ot+wi,pt),un=Se(ot,pt+qi),gn=(Aa[0]-pr[0])/wi,Tn=(Aa[1]-pr[1])/wi,Pn=(un[0]-pr[0])/qi,Eo=(un[1]-pr[1])/qi,qo=Eo*gn-Tn*Pn,Wn=(o(qo)<.5?.5:1)/qo;if(tr=(Rr*Pn-Sr*Eo)*Wn,Ut=(Sr*Tn-Rr*gn)*Wn,ot+=tr,pt+=Ut,o(tr)0&&(Vt[1]*=1+tr/1.5*Vt[0]*Vt[0]),Vt}return $e.invert=ce($e),$e}function xe(){return i.geoProjection(pe()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ye(Se,Ie){var Ge=Se*y(Ie),$e=30,st;do Ie-=st=(Ie+y(Ie)-Ge)/(1+n(Ie));while(o(st)>v&&--$e>0);return Ie/2}function fe(Se,Ie,Ge){function $e(st,ot){return[Se*st*n(ot=ye(Ge,ot)),Ie*y(ot)]}return $e.invert=function(st,ot){return ot=D(ot/Ie),[st/(Se*n(ot)),D((2*ot+y(2*ot))/Ge)]},$e}var ae=fe(k/M,k,S);function ee(){return i.geoProjection(ae).scale(169.529)}var ie=2.00276,Q=1.11072;function ue(Se,Ie){var Ge=ye(S,Ie);return[ie*Se/(1/n(Ie)+Q/n(Ge)),(Ie+k*y(Ge))/ie]}ue.invert=function(Se,Ie){var Ge=ie*Ie,$e=Ie<0?-C:C,st=25,ot,pt;do pt=Ge-k*y($e),$e-=ot=(y(2*$e)+2*$e-S*y(pt))/(2*n(2*$e)+2+S*n(pt)*k*n($e));while(o(ot)>v&&--st>0);return pt=Ge-k*y($e),[Se*(1/n(pt)+Q/n($e))/ie,pt]};function ge(){return i.geoProjection(ue).scale(160.857)}function Me(Se){var Ie=0,Ge=i.geoProjectionMutator(Se),$e=Ge(Ie);return $e.parallel=function(st){return arguments.length?Ge(Ie=st*T):Ie*E},$e}function Te(Se,Ie){return[Se*n(Ie),Ie]}Te.invert=function(Se,Ie){return[Se/n(Ie),Ie]};function je(){return i.geoProjection(Te).scale(152.63)}function Ve(Se){if(!Se)return Te;var Ie=1/_(Se);function Ge($e,st){var ot=Ie+Se-st,pt=ot&&$e*n(st)/ot;return[ot*y(pt),Ie-ot*n(pt)]}return Ge.invert=function($e,st){var ot=P($e*$e+(st=Ie-st)*st),pt=Ie+Se-ot;return[ot/n(pt)*l($e,st),pt]},Ge}function Ke(){return Me(Ve).scale(123.082).center([0,26.1441]).parallel(45)}function Je(Se){function Ie(Ge,$e){var st=M-$e,ot=st&&Ge*Se*y(st)/st;return[st*y(ot)/Se,M-st*n(ot)]}return Ie.invert=function(Ge,$e){var st=Ge*Se,ot=M-$e,pt=P(st*st+ot*ot),Vt=l(st,ot);return[(pt?pt/y(pt):1)*Vt/Se,M-pt]},Ie}function vt(){var Se=.5,Ie=i.geoProjectionMutator(Je),Ge=Ie(Se);return Ge.fraction=function($e){return arguments.length?Ie(Se=+$e):Se},Ge.scale(158.837)}var xt=fe(1,4/S,S);function Pt(){return i.geoProjection(xt).scale(152.63)}function mt(Se,Ie,Ge,$e,st,ot){var pt=n(ot),Vt;if(o(Se)>1||o(ot)>1)Vt=R(Ge*st+Ie*$e*pt);else{var tr=y(Se/2),Ut=y(ot/2);Vt=2*D(P(tr*tr+Ie*$e*Ut*Ut))}return o(Vt)>v?[Vt,l($e*y(ot),Ie*st-Ge*$e*pt)]:[0,0]}function Mt(Se,Ie,Ge){return R((Se*Se+Ie*Ie-Ge*Ge)/(2*Se*Ie))}function lt(Se){return Se-2*S*c((Se+S)/(2*S))}function qe(Se,Ie,Ge){for(var $e=[[Se[0],Se[1],y(Se[1]),n(Se[1])],[Ie[0],Ie[1],y(Ie[1]),n(Ie[1])],[Ge[0],Ge[1],y(Ge[1]),n(Ge[1])]],st=$e[2],ot,pt=0;pt<3;++pt,st=ot)ot=$e[pt],st.v=mt(ot[1]-st[1],st[3],st[2],ot[3],ot[2],ot[0]-st[0]),st.point=[0,0];var Vt=Mt($e[0].v[0],$e[2].v[0],$e[1].v[0]),tr=Mt($e[0].v[0],$e[1].v[0],$e[2].v[0]),Ut=S-Vt;$e[2].point[1]=0,$e[0].point[0]=-($e[1].point[0]=$e[0].v[0]/2);var rr=[$e[2].point[0]=$e[0].point[0]+$e[2].v[0]*n(Vt),2*($e[0].point[1]=$e[1].point[1]=$e[2].v[0]*y(Vt))];function pr(Sr,Rr){var Zr=y(Rr),wi=n(Rr),qi=new Array(3),Aa;for(Aa=0;Aa<3;++Aa){var un=$e[Aa];if(qi[Aa]=mt(Rr-un[1],un[3],un[2],wi,Zr,Sr-un[0]),!qi[Aa][0])return un.point;qi[Aa][1]=lt(qi[Aa][1]-un.v[1])}var gn=rr.slice();for(Aa=0;Aa<3;++Aa){var Tn=Aa==2?0:Aa+1,Pn=Mt($e[Aa].v[0],qi[Aa][0],qi[Tn][0]);qi[Aa][1]<0&&(Pn=-Pn),Aa?Aa==1?(Pn=tr-Pn,gn[0]-=qi[Aa][0]*n(Pn),gn[1]-=qi[Aa][0]*y(Pn)):(Pn=Ut-Pn,gn[0]+=qi[Aa][0]*n(Pn),gn[1]+=qi[Aa][0]*y(Pn)):(gn[0]+=qi[Aa][0]*n(Pn),gn[1]-=qi[Aa][0]*y(Pn))}return gn[0]/=3,gn[1]/=3,gn}return pr}function Ye(Se){return Se[0]*=T,Se[1]*=T,Se}function me(){return _e([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function _e(Se,Ie,Ge){var $e=i.geoCentroid({type:"MultiPoint",coordinates:[Se,Ie,Ge]}),st=[-$e[0],-$e[1]],ot=i.geoRotation(st),pt=qe(Ye(ot(Se)),Ye(ot(Ie)),Ye(ot(Ge)));pt.invert=ce(pt);var Vt=i.geoProjection(pt).rotate(st),tr=Vt.center;return delete Vt.rotate,Vt.center=function(Ut){return arguments.length?tr(ot(Ut)):ot.invert(tr())},Vt.clipAngle(90)}function Ae(Se,Ie){var Ge=P(1-y(Ie));return[2/A*Se*Ge,A*(1-Ge)]}Ae.invert=function(Se,Ie){var Ge=(Ge=Ie/A-1)*Ge;return[Ge>0?Se*P(S/Ge)/2:0,D(1-Ge)]};function ke(){return i.geoProjection(Ae).scale(95.6464).center([0,30])}function Ee(Se){var Ie=_(Se);function Ge($e,st){return[$e,($e?$e/y($e):1)*(y(st)*n($e)-Ie*n(st))]}return Ge.invert=Ie?function($e,st){$e&&(st*=y($e)/$e);var ot=n($e);return[$e,2*l(P(ot*ot+Ie*Ie-st*st)-ot,Ie-st)]}:function($e,st){return[$e,D($e?st*_($e)/$e:st)]},Ge}function De(){return Me(Ee).scale(249.828).clipAngle(90)}var Qe=P(3);function Ue(Se,Ie){return[Qe*Se*(2*n(2*Ie/3)-1)/A,Qe*A*y(Ie/3)]}Ue.invert=function(Se,Ie){var Ge=3*D(Ie/(Qe*A));return[A*Se/(Qe*(2*n(2*Ge/3)-1)),Ge]};function at(){return i.geoProjection(Ue).scale(156.19)}function rt(Se){var Ie=n(Se);function Ge($e,st){return[$e*Ie,y(st)/Ie]}return Ge.invert=function($e,st){return[$e/Ie,D(st*Ie)]},Ge}function ht(){return Me(rt).parallel(38.58).scale(195.044)}function At(Se){var Ie=n(Se);function Ge($e,st){return[$e*Ie,(1+Ie)*_(st/2)]}return Ge.invert=function($e,st){return[$e/Ie,s(st/(1+Ie))*2]},Ge}function dt(){return Me(At).scale(124.75)}function Ht(Se,Ie){var Ge=P(8/(3*S));return[Ge*Se*(1-o(Ie)/S),Ge*Ie]}Ht.invert=function(Se,Ie){var Ge=P(8/(3*S)),$e=Ie/Ge;return[Se/(Ge*(1-o($e)/S)),$e]};function fr(){return i.geoProjection(Ht).scale(165.664)}function gt(Se,Ie){var Ge=P(4-3*y(o(Ie)));return[2/P(6*S)*Se*Ge,m(Ie)*P(2*S/3)*(2-Ge)]}gt.invert=function(Se,Ie){var Ge=2-o(Ie)/P(2*S/3);return[Se*P(6*S)/(2*Ge),m(Ie)*D((4-Ge*Ge)/3)]};function yt(){return i.geoProjection(gt).scale(165.664)}function kt(Se,Ie){var Ge=P(S*(4+S));return[2/Ge*Se*(1+P(1-4*Ie*Ie/(S*S))),4/Ge*Ie]}kt.invert=function(Se,Ie){var Ge=P(S*(4+S))/2;return[Se*Ge/(1+P(1-Ie*Ie*(4+S)/(4*S))),Ie*Ge/2]};function Lt(){return i.geoProjection(kt).scale(180.739)}function Ct(Se,Ie){var Ge=(2+M)*y(Ie);Ie/=2;for(var $e=0,st=1/0;$e<10&&o(st)>v;$e++){var ot=n(Ie);Ie-=st=(Ie+y(Ie)*(ot+2)-Ge)/(2*ot*(1+ot))}return[2/P(S*(4+S))*Se*(1+n(Ie)),2*P(S/(4+S))*y(Ie)]}Ct.invert=function(Se,Ie){var Ge=Ie*P((4+S)/S)/2,$e=D(Ge),st=n($e);return[Se/(2/P(S*(4+S))*(1+st)),D(($e+Ge*(st+2))/(2+M))]};function $t(){return i.geoProjection(Ct).scale(180.739)}function mr(Se,Ie){return[Se*(1+n(Ie))/P(2+S),2*Ie/P(2+S)]}mr.invert=function(Se,Ie){var Ge=P(2+S),$e=Ie*Ge/2;return[Ge*Se/(1+n($e)),$e]};function br(){return i.geoProjection(mr).scale(173.044)}function Er(Se,Ie){for(var Ge=(1+M)*y(Ie),$e=0,st=1/0;$e<10&&o(st)>v;$e++)Ie-=st=(Ie+y(Ie)-Ge)/(1+n(Ie));return Ge=P(2+S),[Se*(1+n(Ie))/Ge,2*Ie/Ge]}Er.invert=function(Se,Ie){var Ge=1+M,$e=P(Ge/2);return[Se*2*$e/(1+n(Ie*=$e)),D((Ie+y(Ie))/Ge)]};function Tr(){return i.geoProjection(Er).scale(173.044)}var Ur=3+2*k;function Ai(Se,Ie){var Ge=y(Se/=2),$e=n(Se),st=P(n(Ie)),ot=n(Ie/=2),pt=y(Ie)/(ot+k*$e*st),Vt=P(2/(1+pt*pt)),tr=P((k*ot+($e+Ge)*st)/(k*ot+($e-Ge)*st));return[Ur*(Vt*(tr-1/tr)-2*f(tr)),Ur*(Vt*pt*(tr+1/tr)-2*s(pt))]}Ai.invert=function(Se,Ie){if(!(ot=H.invert(Se/1.2,Ie*1.065)))return null;var Ge=ot[0],$e=ot[1],st=20,ot;Se/=Ur,Ie/=Ur;do{var pt=Ge/2,Vt=$e/2,tr=y(pt),Ut=n(pt),rr=y(Vt),pr=n(Vt),Sr=n($e),Rr=P(Sr),Zr=rr/(pr+k*Ut*Rr),wi=Zr*Zr,qi=P(2/(1+wi)),Aa=k*pr+(Ut+tr)*Rr,un=k*pr+(Ut-tr)*Rr,gn=Aa/un,Tn=P(gn),Pn=Tn-1/Tn,Eo=Tn+1/Tn,qo=qi*Pn-2*f(Tn)-Se,Wn=qi*Zr*Eo-2*s(Zr)-Ie,ls=rr&&w*Rr*tr*wi/rr,ol=(k*Ut*pr+Rr)/(2*(pr+k*Ut*Rr)*(pr+k*Ut*Rr)*Rr),wl=-.5*Zr*qi*qi*qi,Vu=wl*ls,Pc=wl*ol,dl=(dl=2*pr+k*Rr*(Ut-tr))*dl*Tn,pl=(k*Ut*pr*Rr+Sr)/dl,Tu=-(k*tr*rr)/(Rr*dl),nc=Pn*Vu-2*pl/Tn+qi*(pl+pl/gn),oc=Pn*Pc-2*Tu/Tn+qi*(Tu+Tu/gn),sc=Zr*Eo*Vu-2*ls/(1+wi)+qi*Eo*ls+qi*Zr*(pl-pl/gn),Ic=Zr*Eo*Pc-2*ol/(1+wi)+qi*Eo*ol+qi*Zr*(Tu-Tu/gn),Gu=oc*sc-Ic*nc;if(!Gu)break;var tf=(Wn*oc-qo*Ic)/Gu,th=(qo*sc-Wn*nc)/Gu;Ge-=tf,$e=h(-M,d(M,$e-th))}while((o(tf)>v||o(th)>v)&&--st>0);return o(o($e)-M)$e){var pr=P(rr),Sr=l(Ut,tr),Rr=Ge*g(Sr/Ge),Zr=Sr-Rr,wi=Se*n(Zr),qi=(Se*y(Zr)-Zr*y(wi))/(M-wi),Aa=Jr(Zr,qi),un=(S-Se)/Be(Aa,wi,S);tr=pr;var gn=50,Tn;do tr-=Tn=(Se+Be(Aa,wi,tr)*un-pr)/(Aa(tr)*un);while(o(Tn)>v&&--gn>0);Ut=Zr*y(tr),tr$e){var tr=P(Vt),Ut=l(pt,ot),rr=Ge*g(Ut/Ge),pr=Ut-rr;ot=tr*n(pr),pt=tr*y(pr);for(var Sr=ot-M,Rr=y(ot),Zr=pt/Rr,wi=otv||o(Zr)>v)&&--wi>0);return[pr,Sr]},tr}var St=Et(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function zt(){return i.geoProjection(St).scale(149.995)}var Wt=Et(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Yt(){return i.geoProjection(Wt).scale(153.93)}var ze=Et(5/6*S,-.62636,-.0344,0,1.3493,-.05524,0,.045);function tt(){return i.geoProjection(ze).scale(130.945)}function ft(Se,Ie){var Ge=Se*Se,$e=Ie*Ie;return[Se*(1-.162388*$e)*(.87-952426e-9*Ge*Ge),Ie*(1+$e/12)]}ft.invert=function(Se,Ie){var Ge=Se,$e=Ie,st=50,ot;do{var pt=$e*$e;$e-=ot=($e*(1+pt/12)-Ie)/(1+pt/4)}while(o(ot)>v&&--st>0);st=50,Se/=1-.162388*pt;do{var Vt=(Vt=Ge*Ge)*Vt;Ge-=ot=(Ge*(.87-952426e-9*Vt)-Se)/(.87-.00476213*Vt)}while(o(ot)>v&&--st>0);return[Ge,$e]};function wt(){return i.geoProjection(ft).scale(131.747)}var jt=Et(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function It(){return i.geoProjection(jt).scale(131.087)}function Kt(Se){var Ie=Se(M,0)[0]-Se(-M,0)[0];function Ge($e,st){var ot=$e>0?-.5:.5,pt=Se($e+ot*S,st);return pt[0]-=ot*Ie,pt}return Se.invert&&(Ge.invert=function($e,st){var ot=$e>0?-.5:.5,pt=Se.invert($e+ot*Ie,st),Vt=pt[0]-ot*S;return Vt<-S?Vt+=2*S:Vt>S&&(Vt-=2*S),pt[0]=Vt,pt}),Ge}function qt(Se,Ie){var Ge=m(Se),$e=m(Ie),st=n(Ie),ot=n(Se)*st,pt=y(Se)*st,Vt=y($e*Ie);Se=o(l(pt,Vt)),Ie=D(ot),o(Se-M)>v&&(Se%=M);var tr=vr(Se>S/4?M-Se:Se,Ie);return Se>S/4&&(Vt=tr[0],tr[0]=-tr[1],tr[1]=-Vt),tr[0]*=Ge,tr[1]*=-$e,tr}qt.invert=function(Se,Ie){o(Se)>1&&(Se=m(Se)*2-Se),o(Ie)>1&&(Ie=m(Ie)*2-Ie);var Ge=m(Se),$e=m(Ie),st=-Ge*Se,ot=-$e*Ie,pt=ot/st<1,Vt=Br(pt?ot:st,pt?st:ot),tr=Vt[0],Ut=Vt[1],rr=n(Ut);return pt&&(tr=-M-tr),[Ge*(l(y(tr)*rr,-y(Ut))+S),$e*D(n(tr)*rr)]};function vr(Se,Ie){if(Ie===M)return[0,0];var Ge=y(Ie),$e=Ge*Ge,st=$e*$e,ot=1+st,pt=1+3*st,Vt=1-st,tr=D(1/P(ot)),Ut=Vt+$e*ot*tr,rr=(1-Ge)/Ut,pr=P(rr),Sr=rr*ot,Rr=P(Sr),Zr=pr*Vt,wi,qi;if(Se===0)return[0,-(Zr+$e*Rr)];var Aa=n(Ie),un=1/Aa,gn=2*Ge*Aa,Tn=(-3*$e+tr*pt)*gn,Pn=(-Ut*Aa-(1-Ge)*Tn)/(Ut*Ut),Eo=.5*Pn/pr,qo=Vt*Eo-2*$e*pr*gn,Wn=$e*ot*Pn+rr*pt*gn,ls=-un*gn,ol=-un*Wn,wl=-2*un*qo,Vu=4*Se/S,Pc;if(Se>.222*S||Ie.175*S){if(wi=(Zr+$e*P(Sr*(1+st)-Zr*Zr))/(1+st),Se>S/4)return[wi,wi];var dl=wi,pl=.5*wi;wi=.5*(pl+dl),qi=50;do{var Tu=P(Sr-wi*wi),nc=wi*(wl+ls*Tu)+ol*D(wi/Rr)-Vu;if(!nc)break;nc<0?pl=wi:dl=wi,wi=.5*(pl+dl)}while(o(dl-pl)>v&&--qi>0)}else{wi=v,qi=25;do{var oc=wi*wi,sc=P(Sr-oc),Ic=wl+ls*sc,Gu=wi*Ic+ol*D(wi/Rr)-Vu,tf=Ic+(ol-ls*oc)/sc;wi-=Pc=sc?Gu/tf:0}while(o(Pc)>v&&--qi>0)}return[wi,-Zr-$e*P(Sr-wi*wi)]}function Br(Se,Ie){for(var Ge=0,$e=1,st=.5,ot=50;;){var pt=st*st,Vt=P(st),tr=D(1/P(1+pt)),Ut=1-pt+st*(1+pt)*tr,rr=(1-Vt)/Ut,pr=P(rr),Sr=rr*(1+pt),Rr=pr*(1-pt),Zr=Sr-Se*Se,wi=P(Zr),qi=Ie+Rr+st*wi;if(o($e-Ge)0?Ge=st:$e=st,st=.5*(Ge+$e)}if(!ot)return null;var Aa=D(Vt),un=n(Aa),gn=1/un,Tn=2*Vt*un,Pn=(-3*st+tr*(1+3*pt))*Tn,Eo=(-Ut*un-(1-Vt)*Pn)/(Ut*Ut),qo=.5*Eo/pr,Wn=(1-pt)*qo-2*st*pr*Tn,ls=-2*gn*Wn,ol=-gn*Tn,wl=-gn*(st*(1+pt)*Eo+rr*(1+3*pt)*Tn);return[S/4*(Se*(ls+ol*wi)+wl*D(Se/P(Sr))),Aa]}function Pr(){return i.geoProjection(Kt(qt)).scale(239.75)}function Mi(Se,Ie,Ge){var $e,st,ot;return Se?($e=gi(Se,Ge),Ie?(st=gi(Ie,1-Ge),ot=st[1]*st[1]+Ge*$e[0]*$e[0]*st[0]*st[0],[[$e[0]*st[2]/ot,$e[1]*$e[2]*st[0]*st[1]/ot],[$e[1]*st[1]/ot,-$e[0]*$e[2]*st[0]*st[2]/ot],[$e[2]*st[1]*st[2]/ot,-Ge*$e[0]*$e[1]*st[0]/ot]]):[[$e[0],0],[$e[1],0],[$e[2],0]]):(st=gi(Ie,1-Ge),[[0,st[0]/st[1]],[1/st[1],0],[st[2]/st[1],0]])}function gi(Se,Ie){var Ge,$e,st,ot,pt;if(Ie=1-v)return Ge=(1-Ie)/4,$e=L(Se),ot=z(Se),st=1/$e,pt=$e*I(Se),[ot+Ge*(pt-Se)/($e*$e),st-Ge*ot*st*(pt-Se),st+Ge*ot*st*(pt+Se),2*s(u(Se))-M+Ge*(pt-Se)/$e];var Vt=[1,0,0,0,0,0,0,0,0],tr=[P(Ie),0,0,0,0,0,0,0,0],Ut=0;for($e=P(1-Ie),pt=1;o(tr[Ut]/Vt[Ut])>v&&Ut<8;)Ge=Vt[Ut++],tr[Ut]=(Ge-$e)/2,Vt[Ut]=(Ge+$e)/2,$e=P(Ge*$e),pt*=2;st=pt*Vt[Ut]*Se;do ot=tr[Ut]*y($e=st)/Vt[Ut],st=(D(ot)+st)/2;while(--Ut);return[y(st),ot=n(st),ot/n(st-$e),st]}function ba(Se,Ie,Ge){var $e=o(Se),st=o(Ie),ot=I(st);if($e){var pt=1/y($e),Vt=1/(_($e)*_($e)),tr=-(Vt+Ge*(ot*ot*pt*pt)-1+Ge),Ut=(Ge-1)*Vt,rr=(-tr+P(tr*tr-4*Ut))/2;return[Hi(s(1/P(rr)),Ge)*m(Se),Hi(s(P((rr/Vt-1)/Ge)),1-Ge)*m(Ie)]}return[0,Hi(s(ot),1-Ge)*m(Ie)]}function Hi(Se,Ie){if(!Ie)return Se;if(Ie===1)return f(_(Se/2+C));for(var Ge=1,$e=P(1-Ie),st=P(Ie),ot=0;o(st)>v;ot++){if(Se%S){var pt=s($e*_(Se)/Ge);pt<0&&(pt+=S),Se+=pt+~~(Se/S)*S}else Se+=Se;st=(Ge+$e)/2,$e=P(Ge*$e),st=((Ge=st)-$e)/2}return Se/(p(2,ot)*Ge)}function Za(Se,Ie){var Ge=(k-1)/(k+1),$e=P(1-Ge*Ge),st=Hi(M,$e*$e),ot=-1,pt=f(_(S/4+o(Ie)/2)),Vt=u(ot*pt)/P(Ge),tr=oa(Vt*n(ot*Se),Vt*y(ot*Se)),Ut=ba(tr[0],tr[1],$e*$e);return[-Ut[1],(Ie>=0?1:-1)*(.5*st-Ut[0])]}function oa(Se,Ie){var Ge=Se*Se,$e=Ie+1,st=1-Ge-Ie*Ie;return[.5*((Se>=0?M:-M)-l(st,2*Se)),-.25*f(st*st+4*Ge)+.5*f($e*$e+Ge)]}function Cn(Se,Ie){var Ge=Ie[0]*Ie[0]+Ie[1]*Ie[1];return[(Se[0]*Ie[0]+Se[1]*Ie[1])/Ge,(Se[1]*Ie[0]-Se[0]*Ie[1])/Ge]}Za.invert=function(Se,Ie){var Ge=(k-1)/(k+1),$e=P(1-Ge*Ge),st=Hi(M,$e*$e),ot=-1,pt=Mi(.5*st-Ie,-Se,$e*$e),Vt=Cn(pt[0],pt[1]),tr=l(Vt[1],Vt[0])/ot;return[tr,2*s(u(.5/ot*f(Ge*Vt[0]*Vt[0]+Ge*Vt[1]*Vt[1])))-M]};function _n(){return i.geoProjection(Kt(Za)).scale(151.496)}function Li(Se){var Ie=y(Se),Ge=n(Se),$e=In(Se);$e.invert=In(-Se);function st(ot,pt){var Vt=$e(ot,pt);ot=Vt[0],pt=Vt[1];var tr=y(pt),Ut=n(pt),rr=n(ot),pr=R(Ie*tr+Ge*Ut*rr),Sr=y(pr),Rr=o(Sr)>v?pr/Sr:1;return[Rr*Ge*y(ot),(o(ot)>M?Rr:-Rr)*(Ie*Ut-Ge*tr*rr)]}return st.invert=function(ot,pt){var Vt=P(ot*ot+pt*pt),tr=-y(Vt),Ut=n(Vt),rr=Vt*Ut,pr=-pt*tr,Sr=Vt*Ie,Rr=P(rr*rr+pr*pr-Sr*Sr),Zr=l(rr*Sr+pr*Rr,pr*Sr-rr*Rr),wi=(Vt>M?-1:1)*l(ot*tr,Vt*n(Zr)*Ut+pt*y(Zr)*tr);return $e.invert(wi,Zr)},st}function In(Se){var Ie=y(Se),Ge=n(Se);return function($e,st){var ot=n(st),pt=n($e)*ot,Vt=y($e)*ot,tr=y(st);return[l(Vt,pt*Ge-tr*Ie),D(tr*Ge+pt*Ie)]}}function pn(){var Se=0,Ie=i.geoProjectionMutator(Li),Ge=Ie(Se),$e=Ge.rotate,st=Ge.stream,ot=i.geoCircle();return Ge.parallel=function(pt){if(!arguments.length)return Se*E;var Vt=Ge.rotate();return Ie(Se=pt*T).rotate(Vt)},Ge.rotate=function(pt){return arguments.length?($e.call(Ge,[pt[0],pt[1]-Se*E]),ot.center([-pt[0],-pt[1]]),Ge):(pt=$e.call(Ge),pt[1]+=Se*E,pt)},Ge.stream=function(pt){return pt=st(pt),pt.sphere=function(){pt.polygonStart();var Vt=.01,tr=ot.radius(90-Vt)().coordinates[0],Ut=tr.length-1,rr=-1,pr;for(pt.lineStart();++rr=0;)pt.point((pr=tr[rr])[0],pr[1]);pt.lineEnd(),pt.polygonEnd()},pt},Ge.scale(79.4187).parallel(45).clipAngle(180-.001)}var Ka=3,Rn=D(1-1/Ka)*E,tn=rt(0);function Mn(Se){var Ie=Rn*T,Ge=Ae(S,Ie)[0]-Ae(-S,Ie)[0],$e=tn(0,Ie)[1],st=Ae(0,Ie)[1],ot=A-st,pt=b/Se,Vt=4/b,tr=$e+ot*ot*4/b;function Ut(rr,pr){var Sr,Rr=o(pr);if(Rr>Ie){var Zr=d(Se-1,h(0,c((rr+S)/pt)));rr+=S*(Se-1)/Se-Zr*pt,Sr=Ae(rr,Rr),Sr[0]=Sr[0]*b/Ge-b*(Se-1)/(2*Se)+Zr*b/Se,Sr[1]=$e+(Sr[1]-st)*4*ot/b,pr<0&&(Sr[1]=-Sr[1])}else Sr=tn(rr,pr);return Sr[0]*=Vt,Sr[1]/=tr,Sr}return Ut.invert=function(rr,pr){rr/=Vt,pr*=tr;var Sr=o(pr);if(Sr>$e){var Rr=d(Se-1,h(0,c((rr+S)/pt)));rr=(rr+S*(Se-1)/Se-Rr*pt)*Ge/b;var Zr=Ae.invert(rr,.25*(Sr-$e)*b/ot+st);return Zr[0]-=S*(Se-1)/Se-Rr*pt,pr<0&&(Zr[1]=-Zr[1]),Zr}return tn.invert(rr,pr)},Ut}function Kn(Se,Ie){return[Se,Ie&1?90-v:Rn]}function zn(Se,Ie){return[Se,Ie&1?-90+v:-Rn]}function ua(Se){return[Se[0]*(1-v),Se[1]]}function Ea(Se){var Ie=[].concat(a.range(-180,180+Se/2,Se).map(Kn),a.range(180,-180-Se/2,-Se).map(zn));return{type:"Polygon",coordinates:[Se===180?Ie.map(ua):Ie]}}function ln(){var Se=4,Ie=i.geoProjectionMutator(Mn),Ge=Ie(Se),$e=Ge.stream;return Ge.lobes=function(st){return arguments.length?Ie(Se=+st):Se},Ge.stream=function(st){var ot=Ge.rotate(),pt=$e(st),Vt=(Ge.rotate([0,0]),$e(st));return Ge.rotate(ot),pt.sphere=function(){i.geoStream(Ea(180/Se),Vt)},pt},Ge.scale(239.75)}function on(Se){var Ie=1+Se,Ge=y(1/Ie),$e=D(Ge),st=2*P(S/(ot=S+4*$e*Ie)),ot,pt=.5*st*(Ie+P(Se*(2+Se))),Vt=Se*Se,tr=Ie*Ie;function Ut(rr,pr){var Sr=1-y(pr),Rr,Zr;if(Sr&&Sr<2){var wi=M-pr,qi=25,Aa;do{var un=y(wi),gn=n(wi),Tn=$e+l(un,Ie-gn),Pn=1+tr-2*Ie*gn;wi-=Aa=(wi-Vt*$e-Ie*un+Pn*Tn-.5*Sr*ot)/(2*Ie*un*Tn)}while(o(Aa)>x&&--qi>0);Rr=st*P(Pn),Zr=rr*Tn/S}else Rr=st*(Se+Sr),Zr=rr*$e/S;return[Rr*y(Zr),pt-Rr*n(Zr)]}return Ut.invert=function(rr,pr){var Sr=rr*rr+(pr-=pt)*pr,Rr=(1+tr-Sr/(st*st))/(2*Ie),Zr=R(Rr),wi=y(Zr),qi=$e+l(wi,Ie-Rr);return[D(rr/P(Sr))*S/qi,D(1-2*(Zr-Vt*$e-Ie*wi+(1+tr-2*Ie*Rr)*qi)/ot)]},Ut}function ao(){var Se=1,Ie=i.geoProjectionMutator(on),Ge=Ie(Se);return Ge.ratio=function($e){return arguments.length?Ie(Se=+$e):Se},Ge.scale(167.774).center([0,18.67])}var ho=.7109889596207567,Jn=.0528035274542;function lo(Se,Ie){return Ie>-ho?(Se=ae(Se,Ie),Se[1]+=Jn,Se):Te(Se,Ie)}lo.invert=function(Se,Ie){return Ie>-ho?ae.invert(Se,Ie-Jn):Te.invert(Se,Ie)};function Fo(){return i.geoProjection(lo).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function uo(Se,Ie){return o(Ie)>ho?(Se=ae(Se,Ie),Se[1]-=Ie>0?Jn:-Jn,Se):Te(Se,Ie)}uo.invert=function(Se,Ie){return o(Ie)>ho?ae.invert(Se,Ie+(Ie>0?Jn:-Jn)):Te.invert(Se,Ie)};function Qn(){return i.geoProjection(uo).scale(152.63)}function jo(Se,Ie,Ge,$e){var st=P(4*S/(2*Ge+(1+Se-Ie/2)*y(2*Ge)+(Se+Ie)/2*y(4*Ge)+Ie/2*y(6*Ge))),ot=P($e*y(Ge)*P((1+Se*n(2*Ge)+Ie*n(4*Ge))/(1+Se+Ie))),pt=Ge*tr(1);function Vt(pr){return P(1+Se*n(2*pr)+Ie*n(4*pr))}function tr(pr){var Sr=pr*Ge;return(2*Sr+(1+Se-Ie/2)*y(2*Sr)+(Se+Ie)/2*y(4*Sr)+Ie/2*y(6*Sr))/Ge}function Ut(pr){return Vt(pr)*y(pr)}var rr=function(pr,Sr){var Rr=Ge*le(tr,pt*y(Sr)/Ge,Sr/S);isNaN(Rr)&&(Rr=Ge*m(Sr));var Zr=st*Vt(Rr);return[Zr*ot*pr/S*n(Rr),Zr/ot*y(Rr)]};return rr.invert=function(pr,Sr){var Rr=le(Ut,Sr*ot/st);return[pr*S/(n(Rr)*st*ot*Vt(Rr)),D(Ge*tr(Rr/Ge)/pt)]},Ge===0&&(st=P($e/S),rr=function(pr,Sr){return[pr*st,y(Sr)/st]},rr.invert=function(pr,Sr){return[pr/st,D(Sr*st)]}),rr}function Yn(){var Se=1,Ie=0,Ge=45*T,$e=2,st=i.geoProjectionMutator(jo),ot=st(Se,Ie,Ge,$e);return ot.a=function(pt){return arguments.length?st(Se=+pt,Ie,Ge,$e):Se},ot.b=function(pt){return arguments.length?st(Se,Ie=+pt,Ge,$e):Ie},ot.psiMax=function(pt){return arguments.length?st(Se,Ie,Ge=+pt*T,$e):Ge*E},ot.ratio=function(pt){return arguments.length?st(Se,Ie,Ge,$e=+pt):$e},ot.scale(180.739)}function Bn(Se,Ie,Ge,$e,st,ot,pt,Vt,tr,Ut,rr){if(rr.nanEncountered)return NaN;var pr,Sr,Rr,Zr,wi,qi,Aa,un,gn,Tn;if(pr=Ge-Ie,Sr=Se(Ie+pr*.25),Rr=Se(Ge-pr*.25),isNaN(Sr)){rr.nanEncountered=!0;return}if(isNaN(Rr)){rr.nanEncountered=!0;return}return Zr=pr*($e+4*Sr+st)/12,wi=pr*(st+4*Rr+ot)/12,qi=Zr+wi,Tn=(qi-pt)/15,Ut>tr?(rr.maxDepthCount++,qi+Tn):Math.abs(Tn)>1;do tr[qi]>Rr?wi=qi:Zr=qi,qi=Zr+wi>>1;while(qi>Zr);var Aa=tr[qi+1]-tr[qi];return Aa&&(Aa=(Rr-tr[qi+1])/Aa),(qi+1+Aa)/pt}var pr=2*rr(1)/S*ot/Ge,Sr=function(Rr,Zr){var wi=rr(o(y(Zr))),qi=$e(wi)*Rr;return wi/=pr,[qi,Zr>=0?wi:-wi]};return Sr.invert=function(Rr,Zr){var wi;return Zr*=pr,o(Zr)<1&&(wi=m(Zr)*D(st(o(Zr))*ot)),[Rr/$e(o(Zr)),wi]},Sr}function no(){var Se=0,Ie=2.5,Ge=1.183136,$e=i.geoProjectionMutator(xo),st=$e(Se,Ie,Ge);return st.alpha=function(ot){return arguments.length?$e(Se=+ot,Ie,Ge):Se},st.k=function(ot){return arguments.length?$e(Se,Ie=+ot,Ge):Ie},st.gamma=function(ot){return arguments.length?$e(Se,Ie,Ge=+ot):Ge},st.scale(152.63)}function Mo(Se,Ie){return o(Se[0]-Ie[0])=0;--tr)Ge=Se[1][tr],$e=Ge[0][0],st=Ge[0][1],ot=Ge[1][1],pt=Ge[2][0],Vt=Ge[2][1],Ie.push(Vn([[pt-v,Vt-v],[pt-v,ot+v],[$e+v,ot+v],[$e+v,st-v]],30));return{type:"Polygon",coordinates:[a.merge(Ie)]}}function ws(Se,Ie,Ge){var $e,st;function ot(tr,Ut){for(var rr=Ut<0?-1:1,pr=Ie[+(Ut<0)],Sr=0,Rr=pr.length-1;Srpr[Sr][2][0];++Sr);var Zr=Se(tr-pr[Sr][1][0],Ut);return Zr[0]+=Se(pr[Sr][1][0],rr*Ut>rr*pr[Sr][0][1]?pr[Sr][0][1]:Ut)[0],Zr}Ge?ot.invert=Ge(ot):Se.invert&&(ot.invert=function(tr,Ut){for(var rr=st[+(Ut<0)],pr=Ie[+(Ut<0)],Sr=0,Rr=rr.length;SrZr&&(wi=Rr,Rr=Zr,Zr=wi),[[pr,Rr],[Sr,Zr]]})}),pt):Ie.map(function(Ut){return Ut.map(function(rr){return[[rr[0][0]*E,rr[0][1]*E],[rr[1][0]*E,rr[1][1]*E],[rr[2][0]*E,rr[2][1]*E]]})})},Ie!=null&&pt.lobes(Ie),pt}var So=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function nl(){return ws(ue,So).scale(160.857)}var vs=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function go(){return ws(uo,vs).scale(152.63)}var Xn=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function On(){return ws(ae,Xn).scale(169.529)}var Uo=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function kl(){return ws(ae,Uo).scale(169.529).rotate([20,0])}var mu=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Ul(){return ws(lo,mu,ce).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var gu=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function yu(){return ws(Te,gu).scale(152.63).rotate([-20,0])}function Fu(Se,Ie){return[3/b*Se*P(S*S/3-Ie*Ie),Ie]}Fu.invert=function(Se,Ie){return[b/3*Se/P(S*S/3-Ie*Ie),Ie]};function au(){return i.geoProjection(Fu).scale(158.837)}function xc(Se){function Ie(Ge,$e){if(o(o($e)-M)2)return null;Ge/=2,$e/=2;var ot=Ge*Ge,pt=$e*$e,Vt=2*$e/(1+ot+pt);return Vt=p((1+Vt)/(1-Vt),1/Se),[l(2*Ge,1-ot-pt)/Se,D((Vt-1)/(Vt+1))]},Ie}function Pu(){var Se=.5,Ie=i.geoProjectionMutator(xc),Ge=Ie(Se);return Ge.spacing=function($e){return arguments.length?Ie(Se=+$e):Se},Ge.scale(124.75)}var Cl=S/k;function bc(Se,Ie){return[Se*(1+P(n(Ie)))/2,Ie/(n(Ie/2)*n(Se/6))]}bc.invert=function(Se,Ie){var Ge=o(Se),$e=o(Ie),st=v,ot=M;$ev||o(qi)>v)&&--st>0);return st&&[Ge,$e]};function ms(){return i.geoProjection(_l).scale(139.98)}function ss(Se,Ie){return[y(Se)/n(Ie),_(Ie)*n(Se)]}ss.invert=function(Se,Ie){var Ge=Se*Se,$e=Ie*Ie,st=$e+1,ot=Ge+st,pt=Se?w*P((ot-P(ot*ot-4*Ge))/Ge):1/P(st);return[D(Se*pt),m(Ie)*R(pt)]};function fl(){return i.geoProjection(ss).scale(144.049).clipAngle(90-.001)}function wc(Se){var Ie=n(Se),Ge=_(C+Se/2);function $e(st,ot){var pt=ot-Se,Vt=o(pt)=0;)rr=Se[Ut],pr=rr[0]+Vt*(Rr=pr)-tr*Sr,Sr=rr[1]+Vt*Sr+tr*Rr;return pr=Vt*(Rr=pr)-tr*Sr,Sr=Vt*Sr+tr*Rr,[pr,Sr]}return Ge.invert=function($e,st){var ot=20,pt=$e,Vt=st;do{for(var tr=Ie,Ut=Se[tr],rr=Ut[0],pr=Ut[1],Sr=0,Rr=0,Zr;--tr>=0;)Ut=Se[tr],Sr=rr+pt*(Zr=Sr)-Vt*Rr,Rr=pr+pt*Rr+Vt*Zr,rr=Ut[0]+pt*(Zr=rr)-Vt*pr,pr=Ut[1]+pt*pr+Vt*Zr;Sr=rr+pt*(Zr=Sr)-Vt*Rr,Rr=pr+pt*Rr+Vt*Zr,rr=pt*(Zr=rr)-Vt*pr-$e,pr=pt*pr+Vt*Zr-st;var wi=Sr*Sr+Rr*Rr,qi,Aa;pt-=qi=(rr*Sr+pr*Rr)/wi,Vt-=Aa=(pr*Sr-rr*Rr)/wi}while(o(qi)+o(Aa)>v*v&&--ot>0);if(ot){var un=P(pt*pt+Vt*Vt),gn=2*s(un*.5),Tn=y(gn);return[l(pt*Tn,un*n(gn)),un?D(Vt*Tn/un):0]}},Ge}var zd=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],hp=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ru=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Ts=[[.9245,0],[0,0],[.01943,0]],Mh=[[.721316,0],[0,0],[-.00881625,-.00617325]];function vf(){return zu(zd,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Ac(){return zu(hp,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Sh(){return zu(Ru,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Mc(){return zu(Ts,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function $c(){return zu(Mh,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function zu(Se,Ie){var Ge=i.geoProjection(Ah(Se)).rotate(Ie).clipAngle(90),$e=i.geoRotation(Ie),st=Ge.center;return delete Ge.rotate,Ge.center=function(ot){return arguments.length?st($e(ot)):$e.invert(st())},Ge}var mf=P(6),jf=P(7);function Sc(Se,Ie){var Ge=D(7*y(Ie)/(3*mf));return[mf*Se*(2*n(2*Ge/3)-1)/jf,9*y(Ge/3)/jf]}Sc.invert=function(Se,Ie){var Ge=3*D(Ie*jf/9);return[Se*jf/(mf*(2*n(2*Ge/3)-1)),D(y(Ge)*3*mf/7)]};function ad(){return i.geoProjection(Sc).scale(164.859)}function Uf(Se,Ie){for(var Ge=(1+w)*y(Ie),$e=Ie,st=0,ot;st<25&&($e-=ot=(y($e/2)+y($e)-Ge)/(.5*n($e/2)+n($e)),!(o(ot)x&&--$e>0);return ot=Ge*Ge,pt=ot*ot,Vt=ot*pt,[Se/(.84719-.13063*ot+Vt*Vt*(-.04515+.05494*ot-.02326*pt+.00331*Vt)),Ge]};function qf(){return i.geoProjection(_u).scale(175.295)}function Dl(Se,Ie){return[Se*(1+n(Ie))/2,2*(Ie-_(Ie/2))]}Dl.invert=function(Se,Ie){for(var Ge=Ie/2,$e=0,st=1/0;$e<10&&o(st)>v;++$e){var ot=n(Ie/2);Ie-=st=(Ie-_(Ie/2)-Ge)/(1-.5/(ot*ot))}return[2*Se/(1+n(Ie)),Ie]};function gf(){return i.geoProjection(Dl).scale(152.63)}var Ou=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function yf(){return ws(te(1/0),Ou).rotate([20,0]).scale(152.63)}function _f(Se,Ie){var Ge=y(Ie),$e=n(Ie),st=m(Se);if(Se===0||o(Ie)===M)return[0,Ie];if(Ie===0)return[Se,0];if(o(Se)===M)return[Se*$e,M*Ge];var ot=S/(2*Se)-2*Se/S,pt=2*Ie/S,Vt=(1-pt*pt)/(Ge-pt),tr=ot*ot,Ut=Vt*Vt,rr=1+tr/Ut,pr=1+Ut/tr,Sr=(ot*Ge/Vt-ot/2)/rr,Rr=(Ut*Ge/tr+Vt/2)/pr,Zr=Sr*Sr+$e*$e/rr,wi=Rr*Rr-(Ut*Ge*Ge/tr+Vt*Ge-1)/pr;return[M*(Sr+P(Zr)*st),M*(Rr+P(wi<0?0:wi)*m(-Ie*ot)*st)]}_f.invert=function(Se,Ie){Se/=M,Ie/=M;var Ge=Se*Se,$e=Ie*Ie,st=Ge+$e,ot=S*S;return[Se?(st-1+P((1-st)*(1-st)+4*Ge))/(2*Se)*M:0,le(function(pt){return st*(S*y(pt)-2*pt)*S+4*pt*pt*(Ie-y(pt))+2*S*pt-ot*Ie},0)]};function Vf(){return i.geoProjection(_f).scale(127.267)}var kh=1.0148,Ec=.23185,Ch=-.14499,rc=.02406,Od=kh,xl=5*Ec,xu=7*Ch,kc=9*rc,hl=1.790857183;function Gf(Se,Ie){var Ge=Ie*Ie;return[Se,Ie*(kh+Ge*Ge*(Ec+Ge*(Ch+rc*Ge)))]}Gf.invert=function(Se,Ie){Ie>hl?Ie=hl:Ie<-hl&&(Ie=-hl);var Ge=Ie,$e;do{var st=Ge*Ge;Ge-=$e=(Ge*(kh+st*st*(Ec+st*(Ch+rc*st)))-Ie)/(Od+st*st*(xl+st*(xu+kc*st)))}while(o($e)>v);return[Se,Ge]};function Nu(){return i.geoProjection(Gf).scale(139.319)}function Cc(Se,Ie){if(o(Ie)v&&--st>0);return pt=_($e),[(o(Ie)=0;)if($e=Ie[Vt],Ge[0]===$e[0]&&Ge[1]===$e[1]){if(ot)return[ot,Ge];ot=Ge}}}function $f(Se){for(var Ie=Se.length,Ge=[],$e=Se[Ie-1],st=0;st0?[-$e[0],0]:[180-$e[0],180])};var Ie=Yc.map(function(Ge){return{face:Ge,project:Se(Ge)}});return[-1,0,0,1,0,1,4,5].forEach(function(Ge,$e){var st=Ie[Ge];st&&(st.children||(st.children=[])).push(Ie[$e])}),xf(Ie[0],function(Ge,$e){return Ie[Ge<-S/2?$e<0?6:4:Ge<0?$e<0?2:0:Ge$e^Rr>$e&&Ge<(Sr-Ut)*($e-rr)/(Rr-rr)+Ut&&(st=!st)}return st}function Dh(Se,Ie){var Ge=Ie.stream,$e;if(!Ge)throw new Error("invalid projection");switch(Se&&Se.type){case"Feature":$e=Zf;break;case"FeatureCollection":$e=qd;break;default:$e=Lh;break}return $e(Se,Ge)}function qd(Se,Ie){return{type:"FeatureCollection",features:Se.features.map(function(Ge){return Zf(Ge,Ie)})}}function Zf(Se,Ie){return{type:"Feature",id:Se.id,properties:Se.properties,geometry:Lh(Se.geometry,Ie)}}function ud(Se,Ie){return{type:"GeometryCollection",geometries:Se.geometries.map(function(Ge){return Lh(Ge,Ie)})}}function Lh(Se,Ie){if(!Se)return null;if(Se.type==="GeometryCollection")return ud(Se,Ie);var Ge;switch(Se.type){case"Point":Ge=Kf;break;case"MultiPoint":Ge=Kf;break;case"LineString":Ge=Fh;break;case"MultiLineString":Ge=Fh;break;case"Polygon":Ge=Jf;break;case"MultiPolygon":Ge=Jf;break;case"Sphere":Ge=Jf;break;default:return null}return i.geoStream(Se,Ie(Ge)),Ge.result()}var Js=[],ou=[],Kf={point:function(Se,Ie){Js.push([Se,Ie])},result:function(){var Se=Js.length?Js.length<2?{type:"Point",coordinates:Js[0]}:{type:"MultiPoint",coordinates:Js}:null;return Js=[],Se}},Fh={lineStart:Tf,point:function(Se,Ie){Js.push([Se,Ie])},lineEnd:function(){Js.length&&(ou.push(Js),Js=[])},result:function(){var Se=ou.length?ou.length<2?{type:"LineString",coordinates:ou[0]}:{type:"MultiLineString",coordinates:ou}:null;return ou=[],Se}},Jf={polygonStart:Tf,lineStart:Tf,point:function(Se,Ie){Js.push([Se,Ie])},lineEnd:function(){var Se=Js.length;if(Se){do Js.push(Js[0].slice());while(++Se<4);ou.push(Js),Js=[]}},polygonEnd:Tf,result:function(){if(!ou.length)return null;var Se=[],Ie=[];return ou.forEach(function(Ge){Xf(Ge)?Se.push([Ge]):Ie.push(Ge)}),Ie.forEach(function(Ge){var $e=Ge[0];Se.some(function(st){if(ld(st[0],$e))return st.push(Ge),!0})||Se.push([Ge])}),ou=[],Se.length?Se.length>1?{type:"MultiPolygon",coordinates:Se}:{type:"Polygon",coordinates:Se[0]}:null}};function Af(Se){var Ie=Se(M,0)[0]-Se(-M,0)[0];function Ge($e,st){var ot=o($e)0?$e-S:$e+S,st),Vt=(pt[0]-pt[1])*w,tr=(pt[0]+pt[1])*w;if(ot)return[Vt,tr];var Ut=Ie*w,rr=Vt>0^tr>0?-1:1;return[rr*Vt-m(tr)*Ut,rr*tr-m(Vt)*Ut]}return Se.invert&&(Ge.invert=function($e,st){var ot=($e+st)*w,pt=(st-$e)*w,Vt=o(ot)<.5*Ie&&o(pt)<.5*Ie;if(!Vt){var tr=Ie*w,Ut=ot>0^pt>0?-1:1,rr=-Ut*$e+(pt>0?1:-1)*tr,pr=-Ut*st+(ot>0?1:-1)*tr;ot=(-rr-pr)*w,pt=(rr-pr)*w}var Sr=Se.invert(ot,pt);return Vt||(Sr[0]+=ot>0?S:-S),Sr}),i.geoProjection(Ge).rotate([-90,-90,45]).clipAngle(180-.001)}function nt(){return Af(qt).scale(176.423)}function Tt(){return Af(Za).scale(111.48)}function Jt(Se,Ie){if(!(0<=(Ie=+Ie)&&Ie<=20))throw new Error("invalid digits");function Ge(Ut){var rr=Ut.length,pr=2,Sr=new Array(rr);for(Sr[0]=+Ut[0].toFixed(Ie),Sr[1]=+Ut[1].toFixed(Ie);pr2||Rr[0]!=rr[0]||Rr[1]!=rr[1])&&(pr.push(Rr),rr=Rr)}return pr.length===1&&Ut.length>1&&pr.push(Ge(Ut[Ut.length-1])),pr}function ot(Ut){return Ut.map(st)}function pt(Ut){if(Ut==null)return Ut;var rr;switch(Ut.type){case"GeometryCollection":rr={type:"GeometryCollection",geometries:Ut.geometries.map(pt)};break;case"Point":rr={type:"Point",coordinates:Ge(Ut.coordinates)};break;case"MultiPoint":rr={type:Ut.type,coordinates:$e(Ut.coordinates)};break;case"LineString":rr={type:Ut.type,coordinates:st(Ut.coordinates)};break;case"MultiLineString":case"Polygon":rr={type:Ut.type,coordinates:ot(Ut.coordinates)};break;case"MultiPolygon":rr={type:"MultiPolygon",coordinates:Ut.coordinates.map(ot)};break;default:return Ut}return Ut.bbox!=null&&(rr.bbox=Ut.bbox),rr}function Vt(Ut){var rr={type:"Feature",properties:Ut.properties,geometry:pt(Ut.geometry)};return Ut.id!=null&&(rr.id=Ut.id),Ut.bbox!=null&&(rr.bbox=Ut.bbox),rr}if(Se!=null)switch(Se.type){case"Feature":return Vt(Se);case"FeatureCollection":{var tr={type:"FeatureCollection",features:Se.features.map(Vt)};return Se.bbox!=null&&(tr.bbox=Se.bbox),tr}default:return pt(Se)}return Se}function Bt(Se){var Ie=y(Se);function Ge($e,st){var ot=Ie?_($e*Ie/2)/Ie:$e/2;if(!st)return[2*ot,-Se];var pt=2*s(ot*y(st)),Vt=1/_(st);return[y(pt)*Vt,st+(1-n(pt))*Vt-Se]}return Ge.invert=function($e,st){if(o(st+=Se)v&&--Vt>0);var Sr=$e*(Ut=_(pt)),Rr=_(o(st)0?M:-M)*(tr+st*(rr-pt)/2+st*st*(rr-2*tr+pt)/2)]}Gr.invert=function(Se,Ie){var Ge=Ie/M,$e=Ge*90,st=d(18,o($e/5)),ot=h(0,c(st));do{var pt=zr[ot][1],Vt=zr[ot+1][1],tr=zr[d(19,ot+2)][1],Ut=tr-pt,rr=tr-2*Vt+pt,pr=2*(o(Ge)-Vt)/Ut,Sr=rr/Ut,Rr=pr*(1-Sr*pr*(1-2*Sr*pr));if(Rr>=0||ot===1){$e=(Ie>=0?5:-5)*(Rr+st);var Zr=50,wi;do st=d(18,o($e)/5),ot=c(st),Rr=st-ot,pt=zr[ot][1],Vt=zr[ot+1][1],tr=zr[d(19,ot+2)][1],$e-=(wi=(Ie>=0?M:-M)*(Vt+Rr*(tr-pt)/2+Rr*Rr*(tr-2*Vt+pt)/2)-Ie)*E;while(o(wi)>x&&--Zr>0);break}}while(--ot>=0);var qi=zr[ot][0],Aa=zr[ot+1][0],un=zr[d(19,ot+2)][0];return[Se/(Aa+Rr*(un-qi)/2+Rr*Rr*(un-2*Aa+qi)/2),$e*T]};function ii(){return i.geoProjection(Gr).scale(152.63)}function li(Se){function Ie(Ge,$e){var st=n($e),ot=(Se-1)/(Se-st*n(Ge));return[ot*st*y(Ge),ot*y($e)]}return Ie.invert=function(Ge,$e){var st=Ge*Ge+$e*$e,ot=P(st),pt=(Se-P(1-st*(Se+1)/(Se-1)))/((Se-1)/ot+ot/(Se-1));return[l(Ge*pt,ot*P(1-pt*pt)),ot?D($e*pt/ot):0]},Ie}function Fi(Se,Ie){var Ge=li(Se);if(!Ie)return Ge;var $e=n(Ie),st=y(Ie);function ot(pt,Vt){var tr=Ge(pt,Vt),Ut=tr[1],rr=Ut*st/(Se-1)+$e;return[tr[0]*$e/rr,Ut/rr]}return ot.invert=function(pt,Vt){var tr=(Se-1)/(Se-1-Vt*st);return Ge.invert(tr*pt,tr*Vt*$e)},ot}function $r(){var Se=2,Ie=0,Ge=i.geoProjectionMutator(Fi),$e=Ge(Se,Ie);return $e.distance=function(st){return arguments.length?Ge(Se=+st,Ie):Se},$e.tilt=function(st){return arguments.length?Ge(Se,Ie=st*T):Ie*E},$e.scale(432.147).clipAngle(R(1/Se)*E-1e-6)}var ni=1e-4,ui=1e4,Di=-180,Wi=Di+ni,Oa=180,Pa=Oa-ni,Ja=-90,rn=Ja+ni,Zi=90,sa=Zi-ni;function vn(Se){return Se.length>0}function Dn(Se){return Math.floor(Se*ui)/ui}function po(Se){return Se===Ja||Se===Zi?[0,Se]:[Di,Dn(Se)]}function zo(Se){var Ie=Se[0],Ge=Se[1],$e=!1;return Ie<=Wi?(Ie=Di,$e=!0):Ie>=Pa&&(Ie=Oa,$e=!0),Ge<=rn?(Ge=Ja,$e=!0):Ge>=sa&&(Ge=Zi,$e=!0),$e?[Ie,Ge]:Se}function wo(Se){return Se.map(zo)}function $o(Se,Ie,Ge){for(var $e=0,st=Se.length;$e=Pa||rr<=rn||rr>=sa){ot[pt]=zo(tr);for(var pr=pt+1;prWi&&Rrrn&&Zr=Vt)break;Ge.push({index:-1,polygon:Ie,ring:ot=ot.slice(pr-1)}),ot[0]=po(ot[0][1]),pt=-1,Vt=ot.length}}}}function io(Se){var Ie,Ge=Se.length,$e={},st={},ot,pt,Vt,tr,Ut;for(Ie=0;Ie0?S-Vt:Vt)*E],Ut=i.geoProjection(Se(pt)).rotate(tr),rr=i.geoRotation(tr),pr=Ut.center;return delete Ut.rotate,Ut.center=function(Sr){return arguments.length?pr(rr(Sr)):rr.invert(pr())},Ut.clipAngle(90)}function qs(Se){var Ie=n(Se);function Ge($e,st){var ot=i.geoGnomonicRaw($e,st);return ot[0]*=Ie,ot}return Ge.invert=function($e,st){return i.geoGnomonicRaw.invert($e/Ie,st)},Ge}function Ll(){return bu([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function bu(Se,Ie){return Ls(qs,Se,Ie)}function Gl(Se){if(!(Se*=2))return i.geoAzimuthalEquidistantRaw;var Ie=-Se/2,Ge=-Ie,$e=Se*Se,st=_(Ge),ot=.5/y(Ge);function pt(Vt,tr){var Ut=R(n(tr)*n(Vt-Ie)),rr=R(n(tr)*n(Vt-Ge)),pr=tr<0?-1:1;return Ut*=Ut,rr*=rr,[(Ut-rr)/(2*Se),pr*P(4*$e*rr-($e-Ut+rr)*($e-Ut+rr))/(2*Se)]}return pt.invert=function(Vt,tr){var Ut=tr*tr,rr=n(P(Ut+(Sr=Vt+Ie)*Sr)),pr=n(P(Ut+(Sr=Vt+Ge)*Sr)),Sr,Rr;return[l(Rr=rr-pr,Sr=(rr+pr)*st),(tr<0?-1:1)*R(P(Sr*Sr+Rr*Rr)*ot)]},pt}function ac(){return bl([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function bl(Se,Ie){return Ls(Gl,Se,Ie)}function Uu(Se,Ie){if(o(Ie)v&&--Vt>0);return[m(Se)*(P(st*st+4)+st)*S/4,M*pt]};function Hl(){return i.geoProjection(Ph).scale(127.16)}function Gd(Se,Ie,Ge,$e,st){function ot(pt,Vt){var tr=Ge*y($e*Vt),Ut=P(1-tr*tr),rr=P(2/(1+Ut*n(pt*=st)));return[Se*Ut*rr*y(pt),Ie*tr*rr]}return ot.invert=function(pt,Vt){var tr=pt/Se,Ut=Vt/Ie,rr=P(tr*tr+Ut*Ut),pr=2*D(rr/2);return[l(pt*_(pr),Se*rr)/st,rr&&D(Vt*y(pr)/(Ie*Ge*rr))/$e]},ot}function Mf(Se,Ie,Ge,$e){var st=S/3;Se=h(Se,v),Ie=h(Ie,v),Se=d(Se,M),Ie=d(Ie,S-v),Ge=h(Ge,0),Ge=d(Ge,100-v),$e=h($e,v);var ot=Ge/100+1,pt=$e/100,Vt=R(ot*n(st))/st,tr=y(Se)/y(Vt*M),Ut=Ie/S,rr=P(pt*y(Se/2)/y(Ie/2)),pr=rr/P(Ut*tr*Vt),Sr=1/(rr*P(Ut*tr*Vt));return Gd(pr,Sr,tr,Vt,Ut)}function Ih(){var Se=65*T,Ie=60*T,Ge=20,$e=200,st=i.geoProjectionMutator(Mf),ot=st(Se,Ie,Ge,$e);return ot.poleline=function(pt){return arguments.length?st(Se=+pt*T,Ie,Ge,$e):Se*E},ot.parallels=function(pt){return arguments.length?st(Se,Ie=+pt*T,Ge,$e):Ie*E},ot.inflation=function(pt){return arguments.length?st(Se,Ie,Ge=+pt,$e):Ge},ot.ratio=function(pt){return arguments.length?st(Se,Ie,Ge,$e=+pt):$e},ot.scale(163.775)}function Rh(){return Ih().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var qu=4*S+3*P(3),fd=2*P(2*S*P(3)/qu),Jc=fe(fd*P(3)/S,fd,qu/6);function eh(){return i.geoProjection(Jc).scale(176.84)}function Qc(Se,Ie){return[Se*P(1-3*Ie*Ie/(S*S)),Ie]}Qc.invert=function(Se,Ie){return[Se/P(1-3*Ie*Ie/(S*S)),Ie]};function wu(){return i.geoProjection(Qc).scale(152.63)}function ef(Se,Ie){var Ge=n(Ie),$e=n(Se)*Ge,st=1-$e,ot=n(Se=l(y(Se)*Ge,-y(Ie))),pt=y(Se);return Ge=P(1-$e*$e),[pt*Ge-ot*st,-ot*Ge-pt*st]}ef.invert=function(Se,Ie){var Ge=(Se*Se+Ie*Ie)/-2,$e=P(-Ge*(2+Ge)),st=Ie*Ge+Se*$e,ot=Se*Ge-Ie*$e,pt=P(ot*ot+st*st);return[l($e*st,pt*(1+Ge)),pt?-D($e*ot/pt):0]};function Sf(){return i.geoProjection(ef).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function hd(Se,Ie){var Ge=X(Se,Ie);return[(Ge[0]+Se/M)/2,(Ge[1]+Ie)/2]}hd.invert=function(Se,Ie){var Ge=Se,$e=Ie,st=25;do{var ot=n($e),pt=y($e),Vt=y(2*$e),tr=pt*pt,Ut=ot*ot,rr=y(Ge),pr=n(Ge/2),Sr=y(Ge/2),Rr=Sr*Sr,Zr=1-Ut*pr*pr,wi=Zr?R(ot*pr)*P(qi=1/Zr):qi=0,qi,Aa=.5*(2*wi*ot*Sr+Ge/M)-Se,un=.5*(wi*pt+$e)-Ie,gn=.5*qi*(Ut*Rr+wi*ot*pr*tr)+.5/M,Tn=qi*(rr*Vt/4-wi*pt*Sr),Pn=.125*qi*(Vt*Sr-wi*pt*Ut*rr),Eo=.5*qi*(tr*pr+wi*Rr*ot)+.5,qo=Tn*Pn-Eo*gn,Wn=(un*Tn-Aa*Eo)/qo,ls=(Aa*Pn-un*gn)/qo;Ge-=Wn,$e-=ls}while((o(Wn)>v||o(ls)>v)&&--st>0);return[Ge,$e]};function $l(){return i.geoProjection(hd).scale(158.837)}t.geoNaturalEarth=i.geoNaturalEarth1,t.geoNaturalEarthRaw=i.geoNaturalEarth1Raw,t.geoAiry=W,t.geoAiryRaw=G,t.geoAitoff=Z,t.geoAitoffRaw=X,t.geoArmadillo=N,t.geoArmadilloRaw=J,t.geoAugust=$,t.geoAugustRaw=H,t.geoBaker=q,t.geoBakerRaw=j,t.geoBerghaus=K,t.geoBerghausRaw=Y,t.geoBertin1953=xe,t.geoBertin1953Raw=pe,t.geoBoggs=ge,t.geoBoggsRaw=ue,t.geoBonne=Ke,t.geoBonneRaw=Ve,t.geoBottomley=vt,t.geoBottomleyRaw=Je,t.geoBromley=Pt,t.geoBromleyRaw=xt,t.geoChamberlin=_e,t.geoChamberlinRaw=qe,t.geoChamberlinAfrica=me,t.geoCollignon=ke,t.geoCollignonRaw=Ae,t.geoCraig=De,t.geoCraigRaw=Ee,t.geoCraster=at,t.geoCrasterRaw=Ue,t.geoCylindricalEqualArea=ht,t.geoCylindricalEqualAreaRaw=rt,t.geoCylindricalStereographic=dt,t.geoCylindricalStereographicRaw=At,t.geoEckert1=fr,t.geoEckert1Raw=Ht,t.geoEckert2=yt,t.geoEckert2Raw=gt,t.geoEckert3=Lt,t.geoEckert3Raw=kt,t.geoEckert4=$t,t.geoEckert4Raw=Ct,t.geoEckert5=br,t.geoEckert5Raw=mr,t.geoEckert6=Tr,t.geoEckert6Raw=Er,t.geoEisenlohr=oi,t.geoEisenlohrRaw=Ai,t.geoFahey=$i,t.geoFaheyRaw=ea,t.geoFoucaut=ya,t.geoFoucautRaw=ja,t.geoFoucautSinusoidal=xi,t.geoFoucautSinusoidalRaw=pa,t.geoGilbert=dn,t.geoGingery=Fe,t.geoGingeryRaw=pi,t.geoGinzburg4=zt,t.geoGinzburg4Raw=St,t.geoGinzburg5=Yt,t.geoGinzburg5Raw=Wt,t.geoGinzburg6=tt,t.geoGinzburg6Raw=ze,t.geoGinzburg8=wt,t.geoGinzburg8Raw=ft,t.geoGinzburg9=It,t.geoGinzburg9Raw=jt,t.geoGringorten=Pr,t.geoGringortenRaw=qt,t.geoGuyou=_n,t.geoGuyouRaw=Za,t.geoHammer=se,t.geoHammerRaw=te,t.geoHammerRetroazimuthal=pn,t.geoHammerRetroazimuthalRaw=Li,t.geoHealpix=ln,t.geoHealpixRaw=Mn,t.geoHill=ao,t.geoHillRaw=on,t.geoHomolosine=Qn,t.geoHomolosineRaw=uo,t.geoHufnagel=Yn,t.geoHufnagelRaw=jo,t.geoHyperelliptical=no,t.geoHyperellipticalRaw=xo,t.geoInterrupt=ws,t.geoInterruptedBoggs=nl,t.geoInterruptedHomolosine=go,t.geoInterruptedMollweide=On,t.geoInterruptedMollweideHemispheres=kl,t.geoInterruptedSinuMollweide=Ul,t.geoInterruptedSinusoidal=yu,t.geoKavrayskiy7=au,t.geoKavrayskiy7Raw=Fu,t.geoLagrange=Pu,t.geoLagrangeRaw=xc,t.geoLarrivee=Iu,t.geoLarriveeRaw=bc,t.geoLaskowski=ms,t.geoLaskowskiRaw=_l,t.geoLittrow=fl,t.geoLittrowRaw=ss,t.geoLoximuthal=Tc,t.geoLoximuthalRaw=wc,t.geoMiller=Th,t.geoMillerRaw=tc,t.geoModifiedStereographic=zu,t.geoModifiedStereographicRaw=Ah,t.geoModifiedStereographicAlaska=vf,t.geoModifiedStereographicGs48=Ac,t.geoModifiedStereographicGs50=Sh,t.geoModifiedStereographicMiller=Mc,t.geoModifiedStereographicLee=$c,t.geoMollweide=ee,t.geoMollweideRaw=ae,t.geoMtFlatPolarParabolic=ad,t.geoMtFlatPolarParabolicRaw=Sc,t.geoMtFlatPolarQuartic=Bd,t.geoMtFlatPolarQuarticRaw=Uf,t.geoMtFlatPolarSinusoidal=Eh,t.geoMtFlatPolarSinusoidalRaw=Bu,t.geoNaturalEarth2=qf,t.geoNaturalEarth2Raw=_u,t.geoNellHammer=gf,t.geoNellHammerRaw=Dl,t.geoInterruptedQuarticAuthalic=yf,t.geoNicolosi=Vf,t.geoNicolosiRaw=_f,t.geoPatterson=Nu,t.geoPattersonRaw=Gf,t.geoPolyconic=Hf,t.geoPolyconicRaw=Cc,t.geoPolyhedral=xf,t.geoPolyhedralButterfly=Dc,t.geoPolyhedralCollignon=sd,t.geoPolyhedralWaterman=Wf,t.geoProject=Dh,t.geoGringortenQuincuncial=nt,t.geoPeirceQuincuncial=Tt,t.geoPierceQuincuncial=Tt,t.geoQuantize=Jt,t.geoQuincuncial=Af,t.geoRectangularPolyconic=yr,t.geoRectangularPolyconicRaw=Bt,t.geoRobinson=ii,t.geoRobinsonRaw=Gr,t.geoSatellite=$r,t.geoSatelliteRaw=Fi,t.geoSinuMollweide=Fo,t.geoSinuMollweideRaw=lo,t.geoSinusoidal=je,t.geoSinusoidalRaw=Te,t.geoStitch=Go,t.geoTimes=vo,t.geoTimesRaw=ma,t.geoTwoPointAzimuthal=bu,t.geoTwoPointAzimuthalRaw=qs,t.geoTwoPointAzimuthalUsa=Ll,t.geoTwoPointEquidistant=bl,t.geoTwoPointEquidistantRaw=Gl,t.geoTwoPointEquidistantUsa=ac,t.geoVanDerGrinten=Fc,t.geoVanDerGrintenRaw=Uu,t.geoVanDerGrinten2=cd,t.geoVanDerGrinten2Raw=Kc,t.geoVanDerGrinten3=Vd,t.geoVanDerGrinten3Raw=Qf,t.geoVanDerGrinten4=Hl,t.geoVanDerGrinten4Raw=Ph,t.geoWagner=Ih,t.geoWagner7=Rh,t.geoWagnerRaw=Mf,t.geoWagner4=eh,t.geoWagner4Raw=Jc,t.geoWagner6=wu,t.geoWagner6Raw=Qc,t.geoWiechel=Sf,t.geoWiechelRaw=ef,t.geoWinkel3=$l,t.geoWinkel3Raw=hd,Object.defineProperty(t,"__esModule",{value:!0})}))}}),JY=de({"src/plots/geo/zoom.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=Sa(),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},n={cursor:"auto"};function u(E,T){var F=E.projection,D;return T._isScoped?D=h:T._isClipped?D=p:D=d,D(E,F)}r.exports=u;function c(E,T){return t.behavior.zoom().translate(T.translate()).scaleExtent(T.scaleExtent()).scale(T.scale())}function f(E,T,F){var D=E.id,R=E.graphDiv,P=R.layout,z=P[D],I=R._fullLayout,L=I[D],B={},O={};function G(W,X){B[D+"."+W]=i.nestedProperty(z,W).get(),a.call("_storeDirectGUIEdit",P,I._preGUI,B);var Z=i.nestedProperty(L,W);Z.get()!==X&&(Z.set(X),i.nestedProperty(z,W).set(X),O[D+"."+W]=X)}F(G),G("projection.scale",T.scale()/E.fitScale),G("fitbounds",!1),R.emit("plotly_relayout",O)}function h(E,T){var F=c(E,T);function D(){t.select(this).style(l)}function R(){T.scale(t.event.scale).translate(t.event.translate),E.render(!0);var I=T.invert(E.midPt);E.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/E.fitScale,"geo.center.lon":I[0],"geo.center.lat":I[1]})}function P(I){var L=T.invert(E.midPt);I("center.lon",L[0]),I("center.lat",L[1])}function z(){t.select(this).style(n),f(E,T,P)}return F.on("zoomstart",D).on("zoom",R).on("zoomend",z),F}function d(E,T){var F=c(E,T),D=2,R,P,z,I,L,B,O,G,W;function X(U){return T.invert(U)}function Z(U){var V=X(U);if(!V)return!0;var j=T(V);return Math.abs(j[0]-U[0])>D||Math.abs(j[1]-U[1])>D}function J(){t.select(this).style(l);let{x:U,y:V,width:j,height:q}=this.getBBox();R=t.event.sourceEvent?t.mouse(this):[U+j/2,V+q/2],P=T.rotate(),z=T.translate(),I=P,L=X(R)}function N(){let{x:U,y:V,width:j,height:q}=this.getBBox();if(B=t.event.sourceEvent?t.mouse(this):[U+j/2,V+q/2],Z(R)){F.scale(T.scale()),F.translate(T.translate());return}T.scale(t.event.scale),T.translate([z[0],t.event.translate[1]]),L?X(B)&&(G=X(B),O=[I[0]+(G[0]-L[0]),P[1],P[2]],T.rotate(O),I=O):(R=B,L=X(R)),W=!0,E.render(!0);var Y=T.rotate(),K=T.invert(E.midPt);E.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/E.fitScale,"geo.center.lon":K[0],"geo.center.lat":K[1],"geo.projection.rotation.lon":-Y[0]})}function H(){t.select(this).style(n),W&&f(E,T,$)}function $(U){var V=T.rotate(),j=T.invert(E.midPt);U("projection.rotation.lon",-V[0]),U("center.lon",j[0]),U("center.lat",j[1])}return F.on("zoomstart",J).on("zoom",N).on("zoomend",H),F}function p(E,T){var F={r:T.rotate(),k:T.scale()},D=c(E,T),R=b(D,"zoomstart","zoom","zoomend"),P=0,z=D.on,I;D.on("zoomstart",function(){t.select(this).style(l);let{x:W,y:X,width:Z,height:J}=this.getBBox(),N=t.event.sourceEvent?t.mouse(this):[W+Z/2,X+J/2],H=T.rotate(),$=H,U=T.translate(),V=m(H);I=g(T,N),z.call(D,"zoom",function(){let{x:j,y:q,width:Y,height:K}=this.getBBox(),te=t.event.sourceEvent?t.mouse(this):[j+Y/2,q+K/2];if(T.scale(F.k=t.event.scale),!I)N=te,I=g(T,N);else if(g(T,te)){T.rotate(H).translate(U);var ne=g(T,te),se=_(I,ne),le=C(y(V,se)),ce=F.r=v(le,I,$);(!isFinite(ce[0])||!isFinite(ce[1])||!isFinite(ce[2]))&&(ce=$),T.rotate(ce),$=ce}B(R.of(this,arguments))}),L(R.of(this,arguments))}).on("zoomend",function(){t.select(this).style(n),z.call(D,"zoom",null),O(R.of(this,arguments)),f(E,T,G)}).on("zoom.redraw",function(){E.render(!0);var W=T.rotate();E.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/E.fitScale,"geo.projection.rotation.lon":-W[0],"geo.projection.rotation.lat":-W[1]})});function L(W){P++||W({type:"zoomstart"})}function B(W){W({type:"zoom"})}function O(W){--P||W({type:"zoomend"})}function G(W){var X=T.rotate();W("projection.rotation.lon",-X[0]),W("projection.rotation.lat",-X[1])}return t.rebind(D,R,"on")}function g(E,T){var F=E.invert(T);return F&&isFinite(F[0])&&isFinite(F[1])&&w(F)}function m(E){var T=.5*E[0]*o,F=.5*E[1]*o,D=.5*E[2]*o,R=Math.sin(T),P=Math.cos(T),z=Math.sin(F),I=Math.cos(F),L=Math.sin(D),B=Math.cos(D);return[P*I*B+R*z*L,R*I*B-P*z*L,P*z*B+R*I*L,P*I*L-R*z*B]}function y(E,T){var F=E[0],D=E[1],R=E[2],P=E[3],z=T[0],I=T[1],L=T[2],B=T[3];return[F*z-D*I-R*L-P*B,F*I+D*z+R*B-P*L,F*L-D*B+R*z+P*I,F*B+D*L-R*I+P*z]}function _(E,T){if(!(!E||!T)){var F=A(E,T),D=Math.sqrt(k(F,F)),R=.5*Math.acos(Math.max(-1,Math.min(1,k(E,T)))),P=Math.sin(R)/D;return D&&[Math.cos(R),F[2]*P,-F[1]*P,F[0]*P]}}function v(E,T,F){var D=M(T,2,E[0]);D=M(D,1,E[1]),D=M(D,0,E[2]-F[2]);var R=T[0],P=T[1],z=T[2],I=D[0],L=D[1],B=D[2],O=Math.atan2(P,R)*s,G=Math.sqrt(R*R+P*P),W,X;Math.abs(L)>G?(X=(L>0?90:-90)-O,W=0):(X=Math.asin(L/G)*s-O,W=Math.sqrt(G*G-L*L));var Z=180-X-2*O,J=(Math.atan2(B,I)-Math.atan2(z,W))*s,N=(Math.atan2(B,I)-Math.atan2(z,-W))*s,H=x(F[0],F[1],X,J),$=x(F[0],F[1],Z,N);return H<=$?[X,J,F[2]]:[Z,N,F[2]]}function x(E,T,F,D){var R=S(F-E),P=S(D-T);return Math.sqrt(R*R+P*P)}function S(E){return(E%360+540)%360-180}function M(E,T,F){var D=F*o,R=E.slice(),P=T===0?1:0,z=T===2?1:2,I=Math.cos(D),L=Math.sin(D);return R[P]=E[P]*I-E[z]*L,R[z]=E[z]*I+E[P]*L,R}function C(E){return[Math.atan2(2*(E[0]*E[1]+E[2]*E[3]),1-2*(E[1]*E[1]+E[2]*E[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(E[0]*E[2]-E[3]*E[1]))))*s,Math.atan2(2*(E[0]*E[3]+E[1]*E[2]),1-2*(E[2]*E[2]+E[3]*E[3]))*s]}function w(E){var T=E[0]*o,F=E[1]*o,D=Math.cos(F);return[D*Math.cos(T),D*Math.sin(T),Math.sin(F)]}function k(E,T){for(var F=0,D=0,R=E.length;D0&&G._module.calcGeoJSON(O,z)}if(!I){var W=this.updateProjection(P,z);if(W)return;(!this.viewInitial||this.scope!==L.scope)&&this.saveViewInitial(L)}this.scope=L.scope,this.updateBaseLayers(z,L),this.updateDims(z,L),this.updateFx(z,L),d.generalUpdatePerTraceModule(this.graphDiv,this,P,L);var X=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=X.selectAll(".point"),this.dataPoints.text=X.selectAll("text"),this.dataPaths.line=X.selectAll(".js-line");var Z=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=Z.selectAll("path"),this._render()},T.updateProjection=function(P,z){var I=this.graphDiv,L=z[this.id],B=z._size,O=L.domain,G=L.projection,W=L.lonaxis,X=L.lataxis,Z=W._ax,J=X._ax,N=this.projection=F(L),H=[[B.l+B.w*O.x[0],B.t+B.h*(1-O.y[1])],[B.l+B.w*O.x[1],B.t+B.h*(1-O.y[0])]],$=L.center||{},U=G.rotation||{},V=W.range||[],j=X.range||[];if(L.fitbounds){Z._length=H[1][0]-H[0][0],J._length=H[1][1]-H[0][1],Z.range=m(I,Z),J.range=m(I,J);let ie=[];for(let vt of P){let xt=vt[0].trace;xt.visible===!0&&xt._module.fitCoords&&ie.push(xt._module.fitCoords(vt,L))}let Q=g(I,Z),ue=Q.min.reduce((vt,{val:xt})=>Math.min(vt,xt),1/0),Me=Q.max.reduce((vt,{val:xt})=>Math.max(vt,xt),-1/0)-ue,Te=w.boundsOfCoords(ie.flat()),[je,,Ve]=Te||[],Ke=Ve-je;if(!!Te&&(Me>360||Me<360&&KeMath.max(Ye,vt(me)),0),mt=Q.max.reduce((Ye,me)=>Math.max(Ye,xt(me)),0),Mt=Z._length-Pt-mt,lt=Mt>Z._length/10?Ke*Z._length/Mt:Ke,qe=(je+Ve)/2;Z.range=[qe-lt/2,qe+lt/2]}var q=(Z.range[0]+Z.range[1])/2,Y=(J.range[0]+J.range[1])/2;if(L._isScoped)$={lon:q,lat:Y};else if(L._isClipped){$={lon:q,lat:Y},U={lon:q,lat:Y,roll:U.roll};var K=G.type,te=C.lonaxisSpan[K]/2||180,ne=C.lataxisSpan[K]/2||90;V=[q-te,q+te],j=[Y-ne,Y+ne]}else $={lon:q,lat:Y},U={lon:q,lat:U.lat,roll:U.roll}}N.center([$.lon-U.lon,$.lat-U.lat]).rotate([-U.lon,-U.lat,U.roll]).parallels(G.parallels);var se=R(V,j);N.fitExtent(H,se);var le=this.bounds=N.getBounds(se),ce=this.fitScale=N.scale(),pe=N.translate();if(N.scaleExtent=()=>{var ie;let{minscale:Q}=G,ue=(ie=G.maxscale)!=null?ie:1/0;return[ce*Math.min(Q,ue),ce*Math.max(Q,ue)]},L.fitbounds){var xe=N.getBounds(R(Z.range,J.range)),ye=Math.min((le[1][0]-le[0][0])/(xe[1][0]-xe[0][0]),(le[1][1]-le[0][1])/(xe[1][1]-xe[0][1]));isFinite(ye)?N.scale(ye*ce):n.warn("Something went wrong during"+this.id+"fitbounds computations.")}else N.scale(G.scale*ce);var fe=this.midPt=[(le[0][0]+le[1][0])/2,(le[0][1]+le[1][1])/2];if(N.translate([pe[0]+(fe[0]-pe[0]),pe[1]+(fe[1]-pe[1])]).clipExtent(le),L._isAlbersUsa){var ae=N([$.lon,$.lat]);if(ae){var ee=N.translate();N.translate([ee[0]-(ae[0]-ee[0]),ee[1]-(ae[1]-ee[1])])}}},T.updateBaseLayers=function(P,z){var I=this,L=I.topojson,B=I.layers,O=I.basePaths;function G(H){return H==="lonaxis"||H==="lataxis"}function W(H){return!!C.lineLayers[H]}function X(H){return!!C.fillLayers[H]}var Z=this.hasChoropleth?C.layersForChoropleth:C.layers,J=Z.filter(function(H){return W(H)||X(H)?z["show"+H]:G(H)?z[H].showgrid:!0}),N=I.framework.selectAll(".layer").data(J,String);N.exit().each(function(H){delete B[H],delete O[H],t.select(this).remove()}),N.enter().append("g").attr("class",function(H){return"layer "+H}).each(function(H){var $=B[H]=t.select(this);H==="bg"?I.bgRect=$.append("rect").style("pointer-events","all"):G(H)?O[H]=$.append("path").style("fill","none"):H==="backplot"?$.append("g").classed("choroplethlayer",!0):H==="frontplot"?$.append("g").classed("scatterlayer",!0):W(H)?O[H]=$.append("path").style("fill","none").style("stroke-miterlimit",2):X(H)&&(O[H]=$.append("path").style("stroke","none"))}),N.order(),N.each(function(H){var $=O[H],U=C.layerNameToAdjective[H];H==="frame"?$.datum(C.sphereSVG):W(H)||X(H)?$.datum(b(L,L.objects[H])):G(H)&&$.datum(D(H,z,P)).call(c.stroke,z[H].gridcolor).call(f.dashLine,z[H].griddash,z[H].gridwidth),W(H)?$.call(c.stroke,z[U+"color"]).call(f.dashLine,"",z[U+"width"]):X(H)&&$.call(c.fill,z[U+"color"])})},T.updateDims=function(P,z){var I=this.bounds,L=(z.framewidth||0)/2,B=I[0][0]-L,O=I[0][1]-L,G=I[1][0]-B+L,W=I[1][1]-O+L;f.setRect(this.clipRect,B,O,G,W),this.bgRect.call(f.setRect,B,O,G,W).call(c.fill,z.bgcolor),this.xaxis._offset=B,this.xaxis._length=G,this.yaxis._offset=O,this.yaxis._length=W},T.updateFx=function(P,z){var I=this,L=I.graphDiv,B=I.bgRect,O=P.dragmode,G=P.clickmode;if(I.isStatic)return;function W(){var N=I.viewInitial,H={};for(var $ in N)H[I.id+"."+$]=N[$];l.call("_guiRelayout",L,H),L.emit("plotly_doubleclick",null)}function X(N){return I.projection.invert([N[0]+I.xaxis._offset,N[1]+I.yaxis._offset])}var Z=function(N,H){if(H.isRect){var $=N.range={};$[I.id]=[X([H.xmin,H.ymin]),X([H.xmax,H.ymax])]}else{var U=N.lassoPoints={};U[I.id]=H.map(X)}},J={element:I.bgRect.node(),gd:L,plotinfo:{id:I.id,xaxis:I.xaxis,yaxis:I.yaxis,fillRangeItems:Z},xaxes:[I.xaxis],yaxes:[I.yaxis],subplot:I.id,clickFn:function(N){N===2&&x(L)}};if(O==="pan"){B.node().onmousedown=null;let N=M(I,z);if(B.call(N),!t.event){let H=I.projection.scale(),[$,U]=I.projection.scaleExtent();(H<$||H>U)&&N.event(B)}B.on("dblclick.zoom",W),L._context._scrollZoom.geo||B.on("wheel.zoom",null)}else(O==="select"||O==="lasso")&&(B.on(".zoom",null),J.prepFn=function(N,H,$){v(N,H,$,J,O)},_.init(J));B.on("mousemove",function(){var N=I.projection.invert(n.getPositionFromD3Event());if(!N)return _.unhover(L,t.event);I.xaxis.p2c=function(){return N[0]},I.yaxis.p2c=function(){return N[1]},h.hover(L,t.event,I.id)}),B.on("mouseout",function(){L._dragging||_.unhover(L,t.event)}),B.on("click",function(){O!=="select"&&O!=="lasso"&&(G.indexOf("select")>-1&&S(t.event,L,[I.xaxis],[I.yaxis],I.id,J),G.indexOf("event")>-1&&h.click(L,t.event))})},T.makeFramework=function(){var P=this,z=P.graphDiv,I=z._fullLayout,L="clip"+I._uid+P.id;P.clipDef=I._clips.append("clipPath").attr("id",L),P.clipRect=P.clipDef.append("rect"),P.framework=t.select(P.container).append("g").attr("class","geo "+P.id).call(f.setClipUrl,L,z),P.project=function(B){var O=P.projection(B);return O?[O[0]-P.xaxis._offset,O[1]-P.yaxis._offset]:[null,null]},P.xaxis={_id:"x",c2p:function(B){return P.project(B)[0]}},P.yaxis={_id:"y",c2p:function(B){return P.project(B)[1]}},P.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(P.mockAxis,I)},T.saveViewInitial=function(P){var z=P.center||{},I=P.projection,L=I.rotation||{};this.viewInitial={fitbounds:P.fitbounds,"projection.scale":I.scale};var B;P._isScoped?B={"center.lon":z.lon,"center.lat":z.lat}:P._isClipped?B={"projection.rotation.lon":L.lon,"projection.rotation.lat":L.lat,"center.lon":z.lon,"center.lat":z.lat}:B={"center.lon":z.lon,"center.lat":z.lat,"projection.rotation.lon":L.lon},n.extendFlat(this.viewInitial,B)},T.render=function(P){this._hasMarkerAngles&&P?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},T._render=function(){var P=this.projection,z=P.getPath(),I;function L(O){var G=P(O.lonlat);return G?u(G[0],G[1]):null}function B(O){return P.isLonLatOverEdges(O.lonlat)?"none":null}for(I in this.basePaths)this.basePaths[I].attr("d",z);for(I in this.dataPaths)this.dataPaths[I].attr("d",function(O){return z(O.geojson)});for(I in this.dataPoints)this.dataPoints[I].attr("display",B).attr("transform",L)};function F(P){var z=P.projection,I=z.type,L=C.projNames[I];L="geo"+n.titleCase(L);for(var B=i[L]||s[L],O=B(),G=P._isSatellite?Math.acos(1/z.distance)*180/Math.PI:P._isClipped?C.lonaxisSpan[I]/2:null,W=["center","rotate","parallels","clipExtent"],X=function(N){return N?O:[]},Z=0;ZU}else return!1},O.getPath=function(){return a().projection(O)},O.getBounds=function(N){return O.getPath().bounds(N)},O.precision(C.precision),P._isSatellite&&O.tilt(z.tilt).distance(z.distance),G&&O.clipAngle(G-C.clipPad),O}function D(P,z,I){var L=1e-6,B=2.5,O=z[P],G=C.scopeDefaults[z.scope],W,X,Z;P==="lonaxis"?(W=G.lonaxisRange,X=G.lataxisRange,Z=function(Y,K){return[Y,K]}):P==="lataxis"&&(W=G.lataxisRange,X=G.lonaxisRange,Z=function(Y,K){return[K,Y]});var J={type:"linear",range:[W[0],W[1]-L],tick0:O.tick0,dtick:O.dtick};p.setConvert(J,I);var N=p.calcTicks(J);!z.isScoped&&P==="lonaxis"&&N.pop();for(var H=N.length,$=new Array(H),U=0;Ute[ne]!=null)||s.fitboundsIncompatible.has(v)?f.fitbounds=!1:Y.forEach(({dst:te,key:ne})=>te&&(te[ne]=null))}}}}),f7=de({"src/plots/geo/index.js"(e,r){"use strict";var t=$u().getSubplotCalcData,i=Qt().counterRegex,a=QY(),o="geo",s=i(o),l={};l[o]={valType:"subplotid",dflt:o,editType:"calc"};function n(f){for(var h=f._fullLayout,d=f.calcdata,p=h._subplots[o],g=0;g")}}}}),p7=de({"src/traces/choropleth/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){i.location=a.location,i.z=a.z;var n=s[l];return n.fIn&&n.fIn.properties&&(i.properties=n.fIn.properties),i.ct=n.ct,i}}}),v7=de({"src/traces/choropleth/select.js"(e,r){"use strict";r.exports=function(i,a){var o=i.cd,s=i.xaxis,l=i.yaxis,n=[],u,c,f,h,d;if(a===!1)for(u=0;u=Math.min(G,W)&&v<=Math.max(G,W)?0:1/0}if(R=Math.min(X,Z)&&x<=Math.max(X,Z)?0:1/0}I=Math.sqrt(R*R+P*P),E=M[D]}}}else for(D=M.length-1;D>-1;D--)b=M[D],T=y[b],F=_[b],R=g.c2p(T)-v,P=m.c2p(F)-x,z=Math.sqrt(R*R+P*P),z100},e.isDotSymbol=function(t){return typeof t=="string"?r.DOT_RE.test(t):t>200}}}),oX=de({"src/traces/scattergl/defaults.js"(e,r){"use strict";var t=Qt(),i=Sa(),a=E4(),o=__(),s=Kd(),l=bs(),n=Tv(),u=yd(),c=jh(),f=_d(),h=Qd(),d=xd();r.exports=function(g,m,y,_){function v(b,E){return t.coerce(g,m,o,b,E)}var x=g.marker?a.isOpenSymbol(g.marker.symbol):!1,S=l.isBubble(g),M=n(g,m,_,v);if(!M){m.visible=!1;return}u(g,m,_,v),v("xhoverformat"),v("yhoverformat");var C=M>>1,g=n[p],m=c!==void 0?c(g,u):g-u;m>=0?(d=p,h=p-1):f=p+1}return d}function i(n,u,c,f,h){for(var d=h+1;f<=h;){var p=f+h>>>1,g=n[p],m=c!==void 0?c(g,u):g-u;m>0?(d=p,h=p-1):f=p+1}return d}function a(n,u,c,f,h){for(var d=f-1;f<=h;){var p=f+h>>>1,g=n[p],m=c!==void 0?c(g,u):g-u;m<0?(d=p,f=p+1):h=p-1}return d}function o(n,u,c,f,h){for(var d=f-1;f<=h;){var p=f+h>>>1,g=n[p],m=c!==void 0?c(g,u):g-u;m<=0?(d=p,f=p+1):h=p-1}return d}function s(n,u,c,f,h){for(;f<=h;){var d=f+h>>>1,p=n[d],g=c!==void 0?c(p,u):p-u;if(g===0)return d;g<=0?f=d+1:h=d-1}return-1}function l(n,u,c,f,h,d){return typeof c=="function"?d(n,u,c,f===void 0?0:f|0,h===void 0?n.length-1:h|0):d(n,u,void 0,c===void 0?0:c|0,f===void 0?n.length-1:f|0)}r.exports={ge:function(n,u,c,f,h){return l(n,u,c,f,h,t)},gt:function(n,u,c,f,h){return l(n,u,c,f,h,i)},lt:function(n,u,c,f,h){return l(n,u,c,f,h,a)},le:function(n,u,c,f,h){return l(n,u,c,f,h,o)},eq:function(n,u,c,f,h){return l(n,u,c,f,h,s)}}}}),m7=de({"node_modules/clamp/index.js"(e,r){r.exports=t;function t(i,a,o){return ao?o:i:ia?a:i}}}),ip=de({"node_modules/pick-by-alias/index.js"(e,r){"use strict";r.exports=function(o,s,l){var n={},u,c;if(typeof s=="string"&&(s=i(s)),Array.isArray(s)){var f={};for(c=0;c1&&(a=arguments),typeof a=="string"?a=a.split(/\s/).map(parseFloat):typeof a=="number"&&(a=[a]),a.length&&typeof a[0]=="number"?a.length===1?o={width:a[0],height:a[0],x:0,y:0}:a.length===2?o={width:a[0],height:a[1],x:0,y:0}:o={x:a[0],y:a[1],width:a[2]-a[0]||0,height:a[3]-a[1]||0}:a&&(a=t(a,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),o={x:a.left||0,y:a.top||0},a.width==null?a.right?o.width=a.right-o.x:o.width=0:o.width=a.width,a.height==null?a.bottom?o.height=a.bottom-o.y:o.height=0:o.height=a.height),o}}}),Vv=de({"node_modules/array-bounds/index.js"(e,r){"use strict";r.exports=t;function t(i,a){if(!i||i.length==null)throw Error("Argument should be an array");a==null?a=1:a=Math.floor(a);for(var o=Array(a*2),s=0;sl&&(l=i[u]),i[u]>>1,S;m.dtype||(m.dtype="array"),typeof m.dtype=="string"?S=new(c(m.dtype))(x):m.dtype&&(S=m.dtype,Array.isArray(S)&&(S.length=x));for(let D=0;Dy||L>h){for(let V=0;VK||G>te||W<$||X=Z||q===Y)return;let ne=M[j];Y===void 0&&(Y=ne.length);for(let ee=q;ee=z&&Q<=L&&ue>=I&&ue<=B&&J.push(ie)}let se=C[j],le=se[q*4+0],ce=se[q*4+1],pe=se[q*4+2],xe=se[q*4+3],ye=H(se,q+1),fe=V*.5,ae=j+1;N($,U,fe,ae,le,ce||pe||xe||ye),N($,U+fe,fe,ae,ce,pe||xe||ye),N($+fe,U,fe,ae,pe,xe||ye),N($+fe,U+fe,fe,ae,xe,ye)}function H($,U){let V=null,j=0;for(;V===null;)if(V=$[U*4+j],j++,j>$.length)return null;return V}return J}function T(D,R,P,z,I){let L=[];for(let B=0;B2&&(n.push([c].concat(f.splice(0,2))),h="l",c=c=="m"?"l":"L");;){if(f.length==t[h])return f.unshift(c),n.push(f);if(f.length1&&(g=1),g<-1&&(g=-1),p*Math.acos(g)},l=function(c,f,h,d,p,g,m,y,_,v,x,S){var M=Math.pow(p,2),C=Math.pow(g,2),w=Math.pow(x,2),k=Math.pow(S,2),A=M*C-M*k-C*w;A<0&&(A=0),A/=M*k+C*w,A=Math.sqrt(A)*(m===y?-1:1);var b=A*p/g*S,E=A*-g/p*x,T=v*b-_*E+(c+h)/2,F=_*b+v*E+(f+d)/2,D=(x-b)/p,R=(S-E)/g,P=(-x-b)/p,z=(-S-E)/g,I=s(1,0,D,R),L=s(D,R,P,z);return y===0&&L>0&&(L-=i),y===1&&L<0&&(L+=i),[T,F,I,L]},n=function(c){var f=c.px,h=c.py,d=c.cx,p=c.cy,g=c.rx,m=c.ry,y=c.xAxisRotation,_=y===void 0?0:y,v=c.largeArcFlag,x=v===void 0?0:v,S=c.sweepFlag,M=S===void 0?0:S,C=[];if(g===0||m===0)return[];var w=Math.sin(_*i/360),k=Math.cos(_*i/360),A=k*(f-d)/2+w*(h-p)/2,b=-w*(f-d)/2+k*(h-p)/2;if(A===0&&b===0)return[];g=Math.abs(g),m=Math.abs(m);var E=Math.pow(A,2)/Math.pow(g,2)+Math.pow(b,2)/Math.pow(m,2);E>1&&(g*=Math.sqrt(E),m*=Math.sqrt(E));var T=l(f,h,d,p,g,m,x,M,w,k,A,b),F=t(T,4),D=F[0],R=F[1],P=F[2],z=F[3],I=Math.abs(z)/(i/4);Math.abs(1-I)<1e-7&&(I=1);var L=Math.max(Math.ceil(I),1);z/=L;for(var B=0;B4?(u=v[v.length-4],c=v[v.length-3]):(u=g,c=m),n.push(v)}return n}function a(s,l,n,u){return["C",s,l,n,u,n,u]}function o(s,l,n,u,c,f){return["C",s/3+2/3*n,l/3+2/3*u,c/3+2/3*n,f/3+2/3*u,c,f]}}}),g7=de({"node_modules/is-svg-path/index.js"(e,r){"use strict";r.exports=function(i){return typeof i!="string"?!1:(i=i.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(i)&&/[\dz]$/i.test(i)&&i.length>4))}}}),gX=de({"node_modules/svg-path-bounds/index.js"(e,r){"use strict";var t=dX(),i=pX(),a=mX(),o=g7();r.exports=s;function s(l){if(Array.isArray(l)&&l.length===1&&typeof l[0]=="string"&&(l=l[0]),typeof l=="string"){if(!o(l))throw Error("String is not an SVG path.");l=t(l)}if(!Array.isArray(l))throw Error("Argument should be a string or an array of path segments.");if(l=i(l),l=a(l),!l.length)return[0,0,0,0];for(var n=[1/0,1/0,-1/0,-1/0],u=0,c=l.length;un[2]&&(n[2]=f[h+0]),f[h+1]>n[3]&&(n[3]=f[h+1]);return n}}}),yX=de({"node_modules/bitmap-sdf/index.js"(e,r){"use strict";r.exports=i;var t=1e20;function i(s,l){l||(l={});var n=l.cutoff==null?.25:l.cutoff,u=l.radius==null?8:l.radius,c=l.channel||0,f,h,d,p,g,m,y,_,v,x,S;if(ArrayBuffer.isView(s)||Array.isArray(s)){if(!l.width||!l.height)throw Error("For raw data width and height should be provided by options");f=l.width,h=l.height,p=s,l.stride?m=l.stride:m=Math.floor(s.length/f/h)}else window.HTMLCanvasElement&&s instanceof window.HTMLCanvasElement?(_=s,y=_.getContext("2d"),f=_.width,h=_.height,v=y.getImageData(0,0,f,h),p=v.data,m=4):window.CanvasRenderingContext2D&&s instanceof window.CanvasRenderingContext2D?(_=s.canvas,y=s,f=_.width,h=_.height,v=y.getImageData(0,0,f,h),p=v.data,m=4):window.ImageData&&s instanceof window.ImageData&&(v=s,f=s.width,h=s.height,p=v.data,m=4);if(d=Math.max(f,h),window.Uint8ClampedArray&&p instanceof window.Uint8ClampedArray||window.Uint8Array&&p instanceof window.Uint8Array)for(g=p,p=Array(f*h),x=0,S=Math.floor(g.length/m);x_X});function _X(e,r={}){if(!(0,x7.default)(e))throw Error("Invalid SVG path");let t,i;r.shape||Array.isArray(r)?[t,i]=r.shape||r:(t=x_.width=r.width||r.w||200,i=x_.height=r.height||r.h||200);let a=Math.min(t,i),o=r.stroke||0,s=r.viewbox||r.viewBox||(0,_7.default)(e),l=[t/(s[2]-s[0]),i/(s[3]-s[1])],n=Math.min(l[0]||0,l[1]||0)/2;lh.fillStyle="black",lh.fillRect(0,0,t,i),lh.fillStyle="white",o&&(typeof o!="number"&&(o=1),lh.strokeStyle=o>0?"white":"black",lh.lineWidth=Math.abs(o)),lh.translate(t*.5,i*.5),lh.scale(n,n);let u=new Path2D(e);return lh.fill(u),o&&lh.stroke(u),lh.setTransform(1,0,0,1,0,0),(0,b7.default)(lh,{cutoff:r.cutoff!=null?r.cutoff:.5,radius:r.radius!=null?r.radius:a*.5})}var _7,x7,b7,x_,lh,xX=Ir({"node_modules/svg-path-sdf/svg-path-sdf.js"(){_7=Vr(gX()),x7=Vr(g7()),b7=Vr(yX()),x_=document.createElement("canvas"),lh=x_.getContext("2d",{willReadFrequently:!0})}}),Hv=de({"src/traces/scattergl/convert.js"(e,r){"use strict";var t=da(),i=(xX(),ti(y7)).default,{normalize:a}=ta(),o=Sa(),s=Qt(),l=s.isArrayOrTypedArray,n=hn(),u=Hs(),c=Fp().formatColor,f=bs(),h=Sy(),d=E4(),p=k0(),g=Mp().DESELECTDIM,m={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=sf().appendArrayPointValue;function _(z,I){var L,B={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},O=z._context.plotGlPixelRatio;if(I.visible!==!0)return B;if(f.hasText(I)&&(B.text=v(z,I),B.textSel=C(z,I,I.selected),B.textUnsel=C(z,I,I.unselected)),f.hasMarkers(I)&&(B.marker=S(z,I),B.markerSel=M(z,I,I.selected),B.markerUnsel=M(z,I,I.unselected),!I.unselected&&l(I.marker.opacity))){var G=I.marker.opacity;for(B.markerUnsel.opacity=new Array(G.length),L=0;L500?"bold":"normal":z}function S(z,I){var L=I._length,B=I.marker,O={},G,W=l(B.symbol),X=l(B.angle),Z=l(B.color),J=l(B.line.color),N=l(B.opacity),H=l(B.size),$=l(B.line.width),U;if(W||(U=d.isOpenSymbol(B.symbol)),W||Z||J||N||X){O.symbols=new Array(L),O.angles=new Array(L),O.colors=new Array(L),O.borderColors=new Array(L);var V=B.symbol,j=B.angle,q=c(B,B.opacity,L),Y=c(B.line,B.opacity,L);if(!l(Y[0])){var K=Y;for(Y=Array(L),G=0;Gp.TOO_MANY_POINTS||f.hasMarkers(I)?"rect":"round";if(J&&I.connectgaps){var H=G[0],$=G[1];for(W=0;W1?Z[W]:Z[0]:Z,U=l(J)?J.length>1?J[W]:J[0]:J,V=m[$],j=m[U],q=N?N/.8+1:0,Y=-j*q-j*.5;G.offset[W]=[V*q/H,Y/H]}}return G}r.exports={style:_,markerStyle:S,markerSelection:M,linePositions:D,errorBarPositions:R,textPosition:P}}}),w7=de({"src/traces/scattergl/scene_update.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){var s=o._scene,l={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},n={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return o._scene||(s=o._scene={},s.init=function(){t.extendFlat(s,n,l)},s.init(),s.update=function(c){var f=t.repeat(c,s.count);if(s.fill2d&&s.fill2d.update(f),s.scatter2d&&s.scatter2d.update(f),s.line2d&&s.line2d.update(f),s.error2d&&s.error2d.update(f.concat(f)),s.select2d&&s.select2d.update(f),s.glText)for(var h=0;h=g,b=k*2,E={},T,F=M.makeCalcdata(x,"x"),D=C.makeCalcdata(x,"y"),R=s(x,M,"x",F),P=s(x,C,"y",D),z=R.vals,I=P.vals;x._x=z,x._y=I,x.xperiodalignment&&(x._origX=F,x._xStarts=R.starts,x._xEnds=R.ends),x.yperiodalignment&&(x._origY=D,x._yStarts=P.starts,x._yEnds=P.ends);var L=new Array(b),B=new Array(k);for(T=0;T1&&i.extendFlat(w.line,h.linePositions(_,x,S)),w.errorX||w.errorY){var k=h.errorBarPositions(_,x,S,M,C);w.errorX&&i.extendFlat(w.errorX,k.x),w.errorY&&i.extendFlat(w.errorY,k.y)}return w.text&&(i.extendFlat(w.text,{positions:S},h.textPosition(_,x,w.text,w.marker)),i.extendFlat(w.textSel,{positions:S},h.textPosition(_,x,w.text,w.markerSel)),i.extendFlat(w.textUnsel,{positions:S},h.textPosition(_,x,w.text,w.markerUnsel))),w}}}),T7=de({"src/traces/scattergl/edit_style.js"(e,r){"use strict";var t=Qt(),i=ta(),a=Mp().DESELECTDIM;function o(s){var l=s[0],n=l.trace,u=l.t,c=u._scene,f=u.index,h=c.selectBatch[f],d=c.unselectBatch[f],p=c.textOptions[f],g=c.textSelectedOptions[f]||{},m=c.textUnselectedOptions[f]||{},y=t.extendFlat({},p),_,v;if(h.length||d.length){var x=g.color,S=m.color,M=p.color,C=t.isArrayOrTypedArray(M);for(y.color=new Array(n._length),_=0;_10&&/[0-9](?:\s|\/)/.test(o)&&(l=o.match(/([0-9]+)/g).map(function(g){return parseFloat(g)}),u=o.match(/([a-z])/ig).join("").toLowerCase());else isNaN(o)?Array.isArray(o)||o.length?(l=[o[0],o[1],o[2]],u="rgb",n=o.length===4?o[3]:1):o instanceof Object&&(o.r!=null||o.red!=null||o.R!=null?(u="rgb",l=[o.r||o.red||o.R||0,o.g||o.green||o.G||0,o.b||o.blue||o.B||0]):(u="hsl",l=[o.h||o.hue||o.H||0,o.s||o.saturation||o.S||0,o.l||o.lightness||o.L||o.b||o.brightness]),n=o.a||o.alpha||o.opacity||1,o.opacity!=null&&(n/=100)):(u="rgb",l=[o>>>16,(o&65280)>>>8,o&255]);return{space:u,values:l,alpha:n}}}}),MX=de({"node_modules/color-rgba/index.js"(e,r){"use strict";var t=AX();r.exports=function(o){Array.isArray(o)&&o.raw&&(o=String.raw.apply(null,arguments));var s,l,n,u=t(o);if(!u.space)return[];var c=[0,0,0],f=u.space[0]==="h"?[360,100,100]:[255,255,255];return s=Array(3),s[0]=Math.min(Math.max(u.values[0],c[0]),f[0]),s[1]=Math.min(Math.max(u.values[1],c[1]),f[1]),s[2]=Math.min(Math.max(u.values[2],c[2]),f[2]),u.space[0]==="h"&&(s=i(s)),s.push(Math.min(Math.max(u.alpha,0),1)),s};function i(a){var o=a[0]/360,s=a[1]/100,l=a[2]/100,n,u,c,f,h,d=0;if(s===0)return h=l*255,[h,h,h];for(u=l<.5?l*(1+s):l+s-l*s,n=2*l-u,f=[0,0,0];d<3;)c=o+1/3*-(d-1),c<0?c++:c>1&&c--,h=6*c<1?n+(u-n)*6*c:2*c<1?u:3*c<2?n+(u-n)*(2/3-c)*6:n,f[d++]=h*255;return f}}}),b_=de({"node_modules/color-normalize/index.js"(e,r){"use strict";var t=MX(),i=k4();r.exports=function(s,l){(l==="float"||!l)&&(l="array"),l==="uint"&&(l="uint8"),l==="uint_clamped"&&(l="uint8_clamped");var n=i(l),u=new n(4),c=l!=="uint8"&&l!=="uint8_clamped";return(!s.length||typeof s=="string")&&(s=t(s),s[0]/=255,s[1]/=255,s[2]/=255),a(s)?(u[0]=s[0],u[1]=s[1],u[2]=s[2],u[3]=s[3]!=null?s[3]:255,c&&(u[0]/=255,u[1]/=255,u[2]/=255,u[3]/=255),u):(c?(u[0]=s[0],u[1]=s[1],u[2]=s[2],u[3]=s[3]!=null?s[3]:1):(u[0]=Math.min(Math.max(Math.floor(s[0]*255),0),255),u[1]=Math.min(Math.max(Math.floor(s[1]*255),0),255),u[2]=Math.min(Math.max(Math.floor(s[2]*255),0),255),u[3]=s[3]==null?255:Math.min(Math.max(Math.floor(s[3]*255),0),255)),u)};function a(o){return!!(o instanceof Uint8Array||o instanceof Uint8ClampedArray||Array.isArray(o)&&(o[0]>1||o[0]===0)&&(o[1]>1||o[1]===0)&&(o[2]>1||o[2]===0)&&(!o[3]||o[3]>1))}}}),SX=de({"node_modules/color-id/index.js"(e,r){"use strict";var t=m7();r.exports=i,r.exports.to=i,r.exports.from=a;function i(o,s){s==null&&(s=!0);var l=o[0],n=o[1],u=o[2],c=o[3];c==null&&(c=s?1:255),s&&(l*=255,n*=255,u*=255,c*=255),l=t(l,0,255)&255,n=t(n,0,255)&255,u=t(u,0,255)&255,c=t(c,0,255)&255;var f=l*16777216+(n<<16)+(u<<8)+c;return f}function a(o,s){o=+o;var l=o>>>24,n=(o&16711680)>>>16,u=(o&65280)>>>8,c=o&255;return s===!1?[l,n,u,c]:[l/255,n/255,u/255,c/255]}}}),EX=de({"node_modules/glslify/browser.js"(e,r){r.exports=function(t){typeof t=="string"&&(t=[t]);for(var i=[].slice.call(arguments,1),a=[],o=0;o[this.tooManyColors?0:w,_.height],pixelRatio:g.context("pixelRatio"),scale:g.prop("scale"),scaleFract:g.prop("scaleFract"),translate:g.prop("translate"),translateFract:g.prop("translateFract"),markerTexture:g.prop("markerTexture"),paletteTexture:_},attributes:{x:(T,F)=>F.xAttr||{buffer:F.positionBuffer,stride:8,offset:0},y:(T,F)=>F.yAttr||{buffer:F.positionBuffer,stride:8,offset:4},xFract:(T,F)=>F.xAttr?{constant:[0,0]}:{buffer:F.positionFractBuffer,stride:8,offset:0},yFract:(T,F)=>F.yAttr?{constant:[0,0]}:{buffer:F.positionFractBuffer,stride:8,offset:4},size:(T,F)=>F.size.length?{buffer:F.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(F.size*255/this.maxSize)]},borderSize:(T,F)=>F.borderSize.length?{buffer:F.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(F.borderSize*255/this.maxSize)]},colorId:(T,F)=>F.color.length?{buffer:F.colorBuffer,stride:this.tooManyColors?8:4,offset:0}:{constant:this.tooManyColors?v.slice(F.color*4,F.color*4+4):[F.color]},borderColorId:(T,F)=>F.borderColor.length?{buffer:F.colorBuffer,stride:this.tooManyColors?8:4,offset:this.tooManyColors?4:2}:{constant:this.tooManyColors?v.slice(F.borderColor*4,F.borderColor*4+4):[F.borderColor]},isActive:(T,F)=>F.activation===!0?{constant:[1]}:F.activation?F.activation:{constant:[0]}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:g.prop("viewport")},viewport:g.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:g.prop("elements"),count:g.prop("count"),offset:g.prop("offset"),primitive:"points"},b=Object.assign({},A);b.frag=s([`precision highp float; #define GLSLIFY 1 uniform float opacity; @@ -2194,8 +2194,8 @@ void main() { fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; fragWidth = 1. / gl_PointSize; } -`]),this.drawCircle=g(E)}d.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},d.prototype.render=function(){return arguments.length&&this.update(...arguments),this.draw(),this},d.prototype.draw=function(){for(var g=arguments.length,m=new Array(g),y=0;y{this.drawItem(x)});return this},d.prototype.drawItem=function(g,m){let{groups:y}=this,_=y[g];if(typeof m=="number"&&(g=m,_=y[m],m=null),!(_&&_.count&&_.opacity))return;_.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,_,m));let v=[];for(let x=1;x<_.activation.length;x++)!_.activation[x]||_.activation[x]!==!0&&!_.activation[x].data.length||v.push(...this.getMarkerDrawOptions(x,_,m));v.length&&this.drawMarker(v)},d.prototype.getMarkerDrawOptions=function(g,m,y){let{range:_,tree:v,viewport:x,activation:S,selectionBuffer:M,count:C}=m;if(!v)return y?[Object.assign({},m,{markerTexture:this.markerTextures[g],activation:S[g],count:y.length,elements:y,offset:0})]:[Object.assign({},m,{markerTexture:this.markerTextures[g],activation:S[g],offset:0})];let w=[],k=v.range(_,{lod:!0,px:[(_[2]-_[0])/x.width,(_[3]-_[1])/x.height]});if(y){let b=S[g].data,E=new Uint8Array(C);for(let T=0;T{let A=_[k];if(w===void 0)return A;w===null?w={positions:null}:typeof w=="function"?w={ondraw:w}:typeof w[0]=="number"&&(w={positions:w}),w=l(w,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"}),w.positions===null&&(w.positions=[]),w.tooManyColors!=null&&(this.tooManyColors=w.tooManyColors),A||(_[k]=A={id:k,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:x.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:x.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:x.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:x.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:x.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},w=Object.assign({},d.defaults,w)),w.positions&&!("marker"in w)&&(w.marker=A.marker,delete A.marker),w.marker&&!("positions"in w)&&(w.positions=A.positions,delete A.positions);let b=0,E=0;if(n(A,w,[{snap:!0,size:(T,F)=>(T==null&&(T=d.defaults.size),b+=T&&T.length?1:0,T),borderSize:(T,F)=>(T==null&&(T=d.defaults.borderSize),b+=T&&T.length?1:0,T),opacity:parseFloat,color:(T,F)=>(T==null&&(T=d.defaults.color),T=this.updateColor(T),E++,T),borderColor:(T,F)=>(T==null&&(T=d.defaults.borderColor),T=this.updateColor(T),E++,T),bounds:(T,F,D)=>("range"in D||(D.range=null),T),positions:(T,F,D)=>{let{snap:R}=F,{positionBuffer:P,positionFractBuffer:z,selectionBuffer:I}=F;if(T.x||T.y)return T.x.length?F.xAttr={buffer:x.buffer(T.x),offset:0,stride:4,count:T.x.length}:F.xAttr={buffer:T.x.buffer,offset:T.x.offset*4||0,stride:(T.x.stride||1)*4,count:T.x.count},T.y.length?F.yAttr={buffer:x.buffer(T.y),offset:0,stride:4,count:T.y.length}:F.yAttr={buffer:T.y.buffer,offset:T.y.offset*4||0,stride:(T.y.stride||1)*4,count:T.y.count},F.count=Math.max(F.xAttr.count,F.yAttr.count),T;T=u(T,"float64");let L=F.count=Math.floor(T.length/2),B=F.bounds=L?i(T,2):null;if(!D.range&&!F.range&&(delete F.range,D.range=B),!D.marker&&!F.marker&&(delete F.marker,D.marker=null),R&&(R===!0||L>R)?F.tree=o(T,{bounds:B}):R&&R.length&&(F.tree=R),F.tree){let W={primitive:"points",usage:"static",data:F.tree,type:"uint32"};F.elements?F.elements(W):F.elements=x.elements(W)}var O=c.float32(T);P({data:O,usage:"dynamic"});var G=c.fract32(T,O);return z({data:G,usage:"dynamic"}),I({data:new Uint8Array(L),type:"uint8",usage:"stream"}),T}},{marker:(T,F,D)=>{let{activation:R}=F;if(R.forEach(P=>P&&P.destroy&&P.destroy()),R.length=0,!T||typeof T[0]=="number"){let P=this.addMarker(T);R[P]=!0}else{let P=[];for(let z=0,I=Math.min(T.length,F.count);z{let R=F.bounds;if(R)return T||(T=R),F.scale=[1/(T[2]-T[0]),1/(T[3]-T[1])],F.translate=[-T[0],-T[1]],F.scaleFract=c.fract(F.scale),F.translateFract=c.fract(F.translate),T},viewport:T=>f(T||[v.drawingBufferWidth,v.drawingBufferHeight])}]),b){let{count:T,size:F,borderSize:D,sizeBuffer:R}=A,P=new Uint8Array(T*2);if(F.length||D.length)for(let z=0;z=0)return v;let x;if(g instanceof Uint8Array||g instanceof Uint8ClampedArray)x=g;else{x=new Uint8Array(g.length);for(let M=0,C=g.length;M_*4&&(this.tooManyColors=!0),this.updatePalette(y),v.length===1?v[0]:v},d.prototype.updatePalette=function(g){if(this.tooManyColors)return;let{maxColors:m,paletteTexture:y}=this,_=Math.ceil(g.length*.25/m);if(_>1){g=g.slice();for(let v=g.length*.25%m;v<_*m;v++)g.push(0,0,0,0)}y.height<_&&y.resize(m,_),y.subimage({width:Math.min(g.length*.25,m),height:_,data:g},0,0)},d.prototype.destroy=function(){return this.groups.forEach(g=>{g.sizeBuffer.destroy(),g.positionBuffer.destroy(),g.positionFractBuffer.destroy(),g.colorBuffer.destroy(),g.activation.forEach(m=>m&&m.destroy&&m.destroy()),g.selectionBuffer.destroy(),g.elements&&g.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(g=>g&&g.destroy&&g.destroy()),this};var p=function(g,m){var y=new h(g,m),_=y.render.bind(y);return Object.assign(_,{render:_,update:y.update.bind(y),draw:y.draw.bind(y),destroy:y.destroy.bind(y),regl:y.regl,gl:y.gl,canvas:y.gl.canvas,groups:y.groups,markers:y.markerCache,palette:y.palette}),_};r.exports=p}}),du=de({"node_modules/object-assign/index.js"(e,r){"use strict";var t=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(l){if(l==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(l)}function s(){try{if(!Object.assign)return!1;var l=new String("abc");if(l[5]="de",Object.getOwnPropertyNames(l)[0]==="5")return!1;for(var n={},u=0;u<10;u++)n["_"+String.fromCharCode(u)]=u;var c=Object.getOwnPropertyNames(n).map(function(h){return n[h]});if(c.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(h){f[h]=h}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}r.exports=s()?Object.assign:function(l,n){for(var u,c=o(l),f,h=1;h80*L){X=J=z[0],Z=N=z[1];for(var V=L;VJ&&(J=H),$>N&&(N=$);U=Math.max(J-X,N-Z),U=U!==0?32767/U:0}return o(G,W,L,X,Z,U,0),W}function i(z,I,L,B,O){var G,W;if(O===P(z,I,L,B)>0)for(G=I;G=I;G-=B)W=F(G,z[G],z[G+1],W);return W&&M(W,W.next)&&(D(W),W=W.next),W}function a(z,I){if(!z)return z;I||(I=z);var L=z,B;do if(B=!1,!L.steiner&&(M(L,L.next)||S(L.prev,L,L.next)===0)){if(D(L),L=I=L.prev,L===L.next)break;B=!0}else L=L.next;while(B||L!==I);return I}function o(z,I,L,B,O,G,W){if(z){!W&&G&&g(z,B,O,G);for(var X=z,Z,J;z.prev!==z.next;){if(Z=z.prev,J=z.next,G?l(z,B,O,G):s(z)){I.push(Z.i/L|0),I.push(z.i/L|0),I.push(J.i/L|0),D(z),z=J.next,X=J.next;continue}if(z=J,z===X){W?W===1?(z=n(a(z),I,L),o(z,I,L,B,O,G,2)):W===2&&u(z,I,L,B,O,G):o(a(z),I,L,B,O,G,1);break}}}}function s(z){var I=z.prev,L=z,B=z.next;if(S(I,L,B)>=0)return!1;for(var O=I.x,G=L.x,W=B.x,X=I.y,Z=L.y,J=B.y,N=OG?O>W?O:W:G>W?G:W,U=X>Z?X>J?X:J:Z>J?Z:J,V=B.next;V!==I;){if(V.x>=N&&V.x<=$&&V.y>=H&&V.y<=U&&v(O,X,G,Z,W,J,V.x,V.y)&&S(V.prev,V,V.next)>=0)return!1;V=V.next}return!0}function l(z,I,L,B){var O=z.prev,G=z,W=z.next;if(S(O,G,W)>=0)return!1;for(var X=O.x,Z=G.x,J=W.x,N=O.y,H=G.y,$=W.y,U=XZ?X>J?X:J:Z>J?Z:J,q=N>H?N>$?N:$:H>$?H:$,Y=y(U,V,I,L,B),K=y(j,q,I,L,B),te=z.prevZ,ne=z.nextZ;te&&te.z>=Y&&ne&&ne.z<=K;){if(te.x>=U&&te.x<=j&&te.y>=V&&te.y<=q&&te!==O&&te!==W&&v(X,N,Z,H,J,$,te.x,te.y)&&S(te.prev,te,te.next)>=0||(te=te.prevZ,ne.x>=U&&ne.x<=j&&ne.y>=V&&ne.y<=q&&ne!==O&&ne!==W&&v(X,N,Z,H,J,$,ne.x,ne.y)&&S(ne.prev,ne,ne.next)>=0))return!1;ne=ne.nextZ}for(;te&&te.z>=Y;){if(te.x>=U&&te.x<=j&&te.y>=V&&te.y<=q&&te!==O&&te!==W&&v(X,N,Z,H,J,$,te.x,te.y)&&S(te.prev,te,te.next)>=0)return!1;te=te.prevZ}for(;ne&&ne.z<=K;){if(ne.x>=U&&ne.x<=j&&ne.y>=V&&ne.y<=q&&ne!==O&&ne!==W&&v(X,N,Z,H,J,$,ne.x,ne.y)&&S(ne.prev,ne,ne.next)>=0)return!1;ne=ne.nextZ}return!0}function n(z,I,L){var B=z;do{var O=B.prev,G=B.next.next;!M(O,G)&&C(O,B,B.next,G)&&b(O,G)&&b(G,O)&&(I.push(O.i/L|0),I.push(B.i/L|0),I.push(G.i/L|0),D(B),D(B.next),B=z=G),B=B.next}while(B!==z);return a(B)}function u(z,I,L,B,O,G){var W=z;do{for(var X=W.next.next;X!==W.prev;){if(W.i!==X.i&&x(W,X)){var Z=T(W,X);W=a(W,W.next),Z=a(Z,Z.next),o(W,I,L,B,O,G,0),o(Z,I,L,B,O,G,0);return}X=X.next}W=W.next}while(W!==z)}function c(z,I,L,B){var O=[],G,W,X,Z,J;for(G=0,W=I.length;G=L.next.y&&L.next.y!==L.y){var X=L.x+(O-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(X<=B&&X>G&&(G=X,W=L.x=L.x&&L.x>=J&&B!==L.x&&v(OW.x||L.x===W.x&&p(W,L)))&&(W=L,H=$)),L=L.next;while(L!==Z);return W}function p(z,I){return S(z.prev,z,I.prev)<0&&S(I.next,z,z.next)<0}function g(z,I,L,B){var O=z;do O.z===0&&(O.z=y(O.x,O.y,I,L,B)),O.prevZ=O.prev,O.nextZ=O.next,O=O.next;while(O!==z);O.prevZ.nextZ=null,O.prevZ=null,m(O)}function m(z){var I,L,B,O,G,W,X,Z,J=1;do{for(L=z,z=null,G=null,W=0;L;){for(W++,B=L,X=0,I=0;I0||Z>0&&B;)X!==0&&(Z===0||!B||L.z<=B.z)?(O=L,L=L.nextZ,X--):(O=B,B=B.nextZ,Z--),G?G.nextZ=O:z=O,O.prevZ=G,G=O;L=B}G.nextZ=null,J*=2}while(W>1);return z}function y(z,I,L,B,O){return z=(z-L)*O|0,I=(I-B)*O|0,z=(z|z<<8)&16711935,z=(z|z<<4)&252645135,z=(z|z<<2)&858993459,z=(z|z<<1)&1431655765,I=(I|I<<8)&16711935,I=(I|I<<4)&252645135,I=(I|I<<2)&858993459,I=(I|I<<1)&1431655765,z|I<<1}function _(z){var I=z,L=z;do(I.x=(z-W)*(G-X)&&(z-W)*(B-X)>=(L-W)*(I-X)&&(L-W)*(G-X)>=(O-W)*(B-X)}function x(z,I){return z.next.i!==I.i&&z.prev.i!==I.i&&!A(z,I)&&(b(z,I)&&b(I,z)&&E(z,I)&&(S(z.prev,z,I.prev)||S(z,I.prev,I))||M(z,I)&&S(z.prev,z,z.next)>0&&S(I.prev,I,I.next)>0)}function S(z,I,L){return(I.y-z.y)*(L.x-I.x)-(I.x-z.x)*(L.y-I.y)}function M(z,I){return z.x===I.x&&z.y===I.y}function C(z,I,L,B){var O=k(S(z,I,L)),G=k(S(z,I,B)),W=k(S(L,B,z)),X=k(S(L,B,I));return!!(O!==G&&W!==X||O===0&&w(z,L,I)||G===0&&w(z,B,I)||W===0&&w(L,z,B)||X===0&&w(L,I,B))}function w(z,I,L){return I.x<=Math.max(z.x,L.x)&&I.x>=Math.min(z.x,L.x)&&I.y<=Math.max(z.y,L.y)&&I.y>=Math.min(z.y,L.y)}function k(z){return z>0?1:z<0?-1:0}function A(z,I){var L=z;do{if(L.i!==z.i&&L.next.i!==z.i&&L.i!==I.i&&L.next.i!==I.i&&C(L,L.next,z,I))return!0;L=L.next}while(L!==z);return!1}function b(z,I){return S(z.prev,z,z.next)<0?S(z,I,z.next)>=0&&S(z,z.prev,I)>=0:S(z,I,z.prev)<0||S(z,z.next,I)<0}function E(z,I){var L=z,B=!1,O=(z.x+I.x)/2,G=(z.y+I.y)/2;do L.y>G!=L.next.y>G&&L.next.y!==L.y&&O<(L.next.x-L.x)*(G-L.y)/(L.next.y-L.y)+L.x&&(B=!B),L=L.next;while(L!==z);return B}function T(z,I){var L=new R(z.i,z.x,z.y),B=new R(I.i,I.x,I.y),O=z.next,G=I.prev;return z.next=I,I.prev=z,L.next=O,O.prev=L,B.next=L,L.prev=B,G.next=B,B.prev=G,B}function F(z,I,L,B){var O=new R(z,I,L);return B?(O.next=B.next,O.prev=B,B.next.prev=O,B.next=O):(O.prev=O,O.next=O),O}function D(z){z.next.prev=z.prev,z.prev.next=z.next,z.prevZ&&(z.prevZ.nextZ=z.nextZ),z.nextZ&&(z.nextZ.prevZ=z.prevZ)}function R(z,I,L){this.i=z,this.x=I,this.y=L,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}t.deviation=function(z,I,L,B){var O=I&&I.length,G=O?I[0]*L:z.length,W=Math.abs(P(z,0,G,L));if(O)for(var X=0,Z=I.length;X0&&(B+=z[O-1].length,L.holes.push(B))}return L}}}),CX=de({"node_modules/array-normalize/index.js"(e,r){"use strict";var t=qv();r.exports=i;function i(a,o,s){if(!a||a.length==null)throw Error("Argument should be an array");o==null&&(o=1),s==null&&(s=t(a,o));for(var l=0;l-1}}}),P7=de({"node_modules/es5-ext/string/#/contains/index.js"(e,r){"use strict";r.exports=qX()()?String.prototype.contains:VX()}}),Ip=de({"node_modules/d/index.js"(e,r){"use strict";var t=Hv(),i=L7(),a=F4(),o=F7(),s=P7(),l=r.exports=function(n,u){var c,f,h,d,p;return arguments.length<2||typeof n!="string"?(d=u,u=n,n=null):d=arguments[2],t(n)?(c=s.call(n,"c"),f=s.call(n,"e"),h=s.call(n,"w")):(c=h=!0,f=!1),p={value:u,configurable:c,enumerable:f,writable:h},d?a(o(d),p):p};l.gs=function(n,u,c){var f,h,d,p;return typeof n!="string"?(d=c,c=u,u=n,n=null):d=arguments[3],t(u)?i(u)?t(c)?i(c)||(d=c,c=void 0):c=void 0:(d=u,u=c=void 0):u=void 0,t(n)?(f=s.call(n,"c"),h=s.call(n,"e")):(f=!0,h=!1),p={get:u,set:c,configurable:f,enumerable:h},d?a(o(d),p):p}}}),w_=de({"node_modules/es5-ext/function/is-arguments.js"(e,r){"use strict";var t=Object.prototype.toString,i=t.call((function(){return arguments})());r.exports=function(a){return t.call(a)===i}}}),T_=de({"node_modules/es5-ext/string/is-string.js"(e,r){"use strict";var t=Object.prototype.toString,i=t.call("");r.exports=function(a){return typeof a=="string"||a&&typeof a=="object"&&(a instanceof String||t.call(a)===i)||!1}}}),GX=de({"node_modules/ext/global-this/is-implemented.js"(e,r){"use strict";r.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),HX=de({"node_modules/ext/global-this/implementation.js"(e,r){var t=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};r.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}})()}}),A_=de({"node_modules/ext/global-this/index.js"(e,r){"use strict";r.exports=GX()()?globalThis:HX()}}),$X=de({"node_modules/es6-symbol/is-implemented.js"(e,r){"use strict";var t=A_(),i={object:!0,symbol:!0};r.exports=function(){var a=t.Symbol,o;if(typeof a!="function")return!1;o=a("test symbol");try{String(o)}catch{return!1}return!(!i[typeof a.iterator]||!i[typeof a.toPrimitive]||!i[typeof a.toStringTag])}}}),WX=de({"node_modules/es6-symbol/is-symbol.js"(e,r){"use strict";r.exports=function(t){return t?typeof t=="symbol"?!0:!t.constructor||t.constructor.name!=="Symbol"?!1:t[t.constructor.toStringTag]==="Symbol":!1}}}),I7=de({"node_modules/es6-symbol/validate-symbol.js"(e,r){"use strict";var t=WX();r.exports=function(i){if(!t(i))throw new TypeError(i+" is not a symbol");return i}}}),YX=de({"node_modules/es6-symbol/lib/private/generate-name.js"(e,r){"use strict";var t=Ip(),i=Object.create,a=Object.defineProperty,o=Object.prototype,s=i(null);r.exports=function(l){for(var n=0,u,c;s[l+(n||"")];)++n;return l+=n||"",s[l]=!0,u="@@"+l,a(o,u,t.gs(null,function(f){c||(c=!0,a(this,u,t(f)),c=!1)})),u}}}),XX=de({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(e,r){"use strict";var t=Ip(),i=A_().Symbol;r.exports=function(a){return Object.defineProperties(a,{hasInstance:t("",i&&i.hasInstance||a("hasInstance")),isConcatSpreadable:t("",i&&i.isConcatSpreadable||a("isConcatSpreadable")),iterator:t("",i&&i.iterator||a("iterator")),match:t("",i&&i.match||a("match")),replace:t("",i&&i.replace||a("replace")),search:t("",i&&i.search||a("search")),species:t("",i&&i.species||a("species")),split:t("",i&&i.split||a("split")),toPrimitive:t("",i&&i.toPrimitive||a("toPrimitive")),toStringTag:t("",i&&i.toStringTag||a("toStringTag")),unscopables:t("",i&&i.unscopables||a("unscopables"))})}}}),ZX=de({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(e,r){"use strict";var t=Ip(),i=I7(),a=Object.create(null);r.exports=function(o){return Object.defineProperties(o,{for:t(function(s){return a[s]?a[s]:a[s]=o(String(s))}),keyFor:t(function(s){var l;i(s);for(l in a)if(a[l]===s)return l})})}}}),KX=de({"node_modules/es6-symbol/polyfill.js"(e,r){"use strict";var t=Ip(),i=I7(),a=A_().Symbol,o=YX(),s=XX(),l=ZX(),n=Object.create,u=Object.defineProperties,c=Object.defineProperty,f,h,d;if(typeof a=="function")try{String(a()),d=!0}catch{}else a=null;h=function(g){if(this instanceof h)throw new TypeError("Symbol is not a constructor");return f(g)},r.exports=f=function p(g){var m;if(this instanceof p)throw new TypeError("Symbol is not a constructor");return d?a(g):(m=n(h.prototype),g=g===void 0?"":String(g),u(m,{__description__:t("",g),__name__:t("",o(g))}))},s(f),l(f),u(h.prototype,{constructor:t(f),toString:t("",function(){return this.__name__})}),u(f.prototype,{toString:t(function(){return"Symbol ("+i(this).__description__+")"}),valueOf:t(function(){return i(this)})}),c(f.prototype,f.toPrimitive,t("",function(){var p=i(this);return typeof p=="symbol"?p:p.toString()})),c(f.prototype,f.toStringTag,t("c","Symbol")),c(h.prototype,f.toStringTag,t("c",f.prototype[f.toStringTag])),c(h.prototype,f.toPrimitive,t("c",f.prototype[f.toPrimitive]))}}),C0=de({"node_modules/es6-symbol/index.js"(e,r){"use strict";r.exports=$X()()?A_().Symbol:KX()}}),JX=de({"node_modules/es5-ext/array/#/clear.js"(e,r){"use strict";var t=Pp();r.exports=function(){return t(this).length=0,this}}}),B1=de({"node_modules/es5-ext/object/valid-callable.js"(e,r){"use strict";r.exports=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}}),QX=de({"node_modules/type/string/coerce.js"(e,r){"use strict";var t=Hv(),i=D7(),a=Object.prototype.toString;r.exports=function(o){if(!t(o))return null;if(i(o)){var s=o.toString;if(typeof s!="function"||s===a)return null}try{return""+o}catch{return null}}}}),eZ=de({"node_modules/type/lib/safe-to-string.js"(e,r){"use strict";r.exports=function(t){try{return t.toString()}catch{try{return String(t)}catch{return null}}}}}),tZ=de({"node_modules/type/lib/to-short-string.js"(e,r){"use strict";var t=eZ(),i=/[\n\r\u2028\u2029]/g;r.exports=function(a){var o=t(a);return o===null?"":(o.length>100&&(o=o.slice(0,99)+"\u2026"),o=o.replace(i,function(s){switch(s){case` -`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),o)}}}),rZ=de({"node_modules/type/lib/resolve-error-message.js"(e,r){"use strict";var t=QX(),i=tZ();r.exports=function(a,o,s){s&&s.errorMessage&&(a=t(s.errorMessage));var l=a.indexOf("%v"),n=l>-1?i(o):null;if(s&&s.name){var u=a.indexOf("%n");if(u>-1){if(l>-1){var c,f,h,d;return u>l?(c=n,h=l,f=s.name,d=u):(c=s.name,h=u,f=n,d=l),a.slice(0,h)+c+a.slice(h+2,d)+f+a.slice(d+2)}return a.slice(0,u)+s.name+a.slice(u+2)}}return l>-1?a.slice(0,l)+n+a.slice(l+2):a}}}),R7=de({"node_modules/type/lib/resolve-exception.js"(e,r){"use strict";var t=Hv(),i=rZ();r.exports=function(a,o,s){if(s&&!t(a)){if("default"in s)return s.default;if(s.isOptional)return null}var l=s&&s.Error||TypeError,n=new l(i(o,a,s));throw s&&s.errorCode&&(n.code=s.errorCode),n}}}),iZ=de({"node_modules/type/value/ensure.js"(e,r){"use strict";var t=R7(),i=Hv();r.exports=function(a){if(i(a))return a;var o=arguments[1],s=o&&o.name?"Expected a value for %n, received %v":"Cannot use %v";return t(a,s,o)}}}),aZ=de({"node_modules/type/plain-function/ensure.js"(e,r){"use strict";var t=R7(),i=L7();r.exports=function(a){if(i(a))return a;var o=arguments[1],s=o&&o.name?"Expected a plain function for %n, received %v":"%v is not a plain function";return t(a,s,o)}}}),nZ=de({"node_modules/es5-ext/array/from/is-implemented.js"(e,r){"use strict";r.exports=function(){var t=Array.from,i,a;return typeof t!="function"?!1:(i=["raz","dwa"],a=t(i),!!(a&&a!==i&&a[1]==="dwa"))}}}),oZ=de({"node_modules/es5-ext/function/is-function.js"(e,r){"use strict";var t=Object.prototype.toString,i=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);r.exports=function(a){return typeof a=="function"&&i(t.call(a))}}}),sZ=de({"node_modules/es5-ext/math/sign/is-implemented.js"(e,r){"use strict";r.exports=function(){var t=Math.sign;return typeof t!="function"?!1:t(10)===1&&t(-20)===-1}}}),lZ=de({"node_modules/es5-ext/math/sign/shim.js"(e,r){"use strict";r.exports=function(t){return t=Number(t),isNaN(t)||t===0?t:t>0?1:-1}}}),uZ=de({"node_modules/es5-ext/math/sign/index.js"(e,r){"use strict";r.exports=sZ()()?Math.sign:lZ()}}),cZ=de({"node_modules/es5-ext/number/to-integer.js"(e,r){"use strict";var t=uZ(),i=Math.abs,a=Math.floor;r.exports=function(o){return isNaN(o)?0:(o=Number(o),o===0||!isFinite(o)?o:t(o)*a(i(o)))}}}),fZ=de({"node_modules/es5-ext/number/to-pos-integer.js"(e,r){"use strict";var t=cZ(),i=Math.max;r.exports=function(a){return i(0,t(a))}}}),hZ=de({"node_modules/es5-ext/array/from/shim.js"(e,r){"use strict";var t=C0().iterator,i=w_(),a=oZ(),o=fZ(),s=B1(),l=Pp(),n=k0(),u=T_(),c=Array.isArray,f=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;r.exports=function(p){var g=arguments[1],m=arguments[2],y,_,v,x,S,M,C,w,k,A;if(p=Object(l(p)),n(g)&&s(g),!this||this===Array||!a(this)){if(!g){if(i(p))return S=p.length,S!==1?Array.apply(null,p):(x=new Array(1),x[0]=p[0],x);if(c(p)){for(x=new Array(S=p.length),_=0;_=55296&&M<=56319&&(A+=p[++_])),A=g?f.call(g,m,A,v):A,y?(h.value=A,d(x,v,h)):x[v]=A,++v;S=v}}if(S===void 0)for(S=o(p.length),y&&(x=new y(S)),_=0;_=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){u(this,"__redo__",s("c",[h]));return}this.__redo__.forEach(function(d,p){d>=h&&(this.__redo__[p]=++d)},this),this.__redo__.push(h)}}),_onDelete:s(function(h){var d;h>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(d=this.__redo__.indexOf(h),d!==-1&&this.__redo__.splice(d,1),this.__redo__.forEach(function(p,g){p>h&&(this.__redo__[g]=--p)},this)))}),_onClear:s(function(){this.__redo__&&t.call(this.__redo__),this.__nextIndex__=0})}))),u(f.prototype,n.iterator,s(function(){return this}))}}),_Z=de({"node_modules/es6-iterator/array.js"(e,r){"use strict";var t=L4(),i=P7(),a=Ip(),o=C0(),s=z7(),l=Object.defineProperty,n;n=r.exports=function(u,c){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");s.call(this,u),c?i.call(c,"key+value")?c="key+value":i.call(c,"key")?c="key":c="value":c="value",l(this,"__kind__",a("",c))},t&&t(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_resolve:a(function(u){return this.__kind__==="value"?this.__list__[u]:this.__kind__==="key+value"?[u,this.__list__[u]]:u})}),l(n.prototype,o.toStringTag,a("c","Array Iterator"))}}),xZ=de({"node_modules/es6-iterator/string.js"(e,r){"use strict";var t=L4(),i=Ip(),a=C0(),o=z7(),s=Object.defineProperty,l;l=r.exports=function(n){if(!(this instanceof l))throw new TypeError("Constructor requires 'new'");n=String(n),o.call(this,n),s(this,"__length__",i("",n.length))},t&&t(l,o),delete l.prototype.constructor,l.prototype=Object.create(o.prototype,{_next:i(function(){if(this.__list__){if(this.__nextIndex__=55296&&c<=56319?u+this.__list__[this.__nextIndex__++]:u)})}),s(l.prototype,a.toStringTag,i("c","String Iterator"))}}),bZ=de({"node_modules/es6-iterator/is-iterable.js"(e,r){"use strict";var t=w_(),i=k0(),a=T_(),o=C0().iterator,s=Array.isArray;r.exports=function(l){return i(l)?s(l)||a(l)||t(l)?!0:typeof l[o]=="function":!1}}}),wZ=de({"node_modules/es6-iterator/valid-iterable.js"(e,r){"use strict";var t=bZ();r.exports=function(i){if(!t(i))throw new TypeError(i+" is not iterable");return i}}}),B7=de({"node_modules/es6-iterator/get.js"(e,r){"use strict";var t=w_(),i=T_(),a=_Z(),o=xZ(),s=wZ(),l=C0().iterator;r.exports=function(n){return typeof s(n)[l]=="function"?n[l]():t(n)?new a(n):i(n)?new o(n):new a(n)}}}),TZ=de({"node_modules/es6-iterator/for-of.js"(e,r){"use strict";var t=w_(),i=B1(),a=T_(),o=B7(),s=Array.isArray,l=Function.prototype.call,n=Array.prototype.some;r.exports=function(u,c){var f,h=arguments[2],d,p,g,m,y,_,v;if(s(u)||t(u)?f="array":a(u)?f="string":u=o(u),i(c),p=function(){g=!0},f==="array"){n.call(u,function(x){return l.call(c,h,x,p),g});return}if(f==="string"){for(y=u.length,m=0;m=55296&&v<=56319&&(_+=u[++m])),l.call(c,h,_,p),!g);++m);return}for(d=u.next();!d.done;){if(l.call(c,h,d.value,p),g)return;d=u.next()}}}}),AZ=de({"node_modules/es6-weak-map/is-native-implemented.js"(e,r){"use strict";r.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}}),MZ=de({"node_modules/es6-weak-map/polyfill.js"(e,r){"use strict";var t=k0(),i=L4(),a=PX(),o=Pp(),s=IX(),l=Ip(),n=B7(),u=TZ(),c=C0().toStringTag,f=AZ(),h=Array.isArray,d=Object.defineProperty,p=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf,m;r.exports=m=function(){var y=arguments[0],_;if(!(this instanceof m))throw new TypeError("Constructor requires 'new'");return _=f&&i&&WeakMap!==m?i(new WeakMap,g(this)):this,t(y)&&(h(y)||(y=n(y))),d(_,"__weakMapData__",l("c","$weakMap$"+s())),y&&u(y,function(v){o(v),_.set(v[0],v[1])}),_},f&&(i&&i(m,WeakMap),m.prototype=Object.create(WeakMap.prototype,{constructor:l(m)})),Object.defineProperties(m.prototype,{delete:l(function(y){return p.call(a(y),this.__weakMapData__)?(delete y[this.__weakMapData__],!0):!1}),get:l(function(y){if(p.call(a(y),this.__weakMapData__))return y[this.__weakMapData__]}),has:l(function(y){return p.call(a(y),this.__weakMapData__)}),set:l(function(y,_){return d(a(y),this.__weakMapData__,l("c",_)),this}),toString:l(function(){return"[object WeakMap]"})}),d(m.prototype,c,l("c","WeakMap"))}}),O7=de({"node_modules/es6-weak-map/index.js"(e,r){"use strict";r.exports=DX()()?WeakMap:MZ()}}),SZ=de({"node_modules/array-find-index/index.js"(e,r){"use strict";r.exports=function(t,i,a){if(typeof Array.prototype.findIndex=="function")return t.findIndex(i,a);if(typeof i!="function")throw new TypeError("predicate must be a function");var o=Object(t),s=o.length;if(s===0)return-1;for(var l=0;l{this.drawItem(x)});return this},d.prototype.drawItem=function(g,m){let{groups:y}=this,_=y[g];if(typeof m=="number"&&(g=m,_=y[m],m=null),!(_&&_.count&&_.opacity))return;_.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,_,m));let v=[];for(let x=1;x<_.activation.length;x++)!_.activation[x]||_.activation[x]!==!0&&!_.activation[x].data.length||v.push(...this.getMarkerDrawOptions(x,_,m));v.length&&this.drawMarker(v)},d.prototype.getMarkerDrawOptions=function(g,m,y){let{range:_,tree:v,viewport:x,activation:S,selectionBuffer:M,count:C}=m;if(!v)return y?[Object.assign({},m,{markerTexture:this.markerTextures[g],activation:S[g],count:y.length,elements:y,offset:0})]:[Object.assign({},m,{markerTexture:this.markerTextures[g],activation:S[g],offset:0})];let w=[],k=v.range(_,{lod:!0,px:[(_[2]-_[0])/x.width,(_[3]-_[1])/x.height]});if(y){let b=S[g].data,E=new Uint8Array(C);for(let T=0;T{let A=_[k];if(w===void 0)return A;w===null?w={positions:null}:typeof w=="function"?w={ondraw:w}:typeof w[0]=="number"&&(w={positions:w}),w=l(w,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"}),w.positions===null&&(w.positions=[]),w.tooManyColors!=null&&(this.tooManyColors=w.tooManyColors),A||(_[k]=A={id:k,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:x.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:x.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:x.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:x.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:x.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},w=Object.assign({},d.defaults,w)),w.positions&&!("marker"in w)&&(w.marker=A.marker,delete A.marker),w.marker&&!("positions"in w)&&(w.positions=A.positions,delete A.positions);let b=0,E=0;if(n(A,w,[{snap:!0,size:(T,F)=>(T==null&&(T=d.defaults.size),b+=T&&T.length?1:0,T),borderSize:(T,F)=>(T==null&&(T=d.defaults.borderSize),b+=T&&T.length?1:0,T),opacity:parseFloat,color:(T,F)=>(T==null&&(T=d.defaults.color),T=this.updateColor(T),E++,T),borderColor:(T,F)=>(T==null&&(T=d.defaults.borderColor),T=this.updateColor(T),E++,T),bounds:(T,F,D)=>("range"in D||(D.range=null),T),positions:(T,F,D)=>{let{snap:R}=F,{positionBuffer:P,positionFractBuffer:z,selectionBuffer:I}=F;if(T.x||T.y)return T.x.length?F.xAttr={buffer:x.buffer(T.x),offset:0,stride:4,count:T.x.length}:F.xAttr={buffer:T.x.buffer,offset:T.x.offset*4||0,stride:(T.x.stride||1)*4,count:T.x.count},T.y.length?F.yAttr={buffer:x.buffer(T.y),offset:0,stride:4,count:T.y.length}:F.yAttr={buffer:T.y.buffer,offset:T.y.offset*4||0,stride:(T.y.stride||1)*4,count:T.y.count},F.count=Math.max(F.xAttr.count,F.yAttr.count),T;T=u(T,"float64");let L=F.count=Math.floor(T.length/2),B=F.bounds=L?i(T,2):null;if(!D.range&&!F.range&&(delete F.range,D.range=B),!D.marker&&!F.marker&&(delete F.marker,D.marker=null),R&&(R===!0||L>R)?F.tree=o(T,{bounds:B}):R&&R.length&&(F.tree=R),F.tree){let W={primitive:"points",usage:"static",data:F.tree,type:"uint32"};F.elements?F.elements(W):F.elements=x.elements(W)}var O=c.float32(T);P({data:O,usage:"dynamic"});var G=c.fract32(T,O);return z({data:G,usage:"dynamic"}),I({data:new Uint8Array(L),type:"uint8",usage:"stream"}),T}},{marker:(T,F,D)=>{let{activation:R}=F;if(R.forEach(P=>P&&P.destroy&&P.destroy()),R.length=0,!T||typeof T[0]=="number"){let P=this.addMarker(T);R[P]=!0}else{let P=[];for(let z=0,I=Math.min(T.length,F.count);z{let R=F.bounds;if(R)return T||(T=R),F.scale=[1/(T[2]-T[0]),1/(T[3]-T[1])],F.translate=[-T[0],-T[1]],F.scaleFract=c.fract(F.scale),F.translateFract=c.fract(F.translate),T},viewport:T=>f(T||[v.drawingBufferWidth,v.drawingBufferHeight])}]),b){let{count:T,size:F,borderSize:D,sizeBuffer:R}=A,P=new Uint8Array(T*2);if(F.length||D.length)for(let z=0;z=0)return v;let x;if(g instanceof Uint8Array||g instanceof Uint8ClampedArray)x=g;else{x=new Uint8Array(g.length);for(let M=0,C=g.length;M_*4&&(this.tooManyColors=!0),this.updatePalette(y),v.length===1?v[0]:v},d.prototype.updatePalette=function(g){if(this.tooManyColors)return;let{maxColors:m,paletteTexture:y}=this,_=Math.ceil(g.length*.25/m);if(_>1){g=g.slice();for(let v=g.length*.25%m;v<_*m;v++)g.push(0,0,0,0)}y.height<_&&y.resize(m,_),y.subimage({width:Math.min(g.length*.25,m),height:_,data:g},0,0)},d.prototype.destroy=function(){return this.groups.forEach(g=>{g.sizeBuffer.destroy(),g.positionBuffer.destroy(),g.positionFractBuffer.destroy(),g.colorBuffer.destroy(),g.activation.forEach(m=>m&&m.destroy&&m.destroy()),g.selectionBuffer.destroy(),g.elements&&g.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(g=>g&&g.destroy&&g.destroy()),this};var p=function(g,m){var y=new h(g,m),_=y.render.bind(y);return Object.assign(_,{render:_,update:y.update.bind(y),draw:y.draw.bind(y),destroy:y.destroy.bind(y),regl:y.regl,gl:y.gl,canvas:y.gl.canvas,groups:y.groups,markers:y.markerCache,palette:y.palette}),_};r.exports=p}}),du=de({"node_modules/object-assign/index.js"(e,r){"use strict";var t=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(l){if(l==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(l)}function s(){try{if(!Object.assign)return!1;var l=new String("abc");if(l[5]="de",Object.getOwnPropertyNames(l)[0]==="5")return!1;for(var n={},u=0;u<10;u++)n["_"+String.fromCharCode(u)]=u;var c=Object.getOwnPropertyNames(n).map(function(h){return n[h]});if(c.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(h){f[h]=h}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}r.exports=s()?Object.assign:function(l,n){for(var u,c=o(l),f,h=1;h80*L){X=J=z[0],Z=N=z[1];for(var V=L;VJ&&(J=H),$>N&&(N=$);U=Math.max(J-X,N-Z),U=U!==0?32767/U:0}return o(G,W,L,X,Z,U,0),W}function i(z,I,L,B,O){var G,W;if(O===P(z,I,L,B)>0)for(G=I;G=I;G-=B)W=F(G,z[G],z[G+1],W);return W&&M(W,W.next)&&(D(W),W=W.next),W}function a(z,I){if(!z)return z;I||(I=z);var L=z,B;do if(B=!1,!L.steiner&&(M(L,L.next)||S(L.prev,L,L.next)===0)){if(D(L),L=I=L.prev,L===L.next)break;B=!0}else L=L.next;while(B||L!==I);return I}function o(z,I,L,B,O,G,W){if(z){!W&&G&&g(z,B,O,G);for(var X=z,Z,J;z.prev!==z.next;){if(Z=z.prev,J=z.next,G?l(z,B,O,G):s(z)){I.push(Z.i/L|0),I.push(z.i/L|0),I.push(J.i/L|0),D(z),z=J.next,X=J.next;continue}if(z=J,z===X){W?W===1?(z=n(a(z),I,L),o(z,I,L,B,O,G,2)):W===2&&u(z,I,L,B,O,G):o(a(z),I,L,B,O,G,1);break}}}}function s(z){var I=z.prev,L=z,B=z.next;if(S(I,L,B)>=0)return!1;for(var O=I.x,G=L.x,W=B.x,X=I.y,Z=L.y,J=B.y,N=OG?O>W?O:W:G>W?G:W,U=X>Z?X>J?X:J:Z>J?Z:J,V=B.next;V!==I;){if(V.x>=N&&V.x<=$&&V.y>=H&&V.y<=U&&v(O,X,G,Z,W,J,V.x,V.y)&&S(V.prev,V,V.next)>=0)return!1;V=V.next}return!0}function l(z,I,L,B){var O=z.prev,G=z,W=z.next;if(S(O,G,W)>=0)return!1;for(var X=O.x,Z=G.x,J=W.x,N=O.y,H=G.y,$=W.y,U=XZ?X>J?X:J:Z>J?Z:J,q=N>H?N>$?N:$:H>$?H:$,Y=y(U,V,I,L,B),K=y(j,q,I,L,B),te=z.prevZ,ne=z.nextZ;te&&te.z>=Y&&ne&&ne.z<=K;){if(te.x>=U&&te.x<=j&&te.y>=V&&te.y<=q&&te!==O&&te!==W&&v(X,N,Z,H,J,$,te.x,te.y)&&S(te.prev,te,te.next)>=0||(te=te.prevZ,ne.x>=U&&ne.x<=j&&ne.y>=V&&ne.y<=q&&ne!==O&&ne!==W&&v(X,N,Z,H,J,$,ne.x,ne.y)&&S(ne.prev,ne,ne.next)>=0))return!1;ne=ne.nextZ}for(;te&&te.z>=Y;){if(te.x>=U&&te.x<=j&&te.y>=V&&te.y<=q&&te!==O&&te!==W&&v(X,N,Z,H,J,$,te.x,te.y)&&S(te.prev,te,te.next)>=0)return!1;te=te.prevZ}for(;ne&&ne.z<=K;){if(ne.x>=U&&ne.x<=j&&ne.y>=V&&ne.y<=q&&ne!==O&&ne!==W&&v(X,N,Z,H,J,$,ne.x,ne.y)&&S(ne.prev,ne,ne.next)>=0)return!1;ne=ne.nextZ}return!0}function n(z,I,L){var B=z;do{var O=B.prev,G=B.next.next;!M(O,G)&&C(O,B,B.next,G)&&b(O,G)&&b(G,O)&&(I.push(O.i/L|0),I.push(B.i/L|0),I.push(G.i/L|0),D(B),D(B.next),B=z=G),B=B.next}while(B!==z);return a(B)}function u(z,I,L,B,O,G){var W=z;do{for(var X=W.next.next;X!==W.prev;){if(W.i!==X.i&&x(W,X)){var Z=T(W,X);W=a(W,W.next),Z=a(Z,Z.next),o(W,I,L,B,O,G,0),o(Z,I,L,B,O,G,0);return}X=X.next}W=W.next}while(W!==z)}function c(z,I,L,B){var O=[],G,W,X,Z,J;for(G=0,W=I.length;G=L.next.y&&L.next.y!==L.y){var X=L.x+(O-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(X<=B&&X>G&&(G=X,W=L.x=L.x&&L.x>=J&&B!==L.x&&v(OW.x||L.x===W.x&&p(W,L)))&&(W=L,H=$)),L=L.next;while(L!==Z);return W}function p(z,I){return S(z.prev,z,I.prev)<0&&S(I.next,z,z.next)<0}function g(z,I,L,B){var O=z;do O.z===0&&(O.z=y(O.x,O.y,I,L,B)),O.prevZ=O.prev,O.nextZ=O.next,O=O.next;while(O!==z);O.prevZ.nextZ=null,O.prevZ=null,m(O)}function m(z){var I,L,B,O,G,W,X,Z,J=1;do{for(L=z,z=null,G=null,W=0;L;){for(W++,B=L,X=0,I=0;I0||Z>0&&B;)X!==0&&(Z===0||!B||L.z<=B.z)?(O=L,L=L.nextZ,X--):(O=B,B=B.nextZ,Z--),G?G.nextZ=O:z=O,O.prevZ=G,G=O;L=B}G.nextZ=null,J*=2}while(W>1);return z}function y(z,I,L,B,O){return z=(z-L)*O|0,I=(I-B)*O|0,z=(z|z<<8)&16711935,z=(z|z<<4)&252645135,z=(z|z<<2)&858993459,z=(z|z<<1)&1431655765,I=(I|I<<8)&16711935,I=(I|I<<4)&252645135,I=(I|I<<2)&858993459,I=(I|I<<1)&1431655765,z|I<<1}function _(z){var I=z,L=z;do(I.x=(z-W)*(G-X)&&(z-W)*(B-X)>=(L-W)*(I-X)&&(L-W)*(G-X)>=(O-W)*(B-X)}function x(z,I){return z.next.i!==I.i&&z.prev.i!==I.i&&!A(z,I)&&(b(z,I)&&b(I,z)&&E(z,I)&&(S(z.prev,z,I.prev)||S(z,I.prev,I))||M(z,I)&&S(z.prev,z,z.next)>0&&S(I.prev,I,I.next)>0)}function S(z,I,L){return(I.y-z.y)*(L.x-I.x)-(I.x-z.x)*(L.y-I.y)}function M(z,I){return z.x===I.x&&z.y===I.y}function C(z,I,L,B){var O=k(S(z,I,L)),G=k(S(z,I,B)),W=k(S(L,B,z)),X=k(S(L,B,I));return!!(O!==G&&W!==X||O===0&&w(z,L,I)||G===0&&w(z,B,I)||W===0&&w(L,z,B)||X===0&&w(L,I,B))}function w(z,I,L){return I.x<=Math.max(z.x,L.x)&&I.x>=Math.min(z.x,L.x)&&I.y<=Math.max(z.y,L.y)&&I.y>=Math.min(z.y,L.y)}function k(z){return z>0?1:z<0?-1:0}function A(z,I){var L=z;do{if(L.i!==z.i&&L.next.i!==z.i&&L.i!==I.i&&L.next.i!==I.i&&C(L,L.next,z,I))return!0;L=L.next}while(L!==z);return!1}function b(z,I){return S(z.prev,z,z.next)<0?S(z,I,z.next)>=0&&S(z,z.prev,I)>=0:S(z,I,z.prev)<0||S(z,z.next,I)<0}function E(z,I){var L=z,B=!1,O=(z.x+I.x)/2,G=(z.y+I.y)/2;do L.y>G!=L.next.y>G&&L.next.y!==L.y&&O<(L.next.x-L.x)*(G-L.y)/(L.next.y-L.y)+L.x&&(B=!B),L=L.next;while(L!==z);return B}function T(z,I){var L=new R(z.i,z.x,z.y),B=new R(I.i,I.x,I.y),O=z.next,G=I.prev;return z.next=I,I.prev=z,L.next=O,O.prev=L,B.next=L,L.prev=B,G.next=B,B.prev=G,B}function F(z,I,L,B){var O=new R(z,I,L);return B?(O.next=B.next,O.prev=B,B.next.prev=O,B.next=O):(O.prev=O,O.next=O),O}function D(z){z.next.prev=z.prev,z.prev.next=z.next,z.prevZ&&(z.prevZ.nextZ=z.nextZ),z.nextZ&&(z.nextZ.prevZ=z.prevZ)}function R(z,I,L){this.i=z,this.x=I,this.y=L,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}t.deviation=function(z,I,L,B){var O=I&&I.length,G=O?I[0]*L:z.length,W=Math.abs(P(z,0,G,L));if(O)for(var X=0,Z=I.length;X0&&(B+=z[O-1].length,L.holes.push(B))}return L}}}),CX=de({"node_modules/array-normalize/index.js"(e,r){"use strict";var t=Vv();r.exports=i;function i(a,o,s){if(!a||a.length==null)throw Error("Argument should be an array");o==null&&(o=1),s==null&&(s=t(a,o));for(var l=0;l-1}}}),P7=de({"node_modules/es5-ext/string/#/contains/index.js"(e,r){"use strict";r.exports=qX()()?String.prototype.contains:VX()}}),Rp=de({"node_modules/d/index.js"(e,r){"use strict";var t=$v(),i=L7(),a=F4(),o=F7(),s=P7(),l=r.exports=function(n,u){var c,f,h,d,p;return arguments.length<2||typeof n!="string"?(d=u,u=n,n=null):d=arguments[2],t(n)?(c=s.call(n,"c"),f=s.call(n,"e"),h=s.call(n,"w")):(c=h=!0,f=!1),p={value:u,configurable:c,enumerable:f,writable:h},d?a(o(d),p):p};l.gs=function(n,u,c){var f,h,d,p;return typeof n!="string"?(d=c,c=u,u=n,n=null):d=arguments[3],t(u)?i(u)?t(c)?i(c)||(d=c,c=void 0):c=void 0:(d=u,u=c=void 0):u=void 0,t(n)?(f=s.call(n,"c"),h=s.call(n,"e")):(f=!0,h=!1),p={get:u,set:c,configurable:f,enumerable:h},d?a(o(d),p):p}}}),w_=de({"node_modules/es5-ext/function/is-arguments.js"(e,r){"use strict";var t=Object.prototype.toString,i=t.call((function(){return arguments})());r.exports=function(a){return t.call(a)===i}}}),T_=de({"node_modules/es5-ext/string/is-string.js"(e,r){"use strict";var t=Object.prototype.toString,i=t.call("");r.exports=function(a){return typeof a=="string"||a&&typeof a=="object"&&(a instanceof String||t.call(a)===i)||!1}}}),GX=de({"node_modules/ext/global-this/is-implemented.js"(e,r){"use strict";r.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),HX=de({"node_modules/ext/global-this/implementation.js"(e,r){var t=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};r.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}})()}}),A_=de({"node_modules/ext/global-this/index.js"(e,r){"use strict";r.exports=GX()()?globalThis:HX()}}),$X=de({"node_modules/es6-symbol/is-implemented.js"(e,r){"use strict";var t=A_(),i={object:!0,symbol:!0};r.exports=function(){var a=t.Symbol,o;if(typeof a!="function")return!1;o=a("test symbol");try{String(o)}catch{return!1}return!(!i[typeof a.iterator]||!i[typeof a.toPrimitive]||!i[typeof a.toStringTag])}}}),WX=de({"node_modules/es6-symbol/is-symbol.js"(e,r){"use strict";r.exports=function(t){return t?typeof t=="symbol"?!0:!t.constructor||t.constructor.name!=="Symbol"?!1:t[t.constructor.toStringTag]==="Symbol":!1}}}),I7=de({"node_modules/es6-symbol/validate-symbol.js"(e,r){"use strict";var t=WX();r.exports=function(i){if(!t(i))throw new TypeError(i+" is not a symbol");return i}}}),YX=de({"node_modules/es6-symbol/lib/private/generate-name.js"(e,r){"use strict";var t=Rp(),i=Object.create,a=Object.defineProperty,o=Object.prototype,s=i(null);r.exports=function(l){for(var n=0,u,c;s[l+(n||"")];)++n;return l+=n||"",s[l]=!0,u="@@"+l,a(o,u,t.gs(null,function(f){c||(c=!0,a(this,u,t(f)),c=!1)})),u}}}),XX=de({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(e,r){"use strict";var t=Rp(),i=A_().Symbol;r.exports=function(a){return Object.defineProperties(a,{hasInstance:t("",i&&i.hasInstance||a("hasInstance")),isConcatSpreadable:t("",i&&i.isConcatSpreadable||a("isConcatSpreadable")),iterator:t("",i&&i.iterator||a("iterator")),match:t("",i&&i.match||a("match")),replace:t("",i&&i.replace||a("replace")),search:t("",i&&i.search||a("search")),species:t("",i&&i.species||a("species")),split:t("",i&&i.split||a("split")),toPrimitive:t("",i&&i.toPrimitive||a("toPrimitive")),toStringTag:t("",i&&i.toStringTag||a("toStringTag")),unscopables:t("",i&&i.unscopables||a("unscopables"))})}}}),ZX=de({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(e,r){"use strict";var t=Rp(),i=I7(),a=Object.create(null);r.exports=function(o){return Object.defineProperties(o,{for:t(function(s){return a[s]?a[s]:a[s]=o(String(s))}),keyFor:t(function(s){var l;i(s);for(l in a)if(a[l]===s)return l})})}}}),KX=de({"node_modules/es6-symbol/polyfill.js"(e,r){"use strict";var t=Rp(),i=I7(),a=A_().Symbol,o=YX(),s=XX(),l=ZX(),n=Object.create,u=Object.defineProperties,c=Object.defineProperty,f,h,d;if(typeof a=="function")try{String(a()),d=!0}catch{}else a=null;h=function(g){if(this instanceof h)throw new TypeError("Symbol is not a constructor");return f(g)},r.exports=f=function p(g){var m;if(this instanceof p)throw new TypeError("Symbol is not a constructor");return d?a(g):(m=n(h.prototype),g=g===void 0?"":String(g),u(m,{__description__:t("",g),__name__:t("",o(g))}))},s(f),l(f),u(h.prototype,{constructor:t(f),toString:t("",function(){return this.__name__})}),u(f.prototype,{toString:t(function(){return"Symbol ("+i(this).__description__+")"}),valueOf:t(function(){return i(this)})}),c(f.prototype,f.toPrimitive,t("",function(){var p=i(this);return typeof p=="symbol"?p:p.toString()})),c(f.prototype,f.toStringTag,t("c","Symbol")),c(h.prototype,f.toStringTag,t("c",f.prototype[f.toStringTag])),c(h.prototype,f.toPrimitive,t("c",f.prototype[f.toPrimitive]))}}),D0=de({"node_modules/es6-symbol/index.js"(e,r){"use strict";r.exports=$X()()?A_().Symbol:KX()}}),JX=de({"node_modules/es5-ext/array/#/clear.js"(e,r){"use strict";var t=Ip();r.exports=function(){return t(this).length=0,this}}}),O1=de({"node_modules/es5-ext/object/valid-callable.js"(e,r){"use strict";r.exports=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}}),QX=de({"node_modules/type/string/coerce.js"(e,r){"use strict";var t=$v(),i=D7(),a=Object.prototype.toString;r.exports=function(o){if(!t(o))return null;if(i(o)){var s=o.toString;if(typeof s!="function"||s===a)return null}try{return""+o}catch{return null}}}}),eZ=de({"node_modules/type/lib/safe-to-string.js"(e,r){"use strict";r.exports=function(t){try{return t.toString()}catch{try{return String(t)}catch{return null}}}}}),tZ=de({"node_modules/type/lib/to-short-string.js"(e,r){"use strict";var t=eZ(),i=/[\n\r\u2028\u2029]/g;r.exports=function(a){var o=t(a);return o===null?"":(o.length>100&&(o=o.slice(0,99)+"\u2026"),o=o.replace(i,function(s){switch(s){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),o)}}}),rZ=de({"node_modules/type/lib/resolve-error-message.js"(e,r){"use strict";var t=QX(),i=tZ();r.exports=function(a,o,s){s&&s.errorMessage&&(a=t(s.errorMessage));var l=a.indexOf("%v"),n=l>-1?i(o):null;if(s&&s.name){var u=a.indexOf("%n");if(u>-1){if(l>-1){var c,f,h,d;return u>l?(c=n,h=l,f=s.name,d=u):(c=s.name,h=u,f=n,d=l),a.slice(0,h)+c+a.slice(h+2,d)+f+a.slice(d+2)}return a.slice(0,u)+s.name+a.slice(u+2)}}return l>-1?a.slice(0,l)+n+a.slice(l+2):a}}}),R7=de({"node_modules/type/lib/resolve-exception.js"(e,r){"use strict";var t=$v(),i=rZ();r.exports=function(a,o,s){if(s&&!t(a)){if("default"in s)return s.default;if(s.isOptional)return null}var l=s&&s.Error||TypeError,n=new l(i(o,a,s));throw s&&s.errorCode&&(n.code=s.errorCode),n}}}),iZ=de({"node_modules/type/value/ensure.js"(e,r){"use strict";var t=R7(),i=$v();r.exports=function(a){if(i(a))return a;var o=arguments[1],s=o&&o.name?"Expected a value for %n, received %v":"Cannot use %v";return t(a,s,o)}}}),aZ=de({"node_modules/type/plain-function/ensure.js"(e,r){"use strict";var t=R7(),i=L7();r.exports=function(a){if(i(a))return a;var o=arguments[1],s=o&&o.name?"Expected a plain function for %n, received %v":"%v is not a plain function";return t(a,s,o)}}}),nZ=de({"node_modules/es5-ext/array/from/is-implemented.js"(e,r){"use strict";r.exports=function(){var t=Array.from,i,a;return typeof t!="function"?!1:(i=["raz","dwa"],a=t(i),!!(a&&a!==i&&a[1]==="dwa"))}}}),oZ=de({"node_modules/es5-ext/function/is-function.js"(e,r){"use strict";var t=Object.prototype.toString,i=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);r.exports=function(a){return typeof a=="function"&&i(t.call(a))}}}),sZ=de({"node_modules/es5-ext/math/sign/is-implemented.js"(e,r){"use strict";r.exports=function(){var t=Math.sign;return typeof t!="function"?!1:t(10)===1&&t(-20)===-1}}}),lZ=de({"node_modules/es5-ext/math/sign/shim.js"(e,r){"use strict";r.exports=function(t){return t=Number(t),isNaN(t)||t===0?t:t>0?1:-1}}}),uZ=de({"node_modules/es5-ext/math/sign/index.js"(e,r){"use strict";r.exports=sZ()()?Math.sign:lZ()}}),cZ=de({"node_modules/es5-ext/number/to-integer.js"(e,r){"use strict";var t=uZ(),i=Math.abs,a=Math.floor;r.exports=function(o){return isNaN(o)?0:(o=Number(o),o===0||!isFinite(o)?o:t(o)*a(i(o)))}}}),fZ=de({"node_modules/es5-ext/number/to-pos-integer.js"(e,r){"use strict";var t=cZ(),i=Math.max;r.exports=function(a){return i(0,t(a))}}}),hZ=de({"node_modules/es5-ext/array/from/shim.js"(e,r){"use strict";var t=D0().iterator,i=w_(),a=oZ(),o=fZ(),s=O1(),l=Ip(),n=C0(),u=T_(),c=Array.isArray,f=Function.prototype.call,h={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;r.exports=function(p){var g=arguments[1],m=arguments[2],y,_,v,x,S,M,C,w,k,A;if(p=Object(l(p)),n(g)&&s(g),!this||this===Array||!a(this)){if(!g){if(i(p))return S=p.length,S!==1?Array.apply(null,p):(x=new Array(1),x[0]=p[0],x);if(c(p)){for(x=new Array(S=p.length),_=0;_=55296&&M<=56319&&(A+=p[++_])),A=g?f.call(g,m,A,v):A,y?(h.value=A,d(x,v,h)):x[v]=A,++v;S=v}}if(S===void 0)for(S=o(p.length),y&&(x=new y(S)),_=0;_=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){u(this,"__redo__",s("c",[h]));return}this.__redo__.forEach(function(d,p){d>=h&&(this.__redo__[p]=++d)},this),this.__redo__.push(h)}}),_onDelete:s(function(h){var d;h>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(d=this.__redo__.indexOf(h),d!==-1&&this.__redo__.splice(d,1),this.__redo__.forEach(function(p,g){p>h&&(this.__redo__[g]=--p)},this)))}),_onClear:s(function(){this.__redo__&&t.call(this.__redo__),this.__nextIndex__=0})}))),u(f.prototype,n.iterator,s(function(){return this}))}}),_Z=de({"node_modules/es6-iterator/array.js"(e,r){"use strict";var t=L4(),i=P7(),a=Rp(),o=D0(),s=z7(),l=Object.defineProperty,n;n=r.exports=function(u,c){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");s.call(this,u),c?i.call(c,"key+value")?c="key+value":i.call(c,"key")?c="key":c="value":c="value",l(this,"__kind__",a("",c))},t&&t(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_resolve:a(function(u){return this.__kind__==="value"?this.__list__[u]:this.__kind__==="key+value"?[u,this.__list__[u]]:u})}),l(n.prototype,o.toStringTag,a("c","Array Iterator"))}}),xZ=de({"node_modules/es6-iterator/string.js"(e,r){"use strict";var t=L4(),i=Rp(),a=D0(),o=z7(),s=Object.defineProperty,l;l=r.exports=function(n){if(!(this instanceof l))throw new TypeError("Constructor requires 'new'");n=String(n),o.call(this,n),s(this,"__length__",i("",n.length))},t&&t(l,o),delete l.prototype.constructor,l.prototype=Object.create(o.prototype,{_next:i(function(){if(this.__list__){if(this.__nextIndex__=55296&&c<=56319?u+this.__list__[this.__nextIndex__++]:u)})}),s(l.prototype,a.toStringTag,i("c","String Iterator"))}}),bZ=de({"node_modules/es6-iterator/is-iterable.js"(e,r){"use strict";var t=w_(),i=C0(),a=T_(),o=D0().iterator,s=Array.isArray;r.exports=function(l){return i(l)?s(l)||a(l)||t(l)?!0:typeof l[o]=="function":!1}}}),wZ=de({"node_modules/es6-iterator/valid-iterable.js"(e,r){"use strict";var t=bZ();r.exports=function(i){if(!t(i))throw new TypeError(i+" is not iterable");return i}}}),B7=de({"node_modules/es6-iterator/get.js"(e,r){"use strict";var t=w_(),i=T_(),a=_Z(),o=xZ(),s=wZ(),l=D0().iterator;r.exports=function(n){return typeof s(n)[l]=="function"?n[l]():t(n)?new a(n):i(n)?new o(n):new a(n)}}}),TZ=de({"node_modules/es6-iterator/for-of.js"(e,r){"use strict";var t=w_(),i=O1(),a=T_(),o=B7(),s=Array.isArray,l=Function.prototype.call,n=Array.prototype.some;r.exports=function(u,c){var f,h=arguments[2],d,p,g,m,y,_,v;if(s(u)||t(u)?f="array":a(u)?f="string":u=o(u),i(c),p=function(){g=!0},f==="array"){n.call(u,function(x){return l.call(c,h,x,p),g});return}if(f==="string"){for(y=u.length,m=0;m=55296&&v<=56319&&(_+=u[++m])),l.call(c,h,_,p),!g);++m);return}for(d=u.next();!d.done;){if(l.call(c,h,d.value,p),g)return;d=u.next()}}}}),AZ=de({"node_modules/es6-weak-map/is-native-implemented.js"(e,r){"use strict";r.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}}),MZ=de({"node_modules/es6-weak-map/polyfill.js"(e,r){"use strict";var t=C0(),i=L4(),a=PX(),o=Ip(),s=IX(),l=Rp(),n=B7(),u=TZ(),c=D0().toStringTag,f=AZ(),h=Array.isArray,d=Object.defineProperty,p=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf,m;r.exports=m=function(){var y=arguments[0],_;if(!(this instanceof m))throw new TypeError("Constructor requires 'new'");return _=f&&i&&WeakMap!==m?i(new WeakMap,g(this)):this,t(y)&&(h(y)||(y=n(y))),d(_,"__weakMapData__",l("c","$weakMap$"+s())),y&&u(y,function(v){o(v),_.set(v[0],v[1])}),_},f&&(i&&i(m,WeakMap),m.prototype=Object.create(WeakMap.prototype,{constructor:l(m)})),Object.defineProperties(m.prototype,{delete:l(function(y){return p.call(a(y),this.__weakMapData__)?(delete y[this.__weakMapData__],!0):!1}),get:l(function(y){if(p.call(a(y),this.__weakMapData__))return y[this.__weakMapData__]}),has:l(function(y){return p.call(a(y),this.__weakMapData__)}),set:l(function(y,_){return d(a(y),this.__weakMapData__,l("c",_)),this}),toString:l(function(){return"[object WeakMap]"})}),d(m.prototype,c,l("c","WeakMap"))}}),O7=de({"node_modules/es6-weak-map/index.js"(e,r){"use strict";r.exports=DX()()?WeakMap:MZ()}}),SZ=de({"node_modules/array-find-index/index.js"(e,r){"use strict";r.exports=function(t,i,a){if(typeof Array.prototype.findIndex=="function")return t.findIndex(i,a);if(typeof i!="function")throw new TypeError("predicate must be a function");var o=Object(t),s=o.length;if(s===0)return-1;for(var l=0;lE.join==="round"?2:1,miterLimit:S.prop("miterLimit"),scale:S.prop("scale"),scaleFract:S.prop("scaleFract"),translateFract:S.prop("translateFract"),translate:S.prop("translate"),thickness:S.prop("thickness"),dashTexture:S.prop("dashTexture"),opacity:S.prop("opacity"),pixelRatio:S.context("pixelRatio"),id:S.prop("id"),dashLength:S.prop("dashLength"),viewport:(b,E)=>[E.viewport.x,E.viewport.y,b.viewportWidth,b.viewportHeight],depth:S.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(b,E)=>!E.overlay},stencil:{enable:!1},scissor:{enable:!0,box:S.prop("viewport")},viewport:S.prop("viewport")},w=S(a({vert:p,frag:g,attributes:{lineEnd:{buffer:M,divisor:0,stride:8,offset:0},lineTop:{buffer:M,divisor:0,stride:8,offset:4},aCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:S.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:S.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:S.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},C)),k;try{k=S(a({cull:{enable:!0,face:"back"},vert:_,frag:v,attributes:{lineEnd:{buffer:M,divisor:0,stride:8,offset:0},lineTop:{buffer:M,divisor:0,stride:8,offset:4},aColor:{buffer:S.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:S.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},C))}catch{k=w}return{fill:S({primitive:"triangle",elements:(b,E)=>E.triangles,offset:0,vert:m,frag:y,uniforms:{scale:S.prop("scale"),color:S.prop("fill"),scaleFract:S.prop("scaleFract"),translateFract:S.prop("translateFract"),translate:S.prop("translate"),opacity:S.prop("opacity"),pixelRatio:S.context("pixelRatio"),id:S.prop("id"),viewport:(b,E)=>[E.viewport.x,E.viewport.y,b.viewportWidth,b.viewportHeight]},attributes:{position:{buffer:S.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:S.prop("positionFractBuffer"),stride:8,offset:8}},blend:C.blend,depth:{enable:!1},scissor:C.scissor,stencil:C.stencil,viewport:C.viewport}),rect:w,miter:k}},x.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},x.prototype.render=function(...S){S.length&&this.update(...S),this.draw()},x.prototype.draw=function(...S){return(S.length?S:this.passes).forEach((M,C)=>{if(M&&Array.isArray(M))return this.draw(...M);typeof M=="number"&&(M=this.passes[M]),M&&M.count>1&&M.opacity&&(this.regl._refresh(),M.fill&&M.triangles&&M.triangles.length>2&&this.shaders.fill(M),M.thickness&&(M.scale[0]*M.viewport.width>x.precisionThreshold||M.scale[1]*M.viewport.height>x.precisionThreshold?this.shaders.rect(M):M.join==="rect"||!M.join&&(M.thickness<=2||M.count>=x.maxPoints)?this.shaders.rect(M):this.shaders.miter(M)))}),this},x.prototype.update=function(S){if(!S)return;S.length!=null?typeof S[0]=="number"&&(S=[{positions:S}]):Array.isArray(S)||(S=[S]);let{regl:M,gl:C}=this;if(S.forEach((k,A)=>{let b=this.passes[A];if(k!==void 0){if(k===null){this.passes[A]=null;return}if(typeof k[0]=="number"&&(k={positions:k}),k=o(k,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),b||(this.passes[A]=b={id:A,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:M.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:M.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:M.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:M.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},k=a({},x.defaults,k)),k.thickness!=null&&(b.thickness=parseFloat(k.thickness)),k.opacity!=null&&(b.opacity=parseFloat(k.opacity)),k.miterLimit!=null&&(b.miterLimit=parseFloat(k.miterLimit)),k.overlay!=null&&(b.overlay=!!k.overlay,AZ-J),G=[],W=0,X=b.hole!=null?b.hole[0]:null;if(X!=null){let Z=d(O,J=>J>=X);O=O.slice(0,Z),O.push(X)}for(let Z=0;Z$-X+(O[Z]-W)),H=l(J,N);H=H.map($=>$+W+($+W{S.colorBuffer.destroy(),S.positionBuffer.destroy(),S.dashTexture.destroy()}),this.passes.length=0,this}}}),EZ=de({"node_modules/regl-error2d/index.js"(e,r){"use strict";var t=qv(),i=b_(),a=M7(),o=rp(),s=du(),l=Vv(),{float32:n,fract32:u}=D4();r.exports=f;var c=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function f(h,d){if(typeof h=="function"?(d||(d={}),d.regl=h):d=h,d.length&&(d.positions=d),h=d.regl,!h.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let p=h._gl,g,m,y,_,v,x,S={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},M=[];return _=h.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),m=h.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),y=h.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=h.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),x=h.buffer({usage:"static",type:"float",data:c}),A(d),g=h({vert:` +`;r.exports=x;function x(S,M){if(!(this instanceof x))return new x(S,M);if(typeof S=="function"?(M||(M={}),M.regl=S):M=S,M.length&&(M.positions=M),S=M.regl,!S.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=S._gl,this.regl=S,this.passes=[],this.shaders=x.shaders.has(S)?x.shaders.get(S):x.shaders.set(S,x.createShaders(S)).get(S),this.update(M)}x.dashMult=2,x.maxPatternLength=256,x.precisionThreshold=3e6,x.maxPoints=1e4,x.maxLines=2048,x.shaders=new f,x.createShaders=function(S){let M=S.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),C={primitive:"triangle strip",instances:S.prop("count"),count:4,offset:0,uniforms:{miterMode:(b,E)=>E.join==="round"?2:1,miterLimit:S.prop("miterLimit"),scale:S.prop("scale"),scaleFract:S.prop("scaleFract"),translateFract:S.prop("translateFract"),translate:S.prop("translate"),thickness:S.prop("thickness"),dashTexture:S.prop("dashTexture"),opacity:S.prop("opacity"),pixelRatio:S.context("pixelRatio"),id:S.prop("id"),dashLength:S.prop("dashLength"),viewport:(b,E)=>[E.viewport.x,E.viewport.y,b.viewportWidth,b.viewportHeight],depth:S.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(b,E)=>!E.overlay},stencil:{enable:!1},scissor:{enable:!0,box:S.prop("viewport")},viewport:S.prop("viewport")},w=S(a({vert:p,frag:g,attributes:{lineEnd:{buffer:M,divisor:0,stride:8,offset:0},lineTop:{buffer:M,divisor:0,stride:8,offset:4},aCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:S.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:S.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:S.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},C)),k;try{k=S(a({cull:{enable:!0,face:"back"},vert:_,frag:v,attributes:{lineEnd:{buffer:M,divisor:0,stride:8,offset:0},lineTop:{buffer:M,divisor:0,stride:8,offset:4},aColor:{buffer:S.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:S.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:S.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},C))}catch{k=w}return{fill:S({primitive:"triangle",elements:(b,E)=>E.triangles,offset:0,vert:m,frag:y,uniforms:{scale:S.prop("scale"),color:S.prop("fill"),scaleFract:S.prop("scaleFract"),translateFract:S.prop("translateFract"),translate:S.prop("translate"),opacity:S.prop("opacity"),pixelRatio:S.context("pixelRatio"),id:S.prop("id"),viewport:(b,E)=>[E.viewport.x,E.viewport.y,b.viewportWidth,b.viewportHeight]},attributes:{position:{buffer:S.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:S.prop("positionFractBuffer"),stride:8,offset:8}},blend:C.blend,depth:{enable:!1},scissor:C.scissor,stencil:C.stencil,viewport:C.viewport}),rect:w,miter:k}},x.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},x.prototype.render=function(...S){S.length&&this.update(...S),this.draw()},x.prototype.draw=function(...S){return(S.length?S:this.passes).forEach((M,C)=>{if(M&&Array.isArray(M))return this.draw(...M);typeof M=="number"&&(M=this.passes[M]),M&&M.count>1&&M.opacity&&(this.regl._refresh(),M.fill&&M.triangles&&M.triangles.length>2&&this.shaders.fill(M),M.thickness&&(M.scale[0]*M.viewport.width>x.precisionThreshold||M.scale[1]*M.viewport.height>x.precisionThreshold?this.shaders.rect(M):M.join==="rect"||!M.join&&(M.thickness<=2||M.count>=x.maxPoints)?this.shaders.rect(M):this.shaders.miter(M)))}),this},x.prototype.update=function(S){if(!S)return;S.length!=null?typeof S[0]=="number"&&(S=[{positions:S}]):Array.isArray(S)||(S=[S]);let{regl:M,gl:C}=this;if(S.forEach((k,A)=>{let b=this.passes[A];if(k!==void 0){if(k===null){this.passes[A]=null;return}if(typeof k[0]=="number"&&(k={positions:k}),k=o(k,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),b||(this.passes[A]=b={id:A,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:M.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:M.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:M.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:M.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},k=a({},x.defaults,k)),k.thickness!=null&&(b.thickness=parseFloat(k.thickness)),k.opacity!=null&&(b.opacity=parseFloat(k.opacity)),k.miterLimit!=null&&(b.miterLimit=parseFloat(k.miterLimit)),k.overlay!=null&&(b.overlay=!!k.overlay,AZ-J),G=[],W=0,X=b.hole!=null?b.hole[0]:null;if(X!=null){let Z=d(O,J=>J>=X);O=O.slice(0,Z),O.push(X)}for(let Z=0;Z$-X+(O[Z]-W)),H=l(J,N);H=H.map($=>$+W+($+W{S.colorBuffer.destroy(),S.positionBuffer.destroy(),S.dashTexture.destroy()}),this.passes.length=0,this}}}),EZ=de({"node_modules/regl-error2d/index.js"(e,r){"use strict";var t=Vv(),i=b_(),a=M7(),o=ip(),s=du(),l=Gv(),{float32:n,fract32:u}=D4();r.exports=f;var c=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function f(h,d){if(typeof h=="function"?(d||(d={}),d.regl=h):d=h,d.length&&(d.positions=d),h=d.regl,!h.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let p=h._gl,g,m,y,_,v,x,S={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},M=[];return _=h.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),m=h.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),y=h.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=h.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),x=h.buffer({usage:"static",type:"float",data:c}),A(d),g=h({vert:` precision highp float; attribute vec2 position, positionFract; @@ -2615,10 +2615,10 @@ void main() { gl_FragColor = fragColor; gl_FragColor.a *= opacity; } - `,uniforms:{range:h.prop("range"),lineWidth:h.prop("lineWidth"),capSize:h.prop("capSize"),opacity:h.prop("opacity"),scale:h.prop("scale"),translate:h.prop("translate"),scaleFract:h.prop("scaleFract"),translateFract:h.prop("translateFract"),viewport:(E,T)=>[T.viewport.x,T.viewport.y,E.viewportWidth,E.viewportHeight]},attributes:{color:{buffer:_,offset:(E,T)=>T.offset*4,divisor:1},position:{buffer:m,offset:(E,T)=>T.offset*8,divisor:1},positionFract:{buffer:y,offset:(E,T)=>T.offset*8,divisor:1},error:{buffer:v,offset:(E,T)=>T.offset*16,divisor:1},direction:{buffer:x,stride:24,offset:0},lineOffset:{buffer:x,stride:24,offset:8},capOffset:{buffer:x,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:h.prop("viewport")},viewport:h.prop("viewport"),stencil:!1,instances:h.prop("count"),count:c.length}),s(C,{update:A,draw:w,destroy:b,regl:h,gl:p,canvas:p.canvas,groups:M}),C;function C(E){E?A(E):E===null&&b(),w()}function w(E){if(typeof E=="number")return k(E);E&&!Array.isArray(E)&&(E=[E]),h._refresh(),M.forEach((T,F)=>{if(T){if(E&&(E[F]?T.draw=!0:T.draw=!1),!T.draw){T.draw=!0;return}k(F)}})}function k(E){typeof E=="number"&&(E=M[E]),E!=null&&E&&E.count&&E.color&&E.opacity&&E.positions&&E.positions.length>1&&(E.scaleRatio=[E.scale[0]*E.viewport.width,E.scale[1]*E.viewport.height],g(E),E.after&&E.after(E))}function A(E){if(!E)return;E.length!=null?typeof E[0]=="number"&&(E=[{positions:E}]):Array.isArray(E)||(E=[E]);let T=0,F=0;if(C.groups=M=E.map((P,z)=>{let I=M[z];if(P)typeof P=="function"?P={after:P}:typeof P[0]=="number"&&(P={positions:P});else return I;return P=o(P,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),I||(M[z]=I={id:z,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},P=s({},S,P)),a(I,P,[{lineWidth:L=>+L*.5,capSize:L=>+L*.5,opacity:parseFloat,errors:L=>(L=l(L),F+=L.length,L),positions:(L,B)=>(L=l(L,"float64"),B.count=Math.floor(L.length/2),B.bounds=t(L,2),B.offset=T,T+=B.count,L)},{color:(L,B)=>{let O=B.count;if(L||(L="transparent"),!Array.isArray(L)||typeof L[0]=="number"){let W=L;L=Array(O);for(let X=0;X{let G=B.bounds;return L||(L=G),B.scale=[1/(L[2]-L[0]),1/(L[3]-L[1])],B.translate=[-L[0],-L[1]],B.scaleFract=u(B.scale),B.translateFract=u(B.translate),L},viewport:L=>{let B;return Array.isArray(L)?B={x:L[0],y:L[1],width:L[2]-L[0],height:L[3]-L[1]}:L?(B={x:L.x||L.left||0,y:L.y||L.top||0},L.right?B.width=L.right-B.x:B.width=L.w||L.width||0,L.bottom?B.height=L.bottom-B.y:B.height=L.h||L.height||0):B={x:0,y:0,width:p.drawingBufferWidth,height:p.drawingBufferHeight},B}}]),I}),T||F){let P=M.reduce((B,O,G)=>B+(O?O.count:0),0),z=new Float64Array(P*2),I=new Uint8Array(P*4),L=new Float32Array(P*4);M.forEach((B,O)=>{if(!B)return;let{positions:G,count:W,offset:X,color:Z,errors:J}=B;W&&(I.set(Z,X*4),L.set(J,X*4),z.set(G,X*2))});var D=n(z);m(D);var R=u(z,D);y(R),_(I),v(L)}}function b(){m.destroy(),y.destroy(),_.destroy(),v.destroy(),x.destroy()}}}}),kZ=de({"node_modules/unquote/index.js"(e,r){var t=/[\'\"]/;r.exports=function(a){return a?(t.test(a.charAt(0))&&(a=a.substr(1)),t.test(a.charAt(a.length-1))&&(a=a.substr(0,a.length-1)),a):""}}}),j7=de({"node_modules/css-global-keywords/index.json"(e,r){r.exports=["inherit","initial","unset"]}}),U7=de({"node_modules/css-system-font-keywords/index.json"(e,r){r.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),q7=de({"node_modules/css-font-weight-keywords/index.json"(e,r){r.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),V7=de({"node_modules/css-font-style-keywords/index.json"(e,r){r.exports=["normal","italic","oblique"]}}),G7=de({"node_modules/css-font-stretch-keywords/index.json"(e,r){r.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),CZ=de({"node_modules/parenthesis/index.js"(e,r){"use strict";function t(o,s){if(typeof o!="string")return[o];var l=[o];typeof s=="string"||Array.isArray(s)?s={brackets:s}:s||(s={});var n=s.brackets?Array.isArray(s.brackets)?s.brackets:[s.brackets]:["{}","[]","()"],u=s.escape||"___",c=!!s.flat;n.forEach(function(d){var p=new RegExp(["\\",d[0],"[^\\",d[0],"\\",d[1],"]*\\",d[1]].join("")),g=[];function m(y,_,v){var x=l.push(y.slice(d[0].length,-d[1].length))-1;return g.push(x),u+x+u}l.forEach(function(y,_){for(var v,x=0;y!=v;)if(v=y,y=y.replace(p,m),x++>1e4)throw Error("References have circular dependency. Please, check them.");l[_]=y}),g=g.reverse(),l=l.map(function(y){return g.forEach(function(_){y=y.replace(new RegExp("(\\"+u+_+"\\"+u+")","g"),d[0]+"$1"+d[1])}),y})});var f=new RegExp("\\"+u+"([0-9]+)\\"+u);function h(d,p,g){for(var m=[],y,_=0;y=f.exec(d);){if(_++>1e4)throw Error("Circular references in parenthesis");m.push(d.slice(0,y.index)),m.push(h(p[y[1]],p)),d=d.slice(y.index+y[0].length)}return m.push(d),m}return c?l:h(l[0],l)}function i(o,s){if(s&&s.flat){var l=s&&s.escape||"___",n=o[0],u;if(!n)return"";for(var c=new RegExp("\\"+l+"([0-9]+)\\"+l),f=0;n!=u;){if(f++>1e4)throw Error("Circular references in "+o);u=n,n=n.replace(c,h)}return n}return o.reduce(function d(p,g){return Array.isArray(g)&&(g=g.reduce(d,"")),p+g},"");function h(d,p){if(o[p]==null)throw Error("Reference "+p+"is undefined");return o[p]}}function a(o,s){return Array.isArray(o)?i(o,s):t(o,s)}a.parse=t,a.stringify=i,r.exports=a}}),DZ=de({"node_modules/string-split-by/index.js"(e,r){"use strict";var t=CZ();r.exports=function(a,o,s){if(a==null)throw Error("First argument should be a string");if(o==null)throw Error("Separator should be a string or a RegExp");s?(typeof s=="string"||Array.isArray(s))&&(s={ignore:s}):s={},s.escape==null&&(s.escape=!0),s.ignore==null?s.ignore=["[]","()","{}","<>",'""',"''","``","\u201C\u201D","\xAB\xBB"]:(typeof s.ignore=="string"&&(s.ignore=[s.ignore]),s.ignore=s.ignore.map(function(p){return p.length===1&&(p=p+p),p}));var l=t.parse(a,{flat:!0,brackets:s.ignore}),n=l[0],u=n.split(o);if(s.escape){for(var c=[],f=0;f1&&dr===_r&&(dr==='"'||dr==="'"))return['"'+n(bt.substr(1,bt.length-2))+'"'];var Kr=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(bt);if(Kr)return u(bt.substr(0,Kr.index)).concat(u(Kr[1])).concat(u(bt.substr(Kr.index+Kr[0].length)));var ci=bt.split(".");if(ci.length===1)return['"'+n(bt)+'"'];for(var yi=[],si=0;si"u"?1:window.devicePixelRatio,ra=!1,mn={},Wa=function(Hr){},xa=function(){};if(typeof dr=="string"?_r=document.querySelector(dr):typeof dr=="object"&&(x(dr)?_r=dr:S(dr)?(yi=dr,ci=yi.canvas):("gl"in dr?yi=dr.gl:"canvas"in dr?ci=C(dr.canvas):"container"in dr&&(Kr=C(dr.container)),"attributes"in dr&&(si=dr.attributes),"extensions"in dr&&(Ni=M(dr.extensions)),"optionalExtensions"in dr&&(Ji=M(dr.optionalExtensions)),"onDone"in dr&&(Wa=dr.onDone),"profile"in dr&&(ra=!!dr.profile),"pixelRatio"in dr&&(Qi=+dr.pixelRatio),"cachedCode"in dr&&(mn=dr.cachedCode))),_r&&(_r.nodeName.toLowerCase()==="canvas"?ci=_r:Kr=_r),!yi){if(!ci){var Pi=_(Kr||document.body,Wa,Qi);if(!Pi)return null;ci=Pi.canvas,xa=Pi.onDestroy}si.premultipliedAlpha===void 0&&(si.premultipliedAlpha=!0),yi=v(ci,si)}return yi?{gl:yi,canvas:ci,container:Kr,extensions:Ni,optionalExtensions:Ji,pixelRatio:Qi,profile:ra,cachedCode:mn,onDone:Wa,onDestroy:xa}:(xa(),Wa("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function k(bt,dr){var _r={};function Kr(si){var Ni=si.toLowerCase(),Ji;try{Ji=_r[Ni]=bt.getExtension(Ni)}catch{}return!!Ji}for(var ci=0;ci65535)<<4,bt>>>=dr,_r=(bt>255)<<3,bt>>>=_r,dr|=_r,_r=(bt>15)<<2,bt>>>=_r,dr|=_r,_r=(bt>3)<<1,bt>>>=_r,dr|=_r,dr|bt>>1}function L(){var bt=A(8,function(){return[]});function dr(yi){var si=z(yi),Ni=bt[I(si)>>2];return Ni.length>0?Ni.pop():new ArrayBuffer(si)}function _r(yi){bt[I(yi.byteLength)>>2].push(yi)}function Kr(yi,si){var Ni=null;switch(yi){case b:Ni=new Int8Array(dr(si),0,si);break;case E:Ni=new Uint8Array(dr(si),0,si);break;case T:Ni=new Int16Array(dr(2*si),0,si);break;case F:Ni=new Uint16Array(dr(2*si),0,si);break;case D:Ni=new Int32Array(dr(4*si),0,si);break;case R:Ni=new Uint32Array(dr(4*si),0,si);break;case P:Ni=new Float32Array(dr(4*si),0,si);break;default:return null}return Ni.length!==si?Ni.subarray(0,si):Ni}function ci(yi){_r(yi.buffer)}return{alloc:dr,free:_r,allocType:Kr,freeType:ci}}var B=L();B.zero=L();var O=3408,G=3410,W=3411,X=3412,Z=3413,J=3414,N=3415,H=33901,$=33902,U=3379,V=3386,j=34921,q=36347,Y=36348,K=35661,te=35660,ne=34930,se=36349,le=34076,ce=34024,pe=7936,xe=7937,ye=7938,fe=35724,ae=34047,ee=36063,ie=34852,Q=3553,ue=34067,ge=34069,Me=33984,Te=6408,je=5126,Ve=5121,Ze=36160,Ke=36053,vt=36064,xt=16384,Pt=function(bt,dr){var _r=1;dr.ext_texture_filter_anisotropic&&(_r=bt.getParameter(ae));var Kr=1,ci=1;dr.webgl_draw_buffers&&(Kr=bt.getParameter(ie),ci=bt.getParameter(ee));var yi=!!dr.oes_texture_float;if(yi){var si=bt.createTexture();bt.bindTexture(Q,si),bt.texImage2D(Q,0,Te,1,1,0,Te,je,null);var Ni=bt.createFramebuffer();if(bt.bindFramebuffer(Ze,Ni),bt.framebufferTexture2D(Ze,vt,Q,si,0),bt.bindTexture(Q,null),bt.checkFramebufferStatus(Ze)!==Ke)yi=!1;else{bt.viewport(0,0,1,1),bt.clearColor(1,0,0,1),bt.clear(xt);var Ji=B.allocType(je,4);bt.readPixels(0,0,1,1,Te,je,Ji),bt.getError()?yi=!1:(bt.deleteFramebuffer(Ni),bt.deleteTexture(si),yi=Ji[0]===1),B.freeType(Ji)}}var Qi=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ra=!0;if(!Qi){var mn=bt.createTexture(),Wa=B.allocType(Ve,36);bt.activeTexture(Me),bt.bindTexture(ue,mn),bt.texImage2D(ge,0,Te,3,3,0,Te,Ve,Wa),B.freeType(Wa),bt.bindTexture(ue,null),bt.deleteTexture(mn),ra=!bt.getError()}return{colorBits:[bt.getParameter(G),bt.getParameter(W),bt.getParameter(X),bt.getParameter(Z)],depthBits:bt.getParameter(J),stencilBits:bt.getParameter(N),subpixelBits:bt.getParameter(O),extensions:Object.keys(dr).filter(function(xa){return!!dr[xa]}),maxAnisotropic:_r,maxDrawbuffers:Kr,maxColorAttachments:ci,pointSizeDims:bt.getParameter(H),lineWidthDims:bt.getParameter($),maxViewportDims:bt.getParameter(V),maxCombinedTextureUnits:bt.getParameter(K),maxCubeMapSize:bt.getParameter(le),maxRenderbufferSize:bt.getParameter(ce),maxTextureUnits:bt.getParameter(ne),maxTextureSize:bt.getParameter(U),maxAttributes:bt.getParameter(j),maxVertexUniforms:bt.getParameter(q),maxVertexTextureUnits:bt.getParameter(te),maxVaryingVectors:bt.getParameter(Y),maxFragmentUniforms:bt.getParameter(se),glsl:bt.getParameter(fe),renderer:bt.getParameter(xe),vendor:bt.getParameter(pe),version:bt.getParameter(ye),readFloat:yi,npotTextureCube:ra}},mt=function(bt){return bt instanceof Uint8Array||bt instanceof Uint16Array||bt instanceof Uint32Array||bt instanceof Int8Array||bt instanceof Int16Array||bt instanceof Int32Array||bt instanceof Float32Array||bt instanceof Float64Array||bt instanceof Uint8ClampedArray};function Mt(bt){return!!bt&&typeof bt=="object"&&Array.isArray(bt.shape)&&Array.isArray(bt.stride)&&typeof bt.offset=="number"&&bt.shape.length===bt.stride.length&&(Array.isArray(bt.data)||mt(bt.data))}var lt=function(bt){return Object.keys(bt).map(function(dr){return bt[dr]})},qe={shape:Ee,flatten:ke};function Ye(bt,dr,_r){for(var Kr=0;Kr0){var bn;if(Array.isArray(Ei[0])){wa=Ct(Ei);for(var ji=1,Ii=1;Ii0){if(typeof ji[0]=="number"){var ca=B.allocType(Ui.dtype,ji.length);Ai(ca,ji),wa(ca,Va),B.freeType(ca)}else if(Array.isArray(ji[0])||mt(ji[0])){_a=Ct(ji);var va=Lt(ji,_a,Ui.dtype);wa(va,Va),B.freeType(va)}}}else if(Mt(ji)){_a=ji.shape;var Ga=ji.stride,wn=0,Hn=0,Ca=0,en=0;_a.length===1?(wn=_a[0],Hn=1,Ca=Ga[0],en=0):_a.length===2&&(wn=_a[0],Hn=_a[1],Ca=Ga[0],en=Ga[1]);var Un=Array.isArray(ji.data)?Ui.dtype:Ur(ji.data),qn=B.allocType(Un,wn*Hn);oi(qn,ji.data,wn,Hn,Ca,en,ji.offset),wa(qn,Va),B.freeType(qn)}return Da}return Yi||Da(Hr),Da._reglType="buffer",Da._buffer=Ui,Da.subdata=bn,_r.profile&&(Da.stats=Ui.stats),Da.destroy=function(){Wa(Ui)},Da}function Pi(){lt(yi).forEach(function(Hr){Hr.buffer=bt.createBuffer(),bt.bindBuffer(Hr.type,Hr.buffer),bt.bufferData(Hr.type,Hr.persistentData||Hr.byteLength,Hr.usage)})}return _r.profile&&(dr.getTotalBufferSize=function(){var Hr=0;return Object.keys(yi).forEach(function(Ei){Hr+=yi[Ei].stats.size}),Hr}),{create:xa,createStream:Ji,destroyStream:Qi,clear:function(){lt(yi).forEach(Wa),Ni.forEach(Wa)},getBuffer:function(Hr){return Hr&&Hr._buffer instanceof si?Hr._buffer:null},restore:Pi,_initBuffer:mn}}var ea=0,$i=0,ja=1,ya=1,pa=4,xi=4,bi={points:ea,point:$i,lines:ja,line:ya,triangles:pa,triangle:xi,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ua=0,dn=1,pi=4,Jr=5120,Be=5121,Fe=5122,Et=5123,St=5124,zt=5125,Wt=34963,Yt=35040,ze=35044;function tt(bt,dr,_r,Kr){var ci={},yi=0,si={uint8:Be,uint16:Et};dr.oes_element_index_uint&&(si.uint32=zt);function Ni(Pi){this.id=yi++,ci[this.id]=this,this.buffer=Pi,this.primType=pi,this.vertCount=0,this.type=0}Ni.prototype.bind=function(){this.buffer.bind()};var Ji=[];function Qi(Pi){var Hr=Ji.pop();return Hr||(Hr=new Ni(_r.create(null,Wt,!0,!1)._buffer)),mn(Hr,Pi,Yt,-1,-1,0,0),Hr}function ra(Pi){Ji.push(Pi)}function mn(Pi,Hr,Ei,Yi,la,Ui,Da){Pi.buffer.bind();var wa;if(Hr){var bn=Da;!Da&&(!mt(Hr)||Mt(Hr)&&!mt(Hr.data))&&(bn=dr.oes_element_index_uint?zt:Et),_r._initBuffer(Pi.buffer,Hr,Ei,bn,3)}else bt.bufferData(Wt,Ui,Ei),Pi.buffer.dtype=wa||Be,Pi.buffer.usage=Ei,Pi.buffer.dimension=3,Pi.buffer.byteLength=Ui;if(wa=Da,!Da){switch(Pi.buffer.dtype){case Be:case Jr:wa=Be;break;case Et:case Fe:wa=Et;break;case zt:case St:wa=zt;break;default:}Pi.buffer.dtype=wa}Pi.type=wa;var ji=la;ji<0&&(ji=Pi.buffer.byteLength,wa===Et?ji>>=1:wa===zt&&(ji>>=2)),Pi.vertCount=ji;var Ii=Yi;if(Yi<0){Ii=pi;var Va=Pi.buffer.dimension;Va===1&&(Ii=Ua),Va===2&&(Ii=dn),Va===3&&(Ii=pi)}Pi.primType=Ii}function Wa(Pi){Kr.elementsCount--,delete ci[Pi.id],Pi.buffer.destroy(),Pi.buffer=null}function xa(Pi,Hr){var Ei=_r.create(null,Wt,!0),Yi=new Ni(Ei._buffer);Kr.elementsCount++;function la(Ui){if(!Ui)Ei(),Yi.primType=pi,Yi.vertCount=0,Yi.type=Be;else if(typeof Ui=="number")Ei(Ui),Yi.primType=pi,Yi.vertCount=Ui|0,Yi.type=Be;else{var Da=null,wa=ze,bn=-1,ji=-1,Ii=0,Va=0;Array.isArray(Ui)||mt(Ui)||Mt(Ui)?Da=Ui:("data"in Ui&&(Da=Ui.data),"usage"in Ui&&(wa=kt[Ui.usage]),"primitive"in Ui&&(bn=bi[Ui.primitive]),"count"in Ui&&(ji=Ui.count|0),"type"in Ui&&(Va=si[Ui.type]),"length"in Ui?Ii=Ui.length|0:(Ii=ji,Va===Et||Va===Fe?Ii*=2:(Va===zt||Va===St)&&(Ii*=4))),mn(Yi,Da,wa,bn,ji,Ii,Va)}return la}return la(Pi),la._reglType="elements",la._elements=Yi,la.subdata=function(Ui,Da){return Ei.subdata(Ui,Da),la},la.destroy=function(){Wa(Yi)},la}return{create:xa,createStream:Qi,destroyStream:ra,getElements:function(Pi){return typeof Pi=="function"&&Pi._elements instanceof Ni?Pi._elements:null},clear:function(){lt(ci).forEach(Wa)}}}var ct=new Float32Array(1),wt=new Uint32Array(ct.buffer),Nt=5123;function It(bt){for(var dr=B.allocType(Nt,bt.length),_r=0;_r>>31<<15,yi=(Kr<<1>>>24)-127,si=Kr>>13&1023;if(yi<-24)dr[_r]=ci;else if(yi<-14){var Ni=-14-yi;dr[_r]=ci+(si+1024>>Ni)}else yi>15?dr[_r]=ci+31744:dr[_r]=ci+(yi+15<<10)+si}return dr}function Zt(bt){return Array.isArray(bt)||mt(bt)}var qt=34467,vr=3553,Br=34067,Pr=34069,Mi=6408,gi=6406,ba=6407,Hi=6409,Za=6410,oa=32854,Cn=32855,_n=36194,Li=32819,In=32820,pn=33635,Ka=34042,Rn=6402,tn=34041,Mn=35904,Kn=35906,zn=36193,ua=33776,Ea=33777,ln=33778,on=33779,ao=35986,ho=35987,Jn=34798,lo=35840,Fo=35841,uo=35842,Qn=35843,jo=36196,Yn=5121,Bn=5123,ps=5125,xo=5126,no=10242,Mo=10243,Vn=10497,ts=33071,ws=33648,So=10240,nl=10241,vs=9728,go=9729,Xn=9984,On=9985,Uo=9986,kl=9987,mu=33170,Ul=4352,gu=4353,yu=4354,Fu=34046,au=3317,xc=37440,Pu=37441,Cl=37443,bc=37444,Iu=33984,_l=[Xn,Uo,On,kl],ms=[0,Hi,Za,ba,Mi],ss={};ss[Hi]=ss[gi]=ss[Rn]=1,ss[tn]=ss[Za]=2,ss[ba]=ss[Mn]=3,ss[Mi]=ss[Kn]=4;function fl(bt){return"[object "+bt+"]"}var wc=fl("HTMLCanvasElement"),Tc=fl("OffscreenCanvas"),tc=fl("CanvasRenderingContext2D"),wh=fl("ImageBitmap"),Th=fl("HTMLImageElement"),Rd=fl("HTMLVideoElement"),fp=Object.keys(De).concat([wc,Tc,tc,wh,Th,Rd]),Ru=[];Ru[Yn]=1,Ru[xo]=4,Ru[zn]=2,Ru[Bn]=2,Ru[ps]=4;var Ts=[];Ts[oa]=2,Ts[Cn]=2,Ts[_n]=2,Ts[tn]=4,Ts[ua]=.5,Ts[Ea]=.5,Ts[ln]=1,Ts[on]=1,Ts[ao]=.5,Ts[ho]=1,Ts[Jn]=1,Ts[lo]=.5,Ts[Fo]=.25,Ts[uo]=.5,Ts[Qn]=.25,Ts[jo]=.5;function Ah(bt){return Array.isArray(bt)&&(bt.length===0||typeof bt[0]=="number")}function vf(bt){if(!Array.isArray(bt))return!1;var dr=bt.length;return!(dr===0||!Zt(bt[0]))}function Ac(bt){return Object.prototype.toString.call(bt)}function Mh(bt){return Ac(bt)===wc}function Mc(bt){return Ac(bt)===Tc}function $c(bt){return Ac(bt)===tc}function zu(bt){return Ac(bt)===wh}function mf(bt){return Ac(bt)===Th}function jf(bt){return Ac(bt)===Rd}function Sc(bt){if(!bt)return!1;var dr=Ac(bt);return fp.indexOf(dr)>=0?!0:Ah(bt)||vf(bt)||Mt(bt)}function id(bt){return De[Object.prototype.toString.call(bt)]|0}function Uf(bt,dr){var _r=dr.length;switch(bt.type){case Yn:case Bn:case ps:case xo:var Kr=B.allocType(bt.type,_r);Kr.set(dr),bt.data=Kr;break;case zn:bt.data=It(dr);break;default:}}function zd(bt,dr){return B.allocType(bt.type===zn?xo:bt.type,dr)}function Bu(bt,dr){bt.type===zn?(bt.data=It(dr),B.freeType(dr)):bt.data=dr}function Sh(bt,dr,_r,Kr,ci,yi){for(var si=bt.width,Ni=bt.height,Ji=bt.channels,Qi=si*Ni*Ji,ra=zd(bt,Qi),mn=0,Wa=0;Wa=1;)Ni+=si*Ji*Ji,Ji/=2;return Ni}else return si*_r*Kr}function qf(bt,dr,_r,Kr,ci,yi,si){var Ni={"don't care":Ul,"dont care":Ul,nice:yu,fast:gu},Ji={repeat:Vn,clamp:ts,mirror:ws},Qi={nearest:vs,linear:go},ra=t({mipmap:kl,"nearest mipmap nearest":Xn,"linear mipmap nearest":On,"nearest mipmap linear":Uo,"linear mipmap linear":kl},Qi),mn={none:0,browser:bc},Wa={uint8:Yn,rgba4:Li,rgb565:pn,"rgb5 a1":In},xa={alpha:gi,luminance:Hi,"luminance alpha":Za,rgb:ba,rgba:Mi,rgba4:oa,"rgb5 a1":Cn,rgb565:_n},Pi={};dr.ext_srgb&&(xa.srgb=Mn,xa.srgba=Kn),dr.oes_texture_float&&(Wa.float32=Wa.float=xo),dr.oes_texture_half_float&&(Wa.float16=Wa["half float"]=zn),dr.webgl_depth_texture&&(t(xa,{depth:Rn,"depth stencil":tn}),t(Wa,{uint16:Bn,uint32:ps,"depth stencil":Ka})),dr.webgl_compressed_texture_s3tc&&t(Pi,{"rgb s3tc dxt1":ua,"rgba s3tc dxt1":Ea,"rgba s3tc dxt3":ln,"rgba s3tc dxt5":on}),dr.webgl_compressed_texture_atc&&t(Pi,{"rgb atc":ao,"rgba atc explicit alpha":ho,"rgba atc interpolated alpha":Jn}),dr.webgl_compressed_texture_pvrtc&&t(Pi,{"rgb pvrtc 4bppv1":lo,"rgb pvrtc 2bppv1":Fo,"rgba pvrtc 4bppv1":uo,"rgba pvrtc 2bppv1":Qn}),dr.webgl_compressed_texture_etc1&&(Pi["rgb etc1"]=jo);var Hr=Array.prototype.slice.call(bt.getParameter(qt));Object.keys(Pi).forEach(function(gr){var hi=Pi[gr];Hr.indexOf(hi)>=0&&(xa[gr]=hi)});var Ei=Object.keys(xa);_r.textureFormats=Ei;var Yi=[];Object.keys(xa).forEach(function(gr){var hi=xa[gr];Yi[hi]=gr});var la=[];Object.keys(Wa).forEach(function(gr){var hi=Wa[gr];la[hi]=gr});var Ui=[];Object.keys(Qi).forEach(function(gr){var hi=Qi[gr];Ui[hi]=gr});var Da=[];Object.keys(ra).forEach(function(gr){var hi=ra[gr];Da[hi]=gr});var wa=[];Object.keys(Ji).forEach(function(gr){var hi=Ji[gr];wa[hi]=gr});var bn=Ei.reduce(function(gr,hi){var di=xa[hi];return di===Hi||di===gi||di===Hi||di===Za||di===Rn||di===tn||dr.ext_srgb&&(di===Mn||di===Kn)?gr[di]=di:di===Cn||hi.indexOf("rgba")>=0?gr[di]=Mi:gr[di]=ba,gr},{});function ji(){this.internalformat=Mi,this.format=Mi,this.type=Yn,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bc,this.width=0,this.height=0,this.channels=0}function Ii(gr,hi){gr.internalformat=hi.internalformat,gr.format=hi.format,gr.type=hi.type,gr.compressed=hi.compressed,gr.premultiplyAlpha=hi.premultiplyAlpha,gr.flipY=hi.flipY,gr.unpackAlignment=hi.unpackAlignment,gr.colorSpace=hi.colorSpace,gr.width=hi.width,gr.height=hi.height,gr.channels=hi.channels}function Va(gr,hi){if(!(typeof hi!="object"||!hi)){if("premultiplyAlpha"in hi&&(gr.premultiplyAlpha=hi.premultiplyAlpha),"flipY"in hi&&(gr.flipY=hi.flipY),"alignment"in hi&&(gr.unpackAlignment=hi.alignment),"colorSpace"in hi&&(gr.colorSpace=mn[hi.colorSpace]),"type"in hi){var di=hi.type;gr.type=Wa[di]}var sn=gr.width,Io=gr.height,_s=gr.channels,an=!1;"shape"in hi?(sn=hi.shape[0],Io=hi.shape[1],hi.shape.length===3&&(_s=hi.shape[2],an=!0)):("radius"in hi&&(sn=Io=hi.radius),"width"in hi&&(sn=hi.width),"height"in hi&&(Io=hi.height),"channels"in hi&&(_s=hi.channels,an=!0)),gr.width=sn|0,gr.height=Io|0,gr.channels=_s|0;var cr=!1;if("format"in hi){var xr=hi.format,kr=gr.internalformat=xa[xr];gr.format=bn[kr],xr in Wa&&("type"in hi||(gr.type=Wa[xr])),xr in Pi&&(gr.compressed=!0),cr=!0}!an&&cr?gr.channels=ss[gr.format]:an&&!cr&&gr.channels!==ms[gr.format]&&(gr.format=gr.internalformat=ms[gr.channels])}}function _a(gr){bt.pixelStorei(xc,gr.flipY),bt.pixelStorei(Pu,gr.premultiplyAlpha),bt.pixelStorei(Cl,gr.colorSpace),bt.pixelStorei(au,gr.unpackAlignment)}function ca(){ji.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function va(gr,hi){var di=null;if(Sc(hi)?di=hi:hi&&(Va(gr,hi),"x"in hi&&(gr.xOffset=hi.x|0),"y"in hi&&(gr.yOffset=hi.y|0),Sc(hi.data)&&(di=hi.data)),hi.copy){var sn=ci.viewportWidth,Io=ci.viewportHeight;gr.width=gr.width||sn-gr.xOffset,gr.height=gr.height||Io-gr.yOffset,gr.needsCopy=!0}else if(!di)gr.width=gr.width||1,gr.height=gr.height||1,gr.channels=gr.channels||4;else if(mt(di))gr.channels=gr.channels||4,gr.data=di,!("type"in hi)&&gr.type===Yn&&(gr.type=id(di));else if(Ah(di))gr.channels=gr.channels||4,Uf(gr,di),gr.alignment=1,gr.needsFree=!0;else if(Mt(di)){var _s=di.data;!Array.isArray(_s)&&gr.type===Yn&&(gr.type=id(_s));var an=di.shape,cr=di.stride,xr,kr,fi,Ti,ve,be;an.length===3?(fi=an[2],be=cr[2]):(fi=1,be=1),xr=an[0],kr=an[1],Ti=cr[0],ve=cr[1],gr.alignment=1,gr.width=xr,gr.height=kr,gr.channels=fi,gr.format=gr.internalformat=ms[fi],gr.needsFree=!0,Sh(gr,_s,Ti,ve,be,di.offset)}else if(Mh(di)||Mc(di)||$c(di))Mh(di)||Mc(di)?gr.element=di:gr.element=di.canvas,gr.width=gr.element.width,gr.height=gr.element.height,gr.channels=4;else if(zu(di))gr.element=di,gr.width=di.width,gr.height=di.height,gr.channels=4;else if(mf(di))gr.element=di,gr.width=di.naturalWidth,gr.height=di.naturalHeight,gr.channels=4;else if(jf(di))gr.element=di,gr.width=di.videoWidth,gr.height=di.videoHeight,gr.channels=4;else if(vf(di)){var Ce=gr.width||di[0].length,He=gr.height||di.length,Xe=gr.channels;Zt(di[0][0])?Xe=Xe||di[0][0].length:Xe=Xe||1;for(var it=qe.shape(di),Dt=1,or=0;or>=Io,di.height>>=Io,va(di,sn[Io]),gr.mipmask|=1<=0&&!("faces"in hi)&&(gr.genMipmaps=!0)}if("mag"in hi){var sn=hi.mag;gr.magFilter=Qi[sn]}var Io=gr.wrapS,_s=gr.wrapT;if("wrap"in hi){var an=hi.wrap;typeof an=="string"?Io=_s=Ji[an]:Array.isArray(an)&&(Io=Ji[an[0]],_s=Ji[an[1]])}else{if("wrapS"in hi){var cr=hi.wrapS;Io=Ji[cr]}if("wrapT"in hi){var xr=hi.wrapT;_s=Ji[xr]}}if(gr.wrapS=Io,gr.wrapT=_s,"anisotropic"in hi){var kr=hi.anisotropic;gr.anisotropic=hi.anisotropic}if("mipmap"in hi){var fi=!1;switch(typeof hi.mipmap){case"string":gr.mipmapHint=Ni[hi.mipmap],gr.genMipmaps=!0,fi=!0;break;case"boolean":fi=gr.genMipmaps=hi.mipmap;break;case"object":gr.genMipmaps=!1,fi=!0;break;default:}fi&&!("min"in hi)&&(gr.minFilter=Xn)}}function lc(gr,hi){bt.texParameteri(hi,nl,gr.minFilter),bt.texParameteri(hi,So,gr.magFilter),bt.texParameteri(hi,no,gr.wrapS),bt.texParameteri(hi,Mo,gr.wrapT),dr.ext_texture_filter_anisotropic&&bt.texParameteri(hi,Fu,gr.anisotropic),gr.genMipmaps&&(bt.hint(mu,gr.mipmapHint),bt.generateMipmap(hi))}var zc=0,Pl={},Il=_r.maxTextureUnits,Yl=Array(Il).map(function(){return null});function oo(gr){ji.call(this),this.mipmask=0,this.internalformat=Mi,this.id=zc++,this.refCount=1,this.target=gr,this.texture=bt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new ys,si.profile&&(this.stats={size:0})}function lu(gr){bt.activeTexture(Iu),bt.bindTexture(gr.target,gr.texture)}function Ms(){var gr=Yl[0];gr?bt.bindTexture(gr.target,gr.texture):bt.bindTexture(vr,null)}function uc(gr){var hi=gr.texture,di=gr.unit,sn=gr.target;di>=0&&(bt.activeTexture(Iu+di),bt.bindTexture(sn,null),Yl[di]=null),bt.deleteTexture(hi),gr.texture=null,gr.params=null,gr.pixels=null,gr.refCount=0,delete Pl[gr.id],yi.textureCount--}t(oo.prototype,{bind:function(){var gr=this;gr.bindCount+=1;var hi=gr.unit;if(hi<0){for(var di=0;di0)continue;sn.unit=-1}Yl[di]=gr,hi=di;break}hi>=Il,si.profile&&yi.maxTextureUnits>ve)-fi,be.height=be.height||(di.height>>ve)-Ti,lu(di),wn(be,vr,fi,Ti,ve),Ms(),en(be),sn}function _s(an,cr){var xr=an|0,kr=cr|0||xr;if(xr===di.width&&kr===di.height)return sn;sn.width=di.width=xr,sn.height=di.height=kr,lu(di);for(var fi=0;di.mipmask>>fi;++fi){var Ti=xr>>fi,ve=kr>>fi;if(!Ti||!ve)break;bt.texImage2D(vr,fi,di.format,Ti,ve,0,di.format,di.type,null)}return Ms(),si.profile&&(di.stats.size=_u(di.internalformat,di.type,xr,kr,!1,!1)),sn}return sn(gr,hi),sn.subimage=Io,sn.resize=_s,sn._reglType="texture2d",sn._texture=di,si.profile&&(sn.stats=di.stats),sn.destroy=function(){di.decRef()},sn}function Oc(gr,hi,di,sn,Io,_s){var an=new oo(Br);Pl[an.id]=an,yi.cubeCount++;var cr=new Array(6);function xr(Ti,ve,be,Ce,He,Xe){var it,Dt=an.texInfo;for(ys.call(Dt),it=0;it<6;++it)cr[it]=Co();if(typeof Ti=="number"||!Ti){var or=Ti|0||1;for(it=0;it<6;++it)qn(cr[it],or,or)}else if(typeof Ti=="object")if(ve)yo(cr[0],Ti),yo(cr[1],ve),yo(cr[2],be),yo(cr[3],Ce),yo(cr[4],He),yo(cr[5],Xe);else if(Hu(Dt,Ti),Va(an,Ti),"faces"in Ti){var Dr=Ti.faces;for(it=0;it<6;++it)Ii(cr[it],an),yo(cr[it],Dr[it])}else for(it=0;it<6;++it)yo(cr[it],Ti);for(Ii(an,cr[0]),Dt.genMipmaps?an.mipmask=(cr[0].width<<1)-1:an.mipmask=cr[0].mipmask,an.internalformat=cr[0].internalformat,xr.width=cr[0].width,xr.height=cr[0].height,lu(an),it=0;it<6;++it)Gs(cr[it],Pr+it);for(lc(Dt,Br),Ms(),si.profile&&(an.stats.size=_u(an.internalformat,an.type,xr.width,xr.height,Dt.genMipmaps,!0)),xr.format=Yi[an.internalformat],xr.type=la[an.type],xr.mag=Ui[Dt.magFilter],xr.min=Da[Dt.minFilter],xr.wrapS=wa[Dt.wrapS],xr.wrapT=wa[Dt.wrapT],it=0;it<6;++it)Rc(cr[it]);return xr}function kr(Ti,ve,be,Ce,He){var Xe=be|0,it=Ce|0,Dt=He|0,or=Ca();return Ii(or,an),or.width=0,or.height=0,va(or,ve),or.width=or.width||(an.width>>Dt)-Xe,or.height=or.height||(an.height>>Dt)-it,lu(an),wn(or,Pr+Ti,Xe,it,Dt),Ms(),en(or),xr}function fi(Ti){var ve=Ti|0;if(ve!==an.width){xr.width=an.width=ve,xr.height=an.height=ve,lu(an);for(var be=0;be<6;++be)for(var Ce=0;an.mipmask>>Ce;++Ce)bt.texImage2D(Pr+be,Ce,an.format,ve>>Ce,ve>>Ce,0,an.format,an.type,null);return Ms(),si.profile&&(an.stats.size=_u(an.internalformat,an.type,xr.width,xr.height,!1,!0)),xr}}return xr(gr,hi,di,sn,Io,_s),xr.subimage=kr,xr.resize=fi,xr._reglType="textureCube",xr._texture=an,si.profile&&(xr.stats=an.stats),xr.destroy=function(){an.decRef()},xr}function Zn(){for(var gr=0;gr>sn,di.height>>sn,0,di.internalformat,di.type,null);else for(var Io=0;Io<6;++Io)bt.texImage2D(Pr+Io,sn,di.internalformat,di.width>>sn,di.height>>sn,0,di.internalformat,di.type,null);lc(di.texInfo,di.target)})}function Bs(){for(var gr=0;gr=0?Rc=!0:Ji.indexOf(ys)>=0&&(Rc=!1))),("depthTexture"in oo||"depthStencilTexture"in oo)&&(Yl=!!(oo.depthTexture||oo.depthStencilTexture)),"depth"in oo&&(typeof oo.depth=="boolean"?Gs=oo.depth:(zc=oo.depth,Wl=!1)),"stencil"in oo&&(typeof oo.stencil=="boolean"?Wl=oo.stencil:(Pl=oo.stencil,Gs=!1)),"depthStencil"in oo&&(typeof oo.depthStencil=="boolean"?Gs=Wl=oo.depthStencil:(Il=oo.depthStencil,Gs=!1,Wl=!1))}var Ms=null,uc=null,Bc=null,Oc=null;if(Array.isArray(Co))Ms=Co.map(Pi);else if(Co)Ms=[Pi(Co)];else for(Ms=new Array(lc),Un=0;Un0&&(en.depth=va[0].depth,en.stencil=va[0].stencil,en.depthStencil=va[0].depthStencil),va[Ca]?va[Ca](en):va[Ca]=Ii(en)}return t(Ga,{width:Un,height:Un,color:ys})}function wn(Hn){var Ca,en=Hn|0;if(en===Ga.width)return Ga;var Un=Ga.color;for(Ca=0;Ca=Un.byteLength?qn.subdata(Un):(qn.destroy(),Ii.buffers[Hn]=null)),Ii.buffers[Hn]||(qn=Ii.buffers[Hn]=ci.create(Ca,Yc,!1,!0)),en.buffer=ci.getBuffer(qn),en.size=en.buffer.dimension|0,en.normalized=!1,en.type=en.buffer.dtype,en.offset=0,en.stride=0,en.divisor=0,en.state=1,Ga[Hn]=1}else ci.getBuffer(Ca)?(en.buffer=ci.getBuffer(Ca),en.size=en.buffer.dimension|0,en.normalized=!1,en.type=en.buffer.dtype,en.offset=0,en.stride=0,en.divisor=0,en.state=1):ci.getBuffer(Ca.buffer)?(en.buffer=ci.getBuffer(Ca.buffer),en.size=(+Ca.size||en.buffer.dimension)|0,en.normalized=!!Ca.normalized||!1,"type"in Ca?en.type=fr[Ca.type]:en.type=en.buffer.dtype,en.offset=(Ca.offset||0)|0,en.stride=(Ca.stride||0)|0,en.divisor=(Ca.divisor||0)|0,en.state=1):"x"in Ca&&(en.x=+Ca.x||0,en.y=+Ca.y||0,en.z=+Ca.z||0,en.w=+Ca.w||0,en.state=2)}for(var yo=0;yo1)for(var _a=0;_aHr&&(Hr=Ei.stats.uniformsCount)}),Hr},_r.getMaxAttributesCount=function(){var Hr=0;return ra.forEach(function(Ei){Ei.stats.attributesCount>Hr&&(Hr=Ei.stats.attributesCount)}),Hr});function Pi(){ci={},yi={};for(var Hr=0;Hr16&&(_r=$r(_r,bt.length*8));for(var Kr=Array(16),ci=Array(16),yi=0;yi<16;yi++)Kr[yi]=_r[yi]^909522486,ci[yi]=_r[yi]^1549556828;var si=$r(Kr.concat(Af(dr)),512+dr.length*8);return nt($r(ci.concat(si),768))}function ou(bt){for(var dr=Ud?"0123456789ABCDEF":"0123456789abcdef",_r="",Kr,ci=0;ci>>4&15)+dr.charAt(Kr&15);return _r}function Kf(bt){for(var dr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_r="",Kr=bt.length,ci=0;cibt.length*8?_r+=Zf:_r+=dr.charAt(yi>>>6*(3-si)&63);return _r}function Lh(bt,dr){var _r=dr.length,Kr=Array(),ci,yi,si,Ni,Ji=Array(Math.ceil(bt.length/2));for(ci=0;ci0;){for(Ni=Array(),si=0,ci=0;ci0||yi>0)&&(Ni[Ni.length]=yi);Kr[Kr.length]=si,Ji=Ni}var Qi="";for(ci=Kr.length-1;ci>=0;ci--)Qi+=dr.charAt(Kr[ci]);var ra=Math.ceil(bt.length*8/(Math.log(dr.length)/Math.log(2)));for(ci=Qi.length;ci>>6&31,128|Kr&63):Kr<=65535?dr+=String.fromCharCode(224|Kr>>>12&15,128|Kr>>>6&63,128|Kr&63):Kr<=2097151&&(dr+=String.fromCharCode(240|Kr>>>18&7,128|Kr>>>12&63,128|Kr>>>6&63,128|Kr&63));return dr}function Af(bt){for(var dr=Array(bt.length>>2),_r=0;_r>5]|=(bt.charCodeAt(_r/8)&255)<<24-_r%32;return dr}function nt(bt){for(var dr="",_r=0;_r>5]>>>24-_r%32&255);return dr}function Tt(bt,dr){return bt>>>dr|bt<<32-dr}function Kt(bt,dr){return bt>>>dr}function Bt(bt,dr,_r){return bt&dr^~bt&_r}function yr(bt,dr,_r){return bt&dr^bt&_r^dr&_r}function zr(bt){return Tt(bt,2)^Tt(bt,13)^Tt(bt,22)}function Gr(bt){return Tt(bt,6)^Tt(bt,11)^Tt(bt,25)}function ii(bt){return Tt(bt,7)^Tt(bt,18)^Kt(bt,3)}function li(bt){return Tt(bt,17)^Tt(bt,19)^Kt(bt,10)}var Fi=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function $r(bt,dr){var _r=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Kr=new Array(64),ci,yi,si,Ni,Ji,Qi,ra,mn,Wa,xa,Pi,Hr;for(bt[dr>>5]|=128<<24-dr%32,bt[(dr+64>>9<<4)+15]=dr,Wa=0;Wa>16)+(dr>>16)+(_r>>16);return Kr<<16|_r&65535}function ui(bt){return Array.prototype.slice.call(bt)}function Di(bt){return ui(bt).join("")}function Wi(bt){var dr=bt&&bt.cache,_r=0,Kr=[],ci=[],yi=[];function si(Pi,Hr){var Ei=Hr&&Hr.stable;if(!Ei){for(var Yi=0;Yi0&&(Pi.push(la,"="),Pi.push.apply(Pi,ui(arguments)),Pi.push(";")),la}return t(Hr,{def:Yi,toString:function(){return Di([Ei.length>0?"var "+Ei.join(",")+";":"",Di(Pi)])}})}function Ji(){var Pi=Ni(),Hr=Ni(),Ei=Pi.toString,Yi=Hr.toString;function la(Ui,Da){Hr(Ui,Da,"=",Pi.def(Ui,Da),";")}return t(function(){Pi.apply(Pi,ui(arguments))},{def:Pi.def,entry:Pi,exit:Hr,save:la,set:function(Ui,Da,wa){la(Ui,Da),Pi(Ui,Da,"=",wa,";")},toString:function(){return Ei()+Yi()}})}function Qi(){var Pi=Di(arguments),Hr=Ji(),Ei=Ji(),Yi=Hr.toString,la=Ei.toString;return t(Hr,{then:function(){return Hr.apply(Hr,ui(arguments)),this},else:function(){return Ei.apply(Ei,ui(arguments)),this},toString:function(){var Ui=la();return Ui&&(Ui="else{"+Ui+"}"),Di(["if(",Pi,"){",Yi(),"}",Ui])}})}var ra=Ni(),mn={};function Wa(Pi,Hr){var Ei=[];function Yi(){var bn="a"+Ei.length;return Ei.push(bn),bn}Hr=Hr||0;for(var la=0;la[T.viewport.x,T.viewport.y,E.viewportWidth,E.viewportHeight]},attributes:{color:{buffer:_,offset:(E,T)=>T.offset*4,divisor:1},position:{buffer:m,offset:(E,T)=>T.offset*8,divisor:1},positionFract:{buffer:y,offset:(E,T)=>T.offset*8,divisor:1},error:{buffer:v,offset:(E,T)=>T.offset*16,divisor:1},direction:{buffer:x,stride:24,offset:0},lineOffset:{buffer:x,stride:24,offset:8},capOffset:{buffer:x,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:h.prop("viewport")},viewport:h.prop("viewport"),stencil:!1,instances:h.prop("count"),count:c.length}),s(C,{update:A,draw:w,destroy:b,regl:h,gl:p,canvas:p.canvas,groups:M}),C;function C(E){E?A(E):E===null&&b(),w()}function w(E){if(typeof E=="number")return k(E);E&&!Array.isArray(E)&&(E=[E]),h._refresh(),M.forEach((T,F)=>{if(T){if(E&&(E[F]?T.draw=!0:T.draw=!1),!T.draw){T.draw=!0;return}k(F)}})}function k(E){typeof E=="number"&&(E=M[E]),E!=null&&E&&E.count&&E.color&&E.opacity&&E.positions&&E.positions.length>1&&(E.scaleRatio=[E.scale[0]*E.viewport.width,E.scale[1]*E.viewport.height],g(E),E.after&&E.after(E))}function A(E){if(!E)return;E.length!=null?typeof E[0]=="number"&&(E=[{positions:E}]):Array.isArray(E)||(E=[E]);let T=0,F=0;if(C.groups=M=E.map((P,z)=>{let I=M[z];if(P)typeof P=="function"?P={after:P}:typeof P[0]=="number"&&(P={positions:P});else return I;return P=o(P,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),I||(M[z]=I={id:z,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},P=s({},S,P)),a(I,P,[{lineWidth:L=>+L*.5,capSize:L=>+L*.5,opacity:parseFloat,errors:L=>(L=l(L),F+=L.length,L),positions:(L,B)=>(L=l(L,"float64"),B.count=Math.floor(L.length/2),B.bounds=t(L,2),B.offset=T,T+=B.count,L)},{color:(L,B)=>{let O=B.count;if(L||(L="transparent"),!Array.isArray(L)||typeof L[0]=="number"){let W=L;L=Array(O);for(let X=0;X{let G=B.bounds;return L||(L=G),B.scale=[1/(L[2]-L[0]),1/(L[3]-L[1])],B.translate=[-L[0],-L[1]],B.scaleFract=u(B.scale),B.translateFract=u(B.translate),L},viewport:L=>{let B;return Array.isArray(L)?B={x:L[0],y:L[1],width:L[2]-L[0],height:L[3]-L[1]}:L?(B={x:L.x||L.left||0,y:L.y||L.top||0},L.right?B.width=L.right-B.x:B.width=L.w||L.width||0,L.bottom?B.height=L.bottom-B.y:B.height=L.h||L.height||0):B={x:0,y:0,width:p.drawingBufferWidth,height:p.drawingBufferHeight},B}}]),I}),T||F){let P=M.reduce((B,O,G)=>B+(O?O.count:0),0),z=new Float64Array(P*2),I=new Uint8Array(P*4),L=new Float32Array(P*4);M.forEach((B,O)=>{if(!B)return;let{positions:G,count:W,offset:X,color:Z,errors:J}=B;W&&(I.set(Z,X*4),L.set(J,X*4),z.set(G,X*2))});var D=n(z);m(D);var R=u(z,D);y(R),_(I),v(L)}}function b(){m.destroy(),y.destroy(),_.destroy(),v.destroy(),x.destroy()}}}}),kZ=de({"node_modules/unquote/index.js"(e,r){var t=/[\'\"]/;r.exports=function(a){return a?(t.test(a.charAt(0))&&(a=a.substr(1)),t.test(a.charAt(a.length-1))&&(a=a.substr(0,a.length-1)),a):""}}}),j7=de({"node_modules/css-global-keywords/index.json"(e,r){r.exports=["inherit","initial","unset"]}}),U7=de({"node_modules/css-system-font-keywords/index.json"(e,r){r.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),q7=de({"node_modules/css-font-weight-keywords/index.json"(e,r){r.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),V7=de({"node_modules/css-font-style-keywords/index.json"(e,r){r.exports=["normal","italic","oblique"]}}),G7=de({"node_modules/css-font-stretch-keywords/index.json"(e,r){r.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),CZ=de({"node_modules/parenthesis/index.js"(e,r){"use strict";function t(o,s){if(typeof o!="string")return[o];var l=[o];typeof s=="string"||Array.isArray(s)?s={brackets:s}:s||(s={});var n=s.brackets?Array.isArray(s.brackets)?s.brackets:[s.brackets]:["{}","[]","()"],u=s.escape||"___",c=!!s.flat;n.forEach(function(d){var p=new RegExp(["\\",d[0],"[^\\",d[0],"\\",d[1],"]*\\",d[1]].join("")),g=[];function m(y,_,v){var x=l.push(y.slice(d[0].length,-d[1].length))-1;return g.push(x),u+x+u}l.forEach(function(y,_){for(var v,x=0;y!=v;)if(v=y,y=y.replace(p,m),x++>1e4)throw Error("References have circular dependency. Please, check them.");l[_]=y}),g=g.reverse(),l=l.map(function(y){return g.forEach(function(_){y=y.replace(new RegExp("(\\"+u+_+"\\"+u+")","g"),d[0]+"$1"+d[1])}),y})});var f=new RegExp("\\"+u+"([0-9]+)\\"+u);function h(d,p,g){for(var m=[],y,_=0;y=f.exec(d);){if(_++>1e4)throw Error("Circular references in parenthesis");m.push(d.slice(0,y.index)),m.push(h(p[y[1]],p)),d=d.slice(y.index+y[0].length)}return m.push(d),m}return c?l:h(l[0],l)}function i(o,s){if(s&&s.flat){var l=s&&s.escape||"___",n=o[0],u;if(!n)return"";for(var c=new RegExp("\\"+l+"([0-9]+)\\"+l),f=0;n!=u;){if(f++>1e4)throw Error("Circular references in "+o);u=n,n=n.replace(c,h)}return n}return o.reduce(function d(p,g){return Array.isArray(g)&&(g=g.reduce(d,"")),p+g},"");function h(d,p){if(o[p]==null)throw Error("Reference "+p+"is undefined");return o[p]}}function a(o,s){return Array.isArray(o)?i(o,s):t(o,s)}a.parse=t,a.stringify=i,r.exports=a}}),DZ=de({"node_modules/string-split-by/index.js"(e,r){"use strict";var t=CZ();r.exports=function(a,o,s){if(a==null)throw Error("First argument should be a string");if(o==null)throw Error("Separator should be a string or a RegExp");s?(typeof s=="string"||Array.isArray(s))&&(s={ignore:s}):s={},s.escape==null&&(s.escape=!0),s.ignore==null?s.ignore=["[]","()","{}","<>",'""',"''","``","\u201C\u201D","\xAB\xBB"]:(typeof s.ignore=="string"&&(s.ignore=[s.ignore]),s.ignore=s.ignore.map(function(p){return p.length===1&&(p=p+p),p}));var l=t.parse(a,{flat:!0,brackets:s.ignore}),n=l[0],u=n.split(o);if(s.escape){for(var c=[],f=0;f1&&dr===_r&&(dr==='"'||dr==="'"))return['"'+n(bt.substr(1,bt.length-2))+'"'];var Kr=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(bt);if(Kr)return u(bt.substr(0,Kr.index)).concat(u(Kr[1])).concat(u(bt.substr(Kr.index+Kr[0].length)));var ci=bt.split(".");if(ci.length===1)return['"'+n(bt)+'"'];for(var yi=[],si=0;si"u"?1:window.devicePixelRatio,ra=!1,mn={},Wa=function(Hr){},xa=function(){};if(typeof dr=="string"?_r=document.querySelector(dr):typeof dr=="object"&&(x(dr)?_r=dr:S(dr)?(yi=dr,ci=yi.canvas):("gl"in dr?yi=dr.gl:"canvas"in dr?ci=C(dr.canvas):"container"in dr&&(Kr=C(dr.container)),"attributes"in dr&&(si=dr.attributes),"extensions"in dr&&(Ni=M(dr.extensions)),"optionalExtensions"in dr&&(Ji=M(dr.optionalExtensions)),"onDone"in dr&&(Wa=dr.onDone),"profile"in dr&&(ra=!!dr.profile),"pixelRatio"in dr&&(Qi=+dr.pixelRatio),"cachedCode"in dr&&(mn=dr.cachedCode))),_r&&(_r.nodeName.toLowerCase()==="canvas"?ci=_r:Kr=_r),!yi){if(!ci){var Pi=_(Kr||document.body,Wa,Qi);if(!Pi)return null;ci=Pi.canvas,xa=Pi.onDestroy}si.premultipliedAlpha===void 0&&(si.premultipliedAlpha=!0),yi=v(ci,si)}return yi?{gl:yi,canvas:ci,container:Kr,extensions:Ni,optionalExtensions:Ji,pixelRatio:Qi,profile:ra,cachedCode:mn,onDone:Wa,onDestroy:xa}:(xa(),Wa("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function k(bt,dr){var _r={};function Kr(si){var Ni=si.toLowerCase(),Ji;try{Ji=_r[Ni]=bt.getExtension(Ni)}catch{}return!!Ji}for(var ci=0;ci65535)<<4,bt>>>=dr,_r=(bt>255)<<3,bt>>>=_r,dr|=_r,_r=(bt>15)<<2,bt>>>=_r,dr|=_r,_r=(bt>3)<<1,bt>>>=_r,dr|=_r,dr|bt>>1}function L(){var bt=A(8,function(){return[]});function dr(yi){var si=z(yi),Ni=bt[I(si)>>2];return Ni.length>0?Ni.pop():new ArrayBuffer(si)}function _r(yi){bt[I(yi.byteLength)>>2].push(yi)}function Kr(yi,si){var Ni=null;switch(yi){case b:Ni=new Int8Array(dr(si),0,si);break;case E:Ni=new Uint8Array(dr(si),0,si);break;case T:Ni=new Int16Array(dr(2*si),0,si);break;case F:Ni=new Uint16Array(dr(2*si),0,si);break;case D:Ni=new Int32Array(dr(4*si),0,si);break;case R:Ni=new Uint32Array(dr(4*si),0,si);break;case P:Ni=new Float32Array(dr(4*si),0,si);break;default:return null}return Ni.length!==si?Ni.subarray(0,si):Ni}function ci(yi){_r(yi.buffer)}return{alloc:dr,free:_r,allocType:Kr,freeType:ci}}var B=L();B.zero=L();var O=3408,G=3410,W=3411,X=3412,Z=3413,J=3414,N=3415,H=33901,$=33902,U=3379,V=3386,j=34921,q=36347,Y=36348,K=35661,te=35660,ne=34930,se=36349,le=34076,ce=34024,pe=7936,xe=7937,ye=7938,fe=35724,ae=34047,ee=36063,ie=34852,Q=3553,ue=34067,ge=34069,Me=33984,Te=6408,je=5126,Ve=5121,Ke=36160,Je=36053,vt=36064,xt=16384,Pt=function(bt,dr){var _r=1;dr.ext_texture_filter_anisotropic&&(_r=bt.getParameter(ae));var Kr=1,ci=1;dr.webgl_draw_buffers&&(Kr=bt.getParameter(ie),ci=bt.getParameter(ee));var yi=!!dr.oes_texture_float;if(yi){var si=bt.createTexture();bt.bindTexture(Q,si),bt.texImage2D(Q,0,Te,1,1,0,Te,je,null);var Ni=bt.createFramebuffer();if(bt.bindFramebuffer(Ke,Ni),bt.framebufferTexture2D(Ke,vt,Q,si,0),bt.bindTexture(Q,null),bt.checkFramebufferStatus(Ke)!==Je)yi=!1;else{bt.viewport(0,0,1,1),bt.clearColor(1,0,0,1),bt.clear(xt);var Ji=B.allocType(je,4);bt.readPixels(0,0,1,1,Te,je,Ji),bt.getError()?yi=!1:(bt.deleteFramebuffer(Ni),bt.deleteTexture(si),yi=Ji[0]===1),B.freeType(Ji)}}var Qi=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ra=!0;if(!Qi){var mn=bt.createTexture(),Wa=B.allocType(Ve,36);bt.activeTexture(Me),bt.bindTexture(ue,mn),bt.texImage2D(ge,0,Te,3,3,0,Te,Ve,Wa),B.freeType(Wa),bt.bindTexture(ue,null),bt.deleteTexture(mn),ra=!bt.getError()}return{colorBits:[bt.getParameter(G),bt.getParameter(W),bt.getParameter(X),bt.getParameter(Z)],depthBits:bt.getParameter(J),stencilBits:bt.getParameter(N),subpixelBits:bt.getParameter(O),extensions:Object.keys(dr).filter(function(xa){return!!dr[xa]}),maxAnisotropic:_r,maxDrawbuffers:Kr,maxColorAttachments:ci,pointSizeDims:bt.getParameter(H),lineWidthDims:bt.getParameter($),maxViewportDims:bt.getParameter(V),maxCombinedTextureUnits:bt.getParameter(K),maxCubeMapSize:bt.getParameter(le),maxRenderbufferSize:bt.getParameter(ce),maxTextureUnits:bt.getParameter(ne),maxTextureSize:bt.getParameter(U),maxAttributes:bt.getParameter(j),maxVertexUniforms:bt.getParameter(q),maxVertexTextureUnits:bt.getParameter(te),maxVaryingVectors:bt.getParameter(Y),maxFragmentUniforms:bt.getParameter(se),glsl:bt.getParameter(fe),renderer:bt.getParameter(xe),vendor:bt.getParameter(pe),version:bt.getParameter(ye),readFloat:yi,npotTextureCube:ra}},mt=function(bt){return bt instanceof Uint8Array||bt instanceof Uint16Array||bt instanceof Uint32Array||bt instanceof Int8Array||bt instanceof Int16Array||bt instanceof Int32Array||bt instanceof Float32Array||bt instanceof Float64Array||bt instanceof Uint8ClampedArray};function Mt(bt){return!!bt&&typeof bt=="object"&&Array.isArray(bt.shape)&&Array.isArray(bt.stride)&&typeof bt.offset=="number"&&bt.shape.length===bt.stride.length&&(Array.isArray(bt.data)||mt(bt.data))}var lt=function(bt){return Object.keys(bt).map(function(dr){return bt[dr]})},qe={shape:Ee,flatten:ke};function Ye(bt,dr,_r){for(var Kr=0;Kr0){var bn;if(Array.isArray(Ei[0])){wa=Ct(Ei);for(var ji=1,Ii=1;Ii0){if(typeof ji[0]=="number"){var ca=B.allocType(Ui.dtype,ji.length);Ai(ca,ji),wa(ca,Va),B.freeType(ca)}else if(Array.isArray(ji[0])||mt(ji[0])){_a=Ct(ji);var va=Lt(ji,_a,Ui.dtype);wa(va,Va),B.freeType(va)}}}else if(Mt(ji)){_a=ji.shape;var Ga=ji.stride,wn=0,Hn=0,Ca=0,en=0;_a.length===1?(wn=_a[0],Hn=1,Ca=Ga[0],en=0):_a.length===2&&(wn=_a[0],Hn=_a[1],Ca=Ga[0],en=Ga[1]);var Un=Array.isArray(ji.data)?Ui.dtype:Ur(ji.data),qn=B.allocType(Un,wn*Hn);oi(qn,ji.data,wn,Hn,Ca,en,ji.offset),wa(qn,Va),B.freeType(qn)}return Da}return Yi||Da(Hr),Da._reglType="buffer",Da._buffer=Ui,Da.subdata=bn,_r.profile&&(Da.stats=Ui.stats),Da.destroy=function(){Wa(Ui)},Da}function Pi(){lt(yi).forEach(function(Hr){Hr.buffer=bt.createBuffer(),bt.bindBuffer(Hr.type,Hr.buffer),bt.bufferData(Hr.type,Hr.persistentData||Hr.byteLength,Hr.usage)})}return _r.profile&&(dr.getTotalBufferSize=function(){var Hr=0;return Object.keys(yi).forEach(function(Ei){Hr+=yi[Ei].stats.size}),Hr}),{create:xa,createStream:Ji,destroyStream:Qi,clear:function(){lt(yi).forEach(Wa),Ni.forEach(Wa)},getBuffer:function(Hr){return Hr&&Hr._buffer instanceof si?Hr._buffer:null},restore:Pi,_initBuffer:mn}}var ea=0,$i=0,ja=1,ya=1,pa=4,xi=4,bi={points:ea,point:$i,lines:ja,line:ya,triangles:pa,triangle:xi,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ua=0,dn=1,pi=4,Jr=5120,Be=5121,Fe=5122,Et=5123,St=5124,zt=5125,Wt=34963,Yt=35040,ze=35044;function tt(bt,dr,_r,Kr){var ci={},yi=0,si={uint8:Be,uint16:Et};dr.oes_element_index_uint&&(si.uint32=zt);function Ni(Pi){this.id=yi++,ci[this.id]=this,this.buffer=Pi,this.primType=pi,this.vertCount=0,this.type=0}Ni.prototype.bind=function(){this.buffer.bind()};var Ji=[];function Qi(Pi){var Hr=Ji.pop();return Hr||(Hr=new Ni(_r.create(null,Wt,!0,!1)._buffer)),mn(Hr,Pi,Yt,-1,-1,0,0),Hr}function ra(Pi){Ji.push(Pi)}function mn(Pi,Hr,Ei,Yi,la,Ui,Da){Pi.buffer.bind();var wa;if(Hr){var bn=Da;!Da&&(!mt(Hr)||Mt(Hr)&&!mt(Hr.data))&&(bn=dr.oes_element_index_uint?zt:Et),_r._initBuffer(Pi.buffer,Hr,Ei,bn,3)}else bt.bufferData(Wt,Ui,Ei),Pi.buffer.dtype=wa||Be,Pi.buffer.usage=Ei,Pi.buffer.dimension=3,Pi.buffer.byteLength=Ui;if(wa=Da,!Da){switch(Pi.buffer.dtype){case Be:case Jr:wa=Be;break;case Et:case Fe:wa=Et;break;case zt:case St:wa=zt;break;default:}Pi.buffer.dtype=wa}Pi.type=wa;var ji=la;ji<0&&(ji=Pi.buffer.byteLength,wa===Et?ji>>=1:wa===zt&&(ji>>=2)),Pi.vertCount=ji;var Ii=Yi;if(Yi<0){Ii=pi;var Va=Pi.buffer.dimension;Va===1&&(Ii=Ua),Va===2&&(Ii=dn),Va===3&&(Ii=pi)}Pi.primType=Ii}function Wa(Pi){Kr.elementsCount--,delete ci[Pi.id],Pi.buffer.destroy(),Pi.buffer=null}function xa(Pi,Hr){var Ei=_r.create(null,Wt,!0),Yi=new Ni(Ei._buffer);Kr.elementsCount++;function la(Ui){if(!Ui)Ei(),Yi.primType=pi,Yi.vertCount=0,Yi.type=Be;else if(typeof Ui=="number")Ei(Ui),Yi.primType=pi,Yi.vertCount=Ui|0,Yi.type=Be;else{var Da=null,wa=ze,bn=-1,ji=-1,Ii=0,Va=0;Array.isArray(Ui)||mt(Ui)||Mt(Ui)?Da=Ui:("data"in Ui&&(Da=Ui.data),"usage"in Ui&&(wa=kt[Ui.usage]),"primitive"in Ui&&(bn=bi[Ui.primitive]),"count"in Ui&&(ji=Ui.count|0),"type"in Ui&&(Va=si[Ui.type]),"length"in Ui?Ii=Ui.length|0:(Ii=ji,Va===Et||Va===Fe?Ii*=2:(Va===zt||Va===St)&&(Ii*=4))),mn(Yi,Da,wa,bn,ji,Ii,Va)}return la}return la(Pi),la._reglType="elements",la._elements=Yi,la.subdata=function(Ui,Da){return Ei.subdata(Ui,Da),la},la.destroy=function(){Wa(Yi)},la}return{create:xa,createStream:Qi,destroyStream:ra,getElements:function(Pi){return typeof Pi=="function"&&Pi._elements instanceof Ni?Pi._elements:null},clear:function(){lt(ci).forEach(Wa)}}}var ft=new Float32Array(1),wt=new Uint32Array(ft.buffer),jt=5123;function It(bt){for(var dr=B.allocType(jt,bt.length),_r=0;_r>>31<<15,yi=(Kr<<1>>>24)-127,si=Kr>>13&1023;if(yi<-24)dr[_r]=ci;else if(yi<-14){var Ni=-14-yi;dr[_r]=ci+(si+1024>>Ni)}else yi>15?dr[_r]=ci+31744:dr[_r]=ci+(yi+15<<10)+si}return dr}function Kt(bt){return Array.isArray(bt)||mt(bt)}var qt=34467,vr=3553,Br=34067,Pr=34069,Mi=6408,gi=6406,ba=6407,Hi=6409,Za=6410,oa=32854,Cn=32855,_n=36194,Li=32819,In=32820,pn=33635,Ka=34042,Rn=6402,tn=34041,Mn=35904,Kn=35906,zn=36193,ua=33776,Ea=33777,ln=33778,on=33779,ao=35986,ho=35987,Jn=34798,lo=35840,Fo=35841,uo=35842,Qn=35843,jo=36196,Yn=5121,Bn=5123,ps=5125,xo=5126,no=10242,Mo=10243,Vn=10497,ts=33071,ws=33648,So=10240,nl=10241,vs=9728,go=9729,Xn=9984,On=9985,Uo=9986,kl=9987,mu=33170,Ul=4352,gu=4353,yu=4354,Fu=34046,au=3317,xc=37440,Pu=37441,Cl=37443,bc=37444,Iu=33984,_l=[Xn,Uo,On,kl],ms=[0,Hi,Za,ba,Mi],ss={};ss[Hi]=ss[gi]=ss[Rn]=1,ss[tn]=ss[Za]=2,ss[ba]=ss[Mn]=3,ss[Mi]=ss[Kn]=4;function fl(bt){return"[object "+bt+"]"}var wc=fl("HTMLCanvasElement"),Tc=fl("OffscreenCanvas"),tc=fl("CanvasRenderingContext2D"),Th=fl("ImageBitmap"),Ah=fl("HTMLImageElement"),zd=fl("HTMLVideoElement"),hp=Object.keys(De).concat([wc,Tc,tc,Th,Ah,zd]),Ru=[];Ru[Yn]=1,Ru[xo]=4,Ru[zn]=2,Ru[Bn]=2,Ru[ps]=4;var Ts=[];Ts[oa]=2,Ts[Cn]=2,Ts[_n]=2,Ts[tn]=4,Ts[ua]=.5,Ts[Ea]=.5,Ts[ln]=1,Ts[on]=1,Ts[ao]=.5,Ts[ho]=1,Ts[Jn]=1,Ts[lo]=.5,Ts[Fo]=.25,Ts[uo]=.5,Ts[Qn]=.25,Ts[jo]=.5;function Mh(bt){return Array.isArray(bt)&&(bt.length===0||typeof bt[0]=="number")}function vf(bt){if(!Array.isArray(bt))return!1;var dr=bt.length;return!(dr===0||!Kt(bt[0]))}function Ac(bt){return Object.prototype.toString.call(bt)}function Sh(bt){return Ac(bt)===wc}function Mc(bt){return Ac(bt)===Tc}function $c(bt){return Ac(bt)===tc}function zu(bt){return Ac(bt)===Th}function mf(bt){return Ac(bt)===Ah}function jf(bt){return Ac(bt)===zd}function Sc(bt){if(!bt)return!1;var dr=Ac(bt);return hp.indexOf(dr)>=0?!0:Mh(bt)||vf(bt)||Mt(bt)}function ad(bt){return De[Object.prototype.toString.call(bt)]|0}function Uf(bt,dr){var _r=dr.length;switch(bt.type){case Yn:case Bn:case ps:case xo:var Kr=B.allocType(bt.type,_r);Kr.set(dr),bt.data=Kr;break;case zn:bt.data=It(dr);break;default:}}function Bd(bt,dr){return B.allocType(bt.type===zn?xo:bt.type,dr)}function Bu(bt,dr){bt.type===zn?(bt.data=It(dr),B.freeType(dr)):bt.data=dr}function Eh(bt,dr,_r,Kr,ci,yi){for(var si=bt.width,Ni=bt.height,Ji=bt.channels,Qi=si*Ni*Ji,ra=Bd(bt,Qi),mn=0,Wa=0;Wa=1;)Ni+=si*Ji*Ji,Ji/=2;return Ni}else return si*_r*Kr}function qf(bt,dr,_r,Kr,ci,yi,si){var Ni={"don't care":Ul,"dont care":Ul,nice:yu,fast:gu},Ji={repeat:Vn,clamp:ts,mirror:ws},Qi={nearest:vs,linear:go},ra=t({mipmap:kl,"nearest mipmap nearest":Xn,"linear mipmap nearest":On,"nearest mipmap linear":Uo,"linear mipmap linear":kl},Qi),mn={none:0,browser:bc},Wa={uint8:Yn,rgba4:Li,rgb565:pn,"rgb5 a1":In},xa={alpha:gi,luminance:Hi,"luminance alpha":Za,rgb:ba,rgba:Mi,rgba4:oa,"rgb5 a1":Cn,rgb565:_n},Pi={};dr.ext_srgb&&(xa.srgb=Mn,xa.srgba=Kn),dr.oes_texture_float&&(Wa.float32=Wa.float=xo),dr.oes_texture_half_float&&(Wa.float16=Wa["half float"]=zn),dr.webgl_depth_texture&&(t(xa,{depth:Rn,"depth stencil":tn}),t(Wa,{uint16:Bn,uint32:ps,"depth stencil":Ka})),dr.webgl_compressed_texture_s3tc&&t(Pi,{"rgb s3tc dxt1":ua,"rgba s3tc dxt1":Ea,"rgba s3tc dxt3":ln,"rgba s3tc dxt5":on}),dr.webgl_compressed_texture_atc&&t(Pi,{"rgb atc":ao,"rgba atc explicit alpha":ho,"rgba atc interpolated alpha":Jn}),dr.webgl_compressed_texture_pvrtc&&t(Pi,{"rgb pvrtc 4bppv1":lo,"rgb pvrtc 2bppv1":Fo,"rgba pvrtc 4bppv1":uo,"rgba pvrtc 2bppv1":Qn}),dr.webgl_compressed_texture_etc1&&(Pi["rgb etc1"]=jo);var Hr=Array.prototype.slice.call(bt.getParameter(qt));Object.keys(Pi).forEach(function(gr){var hi=Pi[gr];Hr.indexOf(hi)>=0&&(xa[gr]=hi)});var Ei=Object.keys(xa);_r.textureFormats=Ei;var Yi=[];Object.keys(xa).forEach(function(gr){var hi=xa[gr];Yi[hi]=gr});var la=[];Object.keys(Wa).forEach(function(gr){var hi=Wa[gr];la[hi]=gr});var Ui=[];Object.keys(Qi).forEach(function(gr){var hi=Qi[gr];Ui[hi]=gr});var Da=[];Object.keys(ra).forEach(function(gr){var hi=ra[gr];Da[hi]=gr});var wa=[];Object.keys(Ji).forEach(function(gr){var hi=Ji[gr];wa[hi]=gr});var bn=Ei.reduce(function(gr,hi){var di=xa[hi];return di===Hi||di===gi||di===Hi||di===Za||di===Rn||di===tn||dr.ext_srgb&&(di===Mn||di===Kn)?gr[di]=di:di===Cn||hi.indexOf("rgba")>=0?gr[di]=Mi:gr[di]=ba,gr},{});function ji(){this.internalformat=Mi,this.format=Mi,this.type=Yn,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bc,this.width=0,this.height=0,this.channels=0}function Ii(gr,hi){gr.internalformat=hi.internalformat,gr.format=hi.format,gr.type=hi.type,gr.compressed=hi.compressed,gr.premultiplyAlpha=hi.premultiplyAlpha,gr.flipY=hi.flipY,gr.unpackAlignment=hi.unpackAlignment,gr.colorSpace=hi.colorSpace,gr.width=hi.width,gr.height=hi.height,gr.channels=hi.channels}function Va(gr,hi){if(!(typeof hi!="object"||!hi)){if("premultiplyAlpha"in hi&&(gr.premultiplyAlpha=hi.premultiplyAlpha),"flipY"in hi&&(gr.flipY=hi.flipY),"alignment"in hi&&(gr.unpackAlignment=hi.alignment),"colorSpace"in hi&&(gr.colorSpace=mn[hi.colorSpace]),"type"in hi){var di=hi.type;gr.type=Wa[di]}var sn=gr.width,Io=gr.height,_s=gr.channels,an=!1;"shape"in hi?(sn=hi.shape[0],Io=hi.shape[1],hi.shape.length===3&&(_s=hi.shape[2],an=!0)):("radius"in hi&&(sn=Io=hi.radius),"width"in hi&&(sn=hi.width),"height"in hi&&(Io=hi.height),"channels"in hi&&(_s=hi.channels,an=!0)),gr.width=sn|0,gr.height=Io|0,gr.channels=_s|0;var cr=!1;if("format"in hi){var xr=hi.format,kr=gr.internalformat=xa[xr];gr.format=bn[kr],xr in Wa&&("type"in hi||(gr.type=Wa[xr])),xr in Pi&&(gr.compressed=!0),cr=!0}!an&&cr?gr.channels=ss[gr.format]:an&&!cr&&gr.channels!==ms[gr.format]&&(gr.format=gr.internalformat=ms[gr.channels])}}function _a(gr){bt.pixelStorei(xc,gr.flipY),bt.pixelStorei(Pu,gr.premultiplyAlpha),bt.pixelStorei(Cl,gr.colorSpace),bt.pixelStorei(au,gr.unpackAlignment)}function ca(){ji.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function va(gr,hi){var di=null;if(Sc(hi)?di=hi:hi&&(Va(gr,hi),"x"in hi&&(gr.xOffset=hi.x|0),"y"in hi&&(gr.yOffset=hi.y|0),Sc(hi.data)&&(di=hi.data)),hi.copy){var sn=ci.viewportWidth,Io=ci.viewportHeight;gr.width=gr.width||sn-gr.xOffset,gr.height=gr.height||Io-gr.yOffset,gr.needsCopy=!0}else if(!di)gr.width=gr.width||1,gr.height=gr.height||1,gr.channels=gr.channels||4;else if(mt(di))gr.channels=gr.channels||4,gr.data=di,!("type"in hi)&&gr.type===Yn&&(gr.type=ad(di));else if(Mh(di))gr.channels=gr.channels||4,Uf(gr,di),gr.alignment=1,gr.needsFree=!0;else if(Mt(di)){var _s=di.data;!Array.isArray(_s)&&gr.type===Yn&&(gr.type=ad(_s));var an=di.shape,cr=di.stride,xr,kr,fi,Ti,ve,be;an.length===3?(fi=an[2],be=cr[2]):(fi=1,be=1),xr=an[0],kr=an[1],Ti=cr[0],ve=cr[1],gr.alignment=1,gr.width=xr,gr.height=kr,gr.channels=fi,gr.format=gr.internalformat=ms[fi],gr.needsFree=!0,Eh(gr,_s,Ti,ve,be,di.offset)}else if(Sh(di)||Mc(di)||$c(di))Sh(di)||Mc(di)?gr.element=di:gr.element=di.canvas,gr.width=gr.element.width,gr.height=gr.element.height,gr.channels=4;else if(zu(di))gr.element=di,gr.width=di.width,gr.height=di.height,gr.channels=4;else if(mf(di))gr.element=di,gr.width=di.naturalWidth,gr.height=di.naturalHeight,gr.channels=4;else if(jf(di))gr.element=di,gr.width=di.videoWidth,gr.height=di.videoHeight,gr.channels=4;else if(vf(di)){var Ce=gr.width||di[0].length,He=gr.height||di.length,Xe=gr.channels;Kt(di[0][0])?Xe=Xe||di[0][0].length:Xe=Xe||1;for(var it=qe.shape(di),Dt=1,or=0;or>=Io,di.height>>=Io,va(di,sn[Io]),gr.mipmask|=1<=0&&!("faces"in hi)&&(gr.genMipmaps=!0)}if("mag"in hi){var sn=hi.mag;gr.magFilter=Qi[sn]}var Io=gr.wrapS,_s=gr.wrapT;if("wrap"in hi){var an=hi.wrap;typeof an=="string"?Io=_s=Ji[an]:Array.isArray(an)&&(Io=Ji[an[0]],_s=Ji[an[1]])}else{if("wrapS"in hi){var cr=hi.wrapS;Io=Ji[cr]}if("wrapT"in hi){var xr=hi.wrapT;_s=Ji[xr]}}if(gr.wrapS=Io,gr.wrapT=_s,"anisotropic"in hi){var kr=hi.anisotropic;gr.anisotropic=hi.anisotropic}if("mipmap"in hi){var fi=!1;switch(typeof hi.mipmap){case"string":gr.mipmapHint=Ni[hi.mipmap],gr.genMipmaps=!0,fi=!0;break;case"boolean":fi=gr.genMipmaps=hi.mipmap;break;case"object":gr.genMipmaps=!1,fi=!0;break;default:}fi&&!("min"in hi)&&(gr.minFilter=Xn)}}function lc(gr,hi){bt.texParameteri(hi,nl,gr.minFilter),bt.texParameteri(hi,So,gr.magFilter),bt.texParameteri(hi,no,gr.wrapS),bt.texParameteri(hi,Mo,gr.wrapT),dr.ext_texture_filter_anisotropic&&bt.texParameteri(hi,Fu,gr.anisotropic),gr.genMipmaps&&(bt.hint(mu,gr.mipmapHint),bt.generateMipmap(hi))}var zc=0,Pl={},Il=_r.maxTextureUnits,Yl=Array(Il).map(function(){return null});function oo(gr){ji.call(this),this.mipmask=0,this.internalformat=Mi,this.id=zc++,this.refCount=1,this.target=gr,this.texture=bt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new ys,si.profile&&(this.stats={size:0})}function lu(gr){bt.activeTexture(Iu),bt.bindTexture(gr.target,gr.texture)}function Ms(){var gr=Yl[0];gr?bt.bindTexture(gr.target,gr.texture):bt.bindTexture(vr,null)}function uc(gr){var hi=gr.texture,di=gr.unit,sn=gr.target;di>=0&&(bt.activeTexture(Iu+di),bt.bindTexture(sn,null),Yl[di]=null),bt.deleteTexture(hi),gr.texture=null,gr.params=null,gr.pixels=null,gr.refCount=0,delete Pl[gr.id],yi.textureCount--}t(oo.prototype,{bind:function(){var gr=this;gr.bindCount+=1;var hi=gr.unit;if(hi<0){for(var di=0;di0)continue;sn.unit=-1}Yl[di]=gr,hi=di;break}hi>=Il,si.profile&&yi.maxTextureUnits>ve)-fi,be.height=be.height||(di.height>>ve)-Ti,lu(di),wn(be,vr,fi,Ti,ve),Ms(),en(be),sn}function _s(an,cr){var xr=an|0,kr=cr|0||xr;if(xr===di.width&&kr===di.height)return sn;sn.width=di.width=xr,sn.height=di.height=kr,lu(di);for(var fi=0;di.mipmask>>fi;++fi){var Ti=xr>>fi,ve=kr>>fi;if(!Ti||!ve)break;bt.texImage2D(vr,fi,di.format,Ti,ve,0,di.format,di.type,null)}return Ms(),si.profile&&(di.stats.size=_u(di.internalformat,di.type,xr,kr,!1,!1)),sn}return sn(gr,hi),sn.subimage=Io,sn.resize=_s,sn._reglType="texture2d",sn._texture=di,si.profile&&(sn.stats=di.stats),sn.destroy=function(){di.decRef()},sn}function Oc(gr,hi,di,sn,Io,_s){var an=new oo(Br);Pl[an.id]=an,yi.cubeCount++;var cr=new Array(6);function xr(Ti,ve,be,Ce,He,Xe){var it,Dt=an.texInfo;for(ys.call(Dt),it=0;it<6;++it)cr[it]=Co();if(typeof Ti=="number"||!Ti){var or=Ti|0||1;for(it=0;it<6;++it)qn(cr[it],or,or)}else if(typeof Ti=="object")if(ve)yo(cr[0],Ti),yo(cr[1],ve),yo(cr[2],be),yo(cr[3],Ce),yo(cr[4],He),yo(cr[5],Xe);else if(Hu(Dt,Ti),Va(an,Ti),"faces"in Ti){var Dr=Ti.faces;for(it=0;it<6;++it)Ii(cr[it],an),yo(cr[it],Dr[it])}else for(it=0;it<6;++it)yo(cr[it],Ti);for(Ii(an,cr[0]),Dt.genMipmaps?an.mipmask=(cr[0].width<<1)-1:an.mipmask=cr[0].mipmask,an.internalformat=cr[0].internalformat,xr.width=cr[0].width,xr.height=cr[0].height,lu(an),it=0;it<6;++it)Gs(cr[it],Pr+it);for(lc(Dt,Br),Ms(),si.profile&&(an.stats.size=_u(an.internalformat,an.type,xr.width,xr.height,Dt.genMipmaps,!0)),xr.format=Yi[an.internalformat],xr.type=la[an.type],xr.mag=Ui[Dt.magFilter],xr.min=Da[Dt.minFilter],xr.wrapS=wa[Dt.wrapS],xr.wrapT=wa[Dt.wrapT],it=0;it<6;++it)Rc(cr[it]);return xr}function kr(Ti,ve,be,Ce,He){var Xe=be|0,it=Ce|0,Dt=He|0,or=Ca();return Ii(or,an),or.width=0,or.height=0,va(or,ve),or.width=or.width||(an.width>>Dt)-Xe,or.height=or.height||(an.height>>Dt)-it,lu(an),wn(or,Pr+Ti,Xe,it,Dt),Ms(),en(or),xr}function fi(Ti){var ve=Ti|0;if(ve!==an.width){xr.width=an.width=ve,xr.height=an.height=ve,lu(an);for(var be=0;be<6;++be)for(var Ce=0;an.mipmask>>Ce;++Ce)bt.texImage2D(Pr+be,Ce,an.format,ve>>Ce,ve>>Ce,0,an.format,an.type,null);return Ms(),si.profile&&(an.stats.size=_u(an.internalformat,an.type,xr.width,xr.height,!1,!0)),xr}}return xr(gr,hi,di,sn,Io,_s),xr.subimage=kr,xr.resize=fi,xr._reglType="textureCube",xr._texture=an,si.profile&&(xr.stats=an.stats),xr.destroy=function(){an.decRef()},xr}function Zn(){for(var gr=0;gr>sn,di.height>>sn,0,di.internalformat,di.type,null);else for(var Io=0;Io<6;++Io)bt.texImage2D(Pr+Io,sn,di.internalformat,di.width>>sn,di.height>>sn,0,di.internalformat,di.type,null);lc(di.texInfo,di.target)})}function Os(){for(var gr=0;gr=0?Rc=!0:Ji.indexOf(ys)>=0&&(Rc=!1))),("depthTexture"in oo||"depthStencilTexture"in oo)&&(Yl=!!(oo.depthTexture||oo.depthStencilTexture)),"depth"in oo&&(typeof oo.depth=="boolean"?Gs=oo.depth:(zc=oo.depth,Wl=!1)),"stencil"in oo&&(typeof oo.stencil=="boolean"?Wl=oo.stencil:(Pl=oo.stencil,Gs=!1)),"depthStencil"in oo&&(typeof oo.depthStencil=="boolean"?Gs=Wl=oo.depthStencil:(Il=oo.depthStencil,Gs=!1,Wl=!1))}var Ms=null,uc=null,Bc=null,Oc=null;if(Array.isArray(Co))Ms=Co.map(Pi);else if(Co)Ms=[Pi(Co)];else for(Ms=new Array(lc),Un=0;Un0&&(en.depth=va[0].depth,en.stencil=va[0].stencil,en.depthStencil=va[0].depthStencil),va[Ca]?va[Ca](en):va[Ca]=Ii(en)}return t(Ga,{width:Un,height:Un,color:ys})}function wn(Hn){var Ca,en=Hn|0;if(en===Ga.width)return Ga;var Un=Ga.color;for(Ca=0;Ca=Un.byteLength?qn.subdata(Un):(qn.destroy(),Ii.buffers[Hn]=null)),Ii.buffers[Hn]||(qn=Ii.buffers[Hn]=ci.create(Ca,Yc,!1,!0)),en.buffer=ci.getBuffer(qn),en.size=en.buffer.dimension|0,en.normalized=!1,en.type=en.buffer.dtype,en.offset=0,en.stride=0,en.divisor=0,en.state=1,Ga[Hn]=1}else ci.getBuffer(Ca)?(en.buffer=ci.getBuffer(Ca),en.size=en.buffer.dimension|0,en.normalized=!1,en.type=en.buffer.dtype,en.offset=0,en.stride=0,en.divisor=0,en.state=1):ci.getBuffer(Ca.buffer)?(en.buffer=ci.getBuffer(Ca.buffer),en.size=(+Ca.size||en.buffer.dimension)|0,en.normalized=!!Ca.normalized||!1,"type"in Ca?en.type=fr[Ca.type]:en.type=en.buffer.dtype,en.offset=(Ca.offset||0)|0,en.stride=(Ca.stride||0)|0,en.divisor=(Ca.divisor||0)|0,en.state=1):"x"in Ca&&(en.x=+Ca.x||0,en.y=+Ca.y||0,en.z=+Ca.z||0,en.w=+Ca.w||0,en.state=2)}for(var yo=0;yo1)for(var _a=0;_aHr&&(Hr=Ei.stats.uniformsCount)}),Hr},_r.getMaxAttributesCount=function(){var Hr=0;return ra.forEach(function(Ei){Ei.stats.attributesCount>Hr&&(Hr=Ei.stats.attributesCount)}),Hr});function Pi(){ci={},yi={};for(var Hr=0;Hr16&&(_r=$r(_r,bt.length*8));for(var Kr=Array(16),ci=Array(16),yi=0;yi<16;yi++)Kr[yi]=_r[yi]^909522486,ci[yi]=_r[yi]^1549556828;var si=$r(Kr.concat(Af(dr)),512+dr.length*8);return nt($r(ci.concat(si),768))}function ou(bt){for(var dr=qd?"0123456789ABCDEF":"0123456789abcdef",_r="",Kr,ci=0;ci>>4&15)+dr.charAt(Kr&15);return _r}function Kf(bt){for(var dr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_r="",Kr=bt.length,ci=0;cibt.length*8?_r+=Zf:_r+=dr.charAt(yi>>>6*(3-si)&63);return _r}function Fh(bt,dr){var _r=dr.length,Kr=Array(),ci,yi,si,Ni,Ji=Array(Math.ceil(bt.length/2));for(ci=0;ci0;){for(Ni=Array(),si=0,ci=0;ci0||yi>0)&&(Ni[Ni.length]=yi);Kr[Kr.length]=si,Ji=Ni}var Qi="";for(ci=Kr.length-1;ci>=0;ci--)Qi+=dr.charAt(Kr[ci]);var ra=Math.ceil(bt.length*8/(Math.log(dr.length)/Math.log(2)));for(ci=Qi.length;ci>>6&31,128|Kr&63):Kr<=65535?dr+=String.fromCharCode(224|Kr>>>12&15,128|Kr>>>6&63,128|Kr&63):Kr<=2097151&&(dr+=String.fromCharCode(240|Kr>>>18&7,128|Kr>>>12&63,128|Kr>>>6&63,128|Kr&63));return dr}function Af(bt){for(var dr=Array(bt.length>>2),_r=0;_r>5]|=(bt.charCodeAt(_r/8)&255)<<24-_r%32;return dr}function nt(bt){for(var dr="",_r=0;_r>5]>>>24-_r%32&255);return dr}function Tt(bt,dr){return bt>>>dr|bt<<32-dr}function Jt(bt,dr){return bt>>>dr}function Bt(bt,dr,_r){return bt&dr^~bt&_r}function yr(bt,dr,_r){return bt&dr^bt&_r^dr&_r}function zr(bt){return Tt(bt,2)^Tt(bt,13)^Tt(bt,22)}function Gr(bt){return Tt(bt,6)^Tt(bt,11)^Tt(bt,25)}function ii(bt){return Tt(bt,7)^Tt(bt,18)^Jt(bt,3)}function li(bt){return Tt(bt,17)^Tt(bt,19)^Jt(bt,10)}var Fi=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function $r(bt,dr){var _r=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Kr=new Array(64),ci,yi,si,Ni,Ji,Qi,ra,mn,Wa,xa,Pi,Hr;for(bt[dr>>5]|=128<<24-dr%32,bt[(dr+64>>9<<4)+15]=dr,Wa=0;Wa>16)+(dr>>16)+(_r>>16);return Kr<<16|_r&65535}function ui(bt){return Array.prototype.slice.call(bt)}function Di(bt){return ui(bt).join("")}function Wi(bt){var dr=bt&&bt.cache,_r=0,Kr=[],ci=[],yi=[];function si(Pi,Hr){var Ei=Hr&&Hr.stable;if(!Ei){for(var Yi=0;Yi0&&(Pi.push(la,"="),Pi.push.apply(Pi,ui(arguments)),Pi.push(";")),la}return t(Hr,{def:Yi,toString:function(){return Di([Ei.length>0?"var "+Ei.join(",")+";":"",Di(Pi)])}})}function Ji(){var Pi=Ni(),Hr=Ni(),Ei=Pi.toString,Yi=Hr.toString;function la(Ui,Da){Hr(Ui,Da,"=",Pi.def(Ui,Da),";")}return t(function(){Pi.apply(Pi,ui(arguments))},{def:Pi.def,entry:Pi,exit:Hr,save:la,set:function(Ui,Da,wa){la(Ui,Da),Pi(Ui,Da,"=",wa,";")},toString:function(){return Ei()+Yi()}})}function Qi(){var Pi=Di(arguments),Hr=Ji(),Ei=Ji(),Yi=Hr.toString,la=Ei.toString;return t(Hr,{then:function(){return Hr.apply(Hr,ui(arguments)),this},else:function(){return Ei.apply(Ei,ui(arguments)),this},toString:function(){var Ui=la();return Ui&&(Ui="else{"+Ui+"}"),Di(["if(",Pi,"){",Yi(),"}",Ui])}})}var ra=Ni(),mn={};function Wa(Pi,Hr){var Ei=[];function Yi(){var bn="a"+Ei.length;return Ei.push(bn),bn}Hr=Hr||0;for(var la=0;la":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},wr={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Cr={cw:we,ccw:Le};function Nr(bt){return Array.isArray(bt)||mt(bt)||Mt(bt)}function jr(bt){return bt.sort(function(dr,_r){return dr===qu?-1:_r===qu?1:dr<_r?-1:1})}function Ar(bt,dr,_r,Kr){this.thisDep=bt,this.contextDep=dr,this.propDep=_r,this.append=Kr}function Ci(bt){return bt&&!(bt.thisDep||bt.contextDep||bt.propDep)}function Gi(bt){return new Ar(!1,!1,!1,bt)}function aa(bt,dr){var _r=bt.type;if(_r===Zi){var Kr=bt.data.length;return new Ar(!0,Kr>=1,Kr>=2,dr)}else if(_r===po){var ci=bt.data;return new Ar(ci.thisDep,ci.contextDep,ci.propDep,dr)}else{if(_r===zo)return new Ar(!1,!1,!1,dr);if(_r===wo){for(var yi=!1,si=!1,Ni=!1,Ji=0;Ji=1&&(si=!0),ra>=2&&(Ni=!0)}else Qi.type===po&&(yi=yi||Qi.data.thisDep,si=si||Qi.data.contextDep,Ni=Ni||Qi.data.propDep)}return new Ar(yi,si,Ni,dr)}else return new Ar(_r===Dn,_r===vn,_r===sa,dr)}}var ga=new Ar(!1,!1,!1,function(){});function qa(bt,dr,_r,Kr,ci,yi,si,Ni,Ji,Qi,ra,mn,Wa,xa,Pi,Hr){var Ei=Qi.Record,Yi={add:32774,subtract:32778,"reverse subtract":32779};_r.ext_blend_minmax&&(Yi.min=Re,Yi.max=Ne);var la=_r.angle_instanced_arrays,Ui=_r.webgl_draw_buffers,Da=_r.oes_vertex_array_object,wa={dirty:!0,profile:Hr.profile},bn={},ji=[],Ii={},Va={};function _a(cr){return cr.replace(".","_")}function ca(cr,xr,kr){var fi=_a(cr);ji.push(cr),bn[fi]=wa[fi]=!!kr,Ii[fi]=xr}function va(cr,xr,kr){var fi=_a(cr);ji.push(cr),Array.isArray(kr)?(wa[fi]=kr.slice(),bn[fi]=kr.slice()):wa[fi]=bn[fi]=kr,Va[fi]=xr}function Ga(cr){return!!isNaN(cr)}ca($o,wi),ca(io,Zr),va(Us,"blendColor",[0,0,0,0]),va(gs,"blendEquationSeparate",[Rt,Rt]),va(Go,"blendFuncSeparate",[Ft,_t,Ft,_t]),ca(ma,Aa,!0),va(vo,"depthFunc",lr),va(Ds,"depthRange",[0,1]),va(qs,"depthMask",!0),va(Ll,Ll,[!0,!0,!0,!0]),ca(bu,Rr),va(Gl,"cullFace",he),va(ac,ac,Le),va(bl,bl,1),ca(Uu,gn),va(Fc,"polygonOffset",[0,0]),ca(Kc,Tn),ca(ud,Pn),va(Qf,"sampleCoverage",[1,!1]),ca(qd,qi),va(Fh,"stencilMask",-1),va(Hl,"stencilFunc",[ut,0,-1]),va(Vd,"stencilOpSeparate",[re,et,et,et]),va(Mf,"stencilOpSeparate",[he,et,et,et]),ca(Ph,un),va(Ih,"scissor",[0,0,bt.drawingBufferWidth,bt.drawingBufferHeight]),va(qu,qu,[0,0,bt.drawingBufferWidth,bt.drawingBufferHeight]);var wn={gl:bt,context:Wa,strings:dr,next:bn,current:wa,draw:mn,elements:yi,buffer:ci,shader:ra,attributes:Qi.state,vao:Qi,uniforms:Ji,framebuffer:Ni,extensions:_r,timer:xa,isBufferArgs:Nr},Hn={primTypes:bi,compareFuncs:hr,blendFuncs:Or,blendEquations:Yi,stencilOps:wr,glTypes:fr,orientationType:Cr};Ui&&(Hn.backBuffer=[he],Hn.drawBuffer=A(Kr.maxDrawbuffers,function(cr){return cr===0?[0]:A(cr,function(xr){return Fr+xr})}));var Ca=0;function en(){var cr=Wi({cache:Pi}),xr=cr.link,kr=cr.global;cr.id=Ca++,cr.batchId="0";var fi=xr(wn),Ti=cr.shared={props:"a0"};Object.keys(wn).forEach(function(Xe){Ti[Xe]=kr.def(fi,".",Xe)});var ve=cr.next={},be=cr.current={};Object.keys(Va).forEach(function(Xe){Array.isArray(wa[Xe])&&(ve[Xe]=kr.def(Ti.next,".",Xe),be[Xe]=kr.def(Ti.current,".",Xe))});var Ce=cr.constants={};Object.keys(Hn).forEach(function(Xe){Ce[Xe]=kr.def(JSON.stringify(Hn[Xe]))}),cr.invoke=function(Xe,it){switch(it.type){case Zi:var Dt=["this",Ti.context,Ti.props,cr.batchId];return Xe.def(xr(it.data),".call(",Dt.slice(0,Math.max(it.data.length+1,4)),")");case sa:return Xe.def(Ti.props,it.data);case vn:return Xe.def(Ti.context,it.data);case Dn:return Xe.def("this",it.data);case po:return it.data.append(cr,Xe),it.data.ref;case zo:return it.data.toString();case wo:return it.data.map(function(or){return cr.invoke(Xe,or)})}},cr.attribCache={};var He={};return cr.scopeAttrib=function(Xe){var it=dr.id(Xe);if(it in He)return He[it];var Dt=Qi.scope[it];Dt||(Dt=Qi.scope[it]=new Ei);var or=He[it]=xr(Dt);return or},cr}function Un(cr){var xr=cr.static,kr=cr.dynamic,fi;if(cd in xr){var Ti=!!xr[cd];fi=Gi(function(be,Ce){return Ti}),fi.enable=Ti}else if(cd in kr){var ve=kr[cd];fi=aa(ve,function(be,Ce){return be.invoke(Ce,ve)})}return fi}function qn(cr,xr){var kr=cr.static,fi=cr.dynamic;if(Jc in kr){var Ti=kr[Jc];return Ti?(Ti=Ni.getFramebuffer(Ti),Gi(function(be,Ce){var He=be.link(Ti),Xe=be.shared;Ce.set(Xe.framebuffer,".next",He);var it=Xe.context;return Ce.set(it,"."+$e,He+".width"),Ce.set(it,"."+st,He+".height"),He})):Gi(function(be,Ce){var He=be.shared;Ce.set(He.framebuffer,".next","null");var Xe=He.context;return Ce.set(Xe,"."+$e,Xe+"."+tr),Ce.set(Xe,"."+st,Xe+"."+Ut),"null"})}else if(Jc in fi){var ve=fi[Jc];return aa(ve,function(be,Ce){var He=be.invoke(Ce,ve),Xe=be.shared,it=Xe.framebuffer,Dt=Ce.def(it,".getFramebuffer(",He,")");Ce.set(it,".next",Dt);var or=Xe.context;return Ce.set(or,"."+$e,Dt+"?"+Dt+".width:"+or+"."+tr),Ce.set(or,"."+st,Dt+"?"+Dt+".height:"+or+"."+Ut),Dt})}else return null}function yo(cr,xr,kr){var fi=cr.static,Ti=cr.dynamic;function ve(He){if(He in fi){var Xe=fi[He],it=!0,Dt=Xe.x|0,or=Xe.y|0,Dr,vi;return"width"in Xe?Dr=Xe.width|0:it=!1,"height"in Xe?vi=Xe.height|0:it=!1,new Ar(!it&&xr&&xr.thisDep,!it&&xr&&xr.contextDep,!it&&xr&&xr.propDep,function(Oi,Si){var zi=Oi.shared.context,Vi=Dr;"width"in Xe||(Vi=Si.def(zi,".",$e,"-",Dt));var Xi=vi;return"height"in Xe||(Xi=Si.def(zi,".",st,"-",or)),[Dt,or,Vi,Xi]})}else if(He in Ti){var ai=Ti[He],ei=aa(ai,function(Oi,Si){var zi=Oi.invoke(Si,ai),Vi=Oi.shared.context,Xi=Si.def(zi,".x|0"),ha=Si.def(zi,".y|0"),$a=Si.def('"width" in ',zi,"?",zi,".width|0:","(",Vi,".",$e,"-",Xi,")"),_o=Si.def('"height" in ',zi,"?",zi,".height|0:","(",Vi,".",st,"-",ha,")");return[Xi,ha,$a,_o]});return xr&&(ei.thisDep=ei.thisDep||xr.thisDep,ei.contextDep=ei.contextDep||xr.contextDep,ei.propDep=ei.propDep||xr.propDep),ei}else return xr?new Ar(xr.thisDep,xr.contextDep,xr.propDep,function(Oi,Si){var zi=Oi.shared.context;return[0,0,Si.def(zi,".",$e),Si.def(zi,".",st)]}):null}var be=ve(qu);if(be){var Ce=be;be=new Ar(be.thisDep,be.contextDep,be.propDep,function(He,Xe){var it=Ce.append(He,Xe),Dt=He.shared.context;return Xe.set(Dt,"."+ot,it[2]),Xe.set(Dt,"."+pt,it[3]),it})}return{viewport:be,scissor_box:ve(Ih)}}function Gs(cr,xr){var kr=cr.static,fi=typeof kr[Qc]=="string"&&typeof kr[eh]=="string";if(fi){if(Object.keys(xr.dynamic).length>0)return null;var Ti=xr.static,ve=Object.keys(Ti);if(ve.length>0&&typeof Ti[ve[0]]=="number"){for(var be=[],Ce=0;Ce"+Xi+"?"+it+".constant["+Xi+"]:0;"}).join(""),"}}else{","if(",Dr,"(",it,".buffer)){",Oi,"=",vi,".createStream(",pr,",",it,".buffer);","}else{",Oi,"=",vi,".getBuffer(",it,".buffer);","}",Si,'="type" in ',it,"?",or.glTypes,"[",it,".type]:",Oi,".dtype;",ai.normalized,"=!!",it,".normalized;");function zi(Vi){Xe(ai[Vi],"=",it,".",Vi,"|0;")}return zi("size"),zi("offset"),zi("stride"),zi("divisor"),Xe("}}"),Xe.exit("if(",ai.isStream,"){",vi,".destroyStream(",Oi,");","}"),ai}Ti[ve]=aa(be,Ce)}),Ti}function lc(cr){var xr=cr.static,kr=cr.dynamic,fi={};return Object.keys(xr).forEach(function(Ti){var ve=xr[Ti];fi[Ti]=Gi(function(be,Ce){return typeof ve=="number"||typeof ve=="boolean"?""+ve:be.link(ve)})}),Object.keys(kr).forEach(function(Ti){var ve=kr[Ti];fi[Ti]=aa(ve,function(be,Ce){return be.invoke(Ce,ve)})}),fi}function zc(cr,xr,kr,fi,Ti){var ve=cr.static,be=cr.dynamic,Ce=Gs(cr,xr),He=qn(cr,Ti),Xe=yo(cr,He,Ti),it=Co(cr,Ti),Dt=Rc(cr,Ti),or=Wl(cr,Ti,Ce);function Dr(zi){var Vi=Xe[zi];Vi&&(Dt[zi]=Vi)}Dr(qu),Dr(_a(Ih));var vi=Object.keys(Dt).length>0,ai={framebuffer:He,draw:it,shader:or,state:Dt,dirty:vi,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(ai.profile=Un(cr,Ti),ai.uniforms=ys(kr,Ti),ai.drawVAO=ai.scopeVAO=it.vao,!ai.drawVAO&&or.program&&!Ce&&_r.angle_instanced_arrays&&it.static.elements){var ei=!0,Oi=or.program.attributes.map(function(zi){var Vi=xr.static[zi];return ei=ei&&!!Vi,Vi});if(ei&&Oi.length>0){var Si=Qi.getVAO(Qi.createVAO({attributes:Oi,elements:it.static.elements}));ai.drawVAO=new Ar(null,null,null,function(zi,Vi){return zi.link(Si)}),ai.useVAO=!0}}return Ce?ai.useVAO=!0:ai.attributes=Hu(xr,Ti),ai.context=lc(fi,Ti),ai}function Pl(cr,xr,kr){var fi=cr.shared,Ti=fi.context,ve=cr.scope();Object.keys(kr).forEach(function(be){xr.save(Ti,"."+be);var Ce=kr[be],He=Ce.append(cr,xr);Array.isArray(He)?ve(Ti,".",be,"=[",He.join(),"];"):ve(Ti,".",be,"=",He,";")}),xr(ve)}function Il(cr,xr,kr,fi){var Ti=cr.shared,ve=Ti.gl,be=Ti.framebuffer,Ce;Ui&&(Ce=xr.def(Ti.extensions,".webgl_draw_buffers"));var He=cr.constants,Xe=He.drawBuffer,it=He.backBuffer,Dt;kr?Dt=kr.append(cr,xr):Dt=xr.def(be,".next"),fi||xr("if(",Dt,"!==",be,".cur){"),xr("if(",Dt,"){",ve,".bindFramebuffer(",sr,",",Dt,".framebuffer);"),Ui&&xr(Ce,".drawBuffersWEBGL(",Xe,"[",Dt,".colorAttachments.length]);"),xr("}else{",ve,".bindFramebuffer(",sr,",null);"),Ui&&xr(Ce,".drawBuffersWEBGL(",it,");"),xr("}",be,".cur=",Dt,";"),fi||xr("}")}function Yl(cr,xr,kr){var fi=cr.shared,Ti=fi.gl,ve=cr.current,be=cr.next,Ce=fi.current,He=fi.next,Xe=cr.cond(Ce,".dirty");ji.forEach(function(it){var Dt=_a(it);if(!(Dt in kr.state)){var or,Dr;if(Dt in be){or=be[Dt],Dr=ve[Dt];var vi=A(wa[Dt].length,function(ei){return Xe.def(or,"[",ei,"]")});Xe(cr.cond(vi.map(function(ei,Oi){return ei+"!=="+Dr+"["+Oi+"]"}).join("||")).then(Ti,".",Va[Dt],"(",vi,");",vi.map(function(ei,Oi){return Dr+"["+Oi+"]="+ei}).join(";"),";"))}else{or=Xe.def(He,".",Dt);var ai=cr.cond(or,"!==",Ce,".",Dt);Xe(ai),Dt in Ii?ai(cr.cond(or).then(Ti,".enable(",Ii[Dt],");").else(Ti,".disable(",Ii[Dt],");"),Ce,".",Dt,"=",or,";"):ai(Ti,".",Va[Dt],"(",or,");",Ce,".",Dt,"=",or,";")}}}),Object.keys(kr.state).length===0&&Xe(Ce,".dirty=false;"),xr(Xe)}function oo(cr,xr,kr,fi){var Ti=cr.shared,ve=cr.current,be=Ti.current,Ce=Ti.gl,He;jr(Object.keys(kr)).forEach(function(Xe){var it=kr[Xe];if(!(fi&&!fi(it))){var Dt=it.append(cr,xr);if(Ii[Xe]){var or=Ii[Xe];Ci(it)?(He=cr.link(Dt,{stable:!0}),xr(cr.cond(He).then(Ce,".enable(",or,");").else(Ce,".disable(",or,");")),xr(be,".",Xe,"=",He,";")):(xr(cr.cond(Dt).then(Ce,".enable(",or,");").else(Ce,".disable(",or,");")),xr(be,".",Xe,"=",Dt,";"))}else if(Zt(Dt)){var Dr=ve[Xe];xr(Ce,".",Va[Xe],"(",Dt,");",Dt.map(function(vi,ai){return Dr+"["+ai+"]="+vi}).join(";"),";")}else Ci(it)?(He=cr.link(Dt,{stable:!0}),xr(Ce,".",Va[Xe],"(",He,");",be,".",Xe,"=",He,";")):xr(Ce,".",Va[Xe],"(",Dt,");",be,".",Xe,"=",Dt,";")}})}function lu(cr,xr){la&&(cr.instancing=xr.def(cr.shared.extensions,".angle_instanced_arrays"))}function Ms(cr,xr,kr,fi,Ti){var ve=cr.shared,be=cr.stats,Ce=ve.current,He=ve.timer,Xe=kr.profile;function it(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Dt,or;function Dr(zi){Dt=xr.def(),zi(Dt,"=",it(),";"),typeof Ti=="string"?zi(be,".count+=",Ti,";"):zi(be,".count++;"),xa&&(fi?(or=xr.def(),zi(or,"=",He,".getNumPendingQueries();")):zi(He,".beginQuery(",be,");"))}function vi(zi){zi(be,".cpuTime+=",it(),"-",Dt,";"),xa&&(fi?zi(He,".pushScopeStats(",or,",",He,".getNumPendingQueries(),",be,");"):zi(He,".endQuery();"))}function ai(zi){var Vi=xr.def(Ce,".profile");xr(Ce,".profile=",zi,";"),xr.exit(Ce,".profile=",Vi,";")}var ei;if(Xe){if(Ci(Xe)){Xe.enable?(Dr(xr),vi(xr.exit),ai("true")):ai("false");return}ei=Xe.append(cr,xr),ai(ei)}else ei=xr.def(Ce,".profile");var Oi=cr.block();Dr(Oi),xr("if(",ei,"){",Oi,"}");var Si=cr.block();vi(Si),xr.exit("if(",ei,"){",Si,"}")}function uc(cr,xr,kr,fi,Ti){var ve=cr.shared;function be(He){switch(He){case qo:case wl:case pl:return 2;case Wn:case Vu:case Tu:return 3;case ls:case Pc:case nc:return 4;default:return 1}}function Ce(He,Xe,it){var Dt=ve.gl,or=xr.def(He,".location"),Dr=xr.def(ve.attributes,"[",or,"]"),vi=it.state,ai=it.buffer,ei=[it.x,it.y,it.z,it.w],Oi=["buffer","normalized","offset","stride"];function Si(){xr("if(!",Dr,".buffer){",Dt,".enableVertexAttribArray(",or,");}");var Vi=it.type,Xi;if(it.size?Xi=xr.def(it.size,"||",Xe):Xi=Xe,xr("if(",Dr,".type!==",Vi,"||",Dr,".size!==",Xi,"||",Oi.map(function($a){return Dr+"."+$a+"!=="+it[$a]}).join("||"),"){",Dt,".bindBuffer(",pr,",",ai,".buffer);",Dt,".vertexAttribPointer(",[or,Xi,Vi,it.normalized,it.stride,it.offset],");",Dr,".type=",Vi,";",Dr,".size=",Xi,";",Oi.map(function($a){return Dr+"."+$a+"="+it[$a]+";"}).join(""),"}"),la){var ha=it.divisor;xr("if(",Dr,".divisor!==",ha,"){",cr.instancing,".vertexAttribDivisorANGLE(",[or,ha],");",Dr,".divisor=",ha,";}")}}function zi(){xr("if(",Dr,".buffer){",Dt,".disableVertexAttribArray(",or,");",Dr,".buffer=null;","}if(",Oa.map(function(Vi,Xi){return Dr+"."+Vi+"!=="+ei[Xi]}).join("||"),"){",Dt,".vertexAttrib4f(",or,",",ei,");",Oa.map(function(Vi,Xi){return Dr+"."+Vi+"="+ei[Xi]+";"}).join(""),"}")}vi===Ja?Si():vi===rn?zi():(xr("if(",vi,"===",Ja,"){"),Si(),xr("}else{"),zi(),xr("}"))}fi.forEach(function(He){var Xe=He.name,it=kr.attributes[Xe],Dt;if(it){if(!Ti(it))return;Dt=it.append(cr,xr)}else{if(!Ti(ga))return;var or=cr.scopeAttrib(Xe);Dt={},Object.keys(new Ei).forEach(function(Dr){Dt[Dr]=xr.def(or,".",Dr)})}Ce(cr.link(He),be(He.info.type),Dt)})}function Bc(cr,xr,kr,fi,Ti,ve){for(var be=cr.shared,Ce=be.gl,He,Xe=0;Xe1){for(var xs=[],el=[],vl=0;vl>1)",ai],");")}function ha(){kr(ei,".drawArraysInstancedANGLE(",[or,Dr,vi,ai],");")}it&&it!=="null"?Si?Xi():(kr("if(",it,"){"),Xi(),kr("}else{"),ha(),kr("}")):ha()}function Vi(){function Xi(){kr(ve+".drawElements("+[or,vi,Oi,Dr+"<<(("+Oi+"-"+Pa+")>>1)"]+");")}function ha(){kr(ve+".drawArrays("+[or,Dr,vi]+");")}it&&it!=="null"?Si?Xi():(kr("if(",it,"){"),Xi(),kr("}else{"),ha(),kr("}")):ha()}la&&(typeof ai!="number"||ai>=0)?typeof ai=="string"?(kr("if(",ai,">0){"),zi(),kr("}else if(",ai,"<0){"),Vi(),kr("}")):zi():Vi()}function Zn(cr,xr,kr,fi,Ti){var ve=en(),be=ve.proc("body",Ti);return la&&(ve.instancing=be.def(ve.shared.extensions,".angle_instanced_arrays")),cr(ve,be,kr,fi),ve.compile().body}function Bo(cr,xr,kr,fi){lu(cr,xr),kr.useVAO?kr.drawVAO?xr(cr.shared.vao,".setVAO(",kr.drawVAO.append(cr,xr),");"):xr(cr.shared.vao,".setVAO(",cr.shared.vao,".targetVAO);"):(xr(cr.shared.vao,".setVAO(null);"),uc(cr,xr,kr,fi.attributes,function(){return!0})),Bc(cr,xr,kr,fi.uniforms,function(){return!0},!1),Oc(cr,xr,xr,kr)}function Bs(cr,xr){var kr=cr.proc("draw",1);lu(cr,kr),Pl(cr,kr,xr.context),Il(cr,kr,xr.framebuffer),Yl(cr,kr,xr),oo(cr,kr,xr.state),Ms(cr,kr,xr,!1,!0);var fi=xr.shader.progVar.append(cr,kr);if(kr(cr.shared.gl,".useProgram(",fi,".program);"),xr.shader.program)Bo(cr,kr,xr,xr.shader.program);else{kr(cr.shared.vao,".setVAO(null);");var Ti=cr.global.def("{}"),ve=kr.def(fi,".id"),be=kr.def(Ti,"[",ve,"]");kr(cr.cond(be).then(be,".call(this,a0);").else(be,"=",Ti,"[",ve,"]=",cr.link(function(Ce){return Zn(Bo,cr,xr,Ce,1)}),"(",fi,");",be,".call(this,a0);"))}Object.keys(xr.state).length>0&&kr(cr.shared.current,".dirty=true;"),cr.shared.vao&&kr(cr.shared.vao,".setVAO(null);")}function gr(cr,xr,kr,fi){cr.batchId="a1",lu(cr,xr);function Ti(){return!0}uc(cr,xr,kr,fi.attributes,Ti),Bc(cr,xr,kr,fi.uniforms,Ti,!1),Oc(cr,xr,xr,kr)}function hi(cr,xr,kr,fi){lu(cr,xr);var Ti=kr.contextDep,ve=xr.def(),be="a0",Ce="a1",He=xr.def();cr.shared.props=He,cr.batchId=ve;var Xe=cr.scope(),it=cr.scope();xr(Xe.entry,"for(",ve,"=0;",ve,"<",Ce,";++",ve,"){",He,"=",be,"[",ve,"];",it,"}",Xe.exit);function Dt(Oi){return Oi.contextDep&&Ti||Oi.propDep}function or(Oi){return!Dt(Oi)}if(kr.needsContext&&Pl(cr,it,kr.context),kr.needsFramebuffer&&Il(cr,it,kr.framebuffer),oo(cr,it,kr.state,Dt),kr.profile&&Dt(kr.profile)&&Ms(cr,it,kr,!1,!0),fi)kr.useVAO?kr.drawVAO?Dt(kr.drawVAO)?it(cr.shared.vao,".setVAO(",kr.drawVAO.append(cr,it),");"):Xe(cr.shared.vao,".setVAO(",kr.drawVAO.append(cr,Xe),");"):Xe(cr.shared.vao,".setVAO(",cr.shared.vao,".targetVAO);"):(Xe(cr.shared.vao,".setVAO(null);"),uc(cr,Xe,kr,fi.attributes,or),uc(cr,it,kr,fi.attributes,Dt)),Bc(cr,Xe,kr,fi.uniforms,or,!1),Bc(cr,it,kr,fi.uniforms,Dt,!0),Oc(cr,Xe,it,kr);else{var Dr=cr.global.def("{}"),vi=kr.shader.progVar.append(cr,it),ai=it.def(vi,".id"),ei=it.def(Dr,"[",ai,"]");it(cr.shared.gl,".useProgram(",vi,".program);","if(!",ei,"){",ei,"=",Dr,"[",ai,"]=",cr.link(function(Oi){return Zn(gr,cr,kr,Oi,2)}),"(",vi,");}",ei,".call(this,a0[",ve,"],",ve,");")}}function di(cr,xr){var kr=cr.proc("batch",2);cr.batchId="0",lu(cr,kr);var fi=!1,Ti=!0;Object.keys(xr.context).forEach(function(Dr){fi=fi||xr.context[Dr].propDep}),fi||(Pl(cr,kr,xr.context),Ti=!1);var ve=xr.framebuffer,be=!1;ve?(ve.propDep?fi=be=!0:ve.contextDep&&fi&&(be=!0),be||Il(cr,kr,ve)):Il(cr,kr,null),xr.state.viewport&&xr.state.viewport.propDep&&(fi=!0);function Ce(Dr){return Dr.contextDep&&fi||Dr.propDep}Yl(cr,kr,xr),oo(cr,kr,xr.state,function(Dr){return!Ce(Dr)}),(!xr.profile||!Ce(xr.profile))&&Ms(cr,kr,xr,!1,"a1"),xr.contextDep=fi,xr.needsContext=Ti,xr.needsFramebuffer=be;var He=xr.shader.progVar;if(He.contextDep&&fi||He.propDep)hi(cr,kr,xr,null);else{var Xe=He.append(cr,kr);if(kr(cr.shared.gl,".useProgram(",Xe,".program);"),xr.shader.program)hi(cr,kr,xr,xr.shader.program);else{kr(cr.shared.vao,".setVAO(null);");var it=cr.global.def("{}"),Dt=kr.def(Xe,".id"),or=kr.def(it,"[",Dt,"]");kr(cr.cond(or).then(or,".call(this,a0,a1);").else(or,"=",it,"[",Dt,"]=",cr.link(function(Dr){return Zn(hi,cr,xr,Dr,2)}),"(",Xe,");",or,".call(this,a0,a1);"))}}Object.keys(xr.state).length>0&&kr(cr.shared.current,".dirty=true;"),cr.shared.vao&&kr(cr.shared.vao,".setVAO(null);")}function sn(cr,xr){var kr=cr.proc("scope",3);cr.batchId="a2";var fi=cr.shared,Ti=fi.current;if(Pl(cr,kr,xr.context),xr.framebuffer&&xr.framebuffer.append(cr,kr),jr(Object.keys(xr.state)).forEach(function(Ce){var He=xr.state[Ce],Xe=He.append(cr,kr);Zt(Xe)?Xe.forEach(function(it,Dt){Ga(it)?kr.set(cr.next[Ce],"["+Dt+"]",it):kr.set(cr.next[Ce],"["+Dt+"]",cr.link(it,{stable:!0}))}):Ci(He)?kr.set(fi.next,"."+Ce,cr.link(Xe,{stable:!0})):kr.set(fi.next,"."+Ce,Xe)}),Ms(cr,kr,xr,!0,!0),[wu,fd,Sf,$l,ef].forEach(function(Ce){var He=xr.draw[Ce];if(He){var Xe=He.append(cr,kr);Ga(Xe)?kr.set(fi.draw,"."+Ce,Xe):kr.set(fi.draw,"."+Ce,cr.link(Xe),{stable:!0})}}),Object.keys(xr.uniforms).forEach(function(Ce){var He=xr.uniforms[Ce].append(cr,kr);Array.isArray(He)&&(He="["+He.map(function(Xe){return Ga(Xe)?Xe:cr.link(Xe,{stable:!0})})+"]"),kr.set(fi.uniforms,"["+cr.link(dr.id(Ce),{stable:!0})+"]",He)}),Object.keys(xr.attributes).forEach(function(Ce){var He=xr.attributes[Ce].append(cr,kr),Xe=cr.scopeAttrib(Ce);Object.keys(new Ei).forEach(function(it){kr.set(Xe,"."+it,He[it])})}),xr.scopeVAO){var ve=xr.scopeVAO.append(cr,kr);Ga(ve)?kr.set(fi.vao,".targetVAO",ve):kr.set(fi.vao,".targetVAO",cr.link(ve,{stable:!0}))}function be(Ce){var He=xr.shader[Ce];if(He){var Xe=He.append(cr,kr);Ga(Xe)?kr.set(fi.shader,"."+Ce,Xe):kr.set(fi.shader,"."+Ce,cr.link(Xe,{stable:!0}))}}be(eh),be(Qc),Object.keys(xr.state).length>0&&(kr(Ti,".dirty=true;"),kr.exit(Ti,".dirty=true;")),kr("a1(",cr.shared.context,",a0,",cr.batchId,");")}function Io(cr){if(!(typeof cr!="object"||Zt(cr))){for(var xr=Object.keys(cr),kr=0;kr=0;--Zn){var Bo=wn[Zn];Bo&&Bo(Pi,null,0)}_r.flush(),ra&&ra.update()}function yo(){!Un&&wn.length>0&&(Un=g.next(qn))}function Gs(){Un&&(g.cancel(qn),Un=null)}function Wl(Zn){Zn.preventDefault(),ci=!0,Gs(),Hn.forEach(function(Bo){Bo()})}function Co(Zn){_r.getError(),ci=!1,yi.restore(),bn.restore(),la.restore(),ji.restore(),Ii.restore(),Va.restore(),Da.restore(),ra&&ra.restore(),_a.procs.refresh(),yo(),Ca.forEach(function(Bo){Bo()})}Ga&&(Ga.addEventListener(Gn,Wl,!1),Ga.addEventListener(Po,Co,!1));function Rc(){wn.length=0,Gs(),Ga&&(Ga.removeEventListener(Gn,Wl),Ga.removeEventListener(Po,Co)),bn.clear(),Va.clear(),Ii.clear(),Da.clear(),ji.clear(),Ui.clear(),la.clear(),ra&&ra.clear(),en.forEach(function(Zn){Zn()})}function ys(Zn){function Bo(ve){var be=t({},ve);delete be.uniforms,delete be.attributes,delete be.context,delete be.vao,"stencil"in be&&be.stencil.op&&(be.stencil.opBack=be.stencil.opFront=be.stencil.op,delete be.stencil.op);function Ce(He){if(He in be){var Xe=be[He];delete be[He],Object.keys(Xe).forEach(function(it){be[He+"."+it]=Xe[it]})}}return Ce("blend"),Ce("depth"),Ce("cull"),Ce("stencil"),Ce("polygonOffset"),Ce("scissor"),Ce("sample"),"vao"in ve&&(be.vao=ve.vao),be}function Bs(ve,be){var Ce={},He={};return Object.keys(ve).forEach(function(Xe){var it=ve[Xe];if(p.isDynamic(it)){He[Xe]=p.unbox(it,Xe);return}else if(be&&Array.isArray(it)){for(var Dt=0;Dt0)return cr.call(this,fi(ve|0),ve|0)}else if(Array.isArray(ve)){if(ve.length)return cr.call(this,ve,ve.length)}else return an.call(this,ve)}return t(Ti,{stats:Io,destroy:function(){_s.destroy()}})}var Hu=Va.setFBO=ys({framebuffer:p.define.call(null,As,"framebuffer")});function lc(Zn,Bo){var Bs=0;_a.procs.poll();var gr=Bo.color;gr&&(_r.clearColor(+gr[0]||0,+gr[1]||0,+gr[2]||0,+gr[3]||0),Bs|=Vs),"depth"in Bo&&(_r.clearDepth(+Bo.depth),Bs|=Ho),"stencil"in Bo&&(_r.clearStencil(Bo.stencil|0),Bs|=fa),_r.clear(Bs)}function zc(Zn){if("framebuffer"in Zn)if(Zn.framebuffer&&Zn.framebuffer_reglType==="framebufferCube")for(var Bo=0;Bo<6;++Bo)Hu(t({framebuffer:Zn.framebuffer.faces[Bo]},Zn),lc);else Hu(Zn,lc);else lc(null,Zn)}function Pl(Zn){wn.push(Zn);function Bo(){var Bs=Fl(wn,Zn);function gr(){var hi=Fl(wn,gr);wn[hi]=wn[wn.length-1],wn.length-=1,wn.length<=0&&Gs()}wn[Bs]=gr}return yo(),{cancel:Bo}}function Il(){var Zn=va.viewport,Bo=va.scissor_box;Zn[0]=Zn[1]=Bo[0]=Bo[1]=0,Pi.viewportWidth=Pi.framebufferWidth=Pi.drawingBufferWidth=Zn[2]=Bo[2]=_r.drawingBufferWidth,Pi.viewportHeight=Pi.framebufferHeight=Pi.drawingBufferHeight=Zn[3]=Bo[3]=_r.drawingBufferHeight}function Yl(){Pi.tick+=1,Pi.time=lu(),Il(),_a.procs.poll()}function oo(){ji.refresh(),Il(),_a.procs.refresh(),ra&&ra.update()}function lu(){return(m()-mn)/1e3}oo();function Ms(Zn,Bo){var Bs;switch(Zn){case"frame":return Pl(Bo);case"lost":Bs=Hn;break;case"restore":Bs=Ca;break;case"destroy":Bs=en;break;default:}return Bs.push(Bo),{cancel:function(){for(var gr=0;gr=0},read:ca,destroy:Rc,_gl:_r,_refresh:oo,poll:function(){Yl(),ra&&ra.update()},now:lu,stats:Ni,getCachedCode:uc,preloadCachedCode:Bc});return dr.onDone(null,Oc),Oc}return su}))}}),IZ=de({"node_modules/gl-util/context.js"(e,r){"use strict";var t=rp();r.exports=function(u){if(u?typeof u=="string"&&(u={container:u}):u={},a(u)?u={container:u}:o(u)?u={container:u}:s(u)?u={gl:u}:u=t(u,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),u.pixelRatio||(u.pixelRatio=window.pixelRatio||1),u.gl)return u.gl;if(u.canvas&&(u.container=u.canvas.parentNode),u.container){if(typeof u.container=="string"){var c=document.querySelector(u.container);if(!c)throw Error("Element "+u.container+" is not found");u.container=c}a(u.container)?(u.canvas=u.container,u.container=u.canvas.parentNode):u.canvas||(u.canvas=l(),u.container.appendChild(u.canvas),i(u))}else if(!u.canvas)if(typeof document<"u")u.container=document.body||document.documentElement,u.canvas=l(),u.container.appendChild(u.canvas),i(u);else throw Error("Not DOM environment. Use headless-gl.");return u.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(f){try{u.gl=u.canvas.getContext(f,u.attrs)}catch{}return u.gl}),u.gl};function i(n){if(n.container)if(n.container==document.body)document.body.style.width||(n.canvas.width=n.width||n.pixelRatio*window.innerWidth),document.body.style.height||(n.canvas.height=n.height||n.pixelRatio*window.innerHeight);else{var u=n.container.getBoundingClientRect();n.canvas.width=n.width||u.right-u.left,n.canvas.height=n.height||u.bottom-u.top}}function a(n){return typeof n.getContext=="function"&&"width"in n&&"height"in n}function o(n){return typeof n.nodeName=="string"&&typeof n.appendChild=="function"&&typeof n.getBoundingClientRect=="function"}function s(n){return typeof n.drawArrays=="function"||typeof n.drawElements=="function"}function l(){var n=document.createElement("canvas");return n.style.position="absolute",n.style.top=0,n.style.left=0,n}}}),RZ=de({"node_modules/font-atlas/index.js"(e,r){"use strict";var t=$7(),i=[32,126];r.exports=a;function a(o){o=o||{};var s=o.shape?o.shape:o.canvas?[o.canvas.width,o.canvas.height]:[512,512],l=o.canvas||document.createElement("canvas"),n=o.font,u=typeof o.step=="number"?[o.step,o.step]:o.step||[32,32],c=o.chars||i;if(n&&typeof n!="string"&&(n=t(n)),!Array.isArray(c))c=String(c).split("");else if(c.length===2&&typeof c[0]=="number"&&typeof c[1]=="number"){for(var f=[],h=c[0],d=0;h<=c[1];h++)f[d++]=String.fromCharCode(h);c=f}s=s.slice(),l.width=s[0],l.height=s[1];var p=l.getContext("2d");p.fillStyle="#000",p.fillRect(0,0,l.width,l.height),p.font=n,p.textAlign="center",p.textBaseline="middle",p.fillStyle="#fff";for(var g=u[0]/2,m=u[1]/2,h=0;hs[0]-u[0]/2&&(g=u[0]/2,m+=u[1]);return l}}}),Y7=de({"node_modules/bit-twiddle/twiddle.js"(e){"use strict";"use restrict";var r=32;e.INT_BITS=r,e.INT_MAX=2147483647,e.INT_MIN=-1<0)-(a<0)},e.abs=function(a){var o=a>>r-1;return(a^o)-o},e.min=function(a,o){return o^(a^o)&-(a65535)<<4,a>>>=o,s=(a>255)<<3,a>>>=s,o|=s,s=(a>15)<<2,a>>>=s,o|=s,s=(a>3)<<1,a>>>=s,o|=s,o|a>>1},e.log10=function(a){return a>=1e9?9:a>=1e8?8:a>=1e7?7:a>=1e6?6:a>=1e5?5:a>=1e4?4:a>=1e3?3:a>=100?2:a>=10?1:0},e.popCount=function(a){return a=a-(a>>>1&1431655765),a=(a&858993459)+(a>>>2&858993459),(a+(a>>>4)&252645135)*16843009>>>24};function t(a){var o=32;return a&=-a,a&&o--,a&65535&&(o-=16),a&16711935&&(o-=8),a&252645135&&(o-=4),a&858993459&&(o-=2),a&1431655765&&(o-=1),o}e.countTrailingZeros=t,e.nextPow2=function(a){return a+=a===0,--a,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a+1},e.prevPow2=function(a){return a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a-(a>>>1)},e.parity=function(a){return a^=a>>>16,a^=a>>>8,a^=a>>>4,a&=15,27030>>>a&1};var i=new Array(256);(function(a){for(var o=0;o<256;++o){var s=o,l=o,n=7;for(s>>>=1;s;s>>>=1)l<<=1,l|=s&1,--n;a[o]=l<>>8&255]<<16|i[a>>>16&255]<<8|i[a>>>24&255]},e.interleave2=function(a,o){return a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,a|o<<1},e.deinterleave2=function(a,o){return a=a>>>o&1431655765,a=(a|a>>>1)&858993459,a=(a|a>>>2)&252645135,a=(a|a>>>4)&16711935,a=(a|a>>>16)&65535,a<<16>>16},e.interleave3=function(a,o,s){return a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,a|=o<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,a|s<<2},e.deinterleave3=function(a,o){return a=a>>>o&1227133513,a=(a|a>>>2)&3272356035,a=(a|a>>>4)&251719695,a=(a|a>>>8)&4278190335,a=(a|a>>>16)&1023,a<<22>>22},e.nextCombination=function(a){var o=a|a-1;return o+1|(~o&-~o)-1>>>t(a)+1}}}),zZ=de({"node_modules/dup/dup.js"(e,r){"use strict";function t(o,s,l){var n=o[l]|0;if(n<=0)return[];var u=new Array(n),c;if(l===o.length-1)for(c=0;c"u"&&(s=0),typeof o){case"number":if(o>0)return i(o|0,s);break;case"object":if(typeof o.length=="number")return t(o,s,0);break}return[]}r.exports=a}}),BZ=de({"node_modules/typedarray-pool/pool.js"(e){"use strict";var r=Y7(),t=zZ(),i=kv().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:t([32,0]),UINT16:t([32,0]),UINT32:t([32,0]),BIGUINT64:t([32,0]),INT8:t([32,0]),INT16:t([32,0]),INT32:t([32,0]),BIGINT64:t([32,0]),FLOAT:t([32,0]),DOUBLE:t([32,0]),DATA:t([32,0]),UINT8C:t([32,0]),BUFFER:t([32,0])});var a=typeof Uint8ClampedArray<"u",o=typeof BigUint64Array<"u",s=typeof BigInt64Array<"u",l=window.__TYPEDARRAY_POOL;l.UINT8C||(l.UINT8C=t([32,0])),l.BIGUINT64||(l.BIGUINT64=t([32,0])),l.BIGINT64||(l.BIGINT64=t([32,0])),l.BUFFER||(l.BUFFER=t([32,0]));var n=l.DATA,u=l.BUFFER;e.free=function(b){if(i.isBuffer(b))u[r.log2(b.length)].push(b);else{if(Object.prototype.toString.call(b)!=="[object ArrayBuffer]"&&(b=b.buffer),!b)return;var E=b.length||b.byteLength,T=r.log2(E)|0;n[T].push(b)}};function c(A){if(A){var b=A.length||A.byteLength,E=r.log2(b);n[E].push(A)}}function f(A){c(A.buffer)}e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=f,e.freeArrayBuffer=c,e.freeBuffer=function(b){u[r.log2(b.length)].push(b)},e.malloc=function(b,E){if(E===void 0||E==="arraybuffer")return h(b);switch(E){case"uint8":return d(b);case"uint16":return p(b);case"uint32":return g(b);case"int8":return m(b);case"int16":return y(b);case"int32":return _(b);case"float":case"float32":return v(b);case"double":case"float64":return x(b);case"uint8_clamped":return S(b);case"bigint64":return C(b);case"biguint64":return M(b);case"buffer":return k(b);case"data":case"dataview":return w(b);default:return null}return null};function h(b){var b=r.nextPow2(b),E=r.log2(b),T=n[E];return T.length>0?T.pop():new ArrayBuffer(b)}e.mallocArrayBuffer=h;function d(A){return new Uint8Array(h(A),0,A)}e.mallocUint8=d;function p(A){return new Uint16Array(h(2*A),0,A)}e.mallocUint16=p;function g(A){return new Uint32Array(h(4*A),0,A)}e.mallocUint32=g;function m(A){return new Int8Array(h(A),0,A)}e.mallocInt8=m;function y(A){return new Int16Array(h(2*A),0,A)}e.mallocInt16=y;function _(A){return new Int32Array(h(4*A),0,A)}e.mallocInt32=_;function v(A){return new Float32Array(h(4*A),0,A)}e.mallocFloat32=e.mallocFloat=v;function x(A){return new Float64Array(h(8*A),0,A)}e.mallocFloat64=e.mallocDouble=x;function S(A){return a?new Uint8ClampedArray(h(A),0,A):d(A)}e.mallocUint8Clamped=S;function M(A){return o?new BigUint64Array(h(8*A),0,A):null}e.mallocBigUint64=M;function C(A){return s?new BigInt64Array(h(8*A),0,A):null}e.mallocBigInt64=C;function w(A){return new DataView(h(A),0,A)}e.mallocDataView=w;function k(A){A=r.nextPow2(A);var b=r.log2(A),E=u[b];return E.length>0?E.pop():new i(A)}e.mallocBuffer=k,e.clearCache=function(){for(var b=0;b<32;++b)l.UINT8[b].length=0,l.UINT16[b].length=0,l.UINT32[b].length=0,l.INT8[b].length=0,l.INT16[b].length=0,l.INT32[b].length=0,l.FLOAT[b].length=0,l.DOUBLE[b].length=0,l.BIGUINT64[b].length=0,l.BIGINT64[b].length=0,l.UINT8C[b].length=0,n[b].length=0,u[b].length=0}}}),OZ=de({"node_modules/is-plain-obj/index.js"(e,r){"use strict";var t=Object.prototype.toString;r.exports=function(i){var a;return t.call(i)==="[object Object]"&&(a=Object.getPrototypeOf(i),a===null||a===Object.getPrototypeOf({}))}}}),X7=de({"node_modules/parse-unit/index.js"(e,r){r.exports=function(i,a){a||(a=[0,""]),i=String(i);var o=parseFloat(i,10);return a[0]=o,a[1]=i.match(/[\d.\-\+]*\s*(.*)/)[1]||"",a}}}),NZ=de({"node_modules/gl-text/node_modules/to-px/topx.js"(e,r){"use strict";var t=X7();r.exports=s;var i=96;function a(l,n){var u=t(getComputedStyle(l).getPropertyValue(n));return u[0]*s(u[1],l)}function o(l,n){var u=document.createElement("div");u.style["font-size"]="128"+l,n.appendChild(u);var c=a(u,"font-size")/128;return n.removeChild(u),c}function s(l,n){switch(n=n||document.body,l=(l||"px").trim().toLowerCase(),(n===window||n===document)&&(n=document.body),l){case"%":return n.clientHeight/100;case"ch":case"ex":return o(l,n);case"em":return a(n,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}}}),jZ=de({"node_modules/detect-kerning/index.js"(e,r){"use strict";r.exports=o;var t=o.canvas=document.createElement("canvas"),i=t.getContext("2d"),a=s([32,126]);o.createPairs=s,o.ascii=a;function o(l,n){Array.isArray(l)&&(l=l.join(", "));var u={},c,f=16,h=.05;n&&(n.length===2&&typeof n[0]=="number"?c=s(n):Array.isArray(n)?c=n:(n.o?c=s(n.o):n.pairs&&(c=n.pairs),n.fontSize&&(f=n.fontSize),n.threshold!=null&&(h=n.threshold))),c||(c=a),i.font=f+"px "+l;for(var d=0;df*h){var y=(m-g)/f;u[p]=y*1e3}}return u}function s(l){for(var n=[],u=l[0];u<=l[1];u++)for(var c=String.fromCharCode(u),f=l[0];f0;u-=4)if(n[u]!==0)return Math.floor((u-3)*.25/l)}}}),qZ=de({"node_modules/gl-text/dist.js"(e,r){"use strict";var t=PZ(),i=rp(),a=W7(),o=IZ(),s=O7(),l=b_(),n=RZ(),u=BZ(),c=z1(),f=OZ(),h=X7(),d=NZ(),p=jZ(),g=du(),m=UZ(),y=Vv(),_=Y7(),v=_.nextPow2,x=new s,S=!1;document.body&&(M=document.body.appendChild(document.createElement("div")),M.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(M).fontStretch&&(S=!0),document.body.removeChild(M));var M,C=function(A){w(A)?(A={regl:A},this.gl=A.regl._gl):this.gl=o(A),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=A.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(f(A)?A:{})};C.prototype.createShader=function(){var A=this.regl,b=A({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:A.prop("count"),offset:A.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:A.this("sizeBuffer")},width:{offset:0,stride:8,buffer:A.this("sizeBuffer")},char:A.this("charBuffer"),position:A.this("position")},uniforms:{atlasSize:function(T,F){return[F.atlas.width,F.atlas.height]},atlasDim:function(T,F){return[F.atlas.cols,F.atlas.rows]},atlas:function(T,F){return F.atlas.texture},charStep:function(T,F){return F.atlas.step},em:function(T,F){return F.atlas.em},color:A.prop("color"),opacity:A.prop("opacity"),viewport:A.this("viewportArray"),scale:A.this("scale"),align:A.prop("align"),baseline:A.prop("baseline"),translate:A.this("translate"),positionOffset:A.prop("positionOffset")},primitive:"points",viewport:A.this("viewport"),vert:` +`),Ei;if(dr&&(Ei=ud(Hr),dr[Ei]))return dr[Ei].apply(null,ci);var Yi=Function.apply(null,Kr.concat(Hr));return dr&&(dr[Ei]=Yi),Yi.apply(null,ci)}return{global:ra,link:si,block:Ni,proc:Wa,scope:Ji,cond:Qi,compile:xa}}var Oa="xyzw".split(""),Pa=5121,Ja=1,rn=2,Zi=0,sa=1,vn=2,Dn=3,po=4,zo=5,wo=6,$o="dither",io="blend.enable",Us="blend.color",gs="blend.equation",Go="blend.func",ma="depth.enable",vo="depth.func",Ls="depth.range",qs="depth.mask",Ll="colorMask",bu="cull.enable",Gl="cull.face",ac="frontFace",bl="lineWidth",Uu="polygonOffset.enable",Fc="polygonOffset.offset",Kc="sample.alpha",cd="sample.enable",Qf="sample.coverage",Vd="stencil.enable",Ph="stencil.mask",Hl="stencil.func",Gd="stencil.opFront",Mf="stencil.opBack",Ih="scissor.enable",Rh="scissor.box",qu="viewport",fd="profile",Jc="framebuffer",eh="vert",Qc="frag",wu="elements",ef="primitive",Sf="count",hd="offset",$l="instances",Se="vao",Ie="Width",Ge="Height",$e=Jc+Ie,st=Jc+Ge,ot=qu+Ie,pt=qu+Ge,Vt="drawingBuffer",tr=Vt+Ie,Ut=Vt+Ge,rr=[Go,gs,Hl,Gd,Mf,Qf,qu,Rh,Fc],pr=34962,Sr=34963,Rr=2884,Zr=3042,wi=3024,qi=2960,Aa=2929,un=3089,gn=32823,Tn=32926,Pn=32928,Eo=5126,qo=35664,Wn=35665,ls=35666,ol=5124,wl=35667,Vu=35668,Pc=35669,dl=35670,pl=35671,Tu=35672,nc=35673,oc=35674,sc=35675,Ic=35676,Gu=35678,tf=35680,th=4,re=1028,he=1029,we=2304,Le=2305,Re=32775,Oe=32776,ut=519,et=7680,_t=0,Ft=1,Rt=32774,lr=513,sr=36160,Fr=36064,Or={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},hr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},wr={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Cr={cw:we,ccw:Le};function Nr(bt){return Array.isArray(bt)||mt(bt)||Mt(bt)}function jr(bt){return bt.sort(function(dr,_r){return dr===qu?-1:_r===qu?1:dr<_r?-1:1})}function Ar(bt,dr,_r,Kr){this.thisDep=bt,this.contextDep=dr,this.propDep=_r,this.append=Kr}function Ci(bt){return bt&&!(bt.thisDep||bt.contextDep||bt.propDep)}function Gi(bt){return new Ar(!1,!1,!1,bt)}function aa(bt,dr){var _r=bt.type;if(_r===Zi){var Kr=bt.data.length;return new Ar(!0,Kr>=1,Kr>=2,dr)}else if(_r===po){var ci=bt.data;return new Ar(ci.thisDep,ci.contextDep,ci.propDep,dr)}else{if(_r===zo)return new Ar(!1,!1,!1,dr);if(_r===wo){for(var yi=!1,si=!1,Ni=!1,Ji=0;Ji=1&&(si=!0),ra>=2&&(Ni=!0)}else Qi.type===po&&(yi=yi||Qi.data.thisDep,si=si||Qi.data.contextDep,Ni=Ni||Qi.data.propDep)}return new Ar(yi,si,Ni,dr)}else return new Ar(_r===Dn,_r===vn,_r===sa,dr)}}var ga=new Ar(!1,!1,!1,function(){});function qa(bt,dr,_r,Kr,ci,yi,si,Ni,Ji,Qi,ra,mn,Wa,xa,Pi,Hr){var Ei=Qi.Record,Yi={add:32774,subtract:32778,"reverse subtract":32779};_r.ext_blend_minmax&&(Yi.min=Re,Yi.max=Oe);var la=_r.angle_instanced_arrays,Ui=_r.webgl_draw_buffers,Da=_r.oes_vertex_array_object,wa={dirty:!0,profile:Hr.profile},bn={},ji=[],Ii={},Va={};function _a(cr){return cr.replace(".","_")}function ca(cr,xr,kr){var fi=_a(cr);ji.push(cr),bn[fi]=wa[fi]=!!kr,Ii[fi]=xr}function va(cr,xr,kr){var fi=_a(cr);ji.push(cr),Array.isArray(kr)?(wa[fi]=kr.slice(),bn[fi]=kr.slice()):wa[fi]=bn[fi]=kr,Va[fi]=xr}function Ga(cr){return!!isNaN(cr)}ca($o,wi),ca(io,Zr),va(Us,"blendColor",[0,0,0,0]),va(gs,"blendEquationSeparate",[Rt,Rt]),va(Go,"blendFuncSeparate",[Ft,_t,Ft,_t]),ca(ma,Aa,!0),va(vo,"depthFunc",lr),va(Ls,"depthRange",[0,1]),va(qs,"depthMask",!0),va(Ll,Ll,[!0,!0,!0,!0]),ca(bu,Rr),va(Gl,"cullFace",he),va(ac,ac,Le),va(bl,bl,1),ca(Uu,gn),va(Fc,"polygonOffset",[0,0]),ca(Kc,Tn),ca(cd,Pn),va(Qf,"sampleCoverage",[1,!1]),ca(Vd,qi),va(Ph,"stencilMask",-1),va(Hl,"stencilFunc",[ut,0,-1]),va(Gd,"stencilOpSeparate",[re,et,et,et]),va(Mf,"stencilOpSeparate",[he,et,et,et]),ca(Ih,un),va(Rh,"scissor",[0,0,bt.drawingBufferWidth,bt.drawingBufferHeight]),va(qu,qu,[0,0,bt.drawingBufferWidth,bt.drawingBufferHeight]);var wn={gl:bt,context:Wa,strings:dr,next:bn,current:wa,draw:mn,elements:yi,buffer:ci,shader:ra,attributes:Qi.state,vao:Qi,uniforms:Ji,framebuffer:Ni,extensions:_r,timer:xa,isBufferArgs:Nr},Hn={primTypes:bi,compareFuncs:hr,blendFuncs:Or,blendEquations:Yi,stencilOps:wr,glTypes:fr,orientationType:Cr};Ui&&(Hn.backBuffer=[he],Hn.drawBuffer=A(Kr.maxDrawbuffers,function(cr){return cr===0?[0]:A(cr,function(xr){return Fr+xr})}));var Ca=0;function en(){var cr=Wi({cache:Pi}),xr=cr.link,kr=cr.global;cr.id=Ca++,cr.batchId="0";var fi=xr(wn),Ti=cr.shared={props:"a0"};Object.keys(wn).forEach(function(Xe){Ti[Xe]=kr.def(fi,".",Xe)});var ve=cr.next={},be=cr.current={};Object.keys(Va).forEach(function(Xe){Array.isArray(wa[Xe])&&(ve[Xe]=kr.def(Ti.next,".",Xe),be[Xe]=kr.def(Ti.current,".",Xe))});var Ce=cr.constants={};Object.keys(Hn).forEach(function(Xe){Ce[Xe]=kr.def(JSON.stringify(Hn[Xe]))}),cr.invoke=function(Xe,it){switch(it.type){case Zi:var Dt=["this",Ti.context,Ti.props,cr.batchId];return Xe.def(xr(it.data),".call(",Dt.slice(0,Math.max(it.data.length+1,4)),")");case sa:return Xe.def(Ti.props,it.data);case vn:return Xe.def(Ti.context,it.data);case Dn:return Xe.def("this",it.data);case po:return it.data.append(cr,Xe),it.data.ref;case zo:return it.data.toString();case wo:return it.data.map(function(or){return cr.invoke(Xe,or)})}},cr.attribCache={};var He={};return cr.scopeAttrib=function(Xe){var it=dr.id(Xe);if(it in He)return He[it];var Dt=Qi.scope[it];Dt||(Dt=Qi.scope[it]=new Ei);var or=He[it]=xr(Dt);return or},cr}function Un(cr){var xr=cr.static,kr=cr.dynamic,fi;if(fd in xr){var Ti=!!xr[fd];fi=Gi(function(be,Ce){return Ti}),fi.enable=Ti}else if(fd in kr){var ve=kr[fd];fi=aa(ve,function(be,Ce){return be.invoke(Ce,ve)})}return fi}function qn(cr,xr){var kr=cr.static,fi=cr.dynamic;if(Jc in kr){var Ti=kr[Jc];return Ti?(Ti=Ni.getFramebuffer(Ti),Gi(function(be,Ce){var He=be.link(Ti),Xe=be.shared;Ce.set(Xe.framebuffer,".next",He);var it=Xe.context;return Ce.set(it,"."+$e,He+".width"),Ce.set(it,"."+st,He+".height"),He})):Gi(function(be,Ce){var He=be.shared;Ce.set(He.framebuffer,".next","null");var Xe=He.context;return Ce.set(Xe,"."+$e,Xe+"."+tr),Ce.set(Xe,"."+st,Xe+"."+Ut),"null"})}else if(Jc in fi){var ve=fi[Jc];return aa(ve,function(be,Ce){var He=be.invoke(Ce,ve),Xe=be.shared,it=Xe.framebuffer,Dt=Ce.def(it,".getFramebuffer(",He,")");Ce.set(it,".next",Dt);var or=Xe.context;return Ce.set(or,"."+$e,Dt+"?"+Dt+".width:"+or+"."+tr),Ce.set(or,"."+st,Dt+"?"+Dt+".height:"+or+"."+Ut),Dt})}else return null}function yo(cr,xr,kr){var fi=cr.static,Ti=cr.dynamic;function ve(He){if(He in fi){var Xe=fi[He],it=!0,Dt=Xe.x|0,or=Xe.y|0,Dr,vi;return"width"in Xe?Dr=Xe.width|0:it=!1,"height"in Xe?vi=Xe.height|0:it=!1,new Ar(!it&&xr&&xr.thisDep,!it&&xr&&xr.contextDep,!it&&xr&&xr.propDep,function(Oi,Si){var zi=Oi.shared.context,Vi=Dr;"width"in Xe||(Vi=Si.def(zi,".",$e,"-",Dt));var Xi=vi;return"height"in Xe||(Xi=Si.def(zi,".",st,"-",or)),[Dt,or,Vi,Xi]})}else if(He in Ti){var ai=Ti[He],ei=aa(ai,function(Oi,Si){var zi=Oi.invoke(Si,ai),Vi=Oi.shared.context,Xi=Si.def(zi,".x|0"),ha=Si.def(zi,".y|0"),$a=Si.def('"width" in ',zi,"?",zi,".width|0:","(",Vi,".",$e,"-",Xi,")"),_o=Si.def('"height" in ',zi,"?",zi,".height|0:","(",Vi,".",st,"-",ha,")");return[Xi,ha,$a,_o]});return xr&&(ei.thisDep=ei.thisDep||xr.thisDep,ei.contextDep=ei.contextDep||xr.contextDep,ei.propDep=ei.propDep||xr.propDep),ei}else return xr?new Ar(xr.thisDep,xr.contextDep,xr.propDep,function(Oi,Si){var zi=Oi.shared.context;return[0,0,Si.def(zi,".",$e),Si.def(zi,".",st)]}):null}var be=ve(qu);if(be){var Ce=be;be=new Ar(be.thisDep,be.contextDep,be.propDep,function(He,Xe){var it=Ce.append(He,Xe),Dt=He.shared.context;return Xe.set(Dt,"."+ot,it[2]),Xe.set(Dt,"."+pt,it[3]),it})}return{viewport:be,scissor_box:ve(Rh)}}function Gs(cr,xr){var kr=cr.static,fi=typeof kr[Qc]=="string"&&typeof kr[eh]=="string";if(fi){if(Object.keys(xr.dynamic).length>0)return null;var Ti=xr.static,ve=Object.keys(Ti);if(ve.length>0&&typeof Ti[ve[0]]=="number"){for(var be=[],Ce=0;Ce"+Xi+"?"+it+".constant["+Xi+"]:0;"}).join(""),"}}else{","if(",Dr,"(",it,".buffer)){",Oi,"=",vi,".createStream(",pr,",",it,".buffer);","}else{",Oi,"=",vi,".getBuffer(",it,".buffer);","}",Si,'="type" in ',it,"?",or.glTypes,"[",it,".type]:",Oi,".dtype;",ai.normalized,"=!!",it,".normalized;");function zi(Vi){Xe(ai[Vi],"=",it,".",Vi,"|0;")}return zi("size"),zi("offset"),zi("stride"),zi("divisor"),Xe("}}"),Xe.exit("if(",ai.isStream,"){",vi,".destroyStream(",Oi,");","}"),ai}Ti[ve]=aa(be,Ce)}),Ti}function lc(cr){var xr=cr.static,kr=cr.dynamic,fi={};return Object.keys(xr).forEach(function(Ti){var ve=xr[Ti];fi[Ti]=Gi(function(be,Ce){return typeof ve=="number"||typeof ve=="boolean"?""+ve:be.link(ve)})}),Object.keys(kr).forEach(function(Ti){var ve=kr[Ti];fi[Ti]=aa(ve,function(be,Ce){return be.invoke(Ce,ve)})}),fi}function zc(cr,xr,kr,fi,Ti){var ve=cr.static,be=cr.dynamic,Ce=Gs(cr,xr),He=qn(cr,Ti),Xe=yo(cr,He,Ti),it=Co(cr,Ti),Dt=Rc(cr,Ti),or=Wl(cr,Ti,Ce);function Dr(zi){var Vi=Xe[zi];Vi&&(Dt[zi]=Vi)}Dr(qu),Dr(_a(Rh));var vi=Object.keys(Dt).length>0,ai={framebuffer:He,draw:it,shader:or,state:Dt,dirty:vi,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(ai.profile=Un(cr,Ti),ai.uniforms=ys(kr,Ti),ai.drawVAO=ai.scopeVAO=it.vao,!ai.drawVAO&&or.program&&!Ce&&_r.angle_instanced_arrays&&it.static.elements){var ei=!0,Oi=or.program.attributes.map(function(zi){var Vi=xr.static[zi];return ei=ei&&!!Vi,Vi});if(ei&&Oi.length>0){var Si=Qi.getVAO(Qi.createVAO({attributes:Oi,elements:it.static.elements}));ai.drawVAO=new Ar(null,null,null,function(zi,Vi){return zi.link(Si)}),ai.useVAO=!0}}return Ce?ai.useVAO=!0:ai.attributes=Hu(xr,Ti),ai.context=lc(fi,Ti),ai}function Pl(cr,xr,kr){var fi=cr.shared,Ti=fi.context,ve=cr.scope();Object.keys(kr).forEach(function(be){xr.save(Ti,"."+be);var Ce=kr[be],He=Ce.append(cr,xr);Array.isArray(He)?ve(Ti,".",be,"=[",He.join(),"];"):ve(Ti,".",be,"=",He,";")}),xr(ve)}function Il(cr,xr,kr,fi){var Ti=cr.shared,ve=Ti.gl,be=Ti.framebuffer,Ce;Ui&&(Ce=xr.def(Ti.extensions,".webgl_draw_buffers"));var He=cr.constants,Xe=He.drawBuffer,it=He.backBuffer,Dt;kr?Dt=kr.append(cr,xr):Dt=xr.def(be,".next"),fi||xr("if(",Dt,"!==",be,".cur){"),xr("if(",Dt,"){",ve,".bindFramebuffer(",sr,",",Dt,".framebuffer);"),Ui&&xr(Ce,".drawBuffersWEBGL(",Xe,"[",Dt,".colorAttachments.length]);"),xr("}else{",ve,".bindFramebuffer(",sr,",null);"),Ui&&xr(Ce,".drawBuffersWEBGL(",it,");"),xr("}",be,".cur=",Dt,";"),fi||xr("}")}function Yl(cr,xr,kr){var fi=cr.shared,Ti=fi.gl,ve=cr.current,be=cr.next,Ce=fi.current,He=fi.next,Xe=cr.cond(Ce,".dirty");ji.forEach(function(it){var Dt=_a(it);if(!(Dt in kr.state)){var or,Dr;if(Dt in be){or=be[Dt],Dr=ve[Dt];var vi=A(wa[Dt].length,function(ei){return Xe.def(or,"[",ei,"]")});Xe(cr.cond(vi.map(function(ei,Oi){return ei+"!=="+Dr+"["+Oi+"]"}).join("||")).then(Ti,".",Va[Dt],"(",vi,");",vi.map(function(ei,Oi){return Dr+"["+Oi+"]="+ei}).join(";"),";"))}else{or=Xe.def(He,".",Dt);var ai=cr.cond(or,"!==",Ce,".",Dt);Xe(ai),Dt in Ii?ai(cr.cond(or).then(Ti,".enable(",Ii[Dt],");").else(Ti,".disable(",Ii[Dt],");"),Ce,".",Dt,"=",or,";"):ai(Ti,".",Va[Dt],"(",or,");",Ce,".",Dt,"=",or,";")}}}),Object.keys(kr.state).length===0&&Xe(Ce,".dirty=false;"),xr(Xe)}function oo(cr,xr,kr,fi){var Ti=cr.shared,ve=cr.current,be=Ti.current,Ce=Ti.gl,He;jr(Object.keys(kr)).forEach(function(Xe){var it=kr[Xe];if(!(fi&&!fi(it))){var Dt=it.append(cr,xr);if(Ii[Xe]){var or=Ii[Xe];Ci(it)?(He=cr.link(Dt,{stable:!0}),xr(cr.cond(He).then(Ce,".enable(",or,");").else(Ce,".disable(",or,");")),xr(be,".",Xe,"=",He,";")):(xr(cr.cond(Dt).then(Ce,".enable(",or,");").else(Ce,".disable(",or,");")),xr(be,".",Xe,"=",Dt,";"))}else if(Kt(Dt)){var Dr=ve[Xe];xr(Ce,".",Va[Xe],"(",Dt,");",Dt.map(function(vi,ai){return Dr+"["+ai+"]="+vi}).join(";"),";")}else Ci(it)?(He=cr.link(Dt,{stable:!0}),xr(Ce,".",Va[Xe],"(",He,");",be,".",Xe,"=",He,";")):xr(Ce,".",Va[Xe],"(",Dt,");",be,".",Xe,"=",Dt,";")}})}function lu(cr,xr){la&&(cr.instancing=xr.def(cr.shared.extensions,".angle_instanced_arrays"))}function Ms(cr,xr,kr,fi,Ti){var ve=cr.shared,be=cr.stats,Ce=ve.current,He=ve.timer,Xe=kr.profile;function it(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Dt,or;function Dr(zi){Dt=xr.def(),zi(Dt,"=",it(),";"),typeof Ti=="string"?zi(be,".count+=",Ti,";"):zi(be,".count++;"),xa&&(fi?(or=xr.def(),zi(or,"=",He,".getNumPendingQueries();")):zi(He,".beginQuery(",be,");"))}function vi(zi){zi(be,".cpuTime+=",it(),"-",Dt,";"),xa&&(fi?zi(He,".pushScopeStats(",or,",",He,".getNumPendingQueries(),",be,");"):zi(He,".endQuery();"))}function ai(zi){var Vi=xr.def(Ce,".profile");xr(Ce,".profile=",zi,";"),xr.exit(Ce,".profile=",Vi,";")}var ei;if(Xe){if(Ci(Xe)){Xe.enable?(Dr(xr),vi(xr.exit),ai("true")):ai("false");return}ei=Xe.append(cr,xr),ai(ei)}else ei=xr.def(Ce,".profile");var Oi=cr.block();Dr(Oi),xr("if(",ei,"){",Oi,"}");var Si=cr.block();vi(Si),xr.exit("if(",ei,"){",Si,"}")}function uc(cr,xr,kr,fi,Ti){var ve=cr.shared;function be(He){switch(He){case qo:case wl:case pl:return 2;case Wn:case Vu:case Tu:return 3;case ls:case Pc:case nc:return 4;default:return 1}}function Ce(He,Xe,it){var Dt=ve.gl,or=xr.def(He,".location"),Dr=xr.def(ve.attributes,"[",or,"]"),vi=it.state,ai=it.buffer,ei=[it.x,it.y,it.z,it.w],Oi=["buffer","normalized","offset","stride"];function Si(){xr("if(!",Dr,".buffer){",Dt,".enableVertexAttribArray(",or,");}");var Vi=it.type,Xi;if(it.size?Xi=xr.def(it.size,"||",Xe):Xi=Xe,xr("if(",Dr,".type!==",Vi,"||",Dr,".size!==",Xi,"||",Oi.map(function($a){return Dr+"."+$a+"!=="+it[$a]}).join("||"),"){",Dt,".bindBuffer(",pr,",",ai,".buffer);",Dt,".vertexAttribPointer(",[or,Xi,Vi,it.normalized,it.stride,it.offset],");",Dr,".type=",Vi,";",Dr,".size=",Xi,";",Oi.map(function($a){return Dr+"."+$a+"="+it[$a]+";"}).join(""),"}"),la){var ha=it.divisor;xr("if(",Dr,".divisor!==",ha,"){",cr.instancing,".vertexAttribDivisorANGLE(",[or,ha],");",Dr,".divisor=",ha,";}")}}function zi(){xr("if(",Dr,".buffer){",Dt,".disableVertexAttribArray(",or,");",Dr,".buffer=null;","}if(",Oa.map(function(Vi,Xi){return Dr+"."+Vi+"!=="+ei[Xi]}).join("||"),"){",Dt,".vertexAttrib4f(",or,",",ei,");",Oa.map(function(Vi,Xi){return Dr+"."+Vi+"="+ei[Xi]+";"}).join(""),"}")}vi===Ja?Si():vi===rn?zi():(xr("if(",vi,"===",Ja,"){"),Si(),xr("}else{"),zi(),xr("}"))}fi.forEach(function(He){var Xe=He.name,it=kr.attributes[Xe],Dt;if(it){if(!Ti(it))return;Dt=it.append(cr,xr)}else{if(!Ti(ga))return;var or=cr.scopeAttrib(Xe);Dt={},Object.keys(new Ei).forEach(function(Dr){Dt[Dr]=xr.def(or,".",Dr)})}Ce(cr.link(He),be(He.info.type),Dt)})}function Bc(cr,xr,kr,fi,Ti,ve){for(var be=cr.shared,Ce=be.gl,He,Xe=0;Xe1){for(var xs=[],el=[],vl=0;vl>1)",ai],");")}function ha(){kr(ei,".drawArraysInstancedANGLE(",[or,Dr,vi,ai],");")}it&&it!=="null"?Si?Xi():(kr("if(",it,"){"),Xi(),kr("}else{"),ha(),kr("}")):ha()}function Vi(){function Xi(){kr(ve+".drawElements("+[or,vi,Oi,Dr+"<<(("+Oi+"-"+Pa+")>>1)"]+");")}function ha(){kr(ve+".drawArrays("+[or,Dr,vi]+");")}it&&it!=="null"?Si?Xi():(kr("if(",it,"){"),Xi(),kr("}else{"),ha(),kr("}")):ha()}la&&(typeof ai!="number"||ai>=0)?typeof ai=="string"?(kr("if(",ai,">0){"),zi(),kr("}else if(",ai,"<0){"),Vi(),kr("}")):zi():Vi()}function Zn(cr,xr,kr,fi,Ti){var ve=en(),be=ve.proc("body",Ti);return la&&(ve.instancing=be.def(ve.shared.extensions,".angle_instanced_arrays")),cr(ve,be,kr,fi),ve.compile().body}function Bo(cr,xr,kr,fi){lu(cr,xr),kr.useVAO?kr.drawVAO?xr(cr.shared.vao,".setVAO(",kr.drawVAO.append(cr,xr),");"):xr(cr.shared.vao,".setVAO(",cr.shared.vao,".targetVAO);"):(xr(cr.shared.vao,".setVAO(null);"),uc(cr,xr,kr,fi.attributes,function(){return!0})),Bc(cr,xr,kr,fi.uniforms,function(){return!0},!1),Oc(cr,xr,xr,kr)}function Os(cr,xr){var kr=cr.proc("draw",1);lu(cr,kr),Pl(cr,kr,xr.context),Il(cr,kr,xr.framebuffer),Yl(cr,kr,xr),oo(cr,kr,xr.state),Ms(cr,kr,xr,!1,!0);var fi=xr.shader.progVar.append(cr,kr);if(kr(cr.shared.gl,".useProgram(",fi,".program);"),xr.shader.program)Bo(cr,kr,xr,xr.shader.program);else{kr(cr.shared.vao,".setVAO(null);");var Ti=cr.global.def("{}"),ve=kr.def(fi,".id"),be=kr.def(Ti,"[",ve,"]");kr(cr.cond(be).then(be,".call(this,a0);").else(be,"=",Ti,"[",ve,"]=",cr.link(function(Ce){return Zn(Bo,cr,xr,Ce,1)}),"(",fi,");",be,".call(this,a0);"))}Object.keys(xr.state).length>0&&kr(cr.shared.current,".dirty=true;"),cr.shared.vao&&kr(cr.shared.vao,".setVAO(null);")}function gr(cr,xr,kr,fi){cr.batchId="a1",lu(cr,xr);function Ti(){return!0}uc(cr,xr,kr,fi.attributes,Ti),Bc(cr,xr,kr,fi.uniforms,Ti,!1),Oc(cr,xr,xr,kr)}function hi(cr,xr,kr,fi){lu(cr,xr);var Ti=kr.contextDep,ve=xr.def(),be="a0",Ce="a1",He=xr.def();cr.shared.props=He,cr.batchId=ve;var Xe=cr.scope(),it=cr.scope();xr(Xe.entry,"for(",ve,"=0;",ve,"<",Ce,";++",ve,"){",He,"=",be,"[",ve,"];",it,"}",Xe.exit);function Dt(Oi){return Oi.contextDep&&Ti||Oi.propDep}function or(Oi){return!Dt(Oi)}if(kr.needsContext&&Pl(cr,it,kr.context),kr.needsFramebuffer&&Il(cr,it,kr.framebuffer),oo(cr,it,kr.state,Dt),kr.profile&&Dt(kr.profile)&&Ms(cr,it,kr,!1,!0),fi)kr.useVAO?kr.drawVAO?Dt(kr.drawVAO)?it(cr.shared.vao,".setVAO(",kr.drawVAO.append(cr,it),");"):Xe(cr.shared.vao,".setVAO(",kr.drawVAO.append(cr,Xe),");"):Xe(cr.shared.vao,".setVAO(",cr.shared.vao,".targetVAO);"):(Xe(cr.shared.vao,".setVAO(null);"),uc(cr,Xe,kr,fi.attributes,or),uc(cr,it,kr,fi.attributes,Dt)),Bc(cr,Xe,kr,fi.uniforms,or,!1),Bc(cr,it,kr,fi.uniforms,Dt,!0),Oc(cr,Xe,it,kr);else{var Dr=cr.global.def("{}"),vi=kr.shader.progVar.append(cr,it),ai=it.def(vi,".id"),ei=it.def(Dr,"[",ai,"]");it(cr.shared.gl,".useProgram(",vi,".program);","if(!",ei,"){",ei,"=",Dr,"[",ai,"]=",cr.link(function(Oi){return Zn(gr,cr,kr,Oi,2)}),"(",vi,");}",ei,".call(this,a0[",ve,"],",ve,");")}}function di(cr,xr){var kr=cr.proc("batch",2);cr.batchId="0",lu(cr,kr);var fi=!1,Ti=!0;Object.keys(xr.context).forEach(function(Dr){fi=fi||xr.context[Dr].propDep}),fi||(Pl(cr,kr,xr.context),Ti=!1);var ve=xr.framebuffer,be=!1;ve?(ve.propDep?fi=be=!0:ve.contextDep&&fi&&(be=!0),be||Il(cr,kr,ve)):Il(cr,kr,null),xr.state.viewport&&xr.state.viewport.propDep&&(fi=!0);function Ce(Dr){return Dr.contextDep&&fi||Dr.propDep}Yl(cr,kr,xr),oo(cr,kr,xr.state,function(Dr){return!Ce(Dr)}),(!xr.profile||!Ce(xr.profile))&&Ms(cr,kr,xr,!1,"a1"),xr.contextDep=fi,xr.needsContext=Ti,xr.needsFramebuffer=be;var He=xr.shader.progVar;if(He.contextDep&&fi||He.propDep)hi(cr,kr,xr,null);else{var Xe=He.append(cr,kr);if(kr(cr.shared.gl,".useProgram(",Xe,".program);"),xr.shader.program)hi(cr,kr,xr,xr.shader.program);else{kr(cr.shared.vao,".setVAO(null);");var it=cr.global.def("{}"),Dt=kr.def(Xe,".id"),or=kr.def(it,"[",Dt,"]");kr(cr.cond(or).then(or,".call(this,a0,a1);").else(or,"=",it,"[",Dt,"]=",cr.link(function(Dr){return Zn(hi,cr,xr,Dr,2)}),"(",Xe,");",or,".call(this,a0,a1);"))}}Object.keys(xr.state).length>0&&kr(cr.shared.current,".dirty=true;"),cr.shared.vao&&kr(cr.shared.vao,".setVAO(null);")}function sn(cr,xr){var kr=cr.proc("scope",3);cr.batchId="a2";var fi=cr.shared,Ti=fi.current;if(Pl(cr,kr,xr.context),xr.framebuffer&&xr.framebuffer.append(cr,kr),jr(Object.keys(xr.state)).forEach(function(Ce){var He=xr.state[Ce],Xe=He.append(cr,kr);Kt(Xe)?Xe.forEach(function(it,Dt){Ga(it)?kr.set(cr.next[Ce],"["+Dt+"]",it):kr.set(cr.next[Ce],"["+Dt+"]",cr.link(it,{stable:!0}))}):Ci(He)?kr.set(fi.next,"."+Ce,cr.link(Xe,{stable:!0})):kr.set(fi.next,"."+Ce,Xe)}),Ms(cr,kr,xr,!0,!0),[wu,hd,Sf,$l,ef].forEach(function(Ce){var He=xr.draw[Ce];if(He){var Xe=He.append(cr,kr);Ga(Xe)?kr.set(fi.draw,"."+Ce,Xe):kr.set(fi.draw,"."+Ce,cr.link(Xe),{stable:!0})}}),Object.keys(xr.uniforms).forEach(function(Ce){var He=xr.uniforms[Ce].append(cr,kr);Array.isArray(He)&&(He="["+He.map(function(Xe){return Ga(Xe)?Xe:cr.link(Xe,{stable:!0})})+"]"),kr.set(fi.uniforms,"["+cr.link(dr.id(Ce),{stable:!0})+"]",He)}),Object.keys(xr.attributes).forEach(function(Ce){var He=xr.attributes[Ce].append(cr,kr),Xe=cr.scopeAttrib(Ce);Object.keys(new Ei).forEach(function(it){kr.set(Xe,"."+it,He[it])})}),xr.scopeVAO){var ve=xr.scopeVAO.append(cr,kr);Ga(ve)?kr.set(fi.vao,".targetVAO",ve):kr.set(fi.vao,".targetVAO",cr.link(ve,{stable:!0}))}function be(Ce){var He=xr.shader[Ce];if(He){var Xe=He.append(cr,kr);Ga(Xe)?kr.set(fi.shader,"."+Ce,Xe):kr.set(fi.shader,"."+Ce,cr.link(Xe,{stable:!0}))}}be(eh),be(Qc),Object.keys(xr.state).length>0&&(kr(Ti,".dirty=true;"),kr.exit(Ti,".dirty=true;")),kr("a1(",cr.shared.context,",a0,",cr.batchId,");")}function Io(cr){if(!(typeof cr!="object"||Kt(cr))){for(var xr=Object.keys(cr),kr=0;kr=0;--Zn){var Bo=wn[Zn];Bo&&Bo(Pi,null,0)}_r.flush(),ra&&ra.update()}function yo(){!Un&&wn.length>0&&(Un=g.next(qn))}function Gs(){Un&&(g.cancel(qn),Un=null)}function Wl(Zn){Zn.preventDefault(),ci=!0,Gs(),Hn.forEach(function(Bo){Bo()})}function Co(Zn){_r.getError(),ci=!1,yi.restore(),bn.restore(),la.restore(),ji.restore(),Ii.restore(),Va.restore(),Da.restore(),ra&&ra.restore(),_a.procs.refresh(),yo(),Ca.forEach(function(Bo){Bo()})}Ga&&(Ga.addEventListener(Gn,Wl,!1),Ga.addEventListener(Po,Co,!1));function Rc(){wn.length=0,Gs(),Ga&&(Ga.removeEventListener(Gn,Wl),Ga.removeEventListener(Po,Co)),bn.clear(),Va.clear(),Ii.clear(),Da.clear(),ji.clear(),Ui.clear(),la.clear(),ra&&ra.clear(),en.forEach(function(Zn){Zn()})}function ys(Zn){function Bo(ve){var be=t({},ve);delete be.uniforms,delete be.attributes,delete be.context,delete be.vao,"stencil"in be&&be.stencil.op&&(be.stencil.opBack=be.stencil.opFront=be.stencil.op,delete be.stencil.op);function Ce(He){if(He in be){var Xe=be[He];delete be[He],Object.keys(Xe).forEach(function(it){be[He+"."+it]=Xe[it]})}}return Ce("blend"),Ce("depth"),Ce("cull"),Ce("stencil"),Ce("polygonOffset"),Ce("scissor"),Ce("sample"),"vao"in ve&&(be.vao=ve.vao),be}function Os(ve,be){var Ce={},He={};return Object.keys(ve).forEach(function(Xe){var it=ve[Xe];if(p.isDynamic(it)){He[Xe]=p.unbox(it,Xe);return}else if(be&&Array.isArray(it)){for(var Dt=0;Dt0)return cr.call(this,fi(ve|0),ve|0)}else if(Array.isArray(ve)){if(ve.length)return cr.call(this,ve,ve.length)}else return an.call(this,ve)}return t(Ti,{stats:Io,destroy:function(){_s.destroy()}})}var Hu=Va.setFBO=ys({framebuffer:p.define.call(null,As,"framebuffer")});function lc(Zn,Bo){var Os=0;_a.procs.poll();var gr=Bo.color;gr&&(_r.clearColor(+gr[0]||0,+gr[1]||0,+gr[2]||0,+gr[3]||0),Os|=Vs),"depth"in Bo&&(_r.clearDepth(+Bo.depth),Os|=Ho),"stencil"in Bo&&(_r.clearStencil(Bo.stencil|0),Os|=fa),_r.clear(Os)}function zc(Zn){if("framebuffer"in Zn)if(Zn.framebuffer&&Zn.framebuffer_reglType==="framebufferCube")for(var Bo=0;Bo<6;++Bo)Hu(t({framebuffer:Zn.framebuffer.faces[Bo]},Zn),lc);else Hu(Zn,lc);else lc(null,Zn)}function Pl(Zn){wn.push(Zn);function Bo(){var Os=Fl(wn,Zn);function gr(){var hi=Fl(wn,gr);wn[hi]=wn[wn.length-1],wn.length-=1,wn.length<=0&&Gs()}wn[Os]=gr}return yo(),{cancel:Bo}}function Il(){var Zn=va.viewport,Bo=va.scissor_box;Zn[0]=Zn[1]=Bo[0]=Bo[1]=0,Pi.viewportWidth=Pi.framebufferWidth=Pi.drawingBufferWidth=Zn[2]=Bo[2]=_r.drawingBufferWidth,Pi.viewportHeight=Pi.framebufferHeight=Pi.drawingBufferHeight=Zn[3]=Bo[3]=_r.drawingBufferHeight}function Yl(){Pi.tick+=1,Pi.time=lu(),Il(),_a.procs.poll()}function oo(){ji.refresh(),Il(),_a.procs.refresh(),ra&&ra.update()}function lu(){return(m()-mn)/1e3}oo();function Ms(Zn,Bo){var Os;switch(Zn){case"frame":return Pl(Bo);case"lost":Os=Hn;break;case"restore":Os=Ca;break;case"destroy":Os=en;break;default:}return Os.push(Bo),{cancel:function(){for(var gr=0;gr=0},read:ca,destroy:Rc,_gl:_r,_refresh:oo,poll:function(){Yl(),ra&&ra.update()},now:lu,stats:Ni,getCachedCode:uc,preloadCachedCode:Bc});return dr.onDone(null,Oc),Oc}return su}))}}),IZ=de({"node_modules/gl-util/context.js"(e,r){"use strict";var t=ip();r.exports=function(u){if(u?typeof u=="string"&&(u={container:u}):u={},a(u)?u={container:u}:o(u)?u={container:u}:s(u)?u={gl:u}:u=t(u,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),u.pixelRatio||(u.pixelRatio=window.pixelRatio||1),u.gl)return u.gl;if(u.canvas&&(u.container=u.canvas.parentNode),u.container){if(typeof u.container=="string"){var c=document.querySelector(u.container);if(!c)throw Error("Element "+u.container+" is not found");u.container=c}a(u.container)?(u.canvas=u.container,u.container=u.canvas.parentNode):u.canvas||(u.canvas=l(),u.container.appendChild(u.canvas),i(u))}else if(!u.canvas)if(typeof document<"u")u.container=document.body||document.documentElement,u.canvas=l(),u.container.appendChild(u.canvas),i(u);else throw Error("Not DOM environment. Use headless-gl.");return u.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(f){try{u.gl=u.canvas.getContext(f,u.attrs)}catch{}return u.gl}),u.gl};function i(n){if(n.container)if(n.container==document.body)document.body.style.width||(n.canvas.width=n.width||n.pixelRatio*window.innerWidth),document.body.style.height||(n.canvas.height=n.height||n.pixelRatio*window.innerHeight);else{var u=n.container.getBoundingClientRect();n.canvas.width=n.width||u.right-u.left,n.canvas.height=n.height||u.bottom-u.top}}function a(n){return typeof n.getContext=="function"&&"width"in n&&"height"in n}function o(n){return typeof n.nodeName=="string"&&typeof n.appendChild=="function"&&typeof n.getBoundingClientRect=="function"}function s(n){return typeof n.drawArrays=="function"||typeof n.drawElements=="function"}function l(){var n=document.createElement("canvas");return n.style.position="absolute",n.style.top=0,n.style.left=0,n}}}),RZ=de({"node_modules/font-atlas/index.js"(e,r){"use strict";var t=$7(),i=[32,126];r.exports=a;function a(o){o=o||{};var s=o.shape?o.shape:o.canvas?[o.canvas.width,o.canvas.height]:[512,512],l=o.canvas||document.createElement("canvas"),n=o.font,u=typeof o.step=="number"?[o.step,o.step]:o.step||[32,32],c=o.chars||i;if(n&&typeof n!="string"&&(n=t(n)),!Array.isArray(c))c=String(c).split("");else if(c.length===2&&typeof c[0]=="number"&&typeof c[1]=="number"){for(var f=[],h=c[0],d=0;h<=c[1];h++)f[d++]=String.fromCharCode(h);c=f}s=s.slice(),l.width=s[0],l.height=s[1];var p=l.getContext("2d");p.fillStyle="#000",p.fillRect(0,0,l.width,l.height),p.font=n,p.textAlign="center",p.textBaseline="middle",p.fillStyle="#fff";for(var g=u[0]/2,m=u[1]/2,h=0;hs[0]-u[0]/2&&(g=u[0]/2,m+=u[1]);return l}}}),Y7=de({"node_modules/bit-twiddle/twiddle.js"(e){"use strict";"use restrict";var r=32;e.INT_BITS=r,e.INT_MAX=2147483647,e.INT_MIN=-1<0)-(a<0)},e.abs=function(a){var o=a>>r-1;return(a^o)-o},e.min=function(a,o){return o^(a^o)&-(a65535)<<4,a>>>=o,s=(a>255)<<3,a>>>=s,o|=s,s=(a>15)<<2,a>>>=s,o|=s,s=(a>3)<<1,a>>>=s,o|=s,o|a>>1},e.log10=function(a){return a>=1e9?9:a>=1e8?8:a>=1e7?7:a>=1e6?6:a>=1e5?5:a>=1e4?4:a>=1e3?3:a>=100?2:a>=10?1:0},e.popCount=function(a){return a=a-(a>>>1&1431655765),a=(a&858993459)+(a>>>2&858993459),(a+(a>>>4)&252645135)*16843009>>>24};function t(a){var o=32;return a&=-a,a&&o--,a&65535&&(o-=16),a&16711935&&(o-=8),a&252645135&&(o-=4),a&858993459&&(o-=2),a&1431655765&&(o-=1),o}e.countTrailingZeros=t,e.nextPow2=function(a){return a+=a===0,--a,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a+1},e.prevPow2=function(a){return a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a-(a>>>1)},e.parity=function(a){return a^=a>>>16,a^=a>>>8,a^=a>>>4,a&=15,27030>>>a&1};var i=new Array(256);(function(a){for(var o=0;o<256;++o){var s=o,l=o,n=7;for(s>>>=1;s;s>>>=1)l<<=1,l|=s&1,--n;a[o]=l<>>8&255]<<16|i[a>>>16&255]<<8|i[a>>>24&255]},e.interleave2=function(a,o){return a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,o&=65535,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,a|o<<1},e.deinterleave2=function(a,o){return a=a>>>o&1431655765,a=(a|a>>>1)&858993459,a=(a|a>>>2)&252645135,a=(a|a>>>4)&16711935,a=(a|a>>>16)&65535,a<<16>>16},e.interleave3=function(a,o,s){return a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,o&=1023,o=(o|o<<16)&4278190335,o=(o|o<<8)&251719695,o=(o|o<<4)&3272356035,o=(o|o<<2)&1227133513,a|=o<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,a|s<<2},e.deinterleave3=function(a,o){return a=a>>>o&1227133513,a=(a|a>>>2)&3272356035,a=(a|a>>>4)&251719695,a=(a|a>>>8)&4278190335,a=(a|a>>>16)&1023,a<<22>>22},e.nextCombination=function(a){var o=a|a-1;return o+1|(~o&-~o)-1>>>t(a)+1}}}),zZ=de({"node_modules/dup/dup.js"(e,r){"use strict";function t(o,s,l){var n=o[l]|0;if(n<=0)return[];var u=new Array(n),c;if(l===o.length-1)for(c=0;c"u"&&(s=0),typeof o){case"number":if(o>0)return i(o|0,s);break;case"object":if(typeof o.length=="number")return t(o,s,0);break}return[]}r.exports=a}}),BZ=de({"node_modules/typedarray-pool/pool.js"(e){"use strict";var r=Y7(),t=zZ(),i=Cv().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:t([32,0]),UINT16:t([32,0]),UINT32:t([32,0]),BIGUINT64:t([32,0]),INT8:t([32,0]),INT16:t([32,0]),INT32:t([32,0]),BIGINT64:t([32,0]),FLOAT:t([32,0]),DOUBLE:t([32,0]),DATA:t([32,0]),UINT8C:t([32,0]),BUFFER:t([32,0])});var a=typeof Uint8ClampedArray<"u",o=typeof BigUint64Array<"u",s=typeof BigInt64Array<"u",l=window.__TYPEDARRAY_POOL;l.UINT8C||(l.UINT8C=t([32,0])),l.BIGUINT64||(l.BIGUINT64=t([32,0])),l.BIGINT64||(l.BIGINT64=t([32,0])),l.BUFFER||(l.BUFFER=t([32,0]));var n=l.DATA,u=l.BUFFER;e.free=function(b){if(i.isBuffer(b))u[r.log2(b.length)].push(b);else{if(Object.prototype.toString.call(b)!=="[object ArrayBuffer]"&&(b=b.buffer),!b)return;var E=b.length||b.byteLength,T=r.log2(E)|0;n[T].push(b)}};function c(A){if(A){var b=A.length||A.byteLength,E=r.log2(b);n[E].push(A)}}function f(A){c(A.buffer)}e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=f,e.freeArrayBuffer=c,e.freeBuffer=function(b){u[r.log2(b.length)].push(b)},e.malloc=function(b,E){if(E===void 0||E==="arraybuffer")return h(b);switch(E){case"uint8":return d(b);case"uint16":return p(b);case"uint32":return g(b);case"int8":return m(b);case"int16":return y(b);case"int32":return _(b);case"float":case"float32":return v(b);case"double":case"float64":return x(b);case"uint8_clamped":return S(b);case"bigint64":return C(b);case"biguint64":return M(b);case"buffer":return k(b);case"data":case"dataview":return w(b);default:return null}return null};function h(b){var b=r.nextPow2(b),E=r.log2(b),T=n[E];return T.length>0?T.pop():new ArrayBuffer(b)}e.mallocArrayBuffer=h;function d(A){return new Uint8Array(h(A),0,A)}e.mallocUint8=d;function p(A){return new Uint16Array(h(2*A),0,A)}e.mallocUint16=p;function g(A){return new Uint32Array(h(4*A),0,A)}e.mallocUint32=g;function m(A){return new Int8Array(h(A),0,A)}e.mallocInt8=m;function y(A){return new Int16Array(h(2*A),0,A)}e.mallocInt16=y;function _(A){return new Int32Array(h(4*A),0,A)}e.mallocInt32=_;function v(A){return new Float32Array(h(4*A),0,A)}e.mallocFloat32=e.mallocFloat=v;function x(A){return new Float64Array(h(8*A),0,A)}e.mallocFloat64=e.mallocDouble=x;function S(A){return a?new Uint8ClampedArray(h(A),0,A):d(A)}e.mallocUint8Clamped=S;function M(A){return o?new BigUint64Array(h(8*A),0,A):null}e.mallocBigUint64=M;function C(A){return s?new BigInt64Array(h(8*A),0,A):null}e.mallocBigInt64=C;function w(A){return new DataView(h(A),0,A)}e.mallocDataView=w;function k(A){A=r.nextPow2(A);var b=r.log2(A),E=u[b];return E.length>0?E.pop():new i(A)}e.mallocBuffer=k,e.clearCache=function(){for(var b=0;b<32;++b)l.UINT8[b].length=0,l.UINT16[b].length=0,l.UINT32[b].length=0,l.INT8[b].length=0,l.INT16[b].length=0,l.INT32[b].length=0,l.FLOAT[b].length=0,l.DOUBLE[b].length=0,l.BIGUINT64[b].length=0,l.BIGINT64[b].length=0,l.UINT8C[b].length=0,n[b].length=0,u[b].length=0}}}),OZ=de({"node_modules/is-plain-obj/index.js"(e,r){"use strict";var t=Object.prototype.toString;r.exports=function(i){var a;return t.call(i)==="[object Object]"&&(a=Object.getPrototypeOf(i),a===null||a===Object.getPrototypeOf({}))}}}),X7=de({"node_modules/parse-unit/index.js"(e,r){r.exports=function(i,a){a||(a=[0,""]),i=String(i);var o=parseFloat(i,10);return a[0]=o,a[1]=i.match(/[\d.\-\+]*\s*(.*)/)[1]||"",a}}}),NZ=de({"node_modules/gl-text/node_modules/to-px/topx.js"(e,r){"use strict";var t=X7();r.exports=s;var i=96;function a(l,n){var u=t(getComputedStyle(l).getPropertyValue(n));return u[0]*s(u[1],l)}function o(l,n){var u=document.createElement("div");u.style["font-size"]="128"+l,n.appendChild(u);var c=a(u,"font-size")/128;return n.removeChild(u),c}function s(l,n){switch(n=n||document.body,l=(l||"px").trim().toLowerCase(),(n===window||n===document)&&(n=document.body),l){case"%":return n.clientHeight/100;case"ch":case"ex":return o(l,n);case"em":return a(n,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}}}),jZ=de({"node_modules/detect-kerning/index.js"(e,r){"use strict";r.exports=o;var t=o.canvas=document.createElement("canvas"),i=t.getContext("2d"),a=s([32,126]);o.createPairs=s,o.ascii=a;function o(l,n){Array.isArray(l)&&(l=l.join(", "));var u={},c,f=16,h=.05;n&&(n.length===2&&typeof n[0]=="number"?c=s(n):Array.isArray(n)?c=n:(n.o?c=s(n.o):n.pairs&&(c=n.pairs),n.fontSize&&(f=n.fontSize),n.threshold!=null&&(h=n.threshold))),c||(c=a),i.font=f+"px "+l;for(var d=0;df*h){var y=(m-g)/f;u[p]=y*1e3}}return u}function s(l){for(var n=[],u=l[0];u<=l[1];u++)for(var c=String.fromCharCode(u),f=l[0];f0;u-=4)if(n[u]!==0)return Math.floor((u-3)*.25/l)}}}),qZ=de({"node_modules/gl-text/dist.js"(e,r){"use strict";var t=PZ(),i=ip(),a=W7(),o=IZ(),s=O7(),l=b_(),n=RZ(),u=BZ(),c=B1(),f=OZ(),h=X7(),d=NZ(),p=jZ(),g=du(),m=UZ(),y=Gv(),_=Y7(),v=_.nextPow2,x=new s,S=!1;document.body&&(M=document.body.appendChild(document.createElement("div")),M.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(M).fontStretch&&(S=!0),document.body.removeChild(M));var M,C=function(A){w(A)?(A={regl:A},this.gl=A.regl._gl):this.gl=o(A),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=A.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(f(A)?A:{})};C.prototype.createShader=function(){var A=this.regl,b=A({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:A.prop("count"),offset:A.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:A.this("sizeBuffer")},width:{offset:0,stride:8,buffer:A.this("sizeBuffer")},char:A.this("charBuffer"),position:A.this("position")},uniforms:{atlasSize:function(T,F){return[F.atlas.width,F.atlas.height]},atlasDim:function(T,F){return[F.atlas.cols,F.atlas.rows]},atlas:function(T,F){return F.atlas.texture},charStep:function(T,F){return F.atlas.step},em:function(T,F){return F.atlas.em},color:A.prop("color"),opacity:A.prop("opacity"),viewport:A.this("viewportArray"),scale:A.this("scale"),align:A.prop("align"),baseline:A.prop("baseline"),translate:A.this("translate"),positionOffset:A.prop("positionOffset")},primitive:"points",viewport:A.this("viewport"),vert:` precision highp float; attribute float width, charOffset, char; attribute vec2 position; @@ -2692,9 +2692,9 @@ void main() { // color.rgb += (1. - color.rgb) * (1. - mask.rgb); gl_FragColor = color; - }`}),E={};return{regl:A,draw:b,atlas:E}},C.prototype.update=function(A){var b=this;if(typeof A=="string")A={text:A};else if(!A)return;A=i(A,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),A.opacity!=null&&(Array.isArray(A.opacity)?this.opacity=A.opacity.map(function(Q){return parseFloat(Q)}):this.opacity=parseFloat(A.opacity)),A.viewport!=null&&(this.viewport=c(A.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),A.kerning!=null&&(this.kerning=A.kerning),A.offset!=null&&(typeof A.offset=="number"&&(A.offset=[A.offset,0]),this.positionOffset=y(A.offset)),A.direction&&(this.direction=A.direction),A.range&&(this.range=A.range,this.scale=[1/(A.range[2]-A.range[0]),1/(A.range[3]-A.range[1])],this.translate=[-A.range[0],-A.range[1]]),A.scale&&(this.scale=A.scale),A.translate&&(this.translate=A.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!A.font&&(A.font=C.baseFontSize+"px sans-serif");var E=!1,T=!1;if(A.font&&(Array.isArray(A.font)?A.font:[A.font]).forEach(function(Q,ue){if(typeof Q=="string")try{Q=t.parse(Q)}catch{Q=t.parse(C.baseFontSize+"px "+Q)}else{var ge=Q.style,Me=Q.weight,Te=Q.stretch,je=Q.variant;Q=t.parse(t.stringify(Q)),ge&&(Q.style=ge),Me&&(Q.weight=Me),Te&&(Q.stretch=Te),je&&(Q.variant=je)}var Ve=t.stringify({size:C.baseFontSize,family:Q.family,stretch:S?Q.stretch:void 0,variant:Q.variant,weight:Q.weight,style:Q.style}),Ze=h(Q.size),Ke=Math.round(Ze[0]*d(Ze[1]));if(Ke!==b.fontSize[ue]&&(T=!0,b.fontSize[ue]=Ke),(!b.font[ue]||Ve!=b.font[ue].baseString)&&(E=!0,b.font[ue]=C.fonts[Ve],!b.font[ue])){var vt=Q.family.join(", "),xt=[Q.style];Q.style!=Q.variant&&xt.push(Q.variant),Q.variant!=Q.weight&&xt.push(Q.weight),S&&Q.weight!=Q.stretch&&xt.push(Q.stretch),b.font[ue]={baseString:Ve,family:vt,weight:Q.weight,stretch:Q.stretch,style:Q.style,variant:Q.variant,width:{},kerning:{},metrics:m(vt,{origin:"top",fontSize:C.baseFontSize,fontStyle:xt.join(" ")})},C.fonts[Ve]=b.font[ue]}}),(E||T)&&this.font.forEach(function(Q,ue){var ge=t.stringify({size:b.fontSize[ue],family:Q.family,stretch:S?Q.stretch:void 0,variant:Q.variant,weight:Q.weight,style:Q.style});if(b.fontAtlas[ue]=b.shader.atlas[ge],!b.fontAtlas[ue]){var Me=Q.metrics;b.shader.atlas[ge]=b.fontAtlas[ue]={fontString:ge,step:Math.ceil(b.fontSize[ue]*Me.bottom*.5)*2,em:b.fontSize[ue],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:b.regl.texture()}}A.text==null&&(A.text=b.text)}),typeof A.text=="string"&&A.position&&A.position.length>2){for(var F=Array(A.position.length*.5),D=0;D2){for(var z=!A.position[0].length,I=u.mallocFloat(this.count*2),L=0,B=0;L1?b.align[ue]:b.align[0]:b.align;if(typeof ge=="number")return ge;switch(ge){case"right":case"end":return-Q;case"center":case"centre":case"middle":return-Q*.5}return 0})),this.baseline==null&&A.baseline==null&&(A.baseline=0),A.baseline!=null&&(this.baseline=A.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(Q,ue){var ge=(b.font[ue]||b.font[0]).metrics,Me=0;return Me+=ge.bottom*.5,typeof Q=="number"?Me+=Q-ge.baseline:Me+=-ge[Q],Me*=-1,Me})),A.color!=null)if(A.color||(A.color="transparent"),typeof A.color=="string"||!isNaN(A.color))this.color=l(A.color,"uint8");else{var le;if(typeof A.color[0]=="number"&&A.color.length>this.counts.length){var ce=A.color.length;le=u.mallocUint8(ce);for(var pe=(A.color.subarray||A.color.slice).bind(A.color),xe=0;xe4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(ae){var ee=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(ee);for(var ie=0;ie1?this.counts[ie]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[ie]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(ie*4,ie*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[ie]:this.opacity,baseline:this.baselineOffset[ie]!=null?this.baselineOffset[ie]:this.baselineOffset[0],align:this.align?this.alignOffset[ie]!=null?this.alignOffset[ie]:this.alignOffset[0]:0,atlas:this.fontAtlas[ie]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(ie*2,ie*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},C.prototype.destroy=function(){},C.prototype.kerning=!0,C.prototype.position={constant:new Float32Array(2)},C.prototype.translate=null,C.prototype.scale=null,C.prototype.font=null,C.prototype.text="",C.prototype.positionOffset=[0,0],C.prototype.opacity=1,C.prototype.color=new Uint8Array([0,0,0,255]),C.prototype.alignOffset=[0,0],C.maxAtlasSize=1024,C.atlasCanvas=document.createElement("canvas"),C.atlasContext=C.atlasCanvas.getContext("2d",{alpha:!1}),C.baseFontSize=64,C.fonts={};function w(k){return typeof k=="function"&&k._gl&&k.prop&&k.texture&&k.buffer}r.exports=C}}),P4=de({"src/lib/prepare_regl.js"(e,r){"use strict";var t=ZD(),i=W7();r.exports=function(o,s,l){var n=o._fullLayout,u=!0;return n._glcanvas.each(function(c){if(c.regl){c.regl.preloadCachedCode(l);return}if(!(c.pick&&!n._has("parcoords"))){try{c.regl=i({canvas:this,attributes:{antialias:!c.pick,preserveDrawingBuffer:!0},pixelRatio:o._context.plotGlPixelRatio||window.devicePixelRatio,extensions:s||[],cachedCode:l||{}})}catch{u=!1}c.regl||(u=!1),u&&this.addEventListener("webglcontextlost",function(f){o&&o.emit&&o.emit("plotly_webglcontextlost",{event:f,layer:c.key})},!1)}}),u||t({container:n._glcontainer.node()}),u}}}),Z7=de({"src/traces/scattergl/plot.js"(p,r){"use strict";var t=S7(),i=N7(),a=EZ(),o=qZ(),s=Qt(),l=Xd().selectMode,n=P4(),u=bs(),c=nk(),f=T7().styleTextSelection,h={};function d(g,m,y,_){var v=g._size,x=g.width*_,S=g.height*_,M=v.l*_,C=v.b*_,w=v.r*_,k=v.t*_,A=v.w*_,b=v.h*_;return[M+m.domain[0]*A,C+y.domain[0]*b,x-w-(1-m.domain[1])*A,S-k-(1-y.domain[1])*b]}var p=r.exports=function(m,y,_){if(_.length){var v=m._fullLayout,x=y._scene,S=y.xaxis,M=y.yaxis,C,w;if(x){var k=n(m,["ANGLE_instanced_arrays","OES_element_index_uint"],h);if(!k){x.init();return}var A=x.count,b=v._glcanvas.data()[0].regl;if(c(m,y,_),x.dirty){if((x.line2d||x.error2d)&&!(x.scatter2d||x.fill2d||x.glText)&&b.clear({color:!0,depth:!0}),x.error2d===!0&&(x.error2d=a(b)),x.line2d===!0&&(x.line2d=i(b)),x.scatter2d===!0&&(x.scatter2d=t(b)),x.fill2d===!0&&(x.fill2d=i(b)),x.glText===!0)for(x.glText=new Array(A),C=0;Cx.glText.length){var E=A-x.glText.length;for(C=0;CY&&(isNaN(q[K])||isNaN(q[K+1]));)K-=2;j.positions=q.slice(Y,K+2)}return j}),x.line2d.update(x.lineOptions)),x.error2d){var D=(x.errorXOptions||[]).concat(x.errorYOptions||[]).map(function(j){return j||{positions:[],errors:[]}});x.error2d.update(D)}x.scatter2d&&x.scatter2d.update(x.markerOptions),x.fillOrder=s.repeat(null,A),x.fill2d&&(x.fillOptions=x.fillOptions.map(function(j,q){var Y=_[q];if(!(!j||!Y||!Y[0]||!Y[0].trace)){var K=Y[0],te=K.trace,ne=K.t,se=x.lineOptions[q],le,ce,pe=[];te._ownfill&&pe.push(q),te._nexttrace&&pe.push(q+1),pe.length&&(x.fillOrder[q]=pe);var xe=[],ye=se&&se.positions||ne.positions,fe,ae;if(te.fill==="tozeroy"){for(fe=0;fefe&&isNaN(ye[ae+1]);)ae-=2;ye[fe+1]!==0&&(xe=[ye[fe],0]),xe=xe.concat(ye.slice(fe,ae+2)),ye[ae+1]!==0&&(xe=xe.concat([ye[ae],0]))}else if(te.fill==="tozerox"){for(fe=0;fefe&&isNaN(ye[ae]);)ae-=2;ye[fe]!==0&&(xe=[0,ye[fe+1]]),xe=xe.concat(ye.slice(fe,ae+2)),ye[ae]!==0&&(xe=xe.concat([0,ye[ae+1]]))}else if(te.fill==="toself"||te.fill==="tonext"){for(xe=[],le=0,j.splitNull=!0,ce=0;ce-1;for(let[j]of _)if(j){var I=j.trace,L=j.t,B=L.index,O=I._length,G=L.x,W=L.y;if(I.selectedpoints||P||z){if(P||(P=!0),I.selectedpoints){var X=x.selectBatch[B]=I.selectedpoints,Z={};for(w=0;wS&&y||xf,T;for(E?T=y.sizeAvg||Math.max(y.size,3):T=a(p,m),M=0;M{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,o(()=>{this.dirty=!1})),this)},u.prototype.update=function(...d){if(!d.length)return;for(let m=0;mT||!y.lower&&E{p[_+x]=m})}this.scatter.draw(...p)}return this},u.prototype.destroy=function(){return this.traces.forEach(d=>{d.buffer&&d.buffer.destroy&&d.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function c(d,p,g){let m=d.id!=null?d.id:d,y=p,_=g;return m<<16|(y&255)<<8|_&255}function f(d,p,g){let m,y,_,v,x,S,M,C,w=d[p],k=d[g];return w.length>2?(m=w[0],_=w[2],y=w[1],v=w[3]):w.length?(m=y=w[0],_=v=w[1]):(m=w.x,y=w.y,_=w.x+w.width,v=w.y+w.height),k.length>2?(x=k[0],M=k[2],S=k[1],C=k[3]):k.length?(x=S=k[0],M=C=k[1]):(x=k.x,S=k.y,M=k.x+k.width,C=k.y+k.height),[x,y,M,v]}function h(d){if(typeof d=="number")return[d,d,d,d];if(d.length===2)return[d[0],d[1],d[0],d[1]];{let p=l(d);return[p.x,p.y,p.x+p.width,p.y+p.height]}}}}),JZ=de({"src/traces/splom/plot.js"(e,r){"use strict";var t=KZ(),i=Qt(),a=Hs(),o=Xd().selectMode;r.exports=function(n,u,c){if(c.length)for(var f=0;f-1,z=o(y)||!!f.selectedpoints||P,I=!0;if(z){var L=f._length;if(f.selectedpoints){d.selectBatch=f.selectedpoints;var B=f.selectedpoints,O={};for(x=0;x=G[W][0]&&O<=G[W][1])return!0;return!1}function p(O){O.attr("x",-t.bar.captureWidth/2).attr("width",t.bar.captureWidth)}function g(O){O.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(O){if(!O.brush.filterSpecified)return"0,"+O.height;for(var G=y(O.brush.filter.getConsolidated(),O.height),W=[0],X,Z,J,N=G.length?G[0][0]:null,H=0;HO[1]+W||G=.9*O[1]+.1*O[0]?"n":G<=.9*O[0]+.1*O[1]?"s":"ns"}function v(){i.select(document.body).style("cursor",null)}function x(O){O.attr("stroke-dasharray",m)}function S(O,G){var W=i.select(O).selectAll(".highlight, .highlight-shadow"),X=G?W.transition().duration(t.bar.snapDuration).each("end",G):W;x(X)}function M(O,G){var W=O.brush,X=W.filterSpecified,Z=NaN,J={},N;if(X){var H=O.height,$=W.filter.getConsolidated(),U=y($,H),V=NaN,j=NaN,q=NaN;for(N=0;N<=U.length;N++){var Y=U[N];if(Y&&Y[0]<=G&&G<=Y[1]){V=N;break}else if(j=N?N-1:NaN,Y&&Y[0]>G){q=N;break}}if(Z=V,isNaN(Z)&&(isNaN(j)||isNaN(q)?Z=isNaN(j)?q:j:Z=G-U[j][1]=le[0]&&se<=le[1]){J.clickableOrdinalRange=le;break}}}return J}function C(O,G){i.event.sourceEvent.stopPropagation();var W=G.height-i.mouse(O)[1]-2*t.verticalPadding,X=G.unitToPaddedPx.invert(W),Z=G.brush,J=M(G,W),N=J.interval,H=Z.svgBrush;if(H.wasDragged=!1,H.grabbingBar=J.region==="ns",H.grabbingBar){var $=N.map(G.unitToPaddedPx);H.grabPoint=W-$[0]-t.verticalPadding,H.barLength=$[1]-$[0]}H.clickableOrdinalRange=J.clickableOrdinalRange,H.stayingIntervals=G.multiselect&&Z.filterSpecified?Z.filter.getConsolidated():[],N&&(H.stayingIntervals=H.stayingIntervals.filter(function(U){return U[0]!==N[0]&&U[1]!==N[1]})),H.startExtent=J.region?N[J.region==="s"?1:0]:X,G.parent.inBrushDrag=!0,H.brushStartCallback()}function w(O,G){i.event.sourceEvent.stopPropagation();var W=G.height-i.mouse(O)[1]-2*t.verticalPadding,X=G.brush.svgBrush;X.wasDragged=!0,X._dragging=!0,X.grabbingBar?X.newExtent=[W-X.grabPoint,W+X.barLength-X.grabPoint].map(G.unitToPaddedPx.invert):X.newExtent=[X.startExtent,G.unitToPaddedPx.invert(W)].sort(s),G.brush.filterSpecified=!0,X.extent=X.stayingIntervals.concat([X.newExtent]),X.brushCallback(G),S(O.parentNode)}function k(O,G){var W=G.brush,X=W.filter,Z=W.svgBrush;Z._dragging||(A(O,G),w(O,G),G.brush.svgBrush.wasDragged=!1),Z._dragging=!1;var J=i.event;J.sourceEvent.stopPropagation();var N=Z.grabbingBar;if(Z.grabbingBar=!1,Z.grabLocation=void 0,G.parent.inBrushDrag=!1,v(),!Z.wasDragged){Z.wasDragged=void 0,Z.clickableOrdinalRange?W.filterSpecified&&G.multiselect?Z.extent.push(Z.clickableOrdinalRange):(Z.extent=[Z.clickableOrdinalRange],W.filterSpecified=!0):N?(Z.extent=Z.stayingIntervals,Z.extent.length===0&&R(W)):R(W),Z.brushCallback(G),S(O.parentNode),Z.brushEndCallback(W.filterSpecified?X.getConsolidated():[]);return}var H=function(){X.set(X.getConsolidated())};if(G.ordinal){var $=G.unitTickvals;$[$.length-1]<$[0]&&$.reverse(),Z.newExtent=[h(0,$,Z.newExtent[0],Z.stayingIntervals),h(1,$,Z.newExtent[1],Z.stayingIntervals)];var U=Z.newExtent[1]>Z.newExtent[0];Z.extent=Z.stayingIntervals.concat(U?[Z.newExtent]:[]),Z.extent.length||R(W),Z.brushCallback(G),U?S(O.parentNode,H):(H(),S(O.parentNode))}else H();Z.brushEndCallback(W.filterSpecified?X.getConsolidated():[])}function A(O,G){var W=G.height-i.mouse(O)[1]-2*t.verticalPadding,X=M(G,W),Z="crosshair";X.clickableOrdinalRange?Z="pointer":X.region&&(Z=X.region+"-resize"),i.select(document.body).style("cursor",Z)}function b(O){O.on("mousemove",function(G){i.event.preventDefault(),G.parent.inBrushDrag||A(this,G)}).on("mouseleave",function(G){G.parent.inBrushDrag||v()}).call(i.behavior.drag().on("dragstart",function(G){C(this,G)}).on("drag",function(G){w(this,G)}).on("dragend",function(G){k(this,G)}))}function E(O,G){return O[0]-G[0]}function T(O,G,W){var X=W._context.staticPlot,Z=O.selectAll(".background").data(o);Z.enter().append("rect").classed("background",!0).call(p).call(g).style("pointer-events",X?"none":"auto").attr("transform",l(0,t.verticalPadding)),Z.call(b).attr("height",function(H){return H.height-t.verticalPadding});var J=O.selectAll(".highlight-shadow").data(o);J.enter().append("line").classed("highlight-shadow",!0).attr("x",-t.bar.width/2).attr("stroke-width",t.bar.width+t.bar.strokeWidth).attr("stroke",G).attr("opacity",t.bar.strokeOpacity).attr("stroke-linecap","butt"),J.attr("y1",function(H){return H.height}).call(x);var N=O.selectAll(".highlight").data(o);N.enter().append("line").classed("highlight",!0).attr("x",-t.bar.width/2).attr("stroke-width",t.bar.width-t.bar.strokeWidth).attr("stroke",t.bar.fillColor).attr("opacity",t.bar.fillOpacity).attr("stroke-linecap","butt"),N.attr("y1",function(H){return H.height}).call(x)}function F(O,G,W){var X=O.selectAll("."+t.cn.axisBrush).data(o,a);X.enter().append("g").classed(t.cn.axisBrush,!0),T(X,G,W)}function D(O){return O.svgBrush.extent.map(function(G){return G.slice()})}function R(O){O.filterSpecified=!1,O.svgBrush.extent=[[-1/0,1/0]]}function P(O){return function(W){var X=W.brush,Z=D(X),J=Z.slice();X.filter.set(J),O()}}function z(O){for(var G=O.slice(),W=[],X,Z=G.shift();Z;){for(X=Z.slice();(Z=G.shift())&&Z[0]<=X[1];)X[1]=Math.max(X[1],Z[1]);W.push(X)}return W.length===1&&W[0][0]>W[0][1]&&(W=[]),W}function I(){var O=[],G,W;return{set:function(X){O=X.map(function(Z){return Z.slice().sort(s)}).sort(E),O.length===1&&O[0][0]===-1/0&&O[0][1]===1/0&&(O=[[0,-1]]),G=z(O),W=O.reduce(function(Z,J){return[Math.min(Z[0],J[0]),Math.max(Z[1],J[1])]},[1/0,-1/0])},get:function(){return O.slice()},getConsolidated:function(){return G},getBounds:function(){return W}}}function L(O,G,W,X,Z,J){var N=I();return N.set(W),{filter:N,filterSpecified:G,svgBrush:{extent:[],brushStartCallback:X,brushCallback:P(Z),brushEndCallback:J}}}function B(O,G){if(Array.isArray(O[0])?(O=O.map(function(X){return X.sort(s)}),G.multiselect?O=z(O.sort(E)):O=[O[0]]):O=[O.sort(s)],G.tickvals){var W=G.tickvals.slice().sort(s);if(O=O.map(function(X){var Z=[h(0,W,X[0],[]),h(1,W,X[1],[])];if(Z[1]>Z[0])return Z}).filter(function(X){return X}),!O.length)return}return O.length>1?O:O[0]}r.exports={makeBrush:L,ensureAxisBrush:F,cleanRanges:B}}}),oK=de({"src/traces/parcoords/defaults.js"(e,r){"use strict";var t=Qt(),i=Wu().hasColorscale,a=hu(),o=Is().defaults,s=fc(),l=nn(),n=Q7(),u=e9(),c=M_().maxDimensionCount,f=I4();function h(p,g,m,y,_){var v=_("line.color",m);if(i(p,"line")&&t.isArrayOrTypedArray(v)){if(v.length)return _("line.colorscale"),a(p,g,y,_,{prefix:"line.",cLetter:"c"}),v.length;g.line.color=m}return 1/0}function d(p,g,m,y){function _(C,w){return t.coerce(p,g,n.dimensions,C,w)}var v=_("values"),x=_("visible");if(v&&v.length||(x=g.visible=!1),x){_("label"),_("tickvals"),_("ticktext"),_("tickformat");var S=_("range");g._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:S},l.setConvert(g._ax,y.layout),_("multiselect");var M=_("constraintrange");M&&(g.constraintrange=u.cleanRanges(M,g))}}r.exports=function(g,m,y,_){function v(w,k){return t.coerce(g,m,n,w,k)}var x=g.dimensions;Array.isArray(x)&&x.length>c&&(t.log("parcoords traces support up to "+c+" dimensions at the moment"),x.splice(c));var S=s(g,m,{name:"dimensions",layout:_,handleItemDefaults:d}),M=h(g,m,y,_,v);o(m,_,v),(!Array.isArray(S)||!S.length)&&(m.visible=!1),f(m,S,"values",M);var C=t.extendFlat({},_.font,{size:Math.round(_.font.size/1.2)});t.coerceFont(v,"labelfont",C),t.coerceFont(v,"tickfont",C,{autoShadowDflt:!0}),t.coerceFont(v,"rangefont",C),v("labelangle"),v("labelside"),v("unselected.line.color"),v("unselected.line.opacity")}}}),sK=de({"src/traces/parcoords/calc.js"(e,r){"use strict";var t=Qt().isArrayOrTypedArray,i=ks(),a=ip().wrap;r.exports=function(l,n){var u,c;return i.hasColorscale(n,"line")&&t(n.line.color)?(u=n.line.color,c=i.extractOpts(n.line).colorscale,i.calc(l,n,{vals:u,containerStr:"line",cLetter:"c"})):(u=o(n._length),c=[[0,n.line.color],[1,n.line.color]]),a({lineColor:u,cscale:c})};function o(s){for(var l=new Array(s),n=0;n 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` + }`}),E={};return{regl:A,draw:b,atlas:E}},C.prototype.update=function(A){var b=this;if(typeof A=="string")A={text:A};else if(!A)return;A=i(A,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),A.opacity!=null&&(Array.isArray(A.opacity)?this.opacity=A.opacity.map(function(Q){return parseFloat(Q)}):this.opacity=parseFloat(A.opacity)),A.viewport!=null&&(this.viewport=c(A.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),A.kerning!=null&&(this.kerning=A.kerning),A.offset!=null&&(typeof A.offset=="number"&&(A.offset=[A.offset,0]),this.positionOffset=y(A.offset)),A.direction&&(this.direction=A.direction),A.range&&(this.range=A.range,this.scale=[1/(A.range[2]-A.range[0]),1/(A.range[3]-A.range[1])],this.translate=[-A.range[0],-A.range[1]]),A.scale&&(this.scale=A.scale),A.translate&&(this.translate=A.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!A.font&&(A.font=C.baseFontSize+"px sans-serif");var E=!1,T=!1;if(A.font&&(Array.isArray(A.font)?A.font:[A.font]).forEach(function(Q,ue){if(typeof Q=="string")try{Q=t.parse(Q)}catch{Q=t.parse(C.baseFontSize+"px "+Q)}else{var ge=Q.style,Me=Q.weight,Te=Q.stretch,je=Q.variant;Q=t.parse(t.stringify(Q)),ge&&(Q.style=ge),Me&&(Q.weight=Me),Te&&(Q.stretch=Te),je&&(Q.variant=je)}var Ve=t.stringify({size:C.baseFontSize,family:Q.family,stretch:S?Q.stretch:void 0,variant:Q.variant,weight:Q.weight,style:Q.style}),Ke=h(Q.size),Je=Math.round(Ke[0]*d(Ke[1]));if(Je!==b.fontSize[ue]&&(T=!0,b.fontSize[ue]=Je),(!b.font[ue]||Ve!=b.font[ue].baseString)&&(E=!0,b.font[ue]=C.fonts[Ve],!b.font[ue])){var vt=Q.family.join(", "),xt=[Q.style];Q.style!=Q.variant&&xt.push(Q.variant),Q.variant!=Q.weight&&xt.push(Q.weight),S&&Q.weight!=Q.stretch&&xt.push(Q.stretch),b.font[ue]={baseString:Ve,family:vt,weight:Q.weight,stretch:Q.stretch,style:Q.style,variant:Q.variant,width:{},kerning:{},metrics:m(vt,{origin:"top",fontSize:C.baseFontSize,fontStyle:xt.join(" ")})},C.fonts[Ve]=b.font[ue]}}),(E||T)&&this.font.forEach(function(Q,ue){var ge=t.stringify({size:b.fontSize[ue],family:Q.family,stretch:S?Q.stretch:void 0,variant:Q.variant,weight:Q.weight,style:Q.style});if(b.fontAtlas[ue]=b.shader.atlas[ge],!b.fontAtlas[ue]){var Me=Q.metrics;b.shader.atlas[ge]=b.fontAtlas[ue]={fontString:ge,step:Math.ceil(b.fontSize[ue]*Me.bottom*.5)*2,em:b.fontSize[ue],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:b.regl.texture()}}A.text==null&&(A.text=b.text)}),typeof A.text=="string"&&A.position&&A.position.length>2){for(var F=Array(A.position.length*.5),D=0;D2){for(var z=!A.position[0].length,I=u.mallocFloat(this.count*2),L=0,B=0;L1?b.align[ue]:b.align[0]:b.align;if(typeof ge=="number")return ge;switch(ge){case"right":case"end":return-Q;case"center":case"centre":case"middle":return-Q*.5}return 0})),this.baseline==null&&A.baseline==null&&(A.baseline=0),A.baseline!=null&&(this.baseline=A.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(Q,ue){var ge=(b.font[ue]||b.font[0]).metrics,Me=0;return Me+=ge.bottom*.5,typeof Q=="number"?Me+=Q-ge.baseline:Me+=-ge[Q],Me*=-1,Me})),A.color!=null)if(A.color||(A.color="transparent"),typeof A.color=="string"||!isNaN(A.color))this.color=l(A.color,"uint8");else{var le;if(typeof A.color[0]=="number"&&A.color.length>this.counts.length){var ce=A.color.length;le=u.mallocUint8(ce);for(var pe=(A.color.subarray||A.color.slice).bind(A.color),xe=0;xe4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(ae){var ee=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(ee);for(var ie=0;ie1?this.counts[ie]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[ie]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(ie*4,ie*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[ie]:this.opacity,baseline:this.baselineOffset[ie]!=null?this.baselineOffset[ie]:this.baselineOffset[0],align:this.align?this.alignOffset[ie]!=null?this.alignOffset[ie]:this.alignOffset[0]:0,atlas:this.fontAtlas[ie]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(ie*2,ie*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},C.prototype.destroy=function(){},C.prototype.kerning=!0,C.prototype.position={constant:new Float32Array(2)},C.prototype.translate=null,C.prototype.scale=null,C.prototype.font=null,C.prototype.text="",C.prototype.positionOffset=[0,0],C.prototype.opacity=1,C.prototype.color=new Uint8Array([0,0,0,255]),C.prototype.alignOffset=[0,0],C.maxAtlasSize=1024,C.atlasCanvas=document.createElement("canvas"),C.atlasContext=C.atlasCanvas.getContext("2d",{alpha:!1}),C.baseFontSize=64,C.fonts={};function w(k){return typeof k=="function"&&k._gl&&k.prop&&k.texture&&k.buffer}r.exports=C}}),P4=de({"src/lib/prepare_regl.js"(e,r){"use strict";var t=ZD(),i=W7();r.exports=function(o,s,l){var n=o._fullLayout,u=!0;return n._glcanvas.each(function(c){if(c.regl){c.regl.preloadCachedCode(l);return}if(!(c.pick&&!n._has("parcoords"))){try{c.regl=i({canvas:this,attributes:{antialias:!c.pick,preserveDrawingBuffer:!0},pixelRatio:o._context.plotGlPixelRatio||window.devicePixelRatio,extensions:s||[],cachedCode:l||{}})}catch{u=!1}c.regl||(u=!1),u&&this.addEventListener("webglcontextlost",function(f){o&&o.emit&&o.emit("plotly_webglcontextlost",{event:f,layer:c.key})},!1)}}),u||t({container:n._glcontainer.node()}),u}}}),Z7=de({"src/traces/scattergl/plot.js"(p,r){"use strict";var t=S7(),i=N7(),a=EZ(),o=qZ(),s=Qt(),l=Zd().selectMode,n=P4(),u=bs(),c=nk(),f=T7().styleTextSelection,h={};function d(g,m,y,_){var v=g._size,x=g.width*_,S=g.height*_,M=v.l*_,C=v.b*_,w=v.r*_,k=v.t*_,A=v.w*_,b=v.h*_;return[M+m.domain[0]*A,C+y.domain[0]*b,x-w-(1-m.domain[1])*A,S-k-(1-y.domain[1])*b]}var p=r.exports=function(m,y,_){if(_.length){var v=m._fullLayout,x=y._scene,S=y.xaxis,M=y.yaxis,C,w;if(x){var k=n(m,["ANGLE_instanced_arrays","OES_element_index_uint"],h);if(!k){x.init();return}var A=x.count,b=v._glcanvas.data()[0].regl;if(c(m,y,_),x.dirty){if((x.line2d||x.error2d)&&!(x.scatter2d||x.fill2d||x.glText)&&b.clear({color:!0,depth:!0}),x.error2d===!0&&(x.error2d=a(b)),x.line2d===!0&&(x.line2d=i(b)),x.scatter2d===!0&&(x.scatter2d=t(b)),x.fill2d===!0&&(x.fill2d=i(b)),x.glText===!0)for(x.glText=new Array(A),C=0;Cx.glText.length){var E=A-x.glText.length;for(C=0;CY&&(isNaN(q[K])||isNaN(q[K+1]));)K-=2;j.positions=q.slice(Y,K+2)}return j}),x.line2d.update(x.lineOptions)),x.error2d){var D=(x.errorXOptions||[]).concat(x.errorYOptions||[]).map(function(j){return j||{positions:[],errors:[]}});x.error2d.update(D)}x.scatter2d&&x.scatter2d.update(x.markerOptions),x.fillOrder=s.repeat(null,A),x.fill2d&&(x.fillOptions=x.fillOptions.map(function(j,q){var Y=_[q];if(!(!j||!Y||!Y[0]||!Y[0].trace)){var K=Y[0],te=K.trace,ne=K.t,se=x.lineOptions[q],le,ce,pe=[];te._ownfill&&pe.push(q),te._nexttrace&&pe.push(q+1),pe.length&&(x.fillOrder[q]=pe);var xe=[],ye=se&&se.positions||ne.positions,fe,ae;if(te.fill==="tozeroy"){for(fe=0;fefe&&isNaN(ye[ae+1]);)ae-=2;ye[fe+1]!==0&&(xe=[ye[fe],0]),xe=xe.concat(ye.slice(fe,ae+2)),ye[ae+1]!==0&&(xe=xe.concat([ye[ae],0]))}else if(te.fill==="tozerox"){for(fe=0;fefe&&isNaN(ye[ae]);)ae-=2;ye[fe]!==0&&(xe=[0,ye[fe+1]]),xe=xe.concat(ye.slice(fe,ae+2)),ye[ae]!==0&&(xe=xe.concat([0,ye[ae+1]]))}else if(te.fill==="toself"||te.fill==="tonext"){for(xe=[],le=0,j.splitNull=!0,ce=0;ce-1;for(let[j]of _)if(j){var I=j.trace,L=j.t,B=L.index,O=I._length,G=L.x,W=L.y;if(I.selectedpoints||P||z){if(P||(P=!0),I.selectedpoints){var X=x.selectBatch[B]=I.selectedpoints,Z={};for(w=0;wS&&y||xf,T;for(E?T=y.sizeAvg||Math.max(y.size,3):T=a(p,m),M=0;M{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,o(()=>{this.dirty=!1})),this)},u.prototype.update=function(...d){if(!d.length)return;for(let m=0;mT||!y.lower&&E{p[_+x]=m})}this.scatter.draw(...p)}return this},u.prototype.destroy=function(){return this.traces.forEach(d=>{d.buffer&&d.buffer.destroy&&d.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function c(d,p,g){let m=d.id!=null?d.id:d,y=p,_=g;return m<<16|(y&255)<<8|_&255}function f(d,p,g){let m,y,_,v,x,S,M,C,w=d[p],k=d[g];return w.length>2?(m=w[0],_=w[2],y=w[1],v=w[3]):w.length?(m=y=w[0],_=v=w[1]):(m=w.x,y=w.y,_=w.x+w.width,v=w.y+w.height),k.length>2?(x=k[0],M=k[2],S=k[1],C=k[3]):k.length?(x=S=k[0],M=C=k[1]):(x=k.x,S=k.y,M=k.x+k.width,C=k.y+k.height),[x,y,M,v]}function h(d){if(typeof d=="number")return[d,d,d,d];if(d.length===2)return[d[0],d[1],d[0],d[1]];{let p=l(d);return[p.x,p.y,p.x+p.width,p.y+p.height]}}}}),JZ=de({"src/traces/splom/plot.js"(e,r){"use strict";var t=KZ(),i=Qt(),a=Hs(),o=Zd().selectMode;r.exports=function(n,u,c){if(c.length)for(var f=0;f-1,z=o(y)||!!f.selectedpoints||P,I=!0;if(z){var L=f._length;if(f.selectedpoints){d.selectBatch=f.selectedpoints;var B=f.selectedpoints,O={};for(x=0;x=G[W][0]&&O<=G[W][1])return!0;return!1}function p(O){O.attr("x",-t.bar.captureWidth/2).attr("width",t.bar.captureWidth)}function g(O){O.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(O){if(!O.brush.filterSpecified)return"0,"+O.height;for(var G=y(O.brush.filter.getConsolidated(),O.height),W=[0],X,Z,J,N=G.length?G[0][0]:null,H=0;HO[1]+W||G=.9*O[1]+.1*O[0]?"n":G<=.9*O[0]+.1*O[1]?"s":"ns"}function v(){i.select(document.body).style("cursor",null)}function x(O){O.attr("stroke-dasharray",m)}function S(O,G){var W=i.select(O).selectAll(".highlight, .highlight-shadow"),X=G?W.transition().duration(t.bar.snapDuration).each("end",G):W;x(X)}function M(O,G){var W=O.brush,X=W.filterSpecified,Z=NaN,J={},N;if(X){var H=O.height,$=W.filter.getConsolidated(),U=y($,H),V=NaN,j=NaN,q=NaN;for(N=0;N<=U.length;N++){var Y=U[N];if(Y&&Y[0]<=G&&G<=Y[1]){V=N;break}else if(j=N?N-1:NaN,Y&&Y[0]>G){q=N;break}}if(Z=V,isNaN(Z)&&(isNaN(j)||isNaN(q)?Z=isNaN(j)?q:j:Z=G-U[j][1]=le[0]&&se<=le[1]){J.clickableOrdinalRange=le;break}}}return J}function C(O,G){i.event.sourceEvent.stopPropagation();var W=G.height-i.mouse(O)[1]-2*t.verticalPadding,X=G.unitToPaddedPx.invert(W),Z=G.brush,J=M(G,W),N=J.interval,H=Z.svgBrush;if(H.wasDragged=!1,H.grabbingBar=J.region==="ns",H.grabbingBar){var $=N.map(G.unitToPaddedPx);H.grabPoint=W-$[0]-t.verticalPadding,H.barLength=$[1]-$[0]}H.clickableOrdinalRange=J.clickableOrdinalRange,H.stayingIntervals=G.multiselect&&Z.filterSpecified?Z.filter.getConsolidated():[],N&&(H.stayingIntervals=H.stayingIntervals.filter(function(U){return U[0]!==N[0]&&U[1]!==N[1]})),H.startExtent=J.region?N[J.region==="s"?1:0]:X,G.parent.inBrushDrag=!0,H.brushStartCallback()}function w(O,G){i.event.sourceEvent.stopPropagation();var W=G.height-i.mouse(O)[1]-2*t.verticalPadding,X=G.brush.svgBrush;X.wasDragged=!0,X._dragging=!0,X.grabbingBar?X.newExtent=[W-X.grabPoint,W+X.barLength-X.grabPoint].map(G.unitToPaddedPx.invert):X.newExtent=[X.startExtent,G.unitToPaddedPx.invert(W)].sort(s),G.brush.filterSpecified=!0,X.extent=X.stayingIntervals.concat([X.newExtent]),X.brushCallback(G),S(O.parentNode)}function k(O,G){var W=G.brush,X=W.filter,Z=W.svgBrush;Z._dragging||(A(O,G),w(O,G),G.brush.svgBrush.wasDragged=!1),Z._dragging=!1;var J=i.event;J.sourceEvent.stopPropagation();var N=Z.grabbingBar;if(Z.grabbingBar=!1,Z.grabLocation=void 0,G.parent.inBrushDrag=!1,v(),!Z.wasDragged){Z.wasDragged=void 0,Z.clickableOrdinalRange?W.filterSpecified&&G.multiselect?Z.extent.push(Z.clickableOrdinalRange):(Z.extent=[Z.clickableOrdinalRange],W.filterSpecified=!0):N?(Z.extent=Z.stayingIntervals,Z.extent.length===0&&R(W)):R(W),Z.brushCallback(G),S(O.parentNode),Z.brushEndCallback(W.filterSpecified?X.getConsolidated():[]);return}var H=function(){X.set(X.getConsolidated())};if(G.ordinal){var $=G.unitTickvals;$[$.length-1]<$[0]&&$.reverse(),Z.newExtent=[h(0,$,Z.newExtent[0],Z.stayingIntervals),h(1,$,Z.newExtent[1],Z.stayingIntervals)];var U=Z.newExtent[1]>Z.newExtent[0];Z.extent=Z.stayingIntervals.concat(U?[Z.newExtent]:[]),Z.extent.length||R(W),Z.brushCallback(G),U?S(O.parentNode,H):(H(),S(O.parentNode))}else H();Z.brushEndCallback(W.filterSpecified?X.getConsolidated():[])}function A(O,G){var W=G.height-i.mouse(O)[1]-2*t.verticalPadding,X=M(G,W),Z="crosshair";X.clickableOrdinalRange?Z="pointer":X.region&&(Z=X.region+"-resize"),i.select(document.body).style("cursor",Z)}function b(O){O.on("mousemove",function(G){i.event.preventDefault(),G.parent.inBrushDrag||A(this,G)}).on("mouseleave",function(G){G.parent.inBrushDrag||v()}).call(i.behavior.drag().on("dragstart",function(G){C(this,G)}).on("drag",function(G){w(this,G)}).on("dragend",function(G){k(this,G)}))}function E(O,G){return O[0]-G[0]}function T(O,G,W){var X=W._context.staticPlot,Z=O.selectAll(".background").data(o);Z.enter().append("rect").classed("background",!0).call(p).call(g).style("pointer-events",X?"none":"auto").attr("transform",l(0,t.verticalPadding)),Z.call(b).attr("height",function(H){return H.height-t.verticalPadding});var J=O.selectAll(".highlight-shadow").data(o);J.enter().append("line").classed("highlight-shadow",!0).attr("x",-t.bar.width/2).attr("stroke-width",t.bar.width+t.bar.strokeWidth).attr("stroke",G).attr("opacity",t.bar.strokeOpacity).attr("stroke-linecap","butt"),J.attr("y1",function(H){return H.height}).call(x);var N=O.selectAll(".highlight").data(o);N.enter().append("line").classed("highlight",!0).attr("x",-t.bar.width/2).attr("stroke-width",t.bar.width-t.bar.strokeWidth).attr("stroke",t.bar.fillColor).attr("opacity",t.bar.fillOpacity).attr("stroke-linecap","butt"),N.attr("y1",function(H){return H.height}).call(x)}function F(O,G,W){var X=O.selectAll("."+t.cn.axisBrush).data(o,a);X.enter().append("g").classed(t.cn.axisBrush,!0),T(X,G,W)}function D(O){return O.svgBrush.extent.map(function(G){return G.slice()})}function R(O){O.filterSpecified=!1,O.svgBrush.extent=[[-1/0,1/0]]}function P(O){return function(W){var X=W.brush,Z=D(X),J=Z.slice();X.filter.set(J),O()}}function z(O){for(var G=O.slice(),W=[],X,Z=G.shift();Z;){for(X=Z.slice();(Z=G.shift())&&Z[0]<=X[1];)X[1]=Math.max(X[1],Z[1]);W.push(X)}return W.length===1&&W[0][0]>W[0][1]&&(W=[]),W}function I(){var O=[],G,W;return{set:function(X){O=X.map(function(Z){return Z.slice().sort(s)}).sort(E),O.length===1&&O[0][0]===-1/0&&O[0][1]===1/0&&(O=[[0,-1]]),G=z(O),W=O.reduce(function(Z,J){return[Math.min(Z[0],J[0]),Math.max(Z[1],J[1])]},[1/0,-1/0])},get:function(){return O.slice()},getConsolidated:function(){return G},getBounds:function(){return W}}}function L(O,G,W,X,Z,J){var N=I();return N.set(W),{filter:N,filterSpecified:G,svgBrush:{extent:[],brushStartCallback:X,brushCallback:P(Z),brushEndCallback:J}}}function B(O,G){if(Array.isArray(O[0])?(O=O.map(function(X){return X.sort(s)}),G.multiselect?O=z(O.sort(E)):O=[O[0]]):O=[O.sort(s)],G.tickvals){var W=G.tickvals.slice().sort(s);if(O=O.map(function(X){var Z=[h(0,W,X[0],[]),h(1,W,X[1],[])];if(Z[1]>Z[0])return Z}).filter(function(X){return X}),!O.length)return}return O.length>1?O:O[0]}r.exports={makeBrush:L,ensureAxisBrush:F,cleanRanges:B}}}),oK=de({"src/traces/parcoords/defaults.js"(e,r){"use strict";var t=Qt(),i=Wu().hasColorscale,a=hu(),o=Rs().defaults,s=fc(),l=nn(),n=Q7(),u=e9(),c=M_().maxDimensionCount,f=I4();function h(p,g,m,y,_){var v=_("line.color",m);if(i(p,"line")&&t.isArrayOrTypedArray(v)){if(v.length)return _("line.colorscale"),a(p,g,y,_,{prefix:"line.",cLetter:"c"}),v.length;g.line.color=m}return 1/0}function d(p,g,m,y){function _(C,w){return t.coerce(p,g,n.dimensions,C,w)}var v=_("values"),x=_("visible");if(v&&v.length||(x=g.visible=!1),x){_("label"),_("tickvals"),_("ticktext"),_("tickformat");var S=_("range");g._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:S},l.setConvert(g._ax,y.layout),_("multiselect");var M=_("constraintrange");M&&(g.constraintrange=u.cleanRanges(M,g))}}r.exports=function(g,m,y,_){function v(w,k){return t.coerce(g,m,n,w,k)}var x=g.dimensions;Array.isArray(x)&&x.length>c&&(t.log("parcoords traces support up to "+c+" dimensions at the moment"),x.splice(c));var S=s(g,m,{name:"dimensions",layout:_,handleItemDefaults:d}),M=h(g,m,y,_,v);o(m,_,v),(!Array.isArray(S)||!S.length)&&(m.visible=!1),f(m,S,"values",M);var C=t.extendFlat({},_.font,{size:Math.round(_.font.size/1.2)});t.coerceFont(v,"labelfont",C),t.coerceFont(v,"tickfont",C,{autoShadowDflt:!0}),t.coerceFont(v,"rangefont",C),v("labelangle"),v("labelside"),v("unselected.line.color"),v("unselected.line.opacity")}}}),sK=de({"src/traces/parcoords/calc.js"(e,r){"use strict";var t=Qt().isArrayOrTypedArray,i=Cs(),a=ap().wrap;r.exports=function(l,n){var u,c;return i.hasColorscale(n,"line")&&t(n.line.color)?(u=n.line.color,c=i.extractOpts(n.line).colorscale,i.calc(l,n,{vals:u,containerStr:"line",cLetter:"c"})):(u=o(n._length),c=[[0,n.line.color],[1,n.line.color]]),a({lineColor:u,cscale:c})};function o(s){for(var l=new Array(s),n=0;n 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` `),i=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` -`),a=M_().maxDimensionCount,o=Qt(),s=1e-6,l=2048,n=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(k){k.read({x:0,y:0,width:1,height:1,data:n})}function h(k,A,b,E,T){var F=k._gl;F.enable(F.SCISSOR_TEST),F.scissor(A,b,E,T),k.clear({color:[0,0,0,0],depth:1})}function d(k,A,b,E,T,F){var D=F.key;function R(P){var z=Math.min(E,T-P*E);P===0&&(window.cancelAnimationFrame(b.currentRafs[D]),delete b.currentRafs[D],h(k,F.scissorX,F.scissorY,F.scissorWidth,F.viewBoxSize[1])),!b.clearOnly&&(F.count=2*z,F.offset=2*P*E,A(F),P*E+z>>8*A)%256/255}function y(k,A,b){for(var E=new Array(k*(a+4)),T=0,F=0;Fce&&(ce=j[te].dim1.canvasX,se=te);K===0&&h(T,0,0,z.canvasWidth,z.canvasHeight);var pe=N(b);for(te=0;tete._length&&(ae=ae.slice(0,te._length));var ee=te.tickvals,ie;function Q(je,Ve){return{val:je,text:ie[Ve]}}function ue(je,Ve){return je.val-Ve.val}if(a(ee)&&ee.length){i.isTypedArray(ee)&&(ee=Array.from(ee)),ie=te.ticktext,!a(ie)||!ie.length?ie=ee.map(o(te.tickformat)):ie.length>ee.length?ie=ie.slice(0,ee.length):ee.length>ie.length&&(ee=ee.slice(0,ie.length));for(var ge=1;ge=Ve||xt>=Ze)return;var Pt=Te.lineLayer.readPixel(vt,Ze-1-xt),mt=Pt[3]!==0,Mt=mt?Pt[2]+256*(Pt[1]+256*Pt[0]):null,lt={x:vt,y:xt,clientX:je.clientX,clientY:je.clientY,dataIndex:Te.model.key,curveNumber:Mt};Mt!==se&&(mt?H.hover(lt):H.unhover&&H.unhover(lt),se=Mt)}}),ne.style("opacity",function(Te){return Te.pick?0:1}),V.style("background","rgba(255, 255, 255, 0)");var ce=V.selectAll("."+_.cn.parcoords).data(te,p);ce.exit().remove(),ce.enter().append("g").classed(_.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),ce.attr("transform",function(Te){return u(Te.model.translateX,Te.model.translateY)});var pe=ce.selectAll("."+_.cn.parcoordsControlView).data(g,p);pe.enter().append("g").classed(_.cn.parcoordsControlView,!0),pe.attr("transform",function(Te){return u(Te.model.pad.l,Te.model.pad.t)});var xe=pe.selectAll("."+_.cn.yAxis).data(function(Te){return Te.dimensions},p);xe.enter().append("g").classed(_.cn.yAxis,!0),pe.each(function(Te){B(xe,Te,q)}),ne.each(function(Te){if(Te.viewModel){!Te.lineLayer||H?Te.lineLayer=x(this,Te):Te.lineLayer.update(Te),(Te.key||Te.key===0)&&(Te.viewModel[Te.key]=Te.lineLayer);var je=!Te.context||H;Te.lineLayer.render(Te.viewModel.panels,je)}}),xe.attr("transform",function(Te){return u(Te.xScale(Te.xIndex),0)}),xe.call(t.behavior.drag().origin(function(Te){return Te}).on("drag",function(Te){var je=Te.parent;K.linePickActive(!1),Te.x=Math.max(-_.overdrag,Math.min(Te.model.width+_.overdrag,t.event.x)),Te.canvasX=Te.x*Te.model.canvasPixelRatio,xe.sort(function(Ve,Ze){return Ve.x-Ze.x}).each(function(Ve,Ze){Ve.xIndex=Ze,Ve.x=Te===Ve?Ve.x:Ve.xScale(Ve.xIndex),Ve.canvasX=Ve.x*Ve.model.canvasPixelRatio}),B(xe,je,q),xe.filter(function(Ve){return Math.abs(Te.xIndex-Ve.xIndex)!==0}).attr("transform",function(Ve){return u(Ve.xScale(Ve.xIndex),0)}),t.select(this).attr("transform",u(Te.x,0)),xe.each(function(Ve,Ze,Ke){Ke===Te.parent.key&&(je.dimensions[Ze]=Ve)}),je.contextLayer&&je.contextLayer.render(je.panels,!1,!D(je)),je.focusLayer.render&&je.focusLayer.render(je.panels)}).on("dragend",function(Te){var je=Te.parent;Te.x=Te.xScale(Te.xIndex),Te.canvasX=Te.x*Te.model.canvasPixelRatio,B(xe,je,q),t.select(this).attr("transform",function(Ve){return u(Ve.x,0)}),je.contextLayer&&je.contextLayer.render(je.panels,!1,!D(je)),je.focusLayer&&je.focusLayer.render(je.panels),je.pickLayer&&je.pickLayer.render(je.panels,!0),K.linePickActive(!0),H&&H.axesMoved&&H.axesMoved(je.key,je.dimensions.map(function(Ve){return Ve.crossfilterDimensionIndex}))})),xe.exit().remove();var ye=xe.selectAll("."+_.cn.axisOverlays).data(g,p);ye.enter().append("g").classed(_.cn.axisOverlays,!0),ye.selectAll("."+_.cn.axis).remove();var fe=ye.selectAll("."+_.cn.axis).data(g,p);fe.enter().append("g").classed(_.cn.axis,!0),fe.each(function(Te){var je=Te.model.height/Te.model.tickDistance,Ve=Te.domainScale,Ze=Ve.domain();t.select(this).call(t.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(je,Te.tickFormat).tickValues(Te.ordinal?Ze:null).tickFormat(function(Ke){return y.isOrdinal(Te)?Ke:G(Te.model.dimensions[Te.visibleIndex],Ke)}).scale(Ve)),f.font(fe.selectAll("text"),Te.model.tickFont)}),fe.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),fe.selectAll("text").style("cursor","default");var ae=ye.selectAll("."+_.cn.axisHeading).data(g,p);ae.enter().append("g").classed(_.cn.axisHeading,!0);var ee=ae.selectAll("."+_.cn.axisTitle).data(g,p);ee.enter().append("text").classed(_.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",$?"none":"auto"),ee.text(function(Te){return Te.label}).each(function(Te){var je=t.select(this);f.font(je,Te.model.labelFont),c.convertToTspans(je,Z)}).attr("transform",function(Te){var je=L(Te.model.labelAngle,Te.model.labelSide),Ve=_.axisTitleOffset;return(je.dir>0?"":u(0,2*Ve+Te.model.height))+n(je.degrees)+u(-Ve*je.dx,-Ve*je.dy)}).attr("text-anchor",function(Te){var je=L(Te.model.labelAngle,Te.model.labelSide),Ve=Math.abs(je.dx),Ze=Math.abs(je.dy);return 2*Ve>Ze?je.dir*je.dx<0?"start":"end":"middle"});var ie=ye.selectAll("."+_.cn.axisExtent).data(g,p);ie.enter().append("g").classed(_.cn.axisExtent,!0);var Q=ie.selectAll("."+_.cn.axisExtentTop).data(g,p);Q.enter().append("g").classed(_.cn.axisExtentTop,!0),Q.attr("transform",u(0,-_.axisExtentOffset));var ue=Q.selectAll("."+_.cn.axisExtentTopText).data(g,p);ue.enter().append("text").classed(_.cn.axisExtentTopText,!0).call(z),ue.text(function(Te){return W(Te,!0)}).each(function(Te){f.font(t.select(this),Te.model.rangeFont)});var ge=ie.selectAll("."+_.cn.axisExtentBottom).data(g,p);ge.enter().append("g").classed(_.cn.axisExtentBottom,!0),ge.attr("transform",function(Te){return u(0,Te.model.height+_.axisExtentOffset)});var Me=ge.selectAll("."+_.cn.axisExtentBottomText).data(g,p);Me.enter().append("text").classed(_.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),Me.text(function(Te){return W(Te,!1)}).each(function(Te){f.font(t.select(this),Te.model.rangeFont)}),v.ensureAxisBrush(ye,Y,Z)}}}),r9=de({"src/traces/parcoords/plot.js"(n,r){"use strict";var t=uK(),i=P4(),a=t9().isVisible,o={};function s(u,c,f){var h=c.indexOf(f),d=u.indexOf(h);return d===-1&&(d+=c.length),d}function l(u,c){return function(h,d){return s(u,c,h)-s(u,c,d)}}var n=r.exports=function(c,f){var h=c._fullLayout,d=i(c,[],o);if(d){var p={},g={},m={},y=h._size;f.forEach(function(M,C){var w=M[0].trace,k=m[C]=w.index;p[C]=c.data[k].dimensions,g[C]=c.data[k].dimensions.slice()});var _=function(M,C,w){var k=g[M][C],A=w.map(function(R){return R.slice()}),b="dimensions["+C+"].constraintrange",E=h._tracePreGUI[c._fullData[m[M]].uid];if(E[b]===void 0){var T=k.constraintrange;E[b]=T||null}var F=c._fullData[m[M]].dimensions[C];A.length?(A.length===1&&(A=A[0]),k.constraintrange=A,F.constraintrange=A.slice(),A=[A]):(delete k.constraintrange,delete F.constraintrange,A=null);var D={};D[b]=A,c.emit("plotly_restyle",[D,[m[M]]])},v=function(M){c.emit("plotly_hover",M)},x=function(M){c.emit("plotly_unhover",M)},S=function(M,C){var w=l(C,g[M].filter(a));p[M].sort(w),g[M].filter(function(k){return!a(k)}).sort(function(k){return g[M].indexOf(k)}).forEach(function(k){p[M].splice(p[M].indexOf(k),1),p[M].splice(g[M].indexOf(k),0,k)}),c.emit("plotly_restyle",[{dimensions:[p[M]]},[m[M]]])};t(c,f,{width:y.w,height:y.h,margin:{t:y.t,r:y.r,b:y.b,l:y.l}},{filterChanged:_,hover:v,unhover:x,axesMoved:S})}};n.reglPrecompiled=o}}),cK=de({"src/traces/parcoords/base_plot.js"(e){"use strict";var r=Yr(),t=$u().getModuleCalcData,i=r9(),a=Oh();e.name="parcoords",e.plot=function(o){var s=t(o.calcdata,"parcoords")[0];s.length&&i(o,s)},e.clean=function(o,s,l,n){var u=n._has&&n._has("parcoords"),c=s._has&&s._has("parcoords");u&&!c&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},e.toSVG=function(o){var s=o._fullLayout._glimages,l=r.select(o).selectAll(".svg-container"),n=l.filter(function(c,f){return f===l.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function u(){var c=this,f=c.toDataURL("image/png"),h=s.append("svg:image");h.attr({xmlns:a.svg,"xlink:href":f,preserveAspectRatio:"none",x:0,y:0,width:c.style.width,height:c.style.height})}n.each(u),window.setTimeout(function(){r.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),fK=de({"src/traces/parcoords/base_index.js"(e,r){"use strict";r.exports={attributes:Q7(),supplyDefaults:oK(),calc:sK(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:cK(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),hK=de({"src/traces/parcoords/index.js"(e,r){"use strict";var t=fK();t.plot=r9(),r.exports=t}}),dK=de({"lib/parcoords.js"(e,r){"use strict";r.exports=hK()}}),i9=de({"src/traces/parcats/attributes.js"(e,r){"use strict";var t=fn().extendFlat,i=ri(),a=us(),o=cs(),{hovertemplateAttrs:s,templatefallbackAttrs:l}=Vo(),n=Is().attributes,u=t({editType:"calc"},o("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:l({editType:"plot"})});r.exports={domain:n({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:t({},i.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:l({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:a({editType:"calc"}),tickfont:a({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:u,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),pK=de({"src/traces/parcats/defaults.js"(e,r){"use strict";var t=Qt(),i=Wu().hasColorscale,a=hu(),o=Is().defaults,s=fc(),l=i9(),n=I4(),u=Do().isTypedArraySpec;function c(h,d,p,g,m){m("line.shape"),m("line.hovertemplate"),m("line.hovertemplatefallback");var y=m("line.color",g.colorway[0]);if(i(h,"line")&&t.isArrayOrTypedArray(y)){if(y.length)return m("line.colorscale"),a(h,d,g,m,{prefix:"line.",cLetter:"c"}),y.length;d.line.color=p}return 1/0}function f(h,d){function p(S,M){return t.coerce(h,d,l.dimensions,S,M)}var g=p("values"),m=p("visible");if(g&&g.length||(m=d.visible=!1),m){p("label"),p("displayindex",d._index);var y=h.categoryarray,_=t.isArrayOrTypedArray(y)&&y.length>0||u(y),v;_&&(v="array");var x=p("categoryorder",v);x==="array"?(p("categoryarray"),p("ticktext")):(delete h.categoryarray,delete h.ticktext),!_&&x==="array"&&(d.categoryorder="trace")}}r.exports=function(d,p,g,m){function y(S,M){return t.coerce(d,p,l,S,M)}var _=s(d,p,{name:"dimensions",handleItemDefaults:f}),v=c(d,p,g,m,y);o(p,m,y),(!Array.isArray(_)||!_.length)&&(p.visible=!1),n(p,_,"values",v),y("hoveron"),y("hovertemplate"),y("hovertemplatefallback"),y("arrangement"),y("bundlecolors"),y("sortpaths"),y("counts");var x=m.font;t.coerceFont(y,"labelfont",x,{overrideDflt:{size:Math.round(x.size)}}),t.coerceFont(y,"tickfont",x,{autoShadowDflt:!0,overrideDflt:{size:Math.round(x.size/1.2)}})}}}),vK=de({"src/traces/parcats/calc.js"(e,r){"use strict";var t=ip().wrap,i=Wu().hasColorscale,a=hc(),o=mE(),s=hn(),l=Qt(),n=da();r.exports=function(x,S){var M=l.filterVisible(S.dimensions);if(M.length===0)return[];var C=M.map(function(N){var H;if(N.categoryorder==="trace")H=null;else if(N.categoryorder==="array")H=N.categoryarray;else{H=o(N.values);for(var $=!0,U=0;U=v.length||x[v[S]]!==void 0)return!1;x[v[S]]=!0}return!0}}}),mK=de({"src/traces/parcats/parcats.js"(e,r){"use strict";var t=Yr(),i=(jv(),ti(M0)).interpolateNumber,a=Iw(),o=ta(),s=$s(),l=Qt(),n=l.strTranslate,u=hn(),c=Zo();function f(V,j,q,Y){var K=j._context.staticPlot,te=V.map(J.bind(0,j,q)),ne=Y.selectAll("g.parcatslayer").data([null]);ne.enter().append("g").attr("class","parcatslayer").style("pointer-events",K?"none":"all");var se=ne.selectAll("g.trace.parcats").data(te,h),le=se.enter().append("g").attr("class","trace parcats");se.attr("transform",function(ue){return n(ue.x,ue.y)}),le.append("g").attr("class","paths");var ce=se.select("g.paths"),pe=ce.selectAll("path.path").data(function(ue){return ue.paths},h);pe.attr("fill",function(ue){return ue.model.color});var xe=pe.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(ue){return ue.model.color}).attr("fill-opacity",0);S(xe),pe.attr("d",function(ue){return ue.svgD}),xe.empty()||pe.sort(p),pe.exit().remove(),pe.on("mouseover",m).on("mouseout",y).on("click",x),le.append("g").attr("class","dimensions");var ye=se.select("g.dimensions"),fe=ye.selectAll("g.dimension").data(function(ue){return ue.dimensions},h);fe.enter().append("g").attr("class","dimension"),fe.attr("transform",function(ue){return n(ue.x,0)}),fe.exit().remove();var ae=fe.selectAll("g.category").data(function(ue){return ue.categories},h),ee=ae.enter().append("g").attr("class","category");ae.attr("transform",function(ue){return n(0,ue.y)}),ee.append("rect").attr("class","catrect").attr("pointer-events","none"),ae.select("rect.catrect").attr("fill","none").attr("width",function(ue){return ue.width}).attr("height",function(ue){return ue.height}),w(ee);var ie=ae.selectAll("rect.bandrect").data(function(ue){return ue.bands},h);ie.each(function(){l.raiseToTop(this)}),ie.attr("fill",function(ue){return ue.color});var Q=ie.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(ue){return ue.color}).attr("fill-opacity",0);ie.attr("fill",function(ue){return ue.color}).attr("width",function(ue){return ue.width}).attr("height",function(ue){return ue.height}).attr("y",function(ue){return ue.y}).attr("cursor",function(ue){return ue.parcatsViewModel.arrangement==="fixed"?"default":ue.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),A(Q),ie.exit().remove(),ee.append("text").attr("class","catlabel").attr("pointer-events","none"),ae.select("text.catlabel").attr("text-anchor",function(ue){return d(ue)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(ue){return d(ue)?ue.width+5:-5}).attr("y",function(ue){return ue.height/2}).text(function(ue){return ue.model.categoryLabel}).each(function(ue){u.font(t.select(this),ue.parcatsViewModel.categorylabelfont),c.convertToTspans(t.select(this),j)}),ee.append("text").attr("class","dimlabel"),ae.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(ue){return ue.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(ue){return ue.width/2}).attr("y",-5).text(function(ue,ge){return ge===0?ue.parcatsViewModel.model.dimensions[ue.model.dimensionInd].dimensionLabel:null}).each(function(ue){u.font(t.select(this),ue.parcatsViewModel.labelfont)}),ae.selectAll("rect.bandrect").on("mouseover",I).on("mouseout",L),ae.exit().remove(),fe.call(t.behavior.drag().origin(function(ue){return{x:ue.x,y:0}}).on("dragstart",B).on("drag",O).on("dragend",G)),se.each(function(ue){ue.traceSelection=t.select(this),ue.pathSelection=t.select(this).selectAll("g.paths").selectAll("path.path"),ue.dimensionSelection=t.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),se.exit().remove()}r.exports=function(V,j,q,Y){f(q,V,Y,j)};function h(V){return V.key}function d(V){var j=V.parcatsViewModel.dimensions.length,q=V.parcatsViewModel.dimensions[j-1].model.dimensionInd;return V.model.dimensionInd===q}function p(V,j){return V.model.rawColor>j.model.rawColor?1:V.model.rawColorK)return 1;if(Y!==K){var te=isNaN(Y),ne=isNaN(K);if(te!==ne)return te?1:-1}}return V.length-j.length}function m(V){if(!V.parcatsViewModel.dragDimension&&V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){l.raiseToTop(this),M(t.select(this));var j=_(V),q=v(V);if(V.parcatsViewModel.graphDiv.emit("plotly_hover",{points:j,event:t.event,constraints:q}),V.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Y=t.mouse(this)[0],K=V.parcatsViewModel.graphDiv,te=V.parcatsViewModel.trace,ne=K._fullLayout,se=ne._paperdiv.node().getBoundingClientRect(),le=V.parcatsViewModel.graphDiv.getBoundingClientRect(),ce,pe,xe;for(xe=0;xe"),je=t.mouse(K)[0];s.loneHover({trace:te,x:ae-se.left+le.left,y:ee-se.top+le.top,text:Te,color:V.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:ie,idealAlign:jeo.mostReadable(j.model.color)).attr("stroke-width",.3)}function C(V){V.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}function w(V){V.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function k(V){V.attr("stroke","black").attr("stroke-width",1.5)}function A(V){V.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function b(V){var j=V.parcatsViewModel.pathSelection,q=V.categoryViewModel.model.dimensionInd,Y=V.categoryViewModel.model.categoryInd;return j.filter(function(K){return K.model.categoryInds[q]===Y&&K.model.color===V.color})}function E(V){var j=t.select(V.parentNode).selectAll("rect.bandrect");j.each(function(q){var Y=b(q);M(Y),Y.each(function(){l.raiseToTop(this)})}),C(t.select(V.parentNode))}function T(V){var j=t.select(V).datum(),q=b(j);M(q),q.each(function(){l.raiseToTop(this)}),t.select(V.parentNode).selectAll("rect.bandrect").filter(function(Y){return Y.color===j.color}).each(function(){l.raiseToTop(this),k(t.select(this))})}function F(V,j,q){var Y=t.select(V).datum(),K=Y.categoryViewModel.model,te=Y.parcatsViewModel.graphDiv,ne=t.select(V.parentNode).selectAll("rect.bandrect"),se=[];ne.each(function(ce){var pe=b(ce);pe.each(function(xe){Array.prototype.push.apply(se,_(xe))})});var le={};le[K.dimensionInd]=K.categoryValue,te.emit(j,{points:se,event:q,constraints:le})}function D(V,j,q){var Y=t.select(V).datum(),K=Y.categoryViewModel.model,te=Y.parcatsViewModel.graphDiv,ne=b(Y),se=[];ne.each(function(ce){Array.prototype.push.apply(se,_(ce))});var le={};le[K.dimensionInd]=K.categoryValue,Y.rawColor!==void 0&&(le.color=Y.rawColor),te.emit(j,{points:se,event:q,constraints:le})}function R(V,j,q){V._fullLayout._calcInverseTransform(V);var Y=V._fullLayout._invScaleX,K=V._fullLayout._invScaleY,te=t.select(q.parentNode).select("rect.catrect"),ne=te.node().getBoundingClientRect(),se=te.datum(),le=se.parcatsViewModel,ce=le.model.dimensions[se.model.dimensionInd],pe=le.trace,xe=ne.top+ne.height/2,ye,fe;le.dimensions.length>1&&ce.displayInd===le.dimensions.length-1?(ye=ne.left,fe="left"):(ye=ne.left+ne.width,fe="right");var ae=se.model.count,ee=se.model.categoryLabel,ie=ae/se.parcatsViewModel.model.count,Q={countLabel:ae,categoryLabel:ee,probabilityLabel:ie.toFixed(3)},ue=[];se.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&ue.push(["Count:",Q.countLabel].join(" ")),se.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&ue.push(["P("+Q.categoryLabel+"):",Q.probabilityLabel].join(" "));var ge=ue.join("
");return{trace:pe,x:Y*(ye-j.left),y:K*(xe-j.top),text:ge,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:fe,hovertemplate:pe.hovertemplate,hovertemplateLabels:Q,eventData:[{data:pe._input,fullData:pe,count:ae,category:ee,probability:ie}]}}function P(V,j,q){var Y=[];return t.select(q.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var K=this;Y.push(R(V,j,K))}),Y}function z(V,j,q){V._fullLayout._calcInverseTransform(V);var Y=V._fullLayout._invScaleX,K=V._fullLayout._invScaleY,te=q.getBoundingClientRect(),ne=t.select(q).datum(),se=ne.categoryViewModel,le=se.parcatsViewModel,ce=le.model.dimensions[se.model.dimensionInd],pe=le.trace,xe=te.y+te.height/2,ye,fe;le.dimensions.length>1&&ce.displayInd===le.dimensions.length-1?(ye=te.left,fe="left"):(ye=te.left+te.width,fe="right");var ae=se.model.categoryLabel,ee=ne.parcatsViewModel.model.count,ie=0;ne.categoryViewModel.bands.forEach(function(vt){vt.color===ne.color&&(ie+=vt.count)});var Q=se.model.count,ue=0;le.pathSelection.each(function(vt){vt.model.color===ne.color&&(ue+=vt.model.count)});var ge=ie/ee,Me=ie/ue,Te=ie/Q,je={countLabel:ie,categoryLabel:ae,probabilityLabel:ge.toFixed(3)},Ve=[];se.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ve.push(["Count:",je.countLabel].join(" ")),se.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ve.push("P(color \u2229 "+ae+"): "+je.probabilityLabel),Ve.push("P("+ae+" | color): "+Me.toFixed(3)),Ve.push("P(color | "+ae+"): "+Te.toFixed(3)));var Ze=Ve.join("
"),Ke=o.mostReadable(ne.color);return{trace:pe,x:Y*(ye-j.left),y:K*(xe-j.top),text:Ze,color:ne.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Ke,fontSize:10,idealAlign:fe,hovertemplate:pe.hovertemplate,hovertemplateLabels:je,eventData:[{data:pe._input,fullData:pe,category:ae,count:ee,probability:ge,categorycount:Q,colorcount:ue,bandcolorcount:ie}]}}function I(V){if(!V.parcatsViewModel.dragDimension&&V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var j=t.mouse(this)[1];if(j<-1)return;var q=V.parcatsViewModel.graphDiv,Y=q._fullLayout,K=Y._paperdiv.node().getBoundingClientRect(),te=V.parcatsViewModel.hoveron,ne=this;if(te==="color"?(T(ne),D(ne,"plotly_hover",t.event)):(E(ne),F(ne,"plotly_hover",t.event)),V.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var se;te==="category"?se=R(q,K,ne):te==="color"?se=z(q,K,ne):te==="dimension"&&(se=P(q,K,ne)),se&&s.loneHover(se,{container:Y._hoverlayer.node(),outerContainer:Y._paper.node(),gd:q})}}}function L(V){var j=V.parcatsViewModel;if(!j.dragDimension&&(S(j.pathSelection),w(j.dimensionSelection.selectAll("g.category")),A(j.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),s.loneUnhover(j.graphDiv._fullLayout._hoverlayer.node()),j.pathSelection.sort(p),j.hoverinfoItems.indexOf("skip")===-1)){var q=V.parcatsViewModel.hoveron,Y=this;q==="color"?D(Y,"plotly_unhover",t.event):F(Y,"plotly_unhover",t.event)}}function B(V){V.parcatsViewModel.arrangement!=="fixed"&&(V.dragDimensionDisplayInd=V.model.displayInd,V.initialDragDimensionDisplayInds=V.parcatsViewModel.model.dimensions.map(function(j){return j.displayInd}),V.dragHasMoved=!1,V.dragCategoryDisplayInd=null,t.select(this).selectAll("g.category").select("rect.catrect").each(function(j){var q=t.mouse(this)[0],Y=t.mouse(this)[1];-2<=q&&q<=j.width+2&&-2<=Y&&Y<=j.height+2&&(V.dragCategoryDisplayInd=j.model.displayInd,V.initialDragCategoryDisplayInds=V.model.categories.map(function(K){return K.displayInd}),j.model.dragY=j.y,l.raiseToTop(this.parentNode),t.select(this.parentNode).selectAll("rect.bandrect").each(function(K){K.ype.y+pe.height/2&&(te.model.displayInd=pe.model.displayInd,pe.model.displayInd=se),V.dragCategoryDisplayInd=te.model.displayInd}if(V.dragCategoryDisplayInd===null||V.parcatsViewModel.arrangement==="freeform"){K.model.dragX=t.event.x;var xe=V.parcatsViewModel.dimensions[q],ye=V.parcatsViewModel.dimensions[Y];xe!==void 0&&K.model.dragXye.x&&(K.model.displayInd=ye.model.displayInd,ye.model.displayInd=V.dragDimensionDisplayInd),V.dragDimensionDisplayInd=K.model.displayInd}$(V.parcatsViewModel),H(V.parcatsViewModel),Z(V.parcatsViewModel),X(V.parcatsViewModel)}}function G(V){if(V.parcatsViewModel.arrangement!=="fixed"&&V.dragDimensionDisplayInd!==null){t.select(this).selectAll("text").attr("font-weight","normal");var j={},q=W(V.parcatsViewModel),Y=V.parcatsViewModel.model.dimensions.map(function(ye){return ye.displayInd}),K=V.initialDragDimensionDisplayInds.some(function(ye,fe){return ye!==Y[fe]});K&&Y.forEach(function(ye,fe){var ae=V.parcatsViewModel.model.dimensions[fe].containerInd;j["dimensions["+ae+"].displayindex"]=ye});var te=!1;if(V.dragCategoryDisplayInd!==null){var ne=V.model.categories.map(function(ye){return ye.displayInd});if(te=V.initialDragCategoryDisplayInds.some(function(ye,fe){return ye!==ne[fe]}),te){var se=V.model.categories.slice().sort(function(ye,fe){return ye.displayInd-fe.displayInd}),le=se.map(function(ye){return ye.categoryValue}),ce=se.map(function(ye){return ye.categoryLabel});j["dimensions["+V.model.containerInd+"].categoryarray"]=[le],j["dimensions["+V.model.containerInd+"].ticktext"]=[ce],j["dimensions["+V.model.containerInd+"].categoryorder"]="array"}}if(V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!V.dragHasMoved&&V.potentialClickBand&&(V.parcatsViewModel.hoveron==="color"?D(V.potentialClickBand,"plotly_click",t.event.sourceEvent):F(V.potentialClickBand,"plotly_click",t.event.sourceEvent)),V.model.dragX=null,V.dragCategoryDisplayInd!==null){var pe=V.parcatsViewModel.dimensions[V.dragDimensionDisplayInd].categories[V.dragCategoryDisplayInd];pe.model.dragY=null,V.dragCategoryDisplayInd=null}V.dragDimensionDisplayInd=null,V.parcatsViewModel.dragDimension=null,V.dragHasMoved=null,V.potentialClickBand=null,$(V.parcatsViewModel),H(V.parcatsViewModel);var xe=t.transition().duration(300).ease("cubic-in-out");xe.each(function(){Z(V.parcatsViewModel,!0),X(V.parcatsViewModel,!0)}).each("end",function(){(K||te)&&a.restyle(V.parcatsViewModel.graphDiv,j,[q])})}}function W(V){for(var j,q=V.graphDiv._fullData,Y=0;Y=0;le--)ce+="C"+ne[le]+","+(j[le+1]+Y)+" "+te[le]+","+(j[le]+Y)+" "+(V[le]+q[le])+","+(j[le]+Y),ce+="l-"+q[le]+",0 ";return ce+="Z",ce}function H(V){var j=V.dimensions,q=V.model,Y=j.map(function(mt){return mt.categories.map(function(Mt){return Mt.y})}),K=V.model.dimensions.map(function(mt){return mt.categories.map(function(Mt){return Mt.displayInd})}),te=V.model.dimensions.map(function(mt){return mt.displayInd}),ne=V.dimensions.map(function(mt){return mt.model.dimensionInd}),se=j.map(function(mt){return mt.x}),le=j.map(function(mt){return mt.width}),ce=[];for(var pe in q.paths)q.paths.hasOwnProperty(pe)&&ce.push(q.paths[pe]);function xe(mt){var Mt=mt.categoryInds.map(function(qe,Ye){return K[Ye][qe]}),lt=ne.map(function(qe){return Mt[qe]});return lt}ce.sort(function(mt,Mt){var lt=xe(mt),qe=xe(Mt);return V.sortpaths==="backward"&&(lt.reverse(),qe.reverse()),lt.push(mt.valueInds[0]),qe.push(Mt.valueInds[0]),V.bundlecolors&&(lt.unshift(mt.rawColor),qe.unshift(Mt.rawColor)),g(lt,qe)});for(var ye=new Array(ce.length),fe=j[0].model.count,ae=j[0].categories.map(function(mt){return mt.height}).reduce(function(mt,Mt){return mt+Mt}),ee=0;ee0?Q=ae*(ie.count/fe):Q=0;for(var ue=new Array(Y.length),ge=0;ge1?ne=(V.width-2*q-Y)/(K-1):ne=0,se=q,le=se+ne*te;var ce=[],pe=V.model.maxCats,xe=j.categories.length,ye=8,fe=j.count,ae=V.height-ye*(pe-1),ee,ie,Q,ue,ge,Me=(pe-xe)*ye/2,Te=j.categories.map(function(je){return{displayInd:je.displayInd,categoryInd:je.categoryInd}});for(Te.sort(function(je,Ve){return je.displayInd-Ve.displayInd}),ge=0;ge0?ee=ie.count/fe*ae:ee=0,Q={key:ie.valueInds[0],model:ie,width:Y,height:ee,y:ie.dragY!==null?ie.dragY:Me,bands:[],parcatsViewModel:V},Me=Me+ee+ye,ce.push(Q);return{key:j.dimensionInd,x:j.dragX!==null?j.dragX:le,y:0,width:Y,model:j,categories:ce,parcatsViewModel:V,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),a9=de({"src/traces/parcats/plot.js"(e,r){"use strict";var t=mK();r.exports=function(a,o,s,l){var n=a._fullLayout,u=n._paper,c=n._size;t(a,u,o,{width:c.w,height:c.h,margin:{t:c.t,r:c.r,b:c.b,l:c.l}},s,l)}}}),gK=de({"src/traces/parcats/base_plot.js"(e){"use strict";var r=$u().getModuleCalcData,t=a9(),i="parcats";e.name=i,e.plot=function(a,o,s,l){var n=r(a.calcdata,i);if(n.length){var u=n[0];t(a,u,s,l)}},e.clean=function(a,o,s,l){var n=l._has&&l._has("parcats"),u=o._has&&o._has("parcats");n&&!u&&l._paperdiv.selectAll(".parcats").remove()}}}),yK=de({"src/traces/parcats/index.js"(e,r){"use strict";r.exports={attributes:i9(),supplyDefaults:pK(),calc:vK(),plot:a9(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:gK(),categories:["noOpacity"],meta:{}}}}),_K=de({"lib/parcats.js"(e,r){"use strict";r.exports=yK()}}),xK=de({"src/plots/map/styles/arcgis-sat-hybrid.js"(e,r){"use strict";r.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +`),a=M_().maxDimensionCount,o=Qt(),s=1e-6,l=2048,n=new Uint8Array(4),u=new Uint8Array(4),c={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(k){k.read({x:0,y:0,width:1,height:1,data:n})}function h(k,A,b,E,T){var F=k._gl;F.enable(F.SCISSOR_TEST),F.scissor(A,b,E,T),k.clear({color:[0,0,0,0],depth:1})}function d(k,A,b,E,T,F){var D=F.key;function R(P){var z=Math.min(E,T-P*E);P===0&&(window.cancelAnimationFrame(b.currentRafs[D]),delete b.currentRafs[D],h(k,F.scissorX,F.scissorY,F.scissorWidth,F.viewBoxSize[1])),!b.clearOnly&&(F.count=2*z,F.offset=2*P*E,A(F),P*E+z>>8*A)%256/255}function y(k,A,b){for(var E=new Array(k*(a+4)),T=0,F=0;Fce&&(ce=j[te].dim1.canvasX,se=te);K===0&&h(T,0,0,z.canvasWidth,z.canvasHeight);var pe=N(b);for(te=0;tete._length&&(ae=ae.slice(0,te._length));var ee=te.tickvals,ie;function Q(je,Ve){return{val:je,text:ie[Ve]}}function ue(je,Ve){return je.val-Ve.val}if(a(ee)&&ee.length){i.isTypedArray(ee)&&(ee=Array.from(ee)),ie=te.ticktext,!a(ie)||!ie.length?ie=ee.map(o(te.tickformat)):ie.length>ee.length?ie=ie.slice(0,ee.length):ee.length>ie.length&&(ee=ee.slice(0,ie.length));for(var ge=1;ge=Ve||xt>=Ke)return;var Pt=Te.lineLayer.readPixel(vt,Ke-1-xt),mt=Pt[3]!==0,Mt=mt?Pt[2]+256*(Pt[1]+256*Pt[0]):null,lt={x:vt,y:xt,clientX:je.clientX,clientY:je.clientY,dataIndex:Te.model.key,curveNumber:Mt};Mt!==se&&(mt?H.hover(lt):H.unhover&&H.unhover(lt),se=Mt)}}),ne.style("opacity",function(Te){return Te.pick?0:1}),V.style("background","rgba(255, 255, 255, 0)");var ce=V.selectAll("."+_.cn.parcoords).data(te,p);ce.exit().remove(),ce.enter().append("g").classed(_.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),ce.attr("transform",function(Te){return u(Te.model.translateX,Te.model.translateY)});var pe=ce.selectAll("."+_.cn.parcoordsControlView).data(g,p);pe.enter().append("g").classed(_.cn.parcoordsControlView,!0),pe.attr("transform",function(Te){return u(Te.model.pad.l,Te.model.pad.t)});var xe=pe.selectAll("."+_.cn.yAxis).data(function(Te){return Te.dimensions},p);xe.enter().append("g").classed(_.cn.yAxis,!0),pe.each(function(Te){B(xe,Te,q)}),ne.each(function(Te){if(Te.viewModel){!Te.lineLayer||H?Te.lineLayer=x(this,Te):Te.lineLayer.update(Te),(Te.key||Te.key===0)&&(Te.viewModel[Te.key]=Te.lineLayer);var je=!Te.context||H;Te.lineLayer.render(Te.viewModel.panels,je)}}),xe.attr("transform",function(Te){return u(Te.xScale(Te.xIndex),0)}),xe.call(t.behavior.drag().origin(function(Te){return Te}).on("drag",function(Te){var je=Te.parent;K.linePickActive(!1),Te.x=Math.max(-_.overdrag,Math.min(Te.model.width+_.overdrag,t.event.x)),Te.canvasX=Te.x*Te.model.canvasPixelRatio,xe.sort(function(Ve,Ke){return Ve.x-Ke.x}).each(function(Ve,Ke){Ve.xIndex=Ke,Ve.x=Te===Ve?Ve.x:Ve.xScale(Ve.xIndex),Ve.canvasX=Ve.x*Ve.model.canvasPixelRatio}),B(xe,je,q),xe.filter(function(Ve){return Math.abs(Te.xIndex-Ve.xIndex)!==0}).attr("transform",function(Ve){return u(Ve.xScale(Ve.xIndex),0)}),t.select(this).attr("transform",u(Te.x,0)),xe.each(function(Ve,Ke,Je){Je===Te.parent.key&&(je.dimensions[Ke]=Ve)}),je.contextLayer&&je.contextLayer.render(je.panels,!1,!D(je)),je.focusLayer.render&&je.focusLayer.render(je.panels)}).on("dragend",function(Te){var je=Te.parent;Te.x=Te.xScale(Te.xIndex),Te.canvasX=Te.x*Te.model.canvasPixelRatio,B(xe,je,q),t.select(this).attr("transform",function(Ve){return u(Ve.x,0)}),je.contextLayer&&je.contextLayer.render(je.panels,!1,!D(je)),je.focusLayer&&je.focusLayer.render(je.panels),je.pickLayer&&je.pickLayer.render(je.panels,!0),K.linePickActive(!0),H&&H.axesMoved&&H.axesMoved(je.key,je.dimensions.map(function(Ve){return Ve.crossfilterDimensionIndex}))})),xe.exit().remove();var ye=xe.selectAll("."+_.cn.axisOverlays).data(g,p);ye.enter().append("g").classed(_.cn.axisOverlays,!0),ye.selectAll("."+_.cn.axis).remove();var fe=ye.selectAll("."+_.cn.axis).data(g,p);fe.enter().append("g").classed(_.cn.axis,!0),fe.each(function(Te){var je=Te.model.height/Te.model.tickDistance,Ve=Te.domainScale,Ke=Ve.domain();t.select(this).call(t.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(je,Te.tickFormat).tickValues(Te.ordinal?Ke:null).tickFormat(function(Je){return y.isOrdinal(Te)?Je:G(Te.model.dimensions[Te.visibleIndex],Je)}).scale(Ve)),f.font(fe.selectAll("text"),Te.model.tickFont)}),fe.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),fe.selectAll("text").style("cursor","default");var ae=ye.selectAll("."+_.cn.axisHeading).data(g,p);ae.enter().append("g").classed(_.cn.axisHeading,!0);var ee=ae.selectAll("."+_.cn.axisTitle).data(g,p);ee.enter().append("text").classed(_.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",$?"none":"auto"),ee.text(function(Te){return Te.label}).each(function(Te){var je=t.select(this);f.font(je,Te.model.labelFont),c.convertToTspans(je,Z)}).attr("transform",function(Te){var je=L(Te.model.labelAngle,Te.model.labelSide),Ve=_.axisTitleOffset;return(je.dir>0?"":u(0,2*Ve+Te.model.height))+n(je.degrees)+u(-Ve*je.dx,-Ve*je.dy)}).attr("text-anchor",function(Te){var je=L(Te.model.labelAngle,Te.model.labelSide),Ve=Math.abs(je.dx),Ke=Math.abs(je.dy);return 2*Ve>Ke?je.dir*je.dx<0?"start":"end":"middle"});var ie=ye.selectAll("."+_.cn.axisExtent).data(g,p);ie.enter().append("g").classed(_.cn.axisExtent,!0);var Q=ie.selectAll("."+_.cn.axisExtentTop).data(g,p);Q.enter().append("g").classed(_.cn.axisExtentTop,!0),Q.attr("transform",u(0,-_.axisExtentOffset));var ue=Q.selectAll("."+_.cn.axisExtentTopText).data(g,p);ue.enter().append("text").classed(_.cn.axisExtentTopText,!0).call(z),ue.text(function(Te){return W(Te,!0)}).each(function(Te){f.font(t.select(this),Te.model.rangeFont)});var ge=ie.selectAll("."+_.cn.axisExtentBottom).data(g,p);ge.enter().append("g").classed(_.cn.axisExtentBottom,!0),ge.attr("transform",function(Te){return u(0,Te.model.height+_.axisExtentOffset)});var Me=ge.selectAll("."+_.cn.axisExtentBottomText).data(g,p);Me.enter().append("text").classed(_.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),Me.text(function(Te){return W(Te,!1)}).each(function(Te){f.font(t.select(this),Te.model.rangeFont)}),v.ensureAxisBrush(ye,Y,Z)}}}),r9=de({"src/traces/parcoords/plot.js"(n,r){"use strict";var t=uK(),i=P4(),a=t9().isVisible,o={};function s(u,c,f){var h=c.indexOf(f),d=u.indexOf(h);return d===-1&&(d+=c.length),d}function l(u,c){return function(h,d){return s(u,c,h)-s(u,c,d)}}var n=r.exports=function(c,f){var h=c._fullLayout,d=i(c,[],o);if(d){var p={},g={},m={},y=h._size;f.forEach(function(M,C){var w=M[0].trace,k=m[C]=w.index;p[C]=c.data[k].dimensions,g[C]=c.data[k].dimensions.slice()});var _=function(M,C,w){var k=g[M][C],A=w.map(function(R){return R.slice()}),b="dimensions["+C+"].constraintrange",E=h._tracePreGUI[c._fullData[m[M]].uid];if(E[b]===void 0){var T=k.constraintrange;E[b]=T||null}var F=c._fullData[m[M]].dimensions[C];A.length?(A.length===1&&(A=A[0]),k.constraintrange=A,F.constraintrange=A.slice(),A=[A]):(delete k.constraintrange,delete F.constraintrange,A=null);var D={};D[b]=A,c.emit("plotly_restyle",[D,[m[M]]])},v=function(M){c.emit("plotly_hover",M)},x=function(M){c.emit("plotly_unhover",M)},S=function(M,C){var w=l(C,g[M].filter(a));p[M].sort(w),g[M].filter(function(k){return!a(k)}).sort(function(k){return g[M].indexOf(k)}).forEach(function(k){p[M].splice(p[M].indexOf(k),1),p[M].splice(g[M].indexOf(k),0,k)}),c.emit("plotly_restyle",[{dimensions:[p[M]]},[m[M]]])};t(c,f,{width:y.w,height:y.h,margin:{t:y.t,r:y.r,b:y.b,l:y.l}},{filterChanged:_,hover:v,unhover:x,axesMoved:S})}};n.reglPrecompiled=o}}),cK=de({"src/traces/parcoords/base_plot.js"(e){"use strict";var r=Yr(),t=$u().getModuleCalcData,i=r9(),a=Nh();e.name="parcoords",e.plot=function(o){var s=t(o.calcdata,"parcoords")[0];s.length&&i(o,s)},e.clean=function(o,s,l,n){var u=n._has&&n._has("parcoords"),c=s._has&&s._has("parcoords");u&&!c&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},e.toSVG=function(o){var s=o._fullLayout._glimages,l=r.select(o).selectAll(".svg-container"),n=l.filter(function(c,f){return f===l.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function u(){var c=this,f=c.toDataURL("image/png"),h=s.append("svg:image");h.attr({xmlns:a.svg,"xlink:href":f,preserveAspectRatio:"none",x:0,y:0,width:c.style.width,height:c.style.height})}n.each(u),window.setTimeout(function(){r.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),fK=de({"src/traces/parcoords/base_index.js"(e,r){"use strict";r.exports={attributes:Q7(),supplyDefaults:oK(),calc:sK(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:cK(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),hK=de({"src/traces/parcoords/index.js"(e,r){"use strict";var t=fK();t.plot=r9(),r.exports=t}}),dK=de({"lib/parcoords.js"(e,r){"use strict";r.exports=hK()}}),i9=de({"src/traces/parcats/attributes.js"(e,r){"use strict";var t=fn().extendFlat,i=ri(),a=us(),o=cs(),{hovertemplateAttrs:s,templatefallbackAttrs:l}=Vo(),n=Rs().attributes,u=t({editType:"calc"},o("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:l({editType:"plot"})});r.exports={domain:n({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:t({},i.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:l({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:a({editType:"calc"}),tickfont:a({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:u,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),pK=de({"src/traces/parcats/defaults.js"(e,r){"use strict";var t=Qt(),i=Wu().hasColorscale,a=hu(),o=Rs().defaults,s=fc(),l=i9(),n=I4(),u=Do().isTypedArraySpec;function c(h,d,p,g,m){m("line.shape"),m("line.hovertemplate"),m("line.hovertemplatefallback");var y=m("line.color",g.colorway[0]);if(i(h,"line")&&t.isArrayOrTypedArray(y)){if(y.length)return m("line.colorscale"),a(h,d,g,m,{prefix:"line.",cLetter:"c"}),y.length;d.line.color=p}return 1/0}function f(h,d){function p(S,M){return t.coerce(h,d,l.dimensions,S,M)}var g=p("values"),m=p("visible");if(g&&g.length||(m=d.visible=!1),m){p("label"),p("displayindex",d._index);var y=h.categoryarray,_=t.isArrayOrTypedArray(y)&&y.length>0||u(y),v;_&&(v="array");var x=p("categoryorder",v);x==="array"?(p("categoryarray"),p("ticktext")):(delete h.categoryarray,delete h.ticktext),!_&&x==="array"&&(d.categoryorder="trace")}}r.exports=function(d,p,g,m){function y(S,M){return t.coerce(d,p,l,S,M)}var _=s(d,p,{name:"dimensions",handleItemDefaults:f}),v=c(d,p,g,m,y);o(p,m,y),(!Array.isArray(_)||!_.length)&&(p.visible=!1),n(p,_,"values",v),y("hoveron"),y("hovertemplate"),y("hovertemplatefallback"),y("arrangement"),y("bundlecolors"),y("sortpaths"),y("counts");var x=m.font;t.coerceFont(y,"labelfont",x,{overrideDflt:{size:Math.round(x.size)}}),t.coerceFont(y,"tickfont",x,{autoShadowDflt:!0,overrideDflt:{size:Math.round(x.size/1.2)}})}}}),vK=de({"src/traces/parcats/calc.js"(e,r){"use strict";var t=ap().wrap,i=Wu().hasColorscale,a=hc(),o=mE(),s=hn(),l=Qt(),n=da();r.exports=function(x,S){var M=l.filterVisible(S.dimensions);if(M.length===0)return[];var C=M.map(function(N){var H;if(N.categoryorder==="trace")H=null;else if(N.categoryorder==="array")H=N.categoryarray;else{H=o(N.values);for(var $=!0,U=0;U=v.length||x[v[S]]!==void 0)return!1;x[v[S]]=!0}return!0}}}),mK=de({"src/traces/parcats/parcats.js"(e,r){"use strict";var t=Yr(),i=(Uv(),ti(S0)).interpolateNumber,a=Iw(),o=ta(),s=$s(),l=Qt(),n=l.strTranslate,u=hn(),c=Zo();function f(V,j,q,Y){var K=j._context.staticPlot,te=V.map(J.bind(0,j,q)),ne=Y.selectAll("g.parcatslayer").data([null]);ne.enter().append("g").attr("class","parcatslayer").style("pointer-events",K?"none":"all");var se=ne.selectAll("g.trace.parcats").data(te,h),le=se.enter().append("g").attr("class","trace parcats");se.attr("transform",function(ue){return n(ue.x,ue.y)}),le.append("g").attr("class","paths");var ce=se.select("g.paths"),pe=ce.selectAll("path.path").data(function(ue){return ue.paths},h);pe.attr("fill",function(ue){return ue.model.color});var xe=pe.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(ue){return ue.model.color}).attr("fill-opacity",0);S(xe),pe.attr("d",function(ue){return ue.svgD}),xe.empty()||pe.sort(p),pe.exit().remove(),pe.on("mouseover",m).on("mouseout",y).on("click",x),le.append("g").attr("class","dimensions");var ye=se.select("g.dimensions"),fe=ye.selectAll("g.dimension").data(function(ue){return ue.dimensions},h);fe.enter().append("g").attr("class","dimension"),fe.attr("transform",function(ue){return n(ue.x,0)}),fe.exit().remove();var ae=fe.selectAll("g.category").data(function(ue){return ue.categories},h),ee=ae.enter().append("g").attr("class","category");ae.attr("transform",function(ue){return n(0,ue.y)}),ee.append("rect").attr("class","catrect").attr("pointer-events","none"),ae.select("rect.catrect").attr("fill","none").attr("width",function(ue){return ue.width}).attr("height",function(ue){return ue.height}),w(ee);var ie=ae.selectAll("rect.bandrect").data(function(ue){return ue.bands},h);ie.each(function(){l.raiseToTop(this)}),ie.attr("fill",function(ue){return ue.color});var Q=ie.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(ue){return ue.color}).attr("fill-opacity",0);ie.attr("fill",function(ue){return ue.color}).attr("width",function(ue){return ue.width}).attr("height",function(ue){return ue.height}).attr("y",function(ue){return ue.y}).attr("cursor",function(ue){return ue.parcatsViewModel.arrangement==="fixed"?"default":ue.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),A(Q),ie.exit().remove(),ee.append("text").attr("class","catlabel").attr("pointer-events","none"),ae.select("text.catlabel").attr("text-anchor",function(ue){return d(ue)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(ue){return d(ue)?ue.width+5:-5}).attr("y",function(ue){return ue.height/2}).text(function(ue){return ue.model.categoryLabel}).each(function(ue){u.font(t.select(this),ue.parcatsViewModel.categorylabelfont),c.convertToTspans(t.select(this),j)}),ee.append("text").attr("class","dimlabel"),ae.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(ue){return ue.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(ue){return ue.width/2}).attr("y",-5).text(function(ue,ge){return ge===0?ue.parcatsViewModel.model.dimensions[ue.model.dimensionInd].dimensionLabel:null}).each(function(ue){u.font(t.select(this),ue.parcatsViewModel.labelfont)}),ae.selectAll("rect.bandrect").on("mouseover",I).on("mouseout",L),ae.exit().remove(),fe.call(t.behavior.drag().origin(function(ue){return{x:ue.x,y:0}}).on("dragstart",B).on("drag",O).on("dragend",G)),se.each(function(ue){ue.traceSelection=t.select(this),ue.pathSelection=t.select(this).selectAll("g.paths").selectAll("path.path"),ue.dimensionSelection=t.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),se.exit().remove()}r.exports=function(V,j,q,Y){f(q,V,Y,j)};function h(V){return V.key}function d(V){var j=V.parcatsViewModel.dimensions.length,q=V.parcatsViewModel.dimensions[j-1].model.dimensionInd;return V.model.dimensionInd===q}function p(V,j){return V.model.rawColor>j.model.rawColor?1:V.model.rawColorK)return 1;if(Y!==K){var te=isNaN(Y),ne=isNaN(K);if(te!==ne)return te?1:-1}}return V.length-j.length}function m(V){if(!V.parcatsViewModel.dragDimension&&V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){l.raiseToTop(this),M(t.select(this));var j=_(V),q=v(V);if(V.parcatsViewModel.graphDiv.emit("plotly_hover",{points:j,event:t.event,constraints:q}),V.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Y=t.mouse(this)[0],K=V.parcatsViewModel.graphDiv,te=V.parcatsViewModel.trace,ne=K._fullLayout,se=ne._paperdiv.node().getBoundingClientRect(),le=V.parcatsViewModel.graphDiv.getBoundingClientRect(),ce,pe,xe;for(xe=0;xe"),je=t.mouse(K)[0];s.loneHover({trace:te,x:ae-se.left+le.left,y:ee-se.top+le.top,text:Te,color:V.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:ie,idealAlign:jeo.mostReadable(j.model.color)).attr("stroke-width",.3)}function C(V){V.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}function w(V){V.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function k(V){V.attr("stroke","black").attr("stroke-width",1.5)}function A(V){V.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function b(V){var j=V.parcatsViewModel.pathSelection,q=V.categoryViewModel.model.dimensionInd,Y=V.categoryViewModel.model.categoryInd;return j.filter(function(K){return K.model.categoryInds[q]===Y&&K.model.color===V.color})}function E(V){var j=t.select(V.parentNode).selectAll("rect.bandrect");j.each(function(q){var Y=b(q);M(Y),Y.each(function(){l.raiseToTop(this)})}),C(t.select(V.parentNode))}function T(V){var j=t.select(V).datum(),q=b(j);M(q),q.each(function(){l.raiseToTop(this)}),t.select(V.parentNode).selectAll("rect.bandrect").filter(function(Y){return Y.color===j.color}).each(function(){l.raiseToTop(this),k(t.select(this))})}function F(V,j,q){var Y=t.select(V).datum(),K=Y.categoryViewModel.model,te=Y.parcatsViewModel.graphDiv,ne=t.select(V.parentNode).selectAll("rect.bandrect"),se=[];ne.each(function(ce){var pe=b(ce);pe.each(function(xe){Array.prototype.push.apply(se,_(xe))})});var le={};le[K.dimensionInd]=K.categoryValue,te.emit(j,{points:se,event:q,constraints:le})}function D(V,j,q){var Y=t.select(V).datum(),K=Y.categoryViewModel.model,te=Y.parcatsViewModel.graphDiv,ne=b(Y),se=[];ne.each(function(ce){Array.prototype.push.apply(se,_(ce))});var le={};le[K.dimensionInd]=K.categoryValue,Y.rawColor!==void 0&&(le.color=Y.rawColor),te.emit(j,{points:se,event:q,constraints:le})}function R(V,j,q){V._fullLayout._calcInverseTransform(V);var Y=V._fullLayout._invScaleX,K=V._fullLayout._invScaleY,te=t.select(q.parentNode).select("rect.catrect"),ne=te.node().getBoundingClientRect(),se=te.datum(),le=se.parcatsViewModel,ce=le.model.dimensions[se.model.dimensionInd],pe=le.trace,xe=ne.top+ne.height/2,ye,fe;le.dimensions.length>1&&ce.displayInd===le.dimensions.length-1?(ye=ne.left,fe="left"):(ye=ne.left+ne.width,fe="right");var ae=se.model.count,ee=se.model.categoryLabel,ie=ae/se.parcatsViewModel.model.count,Q={countLabel:ae,categoryLabel:ee,probabilityLabel:ie.toFixed(3)},ue=[];se.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&ue.push(["Count:",Q.countLabel].join(" ")),se.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&ue.push(["P("+Q.categoryLabel+"):",Q.probabilityLabel].join(" "));var ge=ue.join("
");return{trace:pe,x:Y*(ye-j.left),y:K*(xe-j.top),text:ge,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:fe,hovertemplate:pe.hovertemplate,hovertemplateLabels:Q,eventData:[{data:pe._input,fullData:pe,count:ae,category:ee,probability:ie}]}}function P(V,j,q){var Y=[];return t.select(q.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var K=this;Y.push(R(V,j,K))}),Y}function z(V,j,q){V._fullLayout._calcInverseTransform(V);var Y=V._fullLayout._invScaleX,K=V._fullLayout._invScaleY,te=q.getBoundingClientRect(),ne=t.select(q).datum(),se=ne.categoryViewModel,le=se.parcatsViewModel,ce=le.model.dimensions[se.model.dimensionInd],pe=le.trace,xe=te.y+te.height/2,ye,fe;le.dimensions.length>1&&ce.displayInd===le.dimensions.length-1?(ye=te.left,fe="left"):(ye=te.left+te.width,fe="right");var ae=se.model.categoryLabel,ee=ne.parcatsViewModel.model.count,ie=0;ne.categoryViewModel.bands.forEach(function(vt){vt.color===ne.color&&(ie+=vt.count)});var Q=se.model.count,ue=0;le.pathSelection.each(function(vt){vt.model.color===ne.color&&(ue+=vt.model.count)});var ge=ie/ee,Me=ie/ue,Te=ie/Q,je={countLabel:ie,categoryLabel:ae,probabilityLabel:ge.toFixed(3)},Ve=[];se.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ve.push(["Count:",je.countLabel].join(" ")),se.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ve.push("P(color \u2229 "+ae+"): "+je.probabilityLabel),Ve.push("P("+ae+" | color): "+Me.toFixed(3)),Ve.push("P(color | "+ae+"): "+Te.toFixed(3)));var Ke=Ve.join("
"),Je=o.mostReadable(ne.color);return{trace:pe,x:Y*(ye-j.left),y:K*(xe-j.top),text:Ke,color:ne.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Je,fontSize:10,idealAlign:fe,hovertemplate:pe.hovertemplate,hovertemplateLabels:je,eventData:[{data:pe._input,fullData:pe,category:ae,count:ee,probability:ge,categorycount:Q,colorcount:ue,bandcolorcount:ie}]}}function I(V){if(!V.parcatsViewModel.dragDimension&&V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var j=t.mouse(this)[1];if(j<-1)return;var q=V.parcatsViewModel.graphDiv,Y=q._fullLayout,K=Y._paperdiv.node().getBoundingClientRect(),te=V.parcatsViewModel.hoveron,ne=this;if(te==="color"?(T(ne),D(ne,"plotly_hover",t.event)):(E(ne),F(ne,"plotly_hover",t.event)),V.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var se;te==="category"?se=R(q,K,ne):te==="color"?se=z(q,K,ne):te==="dimension"&&(se=P(q,K,ne)),se&&s.loneHover(se,{container:Y._hoverlayer.node(),outerContainer:Y._paper.node(),gd:q})}}}function L(V){var j=V.parcatsViewModel;if(!j.dragDimension&&(S(j.pathSelection),w(j.dimensionSelection.selectAll("g.category")),A(j.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),s.loneUnhover(j.graphDiv._fullLayout._hoverlayer.node()),j.pathSelection.sort(p),j.hoverinfoItems.indexOf("skip")===-1)){var q=V.parcatsViewModel.hoveron,Y=this;q==="color"?D(Y,"plotly_unhover",t.event):F(Y,"plotly_unhover",t.event)}}function B(V){V.parcatsViewModel.arrangement!=="fixed"&&(V.dragDimensionDisplayInd=V.model.displayInd,V.initialDragDimensionDisplayInds=V.parcatsViewModel.model.dimensions.map(function(j){return j.displayInd}),V.dragHasMoved=!1,V.dragCategoryDisplayInd=null,t.select(this).selectAll("g.category").select("rect.catrect").each(function(j){var q=t.mouse(this)[0],Y=t.mouse(this)[1];-2<=q&&q<=j.width+2&&-2<=Y&&Y<=j.height+2&&(V.dragCategoryDisplayInd=j.model.displayInd,V.initialDragCategoryDisplayInds=V.model.categories.map(function(K){return K.displayInd}),j.model.dragY=j.y,l.raiseToTop(this.parentNode),t.select(this.parentNode).selectAll("rect.bandrect").each(function(K){K.ype.y+pe.height/2&&(te.model.displayInd=pe.model.displayInd,pe.model.displayInd=se),V.dragCategoryDisplayInd=te.model.displayInd}if(V.dragCategoryDisplayInd===null||V.parcatsViewModel.arrangement==="freeform"){K.model.dragX=t.event.x;var xe=V.parcatsViewModel.dimensions[q],ye=V.parcatsViewModel.dimensions[Y];xe!==void 0&&K.model.dragXye.x&&(K.model.displayInd=ye.model.displayInd,ye.model.displayInd=V.dragDimensionDisplayInd),V.dragDimensionDisplayInd=K.model.displayInd}$(V.parcatsViewModel),H(V.parcatsViewModel),Z(V.parcatsViewModel),X(V.parcatsViewModel)}}function G(V){if(V.parcatsViewModel.arrangement!=="fixed"&&V.dragDimensionDisplayInd!==null){t.select(this).selectAll("text").attr("font-weight","normal");var j={},q=W(V.parcatsViewModel),Y=V.parcatsViewModel.model.dimensions.map(function(ye){return ye.displayInd}),K=V.initialDragDimensionDisplayInds.some(function(ye,fe){return ye!==Y[fe]});K&&Y.forEach(function(ye,fe){var ae=V.parcatsViewModel.model.dimensions[fe].containerInd;j["dimensions["+ae+"].displayindex"]=ye});var te=!1;if(V.dragCategoryDisplayInd!==null){var ne=V.model.categories.map(function(ye){return ye.displayInd});if(te=V.initialDragCategoryDisplayInds.some(function(ye,fe){return ye!==ne[fe]}),te){var se=V.model.categories.slice().sort(function(ye,fe){return ye.displayInd-fe.displayInd}),le=se.map(function(ye){return ye.categoryValue}),ce=se.map(function(ye){return ye.categoryLabel});j["dimensions["+V.model.containerInd+"].categoryarray"]=[le],j["dimensions["+V.model.containerInd+"].ticktext"]=[ce],j["dimensions["+V.model.containerInd+"].categoryorder"]="array"}}if(V.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!V.dragHasMoved&&V.potentialClickBand&&(V.parcatsViewModel.hoveron==="color"?D(V.potentialClickBand,"plotly_click",t.event.sourceEvent):F(V.potentialClickBand,"plotly_click",t.event.sourceEvent)),V.model.dragX=null,V.dragCategoryDisplayInd!==null){var pe=V.parcatsViewModel.dimensions[V.dragDimensionDisplayInd].categories[V.dragCategoryDisplayInd];pe.model.dragY=null,V.dragCategoryDisplayInd=null}V.dragDimensionDisplayInd=null,V.parcatsViewModel.dragDimension=null,V.dragHasMoved=null,V.potentialClickBand=null,$(V.parcatsViewModel),H(V.parcatsViewModel);var xe=t.transition().duration(300).ease("cubic-in-out");xe.each(function(){Z(V.parcatsViewModel,!0),X(V.parcatsViewModel,!0)}).each("end",function(){(K||te)&&a.restyle(V.parcatsViewModel.graphDiv,j,[q])})}}function W(V){for(var j,q=V.graphDiv._fullData,Y=0;Y=0;le--)ce+="C"+ne[le]+","+(j[le+1]+Y)+" "+te[le]+","+(j[le]+Y)+" "+(V[le]+q[le])+","+(j[le]+Y),ce+="l-"+q[le]+",0 ";return ce+="Z",ce}function H(V){var j=V.dimensions,q=V.model,Y=j.map(function(mt){return mt.categories.map(function(Mt){return Mt.y})}),K=V.model.dimensions.map(function(mt){return mt.categories.map(function(Mt){return Mt.displayInd})}),te=V.model.dimensions.map(function(mt){return mt.displayInd}),ne=V.dimensions.map(function(mt){return mt.model.dimensionInd}),se=j.map(function(mt){return mt.x}),le=j.map(function(mt){return mt.width}),ce=[];for(var pe in q.paths)q.paths.hasOwnProperty(pe)&&ce.push(q.paths[pe]);function xe(mt){var Mt=mt.categoryInds.map(function(qe,Ye){return K[Ye][qe]}),lt=ne.map(function(qe){return Mt[qe]});return lt}ce.sort(function(mt,Mt){var lt=xe(mt),qe=xe(Mt);return V.sortpaths==="backward"&&(lt.reverse(),qe.reverse()),lt.push(mt.valueInds[0]),qe.push(Mt.valueInds[0]),V.bundlecolors&&(lt.unshift(mt.rawColor),qe.unshift(Mt.rawColor)),g(lt,qe)});for(var ye=new Array(ce.length),fe=j[0].model.count,ae=j[0].categories.map(function(mt){return mt.height}).reduce(function(mt,Mt){return mt+Mt}),ee=0;ee0?Q=ae*(ie.count/fe):Q=0;for(var ue=new Array(Y.length),ge=0;ge1?ne=(V.width-2*q-Y)/(K-1):ne=0,se=q,le=se+ne*te;var ce=[],pe=V.model.maxCats,xe=j.categories.length,ye=8,fe=j.count,ae=V.height-ye*(pe-1),ee,ie,Q,ue,ge,Me=(pe-xe)*ye/2,Te=j.categories.map(function(je){return{displayInd:je.displayInd,categoryInd:je.categoryInd}});for(Te.sort(function(je,Ve){return je.displayInd-Ve.displayInd}),ge=0;ge0?ee=ie.count/fe*ae:ee=0,Q={key:ie.valueInds[0],model:ie,width:Y,height:ee,y:ie.dragY!==null?ie.dragY:Me,bands:[],parcatsViewModel:V},Me=Me+ee+ye,ce.push(Q);return{key:j.dimensionInd,x:j.dragX!==null?j.dragX:le,y:0,width:Y,model:j,categories:ce,parcatsViewModel:V,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),a9=de({"src/traces/parcats/plot.js"(e,r){"use strict";var t=mK();r.exports=function(a,o,s,l){var n=a._fullLayout,u=n._paper,c=n._size;t(a,u,o,{width:c.w,height:c.h,margin:{t:c.t,r:c.r,b:c.b,l:c.l}},s,l)}}}),gK=de({"src/traces/parcats/base_plot.js"(e){"use strict";var r=$u().getModuleCalcData,t=a9(),i="parcats";e.name=i,e.plot=function(a,o,s,l){var n=r(a.calcdata,i);if(n.length){var u=n[0];t(a,u,s,l)}},e.clean=function(a,o,s,l){var n=l._has&&l._has("parcats"),u=o._has&&o._has("parcats");n&&!u&&l._paperdiv.selectAll(".parcats").remove()}}}),yK=de({"src/traces/parcats/index.js"(e,r){"use strict";r.exports={attributes:i9(),supplyDefaults:pK(),calc:vK(),plot:a9(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:gK(),categories:["noOpacity"],meta:{}}}}),_K=de({"lib/parcats.js"(e,r){"use strict";r.exports=yK()}}),xK=de({"src/plots/map/styles/arcgis-sat-hybrid.js"(e,r){"use strict";r.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} @@ -2705,10 +2705,10 @@ void main() { {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),bK=de({"src/plots/map/styles/arcgis-sat.js"(e,r){"use strict";r.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),D0=de({"src/plots/map/constants.js"(e,r){"use strict";var t=(gv(),ti(c0)).default,i=xK(),a=bK(),o='\xA9 OpenStreetMap contributors',s="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",l="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",u="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",c="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",f="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",h={basic:n,streets:n,outdoors:n,light:s,dark:l,satellite:a,"satellite-streets":i,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:o,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":s,"carto-darkmatter":l,"carto-voyager":n,"carto-positron-nolabels":u,"carto-darkmatter-nolabels":c,"carto-voyager-nolabels":f},d=t(h);r.exports={styleValueDflt:"basic",stylesMap:h,styleValuesMap:d,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",d.join(", "),"or use a tile service."].join(` -`),mapOnErrorMsg:"Map error.",fitBoundsPadding:20}}}),S_=de({"src/plots/map/layout_attributes.js"(e,r){"use strict";var t=Qt(),i=ta().defaultLine,a=Is().attributes,o=us(),s=tl().textposition,l=Ps().overrideAll,n=Ro().templatedArray,u=D0(),c=o({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var f=r.exports=l({_arrayAttrRegexps:[t.counterRegex("map",".layers",!0)],domain:a({name:"map"}),style:{valType:"any",values:u.styleValuesMap,dflt:u.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},fitbounds:{valType:"enumerated",values:[!1,"locations"],dflt:"locations"},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:n("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:c,textposition:t.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root");f.uirevision={valType:"any",editType:"none"}}}),R4=de({"src/traces/scattermap/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,texttemplateAttrs:i,templatefallbackAttrs:a}=Vo(),o=Kd(),s=R1(),l=tl(),n=S_(),u=ri(),c=cs(),f=fn().extendFlat,h=Ps().overrideAll,d=S_(),p=s.line,g=s.marker;r.exports=h({lon:s.lon,lat:s.lat,cluster:{enabled:{valType:"boolean"},maxzoom:f({},d.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:f({},g.opacity,{dflt:1})},mode:f({},l.mode,{dflt:"markers"}),text:f({},l.text,{}),texttemplate:i({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:a({editType:"plot"}),hovertext:f({},l.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:l.connectgaps,marker:f({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:g.opacity,size:g.size,sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode},c("marker")),fill:s.fill,fillcolor:o(),textfont:n.layers.symbol.textfont,textposition:n.layers.symbol.textposition,below:{valType:"string"},selected:{marker:l.selected.marker},unselected:{marker:l.unselected.marker},hoverinfo:f({},u.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:t(),hovertemplatefallback:a()},"calc","nested")}}),n9=de({"src/traces/scattermap/constants.js"(e,r){"use strict";var t=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];r.exports={isSupportedFont:function(i){return t.indexOf(i)!==-1}}}}),wK=de({"src/traces/scattermap/defaults.js"(e,r){"use strict";var t=Qt(),i=bs(),a=Nh(),o=yd(),s=_d(),l=Jd(),n=R4(),u=n9().isSupportedFont;r.exports=function(h,d,p,g){function m(E,T){return t.coerce(h,d,n,E,T)}function y(E,T){return t.coerce2(h,d,n,E,T)}var _=c(h,d,m);if(!_){d.visible=!1;return}if(m("text"),m("texttemplate"),m("texttemplatefallback"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("mode"),m("below"),i.hasMarkers(d)){a(h,d,p,g,m,{noLine:!0,noAngle:!0}),m("marker.allowoverlap"),m("marker.angle");var v=d.marker;v.symbol!=="circle"&&(t.isArrayOrTypedArray(v.size)&&(v.size=v.size[0]),t.isArrayOrTypedArray(v.color)&&(v.color=v.color[0]))}i.hasLines(d)&&(o(h,d,p,g,m,{noDash:!0}),m("connectgaps"));var x=y("cluster.maxzoom"),S=y("cluster.step"),M=y("cluster.color",d.marker&&d.marker.color||p),C=y("cluster.size"),w=y("cluster.opacity"),k=x!==!1||S!==!1||M!==!1||C!==!1||w!==!1,A=m("cluster.enabled",k);if(A||i.hasText(d)){var b=g.font.family;s(h,d,g,m,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:u(b)?b:"Open Sans Regular",weight:g.font.weight,style:g.font.style,size:g.font.size,color:g.font.color}})}m("fill"),d.fill!=="none"&&l(h,d,p,m),t.coerceSelectionMarkerOpacity(d,m)};function c(f,h,d){var p=d("lon")||[],g=d("lat")||[],m=Math.min(p.length,g.length);return h._length=m,m}}}),o9=de({"src/traces/scattermap/format_labels.js"(e,r){"use strict";var t=nn();r.exports=function(a,o,s){var l={},n=s[o.subplot]._subplot,u=n.mockAxis,c=a.lonlat;return l.lonLabel=t.tickText(u,u.c2l(c[0]),!0).text,l.latLabel=t.tickText(u,u.c2l(c[1]),!0).text,l}}}),s9=de({"src/plots/map/convert_text_opts.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){var s=a.split(" "),l=s[0],n=s[1],u=t.isArrayOrTypedArray(o)?t.mean(o):o,c=.5+u/100,f=1.5+u/100,h=["",""],d=[0,0];switch(l){case"top":h[0]="top",d[1]=-f;break;case"bottom":h[0]="bottom",d[1]=f;break}switch(n){case"left":h[1]="right",d[0]=-c;break;case"right":h[1]="left",d[0]=c;break}var p;return h[0]&&h[1]?p=h.join("-"):h[0]?p=h[0]:h[1]?p=h[1]:p="center",{anchor:p,offset:d}}}}),TK=de({"src/traces/scattermap/convert.js"(e,r){"use strict";var t=da(),i=Qt(),a=cn().BADNUM,o=g_(),s=ks(),l=hn(),n=Sy(),u=bs(),c=n9().isSupportedFont,f=s9(),h=sf().appendArrayPointValue,d=Zo().NEWLINES,p=Zo().BR_TAG_ALL;r.exports=function(w,k){var A=k[0].trace,b=A.visible===!0&&A._length!==0,E=A.fill!=="none",T=u.hasLines(A),F=u.hasMarkers(A),D=u.hasText(A),R=F&&A.marker.symbol==="circle",P=F&&A.marker.symbol!=="circle",z=A.cluster&&A.cluster.enabled,I=g("fill"),L=g("line"),B=g("circle"),O=g("symbol"),G={fill:I,line:L,circle:B,symbol:O};if(!b)return G;var W;if((E||T)&&(W=o.calcTraceToLineCoords(k)),E&&(I.geojson=o.makePolygon(W),I.layout.visibility="visible",i.extendFlat(I.paint,{"fill-color":A.fillcolor})),T&&(L.geojson=o.makeLine(W),L.layout.visibility="visible",i.extendFlat(L.paint,{"line-width":A.line.width,"line-color":A.line.color,"line-opacity":A.opacity})),R){var X=m(k);B.geojson=X.geojson,B.layout.visibility="visible",z&&(B.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":S(A.cluster.color,A.cluster.step),"circle-radius":S(A.cluster.size,A.cluster.step),"circle-opacity":S(A.cluster.opacity,A.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":M(A),"text-size":12}}),i.extendFlat(B.paint,{"circle-color":X.mcc,"circle-radius":X.mrc,"circle-opacity":X.mo})}if(R&&z&&(B.filter=["!",["has","point_count"]]),(P||D)&&(O.geojson=y(k,w),i.extendFlat(O.layout,{visibility:"visible","icon-image":"{symbol}","text-field":"{text}"}),P&&(i.extendFlat(O.layout,{"icon-size":A.marker.size/10}),"angle"in A.marker&&A.marker.angle!=="auto"&&i.extendFlat(O.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),O.layout["icon-allow-overlap"]=A.marker.allowoverlap,i.extendFlat(O.paint,{"icon-opacity":A.opacity*A.marker.opacity,"icon-color":A.marker.color,"icon-halo-color":A.marker.color,"icon-halo-width":2,"icon-halo-blur":1.5})),D)){var Z=(A.marker||{}).size,J=f(A.textposition,Z);i.extendFlat(O.layout,{"text-size":A.textfont.size,"text-anchor":J.anchor,"text-offset":J.offset,"text-font":M(A)}),i.extendFlat(O.paint,{"text-color":A.textfont.color,"text-opacity":A.opacity})}return G};function g(C){return{type:C,geojson:o.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function m(C){var w=C[0].trace,k=w.marker,A=w.selectedpoints,b=i.isArrayOrTypedArray(k.color),E=i.isArrayOrTypedArray(k.size),T=i.isArrayOrTypedArray(k.opacity),F;function D(Z){return w.opacity*Z}function R(Z){return Z/2}var P;b&&(s.hasColorscale(w,"marker")?P=s.makeColorScaleFuncFromTrace(k):P=i.identity);var z;E&&(z=n(w));var I;T&&(I=function(Z){var J=t(Z)?+i.constrain(Z,0,1):0;return D(J)});var L=[];for(F=0;F850?F+=" Black":b>750?F+=" Extra Bold":b>650?F+=" Bold":b>550?F+=" Semi Bold":b>450?F+=" Medium":b>350?F+=" Regular":b>250?F+=" Light":b>150?F+=" Extra Light":F+=" Thin"):E.slice(0,2).join(" ")==="Open Sans"?(F="Open Sans",b>750?F+=" Extrabold":b>650?F+=" Bold":b>550?F+=" Semibold":b>350?F+=" Regular":F+=" Light"):E.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(F="Klokantech Noto Sans",E[3]==="CJK"&&(F+=" CJK"),F+=b>500?" Bold":" Regular")),T&&(F+=" Italic"),F==="Open Sans Regular Italic"?F="Open Sans Italic":F==="Open Sans Regular Bold"?F="Open Sans Bold":F==="Open Sans Regular Bold Italic"?F="Open Sans Bold Italic":F==="Klokantech Noto Sans Regular Italic"&&(F="Klokantech Noto Sans Italic"),c(F)||(F=k);var D=F.split(", ");return D}}}),AK=de({"src/traces/scattermap/plot.js"(e,r){"use strict";var t=Qt(),i=TK(),a=D0().traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(n,u,c,f){this.type="scattermap",this.subplot=n,this.uid=u,this.clusterEnabled=c,this.isHidden=f,this.sourceIds={fill:"source-"+u+"-fill",line:"source-"+u+"-line",circle:"source-"+u+"-circle",symbol:"source-"+u+"-symbol",cluster:"source-"+u+"-circle",clusterCount:"source-"+u+"-circle"},this.layerIds={fill:a+u+"-fill",line:a+u+"-line",circle:a+u+"-circle",symbol:a+u+"-symbol",cluster:a+u+"-cluster",clusterCount:a+u+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(n,u,c){var f={type:"geojson",data:u.geojson};c&&c.enabled&&t.extendFlat(f,{cluster:!0,clusterMaxZoom:c.maxzoom});var h=this.subplot.map.getSource(this.sourceIds[n]);h?h.setData(u.geojson):this.subplot.map.addSource(this.sourceIds[n],f)},l.setSourceData=function(n,u){this.subplot.map.getSource(this.sourceIds[n]).setData(u.geojson)},l.addLayer=function(n,u,c){var f={type:u.type,id:this.layerIds[n],source:this.sourceIds[n],layout:u.layout,paint:u.paint};u.filter&&(f.filter=u.filter);for(var h=this.layerIds[n],d,p=this.subplot.getMapLayers(),g=0;g=0;T--){var F=E[T];h.removeLayer(y.layerIds[F])}b||h.removeSource(y.sourceIds.circle)}function x(b){for(var E=o.nonCluster,T=0;T=0;T--){var F=E[T];h.removeLayer(y.layerIds[F]),b||h.removeSource(y.sourceIds[F])}}function M(b){m?v(b):S(b)}function C(b){g?_(b):x(b)}function w(){for(var b=g?o.cluster:o.nonCluster,E=0;E=0;f--){var h=c[f];u.removeLayer(this.layerIds[h]),u.removeSource(this.sourceIds[h])}},r.exports=function(u,c){var f=c[0].trace,h=f.cluster&&f.cluster.enabled,d=f.visible!==!0,p=new s(u,f.uid,h,d),g=i(u.gd,c),m=p.below=u.belowLookup["trace-"+f.uid],y,_,v;if(h)for(p.addSource("circle",g.circle,f.cluster),y=0;y=0?Math.floor((f+180)/360):Math.ceil((f-180)/360),C=M*360,w=f-C;function k(z){var I=z.lonlat;if(I[0]===s||x&&_.indexOf(z.i+1)===-1)return 1/0;var L=i.modHalf(I[0],360),B=I[1],O=y.project([L,B]),G=O.x-g.c2p([w,B]),W=O.y-m.c2p([L,h]),X=Math.max(3,z.mrc||0);return Math.max(Math.sqrt(G*G+W*W)-X,1-3/X)}if(t.getClosest(d,k,c),c.index!==!1){var A=d[c.index],b=A.lonlat,E=[i.modHalf(b[0],360)+C,b[1]],T=g.c2p(E),F=m.c2p(E),D=A.mrc||1;c.x0=T-D,c.x1=T+D,c.y0=F-D,c.y1=F+D;var R={};R[p.subplot]={_subplot:y};var P=p._module.formatLabels(A,p,R);return c.lonLabel=P.lonLabel,c.latLabel=P.latLabel,c.color=a(p,A),c.extraText=u(p,A,d[0].t.labels),c.hovertemplate=p.hovertemplate,[c]}}function u(c,f,h){if(c.hovertemplate)return;var d=f.hi||c.hoverinfo,p=d.split("+"),g=p.indexOf("all")!==-1,m=p.indexOf("lon")!==-1,y=p.indexOf("lat")!==-1,_=f.lonlat,v=[];function x(S){return S+"\xB0"}return g||m&&y?v.push("("+x(_[1])+", "+x(_[0])+")"):m?v.push(h.lon+x(_[0])):y&&v.push(h.lat+x(_[1])),(g||p.indexOf("text")!==-1)&&o(f,c,v),v.join("
")}r.exports={hoverPoints:n,getExtraText:u}}}),MK=de({"src/traces/scattermap/event_data.js"(e,r){"use strict";r.exports=function(i,a){return i.lon=a.lon,i.lat=a.lat,i}}}),SK=de({"src/traces/scattermap/select.js"(e,r){"use strict";var t=Qt(),i=bs(),{BADNUM:a}=cn(),o=360,s=.001,l=(c,f,h,d)=>[c.c2p([h,d]),f.c2p([h,d])];function n(c,f,h,d,p){let g=l(c,f,h+o,d),m=l(c,f,h-o,d),y=g[0]-p[0],_=g[1]-p[1],v=Math.abs(y-(p[0]-m[0])){if(Math.abs(m)p?null:[Math.floor(d)-1,Math.ceil(p)+1]}r.exports=function(f,h){var d;let{cd:p,xaxis:g,yaxis:m}=f,{trace:y}=p[0];if(!i.hasMarkers(y))return[];if(h===!1){for(let S of p)S.selected=0;return[]}let _=(d=g._subplot)==null?void 0:d.map,v=!!_?.getRenderWorldCopies()&&h.xmax>h.xmin,x=[];for(let S=0;S=1)return 1;let h=c;for(let g=0;g<8;g++){let m=((s*h+o)*h+a)*h-c;if(Math.abs(m)m?d=h:p=h,h=(d+p)*.5}return((u*h+n)*h+l)*h}}function B4(){return Tx??(Tx=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Tx}function l9(){if(Ax==null&&(Ax=!1,B4())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let i=t*4;e.fillStyle=`rgb(${i},${i+1},${i+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let r=e.getImageData(0,0,5,5).data;for(let t=0;t<100;t++)if(t%4!=3&&r[t]!==t){Ax=!0;break}}}return Ax||!1}function u9(){var e=new Ql(9);return Ql!=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}function kK(e){var r=e[0],t=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],n=e[7],u=e[8];return r*(u*o-s*n)+t*(-u*a+s*l)+i*(n*a-o*l)}function CK(e,r){var t=Math.sin(r),i=Math.cos(r);return e[0]=i,e[1]=t,e[2]=0,e[3]=-t,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function DK(e,r){var t=r[0],i=r[1],a=r[2],o=r[3],s=t+t,l=i+i,n=a+a,u=t*s,c=i*s,f=i*l,h=a*s,d=a*l,p=a*n,g=o*s,m=o*l,y=o*n;return e[0]=1-f-p,e[3]=c-y,e[6]=h+m,e[1]=c+y,e[4]=1-u-p,e[7]=d-g,e[2]=h-m,e[5]=d+g,e[8]=1-u-f,e}function Rp(){var e=new Ql(16);return Ql!=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}function O4(e){var r=new Ql(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function LK(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Hh(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 E_(e,r){var t=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],n=r[6],u=r[7],c=r[8],f=r[9],h=r[10],d=r[11],p=r[12],g=r[13],m=r[14],y=r[15],_=t*l-i*s,v=t*n-a*s,x=t*u-o*s,S=i*n-a*l,M=i*u-o*l,C=a*u-o*n,w=c*g-f*p,k=c*m-h*p,A=c*y-d*p,b=f*m-h*g,E=f*y-d*g,T=h*y-d*m,F=_*T-v*E+x*b+S*A-M*k+C*w;return F?(F=1/F,e[0]=(l*T-n*E+u*b)*F,e[1]=(a*E-i*T-o*b)*F,e[2]=(g*C-m*M+y*S)*F,e[3]=(h*M-f*C-d*S)*F,e[4]=(n*A-s*T-u*k)*F,e[5]=(t*T-a*A+o*k)*F,e[6]=(m*x-p*C-y*v)*F,e[7]=(c*C-h*x+d*v)*F,e[8]=(s*E-l*A+u*w)*F,e[9]=(i*A-t*E-o*w)*F,e[10]=(p*M-g*x+y*_)*F,e[11]=(f*x-c*M-d*_)*F,e[12]=(l*k-s*b-n*w)*F,e[13]=(t*b-i*k+a*w)*F,e[14]=(g*v-p*S-m*_)*F,e[15]=(c*S-f*v+h*_)*F,e):null}function $v(e,r,t){var i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],n=r[5],u=r[6],c=r[7],f=r[8],h=r[9],d=r[10],p=r[11],g=r[12],m=r[13],y=r[14],_=r[15],v=t[0],x=t[1],S=t[2],M=t[3];return e[0]=v*i+x*l+S*f+M*g,e[1]=v*a+x*n+S*h+M*m,e[2]=v*o+x*u+S*d+M*y,e[3]=v*s+x*c+S*p+M*_,v=t[4],x=t[5],S=t[6],M=t[7],e[4]=v*i+x*l+S*f+M*g,e[5]=v*a+x*n+S*h+M*m,e[6]=v*o+x*u+S*d+M*y,e[7]=v*s+x*c+S*p+M*_,v=t[8],x=t[9],S=t[10],M=t[11],e[8]=v*i+x*l+S*f+M*g,e[9]=v*a+x*n+S*h+M*m,e[10]=v*o+x*u+S*d+M*y,e[11]=v*s+x*c+S*p+M*_,v=t[12],x=t[13],S=t[14],M=t[15],e[12]=v*i+x*l+S*f+M*g,e[13]=v*a+x*n+S*h+M*m,e[14]=v*o+x*u+S*d+M*y,e[15]=v*s+x*c+S*p+M*_,e}function Ol(e,r,t){var i=t[0],a=t[1],o=t[2],s,l,n,u,c,f,h,d,p,g,m,y;return r===e?(e[12]=r[0]*i+r[4]*a+r[8]*o+r[12],e[13]=r[1]*i+r[5]*a+r[9]*o+r[13],e[14]=r[2]*i+r[6]*a+r[10]*o+r[14],e[15]=r[3]*i+r[7]*a+r[11]*o+r[15]):(s=r[0],l=r[1],n=r[2],u=r[3],c=r[4],f=r[5],h=r[6],d=r[7],p=r[8],g=r[9],m=r[10],y=r[11],e[0]=s,e[1]=l,e[2]=n,e[3]=u,e[4]=c,e[5]=f,e[6]=h,e[7]=d,e[8]=p,e[9]=g,e[10]=m,e[11]=y,e[12]=s*i+c*a+p*o+r[12],e[13]=l*i+f*a+g*o+r[13],e[14]=n*i+h*a+m*o+r[14],e[15]=u*i+d*a+y*o+r[15]),e}function Xu(e,r,t){var i=t[0],a=t[1],o=t[2];return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*a,e[5]=r[5]*a,e[6]=r[6]*a,e[7]=r[7]*a,e[8]=r[8]*o,e[9]=r[9]*o,e[10]=r[10]*o,e[11]=r[11]*o,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Wv(e,r,t){var i=Math.sin(t),a=Math.cos(t),o=r[4],s=r[5],l=r[6],n=r[7],u=r[8],c=r[9],f=r[10],h=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=o*a+u*i,e[5]=s*a+c*i,e[6]=l*a+f*i,e[7]=n*a+h*i,e[8]=u*a-o*i,e[9]=c*a-s*i,e[10]=f*a-l*i,e[11]=h*a-n*i,e}function c9(e,r,t){var i=Math.sin(t),a=Math.cos(t),o=r[0],s=r[1],l=r[2],n=r[3],u=r[8],c=r[9],f=r[10],h=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=o*a-u*i,e[1]=s*a-c*i,e[2]=l*a-f*i,e[3]=n*a-h*i,e[8]=o*i+u*a,e[9]=s*i+c*a,e[10]=l*i+f*a,e[11]=n*i+h*a,e}function zp(e,r,t){var i=Math.sin(t),a=Math.cos(t),o=r[0],s=r[1],l=r[2],n=r[3],u=r[4],c=r[5],f=r[6],h=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=o*a+u*i,e[1]=s*a+c*i,e[2]=l*a+f*i,e[3]=n*a+h*i,e[4]=u*a-o*i,e[5]=c*a-s*i,e[6]=f*a-l*i,e[7]=h*a-n*i,e}function FK(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function PK(e,r,t,i,a){var o=1/Math.tan(r/2);if(e[0]=o/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){var s=1/(i-a);e[10]=(a+i)*s,e[14]=2*a*i*s}else e[10]=-1,e[14]=-2*i;return e}function IK(e,r,t,i,a,o,s){var l=1/(r-t),n=1/(i-a),u=1/(o-s);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*l,e[13]=(a+i)*n,e[14]=(s+o)*u,e[15]=1,e}function RK(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}function zK(e,r){var t=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],n=e[6],u=e[7],c=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15],_=r[0],v=r[1],x=r[2],S=r[3],M=r[4],C=r[5],w=r[6],k=r[7],A=r[8],b=r[9],E=r[10],T=r[11],F=r[12],D=r[13],R=r[14],P=r[15];return Math.abs(t-_)<=1e-6*Math.max(1,Math.abs(t),Math.abs(_))&&Math.abs(i-v)<=1e-6*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(a-x)<=1e-6*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-S)<=1e-6*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-C)<=1e-6*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(n-w)<=1e-6*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(u-k)<=1e-6*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(c-A)<=1e-6*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(f-b)<=1e-6*Math.max(1,Math.abs(f),Math.abs(b))&&Math.abs(h-E)<=1e-6*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(d-T)<=1e-6*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-F)<=1e-6*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(g-D)<=1e-6*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(m-R)<=1e-6*Math.max(1,Math.abs(m),Math.abs(R))&&Math.abs(y-P)<=1e-6*Math.max(1,Math.abs(y),Math.abs(P))}function f9(){var e=new Ql(3);return Ql!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function N4(e){var r=new Ql(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function ap(e){var r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function h9(e,r,t){var i=new Ql(3);return i[0]=e,i[1]=r,i[2]=t,i}function lh(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function d9(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function Ws(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function k_(e,r,t,i){return e[0]=r[0]+t[0]*i,e[1]=r[1]+t[1]*i,e[2]=r[2]+t[2]*i,e}function BK(e,r){var t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return Math.sqrt(t*t+i*i+a*a)}function OK(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function qc(e,r){var t=r[0],i=r[1],a=r[2],o=t*t+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r[0]*o,e[1]=r[1]*o,e[2]=r[2]*o,e}function Kl(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function uf(e,r,t){var i=r[0],a=r[1],o=r[2],s=t[0],l=t[1],n=t[2];return e[0]=a*n-o*l,e[1]=o*s-i*n,e[2]=i*l-a*s,e}function NK(e,r,t){var i=r[0],a=r[1],o=r[2],s=t[3]*i+t[7]*a+t[11]*o+t[15];return s||(s=1),e[0]=(t[0]*i+t[4]*a+t[8]*o+t[12])/s,e[1]=(t[1]*i+t[5]*a+t[9]*o+t[13])/s,e[2]=(t[2]*i+t[6]*a+t[10]*o+t[14])/s,e}function jK(e,r,t){var i=r[0],a=r[1],o=r[2];return e[0]=i*t[0]+a*t[3]+o*t[6],e[1]=i*t[1]+a*t[4]+o*t[7],e[2]=i*t[2]+a*t[5]+o*t[8],e}function j4(e,r,t){var i=t[0],a=t[1],o=t[2],s=t[3],l=r[0],n=r[1],u=r[2],c=a*u-o*n,f=o*l-i*u,h=i*n-a*l;return c+=c,f+=f,h+=h,e[0]=l+s*c+a*h-o*f,e[1]=n+s*f+o*c-i*h,e[2]=u+s*h+i*f-a*c,e}function O1(e,r,t,i){var a=[],o=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],o[0]=a[0],o[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),o[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),e[0]=o[0]+t[0],e[1]=o[1]+t[1],e[2]=o[2]+t[2],e}function Yv(e,r,t,i){var a=[],o=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],o[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),o[1]=a[1],o[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),e[0]=o[0]+t[0],e[1]=o[1]+t[1],e[2]=o[2]+t[2],e}function U4(e,r,t,i){var a=[],o=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],o[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),o[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),o[2]=a[2],e[0]=o[0]+t[0],e[1]=o[1]+t[1],e[2]=o[2]+t[2],e}function UK(e){return e[0]=0,e[1]=0,e[2]=0,e}function qK(){var e=new Ql(4);return Ql!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function VK(e,r,t,i){var a=new Ql(4);return a[0]=e,a[1]=r,a[2]=t,a[3]=i,a}function GK(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e[3]=r[3]*t[3],e}function HK(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e}function $K(e,r){var t=r[0],i=r[1],a=r[2],o=r[3],s=t*t+i*i+a*a+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=t*s,e[1]=i*s,e[2]=a*s,e[3]=o*s,e}function pu(e,r,t){var i=r[0],a=r[1],o=r[2],s=r[3];return e[0]=t[0]*i+t[4]*a+t[8]*o+t[12]*s,e[1]=t[1]*i+t[5]*a+t[9]*o+t[13]*s,e[2]=t[2]*i+t[6]*a+t[10]*o+t[14]*s,e[3]=t[3]*i+t[7]*a+t[11]*o+t[15]*s,e}function p9(){var e=new Ql(4);return Ql!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function WK(e,r,t){t*=.5;var i=Math.sin(t);return e[0]=i*r[0],e[1]=i*r[1],e[2]=i*r[2],e[3]=Math.cos(t),e}function YK(e,r,t){var i=r[0],a=r[1],o=r[2],s=r[3],l=t[0],n=t[1],u=t[2],c=t[3];return e[0]=i*c+s*l+a*u-o*n,e[1]=a*c+s*n+o*l-i*u,e[2]=o*c+s*u+i*n-a*l,e[3]=s*c-i*l-a*n-o*u,e}function C_(e,r,t,i){var a=r[0],o=r[1],s=r[2],l=r[3],n=t[0],u=t[1],c=t[2],f=t[3],h,d=a*n+o*u+s*c+l*f,p,g,m;return d<0&&(d=-d,n=-n,u=-u,c=-c,f=-f),1-d>1e-6?(h=Math.acos(d),p=Math.sin(h),g=Math.sin((1-i)*h)/p,m=Math.sin(i*h)/p):(g=1-i,m=i),e[0]=g*a+m*n,e[1]=g*o+m*u,e[2]=g*s+m*c,e[3]=g*l+m*f,e}function XK(e,r){var t=r[0]+r[4]+r[8],i;if(t>0)i=Math.sqrt(t+1),e[3]=.5*i,i=.5/i,e[0]=(r[5]-r[7])*i,e[1]=(r[6]-r[2])*i,e[2]=(r[1]-r[3])*i;else{var a=0;r[4]>r[0]&&(a=1),r[8]>r[a*3+a]&&(a=2);var o=(a+1)%3,s=(a+2)%3;i=Math.sqrt(r[a*3+a]-r[o*3+o]-r[s*3+s]+1),e[a]=.5*i,i=.5/i,e[3]=(r[o*3+s]-r[s*3+o])*i,e[o]=(r[o*3+a]+r[a*3+o])*i,e[s]=(r[s*3+a]+r[a*3+s])*i}return e}function q4(e,r,t,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",o=Math.PI/360;r*=o,i*=o,t*=o;var s=Math.sin(r),l=Math.cos(r),n=Math.sin(t),u=Math.cos(t),c=Math.sin(i),f=Math.cos(i);switch(a){case"xyz":e[0]=s*u*f+l*n*c,e[1]=l*n*f-s*u*c,e[2]=l*u*c+s*n*f,e[3]=l*u*f-s*n*c;break;case"xzy":e[0]=s*u*f-l*n*c,e[1]=l*n*f-s*u*c,e[2]=l*u*c+s*n*f,e[3]=l*u*f+s*n*c;break;case"yxz":e[0]=s*u*f+l*n*c,e[1]=l*n*f-s*u*c,e[2]=l*u*c-s*n*f,e[3]=l*u*f+s*n*c;break;case"yzx":e[0]=s*u*f+l*n*c,e[1]=l*n*f+s*u*c,e[2]=l*u*c-s*n*f,e[3]=l*u*f-s*n*c;break;case"zxy":e[0]=s*u*f-l*n*c,e[1]=l*n*f+s*u*c,e[2]=l*u*c+s*n*f,e[3]=l*u*f-s*n*c;break;case"zyx":e[0]=s*u*f-l*n*c,e[1]=l*n*f+s*u*c,e[2]=l*u*c-s*n*f,e[3]=l*u*f+s*n*c;break;default:throw Error("Unknown angle order "+a)}return e}function V4(){var e=new Ql(2);return Ql!=Float32Array&&(e[0]=0,e[1]=0),e}function v9(e,r){var t=new Ql(2);return t[0]=e,t[1]=r,t}function m9(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e}function g9(e){var r=e[0],t=e[1];return Math.sqrt(r*r+t*t)}function ZK(e){var r=e[0],t=e[1];return r*r+t*t}function KK(e,r){return e[0]*r[0]+e[1]*r[1]}function y9(e){return e[0]=0,e[1]=0,e}function Cf(e,r,t){return r*(Bi/(e.tileSize*2**(t-e.tileID.overscaledZ)))}function Zu(e){return e instanceof Error?e:Error(typeof e=="string"?e:String(e))}function Bp(){return new Float64Array(4)}function fs(){return new Float64Array(3)}function L0(){return new Float64Array(16)}function D_(){let e=new Float64Array(16);return Hh(e),e}function _9(){let e=new Float32Array(16);return Hh(e),e}function Op(e,r,t,i,a=!1){if(!t[0]&&!t[1])return[0,0];let o=a?i==="map"?-e.bearingInRadians:0:i==="viewport"?e.bearingInRadians:0;if(o){let s=Math.sin(o),l=Math.cos(o);t=[t[0]*l-t[1]*s,t[0]*s+t[1]*l]}return[a?t[0]:Cf(r,t[0],e.zoom),a?t[1]:Cf(r,t[1],e.zoom)]}function G4(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]}function uh(e,r,t){let i=kK([e[0],e[1],e[2],r[0],r[1],r[2],t[0],t[1],t[2]]);if(i===0)return null;let a=uf([],[r[0],r[1],r[2]],[t[0],t[1],t[2]]),o=uf([],[t[0],t[1],t[2]],[e[0],e[1],e[2]]),s=uf([],[e[0],e[1],e[2]],[r[0],r[1],r[2]]),l=Ws([],a,-e[3]);return lh(l,l,Ws([],o,-r[3])),lh(l,l,Ws([],s,-t[3])),Ws(l,l,1/i),l}function JK(e,r,t){let i=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],a=r[0]*t[0]+r[1]*t[1]+r[2]*t[2];return a===0?null:(-i-t[3])/a}function L_(e,r,t,i){let a=Math.sqrt(e*e+r*r),o=Math.sqrt(t*t+i*i);e/=a,r/=a,t/=o,i/=o;let s=e*t+r*i,l=Math.acos(s);return-r*t+e*i>0?l:-l}function Df(e,r){let t=F0(e,360),i=F0(r,360),a=i-t,o=i>t?a-360:a+360;return Math.abs(a)n.canonical.z)),t=1/0,i=-1/0,a=1/0,o=-1/0,s=[];for(let n of e){let{x:u,y:c,z:f}=n.canonical,h=2**(r-f),d=u*h,p=c*h;s.push({id:n,x:d,y:p}),di&&(i=d),po&&(o=p)}let l=new Set;for(let n of s)(n.x===t||n.x===i||n.y===a||n.y===o)&&l.add(n.id);return l}function tJ(e){if(e<=0)return 0;if(e>=1)return 1;let r=e*e,t=r*e;return 4*(e<.5?t:3*(e-r)+t-.75)}function H4(e,r,t,i){return EK(e,r,t,i)}function to(e,r,t){return Math.min(t,Math.max(r,e))}function ch(e,r,t){let i=t-r,a=((e-r)%i+i)%i+r;return a===r?t:a}function yn(e,...r){for(let t of r)for(let i in t)e[i]=t[i];return e}function N1(e,r){let t={};for(let i of r)i in e&&(t[i]=e[i]);return t}function x9(){return wP++}function rJ(e){return Math.log(e)/Math.LN2%1==0}function iJ(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}function Vc(e){return 2**e}function Ku(e){return Math.log(e)/Math.LN2}function Lf(e,r,t){if(r<=0)return e;let i=1/r;return t===void 0||Math.abs(t)<1e-10?Math.round(e*i)/i:(t>0?Math.ceil(e*i-1e-9):Math.floor(e*i+1e-10))/i}function $4(e,r,t){let i={};for(let a in e)i[a]=r.call(t||this,e[a],a,e);return i}function b9(e,r,t){let i={};for(let a in e)r.call(t||this,e[a],a,e)&&(i[a]=e[a]);return i}function Td(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let t=0;t(r.y-e.y)*(t.x-e.x)}function aJ(e,r,t,i){let a=r.y-e.y,o=r.x-e.x,s=i.y-t.y,l=i.x-t.x,n=s*o-l*a;if(n===0)return null;let u=e.y-t.y,c=e.x-t.x,f=(l*u-s*c)/n;return new Wr(e.x+f*o,e.y+f*a)}function nJ([e,r,t]){return r+=90,r*=Math.PI/180,t*=Math.PI/180,[e*Math.cos(r)*Math.sin(t),e*Math.sin(r)*Math.sin(t),e*Math.cos(t)]}function Zv(e){return typeof WorkerGlobalScope<"u"&&e!==void 0&&e instanceof WorkerGlobalScope}function oJ(e){let r=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,t={};if(e.replace(r,(i,a,o,s)=>{let l=o||s;return t[a]=!l||l.toLowerCase(),""}),t["max-age"]){let i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t}function sJ(e){if(Ex==null){let r=e.navigator?e.navigator.userAgent:null;Ex=!!e.safari||!!(r&&(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return Ex}function P0(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}function lJ(e,r,t,i,a){let o=Math.max(-r,0)*4,s=(Math.max(0,t)-t)*i*4+o,l=i*4,n=Math.max(0,r),u=Math.max(0,t),c=Math.min(e.width,r+i),f=Math.min(e.height,t+a);return{rect:{x:n,y:u,width:c-n,height:f-u},layout:[{offset:s,stride:l}]}}function uJ(e,r,t,i,a){return Xr(this,null,function*(){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let o=new VideoFrame(e,{timestamp:0});try{let s=o?.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let l=s.startsWith("BGR"),n=new Uint8ClampedArray(i*a*4);if(yield o.copyTo(n,lJ(e,r,t,i,a)),l)for(let u=0;u{e.removeEventListener(r,t,i)}}}function rl(e){return e*Math.PI/180}function Ad(e){return e/Math.PI*180}function w9(e,r){return e.roll==r.roll&&e.pitch==r.pitch&&e.bearing==r.bearing}function cJ(e){let r=new Float64Array(9);DK(r,e);let t=Ad(-Math.asin(to(r[2],-1,1))),i,a;return Math.hypot(r[5],r[8])<.001?(i=0,a=-Ad(Math.atan2(r[3],r[4]))):(i=Ad(r[5]===0&&r[8]===0?0:Math.atan2(r[5],r[8])),a=Ad(r[1]===0&&r[0]===0?0:Math.atan2(r[1],r[0]))),{roll:i,pitch:t+90,bearing:a}}function T9(e,r,t){let i=v9(r.x-t.x,r.y-t.y),a=v9(e.x-t.x,e.y-t.y),o=i[0]*a[1]-i[1]*a[0];return Ad(Math.atan2(o,KK(i,a)))}function A9(e,r,t){let i=new Float64Array(4);return q4(i,e,r-90,t),i}function fJ(e,r){return cT[r]&&"touches"in e}function hJ(e,r){var t,i;if(!fT[r])return!1;let a=e,o=((i=(t=a?.target)==null?void 0:t.ownerDocument)==null?void 0:i.defaultView)||window;return a instanceof o.MouseEvent||a instanceof o.WheelEvent}function dJ(e){return cT[e]||fT[e]}function jp(e){return e instanceof Error&&e.name==="AbortError"}function Y4(e){if(e.aborted)throw new vm(e.reason)}function M9(e){return ff.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}function pJ(e,r){ff.REGISTERED_PROTOCOLS[e]=r}function vJ(e){delete ff.REGISTERED_PROTOCOLS[e]}function X4(){var e;if(Zv(self))return(e=self.worker)==null?void 0:e.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch{}return window.location.href}function mJ(e,r){return Xr(this,null,function*(){let t=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:X4(),referrerPolicy:e.referrerPolicy,signal:r.signal});e.type==="json"&&!t.headers.has("Accept")&&t.headers.set("Accept","application/json");let i;try{i=yield fetch(t)}catch(s){throw jp(s)?s:new mm(0,Zu(s).message,e.url,new Blob)}if(!i.ok){let s=yield i.blob();throw new mm(i.status,i.statusText,e.url,s)}let a;a=e.type==="arrayBuffer"||e.type==="image"?i.arrayBuffer():e.type==="json"?i.json():i.text();let o=yield a;return Y4(r.signal),{data:o,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}})}function gJ(e,r){return new Promise((t,i)=>{var a;let o=new XMLHttpRequest;o.open(e.method||"GET",e.url,!0),(e.type==="arrayBuffer"||e.type==="image")&&(o.responseType="arraybuffer");for(let s in e.headers)o.setRequestHeader(s,e.headers[s]);e.type==="json"&&(o.responseType="text",(a=e.headers)!=null&&a.Accept||o.setRequestHeader("Accept","application/json")),o.withCredentials=e.credentials==="include",o.onerror=()=>{i(Error(o.statusText))},o.onload=()=>{if(!r.signal.aborted)if((o.status>=200&&o.status<300||o.status===0)&&o.response!==null){let s=o.response;if(e.type==="json")try{s=JSON.parse(o.response)}catch(l){i(l);return}t({data:s,cacheControl:o.getResponseHeader("Cache-Control"),expires:o.getResponseHeader("Expires"),etag:o.getResponseHeader("ETag")})}else{let s=new Blob([o.response],{type:o.getResponseHeader("Content-Type")});i(new mm(o.status,o.statusText,e.url,s))}},r.signal.addEventListener("abort",()=>{o.abort(),i(new vm(r.signal.reason))}),o.send(e.body)})}function S9(e){if(!e||e.startsWith("data:image/"))return!0;if(e.startsWith("blob:")&&(e=e.slice(5),e.startsWith("null")))return!1;if(e.indexOf("://")<=0)return!0;let r=new URL(e),t=window.location;return r.protocol===t.protocol&&r.host===t.host}function E9(e,r,t){var i;(i=t[e])!=null&&i.includes(r)||(t[e]||(t[e]=[]),t[e].push(r))}function Z4(e,r,t){if(t?.[e]){let i=t[e].indexOf(r);i!==-1&&t[e].splice(i,1)}}function pc(e,r){return{kind:"array",itemType:e,N:r}}function ll(e){if(e.kind==="array"){let r=ll(e.itemType);return typeof e.N=="number"?`array<${r}, ${e.N}>`:e.itemType.kind==="value"?"array":`array<${r}>`}return e.kind}function j1(e,r){if(r.kind==="error")return null;if(e.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!j1(e.itemType,r.itemType))&&(typeof e.N!="number"||e.N===r.N))return null}else{if(e.kind===r.kind)return null;if(e.kind==="value"){for(let t of CP)if(!j1(t,r))return null}}return`Expected ${ll(e)} but found ${ll(r)} instead.`}function K4(e,r){return r.some(t=>t.kind===e.kind)}function I0(e,r){return r.some(t=>t==="null"?e===null:t==="array"?Array.isArray(e):t==="object"?e&&!Array.isArray(e)&&typeof e=="object":t===typeof e)}function Up(e,r){return e.kind==="array"&&r.kind==="array"?e.itemType.kind===r.itemType.kind&&typeof e.N=="number":e.kind===r.kind}function k9(e){return e%=360,e<0&&(e+=360),e}function C9([e,r,t,i]){e=J4(e),r=J4(r),t=J4(t);let a,o,s=Q4((.2225045*e+.7168786*r+.0606169*t)/1);e===r&&r===t?a=o=s:(a=Q4((.4360747*e+.3850649*r+.1430804*t)/vT),o=Q4((.0139322*e+.0971045*r+.7141733*t)/mT));let l=116*s-16;return[l<0?0:l,500*(a-s),200*(s-o),i]}function J4(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Q4(e){return e>.008856451679035631?e**.3333333333333333:e/yT+gT}function D9([e,r,t,i]){let a=(e+16)/116,o=isNaN(r)?a:a+r/500,s=isNaN(t)?a:a-t/200;return a=1*t6(a),o=vT*t6(o),s=mT*t6(s),[e6(3.1338561*o-1.6168667*a-.4906146*s),e6(-.9787684*o+1.9161415*a+.033454*s),e6(.0719453*o-.2289914*a+1.4052427*s),i]}function e6(e){return e=e<=.00304?12.92*e:1.055*e**.4166666666666667-.055,e<0?0:e>1?1:e}function t6(e){return e>Cx?e*e*e:yT*(e-gT)}function yJ(e){let[r,t,i,a]=C9(e),o=Math.sqrt(t*t+i*i);return[Math.round(o*1e4)?k9(Math.atan2(i,t)*LP):NaN,o,r,a]}function _J([e,r,t,i]){return e=isNaN(e)?0:e*DP,D9([t,Math.cos(e)*r,Math.sin(e)*r,i])}function xJ([e,r,t,i]){e=k9(e),r/=100,t/=100;function a(o){let s=(o+e/30)%12,l=r*Math.min(t,1-t);return t-l*Math.max(-1,Math.min(s-3,9-s,1))}return[a(0),a(8),a(4),i]}function U1(e,r){return FP(e,r)?e[r]:void 0}function bJ(e){if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let r=U1(PP,e);if(r){let[i,a,o]=r;return[i/255,a/255,o/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let i=e.length<6?1:2,a=1;return[I_(e.slice(a,a+=i)),I_(e.slice(a,a+=i)),I_(e.slice(a,a+=i)),I_(e.slice(a,a+i)||"ff")]}if(e.startsWith("rgb")){let i=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[a,o,s,l,n,u,c,f,h,d,p,g]=i,m=[l||" ",c||" ",d].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let y=[s,u,h].join(""),_=y==="%%%"?100:y===""?255:0;if(_){let v=[Kv(+o/_,0,1),Kv(+n/_,0,1),Kv(+f/_,0,1),p?L9(+p,g):1];if(F9(v))return v}}return}}let t=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[i,a,o,s,l,n,u,c,f]=t,h=[o||" ",l||" ",u].join("");if(h===" "||h===" /"||h===",,"||h===",,,"){let d=[+a,Kv(+s,0,100),Kv(+n,0,100),c?L9(+c,f):1];if(F9(d))return xJ(d)}}}function I_(e){return parseInt(e.padEnd(2,e),16)/255}function L9(e,r){return Kv(r?e/100:e,0,1)}function Kv(e,r,t){return Math.min(Math.max(r,e),t)}function F9(e){return!e.some(Number.isNaN)}function qp(e,r,t){return e+t*(r-e)}function Jv(e,r,t){return e.map((i,a)=>qp(i,r[a],t))}function wJ(e){return e==="rgb"||e==="hcl"||e==="lab"}function P9(e,r,t,i){return typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[e,r,t,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[e,r,t,i]:[e,r,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Qv(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof op||e instanceof ro||e instanceof Lx||e instanceof Ed||e instanceof Yh||e instanceof Xh||e instanceof If||e instanceof Zh||e instanceof Kh)return!0;if(Array.isArray(e)){for(let r of e)if(!Qv(r))return!1;return!0}if(typeof e=="object"){for(let r in e)if(!Qv(e[r]))return!1;return!0}return!1}function Ml(e){if(e===null)return gm;if(typeof e=="string")return so;if(typeof e=="boolean")return Ao;if(typeof e=="number")return Ra;if(e instanceof ro)return dh;if(e instanceof op)return mg;if(e instanceof Lx)return gg;if(e instanceof Ed)return ym;if(e instanceof Yh)return yg;if(e instanceof Xh)return _g;if(e instanceof If)return _m;if(e instanceof Zh)return xg;if(e instanceof Kh)return xm;if(Array.isArray(e)){let r=e.length,t;for(let i of e){let a=Ml(i);if(!t)t=a;else{if(t===a)continue;t=co;break}}return pc(t||co,r)}return Wp}function q1(e){let r=typeof e;return e===null?"":r==="string"||r==="number"||r==="boolean"?String(e):e instanceof ro||e instanceof op||e instanceof Ed||e instanceof Yh||e instanceof Xh||e instanceof If||e instanceof Zh||e instanceof Kh?e.toString():JSON.stringify(e)}function R_(e,r,t){let i=e.length-1,a=0,o=i,s=0,l,n;for(;a<=o;)if(s=Math.floor((a+o)/2),l=e[s],n=e[s+1],l<=r){if(s===i||rr)o=s-1;else throw new Xs("Input is not a number.",t);return 0}function TJ(e,r,t,i){let a=3*e,o=3*(t-e)-a,s=1-a-o,l=3*r,n=3*(i-r)-l,u=1-l-n;return function(c,f=1e-6){if(c<=0)return 0;if(c>=1)return 1;let h=c;for(let g=0;g<8;g++){let m=((s*h+o)*h+a)*h-c;if(Math.abs(m)m?d=h:p=h,h=(d+p)*.5}return((u*h+n)*h+l)*h}}function r6(e,r,t,i){let a=i-t,o=e-t;return a===0?0:r===1?o/a:(r**+o-1)/(r**+a-1)}function I9(e,r,t=0,i=e.length-1,a=AJ){for(;i>t;){if(i-t>600){let n=i-t+1,u=r-t+1,c=Math.log(n),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(n-f)/n)*(u-n/2<0?-1:1);I9(e,r,Math.max(t,Math.floor(r-u*f/n+h)),Math.min(i,Math.floor(r+(n-u)*f/n+h)),a)}let o=e[r],s=t,l=i;for(V1(e,t,r),a(e[i],o)>0&&V1(e,t,i);s0;)l--}a(e[t],o)===0?V1(e,t,l):(l++,V1(e,l,i)),l<=r&&(t=l+1),r<=l&&(i=l-1)}}function V1(e,r,t){let i=e[r];e[r]=e[t],e[t]=i}function AJ(e,r){return er)}function z_(e,r){if(e.length<=1)return[e];let t=[],i,a;for(let o of e){let s=SJ(o);s!==0&&(o.area=Math.abs(s),a===void 0&&(a=s<0),a===s<0?(i&&t.push(i),i=[o]):i.push(o))}if(i&&t.push(i),r>1)for(let o=0;ot}function LJ(e,r,t){return r<=t}function FJ(e,r,t){return r>=t}function z9(e,r,t,i){return i.compare(r,t)===0}function PJ(e,r,t,i){return!z9(e,r,t,i)}function IJ(e,r,t,i){return i.compare(r,t)<0}function RJ(e,r,t,i){return i.compare(r,t)>0}function zJ(e,r,t,i){return i.compare(r,t)<=0}function BJ(e,r,t,i){return i.compare(r,t)>=0}function em(e,r,t){let i=e!=="=="&&e!=="!=";return class Cj{constructor(o,s,l,n){this.lhs=o,this.rhs=s,this.key=l,this.collator=n,this.type=Ao,this.hasUntypedArgument=o.type.kind==="value"||s.type.kind==="value"}static parse(o,s){if(o.length!==3&&o.length!==4)return s.error("Expected two or three arguments.");let l=o[0],n=s.parse(o[1],1,co);if(!n)return null;if(!R9(l,n.type))return s.concat(1).error(`"${l}" comparisons are not supported for type '${ll(n.type)}'.`);let u=s.parse(o[2],2,co);if(!u)return null;if(!R9(l,u.type))return s.concat(2).error(`"${l}" comparisons are not supported for type '${ll(u.type)}'.`);if(n.type.kind!==u.type.kind&&n.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types '${ll(n.type)}' and '${ll(u.type)}'.`);i&&(n.type.kind==="value"&&u.type.kind!=="value"?n=new kd(u.type,[n],s.key):n.type.kind!=="value"&&u.type.kind==="value"&&(u=new kd(n.type,[u],s.key)));let c=null;if(o.length===4){if(n.type.kind!=="string"&&u.type.kind!=="string"&&n.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(c=s.parse(o[3],3,gg),!c)return null}return new Cj(n,u,s.key,c)}evaluate(o){let s=this.lhs.evaluate(o),l=this.rhs.evaluate(o);if(i&&this.hasUntypedArgument){let n=Ml(s),u=Ml(l);if(n.kind!==u.kind||n.kind!=="string"&&n.kind!=="number")throw new Xs(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${n.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let n=Ml(s),u=Ml(l);if(n.kind!=="string"||u.kind!=="string")return r(o,s,l)}return this.collator?t(o,s,l,this.collator.evaluate(o)):r(o,s,l)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}function OJ(e,r){let t=NJ(e[0]),i=UJ(e[1]),a=2**r.z;return[Math.round(t*a*Jh),Math.round(i*a*Jh)]}function i6(e,r){let t=2**r.z,i=(e[0]/Jh+r.x)/t,a=(e[1]/Jh+r.y)/t;return[jJ(i),qJ(a)]}function NJ(e){return(180+e)/360}function jJ(e){return e*360-180}function UJ(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function qJ(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function G1(e,r){e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[0]),e[3]=Math.max(e[3],r[1])}function H1(e,r){return!(e[0]<=r[0]||e[2]>=r[2]||e[1]<=r[1]||e[3]>=r[3])}function VJ(e,r,t){return r[1]>e[1]!=t[1]>e[1]&&e[0]<(t[0]-r[0])*(e[1]-r[1])/(t[1]-r[1])+r[0]}function GJ(e,r,t){let i=e[0]-r[0],a=e[1]-r[1],o=e[0]-t[0],s=e[1]-t[1];return i*s-o*a===0&&i*o<=0&&a*s<=0}function B_(e,r,t,i){let a=[r[0]-e[0],r[1]-e[1]];return YJ([i[0]-t[0],i[1]-t[1]],a)!==0&&!!(O9(e,r,t,i)&&O9(t,i,e,r))}function HJ(e,r,t){for(let i of t)for(let a=0;a0&&f<0||c<0&&f>0}function a6(e,r,t){let i=[];for(let a=0;at[2]){let a=i*.5,o=e[0]-t[0]>a?-i:t[0]-e[0]>a?i:0;o===0&&(o=e[0]-t[2]>a?-i:t[2]-e[0]>a?i:0),e[0]+=o}G1(r,e)}function XJ(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function U9(e,r,t,i){let a=2**i.z*Jh,o=[i.x*Jh,i.y*Jh],s=[];for(let l of e)for(let n of l){let u=[n.x+o[0],n.y+o[1]];j9(u,r,t,a),s.push(u)}return s}function q9(e,r,t,i){let a=2**i.z*Jh,o=[i.x*Jh,i.y*Jh],s=[];for(let l of e){let n=[];for(let u of l){let c=[u.x+o[0],u.y+o[1]];G1(r,c),n.push(c)}s.push(n)}if(r[2]-r[0]<=a/2){XJ(r);for(let l of s)for(let n of l)j9(n,r,t,a)}return s}function ZJ(e,r){let t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],a=e.canonicalID();if(r.type==="Polygon"){let o=a6(r.coordinates,i,a),s=U9(e.geometry(),t,i,a);if(!H1(t,i))return!1;for(let l of s)if(!tm(l,o))return!1}if(r.type==="MultiPolygon"){let o=N9(r.coordinates,i,a),s=U9(e.geometry(),t,i,a);if(!H1(t,i))return!1;for(let l of s)if(!$J(l,o))return!1}return!0}function KJ(e,r){let t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],a=e.canonicalID();if(r.type==="Polygon"){let o=a6(r.coordinates,i,a),s=q9(e.geometry(),t,i,a);if(!H1(t,i))return!1;for(let l of s)if(!B9(l,o))return!1}if(r.type==="MultiPolygon"){let o=N9(r.coordinates,i,a),s=q9(e.geometry(),t,i,a);if(!H1(t,i))return!1;for(let l of s)if(!WJ(l,o))return!1}return!0}function V9(e,r){return r[0]-e[0]}function O_(e){return e[1]-e[0]+1}function np(e,r){return e[1]>=e[0]&&e[1]e[1])return[null,null];let t=O_(e);if(r){if(t===2)return[e,null];let a=Math.floor(t/2);return[[e[0],e[0]+a],[e[0]+a,e[1]]]}if(t===1)return[e,null];let i=Math.floor(t/2)-1;return[[e[0],e[0]+i],[e[0]+i+1,e[1]]]}function o6(e,r){if(!np(r,e.length))return[1/0,1/0,-1/0,-1/0];let t=[1/0,1/0,-1/0,-1/0];for(let i=r[0];i<=r[1];++i)G1(t,e[i]);return t}function s6(e){let r=[1/0,1/0,-1/0,-1/0];for(let t of e)for(let i of t)G1(r,i);return r}function G9(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function l6(e,r,t){if(!G9(e)||!G9(r))return NaN;let i=0,a=0;return e[2]r[2]&&(i=e[0]-r[2]),e[1]>r[3]&&(a=e[1]-r[3]),e[3]=i)return i;if(H1(a,o)){if(H9(e,r))return 0}else if(H9(r,e))return 0;let s=1/0;for(let l of e)for(let n=0,u=l.length,c=u-1;n0;){let n=s.pop();if(n[0]>=o)continue;let u=n[1],c=r?50:100;if(O_(u)<=c){if(!np(u,e.length))return NaN;if(r){let f=tQ(e,u,t,i);if(isNaN(f)||f===0)return f;o=Math.min(o,f)}else for(let f=u[0];f<=u[1];++f){let h=eQ(e[f],t,i);if(o=Math.min(o,h),o===0)return 0}}else{let f=n6(u,r);$9(s,o,i,e,l,f[0]),$9(s,o,i,e,l,f[1])}}return o}function U_(e,r,t,i,a,o=1/0){let s=Math.min(o,a.distance(e[0],t[0]));if(s===0)return s;let l=new ST([[0,[0,e.length-1],[0,t.length-1]]],V9);for(;l.length>0;){let n=l.pop();if(n[0]>=s)continue;let u=n[1],c=n[2],f=r?50:100,h=i?50:100;if(O_(u)<=f&&O_(c)<=h){if(!np(u,e.length)&&np(c,t.length))return NaN;let d;if(r&&i)d=JJ(e,u,t,c,a),s=Math.min(s,d);else if(r&&!i){let p=e.slice(u[0],u[1]+1);for(let g=c[0];g<=c[1];++g)if(d=R0(t[g],p,a),s=Math.min(s,d),s===0)return s}else if(!r&&i){let p=t.slice(c[0],c[1]+1);for(let g=u[0];g<=u[1];++g)if(d=R0(e[g],p,a),s=Math.min(s,d),s===0)return s}else d=QJ(e,u,t,c,a),s=Math.min(s,d)}else{let d=n6(u,r),p=n6(c,i);N_(l,s,a,e,t,d[0],p[0]),N_(l,s,a,e,t,d[0],p[1]),N_(l,s,a,e,t,d[1],p[0]),N_(l,s,a,e,t,d[1],p[1])}}return s}function iQ(e,r){let t=e.geometry(),i=t.flat().map(s=>i6([s.x,s.y],e.canonical));if(t.length===0)return NaN;let a=new Ix(i[0][1]),o=1/0;for(let s of r){switch(s.type){case"Point":o=Math.min(o,U_(i,!1,[s.coordinates],!1,a,o));break;case"LineString":o=Math.min(o,U_(i,!1,s.coordinates,!0,a,o));break;case"Polygon":o=Math.min(o,j_(i,!1,s.coordinates,a,o))}if(o===0)return o}return o}function aQ(e,r){let t=e.geometry(),i=t.flat().map(s=>i6([s.x,s.y],e.canonical));if(t.length===0)return NaN;let a=new Ix(i[0][1]),o=1/0;for(let s of r){switch(s.type){case"Point":o=Math.min(o,U_(i,!0,[s.coordinates],!1,a,o));break;case"LineString":o=Math.min(o,U_(i,!0,s.coordinates,!0,a,o));break;case"Polygon":o=Math.min(o,j_(i,!0,s.coordinates,a,o))}if(o===0)return o}return o}function nQ(e,r){let t=e.geometry();if(t.length===0||t[0].length===0)return NaN;let i=z_(t,0).map(s=>s.map(l=>l.map(n=>i6([n.x,n.y],e.canonical)))),a=new Ix(i[0][0][0][1]),o=1/0;for(let s of r)for(let l of i){switch(s.type){case"Point":o=Math.min(o,j_([s.coordinates],!1,l,a,o));break;case"LineString":o=Math.min(o,j_(s.coordinates,!0,l,a,o));break;case"Polygon":o=Math.min(o,rQ(l,s.coordinates,a,o))}if(o===0)return o}return o}function c6(e){return e.type==="MultiPolygon"?e.coordinates.map(r=>({type:"Polygon",coordinates:r})):e.type==="MultiLineString"?e.coordinates.map(r=>({type:"LineString",coordinates:r})):e.type==="MultiPoint"?e.coordinates.map(r=>({type:"Point",coordinates:r})):[e]}function W9(e,[r,t,i,a],o){r=r.evaluate(e),t=t.evaluate(e),i=i.evaluate(e);let s=a?a.evaluate(e):1,l=P9(r,t,i,s);if(l)throw new Xs(l,o);return new ro(r/255,t/255,i/255,s,!1)}function Y9(e,r){return e in r&&r[e]!==void 0}function f6(e,r){let t=r[e];return t===void 0?null:t}function oQ(e,r,t,i){for(;t<=i;){let a=t+i>>1;if(r[a]===e)return!0;r[a]>e?i=a-1:t=a+1}return!1}function z0(e){return{type:e}}function sQ(e){return Array.isArray(e)?`(${e.map(ll).join(", ")})`:`(${ll(e.type)}...)`}function q_(e){if(e instanceof TT)return q_(e.boundExpression);if(e instanceof Yp&&e.name==="error"||e instanceof MT||e instanceof Px||e instanceof Rx||e instanceof zx)return!1;let r=e instanceof $0||e instanceof kd,t=!0;return e.eachChild(i=>{t&&(t=r?q_(i):i instanceof H0)}),t?V_(e)&&G_(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function V_(e){if(e instanceof Yp&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof Px||e instanceof Rx)return!1;let r=!0;return e.eachChild(t=>{r&&!V_(t)&&(r=!1)}),r}function $1(e){if(e instanceof Yp&&e.name==="feature-state")return!1;let r=!0;return e.eachChild(t=>{r&&!$1(t)&&(r=!1)}),r}function G_(e,r){if(e instanceof Yp&&r.indexOf(e.name)>=0)return!1;let t=!0;return e.eachChild(i=>{t&&!G_(i,r)&&(t=!1)}),t}function rm(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function X9(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function h6(e){return!!e.expression&&e.expression.interpolated}function W1(e,...r){for(let t of r)for(let i in t)e[i]=t[i];return e}function bo(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function H_(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&Ml(e)===Wp}function lQ(e){return e}function uQ(e){switch(e.type){case"color":return ro.parse;case"padding":return Yh.parse;case"numberArray":return Xh.parse;case"colorArray":return If.parse;default:return null}}function cQ(e){switch(e){case"exponential":return K9;case"interval":return hQ;case"categorical":return fQ;case"identity":return dQ;default:throw Error(`Unknown function type "${e}"`)}}function Z9(e,r){let t=e.stops&&typeof e.stops[0][0]=="object",i=t||e.property!==void 0,a=t||!i,o=e.type||(h6(r)?"exponential":"interval"),s=uQ(r);if(s&&(e=W1({},e),e.stops&&(e.stops=e.stops.map(c=>[c[0],s(c[1])])),e.default?e.default=s(e.default):e.default=s(r.default)),e.colorSpace&&!wJ(e.colorSpace))throw Error(`Unknown color space: "${e.colorSpace}"`);let l=cQ(o),n,u;if(o==="categorical"){n=Object.create(null);for(let c of e.stops)n[c[0]]=c[1];u=typeof e.stops[0][0]}if(t){let c={},f=[];for(let p=0;pp[0]),evaluate({zoom:p},g){return K9({stops:h,base:e.base},r,p).evaluate(p,g)}}}if(a){let c=o==="exponential"?{name:"exponential",base:e.base===void 0?1:e.base}:null;return{kind:"camera",interpolationType:c,interpolationFactor:Rf.interpolationFactor.bind(void 0,c),zoomStops:e.stops.map(f=>f[0]),evaluate:({zoom:f})=>l(e,r,f,n,u)}}return{kind:"source",evaluate(c,f){let h=f&&f.properties?f.properties[e.property]:void 0;return h===void 0?Y1(e.default,r.default):l(e,r,h,n,u)}}}function Y1(e,r,t){if(e!==void 0)return e;if(r!==void 0)return r;if(t!==void 0)return t}function fQ(e,r,t,i,a){return Y1(typeof t===a?i[t]:void 0,e.default,r.default)}function hQ(e,r,t){if(bo(t)!=="number")return Y1(e.default,r.default);let i=e.stops.length;if(i===1||t<=e.stops[0][0])return e.stops[0][1];if(t>=e.stops[i-1][0])return e.stops[i-1][1];let a=R_(e.stops.map(o=>o[0]),t,"");return e.stops[a][1]}function K9(e,r,t){let i=e.base===void 0?1:e.base;if(bo(t)!=="number")return Y1(e.default,r.default);let a=e.stops.length;if(a===1||t<=e.stops[0][0])return e.stops[0][1];if(t>=e.stops[a-1][0])return e.stops[a-1][1];let o=R_(e.stops.map(c=>c[0]),t,""),s=pQ(t,i,e.stops[o][0],e.stops[o+1][0]),l=e.stops[o][1],n=e.stops[o+1][1],u=Zs[r.type]||lQ;return typeof l.evaluate=="function"?{evaluate(...c){let f=l.evaluate.apply(void 0,c),h=n.evaluate.apply(void 0,c);if(f!==void 0&&h!==void 0)return u(f,h,s,e.colorSpace)}}:u(l,n,s,e.colorSpace)}function dQ(e,r,t){switch(r.type){case"color":t=ro.parse(t);break;case"formatted":t=Ed.fromString(t.toString());break;case"resolvedImage":t=Kh.fromString(t.toString());break;case"padding":t=Yh.parse(t);break;case"colorArray":t=If.parse(t);break;case"numberArray":t=Xh.parse(t);break;default:bo(t)!==r.type&&(r.type!=="enum"||!r.values[t])&&(t=void 0)}return Y1(t,e.default,r.default)}function pQ(e,r,t,i){let a=i-t,o=e-t;return a===0?0:r===1?o/a:(r**+o-1)/(r**+a-1)}function d6(e){return{result:"success",value:e}}function im(e){return{result:"error",value:e}}function J9(e,r,t,i){return`${e}${r}: ${t}${i==null?"":` Falling back to ${String(i)}.`}`}function Q9(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function $_(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in W0}function W_(e,r,t,i){Q9(r);let a=new kT(W0,q_,[],t?gQ(t):void 0),o=a.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?d6(new Ox(o,r,t,i)):im(a.errors)}function vQ(e){return e._styleExpression!==void 0}function eL(e,r,t,i){let a=W_(e,r,t,i);if(a.result==="error")return a;let o=a.value.expression,s=V_(o);if(!s&&!rm(t))return im([new Qh("","data expressions not supported")]);let l=G_(o,["zoom"]);if(!l&&!X9(t))return im([new Qh("","zoom expressions not supported")]);let n=Y_(o);if(!n&&!l)return im([new Qh("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(n instanceof Qh)return im([n]);if(n instanceof Rf&&!h6(t))return im([new Qh("",'"interpolate" expressions cannot be used with this property')]);if(!n)return d6(s?new bm("constant",a.value,i):new bm("source",a.value,i));let u=n instanceof Rf?n.interpolation:void 0;return d6(s?new wg("camera",a.value,n.labels,u,i):new wg("composite",a.value,n.labels,u,i))}function mQ(e,r,t,i){if(H_(e))return new CT(e,r,t);if($_(e)){let a=eL(e,r,t,i);if(a.result==="error")throw Error(a.value.map(o=>`${o.key}: ${o.message}`).join(", "));return a.value}{let a=e;return t.type==="color"&&typeof e=="string"?a=ro.parse(e):t.type==="padding"&&(typeof e=="number"||Array.isArray(e))?a=Yh.parse(e):t.type==="numberArray"&&(typeof e=="number"||Array.isArray(e))?a=Xh.parse(e):t.type==="colorArray"&&(typeof e=="string"||Array.isArray(e))?a=If.parse(e):t.type==="variableAnchorOffsetCollection"&&Array.isArray(e)?a=Zh.parse(e):t.type==="projectionDefinition"&&typeof e=="string"&&(a=op.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>a}}}function Y_(e){let r=null;if(e instanceof wT)r=Y_(e.result);else if(e instanceof AT){for(let t of e.args)if(r=Y_(t),r)break}else(e instanceof Fx||e instanceof Rf)&&e.input instanceof Yp&&e.input.name==="zoom"&&(r=e);return r instanceof Qh||e.eachChild(t=>{let i=Y_(t);i instanceof Qh?r=i:!r&&i?r=new Qh("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new Qh("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}function X1(e,r=new Set){return e instanceof zx&&r.add(e.key),e.eachChild(t=>{X1(t,r)}),r}function gQ(e){let r={color:dh,string:so,number:Ra,enum:so,boolean:Ao,formatted:ym,padding:yg,numberArray:_g,colorArray:_m,projectionDefinition:mg,resolvedImage:xm,variableAnchorOffsetCollection:xg};return e.type==="array"?pc(r[e.value]||co,e.length):r[e.type]}function tL(e){if(e.type==="color"&&H_(e.default))return new ro(0,0,0,0);switch(e.type){case"color":return ro.parse(e.default)||null;case"padding":return Yh.parse(e.default)||null;case"numberArray":return Xh.parse(e.default)||null;case"colorArray":return If.parse(e.default)||null;case"variableAnchorOffsetCollection":return Zh.parse(e.default)||null;case"projectionDefinition":return op.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function am(e,r){let{zoom:t,heatmapDensity:i,elevation:a,lineProgress:o,isSupportedScript:s,accumulated:l}=e??{};return{zoom:t,heatmapDensity:i,elevation:a,lineProgress:o,isSupportedScript:s,accumulated:l,globalState:r}}function yQ(e){let r=!1;for(let t of e){let i=rL(t);if(i==="expression")return"expression";i==="legacy"&&(r=!0)}return r?"legacy":"neutral"}function rL(e){if(typeof e=="boolean")return"neutral";if(!Array.isArray(e)||e.length===0)return"legacy";switch(e[0]){case"has":return e.length<2||e[1]==="$id"||e[1]==="$type"?"legacy":e.length===2?"neutral":"expression";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return yQ(e.slice(1));default:return"expression"}}function p6(e){return rL(e)!=="legacy"}function iL(e){return e==="$type"?["geometry-type"]:e==="$id"?["id"]:["get",e]}function _Q(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return e.length!==3||typeof e[1]!="string"?null:[e[0],iL(e[1]),e[2]];case"in":case"!in":{if(e.length<2||typeof e[1]!="string")return null;let r=["in",iL(e[1]),["literal",e.slice(2)]];return e[0]==="!in"?["!",r]:r}case"has":case"!has":{if(e.length!==2||typeof e[1]!="string"||e[1]==="$type"||e[1]==="$id")return null;let r=["has",e[1]];return e[0]==="!has"?["!",r]:r}default:return null}}function aL(e){if((e[0]==="<"||e[0]==="<="||e[0]===">"||e[0]===">=")&&e[1]==="$type")return`"$type" cannot be use with operator "${e[0]}"`;let r=_Q(e);return r?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(r)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function v6(e,r,t){let i=t[e];return Array.isArray(i)?p6(i)?m6(i,r.concat(e)):{path:r.concat(e),legacyFilter:i}:null}function m6(e,r=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let t=1;t"u")return;let i=t.path.map(a=>`[${a}]`).join("");console.warn(`${r}${i}: ${aL(t.legacyFilter)}`)}function Z1(e,r,t){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};p6(e)?xQ(e,r):e=X_(e);let i=W_(e,r,eI,t);if(i.result==="error")throw Error(i.value.map(a=>`${a.key}: ${a.message}`).join(", "));return{filter:(a,o,s)=>i.value.evaluate(a,o,{},s),needGeometry:nL(e),getGlobalStateRefs:()=>X1(i.value.expression)}}function bQ(e,r){return er)}function nL(e){if(!Array.isArray(e))return!1;if(e[0]==="within"||e[0]==="distance")return!0;for(let r=1;r"||r==="<="||r===">="?g6(e[1],e[2],r):r==="any"?wQ(e.slice(1)):r==="all"?["all"].concat(e.slice(1).map(X_)):r==="none"?["all"].concat(e.slice(1).map(X_).map(Z_)):r==="in"?oL(e[1],e.slice(2)):r==="!in"?Z_(oL(e[1],e.slice(2))):r==="has"?sL(e[1]):r!=="!has"||Z_(sL(e[1]))}function g6(e,r,t){switch(e){case"$type":return[`filter-type-${t}`,r];case"$id":return[`filter-id-${t}`,r];default:return[`filter-${t}`,e,r]}}function wQ(e){return["any"].concat(e.map(X_))}function oL(e,r){if(r.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(t=>typeof t!=typeof r[0])?["filter-in-large",e,["literal",r.sort(bQ)]]:["filter-in-small",e,["literal",r]]}}function sL(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Z_(e){return["!",e]}function lL(e){let r=e.key,t=e.value;return t?[new na(r,t,"constants have been deprecated as of v8")]:[]}function Sl(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function B0(e){if(Array.isArray(e))return e.map(B0);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let r={};for(let t in e)r[t]=B0(e[t]);return r}return Sl(e)}function Ff(e){let r=e.key,t=e.value,i=e.valueSpec||{},a=e.objectElementValidators||{},o=e.style,s=e.styleSpec,l=e.validateSpec,n=[],u=bo(t);if(u!=="object")return[new na(r,t,`object expected, ${u} found`)];for(let c in t){let f=c.split(".")[0],h=U1(i,f)||i["*"],d;if(U1(a,f))d=a[f];else if(U1(i,f)){if(t[c]===void 0)continue;d=l}else if(a["*"])d=a["*"];else if(i["*"])d=l;else{n.push(new na(r,t[c],`unknown property "${c}"`));continue}n=n.concat(d({key:(r&&`${r}.`)+c,value:t[c],valueSpec:h,style:o,styleSpec:s,object:t,objectKey:c,validateSpec:l},t))}for(let c in i)a[c]||i[c].required&&i[c].default===void 0&&t[c]===void 0&&n.push(new na(r,t,`missing required property "${c}"`));return n}function y6(e){let r=e.value,t=e.valueSpec,i=e.validateSpec,a=e.style,o=e.styleSpec,s=e.key,l=e.arrayElementValidator||i;if(bo(r)!=="array")return[new na(s,r,`array expected, ${bo(r)} found`)];if(t.length&&r.length!==t.length)return[new na(s,r,`array length ${t.length} expected, length ${r.length} found`)];let n={type:t.value,values:t.values};o.$version<7&&(n.function=t.function),bo(t.value)==="object"&&(n=t.value);let u=[];for(let c=0;ci.maximum?[new na(r,t,`${t} is greater than the maximum value ${i.maximum}`)]:[]:[new na(r,t,`number expected, ${a} found`)]}function uL(e){let r=e.valueSpec,t=Sl(e.value.type),i,a={},o,s,l=t!=="categorical"&&e.value.property===void 0,n=!l,u=bo(e.value.stops)==="array"&&bo(e.value.stops[0])==="array"&&bo(e.value.stops[0][0])==="object",c=Ff({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:f,default:p}});return t==="identity"&&l&&c.push(new na(e.key,e.value,'missing required property "property"')),t!=="identity"&&!e.value.stops&&c.push(new na(e.key,e.value,'missing required property "stops"')),t==="exponential"&&e.valueSpec.expression&&!h6(e.valueSpec)&&c.push(new na(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(n&&!rm(e.valueSpec)?c.push(new na(e.key,e.value,"property functions not supported")):l&&!X9(e.valueSpec)&&c.push(new na(e.key,e.value,"zoom functions not supported"))),(t==="categorical"||u)&&e.value.property===void 0&&c.push(new na(e.key,e.value,'"property" property is required')),c;function f(g){if(t==="identity")return[new na(g.key,g.value,'identity function may not have a "stops" property')];let m=[],y=g.value;return m=m.concat(y6({key:g.key,value:y,valueSpec:g.valueSpec,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec,arrayElementValidator:h})),bo(y)==="array"&&y.length===0&&m.push(new na(g.key,y,"array must have at least one stop")),m}function h(g){let m=[],y=g.value,_=g.key;if(bo(y)!=="array")return[new na(_,y,`array expected, ${bo(y)} found`)];if(y.length!==2)return[new na(_,y,`array length 2 expected, length ${y.length} found`)];if(u){if(bo(y[0])!=="object")return[new na(_,y,`object expected, ${bo(y[0])} found`)];if(y[0].zoom===void 0)return[new na(_,y,"object stop key must have zoom")];if(y[0].value===void 0)return[new na(_,y,"object stop key must have value")];if(s&&s>Sl(y[0].zoom))return[new na(_,y[0].zoom,"stop zoom values must appear in ascending order")];Sl(y[0].zoom)!==s&&(s=Sl(y[0].zoom),o=void 0,a={}),m=m.concat(Ff({key:`${_}[0]`,value:y[0],valueSpec:{zoom:{}},validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{zoom:K_,value:d}}))}else m=m.concat(d({key:`${_}[0]`,value:y[0],valueSpec:{},validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec},y));return $_(B0(y[1]))?m.concat([new na(`${_}[1]`,y[1],"expressions are not allowed in function stops.")]):m.concat(g.validateSpec({key:`${_}[1]`,value:y[1],valueSpec:r,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec}))}function d(g,m){let y=bo(g.value),_=Sl(g.value),v=g.value===null?m:g.value;if(!i)i=y;else if(y!==i)return[new na(g.key,v,`${y} stop domain type must match previous stop domain type ${i}`)];if(y!=="number"&&y!=="string"&&y!=="boolean")return[new na(g.key,v,"stop domain value must be a number, string, or boolean")];if(y!=="number"&&t!=="categorical"){let x=`number expected, ${y} found`;return rm(r)&&t===void 0&&(x+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new na(g.key,v,x)]}return t==="categorical"&&y==="number"&&(!isFinite(_)||Math.floor(_)!==_)?[new na(g.key,v,`integer expected, found ${_}`)]:t!=="categorical"&&y==="number"&&o!==void 0&&_new na(`${e.key}${i.key}`,e.value,i.message));let t=r.value.expression||r.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!t.outputDefined())return[new na(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!$1(t))return[new na(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!$1(t))return[new na(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!G_(t,["zoom","feature-state"]))return[new na(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!V_(t))return[new na(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function TQ(e){let r=e.value,t=e.key,i=bo(r);return i==="boolean"?[]:[new na(t,r,`boolean expected, ${i} found`)]}function _6(e){let r=e.key,t=e.value,i=bo(t);return i==="string"?ro.parse(String(t))?[]:[new na(r,t,`color expected, "${t}" found`)]:[new na(r,t,`color expected, ${i} found`)]}function K1(e){let r=e.key,t=e.value,i=e.valueSpec,a=[];return Array.isArray(i.values)?i.values.indexOf(Sl(t))===-1&&a.push(new na(r,t,`expected one of [${i.values.join(", ")}], ${JSON.stringify(t)} found`)):Object.keys(i.values).indexOf(Sl(t))===-1&&a.push(new na(r,t,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(t)} found`)),a}function AQ(e,r){let t=e;for(let i of r)t=t[i];return t}function MQ(e,r){let t=m6(r);return t?[new na(`${e.key}${t.path.map(i=>`[${i}]`).join("")}`,AQ(e.value,t.path),aL(t.legacyFilter),null,"warning")]:[]}function x6(e){let r=B0(e.value);return p6(r)?[...MQ(e,r),...nm(W1({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:cL(e)}function cL(e){let r=e.value,t=e.key;if(bo(r)!=="array")return[new na(t,r,`array expected, ${bo(r)} found`)];let i=e.styleSpec,a,o=[];if(r.length<1)return[new na(t,r,"filter array must have at least 1 element")];switch(o=o.concat(K1({key:`${t}[0]`,value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Sl(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&Sl(r[1])==="$type"&&o.push(new na(t,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":r.length!==3&&o.push(new na(t,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&(a=bo(r[1]),a!=="string"&&o.push(new na(`${t}[1]`,r[1],`string expected, ${a} found`)));for(let s=2;s{f in a&&i.push(new na(o,a[f],`"${f}" is prohibited for ref layers`))});let c;s.layers.forEach(f=>{Sl(f.id)===u&&(c=f)}),c?c.ref?i.push(new na(o,a.ref,"ref cannot reference another ref layer")):n=Sl(c.type):i.push(new na(o,a.ref,`ref layer "${u}" not found`))}else if(n!=="background")if(!a.source)i.push(new na(o,a,'missing required property "source"'));else{let c=s.sources&&s.sources[a.source],f=c&&Sl(c.type);c?f==="vector"&&n==="raster"?i.push(new na(o,a.source,`layer "${a.id}" requires a raster source`)):f!=="raster-dem"&&n==="hillshade"||f!=="raster-dem"&&n==="color-relief"?i.push(new na(o,a.source,`layer "${a.id}" requires a raster-dem source`)):f==="raster"&&n!=="raster"?i.push(new na(o,a.source,`layer "${a.id}" requires a vector source`)):f==="vector"&&!a["source-layer"]?i.push(new na(o,a,`layer "${a.id}" must specify a "source-layer"`)):f==="raster-dem"&&n!=="hillshade"&&n!=="color-relief"?i.push(new na(o,a.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):n==="line"&&a.paint&&a.paint["line-gradient"]&&(f!=="geojson"||!c.lineMetrics)&&i.push(new na(o,a,`layer "${a.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new na(o,a.source,`source "${a.source}" not found`))}return n==="raster"&&((r=a.paint)!=null&&r.resampling)&&((t=a.paint)!=null&&t["raster-resampling"])&&i.push(new na(o,a.paint,`layer "${a.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),i=i.concat(Ff({key:o,value:a,valueSpec:l.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${o}.type`,value:a.type,valueSpec:l.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:a,objectKey:"type"})},filter:x6,layout(c){return Ff({layer:a,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*"(f){return dL(W1({layerType:n},f))}}})},paint(c){return Ff({layer:a,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*"(f){return hL(W1({layerType:n},f))}}})}}})),i}function Vp(e){let r=e.value,t=e.key,i=bo(r);return i==="string"?[]:[new na(t,r,`string expected, ${i} found`)]}function SQ(e){var r;let t=(r=e.sourceName)!=null?r:"",i=e.value,a=e.styleSpec,o=a.source_raster_dem,s=e.style,l=[],n=bo(i);if(i===void 0)return l;if(n!=="object")return l.push(new na("source_raster_dem",i,`object expected, ${n} found`)),l;let u=Sl(i.encoding)==="custom",c=["redFactor","greenFactor","blueFactor","baseShift"],f=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let h in i)!u&&c.includes(h)?l.push(new na(h,i[h],`In "${t}": "${h}" is only valid when "encoding" is set to "custom". ${f} encoding found`)):o[h]?l=l.concat(e.validateSpec({key:h,value:i[h],valueSpec:o[h],validateSpec:e.validateSpec,style:s,styleSpec:a})):l.push(new na(h,i[h],`unknown property "${h}"`));return l}function vL(e){let r=e.value,t=e.key,i=e.styleSpec,a=e.style,o=e.validateSpec;if(!r.type)return[new na(t,r,'"type" is required')];let s=Sl(r.type),l;switch(s){case"vector":case"raster":return l=Ff({key:t,value:r,valueSpec:i[`source_${s.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:DT,validateSpec:o}),l;case"raster-dem":return l=SQ({sourceName:t,value:r,style:e.style,styleSpec:i,validateSpec:o}),l;case"geojson":if(l=Ff({key:t,value:r,valueSpec:i.source_geojson,style:a,styleSpec:i,validateSpec:o,objectElementValidators:DT}),r.cluster)for(let n in r.clusterProperties){let[u,c]=r.clusterProperties[n],f=typeof u=="string"?[u,["accumulated"],["get",n]]:u;l.push(...nm({key:`${t}.${n}.map`,value:c,validateSpec:o,expressionContext:"cluster-map"})),l.push(...nm({key:`${t}.${n}.reduce`,value:f,validateSpec:o,expressionContext:"cluster-reduce"}))}return l;case"video":return Ff({key:t,value:r,valueSpec:i.source_video,style:a,validateSpec:o,styleSpec:i});case"image":return Ff({key:t,value:r,valueSpec:i.source_image,style:a,validateSpec:o,styleSpec:i});case"canvas":return[new na(t,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return K1({key:`${t}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,validateSpec:o,styleSpec:i})}}function EQ({key:e,value:r}){if(bo(r)==="string")return Vp({key:e,value:r});{let t=[];for(let i in r)t.push(...Vp({key:`${e}.${i}`,value:r[i]}));return t}}function mL(e){let r=e.value,t=e.styleSpec,i=t.light,a=e.style,o=[],s=bo(r);if(r===void 0)return o;if(s!=="object")return o=o.concat([new na("light",r,`object expected, ${s} found`)]),o;for(let l in r){let n=l.match(Bx);o=n&&i[n[1]]&&i[n[1]].transition?o.concat(e.validateSpec({key:l,value:r[l],valueSpec:t.transition,validateSpec:e.validateSpec,style:a,styleSpec:t})):i[l]?o.concat(e.validateSpec({key:l,value:r[l],valueSpec:i[l],validateSpec:e.validateSpec,style:a,styleSpec:t})):o.concat([new na(l,r[l],`unknown property "${l}"`)])}return o}function gL(e){let r=e.value,t=e.styleSpec,i=t.sky,a=e.style,o=bo(r);if(r===void 0)return[];if(o!=="object")return[new na("sky",r,`object expected, ${o} found`)];let s=[];for(let l in r){let n=l.match(Bx);s=n&&i[n[1]]&&i[n[1]].transition?s.concat(e.validateSpec({key:l,value:r[l],valueSpec:t.transition,style:a,styleSpec:t})):i[l]?s.concat(e.validateSpec({key:l,value:r[l],valueSpec:i[l],style:a,styleSpec:t})):s.concat([new na(l,r[l],`unknown property "${l}"`)])}return s}function yL(e){let r=e.value,t=e.styleSpec,i=t.terrain,a=e.style,o=[],s=bo(r);if(r===void 0)return o;if(s!=="object")return o=o.concat([new na("terrain",r,`object expected, ${s} found`)]),o;for(let l in r)o=i[l]?o.concat(e.validateSpec({key:l,value:r[l],valueSpec:i[l],validateSpec:e.validateSpec,style:a,styleSpec:t})):o.concat([new na(l,r[l],`unknown property "${l}"`)]);return o}function kQ(e){return Vp(e).length===0?[]:nm(e)}function CQ(e){return Vp(e).length===0?[]:nm(e)}function DQ(e){let r=e.key,t=e.value;if(bo(t)==="array"){if(t.length<1||t.length>4)return[new na(r,t,`padding requires 1 to 4 values; ${t.length} values found`)];let i={type:"number"},a=[];for(let o=0;o[new na(e,r,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],a=t.match(tI);if(!a)return i();let[,o,s,l]=a;if(l!==void 0)return l.length>6?i():[];let n=parseInt(o,16),u=s===void 0?n:parseInt(s,16);return n>LT||u>LT?[new na(e,r,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:n>u?[new na(e,r,`unicode range start must not be greater than its end, but ${t} is`)]:[]}function bL(e){var r,t;let i=(r=e.key)!=null?r:"font-faces",a=e.value,o=e.validateSpec,s=(t=e.styleSpec)!=null?t:pT,l=e.style;if(!b6(a))return[new na(i,a,`object expected, ${bo(a)} found`)];let n=[];for(let u in a){let c=a[u],f=bo(c);if(f==="string")n.push(...Vp({key:`${i}.${u}`,value:c}));else if(f==="array"){let h={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[d,p]of c.entries()){let g=`${i}.${u}[${d}]`;n.push(...Ff({key:g,value:p,valueSpec:h,styleSpec:s,style:l,validateSpec:o}));let m=b6(p)?p["unicode-range"]:void 0;if(bo(m)==="array")for(let[y,_]of m.entries())n.push(...OQ(`${g}.unicode-range[${y}]`,_))}}else n.push(new na(`${i}.${u}`,c,`string or array expected, ${f} found`))}return n}function J1(e){let r=e.value,t=e.valueSpec,i=e.styleSpec;return e.validateSpec=J1,t.expression&&H_(Sl(r))?uL(e):t.expression&&$_(B0(r))?nm(e):t.type&&FT[t.type]?FT[t.type](e):Ff(W1({},e,{valueSpec:t.type?i[t.type]:t}))}function wL(e){let r=e.value,t=e.key,i=Vp(e);return i.length||(r.indexOf("{fontstack}")===-1&&i.push(new na(t,r,'"glyphs" url must include a "{fontstack}" token')),r.indexOf("{range}")===-1&&i.push(new na(t,r,'"glyphs" url must include a "{range}" token'))),i}function Pf(e,r=mi){let t=[];return t=t.concat(J1({key:"",value:e,valueSpec:r.$root,styleSpec:r,style:e,validateSpec:J1,objectElementValidators:{glyphs:wL,"*"(){return[]}}})),e.constants&&(t=t.concat(lL({key:"constants",value:e.constants,style:e,styleSpec:r,validateSpec:J1}))),TL(t)}function fh(e){return function(r){return e(Object.assign({},r,{validateSpec:J1}))}}function TL(e){return[].concat(e).sort((r,t)=>r.line-t.line)}function hh(e){return function(...r){return TL(e.apply(this,r))}}function NQ(e,r,t){return new iI(e,r,t)}function jQ(e){var r;return Object.entries((r=e.sources)!=null?r:{}).filter(([,t])=>!PT.has(t.type)).map(([t])=>`sources.${t}`)}function AL(e,r){let t=jQ(r);return w6(e,Hc(r).filter(({message:i})=>!t.some(a=>i.startsWith(`${a}:`)||i.startsWith(`${a}.`))))}function w6(e,r){let t=!1;for(let i of r){if(i.severity==="warning"){To(i.message);continue}e.fire(new Ln(Error(i.message))),t=!0}return t}function Q1(e,r,t,i){return i?.validate!==!1&&w6(e,r(Ot({styleSpec:mi},t)))}function Qa(e,r,t={}){if(Cd[e])throw Error(`${e} is already registered.`);Object.defineProperty(r,"_classRegistryKey",{value:e,writeable:!1}),Cd[e]={klass:r,omit:t.omit||[],shallow:t.shallow||[]}}function ML(e){var r;return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||((r=e.constructor)==null?void 0:r.name)==="ArrayBuffer")}function T6(e){let r=e.constructor;return e.$name||r._classRegistryKey}function UQ(e){if(typeof e!="object"||!e)return!1;let r=T6(e);return r&&r!=="Object"}function SL(e){return!UQ(e)&&(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||ML(e)||P0(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function eg(e,r){if(SL(e))return(ML(e)||P0(e))&&r&&r.push(e),ArrayBuffer.isView(e)&&r&&r.push(e.buffer),e instanceof ImageData&&r&&r.push(e.data.buffer),e;if(Array.isArray(e)){let o=[];for(let s of e)o.push(eg(s,r));return o}if(typeof e!="object")throw Error(`can't serialize object of type ${typeof e}`);let t=T6(e);if(!t)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!Cd[t])throw Error(`${t} is not registered.`);let{klass:i}=Cd[t],a=i.serialize?i.serialize(e,r):{};if(i.serialize){if(a===r?.[r.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let o in e){if(!e.hasOwnProperty(o)||Cd[t].omit.includes(o))continue;let s=e[o];s!==void 0&&(a[o]=Cd[t].shallow.includes(o)?s:eg(s,r))}e instanceof Error&&(a.message=e.message)}if(a.$name)throw Error("$name property is reserved for worker serialization logic.");return t!=="Object"&&(a.$name=t),a}function tg(e){if(SL(e))return e;if(Array.isArray(e))return e.map(tg);if(typeof e!="object")throw Error(`can't deserialize object of type ${typeof e}`);let r=T6(e)||"Object";if(!Cd[r])throw Error(`can't deserialize unregistered class ${r}`);let{klass:t}=Cd[r];if(!t)throw Error(`can't deserialize unregistered class ${r}`);if(t.deserialize)return t.deserialize(e);let i=Object.create(t.prototype);for(let a of Object.keys(e)){if(a==="$name")continue;let o=e[a];i[a]=Cd[r].shallow.includes(a)?o:tg(o)}return i}function EL(e){if(Array.isArray(e))return e.length;let r=e?.values;return Array.isArray(r)?r.length:void 0}function kL(e,r){let t=EL(e),i=EL(r);return t!==void 0&&i!==void 0&&t!==i}function ul(e,r=1){let t=0,i=0;return{members:e.map(a=>{let o=qQ(a.type),s=t=CL(t,Math.max(r,o)),l=a.components||1;return i=Math.max(i,o),t+=o*l,{name:a.name,type:a.type,components:l,offset:s}}),size:CL(t,Math.max(i,r)),alignment:r}}function qQ(e){return uI[e].BYTES_PER_ELEMENT}function CL(e,r){return Math.ceil(e/r)*r}function DL(e,r){return e=to(Math.floor(e),0,255),r=to(Math.floor(r),0,255),256*e+r}function LL(e){let r=+e;return!isNaN(r)&&r<=9007199254740991?r:(0,hb.default)(String(e))}function A6(e,r,t,i){for(;t>1],o=t-1,s=i+1;for(;;){do o++;while(e[o]a);if(o>=s)break;J_(e,o,s),J_(r,3*o,3*s),J_(r,3*o+1,3*s+1),J_(r,3*o+2,3*s+2)}s-ta.x+1||sa.y+1)&&To("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return t}function N0(e,r){return{type:e.type,id:e.id,properties:e.properties,geometry:r?O0(e):[]}}function HQ(e,r,t,i,a){e.emplaceBack(nA+r*8+i,nA+t*8+a)}function PL(e,r){for(let t of e)if(om(r,t))return!0;for(let t of r)if(om(e,t))return!0;return S6(e,r)}function Q_(e,r,t){return om(e,r)?!0:E6(r,e,t)}function IL(e,r){if(e.length===1)return zL(r,e[0]);for(let t of r)for(let i of t)if(om(e,i))return!0;for(let t of e)if(zL(r,t))return!0;for(let t of r)if(S6(e,t))return!0;return!1}function $Q(e,r,t){for(let i of r){if(e.length>=3){for(let a of i)if(om(e,a))return!0}if(WQ(e,i,t))return!0}return!1}function WQ(e,r,t){if(e.length>1){if(S6(e,r))return!0;for(let i of r)if(E6(i,e,t))return!0}for(let i of e)if(E6(i,r,t))return!0;return!1}function S6(e,r){if(e.length===0||r.length===0)return!1;for(let t=0;t1?e.distSqr(t):e.distSqr(t.sub(r)._mult(a)._add(r))}function zL(e,r){let t=!1,i,a,o;for(let s of e){i=s;for(let l=0,n=i.length-1;lr.y!=o.y>r.y&&r.x<(o.x-a.x)*(r.y-a.y)/(o.y-a.y)+a.x&&(t=!t)}return t}function om(e,r){let t=!1;for(let i=0,a=e.length-1;ir.y!=s.y>r.y&&r.x<(s.x-o.x)*(r.y-o.y)/(s.y-o.y)+o.x&&(t=!t)}return t}function XQ(e,r,t,i,a){for(let s of e)if(r<=s.x&&t<=s.y&&i>=s.x&&a>=s.y)return!0;let o=[new Wr(r,t),new Wr(r,a),new Wr(i,a),new Wr(i,t)];if(e.length>2){for(let s of o)if(om(e,s))return!0}for(let s=0;sa.x&&r.x>a.x||e.ya.y&&r.y>a.y)return!1;let o=Np(e,r,t[0]);return o!==Np(e,r,t[1])||o!==Np(e,r,t[2])||o!==Np(e,r,t[3])}function sm(e,r,t){let i=r.paint.get(e).value;return i.kind==="constant"?i.value:t.programConfigurations.get(r.id).getMaxValue(e)}function ex(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function tx(e,r,t,i,a){if(!r[0]&&!r[1])return e;let o=Wr.convert(r)._mult(a);t==="viewport"&&o._rotate(-i);let s=[];for(let l of e)s.push(l.sub(o));return s}function KQ(e){let r=[];for(let t=0;tk6(a,r,t,i))}function C6(e,{width:r,height:t},i,a){if(!a)a=new Uint8Array(r*t*i);else if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==r*t*i)throw RangeError(`mismatched image size. expected: ${a.length} but got: ${r*t*i}`);return e.width=r,e.height=t,e.data=a,e}function OL(e,{width:r,height:t},i){if(r===e.width&&t===e.height)return;let a=C6({},{width:r,height:t},i);D6(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,t)},i),e.width=r,e.height=t,e.data=a.data}function D6(e,r,t,i,a,o){if(a.width===0||a.height===0)return r;if(a.width>e.width||a.height>e.height||t.x>e.width-a.width||t.y>e.height-a.height)throw RangeError("out of range source coordinates for image copy");if(a.width>r.width||a.height>r.height||i.x>r.width-a.width||i.y>r.height-a.height)throw RangeError("out of range destination coordinates for image copy");let s=e.data,l=r.data;if(s===l)throw Error("srcData equals dstData, so image is already copied");for(let n=0;n{r[e.evaluationKey]=n;let u=e.expression.evaluate(r);a.setPixel(s/4/t,l/4,u)};if(e.clips)for(let s=0,l=0;s80*t){l=e[0],n=e[1];let c=l,f=n;for(let h=t;hc&&(c=d),p>f&&(f=p)}u=Math.max(c-l,f-n),u=u===0?0:32767/u}return P6(o,s,l,n,u),s}function UL(e,r,t,i,a){let o=null;if(a===wee(e,r,t,i)>0)for(let s=r;s=r;s-=i)o=WL(s/i|0,e[s],e[s+1],o);return o&&rg(o,o.next)&&(ag(o),o=o.next),o}function j0(e,r=e){let t=r===e,i=e,a;do a=!1,i!==i.next&&(Cm.size===0||!Cm.has(i))&&(rg(i,i.next)||Jl(i.prev,i,i.next)===0)?((t||i===r)&&(r=i.prev),gb=!0,ag(i),i=i.prev,a=!0):(t||i!==r)&&(i=i.next,a=!t);while(a||i!==r);return r}function P6(e,r,t,i,a){a&&mee(e,t,i,a);let o=e,s=!1;for(;e.prev!==e.next;){let l=e.prev,n=e.next;if(Jl(l,e,n)<0&&(a?oee(e,t,i,a):nee(e))){r.push(l.i,e.i,n.i),ag(e),e=n,o=n;continue}if(e=n,e===o){if(gb=!1,e=j0(e),gb){o=e;continue}if(!s){e=see(e,r),o=e,s=!0;continue}lee(e,r,t,i,a);break}}}function nee(e){let r=e.prev,t=e,i=e.next,a=r.x,o=t.x,s=i.x,l=r.y,n=t.y,u=i.y,c=Math.min(a,o,s),f=Math.min(l,n,u),h=Math.max(a,o,s),d=Math.max(l,n,u),p=i.next;for(;p!==r;){if(p.x>=c&&p.x<=h&&p.y>=f&&p.y<=d&&(a!==p.x||l!==p.y)&&nx(a,l,o,n,s,u,p.x,p.y)&&Jl(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function oee(e,r,t,i){let a=e.prev,o=e,s=e.next,l=a.x,n=o.x,u=s.x,c=a.y,f=o.y,h=s.y,d=Math.min(l,n,u),p=Math.min(c,f,h),g=Math.max(l,n,u),m=Math.max(c,f,h),y=I6(d,p,r,t,i),_=I6(g,m,r,t,i),v=e.prevZ;for(;v&&v.z>=y;){if(v.x>=d&&v.x<=g&&v.y>=p&&v.y<=m&&v!==s&&(l!==v.x||c!==v.y)&&nx(l,c,n,f,u,h,v.x,v.y)&&Jl(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let x=e.nextZ;for(;x&&x.z<=_;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=m&&x!==s&&(l!==x.x||c!==x.y)&&nx(l,c,n,f,u,h,x.x,x.y)&&Jl(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function see(e,r){let t=e,i=!1;do{let a=t.prev,o=t.next.next;HL(a,t,t.next,o,!1)&&ig(a,o)&&ig(o,a)&&(r.push(a.i,t.i,o.i),ag(t),ag(t.next),t=e=o,i=!0),t=t.next}while(t!==e);return i?j0(t):t}function lee(e,r,t,i,a){let o=e;do{let s=o.next.next;for(;s!==o.prev;){if(o.i!==s.i&&_ee(o,s)){let l=$L(o,s);o=j0(o,o.next),l=j0(l,l.next),P6(o,r,t,i,a),P6(l,r,t,i,a);return}s=s.next}o=o.next}while(o!==e)}function uee(e,r,t,i){let a=[];for(let o=0,s=r.length;os&&(s=t.x),t.yl&&(l=t.y),c.xs&&(s=c.x),c.yl&&(l=c.y),t=c}while(++n<16&&t!==r);xb[i]=t;let u=i*4;yl[u]=a,yl[u+1]=o,yl[u+2]=s,yl[u+3]=l}while(t!==r)}function dee(e,r){let t=e.z*4;r.xyl[t+2]&&(yl[t+2]=r.x),r.y>yl[t+3]&&(yl[t+3]=r.y)}function VL(e){let r=xb[e];for(;r.prev.next!==r;)r=r.next;return xb[e]=r,r}function GL(e){let r=_b[e];for(;r.prev.next!==r;)r=r.next;return _b[e]=r,r}function pee(e,r){let t=r,i=e.x,a=e.y,o=-1/0,s;if(rg(e,t))return t;for(let h=0,d=0;hyl[d+3]||yl[d]>i||yl[d+2]<=o)continue;let p=VL(h);t=GL(h);do{if(t.prev.next===t){if(rg(e,t.next))return t.next;if(a<=t.y&&a>=t.next.y&&t.next.y!==t.y){let g=t.x+(a-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(g<=i&&g>o&&(o=g,s=t.xi||yl[d+3]c)continue;let p=VL(h);t=GL(h);do{if(t.prev.next===t&&i>=t.x&&t.x>=l&&i!==t.x&&nx(ai)&&(gs.x||t.x===s.x&&vee(s,t)))&&(s=t,f=g)}t=t.next}while(t!==p)}return s}function vee(e,r){return Jl(e.prev,e,r.prev)<0&&Jl(r.next,e,e.next)<0}function mee(e,r,t,i){let a=e,o=0;do a.z=I6(a.x,a.y,r,t,i),Bf[o++]=a,a=a.next;while(a!==e);gee(o);let s=null;for(let l=0;l=0&&Bf[a].z>i;)Bf[a+1]=Bf[a],a--;Bf[a+1]=t}return}Kp.length>>o&255]++;let s=0;for(let l=0;l<256;l++){let n=Fm[l];Fm[l]=s,s+=n}for(let l=0;l>>o&255]++;i[u]=r[l],a[u]=n}}function I6(e,r,t,i,a){return e=(e-t)*a|0,r=(r-i)*a|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e|r<<1}function yee(e){let r=e,t=e;do(r.x=(e-s)*(o-l)&&(e-s)*(i-l)>=(t-s)*(r-l)&&(t-s)*(o-l)>=(a-s)*(i-l)}function _ee(e,r){let t=rg(e,r)&&Jl(e.prev,e,e.next)>0&&Jl(r.prev,r,r.next)>0;return e.next.i!==r.i&&(t||ig(e,r)&&ig(r,e)&&(Jl(e.prev,e,r.prev)!==0||Jl(e,r.prev,r)!==0))&&!xee(e,r)&&(t||bee(e,r))}function Jl(e,r,t){return(r.y-e.y)*(t.x-r.x)-(r.x-e.x)*(t.y-r.y)}function rg(e,r){return e.x===r.x&&e.y===r.y}function HL(e,r,t,i,a=!0){let o=Jl(e,r,t),s=Jl(e,r,i),l=Jl(t,i,e),n=Jl(t,i,r);return(o>0&&s<0||o<0&&s>0)&&(l>0&&n<0||l<0&&n>0)?!0:a?!!(o===0&&ox(e,t,r)||s===0&&ox(e,i,r)||l===0&&ox(t,e,i)||n===0&&ox(t,r,i)):!1}function ox(e,r,t){return r.x<=Math.max(e.x,t.x)&&r.x>=Math.min(e.x,t.x)&&r.y<=Math.max(e.y,t.y)&&r.y>=Math.min(e.y,t.y)}function xee(e,r){let t=Math.min(e.x,r.x),i=Math.max(e.x,r.x),a=Math.min(e.y,r.y),o=Math.max(e.y,r.y),s=e;do{let l=s.next;if(s.x>i&&l.x>i||s.xo&&l.y>o||s.y=0&&Jl(e,e.prev,r)>=0:Jl(e,r,e.prev)<0||Jl(e,e.next,r)<0}function bee(e,r){let t=e,i=!1,a=(e.x+r.x)/2,o=(e.y+r.y)/2;do{let s=t.next;t.y>o!=s.y>o&&a<(s.x-t.x)*(o-t.y)/(s.y-t.y)+t.x&&(i=!i),t=s}while(t!==e);return i}function $L(e,r){let t=R6(e.i,e.x,e.y),i=R6(r.i,r.x,r.y),a=e.next,o=r.prev;return e.next=r,r.prev=e,t.next=a,a.prev=t,i.next=t,t.prev=i,o.next=i,i.prev=o,i}function WL(e,r,t,i){let a=R6(e,r,t);return i?(a.next=i.next,a.prev=i,i.next.prev=a,i.next=a):(a.prev=a,a.next=a),a}function ag(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),yb&&dee(e.prev,e.next)}function R6(e,r,t){return{i:e,x:r,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function wee(e,r,t,i){let a=0;for(let o=r,s=t-i;o0?(Math.floor(C/s)+1)*s:(Math.ceil(C/s)-1)*s,b=x>0?(Math.floor(w/s)+1)*s:(Math.ceil(w/s)-1)*s,E=Math.abs(C-A),T=Math.abs(w-b),F=Math.abs(C-g),D=Math.abs(w-m),R=y?E/S:1/0,P=_?T/M:1/0;if((F<=E||!y)&&(D<=T||!_))break;if(R0?(t.push(a),t.push(s),t.push(o)):(t.push(a),t.push(o),t.push(s))}return t}function Mee(e,r,t){if(r.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,a=e[r[0]*2];for(let n=1;n=0?s-1:o-1,u=(l+1)%o,c=e[r[n]*2],f=e[r[n]*2+1],h=e[r[u]*2],d=e[r[u]*2+1],p=e[r[s]*2],g=e[r[s]*2+1],m=e[r[l]*2],y=e[r[l]*2+1],_=!1;if(ch)_=!1;else{let v=y-g,x=-(m-p),S=g((h-p)*v+(d-g)*x)*S&&(_=!0)}if(_){let v=r[n],x=r[s],S=r[l];v!==x&&v!==S&&x!==S&&t.push(S,x,v),s--,s<0&&(s=o-1)}else{let v=r[u],x=r[s],S=r[l];v!==x&&v!==S&&x!==S&&t.push(S,x,v),l++,l>=o&&(l=0)}if(n===u)break}}function XL(e,r,t,i,a,o,s,l,n){let u=a.length/2,c=s&&l&&n;if(uKs.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(r,t),n=l.count,g=!0,m=!0,y=!0,c=0);let v=ng(s,i,o,l,h,g,u),x=ng(s,i,o,l,d,m,u),S=ng(s,i,o,l,p,y,u);t.emplaceBack(c+v-n,c+x-n,c+S-n),u.primitiveLength++}}function Eee(e,r,t,i,a,o){let s=[];for(let f=0;fKs.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(r,t),n=l.count,g=!0,m=!0,c=0);let _=ng(s,i,o,l,d,g,u),v=ng(s,i,o,l,p,m,u);t.emplaceBack(c+_-n,c+v-n),u.primitiveLength++}}function z6(e,r){return e.x===r.x&&(e.x<0||e.x>8192)||e.y===r.y&&(e.y<0||e.y>8192)}function ZL(e){return e.every(r=>r.x<0)||e.every(r=>r.x>8192)||e.every(r=>r.y<0)||e.every(r=>r.y>8192)}function KL(e){let r=e.length;if(r<=1)return[e];let t=[],i,a;for(let o=0;oIee(a,i))}function Pee(e,r){let t=Lee(Bi/2,Bi/2,r),i=Qo.fromLngLat(t).meterInMercatorCoordinateUnits(),a=(1<1&&r[0].x===r[r.length-1].x&&r[0].y===r[r.length-1].y;)r.pop();return r}function zee(e,r,t,i,a){let o=r.sub(t),s=i.sub(t),l=o.mag(),n=s.mag();if(l<1e-6||n<1e-6){e.push(t.clone());return}o._div(l),s._div(n);let u=o.x*s.x+o.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){e.push(t.clone());return}let c=.2,f=Math.min(a,l*c,n*c),h=t.add(o.mult(f)),d=t.add(s.mult(f)),p=Math.sqrt((1+u)/2),g=t.add(o.add(s)._unit()._mult(f/p)),m=h.sub(g).angleWith(d.sub(g)),y=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let _=0;_<=y;_++)e.push(h.rotateAround(_/y*m,g))}function ug(e,r,t,i,a,o,s,l){e.emplaceBack(r,t,Math.floor(i*Ab)*2+s,a*Ab*2,o*Ab*2,Math.round(l))}function Bee(e,r){for(let t=0;t0?r+2*e:e}function Uee(e){return/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function qee(e){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function Vee(e){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function Gee(e){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function sx(e){return/[\u02EA\u02EB\u1100-\u11FF\u1401-\u167F\u18B0-\u18FF\u2065\u20DD-\u20E0\u20E2-\u20E4\u2B97\u2BF0-\u2BFF\u2E50\u2E51\u2E80-\u3007\u3012\u3013\u3020-\u302F\u3031-\u30FB\u30FD-\uA4CF\uA960-\uA97F\uAC00-\uD7FF\uF900-\uFAFF\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7\uFFF0-\uFFF8]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|[\uD80C-\uD810\uD81C-\uD822\uD83C\uD83D\uD840-\uD87E\uD880-\uD8BE][\uDC00-\uDFFF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFFF]|\uD823[\uDC00-\uDDFF]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFF]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83E[\uDD00-\uDEFF]|[\uD87F\uD8BF][\uDC00-\uDFFD]/gim.test(String.fromCodePoint(e))}function Hee(e){return/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))}function $ee(e){return/[\r\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0600-\u0605\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DD\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0890\u0891\u0897-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E33-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB3-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1037\u1039-\u103E\u1056-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1084-\u1086\u108D\u109D\u1100-\u11FF\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60\u1A62\u1A65-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA960-\uA97C\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCBD\uDCC2\uDCCD\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC2\uDDC3\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF1F\uDF22-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE84-\uDE99\uDF60-\uDF67]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00-\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD2F]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDD63\uDD67-\uDD6A\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF\uDDEE\uDDEF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDDE6-\uDDFF\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF]/.test(e)}function nF(e){return/[\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA\u1000-\u103F\u1050-\u108F\u109A-\u109F\u1780-\u17D3\u17D7\u17DC\u17DD\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19DE\u19DF\u1A20-\u1A5E\u1A60-\u1A7C\u1AA0-\u1AAD\u1B00-\u1B4C\u1B4E-\u1B7F\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE-\uA9EF\uA9FA-\uA9FE\uAA60-\uAAC2\uAADB-\uAADF]|\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF3A\uDF3B\uDF3F-\uDF46]/gim.test(String.fromCodePoint(e))}function Wee(e,r){return/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(e)||new RegExp("^\\p{gc=Mc}","u").test(r)}function Yee(e,r,t){let i=0;for(let a of e.split(";")){let[o,s]=a.split(",").map(n=>parseInt(n,36)),l=i+o;for(let n=l;n{let t=r.codePointAt(0);return{codePoint:t,type:Xee(t),form:null}})}function ete(e){let r=e.filter(t=>t.type!=="T");for(let t=0;t0&&Zee(r[t-1].type),o=t+1String.fromCodePoint(ite(t))).join("")}function nte(e,r,t){var i;let a=r.layout.get("text-transform").evaluate(t,{});return a==="uppercase"?e=e.toLocaleUpperCase():a==="lowercase"&&(e=e.toLocaleLowerCase()),((i=Fg.applyArabicShaping)!=null?i:ate)(e)}function ote(e,r,t){for(let i of e.sections)i.text=nte(i.text,r,t);return e}function ste(e){let r={},t={},i=[],a=0;function o(u){i.push(e[u]),a++}function s(u,c,f){let h=t[u];return delete t[u],t[c]=h,i[h].geometry[0].pop(),i[h].geometry[0]=i[h].geometry[0].concat(f[0]),h}function l(u,c,f){let h=r[c];return delete r[c],r[u]=h,i[h].geometry[0].shift(),i[h].geometry[0]=f[0].concat(i[h].geometry[0]),h}function n(u,c,f){let h=f?c[0][c[0].length-1]:c[0][0];return`${u}:${h.x}:${h.y}`}for(let u=0;uu.geometry)}function j6(e){if(!gA||!$ee(e))return[...e];kb??(kb=new Intl.Segmenter(void 0,{granularity:"grapheme"}));let r=[];for(let{segment:t}of kb.segment(e)){let i=r.length-1;i>=0&&Wee(r[i],t)?r[i]+=t:r.push(t)}return r}function lte(e){let r=new Set;if(gA){Cb??(Cb=new Intl.Segmenter(void 0,{granularity:"word"}));for(let{index:i}of Cb.segment(e))r.add(i);return r}let t=0;for(let i of e.split(new RegExp("\\b|(?=\\p{Ideo})","u")))r.add(t),t+=i.length;return r}function lx(e){let r=e.codePointAt(0);return e.length>(r>65535?2:1)}function U6(e){return/\s/u.test(String.fromCodePoint(e))}function q6(e){for(let r of e)if(sx(r.codePointAt(0)))return!0;return!1}function ute(e){for(let r of e)if(!cte(r.codePointAt(0)))return!1;return!0}function cte(e){return!Uee(e)}function oF(e){return!(sx(e)||Hee(e))}function sF(e){return new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(e))}function lF(e){return qee(e)}function uF(e){for(let r of e)if(lF(r.codePointAt(0)))return!0;return!1}function fte(e){let r="",t={premature:!0,value:void 0},i=e[Symbol.iterator](),a=i.next(),o=e[Symbol.iterator]();o.next();let s=o.next();for(;!a.done;)(s.done||!oF(s.value.codePointAt(0))||X0[s.value])&&(t.premature||!oF(t.value.codePointAt(0))||X0[t.value])&&X0[a.value]?r+=X0[a.value]:r+=a.value,t={value:a.value,premature:!1},a=i.next(),s=o.next();return r}function cF(e,r,t,i,a,o){if("fontStack"in r){let s=t[r.fontStack],l=s?.[e];if(l)return l.metrics.advance*r.scale+a;let n=0;for(let u of e){let c=s?.[u];c&&(n+=c.metrics.advance*r.scale+a)}return n}{let s=i[r.imageName];return s?s.displaySize[0]*r.scale*24/o+a:0}}function fF(e,r,t,i){let a=(e-r)**2;return i?e1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function p(te,ne){var se=0,le=new Map,ce=ne&&new Map,pe;return te.split(",").forEach(function xe(ye){if(ye.indexOf("+")!==-1)for(var fe=+ye;fe--;)xe(pe);else{pe=ye;var ae=ye.split(">"),ee=ae[0],ie=ae[1];ee=String.fromCodePoint(se+=parseInt(ee,36)),ie=String.fromCodePoint(se+=parseInt(ie,36)),le.set(ee,ie),ne&&ce.set(ie,ee)}}),{map:le,reverseMap:ce}}var g,m,y;function _(){if(!g){var te=p(d.pairs,!0),ne=te.map,se=te.reverseMap;g=ne,m=se,y=p(d.canonical,!1).map}}function v(te){return _(),g.get(te)||null}function x(te){return _(),m.get(te)||null}function S(te){return _(),y.get(te)||null}var M=t.L,C=t.R,w=t.EN,k=t.ES,A=t.ET,b=t.AN,E=t.CS,T=t.B,F=t.S,D=t.ON,R=t.BN,P=t.NSM,z=t.AL,I=t.LRO,L=t.RLO,B=t.LRE,O=t.RLE,G=t.PDF,W=t.LRI,X=t.RLI,Z=t.FSI,J=t.PDI;function N(te,ne){for(var se=125,le=new Uint32Array(te.length),ce=0;ce0)Ve--;else if(Ke>0){for(Ze=0;!Te[Te.length-1]._isolate;)Te.pop();var lt=Te[Te.length-1]._isolInitIndex;lt!=null&&(fe.set(lt,vt),fe.set(vt,lt)),Te.pop(),Ke--}je=Te[Te.length-1],ye[vt]=je._level,je._override&&xe(vt,je._override)}else xt&G?(Ve===0&&(Ze>0?Ze--:!je._isolate&&Te.length>1&&(Te.pop(),je=Te[Te.length-1])),ye[vt]=je._level):xt&T&&(ye[vt]=ee.level);else ye[vt]=je._level,je._override&&xt!==R&&xe(vt,je._override)}for(var qe=[],Ye=null,me=ee.start;me<=ee.end;me++){var _e=le[me];if(!(_e&l)){var Ae=ye[me],ke=_e&a,Ee=_e===J;Ye&&Ae===Ye._level?(Ye._end=me,Ye._endsWithIsolInit=ke):qe.push(Ye={_start:me,_end:me,_level:Ae,_startsWithPDI:Ee,_endsWithIsolInit:ke})}}for(var De=[],Je=0;Je=0;kt--)if(!(le[kt]&l)){yt=ye[kt];break}var Lt=At[At.length-1],Ct=ye[Lt],$t=ee.level;if(!(le[Lt]&a)){for(var mr=Lt+1;mr<=ee.end;mr++)if(!(le[mr]&l)){$t=ye[mr];break}}De.push({_seqIndices:At,_sosType:Math.max(yt,gt)%2?C:M,_eosType:Math.max($t,Ct)%2?C:M})}}for(var br=0;br=0;ja--)if(!(le[Tr[ja]]&l)){$i=le[Tr[ja]];break}xe(ea,$i&(a|J)?D:$i)}}if(pe.get(w))for(var ya=0;ya=-1;xi--){var bi=xi===-1?Ur:le[Tr[xi]];if(bi&o){bi===z&&xe(pa,b);break}}}if(pe.get(z))for(var Ua=0;Ua=0&&(Be=le[Tr[Et]],Be&l);Et--);for(var St=pi+1;St=0&&le[Tr[Wt]]&(A|l);Wt--)xe(Tr[Wt],w);for(zt++;zt=0&&le[Tr[tt]]&l;tt--)xe(Tr[tt],D);for(var ct=Yt+1;ct=0;Hi--){var Za=Pr[Hi].char;if(Za===ba||Za===x(S(gi))||v(S(Za))===gi){Br.push([Pr[Hi].seqIndex,Mi]),Pr.length=Hi;break}}}Br.sort(function(no,Mo){return no[0]-Mo[0]});for(var oa=0;oa=0;Mn--){var Kn=Tr[Mn];if(le[Kn]&vr){var zn=le[Kn]&qt?C:M;pn=zn===oi?oi:zn;break}}}if(pn){if(le[Tr[_n]]=le[Tr[Li]]=pn,pn!==oi){for(var ua=_n+1;ua=0;Jn--)if(le[Tr[Jn]]&l)on=Jn;else{ho=le[Tr[Jn]]&qt?C:M;break}for(var lo=Ai,Fo=ln+1;Fo=0&&f(te[Bn])&n;Bn--)ye[Bn]=ee.level}}return{levels:ye,paragraphs:ae};function ps(no,Mo){for(var Vn=no;Vn=ye&&f(te[ee])&n;ee--)ae[ee]=xe.level;for(var ie=xe.level,Q=1/0,ue=0;ueie&&(ie=ge),ge=Q;Me--)for(var Te=0;Te=Me){for(var je=Te;Te+1=Me;)Te++;Te>je&&pe.push([je+ye,Te+ye])}}}),pe}function Y(te,ne,se,le){var ce=K(te,ne,se,le),pe=[].concat(te);return ce.forEach(function(xe,ye){pe[ye]=(ne.levels[xe]&1?V(te[xe]):null)||te[xe]}),pe.join("")}function K(te,ne,se,le){for(var ce=q(te,ne,se,le),pe=[],xe=0;xe=0;i--){let a=Lb.getBidiCharTypeName(e[i].text[0]);GR.has(a)?(e[i].level=r,t=!0):t&&VR.has(a)?e[i].level=r:t=!1}}function mte(e,r){let t=r,i=1/0;for(let{level:o}of e)o>t&&(t=o),(o|1)=i;o--)for(let s=0;s=o;)l++;for(let n=s,u=l;nr>=a.start&&r<=a.end))==null?void 0:t.level)!=null?i:0}function _te(e,r,t,i,a){let o=pte(e,r,i,a);vte(o,t);let s="",l=[];for(let n of mte(o,t)){if(qR.test(n.text))continue;let u=gte(n);s+=u,l.push(...Array(u.length).fill(n.index))}return{text:s,sourceIndices:l}}function xte(e,r){let t=r.filter(o=>o>0&&oo-s),a=[];for(let o=0;o+1a.start))).map(([a,o])=>_te(e,t,yte(i,a),a,o))}function bte(e,r){return vF(e,r).map(t=>t.text)}function wte(e,r,t){return vF(e,t).map(i=>[i.text,i.sourceIndices.map(a=>{var o;return(o=r[a])!=null?o:0})])}function Tte(e,r,t){let i=t.buf,a,o;if(o=i[t.pos++],a=(o&112)>>4,o<128||(o=i[t.pos++],a|=(o&127)<<3,o<128)||(o=i[t.pos++],a|=(o&127)<<10,o<128)||(o=i[t.pos++],a|=(o&127)<<17,o<128)||(o=i[t.pos++],a|=(o&127)<<24,o<128)||(o=i[t.pos++],a|=(o&1)<<31,o<128))return Ate(e,a,r);throw Error("Expected varint not more than 10 bytes")}function Ate(e,r,t){return t?r*4294967296+(e>>>0):(r>>>0)*4294967296+(e>>>0)}function Mte(e,r,t){let i="",a=r;for(;a239?4:o>223?3:o>191?2:1;if(a+l>t)break;let n,u,c;l===1?o<128&&(s=o):l===2?(n=e[a+1],(n&192)==128&&(s=(o&31)<<6|n&63,s<=127&&(s=null))):l===3?(n=e[a+1],u=e[a+2],(n&192)==128&&(u&192)==128&&(s=(o&15)<<12|(n&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):l===4&&(n=e[a+1],u=e[a+2],c=e[a+3],(n&192)==128&&(u&192)==128&&(c&192)==128&&(s=(o&15)<<18|(n&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,l=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),a+=l}return i}function Ste(e,r,t){e===1&&t.readMessage(Ete,r)}function Ete(e,r,t){if(e===3){let{id:i,bitmap:a,width:o,height:s,left:l,top:n,advance:u}=t.readMessage(kte,{});r.push({id:i,bitmap:new vb({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:n,advance:u}})}}function kte(e,r,t){e===1?r.id=t.readVarint():e===2?r.bitmap=t.readBytes():e===3?r.width=t.readVarint():e===4?r.height=t.readVarint():e===5?r.left=t.readSVarint():e===6?r.top=t.readSVarint():e===7&&(r.advance=t.readVarint())}function Cte(e){return new _A(e).readFields(Ste,[])}function ux(e){return typeof e?.renderWithWebGL=="function"}function Dte(e){let{userImage:r}=e;return!r?.render||!r.render()?!1:(ux(r.data)||e.data.replace(new Uint8Array(r.data.buffer)),!0)}function mF(e){let r=0,t=0;for(let s of e)r+=s.w*s.h,t=Math.max(t,s.w);e.sort((s,l)=>l.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),t),h:1/0}],a=0,o=0;for(let s of e)for(let l=i.length-1;l>=0;l--){let n=i[l];if(!(s.w>n.w||s.h>n.h)){if(s.x=n.x,s.y=n.y,o=Math.max(o,s.y+s.h),a=Math.max(a,s.x+s.w),s.w===n.w&&s.h===n.h){let u=i.pop();u&&l=t;o--)r.push(o);t=i+1}else{for(let o=t;oe.toCodeUnitIndex(o)),i=Fg.isParsed()?Fg:null;if(e.sections.length===1)return i?i.processBidirectionalText(e.toString(),t).map(o=>yF(o,e.sections,[...o].map(()=>0))):bte(e.toString(),t).map(o=>V6([...o],e.sections,[...o].map(()=>0)));let a=Ite(e);return i?i.processStyledBidirectionalText(e.text,a,t).map(([o,s])=>yF(o,e.sections,s)):wte(e.text,a,t).map(([o,s])=>{let l=[...o];return V6(l,e.sections,gF(l).map(n=>{var u;return(u=s[n])!=null?u:0}))})}function V6(e,r,t){var i;let a=new Db(e.join(""),r,[]),o=0;for(let s of a.graphemes())a.sectionIndex.push((i=t[o])!=null?i:0),o+=[...s].length;return a}function gF(e){let r=[],t=0;for(let i of e)r.push(t),t+=i.length;return r}function yF(e,r,t){let i=[...e],a=gF(i),o=Pte(i);return V6(o.map(s=>i[s]),r,o.map(s=>{var l;return(l=t[a[s]])!=null?l:0}))}function cx(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p){let g=Db.fromFeature(e,a);f===2&&g.verticalizePunctuation();let m=g.determineLineBreaks(u,o,r,i,d),y=uF(g.text)?Rte(g,m):Fte(g,m),_=[],v={positionedLines:_,text:g.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:f,iconsInText:!1,verticalizable:!1};return Gte(v,r,t,i,y,s,l,n,f,u,h,p),!Lte(_)&&v}function fx(e){let r=.5,t=.5;switch(e){case"right":case"top-right":case"bottom-right":r=1;break;case"left":case"top-left":case"bottom-left":r=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":t=1;break;case"top":case"top-right":case"top-left":t=0}return{horizontalAlign:r,verticalAlign:t}}function zte(e,r,t){let i=r.getMaxScale()*24,{maxImageWidth:a,maxImageHeight:o}=r.getMaxImageSize(e),s=Math.max(i,o*t);return{verticalLineContentWidth:Math.max(i,a*t),horizontalLineContentHeight:s}}function _F(e){switch(e){case"top":return 0;case"center":return .5;default:return 1}}function Bte(e,r,t,i){var a;if(e?.rect)return e;let o=(a=r[t.fontStack])==null?void 0:a[i];return o?{rect:null,metrics:o.metrics}:null}function Ote(e,r,t){return!(e===1||!r&&!sx(t)||r&&(U6(t)||sF(t)))}function hx(e){return new RegExp("\\p{Nd}","u").test(String.fromCodePoint(e))}function xF(e){return new RegExp("\\p{Lu}","u").test(String.fromCodePoint(e))}function Nte(e){return/[\p{P}\p{S}]/u.test(String.fromCodePoint(e))}function jte(e){let r=e.some(hx)&&e.every(i=>hx(i)||Nte(i)),t=e.length<=3&&e.every(i=>xF(i)||hx(i));return r||t}function Ute(e){return(hx(e)||xF(e))&&!sF(e)}function qte(e,r){let t=!1;for(let i=0;io.codePointAt(0)),i=t.map(sx),a=o=>!i[o]&&!U6(t[o])&&!("imageName"in e.getSection(o));for(let o=0;of){let h=Math.ceil(o/f);a*=h/s,s=h}return{x1:i,y1:a,x2:i+o,y2:a+s}}function wF(e,r,t,i,a,o){let s=e.image,l;if(s.content){let m=s.content,y=s.pixelRatio||1;l=[m[0]/y,m[1]/y,s.displaySize[0]-m[2]/y,s.displaySize[1]-m[3]/y]}let n=r.left*o,u=r.right*o,c,f,h,d;t==="width"||t==="both"?(d=a[0]+n-i[3],f=a[0]+u+i[1]):(d=a[0]+(n+u-s.displaySize[0])/2,f=d+s.displaySize[0]);let p=r.top*o,g=r.bottom*o;return t==="height"||t==="both"?(c=a[1]+p-i[0],h=a[1]+g+i[2]):(c=a[1]+(p+g-s.displaySize[1])/2,h=c+s.displaySize[1]),{image:s,top:c,right:f,bottom:h,left:d,collisionPadding:l}}function TF(e,r){let{expression:t}=r;if(t.kind==="constant")return{kind:"constant",layoutSize:t.evaluate(new ns(e+1))};if(t.kind==="source")return{kind:"source"};if(t.kind==="composite"){let{minZoom:i,maxZoom:a}=Zte(t.zoomStops,e);return{kind:"composite",minZoom:i,maxZoom:a,interpolationType:t.interpolationType}}{let i=Kte(t),a=t.evaluate(new ns(e+1));return{kind:"camera",zoomStops:t.zoomStops,sizes:i,layoutSize:a,interpolationType:t.interpolationType}}}function Zte(e,r){let t=0;for(;te.evaluate(new ns(r===-1/0?e.zoomStops[1]-1:r)))}function G6(e,{uSize:r,uSizeT:t},{lowerSize:i,upperSize:a}){return e.kind==="source"?i/128:e.kind==="composite"?Zs.number(i/128,a/128,t):r}function dx(e,r){let t=0,i=0;return e.kind==="constant"?i=e.layoutSize:e.kind==="camera"?i=Jte(e,r):e.kind==="composite"&&(t=Qte(e,r)),{uSizeT:t,uSize:i}}function Jte({zoomStops:e,sizes:r,layoutSize:t,interpolationType:i},a){let o=e.length-1;for(;o>0&&e[o]>a;)o--;let s=Math.min(o+1,e.length-1),l=i?to(Rf.interpolationFactor(i,a,e[o],e[s]),0,1):0;return Math.min(Zs.number(r[o],r[s],l),t)}function Qte({interpolationType:e,minZoom:r,maxZoom:t},i){return e?to(Rf.interpolationFactor(e,i,r,t),0,1):0}function AF(e,r,t,i,a){if(r.segment===void 0||t===0)return!0;let o=r,s=r.segment+1,l=0;for(;l>-t/2;){if(s--,s<0)return!1;l-=e[s].dist(o),o=e[s]}l+=e[s].dist(e[s+1]),s++;let n=[],u=0;for(;li;)u-=n.shift().angleDelta;if(u>a)return!1;s++,l+=f.dist(h)}return!0}function MF(e){let r=0;for(let t=0;tu){let p=(u-n)/d,g=new Z0(Zs.number(f.x,h.x,p),Zs.number(f.y,h.y,p),h.angleTo(f),c);return g._round(),!s||AF(e,g,l,s,r)?g:void 0}n+=d}}function tre(e,r,t,i,a,o,s,l,n){let u=SF(i,o,s),c=EF(i,a),f=c*s,h=e[0].x===0||e[0].x===n||e[0].y===0||e[0].y===n;r-f=0&&x=0&&S=0&&h+u<=c){let M=new Z0(x,S,_,p);M._round(),(!i||AF(e,M,o,i,a))&&d.push(M)}}f+=y}return!l&&!d.length&&!s&&(d=kF(e,f/2,t,i,a,o,s,!0,n)),d}function CF(e,r,t,i,a){let o=[];for(let s of e){let l;for(let n=0;n=i&&c.x>=i)&&(u.x>=i?u=new Wr(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round():c.x>=i&&(c=new Wr(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round()),!(u.y>=a&&c.y>=a)&&(u.y>=a?u=new Wr(u.x+(c.x-u.x)*((a-u.y)/(c.y-u.y)),a)._round():c.y>=a&&(c=new Wr(u.x+(c.x-u.x)*((a-u.y)/(c.y-u.y)),a)._round()),(!l||!u.equals(l[l.length-1]))&&(l=[u],o.push(l)),l.push(c)))))}}return o}function DF(e,r,t,i){let a=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2,n=o.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},c=o.stretchX||[[0,l]],f=o.stretchY||[[0,n]],h=(F,D)=>F+D[1]-D[0],d=c.reduce(h,0),p=f.reduce(h,0),g=l-d,m=n-p,y=0,_=d,v=0,x=p,S=0,M=g,C=0,w=m;if(o.content&&i){let F=o.content,D=F[2]-F[0],R=F[3]-F[1];(o.textFitWidth||o.textFitHeight)&&(u=bF(e)),y=px(c,0,F[0]),v=px(f,0,F[1]),_=px(c,F[0],F[2]),x=px(f,F[1],F[3]),S=F[0]-y,C=F[1]-v,M=D-_,w=R-x}let k=u.x1,A=u.y1,b=u.x2-k,E=u.y2-A,T=(F,D,R,P)=>{let z=vx(F.stretch-y,_,b,k),I=mx(F.fixed-S,M,F.stretch,d),L=vx(D.stretch-v,x,E,A),B=mx(D.fixed-C,w,D.stretch,p),O=vx(R.stretch-y,_,b,k),G=mx(R.fixed-S,M,R.stretch,d),W=vx(P.stretch-v,x,E,A),X=mx(P.fixed-C,w,P.stretch,p),Z=new Wr(z,L),J=new Wr(O,L),N=new Wr(O,W),H=new Wr(z,W),$=new Wr(I/s,B/s),U=new Wr(G/s,X/s),V=r*Math.PI/180;if(V){let te=Math.sin(V),ne=Math.cos(V),se=[ne,-te,te,ne];Z._matMult(se),J._matMult(se),H._matMult(se),N._matMult(se)}let j=F.stretch+F.fixed,q=R.stretch+R.fixed,Y=D.stretch+D.fixed,K=P.stretch+P.fixed;return{tl:Z,tr:J,bl:H,br:N,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+Y,w:q-j,h:K-Y},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:$,pixelOffsetBR:U,minFontScaleX:M/s/b,minFontScaleY:w/s/E,isSDF:t}};if(!i||!o.stretchX&&!o.stretchY)a.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:n+1}));else{let F=LF(c,g,d),D=LF(f,m,p);for(let R=0;Rf.d||!f.d)&&(f=h),!(h.max-f.d<=r)&&(a=h.h/2,o.push(new K0(h.p.x-a,h.p.y-a,a,e)),o.push(new K0(h.p.x+a,h.p.y-a,a,e)),o.push(new K0(h.p.x-a,h.p.y+a,a,e)),o.push(new K0(h.p.x+a,h.p.y+a,a,e)))}return c.d>0&&f.d-c.d<=r?c.p:f.p}function are(e,r){return r.max-e.max}function nre(e,r){let t=!1,i=1/0;for(let a of r)for(let o=0,s=a.length,l=s-1;oe.y!=u.y>e.y&&e.x<(u.x-n.x)*(e.y-n.y)/(u.y-n.y)+n.x&&(t=!t),i=Math.min(i,RL(e,n,u))}return(t?1:-1)*Math.sqrt(i)}function ore(e){let r=0,t=0,i=0,a=e[0];for(let o=0,s=a.length,l=s-1;oh*24);c.startsWith("top")?f[1]-=7:c.startsWith("bottom")&&(f[1]+=7),n[u+1]=f}return new Zh(n)}let s=a.get("text-variable-anchor");if(s){let l;l=e._unevaluatedLayout.getValue("text-radial-offset")===void 0?a.get("text-offset").evaluate(r,{},t).map(u=>u*24):[a.get("text-radial-offset").evaluate(r,{},t)*24,Rb];let n=[];for(let u of s)n.push(u,FF(u,l));return new Zh(n)}return null}function sre(e){var r,t;e.bucket.createArrays();let i=512*e.bucket.overscaling;e.bucket.tilePixelRatio=Bi/i,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let a=e.bucket.layers[0],o=a.layout,s=a._unevaluatedLayout._values,l={layoutIconSize:s["icon-size"].possiblyEvaluate(new ns(e.bucket.zoom+1),e.canonical),layoutTextSize:s["text-size"].possiblyEvaluate(new ns(e.bucket.zoom+1),e.canonical),textMaxSize:s["text-size"].possiblyEvaluate(new ns(18))};if(e.bucket.textSizeData.kind==="composite"){let{minZoom:h,maxZoom:d}=e.bucket.textSizeData;l.compositeTextSizes=[s["text-size"].possiblyEvaluate(new ns(h),e.canonical),s["text-size"].possiblyEvaluate(new ns(d),e.canonical)]}if(e.bucket.iconSizeData.kind==="composite"){let{minZoom:h,maxZoom:d}=e.bucket.iconSizeData;l.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new ns(h),e.canonical),s["icon-size"].possiblyEvaluate(new ns(d),e.canonical)]}let n=o.get("text-line-height")*24,u=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point",c=o.get("text-keep-upright"),f=o.get("text-size");for(let h of e.bucket.features){let d=o.get("text-font").evaluate(h,{},e.canonical).join(","),p=f.evaluate(h,{},e.canonical),g=l.layoutTextSize.evaluate(h,{},e.canonical),m=l.layoutIconSize.evaluate(h,{},e.canonical),y={horizontal:{},vertical:void 0},_=h.text,v=[0,0];if(_){let C=_.toString(),w=o.get("text-letter-spacing").evaluate(h,{},e.canonical)*24,k=ute(C)?w:0,A=o.get("text-anchor").evaluate(h,{},e.canonical),b=PF(a,h,e.canonical);if(!b){let D=o.get("text-radial-offset").evaluate(h,{},e.canonical);v=D?FF(A,[D*24,Rb]):o.get("text-offset").evaluate(h,{},e.canonical).map(R=>R*24)}let E=u?"center":o.get("text-justify").evaluate(h,{},e.canonical),T=o.get("symbol-placement")==="point"?o.get("text-max-width").evaluate(h,{},e.canonical)*24:1/0,F=()=>{e.bucket.allowVerticalPlacement&&q6(C)&&(y.vertical=cx(_,e.glyphMap,e.glyphPositions,e.imagePositions,d,T,n,A,"left",k,v,2,!0,g,p))};if(!u&&b){let D=new Set;if(E==="auto")for(let P=0;P{P.x<0||P.x>=8192||P.y<0||P.y>=8192||cre(e,P,R,t,i,a,T,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,y,[S,S,S,S],w,n,v,M,k,p,r,o,u,c,s)};if(A==="line")for(let R of CF(r.geometry,0,0,Bi,Bi)){let P=U0(R,F),z=tre(P,x,C,t.vertical||g,i,24,_,e.overscaling,Bi);for(let I of z){let L=g;(!L||!fre(e,L.text,b,I))&&D(P,I)}}else if(A==="line-center"){for(let R of r.geometry)if(R.length>1){let P=U0(R,F),z=ere(P,C,t.vertical||g,i,24,_);z&&D(P,z)}}else if(r.type==="Polygon")for(let R of z_(r.geometry,0)){let P=ire(R,16);D(U0(R[0],F,!0),new Z0(P.x,P.y,0))}else if(r.type==="LineString")for(let R of r.geometry){let P=U0(R,F);D(P,new Z0(P[0].x,P[0].y,0))}else if(r.type==="Point")for(let R of r.geometry)for(let P of R)D([P],new Z0(P.x,P.y,0))}function ure(e,r){let t=e.length,i=r?.values;if(i?.length>0)for(let a=0;a32640&&To(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):y.kind==="composite"&&(_=[128*p.compositeTextSizes[0].evaluate(s,{},g),128*p.compositeTextSizes[1].evaluate(s,{},g)],(_[0]>32640||_[1]>32640)&&To(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,m,_,l,o,s,c,r,u.lineStartIndex,u.lineLength,d,g,n);for(let v of f)h[v]=e.text.placedSymbolArray.length-1;return m.length*4}function RF(e){for(let r in e)return e[r];return null}function cre(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S,M,C,w){let k=e.addToLineVertexArray(r,t),A=l.layout.get("symbol-height-offset").evaluate(x,{},C);A>e.maxHeightOffset&&(e.maxHeightOffset=A);let b,E,T,F,D=0,R=0,P=0,z=0,I=-1,L=-1,B={},O=(0,hb.default)("");if(e.allowVerticalPlacement&&i.vertical){let ne=l.layout.get("text-rotate").evaluate(x,{},C)+90,se=i.vertical;T=new Pg(n,r,u,c,f,se,h,d,p,ne),s&&(F=new Pg(n,r,u,c,f,s,m,y,p,ne))}if(a){let ne=l.layout.get("icon-rotate").evaluate(x,{}),se=l.layout.get("icon-text-fit")!=="none",le=DF(a,ne,M,se),ce=s?DF(s,ne,M,se):void 0;E=new Pg(n,r,u,c,f,a,m,y,!1,ne),D=le.length*4;let pe=e.iconSizeData,xe=null;pe.kind==="source"?(xe=[128*l.layout.get("icon-size").evaluate(x,{})],xe[0]>32640&&To(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):pe.kind==="composite"&&(xe=[128*S.compositeIconSizes[0].evaluate(x,{},C),128*S.compositeIconSizes[1].evaluate(x,{},C)],(xe[0]>32640||xe[1]>32640)&&To(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,le,xe,v,_,x,0,r,k.lineStartIndex,k.lineLength,-1,C,A),I=e.icon.placedSymbolArray.length-1,ce&&(R=ce.length*4,e.addSymbols(e.icon,ce,xe,v,_,x,2,r,k.lineStartIndex,k.lineLength,-1,C,A),L=e.icon.placedSymbolArray.length-1)}let G=Object.keys(i.horizontal);for(let ne of G){let se=i.horizontal[ne];b||(b=(O=(0,hb.default)(se.text),new Pg(n,r,u,c,f,se,h,d,p,l.layout.get("text-rotate").evaluate(x,{},C))));let le=se.positionedLines.length===1;if(P+=IF(e,r,se,o,l,p,x,g,A,k,i.vertical?1:3,le?G:[ne],B,I,S,C),le)break}i.vertical&&(z+=IF(e,r,i.vertical,o,l,p,x,g,A,k,2,["vertical"],B,L,S,C));let W=b?b.boxStartIndex:e.collisionBoxArray.length,X=b?b.boxEndIndex:e.collisionBoxArray.length,Z=T?T.boxStartIndex:e.collisionBoxArray.length,J=T?T.boxEndIndex:e.collisionBoxArray.length,N=E?E.boxStartIndex:e.collisionBoxArray.length,H=E?E.boxEndIndex:e.collisionBoxArray.length,$=F?F.boxStartIndex:e.collisionBoxArray.length,U=F?F.boxEndIndex:e.collisionBoxArray.length,V=-1,j=(ne,se)=>ne?.circleDiameter?Math.max(ne.circleDiameter,se):se;V=j(b,V),V=j(T,V),V=j(E,V),V=j(F,V);let q=+(V>-1);q&&(V*=w/24),e.glyphOffsetArray.length>=e.maxGlyphs&&To("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),x.sortKey!==void 0&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey);let Y=PF(l,x,C),[K,te]=ure(e.textAnchorOffsets,Y);e.symbolInstances.emplaceBack(r.x,r.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,I,L,O,W,X,Z,J,N,H,$,U,u,P,z,D,R,q,0,h,V,K,te,A)}function fre(e,r,t,i){let a=e.compareText;if(!(r in a))a[r]=[];else{let o=a[r];for(let s=o.length-1;s>=0;s--)if(i.dist(o[s])e&&i in e?String(e[i]):"")}function pre(e,r,t,i=1){var a;let o=(a=e.get("icon-padding").evaluate(r,{},t))==null?void 0:a.values;return[o[0]*i,o[1]*i,o[2]*i,o[3]*i]}function vre(e){let r=[],t=e.id;return t===void 0&&r.push(new na(`layers.${t}`,null,'missing required property "id"')),e.render===void 0&&r.push(new na(`layers.${t}`,null,'missing required method "render"')),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&r.push(new na(`layers.${t}`,null,'property "renderingMode" must be either "2d" or "3d"')),r}function $6(e,r){if(e.type==="custom")return new n5(e,r);switch(e.type){case"background":return new i5(e,r);case"circle":return new zI(e,r);case"color-relief":return new JI(e,r);case"fill":return new sR(e,r);case"fill-extrusion":return new _R(e,r);case"heatmap":return new UI(e,r);case"hillshade":return new $I(e,r);case"line":return new LR(e,r);case"raster":return new lI(e,r);case"symbol":return new JR(e,r)}}function mre(e,r,t){return!(e<0||e>25||t<0||t>=2**e||r<0||r>=2**e)}function zF(e,r){let{x:t,y:i}=Qo.fromLngLat(r);return!(e<0||e>25||i<0||i>=1||t<0||t>=1)}function cm(e,r,t,i,a){e*=2,e<0&&(e=e*-1-1);let o=1<0;a--){let o=1<>>0;return((r&255)<<24|(r&65280)<<8|r>>>8&65280|r>>>24&255)>>>0}function wre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0;t[a++]=o>>>0&3,t[a++]=o>>>2&3,t[a++]=o>>>4&3,t[a++]=o>>>6&3,t[a++]=o>>>8&3,t[a++]=o>>>10&3,t[a++]=o>>>12&3,t[a++]=o>>>14&3,t[a++]=o>>>16&3,t[a++]=o>>>18&3,t[a++]=o>>>20&3,t[a++]=o>>>22&3,t[a++]=o>>>24&3,t[a++]=o>>>26&3,t[a++]=o>>>28&3,t[a++]=o>>>30&3,t[a++]=s>>>0&3,t[a++]=s>>>2&3,t[a++]=s>>>4&3,t[a++]=s>>>6&3,t[a++]=s>>>8&3,t[a++]=s>>>10&3,t[a++]=s>>>12&3,t[a++]=s>>>14&3,t[a++]=s>>>16&3,t[a++]=s>>>18&3,t[a++]=s>>>20&3,t[a++]=s>>>22&3,t[a++]=s>>>24&3,t[a++]=s>>>26&3,t[a++]=s>>>28&3,t[a]=s>>>30&3}function Tre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0;t[a++]=o>>>0&7,t[a++]=o>>>3&7,t[a++]=o>>>6&7,t[a++]=o>>>9&7,t[a++]=o>>>12&7,t[a++]=o>>>15&7,t[a++]=o>>>18&7,t[a++]=o>>>21&7,t[a++]=o>>>24&7,t[a++]=o>>>27&7,t[a++]=(o>>>30|(s&1)<<2)&7,t[a++]=s>>>1&7,t[a++]=s>>>4&7,t[a++]=s>>>7&7,t[a++]=s>>>10&7,t[a++]=s>>>13&7,t[a++]=s>>>16&7,t[a++]=s>>>19&7,t[a++]=s>>>22&7,t[a++]=s>>>25&7,t[a++]=s>>>28&7,t[a++]=(s>>>31|(l&3)<<1)&7,t[a++]=l>>>2&7,t[a++]=l>>>5&7,t[a++]=l>>>8&7,t[a++]=l>>>11&7,t[a++]=l>>>14&7,t[a++]=l>>>17&7,t[a++]=l>>>20&7,t[a++]=l>>>23&7,t[a++]=l>>>26&7,t[a]=l>>>29&7}function Are(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0;t[a++]=o>>>0&15,t[a++]=o>>>4&15,t[a++]=o>>>8&15,t[a++]=o>>>12&15,t[a++]=o>>>16&15,t[a++]=o>>>20&15,t[a++]=o>>>24&15,t[a++]=o>>>28&15,t[a++]=s>>>0&15,t[a++]=s>>>4&15,t[a++]=s>>>8&15,t[a++]=s>>>12&15,t[a++]=s>>>16&15,t[a++]=s>>>20&15,t[a++]=s>>>24&15,t[a++]=s>>>28&15,t[a++]=l>>>0&15,t[a++]=l>>>4&15,t[a++]=l>>>8&15,t[a++]=l>>>12&15,t[a++]=l>>>16&15,t[a++]=l>>>20&15,t[a++]=l>>>24&15,t[a++]=l>>>28&15,t[a++]=n>>>0&15,t[a++]=n>>>4&15,t[a++]=n>>>8&15,t[a++]=n>>>12&15,t[a++]=n>>>16&15,t[a++]=n>>>20&15,t[a++]=n>>>24&15,t[a]=n>>>28&15}function Mre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0;t[a++]=o>>>0&31,t[a++]=o>>>5&31,t[a++]=o>>>10&31,t[a++]=o>>>15&31,t[a++]=o>>>20&31,t[a++]=o>>>25&31,t[a++]=(o>>>30|(s&7)<<2)&31,t[a++]=s>>>3&31,t[a++]=s>>>8&31,t[a++]=s>>>13&31,t[a++]=s>>>18&31,t[a++]=s>>>23&31,t[a++]=(s>>>28|(l&1)<<4)&31,t[a++]=l>>>1&31,t[a++]=l>>>6&31,t[a++]=l>>>11&31,t[a++]=l>>>16&31,t[a++]=l>>>21&31,t[a++]=l>>>26&31,t[a++]=(l>>>31|(n&15)<<1)&31,t[a++]=n>>>4&31,t[a++]=n>>>9&31,t[a++]=n>>>14&31,t[a++]=n>>>19&31,t[a++]=n>>>24&31,t[a++]=(n>>>29|(u&3)<<3)&31,t[a++]=u>>>2&31,t[a++]=u>>>7&31,t[a++]=u>>>12&31,t[a++]=u>>>17&31,t[a++]=u>>>22&31,t[a]=u>>>27&31}function Sre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0;t[a++]=o>>>0&63,t[a++]=o>>>6&63,t[a++]=o>>>12&63,t[a++]=o>>>18&63,t[a++]=o>>>24&63,t[a++]=(o>>>30|(s&15)<<2)&63,t[a++]=s>>>4&63,t[a++]=s>>>10&63,t[a++]=s>>>16&63,t[a++]=s>>>22&63,t[a++]=(s>>>28|(l&3)<<4)&63,t[a++]=l>>>2&63,t[a++]=l>>>8&63,t[a++]=l>>>14&63,t[a++]=l>>>20&63,t[a++]=l>>>26&63,t[a++]=n>>>0&63,t[a++]=n>>>6&63,t[a++]=n>>>12&63,t[a++]=n>>>18&63,t[a++]=n>>>24&63,t[a++]=(n>>>30|(u&15)<<2)&63,t[a++]=u>>>4&63,t[a++]=u>>>10&63,t[a++]=u>>>16&63,t[a++]=u>>>22&63,t[a++]=(u>>>28|(c&3)<<4)&63,t[a++]=c>>>2&63,t[a++]=c>>>8&63,t[a++]=c>>>14&63,t[a++]=c>>>20&63,t[a]=c>>>26&63}function Ere(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0;t[a++]=o>>>0&127,t[a++]=o>>>7&127,t[a++]=o>>>14&127,t[a++]=o>>>21&127,t[a++]=(o>>>28|(s&7)<<4)&127,t[a++]=s>>>3&127,t[a++]=s>>>10&127,t[a++]=s>>>17&127,t[a++]=s>>>24&127,t[a++]=(s>>>31|(l&63)<<1)&127,t[a++]=l>>>6&127,t[a++]=l>>>13&127,t[a++]=l>>>20&127,t[a++]=(l>>>27|(n&3)<<5)&127,t[a++]=n>>>2&127,t[a++]=n>>>9&127,t[a++]=n>>>16&127,t[a++]=n>>>23&127,t[a++]=(n>>>30|(u&31)<<2)&127,t[a++]=u>>>5&127,t[a++]=u>>>12&127,t[a++]=u>>>19&127,t[a++]=(u>>>26|(c&1)<<6)&127,t[a++]=c>>>1&127,t[a++]=c>>>8&127,t[a++]=c>>>15&127,t[a++]=c>>>22&127,t[a++]=(c>>>29|(f&15)<<3)&127,t[a++]=f>>>4&127,t[a++]=f>>>11&127,t[a++]=f>>>18&127,t[a]=f>>>25&127}function kre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0;t[a++]=o>>>0&255,t[a++]=o>>>8&255,t[a++]=o>>>16&255,t[a++]=o>>>24&255,t[a++]=s>>>0&255,t[a++]=s>>>8&255,t[a++]=s>>>16&255,t[a++]=s>>>24&255,t[a++]=l>>>0&255,t[a++]=l>>>8&255,t[a++]=l>>>16&255,t[a++]=l>>>24&255,t[a++]=n>>>0&255,t[a++]=n>>>8&255,t[a++]=n>>>16&255,t[a++]=n>>>24&255,t[a++]=u>>>0&255,t[a++]=u>>>8&255,t[a++]=u>>>16&255,t[a++]=u>>>24&255,t[a++]=c>>>0&255,t[a++]=c>>>8&255,t[a++]=c>>>16&255,t[a++]=c>>>24&255,t[a++]=f>>>0&255,t[a++]=f>>>8&255,t[a++]=f>>>16&255,t[a++]=f>>>24&255,t[a++]=h>>>0&255,t[a++]=h>>>8&255,t[a++]=h>>>16&255,t[a]=h>>>24&255}function Cre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0;t[a++]=o>>>0&511,t[a++]=o>>>9&511,t[a++]=o>>>18&511,t[a++]=(o>>>27|(s&15)<<5)&511,t[a++]=s>>>4&511,t[a++]=s>>>13&511,t[a++]=s>>>22&511,t[a++]=(s>>>31|(l&255)<<1)&511,t[a++]=l>>>8&511,t[a++]=l>>>17&511,t[a++]=(l>>>26|(n&7)<<6)&511,t[a++]=n>>>3&511,t[a++]=n>>>12&511,t[a++]=n>>>21&511,t[a++]=(n>>>30|(u&127)<<2)&511,t[a++]=u>>>7&511,t[a++]=u>>>16&511,t[a++]=(u>>>25|(c&3)<<7)&511,t[a++]=c>>>2&511,t[a++]=c>>>11&511,t[a++]=c>>>20&511,t[a++]=(c>>>29|(f&63)<<3)&511,t[a++]=f>>>6&511,t[a++]=f>>>15&511,t[a++]=(f>>>24|(h&1)<<8)&511,t[a++]=h>>>1&511,t[a++]=h>>>10&511,t[a++]=h>>>19&511,t[a++]=(h>>>28|(d&31)<<4)&511,t[a++]=d>>>5&511,t[a++]=d>>>14&511,t[a]=d>>>23&511}function Dre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0,p=e[r+9]>>>0;t[a++]=o>>>0&1023,t[a++]=o>>>10&1023,t[a++]=o>>>20&1023,t[a++]=(o>>>30|(s&255)<<2)&1023,t[a++]=s>>>8&1023,t[a++]=s>>>18&1023,t[a++]=(s>>>28|(l&63)<<4)&1023,t[a++]=l>>>6&1023,t[a++]=l>>>16&1023,t[a++]=(l>>>26|(n&15)<<6)&1023,t[a++]=n>>>4&1023,t[a++]=n>>>14&1023,t[a++]=(n>>>24|(u&3)<<8)&1023,t[a++]=u>>>2&1023,t[a++]=u>>>12&1023,t[a++]=u>>>22&1023,t[a++]=c>>>0&1023,t[a++]=c>>>10&1023,t[a++]=c>>>20&1023,t[a++]=(c>>>30|(f&255)<<2)&1023,t[a++]=f>>>8&1023,t[a++]=f>>>18&1023,t[a++]=(f>>>28|(h&63)<<4)&1023,t[a++]=h>>>6&1023,t[a++]=h>>>16&1023,t[a++]=(h>>>26|(d&15)<<6)&1023,t[a++]=d>>>4&1023,t[a++]=d>>>14&1023,t[a++]=(d>>>24|(p&3)<<8)&1023,t[a++]=p>>>2&1023,t[a++]=p>>>12&1023,t[a]=p>>>22&1023}function Lre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0,p=e[r+9]>>>0,g=e[r+10]>>>0;t[a++]=o>>>0&2047,t[a++]=o>>>11&2047,t[a++]=(o>>>22|(s&1)<<10)&2047,t[a++]=s>>>1&2047,t[a++]=s>>>12&2047,t[a++]=(s>>>23|(l&3)<<9)&2047,t[a++]=l>>>2&2047,t[a++]=l>>>13&2047,t[a++]=(l>>>24|(n&7)<<8)&2047,t[a++]=n>>>3&2047,t[a++]=n>>>14&2047,t[a++]=(n>>>25|(u&15)<<7)&2047,t[a++]=u>>>4&2047,t[a++]=u>>>15&2047,t[a++]=(u>>>26|(c&31)<<6)&2047,t[a++]=c>>>5&2047,t[a++]=c>>>16&2047,t[a++]=(c>>>27|(f&63)<<5)&2047,t[a++]=f>>>6&2047,t[a++]=f>>>17&2047,t[a++]=(f>>>28|(h&127)<<4)&2047,t[a++]=h>>>7&2047,t[a++]=h>>>18&2047,t[a++]=(h>>>29|(d&255)<<3)&2047,t[a++]=d>>>8&2047,t[a++]=d>>>19&2047,t[a++]=(d>>>30|(p&511)<<2)&2047,t[a++]=p>>>9&2047,t[a++]=p>>>20&2047,t[a++]=(p>>>31|(g&1023)<<1)&2047,t[a++]=g>>>10&2047,t[a]=g>>>21&2047}function Fre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0,p=e[r+9]>>>0,g=e[r+10]>>>0,m=e[r+11]>>>0;t[a++]=o>>>0&4095,t[a++]=o>>>12&4095,t[a++]=(o>>>24|(s&15)<<8)&4095,t[a++]=s>>>4&4095,t[a++]=s>>>16&4095,t[a++]=(s>>>28|(l&255)<<4)&4095,t[a++]=l>>>8&4095,t[a++]=l>>>20&4095,t[a++]=n>>>0&4095,t[a++]=n>>>12&4095,t[a++]=(n>>>24|(u&15)<<8)&4095,t[a++]=u>>>4&4095,t[a++]=u>>>16&4095,t[a++]=(u>>>28|(c&255)<<4)&4095,t[a++]=c>>>8&4095,t[a++]=c>>>20&4095,t[a++]=f>>>0&4095,t[a++]=f>>>12&4095,t[a++]=(f>>>24|(h&15)<<8)&4095,t[a++]=h>>>4&4095,t[a++]=h>>>16&4095,t[a++]=(h>>>28|(d&255)<<4)&4095,t[a++]=d>>>8&4095,t[a++]=d>>>20&4095,t[a++]=p>>>0&4095,t[a++]=p>>>12&4095,t[a++]=(p>>>24|(g&15)<<8)&4095,t[a++]=g>>>4&4095,t[a++]=g>>>16&4095,t[a++]=(g>>>28|(m&255)<<4)&4095,t[a++]=m>>>8&4095,t[a]=m>>>20&4095}function Pre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0,p=e[r+9]>>>0,g=e[r+10]>>>0,m=e[r+11]>>>0,y=e[r+12]>>>0,_=e[r+13]>>>0,v=e[r+14]>>>0,x=e[r+15]>>>0;t[a++]=o>>>0&65535,t[a++]=o>>>16&65535,t[a++]=s>>>0&65535,t[a++]=s>>>16&65535,t[a++]=l>>>0&65535,t[a++]=l>>>16&65535,t[a++]=n>>>0&65535,t[a++]=n>>>16&65535,t[a++]=u>>>0&65535,t[a++]=u>>>16&65535,t[a++]=c>>>0&65535,t[a++]=c>>>16&65535,t[a++]=f>>>0&65535,t[a++]=f>>>16&65535,t[a++]=h>>>0&65535,t[a++]=h>>>16&65535,t[a++]=d>>>0&65535,t[a++]=d>>>16&65535,t[a++]=p>>>0&65535,t[a++]=p>>>16&65535,t[a++]=g>>>0&65535,t[a++]=g>>>16&65535,t[a++]=m>>>0&65535,t[a++]=m>>>16&65535,t[a++]=y>>>0&65535,t[a++]=y>>>16&65535,t[a++]=_>>>0&65535,t[a++]=_>>>16&65535,t[a++]=v>>>0&65535,t[a++]=v>>>16&65535,t[a++]=x>>>0&65535,t[a]=x>>>16&65535}function Ire(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0;t[a++]=l>>>0&1,t[a++]=l>>>1&1,t[a++]=l>>>2&1,t[a++]=l>>>3&1,t[a++]=l>>>4&1,t[a++]=l>>>5&1,t[a++]=l>>>6&1,t[a++]=l>>>7&1,t[a++]=l>>>8&1,t[a++]=l>>>9&1,t[a++]=l>>>10&1,t[a++]=l>>>11&1,t[a++]=l>>>12&1,t[a++]=l>>>13&1,t[a++]=l>>>14&1,t[a++]=l>>>15&1,t[a++]=l>>>16&1,t[a++]=l>>>17&1,t[a++]=l>>>18&1,t[a++]=l>>>19&1,t[a++]=l>>>20&1,t[a++]=l>>>21&1,t[a++]=l>>>22&1,t[a++]=l>>>23&1,t[a++]=l>>>24&1,t[a++]=l>>>25&1,t[a++]=l>>>26&1,t[a++]=l>>>27&1,t[a++]=l>>>28&1,t[a++]=l>>>29&1,t[a++]=l>>>30&1,t[a++]=l>>>31&1}}function Rre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0;t[a++]=l>>>0&3,t[a++]=l>>>2&3,t[a++]=l>>>4&3,t[a++]=l>>>6&3,t[a++]=l>>>8&3,t[a++]=l>>>10&3,t[a++]=l>>>12&3,t[a++]=l>>>14&3,t[a++]=l>>>16&3,t[a++]=l>>>18&3,t[a++]=l>>>20&3,t[a++]=l>>>22&3,t[a++]=l>>>24&3,t[a++]=l>>>26&3,t[a++]=l>>>28&3,t[a++]=l>>>30&3,t[a++]=n>>>0&3,t[a++]=n>>>2&3,t[a++]=n>>>4&3,t[a++]=n>>>6&3,t[a++]=n>>>8&3,t[a++]=n>>>10&3,t[a++]=n>>>12&3,t[a++]=n>>>14&3,t[a++]=n>>>16&3,t[a++]=n>>>18&3,t[a++]=n>>>20&3,t[a++]=n>>>22&3,t[a++]=n>>>24&3,t[a++]=n>>>26&3,t[a++]=n>>>28&3,t[a++]=n>>>30&3}}function zre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0;t[a++]=l>>>0&7,t[a++]=l>>>3&7,t[a++]=l>>>6&7,t[a++]=l>>>9&7,t[a++]=l>>>12&7,t[a++]=l>>>15&7,t[a++]=l>>>18&7,t[a++]=l>>>21&7,t[a++]=l>>>24&7,t[a++]=l>>>27&7,t[a++]=(l>>>30|(n&1)<<2)&7,t[a++]=n>>>1&7,t[a++]=n>>>4&7,t[a++]=n>>>7&7,t[a++]=n>>>10&7,t[a++]=n>>>13&7,t[a++]=n>>>16&7,t[a++]=n>>>19&7,t[a++]=n>>>22&7,t[a++]=n>>>25&7,t[a++]=n>>>28&7,t[a++]=(n>>>31|(u&3)<<1)&7,t[a++]=u>>>2&7,t[a++]=u>>>5&7,t[a++]=u>>>8&7,t[a++]=u>>>11&7,t[a++]=u>>>14&7,t[a++]=u>>>17&7,t[a++]=u>>>20&7,t[a++]=u>>>23&7,t[a++]=u>>>26&7,t[a++]=u>>>29&7}}function Bre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0;t[a++]=l>>>0&15,t[a++]=l>>>4&15,t[a++]=l>>>8&15,t[a++]=l>>>12&15,t[a++]=l>>>16&15,t[a++]=l>>>20&15,t[a++]=l>>>24&15,t[a++]=l>>>28&15,t[a++]=n>>>0&15,t[a++]=n>>>4&15,t[a++]=n>>>8&15,t[a++]=n>>>12&15,t[a++]=n>>>16&15,t[a++]=n>>>20&15,t[a++]=n>>>24&15,t[a++]=n>>>28&15,t[a++]=u>>>0&15,t[a++]=u>>>4&15,t[a++]=u>>>8&15,t[a++]=u>>>12&15,t[a++]=u>>>16&15,t[a++]=u>>>20&15,t[a++]=u>>>24&15,t[a++]=u>>>28&15,t[a++]=c>>>0&15,t[a++]=c>>>4&15,t[a++]=c>>>8&15,t[a++]=c>>>12&15,t[a++]=c>>>16&15,t[a++]=c>>>20&15,t[a++]=c>>>24&15,t[a++]=c>>>28&15}}function Ore(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0,f=e[o++]>>>0;t[a++]=l>>>0&31,t[a++]=l>>>5&31,t[a++]=l>>>10&31,t[a++]=l>>>15&31,t[a++]=l>>>20&31,t[a++]=l>>>25&31,t[a++]=(l>>>30|(n&7)<<2)&31,t[a++]=n>>>3&31,t[a++]=n>>>8&31,t[a++]=n>>>13&31,t[a++]=n>>>18&31,t[a++]=n>>>23&31,t[a++]=(n>>>28|(u&1)<<4)&31,t[a++]=u>>>1&31,t[a++]=u>>>6&31,t[a++]=u>>>11&31,t[a++]=u>>>16&31,t[a++]=u>>>21&31,t[a++]=u>>>26&31,t[a++]=(u>>>31|(c&15)<<1)&31,t[a++]=c>>>4&31,t[a++]=c>>>9&31,t[a++]=c>>>14&31,t[a++]=c>>>19&31,t[a++]=c>>>24&31,t[a++]=(c>>>29|(f&3)<<3)&31,t[a++]=f>>>2&31,t[a++]=f>>>7&31,t[a++]=f>>>12&31,t[a++]=f>>>17&31,t[a++]=f>>>22&31,t[a++]=f>>>27&31}}function Nre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0,f=e[o++]>>>0,h=e[o++]>>>0;t[a++]=l>>>0&63,t[a++]=l>>>6&63,t[a++]=l>>>12&63,t[a++]=l>>>18&63,t[a++]=l>>>24&63,t[a++]=(l>>>30|(n&15)<<2)&63,t[a++]=n>>>4&63,t[a++]=n>>>10&63,t[a++]=n>>>16&63,t[a++]=n>>>22&63,t[a++]=(n>>>28|(u&3)<<4)&63,t[a++]=u>>>2&63,t[a++]=u>>>8&63,t[a++]=u>>>14&63,t[a++]=u>>>20&63,t[a++]=u>>>26&63,t[a++]=c>>>0&63,t[a++]=c>>>6&63,t[a++]=c>>>12&63,t[a++]=c>>>18&63,t[a++]=c>>>24&63,t[a++]=(c>>>30|(f&15)<<2)&63,t[a++]=f>>>4&63,t[a++]=f>>>10&63,t[a++]=f>>>16&63,t[a++]=f>>>22&63,t[a++]=(f>>>28|(h&3)<<4)&63,t[a++]=h>>>2&63,t[a++]=h>>>8&63,t[a++]=h>>>14&63,t[a++]=h>>>20&63,t[a++]=h>>>26&63}}function jre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0,f=e[o++]>>>0,h=e[o++]>>>0,d=e[o++]>>>0;t[a++]=l>>>0&127,t[a++]=l>>>7&127,t[a++]=l>>>14&127,t[a++]=l>>>21&127,t[a++]=(l>>>28|(n&7)<<4)&127,t[a++]=n>>>3&127,t[a++]=n>>>10&127,t[a++]=n>>>17&127,t[a++]=n>>>24&127,t[a++]=(n>>>31|(u&63)<<1)&127,t[a++]=u>>>6&127,t[a++]=u>>>13&127,t[a++]=u>>>20&127,t[a++]=(u>>>27|(c&3)<<5)&127,t[a++]=c>>>2&127,t[a++]=c>>>9&127,t[a++]=c>>>16&127,t[a++]=c>>>23&127,t[a++]=(c>>>30|(f&31)<<2)&127,t[a++]=f>>>5&127,t[a++]=f>>>12&127,t[a++]=f>>>19&127,t[a++]=(f>>>26|(h&1)<<6)&127,t[a++]=h>>>1&127,t[a++]=h>>>8&127,t[a++]=h>>>15&127,t[a++]=h>>>22&127,t[a++]=(h>>>29|(d&15)<<3)&127,t[a++]=d>>>4&127,t[a++]=d>>>11&127,t[a++]=d>>>18&127,t[a++]=d>>>25&127}}function Ure(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0,f=e[o++]>>>0,h=e[o++]>>>0,d=e[o++]>>>0,p=e[o++]>>>0;t[a++]=l>>>0&255,t[a++]=l>>>8&255,t[a++]=l>>>16&255,t[a++]=l>>>24&255,t[a++]=n>>>0&255,t[a++]=n>>>8&255,t[a++]=n>>>16&255,t[a++]=n>>>24&255,t[a++]=u>>>0&255,t[a++]=u>>>8&255,t[a++]=u>>>16&255,t[a++]=u>>>24&255,t[a++]=c>>>0&255,t[a++]=c>>>8&255,t[a++]=c>>>16&255,t[a++]=c>>>24&255,t[a++]=f>>>0&255,t[a++]=f>>>8&255,t[a++]=f>>>16&255,t[a++]=f>>>24&255,t[a++]=h>>>0&255,t[a++]=h>>>8&255,t[a++]=h>>>16&255,t[a++]=h>>>24&255,t[a++]=d>>>0&255,t[a++]=d>>>8&255,t[a++]=d>>>16&255,t[a++]=d>>>24&255,t[a++]=p>>>0&255,t[a++]=p>>>8&255,t[a++]=p>>>16&255,t[a++]=p>>>24&255}}function qre(e,r,t,i){let a=i,o=r;for(let s=0;s<128;s++){let l=e[o++]>>>0;t[a++]=l&65535,t[a++]=l>>>16&65535}}function Vre(e,r,t,i,a){let o=Hb[a]>>>0,s=r,l=0,n=e[s]>>>0,u=i;for(let c=0;c<8;c++){for(let f=0;f<32;f++)if(l+a<=32){let h=n>>>l&o;t[u+f]=h|0,l+=a,l===32&&(l=0,s++,f!==31&&(n=e[s]>>>0))}else{let h=32-l,d=n>>>l;s++,n=e[s]>>>0;let p=a-h,g=-1>>>32-p>>>0,m=(d|(n&g)<>>0)}}function NF(){let e=new Uint8Array(f5);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Gre(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);let r=Math.max(16,e|0);return{encodedWords:new Uint32Array(r),decoderWorkspace:NF()}}function Hre(e,r){if(r<=e.encodedWords.length)return e.encodedWords;let t=new Uint32Array(Math.max(16,r*2));return e.encodedWords=t,t}function $re(e,r,t,i){i.byteContainer.length>>2;if(a.byteOffset&3)for(let l=0;l>>8&255,a[u+2|0]=n>>>16&255,a[u+3|0]=n>>>24&255}else{let l=i.byteContainerI32;(!l||l.buffer!==a.buffer||l.byteOffset!==a.byteOffset||l.length>>2)),l.set(e.subarray(r,r+o))}let s=t&3;if(s>0){let l=e[r+o|0]|0,n=o<<2;for(let u=0;u>>(u<<3)&255}return a}function Wre(e,r,t){let i=e[r++]|0,a=t.dataToBePacked;for(let o=2;o<=32;o=o+1|0){if(!(i>>>o-1&1))continue;if(r>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${o}, streamWordIndex=${r}, needWords=1, availableWords=${e.length-r}, encodedWords=${e.length})`);let s=e[r++]>>>0,l=_re(s),n=s*o+31>>>5;if(r+n>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${o}, size=${s}, streamWordIndex=${r}, needWords=${n}, availableWords=${e.length-r}, encodedWords=${e.length})`);let u=a[o];(!u||u.length>>5)|0,t.exceptionSizes[o]=s}return r}function Yre(e,r,t,i,a){switch(a){case 1:Ire(e,r,t,i);break;case 2:Rre(e,r,t,i);break;case 3:zre(e,r,t,i);break;case 4:Bre(e,r,t,i);break;case 5:Ore(e,r,t,i);break;case 6:Nre(e,r,t,i);break;case 7:jre(e,r,t,i);break;case 8:Ure(e,r,t,i);break;case 16:qre(e,r,t,i);break;default:Vre(e,r,t,i,a)}return r+(a<<3)|0}function Xre(e,r,t,i){if(t+2>r)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${t}, byteSize=${r})`);let a=e[t++],o=e[t++];if(a>32)throw Error(`FastPFOR decode: invalid bitWidth=${a} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:a,exceptionCount:o,bytePosIn:t}}function Zre(e,r,t,i,a,o){if(t+1>r)throw Error(`FastPFOR decode: exception header underflow at block=${o} (need 1 byte for maxBits, bytePos=${t}, byteSize=${r})`);let s=e[t++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${o} (bitWidth=${i}, expected ${i}..32)`);let l=s-i|0;if(l<1||l>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${l} at block=${o} (bitWidth=${i}, maxBits=${s})`);if(t+a>r)throw Error(`FastPFOR decode: exception positions underflow at block=${o} (need=${a}, have=${r-t})`);return{maxBits:s,exceptionBitWidth:l,bytePosIn:t}}function Kre(e,r,t,i,a,o,s,l,n){let{maxBits:u,exceptionBitWidth:c,bytePosIn:f}=Zre(a,o,s,t,i,n);if(s=f,c===1){let m=1<g)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${c} (ptr=${p}, need ${i}, size=${g}) at block ${n}`);for(let m=0;m0&&(f=Kre(a,m,p,g,l,n,f,u,h))}if(c!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${r}, packedStart=${t}, consumedPackedEnd=${c}, expectedPackedEnd=${i}, packedWords=${i-t}, encoded.length=${e.length})`)}function Qre(e,r,t,i,a,o){let s=t|0,l=e[s]|0;if(l<=0||s+l>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${l} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let n=s+1|0,u=s+l|0,c=e[u]>>>0,f=c+3>>>2,h=u+1,d=h+f;if(d>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${c} (metaInts=${f}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${h}) causes bitmapPos=${d} out of bounds (encoded.length=${e.length})`);let p=$re(e,h,c,o),g=c,m=Wre(e,d,o);return o.dataPointers.fill(0),Jre(e,s,n,u,r,i|0,a/256|0,p,g,o),m}function eie(e,r,t,i,a,o){let s=i+W6(a,256),l=i,n=t;for(;l!==s;){let u=Math.min($b,s-l);n=Qre(e,r,n,l,u,o),l=l+u|0}return n}function tie(e,r,t,i,a,o){if(o===0)return r;let s=0,l=r,n=r+t,u=a,c=a,f=a+o,h=0,d=0;for(;l>>s&255;if(s+=8,l+=s>>>5,s&=31,h|=(p&127)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${d}, partial=${h}, decoded=${c-u}/${o}, inPos=${l}, inEnd=${n})`)}if(c!==f)throw Error(`FastPFOR VByte: truncated stream (decoded=${c-u}, expected=${o}, consumedWords=${l-r}/${t}, vbyteStart=${r}, vbyteEnd=${n})`);return l}function rie(e,r,t){let i=0,a=0,o=new Uint32Array(r),s=t??NF();if(e.length>0){let u=e[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(a+u>o.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${a}, alignedLength=${u}, out.length=${o.length})`);i=eie(e,o,i,a,u,s),a=a+u|0}let l=e.length-i|0,n=r-a|0;return tie(e,i,l,o,a,n),o}function iie(e,r,t,i,a){switch(a){case 2:wre(e,r,t,i);return;case 3:Tre(e,r,t,i);return;case 4:Are(e,r,t,i);return;case 5:Mre(e,r,t,i);return;case 6:Sre(e,r,t,i);return;case 7:Ere(e,r,t,i);return;case 8:kre(e,r,t,i);return;case 9:Cre(e,r,t,i);return;case 10:Dre(e,r,t,i);return;case 11:Lre(e,r,t,i);return;case 12:Fre(e,r,t,i);return;case 16:Pre(e,r,t,i);return;case 32:for(let u=0;u<32;u=u+1|0)t[i+u|0]=e[r+u|0]|0;return}let o=Hb[a]>>>0,s=r,l=0,n=e[s]>>>0;for(let u=0;u<32;u++)if(l+a<=32){let c=n>>>l&o;t[i+u]=c|0,l+=a,l===32&&(l=0,s++,u!==31&&(n=e[s]>>>0))}else{let c=32-l,f=n>>>l;s++,n=e[s]>>>0;let h=Hb[a-c]>>>0,d=(f|(n&h)<e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${r}, byteLength=${t}, bytes.length=${e.length})`);let a=Math.floor(t/4),o=t%4!=0,s=o?a+1:a;if(i.length0){let l=e.byteOffset+r;if(l&3)for(let n=0;n=64)throw Error("Varint too long")}return r.set(a),t}function oie(e,r,t){let i=new Float64Array(t);for(let a=0;a>4,a<128||(a=r[t.get()],t.increment(),i|=(a&127)<<3,a<128)||(a=r[t.get()],t.increment(),i|=(a&127)<<10,a<128)||(a=r[t.get()],t.increment(),i|=(a&127)<<17,a<128)||(a=r[t.get()],t.increment(),i|=(a&127)<<24,a<128)||(a=r[t.get()],t.increment(),i|=(a&1)<<31,a<128))return i*4294967296+(e>>>0);throw Error("Expected varint not more than 10 bytes")}function uie(e,r,t,i){return cie(e,r,t,i,Gre(t>>>2))}function cie(e,r,t,i,a){let o=i.get();if(t&3)throw Error(`FastPFOR: invalid encodedByteLength=${t} at offset=${o} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=t>>>2,l=Hre(a,s);aie(e,o,t,l);let n=rie(l.subarray(0,s),r,a.decoderWorkspace);return i.add(t),n}function No(e){return e>>>1^-(e&1)}function Qu(e){return e>>BigInt("1")^-(e&BigInt("1"))}function Gp(e){return e%2==1?(e+1)/-2:e/2}function fie(e){let r=new Int32Array(e.length);for(let t=0;t=4)for(;i=4)for(;i=4)for(;t=4)for(let i=e[0];t=4)for(;i=4)for(;n>>0;for(let t=1;t>>0;return r}function HF(e){let r=new BigUint64Array(e.length);r[0]=BigInt.asUintN(64,Qu(e[0]));for(let t=1;t>>0,r[1]=No(e[1])>>>0;for(let t=2;t>>0,r[t+1]=r[t-1]+No(e[t+1])>>>0;return r}function Sie(e,r,t,i){let a=VF(e,r,t,i);return new Uint32Array(a)}function Eie(e){return e[1]}function kie(e){return No(e[1])}function Cie(e){if(e.length===2){let r=No(e[1]);return[r,r]}return[No(e[2]),No(e[3])]}function Die(e){return e[1]}function Lie(e){return Qu(e[1])}function Fie(e){if(e.length===2){let r=Qu(e[1]);return[r,r]}return[Qu(e[2]),Qu(e[3])]}function Ys(e,r){let t=Rie(e,r);return t.logicalLevelTechnique1===fo.MORTON?Pie(t,e,r):(fo.RLE===t.logicalLevelTechnique1||fo.RLE===t.logicalLevelTechnique2)&&Of.NONE!==t.physicalLevelTechnique?Iie(t,e,r):t}function Pie(e,r,t){let i=Ju(r,t,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:e.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function Iie(e,r,t){let i=Ju(r,t,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function Rie(e,r){let t=e[r.get()],i=h5[t>>4],a={};switch(i){case El.DATA:a={dictionaryType:p5[t&15]};break;case El.OFFSET:a={offsetType:v5[t&15]};break;case El.LENGTH:a={lengthType:m5[t&15]}}r.increment();let o=e[r.get()],s=DA[o>>5],l=DA[o>>2&7],n=d5[o&3];r.increment();let u=Ju(e,r,2),c=u[0],f=u[1];return{physicalStreamType:i,logicalStreamType:a,logicalLevelTechnique1:s,logicalLevelTechnique2:l,physicalLevelTechnique:n,numValues:c,byteLength:f,decompressedCount:c}}function V0(e,r,t){if(!r)return e;let i=r.size(),a=e.constructor,o=new a(i),s=0;for(let l=0;l=s);){let l=e[i.increment()];if(l<=127){let n=l+3,u=e[i.increment()],c=Math.min(o+n,r);a.fill(u,o,c),o=c}else{let n=256-l;for(let u=0;u=12?g5.decode(e.subarray(r,t)):jie(e,r,t)}function jie(e,r,t){let i="",a=r;for(;a239?4:o>223?3:o>191?2:1;if(a+l>t)break;let n,u,c;l===1?o<128&&(s=o):l===2?(n=e[a+1],(n&192)==128&&(s=(o&31)<<6|n&63,s<=127&&(s=null))):l===3?(n=e[a+1],u=e[a+2],(n&192)==128&&(u&192)==128&&(s=(o&15)<<12|(n&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):l===4&&(n=e[a+1],u=e[a+2],c=e[a+3],(n&192)==128&&(u&192)==128&&(c&192)==128&&(s=(o&15)<<18|(n&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,l=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),a+=l}return i}function xx(e,r,t,i,a){return Hie(hm(e,r,t),t,i,a)}function ec(e,r,t,i,a){return $ie(hm(e,r,t),t,i,a)}function $p(e,r,t){return Yie(hm(e,r,t),t)}function hm(e,r,t){let i=t.physicalLevelTechnique;switch(i){case Of.FAST_PFOR:return uie(e,t.numValues,t.byteLength,r);case Of.VARINT:return Ju(e,r,t.numValues);case Of.NONE:return Oie(e,r,t.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function fg(e,r,t){let i=t.physicalLevelTechnique;switch(i){case Of.VARINT:return Y6(e,r,t.numValues);case Of.NONE:return Nie(e,r,t.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Uie(e,r,t){let i=hm(e,r,t);return i.length===1?No(i[0]):kie(i)}function Q6(e,r,t){let i=hm(e,r,t);return i.length===1?t.logicalLevelTechnique1===fo.DELTA?No(i[0]):i[0]:Eie(i)}function XF(e,r,t){return Cie(hm(e,r,t))}function ZF(e,r,t){return Fie(Y6(e,r,t.numValues))}function KF(e,r,t,i){return QF(fg(e,r,t),t,i)}function eT(e,r,t,i){return eP(fg(e,r,t),t,i)}function qie(e,r,t,i){let a=Vie(e,r,t,!1);return i?V0(a,i,0):a}function Vie(e,r,t,i){if(t.physicalLevelTechnique===Of.VARINT)return Wie(oie(e,r,t.numValues),t,i);let a=fg(e,r,t),o=i?QF(a,t):eP(a,t);return Float64Array.from(o,Number)}function Gie(e,r,t){let i=fg(e,r,t);return i.length===1?Qu(i[0]):Lie(i)}function JF(e,r,t){let i=fg(e,r,t);return i.length===1?t.logicalLevelTechnique1===fo.DELTA?Qu(i[0]):i[0]:Die(i)}function Hie(e,r,t,i){let a;switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let o=r;if(!i)return Tie(e,o.runs,o.numRleValues);e=X6(e,o.runs,o.numRleValues),a=UF(e)}else a=UF(e);break;case fo.RLE:a=vie(e,r.runs,r.numRleValues);break;case fo.MORTON:K6(e),a=new Int32Array(e);break;case fo.COMPONENTWISE_DELTA:if(t&&!i)return VF(e,t.scale,t.min,t.max);a=_ie(e);break;case fo.NONE:a=fie(e);break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return i?V0(a,i,0):a}function $ie(e,r,t,i){let a;switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let o=r;a=GF(X6(e,o.runs,o.numRleValues))}else a=GF(e);break;case fo.RLE:a=X6(e,r.runs,r.numRleValues);break;case fo.MORTON:K6(e),a=e;break;case fo.COMPONENTWISE_DELTA:a=t&&!i?Sie(e,t.scale,t.min,t.max):Mie(e);break;case fo.NONE:a=e;break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return i?V0(a,i,0):a}function QF(e,r,t){let i;switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let a=r;if(!t)return Aie(e,a.runs,a.numRleValues);e=Z6(e,a.runs,a.numRleValues),i=qF(e)}else i=qF(e);break;case fo.RLE:i=mie(e,r.runs,r.numRleValues);break;case fo.NONE:i=hie(e);break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return t?V0(i,t,BigInt("0")):i}function eP(e,r,t){let i;switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let a=r;i=HF(Z6(e,a.runs,a.numRleValues))}else i=HF(e);break;case fo.RLE:i=Z6(e,r.runs,r.numRleValues);break;case fo.NONE:i=e;break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return t?V0(i,t,BigInt("0")):i}function Wie(e,r,t){switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let i=r;e=jF(e,i.runs,i.numRleValues)}return pie(e),e;case fo.RLE:return Zie(e,r,t);case fo.NONE:return t&&die(e),e;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}}function Yie(e,r){if(r.logicalLevelTechnique1===fo.DELTA&&r.logicalLevelTechnique2===fo.NONE)return xie(e);if(r.logicalLevelTechnique1===fo.RLE&&r.logicalLevelTechnique2===fo.NONE){let t=r;return wie(e,t.runs,t.numRleValues)}if(r.logicalLevelTechnique1===fo.NONE&&r.logicalLevelTechnique2===fo.NONE){yie(e);let t=new Uint32Array(r.numValues+1);return t[0]=0,t.set(e,1),t}if(r.logicalLevelTechnique1===fo.DELTA&&r.logicalLevelTechnique2===fo.RLE){let t=r,i=bie(e,t.runs,t.numRleValues);return K6(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function bx(e,r,t,i,a="int32"){let o=e.logicalLevelTechnique1;if(o===fo.RLE)return e.runs===1?js.CONST:js.FLAT;if(o!==fo.DELTA||e.logicalLevelTechnique2!==fo.RLE)return e.numValues===1?js.CONST:js.FLAT;let s=r instanceof yh?r.size():r,l=e;if(l.numRleValues!==s)return js.FLAT;if(l.runs===1)return js.SEQUENCE;if(l.runs!==2)return e.numValues===1?js.CONST:js.FLAT;let n=i.get();if(e.physicalLevelTechnique===Of.VARINT)return Xie(t,i,a)?js.SEQUENCE:e.numValues===1?js.CONST:js.FLAT;let u=i.get(),c=new Int32Array(t.buffer,t.byteOffset+u,4);return i.set(n),c[2]===2&&c[3]===2?js.SEQUENCE:e.numValues===1?js.CONST:js.FLAT}function Xie(e,r,t){let i=new kA(r.get());if(t==="int64"){let o=Y6(e,i,4);return o[2]===BigInt("2")&&o[3]===BigInt("2")}let a=Ju(e,i,4);return a[2]===2&&a[3]===2}function Zie(e,r,t){return t?gie(e,r.runs,r.numRleValues):jF(e,r.runs,r.numRleValues)}function tT(e,r,t){return{x:tP(e,r)-t,y:tP(e>>1,r)-t}}function tP(e,r){let t=0;for(let i=0;i>i;return t}function Kie(e){let r=Array(e.numGeometries),t=1,i=1,a=1,o=0,s=0,l=0,n=e.mortonSettings,u=e.topologyVector,c=u.geometryOffsets,f=u.partOffsets,h=u.ringOffsets,d=e.vertexOffsets,p=!d||d.length===0,g=e.containsPolygonGeometry(),m=e.vertexBuffer;for(let y=0;y[S]),t+=v,i+=v}break;case Du.LINESTRING:{let v;g?(v=h[i]-h[i-1],i++):v=f[t]-f[t-1],t++;let x;p?(x=dm(m,s,v,!1),s+=v*2):(x=G0(e.vertexBufferType,m,d,l,v,!1,n),l+=v),r[o++]=[x],c&&a++}break;case Du.POLYGON:{let v=f[t]-f[t-1];t++;let x=Array(v-1),S,M=h[i]-h[i-1];if(i++,p){S=dm(m,s,M,!0),s+=M*2;for(let C=0;Ct?r[o++]:1);return i}function nP(e,r,t,i){let a=new Uint32Array(r[r.length-1]+1),o=0;a[0]=o;let s=1,l=0;for(let n=0;n0;)a[o++]=e[u++]}}return a}function oP(e,r,t,i,a){var o,s;let l,n,u,c,f,h=a,d,p;for(let g=0;g1&&!d.nullable||p===1&&d.nullable)throw Error(`The number of streams for the child field ${d.name} does not match its nullability. nullibilty: ${d.nullable}, numStreams: ${p}`);let m;if(d.nullable){let _=Ys(e,r);m=new yh(fm(e,_.numValues,_.byteLength,r),_.numValues)}let y=ec(e,r,Ys(e,r),void 0,m);if(l){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${g}"`);c[h++]=new NA(g,y,a,o,s,l,m,f)}else c[h++]=new J0(g,y,a,o,m)}return c}function hae(e,r,t,i){let a=dae(t);if(i===0)return a.map(c=>new jA(c,[]));let o=pae(e,r,i),s=(o.presentStream?o.presentCount:o.lengthStream.length)/a.length,l=[],n=0,u=0;for(let c=0;c{var i;return e.name+((i=t.name)!=null?i:"")})}function pae(e,r,t){let i=e[r.get()];r.add(1);let a=ec(e,r,Ys(e,r)),o=t-1,s=[];i&Id.STRING&&(o-=vae(e,r,s)),o-=mae(e,r,i,s),o-=gae(e,r,i,s);let l,n=0;if(i&Id.PRESENCE){let c=yae(e,r);l=c.value,n=c.count,o--}let u=new Uint32Array;if(o>0&&(u=ec(e,r,Ys(e,r)),o--),o!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${o}`);return{lengthStream:a,dictionary:s,presentStream:l,presentCount:n,flattenedValues:u}}function vae(e,r,t){let i=e[r.get()];r.add(1);let a=oP("",e,r,i);if(a)for(let o=0;oo.length)throw Error("Merged map counts underflow while decoding child streams");let d=Array(t),p=i,g=a;for(let _=0;_s.length)throw Error("Map value stream underflow while decoding feature payload");let x=xae(s,g,v,n);d[_]=x.value,g=x.nextIndex}let m=0;for(let _=i;_=t)throw Error("Unexpected end of map value stream");let a=e[r];if(a===t0.FALSE)return{value:!1,nextIndex:r+1};if(a===t0.TRUE)return{value:!0,nextIndex:r+1};if(a===t0.START_MAP){let o=lP(e,r,t);return{value:sP(e,r+2,o,i).value,nextIndex:o}}if(a===t0.START_LIST){let o=lP(e,r,t),s=[],l=r+2;for(;l=t)throw Error("Missing length for nested map/list payload");let i=e[r+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let a=r+i;if(a>t)throw Error("Nested payload exceeds containing payload bounds");return a}function uP(e,r){let t=e-t0.COUNT;if(t<0||t>=r.length)throw Error(`Scalar dictionary index out of range: ${e}`);return r[t]}function pm(e,r){for(let t of r)e.push(t)}function bae(e,r,t,i,a,o){var s;return t.type==="scalarType"?o&&!o.has(t.name)?($F(i,e,r),null):wae(i,e,r,a,t.scalarType,t):((s=t.complexType)==null?void 0:s.physicalType)===cp.MAP?hae(e,r,t,i):i===0?null:fae(e,r,t,o)}function wae(e,r,t,i,a,o){var s;let l;if(e===0)return null;if(o.nullable){let u=Ys(r,t),c=u.numValues,f=t.get(),h=fm(r,c,u.byteLength,t);t.set(f+u.byteLength),l=new yh(h,u.numValues)}let n=l??i;switch(a.physicalType){case Wo.UINT_32:case Wo.INT_32:return Eae(r,t,o,a,n);case Wo.STRING:{let u=o.nullable?e-1:e;return(s=oP(o.name,r,t,u,l))!=null?s:null}case Wo.BOOLEAN:return Tae(r,t,o,i,n);case Wo.UINT_64:case Wo.INT_64:return Sae(r,t,o,n,a);case Wo.FLOAT:return Aae(r,t,o,n);case Wo.DOUBLE:return Mae(r,t,o,n);default:throw Error(`The specified data type for the field is currently not supported: ${a}`)}}function Tae(e,r,t,i,a){let o=Ys(e,r),s=o.numValues,l=r.get(),n=hg(a)?a:void 0,u=fm(e,s,o.byteLength,r,n);r.set(l+o.byteLength);let c=new yh(u,s);return new b5(t.name,c,a)}function Aae(e,r,t,i){let a=Ys(e,r),o=hg(i)?i:void 0,s=WF(e,r,a.numValues,o);return new w5(t.name,s,i)}function Mae(e,r,t,i){let a=Ys(e,r),o=hg(i)?i:void 0,s=YF(e,r,a.numValues,o);return new Ub(t.name,s,i)}function Sae(e,r,t,i,a){let o=Ys(e,r),s=bx(o,i,e,r,"int64"),l=a.physicalType===Wo.INT_64;if(s===js.FLAT){let u=hg(i)?i:void 0,c=l?KF(e,r,o,u):eT(e,r,o,u);return new LA(t.name,c,i)}if(s===js.SEQUENCE){let u=ZF(e,r,o);return new FA(t.name,u[0],u[1],o.numRleValues,l)}let n=l?Gie(e,r,o):JF(e,r,o);return new BA(t.name,n,i,l)}function Eae(e,r,t,i,a){let o=Ys(e,r),s=bx(o,a,e,r),l=i.physicalType===Wo.INT_32;if(s===js.FLAT){let u=hg(a)?a:void 0,c=l?xx(e,r,o,void 0,u):ec(e,r,o,void 0,u);return new jb(t.name,c,a)}if(s===js.SEQUENCE){let u=XF(e,r,o);return new qb(t.name,u[0],u[1],o.numRleValues,l)}let n=l?Uie(e,r,o):Q6(e,r,o);return new Vb(t.name,n,a,l)}function hg(e){return e instanceof yh}function cP(e){switch(e){case tu.ID:case tu.ID|tu.ID_NULLABLE:case tu.ID|tu.ID_LONG:case tu.ID|tu.ID_LONG|tu.ID_NULLABLE:return{nullable:(e&tu.ID_NULLABLE)!==0,columnScope:zm.FEATURE,type:"scalarType",scalarType:{longID:(e&tu.ID_LONG)!==0,type:"logicalType",logicalType:EA.ID}};case tu.GEOMETRY:return{nullable:!1,columnScope:zm.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:cp.GEOMETRY,children:[]}};case tu.STRUCT:return{nullable:!1,columnScope:zm.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:cp.STRUCT,children:[]}};case tu.MAP:return{nullable:!0,columnScope:zm.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:cp.MAP,children:[]}};default:return Fae(e)}}function kae(e){return e>=tu.SCALAR_BASE}function fP(e){return e===tu.STRUCT||e===tu.MAP}function Cae(e){if(e.type==="scalarType"){let r=e.scalarType;if(r.type==="physicalType")switch(r.physicalType){case Wo.BOOLEAN:case Wo.INT_8:case Wo.UINT_8:case Wo.INT_32:case Wo.UINT_32:case Wo.INT_64:case Wo.UINT_64:case Wo.FLOAT:case Wo.DOUBLE:return!1;case Wo.STRING:return!0;default:return!1}if(r.type==="logicalType")return!1}else if(e.type==="complexType"){let r=e.complexType;if(r.type==="physicalType")switch(r.physicalType){case cp.GEOMETRY:case cp.STRUCT:case cp.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",e),!1}function Dae(e){var r;return e.type==="scalarType"&&((r=e.scalarType)==null?void 0:r.type)==="logicalType"&&e.scalarType.logicalType===EA.ID}function Lae(e){var r;return e.type==="complexType"&&((r=e.complexType)==null?void 0:r.type)==="physicalType"&&e.complexType.physicalType===cp.GEOMETRY}function Fae(e){let r;switch(e){case 10:case 11:r=Wo.BOOLEAN;break;case 12:case 13:r=Wo.INT_8;break;case 14:case 15:r=Wo.UINT_8;break;case 16:case 17:r=Wo.INT_32;break;case 18:case 19:r=Wo.UINT_32;break;case 20:case 21:r=Wo.INT_64;break;case 22:case 23:r=Wo.UINT_64;break;case 24:case 25:r=Wo.FLOAT;break;case 26:case 27:r=Wo.DOUBLE;break;case 28:case 29:r=Wo.STRING;break;default:return null}return{nullable:!!(e&1),columnScope:zm.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:r}}}function aT(e,r){let t=Ju(e,r,1)[0];if(t===0)return"";let i=r.get(),a=i+t,o=e.subarray(i,a);return r.add(t),T5.decode(o)}function Pae(e){let r=e.name,t=e.nullable;return e.type==="scalarType"?{type:"scalarField",scalarField:e.scalarType,name:r,nullable:t}:{type:"complexField",complexField:e.complexType,name:r,nullable:t}}function hP(e,r){let t=Ju(e,r,1)[0]>>>0,i=t>=tu.SCALAR_BASE?cP(t):null;if(!i)throw Error(`Unsupported field type code ${t}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let a=ar(Ot({},i),{name:aT(e,r)});if(a.type==="complexType"&&fP(t)){let o=a.complexType,s=Ju(e,r,1)[0]>>>0;o.children=Array(s);for(let l=0;l>>0,i=cP(t);if(!i)throw Error(`Unsupported column type code ${t}. Supported: ${UA}`);let a;if(kae(t))a=aT(e,r);else if(t>>0,l=o.complexType;l.children=Array(s);for(let n=0;n>>0,o=Ju(e,r,1)[0]>>>0;i.columns=Array(o);for(let s=0;s>>0,s=i.get()+o;if(s>e.length)throw Error(`Block overruns tile: ${s} > ${e.length}`);let l=Ju(e,i,1)[0]>>>0;if(l!==1&&l!==2){i.set(s);continue}let[n,u]=Rae(e,i),c=n.featureTables[0],f=null,h=null,d=[],p=0;for(let m of c.columns){let y=m.name;if(Dae(m)){let _=null;if(m.nullable){let x=Ys(e,i),S=i.get(),M=fm(e,x.numValues,x.byteLength,i);i.set(S+x.byteLength),_=new yh(M,x.numValues)}let v=Ys(e,i);p=_?_.size():v.decompressedCount,f=Bae(e,m,i,y,v,_??p,t)}else if(Lae(m)){let _=Ju(e,i,1)[0];if(p===0){let v=i.get();p=Ys(e,i).decompressedCount,i.set(v)}r&&(r.scale=r.extent/u),h=iae(e,_,i,p,r)}else{let _=Cae(m)?Ju(e,i,1)[0]:1;if(_===0)continue;let v=bae(e,i,m,_,p,void 0);if(v)if(Array.isArray(v))for(let x of v)d.push(x);else d.push(v)}}let g=new c5(c.name,h,f,d,u);a.push(g),i.set(s)}return a}function Bae(e,r,t,i,a,o,s=!1){var l;let n=(l=r.scalarType)!=null&&l.longID?Wo.UINT_64:Wo.UINT_32,u=typeof o=="number"?void 0:o,c=bx(a,o,e,t,n===Wo.UINT_64?"int64":"int32");if(n===Wo.UINT_32)switch(c){case js.FLAT:return new jb(i,ec(e,t,a,void 0,u),o);case js.SEQUENCE:{let f=XF(e,t,a);return new qb(i,f[0],f[1],a.numRleValues,!1)}case js.CONST:return new Vb(i,Q6(e,t,a),o,!1)}switch(c){case js.FLAT:return s?new Ub(i,qie(e,t,a,u),o):new LA(i,eT(e,t,a,u),o);case js.SEQUENCE:{let f=ZF(e,t,a);return new FA(i,f[0],f[1],a.numRleValues,!1)}case js.CONST:return new BA(i,JF(e,t,a),o,!1)}throw Error("Vector type not supported for id column.")}function Oae(e){return typeof e=="object"&&!!e&&"evaluate"in e}function dP(e,r,t,i,a){return $4(e,(o,s)=>{let l=r instanceof Mg?r.get(s):null;return Oae(l)?l.evaluate(t,i,void 0,a):l})}function Nae(e,r){return r-e}var pP,nT,vP,mP,gP,oT,wx,yP,_P,Tx,Ax,Ql,Mx,$h,Sd,dg,xP,sT,lT,bP,Bi,Sx,wP,uT,Ex,TP,AP,Wh,cT,fT,hT,vm,ff,kx,mm,MP,pg,vg,dT,SP,hf,Ln,Nl,pT,mi,EP,na,gm,Ra,so,Ao,dh,mg,Wp,co,kP,gg,ym,yg,_m,_g,xm,xg,CP,vT,mT,gT,Cx,yT,DP,LP,FP,PP,Gc,ro,IP,Dx,Ed,Yh,Xh,If,Xs,RP,Zh,Kh,op,Lx,H0,zP,_T,Fx,Rf,Zs,xT,bg,kd,bT,$0,wT,TT,BP,OP,NP,jP,UP,qP,AT,VP,GP,HP,$P,WP,YP,MT,XP,ZP,KP,Jh,Px,ST,ET,Ix,Rx,JP,zx,W0,Qh,QP,kT,Yp,Bx,Ox,bm,wg,CT,eI,DT,LT,tI,FT,rI,iI,Hc,PT,Nx,Cd,jx,ns,Ux,Tg,qx,Ag,IT,RT,aI,zf,Mg,Ha,Fn,wm,zT,Sg,vu,BT,Vx,ph,nI,oI,sI,Gx,lI,uI,Tm,il,Am,Eg,Hx,$x,Wx,Mm,Yx,Xx,Zx,Kx,Jx,Qx,eb,tb,rb,kg,ib,ab,Cg,nb,ob,sb,lb,ub,OT,NT,jT,UT,qT,VT,GT,HT,$T,WT,YT,XT,sp,cI,fI,hI,dI,pI,vI,mI,Y0,ZT,gI,yI,_I,KT,xI,bI,wI,ed,cb,TI,fb,AI,Ks,MI,SI,EI,kI,hb,JT,Dd,En,Xa,mo,vc,Sm,lp,QT,eA,CI,vh,Em,Xp,Ld,mh,up,tA,rA,iA,Zp,db,aA,nA,pb,DI,LI,FI,PI,II,RI,zI,oA,BI,OI,NI,vb,Rs,Dg,jI,UI,qI,VI,GI,HI,$I,WI,YI,XI,jl,km,ZI,KI,JI,mb,QI,Cm,gb,yb,yl,Lg,_b,xb,Bf,Dm,Kp,Lm,Fm,Fd,bb,wb,Pm,Im,eR,sA,tR,rR,iR,aR,nR,oR,sR,Tb,lR,uR,gh,cR,Rm,fR,hR,mc,An,lA,Qo,Jp,Ab,uA,dR,pR,vR,mR,gR,yR,_R,jae,xR,bR,Mb,wR,Sb,TR,AR,cA,fA,hA,MR,SR,ER,kR,dA,CR,Eb,DR,LR,FR,PR,IR,pA,RR,Fg,zR,BR,OR,vA,NR,mA,gA,kb,Cb,X0,jR,UR,Db,Lb,qR,VR,GR,Fb,Uae,yA,_A,Pb,HR,xA,bA,wA,Z0,Pg,$R,K0,Ib,Rb,WR,zb,Bb,Ig,YR,XR,ZR,KR,Ob,TA,AA,JR,QR,e5,t5,r5,i5,a5,n5,o5,s5,l5,Rg,zg,Cu,Nb,Bg,u5,MA,Qp,Og,jb,Ub,SA,qb,Vb,c5,zm,Wo,cp,EA,kA,fo,Of,Gb,Hb,CA,$b,f5,El,gc,Pd,eu,h5,DA,d5,p5,v5,m5,js,yh,g5,LA,FA,Du,y5,e0,PA,IA,RA,zA,_5,x5,b5,w5,BA,Wb,OA,J0,NA,jA,Id,t0,tu,T5,UA,A5,M5,S5,E5,k5,qae=Ir({"node_modules/maplibre-gl/dist/maplibre-gl-shared.mjs"(){pP=Object.create,nT=Object.defineProperty,vP=Object.getOwnPropertyDescriptor,mP=Object.getOwnPropertyNames,gP=Object.getPrototypeOf,oT=Object.prototype.hasOwnProperty,wx=(e,r)=>()=>(r||(e((r={exports:{}}).exports,r),e=null),r.exports),yP=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(var a=mP(r),o=0,s=a.length,l;or[n]).bind(null,l),enumerable:!(i=vP(r,l))||i.enumerable});return e},_P=(e,r,t)=>(t=e==null?{}:pP(gP(e)),yP(r||!e||!e.__esModule||!oT.call(e,"default")?nT(t,"default",{value:e,enumerable:!0}):t,e)),Wr.prototype={clone(){return new Wr(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,r){return this.clone()._rotateAround(e,r)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let r=e.x-this.x,t=e.y-this.y;return r*r+t*t},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,r){return Math.atan2(this.x*r-this.y*e,this.x*e+this.y*r)},_matMult(e){let r=e[0]*this.x+e[1]*this.y,t=e[2]*this.x+e[3]*this.y;return this.x=r,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let r=Math.cos(e),t=Math.sin(e),i=r*this.x-t*this.y,a=t*this.x+r*this.y;return this.x=i,this.y=a,this},_rotateAround(e,r){let t=Math.cos(e),i=Math.sin(e),a=r.x+t*(this.x-r.x)-i*(this.y-r.y),o=r.y+i*(this.x-r.x)+t*(this.y-r.y);return this.x=a,this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Wr},Wr.convert=function(e){if(e instanceof Wr)return e;if(Array.isArray(e))return new Wr(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new Wr(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")},Ql=typeof Float32Array<"u"?Float32Array:Array,Math.PI/180,180/Math.PI,Mx=PK,$h=IK,Sd=d9,dg=ap,(function(){var e=f9();return function(r,t,i,a,o,s){var l,n;for(t||(t=3),i||(i=0),n=a?Math.min(a*t+i,r.length):r.length,l=i;l.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(uf(e,a,o),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+s,lT(i,i))}})(),(function(){var e=p9(),r=p9();return function(t,i,a,o,s,l){return C_(e,i,s,l),C_(r,a,o,l),C_(t,e,r,2*l*(1-l)),t}})(),(function(){var e=u9();return function(r,t,i,a){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=a[0],e[4]=a[1],e[7]=a[2],e[2]=-t[0],e[5]=-t[1],e[8]=-t[2],lT(r,XK(r,e))}})(),bP=ZK,(function(){var e=V4();return function(r,t,i,a,o,s){var l,n;for(t||(t=2),i||(i=0),n=a?Math.min(a*t+i,r.length):r.length,l=i;lXr(null,null,function*(){let t=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(t,r)}catch(i){throw Error(`Could not load image because of ${Zu(i).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),AP=e=>new Promise((r,t)=>{let i=new Image;i.onload=()=>{r(i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame(()=>i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=")},i.onerror=()=>t(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let a=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=URL.createObjectURL(a)}),Wh=85.051129,cT={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},fT={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},hT="AbortError",vm=class extends Error{constructor(e=hT){super(e instanceof Error?e.message:e),this.name=hT,e instanceof Error&&e.stack&&(this.stack=e.stack)}},ff={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""},kx="global-dispatcher",mm=class extends Error{constructor(e,r,t,i){super(`AJAXError: ${r} (${e}): ${t}`),this.status=e,this.statusText=r,this.url=t,this.body=i}},MP=e=>{var r;return e.startsWith("file:")||((r=X4())==null?void 0:r.startsWith("file:"))&&!/^\w+:/.test(e)},pg=function(e,r){return Xr(this,null,function*(){var t,i;if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let a=M9(e.url);if(a){let o=yield a(e,r);return!o.data&&e.type==="arrayBuffer"?yn(o,{data:new ArrayBuffer(0)}):o}if(Zv(self)&&((t=self.worker)!=null&&t.actor))return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:kx},r)}if(!MP(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return mJ(e,r);if(Zv(self)&&((i=self.worker)!=null&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:kx},r)}return gJ(e,r)})},vg=(e,r)=>pg(yn(e,{type:"json"}),r),dT=(e,r)=>pg(yn(e,{type:"arrayBuffer"}),r),SP=e=>{let r=window.document.createElement("video");return r.muted=!0,new Promise(t=>{r.onloadstart=()=>{t(r)};for(let i of e){let a=window.document.createElement("source");S9(i)||(r.crossOrigin="Anonymous"),a.src=i,r.appendChild(a)}})},hf=class{constructor(e,r={}){yn(this,r),this.type=e}},Ln=class extends hf{constructor(e,r={}){super("error",yn({error:e},r))}},Nl=class{on(e,r){return this._listeners||(this._listeners={}),E9(e,r,this._listeners),{unsubscribe:()=>{this.off(e,r)}}}off(e,r){return Z4(e,r,this._listeners),Z4(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners||(this._oneTimeListeners={}),E9(e,r,this._oneTimeListeners),this):new Promise(t=>this.once(e,t))}fire(e,r){var t,i,a,o,s,l;let n=typeof e=="string"?new hf(e,r||{}):e,u=n.type;if(this.listens(u)){n.target=this;let c=(a=(i=(t=this._listeners)==null?void 0:t[u])==null?void 0:i.slice())!=null?a:[];for(let d of c)d.call(this,n);let f=(l=(s=(o=this._oneTimeListeners)==null?void 0:o[u])==null?void 0:s.slice())!=null?l:[];for(let d of f)Z4(u,d,this._oneTimeListeners),d.call(this,n);let h=this._eventedParent;h&&(yn(n,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),h.fire(n))}else n instanceof Ln&&console.error(n.error);return this}listens(e){var r,t,i,a,o;return!!((t=(r=this._listeners)==null?void 0:r[e])!=null&&t.length||(a=(i=this._oneTimeListeners)==null?void 0:i[e])!=null&&a.length||(o=this._eventedParent)!=null&&o.listens(e))}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}},pT={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},mi=pT,EP=["type","source","source-layer","minzoom","maxzoom","filter","layout"],na=class{constructor(e,r,t,i,a="error"){this.message=(e?`${e}: `:"")+t,i&&(this.identifier=i),this.severity=a,r!=null&&r.__line__&&(this.line=r.__line__)}},gm={kind:"null"},Ra={kind:"number"},so={kind:"string"},Ao={kind:"boolean"},dh={kind:"color"},mg={kind:"projectionDefinition"},Wp={kind:"object"},co={kind:"value"},kP={kind:"error"},gg={kind:"collator"},ym={kind:"formatted"},yg={kind:"padding"},_m={kind:"colorArray"},_g={kind:"numberArray"},xm={kind:"resolvedImage"},xg={kind:"variableAnchorOffsetCollection"},CP=[gm,Ra,so,Ao,dh,mg,ym,Wp,pc(co),yg,_g,_m,xm,xg],vT=.96422,mT=.82521,gT=4/29,Cx=6/29,yT=3*Cx*Cx,DP=Math.PI/180,LP=180/Math.PI,FP=Object.hasOwn||function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},PP={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ro=(Gc=class{constructor(e,r,t,i=1,a=!0){this.r=e,this.g=r,this.b=t,this.a=i,a||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,r,t,i]))}static parse(e){if(e instanceof Gc)return e;if(typeof e!="string")return;let r=bJ(e);if(r)return new Gc(...r,!1)}get rgb(){let{r:e,g:r,b:t,a:i}=this,a=i||1/0;return this.overwriteGetter("rgb",[e/a,r/a,t/a,i])}get hcl(){return this.overwriteGetter("hcl",yJ(this.rgb))}get lab(){return this.overwriteGetter("lab",C9(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,t,i]=this.rgb;return`rgba(${[e,r,t].map(a=>Math.round(a*255)).join(",")},${i})`}static interpolate(e,r,t,i="rgb"){switch(i){case"rgb":{let[a,o,s,l]=Jv(e.rgb,r.rgb,t);return new Gc(a,o,s,l,!1)}case"hcl":{let[a,o,s,l]=e.hcl,[n,u,c,f]=r.hcl,h,d;if(!isNaN(a)&&!isNaN(n)){let _=n-a;n>a&&_>180?_-=360:n180&&(_+=360),h=a+t*_}else isNaN(a)?isNaN(n)?h=NaN:(h=n,(s===1||s===0)&&(d=u)):(h=a,(c===1||c===0)&&(d=o));let[p,g,m,y]=_J([h,d??qp(o,u,t),qp(s,c,t),qp(l,f,t)]);return new Gc(p,g,m,y,!1)}case"lab":{let[a,o,s,l]=D9(Jv(e.lab,r.lab,t));return new Gc(a,o,s,l,!1)}}}},Gc.black=new Gc(0,0,0,1),Gc.white=new Gc(1,1,1,1),Gc.transparent=new Gc(0,0,0,0),Gc.red=new Gc(1,0,0,1),Gc),IP=["bottom","center","top"],Dx=class{constructor(e,r,t,i,a,o){this.text=e,this.image=r,this.scale=t,this.fontStack=i,this.textColor=a,this.verticalAlign=o}},Ed=class cw{constructor(r){this.sections=r}static fromString(r){return new cw([new Dx(r,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(r=>r.text.length!==0||r.image&&r.image.name.length!==0)}static factory(r){return r instanceof cw?r:cw.fromString(r)}toString(){return this.sections.length===0?"":this.sections.map(r=>r.text).join("")}},Yh=class gy{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof gy)return r;if(typeof r=="number")return new gy([r,r,r,r]);if(Array.isArray(r)&&!(r.length<1||r.length>4)){for(let t of r)if(typeof t!="number")return;switch(r.length){case 1:r=[r[0],r[0],r[0],r[0]];break;case 2:r=[r[0],r[1],r[0],r[1]];break;case 3:r=[r[0],r[1],r[2],r[1]]}return new gy(r)}}toString(){return JSON.stringify(this.values)}static interpolate(r,t,i){return new gy(Jv(r.values,t.values,i))}},Xh=class yy{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof yy)return r;if(typeof r=="number")return new yy([r]);if(Array.isArray(r)){for(let t of r)if(typeof t!="number")return;return new yy(r)}}toString(){return JSON.stringify(this.values)}static interpolate(r,t,i){return new yy(Jv(r.values,t.values,i))}},If=class _y{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof _y)return r;if(typeof r=="string"){let i=ro.parse(r);return i?new _y([i]):void 0}if(!Array.isArray(r))return;let t=[];for(let i of r){if(typeof i!="string")return;let a=ro.parse(i);if(!a)return;t.push(a)}return new _y(t)}toString(){return JSON.stringify(this.values)}static interpolate(r,t,i,a="rgb"){let o=[];if(r.values.length!=t.values.length)throw Error(`colorArray: Arrays have mismatched length (${r.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let s=0;s=l)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let f=t.parse(n,c,o);if(!f)return null;o||(o=f.type),a.push([l,f])}return new Fj(o,i,a,t.key)}evaluate(r){let t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(r);let a=this.input.evaluate(r);if(a<=t[0])return i[0].evaluate(r);let o=t.length;return a>=t[o-1]?i[o-1].evaluate(r):i[R_(t,a,this.key)].evaluate(r)}eachChild(r){r(this.input);for(let t of this.outputs)r(t)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}},Rf=class rE{constructor(r,t,i,a,o,s){this.type=r,this.operator=t,this.interpolation=i,this.input=a,this.key=s,this.labels=[],this.outputs=[];for(let[l,n]of o)this.labels.push(l),this.outputs.push(n)}static interpolationFactor(r,t,i,a){let o=0;if(r.name==="exponential")o=r6(t,r.base,i,a);else if(r.name==="linear")o=r6(t,1,i,a);else if(r.name==="cubic-bezier"){let s=r.controlPoints;o=TJ(s[0],s[1],s[2],s[3])(r6(t,1,i,a))}return o}static parse(r,t){let[i,a,o,...s]=r;if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){let u=a[1];if(typeof u!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:u}}else if(a[0]==="cubic-bezier"){let u=a.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:u}}else return t.error(`Unknown interpolation type ${String(a[0])}`,1,0);if(r.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,Ra),!o)return null;let l=[],n=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&t.expectedType!=_m?n=dh:t.expectedType&&t.expectedType.kind!=="value"&&(n=t.expectedType);for(let u=0;u=c)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);let p=t.parse(f,d,n);if(!p)return null;n||(n=p.type),l.push([c,p])}return!Up(n,Ra)&&!Up(n,mg)&&!Up(n,dh)&&!Up(n,yg)&&!Up(n,_g)&&!Up(n,_m)&&!Up(n,xg)&&!Up(n,pc(Ra))?t.error(`Type ${ll(n)} is not interpolatable.`):new rE(n,i,a,o,l,t.key)}evaluate(r){let t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(r);let a=this.input.evaluate(r);if(a<=t[0])return i[0].evaluate(r);let o=t.length;if(a>=t[o-1])return i[o-1].evaluate(r);let s=R_(t,a,this.key),l=t[s],n=t[s+1],u=rE.interpolationFactor(this.interpolation,a,l,n),c=i[s].evaluate(r),f=i[s+1].evaluate(r);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return qp(c,f,u);case"color":return ro.interpolate(c,f,u);case"padding":return Yh.interpolate(c,f,u);case"colorArray":return If.interpolate(c,f,u);case"numberArray":return Xh.interpolate(c,f,u);case"variableAnchorOffsetCollection":return Zh.interpolate(c,f,u,this.key);case"array":return Jv(c,f,u);case"projectionDefinition":return op.interpolate(c,f,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return ro.interpolate(c,f,u,"hcl");case"colorArray":return If.interpolate(c,f,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return ro.interpolate(c,f,u,"lab");case"colorArray":return If.interpolate(c,f,u,"lab")}}}eachChild(r){r(this.input);for(let t of this.outputs)r(t)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}},Zs={color:ro.interpolate,number:qp,padding:Yh.interpolate,numberArray:Xh.interpolate,colorArray:If.interpolate,variableAnchorOffsetCollection:Zh.interpolate,array:Jv},xT=class Pj{constructor(r){this.type=ym,this.sections=r}static parse(r,t){if(r.length<2)return t.error("Expected at least one argument.");let i=r[1];if(!Array.isArray(i)&&typeof i=="object")return t.error("First argument must be an image or text section.");let a=[],o=!1;for(let s=1;s<=r.length-1;++s){let l=r[s];if(o&&typeof l=="object"&&!Array.isArray(l)){o=!1;let n=null;if(l["font-scale"]&&(n=t.parse(l["font-scale"],1,Ra),!n))return null;let u=null;if(l["text-font"]&&(u=t.parse(l["text-font"],1,pc(so)),!u))return null;let c=null;if(l["text-color"]&&(c=t.parse(l["text-color"],1,dh),!c))return null;let f=null;if(l["vertical-align"]){if(typeof l["vertical-align"]=="string"&&!IP.includes(l["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${l["vertical-align"]}' instead.`);if(f=t.parse(l["vertical-align"],1,so),!f)return null}let h=a[a.length-1];h.scale=n,h.font=u,h.textColor=c,h.verticalAlign=f}else{let n=t.parse(r[s],1,co);if(!n)return null;let u=n.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,a.push({content:n,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Pj(a)}evaluate(r){return new Ed(this.sections.map(t=>{let i=t.content.evaluate(r);return Ml(i)===xm?new Dx("",i,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(r):null):new Dx(q1(i),null,t.scale?t.scale.evaluate(r):null,t.font?t.font.evaluate(r).join(","):null,t.textColor?t.textColor.evaluate(r):null,t.verticalAlign?t.verticalAlign.evaluate(r):null)}))}eachChild(r){for(let t of this.sections)r(t.content),t.scale&&r(t.scale),t.font&&r(t.font),t.textColor&&r(t.textColor),t.verticalAlign&&r(t.verticalAlign)}outputDefined(){return!1}},bg={string:so,number:Ra,boolean:Ao,object:Wp},kd=class Ij{constructor(r,t,i){this.type=r,this.args=t,this.key=i}static parse(r,t){if(r.length<2)return t.error("Expected at least one argument.");let i=1,a,o=r[0];if(o==="array"){let l;if(r.length>2){let u=r[1];if(typeof u!="string"||!(u in bg)||u==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);l=bg[u],i++}else l=co;let n;if(r.length>3){if(r[2]!==null&&(typeof r[2]!="number"||r[2]<0||r[2]!==Math.floor(r[2])))return t.error('The length argument to "array" must be a positive integer literal',2);n=r[2],i++}a=pc(l,n)}else{if(!bg[o])throw Error(`Types doesn't contain name = ${o}`);a=bg[o]}let s=[];for(;ir.outputDefined())}},bT={"to-boolean":Ao,"to-color":dh,"to-number":Ra,"to-string":so},$0=class Rj{constructor(r,t,i){this.type=r,this.args=t,this.key=i}static parse(r,t){if(r.length<2)return t.error("Expected at least one argument.");let i=r[0];if(!bT[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&r.length!==2)return t.error("Expected one argument.");let a=bT[i],o=[];for(let s=1;s4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:P9(t[0],t[1],t[2],t[3]),!i))return new ro(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Xs(i||`Could not parse color from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"padding":{let t;for(let i of this.args){t=i.evaluate(r);let a=Yh.parse(t);if(a)return a}throw new Xs(`Could not parse padding from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"numberArray":{let t;for(let i of this.args){t=i.evaluate(r);let a=Xh.parse(t);if(a)return a}throw new Xs(`Could not parse numberArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"colorArray":{let t;for(let i of this.args){t=i.evaluate(r);let a=If.parse(t);if(a)return a}throw new Xs(`Could not parse colorArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"variableAnchorOffsetCollection":{let t;for(let i of this.args){t=i.evaluate(r);let a=Zh.parse(t);if(a)return a}throw new Xs(`Could not parse variableAnchorOffsetCollection from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"number":{let t=null;for(let i of this.args){if(t=i.evaluate(r),t===null)return 0;let a=Number(t);if(!isNaN(a))return a}throw new Xs(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case"formatted":return Ed.fromString(q1(this.args[0].evaluate(r)));case"resolvedImage":return Kh.fromString(q1(this.args[0].evaluate(r)));case"projectionDefinition":{let t=this.args[0].evaluate(r);if(op.parse(t))return t;throw new Xs(`Could not parse projectionDefinition from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}default:return q1(this.args[0].evaluate(r))}}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}},wT=class zj{constructor(r,t){this.type=t.type,this.bindings=[].concat(r),this.result=t}evaluate(r){return this.result.evaluate(r)}eachChild(r){for(let t of this.bindings)r(t[1]);r(this.result)}static parse(r,t){if(r.length<4)return t.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);let i=[];for(let o=1;o=i.length)throw new Xs(`Array index out of bounds: ${t} > ${i.length-1}.`,this.key);if(t!==Math.floor(t))throw new Xs(`Array index must be an integer, but found ${t} instead.`,this.key);return i[t]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}},OP=class Nj{constructor(r,t,i){this.needle=r,this.haystack=t,this.key=i,this.type=Ao}static parse(r,t){if(r.length!==3)return t.error(`Expected 2 arguments, but found ${r.length-1} instead.`);let i=t.parse(r[1],1,co),a=t.parse(r[2],2,co);return!i||!a?null:K4(i.type,[Ao,so,Ra,gm,co])?new Nj(i,a,t.key):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${ll(i.type)} instead`)}evaluate(r){let t=this.needle.evaluate(r),i=this.haystack.evaluate(r);if(!i)return!1;if(!I0(t,["boolean","string","number","null"]))throw new Xs(`Expected first argument to be of type boolean, string, number or null, but found ${ll(Ml(t))} instead.`,this.key);if(!I0(i,["string","array"]))throw new Xs(`Expected second argument to be of type array or string, but found ${ll(Ml(i))} instead.`,this.key);return i.indexOf(t)>=0}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}},NP=class iE{constructor(r,t,i,a){this.needle=r,this.haystack=t,this.key=i,this.fromIndex=a,this.type=Ra}static parse(r,t){if(r.length<=2||r.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${r.length-1} instead.`);let i=t.parse(r[1],1,co),a=t.parse(r[2],2,co);if(!i||!a)return null;if(!K4(i.type,[Ao,so,Ra,gm,co]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${ll(i.type)} instead`);if(r.length===4){let o=t.parse(r[3],3,Ra);return o?new iE(i,a,t.key,o):null}return new iE(i,a,t.key)}evaluate(r){let t=this.needle.evaluate(r),i=this.haystack.evaluate(r);if(!I0(t,["boolean","string","number","null"]))throw new Xs(`Expected first argument to be of type boolean, string, number or null, but found ${ll(Ml(t))} instead.`,this.key);let a;if(this.fromIndex&&(a=this.fromIndex.evaluate(r)),I0(i,["string"])){let o=i.indexOf(t,a);return o===-1?-1:[...i.slice(0,o)].length}if(I0(i,["array"]))return i.indexOf(t,a);throw new Xs(`Expected second argument to be of type array or string, but found ${ll(Ml(i))} instead.`,this.key)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}},jP=class jj{constructor(r,t,i,a,o,s){this.inputType=r,this.type=t,this.input=i,this.cases=a,this.outputs=o,this.otherwise=s}static parse(r,t){if(r.length<5)return t.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!=1)return t.error("Expected an even number of arguments.");let i,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);let o={},s=[];for(let u=2;u2**53-1)return h.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof p=="number"&&Math.floor(p)!==p)return h.error("Numeric branch labels must be integer values.");if(!i)i=Ml(p);else if(h.checkSubtype(i,Ml(p)))return null;if(o[String(p)]!==void 0)return h.error("Branch labels must be unique.");o[String(p)]=s.length}let d=t.parse(f,u,a);if(!d)return null;a||(a=d.type),s.push(d)}let l=t.parse(r[1],1,co);if(!l)return null;let n=t.parse(r[r.length-1],r.length-1,a);return!n||l.type.kind!=="value"&&t.concat(1).checkSubtype(i,l.type)?null:new jj(i,a,l,o,s,n)}evaluate(r){let t=this.input.evaluate(r);return(Ml(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(r)}eachChild(r){r(this.input),this.outputs.forEach(r),r(this.otherwise)}outputDefined(){return this.outputs.every(r=>r.outputDefined())&&this.otherwise.outputDefined()}},UP=class Uj{constructor(r,t,i){this.type=r,this.branches=t,this.otherwise=i}static parse(r,t){if(r.length<4)return t.error(`Expected at least 3 arguments, but found only ${r.length-1}.`);if(r.length%2!=0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);let a=[];for(let s=1;st.outputDefined())&&this.otherwise.outputDefined()}},qP=class aE{constructor(r,t,i,a,o){this.type=r,this.input=t,this.beginIndex=i,this.key=a,this.endIndex=o}static parse(r,t){if(r.length<=2||r.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${r.length-1} instead.`);let i=t.parse(r[1],1,co),a=t.parse(r[2],2,Ra);if(!i||!a)return null;if(!K4(i.type,[pc(co),so,co]))return t.error(`Expected first argument to be of type array or string, but found ${ll(i.type)} instead`);if(r.length===4){let o=t.parse(r[3],3,Ra);return o?new aE(i.type,i,a,t.key,o):null}return new aE(i.type,i,a,t.key)}evaluate(r){let t=this.input.evaluate(r),i=this.beginIndex.evaluate(r),a;if(this.endIndex&&(a=this.endIndex.evaluate(r)),I0(t,["string"]))return[...t].slice(i,a).join("");if(I0(t,["array"]))return t.slice(i,a);throw new Xs(`Expected first argument to be of type array or string, but found ${ll(Ml(t))} instead.`,this.key)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}},AT=class nE{constructor(r,t){this.type=r,this.args=t}static parse(r,t){if(r.length<2)return t.error("Expected at least one argument.");let i=null,a=t.expectedType;a&&a.kind!=="value"&&(i=a);let o=[];for(let s of r.slice(1)){let l=t.parse(s,1+o.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i||(i=l.type),o.push(l)}if(!i)throw Error("No output type");return a&&o.some(s=>j1(a,s.type))?new nE(co,o):new nE(i,o)}evaluate(r){let t=null,i=0,a;for(let o of this.args)if(i++,t=o.evaluate(r),t&&t instanceof Kh&&!t.available&&(a||(a=t.name),t=null,i===this.args.length&&(t=a)),t!==null)break;return t}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}},VP=em("==",EJ,z9),GP=em("!=",kJ,PJ),HP=em("<",CJ,IJ),$P=em(">",DJ,RJ),WP=em("<=",LJ,zJ),YP=em(">=",FJ,BJ),MT=class qj{constructor(r,t,i){this.type=gg,this.locale=i,this.caseSensitive=r,this.diacriticSensitive=t}static parse(r,t){if(r.length!==2)return t.error("Expected one argument.");let i=r[1];if(typeof i!="object"||Array.isArray(i))return t.error("Collator options argument must be an object.");let a=t.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,Ao);if(!a)return null;let o=t.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,Ao);if(!o)return null;let s=null;return i.locale&&(s=t.parse(i.locale,1,so),!s)?null:new qj(a,o,s)}evaluate(r){return new Lx(this.caseSensitive.evaluate(r),this.diacriticSensitive.evaluate(r),this.locale?this.locale.evaluate(r):null)}eachChild(r){r(this.caseSensitive),r(this.diacriticSensitive),this.locale&&r(this.locale)}outputDefined(){return!1}},XP=class Vj{constructor(r,t,i,a,o,s){this.type=so,this.number=r,this.locale=t,this.currency=i,this.unit=a,this.minFractionDigits=o,this.maxFractionDigits=s}static parse(r,t){if(r.length!==3)return t.error("Expected two arguments.");let i=t.parse(r[1],1,Ra);if(!i)return null;let a=r[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");let o=null;if(a.locale&&(o=t.parse(a.locale,1,so),!o))return null;let s=null;if(a.currency&&(s=t.parse(a.currency,1,so),!s))return null;let l=null;if(a.unit&&(l=t.parse(a.unit,1,so),!l))return null;if(s&&l)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let n=null;if(a["min-fraction-digits"]&&(n=t.parse(a["min-fraction-digits"],1,Ra),!n))return null;let u=null;return a["max-fraction-digits"]&&(u=t.parse(a["max-fraction-digits"],1,Ra),!u)?null:new Vj(i,o,s,l,n,u)}evaluate(r){return new Intl.NumberFormat(this.locale?this.locale.evaluate(r):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(r):void 0,unit:this.unit?this.unit.evaluate(r):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(r):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(r):void 0}).format(this.number.evaluate(r))}eachChild(r){r(this.number),this.locale&&r(this.locale),this.currency&&r(this.currency),this.unit&&r(this.unit),this.minFractionDigits&&r(this.minFractionDigits),this.maxFractionDigits&&r(this.maxFractionDigits)}outputDefined(){return!1}},ZP=class Gj{constructor(r){this.type=xm,this.input=r}static parse(r,t){if(r.length!==2)return t.error("Expected two arguments.");let i=t.parse(r[1],1,so);return i?new Gj(i):t.error("No image name provided.")}evaluate(r){let t=this.input.evaluate(r),i=Kh.fromString(t);return i&&r.availableImages&&(i.available=r.availableImages.indexOf(t)>-1),i}eachChild(r){r(this.input)}outputDefined(){return!1}},KP=class Hj{constructor(r,t){this.input=r,this.key=t,this.type=Ra}static parse(r,t){if(r.length!==2)return t.error(`Expected 1 argument, but found ${r.length-1} instead.`);let i=t.parse(r[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${ll(i.type)} instead.`):new Hj(i,t.key):null}evaluate(r){let t=this.input.evaluate(r);if(typeof t=="string")return[...t].length;if(Array.isArray(t))return t.length;throw new Xs(`Expected value to be of type string or array, but found ${ll(Ml(t))} instead.`,this.key)}eachChild(r){r(this.input)}outputDefined(){return!1}},Jh=8192,Px=class hw{constructor(r,t){this.type=Ao,this.geojson=r,this.geometries=t}static parse(r,t){if(r.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(Qv(r[1])){let i=r[1];if(i.type==="FeatureCollection"){let a=[];for(let o of i.features){let{type:s,coordinates:l}=o.geometry;s==="Polygon"&&a.push(l),s==="MultiPolygon"&&a.push(...l)}if(a.length)return new hw(i,{type:"MultiPolygon",coordinates:a})}else if(i.type==="Feature"){let a=i.geometry.type;if(a==="Polygon"||a==="MultiPolygon")return new hw(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new hw(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return ZJ(r,this.geometries);if(r.geometryType()==="LineString")return KJ(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},ST=class{constructor(e=[],r=(t,i)=>ti)){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:t}=this,i=r[e];for(;e>0;){let a=e-1>>1,o=r[a];if(t(i,o)>=0)break;r[e]=o,e=a}r[e]=i}_down(e){let{data:r,compare:t}=this,i=this.length>>1,a=r[e];for(;e=0)break;r[e]=r[o],e=o}r[e]=a}},ET=Math.PI/180,Ix=class{constructor(e){let r=ET*6378.137*1e3,t=Math.cos(e*ET),i=1/(1-.0066943799901413165*(1-t*t)),a=Math.sqrt(i);this.kx=r*a*t,this.ky=r*a*i*.9933056200098587}distance(e,r){let t=this.wrap(e[0]-r[0])*this.kx,i=(e[1]-r[1])*this.ky;return Math.sqrt(t*t+i*i)}pointOnLine(e,r){let t=1/0,i,a,o,s;for(let l=0;l1?(n=e[l+1][0],u=e[l+1][1]):h>0&&(n+=c/this.kx*h,u+=f/this.ky*h)),c=this.wrap(r[0]-n)*this.kx,f=(r[1]-u)*this.ky;let d=c*c+f*f;d180;)e-=360;return e}},Rx=class dw{constructor(r,t){this.type=Ra,this.geojson=r,this.geometries=t}static parse(r,t){if(r.length!==2)return t.error(`'distance' expression requires exactly one argument, but found ${r.length-1} instead.`);if(Qv(r[1])){let i=r[1];if(i.type==="FeatureCollection")return new dw(i,i.features.map(a=>c6(a.geometry)).flat());if(i.type==="Feature")return new dw(i,c6(i.geometry));if("type"in i&&"coordinates"in i)return new dw(i,c6(i))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return iQ(r,this.geometries);if(r.geometryType()==="LineString")return aQ(r,this.geometries);if(r.geometryType()==="Polygon")return nQ(r,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},JP=class $j{constructor(r){let t=null;for(let i of r)if(!t)t=i.type;else{if(t===i.type)continue;t=co;break}this.type=pc(t??co,r.length),this.arr=r}static parse(r,t){if(r.length!==2)return t.error(`'semiliteral' expression requires exactly one argument, but found ${r.length-1} instead.`);if(!Qv(r[1]))return t.error(`invalid value of type "${typeof r[1]}"`);let i=r[1],a=Ml(i);if(a.kind==="array"){let o=i.map(s=>t.parse(s,null,co));return new $j(o)}return new H0(a,i)}evaluate(r){return this.arr.map(t=>t.evaluate(r))}eachChild(r){this.arr.forEach(r)}outputDefined(){return this.arr.every(r=>r.outputDefined())}},zx=class Wj{constructor(r){this.key=r,this.type=co}static parse(r,t){if(r.length!==2)return t.error(`Expected 1 argument, but found ${r.length-1} instead.`);let i=r[1];return i==null?t.error("Global state property must be defined."):typeof i=="string"?new Wj(i):t.error(`Global state property must be string, but found ${typeof r[1]} instead.`)}evaluate(r){var t,i;let a=(t=r.globals)==null?void 0:t.globalState;return!a||Object.keys(a).length===0?null:(i=U1(a,this.key))!=null?i:null}eachChild(){}outputDefined(){return!1}},W0={"==":VP,"!=":GP,">":$P,"<":HP,">=":YP,"<=":WP,array:kd,at:BP,boolean:kd,case:UP,coalesce:AT,collator:MT,format:xT,image:ZP,in:OP,"index-of":NP,interpolate:Rf,"interpolate-hcl":Rf,"interpolate-lab":Rf,length:KP,let:wT,literal:H0,match:jP,number:kd,"number-format":XP,object:kd,semiliteral:JP,slice:qP,step:Fx,string:kd,"to-boolean":$0,"to-color":$0,"to-number":$0,"to-string":$0,var:TT,within:Px,distance:Rx,"global-state":zx},Qh=class extends Error{constructor(e,r){super(r),this.message=r,this.key=e}},QP=class Yj{constructor(r,t=[]){this.parent=r,this.bindings={};for(let[i,a]of t)this.bindings[i]=a}concat(r){return new Yj(this,r)}get(r){if(this.bindings[r])return this.bindings[r];if(this.parent)return this.parent.get(r);throw Error(`${r} not found in scope.`)}has(r){return this.bindings[r]?!0:this.parent?this.parent.has(r):!1}},kT=class Xj{constructor(r,t,i=[],a,o=new QP,s=[]){this.registry=r,this.path=i,this.key=i.map(l=>`[${l}]`).join(""),this.scope=o,this.errors=s,this.expectedType=a,this._isConstant=t}parse(r,t,i,a,o={}){return t?this.concat(t,i,a)._parse(r,o):this._parse(r,o)}_parse(r,t){(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number")&&(r=["literal",r]);let i=this.key;function a(o,s,l){return l==="assert"?new kd(s,[o],i):l==="coerce"?new $0(s,[o],i):o}if(Array.isArray(r)){if(r.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let o=r[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=this.registry[o];if(s){let l=s.parse(r,this);if(!l)return null;if(this.expectedType){let n=this.expectedType,u=l.type;if((n.kind==="string"||n.kind==="number"||n.kind==="boolean"||n.kind==="object"||n.kind==="array")&&u.kind==="value")l=a(l,n,t.typeAnnotation||"assert");else if(n.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(n.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(n.kind)&&["value","number","array"].includes(u.kind)||n.kind==="colorArray"&&["value","string","array"].includes(u.kind)||n.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))l=a(l,n,t.typeAnnotation||"coerce");else if(this.checkSubtype(n,u))return null}if(!(l instanceof H0)&&l.type.kind!=="resolvedImage"&&this._isConstant(l)){let n=new _T;try{l=new H0(l.type,l.evaluate(n))}catch(u){return this.error(u.message),null}}return l}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return r===void 0?this.error("'undefined' value invalid. Use null instead."):typeof r=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof r} instead.`)}concat(r,t,i){let a=typeof r=="number"?this.path.concat(r):this.path,o=i?this.scope.concat(i):this.scope;return new Xj(this.registry,this._isConstant,a,t||null,o,this.errors)}error(r,...t){let i=`${this.key}${t.map(a=>`[${a}]`).join("")}`;this.errors.push(new Qh(i,r))}checkSubtype(r,t){let i=j1(r,t);return i&&this.error(i),i}},Yp=class xy{constructor(r,t,i,a,o){this.name=r,this.type=t,this._evaluate=i,this.args=a,this.key=o}evaluate(r){return this._evaluate(r,this.args,this.key)}eachChild(r){this.args.forEach(r)}outputDefined(){return!1}static parse(r,t){let i=r[0],a=xy.definitions[i];if(!a)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(a)?a[0]:a.type,s=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,l=s.filter(([u])=>!Array.isArray(u)||u.length===r.length-1),n=null;for(let[u,c]of l){n=new kT(t.registry,q_,t.path,null,t.scope);let f=[],h=!1;for(let d=1;dsQ(f)).join(" | "),c=[];for(let f=1;f{throw new Xs(r.evaluate(e),t)}],typeof:[so,[co],(e,[r])=>ll(Ml(r.evaluate(e)))],"to-rgba":[pc(Ra,4),[dh],(e,[r])=>{let[t,i,a,o]=r.evaluate(e).rgb;return[t*255,i*255,a*255,o]}],rgb:[dh,[Ra,Ra,Ra],W9],rgba:[dh,[Ra,Ra,Ra,Ra],W9],has:{type:Ao,overloads:[[[so],(e,[r])=>Y9(r.evaluate(e),e.properties())],[[so,Wp],(e,[r,t])=>Y9(r.evaluate(e),t.evaluate(e))]]},get:{type:co,overloads:[[[so],(e,[r])=>f6(r.evaluate(e),e.properties())],[[so,Wp],(e,[r,t])=>f6(r.evaluate(e),t.evaluate(e))]]},"feature-state":[co,[so],(e,[r])=>f6(r.evaluate(e),e.featureState||{})],properties:[Wp,[],e=>e.properties()],"geometry-type":[so,[],e=>e.geometryType()],id:[co,[],e=>e.id()],zoom:[Ra,[],e=>e.globals.zoom],"heatmap-density":[Ra,[],e=>e.globals.heatmapDensity||0],elevation:[Ra,[],e=>e.globals.elevation||0],"line-progress":[Ra,[],e=>e.globals.lineProgress||0],accumulated:[co,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[Ra,z0(Ra),(e,r)=>{let t=0;for(let i of r)t+=i.evaluate(e);return t}],"*":[Ra,z0(Ra),(e,r)=>{let t=1;for(let i of r)t*=i.evaluate(e);return t}],"-":{type:Ra,overloads:[[[Ra,Ra],(e,[r,t])=>r.evaluate(e)-t.evaluate(e)],[[Ra],(e,[r])=>-r.evaluate(e)]]},"/":[Ra,[Ra,Ra],(e,[r,t])=>r.evaluate(e)/t.evaluate(e)],"%":[Ra,[Ra,Ra],(e,[r,t])=>r.evaluate(e)%t.evaluate(e)],ln2:[Ra,[],()=>Math.LN2],pi:[Ra,[],()=>Math.PI],e:[Ra,[],()=>Math.E],"^":[Ra,[Ra,Ra],(e,[r,t])=>r.evaluate(e)**+t.evaluate(e)],sqrt:[Ra,[Ra],(e,[r])=>Math.sqrt(r.evaluate(e))],log10:[Ra,[Ra],(e,[r])=>Math.log(r.evaluate(e))/Math.LN10],ln:[Ra,[Ra],(e,[r])=>Math.log(r.evaluate(e))],log2:[Ra,[Ra],(e,[r])=>Math.log(r.evaluate(e))/Math.LN2],sin:[Ra,[Ra],(e,[r])=>Math.sin(r.evaluate(e))],cos:[Ra,[Ra],(e,[r])=>Math.cos(r.evaluate(e))],tan:[Ra,[Ra],(e,[r])=>Math.tan(r.evaluate(e))],asin:[Ra,[Ra],(e,[r])=>Math.asin(r.evaluate(e))],acos:[Ra,[Ra],(e,[r])=>Math.acos(r.evaluate(e))],atan:[Ra,[Ra],(e,[r])=>Math.atan(r.evaluate(e))],min:[Ra,z0(Ra),(e,r)=>Math.min(...r.map(t=>t.evaluate(e)))],max:[Ra,z0(Ra),(e,r)=>Math.max(...r.map(t=>t.evaluate(e)))],abs:[Ra,[Ra],(e,[r])=>Math.abs(r.evaluate(e))],round:[Ra,[Ra],(e,[r])=>{let t=r.evaluate(e);return t<0?-Math.round(-t):Math.round(t)}],floor:[Ra,[Ra],(e,[r])=>Math.floor(r.evaluate(e))],ceil:[Ra,[Ra],(e,[r])=>Math.ceil(r.evaluate(e))],"filter-==":[Ao,[so,co],(e,[r,t])=>e.properties()[r.value]===t.value],"filter-id-==":[Ao,[co],(e,[r])=>e.id()===r.value],"filter-type-==":[Ao,[so],(e,[r])=>e.geometryType()===r.value],"filter-<":[Ao,[so,co],(e,[r,t])=>{let i=e.properties()[r.value],a=t.value;return typeof i==typeof a&&i{let t=e.id(),i=r.value;return typeof t==typeof i&&t":[Ao,[so,co],(e,[r,t])=>{let i=e.properties()[r.value],a=t.value;return typeof i==typeof a&&i>a}],"filter-id->":[Ao,[co],(e,[r])=>{let t=e.id(),i=r.value;return typeof t==typeof i&&t>i}],"filter-<=":[Ao,[so,co],(e,[r,t])=>{let i=e.properties()[r.value],a=t.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Ao,[co],(e,[r])=>{let t=e.id(),i=r.value;return typeof t==typeof i&&t<=i}],"filter->=":[Ao,[so,co],(e,[r,t])=>{let i=e.properties()[r.value],a=t.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Ao,[co],(e,[r])=>{let t=e.id(),i=r.value;return typeof t==typeof i&&t>=i}],"filter-has":[Ao,[co],(e,[r])=>{let t=r.value,i=e.properties();return t in i&&i[t]!==void 0}],"filter-has-id":[Ao,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[Ao,[pc(so)],(e,[r])=>r.value.indexOf(e.geometryType())>=0],"filter-id-in":[Ao,[pc(co)],(e,[r])=>r.value.indexOf(e.id())>=0],"filter-in-small":[Ao,[so,pc(co)],(e,[r,t])=>t.value.indexOf(e.properties()[r.value])>=0],"filter-in-large":[Ao,[so,pc(co)],(e,[r,t])=>oQ(e.properties()[r.value],t.value,0,t.value.length-1)],all:{type:Ao,overloads:[[[Ao,Ao],(e,[r,t])=>r.evaluate(e)&&t.evaluate(e)],[z0(Ao),(e,r)=>{for(let t of r)if(!t.evaluate(e))return!1;return!0}]]},any:{type:Ao,overloads:[[[Ao,Ao],(e,[r,t])=>r.evaluate(e)||t.evaluate(e)],[z0(Ao),(e,r)=>{for(let t of r)if(t.evaluate(e))return!0;return!1}]]},"!":[Ao,[Ao],(e,[r])=>!r.evaluate(e)],"is-supported-script":[Ao,[so],(e,[r])=>{let t=e.globals&&e.globals.isSupportedScript;return!t||t(r.evaluate(e))}],upcase:[so,[so],(e,[r])=>r.evaluate(e).toUpperCase()],downcase:[so,[so],(e,[r])=>r.evaluate(e).toLowerCase()],concat:[so,z0(co),(e,r)=>r.map(t=>q1(t.evaluate(e))).join("")],split:[pc(so),[so,so],(e,[r,t])=>r.evaluate(e).split(t.evaluate(e))],join:[so,[pc(so),so],(e,[r,t])=>r.evaluate(e).join(t.evaluate(e))],"resolved-locale":[so,[gg],(e,[r])=>r.evaluate(e).resolvedLocale()]}),Bx=/^(.*)-transition$/,Ox=class{constructor(e,r,t,i){this.expression=e,this._warningHistory={},this._evaluator=new _T,this._defaultValue=t?tL(t):null,this._enumValues=t&&t.type==="enum"?t.values:null,this._globalState=i,this._rootKey=r}evaluateWithoutErrorHandling(e,r,t,i,a,o){return this._globalState&&(e=am(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=t,this._evaluator.canonical=i,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,r,t,i,a,o){this._globalState&&(e=am(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=t||null,this._evaluator.canonical=i,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new Xs(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let l=s instanceof Xs?s.path:"",n=`${l}|${s.message}`;return this._warningHistory[n]||(this._warningHistory[n]=!0,typeof console<"u"&&console.warn(J9(this._rootKey,l,s.message,this._defaultValue))),this._defaultValue}}},bm=class{constructor(e,r,t){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!$1(r.expression),this.globalStateRefs=X1(r.expression),this._globalState=t}evaluateWithoutErrorHandling(e,r,t,i,a,o){return this._globalState&&(e=am(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,r,t,i,a,o)}evaluate(e,r,t,i,a,o){return this._globalState&&(e=am(e,this._globalState)),this._styleExpression.evaluate(e,r,t,i,a,o)}},wg=class{constructor(e,r,t,i,a){this.kind=e,this.zoomStops=t,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!$1(r.expression),this.globalStateRefs=X1(r.expression),this.interpolationType=i,this._globalState=a}evaluateWithoutErrorHandling(e,r,t,i,a,o){return this._globalState&&(e=am(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,r,t,i,a,o)}evaluate(e,r,t,i,a,o){return this._globalState&&(e=am(e,this._globalState)),this._styleExpression.evaluate(e,r,t,i,a,o)}interpolationFactor(e,r,t){return this.interpolationType?Rf.interpolationFactor(this.interpolationType,e,r,t):0}},CT=class Zj{constructor(r,t,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,Q9(t),this._parameters=r,this._specification=i,this._rootKey=t,this._defaultValue=tL(i),this._warningHistory={};let a=Z9(this._parameters,this._specification);this.kind=a.kind,this.interpolationFactor=a.interpolationFactor,this.zoomStops=a.zoomStops,this.interpolationType=a.interpolationType,this._innerEvaluate=a.evaluate}evaluate(r,t){try{return this._innerEvaluate(r,t)}catch(i){let a=i instanceof Error?i.message:String(i),o=`|${a}`;return this._warningHistory[o]||(this._warningHistory[o]=!0,typeof console<"u"&&console.warn(J9(this._rootKey,"",a,this._defaultValue))),this._defaultValue}}static deserialize(r){return new Zj(r._parameters,r._rootKey,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification,_rootKey:r._rootKey}}},eI={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},DT={promoteId:EQ},LT=1114111,tI=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i,FT={"*"(){return[]},array:y6,boolean:TQ,number:K_,color:_6,constants:lL,enum:K1,filter:x6,function:uL,layer:pL,object:Ff,source:vL,light:mL,sky:gL,terrain:yL,projection:IQ,projectionDefinition:RQ,string:Vp,formatted:kQ,resolvedImage:CQ,padding:DQ,numberArray:LQ,colorArray:FQ,variableAnchorOffsetCollection:PQ,sprite:_L,state:xL,fontFaces:bL},Pf.source=hh(fh(vL)),Pf.sprite=hh(fh(_L)),Pf.glyphs=hh(fh(wL)),Pf.fontFaces=hh(fh(bL)),Pf.light=hh(fh(mL)),Pf.sky=hh(fh(gL)),Pf.terrain=hh(fh(yL)),Pf.state=hh(fh(xL)),Pf.layer=hh(fh(pL)),Pf.filter=hh(fh(x6)),Pf.paintProperty=hh(fh(hL)),Pf.layoutProperty=hh(fh(dL)),rI={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},iI=class{constructor(e,r,t){this._rootKey=r,this._globalState=t,this.setValue(e)}evaluate(){var e;return(e=this._literalValue)!=null?e:this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none"){this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let r=W_(e,this._rootKey,rI,this._globalState);if(r.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(r.value.map(t=>`${t.key}: ${t.message}`).join(", "));this._literalValue=void 0,this._compiledValue=r.value,this._globalStateRefs=X1(r.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}},Hc=Pf,PT=new Set(Object.keys(mi).filter(e=>e.startsWith("source_")).map(e=>e.slice(7).replaceAll("_","-"))),Nx=class Kj{constructor(r,t,i){let a=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;let s=new Int32Array(this.arrayBuffer);r=s[0],t=s[1],i=s[2],this.d=t+2*i;for(let u=0;u=f[d+0]&&a>=f[d+1])?(l[h]=!0,s.push(c[h])):l[h]=!1}}}_forEachCell(r,t,i,a,o,s,l,n){let u=this._convertToCellCoord(r),c=this._convertToCellCoord(t),f=this._convertToCellCoord(i),h=this._convertToCellCoord(a);for(let d=u;d<=f;d++)for(let p=c;p<=h;p++){let g=this.d*p+d;if((!n||n(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&o.call(this,r,t,i,a,g,s,l,n))return}}_convertFromCellCoord(r){return(r-this.padding)/this.scale}_convertToCellCoord(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let r=this.cells,t=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let a=new Int32Array(t+i+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;let o=t;for(let s=0;st?(this.lastIntegerZoom=t+1,this.lastIntegerZoomTime=r):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*t}:{fromScale:.5,toScale:1,t:1-(1-t)*r}}},Ux="-transition",Tg=class{constructor(e,r,t,i){this.property=e,this.value=r,this.expression=mQ(r===void 0?e.specification.default:r,t,e.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,r,t){return this.property.possiblyEvaluate(this,e,r,t)}},qx=class{constructor(e,r,t){this.property=e,this.value=new Tg(e,void 0,r,t)}transitioned(e,r){return new IT(this.property,this.value,r,yn({},e.transition,this.transition),e.now)}untransitioned(){return new IT(this.property,this.value,null,{},0)}},Ag=class{constructor(e,r,t){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=t,this._rootKey=r}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return cf(this._values[e].value.value)}setValue(e,r){Object.hasOwn(this._values,e)||(this._values[e]=new qx(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new Tg(this._values[e].property,r===null?void 0:cf(r),this._propertyRootKey(e),this._globalState)}getTransition(e){return cf(this._values[e].transition)}setTransition(e,r){Object.hasOwn(this._values,e)||(this._values[e]=new qx(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=cf(r)||void 0}serialize(){let e={};for(let r of Object.keys(this._values)){let t=this.getValue(r);t!==void 0&&(e[r]=t);let i=this.getTransition(r);i!==void 0&&(e[`${r}${Ux}`]=i)}return e}transitioned(e,r){let t=new RT(this._properties);for(let i of Object.keys(this._values))t._values[i]=this._values[i].transitioned(e,r._values[i]);return t}untransitioned(){let e=new RT(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}},IT=class{constructor(e,r,t,i,a){this.property=e,this.value=r,this.begin=a+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=t)}possiblyEvaluate(e,r,t){let i=e.now||0,a=this.value.possiblyEvaluate(e,r,t),o=this.prior;if(!o)return a;if(i>this.end||this.value.isDataDriven())return this.prior=null,a;if(ii.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:t,to:r}}interpolate(e){return e}},zT=class{constructor(e,r){this.specification=e,this.name=r}possiblyEvaluate(e,r,t,i){if(e.value!==void 0){if(e.expression.kind==="constant"){let a=e.expression.evaluate(r,null,{},t,i);return this._calculate(a,a,a,r)}return this._calculate(e.expression.evaluate(new ns(Math.floor(r.zoom-1),r)),e.expression.evaluate(new ns(Math.floor(r.zoom),r)),e.expression.evaluate(new ns(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,t,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:t,to:r}}interpolate(e){return e}},Sg=class{constructor(e,r){this.specification=e,this.name=r}possiblyEvaluate(e,r,t,i){return!!e.expression.evaluate(r,null,{},t,i)}interpolate(){return!1}},vu=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in e){let t=e[r];t.specification.overridable&&this.overridableProperties.push(r);let i=this.defaultPropertyValues[r]=new Tg(t,void 0,t.name,void 0),a=this.defaultTransitionablePropertyValues[r]=new qx(t,t.name,void 0);this.defaultTransitioningPropertyValues[r]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}},Qa("DataDrivenProperty",Fn),Qa("DataConstantProperty",Ha),Qa("CrossFadedDataDrivenProperty",wm),Qa("CrossFadedProperty",zT),Qa("ColorRampProperty",Sg),BT=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",Vx=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",ph=class extends Nl{constructor(e,r,t){if(super(),this.id=e.id,this.type=e.type,this._globalState=t,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=NQ(this.visibility,`layers[${this.id}].layout.visibility`,t),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Z1(e.filter,`layers[${this.id}].filter`,t)),r.layout&&(this._unevaluatedLayout=new aI(r.layout,`layers[${this.id}].layout`,t)),r.paint)){this._transitionablePaint=new Ag(r.paint,`layers[${this.id}].paint`,t);for(let i in e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(let i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Mg(r.paint)}}setFilter(e){this.filter=e,this._featureFilter=Z1(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){var r;if(e==="visibility")return this.visibility;if((r=this._transitionablePaint)!=null&&r.hasProperty(e))throw Error(e+BT);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let r of this._visibilityExpression.getGlobalStateRefs())e.add(r);if(this._unevaluatedLayout)for(let r in this._unevaluatedLayout._values){let t=this._unevaluatedLayout._values[r];for(let i of t.getGlobalStateRefs())e.add(i)}for(let r of this._featureFilter.getGlobalStateRefs())e.add(r);return e}getPaintAffectingGlobalStateRefs(){var e;let r=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let i=this._transitionablePaint._values[t].value;for(let a of i.getGlobalStateRefs()){let o=(e=r.get(a))!=null?e:[];o.push({name:t,value:i.value}),r.set(a,o)}}return r}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,r,t={}){var i;if(e==="visibility"){this.visibility=r,this._visibilityExpression.setValue(r),this.recalculateVisibility();return}if((i=this._transitionablePaint)!=null&&i.hasProperty(e)){this.fire(new Ln(Error(e+BT)));return}r!=null&&this._validate(Hc.layoutProperty,`layers.${this.id}.layout.${e}`,e,r,t)||this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){var r,t;if(e.endsWith("-transition")){let i=e.slice(0,-11);if(i==="visibility"||(r=this._unevaluatedLayout)!=null&&r.hasProperty(i))throw Error(e+Vx);return this._transitionablePaint.getTransition(i)}if(e==="visibility"||(t=this._unevaluatedLayout)!=null&&t.hasProperty(e))throw Error(e+Vx);return this._transitionablePaint.getValue(e)}setPaintProperty(e,r,t={}){var i;if(e==="visibility"||(i=this._unevaluatedLayout)!=null&&i.hasProperty(e))return this.fire(new Ln(Error(e+Vx))),!1;if(r!=null&&this._validate(Hc.paintProperty,`layers.${this.id}.paint.${e}`,e,r,t))return!1;if(e.endsWith("-transition"))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{let a=this._transitionablePaint._values[e],o=a.property.specification["property-type"]==="cross-faded-data-driven",s=a.value.isDataDriven(),l=a.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);let n=this._transitionablePaint._values[e].value;return n.isDataDriven()||s||o||this._handleOverridablePaintPropertyUpdate(e,l,n)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,t){return!1}isHidden(e=this.minzoom,r=!1){return this.minzoom&&e<(r?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&e>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){var e,r;let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)==null?void 0:e.serialize(),paint:(r=this._transitionablePaint)==null?void 0:r.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),b9(t,(i,a)=>i!==void 0&&!(a==="layout"&&!Object.keys(i).length)&&!(a==="paint"&&!Object.keys(i).length))}_validate(e,r,t,i,a={}){return Q1(this,e,{key:r,layerType:this.type,objectKey:t,value:i},a)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let r=this.paint.get(e);if(r instanceof zf&&rm(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}},oI=()=>nI||(nI=new vu({"raster-opacity":new Ha(mi.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new Ha(mi.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new Ha(mi.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new Ha(mi.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new Ha(mi.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new Ha(mi.paint_raster["raster-contrast"],"raster-contrast"),resampling:new Ha(mi.paint_raster.resampling,"resampling"),"raster-resampling":new Ha(mi.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new Ha(mi.paint_raster["raster-fade-duration"],"raster-fade-duration")})),sI={get paint(){return oI()}},Gx=e=>e.type==="raster",lI=class extends ph{constructor(e,r){super(e,sI,r)}},uI={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Tm=class{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},il=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}},Am=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let t=this.length;return this.resize(t+1),this.emplace(t,e,r)}emplace(e,r,t){let i=e*2;return this.int16[i+0]=r,this.int16[i+1]=t,e}},Am.prototype.bytesPerElement=4,Qa("StructArrayLayout2i4",Am),Eg=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*3;return this.int16[a+0]=r,this.int16[a+1]=t,this.int16[a+2]=i,e}},Eg.prototype.bytesPerElement=6,Qa("StructArrayLayout3i6",Eg),Hx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,t,i)}emplace(e,r,t,i,a){let o=e*4;return this.int16[o+0]=r,this.int16[o+1]=t,this.int16[o+2]=i,this.int16[o+3]=a,e}},Hx.prototype.bytesPerElement=8,Qa("StructArrayLayout4i8",Hx),$x=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,t,i,a,o)}emplace(e,r,t,i,a,o,s){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=t,this.int16[l+2]=i,this.int16[l+3]=a,this.int16[l+4]=o,this.int16[l+5]=s,e}},$x.prototype.bytesPerElement=12,Qa("StructArrayLayout2i4i12",$x),Wx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,t,i,a,o)}emplace(e,r,t,i,a,o,s){let l=e*4,n=e*8;return this.int16[l+0]=r,this.int16[l+1]=t,this.uint8[n+4]=i,this.uint8[n+5]=a,this.uint8[n+6]=o,this.uint8[n+7]=s,e}},Wx.prototype.bytesPerElement=8,Qa("StructArrayLayout2i4ub8",Wx),Mm=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let t=this.length;return this.resize(t+1),this.emplace(t,e,r)}emplace(e,r,t){let i=e*2;return this.float32[i+0]=r,this.float32[i+1]=t,e}},Mm.prototype.bytesPerElement=8,Qa("StructArrayLayout2f8",Mm),Yx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,r,t,i,a,o,s,l,n,u)}emplace(e,r,t,i,a,o,s,l,n,u,c){let f=e*10;return this.uint16[f+0]=r,this.uint16[f+1]=t,this.uint16[f+2]=i,this.uint16[f+3]=a,this.uint16[f+4]=o,this.uint16[f+5]=s,this.uint16[f+6]=l,this.uint16[f+7]=n,this.uint16[f+8]=u,this.uint16[f+9]=c,e}},Yx.prototype.bytesPerElement=20,Qa("StructArrayLayout10ui20",Yx),Xx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,t,i,a,o,s,l)}emplace(e,r,t,i,a,o,s,l,n){let u=e*8;return this.uint16[u+0]=r,this.uint16[u+1]=t,this.uint16[u+2]=i,this.uint16[u+3]=a,this.uint16[u+4]=o,this.uint16[u+5]=s,this.uint16[u+6]=l,this.uint16[u+7]=n,e}},Xx.prototype.bytesPerElement=16,Qa("StructArrayLayout8ui16",Xx),Zx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n,u,c,f,h){let d=this.length;return this.resize(d+1),this.emplace(d,e,r,t,i,a,o,s,l,n,u,c,f,h)}emplace(e,r,t,i,a,o,s,l,n,u,c,f,h,d){let p=e*14,g=e*7;return this.int16[p+0]=r,this.int16[p+1]=t,this.int16[p+2]=i,this.int16[p+3]=a,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=l,this.uint16[p+7]=n,this.int16[p+8]=u,this.int16[p+9]=c,this.int16[p+10]=f,this.int16[p+11]=h,this.float32[g+6]=d,e}},Zx.prototype.bytesPerElement=28,Qa("StructArrayLayout4i4ui4i1f28",Zx),Kx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*3;return this.float32[a+0]=r,this.float32[a+1]=t,this.float32[a+2]=i,e}},Kx.prototype.bytesPerElement=12,Qa("StructArrayLayout3f12",Kx),Jx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let t=e*1;return this.uint32[t+0]=r,e}},Jx.prototype.bytesPerElement=4,Qa("StructArrayLayout1ul4",Jx),Qx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n){let u=this.length;return this.resize(u+1),this.emplace(u,e,r,t,i,a,o,s,l,n)}emplace(e,r,t,i,a,o,s,l,n,u){let c=e*10,f=e*5;return this.int16[c+0]=r,this.int16[c+1]=t,this.int16[c+2]=i,this.int16[c+3]=a,this.int16[c+4]=o,this.int16[c+5]=s,this.uint32[f+3]=l,this.uint16[c+8]=n,this.uint16[c+9]=u,e}},Qx.prototype.bytesPerElement=20,Qa("StructArrayLayout6i1ul2ui20",Qx),eb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,t,i,a,o)}emplace(e,r,t,i,a,o,s){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=t,this.int16[l+2]=i,this.int16[l+3]=a,this.int16[l+4]=o,this.int16[l+5]=s,e}},eb.prototype.bytesPerElement=12,Qa("StructArrayLayout2i2i2i12",eb),tb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,t,i,a)}emplace(e,r,t,i,a,o){let s=e*4,l=e*8;return this.float32[s+0]=r,this.float32[s+1]=t,this.float32[s+2]=i,this.int16[l+6]=a,this.int16[l+7]=o,e}},tb.prototype.bytesPerElement=16,Qa("StructArrayLayout2f1f2i16",tb),rb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,t,i,a,o)}emplace(e,r,t,i,a,o,s){let l=e*16,n=e*4,u=e*8;return this.uint8[l+0]=r,this.uint8[l+1]=t,this.float32[n+1]=i,this.float32[n+2]=a,this.int16[u+6]=o,this.int16[u+7]=s,e}},rb.prototype.bytesPerElement=16,Qa("StructArrayLayout2ub2f2i16",rb),kg=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*3;return this.uint16[a+0]=r,this.uint16[a+1]=t,this.uint16[a+2]=i,e}},kg.prototype.bytesPerElement=6,Qa("StructArrayLayout3ui6",kg),ib=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y){let _=this.length;return this.resize(_+1),this.emplace(_,e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y)}emplace(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_){let v=e*26,x=e*13,S=e*52;return this.int16[v+0]=r,this.int16[v+1]=t,this.uint16[v+2]=i,this.uint16[v+3]=a,this.uint32[x+2]=o,this.uint32[x+3]=s,this.uint32[x+4]=l,this.uint16[v+10]=n,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[x+7]=f,this.float32[x+8]=h,this.uint8[S+36]=d,this.uint8[S+37]=p,this.uint8[S+38]=g,this.uint32[x+10]=m,this.int16[v+22]=y,this.float32[x+12]=_,e}},ib.prototype.bytesPerElement=52,Qa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",ib),ab=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S,M,C,w,k,A,b,E){let T=this.length;return this.resize(T+1),this.emplace(T,e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S,M,C,w,k,A,b,E)}emplace(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S,M,C,w,k,A,b,E,T){let F=e*34,D=e*17;return this.int16[F+0]=r,this.int16[F+1]=t,this.int16[F+2]=i,this.int16[F+3]=a,this.int16[F+4]=o,this.int16[F+5]=s,this.int16[F+6]=l,this.int16[F+7]=n,this.uint16[F+8]=u,this.uint16[F+9]=c,this.uint16[F+10]=f,this.uint16[F+11]=h,this.uint16[F+12]=d,this.uint16[F+13]=p,this.uint16[F+14]=g,this.uint16[F+15]=m,this.uint16[F+16]=y,this.uint16[F+17]=_,this.uint16[F+18]=v,this.uint16[F+19]=x,this.uint16[F+20]=S,this.uint16[F+21]=M,this.uint16[F+22]=C,this.uint32[D+12]=w,this.float32[D+13]=k,this.float32[D+14]=A,this.uint16[F+30]=b,this.uint16[F+31]=E,this.float32[D+16]=T,e}},ab.prototype.bytesPerElement=68,Qa("StructArrayLayout8i15ui1ul2f2ui1f68",ab),Cg=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let t=e*1;return this.float32[t+0]=r,e}},Cg.prototype.bytesPerElement=4,Qa("StructArrayLayout1f4",Cg),nb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*6,o=e*3;return this.uint16[a+0]=r,this.float32[o+1]=t,this.float32[o+2]=i,e}},nb.prototype.bytesPerElement=12,Qa("StructArrayLayout1ui2f12",nb),ob=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*2,o=e*4;return this.uint32[a+0]=r,this.uint16[o+2]=t,this.uint16[o+3]=i,e}},ob.prototype.bytesPerElement=8,Qa("StructArrayLayout1ul2ui8",ob),sb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let t=this.length;return this.resize(t+1),this.emplace(t,e,r)}emplace(e,r,t){let i=e*2;return this.uint16[i+0]=r,this.uint16[i+1]=t,e}},sb.prototype.bytesPerElement=4,Qa("StructArrayLayout2ui4",sb),lb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let t=e*1;return this.uint16[t+0]=r,e}},lb.prototype.bytesPerElement=2,Qa("StructArrayLayout1ui2",lb),ub=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,t,i)}emplace(e,r,t,i,a){let o=e*4;return this.float32[o+0]=r,this.float32[o+1]=t,this.float32[o+2]=i,this.float32[o+3]=a,e}},ub.prototype.bytesPerElement=16,Qa("StructArrayLayout4f16",ub),OT=class extends Tm{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Wr(this.anchorPointX,this.anchorPointY)}},OT.prototype.size=20,NT=class extends Qx{get(e){return new OT(this,e)}},Qa("CollisionBoxArray",NT),jT=class extends Tm{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}},jT.prototype.size=52,UT=class extends ib{get(e){return new jT(this,e)}},Qa("PlacedSymbolArray",UT),qT=class extends Tm{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}},qT.prototype.size=68,VT=class extends ab{get(e){return new qT(this,e)}},Qa("SymbolInstanceArray",VT),GT=class extends Cg{getoffsetX(e){return this.float32[e*1+0]}},Qa("GlyphOffsetArray",GT),HT=class extends Eg{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}},Qa("SymbolLineVertexArray",HT),$T=class extends Tm{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}},$T.prototype.size=12,WT=class extends nb{get(e){return new $T(this,e)}},Qa("TextAnchorOffsetArray",WT),YT=class extends Tm{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]}},YT.prototype.size=8,XT=class extends ob{get(e){return new YT(this,e)}},Qa("FeatureIndexArray",XT),sp=class extends Am{},cI=class extends Eg{},fI=class extends Hx{},hI=class extends Am{},dI=class extends Am{},pI=class extends $x{},vI=class extends Wx{},mI=class extends Mm{},Y0=class extends Yx{},ZT=class extends Xx{},gI=class extends Zx{},yI=class extends Kx{},_I=class extends Jx{},KT=class extends eb{},xI=class extends tb{},bI=class extends rb{},wI=class extends kg{},ed=class extends kg{},cb=class extends sb{},TI=class extends lb{},fb=ul([{name:"a_pos",components:2,type:"Int16"}],4),AI=fb.members,fb.size,fb.alignment,Ks=class n1{constructor(r=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=r}prepareSegment(r,t,i,a){let o=this.segments[this.segments.length-1];return r>n1.MAX_VERTEX_ARRAY_LENGTH&&To(`Max vertices per segment is ${n1.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${n1.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+r>n1.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==a?this.createNewSegment(t,i,a):o}createNewSegment(r,t,i){let a={vertexOffset:r.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(a.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(a),a}getOrCreateLatestSegment(r,t,i){return this.prepareSegment(0,r,t,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let r of this.segments)for(let t in r.vaos)r.vaos[t].destroy()}static simpleSegment(r,t,i,a){return new n1([{vertexOffset:r,primitiveOffset:t,vertexLength:i,primitiveLength:a,vaos:{},sortKey:0}])}},Ks.MAX_VERTEX_ARRAY_LENGTH=2**16-1,Qa("SegmentVector",Ks),MI=ul([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),SI=ul([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),EI=wx(((e,r)=>{function t(i,a){for(var o=i.length&3,s=i.length-o,l=a,n,u=3432918353,c=461845907,f,h=0;h>>16)*u&65535)<<16)&4294967295,f=f<<15|f>>>17,f=(f&65535)*c+(((f>>>16)*c&65535)<<16)&4294967295,l^=f,l=l<<13|l>>>19,n=(l&65535)*5+(((l>>>16)*5&65535)<<16)&4294967295,l=(n&65535)+27492+(((n>>>16)+58964&65535)<<16);switch(f=0,o){case 3:f^=(i.charCodeAt(h+2)&255)<<16;case 2:f^=(i.charCodeAt(h+1)&255)<<8;case 1:f^=i.charCodeAt(h)&255,f=(f&65535)*u+(((f>>>16)*u&65535)<<16)&4294967295,f=f<<15|f>>>17,f=(f&65535)*c+(((f>>>16)*c&65535)<<16)&4294967295,l^=f}return l^=i.length,l^=l>>>16,l=(l&65535)*2246822507+(((l>>>16)*2246822507&65535)<<16)&4294967295,l^=l>>>13,l=(l&65535)*3266489909+(((l>>>16)*3266489909&65535)<<16)&4294967295,l^=l>>>16,l>>>0}r!==void 0&&(r.exports=t)})),kI=wx(((e,r)=>{function t(i,a){for(var o=i.length,s=a^o,l=0,n;o>=4;)n=i.charCodeAt(l)&255|(i.charCodeAt(++l)&255)<<8|(i.charCodeAt(++l)&255)<<16|(i.charCodeAt(++l)&255)<<24,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>24,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^n,o-=4,++l;switch(o){case 3:s^=(i.charCodeAt(l+2)&255)<<16;case 2:s^=(i.charCodeAt(l+1)&255)<<8;case 1:s^=i.charCodeAt(l)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}r.exports=t})),hb=_P(wx(((e,r)=>{var t=EI(),i=kI();r.exports=t,r.exports.murmur3=t,r.exports.murmur2=i}))(),1),JT=class Jj{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(r,t,i,a){this.ids.push(LL(r)),this.positions.push(t,i,a)}getPositions(r){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let t=LL(r),i=0,a=this.ids.length-1;for(;i>1;this.ids[s]>=t?a=s:i=s+1}let o=[];for(;this.ids[i]===t;){let s=this.positions[3*i],l=this.positions[3*i+1],n=this.positions[3*i+2];o.push({index:s,start:l,end:n}),i++}return o}static serialize(r,t){let i=new Float64Array(r.ids),a=new Uint32Array(r.positions);return A6(i,a,0,i.length-1),t&&t.push(i.buffer,a.buffer),{ids:i,positions:a}}static deserialize(r){let t=new Jj;return t.ids=r.ids,t.positions=r.positions,t.indexed=!0,t}},Qa("FeaturePositionMap",JT),Dd=class{constructor(e,r){this.gl=e.gl,this.location=r}},En=class extends Dd{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},Xa=class extends Dd{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},mo=class extends Dd{constructor(e,r){super(e,r),this.current=[0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},vc=class extends Dd{constructor(e,r){super(e,r),this.current=[0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},Sm=class extends Dd{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},lp=class extends Dd{constructor(e,r){super(e,r),this.current=ro.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}},QT=class extends Dd{constructor(e,r){super(e,r),this.current=[]}set(e){if(e!=this.current){this.current=e;let r=new Float32Array(e.length*4);for(let t=0;t`u_${i}`),this.type=t}setUniform(e,r,t){e.set(t.constantOr(this.value))}getBinding(e,r,t){return this.type==="color"?new lp(e,r):new Xa(e,r)}},Xp=class{constructor(e,r){this.uniformNames=r.map(t=>`u_${t}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,r){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,r.y,r.height,r.width]}setUniform(e,r,t,i){let a=null;i==="u_pattern_to"?a=this.patternTo:i==="u_pattern_from"?a=this.patternFrom:i==="u_dasharray_to"?a=this.dashTo:i==="u_dasharray_from"?a=this.dashFrom:i==="u_pixel_ratio_to"?a=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(a=this.pixelRatioFrom),a!==null&&e.set(a)}getBinding(e,r,t){return t.startsWith("u_pattern")||t.startsWith("u_dasharray_")?new Sm(e,r):new Xa(e,r)}},Ld=class{constructor(e,r,t,i){this.expression=e,this.type=t,this.maxValue=0,this.paintVertexAttributes=r.map(a=>({name:`a_${a}`,type:"Float32",components:t==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,r,t){let i=this.paintVertexArray.length,a=this.expression.evaluate(new ns(0,t),r,{},t.canonical,[],t.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(i,e,a)}updatePaintArray(e,r,t,i,a){let o=this.expression.evaluate(new ns(0,a),t,i);this._setPaintValue(e,r,o)}_setPaintValue(e,r,t){if(this.type==="color"){let i=M6(t);for(let a=e;a`u_${s}_t`),this.type=t,this.useIntegerZoom=i,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=r.map(s=>({name:`a_${s}`,type:"Float32",components:t==="color"?4:2,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,r,t){let i=this.expression.evaluate(new ns(this.zoom,t),r,{},t.canonical,[],t.formattedSection),a=this.expression.evaluate(new ns(this.zoom+1,t),r,{},t.canonical,[],t.formattedSection),o=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(o,e,i,a)}updatePaintArray(e,r,t,i,a){let o=this.expression.evaluate(new ns(this.zoom,a),t,i),s=this.expression.evaluate(new ns(this.zoom+1,a),t,i);this._setPaintValue(e,r,o,s)}_setPaintValue(e,r,t,i){if(this.type==="color"){let a=M6(t),o=M6(i);for(let s=e;s`#define HAS_UNIFORM_${i}`))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let t=this.binders[r];if(t instanceof Ld||t instanceof mh)for(let i of t.paintVertexAttributes)e.push(i.name);else if(t instanceof up){let i=t.getVertexAttributes();for(let a of i)e.push(a.name)}}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let t=this.binders[r];if(t instanceof Em||t instanceof Xp||t instanceof mh)for(let i of t.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){let t=[];for(let i in this.binders){let a=this.binders[i];if(a instanceof Em||a instanceof Xp||a instanceof mh){for(let o of a.uniformNames)if(r[o]){let s=a.getBinding(e,r[o],o);t.push({name:o,property:i,binding:s})}}}return t}setUniforms(e,r,t,i){for(let{name:a,property:o,binding:s}of r)this.binders[o].setUniform(s,i,t.get(o),a)}updatePaintBuffers(e){this._buffers=[];for(let r in this.binders){let t=this.binders[r];if(e&&t instanceof up){let i=e.fromScale===2?t.zoomInPaintVertexBuffer:t.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(t instanceof Ld||t instanceof mh)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(let r in this.binders){let t=this.binders[r];(t instanceof Ld||t instanceof mh||t instanceof up)&&t.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof Ld||r instanceof mh||r instanceof up)&&r.destroy()}}},Zp=class{constructor(e,r,t=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new iA(i,r,t);this.needsUpload=!1,this._featureMap=new JT,this._bufferOffset=0}populatePaintArrays(e,r,t,i){for(let a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(e,r,i);r.id!==void 0&&this._featureMap.add(r.id,t,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,t,i){for(let a of t)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(e,this._featureMap,r,a,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}},Qa("ConstantBinder",Em),Qa("CrossFadedConstantBinder",Xp),Qa("SourceExpressionBinder",Ld),Qa("CrossFadedPatternBinder",tA),Qa("CrossFadedDasharrayBinder",rA),Qa("CompositeExpressionBinder",mh),Qa("ProgramConfiguration",iA,{omit:["_buffers"]}),Qa("ProgramConfigurationSet",Zp),db=2**14-1,aA=-db-1,nA=-32768,pb=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new hI,this.indexArray=new ed,this.segments=new Ks,this.programConfigurations=new Zp(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,t){let i=this.layers[0],a=[],o=null,s=!1,l=i.type==="heatmap";if(i.type==="circle"){let f=i;o=f.layout.get("circle-sort-key"),s=!o.isConstant(),l||(l=f.paint.get("circle-pitch-alignment")==="map")}let n=l?r.subdivisionGranularity.circle:1,u=new ns(this.zoom),c=this.layers[0]._featureFilter.needGeometry;for(let{feature:f,id:h,index:d,sourceLayerIndex:p}of e){let g=N0(f,c);if(!this.layers[0]._featureFilter.filter(u,g,t))continue;let m=s?o.evaluate(g,{},t):void 0,y={id:h,properties:f.properties,type:f.type,sourceLayerIndex:p,index:d,geometry:c?g.geometry:O0(f),patterns:{},sortKey:m};a.push(y)}s&&a.sort((f,h)=>f.sortKey-h.sortKey);for(let f of a){let{geometry:h,index:d,sourceLayerIndex:p}=f,g=e[d].feature;this.addFeature(f,h,d,t,n),r.featureIndex.insert(g,h,d,p,this.index)}}update(e,r,t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:t})}addFeatures(e){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,AI),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,t,i,a=1){let o;switch(a){case 1:o=[0,7];break;case 3:o=[0,2,5,7];break;case 5:o=[0,1,3,4,6,7];break;case 7:o=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${a}; valid values are 1, 3, 5, 7.`)}let s=o.length;for(let l of r)for(let n of l){let u=n.x,c=n.y;if(u<0||u>=8192||c<0||c>=8192)continue;let f=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),h=f.vertexLength;for(let d=0;dDI||(DI=new vu({"circle-sort-key":new Fn(mi.layout_circle["circle-sort-key"],"circle-sort-key")})),PI=()=>FI||(FI=new vu({"circle-radius":new Fn(mi.paint_circle["circle-radius"],"circle-radius"),"circle-color":new Fn(mi.paint_circle["circle-color"],"circle-color"),"circle-blur":new Fn(mi.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new Fn(mi.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new Ha(mi.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new Ha(mi.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new Ha(mi.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new Ha(mi.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new Fn(mi.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new Fn(mi.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new Fn(mi.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})),II={get paint(){return PI()},get layout(){return LI()}},RI=e=>e.type==="circle",zI=class extends ph{constructor(e,r){super(e,II,r)}createBucket(e){return new pb(e)}queryRadius(e){let r=e;return sm("circle-radius",this,r)+sm("circle-stroke-width",this,r)+ex(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:t,geometry:i,transform:a,pixelsToTileUnits:o,unwrappedTileID:s,getElevation:l}){let n=tx(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-a.bearingInRadians,o),u=this.paint.get("circle-radius").evaluate(r,t)+this.paint.get("circle-stroke-width").evaluate(r,t),c=this.paint.get("circle-pitch-scale"),f=this.paint.get("circle-pitch-alignment"),h,d;return f==="map"?(h=n,d=u*o):(h=iee(n,a,s,l),d=u),BL({queryGeometry:h,size:d,transform:a,unwrappedTileID:s,getElevation:l,pitchAlignment:f,pitchScale:c},i)}},oA=class extends pb{},Qa("HeatmapBucket",oA,{omit:["layers"]}),OI=()=>BI||(BI=new vu({"heatmap-radius":new Fn(mi.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new Fn(mi.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new Ha(mi.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Sg(mi.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new Ha(mi.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})),NI={get paint(){return OI()}},vb=class Qj{constructor(r,t){C6(this,r,1,t)}resize(r){OL(this,r,1)}clone(){return new Qj({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(r,t,i,a,o){D6(r,t,i,a,o,1)}},Rs=class eU{constructor(r,t){C6(this,r,4,t)}resize(r){OL(this,r,4)}replace(r,t){t?this.data.set(r):this.data=r instanceof Uint8ClampedArray?new Uint8Array(r.buffer):r}clone(){return new eU({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(r,t,i,a,o){D6(r,t,i,a,o,4)}setPixel(r,t,i){let a=(r*this.width+t)*4;this.data[a+0]=Math.round(i.r*255/i.a),this.data[a+1]=Math.round(i.g*255/i.a),this.data[a+2]=Math.round(i.b*255/i.a),this.data[a+3]=Math.round(i.a*255)}},Qa("AlphaImage",vb),Qa("RGBAImage",Rs),Dg="big-fb",jI=e=>e.type==="heatmap",UI=class extends ph{createBucket(e){return new oA(e)}constructor(e,r){super(e,NI,r),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=NL({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(Dg)}queryRadius(e){return sm("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:t,geometry:i,transform:a,pixelsToTileUnits:o,unwrappedTileID:s,getElevation:l}){return BL({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(r,t)*o,transform:a,unwrappedTileID:s,getElevation:l},i)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}},VI=()=>qI||(qI=new vu({"hillshade-illumination-direction":new Ha(mi.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new Ha(mi.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new Ha(mi.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new Ha(mi.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new Ha(mi.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new Ha(mi.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new Ha(mi.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new Ha(mi.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new Ha(mi.paint_hillshade.resampling,"resampling")})),GI={get paint(){return VI()}},HI=e=>e.type==="hillshade",$I=class extends ph{constructor(e,r){super(e,GI,r),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,t=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,a=Math.max(e.length,r.length,t.length,i.length);e=e.concat(Array(a-e.length).fill(e.at(-1))),r=r.concat(Array(a-r.length).fill(r.at(-1))),t=t.concat(Array(a-t.length).fill(t.at(-1))),i=i.concat(Array(a-i.length).fill(i.at(-1)));let o=r.map(rl);return{directionRadians:e.map(rl),altitudeRadians:o,shadowColor:i,highlightColor:t}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},YI=()=>WI||(WI=new vu({"color-relief-opacity":new Ha(mi["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Sg(mi["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new Ha(mi["paint_color-relief"].resampling,"resampling")})),XI={get paint(){return YI()}},jl=class{constructor(e,r,t,i){this.context=e,this.format=t,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(r,i)}update(e,r,t){var i;let{width:a,height:o}=e,s=(((i=this.size)==null?void 0:i[0])!==a||this.size[1]!==o)&&!t,{context:l}=this,{gl:n}=l;this.useMipmap=!!r?.useMipmap,s&&this.size&&this.format===n.RGBA&&(n.deleteTexture(this.texture),this.texture=n.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),n.bindTexture(n.TEXTURE_2D,this.texture),l.pixelStoreUnpackFlipY.set(!1),l.pixelStoreUnpack.set(1);let u=this.format===n.RGBA&&r?.premultiply!==!1;if(s)if(this.size=[a,o],this.format===n.RGBA&&a>0&&o>0){let c=this.useMipmap?Math.floor(Math.log2(Math.max(a,o)))+1:1;if(n.texStorage2D(n.TEXTURE_2D,c,n.RGBA8,a,o),rx(e)){l.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:f}=e;u&&f&&(f=L6(f)),f&&n.texSubImage2D(n.TEXTURE_2D,0,0,0,a,o,n.RGBA,n.UNSIGNED_BYTE,f)}else l.pixelStoreUnpackPremultiplyAlpha.set(u),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,e)}else rx(e)?(l.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,u,a,o,n)):(l.pixelStoreUnpackPremultiplyAlpha.set(u),this._uploadDomImage(e,n));else{let{x:c,y:f}=t||{x:0,y:0};rx(e)?(l.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,u,c,f,a,o,n)):(l.pixelStoreUnpackPremultiplyAlpha.set(u),this._updateDomImage(e,c,f,n))}this.useMipmap&&!(rx(e)&&e.data===null)&&n.generateMipmap(n.TEXTURE_2D),l.pixelStoreUnpackFlipY.setDefault(),l.pixelStoreUnpack.setDefault(),l.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,r){r.texImage2D(r.TEXTURE_2D,0,this.format,this.format,r.UNSIGNED_BYTE,e)}_uploadRawData(e,r,t,i,a){let{data:o}=e;r&&o&&(o=L6(o)),a.texImage2D(a.TEXTURE_2D,0,this.format,t,i,0,this.format,a.UNSIGNED_BYTE,o)}_updateDomImage(e,r,t,i){i.texSubImage2D(i.TEXTURE_2D,0,r,t,i.RGBA,i.UNSIGNED_BYTE,e)}_updateRawData(e,r,t,i,a,o,s){let{data:l}=e;r&&l&&(l=L6(l)),s.texSubImage2D(s.TEXTURE_2D,0,t,i,a,o,s.RGBA,s.UNSIGNED_BYTE,l)}bind(e,r,t){let{context:i}=this,{gl:a}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),a.bindTexture(a.TEXTURE_2D,this.texture),(t===a.LINEAR_MIPMAP_NEAREST||t===a.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(t=a.LINEAR);let o=t||e;e!==this.magFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),this.magFilter=e),o!==this.minFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,o),this.minFilter=o),r!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,r),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,r),this.wrap=r)}generateMipmap(){if(!this.useMipmap)return;let{gl:e}=this.context;e.bindTexture(e.TEXTURE_2D,this.texture),e.generateMipmap(e.TEXTURE_2D)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},ZI=(km=class{constructor(e,r,t,i=1,a=1,o=1,s=0){if(this.uid=e,r.height!==r.width)throw RangeError("DEM tiles must be square");if(t&&!["mapbox","terrarium","custom"].includes(t)){To(`"${t}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),km.byteViewCache.set(this,new Uint8Array(this.data.buffer)),t){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=a,this.blueFactor=o,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let u=-2;u=l)&&this.data.copyWithin(this._idx(0,u),c,c+l),this.data.fill(this.data[c],this._idx(-2,u),this._idx(0,u)),this.data.fill(this.data[c+l-1],this._idx(l,u),this._idx(l+1,u)+1)}let n=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let u=0;uthis.max&&(this.max=h),h=this.dim||i<-1||i>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),o=((i+2)*this.stride+t+2)*4,s=this.stride*4,l=e-t,n=r-i,u=this._unpackAtIndex(a,o),c=this._unpackAtIndex(a,o+4),f=this._unpackAtIndex(a,o+s),h=this._unpackAtIndex(a,o+s+4);return u*(1-l)*(1-n)+c*l*(1-n)+f*(1-l)*n+h*l*n}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,t){return e*this.redFactor+r*this.greenFactor+t*this.blueFactor-this.baseShift}pack(e){return jL(e,this.getUnpackVector())}getPixels(){return new Rs({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,t){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let i=r*this.dim,a=r*this.dim+this.dim,o=t*this.dim,s=t*this.dim+this.dim;switch(r){case-1:i=a-2;break;case 1:a=i+2}switch(t){case-1:o=s-2;break;case 1:s=o+2}let l=-r*this.dim,n=-t*this.dim;for(let u=o;ue.type==="color-relief",JI=class extends ph{constructor(e,r){super(e,XI,r)}_createColorRamp(e){let r={elevationStops:[],colorStops:[]},t=this._transitionablePaint._values["color-relief-color"].value.expression;if(t instanceof bm&&t._styleExpression.expression instanceof Rf){this.colorRampExpression=t;let o=t._styleExpression.expression;r.elevationStops=o.labels,r.colorStops=[];for(let s of r.elevationStops)r.colorStops.push(o.evaluate({globals:{elevation:s}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[ro.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=e)return r;let i={elevationStops:[],colorStops:[]},a=(r.elevationStops.length-1)/(e-1);for(let o=0;oe)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=r}getGranularityForZoomLevel(e){let r=1<32767||r>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let t=Math.round(e)|0,i=Math.round(r)|0,a=this._getKey(t,i);if(this._vertexDictionary.has(a))return this._vertexDictionary.get(a);let o=this._vertexBuffer.length/2;return this._vertexDictionary.set(a,o),this._vertexBuffer.push(t,i),o}_subdivideTrianglesScanline(e){if(this._granularity<2)return Aee(this._vertexBuffer,e);let r=[],t=e.length;for(let i=0;i=1||x<=0)||m&&(na)){c>=i&&c<=a&&o.push(t[(s+1)%3]);continue}if(!m&&v>0){let C=l+d*v,w=n+p*v;o.push(this._vertexToIndex(C,w))}let S=l+d*Math.max(v,0),M=l+d*Math.min(x,1);if(g||this._generateIntraEdgeVertices(o,l,n,u,c,S,M),!m&&x<1){let C=l+d*x,w=n+p*x;o.push(this._vertexToIndex(C,w))}(m||c>=i&&c<=a)&&o.push(t[(s+1)%3]),!m&&(c<=i||c>=a)&&this._generateInterEdgeVertices(o,l,n,u,c,f,h,M,i,a)}return o}_generateIntraEdgeVertices(e,r,t,i,a,o,s){let l=i-r,n=a-t,u=n===0,c=u?Math.min(r,i):Math.min(o,s),f=u?Math.max(r,i):Math.max(o,s),h=Math.floor(c/this._granularityCellSize)+1,d=Math.ceil(f/this._granularityCellSize)-1;if(u?r=h;p--){let g=p*this._granularityCellSize,m=t+n*(g-r)/l;e.push(this._vertexToIndex(g,m))}}_generateInterEdgeVertices(e,r,t,i,a,o,s,l,n,u){let c=a-t,f=o-i,h=s-a,d=(n-a)/h,p=(u-a)/h,g=Math.min(d,p),m=Math.max(d,p),y=i+f*g,_=Math.floor(Math.min(y,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(y,l)/this._granularityCellSize)-1,x=l=1||m<=0){let C=r-o,w=t-s,k=(n-s)/w,A=(u-s)/w,b=o+C*Math.min(k,A);_=Math.floor(Math.min(b,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(b,l)/this._granularityCellSize)-1,x=l0?u:n;if(x)for(let C=_;C<=v;C++){let w=C*this._granularityCellSize;e.push(this._vertexToIndex(w,M))}else for(let C=v;C>=_;C--){let w=C*this._granularityCellSize;e.push(this._vertexToIndex(w,M))}}_generateOutline(e){let r=[];for(let t of e){let i=U0(t,this._granularity,!0),a=this._pointArrayToIndices(i),o=[];for(let s=1;sa==(o===-32768)?(e.push(t),e.push(r),e.push(this._vertexToIndex(i,o)),e.push(this._vertexToIndex(a,o)),e.push(t),e.push(this._vertexToIndex(i,o))):(e.push(r),e.push(t),e.push(this._vertexToIndex(i,o)),e.push(t),e.push(this._vertexToIndex(a,o)),e.push(this._vertexToIndex(i,o)))}_fillPoles(e,r,t){let i=this._vertexBuffer,a=Bi,o=e.length;for(let s=2;s=2&&((t=this._canonical)==null?void 0:t.z)===0&&(o=this._removeTrianglesOutsideTileX(o),s=s.map(l=>this._removeLinesOutsideTileX(l))),{verticesFlattened:this._vertexBuffer,indicesTriangles:o,indicesLineList:s}}_vertexOutsideTileX(e){let r=this._vertexBuffer[e*2];return r<0||r>8192}_removeTrianglesOutsideTileX(e){let r=[];for(let t=0;tr.id),this.index=e.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new dI,this.indexArray=new ed,this.indexArray2=new cb,this.programConfigurations=new Zp(e.layers,e.zoom),this.segments=new Ks,this.segments2=new Ks,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,t){this.hasDependencies=ix("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),a=!i.isConstant(),o=[],s=new ns(this.zoom),l=this.layers[0]._featureFilter.needGeometry;for(let{feature:n,id:u,index:c,sourceLayerIndex:f}of e){let h=N0(n,l);if(!this.layers[0]._featureFilter.filter(s,h,t))continue;let d=a?i.evaluate(h,{},t,r.availableImages):void 0,p={id:u,properties:n.properties,type:n.type,sourceLayerIndex:f,index:c,geometry:l?h.geometry:O0(n),patterns:{},sortKey:d};o.push(p)}a&&o.sort((n,u)=>n.sortKey-u.sortKey);for(let n of o){let{geometry:u,index:c,sourceLayerIndex:f}=n;if(this.hasDependencies){let d=F6("fill",this.layers,n,{zoom:this.zoom},r);this.patternFeatures.push(d)}else this.addFeature(n,u,c,t,{},r.subdivisionGranularity);let h=e[c].feature;r.featureIndex.insert(h,u,c,f,this.index)}}update(e,r,t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:t})}addFeatures({options:e,canonical:r,patternPositions:t,patternMap:i}){this.detectSdfPatterns(i);for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,r,t,e.subdivisionGranularity)}detectSdfPatterns(e){for(let r of this.patternFeatures)for(let t in r.patterns){let i=r.patterns[t];this.recordSdfPattern(t,e[i.min]),this.recordSdfPattern(t,e[i.mid]),this.recordSdfPattern(t,e[i.max])}for(let r of this.layers){let t=r.paint.get("fill-pattern").constantOr(null);t&&(this.recordSdfPattern(r.id,e[t.from.toString()]),this.recordSdfPattern(r.id,e[t.to.toString()]))}}recordSdfPattern(e,r){if(!r)return;let t=r.sdf===!0,i=this.sdfPatterns[e];i===void 0?this.sdfPatterns[e]=t:i!==t&&To(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${e}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,QI),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,r,t,i,a,o){for(let s of z_(r,500)){let l=YL(s,i,o.fill.getGranularityForZoomLevel(i.z)),n=this.layoutVertexArray;XL((u,c)=>{n.emplaceBack(u,c)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles,this.segments2,this.indexArray2,l.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,t,{imagePositions:a,canonical:i})}},Qa("FillBucket",sA,{omit:["layers","patternFeatures"]}),rR=()=>tR||(tR=new vu({"fill-sort-key":new Fn(mi.layout_fill["fill-sort-key"],"fill-sort-key")})),aR=()=>iR||(iR=new vu({"fill-antialias":new Ha(mi.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new Fn(mi.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new Ha(mi.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new Fn(mi.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new Fn(mi.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new Ha(mi.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new Ha(mi.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new wm(mi.paint_fill["fill-pattern"],"fill-pattern")})),nR={get paint(){return aR()},get layout(){return rR()}},oR=e=>e.type==="fill",sR=class extends ph{constructor(e,r){super(e,nR,r)}recalculate(e,r){super.recalculate(e,r);let t=this.paint._values["fill-outline-color"];t.value.kind==="constant"&&t.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new sA(e)}queryRadius(){return ex(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:r,transform:t,pixelsToTileUnits:i}){return IL(tx(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-t.bearingInRadians,i),r)}isTileClipped(){return!0}},Tb=ul([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),lR=ul([{name:"a_centroid",components:2,type:"Int16"}],4),uR=Tb.members,Tb.size,Tb.alignment,gh=class oE{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(r){return this.minX=Math.min(this.minX,r.x),this.minY=Math.min(this.minY,r.y),this.maxX=Math.max(this.maxX,r.x),this.maxY=Math.max(this.maxY,r.y),this}expandBy(r){return this.minX-=r,this.minY-=r,this.maxX+=r,this.maxY+=r,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(r){return this.expandBy(-r)}map(r){let t=new oE;return t.extend(r(new Wr(this.minX,this.minY))),t.extend(r(new Wr(this.maxX,this.minY))),t.extend(r(new Wr(this.minX,this.maxY))),t.extend(r(new Wr(this.maxX,this.maxY))),t}static fromPoints(r){let t=new oE;for(let i of r)t.extend(i);return t}contains(r){return r.x>=this.minX&&r.x<=this.maxX&&r.y>=this.minY&&r.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(r){return!this.empty()&&!r.empty()&&r.minX>=this.minX&&r.maxX<=this.maxX&&r.minY>=this.minY&&r.maxY<=this.maxY}intersects(r){return!this.empty()&&!r.empty()&&r.minX<=this.maxX&&r.maxX>=this.minX&&r.minY<=this.maxY&&r.maxY>=this.minY}},cR=gh.fromPoints([new Wr(0,0),new Wr(Bi,Bi)]),Rm=class{constructor(e,r,t,i,a){for(this.properties=Object.create(null),this.extent=t,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=a;e.pos>3,o===0)continue}if(o--,a===1)s+=e.readSVarint(),l+=e.readSVarint(),i&&t.push(i),i=[new Wr(s,l)];else if(a===2)s+=e.readSVarint(),l+=e.readSVarint(),i&&i.push(new Wr(s,l));else if(a===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${a}`)}return i&&t.push(i),t}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,t=1,i=0,a=0,o=0,s=1/0,l=-1/0,n=1/0,u=-1/0;for(;e.pos>3,i===0)continue}if(i--,t===1||t===2)a+=e.readSVarint(),o+=e.readSVarint(),al&&(l=a),ou&&(u=o);else if(t!==7)throw Error(`unknown command ${t}`)}return[s,n,l,u]}toGeoJSON(e,r,t){let i=this.extent*2**t,a=this.extent*e,o=this.extent*r,s=this.loadGeometry();function l(f){return[(f.x+a)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(f.y+o)*2/i)*Math.PI))-90]}function n(f){return f.map(l)}let u;if(this.type===1){let f=[];for(let d of s)f.push(d[0]);let h=n(f);u=f.length===1?{type:"Point",coordinates:h[0]}:{type:"MultiPoint",coordinates:h}}else if(this.type===2){let f=s.map(n);u=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}}else if(this.type===3){let f=KL(s),h=[];for(let d of f)h.push(d.map(n));u=h.length===1?{type:"Polygon",coordinates:h[0]}:{type:"MultiPolygon",coordinates:h}}else throw Error("unknown feature type");let c={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(c.id=this.id),c}},Rm.types=["Unknown","Point","LineString","Polygon"],fR=class{constructor(e,r){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],r===void 0&&(r=e.length);e.pos=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new Rm(this._pbf,r,this.extent,this._keys,this._values)}},hR=class{constructor(e,r=e.length){let t=Object.create(null);for(;e.pos90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new by(ch(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(r){let t=Math.PI/180,i=this.lat*t,a=r.lat*t,o=Math.sin(i)*Math.sin(a)+Math.cos(i)*Math.cos(a)*Math.cos((r.lng-this.lng)*t);return mc*Math.acos(Math.min(o,1))}static convert(r){if(r instanceof by)return r;if(Array.isArray(r)&&(r.length===2||r.length===3))return new by(Number(r[0]),Number(r[1]));if(!Array.isArray(r)&&typeof r=="object"&&r)return new by(Number("lng"in r?r.lng:r.lon),Number(r.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}},lA=2*Math.PI*mc,Qo=class tU{constructor(r,t,i=0){this.x=+r,this.y=+t,this.z=+i}static fromLngLat(r,t=0){let i=An.convert(r);return new tU(lm(i.lng),um(i.lat),q0(t,i.lat))}toLngLat(){return new An(B6(this.x),og(this.y))}toAltitude(){return QL(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/lA*Dee(og(this.y))}},Jp=89.25,Ab=8192,uA=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new pI,this.centroidVertexArray=new sp,this.indexArray=new ed,this.programConfigurations=new Zp(e.layers,e.zoom),this.segments=new Ks,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,t){this.features=[],this.hasDependencies=ix("fill-extrusion",this.layers,r);let i=new ns(this.zoom),a=this.layers[0],o=a.layout.get("fill-extrusion-rounded-corner-distance"),s=a._featureFilter.needGeometry;for(let{feature:l,id:n,index:u,sourceLayerIndex:c}of e){let f=N0(l,s);if(!a._featureFilter.filter(i,f,t))continue;let h=s?f.geometry:O0(l),d={id:n,sourceLayerIndex:c,index:u,geometry:o>0?rF(h,o,t):h,properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(F6("fill-extrusion",this.layers,d,{zoom:this.zoom},r)):this.addFeature(d,d.geometry,u,t,{},r.subdivisionGranularity),r.featureIndex.insert(l,d.geometry,u,c,this.index,!0)}}addFeatures({options:e,canonical:r,patternPositions:t}){for(let i of this.features){let{geometry:a}=i;this.addFeature(i,a,i.index,r,t,e.subdivisionGranularity)}}update(e,r,t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:t})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,uR),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,lR.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,t,i,a,o){let s=this.layers[0],l=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0,n=l>0?rF(r,l,i):r;for(let u of z_(n,500)){let c={x:0,y:0,sampleCount:0},f=this.layoutVertexArray.length;this.processPolygon(c,i,e,u,o);let h=this.layoutVertexArray.length-f,d=Math.floor(c.x/c.sampleCount),p=Math.floor(c.y/c.sampleCount);for(let g=0;g{ug(u,c,f,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,n.verticesFlattened,n.indicesTriangles)}_generateSideFaces(e,r){let t=0;for(let i=1;iKs.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=a.sub(o)._perp()._unit(),l=o.dist(a);t+l>32768&&(t=0),ug(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,t),ug(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,t),t+=l,ug(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,0,t),ug(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,1,t);let n=r.segment.vertexLength;this.indexArray.emplaceBack(n,n+2,n+1),this.indexArray.emplaceBack(n+1,n+2,n+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}},Qa("FillExtrusionBucket",uA,{omit:["layers","features"]}),pR=()=>dR||(dR=new vu({"fill-extrusion-rounded-corner-distance":new Ha(mi["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})),mR=()=>vR||(vR=new vu({"fill-extrusion-opacity":new Ha(mi["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new Fn(mi["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new Ha(mi["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new Ha(mi["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new wm(mi["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new Fn(mi["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new Fn(mi["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new Ha(mi["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})),gR={get paint(){return mR()},get layout(){return pR()}},yR=e=>e.type==="fill-extrusion",_R=class extends ph{constructor(e,r){super(e,gR,r)}createBucket(e){return new uA(e)}queryRadius(){return ex(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:t,geometry:i,transform:a,pixelsToTileUnits:o,pixelPosMatrix:s}){let l=tx(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,o),n=this.paint.get("fill-extrusion-height").evaluate(r,t),u=this.paint.get("fill-extrusion-base").evaluate(r,t),c=jee(l,s,0),f=Nee(i,u,n,s),h=f[0],d=f[1];return Oee(h,d,c)}},jae=new Uint32Array(96),xR="geojsonvt_clip_start",bR="geojsonvt_clip_end",Mb=ul([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),wR=Mb.members,Mb.size,Mb.alignment,Sb=ul([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),TR=Sb.members,Sb.size,Sb.alignment,AR=Math.cos(75/2*(Math.PI/180)),cA=1/2,fA=2**14/cA,hA=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let r of this.layers)this.gradients[r.id]={};this.layoutVertexArray=new vI,this.layoutVertexArray2=new mI,this.indexArray=new ed,this.programConfigurations=new Zp(e.layers,e.zoom),this.segments=new Ks,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,t){this.hasDependencies=ix("line",this.layers,r)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),a=!i.isConstant(),o=[],s=new ns(this.zoom),l=this.layers[0]._featureFilter.needGeometry;for(let{feature:n,id:u,index:c,sourceLayerIndex:f}of e){let h=N0(n,l);if(!this.layers[0]._featureFilter.filter(s,h,t))continue;let d=a?i.evaluate(h,{},t):void 0,p={id:u,properties:n.properties,type:n.type,sourceLayerIndex:f,index:c,geometry:l?h.geometry:O0(n),patterns:{},dashes:{},sortKey:d};o.push(p)}a&&o.sort((n,u)=>n.sortKey-u.sortKey);for(let n of o){let{geometry:u,index:c,sourceLayerIndex:f}=n;this.hasDependencies?(ix("line",this.layers,r)?F6("line",this.layers,n,{zoom:this.zoom},r):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,n,this.zoom,r),this.patternFeatures.push(n)):this.addFeature(n,u,c,t,{},{},r.subdivisionGranularity);let h=e[c].feature;r.featureIndex.insert(h,u,c,f,this.index)}}update(e,r,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:t,dashPositions:i})}addFeatures({options:e,canonical:r,patternPositions:t,dashPositions:i}){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,r,t,i,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,TR)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wR),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,"geojsonvt_clip_start")&&Object.hasOwn(e.properties,"geojsonvt_clip_end"))return{start:+e.properties[xR],end:+e.properties[bR]}}addFeature(e,r,t,i,a,o,s){let l=this.layers[0].layout,n=l.get("line-join").evaluate(e,{}),u=l.get("line-cap").evaluate(e,{}),c=l.get("line-miter-limit").evaluate(e,{}),f=l.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let h of r)this.addLine(h,e,n,u,c,f,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,t,{imagePositions:a,dashPositions:o,canonical:i})}addLine(e,r,t,i,a,o,s,l){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let n=s?l.line.getGranularityForZoomLevel(s.z):1;if(e=U0(e,n),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v=2&&e[c-1].equals(e[c-2]);)c--;let f=0;for(;f0;if(k&&v>f){let T=p.dist(g);if(T>2*h){let F=p.sub(p.sub(g)._mult(h/T)._round());this.updateDistance(g,F),this.addCurrentVertex(F,y,0,0,d),g=F}}let b=g&&m,E=b?t:u?"butt":i;if(b&&E==="round"&&(Ca&&(E="bevel"),E==="bevel"&&(C>2&&(E="flipbevel"),C100)x=_.mult(-1);else{let T=C*y.add(_).mag()/y.sub(_).mag();x._perp()._mult(T*(A?-1:1))}this.addCurrentVertex(p,x,0,0,d),this.addCurrentVertex(p,x.mult(-1),0,0,d)}else if(E==="bevel"||E==="fakeround"){let T=-Math.sqrt(C*C-1),F=A?T:0,D=A?0:T;if(g&&this.addCurrentVertex(p,y,F,D,d),E==="fakeround"){let R=Math.round(w*180/Math.PI/20);for(let P=1;P2*h){let F=p.add(m.sub(p)._mult(h/T)._round());this.updateDistance(p,F),this.addCurrentVertex(F,_,0,0,d),p=F}}}}addCurrentVertex(e,r,t,i,a,o=!1){let s=r.x+r.y*t,l=r.y-r.x*t,n=-r.x+r.y*i,u=-r.y-r.x*i;this.addHalfVertex(e,s,l,o,!1,t,a),this.addHalfVertex(e,n,u,o,!0,-i,a),this.distance>fA/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,t,i,a,o))}addHalfVertex({x:e,y:r},t,i,a,o,s,l){let n=(this.lineClips?this.scaledDistance*(fA-1):this.scaledDistance)*cA;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!a,(r<<1)+ +!!o,Math.round(63*t)+128,Math.round(63*i)+128,(s===0?0:s<0?-1:1)+1|(n&63)<<2,n>>6),this.lineClips){let c=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(c,this.lineClipsArray.length)}let u=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),l.primitiveLength++),o?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}hasLineDasharray(e){for(let r of e){let t=r.paint.get("line-dasharray");if(t&&!t.isConstant())return!0}return!1}addLineDashDependencies(e,r,t,i){for(let a of e){let o=a.paint.get("line-dasharray");if(!o||o.value.kind==="constant")continue;let s=a.layout.get("line-cap").evaluate(r,{})==="round",l={dasharray:o.value.evaluate({zoom:t-1},r,{}),round:s},n={dasharray:o.value.evaluate({zoom:t},r,{}),round:s},u={dasharray:o.value.evaluate({zoom:t+1},r,{}),round:s},c=`${l.dasharray.join(",")},${l.round}`,f=`${n.dasharray.join(",")},${n.round}`,h=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[c]=l,i.dashDependencies[f]=n,i.dashDependencies[h]=u,r.dashes[a.id]={min:c,mid:f,max:h}}}},Qa("LineBucket",hA,{omit:["layers","patternFeatures"]}),SR=()=>MR||(MR=new vu({"line-cap":new Fn(mi.layout_line["line-cap"],"line-cap"),"line-join":new Fn(mi.layout_line["line-join"],"line-join"),"line-miter-limit":new Fn(mi.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new Fn(mi.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new Fn(mi.layout_line["line-sort-key"],"line-sort-key")})),kR=()=>ER||(ER=new vu({"line-opacity":new Fn(mi.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new Ha(mi.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new Fn(mi.paint_line["line-color"],"line-color"),"line-translate":new Ha(mi.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new Ha(mi.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new Fn(mi.paint_line["line-width"],"line-width"),"line-gap-width":new Fn(mi.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new Fn(mi.paint_line["line-offset"],"line-offset"),"line-blur":new Fn(mi.paint_line["line-blur"],"line-blur"),"line-dasharray":new wm(mi.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new wm(mi.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Sg(mi.paint_line["line-gradient"],"line-gradient")})),dA={get paint(){return kR()},get layout(){return SR()}},CR=class extends Fn{possiblyEvaluate(e,r){return r=new ns(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,t,i){return r=yn({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,t,i)}},DR=e=>e.type==="line",LR=class extends ph{constructor(e,r){super(e,dA,r),this.gradientVersion=0,Eb||(Eb=new CR(dA.paint.properties["line-width"].specification,"line-floorwidth"),Eb.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();this.stepInterpolant=vQ(r)?r._styleExpression.expression instanceof Fx:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=Eb.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new hA(e)}queryRadius(e){let r=e,t=aF(sm("line-width",this,r),sm("line-gap-width",this,r)),i=sm("line-offset",this,r);return t/2+Math.abs(i)+ex(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:t,geometry:i,transform:a,pixelsToTileUnits:o}){let s=tx(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,o),l=o/2*aF(this.paint.get("line-width").evaluate(r,t),this.paint.get("line-gap-width").evaluate(r,t)),n=this.paint.get("line-offset").evaluate(r,t);return n&&(i=JQ(i,n*o)),$Q(s,i,l)}isTileClipped(){return!0}},FR=ul([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),PR=ul([{name:"a_projected_pos",components:3,type:"Float32"}],4),ul([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),IR=ul([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),ul([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),pA=ul([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),RR=ul([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),ul([{name:"triangle",components:3,type:"Uint16"}]),ul([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),ul([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),ul([{type:"Float32",name:"offsetX"}]),ul([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ul([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]),Fg=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Fg.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(e,r){return Xr(this,null,function*(){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let t=e.pluginURL,i=new Promise(o=>{this.loadScriptResolve=o}),a=new Promise(o=>setTimeout(()=>o(),this.TIMEOUT));if(yield r(t),yield Promise.race([i,a]),this.isParsed()){let o={pluginStatus:"loaded",pluginURL:t};return this.setState(o),o}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${t}`)})}},zR={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},BR={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},OR={\u0644\u0622:[65269,65270],\u0644\u0623:[65271,65272],\u0644\u0625:[65273,65274],\u0644\u0627:[65275,65276]},vA=1604,NR=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/,mA=new Map;for(let[e,r]of Object.entries(zR))Yee(r,e,mA);gA=typeof Intl<"u"&&"Segmenter"in Intl,X0={"!":"\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","\u22EF":"\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"},jR={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},UR={40:!0},Db=class sE{constructor(r="",t=[],i=[]){this.text=r,this.sections=t,this.sectionIndex=i,this.imageSectionID=null,this._graphemes=null}graphemes(){var r;return(r=this._graphemes)!=null||(this._graphemes=j6(this.text)),this._graphemes}static fromFeature(r,t){let i=new sE;for(let a of r.sections)a.image?i.addImageSection(a):i.addTextSection(a,t);return i}length(){return this.graphemes().length}getSection(r){return this.sections[this.sectionIndex[r]]}getSectionIndex(r){return this.sectionIndex[r]}verticalizePunctuation(){this.text=fte(this.text),this._graphemes=null}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let r=this.graphemes(),t=0;for(;tt&&hF(r[i-1]);)i--;this.text=r.slice(t,i).join(""),this.sectionIndex=this.sectionIndex.slice(t,i),this._graphemes=null}substring(r,t){let i=this.graphemes().slice(r,t).join(""),a=this.sectionIndex.slice(r,t);return new sE(i,this.sections,a)}toCodeUnitIndex(r){return this.graphemes().slice(0,r).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((r,t)=>Math.max(r,this.sections[t].scale),0)}getMaxImageSize(r){let t=0,i=0;for(let a=0;a0?i[i.length-1]:"",o=j6(a+r);this.text+=r,this._graphemes=i.slice(0,a?-1:void 0).concat(o);let s=o.length-+!!a;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(r,t,i,a,o){let s=[],l=this.determineAverageLineWidth(r,t,i,a,o),n=this.hasZeroWidthSpaces(),u=this.graphemes(),c=null,f=0,h=0;for(let d=0;d0){let g=u[d-1].codePointAt(0),m=p.codePointAt(0),y=Gee(g),_=nF(g)&&nF(m);(jR[g]||y||"imageName"in this.getSection(d-1)||u[d+1]!==void 0&&UR[m]||_&&(c??(c=lte(this.text))).has(h))&&s.push(dF(d,f,l,s,hte(g,m,y&&n),!1))}U6(p.codePointAt(0))||(f+=cF(p,this.getSection(d),i,a,r,o)),h+=p.length}return pF(dF(this.length(),f,l,s,0,!0))}determineAverageLineWidth(r,t,i,a,o){let s=0,l=0;for(let u of this.graphemes()){let c=this.getSection(l);s+=cF(u,c,i,a,r,o),l++}let n=Math.max(1,Math.ceil(s/t));return s/n}},Lb=dte(),qR=/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/,VR=new Set(["WS","FSI","LRI","RLI","PDI"]),GR=new Set(["S","B"]),Fb=4294967296,Uae=1/Fb,yA=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),_A=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,r,t=this.length){let i;for(;i=this.nextField(t);)e(i,r,this);return r}readMessage(e,r){return this.readFields(e,r,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Fb;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Fb;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let r=this.buf,t=r[this.pos++];if(t<128)return t;let i=t&127,a;return a=r[this.pos++],i|=(a&127)<<7,a<128||(a=r[this.pos++],i|=(a&127)<<14,a<128)||(a=r[this.pos++],i|=(a&127)<<21,a<128)?i:(a=r[this.pos],i|=(a&15)<<28,Tte(i,e,this))}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,r=this.pos;return this.pos=e,e-r>=12&&yA?yA.decode(this.buf.subarray(r,e)):Mte(this.buf,r,e)}readBytes(){let e=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,e);return this.pos=e,r}readPackedVarint(e=[],r){let t=this.readPackedEnd();for(;this.pos=e)return 0;let r=this.readVarint();return this.type=r&7,this._valueStart=this.pos,r>>>3}skip(e){let r=e&7;if(r===0)for(;this.buf[this.pos++]>127;);else if(r===2)this.pos=this.readVarint()+this.pos;else if(r===5)this.pos+=4;else if(r===1)this.pos+=8;else throw Error(`Unimplemented type: ${r}`)}},Pb=class{constructor(e,{pixelRatio:r,version:t,isWebGLImage:i=!1,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:n}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=a,this.stretchY=o,this.content=s,this.version=t,this.needsFirstWebGLRender=i,this.textFitWidth=l,this.textFitHeight=n}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},HR=class{constructor(e,r){let t={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let a=[];this.addImages(e,t,a),this.addImages(r,i,a);let{w:o,h:s}=mF(a),l=new Rs({width:o||1,height:s||1});for(let n in e){let u=e[n];if(u.isWebGLImage)continue;let c=t[n].paddedRect;Rs.copy(u.data,l,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(let n in r){let u=r[n],c=i[n].paddedRect,f=c.x+1,h=c.y+1,d=u.data.width,p=u.data.height;Rs.copy(u.data,l,{x:0,y:0},{x:f,y:h},u.data),Rs.copy(u.data,l,{x:0,y:p-1},{x:f,y:h-1},{width:d,height:1}),Rs.copy(u.data,l,{x:0,y:0},{x:f,y:h+p},{width:d,height:1}),Rs.copy(u.data,l,{x:d-1,y:0},{x:f-1,y:h},{width:1,height:p}),Rs.copy(u.data,l,{x:0,y:0},{x:f+d,y:h},{width:1,height:p})}this.image=l,this.iconPositions=t,this.patternPositions=i}addImages(e,r,t){for(let i in e){let a=e[i],o={x:0,y:0,w:a.data.width+2,h:a.data.height+2};t.push(o),r[i]=new Pb(o,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,r){if(e.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==e.updateVersion){this.patchedUpdateVersion=e.updateVersion;for(let t in this.iconPositions)this.patchUpdatedImage(this.iconPositions[t],e.getImage(t),r);for(let t in this.patternPositions)this.patchUpdatedImage(this.patternPositions[t],e.getImage(t),r)}}patchUpdatedImage(e,r,t){var i;if(!e||!r||!e.needsFirstWebGLRender&&e.version===r.version)return;e.needsFirstWebGLRender=!1,e.version=r.version;let[a,o]=e.tl,s=(i=r.userImage)==null?void 0:i.data;if(!ux(s)){t.update(r.data,void 0,{x:a,y:o});return}let{width:l,height:n}=r.data;t.context.setCustomLayerDefaults(),s.renderWithWebGL({gl:t.context.gl,texture:t.texture,x:a,y:o,width:l,height:n}),t.context.setDirty()}},Qa("ImagePosition",Pb),Qa("ImageAtlas",HR),xA=(function(e){return e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.horizontalOnly=3]="horizontalOnly",e})(xA||{}),bA=new RegExp("^\\p{gc=M}$","u"),wA=32640,Z0=class rU extends Wr{constructor(r,t,i,a){super(r,t),this.angle=i,a!==void 0&&(this.segment=a)}clone(){return new rU(this.x,this.y,this.angle,this.segment)}},Qa("Anchor",Z0),Pg=class{constructor(e,r,t,i,a,o,s,l,n,u){var c;if(this.boxStartIndex=e.length,n){let f=o.top,h=o.bottom,d=o.collisionPadding;d&&(f-=d[1],h+=d[3]);let p=h-f;p>0&&(p=Math.max(10,p),this.circleDiameter=p)}else{let f=(c=o.image)!=null&&c.content&&(o.image.textFitWidth||o.image.textFitHeight)?bF(o):{x1:o.left,y1:o.top,x2:o.right,y2:o.bottom};f.y1=f.y1*s-l[0],f.y2=f.y2*s+l[2],f.x1=f.x1*s-l[3],f.x2=f.x2*s+l[1];let h=o.collisionPadding;if(h&&(f.x1-=h[0]*s,f.y1-=h[1]*s,f.x2+=h[2]*s,f.y2+=h[3]*s),u){let d=new Wr(f.x1,f.y1),p=new Wr(f.x2,f.y1),g=new Wr(f.x1,f.y2),m=new Wr(f.x2,f.y2),y=u*Math.PI/180;d._rotate(y),p._rotate(y),g._rotate(y),m._rotate(y),f.x1=Math.min(d.x,p.x,g.x,m.x),f.x2=Math.max(d.x,p.x,g.x,m.x),f.y1=Math.min(d.y,p.y,g.y,m.y),f.y2=Math.max(d.y,p.y,g.y,m.y)}e.emplaceBack(r.x,r.y,f.x1,f.y1,f.x2,f.y2,t,i,a)}this.boxEndIndex=e.length}},$R=class{constructor(e=[],r=(t,i)=>ti)){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:t}=this,i=r[e];for(;e>0;){let a=e-1>>1,o=r[a];if(t(i,o)>=0)break;r[e]=o,e=a}r[e]=i}_down(e){let{data:r,compare:t}=this,i=this.length>>1,a=r[e];for(;e=0)break;r[e]=r[o],e=o}r[e]=a}},K0=class{constructor(e,r,t,i){this.p=new Wr(e,r),this.h=t,this.d=nre(this.p,i),this.max=this.d+this.h*Math.SQRT2}},Ib=(function(e){return e[e.center=1]="center",e[e.left=2]="left",e[e.right=3]="right",e[e.top=4]="top",e[e.bottom=5]="bottom",e[e["top-left"]=6]="top-left",e[e["top-right"]=7]="top-right",e[e["bottom-left"]=8]="bottom-left",e[e["bottom-right"]=9]="bottom-right",e})({}),Rb=1/0,WR=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}],zb=class{constructor(e){this.layoutVertexArray=new gI,this.indexArray=new ed,this.programConfigurations=e,this.segments=new Ks,this.dynamicLayoutVertexArray=new yI,this.opacityVertexArray=new _I,this.hasVisibleVertices=!1,this.placedSymbolArray=new UT}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,t,i){this.isEmpty()||(t&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,FR.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,PR.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,WR,!0),this.opacityVertexBuffer.itemSize=1),(t||i)&&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())}},Qa("SymbolBuffers",zb),Bb=class{constructor(e,r,t){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new t,this.segments=new Ks,this.collisionVertexArray=new bI}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,IR.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}},Qa("CollisionBuffers",Bb),Ig=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=TF(this.zoom,r["text-size"]),this.iconSizeData=TF(this.zoom,r["icon-size"]);let t=this.layers[0].layout,i=t.get("symbol-sort-key"),a=t.get("symbol-z-order");this.canOverlap=gx(t,"text-overlap","text-allow-overlap")!=="never"||gx(t,"icon-overlap","icon-allow-overlap")!=="never"||t.get("text-ignore-placement")||t.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!i.isConstant();let o=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&this.canOverlap,t.get("symbol-placement")==="point"&&(this.writingModes=t.get("text-writing-mode").map(s=>xA[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=e.sourceID}createArrays(){this.text=new zb(new Zp(this.layers,this.zoom,e=>e.startsWith("text"))),this.icon=new zb(new Zp(this.layers,this.zoom,e=>e.startsWith("icon"))),this.glyphOffsetArray=new GT,this.lineVertexArray=new HT,this.symbolInstances=new VT,this.textAnchorOffsets=new WT}calculateGlyphDependencies(e,r,t,i,a){var o;let s=(i||this.allowVerticalPlacement)&&a,l=Db.fromFeature(e,t),n=l.graphemes();for(let u=0;u0)&&(s.value.kind!=="constant"||s.value.value.length>0),c=n.value.kind!=="constant"||!!n.value.value||Object.keys(n.parameters).length>0,f=o.get("symbol-sort-key");if(this.features=[],!u&&!c)return;let h=r.iconDependencies,d=r.glyphDependencies,p=r.availableImages,g=new ns(this.zoom);for(let{feature:m,id:y,index:_,sourceLayerIndex:v}of e){let x=a._featureFilter.needGeometry,S=N0(m,x);if(!a._featureFilter.filter(g,S,t))continue;x||(S.geometry=O0(m));let M;if(u){let A=a.getValueAndResolveTokens("text-field",S,t,p),b=Ed.factory(A);this.hasRTLText||(this.hasRTLText=hre(b)),M=ote(b,a,S)}let C;if(c){let A=a.getValueAndResolveTokens("icon-image",S,t,p);C=A instanceof Kh?A:Kh.fromString(A)}if(!M&&!C)continue;let w=this.sortFeaturesByKey?f.evaluate(S,{},t):void 0,k={id:y,text:M,icon:C,index:_,sourceLayerIndex:v,geometry:S.geometry,properties:m.properties,type:Rm.types[m.type],sortKey:w};if(this.features.push(k),C&&(h[C.name]=!0),M){let A=s.evaluate(S,{},t).join(","),b=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=(i=this.writingModes)==null?void 0:i.includes(2);let E=q6(M.toString());this.calculateGlyphDependencies(M,d,A,b,E);for(let T of M.sections)T.image&&(h[T.image.name]=!0)}}o.get("symbol-placement")==="line"&&(this.features=ste(this.features)),this.sortFeaturesByKey&&this.features.sort((m,y)=>m.sortKey-y.sortKey)}update(e,r,t){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,{imagePositions:t}),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,{imagePositions:t}))}addFeatures({options:e,canonical:r,glyphMap:t,glyphPositions:i,iconMap:a,iconPositions:o,showCollisionBoxes:s}){sre({bucket:this,glyphMap:t,glyphPositions:i,imageMap:a,imagePositions:o,showCollisionBoxes:s,canonical:r,subdivisionGranularity:e.subdivisionGranularity})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){let t=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(r[e.segment+1]),a=e.dist(r[e.segment]),o={};for(let s=e.segment+1;s=0;s--)o[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=r[s-1].dist(r[s]));for(let s=0;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}addIndicesForPlacedSymbol(e,r){let t=e.placedSymbolArray.get(r),i=t.vertexStartIndex+t.numGlyphs*4;for(let a=t.vertexStartIndex;ai[s]-i[l]||a[l]-a[s]),o}addToSortKeyRanges(e,r){let t=this.sortKeyRanges[this.sortKeyRanges.length-1];t?.sortKey===r?t.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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(let r of this.symbolInstanceIndexes){let t=this.symbolInstances.get(r);this.featureSortOrder.push(t.featureIndex);let i=[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex];for(let a=0;a=0&&i.indexOf(o)===a&&this.addIndicesForPlacedSymbol(this.text,o)}t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}},Qa("SymbolBucket",Ig,{omit:["layers","collisionBoxArray","features","compareText"]}),XR=()=>YR||(YR=new vu({"symbol-placement":new Ha(mi.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new Ha(mi.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new Ha(mi.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new Fn(mi.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new Ha(mi.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new Ha(mi.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new Ha(mi.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new Ha(mi.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new Ha(mi.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new Fn(mi.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new Fn(mi.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new Ha(mi.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new Ha(mi.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new Fn(mi.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new Fn(mi.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new Fn(mi.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new Ha(mi.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new Fn(mi.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new Fn(mi.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new Ha(mi.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new Ha(mi.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new Ha(mi.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new Fn(mi.layout_symbol["text-field"],"text-field"),"text-font":new Fn(mi.layout_symbol["text-font"],"text-font"),"text-size":new Fn(mi.layout_symbol["text-size"],"text-size"),"text-max-width":new Fn(mi.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new Ha(mi.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new Fn(mi.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new Fn(mi.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new Fn(mi.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new Ha(mi.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new Fn(mi.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new Fn(mi.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new Ha(mi.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new Ha(mi.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new Fn(mi.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new Ha(mi.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new Ha(mi.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new Fn(mi.layout_symbol["text-transform"],"text-transform"),"text-offset":new Fn(mi.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new Ha(mi.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new Ha(mi.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new Ha(mi.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new Ha(mi.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new Fn(mi.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new Ha(mi.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})),KR=()=>ZR||(ZR=new vu({"icon-opacity":new Fn(mi.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new Fn(mi.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new Fn(mi.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new Fn(mi.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new Fn(mi.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new Ha(mi.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new Ha(mi.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new Fn(mi.paint_symbol["text-opacity"],"text-opacity"),"text-color":new Fn(mi.paint_symbol["text-color"],"text-color",{runtimeType:dh,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Fn(mi.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new Fn(mi.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new Fn(mi.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new Ha(mi.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new Ha(mi.paint_symbol["text-translate-anchor"],"text-translate-anchor")})),Ob={get paint(){return KR()},get layout(){return XR()}},TA=class{constructor(e){if(e.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:gm,this.defaultValue=e}evaluate(e){if(e.formattedSection){let r=this.defaultValue.property.overrides;if(r?.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let r=this.defaultValue.value;e(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}},Qa("FormatSectionOverride",TA,{omit:["defaultValue"]}),AA=e=>e.type==="symbol",JR=class lE extends ph{constructor(r,t){super(r,Ob,t)}recalculate(r,t){super.recalculate(r,t);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new zf(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let a=this.layout.get("text-writing-mode");if(a){let o=[];for(let s of a)o.includes(s)||o.push(s);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(r,t,i,a){let o=this.layout.get(r).evaluate(t,{},i,a),s=this._unevaluatedLayout._values[r];return!s.isDataDriven()&&!$_(s.value)&&o?dre(t.properties,o):o}createBucket(r){return new Ig(r)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let r of Ob.paint.overridableProperties){if(!lE.hasPaintOverride(this.layout,r))continue;let t=this.paint.get(r),i=new Ox(new TA(t),`layers[${this.id}].paint.${t.property.name}`,t.property.specification),a=null;a=t.value.kind==="constant"||t.value.kind==="source"?new bm("source",i):new wg("composite",i,t.value.zoomStops),this.paint._values[r]=new zf(t.property,a,t.parameters)}}_handleOverridablePaintPropertyUpdate(r,t,i){return!this.layout||t.isDataDriven()||i.isDataDriven()?!1:lE.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,t){let i=r.get("text-field"),a=Ob.paint.properties[t],o=!1,s=l=>{var n;for(let u of l)if((n=a.overrides)!=null&&n.hasOverride(u)){o=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof Ed)s(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let l=u=>{if(!o)if(u instanceof H0&&Ml(u.value)===ym){let c=u.value;s(c.sections)}else u instanceof xT?s(u.sections):u.eachChild(l)},n=i.value;n._styleExpression&&l(n._styleExpression.expression)}return o}},e5=()=>QR||(QR=new vu({"background-color":new Ha(mi.paint_background["background-color"],"background-color"),"background-pattern":new zT(mi.paint_background["background-pattern"],"background-pattern"),"background-opacity":new Ha(mi.paint_background["background-opacity"],"background-opacity")})),t5={get paint(){return e5()}},r5=e=>e.type==="background",i5=class extends ph{constructor(e,r){super(e,t5,r)}},a5=e=>e.type==="custom",n5=class extends ph{constructor(e,r){super(e,{},r),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}},o5=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var e;this._triggered||(this._triggered=!0,(e=this._channel)==null||e.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},s5={once:!0},l5=class{constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new o5(()=>this.process()),this.subscription=W4(this.target,"message",t=>this.receive(t),!1),this.globalScope=Zv(self)?e:window}registerMessageHandler(e,r){this.messageHandlers[e]=r}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,r){return new Promise((t,i)=>{let a=Math.round(Math.random()*1e18).toString(36).substring(0,10),o=r?W4(r.signal,"abort",()=>{o?.unsubscribe(),delete this.resolveRejects[a];let n={id:a,type:"",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(n),i(new vm(r.signal.reason))},s5):null;this.resolveRejects[a]={resolve:n=>{o?.unsubscribe(),t(n)},reject:n=>{o?.unsubscribe(),i(n)}};let s=[],l=ar(Ot({},e),{id:a,sourceMapId:this.mapId,origin:location.origin,data:eg(e.data,s)});this.target.postMessage(l,{transfer:s})})}receive(e){let r=e.data,t=r.id,i=["file://","resource://android","null"],a=[r.origin,location.origin],o=r.origin===location.origin,s=a.some(l=>i.includes(l));if((o||s)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type===""){delete this.tasks[t];let l=this.abortControllers[t];delete this.abortControllers[t],l&&l.abort();return}if(Zv(self)||r.mustQueue){this.tasks[t]=r,this.taskQueue.push(t),this.invoker.trigger();return}this.processTask(t,r)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),r=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(e,r)}processTask(e,r){return Xr(this,null,function*(){if(r.type===""){let a=this.resolveRejects[e];if(delete this.resolveRejects[e],!a)return;r.error?a.reject(Zu(tg(r.error))):a.resolve(tg(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,null,null);return}let t=tg(r.data),i=new AbortController;this.abortControllers[e]=i;try{let a=yield this.messageHandlers[r.type](r.sourceMapId,t,i);this.completeTask(e,null,a)}catch(a){this.completeTask(e,Zu(a))}})}completeTask(e,r,t){let i=[];delete this.abortControllers[e];let a={id:e,type:"",sourceMapId:this.mapId,origin:location.origin,error:r?eg(r):null,data:eg(t,i)};this.target.postMessage(a,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},Rg=class{constructor(e,r,t){if(!mre(e,r,t))throw Error(`x=${r}, y=${t}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=r,this.y=t,this.key=cm(0,e,e,r,t)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,t){let i=gre(this.x,this.y,this.z),a=yre(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(t==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,a).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=2**this.z;return new Wr((e.x*r-this.x)*Bi,(e.y*r-this.y)*Bi)}toString(){return`${this.z}/${this.x}/${this.y}`}},zg=class{constructor(e,r){this.wrap=e,this.canonical=r,this.key=cm(e,r.z,r.z,r.x,r.y)}},Cu=class Bh{constructor(r,t,i,a,o){if(this.terrainRttPosMatrix32f=null,r= z; overscaledZ = ${r}; z = ${i}`);this.overscaledZ=r,this.wrap=t,this.canonical=new Rg(i,+a,+o),this.key=cm(t,r,i,a,o)}clone(){return new Bh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(r){return this.overscaledZ===r.overscaledZ&&this.wrap===r.wrap&&this.canonical.equals(r.canonical)}scaledTo(r){if(r>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);let t=this.canonical.z-r;return r>this.canonical.z?new Bh(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Bh(r,this.wrap,r,this.canonical.x>>t,this.canonical.y>>t)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(r,t){if(r>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-r;return r>this.canonical.z?cm(this.wrap*+t,r,this.canonical.z,this.canonical.x,this.canonical.y):cm(this.wrap*+t,r,r,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(r){if(r.wrap!==this.wrap||this.overscaledZ-r.overscaledZ<=0)return!1;if(r.overscaledZ===0)return this.overscaledZ>0;let t=this.canonical.z-r.canonical.z;return t<0?!1:r.canonical.x===this.canonical.x>>t&&r.canonical.y===this.canonical.y>>t}children(r){if(this.overscaledZ>=r)return[new Bh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let t=this.canonical.z+1,i=this.canonical.x*2,a=this.canonical.y*2;return[new Bh(t,this.wrap,t,i,a),new Bh(t,this.wrap,t,i+1,a),new Bh(t,this.wrap,t,i,a+1),new Bh(t,this.wrap,t,i+1,a+1)]}isLessThan(r){return this.wrapr.wrap?!1:this.overscaledZr.overscaledZ?!1:this.canonical.xr.canonical.x?!1:this.canonical.y=0&&r=0&&t=u)return null;let f=this.canonical.x+a,h=this.wrap;return f<0?(h-=Math.ceil(-f/u),f=(f%u+u)%u):f>=u&&(h+=Math.floor(f/u),f%=u),{tileID:new Bh(this.overscaledZ,h,n,f,c),x:s,y:l}}},Nb=Math.PI*6378137,Qa("CanonicalTileID",Rg),Qa("OverscaledTileID",Cu,{omit:["terrainRttPosMatrix32f"]}),Bg="_geojsonTileLayer",u5=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},MA=class{constructor(e,r,t,i,a){this.type="Feature",this._vectorTileFeature=e,this._x=t,this._y=i,this._z=r;for(let o in e.properties)typeof e.properties[o]=="string"&&e.properties[o].startsWith("__$json__:")&&(e.properties[o]=JSON.parse(e.properties[o].slice(10)));this.properties=e.properties,this.id=a}projectPoint(e,r,t,i){return[(e.x+r)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+t)*2/i)*Math.PI))-90]}projectLine(e,r,t,i){return e.map(a=>this.projectPoint(a,r,t,i))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,r=e.extent*2**this._z,t=e.extent*this._x,i=e.extent*this._y,a=e.loadGeometry();switch(e.type){case 1:{let o=[];for(let l of a)o.push(l[0]);let s=this.projectLine(o,t,i,r);this._geometry=o.length===1?{type:"Point",coordinates:s[0]}:{type:"MultiPoint",coordinates:s};break}case 2:{let o=a.map(s=>this.projectLine(s,t,i,r));this._geometry=o.length===1?{type:"LineString",coordinates:o[0]}:{type:"MultiLineString",coordinates:o};break}case 3:{let o=KL(a),s=[];for(let l of o)s.push(l.map(n=>this.projectLine(n,t,i,r)));this._geometry=s.length===1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&r!=="_x"&&r!=="_y"&&r!=="_z"&&(e[r]=this[r]);return e}},Qp=class{constructor(e,r,t){this._name=e,this.dataBuffer=r,typeof t=="number"?this._size=t:(this.nullabilityBuffer=t,this._size=t.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){var r;return((r=this.nullabilityBuffer)==null?void 0:r.get(e))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Og=class extends Qp{},jb=class extends Og{getValueFromBuffer(e){return this.dataBuffer[e]}},Ub=class extends Og{getValueFromBuffer(e){return this.dataBuffer[e]}},SA=class extends Qp{constructor(e,r,t,i){super(e,r,i),this.delta=t}},qb=class extends SA{constructor(e,r,t,i,a){super(e,a?Int32Array.of(r):Uint32Array.of(r),t,i)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},Vb=class extends Qp{constructor(e,r,t,i){super(e,i?Int32Array.of(r):Uint32Array.of(r),t)}getValueFromBuffer(e){return this.dataBuffer[0]}},c5=class{constructor(e,r,t,i,a=4096){if(this._name=e,this._geometryVector=r,this._idVector=t,this._propertyVectors=i,this._extent=a,e.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var e;return(e=this._propertyVectors)!=null?e:[]}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(r=>[r.name,r]))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],r=this.geometryVector.getGeometries();for(let t=0;t>>32-e;Hb=Gb,CA=65536,$b=xre(CA),f5=3*$b/256+$b|0,(function(e){e.PRESENT="PRESENT",e.DATA="DATA",e.OFFSET="OFFSET",e.LENGTH="LENGTH"})(El||(El={})),(function(e){e.NONE="NONE",e.SINGLE="SINGLE",e.SHARED="SHARED",e.VERTEX="VERTEX",e.MORTON="MORTON",e.FSST="FSST"})(gc||(gc={})),(function(e){e.VERTEX="VERTEX",e.INDEX="INDEX",e.STRING="STRING",e.KEY="KEY"})(Pd||(Pd={})),(function(e){e.VAR_BINARY="VAR_BINARY",e.GEOMETRIES="GEOMETRIES",e.PARTS="PARTS",e.RINGS="RINGS",e.TRIANGLES="TRIANGLES",e.SYMBOL="SYMBOL",e.DICTIONARY="DICTIONARY"})(eu||(eu={})),h5=[El.PRESENT,El.DATA,El.OFFSET,El.LENGTH],DA=[fo.NONE,fo.DELTA,fo.COMPONENTWISE_DELTA,fo.RLE,fo.MORTON],d5=[Of.NONE,Of.FAST_PFOR,Of.VARINT],p5=[gc.NONE,gc.SINGLE,gc.SHARED,gc.VERTEX,gc.MORTON,gc.FSST],v5=[Pd.VERTEX,Pd.INDEX,Pd.STRING,Pd.KEY],m5=[eu.VAR_BINARY,eu.GEOMETRIES,eu.PARTS,eu.RINGS,eu.TRIANGLES,eu.SYMBOL,eu.DICTIONARY],(function(e){e[e.FLAT=0]="FLAT",e[e.CONST=1]="CONST",e[e.SEQUENCE=2]="SEQUENCE",e[e.DICTIONARY=3]="DICTIONARY",e[e.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(js||(js={})),yh=class{constructor(e,r){this.values=e,this._size=r}get(e){let r=Math.floor(e/8),t=e%8;return(this.values[r]>>t&1)==1}set(e,r){let t=Math.floor(e/8),i=e%8;this.values[t]=this.values[t]|+!!r<>t&1}size(){return this._size}getBuffer(){return this.values}},g5=new TextDecoder,LA=class extends Og{getValueFromBuffer(e){return this.dataBuffer[e]}},FA=class extends SA{constructor(e,r,t,i,a){super(e,a?BigInt64Array.of(r):BigUint64Array.of(r),t,i)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}},(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON",e[e.MULTIPOINT=3]="MULTIPOINT",e[e.MULTILINESTRING=4]="MULTILINESTRING",e[e.MULTIPOLYGON=5]="MULTIPOLYGON"})(Du||(Du={})),(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON"})(y5||(y5={})),(function(e){e[e.MORTON=0]="MORTON",e[e.VEC_2=1]="VEC_2",e[e.VEC_3=2]="VEC_3"})(e0||(e0={})),PA=class{constructor(e,r,t,i,a){this._vertexBufferType=e,this._topologyVector=r,this._vertexOffsets=t,this._vertexBuffer=i,this._mortonSettings=a}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let r=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let t=this.vertexOffsets[e],i=this.vertexBuffer[t],a=tT(i,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[a.x,a.y]}let r=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getGeometries(){return Kie(this)}get mortonSettings(){return this._mortonSettings}},IA=class extends PA{constructor(e,r,t,i,a,o,s){super(t,i,a,o,s),this._numGeometries=e,this._geometryType=r}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Du.POLYGON||this._geometryType===Du.MULTIPOLYGON}containsSingleGeometryType(){return!0}},RA=class extends PA{constructor(e,r,t,i,a,o){super(e,t,i,a,o),this._geometryTypes=r}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;ear(Ot({},t),{[i.name]:new M5(i)}),{})}},E5=class{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Nx(Bi,16,0),this.grid3D=new Nx(Bi,16,0),this.featureIndexArray=new XT,this.promoteId=r}insert(e,r,t,i,a,o){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(t,i,a);let l=o?this.grid3D:this.grid;for(let n of r){let u=[1/0,1/0,-1/0,-1/0];for(let c of n)u[0]=Math.min(u[0],c.x),u[1]=Math.min(u[1],c.y),u[2]=Math.max(u[2],c.x),u[3]=Math.max(u[3],c.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&l.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new S5(this.rawTileData).layers:this.vtLayers=new hR(new _A(this.rawTileData)).layers,this.sourceLayerCoder=new u5(this.vtLayers?Object.keys(this.vtLayers).sort():[Bg])),this.vtLayers}query(e,r,t,i){this.loadVTLayers();let a=e.params,o=Bi/e.tileSize/e.scale,s=Z1(a.filter,"queryRenderedFeatures filter",a.globalState),l=e.queryGeometry,n=e.queryPadding*o,u=gh.fromPoints(l),c=this.grid.query(u.minX-n,u.minY-n,u.maxX+n,u.maxY+n),f=gh.fromPoints(e.cameraQueryGeometry).expandBy(n),h=this.grid3D.query(f.minX,f.minY,f.maxX,f.maxY,(g,m,y,_)=>XQ(e.cameraQueryGeometry,g-n,m-n,y+n,_+n));for(let g of h)c.push(g);c.sort(Nae);let d={},p;for(let g of c){if(g===p)continue;p=g;let m=this.featureIndexArray.get(g),y=null;this.loadMatchingFeature(d,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,a.layers,a.availableImages,r,t,i,(_,v,x)=>(y||(y=O0(_)),v.queryIntersectsFeature({queryGeometry:l,feature:_,featureState:x,geometry:y,zoom:this.z,transform:e.transform,pixelsToTileUnits:o,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return d}loadMatchingFeature(e,r,t,i,a,o,s,l,n,u,c){let f=this.bucketLayerIDs[r];if(o&&!f.some(g=>o.has(g)))return;let h=this.sourceLayerCoder.decode(t),d=this.vtLayers[h].feature(i);if(a.needGeometry){let g=N0(d,!0);if(!a.filter(new ns(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!a.filter(new ns(this.tileID.overscaledZ),d))return;let p=this.getId(d,h);for(let g of f){if(o&&!o.has(g))continue;let m=l[g];if(!m)continue;let y={};p&&u&&(y=u.getState(m.sourceLayer||"_geojsonTileLayer",p));let _=yn({},n[g]);_.paint=dP(_.paint,m.paint,d,y,s),_.layout=dP(_.layout,m.layout,d,y,s);let v=!c||c(d,m,y);if(!v)continue;let x=new MA(d,this.z,this.x,this.y,p);x.layer=_;let S=e[g];S===void 0&&(S=e[g]=[]),S.push({featureIndex:i,feature:x,intersectionZ:v})}}lookupSymbolFeatures(e,r,t,i,a,o,s,l){let n={};this.loadVTLayers();let u=Z1(a.filterSpec,"queryRenderedFeatures symbol filter",a.globalState);for(let c of e)this.loadMatchingFeature(n,t,i,c,u,o,s,l,r);return n}hasLayer(e){for(let r of this.bucketLayerIDs)for(let t of r)if(e===t)return!0;return!1}getId(e,r){var t;let i=e.id;if(this.promoteId){let a=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];i=e.properties[a],typeof i=="boolean"&&(i=Number(i)),i===void 0&&((t=e.properties)!=null&&t.cluster)&&this.promoteId&&(i=Number(e.properties.cluster_id))}return i}},Qa("FeatureIndex",E5,{omit:["rawTileData","sourceLayerCoder"]}),k5=class{constructor(e,r){this.max=e,this.onRemove=r,this.reset()}reset(){for(let e in this.data)for(let r of this.data[e])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(e,r,t){let i=e.wrapped().key;this.data[i]===void 0&&(this.data[i]=[]);let a={value:r,timeout:void 0};if(t!==void 0&&(a.timeout=setTimeout(()=>{this.remove(e,a)},t)),this.data[i].push(a),this.order.push(i),this.order.length>this.max){let o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}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){let r=this.data[e].shift();return r.timeout&&clearTimeout(r.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),r.value}getByKey(e){let r=this.data[e];return r?r[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,r){if(!this.has(e))return this;let t=e.wrapped().key,i=r===void 0?0:this.data[t].indexOf(r),a=this.data[t][i];return this.data[t].splice(i,1),a.timeout&&clearTimeout(a.timeout),this.data[t].length===0&&delete this.data[t],this.onRemove(a.value),this.order.splice(this.order.indexOf(t),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let r=this._getAndRemoveByKey(this.order[0]);r&&this.onRemove(r)}return this}filter(e){let r=[];for(let t in this.data)for(let i of this.data[t])e(i.value)||r.push(i);for(let t of r)this.remove(t.value.tileID,t)}}}}),C5={};Mr(C5,{AJAXError:()=>mm,AttributionControl:()=>TS,BoxZoomHandler:()=>uS,CanvasSource:()=>EM,CooperativeGesturesHandler:()=>bS,DoubleClickZoomHandler:()=>gS,DragPanHandler:()=>yS,DragRotateHandler:()=>_S,EXTENT:()=>Bi,EdgeInsets:()=>S2,ErrorEvent:()=>Ln,Event:()=>hf,Evented:()=>Nl,FullscreenControl:()=>E8,FullscreenEvent:()=>H2,GPUInitializationError:()=>sS,GeoJSONSource:()=>MM,GeolocateControl:()=>A8,GeolocateErrorEvent:()=>FS,GeolocateEvent:()=>n0,GeolocatePositionEvent:()=>G2,GlobeControl:()=>C8,Hash:()=>lS,ImageSource:()=>rv,KeyboardHandler:()=>pS,LngLat:()=>An,LngLatBounds:()=>bh,LogoControl:()=>AS,Map:()=>ES,MapBoxZoomEvent:()=>d2,MapContextEvent:()=>Wg,MapLibreEvent:()=>iu,MapLibreMap:()=>ES,MapMouseEvent:()=>df,MapMovementEvent:()=>kn,MapProjectionEvent:()=>_M,MapSourceDataEvent:()=>zs,MapStyleDataEvent:()=>Nf,MapStyleImageMissingEvent:()=>xM,MapStyleLoadEvent:()=>h2,MapTerrainEvent:()=>yM,MapTouchEvent:()=>jm,MapWheelEvent:()=>gM,Marker:()=>V2,MarkerClickEvent:()=>LS,MarkerDragEvent:()=>a0,MercatorCoordinate:()=>Qo,NavigationControl:()=>b8,Point:()=>Wr,Popup:()=>F8,PopupEvent:()=>$2,RasterDEMTileSource:()=>AM,RasterTileSource:()=>_2,ScaleControl:()=>S8,ScrollZoomHandler:()=>mS,Style:()=>L2,TerrainControl:()=>k8,TwoFingersTouchPitchHandler:()=>dS,TwoFingersTouchRotateHandler:()=>hS,TwoFingersTouchZoomHandler:()=>fS,TwoFingersTouchZoomRotateHandler:()=>xS,VectorTileSource:()=>TM,VideoSource:()=>SM,addProtocol:()=>pJ,addSourceType:()=>yB,clearPrewarmedResources:()=>hne,config:()=>ff,createTileMesh:()=>Y5,getGlobalDispatcher:()=>GA,getMaxParallelImageRequests:()=>Ise,getRTLTextPluginStatus:()=>Dse,getVersion:()=>Lse,getWorkerCount:()=>Fse,getWorkerUrl:()=>zse,importScriptInWorkers:()=>Ose,isTimeFrozen:()=>Yae,now:()=>hs,prewarm:()=>fne,removeProtocol:()=>vJ,restoreNow:()=>Wae,setMaxParallelImageRequests:()=>Rse,setNow:()=>$ae,setRTLTextPlugin:()=>Cse,setWorkerCount:()=>Pse,setWorkerUrl:()=>Bse});function D5(){var e=new Ql(4);return Ql!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function Vae(e,r){var t=r[0],i=r[1],a=r[2],o=r[3],s=t*o-a*i;return s?(s=1/s,e[0]=o*s,e[1]=-i*s,e[2]=-a*s,e[3]=t*s,e):null}function Gae(e){return e[0]*e[3]-e[2]*e[1]}function Hae(e,r,t){var i=r[0],a=r[1],o=r[2],s=r[3],l=Math.sin(t),n=Math.cos(t);return e[0]=i*n+o*l,e[1]=a*n+s*l,e[2]=i*-l+o*n,e[3]=a*-l+s*n,e}function hs(){return $g.getCurrentTime()}function $ae(e){$g.setNow(e)}function Wae(){$g.restoreNow()}function Yae(){return $g.isFrozen()}function Xae(e,r){let t={};for(let i in e)i!=="ref"&&(t[i]=e[i]);return EP.forEach(i=>{i in r&&(t[i]=r[i])}),t}function L5(e){e=e.slice();let r=Object.create(null);for(let t=0;t{"source"in s&&i[s.source]?t.push({command:"removeLayer",args:[s.id]}):o.push(s)}),t=t.concat(a),Qae(o,r.layers,t)}catch(i){console.warn("Unable to compute style diff:",i),t=[{command:"setStyle",args:[r]}]}return t}function tne(){let e={},r=mi.$version;for(let t in mi.$root){let i=mi.$root[t];if(i.required){let a=null;a=t==="version"?r:i.type==="array"?[]:{},a!=null&&(e[t]=a)}}return e}function Xb(e){let r=[];if(typeof e=="string")r.push({id:"default",url:e});else if(e&&e.length>0){let t=[];for(let{id:i,url:a}of e){let o=`${i}${a}`;t.includes(o)||(t.push(o),r.push({id:i,url:a}))}}return r}function z5(e,r,t){try{let i=new URL(e);return i.pathname+=`${r}${t}`,i.toString()}catch{throw Error(`Invalid sprite URL "${e}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function rne(e,r,t,i){return Xr(this,null,function*(){let a=Xb(e),o=t>1?"@2x":"",s={},l={};for(let{id:n,url:u}of a){let c=yield r.transformRequest(z5(u,o,".json"),"SpriteJSON");s[n]=vg(c,i);let f=yield r.transformRequest(z5(u,o,".png"),"SpriteImage");l[n]=td.getImage(f,i)}return yield Promise.all([...Object.values(s),...Object.values(l)]),ine(s,l)})}function ine(e,r){return Xr(this,null,function*(){let t={};for(let i in e){t[i]={};let a=(yield r[i]).data;if(!a)throw Error(`Could not load sprite image for ${i}: the response is empty`);let o=yc.getImageCanvasContext(a),s=(yield e[i]).data;for(let l in s){let{width:n,height:u,x:c,y:f,sdf:h,pixelRatio:d,stretchX:p,stretchY:g,content:m,textFitWidth:y,textFitHeight:_}=s[l],v={width:n,height:u,x:c,y:f,context:o};t[i][l]={data:null,pixelRatio:d,sdf:h,stretchX:p,stretchY:g,content:m,textFitWidth:y,textFitHeight:_,spriteData:v}}}return t})}function ane(e){let r=/^u\+([0-9a-f]*)(\?+)$/i.exec(e);if(r){let[,a,o]=r;return a.length+o.length>6?null:B5(parseInt(`${a}${"0".repeat(o.length)}`,16),parseInt(`${a}${"f".repeat(o.length)}`,16))}let t=/^u\+([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?$/i.exec(e);if(!t)return null;let i=parseInt(t[1],16);return B5(i,t[2]===void 0?i:parseInt(t[2],16))}function B5(e,r){return e>r||e>p2?null:{start:e,end:Math.min(r,p2)}}function nne(e,r){return e.ranges.some(({start:t,end:i})=>r>=t&&r<=i)}function O5(e,r,t,i,a,o,s,l,n){for(let u=r;u-1);n++,o[n]=l,s[n]=u,s[n+1]=v2}for(let l=0,n=0;lpg(r,t))),y2}function dne(e,r){let t=Rp();return Ol(t,t,[1,1,0]),Xu(t,t,[e.width*.5,e.height*.5,1]),e.calculatePosMatrix?$v(t,t,e.calculatePosMatrix(r.toUnwrapped())):t}function pne(e,r,t){if(e)for(let i of e){let a=r[i];if(a?.source===t&&a.type==="fill-extrusion")return!0}else for(let i in r){let a=r[i];if(a.source===t&&a.type==="fill-extrusion")return!0}return!1}function vne(e,r,t,i,a,o,s){var l;let n=pne((l=a?.layers)!=null?l:null,r,e.id),u=o.maxPitchScaleFactor(),c=e.tilesIn(i,u,n);c.sort(j5);let f=[];for(let h of c)f.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(r,t,e.getState(),h.queryGeometry,h.cameraQueryGeometry,h.scale,a,o,u,dne(o,h.tileID),s?(d,p)=>s(h.tileID,d,p):void 0)});return _ne(yne(f),e)}function mne(e,r,t,i,a,o,s){let l={},n=o.queryRenderedSymbols(i),u=[];for(let c of Object.keys(n).map(Number))u.push(s[c]);u.sort(j5);for(let c of u){let f=c.featureIndex.lookupSymbolFeatures(n[c.bucketInstanceId],r,c.bucketIndex,c.sourceLayerIndex,{filterSpec:a.filter,globalState:a.globalState},a.layers,a.availableImages,e);for(let h in f){l[h]||(l[h]=[]);let d=f[h];d.sort((p,g)=>{let m=c.featureSortOrder;if(m){let y=m.indexOf(p.featureIndex);return m.indexOf(g.featureIndex)-y}return g.featureIndex-p.featureIndex});for(let p of d)l[h].push(p)}}return xne(l,e,t)}function gne(e,r){let t=e.getRenderableIds().map(o=>e.getTileByID(o)),i=[],a={};for(let o of t){let s=o.tileID.canonical.key;a[s]||(a[s]=!0,o.querySourceFeatures(i,r))}return i}function j5(e,r){let t=e.tileID,i=r.tileID;return t.overscaledZ-i.overscaledZ||t.canonical.y-i.canonical.y||t.wrap-i.wrap||t.canonical.x-i.canonical.x}function yne(e){let r={},t={};for(let{queryResults:i,wrappedTileID:a}of e){t[a]||(t[a]={});let o=t[a];for(let s in i){let l=i[s];o[s]||(o[s]={});let n=o[s];r[s]||(r[s]=[]);for(let u of l)n[u.featureIndex]||(n[u.featureIndex]=!0,r[s].push(u))}}return r}function _ne(e,r){for(let t in e)for(let i of e[t])U5(i,r);return e}function xne(e,r,t){for(let i in e)for(let a of e[i]){let o=t[r[i].source];U5(a,o)}return e}function U5(e,r){let t=e.feature,i=r.getFeatureState(t.layer["source-layer"],t.id);t.source=t.layer.source,t.layer["source-layer"]&&(t.sourceLayer=t.layer["source-layer"]),t.state=i}function q5(e,r,t,i){return Xr(this,null,function*(){let a=e;if(e.url?a=(yield vg(yield r.transformRequest(e.url,"Source"),t)).data:yield yc.frameAsync(t,i),!a)return null;let o=N1(yn(a,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(o.vectorLayerIds=a.vector_layers.map(s=>s.id)),o})}function Ng(e,r){return r?e.properties[r]:e.id}function bne(e,r){let t=new Map;if(e==null||e.type==null)return t;if(e.type==="Feature"){let i=Ng(e,r);return i==null?void 0:(t.set(i,e),t)}if(e.type==="FeatureCollection"){let i=new Set;for(let a of e.features){let o=Ng(a,r);if(o==null||i.has(o))return;i.add(o),t.set(o,a)}return t}}function wne(e,r,t){var i,a;let o=[];if(r.removeAll)e.clear();else if(r.remove)for(let s of r.remove){let l=e.get(s);l&&(o.push(l.geometry),e.delete(s))}if(r.add)for(let s of r.add){let l=Ng(s,t);if(l==null)continue;let n=e.get(l);n&&o.push(n.geometry),o.push(s.geometry),e.set(l,s)}if(r.update)for(let s of r.update){let l=e.get(s.id);if(!l)continue;let n=!!s.newGeometry,u=s.removeAllProperties||((i=s.removeProperties)==null?void 0:i.length)>0||((a=s.addOrUpdateProperties)==null?void 0:a.length)>0;if(!n&&!u)continue;o.push(l.geometry);let c=Ot({},l);if(e.set(s.id,c),n&&(o.push(s.newGeometry),c.geometry=s.newGeometry),u){if(c.properties=s.removeAllProperties?{}:Ot({},c.properties||{}),s.removeProperties)for(let f of s.removeProperties)delete c.properties[f];if(s.addOrUpdateProperties)for(let{key:f,value:h}of s.addOrUpdateProperties)c.properties[f]=h}}return o}function Tne(e,r,t){if(!e)return r||{};if(!r)return e||{};t&&(V5(e.add,t),V5(r.add,t));let i=G5(e),a=G5(r);Ane(i,a);let o={};if((i.removeAll||a.removeAll)&&(o.removeAll=!0),o.remove=new Set([...i.remove,...a.remove]),o.add=new Map([...i.add,...a.add]),o.update=new Map([...i.update,...a.update]),o.remove.size&&o.add.size)for(let l of o.add.keys())o.remove.delete(l);let s=Ene(o);return t&&Sne(s.add,t),s}function Ane(e,r){r.removeAll&&(e.add.clear(),e.update.clear(),e.remove.clear(),r.remove.clear());for(let t of r.remove)e.add.delete(t),e.update.delete(t);for(let[t,i]of r.update){let a=e.update.get(t);a&&(r.update.set(t,Mne(a,i)),e.update.delete(t))}}function Mne(e,r){let t={id:e.id};if(r.removeAllProperties&&(delete e.removeProperties,delete e.addOrUpdateProperties,delete r.removeProperties),r.removeProperties&&e.addOrUpdateProperties){let i=new Set(r.removeProperties);e.addOrUpdateProperties=e.addOrUpdateProperties.filter(a=>!i.has(a.key))}return(e.removeAllProperties||r.removeAllProperties)&&(t.removeAllProperties=!0),(e.removeProperties||r.removeProperties)&&(t.removeProperties=[...e.removeProperties||[],...r.removeProperties||[]]),(e.addOrUpdateProperties||r.addOrUpdateProperties)&&(t.addOrUpdateProperties=[...e.addOrUpdateProperties||[],...r.addOrUpdateProperties||[]]),(e.newGeometry||r.newGeometry)&&(t.newGeometry=r.newGeometry||e.newGeometry),t}function V5(e,r){if(e)for(let t of e){let i=Ng(t,r);i!=null&&(t.id=i)}}function Sne(e,r){if(e)for(let t of e)Ng(t,r)!=null&&delete t.id}function G5(e){var r,t;if(!e)return{};let i={};return i.removeAll=e.removeAll,i.remove=new Set(e.remove||[]),i.add=new Map((r=e.add)==null?void 0:r.map(a=>[a.id,a])),i.update=new Map((t=e.update)==null?void 0:t.map(a=>[a.id,a])),i}function Ene(e){let r={};return e.removeAll&&(r.removeAll=e.removeAll),e.remove&&(r.remove=Array.from(e.remove)),e.add&&(r.add=Array.from(e.add.values())),e.update&&(r.update=Array.from(e.update.values())),r}function H5(e){return!e||e.length===0?[]:typeof e[0]=="number"?[e]:e.flatMap(r=>H5(r))}function Zb(e){return e.type==="GeometryCollection"?e.geometries.flatMap(r=>Zb(r)):H5(e.coordinates)}function $5(e){let r=new bh,t;switch(e.type){case"FeatureCollection":t=e.features.flatMap(i=>Zb(i.geometry));break;case"Feature":t=Zb(e.geometry);break;default:t=Zb(e)}if(t.length===0)return r;for(let i of t){let[a,o]=i;r.extend([a,o])}return r}function kne({x:e,y:r,z:t},i=0){let a=B6((e-i)/2**t),o=og((r+1+i)/2**t),s=B6((e+1+i)/2**t),l=og((r-i)/2**t);return new bh([a,o],[s,l])}function Cne(e){e*=Math.PI/180;let r=Math.sin(e),t=Math.cos(e);return[(2*t+1)/3,(-Math.sqrt(3)*r-t+1)/3,(Math.sqrt(3)*r-t+1)/3]}function Dne(e){return e>0?1/(1-e):1+e}function Lne(e){return e>0?1-1/(1.001-e):-e}function W5(e,r){let t=Y5(r,"16bit"),i=sp.deserialize({arrayBuffer:t.vertices,length:t.vertices.byteLength/2/2}),a=ed.deserialize({arrayBuffer:t.indices,length:t.indices.byteLength/2/3});return new Um(e.createVertexBuffer(i,i0.members),e.createIndexBuffer(a),Ks.simpleSegment(0,0,i.length,a.length))}function Y5(e,r){let t=e.granularity===void 0?1:Math.max(e.granularity,1),i=t+(e.generateBorders?2:0),a=t+(e.extendToNorthPole||e.generateBorders?1:0)+(e.extendToSouthPole||e.generateBorders?1:0),o=i+1,s=a+1,l=e.generateBorders?-1:0,n=e.generateBorders||e.extendToNorthPole?-1:0,u=t+ +!!e.generateBorders,c=t+(e.generateBorders||e.extendToSouthPole?1:0),f=o*s,h=i*a*6,d=o*s>65536;if(d&&r==="16bit")throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let p=d||r==="32bit",g=new Int16Array(f*2),m=0;for(let v=n;v<=c;v++)for(let x=l;x<=u;x++){let S=x/t*Bi;x===-1&&(S=-Zg),x===t+1&&(S=Bi+Zg);let M=v/t*Bi;v===-1&&(M=e.extendToNorthPole?Pm:-Zg),v===t+1&&(M=e.extendToSouthPole?Im:Bi+Zg),g[m++]=S,g[m++]=M}let y=p?new Uint32Array(h):new Uint16Array(h),_=0;for(let v=0;v=1&&y<=512)||_>=1?tv:[p,g,_]}function Rne(e){let r=(1-4/e)/.9921875;return Math.max(0,r)}function X5(e){let[r,t,i,a]=e;return r.x+i.x===t.x+a.x&&r.y+i.y===t.y+a.y}function zne(e,r){let t={};if(!r)return t;for(let i of e){let a=i.layerIds.map(o=>r.getLayer(o)).filter(Boolean);if(a.length!==0){i.layers=a,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map(o=>a.filter(s=>s.id===o)[0]));for(let o of a)t[o.id]=i}}return t}function jg(){return b2||(b2=new _B),b2}function Z5(e){let r=[];for(let t in e)r.push({id:t,state:e[t]});return r}function Bne(e,r,t,i){let a=pu([],e,r),o=1/a[3]/t*i;return xP(a,a,[o,o,1/a[3],o])}function One(e,r,t,i){let a=i?4:0,o=i?0:4,s=0,l=[],n=[];for(let f=0;f<4;f++){let h=Sd([],e[f+o],e[f+a]),d=ap(h);Ws(h,h,1/d),l.push(d),n.push(h)}for(let f=0;f<4;f++){let h=JK(e[f+a],n[f],t);s=h!==null&&h>=0?Math.max(s,h):Math.max(s,l[f])}let u=Nne(e,r),c=jne(t,u);if(c!==null){let f=c/Kl(n[0],u);s=Math.min(s,f)}for(let f=0;f<4;f++){let h=Math.min(s,l[f]);e[f+o]=[e[f+a][0]+n[f][0]*h,e[f+a][1]+n[f][1]*h,e[f+a][2]+n[f][2]*h,1]}}function Nne(e,r){let t=Sd([],e[r[0]],e[r[1]]),i=Sd([],e[r[2]],e[r[1]]),a=[0,0,0,0];return qc(a,uf([],t,i)),a[3]=-Kl(a,e[r[0]]),a}function jne(e,r){let t=dg(e),i=HK([],e,1/t),a=Sd([],r,Ws([],i,Kl(r,i))),o=dg(a);if(o>0){let s=Math.sqrt(1-i[3]*i[3]),l=Ws([],i,-i[3]),n=lh([],l,Ws([],a,s/o));return G4(r,n)}return null}function Une(e,r,t){let i=r.intersectsFrustum(e);if(!t||i===0)return i;let a=r.intersectsPlane(t);return a===0?0:i===2&&a===2?2:1}function K5(e,r,t){let i=0,a=(t-r)/10;for(let o=0;o<10;o++){let s=r+(o+.5)/10*(t-r);i+=a*Math.cos(s)**+e}return i}function HA(e,r){return function(t,i,a,o,s){let l=2*((e-1)/Ku(Math.cos(rl(Jp-s))/Math.cos(rl(Jp)))-1),n=Math.acos(a/o),u=2*K5(l-1,0,rl(s/2)),c=Math.min(rl(Jp),n+rl(s/2)),f=Math.min(c,n-rl(s/2)),h=K5(l-1,f,c),d=Math.atan(i/a),p=Math.hypot(i,a),g=t;return g+=Ku(o/p/Math.max(.5,Math.cos(rl(s/2)))),g+=l*Ku(Math.cos(d))/2,g-=Ku(Math.max(1,h/u/r))/2,g}}function $A(e,r){let t=(r.roundZoom?Math.round:Math.floor)(e.zoom+Ku(e.tileSize/r.tileSize));return Math.max(0,t)}function qne(e,r){let t=Jp-e.pitch-e.fov/2,i=to((15-t)/15,0,1),a=Math.max(500,r??0);return e.elevation+i*a}function Vne(e,r,t){let i=e.planes[1],a=e.points.map(n=>{let u=i[0]*n[0]+i[1]*n[1]+i[2]*n[2]+i[3];if(Math.abs(u)>1e-6)return n;let c=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],f=i[0]*c[0]+i[1]*c[1]+i[2]*c[2];if(f>=-1e-9)return n;let h=r/-f;return[n[0]+c[0]*h,n[1]+c[1]*h,n[2]+c[2]*h,n[3]]}),o=e.planes.map((n,u)=>u===1?[n[0],n[1],n[2],n[3]+r]:n),s=[1/0,1/0,1/0],l=[-1/0,-1/0,-1/0];for(let n of a)for(let u=0;u<3;u++)s[u]=Math.min(s[u],n[u]),l[u]=Math.max(l[u],n[u]);return new T2(a,o,new w2(s,l))}function Bm(e,r){let t=e.getCameraFrustum(),i=e.getClippingPlane();if(i&&r.maxContentElevation>0){let M=Math.hypot(i[0],i[1],i[2]);if(M>0){let C=1+r.maxContentElevation/mc,w=to(-i[3]/M,-1,1),k=Math.cos(Math.acos(w)+Math.acos(1/C));i=[i[0],i[1],i[2],-k*M],t=Vne(t,Math.sqrt(C*C-1),e.cameraPosition)}}let a=Fee(e),o=Qo.fromLngLat(e.center,e.elevation),s=qne(e,r.maxContentElevation),l=e.getCoveringTilesDetailsProvider(),n=l.allowVariableZoom(e,r),u=$A(e,r),c=r.minzoom||0,f=r.maxzoom===void 0?e.maxZoom:r.maxzoom,h=Math.min(Math.max(0,u),f),d=2**h,p=[d*a.x,d*a.y,0],g=[d*o.x,d*o.y,0],m=Math.hypot(o.x-a.x,o.y-a.y),y=Math.abs(o.z-a.z),_=Math.hypot(m,y),v=M=>({zoom:0,x:0,y:0,wrap:M,fullyVisible:!1}),x=[],S=[];if(e.renderWorldCopies&&l.allowWorldCopies())for(let M=1;M<=3;M++)x.push(v(-M)),x.push(v(M));for(x.push(v(0));x.length>0;){let M=x.pop(),C=M.x,w=M.y,k=M.fullyVisible,A={x:C,y:w,z:M.zoom},b=l.getTileBoundingVolume(A,M.wrap,s,r);if(!k){let D=Une(t,b,i);if(D===0)continue;k=D===2}let E=l.distanceToTile2d(a.x,a.y,A,b),T=u;n&&(T=(r.calculateTileZoom||bB)(e.zoom+Ku(e.tileSize/r.tileSize),E,y,_,e.fov)),T=(r.roundZoom?Math.round:Math.floor)(T),T=Math.max(0,T);let F=Math.min(T,f);if(M.wrap=l.getWrap(o,A,M.wrap),M.zoom>=F){if(M.zoom>1),z=M.zoom+1;x.push({zoom:z,x:R,y:P,wrap:M.wrap,fullyVisible:k})}}return S.sort((M,C)=>M.distanceSq-C.distanceSq).map(M=>M.tileID)}function J5(e){return e==="raster"||e==="image"||e==="video"}function Gne(e,r,t,i,a,o,s){let l=hs(),n=eJ(r);for(let u of r){let c=e.getTileById(u.key);(c.fadingDirection===0||c.fadeOpacity===0)&&c.resetFadeLogic(),!Hne(e,c,t,l,i,a,s)&&($ne(e,c,t,l,o,s)||Wne(c,n,l,s)||c.resetFadeLogic())}}function Hne(e,r,t,i,a,o,s){if(!r.hasData())return!1;let{tileID:l,fadingRole:n,fadingDirection:u,fadingParentID:c}=r;if(n===0&&u===1&&c)return t[c.key]=c,!0;let f=Math.max(l.overscaledZ-a,o);for(let h=l.overscaledZ-1;h>=f;h--){let d=l.scaledTo(h),p=e.getLoadedTile(d);if(p)return r.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:p.tileID,fadeEndTime:i+s}),p.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:i+s}),t[d.key]=d,!0}return!1}function $ne(e,r,t,i,a,o){if(!r.hasData())return!1;let s=r.tileID.children(a),l=Q5(e,r,s,t,i,a,o);if(l)return!0;for(let n of s)Q5(e,r,n.children(a),t,i,a,o)&&(l=!0);return l}function Q5(e,r,t,i,a,o,s){if(t[0].overscaledZ>=o)return!1;let l=!1;for(let n of t){let u=e.getLoadedTile(n);if(!u)continue;let{fadingRole:c,fadingDirection:f,fadingParentID:h}=u;(c!==0||f!==0||!h)&&(u.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:r.tileID,fadeEndTime:a+s}),r.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:a+s})),i[n.key]=n,l=!0}return l}function Wne(e,r,t,i){let a=e.tileID;if(e.selfFading)return!0;if(e.hasData())return!1;if(r.has(a)){let o=t+i;return e.setSelfFadeLogic(o),!0}return!1}function Yne(e,r){if(r<=0)return!1;let t=hs();for(let i of e.getAllTiles())if(i.fadeEndTime>=t)return!0;return!1}function Xne(e,r){var t,i,a;let o=r.getRenderableIds();for(let s of o){if(!((t=e.neighboringTiles)!=null&&t[s]))continue;let l=r.getTileById(s);e.neighboringTiles[s].backfilled||ez(e,l),!((a=(i=l.neighboringTiles)==null?void 0:i[e.tileID.key])!=null&&a.backfilled)&&ez(l,e)}}function ez(e,r){var t;e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0;let i=r.tileID.canonical.x-e.tileID.canonical.x,a=r.tileID.canonical.y-e.tileID.canonical.y,o=2**e.tileID.canonical.z,s=r.tileID.key;(i!==0||a!==0)&&(Math.abs(a)>1||(Math.abs(i)>1&&(Math.abs(i+o)===1?i+=o:Math.abs(i-o)===1&&(i-=o)),r.dem&&e.dem&&(e.dem.backfillBorder(r.dem,i,a),(t=e.neighboringTiles)!=null&&t[s]&&(e.neighboringTiles[s].backfilled=!0))))}function Kb(e,r,t,i,a){return a?e?e(r,t)+i:i===0?void 0:i:i}function Jb(e,r){let t=!0;return e==="always"||(e==="never"||r==="never")&&(t=!1),t}function Zne(e,r){let t=1/(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),i=1/(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),a=r[0]*t,o=r[4]*t,s=r[8]*i,l=r[1]*t,n=r[5]*t,u=r[9]*i,c=r[2]*t,f=r[6]*t,h=r[10]*i;e[0]=a,e[1]=o,e[2]=s,e[4]=l,e[5]=n,e[6]=u,e[8]=c,e[9]=f,e[10]=h;let d=r[12],p=r[13],g=r[14];return e[12]=-a*d-l*p-c*g,e[13]=-o*d-n*p-f*g,e[14]=-s*d-u*p-h*g,e[3]=0,e[7]=0,e[11]=0,e[15]=1,e}function Kne(e,r){return e[0]=1/r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1/r[5],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=1/r[14],e[12]=0,e[13]=0,e[14]=-1,e[15]=r[10]/r[14],e}function Jne(e,r){let t=1/(r[0]*r[5]-r[1]*r[4]);return e[0]=r[5]*t,e[1]=-r[1]*t,e[2]=0,e[3]=0,e[4]=-r[4]*t,e[5]=r[0]*t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1/r[10],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1/r[15],e}function WA(e,r,t){let i=Rp();if(!e){let{vecSouth:a,vecEast:o}=YA(r),s=D5();s[0]=o[0],s[1]=o[1],s[2]=a[0],s[3]=a[1],Vae(s,s),i[0]=s[0],i[1]=s[1],i[4]=s[2],i[5]=s[3]}return Xu(i,i,[1/t,1/t,1]),i}function Qne(e,r,t,i){if(e){let a=Rp();if(!r){let{vecSouth:o,vecEast:s}=YA(t);a[0]=s[0],a[1]=s[1],a[4]=o[0],a[5]=o[1]}return Xu(a,a,[i,i,1]),a}return t.pixelsToClipSpaceMatrix}function YA(e){let r=Math.cos(e.rollInRadians),t=Math.sin(e.rollInRadians),i=Math.cos(e.pitchInRadians),a=Math.cos(e.bearingInRadians),o=Math.sin(e.bearingInRadians),s=V4();s[0]=-a*i*t-o*r,s[1]=-o*i*t+a*r;let l=g9(s);l<1e-9?y9(s):m9(s,s,1/l);let n=V4();n[0]=a*i*r-o*t,n[1]=o*i*r+a*t;let u=g9(n);return u<1e-9?y9(n):m9(n,n,1/u),{vecEast:n,vecSouth:s}}function Q0(e,r,t){var i,a;return Kb(e.getElevation,r,t,(i=e.heightOffset)!=null?i:0,(a=e.heightAnchorGround)!=null?a:!0)}function XA(e,r,t,i){let a;i==null?(a=[e,r,0,1],JA(a,a,t)):(a=[e,r,i,1],pu(a,a,t));let o=a[3];return{point:new Wr(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function tz(e,r){return .5+e/r*.5}function eoe(e,r){return e.x>=-r[0]&&e.x<=r[0]&&e.y>=-r[1]&&e.y<=r[1]}function toe(e,r,t,i,a,o,s,l,n,u,c,f,h){let d=t?e.textSizeData:e.iconSizeData,p=dx(d,r.transform.zoom),g=[256/r.width*2+1,256/r.height*2+1],m=t?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;m.clear();let y=e.lineVertexArray,_=t?e.text.placedSymbolArray:e.icon.placedSymbolArray,v=r.transform.width/r.transform.height,x=!1;for(let S=0;S<_.length;S++){let M=_.get(S);if(M.hidden||M.writingMode===2&&!x){Om(M.numGlyphs,m);continue}x=!1;let C=new Wr(M.anchorX,M.anchorY),w={getElevation:h,pitchedLabelPlaneMatrix:i,lineVertexArray:y,pitchWithMap:o,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:r.transform,tileAnchorPoint:C,unwrappedTileID:n,width:u,height:c,translation:f},k=oz(M.anchorX,M.anchorY,w);if(!eoe(k.point,g)){Om(M.numGlyphs,m);continue}let A=k.signedDistanceFromCamera,b=tz(r.transform.cameraToCenterDistance,A),E=G6(d,p,M),T=o?E*r.transform.getPitchedTextCorrection(M.anchorX,M.anchorY,n)/b:E*b,F=az({projectionContext:w,pitchedLabelPlaneMatrixInverse:a,symbol:M,fontSize:T,flip:!1,keepUpright:s,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:v,rotateToLine:l});x=F.useVertical,(F.notEnoughRoom||x||F.needsFlipping&&az({projectionContext:w,pitchedLabelPlaneMatrixInverse:a,symbol:M,fontSize:T,flip:!0,keepUpright:s,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:v,rotateToLine:l}).notEnoughRoom)&&Om(M.numGlyphs,m)}t?e.text.dynamicLayoutVertexBuffer.updateData(m):e.icon.dynamicLayoutVertexBuffer.updateData(m)}function rz(e,r,t,i,a,o,s,l){let n=o.glyphStartIndex+o.numGlyphs,u=o.lineStartIndex,c=o.lineStartIndex+o.lineLength,f=r.getoffsetX(o.glyphStartIndex),h=r.getoffsetX(n-1),d=e2(e*f,t,i,a,o.segment,u,c,l,s);if(!d)return null;let p=e2(e*h,t,i,a,o.segment,u,c,l,s);return!p||l.projectionCache.anyProjectionOccluded?null:{first:d,last:p}}function iz(e,r,t,i){return e===1&&Math.abs(t.y-r.y)>Math.abs(t.x-r.x)*i?{useVertical:!0}:(e===2?r.yt.x)?{needsFlipping:!0}:null}function az(e){let{projectionContext:r,pitchedLabelPlaneMatrixInverse:t,symbol:i,fontSize:a,flip:o,keepUpright:s,glyphOffsetArray:l,dynamicLayoutVertexArray:n,aspectRatio:u,rotateToLine:c}=e,f=a/24,h=i.lineOffsetX*f,d=i.lineOffsetY*f,p;if(i.numGlyphs>1){let g=i.glyphStartIndex+i.numGlyphs,m=i.lineStartIndex,y=i.lineStartIndex+i.lineLength,_=rz(f,l,h,d,o,i,c,r);if(!_)return{notEnoughRoom:!0};let v=Qb(_.first.point.x,_.first.point.y,r,t),x=Qb(_.last.point.x,_.last.point.y,r,t);if(s&&!o){let S=iz(i.writingMode,v,x,u);if(S)return S}p=[_.first];for(let S=i.glyphStartIndex+1;S0?v.point:nz(r.tileAnchorPoint,_,m,1,r),S=Qb(m.x,m.y,r,t),M=Qb(x.x,x.y,r,t),C=iz(i.writingMode,S,M,u);if(C)return C}let g=e2(f*l.getoffsetX(i.glyphStartIndex),h,d,o,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,r,c);if(!g||r.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};p=[g]}for(let g of p)_x(n,g.point,g.angle);return{}}function nz(e,r,t,i,a){let o=e.add(e.sub(r)._unit()),s=ev(o.x,o.y,a).point,l=t.sub(s);return t.add(l._mult(i/l.mag()))}function ZA(e,r,t){let i=r.projectionCache;if(i.projections[e])return i.projections[e];let a=new Wr(r.lineVertexArray.getx(e),r.lineVertexArray.gety(e)),o=ev(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[e]=o.point,i.anyProjectionOccluded||(i.anyProjectionOccluded=o.isOccluded),o.point;let s=e-t.direction,l=t.distanceFromAnchor===0?r.tileAnchorPoint:new Wr(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),n=t.absOffsetX-t.distanceFromAnchor+1;return nz(l,a,t.previousVertex,n,r)}function ev(e,r,t){let i=e+t.translation[0],a=r+t.translation[1],o;return t.pitchWithMap?(o=XA(i,a,t.pitchedLabelPlaneMatrix,Q0(t,i,a)),o.isOccluded=!1):(o=t.transform.projectTileCoordinates(i,a,t.unwrappedTileID,Q0(t,i,a)),o.point.x=(o.point.x*.5+.5)*t.width,o.point.y=(-o.point.y*.5+.5)*t.height),o}function Qb(e,r,t,i){if(t.pitchWithMap){let a=[e,r,0,1];pu(a,a,i);let o=a[0]/a[3],s=a[1]/a[3];return t.transform.projectTileCoordinates(o,s,t.unwrappedTileID,Q0(t,o,s)).point}return{x:e/t.width*2-1,y:1-r/t.height*2}}function oz(e,r,t){return t.transform.projectTileCoordinates(e,r,t.unwrappedTileID,Q0(t,e,r))}function KA(e,r,t){return e._unit()._perp()._mult(r*t)}function roe(e,r,t,i,a,o,s,l,n){if(l.projectionCache.offsets[e])return l.projectionCache.offsets[e];let u=t.add(r);if(e+n.direction=a)return l.projectionCache.offsets[e]=u,u;let c=ZA(e+n.direction,l,n),f=KA(c.sub(t),s,n.direction),h=t.add(f),d=c.add(f);return l.projectionCache.offsets[e]=aJ(o,u,h,d)||u,l.projectionCache.offsets[e]}function e2(e,r,t,i,a,o,s,l,n){let u=i?e-r:e+r,c=u>0?1:-1,f=0;i&&(c*=-1,f=Math.PI),c<0&&(f+=Math.PI);let h=c>0?o+a:o+a+1,d;l.projectionCache.cachedAnchorPoint?d=l.projectionCache.cachedAnchorPoint:(d=ev(l.tileAnchorPoint.x,l.tileAnchorPoint.y,l).point,l.projectionCache.cachedAnchorPoint=d);let p=d,g=d,m,y,_=0,v=0,x=Math.abs(u),S=[],M;for(;_+v<=x;){if(h+=c,h=s)return null;_+=v,g=p,y=m;let A={absOffsetX:x,direction:c,distanceFromAnchor:_,previousVertex:g};if(p=ZA(h,l,A),t===0)S.push(g),M=p.sub(g);else{let b,E=p.sub(g);b=E.mag()===0?KA(ZA(h+c,l,A).sub(p),t,c):KA(E,t,c),y||(y=g.add(b)),m=roe(h,b,p,o,s,y,t,l,A),S.push(y),M=m.sub(y)}v=M.mag()}let C=(x-_)/v,w=M._mult(C)._add(y||g),k=f+Math.atan2(p.y-g.y,p.x-g.x);return S.push(w),{point:w,angle:n?k:0,path:S}}function Om(e,r){for(let t=0;t{let a=XA(i.x,i.y,t,Q0(r,i.x,i.y)),o=r.transform.projectTileCoordinates(a.point.x,a.point.y,r.unwrappedTileID,Q0(r,a.point.x,a.point.y));return o.point.x=(o.point.x*.5+.5)*r.width,o.point.y=(-o.point.y*.5+.5)*r.height,o})}function aoe(e){let r=0,t=0,i=0,a=0;for(let o=0;ot&&(t=a,r=i));return e.slice(r,r+t)}function sz(e,r,t,i,a){let{horizontalAlign:o,verticalAlign:s}=fx(e),l=-(o-.5)*r,n=-(s-.5)*t;return new Wr(l+i[0]*a,n+i[1]*a)}function lz(e,r,t,i,a,o){(!i||i.length===0)&&(i=[0,0,0,0]);let s=i[0]-100,l=i[1]-100,n=i[2]-100,u=i[3]-100;e.emplaceBack(+!!r,+!!t,a||0,o||0,s,l),e.emplaceBack(+!!r,+!!t,a||0,o||0,n,l),e.emplaceBack(+!!r,+!!t,a||0,o||0,n,u),e.emplaceBack(+!!r,+!!t,a||0,o||0,s,u)}function uz(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return 4294967295;let r=+!!e.placed,t=Math.floor(e.opacity*127);return t*CB+r*DB+t*LB+r*FB+t*512+r*256+t*2+r}function QA(e,r,t,i,a,o){if(a-i<=t)return;let s=i+a>>1;cz(e,r,s,i,a,o),QA(e,r,t,i,s-1,1-o),QA(e,r,t,s+1,a,1-o)}function cz(e,r,t,i,a,o){for(;a>i;){if(a-i>600){let u=a-i+1,c=t-i+1,f=Math.log(u),h=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*h*(u-h)/u)*(c-u/2<0?-1:1);cz(e,r,t,Math.max(i,Math.floor(t-c*h/u+d)),Math.min(a,Math.floor(t+(u-c)*h/u+d)),o)}let s=r[2*t+o],l=i,n=a;for(Ug(e,r,i,t),r[2*a+o]>s&&Ug(e,r,i,a);ls;)n--}r[2*i+o]===s?Ug(e,r,i,n):(n++,Ug(e,r,n,a)),n<=t&&(i=n+1),t<=n&&(a=n-1)}}function Ug(e,r,t,i){eM(e,t,i),eM(r,2*t,2*i),eM(r,2*t+1,2*i+1)}function eM(e,r,t){let i=e[r];e[r]=e[t],e[t]=i}function fz(e,r,t,i){let a=e-t,o=r-i;return a*a+o*o}function Yo(e,r){let t=/#pragma maplibre: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=r.match(/in ([\w]+) ([\w]+)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=r.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=o?o.concat(a):a,l=i?i.length:0,n={};return e=e.replace(t,(u,c,f,h,d)=>(n[d]=!0,c==="define"?` +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),bK=de({"src/plots/map/styles/arcgis-sat.js"(e,r){"use strict";r.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),L0=de({"src/plots/map/constants.js"(e,r){"use strict";var t=(yv(),ti(f0)).default,i=xK(),a=bK(),o='\xA9 OpenStreetMap contributors',s="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",l="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",u="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",c="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",f="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",h={basic:n,streets:n,outdoors:n,light:s,dark:l,satellite:a,"satellite-streets":i,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:o,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":s,"carto-darkmatter":l,"carto-voyager":n,"carto-positron-nolabels":u,"carto-darkmatter-nolabels":c,"carto-voyager-nolabels":f},d=t(h);r.exports={styleValueDflt:"basic",stylesMap:h,styleValuesMap:d,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",d.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error.",fitBoundsPadding:20}}}),S_=de({"src/plots/map/layout_attributes.js"(e,r){"use strict";var t=Qt(),i=ta().defaultLine,a=Rs().attributes,o=us(),s=tl().textposition,l=Is().overrideAll,n=Ro().templatedArray,u=L0(),c=o({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var f=r.exports=l({_arrayAttrRegexps:[t.counterRegex("map",".layers",!0)],domain:a({name:"map"}),style:{valType:"any",values:u.styleValuesMap,dflt:u.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},fitbounds:{valType:"enumerated",values:[!1,"locations"],dflt:"locations"},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:n("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:c,textposition:t.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root");f.uirevision={valType:"any",editType:"none"}}}),R4=de({"src/traces/scattermap/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,texttemplateAttrs:i,templatefallbackAttrs:a}=Vo(),o=Jd(),s=z1(),l=tl(),n=S_(),u=ri(),c=cs(),f=fn().extendFlat,h=Is().overrideAll,d=S_(),p=s.line,g=s.marker;r.exports=h({lon:s.lon,lat:s.lat,cluster:{enabled:{valType:"boolean"},maxzoom:f({},d.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:f({},g.opacity,{dflt:1})},mode:f({},l.mode,{dflt:"markers"}),text:f({},l.text,{}),texttemplate:i({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:a({editType:"plot"}),hovertext:f({},l.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:l.connectgaps,marker:f({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:g.opacity,size:g.size,sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode},c("marker")),fill:s.fill,fillcolor:o(),textfont:n.layers.symbol.textfont,textposition:n.layers.symbol.textposition,below:{valType:"string"},selected:{marker:l.selected.marker},unselected:{marker:l.unselected.marker},hoverinfo:f({},u.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:t(),hovertemplatefallback:a()},"calc","nested")}}),n9=de({"src/traces/scattermap/constants.js"(e,r){"use strict";var t=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];r.exports={isSupportedFont:function(i){return t.indexOf(i)!==-1}}}}),wK=de({"src/traces/scattermap/defaults.js"(e,r){"use strict";var t=Qt(),i=bs(),a=jh(),o=_d(),s=xd(),l=Qd(),n=R4(),u=n9().isSupportedFont;r.exports=function(h,d,p,g){function m(E,T){return t.coerce(h,d,n,E,T)}function y(E,T){return t.coerce2(h,d,n,E,T)}var _=c(h,d,m);if(!_){d.visible=!1;return}if(m("text"),m("texttemplate"),m("texttemplatefallback"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("mode"),m("below"),i.hasMarkers(d)){a(h,d,p,g,m,{noLine:!0,noAngle:!0}),m("marker.allowoverlap"),m("marker.angle");var v=d.marker;v.symbol!=="circle"&&(t.isArrayOrTypedArray(v.size)&&(v.size=v.size[0]),t.isArrayOrTypedArray(v.color)&&(v.color=v.color[0]))}i.hasLines(d)&&(o(h,d,p,g,m,{noDash:!0}),m("connectgaps"));var x=y("cluster.maxzoom"),S=y("cluster.step"),M=y("cluster.color",d.marker&&d.marker.color||p),C=y("cluster.size"),w=y("cluster.opacity"),k=x!==!1||S!==!1||M!==!1||C!==!1||w!==!1,A=m("cluster.enabled",k);if(A||i.hasText(d)){var b=g.font.family;s(h,d,g,m,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:u(b)?b:"Open Sans Regular",weight:g.font.weight,style:g.font.style,size:g.font.size,color:g.font.color}})}m("fill"),d.fill!=="none"&&l(h,d,p,m),t.coerceSelectionMarkerOpacity(d,m)};function c(f,h,d){var p=d("lon")||[],g=d("lat")||[],m=Math.min(p.length,g.length);return h._length=m,m}}}),o9=de({"src/traces/scattermap/format_labels.js"(e,r){"use strict";var t=nn();r.exports=function(a,o,s){var l={},n=s[o.subplot]._subplot,u=n.mockAxis,c=a.lonlat;return l.lonLabel=t.tickText(u,u.c2l(c[0]),!0).text,l.latLabel=t.tickText(u,u.c2l(c[1]),!0).text,l}}}),s9=de({"src/plots/map/convert_text_opts.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o){var s=a.split(" "),l=s[0],n=s[1],u=t.isArrayOrTypedArray(o)?t.mean(o):o,c=.5+u/100,f=1.5+u/100,h=["",""],d=[0,0];switch(l){case"top":h[0]="top",d[1]=-f;break;case"bottom":h[0]="bottom",d[1]=f;break}switch(n){case"left":h[1]="right",d[0]=-c;break;case"right":h[1]="left",d[0]=c;break}var p;return h[0]&&h[1]?p=h.join("-"):h[0]?p=h[0]:h[1]?p=h[1]:p="center",{anchor:p,offset:d}}}}),TK=de({"src/traces/scattermap/convert.js"(e,r){"use strict";var t=da(),i=Qt(),a=cn().BADNUM,o=g_(),s=Cs(),l=hn(),n=Sy(),u=bs(),c=n9().isSupportedFont,f=s9(),h=sf().appendArrayPointValue,d=Zo().NEWLINES,p=Zo().BR_TAG_ALL;r.exports=function(w,k){var A=k[0].trace,b=A.visible===!0&&A._length!==0,E=A.fill!=="none",T=u.hasLines(A),F=u.hasMarkers(A),D=u.hasText(A),R=F&&A.marker.symbol==="circle",P=F&&A.marker.symbol!=="circle",z=A.cluster&&A.cluster.enabled,I=g("fill"),L=g("line"),B=g("circle"),O=g("symbol"),G={fill:I,line:L,circle:B,symbol:O};if(!b)return G;var W;if((E||T)&&(W=o.calcTraceToLineCoords(k)),E&&(I.geojson=o.makePolygon(W),I.layout.visibility="visible",i.extendFlat(I.paint,{"fill-color":A.fillcolor})),T&&(L.geojson=o.makeLine(W),L.layout.visibility="visible",i.extendFlat(L.paint,{"line-width":A.line.width,"line-color":A.line.color,"line-opacity":A.opacity})),R){var X=m(k);B.geojson=X.geojson,B.layout.visibility="visible",z&&(B.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":S(A.cluster.color,A.cluster.step),"circle-radius":S(A.cluster.size,A.cluster.step),"circle-opacity":S(A.cluster.opacity,A.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":M(A),"text-size":12}}),i.extendFlat(B.paint,{"circle-color":X.mcc,"circle-radius":X.mrc,"circle-opacity":X.mo})}if(R&&z&&(B.filter=["!",["has","point_count"]]),(P||D)&&(O.geojson=y(k,w),i.extendFlat(O.layout,{visibility:"visible","icon-image":"{symbol}","text-field":"{text}"}),P&&(i.extendFlat(O.layout,{"icon-size":A.marker.size/10}),"angle"in A.marker&&A.marker.angle!=="auto"&&i.extendFlat(O.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),O.layout["icon-allow-overlap"]=A.marker.allowoverlap,i.extendFlat(O.paint,{"icon-opacity":A.opacity*A.marker.opacity,"icon-color":A.marker.color,"icon-halo-color":A.marker.color,"icon-halo-width":2,"icon-halo-blur":1.5})),D)){var Z=(A.marker||{}).size,J=f(A.textposition,Z);i.extendFlat(O.layout,{"text-size":A.textfont.size,"text-anchor":J.anchor,"text-offset":J.offset,"text-font":M(A)}),i.extendFlat(O.paint,{"text-color":A.textfont.color,"text-opacity":A.opacity})}return G};function g(C){return{type:C,geojson:o.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function m(C){var w=C[0].trace,k=w.marker,A=w.selectedpoints,b=i.isArrayOrTypedArray(k.color),E=i.isArrayOrTypedArray(k.size),T=i.isArrayOrTypedArray(k.opacity),F;function D(Z){return w.opacity*Z}function R(Z){return Z/2}var P;b&&(s.hasColorscale(w,"marker")?P=s.makeColorScaleFuncFromTrace(k):P=i.identity);var z;E&&(z=n(w));var I;T&&(I=function(Z){var J=t(Z)?+i.constrain(Z,0,1):0;return D(J)});var L=[];for(F=0;F850?F+=" Black":b>750?F+=" Extra Bold":b>650?F+=" Bold":b>550?F+=" Semi Bold":b>450?F+=" Medium":b>350?F+=" Regular":b>250?F+=" Light":b>150?F+=" Extra Light":F+=" Thin"):E.slice(0,2).join(" ")==="Open Sans"?(F="Open Sans",b>750?F+=" Extrabold":b>650?F+=" Bold":b>550?F+=" Semibold":b>350?F+=" Regular":F+=" Light"):E.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(F="Klokantech Noto Sans",E[3]==="CJK"&&(F+=" CJK"),F+=b>500?" Bold":" Regular")),T&&(F+=" Italic"),F==="Open Sans Regular Italic"?F="Open Sans Italic":F==="Open Sans Regular Bold"?F="Open Sans Bold":F==="Open Sans Regular Bold Italic"?F="Open Sans Bold Italic":F==="Klokantech Noto Sans Regular Italic"&&(F="Klokantech Noto Sans Italic"),c(F)||(F=k);var D=F.split(", ");return D}}}),AK=de({"src/traces/scattermap/plot.js"(e,r){"use strict";var t=Qt(),i=TK(),a=L0().traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(n,u,c,f){this.type="scattermap",this.subplot=n,this.uid=u,this.clusterEnabled=c,this.isHidden=f,this.sourceIds={fill:"source-"+u+"-fill",line:"source-"+u+"-line",circle:"source-"+u+"-circle",symbol:"source-"+u+"-symbol",cluster:"source-"+u+"-circle",clusterCount:"source-"+u+"-circle"},this.layerIds={fill:a+u+"-fill",line:a+u+"-line",circle:a+u+"-circle",symbol:a+u+"-symbol",cluster:a+u+"-cluster",clusterCount:a+u+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(n,u,c){var f={type:"geojson",data:u.geojson};c&&c.enabled&&t.extendFlat(f,{cluster:!0,clusterMaxZoom:c.maxzoom});var h=this.subplot.map.getSource(this.sourceIds[n]);h?h.setData(u.geojson):this.subplot.map.addSource(this.sourceIds[n],f)},l.setSourceData=function(n,u){this.subplot.map.getSource(this.sourceIds[n]).setData(u.geojson)},l.addLayer=function(n,u,c){var f={type:u.type,id:this.layerIds[n],source:this.sourceIds[n],layout:u.layout,paint:u.paint};u.filter&&(f.filter=u.filter);for(var h=this.layerIds[n],d,p=this.subplot.getMapLayers(),g=0;g=0;T--){var F=E[T];h.removeLayer(y.layerIds[F])}b||h.removeSource(y.sourceIds.circle)}function x(b){for(var E=o.nonCluster,T=0;T=0;T--){var F=E[T];h.removeLayer(y.layerIds[F]),b||h.removeSource(y.sourceIds[F])}}function M(b){m?v(b):S(b)}function C(b){g?_(b):x(b)}function w(){for(var b=g?o.cluster:o.nonCluster,E=0;E=0;f--){var h=c[f];u.removeLayer(this.layerIds[h]),u.removeSource(this.sourceIds[h])}},r.exports=function(u,c){var f=c[0].trace,h=f.cluster&&f.cluster.enabled,d=f.visible!==!0,p=new s(u,f.uid,h,d),g=i(u.gd,c),m=p.below=u.belowLookup["trace-"+f.uid],y,_,v;if(h)for(p.addSource("circle",g.circle,f.cluster),y=0;y=0?Math.floor((f+180)/360):Math.ceil((f-180)/360),C=M*360,w=f-C;function k(z){var I=z.lonlat;if(I[0]===s||x&&_.indexOf(z.i+1)===-1)return 1/0;var L=i.modHalf(I[0],360),B=I[1],O=y.project([L,B]),G=O.x-g.c2p([w,B]),W=O.y-m.c2p([L,h]),X=Math.max(3,z.mrc||0);return Math.max(Math.sqrt(G*G+W*W)-X,1-3/X)}if(t.getClosest(d,k,c),c.index!==!1){var A=d[c.index],b=A.lonlat,E=[i.modHalf(b[0],360)+C,b[1]],T=g.c2p(E),F=m.c2p(E),D=A.mrc||1;c.x0=T-D,c.x1=T+D,c.y0=F-D,c.y1=F+D;var R={};R[p.subplot]={_subplot:y};var P=p._module.formatLabels(A,p,R);return c.lonLabel=P.lonLabel,c.latLabel=P.latLabel,c.color=a(p,A),c.extraText=u(p,A,d[0].t.labels),c.hovertemplate=p.hovertemplate,[c]}}function u(c,f,h){if(c.hovertemplate)return;var d=f.hi||c.hoverinfo,p=d.split("+"),g=p.indexOf("all")!==-1,m=p.indexOf("lon")!==-1,y=p.indexOf("lat")!==-1,_=f.lonlat,v=[];function x(S){return S+"\xB0"}return g||m&&y?v.push("("+x(_[1])+", "+x(_[0])+")"):m?v.push(h.lon+x(_[0])):y&&v.push(h.lat+x(_[1])),(g||p.indexOf("text")!==-1)&&o(f,c,v),v.join("
")}r.exports={hoverPoints:n,getExtraText:u}}}),MK=de({"src/traces/scattermap/event_data.js"(e,r){"use strict";r.exports=function(i,a){return i.lon=a.lon,i.lat=a.lat,i}}}),SK=de({"src/traces/scattermap/select.js"(e,r){"use strict";var t=Qt(),i=bs(),{BADNUM:a}=cn(),o=360,s=.001,l=(c,f,h,d)=>[c.c2p([h,d]),f.c2p([h,d])];function n(c,f,h,d,p){let g=l(c,f,h+o,d),m=l(c,f,h-o,d),y=g[0]-p[0],_=g[1]-p[1],v=Math.abs(y-(p[0]-m[0])){if(Math.abs(m)p?null:[Math.floor(d)-1,Math.ceil(p)+1]}r.exports=function(f,h){var d;let{cd:p,xaxis:g,yaxis:m}=f,{trace:y}=p[0];if(!i.hasMarkers(y))return[];if(h===!1){for(let S of p)S.selected=0;return[]}let _=(d=g._subplot)==null?void 0:d.map,v=!!_?.getRenderWorldCopies()&&h.xmax>h.xmin,x=[];for(let S=0;S=1)return 1;let h=c;for(let g=0;g<8;g++){let m=((s*h+o)*h+a)*h-c;if(Math.abs(m)m?d=h:p=h,h=(d+p)*.5}return((u*h+n)*h+l)*h}}function B4(){return Tx??(Tx=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Tx}function l9(){if(Ax==null&&(Ax=!1,B4())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let i=t*4;e.fillStyle=`rgb(${i},${i+1},${i+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let r=e.getImageData(0,0,5,5).data;for(let t=0;t<100;t++)if(t%4!=3&&r[t]!==t){Ax=!0;break}}}return Ax||!1}function u9(){var e=new Ql(9);return Ql!=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}function kK(e){var r=e[0],t=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],n=e[7],u=e[8];return r*(u*o-s*n)+t*(-u*a+s*l)+i*(n*a-o*l)}function CK(e,r){var t=Math.sin(r),i=Math.cos(r);return e[0]=i,e[1]=t,e[2]=0,e[3]=-t,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function DK(e,r){var t=r[0],i=r[1],a=r[2],o=r[3],s=t+t,l=i+i,n=a+a,u=t*s,c=i*s,f=i*l,h=a*s,d=a*l,p=a*n,g=o*s,m=o*l,y=o*n;return e[0]=1-f-p,e[3]=c-y,e[6]=h+m,e[1]=c+y,e[4]=1-u-p,e[7]=d-g,e[2]=h-m,e[5]=d+g,e[8]=1-u-f,e}function zp(){var e=new Ql(16);return Ql!=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}function O4(e){var r=new Ql(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function LK(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function $h(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 E_(e,r){var t=r[0],i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],n=r[6],u=r[7],c=r[8],f=r[9],h=r[10],d=r[11],p=r[12],g=r[13],m=r[14],y=r[15],_=t*l-i*s,v=t*n-a*s,x=t*u-o*s,S=i*n-a*l,M=i*u-o*l,C=a*u-o*n,w=c*g-f*p,k=c*m-h*p,A=c*y-d*p,b=f*m-h*g,E=f*y-d*g,T=h*y-d*m,F=_*T-v*E+x*b+S*A-M*k+C*w;return F?(F=1/F,e[0]=(l*T-n*E+u*b)*F,e[1]=(a*E-i*T-o*b)*F,e[2]=(g*C-m*M+y*S)*F,e[3]=(h*M-f*C-d*S)*F,e[4]=(n*A-s*T-u*k)*F,e[5]=(t*T-a*A+o*k)*F,e[6]=(m*x-p*C-y*v)*F,e[7]=(c*C-h*x+d*v)*F,e[8]=(s*E-l*A+u*w)*F,e[9]=(i*A-t*E-o*w)*F,e[10]=(p*M-g*x+y*_)*F,e[11]=(f*x-c*M-d*_)*F,e[12]=(l*k-s*b-n*w)*F,e[13]=(t*b-i*k+a*w)*F,e[14]=(g*v-p*S-m*_)*F,e[15]=(c*S-f*v+h*_)*F,e):null}function Wv(e,r,t){var i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],n=r[5],u=r[6],c=r[7],f=r[8],h=r[9],d=r[10],p=r[11],g=r[12],m=r[13],y=r[14],_=r[15],v=t[0],x=t[1],S=t[2],M=t[3];return e[0]=v*i+x*l+S*f+M*g,e[1]=v*a+x*n+S*h+M*m,e[2]=v*o+x*u+S*d+M*y,e[3]=v*s+x*c+S*p+M*_,v=t[4],x=t[5],S=t[6],M=t[7],e[4]=v*i+x*l+S*f+M*g,e[5]=v*a+x*n+S*h+M*m,e[6]=v*o+x*u+S*d+M*y,e[7]=v*s+x*c+S*p+M*_,v=t[8],x=t[9],S=t[10],M=t[11],e[8]=v*i+x*l+S*f+M*g,e[9]=v*a+x*n+S*h+M*m,e[10]=v*o+x*u+S*d+M*y,e[11]=v*s+x*c+S*p+M*_,v=t[12],x=t[13],S=t[14],M=t[15],e[12]=v*i+x*l+S*f+M*g,e[13]=v*a+x*n+S*h+M*m,e[14]=v*o+x*u+S*d+M*y,e[15]=v*s+x*c+S*p+M*_,e}function Ol(e,r,t){var i=t[0],a=t[1],o=t[2],s,l,n,u,c,f,h,d,p,g,m,y;return r===e?(e[12]=r[0]*i+r[4]*a+r[8]*o+r[12],e[13]=r[1]*i+r[5]*a+r[9]*o+r[13],e[14]=r[2]*i+r[6]*a+r[10]*o+r[14],e[15]=r[3]*i+r[7]*a+r[11]*o+r[15]):(s=r[0],l=r[1],n=r[2],u=r[3],c=r[4],f=r[5],h=r[6],d=r[7],p=r[8],g=r[9],m=r[10],y=r[11],e[0]=s,e[1]=l,e[2]=n,e[3]=u,e[4]=c,e[5]=f,e[6]=h,e[7]=d,e[8]=p,e[9]=g,e[10]=m,e[11]=y,e[12]=s*i+c*a+p*o+r[12],e[13]=l*i+f*a+g*o+r[13],e[14]=n*i+h*a+m*o+r[14],e[15]=u*i+d*a+y*o+r[15]),e}function Xu(e,r,t){var i=t[0],a=t[1],o=t[2];return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*a,e[5]=r[5]*a,e[6]=r[6]*a,e[7]=r[7]*a,e[8]=r[8]*o,e[9]=r[9]*o,e[10]=r[10]*o,e[11]=r[11]*o,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function Yv(e,r,t){var i=Math.sin(t),a=Math.cos(t),o=r[4],s=r[5],l=r[6],n=r[7],u=r[8],c=r[9],f=r[10],h=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=o*a+u*i,e[5]=s*a+c*i,e[6]=l*a+f*i,e[7]=n*a+h*i,e[8]=u*a-o*i,e[9]=c*a-s*i,e[10]=f*a-l*i,e[11]=h*a-n*i,e}function c9(e,r,t){var i=Math.sin(t),a=Math.cos(t),o=r[0],s=r[1],l=r[2],n=r[3],u=r[8],c=r[9],f=r[10],h=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=o*a-u*i,e[1]=s*a-c*i,e[2]=l*a-f*i,e[3]=n*a-h*i,e[8]=o*i+u*a,e[9]=s*i+c*a,e[10]=l*i+f*a,e[11]=n*i+h*a,e}function Bp(e,r,t){var i=Math.sin(t),a=Math.cos(t),o=r[0],s=r[1],l=r[2],n=r[3],u=r[4],c=r[5],f=r[6],h=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=o*a+u*i,e[1]=s*a+c*i,e[2]=l*a+f*i,e[3]=n*a+h*i,e[4]=u*a-o*i,e[5]=c*a-s*i,e[6]=f*a-l*i,e[7]=h*a-n*i,e}function FK(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function PK(e,r,t,i,a){var o=1/Math.tan(r/2);if(e[0]=o/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){var s=1/(i-a);e[10]=(a+i)*s,e[14]=2*a*i*s}else e[10]=-1,e[14]=-2*i;return e}function IK(e,r,t,i,a,o,s){var l=1/(r-t),n=1/(i-a),u=1/(o-s);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*l,e[13]=(a+i)*n,e[14]=(s+o)*u,e[15]=1,e}function RK(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}function zK(e,r){var t=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],n=e[6],u=e[7],c=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15],_=r[0],v=r[1],x=r[2],S=r[3],M=r[4],C=r[5],w=r[6],k=r[7],A=r[8],b=r[9],E=r[10],T=r[11],F=r[12],D=r[13],R=r[14],P=r[15];return Math.abs(t-_)<=1e-6*Math.max(1,Math.abs(t),Math.abs(_))&&Math.abs(i-v)<=1e-6*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(a-x)<=1e-6*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-S)<=1e-6*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-C)<=1e-6*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(n-w)<=1e-6*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(u-k)<=1e-6*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(c-A)<=1e-6*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(f-b)<=1e-6*Math.max(1,Math.abs(f),Math.abs(b))&&Math.abs(h-E)<=1e-6*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(d-T)<=1e-6*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-F)<=1e-6*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(g-D)<=1e-6*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(m-R)<=1e-6*Math.max(1,Math.abs(m),Math.abs(R))&&Math.abs(y-P)<=1e-6*Math.max(1,Math.abs(y),Math.abs(P))}function f9(){var e=new Ql(3);return Ql!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function N4(e){var r=new Ql(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function np(e){var r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function h9(e,r,t){var i=new Ql(3);return i[0]=e,i[1]=r,i[2]=t,i}function uh(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function d9(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function Ws(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function k_(e,r,t,i){return e[0]=r[0]+t[0]*i,e[1]=r[1]+t[1]*i,e[2]=r[2]+t[2]*i,e}function BK(e,r){var t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return Math.sqrt(t*t+i*i+a*a)}function OK(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function qc(e,r){var t=r[0],i=r[1],a=r[2],o=t*t+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r[0]*o,e[1]=r[1]*o,e[2]=r[2]*o,e}function Kl(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function uf(e,r,t){var i=r[0],a=r[1],o=r[2],s=t[0],l=t[1],n=t[2];return e[0]=a*n-o*l,e[1]=o*s-i*n,e[2]=i*l-a*s,e}function NK(e,r,t){var i=r[0],a=r[1],o=r[2],s=t[3]*i+t[7]*a+t[11]*o+t[15];return s||(s=1),e[0]=(t[0]*i+t[4]*a+t[8]*o+t[12])/s,e[1]=(t[1]*i+t[5]*a+t[9]*o+t[13])/s,e[2]=(t[2]*i+t[6]*a+t[10]*o+t[14])/s,e}function jK(e,r,t){var i=r[0],a=r[1],o=r[2];return e[0]=i*t[0]+a*t[3]+o*t[6],e[1]=i*t[1]+a*t[4]+o*t[7],e[2]=i*t[2]+a*t[5]+o*t[8],e}function j4(e,r,t){var i=t[0],a=t[1],o=t[2],s=t[3],l=r[0],n=r[1],u=r[2],c=a*u-o*n,f=o*l-i*u,h=i*n-a*l;return c+=c,f+=f,h+=h,e[0]=l+s*c+a*h-o*f,e[1]=n+s*f+o*c-i*h,e[2]=u+s*h+i*f-a*c,e}function N1(e,r,t,i){var a=[],o=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],o[0]=a[0],o[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),o[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),e[0]=o[0]+t[0],e[1]=o[1]+t[1],e[2]=o[2]+t[2],e}function Xv(e,r,t,i){var a=[],o=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],o[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),o[1]=a[1],o[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),e[0]=o[0]+t[0],e[1]=o[1]+t[1],e[2]=o[2]+t[2],e}function U4(e,r,t,i){var a=[],o=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],o[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),o[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),o[2]=a[2],e[0]=o[0]+t[0],e[1]=o[1]+t[1],e[2]=o[2]+t[2],e}function UK(e){return e[0]=0,e[1]=0,e[2]=0,e}function qK(){var e=new Ql(4);return Ql!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function VK(e,r,t,i){var a=new Ql(4);return a[0]=e,a[1]=r,a[2]=t,a[3]=i,a}function GK(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e[3]=r[3]*t[3],e}function HK(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e[3]=r[3]*t,e}function $K(e,r){var t=r[0],i=r[1],a=r[2],o=r[3],s=t*t+i*i+a*a+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=t*s,e[1]=i*s,e[2]=a*s,e[3]=o*s,e}function pu(e,r,t){var i=r[0],a=r[1],o=r[2],s=r[3];return e[0]=t[0]*i+t[4]*a+t[8]*o+t[12]*s,e[1]=t[1]*i+t[5]*a+t[9]*o+t[13]*s,e[2]=t[2]*i+t[6]*a+t[10]*o+t[14]*s,e[3]=t[3]*i+t[7]*a+t[11]*o+t[15]*s,e}function p9(){var e=new Ql(4);return Ql!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function WK(e,r,t){t*=.5;var i=Math.sin(t);return e[0]=i*r[0],e[1]=i*r[1],e[2]=i*r[2],e[3]=Math.cos(t),e}function YK(e,r,t){var i=r[0],a=r[1],o=r[2],s=r[3],l=t[0],n=t[1],u=t[2],c=t[3];return e[0]=i*c+s*l+a*u-o*n,e[1]=a*c+s*n+o*l-i*u,e[2]=o*c+s*u+i*n-a*l,e[3]=s*c-i*l-a*n-o*u,e}function C_(e,r,t,i){var a=r[0],o=r[1],s=r[2],l=r[3],n=t[0],u=t[1],c=t[2],f=t[3],h,d=a*n+o*u+s*c+l*f,p,g,m;return d<0&&(d=-d,n=-n,u=-u,c=-c,f=-f),1-d>1e-6?(h=Math.acos(d),p=Math.sin(h),g=Math.sin((1-i)*h)/p,m=Math.sin(i*h)/p):(g=1-i,m=i),e[0]=g*a+m*n,e[1]=g*o+m*u,e[2]=g*s+m*c,e[3]=g*l+m*f,e}function XK(e,r){var t=r[0]+r[4]+r[8],i;if(t>0)i=Math.sqrt(t+1),e[3]=.5*i,i=.5/i,e[0]=(r[5]-r[7])*i,e[1]=(r[6]-r[2])*i,e[2]=(r[1]-r[3])*i;else{var a=0;r[4]>r[0]&&(a=1),r[8]>r[a*3+a]&&(a=2);var o=(a+1)%3,s=(a+2)%3;i=Math.sqrt(r[a*3+a]-r[o*3+o]-r[s*3+s]+1),e[a]=.5*i,i=.5/i,e[3]=(r[o*3+s]-r[s*3+o])*i,e[o]=(r[o*3+a]+r[a*3+o])*i,e[s]=(r[s*3+a]+r[a*3+s])*i}return e}function q4(e,r,t,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",o=Math.PI/360;r*=o,i*=o,t*=o;var s=Math.sin(r),l=Math.cos(r),n=Math.sin(t),u=Math.cos(t),c=Math.sin(i),f=Math.cos(i);switch(a){case"xyz":e[0]=s*u*f+l*n*c,e[1]=l*n*f-s*u*c,e[2]=l*u*c+s*n*f,e[3]=l*u*f-s*n*c;break;case"xzy":e[0]=s*u*f-l*n*c,e[1]=l*n*f-s*u*c,e[2]=l*u*c+s*n*f,e[3]=l*u*f+s*n*c;break;case"yxz":e[0]=s*u*f+l*n*c,e[1]=l*n*f-s*u*c,e[2]=l*u*c-s*n*f,e[3]=l*u*f+s*n*c;break;case"yzx":e[0]=s*u*f+l*n*c,e[1]=l*n*f+s*u*c,e[2]=l*u*c-s*n*f,e[3]=l*u*f-s*n*c;break;case"zxy":e[0]=s*u*f-l*n*c,e[1]=l*n*f+s*u*c,e[2]=l*u*c+s*n*f,e[3]=l*u*f-s*n*c;break;case"zyx":e[0]=s*u*f-l*n*c,e[1]=l*n*f+s*u*c,e[2]=l*u*c-s*n*f,e[3]=l*u*f+s*n*c;break;default:throw Error("Unknown angle order "+a)}return e}function V4(){var e=new Ql(2);return Ql!=Float32Array&&(e[0]=0,e[1]=0),e}function v9(e,r){var t=new Ql(2);return t[0]=e,t[1]=r,t}function m9(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e}function g9(e){var r=e[0],t=e[1];return Math.sqrt(r*r+t*t)}function ZK(e){var r=e[0],t=e[1];return r*r+t*t}function KK(e,r){return e[0]*r[0]+e[1]*r[1]}function y9(e){return e[0]=0,e[1]=0,e}function Cf(e,r,t){return r*(Bi/(e.tileSize*2**(t-e.tileID.overscaledZ)))}function Zu(e){return e instanceof Error?e:Error(typeof e=="string"?e:String(e))}function Op(){return new Float64Array(4)}function fs(){return new Float64Array(3)}function F0(){return new Float64Array(16)}function D_(){let e=new Float64Array(16);return $h(e),e}function _9(){let e=new Float32Array(16);return $h(e),e}function Np(e,r,t,i,a=!1){if(!t[0]&&!t[1])return[0,0];let o=a?i==="map"?-e.bearingInRadians:0:i==="viewport"?e.bearingInRadians:0;if(o){let s=Math.sin(o),l=Math.cos(o);t=[t[0]*l-t[1]*s,t[0]*s+t[1]*l]}return[a?t[0]:Cf(r,t[0],e.zoom),a?t[1]:Cf(r,t[1],e.zoom)]}function G4(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]}function ch(e,r,t){let i=kK([e[0],e[1],e[2],r[0],r[1],r[2],t[0],t[1],t[2]]);if(i===0)return null;let a=uf([],[r[0],r[1],r[2]],[t[0],t[1],t[2]]),o=uf([],[t[0],t[1],t[2]],[e[0],e[1],e[2]]),s=uf([],[e[0],e[1],e[2]],[r[0],r[1],r[2]]),l=Ws([],a,-e[3]);return uh(l,l,Ws([],o,-r[3])),uh(l,l,Ws([],s,-t[3])),Ws(l,l,1/i),l}function JK(e,r,t){let i=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],a=r[0]*t[0]+r[1]*t[1]+r[2]*t[2];return a===0?null:(-i-t[3])/a}function L_(e,r,t,i){let a=Math.sqrt(e*e+r*r),o=Math.sqrt(t*t+i*i);e/=a,r/=a,t/=o,i/=o;let s=e*t+r*i,l=Math.acos(s);return-r*t+e*i>0?l:-l}function Df(e,r){let t=P0(e,360),i=P0(r,360),a=i-t,o=i>t?a-360:a+360;return Math.abs(a)n.canonical.z)),t=1/0,i=-1/0,a=1/0,o=-1/0,s=[];for(let n of e){let{x:u,y:c,z:f}=n.canonical,h=2**(r-f),d=u*h,p=c*h;s.push({id:n,x:d,y:p}),di&&(i=d),po&&(o=p)}let l=new Set;for(let n of s)(n.x===t||n.x===i||n.y===a||n.y===o)&&l.add(n.id);return l}function tJ(e){if(e<=0)return 0;if(e>=1)return 1;let r=e*e,t=r*e;return 4*(e<.5?t:3*(e-r)+t-.75)}function H4(e,r,t,i){return EK(e,r,t,i)}function to(e,r,t){return Math.min(t,Math.max(r,e))}function fh(e,r,t){let i=t-r,a=((e-r)%i+i)%i+r;return a===r?t:a}function yn(e,...r){for(let t of r)for(let i in t)e[i]=t[i];return e}function j1(e,r){let t={};for(let i of r)i in e&&(t[i]=e[i]);return t}function x9(){return wP++}function rJ(e){return Math.log(e)/Math.LN2%1==0}function iJ(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}function Vc(e){return 2**e}function Ku(e){return Math.log(e)/Math.LN2}function Lf(e,r,t){if(r<=0)return e;let i=1/r;return t===void 0||Math.abs(t)<1e-10?Math.round(e*i)/i:(t>0?Math.ceil(e*i-1e-9):Math.floor(e*i+1e-10))/i}function $4(e,r,t){let i={};for(let a in e)i[a]=r.call(t||this,e[a],a,e);return i}function b9(e,r,t){let i={};for(let a in e)r.call(t||this,e[a],a,e)&&(i[a]=e[a]);return i}function Ad(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let t=0;t(r.y-e.y)*(t.x-e.x)}function aJ(e,r,t,i){let a=r.y-e.y,o=r.x-e.x,s=i.y-t.y,l=i.x-t.x,n=s*o-l*a;if(n===0)return null;let u=e.y-t.y,c=e.x-t.x,f=(l*u-s*c)/n;return new Wr(e.x+f*o,e.y+f*a)}function nJ([e,r,t]){return r+=90,r*=Math.PI/180,t*=Math.PI/180,[e*Math.cos(r)*Math.sin(t),e*Math.sin(r)*Math.sin(t),e*Math.cos(t)]}function Kv(e){return typeof WorkerGlobalScope<"u"&&e!==void 0&&e instanceof WorkerGlobalScope}function oJ(e){let r=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,t={};if(e.replace(r,(i,a,o,s)=>{let l=o||s;return t[a]=!l||l.toLowerCase(),""}),t["max-age"]){let i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t}function sJ(e){if(Ex==null){let r=e.navigator?e.navigator.userAgent:null;Ex=!!e.safari||!!(r&&(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return Ex}function I0(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}function lJ(e,r,t,i,a){let o=Math.max(-r,0)*4,s=(Math.max(0,t)-t)*i*4+o,l=i*4,n=Math.max(0,r),u=Math.max(0,t),c=Math.min(e.width,r+i),f=Math.min(e.height,t+a);return{rect:{x:n,y:u,width:c-n,height:f-u},layout:[{offset:s,stride:l}]}}function uJ(e,r,t,i,a){return Xr(this,null,function*(){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let o=new VideoFrame(e,{timestamp:0});try{let s=o?.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let l=s.startsWith("BGR"),n=new Uint8ClampedArray(i*a*4);if(yield o.copyTo(n,lJ(e,r,t,i,a)),l)for(let u=0;u{e.removeEventListener(r,t,i)}}}function rl(e){return e*Math.PI/180}function Md(e){return e/Math.PI*180}function w9(e,r){return e.roll==r.roll&&e.pitch==r.pitch&&e.bearing==r.bearing}function cJ(e){let r=new Float64Array(9);DK(r,e);let t=Md(-Math.asin(to(r[2],-1,1))),i,a;return Math.hypot(r[5],r[8])<.001?(i=0,a=-Md(Math.atan2(r[3],r[4]))):(i=Md(r[5]===0&&r[8]===0?0:Math.atan2(r[5],r[8])),a=Md(r[1]===0&&r[0]===0?0:Math.atan2(r[1],r[0]))),{roll:i,pitch:t+90,bearing:a}}function T9(e,r,t){let i=v9(r.x-t.x,r.y-t.y),a=v9(e.x-t.x,e.y-t.y),o=i[0]*a[1]-i[1]*a[0];return Md(Math.atan2(o,KK(i,a)))}function A9(e,r,t){let i=new Float64Array(4);return q4(i,e,r-90,t),i}function fJ(e,r){return cT[r]&&"touches"in e}function hJ(e,r){var t,i;if(!fT[r])return!1;let a=e,o=((i=(t=a?.target)==null?void 0:t.ownerDocument)==null?void 0:i.defaultView)||window;return a instanceof o.MouseEvent||a instanceof o.WheelEvent}function dJ(e){return cT[e]||fT[e]}function Up(e){return e instanceof Error&&e.name==="AbortError"}function Y4(e){if(e.aborted)throw new mm(e.reason)}function M9(e){return ff.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}function pJ(e,r){ff.REGISTERED_PROTOCOLS[e]=r}function vJ(e){delete ff.REGISTERED_PROTOCOLS[e]}function X4(){var e;if(Kv(self))return(e=self.worker)==null?void 0:e.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch{}return window.location.href}function mJ(e,r){return Xr(this,null,function*(){let t=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:X4(),referrerPolicy:e.referrerPolicy,signal:r.signal});e.type==="json"&&!t.headers.has("Accept")&&t.headers.set("Accept","application/json");let i;try{i=yield fetch(t)}catch(s){throw Up(s)?s:new gm(0,Zu(s).message,e.url,new Blob)}if(!i.ok){let s=yield i.blob();throw new gm(i.status,i.statusText,e.url,s)}let a;a=e.type==="arrayBuffer"||e.type==="image"?i.arrayBuffer():e.type==="json"?i.json():i.text();let o=yield a;return Y4(r.signal),{data:o,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}})}function gJ(e,r){return new Promise((t,i)=>{var a;let o=new XMLHttpRequest;o.open(e.method||"GET",e.url,!0),(e.type==="arrayBuffer"||e.type==="image")&&(o.responseType="arraybuffer");for(let s in e.headers)o.setRequestHeader(s,e.headers[s]);e.type==="json"&&(o.responseType="text",(a=e.headers)!=null&&a.Accept||o.setRequestHeader("Accept","application/json")),o.withCredentials=e.credentials==="include",o.onerror=()=>{i(Error(o.statusText))},o.onload=()=>{if(!r.signal.aborted)if((o.status>=200&&o.status<300||o.status===0)&&o.response!==null){let s=o.response;if(e.type==="json")try{s=JSON.parse(o.response)}catch(l){i(l);return}t({data:s,cacheControl:o.getResponseHeader("Cache-Control"),expires:o.getResponseHeader("Expires"),etag:o.getResponseHeader("ETag")})}else{let s=new Blob([o.response],{type:o.getResponseHeader("Content-Type")});i(new gm(o.status,o.statusText,e.url,s))}},r.signal.addEventListener("abort",()=>{o.abort(),i(new mm(r.signal.reason))}),o.send(e.body)})}function S9(e){if(!e||e.startsWith("data:image/"))return!0;if(e.startsWith("blob:")&&(e=e.slice(5),e.startsWith("null")))return!1;if(e.indexOf("://")<=0)return!0;let r=new URL(e),t=window.location;return r.protocol===t.protocol&&r.host===t.host}function E9(e,r,t){var i;(i=t[e])!=null&&i.includes(r)||(t[e]||(t[e]=[]),t[e].push(r))}function Z4(e,r,t){if(t?.[e]){let i=t[e].indexOf(r);i!==-1&&t[e].splice(i,1)}}function pc(e,r){return{kind:"array",itemType:e,N:r}}function ll(e){if(e.kind==="array"){let r=ll(e.itemType);return typeof e.N=="number"?`array<${r}, ${e.N}>`:e.itemType.kind==="value"?"array":`array<${r}>`}return e.kind}function U1(e,r){if(r.kind==="error")return null;if(e.kind==="array"){if(r.kind==="array"&&(r.N===0&&r.itemType.kind==="value"||!U1(e.itemType,r.itemType))&&(typeof e.N!="number"||e.N===r.N))return null}else{if(e.kind===r.kind)return null;if(e.kind==="value"){for(let t of CP)if(!U1(t,r))return null}}return`Expected ${ll(e)} but found ${ll(r)} instead.`}function K4(e,r){return r.some(t=>t.kind===e.kind)}function R0(e,r){return r.some(t=>t==="null"?e===null:t==="array"?Array.isArray(e):t==="object"?e&&!Array.isArray(e)&&typeof e=="object":t===typeof e)}function qp(e,r){return e.kind==="array"&&r.kind==="array"?e.itemType.kind===r.itemType.kind&&typeof e.N=="number":e.kind===r.kind}function k9(e){return e%=360,e<0&&(e+=360),e}function C9([e,r,t,i]){e=J4(e),r=J4(r),t=J4(t);let a,o,s=Q4((.2225045*e+.7168786*r+.0606169*t)/1);e===r&&r===t?a=o=s:(a=Q4((.4360747*e+.3850649*r+.1430804*t)/vT),o=Q4((.0139322*e+.0971045*r+.7141733*t)/mT));let l=116*s-16;return[l<0?0:l,500*(a-s),200*(s-o),i]}function J4(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Q4(e){return e>.008856451679035631?e**.3333333333333333:e/yT+gT}function D9([e,r,t,i]){let a=(e+16)/116,o=isNaN(r)?a:a+r/500,s=isNaN(t)?a:a-t/200;return a=1*t6(a),o=vT*t6(o),s=mT*t6(s),[e6(3.1338561*o-1.6168667*a-.4906146*s),e6(-.9787684*o+1.9161415*a+.033454*s),e6(.0719453*o-.2289914*a+1.4052427*s),i]}function e6(e){return e=e<=.00304?12.92*e:1.055*e**.4166666666666667-.055,e<0?0:e>1?1:e}function t6(e){return e>Cx?e*e*e:yT*(e-gT)}function yJ(e){let[r,t,i,a]=C9(e),o=Math.sqrt(t*t+i*i);return[Math.round(o*1e4)?k9(Math.atan2(i,t)*LP):NaN,o,r,a]}function _J([e,r,t,i]){return e=isNaN(e)?0:e*DP,D9([t,Math.cos(e)*r,Math.sin(e)*r,i])}function xJ([e,r,t,i]){e=k9(e),r/=100,t/=100;function a(o){let s=(o+e/30)%12,l=r*Math.min(t,1-t);return t-l*Math.max(-1,Math.min(s-3,9-s,1))}return[a(0),a(8),a(4),i]}function q1(e,r){return FP(e,r)?e[r]:void 0}function bJ(e){if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let r=q1(PP,e);if(r){let[i,a,o]=r;return[i/255,a/255,o/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let i=e.length<6?1:2,a=1;return[I_(e.slice(a,a+=i)),I_(e.slice(a,a+=i)),I_(e.slice(a,a+=i)),I_(e.slice(a,a+i)||"ff")]}if(e.startsWith("rgb")){let i=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[a,o,s,l,n,u,c,f,h,d,p,g]=i,m=[l||" ",c||" ",d].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let y=[s,u,h].join(""),_=y==="%%%"?100:y===""?255:0;if(_){let v=[Jv(+o/_,0,1),Jv(+n/_,0,1),Jv(+f/_,0,1),p?L9(+p,g):1];if(F9(v))return v}}return}}let t=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[i,a,o,s,l,n,u,c,f]=t,h=[o||" ",l||" ",u].join("");if(h===" "||h===" /"||h===",,"||h===",,,"){let d=[+a,Jv(+s,0,100),Jv(+n,0,100),c?L9(+c,f):1];if(F9(d))return xJ(d)}}}function I_(e){return parseInt(e.padEnd(2,e),16)/255}function L9(e,r){return Jv(r?e/100:e,0,1)}function Jv(e,r,t){return Math.min(Math.max(r,e),t)}function F9(e){return!e.some(Number.isNaN)}function Vp(e,r,t){return e+t*(r-e)}function Qv(e,r,t){return e.map((i,a)=>Vp(i,r[a],t))}function wJ(e){return e==="rgb"||e==="hcl"||e==="lab"}function P9(e,r,t,i){return typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[e,r,t,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[e,r,t,i]:[e,r,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function em(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof sp||e instanceof ro||e instanceof Lx||e instanceof kd||e instanceof Xh||e instanceof Zh||e instanceof If||e instanceof Kh||e instanceof Jh)return!0;if(Array.isArray(e)){for(let r of e)if(!em(r))return!1;return!0}if(typeof e=="object"){for(let r in e)if(!em(e[r]))return!1;return!0}return!1}function Ml(e){if(e===null)return ym;if(typeof e=="string")return so;if(typeof e=="boolean")return Ao;if(typeof e=="number")return Ra;if(e instanceof ro)return ph;if(e instanceof sp)return gg;if(e instanceof Lx)return yg;if(e instanceof kd)return _m;if(e instanceof Xh)return _g;if(e instanceof Zh)return xg;if(e instanceof If)return xm;if(e instanceof Kh)return bg;if(e instanceof Jh)return bm;if(Array.isArray(e)){let r=e.length,t;for(let i of e){let a=Ml(i);if(!t)t=a;else{if(t===a)continue;t=co;break}}return pc(t||co,r)}return Yp}function V1(e){let r=typeof e;return e===null?"":r==="string"||r==="number"||r==="boolean"?String(e):e instanceof ro||e instanceof sp||e instanceof kd||e instanceof Xh||e instanceof Zh||e instanceof If||e instanceof Kh||e instanceof Jh?e.toString():JSON.stringify(e)}function R_(e,r,t){let i=e.length-1,a=0,o=i,s=0,l,n;for(;a<=o;)if(s=Math.floor((a+o)/2),l=e[s],n=e[s+1],l<=r){if(s===i||rr)o=s-1;else throw new Xs("Input is not a number.",t);return 0}function TJ(e,r,t,i){let a=3*e,o=3*(t-e)-a,s=1-a-o,l=3*r,n=3*(i-r)-l,u=1-l-n;return function(c,f=1e-6){if(c<=0)return 0;if(c>=1)return 1;let h=c;for(let g=0;g<8;g++){let m=((s*h+o)*h+a)*h-c;if(Math.abs(m)m?d=h:p=h,h=(d+p)*.5}return((u*h+n)*h+l)*h}}function r6(e,r,t,i){let a=i-t,o=e-t;return a===0?0:r===1?o/a:(r**+o-1)/(r**+a-1)}function I9(e,r,t=0,i=e.length-1,a=AJ){for(;i>t;){if(i-t>600){let n=i-t+1,u=r-t+1,c=Math.log(n),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(n-f)/n)*(u-n/2<0?-1:1);I9(e,r,Math.max(t,Math.floor(r-u*f/n+h)),Math.min(i,Math.floor(r+(n-u)*f/n+h)),a)}let o=e[r],s=t,l=i;for(G1(e,t,r),a(e[i],o)>0&&G1(e,t,i);s0;)l--}a(e[t],o)===0?G1(e,t,l):(l++,G1(e,l,i)),l<=r&&(t=l+1),r<=l&&(i=l-1)}}function G1(e,r,t){let i=e[r];e[r]=e[t],e[t]=i}function AJ(e,r){return er)}function z_(e,r){if(e.length<=1)return[e];let t=[],i,a;for(let o of e){let s=SJ(o);s!==0&&(o.area=Math.abs(s),a===void 0&&(a=s<0),a===s<0?(i&&t.push(i),i=[o]):i.push(o))}if(i&&t.push(i),r>1)for(let o=0;ot}function LJ(e,r,t){return r<=t}function FJ(e,r,t){return r>=t}function z9(e,r,t,i){return i.compare(r,t)===0}function PJ(e,r,t,i){return!z9(e,r,t,i)}function IJ(e,r,t,i){return i.compare(r,t)<0}function RJ(e,r,t,i){return i.compare(r,t)>0}function zJ(e,r,t,i){return i.compare(r,t)<=0}function BJ(e,r,t,i){return i.compare(r,t)>=0}function tm(e,r,t){let i=e!=="=="&&e!=="!=";return class Cj{constructor(o,s,l,n){this.lhs=o,this.rhs=s,this.key=l,this.collator=n,this.type=Ao,this.hasUntypedArgument=o.type.kind==="value"||s.type.kind==="value"}static parse(o,s){if(o.length!==3&&o.length!==4)return s.error("Expected two or three arguments.");let l=o[0],n=s.parse(o[1],1,co);if(!n)return null;if(!R9(l,n.type))return s.concat(1).error(`"${l}" comparisons are not supported for type '${ll(n.type)}'.`);let u=s.parse(o[2],2,co);if(!u)return null;if(!R9(l,u.type))return s.concat(2).error(`"${l}" comparisons are not supported for type '${ll(u.type)}'.`);if(n.type.kind!==u.type.kind&&n.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types '${ll(n.type)}' and '${ll(u.type)}'.`);i&&(n.type.kind==="value"&&u.type.kind!=="value"?n=new Cd(u.type,[n],s.key):n.type.kind!=="value"&&u.type.kind==="value"&&(u=new Cd(n.type,[u],s.key)));let c=null;if(o.length===4){if(n.type.kind!=="string"&&u.type.kind!=="string"&&n.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(c=s.parse(o[3],3,yg),!c)return null}return new Cj(n,u,s.key,c)}evaluate(o){let s=this.lhs.evaluate(o),l=this.rhs.evaluate(o);if(i&&this.hasUntypedArgument){let n=Ml(s),u=Ml(l);if(n.kind!==u.kind||n.kind!=="string"&&n.kind!=="number")throw new Xs(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${n.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let n=Ml(s),u=Ml(l);if(n.kind!=="string"||u.kind!=="string")return r(o,s,l)}return this.collator?t(o,s,l,this.collator.evaluate(o)):r(o,s,l)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}function OJ(e,r){let t=NJ(e[0]),i=UJ(e[1]),a=2**r.z;return[Math.round(t*a*Qh),Math.round(i*a*Qh)]}function i6(e,r){let t=2**r.z,i=(e[0]/Qh+r.x)/t,a=(e[1]/Qh+r.y)/t;return[jJ(i),qJ(a)]}function NJ(e){return(180+e)/360}function jJ(e){return e*360-180}function UJ(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function qJ(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function H1(e,r){e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[0]),e[3]=Math.max(e[3],r[1])}function $1(e,r){return!(e[0]<=r[0]||e[2]>=r[2]||e[1]<=r[1]||e[3]>=r[3])}function VJ(e,r,t){return r[1]>e[1]!=t[1]>e[1]&&e[0]<(t[0]-r[0])*(e[1]-r[1])/(t[1]-r[1])+r[0]}function GJ(e,r,t){let i=e[0]-r[0],a=e[1]-r[1],o=e[0]-t[0],s=e[1]-t[1];return i*s-o*a===0&&i*o<=0&&a*s<=0}function B_(e,r,t,i){let a=[r[0]-e[0],r[1]-e[1]];return YJ([i[0]-t[0],i[1]-t[1]],a)!==0&&!!(O9(e,r,t,i)&&O9(t,i,e,r))}function HJ(e,r,t){for(let i of t)for(let a=0;a0&&f<0||c<0&&f>0}function a6(e,r,t){let i=[];for(let a=0;at[2]){let a=i*.5,o=e[0]-t[0]>a?-i:t[0]-e[0]>a?i:0;o===0&&(o=e[0]-t[2]>a?-i:t[2]-e[0]>a?i:0),e[0]+=o}H1(r,e)}function XJ(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function U9(e,r,t,i){let a=2**i.z*Qh,o=[i.x*Qh,i.y*Qh],s=[];for(let l of e)for(let n of l){let u=[n.x+o[0],n.y+o[1]];j9(u,r,t,a),s.push(u)}return s}function q9(e,r,t,i){let a=2**i.z*Qh,o=[i.x*Qh,i.y*Qh],s=[];for(let l of e){let n=[];for(let u of l){let c=[u.x+o[0],u.y+o[1]];H1(r,c),n.push(c)}s.push(n)}if(r[2]-r[0]<=a/2){XJ(r);for(let l of s)for(let n of l)j9(n,r,t,a)}return s}function ZJ(e,r){let t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],a=e.canonicalID();if(r.type==="Polygon"){let o=a6(r.coordinates,i,a),s=U9(e.geometry(),t,i,a);if(!$1(t,i))return!1;for(let l of s)if(!rm(l,o))return!1}if(r.type==="MultiPolygon"){let o=N9(r.coordinates,i,a),s=U9(e.geometry(),t,i,a);if(!$1(t,i))return!1;for(let l of s)if(!$J(l,o))return!1}return!0}function KJ(e,r){let t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],a=e.canonicalID();if(r.type==="Polygon"){let o=a6(r.coordinates,i,a),s=q9(e.geometry(),t,i,a);if(!$1(t,i))return!1;for(let l of s)if(!B9(l,o))return!1}if(r.type==="MultiPolygon"){let o=N9(r.coordinates,i,a),s=q9(e.geometry(),t,i,a);if(!$1(t,i))return!1;for(let l of s)if(!WJ(l,o))return!1}return!0}function V9(e,r){return r[0]-e[0]}function O_(e){return e[1]-e[0]+1}function op(e,r){return e[1]>=e[0]&&e[1]e[1])return[null,null];let t=O_(e);if(r){if(t===2)return[e,null];let a=Math.floor(t/2);return[[e[0],e[0]+a],[e[0]+a,e[1]]]}if(t===1)return[e,null];let i=Math.floor(t/2)-1;return[[e[0],e[0]+i],[e[0]+i+1,e[1]]]}function o6(e,r){if(!op(r,e.length))return[1/0,1/0,-1/0,-1/0];let t=[1/0,1/0,-1/0,-1/0];for(let i=r[0];i<=r[1];++i)H1(t,e[i]);return t}function s6(e){let r=[1/0,1/0,-1/0,-1/0];for(let t of e)for(let i of t)H1(r,i);return r}function G9(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function l6(e,r,t){if(!G9(e)||!G9(r))return NaN;let i=0,a=0;return e[2]r[2]&&(i=e[0]-r[2]),e[1]>r[3]&&(a=e[1]-r[3]),e[3]=i)return i;if($1(a,o)){if(H9(e,r))return 0}else if(H9(r,e))return 0;let s=1/0;for(let l of e)for(let n=0,u=l.length,c=u-1;n0;){let n=s.pop();if(n[0]>=o)continue;let u=n[1],c=r?50:100;if(O_(u)<=c){if(!op(u,e.length))return NaN;if(r){let f=tQ(e,u,t,i);if(isNaN(f)||f===0)return f;o=Math.min(o,f)}else for(let f=u[0];f<=u[1];++f){let h=eQ(e[f],t,i);if(o=Math.min(o,h),o===0)return 0}}else{let f=n6(u,r);$9(s,o,i,e,l,f[0]),$9(s,o,i,e,l,f[1])}}return o}function U_(e,r,t,i,a,o=1/0){let s=Math.min(o,a.distance(e[0],t[0]));if(s===0)return s;let l=new ST([[0,[0,e.length-1],[0,t.length-1]]],V9);for(;l.length>0;){let n=l.pop();if(n[0]>=s)continue;let u=n[1],c=n[2],f=r?50:100,h=i?50:100;if(O_(u)<=f&&O_(c)<=h){if(!op(u,e.length)&&op(c,t.length))return NaN;let d;if(r&&i)d=JJ(e,u,t,c,a),s=Math.min(s,d);else if(r&&!i){let p=e.slice(u[0],u[1]+1);for(let g=c[0];g<=c[1];++g)if(d=z0(t[g],p,a),s=Math.min(s,d),s===0)return s}else if(!r&&i){let p=t.slice(c[0],c[1]+1);for(let g=u[0];g<=u[1];++g)if(d=z0(e[g],p,a),s=Math.min(s,d),s===0)return s}else d=QJ(e,u,t,c,a),s=Math.min(s,d)}else{let d=n6(u,r),p=n6(c,i);N_(l,s,a,e,t,d[0],p[0]),N_(l,s,a,e,t,d[0],p[1]),N_(l,s,a,e,t,d[1],p[0]),N_(l,s,a,e,t,d[1],p[1])}}return s}function iQ(e,r){let t=e.geometry(),i=t.flat().map(s=>i6([s.x,s.y],e.canonical));if(t.length===0)return NaN;let a=new Ix(i[0][1]),o=1/0;for(let s of r){switch(s.type){case"Point":o=Math.min(o,U_(i,!1,[s.coordinates],!1,a,o));break;case"LineString":o=Math.min(o,U_(i,!1,s.coordinates,!0,a,o));break;case"Polygon":o=Math.min(o,j_(i,!1,s.coordinates,a,o))}if(o===0)return o}return o}function aQ(e,r){let t=e.geometry(),i=t.flat().map(s=>i6([s.x,s.y],e.canonical));if(t.length===0)return NaN;let a=new Ix(i[0][1]),o=1/0;for(let s of r){switch(s.type){case"Point":o=Math.min(o,U_(i,!0,[s.coordinates],!1,a,o));break;case"LineString":o=Math.min(o,U_(i,!0,s.coordinates,!0,a,o));break;case"Polygon":o=Math.min(o,j_(i,!0,s.coordinates,a,o))}if(o===0)return o}return o}function nQ(e,r){let t=e.geometry();if(t.length===0||t[0].length===0)return NaN;let i=z_(t,0).map(s=>s.map(l=>l.map(n=>i6([n.x,n.y],e.canonical)))),a=new Ix(i[0][0][0][1]),o=1/0;for(let s of r)for(let l of i){switch(s.type){case"Point":o=Math.min(o,j_([s.coordinates],!1,l,a,o));break;case"LineString":o=Math.min(o,j_(s.coordinates,!0,l,a,o));break;case"Polygon":o=Math.min(o,rQ(l,s.coordinates,a,o))}if(o===0)return o}return o}function c6(e){return e.type==="MultiPolygon"?e.coordinates.map(r=>({type:"Polygon",coordinates:r})):e.type==="MultiLineString"?e.coordinates.map(r=>({type:"LineString",coordinates:r})):e.type==="MultiPoint"?e.coordinates.map(r=>({type:"Point",coordinates:r})):[e]}function W9(e,[r,t,i,a],o){r=r.evaluate(e),t=t.evaluate(e),i=i.evaluate(e);let s=a?a.evaluate(e):1,l=P9(r,t,i,s);if(l)throw new Xs(l,o);return new ro(r/255,t/255,i/255,s,!1)}function Y9(e,r){return e in r&&r[e]!==void 0}function f6(e,r){let t=r[e];return t===void 0?null:t}function oQ(e,r,t,i){for(;t<=i;){let a=t+i>>1;if(r[a]===e)return!0;r[a]>e?i=a-1:t=a+1}return!1}function B0(e){return{type:e}}function sQ(e){return Array.isArray(e)?`(${e.map(ll).join(", ")})`:`(${ll(e.type)}...)`}function q_(e){if(e instanceof TT)return q_(e.boundExpression);if(e instanceof Xp&&e.name==="error"||e instanceof MT||e instanceof Px||e instanceof Rx||e instanceof zx)return!1;let r=e instanceof W0||e instanceof Cd,t=!0;return e.eachChild(i=>{t&&(t=r?q_(i):i instanceof $0)}),t?V_(e)&&G_(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function V_(e){if(e instanceof Xp&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof Px||e instanceof Rx)return!1;let r=!0;return e.eachChild(t=>{r&&!V_(t)&&(r=!1)}),r}function W1(e){if(e instanceof Xp&&e.name==="feature-state")return!1;let r=!0;return e.eachChild(t=>{r&&!W1(t)&&(r=!1)}),r}function G_(e,r){if(e instanceof Xp&&r.indexOf(e.name)>=0)return!1;let t=!0;return e.eachChild(i=>{t&&!G_(i,r)&&(t=!1)}),t}function im(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function X9(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function h6(e){return!!e.expression&&e.expression.interpolated}function Y1(e,...r){for(let t of r)for(let i in t)e[i]=t[i];return e}function bo(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function H_(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&Ml(e)===Yp}function lQ(e){return e}function uQ(e){switch(e.type){case"color":return ro.parse;case"padding":return Xh.parse;case"numberArray":return Zh.parse;case"colorArray":return If.parse;default:return null}}function cQ(e){switch(e){case"exponential":return K9;case"interval":return hQ;case"categorical":return fQ;case"identity":return dQ;default:throw Error(`Unknown function type "${e}"`)}}function Z9(e,r){let t=e.stops&&typeof e.stops[0][0]=="object",i=t||e.property!==void 0,a=t||!i,o=e.type||(h6(r)?"exponential":"interval"),s=uQ(r);if(s&&(e=Y1({},e),e.stops&&(e.stops=e.stops.map(c=>[c[0],s(c[1])])),e.default?e.default=s(e.default):e.default=s(r.default)),e.colorSpace&&!wJ(e.colorSpace))throw Error(`Unknown color space: "${e.colorSpace}"`);let l=cQ(o),n,u;if(o==="categorical"){n=Object.create(null);for(let c of e.stops)n[c[0]]=c[1];u=typeof e.stops[0][0]}if(t){let c={},f=[];for(let p=0;pp[0]),evaluate({zoom:p},g){return K9({stops:h,base:e.base},r,p).evaluate(p,g)}}}if(a){let c=o==="exponential"?{name:"exponential",base:e.base===void 0?1:e.base}:null;return{kind:"camera",interpolationType:c,interpolationFactor:Rf.interpolationFactor.bind(void 0,c),zoomStops:e.stops.map(f=>f[0]),evaluate:({zoom:f})=>l(e,r,f,n,u)}}return{kind:"source",evaluate(c,f){let h=f&&f.properties?f.properties[e.property]:void 0;return h===void 0?X1(e.default,r.default):l(e,r,h,n,u)}}}function X1(e,r,t){if(e!==void 0)return e;if(r!==void 0)return r;if(t!==void 0)return t}function fQ(e,r,t,i,a){return X1(typeof t===a?i[t]:void 0,e.default,r.default)}function hQ(e,r,t){if(bo(t)!=="number")return X1(e.default,r.default);let i=e.stops.length;if(i===1||t<=e.stops[0][0])return e.stops[0][1];if(t>=e.stops[i-1][0])return e.stops[i-1][1];let a=R_(e.stops.map(o=>o[0]),t,"");return e.stops[a][1]}function K9(e,r,t){let i=e.base===void 0?1:e.base;if(bo(t)!=="number")return X1(e.default,r.default);let a=e.stops.length;if(a===1||t<=e.stops[0][0])return e.stops[0][1];if(t>=e.stops[a-1][0])return e.stops[a-1][1];let o=R_(e.stops.map(c=>c[0]),t,""),s=pQ(t,i,e.stops[o][0],e.stops[o+1][0]),l=e.stops[o][1],n=e.stops[o+1][1],u=Zs[r.type]||lQ;return typeof l.evaluate=="function"?{evaluate(...c){let f=l.evaluate.apply(void 0,c),h=n.evaluate.apply(void 0,c);if(f!==void 0&&h!==void 0)return u(f,h,s,e.colorSpace)}}:u(l,n,s,e.colorSpace)}function dQ(e,r,t){switch(r.type){case"color":t=ro.parse(t);break;case"formatted":t=kd.fromString(t.toString());break;case"resolvedImage":t=Jh.fromString(t.toString());break;case"padding":t=Xh.parse(t);break;case"colorArray":t=If.parse(t);break;case"numberArray":t=Zh.parse(t);break;default:bo(t)!==r.type&&(r.type!=="enum"||!r.values[t])&&(t=void 0)}return X1(t,e.default,r.default)}function pQ(e,r,t,i){let a=i-t,o=e-t;return a===0?0:r===1?o/a:(r**+o-1)/(r**+a-1)}function d6(e){return{result:"success",value:e}}function am(e){return{result:"error",value:e}}function J9(e,r,t,i){return`${e}${r}: ${t}${i==null?"":` Falling back to ${String(i)}.`}`}function Q9(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function $_(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in Y0}function W_(e,r,t,i){Q9(r);let a=new kT(Y0,q_,[],t?gQ(t):void 0),o=a.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?d6(new Ox(o,r,t,i)):am(a.errors)}function vQ(e){return e._styleExpression!==void 0}function eL(e,r,t,i){let a=W_(e,r,t,i);if(a.result==="error")return a;let o=a.value.expression,s=V_(o);if(!s&&!im(t))return am([new ed("","data expressions not supported")]);let l=G_(o,["zoom"]);if(!l&&!X9(t))return am([new ed("","zoom expressions not supported")]);let n=Y_(o);if(!n&&!l)return am([new ed("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(n instanceof ed)return am([n]);if(n instanceof Rf&&!h6(t))return am([new ed("",'"interpolate" expressions cannot be used with this property')]);if(!n)return d6(s?new wm("constant",a.value,i):new wm("source",a.value,i));let u=n instanceof Rf?n.interpolation:void 0;return d6(s?new Tg("camera",a.value,n.labels,u,i):new Tg("composite",a.value,n.labels,u,i))}function mQ(e,r,t,i){if(H_(e))return new CT(e,r,t);if($_(e)){let a=eL(e,r,t,i);if(a.result==="error")throw Error(a.value.map(o=>`${o.key}: ${o.message}`).join(", "));return a.value}{let a=e;return t.type==="color"&&typeof e=="string"?a=ro.parse(e):t.type==="padding"&&(typeof e=="number"||Array.isArray(e))?a=Xh.parse(e):t.type==="numberArray"&&(typeof e=="number"||Array.isArray(e))?a=Zh.parse(e):t.type==="colorArray"&&(typeof e=="string"||Array.isArray(e))?a=If.parse(e):t.type==="variableAnchorOffsetCollection"&&Array.isArray(e)?a=Kh.parse(e):t.type==="projectionDefinition"&&typeof e=="string"&&(a=sp.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>a}}}function Y_(e){let r=null;if(e instanceof wT)r=Y_(e.result);else if(e instanceof AT){for(let t of e.args)if(r=Y_(t),r)break}else(e instanceof Fx||e instanceof Rf)&&e.input instanceof Xp&&e.input.name==="zoom"&&(r=e);return r instanceof ed||e.eachChild(t=>{let i=Y_(t);i instanceof ed?r=i:!r&&i?r=new ed("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new ed("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}function Z1(e,r=new Set){return e instanceof zx&&r.add(e.key),e.eachChild(t=>{Z1(t,r)}),r}function gQ(e){let r={color:ph,string:so,number:Ra,enum:so,boolean:Ao,formatted:_m,padding:_g,numberArray:xg,colorArray:xm,projectionDefinition:gg,resolvedImage:bm,variableAnchorOffsetCollection:bg};return e.type==="array"?pc(r[e.value]||co,e.length):r[e.type]}function tL(e){if(e.type==="color"&&H_(e.default))return new ro(0,0,0,0);switch(e.type){case"color":return ro.parse(e.default)||null;case"padding":return Xh.parse(e.default)||null;case"numberArray":return Zh.parse(e.default)||null;case"colorArray":return If.parse(e.default)||null;case"variableAnchorOffsetCollection":return Kh.parse(e.default)||null;case"projectionDefinition":return sp.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function nm(e,r){let{zoom:t,heatmapDensity:i,elevation:a,lineProgress:o,isSupportedScript:s,accumulated:l}=e??{};return{zoom:t,heatmapDensity:i,elevation:a,lineProgress:o,isSupportedScript:s,accumulated:l,globalState:r}}function yQ(e){let r=!1;for(let t of e){let i=rL(t);if(i==="expression")return"expression";i==="legacy"&&(r=!0)}return r?"legacy":"neutral"}function rL(e){if(typeof e=="boolean")return"neutral";if(!Array.isArray(e)||e.length===0)return"legacy";switch(e[0]){case"has":return e.length<2||e[1]==="$id"||e[1]==="$type"?"legacy":e.length===2?"neutral":"expression";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return yQ(e.slice(1));default:return"expression"}}function p6(e){return rL(e)!=="legacy"}function iL(e){return e==="$type"?["geometry-type"]:e==="$id"?["id"]:["get",e]}function _Q(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return e.length!==3||typeof e[1]!="string"?null:[e[0],iL(e[1]),e[2]];case"in":case"!in":{if(e.length<2||typeof e[1]!="string")return null;let r=["in",iL(e[1]),["literal",e.slice(2)]];return e[0]==="!in"?["!",r]:r}case"has":case"!has":{if(e.length!==2||typeof e[1]!="string"||e[1]==="$type"||e[1]==="$id")return null;let r=["has",e[1]];return e[0]==="!has"?["!",r]:r}default:return null}}function aL(e){if((e[0]==="<"||e[0]==="<="||e[0]===">"||e[0]===">=")&&e[1]==="$type")return`"$type" cannot be use with operator "${e[0]}"`;let r=_Q(e);return r?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(r)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function v6(e,r,t){let i=t[e];return Array.isArray(i)?p6(i)?m6(i,r.concat(e)):{path:r.concat(e),legacyFilter:i}:null}function m6(e,r=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let t=1;t"u")return;let i=t.path.map(a=>`[${a}]`).join("");console.warn(`${r}${i}: ${aL(t.legacyFilter)}`)}function K1(e,r,t){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};p6(e)?xQ(e,r):e=X_(e);let i=W_(e,r,eI,t);if(i.result==="error")throw Error(i.value.map(a=>`${a.key}: ${a.message}`).join(", "));return{filter:(a,o,s)=>i.value.evaluate(a,o,{},s),needGeometry:nL(e),getGlobalStateRefs:()=>Z1(i.value.expression)}}function bQ(e,r){return er)}function nL(e){if(!Array.isArray(e))return!1;if(e[0]==="within"||e[0]==="distance")return!0;for(let r=1;r"||r==="<="||r===">="?g6(e[1],e[2],r):r==="any"?wQ(e.slice(1)):r==="all"?["all"].concat(e.slice(1).map(X_)):r==="none"?["all"].concat(e.slice(1).map(X_).map(Z_)):r==="in"?oL(e[1],e.slice(2)):r==="!in"?Z_(oL(e[1],e.slice(2))):r==="has"?sL(e[1]):r!=="!has"||Z_(sL(e[1]))}function g6(e,r,t){switch(e){case"$type":return[`filter-type-${t}`,r];case"$id":return[`filter-id-${t}`,r];default:return[`filter-${t}`,e,r]}}function wQ(e){return["any"].concat(e.map(X_))}function oL(e,r){if(r.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(t=>typeof t!=typeof r[0])?["filter-in-large",e,["literal",r.sort(bQ)]]:["filter-in-small",e,["literal",r]]}}function sL(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Z_(e){return["!",e]}function lL(e){let r=e.key,t=e.value;return t?[new na(r,t,"constants have been deprecated as of v8")]:[]}function Sl(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function O0(e){if(Array.isArray(e))return e.map(O0);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let r={};for(let t in e)r[t]=O0(e[t]);return r}return Sl(e)}function Ff(e){let r=e.key,t=e.value,i=e.valueSpec||{},a=e.objectElementValidators||{},o=e.style,s=e.styleSpec,l=e.validateSpec,n=[],u=bo(t);if(u!=="object")return[new na(r,t,`object expected, ${u} found`)];for(let c in t){let f=c.split(".")[0],h=q1(i,f)||i["*"],d;if(q1(a,f))d=a[f];else if(q1(i,f)){if(t[c]===void 0)continue;d=l}else if(a["*"])d=a["*"];else if(i["*"])d=l;else{n.push(new na(r,t[c],`unknown property "${c}"`));continue}n=n.concat(d({key:(r&&`${r}.`)+c,value:t[c],valueSpec:h,style:o,styleSpec:s,object:t,objectKey:c,validateSpec:l},t))}for(let c in i)a[c]||i[c].required&&i[c].default===void 0&&t[c]===void 0&&n.push(new na(r,t,`missing required property "${c}"`));return n}function y6(e){let r=e.value,t=e.valueSpec,i=e.validateSpec,a=e.style,o=e.styleSpec,s=e.key,l=e.arrayElementValidator||i;if(bo(r)!=="array")return[new na(s,r,`array expected, ${bo(r)} found`)];if(t.length&&r.length!==t.length)return[new na(s,r,`array length ${t.length} expected, length ${r.length} found`)];let n={type:t.value,values:t.values};o.$version<7&&(n.function=t.function),bo(t.value)==="object"&&(n=t.value);let u=[];for(let c=0;ci.maximum?[new na(r,t,`${t} is greater than the maximum value ${i.maximum}`)]:[]:[new na(r,t,`number expected, ${a} found`)]}function uL(e){let r=e.valueSpec,t=Sl(e.value.type),i,a={},o,s,l=t!=="categorical"&&e.value.property===void 0,n=!l,u=bo(e.value.stops)==="array"&&bo(e.value.stops[0])==="array"&&bo(e.value.stops[0][0])==="object",c=Ff({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:f,default:p}});return t==="identity"&&l&&c.push(new na(e.key,e.value,'missing required property "property"')),t!=="identity"&&!e.value.stops&&c.push(new na(e.key,e.value,'missing required property "stops"')),t==="exponential"&&e.valueSpec.expression&&!h6(e.valueSpec)&&c.push(new na(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(n&&!im(e.valueSpec)?c.push(new na(e.key,e.value,"property functions not supported")):l&&!X9(e.valueSpec)&&c.push(new na(e.key,e.value,"zoom functions not supported"))),(t==="categorical"||u)&&e.value.property===void 0&&c.push(new na(e.key,e.value,'"property" property is required')),c;function f(g){if(t==="identity")return[new na(g.key,g.value,'identity function may not have a "stops" property')];let m=[],y=g.value;return m=m.concat(y6({key:g.key,value:y,valueSpec:g.valueSpec,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec,arrayElementValidator:h})),bo(y)==="array"&&y.length===0&&m.push(new na(g.key,y,"array must have at least one stop")),m}function h(g){let m=[],y=g.value,_=g.key;if(bo(y)!=="array")return[new na(_,y,`array expected, ${bo(y)} found`)];if(y.length!==2)return[new na(_,y,`array length 2 expected, length ${y.length} found`)];if(u){if(bo(y[0])!=="object")return[new na(_,y,`object expected, ${bo(y[0])} found`)];if(y[0].zoom===void 0)return[new na(_,y,"object stop key must have zoom")];if(y[0].value===void 0)return[new na(_,y,"object stop key must have value")];if(s&&s>Sl(y[0].zoom))return[new na(_,y[0].zoom,"stop zoom values must appear in ascending order")];Sl(y[0].zoom)!==s&&(s=Sl(y[0].zoom),o=void 0,a={}),m=m.concat(Ff({key:`${_}[0]`,value:y[0],valueSpec:{zoom:{}},validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec,objectElementValidators:{zoom:K_,value:d}}))}else m=m.concat(d({key:`${_}[0]`,value:y[0],valueSpec:{},validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec},y));return $_(O0(y[1]))?m.concat([new na(`${_}[1]`,y[1],"expressions are not allowed in function stops.")]):m.concat(g.validateSpec({key:`${_}[1]`,value:y[1],valueSpec:r,validateSpec:g.validateSpec,style:g.style,styleSpec:g.styleSpec}))}function d(g,m){let y=bo(g.value),_=Sl(g.value),v=g.value===null?m:g.value;if(!i)i=y;else if(y!==i)return[new na(g.key,v,`${y} stop domain type must match previous stop domain type ${i}`)];if(y!=="number"&&y!=="string"&&y!=="boolean")return[new na(g.key,v,"stop domain value must be a number, string, or boolean")];if(y!=="number"&&t!=="categorical"){let x=`number expected, ${y} found`;return im(r)&&t===void 0&&(x+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new na(g.key,v,x)]}return t==="categorical"&&y==="number"&&(!isFinite(_)||Math.floor(_)!==_)?[new na(g.key,v,`integer expected, found ${_}`)]:t!=="categorical"&&y==="number"&&o!==void 0&&_new na(`${e.key}${i.key}`,e.value,i.message));let t=r.value.expression||r.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!t.outputDefined())return[new na(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!W1(t))return[new na(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!W1(t))return[new na(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!G_(t,["zoom","feature-state"]))return[new na(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!V_(t))return[new na(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function TQ(e){let r=e.value,t=e.key,i=bo(r);return i==="boolean"?[]:[new na(t,r,`boolean expected, ${i} found`)]}function _6(e){let r=e.key,t=e.value,i=bo(t);return i==="string"?ro.parse(String(t))?[]:[new na(r,t,`color expected, "${t}" found`)]:[new na(r,t,`color expected, ${i} found`)]}function J1(e){let r=e.key,t=e.value,i=e.valueSpec,a=[];return Array.isArray(i.values)?i.values.indexOf(Sl(t))===-1&&a.push(new na(r,t,`expected one of [${i.values.join(", ")}], ${JSON.stringify(t)} found`)):Object.keys(i.values).indexOf(Sl(t))===-1&&a.push(new na(r,t,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(t)} found`)),a}function AQ(e,r){let t=e;for(let i of r)t=t[i];return t}function MQ(e,r){let t=m6(r);return t?[new na(`${e.key}${t.path.map(i=>`[${i}]`).join("")}`,AQ(e.value,t.path),aL(t.legacyFilter),null,"warning")]:[]}function x6(e){let r=O0(e.value);return p6(r)?[...MQ(e,r),...om(Y1({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:cL(e)}function cL(e){let r=e.value,t=e.key;if(bo(r)!=="array")return[new na(t,r,`array expected, ${bo(r)} found`)];let i=e.styleSpec,a,o=[];if(r.length<1)return[new na(t,r,"filter array must have at least 1 element")];switch(o=o.concat(J1({key:`${t}[0]`,value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Sl(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&Sl(r[1])==="$type"&&o.push(new na(t,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":r.length!==3&&o.push(new na(t,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&(a=bo(r[1]),a!=="string"&&o.push(new na(`${t}[1]`,r[1],`string expected, ${a} found`)));for(let s=2;s{f in a&&i.push(new na(o,a[f],`"${f}" is prohibited for ref layers`))});let c;s.layers.forEach(f=>{Sl(f.id)===u&&(c=f)}),c?c.ref?i.push(new na(o,a.ref,"ref cannot reference another ref layer")):n=Sl(c.type):i.push(new na(o,a.ref,`ref layer "${u}" not found`))}else if(n!=="background")if(!a.source)i.push(new na(o,a,'missing required property "source"'));else{let c=s.sources&&s.sources[a.source],f=c&&Sl(c.type);c?f==="vector"&&n==="raster"?i.push(new na(o,a.source,`layer "${a.id}" requires a raster source`)):f!=="raster-dem"&&n==="hillshade"||f!=="raster-dem"&&n==="color-relief"?i.push(new na(o,a.source,`layer "${a.id}" requires a raster-dem source`)):f==="raster"&&n!=="raster"?i.push(new na(o,a.source,`layer "${a.id}" requires a vector source`)):f==="vector"&&!a["source-layer"]?i.push(new na(o,a,`layer "${a.id}" must specify a "source-layer"`)):f==="raster-dem"&&n!=="hillshade"&&n!=="color-relief"?i.push(new na(o,a.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):n==="line"&&a.paint&&a.paint["line-gradient"]&&(f!=="geojson"||!c.lineMetrics)&&i.push(new na(o,a,`layer "${a.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new na(o,a.source,`source "${a.source}" not found`))}return n==="raster"&&((r=a.paint)!=null&&r.resampling)&&((t=a.paint)!=null&&t["raster-resampling"])&&i.push(new na(o,a.paint,`layer "${a.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),i=i.concat(Ff({key:o,value:a,valueSpec:l.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${o}.type`,value:a.type,valueSpec:l.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:a,objectKey:"type"})},filter:x6,layout(c){return Ff({layer:a,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*"(f){return dL(Y1({layerType:n},f))}}})},paint(c){return Ff({layer:a,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,validateSpec:c.validateSpec,objectElementValidators:{"*"(f){return hL(Y1({layerType:n},f))}}})}}})),i}function Gp(e){let r=e.value,t=e.key,i=bo(r);return i==="string"?[]:[new na(t,r,`string expected, ${i} found`)]}function SQ(e){var r;let t=(r=e.sourceName)!=null?r:"",i=e.value,a=e.styleSpec,o=a.source_raster_dem,s=e.style,l=[],n=bo(i);if(i===void 0)return l;if(n!=="object")return l.push(new na("source_raster_dem",i,`object expected, ${n} found`)),l;let u=Sl(i.encoding)==="custom",c=["redFactor","greenFactor","blueFactor","baseShift"],f=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let h in i)!u&&c.includes(h)?l.push(new na(h,i[h],`In "${t}": "${h}" is only valid when "encoding" is set to "custom". ${f} encoding found`)):o[h]?l=l.concat(e.validateSpec({key:h,value:i[h],valueSpec:o[h],validateSpec:e.validateSpec,style:s,styleSpec:a})):l.push(new na(h,i[h],`unknown property "${h}"`));return l}function vL(e){let r=e.value,t=e.key,i=e.styleSpec,a=e.style,o=e.validateSpec;if(!r.type)return[new na(t,r,'"type" is required')];let s=Sl(r.type),l;switch(s){case"vector":case"raster":return l=Ff({key:t,value:r,valueSpec:i[`source_${s.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:DT,validateSpec:o}),l;case"raster-dem":return l=SQ({sourceName:t,value:r,style:e.style,styleSpec:i,validateSpec:o}),l;case"geojson":if(l=Ff({key:t,value:r,valueSpec:i.source_geojson,style:a,styleSpec:i,validateSpec:o,objectElementValidators:DT}),r.cluster)for(let n in r.clusterProperties){let[u,c]=r.clusterProperties[n],f=typeof u=="string"?[u,["accumulated"],["get",n]]:u;l.push(...om({key:`${t}.${n}.map`,value:c,validateSpec:o,expressionContext:"cluster-map"})),l.push(...om({key:`${t}.${n}.reduce`,value:f,validateSpec:o,expressionContext:"cluster-reduce"}))}return l;case"video":return Ff({key:t,value:r,valueSpec:i.source_video,style:a,validateSpec:o,styleSpec:i});case"image":return Ff({key:t,value:r,valueSpec:i.source_image,style:a,validateSpec:o,styleSpec:i});case"canvas":return[new na(t,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return J1({key:`${t}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,validateSpec:o,styleSpec:i})}}function EQ({key:e,value:r}){if(bo(r)==="string")return Gp({key:e,value:r});{let t=[];for(let i in r)t.push(...Gp({key:`${e}.${i}`,value:r[i]}));return t}}function mL(e){let r=e.value,t=e.styleSpec,i=t.light,a=e.style,o=[],s=bo(r);if(r===void 0)return o;if(s!=="object")return o=o.concat([new na("light",r,`object expected, ${s} found`)]),o;for(let l in r){let n=l.match(Bx);o=n&&i[n[1]]&&i[n[1]].transition?o.concat(e.validateSpec({key:l,value:r[l],valueSpec:t.transition,validateSpec:e.validateSpec,style:a,styleSpec:t})):i[l]?o.concat(e.validateSpec({key:l,value:r[l],valueSpec:i[l],validateSpec:e.validateSpec,style:a,styleSpec:t})):o.concat([new na(l,r[l],`unknown property "${l}"`)])}return o}function gL(e){let r=e.value,t=e.styleSpec,i=t.sky,a=e.style,o=bo(r);if(r===void 0)return[];if(o!=="object")return[new na("sky",r,`object expected, ${o} found`)];let s=[];for(let l in r){let n=l.match(Bx);s=n&&i[n[1]]&&i[n[1]].transition?s.concat(e.validateSpec({key:l,value:r[l],valueSpec:t.transition,style:a,styleSpec:t})):i[l]?s.concat(e.validateSpec({key:l,value:r[l],valueSpec:i[l],style:a,styleSpec:t})):s.concat([new na(l,r[l],`unknown property "${l}"`)])}return s}function yL(e){let r=e.value,t=e.styleSpec,i=t.terrain,a=e.style,o=[],s=bo(r);if(r===void 0)return o;if(s!=="object")return o=o.concat([new na("terrain",r,`object expected, ${s} found`)]),o;for(let l in r)o=i[l]?o.concat(e.validateSpec({key:l,value:r[l],valueSpec:i[l],validateSpec:e.validateSpec,style:a,styleSpec:t})):o.concat([new na(l,r[l],`unknown property "${l}"`)]);return o}function kQ(e){return Gp(e).length===0?[]:om(e)}function CQ(e){return Gp(e).length===0?[]:om(e)}function DQ(e){let r=e.key,t=e.value;if(bo(t)==="array"){if(t.length<1||t.length>4)return[new na(r,t,`padding requires 1 to 4 values; ${t.length} values found`)];let i={type:"number"},a=[];for(let o=0;o[new na(e,r,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],a=t.match(tI);if(!a)return i();let[,o,s,l]=a;if(l!==void 0)return l.length>6?i():[];let n=parseInt(o,16),u=s===void 0?n:parseInt(s,16);return n>LT||u>LT?[new na(e,r,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:n>u?[new na(e,r,`unicode range start must not be greater than its end, but ${t} is`)]:[]}function bL(e){var r,t;let i=(r=e.key)!=null?r:"font-faces",a=e.value,o=e.validateSpec,s=(t=e.styleSpec)!=null?t:pT,l=e.style;if(!b6(a))return[new na(i,a,`object expected, ${bo(a)} found`)];let n=[];for(let u in a){let c=a[u],f=bo(c);if(f==="string")n.push(...Gp({key:`${i}.${u}`,value:c}));else if(f==="array"){let h={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[d,p]of c.entries()){let g=`${i}.${u}[${d}]`;n.push(...Ff({key:g,value:p,valueSpec:h,styleSpec:s,style:l,validateSpec:o}));let m=b6(p)?p["unicode-range"]:void 0;if(bo(m)==="array")for(let[y,_]of m.entries())n.push(...OQ(`${g}.unicode-range[${y}]`,_))}}else n.push(new na(`${i}.${u}`,c,`string or array expected, ${f} found`))}return n}function Q1(e){let r=e.value,t=e.valueSpec,i=e.styleSpec;return e.validateSpec=Q1,t.expression&&H_(Sl(r))?uL(e):t.expression&&$_(O0(r))?om(e):t.type&&FT[t.type]?FT[t.type](e):Ff(Y1({},e,{valueSpec:t.type?i[t.type]:t}))}function wL(e){let r=e.value,t=e.key,i=Gp(e);return i.length||(r.indexOf("{fontstack}")===-1&&i.push(new na(t,r,'"glyphs" url must include a "{fontstack}" token')),r.indexOf("{range}")===-1&&i.push(new na(t,r,'"glyphs" url must include a "{range}" token'))),i}function Pf(e,r=mi){let t=[];return t=t.concat(Q1({key:"",value:e,valueSpec:r.$root,styleSpec:r,style:e,validateSpec:Q1,objectElementValidators:{glyphs:wL,"*"(){return[]}}})),e.constants&&(t=t.concat(lL({key:"constants",value:e.constants,style:e,styleSpec:r,validateSpec:Q1}))),TL(t)}function hh(e){return function(r){return e(Object.assign({},r,{validateSpec:Q1}))}}function TL(e){return[].concat(e).sort((r,t)=>r.line-t.line)}function dh(e){return function(...r){return TL(e.apply(this,r))}}function NQ(e,r,t){return new iI(e,r,t)}function jQ(e){var r;return Object.entries((r=e.sources)!=null?r:{}).filter(([,t])=>!PT.has(t.type)).map(([t])=>`sources.${t}`)}function AL(e,r){let t=jQ(r);return w6(e,Hc(r).filter(({message:i})=>!t.some(a=>i.startsWith(`${a}:`)||i.startsWith(`${a}.`))))}function w6(e,r){let t=!1;for(let i of r){if(i.severity==="warning"){To(i.message);continue}e.fire(new Ln(Error(i.message))),t=!0}return t}function eg(e,r,t,i){return i?.validate!==!1&&w6(e,r(Nt({styleSpec:mi},t)))}function Qa(e,r,t={}){if(Dd[e])throw Error(`${e} is already registered.`);Object.defineProperty(r,"_classRegistryKey",{value:e,writeable:!1}),Dd[e]={klass:r,omit:t.omit||[],shallow:t.shallow||[]}}function ML(e){var r;return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||((r=e.constructor)==null?void 0:r.name)==="ArrayBuffer")}function T6(e){let r=e.constructor;return e.$name||r._classRegistryKey}function UQ(e){if(typeof e!="object"||!e)return!1;let r=T6(e);return r&&r!=="Object"}function SL(e){return!UQ(e)&&(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||ML(e)||I0(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function tg(e,r){if(SL(e))return(ML(e)||I0(e))&&r&&r.push(e),ArrayBuffer.isView(e)&&r&&r.push(e.buffer),e instanceof ImageData&&r&&r.push(e.data.buffer),e;if(Array.isArray(e)){let o=[];for(let s of e)o.push(tg(s,r));return o}if(typeof e!="object")throw Error(`can't serialize object of type ${typeof e}`);let t=T6(e);if(!t)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!Dd[t])throw Error(`${t} is not registered.`);let{klass:i}=Dd[t],a=i.serialize?i.serialize(e,r):{};if(i.serialize){if(a===r?.[r.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let o in e){if(!e.hasOwnProperty(o)||Dd[t].omit.includes(o))continue;let s=e[o];s!==void 0&&(a[o]=Dd[t].shallow.includes(o)?s:tg(s,r))}e instanceof Error&&(a.message=e.message)}if(a.$name)throw Error("$name property is reserved for worker serialization logic.");return t!=="Object"&&(a.$name=t),a}function rg(e){if(SL(e))return e;if(Array.isArray(e))return e.map(rg);if(typeof e!="object")throw Error(`can't deserialize object of type ${typeof e}`);let r=T6(e)||"Object";if(!Dd[r])throw Error(`can't deserialize unregistered class ${r}`);let{klass:t}=Dd[r];if(!t)throw Error(`can't deserialize unregistered class ${r}`);if(t.deserialize)return t.deserialize(e);let i=Object.create(t.prototype);for(let a of Object.keys(e)){if(a==="$name")continue;let o=e[a];i[a]=Dd[r].shallow.includes(a)?o:rg(o)}return i}function EL(e){if(Array.isArray(e))return e.length;let r=e?.values;return Array.isArray(r)?r.length:void 0}function kL(e,r){let t=EL(e),i=EL(r);return t!==void 0&&i!==void 0&&t!==i}function ul(e,r=1){let t=0,i=0;return{members:e.map(a=>{let o=qQ(a.type),s=t=CL(t,Math.max(r,o)),l=a.components||1;return i=Math.max(i,o),t+=o*l,{name:a.name,type:a.type,components:l,offset:s}}),size:CL(t,Math.max(i,r)),alignment:r}}function qQ(e){return uI[e].BYTES_PER_ELEMENT}function CL(e,r){return Math.ceil(e/r)*r}function DL(e,r){return e=to(Math.floor(e),0,255),r=to(Math.floor(r),0,255),256*e+r}function LL(e){let r=+e;return!isNaN(r)&&r<=9007199254740991?r:(0,hb.default)(String(e))}function A6(e,r,t,i){for(;t>1],o=t-1,s=i+1;for(;;){do o++;while(e[o]a);if(o>=s)break;J_(e,o,s),J_(r,3*o,3*s),J_(r,3*o+1,3*s+1),J_(r,3*o+2,3*s+2)}s-ta.x+1||sa.y+1)&&To("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return t}function j0(e,r){return{type:e.type,id:e.id,properties:e.properties,geometry:r?N0(e):[]}}function HQ(e,r,t,i,a){e.emplaceBack(nA+r*8+i,nA+t*8+a)}function PL(e,r){for(let t of e)if(sm(r,t))return!0;for(let t of r)if(sm(e,t))return!0;return S6(e,r)}function Q_(e,r,t){return sm(e,r)?!0:E6(r,e,t)}function IL(e,r){if(e.length===1)return zL(r,e[0]);for(let t of r)for(let i of t)if(sm(e,i))return!0;for(let t of e)if(zL(r,t))return!0;for(let t of r)if(S6(e,t))return!0;return!1}function $Q(e,r,t){for(let i of r){if(e.length>=3){for(let a of i)if(sm(e,a))return!0}if(WQ(e,i,t))return!0}return!1}function WQ(e,r,t){if(e.length>1){if(S6(e,r))return!0;for(let i of r)if(E6(i,e,t))return!0}for(let i of e)if(E6(i,r,t))return!0;return!1}function S6(e,r){if(e.length===0||r.length===0)return!1;for(let t=0;t1?e.distSqr(t):e.distSqr(t.sub(r)._mult(a)._add(r))}function zL(e,r){let t=!1,i,a,o;for(let s of e){i=s;for(let l=0,n=i.length-1;lr.y!=o.y>r.y&&r.x<(o.x-a.x)*(r.y-a.y)/(o.y-a.y)+a.x&&(t=!t)}return t}function sm(e,r){let t=!1;for(let i=0,a=e.length-1;ir.y!=s.y>r.y&&r.x<(s.x-o.x)*(r.y-o.y)/(s.y-o.y)+o.x&&(t=!t)}return t}function XQ(e,r,t,i,a){for(let s of e)if(r<=s.x&&t<=s.y&&i>=s.x&&a>=s.y)return!0;let o=[new Wr(r,t),new Wr(r,a),new Wr(i,a),new Wr(i,t)];if(e.length>2){for(let s of o)if(sm(e,s))return!0}for(let s=0;sa.x&&r.x>a.x||e.ya.y&&r.y>a.y)return!1;let o=jp(e,r,t[0]);return o!==jp(e,r,t[1])||o!==jp(e,r,t[2])||o!==jp(e,r,t[3])}function lm(e,r,t){let i=r.paint.get(e).value;return i.kind==="constant"?i.value:t.programConfigurations.get(r.id).getMaxValue(e)}function ex(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function tx(e,r,t,i,a){if(!r[0]&&!r[1])return e;let o=Wr.convert(r)._mult(a);t==="viewport"&&o._rotate(-i);let s=[];for(let l of e)s.push(l.sub(o));return s}function KQ(e){let r=[];for(let t=0;tk6(a,r,t,i))}function C6(e,{width:r,height:t},i,a){if(!a)a=new Uint8Array(r*t*i);else if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==r*t*i)throw RangeError(`mismatched image size. expected: ${a.length} but got: ${r*t*i}`);return e.width=r,e.height=t,e.data=a,e}function OL(e,{width:r,height:t},i){if(r===e.width&&t===e.height)return;let a=C6({},{width:r,height:t},i);D6(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,t)},i),e.width=r,e.height=t,e.data=a.data}function D6(e,r,t,i,a,o){if(a.width===0||a.height===0)return r;if(a.width>e.width||a.height>e.height||t.x>e.width-a.width||t.y>e.height-a.height)throw RangeError("out of range source coordinates for image copy");if(a.width>r.width||a.height>r.height||i.x>r.width-a.width||i.y>r.height-a.height)throw RangeError("out of range destination coordinates for image copy");let s=e.data,l=r.data;if(s===l)throw Error("srcData equals dstData, so image is already copied");for(let n=0;n{r[e.evaluationKey]=n;let u=e.expression.evaluate(r);a.setPixel(s/4/t,l/4,u)};if(e.clips)for(let s=0,l=0;s80*t){l=e[0],n=e[1];let c=l,f=n;for(let h=t;hc&&(c=d),p>f&&(f=p)}u=Math.max(c-l,f-n),u=u===0?0:32767/u}return P6(o,s,l,n,u),s}function UL(e,r,t,i,a){let o=null;if(a===wee(e,r,t,i)>0)for(let s=r;s=r;s-=i)o=WL(s/i|0,e[s],e[s+1],o);return o&&ig(o,o.next)&&(ng(o),o=o.next),o}function U0(e,r=e){let t=r===e,i=e,a;do a=!1,i!==i.next&&(Dm.size===0||!Dm.has(i))&&(ig(i,i.next)||Jl(i.prev,i,i.next)===0)?((t||i===r)&&(r=i.prev),gb=!0,ng(i),i=i.prev,a=!0):(t||i!==r)&&(i=i.next,a=!t);while(a||i!==r);return r}function P6(e,r,t,i,a){a&&mee(e,t,i,a);let o=e,s=!1;for(;e.prev!==e.next;){let l=e.prev,n=e.next;if(Jl(l,e,n)<0&&(a?oee(e,t,i,a):nee(e))){r.push(l.i,e.i,n.i),ng(e),e=n,o=n;continue}if(e=n,e===o){if(gb=!1,e=U0(e),gb){o=e;continue}if(!s){e=see(e,r),o=e,s=!0;continue}lee(e,r,t,i,a);break}}}function nee(e){let r=e.prev,t=e,i=e.next,a=r.x,o=t.x,s=i.x,l=r.y,n=t.y,u=i.y,c=Math.min(a,o,s),f=Math.min(l,n,u),h=Math.max(a,o,s),d=Math.max(l,n,u),p=i.next;for(;p!==r;){if(p.x>=c&&p.x<=h&&p.y>=f&&p.y<=d&&(a!==p.x||l!==p.y)&&nx(a,l,o,n,s,u,p.x,p.y)&&Jl(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function oee(e,r,t,i){let a=e.prev,o=e,s=e.next,l=a.x,n=o.x,u=s.x,c=a.y,f=o.y,h=s.y,d=Math.min(l,n,u),p=Math.min(c,f,h),g=Math.max(l,n,u),m=Math.max(c,f,h),y=I6(d,p,r,t,i),_=I6(g,m,r,t,i),v=e.prevZ;for(;v&&v.z>=y;){if(v.x>=d&&v.x<=g&&v.y>=p&&v.y<=m&&v!==s&&(l!==v.x||c!==v.y)&&nx(l,c,n,f,u,h,v.x,v.y)&&Jl(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let x=e.nextZ;for(;x&&x.z<=_;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=m&&x!==s&&(l!==x.x||c!==x.y)&&nx(l,c,n,f,u,h,x.x,x.y)&&Jl(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function see(e,r){let t=e,i=!1;do{let a=t.prev,o=t.next.next;HL(a,t,t.next,o,!1)&&ag(a,o)&&ag(o,a)&&(r.push(a.i,t.i,o.i),ng(t),ng(t.next),t=e=o,i=!0),t=t.next}while(t!==e);return i?U0(t):t}function lee(e,r,t,i,a){let o=e;do{let s=o.next.next;for(;s!==o.prev;){if(o.i!==s.i&&_ee(o,s)){let l=$L(o,s);o=U0(o,o.next),l=U0(l,l.next),P6(o,r,t,i,a),P6(l,r,t,i,a);return}s=s.next}o=o.next}while(o!==e)}function uee(e,r,t,i){let a=[];for(let o=0,s=r.length;os&&(s=t.x),t.yl&&(l=t.y),c.xs&&(s=c.x),c.yl&&(l=c.y),t=c}while(++n<16&&t!==r);xb[i]=t;let u=i*4;yl[u]=a,yl[u+1]=o,yl[u+2]=s,yl[u+3]=l}while(t!==r)}function dee(e,r){let t=e.z*4;r.xyl[t+2]&&(yl[t+2]=r.x),r.y>yl[t+3]&&(yl[t+3]=r.y)}function VL(e){let r=xb[e];for(;r.prev.next!==r;)r=r.next;return xb[e]=r,r}function GL(e){let r=_b[e];for(;r.prev.next!==r;)r=r.next;return _b[e]=r,r}function pee(e,r){let t=r,i=e.x,a=e.y,o=-1/0,s;if(ig(e,t))return t;for(let h=0,d=0;hyl[d+3]||yl[d]>i||yl[d+2]<=o)continue;let p=VL(h);t=GL(h);do{if(t.prev.next===t){if(ig(e,t.next))return t.next;if(a<=t.y&&a>=t.next.y&&t.next.y!==t.y){let g=t.x+(a-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(g<=i&&g>o&&(o=g,s=t.xi||yl[d+3]c)continue;let p=VL(h);t=GL(h);do{if(t.prev.next===t&&i>=t.x&&t.x>=l&&i!==t.x&&nx(ai)&&(gs.x||t.x===s.x&&vee(s,t)))&&(s=t,f=g)}t=t.next}while(t!==p)}return s}function vee(e,r){return Jl(e.prev,e,r.prev)<0&&Jl(r.next,e,e.next)<0}function mee(e,r,t,i){let a=e,o=0;do a.z=I6(a.x,a.y,r,t,i),Bf[o++]=a,a=a.next;while(a!==e);gee(o);let s=null;for(let l=0;l=0&&Bf[a].z>i;)Bf[a+1]=Bf[a],a--;Bf[a+1]=t}return}Jp.length>>o&255]++;let s=0;for(let l=0;l<256;l++){let n=Pm[l];Pm[l]=s,s+=n}for(let l=0;l>>o&255]++;i[u]=r[l],a[u]=n}}function I6(e,r,t,i,a){return e=(e-t)*a|0,r=(r-i)*a|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e|r<<1}function yee(e){let r=e,t=e;do(r.x=(e-s)*(o-l)&&(e-s)*(i-l)>=(t-s)*(r-l)&&(t-s)*(o-l)>=(a-s)*(i-l)}function _ee(e,r){let t=ig(e,r)&&Jl(e.prev,e,e.next)>0&&Jl(r.prev,r,r.next)>0;return e.next.i!==r.i&&(t||ag(e,r)&&ag(r,e)&&(Jl(e.prev,e,r.prev)!==0||Jl(e,r.prev,r)!==0))&&!xee(e,r)&&(t||bee(e,r))}function Jl(e,r,t){return(r.y-e.y)*(t.x-r.x)-(r.x-e.x)*(t.y-r.y)}function ig(e,r){return e.x===r.x&&e.y===r.y}function HL(e,r,t,i,a=!0){let o=Jl(e,r,t),s=Jl(e,r,i),l=Jl(t,i,e),n=Jl(t,i,r);return(o>0&&s<0||o<0&&s>0)&&(l>0&&n<0||l<0&&n>0)?!0:a?!!(o===0&&ox(e,t,r)||s===0&&ox(e,i,r)||l===0&&ox(t,e,i)||n===0&&ox(t,r,i)):!1}function ox(e,r,t){return r.x<=Math.max(e.x,t.x)&&r.x>=Math.min(e.x,t.x)&&r.y<=Math.max(e.y,t.y)&&r.y>=Math.min(e.y,t.y)}function xee(e,r){let t=Math.min(e.x,r.x),i=Math.max(e.x,r.x),a=Math.min(e.y,r.y),o=Math.max(e.y,r.y),s=e;do{let l=s.next;if(s.x>i&&l.x>i||s.xo&&l.y>o||s.y=0&&Jl(e,e.prev,r)>=0:Jl(e,r,e.prev)<0||Jl(e,e.next,r)<0}function bee(e,r){let t=e,i=!1,a=(e.x+r.x)/2,o=(e.y+r.y)/2;do{let s=t.next;t.y>o!=s.y>o&&a<(s.x-t.x)*(o-t.y)/(s.y-t.y)+t.x&&(i=!i),t=s}while(t!==e);return i}function $L(e,r){let t=R6(e.i,e.x,e.y),i=R6(r.i,r.x,r.y),a=e.next,o=r.prev;return e.next=r,r.prev=e,t.next=a,a.prev=t,i.next=t,t.prev=i,o.next=i,i.prev=o,i}function WL(e,r,t,i){let a=R6(e,r,t);return i?(a.next=i.next,a.prev=i,i.next.prev=a,i.next=a):(a.prev=a,a.next=a),a}function ng(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),yb&&dee(e.prev,e.next)}function R6(e,r,t){return{i:e,x:r,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function wee(e,r,t,i){let a=0;for(let o=r,s=t-i;o0?(Math.floor(C/s)+1)*s:(Math.ceil(C/s)-1)*s,b=x>0?(Math.floor(w/s)+1)*s:(Math.ceil(w/s)-1)*s,E=Math.abs(C-A),T=Math.abs(w-b),F=Math.abs(C-g),D=Math.abs(w-m),R=y?E/S:1/0,P=_?T/M:1/0;if((F<=E||!y)&&(D<=T||!_))break;if(R0?(t.push(a),t.push(s),t.push(o)):(t.push(a),t.push(o),t.push(s))}return t}function Mee(e,r,t){if(r.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,a=e[r[0]*2];for(let n=1;n=0?s-1:o-1,u=(l+1)%o,c=e[r[n]*2],f=e[r[n]*2+1],h=e[r[u]*2],d=e[r[u]*2+1],p=e[r[s]*2],g=e[r[s]*2+1],m=e[r[l]*2],y=e[r[l]*2+1],_=!1;if(ch)_=!1;else{let v=y-g,x=-(m-p),S=g((h-p)*v+(d-g)*x)*S&&(_=!0)}if(_){let v=r[n],x=r[s],S=r[l];v!==x&&v!==S&&x!==S&&t.push(S,x,v),s--,s<0&&(s=o-1)}else{let v=r[u],x=r[s],S=r[l];v!==x&&v!==S&&x!==S&&t.push(S,x,v),l++,l>=o&&(l=0)}if(n===u)break}}function XL(e,r,t,i,a,o,s,l,n){let u=a.length/2,c=s&&l&&n;if(uKs.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(r,t),n=l.count,g=!0,m=!0,y=!0,c=0);let v=og(s,i,o,l,h,g,u),x=og(s,i,o,l,d,m,u),S=og(s,i,o,l,p,y,u);t.emplaceBack(c+v-n,c+x-n,c+S-n),u.primitiveLength++}}function Eee(e,r,t,i,a,o){let s=[];for(let f=0;fKs.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(r,t),n=l.count,g=!0,m=!0,c=0);let _=og(s,i,o,l,d,g,u),v=og(s,i,o,l,p,m,u);t.emplaceBack(c+_-n,c+v-n),u.primitiveLength++}}function z6(e,r){return e.x===r.x&&(e.x<0||e.x>8192)||e.y===r.y&&(e.y<0||e.y>8192)}function ZL(e){return e.every(r=>r.x<0)||e.every(r=>r.x>8192)||e.every(r=>r.y<0)||e.every(r=>r.y>8192)}function KL(e){let r=e.length;if(r<=1)return[e];let t=[],i,a;for(let o=0;oIee(a,i))}function Pee(e,r){let t=Lee(Bi/2,Bi/2,r),i=Qo.fromLngLat(t).meterInMercatorCoordinateUnits(),a=(1<1&&r[0].x===r[r.length-1].x&&r[0].y===r[r.length-1].y;)r.pop();return r}function zee(e,r,t,i,a){let o=r.sub(t),s=i.sub(t),l=o.mag(),n=s.mag();if(l<1e-6||n<1e-6){e.push(t.clone());return}o._div(l),s._div(n);let u=o.x*s.x+o.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){e.push(t.clone());return}let c=.2,f=Math.min(a,l*c,n*c),h=t.add(o.mult(f)),d=t.add(s.mult(f)),p=Math.sqrt((1+u)/2),g=t.add(o.add(s)._unit()._mult(f/p)),m=h.sub(g).angleWith(d.sub(g)),y=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let _=0;_<=y;_++)e.push(h.rotateAround(_/y*m,g))}function cg(e,r,t,i,a,o,s,l){e.emplaceBack(r,t,Math.floor(i*Ab)*2+s,a*Ab*2,o*Ab*2,Math.round(l))}function Bee(e,r){for(let t=0;t0?r+2*e:e}function Uee(e){return/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function qee(e){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function Vee(e){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function Gee(e){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function sx(e){return/[\u02EA\u02EB\u1100-\u11FF\u1401-\u167F\u18B0-\u18FF\u2065\u20DD-\u20E0\u20E2-\u20E4\u2B97\u2BF0-\u2BFF\u2E50\u2E51\u2E80-\u3007\u3012\u3013\u3020-\u302F\u3031-\u30FB\u30FD-\uA4CF\uA960-\uA97F\uAC00-\uD7FF\uF900-\uFAFF\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7\uFFF0-\uFFF8]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|[\uD80C-\uD810\uD81C-\uD822\uD83C\uD83D\uD840-\uD87E\uD880-\uD8BE][\uDC00-\uDFFF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFFF]|\uD823[\uDC00-\uDDFF]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFF]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83E[\uDD00-\uDEFF]|[\uD87F\uD8BF][\uDC00-\uDFFD]/gim.test(String.fromCodePoint(e))}function Hee(e){return/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))}function $ee(e){return/[\r\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0600-\u0605\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DD\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0890\u0891\u0897-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E33-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB3-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1037\u1039-\u103E\u1056-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1084-\u1086\u108D\u109D\u1100-\u11FF\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60\u1A62\u1A65-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA960-\uA97C\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCBD\uDCC2\uDCCD\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC2\uDDC3\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF1F\uDF22-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE84-\uDE99\uDF60-\uDF67]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00-\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD2F]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDD63\uDD67-\uDD6A\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF\uDDEE\uDDEF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDDE6-\uDDFF\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF]/.test(e)}function nF(e){return/[\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA\u1000-\u103F\u1050-\u108F\u109A-\u109F\u1780-\u17D3\u17D7\u17DC\u17DD\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19DE\u19DF\u1A20-\u1A5E\u1A60-\u1A7C\u1AA0-\u1AAD\u1B00-\u1B4C\u1B4E-\u1B7F\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE-\uA9EF\uA9FA-\uA9FE\uAA60-\uAAC2\uAADB-\uAADF]|\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF3A\uDF3B\uDF3F-\uDF46]/gim.test(String.fromCodePoint(e))}function Wee(e,r){return/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(e)||new RegExp("^\\p{gc=Mc}","u").test(r)}function Yee(e,r,t){let i=0;for(let a of e.split(";")){let[o,s]=a.split(",").map(n=>parseInt(n,36)),l=i+o;for(let n=l;n{let t=r.codePointAt(0);return{codePoint:t,type:Xee(t),form:null}})}function ete(e){let r=e.filter(t=>t.type!=="T");for(let t=0;t0&&Zee(r[t-1].type),o=t+1String.fromCodePoint(ite(t))).join("")}function nte(e,r,t){var i;let a=r.layout.get("text-transform").evaluate(t,{});return a==="uppercase"?e=e.toLocaleUpperCase():a==="lowercase"&&(e=e.toLocaleLowerCase()),((i=Pg.applyArabicShaping)!=null?i:ate)(e)}function ote(e,r,t){for(let i of e.sections)i.text=nte(i.text,r,t);return e}function ste(e){let r={},t={},i=[],a=0;function o(u){i.push(e[u]),a++}function s(u,c,f){let h=t[u];return delete t[u],t[c]=h,i[h].geometry[0].pop(),i[h].geometry[0]=i[h].geometry[0].concat(f[0]),h}function l(u,c,f){let h=r[c];return delete r[c],r[u]=h,i[h].geometry[0].shift(),i[h].geometry[0]=f[0].concat(i[h].geometry[0]),h}function n(u,c,f){let h=f?c[0][c[0].length-1]:c[0][0];return`${u}:${h.x}:${h.y}`}for(let u=0;uu.geometry)}function j6(e){if(!gA||!$ee(e))return[...e];kb??(kb=new Intl.Segmenter(void 0,{granularity:"grapheme"}));let r=[];for(let{segment:t}of kb.segment(e)){let i=r.length-1;i>=0&&Wee(r[i],t)?r[i]+=t:r.push(t)}return r}function lte(e){let r=new Set;if(gA){Cb??(Cb=new Intl.Segmenter(void 0,{granularity:"word"}));for(let{index:i}of Cb.segment(e))r.add(i);return r}let t=0;for(let i of e.split(new RegExp("\\b|(?=\\p{Ideo})","u")))r.add(t),t+=i.length;return r}function lx(e){let r=e.codePointAt(0);return e.length>(r>65535?2:1)}function U6(e){return/\s/u.test(String.fromCodePoint(e))}function q6(e){for(let r of e)if(sx(r.codePointAt(0)))return!0;return!1}function ute(e){for(let r of e)if(!cte(r.codePointAt(0)))return!1;return!0}function cte(e){return!Uee(e)}function oF(e){return!(sx(e)||Hee(e))}function sF(e){return new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(e))}function lF(e){return qee(e)}function uF(e){for(let r of e)if(lF(r.codePointAt(0)))return!0;return!1}function fte(e){let r="",t={premature:!0,value:void 0},i=e[Symbol.iterator](),a=i.next(),o=e[Symbol.iterator]();o.next();let s=o.next();for(;!a.done;)(s.done||!oF(s.value.codePointAt(0))||Z0[s.value])&&(t.premature||!oF(t.value.codePointAt(0))||Z0[t.value])&&Z0[a.value]?r+=Z0[a.value]:r+=a.value,t={value:a.value,premature:!1},a=i.next(),s=o.next();return r}function cF(e,r,t,i,a,o){if("fontStack"in r){let s=t[r.fontStack],l=s?.[e];if(l)return l.metrics.advance*r.scale+a;let n=0;for(let u of e){let c=s?.[u];c&&(n+=c.metrics.advance*r.scale+a)}return n}{let s=i[r.imageName];return s?s.displaySize[0]*r.scale*24/o+a:0}}function fF(e,r,t,i){let a=(e-r)**2;return i?e1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function p(te,ne){var se=0,le=new Map,ce=ne&&new Map,pe;return te.split(",").forEach(function xe(ye){if(ye.indexOf("+")!==-1)for(var fe=+ye;fe--;)xe(pe);else{pe=ye;var ae=ye.split(">"),ee=ae[0],ie=ae[1];ee=String.fromCodePoint(se+=parseInt(ee,36)),ie=String.fromCodePoint(se+=parseInt(ie,36)),le.set(ee,ie),ne&&ce.set(ie,ee)}}),{map:le,reverseMap:ce}}var g,m,y;function _(){if(!g){var te=p(d.pairs,!0),ne=te.map,se=te.reverseMap;g=ne,m=se,y=p(d.canonical,!1).map}}function v(te){return _(),g.get(te)||null}function x(te){return _(),m.get(te)||null}function S(te){return _(),y.get(te)||null}var M=t.L,C=t.R,w=t.EN,k=t.ES,A=t.ET,b=t.AN,E=t.CS,T=t.B,F=t.S,D=t.ON,R=t.BN,P=t.NSM,z=t.AL,I=t.LRO,L=t.RLO,B=t.LRE,O=t.RLE,G=t.PDF,W=t.LRI,X=t.RLI,Z=t.FSI,J=t.PDI;function N(te,ne){for(var se=125,le=new Uint32Array(te.length),ce=0;ce0)Ve--;else if(Je>0){for(Ke=0;!Te[Te.length-1]._isolate;)Te.pop();var lt=Te[Te.length-1]._isolInitIndex;lt!=null&&(fe.set(lt,vt),fe.set(vt,lt)),Te.pop(),Je--}je=Te[Te.length-1],ye[vt]=je._level,je._override&&xe(vt,je._override)}else xt&G?(Ve===0&&(Ke>0?Ke--:!je._isolate&&Te.length>1&&(Te.pop(),je=Te[Te.length-1])),ye[vt]=je._level):xt&T&&(ye[vt]=ee.level);else ye[vt]=je._level,je._override&&xt!==R&&xe(vt,je._override)}for(var qe=[],Ye=null,me=ee.start;me<=ee.end;me++){var _e=le[me];if(!(_e&l)){var Ae=ye[me],ke=_e&a,Ee=_e===J;Ye&&Ae===Ye._level?(Ye._end=me,Ye._endsWithIsolInit=ke):qe.push(Ye={_start:me,_end:me,_level:Ae,_startsWithPDI:Ee,_endsWithIsolInit:ke})}}for(var De=[],Qe=0;Qe=0;kt--)if(!(le[kt]&l)){yt=ye[kt];break}var Lt=At[At.length-1],Ct=ye[Lt],$t=ee.level;if(!(le[Lt]&a)){for(var mr=Lt+1;mr<=ee.end;mr++)if(!(le[mr]&l)){$t=ye[mr];break}}De.push({_seqIndices:At,_sosType:Math.max(yt,gt)%2?C:M,_eosType:Math.max($t,Ct)%2?C:M})}}for(var br=0;br=0;ja--)if(!(le[Tr[ja]]&l)){$i=le[Tr[ja]];break}xe(ea,$i&(a|J)?D:$i)}}if(pe.get(w))for(var ya=0;ya=-1;xi--){var bi=xi===-1?Ur:le[Tr[xi]];if(bi&o){bi===z&&xe(pa,b);break}}}if(pe.get(z))for(var Ua=0;Ua=0&&(Be=le[Tr[Et]],Be&l);Et--);for(var St=pi+1;St=0&&le[Tr[Wt]]&(A|l);Wt--)xe(Tr[Wt],w);for(zt++;zt=0&&le[Tr[tt]]&l;tt--)xe(Tr[tt],D);for(var ft=Yt+1;ft=0;Hi--){var Za=Pr[Hi].char;if(Za===ba||Za===x(S(gi))||v(S(Za))===gi){Br.push([Pr[Hi].seqIndex,Mi]),Pr.length=Hi;break}}}Br.sort(function(no,Mo){return no[0]-Mo[0]});for(var oa=0;oa=0;Mn--){var Kn=Tr[Mn];if(le[Kn]&vr){var zn=le[Kn]&qt?C:M;pn=zn===oi?oi:zn;break}}}if(pn){if(le[Tr[_n]]=le[Tr[Li]]=pn,pn!==oi){for(var ua=_n+1;ua=0;Jn--)if(le[Tr[Jn]]&l)on=Jn;else{ho=le[Tr[Jn]]&qt?C:M;break}for(var lo=Ai,Fo=ln+1;Fo=0&&f(te[Bn])&n;Bn--)ye[Bn]=ee.level}}return{levels:ye,paragraphs:ae};function ps(no,Mo){for(var Vn=no;Vn=ye&&f(te[ee])&n;ee--)ae[ee]=xe.level;for(var ie=xe.level,Q=1/0,ue=0;ueie&&(ie=ge),ge=Q;Me--)for(var Te=0;Te=Me){for(var je=Te;Te+1=Me;)Te++;Te>je&&pe.push([je+ye,Te+ye])}}}),pe}function Y(te,ne,se,le){var ce=K(te,ne,se,le),pe=[].concat(te);return ce.forEach(function(xe,ye){pe[ye]=(ne.levels[xe]&1?V(te[xe]):null)||te[xe]}),pe.join("")}function K(te,ne,se,le){for(var ce=q(te,ne,se,le),pe=[],xe=0;xe=0;i--){let a=Lb.getBidiCharTypeName(e[i].text[0]);GR.has(a)?(e[i].level=r,t=!0):t&&VR.has(a)?e[i].level=r:t=!1}}function mte(e,r){let t=r,i=1/0;for(let{level:o}of e)o>t&&(t=o),(o|1)=i;o--)for(let s=0;s=o;)l++;for(let n=s,u=l;nr>=a.start&&r<=a.end))==null?void 0:t.level)!=null?i:0}function _te(e,r,t,i,a){let o=pte(e,r,i,a);vte(o,t);let s="",l=[];for(let n of mte(o,t)){if(qR.test(n.text))continue;let u=gte(n);s+=u,l.push(...Array(u.length).fill(n.index))}return{text:s,sourceIndices:l}}function xte(e,r){let t=r.filter(o=>o>0&&oo-s),a=[];for(let o=0;o+1a.start))).map(([a,o])=>_te(e,t,yte(i,a),a,o))}function bte(e,r){return vF(e,r).map(t=>t.text)}function wte(e,r,t){return vF(e,t).map(i=>[i.text,i.sourceIndices.map(a=>{var o;return(o=r[a])!=null?o:0})])}function Tte(e,r,t){let i=t.buf,a,o;if(o=i[t.pos++],a=(o&112)>>4,o<128||(o=i[t.pos++],a|=(o&127)<<3,o<128)||(o=i[t.pos++],a|=(o&127)<<10,o<128)||(o=i[t.pos++],a|=(o&127)<<17,o<128)||(o=i[t.pos++],a|=(o&127)<<24,o<128)||(o=i[t.pos++],a|=(o&1)<<31,o<128))return Ate(e,a,r);throw Error("Expected varint not more than 10 bytes")}function Ate(e,r,t){return t?r*4294967296+(e>>>0):(r>>>0)*4294967296+(e>>>0)}function Mte(e,r,t){let i="",a=r;for(;a239?4:o>223?3:o>191?2:1;if(a+l>t)break;let n,u,c;l===1?o<128&&(s=o):l===2?(n=e[a+1],(n&192)==128&&(s=(o&31)<<6|n&63,s<=127&&(s=null))):l===3?(n=e[a+1],u=e[a+2],(n&192)==128&&(u&192)==128&&(s=(o&15)<<12|(n&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):l===4&&(n=e[a+1],u=e[a+2],c=e[a+3],(n&192)==128&&(u&192)==128&&(c&192)==128&&(s=(o&15)<<18|(n&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,l=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),a+=l}return i}function Ste(e,r,t){e===1&&t.readMessage(Ete,r)}function Ete(e,r,t){if(e===3){let{id:i,bitmap:a,width:o,height:s,left:l,top:n,advance:u}=t.readMessage(kte,{});r.push({id:i,bitmap:new vb({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:n,advance:u}})}}function kte(e,r,t){e===1?r.id=t.readVarint():e===2?r.bitmap=t.readBytes():e===3?r.width=t.readVarint():e===4?r.height=t.readVarint():e===5?r.left=t.readSVarint():e===6?r.top=t.readSVarint():e===7&&(r.advance=t.readVarint())}function Cte(e){return new _A(e).readFields(Ste,[])}function ux(e){return typeof e?.renderWithWebGL=="function"}function Dte(e){let{userImage:r}=e;return!r?.render||!r.render()?!1:(ux(r.data)||e.data.replace(new Uint8Array(r.data.buffer)),!0)}function mF(e){let r=0,t=0;for(let s of e)r+=s.w*s.h,t=Math.max(t,s.w);e.sort((s,l)=>l.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),t),h:1/0}],a=0,o=0;for(let s of e)for(let l=i.length-1;l>=0;l--){let n=i[l];if(!(s.w>n.w||s.h>n.h)){if(s.x=n.x,s.y=n.y,o=Math.max(o,s.y+s.h),a=Math.max(a,s.x+s.w),s.w===n.w&&s.h===n.h){let u=i.pop();u&&l=t;o--)r.push(o);t=i+1}else{for(let o=t;oe.toCodeUnitIndex(o)),i=Pg.isParsed()?Pg:null;if(e.sections.length===1)return i?i.processBidirectionalText(e.toString(),t).map(o=>yF(o,e.sections,[...o].map(()=>0))):bte(e.toString(),t).map(o=>V6([...o],e.sections,[...o].map(()=>0)));let a=Ite(e);return i?i.processStyledBidirectionalText(e.text,a,t).map(([o,s])=>yF(o,e.sections,s)):wte(e.text,a,t).map(([o,s])=>{let l=[...o];return V6(l,e.sections,gF(l).map(n=>{var u;return(u=s[n])!=null?u:0}))})}function V6(e,r,t){var i;let a=new Db(e.join(""),r,[]),o=0;for(let s of a.graphemes())a.sectionIndex.push((i=t[o])!=null?i:0),o+=[...s].length;return a}function gF(e){let r=[],t=0;for(let i of e)r.push(t),t+=i.length;return r}function yF(e,r,t){let i=[...e],a=gF(i),o=Pte(i);return V6(o.map(s=>i[s]),r,o.map(s=>{var l;return(l=t[a[s]])!=null?l:0}))}function cx(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p){let g=Db.fromFeature(e,a);f===2&&g.verticalizePunctuation();let m=g.determineLineBreaks(u,o,r,i,d),y=uF(g.text)?Rte(g,m):Fte(g,m),_=[],v={positionedLines:_,text:g.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:f,iconsInText:!1,verticalizable:!1};return Gte(v,r,t,i,y,s,l,n,f,u,h,p),!Lte(_)&&v}function fx(e){let r=.5,t=.5;switch(e){case"right":case"top-right":case"bottom-right":r=1;break;case"left":case"top-left":case"bottom-left":r=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":t=1;break;case"top":case"top-right":case"top-left":t=0}return{horizontalAlign:r,verticalAlign:t}}function zte(e,r,t){let i=r.getMaxScale()*24,{maxImageWidth:a,maxImageHeight:o}=r.getMaxImageSize(e),s=Math.max(i,o*t);return{verticalLineContentWidth:Math.max(i,a*t),horizontalLineContentHeight:s}}function _F(e){switch(e){case"top":return 0;case"center":return .5;default:return 1}}function Bte(e,r,t,i){var a;if(e?.rect)return e;let o=(a=r[t.fontStack])==null?void 0:a[i];return o?{rect:null,metrics:o.metrics}:null}function Ote(e,r,t){return!(e===1||!r&&!sx(t)||r&&(U6(t)||sF(t)))}function hx(e){return new RegExp("\\p{Nd}","u").test(String.fromCodePoint(e))}function xF(e){return new RegExp("\\p{Lu}","u").test(String.fromCodePoint(e))}function Nte(e){return/[\p{P}\p{S}]/u.test(String.fromCodePoint(e))}function jte(e){let r=e.some(hx)&&e.every(i=>hx(i)||Nte(i)),t=e.length<=3&&e.every(i=>xF(i)||hx(i));return r||t}function Ute(e){return(hx(e)||xF(e))&&!sF(e)}function qte(e,r){let t=!1;for(let i=0;io.codePointAt(0)),i=t.map(sx),a=o=>!i[o]&&!U6(t[o])&&!("imageName"in e.getSection(o));for(let o=0;of){let h=Math.ceil(o/f);a*=h/s,s=h}return{x1:i,y1:a,x2:i+o,y2:a+s}}function wF(e,r,t,i,a,o){let s=e.image,l;if(s.content){let m=s.content,y=s.pixelRatio||1;l=[m[0]/y,m[1]/y,s.displaySize[0]-m[2]/y,s.displaySize[1]-m[3]/y]}let n=r.left*o,u=r.right*o,c,f,h,d;t==="width"||t==="both"?(d=a[0]+n-i[3],f=a[0]+u+i[1]):(d=a[0]+(n+u-s.displaySize[0])/2,f=d+s.displaySize[0]);let p=r.top*o,g=r.bottom*o;return t==="height"||t==="both"?(c=a[1]+p-i[0],h=a[1]+g+i[2]):(c=a[1]+(p+g-s.displaySize[1])/2,h=c+s.displaySize[1]),{image:s,top:c,right:f,bottom:h,left:d,collisionPadding:l}}function TF(e,r){let{expression:t}=r;if(t.kind==="constant")return{kind:"constant",layoutSize:t.evaluate(new ns(e+1))};if(t.kind==="source")return{kind:"source"};if(t.kind==="composite"){let{minZoom:i,maxZoom:a}=Zte(t.zoomStops,e);return{kind:"composite",minZoom:i,maxZoom:a,interpolationType:t.interpolationType}}{let i=Kte(t),a=t.evaluate(new ns(e+1));return{kind:"camera",zoomStops:t.zoomStops,sizes:i,layoutSize:a,interpolationType:t.interpolationType}}}function Zte(e,r){let t=0;for(;te.evaluate(new ns(r===-1/0?e.zoomStops[1]-1:r)))}function G6(e,{uSize:r,uSizeT:t},{lowerSize:i,upperSize:a}){return e.kind==="source"?i/128:e.kind==="composite"?Zs.number(i/128,a/128,t):r}function dx(e,r){let t=0,i=0;return e.kind==="constant"?i=e.layoutSize:e.kind==="camera"?i=Jte(e,r):e.kind==="composite"&&(t=Qte(e,r)),{uSizeT:t,uSize:i}}function Jte({zoomStops:e,sizes:r,layoutSize:t,interpolationType:i},a){let o=e.length-1;for(;o>0&&e[o]>a;)o--;let s=Math.min(o+1,e.length-1),l=i?to(Rf.interpolationFactor(i,a,e[o],e[s]),0,1):0;return Math.min(Zs.number(r[o],r[s],l),t)}function Qte({interpolationType:e,minZoom:r,maxZoom:t},i){return e?to(Rf.interpolationFactor(e,i,r,t),0,1):0}function AF(e,r,t,i,a){if(r.segment===void 0||t===0)return!0;let o=r,s=r.segment+1,l=0;for(;l>-t/2;){if(s--,s<0)return!1;l-=e[s].dist(o),o=e[s]}l+=e[s].dist(e[s+1]),s++;let n=[],u=0;for(;li;)u-=n.shift().angleDelta;if(u>a)return!1;s++,l+=f.dist(h)}return!0}function MF(e){let r=0;for(let t=0;tu){let p=(u-n)/d,g=new K0(Zs.number(f.x,h.x,p),Zs.number(f.y,h.y,p),h.angleTo(f),c);return g._round(),!s||AF(e,g,l,s,r)?g:void 0}n+=d}}function tre(e,r,t,i,a,o,s,l,n){let u=SF(i,o,s),c=EF(i,a),f=c*s,h=e[0].x===0||e[0].x===n||e[0].y===0||e[0].y===n;r-f=0&&x=0&&S=0&&h+u<=c){let M=new K0(x,S,_,p);M._round(),(!i||AF(e,M,o,i,a))&&d.push(M)}}f+=y}return!l&&!d.length&&!s&&(d=kF(e,f/2,t,i,a,o,s,!0,n)),d}function CF(e,r,t,i,a){let o=[];for(let s of e){let l;for(let n=0;n=i&&c.x>=i)&&(u.x>=i?u=new Wr(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round():c.x>=i&&(c=new Wr(i,u.y+(c.y-u.y)*((i-u.x)/(c.x-u.x)))._round()),!(u.y>=a&&c.y>=a)&&(u.y>=a?u=new Wr(u.x+(c.x-u.x)*((a-u.y)/(c.y-u.y)),a)._round():c.y>=a&&(c=new Wr(u.x+(c.x-u.x)*((a-u.y)/(c.y-u.y)),a)._round()),(!l||!u.equals(l[l.length-1]))&&(l=[u],o.push(l)),l.push(c)))))}}return o}function DF(e,r,t,i){let a=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2,n=o.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},c=o.stretchX||[[0,l]],f=o.stretchY||[[0,n]],h=(F,D)=>F+D[1]-D[0],d=c.reduce(h,0),p=f.reduce(h,0),g=l-d,m=n-p,y=0,_=d,v=0,x=p,S=0,M=g,C=0,w=m;if(o.content&&i){let F=o.content,D=F[2]-F[0],R=F[3]-F[1];(o.textFitWidth||o.textFitHeight)&&(u=bF(e)),y=px(c,0,F[0]),v=px(f,0,F[1]),_=px(c,F[0],F[2]),x=px(f,F[1],F[3]),S=F[0]-y,C=F[1]-v,M=D-_,w=R-x}let k=u.x1,A=u.y1,b=u.x2-k,E=u.y2-A,T=(F,D,R,P)=>{let z=vx(F.stretch-y,_,b,k),I=mx(F.fixed-S,M,F.stretch,d),L=vx(D.stretch-v,x,E,A),B=mx(D.fixed-C,w,D.stretch,p),O=vx(R.stretch-y,_,b,k),G=mx(R.fixed-S,M,R.stretch,d),W=vx(P.stretch-v,x,E,A),X=mx(P.fixed-C,w,P.stretch,p),Z=new Wr(z,L),J=new Wr(O,L),N=new Wr(O,W),H=new Wr(z,W),$=new Wr(I/s,B/s),U=new Wr(G/s,X/s),V=r*Math.PI/180;if(V){let te=Math.sin(V),ne=Math.cos(V),se=[ne,-te,te,ne];Z._matMult(se),J._matMult(se),H._matMult(se),N._matMult(se)}let j=F.stretch+F.fixed,q=R.stretch+R.fixed,Y=D.stretch+D.fixed,K=P.stretch+P.fixed;return{tl:Z,tr:J,bl:H,br:N,tex:{x:o.paddedRect.x+1+j,y:o.paddedRect.y+1+Y,w:q-j,h:K-Y},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:$,pixelOffsetBR:U,minFontScaleX:M/s/b,minFontScaleY:w/s/E,isSDF:t}};if(!i||!o.stretchX&&!o.stretchY)a.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:n+1}));else{let F=LF(c,g,d),D=LF(f,m,p);for(let R=0;Rf.d||!f.d)&&(f=h),!(h.max-f.d<=r)&&(a=h.h/2,o.push(new J0(h.p.x-a,h.p.y-a,a,e)),o.push(new J0(h.p.x+a,h.p.y-a,a,e)),o.push(new J0(h.p.x-a,h.p.y+a,a,e)),o.push(new J0(h.p.x+a,h.p.y+a,a,e)))}return c.d>0&&f.d-c.d<=r?c.p:f.p}function are(e,r){return r.max-e.max}function nre(e,r){let t=!1,i=1/0;for(let a of r)for(let o=0,s=a.length,l=s-1;oe.y!=u.y>e.y&&e.x<(u.x-n.x)*(e.y-n.y)/(u.y-n.y)+n.x&&(t=!t),i=Math.min(i,RL(e,n,u))}return(t?1:-1)*Math.sqrt(i)}function ore(e){let r=0,t=0,i=0,a=e[0];for(let o=0,s=a.length,l=s-1;oh*24);c.startsWith("top")?f[1]-=7:c.startsWith("bottom")&&(f[1]+=7),n[u+1]=f}return new Kh(n)}let s=a.get("text-variable-anchor");if(s){let l;l=e._unevaluatedLayout.getValue("text-radial-offset")===void 0?a.get("text-offset").evaluate(r,{},t).map(u=>u*24):[a.get("text-radial-offset").evaluate(r,{},t)*24,Rb];let n=[];for(let u of s)n.push(u,FF(u,l));return new Kh(n)}return null}function sre(e){var r,t;e.bucket.createArrays();let i=512*e.bucket.overscaling;e.bucket.tilePixelRatio=Bi/i,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let a=e.bucket.layers[0],o=a.layout,s=a._unevaluatedLayout._values,l={layoutIconSize:s["icon-size"].possiblyEvaluate(new ns(e.bucket.zoom+1),e.canonical),layoutTextSize:s["text-size"].possiblyEvaluate(new ns(e.bucket.zoom+1),e.canonical),textMaxSize:s["text-size"].possiblyEvaluate(new ns(18))};if(e.bucket.textSizeData.kind==="composite"){let{minZoom:h,maxZoom:d}=e.bucket.textSizeData;l.compositeTextSizes=[s["text-size"].possiblyEvaluate(new ns(h),e.canonical),s["text-size"].possiblyEvaluate(new ns(d),e.canonical)]}if(e.bucket.iconSizeData.kind==="composite"){let{minZoom:h,maxZoom:d}=e.bucket.iconSizeData;l.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new ns(h),e.canonical),s["icon-size"].possiblyEvaluate(new ns(d),e.canonical)]}let n=o.get("text-line-height")*24,u=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point",c=o.get("text-keep-upright"),f=o.get("text-size");for(let h of e.bucket.features){let d=o.get("text-font").evaluate(h,{},e.canonical).join(","),p=f.evaluate(h,{},e.canonical),g=l.layoutTextSize.evaluate(h,{},e.canonical),m=l.layoutIconSize.evaluate(h,{},e.canonical),y={horizontal:{},vertical:void 0},_=h.text,v=[0,0];if(_){let C=_.toString(),w=o.get("text-letter-spacing").evaluate(h,{},e.canonical)*24,k=ute(C)?w:0,A=o.get("text-anchor").evaluate(h,{},e.canonical),b=PF(a,h,e.canonical);if(!b){let D=o.get("text-radial-offset").evaluate(h,{},e.canonical);v=D?FF(A,[D*24,Rb]):o.get("text-offset").evaluate(h,{},e.canonical).map(R=>R*24)}let E=u?"center":o.get("text-justify").evaluate(h,{},e.canonical),T=o.get("symbol-placement")==="point"?o.get("text-max-width").evaluate(h,{},e.canonical)*24:1/0,F=()=>{e.bucket.allowVerticalPlacement&&q6(C)&&(y.vertical=cx(_,e.glyphMap,e.glyphPositions,e.imagePositions,d,T,n,A,"left",k,v,2,!0,g,p))};if(!u&&b){let D=new Set;if(E==="auto")for(let P=0;P{P.x<0||P.x>=8192||P.y<0||P.y>=8192||cre(e,P,R,t,i,a,T,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,y,[S,S,S,S],w,n,v,M,k,p,r,o,u,c,s)};if(A==="line")for(let R of CF(r.geometry,0,0,Bi,Bi)){let P=q0(R,F),z=tre(P,x,C,t.vertical||g,i,24,_,e.overscaling,Bi);for(let I of z){let L=g;(!L||!fre(e,L.text,b,I))&&D(P,I)}}else if(A==="line-center"){for(let R of r.geometry)if(R.length>1){let P=q0(R,F),z=ere(P,C,t.vertical||g,i,24,_);z&&D(P,z)}}else if(r.type==="Polygon")for(let R of z_(r.geometry,0)){let P=ire(R,16);D(q0(R[0],F,!0),new K0(P.x,P.y,0))}else if(r.type==="LineString")for(let R of r.geometry){let P=q0(R,F);D(P,new K0(P[0].x,P[0].y,0))}else if(r.type==="Point")for(let R of r.geometry)for(let P of R)D([P],new K0(P.x,P.y,0))}function ure(e,r){let t=e.length,i=r?.values;if(i?.length>0)for(let a=0;a32640&&To(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):y.kind==="composite"&&(_=[128*p.compositeTextSizes[0].evaluate(s,{},g),128*p.compositeTextSizes[1].evaluate(s,{},g)],(_[0]>32640||_[1]>32640)&&To(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,m,_,l,o,s,c,r,u.lineStartIndex,u.lineLength,d,g,n);for(let v of f)h[v]=e.text.placedSymbolArray.length-1;return m.length*4}function RF(e){for(let r in e)return e[r];return null}function cre(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S,M,C,w){let k=e.addToLineVertexArray(r,t),A=l.layout.get("symbol-height-offset").evaluate(x,{},C);A>e.maxHeightOffset&&(e.maxHeightOffset=A);let b,E,T,F,D=0,R=0,P=0,z=0,I=-1,L=-1,B={},O=(0,hb.default)("");if(e.allowVerticalPlacement&&i.vertical){let ne=l.layout.get("text-rotate").evaluate(x,{},C)+90,se=i.vertical;T=new Ig(n,r,u,c,f,se,h,d,p,ne),s&&(F=new Ig(n,r,u,c,f,s,m,y,p,ne))}if(a){let ne=l.layout.get("icon-rotate").evaluate(x,{}),se=l.layout.get("icon-text-fit")!=="none",le=DF(a,ne,M,se),ce=s?DF(s,ne,M,se):void 0;E=new Ig(n,r,u,c,f,a,m,y,!1,ne),D=le.length*4;let pe=e.iconSizeData,xe=null;pe.kind==="source"?(xe=[128*l.layout.get("icon-size").evaluate(x,{})],xe[0]>32640&&To(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):pe.kind==="composite"&&(xe=[128*S.compositeIconSizes[0].evaluate(x,{},C),128*S.compositeIconSizes[1].evaluate(x,{},C)],(xe[0]>32640||xe[1]>32640)&&To(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,le,xe,v,_,x,0,r,k.lineStartIndex,k.lineLength,-1,C,A),I=e.icon.placedSymbolArray.length-1,ce&&(R=ce.length*4,e.addSymbols(e.icon,ce,xe,v,_,x,2,r,k.lineStartIndex,k.lineLength,-1,C,A),L=e.icon.placedSymbolArray.length-1)}let G=Object.keys(i.horizontal);for(let ne of G){let se=i.horizontal[ne];b||(b=(O=(0,hb.default)(se.text),new Ig(n,r,u,c,f,se,h,d,p,l.layout.get("text-rotate").evaluate(x,{},C))));let le=se.positionedLines.length===1;if(P+=IF(e,r,se,o,l,p,x,g,A,k,i.vertical?1:3,le?G:[ne],B,I,S,C),le)break}i.vertical&&(z+=IF(e,r,i.vertical,o,l,p,x,g,A,k,2,["vertical"],B,L,S,C));let W=b?b.boxStartIndex:e.collisionBoxArray.length,X=b?b.boxEndIndex:e.collisionBoxArray.length,Z=T?T.boxStartIndex:e.collisionBoxArray.length,J=T?T.boxEndIndex:e.collisionBoxArray.length,N=E?E.boxStartIndex:e.collisionBoxArray.length,H=E?E.boxEndIndex:e.collisionBoxArray.length,$=F?F.boxStartIndex:e.collisionBoxArray.length,U=F?F.boxEndIndex:e.collisionBoxArray.length,V=-1,j=(ne,se)=>ne?.circleDiameter?Math.max(ne.circleDiameter,se):se;V=j(b,V),V=j(T,V),V=j(E,V),V=j(F,V);let q=+(V>-1);q&&(V*=w/24),e.glyphOffsetArray.length>=e.maxGlyphs&&To("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),x.sortKey!==void 0&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey);let Y=PF(l,x,C),[K,te]=ure(e.textAnchorOffsets,Y);e.symbolInstances.emplaceBack(r.x,r.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,I,L,O,W,X,Z,J,N,H,$,U,u,P,z,D,R,q,0,h,V,K,te,A)}function fre(e,r,t,i){let a=e.compareText;if(!(r in a))a[r]=[];else{let o=a[r];for(let s=o.length-1;s>=0;s--)if(i.dist(o[s])e&&i in e?String(e[i]):"")}function pre(e,r,t,i=1){var a;let o=(a=e.get("icon-padding").evaluate(r,{},t))==null?void 0:a.values;return[o[0]*i,o[1]*i,o[2]*i,o[3]*i]}function vre(e){let r=[],t=e.id;return t===void 0&&r.push(new na(`layers.${t}`,null,'missing required property "id"')),e.render===void 0&&r.push(new na(`layers.${t}`,null,'missing required method "render"')),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&r.push(new na(`layers.${t}`,null,'property "renderingMode" must be either "2d" or "3d"')),r}function $6(e,r){if(e.type==="custom")return new n5(e,r);switch(e.type){case"background":return new i5(e,r);case"circle":return new zI(e,r);case"color-relief":return new JI(e,r);case"fill":return new sR(e,r);case"fill-extrusion":return new _R(e,r);case"heatmap":return new UI(e,r);case"hillshade":return new $I(e,r);case"line":return new LR(e,r);case"raster":return new lI(e,r);case"symbol":return new JR(e,r)}}function mre(e,r,t){return!(e<0||e>25||t<0||t>=2**e||r<0||r>=2**e)}function zF(e,r){let{x:t,y:i}=Qo.fromLngLat(r);return!(e<0||e>25||i<0||i>=1||t<0||t>=1)}function fm(e,r,t,i,a){e*=2,e<0&&(e=e*-1-1);let o=1<0;a--){let o=1<>>0;return((r&255)<<24|(r&65280)<<8|r>>>8&65280|r>>>24&255)>>>0}function wre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0;t[a++]=o>>>0&3,t[a++]=o>>>2&3,t[a++]=o>>>4&3,t[a++]=o>>>6&3,t[a++]=o>>>8&3,t[a++]=o>>>10&3,t[a++]=o>>>12&3,t[a++]=o>>>14&3,t[a++]=o>>>16&3,t[a++]=o>>>18&3,t[a++]=o>>>20&3,t[a++]=o>>>22&3,t[a++]=o>>>24&3,t[a++]=o>>>26&3,t[a++]=o>>>28&3,t[a++]=o>>>30&3,t[a++]=s>>>0&3,t[a++]=s>>>2&3,t[a++]=s>>>4&3,t[a++]=s>>>6&3,t[a++]=s>>>8&3,t[a++]=s>>>10&3,t[a++]=s>>>12&3,t[a++]=s>>>14&3,t[a++]=s>>>16&3,t[a++]=s>>>18&3,t[a++]=s>>>20&3,t[a++]=s>>>22&3,t[a++]=s>>>24&3,t[a++]=s>>>26&3,t[a++]=s>>>28&3,t[a]=s>>>30&3}function Tre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0;t[a++]=o>>>0&7,t[a++]=o>>>3&7,t[a++]=o>>>6&7,t[a++]=o>>>9&7,t[a++]=o>>>12&7,t[a++]=o>>>15&7,t[a++]=o>>>18&7,t[a++]=o>>>21&7,t[a++]=o>>>24&7,t[a++]=o>>>27&7,t[a++]=(o>>>30|(s&1)<<2)&7,t[a++]=s>>>1&7,t[a++]=s>>>4&7,t[a++]=s>>>7&7,t[a++]=s>>>10&7,t[a++]=s>>>13&7,t[a++]=s>>>16&7,t[a++]=s>>>19&7,t[a++]=s>>>22&7,t[a++]=s>>>25&7,t[a++]=s>>>28&7,t[a++]=(s>>>31|(l&3)<<1)&7,t[a++]=l>>>2&7,t[a++]=l>>>5&7,t[a++]=l>>>8&7,t[a++]=l>>>11&7,t[a++]=l>>>14&7,t[a++]=l>>>17&7,t[a++]=l>>>20&7,t[a++]=l>>>23&7,t[a++]=l>>>26&7,t[a]=l>>>29&7}function Are(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0;t[a++]=o>>>0&15,t[a++]=o>>>4&15,t[a++]=o>>>8&15,t[a++]=o>>>12&15,t[a++]=o>>>16&15,t[a++]=o>>>20&15,t[a++]=o>>>24&15,t[a++]=o>>>28&15,t[a++]=s>>>0&15,t[a++]=s>>>4&15,t[a++]=s>>>8&15,t[a++]=s>>>12&15,t[a++]=s>>>16&15,t[a++]=s>>>20&15,t[a++]=s>>>24&15,t[a++]=s>>>28&15,t[a++]=l>>>0&15,t[a++]=l>>>4&15,t[a++]=l>>>8&15,t[a++]=l>>>12&15,t[a++]=l>>>16&15,t[a++]=l>>>20&15,t[a++]=l>>>24&15,t[a++]=l>>>28&15,t[a++]=n>>>0&15,t[a++]=n>>>4&15,t[a++]=n>>>8&15,t[a++]=n>>>12&15,t[a++]=n>>>16&15,t[a++]=n>>>20&15,t[a++]=n>>>24&15,t[a]=n>>>28&15}function Mre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0;t[a++]=o>>>0&31,t[a++]=o>>>5&31,t[a++]=o>>>10&31,t[a++]=o>>>15&31,t[a++]=o>>>20&31,t[a++]=o>>>25&31,t[a++]=(o>>>30|(s&7)<<2)&31,t[a++]=s>>>3&31,t[a++]=s>>>8&31,t[a++]=s>>>13&31,t[a++]=s>>>18&31,t[a++]=s>>>23&31,t[a++]=(s>>>28|(l&1)<<4)&31,t[a++]=l>>>1&31,t[a++]=l>>>6&31,t[a++]=l>>>11&31,t[a++]=l>>>16&31,t[a++]=l>>>21&31,t[a++]=l>>>26&31,t[a++]=(l>>>31|(n&15)<<1)&31,t[a++]=n>>>4&31,t[a++]=n>>>9&31,t[a++]=n>>>14&31,t[a++]=n>>>19&31,t[a++]=n>>>24&31,t[a++]=(n>>>29|(u&3)<<3)&31,t[a++]=u>>>2&31,t[a++]=u>>>7&31,t[a++]=u>>>12&31,t[a++]=u>>>17&31,t[a++]=u>>>22&31,t[a]=u>>>27&31}function Sre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0;t[a++]=o>>>0&63,t[a++]=o>>>6&63,t[a++]=o>>>12&63,t[a++]=o>>>18&63,t[a++]=o>>>24&63,t[a++]=(o>>>30|(s&15)<<2)&63,t[a++]=s>>>4&63,t[a++]=s>>>10&63,t[a++]=s>>>16&63,t[a++]=s>>>22&63,t[a++]=(s>>>28|(l&3)<<4)&63,t[a++]=l>>>2&63,t[a++]=l>>>8&63,t[a++]=l>>>14&63,t[a++]=l>>>20&63,t[a++]=l>>>26&63,t[a++]=n>>>0&63,t[a++]=n>>>6&63,t[a++]=n>>>12&63,t[a++]=n>>>18&63,t[a++]=n>>>24&63,t[a++]=(n>>>30|(u&15)<<2)&63,t[a++]=u>>>4&63,t[a++]=u>>>10&63,t[a++]=u>>>16&63,t[a++]=u>>>22&63,t[a++]=(u>>>28|(c&3)<<4)&63,t[a++]=c>>>2&63,t[a++]=c>>>8&63,t[a++]=c>>>14&63,t[a++]=c>>>20&63,t[a]=c>>>26&63}function Ere(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0;t[a++]=o>>>0&127,t[a++]=o>>>7&127,t[a++]=o>>>14&127,t[a++]=o>>>21&127,t[a++]=(o>>>28|(s&7)<<4)&127,t[a++]=s>>>3&127,t[a++]=s>>>10&127,t[a++]=s>>>17&127,t[a++]=s>>>24&127,t[a++]=(s>>>31|(l&63)<<1)&127,t[a++]=l>>>6&127,t[a++]=l>>>13&127,t[a++]=l>>>20&127,t[a++]=(l>>>27|(n&3)<<5)&127,t[a++]=n>>>2&127,t[a++]=n>>>9&127,t[a++]=n>>>16&127,t[a++]=n>>>23&127,t[a++]=(n>>>30|(u&31)<<2)&127,t[a++]=u>>>5&127,t[a++]=u>>>12&127,t[a++]=u>>>19&127,t[a++]=(u>>>26|(c&1)<<6)&127,t[a++]=c>>>1&127,t[a++]=c>>>8&127,t[a++]=c>>>15&127,t[a++]=c>>>22&127,t[a++]=(c>>>29|(f&15)<<3)&127,t[a++]=f>>>4&127,t[a++]=f>>>11&127,t[a++]=f>>>18&127,t[a]=f>>>25&127}function kre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0;t[a++]=o>>>0&255,t[a++]=o>>>8&255,t[a++]=o>>>16&255,t[a++]=o>>>24&255,t[a++]=s>>>0&255,t[a++]=s>>>8&255,t[a++]=s>>>16&255,t[a++]=s>>>24&255,t[a++]=l>>>0&255,t[a++]=l>>>8&255,t[a++]=l>>>16&255,t[a++]=l>>>24&255,t[a++]=n>>>0&255,t[a++]=n>>>8&255,t[a++]=n>>>16&255,t[a++]=n>>>24&255,t[a++]=u>>>0&255,t[a++]=u>>>8&255,t[a++]=u>>>16&255,t[a++]=u>>>24&255,t[a++]=c>>>0&255,t[a++]=c>>>8&255,t[a++]=c>>>16&255,t[a++]=c>>>24&255,t[a++]=f>>>0&255,t[a++]=f>>>8&255,t[a++]=f>>>16&255,t[a++]=f>>>24&255,t[a++]=h>>>0&255,t[a++]=h>>>8&255,t[a++]=h>>>16&255,t[a]=h>>>24&255}function Cre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0;t[a++]=o>>>0&511,t[a++]=o>>>9&511,t[a++]=o>>>18&511,t[a++]=(o>>>27|(s&15)<<5)&511,t[a++]=s>>>4&511,t[a++]=s>>>13&511,t[a++]=s>>>22&511,t[a++]=(s>>>31|(l&255)<<1)&511,t[a++]=l>>>8&511,t[a++]=l>>>17&511,t[a++]=(l>>>26|(n&7)<<6)&511,t[a++]=n>>>3&511,t[a++]=n>>>12&511,t[a++]=n>>>21&511,t[a++]=(n>>>30|(u&127)<<2)&511,t[a++]=u>>>7&511,t[a++]=u>>>16&511,t[a++]=(u>>>25|(c&3)<<7)&511,t[a++]=c>>>2&511,t[a++]=c>>>11&511,t[a++]=c>>>20&511,t[a++]=(c>>>29|(f&63)<<3)&511,t[a++]=f>>>6&511,t[a++]=f>>>15&511,t[a++]=(f>>>24|(h&1)<<8)&511,t[a++]=h>>>1&511,t[a++]=h>>>10&511,t[a++]=h>>>19&511,t[a++]=(h>>>28|(d&31)<<4)&511,t[a++]=d>>>5&511,t[a++]=d>>>14&511,t[a]=d>>>23&511}function Dre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0,p=e[r+9]>>>0;t[a++]=o>>>0&1023,t[a++]=o>>>10&1023,t[a++]=o>>>20&1023,t[a++]=(o>>>30|(s&255)<<2)&1023,t[a++]=s>>>8&1023,t[a++]=s>>>18&1023,t[a++]=(s>>>28|(l&63)<<4)&1023,t[a++]=l>>>6&1023,t[a++]=l>>>16&1023,t[a++]=(l>>>26|(n&15)<<6)&1023,t[a++]=n>>>4&1023,t[a++]=n>>>14&1023,t[a++]=(n>>>24|(u&3)<<8)&1023,t[a++]=u>>>2&1023,t[a++]=u>>>12&1023,t[a++]=u>>>22&1023,t[a++]=c>>>0&1023,t[a++]=c>>>10&1023,t[a++]=c>>>20&1023,t[a++]=(c>>>30|(f&255)<<2)&1023,t[a++]=f>>>8&1023,t[a++]=f>>>18&1023,t[a++]=(f>>>28|(h&63)<<4)&1023,t[a++]=h>>>6&1023,t[a++]=h>>>16&1023,t[a++]=(h>>>26|(d&15)<<6)&1023,t[a++]=d>>>4&1023,t[a++]=d>>>14&1023,t[a++]=(d>>>24|(p&3)<<8)&1023,t[a++]=p>>>2&1023,t[a++]=p>>>12&1023,t[a]=p>>>22&1023}function Lre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0,p=e[r+9]>>>0,g=e[r+10]>>>0;t[a++]=o>>>0&2047,t[a++]=o>>>11&2047,t[a++]=(o>>>22|(s&1)<<10)&2047,t[a++]=s>>>1&2047,t[a++]=s>>>12&2047,t[a++]=(s>>>23|(l&3)<<9)&2047,t[a++]=l>>>2&2047,t[a++]=l>>>13&2047,t[a++]=(l>>>24|(n&7)<<8)&2047,t[a++]=n>>>3&2047,t[a++]=n>>>14&2047,t[a++]=(n>>>25|(u&15)<<7)&2047,t[a++]=u>>>4&2047,t[a++]=u>>>15&2047,t[a++]=(u>>>26|(c&31)<<6)&2047,t[a++]=c>>>5&2047,t[a++]=c>>>16&2047,t[a++]=(c>>>27|(f&63)<<5)&2047,t[a++]=f>>>6&2047,t[a++]=f>>>17&2047,t[a++]=(f>>>28|(h&127)<<4)&2047,t[a++]=h>>>7&2047,t[a++]=h>>>18&2047,t[a++]=(h>>>29|(d&255)<<3)&2047,t[a++]=d>>>8&2047,t[a++]=d>>>19&2047,t[a++]=(d>>>30|(p&511)<<2)&2047,t[a++]=p>>>9&2047,t[a++]=p>>>20&2047,t[a++]=(p>>>31|(g&1023)<<1)&2047,t[a++]=g>>>10&2047,t[a]=g>>>21&2047}function Fre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0,p=e[r+9]>>>0,g=e[r+10]>>>0,m=e[r+11]>>>0;t[a++]=o>>>0&4095,t[a++]=o>>>12&4095,t[a++]=(o>>>24|(s&15)<<8)&4095,t[a++]=s>>>4&4095,t[a++]=s>>>16&4095,t[a++]=(s>>>28|(l&255)<<4)&4095,t[a++]=l>>>8&4095,t[a++]=l>>>20&4095,t[a++]=n>>>0&4095,t[a++]=n>>>12&4095,t[a++]=(n>>>24|(u&15)<<8)&4095,t[a++]=u>>>4&4095,t[a++]=u>>>16&4095,t[a++]=(u>>>28|(c&255)<<4)&4095,t[a++]=c>>>8&4095,t[a++]=c>>>20&4095,t[a++]=f>>>0&4095,t[a++]=f>>>12&4095,t[a++]=(f>>>24|(h&15)<<8)&4095,t[a++]=h>>>4&4095,t[a++]=h>>>16&4095,t[a++]=(h>>>28|(d&255)<<4)&4095,t[a++]=d>>>8&4095,t[a++]=d>>>20&4095,t[a++]=p>>>0&4095,t[a++]=p>>>12&4095,t[a++]=(p>>>24|(g&15)<<8)&4095,t[a++]=g>>>4&4095,t[a++]=g>>>16&4095,t[a++]=(g>>>28|(m&255)<<4)&4095,t[a++]=m>>>8&4095,t[a]=m>>>20&4095}function Pre(e,r,t,i){let a=i,o=e[r]>>>0,s=e[r+1]>>>0,l=e[r+2]>>>0,n=e[r+3]>>>0,u=e[r+4]>>>0,c=e[r+5]>>>0,f=e[r+6]>>>0,h=e[r+7]>>>0,d=e[r+8]>>>0,p=e[r+9]>>>0,g=e[r+10]>>>0,m=e[r+11]>>>0,y=e[r+12]>>>0,_=e[r+13]>>>0,v=e[r+14]>>>0,x=e[r+15]>>>0;t[a++]=o>>>0&65535,t[a++]=o>>>16&65535,t[a++]=s>>>0&65535,t[a++]=s>>>16&65535,t[a++]=l>>>0&65535,t[a++]=l>>>16&65535,t[a++]=n>>>0&65535,t[a++]=n>>>16&65535,t[a++]=u>>>0&65535,t[a++]=u>>>16&65535,t[a++]=c>>>0&65535,t[a++]=c>>>16&65535,t[a++]=f>>>0&65535,t[a++]=f>>>16&65535,t[a++]=h>>>0&65535,t[a++]=h>>>16&65535,t[a++]=d>>>0&65535,t[a++]=d>>>16&65535,t[a++]=p>>>0&65535,t[a++]=p>>>16&65535,t[a++]=g>>>0&65535,t[a++]=g>>>16&65535,t[a++]=m>>>0&65535,t[a++]=m>>>16&65535,t[a++]=y>>>0&65535,t[a++]=y>>>16&65535,t[a++]=_>>>0&65535,t[a++]=_>>>16&65535,t[a++]=v>>>0&65535,t[a++]=v>>>16&65535,t[a++]=x>>>0&65535,t[a]=x>>>16&65535}function Ire(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0;t[a++]=l>>>0&1,t[a++]=l>>>1&1,t[a++]=l>>>2&1,t[a++]=l>>>3&1,t[a++]=l>>>4&1,t[a++]=l>>>5&1,t[a++]=l>>>6&1,t[a++]=l>>>7&1,t[a++]=l>>>8&1,t[a++]=l>>>9&1,t[a++]=l>>>10&1,t[a++]=l>>>11&1,t[a++]=l>>>12&1,t[a++]=l>>>13&1,t[a++]=l>>>14&1,t[a++]=l>>>15&1,t[a++]=l>>>16&1,t[a++]=l>>>17&1,t[a++]=l>>>18&1,t[a++]=l>>>19&1,t[a++]=l>>>20&1,t[a++]=l>>>21&1,t[a++]=l>>>22&1,t[a++]=l>>>23&1,t[a++]=l>>>24&1,t[a++]=l>>>25&1,t[a++]=l>>>26&1,t[a++]=l>>>27&1,t[a++]=l>>>28&1,t[a++]=l>>>29&1,t[a++]=l>>>30&1,t[a++]=l>>>31&1}}function Rre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0;t[a++]=l>>>0&3,t[a++]=l>>>2&3,t[a++]=l>>>4&3,t[a++]=l>>>6&3,t[a++]=l>>>8&3,t[a++]=l>>>10&3,t[a++]=l>>>12&3,t[a++]=l>>>14&3,t[a++]=l>>>16&3,t[a++]=l>>>18&3,t[a++]=l>>>20&3,t[a++]=l>>>22&3,t[a++]=l>>>24&3,t[a++]=l>>>26&3,t[a++]=l>>>28&3,t[a++]=l>>>30&3,t[a++]=n>>>0&3,t[a++]=n>>>2&3,t[a++]=n>>>4&3,t[a++]=n>>>6&3,t[a++]=n>>>8&3,t[a++]=n>>>10&3,t[a++]=n>>>12&3,t[a++]=n>>>14&3,t[a++]=n>>>16&3,t[a++]=n>>>18&3,t[a++]=n>>>20&3,t[a++]=n>>>22&3,t[a++]=n>>>24&3,t[a++]=n>>>26&3,t[a++]=n>>>28&3,t[a++]=n>>>30&3}}function zre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0;t[a++]=l>>>0&7,t[a++]=l>>>3&7,t[a++]=l>>>6&7,t[a++]=l>>>9&7,t[a++]=l>>>12&7,t[a++]=l>>>15&7,t[a++]=l>>>18&7,t[a++]=l>>>21&7,t[a++]=l>>>24&7,t[a++]=l>>>27&7,t[a++]=(l>>>30|(n&1)<<2)&7,t[a++]=n>>>1&7,t[a++]=n>>>4&7,t[a++]=n>>>7&7,t[a++]=n>>>10&7,t[a++]=n>>>13&7,t[a++]=n>>>16&7,t[a++]=n>>>19&7,t[a++]=n>>>22&7,t[a++]=n>>>25&7,t[a++]=n>>>28&7,t[a++]=(n>>>31|(u&3)<<1)&7,t[a++]=u>>>2&7,t[a++]=u>>>5&7,t[a++]=u>>>8&7,t[a++]=u>>>11&7,t[a++]=u>>>14&7,t[a++]=u>>>17&7,t[a++]=u>>>20&7,t[a++]=u>>>23&7,t[a++]=u>>>26&7,t[a++]=u>>>29&7}}function Bre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0;t[a++]=l>>>0&15,t[a++]=l>>>4&15,t[a++]=l>>>8&15,t[a++]=l>>>12&15,t[a++]=l>>>16&15,t[a++]=l>>>20&15,t[a++]=l>>>24&15,t[a++]=l>>>28&15,t[a++]=n>>>0&15,t[a++]=n>>>4&15,t[a++]=n>>>8&15,t[a++]=n>>>12&15,t[a++]=n>>>16&15,t[a++]=n>>>20&15,t[a++]=n>>>24&15,t[a++]=n>>>28&15,t[a++]=u>>>0&15,t[a++]=u>>>4&15,t[a++]=u>>>8&15,t[a++]=u>>>12&15,t[a++]=u>>>16&15,t[a++]=u>>>20&15,t[a++]=u>>>24&15,t[a++]=u>>>28&15,t[a++]=c>>>0&15,t[a++]=c>>>4&15,t[a++]=c>>>8&15,t[a++]=c>>>12&15,t[a++]=c>>>16&15,t[a++]=c>>>20&15,t[a++]=c>>>24&15,t[a++]=c>>>28&15}}function Ore(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0,f=e[o++]>>>0;t[a++]=l>>>0&31,t[a++]=l>>>5&31,t[a++]=l>>>10&31,t[a++]=l>>>15&31,t[a++]=l>>>20&31,t[a++]=l>>>25&31,t[a++]=(l>>>30|(n&7)<<2)&31,t[a++]=n>>>3&31,t[a++]=n>>>8&31,t[a++]=n>>>13&31,t[a++]=n>>>18&31,t[a++]=n>>>23&31,t[a++]=(n>>>28|(u&1)<<4)&31,t[a++]=u>>>1&31,t[a++]=u>>>6&31,t[a++]=u>>>11&31,t[a++]=u>>>16&31,t[a++]=u>>>21&31,t[a++]=u>>>26&31,t[a++]=(u>>>31|(c&15)<<1)&31,t[a++]=c>>>4&31,t[a++]=c>>>9&31,t[a++]=c>>>14&31,t[a++]=c>>>19&31,t[a++]=c>>>24&31,t[a++]=(c>>>29|(f&3)<<3)&31,t[a++]=f>>>2&31,t[a++]=f>>>7&31,t[a++]=f>>>12&31,t[a++]=f>>>17&31,t[a++]=f>>>22&31,t[a++]=f>>>27&31}}function Nre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0,f=e[o++]>>>0,h=e[o++]>>>0;t[a++]=l>>>0&63,t[a++]=l>>>6&63,t[a++]=l>>>12&63,t[a++]=l>>>18&63,t[a++]=l>>>24&63,t[a++]=(l>>>30|(n&15)<<2)&63,t[a++]=n>>>4&63,t[a++]=n>>>10&63,t[a++]=n>>>16&63,t[a++]=n>>>22&63,t[a++]=(n>>>28|(u&3)<<4)&63,t[a++]=u>>>2&63,t[a++]=u>>>8&63,t[a++]=u>>>14&63,t[a++]=u>>>20&63,t[a++]=u>>>26&63,t[a++]=c>>>0&63,t[a++]=c>>>6&63,t[a++]=c>>>12&63,t[a++]=c>>>18&63,t[a++]=c>>>24&63,t[a++]=(c>>>30|(f&15)<<2)&63,t[a++]=f>>>4&63,t[a++]=f>>>10&63,t[a++]=f>>>16&63,t[a++]=f>>>22&63,t[a++]=(f>>>28|(h&3)<<4)&63,t[a++]=h>>>2&63,t[a++]=h>>>8&63,t[a++]=h>>>14&63,t[a++]=h>>>20&63,t[a++]=h>>>26&63}}function jre(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0,f=e[o++]>>>0,h=e[o++]>>>0,d=e[o++]>>>0;t[a++]=l>>>0&127,t[a++]=l>>>7&127,t[a++]=l>>>14&127,t[a++]=l>>>21&127,t[a++]=(l>>>28|(n&7)<<4)&127,t[a++]=n>>>3&127,t[a++]=n>>>10&127,t[a++]=n>>>17&127,t[a++]=n>>>24&127,t[a++]=(n>>>31|(u&63)<<1)&127,t[a++]=u>>>6&127,t[a++]=u>>>13&127,t[a++]=u>>>20&127,t[a++]=(u>>>27|(c&3)<<5)&127,t[a++]=c>>>2&127,t[a++]=c>>>9&127,t[a++]=c>>>16&127,t[a++]=c>>>23&127,t[a++]=(c>>>30|(f&31)<<2)&127,t[a++]=f>>>5&127,t[a++]=f>>>12&127,t[a++]=f>>>19&127,t[a++]=(f>>>26|(h&1)<<6)&127,t[a++]=h>>>1&127,t[a++]=h>>>8&127,t[a++]=h>>>15&127,t[a++]=h>>>22&127,t[a++]=(h>>>29|(d&15)<<3)&127,t[a++]=d>>>4&127,t[a++]=d>>>11&127,t[a++]=d>>>18&127,t[a++]=d>>>25&127}}function Ure(e,r,t,i){let a=i,o=r;for(let s=0;s<8;s++){let l=e[o++]>>>0,n=e[o++]>>>0,u=e[o++]>>>0,c=e[o++]>>>0,f=e[o++]>>>0,h=e[o++]>>>0,d=e[o++]>>>0,p=e[o++]>>>0;t[a++]=l>>>0&255,t[a++]=l>>>8&255,t[a++]=l>>>16&255,t[a++]=l>>>24&255,t[a++]=n>>>0&255,t[a++]=n>>>8&255,t[a++]=n>>>16&255,t[a++]=n>>>24&255,t[a++]=u>>>0&255,t[a++]=u>>>8&255,t[a++]=u>>>16&255,t[a++]=u>>>24&255,t[a++]=c>>>0&255,t[a++]=c>>>8&255,t[a++]=c>>>16&255,t[a++]=c>>>24&255,t[a++]=f>>>0&255,t[a++]=f>>>8&255,t[a++]=f>>>16&255,t[a++]=f>>>24&255,t[a++]=h>>>0&255,t[a++]=h>>>8&255,t[a++]=h>>>16&255,t[a++]=h>>>24&255,t[a++]=d>>>0&255,t[a++]=d>>>8&255,t[a++]=d>>>16&255,t[a++]=d>>>24&255,t[a++]=p>>>0&255,t[a++]=p>>>8&255,t[a++]=p>>>16&255,t[a++]=p>>>24&255}}function qre(e,r,t,i){let a=i,o=r;for(let s=0;s<128;s++){let l=e[o++]>>>0;t[a++]=l&65535,t[a++]=l>>>16&65535}}function Vre(e,r,t,i,a){let o=Hb[a]>>>0,s=r,l=0,n=e[s]>>>0,u=i;for(let c=0;c<8;c++){for(let f=0;f<32;f++)if(l+a<=32){let h=n>>>l&o;t[u+f]=h|0,l+=a,l===32&&(l=0,s++,f!==31&&(n=e[s]>>>0))}else{let h=32-l,d=n>>>l;s++,n=e[s]>>>0;let p=a-h,g=-1>>>32-p>>>0,m=(d|(n&g)<>>0)}}function NF(){let e=new Uint8Array(f5);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Gre(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);let r=Math.max(16,e|0);return{encodedWords:new Uint32Array(r),decoderWorkspace:NF()}}function Hre(e,r){if(r<=e.encodedWords.length)return e.encodedWords;let t=new Uint32Array(Math.max(16,r*2));return e.encodedWords=t,t}function $re(e,r,t,i){i.byteContainer.length>>2;if(a.byteOffset&3)for(let l=0;l>>8&255,a[u+2|0]=n>>>16&255,a[u+3|0]=n>>>24&255}else{let l=i.byteContainerI32;(!l||l.buffer!==a.buffer||l.byteOffset!==a.byteOffset||l.length>>2)),l.set(e.subarray(r,r+o))}let s=t&3;if(s>0){let l=e[r+o|0]|0,n=o<<2;for(let u=0;u>>(u<<3)&255}return a}function Wre(e,r,t){let i=e[r++]|0,a=t.dataToBePacked;for(let o=2;o<=32;o=o+1|0){if(!(i>>>o-1&1))continue;if(r>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${o}, streamWordIndex=${r}, needWords=1, availableWords=${e.length-r}, encodedWords=${e.length})`);let s=e[r++]>>>0,l=_re(s),n=s*o+31>>>5;if(r+n>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${o}, size=${s}, streamWordIndex=${r}, needWords=${n}, availableWords=${e.length-r}, encodedWords=${e.length})`);let u=a[o];(!u||u.length>>5)|0,t.exceptionSizes[o]=s}return r}function Yre(e,r,t,i,a){switch(a){case 1:Ire(e,r,t,i);break;case 2:Rre(e,r,t,i);break;case 3:zre(e,r,t,i);break;case 4:Bre(e,r,t,i);break;case 5:Ore(e,r,t,i);break;case 6:Nre(e,r,t,i);break;case 7:jre(e,r,t,i);break;case 8:Ure(e,r,t,i);break;case 16:qre(e,r,t,i);break;default:Vre(e,r,t,i,a)}return r+(a<<3)|0}function Xre(e,r,t,i){if(t+2>r)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${t}, byteSize=${r})`);let a=e[t++],o=e[t++];if(a>32)throw Error(`FastPFOR decode: invalid bitWidth=${a} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:a,exceptionCount:o,bytePosIn:t}}function Zre(e,r,t,i,a,o){if(t+1>r)throw Error(`FastPFOR decode: exception header underflow at block=${o} (need 1 byte for maxBits, bytePos=${t}, byteSize=${r})`);let s=e[t++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${o} (bitWidth=${i}, expected ${i}..32)`);let l=s-i|0;if(l<1||l>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${l} at block=${o} (bitWidth=${i}, maxBits=${s})`);if(t+a>r)throw Error(`FastPFOR decode: exception positions underflow at block=${o} (need=${a}, have=${r-t})`);return{maxBits:s,exceptionBitWidth:l,bytePosIn:t}}function Kre(e,r,t,i,a,o,s,l,n){let{maxBits:u,exceptionBitWidth:c,bytePosIn:f}=Zre(a,o,s,t,i,n);if(s=f,c===1){let m=1<g)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${c} (ptr=${p}, need ${i}, size=${g}) at block ${n}`);for(let m=0;m0&&(f=Kre(a,m,p,g,l,n,f,u,h))}if(c!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${r}, packedStart=${t}, consumedPackedEnd=${c}, expectedPackedEnd=${i}, packedWords=${i-t}, encoded.length=${e.length})`)}function Qre(e,r,t,i,a,o){let s=t|0,l=e[s]|0;if(l<=0||s+l>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${l} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let n=s+1|0,u=s+l|0,c=e[u]>>>0,f=c+3>>>2,h=u+1,d=h+f;if(d>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${c} (metaInts=${f}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${h}) causes bitmapPos=${d} out of bounds (encoded.length=${e.length})`);let p=$re(e,h,c,o),g=c,m=Wre(e,d,o);return o.dataPointers.fill(0),Jre(e,s,n,u,r,i|0,a/256|0,p,g,o),m}function eie(e,r,t,i,a,o){let s=i+W6(a,256),l=i,n=t;for(;l!==s;){let u=Math.min($b,s-l);n=Qre(e,r,n,l,u,o),l=l+u|0}return n}function tie(e,r,t,i,a,o){if(o===0)return r;let s=0,l=r,n=r+t,u=a,c=a,f=a+o,h=0,d=0;for(;l>>s&255;if(s+=8,l+=s>>>5,s&=31,h|=(p&127)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${d}, partial=${h}, decoded=${c-u}/${o}, inPos=${l}, inEnd=${n})`)}if(c!==f)throw Error(`FastPFOR VByte: truncated stream (decoded=${c-u}, expected=${o}, consumedWords=${l-r}/${t}, vbyteStart=${r}, vbyteEnd=${n})`);return l}function rie(e,r,t){let i=0,a=0,o=new Uint32Array(r),s=t??NF();if(e.length>0){let u=e[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(a+u>o.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${a}, alignedLength=${u}, out.length=${o.length})`);i=eie(e,o,i,a,u,s),a=a+u|0}let l=e.length-i|0,n=r-a|0;return tie(e,i,l,o,a,n),o}function iie(e,r,t,i,a){switch(a){case 2:wre(e,r,t,i);return;case 3:Tre(e,r,t,i);return;case 4:Are(e,r,t,i);return;case 5:Mre(e,r,t,i);return;case 6:Sre(e,r,t,i);return;case 7:Ere(e,r,t,i);return;case 8:kre(e,r,t,i);return;case 9:Cre(e,r,t,i);return;case 10:Dre(e,r,t,i);return;case 11:Lre(e,r,t,i);return;case 12:Fre(e,r,t,i);return;case 16:Pre(e,r,t,i);return;case 32:for(let u=0;u<32;u=u+1|0)t[i+u|0]=e[r+u|0]|0;return}let o=Hb[a]>>>0,s=r,l=0,n=e[s]>>>0;for(let u=0;u<32;u++)if(l+a<=32){let c=n>>>l&o;t[i+u]=c|0,l+=a,l===32&&(l=0,s++,u!==31&&(n=e[s]>>>0))}else{let c=32-l,f=n>>>l;s++,n=e[s]>>>0;let h=Hb[a-c]>>>0,d=(f|(n&h)<e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${r}, byteLength=${t}, bytes.length=${e.length})`);let a=Math.floor(t/4),o=t%4!=0,s=o?a+1:a;if(i.length0){let l=e.byteOffset+r;if(l&3)for(let n=0;n=64)throw Error("Varint too long")}return r.set(a),t}function oie(e,r,t){let i=new Float64Array(t);for(let a=0;a>4,a<128||(a=r[t.get()],t.increment(),i|=(a&127)<<3,a<128)||(a=r[t.get()],t.increment(),i|=(a&127)<<10,a<128)||(a=r[t.get()],t.increment(),i|=(a&127)<<17,a<128)||(a=r[t.get()],t.increment(),i|=(a&127)<<24,a<128)||(a=r[t.get()],t.increment(),i|=(a&1)<<31,a<128))return i*4294967296+(e>>>0);throw Error("Expected varint not more than 10 bytes")}function uie(e,r,t,i){return cie(e,r,t,i,Gre(t>>>2))}function cie(e,r,t,i,a){let o=i.get();if(t&3)throw Error(`FastPFOR: invalid encodedByteLength=${t} at offset=${o} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=t>>>2,l=Hre(a,s);aie(e,o,t,l);let n=rie(l.subarray(0,s),r,a.decoderWorkspace);return i.add(t),n}function No(e){return e>>>1^-(e&1)}function Qu(e){return e>>BigInt("1")^-(e&BigInt("1"))}function Hp(e){return e%2==1?(e+1)/-2:e/2}function fie(e){let r=new Int32Array(e.length);for(let t=0;t=4)for(;i=4)for(;i=4)for(;t=4)for(let i=e[0];t=4)for(;i=4)for(;n>>0;for(let t=1;t>>0;return r}function HF(e){let r=new BigUint64Array(e.length);r[0]=BigInt.asUintN(64,Qu(e[0]));for(let t=1;t>>0,r[1]=No(e[1])>>>0;for(let t=2;t>>0,r[t+1]=r[t-1]+No(e[t+1])>>>0;return r}function Sie(e,r,t,i){let a=VF(e,r,t,i);return new Uint32Array(a)}function Eie(e){return e[1]}function kie(e){return No(e[1])}function Cie(e){if(e.length===2){let r=No(e[1]);return[r,r]}return[No(e[2]),No(e[3])]}function Die(e){return e[1]}function Lie(e){return Qu(e[1])}function Fie(e){if(e.length===2){let r=Qu(e[1]);return[r,r]}return[Qu(e[2]),Qu(e[3])]}function Ys(e,r){let t=Rie(e,r);return t.logicalLevelTechnique1===fo.MORTON?Pie(t,e,r):(fo.RLE===t.logicalLevelTechnique1||fo.RLE===t.logicalLevelTechnique2)&&Of.NONE!==t.physicalLevelTechnique?Iie(t,e,r):t}function Pie(e,r,t){let i=Ju(r,t,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:e.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function Iie(e,r,t){let i=Ju(r,t,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function Rie(e,r){let t=e[r.get()],i=h5[t>>4],a={};switch(i){case El.DATA:a={dictionaryType:p5[t&15]};break;case El.OFFSET:a={offsetType:v5[t&15]};break;case El.LENGTH:a={lengthType:m5[t&15]}}r.increment();let o=e[r.get()],s=DA[o>>5],l=DA[o>>2&7],n=d5[o&3];r.increment();let u=Ju(e,r,2),c=u[0],f=u[1];return{physicalStreamType:i,logicalStreamType:a,logicalLevelTechnique1:s,logicalLevelTechnique2:l,physicalLevelTechnique:n,numValues:c,byteLength:f,decompressedCount:c}}function G0(e,r,t){if(!r)return e;let i=r.size(),a=e.constructor,o=new a(i),s=0;for(let l=0;l=s);){let l=e[i.increment()];if(l<=127){let n=l+3,u=e[i.increment()],c=Math.min(o+n,r);a.fill(u,o,c),o=c}else{let n=256-l;for(let u=0;u=12?g5.decode(e.subarray(r,t)):jie(e,r,t)}function jie(e,r,t){let i="",a=r;for(;a239?4:o>223?3:o>191?2:1;if(a+l>t)break;let n,u,c;l===1?o<128&&(s=o):l===2?(n=e[a+1],(n&192)==128&&(s=(o&31)<<6|n&63,s<=127&&(s=null))):l===3?(n=e[a+1],u=e[a+2],(n&192)==128&&(u&192)==128&&(s=(o&15)<<12|(n&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):l===4&&(n=e[a+1],u=e[a+2],c=e[a+3],(n&192)==128&&(u&192)==128&&(c&192)==128&&(s=(o&15)<<18|(n&63)<<12|(u&63)<<6|c&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,l=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),a+=l}return i}function xx(e,r,t,i,a){return Hie(dm(e,r,t),t,i,a)}function ec(e,r,t,i,a){return $ie(dm(e,r,t),t,i,a)}function Wp(e,r,t){return Yie(dm(e,r,t),t)}function dm(e,r,t){let i=t.physicalLevelTechnique;switch(i){case Of.FAST_PFOR:return uie(e,t.numValues,t.byteLength,r);case Of.VARINT:return Ju(e,r,t.numValues);case Of.NONE:return Oie(e,r,t.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function hg(e,r,t){let i=t.physicalLevelTechnique;switch(i){case Of.VARINT:return Y6(e,r,t.numValues);case Of.NONE:return Nie(e,r,t.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function Uie(e,r,t){let i=dm(e,r,t);return i.length===1?No(i[0]):kie(i)}function Q6(e,r,t){let i=dm(e,r,t);return i.length===1?t.logicalLevelTechnique1===fo.DELTA?No(i[0]):i[0]:Eie(i)}function XF(e,r,t){return Cie(dm(e,r,t))}function ZF(e,r,t){return Fie(Y6(e,r,t.numValues))}function KF(e,r,t,i){return QF(hg(e,r,t),t,i)}function eT(e,r,t,i){return eP(hg(e,r,t),t,i)}function qie(e,r,t,i){let a=Vie(e,r,t,!1);return i?G0(a,i,0):a}function Vie(e,r,t,i){if(t.physicalLevelTechnique===Of.VARINT)return Wie(oie(e,r,t.numValues),t,i);let a=hg(e,r,t),o=i?QF(a,t):eP(a,t);return Float64Array.from(o,Number)}function Gie(e,r,t){let i=hg(e,r,t);return i.length===1?Qu(i[0]):Lie(i)}function JF(e,r,t){let i=hg(e,r,t);return i.length===1?t.logicalLevelTechnique1===fo.DELTA?Qu(i[0]):i[0]:Die(i)}function Hie(e,r,t,i){let a;switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let o=r;if(!i)return Tie(e,o.runs,o.numRleValues);e=X6(e,o.runs,o.numRleValues),a=UF(e)}else a=UF(e);break;case fo.RLE:a=vie(e,r.runs,r.numRleValues);break;case fo.MORTON:K6(e),a=new Int32Array(e);break;case fo.COMPONENTWISE_DELTA:if(t&&!i)return VF(e,t.scale,t.min,t.max);a=_ie(e);break;case fo.NONE:a=fie(e);break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return i?G0(a,i,0):a}function $ie(e,r,t,i){let a;switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let o=r;a=GF(X6(e,o.runs,o.numRleValues))}else a=GF(e);break;case fo.RLE:a=X6(e,r.runs,r.numRleValues);break;case fo.MORTON:K6(e),a=e;break;case fo.COMPONENTWISE_DELTA:a=t&&!i?Sie(e,t.scale,t.min,t.max):Mie(e);break;case fo.NONE:a=e;break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return i?G0(a,i,0):a}function QF(e,r,t){let i;switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let a=r;if(!t)return Aie(e,a.runs,a.numRleValues);e=Z6(e,a.runs,a.numRleValues),i=qF(e)}else i=qF(e);break;case fo.RLE:i=mie(e,r.runs,r.numRleValues);break;case fo.NONE:i=hie(e);break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return t?G0(i,t,BigInt("0")):i}function eP(e,r,t){let i;switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let a=r;i=HF(Z6(e,a.runs,a.numRleValues))}else i=HF(e);break;case fo.RLE:i=Z6(e,r.runs,r.numRleValues);break;case fo.NONE:i=e;break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return t?G0(i,t,BigInt("0")):i}function Wie(e,r,t){switch(r.logicalLevelTechnique1){case fo.DELTA:if(r.logicalLevelTechnique2===fo.RLE){let i=r;e=jF(e,i.runs,i.numRleValues)}return pie(e),e;case fo.RLE:return Zie(e,r,t);case fo.NONE:return t&&die(e),e;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}}function Yie(e,r){if(r.logicalLevelTechnique1===fo.DELTA&&r.logicalLevelTechnique2===fo.NONE)return xie(e);if(r.logicalLevelTechnique1===fo.RLE&&r.logicalLevelTechnique2===fo.NONE){let t=r;return wie(e,t.runs,t.numRleValues)}if(r.logicalLevelTechnique1===fo.NONE&&r.logicalLevelTechnique2===fo.NONE){yie(e);let t=new Uint32Array(r.numValues+1);return t[0]=0,t.set(e,1),t}if(r.logicalLevelTechnique1===fo.DELTA&&r.logicalLevelTechnique2===fo.RLE){let t=r,i=bie(e,t.runs,t.numRleValues);return K6(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function bx(e,r,t,i,a="int32"){let o=e.logicalLevelTechnique1;if(o===fo.RLE)return e.runs===1?js.CONST:js.FLAT;if(o!==fo.DELTA||e.logicalLevelTechnique2!==fo.RLE)return e.numValues===1?js.CONST:js.FLAT;let s=r instanceof _h?r.size():r,l=e;if(l.numRleValues!==s)return js.FLAT;if(l.runs===1)return js.SEQUENCE;if(l.runs!==2)return e.numValues===1?js.CONST:js.FLAT;let n=i.get();if(e.physicalLevelTechnique===Of.VARINT)return Xie(t,i,a)?js.SEQUENCE:e.numValues===1?js.CONST:js.FLAT;let u=i.get(),c=new Int32Array(t.buffer,t.byteOffset+u,4);return i.set(n),c[2]===2&&c[3]===2?js.SEQUENCE:e.numValues===1?js.CONST:js.FLAT}function Xie(e,r,t){let i=new kA(r.get());if(t==="int64"){let o=Y6(e,i,4);return o[2]===BigInt("2")&&o[3]===BigInt("2")}let a=Ju(e,i,4);return a[2]===2&&a[3]===2}function Zie(e,r,t){return t?gie(e,r.runs,r.numRleValues):jF(e,r.runs,r.numRleValues)}function tT(e,r,t){return{x:tP(e,r)-t,y:tP(e>>1,r)-t}}function tP(e,r){let t=0;for(let i=0;i>i;return t}function Kie(e){let r=Array(e.numGeometries),t=1,i=1,a=1,o=0,s=0,l=0,n=e.mortonSettings,u=e.topologyVector,c=u.geometryOffsets,f=u.partOffsets,h=u.ringOffsets,d=e.vertexOffsets,p=!d||d.length===0,g=e.containsPolygonGeometry(),m=e.vertexBuffer;for(let y=0;y[S]),t+=v,i+=v}break;case Du.LINESTRING:{let v;g?(v=h[i]-h[i-1],i++):v=f[t]-f[t-1],t++;let x;p?(x=pm(m,s,v,!1),s+=v*2):(x=H0(e.vertexBufferType,m,d,l,v,!1,n),l+=v),r[o++]=[x],c&&a++}break;case Du.POLYGON:{let v=f[t]-f[t-1];t++;let x=Array(v-1),S,M=h[i]-h[i-1];if(i++,p){S=pm(m,s,M,!0),s+=M*2;for(let C=0;Ct?r[o++]:1);return i}function nP(e,r,t,i){let a=new Uint32Array(r[r.length-1]+1),o=0;a[0]=o;let s=1,l=0;for(let n=0;n0;)a[o++]=e[u++]}}return a}function oP(e,r,t,i,a){var o,s;let l,n,u,c,f,h=a,d,p;for(let g=0;g1&&!d.nullable||p===1&&d.nullable)throw Error(`The number of streams for the child field ${d.name} does not match its nullability. nullibilty: ${d.nullable}, numStreams: ${p}`);let m;if(d.nullable){let _=Ys(e,r);m=new _h(hm(e,_.numValues,_.byteLength,r),_.numValues)}let y=ec(e,r,Ys(e,r),void 0,m);if(l){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${g}"`);c[h++]=new NA(g,y,a,o,s,l,m,f)}else c[h++]=new Q0(g,y,a,o,m)}return c}function hae(e,r,t,i){let a=dae(t);if(i===0)return a.map(c=>new jA(c,[]));let o=pae(e,r,i),s=(o.presentStream?o.presentCount:o.lengthStream.length)/a.length,l=[],n=0,u=0;for(let c=0;c{var i;return e.name+((i=t.name)!=null?i:"")})}function pae(e,r,t){let i=e[r.get()];r.add(1);let a=ec(e,r,Ys(e,r)),o=t-1,s=[];i&Rd.STRING&&(o-=vae(e,r,s)),o-=mae(e,r,i,s),o-=gae(e,r,i,s);let l,n=0;if(i&Rd.PRESENCE){let c=yae(e,r);l=c.value,n=c.count,o--}let u=new Uint32Array;if(o>0&&(u=ec(e,r,Ys(e,r)),o--),o!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${o}`);return{lengthStream:a,dictionary:s,presentStream:l,presentCount:n,flattenedValues:u}}function vae(e,r,t){let i=e[r.get()];r.add(1);let a=oP("",e,r,i);if(a)for(let o=0;oo.length)throw Error("Merged map counts underflow while decoding child streams");let d=Array(t),p=i,g=a;for(let _=0;_s.length)throw Error("Map value stream underflow while decoding feature payload");let x=xae(s,g,v,n);d[_]=x.value,g=x.nextIndex}let m=0;for(let _=i;_=t)throw Error("Unexpected end of map value stream");let a=e[r];if(a===r0.FALSE)return{value:!1,nextIndex:r+1};if(a===r0.TRUE)return{value:!0,nextIndex:r+1};if(a===r0.START_MAP){let o=lP(e,r,t);return{value:sP(e,r+2,o,i).value,nextIndex:o}}if(a===r0.START_LIST){let o=lP(e,r,t),s=[],l=r+2;for(;l=t)throw Error("Missing length for nested map/list payload");let i=e[r+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let a=r+i;if(a>t)throw Error("Nested payload exceeds containing payload bounds");return a}function uP(e,r){let t=e-r0.COUNT;if(t<0||t>=r.length)throw Error(`Scalar dictionary index out of range: ${e}`);return r[t]}function vm(e,r){for(let t of r)e.push(t)}function bae(e,r,t,i,a,o){var s;return t.type==="scalarType"?o&&!o.has(t.name)?($F(i,e,r),null):wae(i,e,r,a,t.scalarType,t):((s=t.complexType)==null?void 0:s.physicalType)===fp.MAP?hae(e,r,t,i):i===0?null:fae(e,r,t,o)}function wae(e,r,t,i,a,o){var s;let l;if(e===0)return null;if(o.nullable){let u=Ys(r,t),c=u.numValues,f=t.get(),h=hm(r,c,u.byteLength,t);t.set(f+u.byteLength),l=new _h(h,u.numValues)}let n=l??i;switch(a.physicalType){case Wo.UINT_32:case Wo.INT_32:return Eae(r,t,o,a,n);case Wo.STRING:{let u=o.nullable?e-1:e;return(s=oP(o.name,r,t,u,l))!=null?s:null}case Wo.BOOLEAN:return Tae(r,t,o,i,n);case Wo.UINT_64:case Wo.INT_64:return Sae(r,t,o,n,a);case Wo.FLOAT:return Aae(r,t,o,n);case Wo.DOUBLE:return Mae(r,t,o,n);default:throw Error(`The specified data type for the field is currently not supported: ${a}`)}}function Tae(e,r,t,i,a){let o=Ys(e,r),s=o.numValues,l=r.get(),n=dg(a)?a:void 0,u=hm(e,s,o.byteLength,r,n);r.set(l+o.byteLength);let c=new _h(u,s);return new b5(t.name,c,a)}function Aae(e,r,t,i){let a=Ys(e,r),o=dg(i)?i:void 0,s=WF(e,r,a.numValues,o);return new w5(t.name,s,i)}function Mae(e,r,t,i){let a=Ys(e,r),o=dg(i)?i:void 0,s=YF(e,r,a.numValues,o);return new Ub(t.name,s,i)}function Sae(e,r,t,i,a){let o=Ys(e,r),s=bx(o,i,e,r,"int64"),l=a.physicalType===Wo.INT_64;if(s===js.FLAT){let u=dg(i)?i:void 0,c=l?KF(e,r,o,u):eT(e,r,o,u);return new LA(t.name,c,i)}if(s===js.SEQUENCE){let u=ZF(e,r,o);return new FA(t.name,u[0],u[1],o.numRleValues,l)}let n=l?Gie(e,r,o):JF(e,r,o);return new BA(t.name,n,i,l)}function Eae(e,r,t,i,a){let o=Ys(e,r),s=bx(o,a,e,r),l=i.physicalType===Wo.INT_32;if(s===js.FLAT){let u=dg(a)?a:void 0,c=l?xx(e,r,o,void 0,u):ec(e,r,o,void 0,u);return new jb(t.name,c,a)}if(s===js.SEQUENCE){let u=XF(e,r,o);return new qb(t.name,u[0],u[1],o.numRleValues,l)}let n=l?Uie(e,r,o):Q6(e,r,o);return new Vb(t.name,n,a,l)}function dg(e){return e instanceof _h}function cP(e){switch(e){case tu.ID:case tu.ID|tu.ID_NULLABLE:case tu.ID|tu.ID_LONG:case tu.ID|tu.ID_LONG|tu.ID_NULLABLE:return{nullable:(e&tu.ID_NULLABLE)!==0,columnScope:Bm.FEATURE,type:"scalarType",scalarType:{longID:(e&tu.ID_LONG)!==0,type:"logicalType",logicalType:EA.ID}};case tu.GEOMETRY:return{nullable:!1,columnScope:Bm.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:fp.GEOMETRY,children:[]}};case tu.STRUCT:return{nullable:!1,columnScope:Bm.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:fp.STRUCT,children:[]}};case tu.MAP:return{nullable:!0,columnScope:Bm.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:fp.MAP,children:[]}};default:return Fae(e)}}function kae(e){return e>=tu.SCALAR_BASE}function fP(e){return e===tu.STRUCT||e===tu.MAP}function Cae(e){if(e.type==="scalarType"){let r=e.scalarType;if(r.type==="physicalType")switch(r.physicalType){case Wo.BOOLEAN:case Wo.INT_8:case Wo.UINT_8:case Wo.INT_32:case Wo.UINT_32:case Wo.INT_64:case Wo.UINT_64:case Wo.FLOAT:case Wo.DOUBLE:return!1;case Wo.STRING:return!0;default:return!1}if(r.type==="logicalType")return!1}else if(e.type==="complexType"){let r=e.complexType;if(r.type==="physicalType")switch(r.physicalType){case fp.GEOMETRY:case fp.STRUCT:case fp.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",e),!1}function Dae(e){var r;return e.type==="scalarType"&&((r=e.scalarType)==null?void 0:r.type)==="logicalType"&&e.scalarType.logicalType===EA.ID}function Lae(e){var r;return e.type==="complexType"&&((r=e.complexType)==null?void 0:r.type)==="physicalType"&&e.complexType.physicalType===fp.GEOMETRY}function Fae(e){let r;switch(e){case 10:case 11:r=Wo.BOOLEAN;break;case 12:case 13:r=Wo.INT_8;break;case 14:case 15:r=Wo.UINT_8;break;case 16:case 17:r=Wo.INT_32;break;case 18:case 19:r=Wo.UINT_32;break;case 20:case 21:r=Wo.INT_64;break;case 22:case 23:r=Wo.UINT_64;break;case 24:case 25:r=Wo.FLOAT;break;case 26:case 27:r=Wo.DOUBLE;break;case 28:case 29:r=Wo.STRING;break;default:return null}return{nullable:!!(e&1),columnScope:Bm.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:r}}}function aT(e,r){let t=Ju(e,r,1)[0];if(t===0)return"";let i=r.get(),a=i+t,o=e.subarray(i,a);return r.add(t),T5.decode(o)}function Pae(e){let r=e.name,t=e.nullable;return e.type==="scalarType"?{type:"scalarField",scalarField:e.scalarType,name:r,nullable:t}:{type:"complexField",complexField:e.complexType,name:r,nullable:t}}function hP(e,r){let t=Ju(e,r,1)[0]>>>0,i=t>=tu.SCALAR_BASE?cP(t):null;if(!i)throw Error(`Unsupported field type code ${t}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let a=ar(Nt({},i),{name:aT(e,r)});if(a.type==="complexType"&&fP(t)){let o=a.complexType,s=Ju(e,r,1)[0]>>>0;o.children=Array(s);for(let l=0;l>>0,i=cP(t);if(!i)throw Error(`Unsupported column type code ${t}. Supported: ${UA}`);let a;if(kae(t))a=aT(e,r);else if(t>>0,l=o.complexType;l.children=Array(s);for(let n=0;n>>0,o=Ju(e,r,1)[0]>>>0;i.columns=Array(o);for(let s=0;s>>0,s=i.get()+o;if(s>e.length)throw Error(`Block overruns tile: ${s} > ${e.length}`);let l=Ju(e,i,1)[0]>>>0;if(l!==1&&l!==2){i.set(s);continue}let[n,u]=Rae(e,i),c=n.featureTables[0],f=null,h=null,d=[],p=0;for(let m of c.columns){let y=m.name;if(Dae(m)){let _=null;if(m.nullable){let x=Ys(e,i),S=i.get(),M=hm(e,x.numValues,x.byteLength,i);i.set(S+x.byteLength),_=new _h(M,x.numValues)}let v=Ys(e,i);p=_?_.size():v.decompressedCount,f=Bae(e,m,i,y,v,_??p,t)}else if(Lae(m)){let _=Ju(e,i,1)[0];if(p===0){let v=i.get();p=Ys(e,i).decompressedCount,i.set(v)}r&&(r.scale=r.extent/u),h=iae(e,_,i,p,r)}else{let _=Cae(m)?Ju(e,i,1)[0]:1;if(_===0)continue;let v=bae(e,i,m,_,p,void 0);if(v)if(Array.isArray(v))for(let x of v)d.push(x);else d.push(v)}}let g=new c5(c.name,h,f,d,u);a.push(g),i.set(s)}return a}function Bae(e,r,t,i,a,o,s=!1){var l;let n=(l=r.scalarType)!=null&&l.longID?Wo.UINT_64:Wo.UINT_32,u=typeof o=="number"?void 0:o,c=bx(a,o,e,t,n===Wo.UINT_64?"int64":"int32");if(n===Wo.UINT_32)switch(c){case js.FLAT:return new jb(i,ec(e,t,a,void 0,u),o);case js.SEQUENCE:{let f=XF(e,t,a);return new qb(i,f[0],f[1],a.numRleValues,!1)}case js.CONST:return new Vb(i,Q6(e,t,a),o,!1)}switch(c){case js.FLAT:return s?new Ub(i,qie(e,t,a,u),o):new LA(i,eT(e,t,a,u),o);case js.SEQUENCE:{let f=ZF(e,t,a);return new FA(i,f[0],f[1],a.numRleValues,!1)}case js.CONST:return new BA(i,JF(e,t,a),o,!1)}throw Error("Vector type not supported for id column.")}function Oae(e){return typeof e=="object"&&!!e&&"evaluate"in e}function dP(e,r,t,i,a){return $4(e,(o,s)=>{let l=r instanceof Sg?r.get(s):null;return Oae(l)?l.evaluate(t,i,void 0,a):l})}function Nae(e,r){return r-e}var pP,nT,vP,mP,gP,oT,wx,yP,_P,Tx,Ax,Ql,Mx,Wh,Ed,pg,xP,sT,lT,bP,Bi,Sx,wP,uT,Ex,TP,AP,Yh,cT,fT,hT,mm,ff,kx,gm,MP,vg,mg,dT,SP,hf,Ln,Nl,pT,mi,EP,na,ym,Ra,so,Ao,ph,gg,Yp,co,kP,yg,_m,_g,xm,xg,bm,bg,CP,vT,mT,gT,Cx,yT,DP,LP,FP,PP,Gc,ro,IP,Dx,kd,Xh,Zh,If,Xs,RP,Kh,Jh,sp,Lx,$0,zP,_T,Fx,Rf,Zs,xT,wg,Cd,bT,W0,wT,TT,BP,OP,NP,jP,UP,qP,AT,VP,GP,HP,$P,WP,YP,MT,XP,ZP,KP,Qh,Px,ST,ET,Ix,Rx,JP,zx,Y0,ed,QP,kT,Xp,Bx,Ox,wm,Tg,CT,eI,DT,LT,tI,FT,rI,iI,Hc,PT,Nx,Dd,jx,ns,Ux,Ag,qx,Mg,IT,RT,aI,zf,Sg,Ha,Fn,Tm,zT,Eg,vu,BT,Vx,vh,nI,oI,sI,Gx,lI,uI,Am,il,Mm,kg,Hx,$x,Wx,Sm,Yx,Xx,Zx,Kx,Jx,Qx,eb,tb,rb,Cg,ib,ab,Dg,nb,ob,sb,lb,ub,OT,NT,jT,UT,qT,VT,GT,HT,$T,WT,YT,XT,lp,cI,fI,hI,dI,pI,vI,mI,X0,ZT,gI,yI,_I,KT,xI,bI,wI,td,cb,TI,fb,AI,Ks,MI,SI,EI,kI,hb,JT,Ld,En,Xa,mo,vc,Em,up,QT,eA,CI,mh,km,Zp,Fd,gh,cp,tA,rA,iA,Kp,db,aA,nA,pb,DI,LI,FI,PI,II,RI,zI,oA,BI,OI,NI,vb,zs,Lg,jI,UI,qI,VI,GI,HI,$I,WI,YI,XI,jl,Cm,ZI,KI,JI,mb,QI,Dm,gb,yb,yl,Fg,_b,xb,Bf,Lm,Jp,Fm,Pm,Pd,bb,wb,Im,Rm,eR,sA,tR,rR,iR,aR,nR,oR,sR,Tb,lR,uR,yh,cR,zm,fR,hR,mc,An,lA,Qo,Qp,Ab,uA,dR,pR,vR,mR,gR,yR,_R,jae,xR,bR,Mb,wR,Sb,TR,AR,cA,fA,hA,MR,SR,ER,kR,dA,CR,Eb,DR,LR,FR,PR,IR,pA,RR,Pg,zR,BR,OR,vA,NR,mA,gA,kb,Cb,Z0,jR,UR,Db,Lb,qR,VR,GR,Fb,Uae,yA,_A,Pb,HR,xA,bA,wA,K0,Ig,$R,J0,Ib,Rb,WR,zb,Bb,Rg,YR,XR,ZR,KR,Ob,TA,AA,JR,QR,e5,t5,r5,i5,a5,n5,o5,s5,l5,zg,Bg,Cu,Nb,Og,u5,MA,e0,Ng,jb,Ub,SA,qb,Vb,c5,Bm,Wo,fp,EA,kA,fo,Of,Gb,Hb,CA,$b,f5,El,gc,Id,eu,h5,DA,d5,p5,v5,m5,js,_h,g5,LA,FA,Du,y5,t0,PA,IA,RA,zA,_5,x5,b5,w5,BA,Wb,OA,Q0,NA,jA,Rd,r0,tu,T5,UA,A5,M5,S5,E5,k5,qae=Ir({"node_modules/maplibre-gl/dist/maplibre-gl-shared.mjs"(){pP=Object.create,nT=Object.defineProperty,vP=Object.getOwnPropertyDescriptor,mP=Object.getOwnPropertyNames,gP=Object.getPrototypeOf,oT=Object.prototype.hasOwnProperty,wx=(e,r)=>()=>(r||(e((r={exports:{}}).exports,r),e=null),r.exports),yP=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(var a=mP(r),o=0,s=a.length,l;or[n]).bind(null,l),enumerable:!(i=vP(r,l))||i.enumerable});return e},_P=(e,r,t)=>(t=e==null?{}:pP(gP(e)),yP(r||!e||!e.__esModule||!oT.call(e,"default")?nT(t,"default",{value:e,enumerable:!0}):t,e)),Wr.prototype={clone(){return new Wr(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,r){return this.clone()._rotateAround(e,r)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let r=e.x-this.x,t=e.y-this.y;return r*r+t*t},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,r){return Math.atan2(this.x*r-this.y*e,this.x*e+this.y*r)},_matMult(e){let r=e[0]*this.x+e[1]*this.y,t=e[2]*this.x+e[3]*this.y;return this.x=r,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let r=Math.cos(e),t=Math.sin(e),i=r*this.x-t*this.y,a=t*this.x+r*this.y;return this.x=i,this.y=a,this},_rotateAround(e,r){let t=Math.cos(e),i=Math.sin(e),a=r.x+t*(this.x-r.x)-i*(this.y-r.y),o=r.y+i*(this.x-r.x)+t*(this.y-r.y);return this.x=a,this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Wr},Wr.convert=function(e){if(e instanceof Wr)return e;if(Array.isArray(e))return new Wr(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new Wr(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")},Ql=typeof Float32Array<"u"?Float32Array:Array,Math.PI/180,180/Math.PI,Mx=PK,Wh=IK,Ed=d9,pg=np,(function(){var e=f9();return function(r,t,i,a,o,s){var l,n;for(t||(t=3),i||(i=0),n=a?Math.min(a*t+i,r.length):r.length,l=i;l.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(uf(e,a,o),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=1+s,lT(i,i))}})(),(function(){var e=p9(),r=p9();return function(t,i,a,o,s,l){return C_(e,i,s,l),C_(r,a,o,l),C_(t,e,r,2*l*(1-l)),t}})(),(function(){var e=u9();return function(r,t,i,a){return e[0]=i[0],e[3]=i[1],e[6]=i[2],e[1]=a[0],e[4]=a[1],e[7]=a[2],e[2]=-t[0],e[5]=-t[1],e[8]=-t[2],lT(r,XK(r,e))}})(),bP=ZK,(function(){var e=V4();return function(r,t,i,a,o,s){var l,n;for(t||(t=2),i||(i=0),n=a?Math.min(a*t+i,r.length):r.length,l=i;lXr(null,null,function*(){let t=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(t,r)}catch(i){throw Error(`Could not load image because of ${Zu(i).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),AP=e=>new Promise((r,t)=>{let i=new Image;i.onload=()=>{r(i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame(()=>i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=")},i.onerror=()=>t(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let a=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=URL.createObjectURL(a)}),Yh=85.051129,cT={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},fT={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},hT="AbortError",mm=class extends Error{constructor(e=hT){super(e instanceof Error?e.message:e),this.name=hT,e instanceof Error&&e.stack&&(this.stack=e.stack)}},ff={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""},kx="global-dispatcher",gm=class extends Error{constructor(e,r,t,i){super(`AJAXError: ${r} (${e}): ${t}`),this.status=e,this.statusText=r,this.url=t,this.body=i}},MP=e=>{var r;return e.startsWith("file:")||((r=X4())==null?void 0:r.startsWith("file:"))&&!/^\w+:/.test(e)},vg=function(e,r){return Xr(this,null,function*(){var t,i;if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let a=M9(e.url);if(a){let o=yield a(e,r);return!o.data&&e.type==="arrayBuffer"?yn(o,{data:new ArrayBuffer(0)}):o}if(Kv(self)&&((t=self.worker)!=null&&t.actor))return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:kx},r)}if(!MP(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return mJ(e,r);if(Kv(self)&&((i=self.worker)!=null&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:kx},r)}return gJ(e,r)})},mg=(e,r)=>vg(yn(e,{type:"json"}),r),dT=(e,r)=>vg(yn(e,{type:"arrayBuffer"}),r),SP=e=>{let r=window.document.createElement("video");return r.muted=!0,new Promise(t=>{r.onloadstart=()=>{t(r)};for(let i of e){let a=window.document.createElement("source");S9(i)||(r.crossOrigin="Anonymous"),a.src=i,r.appendChild(a)}})},hf=class{constructor(e,r={}){yn(this,r),this.type=e}},Ln=class extends hf{constructor(e,r={}){super("error",yn({error:e},r))}},Nl=class{on(e,r){return this._listeners||(this._listeners={}),E9(e,r,this._listeners),{unsubscribe:()=>{this.off(e,r)}}}off(e,r){return Z4(e,r,this._listeners),Z4(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners||(this._oneTimeListeners={}),E9(e,r,this._oneTimeListeners),this):new Promise(t=>this.once(e,t))}fire(e,r){var t,i,a,o,s,l;let n=typeof e=="string"?new hf(e,r||{}):e,u=n.type;if(this.listens(u)){n.target=this;let c=(a=(i=(t=this._listeners)==null?void 0:t[u])==null?void 0:i.slice())!=null?a:[];for(let d of c)d.call(this,n);let f=(l=(s=(o=this._oneTimeListeners)==null?void 0:o[u])==null?void 0:s.slice())!=null?l:[];for(let d of f)Z4(u,d,this._oneTimeListeners),d.call(this,n);let h=this._eventedParent;h&&(yn(n,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),h.fire(n))}else n instanceof Ln&&console.error(n.error);return this}listens(e){var r,t,i,a,o;return!!((t=(r=this._listeners)==null?void 0:r[e])!=null&&t.length||(a=(i=this._oneTimeListeners)==null?void 0:i[e])!=null&&a.length||(o=this._eventedParent)!=null&&o.listens(e))}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}},pT={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},mi=pT,EP=["type","source","source-layer","minzoom","maxzoom","filter","layout"],na=class{constructor(e,r,t,i,a="error"){this.message=(e?`${e}: `:"")+t,i&&(this.identifier=i),this.severity=a,r!=null&&r.__line__&&(this.line=r.__line__)}},ym={kind:"null"},Ra={kind:"number"},so={kind:"string"},Ao={kind:"boolean"},ph={kind:"color"},gg={kind:"projectionDefinition"},Yp={kind:"object"},co={kind:"value"},kP={kind:"error"},yg={kind:"collator"},_m={kind:"formatted"},_g={kind:"padding"},xm={kind:"colorArray"},xg={kind:"numberArray"},bm={kind:"resolvedImage"},bg={kind:"variableAnchorOffsetCollection"},CP=[ym,Ra,so,Ao,ph,gg,_m,Yp,pc(co),_g,xg,xm,bm,bg],vT=.96422,mT=.82521,gT=4/29,Cx=6/29,yT=3*Cx*Cx,DP=Math.PI/180,LP=180/Math.PI,FP=Object.hasOwn||function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},PP={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ro=(Gc=class{constructor(e,r,t,i=1,a=!0){this.r=e,this.g=r,this.b=t,this.a=i,a||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,r,t,i]))}static parse(e){if(e instanceof Gc)return e;if(typeof e!="string")return;let r=bJ(e);if(r)return new Gc(...r,!1)}get rgb(){let{r:e,g:r,b:t,a:i}=this,a=i||1/0;return this.overwriteGetter("rgb",[e/a,r/a,t/a,i])}get hcl(){return this.overwriteGetter("hcl",yJ(this.rgb))}get lab(){return this.overwriteGetter("lab",C9(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,t,i]=this.rgb;return`rgba(${[e,r,t].map(a=>Math.round(a*255)).join(",")},${i})`}static interpolate(e,r,t,i="rgb"){switch(i){case"rgb":{let[a,o,s,l]=Qv(e.rgb,r.rgb,t);return new Gc(a,o,s,l,!1)}case"hcl":{let[a,o,s,l]=e.hcl,[n,u,c,f]=r.hcl,h,d;if(!isNaN(a)&&!isNaN(n)){let _=n-a;n>a&&_>180?_-=360:n180&&(_+=360),h=a+t*_}else isNaN(a)?isNaN(n)?h=NaN:(h=n,(s===1||s===0)&&(d=u)):(h=a,(c===1||c===0)&&(d=o));let[p,g,m,y]=_J([h,d??Vp(o,u,t),Vp(s,c,t),Vp(l,f,t)]);return new Gc(p,g,m,y,!1)}case"lab":{let[a,o,s,l]=D9(Qv(e.lab,r.lab,t));return new Gc(a,o,s,l,!1)}}}},Gc.black=new Gc(0,0,0,1),Gc.white=new Gc(1,1,1,1),Gc.transparent=new Gc(0,0,0,0),Gc.red=new Gc(1,0,0,1),Gc),IP=["bottom","center","top"],Dx=class{constructor(e,r,t,i,a,o){this.text=e,this.image=r,this.scale=t,this.fontStack=i,this.textColor=a,this.verticalAlign=o}},kd=class cw{constructor(r){this.sections=r}static fromString(r){return new cw([new Dx(r,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(r=>r.text.length!==0||r.image&&r.image.name.length!==0)}static factory(r){return r instanceof cw?r:cw.fromString(r)}toString(){return this.sections.length===0?"":this.sections.map(r=>r.text).join("")}},Xh=class gy{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof gy)return r;if(typeof r=="number")return new gy([r,r,r,r]);if(Array.isArray(r)&&!(r.length<1||r.length>4)){for(let t of r)if(typeof t!="number")return;switch(r.length){case 1:r=[r[0],r[0],r[0],r[0]];break;case 2:r=[r[0],r[1],r[0],r[1]];break;case 3:r=[r[0],r[1],r[2],r[1]]}return new gy(r)}}toString(){return JSON.stringify(this.values)}static interpolate(r,t,i){return new gy(Qv(r.values,t.values,i))}},Zh=class yy{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof yy)return r;if(typeof r=="number")return new yy([r]);if(Array.isArray(r)){for(let t of r)if(typeof t!="number")return;return new yy(r)}}toString(){return JSON.stringify(this.values)}static interpolate(r,t,i){return new yy(Qv(r.values,t.values,i))}},If=class _y{constructor(r){this.values=r.slice()}static parse(r){if(r instanceof _y)return r;if(typeof r=="string"){let i=ro.parse(r);return i?new _y([i]):void 0}if(!Array.isArray(r))return;let t=[];for(let i of r){if(typeof i!="string")return;let a=ro.parse(i);if(!a)return;t.push(a)}return new _y(t)}toString(){return JSON.stringify(this.values)}static interpolate(r,t,i,a="rgb"){let o=[];if(r.values.length!=t.values.length)throw Error(`colorArray: Arrays have mismatched length (${r.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let s=0;s=l)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);let f=t.parse(n,c,o);if(!f)return null;o||(o=f.type),a.push([l,f])}return new Fj(o,i,a,t.key)}evaluate(r){let t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(r);let a=this.input.evaluate(r);if(a<=t[0])return i[0].evaluate(r);let o=t.length;return a>=t[o-1]?i[o-1].evaluate(r):i[R_(t,a,this.key)].evaluate(r)}eachChild(r){r(this.input);for(let t of this.outputs)r(t)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}},Rf=class rE{constructor(r,t,i,a,o,s){this.type=r,this.operator=t,this.interpolation=i,this.input=a,this.key=s,this.labels=[],this.outputs=[];for(let[l,n]of o)this.labels.push(l),this.outputs.push(n)}static interpolationFactor(r,t,i,a){let o=0;if(r.name==="exponential")o=r6(t,r.base,i,a);else if(r.name==="linear")o=r6(t,1,i,a);else if(r.name==="cubic-bezier"){let s=r.controlPoints;o=TJ(s[0],s[1],s[2],s[3])(r6(t,1,i,a))}return o}static parse(r,t){let[i,a,o,...s]=r;if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){let u=a[1];if(typeof u!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:u}}else if(a[0]==="cubic-bezier"){let u=a.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:u}}else return t.error(`Unknown interpolation type ${String(a[0])}`,1,0);if(r.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(o=t.parse(o,2,Ra),!o)return null;let l=[],n=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&t.expectedType!=xm?n=ph:t.expectedType&&t.expectedType.kind!=="value"&&(n=t.expectedType);for(let u=0;u=c)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);let p=t.parse(f,d,n);if(!p)return null;n||(n=p.type),l.push([c,p])}return!qp(n,Ra)&&!qp(n,gg)&&!qp(n,ph)&&!qp(n,_g)&&!qp(n,xg)&&!qp(n,xm)&&!qp(n,bg)&&!qp(n,pc(Ra))?t.error(`Type ${ll(n)} is not interpolatable.`):new rE(n,i,a,o,l,t.key)}evaluate(r){let t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(r);let a=this.input.evaluate(r);if(a<=t[0])return i[0].evaluate(r);let o=t.length;if(a>=t[o-1])return i[o-1].evaluate(r);let s=R_(t,a,this.key),l=t[s],n=t[s+1],u=rE.interpolationFactor(this.interpolation,a,l,n),c=i[s].evaluate(r),f=i[s+1].evaluate(r);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Vp(c,f,u);case"color":return ro.interpolate(c,f,u);case"padding":return Xh.interpolate(c,f,u);case"colorArray":return If.interpolate(c,f,u);case"numberArray":return Zh.interpolate(c,f,u);case"variableAnchorOffsetCollection":return Kh.interpolate(c,f,u,this.key);case"array":return Qv(c,f,u);case"projectionDefinition":return sp.interpolate(c,f,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return ro.interpolate(c,f,u,"hcl");case"colorArray":return If.interpolate(c,f,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return ro.interpolate(c,f,u,"lab");case"colorArray":return If.interpolate(c,f,u,"lab")}}}eachChild(r){r(this.input);for(let t of this.outputs)r(t)}outputDefined(){return this.outputs.every(r=>r.outputDefined())}},Zs={color:ro.interpolate,number:Vp,padding:Xh.interpolate,numberArray:Zh.interpolate,colorArray:If.interpolate,variableAnchorOffsetCollection:Kh.interpolate,array:Qv},xT=class Pj{constructor(r){this.type=_m,this.sections=r}static parse(r,t){if(r.length<2)return t.error("Expected at least one argument.");let i=r[1];if(!Array.isArray(i)&&typeof i=="object")return t.error("First argument must be an image or text section.");let a=[],o=!1;for(let s=1;s<=r.length-1;++s){let l=r[s];if(o&&typeof l=="object"&&!Array.isArray(l)){o=!1;let n=null;if(l["font-scale"]&&(n=t.parse(l["font-scale"],1,Ra),!n))return null;let u=null;if(l["text-font"]&&(u=t.parse(l["text-font"],1,pc(so)),!u))return null;let c=null;if(l["text-color"]&&(c=t.parse(l["text-color"],1,ph),!c))return null;let f=null;if(l["vertical-align"]){if(typeof l["vertical-align"]=="string"&&!IP.includes(l["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${l["vertical-align"]}' instead.`);if(f=t.parse(l["vertical-align"],1,so),!f)return null}let h=a[a.length-1];h.scale=n,h.font=u,h.textColor=c,h.verticalAlign=f}else{let n=t.parse(r[s],1,co);if(!n)return null;let u=n.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,a.push({content:n,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Pj(a)}evaluate(r){return new kd(this.sections.map(t=>{let i=t.content.evaluate(r);return Ml(i)===bm?new Dx("",i,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(r):null):new Dx(V1(i),null,t.scale?t.scale.evaluate(r):null,t.font?t.font.evaluate(r).join(","):null,t.textColor?t.textColor.evaluate(r):null,t.verticalAlign?t.verticalAlign.evaluate(r):null)}))}eachChild(r){for(let t of this.sections)r(t.content),t.scale&&r(t.scale),t.font&&r(t.font),t.textColor&&r(t.textColor),t.verticalAlign&&r(t.verticalAlign)}outputDefined(){return!1}},wg={string:so,number:Ra,boolean:Ao,object:Yp},Cd=class Ij{constructor(r,t,i){this.type=r,this.args=t,this.key=i}static parse(r,t){if(r.length<2)return t.error("Expected at least one argument.");let i=1,a,o=r[0];if(o==="array"){let l;if(r.length>2){let u=r[1];if(typeof u!="string"||!(u in wg)||u==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);l=wg[u],i++}else l=co;let n;if(r.length>3){if(r[2]!==null&&(typeof r[2]!="number"||r[2]<0||r[2]!==Math.floor(r[2])))return t.error('The length argument to "array" must be a positive integer literal',2);n=r[2],i++}a=pc(l,n)}else{if(!wg[o])throw Error(`Types doesn't contain name = ${o}`);a=wg[o]}let s=[];for(;ir.outputDefined())}},bT={"to-boolean":Ao,"to-color":ph,"to-number":Ra,"to-string":so},W0=class Rj{constructor(r,t,i){this.type=r,this.args=t,this.key=i}static parse(r,t){if(r.length<2)return t.error("Expected at least one argument.");let i=r[0];if(!bT[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&r.length!==2)return t.error("Expected one argument.");let a=bT[i],o=[];for(let s=1;s4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:P9(t[0],t[1],t[2],t[3]),!i))return new ro(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Xs(i||`Could not parse color from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"padding":{let t;for(let i of this.args){t=i.evaluate(r);let a=Xh.parse(t);if(a)return a}throw new Xs(`Could not parse padding from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"numberArray":{let t;for(let i of this.args){t=i.evaluate(r);let a=Zh.parse(t);if(a)return a}throw new Xs(`Could not parse numberArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"colorArray":{let t;for(let i of this.args){t=i.evaluate(r);let a=If.parse(t);if(a)return a}throw new Xs(`Could not parse colorArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"variableAnchorOffsetCollection":{let t;for(let i of this.args){t=i.evaluate(r);let a=Kh.parse(t);if(a)return a}throw new Xs(`Could not parse variableAnchorOffsetCollection from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}case"number":{let t=null;for(let i of this.args){if(t=i.evaluate(r),t===null)return 0;let a=Number(t);if(!isNaN(a))return a}throw new Xs(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case"formatted":return kd.fromString(V1(this.args[0].evaluate(r)));case"resolvedImage":return Jh.fromString(V1(this.args[0].evaluate(r)));case"projectionDefinition":{let t=this.args[0].evaluate(r);if(sp.parse(t))return t;throw new Xs(`Could not parse projectionDefinition from value '${typeof t=="string"?t:JSON.stringify(t)}'`,this.key)}default:return V1(this.args[0].evaluate(r))}}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}},wT=class zj{constructor(r,t){this.type=t.type,this.bindings=[].concat(r),this.result=t}evaluate(r){return this.result.evaluate(r)}eachChild(r){for(let t of this.bindings)r(t[1]);r(this.result)}static parse(r,t){if(r.length<4)return t.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);let i=[];for(let o=1;o=i.length)throw new Xs(`Array index out of bounds: ${t} > ${i.length-1}.`,this.key);if(t!==Math.floor(t))throw new Xs(`Array index must be an integer, but found ${t} instead.`,this.key);return i[t]}eachChild(r){r(this.index),r(this.input)}outputDefined(){return!1}},OP=class Nj{constructor(r,t,i){this.needle=r,this.haystack=t,this.key=i,this.type=Ao}static parse(r,t){if(r.length!==3)return t.error(`Expected 2 arguments, but found ${r.length-1} instead.`);let i=t.parse(r[1],1,co),a=t.parse(r[2],2,co);return!i||!a?null:K4(i.type,[Ao,so,Ra,ym,co])?new Nj(i,a,t.key):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${ll(i.type)} instead`)}evaluate(r){let t=this.needle.evaluate(r),i=this.haystack.evaluate(r);if(!i)return!1;if(!R0(t,["boolean","string","number","null"]))throw new Xs(`Expected first argument to be of type boolean, string, number or null, but found ${ll(Ml(t))} instead.`,this.key);if(!R0(i,["string","array"]))throw new Xs(`Expected second argument to be of type array or string, but found ${ll(Ml(i))} instead.`,this.key);return i.indexOf(t)>=0}eachChild(r){r(this.needle),r(this.haystack)}outputDefined(){return!0}},NP=class iE{constructor(r,t,i,a){this.needle=r,this.haystack=t,this.key=i,this.fromIndex=a,this.type=Ra}static parse(r,t){if(r.length<=2||r.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${r.length-1} instead.`);let i=t.parse(r[1],1,co),a=t.parse(r[2],2,co);if(!i||!a)return null;if(!K4(i.type,[Ao,so,Ra,ym,co]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${ll(i.type)} instead`);if(r.length===4){let o=t.parse(r[3],3,Ra);return o?new iE(i,a,t.key,o):null}return new iE(i,a,t.key)}evaluate(r){let t=this.needle.evaluate(r),i=this.haystack.evaluate(r);if(!R0(t,["boolean","string","number","null"]))throw new Xs(`Expected first argument to be of type boolean, string, number or null, but found ${ll(Ml(t))} instead.`,this.key);let a;if(this.fromIndex&&(a=this.fromIndex.evaluate(r)),R0(i,["string"])){let o=i.indexOf(t,a);return o===-1?-1:[...i.slice(0,o)].length}if(R0(i,["array"]))return i.indexOf(t,a);throw new Xs(`Expected second argument to be of type array or string, but found ${ll(Ml(i))} instead.`,this.key)}eachChild(r){r(this.needle),r(this.haystack),this.fromIndex&&r(this.fromIndex)}outputDefined(){return!1}},jP=class jj{constructor(r,t,i,a,o,s){this.inputType=r,this.type=t,this.input=i,this.cases=a,this.outputs=o,this.otherwise=s}static parse(r,t){if(r.length<5)return t.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!=1)return t.error("Expected an even number of arguments.");let i,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);let o={},s=[];for(let u=2;u2**53-1)return h.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof p=="number"&&Math.floor(p)!==p)return h.error("Numeric branch labels must be integer values.");if(!i)i=Ml(p);else if(h.checkSubtype(i,Ml(p)))return null;if(o[String(p)]!==void 0)return h.error("Branch labels must be unique.");o[String(p)]=s.length}let d=t.parse(f,u,a);if(!d)return null;a||(a=d.type),s.push(d)}let l=t.parse(r[1],1,co);if(!l)return null;let n=t.parse(r[r.length-1],r.length-1,a);return!n||l.type.kind!=="value"&&t.concat(1).checkSubtype(i,l.type)?null:new jj(i,a,l,o,s,n)}evaluate(r){let t=this.input.evaluate(r);return(Ml(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(r)}eachChild(r){r(this.input),this.outputs.forEach(r),r(this.otherwise)}outputDefined(){return this.outputs.every(r=>r.outputDefined())&&this.otherwise.outputDefined()}},UP=class Uj{constructor(r,t,i){this.type=r,this.branches=t,this.otherwise=i}static parse(r,t){if(r.length<4)return t.error(`Expected at least 3 arguments, but found only ${r.length-1}.`);if(r.length%2!=0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);let a=[];for(let s=1;st.outputDefined())&&this.otherwise.outputDefined()}},qP=class aE{constructor(r,t,i,a,o){this.type=r,this.input=t,this.beginIndex=i,this.key=a,this.endIndex=o}static parse(r,t){if(r.length<=2||r.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${r.length-1} instead.`);let i=t.parse(r[1],1,co),a=t.parse(r[2],2,Ra);if(!i||!a)return null;if(!K4(i.type,[pc(co),so,co]))return t.error(`Expected first argument to be of type array or string, but found ${ll(i.type)} instead`);if(r.length===4){let o=t.parse(r[3],3,Ra);return o?new aE(i.type,i,a,t.key,o):null}return new aE(i.type,i,a,t.key)}evaluate(r){let t=this.input.evaluate(r),i=this.beginIndex.evaluate(r),a;if(this.endIndex&&(a=this.endIndex.evaluate(r)),R0(t,["string"]))return[...t].slice(i,a).join("");if(R0(t,["array"]))return t.slice(i,a);throw new Xs(`Expected first argument to be of type array or string, but found ${ll(Ml(t))} instead.`,this.key)}eachChild(r){r(this.input),r(this.beginIndex),this.endIndex&&r(this.endIndex)}outputDefined(){return!1}},AT=class nE{constructor(r,t){this.type=r,this.args=t}static parse(r,t){if(r.length<2)return t.error("Expected at least one argument.");let i=null,a=t.expectedType;a&&a.kind!=="value"&&(i=a);let o=[];for(let s of r.slice(1)){let l=t.parse(s,1+o.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i||(i=l.type),o.push(l)}if(!i)throw Error("No output type");return a&&o.some(s=>U1(a,s.type))?new nE(co,o):new nE(i,o)}evaluate(r){let t=null,i=0,a;for(let o of this.args)if(i++,t=o.evaluate(r),t&&t instanceof Jh&&!t.available&&(a||(a=t.name),t=null,i===this.args.length&&(t=a)),t!==null)break;return t}eachChild(r){this.args.forEach(r)}outputDefined(){return this.args.every(r=>r.outputDefined())}},VP=tm("==",EJ,z9),GP=tm("!=",kJ,PJ),HP=tm("<",CJ,IJ),$P=tm(">",DJ,RJ),WP=tm("<=",LJ,zJ),YP=tm(">=",FJ,BJ),MT=class qj{constructor(r,t,i){this.type=yg,this.locale=i,this.caseSensitive=r,this.diacriticSensitive=t}static parse(r,t){if(r.length!==2)return t.error("Expected one argument.");let i=r[1];if(typeof i!="object"||Array.isArray(i))return t.error("Collator options argument must be an object.");let a=t.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,Ao);if(!a)return null;let o=t.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,Ao);if(!o)return null;let s=null;return i.locale&&(s=t.parse(i.locale,1,so),!s)?null:new qj(a,o,s)}evaluate(r){return new Lx(this.caseSensitive.evaluate(r),this.diacriticSensitive.evaluate(r),this.locale?this.locale.evaluate(r):null)}eachChild(r){r(this.caseSensitive),r(this.diacriticSensitive),this.locale&&r(this.locale)}outputDefined(){return!1}},XP=class Vj{constructor(r,t,i,a,o,s){this.type=so,this.number=r,this.locale=t,this.currency=i,this.unit=a,this.minFractionDigits=o,this.maxFractionDigits=s}static parse(r,t){if(r.length!==3)return t.error("Expected two arguments.");let i=t.parse(r[1],1,Ra);if(!i)return null;let a=r[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");let o=null;if(a.locale&&(o=t.parse(a.locale,1,so),!o))return null;let s=null;if(a.currency&&(s=t.parse(a.currency,1,so),!s))return null;let l=null;if(a.unit&&(l=t.parse(a.unit,1,so),!l))return null;if(s&&l)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let n=null;if(a["min-fraction-digits"]&&(n=t.parse(a["min-fraction-digits"],1,Ra),!n))return null;let u=null;return a["max-fraction-digits"]&&(u=t.parse(a["max-fraction-digits"],1,Ra),!u)?null:new Vj(i,o,s,l,n,u)}evaluate(r){return new Intl.NumberFormat(this.locale?this.locale.evaluate(r):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(r):void 0,unit:this.unit?this.unit.evaluate(r):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(r):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(r):void 0}).format(this.number.evaluate(r))}eachChild(r){r(this.number),this.locale&&r(this.locale),this.currency&&r(this.currency),this.unit&&r(this.unit),this.minFractionDigits&&r(this.minFractionDigits),this.maxFractionDigits&&r(this.maxFractionDigits)}outputDefined(){return!1}},ZP=class Gj{constructor(r){this.type=bm,this.input=r}static parse(r,t){if(r.length!==2)return t.error("Expected two arguments.");let i=t.parse(r[1],1,so);return i?new Gj(i):t.error("No image name provided.")}evaluate(r){let t=this.input.evaluate(r),i=Jh.fromString(t);return i&&r.availableImages&&(i.available=r.availableImages.indexOf(t)>-1),i}eachChild(r){r(this.input)}outputDefined(){return!1}},KP=class Hj{constructor(r,t){this.input=r,this.key=t,this.type=Ra}static parse(r,t){if(r.length!==2)return t.error(`Expected 1 argument, but found ${r.length-1} instead.`);let i=t.parse(r[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${ll(i.type)} instead.`):new Hj(i,t.key):null}evaluate(r){let t=this.input.evaluate(r);if(typeof t=="string")return[...t].length;if(Array.isArray(t))return t.length;throw new Xs(`Expected value to be of type string or array, but found ${ll(Ml(t))} instead.`,this.key)}eachChild(r){r(this.input)}outputDefined(){return!1}},Qh=8192,Px=class hw{constructor(r,t){this.type=Ao,this.geojson=r,this.geometries=t}static parse(r,t){if(r.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(em(r[1])){let i=r[1];if(i.type==="FeatureCollection"){let a=[];for(let o of i.features){let{type:s,coordinates:l}=o.geometry;s==="Polygon"&&a.push(l),s==="MultiPolygon"&&a.push(...l)}if(a.length)return new hw(i,{type:"MultiPolygon",coordinates:a})}else if(i.type==="Feature"){let a=i.geometry.type;if(a==="Polygon"||a==="MultiPolygon")return new hw(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new hw(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return ZJ(r,this.geometries);if(r.geometryType()==="LineString")return KJ(r,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},ST=class{constructor(e=[],r=(t,i)=>ti)){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:t}=this,i=r[e];for(;e>0;){let a=e-1>>1,o=r[a];if(t(i,o)>=0)break;r[e]=o,e=a}r[e]=i}_down(e){let{data:r,compare:t}=this,i=this.length>>1,a=r[e];for(;e=0)break;r[e]=r[o],e=o}r[e]=a}},ET=Math.PI/180,Ix=class{constructor(e){let r=ET*6378.137*1e3,t=Math.cos(e*ET),i=1/(1-.0066943799901413165*(1-t*t)),a=Math.sqrt(i);this.kx=r*a*t,this.ky=r*a*i*.9933056200098587}distance(e,r){let t=this.wrap(e[0]-r[0])*this.kx,i=(e[1]-r[1])*this.ky;return Math.sqrt(t*t+i*i)}pointOnLine(e,r){let t=1/0,i,a,o,s;for(let l=0;l1?(n=e[l+1][0],u=e[l+1][1]):h>0&&(n+=c/this.kx*h,u+=f/this.ky*h)),c=this.wrap(r[0]-n)*this.kx,f=(r[1]-u)*this.ky;let d=c*c+f*f;d180;)e-=360;return e}},Rx=class dw{constructor(r,t){this.type=Ra,this.geojson=r,this.geometries=t}static parse(r,t){if(r.length!==2)return t.error(`'distance' expression requires exactly one argument, but found ${r.length-1} instead.`);if(em(r[1])){let i=r[1];if(i.type==="FeatureCollection")return new dw(i,i.features.map(a=>c6(a.geometry)).flat());if(i.type==="Feature")return new dw(i,c6(i.geometry));if("type"in i&&"coordinates"in i)return new dw(i,c6(i))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(r){if(r.geometry()!=null&&r.canonicalID()!=null){if(r.geometryType()==="Point")return iQ(r,this.geometries);if(r.geometryType()==="LineString")return aQ(r,this.geometries);if(r.geometryType()==="Polygon")return nQ(r,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},JP=class $j{constructor(r){let t=null;for(let i of r)if(!t)t=i.type;else{if(t===i.type)continue;t=co;break}this.type=pc(t??co,r.length),this.arr=r}static parse(r,t){if(r.length!==2)return t.error(`'semiliteral' expression requires exactly one argument, but found ${r.length-1} instead.`);if(!em(r[1]))return t.error(`invalid value of type "${typeof r[1]}"`);let i=r[1],a=Ml(i);if(a.kind==="array"){let o=i.map(s=>t.parse(s,null,co));return new $j(o)}return new $0(a,i)}evaluate(r){return this.arr.map(t=>t.evaluate(r))}eachChild(r){this.arr.forEach(r)}outputDefined(){return this.arr.every(r=>r.outputDefined())}},zx=class Wj{constructor(r){this.key=r,this.type=co}static parse(r,t){if(r.length!==2)return t.error(`Expected 1 argument, but found ${r.length-1} instead.`);let i=r[1];return i==null?t.error("Global state property must be defined."):typeof i=="string"?new Wj(i):t.error(`Global state property must be string, but found ${typeof r[1]} instead.`)}evaluate(r){var t,i;let a=(t=r.globals)==null?void 0:t.globalState;return!a||Object.keys(a).length===0?null:(i=q1(a,this.key))!=null?i:null}eachChild(){}outputDefined(){return!1}},Y0={"==":VP,"!=":GP,">":$P,"<":HP,">=":YP,"<=":WP,array:Cd,at:BP,boolean:Cd,case:UP,coalesce:AT,collator:MT,format:xT,image:ZP,in:OP,"index-of":NP,interpolate:Rf,"interpolate-hcl":Rf,"interpolate-lab":Rf,length:KP,let:wT,literal:$0,match:jP,number:Cd,"number-format":XP,object:Cd,semiliteral:JP,slice:qP,step:Fx,string:Cd,"to-boolean":W0,"to-color":W0,"to-number":W0,"to-string":W0,var:TT,within:Px,distance:Rx,"global-state":zx},ed=class extends Error{constructor(e,r){super(r),this.message=r,this.key=e}},QP=class Yj{constructor(r,t=[]){this.parent=r,this.bindings={};for(let[i,a]of t)this.bindings[i]=a}concat(r){return new Yj(this,r)}get(r){if(this.bindings[r])return this.bindings[r];if(this.parent)return this.parent.get(r);throw Error(`${r} not found in scope.`)}has(r){return this.bindings[r]?!0:this.parent?this.parent.has(r):!1}},kT=class Xj{constructor(r,t,i=[],a,o=new QP,s=[]){this.registry=r,this.path=i,this.key=i.map(l=>`[${l}]`).join(""),this.scope=o,this.errors=s,this.expectedType=a,this._isConstant=t}parse(r,t,i,a,o={}){return t?this.concat(t,i,a)._parse(r,o):this._parse(r,o)}_parse(r,t){(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number")&&(r=["literal",r]);let i=this.key;function a(o,s,l){return l==="assert"?new Cd(s,[o],i):l==="coerce"?new W0(s,[o],i):o}if(Array.isArray(r)){if(r.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let o=r[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=this.registry[o];if(s){let l=s.parse(r,this);if(!l)return null;if(this.expectedType){let n=this.expectedType,u=l.type;if((n.kind==="string"||n.kind==="number"||n.kind==="boolean"||n.kind==="object"||n.kind==="array")&&u.kind==="value")l=a(l,n,t.typeAnnotation||"assert");else if(n.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(n.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(n.kind)&&["value","number","array"].includes(u.kind)||n.kind==="colorArray"&&["value","string","array"].includes(u.kind)||n.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))l=a(l,n,t.typeAnnotation||"coerce");else if(this.checkSubtype(n,u))return null}if(!(l instanceof $0)&&l.type.kind!=="resolvedImage"&&this._isConstant(l)){let n=new _T;try{l=new $0(l.type,l.evaluate(n))}catch(u){return this.error(u.message),null}}return l}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return r===void 0?this.error("'undefined' value invalid. Use null instead."):typeof r=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof r} instead.`)}concat(r,t,i){let a=typeof r=="number"?this.path.concat(r):this.path,o=i?this.scope.concat(i):this.scope;return new Xj(this.registry,this._isConstant,a,t||null,o,this.errors)}error(r,...t){let i=`${this.key}${t.map(a=>`[${a}]`).join("")}`;this.errors.push(new ed(i,r))}checkSubtype(r,t){let i=U1(r,t);return i&&this.error(i),i}},Xp=class xy{constructor(r,t,i,a,o){this.name=r,this.type=t,this._evaluate=i,this.args=a,this.key=o}evaluate(r){return this._evaluate(r,this.args,this.key)}eachChild(r){this.args.forEach(r)}outputDefined(){return!1}static parse(r,t){let i=r[0],a=xy.definitions[i];if(!a)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(a)?a[0]:a.type,s=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,l=s.filter(([u])=>!Array.isArray(u)||u.length===r.length-1),n=null;for(let[u,c]of l){n=new kT(t.registry,q_,t.path,null,t.scope);let f=[],h=!1;for(let d=1;dsQ(f)).join(" | "),c=[];for(let f=1;f{throw new Xs(r.evaluate(e),t)}],typeof:[so,[co],(e,[r])=>ll(Ml(r.evaluate(e)))],"to-rgba":[pc(Ra,4),[ph],(e,[r])=>{let[t,i,a,o]=r.evaluate(e).rgb;return[t*255,i*255,a*255,o]}],rgb:[ph,[Ra,Ra,Ra],W9],rgba:[ph,[Ra,Ra,Ra,Ra],W9],has:{type:Ao,overloads:[[[so],(e,[r])=>Y9(r.evaluate(e),e.properties())],[[so,Yp],(e,[r,t])=>Y9(r.evaluate(e),t.evaluate(e))]]},get:{type:co,overloads:[[[so],(e,[r])=>f6(r.evaluate(e),e.properties())],[[so,Yp],(e,[r,t])=>f6(r.evaluate(e),t.evaluate(e))]]},"feature-state":[co,[so],(e,[r])=>f6(r.evaluate(e),e.featureState||{})],properties:[Yp,[],e=>e.properties()],"geometry-type":[so,[],e=>e.geometryType()],id:[co,[],e=>e.id()],zoom:[Ra,[],e=>e.globals.zoom],"heatmap-density":[Ra,[],e=>e.globals.heatmapDensity||0],elevation:[Ra,[],e=>e.globals.elevation||0],"line-progress":[Ra,[],e=>e.globals.lineProgress||0],accumulated:[co,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[Ra,B0(Ra),(e,r)=>{let t=0;for(let i of r)t+=i.evaluate(e);return t}],"*":[Ra,B0(Ra),(e,r)=>{let t=1;for(let i of r)t*=i.evaluate(e);return t}],"-":{type:Ra,overloads:[[[Ra,Ra],(e,[r,t])=>r.evaluate(e)-t.evaluate(e)],[[Ra],(e,[r])=>-r.evaluate(e)]]},"/":[Ra,[Ra,Ra],(e,[r,t])=>r.evaluate(e)/t.evaluate(e)],"%":[Ra,[Ra,Ra],(e,[r,t])=>r.evaluate(e)%t.evaluate(e)],ln2:[Ra,[],()=>Math.LN2],pi:[Ra,[],()=>Math.PI],e:[Ra,[],()=>Math.E],"^":[Ra,[Ra,Ra],(e,[r,t])=>r.evaluate(e)**+t.evaluate(e)],sqrt:[Ra,[Ra],(e,[r])=>Math.sqrt(r.evaluate(e))],log10:[Ra,[Ra],(e,[r])=>Math.log(r.evaluate(e))/Math.LN10],ln:[Ra,[Ra],(e,[r])=>Math.log(r.evaluate(e))],log2:[Ra,[Ra],(e,[r])=>Math.log(r.evaluate(e))/Math.LN2],sin:[Ra,[Ra],(e,[r])=>Math.sin(r.evaluate(e))],cos:[Ra,[Ra],(e,[r])=>Math.cos(r.evaluate(e))],tan:[Ra,[Ra],(e,[r])=>Math.tan(r.evaluate(e))],asin:[Ra,[Ra],(e,[r])=>Math.asin(r.evaluate(e))],acos:[Ra,[Ra],(e,[r])=>Math.acos(r.evaluate(e))],atan:[Ra,[Ra],(e,[r])=>Math.atan(r.evaluate(e))],min:[Ra,B0(Ra),(e,r)=>Math.min(...r.map(t=>t.evaluate(e)))],max:[Ra,B0(Ra),(e,r)=>Math.max(...r.map(t=>t.evaluate(e)))],abs:[Ra,[Ra],(e,[r])=>Math.abs(r.evaluate(e))],round:[Ra,[Ra],(e,[r])=>{let t=r.evaluate(e);return t<0?-Math.round(-t):Math.round(t)}],floor:[Ra,[Ra],(e,[r])=>Math.floor(r.evaluate(e))],ceil:[Ra,[Ra],(e,[r])=>Math.ceil(r.evaluate(e))],"filter-==":[Ao,[so,co],(e,[r,t])=>e.properties()[r.value]===t.value],"filter-id-==":[Ao,[co],(e,[r])=>e.id()===r.value],"filter-type-==":[Ao,[so],(e,[r])=>e.geometryType()===r.value],"filter-<":[Ao,[so,co],(e,[r,t])=>{let i=e.properties()[r.value],a=t.value;return typeof i==typeof a&&i{let t=e.id(),i=r.value;return typeof t==typeof i&&t":[Ao,[so,co],(e,[r,t])=>{let i=e.properties()[r.value],a=t.value;return typeof i==typeof a&&i>a}],"filter-id->":[Ao,[co],(e,[r])=>{let t=e.id(),i=r.value;return typeof t==typeof i&&t>i}],"filter-<=":[Ao,[so,co],(e,[r,t])=>{let i=e.properties()[r.value],a=t.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Ao,[co],(e,[r])=>{let t=e.id(),i=r.value;return typeof t==typeof i&&t<=i}],"filter->=":[Ao,[so,co],(e,[r,t])=>{let i=e.properties()[r.value],a=t.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Ao,[co],(e,[r])=>{let t=e.id(),i=r.value;return typeof t==typeof i&&t>=i}],"filter-has":[Ao,[co],(e,[r])=>{let t=r.value,i=e.properties();return t in i&&i[t]!==void 0}],"filter-has-id":[Ao,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[Ao,[pc(so)],(e,[r])=>r.value.indexOf(e.geometryType())>=0],"filter-id-in":[Ao,[pc(co)],(e,[r])=>r.value.indexOf(e.id())>=0],"filter-in-small":[Ao,[so,pc(co)],(e,[r,t])=>t.value.indexOf(e.properties()[r.value])>=0],"filter-in-large":[Ao,[so,pc(co)],(e,[r,t])=>oQ(e.properties()[r.value],t.value,0,t.value.length-1)],all:{type:Ao,overloads:[[[Ao,Ao],(e,[r,t])=>r.evaluate(e)&&t.evaluate(e)],[B0(Ao),(e,r)=>{for(let t of r)if(!t.evaluate(e))return!1;return!0}]]},any:{type:Ao,overloads:[[[Ao,Ao],(e,[r,t])=>r.evaluate(e)||t.evaluate(e)],[B0(Ao),(e,r)=>{for(let t of r)if(t.evaluate(e))return!0;return!1}]]},"!":[Ao,[Ao],(e,[r])=>!r.evaluate(e)],"is-supported-script":[Ao,[so],(e,[r])=>{let t=e.globals&&e.globals.isSupportedScript;return!t||t(r.evaluate(e))}],upcase:[so,[so],(e,[r])=>r.evaluate(e).toUpperCase()],downcase:[so,[so],(e,[r])=>r.evaluate(e).toLowerCase()],concat:[so,B0(co),(e,r)=>r.map(t=>V1(t.evaluate(e))).join("")],split:[pc(so),[so,so],(e,[r,t])=>r.evaluate(e).split(t.evaluate(e))],join:[so,[pc(so),so],(e,[r,t])=>r.evaluate(e).join(t.evaluate(e))],"resolved-locale":[so,[yg],(e,[r])=>r.evaluate(e).resolvedLocale()]}),Bx=/^(.*)-transition$/,Ox=class{constructor(e,r,t,i){this.expression=e,this._warningHistory={},this._evaluator=new _T,this._defaultValue=t?tL(t):null,this._enumValues=t&&t.type==="enum"?t.values:null,this._globalState=i,this._rootKey=r}evaluateWithoutErrorHandling(e,r,t,i,a,o){return this._globalState&&(e=nm(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=t,this._evaluator.canonical=i,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,r,t,i,a,o){this._globalState&&(e=nm(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=t||null,this._evaluator.canonical=i,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new Xs(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let l=s instanceof Xs?s.path:"",n=`${l}|${s.message}`;return this._warningHistory[n]||(this._warningHistory[n]=!0,typeof console<"u"&&console.warn(J9(this._rootKey,l,s.message,this._defaultValue))),this._defaultValue}}},wm=class{constructor(e,r,t){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!W1(r.expression),this.globalStateRefs=Z1(r.expression),this._globalState=t}evaluateWithoutErrorHandling(e,r,t,i,a,o){return this._globalState&&(e=nm(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,r,t,i,a,o)}evaluate(e,r,t,i,a,o){return this._globalState&&(e=nm(e,this._globalState)),this._styleExpression.evaluate(e,r,t,i,a,o)}},Tg=class{constructor(e,r,t,i,a){this.kind=e,this.zoomStops=t,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!W1(r.expression),this.globalStateRefs=Z1(r.expression),this.interpolationType=i,this._globalState=a}evaluateWithoutErrorHandling(e,r,t,i,a,o){return this._globalState&&(e=nm(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,r,t,i,a,o)}evaluate(e,r,t,i,a,o){return this._globalState&&(e=nm(e,this._globalState)),this._styleExpression.evaluate(e,r,t,i,a,o)}interpolationFactor(e,r,t){return this.interpolationType?Rf.interpolationFactor(this.interpolationType,e,r,t):0}},CT=class Zj{constructor(r,t,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,Q9(t),this._parameters=r,this._specification=i,this._rootKey=t,this._defaultValue=tL(i),this._warningHistory={};let a=Z9(this._parameters,this._specification);this.kind=a.kind,this.interpolationFactor=a.interpolationFactor,this.zoomStops=a.zoomStops,this.interpolationType=a.interpolationType,this._innerEvaluate=a.evaluate}evaluate(r,t){try{return this._innerEvaluate(r,t)}catch(i){let a=i instanceof Error?i.message:String(i),o=`|${a}`;return this._warningHistory[o]||(this._warningHistory[o]=!0,typeof console<"u"&&console.warn(J9(this._rootKey,"",a,this._defaultValue))),this._defaultValue}}static deserialize(r){return new Zj(r._parameters,r._rootKey,r._specification)}static serialize(r){return{_parameters:r._parameters,_specification:r._specification,_rootKey:r._rootKey}}},eI={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},DT={promoteId:EQ},LT=1114111,tI=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i,FT={"*"(){return[]},array:y6,boolean:TQ,number:K_,color:_6,constants:lL,enum:J1,filter:x6,function:uL,layer:pL,object:Ff,source:vL,light:mL,sky:gL,terrain:yL,projection:IQ,projectionDefinition:RQ,string:Gp,formatted:kQ,resolvedImage:CQ,padding:DQ,numberArray:LQ,colorArray:FQ,variableAnchorOffsetCollection:PQ,sprite:_L,state:xL,fontFaces:bL},Pf.source=dh(hh(vL)),Pf.sprite=dh(hh(_L)),Pf.glyphs=dh(hh(wL)),Pf.fontFaces=dh(hh(bL)),Pf.light=dh(hh(mL)),Pf.sky=dh(hh(gL)),Pf.terrain=dh(hh(yL)),Pf.state=dh(hh(xL)),Pf.layer=dh(hh(pL)),Pf.filter=dh(hh(x6)),Pf.paintProperty=dh(hh(hL)),Pf.layoutProperty=dh(hh(dL)),rI={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},iI=class{constructor(e,r,t){this._rootKey=r,this._globalState=t,this.setValue(e)}evaluate(){var e;return(e=this._literalValue)!=null?e:this._compiledValue.evaluate({})}setValue(e){if(e==null||e==="visible"||e==="none"){this._literalValue=e==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let r=W_(e,this._rootKey,rI,this._globalState);if(r.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(r.value.map(t=>`${t.key}: ${t.message}`).join(", "));this._literalValue=void 0,this._compiledValue=r.value,this._globalStateRefs=Z1(r.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}},Hc=Pf,PT=new Set(Object.keys(mi).filter(e=>e.startsWith("source_")).map(e=>e.slice(7).replaceAll("_","-"))),Nx=class Kj{constructor(r,t,i){let a=this.cells=[];if(r instanceof ArrayBuffer){this.arrayBuffer=r;let s=new Int32Array(this.arrayBuffer);r=s[0],t=s[1],i=s[2],this.d=t+2*i;for(let u=0;u=f[d+0]&&a>=f[d+1])?(l[h]=!0,s.push(c[h])):l[h]=!1}}}_forEachCell(r,t,i,a,o,s,l,n){let u=this._convertToCellCoord(r),c=this._convertToCellCoord(t),f=this._convertToCellCoord(i),h=this._convertToCellCoord(a);for(let d=u;d<=f;d++)for(let p=c;p<=h;p++){let g=this.d*p+d;if((!n||n(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&o.call(this,r,t,i,a,g,s,l,n))return}}_convertFromCellCoord(r){return(r-this.padding)/this.scale}_convertToCellCoord(r){return Math.max(0,Math.min(this.d-1,Math.floor(r*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let r=this.cells,t=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let a=new Int32Array(t+i+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;let o=t;for(let s=0;st?(this.lastIntegerZoom=t+1,this.lastIntegerZoomTime=r):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*t}:{fromScale:.5,toScale:1,t:1-(1-t)*r}}},Ux="-transition",Ag=class{constructor(e,r,t,i){this.property=e,this.value=r,this.expression=mQ(r===void 0?e.specification.default:r,t,e.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,r,t){return this.property.possiblyEvaluate(this,e,r,t)}},qx=class{constructor(e,r,t){this.property=e,this.value=new Ag(e,void 0,r,t)}transitioned(e,r){return new IT(this.property,this.value,r,yn({},e.transition,this.transition),e.now)}untransitioned(){return new IT(this.property,this.value,null,{},0)}},Mg=class{constructor(e,r,t){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=t,this._rootKey=r}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return cf(this._values[e].value.value)}setValue(e,r){Object.hasOwn(this._values,e)||(this._values[e]=new qx(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new Ag(this._values[e].property,r===null?void 0:cf(r),this._propertyRootKey(e),this._globalState)}getTransition(e){return cf(this._values[e].transition)}setTransition(e,r){Object.hasOwn(this._values,e)||(this._values[e]=new qx(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=cf(r)||void 0}serialize(){let e={};for(let r of Object.keys(this._values)){let t=this.getValue(r);t!==void 0&&(e[r]=t);let i=this.getTransition(r);i!==void 0&&(e[`${r}${Ux}`]=i)}return e}transitioned(e,r){let t=new RT(this._properties);for(let i of Object.keys(this._values))t._values[i]=this._values[i].transitioned(e,r._values[i]);return t}untransitioned(){let e=new RT(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}},IT=class{constructor(e,r,t,i,a){this.property=e,this.value=r,this.begin=a+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=t)}possiblyEvaluate(e,r,t){let i=e.now||0,a=this.value.possiblyEvaluate(e,r,t),o=this.prior;if(!o)return a;if(i>this.end||this.value.isDataDriven())return this.prior=null,a;if(ii.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:t,to:r}}interpolate(e){return e}},zT=class{constructor(e,r){this.specification=e,this.name=r}possiblyEvaluate(e,r,t,i){if(e.value!==void 0){if(e.expression.kind==="constant"){let a=e.expression.evaluate(r,null,{},t,i);return this._calculate(a,a,a,r)}return this._calculate(e.expression.evaluate(new ns(Math.floor(r.zoom-1),r)),e.expression.evaluate(new ns(Math.floor(r.zoom),r)),e.expression.evaluate(new ns(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,t,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:t,to:r}}interpolate(e){return e}},Eg=class{constructor(e,r){this.specification=e,this.name=r}possiblyEvaluate(e,r,t,i){return!!e.expression.evaluate(r,null,{},t,i)}interpolate(){return!1}},vu=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in e){let t=e[r];t.specification.overridable&&this.overridableProperties.push(r);let i=this.defaultPropertyValues[r]=new Ag(t,void 0,t.name,void 0),a=this.defaultTransitionablePropertyValues[r]=new qx(t,t.name,void 0);this.defaultTransitioningPropertyValues[r]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}},Qa("DataDrivenProperty",Fn),Qa("DataConstantProperty",Ha),Qa("CrossFadedDataDrivenProperty",Tm),Qa("CrossFadedProperty",zT),Qa("ColorRampProperty",Eg),BT=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",Vx=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",vh=class extends Nl{constructor(e,r,t){if(super(),this.id=e.id,this.type=e.type,this._globalState=t,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=NQ(this.visibility,`layers[${this.id}].layout.visibility`,t),e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=K1(e.filter,`layers[${this.id}].filter`,t)),r.layout&&(this._unevaluatedLayout=new aI(r.layout,`layers[${this.id}].layout`,t)),r.paint)){this._transitionablePaint=new Mg(r.paint,`layers[${this.id}].paint`,t);for(let i in e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(let i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Sg(r.paint)}}setFilter(e){this.filter=e,this._featureFilter=K1(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){var r;if(e==="visibility")return this.visibility;if((r=this._transitionablePaint)!=null&&r.hasProperty(e))throw Error(e+BT);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let r of this._visibilityExpression.getGlobalStateRefs())e.add(r);if(this._unevaluatedLayout)for(let r in this._unevaluatedLayout._values){let t=this._unevaluatedLayout._values[r];for(let i of t.getGlobalStateRefs())e.add(i)}for(let r of this._featureFilter.getGlobalStateRefs())e.add(r);return e}getPaintAffectingGlobalStateRefs(){var e;let r=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let i=this._transitionablePaint._values[t].value;for(let a of i.getGlobalStateRefs()){let o=(e=r.get(a))!=null?e:[];o.push({name:t,value:i.value}),r.set(a,o)}}return r}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,r,t={}){var i;if(e==="visibility"){this.visibility=r,this._visibilityExpression.setValue(r),this.recalculateVisibility();return}if((i=this._transitionablePaint)!=null&&i.hasProperty(e)){this.fire(new Ln(Error(e+BT)));return}r!=null&&this._validate(Hc.layoutProperty,`layers.${this.id}.layout.${e}`,e,r,t)||this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){var r,t;if(e.endsWith("-transition")){let i=e.slice(0,-11);if(i==="visibility"||(r=this._unevaluatedLayout)!=null&&r.hasProperty(i))throw Error(e+Vx);return this._transitionablePaint.getTransition(i)}if(e==="visibility"||(t=this._unevaluatedLayout)!=null&&t.hasProperty(e))throw Error(e+Vx);return this._transitionablePaint.getValue(e)}setPaintProperty(e,r,t={}){var i;if(e==="visibility"||(i=this._unevaluatedLayout)!=null&&i.hasProperty(e))return this.fire(new Ln(Error(e+Vx))),!1;if(r!=null&&this._validate(Hc.paintProperty,`layers.${this.id}.paint.${e}`,e,r,t))return!1;if(e.endsWith("-transition"))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{let a=this._transitionablePaint._values[e],o=a.property.specification["property-type"]==="cross-faded-data-driven",s=a.value.isDataDriven(),l=a.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);let n=this._transitionablePaint._values[e].value;return n.isDataDriven()||s||o||this._handleOverridablePaintPropertyUpdate(e,l,n)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,t){return!1}isHidden(e=this.minzoom,r=!1){return this.minzoom&&e<(r?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&e>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){var e,r;let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)==null?void 0:e.serialize(),paint:(r=this._transitionablePaint)==null?void 0:r.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),b9(t,(i,a)=>i!==void 0&&!(a==="layout"&&!Object.keys(i).length)&&!(a==="paint"&&!Object.keys(i).length))}_validate(e,r,t,i,a={}){return eg(this,e,{key:r,layerType:this.type,objectKey:t,value:i},a)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let r=this.paint.get(e);if(r instanceof zf&&im(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}},oI=()=>nI||(nI=new vu({"raster-opacity":new Ha(mi.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new Ha(mi.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new Ha(mi.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new Ha(mi.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new Ha(mi.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new Ha(mi.paint_raster["raster-contrast"],"raster-contrast"),resampling:new Ha(mi.paint_raster.resampling,"resampling"),"raster-resampling":new Ha(mi.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new Ha(mi.paint_raster["raster-fade-duration"],"raster-fade-duration")})),sI={get paint(){return oI()}},Gx=e=>e.type==="raster",lI=class extends vh{constructor(e,r){super(e,sI,r)}},uI={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Am=class{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},il=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}},Mm=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let t=this.length;return this.resize(t+1),this.emplace(t,e,r)}emplace(e,r,t){let i=e*2;return this.int16[i+0]=r,this.int16[i+1]=t,e}},Mm.prototype.bytesPerElement=4,Qa("StructArrayLayout2i4",Mm),kg=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*3;return this.int16[a+0]=r,this.int16[a+1]=t,this.int16[a+2]=i,e}},kg.prototype.bytesPerElement=6,Qa("StructArrayLayout3i6",kg),Hx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,t,i)}emplace(e,r,t,i,a){let o=e*4;return this.int16[o+0]=r,this.int16[o+1]=t,this.int16[o+2]=i,this.int16[o+3]=a,e}},Hx.prototype.bytesPerElement=8,Qa("StructArrayLayout4i8",Hx),$x=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,t,i,a,o)}emplace(e,r,t,i,a,o,s){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=t,this.int16[l+2]=i,this.int16[l+3]=a,this.int16[l+4]=o,this.int16[l+5]=s,e}},$x.prototype.bytesPerElement=12,Qa("StructArrayLayout2i4i12",$x),Wx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,t,i,a,o)}emplace(e,r,t,i,a,o,s){let l=e*4,n=e*8;return this.int16[l+0]=r,this.int16[l+1]=t,this.uint8[n+4]=i,this.uint8[n+5]=a,this.uint8[n+6]=o,this.uint8[n+7]=s,e}},Wx.prototype.bytesPerElement=8,Qa("StructArrayLayout2i4ub8",Wx),Sm=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let t=this.length;return this.resize(t+1),this.emplace(t,e,r)}emplace(e,r,t){let i=e*2;return this.float32[i+0]=r,this.float32[i+1]=t,e}},Sm.prototype.bytesPerElement=8,Qa("StructArrayLayout2f8",Sm),Yx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,r,t,i,a,o,s,l,n,u)}emplace(e,r,t,i,a,o,s,l,n,u,c){let f=e*10;return this.uint16[f+0]=r,this.uint16[f+1]=t,this.uint16[f+2]=i,this.uint16[f+3]=a,this.uint16[f+4]=o,this.uint16[f+5]=s,this.uint16[f+6]=l,this.uint16[f+7]=n,this.uint16[f+8]=u,this.uint16[f+9]=c,e}},Yx.prototype.bytesPerElement=20,Qa("StructArrayLayout10ui20",Yx),Xx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l){let n=this.length;return this.resize(n+1),this.emplace(n,e,r,t,i,a,o,s,l)}emplace(e,r,t,i,a,o,s,l,n){let u=e*8;return this.uint16[u+0]=r,this.uint16[u+1]=t,this.uint16[u+2]=i,this.uint16[u+3]=a,this.uint16[u+4]=o,this.uint16[u+5]=s,this.uint16[u+6]=l,this.uint16[u+7]=n,e}},Xx.prototype.bytesPerElement=16,Qa("StructArrayLayout8ui16",Xx),Zx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n,u,c,f,h){let d=this.length;return this.resize(d+1),this.emplace(d,e,r,t,i,a,o,s,l,n,u,c,f,h)}emplace(e,r,t,i,a,o,s,l,n,u,c,f,h,d){let p=e*14,g=e*7;return this.int16[p+0]=r,this.int16[p+1]=t,this.int16[p+2]=i,this.int16[p+3]=a,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=l,this.uint16[p+7]=n,this.int16[p+8]=u,this.int16[p+9]=c,this.int16[p+10]=f,this.int16[p+11]=h,this.float32[g+6]=d,e}},Zx.prototype.bytesPerElement=28,Qa("StructArrayLayout4i4ui4i1f28",Zx),Kx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*3;return this.float32[a+0]=r,this.float32[a+1]=t,this.float32[a+2]=i,e}},Kx.prototype.bytesPerElement=12,Qa("StructArrayLayout3f12",Kx),Jx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let t=e*1;return this.uint32[t+0]=r,e}},Jx.prototype.bytesPerElement=4,Qa("StructArrayLayout1ul4",Jx),Qx=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n){let u=this.length;return this.resize(u+1),this.emplace(u,e,r,t,i,a,o,s,l,n)}emplace(e,r,t,i,a,o,s,l,n,u){let c=e*10,f=e*5;return this.int16[c+0]=r,this.int16[c+1]=t,this.int16[c+2]=i,this.int16[c+3]=a,this.int16[c+4]=o,this.int16[c+5]=s,this.uint32[f+3]=l,this.uint16[c+8]=n,this.uint16[c+9]=u,e}},Qx.prototype.bytesPerElement=20,Qa("StructArrayLayout6i1ul2ui20",Qx),eb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,t,i,a,o)}emplace(e,r,t,i,a,o,s){let l=e*6;return this.int16[l+0]=r,this.int16[l+1]=t,this.int16[l+2]=i,this.int16[l+3]=a,this.int16[l+4]=o,this.int16[l+5]=s,e}},eb.prototype.bytesPerElement=12,Qa("StructArrayLayout2i2i2i12",eb),tb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,t,i,a)}emplace(e,r,t,i,a,o){let s=e*4,l=e*8;return this.float32[s+0]=r,this.float32[s+1]=t,this.float32[s+2]=i,this.int16[l+6]=a,this.int16[l+7]=o,e}},tb.prototype.bytesPerElement=16,Qa("StructArrayLayout2f1f2i16",tb),rb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,t,i,a,o)}emplace(e,r,t,i,a,o,s){let l=e*16,n=e*4,u=e*8;return this.uint8[l+0]=r,this.uint8[l+1]=t,this.float32[n+1]=i,this.float32[n+2]=a,this.int16[u+6]=o,this.int16[u+7]=s,e}},rb.prototype.bytesPerElement=16,Qa("StructArrayLayout2ub2f2i16",rb),Cg=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*3;return this.uint16[a+0]=r,this.uint16[a+1]=t,this.uint16[a+2]=i,e}},Cg.prototype.bytesPerElement=6,Qa("StructArrayLayout3ui6",Cg),ib=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y){let _=this.length;return this.resize(_+1),this.emplace(_,e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y)}emplace(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_){let v=e*26,x=e*13,S=e*52;return this.int16[v+0]=r,this.int16[v+1]=t,this.uint16[v+2]=i,this.uint16[v+3]=a,this.uint32[x+2]=o,this.uint32[x+3]=s,this.uint32[x+4]=l,this.uint16[v+10]=n,this.uint16[v+11]=u,this.uint16[v+12]=c,this.float32[x+7]=f,this.float32[x+8]=h,this.uint8[S+36]=d,this.uint8[S+37]=p,this.uint8[S+38]=g,this.uint32[x+10]=m,this.int16[v+22]=y,this.float32[x+12]=_,e}},ib.prototype.bytesPerElement=52,Qa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",ib),ab=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S,M,C,w,k,A,b,E){let T=this.length;return this.resize(T+1),this.emplace(T,e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S,M,C,w,k,A,b,E)}emplace(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S,M,C,w,k,A,b,E,T){let F=e*34,D=e*17;return this.int16[F+0]=r,this.int16[F+1]=t,this.int16[F+2]=i,this.int16[F+3]=a,this.int16[F+4]=o,this.int16[F+5]=s,this.int16[F+6]=l,this.int16[F+7]=n,this.uint16[F+8]=u,this.uint16[F+9]=c,this.uint16[F+10]=f,this.uint16[F+11]=h,this.uint16[F+12]=d,this.uint16[F+13]=p,this.uint16[F+14]=g,this.uint16[F+15]=m,this.uint16[F+16]=y,this.uint16[F+17]=_,this.uint16[F+18]=v,this.uint16[F+19]=x,this.uint16[F+20]=S,this.uint16[F+21]=M,this.uint16[F+22]=C,this.uint32[D+12]=w,this.float32[D+13]=k,this.float32[D+14]=A,this.uint16[F+30]=b,this.uint16[F+31]=E,this.float32[D+16]=T,e}},ab.prototype.bytesPerElement=68,Qa("StructArrayLayout8i15ui1ul2f2ui1f68",ab),Dg=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let t=e*1;return this.float32[t+0]=r,e}},Dg.prototype.bytesPerElement=4,Qa("StructArrayLayout1f4",Dg),nb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*6,o=e*3;return this.uint16[a+0]=r,this.float32[o+1]=t,this.float32[o+2]=i,e}},nb.prototype.bytesPerElement=12,Qa("StructArrayLayout1ui2f12",nb),ob=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,t){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,t)}emplace(e,r,t,i){let a=e*2,o=e*4;return this.uint32[a+0]=r,this.uint16[o+2]=t,this.uint16[o+3]=i,e}},ob.prototype.bytesPerElement=8,Qa("StructArrayLayout1ul2ui8",ob),sb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let t=this.length;return this.resize(t+1),this.emplace(t,e,r)}emplace(e,r,t){let i=e*2;return this.uint16[i+0]=r,this.uint16[i+1]=t,e}},sb.prototype.bytesPerElement=4,Qa("StructArrayLayout2ui4",sb),lb=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let t=e*1;return this.uint16[t+0]=r,e}},lb.prototype.bytesPerElement=2,Qa("StructArrayLayout1ui2",lb),ub=class extends il{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,t,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,t,i)}emplace(e,r,t,i,a){let o=e*4;return this.float32[o+0]=r,this.float32[o+1]=t,this.float32[o+2]=i,this.float32[o+3]=a,e}},ub.prototype.bytesPerElement=16,Qa("StructArrayLayout4f16",ub),OT=class extends Am{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Wr(this.anchorPointX,this.anchorPointY)}},OT.prototype.size=20,NT=class extends Qx{get(e){return new OT(this,e)}},Qa("CollisionBoxArray",NT),jT=class extends Am{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}},jT.prototype.size=52,UT=class extends ib{get(e){return new jT(this,e)}},Qa("PlacedSymbolArray",UT),qT=class extends Am{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}},qT.prototype.size=68,VT=class extends ab{get(e){return new qT(this,e)}},Qa("SymbolInstanceArray",VT),GT=class extends Dg{getoffsetX(e){return this.float32[e*1+0]}},Qa("GlyphOffsetArray",GT),HT=class extends kg{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}},Qa("SymbolLineVertexArray",HT),$T=class extends Am{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}},$T.prototype.size=12,WT=class extends nb{get(e){return new $T(this,e)}},Qa("TextAnchorOffsetArray",WT),YT=class extends Am{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]}},YT.prototype.size=8,XT=class extends ob{get(e){return new YT(this,e)}},Qa("FeatureIndexArray",XT),lp=class extends Mm{},cI=class extends kg{},fI=class extends Hx{},hI=class extends Mm{},dI=class extends Mm{},pI=class extends $x{},vI=class extends Wx{},mI=class extends Sm{},X0=class extends Yx{},ZT=class extends Xx{},gI=class extends Zx{},yI=class extends Kx{},_I=class extends Jx{},KT=class extends eb{},xI=class extends tb{},bI=class extends rb{},wI=class extends Cg{},td=class extends Cg{},cb=class extends sb{},TI=class extends lb{},fb=ul([{name:"a_pos",components:2,type:"Int16"}],4),AI=fb.members,fb.size,fb.alignment,Ks=class o1{constructor(r=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=r}prepareSegment(r,t,i,a){let o=this.segments[this.segments.length-1];return r>o1.MAX_VERTEX_ARRAY_LENGTH&&To(`Max vertices per segment is ${o1.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${o1.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+r>o1.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==a?this.createNewSegment(t,i,a):o}createNewSegment(r,t,i){let a={vertexOffset:r.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(a.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(a),a}getOrCreateLatestSegment(r,t,i){return this.prepareSegment(0,r,t,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let r of this.segments)for(let t in r.vaos)r.vaos[t].destroy()}static simpleSegment(r,t,i,a){return new o1([{vertexOffset:r,primitiveOffset:t,vertexLength:i,primitiveLength:a,vaos:{},sortKey:0}])}},Ks.MAX_VERTEX_ARRAY_LENGTH=2**16-1,Qa("SegmentVector",Ks),MI=ul([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),SI=ul([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),EI=wx(((e,r)=>{function t(i,a){for(var o=i.length&3,s=i.length-o,l=a,n,u=3432918353,c=461845907,f,h=0;h>>16)*u&65535)<<16)&4294967295,f=f<<15|f>>>17,f=(f&65535)*c+(((f>>>16)*c&65535)<<16)&4294967295,l^=f,l=l<<13|l>>>19,n=(l&65535)*5+(((l>>>16)*5&65535)<<16)&4294967295,l=(n&65535)+27492+(((n>>>16)+58964&65535)<<16);switch(f=0,o){case 3:f^=(i.charCodeAt(h+2)&255)<<16;case 2:f^=(i.charCodeAt(h+1)&255)<<8;case 1:f^=i.charCodeAt(h)&255,f=(f&65535)*u+(((f>>>16)*u&65535)<<16)&4294967295,f=f<<15|f>>>17,f=(f&65535)*c+(((f>>>16)*c&65535)<<16)&4294967295,l^=f}return l^=i.length,l^=l>>>16,l=(l&65535)*2246822507+(((l>>>16)*2246822507&65535)<<16)&4294967295,l^=l>>>13,l=(l&65535)*3266489909+(((l>>>16)*3266489909&65535)<<16)&4294967295,l^=l>>>16,l>>>0}r!==void 0&&(r.exports=t)})),kI=wx(((e,r)=>{function t(i,a){for(var o=i.length,s=a^o,l=0,n;o>=4;)n=i.charCodeAt(l)&255|(i.charCodeAt(++l)&255)<<8|(i.charCodeAt(++l)&255)<<16|(i.charCodeAt(++l)&255)<<24,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>24,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^n,o-=4,++l;switch(o){case 3:s^=(i.charCodeAt(l+2)&255)<<16;case 2:s^=(i.charCodeAt(l+1)&255)<<8;case 1:s^=i.charCodeAt(l)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}r.exports=t})),hb=_P(wx(((e,r)=>{var t=EI(),i=kI();r.exports=t,r.exports.murmur3=t,r.exports.murmur2=i}))(),1),JT=class Jj{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(r,t,i,a){this.ids.push(LL(r)),this.positions.push(t,i,a)}getPositions(r){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let t=LL(r),i=0,a=this.ids.length-1;for(;i>1;this.ids[s]>=t?a=s:i=s+1}let o=[];for(;this.ids[i]===t;){let s=this.positions[3*i],l=this.positions[3*i+1],n=this.positions[3*i+2];o.push({index:s,start:l,end:n}),i++}return o}static serialize(r,t){let i=new Float64Array(r.ids),a=new Uint32Array(r.positions);return A6(i,a,0,i.length-1),t&&t.push(i.buffer,a.buffer),{ids:i,positions:a}}static deserialize(r){let t=new Jj;return t.ids=r.ids,t.positions=r.positions,t.indexed=!0,t}},Qa("FeaturePositionMap",JT),Ld=class{constructor(e,r){this.gl=e.gl,this.location=r}},En=class extends Ld{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},Xa=class extends Ld{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},mo=class extends Ld{constructor(e,r){super(e,r),this.current=[0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},vc=class extends Ld{constructor(e,r){super(e,r),this.current=[0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},Em=class extends Ld{constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},up=class extends Ld{constructor(e,r){super(e,r),this.current=ro.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}},QT=class extends Ld{constructor(e,r){super(e,r),this.current=[]}set(e){if(e!=this.current){this.current=e;let r=new Float32Array(e.length*4);for(let t=0;t`u_${i}`),this.type=t}setUniform(e,r,t){e.set(t.constantOr(this.value))}getBinding(e,r,t){return this.type==="color"?new up(e,r):new Xa(e,r)}},Zp=class{constructor(e,r){this.uniformNames=r.map(t=>`u_${t}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,r){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,r.y,r.height,r.width]}setUniform(e,r,t,i){let a=null;i==="u_pattern_to"?a=this.patternTo:i==="u_pattern_from"?a=this.patternFrom:i==="u_dasharray_to"?a=this.dashTo:i==="u_dasharray_from"?a=this.dashFrom:i==="u_pixel_ratio_to"?a=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(a=this.pixelRatioFrom),a!==null&&e.set(a)}getBinding(e,r,t){return t.startsWith("u_pattern")||t.startsWith("u_dasharray_")?new Em(e,r):new Xa(e,r)}},Fd=class{constructor(e,r,t,i){this.expression=e,this.type=t,this.maxValue=0,this.paintVertexAttributes=r.map(a=>({name:`a_${a}`,type:"Float32",components:t==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,r,t){let i=this.paintVertexArray.length,a=this.expression.evaluate(new ns(0,t),r,{},t.canonical,[],t.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(i,e,a)}updatePaintArray(e,r,t,i,a){let o=this.expression.evaluate(new ns(0,a),t,i);this._setPaintValue(e,r,o)}_setPaintValue(e,r,t){if(this.type==="color"){let i=M6(t);for(let a=e;a`u_${s}_t`),this.type=t,this.useIntegerZoom=i,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=r.map(s=>({name:`a_${s}`,type:"Float32",components:t==="color"?4:2,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,r,t){let i=this.expression.evaluate(new ns(this.zoom,t),r,{},t.canonical,[],t.formattedSection),a=this.expression.evaluate(new ns(this.zoom+1,t),r,{},t.canonical,[],t.formattedSection),o=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(o,e,i,a)}updatePaintArray(e,r,t,i,a){let o=this.expression.evaluate(new ns(this.zoom,a),t,i),s=this.expression.evaluate(new ns(this.zoom+1,a),t,i);this._setPaintValue(e,r,o,s)}_setPaintValue(e,r,t,i){if(this.type==="color"){let a=M6(t),o=M6(i);for(let s=e;s`#define HAS_UNIFORM_${i}`))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let t=this.binders[r];if(t instanceof Fd||t instanceof gh)for(let i of t.paintVertexAttributes)e.push(i.name);else if(t instanceof cp){let i=t.getVertexAttributes();for(let a of i)e.push(a.name)}}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let t=this.binders[r];if(t instanceof km||t instanceof Zp||t instanceof gh)for(let i of t.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){let t=[];for(let i in this.binders){let a=this.binders[i];if(a instanceof km||a instanceof Zp||a instanceof gh){for(let o of a.uniformNames)if(r[o]){let s=a.getBinding(e,r[o],o);t.push({name:o,property:i,binding:s})}}}return t}setUniforms(e,r,t,i){for(let{name:a,property:o,binding:s}of r)this.binders[o].setUniform(s,i,t.get(o),a)}updatePaintBuffers(e){this._buffers=[];for(let r in this.binders){let t=this.binders[r];if(e&&t instanceof cp){let i=e.fromScale===2?t.zoomInPaintVertexBuffer:t.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(t instanceof Fd||t instanceof gh)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(let r in this.binders){let t=this.binders[r];(t instanceof Fd||t instanceof gh||t instanceof cp)&&t.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof Fd||r instanceof gh||r instanceof cp)&&r.destroy()}}},Kp=class{constructor(e,r,t=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new iA(i,r,t);this.needsUpload=!1,this._featureMap=new JT,this._bufferOffset=0}populatePaintArrays(e,r,t,i){for(let a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(e,r,i);r.id!==void 0&&this._featureMap.add(r.id,t,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,t,i){for(let a of t)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(e,this._featureMap,r,a,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}},Qa("ConstantBinder",km),Qa("CrossFadedConstantBinder",Zp),Qa("SourceExpressionBinder",Fd),Qa("CrossFadedPatternBinder",tA),Qa("CrossFadedDasharrayBinder",rA),Qa("CompositeExpressionBinder",gh),Qa("ProgramConfiguration",iA,{omit:["_buffers"]}),Qa("ProgramConfigurationSet",Kp),db=2**14-1,aA=-db-1,nA=-32768,pb=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new hI,this.indexArray=new td,this.segments=new Ks,this.programConfigurations=new Kp(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,t){let i=this.layers[0],a=[],o=null,s=!1,l=i.type==="heatmap";if(i.type==="circle"){let f=i;o=f.layout.get("circle-sort-key"),s=!o.isConstant(),l||(l=f.paint.get("circle-pitch-alignment")==="map")}let n=l?r.subdivisionGranularity.circle:1,u=new ns(this.zoom),c=this.layers[0]._featureFilter.needGeometry;for(let{feature:f,id:h,index:d,sourceLayerIndex:p}of e){let g=j0(f,c);if(!this.layers[0]._featureFilter.filter(u,g,t))continue;let m=s?o.evaluate(g,{},t):void 0,y={id:h,properties:f.properties,type:f.type,sourceLayerIndex:p,index:d,geometry:c?g.geometry:N0(f),patterns:{},sortKey:m};a.push(y)}s&&a.sort((f,h)=>f.sortKey-h.sortKey);for(let f of a){let{geometry:h,index:d,sourceLayerIndex:p}=f,g=e[d].feature;this.addFeature(f,h,d,t,n),r.featureIndex.insert(g,h,d,p,this.index)}}update(e,r,t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:t})}addFeatures(e){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,AI),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,t,i,a=1){let o;switch(a){case 1:o=[0,7];break;case 3:o=[0,2,5,7];break;case 5:o=[0,1,3,4,6,7];break;case 7:o=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${a}; valid values are 1, 3, 5, 7.`)}let s=o.length;for(let l of r)for(let n of l){let u=n.x,c=n.y;if(u<0||u>=8192||c<0||c>=8192)continue;let f=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),h=f.vertexLength;for(let d=0;dDI||(DI=new vu({"circle-sort-key":new Fn(mi.layout_circle["circle-sort-key"],"circle-sort-key")})),PI=()=>FI||(FI=new vu({"circle-radius":new Fn(mi.paint_circle["circle-radius"],"circle-radius"),"circle-color":new Fn(mi.paint_circle["circle-color"],"circle-color"),"circle-blur":new Fn(mi.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new Fn(mi.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new Ha(mi.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new Ha(mi.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new Ha(mi.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new Ha(mi.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new Fn(mi.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new Fn(mi.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new Fn(mi.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})),II={get paint(){return PI()},get layout(){return LI()}},RI=e=>e.type==="circle",zI=class extends vh{constructor(e,r){super(e,II,r)}createBucket(e){return new pb(e)}queryRadius(e){let r=e;return lm("circle-radius",this,r)+lm("circle-stroke-width",this,r)+ex(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:t,geometry:i,transform:a,pixelsToTileUnits:o,unwrappedTileID:s,getElevation:l}){let n=tx(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-a.bearingInRadians,o),u=this.paint.get("circle-radius").evaluate(r,t)+this.paint.get("circle-stroke-width").evaluate(r,t),c=this.paint.get("circle-pitch-scale"),f=this.paint.get("circle-pitch-alignment"),h,d;return f==="map"?(h=n,d=u*o):(h=iee(n,a,s,l),d=u),BL({queryGeometry:h,size:d,transform:a,unwrappedTileID:s,getElevation:l,pitchAlignment:f,pitchScale:c},i)}},oA=class extends pb{},Qa("HeatmapBucket",oA,{omit:["layers"]}),OI=()=>BI||(BI=new vu({"heatmap-radius":new Fn(mi.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new Fn(mi.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new Ha(mi.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Eg(mi.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new Ha(mi.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})),NI={get paint(){return OI()}},vb=class Qj{constructor(r,t){C6(this,r,1,t)}resize(r){OL(this,r,1)}clone(){return new Qj({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(r,t,i,a,o){D6(r,t,i,a,o,1)}},zs=class eU{constructor(r,t){C6(this,r,4,t)}resize(r){OL(this,r,4)}replace(r,t){t?this.data.set(r):this.data=r instanceof Uint8ClampedArray?new Uint8Array(r.buffer):r}clone(){return new eU({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(r,t,i,a,o){D6(r,t,i,a,o,4)}setPixel(r,t,i){let a=(r*this.width+t)*4;this.data[a+0]=Math.round(i.r*255/i.a),this.data[a+1]=Math.round(i.g*255/i.a),this.data[a+2]=Math.round(i.b*255/i.a),this.data[a+3]=Math.round(i.a*255)}},Qa("AlphaImage",vb),Qa("RGBAImage",zs),Lg="big-fb",jI=e=>e.type==="heatmap",UI=class extends vh{createBucket(e){return new oA(e)}constructor(e,r){super(e,NI,r),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=NL({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(Lg)}queryRadius(e){return lm("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:t,geometry:i,transform:a,pixelsToTileUnits:o,unwrappedTileID:s,getElevation:l}){return BL({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(r,t)*o,transform:a,unwrappedTileID:s,getElevation:l},i)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}},VI=()=>qI||(qI=new vu({"hillshade-illumination-direction":new Ha(mi.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new Ha(mi.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new Ha(mi.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new Ha(mi.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new Ha(mi.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new Ha(mi.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new Ha(mi.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new Ha(mi.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new Ha(mi.paint_hillshade.resampling,"resampling")})),GI={get paint(){return VI()}},HI=e=>e.type==="hillshade",$I=class extends vh{constructor(e,r){super(e,GI,r),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,t=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,a=Math.max(e.length,r.length,t.length,i.length);e=e.concat(Array(a-e.length).fill(e.at(-1))),r=r.concat(Array(a-r.length).fill(r.at(-1))),t=t.concat(Array(a-t.length).fill(t.at(-1))),i=i.concat(Array(a-i.length).fill(i.at(-1)));let o=r.map(rl);return{directionRadians:e.map(rl),altitudeRadians:o,shadowColor:i,highlightColor:t}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},YI=()=>WI||(WI=new vu({"color-relief-opacity":new Ha(mi["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Eg(mi["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new Ha(mi["paint_color-relief"].resampling,"resampling")})),XI={get paint(){return YI()}},jl=class{constructor(e,r,t,i){this.context=e,this.format=t,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(r,i)}update(e,r,t){var i;let{width:a,height:o}=e,s=(((i=this.size)==null?void 0:i[0])!==a||this.size[1]!==o)&&!t,{context:l}=this,{gl:n}=l;this.useMipmap=!!r?.useMipmap,s&&this.size&&this.format===n.RGBA&&(n.deleteTexture(this.texture),this.texture=n.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),n.bindTexture(n.TEXTURE_2D,this.texture),l.pixelStoreUnpackFlipY.set(!1),l.pixelStoreUnpack.set(1);let u=this.format===n.RGBA&&r?.premultiply!==!1;if(s)if(this.size=[a,o],this.format===n.RGBA&&a>0&&o>0){let c=this.useMipmap?Math.floor(Math.log2(Math.max(a,o)))+1:1;if(n.texStorage2D(n.TEXTURE_2D,c,n.RGBA8,a,o),rx(e)){l.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:f}=e;u&&f&&(f=L6(f)),f&&n.texSubImage2D(n.TEXTURE_2D,0,0,0,a,o,n.RGBA,n.UNSIGNED_BYTE,f)}else l.pixelStoreUnpackPremultiplyAlpha.set(u),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,e)}else rx(e)?(l.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,u,a,o,n)):(l.pixelStoreUnpackPremultiplyAlpha.set(u),this._uploadDomImage(e,n));else{let{x:c,y:f}=t||{x:0,y:0};rx(e)?(l.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,u,c,f,a,o,n)):(l.pixelStoreUnpackPremultiplyAlpha.set(u),this._updateDomImage(e,c,f,n))}this.useMipmap&&!(rx(e)&&e.data===null)&&n.generateMipmap(n.TEXTURE_2D),l.pixelStoreUnpackFlipY.setDefault(),l.pixelStoreUnpack.setDefault(),l.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,r){r.texImage2D(r.TEXTURE_2D,0,this.format,this.format,r.UNSIGNED_BYTE,e)}_uploadRawData(e,r,t,i,a){let{data:o}=e;r&&o&&(o=L6(o)),a.texImage2D(a.TEXTURE_2D,0,this.format,t,i,0,this.format,a.UNSIGNED_BYTE,o)}_updateDomImage(e,r,t,i){i.texSubImage2D(i.TEXTURE_2D,0,r,t,i.RGBA,i.UNSIGNED_BYTE,e)}_updateRawData(e,r,t,i,a,o,s){let{data:l}=e;r&&l&&(l=L6(l)),s.texSubImage2D(s.TEXTURE_2D,0,t,i,a,o,s.RGBA,s.UNSIGNED_BYTE,l)}bind(e,r,t){let{context:i}=this,{gl:a}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),a.bindTexture(a.TEXTURE_2D,this.texture),(t===a.LINEAR_MIPMAP_NEAREST||t===a.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(t=a.LINEAR);let o=t||e;e!==this.magFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),this.magFilter=e),o!==this.minFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,o),this.minFilter=o),r!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,r),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,r),this.wrap=r)}generateMipmap(){if(!this.useMipmap)return;let{gl:e}=this.context;e.bindTexture(e.TEXTURE_2D,this.texture),e.generateMipmap(e.TEXTURE_2D)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},ZI=(Cm=class{constructor(e,r,t,i=1,a=1,o=1,s=0){if(this.uid=e,r.height!==r.width)throw RangeError("DEM tiles must be square");if(t&&!["mapbox","terrarium","custom"].includes(t)){To(`"${t}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Cm.byteViewCache.set(this,new Uint8Array(this.data.buffer)),t){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=a,this.blueFactor=o,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let u=-2;u=l)&&this.data.copyWithin(this._idx(0,u),c,c+l),this.data.fill(this.data[c],this._idx(-2,u),this._idx(0,u)),this.data.fill(this.data[c+l-1],this._idx(l,u),this._idx(l+1,u)+1)}let n=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let u=0;uthis.max&&(this.max=h),h=this.dim||i<-1||i>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),o=((i+2)*this.stride+t+2)*4,s=this.stride*4,l=e-t,n=r-i,u=this._unpackAtIndex(a,o),c=this._unpackAtIndex(a,o+4),f=this._unpackAtIndex(a,o+s),h=this._unpackAtIndex(a,o+s+4);return u*(1-l)*(1-n)+c*l*(1-n)+f*(1-l)*n+h*l*n}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,t){return e*this.redFactor+r*this.greenFactor+t*this.blueFactor-this.baseShift}pack(e){return jL(e,this.getUnpackVector())}getPixels(){return new zs({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,t){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let i=r*this.dim,a=r*this.dim+this.dim,o=t*this.dim,s=t*this.dim+this.dim;switch(r){case-1:i=a-2;break;case 1:a=i+2}switch(t){case-1:o=s-2;break;case 1:s=o+2}let l=-r*this.dim,n=-t*this.dim;for(let u=o;ue.type==="color-relief",JI=class extends vh{constructor(e,r){super(e,XI,r)}_createColorRamp(e){let r={elevationStops:[],colorStops:[]},t=this._transitionablePaint._values["color-relief-color"].value.expression;if(t instanceof wm&&t._styleExpression.expression instanceof Rf){this.colorRampExpression=t;let o=t._styleExpression.expression;r.elevationStops=o.labels,r.colorStops=[];for(let s of r.elevationStops)r.colorStops.push(o.evaluate({globals:{elevation:s}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[ro.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=e)return r;let i={elevationStops:[],colorStops:[]},a=(r.elevationStops.length-1)/(e-1);for(let o=0;oe)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=r}getGranularityForZoomLevel(e){let r=1<32767||r>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let t=Math.round(e)|0,i=Math.round(r)|0,a=this._getKey(t,i);if(this._vertexDictionary.has(a))return this._vertexDictionary.get(a);let o=this._vertexBuffer.length/2;return this._vertexDictionary.set(a,o),this._vertexBuffer.push(t,i),o}_subdivideTrianglesScanline(e){if(this._granularity<2)return Aee(this._vertexBuffer,e);let r=[],t=e.length;for(let i=0;i=1||x<=0)||m&&(na)){c>=i&&c<=a&&o.push(t[(s+1)%3]);continue}if(!m&&v>0){let C=l+d*v,w=n+p*v;o.push(this._vertexToIndex(C,w))}let S=l+d*Math.max(v,0),M=l+d*Math.min(x,1);if(g||this._generateIntraEdgeVertices(o,l,n,u,c,S,M),!m&&x<1){let C=l+d*x,w=n+p*x;o.push(this._vertexToIndex(C,w))}(m||c>=i&&c<=a)&&o.push(t[(s+1)%3]),!m&&(c<=i||c>=a)&&this._generateInterEdgeVertices(o,l,n,u,c,f,h,M,i,a)}return o}_generateIntraEdgeVertices(e,r,t,i,a,o,s){let l=i-r,n=a-t,u=n===0,c=u?Math.min(r,i):Math.min(o,s),f=u?Math.max(r,i):Math.max(o,s),h=Math.floor(c/this._granularityCellSize)+1,d=Math.ceil(f/this._granularityCellSize)-1;if(u?r=h;p--){let g=p*this._granularityCellSize,m=t+n*(g-r)/l;e.push(this._vertexToIndex(g,m))}}_generateInterEdgeVertices(e,r,t,i,a,o,s,l,n,u){let c=a-t,f=o-i,h=s-a,d=(n-a)/h,p=(u-a)/h,g=Math.min(d,p),m=Math.max(d,p),y=i+f*g,_=Math.floor(Math.min(y,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(y,l)/this._granularityCellSize)-1,x=l=1||m<=0){let C=r-o,w=t-s,k=(n-s)/w,A=(u-s)/w,b=o+C*Math.min(k,A);_=Math.floor(Math.min(b,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(b,l)/this._granularityCellSize)-1,x=l0?u:n;if(x)for(let C=_;C<=v;C++){let w=C*this._granularityCellSize;e.push(this._vertexToIndex(w,M))}else for(let C=v;C>=_;C--){let w=C*this._granularityCellSize;e.push(this._vertexToIndex(w,M))}}_generateOutline(e){let r=[];for(let t of e){let i=q0(t,this._granularity,!0),a=this._pointArrayToIndices(i),o=[];for(let s=1;sa==(o===-32768)?(e.push(t),e.push(r),e.push(this._vertexToIndex(i,o)),e.push(this._vertexToIndex(a,o)),e.push(t),e.push(this._vertexToIndex(i,o))):(e.push(r),e.push(t),e.push(this._vertexToIndex(i,o)),e.push(t),e.push(this._vertexToIndex(a,o)),e.push(this._vertexToIndex(i,o)))}_fillPoles(e,r,t){let i=this._vertexBuffer,a=Bi,o=e.length;for(let s=2;s=2&&((t=this._canonical)==null?void 0:t.z)===0&&(o=this._removeTrianglesOutsideTileX(o),s=s.map(l=>this._removeLinesOutsideTileX(l))),{verticesFlattened:this._vertexBuffer,indicesTriangles:o,indicesLineList:s}}_vertexOutsideTileX(e){let r=this._vertexBuffer[e*2];return r<0||r>8192}_removeTrianglesOutsideTileX(e){let r=[];for(let t=0;tr.id),this.index=e.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new dI,this.indexArray=new td,this.indexArray2=new cb,this.programConfigurations=new Kp(e.layers,e.zoom),this.segments=new Ks,this.segments2=new Ks,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,t){this.hasDependencies=ix("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),a=!i.isConstant(),o=[],s=new ns(this.zoom),l=this.layers[0]._featureFilter.needGeometry;for(let{feature:n,id:u,index:c,sourceLayerIndex:f}of e){let h=j0(n,l);if(!this.layers[0]._featureFilter.filter(s,h,t))continue;let d=a?i.evaluate(h,{},t,r.availableImages):void 0,p={id:u,properties:n.properties,type:n.type,sourceLayerIndex:f,index:c,geometry:l?h.geometry:N0(n),patterns:{},sortKey:d};o.push(p)}a&&o.sort((n,u)=>n.sortKey-u.sortKey);for(let n of o){let{geometry:u,index:c,sourceLayerIndex:f}=n;if(this.hasDependencies){let d=F6("fill",this.layers,n,{zoom:this.zoom},r);this.patternFeatures.push(d)}else this.addFeature(n,u,c,t,{},r.subdivisionGranularity);let h=e[c].feature;r.featureIndex.insert(h,u,c,f,this.index)}}update(e,r,t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:t})}addFeatures({options:e,canonical:r,patternPositions:t,patternMap:i}){this.detectSdfPatterns(i);for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,r,t,e.subdivisionGranularity)}detectSdfPatterns(e){for(let r of this.patternFeatures)for(let t in r.patterns){let i=r.patterns[t];this.recordSdfPattern(t,e[i.min]),this.recordSdfPattern(t,e[i.mid]),this.recordSdfPattern(t,e[i.max])}for(let r of this.layers){let t=r.paint.get("fill-pattern").constantOr(null);t&&(this.recordSdfPattern(r.id,e[t.from.toString()]),this.recordSdfPattern(r.id,e[t.to.toString()]))}}recordSdfPattern(e,r){if(!r)return;let t=r.sdf===!0,i=this.sdfPatterns[e];i===void 0?this.sdfPatterns[e]=t:i!==t&&To(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${e}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,QI),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,r,t,i,a,o){for(let s of z_(r,500)){let l=YL(s,i,o.fill.getGranularityForZoomLevel(i.z)),n=this.layoutVertexArray;XL((u,c)=>{n.emplaceBack(u,c)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles,this.segments2,this.indexArray2,l.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,t,{imagePositions:a,canonical:i})}},Qa("FillBucket",sA,{omit:["layers","patternFeatures"]}),rR=()=>tR||(tR=new vu({"fill-sort-key":new Fn(mi.layout_fill["fill-sort-key"],"fill-sort-key")})),aR=()=>iR||(iR=new vu({"fill-antialias":new Ha(mi.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new Fn(mi.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new Ha(mi.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new Fn(mi.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new Fn(mi.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new Ha(mi.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new Ha(mi.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new Tm(mi.paint_fill["fill-pattern"],"fill-pattern")})),nR={get paint(){return aR()},get layout(){return rR()}},oR=e=>e.type==="fill",sR=class extends vh{constructor(e,r){super(e,nR,r)}recalculate(e,r){super.recalculate(e,r);let t=this.paint._values["fill-outline-color"];t.value.kind==="constant"&&t.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new sA(e)}queryRadius(){return ex(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:r,transform:t,pixelsToTileUnits:i}){return IL(tx(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-t.bearingInRadians,i),r)}isTileClipped(){return!0}},Tb=ul([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),lR=ul([{name:"a_centroid",components:2,type:"Int16"}],4),uR=Tb.members,Tb.size,Tb.alignment,yh=class oE{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(r){return this.minX=Math.min(this.minX,r.x),this.minY=Math.min(this.minY,r.y),this.maxX=Math.max(this.maxX,r.x),this.maxY=Math.max(this.maxY,r.y),this}expandBy(r){return this.minX-=r,this.minY-=r,this.maxX+=r,this.maxY+=r,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(r){return this.expandBy(-r)}map(r){let t=new oE;return t.extend(r(new Wr(this.minX,this.minY))),t.extend(r(new Wr(this.maxX,this.minY))),t.extend(r(new Wr(this.minX,this.maxY))),t.extend(r(new Wr(this.maxX,this.maxY))),t}static fromPoints(r){let t=new oE;for(let i of r)t.extend(i);return t}contains(r){return r.x>=this.minX&&r.x<=this.maxX&&r.y>=this.minY&&r.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(r){return!this.empty()&&!r.empty()&&r.minX>=this.minX&&r.maxX<=this.maxX&&r.minY>=this.minY&&r.maxY<=this.maxY}intersects(r){return!this.empty()&&!r.empty()&&r.minX<=this.maxX&&r.maxX>=this.minX&&r.minY<=this.maxY&&r.maxY>=this.minY}},cR=yh.fromPoints([new Wr(0,0),new Wr(Bi,Bi)]),zm=class{constructor(e,r,t,i,a){for(this.properties=Object.create(null),this.extent=t,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=a;e.pos>3,o===0)continue}if(o--,a===1)s+=e.readSVarint(),l+=e.readSVarint(),i&&t.push(i),i=[new Wr(s,l)];else if(a===2)s+=e.readSVarint(),l+=e.readSVarint(),i&&i.push(new Wr(s,l));else if(a===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${a}`)}return i&&t.push(i),t}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let r=e.readVarint()+e.pos,t=1,i=0,a=0,o=0,s=1/0,l=-1/0,n=1/0,u=-1/0;for(;e.pos>3,i===0)continue}if(i--,t===1||t===2)a+=e.readSVarint(),o+=e.readSVarint(),al&&(l=a),ou&&(u=o);else if(t!==7)throw Error(`unknown command ${t}`)}return[s,n,l,u]}toGeoJSON(e,r,t){let i=this.extent*2**t,a=this.extent*e,o=this.extent*r,s=this.loadGeometry();function l(f){return[(f.x+a)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(f.y+o)*2/i)*Math.PI))-90]}function n(f){return f.map(l)}let u;if(this.type===1){let f=[];for(let d of s)f.push(d[0]);let h=n(f);u=f.length===1?{type:"Point",coordinates:h[0]}:{type:"MultiPoint",coordinates:h}}else if(this.type===2){let f=s.map(n);u=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}}else if(this.type===3){let f=KL(s),h=[];for(let d of f)h.push(d.map(n));u=h.length===1?{type:"Polygon",coordinates:h[0]}:{type:"MultiPolygon",coordinates:h}}else throw Error("unknown feature type");let c={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(c.id=this.id),c}},zm.types=["Unknown","Point","LineString","Polygon"],fR=class{constructor(e,r){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],r===void 0&&(r=e.length);e.pos=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];let r=this._pbf.readVarint()+this._pbf.pos;return new zm(this._pbf,r,this.extent,this._keys,this._values)}},hR=class{constructor(e,r=e.length){let t=Object.create(null);for(;e.pos90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new by(fh(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(r){let t=Math.PI/180,i=this.lat*t,a=r.lat*t,o=Math.sin(i)*Math.sin(a)+Math.cos(i)*Math.cos(a)*Math.cos((r.lng-this.lng)*t);return mc*Math.acos(Math.min(o,1))}static convert(r){if(r instanceof by)return r;if(Array.isArray(r)&&(r.length===2||r.length===3))return new by(Number(r[0]),Number(r[1]));if(!Array.isArray(r)&&typeof r=="object"&&r)return new by(Number("lng"in r?r.lng:r.lon),Number(r.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}},lA=2*Math.PI*mc,Qo=class tU{constructor(r,t,i=0){this.x=+r,this.y=+t,this.z=+i}static fromLngLat(r,t=0){let i=An.convert(r);return new tU(um(i.lng),cm(i.lat),V0(t,i.lat))}toLngLat(){return new An(B6(this.x),sg(this.y))}toAltitude(){return QL(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/lA*Dee(sg(this.y))}},Qp=89.25,Ab=8192,uA=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new pI,this.centroidVertexArray=new lp,this.indexArray=new td,this.programConfigurations=new Kp(e.layers,e.zoom),this.segments=new Ks,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,t){this.features=[],this.hasDependencies=ix("fill-extrusion",this.layers,r);let i=new ns(this.zoom),a=this.layers[0],o=a.layout.get("fill-extrusion-rounded-corner-distance"),s=a._featureFilter.needGeometry;for(let{feature:l,id:n,index:u,sourceLayerIndex:c}of e){let f=j0(l,s);if(!a._featureFilter.filter(i,f,t))continue;let h=s?f.geometry:N0(l),d={id:n,sourceLayerIndex:c,index:u,geometry:o>0?rF(h,o,t):h,properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(F6("fill-extrusion",this.layers,d,{zoom:this.zoom},r)):this.addFeature(d,d.geometry,u,t,{},r.subdivisionGranularity),r.featureIndex.insert(l,d.geometry,u,c,this.index,!0)}}addFeatures({options:e,canonical:r,patternPositions:t}){for(let i of this.features){let{geometry:a}=i;this.addFeature(i,a,i.index,r,t,e.subdivisionGranularity)}}update(e,r,t){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:t})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,uR),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,lR.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,t,i,a,o){let s=this.layers[0],l=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0,n=l>0?rF(r,l,i):r;for(let u of z_(n,500)){let c={x:0,y:0,sampleCount:0},f=this.layoutVertexArray.length;this.processPolygon(c,i,e,u,o);let h=this.layoutVertexArray.length-f,d=Math.floor(c.x/c.sampleCount),p=Math.floor(c.y/c.sampleCount);for(let g=0;g{cg(u,c,f,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,n.verticesFlattened,n.indicesTriangles)}_generateSideFaces(e,r){let t=0;for(let i=1;iKs.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=a.sub(o)._perp()._unit(),l=o.dist(a);t+l>32768&&(t=0),cg(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,t),cg(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,t),t+=l,cg(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,0,t),cg(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,1,t);let n=r.segment.vertexLength;this.indexArray.emplaceBack(n,n+2,n+1),this.indexArray.emplaceBack(n+1,n+2,n+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}},Qa("FillExtrusionBucket",uA,{omit:["layers","features"]}),pR=()=>dR||(dR=new vu({"fill-extrusion-rounded-corner-distance":new Ha(mi["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})),mR=()=>vR||(vR=new vu({"fill-extrusion-opacity":new Ha(mi["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new Fn(mi["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new Ha(mi["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new Ha(mi["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new Tm(mi["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new Fn(mi["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new Fn(mi["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new Ha(mi["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})),gR={get paint(){return mR()},get layout(){return pR()}},yR=e=>e.type==="fill-extrusion",_R=class extends vh{constructor(e,r){super(e,gR,r)}createBucket(e){return new uA(e)}queryRadius(){return ex(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:t,geometry:i,transform:a,pixelsToTileUnits:o,pixelPosMatrix:s}){let l=tx(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,o),n=this.paint.get("fill-extrusion-height").evaluate(r,t),u=this.paint.get("fill-extrusion-base").evaluate(r,t),c=jee(l,s,0),f=Nee(i,u,n,s),h=f[0],d=f[1];return Oee(h,d,c)}},jae=new Uint32Array(96),xR="geojsonvt_clip_start",bR="geojsonvt_clip_end",Mb=ul([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),wR=Mb.members,Mb.size,Mb.alignment,Sb=ul([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),TR=Sb.members,Sb.size,Sb.alignment,AR=Math.cos(75/2*(Math.PI/180)),cA=1/2,fA=2**14/cA,hA=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let r of this.layers)this.gradients[r.id]={};this.layoutVertexArray=new vI,this.layoutVertexArray2=new mI,this.indexArray=new td,this.programConfigurations=new Kp(e.layers,e.zoom),this.segments=new Ks,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,t){this.hasDependencies=ix("line",this.layers,r)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),a=!i.isConstant(),o=[],s=new ns(this.zoom),l=this.layers[0]._featureFilter.needGeometry;for(let{feature:n,id:u,index:c,sourceLayerIndex:f}of e){let h=j0(n,l);if(!this.layers[0]._featureFilter.filter(s,h,t))continue;let d=a?i.evaluate(h,{},t):void 0,p={id:u,properties:n.properties,type:n.type,sourceLayerIndex:f,index:c,geometry:l?h.geometry:N0(n),patterns:{},dashes:{},sortKey:d};o.push(p)}a&&o.sort((n,u)=>n.sortKey-u.sortKey);for(let n of o){let{geometry:u,index:c,sourceLayerIndex:f}=n;this.hasDependencies?(ix("line",this.layers,r)?F6("line",this.layers,n,{zoom:this.zoom},r):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,n,this.zoom,r),this.patternFeatures.push(n)):this.addFeature(n,u,c,t,{},{},r.subdivisionGranularity);let h=e[c].feature;r.featureIndex.insert(h,u,c,f,this.index)}}update(e,r,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,{imagePositions:t,dashPositions:i})}addFeatures({options:e,canonical:r,patternPositions:t,dashPositions:i}){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,r,t,i,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,TR)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wR),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,"geojsonvt_clip_start")&&Object.hasOwn(e.properties,"geojsonvt_clip_end"))return{start:+e.properties[xR],end:+e.properties[bR]}}addFeature(e,r,t,i,a,o,s){let l=this.layers[0].layout,n=l.get("line-join").evaluate(e,{}),u=l.get("line-cap").evaluate(e,{}),c=l.get("line-miter-limit").evaluate(e,{}),f=l.get("line-round-limit").evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let h of r)this.addLine(h,e,n,u,c,f,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,t,{imagePositions:a,dashPositions:o,canonical:i})}addLine(e,r,t,i,a,o,s,l){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let n=s?l.line.getGranularityForZoomLevel(s.z):1;if(e=q0(e,n),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v=2&&e[c-1].equals(e[c-2]);)c--;let f=0;for(;f0;if(k&&v>f){let T=p.dist(g);if(T>2*h){let F=p.sub(p.sub(g)._mult(h/T)._round());this.updateDistance(g,F),this.addCurrentVertex(F,y,0,0,d),g=F}}let b=g&&m,E=b?t:u?"butt":i;if(b&&E==="round"&&(Ca&&(E="bevel"),E==="bevel"&&(C>2&&(E="flipbevel"),C100)x=_.mult(-1);else{let T=C*y.add(_).mag()/y.sub(_).mag();x._perp()._mult(T*(A?-1:1))}this.addCurrentVertex(p,x,0,0,d),this.addCurrentVertex(p,x.mult(-1),0,0,d)}else if(E==="bevel"||E==="fakeround"){let T=-Math.sqrt(C*C-1),F=A?T:0,D=A?0:T;if(g&&this.addCurrentVertex(p,y,F,D,d),E==="fakeround"){let R=Math.round(w*180/Math.PI/20);for(let P=1;P2*h){let F=p.add(m.sub(p)._mult(h/T)._round());this.updateDistance(p,F),this.addCurrentVertex(F,_,0,0,d),p=F}}}}addCurrentVertex(e,r,t,i,a,o=!1){let s=r.x+r.y*t,l=r.y-r.x*t,n=-r.x+r.y*i,u=-r.y-r.x*i;this.addHalfVertex(e,s,l,o,!1,t,a),this.addHalfVertex(e,n,u,o,!0,-i,a),this.distance>fA/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,t,i,a,o))}addHalfVertex({x:e,y:r},t,i,a,o,s,l){let n=(this.lineClips?this.scaledDistance*(fA-1):this.scaledDistance)*cA;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!a,(r<<1)+ +!!o,Math.round(63*t)+128,Math.round(63*i)+128,(s===0?0:s<0?-1:1)+1|(n&63)<<2,n>>6),this.lineClips){let c=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(c,this.lineClipsArray.length)}let u=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),l.primitiveLength++),o?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}hasLineDasharray(e){for(let r of e){let t=r.paint.get("line-dasharray");if(t&&!t.isConstant())return!0}return!1}addLineDashDependencies(e,r,t,i){for(let a of e){let o=a.paint.get("line-dasharray");if(!o||o.value.kind==="constant")continue;let s=a.layout.get("line-cap").evaluate(r,{})==="round",l={dasharray:o.value.evaluate({zoom:t-1},r,{}),round:s},n={dasharray:o.value.evaluate({zoom:t},r,{}),round:s},u={dasharray:o.value.evaluate({zoom:t+1},r,{}),round:s},c=`${l.dasharray.join(",")},${l.round}`,f=`${n.dasharray.join(",")},${n.round}`,h=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[c]=l,i.dashDependencies[f]=n,i.dashDependencies[h]=u,r.dashes[a.id]={min:c,mid:f,max:h}}}},Qa("LineBucket",hA,{omit:["layers","patternFeatures"]}),SR=()=>MR||(MR=new vu({"line-cap":new Fn(mi.layout_line["line-cap"],"line-cap"),"line-join":new Fn(mi.layout_line["line-join"],"line-join"),"line-miter-limit":new Fn(mi.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new Fn(mi.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new Fn(mi.layout_line["line-sort-key"],"line-sort-key")})),kR=()=>ER||(ER=new vu({"line-opacity":new Fn(mi.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new Ha(mi.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new Fn(mi.paint_line["line-color"],"line-color"),"line-translate":new Ha(mi.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new Ha(mi.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new Fn(mi.paint_line["line-width"],"line-width"),"line-gap-width":new Fn(mi.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new Fn(mi.paint_line["line-offset"],"line-offset"),"line-blur":new Fn(mi.paint_line["line-blur"],"line-blur"),"line-dasharray":new Tm(mi.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new Tm(mi.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Eg(mi.paint_line["line-gradient"],"line-gradient")})),dA={get paint(){return kR()},get layout(){return SR()}},CR=class extends Fn{possiblyEvaluate(e,r){return r=new ns(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,t,i){return r=yn({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,t,i)}},DR=e=>e.type==="line",LR=class extends vh{constructor(e,r){super(e,dA,r),this.gradientVersion=0,Eb||(Eb=new CR(dA.paint.properties["line-width"].specification,"line-floorwidth"),Eb.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();this.stepInterpolant=vQ(r)?r._styleExpression.expression instanceof Fx:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=Eb.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new hA(e)}queryRadius(e){let r=e,t=aF(lm("line-width",this,r),lm("line-gap-width",this,r)),i=lm("line-offset",this,r);return t/2+Math.abs(i)+ex(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:t,geometry:i,transform:a,pixelsToTileUnits:o}){let s=tx(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,o),l=o/2*aF(this.paint.get("line-width").evaluate(r,t),this.paint.get("line-gap-width").evaluate(r,t)),n=this.paint.get("line-offset").evaluate(r,t);return n&&(i=JQ(i,n*o)),$Q(s,i,l)}isTileClipped(){return!0}},FR=ul([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),PR=ul([{name:"a_projected_pos",components:3,type:"Float32"}],4),ul([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),IR=ul([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),ul([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),pA=ul([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),RR=ul([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),ul([{name:"triangle",components:3,type:"Uint16"}]),ul([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),ul([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),ul([{type:"Float32",name:"offsetX"}]),ul([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ul([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]),Pg=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Pg.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(e,r){return Xr(this,null,function*(){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let t=e.pluginURL,i=new Promise(o=>{this.loadScriptResolve=o}),a=new Promise(o=>setTimeout(()=>o(),this.TIMEOUT));if(yield r(t),yield Promise.race([i,a]),this.isParsed()){let o={pluginStatus:"loaded",pluginURL:t};return this.setState(o),o}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${t}`)})}},zR={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},BR={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},OR={\u0644\u0622:[65269,65270],\u0644\u0623:[65271,65272],\u0644\u0625:[65273,65274],\u0644\u0627:[65275,65276]},vA=1604,NR=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/,mA=new Map;for(let[e,r]of Object.entries(zR))Yee(r,e,mA);gA=typeof Intl<"u"&&"Segmenter"in Intl,Z0={"!":"\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","\u22EF":"\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"},jR={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},UR={40:!0},Db=class sE{constructor(r="",t=[],i=[]){this.text=r,this.sections=t,this.sectionIndex=i,this.imageSectionID=null,this._graphemes=null}graphemes(){var r;return(r=this._graphemes)!=null||(this._graphemes=j6(this.text)),this._graphemes}static fromFeature(r,t){let i=new sE;for(let a of r.sections)a.image?i.addImageSection(a):i.addTextSection(a,t);return i}length(){return this.graphemes().length}getSection(r){return this.sections[this.sectionIndex[r]]}getSectionIndex(r){return this.sectionIndex[r]}verticalizePunctuation(){this.text=fte(this.text),this._graphemes=null}hasZeroWidthSpaces(){return this.text.includes("\u200B")}trim(){let r=this.graphemes(),t=0;for(;tt&&hF(r[i-1]);)i--;this.text=r.slice(t,i).join(""),this.sectionIndex=this.sectionIndex.slice(t,i),this._graphemes=null}substring(r,t){let i=this.graphemes().slice(r,t).join(""),a=this.sectionIndex.slice(r,t);return new sE(i,this.sections,a)}toCodeUnitIndex(r){return this.graphemes().slice(0,r).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((r,t)=>Math.max(r,this.sections[t].scale),0)}getMaxImageSize(r){let t=0,i=0;for(let a=0;a0?i[i.length-1]:"",o=j6(a+r);this.text+=r,this._graphemes=i.slice(0,a?-1:void 0).concat(o);let s=o.length-+!!a;for(let l=0;l=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(r,t,i,a,o){let s=[],l=this.determineAverageLineWidth(r,t,i,a,o),n=this.hasZeroWidthSpaces(),u=this.graphemes(),c=null,f=0,h=0;for(let d=0;d0){let g=u[d-1].codePointAt(0),m=p.codePointAt(0),y=Gee(g),_=nF(g)&&nF(m);(jR[g]||y||"imageName"in this.getSection(d-1)||u[d+1]!==void 0&&UR[m]||_&&(c??(c=lte(this.text))).has(h))&&s.push(dF(d,f,l,s,hte(g,m,y&&n),!1))}U6(p.codePointAt(0))||(f+=cF(p,this.getSection(d),i,a,r,o)),h+=p.length}return pF(dF(this.length(),f,l,s,0,!0))}determineAverageLineWidth(r,t,i,a,o){let s=0,l=0;for(let u of this.graphemes()){let c=this.getSection(l);s+=cF(u,c,i,a,r,o),l++}let n=Math.max(1,Math.ceil(s/t));return s/n}},Lb=dte(),qR=/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/,VR=new Set(["WS","FSI","LRI","RLI","PDI"]),GR=new Set(["S","B"]),Fb=4294967296,Uae=1/Fb,yA=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),_A=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,r,t=this.length){let i;for(;i=this.nextField(t);)e(i,r,this);return r}readMessage(e,r){return this.readFields(e,r,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Fb;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Fb;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let r=this.buf,t=r[this.pos++];if(t<128)return t;let i=t&127,a;return a=r[this.pos++],i|=(a&127)<<7,a<128||(a=r[this.pos++],i|=(a&127)<<14,a<128)||(a=r[this.pos++],i|=(a&127)<<21,a<128)?i:(a=r[this.pos],i|=(a&15)<<28,Tte(i,e,this))}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,r=this.pos;return this.pos=e,e-r>=12&&yA?yA.decode(this.buf.subarray(r,e)):Mte(this.buf,r,e)}readBytes(){let e=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,e);return this.pos=e,r}readPackedVarint(e=[],r){let t=this.readPackedEnd();for(;this.pos=e)return 0;let r=this.readVarint();return this.type=r&7,this._valueStart=this.pos,r>>>3}skip(e){let r=e&7;if(r===0)for(;this.buf[this.pos++]>127;);else if(r===2)this.pos=this.readVarint()+this.pos;else if(r===5)this.pos+=4;else if(r===1)this.pos+=8;else throw Error(`Unimplemented type: ${r}`)}},Pb=class{constructor(e,{pixelRatio:r,version:t,isWebGLImage:i=!1,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:n}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=a,this.stretchY=o,this.content=s,this.version=t,this.needsFirstWebGLRender=i,this.textFitWidth=l,this.textFitHeight=n}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},HR=class{constructor(e,r){let t={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let a=[];this.addImages(e,t,a),this.addImages(r,i,a);let{w:o,h:s}=mF(a),l=new zs({width:o||1,height:s||1});for(let n in e){let u=e[n];if(u.isWebGLImage)continue;let c=t[n].paddedRect;zs.copy(u.data,l,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(let n in r){let u=r[n],c=i[n].paddedRect,f=c.x+1,h=c.y+1,d=u.data.width,p=u.data.height;zs.copy(u.data,l,{x:0,y:0},{x:f,y:h},u.data),zs.copy(u.data,l,{x:0,y:p-1},{x:f,y:h-1},{width:d,height:1}),zs.copy(u.data,l,{x:0,y:0},{x:f,y:h+p},{width:d,height:1}),zs.copy(u.data,l,{x:d-1,y:0},{x:f-1,y:h},{width:1,height:p}),zs.copy(u.data,l,{x:0,y:0},{x:f+d,y:h},{width:1,height:p})}this.image=l,this.iconPositions=t,this.patternPositions=i}addImages(e,r,t){for(let i in e){let a=e[i],o={x:0,y:0,w:a.data.width+2,h:a.data.height+2};t.push(o),r[i]=new Pb(o,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,r){if(e.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==e.updateVersion){this.patchedUpdateVersion=e.updateVersion;for(let t in this.iconPositions)this.patchUpdatedImage(this.iconPositions[t],e.getImage(t),r);for(let t in this.patternPositions)this.patchUpdatedImage(this.patternPositions[t],e.getImage(t),r)}}patchUpdatedImage(e,r,t){var i;if(!e||!r||!e.needsFirstWebGLRender&&e.version===r.version)return;e.needsFirstWebGLRender=!1,e.version=r.version;let[a,o]=e.tl,s=(i=r.userImage)==null?void 0:i.data;if(!ux(s)){t.update(r.data,void 0,{x:a,y:o});return}let{width:l,height:n}=r.data;t.context.setCustomLayerDefaults(),s.renderWithWebGL({gl:t.context.gl,texture:t.texture,x:a,y:o,width:l,height:n}),t.context.setDirty()}},Qa("ImagePosition",Pb),Qa("ImageAtlas",HR),xA=(function(e){return e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.horizontalOnly=3]="horizontalOnly",e})(xA||{}),bA=new RegExp("^\\p{gc=M}$","u"),wA=32640,K0=class rU extends Wr{constructor(r,t,i,a){super(r,t),this.angle=i,a!==void 0&&(this.segment=a)}clone(){return new rU(this.x,this.y,this.angle,this.segment)}},Qa("Anchor",K0),Ig=class{constructor(e,r,t,i,a,o,s,l,n,u){var c;if(this.boxStartIndex=e.length,n){let f=o.top,h=o.bottom,d=o.collisionPadding;d&&(f-=d[1],h+=d[3]);let p=h-f;p>0&&(p=Math.max(10,p),this.circleDiameter=p)}else{let f=(c=o.image)!=null&&c.content&&(o.image.textFitWidth||o.image.textFitHeight)?bF(o):{x1:o.left,y1:o.top,x2:o.right,y2:o.bottom};f.y1=f.y1*s-l[0],f.y2=f.y2*s+l[2],f.x1=f.x1*s-l[3],f.x2=f.x2*s+l[1];let h=o.collisionPadding;if(h&&(f.x1-=h[0]*s,f.y1-=h[1]*s,f.x2+=h[2]*s,f.y2+=h[3]*s),u){let d=new Wr(f.x1,f.y1),p=new Wr(f.x2,f.y1),g=new Wr(f.x1,f.y2),m=new Wr(f.x2,f.y2),y=u*Math.PI/180;d._rotate(y),p._rotate(y),g._rotate(y),m._rotate(y),f.x1=Math.min(d.x,p.x,g.x,m.x),f.x2=Math.max(d.x,p.x,g.x,m.x),f.y1=Math.min(d.y,p.y,g.y,m.y),f.y2=Math.max(d.y,p.y,g.y,m.y)}e.emplaceBack(r.x,r.y,f.x1,f.y1,f.x2,f.y2,t,i,a)}this.boxEndIndex=e.length}},$R=class{constructor(e=[],r=(t,i)=>ti)){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:t}=this,i=r[e];for(;e>0;){let a=e-1>>1,o=r[a];if(t(i,o)>=0)break;r[e]=o,e=a}r[e]=i}_down(e){let{data:r,compare:t}=this,i=this.length>>1,a=r[e];for(;e=0)break;r[e]=r[o],e=o}r[e]=a}},J0=class{constructor(e,r,t,i){this.p=new Wr(e,r),this.h=t,this.d=nre(this.p,i),this.max=this.d+this.h*Math.SQRT2}},Ib=(function(e){return e[e.center=1]="center",e[e.left=2]="left",e[e.right=3]="right",e[e.top=4]="top",e[e.bottom=5]="bottom",e[e["top-left"]=6]="top-left",e[e["top-right"]=7]="top-right",e[e["bottom-left"]=8]="bottom-left",e[e["bottom-right"]=9]="bottom-right",e})({}),Rb=1/0,WR=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}],zb=class{constructor(e){this.layoutVertexArray=new gI,this.indexArray=new td,this.programConfigurations=e,this.segments=new Ks,this.dynamicLayoutVertexArray=new yI,this.opacityVertexArray=new _I,this.hasVisibleVertices=!1,this.placedSymbolArray=new UT}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,t,i){this.isEmpty()||(t&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,FR.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,PR.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,WR,!0),this.opacityVertexBuffer.itemSize=1),(t||i)&&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())}},Qa("SymbolBuffers",zb),Bb=class{constructor(e,r,t){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new t,this.segments=new Ks,this.collisionVertexArray=new bI}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,IR.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}},Qa("CollisionBuffers",Bb),Rg=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=TF(this.zoom,r["text-size"]),this.iconSizeData=TF(this.zoom,r["icon-size"]);let t=this.layers[0].layout,i=t.get("symbol-sort-key"),a=t.get("symbol-z-order");this.canOverlap=gx(t,"text-overlap","text-allow-overlap")!=="never"||gx(t,"icon-overlap","icon-allow-overlap")!=="never"||t.get("text-ignore-placement")||t.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!i.isConstant();let o=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&this.canOverlap,t.get("symbol-placement")==="point"&&(this.writingModes=t.get("text-writing-mode").map(s=>xA[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=e.sourceID}createArrays(){this.text=new zb(new Kp(this.layers,this.zoom,e=>e.startsWith("text"))),this.icon=new zb(new Kp(this.layers,this.zoom,e=>e.startsWith("icon"))),this.glyphOffsetArray=new GT,this.lineVertexArray=new HT,this.symbolInstances=new VT,this.textAnchorOffsets=new WT}calculateGlyphDependencies(e,r,t,i,a){var o;let s=(i||this.allowVerticalPlacement)&&a,l=Db.fromFeature(e,t),n=l.graphemes();for(let u=0;u0)&&(s.value.kind!=="constant"||s.value.value.length>0),c=n.value.kind!=="constant"||!!n.value.value||Object.keys(n.parameters).length>0,f=o.get("symbol-sort-key");if(this.features=[],!u&&!c)return;let h=r.iconDependencies,d=r.glyphDependencies,p=r.availableImages,g=new ns(this.zoom);for(let{feature:m,id:y,index:_,sourceLayerIndex:v}of e){let x=a._featureFilter.needGeometry,S=j0(m,x);if(!a._featureFilter.filter(g,S,t))continue;x||(S.geometry=N0(m));let M;if(u){let A=a.getValueAndResolveTokens("text-field",S,t,p),b=kd.factory(A);this.hasRTLText||(this.hasRTLText=hre(b)),M=ote(b,a,S)}let C;if(c){let A=a.getValueAndResolveTokens("icon-image",S,t,p);C=A instanceof Jh?A:Jh.fromString(A)}if(!M&&!C)continue;let w=this.sortFeaturesByKey?f.evaluate(S,{},t):void 0,k={id:y,text:M,icon:C,index:_,sourceLayerIndex:v,geometry:S.geometry,properties:m.properties,type:zm.types[m.type],sortKey:w};if(this.features.push(k),C&&(h[C.name]=!0),M){let A=s.evaluate(S,{},t).join(","),b=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=(i=this.writingModes)==null?void 0:i.includes(2);let E=q6(M.toString());this.calculateGlyphDependencies(M,d,A,b,E);for(let T of M.sections)T.image&&(h[T.image.name]=!0)}}o.get("symbol-placement")==="line"&&(this.features=ste(this.features)),this.sortFeaturesByKey&&this.features.sort((m,y)=>m.sortKey-y.sortKey)}update(e,r,t){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,{imagePositions:t}),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,{imagePositions:t}))}addFeatures({options:e,canonical:r,glyphMap:t,glyphPositions:i,iconMap:a,iconPositions:o,showCollisionBoxes:s}){sre({bucket:this,glyphMap:t,glyphPositions:i,imageMap:a,imagePositions:o,showCollisionBoxes:s,canonical:r,subdivisionGranularity:e.subdivisionGranularity})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){let t=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(r[e.segment+1]),a=e.dist(r[e.segment]),o={};for(let s=e.segment+1;s=0;s--)o[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=r[s-1].dist(r[s]));for(let s=0;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}addIndicesForPlacedSymbol(e,r){let t=e.placedSymbolArray.get(r),i=t.vertexStartIndex+t.numGlyphs*4;for(let a=t.vertexStartIndex;ai[s]-i[l]||a[l]-a[s]),o}addToSortKeyRanges(e,r){let t=this.sortKeyRanges[this.sortKeyRanges.length-1];t?.sortKey===r?t.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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(let r of this.symbolInstanceIndexes){let t=this.symbolInstances.get(r);this.featureSortOrder.push(t.featureIndex);let i=[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex];for(let a=0;a=0&&i.indexOf(o)===a&&this.addIndicesForPlacedSymbol(this.text,o)}t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}},Qa("SymbolBucket",Rg,{omit:["layers","collisionBoxArray","features","compareText"]}),XR=()=>YR||(YR=new vu({"symbol-placement":new Ha(mi.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new Ha(mi.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new Ha(mi.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new Fn(mi.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new Ha(mi.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new Ha(mi.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new Ha(mi.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new Ha(mi.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new Ha(mi.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new Fn(mi.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new Fn(mi.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new Ha(mi.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new Ha(mi.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new Fn(mi.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new Fn(mi.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new Fn(mi.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new Ha(mi.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new Fn(mi.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new Fn(mi.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new Ha(mi.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new Ha(mi.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new Ha(mi.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new Fn(mi.layout_symbol["text-field"],"text-field"),"text-font":new Fn(mi.layout_symbol["text-font"],"text-font"),"text-size":new Fn(mi.layout_symbol["text-size"],"text-size"),"text-max-width":new Fn(mi.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new Ha(mi.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new Fn(mi.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new Fn(mi.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new Fn(mi.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new Ha(mi.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new Fn(mi.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new Fn(mi.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new Ha(mi.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new Ha(mi.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new Fn(mi.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new Ha(mi.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new Ha(mi.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new Fn(mi.layout_symbol["text-transform"],"text-transform"),"text-offset":new Fn(mi.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new Ha(mi.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new Ha(mi.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new Ha(mi.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new Ha(mi.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new Fn(mi.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new Ha(mi.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})),KR=()=>ZR||(ZR=new vu({"icon-opacity":new Fn(mi.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new Fn(mi.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new Fn(mi.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new Fn(mi.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new Fn(mi.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new Ha(mi.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new Ha(mi.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new Fn(mi.paint_symbol["text-opacity"],"text-opacity"),"text-color":new Fn(mi.paint_symbol["text-color"],"text-color",{runtimeType:ph,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Fn(mi.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new Fn(mi.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new Fn(mi.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new Ha(mi.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new Ha(mi.paint_symbol["text-translate-anchor"],"text-translate-anchor")})),Ob={get paint(){return KR()},get layout(){return XR()}},TA=class{constructor(e){if(e.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:ym,this.defaultValue=e}evaluate(e){if(e.formattedSection){let r=this.defaultValue.property.overrides;if(r?.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let r=this.defaultValue.value;e(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}},Qa("FormatSectionOverride",TA,{omit:["defaultValue"]}),AA=e=>e.type==="symbol",JR=class lE extends vh{constructor(r,t){super(r,Ob,t)}recalculate(r,t){super.recalculate(r,t);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new zf(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let a=this.layout.get("text-writing-mode");if(a){let o=[];for(let s of a)o.includes(s)||o.push(s);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(r,t,i,a){let o=this.layout.get(r).evaluate(t,{},i,a),s=this._unevaluatedLayout._values[r];return!s.isDataDriven()&&!$_(s.value)&&o?dre(t.properties,o):o}createBucket(r){return new Rg(r)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let r of Ob.paint.overridableProperties){if(!lE.hasPaintOverride(this.layout,r))continue;let t=this.paint.get(r),i=new Ox(new TA(t),`layers[${this.id}].paint.${t.property.name}`,t.property.specification),a=null;a=t.value.kind==="constant"||t.value.kind==="source"?new wm("source",i):new Tg("composite",i,t.value.zoomStops),this.paint._values[r]=new zf(t.property,a,t.parameters)}}_handleOverridablePaintPropertyUpdate(r,t,i){return!this.layout||t.isDataDriven()||i.isDataDriven()?!1:lE.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,t){let i=r.get("text-field"),a=Ob.paint.properties[t],o=!1,s=l=>{var n;for(let u of l)if((n=a.overrides)!=null&&n.hasOverride(u)){o=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof kd)s(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let l=u=>{if(!o)if(u instanceof $0&&Ml(u.value)===_m){let c=u.value;s(c.sections)}else u instanceof xT?s(u.sections):u.eachChild(l)},n=i.value;n._styleExpression&&l(n._styleExpression.expression)}return o}},e5=()=>QR||(QR=new vu({"background-color":new Ha(mi.paint_background["background-color"],"background-color"),"background-pattern":new zT(mi.paint_background["background-pattern"],"background-pattern"),"background-opacity":new Ha(mi.paint_background["background-opacity"],"background-opacity")})),t5={get paint(){return e5()}},r5=e=>e.type==="background",i5=class extends vh{constructor(e,r){super(e,t5,r)}},a5=e=>e.type==="custom",n5=class extends vh{constructor(e,r){super(e,{},r),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}},o5=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var e;this._triggered||(this._triggered=!0,(e=this._channel)==null||e.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},s5={once:!0},l5=class{constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new o5(()=>this.process()),this.subscription=W4(this.target,"message",t=>this.receive(t),!1),this.globalScope=Kv(self)?e:window}registerMessageHandler(e,r){this.messageHandlers[e]=r}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,r){return new Promise((t,i)=>{let a=Math.round(Math.random()*1e18).toString(36).substring(0,10),o=r?W4(r.signal,"abort",()=>{o?.unsubscribe(),delete this.resolveRejects[a];let n={id:a,type:"",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(n),i(new mm(r.signal.reason))},s5):null;this.resolveRejects[a]={resolve:n=>{o?.unsubscribe(),t(n)},reject:n=>{o?.unsubscribe(),i(n)}};let s=[],l=ar(Nt({},e),{id:a,sourceMapId:this.mapId,origin:location.origin,data:tg(e.data,s)});this.target.postMessage(l,{transfer:s})})}receive(e){let r=e.data,t=r.id,i=["file://","resource://android","null"],a=[r.origin,location.origin],o=r.origin===location.origin,s=a.some(l=>i.includes(l));if((o||s)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type===""){delete this.tasks[t];let l=this.abortControllers[t];delete this.abortControllers[t],l&&l.abort();return}if(Kv(self)||r.mustQueue){this.tasks[t]=r,this.taskQueue.push(t),this.invoker.trigger();return}this.processTask(t,r)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),r=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(e,r)}processTask(e,r){return Xr(this,null,function*(){if(r.type===""){let a=this.resolveRejects[e];if(delete this.resolveRejects[e],!a)return;r.error?a.reject(Zu(rg(r.error))):a.resolve(rg(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,null,null);return}let t=rg(r.data),i=new AbortController;this.abortControllers[e]=i;try{let a=yield this.messageHandlers[r.type](r.sourceMapId,t,i);this.completeTask(e,null,a)}catch(a){this.completeTask(e,Zu(a))}})}completeTask(e,r,t){let i=[];delete this.abortControllers[e];let a={id:e,type:"",sourceMapId:this.mapId,origin:location.origin,error:r?tg(r):null,data:tg(t,i)};this.target.postMessage(a,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},zg=class{constructor(e,r,t){if(!mre(e,r,t))throw Error(`x=${r}, y=${t}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=r,this.y=t,this.key=fm(0,e,e,r,t)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,t){let i=gre(this.x,this.y,this.z),a=yre(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(t==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,a).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=2**this.z;return new Wr((e.x*r-this.x)*Bi,(e.y*r-this.y)*Bi)}toString(){return`${this.z}/${this.x}/${this.y}`}},Bg=class{constructor(e,r){this.wrap=e,this.canonical=r,this.key=fm(e,r.z,r.z,r.x,r.y)}},Cu=class Oh{constructor(r,t,i,a,o){if(this.terrainRttPosMatrix32f=null,r= z; overscaledZ = ${r}; z = ${i}`);this.overscaledZ=r,this.wrap=t,this.canonical=new zg(i,+a,+o),this.key=fm(t,r,i,a,o)}clone(){return new Oh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(r){return this.overscaledZ===r.overscaledZ&&this.wrap===r.wrap&&this.canonical.equals(r.canonical)}scaledTo(r){if(r>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);let t=this.canonical.z-r;return r>this.canonical.z?new Oh(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Oh(r,this.wrap,r,this.canonical.x>>t,this.canonical.y>>t)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(r,t){if(r>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-r;return r>this.canonical.z?fm(this.wrap*+t,r,this.canonical.z,this.canonical.x,this.canonical.y):fm(this.wrap*+t,r,r,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(r){if(r.wrap!==this.wrap||this.overscaledZ-r.overscaledZ<=0)return!1;if(r.overscaledZ===0)return this.overscaledZ>0;let t=this.canonical.z-r.canonical.z;return t<0?!1:r.canonical.x===this.canonical.x>>t&&r.canonical.y===this.canonical.y>>t}children(r){if(this.overscaledZ>=r)return[new Oh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let t=this.canonical.z+1,i=this.canonical.x*2,a=this.canonical.y*2;return[new Oh(t,this.wrap,t,i,a),new Oh(t,this.wrap,t,i+1,a),new Oh(t,this.wrap,t,i,a+1),new Oh(t,this.wrap,t,i+1,a+1)]}isLessThan(r){return this.wrapr.wrap?!1:this.overscaledZr.overscaledZ?!1:this.canonical.xr.canonical.x?!1:this.canonical.y=0&&r=0&&t=u)return null;let f=this.canonical.x+a,h=this.wrap;return f<0?(h-=Math.ceil(-f/u),f=(f%u+u)%u):f>=u&&(h+=Math.floor(f/u),f%=u),{tileID:new Oh(this.overscaledZ,h,n,f,c),x:s,y:l}}},Nb=Math.PI*6378137,Qa("CanonicalTileID",zg),Qa("OverscaledTileID",Cu,{omit:["terrainRttPosMatrix32f"]}),Og="_geojsonTileLayer",u5=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},MA=class{constructor(e,r,t,i,a){this.type="Feature",this._vectorTileFeature=e,this._x=t,this._y=i,this._z=r;for(let o in e.properties)typeof e.properties[o]=="string"&&e.properties[o].startsWith("__$json__:")&&(e.properties[o]=JSON.parse(e.properties[o].slice(10)));this.properties=e.properties,this.id=a}projectPoint(e,r,t,i){return[(e.x+r)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+t)*2/i)*Math.PI))-90]}projectLine(e,r,t,i){return e.map(a=>this.projectPoint(a,r,t,i))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,r=e.extent*2**this._z,t=e.extent*this._x,i=e.extent*this._y,a=e.loadGeometry();switch(e.type){case 1:{let o=[];for(let l of a)o.push(l[0]);let s=this.projectLine(o,t,i,r);this._geometry=o.length===1?{type:"Point",coordinates:s[0]}:{type:"MultiPoint",coordinates:s};break}case 2:{let o=a.map(s=>this.projectLine(s,t,i,r));this._geometry=o.length===1?{type:"LineString",coordinates:o[0]}:{type:"MultiLineString",coordinates:o};break}case 3:{let o=KL(a),s=[];for(let l of o)s.push(l.map(n=>this.projectLine(n,t,i,r)));this._geometry=s.length===1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&r!=="_x"&&r!=="_y"&&r!=="_z"&&(e[r]=this[r]);return e}},e0=class{constructor(e,r,t){this._name=e,this.dataBuffer=r,typeof t=="number"?this._size=t:(this.nullabilityBuffer=t,this._size=t.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){var r;return((r=this.nullabilityBuffer)==null?void 0:r.get(e))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Ng=class extends e0{},jb=class extends Ng{getValueFromBuffer(e){return this.dataBuffer[e]}},Ub=class extends Ng{getValueFromBuffer(e){return this.dataBuffer[e]}},SA=class extends e0{constructor(e,r,t,i){super(e,r,i),this.delta=t}},qb=class extends SA{constructor(e,r,t,i,a){super(e,a?Int32Array.of(r):Uint32Array.of(r),t,i)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},Vb=class extends e0{constructor(e,r,t,i){super(e,i?Int32Array.of(r):Uint32Array.of(r),t)}getValueFromBuffer(e){return this.dataBuffer[0]}},c5=class{constructor(e,r,t,i,a=4096){if(this._name=e,this._geometryVector=r,this._idVector=t,this._propertyVectors=i,this._extent=a,e.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var e;return(e=this._propertyVectors)!=null?e:[]}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(r=>[r.name,r]))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],r=this.geometryVector.getGeometries();for(let t=0;t>>32-e;Hb=Gb,CA=65536,$b=xre(CA),f5=3*$b/256+$b|0,(function(e){e.PRESENT="PRESENT",e.DATA="DATA",e.OFFSET="OFFSET",e.LENGTH="LENGTH"})(El||(El={})),(function(e){e.NONE="NONE",e.SINGLE="SINGLE",e.SHARED="SHARED",e.VERTEX="VERTEX",e.MORTON="MORTON",e.FSST="FSST"})(gc||(gc={})),(function(e){e.VERTEX="VERTEX",e.INDEX="INDEX",e.STRING="STRING",e.KEY="KEY"})(Id||(Id={})),(function(e){e.VAR_BINARY="VAR_BINARY",e.GEOMETRIES="GEOMETRIES",e.PARTS="PARTS",e.RINGS="RINGS",e.TRIANGLES="TRIANGLES",e.SYMBOL="SYMBOL",e.DICTIONARY="DICTIONARY"})(eu||(eu={})),h5=[El.PRESENT,El.DATA,El.OFFSET,El.LENGTH],DA=[fo.NONE,fo.DELTA,fo.COMPONENTWISE_DELTA,fo.RLE,fo.MORTON],d5=[Of.NONE,Of.FAST_PFOR,Of.VARINT],p5=[gc.NONE,gc.SINGLE,gc.SHARED,gc.VERTEX,gc.MORTON,gc.FSST],v5=[Id.VERTEX,Id.INDEX,Id.STRING,Id.KEY],m5=[eu.VAR_BINARY,eu.GEOMETRIES,eu.PARTS,eu.RINGS,eu.TRIANGLES,eu.SYMBOL,eu.DICTIONARY],(function(e){e[e.FLAT=0]="FLAT",e[e.CONST=1]="CONST",e[e.SEQUENCE=2]="SEQUENCE",e[e.DICTIONARY=3]="DICTIONARY",e[e.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(js||(js={})),_h=class{constructor(e,r){this.values=e,this._size=r}get(e){let r=Math.floor(e/8),t=e%8;return(this.values[r]>>t&1)==1}set(e,r){let t=Math.floor(e/8),i=e%8;this.values[t]=this.values[t]|+!!r<>t&1}size(){return this._size}getBuffer(){return this.values}},g5=new TextDecoder,LA=class extends Ng{getValueFromBuffer(e){return this.dataBuffer[e]}},FA=class extends SA{constructor(e,r,t,i,a){super(e,a?BigInt64Array.of(r):BigUint64Array.of(r),t,i)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}},(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON",e[e.MULTIPOINT=3]="MULTIPOINT",e[e.MULTILINESTRING=4]="MULTILINESTRING",e[e.MULTIPOLYGON=5]="MULTIPOLYGON"})(Du||(Du={})),(function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON"})(y5||(y5={})),(function(e){e[e.MORTON=0]="MORTON",e[e.VEC_2=1]="VEC_2",e[e.VEC_3=2]="VEC_3"})(t0||(t0={})),PA=class{constructor(e,r,t,i,a){this._vertexBufferType=e,this._topologyVector=r,this._vertexOffsets=t,this._vertexBuffer=i,this._mortonSettings=a}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let r=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let t=this.vertexOffsets[e],i=this.vertexBuffer[t],a=tT(i,this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[a.x,a.y]}let r=this.vertexOffsets?this.vertexOffsets[e]*2:e*2;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getGeometries(){return Kie(this)}get mortonSettings(){return this._mortonSettings}},IA=class extends PA{constructor(e,r,t,i,a,o,s){super(t,i,a,o,s),this._numGeometries=e,this._geometryType=r}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Du.POLYGON||this._geometryType===Du.MULTIPOLYGON}containsSingleGeometryType(){return!0}},RA=class extends PA{constructor(e,r,t,i,a,o){super(e,t,i,a,o),this._geometryTypes=r}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;ear(Nt({},t),{[i.name]:new M5(i)}),{})}},E5=class{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Nx(Bi,16,0),this.grid3D=new Nx(Bi,16,0),this.featureIndexArray=new XT,this.promoteId=r}insert(e,r,t,i,a,o){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(t,i,a);let l=o?this.grid3D:this.grid;for(let n of r){let u=[1/0,1/0,-1/0,-1/0];for(let c of n)u[0]=Math.min(u[0],c.x),u[1]=Math.min(u[1],c.y),u[2]=Math.max(u[2],c.x),u[3]=Math.max(u[3],c.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&l.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new S5(this.rawTileData).layers:this.vtLayers=new hR(new _A(this.rawTileData)).layers,this.sourceLayerCoder=new u5(this.vtLayers?Object.keys(this.vtLayers).sort():[Og])),this.vtLayers}query(e,r,t,i){this.loadVTLayers();let a=e.params,o=Bi/e.tileSize/e.scale,s=K1(a.filter,"queryRenderedFeatures filter",a.globalState),l=e.queryGeometry,n=e.queryPadding*o,u=yh.fromPoints(l),c=this.grid.query(u.minX-n,u.minY-n,u.maxX+n,u.maxY+n),f=yh.fromPoints(e.cameraQueryGeometry).expandBy(n),h=this.grid3D.query(f.minX,f.minY,f.maxX,f.maxY,(g,m,y,_)=>XQ(e.cameraQueryGeometry,g-n,m-n,y+n,_+n));for(let g of h)c.push(g);c.sort(Nae);let d={},p;for(let g of c){if(g===p)continue;p=g;let m=this.featureIndexArray.get(g),y=null;this.loadMatchingFeature(d,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,a.layers,a.availableImages,r,t,i,(_,v,x)=>(y||(y=N0(_)),v.queryIntersectsFeature({queryGeometry:l,feature:_,featureState:x,geometry:y,zoom:this.z,transform:e.transform,pixelsToTileUnits:o,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return d}loadMatchingFeature(e,r,t,i,a,o,s,l,n,u,c){let f=this.bucketLayerIDs[r];if(o&&!f.some(g=>o.has(g)))return;let h=this.sourceLayerCoder.decode(t),d=this.vtLayers[h].feature(i);if(a.needGeometry){let g=j0(d,!0);if(!a.filter(new ns(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!a.filter(new ns(this.tileID.overscaledZ),d))return;let p=this.getId(d,h);for(let g of f){if(o&&!o.has(g))continue;let m=l[g];if(!m)continue;let y={};p&&u&&(y=u.getState(m.sourceLayer||"_geojsonTileLayer",p));let _=yn({},n[g]);_.paint=dP(_.paint,m.paint,d,y,s),_.layout=dP(_.layout,m.layout,d,y,s);let v=!c||c(d,m,y);if(!v)continue;let x=new MA(d,this.z,this.x,this.y,p);x.layer=_;let S=e[g];S===void 0&&(S=e[g]=[]),S.push({featureIndex:i,feature:x,intersectionZ:v})}}lookupSymbolFeatures(e,r,t,i,a,o,s,l){let n={};this.loadVTLayers();let u=K1(a.filterSpec,"queryRenderedFeatures symbol filter",a.globalState);for(let c of e)this.loadMatchingFeature(n,t,i,c,u,o,s,l,r);return n}hasLayer(e){for(let r of this.bucketLayerIDs)for(let t of r)if(e===t)return!0;return!1}getId(e,r){var t;let i=e.id;if(this.promoteId){let a=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];i=e.properties[a],typeof i=="boolean"&&(i=Number(i)),i===void 0&&((t=e.properties)!=null&&t.cluster)&&this.promoteId&&(i=Number(e.properties.cluster_id))}return i}},Qa("FeatureIndex",E5,{omit:["rawTileData","sourceLayerCoder"]}),k5=class{constructor(e,r){this.max=e,this.onRemove=r,this.reset()}reset(){for(let e in this.data)for(let r of this.data[e])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(e,r,t){let i=e.wrapped().key;this.data[i]===void 0&&(this.data[i]=[]);let a={value:r,timeout:void 0};if(t!==void 0&&(a.timeout=setTimeout(()=>{this.remove(e,a)},t)),this.data[i].push(a),this.order.push(i),this.order.length>this.max){let o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}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){let r=this.data[e].shift();return r.timeout&&clearTimeout(r.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),r.value}getByKey(e){let r=this.data[e];return r?r[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,r){if(!this.has(e))return this;let t=e.wrapped().key,i=r===void 0?0:this.data[t].indexOf(r),a=this.data[t][i];return this.data[t].splice(i,1),a.timeout&&clearTimeout(a.timeout),this.data[t].length===0&&delete this.data[t],this.onRemove(a.value),this.order.splice(this.order.indexOf(t),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let r=this._getAndRemoveByKey(this.order[0]);r&&this.onRemove(r)}return this}filter(e){let r=[];for(let t in this.data)for(let i of this.data[t])e(i.value)||r.push(i);for(let t of r)this.remove(t.value.tileID,t)}}}}),C5={};Mr(C5,{AJAXError:()=>gm,AttributionControl:()=>TS,BoxZoomHandler:()=>uS,CanvasSource:()=>EM,CooperativeGesturesHandler:()=>bS,DoubleClickZoomHandler:()=>gS,DragPanHandler:()=>yS,DragRotateHandler:()=>_S,EXTENT:()=>Bi,EdgeInsets:()=>S2,ErrorEvent:()=>Ln,Event:()=>hf,Evented:()=>Nl,FullscreenControl:()=>E8,FullscreenEvent:()=>H2,GPUInitializationError:()=>sS,GeoJSONSource:()=>MM,GeolocateControl:()=>A8,GeolocateErrorEvent:()=>FS,GeolocateEvent:()=>o0,GeolocatePositionEvent:()=>G2,GlobeControl:()=>C8,Hash:()=>lS,ImageSource:()=>iv,KeyboardHandler:()=>pS,LngLat:()=>An,LngLatBounds:()=>wh,LogoControl:()=>AS,Map:()=>ES,MapBoxZoomEvent:()=>d2,MapContextEvent:()=>Yg,MapLibreEvent:()=>iu,MapLibreMap:()=>ES,MapMouseEvent:()=>df,MapMovementEvent:()=>kn,MapProjectionEvent:()=>_M,MapSourceDataEvent:()=>Bs,MapStyleDataEvent:()=>Nf,MapStyleImageMissingEvent:()=>xM,MapStyleLoadEvent:()=>h2,MapTerrainEvent:()=>yM,MapTouchEvent:()=>Um,MapWheelEvent:()=>gM,Marker:()=>V2,MarkerClickEvent:()=>LS,MarkerDragEvent:()=>n0,MercatorCoordinate:()=>Qo,NavigationControl:()=>b8,Point:()=>Wr,Popup:()=>F8,PopupEvent:()=>$2,RasterDEMTileSource:()=>AM,RasterTileSource:()=>_2,ScaleControl:()=>S8,ScrollZoomHandler:()=>mS,Style:()=>L2,TerrainControl:()=>k8,TwoFingersTouchPitchHandler:()=>dS,TwoFingersTouchRotateHandler:()=>hS,TwoFingersTouchZoomHandler:()=>fS,TwoFingersTouchZoomRotateHandler:()=>xS,VectorTileSource:()=>TM,VideoSource:()=>SM,addProtocol:()=>pJ,addSourceType:()=>yB,clearPrewarmedResources:()=>hne,config:()=>ff,createTileMesh:()=>Y5,getGlobalDispatcher:()=>GA,getMaxParallelImageRequests:()=>Ise,getRTLTextPluginStatus:()=>Dse,getVersion:()=>Lse,getWorkerCount:()=>Fse,getWorkerUrl:()=>zse,importScriptInWorkers:()=>Ose,isTimeFrozen:()=>Yae,now:()=>hs,prewarm:()=>fne,removeProtocol:()=>vJ,restoreNow:()=>Wae,setMaxParallelImageRequests:()=>Rse,setNow:()=>$ae,setRTLTextPlugin:()=>Cse,setWorkerCount:()=>Pse,setWorkerUrl:()=>Bse});function D5(){var e=new Ql(4);return Ql!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function Vae(e,r){var t=r[0],i=r[1],a=r[2],o=r[3],s=t*o-a*i;return s?(s=1/s,e[0]=o*s,e[1]=-i*s,e[2]=-a*s,e[3]=t*s,e):null}function Gae(e){return e[0]*e[3]-e[2]*e[1]}function Hae(e,r,t){var i=r[0],a=r[1],o=r[2],s=r[3],l=Math.sin(t),n=Math.cos(t);return e[0]=i*n+o*l,e[1]=a*n+s*l,e[2]=i*-l+o*n,e[3]=a*-l+s*n,e}function hs(){return Wg.getCurrentTime()}function $ae(e){Wg.setNow(e)}function Wae(){Wg.restoreNow()}function Yae(){return Wg.isFrozen()}function Xae(e,r){let t={};for(let i in e)i!=="ref"&&(t[i]=e[i]);return EP.forEach(i=>{i in r&&(t[i]=r[i])}),t}function L5(e){e=e.slice();let r=Object.create(null);for(let t=0;t{"source"in s&&i[s.source]?t.push({command:"removeLayer",args:[s.id]}):o.push(s)}),t=t.concat(a),Qae(o,r.layers,t)}catch(i){console.warn("Unable to compute style diff:",i),t=[{command:"setStyle",args:[r]}]}return t}function tne(){let e={},r=mi.$version;for(let t in mi.$root){let i=mi.$root[t];if(i.required){let a=null;a=t==="version"?r:i.type==="array"?[]:{},a!=null&&(e[t]=a)}}return e}function Xb(e){let r=[];if(typeof e=="string")r.push({id:"default",url:e});else if(e&&e.length>0){let t=[];for(let{id:i,url:a}of e){let o=`${i}${a}`;t.includes(o)||(t.push(o),r.push({id:i,url:a}))}}return r}function z5(e,r,t){try{let i=new URL(e);return i.pathname+=`${r}${t}`,i.toString()}catch{throw Error(`Invalid sprite URL "${e}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function rne(e,r,t,i){return Xr(this,null,function*(){let a=Xb(e),o=t>1?"@2x":"",s={},l={};for(let{id:n,url:u}of a){let c=yield r.transformRequest(z5(u,o,".json"),"SpriteJSON");s[n]=mg(c,i);let f=yield r.transformRequest(z5(u,o,".png"),"SpriteImage");l[n]=rd.getImage(f,i)}return yield Promise.all([...Object.values(s),...Object.values(l)]),ine(s,l)})}function ine(e,r){return Xr(this,null,function*(){let t={};for(let i in e){t[i]={};let a=(yield r[i]).data;if(!a)throw Error(`Could not load sprite image for ${i}: the response is empty`);let o=yc.getImageCanvasContext(a),s=(yield e[i]).data;for(let l in s){let{width:n,height:u,x:c,y:f,sdf:h,pixelRatio:d,stretchX:p,stretchY:g,content:m,textFitWidth:y,textFitHeight:_}=s[l],v={width:n,height:u,x:c,y:f,context:o};t[i][l]={data:null,pixelRatio:d,sdf:h,stretchX:p,stretchY:g,content:m,textFitWidth:y,textFitHeight:_,spriteData:v}}}return t})}function ane(e){let r=/^u\+([0-9a-f]*)(\?+)$/i.exec(e);if(r){let[,a,o]=r;return a.length+o.length>6?null:B5(parseInt(`${a}${"0".repeat(o.length)}`,16),parseInt(`${a}${"f".repeat(o.length)}`,16))}let t=/^u\+([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?$/i.exec(e);if(!t)return null;let i=parseInt(t[1],16);return B5(i,t[2]===void 0?i:parseInt(t[2],16))}function B5(e,r){return e>r||e>p2?null:{start:e,end:Math.min(r,p2)}}function nne(e,r){return e.ranges.some(({start:t,end:i})=>r>=t&&r<=i)}function O5(e,r,t,i,a,o,s,l,n){for(let u=r;u-1);n++,o[n]=l,s[n]=u,s[n+1]=v2}for(let l=0,n=0;lvg(r,t))),y2}function dne(e,r){let t=zp();return Ol(t,t,[1,1,0]),Xu(t,t,[e.width*.5,e.height*.5,1]),e.calculatePosMatrix?Wv(t,t,e.calculatePosMatrix(r.toUnwrapped())):t}function pne(e,r,t){if(e)for(let i of e){let a=r[i];if(a?.source===t&&a.type==="fill-extrusion")return!0}else for(let i in r){let a=r[i];if(a.source===t&&a.type==="fill-extrusion")return!0}return!1}function vne(e,r,t,i,a,o,s){var l;let n=pne((l=a?.layers)!=null?l:null,r,e.id),u=o.maxPitchScaleFactor(),c=e.tilesIn(i,u,n);c.sort(j5);let f=[];for(let h of c)f.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(r,t,e.getState(),h.queryGeometry,h.cameraQueryGeometry,h.scale,a,o,u,dne(o,h.tileID),s?(d,p)=>s(h.tileID,d,p):void 0)});return _ne(yne(f),e)}function mne(e,r,t,i,a,o,s){let l={},n=o.queryRenderedSymbols(i),u=[];for(let c of Object.keys(n).map(Number))u.push(s[c]);u.sort(j5);for(let c of u){let f=c.featureIndex.lookupSymbolFeatures(n[c.bucketInstanceId],r,c.bucketIndex,c.sourceLayerIndex,{filterSpec:a.filter,globalState:a.globalState},a.layers,a.availableImages,e);for(let h in f){l[h]||(l[h]=[]);let d=f[h];d.sort((p,g)=>{let m=c.featureSortOrder;if(m){let y=m.indexOf(p.featureIndex);return m.indexOf(g.featureIndex)-y}return g.featureIndex-p.featureIndex});for(let p of d)l[h].push(p)}}return xne(l,e,t)}function gne(e,r){let t=e.getRenderableIds().map(o=>e.getTileByID(o)),i=[],a={};for(let o of t){let s=o.tileID.canonical.key;a[s]||(a[s]=!0,o.querySourceFeatures(i,r))}return i}function j5(e,r){let t=e.tileID,i=r.tileID;return t.overscaledZ-i.overscaledZ||t.canonical.y-i.canonical.y||t.wrap-i.wrap||t.canonical.x-i.canonical.x}function yne(e){let r={},t={};for(let{queryResults:i,wrappedTileID:a}of e){t[a]||(t[a]={});let o=t[a];for(let s in i){let l=i[s];o[s]||(o[s]={});let n=o[s];r[s]||(r[s]=[]);for(let u of l)n[u.featureIndex]||(n[u.featureIndex]=!0,r[s].push(u))}}return r}function _ne(e,r){for(let t in e)for(let i of e[t])U5(i,r);return e}function xne(e,r,t){for(let i in e)for(let a of e[i]){let o=t[r[i].source];U5(a,o)}return e}function U5(e,r){let t=e.feature,i=r.getFeatureState(t.layer["source-layer"],t.id);t.source=t.layer.source,t.layer["source-layer"]&&(t.sourceLayer=t.layer["source-layer"]),t.state=i}function q5(e,r,t,i){return Xr(this,null,function*(){let a=e;if(e.url?a=(yield mg(yield r.transformRequest(e.url,"Source"),t)).data:yield yc.frameAsync(t,i),!a)return null;let o=j1(yn(a,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(o.vectorLayerIds=a.vector_layers.map(s=>s.id)),o})}function jg(e,r){return r?e.properties[r]:e.id}function bne(e,r){let t=new Map;if(e==null||e.type==null)return t;if(e.type==="Feature"){let i=jg(e,r);return i==null?void 0:(t.set(i,e),t)}if(e.type==="FeatureCollection"){let i=new Set;for(let a of e.features){let o=jg(a,r);if(o==null||i.has(o))return;i.add(o),t.set(o,a)}return t}}function wne(e,r,t){var i,a;let o=[];if(r.removeAll)e.clear();else if(r.remove)for(let s of r.remove){let l=e.get(s);l&&(o.push(l.geometry),e.delete(s))}if(r.add)for(let s of r.add){let l=jg(s,t);if(l==null)continue;let n=e.get(l);n&&o.push(n.geometry),o.push(s.geometry),e.set(l,s)}if(r.update)for(let s of r.update){let l=e.get(s.id);if(!l)continue;let n=!!s.newGeometry,u=s.removeAllProperties||((i=s.removeProperties)==null?void 0:i.length)>0||((a=s.addOrUpdateProperties)==null?void 0:a.length)>0;if(!n&&!u)continue;o.push(l.geometry);let c=Nt({},l);if(e.set(s.id,c),n&&(o.push(s.newGeometry),c.geometry=s.newGeometry),u){if(c.properties=s.removeAllProperties?{}:Nt({},c.properties||{}),s.removeProperties)for(let f of s.removeProperties)delete c.properties[f];if(s.addOrUpdateProperties)for(let{key:f,value:h}of s.addOrUpdateProperties)c.properties[f]=h}}return o}function Tne(e,r,t){if(!e)return r||{};if(!r)return e||{};t&&(V5(e.add,t),V5(r.add,t));let i=G5(e),a=G5(r);Ane(i,a);let o={};if((i.removeAll||a.removeAll)&&(o.removeAll=!0),o.remove=new Set([...i.remove,...a.remove]),o.add=new Map([...i.add,...a.add]),o.update=new Map([...i.update,...a.update]),o.remove.size&&o.add.size)for(let l of o.add.keys())o.remove.delete(l);let s=Ene(o);return t&&Sne(s.add,t),s}function Ane(e,r){r.removeAll&&(e.add.clear(),e.update.clear(),e.remove.clear(),r.remove.clear());for(let t of r.remove)e.add.delete(t),e.update.delete(t);for(let[t,i]of r.update){let a=e.update.get(t);a&&(r.update.set(t,Mne(a,i)),e.update.delete(t))}}function Mne(e,r){let t={id:e.id};if(r.removeAllProperties&&(delete e.removeProperties,delete e.addOrUpdateProperties,delete r.removeProperties),r.removeProperties&&e.addOrUpdateProperties){let i=new Set(r.removeProperties);e.addOrUpdateProperties=e.addOrUpdateProperties.filter(a=>!i.has(a.key))}return(e.removeAllProperties||r.removeAllProperties)&&(t.removeAllProperties=!0),(e.removeProperties||r.removeProperties)&&(t.removeProperties=[...e.removeProperties||[],...r.removeProperties||[]]),(e.addOrUpdateProperties||r.addOrUpdateProperties)&&(t.addOrUpdateProperties=[...e.addOrUpdateProperties||[],...r.addOrUpdateProperties||[]]),(e.newGeometry||r.newGeometry)&&(t.newGeometry=r.newGeometry||e.newGeometry),t}function V5(e,r){if(e)for(let t of e){let i=jg(t,r);i!=null&&(t.id=i)}}function Sne(e,r){if(e)for(let t of e)jg(t,r)!=null&&delete t.id}function G5(e){var r,t;if(!e)return{};let i={};return i.removeAll=e.removeAll,i.remove=new Set(e.remove||[]),i.add=new Map((r=e.add)==null?void 0:r.map(a=>[a.id,a])),i.update=new Map((t=e.update)==null?void 0:t.map(a=>[a.id,a])),i}function Ene(e){let r={};return e.removeAll&&(r.removeAll=e.removeAll),e.remove&&(r.remove=Array.from(e.remove)),e.add&&(r.add=Array.from(e.add.values())),e.update&&(r.update=Array.from(e.update.values())),r}function H5(e){return!e||e.length===0?[]:typeof e[0]=="number"?[e]:e.flatMap(r=>H5(r))}function Zb(e){return e.type==="GeometryCollection"?e.geometries.flatMap(r=>Zb(r)):H5(e.coordinates)}function $5(e){let r=new wh,t;switch(e.type){case"FeatureCollection":t=e.features.flatMap(i=>Zb(i.geometry));break;case"Feature":t=Zb(e.geometry);break;default:t=Zb(e)}if(t.length===0)return r;for(let i of t){let[a,o]=i;r.extend([a,o])}return r}function kne({x:e,y:r,z:t},i=0){let a=B6((e-i)/2**t),o=sg((r+1+i)/2**t),s=B6((e+1+i)/2**t),l=sg((r-i)/2**t);return new wh([a,o],[s,l])}function Cne(e){e*=Math.PI/180;let r=Math.sin(e),t=Math.cos(e);return[(2*t+1)/3,(-Math.sqrt(3)*r-t+1)/3,(Math.sqrt(3)*r-t+1)/3]}function Dne(e){return e>0?1/(1-e):1+e}function Lne(e){return e>0?1-1/(1.001-e):-e}function W5(e,r){let t=Y5(r,"16bit"),i=lp.deserialize({arrayBuffer:t.vertices,length:t.vertices.byteLength/2/2}),a=td.deserialize({arrayBuffer:t.indices,length:t.indices.byteLength/2/3});return new qm(e.createVertexBuffer(i,a0.members),e.createIndexBuffer(a),Ks.simpleSegment(0,0,i.length,a.length))}function Y5(e,r){let t=e.granularity===void 0?1:Math.max(e.granularity,1),i=t+(e.generateBorders?2:0),a=t+(e.extendToNorthPole||e.generateBorders?1:0)+(e.extendToSouthPole||e.generateBorders?1:0),o=i+1,s=a+1,l=e.generateBorders?-1:0,n=e.generateBorders||e.extendToNorthPole?-1:0,u=t+ +!!e.generateBorders,c=t+(e.generateBorders||e.extendToSouthPole?1:0),f=o*s,h=i*a*6,d=o*s>65536;if(d&&r==="16bit")throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let p=d||r==="32bit",g=new Int16Array(f*2),m=0;for(let v=n;v<=c;v++)for(let x=l;x<=u;x++){let S=x/t*Bi;x===-1&&(S=-Kg),x===t+1&&(S=Bi+Kg);let M=v/t*Bi;v===-1&&(M=e.extendToNorthPole?Im:-Kg),v===t+1&&(M=e.extendToSouthPole?Rm:Bi+Kg),g[m++]=S,g[m++]=M}let y=p?new Uint32Array(h):new Uint16Array(h),_=0;for(let v=0;v=1&&y<=512)||_>=1?rv:[p,g,_]}function Rne(e){let r=(1-4/e)/.9921875;return Math.max(0,r)}function X5(e){let[r,t,i,a]=e;return r.x+i.x===t.x+a.x&&r.y+i.y===t.y+a.y}function zne(e,r){let t={};if(!r)return t;for(let i of e){let a=i.layerIds.map(o=>r.getLayer(o)).filter(Boolean);if(a.length!==0){i.layers=a,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map(o=>a.filter(s=>s.id===o)[0]));for(let o of a)t[o.id]=i}}return t}function Ug(){return b2||(b2=new _B),b2}function Z5(e){let r=[];for(let t in e)r.push({id:t,state:e[t]});return r}function Bne(e,r,t,i){let a=pu([],e,r),o=1/a[3]/t*i;return xP(a,a,[o,o,1/a[3],o])}function One(e,r,t,i){let a=i?4:0,o=i?0:4,s=0,l=[],n=[];for(let f=0;f<4;f++){let h=Ed([],e[f+o],e[f+a]),d=np(h);Ws(h,h,1/d),l.push(d),n.push(h)}for(let f=0;f<4;f++){let h=JK(e[f+a],n[f],t);s=h!==null&&h>=0?Math.max(s,h):Math.max(s,l[f])}let u=Nne(e,r),c=jne(t,u);if(c!==null){let f=c/Kl(n[0],u);s=Math.min(s,f)}for(let f=0;f<4;f++){let h=Math.min(s,l[f]);e[f+o]=[e[f+a][0]+n[f][0]*h,e[f+a][1]+n[f][1]*h,e[f+a][2]+n[f][2]*h,1]}}function Nne(e,r){let t=Ed([],e[r[0]],e[r[1]]),i=Ed([],e[r[2]],e[r[1]]),a=[0,0,0,0];return qc(a,uf([],t,i)),a[3]=-Kl(a,e[r[0]]),a}function jne(e,r){let t=pg(e),i=HK([],e,1/t),a=Ed([],r,Ws([],i,Kl(r,i))),o=pg(a);if(o>0){let s=Math.sqrt(1-i[3]*i[3]),l=Ws([],i,-i[3]),n=uh([],l,Ws([],a,s/o));return G4(r,n)}return null}function Une(e,r,t){let i=r.intersectsFrustum(e);if(!t||i===0)return i;let a=r.intersectsPlane(t);return a===0?0:i===2&&a===2?2:1}function K5(e,r,t){let i=0,a=(t-r)/10;for(let o=0;o<10;o++){let s=r+(o+.5)/10*(t-r);i+=a*Math.cos(s)**+e}return i}function HA(e,r){return function(t,i,a,o,s){let l=2*((e-1)/Ku(Math.cos(rl(Qp-s))/Math.cos(rl(Qp)))-1),n=Math.acos(a/o),u=2*K5(l-1,0,rl(s/2)),c=Math.min(rl(Qp),n+rl(s/2)),f=Math.min(c,n-rl(s/2)),h=K5(l-1,f,c),d=Math.atan(i/a),p=Math.hypot(i,a),g=t;return g+=Ku(o/p/Math.max(.5,Math.cos(rl(s/2)))),g+=l*Ku(Math.cos(d))/2,g-=Ku(Math.max(1,h/u/r))/2,g}}function $A(e,r){let t=(r.roundZoom?Math.round:Math.floor)(e.zoom+Ku(e.tileSize/r.tileSize));return Math.max(0,t)}function qne(e,r){let t=Qp-e.pitch-e.fov/2,i=to((15-t)/15,0,1),a=Math.max(500,r??0);return e.elevation+i*a}function Vne(e,r,t){let i=e.planes[1],a=e.points.map(n=>{let u=i[0]*n[0]+i[1]*n[1]+i[2]*n[2]+i[3];if(Math.abs(u)>1e-6)return n;let c=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],f=i[0]*c[0]+i[1]*c[1]+i[2]*c[2];if(f>=-1e-9)return n;let h=r/-f;return[n[0]+c[0]*h,n[1]+c[1]*h,n[2]+c[2]*h,n[3]]}),o=e.planes.map((n,u)=>u===1?[n[0],n[1],n[2],n[3]+r]:n),s=[1/0,1/0,1/0],l=[-1/0,-1/0,-1/0];for(let n of a)for(let u=0;u<3;u++)s[u]=Math.min(s[u],n[u]),l[u]=Math.max(l[u],n[u]);return new T2(a,o,new w2(s,l))}function Om(e,r){let t=e.getCameraFrustum(),i=e.getClippingPlane();if(i&&r.maxContentElevation>0){let M=Math.hypot(i[0],i[1],i[2]);if(M>0){let C=1+r.maxContentElevation/mc,w=to(-i[3]/M,-1,1),k=Math.cos(Math.acos(w)+Math.acos(1/C));i=[i[0],i[1],i[2],-k*M],t=Vne(t,Math.sqrt(C*C-1),e.cameraPosition)}}let a=Fee(e),o=Qo.fromLngLat(e.center,e.elevation),s=qne(e,r.maxContentElevation),l=e.getCoveringTilesDetailsProvider(),n=l.allowVariableZoom(e,r),u=$A(e,r),c=r.minzoom||0,f=r.maxzoom===void 0?e.maxZoom:r.maxzoom,h=Math.min(Math.max(0,u),f),d=2**h,p=[d*a.x,d*a.y,0],g=[d*o.x,d*o.y,0],m=Math.hypot(o.x-a.x,o.y-a.y),y=Math.abs(o.z-a.z),_=Math.hypot(m,y),v=M=>({zoom:0,x:0,y:0,wrap:M,fullyVisible:!1}),x=[],S=[];if(e.renderWorldCopies&&l.allowWorldCopies())for(let M=1;M<=3;M++)x.push(v(-M)),x.push(v(M));for(x.push(v(0));x.length>0;){let M=x.pop(),C=M.x,w=M.y,k=M.fullyVisible,A={x:C,y:w,z:M.zoom},b=l.getTileBoundingVolume(A,M.wrap,s,r);if(!k){let D=Une(t,b,i);if(D===0)continue;k=D===2}let E=l.distanceToTile2d(a.x,a.y,A,b),T=u;n&&(T=(r.calculateTileZoom||bB)(e.zoom+Ku(e.tileSize/r.tileSize),E,y,_,e.fov)),T=(r.roundZoom?Math.round:Math.floor)(T),T=Math.max(0,T);let F=Math.min(T,f);if(M.wrap=l.getWrap(o,A,M.wrap),M.zoom>=F){if(M.zoom>1),z=M.zoom+1;x.push({zoom:z,x:R,y:P,wrap:M.wrap,fullyVisible:k})}}return S.sort((M,C)=>M.distanceSq-C.distanceSq).map(M=>M.tileID)}function J5(e){return e==="raster"||e==="image"||e==="video"}function Gne(e,r,t,i,a,o,s){let l=hs(),n=eJ(r);for(let u of r){let c=e.getTileById(u.key);(c.fadingDirection===0||c.fadeOpacity===0)&&c.resetFadeLogic(),!Hne(e,c,t,l,i,a,s)&&($ne(e,c,t,l,o,s)||Wne(c,n,l,s)||c.resetFadeLogic())}}function Hne(e,r,t,i,a,o,s){if(!r.hasData())return!1;let{tileID:l,fadingRole:n,fadingDirection:u,fadingParentID:c}=r;if(n===0&&u===1&&c)return t[c.key]=c,!0;let f=Math.max(l.overscaledZ-a,o);for(let h=l.overscaledZ-1;h>=f;h--){let d=l.scaledTo(h),p=e.getLoadedTile(d);if(p)return r.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:p.tileID,fadeEndTime:i+s}),p.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:i+s}),t[d.key]=d,!0}return!1}function $ne(e,r,t,i,a,o){if(!r.hasData())return!1;let s=r.tileID.children(a),l=Q5(e,r,s,t,i,a,o);if(l)return!0;for(let n of s)Q5(e,r,n.children(a),t,i,a,o)&&(l=!0);return l}function Q5(e,r,t,i,a,o,s){if(t[0].overscaledZ>=o)return!1;let l=!1;for(let n of t){let u=e.getLoadedTile(n);if(!u)continue;let{fadingRole:c,fadingDirection:f,fadingParentID:h}=u;(c!==0||f!==0||!h)&&(u.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:r.tileID,fadeEndTime:a+s}),r.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:a+s})),i[n.key]=n,l=!0}return l}function Wne(e,r,t,i){let a=e.tileID;if(e.selfFading)return!0;if(e.hasData())return!1;if(r.has(a)){let o=t+i;return e.setSelfFadeLogic(o),!0}return!1}function Yne(e,r){if(r<=0)return!1;let t=hs();for(let i of e.getAllTiles())if(i.fadeEndTime>=t)return!0;return!1}function Xne(e,r){var t,i,a;let o=r.getRenderableIds();for(let s of o){if(!((t=e.neighboringTiles)!=null&&t[s]))continue;let l=r.getTileById(s);e.neighboringTiles[s].backfilled||ez(e,l),!((a=(i=l.neighboringTiles)==null?void 0:i[e.tileID.key])!=null&&a.backfilled)&&ez(l,e)}}function ez(e,r){var t;e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0;let i=r.tileID.canonical.x-e.tileID.canonical.x,a=r.tileID.canonical.y-e.tileID.canonical.y,o=2**e.tileID.canonical.z,s=r.tileID.key;(i!==0||a!==0)&&(Math.abs(a)>1||(Math.abs(i)>1&&(Math.abs(i+o)===1?i+=o:Math.abs(i-o)===1&&(i-=o)),r.dem&&e.dem&&(e.dem.backfillBorder(r.dem,i,a),(t=e.neighboringTiles)!=null&&t[s]&&(e.neighboringTiles[s].backfilled=!0))))}function Kb(e,r,t,i,a){return a?e?e(r,t)+i:i===0?void 0:i:i}function Jb(e,r){let t=!0;return e==="always"||(e==="never"||r==="never")&&(t=!1),t}function Zne(e,r){let t=1/(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]),i=1/(r[8]*r[8]+r[9]*r[9]+r[10]*r[10]),a=r[0]*t,o=r[4]*t,s=r[8]*i,l=r[1]*t,n=r[5]*t,u=r[9]*i,c=r[2]*t,f=r[6]*t,h=r[10]*i;e[0]=a,e[1]=o,e[2]=s,e[4]=l,e[5]=n,e[6]=u,e[8]=c,e[9]=f,e[10]=h;let d=r[12],p=r[13],g=r[14];return e[12]=-a*d-l*p-c*g,e[13]=-o*d-n*p-f*g,e[14]=-s*d-u*p-h*g,e[3]=0,e[7]=0,e[11]=0,e[15]=1,e}function Kne(e,r){return e[0]=1/r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1/r[5],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=1/r[14],e[12]=0,e[13]=0,e[14]=-1,e[15]=r[10]/r[14],e}function Jne(e,r){let t=1/(r[0]*r[5]-r[1]*r[4]);return e[0]=r[5]*t,e[1]=-r[1]*t,e[2]=0,e[3]=0,e[4]=-r[4]*t,e[5]=r[0]*t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1/r[10],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1/r[15],e}function WA(e,r,t){let i=zp();if(!e){let{vecSouth:a,vecEast:o}=YA(r),s=D5();s[0]=o[0],s[1]=o[1],s[2]=a[0],s[3]=a[1],Vae(s,s),i[0]=s[0],i[1]=s[1],i[4]=s[2],i[5]=s[3]}return Xu(i,i,[1/t,1/t,1]),i}function Qne(e,r,t,i){if(e){let a=zp();if(!r){let{vecSouth:o,vecEast:s}=YA(t);a[0]=s[0],a[1]=s[1],a[4]=o[0],a[5]=o[1]}return Xu(a,a,[i,i,1]),a}return t.pixelsToClipSpaceMatrix}function YA(e){let r=Math.cos(e.rollInRadians),t=Math.sin(e.rollInRadians),i=Math.cos(e.pitchInRadians),a=Math.cos(e.bearingInRadians),o=Math.sin(e.bearingInRadians),s=V4();s[0]=-a*i*t-o*r,s[1]=-o*i*t+a*r;let l=g9(s);l<1e-9?y9(s):m9(s,s,1/l);let n=V4();n[0]=a*i*r-o*t,n[1]=o*i*r+a*t;let u=g9(n);return u<1e-9?y9(n):m9(n,n,1/u),{vecEast:n,vecSouth:s}}function ev(e,r,t){var i,a;return Kb(e.getElevation,r,t,(i=e.heightOffset)!=null?i:0,(a=e.heightAnchorGround)!=null?a:!0)}function XA(e,r,t,i){let a;i==null?(a=[e,r,0,1],JA(a,a,t)):(a=[e,r,i,1],pu(a,a,t));let o=a[3];return{point:new Wr(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function tz(e,r){return .5+e/r*.5}function eoe(e,r){return e.x>=-r[0]&&e.x<=r[0]&&e.y>=-r[1]&&e.y<=r[1]}function toe(e,r,t,i,a,o,s,l,n,u,c,f,h){let d=t?e.textSizeData:e.iconSizeData,p=dx(d,r.transform.zoom),g=[256/r.width*2+1,256/r.height*2+1],m=t?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;m.clear();let y=e.lineVertexArray,_=t?e.text.placedSymbolArray:e.icon.placedSymbolArray,v=r.transform.width/r.transform.height,x=!1;for(let S=0;S<_.length;S++){let M=_.get(S);if(M.hidden||M.writingMode===2&&!x){Nm(M.numGlyphs,m);continue}x=!1;let C=new Wr(M.anchorX,M.anchorY),w={getElevation:h,pitchedLabelPlaneMatrix:i,lineVertexArray:y,pitchWithMap:o,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:r.transform,tileAnchorPoint:C,unwrappedTileID:n,width:u,height:c,translation:f},k=oz(M.anchorX,M.anchorY,w);if(!eoe(k.point,g)){Nm(M.numGlyphs,m);continue}let A=k.signedDistanceFromCamera,b=tz(r.transform.cameraToCenterDistance,A),E=G6(d,p,M),T=o?E*r.transform.getPitchedTextCorrection(M.anchorX,M.anchorY,n)/b:E*b,F=az({projectionContext:w,pitchedLabelPlaneMatrixInverse:a,symbol:M,fontSize:T,flip:!1,keepUpright:s,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:v,rotateToLine:l});x=F.useVertical,(F.notEnoughRoom||x||F.needsFlipping&&az({projectionContext:w,pitchedLabelPlaneMatrixInverse:a,symbol:M,fontSize:T,flip:!0,keepUpright:s,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:v,rotateToLine:l}).notEnoughRoom)&&Nm(M.numGlyphs,m)}t?e.text.dynamicLayoutVertexBuffer.updateData(m):e.icon.dynamicLayoutVertexBuffer.updateData(m)}function rz(e,r,t,i,a,o,s,l){let n=o.glyphStartIndex+o.numGlyphs,u=o.lineStartIndex,c=o.lineStartIndex+o.lineLength,f=r.getoffsetX(o.glyphStartIndex),h=r.getoffsetX(n-1),d=e2(e*f,t,i,a,o.segment,u,c,l,s);if(!d)return null;let p=e2(e*h,t,i,a,o.segment,u,c,l,s);return!p||l.projectionCache.anyProjectionOccluded?null:{first:d,last:p}}function iz(e,r,t,i){return e===1&&Math.abs(t.y-r.y)>Math.abs(t.x-r.x)*i?{useVertical:!0}:(e===2?r.yt.x)?{needsFlipping:!0}:null}function az(e){let{projectionContext:r,pitchedLabelPlaneMatrixInverse:t,symbol:i,fontSize:a,flip:o,keepUpright:s,glyphOffsetArray:l,dynamicLayoutVertexArray:n,aspectRatio:u,rotateToLine:c}=e,f=a/24,h=i.lineOffsetX*f,d=i.lineOffsetY*f,p;if(i.numGlyphs>1){let g=i.glyphStartIndex+i.numGlyphs,m=i.lineStartIndex,y=i.lineStartIndex+i.lineLength,_=rz(f,l,h,d,o,i,c,r);if(!_)return{notEnoughRoom:!0};let v=Qb(_.first.point.x,_.first.point.y,r,t),x=Qb(_.last.point.x,_.last.point.y,r,t);if(s&&!o){let S=iz(i.writingMode,v,x,u);if(S)return S}p=[_.first];for(let S=i.glyphStartIndex+1;S0?v.point:nz(r.tileAnchorPoint,_,m,1,r),S=Qb(m.x,m.y,r,t),M=Qb(x.x,x.y,r,t),C=iz(i.writingMode,S,M,u);if(C)return C}let g=e2(f*l.getoffsetX(i.glyphStartIndex),h,d,o,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,r,c);if(!g||r.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};p=[g]}for(let g of p)_x(n,g.point,g.angle);return{}}function nz(e,r,t,i,a){let o=e.add(e.sub(r)._unit()),s=tv(o.x,o.y,a).point,l=t.sub(s);return t.add(l._mult(i/l.mag()))}function ZA(e,r,t){let i=r.projectionCache;if(i.projections[e])return i.projections[e];let a=new Wr(r.lineVertexArray.getx(e),r.lineVertexArray.gety(e)),o=tv(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[e]=o.point,i.anyProjectionOccluded||(i.anyProjectionOccluded=o.isOccluded),o.point;let s=e-t.direction,l=t.distanceFromAnchor===0?r.tileAnchorPoint:new Wr(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),n=t.absOffsetX-t.distanceFromAnchor+1;return nz(l,a,t.previousVertex,n,r)}function tv(e,r,t){let i=e+t.translation[0],a=r+t.translation[1],o;return t.pitchWithMap?(o=XA(i,a,t.pitchedLabelPlaneMatrix,ev(t,i,a)),o.isOccluded=!1):(o=t.transform.projectTileCoordinates(i,a,t.unwrappedTileID,ev(t,i,a)),o.point.x=(o.point.x*.5+.5)*t.width,o.point.y=(-o.point.y*.5+.5)*t.height),o}function Qb(e,r,t,i){if(t.pitchWithMap){let a=[e,r,0,1];pu(a,a,i);let o=a[0]/a[3],s=a[1]/a[3];return t.transform.projectTileCoordinates(o,s,t.unwrappedTileID,ev(t,o,s)).point}return{x:e/t.width*2-1,y:1-r/t.height*2}}function oz(e,r,t){return t.transform.projectTileCoordinates(e,r,t.unwrappedTileID,ev(t,e,r))}function KA(e,r,t){return e._unit()._perp()._mult(r*t)}function roe(e,r,t,i,a,o,s,l,n){if(l.projectionCache.offsets[e])return l.projectionCache.offsets[e];let u=t.add(r);if(e+n.direction=a)return l.projectionCache.offsets[e]=u,u;let c=ZA(e+n.direction,l,n),f=KA(c.sub(t),s,n.direction),h=t.add(f),d=c.add(f);return l.projectionCache.offsets[e]=aJ(o,u,h,d)||u,l.projectionCache.offsets[e]}function e2(e,r,t,i,a,o,s,l,n){let u=i?e-r:e+r,c=u>0?1:-1,f=0;i&&(c*=-1,f=Math.PI),c<0&&(f+=Math.PI);let h=c>0?o+a:o+a+1,d;l.projectionCache.cachedAnchorPoint?d=l.projectionCache.cachedAnchorPoint:(d=tv(l.tileAnchorPoint.x,l.tileAnchorPoint.y,l).point,l.projectionCache.cachedAnchorPoint=d);let p=d,g=d,m,y,_=0,v=0,x=Math.abs(u),S=[],M;for(;_+v<=x;){if(h+=c,h=s)return null;_+=v,g=p,y=m;let A={absOffsetX:x,direction:c,distanceFromAnchor:_,previousVertex:g};if(p=ZA(h,l,A),t===0)S.push(g),M=p.sub(g);else{let b,E=p.sub(g);b=E.mag()===0?KA(ZA(h+c,l,A).sub(p),t,c):KA(E,t,c),y||(y=g.add(b)),m=roe(h,b,p,o,s,y,t,l,A),S.push(y),M=m.sub(y)}v=M.mag()}let C=(x-_)/v,w=M._mult(C)._add(y||g),k=f+Math.atan2(p.y-g.y,p.x-g.x);return S.push(w),{point:w,angle:n?k:0,path:S}}function Nm(e,r){for(let t=0;t{let a=XA(i.x,i.y,t,ev(r,i.x,i.y)),o=r.transform.projectTileCoordinates(a.point.x,a.point.y,r.unwrappedTileID,ev(r,a.point.x,a.point.y));return o.point.x=(o.point.x*.5+.5)*r.width,o.point.y=(-o.point.y*.5+.5)*r.height,o})}function aoe(e){let r=0,t=0,i=0,a=0;for(let o=0;ot&&(t=a,r=i));return e.slice(r,r+t)}function sz(e,r,t,i,a){let{horizontalAlign:o,verticalAlign:s}=fx(e),l=-(o-.5)*r,n=-(s-.5)*t;return new Wr(l+i[0]*a,n+i[1]*a)}function lz(e,r,t,i,a,o){(!i||i.length===0)&&(i=[0,0,0,0]);let s=i[0]-100,l=i[1]-100,n=i[2]-100,u=i[3]-100;e.emplaceBack(+!!r,+!!t,a||0,o||0,s,l),e.emplaceBack(+!!r,+!!t,a||0,o||0,n,l),e.emplaceBack(+!!r,+!!t,a||0,o||0,n,u),e.emplaceBack(+!!r,+!!t,a||0,o||0,s,u)}function uz(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return 4294967295;let r=+!!e.placed,t=Math.floor(e.opacity*127);return t*CB+r*DB+t*LB+r*FB+t*512+r*256+t*2+r}function QA(e,r,t,i,a,o){if(a-i<=t)return;let s=i+a>>1;cz(e,r,s,i,a,o),QA(e,r,t,i,s-1,1-o),QA(e,r,t,s+1,a,1-o)}function cz(e,r,t,i,a,o){for(;a>i;){if(a-i>600){let u=a-i+1,c=t-i+1,f=Math.log(u),h=.5*Math.exp(2*f/3),d=.5*Math.sqrt(f*h*(u-h)/u)*(c-u/2<0?-1:1);cz(e,r,t,Math.max(i,Math.floor(t-c*h/u+d)),Math.min(a,Math.floor(t+(u-c)*h/u+d)),o)}let s=r[2*t+o],l=i,n=a;for(qg(e,r,i,t),r[2*a+o]>s&&qg(e,r,i,a);ls;)n--}r[2*i+o]===s?qg(e,r,i,n):(n++,qg(e,r,n,a)),n<=t&&(i=n+1),t<=n&&(a=n-1)}}function qg(e,r,t,i){eM(e,t,i),eM(r,2*t,2*i),eM(r,2*t+1,2*i+1)}function eM(e,r,t){let i=e[r];e[r]=e[t],e[t]=i}function fz(e,r,t,i){let a=e-t,o=r-i;return a*a+o*o}function Yo(e,r){let t=/#pragma maplibre: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=r.match(/in ([\w]+) ([\w]+)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=r.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=o?o.concat(a):a,l=i?i.length:0,n={};return e=e.replace(t,(u,c,f,h,d)=>(n[d]=!0,c==="define"?` #ifndef HAS_UNIFORM_u_${d} in ${f} ${h} ${d}; #else @@ -2757,9 +2757,9 @@ uniform ${f} ${h} u_${d}; #else ${f} ${h} ${d} = u_${d}; #endif -`}),{fragmentSource:e,vertexSource:r,staticAttributes:i,staticUniforms:s}}function t2(e,r){if(!e.renderWorldCopies||e.lngRange)return;let t=r.lng-e.center.lng;r.lng+=t>180?-360:t<-180?360:0}function hz(e){return Math.max(0,Math.floor(e))}function tM(e,r,t,i){if(i<0||i>=1)return UM;let a=Math.floor(t),o=t-a;for(let s of e.zooms){let l=1<a;o++){let s=(t+i)/2;r(e,s)?i=s:t=s}return{lo:t,hi:i}}function r2(e,r){return tM(e.index,e.exaggeration,(e.near[0]+r*e.dx)/e.worldSize,(e.near[1]+r*e.dy)/e.worldSize)}function i2(e,r){return dz(r2(e,r),e.near[2]+r*e.dz)}function vz(){To("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function mz(e){if(e.useSlerp)if(e.k<1){let r=A9(e.startEulerAngles.roll,e.startEulerAngles.pitch,e.startEulerAngles.bearing),t=A9(e.endEulerAngles.roll,e.endEulerAngles.pitch,e.endEulerAngles.bearing),i=new Float64Array(4);C_(i,r,t,e.k);let a=cJ(i);e.tr.setRoll(a.roll),e.tr.setPitch(a.pitch),e.tr.setBearing(a.bearing)}else e.tr.setRoll(e.endEulerAngles.roll),e.tr.setPitch(e.endEulerAngles.pitch),e.tr.setBearing(e.endEulerAngles.bearing);else e.tr.setRoll(Zs.number(e.startEulerAngles.roll,e.endEulerAngles.roll,e.k)),e.tr.setPitch(Zs.number(e.startEulerAngles.pitch,e.endEulerAngles.pitch,e.k)),e.tr.setBearing(Zs.number(e.startEulerAngles.bearing,e.endEulerAngles.bearing,e.k))}function gz(e,r,t,i,a){let o=a.padding,s=Md(a.worldSize,t.getNorthWest()),l=Md(a.worldSize,t.getNorthEast()),n=Md(a.worldSize,t.getSouthEast()),u=Md(a.worldSize,t.getSouthWest()),c=rl(-i),f=s.rotate(c),h=l.rotate(c),d=n.rotate(c),p=u.rotate(c),g=new Wr(Math.max(f.x,h.x,p.x,d.x),Math.max(f.y,h.y,p.y,d.y)),m=new Wr(Math.min(f.x,h.x,p.x,d.x),Math.min(f.y,h.y,p.y,d.y)),y=g.sub(m),_=a.width-(o.left+o.right+r.left+r.right),v=a.height-(o.top+o.bottom+r.top+r.bottom),x=_/y.x,S=v/y.y;if(S<0||x<0){vz();return}let M=Math.min(Ku(a.scale*Math.min(x,S)),e.maxZoom),C=Wr.convert(e.offset),w=(r.left-r.right)/2,k=(r.top-r.bottom)/2,A=new Wr(w,k).rotate(rl(i)),b=C.add(A).mult(a.scale/Vc(M));return{center:sg(a.worldSize,s.add(n).div(2).sub(b)),zoom:M,bearing:i}}function yz(e){let r=Nm(e.worldSize,e.center.lat);return 2*Math.PI*r}function noe(e,r,t){let i=ru(r),a=ru(t),o=Kl(i,a),s=Math.acos(o),l=yz(e);return s/(2*Math.PI)*l}function ooe(e,r){return[F0(e*Math.PI*2+Math.PI,Math.PI*2),2*Math.atan(Math.exp(Math.PI-r*Math.PI*2))-Math.PI*.5]}function soe(e,r){let t=Math.cos(r),i=new Float64Array(3);return i[0]=Math.sin(e)*t,i[1]=Math.sin(r),i[2]=Math.cos(e)*t,i}function r0(e,r,t,i,a){let o=1/(1<1e-6){let i=e[0]/t,a=e[2]/t,o=Math.acos(a),s=(i>0?o:-o)/Math.PI*180;return new An(ch(s,-180,180),r)}return new An(0,r)}function loe(e,r){return q4(Bp(),-e.lng,-e.lat,r)}function uoe(e){let r=e[0],t=e[1],i=e[2],a=e[3];return{lng:-Math.atan2(2*(a*r+t*i),1-2*(r*r+t*t))*180/Math.PI,lat:-Math.asin(to(2*(a*t-i*r),-1,1))*180/Math.PI,bearing:Math.atan2(2*(a*i+r*t),1-2*(t*t+i*i))*180/Math.PI}}function xz(e,r){let t=e.cameraPosition,i=ap(t);if(i<=1)return e.screenPointToLocation(r);let a=fs();qc(a,t);let o=e.getRayDirectionFromPixel(r),s=-Kl(o,a),l=fs();k_(l,o,a,s);let n=ap(l);if(n<1e-9)return e.screenPointToLocation(r);let u=Math.atan2(n,s),c=Math.asin(1/i)*.9;if(u=0?90:-90,l=e.locationToScreenPoint(new An(0,s)),n=r.x-l.x,u=r.y-l.y,c=n*n+u*u,f=to(1-(Wh-Math.abs(o))/12,0,1),h=f*f*(3-2*f),d=F0(i-a+180,360)-180,p=0;if(h>0&&t){let g=(n*t.y-u*t.x)/Math.max(c,400);p=(s>0?1:-1)*g*180/Math.PI}return a+(1-h)*d+h*p}function hoe(e){let r=fs();return r[0]=e[0]*-e[3],r[1]=e[1]*-e[3],r[2]=e[2]*-e[3],{center:r,radius:Math.sqrt(1-e[3]*e[3])}}function doe(e,r,t){let i=fs();Sd(i,t,e);let a=fs();return k_(a,e,i,r/dg(i)),a}function a2(e){return Math.cos(e*Math.PI/180)}function Lu(e,r){let t=a2(e),i=a2(r);return Ku(i/t)}function poe(e,r){return 360/yz({worldSize:e,center:{lat:r}})}function voe(e,r){let t=e.rotate(r.bearingInRadians),i=r.zoom+Lu(r.center.lat,0),a=Xv(1/a2(r.center.lat),1/a2(Math.min(Math.abs(r.center.lat),60)),P_(i,7,3,0,1)),o=poe(r.worldSize,r.center.lat);return new An(r.center.lng-t.x*o*a,to(r.center.lat+t.y*o,-Wh,Wh))}function rM(e){let r=.5*e,t=Math.sin(r),i=Math.cos(r);return Math.log(t+i)-Math.log(i-t)}function bz(e,r,t,i){let a=e.lat+t*i;if(Math.abs(t)>1){let o=e.lat+t,s=(Math.sign(o)===Math.sign(e.lat)?Math.abs(e.lat):-Math.abs(e.lat))*Math.PI/180,l=Math.abs(e.lat+t)*Math.PI/180,n=rM(s+i*(l-s)),u=rM(s),c=rM(l),f=(n-u)/(c-u),h=e.lng+r*f;return new An(h,a)}{let o=e.lng+r*i;return new An(o,a)}}function n2(e,r,t=1){let i=Kl(e,r),a=t*t,o=fs(),s=fs();Ws(s,r,i),Sd(o,e,s);let l=a-Kl(o,o);if(l<0)return null;let n=Kl(e,e)-a,u=-i+(i<0?1:-1)*Math.sqrt(l),c=n/u,f=u;return{tMin:Math.min(c,f),tMax:Math.max(c,f)}}function o2(e,r,t){let i=e-r;return i<0?-i:Math.max(0,i-t)}function iM(e,r,t,i,a){let o=e-t,s;return s=o<0?Math.min(-o,1+o-a):o>a?Math.min(Math.max(o-a,0),1-o):0,Math.max(s,o2(r,i,a))}function wz(e,r){let t=1/0,i=-1/0;for(let a of r){let o=Kl(e,a);t=Math.min(t,o),i=Math.max(i,o)}return{min:t,max:i}}function Tz(e,r){let t=fs();k_(t,e.origin,e.direction,r);let i=ap(t),a=fs();Ws(a,t,1/i);let o=qg(a),s=Qo.fromLngLat(o),l=new Qo(s.x,to(s.y,0,.999999999)),n=tM(e.index,e.exaggeration,l.x,l.y),u=Math.abs(o.lat)>85.051129?0:n.elevation;return{sample:ar(Ot({},n),{elevation:u}),radius:i,mercator:l}}function Az(e,r){let{sample:t,radius:i}=Tz(e,r);return dz(t,(i-1)*mc)}function moe(e,r,t){let i={constrainOverride:r};if(Array.isArray(e)){let a=new VM({type:e},t);return{projection:a,transform:new $M(i),cameraHelper:new YM(a)}}switch(e){case"mercator":return{projection:new M2,transform:new Kg(i),cameraHelper:new Jg};case"globe":{let a=new VM({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]},{});return{projection:a,transform:new $M(i),cameraHelper:new YM(a)}}case"vertical-perspective":return{projection:new qM,transform:new HM(i),cameraHelper:new WM};default:return To(`Unknown projection name: ${e}. Falling back to mercator projection.`),{projection:new M2,transform:new Kg(i),cameraHelper:new Jg}}}function goe(e,r){for(let[t,i]of Object.entries(Qg)){let a=e.getUniformBlockIndex(r,t);a!==e.INVALID_INDEX&&e.uniformBlockBinding(r,a,i)}}function aM(e){let r={},t=0;for(let{name:i,type:a}of e){let[o,s]=uO[a];t=Math.ceil(t/s)*s,r[i]=t,t+=o}return{offsets:r,contentWords:t,sizeWords:Math.ceil(t/4)*4}}function yoe(e){return new F2(e,Qg.ProjectionUBO,XM)}function _oe(e,r){let t=e.pending;t.set(r.mainMatrix,iv.u_projection_matrix),t.set(r.fallbackMatrix,iv.u_projection_fallback_matrix),t.set(r.tileMercatorCoords,iv.u_projection_tile_mercator_coords),t.set(r.clippingPlane,iv.u_projection_clipping_plane),t[iv.u_projection_transition]=r.projectionTransition,e.pendingWords[iv.u_projection_clip_antimeridian]=+!!r.clipAntimeridian,e.upload()}function xoe(e){return new F2(e,Qg.TerrainUBO,ZM)}function boe(e,r){let t=e.pending;t.set(r.u_terrain_matrix,ey.u_terrain_matrix),t.set(r.u_terrain_unpack,ey.u_terrain_unpack),t[ey.u_terrain_dim]=r.u_terrain_dim,t[ey.u_terrain_exaggeration]=r.u_terrain_exaggeration,e.upload()}function nM(e){let r=[];for(let t of e){if(t===null)continue;let i=t.split(" ");r.push(i.pop())}return r}function woe(e,r){let t=new Set([e.INT,e.INT_VEC2,e.INT_VEC3,e.INT_VEC4,e.UNSIGNED_INT,e.UNSIGNED_INT_VEC2,e.UNSIGNED_INT_VEC3,e.UNSIGNED_INT_VEC4]),i=new Set,a=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES);for(let o=0;o>16,l>>16],u_pixel_coord_lower:[s&65535,l&65535]}}function Toe(e,r,t,i){let a=t.patternAtlas.getPattern(e.from.toString()),o=t.patternAtlas.getPattern(e.to.toString()),{width:s,height:l}=t.patternAtlas.getPixelSize(),n=2**i.tileID.overscaledZ,u=i.tileSize*2**t.transform.tileZoom/n,c=u*(i.tileID.canonical.x+i.tileID.wrap*n),f=u*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,l],u_mix:r.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:r.fromScale,u_scale_b:r.toScale,u_tile_units_to_pixels:1/Cf(i,1,t.transform.tileZoom),u_pixel_coord_upper:[c>>16,f>>16],u_pixel_coord_lower:[c&65535,f&65535]}}function Aoe(e,r){let t=2**r.canonical.z,i=r.canonical.y;return[new Qo(0,i/t).toLngLat().lat,new Qo(0,(i+1)/t).toLngLat().lat]}function oM(e,r){return 1/Cf(e,1,r.tileZoom)}function Sz(e,r,t){return Op(e.transform,r,t.paint.get("line-translate"),t.paint.get("line-translate-anchor"))}function Moe(e){return new F2(e,Qg.FrameUBO,nS)}function Soe(e,r){let t=e.pending,{transform:i}=r,a=r.context.gl;t[pf.u_units_to_pixels]=1/i.pixelsToGLUnits[0],t[pf.u_units_to_pixels+1]=1/i.pixelsToGLUnits[1],t[pf.u_world_size]=a.drawingBufferWidth,t[pf.u_world_size+1]=a.drawingBufferHeight,t[pf.u_camera_to_center_distance]=i.cameraToCenterDistance,t[pf.u_symbol_fade_change]=r.options.fadeDuration?r.symbolFadeChange:1,t[pf.u_aspect_ratio]=i.width/i.height,t[pf.u_device_pixel_ratio]=r.pixelRatio,t[pf.u_viewport_size]=i.width,t[pf.u_viewport_size+1]=i.height,t[pf.u_pixel_extrude_scale]=1/i.width,t[pf.u_pixel_extrude_scale+1]=1/i.height,t[pf.u_pitch]=i.pitch/360*2*Math.PI,e.upload()}function Ez(e,r,t,i,a){var o,s;let l=e.context,n=e.transform,u=l.gl,c=e.useProgram("collisionBox"),f=[],h=0,d=0;for(let v of i){let x=r.getTile(v).getBucket(t);if(!x)continue;let S=a?x.textCollisionBox:x.iconCollisionBox,M=x.collisionCircleArray;M.length>0&&(f.push({circleArray:M,circleOffset:d,coord:v}),h+=M.length/4,d=h),S&&c.draw(l,u.LINES,Lo.disabled,es.disabled,e.colorModeForRenderPass(),Ko.disabled,null,(o=e.style.map.terrain)==null?void 0:o.getTerrainData(v),n.getProjectionData({overscaledTileID:v,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),t.id,S.layoutVertexBuffer,S.indexBuffer,S.segments,null,e.transform.zoom,null,null,S.collisionVertexBuffer)}if(!a||!f.length)return;let p=e.useProgram("collisionCircle"),g=new xI;g.resize(h*4),g._trim();let m=0;for(let v of f)for(let x=0;xf.getElevation(p,w,k):void 0;Foe(m,h,d,n,c,x,M,_,S,Op(c,g,s,l),p.toUnwrapped(),C,t.layout.get("symbol-height-anchor")==="ground")}}}function Loe(e,r,t,i,a,o){let s=r.tileAnchorPoint.add(new Wr(r.translation[0],r.translation[1]));if(r.pitchWithMap){let l=i.mult(o);t||(l=l.rotate(-a));let n=s.add(l);return XA(n.x,n.y,r.pitchedLabelPlaneMatrix,Q0(r,n.x,n.y)).point}if(t){let l=ev(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(e),n=Math.atan(l.y/l.x)+(l.x<0?Math.PI:0);return e.add(i.rotate(n))}return e.add(i)}function Foe(e,r,t,i,a,o,s,l,n,u,c,f,h){let d=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,g=e.icon.dynamicLayoutVertexArray,m={};p.clear();for(let y=0;y=0&&(m[_.associatedIconIndex]={shiftedAnchor:P,angle:z})}}if(n){g.clear();let y=e.icon.placedSymbolArray;for(let _=0;_e.style.map.terrain.getElevation(F,ie,Q):void 0;toe(R,e,a,V,ae,v,u,t.layout.get("text-rotation-alignment")==="map",F.toUnwrapped(),y.width,y.height,q,ee)}let le=a&&k||te,ce=v?V:e.transform.clipSpaceToPixelsMatrix,pe=x||le?jN:ce,xe=I&&t.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ye;ye=I?R.iconsInText?$O(L.kind,G,S,v,x,le,e,pe,j,q,X,Z,b,ne,se):iS(L.kind,G,S,v,x,le,e,pe,j,q,a,X,xe,b,ne,se):rS(L.kind,G,S,v,x,le,e,pe,j,q,a,X,b,ne,se);let fe={program:O,buffers:P,uniformValues:ye,projectionData:Y,atlasTexture:J,atlasTextureIcon:H,atlasInterpolation:N,atlasInterpolationIcon:$,isSDF:I,hasHalo:xe};if(M&&R.canOverlap){C=!0;let ae=P.segments.get();for(let ee of ae)A.push({segments:new Ks([ee]),sortKey:ee.sortKey,state:fe,terrainData:W})}else A.push({segments:P.segments,sortKey:0,state:fe,terrainData:W})}C&&A.sort((F,D)=>F.sortKey-D.sortKey);let E=(p=t.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(null))!=null?p:1/0,T=t.layout.get("text-letter-spacing").constantOr(0)*24<0||E>1;for(let F of A){let D=F.state;g.activeTexture.set(m.TEXTURE0),D.atlasTexture.bind(D.atlasInterpolation,m.CLAMP_TO_EDGE),D.atlasTextureIcon&&(g.activeTexture.set(m.TEXTURE1),D.atlasTextureIcon&&D.atlasTextureIcon.bind(D.atlasInterpolationIcon,m.CLAMP_TO_EDGE));let R=D.isSDF&&D.hasHalo;if(R){let P=D.uniformValues;P.u_is_halo=1,T&&(P.u_is_plain=0,Cz(D.buffers,F.segments,t,e,D.program,w,c,f,P,D.projectionData,F.terrainData),P.u_is_halo=0,P.u_is_plain=1)}Cz(D.buffers,F.segments,t,e,D.program,w,c,f,D.uniformValues,D.projectionData,F.terrainData),R&&!T&&(D.uniformValues.u_is_halo=0)}}function Cz(e,r,t,i,a,o,s,l,n,u,c){let f=i.context,h=f.gl;a.draw(f,h.TRIANGLES,o,s,l,Ko.backCCW,n,c,u,t.id,e.layoutVertexBuffer,e.indexBuffer,r,t.paint,i.transform.zoom,e.programConfigurations.get(t.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Ioe(e,r,t,i,a){var o;if(a.currentPass!=="translucent")return;let{isRenderingToTexture:s}=a,l=t.paint.get("circle-opacity"),n=t.paint.get("circle-stroke-width"),u=t.paint.get("circle-stroke-opacity"),c=!t.layout.get("circle-sort-key").isConstant();if(l.constantOr(1)===0&&(n.constantOr(1)===0||u.constantOr(1)===0))return;let f=e.context,h=f.gl,d=e.transform,p=e.getDepthModeForSublayer(0,Lo.ReadOnly),g=es.disabled,m=e.colorModeForRenderPass(),y=[],_=d.getCircleRadiusCorrection();for(let v of i){let x=r.getTile(v),S=x.getBucket(t);if(!S)continue;let M=t.paint.get("circle-translate"),C=t.paint.get("circle-translate-anchor"),w=Op(d,x,M,C),k=S.programConfigurations.get(t.id),A=e.useProgram("circle",k),b=S.layoutVertexBuffer,E=S.indexBuffer,T=(o=e.style.map.terrain)==null?void 0:o.getTerrainData(v),F={programConfiguration:k,program:A,layoutVertexBuffer:b,indexBuffer:E,uniformValues:wO(e,x,t,w,_),terrainData:T,projectionData:d.getProjectionData({overscaledTileID:v,applyGlobeMatrix:!s,applyTerrainMatrix:!0})};if(c){let D=S.segments.get();for(let R of D)y.push({segments:new Ks([R]),sortKey:R.sortKey,state:F})}else y.push({segments:S.segments,sortKey:0,state:F})}c&&y.sort((v,x)=>v.sortKey-x.sortKey);for(let v of y){let{programConfiguration:x,program:S,layoutVertexBuffer:M,indexBuffer:C,uniformValues:w,terrainData:k,projectionData:A}=v.state,b=v.segments;S.draw(f,h.TRIANGLES,p,g,m,Ko.backCCW,w,k,A,t.id,M,C,b,t.paint,e.transform.zoom,x)}}function Roe(e,r,t,i,a){if(t.paint.get("heatmap-opacity")===0)return;let o=e.context,{isRenderingToTexture:s,isRenderingGlobe:l}=a;if(e.style.map.terrain){for(let n of i){let u=r.getTile(n);r.hasRenderableParent(n)||(a.currentPass==="offscreen"?Ooe(e,u,t,n,l):a.currentPass==="translucent"&&Noe(e,t,n,s,l))}o.viewport.set([0,0,e.width,e.height])}else a.currentPass==="offscreen"?zoe(e,r,t,i):a.currentPass==="translucent"&&Boe(e,t)}function zoe(e,r,t,i){let a=e.context,o=a.gl,s=e.transform,l=es.disabled,n=new cl([o.ONE,o.ONE],ro.transparent,[!0,!0,!0,!0]);joe(a,e,t),a.clear({color:ro.transparent});for(let u of i){if(r.hasRenderableParent(u))continue;let c=r.getTile(u),f=c.getBucket(t);if(!f)continue;let h=f.programConfigurations.get(t.id),d=e.useProgram("heatmap",h),p=s.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),g=s.getCircleRadiusCorrection();d.draw(a,o.TRIANGLES,Lo.disabled,l,n,Ko.backCCW,eS(c,s.zoom,t.paint.get("heatmap-intensity"),g),null,p,t.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,t.paint,s.zoom,h)}a.viewport.set([0,0,e.width,e.height])}function Boe(e,r){let t=e.context,i=t.gl;t.setColorMode(e.colorModeForRenderPass());let a=r.heatmapFbos.get(Dg);a&&(t.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),t.activeTexture.set(i.TEXTURE1),Lz(t,r).bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(t,i.TRIANGLES,Lo.disabled,es.disabled,e.colorModeForRenderPass(),Ko.disabled,tS(e,r,0,1),null,null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom))}function Ooe(e,r,t,i,a){let o=e.context,s=o.gl,l=es.disabled,n=new cl([s.ONE,s.ONE],ro.transparent,[!0,!0,!0,!0]),u=r.getBucket(t);if(!u)return;let c=i.key,f=t.heatmapFbos.get(c);f||(f=Dz(o,r.tileSize,r.tileSize),t.heatmapFbos.set(c,f)),o.bindFramebuffer.set(f.framebuffer),o.viewport.set([0,0,r.tileSize,r.tileSize]),o.clear({color:ro.transparent});let h=u.programConfigurations.get(t.id),d=e.useProgram("heatmap",h,!a),p=e.transform.getProjectionData({overscaledTileID:r.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=e.style.map.terrain.getTerrainData(i);d.draw(o,s.TRIANGLES,Lo.disabled,l,n,Ko.disabled,eS(r,e.transform.zoom,t.paint.get("heatmap-intensity"),1),g,p,t.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,t.paint,e.transform.zoom,h)}function Noe(e,r,t,i,a){let o=e.context,s=o.gl,l=e.transform;o.setColorMode(e.colorModeForRenderPass());let n=Lz(o,r),u=t.key,c=r.heatmapFbos.get(u);if(!c)return;o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,c.colorAttachment.get()),o.activeTexture.set(s.TEXTURE1),n.bind(s.LINEAR,s.CLAMP_TO_EDGE);let f=l.getProjectionData({overscaledTileID:t,applyTerrainMatrix:a,applyGlobeMatrix:!i});e.useProgram("heatmapTexture").draw(o,s.TRIANGLES,Lo.disabled,es.disabled,e.colorModeForRenderPass(),Ko.disabled,tS(e,r,0,1),null,f,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,r.paint,l.zoom),c.destroy(),r.heatmapFbos.delete(u)}function joe(e,r,t){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,r.width/4,r.height/4]);let a=t.heatmapFbos.get(Dg);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=Dz(e,r.width/4,r.height/4),t.heatmapFbos.set(Dg,a))}function Dz(e,r,t){let i=e.gl,a=i.createTexture();i.bindTexture(i.TEXTURE_2D,a),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texStorage2D(i.TEXTURE_2D,1,i.RGBA16F,r,t);let o=e.createFramebuffer(r,t,!1,!1);return o.colorAttachment.set(a),o}function Lz(e,r){return r.colorRampTexture||(r.colorRampTexture=new jl(e,r.colorRamp,e.gl.RGBA)),r.colorRampTexture}function Fz(e,r,t,i){let a=e.context,o=a.bindFramebuffer.get(),s=a.viewport.get(),[,,l,n]=s;return Uoe(e,l,n),a.viewport.set([0,0,l,n]),a.clear({color:ro.transparent,depth:1,stencil:0}),e.currentStencilSource=void 0,e.renderTileClippingMasks(r,t,i),{compositeTarget:o,compositeViewport:s}}function Uoe(e,r,t){let i=e.context.gl;if(!e.layerOpacityFbo){let o=e.context.createFramebuffer(r,t,!0,!0),s=i.createTexture();i.bindTexture(i.TEXTURE_2D,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,r,t,0,i.RGBA,i.UNSIGNED_BYTE,null),o.colorAttachment.set(s),o.depthAttachment.set(e.context.createRenderbuffer(i.DEPTH_STENCIL,r,t)),e.layerOpacityFbo=o,e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}if(e.layerOpacityFbo.width===r&&e.layerOpacityFbo.height===t){e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}let a=e.layerOpacityFbo;i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,r,t,0,i.RGBA,i.UNSIGNED_BYTE,null),e.context.bindRenderbuffer.set(a.depthAttachment.get()),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,r,t),e.context.bindRenderbuffer.set(null),a.width=r,a.height=t,e.context.bindFramebuffer.set(a.framebuffer)}function Pz(e,r,t,i){let a=e.context,o=a.gl;a.bindFramebuffer.set(t.compositeTarget),a.viewport.set(t.compositeViewport),a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,e.layerOpacityFbo.colorAttachment.get()),e.useProgram("layerOpacity").draw(a,o.TRIANGLES,Lo.disabled,es.disabled,e.colorModeForRenderPass(),Ko.disabled,qO(r,0),null,null,i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom),e.currentStencilSource=void 0}function Iz(e,r,t,i,a,o,s,l){let n=256;if(a.stepInterpolant){let u=r.getSource().maxzoom,c=s.canonical.z===u?Math.ceil(1<e.options.anisotropicFilterPitch&&p.texParameterf(p.TEXTURE_2D,d.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,d.extTextureFilterAnisotropicMax);let D=e.getTerrainDataForTile(w,c),R=m.getProjectionData({overscaledTileID:w,aligned:v,applyGlobeMatrix:!c,applyTerrainMatrix:!0}),P=vB(T,E,F.fadeMix,t,l,n),z=f??y.getMeshFromTileID(d,w.canonical,o,s,"raster"),I=a?a[w.overscaledZ]:es.disabled;g.draw(d,p.TRIANGLES,k,I,_,u?Ko.frontCCW:Ko.backCCW,P,D,R,t.id,z.vertexBuffer,z.indexBuffer,z.segments)}}function Qoe(e,r,t,i){let a={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(t===0||i)return a;if(e.fadingParentID){let o=r.getLoadedTile(e.fadingParentID);if(!o)return a;let s=2**(o.tileID.overscaledZ-e.tileID.overscaledZ);return{parentTile:o,parentScaleBy:s,parentTopLeft:[e.tileID.canonical.x*s%1,e.tileID.canonical.y*s%1],fadeValues:ese(e,o,t)}}return e.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:tse(e,t)}:a}function ese(e,r,t){let i=hs(),a=(i-e.timeAdded)/t,o=(i-r.timeAdded)/t,s=e.fadingDirection===1,l=to(a,0,1),n=to(1-o,0,1),u=s?l:n;return{tileOpacity:u,parentTileOpacity:s?n:l,fadeMix:{opacity:1,mix:1-u}}}function tse(e,r){let t=(hs()-e.timeAdded)/r,i=to(t,0,1);return{tileOpacity:i,fadeMix:{opacity:i,mix:0}}}function rse(e,r,t,i,a){let o=t.paint.get("background-color"),s=t.paint.get("background-opacity");if(s===0)return;let{isRenderingToTexture:l}=a,n=e.context,u=n.gl,c=e.style.projection,f=e.transform,h=f.tileSize,d=t.paint.get("background-pattern");if(e.isPatternMissing(d))return;let p=!d&&o.a===1&&s===1&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(a.currentPass!==p)return;let g=es.disabled,m=e.getDepthModeForSublayer(0,p==="opaque"?Lo.ReadWrite:Lo.ReadOnly),y=e.colorModeForRenderPass(),_=e.useProgram(d?"backgroundPattern":"background"),v=i||Bm(f,{tileSize:h,terrain:e.style.map.terrain});d&&(n.activeTexture.set(u.TEXTURE0),e.patternAtlas.bind(e.context));let x=t.getCrossfadeParameters();for(let S of v){let M=f.getProjectionData({overscaledTileID:S,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),C=d?ZO(s,e,d,{tileID:S,tileSize:h},x):XO(s,o),w=e.getTerrainDataForTile(S,l),k=c.getMeshFromTileID(n,S.canonical,!1,!0,"raster");_.draw(n,u.TRIANGLES,m,g,y,Ko.backCCW,C,w,M,t.id,k.vertexBuffer,k.indexBuffer,k.segments)}}function ise(e){let r=e.transform.padding;Nz(e,e.transform.height-(r.top||0),3,UN),Nz(e,r.bottom||0,3,qN),jz(e,r.left||0,3,VN),jz(e,e.transform.width-(r.right||0),3,GN);let t=e.transform.centerPoint;ase(e,t.x,e.transform.height-t.y,HN)}function ase(e,r,t,i){l2(e,r-1,t-10,2,20,i),l2(e,r-10,t-1,20,2,i)}function Nz(e,r,t,i){l2(e,0,r+t/2,e.transform.width,t,i)}function jz(e,r,t,i){l2(e,r-t/2,0,t,e.transform.height,i)}function l2(e,r,t,i,a,o){let s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*e.pixelRatio,t*e.pixelRatio,i*e.pixelRatio,a*e.pixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function nse(e,r,t){for(let i of t)ose(e,r,i)}function ose(e,r,t){var i,a;let o=e.context,s=o.gl,l=e.useProgram("debug"),n=Lo.disabled,u=es.disabled,c=e.colorModeForRenderPass(),f="$debug",h=(i=e.style.map.terrain)==null?void 0:i.getTerrainData(t);o.activeTexture.set(s.TEXTURE0);let d=((a=r.getTileByID(t.key).latestRawTileData)==null?void 0:a.byteLength)||0,p=Math.floor(d/1024),g=r.getTile(t).tileSize,m=512/Math.min(g,512)*(t.overscaledZ/e.transform.zoom)*.5,y=t.canonical.toString();t.overscaledZ!==t.canonical.z&&(y+=` => ${t.overscaledZ}`),sse(e,`${y} ${p}kB`);let _=e.transform.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!0,applyTerrainMatrix:!0});l.draw(o,s.TRIANGLES,n,u,cl.alphaBlended,Ko.disabled,QM(ro.transparent,m),null,_,f,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),l.draw(o,s.LINE_STRIP,n,u,c,Ko.disabled,QM(ro.red),h,_,f,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function sse(e,r){e.initDebugOverlayCanvas();let t=e.debugOverlayCanvas,i=e.context.gl,a=e.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,t.width,t.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(r,5,5),a.strokeText(r,5,5),e.debugOverlayTexture.update(t),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}function lse(e,r){let t=null,i=Object.values(e._layers).flatMap(l=>l.source&&!l.isHidden(r)?[e.tileManagers[l.source]]:[]),a=i.filter(l=>l.getSource().type==="vector"),o=i.filter(l=>l.getSource().type!=="vector"),s=l=>{(!t||t.getSource().maxzoom180?-360:t<-180?360:0}function hz(e){return Math.max(0,Math.floor(e))}function tM(e,r,t,i){if(i<0||i>=1)return UM;let a=Math.floor(t),o=t-a;for(let s of e.zooms){let l=1<a;o++){let s=(t+i)/2;r(e,s)?i=s:t=s}return{lo:t,hi:i}}function r2(e,r){return tM(e.index,e.exaggeration,(e.near[0]+r*e.dx)/e.worldSize,(e.near[1]+r*e.dy)/e.worldSize)}function i2(e,r){return dz(r2(e,r),e.near[2]+r*e.dz)}function vz(){To("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function mz(e){if(e.useSlerp)if(e.k<1){let r=A9(e.startEulerAngles.roll,e.startEulerAngles.pitch,e.startEulerAngles.bearing),t=A9(e.endEulerAngles.roll,e.endEulerAngles.pitch,e.endEulerAngles.bearing),i=new Float64Array(4);C_(i,r,t,e.k);let a=cJ(i);e.tr.setRoll(a.roll),e.tr.setPitch(a.pitch),e.tr.setBearing(a.bearing)}else e.tr.setRoll(e.endEulerAngles.roll),e.tr.setPitch(e.endEulerAngles.pitch),e.tr.setBearing(e.endEulerAngles.bearing);else e.tr.setRoll(Zs.number(e.startEulerAngles.roll,e.endEulerAngles.roll,e.k)),e.tr.setPitch(Zs.number(e.startEulerAngles.pitch,e.endEulerAngles.pitch,e.k)),e.tr.setBearing(Zs.number(e.startEulerAngles.bearing,e.endEulerAngles.bearing,e.k))}function gz(e,r,t,i,a){let o=a.padding,s=Sd(a.worldSize,t.getNorthWest()),l=Sd(a.worldSize,t.getNorthEast()),n=Sd(a.worldSize,t.getSouthEast()),u=Sd(a.worldSize,t.getSouthWest()),c=rl(-i),f=s.rotate(c),h=l.rotate(c),d=n.rotate(c),p=u.rotate(c),g=new Wr(Math.max(f.x,h.x,p.x,d.x),Math.max(f.y,h.y,p.y,d.y)),m=new Wr(Math.min(f.x,h.x,p.x,d.x),Math.min(f.y,h.y,p.y,d.y)),y=g.sub(m),_=a.width-(o.left+o.right+r.left+r.right),v=a.height-(o.top+o.bottom+r.top+r.bottom),x=_/y.x,S=v/y.y;if(S<0||x<0){vz();return}let M=Math.min(Ku(a.scale*Math.min(x,S)),e.maxZoom),C=Wr.convert(e.offset),w=(r.left-r.right)/2,k=(r.top-r.bottom)/2,A=new Wr(w,k).rotate(rl(i)),b=C.add(A).mult(a.scale/Vc(M));return{center:lg(a.worldSize,s.add(n).div(2).sub(b)),zoom:M,bearing:i}}function yz(e){let r=jm(e.worldSize,e.center.lat);return 2*Math.PI*r}function noe(e,r,t){let i=ru(r),a=ru(t),o=Kl(i,a),s=Math.acos(o),l=yz(e);return s/(2*Math.PI)*l}function ooe(e,r){return[P0(e*Math.PI*2+Math.PI,Math.PI*2),2*Math.atan(Math.exp(Math.PI-r*Math.PI*2))-Math.PI*.5]}function soe(e,r){let t=Math.cos(r),i=new Float64Array(3);return i[0]=Math.sin(e)*t,i[1]=Math.sin(r),i[2]=Math.cos(e)*t,i}function i0(e,r,t,i,a){let o=1/(1<1e-6){let i=e[0]/t,a=e[2]/t,o=Math.acos(a),s=(i>0?o:-o)/Math.PI*180;return new An(fh(s,-180,180),r)}return new An(0,r)}function loe(e,r){return q4(Op(),-e.lng,-e.lat,r)}function uoe(e){let r=e[0],t=e[1],i=e[2],a=e[3];return{lng:-Math.atan2(2*(a*r+t*i),1-2*(r*r+t*t))*180/Math.PI,lat:-Math.asin(to(2*(a*t-i*r),-1,1))*180/Math.PI,bearing:Math.atan2(2*(a*i+r*t),1-2*(t*t+i*i))*180/Math.PI}}function xz(e,r){let t=e.cameraPosition,i=np(t);if(i<=1)return e.screenPointToLocation(r);let a=fs();qc(a,t);let o=e.getRayDirectionFromPixel(r),s=-Kl(o,a),l=fs();k_(l,o,a,s);let n=np(l);if(n<1e-9)return e.screenPointToLocation(r);let u=Math.atan2(n,s),c=Math.asin(1/i)*.9;if(u=0?90:-90,l=e.locationToScreenPoint(new An(0,s)),n=r.x-l.x,u=r.y-l.y,c=n*n+u*u,f=to(1-(Yh-Math.abs(o))/12,0,1),h=f*f*(3-2*f),d=P0(i-a+180,360)-180,p=0;if(h>0&&t){let g=(n*t.y-u*t.x)/Math.max(c,400);p=(s>0?1:-1)*g*180/Math.PI}return a+(1-h)*d+h*p}function hoe(e){let r=fs();return r[0]=e[0]*-e[3],r[1]=e[1]*-e[3],r[2]=e[2]*-e[3],{center:r,radius:Math.sqrt(1-e[3]*e[3])}}function doe(e,r,t){let i=fs();Ed(i,t,e);let a=fs();return k_(a,e,i,r/pg(i)),a}function a2(e){return Math.cos(e*Math.PI/180)}function Lu(e,r){let t=a2(e),i=a2(r);return Ku(i/t)}function poe(e,r){return 360/yz({worldSize:e,center:{lat:r}})}function voe(e,r){let t=e.rotate(r.bearingInRadians),i=r.zoom+Lu(r.center.lat,0),a=Zv(1/a2(r.center.lat),1/a2(Math.min(Math.abs(r.center.lat),60)),P_(i,7,3,0,1)),o=poe(r.worldSize,r.center.lat);return new An(r.center.lng-t.x*o*a,to(r.center.lat+t.y*o,-Yh,Yh))}function rM(e){let r=.5*e,t=Math.sin(r),i=Math.cos(r);return Math.log(t+i)-Math.log(i-t)}function bz(e,r,t,i){let a=e.lat+t*i;if(Math.abs(t)>1){let o=e.lat+t,s=(Math.sign(o)===Math.sign(e.lat)?Math.abs(e.lat):-Math.abs(e.lat))*Math.PI/180,l=Math.abs(e.lat+t)*Math.PI/180,n=rM(s+i*(l-s)),u=rM(s),c=rM(l),f=(n-u)/(c-u),h=e.lng+r*f;return new An(h,a)}{let o=e.lng+r*i;return new An(o,a)}}function n2(e,r,t=1){let i=Kl(e,r),a=t*t,o=fs(),s=fs();Ws(s,r,i),Ed(o,e,s);let l=a-Kl(o,o);if(l<0)return null;let n=Kl(e,e)-a,u=-i+(i<0?1:-1)*Math.sqrt(l),c=n/u,f=u;return{tMin:Math.min(c,f),tMax:Math.max(c,f)}}function o2(e,r,t){let i=e-r;return i<0?-i:Math.max(0,i-t)}function iM(e,r,t,i,a){let o=e-t,s;return s=o<0?Math.min(-o,1+o-a):o>a?Math.min(Math.max(o-a,0),1-o):0,Math.max(s,o2(r,i,a))}function wz(e,r){let t=1/0,i=-1/0;for(let a of r){let o=Kl(e,a);t=Math.min(t,o),i=Math.max(i,o)}return{min:t,max:i}}function Tz(e,r){let t=fs();k_(t,e.origin,e.direction,r);let i=np(t),a=fs();Ws(a,t,1/i);let o=Vg(a),s=Qo.fromLngLat(o),l=new Qo(s.x,to(s.y,0,.999999999)),n=tM(e.index,e.exaggeration,l.x,l.y),u=Math.abs(o.lat)>85.051129?0:n.elevation;return{sample:ar(Nt({},n),{elevation:u}),radius:i,mercator:l}}function Az(e,r){let{sample:t,radius:i}=Tz(e,r);return dz(t,(i-1)*mc)}function moe(e,r,t){let i={constrainOverride:r};if(Array.isArray(e)){let a=new VM({type:e},t);return{projection:a,transform:new $M(i),cameraHelper:new YM(a)}}switch(e){case"mercator":return{projection:new M2,transform:new Jg(i),cameraHelper:new Qg};case"globe":{let a=new VM({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]},{});return{projection:a,transform:new $M(i),cameraHelper:new YM(a)}}case"vertical-perspective":return{projection:new qM,transform:new HM(i),cameraHelper:new WM};default:return To(`Unknown projection name: ${e}. Falling back to mercator projection.`),{projection:new M2,transform:new Jg(i),cameraHelper:new Qg}}}function goe(e,r){for(let[t,i]of Object.entries(ey)){let a=e.getUniformBlockIndex(r,t);a!==e.INVALID_INDEX&&e.uniformBlockBinding(r,a,i)}}function aM(e){let r={},t=0;for(let{name:i,type:a}of e){let[o,s]=uO[a];t=Math.ceil(t/s)*s,r[i]=t,t+=o}return{offsets:r,contentWords:t,sizeWords:Math.ceil(t/4)*4}}function yoe(e){return new F2(e,ey.ProjectionUBO,XM)}function _oe(e,r){let t=e.pending;t.set(r.mainMatrix,av.u_projection_matrix),t.set(r.fallbackMatrix,av.u_projection_fallback_matrix),t.set(r.tileMercatorCoords,av.u_projection_tile_mercator_coords),t.set(r.clippingPlane,av.u_projection_clipping_plane),t[av.u_projection_transition]=r.projectionTransition,e.pendingWords[av.u_projection_clip_antimeridian]=+!!r.clipAntimeridian,e.upload()}function xoe(e){return new F2(e,ey.TerrainUBO,ZM)}function boe(e,r){let t=e.pending;t.set(r.u_terrain_matrix,ty.u_terrain_matrix),t.set(r.u_terrain_unpack,ty.u_terrain_unpack),t[ty.u_terrain_dim]=r.u_terrain_dim,t[ty.u_terrain_exaggeration]=r.u_terrain_exaggeration,e.upload()}function nM(e){let r=[];for(let t of e){if(t===null)continue;let i=t.split(" ");r.push(i.pop())}return r}function woe(e,r){let t=new Set([e.INT,e.INT_VEC2,e.INT_VEC3,e.INT_VEC4,e.UNSIGNED_INT,e.UNSIGNED_INT_VEC2,e.UNSIGNED_INT_VEC3,e.UNSIGNED_INT_VEC4]),i=new Set,a=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES);for(let o=0;o>16,l>>16],u_pixel_coord_lower:[s&65535,l&65535]}}function Toe(e,r,t,i){let a=t.patternAtlas.getPattern(e.from.toString()),o=t.patternAtlas.getPattern(e.to.toString()),{width:s,height:l}=t.patternAtlas.getPixelSize(),n=2**i.tileID.overscaledZ,u=i.tileSize*2**t.transform.tileZoom/n,c=u*(i.tileID.canonical.x+i.tileID.wrap*n),f=u*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,l],u_mix:r.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:r.fromScale,u_scale_b:r.toScale,u_tile_units_to_pixels:1/Cf(i,1,t.transform.tileZoom),u_pixel_coord_upper:[c>>16,f>>16],u_pixel_coord_lower:[c&65535,f&65535]}}function Aoe(e,r){let t=2**r.canonical.z,i=r.canonical.y;return[new Qo(0,i/t).toLngLat().lat,new Qo(0,(i+1)/t).toLngLat().lat]}function oM(e,r){return 1/Cf(e,1,r.tileZoom)}function Sz(e,r,t){return Np(e.transform,r,t.paint.get("line-translate"),t.paint.get("line-translate-anchor"))}function Moe(e){return new F2(e,ey.FrameUBO,nS)}function Soe(e,r){let t=e.pending,{transform:i}=r,a=r.context.gl;t[pf.u_units_to_pixels]=1/i.pixelsToGLUnits[0],t[pf.u_units_to_pixels+1]=1/i.pixelsToGLUnits[1],t[pf.u_world_size]=a.drawingBufferWidth,t[pf.u_world_size+1]=a.drawingBufferHeight,t[pf.u_camera_to_center_distance]=i.cameraToCenterDistance,t[pf.u_symbol_fade_change]=r.options.fadeDuration?r.symbolFadeChange:1,t[pf.u_aspect_ratio]=i.width/i.height,t[pf.u_device_pixel_ratio]=r.pixelRatio,t[pf.u_viewport_size]=i.width,t[pf.u_viewport_size+1]=i.height,t[pf.u_pixel_extrude_scale]=1/i.width,t[pf.u_pixel_extrude_scale+1]=1/i.height,t[pf.u_pitch]=i.pitch/360*2*Math.PI,e.upload()}function Ez(e,r,t,i,a){var o,s;let l=e.context,n=e.transform,u=l.gl,c=e.useProgram("collisionBox"),f=[],h=0,d=0;for(let v of i){let x=r.getTile(v).getBucket(t);if(!x)continue;let S=a?x.textCollisionBox:x.iconCollisionBox,M=x.collisionCircleArray;M.length>0&&(f.push({circleArray:M,circleOffset:d,coord:v}),h+=M.length/4,d=h),S&&c.draw(l,u.LINES,Lo.disabled,es.disabled,e.colorModeForRenderPass(),Ko.disabled,null,(o=e.style.map.terrain)==null?void 0:o.getTerrainData(v),n.getProjectionData({overscaledTileID:v,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),t.id,S.layoutVertexBuffer,S.indexBuffer,S.segments,null,e.transform.zoom,null,null,S.collisionVertexBuffer)}if(!a||!f.length)return;let p=e.useProgram("collisionCircle"),g=new xI;g.resize(h*4),g._trim();let m=0;for(let v of f)for(let x=0;xf.getElevation(p,w,k):void 0;Foe(m,h,d,n,c,x,M,_,S,Np(c,g,s,l),p.toUnwrapped(),C,t.layout.get("symbol-height-anchor")==="ground")}}}function Loe(e,r,t,i,a,o){let s=r.tileAnchorPoint.add(new Wr(r.translation[0],r.translation[1]));if(r.pitchWithMap){let l=i.mult(o);t||(l=l.rotate(-a));let n=s.add(l);return XA(n.x,n.y,r.pitchedLabelPlaneMatrix,ev(r,n.x,n.y)).point}if(t){let l=tv(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(e),n=Math.atan(l.y/l.x)+(l.x<0?Math.PI:0);return e.add(i.rotate(n))}return e.add(i)}function Foe(e,r,t,i,a,o,s,l,n,u,c,f,h){let d=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,g=e.icon.dynamicLayoutVertexArray,m={};p.clear();for(let y=0;y=0&&(m[_.associatedIconIndex]={shiftedAnchor:P,angle:z})}}if(n){g.clear();let y=e.icon.placedSymbolArray;for(let _=0;_e.style.map.terrain.getElevation(F,ie,Q):void 0;toe(R,e,a,V,ae,v,u,t.layout.get("text-rotation-alignment")==="map",F.toUnwrapped(),y.width,y.height,q,ee)}let le=a&&k||te,ce=v?V:e.transform.clipSpaceToPixelsMatrix,pe=x||le?jN:ce,xe=I&&t.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ye;ye=I?R.iconsInText?$O(L.kind,G,S,v,x,le,e,pe,j,q,X,Z,b,ne,se):iS(L.kind,G,S,v,x,le,e,pe,j,q,a,X,xe,b,ne,se):rS(L.kind,G,S,v,x,le,e,pe,j,q,a,X,b,ne,se);let fe={program:O,buffers:P,uniformValues:ye,projectionData:Y,atlasTexture:J,atlasTextureIcon:H,atlasInterpolation:N,atlasInterpolationIcon:$,isSDF:I,hasHalo:xe};if(M&&R.canOverlap){C=!0;let ae=P.segments.get();for(let ee of ae)A.push({segments:new Ks([ee]),sortKey:ee.sortKey,state:fe,terrainData:W})}else A.push({segments:P.segments,sortKey:0,state:fe,terrainData:W})}C&&A.sort((F,D)=>F.sortKey-D.sortKey);let E=(p=t.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(null))!=null?p:1/0,T=t.layout.get("text-letter-spacing").constantOr(0)*24<0||E>1;for(let F of A){let D=F.state;g.activeTexture.set(m.TEXTURE0),D.atlasTexture.bind(D.atlasInterpolation,m.CLAMP_TO_EDGE),D.atlasTextureIcon&&(g.activeTexture.set(m.TEXTURE1),D.atlasTextureIcon&&D.atlasTextureIcon.bind(D.atlasInterpolationIcon,m.CLAMP_TO_EDGE));let R=D.isSDF&&D.hasHalo;if(R){let P=D.uniformValues;P.u_is_halo=1,T&&(P.u_is_plain=0,Cz(D.buffers,F.segments,t,e,D.program,w,c,f,P,D.projectionData,F.terrainData),P.u_is_halo=0,P.u_is_plain=1)}Cz(D.buffers,F.segments,t,e,D.program,w,c,f,D.uniformValues,D.projectionData,F.terrainData),R&&!T&&(D.uniformValues.u_is_halo=0)}}function Cz(e,r,t,i,a,o,s,l,n,u,c){let f=i.context,h=f.gl;a.draw(f,h.TRIANGLES,o,s,l,Ko.backCCW,n,c,u,t.id,e.layoutVertexBuffer,e.indexBuffer,r,t.paint,i.transform.zoom,e.programConfigurations.get(t.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Ioe(e,r,t,i,a){var o;if(a.currentPass!=="translucent")return;let{isRenderingToTexture:s}=a,l=t.paint.get("circle-opacity"),n=t.paint.get("circle-stroke-width"),u=t.paint.get("circle-stroke-opacity"),c=!t.layout.get("circle-sort-key").isConstant();if(l.constantOr(1)===0&&(n.constantOr(1)===0||u.constantOr(1)===0))return;let f=e.context,h=f.gl,d=e.transform,p=e.getDepthModeForSublayer(0,Lo.ReadOnly),g=es.disabled,m=e.colorModeForRenderPass(),y=[],_=d.getCircleRadiusCorrection();for(let v of i){let x=r.getTile(v),S=x.getBucket(t);if(!S)continue;let M=t.paint.get("circle-translate"),C=t.paint.get("circle-translate-anchor"),w=Np(d,x,M,C),k=S.programConfigurations.get(t.id),A=e.useProgram("circle",k),b=S.layoutVertexBuffer,E=S.indexBuffer,T=(o=e.style.map.terrain)==null?void 0:o.getTerrainData(v),F={programConfiguration:k,program:A,layoutVertexBuffer:b,indexBuffer:E,uniformValues:wO(e,x,t,w,_),terrainData:T,projectionData:d.getProjectionData({overscaledTileID:v,applyGlobeMatrix:!s,applyTerrainMatrix:!0})};if(c){let D=S.segments.get();for(let R of D)y.push({segments:new Ks([R]),sortKey:R.sortKey,state:F})}else y.push({segments:S.segments,sortKey:0,state:F})}c&&y.sort((v,x)=>v.sortKey-x.sortKey);for(let v of y){let{programConfiguration:x,program:S,layoutVertexBuffer:M,indexBuffer:C,uniformValues:w,terrainData:k,projectionData:A}=v.state,b=v.segments;S.draw(f,h.TRIANGLES,p,g,m,Ko.backCCW,w,k,A,t.id,M,C,b,t.paint,e.transform.zoom,x)}}function Roe(e,r,t,i,a){if(t.paint.get("heatmap-opacity")===0)return;let o=e.context,{isRenderingToTexture:s,isRenderingGlobe:l}=a;if(e.style.map.terrain){for(let n of i){let u=r.getTile(n);r.hasRenderableParent(n)||(a.currentPass==="offscreen"?Ooe(e,u,t,n,l):a.currentPass==="translucent"&&Noe(e,t,n,s,l))}o.viewport.set([0,0,e.width,e.height])}else a.currentPass==="offscreen"?zoe(e,r,t,i):a.currentPass==="translucent"&&Boe(e,t)}function zoe(e,r,t,i){let a=e.context,o=a.gl,s=e.transform,l=es.disabled,n=new cl([o.ONE,o.ONE],ro.transparent,[!0,!0,!0,!0]);joe(a,e,t),a.clear({color:ro.transparent});for(let u of i){if(r.hasRenderableParent(u))continue;let c=r.getTile(u),f=c.getBucket(t);if(!f)continue;let h=f.programConfigurations.get(t.id),d=e.useProgram("heatmap",h),p=s.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),g=s.getCircleRadiusCorrection();d.draw(a,o.TRIANGLES,Lo.disabled,l,n,Ko.backCCW,eS(c,s.zoom,t.paint.get("heatmap-intensity"),g),null,p,t.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,t.paint,s.zoom,h)}a.viewport.set([0,0,e.width,e.height])}function Boe(e,r){let t=e.context,i=t.gl;t.setColorMode(e.colorModeForRenderPass());let a=r.heatmapFbos.get(Lg);a&&(t.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),t.activeTexture.set(i.TEXTURE1),Lz(t,r).bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(t,i.TRIANGLES,Lo.disabled,es.disabled,e.colorModeForRenderPass(),Ko.disabled,tS(e,r,0,1),null,null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom))}function Ooe(e,r,t,i,a){let o=e.context,s=o.gl,l=es.disabled,n=new cl([s.ONE,s.ONE],ro.transparent,[!0,!0,!0,!0]),u=r.getBucket(t);if(!u)return;let c=i.key,f=t.heatmapFbos.get(c);f||(f=Dz(o,r.tileSize,r.tileSize),t.heatmapFbos.set(c,f)),o.bindFramebuffer.set(f.framebuffer),o.viewport.set([0,0,r.tileSize,r.tileSize]),o.clear({color:ro.transparent});let h=u.programConfigurations.get(t.id),d=e.useProgram("heatmap",h,!a),p=e.transform.getProjectionData({overscaledTileID:r.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=e.style.map.terrain.getTerrainData(i);d.draw(o,s.TRIANGLES,Lo.disabled,l,n,Ko.disabled,eS(r,e.transform.zoom,t.paint.get("heatmap-intensity"),1),g,p,t.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,t.paint,e.transform.zoom,h)}function Noe(e,r,t,i,a){let o=e.context,s=o.gl,l=e.transform;o.setColorMode(e.colorModeForRenderPass());let n=Lz(o,r),u=t.key,c=r.heatmapFbos.get(u);if(!c)return;o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,c.colorAttachment.get()),o.activeTexture.set(s.TEXTURE1),n.bind(s.LINEAR,s.CLAMP_TO_EDGE);let f=l.getProjectionData({overscaledTileID:t,applyTerrainMatrix:a,applyGlobeMatrix:!i});e.useProgram("heatmapTexture").draw(o,s.TRIANGLES,Lo.disabled,es.disabled,e.colorModeForRenderPass(),Ko.disabled,tS(e,r,0,1),null,f,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,r.paint,l.zoom),c.destroy(),r.heatmapFbos.delete(u)}function joe(e,r,t){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,r.width/4,r.height/4]);let a=t.heatmapFbos.get(Lg);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=Dz(e,r.width/4,r.height/4),t.heatmapFbos.set(Lg,a))}function Dz(e,r,t){let i=e.gl,a=i.createTexture();i.bindTexture(i.TEXTURE_2D,a),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texStorage2D(i.TEXTURE_2D,1,i.RGBA16F,r,t);let o=e.createFramebuffer(r,t,!1,!1);return o.colorAttachment.set(a),o}function Lz(e,r){return r.colorRampTexture||(r.colorRampTexture=new jl(e,r.colorRamp,e.gl.RGBA)),r.colorRampTexture}function Fz(e,r,t,i){let a=e.context,o=a.bindFramebuffer.get(),s=a.viewport.get(),[,,l,n]=s;return Uoe(e,l,n),a.viewport.set([0,0,l,n]),a.clear({color:ro.transparent,depth:1,stencil:0}),e.currentStencilSource=void 0,e.renderTileClippingMasks(r,t,i),{compositeTarget:o,compositeViewport:s}}function Uoe(e,r,t){let i=e.context.gl;if(!e.layerOpacityFbo){let o=e.context.createFramebuffer(r,t,!0,!0),s=i.createTexture();i.bindTexture(i.TEXTURE_2D,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,r,t,0,i.RGBA,i.UNSIGNED_BYTE,null),o.colorAttachment.set(s),o.depthAttachment.set(e.context.createRenderbuffer(i.DEPTH_STENCIL,r,t)),e.layerOpacityFbo=o,e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}if(e.layerOpacityFbo.width===r&&e.layerOpacityFbo.height===t){e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}let a=e.layerOpacityFbo;i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,r,t,0,i.RGBA,i.UNSIGNED_BYTE,null),e.context.bindRenderbuffer.set(a.depthAttachment.get()),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,r,t),e.context.bindRenderbuffer.set(null),a.width=r,a.height=t,e.context.bindFramebuffer.set(a.framebuffer)}function Pz(e,r,t,i){let a=e.context,o=a.gl;a.bindFramebuffer.set(t.compositeTarget),a.viewport.set(t.compositeViewport),a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,e.layerOpacityFbo.colorAttachment.get()),e.useProgram("layerOpacity").draw(a,o.TRIANGLES,Lo.disabled,es.disabled,e.colorModeForRenderPass(),Ko.disabled,qO(r,0),null,null,i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom),e.currentStencilSource=void 0}function Iz(e,r,t,i,a,o,s,l){let n=256;if(a.stepInterpolant){let u=r.getSource().maxzoom,c=s.canonical.z===u?Math.ceil(1<e.options.anisotropicFilterPitch&&p.texParameterf(p.TEXTURE_2D,d.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,d.extTextureFilterAnisotropicMax);let D=e.getTerrainDataForTile(w,c),R=m.getProjectionData({overscaledTileID:w,aligned:v,applyGlobeMatrix:!c,applyTerrainMatrix:!0}),P=vB(T,E,F.fadeMix,t,l,n),z=f??y.getMeshFromTileID(d,w.canonical,o,s,"raster"),I=a?a[w.overscaledZ]:es.disabled;g.draw(d,p.TRIANGLES,k,I,_,u?Ko.frontCCW:Ko.backCCW,P,D,R,t.id,z.vertexBuffer,z.indexBuffer,z.segments)}}function Qoe(e,r,t,i){let a={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(t===0||i)return a;if(e.fadingParentID){let o=r.getLoadedTile(e.fadingParentID);if(!o)return a;let s=2**(o.tileID.overscaledZ-e.tileID.overscaledZ);return{parentTile:o,parentScaleBy:s,parentTopLeft:[e.tileID.canonical.x*s%1,e.tileID.canonical.y*s%1],fadeValues:ese(e,o,t)}}return e.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:tse(e,t)}:a}function ese(e,r,t){let i=hs(),a=(i-e.timeAdded)/t,o=(i-r.timeAdded)/t,s=e.fadingDirection===1,l=to(a,0,1),n=to(1-o,0,1),u=s?l:n;return{tileOpacity:u,parentTileOpacity:s?n:l,fadeMix:{opacity:1,mix:1-u}}}function tse(e,r){let t=(hs()-e.timeAdded)/r,i=to(t,0,1);return{tileOpacity:i,fadeMix:{opacity:i,mix:0}}}function rse(e,r,t,i,a){let o=t.paint.get("background-color"),s=t.paint.get("background-opacity");if(s===0)return;let{isRenderingToTexture:l}=a,n=e.context,u=n.gl,c=e.style.projection,f=e.transform,h=f.tileSize,d=t.paint.get("background-pattern");if(e.isPatternMissing(d))return;let p=!d&&o.a===1&&s===1&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(a.currentPass!==p)return;let g=es.disabled,m=e.getDepthModeForSublayer(0,p==="opaque"?Lo.ReadWrite:Lo.ReadOnly),y=e.colorModeForRenderPass(),_=e.useProgram(d?"backgroundPattern":"background"),v=i||Om(f,{tileSize:h,terrain:e.style.map.terrain});d&&(n.activeTexture.set(u.TEXTURE0),e.patternAtlas.bind(e.context));let x=t.getCrossfadeParameters();for(let S of v){let M=f.getProjectionData({overscaledTileID:S,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),C=d?ZO(s,e,d,{tileID:S,tileSize:h},x):XO(s,o),w=e.getTerrainDataForTile(S,l),k=c.getMeshFromTileID(n,S.canonical,!1,!0,"raster");_.draw(n,u.TRIANGLES,m,g,y,Ko.backCCW,C,w,M,t.id,k.vertexBuffer,k.indexBuffer,k.segments)}}function ise(e){let r=e.transform.padding;Nz(e,e.transform.height-(r.top||0),3,UN),Nz(e,r.bottom||0,3,qN),jz(e,r.left||0,3,VN),jz(e,e.transform.width-(r.right||0),3,GN);let t=e.transform.centerPoint;ase(e,t.x,e.transform.height-t.y,HN)}function ase(e,r,t,i){l2(e,r-1,t-10,2,20,i),l2(e,r-10,t-1,20,2,i)}function Nz(e,r,t,i){l2(e,0,r+t/2,e.transform.width,t,i)}function jz(e,r,t,i){l2(e,r-t/2,0,t,e.transform.height,i)}function l2(e,r,t,i,a,o){let s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*e.pixelRatio,t*e.pixelRatio,i*e.pixelRatio,a*e.pixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function nse(e,r,t){for(let i of t)ose(e,r,i)}function ose(e,r,t){var i,a;let o=e.context,s=o.gl,l=e.useProgram("debug"),n=Lo.disabled,u=es.disabled,c=e.colorModeForRenderPass(),f="$debug",h=(i=e.style.map.terrain)==null?void 0:i.getTerrainData(t);o.activeTexture.set(s.TEXTURE0);let d=((a=r.getTileByID(t.key).latestRawTileData)==null?void 0:a.byteLength)||0,p=Math.floor(d/1024),g=r.getTile(t).tileSize,m=512/Math.min(g,512)*(t.overscaledZ/e.transform.zoom)*.5,y=t.canonical.toString();t.overscaledZ!==t.canonical.z&&(y+=` => ${t.overscaledZ}`),sse(e,`${y} ${p}kB`);let _=e.transform.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!0,applyTerrainMatrix:!0});l.draw(o,s.TRIANGLES,n,u,cl.alphaBlended,Ko.disabled,QM(ro.transparent,m),null,_,f,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),l.draw(o,s.LINE_STRIP,n,u,c,Ko.disabled,QM(ro.red),h,_,f,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function sse(e,r){e.initDebugOverlayCanvas();let t=e.debugOverlayCanvas,i=e.context.gl,a=e.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,t.width,t.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(r,5,5),a.strokeText(r,5,5),e.debugOverlayTexture.update(t),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}function lse(e,r){let t=null,i=Object.values(e._layers).flatMap(l=>l.source&&!l.isHidden(r)?[e.tileManagers[l.source]]:[]),a=i.filter(l=>l.getSource().type==="vector"),o=i.filter(l=>l.getSource().type!=="vector"),s=l=>{(!t||t.getSource().maxzoom{var d;return n.getProjectionData({overscaledTileID:new Cu(h.tileID.canonical.z,(d=h.tileID.wrap)!=null?d:0,h.tileID.canonical.z,h.tileID.canonical.x,h.tileID.canonical.y),aligned:h.aligned,applyGlobeMatrix:h.applyGlobeMatrix,applyTerrainMatrix:h.applyTerrainMatrix})}},f=s.renderingMode?s.renderingMode:"2d";if(i.currentPass==="offscreen"){let h=s.prerender;h&&(e.setCustomLayerDefaults(),o.setColorMode(e.colorModeForRenderPass()),h.call(s,o.gl,c),o.setDirty(),e.setBaseState())}else if(i.currentPass==="translucent"){e.setCustomLayerDefaults(),o.setColorMode(e.colorModeForRenderPass()),o.setStencilMode(es.disabled);let h=f==="3d"?e.getDepthModeFor3D():e.getDepthModeForSublayer(0,Lo.ReadOnly);o.setDepthMode(h),s.render(o.gl,c),o.setDirty(),e.setBaseState(),o.bindFramebuffer.set(null)}}function cse(e,r){let t=e.context,i=t.gl,a=e.transform,o=cl.unblended,s=new Lo(i.LEQUAL,Lo.ReadWrite,[0,1]),l=r.tileManager.getRenderableTiles(),n=e.useProgram("terrainDepth");t.bindFramebuffer.set(r.getFramebuffer().framebuffer),t.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),t.clear({color:ro.white,depth:1});for(let u of l){let c=r.getTerrainMesh(u.tileID),f=r.getTerrainData(u.tileID),h=a.getProjectionData({overscaledTileID:u.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),d=lO(r.getSkirtLength(a.zoom));n.draw(t,i.TRIANGLES,s,es.disabled,o,Ko.backCCW,d,f,h,"terrain",c.vertexBuffer,c.indexBuffer,c.segments)}t.bindFramebuffer.set(null),t.viewport.set([0,0,e.width,e.height])}function fse(e,r,t,i){let{isRenderingGlobe:a}=i,o=e.context,s=o.gl,l=e.transform,n=e.colorModeForRenderPass(),u=e.getDepthModeFor3D(),c=e.useProgram("terrain");o.bindFramebuffer.set(null),o.viewport.set([0,0,e.width,e.height]);for(let f of t){let h=r.getTerrainMesh(f.tileID),d=e.renderToTexture.getTexture(f),p=r.getTerrainData(f.tileID);o.activeTexture.set(s.TEXTURE0),d.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_LINEAR);let g=r.getSkirtLength(l.zoom),m=l.calculateFogMatrix(f.tileID.toUnwrapped()),y=sO(g,m,e.style.sky,l.pitch,a),_=l.getProjectionData({overscaledTileID:f.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});c.draw(o,s.TRIANGLES,u,es.disabled,n,Ko.backCCW,y,p,_,"terrain",h.vertexBuffer,h.indexBuffer,h.segments)}}function Uz(e,r){if(!r.mesh){let t=new sp;t.emplaceBack(-1,-1),t.emplaceBack(1,-1),t.emplaceBack(1,1),t.emplaceBack(-1,1);let i=new ed;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),r.mesh=new Um(e.createVertexBuffer(t,i0.members),e.createIndexBuffer(i),Ks.simpleSegment(0,0,t.length,i.length))}return r.mesh}function hse(e,r){let t=e.context,i=t.gl,a=eN(r,e.transform,e.pixelRatio),o=new Lo(i.LEQUAL,Lo.ReadWrite,[0,1]),s=es.disabled,l=e.colorModeForRenderPass(),n=e.useProgram("sky"),u=Uz(t,r);n.draw(t,i.TRIANGLES,o,s,l,Ko.disabled,a,null,void 0,"sky",u.vertexBuffer,u.indexBuffer,u.segments)}function dse(e,r){let t=e.getCartesianPosition();OK(t,t);let i=Hh(new Float64Array(16));return e.properties.get("anchor")==="map"&&(zp(i,i,r.rollInRadians),Wv(i,i,-r.pitchInRadians),zp(i,i,r.bearingInRadians),Wv(i,i,r.center.lat*Math.PI/180),c9(i,i,-r.center.lng*Math.PI/180)),NK(t,t,i),t}function pse(e,r,t){let i=e.context,a=i.gl,o=e.useProgram("atmosphere"),s=new Lo(a.LEQUAL,Lo.ReadOnly,[0,1]),l=e.transform,n=dse(t,e.transform),u=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),c=r.properties.get("atmosphere-blend")*u.projectionTransition;if(c===0)return;let f=Nm(l.worldSize,l.center.lat),h=_z(l),d=JO(n,c,h,f,l.inverseProjectionMatrix),p=Uz(i,r);o.draw(i,a.TRIANGLES,s,es.disabled,cl.alphaBlended,Ko.disabled,d,null,null,"atmosphere",p.vertexBuffer,p.indexBuffer,p.segments)}function vse(e,r,t){var i;let a=(i=r?.transitionState)!=null?i:0;return{currentPass:"offscreen",currentLayer:0,opaquePassCutoff:1/0,depthRangeFor3D:[0,1],isRenderingToTexture:!1,transform:e,terrain:t,projectionTransition:a,isRenderingGlobe:a>0}}function qz(e,r){let t=!1,i=null,a,o=()=>{i=null,t&&(t=(e(...a),i=setTimeout(o,r),!1))};return(...s)=>(t=!0,a=s,i||o(),i)}function Vg(e,r){(!e.duration||e.duration({around:i,panDelta:i.sub(t)}),activateOnStart:!0,moveStateManager:new Ym({checkCorrectEvent:t=>t.button===0&&!t.ctrlKey}),enable:e,assignEvents:iy})}function _se({enable:e,clickTolerance:r,aroundCenter:t=!0,minPixelCenterThreshold:i=100,rotateSpeed:a=.8},o){return new Wm({clickTolerance:r,move:(s,l)=>{let n=o();if(t&&Math.abs(n.y-s.y)>i)return{bearingDelta:T9(new Wr(s.x,l.y),l,n)};let u=(l.x-s.x)*a;return t&&l.ys.button===0&&s.ctrlKey||s.button===2&&!s.ctrlKey}),enable:e,assignEvents:iy})}function xse({enable:e,clickTolerance:r,pitchSpeed:t=-.5}){return new Wm({clickTolerance:r,move:(i,a)=>({pitchDelta:(a.y-i.y)*t}),moveStateManager:new Ym({checkCorrectEvent:i=>i.button===0&&i.ctrlKey||i.button===2}),enable:e,assignEvents:iy})}function bse({enable:e,clickTolerance:r,rollDegreesPerPixelMoved:t=.3},i){return new Wm({clickTolerance:r,move:(a,o)=>{let s=i(),l=(o.x-a.x)*t;return o.ya.button===2&&a.ctrlKey}),enable:e,assignEvents:iy})}function u2(e,r,t){for(let i=0;iMath.abs(e.x)}function wse(e){return e*(2-e)}function dM(e){var r;return((r=e.panDelta)==null?void 0:r.mag())||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}function Tse(e=!1){return Xr(this,null,function*(){if(nv!==void 0&&!e)return nv;if(window.navigator.permissions===void 0)return nv=!!window.navigator.geolocation,nv;try{nv=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{nv=!!window.navigator.geolocation}return nv})}function Hz(e,r,t,i=!1){if(i||!t.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let a=new An(e.lng,e.lat);if(e=new An(e.lng,e.lat),r){let o=new An(e.lng-360,e.lat),s=new An(e.lng+360,e.lat),l=t.locationToScreenPoint(e).distSqr(r);t.locationToScreenPoint(o).distSqr(r)180;){let o=t.locationToScreenPoint(e);if(o.x>=0&&o.y>=0&&o.x<=t.width&&o.y<=t.height)break;e.lng>t.center.lng?e.lng-=360:e.lng+=360}return e.lng!==a.lng&&t.isPointOnMapSurface(t.locationToScreenPoint(e))?e:a}function $z(e,r,t){let i=e.classList;for(let a in q2)i.remove(`maplibregl-${t}-anchor-${a}`);i.add(`maplibregl-${t}-anchor-${r}`)}function xh(e,r,t=[]){let i=$n.createNS("http://www.w3.org/2000/svg",e);for(let a in r)i.setAttributeNS(null,a,r[a]);for(let a of t)i.appendChild(a);return i}function Ase(){return DS||(DS=xh("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[xh("g",{"fill-rule":"nonzero"},[xh("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([e,r])=>xh("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:e,ry:r}))),xh("g",{fill:CS},[xh("path",{d:"M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"})]),xh("g",{opacity:"0.25",fill:"#000000"},[xh("path",{d:"M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"})]),xh("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),xh("g",{transform:"translate(8.0, 8.0)"},[xh("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),xh("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]),DS)}function Mse(e){return e.firstElementChild.children[1]}function Wz(e,r,t){let i=t?.maxWidth||100,a=e._container.clientHeight/2,o=e._container.clientWidth/2,s=e.unproject([o-i/2,a]),l=e.unproject([o+i/2,a]),n=Math.round(e.project(l).x-e.project(s).x),u=Math.min(i,n,e._container.clientWidth),c=s.distanceTo(l);if(t?.unit==="imperial"){let f=3.2808*c;f>5280?Hg(r,u,f/5280,e._getUIString("ScaleControl.Miles")):Hg(r,u,f,e._getUIString("ScaleControl.Feet"))}else t?.unit==="nautical"?Hg(r,u,c/1852,e._getUIString("ScaleControl.NauticalMiles")):c>=1e3?Hg(r,u,c/1e3,e._getUIString("ScaleControl.Kilometers")):Hg(r,u,c,e._getUIString("ScaleControl.Meters"))}function Hg(e,r,t,i){let a=Ese(t),o=a/t;e.style.width=`${r*o}px`,e.innerHTML=`${a} ${i}`}function Sse(e){let r=10**Math.ceil(-Math.log(e)/Math.LN10);return Math.round(e*r)/r}function Ese(e){let r=10**(`${Math.floor(e)}`.length-1),t=e/r;return t=t>=10?10:t>=5?5:t>=3?3:t>=2?2:t>=1?1:Sse(t),r*t}function Yz(e){if(!e)return Yz(new Wr(0,0));if(typeof e=="number"){let r=Math.round(Math.abs(e)/Math.SQRT2);return{center:new Wr(0,0),top:new Wr(0,e),"top-left":new Wr(r,r),"top-right":new Wr(-r,r),bottom:new Wr(0,-e),"bottom-left":new Wr(r,-r),"bottom-right":new Wr(-r,-r),left:new Wr(e,0),right:new Wr(-e,0)}}if(e instanceof Wr||Array.isArray(e)){let r=Wr.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:Wr.convert(e.center||[0,0]),top:Wr.convert(e.top||[0,0]),"top-left":Wr.convert(e["top-left"]||[0,0]),"top-right":Wr.convert(e["top-right"]||[0,0]),bottom:Wr.convert(e.bottom||[0,0]),"bottom-left":Wr.convert(e["bottom-left"]||[0,0]),"bottom-right":Wr.convert(e["bottom-right"]||[0,0]),left:Wr.convert(e.left||[0,0]),right:Wr.convert(e.right||[0,0])}}function kse(e){var r,t,i,a;return e?{top:(r=e.top)!=null?r:0,right:(t=e.right)!=null?t:0,bottom:(i=e.bottom)!=null?i:0,left:(a=e.left)!=null?a:0}:{top:0,right:0,bottom:0,left:0}}function Cse(e,r){return jg().setRTLTextPlugin(e,r)}function Dse(){return jg().getRTLTextPluginStatus()}function Lse(){return P8}function Fse(){return Yg.workerCount}function Pse(e){Yg.workerCount=e}function Ise(){return ff.MAX_PARALLEL_IMAGE_REQUESTS}function Rse(e){ff.MAX_PARALLEL_IMAGE_REQUESTS=e}function zse(){return ff.WORKER_URL}function Bse(e){ff.WORKER_URL=e}function Ose(e){return Xr(this,null,function*(){yield GA().broadcast("IS",e)})}var pM,vM,c2,f2,mM,yc,$g,Xz,Cs,$n,td,Zz,iu,kn,h2,Nf,zs,df,jm,gM,d2,yM,_M,Wg,xM,Kz,Jz,p2,Qz,eB,tB,v2,m2,rB,iB,aB,nB,oB,sB,lB,uB,cB,fB,hB,g2,Yg,dB,Xg,bM,y2,bh,wM,TM,_2,AM,MM,tv,pB,vB,Um,i0,Zg,rv,SM,EM,kM,mB,CM,gB,yB,x2,_B,b2,DM,xB,w2,T2,bB,LM,qm,A2,wB,FM,TB,AB,MB,PM,Vm,IM,SB,EB,kB,CB,DB,LB,FB,Gm,PB,IB,RM,al,RB,Hm,zB,BB,OB,zM,NB,jB,UB,qB,VB,GB,HB,$B,BM,rd,OM,NM,M2,S2,E2,WB,YB,XB,jM,ZB,UM,Kg,Jg,KB,JB,k2,qM,VM,C2,QB,D2,eO,GM,HM,$M,WM,YM,tO,L2,rO,iO,aO,nO,oO,sO,lO,Qg,uO,F2,XM,iv,ZM,ey,cO,fO,hO,KM,dO,pO,vO,mO,gO,JM,yO,_O,xO,bO,wO,TO,QM,AO,MO,eS,tS,SO,EO,kO,CO,DO,LO,FO,PO,IO,RO,zO,ty,BO,OO,NO,jO,UO,qO,VO,GO,HO,rS,iS,$O,WO,YO,XO,ZO,KO,JO,QO,eN,ry,tN,rN,aS,iN,os,aN,nN,oN,sN,lN,uN,cN,fN,hN,dN,pN,vN,mN,gN,yN,_N,xN,bN,wN,TN,AN,MN,SN,EN,kN,CN,DN,LN,FN,PN,IN,P2,RN,zN,BN,ON,nS,pf,cl,NN,Lo,I2,es,oS,R2,Ko,z2,jN,B2,O2,UN,qN,VN,GN,HN,$N,N2,WN,sS,lS,$m,YN,XN,ZN,KN,JN,QN,e8,t8,uS,r8,j2,i8,Wm,a8,Ym,n8,o8,iy,s8,U2,cS,fS,hS,dS,l8,pS,vS,mS,gS,u8,c8,yS,_S,xS,bS,f8,ay,h8,d8,p8,wS,TS,AS,v8,MS,m8,av,g8,y8,_8,SS,ES,x8,b8,w8,nv,q2,kS,CS,DS,a0,LS,V2,T8,ny,Xm,n0,G2,FS,A8,M8,S8,H2,E8,k8,C8,D8,L8,$2,F8,P8,Nse=Ir({"node_modules/maplibre-gl/dist/maplibre-gl.mjs"(){qae(),pM={},vM="6.9.0",yc={frame(e,r,t,i){let a=i||window,o=a.requestAnimationFrame(l=>{s(),r(l)}),{unsubscribe:s}=W4(e.signal,"abort",()=>{s(),a.cancelAnimationFrame(o),t(new vm(e.signal.reason))},!1)},frameAsync(e,r){return new Promise((t,i)=>{this.frame(e,t,i,r)})},getImageData(e,r=0){return this.getImageCanvasContext(e).getImageData(-r,-r,e.width+2*r,e.height+2*r)},getImageCanvasContext(e){let r;if(B4()&&!l9())r=new OffscreenCanvas(e.width,e.height).getContext("2d",{willReadFrequently:!0});else{let t=window.document.createElement("canvas");t.width=e.width,t.height=e.height,r=t.getContext("2d",{willReadFrequently:!0})}if(!r)throw Error("failed to create canvas 2d context");return r.drawImage(e,0,0,e.width,e.height),r},resolveURL(e){return c2||(c2=document.createElement("a")),c2.href=e,c2.href},get hardwareConcurrency(){return typeof navigator<"u"&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return mM===void 0?matchMedia?(f2??(f2=matchMedia("(prefers-reduced-motion: reduce)")),f2.matches):!1:mM},set prefersReducedMotion(e){mM=e}},$g=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt===null?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}},$n=(Cs=class{static create(e,r,t){let i=window.document.createElement(e);return r!==void 0&&(i.className=r),t&&t.appendChild(i),i}static createNS(e,r){return window.document.createElementNS(e,r)}static disableDrag(){Cs.docStyle&&Cs.selectProp&&(Cs.userSelect=Cs.docStyle[Cs.selectProp],Cs.docStyle[Cs.selectProp]="none")}static enableDrag(){Cs.docStyle&&Cs.selectProp&&(Cs.docStyle[Cs.selectProp]=Cs.userSelect)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",Cs.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Cs.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",Cs.suppressClickInternal,!0)},0)}static getScale(e){let r=e.getBoundingClientRect();return{x:r.width/e.offsetWidth||1,y:r.height/e.offsetHeight||1,boundingClientRect:r}}static getPoint(e,r,t){let i=r.boundingClientRect;return new Wr((t.clientX-i.left)/r.x-e.clientLeft,(t.clientY-i.top)/r.y-e.clientTop)}static mousePos(e,r){let t=Cs.getScale(e);return Cs.getPoint(e,t,r)}static touchPos(e,r){let t=[],i=Cs.getScale(e);for(let a of r)t.push(Cs.getPoint(e,i,a));return t}static sanitize(e){let r=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),t=r.querySelectorAll("script, iframe");for(let i of t)i.remove();return Cs.clean(r),r.innerHTML}static isPossiblyDangerous(e,r){let t=r.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(e)&&(t.includes("javascript:")||t.includes("data:"))||e==="srcdoc"||e.startsWith("on"))return!0}static clean(e){let r=e.children;for(let t of r)Cs.removeAttributes(t),Cs.clean(t)}static removeAttributes(e){for(let{name:r,value:t}of Array.from(e.attributes))Cs.isPossiblyDangerous(r,t)&&e.removeAttribute(r)}},Cs.docStyle=typeof window<"u"&&((Xz=window.document)==null?void 0:Xz.documentElement.style),Cs.selectProp=!Cs.docStyle||"userSelect"in Cs.docStyle?"userSelect":"webkitUserSelect",Cs),(function(e){let r,t,i,a;e.resetRequestQueue=()=>{r=[],t=0,i=0,a={}},e.addThrottleControl=f=>{let h=i++;return a[h]=f,h},e.removeThrottleControl=f=>{delete a[f],u()};let o=()=>{for(let f of Object.keys(a))if(a[f]())return!0;return!1};function s(f,h,d,p,g=!0,m){return Xr(this,null,function*(){let y=yield f.transformRequest(h,d);return Y4(p.signal),td.getImage(y,p,g,m)})}e.transformAndGetImage=s,e.getImage=(f,h,d=!0,p)=>new Promise((g,m)=>{f.headers||(f.headers={}),f.headers.accept="image/webp,*/*",yn(f,{type:"image"});let y={abortController:h,requestParameters:f,supportImageRefresh:d,imageBitmapOptions:p,state:"queued",onError:_=>{m(_)},onSuccess:_=>{g(_)}};r.push(y),u()});let l=(f,h)=>typeof createImageBitmap=="function"?TP(f,h):AP(f),n=f=>Xr(null,null,function*(){f.state="running";let{requestParameters:h,supportImageRefresh:d,imageBitmapOptions:p,onError:g,onSuccess:m,abortController:y}=f,_=d===!1&&!p&&!Zv(self)&&!M9(h.url)&&(!h.headers||Object.keys(h.headers).reduce((x,S)=>x&&S==="accept",!0));t++;let v=_?c(h,y):pg(h,y);try{let x=yield v;delete f.abortController,f.state="completed",x.data instanceof HTMLImageElement||P0(x.data)?m(x):!x.data||x.data.byteLength===0?m({data:null,cacheControl:x.cacheControl,expires:x.expires}):m({data:yield l(x.data,p),cacheControl:x.cacheControl,expires:x.expires})}catch(x){delete f.abortController,g(Zu(x))}finally{t--,u()}}),u=()=>{let f=o()?ff.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:ff.MAX_PARALLEL_IMAGE_REQUESTS;for(let h=t;h0;h++){let d=r.shift();if(d.abortController.signal.aborted){h--;continue}n(d)}},c=(f,h)=>new Promise((d,p)=>{let g=new Image,m=f.url,y=f.credentials;y&&y==="include"?g.crossOrigin="use-credentials":(y&&y==="same-origin"||!S9(m))&&(g.crossOrigin="anonymous"),h.signal.addEventListener("abort",()=>{g.src="",p(new vm(h.signal.reason))}),g.fetchPriority="high",g.onload=()=>{g.onerror=g.onload=null,d({data:g})},g.onerror=()=>{g.onerror=g.onload=null,!h.signal.aborted&&p(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."))},g.src=m})})(td||(td={})),td.resetRequestQueue(),Zz=class{constructor(e){this._transformRequestFn=e??null}transformRequest(e,r){return this._transformRequestFn&&this._transformRequestFn(e,r)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}},iu=class extends hf{},kn=class extends iu{},h2=class extends iu{constructor(e={}){super("style.load",e)}},Nf=class extends iu{constructor(e,r={}){super(e,r),this.dataType="style"}},zs=class extends iu{constructor(e,r={}){super(e,r),this.dataType="source"}},df=class extends iu{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,t,i={}){t=t instanceof MouseEvent?t:new MouseEvent(e,t);let a=$n.mousePos(r.getCanvas(),t),o=r.unproject(a);super(e,yn({point:a,lngLat:o,originalEvent:t},i)),this._defaultPrevented=!1,this.target=r}},jm=class extends iu{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,t){let i=e==="touchend"?t.changedTouches:t.touches,a=$n.touchPos(r.getCanvasContainer(),i),o=a.map(n=>r.unproject(n)),s=a.reduce((n,u,c,f)=>n.add(u.div(f.length)),new Wr(0,0)),l=r.unproject(s);super(e,{points:a,point:s,lngLats:o,lngLat:l,originalEvent:t}),this._defaultPrevented=!1}},gM=class extends iu{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r){super("wheel",{originalEvent:r}),this._defaultPrevented=!1}},d2=class extends iu{},yM=class extends iu{constructor(e={}){super("terrain",e)}},_M=class extends iu{constructor(e={}){super("projectiontransition",e)}},Wg=class extends iu{},xM=class extends iu{constructor(e={}){super("styleimagemissing",e)}},Kz=class extends Nl{constructor(){super(),this.images={},this.updateVersion=0,this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this._spriteImagesIds={},this._imagesIds=null,this._renderCallbacksDispatchedThisFrame={}}destroy(){for(let e of Object.keys(this.images))this.removeImage(e);this._spriteImagesIds={}}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:r,promiseResolve:t}of this.requestors)t(this._getImagesForIds(r));this.requestors=[]}}getImage(e){let r=this.images[e];if(r&&!r.data&&r.spriteData){let t=r.spriteData;r.data=new Rs({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),r.spriteData=null}return r}addImage(e,r){if(this.images[e])throw Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,r)&&(this.images[e]=r,this._imagesIds=null,r.isWebGLImage&&this.updateImage(e,r,!1))}_validate(e,r){let t=!0,i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i?.width)||(this.fire(new Ln(Error(`Image "${e}" has invalid "stretchX" value`))),t=!1),this._validateStretch(r.stretchY,i?.height)||(this.fire(new Ln(Error(`Image "${e}" has invalid "stretchY" value`))),t=!1),this._validateContent(r.content,r)||(this.fire(new Ln(Error(`Image "${e}" has invalid "content" value`))),t=!1),t}_validateStretch(e,r){if(!e)return!0;let t=0;for(let i of e){if(i[0]=e[1]}updateImage(e,r,t=!0){var i;let a=this.images[e];if(t){let o=a.data||a.spriteData;if(o.width!==r.data.width||o.height!==r.data.height)throw Error(`size mismatch between old image (${o.width}x${o.height}) and new image (${r.data.width}x${r.data.height}).`)}r.version=((i=a.version)!=null?i:0)+1,this.images[e]=r,this.updateVersion++}removeImage(e){var r;let t=this.images[e];t&&(delete this.images[e],this._imagesIds=null,(r=t.userImage)!=null&&r.onRemove&&t.userImage.onRemove())}listImages(){var e;return(e=this._imagesIds)!=null||(this._imagesIds=Object.keys(this.images)),this._imagesIds}_getSpriteImageId(e,r){return e==="default"?r:`${e}:${r}`}setSpriteImages(e,r){var t;let i=(t=this._spriteImagesIds[e])!=null?t:[],a=[];for(let l in r){let n=this._getSpriteImageId(e,l);a.push(n),n in this.images?this.updateImage(n,r[l],!1):this.addImage(n,r[l])}let o=new Set(a),s=i.filter(l=>!o.has(l));for(let l of s)this.removeImage(l);return this._spriteImagesIds[e]=a,{loaded:a,removed:s}}removeSpriteImages(e){var r;let t=(r=this._spriteImagesIds[e])!=null?r:[];for(let i of t)this.removeImage(i);return delete this._spriteImagesIds[e],t}removeAllSpriteImages(){let e=Object.values(this._spriteImagesIds).flat();for(let r of e)this.removeImage(r);return this._spriteImagesIds={},e}setMissingImageResolver(e){this.missingImageResolver=e}getImages(e){return new Promise((r,t)=>{let i=!0;if(!this.isLoaded())for(let a of e)this.images[a]||(i=!1);this.isLoaded()||i?r(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:r})})}_getImagesForIds(e){return Xr(this,null,function*(){var r;let t=new Set(e.filter(o=>!this.getImage(o))),i=this.missingImageResolver;i&&(yield Promise.allSettled(Array.from(t,o=>i(o))));let a={};for(let o of e){let s=this.getImage(o);s&&(t.delete(o),a[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,textFitWidth:s.textFitWidth,textFitHeight:s.textFitHeight,hasRenderCallback:!!((r=s.userImage)!=null&&r.render),isWebGLImage:s.isWebGLImage})}for(let o of t)this.fire(new xM({id:o})),To(`Image "${o}" could not be loaded. Please make sure you have added the image before it is needed with map.addImage(), resolved it with map.setMissingStyleImageResolver(), or included it in a "sprite" property in your style.`);return a})}beginFrame(){this._renderCallbacksDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let r of e){if(this._renderCallbacksDispatchedThisFrame[r])continue;this._renderCallbacksDispatchedThisFrame[r]=!0;let t=this.getImage(r);t||To(`Image with ID: "${r}" was not found`),Dte(t)&&this.updateImage(r,t)}}cloneImages(){let e={};for(let r in this.images){let t=this.images[r];e[r]=ar(Ot({},t),{data:t.data?t.data.clone():null})}return e}},Jz=class{constructor(e){this._imageManager=e,this._entries={},this._image=new Rs({width:1,height:1}),this._dirty=!0}destroy(){this._texture&&(this._texture=(this._texture.destroy(),null)),this._entries={},this._image=new Rs({width:1,height:1}),this._dirty=!0}getPixelSize(){let{width:e,height:r}=this._image;return{width:e,height:r}}getPattern(e){let r=this._imageManager.getImage(e);if(!r)return null;let t=this._entries[e];if(t?.image!==r){let i={w:r.data.width+2,h:r.data.height+2,x:0,y:0};this._entries[e]={bin:i,position:new Pb(i,r),image:r}}else if(t.position.version!==r.version)t.position.version=r.version;else return t.position;return this._update(),this._entries[e].position}bind(e){let r=e.gl;this._texture?this._dirty&&(this._dirty=(this._texture.update(this._image),!1)):(this._texture=new jl(e,this._image,r.RGBA),this._dirty=!1),this._texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}_update(){for(let a in this._entries)this._imageManager.getImage(a)||delete this._entries[a];let e=[];for(let a in this._entries)e.push(this._entries[a].bin);let{w:r,h:t}=mF(e),i=this._image;i.resize({width:r||1,height:t||1});for(let a in this._entries){let{bin:o}=this._entries[a],s=o.x+1,l=o.y+1,n=this._entries[a].image.data,u=n.width,c=n.height;Rs.copy(n,i,{x:0,y:0},{x:s,y:l},{width:u,height:c}),Rs.copy(n,i,{x:0,y:c-1},{x:s,y:l-1},{width:u,height:1}),Rs.copy(n,i,{x:0,y:0},{x:s,y:l+c},{width:u,height:1}),Rs.copy(n,i,{x:u-1,y:0},{x:s-1,y:l},{width:1,height:c}),Rs.copy(n,i,{x:0,y:0},{x:s+u,y:l},{width:1,height:c})}this._dirty=!0}},p2=1114111,Qz={start:0,end:p2},eB=0,tB=class{constructor(e){this.requestManager=e,this._faces={},this._registered=new Set}setFontFaces(e){this._unregisterAll(),this._faces={};for(let[r,t]of Object.entries(e??{})){let i=Array.isArray(t)?t:[t];this._faces[r]=i.map(a=>this._declareFontFace(r,a)).filter(a=>a!==null)}}hasFontFaces(){return Object.keys(this._faces).length>0}getFontFamily(e,r){return Xr(this,null,function*(){var t,i;for(let a of e.split(","))for(let o of(t=this._faces[a.trim()])!=null?t:[])if(nne(o,r)&&((i=o.loaded)!=null||(o.loaded=this._loadFontFace(o)),yield o.loaded))return o.family;return null})}_declareFontFace(e,r){let t=typeof r=="string"?{url:r}:r;if(typeof t?.url!="string")return To(`Ignoring the font face declared for "${e}": it has no URL.`),null;let i=`maplibre-gl-font-face-${eB++}`,a=t["unicode-range"];if(!a?.length)return{url:t.url,ranges:[Qz],family:i};let o=[];for(let s of a){let l=ane(s);if(!l){To(`Ignoring the unicode range "${s}" of the font face at ${t.url}: it is not a valid range.`);continue}o.push(l)}return o.length?{url:t.url,ranges:o,family:i}:null}_loadFontFace(e){return Xr(this,null,function*(){if(typeof FontFace>"u"||typeof document>"u"||!document.fonts)return To(`Ignoring the font face at ${e.url}: this environment has no CSS Font Loading API.`),!1;let r;try{return r=new FontFace(e.family,yield this._downloadFontFile(e.url)),Object.values(this._faces).some(t=>t.includes(e))?(document.fonts.add(r),this._registered.add(r),yield r.load(),!0):!1}catch(t){return r&&this._unregister(r),To(`Ignoring the font face at ${e.url}: ${Zu(t).message}`),!1}})}_downloadFontFile(e){return Xr(this,null,function*(){let r=yield this.requestManager.transformRequest(e,"Glyphs"),t=yield dT(r,new AbortController);if(!t?.data)throw Error(`the response was empty for the font file at ${e}`);return t.data})}_unregister(e){var r;(r=document.fonts)==null||r.delete(e),this._registered.delete(e)}_unregisterAll(){var e;for(let r of this._registered)(e=document.fonts)==null||e.delete(r);this._registered.clear()}destroy(){this._unregisterAll(),this._faces={}}},v2=1e20,m2=new Float64Array(256);for(let e=0;e<256;e++){let r=.5-(e/255)**.45454545454545453;m2[e]=r*Math.abs(r)}m2[255]=-1e20,rB=class{constructor({fontSize:e=24,buffer:r=3,radius:t=8,cutoff:i=.25,fontFamily:a="sans-serif",fontWeight:o="normal",fontStyle:s="normal",lang:l=null}={}){this.buffer=r,this.radius=t,this.cutoff=i,this.lang=l;let n=this.size=e+r*4,u=this._createCanvas(n),c=this.ctx=u.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${o} ${e}px ${a}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(n*n),this.gridInner=new Float64Array(n*n),this.f=new Float64Array(n),this.z=new Float64Array(n+1),this.v=new Uint16Array(n)}_createCanvas(e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(e,e);let r=document.createElement("canvas");return r.width=r.height=e,r}draw(e){let{width:r,actualBoundingBoxAscent:t,actualBoundingBoxDescent:i,actualBoundingBoxLeft:a,actualBoundingBoxRight:o}=this.ctx.measureText(e),s=Math.ceil(t),l=Math.floor(-a),n=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o)-l)),u=Math.max(0,Math.min(this.size-this.buffer,s+Math.ceil(i))),c=n+2*this.buffer,f=u+2*this.buffer,h=Math.max(c*f,0),d=new Uint8ClampedArray(h),p={data:d,width:c,height:f,glyphWidth:n,glyphHeight:u,glyphTop:s,glyphLeft:l,glyphAdvance:r};if(n===0||u===0)return p;let{ctx:g,buffer:m,gridInner:y,gridOuter:_}=this;this.lang&&(g.lang=this.lang),g.clearRect(m,m,n,u),g.fillText(e,m-l,m+s);let v=g.getImageData(m,m,n,u);_.fill(v2,0,h),y.fill(0,0,h);let x=3;for(let w=0;w{let t=new rB(e);return t.buffer=r,t},nB=class{constructor(e,r,t,i=aB){this.requestManager=e,this.localIdeographFontFamily=r,this.entries={},this.lang=t,this.fontFaceManager=new tB(e),this.createRasterizer=i}setURL(e){this.url=e}setFontFaces(e){this.fontFaceManager.setFontFaces(e),this.entries={}}getGlyphs(e){return Xr(this,null,function*(){let r=[];for(let a in e)for(let o of e[a])r.push(this._getAndCacheGlyphsPromise(a,o));let t=yield Promise.all(r),i={};for(let{stack:a,id:o,glyph:s}of t)i[a]||(i[a]={}),i[a][o]=s&&{id:s.id,bitmap:s.bitmap.clone(),metrics:s.metrics};return i})}_getAndCacheGlyphsPromise(e,r){return Xr(this,null,function*(){var t,i;(i=(t=this.entries)[e])!=null||(t[e]={glyphs:{},requests:{},ranges:{}});let a=this.entries[e],o=a.glyphs[r];if(o!==void 0)return{stack:e,id:r,glyph:o};let s=r.codePointAt(0),l=this.fontFaceManager.hasFontFaces()?yield this.fontFaceManager.getFontFamily(e,s):null;return l?(o=a.glyphs[r]=yield this._drawGlyph(a,e,r,l),{stack:e,id:r,glyph:o}):!this.url||lx(r)||this._charUsesLocalIdeographFontFamily(s)?(o=a.glyphs[r]=yield this._drawGlyph(a,e,r),{stack:e,id:r,glyph:o}):yield this._downloadAndCacheRangePromise(e,r)})}_downloadAndCacheRangePromise(e,r){return Xr(this,null,function*(){var t;let i=r.codePointAt(0),a=this.entries[e],o=Math.floor(i/256);if(a.ranges[o])return{stack:e,id:r,glyph:null};(t=a.requests)[o]||(t[o]=this._loadGlyphRange(e,o));try{let s=yield a.requests[o];for(let l in s)a.glyphs[String.fromCodePoint(+l)]=s[+l];return a.ranges[o]=!0,{stack:e,id:r,glyph:s[i]||null}}catch(s){let l=a.glyphs[r]=yield this._drawGlyph(a,e,r);return this._warnOnMissingGlyphRange(l,o,i,Zu(s)),{stack:e,id:r,glyph:l}}})}_loadGlyphRange(e,r){return Xr(this,null,function*(){let t=r*256,i=t+255,a=yield this.requestManager.transformRequest(this.url.replace("{fontstack}",e).replace("{range}",`${t}-${i}`),"Glyphs"),o=yield dT(a,new AbortController);if(!o?.data)throw Error(`Could not load glyph range. range: ${r}, ${t}-${i}`);let s={};for(let l of Cte(o.data))s[l.id]=l;return s})}_warnOnMissingGlyphRange(e,r,t,i){let a=r*256,o=a+255,s=t.toString(16).padStart(4,"0").toUpperCase();To(`Unable to load glyph range ${r}, ${a}-${o}. Rendering codepoint U+${s} locally instead. ${i}`)}_charUsesLocalIdeographFontFamily(e){return!!this.localIdeographFontFamily&&Vee(e)}_drawGlyph(e,r,t,i){return Xr(this,null,function*(){let a=(yield this._getTinySDF(e,r,t,i)).draw(t),o=new RegExp("^\\p{gc=Cf}+$","u").test(t);return{id:t.codePointAt(0),bitmap:new vb({width:a.width||60,height:a.height||60},a.data),metrics:{width:o?0:a.glyphWidth/2||24,height:a.glyphHeight/2||24,left:a.glyphLeft/2+.5||0,top:a.glyphTop/2-27.5||-8,advance:o?0:a.glyphAdvance/2||24,isDoubleResolution:!0}}})}_getTinySDF(e,r,t,i){var a,o,s,l;let n=lx(t);if(i){let h=n?"clusterTinySDFs":"fontFaceTinySDFs";return(a=e[h])!=null||(e[h]={}),(o=e[h])[i]||(o[i]=this._createTinySDF(i,!1,n?3:1)),e[h][i]}let u=r===iB&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(t.codePointAt(0)),c=u?this.localIdeographFontFamily:r;if(n)return(s=e.clusterTinySDFs)!=null||(e.clusterTinySDFs={}),(l=e.clusterTinySDFs)[c]||(l[c]=this._createTinySDF(c,!0,3)),e.clusterTinySDFs[c];let f=u?"ideographTinySDF":"tinySDF";return e[f]||(e[f]=this._createTinySDF(c)),e[f]}_createTinySDF(e,r=!0,t=1){return Xr(this,null,function*(){var i;let a=e?e.split(","):[];a.push("sans-serif");let o=a.map(n=>/[-\w]+/.test(n)?n:`'${CSS.escape(n)}'`).join(","),s=r?this._fontWeight(a[0]):void 0,l=r?this._fontStyle(a[0]):"normal";if(typeof document<"u"&&((i=document.fonts)!=null&&i.load))try{yield document.fonts.load(`${l} ${s||"normal"} 48px ${o}`)}catch(n){To(`Failed to load font "${o}": ${Zu(n).message}`)}return this.createRasterizer({fontSize:48,buffer:Math.max(6,Math.ceil(48*(t-1)/4)),radius:16,cutoff:.25,fontFamily:o,fontWeight:s,fontStyle:l,lang:this.lang},6)})}_fontStyle(e){return/italic/i.test(e)?"italic":/oblique/i.test(e)?"oblique":"normal"}_fontWeight(e){let r={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},t;for(let[i,a]of Object.entries(r))RegExp(`\\b${i}\\b`,"i").test(e)&&(t=`${a}`);return t}destroy(){for(let e in this.entries){let r=this.entries[e];r.tinySDF=null,r.ideographTinySDF=null,r.fontFaceTinySDFs={},r.glyphs={},r.requests={},r.ranges={}}this.entries={},this.fontFaceManager.destroy()}},sB=()=>oB||(oB=new vu({anchor:new Ha(mi.light.anchor,"anchor"),position:new Ha(mi.light.position,"position"),color:new Ha(mi.light.color,"color"),intensity:new Ha(mi.light.intensity,"intensity")})),lB=class extends Nl{constructor(e,r){super(),this._transitionable=new Ag(sB(),"light",r),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}getCartesianPosition(){return nJ(this.properties.get("position"))}setLight(e,r={}){if(!this._validate(Hc.light,e,r))for(let t in e){let i=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-Ux.length),i):this._transitionable.setValue(t,i)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,t){return Q1(this,e,{value:r},t)}},cB=()=>uB||(uB=new vu({"sky-color":new Ha(mi.sky["sky-color"],"sky-color"),"horizon-color":new Ha(mi.sky["horizon-color"],"horizon-color"),"fog-color":new Ha(mi.sky["fog-color"],"fog-color"),"fog-ground-blend":new Ha(mi.sky["fog-ground-blend"],"fog-ground-blend"),"horizon-fog-blend":new Ha(mi.sky["horizon-fog-blend"],"horizon-fog-blend"),"sky-horizon-blend":new Ha(mi.sky["sky-horizon-blend"],"sky-horizon-blend"),"atmosphere-blend":new Ha(mi.sky["atmosphere-blend"],"atmosphere-blend")})),fB=class extends Nl{constructor(e,r){super(),this._transitionable=new Ag(cB(),"sky",r),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new ns(0))}setSky(e,r={}){if(!this._validate(Hc.sky,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let t in e){let i=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-Ux.length),i):this._transitionable.setValue(t,i)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,t={}){return Q1(this,e,{value:r},t)}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}},hB=class{constructor(e,r){this.width=e,this.height=r,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,r){var t;let i=e.join(",")+String(r);return(t=this.dashEntry)[i]||(t[i]=this.addDash(e,r)),this.dashEntry[i]}getDashRanges(e,r,t){let i=e.length%2==1,a=[],o=i?-e[e.length-1]*t:0,s=e[0]*t,l=!0;a.push({left:o,right:s,isDash:l,zeroLength:e[0]===0});let n=e[0];for(let u=1;u1&&(n=e[++l]);let c=Math.abs(u-n.left),f=Math.abs(u-n.right),h=Math.min(c,f),d,p=a/t*(i+1);if(n.isDash){let g=i-Math.abs(p);d=Math.sqrt(h*h+g*g)}else d=i-Math.sqrt(h*h+p*p);this.data[s+u]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e){for(let s=e.length-1;s>=0;--s){let l=e[s],n=e[s+1];l.zeroLength?e.splice(s,1):n?.isDash===l.isDash&&(n.left=l.left,e.splice(s,1))}let r=e[0],t=e[e.length-1];r.isDash===t.isDash&&(r.left=t.left-this.width,t.right=r.right+this.width);let i=this.width*this.nextRow,a=0,o=e[a];for(let s=0;s1&&(o=e[++a]);let l=Math.abs(s-o.left),n=Math.abs(s-o.right),u=Math.min(l,n),c=o.isDash?u:-u;this.data[i+s]=Math.max(0,Math.min(255,c+128))}}addDash(e,r){let t=r?7:0,i=2*t+1;if(this.nextRow+i>this.height)return To("LineAtlas out of space"),null;let a=0;for(let s of e)a+=s;if(a!==0){let s=this.width/a,l=this.getDashRanges(e,this.width,s);r?this.addRoundDash(l,s,t):this.addRegularDash(l)}let o={y:this.nextRow+t,height:2*t,width:a};return this.nextRow+=i,this.dirty=!0,o}bind(e){let r=e.gl;this.texture?(r.bindTexture(r.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,r.texSubImage2D(r.TEXTURE_2D,0,0,0,this.width,this.height,r.ALPHA,r.UNSIGNED_BYTE,this.data))):(this.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,this.width,this.height,0,r.ALPHA,r.UNSIGNED_BYTE,this.data))}},g2="maplibre_preloaded_worker_pool",Yg=class iU{constructor(){this.active={},this.workersPromise=null}acquire(r){return Xr(this,null,function*(){if(this.active[r]=!0,!this.workersPromise){let t=[];for(;t.length{for(let a of i)a.terminate()})}}isPreloaded(){return!!this.active[g2]}numActive(){return Object.keys(this.active).length}},dB=Math.floor(yc.hardwareConcurrency/2),Yg.workerCount=sJ(globalThis)?Math.max(Math.min(dB,3),1):1,bM=class{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r,this.removed=!1,this.actorsPromise=this.initActors(r)}initActors(e){return Xr(this,null,function*(){let r=yield this.workerPool.acquire(e);if(this.removed)return[];if(this.actors=r.map((t,i)=>{let a=new l5(t,e);return a.name=`Worker ${i}`,a}),!this.actors.length)throw Error("No actors found");return this.actors})}broadcast(e,r){return Xr(this,null,function*(){let t=yield this.actorsPromise;return Promise.all(t.map(i=>i.sendAsync({type:e,data:r})))})}getActor(){return Xr(this,null,function*(){let e=yield this.actorsPromise;return this.currentActor=(this.currentActor+1)%e.length,e[this.currentActor]})}waitForInitComplete(){return Xr(this,null,function*(){this.actors.length===0&&(yield this.actorsPromise)})}getReadyActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.removed=!0;for(let r of this.actors)r.remove();this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,r){return Xr(this,null,function*(){let t=yield this.actorsPromise;for(let i of t)i.registerMessageHandler(e,r)})}unregisterMessageHandler(e){return Xr(this,null,function*(){let r=yield this.actorsPromise;for(let t of r)t.unregisterMessageHandler(e)})}},bh=class bp{constructor(r,t){r&&(t?this.setSouthWest(r).setNorthEast(t):Array.isArray(r)&&(r.length===4?this.setSouthWest([r[0],r[1]]).setNorthEast([r[2],r[3]]):this.setSouthWest(r[0]).setNorthEast(r[1])))}setNorthEast(r){return this._ne=r instanceof An?new An(r.lng,r.lat):An.convert(r),this}setSouthWest(r){return this._sw=r instanceof An?new An(r.lng,r.lat):An.convert(r),this}extend(r){let t=this._sw,i=this._ne,a,o;if(r instanceof An)a=r,o=r;else if(r instanceof bp){if(a=r._sw,o=r._ne,!a||!o)return this}else{if(Array.isArray(r)){if(r.length===4||r.every(Array.isArray)){let s=r;return this.extend(bp.convert(s))}{let s=r;return this.extend(An.convert(s))}}return r&&("lng"in r||"lon"in r)&&"lat"in r?this.extend(An.convert(r)):this}return!t&&!i?(this._sw=new An(a.lng,a.lat),this._ne=new An(o.lng,o.lat)):(t.lng=Math.min(a.lng,t.lng),t.lat=Math.min(a.lat,t.lat),i.lng=Math.max(o.lng,i.lng),i.lat=Math.max(o.lat,i.lat)),this}getCenter(){return new An((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 An(this.getWest(),this.getNorth())}getSouthEast(){return new An(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(r){let{lng:t,lat:i}=An.convert(r),a=this._sw.lat<=i&&i<=this._ne.lat,o=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=t&&t>=this._ne.lng),a&&o}intersects(r){if(r=bp.convert(r),!(r.getNorth()>=this.getSouth()&&r.getSouth()<=this.getNorth()))return!1;let t=Math.abs(this.getEast()-this.getWest()),i=Math.abs(r.getEast()-r.getWest());if(t>=360||i>=360)return!0;let a=ch(this.getWest(),-180,180),o=ch(this.getEast(),-180,180),s=ch(r.getWest(),-180,180),l=ch(r.getEast(),-180,180),n=a>o,u=s>l;return n&&u?!0:n?l>=a||s<=o:u?o>=s||a<=l:s<=o&&l>=a}static convert(r){return r instanceof bp||!r?r:new bp(r)}static fromLngLat(r,t=0){let i=360*t/40075017,a=i/Math.cos(Math.PI/180*r.lat);return new bp(new An(r.lng-a,r.lat-i),new An(r.lng+a,r.lat+i))}adjustAntiMeridian(){let r=new An(this._sw.lng,this._sw.lat),t=new An(this._ne.lng,this._ne.lat);return r.lng>t.lng?new bp(r,new An(t.lng+360,t.lat)):new bp(r,t)}},wM=class{constructor(e,r,t){this.bounds=bh.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=t||24}validateBounds(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}contains(e){let r=2**e.z,t={minX:Math.floor(lm(this.bounds.getWest())*r),minY:Math.floor(um(this.bounds.getNorth())*r),maxX:Math.ceil(lm(this.bounds.getEast())*r),maxY:Math.ceil(um(this.bounds.getSouth())*r)};return e.x>=t.minX&&e.x=t.minY&&e.y{this.tiles=e,this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}serialize(){return yn({},this._options)}loadTile(e){return Xr(this,null,function*(){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),t={request:yield this.map._requestManager.transformRequest(r,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(e),etag:e.etag};t.request.collectResourceTiming=this._collectResourceTiming,yield this.dispatcher.waitForInitComplete();let i="RT";if(!e.actor||e.state==="expired")e.actor=this.dispatcher.getReadyActor(),i="LT";else if(e.state==="loading")return new Promise((a,o)=>{e.reloadPromise={resolve:a,reject:o}});e.abortController=new AbortController;try{let a=yield e.actor.sendAsync({type:i,data:t},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,a);let o={};return a?.etagUnmodified&&(o.unmodified=!0),o}catch(a){if(delete e.abortController,e.aborted||jp(a))return;if(a&&a.status!==404)throw a;this._afterTileLoadWorkerResponse(e,null)}})}_getOverzoomParameters(e){return Xr(this,null,function*(){if(e.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let r=e.tileID.scaledTo(this.maxzoom).canonical,t=r.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:r,overzoomRequest:yield this.map._requestManager.transformRequest(t,"Tile")}})}_afterTileLoadWorkerResponse(e,r){if(r?.resourceTiming&&(e.resourceTiming=r.resourceTiming),r&&this.map._refreshExpiredTiles&&e.setExpiryData(r),e.etag=r?.etag,e.loadVectorData(r,this.map.painter),e.reloadPromise){let t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return Xr(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return Xr(this,null,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}},_2=class extends Nl{constructor(e,r,t,i){super(),this.id=e,this.dispatcher=t,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._premultiplyAlpha=!0,this._options=yn({type:"raster"},r),yn(this,N1(r,["url","scheme","tileSize"]))}load(e=!1){return Xr(this,null,function*(){this._loaded=!1,this.fire(new zs("dataloading")),this._tileJSONRequest=new AbortController;try{let r=yield q5(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,r&&(yn(this,r),r.bounds&&(this.tileBounds=new wM(r.bounds,this.minzoom,this.maxzoom)),this.fire(new zs("data",{sourceDataType:"metadata"})),this.fire(new zs("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(r){this._tileJSONRequest=null,this._loaded=!0,jp(r)||this.fire(new Ln(Zu(r)))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null)),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this.tiles=e,this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return yn({},this._options)}setPremultiplyAlpha(e){return this._premultiplyAlpha===e||this.setSourceProperty(()=>{this._premultiplyAlpha=e}),this}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return Xr(this,null,function*(){var r;let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i=this._premultiplyAlpha,a=i?void 0:{premultiplyAlpha:"none"};e.abortController=new AbortController;try{let o=yield td.transformAndGetImage(this.map._requestManager,t,"Tile",e.abortController,this.map._refreshExpiredTiles,a);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(o){this.map._refreshExpiredTiles&&(o.cacheControl||o.expires)&&e.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});let s=this.map.painter.context,l=s.gl,n=(r=o.data)!=null?r:new Rs({width:1,height:1},new Uint8Array(4));e.texture=this.map.painter.getTileTexture(n.width),e.texture?e.texture.update(n,{useMipmap:!0,premultiply:i}):(e.texture=new jl(s,n,l.RGBA,{useMipmap:!0,premultiply:i}),e.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE,l.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(o){if(delete e.abortController,e.aborted)e.state="unloaded";else if(o)throw e.state="errored",o}})}abortTile(e){return Xr(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return Xr(this,null,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}},AM=class extends _2{constructor(e,r,t,i){super(e,r,t,i),this.type="raster-dem",this.maxzoom=22,this._options=yn({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return Xr(this,null,function*(){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let t=yield td.transformAndGetImage(this.map._requestManager,r,"Tile",e.abortController,this.map._refreshExpiredTiles,{colorSpaceConversion:"none"});if(delete e.abortController,e.aborted){e.state="unloaded";return}if(t){if(this.map._refreshExpiredTiles&&(t.cacheControl||t.expires)&&e.setExpiryData({cacheControl:t.cacheControl,expires:t.expires}),!t.data){e.state="loaded";return}let i=t.data,a=P0(i)&&B4()?i:yield this.readImageNow(i),o={type:this.type,uid:e.uid,source:this.id,rawImageData:a,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(e.actor&&e.state!=="expired"&&e.state!=="reloading")return;yield this.dispatcher.waitForInitComplete(),(!e.actor||e.state==="expired")&&(e.actor=this.dispatcher.getReadyActor()),e.dem=yield e.actor.sendAsync({type:"LDT",data:o}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0,e.state="loaded"}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}})}readImageNow(e){return Xr(this,null,function*(){if(typeof VideoFrame<"u"&&l9()){let r=e.width+4,t=e.height+4;try{return new Rs({width:r,height:t},yield uJ(e,-2,-2,r,t))}catch{}}return yc.getImageData(e,2)})}_getNeighboringTiles(e){let r=e.canonical,t=2**r.z,i=(r.x-1+t)%t,a=r.x===0?e.wrap-1:e.wrap,o=(r.x+1+t)%t,s=r.x+1===t?e.wrap+1:e.wrap,l={};return l[new Cu(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new Cu(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new Cu(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new Cu(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new Cu(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1$5(r))}}shouldReloadTile(e,{affectedBounds:r}){if(e.state==="loading")return!0;if(e.state==="unloaded")return!1;let{buffer:t,extent:i}=this.workerOptions.geojsonVtOptions,a=kne(e.tileID.canonical,t/i);for(let o of r)if(a.intersects(o))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(e){return Xr(this,null,function*(){let r=e.actor?"RT":"LT";e.actor=yield this.actorPromise;let t={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;try{let i=yield(yield this.actorPromise).sendAsync({type:r,data:t},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(i,this.map.painter,r==="RT")}catch(i){if(delete e.abortController,e.aborted||jp(i))return;throw i}})}abortTile(e){return Xr(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return Xr(this,null,function*(){e.unloadVectorData(),yield(yield this.actorPromise).sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actorPromise.then(e=>e.sendAsync({type:"RS",data:{type:this.type,source:this.id}}))}serialize(){return yn({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}},tv=[0,0,1],pB=(e,r)=>({u_tl_parent:new mo(e,r.u_tl_parent),u_scale_parent:new Xa(e,r.u_scale_parent),u_buffer_scale:new Xa(e,r.u_buffer_scale),u_image_warp:new vc(e,r.u_image_warp),u_fade_t:new Xa(e,r.u_fade_t),u_opacity:new Xa(e,r.u_opacity),u_image0:new En(e,r.u_image0),u_image1:new En(e,r.u_image1),u_brightness_low:new Xa(e,r.u_brightness_low),u_brightness_high:new Xa(e,r.u_brightness_high),u_saturation_factor:new Xa(e,r.u_saturation_factor),u_contrast_factor:new Xa(e,r.u_contrast_factor),u_spin_weights:new vc(e,r.u_spin_weights),u_coords_top:new Sm(e,r.u_coords_top),u_coords_bottom:new Sm(e,r.u_coords_bottom)}),vB=(e,r,t,i,a,o)=>({u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_image_warp:o,u_fade_t:t.mix,u_opacity:t.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:Lne(i.paint.get("raster-saturation")),u_contrast_factor:Dne(i.paint.get("raster-contrast")),u_spin_weights:Cne(i.paint.get("raster-hue-rotate")),u_coords_top:[a[0].x,a[0].y,a[1].x,a[1].y],u_coords_bottom:[a[3].x,a[3].y,a[2].x,a[2].y]}),Um=class{constructor(e,r,t){this.vertexBuffer=e,this.indexBuffer=r,this.segments=t}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}},i0=ul([{name:"a_pos",type:"Int16",components:2}]),Zg=Bi/128,rv=class extends Nl{constructor(e,r,t,i){super(),this.imageWarp=tv,this.flippedWindingOrder=!1,this._warp="auto",this._imageDirty=!1,this._subdividedQuad=!1,this._subdividedMesh=null,this.id=e,this.dispatcher=t,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}load(e){return Xr(this,null,function*(){if(this.options.url===void 0){this._loaded=!0,this._finishLoading();return}this._loaded=!1,this.fire(new zs("dataloading")),this.url=this.options.url,this._abortController=new AbortController;try{let r=yield td.transformAndGetImage(this.map._requestManager,this.url,"Image",this._abortController);this._abortController=null,this._loaded=!0,r?.data?(this._setImage(r.data),e&&(this.coordinates=e),this._finishLoading()):this.fire(new Ln(Error(`Could not load image ${this.url}: the response is empty`)))}catch(r){if(jp(r))return;this._abortController=null,this._loaded=!0,this.fire(new Ln(Zu(r)))}})}loaded(){return this._loaded}updateImage(e){return this._abortController&&(this._abortController=(this._abortController.abort(),null)),"image"in e?(this._loaded=!0,this._setImage(e.image),e.coordinates&&(this.coordinates=e.coordinates),this._finishLoading(),this):e.url?(this.options.url=e.url,this.load(e.coordinates),this):this}_setImage(e){this.image=e,this._imageDirty=!0}getMesh(e,r){var t;return!this._subdividedQuad||r?null:((t=this._subdividedMesh)!=null||(this._subdividedMesh=W5(e,{granularity:16})),this._subdividedMesh)}_disposeTexture(){var e;(e=this.texture)==null||e.destroy(),this.texture=null}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new zs("data",{sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){var e;this._abortController&&(this._abortController=(this._abortController.abort(),null)),this._disposeTexture(),(e=this._subdividedMesh)==null||e.destroy(),this._subdividedMesh=null,this.image=null,this.tiles={}}setWarp(e){return this._warp===e?this:(this._warp=e,this.tileCoords&&this.setCoordinates(this.coordinates),this)}getWarp(){return this._warp}setCoordinates(e){this.coordinates=e;let r=e.map(Qo.fromLngLat);return this.tileID=Fne(r),this.terrainTileRanges=this._getOverlappingTileRanges(r),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=r.map(t=>this.tileID.getTilePoint(t)._round()),this.imageWarp=Ine(this.tileCoords,this._warp),this._subdividedQuad=this.imageWarp[2]>0&&!X5(this.tileCoords),this.flippedWindingOrder=Pne(this.tileCoords),this.fire(new zs("data",{sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,r=e.gl;this.texture?this._imageDirty&&(this.texture.update(this.image),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)):(this.texture=new jl(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this._imageDirty=!1;let t=!1;for(let i in this.tiles){let a=this.tiles[i];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,t=!0)}t&&this.fire(new zs("data",{sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return Xr(this,null,function*(){var r;(r=this.tileID)!=null&&r.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){let e={type:"image",coordinates:this.coordinates};return this.options.url!==void 0&&(e.url=this.options.url),e}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:r,minY:t,maxX:i,maxY:a}=gh.fromPoints(e),o={};for(let s=0;s<=25;s++){let l=2**s,n=Math.floor(r*l),u=Math.floor(t*l),c=Math.floor(i*l),f=Math.floor(a*l),h=(n%l+l)%l,d=c%l,p=Math.floor(n/l),g=Math.floor(c/l);o[s]={minWrap:p,maxWrap:g,minTileXWrapped:h,maxTileXWrapped:d,minTileY:u,maxTileY:f}}return o}},SM=class extends rv{constructor(e,r,t,i){super(e,r,t,i),this._onPlayingHandler=()=>{var a;(a=this.map)==null||a.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=r}load(){return Xr(this,null,function*(){this._loaded=!1;let e=this.options;this.urls=[];for(let r of e.urls)this.urls.push((yield this.map._requestManager.transformRequest(r,"Source")).url);try{let r=yield SP(this.urls);if(this._loaded=!0,!r)return;this.video=r,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new Ln(Zu(r)))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let r=this.video.seekable;er.end(0)?this.fire(new Ln(new na(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,r=e.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new jl(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let t=!1;for(let i in this.tiles){let a=this.tiles[i];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,t=!0)}t&&this.fire(new zs("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},EM=class extends rv{constructor(e,r,t,i){super(e,r,t,i),r.coordinates?(!Array.isArray(r.coordinates)||r.coordinates.length!==4||r.coordinates.some(a=>!Array.isArray(a)||a.length!==2||a.some(o=>typeof o!="number")))&&this.fire(new Ln(new na(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Ln(new na(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new Ln(new na(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas!="string"&&!(r.canvas instanceof HTMLCanvasElement)&&this.fire(new Ln(new na(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new Ln(new na(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate===void 0||r.animate}load(){return Xr(this,null,function*(){if(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 Ln(Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this._playing=(this.prepare(),!1))},this._finishLoading()})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this._playing=!1,super.onRemove()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let r=this.map.painter.context,t=r.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new jl(r,this.canvas,t.RGBA,{premultiply:!0}),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let i=!1;for(let a in this.tiles){let o=this.tiles[a];o.state!=="loaded"&&(o.state="loaded",o.texture=this.texture,i=!0)}i&&this.fire(new zs("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},kM={},mB=(e,r,t,i)=>{let a=new(CM(r.type))(e,r,t,i);if(a.id!==e)throw Error(`Expected Source id to be ${e} instead of ${a.id}`);return a},CM=e=>{switch(e){case"geojson":return MM;case"image":return rv;case"raster":return _2;case"raster-dem":return AM;case"vector":return TM;case"video":return SM;case"canvas":return EM}return kM[e]},gB=(e,r)=>{kM[e]=r},yB=(e,r)=>Xr(null,null,function*(){if(CM(e))throw Error(`A source type called "${e}" already exists.`);gB(e,r)}),x2="RTLPluginLoaded",_B=class extends Nl{constructor(...e){super(...e),this.status="unavailable",this.url=null,this.dispatcher=GA()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(r=>{throw this.status="error",r})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e,r=!1){return Xr(this,null,function*(){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=yc.resolveURL(e),!this.url)throw Error(`requested url ${e} is invalid`);if(this.status==="unavailable")if(r)this.status="deferred",this._syncState(this.status);else return this._requestImport();else if(this.status==="requested")return this._requestImport()})}_requestImport(){return Xr(this,null,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new hf(x2))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}},b2=null,DM=class{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=x9(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rttObjects=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading",this.featureStateRevision=-1}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:r,fadingParentID:t,fadeEndTime:i}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=r,this.fadingParentID=t,this.fadeEndTime=i}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=hs(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}getRTT(e){return this.rttObjects[e]}acquireRTT(e,r,t){return this.rttObjects[r]=e.acquireRTT(t)}releaseRTT(e){if(this.rttObjects.length!==0){for(let r of this.rttObjects)r&&e.releaseRTT(r);this.rttObjects.length=0}}loadVectorData(e,r,t){if(e?.etagUnmodified===!0){this.state="loaded";return}if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e){this.collisionBoxArray=new NT;return}e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestEncoding=e.encoding,this.latestFeatureIndex.rawTileData=e.rawTileData,this.latestFeatureIndex.encoding=e.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=zne(e.buckets,r?.style),this.hasSymbolBuckets=!1;for(let i in this.buckets){let a=this.buckets[i];if(a instanceof Ig)if(this.hasSymbolBuckets=!0,t)a.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let i in this.buckets){let a=this.buckets[i];if(a instanceof Ig&&a.hasRTLText){this.hasRTLText=!0,jg().lazyLoad();break}}this.queryPadding=0;for(let i in this.buckets){let a=this.buckets[i];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(i).queryRadius(a))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let t in this.buckets){let i=this.buckets[t];i.uploadPending()&&i.upload(e)}let r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new jl(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasImage=(this.glyphAtlasTexture=new jl(e,this.glyphAtlasImage,r.ALPHA),null))}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,r,t,i,a,o,s,l,n,u,c){var f;return(f=this.latestFeatureIndex)!=null&&f.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:a,scale:o,tileSize:this.tileSize,pixelPosMatrix:u,transform:l,params:s,queryPadding:this.queryPadding*n,getElevation:c},e,r,t):{}}querySourceFeatures(e,r){let t=this.latestFeatureIndex;if(!t?.rawTileData)return;let i=t.loadVTLayers(),a=r?.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;let s=Z1(r?.filter,`querySourceFeatures[${a}].filter`,r?.globalState),{z:l,x:n,y:u}=this.tileID.canonical,c={z:l,x:n,y:u};for(let f=0;ft)i=!1;else if(!r)i=!0;else if(this.expirationTimethis.max[0]||r.aabb.min[1]>this.max[1]||r.aabb.min[2]>this.max[2]||r.aabb.max[0]0?(t+=r[a]*this.min[a],i+=r[a]*this.max[a]):(i+=r[a]*this.min[a],t+=r[a]*this.max[a]);return t>=0?2:i<0?0:1}},T2=class nU{constructor(r,t,i){this.points=r,this.planes=t,this.aabb=i}static fromInvProjectionMatrix(r,t=1,i=0,a,o){let 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]],l=o?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],n=2**i,u=s.map(d=>Bne(d,r,t,n));a&&One(u,l[0],a,o);let c=l.map(d=>{let p=Sd([],u[d[0]],u[d[1]]),g=Sd([],u[d[2]],u[d[1]]),m=qc([],uf([],p,g)),y=-Kl(m,u[d[1]]);return m.concat(y)}),f=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0];for(let d of u)for(let p=0;p<3;p++)f[p]=Math.min(f[p],d[p]),h[p]=Math.max(h[p],d[p]);return new nU(u,c,new w2(f,h))}},bB=HA(9.314,3),LM=class{constructor(){this._tiles={}}handleWrapJump(e){let r={};for(let t in this._tiles){let i=this._tiles[t];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}this._tiles=r}setFeatureState(e,r,t){for(let i in this._tiles)this._tiles[i].setFeatureState(e,r,t)}getAllTiles(){return Object.values(this._tiles)}getAllIds(e=!1){return e?Object.values(this._tiles).map(r=>r.tileID).sort(OF).map(r=>r.key):Object.keys(this._tiles)}getTileById(e){return this._tiles[e]}setTile(e,r){this._tiles[e]=r}deleteTileById(e){delete this._tiles[e]}getLoadedTile(e){let r=this.getTileById(e.key);return r?.hasData()?r:null}isIdRenderable(e,r=!1){var t;return(t=this.getTileById(e))==null?void 0:t.isRenderable(r)}getRenderableIds(e=0,r){let t=[];for(let i of this.getAllIds())this.isIdRenderable(i,r)&&t.push(this.getTileById(i));return r?t.sort((i,a)=>{let o=i.tileID,s=a.tileID,l=new Wr(o.canonical.x,o.canonical.y)._rotate(-e),n=new Wr(s.canonical.x,s.canonical.y)._rotate(-e);return o.overscaledZ-s.overscaledZ||n.y-l.y||n.x-l.x}).map(i=>i.tileID.key):t.map(i=>i.tileID).sort(OF).map(i=>i.key)}},A2=(qm=class extends Nl{constructor(e,r,t){super(),this._maxContentElevationSeen=0,this.id=e,this.dispatcher=t,this.on("data",i=>{this._dataHandler(i)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=mB(e,r,t,this),this._inViewTiles=new LM,this._outOfViewCache=new k5(0,i=>this._unloadTile(i)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new xB,this._didEmitContent=!1,this._updated=!1}onAdd(e){var r;this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,(r=this._source)!=null&&r.onAdd&&this._source.onAdd(e)}onRemove(e){var r;for(let t of this._inViewTiles.getAllTiles())t.unloadVectorData();this.clearTiles(),(r=this._source)!=null&&r.onRemove&&this._source.onRemove(e),this._inViewTiles=new LM}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((this.used!==void 0||this.usedForTerrain!==void 0)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let e of this._inViewTiles.getAllTiles())if(e.state!=="loaded"&&e.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,r,t,i){return Xr(this,null,function*(){try{let a=yield this._source.loadTile(e);this._tileLoaded(e,r,t,i,a)}catch(a){e.state="errored",a.status===404?this.update(this.transform,this.terrain):this._source.fire(new Ln(Zu(a),{tile:e}))}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new zs("dataabort",{tile:e,coord:e.tileID}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let r of this._inViewTiles.getAllTiles())r.upload(e),r.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(e){var r;return this._inViewTiles.getRenderableIds((r=this.transform)==null?void 0:r.bearingInRadians,e)}hasRenderableParent(e){let r=e.overscaledZ-1;if(r>=this._source.minzoom){let t=this.getLoadedTile(e.scaledTo(r));if(t)return this._inViewTiles.isIdRenderable(t.tileID.key)}return!1}reload(e,r=void 0){if(this._paused){this._shouldReloadOnResume=!0;return}this._outOfViewCache.reset();for(let t of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(t);(!r||this._source.shouldReloadTile(i,r))&&(e?this._reloadTile(t,i.state==="errored"?"loading":"expired"):i.state!=="errored"&&this._reloadTile(t,"reloading"))}}_reloadTile(e,r){return Xr(this,null,function*(){let t=this._inViewTiles.getTileById(e);if(!t)return;let i=t.hasData();t.state!=="loading"&&(t.state=r),yield this._loadTile(t,e,r,i)})}_tileLoaded(e,r,t,i,a){i||(e.timeAdded=hs(),e.selfFading&&(e.fadeEndTime=e.timeAdded+this._rasterFadeDuration)),t==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),!a?.unmodified&&(this.getSource().type==="raster-dem"&&e.dem&&Xne(e,this._inViewTiles),e.featureStateRevision=-1,this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new zs("data",{tile:e,coord:e.tileID})))}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._inViewTiles.getTileById(e)}_retainLoadedChildren(e,r){let t=this._getLoadedDescendents(r),i=new Set;for(let a of r){let o=t[a.key];if(!o?.length){i.add(a);continue}let s=a.overscaledZ+qm.maxOverzooming,l=o.filter(c=>c.tileID.overscaledZ<=s);if(!l.length){i.add(a);continue}let n=Math.min(...l.map(c=>c.tileID.overscaledZ)),u=l.filter(c=>c.tileID.overscaledZ===n).map(c=>c.tileID);for(let c of u)e[c.key]=c;this._areDescendentsComplete(u,n,a.overscaledZ)||i.add(a)}return i}_getLoadedDescendents(e){var r;let t={};for(let i of this._inViewTiles.getAllTiles().filter(a=>a.hasData()))for(let a of e)i.tileID.isChildOf(a)&&(t[r=a.key]||(t[r]=[]),t[a.key].push(i));return t}_areDescendentsComplete(e,r,t){return e.length===1&&e[0].isOverscaled()?e[0].overscaledZ===r:4**(r-t)===e.length}getLoadedTile(e){return this._inViewTiles.getLoadedTile(e)}updateCacheSize(e){let r=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),t=this._maxTileCacheZoomLevels===null?ff.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,i=Math.floor(r*t),a=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,i):i;this._outOfViewCache.setMaxSize(a)}handleWrapJump(e){let r=(e-(this._prevLng===void 0?e:this._prevLng))/360,t=Math.round(r);this._prevLng=e,t&&(this._inViewTiles.handleWrapJump(t),this._resetTileReloadTimers())}_updateMaxContentElevation(){var e,r;let t=this._maxContentElevationSeen,i=(r=(e=this.map)==null?void 0:e.style)==null?void 0:r._layers;if(!i)return t;let a=this._inViewTiles.getAllTiles();for(let o in i){let s=i[o];if(s.type!=="symbol"||s.source!==this.id||s.isHidden(this.transform.zoom))continue;let l=s;if(l.layout){t=Math.max(t,l.layout.get("symbol-height-offset").constantOr(0));for(let n of a){let u=n.getBucket(s);u&&u.maxHeightOffset>t&&(t=u.maxHeightOffset)}}}return this._maxContentElevationSeen=t,t}update(e,r){if(!this._sourceLoaded||this._paused)return;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng);let t;!this.used&&!this.usedForTerrain?t=[]:this._source.tileID?t=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(l=>new Cu(l.canonical.z,l.wrap,l.canonical.z,l.canonical.x,l.canonical.y)):(t=Bm(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?Math.max(this._source.maxzoom,e.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r,calculateTileZoom:this._source.calculateTileZoom,maxContentElevation:this._updateMaxContentElevation()}),this._source.hasTile&&(t=t.filter(l=>this._source.hasTile(l)))),this.usedForTerrain&&(t=this._addTerrainIdealTiles(t));let i=t.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,i&&this.fire(new zs("data",{sourceDataType:"idle",sourceId:this.id}));let a=$A(e,this._source),o=this._updateRetainedTiles(t,a),s=J5(this._source.type);s&&this._rasterFadeDuration>0&&!r&&Gne(this._inViewTiles,t,o,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),s?this._cleanUpRasterTiles(o):this._cleanUpVectorTiles(o)}_cleanUpRasterTiles(e){for(let r of this._inViewTiles.getAllIds())e[r]||this._removeTile(r)}_cleanUpVectorTiles(e){for(let r of this._inViewTiles.getAllIds()){let t=this._inViewTiles.getTileById(r);if(e[r]){t.clearSymbolFadeHold();continue}if(!t.hasSymbolBuckets){this._removeTile(r);continue}t.holdingForSymbolFade()?t.symbolFadeFinished()&&this._removeTile(r):t.setSymbolHoldDuration(this.map._fadeDuration)}}_addTerrainIdealTiles(e){let r=[];for(let t of e)if(t.canonical.z>this._source.minzoom){let i=t.scaledTo(t.canonical.z-1);r.push(i);let a=t.scaledTo(Math.max(this._source.minzoom,Math.min(t.canonical.z,5)));r.push(a)}return e.concat(r)}releaseSymbolFadeTiles(){for(let e of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(e).holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(e,r){var t;let i=new Set;for(let n of e)this._addTile(n).hasData()||i.add(n);let a=e.reduce((n,u)=>(n[u.key]=u,n),{}),o=this._retainLoadedChildren(a,i),s={},l=Math.max(r-qm.maxUnderzooming,this._source.minzoom);for(let n of o){let u=this._inViewTiles.getTileById(n.key),c=u?.wasRequested();for(let f=n.overscaledZ-1;f>=l;--f){let h=n.scaledTo(f);if(s[h.key])break;if(s[h.key]=!0,u=this.getTile(h),!u&&c&&(u=this._addTile(h)),u){let d=u.hasData();if((d||!((t=this.map)!=null&&t.cancelPendingTileRequestsWhileZooming)||c)&&(a[h.key]=h),c=u.wasRequested(),d)break}}}return a}_addTile(e){let r=this._inViewTiles.getTileById(e.key);if(r)return r;r=this._outOfViewCache.getAndRemove(e),r&&(r.resetFadeLogic(),this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null));let t=r;return r||(r=new DM(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state,!1)),r.uses++,this._inViewTiles.setTile(e.key,r),t||this._source.fire(new zs("dataloading",{tile:r,coord:r.tileID})),r}_setTileReloadTimer(e,r){this._clearTileReloadTimer(e);let t=r.getExpiryTimeout();if(t){let i=()=>{this._reloadTile(e,"expired"),delete this._timers[e]};this._timers[e]=setTimeout(i,t)}}_clearTileReloadTimer(e){let r=this._timers[e];r&&(clearTimeout(r),delete this._timers[e])}_resetTileReloadTimers(){for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(e);this._setTileReloadTimer(e,r)}}refreshTiles(e){for(let r of this._inViewTiles.getAllIds()){let t=this._inViewTiles.getTileById(r);(this._inViewTiles.isIdRenderable(r)||t.state=="errored")&&e.some(i=>i.equals(t.tileID.canonical))&&this._reloadTile(r,"expired")}}_removeTile(e){let r=this._inViewTiles.getTileById(e);r&&(r.uses--,this._inViewTiles.deleteTileById(e),this._clearTileReloadTimer(e),!(r.uses>0)&&(r.hasData()&&r.state!=="reloading"?this._outOfViewCache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}_dataHandler(e){if(e.dataType==="source"){if(e.sourceDataType==="metadata"){this._sourceLoaded=!0;return}e.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(e.sourceDataChanged,e.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}}resetMaxContentElevation(){this._maxContentElevationSeen=0}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1,this.resetMaxContentElevation();for(let e of this._inViewTiles.getAllIds())this._removeTile(e);this._outOfViewCache.reset()}tilesIn(e,r,t){let i=[],a=this.transform;if(!a)return i;let o=a.getCoveringTilesDetailsProvider().allowWorldCopies(),s=t?a.getCameraQueryGeometry(e):e,l=h=>a.screenPointToMercatorCoordinate(h,this.terrain),n=this.transformBbox(e,l,!o),u=this.transformBbox(s,l,!o),c=this.getIds(),f=gh.fromPoints(u);for(let h of c){let d=this._inViewTiles.getTileById(h);if(d.holdingForSymbolFade())continue;let p=o?[d.tileID]:[d.tileID.unwrapTo(-1),d.tileID.unwrapTo(0)],g=2**(a.zoom-d.tileID.overscaledZ),m=r*d.queryPadding*Bi/d.tileSize/g;for(let y of p){let _=f.map(v=>y.getTilePoint(new Qo(v.x,v.y)));if(_.expandBy(m),_.intersects(cR)){let v=n.map(S=>y.getTilePoint(S)),x=u.map(S=>y.getTilePoint(S));i.push({tile:d,tileID:o?y:y.unwrapTo(0),queryGeometry:v,cameraQueryGeometry:x,scale:g})}}}return i}transformBbox(e,r,t){let i=e.map(r);if(t){let a=gh.fromPoints(e);a.shrinkBy(Math.min(a.width(),a.height())*.001);let o=a.map(r);gh.fromPoints(i).covers(o)||(i=i.map(s=>s.x>.5?new Qo(s.x-1,s.y,s.z):s))}return i}getVisibleCoordinates(e){let r=this.getRenderableIds(e).map(t=>this._inViewTiles.getTileById(t).tileID);return this.transform&&this.transform.populateCache(r),r}hasTransition(){return this._source.hasTransition()?!0:J5(this._source.type)&&Yne(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,r,t){e||(e=Bg),this._state.updateState(e,r,t)}removeFeatureState(e,r,t){e||(e=Bg),this._state.removeFeatureState(e,r,t)}getFeatureState(e,r){return e||(e=Bg),this._state.getState(e,r)}setDependencies(e,r,t){let i=this._inViewTiles.getTileById(e);i&&i.setDependencies(r,t)}reloadTilesForDependencies(e,r){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).hasDependency(e,r)&&this._reloadTile(t,"reloading");this._outOfViewCache.filter(t=>!t.hasDependency(e,r))}areTilesLoaded(){for(let e of this._inViewTiles.getAllTiles())if(e.state!=="loaded"&&e.state!=="errored")return!1;return!0}},qm.maxUnderzooming=10,qm.maxOverzooming=3,qm),wB=class{constructor(e,r){this.reset(e,r)}reset(e,r){this.points=e||[],this._distances=[0];for(let t=1;t0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}},FM=class{constructor(e,r,t){let i=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(e/t),this.yCellCount=Math.ceil(r/t);for(let o=0;othis.width||i<0||r>this.height)return[];let l=[];if(e<=0&&r<=0&&this.width<=t&&this.height<=i){if(a)return[{key:null,x1:e,y1:r,x2:t,y2:i}];for(let n=0;n0}hitTestCircle(e,r,t,i,a){let o=e-t,s=e+t,l=r-t,n=r+t;if(s<0||o>this.width||n<0||l>this.height)return!1;let u=[],c={hitTest:!0,overlapMode:i,circle:{x:e,y:r,radius:t},seenUids:{box:{},circle:{}}};return this._forEachCell(o,l,s,n,this._queryCellCircle,u,c,a),u.length>0}_queryCell(e,r,t,i,a,o,s,l){let{seenUids:n,hitTest:u,overlapMode:c}=s,f=this.boxCells[a],h=1e-6;if(f!==null){let p=this.bboxes;for(let g of f)if(!n.box[g]){n.box[g]=!0;let m=g*4,y=this.boxKeys[g];if(e<=p[m+2]+h&&r<=p[m+3]+h&&t>=p[m+0]-h&&i>=p[m+1]-h&&(!l||l(y))&&(!u||!Jb(c,y.overlapMode))&&(o.push({key:y,x1:p[m],y1:p[m+1],x2:p[m+2],y2:p[m+3]}),u))return!0}}let d=this.circleCells[a];if(d!==null){let p=this.circles;for(let g of d)if(!n.circle[g]){n.circle[g]=!0;let m=g*3,y=this.circleKeys[g];if(this._circleAndRectCollide(p[m],p[m+1],p[m+2],e,r,t,i)&&(!l||l(y))&&(!u||!Jb(c,y.overlapMode))){let _=p[m],v=p[m+1],x=p[m+2];if(o.push({key:y,x1:_-x,y1:v-x,x2:_+x,y2:v+x}),u)return!0}}}return!1}_queryCellCircle(e,r,t,i,a,o,s,l){let{circle:n,seenUids:u,overlapMode:c}=s,f=this.boxCells[a];if(f!==null){let d=this.bboxes;for(let p of f)if(!u.box[p]){u.box[p]=!0;let g=p*4,m=this.boxKeys[p];if(this._circleAndRectCollide(n.x,n.y,n.radius,d[g+0],d[g+1],d[g+2],d[g+3])&&(!l||l(m))&&!Jb(c,m.overlapMode))return o.push(!0),!0}}let h=this.circleCells[a];if(h!==null){let d=this.circles;for(let p of h)if(!u.circle[p]){u.circle[p]=!0;let g=p*3,m=this.circleKeys[p];if(this._circlesCollide(d[g],d[g+1],d[g+2],n.x,n.y,n.radius)&&(!l||l(m))&&!Jb(c,m.overlapMode))return o.push(!0),!0}}}_forEachCell(e,r,t,i,a,o,s,l){let n=this._convertToXCellCoord(e),u=this._convertToYCellCoord(r),c=this._convertToXCellCoord(t),f=this._convertToYCellCoord(i);for(let h=n;h<=c;h++)for(let d=u;d<=f;d++){let p=this.xCellCount*d+h;if(a.call(this,e,r,t,i,p,o,s,l))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,r,t,i,a,o){let s=i-e,l=a-r,n=t+o;return n*n>s*s+l*l}_circleAndRectCollide(e,r,t,i,a,o,s){let l=(o-i)/2,n=Math.abs(e-(i+l));if(n>l+t)return!1;let u=(s-a)/2,c=Math.abs(r-(a+u));if(c>u+t)return!1;if(n<=l||c<=u)return!0;let f=n-l,h=c-u;return f*f+h*h<=t*t}},TB=Rp(),AB=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]),MB=class{constructor(e,r=new FM(e.width+200,e.height+200,25),t=new FM(e.width+200,e.height+200,25)){this.transform=e,this.grid=r,this.ignoredGrid=t,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,r,t,i,a,o,s,l,n,u,c,f,h=0,d=!0){let p=e.anchorPointX+l[0],g=e.anchorPointY+l[1],m=this.projectAndGetPerspectiveRatio(p,g,a,Kb(u,p,g,h,d),f),y=t*m.perspectiveRatio,_;if(!o&&!s){let k=m.x+(c?c.x*y:0),A=m.y+(c?c.y*y:0);_={allPointsOccluded:!1,box:[k+e.x1*y,A+e.y1*y,k+e.x2*y,A+e.y2*y]}}else _=this._projectCollisionBox(e,y,i,a,o,s,l,m,u,c,f,h,d);let[v,x,S,M]=_.box,C=o?_.allPointsOccluded:m.isOccluded,w=C;return w||(w=m.perspectiveRatio=1;I--)R.push(F.path[I]);for(let I=1;IL.signedDistanceFromCamera<=0)?[]:I.map(L=>L.point)}let z=[];if(R.length>0){let I=R[0].clone(),L=R[0].clone();for(let B=1;B=b.x&&L.x<=E.x&&I.y>=b.y&&L.y<=E.y?[R]:L.xE.x||L.yE.y?[]:CF([R],b.x,b.y,E.x,E.y)}for(let I of z){T.reset(I,A*.25);let L=0;L=T.length<=.5*A?1:Math.ceil(T.paddedLength/P)+1;for(let B=0;B=this.screenRightBoundary||i<100||r>this.screenBottomBoundary}isInsideGrid(e,r,t,i){return t>=0&&e=0&&rthis.projectAndGetPerspectiveRatio(R.x,R.y,i,Kb(n,R.x,R.y,f,h),c));F=D.some(R=>!R.isOccluded),T=D.map(R=>new Wr(R.x,R.y))}else F=!0;return{box:QK(T),allPointsOccluded:!F}}},PM=class{constructor(e,r,t,i){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?r:-r))):i&&t?1:0,this.placed=t}isHidden(){return this.opacity===0&&!this.placed}},Vm=class{constructor(e,r,t,i,a){this.text=new PM(e?e.text:null,r,t,a),this.icon=new PM(e?e.icon:null,r,i,a)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},IM=class{constructor(e,r,t){this.text=e,this.icon=r,this.skipFade=t}},SB=class{constructor(e,r,t,i,a){this.bucketInstanceId=e,this.featureIndex=r,this.sourceLayerIndex=t,this.bucketIndex=i,this.tileID=a}},EB=class{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let r=++this.maxGroupID;this.collisionGroups[e]={ID:r,predicate:t=>t.collisionGroupID===r}}return this.collisionGroups[e]}},kB=class{constructor(e,r,t,i,a){this.transform=e.clone(),this.terrain=r,this.collisionIndex=new MB(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new EB(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let r=this.terrain;if(r)return(t,i)=>r.getElevation(e,t,i)}getBucketParts(e,r,t,i){let a=t.getBucket(r),o=t.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;let s=t.collisionBoxArray,l=a.layers[0].layout,n=a.layers[0].paint,u=2**(this.transform.zoom-t.tileID.overscaledZ),c=t.tileSize/Bi,f=t.tileID.toUnwrapped(),h=l.get("text-rotation-alignment")==="map",d=Cf(t,1,this.transform.zoom),p=Op(this.collisionIndex.transform,t,n.get("text-translate"),n.get("text-translate-anchor")),g=Op(this.collisionIndex.transform,t,n.get("icon-translate"),n.get("icon-translate-anchor")),m=WA(h,this.transform,d);this.retainedQueryData[a.bucketInstanceId]=new SB(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,t.tileID);let y={bucket:a,layout:l,translationText:p,translationIcon:g,unwrappedTileID:f,pitchedLabelPlaneMatrix:m,scale:u,textPixelRatio:c,holdingForFade:t.holdingForSymbolFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:dx(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(let _ of a.sortKeyRanges){let{sortKey:v,symbolInstanceStart:x,symbolInstanceEnd:S}=_;e.push({sortKey:v,symbolInstanceStart:x,symbolInstanceEnd:S,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:y})}attemptAnchorPlacement(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S){var M,C,w;let k=Ib[e.textAnchor],A=[e.textOffset0,e.textOffset1],b=sz(k,t,i,A,a),E=this.collisionIndex.placeCollisionBox(r,f,l,n,u,s,o,g,c.predicate,_,b,v,x,S);if((!y||this.collisionIndex.placeCollisionBox(y,f,l,n,u,s,o,m,c.predicate,_,b,v,x,S).placeable)&&E.placeable){let T;if((M=this.prevPlacement)!=null&&M.variableOffsets[h.crossTileID]&&((w=(C=this.prevPlacement)==null?void 0:C.placements[h.crossTileID])!=null&&w.text)&&(T=this.prevPlacement.variableOffsets[h.crossTileID].anchor),h.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[h.crossTileID]={textOffset:A,width:t,height:i,anchor:k,textBoxScale:a,prevAnchor:T},this.markUsedJustification(d,k,h,p),d.allowVerticalPlacement&&(this.markUsedOrientation(d,p,h),this.placedOrientations[h.crossTileID]=p),{shift:b,placedGlyphBoxes:E}}}placeLayerBucketPart(e,r,t){let{bucket:i,layout:a,translationText:o,translationIcon:s,unwrappedTileID:l,pitchedLabelPlaneMatrix:n,textPixelRatio:u,holdingForFade:c,collisionBoxArray:f,partiallyEvaluatedTextSize:h,collisionGroup:d}=e.parameters,p=a.get("text-optional"),g=a.get("icon-optional"),m=gx(a,"text-overlap","text-allow-overlap"),y=m==="always",_=gx(a,"icon-overlap","icon-allow-overlap"),v=_==="always",x=a.get("text-rotation-alignment")==="map",S=a.get("text-pitch-alignment")==="map",M=a.get("icon-text-fit")!=="none",C=a.get("symbol-z-order")==="viewport-y",w=a.get("symbol-height-anchor")==="ground",k=y&&(v||!i.hasIconData()||g),A=v&&(y||!i.hasTextData()||p);!i.collisionArrays&&f&&i.deserializeCollisionBoxes(f);let b=this.retainedQueryData[i.bucketInstanceId].tileID,E=this._getTerrainElevationFunc(b),T=this.transform.getFastPathSimpleProjectionMatrix(b),F=(D,R,P)=>{var z,I;if(r[D.crossTileID])return;if(c){this.placements[D.crossTileID]=new IM(!1,!1,!1);return}let L=D.heightOffset,B=!1,O=!1,G=!0,W=null,X={box:null,placeable:!1,offscreen:null,occluded:!1},Z={box:null,placeable:!1,offscreen:null},J=null,N=null,H=null,$=0,U=0,V=0;R.textFeatureIndex?$=R.textFeatureIndex:D.useRuntimeCollisionCircles&&($=D.featureIndex),R.verticalTextFeatureIndex&&(U=R.verticalTextFeatureIndex);let j=R.textBox;if(j){let le=ye=>{let fe=1;if(i.allowVerticalPlacement&&!ye&&this.prevPlacement){let ae=this.prevPlacement.placedOrientations[D.crossTileID];ae&&(this.placedOrientations[D.crossTileID]=ae,fe=ae,this.markUsedOrientation(i,fe,D))}return fe},ce=(ye,fe)=>{if(i.allowVerticalPlacement&&D.numVerticalGlyphVertices>0&&R.verticalTextBox){for(let ae of i.writingModes)if(ae===2?(X=fe(),Z=X):X=ye(),X?.placeable)break}else X=ye()},pe=D.textAnchorOffsetStartIndex,xe=D.textAnchorOffsetEndIndex;if(xe===pe){let ye=(fe,ae)=>{let ee=this.collisionIndex.placeCollisionBox(fe,m,u,b,l,S,x,o,d.predicate,E,void 0,T,L,w);return ee?.placeable&&(this.markUsedOrientation(i,ae,D),this.placedOrientations[D.crossTileID]=ae),ee};ce(()=>ye(j,1),()=>{let fe=R.verticalTextBox;return i.allowVerticalPlacement&&D.numVerticalGlyphVertices>0&&fe?ye(fe,2):{box:null,offscreen:null}}),le(X?.placeable)}else{let ye=Ib[(I=(z=this.prevPlacement)==null?void 0:z.variableOffsets[D.crossTileID])==null?void 0:I.anchor],fe=(ee,ie,Q)=>{let ue=ee.x2-ee.x1,ge=ee.y2-ee.y1,Me=D.textBoxScale,Te=M&&_==="never"?ie:null,je=null,Ve=m==="never"?1:2,Ze="never";ye&&Ve++;for(let Ke=0;Kefe(j,R.iconBox,1),()=>{let ee=R.verticalTextBox,ie=X?.placeable;return i.allowVerticalPlacement&&!ie&&D.numVerticalGlyphVertices>0&&ee?fe(ee,R.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}}),X&&(B=X.placeable,G=X.offscreen);let ae=le(X?.placeable);if(!B&&this.prevPlacement){let ee=this.prevPlacement.variableOffsets[D.crossTileID];ee&&(this.variableOffsets[D.crossTileID]=ee,this.markUsedJustification(i,ee.anchor,D,ae))}}}if(J=X,B=J?.placeable,G=J?.offscreen,D.useRuntimeCollisionCircles&&D.centerJustifiedTextSymbolIndex>=0){let le=i.text.placedSymbolArray.get(D.centerJustifiedTextSymbolIndex),ce=G6(i.textSizeData,h,le),pe=a.get("text-padding"),xe=D.collisionCircleDiameter;N=this.collisionIndex.placeCollisionCircles(m,le,i.lineVertexArray,i.glyphOffsetArray,ce,l,n,t,S,d.predicate,xe,pe,o,E),N.circles.length&&N.collisionDetected&&!t&&To("Collisions detected, but collision boxes are not shown"),B=y||N.circles.length>0&&!N.collisionDetected,G&&(G=N.offscreen)}if(R.iconFeatureIndex&&(V=R.iconFeatureIndex),R.iconBox){let le=ce=>this.collisionIndex.placeCollisionBox(ce,_,u,b,l,S,x,s,d.predicate,E,M&&W?W:void 0,T,L,w);Z&&Z.placeable&&R.verticalIconBox?(H=le(R.verticalIconBox),O=H.placeable):(H=le(R.iconBox),O=H.placeable),G&&(G=H.offscreen)}let q=p||D.numHorizontalGlyphVertices===0&&D.numVerticalGlyphVertices===0,Y=g||D.numIconVertices===0;!q&&!Y?O=B=O&&B:Y?q||O&&(O=B):B=O&&B;let K=B&&J.placeable,te=O&&H.placeable;if(K&&(Z&&Z.placeable&&U?this.collisionIndex.insertCollisionBox(J.box,m,a.get("text-ignore-placement"),i.bucketInstanceId,U,d.ID):this.collisionIndex.insertCollisionBox(J.box,m,a.get("text-ignore-placement"),i.bucketInstanceId,$,d.ID)),te&&this.collisionIndex.insertCollisionBox(H.box,_,a.get("icon-ignore-placement"),i.bucketInstanceId,V,d.ID),N&&B&&this.collisionIndex.insertCollisionCircles(N.circles,m,a.get("text-ignore-placement"),i.bucketInstanceId,$,d.ID),t&&this.storeCollisionData(i.bucketInstanceId,P,R,J,H,N),D.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");if(i.bucketInstanceId===0)throw Error("bucket.bucketInstanceId can't be 0");let ne=(B||k)&&!J?.occluded,se=(O||A)&&!H?.occluded;this.placements[D.crossTileID]=new IM(ne,se,G||i.justReloaded),r[D.crossTileID]=!0};if(C){if(e.symbolInstanceStart!==0)throw Error("bucket.bucketInstanceId should be 0");let D=i.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let R=D.length-1;R>=0;--R){let P=D[R];F(i.symbolInstances.get(P),i.collisionArrays[P],P)}}else for(let D=e.symbolInstanceStart;D=0&&(o>=0&&l!==o?e.text.placedSymbolArray.get(l).crossTileID=0:e.text.placedSymbolArray.get(l).crossTileID=t.crossTileID)}markUsedOrientation(e,r,t){let i=r===1||r===3?r:0,a=r===2?r:0,o=[t.leftJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.rightJustifiedTextSymbolIndex];for(let s of o)e.text.placedSymbolArray.get(s).placedOrientation=i;t.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(t.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let r=this.prevPlacement,t=!1;this.prevZoomAdjustment=r?r.zoomAdjustment(this.transform.zoom):0;let i=r?r.symbolFadeChange(e):1,a=r?r.opacities:{},o=r?r.variableOffsets:{},s=r?r.placedOrientations:{};for(let l in this.placements){let n=this.placements[l],u=a[l];u?(this.opacities[l]=new Vm(u,i,n.text,n.icon),t||(t=n.text!==u.text.placed),t||(t=n.icon!==u.icon.placed)):(this.opacities[l]=new Vm(null,i,n.text,n.icon,n.skipFade),t||(t=n.text||n.icon))}for(let l in a){let n=a[l];if(!this.opacities[l]){let u=new Vm(n,i,!1,!1);u.isHidden()||(this.opacities[l]=u,t||(t=n.text.placed),t||(t=n.icon.placed))}}for(let l in o)!this.variableOffsets[l]&&this.opacities[l]&&!this.opacities[l].isHidden()&&(this.variableOffsets[l]=o[l]);for(let l in s)!this.placedOrientations[l]&&this.opacities[l]&&!this.opacities[l].isHidden()&&(this.placedOrientations[l]=s[l]);if(r&&r.lastPlacementChangeTime===void 0)throw Error("Last placement time for previous placement is not defined");t?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=r?r.lastPlacementChangeTime:e)}updateLayerOpacities(e,r){let t={};for(let i of r){let a=i.getBucket(e);a&&i.latestFeatureIndex&&e.id===a.layerIds[0]&&this.updateBucketOpacities(a,i.tileID,t,i.collisionBoxArray)}}updateBucketOpacities(e,r,t,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let a=e.layers[0],o=a.layout,s=new Vm(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),n=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),c=o.get("text-rotation-alignment")==="map",f=o.get("text-pitch-alignment")==="map",h=o.get("icon-text-fit")!=="none",d=new Vm(null,0,l&&(n||!e.hasIconData()||o.get("icon-optional")),n&&(l||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);let p=(m,y,_)=>{for(let v=0;v0||v>0,w=y.numIconVertices>0,k=this.placedOrientations[y.crossTileID],A=k===2,b=k===1||k===3;if(C){let T=uz(M.text),F=A?Gm:T;p(e.text,_,F);let D=b?Gm:T;p(e.text,v,D);let R=M.text.isHidden(),P=[y.rightJustifiedTextSymbolIndex,y.centerJustifiedTextSymbolIndex,y.leftJustifiedTextSymbolIndex];for(let L of P)L>=0&&(e.text.placedSymbolArray.get(L).hidden=R||A?1:0);y.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(y.verticalPlacedTextSymbolIndex).hidden=R||b?1:0);let z=this.variableOffsets[y.crossTileID];z&&this.markUsedJustification(e,z.anchor,y,k);let I=this.placedOrientations[y.crossTileID];I&&(this.markUsedJustification(e,"left",y,I),this.markUsedOrientation(e,I,y))}if(w){let T=uz(M.icon),F=!(h&&y.verticalPlacedIconSymbolIndex&&A);if(y.placedIconSymbolIndex>=0){let D=F?T:Gm;p(e.icon,y.numIconVertices,D),e.icon.placedSymbolArray.get(y.placedIconSymbolIndex).hidden=M.icon.isHidden()}if(y.verticalPlacedIconSymbolIndex>=0){let D=F?Gm:T;p(e.icon,y.numVerticalIconVertices,D),e.icon.placedSymbolArray.get(y.verticalPlacedIconSymbolIndex).hidden=M.icon.isHidden()}}let E=g?.has(m)?g.get(m):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let T=e.collisionArrays[m];if(T){let F=new Wr(0,0);if(T.textBox||T.verticalTextBox){let D=!0;if(u){let R=this.variableOffsets[x];R?(F=sz(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),c&&F._rotate(f?-this.transform.bearingInRadians:this.transform.bearingInRadians)):D=!1}if(T.textBox||T.verticalTextBox){let R;T.textBox&&(R=A),T.verticalTextBox&&(R=b),lz(e.textCollisionBox.collisionVertexArray,M.text.placed,!D||R,E.text,F.x,F.y)}}if(T.iconBox||T.verticalIconBox){let D=!(b||!T.verticalIconBox),R;T.iconBox&&(R=D),T.verticalIconBox&&(R=!D),lz(e.iconCollisionBox.collisionVertexArray,M.icon.placed,R,E.icon,h?F.x:0,h?F.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}},CB=2**25,DB=2**24,LB=2**17,FB=2**16,Gm=0,PB=class{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,r,t,i,a){let o=this._bucketParts;for(;this._currentTileIndexs.sortKey-l.sortKey));this._currentPartIndex!this._forceFullPlacement&&hs()-i>2;for(;this._currentPlacementIndex>=0;){let o=r[e[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if(AA(o)&&o.layout&&(!o.minzoom||o.minzoom<=s)&&(!o.maxzoom||o.maxzoom>s)){if(this._inProgressLayer||(this._inProgressLayer=new PB(o)),this._inProgressLayer.continuePlacement(t[o.source],this.placement,this._showCollisionBoxes,o,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}},RM=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],al=new Uint32Array(96),RB=class oU{static from(r){if(!r||r.byteLength===void 0||r.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[t,i]=new Uint8Array(r,0,2);if(t!==219)throw Error("Data does not appear to be in a KDBush format.");let a=i>>4;if(a!==1)throw Error(`Got v${a} data when expected v1.`);let o=RM[i&15];if(!o)throw Error("Unrecognized array type.");let[s]=new Uint16Array(r,2,1),[l]=new Uint32Array(r,4,1);return new oU(l,s,o,void 0,r)}constructor(r,t=64,i=Float64Array,a=ArrayBuffer,o){if(isNaN(r)||r<0)throw Error(`Unexpected numItems value: ${r}.`);this.numItems=+r,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;let s=RM.indexOf(this.ArrayType),l=r*2*this.ArrayType.BYTES_PER_ELEMENT,n=r*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-n%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,8,r),this.coords=new i(o,8+n+u,r*2),this._pos=r*2,this._finished=!0;else{let c=this.data=new a(8+l+n+u);this.ids=new this.IndexArrayType(c,8,r),this.coords=new i(c,8+n+u,r*2),this._pos=0,this._finished=!1,new Uint8Array(c,0,2).set([219,16+s]),new Uint16Array(c,2,1)[0]=t,new Uint32Array(c,4,1)[0]=r}}add(r,t){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=r,this.coords[this._pos++]=t,i}finish(){let r=this._pos>>1;if(r!==this.numItems)throw Error(`Added ${r} items when expected ${this.numItems}.`);return QA(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,t,i,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:l}=this;al[0]=0,al[1]=o.length-1,al[2]=0;let n=3,u=[];for(;n>0;){let c=al[--n],f=al[--n],h=al[--n];if(f-h<=l){for(let m=h;m<=f;m++){let y=s[2*m],_=s[2*m+1];y>=r&&y<=i&&_>=t&&_<=a&&u.push(o[m])}continue}let d=h+f>>1,p=s[2*d],g=s[2*d+1];p>=r&&p<=i&&g>=t&&g<=a&&u.push(o[d]),(c===0?r<=p:t<=g)&&(al[n++]=h,al[n++]=d-1,al[n++]=1-c),(c===0?i>=p:a>=g)&&(al[n++]=d+1,al[n++]=f,al[n++]=1-c)}return u}within(r,t,i){let a=[];return this.withinInto(r,t,i,a),a}withinInto(r,t,i,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:l}=this;al[0]=0,al[1]=o.length-1,al[2]=0;let n=3,u=0,c=i*i;for(;n>0;){let f=al[--n],h=al[--n],d=al[--n];if(h-d<=l){for(let y=d;y<=h;y++)fz(s[2*y],s[2*y+1],r,t)<=c&&(a[u++]=o[y]);continue}let p=d+h>>1,g=s[2*p],m=s[2*p+1];fz(g,m,r,t)<=c&&(a[u++]=o[p]),(f===0?r-i<=g:t-i<=m)&&(al[n++]=d,al[n++]=p-1,al[n++]=1-f),(f===0?r+i>=g:t+i>=m)&&(al[n++]=p+1,al[n++]=h,al[n++]=1-f)}return u}},Hm=512/Bi/2,zB=class{constructor(e,r,t){this.tileID=e,this.bucketInstanceId=t,this._symbolsByKey={};let i=new Map;for(let a=0;a({x:Math.floor(l.anchorX*Hm),y:Math.floor(l.anchorY*Hm)})),crossTileIDs:o.map(l=>l.crossTileID)};if(s.positions.length>128){let l=new RB(s.positions.length,16,Uint16Array);for(let{x:n,y:u}of s.positions)l.add(n,u);l.finish(),delete s.positions,s.index=l}this._symbolsByKey[a]=s}}getScaledCoordinates(e,r){let{x:t,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,n=l-a,u=Hm/2**n,c=(o*Bi+e.anchorX)*u,f=(s*Bi+e.anchorY)*u,h=t*Bi*Hm,d=i*Bi*Hm;return{x:Math.floor(c-h),y:Math.floor(f-d)}}findMatches(e,r,t){let i=this.tileID.canonical.ze)}},BB=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},OB=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let r=Math.round((e-this.lng)/360);if(r!==0)for(let t in this.indexes){let i=this.indexes[t],a={};for(let o in i){let s=i[o];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+r),a[s.tileID.key]=s}this.indexes[t]=a}this.lng=e}addBucket(e,r,t){var i,a,o;if((i=this.indexes[e.overscaledZ])!=null&&i[e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===r.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let l=0;le.overscaledZ)for(let u in n){let c=n[u];c.tileID.isChildOf(e)&&c.findMatches(r.symbolInstances,e,s)}else{let u=n[e.scaledTo(Number(l)).key];u&&u.findMatches(r.symbolInstances,e,s)}}for(let l=0;l{var d;return n.getProjectionData({overscaledTileID:new Cu(h.tileID.canonical.z,(d=h.tileID.wrap)!=null?d:0,h.tileID.canonical.z,h.tileID.canonical.x,h.tileID.canonical.y),aligned:h.aligned,applyGlobeMatrix:h.applyGlobeMatrix,applyTerrainMatrix:h.applyTerrainMatrix})}},f=s.renderingMode?s.renderingMode:"2d";if(i.currentPass==="offscreen"){let h=s.prerender;h&&(e.setCustomLayerDefaults(),o.setColorMode(e.colorModeForRenderPass()),h.call(s,o.gl,c),o.setDirty(),e.setBaseState())}else if(i.currentPass==="translucent"){e.setCustomLayerDefaults(),o.setColorMode(e.colorModeForRenderPass()),o.setStencilMode(es.disabled);let h=f==="3d"?e.getDepthModeFor3D():e.getDepthModeForSublayer(0,Lo.ReadOnly);o.setDepthMode(h),s.render(o.gl,c),o.setDirty(),e.setBaseState(),o.bindFramebuffer.set(null)}}function cse(e,r){let t=e.context,i=t.gl,a=e.transform,o=cl.unblended,s=new Lo(i.LEQUAL,Lo.ReadWrite,[0,1]),l=r.tileManager.getRenderableTiles(),n=e.useProgram("terrainDepth");t.bindFramebuffer.set(r.getFramebuffer().framebuffer),t.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),t.clear({color:ro.white,depth:1});for(let u of l){let c=r.getTerrainMesh(u.tileID),f=r.getTerrainData(u.tileID),h=a.getProjectionData({overscaledTileID:u.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),d=lO(r.getSkirtLength(a.zoom));n.draw(t,i.TRIANGLES,s,es.disabled,o,Ko.backCCW,d,f,h,"terrain",c.vertexBuffer,c.indexBuffer,c.segments)}t.bindFramebuffer.set(null),t.viewport.set([0,0,e.width,e.height])}function fse(e,r,t,i){let{isRenderingGlobe:a}=i,o=e.context,s=o.gl,l=e.transform,n=e.colorModeForRenderPass(),u=e.getDepthModeFor3D(),c=e.useProgram("terrain");o.bindFramebuffer.set(null),o.viewport.set([0,0,e.width,e.height]);for(let f of t){let h=r.getTerrainMesh(f.tileID),d=e.renderToTexture.getTexture(f),p=r.getTerrainData(f.tileID);o.activeTexture.set(s.TEXTURE0),d.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_LINEAR);let g=r.getSkirtLength(l.zoom),m=l.calculateFogMatrix(f.tileID.toUnwrapped()),y=sO(g,m,e.style.sky,l.pitch,a),_=l.getProjectionData({overscaledTileID:f.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});c.draw(o,s.TRIANGLES,u,es.disabled,n,Ko.backCCW,y,p,_,"terrain",h.vertexBuffer,h.indexBuffer,h.segments)}}function Uz(e,r){if(!r.mesh){let t=new lp;t.emplaceBack(-1,-1),t.emplaceBack(1,-1),t.emplaceBack(1,1),t.emplaceBack(-1,1);let i=new td;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),r.mesh=new qm(e.createVertexBuffer(t,a0.members),e.createIndexBuffer(i),Ks.simpleSegment(0,0,t.length,i.length))}return r.mesh}function hse(e,r){let t=e.context,i=t.gl,a=eN(r,e.transform,e.pixelRatio),o=new Lo(i.LEQUAL,Lo.ReadWrite,[0,1]),s=es.disabled,l=e.colorModeForRenderPass(),n=e.useProgram("sky"),u=Uz(t,r);n.draw(t,i.TRIANGLES,o,s,l,Ko.disabled,a,null,void 0,"sky",u.vertexBuffer,u.indexBuffer,u.segments)}function dse(e,r){let t=e.getCartesianPosition();OK(t,t);let i=$h(new Float64Array(16));return e.properties.get("anchor")==="map"&&(Bp(i,i,r.rollInRadians),Yv(i,i,-r.pitchInRadians),Bp(i,i,r.bearingInRadians),Yv(i,i,r.center.lat*Math.PI/180),c9(i,i,-r.center.lng*Math.PI/180)),NK(t,t,i),t}function pse(e,r,t){let i=e.context,a=i.gl,o=e.useProgram("atmosphere"),s=new Lo(a.LEQUAL,Lo.ReadOnly,[0,1]),l=e.transform,n=dse(t,e.transform),u=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),c=r.properties.get("atmosphere-blend")*u.projectionTransition;if(c===0)return;let f=jm(l.worldSize,l.center.lat),h=_z(l),d=JO(n,c,h,f,l.inverseProjectionMatrix),p=Uz(i,r);o.draw(i,a.TRIANGLES,s,es.disabled,cl.alphaBlended,Ko.disabled,d,null,null,"atmosphere",p.vertexBuffer,p.indexBuffer,p.segments)}function vse(e,r,t){var i;let a=(i=r?.transitionState)!=null?i:0;return{currentPass:"offscreen",currentLayer:0,opaquePassCutoff:1/0,depthRangeFor3D:[0,1],isRenderingToTexture:!1,transform:e,terrain:t,projectionTransition:a,isRenderingGlobe:a>0}}function qz(e,r){let t=!1,i=null,a,o=()=>{i=null,t&&(t=(e(...a),i=setTimeout(o,r),!1))};return(...s)=>(t=!0,a=s,i||o(),i)}function Gg(e,r){(!e.duration||e.duration({around:i,panDelta:i.sub(t)}),activateOnStart:!0,moveStateManager:new Xm({checkCorrectEvent:t=>t.button===0&&!t.ctrlKey}),enable:e,assignEvents:ay})}function _se({enable:e,clickTolerance:r,aroundCenter:t=!0,minPixelCenterThreshold:i=100,rotateSpeed:a=.8},o){return new Ym({clickTolerance:r,move:(s,l)=>{let n=o();if(t&&Math.abs(n.y-s.y)>i)return{bearingDelta:T9(new Wr(s.x,l.y),l,n)};let u=(l.x-s.x)*a;return t&&l.ys.button===0&&s.ctrlKey||s.button===2&&!s.ctrlKey}),enable:e,assignEvents:ay})}function xse({enable:e,clickTolerance:r,pitchSpeed:t=-.5}){return new Ym({clickTolerance:r,move:(i,a)=>({pitchDelta:(a.y-i.y)*t}),moveStateManager:new Xm({checkCorrectEvent:i=>i.button===0&&i.ctrlKey||i.button===2}),enable:e,assignEvents:ay})}function bse({enable:e,clickTolerance:r,rollDegreesPerPixelMoved:t=.3},i){return new Ym({clickTolerance:r,move:(a,o)=>{let s=i(),l=(o.x-a.x)*t;return o.ya.button===2&&a.ctrlKey}),enable:e,assignEvents:ay})}function u2(e,r,t){for(let i=0;iMath.abs(e.x)}function wse(e){return e*(2-e)}function dM(e){var r;return((r=e.panDelta)==null?void 0:r.mag())||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}function Tse(e=!1){return Xr(this,null,function*(){if(ov!==void 0&&!e)return ov;if(window.navigator.permissions===void 0)return ov=!!window.navigator.geolocation,ov;try{ov=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ov=!!window.navigator.geolocation}return ov})}function Hz(e,r,t,i=!1){if(i||!t.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let a=new An(e.lng,e.lat);if(e=new An(e.lng,e.lat),r){let o=new An(e.lng-360,e.lat),s=new An(e.lng+360,e.lat),l=t.locationToScreenPoint(e).distSqr(r);t.locationToScreenPoint(o).distSqr(r)180;){let o=t.locationToScreenPoint(e);if(o.x>=0&&o.y>=0&&o.x<=t.width&&o.y<=t.height)break;e.lng>t.center.lng?e.lng-=360:e.lng+=360}return e.lng!==a.lng&&t.isPointOnMapSurface(t.locationToScreenPoint(e))?e:a}function $z(e,r,t){let i=e.classList;for(let a in q2)i.remove(`maplibregl-${t}-anchor-${a}`);i.add(`maplibregl-${t}-anchor-${r}`)}function bh(e,r,t=[]){let i=$n.createNS("http://www.w3.org/2000/svg",e);for(let a in r)i.setAttributeNS(null,a,r[a]);for(let a of t)i.appendChild(a);return i}function Ase(){return DS||(DS=bh("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[bh("g",{"fill-rule":"nonzero"},[bh("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([e,r])=>bh("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:e,ry:r}))),bh("g",{fill:CS},[bh("path",{d:"M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"})]),bh("g",{opacity:"0.25",fill:"#000000"},[bh("path",{d:"M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"})]),bh("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),bh("g",{transform:"translate(8.0, 8.0)"},[bh("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),bh("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]),DS)}function Mse(e){return e.firstElementChild.children[1]}function Wz(e,r,t){let i=t?.maxWidth||100,a=e._container.clientHeight/2,o=e._container.clientWidth/2,s=e.unproject([o-i/2,a]),l=e.unproject([o+i/2,a]),n=Math.round(e.project(l).x-e.project(s).x),u=Math.min(i,n,e._container.clientWidth),c=s.distanceTo(l);if(t?.unit==="imperial"){let f=3.2808*c;f>5280?$g(r,u,f/5280,e._getUIString("ScaleControl.Miles")):$g(r,u,f,e._getUIString("ScaleControl.Feet"))}else t?.unit==="nautical"?$g(r,u,c/1852,e._getUIString("ScaleControl.NauticalMiles")):c>=1e3?$g(r,u,c/1e3,e._getUIString("ScaleControl.Kilometers")):$g(r,u,c,e._getUIString("ScaleControl.Meters"))}function $g(e,r,t,i){let a=Ese(t),o=a/t;e.style.width=`${r*o}px`,e.innerHTML=`${a} ${i}`}function Sse(e){let r=10**Math.ceil(-Math.log(e)/Math.LN10);return Math.round(e*r)/r}function Ese(e){let r=10**(`${Math.floor(e)}`.length-1),t=e/r;return t=t>=10?10:t>=5?5:t>=3?3:t>=2?2:t>=1?1:Sse(t),r*t}function Yz(e){if(!e)return Yz(new Wr(0,0));if(typeof e=="number"){let r=Math.round(Math.abs(e)/Math.SQRT2);return{center:new Wr(0,0),top:new Wr(0,e),"top-left":new Wr(r,r),"top-right":new Wr(-r,r),bottom:new Wr(0,-e),"bottom-left":new Wr(r,-r),"bottom-right":new Wr(-r,-r),left:new Wr(e,0),right:new Wr(-e,0)}}if(e instanceof Wr||Array.isArray(e)){let r=Wr.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:Wr.convert(e.center||[0,0]),top:Wr.convert(e.top||[0,0]),"top-left":Wr.convert(e["top-left"]||[0,0]),"top-right":Wr.convert(e["top-right"]||[0,0]),bottom:Wr.convert(e.bottom||[0,0]),"bottom-left":Wr.convert(e["bottom-left"]||[0,0]),"bottom-right":Wr.convert(e["bottom-right"]||[0,0]),left:Wr.convert(e.left||[0,0]),right:Wr.convert(e.right||[0,0])}}function kse(e){var r,t,i,a;return e?{top:(r=e.top)!=null?r:0,right:(t=e.right)!=null?t:0,bottom:(i=e.bottom)!=null?i:0,left:(a=e.left)!=null?a:0}:{top:0,right:0,bottom:0,left:0}}function Cse(e,r){return Ug().setRTLTextPlugin(e,r)}function Dse(){return Ug().getRTLTextPluginStatus()}function Lse(){return P8}function Fse(){return Xg.workerCount}function Pse(e){Xg.workerCount=e}function Ise(){return ff.MAX_PARALLEL_IMAGE_REQUESTS}function Rse(e){ff.MAX_PARALLEL_IMAGE_REQUESTS=e}function zse(){return ff.WORKER_URL}function Bse(e){ff.WORKER_URL=e}function Ose(e){return Xr(this,null,function*(){yield GA().broadcast("IS",e)})}var pM,vM,c2,f2,mM,yc,Wg,Xz,Ds,$n,rd,Zz,iu,kn,h2,Nf,Bs,df,Um,gM,d2,yM,_M,Yg,xM,Kz,Jz,p2,Qz,eB,tB,v2,m2,rB,iB,aB,nB,oB,sB,lB,uB,cB,fB,hB,g2,Xg,dB,Zg,bM,y2,wh,wM,TM,_2,AM,MM,rv,pB,vB,qm,a0,Kg,iv,SM,EM,kM,mB,CM,gB,yB,x2,_B,b2,DM,xB,w2,T2,bB,LM,Vm,A2,wB,FM,TB,AB,MB,PM,Gm,IM,SB,EB,kB,CB,DB,LB,FB,Hm,PB,IB,RM,al,RB,$m,zB,BB,OB,zM,NB,jB,UB,qB,VB,GB,HB,$B,BM,id,OM,NM,M2,S2,E2,WB,YB,XB,jM,ZB,UM,Jg,Qg,KB,JB,k2,qM,VM,C2,QB,D2,eO,GM,HM,$M,WM,YM,tO,L2,rO,iO,aO,nO,oO,sO,lO,ey,uO,F2,XM,av,ZM,ty,cO,fO,hO,KM,dO,pO,vO,mO,gO,JM,yO,_O,xO,bO,wO,TO,QM,AO,MO,eS,tS,SO,EO,kO,CO,DO,LO,FO,PO,IO,RO,zO,ry,BO,OO,NO,jO,UO,qO,VO,GO,HO,rS,iS,$O,WO,YO,XO,ZO,KO,JO,QO,eN,iy,tN,rN,aS,iN,os,aN,nN,oN,sN,lN,uN,cN,fN,hN,dN,pN,vN,mN,gN,yN,_N,xN,bN,wN,TN,AN,MN,SN,EN,kN,CN,DN,LN,FN,PN,IN,P2,RN,zN,BN,ON,nS,pf,cl,NN,Lo,I2,es,oS,R2,Ko,z2,jN,B2,O2,UN,qN,VN,GN,HN,$N,N2,WN,sS,lS,Wm,YN,XN,ZN,KN,JN,QN,e8,t8,uS,r8,j2,i8,Ym,a8,Xm,n8,o8,ay,s8,U2,cS,fS,hS,dS,l8,pS,vS,mS,gS,u8,c8,yS,_S,xS,bS,f8,ny,h8,d8,p8,wS,TS,AS,v8,MS,m8,nv,g8,y8,_8,SS,ES,x8,b8,w8,ov,q2,kS,CS,DS,n0,LS,V2,T8,oy,Zm,o0,G2,FS,A8,M8,S8,H2,E8,k8,C8,D8,L8,$2,F8,P8,Nse=Ir({"node_modules/maplibre-gl/dist/maplibre-gl.mjs"(){qae(),pM={},vM="6.9.0",yc={frame(e,r,t,i){let a=i||window,o=a.requestAnimationFrame(l=>{s(),r(l)}),{unsubscribe:s}=W4(e.signal,"abort",()=>{s(),a.cancelAnimationFrame(o),t(new mm(e.signal.reason))},!1)},frameAsync(e,r){return new Promise((t,i)=>{this.frame(e,t,i,r)})},getImageData(e,r=0){return this.getImageCanvasContext(e).getImageData(-r,-r,e.width+2*r,e.height+2*r)},getImageCanvasContext(e){let r;if(B4()&&!l9())r=new OffscreenCanvas(e.width,e.height).getContext("2d",{willReadFrequently:!0});else{let t=window.document.createElement("canvas");t.width=e.width,t.height=e.height,r=t.getContext("2d",{willReadFrequently:!0})}if(!r)throw Error("failed to create canvas 2d context");return r.drawImage(e,0,0,e.width,e.height),r},resolveURL(e){return c2||(c2=document.createElement("a")),c2.href=e,c2.href},get hardwareConcurrency(){return typeof navigator<"u"&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return mM===void 0?matchMedia?(f2??(f2=matchMedia("(prefers-reduced-motion: reduce)")),f2.matches):!1:mM},set prefersReducedMotion(e){mM=e}},Wg=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt===null?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}},$n=(Ds=class{static create(e,r,t){let i=window.document.createElement(e);return r!==void 0&&(i.className=r),t&&t.appendChild(i),i}static createNS(e,r){return window.document.createElementNS(e,r)}static disableDrag(){Ds.docStyle&&Ds.selectProp&&(Ds.userSelect=Ds.docStyle[Ds.selectProp],Ds.docStyle[Ds.selectProp]="none")}static enableDrag(){Ds.docStyle&&Ds.selectProp&&(Ds.docStyle[Ds.selectProp]=Ds.userSelect)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",Ds.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Ds.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",Ds.suppressClickInternal,!0)},0)}static getScale(e){let r=e.getBoundingClientRect();return{x:r.width/e.offsetWidth||1,y:r.height/e.offsetHeight||1,boundingClientRect:r}}static getPoint(e,r,t){let i=r.boundingClientRect;return new Wr((t.clientX-i.left)/r.x-e.clientLeft,(t.clientY-i.top)/r.y-e.clientTop)}static mousePos(e,r){let t=Ds.getScale(e);return Ds.getPoint(e,t,r)}static touchPos(e,r){let t=[],i=Ds.getScale(e);for(let a of r)t.push(Ds.getPoint(e,i,a));return t}static sanitize(e){let r=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body"),t=r.querySelectorAll("script, iframe");for(let i of t)i.remove();return Ds.clean(r),r.innerHTML}static isPossiblyDangerous(e,r){let t=r.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(e)&&(t.includes("javascript:")||t.includes("data:"))||e==="srcdoc"||e.startsWith("on"))return!0}static clean(e){let r=e.children;for(let t of r)Ds.removeAttributes(t),Ds.clean(t)}static removeAttributes(e){for(let{name:r,value:t}of Array.from(e.attributes))Ds.isPossiblyDangerous(r,t)&&e.removeAttribute(r)}},Ds.docStyle=typeof window<"u"&&((Xz=window.document)==null?void 0:Xz.documentElement.style),Ds.selectProp=!Ds.docStyle||"userSelect"in Ds.docStyle?"userSelect":"webkitUserSelect",Ds),(function(e){let r,t,i,a;e.resetRequestQueue=()=>{r=[],t=0,i=0,a={}},e.addThrottleControl=f=>{let h=i++;return a[h]=f,h},e.removeThrottleControl=f=>{delete a[f],u()};let o=()=>{for(let f of Object.keys(a))if(a[f]())return!0;return!1};function s(f,h,d,p,g=!0,m){return Xr(this,null,function*(){let y=yield f.transformRequest(h,d);return Y4(p.signal),rd.getImage(y,p,g,m)})}e.transformAndGetImage=s,e.getImage=(f,h,d=!0,p)=>new Promise((g,m)=>{f.headers||(f.headers={}),f.headers.accept="image/webp,*/*",yn(f,{type:"image"});let y={abortController:h,requestParameters:f,supportImageRefresh:d,imageBitmapOptions:p,state:"queued",onError:_=>{m(_)},onSuccess:_=>{g(_)}};r.push(y),u()});let l=(f,h)=>typeof createImageBitmap=="function"?TP(f,h):AP(f),n=f=>Xr(null,null,function*(){f.state="running";let{requestParameters:h,supportImageRefresh:d,imageBitmapOptions:p,onError:g,onSuccess:m,abortController:y}=f,_=d===!1&&!p&&!Kv(self)&&!M9(h.url)&&(!h.headers||Object.keys(h.headers).reduce((x,S)=>x&&S==="accept",!0));t++;let v=_?c(h,y):vg(h,y);try{let x=yield v;delete f.abortController,f.state="completed",x.data instanceof HTMLImageElement||I0(x.data)?m(x):!x.data||x.data.byteLength===0?m({data:null,cacheControl:x.cacheControl,expires:x.expires}):m({data:yield l(x.data,p),cacheControl:x.cacheControl,expires:x.expires})}catch(x){delete f.abortController,g(Zu(x))}finally{t--,u()}}),u=()=>{let f=o()?ff.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:ff.MAX_PARALLEL_IMAGE_REQUESTS;for(let h=t;h0;h++){let d=r.shift();if(d.abortController.signal.aborted){h--;continue}n(d)}},c=(f,h)=>new Promise((d,p)=>{let g=new Image,m=f.url,y=f.credentials;y&&y==="include"?g.crossOrigin="use-credentials":(y&&y==="same-origin"||!S9(m))&&(g.crossOrigin="anonymous"),h.signal.addEventListener("abort",()=>{g.src="",p(new mm(h.signal.reason))}),g.fetchPriority="high",g.onload=()=>{g.onerror=g.onload=null,d({data:g})},g.onerror=()=>{g.onerror=g.onload=null,!h.signal.aborted&&p(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."))},g.src=m})})(rd||(rd={})),rd.resetRequestQueue(),Zz=class{constructor(e){this._transformRequestFn=e??null}transformRequest(e,r){return this._transformRequestFn&&this._transformRequestFn(e,r)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}},iu=class extends hf{},kn=class extends iu{},h2=class extends iu{constructor(e={}){super("style.load",e)}},Nf=class extends iu{constructor(e,r={}){super(e,r),this.dataType="style"}},Bs=class extends iu{constructor(e,r={}){super(e,r),this.dataType="source"}},df=class extends iu{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,t,i={}){t=t instanceof MouseEvent?t:new MouseEvent(e,t);let a=$n.mousePos(r.getCanvas(),t),o=r.unproject(a);super(e,yn({point:a,lngLat:o,originalEvent:t},i)),this._defaultPrevented=!1,this.target=r}},Um=class extends iu{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,t){let i=e==="touchend"?t.changedTouches:t.touches,a=$n.touchPos(r.getCanvasContainer(),i),o=a.map(n=>r.unproject(n)),s=a.reduce((n,u,c,f)=>n.add(u.div(f.length)),new Wr(0,0)),l=r.unproject(s);super(e,{points:a,point:s,lngLats:o,lngLat:l,originalEvent:t}),this._defaultPrevented=!1}},gM=class extends iu{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r){super("wheel",{originalEvent:r}),this._defaultPrevented=!1}},d2=class extends iu{},yM=class extends iu{constructor(e={}){super("terrain",e)}},_M=class extends iu{constructor(e={}){super("projectiontransition",e)}},Yg=class extends iu{},xM=class extends iu{constructor(e={}){super("styleimagemissing",e)}},Kz=class extends Nl{constructor(){super(),this.images={},this.updateVersion=0,this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this._spriteImagesIds={},this._imagesIds=null,this._renderCallbacksDispatchedThisFrame={}}destroy(){for(let e of Object.keys(this.images))this.removeImage(e);this._spriteImagesIds={}}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:r,promiseResolve:t}of this.requestors)t(this._getImagesForIds(r));this.requestors=[]}}getImage(e){let r=this.images[e];if(r&&!r.data&&r.spriteData){let t=r.spriteData;r.data=new zs({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),r.spriteData=null}return r}addImage(e,r){if(this.images[e])throw Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,r)&&(this.images[e]=r,this._imagesIds=null,r.isWebGLImage&&this.updateImage(e,r,!1))}_validate(e,r){let t=!0,i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i?.width)||(this.fire(new Ln(Error(`Image "${e}" has invalid "stretchX" value`))),t=!1),this._validateStretch(r.stretchY,i?.height)||(this.fire(new Ln(Error(`Image "${e}" has invalid "stretchY" value`))),t=!1),this._validateContent(r.content,r)||(this.fire(new Ln(Error(`Image "${e}" has invalid "content" value`))),t=!1),t}_validateStretch(e,r){if(!e)return!0;let t=0;for(let i of e){if(i[0]=e[1]}updateImage(e,r,t=!0){var i;let a=this.images[e];if(t){let o=a.data||a.spriteData;if(o.width!==r.data.width||o.height!==r.data.height)throw Error(`size mismatch between old image (${o.width}x${o.height}) and new image (${r.data.width}x${r.data.height}).`)}r.version=((i=a.version)!=null?i:0)+1,this.images[e]=r,this.updateVersion++}removeImage(e){var r;let t=this.images[e];t&&(delete this.images[e],this._imagesIds=null,(r=t.userImage)!=null&&r.onRemove&&t.userImage.onRemove())}listImages(){var e;return(e=this._imagesIds)!=null||(this._imagesIds=Object.keys(this.images)),this._imagesIds}_getSpriteImageId(e,r){return e==="default"?r:`${e}:${r}`}setSpriteImages(e,r){var t;let i=(t=this._spriteImagesIds[e])!=null?t:[],a=[];for(let l in r){let n=this._getSpriteImageId(e,l);a.push(n),n in this.images?this.updateImage(n,r[l],!1):this.addImage(n,r[l])}let o=new Set(a),s=i.filter(l=>!o.has(l));for(let l of s)this.removeImage(l);return this._spriteImagesIds[e]=a,{loaded:a,removed:s}}removeSpriteImages(e){var r;let t=(r=this._spriteImagesIds[e])!=null?r:[];for(let i of t)this.removeImage(i);return delete this._spriteImagesIds[e],t}removeAllSpriteImages(){let e=Object.values(this._spriteImagesIds).flat();for(let r of e)this.removeImage(r);return this._spriteImagesIds={},e}setMissingImageResolver(e){this.missingImageResolver=e}getImages(e){return new Promise((r,t)=>{let i=!0;if(!this.isLoaded())for(let a of e)this.images[a]||(i=!1);this.isLoaded()||i?r(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:r})})}_getImagesForIds(e){return Xr(this,null,function*(){var r;let t=new Set(e.filter(o=>!this.getImage(o))),i=this.missingImageResolver;i&&(yield Promise.allSettled(Array.from(t,o=>i(o))));let a={};for(let o of e){let s=this.getImage(o);s&&(t.delete(o),a[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,textFitWidth:s.textFitWidth,textFitHeight:s.textFitHeight,hasRenderCallback:!!((r=s.userImage)!=null&&r.render),isWebGLImage:s.isWebGLImage})}for(let o of t)this.fire(new xM({id:o})),To(`Image "${o}" could not be loaded. Please make sure you have added the image before it is needed with map.addImage(), resolved it with map.setMissingStyleImageResolver(), or included it in a "sprite" property in your style.`);return a})}beginFrame(){this._renderCallbacksDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let r of e){if(this._renderCallbacksDispatchedThisFrame[r])continue;this._renderCallbacksDispatchedThisFrame[r]=!0;let t=this.getImage(r);t||To(`Image with ID: "${r}" was not found`),Dte(t)&&this.updateImage(r,t)}}cloneImages(){let e={};for(let r in this.images){let t=this.images[r];e[r]=ar(Nt({},t),{data:t.data?t.data.clone():null})}return e}},Jz=class{constructor(e){this._imageManager=e,this._entries={},this._image=new zs({width:1,height:1}),this._dirty=!0}destroy(){this._texture&&(this._texture=(this._texture.destroy(),null)),this._entries={},this._image=new zs({width:1,height:1}),this._dirty=!0}getPixelSize(){let{width:e,height:r}=this._image;return{width:e,height:r}}getPattern(e){let r=this._imageManager.getImage(e);if(!r)return null;let t=this._entries[e];if(t?.image!==r){let i={w:r.data.width+2,h:r.data.height+2,x:0,y:0};this._entries[e]={bin:i,position:new Pb(i,r),image:r}}else if(t.position.version!==r.version)t.position.version=r.version;else return t.position;return this._update(),this._entries[e].position}bind(e){let r=e.gl;this._texture?this._dirty&&(this._dirty=(this._texture.update(this._image),!1)):(this._texture=new jl(e,this._image,r.RGBA),this._dirty=!1),this._texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}_update(){for(let a in this._entries)this._imageManager.getImage(a)||delete this._entries[a];let e=[];for(let a in this._entries)e.push(this._entries[a].bin);let{w:r,h:t}=mF(e),i=this._image;i.resize({width:r||1,height:t||1});for(let a in this._entries){let{bin:o}=this._entries[a],s=o.x+1,l=o.y+1,n=this._entries[a].image.data,u=n.width,c=n.height;zs.copy(n,i,{x:0,y:0},{x:s,y:l},{width:u,height:c}),zs.copy(n,i,{x:0,y:c-1},{x:s,y:l-1},{width:u,height:1}),zs.copy(n,i,{x:0,y:0},{x:s,y:l+c},{width:u,height:1}),zs.copy(n,i,{x:u-1,y:0},{x:s-1,y:l},{width:1,height:c}),zs.copy(n,i,{x:0,y:0},{x:s+u,y:l},{width:1,height:c})}this._dirty=!0}},p2=1114111,Qz={start:0,end:p2},eB=0,tB=class{constructor(e){this.requestManager=e,this._faces={},this._registered=new Set}setFontFaces(e){this._unregisterAll(),this._faces={};for(let[r,t]of Object.entries(e??{})){let i=Array.isArray(t)?t:[t];this._faces[r]=i.map(a=>this._declareFontFace(r,a)).filter(a=>a!==null)}}hasFontFaces(){return Object.keys(this._faces).length>0}getFontFamily(e,r){return Xr(this,null,function*(){var t,i;for(let a of e.split(","))for(let o of(t=this._faces[a.trim()])!=null?t:[])if(nne(o,r)&&((i=o.loaded)!=null||(o.loaded=this._loadFontFace(o)),yield o.loaded))return o.family;return null})}_declareFontFace(e,r){let t=typeof r=="string"?{url:r}:r;if(typeof t?.url!="string")return To(`Ignoring the font face declared for "${e}": it has no URL.`),null;let i=`maplibre-gl-font-face-${eB++}`,a=t["unicode-range"];if(!a?.length)return{url:t.url,ranges:[Qz],family:i};let o=[];for(let s of a){let l=ane(s);if(!l){To(`Ignoring the unicode range "${s}" of the font face at ${t.url}: it is not a valid range.`);continue}o.push(l)}return o.length?{url:t.url,ranges:o,family:i}:null}_loadFontFace(e){return Xr(this,null,function*(){if(typeof FontFace>"u"||typeof document>"u"||!document.fonts)return To(`Ignoring the font face at ${e.url}: this environment has no CSS Font Loading API.`),!1;let r;try{return r=new FontFace(e.family,yield this._downloadFontFile(e.url)),Object.values(this._faces).some(t=>t.includes(e))?(document.fonts.add(r),this._registered.add(r),yield r.load(),!0):!1}catch(t){return r&&this._unregister(r),To(`Ignoring the font face at ${e.url}: ${Zu(t).message}`),!1}})}_downloadFontFile(e){return Xr(this,null,function*(){let r=yield this.requestManager.transformRequest(e,"Glyphs"),t=yield dT(r,new AbortController);if(!t?.data)throw Error(`the response was empty for the font file at ${e}`);return t.data})}_unregister(e){var r;(r=document.fonts)==null||r.delete(e),this._registered.delete(e)}_unregisterAll(){var e;for(let r of this._registered)(e=document.fonts)==null||e.delete(r);this._registered.clear()}destroy(){this._unregisterAll(),this._faces={}}},v2=1e20,m2=new Float64Array(256);for(let e=0;e<256;e++){let r=.5-(e/255)**.45454545454545453;m2[e]=r*Math.abs(r)}m2[255]=-1e20,rB=class{constructor({fontSize:e=24,buffer:r=3,radius:t=8,cutoff:i=.25,fontFamily:a="sans-serif",fontWeight:o="normal",fontStyle:s="normal",lang:l=null}={}){this.buffer=r,this.radius=t,this.cutoff=i,this.lang=l;let n=this.size=e+r*4,u=this._createCanvas(n),c=this.ctx=u.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${o} ${e}px ${a}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(n*n),this.gridInner=new Float64Array(n*n),this.f=new Float64Array(n),this.z=new Float64Array(n+1),this.v=new Uint16Array(n)}_createCanvas(e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(e,e);let r=document.createElement("canvas");return r.width=r.height=e,r}draw(e){let{width:r,actualBoundingBoxAscent:t,actualBoundingBoxDescent:i,actualBoundingBoxLeft:a,actualBoundingBoxRight:o}=this.ctx.measureText(e),s=Math.ceil(t),l=Math.floor(-a),n=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o)-l)),u=Math.max(0,Math.min(this.size-this.buffer,s+Math.ceil(i))),c=n+2*this.buffer,f=u+2*this.buffer,h=Math.max(c*f,0),d=new Uint8ClampedArray(h),p={data:d,width:c,height:f,glyphWidth:n,glyphHeight:u,glyphTop:s,glyphLeft:l,glyphAdvance:r};if(n===0||u===0)return p;let{ctx:g,buffer:m,gridInner:y,gridOuter:_}=this;this.lang&&(g.lang=this.lang),g.clearRect(m,m,n,u),g.fillText(e,m-l,m+s);let v=g.getImageData(m,m,n,u);_.fill(v2,0,h),y.fill(0,0,h);let x=3;for(let w=0;w{let t=new rB(e);return t.buffer=r,t},nB=class{constructor(e,r,t,i=aB){this.requestManager=e,this.localIdeographFontFamily=r,this.entries={},this.lang=t,this.fontFaceManager=new tB(e),this.createRasterizer=i}setURL(e){this.url=e}setFontFaces(e){this.fontFaceManager.setFontFaces(e),this.entries={}}getGlyphs(e){return Xr(this,null,function*(){let r=[];for(let a in e)for(let o of e[a])r.push(this._getAndCacheGlyphsPromise(a,o));let t=yield Promise.all(r),i={};for(let{stack:a,id:o,glyph:s}of t)i[a]||(i[a]={}),i[a][o]=s&&{id:s.id,bitmap:s.bitmap.clone(),metrics:s.metrics};return i})}_getAndCacheGlyphsPromise(e,r){return Xr(this,null,function*(){var t,i;(i=(t=this.entries)[e])!=null||(t[e]={glyphs:{},requests:{},ranges:{}});let a=this.entries[e],o=a.glyphs[r];if(o!==void 0)return{stack:e,id:r,glyph:o};let s=r.codePointAt(0),l=this.fontFaceManager.hasFontFaces()?yield this.fontFaceManager.getFontFamily(e,s):null;return l?(o=a.glyphs[r]=yield this._drawGlyph(a,e,r,l),{stack:e,id:r,glyph:o}):!this.url||lx(r)||this._charUsesLocalIdeographFontFamily(s)?(o=a.glyphs[r]=yield this._drawGlyph(a,e,r),{stack:e,id:r,glyph:o}):yield this._downloadAndCacheRangePromise(e,r)})}_downloadAndCacheRangePromise(e,r){return Xr(this,null,function*(){var t;let i=r.codePointAt(0),a=this.entries[e],o=Math.floor(i/256);if(a.ranges[o])return{stack:e,id:r,glyph:null};(t=a.requests)[o]||(t[o]=this._loadGlyphRange(e,o));try{let s=yield a.requests[o];for(let l in s)a.glyphs[String.fromCodePoint(+l)]=s[+l];return a.ranges[o]=!0,{stack:e,id:r,glyph:s[i]||null}}catch(s){let l=a.glyphs[r]=yield this._drawGlyph(a,e,r);return this._warnOnMissingGlyphRange(l,o,i,Zu(s)),{stack:e,id:r,glyph:l}}})}_loadGlyphRange(e,r){return Xr(this,null,function*(){let t=r*256,i=t+255,a=yield this.requestManager.transformRequest(this.url.replace("{fontstack}",e).replace("{range}",`${t}-${i}`),"Glyphs"),o=yield dT(a,new AbortController);if(!o?.data)throw Error(`Could not load glyph range. range: ${r}, ${t}-${i}`);let s={};for(let l of Cte(o.data))s[l.id]=l;return s})}_warnOnMissingGlyphRange(e,r,t,i){let a=r*256,o=a+255,s=t.toString(16).padStart(4,"0").toUpperCase();To(`Unable to load glyph range ${r}, ${a}-${o}. Rendering codepoint U+${s} locally instead. ${i}`)}_charUsesLocalIdeographFontFamily(e){return!!this.localIdeographFontFamily&&Vee(e)}_drawGlyph(e,r,t,i){return Xr(this,null,function*(){let a=(yield this._getTinySDF(e,r,t,i)).draw(t),o=new RegExp("^\\p{gc=Cf}+$","u").test(t);return{id:t.codePointAt(0),bitmap:new vb({width:a.width||60,height:a.height||60},a.data),metrics:{width:o?0:a.glyphWidth/2||24,height:a.glyphHeight/2||24,left:a.glyphLeft/2+.5||0,top:a.glyphTop/2-27.5||-8,advance:o?0:a.glyphAdvance/2||24,isDoubleResolution:!0}}})}_getTinySDF(e,r,t,i){var a,o,s,l;let n=lx(t);if(i){let h=n?"clusterTinySDFs":"fontFaceTinySDFs";return(a=e[h])!=null||(e[h]={}),(o=e[h])[i]||(o[i]=this._createTinySDF(i,!1,n?3:1)),e[h][i]}let u=r===iB&&this.localIdeographFontFamily!==""&&this._charUsesLocalIdeographFontFamily(t.codePointAt(0)),c=u?this.localIdeographFontFamily:r;if(n)return(s=e.clusterTinySDFs)!=null||(e.clusterTinySDFs={}),(l=e.clusterTinySDFs)[c]||(l[c]=this._createTinySDF(c,!0,3)),e.clusterTinySDFs[c];let f=u?"ideographTinySDF":"tinySDF";return e[f]||(e[f]=this._createTinySDF(c)),e[f]}_createTinySDF(e,r=!0,t=1){return Xr(this,null,function*(){var i;let a=e?e.split(","):[];a.push("sans-serif");let o=a.map(n=>/[-\w]+/.test(n)?n:`'${CSS.escape(n)}'`).join(","),s=r?this._fontWeight(a[0]):void 0,l=r?this._fontStyle(a[0]):"normal";if(typeof document<"u"&&((i=document.fonts)!=null&&i.load))try{yield document.fonts.load(`${l} ${s||"normal"} 48px ${o}`)}catch(n){To(`Failed to load font "${o}": ${Zu(n).message}`)}return this.createRasterizer({fontSize:48,buffer:Math.max(6,Math.ceil(48*(t-1)/4)),radius:16,cutoff:.25,fontFamily:o,fontWeight:s,fontStyle:l,lang:this.lang},6)})}_fontStyle(e){return/italic/i.test(e)?"italic":/oblique/i.test(e)?"oblique":"normal"}_fontWeight(e){let r={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950},t;for(let[i,a]of Object.entries(r))RegExp(`\\b${i}\\b`,"i").test(e)&&(t=`${a}`);return t}destroy(){for(let e in this.entries){let r=this.entries[e];r.tinySDF=null,r.ideographTinySDF=null,r.fontFaceTinySDFs={},r.glyphs={},r.requests={},r.ranges={}}this.entries={},this.fontFaceManager.destroy()}},sB=()=>oB||(oB=new vu({anchor:new Ha(mi.light.anchor,"anchor"),position:new Ha(mi.light.position,"position"),color:new Ha(mi.light.color,"color"),intensity:new Ha(mi.light.intensity,"intensity")})),lB=class extends Nl{constructor(e,r){super(),this._transitionable=new Mg(sB(),"light",r),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}getCartesianPosition(){return nJ(this.properties.get("position"))}setLight(e,r={}){if(!this._validate(Hc.light,e,r))for(let t in e){let i=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-Ux.length),i):this._transitionable.setValue(t,i)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,t){return eg(this,e,{value:r},t)}},cB=()=>uB||(uB=new vu({"sky-color":new Ha(mi.sky["sky-color"],"sky-color"),"horizon-color":new Ha(mi.sky["horizon-color"],"horizon-color"),"fog-color":new Ha(mi.sky["fog-color"],"fog-color"),"fog-ground-blend":new Ha(mi.sky["fog-ground-blend"],"fog-ground-blend"),"horizon-fog-blend":new Ha(mi.sky["horizon-fog-blend"],"horizon-fog-blend"),"sky-horizon-blend":new Ha(mi.sky["sky-horizon-blend"],"sky-horizon-blend"),"atmosphere-blend":new Ha(mi.sky["atmosphere-blend"],"atmosphere-blend")})),fB=class extends Nl{constructor(e,r){super(),this._transitionable=new Mg(cB(),"sky",r),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new ns(0))}setSky(e,r={}){if(!this._validate(Hc.sky,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let t in e){let i=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-Ux.length),i):this._transitionable.setValue(t,i)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,t={}){return eg(this,e,{value:r},t)}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}},hB=class{constructor(e,r){this.width=e,this.height=r,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,r){var t;let i=e.join(",")+String(r);return(t=this.dashEntry)[i]||(t[i]=this.addDash(e,r)),this.dashEntry[i]}getDashRanges(e,r,t){let i=e.length%2==1,a=[],o=i?-e[e.length-1]*t:0,s=e[0]*t,l=!0;a.push({left:o,right:s,isDash:l,zeroLength:e[0]===0});let n=e[0];for(let u=1;u1&&(n=e[++l]);let c=Math.abs(u-n.left),f=Math.abs(u-n.right),h=Math.min(c,f),d,p=a/t*(i+1);if(n.isDash){let g=i-Math.abs(p);d=Math.sqrt(h*h+g*g)}else d=i-Math.sqrt(h*h+p*p);this.data[s+u]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e){for(let s=e.length-1;s>=0;--s){let l=e[s],n=e[s+1];l.zeroLength?e.splice(s,1):n?.isDash===l.isDash&&(n.left=l.left,e.splice(s,1))}let r=e[0],t=e[e.length-1];r.isDash===t.isDash&&(r.left=t.left-this.width,t.right=r.right+this.width);let i=this.width*this.nextRow,a=0,o=e[a];for(let s=0;s1&&(o=e[++a]);let l=Math.abs(s-o.left),n=Math.abs(s-o.right),u=Math.min(l,n),c=o.isDash?u:-u;this.data[i+s]=Math.max(0,Math.min(255,c+128))}}addDash(e,r){let t=r?7:0,i=2*t+1;if(this.nextRow+i>this.height)return To("LineAtlas out of space"),null;let a=0;for(let s of e)a+=s;if(a!==0){let s=this.width/a,l=this.getDashRanges(e,this.width,s);r?this.addRoundDash(l,s,t):this.addRegularDash(l)}let o={y:this.nextRow+t,height:2*t,width:a};return this.nextRow+=i,this.dirty=!0,o}bind(e){let r=e.gl;this.texture?(r.bindTexture(r.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,r.texSubImage2D(r.TEXTURE_2D,0,0,0,this.width,this.height,r.ALPHA,r.UNSIGNED_BYTE,this.data))):(this.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,this.width,this.height,0,r.ALPHA,r.UNSIGNED_BYTE,this.data))}},g2="maplibre_preloaded_worker_pool",Xg=class iU{constructor(){this.active={},this.workersPromise=null}acquire(r){return Xr(this,null,function*(){if(this.active[r]=!0,!this.workersPromise){let t=[];for(;t.length{for(let a of i)a.terminate()})}}isPreloaded(){return!!this.active[g2]}numActive(){return Object.keys(this.active).length}},dB=Math.floor(yc.hardwareConcurrency/2),Xg.workerCount=sJ(globalThis)?Math.max(Math.min(dB,3),1):1,bM=class{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r,this.removed=!1,this.actorsPromise=this.initActors(r)}initActors(e){return Xr(this,null,function*(){let r=yield this.workerPool.acquire(e);if(this.removed)return[];if(this.actors=r.map((t,i)=>{let a=new l5(t,e);return a.name=`Worker ${i}`,a}),!this.actors.length)throw Error("No actors found");return this.actors})}broadcast(e,r){return Xr(this,null,function*(){let t=yield this.actorsPromise;return Promise.all(t.map(i=>i.sendAsync({type:e,data:r})))})}getActor(){return Xr(this,null,function*(){let e=yield this.actorsPromise;return this.currentActor=(this.currentActor+1)%e.length,e[this.currentActor]})}waitForInitComplete(){return Xr(this,null,function*(){this.actors.length===0&&(yield this.actorsPromise)})}getReadyActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.removed=!0;for(let r of this.actors)r.remove();this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,r){return Xr(this,null,function*(){let t=yield this.actorsPromise;for(let i of t)i.registerMessageHandler(e,r)})}unregisterMessageHandler(e){return Xr(this,null,function*(){let r=yield this.actorsPromise;for(let t of r)t.unregisterMessageHandler(e)})}},wh=class wp{constructor(r,t){r&&(t?this.setSouthWest(r).setNorthEast(t):Array.isArray(r)&&(r.length===4?this.setSouthWest([r[0],r[1]]).setNorthEast([r[2],r[3]]):this.setSouthWest(r[0]).setNorthEast(r[1])))}setNorthEast(r){return this._ne=r instanceof An?new An(r.lng,r.lat):An.convert(r),this}setSouthWest(r){return this._sw=r instanceof An?new An(r.lng,r.lat):An.convert(r),this}extend(r){let t=this._sw,i=this._ne,a,o;if(r instanceof An)a=r,o=r;else if(r instanceof wp){if(a=r._sw,o=r._ne,!a||!o)return this}else{if(Array.isArray(r)){if(r.length===4||r.every(Array.isArray)){let s=r;return this.extend(wp.convert(s))}{let s=r;return this.extend(An.convert(s))}}return r&&("lng"in r||"lon"in r)&&"lat"in r?this.extend(An.convert(r)):this}return!t&&!i?(this._sw=new An(a.lng,a.lat),this._ne=new An(o.lng,o.lat)):(t.lng=Math.min(a.lng,t.lng),t.lat=Math.min(a.lat,t.lat),i.lng=Math.max(o.lng,i.lng),i.lat=Math.max(o.lat,i.lat)),this}getCenter(){return new An((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 An(this.getWest(),this.getNorth())}getSouthEast(){return new An(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(r){let{lng:t,lat:i}=An.convert(r),a=this._sw.lat<=i&&i<=this._ne.lat,o=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=t&&t>=this._ne.lng),a&&o}intersects(r){if(r=wp.convert(r),!(r.getNorth()>=this.getSouth()&&r.getSouth()<=this.getNorth()))return!1;let t=Math.abs(this.getEast()-this.getWest()),i=Math.abs(r.getEast()-r.getWest());if(t>=360||i>=360)return!0;let a=fh(this.getWest(),-180,180),o=fh(this.getEast(),-180,180),s=fh(r.getWest(),-180,180),l=fh(r.getEast(),-180,180),n=a>o,u=s>l;return n&&u?!0:n?l>=a||s<=o:u?o>=s||a<=l:s<=o&&l>=a}static convert(r){return r instanceof wp||!r?r:new wp(r)}static fromLngLat(r,t=0){let i=360*t/40075017,a=i/Math.cos(Math.PI/180*r.lat);return new wp(new An(r.lng-a,r.lat-i),new An(r.lng+a,r.lat+i))}adjustAntiMeridian(){let r=new An(this._sw.lng,this._sw.lat),t=new An(this._ne.lng,this._ne.lat);return r.lng>t.lng?new wp(r,new An(t.lng+360,t.lat)):new wp(r,t)}},wM=class{constructor(e,r,t){this.bounds=wh.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=t||24}validateBounds(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}contains(e){let r=2**e.z,t={minX:Math.floor(um(this.bounds.getWest())*r),minY:Math.floor(cm(this.bounds.getNorth())*r),maxX:Math.ceil(um(this.bounds.getEast())*r),maxY:Math.ceil(cm(this.bounds.getSouth())*r)};return e.x>=t.minX&&e.x=t.minY&&e.y{this.tiles=e,this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}serialize(){return yn({},this._options)}loadTile(e){return Xr(this,null,function*(){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),t={request:yield this.map._requestManager.transformRequest(r,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(e),etag:e.etag};t.request.collectResourceTiming=this._collectResourceTiming,yield this.dispatcher.waitForInitComplete();let i="RT";if(!e.actor||e.state==="expired")e.actor=this.dispatcher.getReadyActor(),i="LT";else if(e.state==="loading")return new Promise((a,o)=>{e.reloadPromise={resolve:a,reject:o}});e.abortController=new AbortController;try{let a=yield e.actor.sendAsync({type:i,data:t},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,a);let o={};return a?.etagUnmodified&&(o.unmodified=!0),o}catch(a){if(delete e.abortController,e.aborted||Up(a))return;if(a&&a.status!==404)throw a;this._afterTileLoadWorkerResponse(e,null)}})}_getOverzoomParameters(e){return Xr(this,null,function*(){if(e.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let r=e.tileID.scaledTo(this.maxzoom).canonical,t=r.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:r,overzoomRequest:yield this.map._requestManager.transformRequest(t,"Tile")}})}_afterTileLoadWorkerResponse(e,r){if(r?.resourceTiming&&(e.resourceTiming=r.resourceTiming),r&&this.map._refreshExpiredTiles&&e.setExpiryData(r),e.etag=r?.etag,e.loadVectorData(r,this.map.painter),e.reloadPromise){let t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return Xr(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return Xr(this,null,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}},_2=class extends Nl{constructor(e,r,t,i){super(),this.id=e,this.dispatcher=t,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._premultiplyAlpha=!0,this._options=yn({type:"raster"},r),yn(this,j1(r,["url","scheme","tileSize"]))}load(e=!1){return Xr(this,null,function*(){this._loaded=!1,this.fire(new Bs("dataloading")),this._tileJSONRequest=new AbortController;try{let r=yield q5(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,r&&(yn(this,r),r.bounds&&(this.tileBounds=new wM(r.bounds,this.minzoom,this.maxzoom)),this.fire(new Bs("data",{sourceDataType:"metadata"})),this.fire(new Bs("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(r){this._tileJSONRequest=null,this._loaded=!0,Up(r)||this.fire(new Ln(Zu(r)))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null)),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this.tiles=e,this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return yn({},this._options)}setPremultiplyAlpha(e){return this._premultiplyAlpha===e||this.setSourceProperty(()=>{this._premultiplyAlpha=e}),this}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return Xr(this,null,function*(){var r;let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i=this._premultiplyAlpha,a=i?void 0:{premultiplyAlpha:"none"};e.abortController=new AbortController;try{let o=yield rd.transformAndGetImage(this.map._requestManager,t,"Tile",e.abortController,this.map._refreshExpiredTiles,a);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(o){this.map._refreshExpiredTiles&&(o.cacheControl||o.expires)&&e.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});let s=this.map.painter.context,l=s.gl,n=(r=o.data)!=null?r:new zs({width:1,height:1},new Uint8Array(4));e.texture=this.map.painter.getTileTexture(n.width),e.texture?e.texture.update(n,{useMipmap:!0,premultiply:i}):(e.texture=new jl(s,n,l.RGBA,{useMipmap:!0,premultiply:i}),e.texture.bind(l.LINEAR,l.CLAMP_TO_EDGE,l.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(o){if(delete e.abortController,e.aborted)e.state="unloaded";else if(o)throw e.state="errored",o}})}abortTile(e){return Xr(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return Xr(this,null,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}},AM=class extends _2{constructor(e,r,t,i){super(e,r,t,i),this.type="raster-dem",this.maxzoom=22,this._options=yn({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return Xr(this,null,function*(){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let t=yield rd.transformAndGetImage(this.map._requestManager,r,"Tile",e.abortController,this.map._refreshExpiredTiles,{colorSpaceConversion:"none"});if(delete e.abortController,e.aborted){e.state="unloaded";return}if(t){if(this.map._refreshExpiredTiles&&(t.cacheControl||t.expires)&&e.setExpiryData({cacheControl:t.cacheControl,expires:t.expires}),!t.data){e.state="loaded";return}let i=t.data,a=I0(i)&&B4()?i:yield this.readImageNow(i),o={type:this.type,uid:e.uid,source:this.id,rawImageData:a,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(e.actor&&e.state!=="expired"&&e.state!=="reloading")return;yield this.dispatcher.waitForInitComplete(),(!e.actor||e.state==="expired")&&(e.actor=this.dispatcher.getReadyActor()),e.dem=yield e.actor.sendAsync({type:"LDT",data:o}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0,e.state="loaded"}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}})}readImageNow(e){return Xr(this,null,function*(){if(typeof VideoFrame<"u"&&l9()){let r=e.width+4,t=e.height+4;try{return new zs({width:r,height:t},yield uJ(e,-2,-2,r,t))}catch{}}return yc.getImageData(e,2)})}_getNeighboringTiles(e){let r=e.canonical,t=2**r.z,i=(r.x-1+t)%t,a=r.x===0?e.wrap-1:e.wrap,o=(r.x+1+t)%t,s=r.x+1===t?e.wrap+1:e.wrap,l={};return l[new Cu(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new Cu(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new Cu(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new Cu(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new Cu(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1$5(r))}}shouldReloadTile(e,{affectedBounds:r}){if(e.state==="loading")return!0;if(e.state==="unloaded")return!1;let{buffer:t,extent:i}=this.workerOptions.geojsonVtOptions,a=kne(e.tileID.canonical,t/i);for(let o of r)if(a.intersects(o))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(e){return Xr(this,null,function*(){let r=e.actor?"RT":"LT";e.actor=yield this.actorPromise;let t={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;try{let i=yield(yield this.actorPromise).sendAsync({type:r,data:t},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(i,this.map.painter,r==="RT")}catch(i){if(delete e.abortController,e.aborted||Up(i))return;throw i}})}abortTile(e){return Xr(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return Xr(this,null,function*(){e.unloadVectorData(),yield(yield this.actorPromise).sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actorPromise.then(e=>e.sendAsync({type:"RS",data:{type:this.type,source:this.id}}))}serialize(){return yn({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}},rv=[0,0,1],pB=(e,r)=>({u_tl_parent:new mo(e,r.u_tl_parent),u_scale_parent:new Xa(e,r.u_scale_parent),u_buffer_scale:new Xa(e,r.u_buffer_scale),u_image_warp:new vc(e,r.u_image_warp),u_fade_t:new Xa(e,r.u_fade_t),u_opacity:new Xa(e,r.u_opacity),u_image0:new En(e,r.u_image0),u_image1:new En(e,r.u_image1),u_brightness_low:new Xa(e,r.u_brightness_low),u_brightness_high:new Xa(e,r.u_brightness_high),u_saturation_factor:new Xa(e,r.u_saturation_factor),u_contrast_factor:new Xa(e,r.u_contrast_factor),u_spin_weights:new vc(e,r.u_spin_weights),u_coords_top:new Em(e,r.u_coords_top),u_coords_bottom:new Em(e,r.u_coords_bottom)}),vB=(e,r,t,i,a,o)=>({u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_image_warp:o,u_fade_t:t.mix,u_opacity:t.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:Lne(i.paint.get("raster-saturation")),u_contrast_factor:Dne(i.paint.get("raster-contrast")),u_spin_weights:Cne(i.paint.get("raster-hue-rotate")),u_coords_top:[a[0].x,a[0].y,a[1].x,a[1].y],u_coords_bottom:[a[3].x,a[3].y,a[2].x,a[2].y]}),qm=class{constructor(e,r,t){this.vertexBuffer=e,this.indexBuffer=r,this.segments=t}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}},a0=ul([{name:"a_pos",type:"Int16",components:2}]),Kg=Bi/128,iv=class extends Nl{constructor(e,r,t,i){super(),this.imageWarp=rv,this.flippedWindingOrder=!1,this._warp="auto",this._imageDirty=!1,this._subdividedQuad=!1,this._subdividedMesh=null,this.id=e,this.dispatcher=t,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}load(e){return Xr(this,null,function*(){if(this.options.url===void 0){this._loaded=!0,this._finishLoading();return}this._loaded=!1,this.fire(new Bs("dataloading")),this.url=this.options.url,this._abortController=new AbortController;try{let r=yield rd.transformAndGetImage(this.map._requestManager,this.url,"Image",this._abortController);this._abortController=null,this._loaded=!0,r?.data?(this._setImage(r.data),e&&(this.coordinates=e),this._finishLoading()):this.fire(new Ln(Error(`Could not load image ${this.url}: the response is empty`)))}catch(r){if(Up(r))return;this._abortController=null,this._loaded=!0,this.fire(new Ln(Zu(r)))}})}loaded(){return this._loaded}updateImage(e){return this._abortController&&(this._abortController=(this._abortController.abort(),null)),"image"in e?(this._loaded=!0,this._setImage(e.image),e.coordinates&&(this.coordinates=e.coordinates),this._finishLoading(),this):e.url?(this.options.url=e.url,this.load(e.coordinates),this):this}_setImage(e){this.image=e,this._imageDirty=!0}getMesh(e,r){var t;return!this._subdividedQuad||r?null:((t=this._subdividedMesh)!=null||(this._subdividedMesh=W5(e,{granularity:16})),this._subdividedMesh)}_disposeTexture(){var e;(e=this.texture)==null||e.destroy(),this.texture=null}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Bs("data",{sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){var e;this._abortController&&(this._abortController=(this._abortController.abort(),null)),this._disposeTexture(),(e=this._subdividedMesh)==null||e.destroy(),this._subdividedMesh=null,this.image=null,this.tiles={}}setWarp(e){return this._warp===e?this:(this._warp=e,this.tileCoords&&this.setCoordinates(this.coordinates),this)}getWarp(){return this._warp}setCoordinates(e){this.coordinates=e;let r=e.map(Qo.fromLngLat);return this.tileID=Fne(r),this.terrainTileRanges=this._getOverlappingTileRanges(r),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=r.map(t=>this.tileID.getTilePoint(t)._round()),this.imageWarp=Ine(this.tileCoords,this._warp),this._subdividedQuad=this.imageWarp[2]>0&&!X5(this.tileCoords),this.flippedWindingOrder=Pne(this.tileCoords),this.fire(new Bs("data",{sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,r=e.gl;this.texture?this._imageDirty&&(this.texture.update(this.image),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)):(this.texture=new jl(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this._imageDirty=!1;let t=!1;for(let i in this.tiles){let a=this.tiles[i];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,t=!0)}t&&this.fire(new Bs("data",{sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return Xr(this,null,function*(){var r;(r=this.tileID)!=null&&r.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){let e={type:"image",coordinates:this.coordinates};return this.options.url!==void 0&&(e.url=this.options.url),e}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:r,minY:t,maxX:i,maxY:a}=yh.fromPoints(e),o={};for(let s=0;s<=25;s++){let l=2**s,n=Math.floor(r*l),u=Math.floor(t*l),c=Math.floor(i*l),f=Math.floor(a*l),h=(n%l+l)%l,d=c%l,p=Math.floor(n/l),g=Math.floor(c/l);o[s]={minWrap:p,maxWrap:g,minTileXWrapped:h,maxTileXWrapped:d,minTileY:u,maxTileY:f}}return o}},SM=class extends iv{constructor(e,r,t,i){super(e,r,t,i),this._onPlayingHandler=()=>{var a;(a=this.map)==null||a.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=r}load(){return Xr(this,null,function*(){this._loaded=!1;let e=this.options;this.urls=[];for(let r of e.urls)this.urls.push((yield this.map._requestManager.transformRequest(r,"Source")).url);try{let r=yield SP(this.urls);if(this._loaded=!0,!r)return;this.video=r,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new Ln(Zu(r)))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let r=this.video.seekable;er.end(0)?this.fire(new Ln(new na(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,r=e.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new jl(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let t=!1;for(let i in this.tiles){let a=this.tiles[i];a.state!=="loaded"&&(a.state="loaded",a.texture=this.texture,t=!0)}t&&this.fire(new Bs("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},EM=class extends iv{constructor(e,r,t,i){super(e,r,t,i),r.coordinates?(!Array.isArray(r.coordinates)||r.coordinates.length!==4||r.coordinates.some(a=>!Array.isArray(a)||a.length!==2||a.some(o=>typeof o!="number")))&&this.fire(new Ln(new na(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Ln(new na(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&typeof r.animate!="boolean"&&this.fire(new Ln(new na(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?typeof r.canvas!="string"&&!(r.canvas instanceof HTMLCanvasElement)&&this.fire(new Ln(new na(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new Ln(new na(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=r.animate===void 0||r.animate}load(){return Xr(this,null,function*(){if(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 Ln(Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this._playing=(this.prepare(),!1))},this._finishLoading()})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this._playing=!1,super.onRemove()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let r=this.map.painter.context,t=r.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new jl(r,this.canvas,t.RGBA,{premultiply:!0}),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let i=!1;for(let a in this.tiles){let o=this.tiles[a];o.state!=="loaded"&&(o.state="loaded",o.texture=this.texture,i=!0)}i&&this.fire(new Bs("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},kM={},mB=(e,r,t,i)=>{let a=new(CM(r.type))(e,r,t,i);if(a.id!==e)throw Error(`Expected Source id to be ${e} instead of ${a.id}`);return a},CM=e=>{switch(e){case"geojson":return MM;case"image":return iv;case"raster":return _2;case"raster-dem":return AM;case"vector":return TM;case"video":return SM;case"canvas":return EM}return kM[e]},gB=(e,r)=>{kM[e]=r},yB=(e,r)=>Xr(null,null,function*(){if(CM(e))throw Error(`A source type called "${e}" already exists.`);gB(e,r)}),x2="RTLPluginLoaded",_B=class extends Nl{constructor(...e){super(...e),this.status="unavailable",this.url=null,this.dispatcher=GA()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(r=>{throw this.status="error",r})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e,r=!1){return Xr(this,null,function*(){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=yc.resolveURL(e),!this.url)throw Error(`requested url ${e} is invalid`);if(this.status==="unavailable")if(r)this.status="deferred",this._syncState(this.status);else return this._requestImport();else if(this.status==="requested")return this._requestImport()})}_requestImport(){return Xr(this,null,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new hf(x2))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}},b2=null,DM=class{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=x9(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rttObjects=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading",this.featureStateRevision=-1}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:r,fadingParentID:t,fadeEndTime:i}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=r,this.fadingParentID=t,this.fadeEndTime=i}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=hs(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}getRTT(e){return this.rttObjects[e]}acquireRTT(e,r,t){return this.rttObjects[r]=e.acquireRTT(t)}releaseRTT(e){if(this.rttObjects.length!==0){for(let r of this.rttObjects)r&&e.releaseRTT(r);this.rttObjects.length=0}}loadVectorData(e,r,t){if(e?.etagUnmodified===!0){this.state="loaded";return}if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e){this.collisionBoxArray=new NT;return}e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestEncoding=e.encoding,this.latestFeatureIndex.rawTileData=e.rawTileData,this.latestFeatureIndex.encoding=e.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=zne(e.buckets,r?.style),this.hasSymbolBuckets=!1;for(let i in this.buckets){let a=this.buckets[i];if(a instanceof Rg)if(this.hasSymbolBuckets=!0,t)a.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let i in this.buckets){let a=this.buckets[i];if(a instanceof Rg&&a.hasRTLText){this.hasRTLText=!0,Ug().lazyLoad();break}}this.queryPadding=0;for(let i in this.buckets){let a=this.buckets[i];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(i).queryRadius(a))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let t in this.buckets){let i=this.buckets[t];i.uploadPending()&&i.upload(e)}let r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new jl(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasImage=(this.glyphAtlasTexture=new jl(e,this.glyphAtlasImage,r.ALPHA),null))}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,r,t,i,a,o,s,l,n,u,c){var f;return(f=this.latestFeatureIndex)!=null&&f.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:a,scale:o,tileSize:this.tileSize,pixelPosMatrix:u,transform:l,params:s,queryPadding:this.queryPadding*n,getElevation:c},e,r,t):{}}querySourceFeatures(e,r){let t=this.latestFeatureIndex;if(!t?.rawTileData)return;let i=t.loadVTLayers(),a=r?.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;let s=K1(r?.filter,`querySourceFeatures[${a}].filter`,r?.globalState),{z:l,x:n,y:u}=this.tileID.canonical,c={z:l,x:n,y:u};for(let f=0;ft)i=!1;else if(!r)i=!0;else if(this.expirationTimethis.max[0]||r.aabb.min[1]>this.max[1]||r.aabb.min[2]>this.max[2]||r.aabb.max[0]0?(t+=r[a]*this.min[a],i+=r[a]*this.max[a]):(i+=r[a]*this.min[a],t+=r[a]*this.max[a]);return t>=0?2:i<0?0:1}},T2=class nU{constructor(r,t,i){this.points=r,this.planes=t,this.aabb=i}static fromInvProjectionMatrix(r,t=1,i=0,a,o){let 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]],l=o?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],n=2**i,u=s.map(d=>Bne(d,r,t,n));a&&One(u,l[0],a,o);let c=l.map(d=>{let p=Ed([],u[d[0]],u[d[1]]),g=Ed([],u[d[2]],u[d[1]]),m=qc([],uf([],p,g)),y=-Kl(m,u[d[1]]);return m.concat(y)}),f=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0];for(let d of u)for(let p=0;p<3;p++)f[p]=Math.min(f[p],d[p]),h[p]=Math.max(h[p],d[p]);return new nU(u,c,new w2(f,h))}},bB=HA(9.314,3),LM=class{constructor(){this._tiles={}}handleWrapJump(e){let r={};for(let t in this._tiles){let i=this._tiles[t];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}this._tiles=r}setFeatureState(e,r,t){for(let i in this._tiles)this._tiles[i].setFeatureState(e,r,t)}getAllTiles(){return Object.values(this._tiles)}getAllIds(e=!1){return e?Object.values(this._tiles).map(r=>r.tileID).sort(OF).map(r=>r.key):Object.keys(this._tiles)}getTileById(e){return this._tiles[e]}setTile(e,r){this._tiles[e]=r}deleteTileById(e){delete this._tiles[e]}getLoadedTile(e){let r=this.getTileById(e.key);return r?.hasData()?r:null}isIdRenderable(e,r=!1){var t;return(t=this.getTileById(e))==null?void 0:t.isRenderable(r)}getRenderableIds(e=0,r){let t=[];for(let i of this.getAllIds())this.isIdRenderable(i,r)&&t.push(this.getTileById(i));return r?t.sort((i,a)=>{let o=i.tileID,s=a.tileID,l=new Wr(o.canonical.x,o.canonical.y)._rotate(-e),n=new Wr(s.canonical.x,s.canonical.y)._rotate(-e);return o.overscaledZ-s.overscaledZ||n.y-l.y||n.x-l.x}).map(i=>i.tileID.key):t.map(i=>i.tileID).sort(OF).map(i=>i.key)}},A2=(Vm=class extends Nl{constructor(e,r,t){super(),this._maxContentElevationSeen=0,this.id=e,this.dispatcher=t,this.on("data",i=>{this._dataHandler(i)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=mB(e,r,t,this),this._inViewTiles=new LM,this._outOfViewCache=new k5(0,i=>this._unloadTile(i)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new xB,this._didEmitContent=!1,this._updated=!1}onAdd(e){var r;this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,(r=this._source)!=null&&r.onAdd&&this._source.onAdd(e)}onRemove(e){var r;for(let t of this._inViewTiles.getAllTiles())t.unloadVectorData();this.clearTiles(),(r=this._source)!=null&&r.onRemove&&this._source.onRemove(e),this._inViewTiles=new LM}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((this.used!==void 0||this.usedForTerrain!==void 0)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let e of this._inViewTiles.getAllTiles())if(e.state!=="loaded"&&e.state!=="errored")return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,r,t,i){return Xr(this,null,function*(){try{let a=yield this._source.loadTile(e);this._tileLoaded(e,r,t,i,a)}catch(a){e.state="errored",a.status===404?this.update(this.transform,this.terrain):this._source.fire(new Ln(Zu(a),{tile:e}))}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new Bs("dataabort",{tile:e,coord:e.tileID}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let r of this._inViewTiles.getAllTiles())r.upload(e),r.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(e){var r;return this._inViewTiles.getRenderableIds((r=this.transform)==null?void 0:r.bearingInRadians,e)}hasRenderableParent(e){let r=e.overscaledZ-1;if(r>=this._source.minzoom){let t=this.getLoadedTile(e.scaledTo(r));if(t)return this._inViewTiles.isIdRenderable(t.tileID.key)}return!1}reload(e,r=void 0){if(this._paused){this._shouldReloadOnResume=!0;return}this._outOfViewCache.reset();for(let t of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(t);(!r||this._source.shouldReloadTile(i,r))&&(e?this._reloadTile(t,i.state==="errored"?"loading":"expired"):i.state!=="errored"&&this._reloadTile(t,"reloading"))}}_reloadTile(e,r){return Xr(this,null,function*(){let t=this._inViewTiles.getTileById(e);if(!t)return;let i=t.hasData();t.state!=="loading"&&(t.state=r),yield this._loadTile(t,e,r,i)})}_tileLoaded(e,r,t,i,a){i||(e.timeAdded=hs(),e.selfFading&&(e.fadeEndTime=e.timeAdded+this._rasterFadeDuration)),t==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),!a?.unmodified&&(this.getSource().type==="raster-dem"&&e.dem&&Xne(e,this._inViewTiles),e.featureStateRevision=-1,this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new Bs("data",{tile:e,coord:e.tileID})))}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._inViewTiles.getTileById(e)}_retainLoadedChildren(e,r){let t=this._getLoadedDescendents(r),i=new Set;for(let a of r){let o=t[a.key];if(!o?.length){i.add(a);continue}let s=a.overscaledZ+Vm.maxOverzooming,l=o.filter(c=>c.tileID.overscaledZ<=s);if(!l.length){i.add(a);continue}let n=Math.min(...l.map(c=>c.tileID.overscaledZ)),u=l.filter(c=>c.tileID.overscaledZ===n).map(c=>c.tileID);for(let c of u)e[c.key]=c;this._areDescendentsComplete(u,n,a.overscaledZ)||i.add(a)}return i}_getLoadedDescendents(e){var r;let t={};for(let i of this._inViewTiles.getAllTiles().filter(a=>a.hasData()))for(let a of e)i.tileID.isChildOf(a)&&(t[r=a.key]||(t[r]=[]),t[a.key].push(i));return t}_areDescendentsComplete(e,r,t){return e.length===1&&e[0].isOverscaled()?e[0].overscaledZ===r:4**(r-t)===e.length}getLoadedTile(e){return this._inViewTiles.getLoadedTile(e)}updateCacheSize(e){let r=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),t=this._maxTileCacheZoomLevels===null?ff.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,i=Math.floor(r*t),a=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,i):i;this._outOfViewCache.setMaxSize(a)}handleWrapJump(e){let r=(e-(this._prevLng===void 0?e:this._prevLng))/360,t=Math.round(r);this._prevLng=e,t&&(this._inViewTiles.handleWrapJump(t),this._resetTileReloadTimers())}_updateMaxContentElevation(){var e,r;let t=this._maxContentElevationSeen,i=(r=(e=this.map)==null?void 0:e.style)==null?void 0:r._layers;if(!i)return t;let a=this._inViewTiles.getAllTiles();for(let o in i){let s=i[o];if(s.type!=="symbol"||s.source!==this.id||s.isHidden(this.transform.zoom))continue;let l=s;if(l.layout){t=Math.max(t,l.layout.get("symbol-height-offset").constantOr(0));for(let n of a){let u=n.getBucket(s);u&&u.maxHeightOffset>t&&(t=u.maxHeightOffset)}}}return this._maxContentElevationSeen=t,t}update(e,r){if(!this._sourceLoaded||this._paused)return;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng);let t;!this.used&&!this.usedForTerrain?t=[]:this._source.tileID?t=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(l=>new Cu(l.canonical.z,l.wrap,l.canonical.z,l.canonical.x,l.canonical.y)):(t=Om(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type==="vector"&&this.map._zoomLevelsToOverscale!==void 0?Math.max(this._source.maxzoom,e.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r,calculateTileZoom:this._source.calculateTileZoom,maxContentElevation:this._updateMaxContentElevation()}),this._source.hasTile&&(t=t.filter(l=>this._source.hasTile(l)))),this.usedForTerrain&&(t=this._addTerrainIdealTiles(t));let i=t.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,i&&this.fire(new Bs("data",{sourceDataType:"idle",sourceId:this.id}));let a=$A(e,this._source),o=this._updateRetainedTiles(t,a),s=J5(this._source.type);s&&this._rasterFadeDuration>0&&!r&&Gne(this._inViewTiles,t,o,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),s?this._cleanUpRasterTiles(o):this._cleanUpVectorTiles(o)}_cleanUpRasterTiles(e){for(let r of this._inViewTiles.getAllIds())e[r]||this._removeTile(r)}_cleanUpVectorTiles(e){for(let r of this._inViewTiles.getAllIds()){let t=this._inViewTiles.getTileById(r);if(e[r]){t.clearSymbolFadeHold();continue}if(!t.hasSymbolBuckets){this._removeTile(r);continue}t.holdingForSymbolFade()?t.symbolFadeFinished()&&this._removeTile(r):t.setSymbolHoldDuration(this.map._fadeDuration)}}_addTerrainIdealTiles(e){let r=[];for(let t of e)if(t.canonical.z>this._source.minzoom){let i=t.scaledTo(t.canonical.z-1);r.push(i);let a=t.scaledTo(Math.max(this._source.minzoom,Math.min(t.canonical.z,5)));r.push(a)}return e.concat(r)}releaseSymbolFadeTiles(){for(let e of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(e).holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(e,r){var t;let i=new Set;for(let n of e)this._addTile(n).hasData()||i.add(n);let a=e.reduce((n,u)=>(n[u.key]=u,n),{}),o=this._retainLoadedChildren(a,i),s={},l=Math.max(r-Vm.maxUnderzooming,this._source.minzoom);for(let n of o){let u=this._inViewTiles.getTileById(n.key),c=u?.wasRequested();for(let f=n.overscaledZ-1;f>=l;--f){let h=n.scaledTo(f);if(s[h.key])break;if(s[h.key]=!0,u=this.getTile(h),!u&&c&&(u=this._addTile(h)),u){let d=u.hasData();if((d||!((t=this.map)!=null&&t.cancelPendingTileRequestsWhileZooming)||c)&&(a[h.key]=h),c=u.wasRequested(),d)break}}}return a}_addTile(e){let r=this._inViewTiles.getTileById(e.key);if(r)return r;r=this._outOfViewCache.getAndRemove(e),r&&(r.resetFadeLogic(),this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null));let t=r;return r||(r=new DM(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state,!1)),r.uses++,this._inViewTiles.setTile(e.key,r),t||this._source.fire(new Bs("dataloading",{tile:r,coord:r.tileID})),r}_setTileReloadTimer(e,r){this._clearTileReloadTimer(e);let t=r.getExpiryTimeout();if(t){let i=()=>{this._reloadTile(e,"expired"),delete this._timers[e]};this._timers[e]=setTimeout(i,t)}}_clearTileReloadTimer(e){let r=this._timers[e];r&&(clearTimeout(r),delete this._timers[e])}_resetTileReloadTimers(){for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(e);this._setTileReloadTimer(e,r)}}refreshTiles(e){for(let r of this._inViewTiles.getAllIds()){let t=this._inViewTiles.getTileById(r);(this._inViewTiles.isIdRenderable(r)||t.state=="errored")&&e.some(i=>i.equals(t.tileID.canonical))&&this._reloadTile(r,"expired")}}_removeTile(e){let r=this._inViewTiles.getTileById(e);r&&(r.uses--,this._inViewTiles.deleteTileById(e),this._clearTileReloadTimer(e),!(r.uses>0)&&(r.hasData()&&r.state!=="reloading"?this._outOfViewCache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}_dataHandler(e){if(e.dataType==="source"){if(e.sourceDataType==="metadata"){this._sourceLoaded=!0;return}e.sourceDataType==="content"&&this._sourceLoaded&&!this._paused&&(this.reload(e.sourceDataChanged,e.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}}resetMaxContentElevation(){this._maxContentElevationSeen=0}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1,this.resetMaxContentElevation();for(let e of this._inViewTiles.getAllIds())this._removeTile(e);this._outOfViewCache.reset()}tilesIn(e,r,t){let i=[],a=this.transform;if(!a)return i;let o=a.getCoveringTilesDetailsProvider().allowWorldCopies(),s=t?a.getCameraQueryGeometry(e):e,l=h=>a.screenPointToMercatorCoordinate(h,this.terrain),n=this.transformBbox(e,l,!o),u=this.transformBbox(s,l,!o),c=this.getIds(),f=yh.fromPoints(u);for(let h of c){let d=this._inViewTiles.getTileById(h);if(d.holdingForSymbolFade())continue;let p=o?[d.tileID]:[d.tileID.unwrapTo(-1),d.tileID.unwrapTo(0)],g=2**(a.zoom-d.tileID.overscaledZ),m=r*d.queryPadding*Bi/d.tileSize/g;for(let y of p){let _=f.map(v=>y.getTilePoint(new Qo(v.x,v.y)));if(_.expandBy(m),_.intersects(cR)){let v=n.map(S=>y.getTilePoint(S)),x=u.map(S=>y.getTilePoint(S));i.push({tile:d,tileID:o?y:y.unwrapTo(0),queryGeometry:v,cameraQueryGeometry:x,scale:g})}}}return i}transformBbox(e,r,t){let i=e.map(r);if(t){let a=yh.fromPoints(e);a.shrinkBy(Math.min(a.width(),a.height())*.001);let o=a.map(r);yh.fromPoints(i).covers(o)||(i=i.map(s=>s.x>.5?new Qo(s.x-1,s.y,s.z):s))}return i}getVisibleCoordinates(e){let r=this.getRenderableIds(e).map(t=>this._inViewTiles.getTileById(t).tileID);return this.transform&&this.transform.populateCache(r),r}hasTransition(){return this._source.hasTransition()?!0:J5(this._source.type)&&Yne(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,r,t){e||(e=Og),this._state.updateState(e,r,t)}removeFeatureState(e,r,t){e||(e=Og),this._state.removeFeatureState(e,r,t)}getFeatureState(e,r){return e||(e=Og),this._state.getState(e,r)}setDependencies(e,r,t){let i=this._inViewTiles.getTileById(e);i&&i.setDependencies(r,t)}reloadTilesForDependencies(e,r){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).hasDependency(e,r)&&this._reloadTile(t,"reloading");this._outOfViewCache.filter(t=>!t.hasDependency(e,r))}areTilesLoaded(){for(let e of this._inViewTiles.getAllTiles())if(e.state!=="loaded"&&e.state!=="errored")return!1;return!0}},Vm.maxUnderzooming=10,Vm.maxOverzooming=3,Vm),wB=class{constructor(e,r){this.reset(e,r)}reset(e,r){this.points=e||[],this._distances=[0];for(let t=1;t0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}},FM=class{constructor(e,r,t){let i=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(e/t),this.yCellCount=Math.ceil(r/t);for(let o=0;othis.width||i<0||r>this.height)return[];let l=[];if(e<=0&&r<=0&&this.width<=t&&this.height<=i){if(a)return[{key:null,x1:e,y1:r,x2:t,y2:i}];for(let n=0;n0}hitTestCircle(e,r,t,i,a){let o=e-t,s=e+t,l=r-t,n=r+t;if(s<0||o>this.width||n<0||l>this.height)return!1;let u=[],c={hitTest:!0,overlapMode:i,circle:{x:e,y:r,radius:t},seenUids:{box:{},circle:{}}};return this._forEachCell(o,l,s,n,this._queryCellCircle,u,c,a),u.length>0}_queryCell(e,r,t,i,a,o,s,l){let{seenUids:n,hitTest:u,overlapMode:c}=s,f=this.boxCells[a],h=1e-6;if(f!==null){let p=this.bboxes;for(let g of f)if(!n.box[g]){n.box[g]=!0;let m=g*4,y=this.boxKeys[g];if(e<=p[m+2]+h&&r<=p[m+3]+h&&t>=p[m+0]-h&&i>=p[m+1]-h&&(!l||l(y))&&(!u||!Jb(c,y.overlapMode))&&(o.push({key:y,x1:p[m],y1:p[m+1],x2:p[m+2],y2:p[m+3]}),u))return!0}}let d=this.circleCells[a];if(d!==null){let p=this.circles;for(let g of d)if(!n.circle[g]){n.circle[g]=!0;let m=g*3,y=this.circleKeys[g];if(this._circleAndRectCollide(p[m],p[m+1],p[m+2],e,r,t,i)&&(!l||l(y))&&(!u||!Jb(c,y.overlapMode))){let _=p[m],v=p[m+1],x=p[m+2];if(o.push({key:y,x1:_-x,y1:v-x,x2:_+x,y2:v+x}),u)return!0}}}return!1}_queryCellCircle(e,r,t,i,a,o,s,l){let{circle:n,seenUids:u,overlapMode:c}=s,f=this.boxCells[a];if(f!==null){let d=this.bboxes;for(let p of f)if(!u.box[p]){u.box[p]=!0;let g=p*4,m=this.boxKeys[p];if(this._circleAndRectCollide(n.x,n.y,n.radius,d[g+0],d[g+1],d[g+2],d[g+3])&&(!l||l(m))&&!Jb(c,m.overlapMode))return o.push(!0),!0}}let h=this.circleCells[a];if(h!==null){let d=this.circles;for(let p of h)if(!u.circle[p]){u.circle[p]=!0;let g=p*3,m=this.circleKeys[p];if(this._circlesCollide(d[g],d[g+1],d[g+2],n.x,n.y,n.radius)&&(!l||l(m))&&!Jb(c,m.overlapMode))return o.push(!0),!0}}}_forEachCell(e,r,t,i,a,o,s,l){let n=this._convertToXCellCoord(e),u=this._convertToYCellCoord(r),c=this._convertToXCellCoord(t),f=this._convertToYCellCoord(i);for(let h=n;h<=c;h++)for(let d=u;d<=f;d++){let p=this.xCellCount*d+h;if(a.call(this,e,r,t,i,p,o,s,l))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,r,t,i,a,o){let s=i-e,l=a-r,n=t+o;return n*n>s*s+l*l}_circleAndRectCollide(e,r,t,i,a,o,s){let l=(o-i)/2,n=Math.abs(e-(i+l));if(n>l+t)return!1;let u=(s-a)/2,c=Math.abs(r-(a+u));if(c>u+t)return!1;if(n<=l||c<=u)return!0;let f=n-l,h=c-u;return f*f+h*h<=t*t}},TB=zp(),AB=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]),MB=class{constructor(e,r=new FM(e.width+200,e.height+200,25),t=new FM(e.width+200,e.height+200,25)){this.transform=e,this.grid=r,this.ignoredGrid=t,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,r,t,i,a,o,s,l,n,u,c,f,h=0,d=!0){let p=e.anchorPointX+l[0],g=e.anchorPointY+l[1],m=this.projectAndGetPerspectiveRatio(p,g,a,Kb(u,p,g,h,d),f),y=t*m.perspectiveRatio,_;if(!o&&!s){let k=m.x+(c?c.x*y:0),A=m.y+(c?c.y*y:0);_={allPointsOccluded:!1,box:[k+e.x1*y,A+e.y1*y,k+e.x2*y,A+e.y2*y]}}else _=this._projectCollisionBox(e,y,i,a,o,s,l,m,u,c,f,h,d);let[v,x,S,M]=_.box,C=o?_.allPointsOccluded:m.isOccluded,w=C;return w||(w=m.perspectiveRatio=1;I--)R.push(F.path[I]);for(let I=1;IL.signedDistanceFromCamera<=0)?[]:I.map(L=>L.point)}let z=[];if(R.length>0){let I=R[0].clone(),L=R[0].clone();for(let B=1;B=b.x&&L.x<=E.x&&I.y>=b.y&&L.y<=E.y?[R]:L.xE.x||L.yE.y?[]:CF([R],b.x,b.y,E.x,E.y)}for(let I of z){T.reset(I,A*.25);let L=0;L=T.length<=.5*A?1:Math.ceil(T.paddedLength/P)+1;for(let B=0;B=this.screenRightBoundary||i<100||r>this.screenBottomBoundary}isInsideGrid(e,r,t,i){return t>=0&&e=0&&rthis.projectAndGetPerspectiveRatio(R.x,R.y,i,Kb(n,R.x,R.y,f,h),c));F=D.some(R=>!R.isOccluded),T=D.map(R=>new Wr(R.x,R.y))}else F=!0;return{box:QK(T),allPointsOccluded:!F}}},PM=class{constructor(e,r,t,i){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?r:-r))):i&&t?1:0,this.placed=t}isHidden(){return this.opacity===0&&!this.placed}},Gm=class{constructor(e,r,t,i,a){this.text=new PM(e?e.text:null,r,t,a),this.icon=new PM(e?e.icon:null,r,i,a)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},IM=class{constructor(e,r,t){this.text=e,this.icon=r,this.skipFade=t}},SB=class{constructor(e,r,t,i,a){this.bucketInstanceId=e,this.featureIndex=r,this.sourceLayerIndex=t,this.bucketIndex=i,this.tileID=a}},EB=class{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let r=++this.maxGroupID;this.collisionGroups[e]={ID:r,predicate:t=>t.collisionGroupID===r}}return this.collisionGroups[e]}},kB=class{constructor(e,r,t,i,a){this.transform=e.clone(),this.terrain=r,this.collisionIndex=new MB(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new EB(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let r=this.terrain;if(r)return(t,i)=>r.getElevation(e,t,i)}getBucketParts(e,r,t,i){let a=t.getBucket(r),o=t.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;let s=t.collisionBoxArray,l=a.layers[0].layout,n=a.layers[0].paint,u=2**(this.transform.zoom-t.tileID.overscaledZ),c=t.tileSize/Bi,f=t.tileID.toUnwrapped(),h=l.get("text-rotation-alignment")==="map",d=Cf(t,1,this.transform.zoom),p=Np(this.collisionIndex.transform,t,n.get("text-translate"),n.get("text-translate-anchor")),g=Np(this.collisionIndex.transform,t,n.get("icon-translate"),n.get("icon-translate-anchor")),m=WA(h,this.transform,d);this.retainedQueryData[a.bucketInstanceId]=new SB(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,t.tileID);let y={bucket:a,layout:l,translationText:p,translationIcon:g,unwrappedTileID:f,pitchedLabelPlaneMatrix:m,scale:u,textPixelRatio:c,holdingForFade:t.holdingForSymbolFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:dx(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(let _ of a.sortKeyRanges){let{sortKey:v,symbolInstanceStart:x,symbolInstanceEnd:S}=_;e.push({sortKey:v,symbolInstanceStart:x,symbolInstanceEnd:S,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:y})}attemptAnchorPlacement(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_,v,x,S){var M,C,w;let k=Ib[e.textAnchor],A=[e.textOffset0,e.textOffset1],b=sz(k,t,i,A,a),E=this.collisionIndex.placeCollisionBox(r,f,l,n,u,s,o,g,c.predicate,_,b,v,x,S);if((!y||this.collisionIndex.placeCollisionBox(y,f,l,n,u,s,o,m,c.predicate,_,b,v,x,S).placeable)&&E.placeable){let T;if((M=this.prevPlacement)!=null&&M.variableOffsets[h.crossTileID]&&((w=(C=this.prevPlacement)==null?void 0:C.placements[h.crossTileID])!=null&&w.text)&&(T=this.prevPlacement.variableOffsets[h.crossTileID].anchor),h.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[h.crossTileID]={textOffset:A,width:t,height:i,anchor:k,textBoxScale:a,prevAnchor:T},this.markUsedJustification(d,k,h,p),d.allowVerticalPlacement&&(this.markUsedOrientation(d,p,h),this.placedOrientations[h.crossTileID]=p),{shift:b,placedGlyphBoxes:E}}}placeLayerBucketPart(e,r,t){let{bucket:i,layout:a,translationText:o,translationIcon:s,unwrappedTileID:l,pitchedLabelPlaneMatrix:n,textPixelRatio:u,holdingForFade:c,collisionBoxArray:f,partiallyEvaluatedTextSize:h,collisionGroup:d}=e.parameters,p=a.get("text-optional"),g=a.get("icon-optional"),m=gx(a,"text-overlap","text-allow-overlap"),y=m==="always",_=gx(a,"icon-overlap","icon-allow-overlap"),v=_==="always",x=a.get("text-rotation-alignment")==="map",S=a.get("text-pitch-alignment")==="map",M=a.get("icon-text-fit")!=="none",C=a.get("symbol-z-order")==="viewport-y",w=a.get("symbol-height-anchor")==="ground",k=y&&(v||!i.hasIconData()||g),A=v&&(y||!i.hasTextData()||p);!i.collisionArrays&&f&&i.deserializeCollisionBoxes(f);let b=this.retainedQueryData[i.bucketInstanceId].tileID,E=this._getTerrainElevationFunc(b),T=this.transform.getFastPathSimpleProjectionMatrix(b),F=(D,R,P)=>{var z,I;if(r[D.crossTileID])return;if(c){this.placements[D.crossTileID]=new IM(!1,!1,!1);return}let L=D.heightOffset,B=!1,O=!1,G=!0,W=null,X={box:null,placeable:!1,offscreen:null,occluded:!1},Z={box:null,placeable:!1,offscreen:null},J=null,N=null,H=null,$=0,U=0,V=0;R.textFeatureIndex?$=R.textFeatureIndex:D.useRuntimeCollisionCircles&&($=D.featureIndex),R.verticalTextFeatureIndex&&(U=R.verticalTextFeatureIndex);let j=R.textBox;if(j){let le=ye=>{let fe=1;if(i.allowVerticalPlacement&&!ye&&this.prevPlacement){let ae=this.prevPlacement.placedOrientations[D.crossTileID];ae&&(this.placedOrientations[D.crossTileID]=ae,fe=ae,this.markUsedOrientation(i,fe,D))}return fe},ce=(ye,fe)=>{if(i.allowVerticalPlacement&&D.numVerticalGlyphVertices>0&&R.verticalTextBox){for(let ae of i.writingModes)if(ae===2?(X=fe(),Z=X):X=ye(),X?.placeable)break}else X=ye()},pe=D.textAnchorOffsetStartIndex,xe=D.textAnchorOffsetEndIndex;if(xe===pe){let ye=(fe,ae)=>{let ee=this.collisionIndex.placeCollisionBox(fe,m,u,b,l,S,x,o,d.predicate,E,void 0,T,L,w);return ee?.placeable&&(this.markUsedOrientation(i,ae,D),this.placedOrientations[D.crossTileID]=ae),ee};ce(()=>ye(j,1),()=>{let fe=R.verticalTextBox;return i.allowVerticalPlacement&&D.numVerticalGlyphVertices>0&&fe?ye(fe,2):{box:null,offscreen:null}}),le(X?.placeable)}else{let ye=Ib[(I=(z=this.prevPlacement)==null?void 0:z.variableOffsets[D.crossTileID])==null?void 0:I.anchor],fe=(ee,ie,Q)=>{let ue=ee.x2-ee.x1,ge=ee.y2-ee.y1,Me=D.textBoxScale,Te=M&&_==="never"?ie:null,je=null,Ve=m==="never"?1:2,Ke="never";ye&&Ve++;for(let Je=0;Jefe(j,R.iconBox,1),()=>{let ee=R.verticalTextBox,ie=X?.placeable;return i.allowVerticalPlacement&&!ie&&D.numVerticalGlyphVertices>0&&ee?fe(ee,R.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}}),X&&(B=X.placeable,G=X.offscreen);let ae=le(X?.placeable);if(!B&&this.prevPlacement){let ee=this.prevPlacement.variableOffsets[D.crossTileID];ee&&(this.variableOffsets[D.crossTileID]=ee,this.markUsedJustification(i,ee.anchor,D,ae))}}}if(J=X,B=J?.placeable,G=J?.offscreen,D.useRuntimeCollisionCircles&&D.centerJustifiedTextSymbolIndex>=0){let le=i.text.placedSymbolArray.get(D.centerJustifiedTextSymbolIndex),ce=G6(i.textSizeData,h,le),pe=a.get("text-padding"),xe=D.collisionCircleDiameter;N=this.collisionIndex.placeCollisionCircles(m,le,i.lineVertexArray,i.glyphOffsetArray,ce,l,n,t,S,d.predicate,xe,pe,o,E),N.circles.length&&N.collisionDetected&&!t&&To("Collisions detected, but collision boxes are not shown"),B=y||N.circles.length>0&&!N.collisionDetected,G&&(G=N.offscreen)}if(R.iconFeatureIndex&&(V=R.iconFeatureIndex),R.iconBox){let le=ce=>this.collisionIndex.placeCollisionBox(ce,_,u,b,l,S,x,s,d.predicate,E,M&&W?W:void 0,T,L,w);Z&&Z.placeable&&R.verticalIconBox?(H=le(R.verticalIconBox),O=H.placeable):(H=le(R.iconBox),O=H.placeable),G&&(G=H.offscreen)}let q=p||D.numHorizontalGlyphVertices===0&&D.numVerticalGlyphVertices===0,Y=g||D.numIconVertices===0;!q&&!Y?O=B=O&&B:Y?q||O&&(O=B):B=O&&B;let K=B&&J.placeable,te=O&&H.placeable;if(K&&(Z&&Z.placeable&&U?this.collisionIndex.insertCollisionBox(J.box,m,a.get("text-ignore-placement"),i.bucketInstanceId,U,d.ID):this.collisionIndex.insertCollisionBox(J.box,m,a.get("text-ignore-placement"),i.bucketInstanceId,$,d.ID)),te&&this.collisionIndex.insertCollisionBox(H.box,_,a.get("icon-ignore-placement"),i.bucketInstanceId,V,d.ID),N&&B&&this.collisionIndex.insertCollisionCircles(N.circles,m,a.get("text-ignore-placement"),i.bucketInstanceId,$,d.ID),t&&this.storeCollisionData(i.bucketInstanceId,P,R,J,H,N),D.crossTileID===0)throw Error("symbolInstance.crossTileID can't be 0");if(i.bucketInstanceId===0)throw Error("bucket.bucketInstanceId can't be 0");let ne=(B||k)&&!J?.occluded,se=(O||A)&&!H?.occluded;this.placements[D.crossTileID]=new IM(ne,se,G||i.justReloaded),r[D.crossTileID]=!0};if(C){if(e.symbolInstanceStart!==0)throw Error("bucket.bucketInstanceId should be 0");let D=i.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let R=D.length-1;R>=0;--R){let P=D[R];F(i.symbolInstances.get(P),i.collisionArrays[P],P)}}else for(let D=e.symbolInstanceStart;D=0&&(o>=0&&l!==o?e.text.placedSymbolArray.get(l).crossTileID=0:e.text.placedSymbolArray.get(l).crossTileID=t.crossTileID)}markUsedOrientation(e,r,t){let i=r===1||r===3?r:0,a=r===2?r:0,o=[t.leftJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.rightJustifiedTextSymbolIndex];for(let s of o)e.text.placedSymbolArray.get(s).placedOrientation=i;t.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(t.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let r=this.prevPlacement,t=!1;this.prevZoomAdjustment=r?r.zoomAdjustment(this.transform.zoom):0;let i=r?r.symbolFadeChange(e):1,a=r?r.opacities:{},o=r?r.variableOffsets:{},s=r?r.placedOrientations:{};for(let l in this.placements){let n=this.placements[l],u=a[l];u?(this.opacities[l]=new Gm(u,i,n.text,n.icon),t||(t=n.text!==u.text.placed),t||(t=n.icon!==u.icon.placed)):(this.opacities[l]=new Gm(null,i,n.text,n.icon,n.skipFade),t||(t=n.text||n.icon))}for(let l in a){let n=a[l];if(!this.opacities[l]){let u=new Gm(n,i,!1,!1);u.isHidden()||(this.opacities[l]=u,t||(t=n.text.placed),t||(t=n.icon.placed))}}for(let l in o)!this.variableOffsets[l]&&this.opacities[l]&&!this.opacities[l].isHidden()&&(this.variableOffsets[l]=o[l]);for(let l in s)!this.placedOrientations[l]&&this.opacities[l]&&!this.opacities[l].isHidden()&&(this.placedOrientations[l]=s[l]);if(r&&r.lastPlacementChangeTime===void 0)throw Error("Last placement time for previous placement is not defined");t?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=r?r.lastPlacementChangeTime:e)}updateLayerOpacities(e,r){let t={};for(let i of r){let a=i.getBucket(e);a&&i.latestFeatureIndex&&e.id===a.layerIds[0]&&this.updateBucketOpacities(a,i.tileID,t,i.collisionBoxArray)}}updateBucketOpacities(e,r,t,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let a=e.layers[0],o=a.layout,s=new Gm(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),n=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),c=o.get("text-rotation-alignment")==="map",f=o.get("text-pitch-alignment")==="map",h=o.get("icon-text-fit")!=="none",d=new Gm(null,0,l&&(n||!e.hasIconData()||o.get("icon-optional")),n&&(l||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);let p=(m,y,_)=>{for(let v=0;v0||v>0,w=y.numIconVertices>0,k=this.placedOrientations[y.crossTileID],A=k===2,b=k===1||k===3;if(C){let T=uz(M.text),F=A?Hm:T;p(e.text,_,F);let D=b?Hm:T;p(e.text,v,D);let R=M.text.isHidden(),P=[y.rightJustifiedTextSymbolIndex,y.centerJustifiedTextSymbolIndex,y.leftJustifiedTextSymbolIndex];for(let L of P)L>=0&&(e.text.placedSymbolArray.get(L).hidden=R||A?1:0);y.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(y.verticalPlacedTextSymbolIndex).hidden=R||b?1:0);let z=this.variableOffsets[y.crossTileID];z&&this.markUsedJustification(e,z.anchor,y,k);let I=this.placedOrientations[y.crossTileID];I&&(this.markUsedJustification(e,"left",y,I),this.markUsedOrientation(e,I,y))}if(w){let T=uz(M.icon),F=!(h&&y.verticalPlacedIconSymbolIndex&&A);if(y.placedIconSymbolIndex>=0){let D=F?T:Hm;p(e.icon,y.numIconVertices,D),e.icon.placedSymbolArray.get(y.placedIconSymbolIndex).hidden=M.icon.isHidden()}if(y.verticalPlacedIconSymbolIndex>=0){let D=F?Hm:T;p(e.icon,y.numVerticalIconVertices,D),e.icon.placedSymbolArray.get(y.verticalPlacedIconSymbolIndex).hidden=M.icon.isHidden()}}let E=g?.has(m)?g.get(m):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let T=e.collisionArrays[m];if(T){let F=new Wr(0,0);if(T.textBox||T.verticalTextBox){let D=!0;if(u){let R=this.variableOffsets[x];R?(F=sz(R.anchor,R.width,R.height,R.textOffset,R.textBoxScale),c&&F._rotate(f?-this.transform.bearingInRadians:this.transform.bearingInRadians)):D=!1}if(T.textBox||T.verticalTextBox){let R;T.textBox&&(R=A),T.verticalTextBox&&(R=b),lz(e.textCollisionBox.collisionVertexArray,M.text.placed,!D||R,E.text,F.x,F.y)}}if(T.iconBox||T.verticalIconBox){let D=!(b||!T.verticalIconBox),R;T.iconBox&&(R=D),T.verticalIconBox&&(R=!D),lz(e.iconCollisionBox.collisionVertexArray,M.icon.placed,R,E.icon,h?F.x:0,h?F.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}},CB=2**25,DB=2**24,LB=2**17,FB=2**16,Hm=0,PB=class{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,r,t,i,a){let o=this._bucketParts;for(;this._currentTileIndexs.sortKey-l.sortKey));this._currentPartIndex!this._forceFullPlacement&&hs()-i>2;for(;this._currentPlacementIndex>=0;){let o=r[e[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if(AA(o)&&o.layout&&(!o.minzoom||o.minzoom<=s)&&(!o.maxzoom||o.maxzoom>s)){if(this._inProgressLayer||(this._inProgressLayer=new PB(o)),this._inProgressLayer.continuePlacement(t[o.source],this.placement,this._showCollisionBoxes,o,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}},RM=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],al=new Uint32Array(96),RB=class oU{static from(r){if(!r||r.byteLength===void 0||r.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[t,i]=new Uint8Array(r,0,2);if(t!==219)throw Error("Data does not appear to be in a KDBush format.");let a=i>>4;if(a!==1)throw Error(`Got v${a} data when expected v1.`);let o=RM[i&15];if(!o)throw Error("Unrecognized array type.");let[s]=new Uint16Array(r,2,1),[l]=new Uint32Array(r,4,1);return new oU(l,s,o,void 0,r)}constructor(r,t=64,i=Float64Array,a=ArrayBuffer,o){if(isNaN(r)||r<0)throw Error(`Unexpected numItems value: ${r}.`);this.numItems=+r,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;let s=RM.indexOf(this.ArrayType),l=r*2*this.ArrayType.BYTES_PER_ELEMENT,n=r*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-n%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,8,r),this.coords=new i(o,8+n+u,r*2),this._pos=r*2,this._finished=!0;else{let c=this.data=new a(8+l+n+u);this.ids=new this.IndexArrayType(c,8,r),this.coords=new i(c,8+n+u,r*2),this._pos=0,this._finished=!1,new Uint8Array(c,0,2).set([219,16+s]),new Uint16Array(c,2,1)[0]=t,new Uint32Array(c,4,1)[0]=r}}add(r,t){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=r,this.coords[this._pos++]=t,i}finish(){let r=this._pos>>1;if(r!==this.numItems)throw Error(`Added ${r} items when expected ${this.numItems}.`);return QA(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,t,i,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:l}=this;al[0]=0,al[1]=o.length-1,al[2]=0;let n=3,u=[];for(;n>0;){let c=al[--n],f=al[--n],h=al[--n];if(f-h<=l){for(let m=h;m<=f;m++){let y=s[2*m],_=s[2*m+1];y>=r&&y<=i&&_>=t&&_<=a&&u.push(o[m])}continue}let d=h+f>>1,p=s[2*d],g=s[2*d+1];p>=r&&p<=i&&g>=t&&g<=a&&u.push(o[d]),(c===0?r<=p:t<=g)&&(al[n++]=h,al[n++]=d-1,al[n++]=1-c),(c===0?i>=p:a>=g)&&(al[n++]=d+1,al[n++]=f,al[n++]=1-c)}return u}within(r,t,i){let a=[];return this.withinInto(r,t,i,a),a}withinInto(r,t,i,a){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:l}=this;al[0]=0,al[1]=o.length-1,al[2]=0;let n=3,u=0,c=i*i;for(;n>0;){let f=al[--n],h=al[--n],d=al[--n];if(h-d<=l){for(let y=d;y<=h;y++)fz(s[2*y],s[2*y+1],r,t)<=c&&(a[u++]=o[y]);continue}let p=d+h>>1,g=s[2*p],m=s[2*p+1];fz(g,m,r,t)<=c&&(a[u++]=o[p]),(f===0?r-i<=g:t-i<=m)&&(al[n++]=d,al[n++]=p-1,al[n++]=1-f),(f===0?r+i>=g:t+i>=m)&&(al[n++]=p+1,al[n++]=h,al[n++]=1-f)}return u}},$m=512/Bi/2,zB=class{constructor(e,r,t){this.tileID=e,this.bucketInstanceId=t,this._symbolsByKey={};let i=new Map;for(let a=0;a({x:Math.floor(l.anchorX*$m),y:Math.floor(l.anchorY*$m)})),crossTileIDs:o.map(l=>l.crossTileID)};if(s.positions.length>128){let l=new RB(s.positions.length,16,Uint16Array);for(let{x:n,y:u}of s.positions)l.add(n,u);l.finish(),delete s.positions,s.index=l}this._symbolsByKey[a]=s}}getScaledCoordinates(e,r){let{x:t,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,n=l-a,u=$m/2**n,c=(o*Bi+e.anchorX)*u,f=(s*Bi+e.anchorY)*u,h=t*Bi*$m,d=i*Bi*$m;return{x:Math.floor(c-h),y:Math.floor(f-d)}}findMatches(e,r,t){let i=this.tileID.canonical.ze)}},BB=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},OB=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let r=Math.round((e-this.lng)/360);if(r!==0)for(let t in this.indexes){let i=this.indexes[t],a={};for(let o in i){let s=i[o];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+r),a[s.tileID.key]=s}this.indexes[t]=a}this.lng=e}addBucket(e,r,t){var i,a,o;if((i=this.indexes[e.overscaledZ])!=null&&i[e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===r.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let l=0;le.overscaledZ)for(let u in n){let c=n[u];c.tileID.isChildOf(e)&&c.findMatches(r.symbolInstances,e,s)}else{let u=n[e.scaledTo(Number(l)).key];u&&u.findMatches(r.symbolInstances,e,s)}}for(let l=0;l 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,BM="void main() {fragColor=vec4(1.0);}",rd={prelude:Yo(NB,jB),projectionMercator:Yo(` +} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,BM="void main() {fragColor=vec4(1.0);}",id={prelude:Yo(NB,jB),projectionMercator:Yo(` void clipAntimeridian() {}`,"float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:Yo("in highp float v_projection_tile_x;void clipAntimeridian() {if (u_projection_clip_antimeridian !=0 && (v_projection_tile_x < 0.0 || v_projection_tile_x >=8192.0)) {discard;}}",`#define GLOBE_RADIUS 6371008.8 #ifndef PROJECTION_UBO uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix; @@ -3521,9 +3521,9 @@ vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matr precision highp float; #endif in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758 -);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Yo("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;uniform vec3 u_globe_position;uniform float u_globe_radius;in vec3 v_view_direction;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (u_sky_blend > 0.0) {vec3 ray=normalize(v_view_direction);float globe_distance=length(u_globe_position);float angle_to_globe_center=acos(clamp(dot(ray,u_globe_position)/globe_distance,-1.0,1.0));float horizon_angle=asin(min(u_globe_radius/globe_distance,1.0));blend=mix(blend,(angle_to_globe_center-horizon_angle)*u_camera_to_center_distance*u_device_pixel_ratio,u_sky_blend);}if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 v_view_direction;void main() {v_view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,1.0,1.0);}")},OM="#define PROJECTION_MERCATOR",NM="mercator",M2=class{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return NM}get shaderDefine(){return OM}get shaderPreludeCode(){return rd.projectionMercator}get vertexShaderPreludeCode(){return rd.projectionMercator.vertexSource}get subdivisionGranularity(){return wb.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}destroy(){}getMeshFromTileID(e,r,t,i,a){if(this._cachedMesh)return this._cachedMesh;let o=new sp;o.emplaceBack(0,0),o.emplaceBack(Bi,0),o.emplaceBack(0,Bi),o.emplaceBack(Bi,Bi);let s=e.createVertexBuffer(o,i0.members),l=Ks.simpleSegment(0,0,4,2),n=new ed;n.emplaceBack(1,0,2),n.emplaceBack(1,2,3);let u=e.createIndexBuffer(n);return this._cachedMesh=new Um(s,u,l),this._cachedMesh}recalculate(){}hasTransition(){return!1}},S2=class sU{constructor(r=0,t=0,i=0,a=0){if(isNaN(r)||r<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(a)||a<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=t,this.left=i,this.right=a}interpolate(r,t,i){return t.top!=null&&r.top!=null&&(this.top=Zs.number(r.top,t.top,i)),t.bottom!=null&&r.bottom!=null&&(this.bottom=Zs.number(r.bottom,t.bottom,i)),t.left!=null&&r.left!=null&&(this.left=Zs.number(r.left,t.left,i)),t.right!=null&&r.right!=null&&(this.right=Zs.number(r.right,t.right,i)),this}getCenter(r,t){let i=to((this.left+r-this.right)/2,0,r),a=to((this.top+t-this.bottom)/2,0,t);return new Wr(i,a)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new sU(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}},E2=class{constructor(e,r){var t;this.applyConstrain=(i,a)=>this._constrainOverride===null?this._callbacks.defaultConstrain(i,a):this._constrainOverride(i,a),this._callbacks=e,this._tileSize=512,this._renderWorldCopies=r?.renderWorldCopies===void 0||!!r?.renderWorldCopies,this._minZoom=r?.minZoom||0,this._maxZoom=r?.maxZoom||22,this._minPitch=r?.minPitch===void 0||r?.minPitch===null?0:r?.minPitch,this._maxPitch=r?.maxPitch===void 0||r?.maxPitch===null?60:r?.maxPitch,this._constrainOverride=(t=r?.constrainOverride)!=null?t:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new An(0,0),this._elevation=0,this._zoom=0,this._tileZoom=hz(this._zoom),this._scale=Vc(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new S2,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,r,t){this._constrainOverride=e.constrainOverride,this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=hz(this._zoom),this._scale=Vc(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new S2(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!t&&e.autoCalculateNearFarZ,r&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){if(this._minZoom===e)return;this._minZoom=e;let r=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=r}get maxZoom(){return this._maxZoom}setMaxZoom(e){if(this._maxZoom===e)return;this._maxZoom=e;let r=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=r}get minPitch(){return this._minPitch}setMinPitch(e){if(this._minPitch===e)return;this._minPitch=e;let r=this._unmodified;this.setPitch(Math.max(this.pitch,e)),this._unmodified=r}get maxPitch(){return this._maxPitch}setMaxPitch(e){if(this._maxPitch===e)return;this._maxPitch=e;let r=this._unmodified;this.setPitch(Math.min(this.pitch,e)),this._unmodified=r}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get constrainOverride(){return this._constrainOverride}setConstrainOverride(e){e===void 0&&(e=null),this._constrainOverride!==e&&(this._constrainOverride=e,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new Wr(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){let r=ch(e,-180,180)*Math.PI/180;this._bearingInRadians!==r&&(this._unmodified=!1,this._bearingInRadians=r,this._calcMatrices(),this._rotationMatrix=D5(),Hae(this._rotationMatrix,this._rotationMatrix,-this._bearingInRadians))}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){let r=to(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==r&&(this._unmodified=!1,this._pitchInRadians=r,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){let r=e/180*Math.PI;this._rollInRadians!==r&&(this._unmodified=!1,this._rollInRadians=r,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return Ad(this._fovInRadians)}setFov(e){e=to(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=rl(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){let r=this.applyConstrain(this._center,e).zoom;this._zoom!==r&&(this._unmodified=!1,this._zoom=r,this._tileZoom=Math.max(0,Math.floor(r)),this._scale=Vc(r),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(e){(e.lat!==this._center.lat||e.lng!==this._center.lng)&&(this._unmodified=!1,this._center=e,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,r){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=r,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,r,t){this._unmodified=!1,this._edgeInsets.interpolate(e,r,t),this.constrainInternal(),this._calcMatrices()}resize(e,r,t=!0){this._width=e,this._height=r,t&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){var e,r;return((e=this._latRange)==null?void 0:e.length)!==2||((r=this._lngRange)==null?void 0:r.length)!==2?null:new bh([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-Wh,Wh])}getCameraQueryGeometry(e,r){if(r.length===1)return[r[0],e];{let{minX:t,minY:i,maxX:a,maxY:o}=gh.fromPoints(r).extend(e);return[new Wr(t,i),new Wr(a,i),new Wr(a,o),new Wr(t,o),new Wr(t,i)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:r,zoom:t}=this.applyConstrain(this.center,this.zoom);this.setCenter(r),this.setZoom(t),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._pixelPerMeter=q0(1,this.center.lat)*this.worldSize,!this._width||!this._height)return;this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=Hh(new Float64Array(16));Xu(e,e,[this._width/2,-this._height/2,1]),Ol(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=Hh(new Float64Array(16)),Xu(e,e,[1,-1,1]),Ol(e,e,[-1,-1,0]),Xu(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e;let r=this.fovInRadians/2;this._cameraToCenterDistance=.5/Math.tan(r)*this._height,this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,r,t,i){let a=t===void 0?this.bearing:t,o=i=i===void 0?this.pitch:i,{distanceToCenter:s,clampedElevation:l}=this._distanceToCenterFromAltElevationPitch(r,this.elevation,o),{x:n,y:u}=N6(o,a),c=Qo.fromLngLat(e,r),f=QL(1,c.y),h,d,p=0;do{if(p+=1,p>10)break;d=s/f;let g=n*d,m=u*d;h=new Qo(c.x+g,c.y+m),f=1/h.meterInMercatorCoordinateUnits()}while(Math.abs(s-d*f)>1e-12);return{center:h.toLngLat(),elevation:l,zoom:Ku(this.height/2/Math.tan(this.fovInRadians/2)/d/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e===0)return;let r=1/this.worldSize,t=q0(1,this.center.lat)*this.worldSize,i=Qo.fromLngLat(this.center,this.elevation),a=i.x/r,o=i.y/r,s=i.z/r,l=this.pitch,n=this.bearing,{x:u,y:c,z:f}=N6(l,n),h=this.cameraToCenterDistance,d=a+h*-u,p=o+h*-c,g=s+h*f,{distanceToCenter:m,clampedElevation:y}=this._distanceToCenterFromAltElevationPitch(g/t,e,l),_=m*t,v=d+u*_,x=p+c*_,S=new Qo(v*r,x*r,0).toLngLat(),M=q0(1,S.lat),C=Ku(this.height/2/Math.tan(this.fovInRadians/2)/m/M/this.tileSize);this._elevation=y,this._center=S,this.setZoom(C)}_distanceToCenterFromAltElevationPitch(e,r,t){let i=-Math.cos(rl(t)),a=e-r,o,s=r;return i*a>=0||Math.abs(i)<.1?(o=1e4,s=e+o*i):o=-a/i,{distanceToCenter:o,clampedElevation:s}}getCameraPoint(){let e=this.pitchInRadians,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new Wr(r*Math.sin(this.rollInRadians),r*Math.cos(this.rollInRadians)))}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];let r=e.canonical.z>=0?1<i}allowWorldCopies(){return!0}prepareNextFrame(){}},YB=ul([{name:"a_pos3d",type:"Int16",components:3}]),XB=class extends Nl{constructor(e){super(),this._lastTilesetChange=hs(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,r){this.tileManager.update(e,r),this._renderableTilesKeys=[];let t={},i=!1;for(let a of Bm(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r,calculateTileZoom:this.tileManager._source.calculateTileZoom}))t[a.key]=!0,this._renderableTilesKeys.push(a.key),this._tiles[a.key]||(a.terrainRttPosMatrix32f=new Float32Array(16),$h(a.terrainRttPosMatrix32f,0,Bi,Bi,0,0,1),this._tiles[a.key]=new DM(a,this.tileSize),this._lastTilesetChange=hs(),i=!0);for(let a in this._tiles)t[a]||(this._tiles[a].releaseRTT(this.tileManager.map.painter),delete this._tiles[a],i=!0);return i}releaseRTT(e){for(let r in this._tiles){let t=this._tiles[r];(t.tileID.equals(e)||t.tileID.isChildOf(e)||e.isChildOf(t.tileID))&&t.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,r){return r?this._getTerrainCoordsForTileRanges(e,r):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let r={};for(let t of this._renderableTilesKeys){let i=this._tiles[t].tileID,a=e.clone(),o=L0();if(i.canonical.equals(e.canonical))$h(o,0,Bi,Bi,0,0,1);else if(i.canonical.isChildOf(e.canonical)){let s=i.canonical.z-e.canonical.z,l=i.canonical.x-(i.canonical.x>>s<>s<>s;$h(o,0,u,u,0,0,1),Ol(o,o,[-l*u,-n*u,0])}else if(e.canonical.isChildOf(i.canonical)){let s=e.canonical.z-i.canonical.z,l=e.canonical.x-(e.canonical.x>>s<>s<>s;$h(o,0,Bi,Bi,0,0,1),Ol(o,o,[l*u,n*u,0]),Xu(o,o,[1/2**s,1/2**s,0])}else continue;a.terrainRttPosMatrix32f=new Float32Array(o),r[t]=a}return r}_getTerrainCoordsForTileRanges(e,r){let t={};for(let i of this._renderableTilesKeys){let a=this._tiles[i].tileID;if(!this._isWithinTileRanges(a,r))continue;let o=e.clone(),s=L0();if(a.canonical.z===e.canonical.z){let l=e.canonical.x-a.canonical.x+e.wrap*(1<e.canonical.z){let l=a.canonical.z-e.canonical.z,n=a.canonical.x-(a.canonical.x>>l<>l<>l),f=e.canonical.y-(a.canonical.y>>l),h=Bi>>l;$h(s,0,h,h,0,0,1),Ol(s,s,[-n*h+c*Bi,-u*h+f*Bi,0])}else{let l=e.canonical.z-a.canonical.z,n=e.canonical.x-(e.canonical.x>>l<>l<>l)-a.canonical.x,f=(e.canonical.y>>l)-a.canonical.y,h=Bi<a.maxzoom&&(o=a.maxzoom),o=a.minzoom&&!s?.dem;)s=this.findTileInCaches(e.scaledTo(o--).key);return s}findTileInCaches(e){let r=this.tileManager.getTileByID(e);return r||(r=this.tileManager._outOfViewCache.getByKey(e),r)}anyTilesAfterTime(e=hs()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,r){let t=r[e.canonical.z];return!!t&&(e.wrap>t.minWrap||e.wrap=t.minTileXWrapped&&e.canonical.x<=t.maxTileXWrapped&&e.canonical.y>=t.minTileY&&e.canonical.y<=t.maxTileY)}},jM=Bi*(1-1e-12),ZB=class{constructor(e,r,t,i="auto"){this._meshCache={},this.painter=e,this.tileManager=new XB(r),this.options=t,this.exaggeration=typeof t.exaggeration=="number"?t.exaggeration:1,this._terrainSkirtLength=i,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this._elevationSamplerCache=new Map}destroy(){this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null));for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,r,t,i=Bi){let a=e.normalizeCoordinates(r,t,i);if(!a)return 0;let o=this.getElevationSampler(a.tileID);return o?o(a.x,a.y,i):0}getElevationForLngLatZoom(e,r){if(!zF(r,e.wrap()))return 0;let{tileID:t,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(t,i%Bi,a%Bi,Bi)}getElevationForLngLat(e,r){let t=this.getCoverageIndex();if(t){let o=Qo.fromLngLat(e),s=tM(t,this.exaggeration,o.x,o.y);if(s.demLoaded)return s.elevation}let i=Bm(r,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),a=0;for(let o of i)o.canonical.z>a&&(a=Math.min(o.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(e,a)}getElevation(e,r,t,i=Bi){return this.getDEMElevation(e,r,t,i)*this.exaggeration}resetElevationCache(){this._elevationSamplerCache.clear(),this._coverageIndex=void 0}getCoverageIndex(){return this._coverageIndex===void 0&&(this._coverageIndex=this._buildCoverageIndex()),this._coverageIndex}_buildCoverageIndex(){let e=[],r=new Map,t=0,i=0;for(let a of this.tileManager.getRenderableTiles()){if(!a)continue;let{canonical:o,wrap:s}=a.tileID;e.includes(o.z)||e.push(o.z);let l=this.getElevationSampler(a.tileID);r.set(`${s}/${o.z}/${o.x}/${o.y}`,l);let{minElevation:n,maxElevation:u}=this.getMinMaxElevation(a.tileID);t=Math.min(t,n??0),i=Math.max(i,u??0)}return r.size===0?null:(e.sort((a,o)=>o-a),{zooms:e,samplerPerTile:r,minElevation:t-10,maxElevation:i+10})}getElevationSampler(e){let r=e.key,t=this._elevationSamplerCache.get(r);if(t)return t;let i=this.tileManager.getSourceTile(e,!0),a=i?.dem;if(!i||!a)return null;let o=this._getDEMTileMatrix(e,i),s=o[0]*a.dim,l=o[5]*a.dim,n=o[12]*a.dim,u=o[13]*a.dim,c=(f,h,d)=>{let p=d===8192?1:Bi/d;return a.sampleBilinear(f*p*s+n,h*p*l+u)};return this._elevationSamplerCache.set(r,c),c}_getDEMTileMatrix(e,r){let t=`${r.tileID.key}/${e.key}`,i=this._demMatrixCache.get(t);if(i)return i;let a=this.tileManager.getSource().maxzoom,o=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=a?o=e.canonical.z-a:To("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let s=e.canonical.x-(e.canonical.x>>o<>o<0,i=t&&e.canonical.y===0,a=t&&e.canonical.y===(1<{i=to(+i,this.minZoom,this.maxZoom);let a={center:new An(t.lng,t.lat),zoom:i},o=this._helper._lngRange;!this._helper._renderWorldCopies&&o===null&&(o=[-179.9999999999,180-1e-10]);let s=this.tileSize*Vc(a.zoom),l=0,n=s,u=0,c=s,f=0,h=0,{x:d,y:p}=this.size;if(this._helper._latRange){let x=this._helper._latRange;l=um(x[1])*s,n=um(x[0])*s,n-ln&&(_=n-x)}if(o){let x=(u+c)/2,S=g;this._helper._renderWorldCopies&&(S=ch(g,x-s/2,x+s/2));let M=d/2;S-Mc&&(y=c-M)}if(y!==void 0||_!==void 0){let x=new Wr(y??g,_??m);a.center=sg(s,x).wrap()}return a},this.applyConstrain=(t,i)=>this._helper.applyConstrain(t,i),this._helper=new E2({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,i)=>this.defaultConstrain(t,i)},r),this._coveringTilesDetailsProvider=new WB}clone(){let r=new lU;return r.apply(this,!1),r}apply(r,t,i){this._helper.apply(r,t,i)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(r){let t=[new zg(0,r)];if(this._helper._renderWorldCopies){let i=this.screenPointToMercatorCoordinate(new Wr(0,0)),a=this.screenPointToMercatorCoordinate(new Wr(this._helper._width,0)),o=this.screenPointToMercatorCoordinate(new Wr(this._helper._width,this._helper._height)),s=this.screenPointToMercatorCoordinate(new Wr(0,this._helper._height)),l=Math.floor(Math.min(i.x,a.x,o.x,s.x)),n=Math.floor(Math.max(i.x,a.x,o.x,s.x));for(let u=l-1;u<=n+1;u++)u!==0&&t.push(new zg(u,r))}return t}getCameraFrustum(){return T2.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(r){let t=this.screenPointToLocation(this.centerPoint,r),i=r?r.getElevationForLngLat(t,this):0;this._helper.recalculateZoomAndCenter(i)}setLocationAtPoint(r,t,i=this.elevation){let a=i-this.elevation,o=this.screenPointToMercatorCoordinateAtZ(t,a),s=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,0),l=Qo.fromLngLat(r),n=new Qo(l.x-(o.x-s.x),l.y-(o.y-s.y));this.setCenter(n?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(r,t){return t?this.coordinatePoint(Qo.fromLngLat(r),t.getElevationForLngLat(r,this),this._pixelMatrix3D):this.coordinatePoint(Qo.fromLngLat(r))}screenPointToLocation(r,t){var i;return(i=this.screenPointToMercatorCoordinate(r,t))==null?void 0:i.toLngLat()}screenPointToLocationAtElevation(r,t){var i;return(i=this.screenPointToMercatorCoordinateAtZ(r,t-this.elevation))==null?void 0:i.toLngLat()}screenPointToMercatorCoordinate(r,t){if(t){let i=this.screenTerrainPointToMercatorCoordinate(r,t);if(i!=null)return i}return this.screenPointToMercatorCoordinateAtZ(r)}screenTerrainPointToMercatorCoordinate(r,t){let i=t.getCoverageIndex();if(!i)return null;let{near:a,far:o}=this.getRaySegmentFromPixel(r),s=this.worldSize,l=o[0]-a[0],n=o[1]-a[1],u=o[2]-a[2],c={index:i,exaggeration:t.exaggeration,near:a,dx:l,dy:n,dz:u,worldSize:s},f=0,h=1;if(u===0){if(a[2]>i.maxElevation||a[2]h)return null}let d=Math.hypot(l,n),p=to(Math.ceil(d*(h-f)/4),1,512),g=0,m=!i2(c,0);for(let y=0;y<=p;y++){let _=f+(h-f)*y/p;if(!m)m=!i2(c,_);else if(i2(c,_)){let{lo:v,hi:x}=pz(c,i2,g,_,.001/d),S=r2(c,v),M=r2(c,x),C=a[2]+v*u-S.elevation,w=a[2]+x*u-M.elevation,k=S.covered&&C>w?to(v+C*(x-v)/(C-w),v,x):x;return new Qo((a[0]+k*l)/s,(a[1]+k*n)/s,r2(c,k).elevation)}g=_}return null}getRaySegmentFromPixel(r){let t=[r.x,r.y,0,1],i=[r.x,r.y,1,1];pu(t,t,this._pixelMatrixInverse),pu(i,i,this._pixelMatrixInverse);let a=t[3],o=i[3],s=this.elevation;return{near:[t[0]/a,t[1]/a,t[2]/a+s],far:[i[0]/o,i[1]/o,i[2]/o+s]}}screenPointToMercatorCoordinateAtZ(r,t){let i=t||0,{near:a,far:o}=this.getRaySegmentFromPixel(r),s=a[2]===o[2]?0:(i+this.elevation-a[2])/(o[2]-a[2]);return new Qo(Zs.number(a[0],o[0],s)/this.worldSize,Zs.number(a[1],o[1],s)/this.worldSize,i)}coordinatePoint(r,t=0,i=this._pixelMatrix){let a=[r.x*this.worldSize,r.y*this.worldSize,t,1];return pu(a,a,i),new Wr(a[0]/a[3],a[1]/a[3])}getBounds(){let r=Math.max(0,this._helper._height/2-lg(this));return new bh().extend(this.screenPointToLocation(new Wr(0,r))).extend(this.screenPointToLocation(new Wr(this._helper._width,r))).extend(this.screenPointToLocation(new Wr(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new Wr(0,this._helper._height)))}isPointOnMapSurface(r,t){return t?this.screenTerrainPointToMercatorCoordinate(r,t)!=null:r.y>this.height/2-lg(this)}calculatePosMatrix(r,t=!1,i=!1){var a;let o=(a=r.key)!=null?a:cm(r.wrap,r.canonical.z,r.canonical.z,r.canonical.x,r.canonical.y),s=t?this._alignedPosMatrixCache:this._posMatrixCache;if(s.has(o)){let u=s.get(o);return i?u.f32:u.f64}let l=O6(r,this.worldSize);$v(l,t?this._alignedProjMatrix:this._viewProjMatrix,l);let n={f64:l,f32:new Float32Array(l)};return s.set(o,n),i?n.f32:n.f64}calculateFogMatrix(r){let t=r.key,i=this._fogMatrixCacheF32;if(i.has(t))return i.get(t);let a=O6(r,this.worldSize);return $v(a,this._fogMatrix,a),i.set(t,new Float32Array(a)),i.get(t)}calculateCenterFromCameraLngLatAlt(r,t,i,a){return this._helper.calculateCenterFromCameraLngLatAlt(r,t,i,a)}calculateCameraOptionsFromTo(r,t,i,a){let o=Qo.fromLngLat(r,t),s=Qo.fromLngLat(i,a),l=s.x-o.x,n=s.y-o.y,u=s.z-o.z,c=Math.hypot(l,n,u);if(c===0)throw Error("Can't calculate camera options with same From and To");let f=Math.hypot(l,n),h=Ku(this.cameraToCenterDistance/c/this.tileSize),d=Ad(Math.atan2(l,-n)),p=Ad(Math.acos(f/c));return p=u<0?90-p:90+p,{center:s.toLngLat(),elevation:a,zoom:h,pitch:p,bearing:d}}_calculateNearFarZIfNeeded(r,t,i){if(!this._helper.autoCalculateNearFarZ)return;let a=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),o=r-a*this._helper._pixelPerMeter/Math.cos(t),s=a<0?o:r,l=Math.PI/2+this.pitchInRadians,n=rl(this.fov)*(Math.abs(Math.cos(rl(this.roll)))*this.height+Math.abs(Math.sin(rl(this.roll)))*this.width)/this.height*(.5+i.y/this.height),u=Math.sin(n)*s/Math.sin(to(Math.PI-l-n,.01,Math.PI-.01)),c=lg(this),f=Math.atan(c/this._helper.cameraToCenterDistance),h=rl(90-Jp),d=f>h?2*f*(.5+i.y/(c*2)):h,p=Math.sin(d)*s/Math.sin(to(Math.PI-l-d,.01,Math.PI-.01)),g=Math.min(u,p);this._helper._farZ=(Math.cos(Math.PI/2-t)*g+s)*1.01,this._helper._nearZ=this._helper._height/50}_calcMatrices(){let r=this.centerOffset,t=Md(this.worldSize,this.center),i=t.x,a=t.y,o=rl(Math.min(this.pitch,Jp)),s=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(o));this._calculateNearFarZIfNeeded(s,o,r);let l;l=new Float64Array(16),Mx(l,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),Kne(this._invProjMatrix,l),l[8]=-r.x*2/this._helper._width,l[9]=r.y*2/this._helper._height,this._projectionMatrix=O4(l),Xu(l,l,[1,-1,1]),Ol(l,l,[0,0,-this._helper.cameraToCenterDistance]),zp(l,l,-this.rollInRadians),Wv(l,l,this.pitchInRadians),zp(l,l,-this.bearingInRadians),Ol(l,l,[-i,-a,0]),this._mercatorMatrix=Xu([],l,[this.worldSize,this.worldSize,this.worldSize]),Xu(l,l,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=$v(new Float64Array(16),this.clipSpaceToPixelsMatrix,l),Ol(l,l,[0,0,-this.elevation]),this._viewProjMatrix=l,this._invViewProjMatrix=E_([],l);let n=[0,0,-1,1];pu(n,n,this._invViewProjMatrix),this._cameraPosition=[n[0]/n[3],n[1]/n[3],n[2]/n[3]],this._fogMatrix=new Float64Array(16),Mx(this._fogMatrix,this.fovInRadians,this.width/this.height,s,this._helper._farZ),this._fogMatrix[8]=-r.x*2/this.width,this._fogMatrix[9]=r.y*2/this.height,Xu(this._fogMatrix,this._fogMatrix,[1,-1,1]),Ol(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),zp(this._fogMatrix,this._fogMatrix,-this.rollInRadians),Wv(this._fogMatrix,this._fogMatrix,this.pitchInRadians),zp(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),Ol(this._fogMatrix,this._fogMatrix,[-i,-a,0]),Xu(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),Ol(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=$v(new Float64Array(16),this.clipSpaceToPixelsMatrix,l);let u=this._helper._width%2/2,c=this._helper._height%2/2,f=Math.cos(this.bearingInRadians),h=Math.sin(-this.bearingInRadians),d=i-Math.round(i)+f*u+h*c,p=a-Math.round(a)+f*c+h*u,g=new Float64Array(l);if(Ol(g,g,[d>.5?d-1:d,p>.5?p-1:p,0]),this._alignedProjMatrix=g,l=E_(new Float64Array(16),this._pixelMatrix),!l)throw Error("failed to invert matrix");this._pixelMatrixInverse=l,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let r=this.screenPointToMercatorCoordinate(new Wr(0,0)),t=[r.x*this.worldSize,r.y*this.worldSize,0,1];return pu(t,t,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this.cameraToCenterDistance/this.pixelsPerMeter+this.elevation}getCameraLngLat(){let r=q0(1,this.center.lat)*this.worldSize,t=this._helper.cameraToCenterDistance/r;return tF(this.center,this.elevation,this.pitch,this.bearing,t).toLngLat()}lngLatToCameraDepth(r,t){let i=Qo.fromLngLat(r),a=[i.x*this.worldSize,i.y*this.worldSize,t,1];return pu(a,a,this._viewProjMatrix),a[2]/a[3]}getProjectionData(r){let{overscaledTileID:t,aligned:i,applyTerrainMatrix:a}=r,o=this._helper.getMercatorTileCoordinates(t),s=t?this.calculatePosMatrix(t,i,!0):null,l;return l=t?.terrainRttPosMatrix32f&&a?t.terrainRttPosMatrix32f:s||_9(),{mainMatrix:l,tileMercatorCoords:o,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:l,clipAntimeridian:!1}}isLocationOccluded(r){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(r,t,i){return 1}transformLightDirection(r){return N4(r)}getRayDirectionFromPixel(r){throw Error("Not implemented.")}projectTileCoordinates(r,t,i,a){let o=this.calculatePosMatrix(i),s;a==null?(s=[r,t,0,1],JA(s,s,o)):(s=[r,t,a,1],pu(s,s,o));let l=s[3];return{point:new Wr(s[0]/l,s[1]/l),signedDistanceFromCamera:l,isOccluded:!1}}populateCache(r){for(let t of r)this.calculatePosMatrix(t)}getProjectionDataForCustomLayer(r=!0){let t=new Cu(0,0,0,0,0),i=this.getProjectionData({overscaledTileID:t,applyGlobeMatrix:r}),a=O6(t,this.worldSize);$v(a,this._viewProjMatrix,a);let o=[Bi,Bi,this.worldSize/this._helper.pixelsPerMeter],s=L0();return Xu(s,a,o),ar(Ot({},i),{tileMercatorCoords:[0,0,1,1],fallbackMatrix:s,mainMatrix:s})}getFastPathSimpleProjectionMatrix(r){return this.calculatePosMatrix(r)}},Jg=class{get useGlobeControls(){return!1}handlePanInertia(e,r){let t=e.mag(),i=Math.abs(lg(r));return{easingOffset:e.mult(Math.min(i*.75/t,1)),easingCenter:r.center}}handleMapControlsRollPitchBearingZoom(e,r){e.bearingDelta&&r.setBearing(r.bearing+e.bearingDelta),e.pitchDelta&&r.setPitch(r.pitch+e.pitchDelta),e.rollDelta&&r.setRoll(r.roll+e.rollDelta),e.zoomDelta&&r.setZoom(r.zoom+e.zoomDelta)}handleMapControlsPan(e,r,t){e.around.distSqr(r.centerPoint)<.01||r.setLocationAtPoint(t,e.around,e.aroundElevation)}cameraForBoxAndBearing(e,r,t,i,a){return gz(e,r,t,i,a)}handleJumpToCenterZoom(e,r){let t=r.zoom===void 0?e.zoom:+r.zoom;e.zoom!==t&&e.setZoom(+r.zoom),r.center!==void 0&&e.setCenter(An.convert(r.center))}handleEaseTo(e,r){let t=e.zoom,i=e.padding,a={roll:e.roll,pitch:e.pitch,bearing:e.bearing},o={roll:r.roll===void 0?e.roll:r.roll,pitch:r.pitch===void 0?e.pitch:r.pitch,bearing:r.bearing===void 0?e.bearing:r.bearing},s=r.zoom!==void 0,l=!e.isPaddingEqual(r.padding),n=!1,u=s?+r.zoom:e.zoom,c=e.centerPoint.add(r.offsetAsPoint),f=e.screenPointToLocation(c),{center:h,zoom:d}=e.applyConstrain(An.convert(r.center||f),u??t);t2(e,h);let p=Md(e.worldSize,f),g=Md(e.worldSize,h).sub(p),m=Vc(d-t);return n=d!==t,{easeFunc:y=>{if(n&&e.setZoom(Zs.number(t,d,y)),w9(a,o)||mz({startEulerAngles:a,endEulerAngles:o,tr:e,k:y,useSlerp:a.roll!=o.roll}),l&&(e.interpolatePadding(i,r.padding,y),c=e.centerPoint.add(r.offsetAsPoint)),r.around)e.setLocationAtPoint(r.around,r.aroundPoint);else{let _=Vc(e.zoom-t),v=(d>t?Math.min(2,m):Math.max(.5,m))**(1-y),x=sg(e.worldSize,p.add(g.mult(y*v)).mult(_));e.setLocationAtPoint(e.renderWorldCopies?x.wrap():x,c)}},isZooming:n,elevationCenter:h}}handleFlyTo(e,r){let t=r.zoom!==void 0,i=e.zoom,a=e.applyConstrain(An.convert(r.center||r.locationAtOffset),t?+r.zoom:i),o=a.center,s=a.zoom;t2(e,o);let l=e.worldSize,n=Md(l,r.locationAtOffset),u=Md(l,o).sub(n),c=u.mag(),f=Vc(s-i),h=r.minZoom===void 0?e.minZoom:+r.minZoom,d=Math.max(h,e.minZoom),p=Math.min(d,i,s),g=e.applyConstrain(o,p).zoom;return{easeFunc:(m,y,_,v)=>{e.setZoom(m===1?s:i+Ku(y));let x=m===1?o:sg(l,n.add(u.mult(_)));e.setLocationAtPoint(e.renderWorldCopies?x.wrap():x,v)},scaleOfZoom:f,targetCenter:o,scaleOfMinZoom:Vc(g-i),pixelPathLength:c}}},JB=()=>KB||(KB=new vu({type:new Ha(mi.projection.type,"type")})),k2=new wb({fill:new Fd(128,2),line:new Fd(512,0),tile:new Fd(128,32),stencil:new Fd(128,1),circle:3}),qM=class{constructor(){this._tileMeshCache={}}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return rd.projectionGlobe}get vertexShaderPreludeCode(){return rd.projectionMercator.vertexSource}get subdivisionGranularity(){return k2}get useGlobeControls(){return!0}destroy(){}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?"b":""}${e.extendToNorthPole?"n":""}${e.extendToSouthPole?"s":""}`}getMeshFromTileID(e,r,t,i,a){let o=(a==="stencil"?k2.stencil:k2.tile).getGranularityForZoomLevel(r.z),s=r.y===0&&i,l=r.y===(1<0}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}getMeshFromTileID(e,r,t,i,a){return this.currentProjection.getMeshFromTileID(e,r,t,i,a)}setProjection(e){this._transitionable.setValue("type",e?.type||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}},C2=Math.PI*.98,QB=class{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;let e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,r,t,i){let a=`${e.z}_${e.x}_${e.y}_${i?.terrain?"t":""}_${Math.round(t)}`,o=this._cache.get(a);if(o)return o;let s=this._cachePrevious.get(a);if(s)return this._cache.set(a,s),s;let l=this._boundingVolumeFactory(e,r,t,i);return this._cache.set(a,l),this._hadAnyChanges=!0,l}},D2=class uE{constructor(r,t,i,a){this.min=i,this.max=a,this.points=r,this.planes=t}static fromAabb(r,t){let i=[];for(let a=0;a<8;a++)i.push([(a>>0&1)==1?t[0]:r[0],(a>>1&1)==1?t[1]:r[1],(a>>2&1)==1?t[2]:r[2]]);return new uE(i,[[-1,0,0,t[0]],[1,0,0,-r[0]],[0,-1,0,t[1]],[0,1,0,-r[1]],[0,0,-1,t[2]],[0,0,1,-r[2]]],r,t)}static fromCenterSizeAngles(r,t,i){let a=q4([],i[0],i[1],i[2]),o=j4([],[t[0],0,0],a),s=j4([],[0,t[1],0],a),l=j4([],[0,0,t[2]],a),n=[...r],u=[...r];for(let f=0;f<8;f++)for(let h=0;h<3;h++){let d=r[h]+o[h]*((f>>0&1)==1?1:-1)+s[h]*((f>>1&1)==1?1:-1)+l[h]*((f>>2&1)==1?1:-1);n[h]=Math.min(n[h],d),u[h]=Math.max(u[h],d)}let c=[];for(let f=0;f<8;f++){let h=[...r];lh(h,h,Ws([],o,(f>>0&1)==1?1:-1)),lh(h,h,Ws([],s,(f>>1&1)==1?1:-1)),lh(h,h,Ws([],l,(f>>2&1)==1?1:-1)),c.push(h)}return new uE(c,[[...o,-Kl(o,c[0])],[...s,-Kl(s,c[0])],[...l,-Kl(l,c[0])],[-o[0],-o[1],-o[2],-Kl(o,c[7])],[-s[0],-s[1],-s[2],-Kl(s,c[7])],[-l[0],-l[1],-l[2],-Kl(l,c[7])]],n,u)}intersectsFrustum(r){let t=!0,i=this.points.length,a=this.planes.length,o=r.planes.length,s=r.points.length;for(let l=0;l=0&&u++}if(u===0)return 0;u=0&&u++}if(u===0)return 0}return 1}intersectsPlane(r){let t=this.points.length,i=0;for(let a=0;a=0&&i++}return i===t?2:i===0?0:1}},eO=class{constructor(){this._boundingVolumeCache=new QB(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,r,t,i){let a=1<4}allowWorldCopies(){return!1}getTileBoundingVolume(e,r,t,i){return this._boundingVolumeCache.getTileBoundingVolume(e,r,t,i)}_computeTileBoundingVolume(e,r,t,i){var a,o;let s=Math.min(0,t),l=Math.max(0,t);if(i?.terrain){let n=new Cu(e.z,r,e.z,e.x,e.y),u=i.terrain.getMinMaxElevation(n);s=(a=u.minElevation)!=null?a:s,l=Math.max((o=u.maxElevation)!=null?o:l,l)}if(s/=mc,l/=mc,s+=1,l+=1,e.z<=0)return D2.fromAabb([-l,-l,-l],[l,l,l]);if(e.z===1)return D2.fromAabb([e.x===0?-l:0,e.y===0?0:-l,-l],[e.x===0?0:l,e.y===0?l:0,l]);{let n=[r0(0,0,e.x,e.y,e.z),r0(Bi,0,e.x,e.y,e.z),r0(Bi,Bi,e.x,e.y,e.z),r0(0,Bi,e.x,e.y,e.z)],u=[];for(let A of n)u.push(Ws([],A,l));if(l!==s)for(let A of n)u.push(Ws([],A,s));e.y===0&&u.push([0,1,0]),e.y===(1<=(1<{let a=to(t.lat,-Wh,Wh),o=to(+i,this.minZoom+Lu(0,a),this.maxZoom);return{center:new An(t.lng,a),zoom:o}},this.applyConstrain=(t,i)=>this._helper.applyConstrain(t,i),this._helper=new E2({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,i)=>this.defaultConstrain(t,i)},r),this._coveringTilesDetailsProvider=new eO}clone(){let r=new uU;return r.apply(this,!1),r}apply(r,t){this._helper.apply(r,t)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixF64}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let r=fs();return r[0]=this._cameraPosition[0],r[1]=this._cameraPosition[1],r[2]=this._cameraPosition[2],r}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(r){let{overscaledTileID:t,applyGlobeMatrix:i}=r,a=this._helper.getMercatorTileCoordinates(t);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:a,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!i,fallbackMatrix:this._globeViewProjMatrix32f,clipAntimeridian:t?.canonical.z===0}}_computeClippingPlane(r){let t=this.pitchInRadians,i=this.cameraToCenterDistance/r,a=Math.sin(t)*i,o=Math.cos(t)*i+1,s=1/Math.sqrt(a*a+o*o)*1,l=-a,n=o,u=Math.sqrt(l*l+n*n);l/=u,n/=u;let c=[0,l,n];U4(c,c,[0,0,0],-this.bearingInRadians),O1(c,c,[0,0,0],-1*this.center.lat*Math.PI/180),Yv(c,c,[0,0,0],this.center.lng*Math.PI/180);let f=1/ap(c);return Ws(c,c,f),[...c,-s*f]}isLocationOccluded(r){return!this.isSurfacePointVisible(ru(r))}transformLightDirection(r){let t=this._helper._center.lng*Math.PI/180,i=this._helper._center.lat*Math.PI/180,a=Math.cos(i),o=[Math.sin(t)*a,Math.sin(i),Math.cos(t)*a],s=[o[2],0,-o[0]],l=[0,0,0];uf(l,s,o),qc(s,s),qc(l,l);let n=[s[0]*r[0]+l[0]*r[1]+o[0]*r[2],s[1]*r[0]+l[1]*r[1]+o[1]*r[2],s[2]*r[0]+l[2]*r[1]+o[2]*r[2]],u=[0,0,0];return qc(u,n),u}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(r,t,i){let a=eF(r,t,i.canonical),o=ooe(a.x,a.y);return this.getCircleRadiusCorrection()/Math.cos(o[1])}projectTileCoordinates(r,t,i,a){let o=i.canonical,s=r0(r,t,o.x,o.y,o.z),l=1+(a??0)/mc,n=s[0]*l,u=s[1]*l,c=s[2]*l,f=[n,u,c,1];pu(f,f,this._globeViewProjMatrixF64);let h;if(l<=1){let d=this._cachedClippingPlane;h=d[0]*s[0]+d[1]*s[1]+d[2]*s[2]+d[3]<0}else h=this._isLineOfSightBlocked(n,u,c);return{point:new Wr(f[0]/f[3],f[1]/f[3]),signedDistanceFromCamera:f[3],isOccluded:h}}_isLineOfSightBlocked(r,t,i){let a=this._cameraPosition,o=r-a[0],s=t-a[1],l=i-a[2],n=o*o+s*s+l*l;if(n===0)return!1;let u=to(-(a[0]*o+a[1]*s+a[2]*l)/n,0,1),c=a[0]+u*o,f=a[1]+u*s,h=a[2]+u*l;return c*c+f*f+h*h<1}_calcMatrices(){let r=Nm(this.worldSize,this.center.lat),t=L0();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+r*2),Mx(t,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let i=this.centerOffset;t[8]=-i.x*2/this._helper._width,t[9]=i.y*2/this._helper._height,this._projectionMatrix=O4(t),this._globeProjMatrixInverted=L0(),E_(this._globeProjMatrixInverted,t),Ol(t,t,[0,0,-this.cameraToCenterDistance]),zp(t,t,this.rollInRadians),Wv(t,t,-this.pitchInRadians),zp(t,t,this.bearingInRadians),Ol(t,t,[0,0,-r]);let a=fs();a[0]=r,a[1]=r,a[2]=r,Wv(t,t,this.center.lat*Math.PI/180),c9(t,t,-this.center.lng*Math.PI/180),Xu(t,t,a),this._globeViewProjMatrixF64=t,this._globeViewProjMatrix32f=new Float32Array(t),this._globeViewProjMatrixF64Inverted=L0(),E_(this._globeViewProjMatrixF64Inverted,t);let o=fs();this._cameraPosition=fs(),this._cameraPosition[2]=this.cameraToCenterDistance/r,U4(this._cameraPosition,this._cameraPosition,o,-this.rollInRadians),O1(this._cameraPosition,this._cameraPosition,o,this.pitchInRadians),U4(this._cameraPosition,this._cameraPosition,o,-this.bearingInRadians),lh(this._cameraPosition,this._cameraPosition,[0,0,1]),O1(this._cameraPosition,this._cameraPosition,o,-this.center.lat*Math.PI/180),Yv(this._cameraPosition,this._cameraPosition,o,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(r);let s=O4(this._globeViewProjMatrixF64Inverted);Xu(s,s,[1,1,-1]),this._cachedFrustum=T2.fromInvProjectionMatrix(s,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(r){To("calculateFogMatrix is not supported on globe projection.");let t=L0();return Hh(t),t}getVisibleUnwrappedCoordinates(r){return[new zg(0,r)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(r){if(r){To("terrain is not fully supported on vertical perspective projection.");return}this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return(ap(this._cameraPosition)-1)*mc}getCameraLngLat(){let r=fs();return qc(r,this._cameraPosition),qg(r)}lngLatToCameraDepth(r,t){let i=ru(r);Ws(i,i,1+t/mc);let a=Bp();return pu(a,[i[0],i[1],i[2],1],this._globeViewProjMatrixF64),a[2]/a[3]}populateCache(r){}getBounds(){let r=this.width*.5,t=this.height*.5,i=[new Wr(0,0),new Wr(r,0),new Wr(this.width,0),new Wr(this.width,t),new Wr(this.width,this.height),new Wr(r,this.height),new Wr(0,this.height),new Wr(0,t)],a=[];for(let f of i)a.push(this.unprojectScreenPoint(f));let o=0,s=0,l=0,n=0,u=this.center;for(let f of a){let h=Df(u.lng,f.lng),d=Df(u.lat,f.lat);ho&&(o=h),dl&&(l=d)}let c=[u.lng+s,u.lat+n,u.lng+o,u.lat+l];return this.isSurfacePointOnScreen([0,1,0])&&(c[3]=90,c[0]=-180,c[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(c[1]=-90,c[0]=-180,c[2]=180),new bh(c)}calculateCenterFromCameraLngLatAlt(r,t,i,a){return this._helper.calculateCenterFromCameraLngLatAlt(r,t,i,a)}calculateCameraOptionsFromTo(r,t,i,a){let o=An.convert(i),s=ru(An.convert(r));Ws(s,s,1+t/mc);let l=ru(o),n=Ws(fs(),l,1+a/mc),u=d9(fs(),s,l),c=ap(u);if(c=-_&&g<=_,x=y>=-_&&y<=_,S,M;if(v&&x){let A=this.center.lng*Math.PI/180,b=this.center.lat*Math.PI/180,E=F_(h,A),T=F_(g,b),F=F_(d,A),D=F_(y,b);E+T=0}isSurfacePointOnScreen(r){if(!this.isSurfacePointVisible(r))return!1;let t=Bp();return pu(t,[...r,1],this._globeViewProjMatrixF64),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3],t[0]>-1&&t[0]<1&&t[1]>-1&&t[1]<1&&t[2]>-1&&t[2]<1}unprojectScreenPoint(r){let t=this._cameraPosition,i=this.getRayDirectionFromPixel(r),a=n2(t,i);if(a){let c=fs();lh(c,t,[i[0]*a.tMin,i[1]*a.tMin,i[2]*a.tMin]);let f=fs();return qc(f,c),qg(f)}let o=this._cachedClippingPlane,s=o[0]*i[0]+o[1]*i[1]+o[2]*i[2],l=-G4(o,t)/s,n=fs();if(l>0)lh(n,t,[i[0]*l,i[1]*l,i[2]*l]);else{let c=fs();lh(c,t,[i[0]*2,i[1]*2,i[2]*2]);let f=G4(this._cachedClippingPlane,c);Sd(n,c,[this._cachedClippingPlane[0]*f,this._cachedClippingPlane[1]*f,this._cachedClippingPlane[2]*f])}let u=hoe(o);return qg(doe(u.center,u.radius,n))}getProjectionDataForCustomLayer(r=!0){let t=this.getProjectionData({overscaledTileID:new Cu(0,0,0,0,0),applyGlobeMatrix:r});return t.tileMercatorCoords=[0,0,1,1],t}getFastPathSimpleProjectionMatrix(r){}},$M=class cU{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(r){this._helper.setMinZoom(r)}setMaxZoom(r){this._helper.setMaxZoom(r)}setMinPitch(r){this._helper.setMinPitch(r)}setMaxPitch(r){this._helper.setMaxPitch(r)}setRenderWorldCopies(r){this._helper.setRenderWorldCopies(r)}setBearing(r){this._helper.setBearing(r)}setPitch(r){this._helper.setPitch(r)}setRoll(r){this._helper.setRoll(r)}setFov(r){this._helper.setFov(r)}setZoom(r){this._helper.setZoom(r)}setCenter(r){this._helper.setCenter(r)}setElevation(r){this._helper.setElevation(r)}setMinElevationForCurrentTile(r){this._helper.setMinElevationForCurrentTile(r)}setPadding(r){this._helper.setPadding(r)}interpolatePadding(r,t,i){this._helper.interpolatePadding(r,t,i)}isPaddingEqual(r){return this._helper.isPaddingEqual(r)}resize(r,t,i=!0){this._helper.resize(r,t,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(r){this._helper.setMaxBounds(r)}setConstrainOverride(r){this._helper.setConstrainOverride(r)}overrideNearFarZ(r,t){this._helper.overrideNearFarZ(r,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(r){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),r)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(r){this._globeness=r,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(r){this._globeness=1,this.defaultConstrain=(t,i)=>this.currentTransform.defaultConstrain(t,i),this.applyConstrain=(t,i)=>this._helper.applyConstrain(t,i),this._helper=new E2({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,i)=>this.defaultConstrain(t,i)},r),this._globeness=1,this._mercatorTransform=new Kg,this._verticalPerspectiveTransform=new HM}clone(){let r=new cU;return r._globeness=this._globeness,r.apply(this,!1),r}apply(r,t){this._helper.apply(r,t),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(r){let t=this._mercatorTransform.getProjectionData(r),i=this._verticalPerspectiveTransform.getProjectionData(r);return{mainMatrix:this.isGlobeRendering?i.mainMatrix:t.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:r.applyGlobeMatrix?this._globeness:0,fallbackMatrix:t.fallbackMatrix,clipAntimeridian:i.clipAntimeridian}}isLocationOccluded(r){return this.currentTransform.isLocationOccluded(r)}transformLightDirection(r){return this.currentTransform.transformLightDirection(r)}getPixelScale(){return Xv(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return Xv(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(r,t,i){let a=this._mercatorTransform.getPitchedTextCorrection(r,t,i),o=this._verticalPerspectiveTransform.getPitchedTextCorrection(r,t,i);return Xv(a,o,this._globeness)}projectTileCoordinates(r,t,i,a){return this.currentTransform.projectTileCoordinates(r,t,i,a)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(r){return this.currentTransform.calculateFogMatrix(r)}getVisibleUnwrappedCoordinates(r){return this.currentTransform.getVisibleUnwrappedCoordinates(r)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(r){this.currentTransform.recalculateZoomAndCenter(r)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this.currentTransform.getCameraAltitude()}getCameraLngLat(){return this.currentTransform.getCameraLngLat()}lngLatToCameraDepth(r,t){return this.currentTransform.lngLatToCameraDepth(r,t)}populateCache(r){this._mercatorTransform.populateCache(r),this._verticalPerspectiveTransform.populateCache(r)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(r,t,i,a){return this._helper.calculateCenterFromCameraLngLatAlt(r,t,i,a)}calculateCameraOptionsFromTo(r,t,i,a){return this.currentTransform.calculateCameraOptionsFromTo(r,t,i,a)}setLocationAtPoint(r,t,i){if(!this.isGlobeRendering){this._mercatorTransform.setLocationAtPoint(r,t,i),this.apply(this._mercatorTransform,!1);return}this._verticalPerspectiveTransform.setLocationAtPoint(r,t,i),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(r,t){return this.currentTransform.locationToScreenPoint(r,t)}screenPointToMercatorCoordinate(r,t){return this.currentTransform.screenPointToMercatorCoordinate(r,t)}screenTerrainPointToMercatorCoordinate(r,t){return this.currentTransform.screenTerrainPointToMercatorCoordinate(r,t)}screenPointToLocation(r,t){return this.currentTransform.screenPointToLocation(r,t)}screenPointToLocationAtElevation(r,t){return this.currentTransform.screenPointToLocationAtElevation(r,t)}isPointOnMapSurface(r,t){return this.currentTransform.isPointOnMapSurface(r,t)}getRayDirectionFromPixel(r){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(r)}getProjectionDataForCustomLayer(r=!0){let t=this._mercatorTransform.getProjectionDataForCustomLayer(r);if(!this.isGlobeRendering)return t;let i=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(r);return i.fallbackMatrix=t.mainMatrix,i.projectionTransition=this._globeness,i}getFastPathSimpleProjectionMatrix(r){return this.currentTransform.getFastPathSimpleProjectionMatrix(r)}},WM=class wp{get useGlobeControls(){return!0}handlePanInertia(r,t){let i=voe(r,t);return Math.abs(i.lng-t.center.lng)>180&&(i.lng=t.center.lng+179.5*Math.sign(i.lng-t.center.lng)),{easingCenter:i,easingOffset:new Wr(0,0)}}handleMapControlsRollPitchBearingZoom(r,t){let i=r.around,a=t.screenPointToLocation(i);r.bearingDelta&&t.setBearing(t.bearing+r.bearingDelta),r.pitchDelta&&t.setPitch(t.pitch+r.pitchDelta),r.rollDelta&&t.setRoll(t.roll+r.rollDelta);let o=t.zoom;r.zoomDelta&&t.setZoom(t.zoom+r.zoomDelta);let s=t.zoom-o;if(s===0)return;let l=Df(t.center.lng,a.lng),n=l/(Math.abs(l/180)+1),u=Df(t.center.lat,a.lat),c=t.getRayDirectionFromPixel(i),f=t.cameraPosition,h=Kl(f,c)*-1,d=fs();lh(d,f,[c[0]*h,c[1]*h,c[2]*h]);let p=ap(d),g=p-1,m=Math.exp(-Math.max(g-.3,0)*.5),y=P_(p,.95,.999,0,1),_=Nm(t.worldSize,t.center.lat)/Math.min(t.width,t.height),v=P_(_,.9,.5,1,.25),x=Math.min(m,Xv(1,v,y)),S=(1-Vc(-s))*x,M=t.center.lat,C=t.zoom,w=new An(t.center.lng+n*S,to(t.center.lat+u*S,-Wh,Wh));t.setLocationAtPoint(a,i);let k=t.center,A=P_(Math.abs(l),45,85,0,1),b=Math.max(A,y)**.25,E=Df(k.lng,w.lng),T=Df(k.lat,w.lat);t.setCenter(new An(k.lng+E*b,k.lat+T*b).wrap()),t.setZoom(C+Lu(M,t.center.lat))}handleMapControlsPan(r,t,i){r.panDelta&&coe(t,i,t.isPointOnMapSurface(r.around)?r.around:t.centerPoint,r.panDelta)}cameraForBoxAndBearing(r,t,i,a,o){let s=gz(r,t,i,a,o),l=t.left/o.width*2-1,n=(o.width-t.right)/o.width*2-1,u=t.top/o.height*-2+1,c=(o.height-t.bottom)/o.height*-2+1,f=Df(i.getWest(),i.getEast())<0,h=f?i.getEast():i.getWest(),d=f?i.getWest():i.getEast(),p=Math.max(i.getNorth(),i.getSouth()),g=Math.min(i.getNorth(),i.getSouth()),m=h+Df(h,d)*.5,y=p+Df(p,g)*.5,_=o.clone();_.setCenter(s.center),_.setBearing(s.bearing),_.setPitch(0),_.setRoll(0),_.setZoom(s.zoom);let v=_.modelViewProjectionMatrix,x=[ru(i.getNorthWest()),ru(i.getNorthEast()),ru(i.getSouthWest()),ru(i.getSouthEast()),ru(new An(d,y)),ru(new An(h,y)),ru(new An(m,p)),ru(new An(m,g))],S=ru(s.center),M=1/0;for(let C of x)l<0&&(M=wp.getLesserNonNegativeNonNull(M,wp.solveVectorScale(C,S,v,"x",l))),n>0&&(M=wp.getLesserNonNegativeNonNull(M,wp.solveVectorScale(C,S,v,"x",n))),u>0&&(M=wp.getLesserNonNegativeNonNull(M,wp.solveVectorScale(C,S,v,"y",u))),c<0&&(M=wp.getLesserNonNegativeNonNull(M,wp.solveVectorScale(C,S,v,"y",c)));if(!Number.isFinite(M)||M===0){vz();return}return s.zoom=Math.min(_.zoom+Ku(M),r.maxZoom),s}handleJumpToCenterZoom(r,t){let i=r.center.lat,a=r.applyConstrain(t.center?An.convert(t.center):r.center,r.zoom).center;r.setCenter(a.wrap());let o=t.zoom===void 0?r.zoom+Lu(i,a.lat):+t.zoom;r.zoom!==o&&r.setZoom(o)}handleEaseTo(r,t){let i=r.zoom,a=r.center,o=r.padding,s={roll:r.roll,pitch:r.pitch,bearing:r.bearing},l={roll:t.roll===void 0?r.roll:t.roll,pitch:t.pitch===void 0?r.pitch:t.pitch,bearing:t.bearing===void 0?r.bearing:t.bearing},n=t.zoom!==void 0,u=!r.isPaddingEqual(t.padding),c=!1,f=t.center?An.convert(t.center):a,h=r.applyConstrain(f,i).center;t2(r,h);let d=r.clone();d.setCenter(h),d.setZoom(n?+t.zoom:i+Lu(a.lat,f.lat)),d.setBearing(t.bearing);let p=new Wr(to(r.centerPoint.x+t.offsetAsPoint.x,0,r.width),to(r.centerPoint.y+t.offsetAsPoint.y,0,r.height));d.setLocationAtPoint(h,p);let g=(t.offset&&t.offsetAsPoint.mag())>0?d.center:h,m=n?+t.zoom:i+Lu(a.lat,g.lat),y=i+Lu(a.lat,0),_=m+Lu(g.lat,0),v=Df(a.lng,g.lng),x=Df(a.lat,g.lat),S=Vc(_-y);return c=m!==i,{easeFunc:M=>{if(w9(s,l)||mz({startEulerAngles:s,endEulerAngles:l,tr:r,k:M,useSlerp:s.roll!=l.roll}),u&&r.interpolatePadding(o,t.padding,M),t.around)To("Easing around a point is not supported under globe projection."),r.setLocationAtPoint(t.around,t.aroundPoint);else{let C=M*(_>y?Math.min(2,S):Math.max(.5,S))**(1-M),w=bz(a,v,x,C);r.setCenter(w.wrap())}if(c){let C=Zs.number(y,_,M)+Lu(0,r.center.lat);r.setZoom(C)}},isZooming:c,elevationCenter:g}}handleFlyTo(r,t){let i=t.zoom!==void 0,a=r.center,o=r.zoom,s=r.padding,l=!r.isPaddingEqual(t.padding),n=r.applyConstrain(An.convert(t.center||t.locationAtOffset),o).center,u=i?+t.zoom:r.zoom+Lu(r.center.lat,n.lat),c=r.clone();c.setCenter(n),c.setZoom(u),c.setBearing(t.bearing);let f=new Wr(to(r.centerPoint.x+t.offsetAsPoint.x,0,r.width),to(r.centerPoint.y+t.offsetAsPoint.y,0,r.height));c.setLocationAtPoint(n,f);let h=c.center;t2(r,h);let d=noe(r,a,h),p=o+Lu(a.lat,0),g=u+Lu(h.lat,0),m=Vc(g-p),y=typeof t.minZoom=="number"?+t.minZoom:r.minZoom,_=Math.max(y,r.minZoom)+Lu(h.lat,0),v=Math.min(_,p,g)+Lu(0,h.lat),x=r.applyConstrain(h,v).zoom+Lu(h.lat,0),S=Vc(x-p),M=Df(a.lng,h.lng),C=Df(a.lat,h.lat);return{easeFunc:(w,k,A,b)=>{let E=bz(a,M,C,A);l&&r.interpolatePadding(s,t.padding,w);let T=w===1?h:E;r.setCenter(T.wrap());let F=p+Ku(k);r.setZoom(w===1?u:F+Lu(0,T.lat))},scaleOfZoom:m,targetCenter:h,scaleOfMinZoom:S,pixelPathLength:d}}static solveVectorScale(r,t,i,a,o){let s=o,l=a==="x"?[i[0],i[4],i[8],i[12]]:[i[1],i[5],i[9],i[13]],n=[i[3],i[7],i[11],i[15]],u=r[0]*l[0]+r[1]*l[1]+r[2]*l[2],c=r[0]*n[0]+r[1]*n[1]+r[2]*n[2],f=t[0]*l[0]+t[1]*l[1]+t[2]*l[2],h=t[0]*n[0]+t[1]*n[1]+t[2]*n[2],d=(f+l[3]-s*h-s*n[3])/(f-u-s*h+s*c);return f+s*c===u+s*h||n[3]*(u-f)+l[3]*(h-c)+u*h===f*c?null:d}static getLesserNonNegativeNonNull(r,t){return t!==null&&t>=0&&t{for(let o in this.tileManagers){let s=this.tileManagers[o].getSource().type;(s==="vector"||s==="geojson")&&this.tileManagers[o].reload()}},this.map=e,this.dispatcher=new bM(VA(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(o,s)=>this.getGlyphs(o,s)),this.dispatcher.registerMessageHandler("GI",(o,s)=>this.getImages(o,s)),this.dispatcher.registerMessageHandler("GDA",(o,s)=>this.getDashes(o,s)),this.imageManager=new Kz,this.imageManager.setEventedParent(this),this.imageManager.setMissingImageResolver(e._missingStyleImageResolver),this.patternAtlas=new Jz(this.imageManager);let a=((t=e._container)==null?void 0:t.lang)||typeof document<"u"&&((i=document.documentElement)==null?void 0:i.lang)||void 0;this.glyphManager=new nB(e._requestManager,r.localIdeographFontFamily,a),this.lineAtlas=new hB(256,512),this.crossTileSymbolIndex=new zM,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",X4()),jg().on(x2,this._rtlPluginLoaded),this.on("data",o=>{if(o.dataType!=="source"||o.sourceDataType!=="metadata")return;let s=this.tileManagers[o.sourceId];if(!s)return;let l=s.getSource();if(l?.vectorLayerIds)for(let n in this._layers){let u=this._layers[n];u.source===l.id&&this._validateLayer(u)}})}_setInitialValues(){var e;this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new jx,this._imagesListDirty=!1,this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this._symbolPlacementTriggered=!1,this._placedProjectionTransition=void 0,this.crossTileSymbolIndex=new(((e=this.crossTileSymbolIndex)==null?void 0:e.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(e,r){var t,i,a;this._checkLoaded();let o=r===null?(a=(i=(t=this.stylesheet.state)==null?void 0:t[e])==null?void 0:i.default)!=null?a:null:r;if(Td(o,this._globalState[e]))return this;this._globalState[e]=o,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();let r=[];for(let t in e)Td(this._globalState[t],e[t].default)||(r.push(t),this._globalState[t]=e[t].default);this._applyGlobalStateChanges(r)}_applyGlobalStateChanges(e){if(e.length===0)return;let r=new Set,t={};for(let i of e){t[i]=this._globalState[i];for(let a in this._layers){let o=this._layers[a],s=o.getLayoutAffectingGlobalStateRefs(),l=o.getPaintAffectingGlobalStateRefs(),n=o.getVisibilityAffectingGlobalStateRefs();if(s.has(i)&&r.add(o.source),l.has(i))for(let{name:u,value:c}of l.get(i))this._updatePaintProperty(o,u,c);n?.has(i)&&(o.recalculateVisibility(),this._updateLayer(o))}}this.dispatcher.broadcast("UGS",t);for(let i in this.tileManagers)r.has(i)&&(this._reloadSource(i),this._changed=!0)}loadURL(e){return Xr(this,arguments,function*(r,t={},i){this.fire(new Nf("dataloading")),t.validate=typeof t.validate!="boolean"||t.validate,this._loadStyleRequest=new AbortController;let a=this._loadStyleRequest;try{let o=yield this.map._requestManager.transformRequest(r,"Style");Y4(a.signal);let s=yield vg(o,a);this._loadStyleRequest===a&&(this._loadStyleRequest=null),this._load(s.data,t,i)}catch(o){this._loadStyleRequest===a&&(this._loadStyleRequest=null),o&&!a.signal.aborted&&this.fire(new Ln(Zu(o)))}})}loadJSON(e,r={},t){this.fire(new Nf("dataloading")),this._frameRequest=new AbortController,yc.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,r.validate=r.validate!==!1,this._load(e,r,t)}).catch(()=>{})}loadEmpty(){this.fire(new Nf("dataloading")),this._load(tO,{validate:!1})}_load(e,r,t){var i,a,o;let s=r.transformStyle?r.transformStyle(t,e):e;if(!(r.validate&&AL(this,s))){s=Ot({},s),this._loaded=!0,this.stylesheet=s;for(let l in s.sources)this.addSource(l,s.sources[l],{validate:!1});s.sprite?this._loadSprite(s.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(s.glyphs),this.glyphManager.setFontFaces(s["font-faces"]),this._createLayers(),this.light=new lB((i=this.stylesheet.light)!=null?i:{},this._globalState),this._setProjectionInternal(((a=this.stylesheet.projection)==null?void 0:a.type)||"mercator"),this.sky=new fB(this.stylesheet.sky,this._globalState),this.map.setTerrain((o=this.stylesheet.terrain)!=null?o:null,{validate:!1}),this.fire(new Nf("data")),this.fire(new h2)}}_createLayers(){var e,r,t;let i=L5(this.stylesheet.layers);this.setGlobalState((e=this.stylesheet.state)!=null?e:null),this.dispatcher.broadcast("SL",i),this._order=i.map(a=>a.id),this._layers={},this._serializedLayers=null;for(let a of i){let o=$6(a,this._globalState);if(o.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=o,Gx(o)&&this.tileManagers[o.source]){let s=(t=(r=a.paint)==null?void 0:r["raster-fade-duration"])!=null?t:o.paint.get("raster-fade-duration");this.tileManagers[o.source].setRasterFadeDuration(s)}}}_loadSprite(e,r=!1,t=void 0){return Xr(this,null,function*(){this.imageManager.setLoaded(!1);let i=new AbortController;this._spriteRequest=i;let a;try{let o=yield rne(e,this.map._requestManager,this.map.getPixelRatio(),i);if(!o)return;for(let s in o){let{loaded:l,removed:n}=this.imageManager.setSpriteImages(s,o[s]);this._markImagesChanged(n),r&&this._markImagesChanged(l)}}catch(o){a=o,i.signal.aborted||this.fire(new Ln(a))}finally{this._spriteRequest=null,this.imageManager.setLoaded(!0),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this.imageManager.listImages()),this.fire(new Nf("data")),t?.(a)}})}_unloadSprite(){this._markImagesChanged(this.imageManager.removeAllSpriteImages()),this._imagesListDirty=!0,this._changed=!0,this.fire(new Nf("data"))}_validateLayer(e){let r=this.tileManagers[e.source];if(!r)return;let t=e.sourceLayer;if(!t)return;let i=r.getSource();(i.type==="geojson"||i.vectorLayerIds&&!i.vectorLayerIds.includes(t))&&this.fire(new Ln(Error(`Source layer "${t}" does not exist on source "${i.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.tileManagers)if(!this.tileManagers[e].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(e,r=!1){let t=this._serializedAllLayers();if(!e||e.length===0)return Object.values(r?cf(t):t);let i=[];for(let a of e)if(t[a]){let o=r?cf(t[a]):t[a];i.push(o)}return i}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};let r=Object.keys(this._layers);for(let t of r){let i=this._layers[t];i.type!=="custom"&&(e[t]=i.serialize())}return e}hasTransitions(){var e,r,t;if((e=this.light)!=null&&e.hasTransition()||(r=this.sky)!=null&&r.hasTransition()||(t=this.projection)!=null&&t.hasTransition())return!0;for(let i in this.tileManagers)if(this.tileManagers[i].hasTransition())return!0;for(let i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading.")}update(e){if(!this._loaded)return;let r=this._changed;if(r){this._imagesListDirty&&(this._imagesListDirty=(this.dispatcher.broadcast("SI",this.imageManager.listImages()),!1));let a=Object.keys(this._updatedLayers),o=Object.keys(this._removedLayers);(a.length||o.length)&&this._updateWorkerLayers(a,o);for(let s in this._updatedSources){let l=this._updatedSources[s];if(l==="reload")this._reloadSource(s);else if(l==="clear")this._clearSource(s);else throw Error(`Invalid action ${l}`)}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let s in this._updatedPaintProps)this._layers[s].updateTransitions(e);this._resetUpdates()}let t={};for(let a in this.tileManagers){let o=this.tileManagers[a];t[a]=o.used,o.used=!1}let i=this.imageManager.listImages();for(let a of this._order){let o=this._layers[a];o.recalculate(e,i),!o.isHidden(e.zoom)&&o.source&&(this.tileManagers[o.source].used=!0)}for(let a in t){let o=this.tileManagers[a];!!t[a]!=!!o.used&&o.fire(new zs("data",{sourceDataType:"visibility",sourceId:a}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,r&&this.fire(new Nf("data"))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let r in this.tileManagers)this.tileManagers[r].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,r){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:r})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,r={}){var t;this._checkLoaded();let i=this.serialize();if(e=r.transformStyle?r.transformStyle(i,e):e,((t=r.validate)!=null?t:!0)&&AL(this,e))return!1;e=cf(e),e.layers=L5(e.layers);let a=ene(i,e),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(o.operations.length===0)return!1;for(let s of o.operations)s();return this.stylesheet=e,this._serializedLayers=null,this.fire(new h2({style:this})),!0}_getOperationsToPerform(e){let r=[],t=[];for(let i of e)switch(i.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":r.push(()=>this.addLayer.apply(this,i.args));break;case"removeLayer":r.push(()=>this.removeLayer.apply(this,i.args));break;case"setPaintProperty":r.push(()=>this.setPaintProperty.apply(this,i.args));break;case"setLayoutProperty":r.push(()=>this.setLayoutProperty.apply(this,i.args));break;case"setFilter":r.push(()=>this.setFilter.apply(this,i.args));break;case"addSource":r.push(()=>this.addSource.apply(this,i.args));break;case"removeSource":r.push(()=>this.removeSource.apply(this,i.args));break;case"setLayerZoomRange":r.push(()=>this.setLayerZoomRange.apply(this,i.args));break;case"setLight":r.push(()=>this.setLight.apply(this,i.args));break;case"setGeoJSONSourceData":r.push(()=>this.setGeoJSONSourceData.apply(this,i.args));break;case"setGlyphs":r.push(()=>this.setGlyphs.apply(this,i.args));break;case"setFontFaces":r.push(()=>this.setFontFaces.apply(this,i.args));break;case"setSprite":r.push(()=>this.setSprite.apply(this,i.args));break;case"setTerrain":r.push(()=>this.map.setTerrain.apply(this,i.args));break;case"setSky":r.push(()=>this.setSky.apply(this,i.args));break;case"setProjection":this.setProjection.apply(this,i.args);break;case"setGlobalState":r.push(()=>this.setGlobalState.apply(this,i.args));break;case"setTransition":r.push(()=>{});break;default:t.push(i.command)}return{operations:r,unimplemented:t}}addImage(e,r){if(this.getImage(e)){this.fire(new Ln(Error(`An image named "${e}" already exists.`)));return}this.imageManager.addImage(e,r),this._afterImageUpdated(e)}updateImage(e,r){this.imageManager.updateImage(e,r)}getImage(e){return this.imageManager.getImage(e)}setMissingImageResolver(e){this.imageManager.setMissingImageResolver(e)}removeImage(e){if(!this.getImage(e)){this.fire(new Ln(Error(`An image named "${e}" does not exist.`)));return}this.imageManager.removeImage(e),this._afterImageUpdated(e)}_markImagesChanged(e){for(let r of e)this._changedImages[r]=!0}_afterImageUpdated(e){this._changedImages[e]=!0,this._imagesListDirty=!0,this._changed=!0,this.fire(new Nf("data"))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,r,t={}){var i;if(this._checkLoaded(),this.tileManagers[e]!==void 0)throw Error(`Source "${e}" already exists.`);if(!r.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(PT.has(r.type)&&this._validate(Hc.source,`sources.${e}`,r,null,t))return;(i=this.map)!=null&&i._collectResourceTiming&&(r.collectResourceTiming=!0);let a=this.tileManagers[e]=new A2(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,()=>({isSourceLoaded:a.loaded(),source:a.serialize(),sourceId:e})),a.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);for(let t in this._layers)if(this._layers[t].source===e)return this.fire(new Ln(Error(`Source "${e}" cannot be removed while layer "${t}" is using it.`)));let r=this.tileManagers[e];delete this.tileManagers[e],delete this._updatedSources[e],r.fire(new zs("data",{sourceDataType:"metadata",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,r){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);let t=this.tileManagers[e].getSource();if(t.type!=="geojson")throw Error(`geojsonSource.type is ${t.type}, which is !== 'geojson`);t.setData(r),this._changed=!0}getSource(e){var r;return(r=this.tileManagers[e])==null?void 0:r.getSource()}addLayer(e,r,t={}){this._checkLoaded();let i=e.id;if(this.getLayer(i)){this.fire(new Ln(Error(`Layer "${i}" already exists on this map.`)));return}let a;if(e.type==="custom"){if(w6(this,vre(e)))return;a=$6(e,this._globalState)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(i,e.source),e=cf(e),e=yn(e,{source:i})),this._validate(Hc.layer,`layers.${i}`,e,{arrayIndex:-1},t))return;a=$6(e,this._globalState),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}let o=r?this._order.indexOf(r):this._order.length;if(r&&o===-1){this.fire(new Ln(Error(`Cannot add layer "${i}" before non-existing layer "${r}".`)));return}if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&a.type!=="custom"){let s=this._removedLayers[i];delete this._removedLayers[i],s.type===a.type?(this._updatedSources[a.source]="reload",this.tileManagers[a.source].pause()):this._updatedSources[a.source]="clear"}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e]){this.fire(new Ln(Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));return}if(e===r)return;if(r&&!this._order.includes(r)){this.fire(new Ln(Error(`Cannot move layer "${e}" before non-existing layer "${r}".`)));return}let t=this._order.indexOf(e);this._order.splice(t,1);let i=r?this._order.indexOf(r):this._order.length;this._order.splice(i,0,e),this._layerOrderChanged=!0}removeLayer(e){var r;this._checkLoaded();let t=this._layers[e];if(!t){this.fire(new Ln(Error(`Cannot remove non-existing layer "${e}".`)));return}t.setEventedParent(null);let i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=t,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],t.type==="symbol"&&t.source&&((r=this.tileManagers[t.source])==null||r.resetMaxContentElevation()),t.onRemove&&t.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,t){this._checkLoaded();let i=this.getLayer(e);if(!i){this.fire(new Ln(Error(`Cannot set the zoom range of non-existing layer "${e}".`)));return}(i.minzoom!==r||i.maxzoom!==t)&&(r!=null&&(i.minzoom=r),t!=null&&(i.maxzoom=t),this._updateLayer(i))}setFilter(e,r,t={}){this._checkLoaded();let i=this.getLayer(e);if(!i){this.fire(new Ln(Error(`Cannot filter non-existing layer "${e}".`)));return}if(!Td(i.filter,r)){if(r==null){i.setFilter(void 0),this._updateLayer(i);return}this._validate(Hc.filter,`layers.${i.id}.filter`,r,null,t)||(i.setFilter(cf(r)),this._updateLayer(i))}}getFilter(e){return cf(this.getLayer(e).filter)}setLayoutProperty(e,r,t,i={}){this._checkLoaded();let a=this.getLayer(e);if(!a){this.fire(new Ln(Error(`Cannot style non-existing layer "${e}".`)));return}Td(a.getLayoutProperty(r),t)||(a.setLayoutProperty(r,t,i),this._updateLayer(a))}getLayoutProperty(e,r){let t=this.getLayer(e);if(!t){this.fire(new Ln(Error(`Cannot get style of non-existing layer "${e}".`)));return}return t.getLayoutProperty(r)}setPaintProperty(e,r,t,i={}){this._checkLoaded();let a=this.getLayer(e);if(!a){this.fire(new Ln(Error(`Cannot style non-existing layer "${e}".`)));return}Td(a.getPaintProperty(r),t)||this._updatePaintProperty(a,r,t,i)}_updatePaintProperty(e,r,t,i={}){e.setPaintProperty(r,t,i)&&this._updateLayer(e),Gx(e)&&r==="raster-fade-duration"&&this.tileManagers[e.source].setRasterFadeDuration(t),this._changed=!0,this._updatedPaintProps[e.id]=!0,e.type==="symbol"&&this.triggerSymbolPlacement(),this._serializedLayers=null}getPaintProperty(e,r){return this.getLayer(e).getPaintProperty(r)}setFeatureState(e,r){this._checkLoaded();let t=e.source,i=e.sourceLayer,a=this.tileManagers[t];if(a===void 0){this.fire(new Ln(Error(`The source '${t}' does not exist in the map's style.`)));return}let o=a.getSource().type;if(o==="geojson"&&i){this.fire(new Ln(Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(o==="vector"&&!i){this.fire(new Ln(Error("The sourceLayer parameter must be provided for vector source types.")));return}if(e.id===void 0){this.fire(new Ln(Error("The feature id parameter must be provided.")));return}let s=["__proto__","constructor","prototype"];if(r&&Object.keys(r).some(l=>s.includes(l))){this.fire(new Ln(Error(`The feature state should not include one of the following keys: ${s}`)));return}a.setFeatureState(i,e.id,r)}removeFeatureState(e,r){this._checkLoaded();let t=e.source,i=this.tileManagers[t];if(i===void 0){this.fire(new Ln(Error(`The source '${t}' does not exist in the map's style.`)));return}let a=i.getSource().type,o=a==="vector"?e.sourceLayer:void 0;if(a==="vector"&&!o){this.fire(new Ln(Error("The sourceLayer parameter must be provided for vector source types.")));return}if(r&&typeof e.id!="string"&&typeof e.id!="number"){this.fire(new Ln(Error("A feature id is required to remove its specific state property.")));return}i.removeFeatureState(o,e.id,r)}getFeatureState(e){this._checkLoaded();let r=e.source,t=e.sourceLayer,i=this.tileManagers[r];if(i===void 0){this.fire(new Ln(Error(`The source '${r}' does not exist in the map's style.`)));return}if(i.getSource().type==="vector"&&!t){this.fire(new Ln(Error("The sourceLayer parameter must be provided for vector source types.")));return}return e.id===void 0&&this.fire(new Ln(Error("The feature id parameter must be provided."))),i.getFeatureState(t,e.id)}getTransition(){var e;return yn({duration:300,delay:0},(e=this.stylesheet)==null?void 0:e.transition)}serialize(){if(!this._loaded)return;let e=$4(this.tileManagers,a=>a.serialize()),r=this._serializeByIds(this._order,!0),t=this.map.getTerrain()||void 0,i=this.stylesheet;return b9({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,"font-faces":i["font-faces"],transition:i.transition,projection:i.projection,state:i.state,sources:e,layers:r,terrain:t},a=>a!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.tileManagers[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.tileManagers[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let r=o=>this._layers[o].type==="fill-extrusion",t={},i=[];for(let o=this._order.length-1;o>=0;o--){let s=this._order[o];if(r(s)){t[s]=o;for(let l of e){let n=l[s];if(n)for(let u of n)i.push(u)}}}i.sort((o,s)=>s.intersectionZ-o.intersectionZ);let a=[];for(let o=this._order.length-1;o>=0;o--){let s=this._order[o];if(r(s))for(let l=i.length-1;l>=0;l--){let n=i[l].feature;if(t[n.layer.id]this.map.terrain.getElevation(u,c,f):void 0));return this.placement&&a.push(mne(this._layers,o,this.tileManagers,e,l,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,r){r?.filter&&this._validate(Hc.filter,"querySourceFeatures.filter",r.filter,null,r);let t=this.tileManagers[e];return t?gne(t,r?ar(Ot({},r),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,r={}){this._checkLoaded();let t=this.light.getLight(),i=!1;for(let o in e)if(!Td(e[o],t[o])){i=!0;break}if(!i)return;let a={now:hs(),transition:yn({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(a)}getProjection(){var e;return(e=this.stylesheet)==null?void 0:e.projection}setProjection(e){this._checkLoaded();let r=e??{type:"mercator"};if(this.stylesheet.projection=e,this.projection){if(this.projection.name===r.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(r.type)}getSky(){var e;return(e=this.stylesheet)==null?void 0:e.sky}setSky(e,r={}){this._checkLoaded();let t=this.getSky(),i=!1;if(!e&&!t)return;if(e&&!t)i=!0;else if(!e&&t)i=!0;else for(let o in e)if(!Td(e[o],t[o])){i=!0;break}if(!i)return;let a={now:hs(),transition:yn({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,r),this.sky.updateTransitions(a)}_setProjectionInternal(e){var r;let t=moe(e,(r=this.map._camera)==null?void 0:r.transform.constrainOverride,this._globalState);this.projection=t.projection,this.map.migrateProjection(t.transform,t.cameraHelper);for(let i in this.tileManagers)this.tileManagers[i].reload()}_validate(e,r,t,i,a={}){return a.validate!==!1&&Q1(this,e,Ot({key:r,style:this.serialize(),value:t},i),a)}_remove(e=!0){this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null)),jg().off(x2,this._rtlPluginLoaded);for(let r in this._layers)this._layers[r].setEventedParent(null);for(let r in this.tileManagers){let t=this.tileManagers[r];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.tileManagers[e].clearTiles()}_reloadSource(e){this.tileManagers[e].resume(),this.tileManagers[e].reload()}_updateSources(e){for(let r in this.tileManagers)this.tileManagers[r].update(e,this.map.terrain)}_generateCollisionBoxes(){for(let e in this.tileManagers)this._reloadSource(e)}triggerSymbolPlacement(){this._symbolPlacementTriggered=!0}_placementInputsChanged(e,r,t){var i;let a=this.pauseablePlacement;return!a||this._symbolPlacementTriggered||this._placedProjectionTransition!==((i=this.projection)==null?void 0:i.transitionState)||a._showCollisionBoxes!==r||a.placement.collisionGroups.crossSourceCollisions!==t||a.placement.transform.renderWorldCopies!==e.renderWorldCopies||!RK(a.placement.transform.modelViewProjectionMatrix,e.modelViewProjectionMatrix)}_updatePlacement(e,r,t,i,a=!1){var o,s;let l=!1,n=!1,u={};for(let h of this._order){let d=this._layers[h];if(d.type!=="symbol")continue;if(!u[d.source]){let g=this.tileManagers[d.source];u[d.source]=g.getRenderableIds(!0).map(m=>g.getTileByID(m)).sort((m,y)=>y.tileID.overscaledZ-m.tileID.overscaledZ||(m.tileID.isLessThan(y.tileID)?-1:1))}let p=this.crossTileSymbolIndex.addLayer(d,u[d.source],e.center.lng);l||(l=p)}this.crossTileSymbolIndex.pruneUnusedLayers(this._order),a||(a=this._layerOrderChanged||t===0);let c=l||this._placementInputsChanged(e,r,i),f=((o=this.pauseablePlacement)==null?void 0:o.isDone())&&!this.placement.stillRecent(hs(),e.zoom);if((a||!this.pauseablePlacement||f&&(c||this.placement.stale))&&(this._symbolPlacementTriggered=!1,this._placedProjectionTransition=(s=this.projection)==null?void 0:s.transitionState,this.pauseablePlacement=new IB(e,this.map.terrain,this._order,a,r,t,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?c&&this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(hs()),n=!0),l&&this.pauseablePlacement.placement.setStale()),n||l)for(let h of this._order){let d=this._layers[h];d.type==="symbol"&&this.placement.updateLayerOpacities(d,u[d.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(hs())}_releaseSymbolFadeTiles(){for(let e in this.tileManagers)this.tileManagers[e].releaseSymbolFadeTiles()}getImages(e,r){return Xr(this,null,function*(){let t=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();let i=this.tileManagers[r.source];return i&&i.setDependencies(r.tileID.key,r.type,r.icons),t})}getGlyphs(e,r){return Xr(this,null,function*(){let t=yield this.glyphManager.getGlyphs(r.stacks),i=this.tileManagers[r.source];return i&&i.setDependencies(r.tileID.key,r.type,[""]),t})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,r={}){this._checkLoaded(),!(e&&this._validate(Hc.glyphs,"glyphs",e,null,r))&&(this._changed=!0,this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}getFontFaces(){return this.stylesheet["font-faces"]||null}setFontFaces(e){this._checkLoaded(),this._changed=!0,this._glyphsDidChange=!0,this.stylesheet["font-faces"]=e,this.glyphManager.setFontFaces(e)}getDashes(e,r){return Xr(this,null,function*(){let t={};for(let[i,a]of Object.entries(r.dashes))t[i]=this.lineAtlas.getDash(a.dasharray,a.round);return t})}addSprite(e,r,t={},i){this._checkLoaded();let a=[{id:e,url:r}],o=[...Xb(this.stylesheet.sprite),...a];this._validate(Hc.sprite,"sprite",o,null,t)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(e){this._checkLoaded();let r=Xb(this.stylesheet.sprite);if(!r.find(i=>i.id===e)){this.fire(new Ln(Error(`Sprite "${e}" doesn't exists on this map.`)));return}let t=this.imageManager.removeSpriteImages(e);this._markImagesChanged(t),r.splice(r.findIndex(i=>i.id===e),1),this.stylesheet.sprite=r.length>0?r:void 0,this._imagesListDirty=!0,this._changed=!0,this.fire(new Nf("data"))}getSprite(){return Xb(this.stylesheet.sprite)}setSprite(e,r={},t){this._checkLoaded(),!(e&&this._validate(Hc.sprite,"sprite",e,null,r))&&(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,t):(this._unloadSprite(),t&&t(null)))}destroy(){this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null));for(let e in this.tileManagers){let r=this.tileManagers[e];r.setEventedParent(null),r.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.patternAtlas.destroy()),this.glyphManager&&this.glyphManager.destroy();for(let e in this._layers){let r=this._layers[e];r.setEventedParent(null),r.onRemove&&r.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}},rO=ul([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),iO=class{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,r,t,i,a,o,s,l,n){this.context=e;let u=this.boundPaintVertexBuffers.length!==i.length;for(let c=0;!u&&c({u_depth:new En(e,r.u_depth),u_terrain:new En(e,r.u_terrain)}),nO=(e,r)=>({u_texture:new En(e,r.u_texture),u_ele_delta:new Xa(e,r.u_ele_delta),u_fog_matrix:new vh(e,r.u_fog_matrix),u_fog_color:new lp(e,r.u_fog_color),u_fog_ground_blend:new Xa(e,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new Xa(e,r.u_fog_ground_blend_opacity),u_horizon_color:new lp(e,r.u_horizon_color),u_horizon_fog_blend:new Xa(e,r.u_horizon_fog_blend),u_is_globe_mode:new Xa(e,r.u_is_globe_mode)}),oO=(e,r)=>({u_ele_delta:new Xa(e,r.u_ele_delta)}),sO=(e,r,t,i,a)=>({u_texture:0,u_ele_delta:e,u_fog_matrix:r,u_fog_color:t?t.properties.get("fog-color"):ro.white,u_fog_ground_blend:t?t.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?0:t?t.calculateFogBlendOpacity(i):0,u_horizon_color:t?t.properties.get("horizon-color"):ro.white,u_horizon_fog_blend:t?t.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!a}),lO=e=>({u_ele_delta:e}),Qg={ProjectionUBO:0,TerrainUBO:1,FrameUBO:2},uO={float:[1,1],int:[1,1],vec2:[2,2],vec4:[4,4],mat4:[16,4]},F2=class{constructor(e,r,t){this.context=e,this.binding=r,this.contentWords=t.contentWords;let i=e.gl;this.buffer=i.createBuffer(),i.bindBuffer(i.UNIFORM_BUFFER,this.buffer),i.bufferData(i.UNIFORM_BUFFER,t.sizeWords*4,i.DYNAMIC_DRAW),i.bindBufferBase(i.UNIFORM_BUFFER,r,this.buffer),this.uploaded=new Float32Array(t.sizeWords),this.pending=new Float32Array(t.sizeWords),this.uploadedWords=new Uint32Array(this.uploaded.buffer),this.pendingWords=new Uint32Array(this.pending.buffer),this.hasData=!1,this.bindingDirty=!1}upload(){let e=this.context.gl,r=!this.hasData;if(!r){let t=this.pendingWords,i=this.uploadedWords;for(let a=0;a=0&&(this.attributes[k]={location:A,isInteger:w.has(k)})}u.deleteShader(M),u.deleteShader(S);for(let k of y)if(k&&!C[k]){let A=u.getUniformLocation(this.program,k);A&&(C[k]=A)}this.fixedUniforms=i(e,C),this.terrainUniforms=aO(e,C),this.binderUniforms=t?t.getUniforms(e,C):[]}draw(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_){var v;let x=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(t),e.setStencilMode(i),e.setColorMode(a),e.setCullFace(o),l){e.activeTexture.set(x.TEXTURE2),x.bindTexture(x.TEXTURE_2D,l.depthTexture),e.activeTexture.set(x.TEXTURE3),x.bindTexture(x.TEXTURE_2D,l.texture);for(let M in this.terrainUniforms)this.terrainUniforms[M].set(l[M]);boe(e.terrainUniformBuffer,l)}if(n&&_oe(e.projectionUniformBuffer,n),s)for(let M in this.fixedUniforms)this.fixedUniforms[M].set(s[M]);g&&g.setUniforms(e,this.binderUniforms,d,{zoom:p});let S=0;switch(r){case x.LINES:S=2;break;case x.TRIANGLES:S=3;break;case x.LINE_STRIP:S=1}for(let M of h.get())M.vaos||(M.vaos={}),(v=M.vaos)[u]||(v[u]=new iO),M.vaos[u].bind(e,this,c,g?g.getPaintVertexBuffers():[],f,M.vertexOffset,m,y,_),x.drawElements(r,M.primitiveLength*S,x.UNSIGNED_SHORT,M.primitiveOffset*S*2)}},fO=(e,r)=>({u_lightpos:new vc(e,r.u_lightpos),u_lightpos_globe:new vc(e,r.u_lightpos_globe),u_lightintensity:new Xa(e,r.u_lightintensity),u_lightcolor:new vc(e,r.u_lightcolor),u_vertical_gradient:new Xa(e,r.u_vertical_gradient),u_opacity:new Xa(e,r.u_opacity),u_fill_translate:new mo(e,r.u_fill_translate)}),hO=(e,r)=>({u_lightpos:new vc(e,r.u_lightpos),u_lightpos_globe:new vc(e,r.u_lightpos_globe),u_lightintensity:new Xa(e,r.u_lightintensity),u_lightcolor:new vc(e,r.u_lightcolor),u_vertical_gradient:new Xa(e,r.u_vertical_gradient),u_height_factor:new Xa(e,r.u_height_factor),u_opacity:new Xa(e,r.u_opacity),u_fill_translate:new mo(e,r.u_fill_translate),u_image:new En(e,r.u_image),u_texsize:new mo(e,r.u_texsize),u_pixel_coord_upper:new mo(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new mo(e,r.u_pixel_coord_lower),u_scale:new vc(e,r.u_scale),u_fade:new Xa(e,r.u_fade)}),KM=(e,r,t,i)=>{let a=e.style.light,o=a.getCartesianPosition(),s=u9();a.properties.get("anchor")==="viewport"&&CK(s,e.transform.bearingInRadians),jK(o,o,s);let l=e.transform.transformLightDirection(o),n=a.properties.get("color");return{u_lightpos:o,u_lightpos_globe:l,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[n.r,n.g,n.b],u_vertical_gradient:+r,u_opacity:t,u_fill_translate:i}},dO=(e,r,t,i,a,o,s)=>yn(KM(e,r,t,i),Mz(o,e,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8}),pO=(e,r)=>({u_fill_translate:new mo(e,r.u_fill_translate)}),vO=(e,r)=>({u_image:new En(e,r.u_image),u_texsize:new mo(e,r.u_texsize),u_pixel_coord_upper:new mo(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new mo(e,r.u_pixel_coord_lower),u_scale:new vc(e,r.u_scale),u_fade:new Xa(e,r.u_fade),u_sdf_pattern:new En(e,r.u_sdf_pattern),u_fill_translate:new mo(e,r.u_fill_translate)}),mO=(e,r)=>({u_fill_translate:new mo(e,r.u_fill_translate)}),gO=(e,r)=>({u_image:new En(e,r.u_image),u_texsize:new mo(e,r.u_texsize),u_pixel_coord_upper:new mo(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new mo(e,r.u_pixel_coord_lower),u_scale:new vc(e,r.u_scale),u_fade:new Xa(e,r.u_fade),u_sdf_pattern:new En(e,r.u_sdf_pattern),u_fill_translate:new mo(e,r.u_fill_translate)}),JM=(e,r,t,i,a)=>yn(Mz(r,e,t),{u_fill_translate:i,u_sdf_pattern:+!!a}),yO=e=>({u_fill_translate:e}),_O=e=>({u_fill_translate:e}),xO=(e,r,t,i,a)=>JM(e,r,t,i,a),bO=(e,r)=>({u_scale_with_map:new En(e,r.u_scale_with_map),u_pitch_with_map:new En(e,r.u_pitch_with_map),u_extrude_scale:new mo(e,r.u_extrude_scale),u_globe_extrude_scale:new Xa(e,r.u_globe_extrude_scale),u_translate:new mo(e,r.u_translate)}),wO=(e,r,t,i,a)=>{let o=e.transform,s,l,n=0;if(t.paint.get("circle-pitch-alignment")==="map"){let u=Cf(r,1,o.zoom);s=!0,l=[u,u],n=u/(Bi*2**r.tileID.overscaledZ)*2*Math.PI*a}else s=!1,l=o.pixelsToGLUnits;return{u_scale_with_map:+(t.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+s,u_extrude_scale:l,u_globe_extrude_scale:n,u_translate:i}},TO=(e,r)=>({u_color:new lp(e,r.u_color),u_overlay:new En(e,r.u_overlay),u_overlay_scale:new Xa(e,r.u_overlay_scale)}),QM=(e,r=1)=>({u_color:e,u_overlay:0,u_overlay_scale:r}),AO=(e,r)=>({u_extrude_scale:new Xa(e,r.u_extrude_scale),u_intensity:new Xa(e,r.u_intensity),u_globe_extrude_scale:new Xa(e,r.u_globe_extrude_scale)}),MO=(e,r)=>({u_matrix:new vh(e,r.u_matrix),u_image:new En(e,r.u_image),u_color_ramp:new En(e,r.u_color_ramp),u_opacity:new Xa(e,r.u_opacity)}),eS=(e,r,t,i)=>{let a=Cf(e,1,r)/(Bi*2**e.tileID.overscaledZ)*2*Math.PI*i;return{u_extrude_scale:Cf(e,1,r),u_intensity:t,u_globe_extrude_scale:a}},tS=(e,r,t,i)=>{let a=Rp();return $h(a,0,e.width,e.height,0,0,1),{u_matrix:a,u_image:t,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}},SO=(e,r)=>({u_image:new En(e,r.u_image),u_latrange:new mo(e,r.u_latrange),u_exaggeration:new Xa(e,r.u_exaggeration),u_altitudes:new eA(e,r.u_altitudes),u_azimuths:new eA(e,r.u_azimuths),u_accent:new lp(e,r.u_accent),u_method:new En(e,r.u_method),u_shadows:new QT(e,r.u_shadows),u_highlights:new QT(e,r.u_highlights)}),EO=(e,r)=>({u_matrix:new vh(e,r.u_matrix),u_image:new En(e,r.u_image),u_dimension:new mo(e,r.u_dimension),u_zoom:new Xa(e,r.u_zoom),u_unpack:new Sm(e,r.u_unpack)}),kO=(e,r,t)=>{let i=t.paint.get("hillshade-accent-color"),a;switch(t.paint.get("hillshade-method")){case"basic":a=4;break;case"combined":a=1;break;case"igor":a=2;break;case"multidirectional":a=3;break;default:a=0}let o=t.getIlluminationProperties();for(let s=0;s{let t=r.stride,i=Rp();return $h(i,0,Bi,-Bi,0,0,1),Ol(i,i,[0,-Bi,0]),{u_matrix:i,u_image:1,u_dimension:[t,t],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}},DO=(e,r)=>({u_image:new En(e,r.u_image),u_unpack:new Sm(e,r.u_unpack),u_dimension:new mo(e,r.u_dimension),u_elevation_stops:new En(e,r.u_elevation_stops),u_color_stops:new En(e,r.u_color_stops),u_color_ramp_size:new En(e,r.u_color_ramp_size),u_opacity:new Xa(e,r.u_opacity)}),LO=(e,r,t=0)=>({u_image:0,u_unpack:r.getUnpackVector(),u_dimension:[r.stride,r.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:t,u_opacity:e.paint.get("color-relief-opacity")}),FO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_ratio:new Xa(e,r.u_ratio)}),PO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_ratio:new Xa(e,r.u_ratio),u_image:new En(e,r.u_image),u_image_height:new Xa(e,r.u_image_height)}),IO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_texsize:new mo(e,r.u_texsize),u_ratio:new Xa(e,r.u_ratio),u_image:new En(e,r.u_image),u_scale:new vc(e,r.u_scale),u_fade:new Xa(e,r.u_fade)}),RO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_ratio:new Xa(e,r.u_ratio),u_image:new En(e,r.u_image),u_mix:new Xa(e,r.u_mix),u_tileratio:new Xa(e,r.u_tileratio),u_crossfade_from:new Xa(e,r.u_crossfade_from),u_crossfade_to:new Xa(e,r.u_crossfade_to),u_lineatlas_width:new Xa(e,r.u_lineatlas_width),u_lineatlas_height:new Xa(e,r.u_lineatlas_height)}),zO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_ratio:new Xa(e,r.u_ratio),u_image:new En(e,r.u_image),u_image_height:new Xa(e,r.u_image_height),u_tileratio:new Xa(e,r.u_tileratio),u_crossfade_from:new Xa(e,r.u_crossfade_from),u_crossfade_to:new Xa(e,r.u_crossfade_to),u_image_dash:new En(e,r.u_image_dash),u_mix:new Xa(e,r.u_mix),u_lineatlas_width:new Xa(e,r.u_lineatlas_width),u_lineatlas_height:new Xa(e,r.u_lineatlas_height)}),ty=(e,r,t,i)=>{let a=e.transform;return{u_translation:Sz(e,r,t),u_ratio:i/Cf(r,1,a.zoom)}},BO=(e,r,t,i,a)=>yn(ty(e,r,t,i),{u_image:0,u_image_height:a}),OO=(e,r,t,i,a)=>{let o=e.transform,s=oM(r,o);return{u_translation:Sz(e,r,t),u_texsize:r.imageAtlasTexture.size,u_ratio:i/Cf(r,1,o.zoom),u_image:0,u_scale:[s,a.fromScale,a.toScale],u_fade:a.t}},NO=(e,r,t,i,a)=>{let o=e.transform,s=oM(r,o);return yn(ty(e,r,t,i),{u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},jO=(e,r,t,i,a,o)=>{let s=e.transform,l=oM(r,s);return yn(ty(e,r,t,i),{u_image:0,u_image_height:o,u_tileratio:l,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},UO=(e,r)=>({u_image:new En(e,r.u_image),u_opacity:new Xa(e,r.u_opacity)}),qO=(e,r)=>({u_image:r,u_opacity:e}),VO=(e,r)=>({u_is_size_zoom_constant:new En(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new En(e,r.u_is_size_feature_constant),u_size_t:new Xa(e,r.u_size_t),u_size:new Xa(e,r.u_size),u_rotate_symbol:new En(e,r.u_rotate_symbol),u_label_plane_matrix:new vh(e,r.u_label_plane_matrix),u_coord_matrix:new vh(e,r.u_coord_matrix),u_is_text:new En(e,r.u_is_text),u_pitch_with_map:new En(e,r.u_pitch_with_map),u_is_along_line:new En(e,r.u_is_along_line),u_is_variable_anchor:new En(e,r.u_is_variable_anchor),u_texsize:new mo(e,r.u_texsize),u_texture:new En(e,r.u_texture),u_translation:new mo(e,r.u_translation),u_pitched_scale:new Xa(e,r.u_pitched_scale),u_is_offset:new En(e,r.u_is_offset),u_height_anchor_ground:new En(e,r.u_height_anchor_ground)}),GO=(e,r)=>({u_is_size_zoom_constant:new En(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new En(e,r.u_is_size_feature_constant),u_size_t:new Xa(e,r.u_size_t),u_size:new Xa(e,r.u_size),u_rotate_symbol:new En(e,r.u_rotate_symbol),u_label_plane_matrix:new vh(e,r.u_label_plane_matrix),u_coord_matrix:new vh(e,r.u_coord_matrix),u_is_text:new En(e,r.u_is_text),u_pitch_with_map:new En(e,r.u_pitch_with_map),u_is_along_line:new En(e,r.u_is_along_line),u_is_variable_anchor:new En(e,r.u_is_variable_anchor),u_texsize:new mo(e,r.u_texsize),u_texture:new En(e,r.u_texture),u_gamma_scale:new Xa(e,r.u_gamma_scale),u_is_halo:new En(e,r.u_is_halo),u_is_plain:new En(e,r.u_is_plain),u_translation:new mo(e,r.u_translation),u_pitched_scale:new Xa(e,r.u_pitched_scale),u_is_offset:new En(e,r.u_is_offset),u_height_anchor_ground:new En(e,r.u_height_anchor_ground)}),HO=(e,r)=>({u_is_size_zoom_constant:new En(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new En(e,r.u_is_size_feature_constant),u_size_t:new Xa(e,r.u_size_t),u_size:new Xa(e,r.u_size),u_rotate_symbol:new En(e,r.u_rotate_symbol),u_label_plane_matrix:new vh(e,r.u_label_plane_matrix),u_coord_matrix:new vh(e,r.u_coord_matrix),u_is_text:new En(e,r.u_is_text),u_pitch_with_map:new En(e,r.u_pitch_with_map),u_is_along_line:new En(e,r.u_is_along_line),u_is_variable_anchor:new En(e,r.u_is_variable_anchor),u_texsize:new mo(e,r.u_texsize),u_texsize_icon:new mo(e,r.u_texsize_icon),u_texture:new En(e,r.u_texture),u_texture_icon:new En(e,r.u_texture_icon),u_gamma_scale:new Xa(e,r.u_gamma_scale),u_is_halo:new En(e,r.u_is_halo),u_translation:new mo(e,r.u_translation),u_pitched_scale:new Xa(e,r.u_pitched_scale),u_is_offset:new En(e,r.u_is_offset),u_height_anchor_ground:new En(e,r.u_height_anchor_ground)}),rS=(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p)=>({u_is_size_zoom_constant:+(e==="constant"||e==="source"),u_is_size_feature_constant:+(e==="constant"||e==="camera"),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_rotate_symbol:+t,u_label_plane_matrix:l,u_coord_matrix:n,u_is_text:+c,u_pitch_with_map:+i,u_is_along_line:a,u_is_variable_anchor:o,u_texsize:f,u_texture:0,u_translation:u,u_pitched_scale:h,u_is_offset:d,u_height_anchor_ground:+p}),iS=(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g)=>{let m=s.transform;return yn(rS(e,r,t,i,a,o,s,l,n,u,c,f,d,p,g),{u_gamma_scale:i?Math.cos(m.pitch*Math.PI/180)*m.cameraToCenterDistance:1,u_is_halo:+!!h,u_is_plain:1})},$O=(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p)=>yn(iS(e,r,t,i,a,o,s,l,n,u,!0,c,!0,h,d,p),{u_texsize_icon:f,u_texture_icon:1}),WO=(e,r)=>({u_opacity:new Xa(e,r.u_opacity),u_color:new lp(e,r.u_color)}),YO=(e,r)=>({u_opacity:new Xa(e,r.u_opacity),u_image:new En(e,r.u_image),u_pattern_tl_a:new mo(e,r.u_pattern_tl_a),u_pattern_br_a:new mo(e,r.u_pattern_br_a),u_pattern_tl_b:new mo(e,r.u_pattern_tl_b),u_pattern_br_b:new mo(e,r.u_pattern_br_b),u_texsize:new mo(e,r.u_texsize),u_mix:new Xa(e,r.u_mix),u_pattern_size_a:new mo(e,r.u_pattern_size_a),u_pattern_size_b:new mo(e,r.u_pattern_size_b),u_scale_a:new Xa(e,r.u_scale_a),u_scale_b:new Xa(e,r.u_scale_b),u_pixel_coord_upper:new mo(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new mo(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new Xa(e,r.u_tile_units_to_pixels)}),XO=(e,r)=>({u_opacity:e,u_color:r}),ZO=(e,r,t,i,a)=>yn(Toe(t,a,r,i),{u_opacity:e}),KO=(e,r)=>({u_sun_pos:new vc(e,r.u_sun_pos),u_atmosphere_blend:new Xa(e,r.u_atmosphere_blend),u_globe_position:new vc(e,r.u_globe_position),u_globe_radius:new Xa(e,r.u_globe_radius),u_inv_proj_matrix:new vh(e,r.u_inv_proj_matrix)}),JO=(e,r,t,i,a)=>({u_sun_pos:e,u_atmosphere_blend:r,u_globe_position:t,u_globe_radius:i,u_inv_proj_matrix:a}),QO=(e,r)=>({u_sky_color:new lp(e,r.u_sky_color),u_horizon_color:new lp(e,r.u_horizon_color),u_horizon:new mo(e,r.u_horizon),u_horizon_normal:new mo(e,r.u_horizon_normal),u_sky_horizon_blend:new Xa(e,r.u_sky_horizon_blend),u_sky_blend:new Xa(e,r.u_sky_blend),u_inv_proj_matrix:new vh(e,r.u_inv_proj_matrix),u_globe_position:new vc(e,r.u_globe_position),u_globe_radius:new Xa(e,r.u_globe_radius)}),eN=(e,r,t)=>{let i=Math.cos(r.rollInRadians),a=Math.sin(r.rollInRadians),o=lg(r),s=r.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:e.properties.get("sky-color"),u_horizon_color:e.properties.get("horizon-color"),u_horizon:[(r.width/2-o*a)*t,(r.height/2+o*i)*t],u_horizon_normal:[-a,i],u_sky_horizon_blend:e.properties.get("sky-horizon-blend")*r.height/2*t,u_sky_blend:s,u_inv_proj_matrix:r.inverseProjectionMatrix,u_globe_position:_z(r),u_globe_radius:Nm(r.worldSize,r.center.lat)}},ry=(e,r)=>({}),tN={fillExtrusion:fO,fillExtrusionPattern:hO,fill:pO,fillPattern:vO,fillOutline:mO,fillOutlinePattern:gO,circle:bO,collisionBox:ry,collisionCircle:ry,debug:TO,depth:ry,clippingMask:ry,heatmap:AO,heatmapTexture:MO,hillshade:SO,hillshadePrepare:EO,colorRelief:DO,line:FO,lineGradient:PO,linePattern:IO,lineSDF:RO,lineGradientSDF:zO,layerOpacity:UO,raster:pB,symbolIcon:VO,symbolSDF:GO,symbolTextAndIcon:HO,background:WO,backgroundPattern:YO,terrain:nO,terrainDepth:oO,atmosphere:KO,sky:QO},rN=class{constructor(e,r,t){this.context=e;let i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=!!t,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||r.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let r=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},aS={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},iN=class{constructor(e,r,t,i){this.length=r.length,this.attributes=t,this.itemSize=r.bytesPerElement,this.dynamicDraw=i,this.context=e;let a=e.gl;this.buffer=a.createBuffer(),e.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||r.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,r){for(let t of this.attributes){let i=r.attributes[t.name];i!==void 0&&e.enableVertexAttribArray(i.location)}}setVertexAttribPointers(e,r,t){for(let i of this.attributes){let a=r.attributes[i.name];if(a!==void 0){let o=i.offset+this.itemSize*(t||0);a.isInteger?e.vertexAttribIPointer(a.location,i.components,e[aS[i.type]],this.itemSize,o):e.vertexAttribPointer(a.location,i.components,e[aS[i.type]],!1,this.itemSize,o)}}}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},os=class{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)}},aN=class extends os{getDefault(){return ro.transparent}set(e){let r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}},nN=class extends os{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}},oN=class extends os{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}},sN=class extends os{getDefault(){return[!0,!0,!0,!0]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}},lN=class extends os{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}},uN=class extends os{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}},cN=class extends os{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let r=this.current;(e.func!==r.func||e.ref!==r.ref||e.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}},fN=class extends os{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}},hN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=e,this.dirty=!1}},dN=class extends os{getDefault(){return[0,1]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}},pN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=e,this.dirty=!1}},vN=class extends os{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}},mN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.BLEND):r.disable(r.BLEND),this.current=e,this.dirty=!1}},gN=class extends os{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}},yN=class extends os{getDefault(){return ro.transparent}set(e){let r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}},_N=class extends os{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}},xN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=e,this.dirty=!1}},bN=class extends os{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}},wN=class extends os{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}},TN=class extends os{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}},AN=class extends os{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}},MN=class extends os{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}},SN=class extends os{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},EN=class extends os{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,e),this.current=e,this.dirty=!1}},kN=class extends os{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindTexture(r.TEXTURE_2D,e),this.current=e,this.dirty=!1}},CN=class extends os{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},DN=class extends os{getDefault(){return null}set(e){let r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},LN=class extends os{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}},FN=class extends os{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},PN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},IN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},P2=class extends os{constructor(e,r){super(e),this.context=e,this.parent=r}getDefault(){return null}},RN=class extends P2{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},zN=class extends P2{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}},BN=class extends P2{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}},ON=class{constructor(e,r,t,i,a){this.context=e,this.width=r,this.height=t;let o=e.gl,s=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new RN(e,s),i)this.depthAttachment=a?new BN(e,s):new zN(e,s);else if(a)throw Error("Stencil cannot be set without depth")}destroy(){let e=this.context.gl,r=this.colorAttachment.get();if(r&&e.deleteTexture(r),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}},nS=aM([{name:"u_units_to_pixels",type:"vec2"},{name:"u_world_size",type:"vec2"},{name:"u_camera_to_center_distance",type:"float"},{name:"u_symbol_fade_change",type:"float"},{name:"u_aspect_ratio",type:"float"},{name:"u_device_pixel_ratio",type:"float"},{name:"u_viewport_size",type:"vec2"},{name:"u_pixel_extrude_scale",type:"vec2"},{name:"u_pitch",type:"float"}]),pf=nS.offsets,cl=class{constructor(e,r,t){this.blendFunction=e,this.blendColor=r,this.mask=t}},cl.Replace=[1,0],cl.disabled=new cl(cl.Replace,ro.transparent,[!1,!1,!1,!1]),cl.unblended=new cl(cl.Replace,ro.transparent,[!0,!0,!0,!0]),cl.alphaBlended=new cl([1,771],ro.transparent,[!0,!0,!0,!0]),NN=class{constructor(e){this.gl=e,this.clearColor=new aN(this),this.clearDepth=new nN(this),this.clearStencil=new oN(this),this.colorMask=new sN(this),this.depthMask=new lN(this),this.stencilMask=new uN(this),this.stencilFunc=new cN(this),this.stencilOp=new fN(this),this.stencilTest=new hN(this),this.depthRange=new dN(this),this.depthTest=new pN(this),this.depthFunc=new vN(this),this.blend=new mN(this),this.blendFunc=new gN(this),this.blendColor=new yN(this),this.blendEquation=new _N(this),this.cullFace=new xN(this),this.cullFaceSide=new bN(this),this.frontFace=new wN(this),this.program=new TN(this),this.activeTexture=new AN(this),this.viewport=new MN(this),this.bindFramebuffer=new SN(this),this.bindRenderbuffer=new EN(this),this.bindTexture=new kN(this),this.bindVertexBuffer=new CN(this),this.bindElementBuffer=new DN(this),this.bindVertexArray=new LN(this),this.pixelStoreUnpack=new FN(this),this.pixelStoreUnpackPremultiplyAlpha=new PN(this),this.pixelStoreUnpackFlipY=new IN(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),e.getExtension("EXT_color_buffer_half_float"),e.getExtension("EXT_color_buffer_float"),this.projectionUniformBuffer=yoe(this),this.terrainUniformBuffer=xoe(this),this.frameUniformBuffer=Moe(this)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0,this.projectionUniformBuffer.bindingDirty=!0,this.terrainUniformBuffer.bindingDirty=!0,this.frameUniformBuffer.bindingDirty=!0}setCustomLayerDefaults(){this.unbindVAO(),this.cullFace.setDefault(),this.activeTexture.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}createIndexBuffer(e,r){return new rN(this,e,r)}createVertexBuffer(e,r,t){return new iN(this,e,r,t)}createRenderbuffer(e,r,t){let i=this.gl,a=i.createRenderbuffer();return this.bindRenderbuffer.set(a),i.renderbufferStorage(i.RENDERBUFFER,e,r,t),this.bindRenderbuffer.set(null),a}createFramebuffer(e,r,t,i){return new ON(this,e,r,t,i)}clear({color:e,depth:r,stencil:t}){let i=this.gl,a=0;e&&(a|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),r!==void 0&&(a|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),t!==void 0&&(a|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(t),this.stencilMask.set(255)),i.clear(a)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func===this.gl.ALWAYS&&!e.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range))}setStencilMode(e){e.test.func===this.gl.ALWAYS&&!e.mask?this.stencilTest.set(!1):(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}))}setColorMode(e){Td(e.blendFunction,cl.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){return this.gl.createVertexArray()}deleteVertexArray(e){this.gl.deleteVertexArray(e)}unbindVAO(){this.bindVertexArray.set(null)}},Lo=class{constructor(e,r,t){this.func=e,this.mask=r,this.range=t}},Lo.ReadOnly=!1,Lo.ReadWrite=!0,Lo.disabled=new Lo(519,Lo.ReadOnly,[0,1]),I2=7680,es=class{constructor(e,r,t,i,a,o){this.test=e,this.ref=r,this.mask=t,this.fail=i,this.depthFail=a,this.pass=o}},es.disabled=new es({func:519,mask:0},0,0,I2,I2,I2),oS=1029,R2=2305,Ko=class{constructor(e,r,t){this.enable=e,this.mode=r,this.frontFace=t}},Ko.disabled=new Ko(!1,oS,R2),Ko.backCCW=new Ko(!0,oS,R2),Ko.frontCCW=new Ko(!0,1028,R2),jN=Hh(new Float32Array(16)),B2=0,O2=[new Wr(0,0),new Wr(Bi,0),new Wr(Bi,Bi),new Wr(0,Bi)],UN=new ro(1,0,0,1),qN=new ro(0,1,0,1),VN=new ro(0,0,1,1),GN=new ro(1,0,1,1),HN=new ro(0,1,1,1),$N={symbol:koe,circle:Ioe,heatmap:Roe,line:$oe,fill:Woe,fillExtrusion:Yoe,hillshade:Xoe,colorRelief:Koe,raster:Joe,background:rse,sky:hse,atmosphere:pse,custom:use,debug:nse,debugPadding:ise,terrainDepth:cse},WN=(N2=class{constructor(e,r){this.drawFunctions=$N,this.context=new NN(e),this.transform=r,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:Hh(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=A2.maxOverzooming+A2.maxUnderzooming+1,this.depthEpsilon=1/2**16,this.crossTileSymbolIndex=new zM}resize(e,r,t){if(this.width=Math.floor(e*t),this.height=Math.floor(r*t),this.pixelRatio=t,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let i of this.style._order)this.style._layers[i].resize()}setup(){let e=this.context,r=new sp;r.emplaceBack(0,0),r.emplaceBack(Bi,0),r.emplaceBack(0,Bi),r.emplaceBack(Bi,Bi),this.tileExtentBuffer=e.createVertexBuffer(r,i0.members),this.tileExtentSegments=Ks.simpleSegment(0,0,4,2);let t=new sp;t.emplaceBack(0,0),t.emplaceBack(Bi,0),t.emplaceBack(0,Bi),t.emplaceBack(Bi,Bi),this.debugBuffer=e.createVertexBuffer(t,i0.members),this.debugSegments=Ks.simpleSegment(0,0,4,5);let i=new fI;i.emplaceBack(0,0,0,0),i.emplaceBack(Bi,0,Bi,0),i.emplaceBack(0,Bi,0,Bi),i.emplaceBack(Bi,Bi,Bi,Bi),this.rasterBoundsBuffer=e.createVertexBuffer(i,rO.members),this.rasterBoundsSegments=Ks.simpleSegment(0,0,4,2);let a=new sp;a.emplaceBack(0,0),a.emplaceBack(Bi,0),a.emplaceBack(0,Bi),a.emplaceBack(Bi,Bi),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(a,i0.members),this.rasterBoundsSegmentsPosOnly=Ks.simpleSegment(0,0,4,5);let o=new sp;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,i0.members),this.viewportSegments=Ks.simpleSegment(0,0,4,2);let s=new TI;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);let l=new ed;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(l);let n=this.context.gl;this.stencilClearMode=new es({func:n.ALWAYS,mask:0},0,255,n.ZERO,n.ZERO,n.ZERO),this.tileExtentMesh=new Um(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let t=Rp();$h(t,0,this.width,this.height,0,0,1),Xu(t,t,[r.drawingBufferWidth,r.drawingBufferHeight,0]);let i={mainMatrix:t,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:t,clipAntimeridian:!1};this.useProgram("clippingMask",null,!0).draw(e,r.TRIANGLES,Lo.disabled,this.stencilClearMode,cl.disabled,Ko.disabled,null,null,i,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(e,r,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!r?.length)return;this.currentStencilSource=e.source,this.nextStencilID+r.length>256&&this.clearStencil();let i=this.context;i.setColorMode(cl.disabled),i.setDepthMode(Lo.disabled);let a={};for(let o of r)a[o.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(a,r,t,!0),this._renderTileMasks(a,r,t,!1),this._tileClippingMaskIDs=a}_renderTileMasks(e,r,t,i){let a=this.context,o=a.gl,s=this.style.projection,l=this.transform,n=this.useProgram("clippingMask");for(let u of r){let c=e[u.key],f=this.getTerrainDataForTile(u,t),h=s.getMeshFromTileID(this.context,u.canonical,i,!0,"stencil"),d=l.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!t,applyTerrainMatrix:!0});n.draw(a,o.TRIANGLES,Lo.disabled,new es({func:o.ALWAYS,mask:0},c,255,o.KEEP,o.KEEP,o.REPLACE),cl.disabled,t?Ko.disabled:Ko.backCCW,null,f,d,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}getTerrainDataForTile(e,r){var t,i;return r&&((t=this.style.projection)==null?void 0:t.name)==="mercator"?null:((i=this.style.map.terrain)==null?void 0:i.getTerrainData(e))||null}_renderTilesDepthBuffer(){var e;let r=this.context,t=r.gl,i=this.style.projection,a=this.transform,o=this.useProgram("depth"),s=this.getDepthModeFor3D(),l=Bm(a,{tileSize:a.tileSize});for(let n of l){let u=(e=this.style.map.terrain)==null?void 0:e.getTerrainData(n),c=i.getMeshFromTileID(this.context,n.canonical,!0,!0,"raster"),f=a.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(r,t.TRIANGLES,s,es.disabled,cl.disabled,Ko.backCCW,null,u,f,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,r=this.context.gl;return new es({func:r.NOTEQUAL,mask:255},e,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(e){let r=this.context.gl;return new es({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,r.KEEP,r.KEEP,r.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let r=this.context.gl,t=e.sort((o,s)=>s.overscaledZ-o.overscaledZ),i=t[t.length-1].overscaledZ,a=t[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();let o={};for(let s=0;ss.overscaledZ-o.overscaledZ),i=t[t.length-1].overscaledZ,a=t[0].overscaledZ-i+1;if(this.clearStencil(),a>1){let o={},s={};for(let l=0;l=0;a.currentLayer--){let f=this.style._layers[o[a.currentLayer]];if(f.isHidden(this.transform.zoom))continue;let h=s[f.source],d=l[f.source];this.renderTileClippingMasks(f,d,!1),this.renderLayer(this,h,f,d,a)}a.currentPass="translucent";let c=!1;for(a.currentLayer=0;a.currentLayer0?r.pop():null}acquireRTT(e){let r=this.context.gl,t=this._rttObjectRecyclePool.pop();if(t)return t.size!==e&&(t.texture.update({width:e,height:e,data:null},{premultiply:!1,useMipmap:!0}),t.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),t.size=e),t;let i=new jl(this.context,{width:e,height:e,data:null},r.RGBA,{premultiply:!1,useMipmap:!0});return i.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:i,size:e}}bindRTT(e){let r=this.context.gl,t=e.size;if(!this._rttSharedFbo){let i=this.context.createFramebuffer(t,t,!0,!0),a=this.context.createRenderbuffer(r.DEPTH_STENCIL,t,t);i.depthAttachment.set(a),this._rttSharedFbo={fbo:i,depthRenderbuffer:a,size:t}}this._rttSharedFbo.size!==t&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,t),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=t,this._rttSharedFbo.fbo.height=t,this._rttSharedFbo.size=t),this._rttSharedFbo.fbo.colorAttachment.set(e.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(e){this._rttObjectRecyclePool.push(e)}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let r=this.patternAtlas.getPattern(e.from.toString()),t=this.patternAtlas.getPattern(e.to.toString());return!r||!t}useProgram(e,r,t=!1,i=[]){var a;this.cache||(this.cache={});let o=!!this.style.map.terrain,s=this.style.projection,l=t?rd.projectionMercator:s.shaderPreludeCode,n=t?OM:s.shaderDefine,u=`/${t?NM:s.shaderVariantName}`,c=r?r.cacheKey:"",f=this._showOverdrawInspector?"/overdraw":"",h=o?"/terrain":"",d=i?`/${i.join("/")}`:"",p=e+c+u+f+h+d;return(a=this.cache)[p]||(a[p]=new cO(this.context,rd[e],r,tN[e],this._showOverdrawInspector,o,l,n,i)),this.cache[p]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}setBaseState(){let 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(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let e=this.context.gl;this.debugOverlayTexture=new jl(this.context,this.debugOverlayCanvas,e.RGBA)}}destroy(){var e,r,t;if(this._tileTextures){for(let i in this._tileTextures){let a=this._tileTextures[i];if(a)for(let o of a)o.destroy()}this._tileTextures={}}for(let i of this._rttObjectRecyclePool)i.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let i=this.context.gl;i.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),i.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}if((e=this.layerOpacityFbo)==null||e.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&((r=this.tileExtentMesh.vertexBuffer)==null||r.destroy()),this.tileExtentMesh&&((t=this.tileExtentMesh.indexBuffer)==null||t.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let i in this.cache){let a=this.cache[i];a?.program&&this.context.gl.deleteProgram(a.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:r}=this.context.gl;return this.width!==e||this.height!==r}},N2.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,N2),sS=class extends Error{constructor(e,r){var t;super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=e,this.statusMessage=(t=r?.statusMessage)!=null?t:null}},lS=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{var r;let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):((r=[...t.keys()][0])!=null?r:"").split("/")},this._onHashChange=()=>{let r=this._getCurrentHash();if(!this._isValidHash(r))return!1;let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(r[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:t,pitch:+(r[4]||0)}),!0},this._updateHashUnthrottled=()=>{let r=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,r)},this._removeHash=()=>{let r=this._getHashParams();if(this._hashName)r.delete(this._hashName);else{let o=Array.from(r.keys());o.length>0&&r.delete(o[0])}let t=decodeURIComponent(r.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=t?`#${t}`:"",a=window.location.href.replace(/(#.+)?$/,i);a=a.replace("&&","&"),window.history.replaceState(window.history.state,null,a)},this._updateHash=qz(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let r=this._map.getCenter(),t=Math.round(this._map.getZoom()*100)/100,i=10**Math.ceil((t*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.round(r.lng*i)/i,o=Math.round(r.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),n="";if(n+=e?`/${a}/${o}/${t}`:`${t}/${o}/${a}`,(s||l)&&(n+=`/${Math.round(s*10)/10}`),l&&(n+=`/${Math.round(l)}`),this._hashName){let u=this._getHashParams();return u.set(this._hashName,n),`#${decodeURIComponent(u.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${n}`}_isValidHash(e){if(e.length<3||e.some(a=>isNaN(+a)))return!1;try{new An(+e[2],+e[1])}catch{return!1}let r=+e[0],t=+(e[3]||0),i=+(e[4]||0);return r>=this._map.getMinZoom()&&r<=this._map.getMaxZoom()&&t>=-180&&t<=180&&i>=this._map.getMinPitch()&&i<=this._map.getMaxPitch()}},$m={linearity:.3,easing:H4(0,0,.3,1)},YN=yn({deceleration:2500,maxSpeed:1400},$m),XN=yn({deceleration:20,maxSpeed:1400},$m),ZN=yn({deceleration:1e3,maxSpeed:360},$m),KN=yn({deceleration:1e3,maxSpeed:90},$m),JN=yn({deceleration:1e3,maxSpeed:360},$m),QN=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:hs(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,r=hs();for(;e.length>0&&r-e[0].time>160;)e.shift()}_getVelocityEntries(){let e=this._inertiaBuffer,r=hs()-60,t=Math.max(0,e.length-2);for(;t>0&&e[t-1].time>=r;)t--;return e.slice(t)}_onMoveEnd(e){this._drainInertiaBuffer();let r=this._getVelocityEntries();if(r.length<2){this.clear();return}let t={zoom:0,bearing:0,pitch:0,roll:0,pan:new Wr(0,0),pinchAround:void 0,around:void 0};for(let{settings:o}of r)o.around&&(t.around=o.around),o.pinchAround&&(t.pinchAround=o.pinchAround);for(let{settings:o}of r.slice(1))t.zoom+=o.zoomDelta||0,t.bearing+=o.bearingDelta||0,t.pitch+=o.pitchDelta||0,t.roll+=o.rollDelta||0,o.panDelta&&t.pan._add(o.panDelta);if(!t.pan.mag()&&!t.zoom&&!t.bearing&&!t.pitch&&!t.roll){this.clear();return}let i=hs()-r[0].time,a={};if(t.pan.mag()){let o=Gg(t.pan.mag(),i,yn({},YN,e||{})),s=t.pan.mult(o.amount/t.pan.mag()),l=this._map._camera.cameraHelper.handlePanInertia(s,this._map._camera.transform);a.center=l.easingCenter,a.offset=l.easingOffset,Vg(a,o)}if(t.zoom){let o=Gg(t.zoom,i,XN);a.zoom=Lf(this._map.getZoom()+o.amount,this._map.getZoomSnap(),o.amount),Vg(a,o)}if(t.bearing){let o=Gg(t.bearing,i,ZN);a.bearing=this._map.getBearing()+to(o.amount,-179,179),Vg(a,o)}if(t.pitch){let o=Gg(t.pitch,i,KN);a.pitch=this._map.getPitch()+o.amount,Vg(a,o)}if(t.roll){let o=Gg(t.roll,i,JN);a.roll=this._map.getRoll()+to(o.amount,-179,179),Vg(a,o)}if(a.zoom||a.bearing){let o=t.pinchAround===void 0?t.around:t.pinchAround;a.around=o?this._map.unproject(o):this._map.getCenter()}return this.clear(),yn(a,{noMoveStart:!0})}},e8=class{constructor(e,r){this._map=e,this._clickTolerance=r.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new gM(this._map,e))}mousedown(e,r){return this._mousedownPos=r,this._firePreventable(new df(e.type,this._map,e))}mouseup(e){this._map.fire(new df(e.type,this._map,e))}click(e,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||this._map.fire(new df(e.type,this._map,e))}dblclick(e){return this._firePreventable(new df(e.type,this._map,e))}mouseover(e){this._map.fire(new df(e.type,this._map,e))}mouseout(e){this._map.fire(new df(e.type,this._map,e))}touchstart(e){return this._firePreventable(new jm(e.type,this._map,e))}touchmove(e){this._map.fire(new jm(e.type,this._map,e))}touchend(e){this._map.fire(new jm(e.type,this._map,e))}touchcancel(e){this._map.fire(new jm(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},t8=class{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new df(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new df("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new df(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},uS=class{constructor(e,r,t){this._map=e,this._tr=t,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1,r.boxZoom&&typeof r.boxZoom=="object"&&(this._boxZoomEnd=r.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&e.button===0&&($n.disableDrag(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(e,r){if(!this._active)return;let t=r;if(this._lastPos.equals(t)||!this._box&&t.dist(this._startPos)a.fitScreenCoordinates(t,i,this._tr.bearing,{linear:!0})}}}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box=(this._box.remove(),null)),$n.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new d2(e,{originalEvent:r}))}},r8=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,t){(this.centroid||t.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),t.length===this.numTouches&&(this.centroid=mse(r),this.touches=fM(t,r)))}touchmove(e,r,t){if(this.aborted||!this.centroid)return;let i=fM(t,r);for(let a in this.touches){let o=this.touches[a],s=i[a];(!s||s.dist(o)>30)&&(this.aborted=!0)}}touchend(e,r,t){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),t.length===0){let i=!this.aborted&&this.centroid;if(this.reset(),i)return i}}},j2=class{constructor(e){this.singleTap=new r8(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,r,t){this.singleTap.touchstart(e,r,t)}touchmove(e,r,t){this.singleTap.touchmove(e,r,t)}touchend(e,r,t){let i=this.singleTap.touchend(e,r,t);if(i){let a=e.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(i)<30;if((!a||!o)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}},i8=class{constructor(e,r){this._tr=r,this._zoomIn=new j2({numTouches:1,numTaps:2}),this._zoomOut=new j2({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,r,t){this._zoomIn.touchstart(e,r,t),this._zoomOut.touchstart(e,r,t)}touchmove(e,r,t){this._zoomIn.touchmove(e,r,t),this._zoomOut.touchmove(e,r,t)}touchend(e,r,t){let i=this._zoomIn.touchend(e,r,t),a=this._zoomOut.touchend(e,r,t),o=this._tr;if(i)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:s=>s.easeTo({duration:300,zoom:Lf(o.zoom+1,s.getZoomSnap()),around:o.unproject(i)},{originalEvent:e})};if(a)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:s=>s.easeTo({duration:300,zoom:Lf(o.zoom-1,s.getZoomSnap()),around:o.unproject(a)},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},Wm=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let r=this._moveFunction(...e);if(r.bearingDelta||r.pitchDelta||r.rollDelta||r.around||r.panDelta)return this._active=!0,r}dragStart(e,r){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(r)?r[0]:r,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,r){if(!this.isEnabled())return;let t=this._lastPoint;if(!t)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let i=Array.isArray(r)?r[0]:r;if(!(!this._moved&&i.dist(t)!0}),r=new n8){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=r}_executeRelevantHandler(e,r,t){if(e instanceof MouseEvent)return r(e);if(typeof TouchEvent<"u"&&e instanceof TouchEvent)return t(e)}startMove(e){this._executeRelevantHandler(e,r=>{this.mouseMoveStateManager.startMove(r)},r=>{this.oneFingerTouchMoveStateManager.startMove(r)})}endMove(e){this._executeRelevantHandler(e,r=>{this.mouseMoveStateManager.endMove(r)},r=>{this.oneFingerTouchMoveStateManager.endMove(r)})}isValidStartEvent(e){return!!this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidStartEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidStartEvent(r))}isValidMoveEvent(e){return!!this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidMoveEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(r))}isValidEndEvent(e){return!!this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidEndEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidEndEvent(r))}},iy=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=r=>{r.preventDefault()}},s8=class{constructor(e,r){this._clickTolerance=e.clickTolerance||1,this._map=r,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new Wr(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,r,t){return this._calculateTransform(e,r,t)}touchmove(e,r,t){if(this._active){if(this._shouldBePrevented(t.length)){this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e);return}return e.preventDefault(),this._calculateTransform(e,r,t)}}touchend(e,r,t){this._calculateTransform(e,r,t),this._active&&this._shouldBePrevented(t.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,t){t.length>0&&(this._active=!0);let i=fM(t,r),a=new Wr(0,0),o=new Wr(0,0),s=0;for(let n in i){let u=i[n],c=this._touches[n];c&&(a._add(u),o._add(u.sub(c)),s++,i[n]=u)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;let l=o.div(s);if(this._sum._add(l),!(this._sum.mag()=2,a=r.mag()>=2;if(!i&&!a)return;if(!i||!a)return this._firstMove===void 0&&(this._firstMove=t),t-this._firstMove<100&&void 0;let o=e.y>0==r.y>0;return hM(e)&&hM(r)&&o}},l8={panStep:100,bearingStep:15,pitchStep:10},pS=class{constructor(e,r){this._tr=r;let t=l8;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let r=0,t=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?t=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?t=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(t=0,i=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:wse,zoom:r?Lf(l.zoom+r*(e.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+t*this._bearingStep,pitch:l.pitch+i*this._pitchStep,offset:[-a*this._panStep,-o*this._panStep],center:l.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}},vS=4.000244140625,mS=class{constructor(e,r,t){this._onTimeout=i=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},this._map=e,this._tr=t,this._triggerRenderFrame=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return this._map.cooperativeGestures.isEnabled()?!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e)):!1}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e)){this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);return}let r=e.deltaMode===WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY,t=hs(),i=t-(this._lastWheelEventTime||0);this._lastWheelEventTime=t,r!==0&&r%vS==0?this._type="wheel":r!==0&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=$n.mousePos(this._map.getCanvas(),e),t=this._tr;this._aroundPoint=this._aroundCenter?t.transform.locationToScreenPoint(An.convert(t.center)):r,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let s=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=s),typeof this._targetZoom=="number"&&(this._targetZoom+=s)}if(this._delta!==0){let s=this._type==="wheel"&&Math.abs(this._delta)>vS?this._wheelZoomRate:this._defaultZoomRate,l=2/(1+Math.exp(-Math.abs(this._delta*s)));this._delta<0&&l!==0&&(l=1/l);let n=typeof this._targetZoom=="number"?Vc(this._targetZoom):e.scale,u=e.applyConstrain(e.getCameraLngLat(),Ku(n*l)).zoom,c=this._map.getZoomSnap();if(this._type==="wheel"&&c>0){let f=Lf(e.zoom,c);this._targetZoom=Lf(u,c,u-f)}else this._targetZoom=u;this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let r=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,t=this._startZoom,i=this._easing,a=!1,o;if(this._type==="wheel"&&t&&i){let s=hs()-this._lastWheelEventTime,l=Math.min((s+5)/200,1),n=i(l);o=Zs.number(t,r,n),l<1?this._needsRerender=!0:a=!0}else o=r,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=o,{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=Sx;if(this._prevEase){let t=this._prevEase,i=(hs()-t.start)/t.duration,a=t.easing(i+.01)-t.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=H4(o,s,.25,1)}return this._prevEase={start:hs(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},gS=class{constructor(e,r){this._clickZoom=e,this._tapZoom=r}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()}},u8=class{constructor(e,r){this._tr=r,this.reset()}reset(){this._active=!1}dblclick(e,r){return e.preventDefault(),{cameraAnimation:t=>{t.easeTo({duration:300,zoom:Lf(this._tr.zoom+(e.shiftKey?-1:1),t.getZoomSnap()),around:this._tr.unproject(r)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},c8=class{constructor(){this._tap=new j2({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,r,t){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(e,r,t);else{let i=r[0],a=e.timeStamp-this._tapTime<500,o=this._tapPoint.dist(i)<30;!a||!o?this.reset():t.length>0&&(this._swipePoint=i,this._swipeTouch=t[0].identifier)}}touchmove(e,r,t){if(!this._tapTime)this._tap.touchmove(e,r,t);else if(this._swipePoint){if(t[0].identifier!==this._swipeTouch)return;let i=r[0],a=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:a/128*this._zoomRate}}}touchend(e,r,t){if(this._tapTime)this._swipePoint&&t.length===0&&this.reset();else{let i=this._tap.touchend(e,r,t);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},yS=class{constructor(e,r,t){this._el=e,this._mousePan=r,this._touchPan=t}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},_S=class{constructor(e,r,t,i){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=r,this._mousePitch=t,this._mouseRoll=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},xS=class{constructor(e,r,t,i){this._el=e,this._touchZoom=r,this._touchRotate=t,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},bS=class{constructor(e,r){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=r,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=$n.create("div","maplibregl-cooperative-gesture-screen",e);let r=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(r=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let t=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=r,this._container.appendChild(i);let a=document.createElement("div");a.className="maplibregl-mobile-message",a.textContent=t,this._container.appendChild(a),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new iu("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},f8=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(Wr.convert(e),this._camera.terrain)}},ay=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate,h8=class extends hf{},d8=class{get _ownerDocument(){var e;return((e=this._el)==null?void 0:e.ownerDocument)||document}get _ownerWindow(){var e,r;return((r=(e=this._el)==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)||window}constructor(e,r,t){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=a=>{this.handleEvent(a,`${a.type}Window`)},this.handleEvent=(a,o)=>{if(a.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let s=a.type==="renderFrame"?void 0:a,l={needsRenderFrame:!1},n={},u={};for(let{handlerName:h,handler:d,allowed:p}of this._handlers){if(!d.isEnabled())continue;let g;if(this._blockedByActive(u,p,h))d.reset();else if(d[o||a.type]){if(hJ(a,o||a.type)){let m=$n.mousePos(this._map.getCanvas(),a);g=d[o||a.type](a,m)}else if(fJ(a,o||a.type)){let m=a.touches,y=this._getMapTouches(m),_=$n.touchPos(this._map.getCanvas(),y);g=d[o||a.type](a,_,y)}else dJ(o||a.type)||(g=d[o||a.type](a));this.mergeHandlerResult(l,n,g,h,s),g?.needsRenderFrame&&this._triggerRenderFrame()}(g||d.isActive())&&(u[h]=d)}let c={};for(let h in this._previousActiveHandlers)u[h]||(c[h]=s);this._previousActiveHandlers=u,(Object.keys(c).length||dM(l))&&(this._changes.push([l,n,c]),this._triggerRenderFrame()),(Object.keys(u).length||dM(l))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:f}=l;f&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],f(this._map))},this._map=e,this._camera=r,this._transformProvider=new f8(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new QN(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);let i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[a,o,s]of this._listeners)a.addEventListener(o,a===this._ownerDocument?this.handleWindowEvent:this.handleEvent,s)}destroy(){for(let[e,r,t]of this._listeners)e.removeEventListener(r,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,t)}_addDefaultHandlers(e){let r=this._map,t=r.getCanvasContainer();this._add("mapEvent",new e8(r,e));let i=r.boxZoom=new uS(r,e,this._transformProvider);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let a=r.cooperativeGestures=new bS(r,e.cooperativeGestures);this._add("cooperativeGestures",a),e.cooperativeGestures&&a.enable();let o=new i8(r,this._transformProvider),s=new u8(r,this._transformProvider);r.doubleClickZoom=new gS(s,o),this._add("tapZoom",o),this._add("clickZoom",s),e.interactive&&e.doubleClickZoom&&r.doubleClickZoom.enable();let l=new c8;this._add("tapDragZoom",l);let n=r.touchPitch=new dS(r);this._add("touchPitch",n),e.interactive&&e.touchPitch&&r.touchPitch.enable(e.touchPitch);let u=()=>r.project(r.getCenter()),c=_se(e,u),f=xse(e),h=bse(e,u);r.dragRotate=new _S(e,c,f,h),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",f,["mouseRotate","mouseRoll"]),this._add("mouseRoll",h,["mousePitch"]),e.interactive&&e.dragRotate&&r.dragRotate.enable();let d=yse(e),p=new s8(e,r);r.dragPan=new yS(t,d,p),this._add("mousePan",d),this._add("touchPan",p,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&r.dragPan.enable(e.dragPan);let g=new hS,m=new fS;r.touchZoomRotate=new xS(t,m,g,l),this._add("touchRotate",g,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&r.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new t8(r));let y=r.scrollZoom=new mS(r,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",y,["mousePan"]),e.interactive&&e.scrollZoom&&r.scrollZoom.enable(e.scrollZoom);let _=r.keyboard=new pS(r,this._transformProvider);this._add("keyboard",_),e.interactive&&e.keyboard&&r.keyboard.enable()}_add(e,r,t){this._handlers.push({handlerName:e,handler:r,allowed:t}),this._handlersById[e]=r}stop(e){if(!this._updatingCamera){for(let{handler:r}of this._handlers)r.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{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!!ay(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,r,t){for(let i in e)if(i!==t&&!r?.includes(i))return!0;return!1}_getMapTouches(e){let r=[];for(let t of e){let i=t.target;this._el.contains(i)&&r.push(t)}return r}mergeHandlerResult(e,r,t,i,a){if(!t)return;yn(e,t);let o={handlerName:i,originalEvent:t.originalEvent||a};t.zoomDelta!==void 0&&(r.zoom=o),t.panDelta!==void 0&&(r.drag=o),t.rollDelta!==void 0&&(r.roll=o),t.pitchDelta!==void 0&&(r.pitch=o),t.bearingDelta!==void 0&&(r.rotate=o)}_applyChanges(){let e={},r={},t={};for(let[i,a,o]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new Wr(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.rollDelta&&(e.rollDelta=(e.rollDelta||0)+i.rollDelta),i.around!==void 0&&(e.around=i.around),i.pinchAround!==void 0&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),yn(r,a),yn(t,o);this._updateMapTransform(e,r,t),this._changes=[]}_updateMapTransform(e,r,t){let i=this._map,a=this._camera.getTransformForUpdate(),o=i.terrain;if(!dM(e)&&!(o&&this._terrainMovement)){this._fireEvents(r,t,!0);return}this._camera.stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:n,pitchDelta:u,rollDelta:c}=e,{around:f,aroundOnSurface:h}=this._resolveAround(e,o,a),d=o?this._terrainGestureElevation(o,f,h,a,r):void 0,p={panDelta:s,zoomDelta:l,rollDelta:c,pitchDelta:u,bearingDelta:n,around:f,aroundElevation:d};this._camera.cameraHelper.useGlobeControls&&!a.isPointOnMapSurface(f)&&(f=a.centerPoint);let g=this._computePreZoomAroundLoc(a,f,s,d);this._handleMapControls({terrain:o,tr:a,deltasForHelper:p,preZoomAroundLoc:g,combinedEventsInProgress:r,panDelta:s}),this._camera.applyUpdatedTransform(a),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(r,t,!0)}_resolveAround(e,r,t){let i=e.pinchAround===void 0?e.around:e.pinchAround;return i||(i=this._camera.transform.centerPoint),r&&!t.isPointOnMapSurface(i)?{around:t.centerPoint,aroundOnSurface:!1}:{around:i,aroundOnSurface:!0}}_terrainGestureElevation(e,r,t,i,a){if(!t)return;if(!this._terrainMovement&&(a.drag||a.zoom)){let s=i.screenTerrainPointToMercatorCoordinate(r,e);this._terrainGestureAnchorElevation=s?s.z:null}if(this._terrainGestureAnchorElevation===null)return;let o=this._terrainGestureAnchorElevation;if(!(r.distSqr(i.centerPoint)<.01)&&!(o-i.elevation>=.9*(i.getCameraAltitude()-i.elevation)))return o}_computePreZoomAroundLoc(e,r,t,i){if(r.distSqr(e.centerPoint)<.01)return e.center;let a=t?r.sub(t):r;return i===void 0?e.screenPointToLocation(a):e.screenPointToLocationAtElevation(a,i)}_handleMapControls({terrain:e,tr:r,deltasForHelper:t,preZoomAroundLoc:i,combinedEventsInProgress:a,panDelta:o}){let s=this._camera.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(t,r),!e){s.handleMapControlsPan(t,r,i);return}if(s.useGlobeControls){!this._terrainMovement&&(a.drag||a.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),s.handleMapControlsPan(t,r,i);return}if(!this._terrainMovement&&(a.drag||a.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,s.handleMapControlsPan(t,r,i);return}if(t.aroundElevation===void 0&&a.drag&&this._terrainMovement&&o){r.setCenter(r.screenPointToLocation(r.centerPoint.sub(o)));return}s.handleMapControlsPan(t,r,i)}_fireEvents(e,r,t){let i=ay(this._eventsInProgress),a=ay(e),o={};for(let c in e){let{originalEvent:f}=e[c];this._eventsInProgress[c]||(o[`${c}start`]=f),this._eventsInProgress[c]=e[c]}!i&&a&&this._fireEvent("movestart",a.originalEvent);for(let c in o)this._fireEvent(c,o[c]);a&&this._fireEvent("move",a.originalEvent);for(let c in e){let{originalEvent:f}=e[c];this._fireEvent(c,f)}let s={},l;for(let c in this._eventsInProgress){let{handlerName:f,originalEvent:h}=this._eventsInProgress[c];this._handlersById[f].isActive()||(delete this._eventsInProgress[c],l=r[f]||h,s[`${c}end`]=l)}for(let c in s)this._fireEvent(c,s[c]);let n=ay(this._eventsInProgress),u=(i||a)&&!n;if(u&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let c=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&c.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(c)}if(t&&u){this._updatingCamera=!0;let c=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),f=h=>h!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new h8("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},p8=class extends Nl{constructor(e){var r,t,i;super(),this._renderFrameCallback=()=>{let a=Math.min((hs()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new Kg,this.cameraHelper=new Jg,e.minZoom!==void 0&&this.transform.setMinZoom(e.minZoom),e.maxZoom!==void 0&&this.transform.setMaxZoom(e.maxZoom),e.minPitch!==void 0&&this.transform.setMinPitch(e.minPitch),e.maxPitch!==void 0&&this.transform.setMaxPitch(e.maxPitch),e.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(e.renderWorldCopies),e.transformConstrain!==null&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=(r=e.centerClampedToGround)!=null?r:!0,this.transformCameraUpdate=(t=e.transformCameraUpdate)!=null?t:null,this._stopHandlers=(i=e.stopHandlers)!=null?i:(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,r){if(e.apply(this.transform,!0),this.transform=e,this.cameraHelper=r,this._requestedCameraState){let t=e.clone();t.apply(this._requestedCameraState,!0),this._requestedCameraState=t}}getCenter(){return new An(this.transform.center.lng,this.transform.center.lat)}setCenter(e,r){return this.jumpTo({center:e},r)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,r){return this.jumpTo({elevation:e},r),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,r,t){return e=Wr.convert(e).mult(-1),this.panTo(this.transform.center,yn({offset:e},r),t)}panTo(e,r,t){return this.easeTo(yn({center:e},r),t)}getZoom(){return this.transform.zoom}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomTo(e,r,t){return this.easeTo(yn({zoom:e},r),t)}zoomIn(e,r){return this.zoomTo(Lf(this.getZoom()+1,this._zoomSnap),e,r),this}zoomOut(e,r){return this.zoomTo(Lf(this.getZoom()-1,this._zoomSnap),e,r),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,r){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new kn("movestart",r)).fire(new kn("move",r)).fire(new kn("moveend",r))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,r){return this.jumpTo({bearing:e},r),this}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(e,r,t){return this.easeTo(yn({bearing:e},r),t)}resetNorth(e,r){return this.rotateTo(0,yn({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(yn({bearing:0,pitch:0,roll:0,duration:1e3},e),r),this}snapToNorth(e,r){return Math.abs(this.getBearing()){p.easeFunc(g),this.terrain&&!e.freezeElevation&&this._updateElevation(g),this.applyUpdatedTransform(t),this._fireMoveEvents(r)},g=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,g)},e),this}_prepareEase(e,r,t={}){this._moving=!0,!r&&!t.moving&&this.fire(new kn("movestart",e)),this._zooming&&!t.zooming&&this.fire(new kn("zoomstart",e)),this._rotating&&!t.rotating&&this.fire(new kn("rotatestart",e)),this._pitching&&!t.pitching&&this.fire(new kn("pitchstart",e)),this._rolling&&!t.rolling&&this.fire(new kn("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(e,this.transform),this.elevationFreeze=!0}_updateElevation(e){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let r=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(e<1&&r!==this._elevationTarget){let t=this._elevationTarget-this._elevationStart,i=(r-(t*e+this._elevationStart))/(1-e);this._elevationStart+=e*(t-i),this._elevationTarget=r}this.transform.setElevation(Zs.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState)}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};let r=e.getCameraLngLat(),t=e.getCameraAltitude(),i=this.terrain?this.terrain.getElevationForLngLatZoom(r,e.zoom):0;if(tthis._elevateCameraIfInsideTerrain(i)),this.transformCameraUpdate&&r.push(i=>this.transformCameraUpdate(i)),!r.length)return;let t=e.clone();for(let i of r){let a=t.clone(),{center:o,zoom:s,roll:l,pitch:n,bearing:u,elevation:c}=i(a);o&&a.setCenter(o),c!==void 0&&a.setElevation(c),s!==void 0&&a.setZoom(s),l!==void 0&&a.setRoll(l),n!==void 0&&a.setPitch(n),u!==void 0&&a.setBearing(u),t.apply(a,!1)}this.transform.apply(t,!1)}_fireMoveEvents(e){this.fire(new kn("move",e)),this._zooming&&this.fire(new kn("zoom",e)),this._rotating&&this.fire(new kn("rotate",e)),this._pitching&&this.fire(new kn("pitch",e)),this._rolling&&this.fire(new kn("roll",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;let t=this._zooming,i=this._rotating,a=this._pitching,o=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,t&&this.fire(new kn("zoomend",e)),i&&this.fire(new kn("rotateend",e)),a&&this.fire(new kn("pitchend",e)),o&&this.fire(new kn("rollend",e)),this.fire(new kn("moveend",e))}flyTo(e,r){if(!e.essential&&yc.prefersReducedMotion){let T=N1(e,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(T,r)}this.stop(),e=yn({offset:[0,0],speed:1.2,curve:1.42,easing:Sx},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Lf(e.zoom,this._zoomSnap));let t=this.getTransformForUpdate(),i=t.bearing,a=t.pitch,o=t.roll,s=t.padding,l=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),n=e.pitch===void 0?a:+e.pitch,u=e.roll===void 0?o:this._normalizeBearing(e.roll,o),c=e.padding===void 0?t.padding:e.padding,f=Wr.convert(e.offset),h=t.centerPoint.add(f),d=t.screenPointToLocation(h),p=this.cameraHelper.handleFlyTo(t,{bearing:l,pitch:n,roll:u,padding:c,locationAtOffset:d,offsetAsPoint:f,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),g=e.curve,m=Math.max(t.width,t.height),y=m/p.scaleOfZoom,_=p.pixelPathLength,v=m/p.scaleOfMinZoom;g=Math.min(g,Math.sqrt(v/_*2));let x=g*g;function S(T){let F=(y*y-m*m+(T?-1:1)*x*x*_*_)/(2*(T?y:m)*x*_);return Math.log(Math.sqrt(F*F+1)-F)}function M(T){return(Math.exp(T)-Math.exp(-T))/2}function C(T){return(Math.exp(T)+Math.exp(-T))/2}function w(T){return M(T)/C(T)}let k=S(!1),A=function(T){return C(k)/C(k+g*T)},b=function(T){return m*((C(k)*w(k+g*T)-M(k))/x)/_},E=(S(!0)-k)/g;if(Math.abs(_)<2e-6||!isFinite(E)){if(Math.abs(m-y)<1e-6)return this.easeTo(e,r);let T=y0,A=F=>Math.exp(T*g*F)}if(e.duration!==void 0)e.duration=+e.duration;else{let T=e.screenSpeed===void 0?+e.speed:+e.screenSpeed/g;e.duration=1e3*E/T}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=i!==l,this._pitching=n!==a,this._rolling=u!==o,this._padding=!t.isPaddingEqual(c),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(p.targetCenter),this._ease(T=>{let F=T*E,D=1/A(F),R=b(F);this._rotating&&t.setBearing(Zs.number(i,l,T)),this._pitching&&t.setPitch(Zs.number(a,n,T)),this._rolling&&t.setRoll(Zs.number(o,u,T)),this._padding&&(t.interpolatePadding(s,c,T),h=t.centerPoint.add(f)),p.easeFunc(T,D,R,h),this.terrain&&!e.freezeElevation&&this._updateElevation(T),this.applyUpdatedTransform(t),this._fireMoveEvents(r)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,r){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,r)}return e||this._stopHandlers(),this}_ease(e,r,t){t.animate===!1||t.duration===0?(e(1),r()):(this._easeStart=hs(),this._easeOptions=t,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=ch(e,-180,180);let t=Math.abs(e-r);return Math.abs(e-360-r)MapLibre'},TS=class{constructor(e=wS){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=r=>{r&&(r.type==="terrain"||r.dataType==="style"||r.dataType==="source"&&(r.sourceDataType==="metadata"||r.sourceDataType==="visibility"))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):!this._container.classList.contains("maplibregl-compact")&&!this._container.classList.contains("maplibregl-attrib-empty")&&(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=$n.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=$n.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=$n.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,r){let t=this._map._getUIString(`AttributionControl.${r}`);e.title=t,e.setAttribute("aria-label",t)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(i=>typeof i=="string"?i:"")):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let i=this._map.style.stylesheet;this.styleOwner=i.owner,this.styleId=i.id}let r=this._map.style.tileManagers;for(let i in r){let a=r[i];if(a.used||a.usedForTerrain){let o=a.getSource();o.attribution&&!e.includes(o.attribution)&&e.push(o.attribution)}}e=e.filter(i=>String(i).trim()),e.sort((i,a)=>i.length-a.length),e=e.filter((i,a)=>{for(let o=a+1;o{let r=this._container.children;if(r.length){let t=r[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){var r;this._map=e,this._compact=(r=this.options)==null?void 0:r.compact,this._container=$n.create("div","maplibregl-ctrl");let t=$n.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},v8=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let r=++this._id;return this._queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){let r=this._currentlyRunning,t=r?this._queue.concat(r):this._queue;for(let i of t)if(i.id===e){i.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let r=this._currentlyRunning=this._queue;this._queue=[];let t=!1,i;for(let a of r)if(!a.cancelled){try{a.callback(e)}catch(o){t||(t=!0,i=o)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,t)throw i}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},MS=["none","zoom","sourceTiles","visibleLayers","revision"],m8=class{constructor(e,r,t,i){this._tileKeys=e.map(a=>a.key).sort().join(),this._revision=r,this._zoom=t,this._visibleLayerIds=i}difference(e){return this._revision===e?._revision?this._visibleLayerIds===e._visibleLayerIds?this._tileKeys===e._tileKeys?this._zoom===e._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},av={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0},g8=class{constructor(e,r){this.needsFollowUpFrame=!1,this.painter=e,this.terrain=r,this.rttSize=r.tileManager.tileSize*r.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}prepareForRender(e,r){let t=r!==this._lastPrepareZoom;this._lastPrepareZoom=r,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(l=>!e._layers[l].isHidden(r));let i=this._renderableLayerIds.join(),a=new Set;for(let l of this._renderableLayerIds){let n=e._layers[l],u=n.source;u&&av[n.type]&&a.add(u)}this._coordsAscending={},this._rttFingerprints={};for(let l of a){let n=e.tileManagers[l];if(!n)continue;this._coordsAscending[l]={};let u=this._coordsAscending[l],c=n.getSource(),f=c instanceof rv?c.terrainTileRanges:null;for(let p of n.getVisibleCoordinates()){let g=this.terrain.tileManager.getTerrainCoords(p,f);for(let m in g)u[m]||(u[m]=[]),u[m].push(g[m])}this._rttFingerprints[l]={};let h=this._rttFingerprints[l],d=n.getState().revision;for(let p in u)h[p]=new m8(u[p],d,r,i)}this.needsFollowUpFrame=!1;let o=t||this.painter.options.moving,s=!1;for(let l of this._renderableTiles){let n=this._textureDifference(l);n!=="none"&&(n==="zoom"&&o||n==="visibleLayers"&&t?this.needsFollowUpFrame=!0:n==="zoom"||n==="sourceTiles"?(s?this.needsFollowUpFrame=!0:l.releaseRTT(this.painter),s=!0):l.releaseRTT(this.painter))}}_textureDifference(e){let r="none";for(let t in this._rttFingerprints){let i=this._rttFingerprints[t][e.tileID.key];if(!i)continue;let a=i.difference(e.rttFingerprint[t]);MS.indexOf(a)>MS.indexOf(r)&&(r=a)}return r}renderLayer(e,r){if(e.isHidden(this.painter.transform.zoom))return!1;let t=ar(Ot({},r),{isRenderingToTexture:!0}),i=e.type,a=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(av[i]&&((!this._prevType||!av[this._prevType])&&this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(e.id),!o))return!0;if(av[this._prevType]||av[i]&&o){this._prevType=i;let s=this._stacks.length-1,l=this._stacks[s]||[];for(let n of this._renderableTiles){if(this._rttTiles.push(n),n.getRTT(s))continue;let u=n.acquireRTT(a,s,this.rttSize);a.bindRTT(u),a.context.clear({color:ro.transparent,stencil:0}),a.currentStencilSource=void 0;for(let c of l){let f=a.style._layers[c],h=f.source?this._coordsAscending[f.source][n.tileID.key]:[n.tileID];a.context.viewport.set([0,0,this.rttSize,this.rttSize]),a.renderTileClippingMasks(f,h,!0),a.renderLayer(a,a.style.tileManagers[f.source],f,h,t),f.source&&(n.rttFingerprint[f.source]=this._rttFingerprints[f.source][n.tileID.key])}u.texture.generateMipmap()}return fse(this.painter,this.terrain,this._rttTiles,t),this._rttTiles=[],av[i]}return!1}},y8={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},_8=vM,SS={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:wS,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:ff.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},ES=class extends Nl{get _ownerWindow(){var e,r;return((r=(e=this._container)==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)||window}constructor(e){var r,t,i;super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new v8,this._controls=[],this._mapId=x9(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=l=>{if(l.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style){this.fire(new Wg("webglcontextlost",{originalEvent:l}));return}for(let n of Object.values(this.style._layers))if(n.type==="custom"&&console.warn(`Custom layer with id '${n.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),n._listeners)for(let[u]of Object.entries(n._listeners))console.warn(`Custom layer with id '${n.id}' had event listeners for event '${u}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new Wg("webglcontextlost",{originalEvent:l}))},this._contextRestored=l=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style){this.style.imageManager.images=this._lostContextStyle.images;for(let n in this._lostContextStyle.images){let u=this._lostContextStyle.images[n];u.isWebGLImage&&this.style.imageManager.updateImage(n,u,!1)}}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(n){this.fire(new Ln(n));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new Wg("webglcontextrestored",{originalEvent:l}))},this._onMapScroll=l=>{if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let a=ar(Ot(Ot({},SS),e),{canvasContextAttributes:Ot(Ot({},SS.canvasContextAttributes),e.canvasContextAttributes)});if(a.minZoom!=null&&a.maxZoom!=null&&a.minZoom>a.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(a.minPitch!=null&&a.maxPitch!=null&&a.minPitch>a.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(a.minPitch!=null&&a.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(a.maxPitch!=null&&a.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new p8({minZoom:a.minZoom,maxZoom:a.maxZoom,minPitch:a.minPitch,maxPitch:a.maxPitch,bearingSnap:a.bearingSnap,zoomSnap:a.zoomSnap,renderWorldCopies:a.renderWorldCopies,centerClampedToGround:a.centerClampedToGround,terrain:this.terrain,transformConstrain:a.transformConstrain,requestRenderFrame:l=>this._requestRenderFrame(l),cancelRenderFrame:l=>this._cancelRenderFrame(l),transformCameraUpdate:a.transformCameraUpdate,stopHandlers:()=>{var l;return(l=this._handlers)==null?void 0:l.stop(!1)}}),this._camera.setEventedParent(this),this._interactive=a.interactive,this._maxTileCacheSize=a.maxTileCacheSize,this._maxTileCacheZoomLevels=a.maxTileCacheZoomLevels,this._canvasContextAttributes=Ot({},a.canvasContextAttributes),this._trackResize=a.trackResize===!0,this._terrainSkirtLength=a.terrainSkirtLength,this._refreshExpiredTiles=a.refreshExpiredTiles===!0,this._fadeDuration=a.fadeDuration,this._crossSourceCollisions=a.crossSourceCollisions===!0,this._collectResourceTiming=a.collectResourceTiming===!0,this._locale=Ot(Ot({},y8),a.locale),this._clickTolerance=a.clickTolerance,this._overridePixelRatio=a.pixelRatio,this._maxCanvasSize=a.maxCanvasSize,this._zoomLevelsToOverscale=a.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=a.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(a.anisotropicFilterPitch),a.reduceMotion!==void 0&&(yc.prefersReducedMotion=a.reduceMotion),this._requestManager=new Zz(a.transformRequest),this._container=this._resolveContainer(a.container),a.maxBounds&&this.setMaxBounds(a.maxBounds),this._setupContainer();try{this._setupPainter()}catch(l){throw this._cleanupContainer(),l}this._imageQueueHandle=td.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new d8(this,this._camera,a),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let o=typeof a.hash=="string"&&a.hash||void 0;this._hash=a.hash?new lS(o).addTo(this):void 0,(r=this._hash)!=null&&r._onHashChange()||(this.jumpTo({center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,roll:a.roll}),a.bounds&&(this.resize(),this.fitBounds(a.bounds,yn({},a.fitBoundsOptions,{duration:0}))));let s=typeof a.style=="string"||((i=(t=a.style)==null?void 0:t.projection)==null?void 0:i.type)!=="globe";this.resize(null,s),this._localIdeographFontFamily=a.localIdeographFontFamily,this._validateStyle=a.validateStyle,a.style&&this.setStyle(a.style,{localIdeographFontFamily:a.localIdeographFontFamily}),a.attributionControl&&this.addControl(new TS(typeof a.attributionControl=="boolean"?void 0:a.attributionControl)),a.maplibreLogo&&this.addControl(new AS,a.logoPosition),this.on("style.load",()=>{if(s||this._resizeTransform(),this._camera.transform.unmodified){let l=N1(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(l)}}),this.on("data",l=>{this._update(l.dataType==="style"),this.fire(l.dataType==="style"?new Nf("styledata",l):new zs("sourcedata",l))}),this.on("dataloading",l=>{this.fire(l.dataType==="style"?new Nf("styledataloading",l):new zs("sourcedataloading",l))}),this.on("dataabort",l=>{this.fire(new zs("sourcedataabort",l))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,r){return this.style.setGlobalStateProperty(e,r),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,r){if(r===void 0&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new Ln(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let t=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[r];return r.includes("bottom")?i.insertBefore(t,i.firstChild):i.appendChild(t),this}removeControl(e){if(!e?.onRemove)return this.fire(new Ln(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return Bm(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new An(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,r){return this._camera.setCenter(e,r),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,r){return this._camera.setCenterElevation(e,r),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,r,t){return this._camera.panBy(e,r,t),this}panTo(e,r,t){return this._camera.panTo(e,r,t),this}getZoom(){return this._camera.transform.zoom}setZoom(e,r){return this._camera.setZoom(e,r),this}zoomTo(e,r,t){return this._camera.zoomTo(e,r,t),this}zoomIn(e,r){return this._camera.zoomIn(e,r),this}zoomOut(e,r){return this._camera.zoomOut(e,r),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,r){return this._camera.setVerticalFieldOfView(e,r),this}getBearing(){return this._camera.transform.bearing}setBearing(e,r){return this._camera.setBearing(e,r),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,r){return this._camera.setPadding(e,r),this}rotateTo(e,r,t){return this._camera.rotateTo(e,r,t),this}resetNorth(e,r){return this._camera.resetNorth(e,r),this}resetNorthPitch(e,r){return this._camera.resetNorthPitch(e,r),this}snapToNorth(e,r){return this._camera.snapToNorth(e,r),this}getPitch(){return this._camera.transform.pitch}setPitch(e,r){return this._camera.setPitch(e,r),this}getRoll(){return this._camera.transform.roll}setRoll(e,r){return this._camera.setRoll(e,r),this}cameraForBounds(e,r){return this._camera.cameraForBounds(e,r)}fitBounds(e,r,t){return this._camera.fitBounds(e,r,t),this}fitScreenCoordinates(e,r,t,i,a){return this._camera.fitScreenCoordinates(e,r,t,i,a),this}jumpTo(e,r){return this._camera.jumpTo(e,r),this}calculateCameraOptionsFromCameraLngLatAltRotation(e,r,t,i,a){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,r,t,i,a)}easeTo(e,r){return this._camera.easeTo(e,r),this}flyTo(e,r){return this._camera.flyTo(e,r),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(An.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,r,t,i){return i==null&&this.terrain&&(i=this.terrain.getElevationForLngLat(t,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(e,r,t,i??0)}resize(e,r=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(r);let t=!this._camera._moving;return t&&(this.stop(),this.fire(new kn("movestart",e)).fire(new kn("move",e))),this.fire(new iu("resize",e)),t&&this.fire(new kn("moveend",e)),this}_resizeInternal(e=!0){let[r,t]=this._containerDimensions(),i=this._getClampedPixelRatio(r,t);if(this._resizeCanvas(r,t,i),this.painter.resize(r,t,i),this.painter.overLimit()){let a=this.painter.context.gl;this._maxCanvasSize=[a.drawingBufferWidth,a.drawingBufferHeight];let o=this._getClampedPixelRatio(r,t);this._resizeCanvas(r,t,o),this.painter.resize(r,t,o)}this._resizeTransform(e)}_resizeTransform(e=!0){var r;let[t,i]=this._containerDimensions();this._camera.transform.resize(t,i,e),(r=this._camera._requestedCameraState)==null||r.resize(t,i,e)}_getClampedPixelRatio(e,r){let{0:t,1:i}=this._maxCanvasSize,a=this.getPixelRatio(),o=e*a,s=r*a,l=o>t?t/o:1,n=s>i?i/s:1,u=Math.min(l,n);return u<1&&To("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),u*a}getPixelRatio(){var e;return(e=this._overridePixelRatio)!=null?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.transform.setMaxBounds(bh.convert(e)),this._update()}setMinZoom(e){if(e??(e=-2),e>=-2&&e<=this._camera.transform.maxZoom){let r=this._camera.transform.zoom,t=this._camera.getTransformForUpdate();return t.setMinZoom(e),this._camera.applyUpdatedTransform(t),this._update(),r!==this._camera.transform.zoom&&this.fire(new kn("zoomstart")).fire(new kn("zoom")).fire(new kn("zoomend")).fire(new kn("movestart")).fire(new kn("move")).fire(new kn("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(e=!1){let r=this._camera.transform;return e?r.applyConstrain(r.center,r.minZoom).zoom:r.minZoom}setMaxZoom(e){if(e??(e=22),e>=this._camera.transform.minZoom){let r=this._camera.transform.zoom,t=this._camera.getTransformForUpdate();return t.setMaxZoom(e),this._camera.applyUpdatedTransform(t),this._update(),r!==this._camera.transform.zoom&&this.fire(new kn("zoomstart")).fire(new kn("zoom")).fire(new kn("zoomend")).fire(new kn("movestart")).fire(new kn("move")).fire(new kn("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??(e=0),e<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this._camera.transform.maxPitch){let r=this._camera.transform.pitch,t=this._camera.getTransformForUpdate();return t.setMinPitch(e),this._camera.applyUpdatedTransform(t),this._update(),r!==this._camera.transform.pitch&&this.fire(new kn("pitchstart")).fire(new kn("pitch")).fire(new kn("pitchend")).fire(new kn("movestart")).fire(new kn("move")).fire(new kn("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??(e=60),e>180)throw Error("maxPitch must be less than or equal to 180");if(e>=this._camera.transform.minPitch){let r=this._camera.transform.pitch,t=this._camera.getTransformForUpdate();return t.setMaxPitch(e),this._camera.applyUpdatedTransform(t),this._update(),r!==this._camera.transform.pitch&&this.fire(new kn("pitchstart")).fire(new kn("pitch")).fire(new kn("pitchend")).fire(new kn("movestart")).fire(new kn("move")).fire(new kn("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??(e=20),e>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(e<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.transform.setRenderWorldCopies(e),this._update()}setTransformConstrain(e){return this._camera.transform.setConstrainOverride(e),this._update()}project(e){return this._camera.transform.locationToScreenPoint(An.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(Wr.convert(e),this.terrain)}isMoving(){var e;return this._camera.isMoving()||((e=this._handlers)==null?void 0:e.isMoving())||!1}isZooming(){var e;return this._camera.isZooming()||((e=this._handlers)==null?void 0:e.isZooming())||!1}isRotating(){var e;return this._camera.isRotating()||((e=this._handlers)==null?void 0:e.isRotating())||!1}_createDelegatedListener(e,r,t){if(e==="mouseenter"||e==="mouseover"){let i=!1;return{layers:r,listener:t,delegates:{mousemove:a=>{let o=r.filter(l=>this.getLayer(l)),s=o.length===0?[]:this.queryRenderedFeatures(a.point,{layers:o});s.length?i||(i=!0,t.call(this,new df(e,this,a.originalEvent,{features:s}))):i=!1},mouseout:()=>{i=!1}}}}if(e==="mouseleave"||e==="mouseout"){let i=!1;return{layers:r,listener:t,delegates:{mousemove:a=>{let o=r.filter(s=>this.getLayer(s));(o.length===0?[]:this.queryRenderedFeatures(a.point,{layers:o})).length?i=!0:i&&(i=!1,t.call(this,new df(e,this,a.originalEvent)))},mouseout:a=>{i&&(i=!1,t.call(this,new df(e,this,a.originalEvent)))}}}}{let i=a=>{let o=r.filter(l=>this.getLayer(l)),s=o.length===0?[]:this.queryRenderedFeatures(a.point,{layers:o});s.length&&(a.features=s,t.call(this,a),delete a.features)};return{layers:r,listener:t,delegates:{[e]:i}}}}_saveDelegatedListener(e,r){var t;this._delegatedListeners||(this._delegatedListeners={}),(t=this._delegatedListeners)[e]||(t[e]=[]),this._delegatedListeners[e].push(r)}_removeDelegatedListener(e,r,t){var i;if(!((i=this._delegatedListeners)!=null&&i[e]))return;let a=this._delegatedListeners[e];for(let o=0;or.includes(l))){for(let l in s.delegates)this.off(l,s.delegates[l]);a.splice(o,1);return}}}on(e,r,t){if(t===void 0)return super.on(e,r);let i=typeof r=="string"?[r]:r,a=this._createDelegatedListener(e,i,t);this._saveDelegatedListener(e,a);for(let o in a.delegates)this.on(o,a.delegates[o]);return{unsubscribe:()=>{this._removeDelegatedListener(e,i,t)}}}once(e,r,t){if(t===void 0)return super.once(e,r);let i=typeof r=="string"?[r]:r,a=this._createDelegatedListener(e,i,t);for(let o in a.delegates){let s=a.delegates[o];a.delegates[o]=(...l)=>{this._removeDelegatedListener(e,i,t),s(...l)}}this._saveDelegatedListener(e,a);for(let o in a.delegates)this.once(o,a.delegates[o]);return this}off(e,r,t){if(t===void 0)return super.off(e,r);let i=typeof r=="string"?[r]:r;return this._removeDelegatedListener(e,i,t),this}queryRenderedFeatures(e,r){if(!this.style)return[];let t,i=e instanceof Wr||Array.isArray(e),a=i?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(r||(r=(i?{}:e)||{}),a instanceof Wr||typeof a[0]=="number")t=[Wr.convert(a)];else{let o=Wr.convert(a[0]),s=Wr.convert(a[1]);t=[o,new Wr(s.x,o.y),s,new Wr(o.x,s.y),o]}return this.style.queryRenderedFeatures(t,r,this._camera.transform)}querySourceFeatures(e,r){return this.style.querySourceFeatures(e,r)}setStyle(e,r){return r=yn({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r),this._styleUrl=typeof e=="string"?e:null,r.diff!==!1&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let r=this._locale[e];if(r==null)throw Error(`Missing UI string '${e}'`);return r}_updateStyle(e,r){var t,i,a;if((t=this._diffStyleRequest)==null||t.abort(),this._diffStyleRequest=null,r.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(e,r));return}let o=this.style&&r.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e)this.style=new L2(this,r||{});else return this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),(a=(i=this.style)==null?void 0:i.projection)==null||a.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof e=="string"?this.style.loadURL(e,r,o):this.style.loadJSON(e,r,o),this}_lazyInitEmptyStyle(){this.style||(this.style=new L2(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,r){return Xr(this,null,function*(){var t;if((t=this._diffStyleRequest)==null||t.abort(),typeof e=="string"){let i=e;this._diffStyleRequest=new AbortController;let a=this._diffStyleRequest;try{let o=yield this._requestManager.transformRequest(i,"Style");if(a.signal.aborted){this._diffStyleRequest=null;return}let s=yield vg(o,a);this._diffStyleRequest=null,this._updateDiff(s.data,r)}catch(o){this._diffStyleRequest=null,jp(o)||this.fire(new Ln(Zu(o)))}}else typeof e=="object"&&(this._diffStyleRequest=null,this._updateDiff(e,r))})}_updateDiff(e,r){try{this.style.setState(e,r)&&this._update(!0)}catch(t){To(`Unable to perform style diff: ${Zu(t).message}. Rebuilding the style from scratch.`),this._updateStyle(e,r)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style){To("There is no style added to the map.");return}return this.style.loaded()}addSource(e,r){return this._lazyInitEmptyStyle(),this.style.addSource(e,r),this._update(!0)}isSourceLoaded(e){var r;let t=(r=this.style)==null?void 0:r.tileManagers[e];if(t===void 0){this.fire(new Ln(Error(`There is no tile manager with ID '${e}'`)));return}return t.loaded()}setTerrain(e,r={}){if(this.style._checkLoaded(),e&&Q1(this,Hc.terrain,{value:e},r))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!e)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);else{let t=this.style.tileManagers[e.source];if(!t)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&t.reload();for(let i in this.style._layers){let a=this.style._layers[i];a.type==="hillshade"&&a.source===e.source&&To("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),a.type==="color-relief"&&a.source===e.source&&To("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new ZB(this.painter,t,e,this._terrainSkirtLength),this.painter.renderToTexture=new g8(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=i=>this._handleTerrainDataEvent(i,e.source),this.style.on("data",this._terrainDataCallback)}return this.style.triggerSymbolPlacement(),this.fire(new yM({terrain:e})),this}_handleTerrainDataEvent(e,r){var t;if(e.dataType==="style"){this.terrain.tileManager.releaseAllRTT();return}let i=e.sourceId===r;if(i&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),i&&e.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),e.tile){if(((t=e.source)==null?void 0:t.type)==="image"){this.terrain.tileManager.releaseAllRTT();return}this.terrain.tileManager.releaseRTT(e.tile.tileID)}}getTerrain(){var e,r;return(r=(e=this.terrain)==null?void 0:e.options)!=null?r:null}areTilesLoaded(){var e;let r=(e=this.style)==null?void 0:e.tileManagers;for(let t of Object.values(r))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){var r;return(r=this.style)==null?void 0:r.getSource(e)}setSourceTileLodParams(e,r,t){if(t){let i=this.getSource(t);if(!i)throw Error(`There is no source with ID "${t}", cannot set LOD parameters`);i.calculateTileZoom=HA(Math.max(1,e),Math.max(1,r))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=HA(Math.max(1,e),Math.max(1,r));return this._update(!0),this}refreshTiles(e,r){let t=this.style.tileManagers[e];if(!t)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);r===void 0?t.reload(!0):t.refreshTiles(r.map(i=>new Rg(i.z,i.x,i.y)))}addImage(e,r,t={}){var i;this._lazyInitEmptyStyle();let a=this._createStyleImage(r,t);return a?(this.style.addImage(e,a),(i=a.userImage)!=null&&i.onAdd&&a.userImage.onAdd(this,e),this):this}setMissingStyleImageResolver(e){var r;return this._missingStyleImageResolver=e,(r=this.style)==null||r.setMissingImageResolver(e),this}_createStyleImage(e,r={}){let{pixelRatio:t=1,sdf:i=!1,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:n}=r;if(e instanceof HTMLImageElement||P0(e)){let{width:u,height:c,data:f}=yc.getImageData(e);return{data:new Rs({width:u,height:c},f),pixelRatio:t,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:n,sdf:i,version:0}}if(e.width===void 0||e.height===void 0)return this.fire(new Ln(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`"))),null;{let{width:u,height:c,data:f}=e,h=e,d=ux(h.data);return{data:d?new Rs({width:u,height:c}):new Rs({width:u,height:c},new Uint8Array(f)),pixelRatio:t,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:n,sdf:i,version:0,isWebGLImage:d,userImage:h}}}updateImage(e,r){let t=this.style.getImage(e);if(!t)return this.fire(new Ln(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:a,data:o}=r instanceof HTMLImageElement||P0(r)?yc.getImageData(r):r;if(i===void 0||a===void 0)return this.fire(new Ln(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(i!==t.data.width||a!==t.data.height)return this.fire(new Ln(Error("The width and height of the updated image must be that same as the previous version of the image")));if(t.isWebGLImage=ux(o),t.isWebGLImage)t.userImage=r;else{let s=!(r instanceof HTMLImageElement||P0(r));t.data.replace(o,s)}return this.style.updateImage(e,t),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new Ln(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return Xr(this,null,function*(){let r=yield td.getImage(yield this._requestManager.transformRequest(e,"Image"),new AbortController);if(!r.data)throw Error(`Could not load image ${e}: the response is empty`);return r})}listImages(){var e,r;return(r=(e=this.style)==null?void 0:e.listImages())!=null?r:[]}addLayer(e,r){return this._lazyInitEmptyStyle(),this.style.addLayer(e,r),this._update(!0)}moveLayer(e,r){return this.style.moveLayer(e,r),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){var r;return(r=this.style)==null?void 0:r.getLayer(e)}getLayersOrder(){var e,r;return(r=(e=this.style)==null?void 0:e.getLayersOrder())!=null?r:[]}setLayerZoomRange(e,r,t){return this.style.setLayerZoomRange(e,r,t),this._update(!0)}setFilter(e,r,t={}){var i;return(i=this.style)==null||i.setFilter(e,r,t),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,r,t,i={}){var a;return(a=this.style)==null||a.setPaintProperty(e,r,t,i),this._update(!0)}getPaintProperty(e,r){return this.style.getPaintProperty(e,r)}setLayoutProperty(e,r,t,i={}){return this.style.setLayoutProperty(e,r,t,i),this._update(!0)}getLayoutProperty(e,r){return this.style.getLayoutProperty(e,r)}setGlyphs(e,r={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,r),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(e){return this._lazyInitEmptyStyle(),this.style.setFontFaces(e),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(e,r,t={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,r,t,i=>{i||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,r={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,r,t=>{t||this._update(!0)}),this}setLight(e,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,r),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,r={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,r),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,r){return this.style.setFeatureState(e,r),this._update()}removeFeatureState(e,r){return this.style.removeFeatureState(e,r),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,r=0;return this._container&&(e=this._container.clientWidth||400,r=this._container.clientHeight||300),[e,r]}_shouldHandleInitialResize(){var e;if(!((e=this._container)!=null&&e.clientWidth)||!this._container.clientHeight)return!1;let[r,t]=this._containerDimensions();return r!==this._camera.transform.width||t!==this._camera.transform.height}_setupResizeObserver(){var e;let r=!1,t=qz(a=>{this._trackResize&&!this._removed&&(this.resize(a),this.redraw())},50),i=(e=this._ownerWindow.ResizeObserver)!=null?e:ResizeObserver;this._resizeObserver=new i(a=>{!r&&(r=!0,!this._shouldHandleInitialResize())||t(a)}),this._resizeObserver.observe(this._container)}_resolveContainer(e){if(typeof e=="string"){let r=document.getElementById(e);if(!r)throw Error(`Container '${e}' not found.`);return r}if(e instanceof HTMLElement||e&&typeof e=="object"&&e.nodeType===1)return e;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let e=this._container;e.classList.add("maplibregl-map");let r=this._canvasContainer=$n.create("div","maplibregl-canvas-container",e);this._interactive&&r.classList.add("maplibregl-interactive"),this._canvas=$n.create("canvas","maplibregl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let t=this._containerDimensions(),i=this._getClampedPixelRatio(t[0],t[1]);this._resizeCanvas(t[0],t[1],i);let a=this._controlContainer=$n.create("div","maplibregl-control-container",e),o=this._controlPositions={};for(let s of["top-left","top-right","bottom-left","bottom-right"])o[s]=$n.create("div",`maplibregl-ctrl-${s} `,a);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(e,r,t){this._canvas.width=Math.floor(t*e),this._canvas.height=Math.floor(t*r),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${r}px`}_setupPainter(){let e=ar(Ot({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),r=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{r=i},{once:!0});let t=this._canvas.getContext("webgl2",e);if(!t)throw new sS(e,r);this.painter=new WN(t,this._camera.transform)}migrateProjection(e,r){this._camera.migrateProjection(e,r),this.painter.transform=e,this.fire(new _M({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){var r;return(r=this.style)!=null&&r._loaded?(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)}_render(e){var r,t,i,a,o;let s=this._idleTriggered?this._fadeDuration:0,l=((r=this.style.projection)==null?void 0:r.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let f=this._camera.transform.zoom,h=hs();this.style.zoomHistory.update(f,h);let d=new ns(f,{now:h,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),p=d.crossFadingFactor();(p!==1||p!==this._crossFadingFactor)&&(n=!0,this._crossFadingFactor=p),this.style.update(d)}let u=((t=this.style.projection)==null?void 0:t.transitionState)>0!==l;this._camera.transform.setTransitionState((i=this.style.projection)==null?void 0:i.transitionState),this.style&&(this._sourcesDirty||u)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=(a=this.style)==null?void 0:a._updatePlacement(this._camera.transform,this.showCollisionBoxes,s,this._crossSourceCollisions,u),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new iu("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new iu("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let c=this._sourcesDirty||this._styleDirty||this._placementDirty||((o=this.painter.renderToTexture)==null?void 0:o.needsFollowUpFrame);return c||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new iu("idle")),this._loaded&&!this._fullyLoaded&&!c&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){var e,r;this._hash&&this._hash.remove();for(let i of this._controls)i.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),(e=this._diffStyleRequest)==null||e.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),td.removeThrottleControl(this._imageQueueHandle),(r=this._resizeObserver)==null||r.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new iu("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,yc.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(r){if(!jp(r))throw r}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return _8}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}},x8={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0},b8=class{constructor(e){this._updateZoomButtons=()=>{let r=this._map.getZoom(),t=r===this._map.getMaxZoom(),i=r===this._map.getMinZoom(!0);this._zoomInButton.disabled=t,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{let r=this._map.getPitch(),t=this._map.getRoll(),i=this._map.getBearing(),a=1/Math.cos(rl(r))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${a}) rotateZ(${-t}deg) rotateX(${r}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${a}) rotateX(${r}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-i-t}deg)`;return}this._compassIcon.style.transform=`rotate(${-i}deg)`},this._setButtonTitle=(r,t)=>{let i=this._map._getUIString(`NavigationControl.${t}`);r.title=i,r.setAttribute("aria-label",i)},this.options=yn({},x8,e),this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",r=>this._map.zoomIn({},{originalEvent:r})),$n.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",r=>this._map.zoomOut({},{originalEvent:r})),$n.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",r=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:r}):this._map.resetNorth({},{originalEvent:r})}),this._compassIcon=$n.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new w8(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,r){let t=$n.create("button",e,this._container);return t.type="button",t.addEventListener("click",r),t}},w8=class{constructor(e,r,t=!1){this.mousedown=a=>{this.startMove(a,$n.mousePos(this.element,a)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=a=>{this.move(a,$n.mousePos(this.element,a))},this.mouseup=a=>{this._rotatePitchHandler.dragEnd(a),this.offTemp()},this.touchstart=a=>{a.targetTouches.length===1?(this._startPos=this._lastPos=$n.touchPos(this.element,a.targetTouches)[0],this.startMove(a,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=a=>{a.targetTouches.length===1?(this._lastPos=$n.touchPos(this.element,a.targetTouches)[0],this.move(a,this._lastPos)):this.reset()},this.touchend=a=>{a.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=r;let i=new o8;this._rotatePitchHandler=new Wm({clickTolerance:3,move:(a,o)=>{let s=r.getBoundingClientRect(),l=new Wr((s.bottom-s.top)/2,(s.right-s.left)/2);return{bearingDelta:T9(new Wr(a.x,o.y),o,l),pitchDelta:t?(o.y-a.y)*-.5:void 0}},moveStateManager:i,enable:!0,assignEvents:()=>{}}),this.map=e,r.addEventListener("mousedown",this.mousedown),r.addEventListener("touchstart",this.touchstart,{passive:!1}),r.addEventListener("touchcancel",this.reset)}startMove(e,r){this._rotatePitchHandler.dragStart(e,r),$n.disableDrag()}move(e,r){let t=this.map,{bearingDelta:i,pitchDelta:a}=this._rotatePitchHandler.dragMove(e,r)||{};i&&t.setBearing(t.getBearing()+i),a&&t.setPitch(t.getPitch()+a)}off(){let e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){$n.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}},q2={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%)"},kS={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},CS="#3FB1CE",a0=class extends hf{},LS=class extends hf{},V2=class extends Nl{constructor(e){if(super(),this._onClick=r=>{this.fire(new LS("click",{originalEvent:r}))},this._onKeyPress=r=>{(r.code==="Space"||r.code==="Enter")&&this.togglePopup()},this._onKeyDown=r=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||r.composedPath()[0]!==this._element||r.altKey||r.ctrlKey||r.metaKey)return;let t=kS[r.key];if(!t)return;r.preventDefault(),r.stopPropagation();let i=r.shiftKey?10:1,a=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new Wr(a.x+t[0]*i,a.y+t[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new a0("dragstart"))),this.fire(new a0("drag"))},this._onKeyUp=r=>{kS[r.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=r=>{let t=r.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()},this._update=r=>{if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();(r?.type==="terrain"||r?.type==="render"&&!t)&&this._map.once("render",this._update),this._lngLat=Hz(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let i="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?i=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let a="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?a="rotateX(0deg)":this._pitchAlignment==="map"&&(a=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&(!r||r.type==="moveend")&&(this._pos=this._pos.round()),this._element.style.transform=`${q2[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${a} ${i}`,yc.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(r?.type==="moveend")}).catch(()=>{})},this._onMove=r=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=r.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=r.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new a0("dragstart"))),this.fire(new a0("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new a0("dragend")),this._state="inactive"},this._addDragHandler=r=>{this._element.contains(r.originalEvent.target)&&(r.preventDefault(),this._positionDelta=r.point.sub(this._pos).add(this._offset),this._pointerdownPos=r.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e?.anchor||"center",this._color=e?.color||CS,this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||"auto",this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=Wr.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=$n.create("div");let r=Ase().cloneNode(!0);r.setAttributeNS(null,"height",`${41*this._scale}px`),r.setAttributeNS(null,"width",`${27*this._scale}px`),Mse(r).setAttributeNS(null,"fill",this._color),this._element.appendChild(r),this._offset=Wr.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",r=>{r.preventDefault()}),this._element.addEventListener("mousedown",r=>{r.preventDefault()}),$z(this._element,this._anchor,"marker"),e?.className)for(let r of e.className.split(" "))this._element.classList.add(r);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=An.convert(e),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),e){if(!("offset"in e.options)){let r=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,(24.6+r)*-1],"bottom-right":[-r,(24.6+r)*-1],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new a0("dragend")))}getPopup(){return this._popup}togglePopup(){let e=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(e)e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map));else return this;return this}_updateOpacity(e=!1){var r,t;let i=(r=this._map)==null?void 0:r.terrain,a=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!i||a){let p=a?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==p&&(this._element.style.opacity=p,this._element.classList.toggle("maplibregl-marker-covered",a));return}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let o=this._map,s=o.terrain.depthAtPoint(this._pos),l=o.terrain.getElevationForLngLat(this._lngLat,o._camera.transform),n=o._camera.transform.lngLatToCameraDepth(this._lngLat,l),u=.006;if(n-su;(t=this._popup)!=null&&t.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",d)}getOffset(){return this._offset}setOffset(e){return this._offset=Wr.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=(this._element.getAttribute("tabindex")==="0"&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let e=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,r){return(this._opacity===void 0||e===void 0&&r===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=String(e)),r!==void 0&&(this._opacityWhenCovered=String(r)),this._map&&this._updateOpacity(!0),this}},T8={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ny=0,Xm=!1,n0=class extends hf{},G2=class extends hf{},FS=class extends hf{},A8=class extends Nl{constructor(e){super(),this._onSuccess=r=>{if(this._map){if(this._isOutOfMapMaxBounds(r)){this._setErrorState(),this.fire(new G2("outofmaxbounds",r)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=r,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(r),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(r),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new G2("geolocate",r)),this._finish()}},this._updateCamera=r=>{let t=new An(r.coords.longitude,r.coords.latitude),i=r.coords.accuracy,a=this._map.getBearing(),o=yn({bearing:a},this.options.fitBoundsOptions),s=bh.fromLngLat(t,i);this._map.fitBounds(s,o,{geolocateSource:!0})},this._updateMarker=r=>{if(r){let t=new An(r.coords.longitude,r.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=r.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=r=>{if(this._map){if(r.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(r.code===3&&Xm)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new FS("error",r)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=r=>{if(!this._map)return;let t=r?.[0]instanceof ResizeObserverEntry;!r.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!t&&!this._map.isZooming()&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new n0("trackuserlocationend")),this.fire(new n0("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",r=>{r.preventDefault()}),this._geolocateButton=$n.create("button","maplibregl-ctrl-geolocate",this._container),$n.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=r=>{if(this._map){if(r===!1){To("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=$n.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new V2({element:this._dotElement}),this._circleElement=$n.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new V2({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=yn({},T8,e)}onAdd(e){return this._map=e,this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),Tse().then(r=>this._finishSetupUI(r)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,ny=0,Xm=!1}_isOutOfMapMaxBounds(e){let r=this._map.getMaxBounds(),t=e.coords;return r&&(t.longituder.getEast()||t.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":break;case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let e=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!e)return;let r=this._map.project(e),t=this._map.unproject([r.x+100,r.y]),i=e.distanceTo(t)/100,a=2*this._accuracy/i;this._circleElement.style.width=`${a.toFixed(2)}px`,this._circleElement.style.height=`${a.toFixed(2)}px`}trigger(){if(!this._setup)return To("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 n0("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ny--,Xm=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new n0("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n0("trackuserlocationstart")),this.fire(new n0("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ny++;let e;ny>1?(e={maximumAge:6e5,timeout:0},Xm=!0):(e=this.options.positionOptions,Xm=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},M8={maxWidth:100,unit:"metric"},S8=class{constructor(e){this._onMove=()=>{Wz(this._map,this._container,this.options)},this.setUnit=r=>{this.options.unit=r,Wz(this._map,this._container,this.options)},this.options=Ot(Ot({},M8),e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}},H2=class extends hf{},E8=class extends Nl{constructor(e={}){var r;super(),this._onFullscreenChange=()=>{var t;let i=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;(t=i?.shadowRoot)!=null&&t.fullscreenElement;)i=i.shadowRoot.fullscreenElement;i===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=(r=e.pseudo)!=null?r:!1,e?.container&&(e.container instanceof HTMLElement?this._container=e.container:To("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let e=this._fullscreenButton=$n.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);$n.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new H2("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new H2("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},k8=class{constructor(e){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=e}onAdd(e){return this._map=e,this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=$n.create("button","maplibregl-ctrl-terrain",this._container),$n.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},C8=class{constructor(){this._toggleProjection=()=>{var e;let r=(e=this._map.getProjection())==null?void 0:e.type;r==="mercator"||!r?this._map.setProjection({type:"globe"}):this._map.setProjection({type:"mercator"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var e;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((e=this._map.getProjection())==null?void 0:e.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(e){return this._map=e,this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=$n.create("button","maplibregl-ctrl-globe",this._container),$n.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},D8={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},L8=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),$2=class extends hf{},F8=class extends Nl{constructor(e){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new $2("close"))),this),this._update=r=>{let t=this._lngLat||this._trackPointer;if(!this._map||!t||!this._content)return;if(!this._container){if(this._container=$n.create("div","maplibregl-popup",this._map.getContainer()),this._tip=$n.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let n of this.options.className.split(" "))this._container.classList.add(n);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Hz(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer);let i;if(r&&"point"in r&&r.point&&(i=r.point),this._trackPointer&&!i)return;let a=this._flatPos=this._pos=this._trackPointer&&i?i:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&i?i:this._map._camera.transform.locationToScreenPoint(this._lngLat));let o=this.options.anchor,s=Yz(this.options.offset);if(!o){let n=this._container.offsetWidth,u=this._container.offsetHeight,c=kse(this.options.padding),f;f=a.y+s.bottom.ythis._map._camera.transform.height-u-c.bottom?["bottom"]:[],a.xthis._map._camera.transform.width-n/2-c.right&&f.push("right"),o=f.length===0?"bottom":f.join("-")}let l=a.add(s[o]);this.options.subpixelPositioning||(l=l.round()),this._container.style.transform=`${q2[o]} translate(${l.x}px,${l.y}px)`,$z(this._container,o,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=yn(Object.create(D8),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new $2("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=An.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let r=document.createDocumentFragment(),t=document.createElement("body"),i;for(t.innerHTML=e;i=t.firstChild,i;)r.appendChild(i);return this.setDOMContent(r)}getMaxWidth(){var e;return(e=this._container)==null?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=$n.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}setPadding(e){this.options.padding=e,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=$n.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=this._container.querySelector(L8);e&&e.focus()}},P8=vM}}),jse=de({"build/maplibre_worker.js"(e,r){"use strict";r.exports='var t1=Object.defineProperty,e1=Object.defineProperties;var r1=Object.getOwnPropertyDescriptors;var nh=Object.getOwnPropertySymbols;var i1=Object.prototype.hasOwnProperty,n1=Object.prototype.propertyIsEnumerable;var ah=(t,e,r)=>e in t?t1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,je=(t,e)=>{for(var r in e||(e={}))i1.call(e,r)&&ah(t,r,e[r]);if(nh)for(var r of nh(e))n1.call(e,r)&&ah(t,r,e[r]);return t},Si=(t,e)=>e1(t,r1(e));var rt=(t,e,r)=>new Promise((i,n)=>{var a=l=>{try{o(r.next(l))}catch(u){n(u)}},s=l=>{try{o(r.throw(l))}catch(u){n(u)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(a,s);o((r=r.apply(t,e)).next())});var a1=Object.create,ep=Object.defineProperty,s1=Object.getOwnPropertyDescriptor,o1=Object.getOwnPropertyNames,l1=Object.getPrototypeOf,rp=Object.prototype.hasOwnProperty,fl=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),u1=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=o1(e),a=0,s=n.length,o;ae[l]).bind(null,o),enumerable:!(i=s1(e,o))||i.enumerable});return t},h1=(t,e,r)=>(r=t==null?{}:a1(l1(t)),u1(e||!t||!t.__esModule||!rp.call(t,"default")?ep(r,"default",{value:t,enumerable:!0}):r,t));function B(t,e){this.x=t,this.y=e}B.prototype={clone(){return new B(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:B},B.convert=function(t){if(t instanceof B)return t;if(Array.isArray(t))return new B(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new B(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")};function c1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var Nn;function p1(){return Nn!=null||(Nn=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Nn}var Un;function f1(){if(Un==null&&(Un=!1,p1())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){Un=!0;break}}}return Un||!1}var pe=typeof Float32Array<"u"?Float32Array:Array;Math.PI/180,180/Math.PI;function d1(){var t=new pe(9);return pe!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ip(){var t=new pe(3);return pe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function y1(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function sh(t,e,r){var i=new pe(3);return i[0]=t,i[1]=e,i[2]=r,i}function m1(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function g1(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ks(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}var x1=y1;(function(){var t=ip();return function(e,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=i*s,t[2]=n*s,t[3]=a*s,t}function w1(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}(function(){var t=v1();return function(e,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o1e-6?(p=Math.acos(f),d=Math.sin(p),y=Math.sin((1-i)*p)/d,m=Math.sin(i*p)/d):(y=1-i,m=i),t[0]=y*n+m*l,t[1]=y*a+m*u,t[2]=y*s+m*h,t[3]=y*o+m*c,t}function _1(t,e){var r=e[0]+e[4]+e[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[n*3+n]&&(n=2);var a=(n+1)%3,s=(n+2)%3;i=Math.sqrt(e[n*3+n]-e[a*3+a]-e[s*3+s]+1),t[n]=.5*i,i=.5/i,t[3]=(e[a*3+s]-e[s*3+a])*i,t[a]=(e[a*3+n]+e[n*3+a])*i,t[s]=(e[s*3+n]+e[n*3+s])*i}return t}var lh=b1;(function(){var t=ip(),e=sh(1,0,0),r=sh(0,1,0);return function(i,n,a){var s=g1(n,a);return s<-.999999?(ks(t,e,n),x1(t)<1e-6&&ks(t,r,n),m1(t,t),D1(i,t,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(ks(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+s,lh(i,i))}})(),(function(){var t=oh(),e=oh();return function(r,i,n,a,s,o){return Ts(t,i,s,o),Ts(e,n,a,o),Ts(r,t,e,2*o*(1-o)),r}})(),(function(){var t=d1();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],lh(e,_1(e,t))}})();function A1(){var t=new pe(2);return pe!=Float32Array&&(t[0]=0,t[1]=0),t}(function(){var t=A1();return function(e,r,i,n,a,s){var o,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function E1(t,e,r,i){return c1(t,e,r,i)}var d5=E1(.25,.1,.25,1);function Ji(t,e,r){return Math.min(r,Math.max(e,t))}function F1(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function Gt(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function k1(t){return Math.log(t)/Math.LN2%1==0}function Ia(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}function T1(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function He(t){return Array.isArray(t)?t.map(He):typeof t=="object"&&t?Ia(t,He):t}var uh={};function Bt(t){uh[t]||(typeof console<"u"&&console.warn(t),uh[t]=!0)}function Ke(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function mr(t){return typeof WorkerGlobalScope<"u"&&t!==void 0&&t instanceof WorkerGlobalScope}function Ca(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function I1(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),h=Math.min(t.width,e+i),c=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}function C1(t,e,r,i,n){return rt(this,null,function*(){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(t,{timestamp:0});try{let s=a==null?void 0:a.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith("BGR"),l=new Uint8ClampedArray(i*n*4);if(yield a.copyTo(l,I1(t,e,r,i,n)),o)for(let u=0;u{t.removeEventListener(e,r,i)}}}function ch(t){return t*Math.PI/180}var ph="AbortError",dl=class extends Error{constructor(t=ph){super(t instanceof Error?t.message:t),this.name=ph,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function yl(t){return t instanceof Error&&t.name==="AbortError"}function B1(t){if(t.aborted)throw new dl(t.reason)}var ml={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function P1(t){return ml.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function sp(t,e){ml.REGISTERED_PROTOCOLS[t]=e}function op(t){delete ml.REGISTERED_PROTOCOLS[t]}var fh="global-dispatcher",ya=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function lp(){var t;if(mr(self))return(t=self.worker)==null?void 0:t.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch(e){}return window.location.href}var z1=t=>{var e;return t.startsWith("file:")||((e=lp())==null?void 0:e.startsWith("file:"))&&!/^\\w+:/.test(t)};function L1(t,e){return rt(this,null,function*(){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:lp(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=yield fetch(r)}catch(s){throw yl(s)?s:new ya(0,Ki(s).message,t.url,new Blob)}if(!i.ok){let s=yield i.blob();throw new ya(i.status,i.statusText,t.url,s)}let n;n=t.type==="arrayBuffer"||t.type==="image"?i.arrayBuffer():t.type==="json"?i.json():i.text();let a=yield n;return B1(e.signal),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}})}function V1(t,e){return new Promise((r,i)=>{var a;let n=new XMLHttpRequest;n.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(n.responseType="arraybuffer");for(let s in t.headers)n.setRequestHeader(s,t.headers[s]);t.type==="json"&&(n.responseType="text",(a=t.headers)!=null&&a.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=t.credentials==="include",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let s=n.response;if(t.type==="json")try{s=JSON.parse(n.response)}catch(o){i(o);return}r({data:s,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let s=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new ya(n.status,n.statusText,t.url,s))}},e.signal.addEventListener("abort",()=>{n.abort(),i(new dl(e.signal.reason))}),n.send(t.body)})}var Ma=function(t,e){return rt(this,null,function*(){var r,i;if(t.url.includes("://")&&!/^https?:|^file:/.test(t.url)){let n=P1(t.url);if(n){let a=yield n(t,e);return!a.data&&t.type==="arrayBuffer"?Gt(a,{data:new ArrayBuffer(0)}):a}if(mr(self)&&((r=self.worker)!=null&&r.actor))return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:fh},e)}if(!z1(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return L1(t,e);if(mr(self)&&((i=self.worker)!=null&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:fh},e)}return V1(t,e)})},up=(t,e)=>Ma(Gt(t,{type:"json"}),e),hp=(t,e)=>Ma(Gt(t,{type:"arrayBuffer"}),e);function dh(t,e,r){var i;(i=r[t])!=null&&i.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function Is(t,e,r){if(r!=null&&r[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}var cp=class{constructor(t,e={}){Gt(this,e),this.type=t}},ma=class extends cp{constructor(t,e={}){super("error",Gt({error:t},e))}},O1=class{on(t,e){return this._listeners||(this._listeners={}),dh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return Is(t,e,this._listeners),Is(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),dh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){var n,a,s,o,l,u;let r=typeof t=="string"?new cp(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let h=(s=(a=(n=this._listeners)==null?void 0:n[i])==null?void 0:a.slice())!=null?s:[];for(let f of h)f.call(this,r);let c=(u=(l=(o=this._oneTimeListeners)==null?void 0:o[i])==null?void 0:l.slice())!=null?u:[];for(let f of c)Is(i,f,this._oneTimeListeners),f.call(this,r);let p=this._eventedParent;p&&(Gt(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(r))}else r instanceof ma&&console.error(r.error);return this}listens(t){var e,r,i,n,a;return!!((r=(e=this._listeners)==null?void 0:e[t])!=null&&r.length||(n=(i=this._oneTimeListeners)==null?void 0:i[t])!=null&&n.length||(a=this._eventedParent)!=null&&a.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},pp={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},w=pp,fp=["type","source","source-layer","minzoom","maxzoom","filter","layout"],E=class{constructor(t,e,r,i,n="error"){this.message=(t?`${t}: `:"")+r,i&&(this.identifier=i),this.severity=n,e!=null&&e.__line__&&(this.line=e.__line__)}},dn={kind:"null"},I={kind:"number"},Y={kind:"string"},tt={kind:"boolean"},ce={kind:"color"},Ba={kind:"projectionDefinition"},fr={kind:"object"},Z={kind:"value"},R1={kind:"error"},Pa={kind:"collator"},yn={kind:"formatted"},za={kind:"padding"},Qi={kind:"colorArray"},La={kind:"numberArray"},mn={kind:"resolvedImage"},Va={kind:"variableAnchorOffsetCollection"};function Ut(t,e){return{kind:"array",itemType:t,N:e}}function yt(t){if(t.kind==="array"){let e=yt(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}var $1=[dn,I,Y,tt,ce,Ba,yn,fr,Ut(Z),za,La,Qi,mn,Va];function tn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!tn(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of $1)if(!tn(r,e))return null}}return`Expected ${yt(t)} but found ${yt(e)} instead.`}function gl(t,e){return e.some(r=>r.kind===t.kind)}function dr(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function Ge(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}var dp=.96422,yp=.82521,mp=4/29,Ks=6/29,gp=3*Ks*Ks,N1=Math.PI/180,U1=180/Math.PI;function xp(t){return t%=360,t<0&&(t+=360),t}function vp([t,e,r,i]){t=Cs(t),e=Cs(e),r=Cs(r);let n,a,s=Ms((.2225045*t+.7168786*e+.0606169*r)/1);t===e&&e===r?n=a=s:(n=Ms((.4360747*t+.3850649*e+.1430804*r)/dp),a=Ms((.0139322*t+.0971045*e+.7141733*r)/yp));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Cs(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ms(t){return t>.008856451679035631?t**(1/3):t/gp+mp}function bp([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*Ps(n),a=dp*Ps(a),s=yp*Ps(s),[Bs(3.1338561*a-1.6168667*n-.4906146*s),Bs(-.9787684*a+1.9161415*n+.033454*s),Bs(.0719453*a-.2289914*n+1.4052427*s),i]}function Bs(t){return t=t<=.00304?12.92*t:1.055*t**(1/2.4)-.055,t<0?0:t>1?1:t}function Ps(t){return t>Ks?t*t*t:gp*(t-mp)}function q1(t){let[e,r,i,n]=vp(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?xp(Math.atan2(i,r)*U1):NaN,a,e,n]}function j1([t,e,r,i]){return t=isNaN(t)?0:t*N1,bp([r,Math.cos(t)*e,Math.sin(t)*e,i])}function G1([t,e,r,i]){t=xp(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var X1=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function ji(t,e){return X1(t,e)?t[e]:void 0}function Y1(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=ji(W1,t);if(e){let[i,n,a]=e;return[i/255,n/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let i=t.length<6?1:2,n=1;return[qn(t.slice(n,n+=i)),qn(t.slice(n,n+=i)),qn(t.slice(n,n+=i)),qn(t.slice(n,n+i)||"ff")]}if(t.startsWith("rgb")){let i=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(i){let[n,a,s,o,l,u,h,c,p,f,d,y]=i,m=[o||" ",h||" ",f].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let g=[s,u,p].join(""),x=g==="%%%"?100:g===""?255:0;if(x){let v=[Rr(+a/x,0,1),Rr(+l/x,0,1),Rr(+c/x,0,1),d?yh(+d,y):1];if(mh(v))return v}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[i,n,a,s,o,l,u,h,c]=r,p=[a||" ",o||" ",u].join("");if(p===" "||p===" /"||p===",,"||p===",,,"){let f=[+n,Rr(+s,0,100),Rr(+l,0,100),h?yh(+h,c):1];if(mh(f))return G1(f)}}}function qn(t){return parseInt(t.padEnd(2,t),16)/255}function yh(t,e){return Rr(e?t/100:t,0,1)}function Rr(t,e,r){return Math.min(Math.max(e,t),r)}function mh(t){return!t.some(Number.isNaN)}var W1={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Je(t,e,r){return t+r*(e-t)}function ti(t,e,r){return t.map((i,n)=>Je(i,e[n],r))}function Z1(t){return t==="rgb"||t==="hcl"||t==="lab"}var Pt,gt=(Pt=class{constructor(e,r,i,n=1,a=!0){this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,r,i,n]))}static parse(e){if(e instanceof Pt)return e;if(typeof e!="string")return;let r=Y1(e);if(r)return new Pt(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",q1(this.rgb))}get lab(){return this.overwriteGetter("lab",vp(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(",")},${n})`}static interpolate(e,r,i,n="rgb"){switch(n){case"rgb":{let[a,s,o,l]=ti(e.rgb,r.rgb,i);return new Pt(a,s,o,l,!1)}case"hcl":{let[a,s,o,l]=e.hcl,[u,h,c,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=h)):(f=a,(c===1||c===0)&&(d=s));let[y,m,g,x]=j1([f,d!=null?d:Je(s,h,i),Je(o,c,i),Je(l,p,i)]);return new Pt(y,m,g,x,!1)}case"lab":{let[a,s,o,l]=bp(ti(e.lab,r.lab,i));return new Pt(a,s,o,l,!1)}}}},Pt.black=new Pt(0,0,0,1),Pt.white=new Pt(1,1,1,1),Pt.transparent=new Pt(0,0,0,0),Pt.red=new Pt(1,0,0,1),Pt),H1=["bottom","center","top"],Js=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},ze=class la{constructor(e){this.sections=e}static fromString(e){return new la([new Js(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof la?e:la.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Ae=class Li{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Li)return e;if(typeof e=="number")return new Li([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Li(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Li(ti(e.values,r.values,i))}},Se=class Vi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Vi)return e;if(typeof e=="number")return new Vi([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new Vi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Vi(ti(e.values,r.values,i))}},oe=class Oi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Oi)return e;if(typeof e=="string"){let i=gt.parse(e);return i?new Oi([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!="string")return;let n=gt.parse(i);if(!n)return;r.push(n)}return new Oi(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n="rgb"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[t,e,r,i]:[t,e,r]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function ei(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Dr||t instanceof gt||t instanceof xl||t instanceof ze||t instanceof Ae||t instanceof Se||t instanceof oe||t instanceof De||t instanceof _e)return!0;if(Array.isArray(t)){for(let e of t)if(!ei(e))return!1;return!0}if(typeof t=="object"){for(let e in t)if(!ei(t[e]))return!1;return!0}return!1}function _t(t){if(t===null)return dn;if(typeof t=="string")return Y;if(typeof t=="boolean")return tt;if(typeof t=="number")return I;if(t instanceof gt)return ce;if(t instanceof Dr)return Ba;if(t instanceof xl)return Pa;if(t instanceof ze)return yn;if(t instanceof Ae)return za;if(t instanceof Se)return La;if(t instanceof oe)return Qi;if(t instanceof De)return Va;if(t instanceof _e)return mn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=_t(i);if(!r)r=n;else{if(r===n)continue;r=Z;break}}return Ut(r||Z,e)}return fr}function Gi(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof gt||t instanceof Dr||t instanceof ze||t instanceof Ae||t instanceof Se||t instanceof oe||t instanceof De||t instanceof _e?t.toString():JSON.stringify(t)}var ri=class _p{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`\'literal\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=_t(i),a=r.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new _p(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},J1=["Unknown","Point","LineString","Polygon"],Ap=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?J1[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=gt.parse(t),this._parseColorCache.set(t,e)),e}};function Oa(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||ee)a=s-1;else throw new ft("Input is not a number.",r);return 0}var vl=class Sp{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(e[1],1,I);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let s=1;s=o)return r.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',u);let c=r.parse(l,h,a);if(!c)return null;a||(a=c.type),n.push([o,c])}return new Sp(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[Oa(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Q1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var be=class Qs{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name==="exponential")a=zs(r,e.base,i,n);else if(e.name==="linear")a=zs(r,1,i,n);else if(e.name==="cubic-bezier"){let s=e.controlPoints;a=Q1(s[0],s[1],s[2],s[3])(zs(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(h=>typeof h!="number"||h<0||h>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,I),!a)return null;let o=[],l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&r.expectedType!=Qi?l=ce:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u=h)return r.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',p);let d=r.parse(c,f,l);if(!d)return null;l||(l=d.type),o.push([h,d])}return!Ge(l,I)&&!Ge(l,Ba)&&!Ge(l,ce)&&!Ge(l,za)&&!Ge(l,La)&&!Ge(l,Qi)&&!Ge(l,Va)&&!Ge(l,Ut(I))?r.error(`Type ${yt(l)} is not interpolatable.`):new Qs(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=Oa(r,n,this.key),o=r[s],l=r[s+1],u=Qs.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(e),c=i[s+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Je(h,c,u);case"color":return gt.interpolate(h,c,u);case"padding":return Ae.interpolate(h,c,u);case"colorArray":return oe.interpolate(h,c,u);case"numberArray":return Se.interpolate(h,c,u);case"variableAnchorOffsetCollection":return De.interpolate(h,c,u,this.key);case"array":return ti(h,c,u);case"projectionDefinition":return Dr.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return gt.interpolate(h,c,u,"hcl");case"colorArray":return oe.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return gt.interpolate(h,c,u,"lab");case"colorArray":return oe.interpolate(h,c,u,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function zs(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var gr={color:gt.interpolate,number:Je,padding:Ae.interpolate,numberArray:Se.interpolate,colorArray:oe.interpolate,variableAnchorOffsetCollection:De.interpolate,array:ti},Ep=class Fp{constructor(e){this.type=yn,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o=="object"&&!Array.isArray(o)){a=!1;let l=null;if(o["font-scale"]&&(l=r.parse(o["font-scale"],1,I),!l))return null;let u=null;if(o["text-font"]&&(u=r.parse(o["text-font"],1,Ut(Y)),!u))return null;let h=null;if(o["text-color"]&&(h=r.parse(o["text-color"],1,ce),!h))return null;let c=null;if(o["vertical-align"]){if(typeof o["vertical-align"]=="string"&&!H1.includes(o["vertical-align"]))return r.error(`\'vertical-align\' must be one of: \'bottom\', \'center\', \'top\' but found \'${o["vertical-align"]}\' instead.`);if(c=r.parse(o["vertical-align"],1,Y),!c)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=r.parse(e[s],1,Z);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Fp(n)}evaluate(e){return new ze(this.sections.map(r=>{let i=r.content.evaluate(e);return _t(i)===mn?new Js("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new Js(Gi(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}};function kp(t,e,r=0,i=t.length-1,n=t0){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);kp(t,e,Math.max(r,Math.floor(e-u*c/l+p)),Math.min(i,Math.floor(e+(l-u)*c/l+p)),n)}let a=t[e],s=r,o=i;for(ki(t,r,e),n(t[i],a)>0&&ki(t,r,i);s0;)o--}n(t[r],a)===0?ki(t,r,o):(o++,ki(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function ki(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function t0(t,e){return te)}function Ra(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=r0(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a2){let u=e[1];if(typeof u!="string"||!(u in jn)||u==="object")return r.error(\'The item type argument of "array" must be one of string, number, boolean\',1);o=jn[u],i++}else o=Z;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error(\'The length argument to "array" must be a positive integer literal\',2);l=e[2],i++}n=Ut(o,l)}else{if(!jn[a])throw Error(`Types doesn\'t contain name = ${a}`);n=jn[a]}let s=[];for(;ie.outputDefined())}},gh={"to-boolean":tt,"to-color":ce,"to-number":I,"to-string":Y},jr=class Ip{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[0];if(!gh[i])throw Error(`Can\'t parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&e.length!==2)return r.error("Expected one argument.");let n=gh[i],a=[];for(let s=1;s4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Dp(r[0],r[1],r[2],r[3]),!i))return new gt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ft(i||`Could not parse color from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ae.parse(r);if(n)return n}throw new ft(`Could not parse padding from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=Se.parse(r);if(n)return n}throw new ft(`Could not parse numberArray from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=oe.parse(r);if(n)return n}throw new ft(`Could not parse colorArray from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(e);let n=De.parse(r);if(n)return n}throw new ft(`Could not parse variableAnchorOffsetCollection from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new ft(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return ze.fromString(Gi(this.args[0].evaluate(e)));case"resolvedImage":return _e.fromString(Gi(this.args[0].evaluate(e)));case"projectionDefinition":{let r=this.args[0].evaluate(e);if(Dr.parse(r))return r;throw new ft(`Could not parse projectionDefinition from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}default:return Gi(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Cp=class Mp{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a=i.length)throw new ft(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new ft(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},n0=class Lp{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=tt}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);return!i||!n?null:gl(i.type,[tt,Y,I,dn,Z])?new Lp(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!dr(r,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(_t(r))} instead.`,this.key);if(!dr(i,["string","array"]))throw new ft(`Expected second argument to be of type array or string, but found ${yt(_t(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},a0=class to{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=I}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);if(!i||!n)return null;if(!gl(i.type,[tt,Y,I,dn,Z]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new to(i,n,r.key,a):null}return new to(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!dr(r,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(_t(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),dr(i,["string"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(dr(i,["array"]))return i.indexOf(r,n);throw new ft(`Expected second argument to be of type array or string, but found ${yt(_t(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},s0=class Vp{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let a={},s=[];for(let u=2;u2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d=="number"&&Math.floor(d)!==d)return p.error("Numeric branch labels must be integer values.");if(!i)i=_t(d);else if(p.checkSubtype(i,_t(d)))return null;if(a[String(d)]!==void 0)return p.error("Branch labels must be unique.");a[String(d)]=s.length}let f=r.parse(c,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,Z);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!=="value"&&r.concat(1).checkSubtype(i,o.type)?null:new Vp(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(_t(r)===this.inputType&&this.outputs[this.cases[r]]||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()}},o0=class Op{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let s=1;sr.outputDefined())&&this.otherwise.outputDefined()}},l0=class eo{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,I);if(!i||!n)return null;if(!gl(i.type,[Ut(Z),Y,Z]))return r.error(`Expected first argument to be of type array or string, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new eo(i.type,i,n,r.key,a):null}return new eo(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),dr(r,["string"]))return[...r].slice(i,n).join("");if(dr(r,["array"]))return r.slice(i,n);throw new ft(`Expected first argument to be of type array or string, but found ${yt(_t(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},Rp=class ro{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error("No output type");return n&&a.some(s=>tn(n,s.type))?new ro(Z,a):new ro(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof _e&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function xh(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function u0(t,e,r){return e===r}function h0(t,e,r){return e!==r}function c0(t,e,r){return er}function f0(t,e,r){return e<=r}function d0(t,e,r){return e>=r}function $p(t,e,r,i){return i.compare(e,r)===0}function y0(t,e,r,i){return!$p(t,e,r,i)}function m0(t,e,r,i){return i.compare(e,r)<0}function g0(t,e,r,i){return i.compare(e,r)>0}function x0(t,e,r,i){return i.compare(e,r)<=0}function v0(t,e,r,i){return i.compare(e,r)>=0}function li(t,e,r){let i=t!=="=="&&t!=="!=";return class Np{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=tt,this.hasUntypedArgument=a.type.kind==="value"||s.type.kind==="value"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error("Expected two or three arguments.");let o=a[0],l=s.parse(a[1],1,Z);if(!l)return null;if(!xh(o,l.type))return s.concat(1).error(`"${o}" comparisons are not supported for type \'${yt(l.type)}\'.`);let u=s.parse(a[2],2,Z);if(!u)return null;if(!xh(o,u.type))return s.concat(2).error(`"${o}" comparisons are not supported for type \'${yt(u.type)}\'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types \'${yt(l.type)}\' and \'${yt(u.type)}\'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Ie(u.type,[l],s.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Ie(l.type,[u],s.key)));let h=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(h=s.parse(a[3],3,Pa),!h)return null}return new Np(l,u,s.key,h)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=_t(s),u=_t(o);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new ft(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=_t(s),u=_t(o);if(l.kind!=="string"||u.kind!=="string")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var b0=li("==",u0,$p),w0=li("!=",h0,y0),D0=li("<",c0,m0),_0=li(">",p0,g0),A0=li("<=",f0,x0),S0=li(">=",d0,v0),Up=class qp{constructor(e,r,i){this.type=Pa,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let i=e[1];if(typeof i!="object"||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,tt);if(!n)return null;let a=r.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,tt);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,Y),!s)?null:new qp(n,a,s)}evaluate(e){return new xl(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},E0=class jp{constructor(e,r,i,n,a,s){this.type=Y,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let i=r.parse(e[1],1,I);if(!i)return null;let n=e[2];if(typeof n!="object"||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,Y),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,Y),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,Y),!o))return null;if(s&&o)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,I),!l))return null;let u=null;return n["max-fraction-digits"]&&(u=r.parse(n["max-fraction-digits"],1,I),!u)?null:new jp(i,a,s,o,l,u)}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}},F0=class Gp{constructor(e){this.type=mn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let i=r.parse(e[1],1,Y);return i?new Gp(i):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),i=_e.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},k0=class Xp{constructor(e,r){this.input=e,this.key=r,this.type=I}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${yt(i.type)} instead.`):new Xp(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new ft(`Expected value to be of type string or array, but found ${yt(_t(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},we=8192;function T0(t,e){let r=I0(t[0]),i=M0(t[1]),n=2**e.z;return[Math.round(r*n*we),Math.round(i*n*we)]}function bl(t,e){let r=2**e.z,i=(t[0]/we+e.x)/r,n=(t[1]/we+e.y)/r;return[C0(i),B0(n)]}function I0(t){return(180+t)/360}function C0(t){return t*360-180}function M0(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function B0(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function gn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function en(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function P0(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function z0(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function $a(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return R0([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(vh(t,e,r,i)&&vh(r,i,t,e))}function L0(t,e,r){for(let i of r)for(let n=0;n0&&c<0||h<0&&c>0}function wl(t,e,r){let i=[];for(let n=0;nr[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}gn(e,t)}function $0(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function bh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];Zp(u,e,r,n),s.push(u)}return s}function wh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t){let l=[];for(let u of o){let h=[u.x+a[0],u.y+a[1]];gn(e,h),l.push(h)}s.push(l)}if(e[2]-e[0]<=n/2){$0(e);for(let o of s)for(let l of o)Zp(l,e,r,n)}return s}function N0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=wl(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!ui(o,a))return!1}if(e.type==="MultiPolygon"){let a=Wp(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!V0(o,a))return!1}return!0}function U0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=wl(e.coordinates,i,n),s=wh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!Yp(o,a))return!1}if(e.type==="MultiPolygon"){let a=Wp(e.coordinates,i,n),s=wh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!O0(o,a))return!1}return!0}var Dl=class ha{constructor(e,r){this.type=tt,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'within\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type==="FeatureCollection"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s==="Polygon"&&n.push(o),s==="MultiPolygon"&&n.push(...o)}if(n.length)return new ha(i,{type:"MultiPolygon",coordinates:n})}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new ha(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new ha(i,i)}return r.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return N0(e,this.geometries);if(e.geometryType()==="LineString")return U0(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Hp=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}},Dh=Math.PI/180,_l=class{constructor(t){let e=Dh*6378.137*1e3,r=Math.cos(t*Dh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-u)*this.ky;let f=h*h+c*c;f180;)t-=360;return t}};function Kp(t,e){return e[0]-t[0]}function ga(t){return t[1]-t[0]+1}function Le(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];let r=ga(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function no(t,e){if(!Le(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)gn(r,t[i]);return r}function ao(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)gn(e,i);return e}function _h(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Al(t,e,r){if(!_h(t)||!_h(e))return NaN;let i=0,n=0;return t[2]e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]=i)return i;if(en(n,a)){if(Ah(t,e))return 0}else if(Ah(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,h=u-1;l0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],h=e?50:100;if(ga(u)<=h){if(!Le(u,t.length))return NaN;if(e){let c=X0(t,u,r,i);if(isNaN(c)||c===0)return c;a=Math.min(a,c)}else for(let c=u[0];c<=u[1];++c){let p=G0(t[c],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let c=io(u,e);Sh(s,a,i,t,o,c[0]),Sh(s,a,i,t,o,c[1])}}return a}function va(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new Hp([[0,[0,t.length-1],[0,r.length-1]]],Kp);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=e?50:100,p=i?50:100;if(ga(u)<=c&&ga(h)<=p){if(!Le(u,t.length)&&Le(h,r.length))return NaN;let f;if(e&&i)f=q0(t,u,r,h,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=h[0];y<=h[1];++y)if(f=hr(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(h[0],h[1]+1);for(let y=u[0];y<=u[1];++y)if(f=hr(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=j0(t,u,r,h,n),s=Math.min(s,f)}else{let f=io(u,e),d=io(h,i);Gn(o,s,n,t,r,f[0],d[0]),Gn(o,s,n,t,r,f[0],d[1]),Gn(o,s,n,t,r,f[1],d[0]),Gn(o,s,n,t,r,f[1],d[1])}}return s}function W0(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,va(i,!1,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,va(i,!1,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,xa(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function Z0(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,va(i,!0,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,va(i,!0,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,xa(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function H0(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=Ra(r,0).map(s=>s.map(o=>o.map(l=>bl([l.x,l.y],t.canonical)))),n=new _l(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case"Point":a=Math.min(a,xa([s.coordinates],!1,o,n,a));break;case"LineString":a=Math.min(a,xa(s.coordinates,!0,o,n,a));break;case"Polygon":a=Math.min(a,Y0(o,s.coordinates,n,a))}if(a===0)return a}return a}function Ls(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var El=class ca{constructor(e,r){this.type=I,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'distance\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type==="FeatureCollection")return new ca(i,i.features.map(n=>Ls(n.geometry)).flat());if(i.type==="Feature")return new ca(i,Ls(i.geometry));if("type"in i&&"coordinates"in i)return new ca(i,Ls(i))}return r.error("\'distance\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return W0(e,this.geometries);if(e.geometryType()==="LineString")return Z0(e,this.geometries);if(e.geometryType()==="Polygon")return H0(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},K0=class Jp{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=Z;break}this.type=Ut(r!=null?r:Z,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`\'semiliteral\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=_t(i);if(n.kind==="array"){let a=i.map(s=>r.parse(s,null,Z));return new Jp(a)}return new ri(n,i)}evaluate(e){return this.arr.map(r=>r.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},Fl=class Qp{constructor(e){this.key=e,this.type=Z}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error("Global state property must be defined."):typeof i=="string"?new Qp(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){var i,n;let r=(i=e.globals)==null?void 0:i.globalState;return!r||Object.keys(r).length===0?null:(n=ji(r,this.key))!=null?n:null}eachChild(){}outputDefined(){return!1}},Yr={"==":b0,"!=":w0,">":_0,"<":D0,">=":S0,"<=":A0,array:Ie,at:i0,boolean:Ie,case:o0,coalesce:Rp,collator:Up,format:Ep,image:F0,in:n0,"index-of":a0,interpolate:be,"interpolate-hcl":be,"interpolate-lab":be,length:k0,let:Cp,literal:ri,match:s0,number:Ie,"number-format":E0,object:Ie,semiliteral:K0,slice:l0,step:vl,string:Ie,"to-boolean":jr,"to-color":jr,"to-number":jr,"to-string":jr,var:Bp,within:Dl,distance:El,"global-state":Fl},ve=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},J0=class tf{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new tf(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},ef=class rf{constructor(e,r,i=[],n,a=new J0,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(""),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r?this.concat(r,i,n)._parse(e,a):this._parse(e,a)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);let i=this.key;function n(a,s,o){return o==="assert"?new Ie(s,[a],i):o==="coerce"?new jr(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error(\'Expected an array with at least one element. If you wanted a literal array, use ["literal", []].\');let a=e[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")o=n(o,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))o=n(o,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(o instanceof ri)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let l=new Ap;try{o=new ri(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return e===void 0?this.error("\'undefined\' value invalid. Use null instead."):typeof e=="object"?this.error(\'Bare objects invalid. Use ["literal", {...}] instead.\'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e=="number"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new rf(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join("")}`;this.errors.push(new ve(i,e))}checkSubtype(e,r){let i=tn(e,r);return i&&this.error(i),i}},_r=class Ri{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=Ri.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,h]of o){l=new ef(r.registry,ba,r.path,null,r.scope);let c=[],p=!1;for(let f=1;ftm(c)).join(" | "),h=[];for(let c=1;c>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function sr(t){return{type:t}}_r.register(Yr,{error:[R1,[Y],(t,[e],r)=>{throw new ft(e.evaluate(t),r)}],typeof:[Y,[Z],(t,[e])=>yt(_t(e.evaluate(t)))],"to-rgba":[Ut(I,4),[ce],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[ce,[I,I,I],Eh],rgba:[ce,[I,I,I,I],Eh],has:{type:tt,overloads:[[[Y],(t,[e])=>Fh(e.evaluate(t),t.properties())],[[Y,fr],(t,[e,r])=>Fh(e.evaluate(t),r.evaluate(t))]]},get:{type:Z,overloads:[[[Y],(t,[e])=>Vs(e.evaluate(t),t.properties())],[[Y,fr],(t,[e,r])=>Vs(e.evaluate(t),r.evaluate(t))]]},"feature-state":[Z,[Y],(t,[e])=>Vs(e.evaluate(t),t.featureState||{})],properties:[fr,[],t=>t.properties()],"geometry-type":[Y,[],t=>t.geometryType()],id:[Z,[],t=>t.id()],zoom:[I,[],t=>t.globals.zoom],"heatmap-density":[I,[],t=>t.globals.heatmapDensity||0],elevation:[I,[],t=>t.globals.elevation||0],"line-progress":[I,[],t=>t.globals.lineProgress||0],accumulated:[Z,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[I,sr(I),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],"*":[I,sr(I),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],"-":{type:I,overloads:[[[I,I],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[I],(t,[e])=>-e.evaluate(t)]]},"/":[I,[I,I],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[I,[I,I],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[I,[],()=>Math.LN2],pi:[I,[],()=>Math.PI],e:[I,[],()=>Math.E],"^":[I,[I,I],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[I,[I],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[I,[I],(t,[e])=>Math.log(e.evaluate(t))],log2:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[I,[I],(t,[e])=>Math.sin(e.evaluate(t))],cos:[I,[I],(t,[e])=>Math.cos(e.evaluate(t))],tan:[I,[I],(t,[e])=>Math.tan(e.evaluate(t))],asin:[I,[I],(t,[e])=>Math.asin(e.evaluate(t))],acos:[I,[I],(t,[e])=>Math.acos(e.evaluate(t))],atan:[I,[I],(t,[e])=>Math.atan(e.evaluate(t))],min:[I,sr(I),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[I,sr(I),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[I,[I],(t,[e])=>Math.abs(e.evaluate(t))],round:[I,[I],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[I,[I],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[I,[I],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[tt,[Y,Z],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[tt,[Z],(t,[e])=>t.id()===e.value],"filter-type-==":[tt,[Y],(t,[e])=>t.geometryType()===e.value],"filter-<":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{let r=t.id(),i=e.value;return typeof r==typeof i&&r":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[tt,[Z],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],"filter-has-id":[tt,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[tt,[Ut(Y)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[tt,[Ut(Z)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[tt,[Y,Ut(Z)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[tt,[Y,Ut(Z)],(t,[e,r])=>Q0(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[sr(tt),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[sr(tt),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[tt,[tt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[tt,[Y],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[Y,[Y],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Y,[Y],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Y,sr(Z),(t,e)=>e.map(r=>Gi(r.evaluate(t))).join("")],split:[Ut(Y),[Y,Y],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[Y,[Ut(Y),Y],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],"resolved-locale":[Y,[Pa],(t,[e])=>e.evaluate(t).resolvedLocale()]});function tm(t){return Array.isArray(t)?`(${t.map(yt).join(", ")})`:`(${yt(t.type)}...)`}function ba(t){if(t instanceof Bp)return ba(t.boundExpression);if(t instanceof _r&&t.name==="error"||t instanceof Up||t instanceof Dl||t instanceof El||t instanceof Fl)return!1;let e=t instanceof jr||t instanceof Ie,r=!0;return t.eachChild(i=>{r&&(r=e?ba(i):i instanceof ri)}),r?Na(t)&&Ua(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function Na(t){if(t instanceof _r&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof Dl||t instanceof El)return!1;let e=!0;return t.eachChild(r=>{e&&!Na(r)&&(e=!1)}),e}function rn(t){if(t instanceof _r&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!rn(r)&&(e=!1)}),e}function Ua(t,e){if(t instanceof _r&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!Ua(i,e)&&(r=!1)}),r}function ii(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function nf(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function kl(t){return!!t.expression&&t.expression.interpolated}var Tl=/^(.*)-transition$/;function nn(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function Q(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function qa(t){return typeof t=="object"&&!!t&&!Array.isArray(t)&&_t(t)===fr}function em(t){return t}function rm(t){switch(t.type){case"color":return gt.parse;case"padding":return Ae.parse;case"numberArray":return Se.parse;case"colorArray":return oe.parse;default:return null}}function im(t){switch(t){case"exponential":return sf;case"interval":return am;case"categorical":return nm;case"identity":return sm;default:throw Error(`Unknown function type "${t}"`)}}function af(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",i=r||t.property!==void 0,n=r||!i,a=t.type||(kl(e)?"exponential":"interval"),s=rm(e);if(s&&(t=nn({},t),t.stops&&(t.stops=t.stops.map(h=>[h[0],s(h[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!Z1(t.colorSpace))throw Error(`Unknown color space: "${t.colorSpace}"`);let o=im(a),l,u;if(a==="categorical"){l=Object.create(null);for(let h of t.stops)l[h[0]]=h[1];u=typeof t.stops[0][0]}if(r){let h={},c=[];for(let d=0;dd[0]),evaluate({zoom:d},y){return sf({stops:p,base:t.base},e,d).evaluate(d,y)}}}if(n){let h=a==="exponential"?{name:"exponential",base:t.base===void 0?1:t.base}:null;return{kind:"camera",interpolationType:h,interpolationFactor:be.interpolationFactor.bind(void 0,h),zoomStops:t.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(t,e,c,l,u)}}return{kind:"source",evaluate(h,c){let p=c&&c.properties?c.properties[t.property]:void 0;return p===void 0?xn(t.default,e.default):o(t,e,p,l,u)}}}function xn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function nm(t,e,r,i,n){return xn(typeof r===n?i[r]:void 0,t.default,e.default)}function am(t,e,r){if(Q(r)!=="number")return xn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=Oa(t.stops.map(a=>a[0]),r,"");return t.stops[n][1]}function sf(t,e,r){let i=t.base===void 0?1:t.base;if(Q(r)!=="number")return xn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=Oa(t.stops.map(h=>h[0]),r,""),s=om(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=gr[e.type]||em;return typeof o.evaluate=="function"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function sm(t,e,r){switch(e.type){case"color":r=gt.parse(r);break;case"formatted":r=ze.fromString(r.toString());break;case"resolvedImage":r=_e.fromString(r.toString());break;case"padding":r=Ae.parse(r);break;case"colorArray":r=oe.parse(r);break;case"numberArray":r=Se.parse(r);break;default:Q(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return xn(r,t.default,e.default)}function om(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}function so(t){return{result:"success",value:t}}function Nr(t){return{result:"error",value:t}}var Il=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new Ap,this._defaultValue=r?pf(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ft(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let o=s instanceof ft?s.path:"",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(of(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function of(t,e,r,i){return`${t}${e}: ${r}${i==null?"":` Falling back to ${String(i)}.`}`}function lf(t){if(!t)throw Error(\'rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".\')}function ja(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Yr}function er(t,e,r,i){lf(e);let n=new ef(Yr,ba,[],r?hm(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?so(new Il(a,e,r,i)):Nr(n.errors)}var an=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!=="constant"&&!rn(e.expression),this.globalStateRefs=vn(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},wa=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!=="camera"&&!rn(e.expression),this.globalStateRefs=vn(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?be.interpolationFactor(this.interpolationType,t,e,r):0}};function lm(t){return t._styleExpression!==void 0}function uf(t,e,r,i){let n=er(t,e,r,i);if(n.result==="error")return n;let a=n.value.expression,s=Na(a);if(!s&&!ii(r))return Nr([new ve("","data expressions not supported")]);let o=Ua(a,["zoom"]);if(!o&&!nf(r))return Nr([new ve("","zoom expressions not supported")]);let l=pa(a);if(!l&&!o)return Nr([new ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(l instanceof ve)return Nr([l]);if(l instanceof be&&!kl(r))return Nr([new ve("",\'"interpolate" expressions cannot be used with this property\')]);if(!l)return so(s?new an("constant",n.value,i):new an("source",n.value,i));let u=l instanceof be?l.interpolation:void 0;return so(s?new wa("camera",n.value,l.labels,u,i):new wa("composite",n.value,l.labels,u,i))}var hf=class cf{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,lf(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=pf(i),this._warningHistory={};let n=af(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<"u"&&console.warn(of(this._rootKey,"",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new cf(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function um(t,e,r,i){if(qa(t))return new hf(t,e,r);if(ja(t)){let n=uf(t,e,r,i);if(n.result==="error")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(", "));return n.value}{let n=t;return r.type==="color"&&typeof t=="string"?n=gt.parse(t):r.type==="padding"&&(typeof t=="number"||Array.isArray(t))?n=Ae.parse(t):r.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?n=Se.parse(t):r.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?n=oe.parse(t):r.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?n=De.parse(t):r.type==="projectionDefinition"&&typeof t=="string"&&(n=Dr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>n}}}function pa(t){let e=null;if(t instanceof Cp)e=pa(t.result);else if(t instanceof Rp){for(let r of t.args)if(e=pa(r),e)break}else(t instanceof vl||t instanceof be)&&t.input instanceof _r&&t.input.name==="zoom"&&(e=t);return e instanceof ve||t.eachChild(r=>{let i=pa(r);i instanceof ve?e=i:!e&&i?e=new ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):e&&i&&e!==i&&(e=new ve("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),e}function vn(t,e=new Set){return t instanceof Fl&&e.add(t.key),t.eachChild(r=>{vn(r,e)}),e}function hm(t){let e={color:ce,string:Y,number:I,enum:Y,boolean:tt,formatted:yn,padding:za,numberArray:La,colorArray:Qi,projectionDefinition:Ba,resolvedImage:mn,variableAnchorOffsetCollection:Va};return t.type==="array"?Ut(e[t.value]||Z,t.length):e[t.type]}function pf(t){if(t.type==="color"&&qa(t.default))return new gt(0,0,0,0);switch(t.type){case"color":return gt.parse(t.default)||null;case"padding":return Ae.parse(t.default)||null;case"numberArray":return Se.parse(t.default)||null;case"colorArray":return oe.parse(t.default)||null;case"variableAnchorOffsetCollection":return De.parse(t.default)||null;case"projectionDefinition":return Dr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function ni(t,e){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=t!=null?t:{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:e}}function cm(t){let e=!1;for(let r of t){let i=ff(r);if(i==="expression")return"expression";i==="legacy"&&(e=!0)}return e?"legacy":"neutral"}function ff(t){if(typeof t=="boolean")return"neutral";if(!Array.isArray(t)||t.length===0)return"legacy";switch(t[0]){case"has":return t.length<2||t[1]==="$id"||t[1]==="$type"?"legacy":t.length===2?"neutral":"expression";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return cm(t.slice(1));default:return"expression"}}function Cl(t){return ff(t)!=="legacy"}function kh(t){return t==="$type"?["geometry-type"]:t==="$id"?["id"]:["get",t]}function pm(t){switch(t[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return t.length!==3||typeof t[1]!="string"?null:[t[0],kh(t[1]),t[2]];case"in":case"!in":{if(t.length<2||typeof t[1]!="string")return null;let e=["in",kh(t[1]),["literal",t.slice(2)]];return t[0]==="!in"?["!",e]:e}case"has":case"!has":{if(t.length!==2||typeof t[1]!="string"||t[1]==="$type"||t[1]==="$id")return null;let e=["has",t[1]];return t[0]==="!has"?["!",e]:e}default:return null}}function df(t){if((t[0]==="<"||t[0]==="<="||t[0]===">"||t[0]===">=")&&t[1]==="$type")return`"$type" cannot be use with operator "${t[0]}"`;let e=pm(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function Os(t,e,r){let i=r[t];return Array.isArray(i)?Cl(i)?Ml(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Ml(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case"all":case"any":case"none":for(let r=1;r"u")return;let i=r.path.map(n=>`[${n}]`).join("");console.warn(`${e}${i}: ${df(r.legacyFilter)}`)}var dm={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ai(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Cl(t)?fm(t,e):t=Da(t);let i=er(t,e,dm,r);if(i.result==="error")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:yf(t),getGlobalStateRefs:()=>vn(i.value.expression)}}function ym(t,e){return te)}function yf(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e"||e==="<="||e===">="?Rs(t[1],t[2],e):e==="any"?mm(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(Da)):e==="none"?["all"].concat(t.slice(1).map(Da).map(Xn)):e==="in"?Th(t[1],t.slice(2)):e==="!in"?Xn(Th(t[1],t.slice(2))):e==="has"?Ih(t[1]):e!=="!has"||Xn(Ih(t[1]))}function Rs(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function mm(t){return["any"].concat(t.map(Da))}function Th(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(ym)]]:["filter-in-small",t,["literal",e]]}}function Ih(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Xn(t){return["!",t]}function mf(t){let e=t.key,r=t.value;return r?[new E(e,r,"constants have been deprecated as of v8")]:[]}function Dt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function xr(t){if(Array.isArray(t))return t.map(xr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=xr(t[r]);return e}return Dt(t)}function te(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=Q(r);if(u!=="object")return[new E(e,r,`object expected, ${u} found`)];for(let h in r){let c=h.split(".")[0],p=ji(i,c)||i["*"],f;if(ji(n,c))f=n[c];else if(ji(i,c)){if(r[h]===void 0)continue;f=o}else if(n["*"])f=n["*"];else if(i["*"])f=o;else{l.push(new E(e,r[h],`unknown property "${h}"`));continue}l=l.concat(f({key:(e&&`${e}.`)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h,validateSpec:o},r))}for(let h in i)n[h]||i[h].required&&i[h].default===void 0&&r[h]===void 0&&l.push(new E(e,r,`missing required property "${h}"`));return l}function Bl(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(Q(e)!=="array")return[new E(s,e,`array expected, ${Q(e)} found`)];if(r.length&&e.length!==r.length)return[new E(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),Q(r.value)==="object"&&(l=r.value);let u=[];for(let h=0;hi.maximum?[new E(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new E(e,r,`number expected, ${n} found`)]}function gf(t){let e=t.valueSpec,r=Dt(t.value.type),i,n={},a,s,o=r!=="categorical"&&t.value.property===void 0,l=!o,u=Q(t.value.stops)==="array"&&Q(t.value.stops[0])==="array"&&Q(t.value.stops[0][0])==="object",h=te({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:c,default:d}});return r==="identity"&&o&&h.push(new E(t.key,t.value,\'missing required property "property"\')),r!=="identity"&&!t.value.stops&&h.push(new E(t.key,t.value,\'missing required property "stops"\')),r==="exponential"&&t.valueSpec.expression&&!kl(t.valueSpec)&&h.push(new E(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!ii(t.valueSpec)?h.push(new E(t.key,t.value,"property functions not supported")):o&&!nf(t.valueSpec)&&h.push(new E(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&h.push(new E(t.key,t.value,\'"property" property is required\')),h;function c(y){if(r==="identity")return[new E(y.key,y.value,\'identity function may not have a "stops" property\')];let m=[],g=y.value;return m=m.concat(Bl({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),Q(g)==="array"&&g.length===0&&m.push(new E(y.key,g,"array must have at least one stop")),m}function p(y){let m=[],g=y.value,x=y.key;if(Q(g)!=="array")return[new E(x,g,`array expected, ${Q(g)} found`)];if(g.length!==2)return[new E(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(Q(g[0])!=="object")return[new E(x,g,`object expected, ${Q(g[0])} found`)];if(g[0].zoom===void 0)return[new E(x,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new E(x,g,"object stop key must have value")];if(s&&s>Dt(g[0].zoom))return[new E(x,g[0].zoom,"stop zoom values must appear in ascending order")];Dt(g[0].zoom)!==s&&(s=Dt(g[0].zoom),a=void 0,n={}),m=m.concat(te({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:Ga,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return ja(xr(g[1]))?m.concat([new E(`${x}[1]`,g[1],"expressions are not allowed in function stops.")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=Q(y.value),x=Dt(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new E(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new E(y.key,v,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let b=`number expected, ${g} found`;return ii(e)&&r===void 0&&(b+=\'\\nIf you intended to use a categorical function, specify `"type": "categorical"`.\'),[new E(y.key,v,b)]}return r==="categorical"&&g==="number"&&(!isFinite(x)||Math.floor(x)!==x)?[new E(y.key,v,`integer expected, found ${x}`)]:r!=="categorical"&&g==="number"&&a!==void 0&&xnew E(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new E(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!rn(r))return[new E(t.key,t.value,\'"feature-state" data expressions are not supported with layout properties.\')];if(t.expressionContext==="filter"&&!rn(r))return[new E(t.key,t.value,\'"feature-state" data expressions are not supported with filters.\')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Ua(r,["zoom","feature-state"]))return[new E(t.key,t.value,\'"zoom" and "feature-state" expressions are not supported with cluster properties.\')];if(t.expressionContext==="cluster-initial"&&!Na(r))return[new E(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function gm(t){let e=t.value,r=t.key,i=Q(e);return i==="boolean"?[]:[new E(r,e,`boolean expected, ${i} found`)]}function oo(t){let e=t.key,r=t.value,i=Q(r);return i==="string"?gt.parse(String(r))?[]:[new E(e,r,`color expected, "${r}" found`)]:[new E(e,r,`color expected, ${i} found`)]}function sn(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Dt(r))===-1&&n.push(new E(e,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(Dt(r))===-1&&n.push(new E(e,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function xm(t,e){let r=t;for(let i of e)r=r[i];return r}function vm(t,e){let r=Ml(e);return r?[new E(`${t.key}${r.path.map(i=>`[${i}]`).join("")}`,xm(t.value,r.path),df(r.legacyFilter),null,"warning")]:[]}function Pl(t){let e=xr(t.value);return Cl(e)?[...vm(t,e),...si(nn({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:xf(t)}function xf(t){let e=t.value,r=t.key;if(Q(e)!=="array")return[new E(r,e,`array expected, ${Q(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new E(r,e,"filter array must have at least 1 element")];switch(a=a.concat(sn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Dt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Dt(e[1])==="$type"&&a.push(new E(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&a.push(new E(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=Q(e[1]),n!=="string"&&a.push(new E(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s{c in r&&e.push(new E(i,r[c],`"${c}" is prohibited for ref layers`))});let h;n.layers.forEach(c=>{Dt(c.id)===o&&(h=c)}),h?h.ref?e.push(new E(i,r.ref,"ref cannot reference another ref layer")):s=Dt(h.type):e.push(new E(i,r.ref,`ref layer "${o}" not found`))}else if(s!=="background")if(!r.source)e.push(new E(i,r,\'missing required property "source"\'));else{let h=n.sources&&n.sources[r.source],c=h&&Dt(h.type);h?c==="vector"&&s==="raster"?e.push(new E(i,r.source,`layer "${r.id}" requires a raster source`)):c!=="raster-dem"&&s==="hillshade"||c!=="raster-dem"&&s==="color-relief"?e.push(new E(i,r.source,`layer "${r.id}" requires a raster-dem source`)):c==="raster"&&s!=="raster"?e.push(new E(i,r.source,`layer "${r.id}" requires a vector source`)):c==="vector"&&!r["source-layer"]?e.push(new E(i,r,`layer "${r.id}" must specify a "source-layer"`)):c==="raster-dem"&&s!=="hillshade"&&s!=="color-relief"?e.push(new E(i,r.source,"raster-dem source can only be used with layer type \'hillshade\' or \'color-relief\'.")):s==="line"&&r.paint&&r.paint["line-gradient"]&&(c!=="geojson"||!h.lineMetrics)&&e.push(new E(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new E(i,r.source,`source "${r.source}" not found`))}return s==="raster"&&((l=r.paint)!=null&&l.resampling)&&((u=r.paint)!=null&&u["raster-resampling"])&&e.push(new E(i,r.paint,`layer "${r.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),e=e.concat(te({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Pl,layout(h){return te({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{"*"(c){return wf(nn({layerType:s},c))}}})},paint(h){return te({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{"*"(c){return bf(nn({layerType:s},c))}}})}}})),e}function tr(t){let e=t.value,r=t.key,i=Q(e);return i==="string"?[]:[new E(r,e,`string expected, ${i} found`)]}function bm(t){var c;let e=(c=t.sourceName)!=null?c:"",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=Q(r);if(r===void 0)return s;if(o!=="object")return s.push(new E("source_raster_dem",r,`object expected, ${o} found`)),s;let l=Dt(r.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let p in r)!l&&u.includes(p)?s.push(new E(p,r[p],`In "${e}": "${p}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):n[p]?s=s.concat(t.validateSpec({key:p,value:r[p],valueSpec:n[p],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new E(p,r[p],`unknown property "${p}"`));return s}var Ch={promoteId:wm};function _f(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new E(r,e,\'"type" is required\')];let s=Dt(e.type),o;switch(s){case"vector":case"raster":return o=te({key:r,value:e,valueSpec:i[`source_${s.replace("-","_")}`],style:t.style,styleSpec:i,objectElementValidators:Ch,validateSpec:a}),o;case"raster-dem":return o=bm({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case"geojson":if(o=te({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Ch}),e.cluster)for(let l in e.clusterProperties){let[u,h]=e.clusterProperties[l],c=typeof u=="string"?[u,["accumulated"],["get",l]]:u;o.push(...si({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:"cluster-map"})),o.push(...si({key:`${r}.${l}.reduce`,value:c,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return te({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return te({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new E(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return sn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function wm({key:t,value:e}){if(Q(e)==="string")return tr({key:t,value:e});{let r=[];for(let i in e)r.push(...tr({key:`${t}.${i}`,value:e[i]}));return r}}function Af(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=Q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new E("light",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(Tl);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property "${o}"`)])}return a}function Sf(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=Q(e);if(e===void 0)return[];if(a!=="object")return[new E("sky",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(Tl);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new E(o,e[o],`unknown property "${o}"`)])}return s}function Ef(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=Q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new E("terrain",e,`object expected, ${s} found`)]),a;for(let o in e)a=i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property "${o}"`)]);return a}function Dm(t){return tr(t).length===0?[]:si(t)}function _m(t){return tr(t).length===0?[]:si(t)}function Am(t){let e=t.key,r=t.value;if(Q(r)==="array"){if(r.length<1||r.length>4)return[new E(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a[new E(t,e,\'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"\')],n=r.match(Mm);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Mh||u>Mh?[new E(t,e,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new E(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function Tf(t){var o,l;let e=(o=t.key)!=null?o:"font-faces",r=t.value,i=t.validateSpec,n=(l=t.styleSpec)!=null?l:pp,a=t.style;if(!lo(r))return[new E(e,r,`object expected, ${Q(r)} found`)];let s=[];for(let u in r){let h=r[u],c=Q(h);if(c==="string")s.push(...tr({key:`${e}.${u}`,value:h}));else if(c==="array"){let p={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[f,d]of h.entries()){let y=`${e}.${u}[${f}]`;s.push(...te({key:y,value:d,valueSpec:p,styleSpec:n,style:a,validateSpec:i}));let m=lo(d)?d["unicode-range"]:void 0;if(Q(m)==="array")for(let[g,x]of m.entries())s.push(...Bm(`${y}.unicode-range[${g}]`,x))}}else s.push(new E(`${e}.${u}`,h,`string or array expected, ${c} found`))}return s}var Bh={"*"(){return[]},array:Bl,boolean:gm,number:Ga,color:oo,constants:mf,enum:sn,filter:Pl,function:gf,layer:Df,object:te,source:_f,light:Af,sky:Sf,terrain:Ef,projection:km,projectionDefinition:Tm,string:tr,formatted:Dm,resolvedImage:_m,padding:Am,numberArray:Sm,colorArray:Em,variableAnchorOffsetCollection:Fm,sprite:Ff,state:kf,fontFaces:Tf};function Xi(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=Xi,r.expression&&qa(Dt(e))?gf(t):r.expression&&ja(xr(e))?si(t):r.type&&Bh[r.type]?Bh[r.type](t):te(nn({},t,{valueSpec:r.type?i[r.type]:r}))}function If(t){let e=t.value,r=t.key,i=tr(t);return i.length||(e.indexOf("{fontstack}")===-1&&i.push(new E(r,e,\'"glyphs" url must include a "{fontstack}" token\')),e.indexOf("{range}")===-1&&i.push(new E(r,e,\'"glyphs" url must include a "{range}" token\'))),i}function Qt(t,e=w){let r=[];return r=r.concat(Xi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Xi,objectElementValidators:{glyphs:If,"*"(){return[]}}})),t.constants&&(r=r.concat(mf({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:Xi}))),Cf(r)}Qt.source=ie(re(_f)),Qt.sprite=ie(re(Ff)),Qt.glyphs=ie(re(If)),Qt.fontFaces=ie(re(Tf)),Qt.light=ie(re(Af)),Qt.sky=ie(re(Sf)),Qt.terrain=ie(re(Ef)),Qt.state=ie(re(kf)),Qt.layer=ie(re(Df)),Qt.filter=ie(re(Pl)),Qt.paintProperty=ie(re(bf)),Qt.layoutProperty=ie(re(wf));function re(t){return function(e){return t(Object.assign({},e,{validateSpec:Xi}))}}function Cf(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function ie(t){return function(...e){return Cf(t.apply(this,e))}}var Pm={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},zm=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){var t;return(t=this._literalValue)!=null?t:this._compiledValue.evaluate({})}setValue(t){if(t==null||t==="visible"||t==="none"){this._literalValue=t==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=er(t,this._rootKey,Pm,this._globalState);if(e.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=vn(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function Lm(t,e,r){return new zm(t,e,r)}var Ph=Qt,y5=new Set(Object.keys(w).filter(t=>t.startsWith("source_")).map(t=>t.slice(7).replaceAll("_","-")));function Vm(t,e){let r=!1;for(let i of e){if(i.severity==="warning"){Bt(i.message);continue}t.fire(new ma(Error(i.message))),r=!0}return r}function Om(t,e,r,i){return(i==null?void 0:i.validate)!==!1&&Vm(t,e(je({styleSpec:w},r)))}var uo=class Mf{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u=c[f+0]&&n>=c[f+1])?(o[p]=!0,s.push(h[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=c;f++)for(let d=h;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;sr?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},$m="-transition",Xa=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=um(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},ho=class{constructor(t,e,r){this.property=t,this.value=new Xa(t,void 0,e,r)}transitioned(t,e){return new Lh(this.property,this.value,e,Gt({},t.transition,this.transition),t.now)}untransitioned(){return new Lh(this.property,this.value,null,{},0)}},Nm=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return He(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new Xa(this._values[t].property,e===null?void 0:He(e),this._propertyRootKey(t),this._globalState)}getTransition(t){return He(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=He(e)||void 0}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}${$m}`]=i)}return t}transitioned(t,e){let r=new Vh(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new Vh(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},Lh=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(ii.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Lf=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind==="constant"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new st(Math.floor(e.zoom-1),e)),t.expression.evaluate(new st(Math.floor(e.zoom),e)),t.expression.evaluate(new st(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Wa=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Xt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new Xa(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new ho(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};C("DataDrivenProperty",N),C("DataConstantProperty",V),C("CrossFadedDataDrivenProperty",on),C("CrossFadedProperty",Lf),C("ColorRampProperty",Wa);var Rh=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",$s=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",de=class extends O1{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=Lm(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=ai(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new Um(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new Nm(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ya(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=ai(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){var e;if(t==="visibility")return this.visibility;if((e=this._transitionablePaint)!=null&&e.hasProperty(t))throw Error(t+Rh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){var e;let t=new globalThis.Map;if(this._transitionablePaint)for(let r in this._transitionablePaint._values){let i=this._transitionablePaint._values[r].value;for(let n of i.getGlobalStateRefs()){let a=(e=t.get(n))!=null?e:[];a.push({name:r,value:i.value}),t.set(n,a)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){var i;if(t==="visibility"){this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility();return}if((i=this._transitionablePaint)!=null&&i.hasProperty(t)){this.fire(new ma(Error(t+Rh)));return}e!=null&&this._validate(Ph.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){var e,r;if(t.endsWith("-transition")){let i=t.slice(0,-11);if(i==="visibility"||(e=this._unevaluatedLayout)!=null&&e.hasProperty(i))throw Error(t+$s);return this._transitionablePaint.getTransition(i)}if(t==="visibility"||(r=this._unevaluatedLayout)!=null&&r.hasProperty(t))throw Error(t+$s);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){var i;if(t==="visibility"||(i=this._unevaluatedLayout)!=null&&i.hasProperty(t))return this.fire(new ma(Error(t+$s))),!1;if(e!=null&&this._validate(Ph.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith("-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let n=this._transitionablePaint._values[t],a=n.property.specification["property-type"]==="cross-faded-data-driven",s=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let l=this._transitionablePaint._values[t].value;return l.isDataDriven()||s||a||this._handleOverridablePaintPropertyUpdate(t,o,l)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){var e,r;let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)==null?void 0:e.serialize(),paint:(r=this._transitionablePaint)==null?void 0:r.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),T1(t,(i,n)=>i!==void 0&&!(n==="layout"&&!Object.keys(i).length)&&!(n==="paint"&&!Object.keys(i).length))}_validate(t,e,r,i,n={}){return Om(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof se&&ii(e.property.specification)&&(e.value.kind==="source"||e.value.kind==="composite")&&e.value.isStateDependent)return!0}return!1}},qm,jm=()=>qm||(qm=new Xt({"raster-opacity":new V(w.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new V(w.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new V(w.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new V(w.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new V(w.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new V(w.paint_raster["raster-contrast"],"raster-contrast"),resampling:new V(w.paint_raster.resampling,"resampling"),"raster-resampling":new V(w.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new V(w.paint_raster["raster-fade-duration"],"raster-fade-duration")})),Gm={get paint(){return jm()}};var Xm=class extends de{constructor(t,e){super(t,Gm,e)}},Ym={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},bn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},xt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function At(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=Wm(n.type),s=r=$h(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:$h(r,Math.max(i,e)),alignment:e}}function Wm(t){return Ym[t].BYTES_PER_ELEMENT}function $h(t,e){return Math.ceil(t/e)*e}var ln=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};ln.prototype.bytesPerElement=4,C("StructArrayLayout2i4",ln);var co=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};co.prototype.bytesPerElement=6,C("StructArrayLayout3i6",co);var Nh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Nh.prototype.bytesPerElement=8,C("StructArrayLayout4i8",Nh);var po=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};po.prototype.bytesPerElement=12,C("StructArrayLayout2i4i12",po);var fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*4,l=t*8;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,t}};fo.prototype.bytesPerElement=8,C("StructArrayLayout2i4ub8",fo);var un=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};un.prototype.bytesPerElement=8,C("StructArrayLayout2f8",un);var yo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,h){let c=t*10;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};yo.prototype.bytesPerElement=20,C("StructArrayLayout10ui20",yo);var mo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};mo.prototype.bytesPerElement=16,C("StructArrayLayout8ui16",mo);var go=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,h,c,p)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[y+6]=f,t}};go.prototype.bytesPerElement=28,C("StructArrayLayout4i4ui4i1f28",go);var xo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};xo.prototype.bytesPerElement=12,C("StructArrayLayout3f12",xo);var vo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};vo.prototype.bytesPerElement=4,C("StructArrayLayout1ul4",vo);var bo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let h=t*10,c=t*5;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,t}};bo.prototype.bytesPerElement=20,C("StructArrayLayout6i1ul2ui20",bo);var wo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};wo.prototype.bytesPerElement=12,C("StructArrayLayout2i2i2i12",wo);var Uh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};Uh.prototype.bytesPerElement=16,C("StructArrayLayout2f1f2i16",Uh);var Do=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};Do.prototype.bytesPerElement=16,C("StructArrayLayout2ub2f2i16",Do);var _o=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};_o.prototype.bytesPerElement=6,C("StructArrayLayout3ui6",_o);var Ao=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let v=t*26,b=t*13,D=t*52;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=h,this.float32[b+7]=c,this.float32[b+8]=p,this.uint8[D+36]=f,this.uint8[D+37]=d,this.uint8[D+38]=y,this.uint32[b+10]=m,this.int16[v+22]=g,this.float32[b+12]=x,t}};Ao.prototype.bytesPerElement=52,C("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",Ao);var So=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P){let L=this.length;return this.resize(L+1),this.emplace(L,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P,L){let F=t*34,$=t*17;return this.int16[F+0]=e,this.int16[F+1]=r,this.int16[F+2]=i,this.int16[F+3]=n,this.int16[F+4]=a,this.int16[F+5]=s,this.int16[F+6]=o,this.int16[F+7]=l,this.uint16[F+8]=u,this.uint16[F+9]=h,this.uint16[F+10]=c,this.uint16[F+11]=p,this.uint16[F+12]=f,this.uint16[F+13]=d,this.uint16[F+14]=y,this.uint16[F+15]=m,this.uint16[F+16]=g,this.uint16[F+17]=x,this.uint16[F+18]=v,this.uint16[F+19]=b,this.uint16[F+20]=D,this.uint16[F+21]=A,this.uint16[F+22]=_,this.uint32[$+12]=S,this.float32[$+13]=k,this.float32[$+14]=z,this.uint16[F+30]=O,this.uint16[F+31]=P,this.float32[$+16]=L,t}};So.prototype.bytesPerElement=68,C("StructArrayLayout8i15ui1ul2f2ui1f68",So);var _a=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};_a.prototype.bytesPerElement=4,C("StructArrayLayout1f4",_a);var Eo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};Eo.prototype.bytesPerElement=12,C("StructArrayLayout1ui2f12",Eo);var Fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};Fo.prototype.bytesPerElement=8,C("StructArrayLayout1ul2ui8",Fo);var ko=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};ko.prototype.bytesPerElement=4,C("StructArrayLayout2ui4",ko);var qh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};qh.prototype.bytesPerElement=2,C("StructArrayLayout1ui2",qh);var To=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};To.prototype.bytesPerElement=16,C("StructArrayLayout4f16",To);var Vf=class extends bn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new B(this.anchorPointX,this.anchorPointY)}};Vf.prototype.size=20;var Ll=class extends bo{get(t){return new Vf(this,t)}};C("CollisionBoxArray",Ll);var Of=class extends bn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};Of.prototype.size=52;var Rf=class extends Ao{get(t){return new Of(this,t)}};C("PlacedSymbolArray",Rf);var $f=class extends bn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};$f.prototype.size=68;var Nf=class extends So{get(t){return new $f(this,t)}};C("SymbolInstanceArray",Nf);var Uf=class extends _a{getoffsetX(t){return this.float32[t*1+0]}};C("GlyphOffsetArray",Uf);var qf=class extends co{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};C("SymbolLineVertexArray",qf);var jf=class extends bn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};jf.prototype.size=12;var Gf=class extends Eo{get(t){return new jf(this,t)}};C("TextAnchorOffsetArray",Gf);var Xf=class extends bn{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]}};Xf.prototype.size=8;var Yf=class extends Fo{get(t){return new Xf(this,t)}};C("FeatureIndexArray",Yf);var Zm=class extends ln{};var Hm=class extends ln{},Km=class extends ln{},Jm=class extends po{},Qm=class extends fo{},tg=class extends un{},Vr=class extends yo{},jh=class extends mo{},eg=class extends go{},rg=class extends xo{},ig=class extends vo{},Gh=class extends wo{};var ng=class extends Do{};var wn=class extends _o{},Io=class extends ko{};var Co=At([{name:"a_pos",components:2,type:"Int16"}],4),ag=Co.members;Co.size,Co.alignment;var ee=class Ur{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>Ur.MAX_VERTEX_ARRAY_LENGTH&&Bt(`Max vertices per segment is ${Ur.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${Ur.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>Ur.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new Ur([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};ee.MAX_VERTEX_ARRAY_LENGTH=2**16-1,C("SegmentVector",ee);function Xh(t,e){return t=Ji(Math.floor(t),0,255),e=Ji(Math.floor(e),0,255),256*t+e}var sg=At([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),og=At([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),lg=fl(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,h=461845907,c,p=0;p>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)&4294967295,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,a){case 3:c^=(i.charCodeAt(p+2)&255)<<16;case 2:c^=(i.charCodeAt(p+1)&255)<<8;case 1:c^=i.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)&4294967295,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)&4294967295,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),ug=fl(((t,e)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=r})),Mo=h1(fl(((t,e)=>{var r=lg(),i=ug();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),Wf=class Zf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Yh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let r=Yh(e),i=0,n=this.ids.length-1;for(;i>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Bo(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new Zf;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Yh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Mo.default)(String(t))}function Bo(t,e,r,i){for(;r>1],a=r-1,s=i+1;for(;;){do a++;while(t[a]n);if(a>=s)break;Yn(t,a,s),Yn(e,3*a,3*s),Yn(e,3*a+1,3*s+1),Yn(e,3*a+2,3*s+2)}s-r`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type==="color"?new cg(t,e):new Ol(t,e)}},ur=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i==="u_pattern_to"?n=this.patternTo:i==="u_pattern_from"?n=this.patternFrom:i==="u_dasharray_to"?n=this.dashTo:i==="u_dasharray_from"?n=this.dashFrom:i==="u_pixel_ratio_to"?n=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new hg(t,e):new Ol(t,e)}},ke=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new st(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type==="color"){let i=Po(r);for(let n=t;n`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new st(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new st(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(this.zoom,n),r,i),s=this.expression.evaluate(new st(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type==="color"){let n=Po(r),a=Po(i);for(let s=t;s`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof ke||r instanceof he)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof Ye){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof $i||r instanceof ur||r instanceof he)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof $i||n instanceof ur||n instanceof he){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof Ye){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof ke||r instanceof he)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof ke||r instanceof he||r instanceof Ye)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof ke||e instanceof he||e instanceof Ye)&&e.destroy()}}},vr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new Jf(i,e,r);this.needsUpload=!1,this._featureMap=new Wf,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function pg(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function fg(t){return{"line-pattern":{source:Vr,composite:Vr},"fill-pattern":{source:Vr,composite:Vr},"fill-extrusion-pattern":{source:Vr,composite:Vr},"line-dasharray":{source:jh,composite:jh}}[t]}function Wh(t,e,r){var n;let i={color:{source:un,composite:To},number:{source:_a,composite:un}};return((n=fg(t))==null?void 0:n[r])||i[e][r]}C("ConstantBinder",$i),C("CrossFadedConstantBinder",ur),C("SourceExpressionBinder",ke),C("CrossFadedPatternBinder",Hf),C("CrossFadedDasharrayBinder",Kf),C("CompositeExpressionBinder",he),C("ProgramConfiguration",Jf,{omit:["_buffers"]}),C("ProgramConfigurationSet",vr);var zo=2**14-1,Zh=-zo-1;function Ar(t){let e=mt/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=Ji(a,Zh,zo),n.y=Ji(s,Zh,zo),(an.x+1||sn.y+1)&&Bt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function hi(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ar(t):[]}}var Hh=-32768;function dg(t,e,r,i,n){t.emplaceBack(Hh+e*8+i,Hh+r*8+n)}var Rl=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Hm,this.indexArray=new wn,this.segments=new ee,this.programConfigurations=new vr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type==="heatmap";if(i.type==="circle"){let c=i;a=c.layout.get("circle-sort-key"),s=!a.isConstant(),o||(o=c.paint.get("circle-pitch-alignment")==="map")}let l=o?e.subdivisionGranularity.circle:1,u=new st(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:p,index:f,sourceLayerIndex:d}of t){let y=hi(c,h);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:c.properties,type:c.type,sourceLayerIndex:d,index:f,geometry:h?y.geometry:Ar(c),patterns:{},sortKey:m};n.push(g)}s&&n.sort((c,p)=>c.sortKey-p.sortKey);for(let c of n){let{geometry:p,index:f,sourceLayerIndex:d}=c,y=t[f].feature;this.addFeature(c,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ag),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,h=l.y;if(u<0||u>=8192||h<0||h>=8192)continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;for(let f=0;f=3){for(let n of i)if(oi(t,n))return!0}if(gg(t,i,r))return!0}return!1}function gg(t,e,r){if(t.length>1){if($l(t,e))return!0;for(let i of e)if(Lo(i,t,r))return!0}for(let i of t)if(Lo(i,e,r))return!0;return!1}function $l(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Kh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function oi(t,e){let r=!1;for(let i=0,n=t.length-1;ie.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function vg(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new B(e,r),new B(e,n),new B(i,n),new B(i,r)];if(t.length>2){for(let s of a)if(oi(t,s))return!0}for(let s=0;sn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return!1;let a=Ke(t,e,r[0]);return a!==Ke(t,e,r[1])||a!==Ke(t,e,r[2])||a!==Ke(t,e,r[3])}function Wr(t,e,r){let i=e.paint.get(t).value;return i.kind==="constant"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ha(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ka(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=B.convert(e)._mult(n);r==="viewport"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function wg(t){let e=[];for(let r=0;rNl(n,e,r,i))}var kg,Tg=()=>kg||(kg=new Xt({"circle-sort-key":new N(w.layout_circle["circle-sort-key"],"circle-sort-key")})),Ig,Cg=()=>Ig||(Ig=new Xt({"circle-radius":new N(w.paint_circle["circle-radius"],"circle-radius"),"circle-color":new N(w.paint_circle["circle-color"],"circle-color"),"circle-blur":new N(w.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new N(w.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new V(w.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new V(w.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new V(w.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new V(w.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new N(w.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new N(w.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new N(w.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})),Mg={get paint(){return Cg()},get layout(){return Tg()}};var Bg=class extends de{constructor(t,e){super(t,Mg,e)}createBucket(t){return new Rl(t)}queryRadius(t){let e=t;return Wr("circle-radius",this,e)+Wr("circle-stroke-width",this,e)+Ha(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Ka(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),h=this.paint.get("circle-pitch-scale"),c=this.paint.get("circle-pitch-alignment"),p,f;return c==="map"?(p=l,f=u*a):(p=Fg(l,n,s,o),f=u),ed({queryGeometry:p,size:f,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},i)}},rd=class extends Rl{};C("HeatmapBucket",rd,{omit:["layers"]});var Pg,zg=()=>Pg||(Pg=new Xt({"heatmap-radius":new N(w.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new N(w.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new V(w.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Wa(w.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new V(w.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})),Lg={get paint(){return zg()}};function Ul(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function id(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Ul({},{width:e,height:r},i);ql(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function ql(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError("out of range destination coordinates for image copy");let s=t.data,o=e.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;s$g||($g=new Xt({"hillshade-illumination-direction":new V(w.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new V(w.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new V(w.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new V(w.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new V(w.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new V(w.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new V(w.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new V(w.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new V(w.paint_hillshade.resampling,"resampling")})),Ug={get paint(){return Ng()}};var qg=class extends de{constructor(t,e){super(t,Ug,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(ch);return{directionRadians:t.map(ch),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},jg,Gg=()=>jg||(jg=new Xt({"color-relief-opacity":new V(w["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Wa(w["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new V(w["paint_color-relief"].resampling,"resampling")})),Xg={get paint(){return Gg()}};function Wn(t){return"data"in t}var Jh=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){var u;let{width:i,height:n}=t,a=(((u=this.size)==null?void 0:u[0])!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!(e!=null&&e.useMipmap),a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&(e==null?void 0:e.premultiply)!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let h=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,h,o.RGBA8,i,n),Wn(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=t;l&&c&&(c=Ns(c)),c&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,c)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else Wn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:h,y:c}=r||{x:0,y:0};Wn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,h,c,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,h,c,o))}this.useMipmap&&!(Wn(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=Ns(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=Ns(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),(r===n.LINEAR_MIPMAP_NEAREST||r===n.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Pe,jl=(Pe=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i)){Bt(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Pe.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;hthis.max&&(this.max=f),f=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,h=this._unpackAtIndex(a,s),c=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return sd(e,this.getUnpackVector())}getPixels(){return new Zt({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let h=s;h80*r){o=t[0],l=t[1];let h=o,c=l;for(let p=r;ph&&(h=f),d>c&&(c=d)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return Ro(a,s,o,l,u),s}function od(t,e,r,i,n){let a=null;if(n===fx(t,e,r,i)>0)for(let s=e;s=e;s-=i)a=ec(s/i|0,t[s],t[s+1],a);return a&&cn(a,a.next)&&(fn(a),a=a.next),a}function br(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(hn.size===0||!hn.has(i))&&(cn(i,i.next)||Ft(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),Oo=!0,fn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Ro(t,e,r,i,n){n&&ox(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Ft(o,t,l)<0&&(n?Kg(t,r,i,n):Hg(t))){e.push(o.i,t.i,l.i),fn(t),t=l,a=l;continue}if(t=l,t===a){if(Oo=!1,t=br(t),Oo){a=t;continue}if(!s){t=Jg(t,e),a=t,s=!0;continue}Qg(t,e,r,i,n);break}}}function Hg(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,h=Math.min(n,a,s),c=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&(n!==d.x||o!==d.y)&&Ea(n,o,a,l,s,u,d.x,d.y)&&Ft(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Kg(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,h=n.y,c=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(h,c,p),y=Math.max(o,l,u),m=Math.max(h,c,p),g=qo(f,d,e,r,i),x=qo(y,m,e,r,i),v=t.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||h!==v.y)&&Ea(o,h,l,c,u,p,v.x,v.y)&&Ft(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=t.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||h!==b.y)&&Ea(o,h,l,c,u,p,b.x,b.y)&&Ft(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Jg(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;ud(n,r,r.next,a,!1)&&pn(n,a)&&pn(a,n)&&(e.push(n.i,r.i,a.i),fn(r),fn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?br(r):r}function Qg(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&hx(a,s)){let o=hd(a,s);a=br(a,a.next),o=br(o,o.next),Ro(a,e,r,i,n),Ro(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var $o=!1;function tx(t,e,r,i){let n=[];for(let a=0,s=e.length;as&&(s=r.x),r.yo&&(o=r.y),h.xs&&(s=h.x),h.yo&&(o=h.y),r=h}while(++l<16&&r!==e);Uo[i]=r;let u=i*4;wt[u]=n,wt[u+1]=a,wt[u+2]=s,wt[u+3]=o}while(r!==e)}function nx(t,e){let r=t.z*4;e.xwt[r+2]&&(wt[r+2]=e.x),e.y>wt[r+3]&&(wt[r+3]=e.y)}function Qh(t){let e=Uo[t];for(;e.prev.next!==e;)e=e.next;return Uo[t]=e,e}function tc(t){let e=No[t];for(;e.prev.next!==e;)e=e.next;return No[t]=e,e}function ax(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(cn(t,r))return r;for(let p=0,f=0;pwt[f+3]||wt[f]>i||wt[f+2]<=a)continue;let d=Qh(p);r=tc(p);do{if(r.prev.next===r){if(cn(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.xi||wt[f+3]h)continue;let d=Qh(p);r=tc(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&Ea(ni)&&(ys.x||r.x===s.x&&sx(s,r)))&&(s=r,c=y)}r=r.next}while(r!==d)}return s}function sx(t,e){return Ft(t.prev,t,e.prev)<0&&Ft(e.next,t,t.next)<0}var ae=[],Ti=[],or=new Uint32Array,Ii=new Uint32Array,Ci=new Uint32Array(256);function ox(t,e,r,i){let n=t,a=0;do n.z=qo(n.x,n.y,e,r,i),ae[a++]=n,n=n.next;while(n!==t);lx(a);let s=null;for(let o=0;o=0&&ae[n].z>i;)ae[n+1]=ae[n],n--;ae[n+1]=r}return}or.length>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Ci[o];Ci[o]=s,s+=l}for(let o=0;o>>a&255]++;i[u]=e[o],n[u]=l}}function qo(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function ux(t){let e=t,r=t;do(e.x=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function hx(t,e){let r=cn(t,e)&&Ft(t.prev,t,t.next)>0&&Ft(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||pn(t,e)&&pn(e,t)&&(Ft(t.prev,t,e.prev)!==0||Ft(t,e.prev,e)!==0))&&!cx(t,e)&&(r||px(t,e))}function Ft(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function cn(t,e){return t.x===e.x&&t.y===e.y}function ud(t,e,r,i,n=!0){let a=Ft(t,e,r),s=Ft(t,e,i),o=Ft(r,i,t),l=Ft(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&Hn(t,r,e)||s===0&&Hn(t,i,e)||o===0&&Hn(r,t,i)||l===0&&Hn(r,e,i)):!1}function Hn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function cx(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.xa&&o.y>a||s.y=0&&Ft(t,t.prev,e)>=0:Ft(t,e,t.prev)<0||Ft(t,t.next,e)<0}function px(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function hd(t,e){let r=jo(t.i,t.x,t.y),i=jo(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function ec(t,e,r,i){let n=jo(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function fn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),$o&&nx(t.prev,t.next)}function jo(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function fx(t,e,r,i){let n=0;for(let a=e,s=r-i;at)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<32767||e>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,a),this._vertexBuffer.push(r,i),a}_subdivideTrianglesScanline(t){if(this._granularity<2)return gx(this._vertexBuffer,t);let e=[],r=t.length;for(let i=0;i=1||b<=0)||m&&(ln)){h>=i&&h<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let _=o+f*v,S=l+d*v;a.push(this._vertexToIndex(_,S))}let D=o+f*Math.max(v,0),A=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,h,D,A),!m&&b<1){let _=o+f*b,S=l+d*b;a.push(this._vertexToIndex(_,S))}(m||h>=i&&h<=n)&&a.push(r[(s+1)%3]),!m&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,o,l,u,h,c,p,A,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,h=u?Math.min(e,i):Math.min(a,s),c=u?Math.max(e,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(u?e=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let h=n-r,c=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+c*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o=1||m<=0){let _=e-a,S=r-s,k=(l-s)/S,z=(u-s)/S,O=a+_*Math.min(k,z);x=Math.floor(Math.min(O,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(O,o)/this._granularityCellSize)-1,b=o0?u:l;if(b)for(let _=x;_<=v;_++){let S=_*this._granularityCellSize;t.push(this._vertexToIndex(S,A))}else for(let _=v;_>=x;_--){let S=_*this._granularityCellSize;t.push(this._vertexToIndex(S,A))}}_generateOutline(t){let e=[];for(let r of t){let i=cr(r,this._granularity,!0),n=this._pointArrayToIndices(i),a=[];for(let s=1;sn==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=mt,a=t.length;for(let s=2;s=2&&((s=this._canonical)==null?void 0:s.z)===0&&(n=this._removeTrianglesOutsideTileX(n),a=a.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:n,indicesLineList:a}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r0?(Math.floor(_/s)+1)*s:(Math.ceil(_/s)-1)*s,O=b>0?(Math.floor(S/s)+1)*s:(Math.ceil(S/s)-1)*s,P=Math.abs(_-z),L=Math.abs(S-O),F=Math.abs(_-y),$=Math.abs(S-m),U=g?P/D:1/0,T=x?L/A:1/0;if((F<=P||!g)&&($<=L||!x))break;if(U0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function xx(t,e,r){if(e.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,n=t[e[0]*2];for(let l=1;l=0?s-1:a-1,u=(o+1)%a,h=t[e[l]*2],c=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(hp)x=!1;else{let v=g-y,b=-(m-d),D=y((p-d)*v+(f-y)*b)*D&&(x=!0)}if(x){let v=e[l],b=e[s],D=e[o];v!==b&&v!==D&&b!==D&&r.push(D,b,v),s--,s<0&&(s=a-1)}else{let v=e[u],b=e[s],D=e[o];v!==b&&v!==D&&b!==D&&r.push(D,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function pd(t,e,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(uee.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=Zi(s,i,a,o,p,y,u),b=Zi(s,i,a,o,f,m,u),D=Zi(s,i,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+D-l),u.primitiveLength++}}function bx(t,e,r,i,n,a){let s=[];for(let c=0;cee.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,h=0);let x=Zi(s,i,a,o,f,y,u),v=Zi(s,i,a,o,d,m,u);r.emplaceBack(h+x-l,h+v-l),u.primitiveLength++}}var fd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new Km,this.indexArray=new wn,this.indexArray2=new Io,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.segments2=new ee,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Aa("fill",this.layers,e);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Ar(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let f=Gl("fill",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,h,r,{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Bt(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${t}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Wg),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of Ra(e,500)){let o=cd(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;pd((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};C("FillBucket",fd,{omit:["layers","patternFeatures"]});var wx,Dx=()=>wx||(wx=new Xt({"fill-sort-key":new N(w.layout_fill["fill-sort-key"],"fill-sort-key")})),_x,Ax=()=>_x||(_x=new Xt({"fill-antialias":new V(w.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new N(w.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new V(w.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new N(w.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new N(w.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new V(w.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new V(w.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new on(w.paint_fill["fill-pattern"],"fill-pattern")})),Sx={get paint(){return Ax()},get layout(){return Dx()}};var Ex=class extends de{constructor(t,e){super(t,Sx,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new fd(t)}queryRadius(){return Ha(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:r,pixelsToTileUnits:i}){return Qf(Ka(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},Go=At([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Fx=At([{name:"a_centroid",components:2,type:"Int16"}],4),kx=Go.members;Go.size,Go.alignment;var Fa=class Xo{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new Xo;return r.extend(e(new B(this.minX,this.minY))),r.extend(e(new B(this.maxX,this.minY))),r.extend(e(new B(this.minX,this.maxY))),r.extend(e(new B(this.maxX,this.maxY))),r}static fromPoints(e){let r=new Xo;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},g5=Fa.fromPoints([new B(0,0),new B(mt,mt)]);function Yo(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function rc(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var Dn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new B(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new B(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),no&&(o=n),au&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(c){return[(c.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+a)*2/i)*Math.PI))-90]}function l(c){return c.map(o)}let u;if(this.type===1){let c=[];for(let f of s)c.push(f[0]);let p=l(c);u=c.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}}else if(this.type===3){let c=dd(s),p=[];for(let f of c)p.push(f.map(l));u=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw Error("unknown feature type");let h={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};Dn.types=["Unknown","Point","LineString","Polygon"];function dd(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Dn(this._pbf,e,this.extent,this._keys,this._values)}};function Cx(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ui(F1(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return yd*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof Ui)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ui(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e)return new Ui(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}},md=2*Math.PI*yd;function gd(t){return md*Math.cos(t*Math.PI/180)}function Mx(t){return(180+t)/360}function Bx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Px(t,e){return t/gd(e)}function zx(t){return t*360-180}function Wo(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Lx(t,e){return t*gd(Wo(e))}function Vx(t){return 1/Math.cos(t*Math.PI/180)}var Yl=class xd{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=ic.convert(e);return new xd(Mx(i.lng),Bx(i.lat),Px(r,i.lat))}toLngLat(){return new ic(zx(this.x),Wo(this.y))}toAltitude(){return Lx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/md*Vx(Wo(this.y))}};function Ox(t,e,r){let i=1/(1<Nx(n,i))}function $x(t,e){let r=Rx(mt/2,mt/2,e),i=Yl.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function qx(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let h=.2,c=Math.min(n,o*h,l*h),p=r.add(a.mult(c)),f=r.add(s.mult(c)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(c/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var js=8192;function Mi(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*js)*2+s,n*js*2,a*js*2,Math.round(o))}var vd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Jm,this.centroidVertexArray=new Zm,this.indexArray=new wn,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=Aa("fill-extrusion",this.layers,e);let i=new st(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),s=n._featureFilter.needGeometry;for(let{feature:o,id:l,index:u,sourceLayerIndex:h}of t){let c=hi(o,s);if(!n._featureFilter.filter(i,c,r))continue;let p=s?c.geometry:Ar(o),f={id:l,sourceLayerIndex:h,index:u,geometry:a>0?nc(p,a,r):p,properties:o.properties,type:o.type,patterns:{}};this.hasDependencies?this.features.push(Gl("fill-extrusion",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,u,r,{},e.subdivisionGranularity),e.featureIndex.insert(o,f.geometry,u,h,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,kx),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Fx.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){let s=this.layers[0],o=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0,l=o>0?nc(e,o,i):e;for(let u of Ra(l,500)){let h={x:0,y:0,sampleCount:0},c=this.layoutVertexArray.length;this.processPolygon(h,i,t,u,a);let p=this.layoutVertexArray.length-c,f=Math.floor(h.x/h.sampleCount),d=Math.floor(h.y/h.sampleCount);for(let y=0;y{Mi(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0;for(let i=1;iee.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=n.sub(a)._perp()._unit(),o=a.dist(n);r+o>32768&&(r=0),Mi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,0,r),Mi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,1,r),r+=o,Mi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,r),Mi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,r);let l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function jx(t,e){for(let r=0;rGx||(Gx=new Xt({"fill-extrusion-rounded-corner-distance":new V(w["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})),Yx,Wx=()=>Yx||(Yx=new Xt({"fill-extrusion-opacity":new V(w["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new N(w["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new V(w["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new V(w["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new on(w["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new N(w["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new N(w["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new V(w["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})),Zx={get paint(){return Wx()},get layout(){return Xx()}};var Hx=class extends de{constructor(t,e){super(t,Zx,e)}createBucket(t){return new vd(t)}queryRadius(){return Ha(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=Ka(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(e,r),u=this.paint.get("fill-extrusion-base").evaluate(e,r),h=Qx(o,s,0),c=Jx(i,u,l,s),p=c[0],f=c[1];return Kx(p,f,h)}};function Bi(t,e){return t.x*e.x+t.y*e.y}function ac(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r>1),s=r-e,o,l=t[e],u=t[e+1],h=t[r],c=t[r+1];for(let p=e+3;pn){o=p,n=f;continue}if(f===n){let d=Math.abs(p-a);di&&(o-e>3&&Zo(t,e,o,i),t[o+2]=n,r-o>3&&Zo(t,o,r,i))}function t2(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function Mt(t,e,r,i){let n={type:e,geom:r},a={id:t!=null?t:null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case"Point":case"MultiPoint":Pi(a,n.geom);break;case"LineString":Pi(a,n.geom.points);break;case"Polygon":Pi(a,n.geom[0].points);break;case"MultiLineString":for(let s of n.geom)Pi(a,s.points);break;case"MultiPolygon":for(let s of n.geom)Pi(a,s[0].points)}return a}function Wl(t){let e=t;t.points.length>64&&(e.points=new Float64Array(t.points))}function Pi(t,e){for(let r=0;r1024)throw Error("GeometryCollection nesting exceeds supported depth: 1024");if(e.geometry.type==="GeometryCollection"){r2(t,e,e.geometry,r,i,n+1);return}if(!((o=e.geometry.coordinates)!=null&&o.length))return;let a=e2(e,r,i),s=(r.tolerance/((1<0&&(s+=i?(n*h-u*a)/2:Math.sqrt((u-n)**2+(h-a)**2)),n=u,a=h}let o=e.points.length-3;e.points[2]=1,r>0&&Zo(e.points,0,o,r),e.points[o+2]=1,Wl(e),e.size=Math.abs(s),e.start=0,e.end=e.size}function Kl(t,e,r,i){for(let n=0;n1?1:r}function u2(t){return{type:"FeatureCollection",features:t.map(e=>ka(e))}}function ka(t){let e={type:"Feature",geometry:h2(t),properties:t.tags};return t.id!=null&&(e.id=t.id),e}function h2(t){let{type:e,geometry:r}=t;switch(e){case"Point":return{type:e,coordinates:bd(r[0],r[1])};case"MultiPoint":return{type:e,coordinates:Kn(r)};case"LineString":return{type:e,coordinates:Kn(r.points)};case"MultiLineString":case"Polygon":return{type:e,coordinates:r.map(i=>Kn(i.points))};case"MultiPolygon":return{type:e,coordinates:r.map(i=>i.map(n=>Kn(n.points)))}}}function Kn(t){let e=[];for(let r=0;r=r&&s=i)return null;let l=[];for(let u of t){let h=n===0?u.minX:u.minY,c=n===0?u.maxX:u.maxY;if(h>=r&&c=i))switch(u.type){case"Point":case"MultiPoint":c2(u,l,r,i,n);continue;case"LineString":p2(u,l,r,i,n,o);continue;case"MultiLineString":f2(u,l,r,i,n);continue;case"Polygon":d2(u,l,r,i,n);continue;case"MultiPolygon":y2(u,l,r,i,n);continue}}return l.length?l:null}function c2(t,e,r,i,n){let a=[];if(m2(t.geometry,a,r,i,n),!a.length)return;let s=a.length===3?"Point":"MultiPoint";e.push(Mt(t.id,s,a,t.tags))}function p2(t,e,r,i,n,a){let s=[];if(_d(t.geometry,s,r,i,n,!1,a.lineMetrics),s.length){if(a.lineMetrics){for(let o of s)e.push(Mt(t.id,"LineString",o,t.tags));return}if(s.length>1){e.push(Mt(t.id,"MultiLineString",s,t.tags));return}e.push(Mt(t.id,"LineString",s[0],t.tags))}}function f2(t,e,r,i,n){let a=[];if(Jl(t.geometry,a,r,i,n,!1),a.length){if(a.length===1){e.push(Mt(t.id,"LineString",a[0],t.tags));return}e.push(Mt(t.id,"MultiLineString",a,t.tags))}}function d2(t,e,r,i,n){let a=[];Jl(t.geometry,a,r,i,n,!0),a.length&&e.push(Mt(t.id,"Polygon",a,t.tags))}function y2(t,e,r,i,n){let a=[];for(let s of t.geometry){let o=[];Jl(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&e.push(Mt(t.id,"MultiPolygon",a,t.tags))}function m2(t,e,r,i,n){for(let a=0;a=r&&s<=i&&Kr(e,t[a],t[a+1],t[a+2])}}function _d(t,e,r,i,n,a,s){let o=sc(t),l=n===0?g2:x2,u=t.start,h,c;for(let g=0;gr&&(c=l(o,x,v,D,A,r),s&&(o.start=u+h*c)):_>i?S=r&&(c=l(o,x,v,D,A,r),k=!0),S>i&&_<=i&&(c=l(o,x,v,D,A,i),k=!0),!a&&k&&(s&&(o.end=u+h*c),e.push(o),o=sc(t)),s&&(u+=h)}let p=t.points.length-3,f=t.points[p],d=t.points[p+1],y=t.points[p+2],m=n===0?f:d;m>=r&&m<=i&&Kr(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&Kr(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Wl(o),e.push(o))}function sc(t){return{points:[],size:t.size,start:t.start,end:t.end}}function Jl(t,e,r,i,n,a){for(let s of t)_d(s,e,r,i,n,a,!1)}function Kr(t,e,r,i){t.push(e,r,i)}function g2(t,e,r,i,n,a){let s=(a-e)/(i-e);return Kr(t.points,a,r+(n-r)*s,1),s}function x2(t,e,r,i,n,a){let s=(a-r)/(n-r);return Kr(t.points,e+(i-e)*s,a,1),s}function Ql(t,e){let r=e.buffer/e.extent,i=t,n=Te(t,1,-1-r,r,0,-1,2,e),a=Te(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=Te(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=oc(n,1).concat(i)),a&&(i=i.concat(oc(a,-1)))),i}function oc(t,e){let r=[];for(let i of t)switch(i.type){case"Point":case"MultiPoint":{let n=v2(i.geometry,e);r.push(Mt(i.id,i.type,n,i.tags));continue}case"LineString":{let n=Gs(i.geometry,e);r.push(Mt(i.id,i.type,n,i.tags));continue}case"MultiLineString":case"Polygon":{let n=[];for(let a of i.geometry)n.push(Gs(a,e));r.push(Mt(i.id,i.type,n,i.tags));continue}case"MultiPolygon":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push(Gs(o,e));n.push(s)}r.push(Mt(i.id,i.type,n,i.tags));continue}}return r}function v2(t,e){let r=[];for(let i=0;io.id));t=t.filter(o=>!s.has(o.id))}if(i.add.size){let s=Zl({type:"FeatureCollection",features:Array.from(i.add.values())},r);s=Ql(s,r),n=n.concat(s),t=t.concat(s)}}if(i.update.size){let a=new Map,s=[];for(let o of t)i.update.has(o.id)?a.set(o.id,[...a.get(o.id)||[],o]):s.push(o);for(let[o,l]of i.update){let u=a.get(o);if(!u||u.length===0)continue;let h=w2(u,l,r);n=n.concat(u,h),s=s.concat(h)}t=s}return{affected:n,source:t}}function w2(t,e,r){var a,s;let i=!!e.newGeometry,n=e.removeAllProperties||((a=e.removeProperties)==null?void 0:a.length)>0||((s=e.addOrUpdateProperties)==null?void 0:s.length)>0;if(i){let o=t[0],l=Zl({type:"FeatureCollection",features:[{type:"Feature",id:o.id,geometry:e.newGeometry,properties:n?lc(o.tags,e):o.tags}]},r);return l=Ql(l,r),l}if(n){let o=[];for(let l of t){let u=je({},l);u.tags=lc(u.tags,e),o.push(u)}return o}return t}function lc(t,e){if(e.removeAllProperties)return{};let r=je({},t||{});if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function D2(t,e){var r,i;return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map((r=t.add)==null?void 0:r.map(n=>[e.promoteId?n.properties[e.promoteId]:n.id,n])),update:new Map((i=t.update)==null?void 0:i.map(n=>[n.id,n]))}:{remove:new Set,add:new Map,update:new Map}}var uc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],dt=new Uint32Array(96),_2=class Ad{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=uc[i&15];if(!a)throw Error("Unrecognized array type.");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Ad(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=uc.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let h=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(h,8,e),this.coords=new i(h,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=r,new Uint32Array(h,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Ho(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=[];for(;l>0;){let h=dt[--l],c=dt[--l],p=dt[--l];if(c-p<=o){for(let m=p;m<=c;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+c>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(h===0?e<=d:r<=y)&&(dt[l++]=p,dt[l++]=f-1,dt[l++]=1-h),(h===0?i>=d:n>=y)&&(dt[l++]=f+1,dt[l++]=c,dt[l++]=1-h)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=0,h=i*i;for(;l>0;){let c=dt[--l],p=dt[--l],f=dt[--l];if(p-f<=o){for(let g=f;g<=p;g++)hc(s[2*g],s[2*g+1],e,r)<=h&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];hc(y,m,e,r)<=h&&(n[u++]=a[d]),(c===0?e-i<=y:r-i<=m)&&(dt[l++]=f,dt[l++]=d-1,dt[l++]=1-c),(c===0?e+i>=y:r+i>=m)&&(dt[l++]=d+1,dt[l++]=p,dt[l++]=1-c)}return u}};function Ho(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Sd(t,e,s,i,n,a),Ho(t,e,r,i,s-1,1-a),Ho(t,e,r,s+1,n,1-a)}function Sd(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,h=r-i+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);Sd(t,e,r,Math.max(i,Math.floor(r-h*p/u+f)),Math.min(n,Math.floor(r+(u-h)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(zi(t,e,i,r),e[2*n+a]>s&&zi(t,e,i,n);os;)l--}e[2*i+a]===s?zi(t,e,i,l):(l++,zi(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function zi(t,e,r,i){Xs(t,r,i),Xs(e,2*r,2*i),Xs(e,2*r+1,2*i+1)}function Xs(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function hc(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var Ko={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},A2=class{constructor(t){this.options=Object.assign(Object.create(Ko),t),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,[a,s]=[Zr(i),Hr(n)],o={id:r.id,type:"Point",geometry:[a,s],tags:r.properties};e.push(o)}this.createIndex(e)}initialize(t){let e=[];for(let r of t)r.type==="Point"&&e.push(r);this.createIndex(e)}updateIndex(t,e,r){this.options=Object.assign(Object.create(Ko),r.clusterOptions),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;e&&console.time("total time");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=[];for(let o=0;o=r;o--){let l=Date.now();s=this.trees[o]=this.createTree(this.cluster(s,o)),e&&console.log("z%d: %d clusters in %dms",o,s.numItems,Date.now()-l)}e&&console.timeEnd("total time")}getClusters(t,e){return this.getClustersInternal(t,e).map(r=>ka(r))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let h=this.getClustersInternal([r,i,180,a],e),c=this.getClustersInternal([-180,i,n,a],e);return h.concat(c)}let s=this.trees[this.limitZoom(e)],o=s.range(Zr(r),Hr(a),Zr(n),Hr(i)),l=s.flatData,u=[];for(let h of o){let c=this.stride*h;u.push(l[c+5]>1?S2(l,c,this.clusterProps):this.points[l[c+3]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error("No cluster with the specified id: "+t),n=this.trees[r];if(!n)throw i;let a=n.flatData;if(e*this.stride>=a.length)throw i;let s=this.options.radius/(this.options.extent*2**(r-1)),o=a[e*this.stride],l=a[e*this.stride+1],u=n.within(o,l,s),h=[];for(let c of u){let p=c*this.stride;a[p+4]===t&&h.push(a[p+5]>1?E2(a,p,this.clusterProps):ka(this.points[a[p+3]]))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t,{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,h={transformed:!0,features:[],source:null,x:e,y:r,z:t};return this.addTileFeatures(i.range((e-o)/n,l,(e+1+o)/n,u),i.flatData,e,r,n,h),e===0&&this.addTileFeatures(i.range(1-o/n,l,1,u),i.flatData,n,r,n,h),e===n-1&&this.addTileFeatures(i.range(0,l,o/n,u),i.flatData,-1,r,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o!=null&&o.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n1,u,h,c;if(l)u=tu(e,o,this.clusterProps),h=e[o],c=e[o+1];else{let d=this.points[e[o+3]];u=d.tags,[h,c]=d.geometry}let p={type:1,geometry:[[Math.round(this.options.extent*(h*n-r)),Math.round(this.options.extent*(c*n-i))]],tags:u},f;f=l||this.options.generateId?e[o+3]:this.points[e[o+3]].id,f!==void 0&&(p.id=f),a.features.push(p)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*2**e),o=t.flatData,l=[],u=this.stride;for(let h=0;he&&(y+=o[g+5])}if(y>d&&y>=a){let m=c*d,g=p*d,x,v=-1,b=((h/u|0)<<5)+(e+1)+this.points.length;for(let D of f){let A=D*u;if(o[A+2]<=e)continue;o[A+2]=e;let _=o[A+5];m+=o[A]*_,g+=o[A+1]*_,o[A+4]=b,n&&(x||(x=this.map(o,h,!0),v=this.clusterProps.length,this.clusterProps.push(x)),n(x,this.map(o,A)))}o[h+4]=b,l.push(m/y,g/y,1/0,b,-1,y),n&&l.push(v)}else{for(let m=0;m1)for(let m of f){let g=m*u;if(!(o[g+2]<=e)){o[g+2]=e;for(let x=0;x>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+5]>1){let a=this.clusterProps[t[e+6]];return r?Object.assign({},a):a}let i=this.points[t[e+3]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function S2(t,e,r){return{id:t[e+3],type:"Point",tags:tu(t,e,r),geometry:[t[e],t[e+1]]}}function E2(t,e,r){return{type:"Feature",id:t[e+3],properties:tu(t,e,r),geometry:{type:"Point",coordinates:[wd(t[e]),Dd(t[e+1])]}}}function tu(t,e,r){let i=t[e+5],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+6],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+3],point_count:i,point_count_abbreviated:n})}var Ed="geojsonvt_clip_start",Fd="geojsonvt_clip_end";function cc(t,e,r,i,n){let a=e===n.maxZoom?0:n.tolerance/((1<0&&e.size<(n?s:i)){r.numPoints+=e.points.length/3;return}let o=[];for(let l=0;ls)&&(r.numSimplified++,o.push(e.points[l],e.points[l+1])),r.numPoints++;n&&M2(o,a),t.push(o)}function M2(t,e){let r=0;for(let i=0,n=t.length,a=n-2;i0===e)for(let i=0,n=t.length;i1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(e),r.debug>1&&console.timeEnd("invalidating");let[i,n,a]=[0,0,0],s=cc(t,i,n,a,r);s.source=t;let o=Jn(i,n,a);if(this.tiles[o]=s,this.tileCoords.push({z:i,x:n,y:a,id:o}),r.debug){let l=`z${i}`;this.stats[l]=(this.stats[l]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{extent:i,debug:n}=this.options,a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);let o=t,l=e,u=r,h;for(;!h&&o>0;)o--,l>>=1,u>>=1,h=this.tiles[Jn(o,l,u)];return!(h!=null&&h.source)||(n>1&&(console.log("found parent tile z%d-%d-%d",o,l,u),console.time("drilling down")),this.splitTile(h.source,o,l,u,t,e,r),n>1&&console.timeEnd("drilling down"),!this.tiles[s])?null:pc(this.tiles[s],i)}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let h=1<1&&console.time("creation"),p=this.tiles[c]=cc(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:c}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let _=`z${e}`;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let _=n-e;if(r!==a>>_||i!==s>>_)continue}}if(p.source=null,!t.length)continue;u>1&&console.time("clipping");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,D=Te(t,h,r-f,r+y,0,p.minX,p.maxX,l),A=Te(t,h,r+d,r+m,0,p.minX,p.maxX,l);D&&(g=Te(D,h,i-f,i+y,1,p.minY,p.maxY,l),x=Te(D,h,i+d,i+m,1,p.minY,p.maxY,l)),A&&(v=Te(A,h,i-f,i+y,1,p.minY,p.maxY,l),b=Te(A,h,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd("clipping"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(v||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let h=this.tiles[u],c=1<=f||s=y)continue;let m=!1;for(let g of t)if(g.maxX>=p&&g.minX=d&&g.minY1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",h.z,h.x,h.y,h.numFeatures,h.numPoints,h.numSimplified);let g=`z${h.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function Jn(t,e,r){return((1<24)throw Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw Error("promoteId and generateId cannot be used together.");let i=Zl(t,e);r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),i=Ql(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new A2(e.clusterOptions):new z2(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:i,source:n}=b2(this.source,t,r);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(ka(n))||(e.push(n),i.add(n.id)));return t=t.filter(n=>!i.has(n.id)),{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error("to retrieve data the `updateable` option must be set to true");return u2(this.source)}updateClusterOptions(t,e){let r=this.options.cluster;if(this.options.cluster=t,this.options.clusterOptions=e,r==t){this.tileIndex.updateIndex(this.source,[],this.options);return}this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},Jo=At([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),V2=Jo.members;Jo.size,Jo.alignment;var Qo=At([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),O2=Qo.members;Qo.size,Qo.alignment;var R2=Math.cos(75/2*(Math.PI/180)),Id=1/2,fc=2**14/Id,Cd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new Qm,this.layoutVertexArray2=new tg,this.indexArray=new wn,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Aa("line",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Ar(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(Aa("line",this.layers,e)?Gl("line",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,h,r,{},{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,O2)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,V2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,"geojsonvt_clip_start")&&Object.hasOwn(t.properties,"geojsonvt_clip_end"))return{start:+t.properties[Ed],end:+t.properties[Fd]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(t,{}),u=o.get("line-cap").evaluate(t,{}),h=o.get("line-miter-limit").evaluate(t,{}),c=o.get("line-round-limit").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e)this.addLine(p,t,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=cr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v=2&&t[h-1].equals(t[h-2]);)h--;let c=0;for(;c0;if(k&&v>c){let L=d.dist(y);if(L>2*p){let F=d.sub(d.sub(y)._mult(p/L)._round());this.updateDistance(y,F),this.addCurrentVertex(F,g,0,0,f),y=F}}let O=y&&m,P=O?r:u?"butt":i;if(O&&P==="round"&&(_n&&(P="bevel"),P==="bevel"&&(_>2&&(P="flipbevel"),_100)b=x.mult(-1);else{let L=_*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(L*(z?-1:1))}this.addCurrentVertex(d,b,0,0,f),this.addCurrentVertex(d,b.mult(-1),0,0,f)}else if(P==="bevel"||P==="fakeround"){let L=-Math.sqrt(_*_-1),F=z?L:0,$=z?0:L;if(y&&this.addCurrentVertex(d,g,F,$,f),P==="fakeround"){let U=Math.round(S*180/Math.PI/20);for(let T=1;T2*p){let F=d.add(m.sub(d)._mult(p/L)._round());this.updateDistance(d,F),this.addCurrentVertex(F,x,0,0,f),d=F}}}}addCurrentVertex(t,e,r,i,n,a=!1){let s=e.x+e.y*r,o=e.y-e.x*r,l=-e.x+e.y*i,u=-e.y-e.x*i;this.addHalfVertex(t,s,o,a,!1,r,n),this.addHalfVertex(t,l,u,a,!0,-i,n),this.distance>fc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a))}addHalfVertex({x:t,y:e},r,i,n,a,s,o){let l=(this.lineClips?this.scaledDistance*(fc-1):this.scaledDistance)*Id;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!n,(e<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*i)+128,(s===0?0:s<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let r=e.paint.get("line-dasharray");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get("line-dasharray");if(!a||a.value.kind==="constant")continue;let s=n.layout.get("line-cap").evaluate(e,{})==="round",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},h=`${o.dasharray.join(",")},${o.round}`,c=`${l.dasharray.join(",")},${l.round}`,p=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[h]=o,i.dashDependencies[c]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:h,mid:c,max:p}}}};C("LineBucket",Cd,{omit:["layers","patternFeatures"]});var $2,N2=()=>$2||($2=new Xt({"line-cap":new N(w.layout_line["line-cap"],"line-cap"),"line-join":new N(w.layout_line["line-join"],"line-join"),"line-miter-limit":new N(w.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new N(w.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new N(w.layout_line["line-sort-key"],"line-sort-key")})),U2,q2=()=>U2||(U2=new Xt({"line-opacity":new N(w.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new V(w.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new N(w.paint_line["line-color"],"line-color"),"line-translate":new V(w.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new V(w.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new N(w.paint_line["line-width"],"line-width"),"line-gap-width":new N(w.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new N(w.paint_line["line-offset"],"line-offset"),"line-blur":new N(w.paint_line["line-blur"],"line-blur"),"line-dasharray":new on(w.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new on(w.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Wa(w.paint_line["line-gradient"],"line-gradient")})),dc={get paint(){return q2()},get layout(){return N2()}},j2=class extends N{possiblyEvaluate(t,e){return e=new st(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=Gt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,i)}},Qn;var G2=class extends de{constructor(t,e){super(t,dc,e),this.gradientVersion=0,Qn||(Qn=new j2(dc.paint.properties["line-width"].specification,"line-floorwidth"),Qn.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let e=this.gradientExpression();this.stepInterpolant=lm(e)?e._styleExpression.expression instanceof vl:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Qn.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Cd(t)}queryRadius(t){let e=t,r=yc(Wr("line-width",this,e),Wr("line-gap-width",this,e)),i=Wr("line-offset",this,e);return r/2+Math.abs(i)+Ha(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=Ka(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),o=a/2*yc(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(i=Dg(i,l*a)),mg(s,i,o)}isTileClipped(){return!0}};function yc(t,e){return e>0?e+2*t:t}var X2=At([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),Y2=At([{name:"a_projected_pos",components:3,type:"Float32"}],4);At([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var W2=At([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);At([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var mc=At([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),x5=At([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);At([{name:"triangle",components:3,type:"Uint16"}]),At([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),At([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),At([{type:"Float32",name:"offsetX"}]),At([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),At([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wr=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(wr.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,e){return rt(this,null,function*(){if(this.isParsed())return this.getState();if(t.pluginStatus!=="loading")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(yield e(r),yield Promise.race([i,n]),this.isParsed()){let a={pluginStatus:"loaded",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)})}};function Z2(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function H2(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function K2(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function Qa(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function J2(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function Q2(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function gc(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function tv(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||new RegExp("^\\\\p{gc=Mc}","u").test(e)}var ev={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},rv={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},iv={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},xc=1604,nv=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function av(t,e,r){let i=0;for(let n of t.split(";")){let[a,s]=n.split(",").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l{let r=e.codePointAt(0);return{codePoint:r,type:sv(r),form:null}})}function cv(t){let e=t.filter(r=>r.type!=="T");for(let r=0;r0&&ov(e[r-1].type),a=r+1String.fromCodePoint(dv(r))).join("")}function mv(t,e,r){var n;let i=e.layout.get("text-transform").evaluate(r,{});return i==="uppercase"?t=t.toLocaleUpperCase():i==="lowercase"&&(t=t.toLocaleLowerCase()),((n=wr.applyArabicShaping)!=null?n:yv)(t)}function gv(t,e,r){for(let i of t.sections)i.text=mv(i.text,e,r);return t}function xv(t){let e={},r={},i=[],n=0;function a(u){i.push(t[u]),n++}function s(u,h,c){let p=r[u];return delete r[u],r[h]=p,i[p].geometry[0].pop(),i[p].geometry[0]=i[p].geometry[0].concat(c[0]),p}function o(u,h,c){let p=e[h];return delete e[h],e[u]=p,i[p].geometry[0].shift(),i[p].geometry[0]=c[0].concat(i[p].geometry[0]),p}function l(u,h,c){let p=c?h[0][h[0].length-1]:h[0][0];return`${u}:${p.x}:${p.y}`}for(let u=0;uu.geometry)}var Bd=typeof Intl<"u"&&"Segmenter"in Intl,ta,ea;function tl(t){if(!Bd||!Q2(t))return[...t];ta!=null||(ta=new Intl.Segmenter(void 0,{granularity:"grapheme"}));let e=[];for(let{segment:r}of ta.segment(t)){let i=e.length-1;i>=0&&tv(e[i],r)?e[i]+=r:e.push(r)}return e}function vv(t){let e=new Set;if(Bd){ea!=null||(ea=new Intl.Segmenter(void 0,{granularity:"word"}));for(let{index:i}of ea.segment(t))e.add(i);return e}let r=0;for(let i of t.split(new RegExp("\\\\b|(?=\\\\p{Ideo})","u")))e.add(r),r+=i.length;return e}function Pd(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function ru(t){return/\\s/u.test(String.fromCodePoint(t))}function el(t){for(let e of t)if(Qa(e.codePointAt(0)))return!0;return!1}function bv(t){for(let e of t)if(!wv(e.codePointAt(0)))return!1;return!0}function wv(t){return!Z2(t)}function vc(t){return!(Qa(t)||J2(t))}function zd(t){return new RegExp("\\\\p{sc=Arab}","u").test(String.fromCodePoint(t))}function Ld(t){return H2(t)}function Vd(t){for(let e of t)if(Ld(e.codePointAt(0)))return!0;return!1}var Gr={"!":"\\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","\\u22EF":"\\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"};function Dv(t){let e="",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!vc(s.value.codePointAt(0))||Gr[s.value])&&(r.premature||!vc(r.value.codePointAt(0))||Gr[r.value])&&Gr[n.value]?e+=Gr[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var _v={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Av={40:!0};function bc(t,e,r,i,n,a){if("fontStack"in e){let s=r[e.fontStack],o=s==null?void 0:s[t];if(o)return o.metrics.advance*e.scale+n;let l=0;for(let u of t){let h=s==null?void 0:s[u];h&&(l+=h.metrics.advance*e.scale+n)}return l}{let s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}}function wc(t,e,r,i){let n=(t-e)**2;return i?tr&&Dc(e[i-1]);)i--;this.text=e.slice(r,i).join(""),this.sectionIndex=this.sectionIndex.slice(r,i),this._graphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(""),n=this.sectionIndex.slice(e,r);return new rl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n0?i[i.length-1]:"",a=tl(n+e);this.text+=e,this._graphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=[],o=this.determineAverageLineWidth(e,r,i,n,a),l=this.hasZeroWidthSpaces(),u=this.graphemes(),h=null,c=0,p=0;for(let f=0;f0){let y=u[f-1].codePointAt(0),m=d.codePointAt(0),g=K2(y),x=gc(y)&&gc(m);(_v[y]||g||"imageName"in this.getSection(f-1)||u[f+1]!==void 0&&Av[m]||x&&(h!=null?h:h=vv(this.text)).has(p))&&s.push(_c(f,c,o,s,Sv(y,m,g&&l),!1))}ru(d.codePointAt(0))||(c+=bc(d,this.getSection(f),i,n,e,a)),p+=d.length}return Od(_c(this.length(),c,o,s,0,!0))}determineAverageLineWidth(e,r,i,n,a){let s=0,o=0;for(let u of this.graphemes()){let h=this.getSection(o);s+=bc(u,h,i,n,e,a),o++}let l=Math.max(1,Math.ceil(s/r));return s/l}};function Ev(){return(function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},i={};r.L=1,i[1]="L",Object.keys(e).forEach(function(R,J){r[R]=1<1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function d(R,J){var W=0,M=new Map,ut=J&&new Map,X;return R.split(",").forEach(function G(K){if(K.indexOf("+")!==-1)for(var Nt=+K;Nt--;)G(X);else{X=K;var vt=K.split(">"),nt=vt[0],Tt=vt[1];nt=String.fromCodePoint(W+=parseInt(nt,36)),Tt=String.fromCodePoint(W+=parseInt(Tt,36)),M.set(nt,Tt),J&&ut.set(Tt,nt)}}),{map:M,reverseMap:ut}}var y,m,g;function x(){if(!y){var R=d(f.pairs,!0),J=R.map,W=R.reverseMap;y=J,m=W,g=d(f.canonical,!1).map}}function v(R){return x(),y.get(R)||null}function b(R){return x(),m.get(R)||null}function D(R){return x(),g.get(R)||null}var A=r.L,_=r.R,S=r.EN,k=r.ES,z=r.ET,O=r.AN,P=r.CS,L=r.B,F=r.S,$=r.ON,U=r.BN,T=r.NSM,q=r.AL,at=r.LRO,ot=r.RLO,pt=r.LRE,Et=r.RLE,qt=r.PDF,Ht=r.LRI,Ve=r.RLI,ye=r.FSI,Kt=r.PDI;function Oe(R,J){for(var W=125,M=new Uint32Array(R.length),ut=0;ut0)Fe--;else if(rs>0){for(Ne=0;!lt[lt.length-1]._isolate;)lt.pop();var is=lt[lt.length-1]._isolInitIndex;is!=null&&(Nt.set(is,zt),Nt.set(zt,is)),lt.pop(),rs--}bt=lt[lt.length-1],K[zt]=bt._level,bt._override&&G(zt,bt._override)}else Lt&qt?(Fe===0&&(Ne>0?Ne--:!bt._isolate&<.length>1&&(lt.pop(),bt=lt[lt.length-1])),K[zt]=bt._level):Lt&L&&(K[zt]=nt.level);else K[zt]=bt._level,bt._override&&Lt!==U&&G(zt,bt._override)}for(var Cr=[],me=null,ar=nt.start;ar<=nt.end;ar++){var ns=M[ar];if(!(ns&o)){var Bu=K[ar],Pu=ns&n,Wy=ns===Kt;me&&Bu===me._level?(me._end=ar,me._endsWithIsolInit=Pu):Cr.push(me={_start:ar,_end:ar,_level:Bu,_startsWithPDI:Wy,_endsWithIsolInit:Pu})}}for(var as=[],Sn=0;Sn=0;kn--)if(!(M[kn]&o)){Vu=K[kn];break}var us=Mr[Mr.length-1],Hy=K[us],Ou=nt.level;if(!(M[us]&n)){for(var Tn=us+1;Tn<=nt.end;Tn++)if(!(M[Tn]&o)){Ou=K[Tn];break}}as.push({_seqIndices:Mr,_sosType:Math.max(Vu,Zy)%2?_:A,_eosType:Math.max(Ou,Hy)%2?_:A})}}for(var hs=0;hs=0;Cn--)if(!(M[j[Cn]]&o)){ps=M[j[Cn]];break}G(Ru,ps&(n|Kt)?$:ps)}}if(X.get(S))for(var Mn=0;Mn=-1;Bn--){var Nu=Bn===-1?yi:M[j[Bn]];if(Nu&a){Nu===q&&G($u,O);break}}}if(X.get(q))for(var fs=0;fs=0&&(Pr=M[j[ms]],Pr&o);ms--);for(var gs=mi+1;gs=0&&M[j[Pn]]&(z|o);Pn--)G(j[Pn],S);for(ge++;ge=0&&M[j[zn]]&o;zn--)G(j[zn],$);for(var Ln=gi+1;Ln=0;bi--){var bs=zr[bi].char;if(bs===Yu||bs===b(D(vi))||v(D(bs))===vi){Vn.push([zr[bi].seqIndex,Lr]),zr.length=bi;break}}}Vn.sort(function(Yt,ue){return Yt[0]-ue[0]});for(var ws=0;ws=0;As--){var Ju=j[As];if(M[Ju]&Xu){var Qu=M[Ju]&xi?_:A;xe=Qu===Br?Br:Qu;break}}}if(xe){if(M[j[On]]=M[j[Ds]]=xe,xe!==Br){for(var wi=On+1;wi=0;_i--)if(M[j[_i]]&o)th=_i;else{Es=M[j[_i]]&xi?_:A;break}for(var eh=Ky,Ai=Ue+1;Ai=0&&c(R[$n])&l;$n--)K[$n]=nt.level}}return{levels:K,paragraphs:vt};function rh(Yt,ue){for(var Wt=Yt;Wt=K&&c(R[nt])&l;nt--)vt[nt]=G.level;for(var Tt=G.level,di=1/0,nr=0;nrTt&&(Tt=Re),Re=di;$e--)for(var lt=0;lt=$e){for(var bt=lt;lt+1=$e;)lt++;lt>bt&&X.push([bt+K,lt+K])}}}),X}function Tr(R,J,W,M){var ut=Ir(R,J,W,M),X=[].concat(R);return ut.forEach(function(G,K){X[K]=(J.levels[G]&1?kt(R[G]):null)||R[G]}),X.join("")}function Ir(R,J,W,M){for(var ut=ir(R,J,W,M),X=[],G=0;G=0;i--){let n=nu.getBidiCharTypeName(t[i].text[0]);Tv.has(n)?(t[i].level=e,r=!0):r&&kv.has(n)?t[i].level=e:r=!1}}function Mv(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)=i;a--)for(let s=0;s=a;)o++;for(let l=s,u=o;le>=n.start&&e<=n.end))==null?void 0:r.level)!=null?i:0}function zv(t,e,r,i,n){let a=Iv(t,e,i,n);Cv(a,r);let s="",o=[];for(let l of Mv(a,r)){if(Fv.test(l.text))continue;let u=Bv(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function Lv(t,e){let r=e.filter(a=>a>0&&aa-s),n=[];for(let a=0;a+1n.start))).map(([n,a])=>zv(t,r,Pv(i,n),n,a))}function Vv(t,e){return Rd(t,e).map(r=>r.text)}function Ov(t,e,r){return Rd(t,r).map(i=>[i.text,i.sourceIndices.map(n=>{var a;return(a=e[n])!=null?a:0})])}var il=4294967296,Ac=1/il,Sc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),au=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*il;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*il;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,$v(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Sc?Sc.decode(this.buf.subarray(e,t)):tb(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd();for(;this.pos=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},Rv=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e=0&&t<128){this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t;return}if(t>268435455||t<0){Uv(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=eb(this.buf,t,this.pos);let r=this.pos-e;r>=128&&Ec(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&Ec(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,Gv,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,Xv,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,Zv,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,Yv,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,Wv,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,Hv,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Kv,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,Jv,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,Qv,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function $v(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return Nv(t,n,e);throw Error("Expected varint not more than 10 bytes")}function Nv(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Uv(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),qv(r,i,e),jv(i,e)}function qv(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function jv(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Ec(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function Gv(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;sa){e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;continue}for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}e.pos=n}function Xv(t,e){for(let r=0;r239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function eb(t,e,r){for(let i=0,n,a;i55295&&n<57344)if(a){if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}else a&&(a=(t[r++]=239,t[r++]=191,t[r++]=189,null));n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=n&63|128)}return r}function rb(t){return typeof(t==null?void 0:t.renderWithWebGL)=="function"}function su(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o=r;a--)e.push(a);r=i+1}else{for(let a=r;at.toCodeUnitIndex(a)),i=wr.isParsed()?wr:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>kc(a,t.sections,[...a].map(()=>0))):Vv(t.toString(),r).map(a=>nl([...a],t.sections,[...a].map(()=>0)));let n=sb(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>kc(a,t.sections,s)):Ov(t.text,n,r).map(([a,s])=>{let o=[...a];return nl(o,t.sections,Ud(o).map(l=>{var u;return(u=s[l])!=null?u:0}))})}function nl(t,e,r){var a;let i=new iu(t.join(""),e,[]),n=0;for(let s of i.graphemes())i.sectionIndex.push((a=r[n])!=null?a:0),n+=[...s].length;return i}function Ud(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function kc(t,e,r){let i=[...t],n=Ud(i),a=ab(i);return nl(a.map(s=>i[s]),e,a.map(s=>{var o;return(o=r[n[s]])!=null?o:0}))}function ra(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=iu.fromFeature(t,n);c===2&&y.verticalizePunctuation();let m=y.determineLineBreaks(u,a,e,i,f),g=Vd(y.text)?ob(y,m):nb(y,m),x=[],v={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return mb(v,e,r,i,g,s,o,l,c,u,p,d),!ib(x)&&v}function qd(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function lb(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function jd(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}function ub(t,e,r,i){var a;if(t!=null&&t.rect)return t;let n=(a=e[r.fontStack])==null?void 0:a[i];return n?{rect:null,metrics:n.metrics}:null}function hb(t,e,r){return!(t===1||!e&&!Qa(r)||e&&(ru(r)||zd(r)))}function da(t){return new RegExp("\\\\p{Nd}","u").test(String.fromCodePoint(t))}function Gd(t){return new RegExp("\\\\p{Lu}","u").test(String.fromCodePoint(t))}function cb(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function pb(t){let e=t.some(da)&&t.every(i=>da(i)||cb(i)),r=t.length<=3&&t.every(i=>Gd(i)||da(i));return e||r}function fb(t){return(da(t)||Gd(t))&&!zd(t)}function db(t,e){let r=!1;for(let i=0;ia.codePointAt(0)),i=r.map(Qa),n=a=>!i[a]&&!ru(r[a])&&!("imageName"in t.getSection(a));for(let a=0;au){let p=Math.ceil(i/u);r*=p/n,n=p}return{x1:e,y1:r,x2:e+i,y2:r+n}}function Tc(t,e,r,i,n,a){let s=t.image,o;if(s.content){let m=s.content,g=s.pixelRatio||1;o=[m[0]/g,m[1]/g,s.displaySize[0]-m[2]/g,s.displaySize[1]-m[3]/g]}let l=e.left*a,u=e.right*a,h,c,p,f;r==="width"||r==="both"?(f=n[0]+l-i[3],c=n[0]+u+i[1]):(f=n[0]+(l+u-s.displaySize[0])/2,c=f+s.displaySize[0]);let d=e.top*a,y=e.bottom*a;return r==="height"||r==="both"?(h=n[1]+d-i[0],p=n[1]+y+i[2]):(h=n[1]+(d+y-s.displaySize[1])/2,p=h+s.displaySize[1]),{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}var Ic=32640;function Cc(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new st(t+1))};if(r.kind==="source")return{kind:"source"};if(r.kind==="composite"){let{minZoom:i,maxZoom:n}=Db(r.zoomStops,t);return{kind:"composite",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=_b(r),n=r.evaluate(new st(t+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function Db(t,e){let r=0;for(;rt.evaluate(new st(e===-1/0?t.zoomStops[1]-1:e)))}var Jr=class Yd extends B{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new Yd(this.x,this.y,this.angle,this.segment)}};C("Anchor",Jr);function Wd(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;oi;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=c.dist(p)}return!0}function Zd(t){let e=0;for(let r=0;ru){let d=(u-l)/f,y=new Jr(gr.number(c.x,p.x,d),gr.number(c.y,p.y,d),p.angleTo(c),h);return y._round(),!s||Wd(t,y,o,s,e)?y:void 0}l+=f}}function Sb(t,e,r,i,n,a,s,o,l){let u=Hd(i,a,s),h=Kd(i,n),c=h*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-c=0&&b=0&&D=0&&p+u<=h){let A=new Jr(b,D,x,d);A._round(),(!i||Wd(t,A,a,i,n))&&f.push(A)}}c+=g}return!o&&!f.length&&!s&&(f=Jd(t,c/2,r,i,n,a,s,!0,l)),f}function Eb(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l=i&&h.x>=i)&&(u.x>=i?u=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round():h.x>=i&&(h=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round()),!(u.y>=n&&h.y>=n)&&(u.y>=n?u=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y>=n&&(h=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),(!o||!u.equals(o[o.length-1]))&&(o=[u],a.push(o)),o.push(h)))))}}return a}function Qd(t,e,r,i,n,a){let s=Mc(t,e,r,n,0);return s=Mc(s,e,i,a,1),s}function Mc(t,e,r,i,n){switch(e){case 1:return Fb(t,r,i,n);case 2:return Bc(t,r,i,n,!1);case 3:return Bc(t,r,i,n,!0)}return[]}function Fb(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function kb(t,e,r,i,n){let a=i===0?Tb:Ib,s=[],o=[];for(let h=0;he&&s.push(a(c,p,e)):f>r?d=e&&(s.push(a(c,p,e)),y=!0),d>r&&f<=r&&(s.push(a(c,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new B(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function Bc(t,e,r,i,n){let a=[];for(let s of t){let o=kb(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function Tb(t,e,r){let i=(r-t.x)/(e.x-t.x);return new B(r,t.y+(e.y-t.y)*i)}function Ib(t,e,r){let i=(r-t.y)/(e.y-t.y);return new B(t.x+(e.x-t.x)*i,r)}function Pc(t,e,r,i){let n=[],a=t.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(F,$)=>F+$[1]-$[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,v=0,b=d,D=0,A=y,_=0,S=m;if(a.content&&i){let F=a.content,$=F[2]-F[0],U=F[3]-F[1];(a.textFitWidth||a.textFitHeight)&&(u=Xd(t)),g=ia(h,0,F[0]),v=ia(c,0,F[1]),x=ia(h,F[0],F[2]),b=ia(c,F[1],F[3]),D=F[0]-g,_=F[1]-v,A=$-x,S=U-b}let k=u.x1,z=u.y1,O=u.x2-k,P=u.y2-z,L=(F,$,U,T)=>{let q=na(F.stretch-g,x,O,k),at=aa(F.fixed-D,A,F.stretch,f),ot=na($.stretch-v,b,P,z),pt=aa($.fixed-_,S,$.stretch,d),Et=na(U.stretch-g,x,O,k),qt=aa(U.fixed-D,A,U.stretch,f),Ht=na(T.stretch-v,b,P,z),Ve=aa(T.fixed-_,S,T.stretch,d),ye=new B(q,ot),Kt=new B(Et,ot),Oe=new B(Et,Ht),kr=new B(q,Ht),rr=new B(at/s,pt/s),fi=new B(qt/s,Ve/s),kt=e*Math.PI/180;if(kt){let R=Math.sin(kt),J=Math.cos(kt),W=[J,-R,R,J];ye._matMult(W),Kt._matMult(W),kr._matMult(W),Oe._matMult(W)}let Ee=F.stretch+F.fixed,ir=U.stretch+U.fixed,Tr=$.stretch+$.fixed,Ir=T.stretch+T.fixed;return{tl:ye,tr:Kt,bl:kr,br:Oe,tex:{x:a.paddedRect.x+1+Ee,y:a.paddedRect.y+1+Tr,w:ir-Ee,h:Ir-Tr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:rr,pixelOffsetBR:fi,minFontScaleX:A/s/O,minFontScaleY:S/s/P,isSDF:r}};if(!i||!a.stretchX&&!a.stretchY)n.push(L({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));else{let F=zc(h,y,f),$=zc(c,m,d);for(let U=0;U0&&(d=Math.max(10,d),this.circleDiameter=d)}else{let c=(h=a.image)!=null&&h.content&&(a.image.textFitWidth||a.image.textFitHeight)?Xd(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-o[0],c.y2=c.y2*s+o[2],c.x1=c.x1*s-o[3],c.x2=c.x2*s+o[1];let p=a.collisionPadding;if(p&&(c.x1-=p[0]*s,c.y1-=p[1]*s,c.x2+=p[2]*s,c.y2+=p[3]*s),u){let f=new B(c.x1,c.y1),d=new B(c.x2,c.y1),y=new B(c.x1,c.y2),m=new B(c.x2,c.y2),g=u*Math.PI/180;f._rotate(g),d._rotate(g),y._rotate(g),m._rotate(g),c.x1=Math.min(f.x,d.x,y.x,m.x),c.x2=Math.max(f.x,d.x,y.x,m.x),c.y1=Math.min(f.y,d.y,y.y,m.y),c.y2=Math.max(f.y,d.y,y.y,m.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,i,n)}this.boxEndIndex=t.length}},Mb=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}};function Bb(t,e=1){let r=Fa.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new Mb([],Pb),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new B(s,o);for(let p=s;pc.d||!c.d)&&(c=p),!(p.max-c.d<=e)&&(n=p.h/2,a.push(new qr(p.p.x-n,p.p.y-n,n,t)),a.push(new qr(p.p.x+n,p.p.y-n,n,t)),a.push(new qr(p.p.x-n,p.p.y+n,n,t)),a.push(new qr(p.p.x+n,p.p.y+n,n,t)))}return h.d>0&&c.d-h.d<=e?h.p:c.p}function Pb(t,e){return e.max-t.max}var qr=class{constructor(t,e,r,i){this.p=new B(t,e),this.h=r,this.d=zb(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function zb(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;at.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,td(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function Lb(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;ap*24);h.startsWith("top")?c[1]-=7:h.startsWith("bottom")&&(c[1]+=7),l[u+1]=c}return new De(l)}let a=i.get("text-variable-anchor");if(a){let o;o=t._unevaluatedLayout.getValue("text-radial-offset")===void 0?i.get("text-offset").evaluate(e,{},r).map(u=>u*24):[i.get("text-radial-offset").evaluate(e,{},r)*24,lu];let l=[];for(let u of a)l.push(u,ty(u,o));return new De(l)}return null}function Ob(t){var h,c;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=mt/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new st(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new st(p),t.canonical),n["text-size"].possiblyEvaluate(new st(f),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new st(p),t.canonical),n["icon-size"].possiblyEvaluate(new st(f),t.canonical)]}let s=i.get("text-line-height")*24,o=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",l=i.get("text-keep-upright"),u=i.get("text-size");for(let p of t.bucket.features){let f=i.get("text-font").evaluate(p,{},t.canonical).join(","),d=u.evaluate(p,{},t.canonical),y=a.layoutTextSize.evaluate(p,{},t.canonical),m=a.layoutIconSize.evaluate(p,{},t.canonical),g={horizontal:{},vertical:void 0},x=p.text,v=[0,0];if(x){let _=x.toString(),S=i.get("text-letter-spacing").evaluate(p,{},t.canonical)*24,k=bv(_)?S:0,z=i.get("text-anchor").evaluate(p,{},t.canonical),O=ey(r,p,t.canonical);if(!O){let $=i.get("text-radial-offset").evaluate(p,{},t.canonical);v=$?ty(z,[$*24,lu]):i.get("text-offset").evaluate(p,{},t.canonical).map(U=>U*24)}let P=o?"center":i.get("text-justify").evaluate(p,{},t.canonical),L=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(p,{},t.canonical)*24:1/0,F=()=>{t.bucket.allowVerticalPlacement&&el(_)&&(g.vertical=ra(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,L,s,z,"left",k,v,2,!0,y,d))};if(!o&&O){let $=new Set;if(P==="auto")for(let T=0;T{T.x<0||T.x>=8192||T.y<0||T.y>=8192||Nb(t,T,U,r,i,n,L,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,[D,D,D,D],S,l,v,A,k,d,e,a,u,h,s)};if(z==="line")for(let U of Eb(e.geometry,0,0,mt,mt)){let T=cr(U,F),q=Sb(T,b,_,r.vertical||y,i,24,x,t.overscaling,mt);for(let at of q){let ot=y;(!ot||!Ub(t,ot.text,O,at))&&$(T,at)}}else if(z==="line-center"){for(let U of e.geometry)if(U.length>1){let T=cr(U,F),q=Ab(T,_,r.vertical||y,i,24,x);q&&$(T,q)}}else if(e.type==="Polygon")for(let U of Ra(e.geometry,0)){let T=Bb(U,16);$(cr(U[0],F,!0),new Jr(T.x,T.y,0))}else if(e.type==="LineString")for(let U of e.geometry){let T=cr(U,F);$(T,new Jr(T[0].x,T[0].y,0))}else if(e.type==="Point")for(let U of e.geometry)for(let T of U)$([T],new Jr(T.x,T.y,0))}function $b(t,e){let r=t.length,i=e==null?void 0:e.values;if((i==null?void 0:i.length)>0)for(let n=0;n32640&&Bt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):g.kind==="composite"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Bt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,m,x,o,a,s,h,e,u.lineStartIndex,u.lineLength,f,y,l);for(let v of c)p[v]=t.text.placedSymbolArray.length-1;return m.length*4}function ry(t){for(let e in t)return t[e];return null}function Nb(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S){let k=t.addToLineVertexArray(e,r),z=o.layout.get("symbol-height-offset").evaluate(b,{},_);z>t.maxHeightOffset&&(t.maxHeightOffset=z);let O,P,L,F,$=0,U=0,T=0,q=0,at=-1,ot=-1,pt={},Et=(0,Mo.default)("");if(t.allowVerticalPlacement&&i.vertical){let J=o.layout.get("text-rotate").evaluate(b,{},_)+90,W=i.vertical;L=new sa(l,e,u,h,c,W,p,f,d,J),s&&(F=new sa(l,e,u,h,c,s,m,g,d,J))}if(n){let J=o.layout.get("icon-rotate").evaluate(b,{}),W=o.layout.get("icon-text-fit")!=="none",M=Pc(n,J,A,W),ut=s?Pc(s,J,A,W):void 0;P=new sa(l,e,u,h,c,n,m,g,!1,J),$=M.length*4;let X=t.iconSizeData,G=null;X.kind==="source"?(G=[128*o.layout.get("icon-size").evaluate(b,{})],G[0]>32640&&Bt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):X.kind==="composite"&&(G=[128*D.compositeIconSizes[0].evaluate(b,{},_),128*D.compositeIconSizes[1].evaluate(b,{},_)],(G[0]>32640||G[1]>32640)&&Bt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,M,G,v,x,b,0,e,k.lineStartIndex,k.lineLength,-1,_,z),at=t.icon.placedSymbolArray.length-1,ut&&(U=ut.length*4,t.addSymbols(t.icon,ut,G,v,x,b,2,e,k.lineStartIndex,k.lineLength,-1,_,z),ot=t.icon.placedSymbolArray.length-1)}let qt=Object.keys(i.horizontal);for(let J of qt){let W=i.horizontal[J];O||(O=(Et=(0,Mo.default)(W.text),new sa(l,e,u,h,c,W,p,f,d,o.layout.get("text-rotate").evaluate(b,{},_))));let M=W.positionedLines.length===1;if(T+=Vc(t,e,W,a,o,d,b,y,z,k,i.vertical?1:3,M?qt:[J],pt,at,D,_),M)break}i.vertical&&(q+=Vc(t,e,i.vertical,a,o,d,b,y,z,k,2,["vertical"],pt,ot,D,_));let Ht=O?O.boxStartIndex:t.collisionBoxArray.length,Ve=O?O.boxEndIndex:t.collisionBoxArray.length,ye=L?L.boxStartIndex:t.collisionBoxArray.length,Kt=L?L.boxEndIndex:t.collisionBoxArray.length,Oe=P?P.boxStartIndex:t.collisionBoxArray.length,kr=P?P.boxEndIndex:t.collisionBoxArray.length,rr=F?F.boxStartIndex:t.collisionBoxArray.length,fi=F?F.boxEndIndex:t.collisionBoxArray.length,kt=-1,Ee=(J,W)=>J!=null&&J.circleDiameter?Math.max(J.circleDiameter,W):W;kt=Ee(O,kt),kt=Ee(L,kt),kt=Ee(P,kt),kt=Ee(F,kt);let ir=+(kt>-1);ir&&(kt*=S/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Bt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let Tr=ey(o,b,_),[Ir,R]=$b(t.textAnchorOffsets,Tr);t.symbolInstances.emplaceBack(e.x,e.y,pt.right>=0?pt.right:-1,pt.center>=0?pt.center:-1,pt.left>=0?pt.left:-1,pt.vertical||-1,at,ot,Et,Ht,Ve,ye,Kt,Oe,kr,rr,fi,u,T,q,$,U,ir,0,p,kt,Ir,R,z)}function Ub(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Cc(this.zoom,e["text-size"]),this.iconSizeData=Cc(this.zoom,e["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap=Oc(r,"text-overlap","text-allow-overlap")!=="never"||Oc(r,"icon-overlap","icon-allow-overlap")!=="never"||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=n!=="viewport-y"&&!i.isConstant();let a=n==="viewport-y"||n==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(s=>Nd[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new al(new vr(this.layers,this.zoom,t=>t.startsWith("text"))),this.icon=new al(new vr(this.layers,this.zoom,t=>t.startsWith("icon"))),this.glyphOffsetArray=new Uf,this.lineVertexArray=new qf,this.symbolInstances=new Nf,this.textAnchorOffsets=new Gf}calculateGlyphDependencies(t,e,r,i,n){var l;let a=(i||this.allowVerticalPlacement)&&n,s=iu.fromFeature(t,r),o=s.graphemes();for(let u=0;u0)&&(a.value.kind!=="constant"||a.value.value.length>0),u=o.value.kind!=="constant"||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let c=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new st(this.zoom);for(let{feature:m,id:g,index:x,sourceLayerIndex:v}of t){let b=i._featureFilter.needGeometry,D=hi(m,b);if(!i._featureFilter.filter(d,D,r))continue;b||(D.geometry=Ar(m));let A;if(l){let z=i.getValueAndResolveTokens("text-field",D,r,f),O=ze.factory(z);this.hasRTLText||(this.hasRTLText=Gb(O)),A=gv(O,i,D)}let _;if(u){let z=i.getValueAndResolveTokens("icon-image",D,r,f);_=z instanceof _e?z:_e.fromString(z)}if(!A&&!_)continue;let S=this.sortFeaturesByKey?h.evaluate(D,{},r):void 0,k={id:g,text:A,icon:_,index:x,sourceLayerIndex:v,geometry:D.geometry,properties:m.properties,type:Dn.types[m.type],sortKey:S};if(this.features.push(k),_&&(c[_.name]=!0),A){let z=a.evaluate(D,{},r).join(","),O=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point";this.allowVerticalPlacement=(y=this.writingModes)==null?void 0:y.includes(2);let P=el(A.toString());this.calculateGlyphDependencies(A,p,z,O,P);for(let L of A.sections)L.image&&(c[L.image.name]=!0)}}n.get("symbol-placement")==="line"&&(this.features=xv(this.features)),this.sortFeaturesByKey&&this.features.sort((m,g)=>m.sortKey-g.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){Ob({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;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}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;ni[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];(r==null?void 0:r.sortKey)===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};C("SymbolBucket",iy,{omit:["layers","collisionBoxArray","features","compareText"]});function Xb(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):"")}var Yb,Wb=()=>Yb||(Yb=new Xt({"symbol-placement":new V(w.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new V(w.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new V(w.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new N(w.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new V(w.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new V(w.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new V(w.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new V(w.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new V(w.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new N(w.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new N(w.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new V(w.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new V(w.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new N(w.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new N(w.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new N(w.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new V(w.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new N(w.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new N(w.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new V(w.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new V(w.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new V(w.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new N(w.layout_symbol["text-field"],"text-field"),"text-font":new N(w.layout_symbol["text-font"],"text-font"),"text-size":new N(w.layout_symbol["text-size"],"text-size"),"text-max-width":new N(w.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new V(w.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new N(w.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new N(w.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new N(w.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new V(w.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new N(w.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new N(w.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new V(w.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new V(w.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new N(w.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new V(w.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new V(w.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new N(w.layout_symbol["text-transform"],"text-transform"),"text-offset":new N(w.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new V(w.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new V(w.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new V(w.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new V(w.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new N(w.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new V(w.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})),Zb,Hb=()=>Zb||(Zb=new Xt({"icon-opacity":new N(w.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new N(w.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new N(w.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new N(w.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new N(w.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new V(w.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new V(w.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new N(w.paint_symbol["text-opacity"],"text-opacity"),"text-color":new N(w.paint_symbol["text-color"],"text-color",{runtimeType:ce,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new N(w.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new N(w.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new N(w.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new V(w.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new V(w.paint_symbol["text-translate-anchor"],"text-translate-anchor")})),Ys={get paint(){return Hb()},get layout(){return Wb()}},ny=class{constructor(t){if(t.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:dn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e!=null&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};C("FormatSectionOverride",ny,{omit:["defaultValue"]});var Kb=class ol extends de{constructor(e,r){super(e,Ys,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new se(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!ja(s.value)&&a?Xb(r.properties,a):a}createBucket(e){return new iy(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Ys.paint.overridableProperties){if(!ol.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Il(new ny(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind==="constant"||r.value.kind==="source"?new an("source",i):new wa("composite",i,r.value.zoomStops),this.paint._values[e]=new se(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:ol.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get("text-field"),n=Ys.paint.properties[r],a=!1,s=o=>{var l;for(let u of o)if((l=n.overrides)!=null&&l.hasOverride(u)){a=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof ze)s(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let o=u=>{if(!a)if(u instanceof ri&&_t(u.value)===yn){let h=u.value;s(h.sections)}else u instanceof Ep?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function Jb(t,e,r,i=1){var a;let n=(a=t.get("icon-padding").evaluate(e,{},r))==null?void 0:a.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var Qb,tw=()=>Qb||(Qb=new Xt({"background-color":new V(w.paint_background["background-color"],"background-color"),"background-pattern":new Lf(w.paint_background["background-pattern"],"background-pattern"),"background-opacity":new V(w.paint_background["background-opacity"],"background-opacity")})),ew={get paint(){return tw()}};var rw=class extends de{constructor(t,e){super(t,ew,e)}};var iw=class extends de{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function ay(t,e){if(t.type==="custom")return new iw(t,e);switch(t.type){case"background":return new rw(t,e);case"circle":return new Bg(t,e);case"color-relief":return new Yg(t,e);case"fill":return new Ex(t,e);case"fill-extrusion":return new Hx(t,e);case"heatmap":return new Rg(t,e);case"hillshade":return new qg(t,e);case"line":return new G2(t,e);case"raster":return new Xm(t,e);case"symbol":return new Kb(t,e)}}var nw=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var t;this._triggered||(this._triggered=!0,(t=this._channel)==null||t.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},aw={once:!0},sy=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new nw(()=>this.process()),this.subscription=hh(this.target,"message",r=>this.receive(r),!1),this.globalScope=mr(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?hh(e.signal,"abort",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:"",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new dl(e.signal.reason))},aw):null;this.resolveRejects[n]={resolve:l=>{a==null||a.unsubscribe(),r(l)},reject:l=>{a==null||a.unsubscribe(),i(l)}};let s=[],o=Si(je({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:Yi(t.data,s)});this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=["file://","resource://android","null"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===""){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort();return}if(mr(self)||e.mustQueue){this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,e){return rt(this,null,function*(){if(e.type===""){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(Ki(Wi(e.error))):n.resolve(Wi(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=Wi(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=yield this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,Ki(n))}})}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?Yi(e):null,data:Yi(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function sw(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var oy=class{constructor(t,e,r){if(!sw(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=Hi(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){let i=lw(this.x,this.y,this.z),n=uw(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,i)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new B((t.x*e-this.x)*mt,(t.y*e-this.y)*mt)}toString(){return`${this.z}/${this.x}/${this.y}`}},ow=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Hi(t,e.z,e.z,e.x,e.y)}},uu=class ne{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new oy(i,+n,+a),this.key=Hi(r,e,i,n,a)}clone(){return new ne(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new ne(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ne(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?Hi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Hi(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ne(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new ne(r,this.wrap,r,i,n),new ne(r,this.wrap,r,i+1,n),new ne(r,this.wrap,r,i,n+1),new ne(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrape.wrap?!1:this.overscaledZe.overscaledZ?!1:this.canonical.xe.canonical.x?!1:this.canonical.y=0&&e=0&&r=u)return null;let c=this.canonical.x+n,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new ne(this.overscaledZ,p,l,c,h),x:s,y:o}}};function Hi(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<0;n--){let a=1<pw(n,a,r),t.layers[i])}function pw(t,e,r=""){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s>31}function yw(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(Zs(1,o));let l=i===3?s.length-1:s.length;for(let u=0;u=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can\'t be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},gw=class{constructor(t,e,r,i,n){this.type="Feature",this._vectorTileFeature=t,this._x=r,this._y=i,this._z=e;for(let a in t.properties)typeof t.properties[a]=="string"&&t.properties[a].startsWith("__$json__:")&&(t.properties[a]=JSON.parse(t.properties[a].slice(10)));this.properties=t.properties,this.id=n}projectPoint(t,e,r,i){return[(t.x+e)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+r)*2/i)*Math.PI))-90]}projectLine(t,e,r,i){return t.map(n=>this.projectPoint(n,e,r,i))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,e=t.extent*2**this._z,r=t.extent*this._x,i=t.extent*this._y,n=t.loadGeometry();switch(t.type){case 1:{let a=[];for(let o of n)a.push(o[0]);let s=this.projectLine(a,r,i,e);this._geometry=a.length===1?{type:"Point",coordinates:s[0]}:{type:"MultiPoint",coordinates:s};break}case 2:{let a=n.map(s=>this.projectLine(s,r,i,e));this._geometry=a.length===1?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a};break}case 3:{let a=dd(n),s=[];for(let o of a)s.push(o.map(l=>this.projectLine(l,r,i,e)));this._geometry=s.length===1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)e!=="_geometry"&&e!=="_vectorTileFeature"&&e!=="_x"&&e!=="_y"&&e!=="_z"&&(t[e]=this[e]);return t}},Sr=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r=="number"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){var e;return((e=this.nullabilityBuffer)==null?void 0:e.get(t))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},ts=class extends Sr{},pu=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},fu=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},uy=class extends Sr{constructor(t,e,r,i){super(t,e,i),this.delta=r}},du=class extends uy{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},yu=class extends Sr{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},xw=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var t;return(t=this._propertyVectors)!=null?t:[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r>>32-t;var ul=mu,py=65536;function gu(t,e){return t-t%e}function vw(t){return gu(t+31,32)}function bw(t){if(!Number.isFinite(t)||t<=0)return py;let e=gu(Math.floor(t),256);return e===0?256:e}function ww(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function Dw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function _w(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function Aw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function Sw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function Ew(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(h&3)<<4)&63,r[n++]=h>>>2&63,r[n++]=h>>>8&63,r[n++]=h>>>14&63,r[n++]=h>>>20&63,r[n]=h>>>26&63}function Fw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(h&1)<<6)&127,r[n++]=h>>>1&127,r[n++]=h>>>8&127,r[n++]=h>>>15&127,r[n++]=h>>>22&127,r[n++]=(h>>>29|(c&15)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n]=c>>>25&127}function kw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function Tw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(h&3)<<7)&511,r[n++]=h>>>2&511,r[n++]=h>>>11&511,r[n++]=h>>>20&511,r[n++]=(h>>>29|(c&63)<<3)&511,r[n++]=c>>>6&511,r[n++]=c>>>15&511,r[n++]=(c>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function Iw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=h>>>0&1023,r[n++]=h>>>10&1023,r[n++]=h>>>20&1023,r[n++]=(h>>>30|(c&255)<<2)&1023,r[n++]=c>>>8&1023,r[n++]=c>>>18&1023,r[n++]=(c>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function Cw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(h&31)<<6)&2047,r[n++]=h>>>5&2047,r[n++]=h>>>16&2047,r[n++]=(h>>>27|(c&63)<<5)&2047,r[n++]=c>>>6&2047,r[n++]=c>>>17&2047,r[n++]=(c>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Mw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(h&255)<<4)&4095,r[n++]=h>>>8&4095,r[n++]=h>>>20&4095,r[n++]=c>>>0&4095,r[n++]=c>>>12&4095,r[n++]=(c>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function Bw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,v=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function Pw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function zw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Lw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function Vw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=h>>>0&15,r[n++]=h>>>4&15,r[n++]=h>>>8&15,r[n++]=h>>>12&15,r[n++]=h>>>16&15,r[n++]=h>>>20&15,r[n++]=h>>>24&15,r[n++]=h>>>28&15}}function Ow(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(h&15)<<1)&31,r[n++]=h>>>4&31,r[n++]=h>>>9&31,r[n++]=h>>>14&31,r[n++]=h>>>19&31,r[n++]=h>>>24&31,r[n++]=(h>>>29|(c&3)<<3)&31,r[n++]=c>>>2&31,r[n++]=c>>>7&31,r[n++]=c>>>12&31,r[n++]=c>>>17&31,r[n++]=c>>>22&31,r[n++]=c>>>27&31}}function Rw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=h>>>0&63,r[n++]=h>>>6&63,r[n++]=h>>>12&63,r[n++]=h>>>18&63,r[n++]=h>>>24&63,r[n++]=(h>>>30|(c&15)<<2)&63,r[n++]=c>>>4&63,r[n++]=c>>>10&63,r[n++]=c>>>16&63,r[n++]=c>>>22&63,r[n++]=(c>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function $w(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(h&3)<<5)&127,r[n++]=h>>>2&127,r[n++]=h>>>9&127,r[n++]=h>>>16&127,r[n++]=h>>>23&127,r[n++]=(h>>>30|(c&31)<<2)&127,r[n++]=c>>>5&127,r[n++]=c>>>12&127,r[n++]=c>>>19&127,r[n++]=(c>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function Nw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function Uw(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function qw(t,e,r,i,n){let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+n<=32){let p=l>>>o&a;r[u+c]=p|0,o+=n,o===32&&(o=0,s++,c!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<>>0)}}var hl=bw(py),jw=3*hl/256+hl|0;function fy(){let t=new Uint8Array(jw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Gw(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:fy()}}function Xw(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function Yw(t,e,r,i){i.byteContainer.length>>2;if(n.byteOffset&3)for(let o=0;o>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u>>(u<<3)&255}return n}function Ww(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=vw(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length>>5)|0,r.exceptionSizes[a]=s}return e}function Zw(t,e,r,i,n){switch(n){case 1:Pw(t,e,r,i);break;case 2:zw(t,e,r,i);break;case 3:Lw(t,e,r,i);break;case 4:Vw(t,e,r,i);break;case 5:Ow(t,e,r,i);break;case 6:Rw(t,e,r,i);break;case 7:$w(t,e,r,i);break;case 8:Nw(t,e,r,i);break;case 16:Uw(t,e,r,i);break;default:qw(t,e,r,i,n)}return e+(n<<3)|0}function Hw(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function Kw(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function Jw(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=Kw(n,a,s,r,i,l);if(s=c,h===1){let m=1<y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m0&&(c=Jw(n,m,d,y,o,l,c,u,p))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function t3(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,h=t[u]>>>0,c=h+3>>>2,p=u+1,f=p+c;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=Yw(t,p,h,a),y=h,m=Ww(t,f,a);return a.dataPointers.fill(0),Qw(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function e3(t,e,r,i,n,a){let s=i+gu(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(hl,s-o);l=t3(t,e,l,o,u,a),o=o+u|0}return l}function r3(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,h=n,c=n+a,p=0,f=0;for(;o>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${h-u}/${a}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function i3(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r!=null?r:fy();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=e3(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return r3(t,i,o,a,n,l),a}function n3(t,e,r,i,n){switch(n){case 2:Dw(t,e,r,i);return;case 3:_w(t,e,r,i);return;case 4:Aw(t,e,r,i);return;case 5:Sw(t,e,r,i);return;case 6:Ew(t,e,r,i);return;case 7:Fw(t,e,r,i);return;case 8:kw(t,e,r,i);return;case 9:Tw(t,e,r,i);return;case 10:Iw(t,e,r,i);return;case 11:Cw(t,e,r,i);return;case 12:Mw(t,e,r,i);return;case 16:Bw(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let h=l>>>o&a;r[i+u]=h|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=t[s]>>>0;let p=ul[n-h]>>>0,f=(c|(l&p)<t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length0){let o=t.byteOffset+e;if(o&3)for(let l=0;l=64)throw Error("Varint too long")}return e.set(n),r}function o3(t,e,r){let i=new Float64Array(r);for(let n=0;n>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error("Expected varint not more than 10 bytes")}function h3(t,e,r,i){return c3(t,e,r,i,Gw(r>>>2))}function c3(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=Xw(n,s);a3(t,a,r,o);let l=i3(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function et(t){return t>>>1^-(t&1)}function Ot(t){return t>>BigInt(1)^-(t&BigInt(1))}function We(t){return t%2==1?(t+1)/-2:t/2}function p3(t){let e=new Int32Array(t.length);for(let r=0;r=4)for(;i=4)for(;i=4)for(;r=4)for(let i=t[0];r=4)for(;i=4)for(;l>>0;for(let r=1;r>>0;return e}function jc(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ot(t[0]));for(let r=1;r>>0,e[1]=et(t[1])>>>0;for(let r=2;r>>0,e[r+1]=e[r-1]+et(t[r+1])>>>0;return e}function F3(t,e,r,i){let n=yy(t,e,r,i);return new Uint32Array(n)}function k3(t){return t[1]}function T3(t){return et(t[1])}function I3(t){if(t.length===2){let e=et(t[1]);return[e,e]}return[et(t[2]),et(t[3])]}function C3(t){return t[1]}function M3(t){return Ot(t[1])}function B3(t){if(t.length===2){let e=Ot(t[1]);return[e,e]}return[Ot(t[2]),Ot(t[3])]}var St;(function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"})(St||(St={}));var jt;(function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"})(jt||(jt={}));var Me;(function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"})(Me||(Me={}));var Ct;(function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"})(Ct||(Ct={}));var P3=[St.PRESENT,St.DATA,St.OFFSET,St.LENGTH],Gc=[H.NONE,H.DELTA,H.COMPONENTWISE_DELTA,H.RLE,H.MORTON],z3=[le.NONE,le.FAST_PFOR,le.VARINT],L3=[jt.NONE,jt.SINGLE,jt.SHARED,jt.VERTEX,jt.MORTON,jt.FSST],V3=[Me.VERTEX,Me.INDEX,Me.STRING,Me.KEY],O3=[Ct.VAR_BINARY,Ct.GEOMETRIES,Ct.PARTS,Ct.RINGS,Ct.TRIANGLES,Ct.SYMBOL,Ct.DICTIONARY];function ct(t,e){let r=N3(t,e);return r.logicalLevelTechnique1===H.MORTON?R3(r,t,e):(H.RLE===r.logicalLevelTechnique1||H.RLE===r.logicalLevelTechnique2)&&le.NONE!==r.physicalLevelTechnique?$3(r,t,e):r}function R3(t,e,r){let i=$t(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function $3(t,e,r){let i=$t(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function N3(t,e){let r=t[e.get()],i=P3[r>>4],n={};switch(i){case St.DATA:n={dictionaryType:L3[r&15]};break;case St.OFFSET:n={offsetType:V3[r&15]};break;case St.LENGTH:n={lengthType:O3[r&15]}}e.increment();let a=t[e.get()],s=Gc[a>>5],o=Gc[a>>2&7],l=z3[a&3];e.increment();let u=$t(t,e,2),h=u[0],c=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var ht;(function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(ht||(ht={}));var fe=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<>r&1}size(){return this._size}getBuffer(){return this.values}};function Er(t,e,r){if(!e)return t;let i=e.size(),n=t.constructor,a=new n(i),s=0;for(let o=0;o=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],h=Math.min(a+l,e);n.fill(u,a,h),a=h}else{let l=256-o;for(let u=0;u=12?X3.decode(t.subarray(e,r)):Y3(t,e,r)}function Y3(t,e,r){let i="",n=e;for(;n239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function Ta(t,e,r,i,n){return J3(pi(t,e,r),r,i,n)}function Vt(t,e,r,i,n){return Q3(pi(t,e,r),r,i,n)}function Ze(t,e,r){return e6(pi(t,e,r),r)}function pi(t,e,r){let i=r.physicalLevelTechnique;switch(i){case le.FAST_PFOR:return h3(t,r.numValues,r.byteLength,e);case le.VARINT:return $t(t,e,r.numValues);case le.NONE:return j3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function _n(t,e,r){let i=r.physicalLevelTechnique;switch(i){case le.VARINT:return xu(t,e,r.numValues);case le.NONE:return G3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function W3(t,e,r){let i=pi(t,e,r);return i.length===1?et(i[0]):T3(i)}function wu(t,e,r){let i=pi(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?et(i[0]):i[0]:k3(i)}function vy(t,e,r){return I3(pi(t,e,r))}function by(t,e,r){return B3(xu(t,e,r.numValues))}function wy(t,e,r,i){return _y(_n(t,e,r),r,i)}function Du(t,e,r,i){return Ay(_n(t,e,r),r,i)}function Z3(t,e,r,i){let n=H3(t,e,r,!1);return i?Er(n,i,0):n}function H3(t,e,r,i){if(r.physicalLevelTechnique===le.VARINT)return t6(o3(t,e,r.numValues),r,i);let n=_n(t,e,r),a=i?_y(n,r):Ay(n,r);return Float64Array.from(a,Number)}function K3(t,e,r){let i=_n(t,e,r);return i.length===1?Ot(i[0]):M3(i)}function Dy(t,e,r){let i=_n(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?Ot(i[0]):i[0]:C3(i)}function J3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;if(!i)return A3(t,a.runs,a.numRleValues);t=cl(t,a.runs,a.numRleValues),n=Nc(t)}else n=Nc(t);break;case H.RLE:n=m3(t,e.runs,e.numRleValues);break;case H.MORTON:vu(t),n=new Int32Array(t);break;case H.COMPONENTWISE_DELTA:if(r&&!i)return yy(t,r.scale,r.min,r.max);n=b3(t);break;case H.NONE:n=p3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Er(n,i,0):n}function Q3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;n=qc(cl(t,a.runs,a.numRleValues))}else n=qc(t);break;case H.RLE:n=cl(t,e.runs,e.numRleValues);break;case H.MORTON:vu(t),n=t;break;case H.COMPONENTWISE_DELTA:n=r&&!i?F3(t,r.scale,r.min,r.max):E3(t);break;case H.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Er(n,i,0):n}function _y(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;if(!r)return S3(t,n.runs,n.numRleValues);t=pl(t,n.runs,n.numRleValues),i=Uc(t)}else i=Uc(t);break;case H.RLE:i=g3(t,e.runs,e.numRleValues);break;case H.NONE:i=f3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Er(i,r,BigInt(0)):i}function Ay(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;i=jc(pl(t,n.runs,n.numRleValues))}else i=jc(t);break;case H.RLE:i=pl(t,e.runs,e.numRleValues);break;case H.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Er(i,r,BigInt(0)):i}function t6(t,e,r){switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let i=e;t=dy(t,i.runs,i.numRleValues)}return y3(t),t;case H.RLE:return i6(t,e,r);case H.NONE:return r&&d3(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function e6(t,e){if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.NONE)return w3(t);if(e.logicalLevelTechnique1===H.RLE&&e.logicalLevelTechnique2===H.NONE){let r=e;return _3(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===H.NONE&&e.logicalLevelTechnique2===H.NONE){v3(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.RLE){let r=e,i=D3(t,r.runs,r.numRleValues);return vu(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function es(t,e,r,i,n="int32"){let a=t.logicalLevelTechnique1;if(a===H.RLE)return t.runs===1?ht.CONST:ht.FLAT;if(a!==H.DELTA||t.logicalLevelTechnique2!==H.RLE)return t.numValues===1?ht.CONST:ht.FLAT;let s=e instanceof fe?e.size():e,o=t;if(o.numRleValues!==s)return ht.FLAT;if(o.runs===1)return ht.SEQUENCE;if(o.runs!==2)return t.numValues===1?ht.CONST:ht.FLAT;let l=i.get();if(t.physicalLevelTechnique===le.VARINT)return r6(r,i,n)?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT;let u=i.get(),h=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),h[2]===2&&h[3]===2?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT}function r6(t,e,r){let i=new cy(e.get());if(r==="int64"){let a=xu(t,i,4);return a[2]===BigInt(2)&&a[3]===BigInt(2)}let n=$t(t,i,4);return n[2]===2&&n[3]===2}function i6(t,e,r){return r?x3(t,e.runs,e.numRleValues):dy(t,e.runs,e.numRleValues)}var Sy=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},Ey=class extends uy{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function _u(t,e,r){return{x:Xc(t,e)-r,y:Xc(t>>1,e)-r}}function Xc(t,e){let r=0;for(let i=0;i>i;return r}var Rt;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"})(Rt||(Rt={}));var n6;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"})(n6||(n6={}));var Fr;(function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"})(Fr||(Fr={}));function a6(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g[D]),r+=v,i+=v}break;case Rt.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=c[r]-c[r-1],r++;let b;d?(b=Or(m,s,v,!1),s+=v*2):(b=lr(t.vertexBufferType,m,f,o,v,!1,l),o+=v),e[a++]=[b],h&&n++}break;case Rt.POLYGON:{let v=c[r]-c[r-1];r++;let b=Array(v-1),D,A=p[i]-p[i-1];if(i++,d){D=Or(m,s,A,!0),s+=A*2;for(let _=0;_r?e[a++]:1);return i}function Zc(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l0;)n[a++]=t[u++]}}return n}var By=class extends Au{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s!=null?s:e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){var n,a,s;(s=this.decodedDictionary)!=null||(this.decodedDictionary=(n=this.sharedDictionaryCache)==null?void 0:n.decodedDictionary,(a=this.decodedDictionary)!=null||(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return bu(this.decodedDictionary,r,i)}decodeDictionary(){var t;return(t=this.symbolLengthBuffer)!=null||(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),v6(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=ct(t,e);m=new fe(ci(t,x.numValues,x.byteLength,e),x.numValues)}let g=Vt(t,e,ct(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${y}"`);h[p++]=new By(y,g,n,a,s,o,m,c)}else h[p++]=new Qr(y,g,n,a,m)}return h}var Kc=class extends Sr{constructor(t,e,r){super(t,new Uint8Array,r!=null?r:e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},Be;(function(t){t[t.STRING=1]="STRING",t[t.INT32=2]="INT32",t[t.UINT32=4]="UINT32",t[t.INT64=8]="INT64",t[t.UINT64=16]="UINT64",t[t.FLOAT=32]="FLOAT",t[t.DOUBLE=64]="DOUBLE",t[t.PRESENCE=128]="PRESENCE"})(Be||(Be={}));var pr;(function(t){t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t[t.START_MAP=2]="START_MAP",t[t.START_LIST=3]="START_LIST",t[t.COUNT=4]="COUNT"})(pr||(pr={}));function A6(t,e,r,i){let n=S6(r);if(i===0)return n.map(h=>new Kc(h,[]));let a=E6(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let h=0;h{var i;return t.name+((i=r.name)!=null?i:"")})}function E6(t,e,r){let i=t[e.get()];e.add(1);let n=Vt(t,e,ct(t,e)),a=r-1,s=[];i&Be.STRING&&(a-=F6(t,e,s)),a-=k6(t,e,i,s),a-=T6(t,e,i,s);let o,l=0;if(i&Be.PRESENCE){let h=I6(t,e);o=h.value,l=h.count,a--}let u=new Uint32Array;if(a>0&&(u=Vt(t,e,ct(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function F6(t,e,r){let i=t[e.get()];e.add(1);let n=Py("",t,e,i);if(n)for(let a=0;aa.length)throw Error("Merged map counts underflow while decoding child streams");let f=Array(r),d=i,y=n;for(let x=0;xs.length)throw Error("Map value stream underflow while decoding feature payload");let b=M6(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x=r)throw Error("Unexpected end of map value stream");let n=t[e];if(n===pr.FALSE)return{value:!1,nextIndex:e+1};if(n===pr.TRUE)return{value:!0,nextIndex:e+1};if(n===pr.START_MAP){let a=Jc(t,e,r);return{value:zy(t,e+2,a,i).value,nextIndex:a}}if(n===pr.START_LIST){let a=Jc(t,e,r),s=[],o=e+2;for(;o=r)throw Error("Missing length for nested map/list payload");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error("Nested payload exceeds containing payload bounds");return n}function Ly(t,e){let r=t-pr.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function Xr(t,e){for(let r of e)t.push(r)}function B6(t,e,r,i,n,a){var s;return r.type==="scalarType"?a&&!a.has(r.name)?(my(i,t,e),null):P6(i,t,e,n,r.scalarType,r):((s=r.complexType)==null?void 0:s.physicalType)===Qe.MAP?A6(t,e,r,i):i===0?null:_6(t,e,r,a)}function P6(t,e,r,i,n,a){var l;let s;if(t===0)return null;if(a.nullable){let u=ct(e,r),h=u.numValues,c=r.get(),p=ci(e,h,u.byteLength,r);r.set(c+u.byteLength),s=new fe(p,u.numValues)}let o=s!=null?s:i;switch(n.physicalType){case it.UINT_32:case it.INT_32:return R6(e,r,a,n,o);case it.STRING:{let u=a.nullable?t-1:t;return(l=Py(a.name,e,r,u,s))!=null?l:null}case it.BOOLEAN:return z6(e,r,a,i,o);case it.UINT_64:case it.INT_64:return O6(e,r,a,o,n);case it.FLOAT:return L6(e,r,a,o);case it.DOUBLE:return V6(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function z6(t,e,r,i,n){let a=ct(t,e),s=a.numValues,o=e.get(),l=An(n)?n:void 0,u=ci(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let h=new fe(u,s);return new m6(r.name,h,n)}function L6(t,e,r,i){let n=ct(t,e),a=An(i)?i:void 0,s=gy(t,e,n.numValues,a);return new g6(r.name,s,i)}function V6(t,e,r,i){let n=ct(t,e),a=An(i)?i:void 0,s=xy(t,e,n.numValues,a);return new fu(r.name,s,i)}function O6(t,e,r,i,n){let a=ct(t,e),s=es(a,i,t,e,"int64"),o=n.physicalType===it.INT_64;if(s===ht.FLAT){let u=An(i)?i:void 0,h=o?wy(t,e,a,u):Du(t,e,a,u);return new Sy(r.name,h,i)}if(s===ht.SEQUENCE){let u=by(t,e,a);return new Ey(r.name,u[0],u[1],a.numRleValues,o)}let l=o?K3(t,e,a):Dy(t,e,a);return new My(r.name,l,i,o)}function R6(t,e,r,i,n){let a=ct(t,e),s=es(a,n,t,e),o=i.physicalType===it.INT_32;if(s===ht.FLAT){let u=An(n)?n:void 0,h=o?Ta(t,e,a,void 0,u):Vt(t,e,a,void 0,u);return new pu(r.name,h,n)}if(s===ht.SEQUENCE){let u=vy(t,e,a);return new du(r.name,u[0],u[1],a.numRleValues,o)}let l=o?W3(t,e,a):wu(t,e,a);return new yu(r.name,l,n,o)}function An(t){return t instanceof fe}var It={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function Vy(t){switch(t){case It.ID:case It.ID|It.ID_NULLABLE:case It.ID|It.ID_LONG:case It.ID|It.ID_LONG|It.ID_NULLABLE:return{nullable:(t&It.ID_NULLABLE)!==0,columnScope:qi.FEATURE,type:"scalarType",scalarType:{longID:(t&It.ID_LONG)!==0,type:"logicalType",logicalType:hy.ID}};case It.GEOMETRY:return{nullable:!1,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.GEOMETRY,children:[]}};case It.STRUCT:return{nullable:!1,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.STRUCT,children:[]}};case It.MAP:return{nullable:!0,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.MAP,children:[]}};default:return j6(t)}}function $6(t){return t>=It.SCALAR_BASE}function Oy(t){return t===It.STRUCT||t===It.MAP}function N6(t){if(t.type==="scalarType"){let e=t.scalarType;if(e.type==="physicalType")switch(e.physicalType){case it.BOOLEAN:case it.INT_8:case it.UINT_8:case it.INT_32:case it.UINT_32:case it.INT_64:case it.UINT_64:case it.FLOAT:case it.DOUBLE:return!1;case it.STRING:return!0;default:return!1}if(e.type==="logicalType")return!1}else if(t.type==="complexType"){let e=t.complexType;if(e.type==="physicalType")switch(e.physicalType){case Qe.GEOMETRY:case Qe.STRUCT:case Qe.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}function U6(t){var e;return t.type==="scalarType"&&((e=t.scalarType)==null?void 0:e.type)==="logicalType"&&t.scalarType.logicalType===hy.ID}function q6(t){var e;return t.type==="complexType"&&((e=t.complexType)==null?void 0:e.type)==="physicalType"&&t.complexType.physicalType===Qe.GEOMETRY}function j6(t){let e;switch(t){case 10:case 11:e=it.BOOLEAN;break;case 12:case 13:e=it.INT_8;break;case 14:case 15:e=it.UINT_8;break;case 16:case 17:e=it.INT_32;break;case 18:case 19:e=it.UINT_32;break;case 20:case 21:e=it.INT_64;break;case 22:case 23:e=it.UINT_64;break;case 24:case 25:e=it.FLOAT;break;case 26:case 27:e=it.DOUBLE;break;case 28:case 29:e=it.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:qi.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:e}}}var G6=new TextDecoder,Qc="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function Eu(t,e){let r=$t(t,e,1)[0];if(r===0)return"";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),G6.decode(a)}function X6(t){let e=t.name,r=t.nullable;return t.type==="scalarType"?{type:"scalarField",scalarField:t.scalarType,name:e,nullable:r}:{type:"complexField",complexField:t.complexType,name:e,nullable:r}}function Ry(t,e){let r=$t(t,e,1)[0]>>>0,i=r>=It.SCALAR_BASE?Vy(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n=Si(je({},i),{name:Eu(t,e)});if(n.type==="complexType"&&Oy(r)){let a=n.complexType,s=$t(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o>>0,i=Vy(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${Qc}`);let n;if($6(r))n=Eu(t,e);else if(r>>0,o=a.complexType;o.children=Array(s);for(let l=0;l>>0,a=$t(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=$t(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=W6(t,i),h=l.featureTables[0],c=null,p=null,f=[],d=0;for(let m of h.columns){let g=m.name;if(U6(m)){let x=null;if(m.nullable){let b=ct(t,i),D=i.get(),A=ci(t,b.numValues,b.byteLength,i);i.set(D+b.byteLength),x=new fe(A,b.numValues)}let v=ct(t,i);d=x?x.size():v.decompressedCount,c=H6(t,m,i,g,v,x!=null?x:d,r)}else if(q6(m)){let x=$t(t,i,1)[0];if(d===0){let v=i.get();d=ct(t,i).decompressedCount,i.set(v)}e&&(e.scale=e.extent/u),p=f6(t,x,i,d,e)}else{let x=N6(m)?$t(t,i,1)[0]:1;if(x===0)continue;let v=B6(t,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new xw(h.name,p,c,f,u);n.push(y),i.set(s)}return n}function H6(t,e,r,i,n,a,s=!1){var h;let o=(h=e.scalarType)!=null&&h.longID?it.UINT_64:it.UINT_32,l=typeof a=="number"?void 0:a,u=es(n,a,t,r,o===it.UINT_64?"int64":"int32");if(o===it.UINT_32)switch(u){case ht.FLAT:return new pu(i,Vt(t,r,n,void 0,l),a);case ht.SEQUENCE:{let c=vy(t,r,n);return new du(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new yu(i,wu(t,r,n),a,!1)}switch(u){case ht.FLAT:return s?new fu(i,Z3(t,r,n,l),a):new Sy(i,Du(t,r,n,l),a);case ht.SEQUENCE:{let c=by(t,r,n);return new Ey(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new My(i,Dy(t,r,n),a,!1)}throw Error("Vector type not supported for id column.")}var K6=class{constructor(t,e){var r;switch(this._featureData=t,this.properties=this._featureData.properties||{},(r=this._featureData.geometry)==null?void 0:r.type){case Rt.POINT:case Rt.MULTIPOINT:this.type=1;break;case Rt.LINESTRING:case Rt.MULTILINESTRING:this.type=2;break;case Rt.POLYGON:case Rt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new B(i.x,i.y));t.push(r)}return t}},J6=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new K6(this.features[t],this.extent)}},Fu=class{constructor(t){this.layers={};let e=Z6(new Uint8Array(t));this.layers=e.reduce((r,i)=>Si(je({},r),{[i.name]:new J6(i)}),{})}},ku=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new uo(mt,16,0),this.grid3D=new uo(mt,16,0),this.featureIndexArray=new Yf,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new Fu(this.rawTileData).layers:this.vtLayers=new Xl(new au(this.rawTileData)).layers,this.sourceLayerCoder=new cu(this.vtLayers?Object.keys(this.vtLayers).sort():[ll])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=mt/t.tileSize/t.scale,s=ai(n.filter,"queryRenderedFeatures filter",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Fa.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=Fa.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(y,m,g,x)=>vg(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)h.push(y);h.sort(t5);let f={},d;for(let y of h){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,i,(x,v,b)=>(g||(g=Ar(x)),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,transform:t.transform,pixelsToTileUnits:a,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,h){let c=this.bucketLayerIDs[e];if(a&&!c.some(y=>a.has(y)))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(i);if(n.needGeometry){let y=hi(f,!0);if(!n.filter(new st(this.tileID.overscaledZ),y,this.tileID.canonical))return}else if(!n.filter(new st(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let y of c){if(a&&!a.has(y))continue;let m=o[y];if(!m)continue;let g={};d&&u&&(g=u.getState(m.sourceLayer||"_geojsonTileLayer",d));let x=Gt({},l[y]);x.paint=tp(x.paint,m.paint,f,g,s),x.layout=tp(x.layout,m.layout,f,g,s);let v=!h||h(f,m,g);if(!v)continue;let b=new gw(f,this.z,this.x,this.y,d);b.layer=x;let D=t[y];D===void 0&&(D=t[y]=[]),D.push({featureIndex:i,feature:b,intersectionZ:v})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=ai(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let h of t)this.loadMatchingFeature(l,r,i,h,u,a,s,o,e);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){var i;let r=t.id;if(this.promoteId){let n=typeof this.promoteId=="string"?this.promoteId:this.promoteId[e];r=t.properties[n],typeof r=="boolean"&&(r=Number(r)),r===void 0&&((i=t.properties)!=null&&i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};C("FeatureIndex",ku,{omit:["rawTileData","sourceLayerCoder"]});function Q6(t){return typeof t=="object"&&!!t&&"evaluate"in t}function tp(t,e,r,i,n){return Ia(t,(a,s)=>{let o=e instanceof Ya?e.get(s):null;return Q6(o)?o.evaluate(r,i,void 0,n):o})}function t5(t,e){return e-t}var $y=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}};function Tu(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n="[";for(let a of t)n+=`${Tu(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i="{";for(let n=0;nthis._layers[c.id]),s=a[0];if(s.isHidden())continue;let o=s.source||"",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]={});let u=s.sourceLayer||"_geojsonTileLayer",h=l[u];h||(h=l[u]=[]),h.push(a)}}},qy=class{constructor(t){let e={},r=[];for(let s in t){let o=t[s],l=e[s]={};for(let u in o){let h=o[u];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let c={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};r.push(c),l[u]={rect:c,metrics:h.metrics}}}let{w:i,h:n}=su(r),a=new Ja({width:i||1,height:n||1});for(let s in t){let o=t[s];for(let l in o){let u=o[l];if(!u||u.bitmap.width===0||u.bitmap.height===0)continue;let h=e[s][l].rect;Ja.copy(u.bitmap,a,{x:0,y:0},{x:h.x+1,y:h.y+1},u.bitmap)}}this.image=a,this.positions=e}};C("GlyphAtlas",qy);var jy=class{constructor(t){this.tileID=new uu(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,e,r,i,n){return rt(this,null,function*(){this.data=t,this.collisionBoxArray=new Ll;let a=new cu(Object.keys(t.layers).sort()),s=new ku(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let S in u){let k=t.layers[S];if(!k)continue;k.version===1&&Bt(`Vector tile source "${this.source}" layer "${S}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let z=a.encode(S),O=[];for(let P=0;PF.id)))}}let h=Ia(l.glyphDependencies,S=>Object.keys(S));for(let S of this.inFlightDependencies)S==null||S.abort();this.inFlightDependencies=[];let c=Promise.resolve({});if(Object.keys(h).length){let S=new AbortController;this.inFlightDependencies.push(S),c=i.sendAsync({type:"GG",data:{stacks:h,source:this.source,tileID:this.tileID,type:"glyphs"}},S)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let S=new AbortController;this.inFlightDependencies.push(S),f=i.sendAsync({type:"GI",data:{icons:p,source:this.source,tileID:this.tileID,type:"icons"}},S)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let S=new AbortController;this.inFlightDependencies.push(S),y=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},S)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let S=new AbortController;this.inFlightDependencies.push(S),g=i.sendAsync({type:"GDA",data:{dashes:m}},S)}let[x,v,b,D]=yield Promise.all([c,f,y,g]),A=new qy(x),_=new ou(v,b);for(let S in o){let k=o[S];k.hasDependencies&&(Ny(k.layers,this.zoom,r),k.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:A.positions,iconMap:v,iconPositions:_.iconPositions,patternMap:b,patternPositions:_.patternPositions,dashPositions:D,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(S=>!S.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:A.image,imageAtlas:_,dashPositions:D,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?A.positions:null}})}};function Ny(t,e,r){let i=new st(e);for(let n of t)n.recalculate(i,r)}var Gy=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e!=null&&e.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},Xy=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},n5=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new B(e.x,e.y)))}},a5=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},s5=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function o5(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l0&&l.addLayer(d)}let h={vectorTile:l,rawData:hu(l).buffer};return this.overzoomedTileResultCache.set(s,h),h}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}},u5=class{constructor(){this.loaded={}}loadTile(t){return rt(this,null,function*(){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,h=Ca(i)?new Zt({width:l,height:u},yield ap(i,-2,-2,l,u)):i,c=new jl(e,h,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=c,c})}removeTile(t){let e=this.loaded,r=t.uid;e!=null&&e[r]&&delete e[r]}},h5=class{constructor(t,e,r,i=c5){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new Gy,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new ly(n.features,{version:2,extent:mt});return{vectorTile:a,rawData:hu(a,np).buffer}}loadTile(t){return rt(this,null,function*(){let{uid:e}=t,r=new jy(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),yield this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}})}_parseWorkerTile(t,e){return rt(this,null,function*(){let r=this.tileState.getParsing(t.uid),i=yield t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=Gt({rawTileData:n.slice(0),encoding:"mvt"},i),this.tileState.removeParsing(t.uid)}return i})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}loadData(t){return rt(this,null,function*(){var r;(r=this._pendingRequest)==null||r.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let i={};return t.request&&(i.data=t.data),this._finishRequestTiming(e,t,i),i}catch(i){if(delete this._pendingRequest,!yl(i))throw i;return{abandoned:!0}}})}_startRequestTiming(t){var e;if((e=t.request)!=null&&e.collectResourceTiming)return new Xy(t.request.url)}_finishRequestTiming(t,e,r){let i=t==null?void 0:t.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return yield this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}loadAndProcessGeoJSON(t,e){return rt(this,null,function*(){var r;if(t.request&&(t.data=(yield up(t.request,e)).data),t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source),this._geoJSONIndex=this._createGeoJSONIndex(t.data,t);return}if(t.dataDiff){(r=this._geoJSONIndex)!=null||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},t)),this._geoJSONIndex.updateData(t.dataDiff,this._getFilterPredicate(t.filter,t.source));return}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,Yy(t)),this._geoJSONIndex==null)throw Error(`Input data given to \'${t.source}\' is not a valid GeoJSON object.`)})}_filterGeoJSON(t,e,r){if(t.type!=="FeatureCollection")return t;let i=this._getFilterPredicate(e,r);return i?{type:"FeatureCollection",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!="boolean"&&!(t!=null&&t.length))return;let r=er(t,`sources.${e}.filter`,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(r.result==="error")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(", "));return i=>r.value.evaluate({zoom:0},i)}removeSource(t){return rt(this,null,function*(){var e;(e=this._pendingRequest)==null||e.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getClusterChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset)}};function c5(t,e){let r=Gt(e.geojsonVtOptions||{},{updateable:!0,clusterOptions:Yy(e)});return new Td(t,r)}function Yy({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,h]=e[l],c=er(h,`sources.${r}.clusterProperties.${l}[1]`),p=er(typeof u=="string"?[u,["accumulated"],["get",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=c.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let h of o)u[h]=i[h].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let h of o)a.accumulated=l[h],l[h]=n[h].evaluate(a,s)},t.clusterOptions}function Uy(t){return rt(this,null,function*(){if(t.endsWith(".mjs")){yield import(t);return}let e=yield fetch(t,{credentials:"same-origin"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=yield e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{yield import(i)}finally{URL.revokeObjectURL(i)}return}globalThis.eval(r)})}var p5=class{constructor(t){this.self=t,this.actor=new sy(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=sp,this.self.removeProtocol=op,this.self.registerRTLTextPlugin=e=>{wr.setMethods(e)},this.self.makeRequest=Ma,this.actor.registerMessageHandler("LDT",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler("RDT",(e,r)=>rt(this,null,function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})),this.actor.registerMessageHandler("GCEZ",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})),this.actor.registerMessageHandler("GCC",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})),this.actor.registerMessageHandler("GCL",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})),this.actor.registerMessageHandler("LD",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler("LT",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler("RT",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler("AT",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler("RMT",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler("RS",(e,r)=>rt(this,null,function*(){var n,a;if(!((a=(n=this.workerSources[e])==null?void 0:n[r.type])!=null&&a[r.source]))return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)})),this.actor.registerMessageHandler("RM",e=>rt(this,null,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)})),this.actor.registerMessageHandler("SR",(e,r)=>rt(this,null,function*(){this.referrer=r})),this.actor.registerMessageHandler("SRPS",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler("IS",(e,r)=>rt(this,null,function*(){yield Uy(r)})),this.actor.registerMessageHandler("SI",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler("UL",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))})),this.actor.registerMessageHandler("UGS",(e,r)=>rt(this,null,function*(){let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]})),this.actor.registerMessageHandler("SL",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).replace(r,this._getGlobalState(e))}))}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}_setImages(t,e){return rt(this,null,function*(){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}})}_syncRTLPluginState(t,e){return rt(this,null,function*(){return yield wr.syncState(e,Uy)})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i5),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case"vector":this.workerSources[t][e][r]=new l5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new h5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new u5),this.demWorkerSources[t][e]}};mr(self)&&(self.worker=new p5(self));export{p5 as default};\n/*! Bundled license information:\n\nmaplibre-gl/dist/maplibre-gl-shared.mjs:\nmaplibre-gl/dist/maplibre-gl-worker.mjs:\n (**\n * MapLibre GL JS\n * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.9.0/LICENSE.txt\n *)\n*/\n'}}),Use=de({"src/plots/map/layers.js"(e,r){"use strict";var t=Qt(),i=Zo().sanitizeHTML,a=s9(),o=D0();function s(f,h){this.subplot=f,this.uid=f.uid+"-"+h,this.index=h,this.idSource="source-"+this.uid,this.idLayer=o.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var l=s.prototype;l.update=function(h){this.visible?this.needsNewImage(h)?this.updateImage(h):this.needsNewSource(h)?(this.removeLayer(),this.updateSource(h),this.updateLayer(h)):this.needsNewLayer(h)?this.updateLayer(h):this.updateStyle(h):(this.updateSource(h),this.updateLayer(h)),this.visible=n(h)},l.needsNewImage=function(f){var h=this.subplot.map;return h.getSource(this.idSource)&&this.sourceType==="image"&&f.sourcetype==="image"&&(this.source!==f.source||JSON.stringify(this.coordinates)!==JSON.stringify(f.coordinates))},l.needsNewSource=function(f){return this.sourceType!==f.sourcetype||JSON.stringify(this.source)!==JSON.stringify(f.source)||this.layerType!==f.type},l.needsNewLayer=function(f){return this.layerType!==f.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(f){var h=this.subplot.map;h.getSource(this.idSource).updateImage({url:f.source,coordinates:f.coordinates});var d=this.findFollowingMapLayerId(this.lookupBelow());d!==null&&this.subplot.map.moveLayer(this.idLayer,d)},l.updateSource=function(f){var h=this.subplot.map;if(h.getSource(this.idSource)&&h.removeSource(this.idSource),this.sourceType=f.sourcetype,this.source=f.source,!!n(f)){var d=c(f);h.addSource(this.idSource,d)}},l.findFollowingMapLayerId=function(f){if(f==="traces")for(var h=this.subplot.getMapLayers(),d=0;d0){for(var d=0;d0}function u(f){var h={},d={};switch(f.type){case"circle":t.extendFlat(d,{"circle-radius":f.circle.radius,"circle-color":f.color,"circle-opacity":f.opacity});break;case"line":t.extendFlat(d,{"line-width":f.line.width,"line-color":f.color,"line-opacity":f.opacity,"line-dasharray":f.line.dash});break;case"fill":t.extendFlat(d,{"fill-color":f.color,"fill-outline-color":f.fill.outlinecolor,"fill-opacity":f.opacity});break;case"symbol":var p=f.symbol,g=a(p.textposition,p.iconsize);t.extendFlat(h,{"icon-image":p.icon,"icon-size":p.iconsize/10,"text-field":p.text,"text-size":p.textfont.size,"text-anchor":g.anchor,"text-offset":g.offset,"symbol-placement":p.placement}),t.extendFlat(d,{"icon-color":f.color,"text-color":p.textfont.color,"text-opacity":f.opacity});break;case"raster":t.extendFlat(d,{"raster-fade-duration":0,"raster-opacity":f.opacity});break}return{layout:h,paint:d}}function c(f){var h=f.sourcetype,d=f.source,p={type:h},g;return h==="geojson"?g="data":h==="vector"?g=typeof d=="string"?"url":"tiles":h==="raster"?(g="tiles",p.tileSize=256):h==="image"&&(g="url",p.coordinates=f.coordinates),p[g]=d,f.sourceattribution&&(p.attribution=i(f.sourceattribution)),p}r.exports=function(h,d,p){var g=new s(h,d);return g.update(p),g}}}),qse=de({"src/plots/map/map.js"(e,r){"use strict";var t=(Nse(),ti(C5)),i=jse(),a=!1,o=()=>{a||(a=!0,t.setWorkerUrl(URL.createObjectURL(new Blob([i],{type:"text/javascript"}))))},s=Qt(),l=Fp(),n=Ma(),u=nn(),c=Uc(),f=$s(),h=Xd(),d=h.drawMode,p=h.selectMode,g=Zl().prepSelect,m=Zl().clearOutline,y=Zl().clearSelectionsCache,_=Zl().selectOnClick,v=D0(),x=Use();function S(E,T){this.id=T,this.gd=E;var F=E._fullLayout,D=E._context;this.container=F._glcontainer.node(),this.isStatic=D.staticPlot,this.uid=F._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(F),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var M=S.prototype;M.plot=function(E,T,F){var D=this,R;D.map?R=new Promise(function(P,z){D.updateMap(E,T,P,z)}):R=new Promise(function(P,z){D.createMap(E,T,P,z)}),F.push(R)},M.createMap=function(E,T,F,D){var R=this,P=T[R.id],z=R.styleObj=A(P.style),I=P.bounds,L=I?[[I.west,I.south],[I.east,I.north]]:null;let B={container:R.div,style:z.style,center:b(P.center),zoom:P.zoom,bearing:P.bearing,pitch:P.pitch,maxBounds:L,interactive:!R.isStatic,canvasContextAttributes:{preserveDrawingBuffer:R.isStatic},doubleClickZoom:!1,boxZoom:!1,attributionControl:!1},O=P._fitBounds;O&&(B.bounds=[[O.west,O.south],[O.east,O.north]],B.fitBoundsOptions={padding:v.fitBoundsPadding}),o();let G=R.map=new t.Map(B).addControl(new t.AttributionControl({compact:!0})),W={};G.setMissingStyleImageResolver(Z=>(!W[Z]&&/^[a-zA-Z0-9-]+$/.test(Z)&&(W[Z]=new Promise(J=>{let N=new Image(15,15);N.onload=()=>{G.addImage(Z,N,{sdf:!0}),J()},N.onerror=()=>J(),N.crossOrigin="Anonymous",N.src=`https://cdn.jsdelivr.net/npm/@mapbox/maki@8.2.0/icons/${Z}.svg`})),W[Z])),G.setTransformRequest(function(Z){return Z=Z.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),Z=Z.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),Z=Z.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:Z}}),G._canvas.style.left="0px",G._canvas.style.top="0px",R.rejectOnError(D),R.isStatic||R.initFx(E,T);var X=[];X.push(new Promise(function(Z){G.once("load",Z)})),X=X.concat(l.fetchTraceGeoData(E)),Promise.all(X).then(function(){O&&C(R,P),w(R,P),R.fillBelowLookup(E,T),R.updateData(E),R.updateLayout(T),R.resolveOnRender(F)}).catch(D)},M.updateMap=function(E,T,F,D){var R=this,P=R.map,z=T[this.id];R.rejectOnError(D);var I=[],L=A(z.style);JSON.stringify(R.styleObj)!==JSON.stringify(L)&&(R.styleObj=L,P.setStyle(L.style),R.traceHash={},I.push(new Promise(function(B){P.once("styledata",B)}))),I=I.concat(l.fetchTraceGeoData(E)),Promise.all(I).then(function(){R.fillBelowLookup(E,T),R.updateData(E);let B=z._fitBounds;B&&(P.fitBounds([[B.west,B.south],[B.east,B.north]],{padding:v.fitBoundsPadding,animate:!1}),C(R,z),w(R,z)),R.updateLayout(T),R.resolveOnRender(F)}).catch(D)};function C(E,T){let{center:F,zoom:D}=E.getView();T._input.center=T.center=F,T._input.zoom=T.zoom=D,T._input._fitView={center:Ot({},F),zoom:D}}function w(E,T){let F=E.getView();E.viewInitial={center:s.extendFlat({},F.center),bearing:T.bearing,pitch:T.pitch,zoom:F.zoom}}M.fillBelowLookup=function(E,T){var F=T[this.id],D=F.layers,R,P,z=this.belowLookup={},I=!1;for(R=0;R1)for(R=0;RT.project(D).x,_subplot:T},T.yaxis={_id:"y",c2p:D=>T.project(D).y,_subplot:T},T.updateFramework(E),T.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(T.mockAxis,E)},M.initFx=function(E,T){var F=this,D=F.gd,R=F.map;R.on("moveend",function(I){if(F.map){var L=D._fullLayout;if(I.originalEvent||F.wheeling){var B=L[F.id];n.call("_storeDirectGUIEdit",D.layout,L._preGUI,F.getViewEdits(B));var O=F.getView();B._input.center=B.center=O.center,B._input.zoom=B.zoom=O.zoom,B._input.bearing=B.bearing=O.bearing,B._input.pitch=B.pitch=O.pitch,D.emit("plotly_relayout",F.getViewEditsWithDerived(O))}I.originalEvent&&I.originalEvent.type==="mouseup"?F.dragging=!1:F.wheeling&&(F.wheeling=!1),L&&L._rehover&&L._rehover()}}),R.on("wheel",function(){F.wheeling=!0}),R.on("mousemove",function(I){var L=F.div.getBoundingClientRect(),B=[I.originalEvent.offsetX,I.originalEvent.offsetY];I.target.getBoundingClientRect=function(){return L},F.xaxis.p2c=function(){return R.unproject(B).lng},F.yaxis.p2c=function(){return R.unproject(B).lat},D._fullLayout._rehover=function(){D._fullLayout._hoversubplot===F.id&&D._fullLayout[F.id]&&f.hover(D,I,F.id)},f.hover(D,I,F.id),D._fullLayout._hoversubplot=F.id});function P(){f.loneUnhover(T._hoverlayer)}R.on("dragstart",function(){F.dragging=!0,P()}),R.on("zoomstart",P),R.on("mouseout",function(){D._fullLayout._hoversubplot=null});function z(){var I=F.getView();D.emit("plotly_relayouting",F.getViewEditsWithDerived(I))}R.on("drag",z),R.on("zoom",z),R.on("dblclick",function(){var I=D._fullLayout[F.id];n.call("_storeDirectGUIEdit",D.layout,D._fullLayout._preGUI,F.getViewEdits(I));var L=F.viewInitial;R.setCenter(b(L.center)),R.setZoom(L.zoom),R.setBearing(L.bearing),R.setPitch(L.pitch);var B=F.getView();I._input.center=I.center=B.center,I._input.zoom=I.zoom=B.zoom,I._input.bearing=I.bearing=B.bearing,I._input.pitch=I.pitch=B.pitch,D.emit("plotly_doubleclick",null),D.emit("plotly_relayout",F.getViewEditsWithDerived(B))}),F.clearOutline=function(){y(F.dragOptions),m(F.dragOptions.gd)},F.onClickInPanFn=function(I){return function(L){var B=D._fullLayout.clickmode;B.indexOf("select")>-1&&_(L.originalEvent,D,[F.xaxis],[F.yaxis],F.id,I),B.indexOf("event")>-1&&f.click(D,L.originalEvent)}}},M.updateFx=function(E){var T=this,F=T.map,D=T.gd;if(T.isStatic)return;function R(L){var B=T.map.unproject(L);return[B.lng,B.lat]}var P=E.dragmode,z;z=function(L,B){if(B.isRect){var O=L.range={};O[T.id]=[R([B.xmin,B.ymin]),R([B.xmax,B.ymax])]}else{var G=L.lassoPoints={};G[T.id]=B.map(R)}};var I=T.dragOptions;T.dragOptions=s.extendDeep(I||{},{dragmode:E.dragmode,element:T.div,gd:D,plotinfo:{id:T.id,domain:E[T.id].domain,xaxis:T.xaxis,yaxis:T.yaxis,fillRangeItems:z},xaxes:[T.xaxis],yaxes:[T.yaxis],subplot:T.id}),F.off("click",T.onClickInPanHandler),p(P)||d(P)?(F.dragPan.disable(),F.on("zoomstart",T.clearOutline),T.dragOptions.prepFn=function(L,B,O){g(L,B,O,T.dragOptions,P)},c.init(T.dragOptions)):(F.dragPan.enable(),F.off("zoomstart",T.clearOutline),T.div.onmousedown=null,T.div.ontouchstart=null,T.div.removeEventListener("touchstart",T.div._ontouchstart),T.onClickInPanHandler=T.onClickInPanFn(T.dragOptions),F.on("click",T.onClickInPanHandler))},M.updateFramework=function(E){var T=E[this.id].domain,F=E._size,D=this.div.style;D.width=F.w*(T.x[1]-T.x[0])+"px",D.height=F.h*(T.y[1]-T.y[0])+"px",D.left=F.l+T.x[0]*F.w+"px",D.top=F.t+(1-T.y[1])*F.h+"px",this.xaxis._offset=F.l+T.x[0]*F.w,this.xaxis._length=F.w*(T.x[1]-T.x[0]),this.yaxis._offset=F.t+(1-T.y[1])*F.h,this.yaxis._length=F.h*(T.y[1]-T.y[0])},M.updateLayers=function(E){var T=E[this.id],F=T.layers,D=this.layerList,R;if(F.length!==D.length){for(R=0;RVse});function Vse(e,r){let t=[];for(let n of e){if(n.subplot!==r||n.visible!==!0)continue;if(n.type==="choroplethmap")return null;let{lat:u,lon:c}=n;if(!c||!u)continue;let f=Math.min(c.length,u.length);for(let h=0;hA/2){var b=M.split("|").join("
");w.text(b).attr("data-unformatted",b).call(n.convertToTspans,f),k=l.bBox(w.node())}w.attr("transform",t(-3,-k.height+8)),C.insert("rect",".static-attribution").attr({x:-k.width-6,y:-k.height-3,width:k.width+6,height:k.height+3,fill:"rgba(255, 255, 255, 0.75)"});var E=1;k.width+6>A&&(E=A/(k.width+6));var T=[p.l+p.w*y.x[1],p.t+p.h*(1-y.y[0])];C.attr("transform",t(T[0],T[1])+i(E))}},e.updateFx=function(f){for(var h=f._fullLayout,d=h._subplots[c],p=0;p=0;u--)l.removeLayer(n[u][1])},s.dispose=function(){var l=this.subplot.map;this._removeLayers(),l.removeSource(this.sourceId)},r.exports=function(n,u){var c=u[0].trace,f=new o(n,c.uid),h=f.sourceId,d=t(u),p=f.below=n.belowLookup["trace-"+c.uid];return n.map.addSource(h,{type:"geojson",data:d.geojson}),f._addLayers(d,p),u[0].trace._glTrace=f,f}}}),Zse=de({"src/traces/choroplethmap/index.js"(e,r){"use strict";r.exports={attributes:z8(),supplyDefaults:Yse(),colorbar:b1(),calc:h7(),plot:Xse(),hoverPoints:d7(),eventData:p7(),selectPoints:v7(),styleOnSelect:function(t,i){if(i){var a=i[0].trace;a._glTrace.updateOnSelect(i)}},getBelow:function(t,i){for(var a=i.getMapLayers(),o=a.length-2;o>=0;o--){var s=a[o].id;if(typeof s=="string"&&s.indexOf("water")===0){for(var l=o+1;l0?+y[g]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:S},properties:M})}}var w=o.extractOpts(c),k=w.reversescale?o.flipScale(w.colorscale):w.colorscale,A=k[0][1],b=a.opacity(A)<1?A:a.addOpacity(A,0),E=["interpolate",["linear"],["heatmap-density"],0,b];for(g=1;g=0;n--)s.removeLayer(l[n][1])},o.dispose=function(){var s=this.subplot.map;this._removeLayers(),s.removeSource(this.sourceId)},r.exports=function(l,n){var u=n[0].trace,c=new a(l,u.uid),f=c.sourceId,h=t(n),d=c.below=l.belowLookup["trace-"+u.uid];return l.map.addSource(f,{type:"geojson",data:h.geojson}),c._addLayers(h,d),c}}}),rle=de({"src/traces/densitymap/hover.js"(e,r){"use strict";var t=nn(),i=z4().hoverPoints,a=z4().getExtraText;r.exports=function(s,l,n){var u=i(s,l,n);if(u){var c=u[0],f=c.cd,h=f[0].trace,d=f[c.index];if(delete c.color,"z"in d){var p=c.subplot.mockAxis;c.z=d.z,c.zLabel=t.tickText(p,p.c2l(d.z),"hover").text}return c.extraText=a(h,d,f[0].t.labels),[c]}}}}),ile=de({"src/traces/densitymap/event_data.js"(e,r){"use strict";r.exports=function(i,a){return i.lon=a.lon,i.lat=a.lat,i.z=a.z,i}}}),ale=de({"src/traces/densitymap/index.js"(e,r){"use strict";r.exports={attributes:O8(),supplyDefaults:Jse(),colorbar:b1(),formatLabels:o9(),calc:Qse(),plot:tle(),hoverPoints:rle(),eventData:ile(),getBelow:function(t,i){for(var a=i.getMapLayers(),o=0;ox[F%x.length];v("color",_.label.map((F,D)=>a.addOpacity(S(D),.8))),v("customdata");var M=f.link||{},C=l.newContainer(h,"link");function w(F,D){return t.coerce(M,C,i.link,F,D)}w("label"),w("arrowlen"),w("source"),w("target"),w("value"),w("line.color"),w("line.width"),w("hoverinfo",f.hoverinfo),s(M,C,w,m),w("hovertemplate"),w("sort");var k=a.luminosity(p.paper_bgcolor)<.333,A=k?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",b=w("color",A);function E(F){if(!a.isValid(F))return F;let D=a.opacity(F);return D<=.8?a.addOpacity(F,D+.2):k?a.brighten(F,10):a.adjustLightness(F,-10)}w("hovercolor",Array.isArray(b)?b.map(E):E(b)),w("customdata"),n(M,C,{name:"colorscales",handleItemDefaults:u}),o(h,p,g),g("orientation"),g("direction"),g("valueformat"),g("valuesuffix");let T=_.x.length&&_.y.length?"freeform":void 0;g("arrangement",T),t.coerceFont(g,"textfont",p.font,{autoShadowDflt:!0}),h._length=null};function u(c,f){function h(d,p){return t.coerce(c,f,i.link.colorscales,d,p)}h("label"),h("cmin"),h("cmax"),h("colorscale")}}}),j8=de({"node_modules/strongly-connected-components/scc.js"(e,r){"use strict";r.exports=t;function t(i){for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),n=new Array(a),u=new Array(a),c=new Array(a),f=0;f0;){v=S[S.length-1];var M=i[v];if(n[v]=0&&c[v].push(u[w])}n[v]=C}else{if(s[v]===o[v]){for(var k=[],A=[],b=0,C=x.length-1;C>=0;--C){var E=x[C];if(l[E]=!1,k.push(E),A.push(c[E]),b+=c[E].length,u[E]=d.length,E===v){x.length=C;break}}d.push(k);for(var T=new Array(b),C=0;Cw&&(w=h.source[x]),h.target[x]>w&&(w=h.target[x]);var k=w+1;c.node._count=k;var A,b=c.node.groups,E={};for(x=0;x0&&s(z,k)&&s(I,k)&&!(E.hasOwnProperty(z)&&E.hasOwnProperty(I)&&E[z]===E[I])){E.hasOwnProperty(I)&&(I=E[I]),E.hasOwnProperty(z)&&(z=E[z]),z=+z,I=+I,y[z]=y[I]=!0;var L="";h.label&&h.label[x]&&(L=h.label[x]);var B=null;L&&_.hasOwnProperty(L)&&(B=_[L]),d.push({pointNumber:x,label:L,color:p?h.color[x]:h.color,hovercolor:g?h.hovercolor[x]:h.hovercolor,customdata:m?h.customdata[x]:h.customdata,concentrationscale:B,source:z,target:I,value:+P}),R.source.push(z),R.target.push(I)}}var O=k+b.length,G=o(f.color),W=o(f.customdata),X=[];for(x=0;xk-1,childrenNodes:[],pointNumber:x,label:Z,color:G?f.color[x]:f.color,customdata:W?f.customdata[x]:f.customdata})}var J=!1;return u(O,R.source,R.target)&&(J=!0),{circular:J,links:d,nodes:X,groups:b,groupLookup:E}}function u(c,f,h){for(var d=i.init2dArray(c,0),p=0;p1})}r.exports=function(f,h){var d=n(h);return a({circular:d.circular,_nodes:d.nodes,_links:d.links,_groups:d.groups,_groupLookup:d.groupLookup})}}}),lle=de({"node_modules/d3-quadtree/dist/d3-quadtree.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=t||self,i(t.d3=t.d3||{}))})(e,function(t){"use strict";function i(k){var A=+this._x.call(null,k),b=+this._y.call(null,k);return a(this.cover(A,b),A,b,k)}function a(k,A,b,E){if(isNaN(A)||isNaN(b))return k;var T,F=k._root,D={data:E},R=k._x0,P=k._y0,z=k._x1,I=k._y1,L,B,O,G,W,X,Z,J;if(!F)return k._root=D,k;for(;F.length;)if((W=A>=(L=(R+z)/2))?R=L:z=L,(X=b>=(B=(P+I)/2))?P=B:I=B,T=F,!(F=F[Z=X<<1|W]))return T[Z]=D,k;if(O=+k._x.call(null,F.data),G=+k._y.call(null,F.data),A===O&&b===G)return D.next=F,T?T[Z]=D:k._root=D,k;do T=T?T[Z]=new Array(4):k._root=new Array(4),(W=A>=(L=(R+z)/2))?R=L:z=L,(X=b>=(B=(P+I)/2))?P=B:I=B;while((Z=X<<1|W)===(J=(G>=B)<<1|O>=L));return T[J]=F,T[Z]=D,k}function o(k){var A,b,E=k.length,T,F,D=new Array(E),R=new Array(E),P=1/0,z=1/0,I=-1/0,L=-1/0;for(b=0;bI&&(I=T),FL&&(L=F));if(P>I||z>L)return this;for(this.cover(P,z).cover(I,L),b=0;bk||k>=T||E>A||A>=F;)switch(z=(AI||(R=G.y0)>L||(P=G.x1)=Z)<<1|k>=X)&&(G=B[B.length-1],B[B.length-1]=B[B.length-1-W],B[B.length-1-W]=G)}else{var J=k-+this._x.call(null,O.data),N=A-+this._y.call(null,O.data),H=J*J+N*N;if(H=(B=(D+P)/2))?D=B:P=B,(W=L>=(O=(R+z)/2))?R=O:z=O,A=b,!(b=b[X=W<<1|G]))return this;if(!b.length)break;(A[X+1&3]||A[X+2&3]||A[X+3&3])&&(E=A,Z=X)}for(;b.data!==k;)if(T=b,!(b=b.next))return this;return(F=b.next)&&delete b.next,T?(F?T.next=F:delete T.next,this):A?(F?A[X]=F:delete A[X],(b=A[0]||A[1]||A[2]||A[3])&&b===(A[3]||A[2]||A[1]||A[0])&&!b.length&&(E?E[Z]=b:this._root=b),this):(this._root=F,this)}function h(k){for(var A=0,b=k.length;A=y.length)return v!=null&&w.sort(v),x!=null?x(w):w;for(var E=-1,T=w.length,F=y[k++],D,R,P=o(),z,I=A();++Ey.length)return w;var A,b=_[k-1];return x!=null&&k>=y.length?A=w.entries():(A=[],w.each(function(E,T){A.push({key:T,values:C(E,k)})})),b!=null?A.sort(function(E,T){return b(E.key,T.key)}):A}return S={object:function(w){return M(w,0,l,n)},map:function(w){return M(w,0,u,c)},entries:function(w){return C(M(w,0,u,c),0)},key:function(w){return y.push(w),S},sortKeys:function(w){return _[y.length-1]=w,S},sortValues:function(w){return v=w,S},rollup:function(w){return x=w,S}}}function l(){return{}}function n(y,_,v){y[_]=v}function u(){return o()}function c(y,_,v){y.set(_,v)}function f(){}var h=o.prototype;f.prototype=d.prototype={constructor:f,has:h.has,add:function(y){return y+="",this[i+y]=y,this},remove:h.remove,clear:h.clear,values:h.keys,size:h.size,empty:h.empty,each:h.each};function d(y,_){var v=new f;if(y instanceof f)y.each(function(M){v.add(M)});else if(y){var x=-1,S=y.length;if(_==null)for(;++x=0&&(h=f.slice(d+1),f=f.slice(0,d)),f&&!c.hasOwnProperty(f))throw new Error("unknown type: "+f);return{type:f,name:h}})}o.prototype=a.prototype={constructor:o,on:function(u,c){var f=this._,h=s(u+"",f),d,p=-1,g=h.length;if(arguments.length<2){for(;++p0)for(var f=new Array(d),h=0,d,p;h=0&&k._call.call(null,A),k=k._next;--i}function v(){c=(u=h.now())+f,i=a=0;try{_()}finally{i=0,S(),c=0}}function x(){var k=h.now(),A=k-u;A>s&&(f-=A,u=k)}function S(){for(var k,A=l,b,E=1/0;A;)A._call?(E>A._time&&(E=A._time),k=A,A=A._next):(b=A._next,A._next=null,A=k?k._next=b:l=b);n=k,M(E)}function M(k){if(!i){a&&(a=clearTimeout(a));var A=k-c;A>24?(k<1/0&&(a=setTimeout(v,k-h.now()-f)),o&&(o=clearInterval(o))):(o||(u=h.now(),o=setInterval(x,s)),i=1,d(v))}}function C(k,A,b){var E=new m;return A=A==null?0:+A,E.restart(function(T){E.stop(),k(T+A)},A,b),E}function w(k,A,b){var E=new m,T=A;return A==null?(E.restart(k,A,b),E):(A=+A,b=b==null?p():+b,E.restart(function F(D){D+=T,E.restart(F,T+=A,b),k(D)},A,b),E)}t.interval=w,t.now=p,t.timeout=C,t.timer=y,t.timerFlush=_,Object.defineProperty(t,"__esModule",{value:!0})})}}),fle=de({"node_modules/d3-force/dist/d3-force.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e,lle(),U8(),ule(),cle()):i(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3)})(e,(function(t,i,a,o,s){"use strict";function l(k,A){var b;k==null&&(k=0),A==null&&(A=0);function E(){var T,F=b.length,D,R=0,P=0;for(T=0;TL.index){var Y=B-V.x-V.vx,K=O-V.y-V.vy,te=Y*Y+K*K;teB+q||$O+q||UP.r&&(P.r=P[z].r)}function R(){if(A){var P,z=A.length,I;for(b=new Array(z),P=0;P1?(W==null?R.remove(G):R.set(G,O(W)),A):R.get(G)},find:function(G,W,X){var Z=0,J=k.length,N,H,$,U,V;for(X==null?X=1/0:X*=X,Z=0;Z1?(z.on(G,W),A):z.on(G)}}}function S(){var k,A,b,E=n(-30),T,F=1,D=1/0,R=.81;function P(B){var O,G=k.length,W=i.quadtree(k,m,y).visitAfter(I);for(b=B,O=0;O=D)return;(B.data!==A||B.next)&&(X===0&&(X=u(),N+=X*X),Z===0&&(Z=u(),N+=Z*Z),Nyt?1:gt>=yt?0:NaN}function a(gt){let yt=gt,kt=gt;gt.length===1&&(yt=(mr,br)=>gt(mr)-br,kt=o(gt));function Lt(mr,br,Er,Tr){for(Er==null&&(Er=0),Tr==null&&(Tr=mr.length);Er>>1;kt(mr[Ur],br)<0?Er=Ur+1:Tr=Ur}return Er}function Ct(mr,br,Er,Tr){for(Er==null&&(Er=0),Tr==null&&(Tr=mr.length);Er>>1;kt(mr[Ur],br)>0?Tr=Ur:Er=Ur+1}return Er}function $t(mr,br,Er,Tr){Er==null&&(Er=0),Tr==null&&(Tr=mr.length);let Ur=Lt(mr,br,Er,Tr-1);return Ur>Er&&yt(mr[Ur-1],br)>-yt(mr[Ur],br)?Ur-1:Ur}return{left:Lt,center:$t,right:Ct}}function o(gt){return(yt,kt)=>i(gt(yt),kt)}function s(gt){return gt===null?NaN:+gt}function*l(gt,yt){if(yt===void 0)for(let kt of gt)kt!=null&&(kt=+kt)>=kt&&(yield kt);else{let kt=-1;for(let Lt of gt)(Lt=yt(Lt,++kt,gt))!=null&&(Lt=+Lt)>=Lt&&(yield Lt)}}let n=a(i),u=n.right,c=n.left,f=a(s).center;function h(gt,yt){let kt=0;if(yt===void 0)for(let Lt of gt)Lt!=null&&(Lt=+Lt)>=Lt&&++kt;else{let Lt=-1;for(let Ct of gt)(Ct=yt(Ct,++Lt,gt))!=null&&(Ct=+Ct)>=Ct&&++kt}return kt}function d(gt){return gt.length|0}function p(gt){return!(gt>0)}function g(gt){return typeof gt!="object"||"length"in gt?gt:Array.from(gt)}function m(gt){return yt=>gt(...yt)}function y(...gt){let yt=typeof gt[gt.length-1]=="function"&&m(gt.pop());gt=gt.map(g);let kt=gt.map(d),Lt=gt.length-1,Ct=new Array(Lt+1).fill(0),$t=[];if(Lt<0||kt.some(p))return $t;for(;;){$t.push(Ct.map((br,Er)=>gt[Er][br]));let mr=Lt;for(;++Ct[mr]===kt[mr];){if(mr===0)return yt?$t.map(yt):$t;Ct[mr--]=0}}}function _(gt,yt){var kt=0,Lt=0;return Float64Array.from(gt,yt===void 0?Ct=>kt+=+Ct||0:Ct=>kt+=+yt(Ct,Lt++,gt)||0)}function v(gt,yt){return ytgt?1:yt>=gt?0:NaN}function x(gt,yt){let kt=0,Lt,Ct=0,$t=0;if(yt===void 0)for(let mr of gt)mr!=null&&(mr=+mr)>=mr&&(Lt=mr-Ct,Ct+=Lt/++kt,$t+=Lt*(mr-Ct));else{let mr=-1;for(let br of gt)(br=yt(br,++mr,gt))!=null&&(br=+br)>=br&&(Lt=br-Ct,Ct+=Lt/++kt,$t+=Lt*(br-Ct))}if(kt>1)return $t/(kt-1)}function S(gt,yt){let kt=x(gt,yt);return kt&&Math.sqrt(kt)}function M(gt,yt){let kt,Lt;if(yt===void 0)for(let Ct of gt)Ct!=null&&(kt===void 0?Ct>=Ct&&(kt=Lt=Ct):(kt>Ct&&(kt=Ct),Lt=$t&&(kt=Lt=$t):(kt>$t&&(kt=$t),Lt<$t&&(Lt=$t)))}return[kt,Lt]}class C{constructor(){this._partials=new Float64Array(32),this._n=0}add(yt){let kt=this._partials,Lt=0;for(let Ct=0;Ct0){for(mr=yt[--kt];kt>0&&(Lt=mr,Ct=yt[--kt],mr=Lt+Ct,$t=Ct-(mr-Lt),!$t););kt>0&&($t<0&&yt[kt-1]<0||$t>0&&yt[kt-1]>0)&&(Ct=$t*2,Lt=mr+Ct,Ct==Lt-mr&&(mr=Lt))}return mr}}function w(gt,yt){let kt=new C;if(yt===void 0)for(let Lt of gt)(Lt=+Lt)&&kt.add(Lt);else{let Lt=-1;for(let Ct of gt)(Ct=+yt(Ct,++Lt,gt))&&kt.add(Ct)}return+kt}function k(gt,yt){let kt=new C,Lt=-1;return Float64Array.from(gt,yt===void 0?Ct=>kt.add(+Ct||0):Ct=>kt.add(+yt(Ct,++Lt,gt)||0))}class A extends Map{constructor(yt,kt=D){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:kt}}),yt!=null)for(let[Lt,Ct]of yt)this.set(Lt,Ct)}get(yt){return super.get(E(this,yt))}has(yt){return super.has(E(this,yt))}set(yt,kt){return super.set(T(this,yt),kt)}delete(yt){return super.delete(F(this,yt))}}class b extends Set{constructor(yt,kt=D){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:kt}}),yt!=null)for(let Lt of yt)this.add(Lt)}has(yt){return super.has(E(this,yt))}add(yt){return super.add(T(this,yt))}delete(yt){return super.delete(F(this,yt))}}function E({_intern:gt,_key:yt},kt){let Lt=yt(kt);return gt.has(Lt)?gt.get(Lt):kt}function T({_intern:gt,_key:yt},kt){let Lt=yt(kt);return gt.has(Lt)?gt.get(Lt):(gt.set(Lt,kt),kt)}function F({_intern:gt,_key:yt},kt){let Lt=yt(kt);return gt.has(Lt)&&(kt=gt.get(kt),gt.delete(Lt)),kt}function D(gt){return gt!==null&&typeof gt=="object"?gt.valueOf():gt}function R(gt){return gt}function P(gt,...yt){return W(gt,R,R,yt)}function z(gt,...yt){return W(gt,Array.from,R,yt)}function I(gt,yt,...kt){return W(gt,R,yt,kt)}function L(gt,yt,...kt){return W(gt,Array.from,yt,kt)}function B(gt,...yt){return W(gt,R,G,yt)}function O(gt,...yt){return W(gt,Array.from,G,yt)}function G(gt){if(gt.length!==1)throw new Error("duplicate key");return gt[0]}function W(gt,yt,kt,Lt){return(function Ct($t,mr){if(mr>=Lt.length)return kt($t);let br=new A,Er=Lt[mr++],Tr=-1;for(let Ur of $t){let Ai=Er(Ur,++Tr,$t),oi=br.get(Ai);oi?oi.push(Ur):br.set(Ai,[Ur])}for(let[Ur,Ai]of br)br.set(Ur,Ct(Ai,mr));return yt(br)})(gt,0)}function X(gt,yt){return Array.from(yt,kt=>gt[kt])}function Z(gt,...yt){if(typeof gt[Symbol.iterator]!="function")throw new TypeError("values is not iterable");gt=Array.from(gt);let[kt=i]=yt;if(kt.length===1||yt.length>1){let Lt=Uint32Array.from(gt,(Ct,$t)=>$t);return yt.length>1?(yt=yt.map(Ct=>gt.map(Ct)),Lt.sort((Ct,$t)=>{for(let mr of yt){let br=i(mr[Ct],mr[$t]);if(br)return br}})):(kt=gt.map(kt),Lt.sort((Ct,$t)=>i(kt[Ct],kt[$t]))),X(gt,Lt)}return gt.sort(kt)}function J(gt,yt,kt){return(yt.length===1?Z(I(gt,yt,kt),(([Lt,Ct],[$t,mr])=>i(Ct,mr)||i(Lt,$t))):Z(P(gt,kt),(([Lt,Ct],[$t,mr])=>yt(Ct,mr)||i(Lt,$t)))).map(([Lt])=>Lt)}var N=Array.prototype,H=N.slice;function $(gt){return function(){return gt}}var U=Math.sqrt(50),V=Math.sqrt(10),j=Math.sqrt(2);function q(gt,yt,kt){var Lt,Ct=-1,$t,mr,br;if(yt=+yt,gt=+gt,kt=+kt,gt===yt&&kt>0)return[gt];if((Lt=yt0){let Er=Math.round(gt/br),Tr=Math.round(yt/br);for(Er*bryt&&--Tr,mr=new Array($t=Tr-Er+1);++Ct<$t;)mr[Ct]=(Er+Ct)*br}else{br=-br;let Er=Math.round(gt*br),Tr=Math.round(yt*br);for(Er/bryt&&--Tr,mr=new Array($t=Tr-Er+1);++Ct<$t;)mr[Ct]=(Er+Ct)/br}return Lt&&mr.reverse(),mr}function Y(gt,yt,kt){var Lt=(yt-gt)/Math.max(0,kt),Ct=Math.floor(Math.log(Lt)/Math.LN10),$t=Lt/Math.pow(10,Ct);return Ct>=0?($t>=U?10:$t>=V?5:$t>=j?2:1)*Math.pow(10,Ct):-Math.pow(10,-Ct)/($t>=U?10:$t>=V?5:$t>=j?2:1)}function K(gt,yt,kt){var Lt=Math.abs(yt-gt)/Math.max(0,kt),Ct=Math.pow(10,Math.floor(Math.log(Lt)/Math.LN10)),$t=Lt/Ct;return $t>=U?Ct*=10:$t>=V?Ct*=5:$t>=j&&(Ct*=2),yt0?(gt=Math.floor(gt/Ct)*Ct,yt=Math.ceil(yt/Ct)*Ct):Ct<0&&(gt=Math.ceil(gt*Ct)/Ct,yt=Math.floor(yt*Ct)/Ct),Lt=Ct}}function ne(gt){return Math.ceil(Math.log(h(gt))/Math.LN2)+1}function se(){var gt=R,yt=M,kt=ne;function Lt(Ct){Array.isArray(Ct)||(Ct=Array.from(Ct));var $t,mr=Ct.length,br,Er=new Array(mr);for($t=0;$t=Ai)if(ja>=Ai&&yt===M){let pa=Y(Ur,Ai,ya);isFinite(pa)&&(pa>0?Ai=(Math.floor(Ai/pa)+1)*pa:pa<0&&(Ai=(Math.ceil(Ai*-pa)+1)/-pa))}else oi.pop()}for(var Qr=oi.length;oi[0]<=Ur;)oi.shift(),--Qr;for(;oi[Qr-1]>Ai;)oi.pop(),--Qr;var ea=new Array(Qr+1),$i;for($t=0;$t<=Qr;++$t)$i=ea[$t]=[],$i.x0=$t>0?oi[$t-1]:Ur,$i.x1=$t=Lt)&&(kt=Lt);else{let Lt=-1;for(let Ct of gt)(Ct=yt(Ct,++Lt,gt))!=null&&(kt=Ct)&&(kt=Ct)}return kt}function ce(gt,yt){let kt;if(yt===void 0)for(let Lt of gt)Lt!=null&&(kt>Lt||kt===void 0&&Lt>=Lt)&&(kt=Lt);else{let Lt=-1;for(let Ct of gt)(Ct=yt(Ct,++Lt,gt))!=null&&(kt>Ct||kt===void 0&&Ct>=Ct)&&(kt=Ct)}return kt}function pe(gt,yt,kt=0,Lt=gt.length-1,Ct=i){for(;Lt>kt;){if(Lt-kt>600){let Er=Lt-kt+1,Tr=yt-kt+1,Ur=Math.log(Er),Ai=.5*Math.exp(2*Ur/3),oi=.5*Math.sqrt(Ur*Ai*(Er-Ai)/Er)*(Tr-Er/2<0?-1:1),Qr=Math.max(kt,Math.floor(yt-Tr*Ai/Er+oi)),ea=Math.min(Lt,Math.floor(yt+(Er-Tr)*Ai/Er+oi));pe(gt,yt,Qr,ea,Ct)}let $t=gt[yt],mr=kt,br=Lt;for(xe(gt,kt,yt),Ct(gt[Lt],$t)>0&&xe(gt,kt,Lt);mr0;)--br}Ct(gt[kt],$t)===0?xe(gt,kt,br):(++br,xe(gt,br,Lt)),br<=yt&&(kt=br+1),yt<=br&&(Lt=br-1)}return gt}function xe(gt,yt,kt){let Lt=gt[yt];gt[yt]=gt[kt],gt[kt]=Lt}function ye(gt,yt,kt){if(gt=Float64Array.from(l(gt,kt)),!!(Lt=gt.length)){if((yt=+yt)<=0||Lt<2)return ce(gt);if(yt>=1)return le(gt);var Lt,Ct=(Lt-1)*yt,$t=Math.floor(Ct),mr=le(pe(gt,$t).subarray(0,$t+1)),br=ce(gt.subarray($t+1));return mr+(br-mr)*(Ct-$t)}}function fe(gt,yt,kt=s){if(Lt=gt.length){if((yt=+yt)<=0||Lt<2)return+kt(gt[0],0,gt);if(yt>=1)return+kt(gt[Lt-1],Lt-1,gt);var Lt,Ct=(Lt-1)*yt,$t=Math.floor(Ct),mr=+kt(gt[$t],$t,gt),br=+kt(gt[$t+1],$t+1,gt);return mr+(br-mr)*(Ct-$t)}}function ae(gt,yt,kt){return Math.ceil((kt-yt)/(2*(ye(gt,.75)-ye(gt,.25))*Math.pow(h(gt),-1/3)))}function ee(gt,yt,kt){return Math.ceil((kt-yt)/(3.5*S(gt)*Math.pow(h(gt),-1/3)))}function ie(gt,yt){let kt,Lt=-1,Ct=-1;if(yt===void 0)for(let $t of gt)++Ct,$t!=null&&(kt<$t||kt===void 0&&$t>=$t)&&(kt=$t,Lt=Ct);else for(let $t of gt)($t=yt($t,++Ct,gt))!=null&&(kt<$t||kt===void 0&&$t>=$t)&&(kt=$t,Lt=Ct);return Lt}function Q(gt,yt){let kt=0,Lt=0;if(yt===void 0)for(let Ct of gt)Ct!=null&&(Ct=+Ct)>=Ct&&(++kt,Lt+=Ct);else{let Ct=-1;for(let $t of gt)($t=yt($t,++Ct,gt))!=null&&($t=+$t)>=$t&&(++kt,Lt+=$t)}if(kt)return Lt/kt}function ue(gt,yt){return ye(gt,.5,yt)}function*ge(gt){for(let yt of gt)yield*Ia(yt)}function Me(gt){return Array.from(ge(gt))}function Te(gt,yt){let kt,Lt=-1,Ct=-1;if(yt===void 0)for(let $t of gt)++Ct,$t!=null&&(kt>$t||kt===void 0&&$t>=$t)&&(kt=$t,Lt=Ct);else for(let $t of gt)($t=yt($t,++Ct,gt))!=null&&(kt>$t||kt===void 0&&$t>=$t)&&(kt=$t,Lt=Ct);return Lt}function je(gt,yt=Ve){let kt=[],Lt,Ct=!1;for(let $t of gt)Ct&&kt.push(yt(Lt,$t)),Lt=$t,Ct=!0;return kt}function Ve(gt,yt){return[gt,yt]}function Ze(gt,yt,kt){gt=+gt,yt=+yt,kt=(Ct=arguments.length)<2?(yt=gt,gt=0,1):Ct<3?1:+kt;for(var Lt=-1,Ct=Math.max(0,Math.ceil((yt-gt)/kt))|0,$t=new Array(Ct);++Lt0:i(mr,mr)===0)&&(kt=$t,Ct=mr,Lt=!0)}}else for(let Ct of gt)(Lt?yt(Ct,kt)>0:yt(Ct,Ct)===0)&&(kt=Ct,Lt=!0);return kt}function Pt(gt,yt=i){if(yt.length===1)return ie(gt,yt);let kt,Lt=-1,Ct=-1;for(let $t of gt)++Ct,(Lt<0?yt($t,$t)===0:yt($t,kt)>0)&&(kt=$t,Lt=Ct);return Lt}function mt(gt,yt){let kt=vt(gt,yt);return kt<0?void 0:kt}var Mt=lt(Math.random);function lt(gt){return function(kt,Lt=0,Ct=kt.length){let $t=Ct-(Lt=+Lt);for(;$t;){let mr=gt()*$t--|0,br=kt[$t+Lt];kt[$t+Lt]=kt[mr+Lt],kt[mr+Lt]=br}return kt}}function qe(gt,yt){let kt=0;if(yt===void 0)for(let Lt of gt)(Lt=+Lt)&&(kt+=Lt);else{let Lt=-1;for(let Ct of gt)(Ct=+yt(Ct,++Lt,gt))&&(kt+=Ct)}return kt}function Ye(gt){if(!($t=gt.length))return[];for(var yt=-1,kt=ce(gt,me),Lt=new Array(kt);++ytyt(kt,Lt,gt))}function Je(gt,yt,kt){if(typeof yt!="function")throw new TypeError("reducer is not a function");let Lt=gt[Symbol.iterator](),Ct,$t,mr=-1;if(arguments.length<3){if({done:Ct,value:kt}=Lt.next(),Ct)return;++mr}for(;{done:Ct,value:$t}=Lt.next(),!Ct;)kt=yt(kt,$t,++mr,gt);return kt}function Ue(gt){if(typeof gt[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(gt).reverse()}function at(gt,...yt){gt=new Set(gt);for(let kt of yt)for(let Lt of kt)gt.delete(Lt);return gt}function rt(gt,yt){let kt=yt[Symbol.iterator](),Lt=new Set;for(let Ct of gt){if(Lt.has(Ct))return!1;let $t,mr;for(;({value:$t,done:mr}=kt.next())&&!mr;){if(Object.is(Ct,$t))return!1;Lt.add($t)}}return!0}function ft(gt){return gt instanceof Set?gt:new Set(gt)}function At(gt,...yt){gt=new Set(gt),yt=yt.map(ft);e:for(let kt of gt)for(let Lt of yt)if(!Lt.has(kt)){gt.delete(kt);continue e}return gt}function ht(gt,yt){let kt=gt[Symbol.iterator](),Lt=new Set;for(let Ct of yt){if(Lt.has(Ct))continue;let $t,mr;for(;{value:$t,done:mr}=kt.next();){if(mr)return!1;if(Lt.add($t),Object.is(Ct,$t))break}}return!0}function Gt(gt,yt){return ht(yt,gt)}function fr(...gt){let yt=new Set;for(let kt of gt)for(let Lt of kt)yt.add(Lt);return yt}t.Adder=C,t.InternMap=A,t.InternSet=b,t.ascending=i,t.bin=se,t.bisect=u,t.bisectCenter=f,t.bisectLeft=c,t.bisectRight=u,t.bisector=a,t.count=h,t.cross=y,t.cumsum=_,t.descending=v,t.deviation=S,t.difference=at,t.disjoint=rt,t.every=Ae,t.extent=M,t.fcumsum=k,t.filter=Ee,t.fsum=w,t.greatest=xt,t.greatestIndex=Pt,t.group=P,t.groupSort=J,t.groups=z,t.histogram=se,t.index=B,t.indexes=O,t.intersection=At,t.least=Ke,t.leastIndex=vt,t.map=De,t.max=le,t.maxIndex=ie,t.mean=Q,t.median=ue,t.merge=Me,t.min=ce,t.minIndex=Te,t.nice=te,t.pairs=je,t.permute=X,t.quantile=ye,t.quantileSorted=fe,t.quickselect=pe,t.range=Ze,t.reduce=Je,t.reverse=Ue,t.rollup=I,t.rollups=L,t.scan=mt,t.shuffle=Mt,t.shuffler=lt,t.some=ke,t.sort=Z,t.subset=Gt,t.sum=qe,t.superset=ht,t.thresholdFreedmanDiaconis=ae,t.thresholdScott=ee,t.thresholdSturges=ne,t.tickIncrement=Y,t.tickStep=K,t.ticks=q,t.transpose=Ye,t.union=fr,t.variance=x,t.zip=_e,Object.defineProperty(t,"__esModule",{value:!0})}))}}),dle=de({"node_modules/d3-path/dist/d3-path.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=t||self,i(t.d3=t.d3||{}))})(e,function(t){"use strict";var i=Math.PI,a=2*i,o=1e-6,s=a-o;function l(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function n(){return new l}l.prototype=n.prototype={constructor:l,moveTo:function(u,c){this._+="M"+(this._x0=this._x1=+u)+","+(this._y0=this._y1=+c)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(u,c){this._+="L"+(this._x1=+u)+","+(this._y1=+c)},quadraticCurveTo:function(u,c,f,h){this._+="Q"+ +u+","+ +c+","+(this._x1=+f)+","+(this._y1=+h)},bezierCurveTo:function(u,c,f,h,d,p){this._+="C"+ +u+","+ +c+","+ +f+","+ +h+","+(this._x1=+d)+","+(this._y1=+p)},arcTo:function(u,c,f,h,d){u=+u,c=+c,f=+f,h=+h,d=+d;var p=this._x1,g=this._y1,m=f-u,y=h-c,_=p-u,v=g-c,x=_*_+v*v;if(d<0)throw new Error("negative radius: "+d);if(this._x1===null)this._+="M"+(this._x1=u)+","+(this._y1=c);else if(x>o)if(!(Math.abs(v*m-y*_)>o)||!d)this._+="L"+(this._x1=u)+","+(this._y1=c);else{var S=f-p,M=h-g,C=m*m+y*y,w=S*S+M*M,k=Math.sqrt(C),A=Math.sqrt(x),b=d*Math.tan((i-Math.acos((C+x-w)/(2*k*A)))/2),E=b/A,T=b/k;Math.abs(E-1)>o&&(this._+="L"+(u+E*_)+","+(c+E*v)),this._+="A"+d+","+d+",0,0,"+ +(v*S>_*M)+","+(this._x1=u+T*m)+","+(this._y1=c+T*y)}},arc:function(u,c,f,h,d,p){u=+u,c=+c,f=+f,p=!!p;var g=f*Math.cos(h),m=f*Math.sin(h),y=u+g,_=c+m,v=1^p,x=p?h-d:d-h;if(f<0)throw new Error("negative radius: "+f);this._x1===null?this._+="M"+y+","+_:(Math.abs(this._x1-y)>o||Math.abs(this._y1-_)>o)&&(this._+="L"+y+","+_),f&&(x<0&&(x=x%a+a),x>s?this._+="A"+f+","+f+",0,1,"+v+","+(u-g)+","+(c-m)+"A"+f+","+f+",0,1,"+v+","+(this._x1=y)+","+(this._y1=_):x>o&&(this._+="A"+f+","+f+",0,"+ +(x>=i)+","+v+","+(this._x1=u+f*Math.cos(d))+","+(this._y1=c+f*Math.sin(d))))},rect:function(u,c,f,h){this._+="M"+(this._x0=this._x1=+u)+","+(this._y0=this._y1=+c)+"h"+ +f+"v"+ +h+"h"+-f+"Z"},toString:function(){return this._}},t.path=n,Object.defineProperty(t,"__esModule",{value:!0})})}}),q8=de({"node_modules/d3-shape/dist/d3-shape.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e,dle()):(t=t||self,i(t.d3=t.d3||{},t.d3))})(e,function(t,i){"use strict";function a(ze){return function(){return ze}}var o=Math.abs,s=Math.atan2,l=Math.cos,n=Math.max,u=Math.min,c=Math.sin,f=Math.sqrt,h=1e-12,d=Math.PI,p=d/2,g=2*d;function m(ze){return ze>1?0:ze<-1?d:Math.acos(ze)}function y(ze){return ze>=1?p:ze<=-1?-p:Math.asin(ze)}function _(ze){return ze.innerRadius}function v(ze){return ze.outerRadius}function x(ze){return ze.startAngle}function S(ze){return ze.endAngle}function M(ze){return ze&&ze.padAngle}function C(ze,tt,ct,wt,Nt,It,Zt,qt){var vr=ct-ze,Br=wt-tt,Pr=Zt-Nt,Mi=qt-It,gi=Mi*vr-Pr*Br;if(!(gi*giln*ln+on*on&&(tn=Kn,Mn=zn),{cx:tn,cy:Mn,x01:-Pr,y01:-Mi,x11:tn*(Nt/pn-1),y11:Mn*(Nt/pn-1)}}function k(){var ze=_,tt=v,ct=a(0),wt=null,Nt=x,It=S,Zt=M,qt=null;function vr(){var Br,Pr,Mi=+ze.apply(this,arguments),gi=+tt.apply(this,arguments),ba=Nt.apply(this,arguments)-p,Hi=It.apply(this,arguments)-p,Za=o(Hi-ba),oa=Hi>ba;if(qt||(qt=Br=i.path()),gih))qt.moveTo(0,0);else if(Za>g-h)qt.moveTo(gi*l(ba),gi*c(ba)),qt.arc(0,0,gi,ba,Hi,!oa),Mi>h&&(qt.moveTo(Mi*l(Hi),Mi*c(Hi)),qt.arc(0,0,Mi,Hi,ba,oa));else{var Cn=ba,_n=Hi,Li=ba,In=Hi,pn=Za,Ka=Za,Rn=Zt.apply(this,arguments)/2,tn=Rn>h&&(wt?+wt.apply(this,arguments):f(Mi*Mi+gi*gi)),Mn=u(o(gi-Mi)/2,+ct.apply(this,arguments)),Kn=Mn,zn=Mn,ua,Ea;if(tn>h){var ln=y(tn/Mi*c(Rn)),on=y(tn/gi*c(Rn));(pn-=ln*2)>h?(ln*=oa?1:-1,Li+=ln,In-=ln):(pn=0,Li=In=(ba+Hi)/2),(Ka-=on*2)>h?(on*=oa?1:-1,Cn+=on,_n-=on):(Ka=0,Cn=_n=(ba+Hi)/2)}var ao=gi*l(Cn),ho=gi*c(Cn),Jn=Mi*l(In),lo=Mi*c(In);if(Mn>h){var Fo=gi*l(_n),uo=gi*c(_n),Qn=Mi*l(Li),jo=Mi*c(Li),Yn;if(Zah?zn>h?(ua=w(Qn,jo,ao,ho,gi,zn,oa),Ea=w(Fo,uo,Jn,lo,gi,zn,oa),qt.moveTo(ua.cx+ua.x01,ua.cy+ua.y01),znh)||!(pn>h)?qt.lineTo(Jn,lo):Kn>h?(ua=w(Jn,lo,Fo,uo,Mi,-Kn,oa),Ea=w(ao,ho,Qn,jo,Mi,-Kn,oa),qt.lineTo(ua.cx+ua.x01,ua.cy+ua.y01),Kn=gi;--ba)qt.point(_n[ba],Li[ba]);qt.lineEnd(),qt.areaEnd()}oa&&(_n[Mi]=+ze(Za,Mi,Pr),Li[Mi]=+ct(Za,Mi,Pr),qt.point(tt?+tt(Za,Mi,Pr):_n[Mi],wt?+wt(Za,Mi,Pr):Li[Mi]))}if(Cn)return qt=null,Cn+""||null}function Br(){return F().defined(Nt).curve(Zt).context(It)}return vr.x=function(Pr){return arguments.length?(ze=typeof Pr=="function"?Pr:a(+Pr),tt=null,vr):ze},vr.x0=function(Pr){return arguments.length?(ze=typeof Pr=="function"?Pr:a(+Pr),vr):ze},vr.x1=function(Pr){return arguments.length?(tt=Pr==null?null:typeof Pr=="function"?Pr:a(+Pr),vr):tt},vr.y=function(Pr){return arguments.length?(ct=typeof Pr=="function"?Pr:a(+Pr),wt=null,vr):ct},vr.y0=function(Pr){return arguments.length?(ct=typeof Pr=="function"?Pr:a(+Pr),vr):ct},vr.y1=function(Pr){return arguments.length?(wt=Pr==null?null:typeof Pr=="function"?Pr:a(+Pr),vr):wt},vr.lineX0=vr.lineY0=function(){return Br().x(ze).y(ct)},vr.lineY1=function(){return Br().x(ze).y(wt)},vr.lineX1=function(){return Br().x(tt).y(ct)},vr.defined=function(Pr){return arguments.length?(Nt=typeof Pr=="function"?Pr:a(!!Pr),vr):Nt},vr.curve=function(Pr){return arguments.length?(Zt=Pr,It!=null&&(qt=Zt(It)),vr):Zt},vr.context=function(Pr){return arguments.length?(Pr==null?It=qt=null:qt=Zt(It=Pr),vr):It},vr}function R(ze,tt){return ttze?1:tt>=ze?0:NaN}function P(ze){return ze}function z(){var ze=P,tt=R,ct=null,wt=a(0),Nt=a(g),It=a(0);function Zt(qt){var vr,Br=qt.length,Pr,Mi,gi=0,ba=new Array(Br),Hi=new Array(Br),Za=+wt.apply(this,arguments),oa=Math.min(g,Math.max(-g,Nt.apply(this,arguments)-Za)),Cn,_n=Math.min(Math.abs(oa)/Br,It.apply(this,arguments)),Li=_n*(oa<0?-1:1),In;for(vr=0;vr0&&(gi+=In);for(tt!=null?ba.sort(function(pn,Ka){return tt(Hi[pn],Hi[Ka])}):ct!=null&&ba.sort(function(pn,Ka){return ct(qt[pn],qt[Ka])}),vr=0,Mi=gi?(oa-Br*Li)/gi:0;vr0?In*Mi:0)+Li,Hi[Pr]={data:qt[Pr],index:vr,value:In,startAngle:Za,endAngle:Cn,padAngle:_n};return Hi}return Zt.value=function(qt){return arguments.length?(ze=typeof qt=="function"?qt:a(+qt),Zt):ze},Zt.sortValues=function(qt){return arguments.length?(tt=qt,ct=null,Zt):tt},Zt.sort=function(qt){return arguments.length?(ct=qt,tt=null,Zt):ct},Zt.startAngle=function(qt){return arguments.length?(wt=typeof qt=="function"?qt:a(+qt),Zt):wt},Zt.endAngle=function(qt){return arguments.length?(Nt=typeof qt=="function"?qt:a(+qt),Zt):Nt},Zt.padAngle=function(qt){return arguments.length?(It=typeof qt=="function"?qt:a(+qt),Zt):It},Zt}var I=B(b);function L(ze){this._curve=ze}L.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(ze,tt){this._curve.point(tt*Math.sin(ze),tt*-Math.cos(ze))}};function B(ze){function tt(ct){return new L(ze(ct))}return tt._curve=ze,tt}function O(ze){var tt=ze.curve;return ze.angle=ze.x,delete ze.x,ze.radius=ze.y,delete ze.y,ze.curve=function(ct){return arguments.length?tt(B(ct)):tt()._curve},ze}function G(){return O(F().curve(I))}function W(){var ze=D().curve(I),tt=ze.curve,ct=ze.lineX0,wt=ze.lineX1,Nt=ze.lineY0,It=ze.lineY1;return ze.angle=ze.x,delete ze.x,ze.startAngle=ze.x0,delete ze.x0,ze.endAngle=ze.x1,delete ze.x1,ze.radius=ze.y,delete ze.y,ze.innerRadius=ze.y0,delete ze.y0,ze.outerRadius=ze.y1,delete ze.y1,ze.lineStartAngle=function(){return O(ct())},delete ze.lineX0,ze.lineEndAngle=function(){return O(wt())},delete ze.lineX1,ze.lineInnerRadius=function(){return O(Nt())},delete ze.lineY0,ze.lineOuterRadius=function(){return O(It())},delete ze.lineY1,ze.curve=function(Zt){return arguments.length?tt(B(Zt)):tt()._curve},ze}function X(ze,tt){return[(tt=+tt)*Math.cos(ze-=Math.PI/2),tt*Math.sin(ze)]}var Z=Array.prototype.slice;function J(ze){return ze.source}function N(ze){return ze.target}function H(ze){var tt=J,ct=N,wt=E,Nt=T,It=null;function Zt(){var qt,vr=Z.call(arguments),Br=tt.apply(this,vr),Pr=ct.apply(this,vr);if(It||(It=qt=i.path()),ze(It,+wt.apply(this,(vr[0]=Br,vr)),+Nt.apply(this,vr),+wt.apply(this,(vr[0]=Pr,vr)),+Nt.apply(this,vr)),qt)return It=null,qt+""||null}return Zt.source=function(qt){return arguments.length?(tt=qt,Zt):tt},Zt.target=function(qt){return arguments.length?(ct=qt,Zt):ct},Zt.x=function(qt){return arguments.length?(wt=typeof qt=="function"?qt:a(+qt),Zt):wt},Zt.y=function(qt){return arguments.length?(Nt=typeof qt=="function"?qt:a(+qt),Zt):Nt},Zt.context=function(qt){return arguments.length?(It=qt??null,Zt):It},Zt}function $(ze,tt,ct,wt,Nt){ze.moveTo(tt,ct),ze.bezierCurveTo(tt=(tt+wt)/2,ct,tt,Nt,wt,Nt)}function U(ze,tt,ct,wt,Nt){ze.moveTo(tt,ct),ze.bezierCurveTo(tt,ct=(ct+Nt)/2,wt,ct,wt,Nt)}function V(ze,tt,ct,wt,Nt){var It=X(tt,ct),Zt=X(tt,ct=(ct+Nt)/2),qt=X(wt,ct),vr=X(wt,Nt);ze.moveTo(It[0],It[1]),ze.bezierCurveTo(Zt[0],Zt[1],qt[0],qt[1],vr[0],vr[1])}function j(){return H($)}function q(){return H(U)}function Y(){var ze=H(V);return ze.angle=ze.x,delete ze.x,ze.radius=ze.y,delete ze.y,ze}var K={draw:function(ze,tt){var ct=Math.sqrt(tt/d);ze.moveTo(ct,0),ze.arc(0,0,ct,0,g)}},te={draw:function(ze,tt){var ct=Math.sqrt(tt/5)/2;ze.moveTo(-3*ct,-ct),ze.lineTo(-ct,-ct),ze.lineTo(-ct,-3*ct),ze.lineTo(ct,-3*ct),ze.lineTo(ct,-ct),ze.lineTo(3*ct,-ct),ze.lineTo(3*ct,ct),ze.lineTo(ct,ct),ze.lineTo(ct,3*ct),ze.lineTo(-ct,3*ct),ze.lineTo(-ct,ct),ze.lineTo(-3*ct,ct),ze.closePath()}},ne=Math.sqrt(1/3),se=ne*2,le={draw:function(ze,tt){var ct=Math.sqrt(tt/se),wt=ct*ne;ze.moveTo(0,-ct),ze.lineTo(wt,0),ze.lineTo(0,ct),ze.lineTo(-wt,0),ze.closePath()}},ce=.8908130915292852,pe=Math.sin(d/10)/Math.sin(7*d/10),xe=Math.sin(g/10)*pe,ye=-Math.cos(g/10)*pe,fe={draw:function(ze,tt){var ct=Math.sqrt(tt*ce),wt=xe*ct,Nt=ye*ct;ze.moveTo(0,-ct),ze.lineTo(wt,Nt);for(var It=1;It<5;++It){var Zt=g*It/5,qt=Math.cos(Zt),vr=Math.sin(Zt);ze.lineTo(vr*ct,-qt*ct),ze.lineTo(qt*wt-vr*Nt,vr*wt+qt*Nt)}ze.closePath()}},ae={draw:function(ze,tt){var ct=Math.sqrt(tt),wt=-ct/2;ze.rect(wt,wt,ct,ct)}},ee=Math.sqrt(3),ie={draw:function(ze,tt){var ct=-Math.sqrt(tt/(ee*3));ze.moveTo(0,ct*2),ze.lineTo(-ee*ct,-ct),ze.lineTo(ee*ct,-ct),ze.closePath()}},Q=-.5,ue=Math.sqrt(3)/2,ge=1/Math.sqrt(12),Me=(ge/2+1)*3,Te={draw:function(ze,tt){var ct=Math.sqrt(tt/Me),wt=ct/2,Nt=ct*ge,It=wt,Zt=ct*ge+ct,qt=-It,vr=Zt;ze.moveTo(wt,Nt),ze.lineTo(It,Zt),ze.lineTo(qt,vr),ze.lineTo(Q*wt-ue*Nt,ue*wt+Q*Nt),ze.lineTo(Q*It-ue*Zt,ue*It+Q*Zt),ze.lineTo(Q*qt-ue*vr,ue*qt+Q*vr),ze.lineTo(Q*wt+ue*Nt,Q*Nt-ue*wt),ze.lineTo(Q*It+ue*Zt,Q*Zt-ue*It),ze.lineTo(Q*qt+ue*vr,Q*vr-ue*qt),ze.closePath()}},je=[K,te,le,ae,fe,ie,Te];function Ve(){var ze=a(K),tt=a(64),ct=null;function wt(){var Nt;if(ct||(ct=Nt=i.path()),ze.apply(this,arguments).draw(ct,+tt.apply(this,arguments)),Nt)return ct=null,Nt+""||null}return wt.type=function(Nt){return arguments.length?(ze=typeof Nt=="function"?Nt:a(Nt),wt):ze},wt.size=function(Nt){return arguments.length?(tt=typeof Nt=="function"?Nt:a(+Nt),wt):tt},wt.context=function(Nt){return arguments.length?(ct=Nt??null,wt):ct},wt}function Ze(){}function Ke(ze,tt,ct){ze._context.bezierCurveTo((2*ze._x0+ze._x1)/3,(2*ze._y0+ze._y1)/3,(ze._x0+2*ze._x1)/3,(ze._y0+2*ze._y1)/3,(ze._x0+4*ze._x1+tt)/6,(ze._y0+4*ze._y1+ct)/6)}function vt(ze){this._context=ze}vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ke(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ke(this,ze,tt);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=tt}};function xt(ze){return new vt(ze)}function Pt(ze){this._context=ze}Pt.prototype={areaStart:Ze,areaEnd:Ze,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._x2=ze,this._y2=tt;break;case 1:this._point=2,this._x3=ze,this._y3=tt;break;case 2:this._point=3,this._x4=ze,this._y4=tt,this._context.moveTo((this._x0+4*this._x1+ze)/6,(this._y0+4*this._y1+tt)/6);break;default:Ke(this,ze,tt);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=tt}};function mt(ze){return new Pt(ze)}function Mt(ze){this._context=ze}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var ct=(this._x0+4*this._x1+ze)/6,wt=(this._y0+4*this._y1+tt)/6;this._line?this._context.lineTo(ct,wt):this._context.moveTo(ct,wt);break;case 3:this._point=4;default:Ke(this,ze,tt);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=tt}};function lt(ze){return new Mt(ze)}function qe(ze,tt){this._basis=new vt(ze),this._beta=tt}qe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var ze=this._x,tt=this._y,ct=ze.length-1;if(ct>0)for(var wt=ze[0],Nt=tt[0],It=ze[ct]-wt,Zt=tt[ct]-Nt,qt=-1,vr;++qt<=ct;)vr=qt/ct,this._basis.point(this._beta*ze[qt]+(1-this._beta)*(wt+vr*It),this._beta*tt[qt]+(1-this._beta)*(Nt+vr*Zt));this._x=this._y=null,this._basis.lineEnd()},point:function(ze,tt){this._x.push(+ze),this._y.push(+tt)}};var Ye=(function ze(tt){function ct(wt){return tt===1?new vt(wt):new qe(wt,tt)}return ct.beta=function(wt){return ze(+wt)},ct})(.85);function me(ze,tt,ct){ze._context.bezierCurveTo(ze._x1+ze._k*(ze._x2-ze._x0),ze._y1+ze._k*(ze._y2-ze._y0),ze._x2+ze._k*(ze._x1-tt),ze._y2+ze._k*(ze._y1-ct),ze._x2,ze._y2)}function _e(ze,tt){this._context=ze,this._k=(1-tt)/6}_e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:me(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2,this._x1=ze,this._y1=tt;break;case 2:this._point=3;default:me(this,ze,tt);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var Ae=(function ze(tt){function ct(wt){return new _e(wt,tt)}return ct.tension=function(wt){return ze(+wt)},ct})(0);function ke(ze,tt){this._context=ze,this._k=(1-tt)/6}ke.prototype={areaStart:Ze,areaEnd:Ze,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._x3=ze,this._y3=tt;break;case 1:this._point=2,this._context.moveTo(this._x4=ze,this._y4=tt);break;case 2:this._point=3,this._x5=ze,this._y5=tt;break;default:me(this,ze,tt);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var Ee=(function ze(tt){function ct(wt){return new ke(wt,tt)}return ct.tension=function(wt){return ze(+wt)},ct})(0);function De(ze,tt){this._context=ze,this._k=(1-tt)/6}De.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:me(this,ze,tt);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var Je=(function ze(tt){function ct(wt){return new De(wt,tt)}return ct.tension=function(wt){return ze(+wt)},ct})(0);function Ue(ze,tt,ct){var wt=ze._x1,Nt=ze._y1,It=ze._x2,Zt=ze._y2;if(ze._l01_a>h){var qt=2*ze._l01_2a+3*ze._l01_a*ze._l12_a+ze._l12_2a,vr=3*ze._l01_a*(ze._l01_a+ze._l12_a);wt=(wt*qt-ze._x0*ze._l12_2a+ze._x2*ze._l01_2a)/vr,Nt=(Nt*qt-ze._y0*ze._l12_2a+ze._y2*ze._l01_2a)/vr}if(ze._l23_a>h){var Br=2*ze._l23_2a+3*ze._l23_a*ze._l12_a+ze._l12_2a,Pr=3*ze._l23_a*(ze._l23_a+ze._l12_a);It=(It*Br+ze._x1*ze._l23_2a-tt*ze._l12_2a)/Pr,Zt=(Zt*Br+ze._y1*ze._l23_2a-ct*ze._l12_2a)/Pr}ze._context.bezierCurveTo(wt,Nt,It,Zt,ze._x2,ze._y2)}function at(ze,tt){this._context=ze,this._alpha=tt}at.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){if(ze=+ze,tt=+tt,this._point){var ct=this._x2-ze,wt=this._y2-tt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(ct*ct+wt*wt,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2;break;case 2:this._point=3;default:Ue(this,ze,tt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var rt=(function ze(tt){function ct(wt){return tt?new at(wt,tt):new _e(wt,0)}return ct.alpha=function(wt){return ze(+wt)},ct})(.5);function ft(ze,tt){this._context=ze,this._alpha=tt}ft.prototype={areaStart:Ze,areaEnd:Ze,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(ze,tt){if(ze=+ze,tt=+tt,this._point){var ct=this._x2-ze,wt=this._y2-tt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(ct*ct+wt*wt,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=ze,this._y3=tt;break;case 1:this._point=2,this._context.moveTo(this._x4=ze,this._y4=tt);break;case 2:this._point=3,this._x5=ze,this._y5=tt;break;default:Ue(this,ze,tt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var At=(function ze(tt){function ct(wt){return tt?new ft(wt,tt):new ke(wt,0)}return ct.alpha=function(wt){return ze(+wt)},ct})(.5);function ht(ze,tt){this._context=ze,this._alpha=tt}ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){if(ze=+ze,tt=+tt,this._point){var ct=this._x2-ze,wt=this._y2-tt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(ct*ct+wt*wt,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ue(this,ze,tt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var Gt=(function ze(tt){function ct(wt){return tt?new ht(wt,tt):new De(wt,0)}return ct.alpha=function(wt){return ze(+wt)},ct})(.5);function fr(ze){this._context=ze}fr.prototype={areaStart:Ze,areaEnd:Ze,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(ze,tt){ze=+ze,tt=+tt,this._point?this._context.lineTo(ze,tt):(this._point=1,this._context.moveTo(ze,tt))}};function gt(ze){return new fr(ze)}function yt(ze){return ze<0?-1:1}function kt(ze,tt,ct){var wt=ze._x1-ze._x0,Nt=tt-ze._x1,It=(ze._y1-ze._y0)/(wt||Nt<0&&-0),Zt=(ct-ze._y1)/(Nt||wt<0&&-0),qt=(It*Nt+Zt*wt)/(wt+Nt);return(yt(It)+yt(Zt))*Math.min(Math.abs(It),Math.abs(Zt),.5*Math.abs(qt))||0}function Lt(ze,tt){var ct=ze._x1-ze._x0;return ct?(3*(ze._y1-ze._y0)/ct-tt)/2:tt}function Ct(ze,tt,ct){var wt=ze._x0,Nt=ze._y0,It=ze._x1,Zt=ze._y1,qt=(It-wt)/3;ze._context.bezierCurveTo(wt+qt,Nt+qt*tt,It-qt,Zt-qt*ct,It,Zt)}function $t(ze){this._context=ze}$t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ct(this,this._t0,Lt(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){var ct=NaN;if(ze=+ze,tt=+tt,!(ze===this._x1&&tt===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2;break;case 2:this._point=3,Ct(this,Lt(this,ct=kt(this,ze,tt)),ct);break;default:Ct(this,this._t0,ct=kt(this,ze,tt));break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=tt,this._t0=ct}}};function mr(ze){this._context=new br(ze)}(mr.prototype=Object.create($t.prototype)).point=function(ze,tt){$t.prototype.point.call(this,tt,ze)};function br(ze){this._context=ze}br.prototype={moveTo:function(ze,tt){this._context.moveTo(tt,ze)},closePath:function(){this._context.closePath()},lineTo:function(ze,tt){this._context.lineTo(tt,ze)},bezierCurveTo:function(ze,tt,ct,wt,Nt,It){this._context.bezierCurveTo(tt,ze,wt,ct,It,Nt)}};function Er(ze){return new $t(ze)}function Tr(ze){return new mr(ze)}function Ur(ze){this._context=ze}Ur.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var ze=this._x,tt=this._y,ct=ze.length;if(ct)if(this._line?this._context.lineTo(ze[0],tt[0]):this._context.moveTo(ze[0],tt[0]),ct===2)this._context.lineTo(ze[1],tt[1]);else for(var wt=Ai(ze),Nt=Ai(tt),It=0,Zt=1;Zt=0;--tt)Nt[tt]=(Zt[tt]-Nt[tt+1])/It[tt];for(It[ct-1]=(ze[ct]+Nt[ct-1])/2,tt=0;tt=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,tt),this._context.lineTo(ze,tt);else{var ct=this._x*(1-this._t)+ze*this._t;this._context.lineTo(ct,this._y),this._context.lineTo(ct,tt)}break}}this._x=ze,this._y=tt}};function ea(ze){return new Qr(ze,.5)}function $i(ze){return new Qr(ze,0)}function ja(ze){return new Qr(ze,1)}function ya(ze,tt){if((Zt=ze.length)>1)for(var ct=1,wt,Nt,It=ze[tt[0]],Zt,qt=It.length;ct=0;)ct[tt]=tt;return ct}function xi(ze,tt){return ze[tt]}function bi(){var ze=a([]),tt=pa,ct=ya,wt=xi;function Nt(It){var Zt=ze.apply(this,arguments),qt,vr=It.length,Br=Zt.length,Pr=new Array(Br),Mi;for(qt=0;qt0){for(var ct,wt,Nt=0,It=ze[0].length,Zt;Nt0)for(var ct,wt=0,Nt,It,Zt,qt,vr,Br=ze[tt[0]].length;wt0?(Nt[0]=Zt,Nt[1]=Zt+=It):It<0?(Nt[1]=qt,Nt[0]=qt+=It):(Nt[0]=0,Nt[1]=It)}function pi(ze,tt){if((Nt=ze.length)>0){for(var ct=0,wt=ze[tt[0]],Nt,It=wt.length;ct0)||!((It=(Nt=ze[tt[0]]).length)>0))){for(var ct=0,wt=1,Nt,It,Zt;wtIt&&(It=Nt,ct=tt);return ct}function Et(ze){var tt=ze.map(St);return pa(ze).sort(function(ct,wt){return tt[ct]-tt[wt]})}function St(ze){for(var tt=0,ct=-1,wt=ze.length,Nt;++ct[D(xe,ye,le),xe]));for(let[xe,ye]of ce.entries()){ye.index=xe;let{source:fe,target:ae}=ye;typeof fe!="object"&&(fe=ye.source=_(pe,fe)),typeof ae!="object"&&(ae=ye.target=_(pe,ae)),fe.sourceLinks.push(ye),ae.targetLinks.push(ye)}if(z!=null)for(let{sourceLinks:xe,targetLinks:ye}of le)xe.sort(z),ye.sort(z)}function X({nodes:le}){for(let ce of le)ce.value=ce.fixedValue===void 0?Math.max(i.sum(ce.sourceLinks,p),i.sum(ce.targetLinks,p)):ce.fixedValue}function Z({nodes:le}){let ce=le.length,pe=new Set(le),xe=new Set,ye=0;for(;pe.size;){for(let fe of pe){fe.depth=ye;for(let{target:ae}of fe.sourceLinks)xe.add(ae)}if(++ye>ce)throw new Error("circular link");pe=xe,xe=new Set}}function J({nodes:le}){let ce=le.length,pe=new Set(le),xe=new Set,ye=0;for(;pe.size;){for(let fe of pe){fe.height=ye;for(let{source:ae}of fe.targetLinks)xe.add(ae)}if(++ye>ce)throw new Error("circular link");pe=xe,xe=new Set}}function N({nodes:le}){let ce=i.max(le,ye=>ye.depth)+1,pe=(A-w-E)/(ce-1),xe=new Array(ce);for(let ye of le){let fe=Math.max(0,Math.min(ce-1,Math.floor(R.call(null,ye,ce))));ye.layer=fe,ye.x0=w+fe*pe,ye.x1=ye.x0+E,xe[fe]?xe[fe].push(ye):xe[fe]=[ye]}if(P)for(let ye of xe)ye.sort(P);return xe}function H(le){let ce=i.min(le,pe=>(b-k-(pe.length-1)*F)/i.sum(pe,p));for(let pe of le){let xe=k;for(let ye of pe){ye.y0=xe,ye.y1=xe+ye.value*ce,xe=ye.y1+F;for(let fe of ye.sourceLinks)fe.width=fe.value*ce}xe=(b-xe+F)/(pe.length+1);for(let ye=0;yepe.length)-1)),H(ce);for(let pe=0;pe0))continue;let Q=(ee/ie-ae.y0)*ce;ae.y0+=Q,ae.y1+=Q,K(ae)}P===void 0&&fe.sort(d),j(fe,pe)}}function V(le,ce,pe){for(let xe=le.length,ye=xe-2;ye>=0;--ye){let fe=le[ye];for(let ae of fe){let ee=0,ie=0;for(let{target:ue,value:ge}of ae.sourceLinks){let Me=ge*(ue.layer-ae.layer);ee+=se(ae,ue)*Me,ie+=Me}if(!(ie>0))continue;let Q=(ee/ie-ae.y0)*ce;ae.y0+=Q,ae.y1+=Q,K(ae)}P===void 0&&fe.sort(d),j(fe,pe)}}function j(le,ce){let pe=le.length>>1,xe=le[pe];Y(le,xe.y0-F,pe-1,ce),q(le,xe.y1+F,pe+1,ce),Y(le,b,le.length-1,ce),q(le,k,0,ce)}function q(le,ce,pe,xe){for(;pe1e-6&&(ye.y0+=fe,ye.y1+=fe),ce=ye.y1+F}}function Y(le,ce,pe,xe){for(;pe>=0;--pe){let ye=le[pe],fe=(ye.y1-ce)*xe;fe>1e-6&&(ye.y0-=fe,ye.y1-=fe),ce=ye.y0-F}}function K({sourceLinks:le,targetLinks:ce}){if(z===void 0){for(let{source:{sourceLinks:pe}}of ce)pe.sort(h);for(let{target:{targetLinks:pe}}of le)pe.sort(f)}}function te(le){if(z===void 0)for(let{sourceLinks:ce,targetLinks:pe}of le)ce.sort(h),pe.sort(f)}function ne(le,ce){let pe=le.y0-(le.sourceLinks.length-1)*F/2;for(let{target:xe,width:ye}of le.sourceLinks){if(xe===ce)break;pe+=ye+F}for(let{source:xe,width:ye}of ce.targetLinks){if(xe===le)break;pe-=ye}return pe}function se(le,ce){let pe=ce.y0-(ce.targetLinks.length-1)*F/2;for(let{source:xe,width:ye}of ce.targetLinks){if(xe===le)break;pe+=ye+F}for(let{target:xe,width:ye}of le.sourceLinks){if(xe===ce)break;pe-=ye}return pe}return G}function S(w){return[w.source.x1,w.y0]}function M(w){return[w.target.x0,w.y1]}function C(){return a.linkHorizontal().source(S).target(M)}t.sankey=x,t.sankeyCenter=u,t.sankeyJustify=n,t.sankeyLeft=s,t.sankeyLinkHorizontal=C,t.sankeyRight=l,Object.defineProperty(t,"__esModule",{value:!0})})}}),vle=de({"node_modules/@plotly/d3-sankey-circular/node_modules/d3-array/dist/d3-array.js"(e,r){(function(t,i){i(typeof e=="object"&&typeof r<"u"?e:t.d3=t.d3||{})})(e,(function(t){"use strict";function i($,U){return $U?1:$>=U?0:NaN}function a($){return $.length===1&&($=o($)),{left:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)<0?j=Y+1:q=Y}return j},right:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)>0?q=Y:j=Y+1}return j}}}function o($){return function(U,V){return i($(U),V)}}var s=a(i),l=s.right,n=s.left;function u($,U){U==null&&(U=c);for(var V=0,j=$.length-1,q=$[0],Y=new Array(j<0?0:j);V$?1:U>=$?0:NaN}function d($){return $===null?NaN:+$}function p($,U){var V=$.length,j=0,q=-1,Y=0,K,te,ne=0;if(U==null)for(;++q1)return ne/(j-1)}function g($,U){var V=p($,U);return V&&Math.sqrt(V)}function m($,U){var V=$.length,j=-1,q,Y,K;if(U==null){for(;++j=q)for(Y=K=q;++jq&&(Y=q),K=q)for(Y=K=q;++jq&&(Y=q),K0)return[$];if((j=U<$)&&(Y=$,$=U,U=Y),(te=b($,U,V))===0||!isFinite(te))return[];if(te>0)for($=Math.ceil($/te),U=Math.floor(U/te),K=new Array(Y=Math.ceil(U-$+1));++q=0?(Y>=C?10:Y>=w?5:Y>=k?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(Y>=C?10:Y>=w?5:Y>=k?2:1)}function E($,U,V){var j=Math.abs(U-$)/Math.max(0,V),q=Math.pow(10,Math.floor(Math.log(j)/Math.LN10)),Y=j/q;return Y>=C?q*=10:Y>=w?q*=5:Y>=k&&(q*=2),U<$?-q:q}function T($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function F(){var $=S,U=m,V=T;function j(q){var Y,K=q.length,te,ne=new Array(K);for(Y=0;Yce;)pe.pop(),--xe;var ye=new Array(xe+1),fe;for(Y=0;Y<=xe;++Y)fe=ye[Y]=[],fe.x0=Y>0?pe[Y-1]:le,fe.x1=Y=1)return+V($[j-1],j-1,$);var j,q=(j-1)*U,Y=Math.floor(q),K=+V($[Y],Y,$),te=+V($[Y+1],Y+1,$);return K+(te-K)*(q-Y)}}function R($,U,V){return $=v.call($,d).sort(i),Math.ceil((V-U)/(2*(D($,.75)-D($,.25))*Math.pow($.length,-1/3)))}function P($,U,V){return Math.ceil((V-U)/(3.5*g($)*Math.pow($.length,-1/3)))}function z($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jY&&(Y=q)}else for(;++j=q)for(Y=q;++jY&&(Y=q);return Y}function I($,U){var V=$.length,j=V,q=-1,Y,K=0;if(U==null)for(;++q=0;)for(K=$[U],V=K.length;--V>=0;)Y[--q]=K[V];return Y}function O($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jq&&(Y=q)}else for(;++j=q)for(Y=q;++jq&&(Y=q);return Y}function G($,U){for(var V=U.length,j=new Array(V);V--;)j[V]=$[U[V]];return j}function W($,U){if(V=$.length){var V,j=0,q=0,Y,K=$[q];for(U==null&&(U=i);++j=M})}function m(M){g(M);for(var C=a,w=t(C),k=w.components.filter(function(R){return R.length>1}),A=1/0,b,E=0;E"u"?"undefined":d(_e))!=="object"&&(_e=Ye.source=w(qe,_e)),(typeof Ae>"u"?"undefined":d(Ae))!=="object"&&(Ae=Ye.target=w(qe,Ae)),_e.sourceLinks.push(Ye),Ae.targetLinks.push(Ye)}),lt}function Ke(lt){lt.nodes.forEach(function(qe){qe.partOfCycle=!1,qe.value=Math.max(i.sum(qe.sourceLinks,y),i.sum(qe.targetLinks,y)),qe.sourceLinks.forEach(function(Ye){Ye.circular&&(qe.partOfCycle=!0,qe.circularLinkType=Ye.circularLinkType)}),qe.targetLinks.forEach(function(Ye){Ye.circular&&(qe.partOfCycle=!0,qe.circularLinkType=Ye.circularLinkType)})})}function vt(lt){var qe=0,Ye=0,me=0,_e=0,Ae=i.max(lt.nodes,function(ke){return ke.column});return lt.links.forEach(function(ke){ke.circular&&(ke.circularLinkType=="top"?qe=qe+ke.width:Ye=Ye+ke.width,ke.target.column==0&&(_e=_e+ke.width),ke.source.column==Ae&&(me=me+ke.width))}),qe=qe>0?qe+A+b:qe,Ye=Ye>0?Ye+A+b:Ye,me=me>0?me+A+b:me,_e=_e>0?_e+A+b:_e,{top:qe,bottom:Ye,left:_e,right:me}}function xt(lt,qe){var Ye=i.max(lt.nodes,function(Je){return Je.column}),me=xe-ce,_e=ye-pe,Ae=me+qe.right+qe.left,ke=_e+qe.top+qe.bottom,Ee=me/Ae,De=_e/ke;return ce=ce*Ee+qe.left,xe=qe.right==0?xe:xe*Ee,pe=pe*De+qe.top,ye=ye*De,lt.nodes.forEach(function(Je){Je.x0=ce+Je.column*((xe-ce-fe)/Ye),Je.x1=Je.x0+fe}),De}function Pt(lt){var qe,Ye,me;for(qe=lt.nodes,Ye=[],me=0;qe.length;++me,qe=Ye,Ye=[])qe.forEach(function(_e){_e.depth=me,_e.sourceLinks.forEach(function(Ae){Ye.indexOf(Ae.target)<0&&!Ae.circular&&Ye.push(Ae.target)})});for(qe=lt.nodes,Ye=[],me=0;qe.length;++me,qe=Ye,Ye=[])qe.forEach(function(_e){_e.height=me,_e.targetLinks.forEach(function(Ae){Ye.indexOf(Ae.source)<0&&!Ae.circular&&Ye.push(Ae.source)})});lt.nodes.forEach(function(_e){_e.column=Math.floor(ie.call(null,_e,me))})}function mt(lt,qe,Ye){var me=a.nest().key(function(Je){return Je.column}).sortKeys(i.ascending).entries(lt.nodes).map(function(Je){return Je.values});ke(Ye),De();for(var _e=1,Ae=qe;Ae>0;--Ae)Ee(_e*=.99,Ye),De();function ke(Je){if(Te){var Ue=1/0;me.forEach(function(At){var ht=ye*Te/(At.length+1);Ue=ht0))if(At==0&&ft==1)Gt=ht.y1-ht.y0,ht.y0=ye/2-Gt/2,ht.y1=ye/2+Gt/2;else if(At==at-1&&ft==1)Gt=ht.y1-ht.y0,ht.y0=ye/2-Gt/2,ht.y1=ye/2+Gt/2;else{var fr=0,gt=i.mean(ht.sourceLinks,x),yt=i.mean(ht.targetLinks,v);gt&&yt?fr=(gt+yt)/2:fr=gt||yt;var kt=(fr-_(ht))*Je;ht.y0+=kt,ht.y1+=kt}})})}function De(){me.forEach(function(Je){var Ue,at,rt=pe,ft=Je.length,At;for(Je.sort(m),At=0;At0&&(Ue.y0+=at,Ue.y1+=at),rt=Ue.y1+ae;if(at=rt-ae-ye,at>0)for(rt=Ue.y0-=at,Ue.y1-=at,At=ft-2;At>=0;--At)Ue=Je[At],at=Ue.y1+ae-rt,at>0&&(Ue.y0-=at,Ue.y1-=at),rt=Ue.y0})}}function Mt(lt){lt.nodes.forEach(function(qe){qe.sourceLinks.sort(g),qe.targetLinks.sort(p)}),lt.nodes.forEach(function(qe){var Ye=qe.y0,me=Ye,_e=qe.y1,Ae=_e;qe.sourceLinks.forEach(function(ke){ke.circular?(ke.y0=_e-ke.width/2,_e=_e-ke.width):(ke.y0=Ye+ke.width/2,Ye+=ke.width)}),qe.targetLinks.forEach(function(ke){ke.circular?(ke.y1=Ae-ke.width/2,Ae=Ae-ke.width):(ke.y1=me+ke.width/2,me+=ke.width)})})}return Ve}function F(ce,pe,xe){var ye=0;if(xe===null){for(var fe=[],ae=0;aepe.source.column)}function z(ce,pe){var xe=0;ce.sourceLinks.forEach(function(fe){xe=fe.circular&&!se(fe,pe)?xe+1:xe});var ye=0;return ce.targetLinks.forEach(function(fe){ye=fe.circular&&!se(fe,pe)?ye+1:ye}),xe+ye}function I(ce){var pe=ce.source.sourceLinks,xe=0;pe.forEach(function(ae){xe=ae.circular?xe+1:xe});var ye=ce.target.targetLinks,fe=0;return ye.forEach(function(ae){fe=ae.circular?fe+1:fe}),!(xe>1||fe>1)}function L(ce,pe,xe){return ce.sort(G),ce.forEach(function(ye,fe){var ae=0;if(se(ye,xe)&&I(ye))ye.circularPathData.verticalBuffer=ae+ye.width/2;else{var ee=0;for(ee;eeae?ie:ae}ye.circularPathData.verticalBuffer=ae+ye.width/2}}),ce}function B(ce,pe,xe,ye){var fe=5,ae=i.min(ce.links,function(Q){return Q.source.y0});ce.links.forEach(function(Q){Q.circular&&(Q.circularPathData={})});var ee=ce.links.filter(function(Q){return Q.circularLinkType=="top"});L(ee,pe,ye);var ie=ce.links.filter(function(Q){return Q.circularLinkType=="bottom"});L(ie,pe,ye),ce.links.forEach(function(Q){if(Q.circular){if(Q.circularPathData.arcRadius=Q.width+b,Q.circularPathData.leftNodeBuffer=fe,Q.circularPathData.rightNodeBuffer=fe,Q.circularPathData.sourceWidth=Q.source.x1-Q.source.x0,Q.circularPathData.sourceX=Q.source.x0+Q.circularPathData.sourceWidth,Q.circularPathData.targetX=Q.target.x0,Q.circularPathData.sourceY=Q.y0,Q.circularPathData.targetY=Q.y1,se(Q,ye)&&I(Q))Q.circularPathData.leftSmallArcRadius=b+Q.width/2,Q.circularPathData.leftLargeArcRadius=b+Q.width/2,Q.circularPathData.rightSmallArcRadius=b+Q.width/2,Q.circularPathData.rightLargeArcRadius=b+Q.width/2,Q.circularLinkType=="bottom"?(Q.circularPathData.verticalFullExtent=Q.source.y1+A+Q.circularPathData.verticalBuffer,Q.circularPathData.verticalLeftInnerExtent=Q.circularPathData.verticalFullExtent-Q.circularPathData.leftLargeArcRadius,Q.circularPathData.verticalRightInnerExtent=Q.circularPathData.verticalFullExtent-Q.circularPathData.rightLargeArcRadius):(Q.circularPathData.verticalFullExtent=Q.source.y0-A-Q.circularPathData.verticalBuffer,Q.circularPathData.verticalLeftInnerExtent=Q.circularPathData.verticalFullExtent+Q.circularPathData.leftLargeArcRadius,Q.circularPathData.verticalRightInnerExtent=Q.circularPathData.verticalFullExtent+Q.circularPathData.rightLargeArcRadius);else{var ue=Q.source.column,ge=Q.circularLinkType,Me=ce.links.filter(function(Ve){return Ve.source.column==ue&&Ve.circularLinkType==ge});Q.circularLinkType=="bottom"?Me.sort(X):Me.sort(W);var Te=0;Me.forEach(function(Ve,Ze){Ve.circularLinkID==Q.circularLinkID&&(Q.circularPathData.leftSmallArcRadius=b+Q.width/2+Te,Q.circularPathData.leftLargeArcRadius=b+Q.width/2+Ze*pe+Te),Te=Te+Ve.width}),ue=Q.target.column,Me=ce.links.filter(function(Ve){return Ve.target.column==ue&&Ve.circularLinkType==ge}),Q.circularLinkType=="bottom"?Me.sort(J):Me.sort(Z),Te=0,Me.forEach(function(Ve,Ze){Ve.circularLinkID==Q.circularLinkID&&(Q.circularPathData.rightSmallArcRadius=b+Q.width/2+Te,Q.circularPathData.rightLargeArcRadius=b+Q.width/2+Ze*pe+Te),Te=Te+Ve.width}),Q.circularLinkType=="bottom"?(Q.circularPathData.verticalFullExtent=Math.max(xe,Q.source.y1,Q.target.y1)+A+Q.circularPathData.verticalBuffer,Q.circularPathData.verticalLeftInnerExtent=Q.circularPathData.verticalFullExtent-Q.circularPathData.leftLargeArcRadius,Q.circularPathData.verticalRightInnerExtent=Q.circularPathData.verticalFullExtent-Q.circularPathData.rightLargeArcRadius):(Q.circularPathData.verticalFullExtent=ae-A-Q.circularPathData.verticalBuffer,Q.circularPathData.verticalLeftInnerExtent=Q.circularPathData.verticalFullExtent+Q.circularPathData.leftLargeArcRadius,Q.circularPathData.verticalRightInnerExtent=Q.circularPathData.verticalFullExtent+Q.circularPathData.rightLargeArcRadius)}Q.circularPathData.leftInnerExtent=Q.circularPathData.sourceX+Q.circularPathData.leftNodeBuffer,Q.circularPathData.rightInnerExtent=Q.circularPathData.targetX-Q.circularPathData.rightNodeBuffer,Q.circularPathData.leftFullExtent=Q.circularPathData.sourceX+Q.circularPathData.leftLargeArcRadius+Q.circularPathData.leftNodeBuffer,Q.circularPathData.rightFullExtent=Q.circularPathData.targetX-Q.circularPathData.rightLargeArcRadius-Q.circularPathData.rightNodeBuffer}if(Q.circular)Q.path=O(Q);else{var je=o.linkHorizontal().source(function(Ve){var Ze=Ve.source.x0+(Ve.source.x1-Ve.source.x0),Ke=Ve.y0;return[Ze,Ke]}).target(function(Ve){var Ze=Ve.target.x0,Ke=Ve.y1;return[Ze,Ke]});Q.path=je(Q)}})}function O(ce){var pe="";return ce.circularLinkType=="top"?pe="M"+ce.circularPathData.sourceX+" "+ce.circularPathData.sourceY+" L"+ce.circularPathData.leftInnerExtent+" "+ce.circularPathData.sourceY+" A"+ce.circularPathData.leftLargeArcRadius+" "+ce.circularPathData.leftSmallArcRadius+" 0 0 0 "+ce.circularPathData.leftFullExtent+" "+(ce.circularPathData.sourceY-ce.circularPathData.leftSmallArcRadius)+" L"+ce.circularPathData.leftFullExtent+" "+ce.circularPathData.verticalLeftInnerExtent+" A"+ce.circularPathData.leftLargeArcRadius+" "+ce.circularPathData.leftLargeArcRadius+" 0 0 0 "+ce.circularPathData.leftInnerExtent+" "+ce.circularPathData.verticalFullExtent+" L"+ce.circularPathData.rightInnerExtent+" "+ce.circularPathData.verticalFullExtent+" A"+ce.circularPathData.rightLargeArcRadius+" "+ce.circularPathData.rightLargeArcRadius+" 0 0 0 "+ce.circularPathData.rightFullExtent+" "+ce.circularPathData.verticalRightInnerExtent+" L"+ce.circularPathData.rightFullExtent+" "+(ce.circularPathData.targetY-ce.circularPathData.rightSmallArcRadius)+" A"+ce.circularPathData.rightLargeArcRadius+" "+ce.circularPathData.rightSmallArcRadius+" 0 0 0 "+ce.circularPathData.rightInnerExtent+" "+ce.circularPathData.targetY+" L"+ce.circularPathData.targetX+" "+ce.circularPathData.targetY:pe="M"+ce.circularPathData.sourceX+" "+ce.circularPathData.sourceY+" L"+ce.circularPathData.leftInnerExtent+" "+ce.circularPathData.sourceY+" A"+ce.circularPathData.leftLargeArcRadius+" "+ce.circularPathData.leftSmallArcRadius+" 0 0 1 "+ce.circularPathData.leftFullExtent+" "+(ce.circularPathData.sourceY+ce.circularPathData.leftSmallArcRadius)+" L"+ce.circularPathData.leftFullExtent+" "+ce.circularPathData.verticalLeftInnerExtent+" A"+ce.circularPathData.leftLargeArcRadius+" "+ce.circularPathData.leftLargeArcRadius+" 0 0 1 "+ce.circularPathData.leftInnerExtent+" "+ce.circularPathData.verticalFullExtent+" L"+ce.circularPathData.rightInnerExtent+" "+ce.circularPathData.verticalFullExtent+" A"+ce.circularPathData.rightLargeArcRadius+" "+ce.circularPathData.rightLargeArcRadius+" 0 0 1 "+ce.circularPathData.rightFullExtent+" "+ce.circularPathData.verticalRightInnerExtent+" L"+ce.circularPathData.rightFullExtent+" "+(ce.circularPathData.targetY+ce.circularPathData.rightSmallArcRadius)+" A"+ce.circularPathData.rightLargeArcRadius+" "+ce.circularPathData.rightSmallArcRadius+" 0 0 1 "+ce.circularPathData.rightInnerExtent+" "+ce.circularPathData.targetY+" L"+ce.circularPathData.targetX+" "+ce.circularPathData.targetY,pe}function G(ce,pe){return N(ce)==N(pe)?ce.circularLinkType=="bottom"?X(ce,pe):W(ce,pe):N(pe)-N(ce)}function W(ce,pe){return ce.y0-pe.y0}function X(ce,pe){return pe.y0-ce.y0}function Z(ce,pe){return ce.y1-pe.y1}function J(ce,pe){return pe.y1-ce.y1}function N(ce){return ce.target.column-ce.source.column}function H(ce){return ce.target.x0-ce.source.x1}function $(ce,pe){var xe=R(ce),ye=H(pe)/Math.tan(xe),fe=ne(ce)=="up"?ce.y1+ye:ce.y1-ye;return fe}function U(ce,pe){var xe=R(ce),ye=H(pe)/Math.tan(xe),fe=ne(ce)=="up"?ce.y1-ye:ce.y1+ye;return fe}function V(ce,pe,xe,ye){ce.links.forEach(function(fe){if(!fe.circular&&fe.target.column-fe.source.column>1){var ae=fe.source.column+1,ee=fe.target.column-1,ie=1,Q=ee-ae+1;for(ie=1;ae<=ee;ae++,ie++)ce.nodes.forEach(function(ue){if(ue.column==ae){var ge=ie/(Q+1),Me=Math.pow(1-ge,3),Te=3*ge*Math.pow(1-ge,2),je=3*Math.pow(ge,2)*(1-ge),Ve=Math.pow(ge,3),Ze=Me*fe.y0+Te*fe.y0+je*fe.y1+Ve*fe.y1,Ke=Ze-fe.width/2,vt=Ze+fe.width/2,xt;Ke>ue.y0&&Keue.y0&&vtue.y1&&q(Pt,xt,pe,xe)})):Keue.y1&&(xt=vt-ue.y0+10,ue=q(ue,xt,pe,xe),ce.nodes.forEach(function(Pt){k(Pt,ye)==k(ue,ye)||Pt.column!=ue.column||Pt.y0ue.y1&&q(Pt,xt,pe,xe)}))}})}})}function j(ce,pe){return ce.y0>pe.y0&&ce.y0pe.y0&&ce.y1pe.y1}function q(ce,pe,xe,ye){return ce.y0+pe>=xe&&ce.y1+pe<=ye&&(ce.y0=ce.y0+pe,ce.y1=ce.y1+pe,ce.targetLinks.forEach(function(fe){fe.y1=fe.y1+pe}),ce.sourceLinks.forEach(function(fe){fe.y0=fe.y0+pe})),ce}function Y(ce,pe,xe,ye){ce.nodes.forEach(function(fe){ye&&fe.y+(fe.y1-fe.y0)>pe&&(fe.y=fe.y-(fe.y+(fe.y1-fe.y0)-pe));var ae=ce.links.filter(function(Q){return k(Q.source,xe)==k(fe,xe)}),ee=ae.length;ee>1&&ae.sort(function(Q,ue){if(!Q.circular&&!ue.circular){if(Q.target.column==ue.target.column)return Q.y1-ue.y1;if(te(Q,ue)){if(Q.target.column>ue.target.column){var ge=U(ue,Q);return Q.y1-ge}if(ue.target.column>Q.target.column){var Me=U(Q,ue);return Me-ue.y1}}else return Q.y1-ue.y1}if(Q.circular&&!ue.circular)return Q.circularLinkType=="top"?-1:1;if(ue.circular&&!Q.circular)return ue.circularLinkType=="top"?1:-1;if(Q.circular&&ue.circular)return Q.circularLinkType===ue.circularLinkType&&Q.circularLinkType=="top"?Q.target.column===ue.target.column?Q.target.y1-ue.target.y1:ue.target.column-Q.target.column:Q.circularLinkType===ue.circularLinkType&&Q.circularLinkType=="bottom"?Q.target.column===ue.target.column?ue.target.y1-Q.target.y1:Q.target.column-ue.target.column:Q.circularLinkType=="top"?-1:1});var ie=fe.y0;ae.forEach(function(Q){Q.y0=ie+Q.width/2,ie=ie+Q.width}),ae.forEach(function(Q,ue){if(Q.circularLinkType=="bottom"){var ge=ue+1,Me=0;for(ge;ge1&&fe.sort(function(ie,Q){if(!ie.circular&&!Q.circular){if(ie.source.column==Q.source.column)return ie.y0-Q.y0;if(te(ie,Q)){if(Q.source.column0?"up":"down"}function se(ce,pe){return k(ce.source,pe)==k(ce.target,pe)}function le(ce,pe,xe){var ye=ce.nodes,fe=ce.links,ae=!1,ee=!1;if(fe.forEach(function(Te){Te.circularLinkType=="top"?ae=!0:Te.circularLinkType=="bottom"&&(ee=!0)}),ae==!1||ee==!1){var ie=i.min(ye,function(Te){return Te.y0}),Q=i.max(ye,function(Te){return Te.y1}),ue=Q-ie,ge=xe-pe,Me=ge/ue;ye.forEach(function(Te){var je=(Te.y1-Te.y0)*Me;Te.y0=(Te.y0-ie)*Me,Te.y1=Te.y0+je}),fe.forEach(function(Te){Te.y0=(Te.y0-ie)*Me,Te.y1=(Te.y1-ie)*Me,Te.width=Te.width*Me})}}t.sankeyCircular=T,t.sankeyCenter=f,t.sankeyLeft=n,t.sankeyRight=u,t.sankeyJustify=c,Object.defineProperty(t,"__esModule",{value:!0})}))}}),V8=de({"src/traces/sankey/constants.js"(e,r){"use strict";r.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),yle=de({"src/traces/sankey/render.js"(e,r){"use strict";var t=fle(),i=(jv(),ti(M0)).interpolateNumber,a=Yr(),o=ple(),s=gle(),l=V8(),n=ta(),u=hn(),c=Qt(),f=c.strTranslate,h=c.strRotate,d=ip(),p=d.keyFun,g=d.repeat,m=d.unwrap,y=Zo(),_=Ma(),v=Bl(),x=v.CAP_SHIFT,S=v.LINE_SPACING,M=3;function C(H,$,U){var V=m($),j=V.trace,q=j.domain,Y=j.orientation==="h",K=j.direction==="reversed",te=j.node.pad,ne=j.node.thickness,se={justify:o.sankeyJustify,left:o.sankeyLeft,right:o.sankeyRight,center:o.sankeyCenter}[j.node.align],le=H.width*(q.x[1]-q.x[0]),ce=H.height*(q.y[1]-q.y[0]),pe=V._nodes,xe=V._links,ye=V.circular,fe;ye?fe=s.sankeyCircular().circularLinkGap(0):fe=o.sankey(),fe.iterations(l.sankeyIterations).size(Y?[le,ce]:[ce,le]).nodeWidth(ne).nodePadding(te).nodeId(function(mt){return mt.pointNumber}).nodeAlign(se).nodes(pe).links(xe);function ae(mt){j[mt].sort==="input"&&(ye?c.warn(`Circular Sankey diagrams do not support the "input" ${mt}.sort mode; falling back to the default sort.`):fe[`${mt}Sort`](null))}ae("link"),ae("node");var ee=fe();fe.nodePadding()=Ye||(qe=Ye-lt.y0,qe>1e-6&&(lt.y0+=qe,lt.y1+=qe)),Ye=lt.y1+te})}function Ke(mt){var Mt=mt.map(function(ke,Ee){return{x0:ke.x0,index:Ee}}).sort(function(ke,Ee){return ke.x0-Ee.x0}),lt=[],qe=-1,Ye,me=-1/0,_e;for(ie=0;ieme+ne&&(qe+=1,Ye=Ae.x0),me=Ae.x0,lt[qe]||(lt[qe]=[]),lt[qe].push(Ae),_e=Ye-Ae.x0,Ae.x0+=_e,Ae.x1+=_e}return lt}if(j.node.x.length&&j.node.y.length){for(ie=0;ie0?" L "+j.targetX+" "+j.targetY:"")+"Z"):(U="M "+(j.targetX-$)+" "+(j.targetY-V)+" L "+(j.rightInnerExtent-$)+" "+(j.targetY-V)+" A "+(j.rightLargeArcRadius+V)+" "+(j.rightSmallArcRadius+V)+" 0 0 0 "+(j.rightFullExtent-V-$)+" "+(j.targetY+j.rightSmallArcRadius)+" L "+(j.rightFullExtent-V-$)+" "+j.verticalRightInnerExtent,q&&Y?U+=" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.rightInnerExtent-V-$)+" "+(j.verticalFullExtent+V)+" L "+(j.rightFullExtent+V-$-(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent+V)+" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.leftFullExtent+V)+" "+j.verticalLeftInnerExtent:q?U+=" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.rightFullExtent-$-V-(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent-V)+" L "+(j.leftFullExtent+V+(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent-V)+" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.leftFullExtent+V)+" "+j.verticalLeftInnerExtent:U+=" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.rightInnerExtent-$)+" "+(j.verticalFullExtent+V)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent+V)+" A "+(j.leftLargeArcRadius+V)+" "+(j.leftLargeArcRadius+V)+" 0 0 0 "+(j.leftFullExtent+V)+" "+j.verticalLeftInnerExtent,U+=" L "+(j.leftFullExtent+V)+" "+(j.sourceY+j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+V)+" "+(j.leftSmallArcRadius+V)+" 0 0 0 "+j.leftInnerExtent+" "+(j.sourceY-V)+" L "+j.sourceX+" "+(j.sourceY-V)+" L "+j.sourceX+" "+(j.sourceY+V)+" L "+j.leftInnerExtent+" "+(j.sourceY+V)+" A "+(j.leftLargeArcRadius-V)+" "+(j.leftSmallArcRadius-V)+" 0 0 1 "+(j.leftFullExtent-V)+" "+(j.sourceY+j.leftSmallArcRadius)+" L "+(j.leftFullExtent-V)+" "+j.verticalLeftInnerExtent,q&&Y?U+=" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.leftFullExtent-V-(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent-V)+" L "+(j.rightFullExtent+V-$+(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent-V)+" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.rightFullExtent+V-$)+" "+j.verticalRightInnerExtent:q?U+=" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.leftFullExtent+V)+" "+(j.verticalFullExtent+V)+" L "+(j.rightFullExtent-$-V)+" "+(j.verticalFullExtent+V)+" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.rightFullExtent+V-$)+" "+j.verticalRightInnerExtent:U+=" A "+(j.leftLargeArcRadius-V)+" "+(j.leftLargeArcRadius-V)+" 0 0 1 "+j.leftInnerExtent+" "+(j.verticalFullExtent-V)+" L "+(j.rightInnerExtent-$)+" "+(j.verticalFullExtent-V)+" A "+(j.rightLargeArcRadius-V)+" "+(j.rightLargeArcRadius-V)+" 0 0 1 "+(j.rightFullExtent+V-$)+" "+j.verticalRightInnerExtent,U+=" L "+(j.rightFullExtent+V-$)+" "+(j.targetY+j.rightSmallArcRadius)+" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.rightInnerExtent-$)+" "+(j.targetY+V)+" L "+(j.targetX-$)+" "+(j.targetY+V)+($>0?" L "+j.targetX+" "+j.targetY:"")+"Z"),U}function A(){var H=.5;function $(U){var V=U.linkArrowLength;if(U.link.circular)return k(U.link,V);var j=Math.abs((U.link.target.x0-U.link.source.x1)/2);V>j&&(V=j);var q=U.link.source.x1,Y=U.link.target.x0-V,K=i(q,Y),te=K(H),ne=K(1-H),se=U.link.y0-U.link.width/2,le=U.link.y0+U.link.width/2,ce=U.link.y1-U.link.width/2,pe=U.link.y1+U.link.width/2,xe="M"+q+","+se,ye="C"+te+","+se+" "+ne+","+ce+" "+Y+","+ce,fe="C"+ne+","+pe+" "+te+","+le+" "+q+","+le,ae=V>0?"L"+(Y+V)+","+(ce+U.link.width/2):"";return ae+="L"+Y+","+pe,xe+ye+ae+fe+"Z"}return $}function b(H,$){var U=l.nodePadAcross,V=H.nodePad/2;$.dx=$.x1-$.x0,$.dy=$.y1-$.y0;var j=$.dx,q=Math.max(.5,$.dy),Y="node_"+$.pointNumber;return $.group&&(Y=c.randstr()),$.trace=H.trace,$.curveNumber=H.trace.index,{index:$.pointNumber,key:Y,partOfGroup:$.partOfGroup||!1,group:$.group,traceId:H.key,trace:H.trace,node:$,nodePad:H.nodePad,nodeLineColor:H.nodeLineColor,nodeLineWidth:H.nodeLineWidth,textFont:H.textFont,size:H.horizontal?H.height:H.width,visibleWidth:Math.ceil(j),visibleHeight:q,zoneX:-U,zoneY:-V,zoneWidth:j+2*U,zoneHeight:q+2*V,labelY:H.horizontal?$.dy/2+1:$.dx/2+1,left:$.originalLayer===1,sizeAcross:H.width,forceLayouts:H.forceLayouts,horizontal:H.horizontal,reversed:H.reversed,rgb:n.rgb($.color),alpha:n.parse($.color).alpha,valueFormat:H.valueFormat,valueSuffix:H.valueSuffix,sankey:H.sankey,graph:H.graph,arrangement:H.arrangement,uniqueNodeLabelPathId:[H.guid,H.key,Y].join("_"),interactionState:H.interactionState,figure:H}}function E(H){H.attr("transform",function($){return f($.node.x0.toFixed(3),$.node.y0.toFixed(3))})}function T(H){H.call(E)}function F(H,$){H.call(T),$.attr("d",A())}function D(H){H.attr("width",function($){return $.node.x1-$.node.x0}).attr("height",function($){return $.visibleHeight})}function R(H){return H.link.width>1||H.linkLineWidth>0}function P(H){return H.horizontal?H.reversed?f(H.translateX+H.width,H.translateY)+"matrix(-1 0 0 1 0 0)":f(H.translateX,H.translateY)+"matrix(1 0 0 1 0 0)":H.reversed?f(H.translateX,H.translateY+H.height)+"matrix(0 -1 1 0 0 0)":f(H.translateX,H.translateY)+"matrix(0 1 1 0 0 0)"}function z(H,$,U){H.on(".basic",null).on("mouseover.basic",function(V){!V.interactionState.dragInProgress&&!V.partOfGroup&&(U.hover(this,V,$),V.interactionState.hovered=[this,V])}).on("mousemove.basic",function(V){!V.interactionState.dragInProgress&&!V.partOfGroup&&(U.follow(this,V),V.interactionState.hovered=[this,V])}).on("mouseout.basic",function(V){!V.interactionState.dragInProgress&&!V.partOfGroup&&(U.unhover(this,V,$),V.interactionState.hovered=!1)}).on("click.basic",function(V){V.interactionState.hovered&&(U.unhover(this,V,$),V.interactionState.hovered=!1),!V.interactionState.dragInProgress&&!V.partOfGroup&&U.select(this,V,$)})}function I(H,$,U,V){var j=a.behavior.drag().origin(function(q){return{x:q.node.x0+q.visibleWidth/2,y:q.node.y0+q.visibleHeight/2}}).on("dragstart",function(q){if(q.arrangement!=="fixed"&&(c.ensureSingle(V._fullLayout._infolayer,"g","dragcover",function(K){V._fullLayout._dragCover=K}),c.raiseToTop(this),q.interactionState.dragInProgress=q.node,X(q.node),q.interactionState.hovered&&(U.nodeEvents.unhover.apply(0,q.interactionState.hovered),q.interactionState.hovered=!1),q.arrangement==="snap")){var Y=q.traceId+"|"+q.key;q.forceLayouts[Y]?q.forceLayouts[Y].alpha(1):L(H,Y,q,V),B(H,$,q,Y,V)}}).on("drag",function(q){if(q.arrangement!=="fixed"){var Y=a.event.x,K=a.event.y;q.arrangement==="snap"?(q.node.x0=Y-q.visibleWidth/2,q.node.x1=Y+q.visibleWidth/2,q.node.y0=K-q.visibleHeight/2,q.node.y1=K+q.visibleHeight/2):(q.arrangement==="freeform"&&(q.node.x0=Y-q.visibleWidth/2,q.node.x1=Y+q.visibleWidth/2),K=Math.max(0,Math.min(q.size-q.visibleHeight/2,K)),q.node.y0=K-q.visibleHeight/2,q.node.y1=K+q.visibleHeight/2),X(q.node),q.arrangement!=="snap"&&(q.sankey.update(q.graph),F(H.filter(Z(q)),$))}}).on("dragend",function(q){if(q.arrangement!=="fixed"){q.interactionState.dragInProgress=!1;for(var Y=0;Y0)window.requestAnimationFrame(q);else{var te=U.node.originalX;U.node.x0=te-U.visibleWidth/2,U.node.x1=te+U.visibleWidth/2,G(U,j)}})}function O(H,$,U,V){return function(){for(var q=0,Y=0;Y0&&V.forceLayouts[$].alpha(0)}}function G(H,$){for(var U=[],V=[],j=0;jR(fe)?n.rgb(fe.linkLineColor):fe.rgb).style("stroke-opacity",fe=>R(fe)?n.opacity(fe.linkLineColor):fe.alpha).style("fill",fe=>fe.rgb).style("fill-opacity",fe=>fe.alpha).style("stroke-width",fe=>R(fe)?fe.linkLineWidth:1).attr("d",A()),le.style("opacity",function(){return H._context.staticPlot||Y||K?1:0}).transition().ease(l.ease).duration(l.duration).style("opacity",1),le.exit().transition().ease(l.ease).duration(l.duration).style("opacity",0).remove();var ce=ne.selectAll("."+l.cn.sankeyNodeSet).data(g,p);ce.enter().append("g").classed(l.cn.sankeyNodeSet,!0),ce.style("cursor",function(fe){switch(fe.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var pe=ce.selectAll("."+l.cn.sankeyNode).data(function(fe){var ae=fe.graph.nodes;return W(ae),ae.map(b.bind(null,fe))},p);pe.enter().append("g").classed(l.cn.sankeyNode,!0).call(E).style("opacity",function(fe){return(H._context.staticPlot||Y)&&!fe.partOfGroup?1:0}),pe.call(z,ne,j.nodeEvents).call(I,le,j,H),pe.transition().ease(l.ease).duration(l.duration).call(E).style("opacity",function(fe){return fe.partOfGroup?0:1}),pe.exit().transition().ease(l.ease).duration(l.duration).style("opacity",0).remove();var xe=pe.selectAll("."+l.cn.nodeRect).data(g);xe.enter().append("rect").classed(l.cn.nodeRect,!0).call(D),xe.style("stroke-width",function(fe){return fe.nodeLineWidth}).style("stroke",function(fe){return n.rgb(fe.nodeLineColor)}).style("stroke-opacity",function(fe){return n.opacity(fe.nodeLineColor)}).style("fill",fe=>fe.rgb).style("fill-opacity",fe=>fe.alpha),xe.transition().ease(l.ease).duration(l.duration).call(D);var ye=pe.selectAll("."+l.cn.nodeLabel).data(g);ye.enter().append("text").classed(l.cn.nodeLabel,!0).style("cursor","default"),ye.attr("data-notex",1).text(function(fe){return fe.node.label}).each(function(fe){var ae=a.select(this);u.font(ae,fe.textFont),y.convertToTspans(ae,H)}).attr("text-anchor",function(fe){return fe.horizontal&&fe.left!==fe.reversed?"end":"start"}).attr("transform",function(fe){var ae=a.select(this),ee=y.lineCount(ae),ie=fe.textFont.size*((ee-1)*S-x),Q=fe.nodeLineWidth/2+M;if(!fe.horizontal){var Me=fe.reversed?(fe.visibleWidth+ie)/2:(fe.visibleWidth-ie)/2,ue=fe.reversed?h(90):"scale(-1,1)"+h(90);return f(Me,Q)+ue}var ge=Q,Me=(fe.visibleHeight-ie)/2;return fe.left?ge=-ge:ge+=fe.visibleWidth,f(ge,Me)+(fe.reversed?"scale(-1,1)":"")}),ye.transition().ease(l.ease).duration(l.duration)}}}),G8=de({"src/traces/sankey/plot.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=i.numberFormat,o=yle(),s=$s(),l=ta(),n=V8().cn,u=i._;function c(S){return S!==""}function f(S,M){return S.filter(function(C){return C.key===M.traceId})}function h(S,M){t.select(S).select("path").style("fill-opacity",M),t.select(S).select("rect").style("fill-opacity",M)}function d(S){t.select(S).select("text.name").style("fill","black")}function p(S){return function(M){return S.node.sourceLinks.indexOf(M.link)!==-1||S.node.targetLinks.indexOf(M.link)!==-1}}function g(S){return function(M){return M.node.sourceLinks.indexOf(S.link)!==-1||M.node.targetLinks.indexOf(S.link)!==-1}}function m(S,M,C){M&&C&&f(C,M).selectAll("."+n.sankeyLink).filter(p(M)).call(_.bind(0,M,C,!1))}function y(S,M,C){M&&C&&f(C,M).selectAll("."+n.sankeyLink).filter(p(M)).call(v.bind(0,M,C,!1))}function _(S,M,C,w){w.style("fill",function(k){if(!k.link.concentrationscale)return k.hoverRgb}).style("fill-opacity",function(k){if(!k.link.concentrationscale)return k.hoverAlpha}),w.each(function(k){var A=k.link.label;A!==""&&f(M,S).selectAll("."+n.sankeyLink).filter(function(b){return b.link.label===A}).style("fill",function(b){if(!b.link.concentrationscale)return b.hoverRgb}).style("fill-opacity",function(b){if(!b.link.concentrationscale)return b.hoverAlpha})}),C&&f(M,S).selectAll("."+n.sankeyNode).filter(g(S)).call(m)}function v(S,M,C,w){w.style("fill",function(k){return k.rgb}).style("fill-opacity",function(k){return k.alpha}),w.each(function(k){var A=k.link.label;A!==""&&f(M,S).selectAll("."+n.sankeyLink).filter(function(b){return b.link.label===A}).style("fill",b=>b.rgb).style("fill-opacity",b=>b.alpha)}),C&&f(M,S).selectAll(n.sankeyNode).filter(g(S)).call(y)}function x(S,M){var C=S.hoverlabel||{},w=i.nestedProperty(C,M).get();return Array.isArray(w)?!1:w}r.exports=function(M,C){for(var w=M._fullLayout,k=w._paper,A=w._size,b=0;b"),color:x(N,"bgcolor")||l.addOpacity(j.color,1),borderColor:x(N,"bordercolor"),fontFamily:x(N,"font.family"),fontSize:x(N,"font.size"),fontColor:x(N,"font.color"),fontWeight:x(N,"font.weight"),fontStyle:x(N,"font.style"),fontVariant:x(N,"font.variant"),fontTextcase:x(N,"font.textcase"),fontLineposition:x(N,"font.lineposition"),fontShadow:x(N,"font.shadow"),nameLength:x(N,"namelength"),textAlign:x(N,"align"),idealAlign:t.event.x"),color:x(N,"bgcolor")||J.rgb,borderColor:x(N,"bordercolor"),fontFamily:x(N,"font.family"),fontSize:x(N,"font.size"),fontColor:x(N,"font.color"),fontWeight:x(N,"font.weight"),fontStyle:x(N,"font.style"),fontVariant:x(N,"font.variant"),fontTextcase:x(N,"font.textcase"),fontLineposition:x(N,"font.lineposition"),fontShadow:x(N,"font.shadow"),nameLength:x(N,"namelength"),textAlign:x(N,"align"),idealAlign:"left",hovertemplate:N.hovertemplate,hovertemplateLabels:Y,eventData:[J.node]},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:M});h(ne,.85),d(ne)}}},X=function(Z,J,N){M._fullLayout.hovermode!==!1&&(t.select(Z).call(y,J,N),J.node.trace.node.hoverinfo!=="skip"&&(J.node.fullData=J.node.trace,M.emit("plotly_unhover",{event:t.event,points:[J.node]})),s.loneUnhover(w._hoverlayer.node()))};o(M,k,C,{width:A.w,height:A.h,margin:{t:A.t,r:A.r,b:A.b,l:A.l}},{linkEvents:{hover:F,follow:L,unhover:B,select:T},nodeEvents:{hover:G,follow:W,unhover:X,select:O}})}}}),_le=de({"src/traces/sankey/base_plot.js"(e){"use strict";var r=Ps().overrideAll,t=$u().getModuleCalcData,i=G8(),a=La(),o=md(),s=Uc(),l=Zl().prepSelect,n=Qt(),u=Ma(),c="sankey";e.name=c,e.baseLayoutAttrOverrides=r({hoverlabel:a.hoverlabel},"plot","nested"),e.plot=function(h){var d=t(h.calcdata,c)[0];i(h,d),e.updateFx(h)},e.clean=function(h,d,p,g){var m=g._has&&g._has(c),y=d._has&&d._has(c);m&&!y&&(g._paperdiv.selectAll(".sankey").remove(),g._paperdiv.selectAll(".bgsankey").remove())},e.updateFx=function(h){for(var d=0;d0}r.exports=function(P,z,I,L){var B=P._fullLayout,O;S(I)&&L&&(O=L()),o.makeTraceGroups(B._indicatorlayer,z,"trace").each(function(G){var W=G[0],X=W.trace,Z=t.select(this),J=X._hasGauge,N=X._isAngular,H=X._isBullet,$=X.domain,U={w:B._size.w*($.x[1]-$.x[0]),h:B._size.h*($.y[1]-$.y[0]),l:B._size.l+B._size.w*$.x[0],r:B._size.r+B._size.w*(1-$.x[1]),t:B._size.t+B._size.h*(1-$.y[1]),b:B._size.b+B._size.h*$.y[0]},V=U.l+U.w/2,j=U.t+U.h/2,q=Math.min(U.w/2,U.h),Y=f.innerRadius*q,K,te,ne,se=X.align||"center";if(te=j,!J)K=U.l+v[se]*U.w,ne=function(Q){return E(Q,U.w,U.h)};else if(N&&(K=V,te=j+q/2,ne=function(Q){return T(Q,.9*Y)}),H){var le=f.bulletPadding,ce=1-f.bulletNumberDomainSize+le;K=U.l+(ce+(1-ce)*v[se])*U.w,ne=function(Q){return E(Q,(f.bulletNumberDomainSize-le)*U.w,U.h)}}w(P,Z,G,{numbersX:K,numbersY:te,numbersScaler:ne,transitionOpts:I,onComplete:O});var pe,xe;J&&(pe={range:X.gauge.axis.range,color:X.gauge.bgcolor,line:{color:X.gauge.bordercolor,width:0},thickness:1},xe={range:X.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:X.gauge.bordercolor,width:X.gauge.borderwidth},thickness:1});var ye=Z.selectAll("g.angular").data(N?G:[]);ye.exit().remove();var fe=Z.selectAll("g.angularaxis").data(N?G:[]);fe.exit().remove(),N&&C(P,Z,G,{radius:q,innerRadius:Y,gauge:ye,layer:fe,size:U,gaugeBg:pe,gaugeOutline:xe,transitionOpts:I,onComplete:O});var ae=Z.selectAll("g.bullet").data(H?G:[]);ae.exit().remove();var ee=Z.selectAll("g.bulletaxis").data(H?G:[]);ee.exit().remove(),H&&M(P,Z,G,{gauge:ae,layer:ee,size:U,gaugeBg:pe,gaugeOutline:xe,transitionOpts:I,onComplete:O});var ie=Z.selectAll("text.title").data(G);ie.exit().remove(),ie.enter().append("text").classed("title",!0),ie.attr("text-anchor",function(){return H?_.right:_[X.title.align]}).text(X.title.text).call(c.font,X.title.font).call(h.convertToTspans,P),ie.attr("transform",function(){var Q=U.l+U.w*v[X.title.align],ue,ge=f.titlePadding,Me=c.bBox(ie.node());if(J){if(N)if(X.gauge.axis.visible){var Te=c.bBox(fe.node());ue=Te.top-ge-Me.bottom}else ue=U.t+U.h/2-q/2-Me.bottom-ge;H&&(ue=te-(Me.top+Me.bottom)/2,Q=U.l-f.bulletPadding*U.w)}else ue=X._numbersTop-ge-Me.bottom;return l(Q,ue)})})};function M(R,P,z,I){var L=z[0].trace,B=I.gauge,O=I.layer,G=I.gaugeBg,W=I.gaugeOutline,X=I.size,Z=L.domain,J=I.transitionOpts,N=I.onComplete,H,$,U,V,j;B.enter().append("g").classed("bullet",!0),B.attr("transform",l(X.l,X.t)),O.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),O.selectAll("g.xbulletaxistick,path,text").remove();var q=X.h,Y=L.gauge.bar.thickness*q,K=Z.x[0],te=Z.x[0]+(Z.x[1]-Z.x[0])*(L._hasNumber||L._hasDelta?1-f.bulletNumberDomainSize:1);H=b(R,L.gauge.axis),H._id="xbulletaxis",H.domain=[K,te],H.setScale(),$=d.calcTicks(H),U=d.makeTransTickFn(H),V=d.getTickSigns(H)[2],j=X.t+X.h,H.visible&&(d.drawTicks(R,H,{vals:H.ticks==="inside"?d.clipEnds(H,$):$,layer:O,path:d.makeTickPath(H,j,V),transFn:U}),d.drawLabels(R,H,{vals:$,layer:O,transFn:U,labelFns:d.makeLabelFns(H,j)}));function ne(fe){fe.attr("width",function(ae){return Math.max(0,H.c2p(ae.range[1])-H.c2p(ae.range[0]))}).attr("x",function(ae){return H.c2p(ae.range[0])}).attr("y",function(ae){return .5*(1-ae.thickness)*q}).attr("height",function(ae){return ae.thickness*q})}var se=[G].concat(L.gauge.steps),le=B.selectAll("g.bg-bullet").data(se);le.enter().append("g").classed("bg-bullet",!0).append("rect"),le.select("rect").call(ne).call(k),le.exit().remove();var ce=B.selectAll("g.value-bullet").data([L.gauge.bar]);ce.enter().append("g").classed("value-bullet",!0).append("rect"),ce.select("rect").attr("height",Y).attr("y",(q-Y)/2).call(k),S(J)?ce.select("rect").transition().duration(J.duration).ease(J.easing).each("end",function(){N&&N()}).each("interrupt",function(){N&&N()}).attr("width",Math.max(0,H.c2p(Math.min(L.gauge.axis.range[1],z[0].y)))):ce.select("rect").attr("width",typeof z[0].y=="number"?Math.max(0,H.c2p(Math.min(L.gauge.axis.range[1],z[0].y))):0),ce.exit().remove();var pe=z.filter(function(){return L.gauge.threshold.value||L.gauge.threshold.value===0}),xe=B.selectAll("g.threshold-bullet").data(pe);xe.enter().append("g").classed("threshold-bullet",!0).append("line"),xe.select("line").attr("x1",H.c2p(L.gauge.threshold.value)).attr("x2",H.c2p(L.gauge.threshold.value)).attr("y1",(1-L.gauge.threshold.thickness)/2*q).attr("y2",(1-(1-L.gauge.threshold.thickness)/2)*q).call(y.stroke,L.gauge.threshold.line.color).style("stroke-width",L.gauge.threshold.line.width),xe.exit().remove();var ye=B.selectAll("g.gauge-outline").data([W]);ye.enter().append("g").classed("gauge-outline",!0).append("rect"),ye.select("rect").call(ne).call(k),ye.exit().remove()}function C(R,P,z,I){var L=z[0].trace,B=I.size,O=I.radius,G=I.innerRadius,W=I.gaugeBg,X=I.gaugeOutline,Z=[B.l+B.w/2,B.t+B.h/2+O/2],J=I.gauge,N=I.layer,H=I.transitionOpts,$=I.onComplete,U=Math.PI/2;function V(je){var Ve=L.gauge.axis.range[0],Ze=L.gauge.axis.range[1],Ke=(je-Ve)/(Ze-Ve)*Math.PI-U;return Ke<-U?-U:Ke>U?U:Ke}function j(je){return t.svg.arc().innerRadius((G+O)/2-je/2*(O-G)).outerRadius((G+O)/2+je/2*(O-G)).startAngle(-U)}function q(je){je.attr("d",function(Ve){return j(Ve.thickness).startAngle(V(Ve.range[0])).endAngle(V(Ve.range[1]))()})}var Y,K,te,ne;J.enter().append("g").classed("angular",!0),J.attr("transform",l(Z[0],Z[1])),N.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),N.selectAll("g.xangularaxistick,path,text").remove(),Y=b(R,L.gauge.axis),Y.type="linear",Y.range=L.gauge.axis.range,Y._id="xangularaxis",Y.ticklabeloverflow="allow",Y.setScale();var se=function(je){return(Y.range[0]-je.x)/(Y.range[1]-Y.range[0])*Math.PI+Math.PI},le={},ce=d.makeLabelFns(Y,0),pe=ce.labelStandoff;le.xFn=function(je){var Ve=se(je);return Math.cos(Ve)*pe},le.yFn=function(je){var Ve=se(je),Ze=Math.sin(Ve)>0?.2:1;return-Math.sin(Ve)*(pe+je.fontSize*Ze)+Math.abs(Math.cos(Ve))*(je.fontSize*u)},le.anchorFn=function(je){var Ve=se(je),Ze=Math.cos(Ve);return Math.abs(Ze)<.1?"middle":Ze>0?"start":"end"},le.heightFn=function(je,Ve,Ze){var Ke=se(je);return-.5*(1+Math.sin(Ke))*Ze};var xe=function(je){return l(Z[0]+O*Math.cos(je),Z[1]-O*Math.sin(je))};te=function(je){return xe(se(je))};var ye=function(je){var Ve=se(je);return xe(Ve)+"rotate("+-n(Ve)+")"};if(K=d.calcTicks(Y),ne=d.getTickSigns(Y)[2],Y.visible){ne=Y.ticks==="inside"?-1:1;var fe=(Y.linewidth||1)/2;d.drawTicks(R,Y,{vals:K,layer:N,path:"M"+ne*fe+",0h"+ne*Y.ticklen,transFn:ye}),d.drawLabels(R,Y,{vals:K,layer:N,transFn:te,labelFns:le})}var ae=[W].concat(L.gauge.steps),ee=J.selectAll("g.bg-arc").data(ae);ee.enter().append("g").classed("bg-arc",!0).append("path"),ee.select("path").call(q).call(k),ee.exit().remove();var ie=j(L.gauge.bar.thickness),Q=J.selectAll("g.value-arc").data([L.gauge.bar]);Q.enter().append("g").classed("value-arc",!0).append("path");var ue=Q.select("path");S(H)?(ue.transition().duration(H.duration).ease(H.easing).each("end",function(){$&&$()}).each("interrupt",function(){$&&$()}).attrTween("d",A(ie,V(z[0].lastY),V(z[0].y))),L._lastValue=z[0].y):ue.attr("d",typeof z[0].y=="number"?ie.endAngle(V(z[0].y)):"M0,0Z"),ue.call(k),Q.exit().remove(),ae=[];var ge=L.gauge.threshold.value;(ge||ge===0)&&ae.push({range:[ge,ge],color:L.gauge.threshold.color,line:{color:L.gauge.threshold.line.color,width:L.gauge.threshold.line.width},thickness:L.gauge.threshold.thickness});var Me=J.selectAll("g.threshold-arc").data(ae);Me.enter().append("g").classed("threshold-arc",!0).append("path"),Me.select("path").call(q).call(k),Me.exit().remove();var Te=J.selectAll("g.gauge-outline").data([X]);Te.enter().append("g").classed("gauge-outline",!0).append("path"),Te.select("path").call(q).call(k),Te.exit().remove()}function w(R,P,z,I){var L=z[0].trace,B=I.numbersX,O=I.numbersY,G=L.align||"center",W=_[G],X=I.transitionOpts,Z=I.onComplete,J=o.ensureSingle(P,"g","numbers"),N,H,$,U=[];L._hasNumber&&U.push("number"),L._hasDelta&&(U.push("delta"),L.delta.position==="left"&&U.reverse());var V=J.selectAll("text").data(U);V.enter().append("text"),V.attr("text-anchor",function(){return W}).attr("class",function(xe){return xe}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),V.exit().remove();function j(xe,ye,fe,ae){if(xe.match("s")&&fe>=0!=ae>=0&&!ye(fe).slice(-1).match(x)&&!ye(ae).slice(-1).match(x)){var ee=xe.slice().replace("s","f").replace(/\d+/,function(Q){return parseInt(Q)-1}),ie=b(R,{tickformat:ee});return function(Q){return Math.abs(Q)<1?d.tickText(ie,Q).text:ye(Q)}}else return ye}function q(){var xe=b(R,{tickformat:L.number.valueformat},L._range);xe.setScale(),d.prepTicks(xe);var ye=function(Q){return d.tickText(xe,Q).text},fe=L.number.suffix,ae=L.number.prefix,ee=J.select("text.number");function ie(){var Q=typeof z[0].y=="number"?ae+ye(z[0].y)+fe:"-";ee.text(Q).call(c.font,L.number.font).call(h.convertToTspans,R)}return S(X)?ee.transition().duration(X.duration).ease(X.easing).each("end",function(){ie(),Z&&Z()}).each("interrupt",function(){ie(),Z&&Z()}).attrTween("text",function(){var Q=t.select(this),ue=a(z[0].lastY,z[0].y);L._lastValue=z[0].y;var ge=j(L.number.valueformat,ye,z[0].lastY,z[0].y);return function(Me){Q.text(ae+ge(ue(Me))+fe)}}):ie(),N=F(ae+ye(z[0].y)+fe,L.number.font,W,R),ee}function Y(){var xe=b(R,{tickformat:L.delta.valueformat},L._range);xe.setScale(),d.prepTicks(xe);var ye=function(Me){return d.tickText(xe,Me).text},fe=L.delta.suffix,ae=L.delta.prefix,ee=function(Me){var Te=L.delta.relative?Me.relativeDelta:Me.delta;return Te},ie=function(Me,Te){return Me===0||typeof Me!="number"||isNaN(Me)?"-":(Me>0?L.delta.increasing.symbol:L.delta.decreasing.symbol)+ae+Te(Me)+fe},Q=function(Me){return Me.delta>=0?L.delta.increasing.color:L.delta.decreasing.color};L._deltaLastValue===void 0&&(L._deltaLastValue=ee(z[0]));var ue=J.select("text.delta");ue.call(c.font,L.delta.font).call(y.fill,Q({delta:L._deltaLastValue}));function ge(){ue.text(ie(ee(z[0]),ye)).call(y.fill,Q(z[0])).call(h.convertToTspans,R)}return S(X)?ue.transition().duration(X.duration).ease(X.easing).tween("text",function(){var Me=t.select(this),Te=ee(z[0]),je=L._deltaLastValue,Ve=j(L.delta.valueformat,ye,je,Te),Ze=a(je,Te);return L._deltaLastValue=Te,function(Ke){Me.text(ie(Ze(Ke),Ve)),Me.call(y.fill,Q({delta:Ze(Ke)}))}}).each("end",function(){ge(),Z&&Z()}).each("interrupt",function(){ge(),Z&&Z()}):ge(),H=F(ie(ee(z[0]),ye),L.delta.font,W,R),ue}var K=L.mode+L.align,te;if(L._hasDelta&&(te=Y(),K+=L.delta.position+L.delta.font.size+L.delta.font.family+L.delta.valueformat,K+=L.delta.increasing.symbol+L.delta.decreasing.symbol,$=H),L._hasNumber&&(q(),K+=L.number.font.size+L.number.font.family+L.number.valueformat+L.number.suffix+L.number.prefix,$=N),L._hasDelta&&L._hasNumber){var ne=[(N.left+N.right)/2,(N.top+N.bottom)/2],se=[(H.left+H.right)/2,(H.top+H.bottom)/2],le,ce,pe=.75*L.delta.font.size;L.delta.position==="left"&&(le=D(L,"deltaPos",0,-1*(N.width*v[L.align]+H.width*(1-v[L.align])+pe),K,Math.min),ce=ne[1]-se[1],$={width:N.width+H.width+pe,height:Math.max(N.height,H.height),left:H.left+le,right:N.right,top:Math.min(N.top,H.top+ce),bottom:Math.max(N.bottom,H.bottom+ce)}),L.delta.position==="right"&&(le=D(L,"deltaPos",0,N.width*(1-v[L.align])+H.width*v[L.align]+pe,K,Math.max),ce=ne[1]-se[1],$={width:N.width+H.width+pe,height:Math.max(N.height,H.height),left:N.left,right:H.right+le,top:Math.min(N.top,H.top+ce),bottom:Math.max(N.bottom,H.bottom+ce)}),L.delta.position==="bottom"&&(le=null,ce=H.height,$={width:Math.max(N.width,H.width),height:N.height+H.height,left:Math.min(N.left,H.left),right:Math.max(N.right,H.right),top:N.bottom-N.height,bottom:N.bottom+H.height}),L.delta.position==="top"&&(le=null,ce=N.top,$={width:Math.max(N.width,H.width),height:N.height+H.height,left:Math.min(N.left,H.left),right:Math.max(N.right,H.right),top:N.bottom-N.height-H.height,bottom:N.bottom}),te.attr({dx:le,dy:ce})}(L._hasNumber||L._hasDelta)&&J.attr("transform",function(){var xe=I.numbersScaler($);K+=xe[2];var ye=D(L,"numbersScale",1,xe[0],K,Math.min),fe;L._scaleNumbers||(ye=1),L._isAngular?fe=O-ye*$.bottom:fe=O-ye*($.top+$.bottom)/2,L._numbersTop=ye*$.top+fe;var ae=$[G];G==="center"&&(ae=($.left+$.right)/2);var ee=B-ye*ae;return ee=D(L,"numbersTranslate",0,ee,K,Math.max),l(ee,fe)+s(ye)})}function k(R){R.each(function(P){y.stroke(t.select(this),P.line.color)}).each(function(P){y.fill(t.select(this),P.color)}).style("stroke-width",function(P){return P.line.width})}function A(R,P,z){return function(){var I=i(P,z);return function(L){return R.endAngle(I(L))()}}}function b(R,P,z){var I=R._fullLayout,L=o.extendFlat({type:"linear",ticks:"outside",range:z,showline:!0},P),B={type:"linear",_id:"x"+P._id},O={letter:"x",font:I.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function G(W,X){return o.coerce(L,B,m,W,X)}return p(L,B,G,O,I),g(L,B,G,O),B}function E(R,P,z){var I=Math.min(P/R.width,z/R.height);return[I,R,P+"x"+z]}function T(R,P){var z=Math.sqrt(R.width/2*(R.width/2)+R.height*R.height),I=P/z;return[I,R,P]}function F(R,P,z,I){var L=document.createElementNS("http://www.w3.org/2000/svg","text"),B=t.select(L);return B.text(R).attr("x",0).attr("y",0).attr("text-anchor",z).attr("data-unformatted",R).call(h.convertToTspans,I).call(c.font,P),c.bBox(B.node())}function D(R,P,z,I,L,B){var O="_cache"+P;R[O]&&R[O].key===L||(R[O]={key:L,value:z});var G=o.aggNums(B,null,[R[O].value,I],2);return R[O].value=G,G}}}),Ele=de({"src/traces/indicator/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"indicator",basePlotModule:Tle(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:H8(),supplyDefaults:Ale().supplyDefaults,calc:Mle().calc,plot:Sle(),meta:{}}}}),kle=de({"lib/indicator.js"(e,r){"use strict";r.exports=Ele()}}),W8=de({"src/traces/table/attributes.js"(e,r){"use strict";var t=g0(),i=fn().extendFlat,a=Ps().overrideAll,o=us(),s=Is().attributes,l=Ns().descriptionOnlyNumbers,n=r.exports=a({domain:s({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:i({},t.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:i({},o({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:i({},t.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:i({},o({arrayOk:!0}))}},"calc","from-root")}}),Cle=de({"src/traces/table/defaults.js"(e,r){"use strict";var t=Qt(),i=W8(),a=Is().defaults;function o(s,l){for(var n=s.columnorder||[],u=s.header.values.length,c=n.slice(0,u),f=c.slice().sort(function(p,g){return p-g}),h=c.map(function(p){return f.indexOf(p)}),d=h.length;d",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),Lle=de({"src/traces/table/data_preparation_helper.js"(e,r){"use strict";var t=Y8(),i=fn().extendFlat,a=da(),o=Do().isTypedArray,s=Do().isArrayOrTypedArray;r.exports=function(m,y){var _=u(y.cells.values),v=function(W){return W.slice(y.header.values.length,W.length)},x=u(y.header.values);x.length&&!x[0].length&&(x[0]=[""],x=u(x));var S=x.concat(v(_).map(function(){return c((x[0]||[""]).length)})),M=y.domain,C=Math.floor(m._fullLayout._size.w*(M.x[1]-M.x[0])),w=Math.floor(m._fullLayout._size.h*(M.y[1]-M.y[0])),k=y.header.values.length?S[0].map(function(){return y.header.height}):[t.emptyHeaderHeight],A=_.length?_[0].map(function(){return y.cells.height}):[],b=k.reduce(n,0),E=w-b,T=E+t.uplift,F=d(A,T),D=d(k,b),R=h(D,[]),P=h(F,R),z={},I=y.columnorder;s(I)&&(I=Array.from(I)),I=I.concat(v(_.map(function(W,X){return X})));var L=S.map(function(W,X){var Z=s(y.columnwidth)?y.columnwidth[Math.min(X,y.columnwidth.length-1)]:y.columnwidth;return a(Z)?Number(Z):1}),B=L.reduce(n,0);L=L.map(function(W){return W/B*C});var O=Math.max(l(y.header.line.width),l(y.cells.line.width)),G={key:y.uid+m._context.staticPlot,translateX:M.x[0]*m._fullLayout._size.w,translateY:m._fullLayout._size.h*(1-M.y[1]),size:m._fullLayout._size,width:C,maxLineWidth:O,height:w,columnOrder:I,groupHeight:w,rowBlocks:P,headerRowBlocks:R,scrollY:0,cells:i({},y.cells,{values:_}),headerCells:i({},y.header,{values:S}),gdColumns:S.map(function(W){return W[0]}),gdColumnsOriginalOrder:S.map(function(W){return W[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:S.map(function(W,X){var Z=z[W];z[W]=(Z||0)+1;var J=W+"__"+z[W];return{key:J,label:W,specIndex:X,xIndex:I[X],xScale:f,x:void 0,calcdata:void 0,columnWidth:L[X]}})};return G.columns.forEach(function(W){W.calcdata=G,W.x=f(W)}),G};function l(g){if(s(g)){for(var m=0,y=0;y=m||w===g.length-1)&&(y[v]=S,S.key=C++,S.firstRowIndex=M,S.lastRowIndex=w,S=p(),v+=x,M=w+1,x=0);return y}function p(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),Fle=de({"src/traces/table/data_split_helpers.js"(e){"use strict";var r=fn().extendFlat;e.splitToPanels=function(i){var a=[0,0],o=r({},i,{key:"header",type:"header",page:0,prevPages:a,currentRepaint:[null,null],dragHandle:!0,values:i.calcdata.headerCells.values[i.specIndex],rowBlocks:i.calcdata.headerRowBlocks,calcdata:r({},i.calcdata,{cells:i.calcdata.headerCells})}),s=r({},i,{key:"cells1",type:"cells",page:0,prevPages:a,currentRepaint:[null,null],dragHandle:!1,values:i.calcdata.cells.values[i.specIndex],rowBlocks:i.calcdata.rowBlocks}),l=r({},i,{key:"cells2",type:"cells",page:1,prevPages:a,currentRepaint:[null,null],dragHandle:!1,values:i.calcdata.cells.values[i.specIndex],rowBlocks:i.calcdata.rowBlocks});return[s,l,o]},e.splitToCells=function(i){var a=t(i);return(i.values||[]).slice(a[0],a[1]).map(function(o,s){var l=typeof o=="string"&&o.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:s+l,key:a[0]+s,column:i,calcdata:i.calcdata,page:i.page,rowBlocks:i.rowBlocks,value:o}})};function t(i){var a=i.rowBlocks[i.page],o=a?a.rows[0].rowIndex:0,s=a?o+a.rows.length:0;return[o,s]}}}),X8=de({"src/traces/table/plot.js"(e,r){"use strict";var t=Y8(),i=Yr(),a=Qt(),o=a.numberFormat,s=ip(),l=hn(),n=Zo(),u=Qt().raiseToTop,c=Qt().strTranslate,f=Qt().cancelTransition,h=Lle(),d=Fle(),p=ta();r.exports=function(K,te){var ne=!K._context.staticPlot,se=K._fullLayout._paper.selectAll("."+t.cn.table).data(te.map(function(Te){var je=s.unwrap(Te),Ve=je.trace;return h(K,Ve)}),s.keyFun);se.exit().remove(),se.enter().append("g").classed(t.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),se.attr("width",function(Te){return Te.width+Te.size.l+Te.size.r}).attr("height",function(Te){return Te.height+Te.size.t+Te.size.b}).attr("transform",function(Te){return c(Te.translateX,Te.translateY)});var le=se.selectAll("."+t.cn.tableControlView).data(s.repeat,s.keyFun),ce=le.enter().append("g").classed(t.cn.tableControlView,!0).style("box-sizing","content-box");if(ne){var pe="onwheel"in document?"wheel":"mousewheel";ce.on("mousemove",function(Te){le.filter(function(je){return Te===je}).call(v,K)}).on(pe,function(Te){if(!Te.scrollbarState.wheeling){Te.scrollbarState.wheeling=!0;var je=Te.scrollY+i.event.deltaY,Ve=W(K,le,null,je)(Te);Ve||(i.event.stopPropagation(),i.event.preventDefault()),Te.scrollbarState.wheeling=!1}}).call(v,K,!0)}le.attr("transform",function(Te){return c(Te.size.l,Te.size.t)});var xe=le.selectAll("."+t.cn.scrollBackground).data(s.repeat,s.keyFun);xe.enter().append("rect").classed(t.cn.scrollBackground,!0).attr("fill","none"),xe.attr("width",function(Te){return Te.width}).attr("height",function(Te){return Te.height}),le.each(function(Te){l.setClipUrl(i.select(this),m(K,Te),K)});var ye=le.selectAll("."+t.cn.yColumn).data(function(Te){return Te.columns},s.keyFun);ye.enter().append("g").classed(t.cn.yColumn,!0),ye.exit().remove(),ye.attr("transform",function(Te){return c(Te.x,0)}),ne&&ye.call(i.behavior.drag().origin(function(Te){var je=i.select(this);return z(je,Te,-t.uplift),u(this),Te.calcdata.columnDragInProgress=!0,v(le.filter(function(Ve){return Te.calcdata.key===Ve.key}),K),Te}).on("drag",function(Te){var je=i.select(this),Ve=function(vt){return(Te===vt?i.event.x:vt.x)+vt.columnWidth/2};Te.x=Math.max(-t.overdrag,Math.min(Te.calcdata.width+t.overdrag-Te.columnWidth,i.event.x));var Ze=_(ye).filter(function(vt){return vt.calcdata.key===Te.calcdata.key}),Ke=Ze.sort(function(vt,xt){return Ve(vt)-Ve(xt)});Ke.forEach(function(vt,xt){vt.xIndex=xt,vt.x=Te===vt?vt.x:vt.xScale(vt)}),ye.filter(function(vt){return Te!==vt}).transition().ease(t.transitionEase).duration(t.transitionDuration).attr("transform",function(vt){return c(vt.x,0)}),je.call(f).attr("transform",c(Te.x,-t.uplift))}).on("dragend",function(Te){var je=i.select(this),Ve=Te.calcdata;Te.x=Te.xScale(Te),Te.calcdata.columnDragInProgress=!1,z(je,Te,0),R(K,Ve,Ve.columns.map(function(Ze){return Ze.xIndex}))})),ye.each(function(Te){l.setClipUrl(i.select(this),y(K,Te),K)});var fe=ye.selectAll("."+t.cn.columnBlock).data(d.splitToPanels,s.keyFun);fe.enter().append("g").classed(t.cn.columnBlock,!0).attr("id",function(Te){return Te.key}),fe.style("cursor",function(Te){return Te.dragHandle?"ew-resize":Te.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var ae=fe.filter(L),ee=fe.filter(I);ne&&ee.call(i.behavior.drag().origin(function(Te){return i.event.stopPropagation(),Te}).on("drag",W(K,le,-1)).on("dragend",function(){})),x(K,le,ae,fe),x(K,le,ee,fe);var ie=le.selectAll("."+t.cn.scrollAreaClip).data(s.repeat,s.keyFun);ie.enter().append("clipPath").classed(t.cn.scrollAreaClip,!0).attr("id",function(Te){return m(K,Te)});var Q=ie.selectAll("."+t.cn.scrollAreaClipRect).data(s.repeat,s.keyFun);Q.enter().append("rect").classed(t.cn.scrollAreaClipRect,!0).attr("x",-t.overdrag).attr("y",-t.uplift).attr("fill","none"),Q.attr("width",function(Te){return Te.width+2*t.overdrag}).attr("height",function(Te){return Te.height+t.uplift});var ue=ye.selectAll("."+t.cn.columnBoundary).data(s.repeat,s.keyFun);ue.enter().append("g").classed(t.cn.columnBoundary,!0);var ge=ye.selectAll("."+t.cn.columnBoundaryClippath).data(s.repeat,s.keyFun);ge.enter().append("clipPath").classed(t.cn.columnBoundaryClippath,!0),ge.attr("id",function(Te){return y(K,Te)});var Me=ge.selectAll("."+t.cn.columnBoundaryRect).data(s.repeat,s.keyFun);Me.enter().append("rect").classed(t.cn.columnBoundaryRect,!0).attr("fill","none"),Me.attr("width",function(Te){return Te.columnWidth+2*g(Te)}).attr("height",function(Te){return Te.calcdata.height+2*g(Te)+t.uplift}).attr("x",function(Te){return-g(Te)}).attr("y",function(Te){return-g(Te)}),G(null,ee,le)};function g(Y){return Math.ceil(Y.calcdata.maxLineWidth/2)}function m(Y,K){return"clip"+Y._fullLayout._uid+"_scrollAreaBottomClip_"+K.key}function y(Y,K){return"clip"+Y._fullLayout._uid+"_columnBoundaryClippath_"+K.calcdata.key+"_"+K.specIndex}function _(Y){return[].concat.apply([],Y.map(function(K){return K})).map(function(K){return K.__data__})}function v(Y,K,te){function ne(ye){var fe=ye.rowBlocks;return $(fe,fe.length-1)+(fe.length?U(fe[fe.length-1],1/0):1)}var se=Y.selectAll("."+t.cn.scrollbarKit).data(s.repeat,s.keyFun);se.enter().append("g").classed(t.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),se.each(function(ye){var fe=ye.scrollbarState;fe.totalHeight=ne(ye),fe.scrollableAreaHeight=ye.groupHeight-B(ye),fe.currentlyVisibleHeight=Math.min(fe.totalHeight,fe.scrollableAreaHeight),fe.ratio=fe.currentlyVisibleHeight/fe.totalHeight,fe.barLength=Math.max(fe.ratio*fe.currentlyVisibleHeight,t.goldenRatio*t.scrollbarWidth),fe.barWiggleRoom=fe.currentlyVisibleHeight-fe.barLength,fe.wiggleRoom=Math.max(0,fe.totalHeight-fe.scrollableAreaHeight),fe.topY=fe.barWiggleRoom===0?0:ye.scrollY/fe.wiggleRoom*fe.barWiggleRoom,fe.bottomY=fe.topY+fe.barLength,fe.dragMultiplier=fe.wiggleRoom/fe.barWiggleRoom}).attr("transform",function(ye){var fe=ye.width+t.scrollbarWidth/2+t.scrollbarOffset;return c(fe,B(ye))});var le=se.selectAll("."+t.cn.scrollbar).data(s.repeat,s.keyFun);le.enter().append("g").classed(t.cn.scrollbar,!0);var ce=le.selectAll("."+t.cn.scrollbarSlider).data(s.repeat,s.keyFun);ce.enter().append("g").classed(t.cn.scrollbarSlider,!0),ce.attr("transform",function(ye){return c(0,ye.scrollbarState.topY||0)});var pe=ce.selectAll("."+t.cn.scrollbarGlyph).data(s.repeat,s.keyFun);pe.enter().append("line").classed(t.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",t.scrollbarWidth).attr("stroke-linecap","round").attr("y1",t.scrollbarWidth/2),pe.attr("y2",function(ye){return ye.scrollbarState.barLength-t.scrollbarWidth/2}).attr("stroke-opacity",function(ye){return ye.columnDragInProgress||!ye.scrollbarState.barWiggleRoom||te?0:.4}),pe.transition().delay(0).duration(0),pe.transition().delay(t.scrollbarHideDelay).duration(t.scrollbarHideDuration).attr("stroke-opacity",0);var xe=le.selectAll("."+t.cn.scrollbarCaptureZone).data(s.repeat,s.keyFun);xe.enter().append("line").classed(t.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",t.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(ye){var fe=i.event.y,ae=this.getBoundingClientRect(),ee=ye.scrollbarState,ie=fe-ae.top,Q=i.scale.linear().domain([0,ee.scrollableAreaHeight]).range([0,ee.totalHeight]).clamp(!0);ee.topY<=ie&&ie<=ee.bottomY||W(K,Y,null,Q(ie-ee.barLength/2))(ye)}).call(i.behavior.drag().origin(function(ye){return i.event.stopPropagation(),ye.scrollbarState.scrollbarScrollInProgress=!0,ye}).on("drag",W(K,Y)).on("dragend",function(){})),xe.attr("y2",function(ye){return ye.scrollbarState.scrollableAreaHeight}),K._context.staticPlot&&(pe.remove(),xe.remove())}function x(Y,K,te,ne){var se=S(te),le=M(se);A(le);var ce=C(le);E(ce);var pe=k(le),xe=w(pe);b(xe),T(xe,K,ne,Y),H(le)}function S(Y){var K=Y.selectAll("."+t.cn.columnCells).data(s.repeat,s.keyFun);return K.enter().append("g").classed(t.cn.columnCells,!0),K.exit().remove(),K}function M(Y){var K=Y.selectAll("."+t.cn.columnCell).data(d.splitToCells,function(te){return te.keyWithinBlock});return K.enter().append("g").classed(t.cn.columnCell,!0),K.exit().remove(),K}function C(Y){var K=Y.selectAll("."+t.cn.cellRect).data(s.repeat,function(te){return te.keyWithinBlock});return K.enter().append("rect").classed(t.cn.cellRect,!0),K}function w(Y){var K=Y.selectAll("."+t.cn.cellText).data(s.repeat,function(te){return te.keyWithinBlock});return K.enter().append("text").classed(t.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){i.event.stopPropagation()}),K}function k(Y){var K=Y.selectAll("."+t.cn.cellTextHolder).data(s.repeat,function(te){return te.keyWithinBlock});return K.enter().append("g").classed(t.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),K}function A(Y){Y.each(function(K,te){var ne=K.calcdata.cells.font,se=K.column.specIndex,le={size:P(ne.size,se,te),color:P(ne.color,se,te),family:P(ne.family,se,te),weight:P(ne.weight,se,te),style:P(ne.style,se,te),variant:P(ne.variant,se,te),textcase:P(ne.textcase,se,te),lineposition:P(ne.lineposition,se,te),shadow:P(ne.shadow,se,te)};K.rowNumber=K.key,K.align=P(K.calcdata.cells.align,se,te),K.cellBorderWidth=P(K.calcdata.cells.line.width,se,te),K.font=le})}function b(Y){Y.each(function(K){l.font(i.select(this),K.font)})}function E(Y){Y.attr("width",function(K){return K.column.columnWidth}).attr("stroke-width",function(K){return K.cellBorderWidth}).each(function(K){var te=i.select(this);p.stroke(te,P(K.calcdata.cells.line.color,K.column.specIndex,K.rowNumber)),p.fill(te,P(K.calcdata.cells.fill.color,K.column.specIndex,K.rowNumber))})}function T(Y,K,te,ne){Y.text(function(se){var le=se.column.specIndex,ce=se.rowNumber,pe=se.value,xe=typeof pe=="string",ye=xe&&pe.match(/
/i),fe=!xe||ye;se.mayHaveMarkup=xe&&pe.match(/[<&>]/);var ae=F(pe);se.latex=ae;var ee=ae?"":P(se.calcdata.cells.prefix,le,ce)||"",ie=ae?"":P(se.calcdata.cells.suffix,le,ce)||"",Q=ae?null:P(se.calcdata.cells.format,le,ce)||null,ue=ee+(Q?o(Q)(se.value):se.value)+ie,ge;se.wrappingNeeded=!se.wrapped&&!fe&&!ae&&(ge=D(ue)),se.cellHeightMayIncrease=ye||ae||se.mayHaveMarkup||(ge===void 0?D(ue):ge),se.needsConvertToTspans=se.mayHaveMarkup||se.wrappingNeeded||se.latex;var Me;if(se.wrappingNeeded){var Te=t.wrapSplitCharacter===" "?ue.replace(/se&&ne.push(le),se+=xe}return ne}function G(Y,K,te){var ne=_(K)[0];if(ne!==void 0){var se=ne.rowBlocks,le=ne.calcdata,ce=$(se,se.length),pe=ne.calcdata.groupHeight-B(ne),xe=le.scrollY=Math.max(0,Math.min(ce-pe,le.scrollY)),ye=O(se,xe,pe);ye.length===1&&(ye[0]===se.length-1?ye.unshift(ye[0]-1):ye.push(ye[0]+1)),ye[0]%2&&ye.reverse(),K.each(function(fe,ae){fe.page=ye[ae],fe.scrollY=xe}),K.attr("transform",function(fe){var ae=$(fe.rowBlocks,fe.page)-fe.scrollY;return c(0,ae)}),Y&&(X(Y,te,K,ye,ne.prevPages,ne,0),X(Y,te,K,ye,ne.prevPages,ne,1),v(te,Y))}}function W(Y,K,te,ne){return function(le){var ce=le.calcdata?le.calcdata:le,pe=K.filter(function(ae){return ce.key===ae.key}),xe=te||ce.scrollbarState.dragMultiplier,ye=ce.scrollY;ce.scrollY=ne===void 0?ce.scrollY+xe*i.event.dy:ne;var fe=pe.selectAll("."+t.cn.yColumn).selectAll("."+t.cn.columnBlock).filter(I);return G(Y,fe,pe),ce.scrollY===ye}}function X(Y,K,te,ne,se,le,ce){var pe=ne[ce]!==se[ce];pe&&(clearTimeout(le.currentRepaint[ce]),le.currentRepaint[ce]=setTimeout(function(){var xe=te.filter(function(ye,fe){return fe===ce&&ne[fe]!==se[fe]});x(Y,K,xe,te),se[ce]=ne[ce]}))}function Z(Y,K,te,ne){return function(){var le=i.select(K.parentNode);le.each(function(ce){var pe=ce.fragments;le.selectAll("tspan.line").each(function(ue,ge){pe[ge].width=this.getComputedTextLength()});var xe=pe[pe.length-1].width,ye=pe.slice(0,-1),fe=[],ae,ee,ie=0,Q=ce.column.columnWidth-2*t.cellPad;for(ce.value="";ye.length;)ae=ye.shift(),ee=ae.width+xe,ie+ee>Q&&(ce.value+=fe.join(t.wrapSpacer)+t.lineBreaker,fe=[],ie=0),fe.push(ae.text),ie+=ee;ie&&(ce.value+=fe.join(t.wrapSpacer)),ce.wrapped=!0}),le.selectAll("tspan.line").remove(),T(le.select("."+t.cn.cellText),te,Y,ne),i.select(K.parentNode.parentNode).call(H)}}function J(Y,K,te,ne,se){return function(){if(!se.settledY){var ce=i.select(K.parentNode),pe=j(se),xe=se.key-pe.firstRowIndex,ye=pe.rows[xe].rowHeight,fe=se.cellHeightMayIncrease?K.parentNode.getBoundingClientRect().height+2*t.cellPad:ye,ae=Math.max(fe,ye),ee=ae-pe.rows[xe].rowHeight;ee&&(pe.rows[xe].rowHeight=ae,Y.selectAll("."+t.cn.columnCell).call(H),G(null,Y.filter(I),0),v(te,ne,!0)),ce.attr("transform",function(){var ie=this,Q=ie.parentNode,ue=Q.getBoundingClientRect(),ge=i.select(ie.parentNode).select("."+t.cn.cellRect).node().getBoundingClientRect(),Me=ie.transform.baseVal.consolidate(),Te=ge.top-ue.top+(Me?Me.matrix.f:t.cellPad);return c(N(se,i.select(ie.parentNode).select("."+t.cn.cellTextHolder).node().getBoundingClientRect().width),Te)}),se.settledY=!0}}}function N(Y,K){switch(Y.align){case"left":return t.cellPad;case"right":return Y.column.columnWidth-(K||0)-t.cellPad;case"center":return(Y.column.columnWidth-(K||0))/2;default:return t.cellPad}}function H(Y){Y.attr("transform",function(K){var te=K.rowBlocks[0].auxiliaryBlocks.reduce(function(ce,pe){return ce+U(pe,1/0)},0),ne=j(K),se=U(ne,K.key),le=se+te;return c(0,le)}).selectAll("."+t.cn.cellRect).attr("height",function(K){return q(j(K),K.key).rowHeight})}function $(Y,K){for(var te=0,ne=K-1;ne>=0;ne--)te+=V(Y[ne]);return te}function U(Y,K){for(var te=0,ne=0;neo.length&&(a=a.slice(0,o.length)):a=[],l=0;l90&&(m-=180,f=-f),{angle:m,flip:f,p:i.c2p(s,a,o),offsetMultplier:h}}}}),qle=de({"src/traces/carpet/plot.js"(e,r){"use strict";var t=Yr(),i=hn(),a=Z8(),o=K8(),s=Ule(),l=Zo(),n=Qt(),u=n.strRotate,c=n.strTranslate,f=Bl();r.exports=function(x,S,M,C){var w=x._context.staticPlot,k=S.xaxis,A=S.yaxis,b=x._fullLayout,E=b._clips;n.makeTraceGroups(C,M,"trace").each(function(T){var F=t.select(this),D=T[0],R=D.trace,P=R.aaxis,z=R.baxis,I=n.ensureSingle(F,"g","minorlayer"),L=n.ensureSingle(F,"g","majorlayer"),B=n.ensureSingle(F,"g","boundarylayer"),O=n.ensureSingle(F,"g","labellayer");F.style("opacity",R.opacity),d(k,A,L,P,"a",P._gridlines,!0,w),d(k,A,L,z,"b",z._gridlines,!0,w),d(k,A,I,P,"a",P._minorgridlines,!0,w),d(k,A,I,z,"b",z._minorgridlines,!0,w),d(k,A,B,P,"a-boundary",P._boundarylines,w),d(k,A,B,z,"b-boundary",z._boundarylines,w);var G=p(x,k,A,R,D,O,P._labels,"a-label"),W=p(x,k,A,R,D,O,z._labels,"b-label");g(x,O,R,D,k,A,G,W),h(R,D,E,k,A)})};function h(v,x,S,M,C){var w,k,A,b,E=S.select("#"+v._clipPathId);E.size()||(E=S.append("clipPath").classed("carpetclip",!0));var T=n.ensureSingle(E,"path","carpetboundary"),F=x.clipsegments,D=[];for(b=0;b0?"start":"end","data-notex":1}).call(i.font,F.font).text(F.text).call(l.convertToTspans,v),L=i.bBox(this);I.attr("transform",c(R.p[0],R.p[1])+u(R.angle)+c(F.axis.labelpadding*z,L.height*.3)),E=Math.max(E,L.width+F.axis.labelpadding)}),b.exit().remove(),T.maxExtent=E,T}function g(v,x,S,M,C,w,k,A){var b,E,T,F,D=n.aggNums(Math.min,null,S.a),R=n.aggNums(Math.max,null,S.a),P=n.aggNums(Math.min,null,S.b),z=n.aggNums(Math.max,null,S.b);b=.5*(D+R),E=P,T=S.ab2xy(b,E,!0),F=S.dxyda_rough(b,E),k.angle===void 0&&n.extendFlat(k,s(S,C,w,T,S.dxydb_rough(b,E))),_(v,x,S,M,T,F,S.aaxis,C,w,k,"a-title"),b=D,E=.5*(P+z),T=S.ab2xy(b,E,!0),F=S.dxydb_rough(b,E),A.angle===void 0&&n.extendFlat(A,s(S,C,w,T,S.dxyda_rough(b,E))),_(v,x,S,M,T,F,S.baxis,C,w,A,"b-title")}var m=f.LINE_SPACING,y=(1-f.MID_SHIFT)/m+1;function _(v,x,S,M,C,w,k,A,b,E,T){var F=[];k.title.text&&F.push(k.title.text);var D=x.selectAll("text."+T).data(F),R=E.maxExtent;D.enter().append("text").classed(T,!0),D.each(function(){var P=s(S,A,b,C,w);["start","both"].indexOf(k.showticklabels)===-1&&(R=0);var z=k.title.font.size;R+=z+k.title.offset;var I=E.angle+(E.flip<0?180:0),L=(I-P.angle+450)%360,B=L>90&&L<270,O=t.select(this);O.text(k.title.text).call(l.convertToTspans,v),B&&(R=(-l.lineCount(O)+y)*m*z-R),O.attr("transform",c(P.p[0],P.p[1])+u(P.angle)+c(0,R)).attr("text-anchor","middle").call(i.font,k.title.font)}),D.exit().remove()}}}),Vle=de({"src/traces/carpet/cheater_basis.js"(e,r){"use strict";var t=Qt().isArrayOrTypedArray;r.exports=function(i,a,o){var s,l,n,u,c,f,h=[],d=t(i)?i.length:i,p=t(a)?a.length:a,g=t(i)?i:null,m=t(a)?a:null;g&&(n=(g.length-1)/(g[g.length-1]-g[0])/(d-1)),m&&(u=(m.length-1)/(m[m.length-1]-m[0])/(p-1));var y,_=1/0,v=-1/0;for(l=0;l=10)return null;for(var s=1/0,l=-1/0,n=a.length,u=0;u0&&(U=o.dxydi([],G-1,X,0,Z),Y.push(J[0]+U[0]/3),K.push(J[1]+U[1]/3),V=o.dxydi([],G-1,X,1,Z),Y.push($[0]-V[0]/3),K.push($[1]-V[1]/3)),Y.push($[0]),K.push($[1]),J=$;else for(G=o.a2i(O),N=Math.floor(Math.max(0,Math.min(P-2,G))),H=G-N,te.length=P,te.crossLength=z,te.xy=function(ne){return o.evalxy([],G,ne)},te.dxy=function(ne,se){return o.dxydj([],N,ne,H,se)},W=0;W0&&(j=o.dxydj([],N,W-1,H,0),Y.push(J[0]+j[0]/3),K.push(J[1]+j[1]/3),q=o.dxydj([],N,W-1,H,1),Y.push($[0]-q[0]/3),K.push($[1]-q[1]/3)),Y.push($[0]),K.push($[1]),J=$;return te.axisLetter=s,te.axis=C,te.crossAxis=E,te.value=O,te.constvar=l,te.index=g,te.x=Y,te.y=K,te.smoothing=E.smoothing,te}function B(O){var G,W,X,Z,J,N=[],H=[],$={};if($.length=M.length,$.crossLength=b.length,s==="b")for(X=Math.max(0,Math.min(z-2,O)),J=Math.min(1,Math.max(0,O-X)),$.xy=function(U){return o.evalxy([],U,O)},$.dxy=function(U,V){return o.dxydi([],U,X,V,J)},G=0;GM.length-1)&&w.push(i(B(u),{color:C.gridcolor,width:C.gridwidth,dash:C.griddash}));for(g=d;gM.length-1)&&!(_<0||_>M.length-1))for(v=M[c],x=M[_],n=0;nM[M.length-1])&&k.push(i(L(y),{color:C.minorgridcolor,width:C.minorgridwidth,dash:C.minorgriddash})));C.startline&&A.push(i(B(0),{color:C.startlinecolor,width:C.startlinewidth})),C.endline&&A.push(i(B(M.length-1),{color:C.endlinecolor,width:C.endlinewidth}))}else{for(f=5e-15,h=[Math.floor((M[M.length-1]-C.tick0)/C.dtick*(1+f)),Math.ceil((M[0]-C.tick0)/C.dtick/(1+f))].sort(function(O,G){return O-G}),d=h[0],p=h[1],g=d;g<=p;g++)m=C.tick0+C.dtick*g,w.push(i(L(m),{color:C.gridcolor,width:C.gridwidth,dash:C.griddash}));for(g=d-1;gM[M.length-1])&&k.push(i(L(y),{color:C.minorgridcolor,width:C.minorgridwidth,dash:C.minorgriddash}));C.startline&&A.push(i(L(M[0]),{color:C.startlinecolor,width:C.startlinewidth})),C.endline&&A.push(i(L(M[M.length-1]),{color:C.endlinecolor,width:C.endlinewidth}))}}}}),$le=de({"src/traces/carpet/calc_labels.js"(e,r){"use strict";var t=nn(),i=fn().extendFlat;r.exports=function(o,s){var l,n,u,c,f,h=s._labels=[],d=s._gridlines;for(l=0;l=0;l--)n[d-l]=i[p][l],u[d-l]=a[p][l];for(c.push({x:n,y:u,bicubic:f}),l=p,n=[],u=[];l>=0;l--)n[p-l]=i[l][0],u[p-l]=a[l][0];return c.push({x:n,y:u,bicubic:h}),c}}}),Yle=de({"src/traces/carpet/smooth_fill_2d_array.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o,s){var l,n,u,c=[],f=[],h=a[0].length,d=a.length;function p(W,X){var Z=0,J,N=0;return W>0&&(J=a[X][W-1])!==void 0&&(N++,Z+=J),W0&&(J=a[X-1][W])!==void 0&&(N++,Z+=J),X0&&n0&&lb);return t.log("Smoother converged to",E,"after",F,"iterations"),a}}}),Xle=de({"src/traces/carpet/constants.js"(e,r){"use strict";r.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Zle=de({"src/traces/carpet/catmull_rom.js"(e,r){"use strict";var t=.5;r.exports=function(a,o,s,l){var n=a[0]-o[0],u=a[1]-o[1],c=s[0]-o[0],f=s[1]-o[1],h=Math.pow(n*n+u*u,t/2),d=Math.pow(c*c+f*f,t/2),p=(d*d*n-h*h*c)*l,g=(d*d*u-h*h*f)*l,m=d*(h+d)*3,y=h*(h+d)*3;return[[o[0]+(m&&p/m),o[1]+(m&&g/m)],[o[0]-(y&&p/y),o[1]-(y&&g/y)]]}}}),Kle=de({"src/traces/carpet/compute_control_points.js"(e,r){"use strict";var t=Zle(),i=Qt().ensureArray;function a(o,s,l){var n=-.5*l[0]+1.5*s[0],u=-.5*l[1]+1.5*s[1];return[(2*n+o[0])/3,(2*u+o[1])/3]}r.exports=function(s,l,n,u,c,f){var h,d,p,g,m,y,_,v,x,S,M=n[0].length,C=n.length,w=c?3*M-2:M,k=f?3*C-2:C;for(s=i(s,k),l=i(l,k),p=0;pm&&w_&&ky||k<_||k>v},u.setScale=function(){var w=u._x,k=u._y,A=a(u._xctrl,u._yctrl,w,k,p.smoothing,g.smoothing);u._xctrl=A[0],u._yctrl=A[1],u.evalxy=o([u._xctrl,u._yctrl],h,d,p.smoothing,g.smoothing),u.dxydi=s([u._xctrl,u._yctrl],p.smoothing,g.smoothing),u.dxydj=l([u._xctrl,u._yctrl],p.smoothing,g.smoothing)},u.i2a=function(w){var k=Math.max(0,Math.floor(w[0]),h-2),A=w[0]-k;return(1-A)*c[k]+A*c[k+1]},u.j2b=function(w){var k=Math.max(0,Math.floor(w[1]),h-2),A=w[1]-k;return(1-A)*f[k]+A*f[k+1]},u.ij2ab=function(w){return[u.i2a(w[0]),u.j2b(w[1])]},u.a2i=function(w){var k=Math.max(0,Math.min(i(w,c),h-2)),A=c[k],b=c[k+1];return Math.max(0,Math.min(h-1,k+(w-A)/(b-A)))},u.b2j=function(w){var k=Math.max(0,Math.min(i(w,f),d-2)),A=f[k],b=f[k+1];return Math.max(0,Math.min(d-1,k+(w-A)/(b-A)))},u.ab2ij=function(w){return[u.a2i(w[0]),u.b2j(w[1])]},u.i2c=function(w,k){return u.evalxy([],w,k)},u.ab2xy=function(w,k,A){if(!A&&(wc[h-1]|kf[d-1]))return[!1,!1];var b=u.a2i(w),E=u.b2j(k),T=u.evalxy([],b,E);if(A){var F=0,D=0,R=[],P,z,I,L;wc[h-1]?(P=h-2,z=1,F=(w-c[h-1])/(c[h-1]-c[h-2])):(P=Math.max(0,Math.min(h-2,Math.floor(b))),z=b-P),kf[d-1]?(I=d-2,L=1,D=(k-f[d-1])/(f[d-1]-f[d-2])):(I=Math.max(0,Math.min(d-2,Math.floor(E))),L=E-I),F&&(u.dxydi(R,P,I,z,L),T[0]+=R[0]*F,T[1]+=R[1]*F),D&&(u.dxydj(R,P,I,z,L),T[0]+=R[0]*D,T[1]+=R[1]*D)}return T},u.c2p=function(w,k,A){return[k.c2p(w[0]),A.c2p(w[1])]},u.p2x=function(w,k,A){return[k.p2c(w[0]),A.p2c(w[1])]},u.dadi=function(w){var k=Math.max(0,Math.min(c.length-2,w));return c[k+1]-c[k]},u.dbdj=function(w){var k=Math.max(0,Math.min(f.length-2,w));return f[k+1]-f[k]},u.dxyda=function(w,k,A,b){var E=u.dxydi(null,w,k,A,b),T=u.dadi(w,A);return[E[0]/T,E[1]/T]},u.dxydb=function(w,k,A,b){var E=u.dxydj(null,w,k,A,b),T=u.dbdj(k,b);return[E[0]/T,E[1]/T]},u.dxyda_rough=function(w,k,A){var b=x*(A||.1),E=u.ab2xy(w+b,k,!0),T=u.ab2xy(w-b,k,!0);return[(E[0]-T[0])*.5/b,(E[1]-T[1])*.5/b]},u.dxydb_rough=function(w,k,A){var b=S*(A||.1),E=u.ab2xy(w,k+b,!0),T=u.ab2xy(w,k-b,!0);return[(E[0]-T[0])*.5/b,(E[1]-T[1])*.5/b]},u.dpdx=function(w){return w._m},u.dpdy=function(w){return w._m}}}}),rue=de({"src/traces/carpet/calc.js"(e,r){"use strict";var t=nn(),i=Qt().isArray1D,a=Vle(),o=Gle(),s=Hle(),l=$le(),n=Wle(),u=t3(),c=Yle(),f=e3(),h=tue();r.exports=function(p,g){var m=t.getFromId(p,g.xaxis),y=t.getFromId(p,g.yaxis),_=g.aaxis,v=g.baxis,x=g.x,S=g.y,M=[];x&&i(x)&&M.push("x"),S&&i(S)&&M.push("y"),M.length&&f(g,_,v,"a","b",M);var C=g._a=g._a||g.a,w=g._b=g._b||g.b;x=g._x||g.x,S=g._y||g.y;var k={};if(g._cheater){var A=_.cheatertype==="index"?C.length:C,b=v.cheatertype==="index"?w.length:w;x=a(A,b,g.cheaterslope)}g._x=x=u(x),g._y=S=u(S),c(x,C,w),c(S,C,w),h(g),g.setScale();var E=o(x),T=o(S),F=.5*(E[1]-E[0]),D=.5*(E[1]+E[0]),R=.5*(T[1]-T[0]),P=.5*(T[1]+T[0]),z=1.3;return E=[D-F*z,D+F*z],T=[P-R*z,P+R*z],g._extremes[m._id]=t.findExtremes(m,E,{padded:!0}),g._extremes[y._id]=t.findExtremes(y,T,{padded:!0}),s(g,"a","b"),s(g,"b","a"),l(g,_),l(g,v),k.clipsegments=n(g._xctrl,g._yctrl,_,v),k.x=x,k.y=S,k.a=C,k.b=w,[k]}}}),iue=de({"src/traces/carpet/index.js"(e,r){"use strict";r.exports={attributes:IS(),supplyDefaults:jle(),plot:qle(),calc:rue(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:ml(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),aue=de({"lib/carpet.js"(e,r){"use strict";r.exports=iue()}}),J8=de({"src/traces/scattercarpet/attributes.js"(e,r){"use strict";var t=Kd(),i=tl(),a=ri(),{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=Vo(),n=cs(),u=fn().extendFlat,c=i.marker,f=i.line,h=c.line;r.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:u({},i.mode,{dflt:"markers"}),text:u({},i.text,{}),texttemplate:s({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:l({editType:"plot"}),hovertext:u({},i.hovertext,{}),line:{color:f.color,width:f.width,dash:f.dash,backoff:f.backoff,shape:u({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:i.connectgaps,fill:u({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:t(),marker:u({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:u({width:h.width,dash:h.dash,editType:"calc"},n("marker.line")),gradient:c.gradient,editType:"calc"},n("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:u({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:i.hoveron,hovertemplate:o(),hovertemplatefallback:l(),zorder:i.zorder}}}),nue=de({"src/traces/scattercarpet/defaults.js"(e,r){"use strict";var t=Qt(),i=Zd(),a=bs(),o=Nh(),s=yd(),l=p1(),n=_d(),u=Jd(),c=J8();r.exports=function(h,d,p,g){function m(C,w){return t.coerce(h,d,c,C,w)}m("carpet"),d.xaxis="x",d.yaxis="y";var y=m("a"),_=m("b"),v=Math.min(y.length,_.length);if(!v){d.visible=!1;return}d._length=v,m("text"),m("texttemplate"),m("texttemplatefallback"),m("hovertext");var x=v0?k=C.labelprefix.replace(/ = $/,""):k=C._hovertitle,v.push(k+": "+w.toFixed(3)+C.labelsuffix)}if(!m.hovertemplate){var S=g.hi||m.hoverinfo,M=S.split("+");M.indexOf("all")!==-1&&(M=["a","b","text"]),M.indexOf("a")!==-1&&x(y.aaxis,g.a),M.indexOf("b")!==-1&&x(y.baxis,g.b),v.push("y: "+c.yLabel),M.indexOf("text")!==-1&&i(g,m,v),c.extraText=v.join("
")}return u}}}),cue=de({"src/traces/scattercarpet/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){var n=s[l];return i.a=n.a,i.b=n.b,i.y=n.y,i}}}),fue=de({"src/traces/scattercarpet/index.js"(e,r){"use strict";r.exports={attributes:J8(),supplyDefaults:nue(),colorbar:Yu(),formatLabels:oue(),calc:sue(),plot:lue(),style:lf().style,styleOnSelect:lf().styleOnSelect,hoverPoints:uue(),selectPoints:Mv(),eventData:cue(),moduleType:"trace",name:"scattercarpet",basePlotModule:ml(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),hue=de({"lib/scattercarpet.js"(e,r){"use strict";r.exports=fue()}}),Q8=de({"src/traces/contourcarpet/attributes.js"(e,r){"use strict";var t=x1(),i=Vy(),a=cs(),o=fn().extendFlat,s=i.contours;r.exports=o({carpet:{valType:"string",editType:"calc"},z:t.z,a:t.x,a0:t.x0,da:t.dx,b:t.y,b0:t.y0,db:t.dy,text:t.text,hovertext:t.hovertext,transpose:t.transpose,atype:t.xtype,btype:t.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},zorder:i.zorder},a("",{cLetter:"z",autoColorDflt:!1}))}}),ej=de({"src/traces/contourcarpet/defaults.js"(e,r){"use strict";var t=Qt(),i=Qw(),a=Q8(),o=Hk(),s=d3(),l=p3();r.exports=function(u,c,f,h){function d(y,_){return t.coerce(u,c,a,y,_)}function p(y){return t.coerce2(u,c,a,y)}if(d("carpet"),u.a&&u.b){var g=i(u,c,d,h,"a","b");if(!g){c.visible=!1;return}d("text");var m=d("contours.type")==="constraint";m?o(u,c,d,h,f,{hasHover:!1}):(s(u,c,d,p),l(u,c,d,h,{hasHover:!1}))}else c._defaultColor=f,c._length=null;d("zorder")}}}),due=de({"src/traces/contourcarpet/calc.js"(e,r){"use strict";var t=hc(),i=Qt(),a=e3(),o=t3(),s=r3(),l=i3(),n=Ck(),u=ej(),c=RS(),f=zk();r.exports=function(p,g){var m=g._carpetTrace=c(p,g);if(!(!m||!m.visible||m.visible==="legendonly")){if(!g.a||!g.b){var y=p.data[m.index],_=p.data[g.index];_.a||(_.a=y.a),_.b||(_.b=y.b),u(_,g,g._defaultColor,p._fullLayout)}var v=h(p,g);return f(g,g._z),v}};function h(d,p){var g=p._carpetTrace,m=g.aaxis,y=g.baxis,_,v,x,S,M,C,w;m._minDtick=0,y._minDtick=0,i.isArray1D(p.z)&&a(p,m,y,"a","b",["z"]),_=p._a=p._a||p.a,S=p._b=p._b||p.b,_=_?m.makeCalcdata(p,"_a"):[],S=S?y.makeCalcdata(p,"_b"):[],v=p.a0||0,x=p.da||1,M=p.b0||0,C=p.db||1,w=p._z=o(p._z||p.z,p.transpose),p._emptypoints=l(w),s(w,p._emptypoints);var k=i.maxRowLength(w),A=p.xtype==="scaled"?"":_,b=n(p,A,v,x,k,m),E=p.ytype==="scaled"?"":S,T=n(p,E,M,C,w.length,y),F={a:b,b:T,z:w};return p.contours.type==="levels"&&p.contours.coloring!=="none"&&t(d,p,{vals:w,containerStr:"",cLetter:"z"}),[F]}}}),pue=de({"src/traces/carpet/axis_aligned_line.js"(e,r){"use strict";var t=Qt().isArrayOrTypedArray;r.exports=function(i,a,o,s){var l,n,u,c,f,h,d,p,g,m,y,_,v,x=t(o)?"a":"b",S=x==="a"?i.aaxis:i.baxis,M=S.smoothing,C=x==="a"?i.a2i:i.b2j,w=x==="a"?o:s,k=x==="a"?s:o,A=x==="a"?a.a.length:a.b.length,b=x==="a"?a.b.length:a.a.length,E=Math.floor(x==="a"?i.b2j(k):i.a2i(k)),T=x==="a"?function(X){return i.evalxy([],X,E)}:function(X){return i.evalxy([],E,X)};M&&(u=Math.max(0,Math.min(b-2,E)),c=E-u,n=x==="a"?function(X,Z){return i.dxydi([],X,u,Z,c)}:function(X,Z){return i.dxydj([],u,X,c,Z)});var F=C(w[0]),D=C(w[1]),R=F0?Math.floor:Math.ceil,I=R>0?Math.ceil:Math.floor,L=R>0?Math.min:Math.max,B=R>0?Math.max:Math.min,O=z(F+P),G=I(D-P);d=T(F);var W=[[d]];for(l=O;l*R=0;te--)q=B.clipsegments[te],Y=i([],q.x,F.c2p),K=i([],q.y,D.c2p),Y.reverse(),K.reverse(),ne.push(a(Y,K,q.bicubic));var se="M"+ne.join("L")+"Z";M(P,B.clipsegments,F,D,Z,N),C(I,P,F,D,j,$,H,L,B,N,se),y(P,X,A,z,W,b,L),o.setClipUrl(P,L._clipPathId,A)})};function m(k,A){var b,E,T,F,D,R,P,z,I;for(b=0;bX&&(E.max=X),E.len=E.max-E.min}function v(k,A,b){var E=k.getPointAtLength(A),T=k.getPointAtLength(b),F=T.x-E.x,D=T.y-E.y,R=Math.sqrt(F*F+D*D);return[F/R,D/R]}function x(k){var A=Math.sqrt(k[0]*k[0]+k[1]*k[1]);return[k[0]/A,k[1]/A]}function S(k,A){var b=Math.abs(k[0]*A[0]+k[1]*A[1]),E=Math.sqrt(1-b*b);return E/b}function M(k,A,b,E,T,F){var D,R,P,z,I=s.ensureSingle(k,"g","contourbg"),L=I.selectAll("path").data(F==="fill"&&!T?[0]:[]);L.enter().append("path"),L.exit().remove();var B=[];for(z=0;z=0&&(O=Y,W=X):Math.abs(B[1]-O[1])=0&&(O=Y,W=X):s.log("endpt to newendpt is not vert. or horz.",B,O,Y)}if(W>=0)break;z+=j(B,O),B=O}if(W===A.edgepaths.length){s.log("unclosed perimeter path");break}P=W,L=I.indexOf(P)===-1,L&&(P=I[0],z+=j(B,O)+"Z",B=null)}for(P=0;Pw):C=R>T,w=R;var P=m(T,F,D,R);P.pos=E,P.yc=(T+R)/2,P.i=b,P.dir=C?"increasing":"decreasing",P.x=P.pos,P.y=[D,F],k&&(P.orig_p=d[b]),S&&(P.tx=h.text[b]),M&&(P.htx=h.hovertext[b]),A.push(P)}else A.push({pos:E,empty:!0})}return h._extremes[g._id]=a.findExtremes(g,t.concat(v,_),{padded:!0}),A.length&&(A[0].t={labels:{open:i(f,"open:")+" ",high:i(f,"high:")+" ",low:i(f,"low:")+" ",close:i(f,"close:")+" "}}),A}function c(f,h,d){var p=d._minDiff;if(!p){var g=f._fullData,m=[];p=1/0;var y;for(y=0;y"+x.labels[E]+t.hoverLabelText(_,T,v.yhoverformat)):(D=i.extendFlat({},M),D.y0=D.y1=F,D.yLabelVal=T,D.yLabel=x.labels[E]+t.hoverLabelText(_,T,v.yhoverformat),D.name="",S.push(D),A[T]=D)}return S}function h(d,p,g,m){var y=d.cd,_=d.ya,v=y[0].trace,x=y[0].t,S=c(d,p,g,m);if(!S)return[];var M=S.index,C=y[M],w=S.index=C.i,k=C.dir;function A(P){return x.labels[P]+t.hoverLabelText(_,v[P][w],v.yhoverformat)}var b=C.hi||v.hoverinfo||"",E=b.split("+"),T=b==="all",F=T||E.indexOf("y")!==-1,D=T||E.indexOf("text")!==-1,R=F?[A("open"),A("high"),A("low"),A("close")+" "+n[k]]:[];return D&&s(C,v,R),S.extraText=R.join("
"),S.y0=S.y1=_.c2p(C.yc,!0),[S]}r.exports={hoverPoints:u,hoverSplit:f,hoverOnPoints:h}}}),aj=de({"src/traces/ohlc/select.js"(e,r){"use strict";r.exports=function(i,a){var o=i.cd,s=i.xaxis,l=i.yaxis,n=[],u,c=o[0].t.bPos||0;if(a===!1)for(u=0;up?function(v){return v<=0}:function(v){return v>=0};c.c2g=function(v){var x=c.c2l(v)-d;return(_(x)?x:0)+y},c.g2c=function(v){return c.l2c(v+d-y)},c.g2p=function(v){return v*m},c.c2p=function(v){return c.g2p(c.c2g(v))}}}function l(c,f){return f==="degrees"?a(c):c}function n(c,f){return f==="degrees"?o(c):c}function u(c,f){var h=c.type;if(h==="linear"){var d=c.d2c,p=c.c2d;c.d2c=function(g,m){return l(d(g),m)},c.c2d=function(g,m){return p(n(g,m))}}c.makeCalcdata=function(g,m){var y=g[m],_=g._length,v,x,S=function(A){return c.d2c(A,g.thetaunit)};if(y)for(v=new Array(_),x=0;x<_;x++)v[x]=S(y[x]);else{var M=m+"0",C="d"+m,w=M in g?S(g[M]):0,k=g[C]?S(g[C]):(c.period||2*Math.PI)/_;for(v=new Array(_),x=0;x<_;x++)v[x]=w+x*k}return v},c.setGeometry=function(){var g=f.sector,m=g.map(a),y={clockwise:-1,counterclockwise:1}[c.direction],_=a(c.rotation),v=function(b){return y*b+_},x=function(b){return(b-_)/y},S,M,C,w;switch(h){case"linear":M=S=t.identity,w=a,C=o,c.range=t.isFullCircle(m)?[g[0],g[0]+360]:m.map(x).map(o);break;case"category":var k=c._categories.length,A=c.period?Math.max(c.period,k):k;A===0&&(A=1),M=w=function(b){return b*2*Math.PI/A},S=C=function(b){return b*A/Math.PI/2},c.range=[0,A];break}c.c2g=function(b){return v(M(b))},c.g2c=function(b){return S(x(b))},c.t2g=function(b){return v(w(b))},c.g2t=function(b){return C(x(b))}}}}}),BS=de({"src/plots/polar/constants.js"(e,r){"use strict";r.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}}),OS=de({"src/plots/polar/helpers.js"(e,r){"use strict";var t=Qt(),i=Fy().tester,a=t.findIndexOfMin,o=t.isAngleInsideSector,s=t.angleDelta,l=t.angleDist;function n(x,S,M,C,w){if(!o(S,C))return!1;var k,A;M[0]0?A:1/0},C=a(S,M),w=t.mod(C+1,S.length);return[S[C],S[w]]}function m(x){return Math.abs(x)>1e-10?x:0}function y(x,S,M){S=S||0,M=M||0;for(var C=x.length,w=new Array(C),k=0;k0?1:0}function i(n){var u=n[0],c=n[1];if(!isFinite(u)||!isFinite(c))return[1,0];var f=(u+1)*(u+1)+c*c;return[(u*u+c*c-1)/f,2*c/f]}function a(n,u){var c=u[0],f=u[1];return[c*n.radius+n.cx,-f*n.radius+n.cy]}function o(n,u){return u*n.radius}function s(n,u,c,f){var h=a(n,i([c,u])),d=h[0],p=h[1],g=a(n,i([f,u])),m=g[0],y=g[1];if(u===0)return["M"+d+","+p,"L"+m+","+y].join(" ");var _=o(n,1/Math.abs(u));return["M"+d+","+p,"A"+_+","+_+" 0 0,"+(u<0?1:0)+" "+m+","+y].join(" ")}function l(n,u,c,f){var h=o(n,1/(u+1)),d=a(n,i([u,c])),p=d[0],g=d[1],m=a(n,i([u,f])),y=m[0],_=m[1];if(t(c)!==t(f)){var v=a(n,i([u,0])),x=v[0],S=v[1];return["M"+p+","+g,"A"+h+","+h+" 0 0,"+(0pe?(xe=Y,ye=Y*pe,ee=(K-ye)/$.h/2,fe=[j[0],j[1]],ae=[q[0]+ee,q[1]-ee]):(xe=K/pe,ye=K,ee=(Y-xe)/$.w/2,fe=[j[0]+ee,j[1]-ee],ae=[q[0],q[1]]),N.xLength2=xe,N.yLength2=ye,N.xDomain2=fe,N.yDomain2=ae;var ie=N.xOffset2=$.l+$.w*fe[0],Q=N.yOffset2=$.t+$.h*(1-ae[1]),ue=N.radius=xe/se,ge=N.innerRadius=N.getHole(J)*ue,Me=N.cx=ie-ue*ne[0],Te=N.cy=Q+ue*ne[3],je=N.cxx=Me-ie,Ve=N.cyy=Te-Q,Ze=U.side,Ke;Ze==="counterclockwise"?(Ke=Ze,Ze="top"):Ze==="clockwise"&&(Ke=Ze,Ze="bottom"),N.radialAxis=N.mockAxis(Z,J,U,{_id:"x",side:Ze,_trueSide:Ke,domain:[ge/$.w,ue/$.w]}),N.angularAxis=N.mockAxis(Z,J,V,{side:"right",domain:[0,Math.PI],autorange:!1}),N.doAutoRange(Z,J),N.updateAngularAxis(Z,J),N.updateRadialAxis(Z,J),N.updateRadialAxisTitle(Z,J),N.xaxis=N.mockCartesianAxis(Z,J,{_id:"x",domain:fe}),N.yaxis=N.mockCartesianAxis(Z,J,{_id:"y",domain:ae});var vt=N.pathSubplot();N.clipPaths.forTraces.select("path").attr("d",vt).attr("transform",s(je,Ve)),H.frontplot.attr("transform",s(ie,Q)).call(n.setClipUrl,N._hasClipOnAxisFalse?null:N.clipIds.forTraces,N.gd),H.bg.attr("d",vt).attr("transform",s(Me,Te)).call(l.fill,J.bgcolor)},B.mockAxis=function(Z,J,N,H){var $=a.extendFlat({},N,H);return h($,J,Z),$},B.mockCartesianAxis=function(Z,J,N){var H=this,$=H.isSmith,U=N._id,V=a.extendFlat({type:"linear"},N);f(V,Z);var j={x:[0,2],y:[1,3]};return V.setRange=function(){var q=H.sectorBBox,Y=j[U],K=H.radialAxis._rl,te=(K[1]-K[0])/(1-H.getHole(J));V.range=[q[Y[0]]*te,q[Y[1]]*te]},V.isPtWithinRange=U==="x"&&!$?function(q){return H.isPtInside(q)}:function(){return!0},V.setRange(),V.setScale(),V},B.doAutoRange=function(Z,J){var N=this,H=N.gd,$=N.radialAxis,U=N.getRadial(J);d(H,$);var V=$.range;if(U.range=V.slice(),U._input.range=V.slice(),$._rl=[$.r2l(V[0],null,"gregorian"),$.r2l(V[1],null,"gregorian")],$.minallowed!==void 0){var j=$.r2l($.minallowed);$._rl[0]>$._rl[1]?$._rl[1]=Math.max($._rl[1],j):$._rl[0]=Math.max($._rl[0],j)}if($.maxallowed!==void 0){var q=$.r2l($.maxallowed);$._rl[0]<$._rl[1]?$._rl[1]=Math.min($._rl[1],q):$._rl[0]=Math.min($._rl[0],q)}},B.updateRadialAxis=function(Z,J){var N=this,H=N.gd,$=N.layers,U=N.radius,V=N.innerRadius,j=N.cx,q=N.cy,Y=N.getRadial(J),K=P(N.getSector(J)[0],360),te=N.radialAxis,ne=V90&&K<=270&&(te.tickangle=180);var le=se?function(ue){var ge=D(N,E([ue.x,0]));return s(ge[0]-j,ge[1]-q)}:function(ue){return s(te.l2p(ue.x)+V,0)},ce=se?function(ue){return F(N,ue.x,-1/0,1/0)}:function(ue){return N.pathArc(te.r2p(ue.x)+V)},pe=O(Y);if(N.radialTickLayout!==pe&&($["radial-axis"].selectAll(".xtick").remove(),N.radialTickLayout=pe),ne){te.setScale();var xe=0,ye=se?(te.tickvals||[]).filter(function(ue){return ue>=0}).map(function(ue){return c.tickText(te,ue,!0,!1)}):c.calcTicks(te),fe=se?ye:c.clipEnds(te,ye),ae=c.getTickSigns(te)[2];se&&((te.ticks==="top"&&te.side==="bottom"||te.ticks==="bottom"&&te.side==="top")&&(ae=-ae),te.ticks==="top"&&te.side==="top"&&(xe=-te.ticklen),te.ticks==="bottom"&&te.side==="bottom"&&(xe=te.ticklen)),c.drawTicks(H,te,{vals:ye,layer:$["radial-axis"],path:c.makeTickPath(te,0,ae),transFn:le,crisp:!1}),c.drawGrid(H,te,{vals:fe,layer:$["radial-grid"],path:ce,transFn:a.noop,crisp:!1}),c.drawLabels(H,te,{vals:ye,layer:$["radial-axis"],transFn:le,labelFns:c.makeLabelFns(te,xe)})}var ee=N.radialAxisAngle=N.vangles?I(W(z(Y.angle),N.vangles)):Y.angle,ie=s(j,q),Q=ie+o(-ee);X($["radial-axis"],ne&&(Y.showticklabels||Y.ticks),{transform:Q}),X($["radial-grid"],ne&&Y.showgrid,{transform:se?"":ie}),X($["radial-line"].select("line"),ne&&Y.showline,{x1:se?-U:V,y1:0,x2:U,y2:0,transform:Q}).attr("stroke-width",Y.linewidth).call(l.stroke,Y.linecolor)},B.updateRadialAxisTitle=function(Z,J,N){if(!this.isSmith){var H=this,$=H.gd,U=H.radius,V=H.cx,j=H.cy,q=H.getRadial(J),Y=H.id+"title",K=0;if(q.title){var te=n.bBox(H.layers["radial-axis"].node()).height,ne=q.title.font.size,se=q.side;K=se==="top"?ne:se==="counterclockwise"?-(te+ne*.4):te+ne*.8}var le=N!==void 0?N:H.radialAxisAngle,ce=z(le),pe=Math.cos(ce),xe=Math.sin(ce),ye=V+U/2*pe+K*xe,fe=j-U/2*xe+K*pe;H.layers["radial-axis-title"]=y.draw($,Y,{propContainer:q,propName:H.id+".radialaxis.title.text",placeholder:R($,"Click to enter radial axis title"),attributes:{x:ye,y:fe,"text-anchor":"middle"},transform:{rotate:-le}})}},B.updateAngularAxis=function(Z,J){var N=this,H=N.gd,$=N.layers,U=N.radius,V=N.innerRadius,j=N.cx,q=N.cy,Y=N.getAngular(J),K=N.angularAxis,te=N.isSmith;te||(N.fillViewInitialKey("angularaxis.rotation",Y.rotation),K.setGeometry(),K.setScale());var ne=te?function(ge){var Me=D(N,E([0,ge.x]));return Math.atan2(Me[0]-j,Me[1]-q)-Math.PI/2}:function(ge){return K.t2g(ge.x)};K.type==="linear"&&K.thetaunit==="radians"&&(K.tick0=I(K.tick0),K.dtick=I(K.dtick));var se=function(ge){return s(j+U*Math.cos(ge),q-U*Math.sin(ge))},le=te?function(ge){var Me=D(N,E([0,ge.x]));return s(Me[0],Me[1])}:function(ge){return se(ne(ge))},ce=te?function(ge){var Me=D(N,E([0,ge.x])),Te=Math.atan2(Me[0]-j,Me[1]-q)-Math.PI/2;return s(Me[0],Me[1])+o(-I(Te))}:function(ge){var Me=ne(ge);return se(Me)+o(-I(Me))},pe=te?function(ge){return T(N,ge.x,0,1/0)}:function(ge){var Me=ne(ge),Te=Math.cos(Me),je=Math.sin(Me);return"M"+[j+V*Te,q-V*je]+"L"+[j+U*Te,q-U*je]},xe=c.makeLabelFns(K,0),ye=xe.labelStandoff,fe={};fe.xFn=function(ge){var Me=ne(ge);return Math.cos(Me)*ye},fe.yFn=function(ge){var Me=ne(ge),Te=Math.sin(Me)>0?.2:1;return-Math.sin(Me)*(ye+ge.fontSize*Te)+Math.abs(Math.cos(Me))*(ge.fontSize*w)},fe.anchorFn=function(ge){var Me=ne(ge),Te=Math.cos(Me);return Math.abs(Te)<.1?"middle":Te>0?"start":"end"},fe.heightFn=function(ge,Me,Te){var je=ne(ge);return-.5*(1+Math.sin(je))*Te};var ae=O(Y);N.angularTickLayout!==ae&&($["angular-axis"].selectAll("."+K._id+"tick").remove(),N.angularTickLayout=ae);var ee=te?[1/0].concat(K.tickvals||[]).map(function(ge){return c.tickText(K,ge,!0,!1)}):c.calcTicks(K);te&&(ee[0].text="\u221E",ee[0].fontSize*=1.75);var ie;if(J.gridshape==="linear"?(ie=ee.map(ne),a.angleDelta(ie[0],ie[1])<0&&(ie=ie.slice().reverse())):ie=null,N.vangles=ie,K.type==="category"&&(ee=ee.filter(function(ge){return a.isAngleInsideSector(ne(ge),N.sectorInRad)})),K.visible){var Q=K.ticks==="inside"?-1:1,ue=(K.linewidth||1)/2;c.drawTicks(H,K,{vals:ee,layer:$["angular-axis"],path:"M"+Q*ue+",0h"+Q*K.ticklen,transFn:ce,crisp:!1}),c.drawGrid(H,K,{vals:ee,layer:$["angular-grid"],path:pe,transFn:a.noop,crisp:!1}),c.drawLabels(H,K,{vals:ee,layer:$["angular-axis"],repositionOnUpdate:!0,transFn:le,labelFns:fe})}X($["angular-line"].select("path"),Y.showline,{d:N.pathSubplot(),transform:s(j,q)}).attr("stroke-width",Y.linewidth).call(l.stroke,Y.linecolor)},B.updateFx=function(Z,J){if(!this.gd._context.staticPlot){var N=!this.isSmith;N&&(this.updateAngularDrag(Z),this.updateRadialDrag(Z,J,0),this.updateRadialDrag(Z,J,1)),this.updateHoverAndMainDrag(Z)}},B.updateHoverAndMainDrag=function(Z){var J=this,N=J.isSmith,H=J.gd,$=J.layers,U=Z._zoomlayer,V=k.MINZOOM,j=k.OFFEDGE,q=J.radius,Y=J.innerRadius,K=J.cx,te=J.cy,ne=J.cxx,se=J.cyy,le=J.sectorInRad,ce=J.vangles,pe=J.radialAxis,xe=A.clampTiny,ye=A.findXYatLength,fe=A.findEnclosingVertexAngles,ae=k.cornerHalfWidth,ee=k.cornerLen/2,ie,Q,ue=p.makeDragger($,"path","maindrag",Z.dragmode===!1?"none":"crosshair");t.select(ue).attr("d",J.pathSubplot()).attr("transform",s(K,te)),ue.onmousemove=function(ft){m.hover(H,ft,J.id),H._fullLayout._lasthover=ue,H._fullLayout._hoversubplot=J.id},ue.onmouseout=function(ft){H._dragging||g.unhover(H,ft)};var ge={element:ue,gd:H,subplot:J.id,plotinfo:{id:J.id,xaxis:J.xaxis,yaxis:J.yaxis},xaxes:[J.xaxis],yaxes:[J.yaxis]},Me,Te,je,Ve,Ze,Ke,vt,xt,Pt;function mt(ft,At){return Math.sqrt(ft*ft+At*At)}function Mt(ft,At){return mt(ft-ne,At-se)}function lt(ft,At){return Math.atan2(se-At,ft-ne)}function qe(ft,At){return[ft*Math.cos(At),ft*Math.sin(-At)]}function Ye(ft,At){if(ft===0)return J.pathSector(2*ae);var ht=ee/ft,Gt=At-ht,fr=At+ht,gt=Math.max(0,Math.min(ft,q)),yt=gt-ae,kt=gt+ae;return"M"+qe(yt,Gt)+"A"+[yt,yt]+" 0,0,0 "+qe(yt,fr)+"L"+qe(kt,fr)+"A"+[kt,kt]+" 0,0,1 "+qe(kt,Gt)+"Z"}function me(ft,At,ht){if(ft===0)return J.pathSector(2*ae);var Gt=qe(ft,At),fr=qe(ft,ht),gt=xe((Gt[0]+fr[0])/2),yt=xe((Gt[1]+fr[1])/2),kt,Lt;if(gt&&yt){var Ct=yt/gt,$t=-1/Ct,mr=ye(ae,Ct,gt,yt);kt=ye(ee,$t,mr[0][0],mr[0][1]),Lt=ye(ee,$t,mr[1][0],mr[1][1])}else{var br,Er;yt?(br=ee,Er=ae):(br=ae,Er=ee),kt=[[gt-br,yt-Er],[gt+br,yt-Er]],Lt=[[gt-br,yt+Er],[gt+br,yt+Er]]}return"M"+kt.join("L")+"L"+Lt.reverse().join("L")+"Z"}function _e(){je=null,Ve=null,Ze=J.pathSubplot(),Ke=!1;var ft=H._fullLayout[J.id];vt=l.luminosity(ft.bgcolor),xt=p.makeZoombox(U,vt,K,te,Ze),xt.attr("fill-rule","evenodd"),Pt=p.makeCorners(U,K,te),x(H)}function Ae(ft,At){return At=Math.max(Math.min(At,q),Y),ftV?(ft-1&&ft===1&&v(At,H,[J.xaxis],[J.yaxis],J.id,ge),ht.indexOf("event")>-1&&m.click(H,At,J.id)}ge.prepFn=function(ft,At,ht){var Gt=H._fullLayout.dragmode,fr=ue.getBoundingClientRect();H._fullLayout._calcInverseTransform(H);var gt=H._fullLayout._invTransform;ie=H._fullLayout._invScaleX,Q=H._fullLayout._invScaleY;var yt=a.apply3DTransform(gt)(At-fr.left,ht-fr.top);if(Me=yt[0],Te=yt[1],ce){var kt=A.findPolygonOffset(q,le[0],le[1],ce);Me+=ne+kt[0],Te+=se+kt[1]}switch(Gt){case"zoom":ge.clickFn=rt,N||(ce?ge.moveFn=Je:ge.moveFn=Ee,ge.doneFn=Ue,_e(ft,At,ht));break;case"select":case"lasso":_(ft,At,ht,ge,Gt);break}},g.init(ge)},B.updateRadialDrag=function(Z,J,N){var H=this,$=H.gd,U=H.layers,V=H.radius,j=H.innerRadius,q=H.cx,Y=H.cy,K=H.radialAxis,te=k.radialDragBoxSize,ne=te/2;if(!K.visible)return;var se=z(H.radialAxisAngle),le=K._rl,ce=le[0],pe=le[1],xe=le[N],ye=.75*(le[1]-le[0])/(1-H.getHole(J))/V,fe,ae,ee;N?(fe=q+(V+ne)*Math.cos(se),ae=Y-(V+ne)*Math.sin(se),ee="radialdrag"):(fe=q+(j-ne)*Math.cos(se),ae=Y-(j-ne)*Math.sin(se),ee="radialdrag-inner");var ie=p.makeRectDragger(U,ee,"crosshair",-ne,-ne,te,te),Q={element:ie,gd:$};Z.dragmode===!1&&(Q.dragmode=!1),X(t.select(ie),K.visible&&j0!=(N?Me>ce:Me=90||$>90&&U>=450?se=1:j<=0&&Y<=0?se=0:se=Math.max(j,Y),$<=180&&U>=180||$>180&&U>=540?K=-1:V>=0&&q>=0?K=0:K=Math.min(V,q),$<=270&&U>=270||$>270&&U>=630?te=-1:j>=0&&Y>=0?te=0:te=Math.min(j,Y),U>=360?ne=1:V<=0&&q<=0?ne=0:ne=Math.max(V,q),[K,te,ne,se]}function W(Z,J){var N=function($){return a.angleDist(Z,$)},H=a.findIndexOfMin(J,N);return J[H]}function X(Z,J,N){return J?(Z.attr("display",null),Z.attr(N)):Z&&Z.attr("display","none"),Z}}}),uj=de({"src/plots/polar/layout_attributes.js"(e,r){"use strict";var t=Jo(),i=Mu(),a=Is().attributes,o=Qt().extendFlat,s=Ps().overrideAll,l=s({color:i.color,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash},"plot","from-root"),n=s({tickmode:i.minor.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,minorloglabels:i.minorloglabels,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,layer:i.layer},"plot","from-root"),u={visible:o({},i.visible,{dflt:!0}),type:o({},i.type,{values:["-","linear","log","date","category"]}),autotypenumbers:i.autotypenumbers,autorangeoptions:{minallowed:i.autorangeoptions.minallowed,maxallowed:i.autorangeoptions.maxallowed,clipmin:i.autorangeoptions.clipmin,clipmax:i.autorangeoptions.clipmax,include:i.autorangeoptions.include,editType:"plot"},autorange:o({},i.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:o({},i.minallowed,{editType:"plot"}),maxallowed:o({},i.maxallowed,{editType:"plot"}),range:o({},i.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:i.categoryorder,categoryarray:i.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:i.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:o({},i.title.text,{editType:"plot",dflt:""}),font:o({},i.title.font,{editType:"plot"}),editType:"plot"},hoverformat:i.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};o(u,l,n);var c={visible:o({},i.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:i.autotypenumbers,categoryorder:i.categoryorder,categoryarray:i.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:i.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};o(c,l,n),r.exports={domain:a({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:t.background},radialaxis:u,angularaxis:c,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),Eue=de({"src/plots/polar/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=Ro(),o=Ev(),s=$u().getSubplotData,l=_v(),n=f1(),u=h0(),c=d0(),f=Ow(),h=Ry(),d=LE(),p=h1(),g=uj(),m=oj(),y=BS(),_=y.axisNames;function v(S,M,C,w){var k=C("bgcolor");w.bgColor=i.combine(k,w.paper_bgcolor);var A=C("sector");C("hole");var b=s(w.fullData,y.name,w.id),E=w.layoutOut,T;function F(ne,se){return C(T+"."+ne,se)}for(var D=0;D<_.length;D++){T=_[D],t.isPlainObject(S[T])||(S[T]={});var R=S[T],P=a.newContainer(M,T);P._id=P._name=T,P._attr=w.id+"."+T,P._traceIndices=b.map(function(ne){return ne.index});var z=y.axisName2dataArray[T],I=x(R,P,F,b,z,w);f(R,P,F,{axData:b,dataAttr:z});var L=F("visible");switch(m(P,M,E),F("uirevision",M.uirevision),P._m=1,T){case"radialaxis":F("minallowed"),F("maxallowed");var B=F("range"),O=P.getAutorangeDflt(B),G=F("autorange",O),W;B&&(B[0]===null&&B[1]===null||(B[0]===null||B[1]===null)&&(G==="reversed"||G===!0)||B[0]!==null&&(G==="min"||G==="max reversed")||B[1]!==null&&(G==="max"||G==="min reversed"))&&(B=void 0,delete P.range,P.autorange=!0,W=!0),W||(O=P.getAutorangeDflt(B),G=F("autorange",O)),R.autorange=G,G&&(d(F,G,B),(I==="linear"||I==="-")&&F("rangemode"),P.isReversed()&&(P._m=-1)),P.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if(I==="date"){t.log("Polar plots do not support date angular axes yet.");for(var X=0;X")}}r.exports={hoverPoints:i,makeHoverPointText:a}}}),Due=de({"src/traces/scatterpolar/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:NS(),categories:["polar","symbols","showLegend","scatter-like"],attributes:W2(),supplyDefaults:jS().supplyDefaults,colorbar:Yu(),formatLabels:US(),calc:kue(),plot:Cue(),style:lf().style,styleOnSelect:lf().styleOnSelect,hoverPoints:qS().hoverPoints,selectPoints:Mv(),meta:{}}}}),Lue=de({"lib/scatterpolar.js"(e,r){"use strict";r.exports=Due()}}),cj=de({"src/traces/scatterpolargl/attributes.js"(e,r){"use strict";var t=W2(),{cliponaxis:i,hoveron:a}=t,o=Lr(t,["cliponaxis","hoveron"]),{connectgaps:s,line:{color:l,dash:n,width:u},fill:c,fillcolor:f,marker:h,textfont:d,textposition:p}=__();r.exports=ar(Ot({},o),{connectgaps:s,fill:c,fillcolor:f,line:{color:l,dash:n,editType:"calc",width:u},marker:h,textfont:d,textposition:p})}}),Fue=de({"src/traces/scatterpolargl/defaults.js"(e,r){"use strict";var t=Qt(),i=bs(),a=jS().handleRThetaDefaults,o=Nh(),s=yd(),l=_d(),n=Jd(),u=Zd().PTS_LINESONLY,c=cj();r.exports=function(h,d,p,g){function m(_,v){return t.coerce(h,d,c,_,v)}var y=a(h,d,g,m);if(!y){d.visible=!1;return}m("thetaunit"),m("mode",y=n&&(w.marker.cluster=x.tree),w.marker&&(w.markerSel.positions=w.markerUnsel.positions=w.marker.positions=E),w.line&&E.length>1&&l.extendFlat(w.line,s.linePositions(f,v,E)),w.text&&(l.extendFlat(w.text,{positions:E},s.textPosition(f,v,w.text,w.marker)),l.extendFlat(w.textSel,{positions:E},s.textPosition(f,v,w.text,w.markerSel)),l.extendFlat(w.textUnsel,{positions:E},s.textPosition(f,v,w.text,w.markerUnsel))),w.fill&&!m.fill2d&&(m.fill2d=!0),w.marker&&!m.scatter2d&&(m.scatter2d=!0),w.line&&!m.line2d&&(m.line2d=!0),w.text&&!m.glText&&(m.glText=!0),m.lineOptions.push(w.line),m.fillOptions.push(w.fill),m.markerOptions.push(w.marker),m.markerSelectedOptions.push(w.markerSel),m.markerUnselectedOptions.push(w.markerUnsel),m.textOptions.push(w.text),m.textSelectedOptions.push(w.textSel),m.textUnselectedOptions.push(w.textUnsel),m.selectBatch.push([]),m.unselectBatch.push([]),x.x=T,x.y=F,x.rawx=T,x.rawy=F,x.r=M,x.theta=C,x.positions=E,x._scene=m,x.index=m.count,m.count++}}),a(f,h,d)}},r.exports.reglPrecompiled=u}}),Oue=de({"src/traces/scatterpolargl/index.js"(e,r){"use strict";var t=zue();t.plot=Bue(),r.exports=t}}),Nue=de({"lib/scatterpolargl.js"(e,r){"use strict";r.exports=Oue()}}),fj=de({"src/traces/barpolar/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,templatefallbackAttrs:i}=Vo(),a=fn().extendFlat,o=W2(),s=ep();r.exports={r:o.r,theta:o.theta,r0:o.r0,dr:o.dr,theta0:o.theta0,dtheta:o.dtheta,thetaunit:o.thetaunit,base:a({},s.base,{}),offset:a({},s.offset,{}),width:a({},s.width,{}),text:a({},s.text,{}),hovertext:a({},s.hovertext,{}),marker:l(),hoverinfo:o.hoverinfo,hovertemplate:t(),hovertemplatefallback:i(),selected:s.selected,unselected:s.unselected};function l(){var n=a({},s.marker);return delete n.cornerradius,n}}}),hj=de({"src/traces/barpolar/layout_attributes.js"(e,r){"use strict";r.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),jue=de({"src/traces/barpolar/defaults.js"(e,r){"use strict";var t=Qt(),i=jS().handleRThetaDefaults,a=Ww(),o=fj();r.exports=function(l,n,u,c){function f(d,p){return t.coerce(l,n,o,d,p)}var h=i(l,n,c,f);if(!h){n.visible=!1;return}f("thetaunit"),f("base"),f("offset"),f("width"),f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),a(l,n,f,u,c),t.coerceSelectionMarkerOpacity(n,f)}}}),Uue=de({"src/traces/barpolar/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=hj();r.exports=function(a,o,s){var l={},n;function u(h,d){return t.coerce(a[n]||{},o[n],i,h,d)}for(var c=0;c0?(g=d,m=p):(g=p,m=d);var y=s.findEnclosingVertexAngles(g,n.vangles)[0],_=s.findEnclosingVertexAngles(m,n.vangles)[1],v=[y,(g+m)/2,_];return s.pathPolygonAnnulus(f,h,g,m,v,u,c)}:function(f,h,d,p){return a.pathAnnulus(f,h,d,p,u,c)}}}}),Vue=de({"src/traces/barpolar/hover.js"(e,r){"use strict";var t=$s(),i=Qt(),a=y1().getTraceColor,o=i.fillText,s=qS().makeHoverPointText,l=OS().isPtInsidePolygon;r.exports=function(u,c,f){var h=u.cd,d=h[0].trace,p=u.subplot,g=p.radialAxis,m=p.angularAxis,y=p.vangles,_=y?l:i.isPtInsideSector,v=u.maxHoverDistance,x=m._period||2*Math.PI,S=Math.abs(g.g2p(Math.sqrt(c*c+f*f))),M=Math.atan2(f,c);g.range[0]>g.range[1]&&(M+=Math.PI);var C=function(b){return _(S,M,[b.rp0,b.rp1],[b.thetag0,b.thetag1],y)?v+Math.min(1,Math.abs(b.thetag1-b.thetag0)/x)-1+(b.rp1-S)/(b.rp1-b.rp0)-1:1/0};if(t.getClosest(h,C,u),u.index!==!1){var w=u.index,k=h[w];u.x0=u.x1=k.ct[0],u.y0=u.y1=k.ct[1];var A=i.extendFlat({},k,{r:k.s,theta:k.p});return o(k,d,u),s(A,d,p,u),u.hovertemplate=d.hovertemplate,u.color=a(d,k),u.xLabelVal=u.yLabelVal=void 0,k.s<0&&(u.idealAlign="left"),[u]}}}}),Gue=de({"src/traces/barpolar/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"barpolar",basePlotModule:NS(),categories:["polar","bar","showLegend"],attributes:fj(),layoutAttributes:hj(),supplyDefaults:jue(),supplyLayoutDefaults:Uue(),calc:dj().calc,crossTraceCalc:dj().crossTraceCalc,plot:que(),colorbar:Yu(),formatLabels:US(),style:qh().style,styleOnSelect:qh().styleOnSelect,hoverPoints:Vue(),selectPoints:_1(),meta:{}}}}),Hue=de({"lib/barpolar.js"(e,r){"use strict";r.exports=Gue()}}),pj=de({"src/plots/smith/constants.js"(e,r){"use strict";r.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),vj=de({"src/plots/smith/layout_attributes.js"(e,r){"use strict";var t=Jo(),i=Mu(),a=Is().attributes,o=Qt().extendFlat,s=Ps().overrideAll,l=s({color:i.color,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash},"plot","from-root"),n=s({ticklen:i.ticklen,tickwidth:o({},i.tickwidth,{dflt:2}),tickcolor:i.tickcolor,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,tickfont:i.tickfont,tickformat:i.tickformat,hoverformat:i.hoverformat,layer:i.layer},"plot","from-root"),u=o({visible:o({},i.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:o({},i.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},l,n),c=o({visible:o({},i.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:i.ticks,editType:"calc"},l,n);r.exports={domain:a({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:t.background},realaxis:u,imaginaryaxis:c,editType:"calc"}}}),$ue=de({"src/plots/smith/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=Ro(),o=Ev(),s=$u().getSubplotData,l=d0(),n=h0(),u=Ry(),c=Yd(),f=vj(),h=pj(),d=h.axisNames,p=m(function(y){return t.isTypedArray(y)&&(y=Array.from(y)),y.slice().reverse().map(function(_){return-_}).concat([0]).concat(y)},String);function g(y,_,v,x){var S=v("bgcolor");x.bgColor=i.combine(S,x.paper_bgcolor);var M=s(x.fullData,h.name,x.id),C=x.layoutOut,w;function k(O,G){return v(w+"."+O,G)}for(var A=0;A")}}r.exports={hoverPoints:i,makeHoverPointText:a}}}),Que=de({"src/traces/scattersmith/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"scattersmith",basePlotModule:Wue(),categories:["smith","symbols","showLegend","scatter-like"],attributes:mj(),supplyDefaults:Yue(),colorbar:Yu(),formatLabels:Xue(),calc:Zue(),plot:Kue(),style:lf().style,styleOnSelect:lf().styleOnSelect,hoverPoints:Jue().hoverPoints,selectPoints:Mv(),meta:{}}}}),ece=de({"lib/scattersmith.js"(e,r){"use strict";r.exports=Que()}}),gj=de({"src/traces/quiver/attributes.js"(e,r){"use strict";var t=ri(),i=Vo().hovertemplateAttrs,a=Ns().axisHoverFormat,o=fn().extendFlat,s=cs(),l=fu().dash,n=g0(),u=tl(),c={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:u.x0,dx:u.dx,y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:u.y0,dy:u.dy,u:{valType:"data_array",editType:"calc",anim:!0},v:{valType:"data_array",editType:"calc",anim:!0},arrowref:{valType:"enumerated",values:["paper","data"],dflt:"data",editType:"calc"},lengthmode:{valType:"enumerated",values:["scaled","raw"],editType:"calc",dflt:"scaled"},lengthfactor:{valType:"number",min:0,editType:"calc",dflt:1},anchor:{valType:"enumerated",values:["tip","tail","center"],dflt:"tail",editType:"calc"},xhoverformat:a("x"),yhoverformat:a("y"),uhoverformat:a("u","noDate"),vhoverformat:a("v","noDate"),hoverinfo:o({},t.hoverinfo,{flags:["x","y","u","v","text","name"],dflt:"all"}),hovertemplate:i({},{keys:["x","y","u","v","text","name"]}),text:u.text,textposition:u.textposition,textfont:u.textfont,marker:o({arrowsize:o({},n.arrowsize,{editType:"calc"}),line:{width:{valType:"number",min:0,dflt:2,editType:"style"},dash:l,editType:"style"},editType:"calc"},s("marker",{showScaleDflt:!0,editTypeOverride:"calc"})),selected:{marker:{color:{valType:"color",editType:"style"},line:{width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{color:{valType:"color",editType:"style"},line:{width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"}};r.exports=c}}),tce=de({"src/traces/quiver/defaults.js"(e,r){"use strict";var t=Qt(),i=gj(),a=wv(),o=Wu().hasColorscale,s=hu();r.exports=function(n,u,c,f){function h(S,M){return t.coerce(n,u,i,S,M)}var d=a(n,u,f,h);if(!d){u.visible=!1;return}var p=h("u"),g=h("v");if(!t.isArrayOrTypedArray(p)||p.length===0){u.u=new Array(d);for(var m=0;mR&&(R=p[W]),g[W]z&&(z=g[W]),NL&&(L=N),HO&&(O=H);var $=Math.sqrt(N*N+H*H);if($>v&&(v=$),$<_&&(_=$),C){var U=M[W];X.mc=U,a(U)&&(US&&(S=U))}}else X.x=o,X.y=o}if(f._maxNorm=v,b==="scaled"||E==="paper"){let le=R-D,ce=z-P;var V;le===0&&ce===0?V=1:V=(le+ce+Math.sqrt((le-ce)*(le-ce)+4*G*le*ce))/(2*(G-1)),V*=n,f._scaleFactor=V/f._maxNorm}else f._scaleFactor=1;f._scaleFactor*=f.lengthfactor;let j=new Array(m),q=new Array(m),Y=new Array(m),K=new Array(m);for(var te,ne,W=0;Wg.i&&isFinite(m[g.i]))y=m[g.i];else{var _=h.u&&h.u[g.i]||0,v=h.v&&h.v[g.i]||0;y=Math.sqrt(_*_+v*v)}return g.mcc=p(y),g.mcc})}function n(f){var h=t.select(f).selectAll("g.trace.quiver");h.each(function(d){c(f,d,t.select(this))})}function u(f,h,d){c(f,h,d)}function c(f,h,d){var p=h[0].trace,g=p.marker||{},m=g.line||{},y=i.isArrayOrTypedArray(g.color)?void 0:g.color,_=p._hasColorscale;if(d)if(p.selectedpoints){var v=(p.selected||{}).marker||{},x=(p.unselected||{}).marker||{},S=v.line||{},M=x.line||{};d.selectAll("path.js-line").each(function(w){var k=t.select(this),A=!w.selected,b=A?x.color:v.color,E=A?M.width!==void 0?M.width:m.width:S.width!==void 0?S.width:m.width;b?(a.lineGroupStyle(k,E,b,m.dash),k.style("stroke-opacity",1)):(a.lineGroupStyle(k,E,y,m.dash),_&&l(k,p),k.style("stroke-opacity",A?s:1))}),a.selectedTextStyle(d.selectAll("text"),p)}else{var C=d.selectAll("path.js-line");C.call(a.lineGroupStyle,m.width,y,m.dash),_&&l(C,p),C.style("stroke-opacity",1),a.textPointStyle(d.selectAll("text"),p,f)}}r.exports={style:n,styleOnSelect:u,colorscaleStroke:l}}}),ace=de({"src/traces/quiver/plot.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=hn(),o=VS().colorscaleStroke,s=Math.PI/12,l=5.8,n=1.5,u=.7;r.exports=function(h,d,p,g,m,y){var _,v,x=!m,S=!!m&&m.duration>0;if(_=g.selectAll("g.trace").data(p,function(C){return C[0].trace.uid}),_.enter().append("g").attr("class",function(C){return"trace quiver trace"+C[0].trace.uid}).style("stroke-miterlimit",2),_.order(),S){y&&(v=y());var M=t.transition().duration(m.duration).ease(m.easing).each("end",function(){v&&v()}).each("interrupt",function(){v&&v()});M.each(function(){g.selectAll("g.trace").each(function(C,w){c(h,w,d,C,p,this,m)})})}else _.each(function(C,w){c(h,w,d,C,p,this,m)});x&&_.exit().remove()};function c(f,h,d,p,g,m,y){var _=p[0].trace,v=d.xaxis,x=d.yaxis;p[0][d.isRangePlot?"nodeRangePlot3":"node3"]=t.select(m);var S=t.select(m).selectAll("g.lines").data([p]);S.enter().append("g").classed("lines",!0),a.setClipUrl(S,d.layerClipId,f);var M=S.selectAll("path.js-line").data(p);M.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke"),M.exit().remove();let{anchor:C,maxNorm:w=0,arrowref:k}=_,A=k==="paper"?_._scaleFactor*Math.sqrt(Math.abs(v._m*x._m)):_._scaleFactor,b=_.marker.arrowsize;M.each(function(z){let I=t.select(this);if(z.x===void 0||z.y===void 0){I.attr("d",null);return}let L=(k==="paper"?z._u*Math.sign(v._m):t.round(v._m*z._u))*A,B=(k==="paper"?z._v*Math.sign(x._m):t.round(x._m*z._v))*A,O=(_._input.marker||{}).arrowsize!==void 0;var G,W,X,Z;C==="tip"?(G=v.c2p(z.x)-L,X=x.c2p(z.y)-B,W=v.c2p(z.x),Z=x.c2p(z.y)):C==="center"?(G=v.c2p(z.x)-L/2,X=x.c2p(z.y)-B/2,W=v.c2p(z.x)+L/2,Z=x.c2p(z.y)+B/2):(G=v.c2p(z.x),X=x.c2p(z.y),W=v.c2p(z.x)+L,Z=x.c2p(z.y)+B),z._px0=G,z._py0=X,z._px1=W,z._py1=Z;var J=_.marker.line.width;O||(J=Math.max(J,n));let N=Math.sqrt((W-G)*(W-G)+(Z-X)*(Z-X)),H=u*N,$=Math.min(l*b*J,H),U=Math.atan2(Z-X,W-G),V=W-$*Math.cos(U-s),j=Z-$*Math.sin(U-s),q=W-$*Math.cos(U+s),Y=Z-$*Math.sin(U+s),K="M"+G+","+X+"L"+W+","+Z+"L"+V+","+j+"L"+W+","+Z+"L"+q+","+Y;I.attr("d",K)});var E=_.marker||{},T=E.line||{},F=i.isArrayOrTypedArray(E.color)?void 0:E.color;a.lineGroupStyle(M,T.width,F,T.dash),_._hasColorscale&&o(M,_);var D=t.select(m).selectAll("g.text").data([p]);D.enter().append("g").classed("text",!0),a.setClipUrl(D,d.layerClipId,f);var R=D.selectAll("g.textpoint").data(p);if(R.enter().append("g").classed("textpoint",!0).append("text"),R.exit().remove(),R.each(function(z){var I=t.select(this),L=a.translatePoint(z,I.select("text"),v,x);L||I.remove()}),R.selectAll("text").call(a.textPointStyle,_,f).each(function(z){var I=v.c2p(z.x),L=x.c2p(z.y);t.select(this).selectAll("tspan.line").each(function(){t.select(this).attr({x:I,y:L})})}),y&&y.duration>0){var P=t.transition().duration(y.duration).ease(y.easing);M.transition(P).style("opacity",1)}}}}),nce=de({"src/traces/quiver/hover.js"(e,r){"use strict";var t=Qt(),i=$s(),a=m1();function o(s,l,n,u,c,f){let h=c-n,d=f-u,p=h*h+d*d;if(!p)return Math.sqrt((s-n)*(s-n)+(l-u)*(l-u));var g=((s-n)*h+(l-u)*d)/p;g=Math.max(0,Math.min(1,g));let m=n+g*h,y=u+g*d;return Math.sqrt((s-m)*(s-m)+(l-y)*(l-y))}r.exports=function(l,n,u,c){var f=l.cd,h=f[0].trace,d=l.xa,p=l.ya,g=d.c2p(n),m=p.c2p(u),y=function(k){return k._px0===void 0?1/0:o(g,m,k._px0,k._py0,k._px1,k._py1)};if(i.getClosest(f,y,l),l.index!==!1){var _=f[l.index],v=d.c2p(_.x,!0),x=p.c2p(_.y,!0),S=Math.sqrt((g-v)*(g-v)+(m-x)*(m-x));l.index=_.i;var M=h.u?h.u[_.i]:0,C=h.v?h.v[_.i]:0,w="u: "+M+", v: "+C;return t.extendFlat(l,{color:a(h,_),x0:v-3,x1:v+3,xLabelVal:_.x,y0:x-3,y1:x+3,yLabelVal:_.y,uLabelVal:M,vLabelVal:C,extraText:w,spikeDistance:S,hovertemplate:h.hovertemplate}),t.fillText(_,h,l),[l]}}}}),oce=de({"src/traces/quiver/format_labels.js"(e,r){"use strict";var t=nn(),i=Qt();r.exports=function(o,s,l){var n={},u={_fullLayout:l},c=t.getFromTrace(u,s,"x"),f=t.getFromTrace(u,s,"y"),h=o.x,d=o.y;n.xLabel=t.tickText(c,c.c2l(h),!0).text,n.yLabel=t.tickText(f,f.c2l(d),!0).text;var p=s.u?s.u[o.i]:0,g=s.v?s.v[o.i]:0,m=s.uhoverformat,y=s.vhoverformat;return n.uLabel=m?i.numberFormat(m)(p):String(p),n.vLabel=y?i.numberFormat(y)(g):String(g),n}}}),sce=de({"src/traces/quiver/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){return i.x=a.x,i.y=a.y,i.u=o.u?o.u[l]:void 0,i.v=o.v?o.v[l]:void 0,i}}}),lce=de({"src/traces/quiver/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"quiver",basePlotModule:ml(),categories:["cartesian","svg","showLegend","scatter-like","zoomScale"],attributes:gj(),supplyDefaults:tce(),calc:rce(),crossTraceCalc:ice(),plot:ace(),style:VS().style,styleOnSelect:VS().styleOnSelect,hoverPoints:nce(),formatLabels:oce(),eventData:sce(),selectPoints:Mv(),colorbar:Yu(),animatable:!0,meta:{}}}}),uce=de({"lib/quiver.js"(e,r){"use strict";r.exports=lce()}}),_c=de({"node_modules/world-calendars/dist/main.js"(e,r){var t=du();function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}t(i.prototype,{instance:function(u,c){u=(u||"gregorian").toLowerCase(),c=c||"";var f=this._localCals[u+"-"+c];if(!f&&this.calendars[u]&&(f=new this.calendars[u](c),this._localCals[u+"-"+c]=f),!f)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,u);return f},newDate:function(u,c,f,h,d){return h=(u!=null&&u.year?u.calendar():typeof h=="string"?this.instance(h,d):h)||this.instance(),h.newDate(u,c,f)},substituteDigits:function(u){return function(c){return(c+"").replace(/[0-9]/g,function(f){return u[f]})}},substituteChineseDigits:function(u,c){return function(f){for(var h="",d=0;f>0;){var p=f%10;h=(p===0?"":u[p]+c[d])+h,d++,f=Math.floor(f/10)}return h.indexOf(u[1]+c[1])===0&&(h=h.substr(1)),h||u[0]}}});function a(u,c,f,h){if(this._calendar=u,this._year=c,this._month=f,this._day=h,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(n.local.invalidDate||n.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(u,c){return u=""+u,"000000".substring(0,c-u.length)+u}t(a.prototype,{newDate:function(u,c,f){return this._calendar.newDate(u??this,c,f)},year:function(u){return arguments.length===0?this._year:this.set(u,"y")},month:function(u){return arguments.length===0?this._month:this.set(u,"m")},day:function(u){return arguments.length===0?this._day:this.set(u,"d")},date:function(u,c,f){if(!this._calendar.isValid(u,c,f))throw(n.local.invalidDate||n.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=u,this._month=c,this._day=f,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(u,c){return this._calendar.add(this,u,c)},set:function(u,c){return this._calendar.set(this,u,c)},compareTo:function(u){if(this._calendar.name!==u._calendar.name)throw(n.local.differentCalendars||n.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,u._calendar.local.name);var c=this._year!==u._year?this._year-u._year:this._month!==u._month?this.monthOfYear()-u.monthOfYear():this._day-u._day;return c===0?0:c<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(u){return this._calendar.fromJD(u)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(u){return this._calendar.fromJSDate(u)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}});function s(){this.shortYearCutoff="+10"}t(s.prototype,{_validateLevel:0,newDate:function(u,c,f){return u==null?this.today():(u.year&&(this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate),f=u.day(),c=u.month(),u=u.year()),new a(this,u,c,f))},today:function(){return this.fromJSDate(new Date)},epoch:function(u){var c=this._validate(u,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return c.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(u){var c=this._validate(u,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return(c.year()<0?"-":"")+o(Math.abs(c.year()),4)},monthsInYear:function(u){return this._validate(u,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),12},monthOfYear:function(u,c){var f=this._validate(u,c,this.minDay,n.local.invalidMonth||n.regionalOptions[""].invalidMonth);return(f.month()+this.monthsInYear(f)-this.firstMonth)%this.monthsInYear(f)+this.minMonth},fromMonthOfYear:function(u,c){var f=(c+this.firstMonth-2*this.minMonth)%this.monthsInYear(u)+this.minMonth;return this._validate(u,f,this.minDay,n.local.invalidMonth||n.regionalOptions[""].invalidMonth),f},daysInYear:function(u){var c=this._validate(u,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return this.leapYear(c)?366:365},dayOfYear:function(u,c,f){var h=this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate);return h.toJD()-this.newDate(h.year(),this.fromMonthOfYear(h.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(u,c,f){var h=this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(h))+2)%this.daysInWeek()},extraInfo:function(u,c,f){return this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate),{}},add:function(u,c,f){return this._validate(u,this.minMonth,this.minDay,n.local.invalidDate||n.regionalOptions[""].invalidDate),this._correctAdd(u,this._add(u,c,f),c,f)},_add:function(u,c,f){if(this._validateLevel++,f==="d"||f==="w"){var h=u.toJD()+c*(f==="w"?this.daysInWeek():1),d=u.calendar().fromJD(h);return this._validateLevel--,[d.year(),d.month(),d.day()]}try{var p=u.year()+(f==="y"?c:0),g=u.monthOfYear()+(f==="m"?c:0),d=u.day(),m=function(v){for(;gx-1+v.minMonth;)p++,g-=x,x=v.monthsInYear(p)};f==="y"?(u.month()!==this.fromMonthOfYear(p,g)&&(g=this.newDate(p,u.month(),this.minDay).monthOfYear()),g=Math.min(g,this.monthsInYear(p)),d=Math.min(d,this.daysInMonth(p,this.fromMonthOfYear(p,g)))):f==="m"&&(m(this),d=Math.min(d,this.daysInMonth(p,this.fromMonthOfYear(p,g))));var y=[p,this.fromMonthOfYear(p,g),d];return this._validateLevel--,y}catch(_){throw this._validateLevel--,_}},_correctAdd:function(u,c,f,h){if(!this.hasYearZero&&(h==="y"||h==="m")&&(c[0]===0||u.year()>0!=c[0]>0)){var d={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[h],p=f<0?-1:1;c=this._add(u,f*d[0]+p*d[1],d[2])}return u.date(c[0],c[1],c[2])},set:function(u,c,f){this._validate(u,this.minMonth,this.minDay,n.local.invalidDate||n.regionalOptions[""].invalidDate);var h=f==="y"?c:u.year(),d=f==="m"?c:u.month(),p=f==="d"?c:u.day();return(f==="y"||f==="m")&&(p=Math.min(p,this.daysInMonth(h,d))),u.date(h,d,p)},isValid:function(u,c,f){this._validateLevel++;var h=this.hasYearZero||u!==0;if(h){var d=this.newDate(u,c,this.minDay);h=c>=this.minMonth&&c-this.minMonth=this.minDay&&f-this.minDay13.5?13:1),_=d-(y>2.5?4716:4715);return _<=0&&_--,this.newDate(_,y,m)},toJSDate:function(u,c,f){var h=this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate),d=new Date(h.year(),h.month()-1,h.day());return d.setHours(0),d.setMinutes(0),d.setSeconds(0),d.setMilliseconds(0),d.setHours(d.getHours()>12?d.getHours()+2:0),d},fromJSDate:function(u){return this.newDate(u.getFullYear(),u.getMonth()+1,u.getDate())}});var n=r.exports=new i;n.cdate=a,n.baseCalendar=s,n.calendars.gregorian=l}}),cce=de({"node_modules/world-calendars/dist/plus.js"(){var e=du(),r=_c();e(r.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),r.local=r.regionalOptions[""],e(r.cdate.prototype,{formatDate:function(t,i){return typeof t!="string"&&(i=t,t=""),this._calendar.formatDate(t||"",this,i)}}),e(r.baseCalendar.prototype,{UNIX_EPOCH:r.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:r.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,i,a){if(typeof t!="string"&&(a=i,i=t,t=""),!i)return"";if(i.calendar()!==this)throw r.local.invalidFormat||r.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat,a=a||{};for(var o=a.dayNamesShort||this.local.dayNamesShort,s=a.dayNames||this.local.dayNames,l=a.monthNumbers||this.local.monthNumbers,n=a.monthNamesShort||this.local.monthNamesShort,u=a.monthNames||this.local.monthNames,c=a.calculateWeek||this.local.calculateWeek,f=function(M,C){for(var w=1;S+w1},h=function(M,C,w,k){var A=""+C;if(f(M,k))for(;A.length1},x=function(F,D){var R=v(F,D),P=[2,3,R?4:2,R?4:2,10,11,20]["oyYJ@!".indexOf(F)+1],z=new RegExp("^-?\\d{1,"+P+"}"),I=i.substring(A).match(z);if(!I)throw(r.local.missingNumberAt||r.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=I[0].length,parseInt(I[0],10)},S=this,M=function(){if(typeof u=="function"){v("m");var F=u.call(S,i.substring(A));return A+=F.length,F}return x("m")},C=function(F,D,R,P){for(var z=v(F,P)?R:D,I=0;I-1){p=1,g=m;for(var T=this.daysInMonth(d,p);g>T;T=this.daysInMonth(d,p))p++,g-=T}return h>-1?this.fromJD(h):this.newDate(d,p,g)},determineDate:function(t,i,a,o,s){a&&typeof a!="object"&&(s=o,o=a,a=null),typeof o!="string"&&(s=o,o="");var l=this,n=function(u){try{return l.parseDate(o,u,s)}catch{}u=u.toLowerCase();for(var c=(u.match(/^c/)&&a?a.newDate():null)||l.today(),f=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,h=f.exec(u);h;)c.add(parseInt(h[1],10),h[2]||"d"),h=f.exec(u);return c};return i=i?i.newDate():null,t=t==null?i:typeof t=="string"?n(t):typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?i:l.today().add(t,"d"):l.newDate(t),t}})}}),fce=de({"node_modules/world-calendars/dist/calendars/chinese.js"(){var e=_c(),r=du(),t=e.instance();function i(h){this.local=this.regionalOptions[h||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,r(i.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(h,d){if(typeof h=="string"){var p=h.match(o);return p?p[0]:""}var g=this._validateYear(h),m=h.month(),y=""+this.toChineseMonth(g,m);return d&&y.length<2&&(y="0"+y),this.isIntercalaryMonth(g,m)&&(y+="i"),y},monthNames:function(h){if(typeof h=="string"){var d=h.match(s);return d?d[0]:""}var p=this._validateYear(h),g=h.month(),m=this.toChineseMonth(p,g),y=["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"][m-1];return this.isIntercalaryMonth(p,g)&&(y="\u95F0"+y),y},monthNamesShort:function(h){if(typeof h=="string"){var d=h.match(l);return d?d[0]:""}var p=this._validateYear(h),g=h.month(),m=this.toChineseMonth(p,g),y=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][m-1];return this.isIntercalaryMonth(p,g)&&(y="\u95F0"+y),y},parseMonth:function(h,d){h=this._validateYear(h);var p=parseInt(d),g;if(isNaN(p))d[0]==="\u95F0"&&(g=!0,d=d.substring(1)),d[d.length-1]==="\u6708"&&(d=d.substring(0,d.length-1)),p=1+["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"].indexOf(d);else{var m=d[d.length-1];g=m==="i"||m==="I"}var y=this.toMonthIndex(h,p,g);return y},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(h,d){if(h.year&&(h=h.year()),typeof h!="number"||h<1888||h>2111)throw d.replace(/\{0\}/,this.local.name);return h},toMonthIndex:function(h,d,p){var g=this.intercalaryMonth(h),m=p&&d!==g;if(m||d<1||d>12)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);var y;return g?!p&&d<=g?y=d-1:y=d:y=d-1,y},toChineseMonth:function(h,d){h.year&&(h=h.year(),d=h.month());var p=this.intercalaryMonth(h),g=p?12:11;if(d<0||d>g)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return p?d>13;return p},isIntercalaryMonth:function(h,d){h.year&&(h=h.year(),d=h.month());var p=this.intercalaryMonth(h);return!!p&&p===d},leapYear:function(h){return this.intercalaryMonth(h)!==0},weekOfYear:function(h,d,p){var g=this._validateYear(h,e.local.invalidyear),m=u[g-u[0]],y=m>>9&4095,_=m>>5&15,v=m&31,x;x=t.newDate(y,_,v),x.add(4-(x.dayOfWeek()||7),"d");var S=this.toJD(h,d,p)-x.toJD();return 1+Math.floor(S/7)},monthsInYear:function(h){return this.leapYear(h)?13:12},daysInMonth:function(h,d){h.year&&(d=h.month(),h=h.year()),h=this._validateYear(h);var p=n[h-n[0]],g=p>>13,m=g?12:11;if(d>m)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);var y=p&1<<12-d?30:29;return y},weekDay:function(h,d,p){return(this.dayOfWeek(h,d,p)||7)<6},toJD:function(h,d,p){var g=this._validate(h,y,p,e.local.invalidDate);h=this._validateYear(g.year()),d=g.month(),p=g.day();var m=this.isIntercalaryMonth(h,d),y=this.toChineseMonth(h,d),_=f(h,y,p,m);return t.toJD(_.year,_.month,_.day)},fromJD:function(h){var d=t.fromJD(h),p=c(d.year(),d.month(),d.day()),g=this.toMonthIndex(p.year,p.month,p.isIntercalary);return this.newDate(p.year,g,p.day)},fromString:function(h){var d=h.match(a),p=this._validateYear(+d[1]),g=+d[2],m=!!d[3],y=this.toMonthIndex(p,g,m),_=+d[4];return this.newDate(p,y,_)},add:function(h,d,p){var g=h.year(),m=h.month(),y=this.isIntercalaryMonth(g,m),_=this.toChineseMonth(g,m),v=Object.getPrototypeOf(i.prototype).add.call(this,h,d,p);if(p==="y"){var x=v.year(),S=v.month(),M=this.isIntercalaryMonth(x,_),C=y&&M?this.toMonthIndex(x,_,!0):this.toMonthIndex(x,_,!1);C!==S&&v.month(C)}return v}});var a=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,o=/^\d?\d[iI]?/m,s=/^闰?十?[一二三四五六七八九]?月/m,l=/^闰?十?[一二三四五六七八九]?/m;e.calendars.chinese=i;var n=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],u=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function c(h,d,p,g){var m,y;if(typeof h=="object")m=h,y=d||{};else{var _=typeof h=="number"&&h>=1888&&h<=2111;if(!_)throw new Error("Solar year outside range 1888-2111");var v=typeof d=="number"&&d>=1&&d<=12;if(!v)throw new Error("Solar month outside range 1 - 12");var x=typeof p=="number"&&p>=1&&p<=31;if(!x)throw new Error("Solar day outside range 1 - 31");m={year:h,month:d,day:p},y=g||{}}var S=u[m.year-u[0]],M=m.year<<9|m.month<<5|m.day;y.year=M>=S?m.year:m.year-1,S=u[y.year-u[0]];var C=S>>9&4095,w=S>>5&15,k=S&31,A,b=new Date(C,w-1,k),E=new Date(m.year,m.month-1,m.day);A=Math.round((E-b)/(24*3600*1e3));var T=n[y.year-n[0]],F;for(F=0;F<13;F++){var D=T&1<<12-F?30:29;if(A>13;return!R||F=1888&&h<=2111;if(!v)throw new Error("Lunar year outside range 1888-2111");var x=typeof d=="number"&&d>=1&&d<=12;if(!x)throw new Error("Lunar month outside range 1 - 12");var S=typeof p=="number"&&p>=1&&p<=30;if(!S)throw new Error("Lunar day outside range 1 - 30");var M;typeof g=="object"?(M=!1,y=g):(M=!!g,y=m||{}),_={year:h,month:d,day:p,isIntercalary:M}}var C;C=_.day-1;var w=n[_.year-n[0]],k=w>>13,A;k&&(_.month>k||_.isIntercalary)?A=_.month:A=_.month-1;for(var b=0;b>9&4095,D=T>>5&15,R=T&31,P=new Date(F,D-1,R+C);return y.year=P.getFullYear(),y.month=1+P.getMonth(),y.day=P.getDate(),y}}}),hce=de({"node_modules/world-calendars/dist/calendars/coptic.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),o=a.year()+(a.year()<0?1:0);return o%4===3||o%4===-1},monthsInYear:function(i){return this._validate(i,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(-s.dayOfWeek(),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInMonth:function(i,a){var o=this._validate(i,a,this.minDay,e.local.invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===13&&this.leapYear(o.year())?1:0)},weekDay:function(i,a,o){return(this.dayOfWeek(i,a,o)||7)<6},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);return i=s.year(),i<0&&i++,s.day()+(s.month()-1)*30+(i-1)*365+Math.floor(i/4)+this.jdEpoch-1},fromJD:function(i){var a=Math.floor(i)+.5-this.jdEpoch,o=Math.floor((a-Math.floor((a+366)/1461))/365)+1;o<=0&&o--,a=Math.floor(i)+.5-this.newDate(o,1,1).toJD();var s=Math.floor(a/30)+1,l=a-(s-1)*30+1;return this.newDate(o,s,l)}}),e.calendars.coptic=t}}),dce=de({"node_modules/world-calendars/dist/calendars/discworld.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(a){return this._validate(a,this.minMonth,this.minDay,e.local.invalidYear),!1},monthsInYear:function(a){return this._validate(a,this.minMonth,this.minDay,e.local.invalidYear),13},daysInYear:function(a){return this._validate(a,this.minMonth,this.minDay,e.local.invalidYear),400},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/8)+1},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);return(l.day()+1)%8},weekDay:function(a,o,s){var l=this.dayOfWeek(a,o,s);return l>=2&&l<=6},extraInfo:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);return{century:i[Math.floor((l.year()-1)/100)+1]||""}},toJD:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);return a=l.year()+(l.year()<0?1:0),o=l.month(),s=l.day(),s+(o>1?16:0)+(o>2?(o-2)*32:0)+(a-1)*400+this.jdEpoch-1},fromJD:function(a){a=Math.floor(a+.5)-Math.floor(this.jdEpoch)-1;var o=Math.floor(a/400)+1;a-=(o-1)*400,a+=a>15?16:0;var s=Math.floor(a/32)+1,l=a-(s-1)*32+1;return this.newDate(o<=0?o-1:o,s,l)}});var i={20:"Fruitbat",21:"Anchovy"};e.calendars.discworld=t}}),pce=de({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),o=a.year()+(a.year()<0?1:0);return o%4===3||o%4===-1},monthsInYear:function(i){return this._validate(i,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(-s.dayOfWeek(),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInMonth:function(i,a){var o=this._validate(i,a,this.minDay,e.local.invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===13&&this.leapYear(o.year())?1:0)},weekDay:function(i,a,o){return(this.dayOfWeek(i,a,o)||7)<6},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);return i=s.year(),i<0&&i++,s.day()+(s.month()-1)*30+(i-1)*365+Math.floor(i/4)+this.jdEpoch-1},fromJD:function(i){var a=Math.floor(i)+.5-this.jdEpoch,o=Math.floor((a-Math.floor((a+366)/1461))/365)+1;o<=0&&o--,a=Math.floor(i)+.5-this.newDate(o,1,1).toJD();var s=Math.floor(a/30)+1,l=a-(s-1)*30+1;return this.newDate(o,s,l)}}),e.calendars.ethiopian=t}}),vce=de({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear);return this._leapYear(o.year())},_leapYear:function(a){return a=a<0?a+1:a,i(a*7+1,19)<7},monthsInYear:function(a){return this._validate(a,this.minMonth,this.minDay,e.local.invalidYear),this._leapYear(a.year?a.year():a)?13:12},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear);return a=o.year(),this.toJD(a===-1?1:a+1,7,1)-this.toJD(a,7,1)},daysInMonth:function(a,o){return a.year&&(o=a.month(),a=a.year()),this._validate(a,o,this.minDay,e.local.invalidMonth),o===12&&this.leapYear(a)||o===8&&i(this.daysInYear(a),10)===5?30:o===9&&i(this.daysInYear(a),10)===3?29:this.daysPerMonth[o-1]},weekDay:function(a,o,s){return this.dayOfWeek(a,o,s)!==6},extraInfo:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);return{yearType:(this.leapYear(l)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(l)%10-3]}},toJD:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);a=l.year(),o=l.month(),s=l.day();var n=a<=0?a+1:a,u=this.jdEpoch+this._delay1(n)+this._delay2(n)+s+1;if(o<7){for(var c=7;c<=this.monthsInYear(a);c++)u+=this.daysInMonth(a,c);for(var c=1;c=this.toJD(o===-1?1:o+1,7,1);)o++;for(var s=athis.toJD(o,s,this.daysInMonth(o,s));)s++;var l=a-this.toJD(o,s,1)+1;return this.newDate(o,s,l)}});function i(a,o){return a-o*Math.floor(a/o)}e.calendars.hebrew=t}}),mce=de({"node_modules/world-calendars/dist/calendars/islamic.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012Bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(i){var a=this._validate(i,this.minMonth,this.minDay,e.local.invalidYear);return(a.year()*11+14)%30<11},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(-s.dayOfWeek(),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInYear:function(i){return this.leapYear(i)?355:354},daysInMonth:function(i,a){var o=this._validate(i,a,this.minDay,e.local.invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===12&&this.leapYear(o.year())?1:0)},weekDay:function(i,a,o){return this.dayOfWeek(i,a,o)!==5},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);return i=s.year(),a=s.month(),o=s.day(),i=i<=0?i+1:i,o+Math.ceil(29.5*(a-1))+(i-1)*354+Math.floor((3+11*i)/30)+this.jdEpoch-1},fromJD:function(i){i=Math.floor(i)+.5;var a=Math.floor((30*(i-this.jdEpoch)+10646)/10631);a=a<=0?a-1:a;var o=Math.min(12,Math.ceil((i-29-this.toJD(a,1,1))/29.5)+1),s=i-this.toJD(a,o,1)+1;return this.newDate(a,o,s)}}),e.calendars.islamic=t}}),gce=de({"node_modules/world-calendars/dist/calendars/julian.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),o=a.year()<0?a.year()+1:a.year();return o%4===0},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(4-(s.dayOfWeek()||7),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInMonth:function(i,a){var o=this._validate(i,a,this.minDay,e.local.invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===2&&this.leapYear(o.year())?1:0)},weekDay:function(i,a,o){return(this.dayOfWeek(i,a,o)||7)<6},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);return i=s.year(),a=s.month(),o=s.day(),i<0&&i++,a<=2&&(i--,a+=12),Math.floor(365.25*(i+4716))+Math.floor(30.6001*(a+1))+o-1524.5},fromJD:function(i){var a=Math.floor(i+.5),o=a+1524,s=Math.floor((o-122.1)/365.25),l=Math.floor(365.25*s),n=Math.floor((o-l)/30.6001),u=n-Math.floor(n<14?1:13),c=s-Math.floor(u>2?4716:4715),f=o-l-Math.floor(30.6001*n);return c<=0&&c--,this.newDate(c,u,f)}}),e.calendars.julian=t}}),yce=de({"node_modules/world-calendars/dist/calendars/mayan.js"(){var e=_c(),r=du();function t(o){this.local=this.regionalOptions[o||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(o){return this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),!1},formatYear:function(o){var s=this._validate(o,this.minMonth,this.minDay,e.local.invalidYear);o=s.year();var l=Math.floor(o/400);o=o%400,o+=o<0?400:0;var n=Math.floor(o/20);return l+"."+n+"."+o%20},forYear:function(o){if(o=o.split("."),o.length<3)throw"Invalid Mayan year";for(var s=0,l=0;l19||l>0&&n<0)throw"Invalid Mayan year";s=s*20+n}return s},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),18},weekOfYear:function(o,s,l){return this._validate(o,s,l,e.local.invalidDate),0},daysInYear:function(o){return this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),360},daysInMonth:function(o,s){return this._validate(o,s,this.minDay,e.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(o,s,l){var n=this._validate(o,s,l,e.local.invalidDate);return n.day()},weekDay:function(o,s,l){return this._validate(o,s,l,e.local.invalidDate),!0},extraInfo:function(o,s,l){var n=this._validate(o,s,l,e.local.invalidDate),u=n.toJD(),c=this._toHaab(u),f=this._toTzolkin(u);return{haabMonthName:this.local.haabMonths[c[0]-1],haabMonth:c[0],haabDay:c[1],tzolkinDayName:this.local.tzolkinMonths[f[0]-1],tzolkinDay:f[0],tzolkinTrecena:f[1]}},_toHaab:function(o){o-=this.jdEpoch;var s=i(o+8+340,365);return[Math.floor(s/20)+1,i(s,20)]},_toTzolkin:function(o){return o-=this.jdEpoch,[a(o+20,20),a(o+4,13)]},toJD:function(o,s,l){var n=this._validate(o,s,l,e.local.invalidDate);return n.day()+n.month()*20+n.year()*360+this.jdEpoch},fromJD:function(o){o=Math.floor(o)+.5-this.jdEpoch;var s=Math.floor(o/360);o=o%360,o+=o<0?360:0;var l=Math.floor(o/20),n=o%20;return this.newDate(s,l,n)}});function i(o,s){return o-s*Math.floor(o/s)}function a(o,s){return i(o-1,s)+1}e.calendars.mayan=t}}),_ce=de({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar;var i=e.instance("gregorian");r(t.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear);return i.leapYear(o.year()+(o.year()<1?1:0)+1469)},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(1-(l.dayOfWeek()||7),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===12&&this.leapYear(s.year())?1:0)},weekDay:function(a,o,s){return(this.dayOfWeek(a,o,s)||7)<6},toJD:function(n,o,s){var l=this._validate(n,o,s,e.local.invalidMonth),n=l.year();n<0&&n++;for(var u=l.day(),c=1;c=this.toJD(o+1,1,1);)o++;for(var s=a-Math.floor(this.toJD(o,1,1)+.5)+1,l=1;s>this.daysInMonth(o,l);)s-=this.daysInMonth(o,l),l++;return this.newDate(o,l,s)}}),e.calendars.nanakshahi=t}}),xce=de({"node_modules/world-calendars/dist/calendars/nepali.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(i){return this.daysInYear(i)!==this.daysPerYear},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(-s.dayOfWeek(),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInYear:function(i){var a=this._validate(i,this.minMonth,this.minDay,e.local.invalidYear);if(i=a.year(),typeof this.NEPALI_CALENDAR_DATA[i]>"u")return this.daysPerYear;for(var o=0,s=this.minMonth;s<=12;s++)o+=this.NEPALI_CALENDAR_DATA[i][s];return o},daysInMonth:function(i,a){return i.year&&(a=i.month(),i=i.year()),this._validate(i,a,this.minDay,e.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[i]>"u"?this.daysPerMonth[a-1]:this.NEPALI_CALENDAR_DATA[i][a]},weekDay:function(i,a,o){return this.dayOfWeek(i,a,o)!==6},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);i=s.year(),a=s.month(),o=s.day();var l=e.instance(),n=0,u=a,c=i;this._createMissingCalendarData(i);var f=i-(u>9||u===9&&o>=this.NEPALI_CALENDAR_DATA[c][0]?56:57);for(a!==9&&(n=o,u--);u!==9;)u<=0&&(u=12,c--),n+=this.NEPALI_CALENDAR_DATA[c][u],u--;return a===9?(n+=o-this.NEPALI_CALENDAR_DATA[c][0],n<0&&(n+=l.daysInYear(f))):n+=this.NEPALI_CALENDAR_DATA[c][9]-this.NEPALI_CALENDAR_DATA[c][0],l.newDate(f,1,1).add(n,"d").toJD()},fromJD:function(i){var a=e.instance(),o=a.fromJD(i),s=o.year(),l=o.dayOfYear(),n=s+56;this._createMissingCalendarData(n);for(var u=9,c=this.NEPALI_CALENDAR_DATA[n][0],f=this.NEPALI_CALENDAR_DATA[n][u]-c+1;l>f;)u++,u>12&&(u=1,n++),f+=this.NEPALI_CALENDAR_DATA[n][u];var h=this.NEPALI_CALENDAR_DATA[n][u]-(f-l);return this.newDate(n,u,h)},_createMissingCalendarData:function(i){var a=this.daysPerMonth.slice(0);a.unshift(17);for(var o=i-1;o"u"&&(this.NEPALI_CALENDAR_DATA[o]=a)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),e.calendars.nepali=t}}),bce=de({"node_modules/world-calendars/dist/calendars/persian.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}function i(a){var o=a-475;a<0&&o++;var s=.242197,l=s*o,n=s*(o+1),u=l-Math.floor(l),c=n-Math.floor(n);return u>c}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chah\u0101rshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear);return i(o.year())},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(-((l.dayOfWeek()+1)%7),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===12&&this.leapYear(s.year())?1:0)},weekDay:function(a,o,s){return this.dayOfWeek(a,o,s)!==5},toJD:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);a=l.year(),o=l.month(),s=l.day();var n=0;if(a>0)for(var u=1;u0?a-1:a)*365+n+this.jdEpoch-1},fromJD:function(a){a=Math.floor(a)+.5;var o=475+(a-this.toJD(475,1,1))/365.242197,s=Math.floor(o);s<=0&&s--,a>this.toJD(s,12,i(s)?30:29)&&(s++,s===0&&s++);var l=a-this.toJD(s,1,1)+1,n=l<=186?Math.ceil(l/31):Math.ceil((l-6)/30),u=a-this.toJD(s,n,1)+1;return this.newDate(s,n,u)}}),e.calendars.persian=t,e.calendars.jalali=t}}),wce=de({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var e=_c(),r=du(),t=e.instance();function i(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,r(i.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(s){var o=this._validate(s,this.minMonth,this.minDay,e.local.invalidYear),s=this._t2gYear(o.year());return t.leapYear(s)},weekOfYear:function(n,o,s){var l=this._validate(n,this.minMonth,this.minDay,e.local.invalidYear),n=this._t2gYear(l.year());return t.weekOfYear(n,l.month(),l.day())},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===2&&this.leapYear(s.year())?1:0)},weekDay:function(a,o,s){return(this.dayOfWeek(a,o,s)||7)<6},toJD:function(n,o,s){var l=this._validate(n,o,s,e.local.invalidDate),n=this._t2gYear(l.year());return t.toJD(n,l.month(),l.day())},fromJD:function(a){var o=t.fromJD(a),s=this._g2tYear(o.year());return this.newDate(s,o.month(),o.day())},_t2gYear:function(a){return a+this.yearsOffset+(a>=-this.yearsOffset&&a<=-1?1:0)},_g2tYear:function(a){return a-this.yearsOffset-(a>=1&&a<=this.yearsOffset?1:0)}}),e.calendars.taiwan=i}}),Tce=de({"node_modules/world-calendars/dist/calendars/thai.js"(){var e=_c(),r=du(),t=e.instance();function i(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,r(i.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(s){var o=this._validate(s,this.minMonth,this.minDay,e.local.invalidYear),s=this._t2gYear(o.year());return t.leapYear(s)},weekOfYear:function(n,o,s){var l=this._validate(n,this.minMonth,this.minDay,e.local.invalidYear),n=this._t2gYear(l.year());return t.weekOfYear(n,l.month(),l.day())},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===2&&this.leapYear(s.year())?1:0)},weekDay:function(a,o,s){return(this.dayOfWeek(a,o,s)||7)<6},toJD:function(n,o,s){var l=this._validate(n,o,s,e.local.invalidDate),n=this._t2gYear(l.year());return t.toJD(n,l.month(),l.day())},fromJD:function(a){var o=t.fromJD(a),s=this._g2tYear(o.year());return this.newDate(s,o.month(),o.day())},_t2gYear:function(a){return a-this.yearsOffset-(a>=1&&a<=this.yearsOffset?1:0)},_g2tYear:function(a){return a+this.yearsOffset+(a>=-this.yearsOffset&&a<=-1?1:0)}}),e.calendars.thai=i}}),Ace=de({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012Bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear);return this.daysInYear(o.year())===355},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInYear:function(a){for(var o=0,s=1;s<=12;s++)o+=this.daysInMonth(a,s);return o},daysInMonth:function(a,o){for(var s=this._validate(a,o,this.minDay,e.local.invalidMonth),l=s.toJD()-24e5+.5,n=0,u=0;ul)return i[n]-i[n-1];n++}return 30},weekDay:function(a,o,s){return this.dayOfWeek(a,o,s)!==5},toJD:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate),n=12*(l.year()-1)+l.month()-15292,u=l.day()+i[n-1]-1;return u+24e5-.5},fromJD:function(a){for(var o=a-24e5+.5,s=0,l=0;lo);l++)s++;var n=s+15292,u=Math.floor((n-1)/12),c=u+1,f=n-12*u,h=o-i[s-1]+1;return this.newDate(c,f,h)},isValid:function(a,o,s){var l=e.baseCalendar.prototype.isValid.apply(this,arguments);return l&&(a=a.year!=null?a.year:a,l=a>=1276&&a<=1500),l},_validate:function(a,o,s,l){var n=e.baseCalendar.prototype._validate.apply(this,arguments);if(n.year<1276||n.year>1500)throw l.replace(/\{0\}/,this.local.name);return n}}),e.calendars.ummalqura=t;var i=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),Mce=de({"src/components/calendars/calendars.js"(e,r){"use strict";r.exports=_c(),cce(),fce(),hce(),dce(),pce(),vce(),mce(),gce(),yce(),_ce(),xce(),bce(),wce(),Tce(),Ace()}}),Sce=de({"src/components/calendars/index.js"(e,r){"use strict";var t=Mce(),i=Qt(),a=cn(),o=a.EPOCHJD,s=a.ONEDAY,l={valType:"enumerated",values:i.sortObjectKeys(t.calendars),editType:"calc",dflt:"gregorian"},n=function(w,k,A,b){var E={};return E[A]=l,i.coerce(w,k,E,A,b)},u=function(w,k,A,b){for(var E=0;E{dt.preventDefault(),dt.stopPropagation(),dt.clipboardData.setData("text",Ie),Oe.removeEventListener("copy",Qe,!0)};Oe.addEventListener("copy",Qe,!0),document.execCommand("copy")}We.copyText=oe})(Tj||(Tj={}));var Os;(function(We){function oe(dt){let Jt=window.getComputedStyle(dt),jt=parseFloat(Jt.borderTopWidth)||0,Xt=parseFloat(Jt.borderLeftWidth)||0,nr=parseFloat(Jt.borderRightWidth)||0,Ht=parseFloat(Jt.borderBottomWidth)||0,er=parseFloat(Jt.paddingTop)||0,ur=parseFloat(Jt.paddingLeft)||0,ir=parseFloat(Jt.paddingRight)||0,Ot=parseFloat(Jt.paddingBottom)||0,ar=Xt+ur+ir+nr,Lr=jt+er+Ot+Ht;return{borderTop:jt,borderLeft:Xt,borderRight:nr,borderBottom:Ht,paddingTop:er,paddingLeft:ur,paddingRight:ir,paddingBottom:Ot,horizontalSum:ar,verticalSum:Lr}}We.boxSizing=oe;function Ie(dt){let Jt=window.getComputedStyle(dt),jt=parseFloat(Jt.minWidth)||0,Xt=parseFloat(Jt.minHeight)||0,nr=parseFloat(Jt.maxWidth)||1/0,Ht=parseFloat(Jt.maxHeight)||1/0;return nr=Math.max(jt,nr),Ht=Math.max(Xt,Ht),{minWidth:jt,minHeight:Xt,maxWidth:nr,maxHeight:Ht}}We.sizeLimits=Ie;function Oe(dt,Jt,jt){let Xt=dt.getBoundingClientRect();return Jt>=Xt.left&&Jt=Xt.top&&jt=jt.bottom)){if(Xt.topjt.bottom&&Xt.height>=jt.height){dt.scrollTop-=jt.top-Xt.top;return}if(Xt.topjt.height){dt.scrollTop-=jt.bottom-Xt.bottom;return}if(Xt.bottom>jt.bottom&&Xt.height{let Ht=Element.prototype;return Ht.matches||Ht.matchesSelector||Ht.mozMatchesSelector||Ht.msMatchesSelector||Ht.oMatchesSelector||Ht.webkitMatchesSelector||function(er){let ur=this,ir=ur.ownerDocument?ur.ownerDocument.querySelectorAll(er):[];return Array.prototype.indexOf.call(ir,ur)!==-1}})();function oe(Ht){Ht=Ht.split(",",1)[0];let er=0,ur=0,ir=0;function Ot(ar){let Lr=Ht.match(ar);return Lr===null?!1:(Ht=Ht.slice(Lr[0].length),!0)}for(Ht=Ht.replace(nr," $1 ");Ht.length>0;){if(Ot(Ie)){er++;continue}if(Ot(Oe)){ur++;continue}if(Ot(Qe)){ur++;continue}if(Ot(Jt)){ir++;continue}if(Ot(jt)){ur++;continue}if(Ot(dt)){ir++;continue}if(!Ot(Xt))return 0}return er=Math.min(er,255),ur=Math.min(ur,255),ir=Math.min(ir,255),er<<16|ur<<8|ir}We.calculateSingle=oe;let Ie=/^#[^\s\+>~#\.\[:]+/,Oe=/^\.[^\s\+>~#\.\[:]+/,Qe=/^\[[^\]]+\]/,dt=/^[^\s\+>~#\.\[:]+/,Jt=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,jt=/^:[^\s\+>~#\.\[:]+/,Xt=/^[\s\+>~\*]+/,nr=/:not\(([^\)]+)\)/g})(hd||(hd={}));var pp=hp(lv());var Km=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let oe=this._first;for(;oe;)yield oe.value,oe=oe.next}*retro(){let oe=this._last;for(;oe;)yield oe.value,oe=oe.prev}*nodes(){let oe=this._first;for(;oe;)yield oe,oe=oe.next}*retroNodes(){let oe=this._last;for(;oe;)yield oe,oe=oe.prev}assign(oe){this.clear();for(let Ie of oe)this.addLast(Ie)}push(oe){this.addLast(oe)}pop(){return this.removeLast()}shift(oe){this.addFirst(oe)}unshift(){return this.removeFirst()}addFirst(oe){let Ie=new dp.LinkedListNode(this,oe);return this._first?(Ie.next=this._first,this._first.prev=Ie,this._first=Ie):(this._first=Ie,this._last=Ie),this._size++,Ie}addLast(oe){let Ie=new dp.LinkedListNode(this,oe);return this._last?(Ie.prev=this._last,this._last.next=Ie,this._last=Ie):(this._first=Ie,this._last=Ie),this._size++,Ie}insertBefore(oe,Ie){if(!Ie||Ie===this._first)return this.addFirst(oe);if(!(Ie instanceof dp.LinkedListNode)||Ie.list!==this)throw new Error("Reference node is not owned by the list.");let Oe=new dp.LinkedListNode(this,oe),Qe=Ie,dt=Qe.prev;return Oe.next=Qe,Oe.prev=dt,Qe.prev=Oe,dt.next=Oe,this._size++,Oe}insertAfter(oe,Ie){if(!Ie||Ie===this._last)return this.addLast(oe);if(!(Ie instanceof dp.LinkedListNode)||Ie.list!==this)throw new Error("Reference node is not owned by the list.");let Oe=new dp.LinkedListNode(this,oe),Qe=Ie,dt=Qe.next;return Oe.next=dt,Oe.prev=Qe,Qe.next=Oe,dt.prev=Oe,this._size++,Oe}removeFirst(){let oe=this._first;if(oe)return oe===this._last?(this._first=null,this._last=null):(this._first=oe.next,this._first.prev=null),oe.list=null,oe.next=null,oe.prev=null,this._size--,oe.value}removeLast(){let oe=this._last;if(oe)return oe===this._first?(this._first=null,this._last=null):(this._last=oe.prev,this._last.next=null),oe.list=null,oe.next=null,oe.prev=null,this._size--,oe.value}removeNode(oe){if(!(oe instanceof dp.LinkedListNode)||oe.list!==this)throw new Error("Node is not owned by the list.");let Ie=oe;Ie===this._first&&Ie===this._last?(this._first=null,this._last=null):Ie===this._first?(this._first=Ie.next,this._first.prev=null):Ie===this._last?(this._last=Ie.prev,this._last.next=null):(Ie.next.prev=Ie.prev,Ie.prev.next=Ie.next),Ie.list=null,Ie.next=null,Ie.prev=null,this._size--}clear(){let oe=this._first;for(;oe;){let Ie=oe.next;oe.list=null,oe.prev=null,oe.next=null,oe=Ie}this._first=null,this._last=null,this._size=0}};(function(We){function oe(Ie){let Oe=new We;return Oe.assign(Ie),Oe}We.from=oe})(Km||(Km={}));var dp;(function(We){class oe{constructor(Oe,Qe){this.list=null,this.next=null,this.prev=null,this.list=Oe,this.value=Qe}}We.LinkedListNode=oe})(dp||(dp={}));var rf=class{constructor(oe){this.type=oe}get isConflatable(){return!1}conflate(oe){return!1}},o0=class extends rf{get isConflatable(){return!0}conflate(oe){return!0}},za;(function(We){let oe=null,Ie=(Ki=>Ia=>{let _i=!1;return Ki.then(()=>!_i&&Ia()),()=>{_i=!0}})(Promise.resolve());function Oe(Ki,Ia){let _i=ur.get(Ki);if(!_i||_i.length===0){Ir(Ki,Ia);return}(0,pp.every)((0,pp.retro)(_i),Yr=>Yr?Lr(Yr,Ki,Ia):!0)&&Ir(Ki,Ia)}We.sendMessage=Oe;function Qe(Ki,Ia){if(!Ia.isConflatable){de(Ki,Ia);return}(0,pp.some)(er,ia=>ia.handler!==Ki||!ia.msg||ia.msg.type!==Ia.type||!ia.msg.isConflatable?!1:ia.msg.conflate(Ia))||de(Ki,Ia)}We.postMessage=Qe;function dt(Ki,Ia){let _i=ur.get(Ki);_i&&_i.indexOf(Ia)!==-1||(_i?_i.push(Ia):ur.set(Ki,[Ia]))}We.installMessageHook=dt;function Jt(Ki,Ia){let _i=ur.get(Ki);if(!_i)return;let ia=_i.indexOf(Ia);ia!==-1&&(_i[ia]=null,qr(_i))}We.removeMessageHook=Jt;function jt(Ki){let Ia=ur.get(Ki);Ia&&Ia.length>0&&(pp.ArrayExt.fill(Ia,null),qr(Ia));for(let _i of er)_i.handler===Ki&&(_i.handler=null,_i.msg=null)}We.clearData=jt;function Xt(){ar||oe===null||(oe(),oe=null,ar=!0,Mr(),ar=!1)}We.flush=Xt;function nr(){return Ot}We.getExceptionHandler=nr;function Ht(Ki){let Ia=Ot;return Ot=Ki,Ia}We.setExceptionHandler=Ht;let er=new Km,ur=new WeakMap,ir=new Set,Ot=Ki=>{console.error(Ki)},ar=!1;function Lr(Ki,Ia,_i){let ia=!0;try{typeof Ki=="function"?ia=Ki(Ia,_i):ia=Ki.messageHook(Ia,_i)}catch(Yr){Ot(Yr)}return ia}function Ir(Ki,Ia){try{Ki.processMessage(Ia)}catch(_i){Ot(_i)}}function de(Ki,Ia){er.addLast({handler:Ki,msg:Ia}),oe===null&&(oe=Ie(Mr))}function Mr(){if(oe=null,er.isEmpty)return;let Ki={handler:null,msg:null};for(er.addLast(Ki);;){let Ia=er.removeFirst();if(Ia===Ki)return;Ia.handler&&Ia.msg&&Oe(Ia.handler,Ia.msg)}}function qr(Ki){ir.size===0&&Ie(Vr),ir.add(Ki)}function Vr(){ir.forEach(ti),ir.clear()}function ti(Ki){pp.ArrayExt.removeAllWhere(Ki,Xr)}function Xr(Ki){return Ki===null}})(za||(za={}));var af=class{constructor(oe){this._pid=uv.nextPID(),this.name=oe.name,this._create=oe.create,this._coerce=oe.coerce||null,this._compare=oe.compare||null,this._changed=oe.changed||null}get(oe){let Ie,Oe=uv.ensureMap(oe);return this._pid in Oe?Ie=Oe[this._pid]:Ie=Oe[this._pid]=this._createValue(oe),Ie}set(oe,Ie){let Oe,Qe=uv.ensureMap(oe);this._pid in Qe?Oe=Qe[this._pid]:Oe=Qe[this._pid]=this._createValue(oe);let dt=this._coerceValue(oe,Ie);this._maybeNotify(oe,Oe,Qe[this._pid]=dt)}coerce(oe){let Ie,Oe=uv.ensureMap(oe);this._pid in Oe?Ie=Oe[this._pid]:Ie=Oe[this._pid]=this._createValue(oe);let Qe=this._coerceValue(oe,Ie);this._maybeNotify(oe,Ie,Oe[this._pid]=Qe)}_createValue(oe){let Ie=this._create;return Ie(oe)}_coerceValue(oe,Ie){let Oe=this._coerce;return Oe?Oe(oe,Ie):Ie}_compareValue(oe,Ie){let Oe=this._compare;return Oe?Oe(oe,Ie):oe===Ie}_maybeNotify(oe,Ie,Oe){let Qe=this._changed;Qe&&!this._compareValue(Ie,Oe)&&Qe(oe,Ie,Oe)}};(function(We){function oe(Ie){uv.ownerData.delete(Ie)}We.clearData=oe})(af||(af={}));var uv;(function(We){We.ownerData=new WeakMap,We.nextPID=(()=>{let Ie=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${Ie++}`})();function oe(Ie){let Oe=We.ownerData.get(Ie);return Oe||(Oe=Object.create(null),We.ownerData.set(Ie,Oe),Oe)}We.ensureMap=oe})(uv||(uv={}));var ew=hp(lv()),zce=hp(Q2()),Ls=class{constructor(oe){this.sender=oe}connect(oe,Ie){return rh.connect(this,oe,Ie)}disconnect(oe,Ie){return rh.disconnect(this,oe,Ie)}emit(oe){rh.emit(this,oe)}};(function(We){function oe(Xt,nr){rh.disconnectBetween(Xt,nr)}We.disconnectBetween=oe;function Ie(Xt){rh.disconnectSender(Xt)}We.disconnectSender=Ie;function Oe(Xt){rh.disconnectReceiver(Xt)}We.disconnectReceiver=Oe;function Qe(Xt){rh.disconnectAll(Xt)}We.disconnectAll=Qe;function dt(Xt){rh.disconnectAll(Xt)}We.clearData=dt;function Jt(){return rh.exceptionHandler}We.getExceptionHandler=Jt;function jt(Xt){let nr=rh.exceptionHandler;return rh.exceptionHandler=Xt,nr}We.setExceptionHandler=jt})(Ls||(Ls={}));var rh;(function(We){We.exceptionHandler=de=>{console.error(de)};function oe(de,Mr,qr){qr=qr||void 0;let Vr=Xt.get(de.sender);if(Vr||(Vr=[],Xt.set(de.sender,Vr)),ur(Vr,de,Mr,qr))return!1;let ti=qr||Mr,Xr=nr.get(ti);Xr||(Xr=[],nr.set(ti,Xr));let Ki={signal:de,slot:Mr,thisArg:qr};return Vr.push(Ki),Xr.push(Ki),!0}We.connect=oe;function Ie(de,Mr,qr){qr=qr||void 0;let Vr=Xt.get(de.sender);if(!Vr||Vr.length===0)return!1;let ti=ur(Vr,de,Mr,qr);if(!ti)return!1;let Xr=qr||Mr,Ki=nr.get(Xr);return ti.signal=null,Ot(Vr),Ot(Ki),!0}We.disconnect=Ie;function Oe(de,Mr){let qr=Xt.get(de);if(!qr||qr.length===0)return;let Vr=nr.get(Mr);if(!(!Vr||Vr.length===0)){for(let ti of Vr)ti.signal&&ti.signal.sender===de&&(ti.signal=null);Ot(qr),Ot(Vr)}}We.disconnectBetween=Oe;function Qe(de){let Mr=Xt.get(de);if(!(!Mr||Mr.length===0)){for(let qr of Mr){if(!qr.signal)continue;let Vr=qr.thisArg||qr.slot;qr.signal=null,Ot(nr.get(Vr))}Ot(Mr)}}We.disconnectSender=Qe;function dt(de){let Mr=nr.get(de);if(!(!Mr||Mr.length===0)){for(let qr of Mr){if(!qr.signal)continue;let Vr=qr.signal.sender;qr.signal=null,Ot(Xt.get(Vr))}Ot(Mr)}}We.disconnectReceiver=dt;function Jt(de){Qe(de),dt(de)}We.disconnectAll=Jt;function jt(de,Mr){let qr=Xt.get(de.sender);if(!(!qr||qr.length===0))for(let Vr=0,ti=qr.length;Vrti.signal===Mr&&ti.slot===qr&&ti.thisArg===Vr)}function ir(de,Mr){let{signal:qr,slot:Vr,thisArg:ti}=de;try{Vr.call(ti,qr.sender,Mr)}catch(Xr){We.exceptionHandler(Xr)}}function Ot(de){Ht.size===0&&er(ar),Ht.add(de)}function ar(){Ht.forEach(Lr),Ht.clear()}function Lr(de){ew.ArrayExt.removeAllWhere(de,Ir)}function Ir(de){return de.signal===null}})(rh||(rh={}));var s0=class{constructor(oe){this._fn=oe}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let oe=this._fn;this._fn=null,oe()}};var uy=class{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(oe=>{oe.dispose()}),this._items.clear())}contains(oe){return this._items.has(oe)}add(oe){this._items.add(oe)}remove(oe){this._items.delete(oe)}clear(){this._items.clear()}};(function(We){function oe(Ie){let Oe=new We;for(let Qe of Ie)Oe.add(Qe);return Oe}We.from=oe})(uy||(uy={}));var tw=class extends uy{constructor(){super(...arguments),this._disposed=new Ls(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),Ls.clearData(this))}};(function(We){function oe(Ie){let Oe=new We;for(let Qe of Ie)Oe.add(Qe);return Oe}We.from=oe})(tw||(tw={}));var nf=class We{constructor(oe){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:Ie,edge:Oe,distance:Qe}=this._scrollTarget,dt=jc.SCROLL_EDGE_SIZE-Qe,Jt=Math.pow(dt/jc.SCROLL_EDGE_SIZE,2),jt=Math.max(1,Math.round(Jt*jc.SCROLL_EDGE_SIZE));switch(Oe){case"top":Ie.scrollTop-=jt;break;case"left":Ie.scrollLeft-=jt;break;case"right":Ie.scrollLeft+=jt;break;case"bottom":Ie.scrollTop+=jt;break}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=oe.document||document,this.mimeData=oe.mimeData,this.dragImage=oe.dragImage||null,this.proposedAction=oe.proposedAction||"copy",this.supportedActions=oe.supportedActions||"all",this.source=oe.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let oe=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});jc.dispatchDragLeave(this,this._currentTarget,null,oe)}this._finalize("none")}}get isDisposed(){return this._disposed}start(oe,Ie){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(oe,Ie),this._promise=new Promise(Qe=>{this._resolve=Qe});let Oe=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:oe,clientY:Ie});return document.dispatchEvent(Oe),this._promise}handleEvent(oe){switch(oe.type){case"pointermove":this._evtPointerMove(oe);break;case"pointerup":this._evtPointerUp(oe);break;case"keydown":this._evtKeyDown(oe);break;default:oe.preventDefault(),oe.stopPropagation();break}}moveDragImage(oe,Ie){if(!this.dragImage)return;let Oe=this.dragImage.style;Oe.transform=`translate(${oe}px, ${Ie}px)`}_evtPointerMove(oe){oe.preventDefault(),oe.stopPropagation(),this._updateCurrentTarget(oe),this._updateDragScroll(oe),this.moveDragImage(oe.clientX,oe.clientY)}_evtPointerUp(oe){if(oe.preventDefault(),oe.stopPropagation(),oe.button!==0)return;if(this._updateCurrentTarget(oe),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){jc.dispatchDragLeave(this,this._currentTarget,null,oe),this._finalize("none");return}let Ie=jc.dispatchDrop(this,this._currentTarget,oe);this._finalize(Ie)}_evtKeyDown(oe){oe.preventDefault(),oe.stopPropagation(),oe.keyCode===27&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(oe){let Ie=jc.findScrollTarget(oe);!this._scrollTarget&&!Ie||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=Ie)}_updateCurrentTarget(oe){let Ie=this._currentTarget,Oe=this._currentTarget,Qe=this._currentElement,dt=jc.findElementBehindBackdrop(oe,this.document);this._currentElement=dt,dt!==Qe&&dt!==Oe&&jc.dispatchDragExit(this,Oe,dt,oe),dt!==Qe&&dt!==Oe&&(Oe=jc.dispatchDragEnter(this,dt,Oe,oe)),Oe!==Ie&&(this._currentTarget=Oe,jc.dispatchDragLeave(this,Ie,Oe,oe));let Jt=jc.dispatchDragOver(this,Oe,oe);this._setDropAction(Jt)}_attachDragImage(oe,Ie){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let Oe=this.dragImage.style;Oe.pointerEvents="none",Oe.position="fixed",Oe.transform=`translate(${oe}px, ${Ie}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let oe=this.dragImage.parentNode;oe&&oe.removeChild(this.dragImage)}_setDropAction(oe){if(oe=jc.validateAction(oe,this.supportedActions),!(this._override&&this._dropAction===oe))switch(oe){case"none":this._dropAction=oe,this._override=We.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=oe,this._override=We.overrideCursor("copy",this.document);break;case"link":this._dropAction=oe,this._override=We.overrideCursor("alias",this.document);break;case"move":this._dropAction=oe,this._override=We.overrideCursor("move",this.document);break}}_finalize(oe){let Ie=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,Ie&&Ie(oe)}};(function(We){class oe extends DragEvent{constructor(Qe,dt){super(dt.type,{bubbles:!0,cancelable:!0,altKey:Qe.altKey,button:Qe.button,clientX:Qe.clientX,clientY:Qe.clientY,ctrlKey:Qe.ctrlKey,detail:0,metaKey:Qe.metaKey,relatedTarget:dt.related,screenX:Qe.screenX,screenY:Qe.screenY,shiftKey:Qe.shiftKey,view:window});let{drag:Jt}=dt;this.dropAction="none",this.mimeData=Jt.mimeData,this.proposedAction=Jt.proposedAction,this.supportedActions=Jt.supportedActions,this.source=Jt.source}}We.Event=oe;function Ie(Oe,Qe=document){return jc.overrideCursor(Oe,Qe)}We.overrideCursor=Ie})(nf||(nf={}));var jc;(function(We){We.SCROLL_EDGE_SIZE=20;function oe(qr,Vr){return er[qr]&ur[Vr]?qr:"none"}We.validateAction=oe;function Ie(qr,Vr=document){if(qr){if(Oe&&qr==Oe.event)return Oe.element;We.cursorBackdrop.style.zIndex="-1000";let ti=Vr.elementFromPoint(qr.clientX,qr.clientY);return We.cursorBackdrop.style.zIndex="",Oe={event:qr,element:ti},ti}else{let ti=We.cursorBackdrop.style.transform;if(Qe&&ti===Qe.transform)return Qe.element;let Xr=We.cursorBackdrop.getBoundingClientRect();We.cursorBackdrop.style.zIndex="-1000";let Ki=Vr.elementFromPoint(Xr.left+Xr.width/2,Xr.top+Xr.height/2);return We.cursorBackdrop.style.zIndex="",Qe={transform:ti,element:Ki},Ki}}We.findElementBehindBackdrop=Ie;let Oe=null,Qe=null;function dt(qr){let Vr=qr.clientX,ti=qr.clientY,Xr=Ie(qr);for(;Xr;Xr=Xr.parentElement){if(!Xr.hasAttribute("data-lm-dragscroll"))continue;let Ki=0,Ia=0;Xr===document.body&&(Ki=window.pageXOffset,Ia=window.pageYOffset);let _i=Xr.getBoundingClientRect(),ia=_i.top+Ia,Yr=_i.left+Ki,Ba=Yr+_i.width,eo=ia+_i.height;if(Vr=Ba||ti=eo)continue;let rs=Vr-Yr+1,Oo=ti-ia+1,da=Ba-Vr,cn=eo-ti,Ss=Math.min(rs,Oo,da,cn);if(Ss>We.SCROLL_EDGE_SIZE)continue;let is;switch(Ss){case cn:is="bottom";break;case Oo:is="top";break;case da:is="right";break;case rs:is="left";break;default:throw"unreachable"}let Do=Xr.scrollWidth-Xr.clientWidth,sl=Xr.scrollHeight-Xr.clientHeight,cu;switch(is){case"top":cu=sl>0&&Xr.scrollTop>0;break;case"left":cu=Do>0&&Xr.scrollLeft>0;break;case"right":cu=Do>0&&Xr.scrollLeft0&&Xr.scrollTop{ti===Mr&&We.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",Ot,!0),We.cursorBackdrop.removeEventListener("scroll",ar,!0),Xr.removeChild(We.cursorBackdrop))})}We.overrideCursor=ir;function Ot(qr){if(We.cursorBackdrop){We.cursorBackdrop.style.transform=`translate(${qr.clientX}px, ${qr.clientY}px)`;try{We.cursorBackdrop.hasPointerCapture(qr.pointerId)||We.cursorBackdrop.setPointerCapture(qr.pointerId)}catch{}}}function ar(qr){if(!We.cursorBackdrop)return;let Vr=Ie();if(!Vr)return;let ti=Vr.closest("[data-lm-dragscroll]");ti&&(ti.scrollTop+=We.cursorBackdrop.scrollTop-Ir,ti.scrollLeft+=We.cursorBackdrop.scrollLeft-Ir,Lr())}function Lr(){We.cursorBackdrop.scrollTop=Ir,We.cursorBackdrop.scrollLeft=Ir}let Ir=500;function de(){let qr=document.createElement("div");return qr.classList.add("lm-cursor-backdrop"),qr}let Mr=0;We.cursorBackdrop=de()})(jc||(jc={}));var Aj=hp(lv()),cc=hp(Q2());function Jm(){return YS.keyboardLayout}var cy=class We{constructor(oe,Ie,Oe=[]){this.name=oe,this._codes=Ie,this._keys=We.extractKeys(Ie),this._modifierKeys=We.convertToKeySet(Oe)}keys(){return Object.keys(this._keys)}isValidKey(oe){return oe in this._keys}isModifierKey(oe){return oe in this._modifierKeys}keyForKeydownEvent(oe){return this._codes[oe.keyCode]||""}};(function(We){function oe(Oe){let Qe=Object.create(null);for(let dt in Oe)Qe[Oe[dt]]=!0;return Qe}We.extractKeys=oe;function Ie(Oe){let Qe=Object(null);for(let dt=0,Jt=Oe.length;dt{this._commands.delete(oe),this._commandChanged.emit({id:oe,type:"removed"})})}notifyCommandChanged(oe){if(oe!==void 0&&!this._commands.has(oe))throw new Error(`Command '${oe}' is not registered.`);this._commandChanged.emit({id:oe,type:oe?"changed":"many-changed"})}describedBy(oe,Ie=cc.JSONExt.emptyObject){var Oe;let Qe=this._commands.get(oe);return Promise.resolve((Oe=Qe?.describedBy.call(void 0,Ie))!==null&&Oe!==void 0?Oe:{args:null})}label(oe,Ie=cc.JSONExt.emptyObject){var Oe;let Qe=this._commands.get(oe);return(Oe=Qe?.label.call(void 0,Ie))!==null&&Oe!==void 0?Oe:""}mnemonic(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.mnemonic.call(void 0,Ie):-1}icon(oe,Ie=cc.JSONExt.emptyObject){var Oe;return(Oe=this._commands.get(oe))===null||Oe===void 0?void 0:Oe.icon.call(void 0,Ie)}iconClass(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.iconClass.call(void 0,Ie):""}iconLabel(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.iconLabel.call(void 0,Ie):""}caption(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.caption.call(void 0,Ie):""}usage(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.usage.call(void 0,Ie):""}className(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.className.call(void 0,Ie):""}dataset(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.dataset.call(void 0,Ie):{}}isEnabled(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.isEnabled.call(void 0,Ie):!1}isToggled(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.isToggled.call(void 0,Ie):!1}isToggleable(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.isToggleable:!1}isVisible(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);return Oe?Oe.isVisible.call(void 0,Ie):!1}execute(oe,Ie=cc.JSONExt.emptyObject){let Oe=this._commands.get(oe);if(!Oe)return Promise.reject(new Error(`Command '${oe}' not registered.`));let Qe;try{Qe=Oe.execute.call(void 0,Ie)}catch(Jt){Qe=Promise.reject(Jt)}let dt=Promise.resolve(Qe);return this._commandExecuted.emit({id:oe,args:Ie,result:dt}),dt}addKeyBinding(oe){let Ie=pd.createKeyBinding(oe);return this._keyBindings.push(Ie),this._keyBindingChanged.emit({binding:Ie,type:"added"}),new s0(()=>{Aj.ArrayExt.removeFirstOf(this._keyBindings,Ie),this._keyBindingChanged.emit({binding:Ie,type:"removed"})})}processKeydownEvent(oe){if(oe.defaultPrevented||this._replaying)return;let Ie=We.keystrokeForKeydownEvent(oe);if(!Ie){this._replayKeydownEvents(),this._clearPendingState();return}if(We.isModifierKeyPressed(oe)){let{exact:Jt}=pd.matchKeyBinding(this._keyBindings,[Ie],oe);Jt?(oe.preventDefault(),oe.stopPropagation(),this._startModifierTimer(Jt)):this._clearModifierTimer();return}this._keystrokes.push(Ie);let{exact:Oe,partial:Qe}=pd.matchKeyBinding(this._keyBindings,this._keystrokes,oe),dt=Qe.length!==0;if(!Oe&&!dt){this._replayKeydownEvents(),this._clearPendingState();return}if((Oe?.preventDefault||Qe.some(Jt=>Jt.preventDefault))&&(oe.preventDefault(),oe.stopPropagation()),this._keydownEvents.push(oe),Oe&&!dt){this._executeKeyBinding(Oe),this._clearPendingState();return}Oe&&(this._exactKeyMatch=Oe),this._startTimer()}holdKeyBindingExecution(oe,Ie){this._holdKeyBindingPromises.set(oe,Ie)}processKeyupEvent(oe){this._clearModifierTimer()}_startModifierTimer(oe){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(oe)},pd.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},pd.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(pd.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(oe){if(this._holdKeyBindingPromises.size!==0){let dt=[...this._keydownEvents],Jt=(await Promise.race([Promise.all(dt.map(async jt=>{var Xt;return(Xt=this._holdKeyBindingPromises.get(jt))!==null&&Xt!==void 0?Xt:Promise.resolve(!0)})),new Promise(jt=>{setTimeout(()=>jt([!1]),pd.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!Jt)return}let{command:Ie,args:Oe}=oe,Qe={_luminoEvent:{type:"keybinding",keys:oe.keys},...Oe};if(!this.hasCommand(Ie)||!this.isEnabled(Ie,Qe)){let dt=this.hasCommand(Ie)?"enabled":"registered",jt=`Cannot execute key binding '${oe.keys.join(", ")}':`,Xt=`command '${Ie}' is not ${dt}.`;console.warn(`${jt} ${Xt}`);return}await this.execute(Ie,Qe)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}};(function(We){function oe(jt){let Xt="",nr=!1,Ht=!1,er=!1,ur=!1;for(let ir of jt.split(/\s+/))ir==="Accel"?Nc.IS_MAC?Ht=!0:er=!0:ir==="Alt"?nr=!0:ir==="Cmd"?Ht=!0:ir==="Ctrl"?er=!0:ir==="Shift"?ur=!0:ir.length>0&&(Xt=ir);return{cmd:Ht,ctrl:er,alt:nr,shift:ur,key:Xt}}We.parseKeystroke=oe;function Ie(jt){let Xt="",nr=oe(jt);return nr.ctrl&&(Xt+="Ctrl "),nr.alt&&(Xt+="Alt "),nr.shift&&(Xt+="Shift "),nr.cmd&&Nc.IS_MAC&&(Xt+="Cmd "),nr.key?Xt+nr.key:Xt.trim()}We.normalizeKeystroke=Ie;function Oe(jt){let Xt;return Nc.IS_WIN?Xt=jt.winKeys||jt.keys:Nc.IS_MAC?Xt=jt.macKeys||jt.keys:Xt=jt.linuxKeys||jt.keys,Xt.map(Ie)}We.normalizeKeys=Oe;function Qe(jt){return typeof jt=="string"?Xt(jt):jt.map(Xt).join(", ");function Xt(nr){let Ht=[],er=Nc.IS_MAC?" ":"+",ur=oe(nr);return ur.ctrl&&Ht.push("Ctrl"),ur.alt&&Ht.push("Alt"),ur.shift&&Ht.push("Shift"),Nc.IS_MAC&&ur.cmd&&Ht.push("Cmd"),Ht.push(ur.key),Ht.map(pd.formatKey).join(er)}}We.formatKeystroke=Qe;function dt(jt){let Xt=Jm(),nr=Xt.keyForKeydownEvent(jt);return Xt.isModifierKey(nr)}We.isModifierKeyPressed=dt;function Jt(jt){let Xt=Jm(),nr=Xt.keyForKeydownEvent(jt),Ht=[];return jt.ctrlKey&&Ht.push("Ctrl"),jt.altKey&&Ht.push("Alt"),jt.shiftKey&&Ht.push("Shift"),jt.metaKey&&Nc.IS_MAC&&Ht.push("Cmd"),Xt.isModifierKey(nr)||Ht.push(nr),Ht.join(" ")}We.keystrokeForKeydownEvent=Jt})(vp||(vp={}));var pd;(function(We){We.CHORD_TIMEOUT=1e3,We.KEYBINDING_HOLD_TIMEOUT=1e3,We.modifierkeyTimeOut=500;function oe(Mr){return{execute:Mr.execute,describedBy:Ot(typeof Mr.describedBy=="function"?Mr.describedBy:{args:null,...Mr.describedBy},()=>({args:null})),label:Ot(Mr.label,Xt),mnemonic:Ot(Mr.mnemonic,nr),icon:Ot(Mr.icon,ir),iconClass:Ot(Mr.iconClass,Xt),iconLabel:Ot(Mr.iconLabel,Xt),caption:Ot(Mr.caption,Xt),usage:Ot(Mr.usage,Xt),className:Ot(Mr.className,Xt),dataset:Ot(Mr.dataset,ur),isEnabled:Mr.isEnabled||Ht,isToggled:Mr.isToggled||er,isToggleable:Mr.isToggleable||!!Mr.isToggled,isVisible:Mr.isVisible||Ht}}We.createCommand=oe;function Ie(Mr){var qr;return{keys:vp.normalizeKeys(Mr),selector:ar(Mr),command:Mr.command,args:Mr.args||cc.JSONExt.emptyObject,preventDefault:(qr=Mr.preventDefault)!==null&&qr!==void 0?qr:!0}}We.createKeyBinding=Ie;function Oe(Mr,qr,Vr){let ti=null,Xr=[],Ki=1/0,Ia=0;for(let _i=0,ia=Mr.length;_iKi)continue;let rs=dd.calculateSpecificity(Yr.selector);(!ti||eo=Ia)&&(ti=Yr,Ki=eo,Ia=rs)}return{exact:ti,partial:Xr}}We.matchKeyBinding=Oe;function Qe(Mr){Mr.target.dispatchEvent(de(Mr))}We.replayKeyEvent=Qe;function dt(Mr){return Nc.IS_MAC?Jt.hasOwnProperty(Mr)?Jt[Mr]:Mr:jt.hasOwnProperty(Mr)?jt[Mr]:Mr}We.formatKey=dt;let Jt={Backspace:"\u232B",Tab:"\u21E5",Enter:"\u23CE",Shift:"\u21E7",Ctrl:"\u2303",Alt:"\u2325",Escape:"\u238B",PageUp:"\u21DE",PageDown:"\u21DF",End:"\u2198",Home:"\u2196",ArrowLeft:"\u2190",ArrowUp:"\u2191",ArrowRight:"\u2192",ArrowDown:"\u2193",Delete:"\u2326",Cmd:"\u2318"},jt={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Xt=()=>"",nr=()=>-1,Ht=()=>!0,er=()=>!1,ur=()=>({}),ir=()=>{};function Ot(Mr,qr){return Mr===void 0?qr:typeof Mr=="function"?Mr:()=>Mr}function ar(Mr){if(Mr.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${Mr.selector}`);if(!dd.isValid(Mr.selector))throw new Error(`Invalid selector: ${Mr.selector}`);return Mr.selector}function Lr(Mr,qr){if(Mr.lengthqr.length?2:1}function Ir(Mr,qr){let Vr=qr.target,ti=qr.currentTarget;for(let Xr=0;Vr!==null;Vr=Vr.parentElement,++Xr){if(Vr.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(dd.matches(Vr,Mr))return Xr;if(Vr===ti)return-1}return-1}function de(Mr){let qr=document.createEvent("Event"),Vr=Mr.bubbles||!0,ti=Mr.cancelable||!0;return qr.initEvent(Mr.type||"keydown",Vr,ti),qr.key=Mr.key||"",qr.keyCode=Mr.keyCode||0,qr.which=Mr.keyCode||0,qr.ctrlKey=Mr.ctrlKey||!1,qr.altKey=Mr.altKey||!1,qr.shiftKey=Mr.shiftKey||!1,qr.metaKey=Mr.metaKey||!1,qr.view=Mr.view||window,qr}})(pd||(pd={}));var Qm=hp(lv()),e1=class{constructor(oe){this.type="text",this.content=oe}},fy=class{constructor(oe,Ie,Oe,Qe){this.type="element",this.tag=oe,this.attrs=Ie,this.children=Oe,this.renderer=Qe}};function Fs(We){let oe={},Ie,Oe=[];for(let dt=1,Jt=arguments.length;dt=Ir.length){Ie(ar[qr],ir);continue}let Vr=Ir[qr],ti=ar[qr];if(Vr===ti){de=de.nextSibling;continue}if(Vr.type==="text"&&ti.type==="text"){de.textContent!==ti.content&&(de.textContent=ti.content),de=de.nextSibling;continue}if(Vr.type==="text"||ti.type==="text"){Qm.ArrayExt.insert(Ir,qr,ti),Ie(ti,ir,de);continue}if(!Vr.renderer!=!ti.renderer){Qm.ArrayExt.insert(Ir,qr,ti),Ie(ti,ir,de);continue}let Xr=ti.attrs.key;if(Xr&&Xr in Lr){let Ia=Lr[Xr];Ia.vNode!==Vr&&(Qm.ArrayExt.move(Ir,Ir.indexOf(Ia.vNode,qr+1),qr),ir.insertBefore(Ia.element,de),Vr=Ia.vNode,de=Ia.element)}if(Vr===ti){de=de.nextSibling;continue}let Ki=Vr.attrs.key;if(Ki&&Ki!==Xr){Qm.ArrayExt.insert(Ir,qr,ti),Ie(ti,ir,de);continue}if(Vr.tag!==ti.tag){Qm.ArrayExt.insert(Ir,qr,ti),Ie(ti,ir,de);continue}jt(de,Vr.attrs,ti.attrs),ti.renderer?ti.renderer.render(de,{attrs:ti.attrs,children:ti.children}):Oe(de,Vr.children,ti.children),de=de.nextSibling}Qe(ir,Ir,Mr,!0)}We.updateContent=Oe;function Qe(ir,Ot,ar,Lr){for(let Ir=Ot.length-1;Ir>=ar;--Ir){let de=Ot[Ir],Mr=Lr?ir.lastChild:ir.childNodes[Ir];de.type==="text"||(de.renderer&&de.renderer.unrender?de.renderer.unrender(Mr,{attrs:de.attrs,children:de.children}):Qe(Mr,de.children,0,!1)),Lr&&ir.removeChild(Mr)}}let dt={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function Jt(ir,Ot){for(let ar in Ot)ar in dt||(ar.substr(0,2)==="on"?ir[ar]=Ot[ar]:ir.setAttribute(ar,Ot[ar]));Ot.className!==void 0&&ir.setAttribute("class",Ot.className),Ot.htmlFor!==void 0&&ir.setAttribute("for",Ot.htmlFor),Ot.dataset&&Xt(ir,Ot.dataset),Ot.style&&Ht(ir,Ot.style)}function jt(ir,Ot,ar){if(Ot===ar)return;let Lr;for(Lr in Ot)Lr in dt||Lr in ar||(Lr.substr(0,2)==="on"?ir[Lr]=null:ir.removeAttribute(Lr));for(Lr in ar)Lr in dt||Ot[Lr]===ar[Lr]||(Lr.substr(0,2)==="on"?ir[Lr]=ar[Lr]:ir.setAttribute(Lr,ar[Lr]));Ot.className!==ar.className&&(ar.className!==void 0?ir.setAttribute("class",ar.className):ir.removeAttribute("class")),Ot.htmlFor!==ar.htmlFor&&(ar.htmlFor!==void 0?ir.setAttribute("for",ar.htmlFor):ir.removeAttribute("for")),Ot.dataset!==ar.dataset&&nr(ir,Ot.dataset||{},ar.dataset||{}),Ot.style!==ar.style&&er(ir,Ot.style||{},ar.style||{})}function Xt(ir,Ot){for(let ar in Ot)ir.setAttribute(`data-${ar}`,Ot[ar])}function nr(ir,Ot,ar){for(let Lr in Ot)Lr in ar||ir.removeAttribute(`data-${Lr}`);for(let Lr in ar)Ot[Lr]!==ar[Lr]&&ir.setAttribute(`data-${Lr}`,ar[Lr])}function Ht(ir,Ot){let ar=ir.style,Lr;for(Lr in Ot)ar[Lr]=Ot[Lr]}function er(ir,Ot,ar){let Lr=ir.style,Ir;for(Ir in Ot)Ir in ar||(Lr[Ir]="");for(Ir in ar)Ot[Ir]!==ar[Ir]&&(Lr[Ir]=ar[Ir])}function ur(ir,Ot){let ar=ir.firstChild,Lr=Object.create(null);for(let Ir of Ot)Ir.type==="element"&&Ir.attrs.key&&(Lr[Ir.attrs.key]={vNode:Ir,element:ar}),ar=ar.nextSibling;return Lr}})(cv||(cv={}));var Wd=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}},ih;(function(We){function oe(dt,Jt){let jt=dt.length;if(jt===0)return Jt;let Xt=0,nr=0,Ht=0,er=0,ur=0;for(let ar=0;ar0&&(er+=Lr.stretch,ur++)}if(Jt===Ht)return 0;if(Jt<=Xt){for(let ar=0;ar=nr){for(let ar=0;ar0&&ar>ir;){let Lr=ar,Ir=er;for(let de=0;de0&&ar>ir;){let Lr=ar/Ot;for(let Ir=0;Ir0&&ar>ir;){let Lr=ar,Ir=er;for(let de=0;de=Mr.maxSize?(ar-=Mr.maxSize-Mr.size,er-=Mr.stretch,Mr.size=Mr.maxSize,Mr.done=!0,Ot--,ur--):(ar-=qr,Mr.size+=qr)}}for(;Ot>0&&ar>ir;){let Lr=ar/Ot;for(let Ir=0;Ir=de.maxSize?(ar-=de.maxSize-de.size,de.size=de.maxSize,de.done=!0,Ot--):(ar-=Lr,de.size+=Lr))}}}return 0}We.calc=oe;function Ie(dt,Jt,jt){dt.length===0||jt===0||(jt>0?Oe(dt,Jt,jt):Qe(dt,Jt,-jt))}We.adjust=Ie;function Oe(dt,Jt,jt){let Xt=0;for(let ur=0;ur<=Jt;++ur){let ir=dt[ur];Xt+=ir.maxSize-ir.size}let nr=0;for(let ur=Jt+1,ir=dt.length;ur=0&&Ht>0;--ur){let ir=dt[ur],Ot=ir.maxSize-ir.size;Ot>=Ht?(ir.sizeHint=ir.size+Ht,Ht=0):(ir.sizeHint=ir.size+Ot,Ht-=Ot)}let er=jt;for(let ur=Jt+1,ir=dt.length;ur0;++ur){let Ot=dt[ur],ar=Ot.size-Ot.minSize;ar>=er?(Ot.sizeHint=Ot.size-er,er=0):(Ot.sizeHint=Ot.size-ar,er-=ar)}}function Qe(dt,Jt,jt){let Xt=0;for(let ur=Jt+1,ir=dt.length;ur0;++ur){let Ot=dt[ur],ar=Ot.maxSize-Ot.size;ar>=Ht?(Ot.sizeHint=Ot.size+Ht,Ht=0):(Ot.sizeHint=Ot.size+ar,Ht-=ar)}let er=jt;for(let ur=Jt;ur>=0&&er>0;--ur){let ir=dt[ur],Ot=ir.size-ir.minSize;Ot>=er?(ir.sizeHint=ir.size-er,er=0):(ir.sizeHint=ir.size-Ot,er-=Ot)}}})(ih||(ih={}));var hy=class{constructor(oe){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Ls(this),this._isDisposed=!1,this.owner=oe.owner,oe.label!==void 0&&(this._label=oe.label),oe.mnemonic!==void 0&&(this._mnemonic=oe.mnemonic),oe.icon!==void 0&&(this._icon=oe.icon),oe.iconClass!==void 0&&(this._iconClass=oe.iconClass),oe.iconLabel!==void 0&&(this._iconLabel=oe.iconLabel),oe.caption!==void 0&&(this._caption=oe.caption),oe.className!==void 0&&(this._className=oe.className),oe.closable!==void 0&&(this._closable=oe.closable),this._dataset=oe.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(oe){this._label!==oe&&(this._label=oe,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(oe){this._mnemonic!==oe&&(this._mnemonic=oe,this._changed.emit(void 0))}get icon(){return this._icon}set icon(oe){this._icon!==oe&&(this._icon=oe,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(oe){this._iconClass!==oe&&(this._iconClass=oe,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(oe){this._iconLabel!==oe&&(this._iconLabel=oe,this._changed.emit(void 0))}get caption(){return this._caption}set caption(oe){this._caption!==oe&&(this._caption=oe,this._changed.emit(void 0))}get className(){return this._className}set className(oe){this._className!==oe&&(this._className=oe,this._changed.emit(void 0))}get closable(){return this._closable}set closable(oe){this._closable!==oe&&(this._closable=oe,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(oe){this._dataset!==oe&&(this._dataset=oe,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,Ls.clearData(this))}},Ya=class We{constructor(oe={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new Ls(this),this._hiddenMode=We.HiddenMode.Display,this.node=rw.createNode(oe),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(We.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&We.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Ls.clearData(this),za.clearData(this),af.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(We.Flag.IsDisposed)}get isAttached(){return this.testFlag(We.Flag.IsAttached)}get isHidden(){return this.testFlag(We.Flag.IsHidden)}get isVisible(){let oe=this;do{if(oe.isHidden||!oe.isAttached)return!1;oe=oe.parent}while(oe!=null);return!0}get title(){return rw.titleProperty.get(this)}get id(){return this.node.id}set id(oe){this.node.id=oe}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(oe){this._hiddenMode!==oe&&(this.isHidden&&this._toggleHidden(!1),oe==We.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=oe,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(oe){if(this._parent!==oe){if(oe&&this.contains(oe))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let Ie=new We.ChildMessage("child-removed",this);za.sendMessage(this._parent,Ie)}if(this._parent=oe,this._parent&&!this._parent.isDisposed){let Ie=new We.ChildMessage("child-added",this);za.sendMessage(this._parent,Ie)}this.isDisposed||za.sendMessage(this,We.Msg.ParentChanged)}}get layout(){return this._layout}set layout(oe){if(this._layout!==oe){if(this.testFlag(We.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(oe.parent)throw new Error("Cannot change layout parent.");this._layout=oe,oe.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(oe){for(let Ie=oe;Ie;Ie=Ie._parent)if(Ie===this)return!0;return!1}hasClass(oe){return this.node.classList.contains(oe)}addClass(oe){this.node.classList.add(oe)}removeClass(oe){this.node.classList.remove(oe)}toggleClass(oe,Ie){return Ie===!0?(this.node.classList.add(oe),!0):Ie===!1?(this.node.classList.remove(oe),!1):this.node.classList.toggle(oe)}update(){za.postMessage(this,We.Msg.UpdateRequest)}fit(){za.postMessage(this,We.Msg.FitRequest)}activate(){za.postMessage(this,We.Msg.ActivateRequest)}close(){za.sendMessage(this,We.Msg.CloseRequest)}show(){if(this.testFlag(We.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&za.sendMessage(this,We.Msg.BeforeShow),this.clearFlag(We.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&za.sendMessage(this,We.Msg.AfterShow),this.parent)){let oe=new We.ChildMessage("child-shown",this);za.sendMessage(this.parent,oe)}}hide(){if(!this.testFlag(We.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&za.sendMessage(this,We.Msg.BeforeHide),this.setFlag(We.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&za.sendMessage(this,We.Msg.AfterHide),this.parent)){let oe=new We.ChildMessage("child-hidden",this);za.sendMessage(this.parent,oe)}}setHidden(oe){oe?this.hide():this.show()}testFlag(oe){return(this._flags&oe)!==0}setFlag(oe){this._flags|=oe}clearFlag(oe){this._flags&=~oe}processMessage(oe){switch(oe.type){case"resize":this.notifyLayout(oe),this.onResize(oe);break;case"update-request":this.notifyLayout(oe),this.onUpdateRequest(oe);break;case"fit-request":this.notifyLayout(oe),this.onFitRequest(oe);break;case"before-show":this.notifyLayout(oe),this.onBeforeShow(oe);break;case"after-show":this.setFlag(We.Flag.IsVisible),this.notifyLayout(oe),this.onAfterShow(oe);break;case"before-hide":this.notifyLayout(oe),this.onBeforeHide(oe);break;case"after-hide":this.clearFlag(We.Flag.IsVisible),this.notifyLayout(oe),this.onAfterHide(oe);break;case"before-attach":this.notifyLayout(oe),this.onBeforeAttach(oe);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(We.Flag.IsVisible),this.setFlag(We.Flag.IsAttached),this.notifyLayout(oe),this.onAfterAttach(oe);break;case"before-detach":this.notifyLayout(oe),this.onBeforeDetach(oe);break;case"after-detach":this.clearFlag(We.Flag.IsVisible),this.clearFlag(We.Flag.IsAttached),this.notifyLayout(oe),this.onAfterDetach(oe);break;case"activate-request":this.notifyLayout(oe),this.onActivateRequest(oe);break;case"close-request":this.notifyLayout(oe),this.onCloseRequest(oe);break;case"child-added":this.notifyLayout(oe),this.onChildAdded(oe);break;case"child-removed":this.notifyLayout(oe),this.onChildRemoved(oe);break;default:this.notifyLayout(oe);break}}notifyLayout(oe){this._layout&&this._layout.processParentMessage(oe)}onCloseRequest(oe){this.parent?this.parent=null:this.isAttached&&We.detach(this)}onResize(oe){}onUpdateRequest(oe){}onFitRequest(oe){}onActivateRequest(oe){}onBeforeShow(oe){}onAfterShow(oe){}onBeforeHide(oe){}onAfterHide(oe){}onBeforeAttach(oe){}onAfterAttach(oe){}onBeforeDetach(oe){}onAfterDetach(oe){}onChildAdded(oe){}onChildRemoved(oe){}_toggleHidden(oe){if(oe)switch(this._hiddenMode){case We.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case We.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case We.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1",this.node.style.opacity="0";break}else switch(this._hiddenMode){case We.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case We.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case We.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="",this.node.style.opacity="";break}}};(function(We){(function(dt){dt[dt.Display=0]="Display",dt[dt.Scale=1]="Scale",dt[dt.ContentVisibility=2]="ContentVisibility"})(We.HiddenMode||(We.HiddenMode={})),(function(dt){dt[dt.IsDisposed=1]="IsDisposed",dt[dt.IsAttached=2]="IsAttached",dt[dt.IsHidden=4]="IsHidden",dt[dt.IsVisible=8]="IsVisible",dt[dt.DisallowLayout=16]="DisallowLayout"})(We.Flag||(We.Flag={})),(function(dt){dt.BeforeShow=new rf("before-show"),dt.AfterShow=new rf("after-show"),dt.BeforeHide=new rf("before-hide"),dt.AfterHide=new rf("after-hide"),dt.BeforeAttach=new rf("before-attach"),dt.AfterAttach=new rf("after-attach"),dt.BeforeDetach=new rf("before-detach"),dt.AfterDetach=new rf("after-detach"),dt.ParentChanged=new rf("parent-changed"),dt.UpdateRequest=new o0("update-request"),dt.FitRequest=new o0("fit-request"),dt.ActivateRequest=new o0("activate-request"),dt.CloseRequest=new o0("close-request")})(We.Msg||(We.Msg={}));class oe extends rf{constructor(Jt,jt){super(Jt),this.child=jt}}We.ChildMessage=oe;class Ie extends rf{constructor(Jt,jt){super("resize"),this.width=Jt,this.height=jt}}We.ResizeMessage=Ie,(function(dt){dt.UnknownSize=new dt(-1,-1)})(Ie=We.ResizeMessage||(We.ResizeMessage={}));function Oe(dt,Jt,jt=null){if(dt.parent)throw new Error("Cannot attach a child widget.");if(dt.isAttached||dt.node.isConnected)throw new Error("Widget is already attached.");if(!Jt.isConnected)throw new Error("Host is not attached.");za.sendMessage(dt,We.Msg.BeforeAttach),Jt.insertBefore(dt.node,jt),za.sendMessage(dt,We.Msg.AfterAttach)}We.attach=Oe;function Qe(dt){if(dt.parent)throw new Error("Cannot detach a child widget.");if(!dt.isAttached||!dt.node.isConnected)throw new Error("Widget is not attached.");za.sendMessage(dt,We.Msg.BeforeDetach),dt.node.parentNode.removeChild(dt.node),za.sendMessage(dt,We.Msg.AfterDetach)}We.detach=Qe})(Ya||(Ya={}));var rw;(function(We){We.titleProperty=new af({name:"title",create:Ie=>new hy({owner:Ie})});function oe(Ie){return Ie.node||document.createElement(Ie.tag||"div")}We.createNode=oe})(rw||(rw={}));var _p=class{constructor(oe={}){this._disposed=!1,this._parent=null,this._fitPolicy=oe.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,Ls.clearData(this),af.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(oe){if(this._parent!==oe){if(this._parent)throw new Error("Cannot change parent widget.");if(oe.layout!==this)throw new Error("Invalid parent widget.");this._parent=oe,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(oe){if(this._fitPolicy!==oe&&(this._fitPolicy=oe,this._parent)){let Ie=this._parent.node.style;Ie.minWidth="",Ie.minHeight="",Ie.maxWidth="",Ie.maxHeight="",this._parent.fit()}}processParentMessage(oe){switch(oe.type){case"resize":this.onResize(oe);break;case"update-request":this.onUpdateRequest(oe);break;case"fit-request":this.onFitRequest(oe);break;case"before-show":this.onBeforeShow(oe);break;case"after-show":this.onAfterShow(oe);break;case"before-hide":this.onBeforeHide(oe);break;case"after-hide":this.onAfterHide(oe);break;case"before-attach":this.onBeforeAttach(oe);break;case"after-attach":this.onAfterAttach(oe);break;case"before-detach":this.onBeforeDetach(oe);break;case"after-detach":this.onAfterDetach(oe);break;case"child-removed":this.onChildRemoved(oe);break;case"child-shown":this.onChildShown(oe);break;case"child-hidden":this.onChildHidden(oe);break}}init(){for(let oe of this)oe.parent=this.parent}onResize(oe){for(let Ie of this)za.sendMessage(Ie,Ya.ResizeMessage.UnknownSize)}onUpdateRequest(oe){for(let Ie of this)za.sendMessage(Ie,Ya.ResizeMessage.UnknownSize)}onBeforeAttach(oe){for(let Ie of this)za.sendMessage(Ie,oe)}onAfterAttach(oe){for(let Ie of this)za.sendMessage(Ie,oe)}onBeforeDetach(oe){for(let Ie of this)za.sendMessage(Ie,oe)}onAfterDetach(oe){for(let Ie of this)za.sendMessage(Ie,oe)}onBeforeShow(oe){for(let Ie of this)Ie.isHidden||za.sendMessage(Ie,oe)}onAfterShow(oe){for(let Ie of this)Ie.isHidden||za.sendMessage(Ie,oe)}onBeforeHide(oe){for(let Ie of this)Ie.isHidden||za.sendMessage(Ie,oe)}onAfterHide(oe){for(let Ie of this)Ie.isHidden||za.sendMessage(Ie,oe)}onChildRemoved(oe){this.removeWidget(oe.child)}onFitRequest(oe){}onChildShown(oe){}onChildHidden(oe){}};(function(We){function oe(dt){return t1.horizontalAlignmentProperty.get(dt)}We.getHorizontalAlignment=oe;function Ie(dt,Jt){t1.horizontalAlignmentProperty.set(dt,Jt)}We.setHorizontalAlignment=Ie;function Oe(dt){return t1.verticalAlignmentProperty.get(dt)}We.getVerticalAlignment=Oe;function Qe(dt,Jt){t1.verticalAlignmentProperty.set(dt,Jt)}We.setVerticalAlignment=Qe})(_p||(_p={}));var dv=class{constructor(oe){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=oe,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let oe=this.widget.node.style;oe.position="",oe.top="",oe.left="",oe.width="",oe.height="",oe.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let oe=Os.sizeLimits(this.widget.node);this._minWidth=oe.minWidth,this._minHeight=oe.minHeight,this._maxWidth=oe.maxWidth,this._maxHeight=oe.maxHeight}update(oe,Ie,Oe,Qe){let dt=Math.max(this._minWidth,Math.min(Oe,this._maxWidth)),Jt=Math.max(this._minHeight,Math.min(Qe,this._maxHeight));if(dt"center",changed:oe}),We.verticalAlignmentProperty=new af({name:"verticalAlignment",create:()=>"top",changed:oe});function oe(Ie){Ie.parent&&Ie.parent.layout&&Ie.parent.update()}})(t1||(t1={}));var r1=class extends _p{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(oe){this.insertWidget(this._widgets.length,oe)}insertWidget(oe,Ie){Ie.parent=this.parent;let Oe=this._widgets.indexOf(Ie),Qe=Math.max(0,Math.min(oe,this._widgets.length));if(Oe===-1){Sa.ArrayExt.insert(this._widgets,Qe,Ie),this.parent&&this.attachWidget(Qe,Ie);return}Qe===this._widgets.length&&Qe--,Oe!==Qe&&(Sa.ArrayExt.move(this._widgets,Oe,Qe),this.parent&&this.moveWidget(Oe,Qe,Ie))}removeWidget(oe){this.removeWidgetAt(this._widgets.indexOf(oe))}removeWidgetAt(oe){let Ie=Sa.ArrayExt.removeAt(this._widgets,oe);Ie&&this.parent&&this.detachWidget(oe,Ie)}init(){super.init();let oe=0;for(let Ie of this)this.attachWidget(oe++,Ie)}attachWidget(oe,Ie){let Oe=this.parent.node.children[oe];this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.BeforeAttach),this.parent.node.insertBefore(Ie.node,Oe),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.AfterAttach)}moveWidget(oe,Ie,Oe){this.parent.isAttached&&za.sendMessage(Oe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Oe.node),this.parent.isAttached&&za.sendMessage(Oe,Ya.Msg.AfterDetach);let Qe=this.parent.node.children[Ie];this.parent.isAttached&&za.sendMessage(Oe,Ya.Msg.BeforeAttach),this.parent.node.insertBefore(Oe.node,Qe),this.parent.isAttached&&za.sendMessage(Oe,Ya.Msg.AfterAttach)}detachWidget(oe,Ie){this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Ie.node),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.AfterDetach)}},dy;(function(We){function oe(Ie){return Math.max(0,Math.floor(Ie))}We.clampDimension=oe})(dy||(dy={}));var py=dy,xp=class We extends r1{constructor(oe){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=oe.renderer,oe.orientation!==void 0&&(this._orientation=oe.orientation),oe.alignment!==void 0&&(this._alignment=oe.alignment),oe.spacing!==void 0&&(this._spacing=dy.clampDimension(oe.spacing))}dispose(){for(let oe of this._items)oe.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(oe){this._orientation!==oe&&(this._orientation=oe,this.parent&&(this.parent.dataset.orientation=oe,this.parent.fit()))}get alignment(){return this._alignment}set alignment(oe){this._alignment!==oe&&(this._alignment=oe,this.parent&&(this.parent.dataset.alignment=oe,this.parent.update()))}get spacing(){return this._spacing}set spacing(oe){oe=dy.clampDimension(oe),this._spacing!==oe&&(this._spacing=oe,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(oe=>oe.size)}relativeSizes(){return gp.normalize(this._sizers.map(oe=>oe.size))}setRelativeSizes(oe,Ie=!0){let Oe=this._sizers.length,Qe=oe.slice(0,Oe);for(;Qe.length0&&(dt.sizeHint=dt.size);ih.adjust(this._sizers,oe,Qe),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(oe,Ie){let Oe=new dv(Ie),Qe=gp.createHandle(this.renderer),dt=gp.averageSize(this._sizers),Jt=gp.createSizer(dt);Sa.ArrayExt.insert(this._items,oe,Oe),Sa.ArrayExt.insert(this._sizers,oe,Jt),Sa.ArrayExt.insert(this._handles,oe,Qe),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.BeforeAttach),this.parent.node.appendChild(Ie.node),this.parent.node.appendChild(Qe),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.AfterAttach),this.parent.fit()}moveWidget(oe,Ie,Oe){Sa.ArrayExt.move(this._items,oe,Ie),Sa.ArrayExt.move(this._sizers,oe,Ie),Sa.ArrayExt.move(this._handles,oe,Ie),this.parent.fit()}detachWidget(oe,Ie){let Oe=Sa.ArrayExt.removeAt(this._items,oe),Qe=Sa.ArrayExt.removeAt(this._handles,oe);Sa.ArrayExt.removeAt(this._sizers,oe),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Ie.node),this.parent.node.removeChild(Qe),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.AfterDetach),Oe.dispose(),this.parent.fit()}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}updateItemPosition(oe,Ie,Oe,Qe,dt,Jt,jt){let Xt=this._items[oe];if(Xt.isHidden)return;let nr=this._handles[oe].style;Ie?(Oe+=this.widgetOffset,Xt.update(Oe,Qe,jt,dt),Oe+=jt,nr.top=`${Qe}px`,nr.left=`${Oe}px`,nr.width=`${this._spacing}px`,nr.height=`${dt}px`):(Qe+=this.widgetOffset,Xt.update(Oe,Qe,Jt,jt),Qe+=jt,nr.top=`${Qe}px`,nr.left=`${Oe}px`,nr.width=`${Jt}px`,nr.height=`${this._spacing}px`)}_fit(){let oe=0,Ie=-1;for(let Xt=0,nr=this._items.length;Xt0&&(er.sizeHint=er.size),Ht.isHidden){er.minSize=0,er.maxSize=0;continue}Ht.fit(),er.stretch=We.getStretch(Ht.widget),Oe?(er.minSize=Ht.minWidth,er.maxSize=Ht.maxWidth,Qe+=Ht.minWidth,dt=Math.max(dt,Ht.minHeight)):(er.minSize=Ht.minHeight,er.maxSize=Ht.maxHeight,dt+=Ht.minHeight,Qe=Math.max(Qe,Ht.minWidth))}let Jt=this._box=Os.boxSizing(this.parent.node);Qe+=Jt.horizontalSum,dt+=Jt.verticalSum;let jt=this.parent.node.style;jt.minWidth=`${Qe}px`,jt.minHeight=`${dt}px`,this._dirty=!0,this.parent.parent&&za.sendMessage(this.parent.parent,Ya.Msg.FitRequest),this._dirty&&za.sendMessage(this.parent,Ya.Msg.UpdateRequest)}_update(oe,Ie){this._dirty=!1;let Oe=0;for(let er=0,ur=this._items.length;er0){let er;if(Ht?er=Math.max(0,Jt-this._fixed):er=Math.max(0,jt-this._fixed),this._hasNormedSizes){for(let ir of this._sizers)ir.sizeHint*=er;this._hasNormedSizes=!1}let ur=ih.calc(this._sizers,er);if(ur>0)switch(this._alignment){case"start":break;case"center":Xt=0,nr=ur/2;break;case"end":Xt=0,nr=ur;break;case"justify":Xt=ur/Oe,nr=0;break;default:throw"unreachable"}}for(let er=0,ur=this._items.length;er0,coerce:(Jt,jt)=>Math.max(0,Math.floor(jt)),changed:dt});function oe(Jt){let jt=new Wd;return jt.sizeHint=Math.floor(Jt),jt}We.createSizer=oe;function Ie(Jt){let jt=Jt.createHandle();return jt.style.position="absolute",jt.style.contain="style",jt}We.createHandle=Ie;function Oe(Jt){return Jt.reduce((jt,Xt)=>jt+Xt.size,0)/Jt.length||0}We.averageSize=Oe;function Qe(Jt){let jt=Jt.length;if(jt===0)return[];let Xt=Jt.reduce((nr,Ht)=>nr+Math.abs(Ht),0);return Xt===0?Jt.map(nr=>1/jt):Jt.map(nr=>nr/Xt)}We.normalize=Qe;function dt(Jt){Jt.parent&&Jt.parent.layout instanceof xp&&Jt.parent.fit()}})(gp||(gp={}));var XS=class extends xp{constructor(oe){super({...oe,orientation:oe.orientation||"vertical"}),this._titles=[],this.titleSpace=oe.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(oe){oe=py.clampDimension(oe),this.widgetOffset!==oe&&(this.widgetOffset=oe,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(oe,Ie){let Oe=this._titles[oe],Qe=Oe.classList.contains("lm-mod-expanded"),dt=iw.createTitle(this.renderer,Ie.title,Qe);this._titles[oe]=dt,this.parent.node.replaceChild(dt,Oe)}insertWidget(oe,Ie){Ie.id||(Ie.id=`id-${yp.UUID.uuid4()}`),super.insertWidget(oe,Ie)}attachWidget(oe,Ie){let Oe=iw.createTitle(this.renderer,Ie.title,!Ie.isHidden);Sa.ArrayExt.insert(this._titles,oe,Oe),this.parent.node.appendChild(Oe),Ie.node.setAttribute("role","region"),Ie.node.setAttribute("aria-labelledby",Oe.id),super.attachWidget(oe,Ie)}moveWidget(oe,Ie,Oe){Sa.ArrayExt.move(this._titles,oe,Ie),super.moveWidget(oe,Ie,Oe)}detachWidget(oe,Ie){let Oe=Sa.ArrayExt.removeAt(this._titles,oe);this.parent.node.removeChild(Oe),super.detachWidget(oe,Ie)}updateItemPosition(oe,Ie,Oe,Qe,dt,Jt,jt){let Xt=this._titles[oe].style;Xt.top=`${Qe}px`,Xt.left=`${Oe}px`,Xt.height=`${this.widgetOffset}px`,Ie?Xt.width=`${dt}px`:Xt.width=`${Jt}px`,super.updateItemPosition(oe,Ie,Oe,Qe,dt,Jt,jt)}},iw;(function(We){function oe(Ie,Oe,Qe=!0){let dt=Ie.createSectionTitle(Oe);return dt.style.position="absolute",dt.style.contain="strict",dt.setAttribute("aria-label",`${Oe.label} Section`),dt.setAttribute("aria-expanded",Qe?"true":"false"),dt.setAttribute("aria-controls",Oe.owner.id),Qe&&dt.classList.add("lm-mod-expanded"),dt}We.createTitle=oe})(iw||(iw={}));var aw=class extends Ya{constructor(oe={}){super(),this.addClass("lm-Panel"),this.layout=ZS.createLayout(oe)}get widgets(){return this.layout.widgets}addWidget(oe){this.layout.addWidget(oe)}insertWidget(oe,Ie){this.layout.insertWidget(oe,Ie)}},ZS;(function(We){function oe(Ie){return Ie.layout||new r1}We.createLayout=oe})(ZS||(ZS={}));var pv=class extends aw{constructor(oe={}){super({layout:KS.createLayout(oe)}),this._handleMoved=new Ls(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(oe){this.layout.orientation=oe}get alignment(){return this.layout.alignment}set alignment(oe){this.layout.alignment=oe}get spacing(){return this.layout.spacing}set spacing(oe){this.layout.spacing=oe}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(oe,Ie=!0){this.layout.setRelativeSizes(oe,Ie)}handleEvent(oe){switch(oe.type){case"pointerdown":this._evtPointerDown(oe);break;case"pointermove":this._evtPointerMove(oe);break;case"pointerup":this._evtPointerUp(oe);break;case"keydown":this._evtKeyDown(oe);break;case"contextmenu":oe.preventDefault(),oe.stopPropagation();break}}onBeforeAttach(oe){this.node.addEventListener("pointerdown",this)}onAfterDetach(oe){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(oe){oe.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(oe){oe.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(oe){this._pressData&&(oe.preventDefault(),oe.stopPropagation()),oe.keyCode===27&&this._releaseMouse()}_evtPointerDown(oe){if(oe.button!==0)return;let Ie=this.layout,Oe=Sa.ArrayExt.findFirstIndex(Ie.handles,nr=>nr.contains(oe.target));if(Oe===-1)return;oe.preventDefault(),oe.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let Qe,dt=Ie.handles[Oe],Jt=dt.getBoundingClientRect();Ie.orientation==="horizontal"?Qe=oe.clientX-Jt.left:Qe=oe.clientY-Jt.top;let jt=window.getComputedStyle(dt),Xt=nf.overrideCursor(jt.cursor);this._pressData={index:Oe,delta:Qe,override:Xt}}_evtPointerMove(oe){oe.preventDefault(),oe.stopPropagation();let Ie,Oe=this.layout,Qe=this.node.getBoundingClientRect();Oe.orientation==="horizontal"?Ie=oe.clientX-Qe.left-this._pressData.delta:Ie=oe.clientY-Qe.top-this._pressData.delta,Oe.moveHandle(this._pressData.index,Ie)}_evtPointerUp(oe){oe.button===0&&(oe.preventDefault(),oe.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}};(function(We){class oe{createHandle(){let dt=document.createElement("div");return dt.className="lm-SplitPanel-handle",dt}}We.Renderer=oe,We.defaultRenderer=new oe;function Ie(Qe){return xp.getStretch(Qe)}We.getStretch=Ie;function Oe(Qe,dt){xp.setStretch(Qe,dt)}We.setStretch=Oe})(pv||(pv={}));var KS;(function(We){function oe(Ie){return Ie.layout||new xp({renderer:Ie.renderer||pv.defaultRenderer,orientation:Ie.orientation,alignment:Ie.alignment,spacing:Ie.spacing})}We.createLayout=oe})(KS||(KS={}));var vy=class extends pv{constructor(oe={}){super({...oe,layout:JS.createLayout(oe)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new Ls(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(oe){this.layout.titleSpace=oe}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(oe){super.addWidget(oe),oe.title.changed.connect(this._onTitleChanged,this)}collapse(oe){let Ie=this.layout.widgets[oe];Ie&&!Ie.isHidden&&this._toggleExpansion(oe)}expand(oe){let Ie=this.layout.widgets[oe];Ie&&Ie.isHidden&&this._toggleExpansion(oe)}insertWidget(oe,Ie){super.insertWidget(oe,Ie),Ie.title.changed.connect(this._onTitleChanged,this)}handleEvent(oe){switch(super.handleEvent(oe),oe.type){case"click":this._evtClick(oe);break;case"keydown":this._eventKeyDown(oe);break}}onBeforeAttach(oe){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(oe)}onAfterDetach(oe){super.onAfterDetach(oe),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(oe){let Ie=Sa.ArrayExt.findFirstIndex(this.widgets,Oe=>Oe.contains(oe.owner));Ie>=0&&(this.layout.updateTitle(Ie,oe.owner),this.update())}_computeWidgetSize(oe){let Ie=this.layout,Oe=Ie.widgets[oe];if(!Oe)return;let Qe=Oe.isHidden,dt=Ie.absoluteSizes(),Jt=(Qe?-1:1)*this.spacing,jt=dt.reduce((nr,Ht)=>nr+Ht),Xt=[...dt];if(Qe){let nr=this._widgetSizesCache.get(Oe);if(!nr)return;Xt[oe]+=nr;let Ht=Xt.map(er=>er-nr>0).lastIndexOf(!0);Ht===-1?Xt.forEach((er,ur)=>{ur!==oe&&(Xt[ur]-=dt[ur]/jt*(nr-Jt))}):Xt[Ht]-=nr-Jt}else{let nr=dt[oe];this._widgetSizesCache.set(Oe,nr),Xt[oe]=0;let Ht=Xt.map(er=>er>0).lastIndexOf(!0);if(Ht===-1)return;Xt[Ht]=dt[Ht]+nr+Jt}return Xt.map(nr=>nr/(jt+Jt))}_evtClick(oe){let Ie=oe.target;if(Ie){let Oe=Sa.ArrayExt.findFirstIndex(this.titles,Qe=>Qe.contains(Ie));Oe>=0&&(oe.preventDefault(),oe.stopPropagation(),this._toggleExpansion(Oe))}}_eventKeyDown(oe){if(oe.defaultPrevented)return;let Ie=oe.target,Oe=!1;if(Ie){let Qe=Sa.ArrayExt.findFirstIndex(this.titles,dt=>dt.contains(Ie));if(Qe>=0){let dt=oe.keyCode.toString();if(oe.key.match(/Space|Enter/)||dt.match(/13|32/))Ie.click(),Oe=!0;else if(this.orientation==="horizontal"?oe.key.match(/ArrowLeft|ArrowRight/)||dt.match(/37|39/):oe.key.match(/ArrowUp|ArrowDown/)||dt.match(/38|40/)){let Jt=oe.key.match(/ArrowLeft|ArrowUp/)||dt.match(/37|38/)?-1:1,jt=this.titles.length,Xt=(Qe+jt+Jt)%jt;this.titles[Xt].focus(),Oe=!0}else oe.key==="End"||dt==="35"?(this.titles[this.titles.length-1].focus(),Oe=!0):(oe.key==="Home"||dt==="36")&&(this.titles[0].focus(),Oe=!0)}Oe&&oe.preventDefault()}}_toggleExpansion(oe){let Ie=this.titles[oe],Oe=this.layout.widgets[oe],Qe=this._computeWidgetSize(oe);Qe&&this.setRelativeSizes(Qe,!1),Oe.isHidden?(Ie.classList.add("lm-mod-expanded"),Ie.setAttribute("aria-expanded","true"),Oe.show()):(Ie.classList.remove("lm-mod-expanded"),Ie.setAttribute("aria-expanded","false"),Oe.hide()),this._expansionToggled.emit(oe)}};(function(We){class oe extends pv.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++oe._nInstance}createCollapseIcon(Oe){return document.createElement("span")}createSectionTitle(Oe){let Qe=document.createElement("h3");Qe.setAttribute("tabindex","0"),Qe.id=this.createTitleKey(Oe),Qe.className=this.titleClassName;for(let jt in Oe.dataset)Qe.dataset[jt]=Oe.dataset[jt];let dt=Qe.appendChild(this.createCollapseIcon(Oe));dt.className="lm-AccordionPanel-titleCollapser";let Jt=Qe.appendChild(document.createElement("span"));return Jt.className="lm-AccordionPanel-titleLabel",Jt.textContent=Oe.label,Jt.title=Oe.caption||Oe.label,Qe}createTitleKey(Oe){let Qe=this._titleKeys.get(Oe);return Qe===void 0&&(Qe=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(Oe,Qe)),Qe}}oe._nInstance=0,We.Renderer=oe,We.defaultRenderer=new oe})(vy||(vy={}));var JS;(function(We){function oe(Ie){return Ie.layout||new XS({renderer:Ie.renderer||vy.defaultRenderer,orientation:Ie.orientation,alignment:Ie.alignment,spacing:Ie.spacing,titleSpace:Ie.titleSpace})}We.createLayout=oe})(JS||(JS={}));var $d=class We extends r1{constructor(oe={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",oe.direction!==void 0&&(this._direction=oe.direction),oe.alignment!==void 0&&(this._alignment=oe.alignment),oe.spacing!==void 0&&(this._spacing=py.clampDimension(oe.spacing))}dispose(){for(let oe of this._items)oe.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(oe){this._direction!==oe&&(this._direction=oe,this.parent&&(this.parent.dataset.direction=oe,this.parent.fit()))}get alignment(){return this._alignment}set alignment(oe){this._alignment!==oe&&(this._alignment=oe,this.parent&&(this.parent.dataset.alignment=oe,this.parent.update()))}get spacing(){return this._spacing}set spacing(oe){oe=py.clampDimension(oe),this._spacing!==oe&&(this._spacing=oe,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(oe,Ie){Sa.ArrayExt.insert(this._items,oe,new dv(Ie)),Sa.ArrayExt.insert(this._sizers,oe,new Wd),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.BeforeAttach),this.parent.node.appendChild(Ie.node),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.AfterAttach),this.parent.fit()}moveWidget(oe,Ie,Oe){Sa.ArrayExt.move(this._items,oe,Ie),Sa.ArrayExt.move(this._sizers,oe,Ie),this.parent.update()}detachWidget(oe,Ie){let Oe=Sa.ArrayExt.removeAt(this._items,oe);Sa.ArrayExt.removeAt(this._sizers,oe),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Ie.node),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.AfterDetach),Oe.dispose(),this.parent.fit()}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}_fit(){let oe=0;for(let jt=0,Xt=this._items.length;jt0)switch(this._alignment){case"start":break;case"center":nr=0,Ht=Xt/2;break;case"end":nr=0,Ht=Xt;break;case"justify":nr=Xt/Oe,Ht=0;break;default:throw"unreachable"}for(let er=0,ur=this._items.length;er0,coerce:(Qe,dt)=>Math.max(0,Math.floor(dt)),changed:Oe}),We.sizeBasisProperty=new af({name:"sizeBasis",create:()=>0,coerce:(Qe,dt)=>Math.max(0,Math.floor(dt)),changed:Oe});function oe(Qe){return Qe==="left-to-right"||Qe==="right-to-left"}We.isHorizontal=oe;function Ie(Qe){return Math.max(0,Math.floor(Qe))}We.clampSpacing=Ie;function Oe(Qe){Qe.parent&&Qe.parent.layout instanceof $d&&Qe.parent.fit()}})(fv||(fv={}));var nw=class extends aw{constructor(oe={}){super({layout:QS.createLayout(oe)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(oe){this.layout.direction=oe}get alignment(){return this.layout.alignment}set alignment(oe){this.layout.alignment=oe}get spacing(){return this.layout.spacing}set spacing(oe){this.layout.spacing=oe}onChildAdded(oe){oe.child.addClass("lm-BoxPanel-child")}onChildRemoved(oe){oe.child.removeClass("lm-BoxPanel-child")}};(function(We){function oe(dt){return $d.getStretch(dt)}We.getStretch=oe;function Ie(dt,Jt){$d.setStretch(dt,Jt)}We.setStretch=Ie;function Oe(dt){return $d.getSizeBasis(dt)}We.getSizeBasis=Oe;function Qe(dt,Jt){$d.setSizeBasis(dt,Jt)}We.setSizeBasis=Qe})(nw||(nw={}));var QS;(function(We){function oe(Ie){return Ie.layout||new $d(Ie)}We.createLayout=oe})(QS||(QS={}));var ow=class We extends Ya{constructor(oe){super({node:mp.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(Ya.Flag.DisallowLayout),this.commands=oe.commands,this.renderer=oe.renderer||We.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(oe){let Ie=mp.createItem(this.commands,oe);return this._items.push(Ie),this.refresh(),Ie}addItems(oe){let Ie=oe.map(Oe=>mp.createItem(this.commands,Oe));return Ie.forEach(Oe=>this._items.push(Oe)),this.refresh(),Ie}removeItem(oe){this.removeItemAt(this._items.indexOf(oe))}removeItemAt(oe){Sa.ArrayExt.removeAt(this._items,oe)&&this.refresh()}clearItems(){this._items.length!==0&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,this.inputNode.value!==""){let oe=this.node.getElementsByClassName("lm-close-icon")[0];oe.style.display="inherit"}else{let oe=this.node.getElementsByClassName("lm-close-icon")[0];oe.style.display="none"}this.update()}handleEvent(oe){switch(oe.type){case"click":this._evtClick(oe);break;case"keydown":this._evtKeyDown(oe);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}onBeforeAttach(oe){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(oe){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(oe){this.update(),super.onAfterShow(oe)}onActivateRequest(oe){if(this.isAttached){let Ie=this.inputNode;Ie.focus(),Ie.select()}}onUpdateRequest(oe){if(!this.isVisible){Hd.render(null,this.contentNode);return}let Ie=this.inputNode.value,Oe=this.contentNode,Qe=this._results;if(Qe||(Qe=this._results=mp.search(this._items,Ie),this._activeIndex=Ie?Sa.ArrayExt.findFirstIndex(Qe,mp.canActivate):-1),!Ie&&Qe.length===0){Hd.render(null,Oe);return}if(Ie&&Qe.length===0){let Xt=this.renderer.renderEmptyMessage({query:Ie});Hd.render(Xt,Oe);return}let dt=this.renderer,Jt=this._activeIndex,jt=new Array(Qe.length);for(let Xt=0,nr=Qe.length;Xt=Qe.length)Oe.scrollTop=0;else{let Xt=Oe.children[Jt];Os.scrollIntoViewIfNeeded(Oe,Xt)}}_evtClick(oe){if(oe.button!==0)return;if(oe.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let Ie=Sa.ArrayExt.findFirstIndex(this.contentNode.children,Oe=>Oe.contains(oe.target));Ie!==-1&&(oe.preventDefault(),oe.stopPropagation(),this._execute(Ie))}_evtKeyDown(oe){if(!(oe.altKey||oe.ctrlKey||oe.metaKey||oe.shiftKey))switch(oe.keyCode){case 13:oe.preventDefault(),oe.stopPropagation(),this._execute(this._activeIndex);break;case 38:oe.preventDefault(),oe.stopPropagation(),this._activatePreviousItem();break;case 40:oe.preventDefault(),oe.stopPropagation(),this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0)return;let oe=this._activeIndex,Ie=this._results.length,Oe=oeKi-Ia),ti=de.slice(0,Vr),Xr=de.slice(Vr);for(let Ki=0,Ia=Xr.length;Kiar.command===ir&&yp.JSONExt.deepEqual(ar.args,Ot))||null}}})(mp||(mp={}));var hv=class We extends Ya{constructor(oe){super({node:of.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new Ls(this),this._menuRequested=new Ls(this),this.addClass("lm-Menu"),this.setFlag(Ya.Flag.DisallowLayout),this.commands=oe.commands,this.renderer=oe.renderer||We.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let oe=this;for(;oe._parentMenu;)oe=oe._parentMenu;return oe}get leafMenu(){let oe=this;for(;oe._childMenu;)oe=oe._childMenu;return oe}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(oe){this.activeIndex=oe?this._items.indexOf(oe):-1}get activeIndex(){return this._activeIndex}set activeIndex(oe){(oe<0||oe>=this._items.length)&&(oe=-1),oe!==-1&&!of.canActivate(this._items[oe])&&(oe=-1),this._activeIndex!==oe&&(this._activeIndex=oe,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let oe=this._items.length,Ie=this._activeIndex,Oe=Ie{this.activeIndex=jt}})}Hd.render(Jt,this.contentNode)}onCloseRequest(oe){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let Ie=this._childMenu;Ie&&(this._childIndex=-1,this._childMenu=null,Ie._parentMenu=null,Ie.close());let Oe=this._parentMenu;Oe&&(this._parentMenu=null,Oe._childIndex=-1,Oe._childMenu=null,Oe.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(oe)}_evtKeyDown(oe){oe.preventDefault(),oe.stopPropagation();let Ie=oe.keyCode;if(Ie===13){this.triggerActiveItem();return}if(Ie===27){this.close();return}if(Ie===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(Ie===38){this.activatePreviousItem();return}if(Ie===39){let Jt=this.activeItem;Jt&&Jt.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(Ie===40){this.activateNextItem();return}let Oe=Jm().keyForKeydownEvent(oe);if(!Oe)return;let Qe=this._activeIndex+1,dt=of.findMnemonic(this._items,Oe,Qe);dt.index!==-1&&!dt.multiple?(this.activeIndex=dt.index,this.triggerActiveItem()):dt.index!==-1?this.activeIndex=dt.index:dt.auto!==-1&&(this.activeIndex=dt.auto)}_evtPointerUp(oe){oe.button===0&&(oe.preventDefault(),oe.stopPropagation(),this.triggerActiveItem())}_evtPointerMove(oe){let Ie=Sa.ArrayExt.findFirstIndex(this.contentNode.children,Qe=>Os.hitTest(Qe,oe.clientX,oe.clientY));if(Ie===this._activeIndex)return;if(this.activeIndex=Ie,Ie=this.activeIndex,Ie===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();let Oe=this.activeItem;!Oe||Oe.type!=="submenu"||!Oe.submenu||this._startOpenTimer()}_evtPointerEnter(oe){for(let Ie=this._parentMenu;Ie;Ie=Ie._parentMenu)Ie._cancelOpenTimer(),Ie._cancelCloseTimer(),Ie.activeIndex=Ie._childIndex}_evtPointerLeave(oe){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:Ie,clientY:Oe}=oe;if(Os.hitTest(this._childMenu.node,Ie,Oe)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtPointerDown(oe){this._parentMenu||(of.hitTestMenus(this,oe.clientX,oe.clientY)?(oe.preventDefault(),oe.stopPropagation()):this.close())}_openChildMenu(oe=!1){let Ie=this.activeItem;if(!Ie||Ie.type!=="submenu"||!Ie.submenu){this._closeChildMenu();return}let Oe=Ie.submenu;if(Oe===this._childMenu)return;We.saveWindowData(),this._closeChildMenu(),this._childMenu=Oe,this._childIndex=this._activeIndex,Oe._parentMenu=this,za.sendMessage(this,Ya.Msg.UpdateRequest);let Qe=this.contentNode.children[this._activeIndex];of.openSubmenu(Oe,Qe),oe&&(Oe.activeIndex=-1,Oe.activateNextItem()),Oe.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){this._openTimerID===0&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},of.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},of.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){of.saveWindowData()}};(function(We){class oe{renderItem(Oe){let Qe=this.createItemClass(Oe),dt=this.createItemDataset(Oe),Jt=this.createItemARIA(Oe);return Fs.li({className:Qe,dataset:dt,tabindex:"0",onfocus:Oe.onfocus,...Jt},this.renderIcon(Oe),this.renderLabel(Oe),this.renderShortcut(Oe),this.renderSubmenu(Oe))}renderIcon(Oe){let Qe=this.createIconClass(Oe);return Fs.div({className:Qe},Oe.item.icon,Oe.item.iconLabel)}renderLabel(Oe){let Qe=this.formatLabel(Oe);return Fs.div({className:"lm-Menu-itemLabel"},Qe)}renderShortcut(Oe){let Qe=this.formatShortcut(Oe);return Fs.div({className:"lm-Menu-itemShortcut"},Qe)}renderSubmenu(Oe){return Fs.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(Oe){let Qe="lm-Menu-item";Oe.item.isEnabled||(Qe+=" lm-mod-disabled"),Oe.item.isToggled&&(Qe+=" lm-mod-toggled"),Oe.item.isVisible||(Qe+=" lm-mod-hidden"),Oe.active&&(Qe+=" lm-mod-active"),Oe.collapsed&&(Qe+=" lm-mod-collapsed");let dt=Oe.item.className;return dt&&(Qe+=` ${dt}`),Qe}createItemDataset(Oe){let Qe,{type:dt,command:Jt,dataset:jt}=Oe.item;return dt==="command"?Qe={...jt,type:dt,command:Jt}:Qe={...jt,type:dt},Qe}createIconClass(Oe){let Qe="lm-Menu-itemIcon",dt=Oe.item.iconClass;return dt?`${Qe} ${dt}`:Qe}createItemARIA(Oe){let Qe={};switch(Oe.item.type){case"separator":Qe.role="presentation";break;case"submenu":Qe["aria-haspopup"]="true",Oe.item.isEnabled||(Qe["aria-disabled"]="true");break;default:Oe.item.isEnabled||(Qe["aria-disabled"]="true"),Oe.item.isToggled?(Qe.role="menuitemcheckbox",Qe["aria-checked"]="true"):Qe.role="menuitem"}return Qe}formatLabel(Oe){let{label:Qe,mnemonic:dt}=Oe.item;if(dt<0||dt>=Qe.length)return Qe;let Jt=Qe.slice(0,dt),jt=Qe.slice(dt+1),Xt=Qe[dt],nr=Fs.span({className:"lm-Menu-itemMnemonic"},Xt);return[Jt,nr,jt]}formatShortcut(Oe){let Qe=Oe.item.keyBinding;return Qe?vp.formatKeystroke(Qe.keys):null}}We.Renderer=oe,We.defaultRenderer=new oe})(hv||(hv={}));var of;(function(We){We.TIMER_DELAY=300,We.SUBMENU_OVERLAP=3;let oe=null,Ie=0;function Oe(){return Ie>0?(Ie--,oe):Ht()}function Qe(){oe=Ht(),Ie++}We.saveWindowData=Qe;function dt(){let ar=document.createElement("div"),Lr=document.createElement("ul");return Lr.className="lm-Menu-content",ar.appendChild(Lr),Lr.setAttribute("role","menu"),ar.tabIndex=0,ar}We.createNode=dt;function Jt(ar){return ar.type!=="separator"&&ar.isEnabled&&ar.isVisible}We.canActivate=Jt;function jt(ar,Lr){return new Ot(ar.commands,Lr)}We.createItem=jt;function Xt(ar,Lr,Ir){for(let de=ar;de;de=de.childMenu)if(Os.hitTest(de.node,Lr,Ir))return!0;return!1}We.hitTestMenus=Xt;function nr(ar){let Lr=new Array(ar.length);Sa.ArrayExt.fill(Lr,!1);let Ir=0,de=ar.length;for(;Ir=0;--Mr){let Vr=ar[Mr];if(Vr.isVisible){if(Vr.type!=="separator")break;Lr[Mr]=!0}}let qr=!1;for(;++IrKi+_i&&(Lr=Ki+_i-rs),!Mr&&Ir+Oo>Ia+ia&&(Ir>Ia+ia?Ir=Ia+ia-Oo:Ir=Ir-Oo),eo.transform=`translate(${Math.max(0,Lr)}px, ${Math.max(0,Ir)}px`,eo.opacity="1"}We.openRootMenu=er;function ur(ar,Lr){let Ir=Oe(),de=Ir.pageXOffset,Mr=Ir.pageYOffset,qr=Ir.clientWidth,Vr=Ir.clientHeight;za.sendMessage(ar,Ya.Msg.UpdateRequest);let ti=Vr,Xr=ar.node,Ki=Xr.style;Ki.opacity="0",Ki.maxHeight=`${ti}px`,Ya.attach(ar,document.body);let{width:Ia,height:_i}=Xr.getBoundingClientRect(),ia=Os.boxSizing(ar.node),Yr=Lr.getBoundingClientRect(),Ba=Yr.right-We.SUBMENU_OVERLAP;Ba+Ia>de+qr&&(Ba=Yr.left+We.SUBMENU_OVERLAP-Ia);let eo=Yr.top-ia.borderTop-ia.paddingTop;eo+_i>Mr+Vr&&(eo=Yr.bottom+ia.borderBottom+ia.paddingBottom-_i),Ki.transform=`translate(${Math.max(0,Ba)}px, ${Math.max(0,eo)}px`,Ki.opacity="1"}We.openSubmenu=ur;function ir(ar,Lr,Ir){let de=-1,Mr=-1,qr=!1,Vr=Lr.toUpperCase();for(let ti=0,Xr=ar.length;ti=0&&ia<_i.length){_i[ia].toUpperCase()===Vr&&(de===-1?de=Ki:qr=!0);continue}Mr===-1&&_i[0].toUpperCase()===Vr&&(Mr=Ki)}return{index:de,multiple:qr,auto:Mr}}We.findMnemonic=ir;class Ot{constructor(Lr,Ir){this._commands=Lr,this.type=Ir.type||"command",this.command=Ir.command||"",this.args=Ir.args||yp.JSONExt.emptyObject,this.submenu=Ir.submenu||null}get label(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""}get mnemonic(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1}get icon(){if(this.type==="command")return this._commands.icon(this.command,this.args);if(this.type==="submenu"&&this.submenu)return this.submenu.title.icon}get iconClass(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""}get iconLabel(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""}get caption(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""}get className(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""}get dataset(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}}get isEnabled(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0}get isToggled(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1}get isVisible(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0}get keyBinding(){if(this.type==="command"){let{command:Lr,args:Ir}=this;return Sa.ArrayExt.findLastValue(this._commands.keyBindings,de=>de.command===Lr&&yp.JSONExt.deepEqual(de.args,Ir))||null}return null}}})(of||(of={}));var Mj;(function(We){function oe(Jt,jt){let Xt=Oe(Jt.selector),nr=Jt.rank!==void 0?Jt.rank:1/0;return{...Jt,selector:Xt,rank:nr,id:jt}}We.createItem=oe;function Ie(Jt,jt,Xt,nr){let Ht=jt.target;if(!Ht)return null;let er=jt.currentTarget;if(!er||!er.contains(Ht)&&(Ht=document.elementFromPoint(jt.clientX,jt.clientY),!Ht||!er.contains(Ht)))return null;let ur=[],ir=Jt.slice();for(;Ht!==null;){let Ot=[];for(let ar=0,Lr=ir.length;ar=this._titles.length)&&(oe=-1),this._currentIndex===oe)return;let Ie=this._currentIndex,Oe=this._titles[Ie]||null,Qe=oe,dt=this._titles[Qe]||null;this._currentIndex=Qe,this._previousTitle=Oe,this.update(),this._currentChanged.emit({previousIndex:Ie,previousTitle:Oe,currentIndex:Qe,currentTitle:dt})}get name(){return this._name}set name(oe){this._name=oe,oe?this.contentNode.setAttribute("aria-label",oe):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(oe){this._orientation!==oe&&(this._releaseMouse(),this._orientation=oe,this.dataset.orientation=oe,this.contentNode.setAttribute("aria-orientation",oe))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(oe){this._addButtonEnabled!==oe&&(this._addButtonEnabled=oe,oe?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(oe){return this.insertTab(this._titles.length,oe)}insertTab(oe,Ie){this._releaseMouse();let Oe=zh.asTitle(Ie),Qe=this._titles.indexOf(Oe),dt=Math.max(0,Math.min(oe,this._titles.length));return Qe===-1?(Sa.ArrayExt.insert(this._titles,dt,Oe),Oe.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(dt,Oe),Oe):(dt===this._titles.length&&dt--,Qe===dt||(Sa.ArrayExt.move(this._titles,Qe,dt),this.update(),this._adjustCurrentForMove(Qe,dt)),Oe)}removeTab(oe){this.removeTabAt(this._titles.indexOf(oe))}removeTabAt(oe){let Ie=oe>=0&&oe-1?this._currentIndex:0;for(let Xt=0,nr=Oe.length;XtOs.hitTest(Jt,oe.clientX,oe.clientY));if(Oe===-1)return;let Qe=this.titles[Oe],dt=Ie[Oe].querySelector(".lm-TabBar-tabLabel");if(dt&&dt.contains(oe.target)){let Jt=Qe.label||"",jt=dt.innerHTML;dt.innerHTML="";let Xt=document.createElement("input");Xt.classList.add("lm-TabBar-tabInput"),Xt.value=Jt,dt.appendChild(Xt);let nr=()=>{Xt.removeEventListener("blur",nr),dt.innerHTML=jt,this.node.addEventListener("keydown",this)};Xt.addEventListener("dblclick",Ht=>Ht.stopPropagation()),Xt.addEventListener("blur",nr),Xt.addEventListener("keydown",Ht=>{Ht.key==="Enter"?(Xt.value!==""&&(Qe.label=Qe.caption=Xt.value),nr()):Ht.key==="Escape"&&nr()}),this.node.removeEventListener("keydown",this),Xt.select(),Xt.focus(),dt.children.length>0&&dt.children[0].focus()}}_evtKeyDownCapturing(oe){oe.eventPhase===Event.CAPTURING_PHASE&&(oe.preventDefault(),oe.stopPropagation(),oe.key==="Escape"&&this._releaseMouse())}_evtKeyDown(oe){var Ie,Oe,Qe;if(!(oe.key==="Tab"||oe.eventPhase===Event.CAPTURING_PHASE)){if(oe.key==="Enter"||oe.key==="Spacebar"||oe.key===" "){let dt=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(dt))oe.preventDefault(),oe.stopPropagation(),this._addRequested.emit();else{let Jt=Sa.ArrayExt.findFirstIndex(this.contentNode.children,jt=>jt.contains(dt));Jt>=0&&(oe.preventDefault(),oe.stopPropagation(),this.currentIndex=Jt)}}else if(Oce.includes(oe.key)){let dt=[...this.contentNode.children];if(this.addButtonEnabled&&dt.push(this.addButtonNode),dt.length<=1)return;oe.preventDefault(),oe.stopPropagation();let Jt=dt.indexOf(document.activeElement);Jt===-1&&(Jt=this._currentIndex);let jt;oe.key==="ArrowRight"&&this._orientation==="horizontal"||oe.key==="ArrowDown"&&this._orientation==="vertical"?jt=(Ie=dt[Jt+1])!==null&&Ie!==void 0?Ie:dt[0]:oe.key==="ArrowLeft"&&this._orientation==="horizontal"||oe.key==="ArrowUp"&&this._orientation==="vertical"?jt=(Oe=dt[Jt-1])!==null&&Oe!==void 0?Oe:dt[dt.length-1]:oe.key==="Home"?jt=dt[0]:oe.key==="End"&&(jt=dt[dt.length-1]),jt&&((Qe=dt[Jt])===null||Qe===void 0||Qe.setAttribute("tabindex","-1"),jt?.setAttribute("tabindex","0"),jt.focus())}}}_evtPointerDown(oe){if(oe.button!==0&&oe.button!==1||this._dragData||oe.target.classList.contains("lm-TabBar-tabInput"))return;let Ie=this.addButtonEnabled&&this.addButtonNode.contains(oe.target),Oe=this.contentNode.children,Qe=Sa.ArrayExt.findFirstIndex(Oe,Jt=>Os.hitTest(Jt,oe.clientX,oe.clientY));if(Qe===-1&&!Ie||(oe.preventDefault(),oe.stopPropagation(),this._dragData={tab:Oe[Qe],index:Qe,pressX:oe.clientX,pressY:oe.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),oe.button===1||Ie))return;let dt=Oe[Qe].querySelector(this.renderer.closeIconSelector);dt&&dt.contains(oe.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===Qe?this.currentIndex=-1:this.currentIndex=Qe,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(oe){let Ie=this._dragData;if(!Ie)return;oe.preventDefault(),oe.stopPropagation();let Oe=this.contentNode.children;if(!(!Ie.dragActive&&!zh.dragExceeded(Ie,oe))){if(!Ie.dragActive){let Qe=Ie.tab.getBoundingClientRect();this._orientation==="horizontal"?(Ie.tabPos=Ie.tab.offsetLeft,Ie.tabSize=Qe.width,Ie.tabPressPos=Ie.pressX-Qe.left):(Ie.tabPos=Ie.tab.offsetTop,Ie.tabSize=Qe.height,Ie.tabPressPos=Ie.pressY-Qe.top),Ie.tabPressOffset={x:Ie.pressX-Qe.left,y:Ie.pressY-Qe.top},Ie.tabLayout=zh.snapTabLayout(Oe,this._orientation),Ie.contentRect=this.contentNode.getBoundingClientRect(),Ie.override=nf.overrideCursor("default"),Ie.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),Ie.dragActive=!0}if(!Ie.detachRequested&&zh.detachExceeded(Ie,oe)){Ie.detachRequested=!0;let Qe=Ie.index,dt=oe.clientX,Jt=oe.clientY,jt=Oe[Qe],Xt=this._titles[Qe];if(this._tabDetachRequested.emit({index:Qe,title:Xt,tab:jt,clientX:dt,clientY:Jt,offset:Ie.tabPressOffset}),Ie.dragAborted)return}zh.layoutTabs(Oe,Ie,oe,this._orientation)}}_evtPointerUp(oe){if(oe.button!==0&&oe.button!==1)return;let Ie=this._dragData;if(!Ie)return;if(oe.preventDefault(),oe.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!Ie.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(oe.target)){this._addRequested.emit(void 0);return}let dt=this.contentNode.children,Jt=Sa.ArrayExt.findFirstIndex(dt,nr=>Os.hitTest(nr,oe.clientX,oe.clientY));if(Jt!==Ie.index)return;let jt=this._titles[Jt];if(!jt.closable)return;if(oe.button===1){this._tabCloseRequested.emit({index:Jt,title:jt});return}let Xt=dt[Jt].querySelector(this.renderer.closeIconSelector);if(Xt&&Xt.contains(oe.target)){this._tabSizeFrozen=!0,this._tabCloseRequested.emit({index:Jt,title:jt});return}return}if(oe.button!==0)return;zh.finalizeTabPosition(Ie,this._orientation),Ie.tab.classList.remove("lm-mod-dragging");let Oe=zh.parseTransitionDuration(Ie.tab);setTimeout(()=>{if(Ie.dragAborted)return;this._dragData=null,zh.resetTabPositions(this.contentNode.children,this._orientation),Ie.override.dispose(),this.removeClass("lm-mod-dragging");let Qe=Ie.index,dt=Ie.targetIndex;dt===-1||Qe===dt||(Sa.ArrayExt.move(this._titles,Qe,dt),this._adjustCurrentForMove(Qe,dt),this._tabMoved.emit({fromIndex:Qe,toIndex:dt,title:this._titles[dt]}),za.sendMessage(this,Ya.Msg.UpdateRequest))},Oe)}_releaseMouse(){let oe=this._dragData;oe&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),oe.dragAborted=!0,oe.dragActive&&(zh.resetTabPositions(this.contentNode.children,this._orientation),oe.override.dispose(),oe.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(oe,Ie){let Oe=this.currentTitle,Qe=this._currentIndex,dt=this.insertBehavior;if(dt==="select-tab"||dt==="select-tab-if-needed"&&Qe===-1){this._currentIndex=oe,this._previousTitle=Oe,this._currentChanged.emit({previousIndex:Qe,previousTitle:Oe,currentIndex:oe,currentTitle:Ie});return}Qe>=oe&&this._currentIndex++}_adjustCurrentForMove(oe,Ie){this._currentIndex===oe?this._currentIndex=Ie:this._currentIndex=Ie?this._currentIndex++:this._currentIndex>oe&&this._currentIndex<=Ie&&this._currentIndex--}_adjustCurrentForRemove(oe,Ie){let Oe=this._currentIndex,Qe=this.removeBehavior;if(Oe!==oe){Oe>oe&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:oe,previousTitle:Ie,currentIndex:-1,currentTitle:null});return}if(Qe==="select-tab-after"){this._currentIndex=Math.min(oe,this._titles.length-1),this._currentChanged.emit({previousIndex:oe,previousTitle:Ie,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(Qe==="select-tab-before"){this._currentIndex=Math.max(0,oe-1),this._currentChanged.emit({previousIndex:oe,previousTitle:Ie,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(Qe==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(oe,this._titles.length-1),this._currentChanged.emit({previousIndex:oe,previousTitle:Ie,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:oe,previousTitle:Ie,currentIndex:-1,currentTitle:null})}_onTitleChanged(oe){this.update()}_evtPointerLeave(oe){if(!this._tabSizeFrozen)return;this._tabSizeFrozen=!1,this._frozenTabWidths=null,this._unfreezeRunID++;let Ie=this._unfreezeRunID;this._clearUnfreezeTransitionState(),this.addClass("lm-mod-unfreezing");let Oe=this.contentNode.children;for(let Qe=0,dt=Oe.length;Qe{let Jt=dt.propertyName;(Jt==="width"||Jt==="flex-basis")&&this._finalizeUnfreezeRun(Ie)};this._unfreezeTransitionListener=Qe,this.node.addEventListener("transitionend",Qe),this.node.addEventListener("transitioncancel",Qe),this._unfreezeFallbackTimerID=window.setTimeout(()=>{this._finalizeUnfreezeRun(Ie)},2e3)}this.update()}_setFrozenTabSize(oe,Ie){let Oe=`${Ie}px`;oe.style.width=Oe,oe.style.flexBasis=Oe}_finalizeUnfreezeRun(oe){oe===this._unfreezeRunID&&(this._clearUnfreezeTransitionState(),this.removeClass("lm-mod-unfreezing"))}_clearUnfreezeTransitionState(){this._unfreezeTransitionListener&&(this.node.removeEventListener("transitionend",this._unfreezeTransitionListener),this.node.removeEventListener("transitioncancel",this._unfreezeTransitionListener),this._unfreezeTransitionListener=null),this._unfreezeFallbackTimerID!==0&&(clearTimeout(this._unfreezeFallbackTimerID),this._unfreezeFallbackTimerID=0)}_clearTabSizeFreezeState(){this._tabSizeFrozen=!1,this._frozenTabWidths=null,this.removeClass("lm-mod-unfreezing");let oe=this.contentNode.children;for(let Ie=0,Oe=oe.length;Ie=We.DRAG_THRESHOLD||ir>=We.DRAG_THRESHOLD}We.dragExceeded=dt;function Jt(Ht,er){let ur=Ht.contentRect;return er.clientX=ur.right+We.DETACH_THRESHOLD||er.clientY=ur.bottom+We.DETACH_THRESHOLD}We.detachExceeded=Jt;function jt(Ht,er,ur,ir){let Ot,ar,Lr,Ir;ir==="horizontal"?(Ot=er.pressX,ar=ur.clientX-er.contentRect.left,Lr=ur.clientX,Ir=er.contentRect.width):(Ot=er.pressY,ar=ur.clientY-er.contentRect.top,Lr=ur.clientY,Ir=er.contentRect.height);let de=er.index,Mr=ar-er.tabPressPos,qr=Mr+er.tabSize;for(let Vr=0,ti=Ht.length;Vr>1);if(Vrer.index&&qr>Ia)Xr=`${-er.tabSize-Ki.margin}px`,de=Math.max(de,Vr);else if(Vr===er.index){let _i=Lr-Ot,ia=Ir-(er.tabPos+er.tabSize);Xr=`${Math.max(-er.tabPos,Math.min(_i,ia))}px`}else Xr="";ir==="horizontal"?Ht[Vr].style.left=Xr:Ht[Vr].style.top=Xr}er.targetIndex=de}We.layoutTabs=jt;function Xt(Ht,er){let ur;er==="horizontal"?ur=Ht.contentRect.width:ur=Ht.contentRect.height;let ir;if(Ht.targetIndex===Ht.index)ir=0;else if(Ht.targetIndex>Ht.index){let Lr=Ht.tabLayout[Ht.targetIndex];ir=Lr.pos+Lr.size-Ht.tabSize-Ht.tabPos}else ir=Ht.tabLayout[Ht.targetIndex].pos-Ht.tabPos;let Ot=ur-(Ht.tabPos+Ht.tabSize),ar=Math.max(-Ht.tabPos,Math.min(ir,Ot));er==="horizontal"?Ht.tab.style.left=`${ar}px`:Ht.tab.style.top=`${ar}px`}We.finalizeTabPosition=Xt;function nr(Ht,er){for(let ur of Ht)er==="horizontal"?ur.style.left="":ur.style.top=""}We.resetTabPositions=nr})(zh||(zh={}));var eE=class extends _p{constructor(oe){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=oe.renderer,oe.spacing!==void 0&&(this._spacing=py.clampDimension(oe.spacing)),this._document=oe.document||document,this._hiddenMode=oe.hiddenMode!==void 0?oe.hiddenMode:Ya.HiddenMode.Display}dispose(){let oe=this[Symbol.iterator]();this._items.forEach(Ie=>{Ie.dispose()}),this._box=null,this._root=null,this._items.clear();for(let Ie of oe)Ie.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(oe){if(this._hiddenMode!==oe){this._hiddenMode=oe;for(let Ie of this.tabBars())if(Ie.titles.length>1)for(let Oe of Ie.titles)Oe.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(oe){oe=py.clampDimension(oe),this._spacing!==oe&&(this._spacing=oe,this.parent&&this.parent.fit())}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,Sa.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,Sa.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,Sa.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,Sa.empty)()}handles(){return this._root?this._root.iterHandles():(0,Sa.empty)()}moveHandle(oe,Ie,Oe){let Qe=oe.classList.contains("lm-mod-hidden");if(!this._root||Qe)return;let dt=this._root.findSplitNode(oe);if(!dt)return;let Jt;dt.node.orientation==="horizontal"?Jt=Ie-oe.offsetLeft:Jt=Oe-oe.offsetTop,Jt!==0&&(dt.node.holdSizes(),ih.adjust(dt.node.sizers,dt.index,Jt),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(oe){let Ie=new Set,Oe;oe.main?Oe=Xl.normalizeAreaConfig(oe.main,Ie):Oe=null;let Qe=this.widgets(),dt=this.tabBars(),Jt=this.handles();this._root=null;for(let jt of Qe)Ie.has(jt)||(jt.parent=null);for(let jt of dt)jt.dispose();for(let jt of Jt)jt.parentNode&&jt.parentNode.removeChild(jt);for(let jt of Ie)jt.parent=this.parent;Oe?this._root=Xl.realizeAreaConfig(Oe,{createTabBar:jt=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(Ie.forEach(jt=>{this.attachWidget(jt)}),this.parent.fit())}addWidget(oe,Ie={}){let Oe=Ie.ref||null,Qe=Ie.mode||"tab-after",dt=null;if(this._root&&Oe&&(dt=this._root.findTabNode(Oe)),Oe&&!dt)throw new Error("Reference widget is not in the layout.");switch(oe.parent=this.parent,Qe){case"tab-after":this._insertTab(oe,Oe,dt,!0);break;case"tab-before":this._insertTab(oe,Oe,dt,!1);break;case"split-top":this._insertSplit(oe,Oe,dt,"vertical",!1);break;case"split-left":this._insertSplit(oe,Oe,dt,"horizontal",!1);break;case"split-right":this._insertSplit(oe,Oe,dt,"horizontal",!0);break;case"split-bottom":this._insertSplit(oe,Oe,dt,"vertical",!0);break;case"merge-top":this._insertSplit(oe,Oe,dt,"vertical",!1,!0);break;case"merge-left":this._insertSplit(oe,Oe,dt,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(oe,Oe,dt,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(oe,Oe,dt,"vertical",!0,!0);break}this.parent&&(this.attachWidget(oe),this.parent.fit())}removeWidget(oe){this._removeWidget(oe),this.parent&&(this.detachWidget(oe),this.parent.fit())}hitTestTabAreas(oe,Ie){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=Os.boxSizing(this.parent.node));let Oe=this.parent.node.getBoundingClientRect(),Qe=oe-Oe.left-this._box.borderLeft,dt=Ie-Oe.top-this._box.borderTop,Jt=this._root.hitTestTabNodes(Qe,dt);if(!Jt)return null;let{tabBar:jt,top:Xt,left:nr,width:Ht,height:er}=Jt,ur=this._box.borderLeft+this._box.borderRight,ir=this._box.borderTop+this._box.borderBottom,Ot=Oe.width-ur-(nr+Ht),ar=Oe.height-ir-(Xt+er);return{tabBar:jt,x:Qe,y:dt,top:Xt,left:nr,right:Ot,bottom:ar,width:Ht,height:er}}init(){super.init();for(let oe of this)this.attachWidget(oe);for(let oe of this.handles())this.parent.node.appendChild(oe);this.parent.fit()}attachWidget(oe){this.parent.node!==oe.node.parentNode&&(this._items.set(oe,new dv(oe)),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.BeforeAttach),this.parent.node.appendChild(oe.node),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.AfterAttach))}detachWidget(oe){if(this.parent.node!==oe.node.parentNode)return;this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(oe.node),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.AfterDetach);let Ie=this._items.get(oe);Ie&&(this._items.delete(oe),Ie.dispose())}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}_removeWidget(oe){if(!this._root)return;let Ie=this._root.findTabNode(oe);if(!Ie)return;if(Xl.removeAria(oe),Ie.tabBar.titles.length>1){if(Ie.tabBar.removeTab(oe.title),this._hiddenMode===Ya.HiddenMode.Scale&&Ie.tabBar.titles.length==1){let ur=Ie.tabBar.titles[0].owner;ur.hiddenMode=Ya.HiddenMode.Display}return}if(Ie.tabBar.dispose(),this._root===Ie){this._root=null;return}this._root.holdAllSizes();let Oe=Ie.parent;Ie.parent=null;let Qe=Sa.ArrayExt.removeFirstOf(Oe.children,Ie),dt=Sa.ArrayExt.removeAt(Oe.handles,Qe);if(Sa.ArrayExt.removeAt(Oe.sizers,Qe),dt.parentNode&&dt.parentNode.removeChild(dt),Oe.children.length>1){Oe.syncHandles();return}let Jt=Oe.parent;Oe.parent=null;let jt=Oe.children[0],Xt=Oe.handles[0];if(Oe.children.length=0,Oe.handles.length=0,Oe.sizers.length=0,Xt.parentNode&&Xt.parentNode.removeChild(Xt),this._root===Oe){jt.parent=null,this._root=jt;return}let nr=Jt,Ht=nr.children.indexOf(Oe);if(jt instanceof Xl.TabLayoutNode){jt.parent=nr,nr.children[Ht]=jt;return}let er=Sa.ArrayExt.removeAt(nr.handles,Ht);Sa.ArrayExt.removeAt(nr.children,Ht),Sa.ArrayExt.removeAt(nr.sizers,Ht),er.parentNode&&er.parentNode.removeChild(er);for(let ur=0,ir=jt.children.length;ur=this._left+this._width||Ot=this._top+this._height?null:this}createConfig(){let ir=this.tabBar.titles.map(ar=>ar.owner),Ot=this.tabBar.currentIndex;return{type:"tab-area",widgets:ir,currentIndex:Ot}}holdAllSizes(){}fit(ir,Ot){let ar=0,Lr=0,Ir=1/0,de=1/0,Mr=Ot.get(this.tabBar),qr=this.tabBar.currentTitle,Vr=qr?Ot.get(qr.owner):void 0,[ti,Xr]=this.sizers;return Mr&&Mr.fit(),Vr&&Vr.fit(),Mr&&!Mr.isHidden?(ar=Math.max(ar,Mr.minWidth),Lr+=Mr.minHeight,ti.minSize=Mr.minHeight,ti.maxSize=Mr.maxHeight):(ti.minSize=0,ti.maxSize=0),Vr&&!Vr.isHidden?(ar=Math.max(ar,Vr.minWidth),Lr+=Vr.minHeight,Xr.minSize=Vr.minHeight,Xr.maxSize=1/0):(Xr.minSize=0,Xr.maxSize=1/0),{minWidth:ar,minHeight:Lr,maxWidth:Ir,maxHeight:de}}update(ir,Ot,ar,Lr,Ir,de){this._top=Ot,this._left=ir,this._width=ar,this._height=Lr;let Mr=de.get(this.tabBar),qr=this.tabBar.currentTitle,Vr=qr?de.get(qr.owner):void 0;if(ih.calc(this.sizers,Lr),Mr&&!Mr.isHidden){let ti=this.sizers[0].size;Mr.update(ir,Ot,ar,ti),Ot+=ti}if(Vr&&!Vr.isHidden){let ti=this.sizers[1].size;Vr.update(ir,Ot,ar,ti)}}}We.TabLayoutNode=Qe;class dt{constructor(ir){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=ir}*iterAllWidgets(){for(let ir of this.children)yield*ir.iterAllWidgets()}*iterUserWidgets(){for(let ir of this.children)yield*ir.iterUserWidgets()}*iterSelectedWidgets(){for(let ir of this.children)yield*ir.iterSelectedWidgets()}*iterTabBars(){for(let ir of this.children)yield*ir.iterTabBars()}*iterHandles(){yield*this.handles;for(let ir of this.children)yield*ir.iterHandles()}findTabNode(ir){for(let Ot=0,ar=this.children.length;OtLr.createConfig());return{type:"split-area",orientation:ir,children:ar,sizes:Ot}}syncHandles(){this.handles.forEach((ir,Ot)=>{ir.setAttribute("data-orientation",this.orientation),Ot===this.handles.length-1?ir.classList.add("lm-mod-hidden"):ir.classList.remove("lm-mod-hidden")})}holdSizes(){for(let ir of this.sizers)ir.sizeHint=ir.size}holdAllSizes(){for(let ir of this.children)ir.holdAllSizes();this.holdSizes()}normalizeSizes(){let ir=this.sizers.length;if(ir===0)return;this.holdSizes();let Ot=this.sizers.reduce((ar,Lr)=>ar+Lr.sizeHint,0);if(Ot===0)for(let ar of this.sizers)ar.size=ar.sizeHint=1/ir;else for(let ar of this.sizers)ar.size=ar.sizeHint/=Ot;this.normalized=!0}createNormalizedSizes(){let ir=this.sizers.length;if(ir===0)return[];let Ot=this.sizers.map(Lr=>Lr.size),ar=Ot.reduce((Lr,Ir)=>Lr+Ir,0);if(ar===0)for(let Lr=Ot.length-1;Lr>-1;Lr--)Ot[Lr]=1/ir;else for(let Lr=Ot.length-1;Lr>-1;Lr--)Ot[Lr]/=ar;return Ot}fit(ir,Ot){let ar=this.orientation==="horizontal",Lr=Math.max(0,this.children.length-1)*ir,Ir=ar?Lr:0,de=ar?0:Lr,Mr=1/0,qr=1/0;for(let Vr=0,ti=this.children.length;Vr=Ot.length)&&(ar=0),{type:"tab-area",widgets:Ot,currentIndex:ar}}function nr(ur,ir){let Ot=ur.orientation,ar=[],Lr=[];for(let Ir=0,de=ur.children.length;Ir{let de=Oe(Lr,ir,Ot),Mr=oe(ur.sizes[Ir]),qr=ir.createHandle();ar.children.push(de),ar.handles.push(qr),ar.sizers.push(Mr),de.parent=ar}),ar.syncHandles(),ar.normalizeSizes(),ar}})(Xl||(Xl={}));var sw=class We extends Ya{constructor(oe={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new Ls(this),this._addRequested=new Ls(this),this.addClass("lm-DockPanel"),this._document=oe.document||document,this._mode=oe.mode||"multiple-document",this._renderer=oe.renderer||We.defaultRenderer,this._edges=oe.edges||Rl.DEFAULT_EDGES,oe.tabsMovable!==void 0&&(this._tabsMovable=oe.tabsMovable),oe.tabsConstrained!==void 0&&(this._tabsConstrained=oe.tabsConstrained),oe.addButtonEnabled!==void 0&&(this._addButtonEnabled=oe.addButtonEnabled),this.dataset.mode=this._mode;let Ie={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new eE({document:this._document,renderer:Ie,spacing:oe.spacing,hiddenMode:oe.hiddenMode}),this.overlay=oe.overlay||new We.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(oe){this.layout.hiddenMode=oe}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(oe){this.layout.spacing=oe}get mode(){return this._mode}set mode(oe){if(this._mode===oe)return;this._mode=oe,this.dataset.mode=oe;let Ie=this.layout;switch(oe){case"multiple-document":for(let Oe of Ie.tabBars())Oe.show();break;case"single-document":Ie.restoreLayout(Rl.createSingleDocumentConfig(this));break;default:throw"unreachable"}za.postMessage(this,Rl.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(oe){this._tabsMovable=oe;for(let Ie of this.tabBars())Ie.tabsMovable=oe}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(oe){this._tabsConstrained=oe}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(oe){this._addButtonEnabled=oe;for(let Ie of this.tabBars())Ie.addButtonEnabled=oe}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(oe){let Ie=(0,Sa.find)(this.tabBars(),Oe=>Oe.titles.indexOf(oe.title)!==-1);if(!Ie)throw new Error("Widget is not contained in the dock panel.");Ie.currentTitle=oe.title}activateWidget(oe){this.selectWidget(oe),oe.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(oe){this._mode="multiple-document",this.layout.restoreLayout(oe),(Nc.IS_EDGE||Nc.IS_IE)&&za.flush(),za.postMessage(this,Rl.LayoutModified)}addWidget(oe,Ie={}){this._mode==="single-document"?this.layout.addWidget(oe):this.layout.addWidget(oe,Ie),za.postMessage(this,Rl.LayoutModified)}processMessage(oe){oe.type==="layout-modified"?this._layoutModified.emit(void 0):super.processMessage(oe)}handleEvent(oe){switch(oe.type){case"lm-dragenter":this._evtDragEnter(oe);break;case"lm-dragleave":this._evtDragLeave(oe);break;case"lm-dragover":this._evtDragOver(oe);break;case"lm-drop":this._evtDrop(oe);break;case"pointerdown":this._evtPointerDown(oe);break;case"pointermove":this._evtPointerMove(oe);break;case"pointerup":this._evtPointerUp(oe);break;case"keydown":this._evtKeyDown(oe);break;case"contextmenu":oe.preventDefault(),oe.stopPropagation();break}}onBeforeAttach(oe){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(oe){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(oe){Rl.isGeneratedTabBarProperty.get(oe.child)||oe.child.addClass("lm-DockPanel-widget")}onChildRemoved(oe){Rl.isGeneratedTabBarProperty.get(oe.child)||(oe.child.removeClass("lm-DockPanel-widget"),za.postMessage(this,Rl.LayoutModified))}_evtDragEnter(oe){oe.mimeData.hasData("application/vnd.lumino.widget-factory")&&(oe.preventDefault(),oe.stopPropagation())}_evtDragLeave(oe){oe.preventDefault(),!(this._tabsConstrained&&oe.source!==this)&&(oe.stopPropagation(),this.overlay.hide(1))}_evtDragOver(oe){oe.preventDefault(),this._tabsConstrained&&oe.source!==this||this._showOverlay(oe.clientX,oe.clientY)==="invalid"?oe.dropAction="none":(oe.stopPropagation(),oe.dropAction=oe.proposedAction)}_evtDrop(oe){if(oe.preventDefault(),this.overlay.hide(0),oe.proposedAction==="none"){oe.dropAction="none";return}let{clientX:Ie,clientY:Oe}=oe,{zone:Qe,target:dt}=Rl.findDropTarget(this,Ie,Oe,this._edges);if(this._tabsConstrained&&oe.source!==this||Qe==="invalid"){oe.dropAction="none";return}let jt=oe.mimeData.getData("application/vnd.lumino.widget-factory");if(typeof jt!="function"){oe.dropAction="none";return}let Xt=jt();if(!(Xt instanceof Ya)){oe.dropAction="none";return}if(Xt.contains(this)){oe.dropAction="none";return}let nr=dt?Rl.getDropRef(dt.tabBar):null;switch(Qe){case"root-all":this.addWidget(Xt);break;case"root-top":this.addWidget(Xt,{mode:"split-top"});break;case"root-left":this.addWidget(Xt,{mode:"split-left"});break;case"root-right":this.addWidget(Xt,{mode:"split-right"});break;case"root-bottom":this.addWidget(Xt,{mode:"split-bottom"});break;case"widget-all":this.addWidget(Xt,{mode:"tab-after",ref:nr});break;case"widget-top":this.addWidget(Xt,{mode:"split-top",ref:nr});break;case"widget-left":this.addWidget(Xt,{mode:"split-left",ref:nr});break;case"widget-right":this.addWidget(Xt,{mode:"split-right",ref:nr});break;case"widget-bottom":this.addWidget(Xt,{mode:"split-bottom",ref:nr});break;case"widget-tab":this.addWidget(Xt,{mode:"tab-after",ref:nr});break;default:throw"unreachable"}oe.dropAction=oe.proposedAction,oe.stopPropagation(),this.activateWidget(Xt)}_evtKeyDown(oe){oe.preventDefault(),oe.stopPropagation(),oe.keyCode===27&&(this._releaseMouse(),za.postMessage(this,Rl.LayoutModified))}_evtPointerDown(oe){if(oe.button!==0)return;let Ie=this.layout,Oe=oe.target,Qe=(0,Sa.find)(Ie.handles(),Ht=>Ht.contains(Oe));if(!Qe)return;oe.preventDefault(),oe.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let dt=Qe.getBoundingClientRect(),Jt=oe.clientX-dt.left,jt=oe.clientY-dt.top,Xt=window.getComputedStyle(Qe),nr=nf.overrideCursor(Xt.cursor,this._document);this._pressData={handle:Qe,deltaX:Jt,deltaY:jt,override:nr}}_evtPointerMove(oe){if(!this._pressData)return;oe.preventDefault(),oe.stopPropagation();let Ie=this.node.getBoundingClientRect(),Oe=oe.clientX-Ie.left-this._pressData.deltaX,Qe=oe.clientY-Ie.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,Oe,Qe)}_evtPointerUp(oe){oe.button===0&&(oe.preventDefault(),oe.stopPropagation(),this._releaseMouse(),za.postMessage(this,Rl.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(oe,Ie){let{zone:Oe,target:Qe}=Rl.findDropTarget(this,oe,Ie,this._edges);if(Oe==="invalid")return this.overlay.hide(100),Oe;let dt,Jt,jt,Xt,nr=Os.boxSizing(this.node),Ht=this.node.getBoundingClientRect();switch(Oe){case"root-all":dt=nr.paddingTop,Jt=nr.paddingLeft,jt=nr.paddingRight,Xt=nr.paddingBottom;break;case"root-top":dt=nr.paddingTop,Jt=nr.paddingLeft,jt=nr.paddingRight,Xt=Ht.height*Rl.GOLDEN_RATIO;break;case"root-left":dt=nr.paddingTop,Jt=nr.paddingLeft,jt=Ht.width*Rl.GOLDEN_RATIO,Xt=nr.paddingBottom;break;case"root-right":dt=nr.paddingTop,Jt=Ht.width*Rl.GOLDEN_RATIO,jt=nr.paddingRight,Xt=nr.paddingBottom;break;case"root-bottom":dt=Ht.height*Rl.GOLDEN_RATIO,Jt=nr.paddingLeft,jt=nr.paddingRight,Xt=nr.paddingBottom;break;case"widget-all":dt=Qe.top,Jt=Qe.left,jt=Qe.right,Xt=Qe.bottom;break;case"widget-top":dt=Qe.top,Jt=Qe.left,jt=Qe.right,Xt=Qe.bottom+Qe.height/2;break;case"widget-left":dt=Qe.top,Jt=Qe.left,jt=Qe.right+Qe.width/2,Xt=Qe.bottom;break;case"widget-right":dt=Qe.top,Jt=Qe.left+Qe.width/2,jt=Qe.right,Xt=Qe.bottom;break;case"widget-bottom":dt=Qe.top+Qe.height/2,Jt=Qe.left,jt=Qe.right,Xt=Qe.bottom;break;case"widget-tab":{let er=Qe.tabBar.node.getBoundingClientRect().height;dt=Qe.top,Jt=Qe.left,jt=Qe.right,Xt=Qe.bottom+Qe.height-er;break}default:throw"unreachable"}return this.overlay.show({top:dt,left:Jt,right:jt,bottom:Xt}),Oe}_createTabBar(){let oe=this._renderer.createTabBar(this._document);return Rl.isGeneratedTabBarProperty.set(oe,!0),this._mode==="single-document"&&oe.hide(),oe.tabsMovable=this._tabsMovable,oe.allowDeselect=!1,oe.addButtonEnabled=this._addButtonEnabled,oe.removeBehavior="select-previous-tab",oe.insertBehavior="select-tab-if-needed",oe.tabMoved.connect(this._onTabMoved,this),oe.currentChanged.connect(this._onCurrentChanged,this),oe.tabCloseRequested.connect(this._onTabCloseRequested,this),oe.tabDetachRequested.connect(this._onTabDetachRequested,this),oe.tabActivateRequested.connect(this._onTabActivateRequested,this),oe.addRequested.connect(this._onTabAddRequested,this),oe}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){za.postMessage(this,Rl.LayoutModified)}_onCurrentChanged(oe,Ie){let{previousTitle:Oe,currentTitle:Qe}=Ie;Oe&&Oe.owner.hide(),Qe&&Qe.owner.show(),(Nc.IS_EDGE||Nc.IS_IE)&&za.flush(),za.postMessage(this,Rl.LayoutModified)}_onTabAddRequested(oe){this._addRequested.emit(oe)}_onTabActivateRequested(oe,Ie){Ie.title.owner.activate()}_onTabCloseRequested(oe,Ie){Ie.title.owner.close()}_onTabDetachRequested(oe,Ie){if(this._drag)return;oe.releaseMouse();let{title:Oe,tab:Qe,clientX:dt,clientY:Jt,offset:jt}=Ie,Xt=new yp.MimeData,nr=()=>Oe.owner;Xt.setData("application/vnd.lumino.widget-factory",nr);let Ht=Qe.cloneNode(!0);jt&&(Ht.style.top=`-${jt.y}px`,Ht.style.left=`-${jt.x}px`),this._drag=new nf({document:this._document,mimeData:Xt,dragImage:Ht,proposedAction:"move",supportedActions:"move",source:this}),Qe.classList.add("lm-mod-hidden");let er=()=>{this._drag=null,Qe.classList.remove("lm-mod-hidden")};this._drag.start(dt,Jt).then(er)}};(function(We){class oe{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(Qe){let dt=this.node.style;dt.top=`${Qe.top}px`,dt.left=`${Qe.left}px`,dt.right=`${Qe.right}px`,dt.bottom=`${Qe.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(Qe){if(!this._hidden){if(Qe<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},Qe))}}}We.Overlay=oe;class Ie{createTabBar(Qe){let dt=new i1({document:Qe});return dt.addClass("lm-DockPanel-tabBar"),dt}createHandle(){let Qe=document.createElement("div");return Qe.className="lm-DockPanel-handle",Qe}}We.Renderer=Ie,We.defaultRenderer=new Ie})(sw||(sw={}));var Rl;(function(We){We.GOLDEN_RATIO=.618,We.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},We.LayoutModified=new o0("layout-modified"),We.isGeneratedTabBarProperty=new af({name:"isGeneratedTabBar",create:()=>!1});function oe(Qe){if(Qe.isEmpty)return{main:null};let dt=Array.from(Qe.widgets()),Jt=Qe.selectedWidgets().next().value,jt=Jt?dt.indexOf(Jt):-1;return{main:{type:"tab-area",widgets:dt,currentIndex:jt}}}We.createSingleDocumentConfig=oe;function Ie(Qe,dt,Jt,jt){if(!Os.hitTest(Qe.node,dt,Jt))return{zone:"invalid",target:null};let Xt=Qe.layout;if(Xt.isEmpty)return{zone:"root-all",target:null};if(Qe.mode==="multiple-document"){let Mr=Qe.node.getBoundingClientRect(),qr=dt-Mr.left+1,Vr=Jt-Mr.top+1,ti=Mr.right-dt,Xr=Mr.bottom-Jt;switch(Math.min(Vr,ti,Xr,qr)){case Vr:if(Vrar&&ur>ar&&er>Lr&&ir>Lr)return{zone:"widget-all",target:nr};Ht/=ar,er/=Lr,ur/=ar,ir/=Lr;let Ir=Math.min(Ht,er,ur,ir),de;switch(Ir){case Ht:de="widget-left";break;case er:de="widget-top";break;case ur:de="widget-right";break;case ir:de="widget-bottom";break;default:throw"unreachable"}return{zone:de,target:nr}}We.findDropTarget=Ie;function Oe(Qe){return Qe.titles.length===0?null:Qe.currentTitle?Qe.currentTitle.owner:Qe.titles[Qe.titles.length-1].owner}We.getDropRef=Oe})(Rl||(Rl={}));var my=class We extends _p{constructor(oe={}){super(oe),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new Wd],this._columnSizers=[new Wd],this._box=null,oe.rowCount!==void 0&&Au.reallocSizers(this._rowSizers,oe.rowCount),oe.columnCount!==void 0&&Au.reallocSizers(this._columnSizers,oe.columnCount),oe.rowSpacing!==void 0&&(this._rowSpacing=Au.clampValue(oe.rowSpacing)),oe.columnSpacing!==void 0&&(this._columnSpacing=Au.clampValue(oe.columnSpacing))}dispose(){for(let oe of this._items){let Ie=oe.widget;oe.dispose(),Ie.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(oe){oe!==this.rowCount&&(Au.reallocSizers(this._rowSizers,oe),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(oe){oe!==this.columnCount&&(Au.reallocSizers(this._columnSizers,oe),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(oe){oe=Au.clampValue(oe),this._rowSpacing!==oe&&(this._rowSpacing=oe,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(oe){oe=Au.clampValue(oe),this._columnSpacing!==oe&&(this._columnSpacing=oe,this.parent&&this.parent.fit())}rowStretch(oe){let Ie=this._rowSizers[oe];return Ie?Ie.stretch:-1}setRowStretch(oe,Ie){let Oe=this._rowSizers[oe];Oe&&(Ie=Au.clampValue(Ie),Oe.stretch!==Ie&&(Oe.stretch=Ie,this.parent&&this.parent.update()))}columnStretch(oe){let Ie=this._columnSizers[oe];return Ie?Ie.stretch:-1}setColumnStretch(oe,Ie){let Oe=this._columnSizers[oe];Oe&&(Ie=Au.clampValue(Ie),Oe.stretch!==Ie&&(Oe.stretch=Ie,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(let oe of this._items)yield oe.widget}addWidget(oe){Sa.ArrayExt.findFirstIndex(this._items,Oe=>Oe.widget===oe)===-1&&(this._items.push(new dv(oe)),this.parent&&this.attachWidget(oe))}removeWidget(oe){let Ie=Sa.ArrayExt.findFirstIndex(this._items,Qe=>Qe.widget===oe);if(Ie===-1)return;let Oe=Sa.ArrayExt.removeAt(this._items,Ie);this.parent&&this.detachWidget(oe),Oe.dispose()}init(){super.init();for(let oe of this)this.attachWidget(oe)}attachWidget(oe){this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.BeforeAttach),this.parent.node.appendChild(oe.node),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.AfterAttach),this.parent.fit()}detachWidget(oe){this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(oe.node),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.AfterDetach),this.parent.fit()}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}_fit(){for(let Xt=0,nr=this.rowCount;Xt!Xt.isHidden);for(let Xt=0,nr=oe.length;Xt({row:0,column:0,rowSpan:1,columnSpan:1}),changed:jt});function oe(Xt){let nr=Math.max(0,Math.floor(Xt.row||0)),Ht=Math.max(0,Math.floor(Xt.column||0)),er=Math.max(1,Math.floor(Xt.rowSpan||0)),ur=Math.max(1,Math.floor(Xt.columnSpan||0));return{row:nr,column:Ht,rowSpan:er,columnSpan:ur}}We.normalizeConfig=oe;function Ie(Xt){return Math.max(0,Math.floor(Xt))}We.clampValue=Ie;function Oe(Xt,nr){let Ht=We.cellConfigProperty.get(Xt.widget),er=We.cellConfigProperty.get(nr.widget);return Ht.rowSpan-er.rowSpan}We.rowSpanCmp=Oe;function Qe(Xt,nr){let Ht=We.cellConfigProperty.get(Xt.widget),er=We.cellConfigProperty.get(nr.widget);return Ht.columnSpan-er.columnSpan}We.columnSpanCmp=Qe;function dt(Xt,nr){for(nr=Math.max(1,Math.floor(nr));Xt.lengthnr&&(Xt.length=nr)}We.reallocSizers=dt;function Jt(Xt,nr,Ht,er){if(Ht=er)return;let ir=(er-ur)/(Ht-nr+1);for(let Ot=nr;Ot<=Ht;++Ot)Xt[Ot].minSize+=ir}We.distributeMin=Jt;function jt(Xt){Xt.parent&&Xt.parent.layout instanceof my&&Xt.parent.fit()}})(Au||(Au={}));var lw=class We extends Ya{constructor(oe={}){super({node:uw.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(Ya.Flag.DisallowLayout),this.renderer=oe.renderer||We.defaultRenderer,this._forceItemsPosition=oe.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=oe.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(oe){this.activeIndex=oe?this._menus.indexOf(oe):-1}get activeIndex(){return this._activeIndex}set activeIndex(oe){(oe<0||oe>=this._menus.length)&&(oe=-1),oe>-1&&this._menus[oe].items.length===0&&(oe=-1),this._activeIndex!==oe&&(this._activeIndex=oe,this.update())}get menus(){return this._menus}openActiveMenu(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(oe,Ie=!0){this.insertMenu(this._menus.length,oe,Ie)}insertMenu(oe,Ie,Oe=!0){this._closeChildMenu();let Qe=this._menus.indexOf(Ie),dt=Math.max(0,Math.min(oe,this._menus.length));if(Qe===-1){Sa.ArrayExt.insert(this._menus,dt,Ie),Ie.addClass("lm-MenuBar-menu"),Ie.aboutToClose.connect(this._onMenuAboutToClose,this),Ie.menuRequested.connect(this._onMenuMenuRequested,this),Ie.title.changed.connect(this._onTitleChanged,this),Oe&&this.update();return}dt===this._menus.length&&dt--,Qe!==dt&&(Sa.ArrayExt.move(this._menus,Qe,dt),Oe&&this.update())}removeMenu(oe,Ie=!0){this.removeMenuAt(this._menus.indexOf(oe),Ie)}removeMenuAt(oe,Ie=!0){this._closeChildMenu();let Oe=Sa.ArrayExt.removeAt(this._menus,oe);Oe&&(Oe.aboutToClose.disconnect(this._onMenuAboutToClose,this),Oe.menuRequested.disconnect(this._onMenuMenuRequested,this),Oe.title.changed.disconnect(this._onTitleChanged,this),Oe.removeClass("lm-MenuBar-menu"),Ie&&this.update())}clearMenus(){if(this._menus.length!==0){this._closeChildMenu();for(let oe of this._menus)oe.aboutToClose.disconnect(this._onMenuAboutToClose,this),oe.menuRequested.disconnect(this._onMenuMenuRequested,this),oe.title.changed.disconnect(this._onTitleChanged,this),oe.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(oe){switch(oe.type){case"keydown":this._evtKeyDown(oe);break;case"pointerdown":this._evtPointerDown(oe);break;case"pointermove":case"pointerleave":this._evtPointerMove(oe);break;case"focusout":this._evtFocusOut(oe);break;case"contextmenu":oe.preventDefault(),oe.stopPropagation();break}}onBeforeAttach(oe){this.node.addEventListener("keydown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("pointermove",this),this.node.addEventListener("pointerleave",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(oe){this.node.removeEventListener("keydown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("pointermove",this),this.node.removeEventListener("pointerleave",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(oe){this.isAttached&&this._focusItemAt(0)}onResize(oe){this.update(),super.onResize(oe)}onUpdateRequest(oe){var Ie;let Oe=this._menus,Qe=this.renderer,dt=this._activeIndex,Jt=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:Oe.length,Xt=0,nr=!1;jt=this._overflowMenu!==null?jt-1:jt;let Ht=new Array(jt);for(let er=0;er{this._tabFocusIndex=er,this.activeIndex=er}}),Xt+=this._menuItemSizes[er],Oe[er].title.label===this._overflowMenuOptions.title&&(nr=!0,jt--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!nr){if(this._overflowMenu===null){let er=(Ie=this._overflowMenuOptions.title)!==null&&Ie!==void 0?Ie:"...";this._overflowMenu=new hv({commands:new vp}),this._overflowMenu.title.label=er,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let er=Oe.length-2;er>=jt;er--){let ur=this.menus[er];ur.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:ur}),this.removeMenu(ur,!1)}Ht[jt]=Qe.renderItem({title:this._overflowMenu.title,active:jt===dt&&Oe[jt].items.length!==0,tabbable:jt===Jt,disabled:Oe[jt].items.length===0,onfocus:()=>{this._tabFocusIndex=jt,this.activeIndex=jt}}),jt++}else if(this._overflowMenu!==null){let er=this._overflowMenu.items,ur=this.node.offsetWidth,ir=this._overflowMenu.items.length;for(let Ot=0;Otthis._menuItemSizes[ar]){let Lr=er[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(jt,Lr,!1),Ht[jt]=Qe.renderItem({title:Lr.title,active:!1,tabbable:jt===Jt,disabled:Oe[jt].items.length===0,onfocus:()=>{this._tabFocusIndex=jt,this.activeIndex=jt}}),jt++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),Ht.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}Hd.render(Ht,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let oe=this.contentNode.childNodes,Ie=this.node.offsetWidth,Oe=0,Qe=-1,dt=oe.length;if(this._menuItemSizes.length==0)for(let Jt=0;JtIe&&Qe===-1&&(Qe=Jt)}else for(let Jt=0;JtIe){Qe=Jt;break}this._overflowIndex=Qe}_evtKeyDown(oe){let Ie=oe.keyCode;if(Ie===9){this.activeIndex=-1;return}if(oe.preventDefault(),oe.stopPropagation(),Ie===13||Ie===32||Ie===38||Ie===40){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(Ie===27){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(Ie===37||Ie===39){let Jt=Ie===37?-1:1,jt=this._tabFocusIndex+Jt,Xt=this._menus.length;for(let nr=0;nrOs.hitTest(Oe,oe.clientX,oe.clientY));if(Ie===-1){this._closeChildMenu();return}if(oe.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=Ie;else{oe.preventDefault();let Oe=this._positionForMenu(Ie);hv.saveWindowData(),this.activeIndex=Ie,this._openChildMenu(Oe)}}_evtPointerMove(oe){let Ie=Sa.ArrayExt.findFirstIndex(this.contentNode.children,Qe=>Os.hitTest(Qe,oe.clientX,oe.clientY));if(Ie===this._activeIndex||Ie===-1&&this._childMenu)return;let Oe=Ie>=0&&this._childMenu?this._positionForMenu(Ie):null;hv.saveWindowData(),this.activeIndex=Ie,Oe&&this._openChildMenu(Oe)}_positionForMenu(oe){let Ie=this.contentNode.children[oe],{left:Oe,bottom:Qe}=Ie.getBoundingClientRect();return{top:Qe,left:Oe}}_evtFocusOut(oe){!this._childMenu&&!this.node.contains(oe.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(oe){let Ie=this.contentNode.childNodes[oe];Ie&&Ie.focus()}_openChildMenu(oe={}){let Ie=this.activeMenu;if(!Ie){this._closeChildMenu();return}let Oe=this._childMenu;if(Oe===Ie)return;this._childMenu=Ie,Oe?Oe.close():document.addEventListener("pointerdown",this,!0),this._tabFocusIndex=this.activeIndex,za.sendMessage(this,Ya.Msg.UpdateRequest);let{left:Qe,top:dt}=oe;(typeof Qe>"u"||typeof dt>"u")&&({left:Qe,top:dt}=this._positionForMenu(this._activeIndex)),Oe||this.addClass("lm-mod-active"),Ie.items.length>0&&Ie.open(Qe,dt,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("pointerdown",this,!0);let oe=this._childMenu;this._childMenu=null,oe.close(),this.activeIndex=-1}_onMenuAboutToClose(oe){oe===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("pointerdown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(oe,Ie){if(oe!==this._childMenu)return;let Oe=this._activeIndex,Qe=this._menus.length;switch(Ie){case"next":this.activeIndex=Oe===Qe-1?0:Oe+1;break;case"previous":this.activeIndex=Oe===0?Qe-1:Oe-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}};(function(We){class oe{renderItem(Oe){let Qe=this.createItemClass(Oe),dt=this.createItemDataset(Oe),Jt=this.createItemARIA(Oe);return Fs.li({className:Qe,dataset:dt,...Oe.disabled?{}:{tabindex:Oe.tabbable?"0":"-1"},onfocus:Oe.onfocus,...Jt},this.renderIcon(Oe),this.renderLabel(Oe))}renderIcon(Oe){let Qe=this.createIconClass(Oe);return Fs.div({className:Qe},Oe.title.icon,Oe.title.iconLabel)}renderLabel(Oe){let Qe=this.formatLabel(Oe);return Fs.div({className:"lm-MenuBar-itemLabel"},Qe)}createItemClass(Oe){let Qe="lm-MenuBar-item";return Oe.title.className&&(Qe+=` ${Oe.title.className}`),Oe.active&&!Oe.disabled&&(Qe+=" lm-mod-active"),Qe}createItemDataset(Oe){return Oe.title.dataset}createItemARIA(Oe){return{role:"menuitem","aria-haspopup":"true","aria-disabled":Oe.disabled?"true":"false"}}createIconClass(Oe){let Qe="lm-MenuBar-itemIcon",dt=Oe.title.iconClass;return dt?`${Qe} ${dt}`:Qe}formatLabel(Oe){let{label:Qe,mnemonic:dt}=Oe.title;if(dt<0||dt>=Qe.length)return Qe;let Jt=Qe.slice(0,dt),jt=Qe.slice(dt+1),Xt=Qe[dt],nr=Fs.span({className:"lm-MenuBar-itemMnemonic"},Xt);return[Jt,nr,jt]}}We.Renderer=oe,We.defaultRenderer=new oe})(lw||(lw={}));var uw;(function(We){function oe(){let Oe=document.createElement("div"),Qe=document.createElement("ul");return Qe.className="lm-MenuBar-content",Oe.appendChild(Qe),Qe.setAttribute("role","menubar"),Oe}We.createNode=oe;function Ie(Oe,Qe,dt){let Jt=-1,jt=-1,Xt=!1,nr=Qe.toUpperCase();for(let Ht=0,er=Oe.length;Ht=0&&Ot1&&this.widgets.forEach(Ie=>{Ie.hiddenMode=this._hiddenMode}))}dispose(){for(let oe of this._items)oe.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(oe,Ie){this._hiddenMode===Ya.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=Ya.HiddenMode.Scale),Ie.hiddenMode=Ya.HiddenMode.Scale):Ie.hiddenMode=Ya.HiddenMode.Display,Sa.ArrayExt.insert(this._items,oe,new dv(Ie)),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.BeforeAttach),this.parent.node.appendChild(Ie.node),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.AfterAttach),this.parent.fit()}moveWidget(oe,Ie,Oe){Sa.ArrayExt.move(this._items,oe,Ie),this.parent.update()}detachWidget(oe,Ie){let Oe=Sa.ArrayExt.removeAt(this._items,oe);this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Ie.node),this.parent.isAttached&&za.sendMessage(Ie,Ya.Msg.AfterDetach),Oe.widget.node.style.zIndex="",this._hiddenMode===Ya.HiddenMode.Scale&&(Ie.hiddenMode=Ya.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=Ya.HiddenMode.Display)),Oe.dispose(),this.parent.fit()}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}_fit(){let oe=0,Ie=0;for(let dt=0,Jt=this._items.length;dt{this.createGraph(this._model)})}renderModel(oe){if(this.hasGraphElement()){let Oe=this._model?.data[this._mimeType];return JSON.stringify(Oe)===JSON.stringify(oe.data[this._mimeType])?Promise.resolve():(this._model=oe,this.createGraph(oe))}this._model=oe;let Ie=oe.data["image/png"];return Ie!=null?(this.updateImage(Ie),Promise.resolve()):this.createGraph(oe)}hasGraphElement(){return this.node.querySelector(".plot-container")!==null}updateImage(oe){this.hideGraph(),this._img_el.src="data:image/png;base64,"+oe,this.showImage()}hideGraph(){let oe=this.node.querySelector(".plot-container");oe!=null&&(oe.style.display="none")}showGraph(){let oe=this.node.querySelector(".plot-container");oe!=null&&(oe.style.display="block")}hideImage(){let oe=this.node.querySelector(".plot-img");oe!=null&&(oe.style.display="none")}showImage(){let oe=this.node.querySelector(".plot-img");oe!=null&&(oe.style.display="block")}createGraph(oe){let{data:Ie,layout:Oe,frames:Qe,config:dt}=oe.data[this._mimeType];return Oe.height||(Oe.height=360),(async()=>(We.Plotly===null&&(We.Plotly=await Promise.resolve().then(()=>hp(hU())),We._resolveLoadingPlotly()),We.loadingPlotly))().then(()=>We.Plotly.react(this.node,Ie,Oe,dt)).then(jt=>{this.showGraph(),this.hideImage(),this.update(),Qe&&We.Plotly.addFrames(this.node,Qe),this.node.offsetWidth>0&&this.node.offsetHeight>0&&We.Plotly.toImage(jt,{format:"png",width:this.node.offsetWidth,height:this.node.offsetHeight}).then(Xt=>{let nr=Xt.split(",")[1];oe.data["image/png"]!==nr&&oe.setData({data:{...oe.data,"image/png":nr}})}),this.node.on("plotly_webglcontextlost",()=>{let Xt=oe.data["image/png"];if(Xt!=null)return this.updateImage(Xt),Promise.resolve()})})}onAfterShow(oe){this.update()}onResize(oe){this.update()}onUpdateRequest(oe){We.Plotly&&this.isVisible&&this.hasGraphElement()&&We.Plotly.redraw(this.node).then(()=>{We.Plotly.Plots.resize(this.node)})}static{this.Plotly=null}static{this.loadingPlotly=new Promise(oe=>{We._resolveLoadingPlotly=oe})}},Uce={safe:!0,mimeTypes:[dU],createRenderer:We=>new cE(We)},qce=[{id:"@jupyterlab/plotly-extension:factory",rendererFactory:Uce,rank:2,dataType:"json",fileTypes:[{name:"plotly",mimeTypes:[dU],extensions:[".plotly",".plotly.json"],iconClass:jce}],documentWidgetFactoryOptions:{name:"Plotly",primaryFileType:"plotly",fileTypes:["plotly","json"],defaultFor:["plotly"]}}],$me=qce;export{dU as MIME_TYPE,cE as RenderedPlotly,$me as default,Uce as rendererFactory}; +);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Yo("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;uniform vec3 u_globe_position;uniform float u_globe_radius;in vec3 v_view_direction;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (u_sky_blend > 0.0) {vec3 ray=normalize(v_view_direction);float globe_distance=length(u_globe_position);float angle_to_globe_center=acos(clamp(dot(ray,u_globe_position)/globe_distance,-1.0,1.0));float horizon_angle=asin(min(u_globe_radius/globe_distance,1.0));blend=mix(blend,(angle_to_globe_center-horizon_angle)*u_camera_to_center_distance*u_device_pixel_ratio,u_sky_blend);}if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 v_view_direction;void main() {v_view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,1.0,1.0);}")},OM="#define PROJECTION_MERCATOR",NM="mercator",M2=class{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return NM}get shaderDefine(){return OM}get shaderPreludeCode(){return id.projectionMercator}get vertexShaderPreludeCode(){return id.projectionMercator.vertexSource}get subdivisionGranularity(){return wb.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}destroy(){}getMeshFromTileID(e,r,t,i,a){if(this._cachedMesh)return this._cachedMesh;let o=new lp;o.emplaceBack(0,0),o.emplaceBack(Bi,0),o.emplaceBack(0,Bi),o.emplaceBack(Bi,Bi);let s=e.createVertexBuffer(o,a0.members),l=Ks.simpleSegment(0,0,4,2),n=new td;n.emplaceBack(1,0,2),n.emplaceBack(1,2,3);let u=e.createIndexBuffer(n);return this._cachedMesh=new qm(s,u,l),this._cachedMesh}recalculate(){}hasTransition(){return!1}},S2=class sU{constructor(r=0,t=0,i=0,a=0){if(isNaN(r)||r<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(a)||a<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=r,this.bottom=t,this.left=i,this.right=a}interpolate(r,t,i){return t.top!=null&&r.top!=null&&(this.top=Zs.number(r.top,t.top,i)),t.bottom!=null&&r.bottom!=null&&(this.bottom=Zs.number(r.bottom,t.bottom,i)),t.left!=null&&r.left!=null&&(this.left=Zs.number(r.left,t.left,i)),t.right!=null&&r.right!=null&&(this.right=Zs.number(r.right,t.right,i)),this}getCenter(r,t){let i=to((this.left+r-this.right)/2,0,r),a=to((this.top+t-this.bottom)/2,0,t);return new Wr(i,a)}equals(r){return this.top===r.top&&this.bottom===r.bottom&&this.left===r.left&&this.right===r.right}clone(){return new sU(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}},E2=class{constructor(e,r){var t;this.applyConstrain=(i,a)=>this._constrainOverride===null?this._callbacks.defaultConstrain(i,a):this._constrainOverride(i,a),this._callbacks=e,this._tileSize=512,this._renderWorldCopies=r?.renderWorldCopies===void 0||!!r?.renderWorldCopies,this._minZoom=r?.minZoom||0,this._maxZoom=r?.maxZoom||22,this._minPitch=r?.minPitch===void 0||r?.minPitch===null?0:r?.minPitch,this._maxPitch=r?.maxPitch===void 0||r?.maxPitch===null?60:r?.maxPitch,this._constrainOverride=(t=r?.constrainOverride)!=null?t:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new An(0,0),this._elevation=0,this._zoom=0,this._tileZoom=hz(this._zoom),this._scale=Vc(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new S2,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,r,t){this._constrainOverride=e.constrainOverride,this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=hz(this._zoom),this._scale=Vc(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new S2(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!t&&e.autoCalculateNearFarZ,r&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){if(this._minZoom===e)return;this._minZoom=e;let r=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=r}get maxZoom(){return this._maxZoom}setMaxZoom(e){if(this._maxZoom===e)return;this._maxZoom=e;let r=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=r}get minPitch(){return this._minPitch}setMinPitch(e){if(this._minPitch===e)return;this._minPitch=e;let r=this._unmodified;this.setPitch(Math.max(this.pitch,e)),this._unmodified=r}get maxPitch(){return this._maxPitch}setMaxPitch(e){if(this._maxPitch===e)return;this._maxPitch=e;let r=this._unmodified;this.setPitch(Math.min(this.pitch,e)),this._unmodified=r}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get constrainOverride(){return this._constrainOverride}setConstrainOverride(e){e===void 0&&(e=null),this._constrainOverride!==e&&(this._constrainOverride=e,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new Wr(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){let r=fh(e,-180,180)*Math.PI/180;this._bearingInRadians!==r&&(this._unmodified=!1,this._bearingInRadians=r,this._calcMatrices(),this._rotationMatrix=D5(),Hae(this._rotationMatrix,this._rotationMatrix,-this._bearingInRadians))}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){let r=to(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==r&&(this._unmodified=!1,this._pitchInRadians=r,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){let r=e/180*Math.PI;this._rollInRadians!==r&&(this._unmodified=!1,this._rollInRadians=r,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return Md(this._fovInRadians)}setFov(e){e=to(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=rl(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){let r=this.applyConstrain(this._center,e).zoom;this._zoom!==r&&(this._unmodified=!1,this._zoom=r,this._tileZoom=Math.max(0,Math.floor(r)),this._scale=Vc(r),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(e){(e.lat!==this._center.lat||e.lng!==this._center.lng)&&(this._unmodified=!1,this._center=e,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,r){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=r,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,r,t){this._unmodified=!1,this._edgeInsets.interpolate(e,r,t),this.constrainInternal(),this._calcMatrices()}resize(e,r,t=!0){this._width=e,this._height=r,t&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){var e,r;return((e=this._latRange)==null?void 0:e.length)!==2||((r=this._lngRange)==null?void 0:r.length)!==2?null:new wh([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-Yh,Yh])}getCameraQueryGeometry(e,r){if(r.length===1)return[r[0],e];{let{minX:t,minY:i,maxX:a,maxY:o}=yh.fromPoints(r).extend(e);return[new Wr(t,i),new Wr(a,i),new Wr(a,o),new Wr(t,o),new Wr(t,i)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:r,zoom:t}=this.applyConstrain(this.center,this.zoom);this.setCenter(r),this.setZoom(t),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._pixelPerMeter=V0(1,this.center.lat)*this.worldSize,!this._width||!this._height)return;this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=$h(new Float64Array(16));Xu(e,e,[this._width/2,-this._height/2,1]),Ol(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=$h(new Float64Array(16)),Xu(e,e,[1,-1,1]),Ol(e,e,[-1,-1,0]),Xu(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e;let r=this.fovInRadians/2;this._cameraToCenterDistance=.5/Math.tan(r)*this._height,this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,r,t,i){let a=t===void 0?this.bearing:t,o=i=i===void 0?this.pitch:i,{distanceToCenter:s,clampedElevation:l}=this._distanceToCenterFromAltElevationPitch(r,this.elevation,o),{x:n,y:u}=N6(o,a),c=Qo.fromLngLat(e,r),f=QL(1,c.y),h,d,p=0;do{if(p+=1,p>10)break;d=s/f;let g=n*d,m=u*d;h=new Qo(c.x+g,c.y+m),f=1/h.meterInMercatorCoordinateUnits()}while(Math.abs(s-d*f)>1e-12);return{center:h.toLngLat(),elevation:l,zoom:Ku(this.height/2/Math.tan(this.fovInRadians/2)/d/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e===0)return;let r=1/this.worldSize,t=V0(1,this.center.lat)*this.worldSize,i=Qo.fromLngLat(this.center,this.elevation),a=i.x/r,o=i.y/r,s=i.z/r,l=this.pitch,n=this.bearing,{x:u,y:c,z:f}=N6(l,n),h=this.cameraToCenterDistance,d=a+h*-u,p=o+h*-c,g=s+h*f,{distanceToCenter:m,clampedElevation:y}=this._distanceToCenterFromAltElevationPitch(g/t,e,l),_=m*t,v=d+u*_,x=p+c*_,S=new Qo(v*r,x*r,0).toLngLat(),M=V0(1,S.lat),C=Ku(this.height/2/Math.tan(this.fovInRadians/2)/m/M/this.tileSize);this._elevation=y,this._center=S,this.setZoom(C)}_distanceToCenterFromAltElevationPitch(e,r,t){let i=-Math.cos(rl(t)),a=e-r,o,s=r;return i*a>=0||Math.abs(i)<.1?(o=1e4,s=e+o*i):o=-a/i,{distanceToCenter:o,clampedElevation:s}}getCameraPoint(){let e=this.pitchInRadians,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new Wr(r*Math.sin(this.rollInRadians),r*Math.cos(this.rollInRadians)))}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];let r=e.canonical.z>=0?1<i}allowWorldCopies(){return!0}prepareNextFrame(){}},YB=ul([{name:"a_pos3d",type:"Int16",components:3}]),XB=class extends Nl{constructor(e){super(),this._lastTilesetChange=hs(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,r){this.tileManager.update(e,r),this._renderableTilesKeys=[];let t={},i=!1;for(let a of Om(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r,calculateTileZoom:this.tileManager._source.calculateTileZoom}))t[a.key]=!0,this._renderableTilesKeys.push(a.key),this._tiles[a.key]||(a.terrainRttPosMatrix32f=new Float32Array(16),Wh(a.terrainRttPosMatrix32f,0,Bi,Bi,0,0,1),this._tiles[a.key]=new DM(a,this.tileSize),this._lastTilesetChange=hs(),i=!0);for(let a in this._tiles)t[a]||(this._tiles[a].releaseRTT(this.tileManager.map.painter),delete this._tiles[a],i=!0);return i}releaseRTT(e){for(let r in this._tiles){let t=this._tiles[r];(t.tileID.equals(e)||t.tileID.isChildOf(e)||e.isChildOf(t.tileID))&&t.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,r){return r?this._getTerrainCoordsForTileRanges(e,r):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let r={};for(let t of this._renderableTilesKeys){let i=this._tiles[t].tileID,a=e.clone(),o=F0();if(i.canonical.equals(e.canonical))Wh(o,0,Bi,Bi,0,0,1);else if(i.canonical.isChildOf(e.canonical)){let s=i.canonical.z-e.canonical.z,l=i.canonical.x-(i.canonical.x>>s<>s<>s;Wh(o,0,u,u,0,0,1),Ol(o,o,[-l*u,-n*u,0])}else if(e.canonical.isChildOf(i.canonical)){let s=e.canonical.z-i.canonical.z,l=e.canonical.x-(e.canonical.x>>s<>s<>s;Wh(o,0,Bi,Bi,0,0,1),Ol(o,o,[l*u,n*u,0]),Xu(o,o,[1/2**s,1/2**s,0])}else continue;a.terrainRttPosMatrix32f=new Float32Array(o),r[t]=a}return r}_getTerrainCoordsForTileRanges(e,r){let t={};for(let i of this._renderableTilesKeys){let a=this._tiles[i].tileID;if(!this._isWithinTileRanges(a,r))continue;let o=e.clone(),s=F0();if(a.canonical.z===e.canonical.z){let l=e.canonical.x-a.canonical.x+e.wrap*(1<e.canonical.z){let l=a.canonical.z-e.canonical.z,n=a.canonical.x-(a.canonical.x>>l<>l<>l),f=e.canonical.y-(a.canonical.y>>l),h=Bi>>l;Wh(s,0,h,h,0,0,1),Ol(s,s,[-n*h+c*Bi,-u*h+f*Bi,0])}else{let l=e.canonical.z-a.canonical.z,n=e.canonical.x-(e.canonical.x>>l<>l<>l)-a.canonical.x,f=(e.canonical.y>>l)-a.canonical.y,h=Bi<a.maxzoom&&(o=a.maxzoom),o=a.minzoom&&!s?.dem;)s=this.findTileInCaches(e.scaledTo(o--).key);return s}findTileInCaches(e){let r=this.tileManager.getTileByID(e);return r||(r=this.tileManager._outOfViewCache.getByKey(e),r)}anyTilesAfterTime(e=hs()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,r){let t=r[e.canonical.z];return!!t&&(e.wrap>t.minWrap||e.wrap=t.minTileXWrapped&&e.canonical.x<=t.maxTileXWrapped&&e.canonical.y>=t.minTileY&&e.canonical.y<=t.maxTileY)}},jM=Bi*(1-1e-12),ZB=class{constructor(e,r,t,i="auto"){this._meshCache={},this.painter=e,this.tileManager=new XB(r),this.options=t,this.exaggeration=typeof t.exaggeration=="number"?t.exaggeration:1,this._terrainSkirtLength=i,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this._elevationSamplerCache=new Map}destroy(){this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null));for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,r,t,i=Bi){let a=e.normalizeCoordinates(r,t,i);if(!a)return 0;let o=this.getElevationSampler(a.tileID);return o?o(a.x,a.y,i):0}getElevationForLngLatZoom(e,r){if(!zF(r,e.wrap()))return 0;let{tileID:t,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(t,i%Bi,a%Bi,Bi)}getElevationForLngLat(e,r){let t=this.getCoverageIndex();if(t){let o=Qo.fromLngLat(e),s=tM(t,this.exaggeration,o.x,o.y);if(s.demLoaded)return s.elevation}let i=Om(r,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),a=0;for(let o of i)o.canonical.z>a&&(a=Math.min(o.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(e,a)}getElevation(e,r,t,i=Bi){return this.getDEMElevation(e,r,t,i)*this.exaggeration}resetElevationCache(){this._elevationSamplerCache.clear(),this._coverageIndex=void 0}getCoverageIndex(){return this._coverageIndex===void 0&&(this._coverageIndex=this._buildCoverageIndex()),this._coverageIndex}_buildCoverageIndex(){let e=[],r=new Map,t=0,i=0;for(let a of this.tileManager.getRenderableTiles()){if(!a)continue;let{canonical:o,wrap:s}=a.tileID;e.includes(o.z)||e.push(o.z);let l=this.getElevationSampler(a.tileID);r.set(`${s}/${o.z}/${o.x}/${o.y}`,l);let{minElevation:n,maxElevation:u}=this.getMinMaxElevation(a.tileID);t=Math.min(t,n??0),i=Math.max(i,u??0)}return r.size===0?null:(e.sort((a,o)=>o-a),{zooms:e,samplerPerTile:r,minElevation:t-10,maxElevation:i+10})}getElevationSampler(e){let r=e.key,t=this._elevationSamplerCache.get(r);if(t)return t;let i=this.tileManager.getSourceTile(e,!0),a=i?.dem;if(!i||!a)return null;let o=this._getDEMTileMatrix(e,i),s=o[0]*a.dim,l=o[5]*a.dim,n=o[12]*a.dim,u=o[13]*a.dim,c=(f,h,d)=>{let p=d===8192?1:Bi/d;return a.sampleBilinear(f*p*s+n,h*p*l+u)};return this._elevationSamplerCache.set(r,c),c}_getDEMTileMatrix(e,r){let t=`${r.tileID.key}/${e.key}`,i=this._demMatrixCache.get(t);if(i)return i;let a=this.tileManager.getSource().maxzoom,o=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=a?o=e.canonical.z-a:To("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let s=e.canonical.x-(e.canonical.x>>o<>o<0,i=t&&e.canonical.y===0,a=t&&e.canonical.y===(1<{i=to(+i,this.minZoom,this.maxZoom);let a={center:new An(t.lng,t.lat),zoom:i},o=this._helper._lngRange;!this._helper._renderWorldCopies&&o===null&&(o=[-179.9999999999,180-1e-10]);let s=this.tileSize*Vc(a.zoom),l=0,n=s,u=0,c=s,f=0,h=0,{x:d,y:p}=this.size;if(this._helper._latRange){let x=this._helper._latRange;l=cm(x[1])*s,n=cm(x[0])*s,n-ln&&(_=n-x)}if(o){let x=(u+c)/2,S=g;this._helper._renderWorldCopies&&(S=fh(g,x-s/2,x+s/2));let M=d/2;S-Mc&&(y=c-M)}if(y!==void 0||_!==void 0){let x=new Wr(y??g,_??m);a.center=lg(s,x).wrap()}return a},this.applyConstrain=(t,i)=>this._helper.applyConstrain(t,i),this._helper=new E2({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,i)=>this.defaultConstrain(t,i)},r),this._coveringTilesDetailsProvider=new WB}clone(){let r=new lU;return r.apply(this,!1),r}apply(r,t,i){this._helper.apply(r,t,i)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(r){let t=[new Bg(0,r)];if(this._helper._renderWorldCopies){let i=this.screenPointToMercatorCoordinate(new Wr(0,0)),a=this.screenPointToMercatorCoordinate(new Wr(this._helper._width,0)),o=this.screenPointToMercatorCoordinate(new Wr(this._helper._width,this._helper._height)),s=this.screenPointToMercatorCoordinate(new Wr(0,this._helper._height)),l=Math.floor(Math.min(i.x,a.x,o.x,s.x)),n=Math.floor(Math.max(i.x,a.x,o.x,s.x));for(let u=l-1;u<=n+1;u++)u!==0&&t.push(new Bg(u,r))}return t}getCameraFrustum(){return T2.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(r){let t=this.screenPointToLocation(this.centerPoint,r),i=r?r.getElevationForLngLat(t,this):0;this._helper.recalculateZoomAndCenter(i)}setLocationAtPoint(r,t,i=this.elevation){let a=i-this.elevation,o=this.screenPointToMercatorCoordinateAtZ(t,a),s=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,0),l=Qo.fromLngLat(r),n=new Qo(l.x-(o.x-s.x),l.y-(o.y-s.y));this.setCenter(n?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(r,t){return t?this.coordinatePoint(Qo.fromLngLat(r),t.getElevationForLngLat(r,this),this._pixelMatrix3D):this.coordinatePoint(Qo.fromLngLat(r))}screenPointToLocation(r,t){var i;return(i=this.screenPointToMercatorCoordinate(r,t))==null?void 0:i.toLngLat()}screenPointToLocationAtElevation(r,t){var i;return(i=this.screenPointToMercatorCoordinateAtZ(r,t-this.elevation))==null?void 0:i.toLngLat()}screenPointToMercatorCoordinate(r,t){if(t){let i=this.screenTerrainPointToMercatorCoordinate(r,t);if(i!=null)return i}return this.screenPointToMercatorCoordinateAtZ(r)}screenTerrainPointToMercatorCoordinate(r,t){let i=t.getCoverageIndex();if(!i)return null;let{near:a,far:o}=this.getRaySegmentFromPixel(r),s=this.worldSize,l=o[0]-a[0],n=o[1]-a[1],u=o[2]-a[2],c={index:i,exaggeration:t.exaggeration,near:a,dx:l,dy:n,dz:u,worldSize:s},f=0,h=1;if(u===0){if(a[2]>i.maxElevation||a[2]h)return null}let d=Math.hypot(l,n),p=to(Math.ceil(d*(h-f)/4),1,512),g=0,m=!i2(c,0);for(let y=0;y<=p;y++){let _=f+(h-f)*y/p;if(!m)m=!i2(c,_);else if(i2(c,_)){let{lo:v,hi:x}=pz(c,i2,g,_,.001/d),S=r2(c,v),M=r2(c,x),C=a[2]+v*u-S.elevation,w=a[2]+x*u-M.elevation,k=S.covered&&C>w?to(v+C*(x-v)/(C-w),v,x):x;return new Qo((a[0]+k*l)/s,(a[1]+k*n)/s,r2(c,k).elevation)}g=_}return null}getRaySegmentFromPixel(r){let t=[r.x,r.y,0,1],i=[r.x,r.y,1,1];pu(t,t,this._pixelMatrixInverse),pu(i,i,this._pixelMatrixInverse);let a=t[3],o=i[3],s=this.elevation;return{near:[t[0]/a,t[1]/a,t[2]/a+s],far:[i[0]/o,i[1]/o,i[2]/o+s]}}screenPointToMercatorCoordinateAtZ(r,t){let i=t||0,{near:a,far:o}=this.getRaySegmentFromPixel(r),s=a[2]===o[2]?0:(i+this.elevation-a[2])/(o[2]-a[2]);return new Qo(Zs.number(a[0],o[0],s)/this.worldSize,Zs.number(a[1],o[1],s)/this.worldSize,i)}coordinatePoint(r,t=0,i=this._pixelMatrix){let a=[r.x*this.worldSize,r.y*this.worldSize,t,1];return pu(a,a,i),new Wr(a[0]/a[3],a[1]/a[3])}getBounds(){let r=Math.max(0,this._helper._height/2-ug(this));return new wh().extend(this.screenPointToLocation(new Wr(0,r))).extend(this.screenPointToLocation(new Wr(this._helper._width,r))).extend(this.screenPointToLocation(new Wr(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new Wr(0,this._helper._height)))}isPointOnMapSurface(r,t){return t?this.screenTerrainPointToMercatorCoordinate(r,t)!=null:r.y>this.height/2-ug(this)}calculatePosMatrix(r,t=!1,i=!1){var a;let o=(a=r.key)!=null?a:fm(r.wrap,r.canonical.z,r.canonical.z,r.canonical.x,r.canonical.y),s=t?this._alignedPosMatrixCache:this._posMatrixCache;if(s.has(o)){let u=s.get(o);return i?u.f32:u.f64}let l=O6(r,this.worldSize);Wv(l,t?this._alignedProjMatrix:this._viewProjMatrix,l);let n={f64:l,f32:new Float32Array(l)};return s.set(o,n),i?n.f32:n.f64}calculateFogMatrix(r){let t=r.key,i=this._fogMatrixCacheF32;if(i.has(t))return i.get(t);let a=O6(r,this.worldSize);return Wv(a,this._fogMatrix,a),i.set(t,new Float32Array(a)),i.get(t)}calculateCenterFromCameraLngLatAlt(r,t,i,a){return this._helper.calculateCenterFromCameraLngLatAlt(r,t,i,a)}calculateCameraOptionsFromTo(r,t,i,a){let o=Qo.fromLngLat(r,t),s=Qo.fromLngLat(i,a),l=s.x-o.x,n=s.y-o.y,u=s.z-o.z,c=Math.hypot(l,n,u);if(c===0)throw Error("Can't calculate camera options with same From and To");let f=Math.hypot(l,n),h=Ku(this.cameraToCenterDistance/c/this.tileSize),d=Md(Math.atan2(l,-n)),p=Md(Math.acos(f/c));return p=u<0?90-p:90+p,{center:s.toLngLat(),elevation:a,zoom:h,pitch:p,bearing:d}}_calculateNearFarZIfNeeded(r,t,i){if(!this._helper.autoCalculateNearFarZ)return;let a=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),o=r-a*this._helper._pixelPerMeter/Math.cos(t),s=a<0?o:r,l=Math.PI/2+this.pitchInRadians,n=rl(this.fov)*(Math.abs(Math.cos(rl(this.roll)))*this.height+Math.abs(Math.sin(rl(this.roll)))*this.width)/this.height*(.5+i.y/this.height),u=Math.sin(n)*s/Math.sin(to(Math.PI-l-n,.01,Math.PI-.01)),c=ug(this),f=Math.atan(c/this._helper.cameraToCenterDistance),h=rl(90-Qp),d=f>h?2*f*(.5+i.y/(c*2)):h,p=Math.sin(d)*s/Math.sin(to(Math.PI-l-d,.01,Math.PI-.01)),g=Math.min(u,p);this._helper._farZ=(Math.cos(Math.PI/2-t)*g+s)*1.01,this._helper._nearZ=this._helper._height/50}_calcMatrices(){let r=this.centerOffset,t=Sd(this.worldSize,this.center),i=t.x,a=t.y,o=rl(Math.min(this.pitch,Qp)),s=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(o));this._calculateNearFarZIfNeeded(s,o,r);let l;l=new Float64Array(16),Mx(l,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),Kne(this._invProjMatrix,l),l[8]=-r.x*2/this._helper._width,l[9]=r.y*2/this._helper._height,this._projectionMatrix=O4(l),Xu(l,l,[1,-1,1]),Ol(l,l,[0,0,-this._helper.cameraToCenterDistance]),Bp(l,l,-this.rollInRadians),Yv(l,l,this.pitchInRadians),Bp(l,l,-this.bearingInRadians),Ol(l,l,[-i,-a,0]),this._mercatorMatrix=Xu([],l,[this.worldSize,this.worldSize,this.worldSize]),Xu(l,l,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=Wv(new Float64Array(16),this.clipSpaceToPixelsMatrix,l),Ol(l,l,[0,0,-this.elevation]),this._viewProjMatrix=l,this._invViewProjMatrix=E_([],l);let n=[0,0,-1,1];pu(n,n,this._invViewProjMatrix),this._cameraPosition=[n[0]/n[3],n[1]/n[3],n[2]/n[3]],this._fogMatrix=new Float64Array(16),Mx(this._fogMatrix,this.fovInRadians,this.width/this.height,s,this._helper._farZ),this._fogMatrix[8]=-r.x*2/this.width,this._fogMatrix[9]=r.y*2/this.height,Xu(this._fogMatrix,this._fogMatrix,[1,-1,1]),Ol(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),Bp(this._fogMatrix,this._fogMatrix,-this.rollInRadians),Yv(this._fogMatrix,this._fogMatrix,this.pitchInRadians),Bp(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),Ol(this._fogMatrix,this._fogMatrix,[-i,-a,0]),Xu(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),Ol(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=Wv(new Float64Array(16),this.clipSpaceToPixelsMatrix,l);let u=this._helper._width%2/2,c=this._helper._height%2/2,f=Math.cos(this.bearingInRadians),h=Math.sin(-this.bearingInRadians),d=i-Math.round(i)+f*u+h*c,p=a-Math.round(a)+f*c+h*u,g=new Float64Array(l);if(Ol(g,g,[d>.5?d-1:d,p>.5?p-1:p,0]),this._alignedProjMatrix=g,l=E_(new Float64Array(16),this._pixelMatrix),!l)throw Error("failed to invert matrix");this._pixelMatrixInverse=l,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let r=this.screenPointToMercatorCoordinate(new Wr(0,0)),t=[r.x*this.worldSize,r.y*this.worldSize,0,1];return pu(t,t,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this.cameraToCenterDistance/this.pixelsPerMeter+this.elevation}getCameraLngLat(){let r=V0(1,this.center.lat)*this.worldSize,t=this._helper.cameraToCenterDistance/r;return tF(this.center,this.elevation,this.pitch,this.bearing,t).toLngLat()}lngLatToCameraDepth(r,t){let i=Qo.fromLngLat(r),a=[i.x*this.worldSize,i.y*this.worldSize,t,1];return pu(a,a,this._viewProjMatrix),a[2]/a[3]}getProjectionData(r){let{overscaledTileID:t,aligned:i,applyTerrainMatrix:a}=r,o=this._helper.getMercatorTileCoordinates(t),s=t?this.calculatePosMatrix(t,i,!0):null,l;return l=t?.terrainRttPosMatrix32f&&a?t.terrainRttPosMatrix32f:s||_9(),{mainMatrix:l,tileMercatorCoords:o,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:l,clipAntimeridian:!1}}isLocationOccluded(r){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(r,t,i){return 1}transformLightDirection(r){return N4(r)}getRayDirectionFromPixel(r){throw Error("Not implemented.")}projectTileCoordinates(r,t,i,a){let o=this.calculatePosMatrix(i),s;a==null?(s=[r,t,0,1],JA(s,s,o)):(s=[r,t,a,1],pu(s,s,o));let l=s[3];return{point:new Wr(s[0]/l,s[1]/l),signedDistanceFromCamera:l,isOccluded:!1}}populateCache(r){for(let t of r)this.calculatePosMatrix(t)}getProjectionDataForCustomLayer(r=!0){let t=new Cu(0,0,0,0,0),i=this.getProjectionData({overscaledTileID:t,applyGlobeMatrix:r}),a=O6(t,this.worldSize);Wv(a,this._viewProjMatrix,a);let o=[Bi,Bi,this.worldSize/this._helper.pixelsPerMeter],s=F0();return Xu(s,a,o),ar(Nt({},i),{tileMercatorCoords:[0,0,1,1],fallbackMatrix:s,mainMatrix:s})}getFastPathSimpleProjectionMatrix(r){return this.calculatePosMatrix(r)}},Qg=class{get useGlobeControls(){return!1}handlePanInertia(e,r){let t=e.mag(),i=Math.abs(ug(r));return{easingOffset:e.mult(Math.min(i*.75/t,1)),easingCenter:r.center}}handleMapControlsRollPitchBearingZoom(e,r){e.bearingDelta&&r.setBearing(r.bearing+e.bearingDelta),e.pitchDelta&&r.setPitch(r.pitch+e.pitchDelta),e.rollDelta&&r.setRoll(r.roll+e.rollDelta),e.zoomDelta&&r.setZoom(r.zoom+e.zoomDelta)}handleMapControlsPan(e,r,t){e.around.distSqr(r.centerPoint)<.01||r.setLocationAtPoint(t,e.around,e.aroundElevation)}cameraForBoxAndBearing(e,r,t,i,a){return gz(e,r,t,i,a)}handleJumpToCenterZoom(e,r){let t=r.zoom===void 0?e.zoom:+r.zoom;e.zoom!==t&&e.setZoom(+r.zoom),r.center!==void 0&&e.setCenter(An.convert(r.center))}handleEaseTo(e,r){let t=e.zoom,i=e.padding,a={roll:e.roll,pitch:e.pitch,bearing:e.bearing},o={roll:r.roll===void 0?e.roll:r.roll,pitch:r.pitch===void 0?e.pitch:r.pitch,bearing:r.bearing===void 0?e.bearing:r.bearing},s=r.zoom!==void 0,l=!e.isPaddingEqual(r.padding),n=!1,u=s?+r.zoom:e.zoom,c=e.centerPoint.add(r.offsetAsPoint),f=e.screenPointToLocation(c),{center:h,zoom:d}=e.applyConstrain(An.convert(r.center||f),u??t);t2(e,h);let p=Sd(e.worldSize,f),g=Sd(e.worldSize,h).sub(p),m=Vc(d-t);return n=d!==t,{easeFunc:y=>{if(n&&e.setZoom(Zs.number(t,d,y)),w9(a,o)||mz({startEulerAngles:a,endEulerAngles:o,tr:e,k:y,useSlerp:a.roll!=o.roll}),l&&(e.interpolatePadding(i,r.padding,y),c=e.centerPoint.add(r.offsetAsPoint)),r.around)e.setLocationAtPoint(r.around,r.aroundPoint);else{let _=Vc(e.zoom-t),v=(d>t?Math.min(2,m):Math.max(.5,m))**(1-y),x=lg(e.worldSize,p.add(g.mult(y*v)).mult(_));e.setLocationAtPoint(e.renderWorldCopies?x.wrap():x,c)}},isZooming:n,elevationCenter:h}}handleFlyTo(e,r){let t=r.zoom!==void 0,i=e.zoom,a=e.applyConstrain(An.convert(r.center||r.locationAtOffset),t?+r.zoom:i),o=a.center,s=a.zoom;t2(e,o);let l=e.worldSize,n=Sd(l,r.locationAtOffset),u=Sd(l,o).sub(n),c=u.mag(),f=Vc(s-i),h=r.minZoom===void 0?e.minZoom:+r.minZoom,d=Math.max(h,e.minZoom),p=Math.min(d,i,s),g=e.applyConstrain(o,p).zoom;return{easeFunc:(m,y,_,v)=>{e.setZoom(m===1?s:i+Ku(y));let x=m===1?o:lg(l,n.add(u.mult(_)));e.setLocationAtPoint(e.renderWorldCopies?x.wrap():x,v)},scaleOfZoom:f,targetCenter:o,scaleOfMinZoom:Vc(g-i),pixelPathLength:c}}},JB=()=>KB||(KB=new vu({type:new Ha(mi.projection.type,"type")})),k2=new wb({fill:new Pd(128,2),line:new Pd(512,0),tile:new Pd(128,32),stencil:new Pd(128,1),circle:3}),qM=class{constructor(){this._tileMeshCache={}}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return id.projectionGlobe}get vertexShaderPreludeCode(){return id.projectionMercator.vertexSource}get subdivisionGranularity(){return k2}get useGlobeControls(){return!0}destroy(){}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?"b":""}${e.extendToNorthPole?"n":""}${e.extendToSouthPole?"s":""}`}getMeshFromTileID(e,r,t,i,a){let o=(a==="stencil"?k2.stencil:k2.tile).getGranularityForZoomLevel(r.z),s=r.y===0&&i,l=r.y===(1<0}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}getMeshFromTileID(e,r,t,i,a){return this.currentProjection.getMeshFromTileID(e,r,t,i,a)}setProjection(e){this._transitionable.setValue("type",e?.type||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}},C2=Math.PI*.98,QB=class{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;let e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,r,t,i){let a=`${e.z}_${e.x}_${e.y}_${i?.terrain?"t":""}_${Math.round(t)}`,o=this._cache.get(a);if(o)return o;let s=this._cachePrevious.get(a);if(s)return this._cache.set(a,s),s;let l=this._boundingVolumeFactory(e,r,t,i);return this._cache.set(a,l),this._hadAnyChanges=!0,l}},D2=class uE{constructor(r,t,i,a){this.min=i,this.max=a,this.points=r,this.planes=t}static fromAabb(r,t){let i=[];for(let a=0;a<8;a++)i.push([(a>>0&1)==1?t[0]:r[0],(a>>1&1)==1?t[1]:r[1],(a>>2&1)==1?t[2]:r[2]]);return new uE(i,[[-1,0,0,t[0]],[1,0,0,-r[0]],[0,-1,0,t[1]],[0,1,0,-r[1]],[0,0,-1,t[2]],[0,0,1,-r[2]]],r,t)}static fromCenterSizeAngles(r,t,i){let a=q4([],i[0],i[1],i[2]),o=j4([],[t[0],0,0],a),s=j4([],[0,t[1],0],a),l=j4([],[0,0,t[2]],a),n=[...r],u=[...r];for(let f=0;f<8;f++)for(let h=0;h<3;h++){let d=r[h]+o[h]*((f>>0&1)==1?1:-1)+s[h]*((f>>1&1)==1?1:-1)+l[h]*((f>>2&1)==1?1:-1);n[h]=Math.min(n[h],d),u[h]=Math.max(u[h],d)}let c=[];for(let f=0;f<8;f++){let h=[...r];uh(h,h,Ws([],o,(f>>0&1)==1?1:-1)),uh(h,h,Ws([],s,(f>>1&1)==1?1:-1)),uh(h,h,Ws([],l,(f>>2&1)==1?1:-1)),c.push(h)}return new uE(c,[[...o,-Kl(o,c[0])],[...s,-Kl(s,c[0])],[...l,-Kl(l,c[0])],[-o[0],-o[1],-o[2],-Kl(o,c[7])],[-s[0],-s[1],-s[2],-Kl(s,c[7])],[-l[0],-l[1],-l[2],-Kl(l,c[7])]],n,u)}intersectsFrustum(r){let t=!0,i=this.points.length,a=this.planes.length,o=r.planes.length,s=r.points.length;for(let l=0;l=0&&u++}if(u===0)return 0;u=0&&u++}if(u===0)return 0}return 1}intersectsPlane(r){let t=this.points.length,i=0;for(let a=0;a=0&&i++}return i===t?2:i===0?0:1}},eO=class{constructor(){this._boundingVolumeCache=new QB(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,r,t,i){let a=1<4}allowWorldCopies(){return!1}getTileBoundingVolume(e,r,t,i){return this._boundingVolumeCache.getTileBoundingVolume(e,r,t,i)}_computeTileBoundingVolume(e,r,t,i){var a,o;let s=Math.min(0,t),l=Math.max(0,t);if(i?.terrain){let n=new Cu(e.z,r,e.z,e.x,e.y),u=i.terrain.getMinMaxElevation(n);s=(a=u.minElevation)!=null?a:s,l=Math.max((o=u.maxElevation)!=null?o:l,l)}if(s/=mc,l/=mc,s+=1,l+=1,e.z<=0)return D2.fromAabb([-l,-l,-l],[l,l,l]);if(e.z===1)return D2.fromAabb([e.x===0?-l:0,e.y===0?0:-l,-l],[e.x===0?0:l,e.y===0?l:0,l]);{let n=[i0(0,0,e.x,e.y,e.z),i0(Bi,0,e.x,e.y,e.z),i0(Bi,Bi,e.x,e.y,e.z),i0(0,Bi,e.x,e.y,e.z)],u=[];for(let A of n)u.push(Ws([],A,l));if(l!==s)for(let A of n)u.push(Ws([],A,s));e.y===0&&u.push([0,1,0]),e.y===(1<=(1<{let a=to(t.lat,-Yh,Yh),o=to(+i,this.minZoom+Lu(0,a),this.maxZoom);return{center:new An(t.lng,a),zoom:o}},this.applyConstrain=(t,i)=>this._helper.applyConstrain(t,i),this._helper=new E2({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,i)=>this.defaultConstrain(t,i)},r),this._coveringTilesDetailsProvider=new eO}clone(){let r=new uU;return r.apply(this,!1),r}apply(r,t){this._helper.apply(r,t)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixF64}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let r=fs();return r[0]=this._cameraPosition[0],r[1]=this._cameraPosition[1],r[2]=this._cameraPosition[2],r}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(r){let{overscaledTileID:t,applyGlobeMatrix:i}=r,a=this._helper.getMercatorTileCoordinates(t);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:a,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!i,fallbackMatrix:this._globeViewProjMatrix32f,clipAntimeridian:t?.canonical.z===0}}_computeClippingPlane(r){let t=this.pitchInRadians,i=this.cameraToCenterDistance/r,a=Math.sin(t)*i,o=Math.cos(t)*i+1,s=1/Math.sqrt(a*a+o*o)*1,l=-a,n=o,u=Math.sqrt(l*l+n*n);l/=u,n/=u;let c=[0,l,n];U4(c,c,[0,0,0],-this.bearingInRadians),N1(c,c,[0,0,0],-1*this.center.lat*Math.PI/180),Xv(c,c,[0,0,0],this.center.lng*Math.PI/180);let f=1/np(c);return Ws(c,c,f),[...c,-s*f]}isLocationOccluded(r){return!this.isSurfacePointVisible(ru(r))}transformLightDirection(r){let t=this._helper._center.lng*Math.PI/180,i=this._helper._center.lat*Math.PI/180,a=Math.cos(i),o=[Math.sin(t)*a,Math.sin(i),Math.cos(t)*a],s=[o[2],0,-o[0]],l=[0,0,0];uf(l,s,o),qc(s,s),qc(l,l);let n=[s[0]*r[0]+l[0]*r[1]+o[0]*r[2],s[1]*r[0]+l[1]*r[1]+o[1]*r[2],s[2]*r[0]+l[2]*r[1]+o[2]*r[2]],u=[0,0,0];return qc(u,n),u}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(r,t,i){let a=eF(r,t,i.canonical),o=ooe(a.x,a.y);return this.getCircleRadiusCorrection()/Math.cos(o[1])}projectTileCoordinates(r,t,i,a){let o=i.canonical,s=i0(r,t,o.x,o.y,o.z),l=1+(a??0)/mc,n=s[0]*l,u=s[1]*l,c=s[2]*l,f=[n,u,c,1];pu(f,f,this._globeViewProjMatrixF64);let h;if(l<=1){let d=this._cachedClippingPlane;h=d[0]*s[0]+d[1]*s[1]+d[2]*s[2]+d[3]<0}else h=this._isLineOfSightBlocked(n,u,c);return{point:new Wr(f[0]/f[3],f[1]/f[3]),signedDistanceFromCamera:f[3],isOccluded:h}}_isLineOfSightBlocked(r,t,i){let a=this._cameraPosition,o=r-a[0],s=t-a[1],l=i-a[2],n=o*o+s*s+l*l;if(n===0)return!1;let u=to(-(a[0]*o+a[1]*s+a[2]*l)/n,0,1),c=a[0]+u*o,f=a[1]+u*s,h=a[2]+u*l;return c*c+f*f+h*h<1}_calcMatrices(){let r=jm(this.worldSize,this.center.lat),t=F0();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+r*2),Mx(t,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let i=this.centerOffset;t[8]=-i.x*2/this._helper._width,t[9]=i.y*2/this._helper._height,this._projectionMatrix=O4(t),this._globeProjMatrixInverted=F0(),E_(this._globeProjMatrixInverted,t),Ol(t,t,[0,0,-this.cameraToCenterDistance]),Bp(t,t,this.rollInRadians),Yv(t,t,-this.pitchInRadians),Bp(t,t,this.bearingInRadians),Ol(t,t,[0,0,-r]);let a=fs();a[0]=r,a[1]=r,a[2]=r,Yv(t,t,this.center.lat*Math.PI/180),c9(t,t,-this.center.lng*Math.PI/180),Xu(t,t,a),this._globeViewProjMatrixF64=t,this._globeViewProjMatrix32f=new Float32Array(t),this._globeViewProjMatrixF64Inverted=F0(),E_(this._globeViewProjMatrixF64Inverted,t);let o=fs();this._cameraPosition=fs(),this._cameraPosition[2]=this.cameraToCenterDistance/r,U4(this._cameraPosition,this._cameraPosition,o,-this.rollInRadians),N1(this._cameraPosition,this._cameraPosition,o,this.pitchInRadians),U4(this._cameraPosition,this._cameraPosition,o,-this.bearingInRadians),uh(this._cameraPosition,this._cameraPosition,[0,0,1]),N1(this._cameraPosition,this._cameraPosition,o,-this.center.lat*Math.PI/180),Xv(this._cameraPosition,this._cameraPosition,o,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(r);let s=O4(this._globeViewProjMatrixF64Inverted);Xu(s,s,[1,1,-1]),this._cachedFrustum=T2.fromInvProjectionMatrix(s,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(r){To("calculateFogMatrix is not supported on globe projection.");let t=F0();return $h(t),t}getVisibleUnwrappedCoordinates(r){return[new Bg(0,r)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(r){if(r){To("terrain is not fully supported on vertical perspective projection.");return}this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return(np(this._cameraPosition)-1)*mc}getCameraLngLat(){let r=fs();return qc(r,this._cameraPosition),Vg(r)}lngLatToCameraDepth(r,t){let i=ru(r);Ws(i,i,1+t/mc);let a=Op();return pu(a,[i[0],i[1],i[2],1],this._globeViewProjMatrixF64),a[2]/a[3]}populateCache(r){}getBounds(){let r=this.width*.5,t=this.height*.5,i=[new Wr(0,0),new Wr(r,0),new Wr(this.width,0),new Wr(this.width,t),new Wr(this.width,this.height),new Wr(r,this.height),new Wr(0,this.height),new Wr(0,t)],a=[];for(let f of i)a.push(this.unprojectScreenPoint(f));let o=0,s=0,l=0,n=0,u=this.center;for(let f of a){let h=Df(u.lng,f.lng),d=Df(u.lat,f.lat);ho&&(o=h),dl&&(l=d)}let c=[u.lng+s,u.lat+n,u.lng+o,u.lat+l];return this.isSurfacePointOnScreen([0,1,0])&&(c[3]=90,c[0]=-180,c[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(c[1]=-90,c[0]=-180,c[2]=180),new wh(c)}calculateCenterFromCameraLngLatAlt(r,t,i,a){return this._helper.calculateCenterFromCameraLngLatAlt(r,t,i,a)}calculateCameraOptionsFromTo(r,t,i,a){let o=An.convert(i),s=ru(An.convert(r));Ws(s,s,1+t/mc);let l=ru(o),n=Ws(fs(),l,1+a/mc),u=d9(fs(),s,l),c=np(u);if(c=-_&&g<=_,x=y>=-_&&y<=_,S,M;if(v&&x){let A=this.center.lng*Math.PI/180,b=this.center.lat*Math.PI/180,E=F_(h,A),T=F_(g,b),F=F_(d,A),D=F_(y,b);E+T=0}isSurfacePointOnScreen(r){if(!this.isSurfacePointVisible(r))return!1;let t=Op();return pu(t,[...r,1],this._globeViewProjMatrixF64),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3],t[0]>-1&&t[0]<1&&t[1]>-1&&t[1]<1&&t[2]>-1&&t[2]<1}unprojectScreenPoint(r){let t=this._cameraPosition,i=this.getRayDirectionFromPixel(r),a=n2(t,i);if(a){let c=fs();uh(c,t,[i[0]*a.tMin,i[1]*a.tMin,i[2]*a.tMin]);let f=fs();return qc(f,c),Vg(f)}let o=this._cachedClippingPlane,s=o[0]*i[0]+o[1]*i[1]+o[2]*i[2],l=-G4(o,t)/s,n=fs();if(l>0)uh(n,t,[i[0]*l,i[1]*l,i[2]*l]);else{let c=fs();uh(c,t,[i[0]*2,i[1]*2,i[2]*2]);let f=G4(this._cachedClippingPlane,c);Ed(n,c,[this._cachedClippingPlane[0]*f,this._cachedClippingPlane[1]*f,this._cachedClippingPlane[2]*f])}let u=hoe(o);return Vg(doe(u.center,u.radius,n))}getProjectionDataForCustomLayer(r=!0){let t=this.getProjectionData({overscaledTileID:new Cu(0,0,0,0,0),applyGlobeMatrix:r});return t.tileMercatorCoords=[0,0,1,1],t}getFastPathSimpleProjectionMatrix(r){}},$M=class cU{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(r){this._helper.setMinZoom(r)}setMaxZoom(r){this._helper.setMaxZoom(r)}setMinPitch(r){this._helper.setMinPitch(r)}setMaxPitch(r){this._helper.setMaxPitch(r)}setRenderWorldCopies(r){this._helper.setRenderWorldCopies(r)}setBearing(r){this._helper.setBearing(r)}setPitch(r){this._helper.setPitch(r)}setRoll(r){this._helper.setRoll(r)}setFov(r){this._helper.setFov(r)}setZoom(r){this._helper.setZoom(r)}setCenter(r){this._helper.setCenter(r)}setElevation(r){this._helper.setElevation(r)}setMinElevationForCurrentTile(r){this._helper.setMinElevationForCurrentTile(r)}setPadding(r){this._helper.setPadding(r)}interpolatePadding(r,t,i){this._helper.interpolatePadding(r,t,i)}isPaddingEqual(r){return this._helper.isPaddingEqual(r)}resize(r,t,i=!0){this._helper.resize(r,t,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(r){this._helper.setMaxBounds(r)}setConstrainOverride(r){this._helper.setConstrainOverride(r)}overrideNearFarZ(r,t){this._helper.overrideNearFarZ(r,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(r){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),r)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(r){this._globeness=r,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(r){this._globeness=1,this.defaultConstrain=(t,i)=>this.currentTransform.defaultConstrain(t,i),this.applyConstrain=(t,i)=>this._helper.applyConstrain(t,i),this._helper=new E2({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,i)=>this.defaultConstrain(t,i)},r),this._globeness=1,this._mercatorTransform=new Jg,this._verticalPerspectiveTransform=new HM}clone(){let r=new cU;return r._globeness=this._globeness,r.apply(this,!1),r}apply(r,t){this._helper.apply(r,t),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(r){let t=this._mercatorTransform.getProjectionData(r),i=this._verticalPerspectiveTransform.getProjectionData(r);return{mainMatrix:this.isGlobeRendering?i.mainMatrix:t.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:r.applyGlobeMatrix?this._globeness:0,fallbackMatrix:t.fallbackMatrix,clipAntimeridian:i.clipAntimeridian}}isLocationOccluded(r){return this.currentTransform.isLocationOccluded(r)}transformLightDirection(r){return this.currentTransform.transformLightDirection(r)}getPixelScale(){return Zv(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return Zv(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(r,t,i){let a=this._mercatorTransform.getPitchedTextCorrection(r,t,i),o=this._verticalPerspectiveTransform.getPitchedTextCorrection(r,t,i);return Zv(a,o,this._globeness)}projectTileCoordinates(r,t,i,a){return this.currentTransform.projectTileCoordinates(r,t,i,a)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(r){return this.currentTransform.calculateFogMatrix(r)}getVisibleUnwrappedCoordinates(r){return this.currentTransform.getVisibleUnwrappedCoordinates(r)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(r){this.currentTransform.recalculateZoomAndCenter(r)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this.currentTransform.getCameraAltitude()}getCameraLngLat(){return this.currentTransform.getCameraLngLat()}lngLatToCameraDepth(r,t){return this.currentTransform.lngLatToCameraDepth(r,t)}populateCache(r){this._mercatorTransform.populateCache(r),this._verticalPerspectiveTransform.populateCache(r)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(r,t,i,a){return this._helper.calculateCenterFromCameraLngLatAlt(r,t,i,a)}calculateCameraOptionsFromTo(r,t,i,a){return this.currentTransform.calculateCameraOptionsFromTo(r,t,i,a)}setLocationAtPoint(r,t,i){if(!this.isGlobeRendering){this._mercatorTransform.setLocationAtPoint(r,t,i),this.apply(this._mercatorTransform,!1);return}this._verticalPerspectiveTransform.setLocationAtPoint(r,t,i),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(r,t){return this.currentTransform.locationToScreenPoint(r,t)}screenPointToMercatorCoordinate(r,t){return this.currentTransform.screenPointToMercatorCoordinate(r,t)}screenTerrainPointToMercatorCoordinate(r,t){return this.currentTransform.screenTerrainPointToMercatorCoordinate(r,t)}screenPointToLocation(r,t){return this.currentTransform.screenPointToLocation(r,t)}screenPointToLocationAtElevation(r,t){return this.currentTransform.screenPointToLocationAtElevation(r,t)}isPointOnMapSurface(r,t){return this.currentTransform.isPointOnMapSurface(r,t)}getRayDirectionFromPixel(r){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(r)}getProjectionDataForCustomLayer(r=!0){let t=this._mercatorTransform.getProjectionDataForCustomLayer(r);if(!this.isGlobeRendering)return t;let i=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(r);return i.fallbackMatrix=t.mainMatrix,i.projectionTransition=this._globeness,i}getFastPathSimpleProjectionMatrix(r){return this.currentTransform.getFastPathSimpleProjectionMatrix(r)}},WM=class Tp{get useGlobeControls(){return!0}handlePanInertia(r,t){let i=voe(r,t);return Math.abs(i.lng-t.center.lng)>180&&(i.lng=t.center.lng+179.5*Math.sign(i.lng-t.center.lng)),{easingCenter:i,easingOffset:new Wr(0,0)}}handleMapControlsRollPitchBearingZoom(r,t){let i=r.around,a=t.screenPointToLocation(i);r.bearingDelta&&t.setBearing(t.bearing+r.bearingDelta),r.pitchDelta&&t.setPitch(t.pitch+r.pitchDelta),r.rollDelta&&t.setRoll(t.roll+r.rollDelta);let o=t.zoom;r.zoomDelta&&t.setZoom(t.zoom+r.zoomDelta);let s=t.zoom-o;if(s===0)return;let l=Df(t.center.lng,a.lng),n=l/(Math.abs(l/180)+1),u=Df(t.center.lat,a.lat),c=t.getRayDirectionFromPixel(i),f=t.cameraPosition,h=Kl(f,c)*-1,d=fs();uh(d,f,[c[0]*h,c[1]*h,c[2]*h]);let p=np(d),g=p-1,m=Math.exp(-Math.max(g-.3,0)*.5),y=P_(p,.95,.999,0,1),_=jm(t.worldSize,t.center.lat)/Math.min(t.width,t.height),v=P_(_,.9,.5,1,.25),x=Math.min(m,Zv(1,v,y)),S=(1-Vc(-s))*x,M=t.center.lat,C=t.zoom,w=new An(t.center.lng+n*S,to(t.center.lat+u*S,-Yh,Yh));t.setLocationAtPoint(a,i);let k=t.center,A=P_(Math.abs(l),45,85,0,1),b=Math.max(A,y)**.25,E=Df(k.lng,w.lng),T=Df(k.lat,w.lat);t.setCenter(new An(k.lng+E*b,k.lat+T*b).wrap()),t.setZoom(C+Lu(M,t.center.lat))}handleMapControlsPan(r,t,i){r.panDelta&&coe(t,i,t.isPointOnMapSurface(r.around)?r.around:t.centerPoint,r.panDelta)}cameraForBoxAndBearing(r,t,i,a,o){let s=gz(r,t,i,a,o),l=t.left/o.width*2-1,n=(o.width-t.right)/o.width*2-1,u=t.top/o.height*-2+1,c=(o.height-t.bottom)/o.height*-2+1,f=Df(i.getWest(),i.getEast())<0,h=f?i.getEast():i.getWest(),d=f?i.getWest():i.getEast(),p=Math.max(i.getNorth(),i.getSouth()),g=Math.min(i.getNorth(),i.getSouth()),m=h+Df(h,d)*.5,y=p+Df(p,g)*.5,_=o.clone();_.setCenter(s.center),_.setBearing(s.bearing),_.setPitch(0),_.setRoll(0),_.setZoom(s.zoom);let v=_.modelViewProjectionMatrix,x=[ru(i.getNorthWest()),ru(i.getNorthEast()),ru(i.getSouthWest()),ru(i.getSouthEast()),ru(new An(d,y)),ru(new An(h,y)),ru(new An(m,p)),ru(new An(m,g))],S=ru(s.center),M=1/0;for(let C of x)l<0&&(M=Tp.getLesserNonNegativeNonNull(M,Tp.solveVectorScale(C,S,v,"x",l))),n>0&&(M=Tp.getLesserNonNegativeNonNull(M,Tp.solveVectorScale(C,S,v,"x",n))),u>0&&(M=Tp.getLesserNonNegativeNonNull(M,Tp.solveVectorScale(C,S,v,"y",u))),c<0&&(M=Tp.getLesserNonNegativeNonNull(M,Tp.solveVectorScale(C,S,v,"y",c)));if(!Number.isFinite(M)||M===0){vz();return}return s.zoom=Math.min(_.zoom+Ku(M),r.maxZoom),s}handleJumpToCenterZoom(r,t){let i=r.center.lat,a=r.applyConstrain(t.center?An.convert(t.center):r.center,r.zoom).center;r.setCenter(a.wrap());let o=t.zoom===void 0?r.zoom+Lu(i,a.lat):+t.zoom;r.zoom!==o&&r.setZoom(o)}handleEaseTo(r,t){let i=r.zoom,a=r.center,o=r.padding,s={roll:r.roll,pitch:r.pitch,bearing:r.bearing},l={roll:t.roll===void 0?r.roll:t.roll,pitch:t.pitch===void 0?r.pitch:t.pitch,bearing:t.bearing===void 0?r.bearing:t.bearing},n=t.zoom!==void 0,u=!r.isPaddingEqual(t.padding),c=!1,f=t.center?An.convert(t.center):a,h=r.applyConstrain(f,i).center;t2(r,h);let d=r.clone();d.setCenter(h),d.setZoom(n?+t.zoom:i+Lu(a.lat,f.lat)),d.setBearing(t.bearing);let p=new Wr(to(r.centerPoint.x+t.offsetAsPoint.x,0,r.width),to(r.centerPoint.y+t.offsetAsPoint.y,0,r.height));d.setLocationAtPoint(h,p);let g=(t.offset&&t.offsetAsPoint.mag())>0?d.center:h,m=n?+t.zoom:i+Lu(a.lat,g.lat),y=i+Lu(a.lat,0),_=m+Lu(g.lat,0),v=Df(a.lng,g.lng),x=Df(a.lat,g.lat),S=Vc(_-y);return c=m!==i,{easeFunc:M=>{if(w9(s,l)||mz({startEulerAngles:s,endEulerAngles:l,tr:r,k:M,useSlerp:s.roll!=l.roll}),u&&r.interpolatePadding(o,t.padding,M),t.around)To("Easing around a point is not supported under globe projection."),r.setLocationAtPoint(t.around,t.aroundPoint);else{let C=M*(_>y?Math.min(2,S):Math.max(.5,S))**(1-M),w=bz(a,v,x,C);r.setCenter(w.wrap())}if(c){let C=Zs.number(y,_,M)+Lu(0,r.center.lat);r.setZoom(C)}},isZooming:c,elevationCenter:g}}handleFlyTo(r,t){let i=t.zoom!==void 0,a=r.center,o=r.zoom,s=r.padding,l=!r.isPaddingEqual(t.padding),n=r.applyConstrain(An.convert(t.center||t.locationAtOffset),o).center,u=i?+t.zoom:r.zoom+Lu(r.center.lat,n.lat),c=r.clone();c.setCenter(n),c.setZoom(u),c.setBearing(t.bearing);let f=new Wr(to(r.centerPoint.x+t.offsetAsPoint.x,0,r.width),to(r.centerPoint.y+t.offsetAsPoint.y,0,r.height));c.setLocationAtPoint(n,f);let h=c.center;t2(r,h);let d=noe(r,a,h),p=o+Lu(a.lat,0),g=u+Lu(h.lat,0),m=Vc(g-p),y=typeof t.minZoom=="number"?+t.minZoom:r.minZoom,_=Math.max(y,r.minZoom)+Lu(h.lat,0),v=Math.min(_,p,g)+Lu(0,h.lat),x=r.applyConstrain(h,v).zoom+Lu(h.lat,0),S=Vc(x-p),M=Df(a.lng,h.lng),C=Df(a.lat,h.lat);return{easeFunc:(w,k,A,b)=>{let E=bz(a,M,C,A);l&&r.interpolatePadding(s,t.padding,w);let T=w===1?h:E;r.setCenter(T.wrap());let F=p+Ku(k);r.setZoom(w===1?u:F+Lu(0,T.lat))},scaleOfZoom:m,targetCenter:h,scaleOfMinZoom:S,pixelPathLength:d}}static solveVectorScale(r,t,i,a,o){let s=o,l=a==="x"?[i[0],i[4],i[8],i[12]]:[i[1],i[5],i[9],i[13]],n=[i[3],i[7],i[11],i[15]],u=r[0]*l[0]+r[1]*l[1]+r[2]*l[2],c=r[0]*n[0]+r[1]*n[1]+r[2]*n[2],f=t[0]*l[0]+t[1]*l[1]+t[2]*l[2],h=t[0]*n[0]+t[1]*n[1]+t[2]*n[2],d=(f+l[3]-s*h-s*n[3])/(f-u-s*h+s*c);return f+s*c===u+s*h||n[3]*(u-f)+l[3]*(h-c)+u*h===f*c?null:d}static getLesserNonNegativeNonNull(r,t){return t!==null&&t>=0&&t{for(let o in this.tileManagers){let s=this.tileManagers[o].getSource().type;(s==="vector"||s==="geojson")&&this.tileManagers[o].reload()}},this.map=e,this.dispatcher=new bM(VA(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(o,s)=>this.getGlyphs(o,s)),this.dispatcher.registerMessageHandler("GI",(o,s)=>this.getImages(o,s)),this.dispatcher.registerMessageHandler("GDA",(o,s)=>this.getDashes(o,s)),this.imageManager=new Kz,this.imageManager.setEventedParent(this),this.imageManager.setMissingImageResolver(e._missingStyleImageResolver),this.patternAtlas=new Jz(this.imageManager);let a=((t=e._container)==null?void 0:t.lang)||typeof document<"u"&&((i=document.documentElement)==null?void 0:i.lang)||void 0;this.glyphManager=new nB(e._requestManager,r.localIdeographFontFamily,a),this.lineAtlas=new hB(256,512),this.crossTileSymbolIndex=new zM,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",X4()),Ug().on(x2,this._rtlPluginLoaded),this.on("data",o=>{if(o.dataType!=="source"||o.sourceDataType!=="metadata")return;let s=this.tileManagers[o.sourceId];if(!s)return;let l=s.getSource();if(l?.vectorLayerIds)for(let n in this._layers){let u=this._layers[n];u.source===l.id&&this._validateLayer(u)}})}_setInitialValues(){var e;this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new jx,this._imagesListDirty=!1,this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this._symbolPlacementTriggered=!1,this._placedProjectionTransition=void 0,this.crossTileSymbolIndex=new(((e=this.crossTileSymbolIndex)==null?void 0:e.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(e,r){var t,i,a;this._checkLoaded();let o=r===null?(a=(i=(t=this.stylesheet.state)==null?void 0:t[e])==null?void 0:i.default)!=null?a:null:r;if(Ad(o,this._globalState[e]))return this;this._globalState[e]=o,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();let r=[];for(let t in e)Ad(this._globalState[t],e[t].default)||(r.push(t),this._globalState[t]=e[t].default);this._applyGlobalStateChanges(r)}_applyGlobalStateChanges(e){if(e.length===0)return;let r=new Set,t={};for(let i of e){t[i]=this._globalState[i];for(let a in this._layers){let o=this._layers[a],s=o.getLayoutAffectingGlobalStateRefs(),l=o.getPaintAffectingGlobalStateRefs(),n=o.getVisibilityAffectingGlobalStateRefs();if(s.has(i)&&r.add(o.source),l.has(i))for(let{name:u,value:c}of l.get(i))this._updatePaintProperty(o,u,c);n?.has(i)&&(o.recalculateVisibility(),this._updateLayer(o))}}this.dispatcher.broadcast("UGS",t);for(let i in this.tileManagers)r.has(i)&&(this._reloadSource(i),this._changed=!0)}loadURL(e){return Xr(this,arguments,function*(r,t={},i){this.fire(new Nf("dataloading")),t.validate=typeof t.validate!="boolean"||t.validate,this._loadStyleRequest=new AbortController;let a=this._loadStyleRequest;try{let o=yield this.map._requestManager.transformRequest(r,"Style");Y4(a.signal);let s=yield mg(o,a);this._loadStyleRequest===a&&(this._loadStyleRequest=null),this._load(s.data,t,i)}catch(o){this._loadStyleRequest===a&&(this._loadStyleRequest=null),o&&!a.signal.aborted&&this.fire(new Ln(Zu(o)))}})}loadJSON(e,r={},t){this.fire(new Nf("dataloading")),this._frameRequest=new AbortController,yc.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,r.validate=r.validate!==!1,this._load(e,r,t)}).catch(()=>{})}loadEmpty(){this.fire(new Nf("dataloading")),this._load(tO,{validate:!1})}_load(e,r,t){var i,a,o;let s=r.transformStyle?r.transformStyle(t,e):e;if(!(r.validate&&AL(this,s))){s=Nt({},s),this._loaded=!0,this.stylesheet=s;for(let l in s.sources)this.addSource(l,s.sources[l],{validate:!1});s.sprite?this._loadSprite(s.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(s.glyphs),this.glyphManager.setFontFaces(s["font-faces"]),this._createLayers(),this.light=new lB((i=this.stylesheet.light)!=null?i:{},this._globalState),this._setProjectionInternal(((a=this.stylesheet.projection)==null?void 0:a.type)||"mercator"),this.sky=new fB(this.stylesheet.sky,this._globalState),this.map.setTerrain((o=this.stylesheet.terrain)!=null?o:null,{validate:!1}),this.fire(new Nf("data")),this.fire(new h2)}}_createLayers(){var e,r,t;let i=L5(this.stylesheet.layers);this.setGlobalState((e=this.stylesheet.state)!=null?e:null),this.dispatcher.broadcast("SL",i),this._order=i.map(a=>a.id),this._layers={},this._serializedLayers=null;for(let a of i){let o=$6(a,this._globalState);if(o.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=o,Gx(o)&&this.tileManagers[o.source]){let s=(t=(r=a.paint)==null?void 0:r["raster-fade-duration"])!=null?t:o.paint.get("raster-fade-duration");this.tileManagers[o.source].setRasterFadeDuration(s)}}}_loadSprite(e,r=!1,t=void 0){return Xr(this,null,function*(){this.imageManager.setLoaded(!1);let i=new AbortController;this._spriteRequest=i;let a;try{let o=yield rne(e,this.map._requestManager,this.map.getPixelRatio(),i);if(!o)return;for(let s in o){let{loaded:l,removed:n}=this.imageManager.setSpriteImages(s,o[s]);this._markImagesChanged(n),r&&this._markImagesChanged(l)}}catch(o){a=o,i.signal.aborted||this.fire(new Ln(a))}finally{this._spriteRequest=null,this.imageManager.setLoaded(!0),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this.imageManager.listImages()),this.fire(new Nf("data")),t?.(a)}})}_unloadSprite(){this._markImagesChanged(this.imageManager.removeAllSpriteImages()),this._imagesListDirty=!0,this._changed=!0,this.fire(new Nf("data"))}_validateLayer(e){let r=this.tileManagers[e.source];if(!r)return;let t=e.sourceLayer;if(!t)return;let i=r.getSource();(i.type==="geojson"||i.vectorLayerIds&&!i.vectorLayerIds.includes(t))&&this.fire(new Ln(Error(`Source layer "${t}" does not exist on source "${i.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.tileManagers)if(!this.tileManagers[e].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(e,r=!1){let t=this._serializedAllLayers();if(!e||e.length===0)return Object.values(r?cf(t):t);let i=[];for(let a of e)if(t[a]){let o=r?cf(t[a]):t[a];i.push(o)}return i}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};let r=Object.keys(this._layers);for(let t of r){let i=this._layers[t];i.type!=="custom"&&(e[t]=i.serialize())}return e}hasTransitions(){var e,r,t;if((e=this.light)!=null&&e.hasTransition()||(r=this.sky)!=null&&r.hasTransition()||(t=this.projection)!=null&&t.hasTransition())return!0;for(let i in this.tileManagers)if(this.tileManagers[i].hasTransition())return!0;for(let i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading.")}update(e){if(!this._loaded)return;let r=this._changed;if(r){this._imagesListDirty&&(this._imagesListDirty=(this.dispatcher.broadcast("SI",this.imageManager.listImages()),!1));let a=Object.keys(this._updatedLayers),o=Object.keys(this._removedLayers);(a.length||o.length)&&this._updateWorkerLayers(a,o);for(let s in this._updatedSources){let l=this._updatedSources[s];if(l==="reload")this._reloadSource(s);else if(l==="clear")this._clearSource(s);else throw Error(`Invalid action ${l}`)}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let s in this._updatedPaintProps)this._layers[s].updateTransitions(e);this._resetUpdates()}let t={};for(let a in this.tileManagers){let o=this.tileManagers[a];t[a]=o.used,o.used=!1}let i=this.imageManager.listImages();for(let a of this._order){let o=this._layers[a];o.recalculate(e,i),!o.isHidden(e.zoom)&&o.source&&(this.tileManagers[o.source].used=!0)}for(let a in t){let o=this.tileManagers[a];!!t[a]!=!!o.used&&o.fire(new Bs("data",{sourceDataType:"visibility",sourceId:a}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,r&&this.fire(new Nf("data"))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let r in this.tileManagers)this.tileManagers[r].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,r){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:r})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,r={}){var t;this._checkLoaded();let i=this.serialize();if(e=r.transformStyle?r.transformStyle(i,e):e,((t=r.validate)!=null?t:!0)&&AL(this,e))return!1;e=cf(e),e.layers=L5(e.layers);let a=ene(i,e),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(o.operations.length===0)return!1;for(let s of o.operations)s();return this.stylesheet=e,this._serializedLayers=null,this.fire(new h2({style:this})),!0}_getOperationsToPerform(e){let r=[],t=[];for(let i of e)switch(i.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":r.push(()=>this.addLayer.apply(this,i.args));break;case"removeLayer":r.push(()=>this.removeLayer.apply(this,i.args));break;case"setPaintProperty":r.push(()=>this.setPaintProperty.apply(this,i.args));break;case"setLayoutProperty":r.push(()=>this.setLayoutProperty.apply(this,i.args));break;case"setFilter":r.push(()=>this.setFilter.apply(this,i.args));break;case"addSource":r.push(()=>this.addSource.apply(this,i.args));break;case"removeSource":r.push(()=>this.removeSource.apply(this,i.args));break;case"setLayerZoomRange":r.push(()=>this.setLayerZoomRange.apply(this,i.args));break;case"setLight":r.push(()=>this.setLight.apply(this,i.args));break;case"setGeoJSONSourceData":r.push(()=>this.setGeoJSONSourceData.apply(this,i.args));break;case"setGlyphs":r.push(()=>this.setGlyphs.apply(this,i.args));break;case"setFontFaces":r.push(()=>this.setFontFaces.apply(this,i.args));break;case"setSprite":r.push(()=>this.setSprite.apply(this,i.args));break;case"setTerrain":r.push(()=>this.map.setTerrain.apply(this,i.args));break;case"setSky":r.push(()=>this.setSky.apply(this,i.args));break;case"setProjection":this.setProjection.apply(this,i.args);break;case"setGlobalState":r.push(()=>this.setGlobalState.apply(this,i.args));break;case"setTransition":r.push(()=>{});break;default:t.push(i.command)}return{operations:r,unimplemented:t}}addImage(e,r){if(this.getImage(e)){this.fire(new Ln(Error(`An image named "${e}" already exists.`)));return}this.imageManager.addImage(e,r),this._afterImageUpdated(e)}updateImage(e,r){this.imageManager.updateImage(e,r)}getImage(e){return this.imageManager.getImage(e)}setMissingImageResolver(e){this.imageManager.setMissingImageResolver(e)}removeImage(e){if(!this.getImage(e)){this.fire(new Ln(Error(`An image named "${e}" does not exist.`)));return}this.imageManager.removeImage(e),this._afterImageUpdated(e)}_markImagesChanged(e){for(let r of e)this._changedImages[r]=!0}_afterImageUpdated(e){this._changedImages[e]=!0,this._imagesListDirty=!0,this._changed=!0,this.fire(new Nf("data"))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,r,t={}){var i;if(this._checkLoaded(),this.tileManagers[e]!==void 0)throw Error(`Source "${e}" already exists.`);if(!r.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(PT.has(r.type)&&this._validate(Hc.source,`sources.${e}`,r,null,t))return;(i=this.map)!=null&&i._collectResourceTiming&&(r.collectResourceTiming=!0);let a=this.tileManagers[e]=new A2(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,()=>({isSourceLoaded:a.loaded(),source:a.serialize(),sourceId:e})),a.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);for(let t in this._layers)if(this._layers[t].source===e)return this.fire(new Ln(Error(`Source "${e}" cannot be removed while layer "${t}" is using it.`)));let r=this.tileManagers[e];delete this.tileManagers[e],delete this._updatedSources[e],r.fire(new Bs("data",{sourceDataType:"metadata",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,r){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);let t=this.tileManagers[e].getSource();if(t.type!=="geojson")throw Error(`geojsonSource.type is ${t.type}, which is !== 'geojson`);t.setData(r),this._changed=!0}getSource(e){var r;return(r=this.tileManagers[e])==null?void 0:r.getSource()}addLayer(e,r,t={}){this._checkLoaded();let i=e.id;if(this.getLayer(i)){this.fire(new Ln(Error(`Layer "${i}" already exists on this map.`)));return}let a;if(e.type==="custom"){if(w6(this,vre(e)))return;a=$6(e,this._globalState)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(i,e.source),e=cf(e),e=yn(e,{source:i})),this._validate(Hc.layer,`layers.${i}`,e,{arrayIndex:-1},t))return;a=$6(e,this._globalState),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}let o=r?this._order.indexOf(r):this._order.length;if(r&&o===-1){this.fire(new Ln(Error(`Cannot add layer "${i}" before non-existing layer "${r}".`)));return}if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&a.type!=="custom"){let s=this._removedLayers[i];delete this._removedLayers[i],s.type===a.type?(this._updatedSources[a.source]="reload",this.tileManagers[a.source].pause()):this._updatedSources[a.source]="clear"}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e]){this.fire(new Ln(Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));return}if(e===r)return;if(r&&!this._order.includes(r)){this.fire(new Ln(Error(`Cannot move layer "${e}" before non-existing layer "${r}".`)));return}let t=this._order.indexOf(e);this._order.splice(t,1);let i=r?this._order.indexOf(r):this._order.length;this._order.splice(i,0,e),this._layerOrderChanged=!0}removeLayer(e){var r;this._checkLoaded();let t=this._layers[e];if(!t){this.fire(new Ln(Error(`Cannot remove non-existing layer "${e}".`)));return}t.setEventedParent(null);let i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=t,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],t.type==="symbol"&&t.source&&((r=this.tileManagers[t.source])==null||r.resetMaxContentElevation()),t.onRemove&&t.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,t){this._checkLoaded();let i=this.getLayer(e);if(!i){this.fire(new Ln(Error(`Cannot set the zoom range of non-existing layer "${e}".`)));return}(i.minzoom!==r||i.maxzoom!==t)&&(r!=null&&(i.minzoom=r),t!=null&&(i.maxzoom=t),this._updateLayer(i))}setFilter(e,r,t={}){this._checkLoaded();let i=this.getLayer(e);if(!i){this.fire(new Ln(Error(`Cannot filter non-existing layer "${e}".`)));return}if(!Ad(i.filter,r)){if(r==null){i.setFilter(void 0),this._updateLayer(i);return}this._validate(Hc.filter,`layers.${i.id}.filter`,r,null,t)||(i.setFilter(cf(r)),this._updateLayer(i))}}getFilter(e){return cf(this.getLayer(e).filter)}setLayoutProperty(e,r,t,i={}){this._checkLoaded();let a=this.getLayer(e);if(!a){this.fire(new Ln(Error(`Cannot style non-existing layer "${e}".`)));return}Ad(a.getLayoutProperty(r),t)||(a.setLayoutProperty(r,t,i),this._updateLayer(a))}getLayoutProperty(e,r){let t=this.getLayer(e);if(!t){this.fire(new Ln(Error(`Cannot get style of non-existing layer "${e}".`)));return}return t.getLayoutProperty(r)}setPaintProperty(e,r,t,i={}){this._checkLoaded();let a=this.getLayer(e);if(!a){this.fire(new Ln(Error(`Cannot style non-existing layer "${e}".`)));return}Ad(a.getPaintProperty(r),t)||this._updatePaintProperty(a,r,t,i)}_updatePaintProperty(e,r,t,i={}){e.setPaintProperty(r,t,i)&&this._updateLayer(e),Gx(e)&&r==="raster-fade-duration"&&this.tileManagers[e.source].setRasterFadeDuration(t),this._changed=!0,this._updatedPaintProps[e.id]=!0,e.type==="symbol"&&this.triggerSymbolPlacement(),this._serializedLayers=null}getPaintProperty(e,r){return this.getLayer(e).getPaintProperty(r)}setFeatureState(e,r){this._checkLoaded();let t=e.source,i=e.sourceLayer,a=this.tileManagers[t];if(a===void 0){this.fire(new Ln(Error(`The source '${t}' does not exist in the map's style.`)));return}let o=a.getSource().type;if(o==="geojson"&&i){this.fire(new Ln(Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(o==="vector"&&!i){this.fire(new Ln(Error("The sourceLayer parameter must be provided for vector source types.")));return}if(e.id===void 0){this.fire(new Ln(Error("The feature id parameter must be provided.")));return}let s=["__proto__","constructor","prototype"];if(r&&Object.keys(r).some(l=>s.includes(l))){this.fire(new Ln(Error(`The feature state should not include one of the following keys: ${s}`)));return}a.setFeatureState(i,e.id,r)}removeFeatureState(e,r){this._checkLoaded();let t=e.source,i=this.tileManagers[t];if(i===void 0){this.fire(new Ln(Error(`The source '${t}' does not exist in the map's style.`)));return}let a=i.getSource().type,o=a==="vector"?e.sourceLayer:void 0;if(a==="vector"&&!o){this.fire(new Ln(Error("The sourceLayer parameter must be provided for vector source types.")));return}if(r&&typeof e.id!="string"&&typeof e.id!="number"){this.fire(new Ln(Error("A feature id is required to remove its specific state property.")));return}i.removeFeatureState(o,e.id,r)}getFeatureState(e){this._checkLoaded();let r=e.source,t=e.sourceLayer,i=this.tileManagers[r];if(i===void 0){this.fire(new Ln(Error(`The source '${r}' does not exist in the map's style.`)));return}if(i.getSource().type==="vector"&&!t){this.fire(new Ln(Error("The sourceLayer parameter must be provided for vector source types.")));return}return e.id===void 0&&this.fire(new Ln(Error("The feature id parameter must be provided."))),i.getFeatureState(t,e.id)}getTransition(){var e;return yn({duration:300,delay:0},(e=this.stylesheet)==null?void 0:e.transition)}serialize(){if(!this._loaded)return;let e=$4(this.tileManagers,a=>a.serialize()),r=this._serializeByIds(this._order,!0),t=this.map.getTerrain()||void 0,i=this.stylesheet;return b9({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,"font-faces":i["font-faces"],transition:i.transition,projection:i.projection,state:i.state,sources:e,layers:r,terrain:t},a=>a!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.tileManagers[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.tileManagers[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let r=o=>this._layers[o].type==="fill-extrusion",t={},i=[];for(let o=this._order.length-1;o>=0;o--){let s=this._order[o];if(r(s)){t[s]=o;for(let l of e){let n=l[s];if(n)for(let u of n)i.push(u)}}}i.sort((o,s)=>s.intersectionZ-o.intersectionZ);let a=[];for(let o=this._order.length-1;o>=0;o--){let s=this._order[o];if(r(s))for(let l=i.length-1;l>=0;l--){let n=i[l].feature;if(t[n.layer.id]this.map.terrain.getElevation(u,c,f):void 0));return this.placement&&a.push(mne(this._layers,o,this.tileManagers,e,l,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,r){r?.filter&&this._validate(Hc.filter,"querySourceFeatures.filter",r.filter,null,r);let t=this.tileManagers[e];return t?gne(t,r?ar(Nt({},r),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,r={}){this._checkLoaded();let t=this.light.getLight(),i=!1;for(let o in e)if(!Ad(e[o],t[o])){i=!0;break}if(!i)return;let a={now:hs(),transition:yn({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(a)}getProjection(){var e;return(e=this.stylesheet)==null?void 0:e.projection}setProjection(e){this._checkLoaded();let r=e??{type:"mercator"};if(this.stylesheet.projection=e,this.projection){if(this.projection.name===r.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(r.type)}getSky(){var e;return(e=this.stylesheet)==null?void 0:e.sky}setSky(e,r={}){this._checkLoaded();let t=this.getSky(),i=!1;if(!e&&!t)return;if(e&&!t)i=!0;else if(!e&&t)i=!0;else for(let o in e)if(!Ad(e[o],t[o])){i=!0;break}if(!i)return;let a={now:hs(),transition:yn({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,r),this.sky.updateTransitions(a)}_setProjectionInternal(e){var r;let t=moe(e,(r=this.map._camera)==null?void 0:r.transform.constrainOverride,this._globalState);this.projection=t.projection,this.map.migrateProjection(t.transform,t.cameraHelper);for(let i in this.tileManagers)this.tileManagers[i].reload()}_validate(e,r,t,i,a={}){return a.validate!==!1&&eg(this,e,Nt({key:r,style:this.serialize(),value:t},i),a)}_remove(e=!0){this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null)),Ug().off(x2,this._rtlPluginLoaded);for(let r in this._layers)this._layers[r].setEventedParent(null);for(let r in this.tileManagers){let t=this.tileManagers[r];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.tileManagers[e].clearTiles()}_reloadSource(e){this.tileManagers[e].resume(),this.tileManagers[e].reload()}_updateSources(e){for(let r in this.tileManagers)this.tileManagers[r].update(e,this.map.terrain)}_generateCollisionBoxes(){for(let e in this.tileManagers)this._reloadSource(e)}triggerSymbolPlacement(){this._symbolPlacementTriggered=!0}_placementInputsChanged(e,r,t){var i;let a=this.pauseablePlacement;return!a||this._symbolPlacementTriggered||this._placedProjectionTransition!==((i=this.projection)==null?void 0:i.transitionState)||a._showCollisionBoxes!==r||a.placement.collisionGroups.crossSourceCollisions!==t||a.placement.transform.renderWorldCopies!==e.renderWorldCopies||!RK(a.placement.transform.modelViewProjectionMatrix,e.modelViewProjectionMatrix)}_updatePlacement(e,r,t,i,a=!1){var o,s;let l=!1,n=!1,u={};for(let h of this._order){let d=this._layers[h];if(d.type!=="symbol")continue;if(!u[d.source]){let g=this.tileManagers[d.source];u[d.source]=g.getRenderableIds(!0).map(m=>g.getTileByID(m)).sort((m,y)=>y.tileID.overscaledZ-m.tileID.overscaledZ||(m.tileID.isLessThan(y.tileID)?-1:1))}let p=this.crossTileSymbolIndex.addLayer(d,u[d.source],e.center.lng);l||(l=p)}this.crossTileSymbolIndex.pruneUnusedLayers(this._order),a||(a=this._layerOrderChanged||t===0);let c=l||this._placementInputsChanged(e,r,i),f=((o=this.pauseablePlacement)==null?void 0:o.isDone())&&!this.placement.stillRecent(hs(),e.zoom);if((a||!this.pauseablePlacement||f&&(c||this.placement.stale))&&(this._symbolPlacementTriggered=!1,this._placedProjectionTransition=(s=this.projection)==null?void 0:s.transitionState,this.pauseablePlacement=new IB(e,this.map.terrain,this._order,a,r,t,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?c&&this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(hs()),n=!0),l&&this.pauseablePlacement.placement.setStale()),n||l)for(let h of this._order){let d=this._layers[h];d.type==="symbol"&&this.placement.updateLayerOpacities(d,u[d.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(hs())}_releaseSymbolFadeTiles(){for(let e in this.tileManagers)this.tileManagers[e].releaseSymbolFadeTiles()}getImages(e,r){return Xr(this,null,function*(){let t=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();let i=this.tileManagers[r.source];return i&&i.setDependencies(r.tileID.key,r.type,r.icons),t})}getGlyphs(e,r){return Xr(this,null,function*(){let t=yield this.glyphManager.getGlyphs(r.stacks),i=this.tileManagers[r.source];return i&&i.setDependencies(r.tileID.key,r.type,[""]),t})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,r={}){this._checkLoaded(),!(e&&this._validate(Hc.glyphs,"glyphs",e,null,r))&&(this._changed=!0,this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}getFontFaces(){return this.stylesheet["font-faces"]||null}setFontFaces(e){this._checkLoaded(),this._changed=!0,this._glyphsDidChange=!0,this.stylesheet["font-faces"]=e,this.glyphManager.setFontFaces(e)}getDashes(e,r){return Xr(this,null,function*(){let t={};for(let[i,a]of Object.entries(r.dashes))t[i]=this.lineAtlas.getDash(a.dasharray,a.round);return t})}addSprite(e,r,t={},i){this._checkLoaded();let a=[{id:e,url:r}],o=[...Xb(this.stylesheet.sprite),...a];this._validate(Hc.sprite,"sprite",o,null,t)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(e){this._checkLoaded();let r=Xb(this.stylesheet.sprite);if(!r.find(i=>i.id===e)){this.fire(new Ln(Error(`Sprite "${e}" doesn't exists on this map.`)));return}let t=this.imageManager.removeSpriteImages(e);this._markImagesChanged(t),r.splice(r.findIndex(i=>i.id===e),1),this.stylesheet.sprite=r.length>0?r:void 0,this._imagesListDirty=!0,this._changed=!0,this.fire(new Nf("data"))}getSprite(){return Xb(this.stylesheet.sprite)}setSprite(e,r={},t){this._checkLoaded(),!(e&&this._validate(Hc.sprite,"sprite",e,null,r))&&(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,t):(this._unloadSprite(),t&&t(null)))}destroy(){this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null));for(let e in this.tileManagers){let r=this.tileManagers[e];r.setEventedParent(null),r.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.patternAtlas.destroy()),this.glyphManager&&this.glyphManager.destroy();for(let e in this._layers){let r=this._layers[e];r.setEventedParent(null),r.onRemove&&r.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}},rO=ul([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),iO=class{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,r,t,i,a,o,s,l,n){this.context=e;let u=this.boundPaintVertexBuffers.length!==i.length;for(let c=0;!u&&c({u_depth:new En(e,r.u_depth),u_terrain:new En(e,r.u_terrain)}),nO=(e,r)=>({u_texture:new En(e,r.u_texture),u_ele_delta:new Xa(e,r.u_ele_delta),u_fog_matrix:new mh(e,r.u_fog_matrix),u_fog_color:new up(e,r.u_fog_color),u_fog_ground_blend:new Xa(e,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new Xa(e,r.u_fog_ground_blend_opacity),u_horizon_color:new up(e,r.u_horizon_color),u_horizon_fog_blend:new Xa(e,r.u_horizon_fog_blend),u_is_globe_mode:new Xa(e,r.u_is_globe_mode)}),oO=(e,r)=>({u_ele_delta:new Xa(e,r.u_ele_delta)}),sO=(e,r,t,i,a)=>({u_texture:0,u_ele_delta:e,u_fog_matrix:r,u_fog_color:t?t.properties.get("fog-color"):ro.white,u_fog_ground_blend:t?t.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?0:t?t.calculateFogBlendOpacity(i):0,u_horizon_color:t?t.properties.get("horizon-color"):ro.white,u_horizon_fog_blend:t?t.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!a}),lO=e=>({u_ele_delta:e}),ey={ProjectionUBO:0,TerrainUBO:1,FrameUBO:2},uO={float:[1,1],int:[1,1],vec2:[2,2],vec4:[4,4],mat4:[16,4]},F2=class{constructor(e,r,t){this.context=e,this.binding=r,this.contentWords=t.contentWords;let i=e.gl;this.buffer=i.createBuffer(),i.bindBuffer(i.UNIFORM_BUFFER,this.buffer),i.bufferData(i.UNIFORM_BUFFER,t.sizeWords*4,i.DYNAMIC_DRAW),i.bindBufferBase(i.UNIFORM_BUFFER,r,this.buffer),this.uploaded=new Float32Array(t.sizeWords),this.pending=new Float32Array(t.sizeWords),this.uploadedWords=new Uint32Array(this.uploaded.buffer),this.pendingWords=new Uint32Array(this.pending.buffer),this.hasData=!1,this.bindingDirty=!1}upload(){let e=this.context.gl,r=!this.hasData;if(!r){let t=this.pendingWords,i=this.uploadedWords;for(let a=0;a=0&&(this.attributes[k]={location:A,isInteger:w.has(k)})}u.deleteShader(M),u.deleteShader(S);for(let k of y)if(k&&!C[k]){let A=u.getUniformLocation(this.program,k);A&&(C[k]=A)}this.fixedUniforms=i(e,C),this.terrainUniforms=aO(e,C),this.binderUniforms=t?t.getUniforms(e,C):[]}draw(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g,m,y,_){var v;let x=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(t),e.setStencilMode(i),e.setColorMode(a),e.setCullFace(o),l){e.activeTexture.set(x.TEXTURE2),x.bindTexture(x.TEXTURE_2D,l.depthTexture),e.activeTexture.set(x.TEXTURE3),x.bindTexture(x.TEXTURE_2D,l.texture);for(let M in this.terrainUniforms)this.terrainUniforms[M].set(l[M]);boe(e.terrainUniformBuffer,l)}if(n&&_oe(e.projectionUniformBuffer,n),s)for(let M in this.fixedUniforms)this.fixedUniforms[M].set(s[M]);g&&g.setUniforms(e,this.binderUniforms,d,{zoom:p});let S=0;switch(r){case x.LINES:S=2;break;case x.TRIANGLES:S=3;break;case x.LINE_STRIP:S=1}for(let M of h.get())M.vaos||(M.vaos={}),(v=M.vaos)[u]||(v[u]=new iO),M.vaos[u].bind(e,this,c,g?g.getPaintVertexBuffers():[],f,M.vertexOffset,m,y,_),x.drawElements(r,M.primitiveLength*S,x.UNSIGNED_SHORT,M.primitiveOffset*S*2)}},fO=(e,r)=>({u_lightpos:new vc(e,r.u_lightpos),u_lightpos_globe:new vc(e,r.u_lightpos_globe),u_lightintensity:new Xa(e,r.u_lightintensity),u_lightcolor:new vc(e,r.u_lightcolor),u_vertical_gradient:new Xa(e,r.u_vertical_gradient),u_opacity:new Xa(e,r.u_opacity),u_fill_translate:new mo(e,r.u_fill_translate)}),hO=(e,r)=>({u_lightpos:new vc(e,r.u_lightpos),u_lightpos_globe:new vc(e,r.u_lightpos_globe),u_lightintensity:new Xa(e,r.u_lightintensity),u_lightcolor:new vc(e,r.u_lightcolor),u_vertical_gradient:new Xa(e,r.u_vertical_gradient),u_height_factor:new Xa(e,r.u_height_factor),u_opacity:new Xa(e,r.u_opacity),u_fill_translate:new mo(e,r.u_fill_translate),u_image:new En(e,r.u_image),u_texsize:new mo(e,r.u_texsize),u_pixel_coord_upper:new mo(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new mo(e,r.u_pixel_coord_lower),u_scale:new vc(e,r.u_scale),u_fade:new Xa(e,r.u_fade)}),KM=(e,r,t,i)=>{let a=e.style.light,o=a.getCartesianPosition(),s=u9();a.properties.get("anchor")==="viewport"&&CK(s,e.transform.bearingInRadians),jK(o,o,s);let l=e.transform.transformLightDirection(o),n=a.properties.get("color");return{u_lightpos:o,u_lightpos_globe:l,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[n.r,n.g,n.b],u_vertical_gradient:+r,u_opacity:t,u_fill_translate:i}},dO=(e,r,t,i,a,o,s)=>yn(KM(e,r,t,i),Mz(o,e,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8}),pO=(e,r)=>({u_fill_translate:new mo(e,r.u_fill_translate)}),vO=(e,r)=>({u_image:new En(e,r.u_image),u_texsize:new mo(e,r.u_texsize),u_pixel_coord_upper:new mo(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new mo(e,r.u_pixel_coord_lower),u_scale:new vc(e,r.u_scale),u_fade:new Xa(e,r.u_fade),u_sdf_pattern:new En(e,r.u_sdf_pattern),u_fill_translate:new mo(e,r.u_fill_translate)}),mO=(e,r)=>({u_fill_translate:new mo(e,r.u_fill_translate)}),gO=(e,r)=>({u_image:new En(e,r.u_image),u_texsize:new mo(e,r.u_texsize),u_pixel_coord_upper:new mo(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new mo(e,r.u_pixel_coord_lower),u_scale:new vc(e,r.u_scale),u_fade:new Xa(e,r.u_fade),u_sdf_pattern:new En(e,r.u_sdf_pattern),u_fill_translate:new mo(e,r.u_fill_translate)}),JM=(e,r,t,i,a)=>yn(Mz(r,e,t),{u_fill_translate:i,u_sdf_pattern:+!!a}),yO=e=>({u_fill_translate:e}),_O=e=>({u_fill_translate:e}),xO=(e,r,t,i,a)=>JM(e,r,t,i,a),bO=(e,r)=>({u_scale_with_map:new En(e,r.u_scale_with_map),u_pitch_with_map:new En(e,r.u_pitch_with_map),u_extrude_scale:new mo(e,r.u_extrude_scale),u_globe_extrude_scale:new Xa(e,r.u_globe_extrude_scale),u_translate:new mo(e,r.u_translate)}),wO=(e,r,t,i,a)=>{let o=e.transform,s,l,n=0;if(t.paint.get("circle-pitch-alignment")==="map"){let u=Cf(r,1,o.zoom);s=!0,l=[u,u],n=u/(Bi*2**r.tileID.overscaledZ)*2*Math.PI*a}else s=!1,l=o.pixelsToGLUnits;return{u_scale_with_map:+(t.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+s,u_extrude_scale:l,u_globe_extrude_scale:n,u_translate:i}},TO=(e,r)=>({u_color:new up(e,r.u_color),u_overlay:new En(e,r.u_overlay),u_overlay_scale:new Xa(e,r.u_overlay_scale)}),QM=(e,r=1)=>({u_color:e,u_overlay:0,u_overlay_scale:r}),AO=(e,r)=>({u_extrude_scale:new Xa(e,r.u_extrude_scale),u_intensity:new Xa(e,r.u_intensity),u_globe_extrude_scale:new Xa(e,r.u_globe_extrude_scale)}),MO=(e,r)=>({u_matrix:new mh(e,r.u_matrix),u_image:new En(e,r.u_image),u_color_ramp:new En(e,r.u_color_ramp),u_opacity:new Xa(e,r.u_opacity)}),eS=(e,r,t,i)=>{let a=Cf(e,1,r)/(Bi*2**e.tileID.overscaledZ)*2*Math.PI*i;return{u_extrude_scale:Cf(e,1,r),u_intensity:t,u_globe_extrude_scale:a}},tS=(e,r,t,i)=>{let a=zp();return Wh(a,0,e.width,e.height,0,0,1),{u_matrix:a,u_image:t,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}},SO=(e,r)=>({u_image:new En(e,r.u_image),u_latrange:new mo(e,r.u_latrange),u_exaggeration:new Xa(e,r.u_exaggeration),u_altitudes:new eA(e,r.u_altitudes),u_azimuths:new eA(e,r.u_azimuths),u_accent:new up(e,r.u_accent),u_method:new En(e,r.u_method),u_shadows:new QT(e,r.u_shadows),u_highlights:new QT(e,r.u_highlights)}),EO=(e,r)=>({u_matrix:new mh(e,r.u_matrix),u_image:new En(e,r.u_image),u_dimension:new mo(e,r.u_dimension),u_zoom:new Xa(e,r.u_zoom),u_unpack:new Em(e,r.u_unpack)}),kO=(e,r,t)=>{let i=t.paint.get("hillshade-accent-color"),a;switch(t.paint.get("hillshade-method")){case"basic":a=4;break;case"combined":a=1;break;case"igor":a=2;break;case"multidirectional":a=3;break;default:a=0}let o=t.getIlluminationProperties();for(let s=0;s{let t=r.stride,i=zp();return Wh(i,0,Bi,-Bi,0,0,1),Ol(i,i,[0,-Bi,0]),{u_matrix:i,u_image:1,u_dimension:[t,t],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}},DO=(e,r)=>({u_image:new En(e,r.u_image),u_unpack:new Em(e,r.u_unpack),u_dimension:new mo(e,r.u_dimension),u_elevation_stops:new En(e,r.u_elevation_stops),u_color_stops:new En(e,r.u_color_stops),u_color_ramp_size:new En(e,r.u_color_ramp_size),u_opacity:new Xa(e,r.u_opacity)}),LO=(e,r,t=0)=>({u_image:0,u_unpack:r.getUnpackVector(),u_dimension:[r.stride,r.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:t,u_opacity:e.paint.get("color-relief-opacity")}),FO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_ratio:new Xa(e,r.u_ratio)}),PO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_ratio:new Xa(e,r.u_ratio),u_image:new En(e,r.u_image),u_image_height:new Xa(e,r.u_image_height)}),IO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_texsize:new mo(e,r.u_texsize),u_ratio:new Xa(e,r.u_ratio),u_image:new En(e,r.u_image),u_scale:new vc(e,r.u_scale),u_fade:new Xa(e,r.u_fade)}),RO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_ratio:new Xa(e,r.u_ratio),u_image:new En(e,r.u_image),u_mix:new Xa(e,r.u_mix),u_tileratio:new Xa(e,r.u_tileratio),u_crossfade_from:new Xa(e,r.u_crossfade_from),u_crossfade_to:new Xa(e,r.u_crossfade_to),u_lineatlas_width:new Xa(e,r.u_lineatlas_width),u_lineatlas_height:new Xa(e,r.u_lineatlas_height)}),zO=(e,r)=>({u_translation:new mo(e,r.u_translation),u_ratio:new Xa(e,r.u_ratio),u_image:new En(e,r.u_image),u_image_height:new Xa(e,r.u_image_height),u_tileratio:new Xa(e,r.u_tileratio),u_crossfade_from:new Xa(e,r.u_crossfade_from),u_crossfade_to:new Xa(e,r.u_crossfade_to),u_image_dash:new En(e,r.u_image_dash),u_mix:new Xa(e,r.u_mix),u_lineatlas_width:new Xa(e,r.u_lineatlas_width),u_lineatlas_height:new Xa(e,r.u_lineatlas_height)}),ry=(e,r,t,i)=>{let a=e.transform;return{u_translation:Sz(e,r,t),u_ratio:i/Cf(r,1,a.zoom)}},BO=(e,r,t,i,a)=>yn(ry(e,r,t,i),{u_image:0,u_image_height:a}),OO=(e,r,t,i,a)=>{let o=e.transform,s=oM(r,o);return{u_translation:Sz(e,r,t),u_texsize:r.imageAtlasTexture.size,u_ratio:i/Cf(r,1,o.zoom),u_image:0,u_scale:[s,a.fromScale,a.toScale],u_fade:a.t}},NO=(e,r,t,i,a)=>{let o=e.transform,s=oM(r,o);return yn(ry(e,r,t,i),{u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},jO=(e,r,t,i,a,o)=>{let s=e.transform,l=oM(r,s);return yn(ry(e,r,t,i),{u_image:0,u_image_height:o,u_tileratio:l,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},UO=(e,r)=>({u_image:new En(e,r.u_image),u_opacity:new Xa(e,r.u_opacity)}),qO=(e,r)=>({u_image:r,u_opacity:e}),VO=(e,r)=>({u_is_size_zoom_constant:new En(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new En(e,r.u_is_size_feature_constant),u_size_t:new Xa(e,r.u_size_t),u_size:new Xa(e,r.u_size),u_rotate_symbol:new En(e,r.u_rotate_symbol),u_label_plane_matrix:new mh(e,r.u_label_plane_matrix),u_coord_matrix:new mh(e,r.u_coord_matrix),u_is_text:new En(e,r.u_is_text),u_pitch_with_map:new En(e,r.u_pitch_with_map),u_is_along_line:new En(e,r.u_is_along_line),u_is_variable_anchor:new En(e,r.u_is_variable_anchor),u_texsize:new mo(e,r.u_texsize),u_texture:new En(e,r.u_texture),u_translation:new mo(e,r.u_translation),u_pitched_scale:new Xa(e,r.u_pitched_scale),u_is_offset:new En(e,r.u_is_offset),u_height_anchor_ground:new En(e,r.u_height_anchor_ground)}),GO=(e,r)=>({u_is_size_zoom_constant:new En(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new En(e,r.u_is_size_feature_constant),u_size_t:new Xa(e,r.u_size_t),u_size:new Xa(e,r.u_size),u_rotate_symbol:new En(e,r.u_rotate_symbol),u_label_plane_matrix:new mh(e,r.u_label_plane_matrix),u_coord_matrix:new mh(e,r.u_coord_matrix),u_is_text:new En(e,r.u_is_text),u_pitch_with_map:new En(e,r.u_pitch_with_map),u_is_along_line:new En(e,r.u_is_along_line),u_is_variable_anchor:new En(e,r.u_is_variable_anchor),u_texsize:new mo(e,r.u_texsize),u_texture:new En(e,r.u_texture),u_gamma_scale:new Xa(e,r.u_gamma_scale),u_is_halo:new En(e,r.u_is_halo),u_is_plain:new En(e,r.u_is_plain),u_translation:new mo(e,r.u_translation),u_pitched_scale:new Xa(e,r.u_pitched_scale),u_is_offset:new En(e,r.u_is_offset),u_height_anchor_ground:new En(e,r.u_height_anchor_ground)}),HO=(e,r)=>({u_is_size_zoom_constant:new En(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new En(e,r.u_is_size_feature_constant),u_size_t:new Xa(e,r.u_size_t),u_size:new Xa(e,r.u_size),u_rotate_symbol:new En(e,r.u_rotate_symbol),u_label_plane_matrix:new mh(e,r.u_label_plane_matrix),u_coord_matrix:new mh(e,r.u_coord_matrix),u_is_text:new En(e,r.u_is_text),u_pitch_with_map:new En(e,r.u_pitch_with_map),u_is_along_line:new En(e,r.u_is_along_line),u_is_variable_anchor:new En(e,r.u_is_variable_anchor),u_texsize:new mo(e,r.u_texsize),u_texsize_icon:new mo(e,r.u_texsize_icon),u_texture:new En(e,r.u_texture),u_texture_icon:new En(e,r.u_texture_icon),u_gamma_scale:new Xa(e,r.u_gamma_scale),u_is_halo:new En(e,r.u_is_halo),u_translation:new mo(e,r.u_translation),u_pitched_scale:new Xa(e,r.u_pitched_scale),u_is_offset:new En(e,r.u_is_offset),u_height_anchor_ground:new En(e,r.u_height_anchor_ground)}),rS=(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p)=>({u_is_size_zoom_constant:+(e==="constant"||e==="source"),u_is_size_feature_constant:+(e==="constant"||e==="camera"),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_rotate_symbol:+t,u_label_plane_matrix:l,u_coord_matrix:n,u_is_text:+c,u_pitch_with_map:+i,u_is_along_line:a,u_is_variable_anchor:o,u_texsize:f,u_texture:0,u_translation:u,u_pitched_scale:h,u_is_offset:d,u_height_anchor_ground:+p}),iS=(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p,g)=>{let m=s.transform;return yn(rS(e,r,t,i,a,o,s,l,n,u,c,f,d,p,g),{u_gamma_scale:i?Math.cos(m.pitch*Math.PI/180)*m.cameraToCenterDistance:1,u_is_halo:+!!h,u_is_plain:1})},$O=(e,r,t,i,a,o,s,l,n,u,c,f,h,d,p)=>yn(iS(e,r,t,i,a,o,s,l,n,u,!0,c,!0,h,d,p),{u_texsize_icon:f,u_texture_icon:1}),WO=(e,r)=>({u_opacity:new Xa(e,r.u_opacity),u_color:new up(e,r.u_color)}),YO=(e,r)=>({u_opacity:new Xa(e,r.u_opacity),u_image:new En(e,r.u_image),u_pattern_tl_a:new mo(e,r.u_pattern_tl_a),u_pattern_br_a:new mo(e,r.u_pattern_br_a),u_pattern_tl_b:new mo(e,r.u_pattern_tl_b),u_pattern_br_b:new mo(e,r.u_pattern_br_b),u_texsize:new mo(e,r.u_texsize),u_mix:new Xa(e,r.u_mix),u_pattern_size_a:new mo(e,r.u_pattern_size_a),u_pattern_size_b:new mo(e,r.u_pattern_size_b),u_scale_a:new Xa(e,r.u_scale_a),u_scale_b:new Xa(e,r.u_scale_b),u_pixel_coord_upper:new mo(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new mo(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new Xa(e,r.u_tile_units_to_pixels)}),XO=(e,r)=>({u_opacity:e,u_color:r}),ZO=(e,r,t,i,a)=>yn(Toe(t,a,r,i),{u_opacity:e}),KO=(e,r)=>({u_sun_pos:new vc(e,r.u_sun_pos),u_atmosphere_blend:new Xa(e,r.u_atmosphere_blend),u_globe_position:new vc(e,r.u_globe_position),u_globe_radius:new Xa(e,r.u_globe_radius),u_inv_proj_matrix:new mh(e,r.u_inv_proj_matrix)}),JO=(e,r,t,i,a)=>({u_sun_pos:e,u_atmosphere_blend:r,u_globe_position:t,u_globe_radius:i,u_inv_proj_matrix:a}),QO=(e,r)=>({u_sky_color:new up(e,r.u_sky_color),u_horizon_color:new up(e,r.u_horizon_color),u_horizon:new mo(e,r.u_horizon),u_horizon_normal:new mo(e,r.u_horizon_normal),u_sky_horizon_blend:new Xa(e,r.u_sky_horizon_blend),u_sky_blend:new Xa(e,r.u_sky_blend),u_inv_proj_matrix:new mh(e,r.u_inv_proj_matrix),u_globe_position:new vc(e,r.u_globe_position),u_globe_radius:new Xa(e,r.u_globe_radius)}),eN=(e,r,t)=>{let i=Math.cos(r.rollInRadians),a=Math.sin(r.rollInRadians),o=ug(r),s=r.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:e.properties.get("sky-color"),u_horizon_color:e.properties.get("horizon-color"),u_horizon:[(r.width/2-o*a)*t,(r.height/2+o*i)*t],u_horizon_normal:[-a,i],u_sky_horizon_blend:e.properties.get("sky-horizon-blend")*r.height/2*t,u_sky_blend:s,u_inv_proj_matrix:r.inverseProjectionMatrix,u_globe_position:_z(r),u_globe_radius:jm(r.worldSize,r.center.lat)}},iy=(e,r)=>({}),tN={fillExtrusion:fO,fillExtrusionPattern:hO,fill:pO,fillPattern:vO,fillOutline:mO,fillOutlinePattern:gO,circle:bO,collisionBox:iy,collisionCircle:iy,debug:TO,depth:iy,clippingMask:iy,heatmap:AO,heatmapTexture:MO,hillshade:SO,hillshadePrepare:EO,colorRelief:DO,line:FO,lineGradient:PO,linePattern:IO,lineSDF:RO,lineGradientSDF:zO,layerOpacity:UO,raster:pB,symbolIcon:VO,symbolSDF:GO,symbolTextAndIcon:HO,background:WO,backgroundPattern:YO,terrain:nO,terrainDepth:oO,atmosphere:KO,sky:QO},rN=class{constructor(e,r,t){this.context=e;let i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=!!t,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||r.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let r=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},aS={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},iN=class{constructor(e,r,t,i){this.length=r.length,this.attributes=t,this.itemSize=r.bytesPerElement,this.dynamicDraw=i,this.context=e;let a=e.gl;this.buffer=a.createBuffer(),e.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||r.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,r){for(let t of this.attributes){let i=r.attributes[t.name];i!==void 0&&e.enableVertexAttribArray(i.location)}}setVertexAttribPointers(e,r,t){for(let i of this.attributes){let a=r.attributes[i.name];if(a!==void 0){let o=i.offset+this.itemSize*(t||0);a.isInteger?e.vertexAttribIPointer(a.location,i.components,e[aS[i.type]],this.itemSize,o):e.vertexAttribPointer(a.location,i.components,e[aS[i.type]],!1,this.itemSize,o)}}}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},os=class{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)}},aN=class extends os{getDefault(){return ro.transparent}set(e){let r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}},nN=class extends os{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}},oN=class extends os{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}},sN=class extends os{getDefault(){return[!0,!0,!0,!0]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}},lN=class extends os{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}},uN=class extends os{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}},cN=class extends os{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let r=this.current;(e.func!==r.func||e.ref!==r.ref||e.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}},fN=class extends os{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}},hN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=e,this.dirty=!1}},dN=class extends os{getDefault(){return[0,1]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}},pN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=e,this.dirty=!1}},vN=class extends os{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}},mN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.BLEND):r.disable(r.BLEND),this.current=e,this.dirty=!1}},gN=class extends os{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}},yN=class extends os{getDefault(){return ro.transparent}set(e){let r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}},_N=class extends os{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}},xN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;e?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=e,this.dirty=!1}},bN=class extends os{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}},wN=class extends os{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}},TN=class extends os{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}},AN=class extends os{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}},MN=class extends os{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}},SN=class extends os{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},EN=class extends os{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,e),this.current=e,this.dirty=!1}},kN=class extends os{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindTexture(r.TEXTURE_2D,e),this.current=e,this.dirty=!1}},CN=class extends os{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},DN=class extends os{getDefault(){return null}set(e){let r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},LN=class extends os{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}},FN=class extends os{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},PN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},IN=class extends os{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},P2=class extends os{constructor(e,r){super(e),this.context=e,this.parent=r}getDefault(){return null}},RN=class extends P2{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},zN=class extends P2{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}},BN=class extends P2{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}},ON=class{constructor(e,r,t,i,a){this.context=e,this.width=r,this.height=t;let o=e.gl,s=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new RN(e,s),i)this.depthAttachment=a?new BN(e,s):new zN(e,s);else if(a)throw Error("Stencil cannot be set without depth")}destroy(){let e=this.context.gl,r=this.colorAttachment.get();if(r&&e.deleteTexture(r),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}},nS=aM([{name:"u_units_to_pixels",type:"vec2"},{name:"u_world_size",type:"vec2"},{name:"u_camera_to_center_distance",type:"float"},{name:"u_symbol_fade_change",type:"float"},{name:"u_aspect_ratio",type:"float"},{name:"u_device_pixel_ratio",type:"float"},{name:"u_viewport_size",type:"vec2"},{name:"u_pixel_extrude_scale",type:"vec2"},{name:"u_pitch",type:"float"}]),pf=nS.offsets,cl=class{constructor(e,r,t){this.blendFunction=e,this.blendColor=r,this.mask=t}},cl.Replace=[1,0],cl.disabled=new cl(cl.Replace,ro.transparent,[!1,!1,!1,!1]),cl.unblended=new cl(cl.Replace,ro.transparent,[!0,!0,!0,!0]),cl.alphaBlended=new cl([1,771],ro.transparent,[!0,!0,!0,!0]),NN=class{constructor(e){this.gl=e,this.clearColor=new aN(this),this.clearDepth=new nN(this),this.clearStencil=new oN(this),this.colorMask=new sN(this),this.depthMask=new lN(this),this.stencilMask=new uN(this),this.stencilFunc=new cN(this),this.stencilOp=new fN(this),this.stencilTest=new hN(this),this.depthRange=new dN(this),this.depthTest=new pN(this),this.depthFunc=new vN(this),this.blend=new mN(this),this.blendFunc=new gN(this),this.blendColor=new yN(this),this.blendEquation=new _N(this),this.cullFace=new xN(this),this.cullFaceSide=new bN(this),this.frontFace=new wN(this),this.program=new TN(this),this.activeTexture=new AN(this),this.viewport=new MN(this),this.bindFramebuffer=new SN(this),this.bindRenderbuffer=new EN(this),this.bindTexture=new kN(this),this.bindVertexBuffer=new CN(this),this.bindElementBuffer=new DN(this),this.bindVertexArray=new LN(this),this.pixelStoreUnpack=new FN(this),this.pixelStoreUnpackPremultiplyAlpha=new PN(this),this.pixelStoreUnpackFlipY=new IN(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),e.getExtension("EXT_color_buffer_half_float"),e.getExtension("EXT_color_buffer_float"),this.projectionUniformBuffer=yoe(this),this.terrainUniformBuffer=xoe(this),this.frameUniformBuffer=Moe(this)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0,this.projectionUniformBuffer.bindingDirty=!0,this.terrainUniformBuffer.bindingDirty=!0,this.frameUniformBuffer.bindingDirty=!0}setCustomLayerDefaults(){this.unbindVAO(),this.cullFace.setDefault(),this.activeTexture.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}createIndexBuffer(e,r){return new rN(this,e,r)}createVertexBuffer(e,r,t){return new iN(this,e,r,t)}createRenderbuffer(e,r,t){let i=this.gl,a=i.createRenderbuffer();return this.bindRenderbuffer.set(a),i.renderbufferStorage(i.RENDERBUFFER,e,r,t),this.bindRenderbuffer.set(null),a}createFramebuffer(e,r,t,i){return new ON(this,e,r,t,i)}clear({color:e,depth:r,stencil:t}){let i=this.gl,a=0;e&&(a|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),r!==void 0&&(a|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),t!==void 0&&(a|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(t),this.stencilMask.set(255)),i.clear(a)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func===this.gl.ALWAYS&&!e.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range))}setStencilMode(e){e.test.func===this.gl.ALWAYS&&!e.mask?this.stencilTest.set(!1):(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}))}setColorMode(e){Ad(e.blendFunction,cl.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){return this.gl.createVertexArray()}deleteVertexArray(e){this.gl.deleteVertexArray(e)}unbindVAO(){this.bindVertexArray.set(null)}},Lo=class{constructor(e,r,t){this.func=e,this.mask=r,this.range=t}},Lo.ReadOnly=!1,Lo.ReadWrite=!0,Lo.disabled=new Lo(519,Lo.ReadOnly,[0,1]),I2=7680,es=class{constructor(e,r,t,i,a,o){this.test=e,this.ref=r,this.mask=t,this.fail=i,this.depthFail=a,this.pass=o}},es.disabled=new es({func:519,mask:0},0,0,I2,I2,I2),oS=1029,R2=2305,Ko=class{constructor(e,r,t){this.enable=e,this.mode=r,this.frontFace=t}},Ko.disabled=new Ko(!1,oS,R2),Ko.backCCW=new Ko(!0,oS,R2),Ko.frontCCW=new Ko(!0,1028,R2),jN=$h(new Float32Array(16)),B2=0,O2=[new Wr(0,0),new Wr(Bi,0),new Wr(Bi,Bi),new Wr(0,Bi)],UN=new ro(1,0,0,1),qN=new ro(0,1,0,1),VN=new ro(0,0,1,1),GN=new ro(1,0,1,1),HN=new ro(0,1,1,1),$N={symbol:koe,circle:Ioe,heatmap:Roe,line:$oe,fill:Woe,fillExtrusion:Yoe,hillshade:Xoe,colorRelief:Koe,raster:Joe,background:rse,sky:hse,atmosphere:pse,custom:use,debug:nse,debugPadding:ise,terrainDepth:cse},WN=(N2=class{constructor(e,r){this.drawFunctions=$N,this.context=new NN(e),this.transform=r,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:$h(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=A2.maxOverzooming+A2.maxUnderzooming+1,this.depthEpsilon=1/2**16,this.crossTileSymbolIndex=new zM}resize(e,r,t){if(this.width=Math.floor(e*t),this.height=Math.floor(r*t),this.pixelRatio=t,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let i of this.style._order)this.style._layers[i].resize()}setup(){let e=this.context,r=new lp;r.emplaceBack(0,0),r.emplaceBack(Bi,0),r.emplaceBack(0,Bi),r.emplaceBack(Bi,Bi),this.tileExtentBuffer=e.createVertexBuffer(r,a0.members),this.tileExtentSegments=Ks.simpleSegment(0,0,4,2);let t=new lp;t.emplaceBack(0,0),t.emplaceBack(Bi,0),t.emplaceBack(0,Bi),t.emplaceBack(Bi,Bi),this.debugBuffer=e.createVertexBuffer(t,a0.members),this.debugSegments=Ks.simpleSegment(0,0,4,5);let i=new fI;i.emplaceBack(0,0,0,0),i.emplaceBack(Bi,0,Bi,0),i.emplaceBack(0,Bi,0,Bi),i.emplaceBack(Bi,Bi,Bi,Bi),this.rasterBoundsBuffer=e.createVertexBuffer(i,rO.members),this.rasterBoundsSegments=Ks.simpleSegment(0,0,4,2);let a=new lp;a.emplaceBack(0,0),a.emplaceBack(Bi,0),a.emplaceBack(0,Bi),a.emplaceBack(Bi,Bi),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(a,a0.members),this.rasterBoundsSegmentsPosOnly=Ks.simpleSegment(0,0,4,5);let o=new lp;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,a0.members),this.viewportSegments=Ks.simpleSegment(0,0,4,2);let s=new TI;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);let l=new td;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(l);let n=this.context.gl;this.stencilClearMode=new es({func:n.ALWAYS,mask:0},0,255,n.ZERO,n.ZERO,n.ZERO),this.tileExtentMesh=new qm(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let t=zp();Wh(t,0,this.width,this.height,0,0,1),Xu(t,t,[r.drawingBufferWidth,r.drawingBufferHeight,0]);let i={mainMatrix:t,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:t,clipAntimeridian:!1};this.useProgram("clippingMask",null,!0).draw(e,r.TRIANGLES,Lo.disabled,this.stencilClearMode,cl.disabled,Ko.disabled,null,null,i,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(e,r,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!r?.length)return;this.currentStencilSource=e.source,this.nextStencilID+r.length>256&&this.clearStencil();let i=this.context;i.setColorMode(cl.disabled),i.setDepthMode(Lo.disabled);let a={};for(let o of r)a[o.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(a,r,t,!0),this._renderTileMasks(a,r,t,!1),this._tileClippingMaskIDs=a}_renderTileMasks(e,r,t,i){let a=this.context,o=a.gl,s=this.style.projection,l=this.transform,n=this.useProgram("clippingMask");for(let u of r){let c=e[u.key],f=this.getTerrainDataForTile(u,t),h=s.getMeshFromTileID(this.context,u.canonical,i,!0,"stencil"),d=l.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!t,applyTerrainMatrix:!0});n.draw(a,o.TRIANGLES,Lo.disabled,new es({func:o.ALWAYS,mask:0},c,255,o.KEEP,o.KEEP,o.REPLACE),cl.disabled,t?Ko.disabled:Ko.backCCW,null,f,d,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}getTerrainDataForTile(e,r){var t,i;return r&&((t=this.style.projection)==null?void 0:t.name)==="mercator"?null:((i=this.style.map.terrain)==null?void 0:i.getTerrainData(e))||null}_renderTilesDepthBuffer(){var e;let r=this.context,t=r.gl,i=this.style.projection,a=this.transform,o=this.useProgram("depth"),s=this.getDepthModeFor3D(),l=Om(a,{tileSize:a.tileSize});for(let n of l){let u=(e=this.style.map.terrain)==null?void 0:e.getTerrainData(n),c=i.getMeshFromTileID(this.context,n.canonical,!0,!0,"raster"),f=a.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(r,t.TRIANGLES,s,es.disabled,cl.disabled,Ko.backCCW,null,u,f,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,r=this.context.gl;return new es({func:r.NOTEQUAL,mask:255},e,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(e){let r=this.context.gl;return new es({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,r.KEEP,r.KEEP,r.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let r=this.context.gl,t=e.sort((o,s)=>s.overscaledZ-o.overscaledZ),i=t[t.length-1].overscaledZ,a=t[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();let o={};for(let s=0;ss.overscaledZ-o.overscaledZ),i=t[t.length-1].overscaledZ,a=t[0].overscaledZ-i+1;if(this.clearStencil(),a>1){let o={},s={};for(let l=0;l=0;a.currentLayer--){let f=this.style._layers[o[a.currentLayer]];if(f.isHidden(this.transform.zoom))continue;let h=s[f.source],d=l[f.source];this.renderTileClippingMasks(f,d,!1),this.renderLayer(this,h,f,d,a)}a.currentPass="translucent";let c=!1;for(a.currentLayer=0;a.currentLayer0?r.pop():null}acquireRTT(e){let r=this.context.gl,t=this._rttObjectRecyclePool.pop();if(t)return t.size!==e&&(t.texture.update({width:e,height:e,data:null},{premultiply:!1,useMipmap:!0}),t.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),t.size=e),t;let i=new jl(this.context,{width:e,height:e,data:null},r.RGBA,{premultiply:!1,useMipmap:!0});return i.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:i,size:e}}bindRTT(e){let r=this.context.gl,t=e.size;if(!this._rttSharedFbo){let i=this.context.createFramebuffer(t,t,!0,!0),a=this.context.createRenderbuffer(r.DEPTH_STENCIL,t,t);i.depthAttachment.set(a),this._rttSharedFbo={fbo:i,depthRenderbuffer:a,size:t}}this._rttSharedFbo.size!==t&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,t),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=t,this._rttSharedFbo.fbo.height=t,this._rttSharedFbo.size=t),this._rttSharedFbo.fbo.colorAttachment.set(e.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(e){this._rttObjectRecyclePool.push(e)}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let r=this.patternAtlas.getPattern(e.from.toString()),t=this.patternAtlas.getPattern(e.to.toString());return!r||!t}useProgram(e,r,t=!1,i=[]){var a;this.cache||(this.cache={});let o=!!this.style.map.terrain,s=this.style.projection,l=t?id.projectionMercator:s.shaderPreludeCode,n=t?OM:s.shaderDefine,u=`/${t?NM:s.shaderVariantName}`,c=r?r.cacheKey:"",f=this._showOverdrawInspector?"/overdraw":"",h=o?"/terrain":"",d=i?`/${i.join("/")}`:"",p=e+c+u+f+h+d;return(a=this.cache)[p]||(a[p]=new cO(this.context,id[e],r,tN[e],this._showOverdrawInspector,o,l,n,i)),this.cache[p]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}setBaseState(){let 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(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let e=this.context.gl;this.debugOverlayTexture=new jl(this.context,this.debugOverlayCanvas,e.RGBA)}}destroy(){var e,r,t;if(this._tileTextures){for(let i in this._tileTextures){let a=this._tileTextures[i];if(a)for(let o of a)o.destroy()}this._tileTextures={}}for(let i of this._rttObjectRecyclePool)i.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let i=this.context.gl;i.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),i.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}if((e=this.layerOpacityFbo)==null||e.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&((r=this.tileExtentMesh.vertexBuffer)==null||r.destroy()),this.tileExtentMesh&&((t=this.tileExtentMesh.indexBuffer)==null||t.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let i in this.cache){let a=this.cache[i];a?.program&&this.context.gl.deleteProgram(a.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:r}=this.context.gl;return this.width!==e||this.height!==r}},N2.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,N2),sS=class extends Error{constructor(e,r){var t;super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=e,this.statusMessage=(t=r?.statusMessage)!=null?t:null}},lS=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{var r;let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):((r=[...t.keys()][0])!=null?r:"").split("/")},this._onHashChange=()=>{let r=this._getCurrentHash();if(!this._isValidHash(r))return!1;let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(r[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:t,pitch:+(r[4]||0)}),!0},this._updateHashUnthrottled=()=>{let r=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,r)},this._removeHash=()=>{let r=this._getHashParams();if(this._hashName)r.delete(this._hashName);else{let o=Array.from(r.keys());o.length>0&&r.delete(o[0])}let t=decodeURIComponent(r.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=t?`#${t}`:"",a=window.location.href.replace(/(#.+)?$/,i);a=a.replace("&&","&"),window.history.replaceState(window.history.state,null,a)},this._updateHash=qz(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let r=this._map.getCenter(),t=Math.round(this._map.getZoom()*100)/100,i=10**Math.ceil((t*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.round(r.lng*i)/i,o=Math.round(r.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),n="";if(n+=e?`/${a}/${o}/${t}`:`${t}/${o}/${a}`,(s||l)&&(n+=`/${Math.round(s*10)/10}`),l&&(n+=`/${Math.round(l)}`),this._hashName){let u=this._getHashParams();return u.set(this._hashName,n),`#${decodeURIComponent(u.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${n}`}_isValidHash(e){if(e.length<3||e.some(a=>isNaN(+a)))return!1;try{new An(+e[2],+e[1])}catch{return!1}let r=+e[0],t=+(e[3]||0),i=+(e[4]||0);return r>=this._map.getMinZoom()&&r<=this._map.getMaxZoom()&&t>=-180&&t<=180&&i>=this._map.getMinPitch()&&i<=this._map.getMaxPitch()}},Wm={linearity:.3,easing:H4(0,0,.3,1)},YN=yn({deceleration:2500,maxSpeed:1400},Wm),XN=yn({deceleration:20,maxSpeed:1400},Wm),ZN=yn({deceleration:1e3,maxSpeed:360},Wm),KN=yn({deceleration:1e3,maxSpeed:90},Wm),JN=yn({deceleration:1e3,maxSpeed:360},Wm),QN=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:hs(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,r=hs();for(;e.length>0&&r-e[0].time>160;)e.shift()}_getVelocityEntries(){let e=this._inertiaBuffer,r=hs()-60,t=Math.max(0,e.length-2);for(;t>0&&e[t-1].time>=r;)t--;return e.slice(t)}_onMoveEnd(e){this._drainInertiaBuffer();let r=this._getVelocityEntries();if(r.length<2){this.clear();return}let t={zoom:0,bearing:0,pitch:0,roll:0,pan:new Wr(0,0),pinchAround:void 0,around:void 0};for(let{settings:o}of r)o.around&&(t.around=o.around),o.pinchAround&&(t.pinchAround=o.pinchAround);for(let{settings:o}of r.slice(1))t.zoom+=o.zoomDelta||0,t.bearing+=o.bearingDelta||0,t.pitch+=o.pitchDelta||0,t.roll+=o.rollDelta||0,o.panDelta&&t.pan._add(o.panDelta);if(!t.pan.mag()&&!t.zoom&&!t.bearing&&!t.pitch&&!t.roll){this.clear();return}let i=hs()-r[0].time,a={};if(t.pan.mag()){let o=Hg(t.pan.mag(),i,yn({},YN,e||{})),s=t.pan.mult(o.amount/t.pan.mag()),l=this._map._camera.cameraHelper.handlePanInertia(s,this._map._camera.transform);a.center=l.easingCenter,a.offset=l.easingOffset,Gg(a,o)}if(t.zoom){let o=Hg(t.zoom,i,XN);a.zoom=Lf(this._map.getZoom()+o.amount,this._map.getZoomSnap(),o.amount),Gg(a,o)}if(t.bearing){let o=Hg(t.bearing,i,ZN);a.bearing=this._map.getBearing()+to(o.amount,-179,179),Gg(a,o)}if(t.pitch){let o=Hg(t.pitch,i,KN);a.pitch=this._map.getPitch()+o.amount,Gg(a,o)}if(t.roll){let o=Hg(t.roll,i,JN);a.roll=this._map.getRoll()+to(o.amount,-179,179),Gg(a,o)}if(a.zoom||a.bearing){let o=t.pinchAround===void 0?t.around:t.pinchAround;a.around=o?this._map.unproject(o):this._map.getCenter()}return this.clear(),yn(a,{noMoveStart:!0})}},e8=class{constructor(e,r){this._map=e,this._clickTolerance=r.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new gM(this._map,e))}mousedown(e,r){return this._mousedownPos=r,this._firePreventable(new df(e.type,this._map,e))}mouseup(e){this._map.fire(new df(e.type,this._map,e))}click(e,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||this._map.fire(new df(e.type,this._map,e))}dblclick(e){return this._firePreventable(new df(e.type,this._map,e))}mouseover(e){this._map.fire(new df(e.type,this._map,e))}mouseout(e){this._map.fire(new df(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Um(e.type,this._map,e))}touchmove(e){this._map.fire(new Um(e.type,this._map,e))}touchend(e){this._map.fire(new Um(e.type,this._map,e))}touchcancel(e){this._map.fire(new Um(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},t8=class{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new df(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new df("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new df(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},uS=class{constructor(e,r,t){this._map=e,this._tr=t,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1,r.boxZoom&&typeof r.boxZoom=="object"&&(this._boxZoomEnd=r.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&e.button===0&&($n.disableDrag(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(e,r){if(!this._active)return;let t=r;if(this._lastPos.equals(t)||!this._box&&t.dist(this._startPos)a.fitScreenCoordinates(t,i,this._tr.bearing,{linear:!0})}}}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box=(this._box.remove(),null)),$n.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new d2(e,{originalEvent:r}))}},r8=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,t){(this.centroid||t.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),t.length===this.numTouches&&(this.centroid=mse(r),this.touches=fM(t,r)))}touchmove(e,r,t){if(this.aborted||!this.centroid)return;let i=fM(t,r);for(let a in this.touches){let o=this.touches[a],s=i[a];(!s||s.dist(o)>30)&&(this.aborted=!0)}}touchend(e,r,t){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),t.length===0){let i=!this.aborted&&this.centroid;if(this.reset(),i)return i}}},j2=class{constructor(e){this.singleTap=new r8(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,r,t){this.singleTap.touchstart(e,r,t)}touchmove(e,r,t){this.singleTap.touchmove(e,r,t)}touchend(e,r,t){let i=this.singleTap.touchend(e,r,t);if(i){let a=e.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(i)<30;if((!a||!o)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}},i8=class{constructor(e,r){this._tr=r,this._zoomIn=new j2({numTouches:1,numTaps:2}),this._zoomOut=new j2({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,r,t){this._zoomIn.touchstart(e,r,t),this._zoomOut.touchstart(e,r,t)}touchmove(e,r,t){this._zoomIn.touchmove(e,r,t),this._zoomOut.touchmove(e,r,t)}touchend(e,r,t){let i=this._zoomIn.touchend(e,r,t),a=this._zoomOut.touchend(e,r,t),o=this._tr;if(i)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:s=>s.easeTo({duration:300,zoom:Lf(o.zoom+1,s.getZoomSnap()),around:o.unproject(i)},{originalEvent:e})};if(a)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:s=>s.easeTo({duration:300,zoom:Lf(o.zoom-1,s.getZoomSnap()),around:o.unproject(a)},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},Ym=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let r=this._moveFunction(...e);if(r.bearingDelta||r.pitchDelta||r.rollDelta||r.around||r.panDelta)return this._active=!0,r}dragStart(e,r){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(r)?r[0]:r,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,r){if(!this.isEnabled())return;let t=this._lastPoint;if(!t)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let i=Array.isArray(r)?r[0]:r;if(!(!this._moved&&i.dist(t)!0}),r=new n8){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=r}_executeRelevantHandler(e,r,t){if(e instanceof MouseEvent)return r(e);if(typeof TouchEvent<"u"&&e instanceof TouchEvent)return t(e)}startMove(e){this._executeRelevantHandler(e,r=>{this.mouseMoveStateManager.startMove(r)},r=>{this.oneFingerTouchMoveStateManager.startMove(r)})}endMove(e){this._executeRelevantHandler(e,r=>{this.mouseMoveStateManager.endMove(r)},r=>{this.oneFingerTouchMoveStateManager.endMove(r)})}isValidStartEvent(e){return!!this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidStartEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidStartEvent(r))}isValidMoveEvent(e){return!!this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidMoveEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(r))}isValidEndEvent(e){return!!this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidEndEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidEndEvent(r))}},ay=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=r=>{r.preventDefault()}},s8=class{constructor(e,r){this._clickTolerance=e.clickTolerance||1,this._map=r,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new Wr(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,r,t){return this._calculateTransform(e,r,t)}touchmove(e,r,t){if(this._active){if(this._shouldBePrevented(t.length)){this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e);return}return e.preventDefault(),this._calculateTransform(e,r,t)}}touchend(e,r,t){this._calculateTransform(e,r,t),this._active&&this._shouldBePrevented(t.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,t){t.length>0&&(this._active=!0);let i=fM(t,r),a=new Wr(0,0),o=new Wr(0,0),s=0;for(let n in i){let u=i[n],c=this._touches[n];c&&(a._add(u),o._add(u.sub(c)),s++,i[n]=u)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;let l=o.div(s);if(this._sum._add(l),!(this._sum.mag()=2,a=r.mag()>=2;if(!i&&!a)return;if(!i||!a)return this._firstMove===void 0&&(this._firstMove=t),t-this._firstMove<100&&void 0;let o=e.y>0==r.y>0;return hM(e)&&hM(r)&&o}},l8={panStep:100,bearingStep:15,pitchStep:10},pS=class{constructor(e,r){this._tr=r;let t=l8;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let r=0,t=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?t=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?t=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(t=0,i=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:wse,zoom:r?Lf(l.zoom+r*(e.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+t*this._bearingStep,pitch:l.pitch+i*this._pitchStep,offset:[-a*this._panStep,-o*this._panStep],center:l.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}},vS=4.000244140625,mS=class{constructor(e,r,t){this._onTimeout=i=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},this._map=e,this._tr=t,this._triggerRenderFrame=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return this._map.cooperativeGestures.isEnabled()?!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e)):!1}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e)){this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);return}let r=e.deltaMode===WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY,t=hs(),i=t-(this._lastWheelEventTime||0);this._lastWheelEventTime=t,r!==0&&r%vS==0?this._type="wheel":r!==0&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=$n.mousePos(this._map.getCanvas(),e),t=this._tr;this._aroundPoint=this._aroundCenter?t.transform.locationToScreenPoint(An.convert(t.center)):r,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let s=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=s),typeof this._targetZoom=="number"&&(this._targetZoom+=s)}if(this._delta!==0){let s=this._type==="wheel"&&Math.abs(this._delta)>vS?this._wheelZoomRate:this._defaultZoomRate,l=2/(1+Math.exp(-Math.abs(this._delta*s)));this._delta<0&&l!==0&&(l=1/l);let n=typeof this._targetZoom=="number"?Vc(this._targetZoom):e.scale,u=e.applyConstrain(e.getCameraLngLat(),Ku(n*l)).zoom,c=this._map.getZoomSnap();if(this._type==="wheel"&&c>0){let f=Lf(e.zoom,c);this._targetZoom=Lf(u,c,u-f)}else this._targetZoom=u;this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let r=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,t=this._startZoom,i=this._easing,a=!1,o;if(this._type==="wheel"&&t&&i){let s=hs()-this._lastWheelEventTime,l=Math.min((s+5)/200,1),n=i(l);o=Zs.number(t,r,n),l<1?this._needsRerender=!0:a=!0}else o=r,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=o,{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=Sx;if(this._prevEase){let t=this._prevEase,i=(hs()-t.start)/t.duration,a=t.easing(i+.01)-t.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=H4(o,s,.25,1)}return this._prevEase={start:hs(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},gS=class{constructor(e,r){this._clickZoom=e,this._tapZoom=r}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()}},u8=class{constructor(e,r){this._tr=r,this.reset()}reset(){this._active=!1}dblclick(e,r){return e.preventDefault(),{cameraAnimation:t=>{t.easeTo({duration:300,zoom:Lf(this._tr.zoom+(e.shiftKey?-1:1),t.getZoomSnap()),around:this._tr.unproject(r)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},c8=class{constructor(){this._tap=new j2({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,r,t){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(e,r,t);else{let i=r[0],a=e.timeStamp-this._tapTime<500,o=this._tapPoint.dist(i)<30;!a||!o?this.reset():t.length>0&&(this._swipePoint=i,this._swipeTouch=t[0].identifier)}}touchmove(e,r,t){if(!this._tapTime)this._tap.touchmove(e,r,t);else if(this._swipePoint){if(t[0].identifier!==this._swipeTouch)return;let i=r[0],a=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:a/128*this._zoomRate}}}touchend(e,r,t){if(this._tapTime)this._swipePoint&&t.length===0&&this.reset();else{let i=this._tap.touchend(e,r,t);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},yS=class{constructor(e,r,t){this._el=e,this._mousePan=r,this._touchPan=t}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},_S=class{constructor(e,r,t,i){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=r,this._mousePitch=t,this._mouseRoll=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},xS=class{constructor(e,r,t,i){this._el=e,this._touchZoom=r,this._touchRotate=t,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},bS=class{constructor(e,r){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=r,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=$n.create("div","maplibregl-cooperative-gesture-screen",e);let r=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(r=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let t=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=r,this._container.appendChild(i);let a=document.createElement("div");a.className="maplibregl-mobile-message",a.textContent=t,this._container.appendChild(a),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new iu("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},f8=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(Wr.convert(e),this._camera.terrain)}},ny=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate,h8=class extends hf{},d8=class{get _ownerDocument(){var e;return((e=this._el)==null?void 0:e.ownerDocument)||document}get _ownerWindow(){var e,r;return((r=(e=this._el)==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)||window}constructor(e,r,t){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=a=>{this.handleEvent(a,`${a.type}Window`)},this.handleEvent=(a,o)=>{if(a.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let s=a.type==="renderFrame"?void 0:a,l={needsRenderFrame:!1},n={},u={};for(let{handlerName:h,handler:d,allowed:p}of this._handlers){if(!d.isEnabled())continue;let g;if(this._blockedByActive(u,p,h))d.reset();else if(d[o||a.type]){if(hJ(a,o||a.type)){let m=$n.mousePos(this._map.getCanvas(),a);g=d[o||a.type](a,m)}else if(fJ(a,o||a.type)){let m=a.touches,y=this._getMapTouches(m),_=$n.touchPos(this._map.getCanvas(),y);g=d[o||a.type](a,_,y)}else dJ(o||a.type)||(g=d[o||a.type](a));this.mergeHandlerResult(l,n,g,h,s),g?.needsRenderFrame&&this._triggerRenderFrame()}(g||d.isActive())&&(u[h]=d)}let c={};for(let h in this._previousActiveHandlers)u[h]||(c[h]=s);this._previousActiveHandlers=u,(Object.keys(c).length||dM(l))&&(this._changes.push([l,n,c]),this._triggerRenderFrame()),(Object.keys(u).length||dM(l))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:f}=l;f&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],f(this._map))},this._map=e,this._camera=r,this._transformProvider=new f8(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new QN(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);let i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[a,o,s]of this._listeners)a.addEventListener(o,a===this._ownerDocument?this.handleWindowEvent:this.handleEvent,s)}destroy(){for(let[e,r,t]of this._listeners)e.removeEventListener(r,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,t)}_addDefaultHandlers(e){let r=this._map,t=r.getCanvasContainer();this._add("mapEvent",new e8(r,e));let i=r.boxZoom=new uS(r,e,this._transformProvider);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let a=r.cooperativeGestures=new bS(r,e.cooperativeGestures);this._add("cooperativeGestures",a),e.cooperativeGestures&&a.enable();let o=new i8(r,this._transformProvider),s=new u8(r,this._transformProvider);r.doubleClickZoom=new gS(s,o),this._add("tapZoom",o),this._add("clickZoom",s),e.interactive&&e.doubleClickZoom&&r.doubleClickZoom.enable();let l=new c8;this._add("tapDragZoom",l);let n=r.touchPitch=new dS(r);this._add("touchPitch",n),e.interactive&&e.touchPitch&&r.touchPitch.enable(e.touchPitch);let u=()=>r.project(r.getCenter()),c=_se(e,u),f=xse(e),h=bse(e,u);r.dragRotate=new _S(e,c,f,h),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",f,["mouseRotate","mouseRoll"]),this._add("mouseRoll",h,["mousePitch"]),e.interactive&&e.dragRotate&&r.dragRotate.enable();let d=yse(e),p=new s8(e,r);r.dragPan=new yS(t,d,p),this._add("mousePan",d),this._add("touchPan",p,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&r.dragPan.enable(e.dragPan);let g=new hS,m=new fS;r.touchZoomRotate=new xS(t,m,g,l),this._add("touchRotate",g,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&r.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new t8(r));let y=r.scrollZoom=new mS(r,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",y,["mousePan"]),e.interactive&&e.scrollZoom&&r.scrollZoom.enable(e.scrollZoom);let _=r.keyboard=new pS(r,this._transformProvider);this._add("keyboard",_),e.interactive&&e.keyboard&&r.keyboard.enable()}_add(e,r,t){this._handlers.push({handlerName:e,handler:r,allowed:t}),this._handlersById[e]=r}stop(e){if(!this._updatingCamera){for(let{handler:r}of this._handlers)r.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{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!!ny(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,r,t){for(let i in e)if(i!==t&&!r?.includes(i))return!0;return!1}_getMapTouches(e){let r=[];for(let t of e){let i=t.target;this._el.contains(i)&&r.push(t)}return r}mergeHandlerResult(e,r,t,i,a){if(!t)return;yn(e,t);let o={handlerName:i,originalEvent:t.originalEvent||a};t.zoomDelta!==void 0&&(r.zoom=o),t.panDelta!==void 0&&(r.drag=o),t.rollDelta!==void 0&&(r.roll=o),t.pitchDelta!==void 0&&(r.pitch=o),t.bearingDelta!==void 0&&(r.rotate=o)}_applyChanges(){let e={},r={},t={};for(let[i,a,o]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new Wr(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.rollDelta&&(e.rollDelta=(e.rollDelta||0)+i.rollDelta),i.around!==void 0&&(e.around=i.around),i.pinchAround!==void 0&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),yn(r,a),yn(t,o);this._updateMapTransform(e,r,t),this._changes=[]}_updateMapTransform(e,r,t){let i=this._map,a=this._camera.getTransformForUpdate(),o=i.terrain;if(!dM(e)&&!(o&&this._terrainMovement)){this._fireEvents(r,t,!0);return}this._camera.stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:n,pitchDelta:u,rollDelta:c}=e,{around:f,aroundOnSurface:h}=this._resolveAround(e,o,a),d=o?this._terrainGestureElevation(o,f,h,a,r):void 0,p={panDelta:s,zoomDelta:l,rollDelta:c,pitchDelta:u,bearingDelta:n,around:f,aroundElevation:d};this._camera.cameraHelper.useGlobeControls&&!a.isPointOnMapSurface(f)&&(f=a.centerPoint);let g=this._computePreZoomAroundLoc(a,f,s,d);this._handleMapControls({terrain:o,tr:a,deltasForHelper:p,preZoomAroundLoc:g,combinedEventsInProgress:r,panDelta:s}),this._camera.applyUpdatedTransform(a),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(r,t,!0)}_resolveAround(e,r,t){let i=e.pinchAround===void 0?e.around:e.pinchAround;return i||(i=this._camera.transform.centerPoint),r&&!t.isPointOnMapSurface(i)?{around:t.centerPoint,aroundOnSurface:!1}:{around:i,aroundOnSurface:!0}}_terrainGestureElevation(e,r,t,i,a){if(!t)return;if(!this._terrainMovement&&(a.drag||a.zoom)){let s=i.screenTerrainPointToMercatorCoordinate(r,e);this._terrainGestureAnchorElevation=s?s.z:null}if(this._terrainGestureAnchorElevation===null)return;let o=this._terrainGestureAnchorElevation;if(!(r.distSqr(i.centerPoint)<.01)&&!(o-i.elevation>=.9*(i.getCameraAltitude()-i.elevation)))return o}_computePreZoomAroundLoc(e,r,t,i){if(r.distSqr(e.centerPoint)<.01)return e.center;let a=t?r.sub(t):r;return i===void 0?e.screenPointToLocation(a):e.screenPointToLocationAtElevation(a,i)}_handleMapControls({terrain:e,tr:r,deltasForHelper:t,preZoomAroundLoc:i,combinedEventsInProgress:a,panDelta:o}){let s=this._camera.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(t,r),!e){s.handleMapControlsPan(t,r,i);return}if(s.useGlobeControls){!this._terrainMovement&&(a.drag||a.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),s.handleMapControlsPan(t,r,i);return}if(!this._terrainMovement&&(a.drag||a.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,s.handleMapControlsPan(t,r,i);return}if(t.aroundElevation===void 0&&a.drag&&this._terrainMovement&&o){r.setCenter(r.screenPointToLocation(r.centerPoint.sub(o)));return}s.handleMapControlsPan(t,r,i)}_fireEvents(e,r,t){let i=ny(this._eventsInProgress),a=ny(e),o={};for(let c in e){let{originalEvent:f}=e[c];this._eventsInProgress[c]||(o[`${c}start`]=f),this._eventsInProgress[c]=e[c]}!i&&a&&this._fireEvent("movestart",a.originalEvent);for(let c in o)this._fireEvent(c,o[c]);a&&this._fireEvent("move",a.originalEvent);for(let c in e){let{originalEvent:f}=e[c];this._fireEvent(c,f)}let s={},l;for(let c in this._eventsInProgress){let{handlerName:f,originalEvent:h}=this._eventsInProgress[c];this._handlersById[f].isActive()||(delete this._eventsInProgress[c],l=r[f]||h,s[`${c}end`]=l)}for(let c in s)this._fireEvent(c,s[c]);let n=ny(this._eventsInProgress),u=(i||a)&&!n;if(u&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let c=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&c.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(c)}if(t&&u){this._updatingCamera=!0;let c=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),f=h=>h!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new h8("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},p8=class extends Nl{constructor(e){var r,t,i;super(),this._renderFrameCallback=()=>{let a=Math.min((hs()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new Jg,this.cameraHelper=new Qg,e.minZoom!==void 0&&this.transform.setMinZoom(e.minZoom),e.maxZoom!==void 0&&this.transform.setMaxZoom(e.maxZoom),e.minPitch!==void 0&&this.transform.setMinPitch(e.minPitch),e.maxPitch!==void 0&&this.transform.setMaxPitch(e.maxPitch),e.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(e.renderWorldCopies),e.transformConstrain!==null&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=(r=e.centerClampedToGround)!=null?r:!0,this.transformCameraUpdate=(t=e.transformCameraUpdate)!=null?t:null,this._stopHandlers=(i=e.stopHandlers)!=null?i:(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,r){if(e.apply(this.transform,!0),this.transform=e,this.cameraHelper=r,this._requestedCameraState){let t=e.clone();t.apply(this._requestedCameraState,!0),this._requestedCameraState=t}}getCenter(){return new An(this.transform.center.lng,this.transform.center.lat)}setCenter(e,r){return this.jumpTo({center:e},r)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,r){return this.jumpTo({elevation:e},r),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,r,t){return e=Wr.convert(e).mult(-1),this.panTo(this.transform.center,yn({offset:e},r),t)}panTo(e,r,t){return this.easeTo(yn({center:e},r),t)}getZoom(){return this.transform.zoom}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomTo(e,r,t){return this.easeTo(yn({zoom:e},r),t)}zoomIn(e,r){return this.zoomTo(Lf(this.getZoom()+1,this._zoomSnap),e,r),this}zoomOut(e,r){return this.zoomTo(Lf(this.getZoom()-1,this._zoomSnap),e,r),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,r){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new kn("movestart",r)).fire(new kn("move",r)).fire(new kn("moveend",r))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,r){return this.jumpTo({bearing:e},r),this}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(e,r,t){return this.easeTo(yn({bearing:e},r),t)}resetNorth(e,r){return this.rotateTo(0,yn({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(yn({bearing:0,pitch:0,roll:0,duration:1e3},e),r),this}snapToNorth(e,r){return Math.abs(this.getBearing()){p.easeFunc(g),this.terrain&&!e.freezeElevation&&this._updateElevation(g),this.applyUpdatedTransform(t),this._fireMoveEvents(r)},g=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,g)},e),this}_prepareEase(e,r,t={}){this._moving=!0,!r&&!t.moving&&this.fire(new kn("movestart",e)),this._zooming&&!t.zooming&&this.fire(new kn("zoomstart",e)),this._rotating&&!t.rotating&&this.fire(new kn("rotatestart",e)),this._pitching&&!t.pitching&&this.fire(new kn("pitchstart",e)),this._rolling&&!t.rolling&&this.fire(new kn("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(e,this.transform),this.elevationFreeze=!0}_updateElevation(e){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let r=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(e<1&&r!==this._elevationTarget){let t=this._elevationTarget-this._elevationStart,i=(r-(t*e+this._elevationStart))/(1-e);this._elevationStart+=e*(t-i),this._elevationTarget=r}this.transform.setElevation(Zs.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState)}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};let r=e.getCameraLngLat(),t=e.getCameraAltitude(),i=this.terrain?this.terrain.getElevationForLngLatZoom(r,e.zoom):0;if(tthis._elevateCameraIfInsideTerrain(i)),this.transformCameraUpdate&&r.push(i=>this.transformCameraUpdate(i)),!r.length)return;let t=e.clone();for(let i of r){let a=t.clone(),{center:o,zoom:s,roll:l,pitch:n,bearing:u,elevation:c}=i(a);o&&a.setCenter(o),c!==void 0&&a.setElevation(c),s!==void 0&&a.setZoom(s),l!==void 0&&a.setRoll(l),n!==void 0&&a.setPitch(n),u!==void 0&&a.setBearing(u),t.apply(a,!1)}this.transform.apply(t,!1)}_fireMoveEvents(e){this.fire(new kn("move",e)),this._zooming&&this.fire(new kn("zoom",e)),this._rotating&&this.fire(new kn("rotate",e)),this._pitching&&this.fire(new kn("pitch",e)),this._rolling&&this.fire(new kn("roll",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;let t=this._zooming,i=this._rotating,a=this._pitching,o=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,t&&this.fire(new kn("zoomend",e)),i&&this.fire(new kn("rotateend",e)),a&&this.fire(new kn("pitchend",e)),o&&this.fire(new kn("rollend",e)),this.fire(new kn("moveend",e))}flyTo(e,r){if(!e.essential&&yc.prefersReducedMotion){let T=j1(e,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(T,r)}this.stop(),e=yn({offset:[0,0],speed:1.2,curve:1.42,easing:Sx},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Lf(e.zoom,this._zoomSnap));let t=this.getTransformForUpdate(),i=t.bearing,a=t.pitch,o=t.roll,s=t.padding,l=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),n=e.pitch===void 0?a:+e.pitch,u=e.roll===void 0?o:this._normalizeBearing(e.roll,o),c=e.padding===void 0?t.padding:e.padding,f=Wr.convert(e.offset),h=t.centerPoint.add(f),d=t.screenPointToLocation(h),p=this.cameraHelper.handleFlyTo(t,{bearing:l,pitch:n,roll:u,padding:c,locationAtOffset:d,offsetAsPoint:f,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),g=e.curve,m=Math.max(t.width,t.height),y=m/p.scaleOfZoom,_=p.pixelPathLength,v=m/p.scaleOfMinZoom;g=Math.min(g,Math.sqrt(v/_*2));let x=g*g;function S(T){let F=(y*y-m*m+(T?-1:1)*x*x*_*_)/(2*(T?y:m)*x*_);return Math.log(Math.sqrt(F*F+1)-F)}function M(T){return(Math.exp(T)-Math.exp(-T))/2}function C(T){return(Math.exp(T)+Math.exp(-T))/2}function w(T){return M(T)/C(T)}let k=S(!1),A=function(T){return C(k)/C(k+g*T)},b=function(T){return m*((C(k)*w(k+g*T)-M(k))/x)/_},E=(S(!0)-k)/g;if(Math.abs(_)<2e-6||!isFinite(E)){if(Math.abs(m-y)<1e-6)return this.easeTo(e,r);let T=y0,A=F=>Math.exp(T*g*F)}if(e.duration!==void 0)e.duration=+e.duration;else{let T=e.screenSpeed===void 0?+e.speed:+e.screenSpeed/g;e.duration=1e3*E/T}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=i!==l,this._pitching=n!==a,this._rolling=u!==o,this._padding=!t.isPaddingEqual(c),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(p.targetCenter),this._ease(T=>{let F=T*E,D=1/A(F),R=b(F);this._rotating&&t.setBearing(Zs.number(i,l,T)),this._pitching&&t.setPitch(Zs.number(a,n,T)),this._rolling&&t.setRoll(Zs.number(o,u,T)),this._padding&&(t.interpolatePadding(s,c,T),h=t.centerPoint.add(f)),p.easeFunc(T,D,R,h),this.terrain&&!e.freezeElevation&&this._updateElevation(T),this.applyUpdatedTransform(t),this._fireMoveEvents(r)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,r){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,r)}return e||this._stopHandlers(),this}_ease(e,r,t){t.animate===!1||t.duration===0?(e(1),r()):(this._easeStart=hs(),this._easeOptions=t,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=fh(e,-180,180);let t=Math.abs(e-r);return Math.abs(e-360-r)MapLibre
'},TS=class{constructor(e=wS){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=r=>{r&&(r.type==="terrain"||r.dataType==="style"||r.dataType==="source"&&(r.sourceDataType==="metadata"||r.sourceDataType==="visibility"))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):!this._container.classList.contains("maplibregl-compact")&&!this._container.classList.contains("maplibregl-attrib-empty")&&(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=$n.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=$n.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=$n.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,r){let t=this._map._getUIString(`AttributionControl.${r}`);e.title=t,e.setAttribute("aria-label",t)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(i=>typeof i=="string"?i:"")):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let i=this._map.style.stylesheet;this.styleOwner=i.owner,this.styleId=i.id}let r=this._map.style.tileManagers;for(let i in r){let a=r[i];if(a.used||a.usedForTerrain){let o=a.getSource();o.attribution&&!e.includes(o.attribution)&&e.push(o.attribution)}}e=e.filter(i=>String(i).trim()),e.sort((i,a)=>i.length-a.length),e=e.filter((i,a)=>{for(let o=a+1;o{let r=this._container.children;if(r.length){let t=r[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){var r;this._map=e,this._compact=(r=this.options)==null?void 0:r.compact,this._container=$n.create("div","maplibregl-ctrl");let t=$n.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},v8=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let r=++this._id;return this._queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){let r=this._currentlyRunning,t=r?this._queue.concat(r):this._queue;for(let i of t)if(i.id===e){i.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let r=this._currentlyRunning=this._queue;this._queue=[];let t=!1,i;for(let a of r)if(!a.cancelled){try{a.callback(e)}catch(o){t||(t=!0,i=o)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,t)throw i}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},MS=["none","zoom","sourceTiles","visibleLayers","revision"],m8=class{constructor(e,r,t,i){this._tileKeys=e.map(a=>a.key).sort().join(),this._revision=r,this._zoom=t,this._visibleLayerIds=i}difference(e){return this._revision===e?._revision?this._visibleLayerIds===e._visibleLayerIds?this._tileKeys===e._tileKeys?this._zoom===e._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},nv={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0},g8=class{constructor(e,r){this.needsFollowUpFrame=!1,this.painter=e,this.terrain=r,this.rttSize=r.tileManager.tileSize*r.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}prepareForRender(e,r){let t=r!==this._lastPrepareZoom;this._lastPrepareZoom=r,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(l=>!e._layers[l].isHidden(r));let i=this._renderableLayerIds.join(),a=new Set;for(let l of this._renderableLayerIds){let n=e._layers[l],u=n.source;u&&nv[n.type]&&a.add(u)}this._coordsAscending={},this._rttFingerprints={};for(let l of a){let n=e.tileManagers[l];if(!n)continue;this._coordsAscending[l]={};let u=this._coordsAscending[l],c=n.getSource(),f=c instanceof iv?c.terrainTileRanges:null;for(let p of n.getVisibleCoordinates()){let g=this.terrain.tileManager.getTerrainCoords(p,f);for(let m in g)u[m]||(u[m]=[]),u[m].push(g[m])}this._rttFingerprints[l]={};let h=this._rttFingerprints[l],d=n.getState().revision;for(let p in u)h[p]=new m8(u[p],d,r,i)}this.needsFollowUpFrame=!1;let o=t||this.painter.options.moving,s=!1;for(let l of this._renderableTiles){let n=this._textureDifference(l);n!=="none"&&(n==="zoom"&&o||n==="visibleLayers"&&t?this.needsFollowUpFrame=!0:n==="zoom"||n==="sourceTiles"?(s?this.needsFollowUpFrame=!0:l.releaseRTT(this.painter),s=!0):l.releaseRTT(this.painter))}}_textureDifference(e){let r="none";for(let t in this._rttFingerprints){let i=this._rttFingerprints[t][e.tileID.key];if(!i)continue;let a=i.difference(e.rttFingerprint[t]);MS.indexOf(a)>MS.indexOf(r)&&(r=a)}return r}renderLayer(e,r){if(e.isHidden(this.painter.transform.zoom))return!1;let t=ar(Nt({},r),{isRenderingToTexture:!0}),i=e.type,a=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(nv[i]&&((!this._prevType||!nv[this._prevType])&&this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(e.id),!o))return!0;if(nv[this._prevType]||nv[i]&&o){this._prevType=i;let s=this._stacks.length-1,l=this._stacks[s]||[];for(let n of this._renderableTiles){if(this._rttTiles.push(n),n.getRTT(s))continue;let u=n.acquireRTT(a,s,this.rttSize);a.bindRTT(u),a.context.clear({color:ro.transparent,stencil:0}),a.currentStencilSource=void 0;for(let c of l){let f=a.style._layers[c],h=f.source?this._coordsAscending[f.source][n.tileID.key]:[n.tileID];a.context.viewport.set([0,0,this.rttSize,this.rttSize]),a.renderTileClippingMasks(f,h,!0),a.renderLayer(a,a.style.tileManagers[f.source],f,h,t),f.source&&(n.rttFingerprint[f.source]=this._rttFingerprints[f.source][n.tileID.key])}u.texture.generateMipmap()}return fse(this.painter,this.terrain,this._rttTiles,t),this._rttTiles=[],nv[i]}return!1}},y8={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},_8=vM,SS={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:wS,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:ff.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},ES=class extends Nl{get _ownerWindow(){var e,r;return((r=(e=this._container)==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)||window}constructor(e){var r,t,i;super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new v8,this._controls=[],this._mapId=x9(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=l=>{if(l.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style){this.fire(new Yg("webglcontextlost",{originalEvent:l}));return}for(let n of Object.values(this.style._layers))if(n.type==="custom"&&console.warn(`Custom layer with id '${n.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),n._listeners)for(let[u]of Object.entries(n._listeners))console.warn(`Custom layer with id '${n.id}' had event listeners for event '${u}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new Yg("webglcontextlost",{originalEvent:l}))},this._contextRestored=l=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style){this.style.imageManager.images=this._lostContextStyle.images;for(let n in this._lostContextStyle.images){let u=this._lostContextStyle.images[n];u.isWebGLImage&&this.style.imageManager.updateImage(n,u,!1)}}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(n){this.fire(new Ln(n));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new Yg("webglcontextrestored",{originalEvent:l}))},this._onMapScroll=l=>{if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let a=ar(Nt(Nt({},SS),e),{canvasContextAttributes:Nt(Nt({},SS.canvasContextAttributes),e.canvasContextAttributes)});if(a.minZoom!=null&&a.maxZoom!=null&&a.minZoom>a.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(a.minPitch!=null&&a.maxPitch!=null&&a.minPitch>a.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(a.minPitch!=null&&a.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(a.maxPitch!=null&&a.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new p8({minZoom:a.minZoom,maxZoom:a.maxZoom,minPitch:a.minPitch,maxPitch:a.maxPitch,bearingSnap:a.bearingSnap,zoomSnap:a.zoomSnap,renderWorldCopies:a.renderWorldCopies,centerClampedToGround:a.centerClampedToGround,terrain:this.terrain,transformConstrain:a.transformConstrain,requestRenderFrame:l=>this._requestRenderFrame(l),cancelRenderFrame:l=>this._cancelRenderFrame(l),transformCameraUpdate:a.transformCameraUpdate,stopHandlers:()=>{var l;return(l=this._handlers)==null?void 0:l.stop(!1)}}),this._camera.setEventedParent(this),this._interactive=a.interactive,this._maxTileCacheSize=a.maxTileCacheSize,this._maxTileCacheZoomLevels=a.maxTileCacheZoomLevels,this._canvasContextAttributes=Nt({},a.canvasContextAttributes),this._trackResize=a.trackResize===!0,this._terrainSkirtLength=a.terrainSkirtLength,this._refreshExpiredTiles=a.refreshExpiredTiles===!0,this._fadeDuration=a.fadeDuration,this._crossSourceCollisions=a.crossSourceCollisions===!0,this._collectResourceTiming=a.collectResourceTiming===!0,this._locale=Nt(Nt({},y8),a.locale),this._clickTolerance=a.clickTolerance,this._overridePixelRatio=a.pixelRatio,this._maxCanvasSize=a.maxCanvasSize,this._zoomLevelsToOverscale=a.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=a.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(a.anisotropicFilterPitch),a.reduceMotion!==void 0&&(yc.prefersReducedMotion=a.reduceMotion),this._requestManager=new Zz(a.transformRequest),this._container=this._resolveContainer(a.container),a.maxBounds&&this.setMaxBounds(a.maxBounds),this._setupContainer();try{this._setupPainter()}catch(l){throw this._cleanupContainer(),l}this._imageQueueHandle=rd.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new d8(this,this._camera,a),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let o=typeof a.hash=="string"&&a.hash||void 0;this._hash=a.hash?new lS(o).addTo(this):void 0,(r=this._hash)!=null&&r._onHashChange()||(this.jumpTo({center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,roll:a.roll}),a.bounds&&(this.resize(),this.fitBounds(a.bounds,yn({},a.fitBoundsOptions,{duration:0}))));let s=typeof a.style=="string"||((i=(t=a.style)==null?void 0:t.projection)==null?void 0:i.type)!=="globe";this.resize(null,s),this._localIdeographFontFamily=a.localIdeographFontFamily,this._validateStyle=a.validateStyle,a.style&&this.setStyle(a.style,{localIdeographFontFamily:a.localIdeographFontFamily}),a.attributionControl&&this.addControl(new TS(typeof a.attributionControl=="boolean"?void 0:a.attributionControl)),a.maplibreLogo&&this.addControl(new AS,a.logoPosition),this.on("style.load",()=>{if(s||this._resizeTransform(),this._camera.transform.unmodified){let l=j1(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(l)}}),this.on("data",l=>{this._update(l.dataType==="style"),this.fire(l.dataType==="style"?new Nf("styledata",l):new Bs("sourcedata",l))}),this.on("dataloading",l=>{this.fire(l.dataType==="style"?new Nf("styledataloading",l):new Bs("sourcedataloading",l))}),this.on("dataabort",l=>{this.fire(new Bs("sourcedataabort",l))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,r){return this.style.setGlobalStateProperty(e,r),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,r){if(r===void 0&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new Ln(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let t=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[r];return r.includes("bottom")?i.insertBefore(t,i.firstChild):i.appendChild(t),this}removeControl(e){if(!e?.onRemove)return this.fire(new Ln(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return Om(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new An(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,r){return this._camera.setCenter(e,r),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,r){return this._camera.setCenterElevation(e,r),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,r,t){return this._camera.panBy(e,r,t),this}panTo(e,r,t){return this._camera.panTo(e,r,t),this}getZoom(){return this._camera.transform.zoom}setZoom(e,r){return this._camera.setZoom(e,r),this}zoomTo(e,r,t){return this._camera.zoomTo(e,r,t),this}zoomIn(e,r){return this._camera.zoomIn(e,r),this}zoomOut(e,r){return this._camera.zoomOut(e,r),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,r){return this._camera.setVerticalFieldOfView(e,r),this}getBearing(){return this._camera.transform.bearing}setBearing(e,r){return this._camera.setBearing(e,r),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,r){return this._camera.setPadding(e,r),this}rotateTo(e,r,t){return this._camera.rotateTo(e,r,t),this}resetNorth(e,r){return this._camera.resetNorth(e,r),this}resetNorthPitch(e,r){return this._camera.resetNorthPitch(e,r),this}snapToNorth(e,r){return this._camera.snapToNorth(e,r),this}getPitch(){return this._camera.transform.pitch}setPitch(e,r){return this._camera.setPitch(e,r),this}getRoll(){return this._camera.transform.roll}setRoll(e,r){return this._camera.setRoll(e,r),this}cameraForBounds(e,r){return this._camera.cameraForBounds(e,r)}fitBounds(e,r,t){return this._camera.fitBounds(e,r,t),this}fitScreenCoordinates(e,r,t,i,a){return this._camera.fitScreenCoordinates(e,r,t,i,a),this}jumpTo(e,r){return this._camera.jumpTo(e,r),this}calculateCameraOptionsFromCameraLngLatAltRotation(e,r,t,i,a){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,r,t,i,a)}easeTo(e,r){return this._camera.easeTo(e,r),this}flyTo(e,r){return this._camera.flyTo(e,r),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(An.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,r,t,i){return i==null&&this.terrain&&(i=this.terrain.getElevationForLngLat(t,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(e,r,t,i??0)}resize(e,r=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(r);let t=!this._camera._moving;return t&&(this.stop(),this.fire(new kn("movestart",e)).fire(new kn("move",e))),this.fire(new iu("resize",e)),t&&this.fire(new kn("moveend",e)),this}_resizeInternal(e=!0){let[r,t]=this._containerDimensions(),i=this._getClampedPixelRatio(r,t);if(this._resizeCanvas(r,t,i),this.painter.resize(r,t,i),this.painter.overLimit()){let a=this.painter.context.gl;this._maxCanvasSize=[a.drawingBufferWidth,a.drawingBufferHeight];let o=this._getClampedPixelRatio(r,t);this._resizeCanvas(r,t,o),this.painter.resize(r,t,o)}this._resizeTransform(e)}_resizeTransform(e=!0){var r;let[t,i]=this._containerDimensions();this._camera.transform.resize(t,i,e),(r=this._camera._requestedCameraState)==null||r.resize(t,i,e)}_getClampedPixelRatio(e,r){let{0:t,1:i}=this._maxCanvasSize,a=this.getPixelRatio(),o=e*a,s=r*a,l=o>t?t/o:1,n=s>i?i/s:1,u=Math.min(l,n);return u<1&&To("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),u*a}getPixelRatio(){var e;return(e=this._overridePixelRatio)!=null?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.transform.setMaxBounds(wh.convert(e)),this._update()}setMinZoom(e){if(e??(e=-2),e>=-2&&e<=this._camera.transform.maxZoom){let r=this._camera.transform.zoom,t=this._camera.getTransformForUpdate();return t.setMinZoom(e),this._camera.applyUpdatedTransform(t),this._update(),r!==this._camera.transform.zoom&&this.fire(new kn("zoomstart")).fire(new kn("zoom")).fire(new kn("zoomend")).fire(new kn("movestart")).fire(new kn("move")).fire(new kn("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(e=!1){let r=this._camera.transform;return e?r.applyConstrain(r.center,r.minZoom).zoom:r.minZoom}setMaxZoom(e){if(e??(e=22),e>=this._camera.transform.minZoom){let r=this._camera.transform.zoom,t=this._camera.getTransformForUpdate();return t.setMaxZoom(e),this._camera.applyUpdatedTransform(t),this._update(),r!==this._camera.transform.zoom&&this.fire(new kn("zoomstart")).fire(new kn("zoom")).fire(new kn("zoomend")).fire(new kn("movestart")).fire(new kn("move")).fire(new kn("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??(e=0),e<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this._camera.transform.maxPitch){let r=this._camera.transform.pitch,t=this._camera.getTransformForUpdate();return t.setMinPitch(e),this._camera.applyUpdatedTransform(t),this._update(),r!==this._camera.transform.pitch&&this.fire(new kn("pitchstart")).fire(new kn("pitch")).fire(new kn("pitchend")).fire(new kn("movestart")).fire(new kn("move")).fire(new kn("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??(e=60),e>180)throw Error("maxPitch must be less than or equal to 180");if(e>=this._camera.transform.minPitch){let r=this._camera.transform.pitch,t=this._camera.getTransformForUpdate();return t.setMaxPitch(e),this._camera.applyUpdatedTransform(t),this._update(),r!==this._camera.transform.pitch&&this.fire(new kn("pitchstart")).fire(new kn("pitch")).fire(new kn("pitchend")).fire(new kn("movestart")).fire(new kn("move")).fire(new kn("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??(e=20),e>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(e<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.transform.setRenderWorldCopies(e),this._update()}setTransformConstrain(e){return this._camera.transform.setConstrainOverride(e),this._update()}project(e){return this._camera.transform.locationToScreenPoint(An.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(Wr.convert(e),this.terrain)}isMoving(){var e;return this._camera.isMoving()||((e=this._handlers)==null?void 0:e.isMoving())||!1}isZooming(){var e;return this._camera.isZooming()||((e=this._handlers)==null?void 0:e.isZooming())||!1}isRotating(){var e;return this._camera.isRotating()||((e=this._handlers)==null?void 0:e.isRotating())||!1}_createDelegatedListener(e,r,t){if(e==="mouseenter"||e==="mouseover"){let i=!1;return{layers:r,listener:t,delegates:{mousemove:a=>{let o=r.filter(l=>this.getLayer(l)),s=o.length===0?[]:this.queryRenderedFeatures(a.point,{layers:o});s.length?i||(i=!0,t.call(this,new df(e,this,a.originalEvent,{features:s}))):i=!1},mouseout:()=>{i=!1}}}}if(e==="mouseleave"||e==="mouseout"){let i=!1;return{layers:r,listener:t,delegates:{mousemove:a=>{let o=r.filter(s=>this.getLayer(s));(o.length===0?[]:this.queryRenderedFeatures(a.point,{layers:o})).length?i=!0:i&&(i=!1,t.call(this,new df(e,this,a.originalEvent)))},mouseout:a=>{i&&(i=!1,t.call(this,new df(e,this,a.originalEvent)))}}}}{let i=a=>{let o=r.filter(l=>this.getLayer(l)),s=o.length===0?[]:this.queryRenderedFeatures(a.point,{layers:o});s.length&&(a.features=s,t.call(this,a),delete a.features)};return{layers:r,listener:t,delegates:{[e]:i}}}}_saveDelegatedListener(e,r){var t;this._delegatedListeners||(this._delegatedListeners={}),(t=this._delegatedListeners)[e]||(t[e]=[]),this._delegatedListeners[e].push(r)}_removeDelegatedListener(e,r,t){var i;if(!((i=this._delegatedListeners)!=null&&i[e]))return;let a=this._delegatedListeners[e];for(let o=0;or.includes(l))){for(let l in s.delegates)this.off(l,s.delegates[l]);a.splice(o,1);return}}}on(e,r,t){if(t===void 0)return super.on(e,r);let i=typeof r=="string"?[r]:r,a=this._createDelegatedListener(e,i,t);this._saveDelegatedListener(e,a);for(let o in a.delegates)this.on(o,a.delegates[o]);return{unsubscribe:()=>{this._removeDelegatedListener(e,i,t)}}}once(e,r,t){if(t===void 0)return super.once(e,r);let i=typeof r=="string"?[r]:r,a=this._createDelegatedListener(e,i,t);for(let o in a.delegates){let s=a.delegates[o];a.delegates[o]=(...l)=>{this._removeDelegatedListener(e,i,t),s(...l)}}this._saveDelegatedListener(e,a);for(let o in a.delegates)this.once(o,a.delegates[o]);return this}off(e,r,t){if(t===void 0)return super.off(e,r);let i=typeof r=="string"?[r]:r;return this._removeDelegatedListener(e,i,t),this}queryRenderedFeatures(e,r){if(!this.style)return[];let t,i=e instanceof Wr||Array.isArray(e),a=i?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(r||(r=(i?{}:e)||{}),a instanceof Wr||typeof a[0]=="number")t=[Wr.convert(a)];else{let o=Wr.convert(a[0]),s=Wr.convert(a[1]);t=[o,new Wr(s.x,o.y),s,new Wr(o.x,s.y),o]}return this.style.queryRenderedFeatures(t,r,this._camera.transform)}querySourceFeatures(e,r){return this.style.querySourceFeatures(e,r)}setStyle(e,r){return r=yn({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r),this._styleUrl=typeof e=="string"?e:null,r.diff!==!1&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let r=this._locale[e];if(r==null)throw Error(`Missing UI string '${e}'`);return r}_updateStyle(e,r){var t,i,a;if((t=this._diffStyleRequest)==null||t.abort(),this._diffStyleRequest=null,r.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(e,r));return}let o=this.style&&r.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e)this.style=new L2(this,r||{});else return this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),(a=(i=this.style)==null?void 0:i.projection)==null||a.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof e=="string"?this.style.loadURL(e,r,o):this.style.loadJSON(e,r,o),this}_lazyInitEmptyStyle(){this.style||(this.style=new L2(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,r){return Xr(this,null,function*(){var t;if((t=this._diffStyleRequest)==null||t.abort(),typeof e=="string"){let i=e;this._diffStyleRequest=new AbortController;let a=this._diffStyleRequest;try{let o=yield this._requestManager.transformRequest(i,"Style");if(a.signal.aborted){this._diffStyleRequest=null;return}let s=yield mg(o,a);this._diffStyleRequest=null,this._updateDiff(s.data,r)}catch(o){this._diffStyleRequest=null,Up(o)||this.fire(new Ln(Zu(o)))}}else typeof e=="object"&&(this._diffStyleRequest=null,this._updateDiff(e,r))})}_updateDiff(e,r){try{this.style.setState(e,r)&&this._update(!0)}catch(t){To(`Unable to perform style diff: ${Zu(t).message}. Rebuilding the style from scratch.`),this._updateStyle(e,r)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style){To("There is no style added to the map.");return}return this.style.loaded()}addSource(e,r){return this._lazyInitEmptyStyle(),this.style.addSource(e,r),this._update(!0)}isSourceLoaded(e){var r;let t=(r=this.style)==null?void 0:r.tileManagers[e];if(t===void 0){this.fire(new Ln(Error(`There is no tile manager with ID '${e}'`)));return}return t.loaded()}setTerrain(e,r={}){if(this.style._checkLoaded(),e&&eg(this,Hc.terrain,{value:e},r))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!e)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);else{let t=this.style.tileManagers[e.source];if(!t)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&t.reload();for(let i in this.style._layers){let a=this.style._layers[i];a.type==="hillshade"&&a.source===e.source&&To("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),a.type==="color-relief"&&a.source===e.source&&To("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new ZB(this.painter,t,e,this._terrainSkirtLength),this.painter.renderToTexture=new g8(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=i=>this._handleTerrainDataEvent(i,e.source),this.style.on("data",this._terrainDataCallback)}return this.style.triggerSymbolPlacement(),this.fire(new yM({terrain:e})),this}_handleTerrainDataEvent(e,r){var t;if(e.dataType==="style"){this.terrain.tileManager.releaseAllRTT();return}let i=e.sourceId===r;if(i&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),i&&e.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),e.tile){if(((t=e.source)==null?void 0:t.type)==="image"){this.terrain.tileManager.releaseAllRTT();return}this.terrain.tileManager.releaseRTT(e.tile.tileID)}}getTerrain(){var e,r;return(r=(e=this.terrain)==null?void 0:e.options)!=null?r:null}areTilesLoaded(){var e;let r=(e=this.style)==null?void 0:e.tileManagers;for(let t of Object.values(r))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){var r;return(r=this.style)==null?void 0:r.getSource(e)}setSourceTileLodParams(e,r,t){if(t){let i=this.getSource(t);if(!i)throw Error(`There is no source with ID "${t}", cannot set LOD parameters`);i.calculateTileZoom=HA(Math.max(1,e),Math.max(1,r))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=HA(Math.max(1,e),Math.max(1,r));return this._update(!0),this}refreshTiles(e,r){let t=this.style.tileManagers[e];if(!t)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);r===void 0?t.reload(!0):t.refreshTiles(r.map(i=>new zg(i.z,i.x,i.y)))}addImage(e,r,t={}){var i;this._lazyInitEmptyStyle();let a=this._createStyleImage(r,t);return a?(this.style.addImage(e,a),(i=a.userImage)!=null&&i.onAdd&&a.userImage.onAdd(this,e),this):this}setMissingStyleImageResolver(e){var r;return this._missingStyleImageResolver=e,(r=this.style)==null||r.setMissingImageResolver(e),this}_createStyleImage(e,r={}){let{pixelRatio:t=1,sdf:i=!1,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:n}=r;if(e instanceof HTMLImageElement||I0(e)){let{width:u,height:c,data:f}=yc.getImageData(e);return{data:new zs({width:u,height:c},f),pixelRatio:t,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:n,sdf:i,version:0}}if(e.width===void 0||e.height===void 0)return this.fire(new Ln(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`"))),null;{let{width:u,height:c,data:f}=e,h=e,d=ux(h.data);return{data:d?new zs({width:u,height:c}):new zs({width:u,height:c},new Uint8Array(f)),pixelRatio:t,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:n,sdf:i,version:0,isWebGLImage:d,userImage:h}}}updateImage(e,r){let t=this.style.getImage(e);if(!t)return this.fire(new Ln(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:a,data:o}=r instanceof HTMLImageElement||I0(r)?yc.getImageData(r):r;if(i===void 0||a===void 0)return this.fire(new Ln(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(i!==t.data.width||a!==t.data.height)return this.fire(new Ln(Error("The width and height of the updated image must be that same as the previous version of the image")));if(t.isWebGLImage=ux(o),t.isWebGLImage)t.userImage=r;else{let s=!(r instanceof HTMLImageElement||I0(r));t.data.replace(o,s)}return this.style.updateImage(e,t),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new Ln(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return Xr(this,null,function*(){let r=yield rd.getImage(yield this._requestManager.transformRequest(e,"Image"),new AbortController);if(!r.data)throw Error(`Could not load image ${e}: the response is empty`);return r})}listImages(){var e,r;return(r=(e=this.style)==null?void 0:e.listImages())!=null?r:[]}addLayer(e,r){return this._lazyInitEmptyStyle(),this.style.addLayer(e,r),this._update(!0)}moveLayer(e,r){return this.style.moveLayer(e,r),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){var r;return(r=this.style)==null?void 0:r.getLayer(e)}getLayersOrder(){var e,r;return(r=(e=this.style)==null?void 0:e.getLayersOrder())!=null?r:[]}setLayerZoomRange(e,r,t){return this.style.setLayerZoomRange(e,r,t),this._update(!0)}setFilter(e,r,t={}){var i;return(i=this.style)==null||i.setFilter(e,r,t),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,r,t,i={}){var a;return(a=this.style)==null||a.setPaintProperty(e,r,t,i),this._update(!0)}getPaintProperty(e,r){return this.style.getPaintProperty(e,r)}setLayoutProperty(e,r,t,i={}){return this.style.setLayoutProperty(e,r,t,i),this._update(!0)}getLayoutProperty(e,r){return this.style.getLayoutProperty(e,r)}setGlyphs(e,r={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,r),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(e){return this._lazyInitEmptyStyle(),this.style.setFontFaces(e),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(e,r,t={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,r,t,i=>{i||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,r={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,r,t=>{t||this._update(!0)}),this}setLight(e,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,r),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,r={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,r),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,r){return this.style.setFeatureState(e,r),this._update()}removeFeatureState(e,r){return this.style.removeFeatureState(e,r),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,r=0;return this._container&&(e=this._container.clientWidth||400,r=this._container.clientHeight||300),[e,r]}_shouldHandleInitialResize(){var e;if(!((e=this._container)!=null&&e.clientWidth)||!this._container.clientHeight)return!1;let[r,t]=this._containerDimensions();return r!==this._camera.transform.width||t!==this._camera.transform.height}_setupResizeObserver(){var e;let r=!1,t=qz(a=>{this._trackResize&&!this._removed&&(this.resize(a),this.redraw())},50),i=(e=this._ownerWindow.ResizeObserver)!=null?e:ResizeObserver;this._resizeObserver=new i(a=>{!r&&(r=!0,!this._shouldHandleInitialResize())||t(a)}),this._resizeObserver.observe(this._container)}_resolveContainer(e){if(typeof e=="string"){let r=document.getElementById(e);if(!r)throw Error(`Container '${e}' not found.`);return r}if(e instanceof HTMLElement||e&&typeof e=="object"&&e.nodeType===1)return e;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let e=this._container;e.classList.add("maplibregl-map");let r=this._canvasContainer=$n.create("div","maplibregl-canvas-container",e);this._interactive&&r.classList.add("maplibregl-interactive"),this._canvas=$n.create("canvas","maplibregl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let t=this._containerDimensions(),i=this._getClampedPixelRatio(t[0],t[1]);this._resizeCanvas(t[0],t[1],i);let a=this._controlContainer=$n.create("div","maplibregl-control-container",e),o=this._controlPositions={};for(let s of["top-left","top-right","bottom-left","bottom-right"])o[s]=$n.create("div",`maplibregl-ctrl-${s} `,a);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(e,r,t){this._canvas.width=Math.floor(t*e),this._canvas.height=Math.floor(t*r),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${r}px`}_setupPainter(){let e=ar(Nt({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),r=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{r=i},{once:!0});let t=this._canvas.getContext("webgl2",e);if(!t)throw new sS(e,r);this.painter=new WN(t,this._camera.transform)}migrateProjection(e,r){this._camera.migrateProjection(e,r),this.painter.transform=e,this.fire(new _M({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){var r;return(r=this.style)!=null&&r._loaded?(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)}_render(e){var r,t,i,a,o;let s=this._idleTriggered?this._fadeDuration:0,l=((r=this.style.projection)==null?void 0:r.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let f=this._camera.transform.zoom,h=hs();this.style.zoomHistory.update(f,h);let d=new ns(f,{now:h,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),p=d.crossFadingFactor();(p!==1||p!==this._crossFadingFactor)&&(n=!0,this._crossFadingFactor=p),this.style.update(d)}let u=((t=this.style.projection)==null?void 0:t.transitionState)>0!==l;this._camera.transform.setTransitionState((i=this.style.projection)==null?void 0:i.transitionState),this.style&&(this._sourcesDirty||u)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=(a=this.style)==null?void 0:a._updatePlacement(this._camera.transform,this.showCollisionBoxes,s,this._crossSourceCollisions,u),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new iu("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new iu("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let c=this._sourcesDirty||this._styleDirty||this._placementDirty||((o=this.painter.renderToTexture)==null?void 0:o.needsFollowUpFrame);return c||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new iu("idle")),this._loaded&&!this._fullyLoaded&&!c&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){var e,r;this._hash&&this._hash.remove();for(let i of this._controls)i.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),(e=this._diffStyleRequest)==null||e.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),rd.removeThrottleControl(this._imageQueueHandle),(r=this._resizeObserver)==null||r.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new iu("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,yc.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(r){if(!Up(r))throw r}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return _8}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}},x8={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0},b8=class{constructor(e){this._updateZoomButtons=()=>{let r=this._map.getZoom(),t=r===this._map.getMaxZoom(),i=r===this._map.getMinZoom(!0);this._zoomInButton.disabled=t,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{let r=this._map.getPitch(),t=this._map.getRoll(),i=this._map.getBearing(),a=1/Math.cos(rl(r))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${a}) rotateZ(${-t}deg) rotateX(${r}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${a}) rotateX(${r}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-i-t}deg)`;return}this._compassIcon.style.transform=`rotate(${-i}deg)`},this._setButtonTitle=(r,t)=>{let i=this._map._getUIString(`NavigationControl.${t}`);r.title=i,r.setAttribute("aria-label",i)},this.options=yn({},x8,e),this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",r=>r.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",r=>this._map.zoomIn({},{originalEvent:r})),$n.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",r=>this._map.zoomOut({},{originalEvent:r})),$n.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",r=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:r}):this._map.resetNorth({},{originalEvent:r})}),this._compassIcon=$n.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new w8(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,r){let t=$n.create("button",e,this._container);return t.type="button",t.addEventListener("click",r),t}},w8=class{constructor(e,r,t=!1){this.mousedown=a=>{this.startMove(a,$n.mousePos(this.element,a)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=a=>{this.move(a,$n.mousePos(this.element,a))},this.mouseup=a=>{this._rotatePitchHandler.dragEnd(a),this.offTemp()},this.touchstart=a=>{a.targetTouches.length===1?(this._startPos=this._lastPos=$n.touchPos(this.element,a.targetTouches)[0],this.startMove(a,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=a=>{a.targetTouches.length===1?(this._lastPos=$n.touchPos(this.element,a.targetTouches)[0],this.move(a,this._lastPos)):this.reset()},this.touchend=a=>{a.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=r;let i=new o8;this._rotatePitchHandler=new Ym({clickTolerance:3,move:(a,o)=>{let s=r.getBoundingClientRect(),l=new Wr((s.bottom-s.top)/2,(s.right-s.left)/2);return{bearingDelta:T9(new Wr(a.x,o.y),o,l),pitchDelta:t?(o.y-a.y)*-.5:void 0}},moveStateManager:i,enable:!0,assignEvents:()=>{}}),this.map=e,r.addEventListener("mousedown",this.mousedown),r.addEventListener("touchstart",this.touchstart,{passive:!1}),r.addEventListener("touchcancel",this.reset)}startMove(e,r){this._rotatePitchHandler.dragStart(e,r),$n.disableDrag()}move(e,r){let t=this.map,{bearingDelta:i,pitchDelta:a}=this._rotatePitchHandler.dragMove(e,r)||{};i&&t.setBearing(t.getBearing()+i),a&&t.setPitch(t.getPitch()+a)}off(){let e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){$n.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}},q2={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%)"},kS={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},CS="#3FB1CE",n0=class extends hf{},LS=class extends hf{},V2=class extends Nl{constructor(e){if(super(),this._onClick=r=>{this.fire(new LS("click",{originalEvent:r}))},this._onKeyPress=r=>{(r.code==="Space"||r.code==="Enter")&&this.togglePopup()},this._onKeyDown=r=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||r.composedPath()[0]!==this._element||r.altKey||r.ctrlKey||r.metaKey)return;let t=kS[r.key];if(!t)return;r.preventDefault(),r.stopPropagation();let i=r.shiftKey?10:1,a=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new Wr(a.x+t[0]*i,a.y+t[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new n0("dragstart"))),this.fire(new n0("drag"))},this._onKeyUp=r=>{kS[r.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=r=>{let t=r.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()},this._update=r=>{if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();(r?.type==="terrain"||r?.type==="render"&&!t)&&this._map.once("render",this._update),this._lngLat=Hz(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let i="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?i=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let a="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?a="rotateX(0deg)":this._pitchAlignment==="map"&&(a=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&(!r||r.type==="moveend")&&(this._pos=this._pos.round()),this._element.style.transform=`${q2[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${a} ${i}`,yc.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(r?.type==="moveend")}).catch(()=>{})},this._onMove=r=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=r.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=r.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new n0("dragstart"))),this.fire(new n0("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new n0("dragend")),this._state="inactive"},this._addDragHandler=r=>{this._element.contains(r.originalEvent.target)&&(r.preventDefault(),this._positionDelta=r.point.sub(this._pos).add(this._offset),this._pointerdownPos=r.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e?.anchor||"center",this._color=e?.color||CS,this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||"auto",this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=Wr.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=$n.create("div");let r=Ase().cloneNode(!0);r.setAttributeNS(null,"height",`${41*this._scale}px`),r.setAttributeNS(null,"width",`${27*this._scale}px`),Mse(r).setAttributeNS(null,"fill",this._color),this._element.appendChild(r),this._offset=Wr.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",r=>{r.preventDefault()}),this._element.addEventListener("mousedown",r=>{r.preventDefault()}),$z(this._element,this._anchor,"marker"),e?.className)for(let r of e.className.split(" "))this._element.classList.add(r);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=An.convert(e),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),e){if(!("offset"in e.options)){let r=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,(24.6+r)*-1],"bottom-right":[-r,(24.6+r)*-1],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new n0("dragend")))}getPopup(){return this._popup}togglePopup(){let e=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(e)e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map));else return this;return this}_updateOpacity(e=!1){var r,t;let i=(r=this._map)==null?void 0:r.terrain,a=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!i||a){let p=a?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==p&&(this._element.style.opacity=p,this._element.classList.toggle("maplibregl-marker-covered",a));return}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let o=this._map,s=o.terrain.depthAtPoint(this._pos),l=o.terrain.getElevationForLngLat(this._lngLat,o._camera.transform),n=o._camera.transform.lngLatToCameraDepth(this._lngLat,l),u=.006;if(n-su;(t=this._popup)!=null&&t.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",d)}getOffset(){return this._offset}setOffset(e){return this._offset=Wr.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=(this._element.getAttribute("tabindex")==="0"&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let e=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,r){return(this._opacity===void 0||e===void 0&&r===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=String(e)),r!==void 0&&(this._opacityWhenCovered=String(r)),this._map&&this._updateOpacity(!0),this}},T8={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},oy=0,Zm=!1,o0=class extends hf{},G2=class extends hf{},FS=class extends hf{},A8=class extends Nl{constructor(e){super(),this._onSuccess=r=>{if(this._map){if(this._isOutOfMapMaxBounds(r)){this._setErrorState(),this.fire(new G2("outofmaxbounds",r)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=r,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(r),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(r),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new G2("geolocate",r)),this._finish()}},this._updateCamera=r=>{let t=new An(r.coords.longitude,r.coords.latitude),i=r.coords.accuracy,a=this._map.getBearing(),o=yn({bearing:a},this.options.fitBoundsOptions),s=wh.fromLngLat(t,i);this._map.fitBounds(s,o,{geolocateSource:!0})},this._updateMarker=r=>{if(r){let t=new An(r.coords.longitude,r.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=r.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=r=>{if(this._map){if(r.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(r.code===3&&Zm)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new FS("error",r)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=r=>{if(!this._map)return;let t=r?.[0]instanceof ResizeObserverEntry;!r.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!t&&!this._map.isZooming()&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new o0("trackuserlocationend")),this.fire(new o0("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",r=>{r.preventDefault()}),this._geolocateButton=$n.create("button","maplibregl-ctrl-geolocate",this._container),$n.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=r=>{if(this._map){if(r===!1){To("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=$n.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new V2({element:this._dotElement}),this._circleElement=$n.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new V2({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=yn({},T8,e)}onAdd(e){return this._map=e,this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),Tse().then(r=>this._finishSetupUI(r)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,oy=0,Zm=!1}_isOutOfMapMaxBounds(e){let r=this._map.getMaxBounds(),t=e.coords;return r&&(t.longituder.getEast()||t.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":break;case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let e=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!e)return;let r=this._map.project(e),t=this._map.unproject([r.x+100,r.y]),i=e.distanceTo(t)/100,a=2*this._accuracy/i;this._circleElement.style.width=`${a.toFixed(2)}px`,this._circleElement.style.height=`${a.toFixed(2)}px`}trigger(){if(!this._setup)return To("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 o0("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":oy--,Zm=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new o0("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o0("trackuserlocationstart")),this.fire(new o0("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),oy++;let e;oy>1?(e={maximumAge:6e5,timeout:0},Zm=!0):(e=this.options.positionOptions,Zm=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},M8={maxWidth:100,unit:"metric"},S8=class{constructor(e){this._onMove=()=>{Wz(this._map,this._container,this.options)},this.setUnit=r=>{this.options.unit=r,Wz(this._map,this._container,this.options)},this.options=Nt(Nt({},M8),e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}},H2=class extends hf{},E8=class extends Nl{constructor(e={}){var r;super(),this._onFullscreenChange=()=>{var t;let i=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;(t=i?.shadowRoot)!=null&&t.fullscreenElement;)i=i.shadowRoot.fullscreenElement;i===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=(r=e.pseudo)!=null?r:!1,e?.container&&(e.container instanceof HTMLElement?this._container=e.container:To("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let e=this._fullscreenButton=$n.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);$n.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new H2("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new H2("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},k8=class{constructor(e){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=e}onAdd(e){return this._map=e,this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=$n.create("button","maplibregl-ctrl-terrain",this._container),$n.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},C8=class{constructor(){this._toggleProjection=()=>{var e;let r=(e=this._map.getProjection())==null?void 0:e.type;r==="mercator"||!r?this._map.setProjection({type:"globe"}):this._map.setProjection({type:"mercator"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var e;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((e=this._map.getProjection())==null?void 0:e.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(e){return this._map=e,this._container=$n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=$n.create("button","maplibregl-ctrl-globe",this._container),$n.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},D8={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},L8=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),$2=class extends hf{},F8=class extends Nl{constructor(e){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new $2("close"))),this),this._update=r=>{let t=this._lngLat||this._trackPointer;if(!this._map||!t||!this._content)return;if(!this._container){if(this._container=$n.create("div","maplibregl-popup",this._map.getContainer()),this._tip=$n.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let n of this.options.className.split(" "))this._container.classList.add(n);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Hz(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer);let i;if(r&&"point"in r&&r.point&&(i=r.point),this._trackPointer&&!i)return;let a=this._flatPos=this._pos=this._trackPointer&&i?i:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&i?i:this._map._camera.transform.locationToScreenPoint(this._lngLat));let o=this.options.anchor,s=Yz(this.options.offset);if(!o){let n=this._container.offsetWidth,u=this._container.offsetHeight,c=kse(this.options.padding),f;f=a.y+s.bottom.ythis._map._camera.transform.height-u-c.bottom?["bottom"]:[],a.xthis._map._camera.transform.width-n/2-c.right&&f.push("right"),o=f.length===0?"bottom":f.join("-")}let l=a.add(s[o]);this.options.subpixelPositioning||(l=l.round()),this._container.style.transform=`${q2[o]} translate(${l.x}px,${l.y}px)`,$z(this._container,o,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=yn(Object.create(D8),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new $2("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=An.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let r=document.createDocumentFragment(),t=document.createElement("body"),i;for(t.innerHTML=e;i=t.firstChild,i;)r.appendChild(i);return this.setDOMContent(r)}getMaxWidth(){var e;return(e=this._container)==null?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=$n.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}setPadding(e){this.options.padding=e,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=$n.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=this._container.querySelector(L8);e&&e.focus()}},P8=vM}}),jse=de({"build/maplibre_worker.js"(e,r){"use strict";r.exports='var t1=Object.defineProperty,e1=Object.defineProperties;var r1=Object.getOwnPropertyDescriptors;var nh=Object.getOwnPropertySymbols;var i1=Object.prototype.hasOwnProperty,n1=Object.prototype.propertyIsEnumerable;var ah=(t,e,r)=>e in t?t1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,je=(t,e)=>{for(var r in e||(e={}))i1.call(e,r)&&ah(t,r,e[r]);if(nh)for(var r of nh(e))n1.call(e,r)&&ah(t,r,e[r]);return t},Si=(t,e)=>e1(t,r1(e));var rt=(t,e,r)=>new Promise((i,n)=>{var a=l=>{try{o(r.next(l))}catch(u){n(u)}},s=l=>{try{o(r.throw(l))}catch(u){n(u)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(a,s);o((r=r.apply(t,e)).next())});var a1=Object.create,ep=Object.defineProperty,s1=Object.getOwnPropertyDescriptor,o1=Object.getOwnPropertyNames,l1=Object.getPrototypeOf,rp=Object.prototype.hasOwnProperty,fl=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),u1=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=o1(e),a=0,s=n.length,o;ae[l]).bind(null,o),enumerable:!(i=s1(e,o))||i.enumerable});return t},h1=(t,e,r)=>(r=t==null?{}:a1(l1(t)),u1(e||!t||!t.__esModule||!rp.call(t,"default")?ep(r,"default",{value:t,enumerable:!0}):r,t));function B(t,e){this.x=t,this.y=e}B.prototype={clone(){return new B(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:B},B.convert=function(t){if(t instanceof B)return t;if(Array.isArray(t))return new B(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new B(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")};function c1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var Nn;function p1(){return Nn!=null||(Nn=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Nn}var Un;function f1(){if(Un==null&&(Un=!1,p1())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){Un=!0;break}}}return Un||!1}var pe=typeof Float32Array<"u"?Float32Array:Array;Math.PI/180,180/Math.PI;function d1(){var t=new pe(9);return pe!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ip(){var t=new pe(3);return pe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function y1(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function sh(t,e,r){var i=new pe(3);return i[0]=t,i[1]=e,i[2]=r,i}function m1(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function g1(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ks(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}var x1=y1;(function(){var t=ip();return function(e,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=i*s,t[2]=n*s,t[3]=a*s,t}function w1(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}(function(){var t=v1();return function(e,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o1e-6?(p=Math.acos(f),d=Math.sin(p),y=Math.sin((1-i)*p)/d,m=Math.sin(i*p)/d):(y=1-i,m=i),t[0]=y*n+m*l,t[1]=y*a+m*u,t[2]=y*s+m*h,t[3]=y*o+m*c,t}function _1(t,e){var r=e[0]+e[4]+e[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[n*3+n]&&(n=2);var a=(n+1)%3,s=(n+2)%3;i=Math.sqrt(e[n*3+n]-e[a*3+a]-e[s*3+s]+1),t[n]=.5*i,i=.5/i,t[3]=(e[a*3+s]-e[s*3+a])*i,t[a]=(e[a*3+n]+e[n*3+a])*i,t[s]=(e[s*3+n]+e[n*3+s])*i}return t}var lh=b1;(function(){var t=ip(),e=sh(1,0,0),r=sh(0,1,0);return function(i,n,a){var s=g1(n,a);return s<-.999999?(ks(t,e,n),x1(t)<1e-6&&ks(t,r,n),m1(t,t),D1(i,t,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(ks(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+s,lh(i,i))}})(),(function(){var t=oh(),e=oh();return function(r,i,n,a,s,o){return Ts(t,i,s,o),Ts(e,n,a,o),Ts(r,t,e,2*o*(1-o)),r}})(),(function(){var t=d1();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],lh(e,_1(e,t))}})();function A1(){var t=new pe(2);return pe!=Float32Array&&(t[0]=0,t[1]=0),t}(function(){var t=A1();return function(e,r,i,n,a,s){var o,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function E1(t,e,r,i){return c1(t,e,r,i)}var d5=E1(.25,.1,.25,1);function Ji(t,e,r){return Math.min(r,Math.max(e,t))}function F1(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function Gt(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function k1(t){return Math.log(t)/Math.LN2%1==0}function Ia(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}function T1(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function He(t){return Array.isArray(t)?t.map(He):typeof t=="object"&&t?Ia(t,He):t}var uh={};function Bt(t){uh[t]||(typeof console<"u"&&console.warn(t),uh[t]=!0)}function Ke(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function mr(t){return typeof WorkerGlobalScope<"u"&&t!==void 0&&t instanceof WorkerGlobalScope}function Ca(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function I1(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),h=Math.min(t.width,e+i),c=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}function C1(t,e,r,i,n){return rt(this,null,function*(){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(t,{timestamp:0});try{let s=a==null?void 0:a.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith("BGR"),l=new Uint8ClampedArray(i*n*4);if(yield a.copyTo(l,I1(t,e,r,i,n)),o)for(let u=0;u{t.removeEventListener(e,r,i)}}}function ch(t){return t*Math.PI/180}var ph="AbortError",dl=class extends Error{constructor(t=ph){super(t instanceof Error?t.message:t),this.name=ph,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function yl(t){return t instanceof Error&&t.name==="AbortError"}function B1(t){if(t.aborted)throw new dl(t.reason)}var ml={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function P1(t){return ml.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function sp(t,e){ml.REGISTERED_PROTOCOLS[t]=e}function op(t){delete ml.REGISTERED_PROTOCOLS[t]}var fh="global-dispatcher",ya=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function lp(){var t;if(mr(self))return(t=self.worker)==null?void 0:t.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch(e){}return window.location.href}var z1=t=>{var e;return t.startsWith("file:")||((e=lp())==null?void 0:e.startsWith("file:"))&&!/^\\w+:/.test(t)};function L1(t,e){return rt(this,null,function*(){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:lp(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=yield fetch(r)}catch(s){throw yl(s)?s:new ya(0,Ki(s).message,t.url,new Blob)}if(!i.ok){let s=yield i.blob();throw new ya(i.status,i.statusText,t.url,s)}let n;n=t.type==="arrayBuffer"||t.type==="image"?i.arrayBuffer():t.type==="json"?i.json():i.text();let a=yield n;return B1(e.signal),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}})}function V1(t,e){return new Promise((r,i)=>{var a;let n=new XMLHttpRequest;n.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(n.responseType="arraybuffer");for(let s in t.headers)n.setRequestHeader(s,t.headers[s]);t.type==="json"&&(n.responseType="text",(a=t.headers)!=null&&a.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=t.credentials==="include",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let s=n.response;if(t.type==="json")try{s=JSON.parse(n.response)}catch(o){i(o);return}r({data:s,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let s=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new ya(n.status,n.statusText,t.url,s))}},e.signal.addEventListener("abort",()=>{n.abort(),i(new dl(e.signal.reason))}),n.send(t.body)})}var Ma=function(t,e){return rt(this,null,function*(){var r,i;if(t.url.includes("://")&&!/^https?:|^file:/.test(t.url)){let n=P1(t.url);if(n){let a=yield n(t,e);return!a.data&&t.type==="arrayBuffer"?Gt(a,{data:new ArrayBuffer(0)}):a}if(mr(self)&&((r=self.worker)!=null&&r.actor))return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:fh},e)}if(!z1(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return L1(t,e);if(mr(self)&&((i=self.worker)!=null&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:fh},e)}return V1(t,e)})},up=(t,e)=>Ma(Gt(t,{type:"json"}),e),hp=(t,e)=>Ma(Gt(t,{type:"arrayBuffer"}),e);function dh(t,e,r){var i;(i=r[t])!=null&&i.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function Is(t,e,r){if(r!=null&&r[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}var cp=class{constructor(t,e={}){Gt(this,e),this.type=t}},ma=class extends cp{constructor(t,e={}){super("error",Gt({error:t},e))}},O1=class{on(t,e){return this._listeners||(this._listeners={}),dh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return Is(t,e,this._listeners),Is(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),dh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){var n,a,s,o,l,u;let r=typeof t=="string"?new cp(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let h=(s=(a=(n=this._listeners)==null?void 0:n[i])==null?void 0:a.slice())!=null?s:[];for(let f of h)f.call(this,r);let c=(u=(l=(o=this._oneTimeListeners)==null?void 0:o[i])==null?void 0:l.slice())!=null?u:[];for(let f of c)Is(i,f,this._oneTimeListeners),f.call(this,r);let p=this._eventedParent;p&&(Gt(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(r))}else r instanceof ma&&console.error(r.error);return this}listens(t){var e,r,i,n,a;return!!((r=(e=this._listeners)==null?void 0:e[t])!=null&&r.length||(n=(i=this._oneTimeListeners)==null?void 0:i[t])!=null&&n.length||(a=this._eventedParent)!=null&&a.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},pp={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},w=pp,fp=["type","source","source-layer","minzoom","maxzoom","filter","layout"],E=class{constructor(t,e,r,i,n="error"){this.message=(t?`${t}: `:"")+r,i&&(this.identifier=i),this.severity=n,e!=null&&e.__line__&&(this.line=e.__line__)}},dn={kind:"null"},I={kind:"number"},Y={kind:"string"},tt={kind:"boolean"},ce={kind:"color"},Ba={kind:"projectionDefinition"},fr={kind:"object"},Z={kind:"value"},R1={kind:"error"},Pa={kind:"collator"},yn={kind:"formatted"},za={kind:"padding"},Qi={kind:"colorArray"},La={kind:"numberArray"},mn={kind:"resolvedImage"},Va={kind:"variableAnchorOffsetCollection"};function Ut(t,e){return{kind:"array",itemType:t,N:e}}function yt(t){if(t.kind==="array"){let e=yt(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}var $1=[dn,I,Y,tt,ce,Ba,yn,fr,Ut(Z),za,La,Qi,mn,Va];function tn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!tn(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of $1)if(!tn(r,e))return null}}return`Expected ${yt(t)} but found ${yt(e)} instead.`}function gl(t,e){return e.some(r=>r.kind===t.kind)}function dr(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function Ge(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}var dp=.96422,yp=.82521,mp=4/29,Ks=6/29,gp=3*Ks*Ks,N1=Math.PI/180,U1=180/Math.PI;function xp(t){return t%=360,t<0&&(t+=360),t}function vp([t,e,r,i]){t=Cs(t),e=Cs(e),r=Cs(r);let n,a,s=Ms((.2225045*t+.7168786*e+.0606169*r)/1);t===e&&e===r?n=a=s:(n=Ms((.4360747*t+.3850649*e+.1430804*r)/dp),a=Ms((.0139322*t+.0971045*e+.7141733*r)/yp));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Cs(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ms(t){return t>.008856451679035631?t**(1/3):t/gp+mp}function bp([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*Ps(n),a=dp*Ps(a),s=yp*Ps(s),[Bs(3.1338561*a-1.6168667*n-.4906146*s),Bs(-.9787684*a+1.9161415*n+.033454*s),Bs(.0719453*a-.2289914*n+1.4052427*s),i]}function Bs(t){return t=t<=.00304?12.92*t:1.055*t**(1/2.4)-.055,t<0?0:t>1?1:t}function Ps(t){return t>Ks?t*t*t:gp*(t-mp)}function q1(t){let[e,r,i,n]=vp(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?xp(Math.atan2(i,r)*U1):NaN,a,e,n]}function j1([t,e,r,i]){return t=isNaN(t)?0:t*N1,bp([r,Math.cos(t)*e,Math.sin(t)*e,i])}function G1([t,e,r,i]){t=xp(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var X1=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function ji(t,e){return X1(t,e)?t[e]:void 0}function Y1(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=ji(W1,t);if(e){let[i,n,a]=e;return[i/255,n/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let i=t.length<6?1:2,n=1;return[qn(t.slice(n,n+=i)),qn(t.slice(n,n+=i)),qn(t.slice(n,n+=i)),qn(t.slice(n,n+i)||"ff")]}if(t.startsWith("rgb")){let i=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(i){let[n,a,s,o,l,u,h,c,p,f,d,y]=i,m=[o||" ",h||" ",f].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let g=[s,u,p].join(""),x=g==="%%%"?100:g===""?255:0;if(x){let v=[Rr(+a/x,0,1),Rr(+l/x,0,1),Rr(+c/x,0,1),d?yh(+d,y):1];if(mh(v))return v}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[i,n,a,s,o,l,u,h,c]=r,p=[a||" ",o||" ",u].join("");if(p===" "||p===" /"||p===",,"||p===",,,"){let f=[+n,Rr(+s,0,100),Rr(+l,0,100),h?yh(+h,c):1];if(mh(f))return G1(f)}}}function qn(t){return parseInt(t.padEnd(2,t),16)/255}function yh(t,e){return Rr(e?t/100:t,0,1)}function Rr(t,e,r){return Math.min(Math.max(e,t),r)}function mh(t){return!t.some(Number.isNaN)}var W1={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Je(t,e,r){return t+r*(e-t)}function ti(t,e,r){return t.map((i,n)=>Je(i,e[n],r))}function Z1(t){return t==="rgb"||t==="hcl"||t==="lab"}var Pt,gt=(Pt=class{constructor(e,r,i,n=1,a=!0){this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,r,i,n]))}static parse(e){if(e instanceof Pt)return e;if(typeof e!="string")return;let r=Y1(e);if(r)return new Pt(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",q1(this.rgb))}get lab(){return this.overwriteGetter("lab",vp(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(",")},${n})`}static interpolate(e,r,i,n="rgb"){switch(n){case"rgb":{let[a,s,o,l]=ti(e.rgb,r.rgb,i);return new Pt(a,s,o,l,!1)}case"hcl":{let[a,s,o,l]=e.hcl,[u,h,c,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=h)):(f=a,(c===1||c===0)&&(d=s));let[y,m,g,x]=j1([f,d!=null?d:Je(s,h,i),Je(o,c,i),Je(l,p,i)]);return new Pt(y,m,g,x,!1)}case"lab":{let[a,s,o,l]=bp(ti(e.lab,r.lab,i));return new Pt(a,s,o,l,!1)}}}},Pt.black=new Pt(0,0,0,1),Pt.white=new Pt(1,1,1,1),Pt.transparent=new Pt(0,0,0,0),Pt.red=new Pt(1,0,0,1),Pt),H1=["bottom","center","top"],Js=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},ze=class la{constructor(e){this.sections=e}static fromString(e){return new la([new Js(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof la?e:la.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Ae=class Li{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Li)return e;if(typeof e=="number")return new Li([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Li(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Li(ti(e.values,r.values,i))}},Se=class Vi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Vi)return e;if(typeof e=="number")return new Vi([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new Vi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Vi(ti(e.values,r.values,i))}},oe=class Oi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Oi)return e;if(typeof e=="string"){let i=gt.parse(e);return i?new Oi([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!="string")return;let n=gt.parse(i);if(!n)return;r.push(n)}return new Oi(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n="rgb"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[t,e,r,i]:[t,e,r]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function ei(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Dr||t instanceof gt||t instanceof xl||t instanceof ze||t instanceof Ae||t instanceof Se||t instanceof oe||t instanceof De||t instanceof _e)return!0;if(Array.isArray(t)){for(let e of t)if(!ei(e))return!1;return!0}if(typeof t=="object"){for(let e in t)if(!ei(t[e]))return!1;return!0}return!1}function _t(t){if(t===null)return dn;if(typeof t=="string")return Y;if(typeof t=="boolean")return tt;if(typeof t=="number")return I;if(t instanceof gt)return ce;if(t instanceof Dr)return Ba;if(t instanceof xl)return Pa;if(t instanceof ze)return yn;if(t instanceof Ae)return za;if(t instanceof Se)return La;if(t instanceof oe)return Qi;if(t instanceof De)return Va;if(t instanceof _e)return mn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=_t(i);if(!r)r=n;else{if(r===n)continue;r=Z;break}}return Ut(r||Z,e)}return fr}function Gi(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof gt||t instanceof Dr||t instanceof ze||t instanceof Ae||t instanceof Se||t instanceof oe||t instanceof De||t instanceof _e?t.toString():JSON.stringify(t)}var ri=class _p{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`\'literal\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=_t(i),a=r.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new _p(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},J1=["Unknown","Point","LineString","Polygon"],Ap=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?J1[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=gt.parse(t),this._parseColorCache.set(t,e)),e}};function Oa(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||ee)a=s-1;else throw new ft("Input is not a number.",r);return 0}var vl=class Sp{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(e[1],1,I);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let s=1;s=o)return r.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',u);let c=r.parse(l,h,a);if(!c)return null;a||(a=c.type),n.push([o,c])}return new Sp(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[Oa(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Q1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var be=class Qs{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name==="exponential")a=zs(r,e.base,i,n);else if(e.name==="linear")a=zs(r,1,i,n);else if(e.name==="cubic-bezier"){let s=e.controlPoints;a=Q1(s[0],s[1],s[2],s[3])(zs(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(h=>typeof h!="number"||h<0||h>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,I),!a)return null;let o=[],l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&r.expectedType!=Qi?l=ce:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u=h)return r.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',p);let d=r.parse(c,f,l);if(!d)return null;l||(l=d.type),o.push([h,d])}return!Ge(l,I)&&!Ge(l,Ba)&&!Ge(l,ce)&&!Ge(l,za)&&!Ge(l,La)&&!Ge(l,Qi)&&!Ge(l,Va)&&!Ge(l,Ut(I))?r.error(`Type ${yt(l)} is not interpolatable.`):new Qs(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=Oa(r,n,this.key),o=r[s],l=r[s+1],u=Qs.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(e),c=i[s+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Je(h,c,u);case"color":return gt.interpolate(h,c,u);case"padding":return Ae.interpolate(h,c,u);case"colorArray":return oe.interpolate(h,c,u);case"numberArray":return Se.interpolate(h,c,u);case"variableAnchorOffsetCollection":return De.interpolate(h,c,u,this.key);case"array":return ti(h,c,u);case"projectionDefinition":return Dr.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return gt.interpolate(h,c,u,"hcl");case"colorArray":return oe.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return gt.interpolate(h,c,u,"lab");case"colorArray":return oe.interpolate(h,c,u,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function zs(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var gr={color:gt.interpolate,number:Je,padding:Ae.interpolate,numberArray:Se.interpolate,colorArray:oe.interpolate,variableAnchorOffsetCollection:De.interpolate,array:ti},Ep=class Fp{constructor(e){this.type=yn,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o=="object"&&!Array.isArray(o)){a=!1;let l=null;if(o["font-scale"]&&(l=r.parse(o["font-scale"],1,I),!l))return null;let u=null;if(o["text-font"]&&(u=r.parse(o["text-font"],1,Ut(Y)),!u))return null;let h=null;if(o["text-color"]&&(h=r.parse(o["text-color"],1,ce),!h))return null;let c=null;if(o["vertical-align"]){if(typeof o["vertical-align"]=="string"&&!H1.includes(o["vertical-align"]))return r.error(`\'vertical-align\' must be one of: \'bottom\', \'center\', \'top\' but found \'${o["vertical-align"]}\' instead.`);if(c=r.parse(o["vertical-align"],1,Y),!c)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=r.parse(e[s],1,Z);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Fp(n)}evaluate(e){return new ze(this.sections.map(r=>{let i=r.content.evaluate(e);return _t(i)===mn?new Js("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new Js(Gi(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}};function kp(t,e,r=0,i=t.length-1,n=t0){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);kp(t,e,Math.max(r,Math.floor(e-u*c/l+p)),Math.min(i,Math.floor(e+(l-u)*c/l+p)),n)}let a=t[e],s=r,o=i;for(ki(t,r,e),n(t[i],a)>0&&ki(t,r,i);s0;)o--}n(t[r],a)===0?ki(t,r,o):(o++,ki(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function ki(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function t0(t,e){return te)}function Ra(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=r0(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a2){let u=e[1];if(typeof u!="string"||!(u in jn)||u==="object")return r.error(\'The item type argument of "array" must be one of string, number, boolean\',1);o=jn[u],i++}else o=Z;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error(\'The length argument to "array" must be a positive integer literal\',2);l=e[2],i++}n=Ut(o,l)}else{if(!jn[a])throw Error(`Types doesn\'t contain name = ${a}`);n=jn[a]}let s=[];for(;ie.outputDefined())}},gh={"to-boolean":tt,"to-color":ce,"to-number":I,"to-string":Y},jr=class Ip{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[0];if(!gh[i])throw Error(`Can\'t parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&e.length!==2)return r.error("Expected one argument.");let n=gh[i],a=[];for(let s=1;s4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Dp(r[0],r[1],r[2],r[3]),!i))return new gt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ft(i||`Could not parse color from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ae.parse(r);if(n)return n}throw new ft(`Could not parse padding from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=Se.parse(r);if(n)return n}throw new ft(`Could not parse numberArray from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=oe.parse(r);if(n)return n}throw new ft(`Could not parse colorArray from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(e);let n=De.parse(r);if(n)return n}throw new ft(`Could not parse variableAnchorOffsetCollection from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new ft(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return ze.fromString(Gi(this.args[0].evaluate(e)));case"resolvedImage":return _e.fromString(Gi(this.args[0].evaluate(e)));case"projectionDefinition":{let r=this.args[0].evaluate(e);if(Dr.parse(r))return r;throw new ft(`Could not parse projectionDefinition from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}default:return Gi(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Cp=class Mp{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a=i.length)throw new ft(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new ft(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},n0=class Lp{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=tt}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);return!i||!n?null:gl(i.type,[tt,Y,I,dn,Z])?new Lp(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!dr(r,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(_t(r))} instead.`,this.key);if(!dr(i,["string","array"]))throw new ft(`Expected second argument to be of type array or string, but found ${yt(_t(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},a0=class to{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=I}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);if(!i||!n)return null;if(!gl(i.type,[tt,Y,I,dn,Z]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new to(i,n,r.key,a):null}return new to(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!dr(r,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(_t(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),dr(i,["string"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(dr(i,["array"]))return i.indexOf(r,n);throw new ft(`Expected second argument to be of type array or string, but found ${yt(_t(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},s0=class Vp{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let a={},s=[];for(let u=2;u2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d=="number"&&Math.floor(d)!==d)return p.error("Numeric branch labels must be integer values.");if(!i)i=_t(d);else if(p.checkSubtype(i,_t(d)))return null;if(a[String(d)]!==void 0)return p.error("Branch labels must be unique.");a[String(d)]=s.length}let f=r.parse(c,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,Z);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!=="value"&&r.concat(1).checkSubtype(i,o.type)?null:new Vp(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(_t(r)===this.inputType&&this.outputs[this.cases[r]]||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()}},o0=class Op{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let s=1;sr.outputDefined())&&this.otherwise.outputDefined()}},l0=class eo{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,I);if(!i||!n)return null;if(!gl(i.type,[Ut(Z),Y,Z]))return r.error(`Expected first argument to be of type array or string, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new eo(i.type,i,n,r.key,a):null}return new eo(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),dr(r,["string"]))return[...r].slice(i,n).join("");if(dr(r,["array"]))return r.slice(i,n);throw new ft(`Expected first argument to be of type array or string, but found ${yt(_t(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},Rp=class ro{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error("No output type");return n&&a.some(s=>tn(n,s.type))?new ro(Z,a):new ro(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof _e&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function xh(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function u0(t,e,r){return e===r}function h0(t,e,r){return e!==r}function c0(t,e,r){return er}function f0(t,e,r){return e<=r}function d0(t,e,r){return e>=r}function $p(t,e,r,i){return i.compare(e,r)===0}function y0(t,e,r,i){return!$p(t,e,r,i)}function m0(t,e,r,i){return i.compare(e,r)<0}function g0(t,e,r,i){return i.compare(e,r)>0}function x0(t,e,r,i){return i.compare(e,r)<=0}function v0(t,e,r,i){return i.compare(e,r)>=0}function li(t,e,r){let i=t!=="=="&&t!=="!=";return class Np{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=tt,this.hasUntypedArgument=a.type.kind==="value"||s.type.kind==="value"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error("Expected two or three arguments.");let o=a[0],l=s.parse(a[1],1,Z);if(!l)return null;if(!xh(o,l.type))return s.concat(1).error(`"${o}" comparisons are not supported for type \'${yt(l.type)}\'.`);let u=s.parse(a[2],2,Z);if(!u)return null;if(!xh(o,u.type))return s.concat(2).error(`"${o}" comparisons are not supported for type \'${yt(u.type)}\'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types \'${yt(l.type)}\' and \'${yt(u.type)}\'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Ie(u.type,[l],s.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Ie(l.type,[u],s.key)));let h=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(h=s.parse(a[3],3,Pa),!h)return null}return new Np(l,u,s.key,h)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=_t(s),u=_t(o);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new ft(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=_t(s),u=_t(o);if(l.kind!=="string"||u.kind!=="string")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var b0=li("==",u0,$p),w0=li("!=",h0,y0),D0=li("<",c0,m0),_0=li(">",p0,g0),A0=li("<=",f0,x0),S0=li(">=",d0,v0),Up=class qp{constructor(e,r,i){this.type=Pa,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let i=e[1];if(typeof i!="object"||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,tt);if(!n)return null;let a=r.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,tt);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,Y),!s)?null:new qp(n,a,s)}evaluate(e){return new xl(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},E0=class jp{constructor(e,r,i,n,a,s){this.type=Y,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let i=r.parse(e[1],1,I);if(!i)return null;let n=e[2];if(typeof n!="object"||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,Y),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,Y),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,Y),!o))return null;if(s&&o)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,I),!l))return null;let u=null;return n["max-fraction-digits"]&&(u=r.parse(n["max-fraction-digits"],1,I),!u)?null:new jp(i,a,s,o,l,u)}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}},F0=class Gp{constructor(e){this.type=mn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let i=r.parse(e[1],1,Y);return i?new Gp(i):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),i=_e.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},k0=class Xp{constructor(e,r){this.input=e,this.key=r,this.type=I}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${yt(i.type)} instead.`):new Xp(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new ft(`Expected value to be of type string or array, but found ${yt(_t(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},we=8192;function T0(t,e){let r=I0(t[0]),i=M0(t[1]),n=2**e.z;return[Math.round(r*n*we),Math.round(i*n*we)]}function bl(t,e){let r=2**e.z,i=(t[0]/we+e.x)/r,n=(t[1]/we+e.y)/r;return[C0(i),B0(n)]}function I0(t){return(180+t)/360}function C0(t){return t*360-180}function M0(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function B0(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function gn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function en(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function P0(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function z0(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function $a(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return R0([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(vh(t,e,r,i)&&vh(r,i,t,e))}function L0(t,e,r){for(let i of r)for(let n=0;n0&&c<0||h<0&&c>0}function wl(t,e,r){let i=[];for(let n=0;nr[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}gn(e,t)}function $0(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function bh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];Zp(u,e,r,n),s.push(u)}return s}function wh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t){let l=[];for(let u of o){let h=[u.x+a[0],u.y+a[1]];gn(e,h),l.push(h)}s.push(l)}if(e[2]-e[0]<=n/2){$0(e);for(let o of s)for(let l of o)Zp(l,e,r,n)}return s}function N0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=wl(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!ui(o,a))return!1}if(e.type==="MultiPolygon"){let a=Wp(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!V0(o,a))return!1}return!0}function U0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=wl(e.coordinates,i,n),s=wh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!Yp(o,a))return!1}if(e.type==="MultiPolygon"){let a=Wp(e.coordinates,i,n),s=wh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!O0(o,a))return!1}return!0}var Dl=class ha{constructor(e,r){this.type=tt,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'within\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type==="FeatureCollection"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s==="Polygon"&&n.push(o),s==="MultiPolygon"&&n.push(...o)}if(n.length)return new ha(i,{type:"MultiPolygon",coordinates:n})}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new ha(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new ha(i,i)}return r.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return N0(e,this.geometries);if(e.geometryType()==="LineString")return U0(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Hp=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}},Dh=Math.PI/180,_l=class{constructor(t){let e=Dh*6378.137*1e3,r=Math.cos(t*Dh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-u)*this.ky;let f=h*h+c*c;f180;)t-=360;return t}};function Kp(t,e){return e[0]-t[0]}function ga(t){return t[1]-t[0]+1}function Le(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];let r=ga(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function no(t,e){if(!Le(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)gn(r,t[i]);return r}function ao(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)gn(e,i);return e}function _h(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Al(t,e,r){if(!_h(t)||!_h(e))return NaN;let i=0,n=0;return t[2]e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]=i)return i;if(en(n,a)){if(Ah(t,e))return 0}else if(Ah(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,h=u-1;l0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],h=e?50:100;if(ga(u)<=h){if(!Le(u,t.length))return NaN;if(e){let c=X0(t,u,r,i);if(isNaN(c)||c===0)return c;a=Math.min(a,c)}else for(let c=u[0];c<=u[1];++c){let p=G0(t[c],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let c=io(u,e);Sh(s,a,i,t,o,c[0]),Sh(s,a,i,t,o,c[1])}}return a}function va(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new Hp([[0,[0,t.length-1],[0,r.length-1]]],Kp);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=e?50:100,p=i?50:100;if(ga(u)<=c&&ga(h)<=p){if(!Le(u,t.length)&&Le(h,r.length))return NaN;let f;if(e&&i)f=q0(t,u,r,h,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=h[0];y<=h[1];++y)if(f=hr(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(h[0],h[1]+1);for(let y=u[0];y<=u[1];++y)if(f=hr(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=j0(t,u,r,h,n),s=Math.min(s,f)}else{let f=io(u,e),d=io(h,i);Gn(o,s,n,t,r,f[0],d[0]),Gn(o,s,n,t,r,f[0],d[1]),Gn(o,s,n,t,r,f[1],d[0]),Gn(o,s,n,t,r,f[1],d[1])}}return s}function W0(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,va(i,!1,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,va(i,!1,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,xa(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function Z0(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,va(i,!0,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,va(i,!0,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,xa(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function H0(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=Ra(r,0).map(s=>s.map(o=>o.map(l=>bl([l.x,l.y],t.canonical)))),n=new _l(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case"Point":a=Math.min(a,xa([s.coordinates],!1,o,n,a));break;case"LineString":a=Math.min(a,xa(s.coordinates,!0,o,n,a));break;case"Polygon":a=Math.min(a,Y0(o,s.coordinates,n,a))}if(a===0)return a}return a}function Ls(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var El=class ca{constructor(e,r){this.type=I,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'distance\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type==="FeatureCollection")return new ca(i,i.features.map(n=>Ls(n.geometry)).flat());if(i.type==="Feature")return new ca(i,Ls(i.geometry));if("type"in i&&"coordinates"in i)return new ca(i,Ls(i))}return r.error("\'distance\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return W0(e,this.geometries);if(e.geometryType()==="LineString")return Z0(e,this.geometries);if(e.geometryType()==="Polygon")return H0(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},K0=class Jp{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=Z;break}this.type=Ut(r!=null?r:Z,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`\'semiliteral\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=_t(i);if(n.kind==="array"){let a=i.map(s=>r.parse(s,null,Z));return new Jp(a)}return new ri(n,i)}evaluate(e){return this.arr.map(r=>r.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},Fl=class Qp{constructor(e){this.key=e,this.type=Z}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error("Global state property must be defined."):typeof i=="string"?new Qp(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){var i,n;let r=(i=e.globals)==null?void 0:i.globalState;return!r||Object.keys(r).length===0?null:(n=ji(r,this.key))!=null?n:null}eachChild(){}outputDefined(){return!1}},Yr={"==":b0,"!=":w0,">":_0,"<":D0,">=":S0,"<=":A0,array:Ie,at:i0,boolean:Ie,case:o0,coalesce:Rp,collator:Up,format:Ep,image:F0,in:n0,"index-of":a0,interpolate:be,"interpolate-hcl":be,"interpolate-lab":be,length:k0,let:Cp,literal:ri,match:s0,number:Ie,"number-format":E0,object:Ie,semiliteral:K0,slice:l0,step:vl,string:Ie,"to-boolean":jr,"to-color":jr,"to-number":jr,"to-string":jr,var:Bp,within:Dl,distance:El,"global-state":Fl},ve=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},J0=class tf{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new tf(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},ef=class rf{constructor(e,r,i=[],n,a=new J0,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(""),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r?this.concat(r,i,n)._parse(e,a):this._parse(e,a)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);let i=this.key;function n(a,s,o){return o==="assert"?new Ie(s,[a],i):o==="coerce"?new jr(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error(\'Expected an array with at least one element. If you wanted a literal array, use ["literal", []].\');let a=e[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")o=n(o,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))o=n(o,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(o instanceof ri)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let l=new Ap;try{o=new ri(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return e===void 0?this.error("\'undefined\' value invalid. Use null instead."):typeof e=="object"?this.error(\'Bare objects invalid. Use ["literal", {...}] instead.\'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e=="number"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new rf(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join("")}`;this.errors.push(new ve(i,e))}checkSubtype(e,r){let i=tn(e,r);return i&&this.error(i),i}},_r=class Ri{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=Ri.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,h]of o){l=new ef(r.registry,ba,r.path,null,r.scope);let c=[],p=!1;for(let f=1;ftm(c)).join(" | "),h=[];for(let c=1;c>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function sr(t){return{type:t}}_r.register(Yr,{error:[R1,[Y],(t,[e],r)=>{throw new ft(e.evaluate(t),r)}],typeof:[Y,[Z],(t,[e])=>yt(_t(e.evaluate(t)))],"to-rgba":[Ut(I,4),[ce],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[ce,[I,I,I],Eh],rgba:[ce,[I,I,I,I],Eh],has:{type:tt,overloads:[[[Y],(t,[e])=>Fh(e.evaluate(t),t.properties())],[[Y,fr],(t,[e,r])=>Fh(e.evaluate(t),r.evaluate(t))]]},get:{type:Z,overloads:[[[Y],(t,[e])=>Vs(e.evaluate(t),t.properties())],[[Y,fr],(t,[e,r])=>Vs(e.evaluate(t),r.evaluate(t))]]},"feature-state":[Z,[Y],(t,[e])=>Vs(e.evaluate(t),t.featureState||{})],properties:[fr,[],t=>t.properties()],"geometry-type":[Y,[],t=>t.geometryType()],id:[Z,[],t=>t.id()],zoom:[I,[],t=>t.globals.zoom],"heatmap-density":[I,[],t=>t.globals.heatmapDensity||0],elevation:[I,[],t=>t.globals.elevation||0],"line-progress":[I,[],t=>t.globals.lineProgress||0],accumulated:[Z,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[I,sr(I),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],"*":[I,sr(I),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],"-":{type:I,overloads:[[[I,I],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[I],(t,[e])=>-e.evaluate(t)]]},"/":[I,[I,I],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[I,[I,I],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[I,[],()=>Math.LN2],pi:[I,[],()=>Math.PI],e:[I,[],()=>Math.E],"^":[I,[I,I],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[I,[I],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[I,[I],(t,[e])=>Math.log(e.evaluate(t))],log2:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[I,[I],(t,[e])=>Math.sin(e.evaluate(t))],cos:[I,[I],(t,[e])=>Math.cos(e.evaluate(t))],tan:[I,[I],(t,[e])=>Math.tan(e.evaluate(t))],asin:[I,[I],(t,[e])=>Math.asin(e.evaluate(t))],acos:[I,[I],(t,[e])=>Math.acos(e.evaluate(t))],atan:[I,[I],(t,[e])=>Math.atan(e.evaluate(t))],min:[I,sr(I),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[I,sr(I),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[I,[I],(t,[e])=>Math.abs(e.evaluate(t))],round:[I,[I],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[I,[I],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[I,[I],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[tt,[Y,Z],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[tt,[Z],(t,[e])=>t.id()===e.value],"filter-type-==":[tt,[Y],(t,[e])=>t.geometryType()===e.value],"filter-<":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{let r=t.id(),i=e.value;return typeof r==typeof i&&r":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[tt,[Z],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],"filter-has-id":[tt,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[tt,[Ut(Y)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[tt,[Ut(Z)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[tt,[Y,Ut(Z)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[tt,[Y,Ut(Z)],(t,[e,r])=>Q0(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[sr(tt),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[sr(tt),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[tt,[tt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[tt,[Y],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[Y,[Y],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Y,[Y],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Y,sr(Z),(t,e)=>e.map(r=>Gi(r.evaluate(t))).join("")],split:[Ut(Y),[Y,Y],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[Y,[Ut(Y),Y],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],"resolved-locale":[Y,[Pa],(t,[e])=>e.evaluate(t).resolvedLocale()]});function tm(t){return Array.isArray(t)?`(${t.map(yt).join(", ")})`:`(${yt(t.type)}...)`}function ba(t){if(t instanceof Bp)return ba(t.boundExpression);if(t instanceof _r&&t.name==="error"||t instanceof Up||t instanceof Dl||t instanceof El||t instanceof Fl)return!1;let e=t instanceof jr||t instanceof Ie,r=!0;return t.eachChild(i=>{r&&(r=e?ba(i):i instanceof ri)}),r?Na(t)&&Ua(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function Na(t){if(t instanceof _r&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof Dl||t instanceof El)return!1;let e=!0;return t.eachChild(r=>{e&&!Na(r)&&(e=!1)}),e}function rn(t){if(t instanceof _r&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!rn(r)&&(e=!1)}),e}function Ua(t,e){if(t instanceof _r&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!Ua(i,e)&&(r=!1)}),r}function ii(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function nf(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function kl(t){return!!t.expression&&t.expression.interpolated}var Tl=/^(.*)-transition$/;function nn(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function Q(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function qa(t){return typeof t=="object"&&!!t&&!Array.isArray(t)&&_t(t)===fr}function em(t){return t}function rm(t){switch(t.type){case"color":return gt.parse;case"padding":return Ae.parse;case"numberArray":return Se.parse;case"colorArray":return oe.parse;default:return null}}function im(t){switch(t){case"exponential":return sf;case"interval":return am;case"categorical":return nm;case"identity":return sm;default:throw Error(`Unknown function type "${t}"`)}}function af(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",i=r||t.property!==void 0,n=r||!i,a=t.type||(kl(e)?"exponential":"interval"),s=rm(e);if(s&&(t=nn({},t),t.stops&&(t.stops=t.stops.map(h=>[h[0],s(h[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!Z1(t.colorSpace))throw Error(`Unknown color space: "${t.colorSpace}"`);let o=im(a),l,u;if(a==="categorical"){l=Object.create(null);for(let h of t.stops)l[h[0]]=h[1];u=typeof t.stops[0][0]}if(r){let h={},c=[];for(let d=0;dd[0]),evaluate({zoom:d},y){return sf({stops:p,base:t.base},e,d).evaluate(d,y)}}}if(n){let h=a==="exponential"?{name:"exponential",base:t.base===void 0?1:t.base}:null;return{kind:"camera",interpolationType:h,interpolationFactor:be.interpolationFactor.bind(void 0,h),zoomStops:t.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(t,e,c,l,u)}}return{kind:"source",evaluate(h,c){let p=c&&c.properties?c.properties[t.property]:void 0;return p===void 0?xn(t.default,e.default):o(t,e,p,l,u)}}}function xn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function nm(t,e,r,i,n){return xn(typeof r===n?i[r]:void 0,t.default,e.default)}function am(t,e,r){if(Q(r)!=="number")return xn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=Oa(t.stops.map(a=>a[0]),r,"");return t.stops[n][1]}function sf(t,e,r){let i=t.base===void 0?1:t.base;if(Q(r)!=="number")return xn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=Oa(t.stops.map(h=>h[0]),r,""),s=om(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=gr[e.type]||em;return typeof o.evaluate=="function"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function sm(t,e,r){switch(e.type){case"color":r=gt.parse(r);break;case"formatted":r=ze.fromString(r.toString());break;case"resolvedImage":r=_e.fromString(r.toString());break;case"padding":r=Ae.parse(r);break;case"colorArray":r=oe.parse(r);break;case"numberArray":r=Se.parse(r);break;default:Q(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return xn(r,t.default,e.default)}function om(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}function so(t){return{result:"success",value:t}}function Nr(t){return{result:"error",value:t}}var Il=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new Ap,this._defaultValue=r?pf(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ft(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let o=s instanceof ft?s.path:"",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(of(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function of(t,e,r,i){return`${t}${e}: ${r}${i==null?"":` Falling back to ${String(i)}.`}`}function lf(t){if(!t)throw Error(\'rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".\')}function ja(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Yr}function er(t,e,r,i){lf(e);let n=new ef(Yr,ba,[],r?hm(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?so(new Il(a,e,r,i)):Nr(n.errors)}var an=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!=="constant"&&!rn(e.expression),this.globalStateRefs=vn(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},wa=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!=="camera"&&!rn(e.expression),this.globalStateRefs=vn(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?be.interpolationFactor(this.interpolationType,t,e,r):0}};function lm(t){return t._styleExpression!==void 0}function uf(t,e,r,i){let n=er(t,e,r,i);if(n.result==="error")return n;let a=n.value.expression,s=Na(a);if(!s&&!ii(r))return Nr([new ve("","data expressions not supported")]);let o=Ua(a,["zoom"]);if(!o&&!nf(r))return Nr([new ve("","zoom expressions not supported")]);let l=pa(a);if(!l&&!o)return Nr([new ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(l instanceof ve)return Nr([l]);if(l instanceof be&&!kl(r))return Nr([new ve("",\'"interpolate" expressions cannot be used with this property\')]);if(!l)return so(s?new an("constant",n.value,i):new an("source",n.value,i));let u=l instanceof be?l.interpolation:void 0;return so(s?new wa("camera",n.value,l.labels,u,i):new wa("composite",n.value,l.labels,u,i))}var hf=class cf{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,lf(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=pf(i),this._warningHistory={};let n=af(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<"u"&&console.warn(of(this._rootKey,"",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new cf(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function um(t,e,r,i){if(qa(t))return new hf(t,e,r);if(ja(t)){let n=uf(t,e,r,i);if(n.result==="error")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(", "));return n.value}{let n=t;return r.type==="color"&&typeof t=="string"?n=gt.parse(t):r.type==="padding"&&(typeof t=="number"||Array.isArray(t))?n=Ae.parse(t):r.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?n=Se.parse(t):r.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?n=oe.parse(t):r.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?n=De.parse(t):r.type==="projectionDefinition"&&typeof t=="string"&&(n=Dr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>n}}}function pa(t){let e=null;if(t instanceof Cp)e=pa(t.result);else if(t instanceof Rp){for(let r of t.args)if(e=pa(r),e)break}else(t instanceof vl||t instanceof be)&&t.input instanceof _r&&t.input.name==="zoom"&&(e=t);return e instanceof ve||t.eachChild(r=>{let i=pa(r);i instanceof ve?e=i:!e&&i?e=new ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):e&&i&&e!==i&&(e=new ve("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),e}function vn(t,e=new Set){return t instanceof Fl&&e.add(t.key),t.eachChild(r=>{vn(r,e)}),e}function hm(t){let e={color:ce,string:Y,number:I,enum:Y,boolean:tt,formatted:yn,padding:za,numberArray:La,colorArray:Qi,projectionDefinition:Ba,resolvedImage:mn,variableAnchorOffsetCollection:Va};return t.type==="array"?Ut(e[t.value]||Z,t.length):e[t.type]}function pf(t){if(t.type==="color"&&qa(t.default))return new gt(0,0,0,0);switch(t.type){case"color":return gt.parse(t.default)||null;case"padding":return Ae.parse(t.default)||null;case"numberArray":return Se.parse(t.default)||null;case"colorArray":return oe.parse(t.default)||null;case"variableAnchorOffsetCollection":return De.parse(t.default)||null;case"projectionDefinition":return Dr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function ni(t,e){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=t!=null?t:{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:e}}function cm(t){let e=!1;for(let r of t){let i=ff(r);if(i==="expression")return"expression";i==="legacy"&&(e=!0)}return e?"legacy":"neutral"}function ff(t){if(typeof t=="boolean")return"neutral";if(!Array.isArray(t)||t.length===0)return"legacy";switch(t[0]){case"has":return t.length<2||t[1]==="$id"||t[1]==="$type"?"legacy":t.length===2?"neutral":"expression";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return cm(t.slice(1));default:return"expression"}}function Cl(t){return ff(t)!=="legacy"}function kh(t){return t==="$type"?["geometry-type"]:t==="$id"?["id"]:["get",t]}function pm(t){switch(t[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return t.length!==3||typeof t[1]!="string"?null:[t[0],kh(t[1]),t[2]];case"in":case"!in":{if(t.length<2||typeof t[1]!="string")return null;let e=["in",kh(t[1]),["literal",t.slice(2)]];return t[0]==="!in"?["!",e]:e}case"has":case"!has":{if(t.length!==2||typeof t[1]!="string"||t[1]==="$type"||t[1]==="$id")return null;let e=["has",t[1]];return t[0]==="!has"?["!",e]:e}default:return null}}function df(t){if((t[0]==="<"||t[0]==="<="||t[0]===">"||t[0]===">=")&&t[1]==="$type")return`"$type" cannot be use with operator "${t[0]}"`;let e=pm(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function Os(t,e,r){let i=r[t];return Array.isArray(i)?Cl(i)?Ml(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Ml(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case"all":case"any":case"none":for(let r=1;r"u")return;let i=r.path.map(n=>`[${n}]`).join("");console.warn(`${e}${i}: ${df(r.legacyFilter)}`)}var dm={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ai(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Cl(t)?fm(t,e):t=Da(t);let i=er(t,e,dm,r);if(i.result==="error")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:yf(t),getGlobalStateRefs:()=>vn(i.value.expression)}}function ym(t,e){return te)}function yf(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e"||e==="<="||e===">="?Rs(t[1],t[2],e):e==="any"?mm(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(Da)):e==="none"?["all"].concat(t.slice(1).map(Da).map(Xn)):e==="in"?Th(t[1],t.slice(2)):e==="!in"?Xn(Th(t[1],t.slice(2))):e==="has"?Ih(t[1]):e!=="!has"||Xn(Ih(t[1]))}function Rs(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function mm(t){return["any"].concat(t.map(Da))}function Th(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(ym)]]:["filter-in-small",t,["literal",e]]}}function Ih(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Xn(t){return["!",t]}function mf(t){let e=t.key,r=t.value;return r?[new E(e,r,"constants have been deprecated as of v8")]:[]}function Dt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function xr(t){if(Array.isArray(t))return t.map(xr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=xr(t[r]);return e}return Dt(t)}function te(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=Q(r);if(u!=="object")return[new E(e,r,`object expected, ${u} found`)];for(let h in r){let c=h.split(".")[0],p=ji(i,c)||i["*"],f;if(ji(n,c))f=n[c];else if(ji(i,c)){if(r[h]===void 0)continue;f=o}else if(n["*"])f=n["*"];else if(i["*"])f=o;else{l.push(new E(e,r[h],`unknown property "${h}"`));continue}l=l.concat(f({key:(e&&`${e}.`)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h,validateSpec:o},r))}for(let h in i)n[h]||i[h].required&&i[h].default===void 0&&r[h]===void 0&&l.push(new E(e,r,`missing required property "${h}"`));return l}function Bl(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(Q(e)!=="array")return[new E(s,e,`array expected, ${Q(e)} found`)];if(r.length&&e.length!==r.length)return[new E(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),Q(r.value)==="object"&&(l=r.value);let u=[];for(let h=0;hi.maximum?[new E(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new E(e,r,`number expected, ${n} found`)]}function gf(t){let e=t.valueSpec,r=Dt(t.value.type),i,n={},a,s,o=r!=="categorical"&&t.value.property===void 0,l=!o,u=Q(t.value.stops)==="array"&&Q(t.value.stops[0])==="array"&&Q(t.value.stops[0][0])==="object",h=te({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:c,default:d}});return r==="identity"&&o&&h.push(new E(t.key,t.value,\'missing required property "property"\')),r!=="identity"&&!t.value.stops&&h.push(new E(t.key,t.value,\'missing required property "stops"\')),r==="exponential"&&t.valueSpec.expression&&!kl(t.valueSpec)&&h.push(new E(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!ii(t.valueSpec)?h.push(new E(t.key,t.value,"property functions not supported")):o&&!nf(t.valueSpec)&&h.push(new E(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&h.push(new E(t.key,t.value,\'"property" property is required\')),h;function c(y){if(r==="identity")return[new E(y.key,y.value,\'identity function may not have a "stops" property\')];let m=[],g=y.value;return m=m.concat(Bl({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),Q(g)==="array"&&g.length===0&&m.push(new E(y.key,g,"array must have at least one stop")),m}function p(y){let m=[],g=y.value,x=y.key;if(Q(g)!=="array")return[new E(x,g,`array expected, ${Q(g)} found`)];if(g.length!==2)return[new E(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(Q(g[0])!=="object")return[new E(x,g,`object expected, ${Q(g[0])} found`)];if(g[0].zoom===void 0)return[new E(x,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new E(x,g,"object stop key must have value")];if(s&&s>Dt(g[0].zoom))return[new E(x,g[0].zoom,"stop zoom values must appear in ascending order")];Dt(g[0].zoom)!==s&&(s=Dt(g[0].zoom),a=void 0,n={}),m=m.concat(te({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:Ga,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return ja(xr(g[1]))?m.concat([new E(`${x}[1]`,g[1],"expressions are not allowed in function stops.")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=Q(y.value),x=Dt(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new E(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new E(y.key,v,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let b=`number expected, ${g} found`;return ii(e)&&r===void 0&&(b+=\'\\nIf you intended to use a categorical function, specify `"type": "categorical"`.\'),[new E(y.key,v,b)]}return r==="categorical"&&g==="number"&&(!isFinite(x)||Math.floor(x)!==x)?[new E(y.key,v,`integer expected, found ${x}`)]:r!=="categorical"&&g==="number"&&a!==void 0&&xnew E(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new E(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!rn(r))return[new E(t.key,t.value,\'"feature-state" data expressions are not supported with layout properties.\')];if(t.expressionContext==="filter"&&!rn(r))return[new E(t.key,t.value,\'"feature-state" data expressions are not supported with filters.\')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Ua(r,["zoom","feature-state"]))return[new E(t.key,t.value,\'"zoom" and "feature-state" expressions are not supported with cluster properties.\')];if(t.expressionContext==="cluster-initial"&&!Na(r))return[new E(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function gm(t){let e=t.value,r=t.key,i=Q(e);return i==="boolean"?[]:[new E(r,e,`boolean expected, ${i} found`)]}function oo(t){let e=t.key,r=t.value,i=Q(r);return i==="string"?gt.parse(String(r))?[]:[new E(e,r,`color expected, "${r}" found`)]:[new E(e,r,`color expected, ${i} found`)]}function sn(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Dt(r))===-1&&n.push(new E(e,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(Dt(r))===-1&&n.push(new E(e,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function xm(t,e){let r=t;for(let i of e)r=r[i];return r}function vm(t,e){let r=Ml(e);return r?[new E(`${t.key}${r.path.map(i=>`[${i}]`).join("")}`,xm(t.value,r.path),df(r.legacyFilter),null,"warning")]:[]}function Pl(t){let e=xr(t.value);return Cl(e)?[...vm(t,e),...si(nn({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:xf(t)}function xf(t){let e=t.value,r=t.key;if(Q(e)!=="array")return[new E(r,e,`array expected, ${Q(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new E(r,e,"filter array must have at least 1 element")];switch(a=a.concat(sn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Dt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Dt(e[1])==="$type"&&a.push(new E(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&a.push(new E(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=Q(e[1]),n!=="string"&&a.push(new E(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s{c in r&&e.push(new E(i,r[c],`"${c}" is prohibited for ref layers`))});let h;n.layers.forEach(c=>{Dt(c.id)===o&&(h=c)}),h?h.ref?e.push(new E(i,r.ref,"ref cannot reference another ref layer")):s=Dt(h.type):e.push(new E(i,r.ref,`ref layer "${o}" not found`))}else if(s!=="background")if(!r.source)e.push(new E(i,r,\'missing required property "source"\'));else{let h=n.sources&&n.sources[r.source],c=h&&Dt(h.type);h?c==="vector"&&s==="raster"?e.push(new E(i,r.source,`layer "${r.id}" requires a raster source`)):c!=="raster-dem"&&s==="hillshade"||c!=="raster-dem"&&s==="color-relief"?e.push(new E(i,r.source,`layer "${r.id}" requires a raster-dem source`)):c==="raster"&&s!=="raster"?e.push(new E(i,r.source,`layer "${r.id}" requires a vector source`)):c==="vector"&&!r["source-layer"]?e.push(new E(i,r,`layer "${r.id}" must specify a "source-layer"`)):c==="raster-dem"&&s!=="hillshade"&&s!=="color-relief"?e.push(new E(i,r.source,"raster-dem source can only be used with layer type \'hillshade\' or \'color-relief\'.")):s==="line"&&r.paint&&r.paint["line-gradient"]&&(c!=="geojson"||!h.lineMetrics)&&e.push(new E(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new E(i,r.source,`source "${r.source}" not found`))}return s==="raster"&&((l=r.paint)!=null&&l.resampling)&&((u=r.paint)!=null&&u["raster-resampling"])&&e.push(new E(i,r.paint,`layer "${r.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),e=e.concat(te({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Pl,layout(h){return te({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{"*"(c){return wf(nn({layerType:s},c))}}})},paint(h){return te({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{"*"(c){return bf(nn({layerType:s},c))}}})}}})),e}function tr(t){let e=t.value,r=t.key,i=Q(e);return i==="string"?[]:[new E(r,e,`string expected, ${i} found`)]}function bm(t){var c;let e=(c=t.sourceName)!=null?c:"",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=Q(r);if(r===void 0)return s;if(o!=="object")return s.push(new E("source_raster_dem",r,`object expected, ${o} found`)),s;let l=Dt(r.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let p in r)!l&&u.includes(p)?s.push(new E(p,r[p],`In "${e}": "${p}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):n[p]?s=s.concat(t.validateSpec({key:p,value:r[p],valueSpec:n[p],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new E(p,r[p],`unknown property "${p}"`));return s}var Ch={promoteId:wm};function _f(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new E(r,e,\'"type" is required\')];let s=Dt(e.type),o;switch(s){case"vector":case"raster":return o=te({key:r,value:e,valueSpec:i[`source_${s.replace("-","_")}`],style:t.style,styleSpec:i,objectElementValidators:Ch,validateSpec:a}),o;case"raster-dem":return o=bm({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case"geojson":if(o=te({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Ch}),e.cluster)for(let l in e.clusterProperties){let[u,h]=e.clusterProperties[l],c=typeof u=="string"?[u,["accumulated"],["get",l]]:u;o.push(...si({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:"cluster-map"})),o.push(...si({key:`${r}.${l}.reduce`,value:c,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return te({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return te({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new E(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return sn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function wm({key:t,value:e}){if(Q(e)==="string")return tr({key:t,value:e});{let r=[];for(let i in e)r.push(...tr({key:`${t}.${i}`,value:e[i]}));return r}}function Af(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=Q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new E("light",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(Tl);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property "${o}"`)])}return a}function Sf(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=Q(e);if(e===void 0)return[];if(a!=="object")return[new E("sky",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(Tl);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new E(o,e[o],`unknown property "${o}"`)])}return s}function Ef(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=Q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new E("terrain",e,`object expected, ${s} found`)]),a;for(let o in e)a=i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property "${o}"`)]);return a}function Dm(t){return tr(t).length===0?[]:si(t)}function _m(t){return tr(t).length===0?[]:si(t)}function Am(t){let e=t.key,r=t.value;if(Q(r)==="array"){if(r.length<1||r.length>4)return[new E(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a[new E(t,e,\'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"\')],n=r.match(Mm);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Mh||u>Mh?[new E(t,e,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new E(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function Tf(t){var o,l;let e=(o=t.key)!=null?o:"font-faces",r=t.value,i=t.validateSpec,n=(l=t.styleSpec)!=null?l:pp,a=t.style;if(!lo(r))return[new E(e,r,`object expected, ${Q(r)} found`)];let s=[];for(let u in r){let h=r[u],c=Q(h);if(c==="string")s.push(...tr({key:`${e}.${u}`,value:h}));else if(c==="array"){let p={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[f,d]of h.entries()){let y=`${e}.${u}[${f}]`;s.push(...te({key:y,value:d,valueSpec:p,styleSpec:n,style:a,validateSpec:i}));let m=lo(d)?d["unicode-range"]:void 0;if(Q(m)==="array")for(let[g,x]of m.entries())s.push(...Bm(`${y}.unicode-range[${g}]`,x))}}else s.push(new E(`${e}.${u}`,h,`string or array expected, ${c} found`))}return s}var Bh={"*"(){return[]},array:Bl,boolean:gm,number:Ga,color:oo,constants:mf,enum:sn,filter:Pl,function:gf,layer:Df,object:te,source:_f,light:Af,sky:Sf,terrain:Ef,projection:km,projectionDefinition:Tm,string:tr,formatted:Dm,resolvedImage:_m,padding:Am,numberArray:Sm,colorArray:Em,variableAnchorOffsetCollection:Fm,sprite:Ff,state:kf,fontFaces:Tf};function Xi(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=Xi,r.expression&&qa(Dt(e))?gf(t):r.expression&&ja(xr(e))?si(t):r.type&&Bh[r.type]?Bh[r.type](t):te(nn({},t,{valueSpec:r.type?i[r.type]:r}))}function If(t){let e=t.value,r=t.key,i=tr(t);return i.length||(e.indexOf("{fontstack}")===-1&&i.push(new E(r,e,\'"glyphs" url must include a "{fontstack}" token\')),e.indexOf("{range}")===-1&&i.push(new E(r,e,\'"glyphs" url must include a "{range}" token\'))),i}function Qt(t,e=w){let r=[];return r=r.concat(Xi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Xi,objectElementValidators:{glyphs:If,"*"(){return[]}}})),t.constants&&(r=r.concat(mf({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:Xi}))),Cf(r)}Qt.source=ie(re(_f)),Qt.sprite=ie(re(Ff)),Qt.glyphs=ie(re(If)),Qt.fontFaces=ie(re(Tf)),Qt.light=ie(re(Af)),Qt.sky=ie(re(Sf)),Qt.terrain=ie(re(Ef)),Qt.state=ie(re(kf)),Qt.layer=ie(re(Df)),Qt.filter=ie(re(Pl)),Qt.paintProperty=ie(re(bf)),Qt.layoutProperty=ie(re(wf));function re(t){return function(e){return t(Object.assign({},e,{validateSpec:Xi}))}}function Cf(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function ie(t){return function(...e){return Cf(t.apply(this,e))}}var Pm={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},zm=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){var t;return(t=this._literalValue)!=null?t:this._compiledValue.evaluate({})}setValue(t){if(t==null||t==="visible"||t==="none"){this._literalValue=t==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=er(t,this._rootKey,Pm,this._globalState);if(e.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=vn(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function Lm(t,e,r){return new zm(t,e,r)}var Ph=Qt,y5=new Set(Object.keys(w).filter(t=>t.startsWith("source_")).map(t=>t.slice(7).replaceAll("_","-")));function Vm(t,e){let r=!1;for(let i of e){if(i.severity==="warning"){Bt(i.message);continue}t.fire(new ma(Error(i.message))),r=!0}return r}function Om(t,e,r,i){return(i==null?void 0:i.validate)!==!1&&Vm(t,e(je({styleSpec:w},r)))}var uo=class Mf{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u=c[f+0]&&n>=c[f+1])?(o[p]=!0,s.push(h[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=c;f++)for(let d=h;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;sr?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},$m="-transition",Xa=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=um(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},ho=class{constructor(t,e,r){this.property=t,this.value=new Xa(t,void 0,e,r)}transitioned(t,e){return new Lh(this.property,this.value,e,Gt({},t.transition,this.transition),t.now)}untransitioned(){return new Lh(this.property,this.value,null,{},0)}},Nm=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return He(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new Xa(this._values[t].property,e===null?void 0:He(e),this._propertyRootKey(t),this._globalState)}getTransition(t){return He(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=He(e)||void 0}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}${$m}`]=i)}return t}transitioned(t,e){let r=new Vh(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new Vh(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},Lh=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(ii.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Lf=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind==="constant"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new st(Math.floor(e.zoom-1),e)),t.expression.evaluate(new st(Math.floor(e.zoom),e)),t.expression.evaluate(new st(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Wa=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Xt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new Xa(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new ho(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};C("DataDrivenProperty",N),C("DataConstantProperty",V),C("CrossFadedDataDrivenProperty",on),C("CrossFadedProperty",Lf),C("ColorRampProperty",Wa);var Rh=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",$s=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",de=class extends O1{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=Lm(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=ai(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new Um(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new Nm(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ya(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=ai(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){var e;if(t==="visibility")return this.visibility;if((e=this._transitionablePaint)!=null&&e.hasProperty(t))throw Error(t+Rh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){var e;let t=new globalThis.Map;if(this._transitionablePaint)for(let r in this._transitionablePaint._values){let i=this._transitionablePaint._values[r].value;for(let n of i.getGlobalStateRefs()){let a=(e=t.get(n))!=null?e:[];a.push({name:r,value:i.value}),t.set(n,a)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){var i;if(t==="visibility"){this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility();return}if((i=this._transitionablePaint)!=null&&i.hasProperty(t)){this.fire(new ma(Error(t+Rh)));return}e!=null&&this._validate(Ph.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){var e,r;if(t.endsWith("-transition")){let i=t.slice(0,-11);if(i==="visibility"||(e=this._unevaluatedLayout)!=null&&e.hasProperty(i))throw Error(t+$s);return this._transitionablePaint.getTransition(i)}if(t==="visibility"||(r=this._unevaluatedLayout)!=null&&r.hasProperty(t))throw Error(t+$s);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){var i;if(t==="visibility"||(i=this._unevaluatedLayout)!=null&&i.hasProperty(t))return this.fire(new ma(Error(t+$s))),!1;if(e!=null&&this._validate(Ph.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith("-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let n=this._transitionablePaint._values[t],a=n.property.specification["property-type"]==="cross-faded-data-driven",s=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let l=this._transitionablePaint._values[t].value;return l.isDataDriven()||s||a||this._handleOverridablePaintPropertyUpdate(t,o,l)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){var e,r;let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)==null?void 0:e.serialize(),paint:(r=this._transitionablePaint)==null?void 0:r.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),T1(t,(i,n)=>i!==void 0&&!(n==="layout"&&!Object.keys(i).length)&&!(n==="paint"&&!Object.keys(i).length))}_validate(t,e,r,i,n={}){return Om(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof se&&ii(e.property.specification)&&(e.value.kind==="source"||e.value.kind==="composite")&&e.value.isStateDependent)return!0}return!1}},qm,jm=()=>qm||(qm=new Xt({"raster-opacity":new V(w.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new V(w.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new V(w.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new V(w.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new V(w.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new V(w.paint_raster["raster-contrast"],"raster-contrast"),resampling:new V(w.paint_raster.resampling,"resampling"),"raster-resampling":new V(w.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new V(w.paint_raster["raster-fade-duration"],"raster-fade-duration")})),Gm={get paint(){return jm()}};var Xm=class extends de{constructor(t,e){super(t,Gm,e)}},Ym={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},bn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},xt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function At(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=Wm(n.type),s=r=$h(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:$h(r,Math.max(i,e)),alignment:e}}function Wm(t){return Ym[t].BYTES_PER_ELEMENT}function $h(t,e){return Math.ceil(t/e)*e}var ln=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};ln.prototype.bytesPerElement=4,C("StructArrayLayout2i4",ln);var co=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};co.prototype.bytesPerElement=6,C("StructArrayLayout3i6",co);var Nh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Nh.prototype.bytesPerElement=8,C("StructArrayLayout4i8",Nh);var po=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};po.prototype.bytesPerElement=12,C("StructArrayLayout2i4i12",po);var fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*4,l=t*8;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,t}};fo.prototype.bytesPerElement=8,C("StructArrayLayout2i4ub8",fo);var un=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};un.prototype.bytesPerElement=8,C("StructArrayLayout2f8",un);var yo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,h){let c=t*10;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};yo.prototype.bytesPerElement=20,C("StructArrayLayout10ui20",yo);var mo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};mo.prototype.bytesPerElement=16,C("StructArrayLayout8ui16",mo);var go=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,h,c,p)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[y+6]=f,t}};go.prototype.bytesPerElement=28,C("StructArrayLayout4i4ui4i1f28",go);var xo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};xo.prototype.bytesPerElement=12,C("StructArrayLayout3f12",xo);var vo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};vo.prototype.bytesPerElement=4,C("StructArrayLayout1ul4",vo);var bo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let h=t*10,c=t*5;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,t}};bo.prototype.bytesPerElement=20,C("StructArrayLayout6i1ul2ui20",bo);var wo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};wo.prototype.bytesPerElement=12,C("StructArrayLayout2i2i2i12",wo);var Uh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};Uh.prototype.bytesPerElement=16,C("StructArrayLayout2f1f2i16",Uh);var Do=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};Do.prototype.bytesPerElement=16,C("StructArrayLayout2ub2f2i16",Do);var _o=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};_o.prototype.bytesPerElement=6,C("StructArrayLayout3ui6",_o);var Ao=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let v=t*26,b=t*13,D=t*52;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=h,this.float32[b+7]=c,this.float32[b+8]=p,this.uint8[D+36]=f,this.uint8[D+37]=d,this.uint8[D+38]=y,this.uint32[b+10]=m,this.int16[v+22]=g,this.float32[b+12]=x,t}};Ao.prototype.bytesPerElement=52,C("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",Ao);var So=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P){let L=this.length;return this.resize(L+1),this.emplace(L,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P,L){let F=t*34,$=t*17;return this.int16[F+0]=e,this.int16[F+1]=r,this.int16[F+2]=i,this.int16[F+3]=n,this.int16[F+4]=a,this.int16[F+5]=s,this.int16[F+6]=o,this.int16[F+7]=l,this.uint16[F+8]=u,this.uint16[F+9]=h,this.uint16[F+10]=c,this.uint16[F+11]=p,this.uint16[F+12]=f,this.uint16[F+13]=d,this.uint16[F+14]=y,this.uint16[F+15]=m,this.uint16[F+16]=g,this.uint16[F+17]=x,this.uint16[F+18]=v,this.uint16[F+19]=b,this.uint16[F+20]=D,this.uint16[F+21]=A,this.uint16[F+22]=_,this.uint32[$+12]=S,this.float32[$+13]=k,this.float32[$+14]=z,this.uint16[F+30]=O,this.uint16[F+31]=P,this.float32[$+16]=L,t}};So.prototype.bytesPerElement=68,C("StructArrayLayout8i15ui1ul2f2ui1f68",So);var _a=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};_a.prototype.bytesPerElement=4,C("StructArrayLayout1f4",_a);var Eo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};Eo.prototype.bytesPerElement=12,C("StructArrayLayout1ui2f12",Eo);var Fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};Fo.prototype.bytesPerElement=8,C("StructArrayLayout1ul2ui8",Fo);var ko=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};ko.prototype.bytesPerElement=4,C("StructArrayLayout2ui4",ko);var qh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};qh.prototype.bytesPerElement=2,C("StructArrayLayout1ui2",qh);var To=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};To.prototype.bytesPerElement=16,C("StructArrayLayout4f16",To);var Vf=class extends bn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new B(this.anchorPointX,this.anchorPointY)}};Vf.prototype.size=20;var Ll=class extends bo{get(t){return new Vf(this,t)}};C("CollisionBoxArray",Ll);var Of=class extends bn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};Of.prototype.size=52;var Rf=class extends Ao{get(t){return new Of(this,t)}};C("PlacedSymbolArray",Rf);var $f=class extends bn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};$f.prototype.size=68;var Nf=class extends So{get(t){return new $f(this,t)}};C("SymbolInstanceArray",Nf);var Uf=class extends _a{getoffsetX(t){return this.float32[t*1+0]}};C("GlyphOffsetArray",Uf);var qf=class extends co{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};C("SymbolLineVertexArray",qf);var jf=class extends bn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};jf.prototype.size=12;var Gf=class extends Eo{get(t){return new jf(this,t)}};C("TextAnchorOffsetArray",Gf);var Xf=class extends bn{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]}};Xf.prototype.size=8;var Yf=class extends Fo{get(t){return new Xf(this,t)}};C("FeatureIndexArray",Yf);var Zm=class extends ln{};var Hm=class extends ln{},Km=class extends ln{},Jm=class extends po{},Qm=class extends fo{},tg=class extends un{},Vr=class extends yo{},jh=class extends mo{},eg=class extends go{},rg=class extends xo{},ig=class extends vo{},Gh=class extends wo{};var ng=class extends Do{};var wn=class extends _o{},Io=class extends ko{};var Co=At([{name:"a_pos",components:2,type:"Int16"}],4),ag=Co.members;Co.size,Co.alignment;var ee=class Ur{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>Ur.MAX_VERTEX_ARRAY_LENGTH&&Bt(`Max vertices per segment is ${Ur.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${Ur.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>Ur.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new Ur([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};ee.MAX_VERTEX_ARRAY_LENGTH=2**16-1,C("SegmentVector",ee);function Xh(t,e){return t=Ji(Math.floor(t),0,255),e=Ji(Math.floor(e),0,255),256*t+e}var sg=At([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),og=At([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),lg=fl(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,h=461845907,c,p=0;p>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)&4294967295,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,a){case 3:c^=(i.charCodeAt(p+2)&255)<<16;case 2:c^=(i.charCodeAt(p+1)&255)<<8;case 1:c^=i.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)&4294967295,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)&4294967295,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),ug=fl(((t,e)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=r})),Mo=h1(fl(((t,e)=>{var r=lg(),i=ug();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),Wf=class Zf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Yh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let r=Yh(e),i=0,n=this.ids.length-1;for(;i>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Bo(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new Zf;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Yh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Mo.default)(String(t))}function Bo(t,e,r,i){for(;r>1],a=r-1,s=i+1;for(;;){do a++;while(t[a]n);if(a>=s)break;Yn(t,a,s),Yn(e,3*a,3*s),Yn(e,3*a+1,3*s+1),Yn(e,3*a+2,3*s+2)}s-r`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type==="color"?new cg(t,e):new Ol(t,e)}},ur=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i==="u_pattern_to"?n=this.patternTo:i==="u_pattern_from"?n=this.patternFrom:i==="u_dasharray_to"?n=this.dashTo:i==="u_dasharray_from"?n=this.dashFrom:i==="u_pixel_ratio_to"?n=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new hg(t,e):new Ol(t,e)}},ke=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new st(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type==="color"){let i=Po(r);for(let n=t;n`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new st(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new st(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(this.zoom,n),r,i),s=this.expression.evaluate(new st(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type==="color"){let n=Po(r),a=Po(i);for(let s=t;s`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof ke||r instanceof he)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof Ye){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof $i||r instanceof ur||r instanceof he)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof $i||n instanceof ur||n instanceof he){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof Ye){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof ke||r instanceof he)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof ke||r instanceof he||r instanceof Ye)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof ke||e instanceof he||e instanceof Ye)&&e.destroy()}}},vr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new Jf(i,e,r);this.needsUpload=!1,this._featureMap=new Wf,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function pg(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function fg(t){return{"line-pattern":{source:Vr,composite:Vr},"fill-pattern":{source:Vr,composite:Vr},"fill-extrusion-pattern":{source:Vr,composite:Vr},"line-dasharray":{source:jh,composite:jh}}[t]}function Wh(t,e,r){var n;let i={color:{source:un,composite:To},number:{source:_a,composite:un}};return((n=fg(t))==null?void 0:n[r])||i[e][r]}C("ConstantBinder",$i),C("CrossFadedConstantBinder",ur),C("SourceExpressionBinder",ke),C("CrossFadedPatternBinder",Hf),C("CrossFadedDasharrayBinder",Kf),C("CompositeExpressionBinder",he),C("ProgramConfiguration",Jf,{omit:["_buffers"]}),C("ProgramConfigurationSet",vr);var zo=2**14-1,Zh=-zo-1;function Ar(t){let e=mt/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=Ji(a,Zh,zo),n.y=Ji(s,Zh,zo),(an.x+1||sn.y+1)&&Bt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function hi(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ar(t):[]}}var Hh=-32768;function dg(t,e,r,i,n){t.emplaceBack(Hh+e*8+i,Hh+r*8+n)}var Rl=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Hm,this.indexArray=new wn,this.segments=new ee,this.programConfigurations=new vr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type==="heatmap";if(i.type==="circle"){let c=i;a=c.layout.get("circle-sort-key"),s=!a.isConstant(),o||(o=c.paint.get("circle-pitch-alignment")==="map")}let l=o?e.subdivisionGranularity.circle:1,u=new st(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:p,index:f,sourceLayerIndex:d}of t){let y=hi(c,h);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:c.properties,type:c.type,sourceLayerIndex:d,index:f,geometry:h?y.geometry:Ar(c),patterns:{},sortKey:m};n.push(g)}s&&n.sort((c,p)=>c.sortKey-p.sortKey);for(let c of n){let{geometry:p,index:f,sourceLayerIndex:d}=c,y=t[f].feature;this.addFeature(c,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ag),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,h=l.y;if(u<0||u>=8192||h<0||h>=8192)continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;for(let f=0;f=3){for(let n of i)if(oi(t,n))return!0}if(gg(t,i,r))return!0}return!1}function gg(t,e,r){if(t.length>1){if($l(t,e))return!0;for(let i of e)if(Lo(i,t,r))return!0}for(let i of t)if(Lo(i,e,r))return!0;return!1}function $l(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Kh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function oi(t,e){let r=!1;for(let i=0,n=t.length-1;ie.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function vg(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new B(e,r),new B(e,n),new B(i,n),new B(i,r)];if(t.length>2){for(let s of a)if(oi(t,s))return!0}for(let s=0;sn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return!1;let a=Ke(t,e,r[0]);return a!==Ke(t,e,r[1])||a!==Ke(t,e,r[2])||a!==Ke(t,e,r[3])}function Wr(t,e,r){let i=e.paint.get(t).value;return i.kind==="constant"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ha(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ka(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=B.convert(e)._mult(n);r==="viewport"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function wg(t){let e=[];for(let r=0;rNl(n,e,r,i))}var kg,Tg=()=>kg||(kg=new Xt({"circle-sort-key":new N(w.layout_circle["circle-sort-key"],"circle-sort-key")})),Ig,Cg=()=>Ig||(Ig=new Xt({"circle-radius":new N(w.paint_circle["circle-radius"],"circle-radius"),"circle-color":new N(w.paint_circle["circle-color"],"circle-color"),"circle-blur":new N(w.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new N(w.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new V(w.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new V(w.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new V(w.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new V(w.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new N(w.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new N(w.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new N(w.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})),Mg={get paint(){return Cg()},get layout(){return Tg()}};var Bg=class extends de{constructor(t,e){super(t,Mg,e)}createBucket(t){return new Rl(t)}queryRadius(t){let e=t;return Wr("circle-radius",this,e)+Wr("circle-stroke-width",this,e)+Ha(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Ka(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),h=this.paint.get("circle-pitch-scale"),c=this.paint.get("circle-pitch-alignment"),p,f;return c==="map"?(p=l,f=u*a):(p=Fg(l,n,s,o),f=u),ed({queryGeometry:p,size:f,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},i)}},rd=class extends Rl{};C("HeatmapBucket",rd,{omit:["layers"]});var Pg,zg=()=>Pg||(Pg=new Xt({"heatmap-radius":new N(w.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new N(w.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new V(w.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Wa(w.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new V(w.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})),Lg={get paint(){return zg()}};function Ul(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function id(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Ul({},{width:e,height:r},i);ql(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function ql(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError("out of range destination coordinates for image copy");let s=t.data,o=e.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;s$g||($g=new Xt({"hillshade-illumination-direction":new V(w.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new V(w.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new V(w.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new V(w.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new V(w.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new V(w.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new V(w.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new V(w.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new V(w.paint_hillshade.resampling,"resampling")})),Ug={get paint(){return Ng()}};var qg=class extends de{constructor(t,e){super(t,Ug,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(ch);return{directionRadians:t.map(ch),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},jg,Gg=()=>jg||(jg=new Xt({"color-relief-opacity":new V(w["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Wa(w["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new V(w["paint_color-relief"].resampling,"resampling")})),Xg={get paint(){return Gg()}};function Wn(t){return"data"in t}var Jh=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){var u;let{width:i,height:n}=t,a=(((u=this.size)==null?void 0:u[0])!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!(e!=null&&e.useMipmap),a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&(e==null?void 0:e.premultiply)!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let h=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,h,o.RGBA8,i,n),Wn(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=t;l&&c&&(c=Ns(c)),c&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,c)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else Wn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:h,y:c}=r||{x:0,y:0};Wn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,h,c,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,h,c,o))}this.useMipmap&&!(Wn(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=Ns(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=Ns(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),(r===n.LINEAR_MIPMAP_NEAREST||r===n.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Pe,jl=(Pe=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i)){Bt(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Pe.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;hthis.max&&(this.max=f),f=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,h=this._unpackAtIndex(a,s),c=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return sd(e,this.getUnpackVector())}getPixels(){return new Zt({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let h=s;h80*r){o=t[0],l=t[1];let h=o,c=l;for(let p=r;ph&&(h=f),d>c&&(c=d)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return Ro(a,s,o,l,u),s}function od(t,e,r,i,n){let a=null;if(n===fx(t,e,r,i)>0)for(let s=e;s=e;s-=i)a=ec(s/i|0,t[s],t[s+1],a);return a&&cn(a,a.next)&&(fn(a),a=a.next),a}function br(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(hn.size===0||!hn.has(i))&&(cn(i,i.next)||Ft(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),Oo=!0,fn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Ro(t,e,r,i,n){n&&ox(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Ft(o,t,l)<0&&(n?Kg(t,r,i,n):Hg(t))){e.push(o.i,t.i,l.i),fn(t),t=l,a=l;continue}if(t=l,t===a){if(Oo=!1,t=br(t),Oo){a=t;continue}if(!s){t=Jg(t,e),a=t,s=!0;continue}Qg(t,e,r,i,n);break}}}function Hg(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,h=Math.min(n,a,s),c=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&(n!==d.x||o!==d.y)&&Ea(n,o,a,l,s,u,d.x,d.y)&&Ft(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Kg(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,h=n.y,c=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(h,c,p),y=Math.max(o,l,u),m=Math.max(h,c,p),g=qo(f,d,e,r,i),x=qo(y,m,e,r,i),v=t.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||h!==v.y)&&Ea(o,h,l,c,u,p,v.x,v.y)&&Ft(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=t.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||h!==b.y)&&Ea(o,h,l,c,u,p,b.x,b.y)&&Ft(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Jg(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;ud(n,r,r.next,a,!1)&&pn(n,a)&&pn(a,n)&&(e.push(n.i,r.i,a.i),fn(r),fn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?br(r):r}function Qg(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&hx(a,s)){let o=hd(a,s);a=br(a,a.next),o=br(o,o.next),Ro(a,e,r,i,n),Ro(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var $o=!1;function tx(t,e,r,i){let n=[];for(let a=0,s=e.length;as&&(s=r.x),r.yo&&(o=r.y),h.xs&&(s=h.x),h.yo&&(o=h.y),r=h}while(++l<16&&r!==e);Uo[i]=r;let u=i*4;wt[u]=n,wt[u+1]=a,wt[u+2]=s,wt[u+3]=o}while(r!==e)}function nx(t,e){let r=t.z*4;e.xwt[r+2]&&(wt[r+2]=e.x),e.y>wt[r+3]&&(wt[r+3]=e.y)}function Qh(t){let e=Uo[t];for(;e.prev.next!==e;)e=e.next;return Uo[t]=e,e}function tc(t){let e=No[t];for(;e.prev.next!==e;)e=e.next;return No[t]=e,e}function ax(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(cn(t,r))return r;for(let p=0,f=0;pwt[f+3]||wt[f]>i||wt[f+2]<=a)continue;let d=Qh(p);r=tc(p);do{if(r.prev.next===r){if(cn(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.xi||wt[f+3]h)continue;let d=Qh(p);r=tc(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&Ea(ni)&&(ys.x||r.x===s.x&&sx(s,r)))&&(s=r,c=y)}r=r.next}while(r!==d)}return s}function sx(t,e){return Ft(t.prev,t,e.prev)<0&&Ft(e.next,t,t.next)<0}var ae=[],Ti=[],or=new Uint32Array,Ii=new Uint32Array,Ci=new Uint32Array(256);function ox(t,e,r,i){let n=t,a=0;do n.z=qo(n.x,n.y,e,r,i),ae[a++]=n,n=n.next;while(n!==t);lx(a);let s=null;for(let o=0;o=0&&ae[n].z>i;)ae[n+1]=ae[n],n--;ae[n+1]=r}return}or.length>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Ci[o];Ci[o]=s,s+=l}for(let o=0;o>>a&255]++;i[u]=e[o],n[u]=l}}function qo(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function ux(t){let e=t,r=t;do(e.x=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function hx(t,e){let r=cn(t,e)&&Ft(t.prev,t,t.next)>0&&Ft(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||pn(t,e)&&pn(e,t)&&(Ft(t.prev,t,e.prev)!==0||Ft(t,e.prev,e)!==0))&&!cx(t,e)&&(r||px(t,e))}function Ft(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function cn(t,e){return t.x===e.x&&t.y===e.y}function ud(t,e,r,i,n=!0){let a=Ft(t,e,r),s=Ft(t,e,i),o=Ft(r,i,t),l=Ft(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&Hn(t,r,e)||s===0&&Hn(t,i,e)||o===0&&Hn(r,t,i)||l===0&&Hn(r,e,i)):!1}function Hn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function cx(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.xa&&o.y>a||s.y=0&&Ft(t,t.prev,e)>=0:Ft(t,e,t.prev)<0||Ft(t,t.next,e)<0}function px(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function hd(t,e){let r=jo(t.i,t.x,t.y),i=jo(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function ec(t,e,r,i){let n=jo(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function fn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),$o&&nx(t.prev,t.next)}function jo(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function fx(t,e,r,i){let n=0;for(let a=e,s=r-i;at)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<32767||e>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,a),this._vertexBuffer.push(r,i),a}_subdivideTrianglesScanline(t){if(this._granularity<2)return gx(this._vertexBuffer,t);let e=[],r=t.length;for(let i=0;i=1||b<=0)||m&&(ln)){h>=i&&h<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let _=o+f*v,S=l+d*v;a.push(this._vertexToIndex(_,S))}let D=o+f*Math.max(v,0),A=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,h,D,A),!m&&b<1){let _=o+f*b,S=l+d*b;a.push(this._vertexToIndex(_,S))}(m||h>=i&&h<=n)&&a.push(r[(s+1)%3]),!m&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,o,l,u,h,c,p,A,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,h=u?Math.min(e,i):Math.min(a,s),c=u?Math.max(e,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(u?e=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let h=n-r,c=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+c*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o=1||m<=0){let _=e-a,S=r-s,k=(l-s)/S,z=(u-s)/S,O=a+_*Math.min(k,z);x=Math.floor(Math.min(O,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(O,o)/this._granularityCellSize)-1,b=o0?u:l;if(b)for(let _=x;_<=v;_++){let S=_*this._granularityCellSize;t.push(this._vertexToIndex(S,A))}else for(let _=v;_>=x;_--){let S=_*this._granularityCellSize;t.push(this._vertexToIndex(S,A))}}_generateOutline(t){let e=[];for(let r of t){let i=cr(r,this._granularity,!0),n=this._pointArrayToIndices(i),a=[];for(let s=1;sn==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=mt,a=t.length;for(let s=2;s=2&&((s=this._canonical)==null?void 0:s.z)===0&&(n=this._removeTrianglesOutsideTileX(n),a=a.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:n,indicesLineList:a}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r0?(Math.floor(_/s)+1)*s:(Math.ceil(_/s)-1)*s,O=b>0?(Math.floor(S/s)+1)*s:(Math.ceil(S/s)-1)*s,P=Math.abs(_-z),L=Math.abs(S-O),F=Math.abs(_-y),$=Math.abs(S-m),U=g?P/D:1/0,T=x?L/A:1/0;if((F<=P||!g)&&($<=L||!x))break;if(U0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function xx(t,e,r){if(e.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,n=t[e[0]*2];for(let l=1;l=0?s-1:a-1,u=(o+1)%a,h=t[e[l]*2],c=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(hp)x=!1;else{let v=g-y,b=-(m-d),D=y((p-d)*v+(f-y)*b)*D&&(x=!0)}if(x){let v=e[l],b=e[s],D=e[o];v!==b&&v!==D&&b!==D&&r.push(D,b,v),s--,s<0&&(s=a-1)}else{let v=e[u],b=e[s],D=e[o];v!==b&&v!==D&&b!==D&&r.push(D,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function pd(t,e,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(uee.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=Zi(s,i,a,o,p,y,u),b=Zi(s,i,a,o,f,m,u),D=Zi(s,i,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+D-l),u.primitiveLength++}}function bx(t,e,r,i,n,a){let s=[];for(let c=0;cee.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,h=0);let x=Zi(s,i,a,o,f,y,u),v=Zi(s,i,a,o,d,m,u);r.emplaceBack(h+x-l,h+v-l),u.primitiveLength++}}var fd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new Km,this.indexArray=new wn,this.indexArray2=new Io,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.segments2=new ee,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Aa("fill",this.layers,e);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Ar(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let f=Gl("fill",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,h,r,{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Bt(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${t}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Wg),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of Ra(e,500)){let o=cd(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;pd((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};C("FillBucket",fd,{omit:["layers","patternFeatures"]});var wx,Dx=()=>wx||(wx=new Xt({"fill-sort-key":new N(w.layout_fill["fill-sort-key"],"fill-sort-key")})),_x,Ax=()=>_x||(_x=new Xt({"fill-antialias":new V(w.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new N(w.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new V(w.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new N(w.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new N(w.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new V(w.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new V(w.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new on(w.paint_fill["fill-pattern"],"fill-pattern")})),Sx={get paint(){return Ax()},get layout(){return Dx()}};var Ex=class extends de{constructor(t,e){super(t,Sx,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new fd(t)}queryRadius(){return Ha(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:r,pixelsToTileUnits:i}){return Qf(Ka(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},Go=At([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Fx=At([{name:"a_centroid",components:2,type:"Int16"}],4),kx=Go.members;Go.size,Go.alignment;var Fa=class Xo{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new Xo;return r.extend(e(new B(this.minX,this.minY))),r.extend(e(new B(this.maxX,this.minY))),r.extend(e(new B(this.minX,this.maxY))),r.extend(e(new B(this.maxX,this.maxY))),r}static fromPoints(e){let r=new Xo;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},g5=Fa.fromPoints([new B(0,0),new B(mt,mt)]);function Yo(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function rc(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var Dn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new B(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new B(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),no&&(o=n),au&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(c){return[(c.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+a)*2/i)*Math.PI))-90]}function l(c){return c.map(o)}let u;if(this.type===1){let c=[];for(let f of s)c.push(f[0]);let p=l(c);u=c.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}}else if(this.type===3){let c=dd(s),p=[];for(let f of c)p.push(f.map(l));u=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw Error("unknown feature type");let h={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};Dn.types=["Unknown","Point","LineString","Polygon"];function dd(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Dn(this._pbf,e,this.extent,this._keys,this._values)}};function Cx(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ui(F1(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return yd*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof Ui)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ui(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e)return new Ui(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}},md=2*Math.PI*yd;function gd(t){return md*Math.cos(t*Math.PI/180)}function Mx(t){return(180+t)/360}function Bx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Px(t,e){return t/gd(e)}function zx(t){return t*360-180}function Wo(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Lx(t,e){return t*gd(Wo(e))}function Vx(t){return 1/Math.cos(t*Math.PI/180)}var Yl=class xd{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=ic.convert(e);return new xd(Mx(i.lng),Bx(i.lat),Px(r,i.lat))}toLngLat(){return new ic(zx(this.x),Wo(this.y))}toAltitude(){return Lx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/md*Vx(Wo(this.y))}};function Ox(t,e,r){let i=1/(1<Nx(n,i))}function $x(t,e){let r=Rx(mt/2,mt/2,e),i=Yl.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function qx(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let h=.2,c=Math.min(n,o*h,l*h),p=r.add(a.mult(c)),f=r.add(s.mult(c)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(c/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var js=8192;function Mi(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*js)*2+s,n*js*2,a*js*2,Math.round(o))}var vd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Jm,this.centroidVertexArray=new Zm,this.indexArray=new wn,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=Aa("fill-extrusion",this.layers,e);let i=new st(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),s=n._featureFilter.needGeometry;for(let{feature:o,id:l,index:u,sourceLayerIndex:h}of t){let c=hi(o,s);if(!n._featureFilter.filter(i,c,r))continue;let p=s?c.geometry:Ar(o),f={id:l,sourceLayerIndex:h,index:u,geometry:a>0?nc(p,a,r):p,properties:o.properties,type:o.type,patterns:{}};this.hasDependencies?this.features.push(Gl("fill-extrusion",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,u,r,{},e.subdivisionGranularity),e.featureIndex.insert(o,f.geometry,u,h,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,kx),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Fx.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){let s=this.layers[0],o=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0,l=o>0?nc(e,o,i):e;for(let u of Ra(l,500)){let h={x:0,y:0,sampleCount:0},c=this.layoutVertexArray.length;this.processPolygon(h,i,t,u,a);let p=this.layoutVertexArray.length-c,f=Math.floor(h.x/h.sampleCount),d=Math.floor(h.y/h.sampleCount);for(let y=0;y{Mi(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0;for(let i=1;iee.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=n.sub(a)._perp()._unit(),o=a.dist(n);r+o>32768&&(r=0),Mi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,0,r),Mi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,1,r),r+=o,Mi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,r),Mi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,r);let l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function jx(t,e){for(let r=0;rGx||(Gx=new Xt({"fill-extrusion-rounded-corner-distance":new V(w["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})),Yx,Wx=()=>Yx||(Yx=new Xt({"fill-extrusion-opacity":new V(w["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new N(w["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new V(w["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new V(w["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new on(w["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new N(w["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new N(w["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new V(w["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})),Zx={get paint(){return Wx()},get layout(){return Xx()}};var Hx=class extends de{constructor(t,e){super(t,Zx,e)}createBucket(t){return new vd(t)}queryRadius(){return Ha(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=Ka(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(e,r),u=this.paint.get("fill-extrusion-base").evaluate(e,r),h=Qx(o,s,0),c=Jx(i,u,l,s),p=c[0],f=c[1];return Kx(p,f,h)}};function Bi(t,e){return t.x*e.x+t.y*e.y}function ac(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r>1),s=r-e,o,l=t[e],u=t[e+1],h=t[r],c=t[r+1];for(let p=e+3;pn){o=p,n=f;continue}if(f===n){let d=Math.abs(p-a);di&&(o-e>3&&Zo(t,e,o,i),t[o+2]=n,r-o>3&&Zo(t,o,r,i))}function t2(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function Mt(t,e,r,i){let n={type:e,geom:r},a={id:t!=null?t:null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case"Point":case"MultiPoint":Pi(a,n.geom);break;case"LineString":Pi(a,n.geom.points);break;case"Polygon":Pi(a,n.geom[0].points);break;case"MultiLineString":for(let s of n.geom)Pi(a,s.points);break;case"MultiPolygon":for(let s of n.geom)Pi(a,s[0].points)}return a}function Wl(t){let e=t;t.points.length>64&&(e.points=new Float64Array(t.points))}function Pi(t,e){for(let r=0;r1024)throw Error("GeometryCollection nesting exceeds supported depth: 1024");if(e.geometry.type==="GeometryCollection"){r2(t,e,e.geometry,r,i,n+1);return}if(!((o=e.geometry.coordinates)!=null&&o.length))return;let a=e2(e,r,i),s=(r.tolerance/((1<0&&(s+=i?(n*h-u*a)/2:Math.sqrt((u-n)**2+(h-a)**2)),n=u,a=h}let o=e.points.length-3;e.points[2]=1,r>0&&Zo(e.points,0,o,r),e.points[o+2]=1,Wl(e),e.size=Math.abs(s),e.start=0,e.end=e.size}function Kl(t,e,r,i){for(let n=0;n1?1:r}function u2(t){return{type:"FeatureCollection",features:t.map(e=>ka(e))}}function ka(t){let e={type:"Feature",geometry:h2(t),properties:t.tags};return t.id!=null&&(e.id=t.id),e}function h2(t){let{type:e,geometry:r}=t;switch(e){case"Point":return{type:e,coordinates:bd(r[0],r[1])};case"MultiPoint":return{type:e,coordinates:Kn(r)};case"LineString":return{type:e,coordinates:Kn(r.points)};case"MultiLineString":case"Polygon":return{type:e,coordinates:r.map(i=>Kn(i.points))};case"MultiPolygon":return{type:e,coordinates:r.map(i=>i.map(n=>Kn(n.points)))}}}function Kn(t){let e=[];for(let r=0;r=r&&s=i)return null;let l=[];for(let u of t){let h=n===0?u.minX:u.minY,c=n===0?u.maxX:u.maxY;if(h>=r&&c=i))switch(u.type){case"Point":case"MultiPoint":c2(u,l,r,i,n);continue;case"LineString":p2(u,l,r,i,n,o);continue;case"MultiLineString":f2(u,l,r,i,n);continue;case"Polygon":d2(u,l,r,i,n);continue;case"MultiPolygon":y2(u,l,r,i,n);continue}}return l.length?l:null}function c2(t,e,r,i,n){let a=[];if(m2(t.geometry,a,r,i,n),!a.length)return;let s=a.length===3?"Point":"MultiPoint";e.push(Mt(t.id,s,a,t.tags))}function p2(t,e,r,i,n,a){let s=[];if(_d(t.geometry,s,r,i,n,!1,a.lineMetrics),s.length){if(a.lineMetrics){for(let o of s)e.push(Mt(t.id,"LineString",o,t.tags));return}if(s.length>1){e.push(Mt(t.id,"MultiLineString",s,t.tags));return}e.push(Mt(t.id,"LineString",s[0],t.tags))}}function f2(t,e,r,i,n){let a=[];if(Jl(t.geometry,a,r,i,n,!1),a.length){if(a.length===1){e.push(Mt(t.id,"LineString",a[0],t.tags));return}e.push(Mt(t.id,"MultiLineString",a,t.tags))}}function d2(t,e,r,i,n){let a=[];Jl(t.geometry,a,r,i,n,!0),a.length&&e.push(Mt(t.id,"Polygon",a,t.tags))}function y2(t,e,r,i,n){let a=[];for(let s of t.geometry){let o=[];Jl(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&e.push(Mt(t.id,"MultiPolygon",a,t.tags))}function m2(t,e,r,i,n){for(let a=0;a=r&&s<=i&&Kr(e,t[a],t[a+1],t[a+2])}}function _d(t,e,r,i,n,a,s){let o=sc(t),l=n===0?g2:x2,u=t.start,h,c;for(let g=0;gr&&(c=l(o,x,v,D,A,r),s&&(o.start=u+h*c)):_>i?S=r&&(c=l(o,x,v,D,A,r),k=!0),S>i&&_<=i&&(c=l(o,x,v,D,A,i),k=!0),!a&&k&&(s&&(o.end=u+h*c),e.push(o),o=sc(t)),s&&(u+=h)}let p=t.points.length-3,f=t.points[p],d=t.points[p+1],y=t.points[p+2],m=n===0?f:d;m>=r&&m<=i&&Kr(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&Kr(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Wl(o),e.push(o))}function sc(t){return{points:[],size:t.size,start:t.start,end:t.end}}function Jl(t,e,r,i,n,a){for(let s of t)_d(s,e,r,i,n,a,!1)}function Kr(t,e,r,i){t.push(e,r,i)}function g2(t,e,r,i,n,a){let s=(a-e)/(i-e);return Kr(t.points,a,r+(n-r)*s,1),s}function x2(t,e,r,i,n,a){let s=(a-r)/(n-r);return Kr(t.points,e+(i-e)*s,a,1),s}function Ql(t,e){let r=e.buffer/e.extent,i=t,n=Te(t,1,-1-r,r,0,-1,2,e),a=Te(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=Te(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=oc(n,1).concat(i)),a&&(i=i.concat(oc(a,-1)))),i}function oc(t,e){let r=[];for(let i of t)switch(i.type){case"Point":case"MultiPoint":{let n=v2(i.geometry,e);r.push(Mt(i.id,i.type,n,i.tags));continue}case"LineString":{let n=Gs(i.geometry,e);r.push(Mt(i.id,i.type,n,i.tags));continue}case"MultiLineString":case"Polygon":{let n=[];for(let a of i.geometry)n.push(Gs(a,e));r.push(Mt(i.id,i.type,n,i.tags));continue}case"MultiPolygon":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push(Gs(o,e));n.push(s)}r.push(Mt(i.id,i.type,n,i.tags));continue}}return r}function v2(t,e){let r=[];for(let i=0;io.id));t=t.filter(o=>!s.has(o.id))}if(i.add.size){let s=Zl({type:"FeatureCollection",features:Array.from(i.add.values())},r);s=Ql(s,r),n=n.concat(s),t=t.concat(s)}}if(i.update.size){let a=new Map,s=[];for(let o of t)i.update.has(o.id)?a.set(o.id,[...a.get(o.id)||[],o]):s.push(o);for(let[o,l]of i.update){let u=a.get(o);if(!u||u.length===0)continue;let h=w2(u,l,r);n=n.concat(u,h),s=s.concat(h)}t=s}return{affected:n,source:t}}function w2(t,e,r){var a,s;let i=!!e.newGeometry,n=e.removeAllProperties||((a=e.removeProperties)==null?void 0:a.length)>0||((s=e.addOrUpdateProperties)==null?void 0:s.length)>0;if(i){let o=t[0],l=Zl({type:"FeatureCollection",features:[{type:"Feature",id:o.id,geometry:e.newGeometry,properties:n?lc(o.tags,e):o.tags}]},r);return l=Ql(l,r),l}if(n){let o=[];for(let l of t){let u=je({},l);u.tags=lc(u.tags,e),o.push(u)}return o}return t}function lc(t,e){if(e.removeAllProperties)return{};let r=je({},t||{});if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function D2(t,e){var r,i;return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map((r=t.add)==null?void 0:r.map(n=>[e.promoteId?n.properties[e.promoteId]:n.id,n])),update:new Map((i=t.update)==null?void 0:i.map(n=>[n.id,n]))}:{remove:new Set,add:new Map,update:new Map}}var uc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],dt=new Uint32Array(96),_2=class Ad{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=uc[i&15];if(!a)throw Error("Unrecognized array type.");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Ad(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=uc.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let h=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(h,8,e),this.coords=new i(h,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=r,new Uint32Array(h,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Ho(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=[];for(;l>0;){let h=dt[--l],c=dt[--l],p=dt[--l];if(c-p<=o){for(let m=p;m<=c;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+c>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(h===0?e<=d:r<=y)&&(dt[l++]=p,dt[l++]=f-1,dt[l++]=1-h),(h===0?i>=d:n>=y)&&(dt[l++]=f+1,dt[l++]=c,dt[l++]=1-h)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=0,h=i*i;for(;l>0;){let c=dt[--l],p=dt[--l],f=dt[--l];if(p-f<=o){for(let g=f;g<=p;g++)hc(s[2*g],s[2*g+1],e,r)<=h&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];hc(y,m,e,r)<=h&&(n[u++]=a[d]),(c===0?e-i<=y:r-i<=m)&&(dt[l++]=f,dt[l++]=d-1,dt[l++]=1-c),(c===0?e+i>=y:r+i>=m)&&(dt[l++]=d+1,dt[l++]=p,dt[l++]=1-c)}return u}};function Ho(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Sd(t,e,s,i,n,a),Ho(t,e,r,i,s-1,1-a),Ho(t,e,r,s+1,n,1-a)}function Sd(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,h=r-i+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);Sd(t,e,r,Math.max(i,Math.floor(r-h*p/u+f)),Math.min(n,Math.floor(r+(u-h)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(zi(t,e,i,r),e[2*n+a]>s&&zi(t,e,i,n);os;)l--}e[2*i+a]===s?zi(t,e,i,l):(l++,zi(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function zi(t,e,r,i){Xs(t,r,i),Xs(e,2*r,2*i),Xs(e,2*r+1,2*i+1)}function Xs(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function hc(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var Ko={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},A2=class{constructor(t){this.options=Object.assign(Object.create(Ko),t),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,[a,s]=[Zr(i),Hr(n)],o={id:r.id,type:"Point",geometry:[a,s],tags:r.properties};e.push(o)}this.createIndex(e)}initialize(t){let e=[];for(let r of t)r.type==="Point"&&e.push(r);this.createIndex(e)}updateIndex(t,e,r){this.options=Object.assign(Object.create(Ko),r.clusterOptions),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;e&&console.time("total time");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=[];for(let o=0;o=r;o--){let l=Date.now();s=this.trees[o]=this.createTree(this.cluster(s,o)),e&&console.log("z%d: %d clusters in %dms",o,s.numItems,Date.now()-l)}e&&console.timeEnd("total time")}getClusters(t,e){return this.getClustersInternal(t,e).map(r=>ka(r))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let h=this.getClustersInternal([r,i,180,a],e),c=this.getClustersInternal([-180,i,n,a],e);return h.concat(c)}let s=this.trees[this.limitZoom(e)],o=s.range(Zr(r),Hr(a),Zr(n),Hr(i)),l=s.flatData,u=[];for(let h of o){let c=this.stride*h;u.push(l[c+5]>1?S2(l,c,this.clusterProps):this.points[l[c+3]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error("No cluster with the specified id: "+t),n=this.trees[r];if(!n)throw i;let a=n.flatData;if(e*this.stride>=a.length)throw i;let s=this.options.radius/(this.options.extent*2**(r-1)),o=a[e*this.stride],l=a[e*this.stride+1],u=n.within(o,l,s),h=[];for(let c of u){let p=c*this.stride;a[p+4]===t&&h.push(a[p+5]>1?E2(a,p,this.clusterProps):ka(this.points[a[p+3]]))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t,{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,h={transformed:!0,features:[],source:null,x:e,y:r,z:t};return this.addTileFeatures(i.range((e-o)/n,l,(e+1+o)/n,u),i.flatData,e,r,n,h),e===0&&this.addTileFeatures(i.range(1-o/n,l,1,u),i.flatData,n,r,n,h),e===n-1&&this.addTileFeatures(i.range(0,l,o/n,u),i.flatData,-1,r,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o!=null&&o.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n1,u,h,c;if(l)u=tu(e,o,this.clusterProps),h=e[o],c=e[o+1];else{let d=this.points[e[o+3]];u=d.tags,[h,c]=d.geometry}let p={type:1,geometry:[[Math.round(this.options.extent*(h*n-r)),Math.round(this.options.extent*(c*n-i))]],tags:u},f;f=l||this.options.generateId?e[o+3]:this.points[e[o+3]].id,f!==void 0&&(p.id=f),a.features.push(p)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*2**e),o=t.flatData,l=[],u=this.stride;for(let h=0;he&&(y+=o[g+5])}if(y>d&&y>=a){let m=c*d,g=p*d,x,v=-1,b=((h/u|0)<<5)+(e+1)+this.points.length;for(let D of f){let A=D*u;if(o[A+2]<=e)continue;o[A+2]=e;let _=o[A+5];m+=o[A]*_,g+=o[A+1]*_,o[A+4]=b,n&&(x||(x=this.map(o,h,!0),v=this.clusterProps.length,this.clusterProps.push(x)),n(x,this.map(o,A)))}o[h+4]=b,l.push(m/y,g/y,1/0,b,-1,y),n&&l.push(v)}else{for(let m=0;m1)for(let m of f){let g=m*u;if(!(o[g+2]<=e)){o[g+2]=e;for(let x=0;x>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+5]>1){let a=this.clusterProps[t[e+6]];return r?Object.assign({},a):a}let i=this.points[t[e+3]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function S2(t,e,r){return{id:t[e+3],type:"Point",tags:tu(t,e,r),geometry:[t[e],t[e+1]]}}function E2(t,e,r){return{type:"Feature",id:t[e+3],properties:tu(t,e,r),geometry:{type:"Point",coordinates:[wd(t[e]),Dd(t[e+1])]}}}function tu(t,e,r){let i=t[e+5],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+6],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+3],point_count:i,point_count_abbreviated:n})}var Ed="geojsonvt_clip_start",Fd="geojsonvt_clip_end";function cc(t,e,r,i,n){let a=e===n.maxZoom?0:n.tolerance/((1<0&&e.size<(n?s:i)){r.numPoints+=e.points.length/3;return}let o=[];for(let l=0;ls)&&(r.numSimplified++,o.push(e.points[l],e.points[l+1])),r.numPoints++;n&&M2(o,a),t.push(o)}function M2(t,e){let r=0;for(let i=0,n=t.length,a=n-2;i0===e)for(let i=0,n=t.length;i1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(e),r.debug>1&&console.timeEnd("invalidating");let[i,n,a]=[0,0,0],s=cc(t,i,n,a,r);s.source=t;let o=Jn(i,n,a);if(this.tiles[o]=s,this.tileCoords.push({z:i,x:n,y:a,id:o}),r.debug){let l=`z${i}`;this.stats[l]=(this.stats[l]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{extent:i,debug:n}=this.options,a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);let o=t,l=e,u=r,h;for(;!h&&o>0;)o--,l>>=1,u>>=1,h=this.tiles[Jn(o,l,u)];return!(h!=null&&h.source)||(n>1&&(console.log("found parent tile z%d-%d-%d",o,l,u),console.time("drilling down")),this.splitTile(h.source,o,l,u,t,e,r),n>1&&console.timeEnd("drilling down"),!this.tiles[s])?null:pc(this.tiles[s],i)}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let h=1<1&&console.time("creation"),p=this.tiles[c]=cc(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:c}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let _=`z${e}`;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let _=n-e;if(r!==a>>_||i!==s>>_)continue}}if(p.source=null,!t.length)continue;u>1&&console.time("clipping");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,D=Te(t,h,r-f,r+y,0,p.minX,p.maxX,l),A=Te(t,h,r+d,r+m,0,p.minX,p.maxX,l);D&&(g=Te(D,h,i-f,i+y,1,p.minY,p.maxY,l),x=Te(D,h,i+d,i+m,1,p.minY,p.maxY,l)),A&&(v=Te(A,h,i-f,i+y,1,p.minY,p.maxY,l),b=Te(A,h,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd("clipping"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(v||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let h=this.tiles[u],c=1<=f||s=y)continue;let m=!1;for(let g of t)if(g.maxX>=p&&g.minX=d&&g.minY1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",h.z,h.x,h.y,h.numFeatures,h.numPoints,h.numSimplified);let g=`z${h.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function Jn(t,e,r){return((1<24)throw Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw Error("promoteId and generateId cannot be used together.");let i=Zl(t,e);r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),i=Ql(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new A2(e.clusterOptions):new z2(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:i,source:n}=b2(this.source,t,r);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(ka(n))||(e.push(n),i.add(n.id)));return t=t.filter(n=>!i.has(n.id)),{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error("to retrieve data the `updateable` option must be set to true");return u2(this.source)}updateClusterOptions(t,e){let r=this.options.cluster;if(this.options.cluster=t,this.options.clusterOptions=e,r==t){this.tileIndex.updateIndex(this.source,[],this.options);return}this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},Jo=At([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),V2=Jo.members;Jo.size,Jo.alignment;var Qo=At([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),O2=Qo.members;Qo.size,Qo.alignment;var R2=Math.cos(75/2*(Math.PI/180)),Id=1/2,fc=2**14/Id,Cd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new Qm,this.layoutVertexArray2=new tg,this.indexArray=new wn,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Aa("line",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Ar(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(Aa("line",this.layers,e)?Gl("line",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,h,r,{},{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,O2)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,V2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,"geojsonvt_clip_start")&&Object.hasOwn(t.properties,"geojsonvt_clip_end"))return{start:+t.properties[Ed],end:+t.properties[Fd]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(t,{}),u=o.get("line-cap").evaluate(t,{}),h=o.get("line-miter-limit").evaluate(t,{}),c=o.get("line-round-limit").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e)this.addLine(p,t,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=cr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v=2&&t[h-1].equals(t[h-2]);)h--;let c=0;for(;c0;if(k&&v>c){let L=d.dist(y);if(L>2*p){let F=d.sub(d.sub(y)._mult(p/L)._round());this.updateDistance(y,F),this.addCurrentVertex(F,g,0,0,f),y=F}}let O=y&&m,P=O?r:u?"butt":i;if(O&&P==="round"&&(_n&&(P="bevel"),P==="bevel"&&(_>2&&(P="flipbevel"),_100)b=x.mult(-1);else{let L=_*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(L*(z?-1:1))}this.addCurrentVertex(d,b,0,0,f),this.addCurrentVertex(d,b.mult(-1),0,0,f)}else if(P==="bevel"||P==="fakeround"){let L=-Math.sqrt(_*_-1),F=z?L:0,$=z?0:L;if(y&&this.addCurrentVertex(d,g,F,$,f),P==="fakeround"){let U=Math.round(S*180/Math.PI/20);for(let T=1;T2*p){let F=d.add(m.sub(d)._mult(p/L)._round());this.updateDistance(d,F),this.addCurrentVertex(F,x,0,0,f),d=F}}}}addCurrentVertex(t,e,r,i,n,a=!1){let s=e.x+e.y*r,o=e.y-e.x*r,l=-e.x+e.y*i,u=-e.y-e.x*i;this.addHalfVertex(t,s,o,a,!1,r,n),this.addHalfVertex(t,l,u,a,!0,-i,n),this.distance>fc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a))}addHalfVertex({x:t,y:e},r,i,n,a,s,o){let l=(this.lineClips?this.scaledDistance*(fc-1):this.scaledDistance)*Id;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!n,(e<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*i)+128,(s===0?0:s<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let r=e.paint.get("line-dasharray");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get("line-dasharray");if(!a||a.value.kind==="constant")continue;let s=n.layout.get("line-cap").evaluate(e,{})==="round",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},h=`${o.dasharray.join(",")},${o.round}`,c=`${l.dasharray.join(",")},${l.round}`,p=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[h]=o,i.dashDependencies[c]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:h,mid:c,max:p}}}};C("LineBucket",Cd,{omit:["layers","patternFeatures"]});var $2,N2=()=>$2||($2=new Xt({"line-cap":new N(w.layout_line["line-cap"],"line-cap"),"line-join":new N(w.layout_line["line-join"],"line-join"),"line-miter-limit":new N(w.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new N(w.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new N(w.layout_line["line-sort-key"],"line-sort-key")})),U2,q2=()=>U2||(U2=new Xt({"line-opacity":new N(w.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new V(w.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new N(w.paint_line["line-color"],"line-color"),"line-translate":new V(w.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new V(w.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new N(w.paint_line["line-width"],"line-width"),"line-gap-width":new N(w.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new N(w.paint_line["line-offset"],"line-offset"),"line-blur":new N(w.paint_line["line-blur"],"line-blur"),"line-dasharray":new on(w.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new on(w.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Wa(w.paint_line["line-gradient"],"line-gradient")})),dc={get paint(){return q2()},get layout(){return N2()}},j2=class extends N{possiblyEvaluate(t,e){return e=new st(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=Gt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,i)}},Qn;var G2=class extends de{constructor(t,e){super(t,dc,e),this.gradientVersion=0,Qn||(Qn=new j2(dc.paint.properties["line-width"].specification,"line-floorwidth"),Qn.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let e=this.gradientExpression();this.stepInterpolant=lm(e)?e._styleExpression.expression instanceof vl:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Qn.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Cd(t)}queryRadius(t){let e=t,r=yc(Wr("line-width",this,e),Wr("line-gap-width",this,e)),i=Wr("line-offset",this,e);return r/2+Math.abs(i)+Ha(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=Ka(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),o=a/2*yc(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(i=Dg(i,l*a)),mg(s,i,o)}isTileClipped(){return!0}};function yc(t,e){return e>0?e+2*t:t}var X2=At([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),Y2=At([{name:"a_projected_pos",components:3,type:"Float32"}],4);At([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var W2=At([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);At([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var mc=At([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),x5=At([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);At([{name:"triangle",components:3,type:"Uint16"}]),At([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),At([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),At([{type:"Float32",name:"offsetX"}]),At([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),At([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wr=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(wr.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,e){return rt(this,null,function*(){if(this.isParsed())return this.getState();if(t.pluginStatus!=="loading")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(yield e(r),yield Promise.race([i,n]),this.isParsed()){let a={pluginStatus:"loaded",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)})}};function Z2(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function H2(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function K2(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function Qa(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function J2(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function Q2(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function gc(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function tv(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||new RegExp("^\\\\p{gc=Mc}","u").test(e)}var ev={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},rv={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},iv={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},xc=1604,nv=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function av(t,e,r){let i=0;for(let n of t.split(";")){let[a,s]=n.split(",").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l{let r=e.codePointAt(0);return{codePoint:r,type:sv(r),form:null}})}function cv(t){let e=t.filter(r=>r.type!=="T");for(let r=0;r0&&ov(e[r-1].type),a=r+1String.fromCodePoint(dv(r))).join("")}function mv(t,e,r){var n;let i=e.layout.get("text-transform").evaluate(r,{});return i==="uppercase"?t=t.toLocaleUpperCase():i==="lowercase"&&(t=t.toLocaleLowerCase()),((n=wr.applyArabicShaping)!=null?n:yv)(t)}function gv(t,e,r){for(let i of t.sections)i.text=mv(i.text,e,r);return t}function xv(t){let e={},r={},i=[],n=0;function a(u){i.push(t[u]),n++}function s(u,h,c){let p=r[u];return delete r[u],r[h]=p,i[p].geometry[0].pop(),i[p].geometry[0]=i[p].geometry[0].concat(c[0]),p}function o(u,h,c){let p=e[h];return delete e[h],e[u]=p,i[p].geometry[0].shift(),i[p].geometry[0]=c[0].concat(i[p].geometry[0]),p}function l(u,h,c){let p=c?h[0][h[0].length-1]:h[0][0];return`${u}:${p.x}:${p.y}`}for(let u=0;uu.geometry)}var Bd=typeof Intl<"u"&&"Segmenter"in Intl,ta,ea;function tl(t){if(!Bd||!Q2(t))return[...t];ta!=null||(ta=new Intl.Segmenter(void 0,{granularity:"grapheme"}));let e=[];for(let{segment:r}of ta.segment(t)){let i=e.length-1;i>=0&&tv(e[i],r)?e[i]+=r:e.push(r)}return e}function vv(t){let e=new Set;if(Bd){ea!=null||(ea=new Intl.Segmenter(void 0,{granularity:"word"}));for(let{index:i}of ea.segment(t))e.add(i);return e}let r=0;for(let i of t.split(new RegExp("\\\\b|(?=\\\\p{Ideo})","u")))e.add(r),r+=i.length;return e}function Pd(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function ru(t){return/\\s/u.test(String.fromCodePoint(t))}function el(t){for(let e of t)if(Qa(e.codePointAt(0)))return!0;return!1}function bv(t){for(let e of t)if(!wv(e.codePointAt(0)))return!1;return!0}function wv(t){return!Z2(t)}function vc(t){return!(Qa(t)||J2(t))}function zd(t){return new RegExp("\\\\p{sc=Arab}","u").test(String.fromCodePoint(t))}function Ld(t){return H2(t)}function Vd(t){for(let e of t)if(Ld(e.codePointAt(0)))return!0;return!1}var Gr={"!":"\\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","\\u22EF":"\\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"};function Dv(t){let e="",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!vc(s.value.codePointAt(0))||Gr[s.value])&&(r.premature||!vc(r.value.codePointAt(0))||Gr[r.value])&&Gr[n.value]?e+=Gr[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var _v={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Av={40:!0};function bc(t,e,r,i,n,a){if("fontStack"in e){let s=r[e.fontStack],o=s==null?void 0:s[t];if(o)return o.metrics.advance*e.scale+n;let l=0;for(let u of t){let h=s==null?void 0:s[u];h&&(l+=h.metrics.advance*e.scale+n)}return l}{let s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}}function wc(t,e,r,i){let n=(t-e)**2;return i?tr&&Dc(e[i-1]);)i--;this.text=e.slice(r,i).join(""),this.sectionIndex=this.sectionIndex.slice(r,i),this._graphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(""),n=this.sectionIndex.slice(e,r);return new rl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n0?i[i.length-1]:"",a=tl(n+e);this.text+=e,this._graphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=[],o=this.determineAverageLineWidth(e,r,i,n,a),l=this.hasZeroWidthSpaces(),u=this.graphemes(),h=null,c=0,p=0;for(let f=0;f0){let y=u[f-1].codePointAt(0),m=d.codePointAt(0),g=K2(y),x=gc(y)&&gc(m);(_v[y]||g||"imageName"in this.getSection(f-1)||u[f+1]!==void 0&&Av[m]||x&&(h!=null?h:h=vv(this.text)).has(p))&&s.push(_c(f,c,o,s,Sv(y,m,g&&l),!1))}ru(d.codePointAt(0))||(c+=bc(d,this.getSection(f),i,n,e,a)),p+=d.length}return Od(_c(this.length(),c,o,s,0,!0))}determineAverageLineWidth(e,r,i,n,a){let s=0,o=0;for(let u of this.graphemes()){let h=this.getSection(o);s+=bc(u,h,i,n,e,a),o++}let l=Math.max(1,Math.ceil(s/r));return s/l}};function Ev(){return(function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},i={};r.L=1,i[1]="L",Object.keys(e).forEach(function(R,J){r[R]=1<1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function d(R,J){var W=0,M=new Map,ut=J&&new Map,X;return R.split(",").forEach(function G(K){if(K.indexOf("+")!==-1)for(var Nt=+K;Nt--;)G(X);else{X=K;var vt=K.split(">"),nt=vt[0],Tt=vt[1];nt=String.fromCodePoint(W+=parseInt(nt,36)),Tt=String.fromCodePoint(W+=parseInt(Tt,36)),M.set(nt,Tt),J&&ut.set(Tt,nt)}}),{map:M,reverseMap:ut}}var y,m,g;function x(){if(!y){var R=d(f.pairs,!0),J=R.map,W=R.reverseMap;y=J,m=W,g=d(f.canonical,!1).map}}function v(R){return x(),y.get(R)||null}function b(R){return x(),m.get(R)||null}function D(R){return x(),g.get(R)||null}var A=r.L,_=r.R,S=r.EN,k=r.ES,z=r.ET,O=r.AN,P=r.CS,L=r.B,F=r.S,$=r.ON,U=r.BN,T=r.NSM,q=r.AL,at=r.LRO,ot=r.RLO,pt=r.LRE,Et=r.RLE,qt=r.PDF,Ht=r.LRI,Ve=r.RLI,ye=r.FSI,Kt=r.PDI;function Oe(R,J){for(var W=125,M=new Uint32Array(R.length),ut=0;ut0)Fe--;else if(rs>0){for(Ne=0;!lt[lt.length-1]._isolate;)lt.pop();var is=lt[lt.length-1]._isolInitIndex;is!=null&&(Nt.set(is,zt),Nt.set(zt,is)),lt.pop(),rs--}bt=lt[lt.length-1],K[zt]=bt._level,bt._override&&G(zt,bt._override)}else Lt&qt?(Fe===0&&(Ne>0?Ne--:!bt._isolate&<.length>1&&(lt.pop(),bt=lt[lt.length-1])),K[zt]=bt._level):Lt&L&&(K[zt]=nt.level);else K[zt]=bt._level,bt._override&&Lt!==U&&G(zt,bt._override)}for(var Cr=[],me=null,ar=nt.start;ar<=nt.end;ar++){var ns=M[ar];if(!(ns&o)){var Bu=K[ar],Pu=ns&n,Wy=ns===Kt;me&&Bu===me._level?(me._end=ar,me._endsWithIsolInit=Pu):Cr.push(me={_start:ar,_end:ar,_level:Bu,_startsWithPDI:Wy,_endsWithIsolInit:Pu})}}for(var as=[],Sn=0;Sn=0;kn--)if(!(M[kn]&o)){Vu=K[kn];break}var us=Mr[Mr.length-1],Hy=K[us],Ou=nt.level;if(!(M[us]&n)){for(var Tn=us+1;Tn<=nt.end;Tn++)if(!(M[Tn]&o)){Ou=K[Tn];break}}as.push({_seqIndices:Mr,_sosType:Math.max(Vu,Zy)%2?_:A,_eosType:Math.max(Ou,Hy)%2?_:A})}}for(var hs=0;hs=0;Cn--)if(!(M[j[Cn]]&o)){ps=M[j[Cn]];break}G(Ru,ps&(n|Kt)?$:ps)}}if(X.get(S))for(var Mn=0;Mn=-1;Bn--){var Nu=Bn===-1?yi:M[j[Bn]];if(Nu&a){Nu===q&&G($u,O);break}}}if(X.get(q))for(var fs=0;fs=0&&(Pr=M[j[ms]],Pr&o);ms--);for(var gs=mi+1;gs=0&&M[j[Pn]]&(z|o);Pn--)G(j[Pn],S);for(ge++;ge=0&&M[j[zn]]&o;zn--)G(j[zn],$);for(var Ln=gi+1;Ln=0;bi--){var bs=zr[bi].char;if(bs===Yu||bs===b(D(vi))||v(D(bs))===vi){Vn.push([zr[bi].seqIndex,Lr]),zr.length=bi;break}}}Vn.sort(function(Yt,ue){return Yt[0]-ue[0]});for(var ws=0;ws=0;As--){var Ju=j[As];if(M[Ju]&Xu){var Qu=M[Ju]&xi?_:A;xe=Qu===Br?Br:Qu;break}}}if(xe){if(M[j[On]]=M[j[Ds]]=xe,xe!==Br){for(var wi=On+1;wi=0;_i--)if(M[j[_i]]&o)th=_i;else{Es=M[j[_i]]&xi?_:A;break}for(var eh=Ky,Ai=Ue+1;Ai=0&&c(R[$n])&l;$n--)K[$n]=nt.level}}return{levels:K,paragraphs:vt};function rh(Yt,ue){for(var Wt=Yt;Wt=K&&c(R[nt])&l;nt--)vt[nt]=G.level;for(var Tt=G.level,di=1/0,nr=0;nrTt&&(Tt=Re),Re=di;$e--)for(var lt=0;lt=$e){for(var bt=lt;lt+1=$e;)lt++;lt>bt&&X.push([bt+K,lt+K])}}}),X}function Tr(R,J,W,M){var ut=Ir(R,J,W,M),X=[].concat(R);return ut.forEach(function(G,K){X[K]=(J.levels[G]&1?kt(R[G]):null)||R[G]}),X.join("")}function Ir(R,J,W,M){for(var ut=ir(R,J,W,M),X=[],G=0;G=0;i--){let n=nu.getBidiCharTypeName(t[i].text[0]);Tv.has(n)?(t[i].level=e,r=!0):r&&kv.has(n)?t[i].level=e:r=!1}}function Mv(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)=i;a--)for(let s=0;s=a;)o++;for(let l=s,u=o;le>=n.start&&e<=n.end))==null?void 0:r.level)!=null?i:0}function zv(t,e,r,i,n){let a=Iv(t,e,i,n);Cv(a,r);let s="",o=[];for(let l of Mv(a,r)){if(Fv.test(l.text))continue;let u=Bv(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function Lv(t,e){let r=e.filter(a=>a>0&&aa-s),n=[];for(let a=0;a+1n.start))).map(([n,a])=>zv(t,r,Pv(i,n),n,a))}function Vv(t,e){return Rd(t,e).map(r=>r.text)}function Ov(t,e,r){return Rd(t,r).map(i=>[i.text,i.sourceIndices.map(n=>{var a;return(a=e[n])!=null?a:0})])}var il=4294967296,Ac=1/il,Sc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),au=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*il;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*il;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,$v(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Sc?Sc.decode(this.buf.subarray(e,t)):tb(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd();for(;this.pos=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},Rv=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e=0&&t<128){this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t;return}if(t>268435455||t<0){Uv(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=eb(this.buf,t,this.pos);let r=this.pos-e;r>=128&&Ec(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&Ec(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,Gv,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,Xv,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,Zv,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,Yv,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,Wv,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,Hv,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Kv,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,Jv,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,Qv,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function $v(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return Nv(t,n,e);throw Error("Expected varint not more than 10 bytes")}function Nv(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Uv(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),qv(r,i,e),jv(i,e)}function qv(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function jv(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Ec(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function Gv(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;sa){e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;continue}for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}e.pos=n}function Xv(t,e){for(let r=0;r239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function eb(t,e,r){for(let i=0,n,a;i55295&&n<57344)if(a){if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}else a&&(a=(t[r++]=239,t[r++]=191,t[r++]=189,null));n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=n&63|128)}return r}function rb(t){return typeof(t==null?void 0:t.renderWithWebGL)=="function"}function su(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o=r;a--)e.push(a);r=i+1}else{for(let a=r;at.toCodeUnitIndex(a)),i=wr.isParsed()?wr:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>kc(a,t.sections,[...a].map(()=>0))):Vv(t.toString(),r).map(a=>nl([...a],t.sections,[...a].map(()=>0)));let n=sb(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>kc(a,t.sections,s)):Ov(t.text,n,r).map(([a,s])=>{let o=[...a];return nl(o,t.sections,Ud(o).map(l=>{var u;return(u=s[l])!=null?u:0}))})}function nl(t,e,r){var a;let i=new iu(t.join(""),e,[]),n=0;for(let s of i.graphemes())i.sectionIndex.push((a=r[n])!=null?a:0),n+=[...s].length;return i}function Ud(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function kc(t,e,r){let i=[...t],n=Ud(i),a=ab(i);return nl(a.map(s=>i[s]),e,a.map(s=>{var o;return(o=r[n[s]])!=null?o:0}))}function ra(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=iu.fromFeature(t,n);c===2&&y.verticalizePunctuation();let m=y.determineLineBreaks(u,a,e,i,f),g=Vd(y.text)?ob(y,m):nb(y,m),x=[],v={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return mb(v,e,r,i,g,s,o,l,c,u,p,d),!ib(x)&&v}function qd(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function lb(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function jd(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}function ub(t,e,r,i){var a;if(t!=null&&t.rect)return t;let n=(a=e[r.fontStack])==null?void 0:a[i];return n?{rect:null,metrics:n.metrics}:null}function hb(t,e,r){return!(t===1||!e&&!Qa(r)||e&&(ru(r)||zd(r)))}function da(t){return new RegExp("\\\\p{Nd}","u").test(String.fromCodePoint(t))}function Gd(t){return new RegExp("\\\\p{Lu}","u").test(String.fromCodePoint(t))}function cb(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function pb(t){let e=t.some(da)&&t.every(i=>da(i)||cb(i)),r=t.length<=3&&t.every(i=>Gd(i)||da(i));return e||r}function fb(t){return(da(t)||Gd(t))&&!zd(t)}function db(t,e){let r=!1;for(let i=0;ia.codePointAt(0)),i=r.map(Qa),n=a=>!i[a]&&!ru(r[a])&&!("imageName"in t.getSection(a));for(let a=0;au){let p=Math.ceil(i/u);r*=p/n,n=p}return{x1:e,y1:r,x2:e+i,y2:r+n}}function Tc(t,e,r,i,n,a){let s=t.image,o;if(s.content){let m=s.content,g=s.pixelRatio||1;o=[m[0]/g,m[1]/g,s.displaySize[0]-m[2]/g,s.displaySize[1]-m[3]/g]}let l=e.left*a,u=e.right*a,h,c,p,f;r==="width"||r==="both"?(f=n[0]+l-i[3],c=n[0]+u+i[1]):(f=n[0]+(l+u-s.displaySize[0])/2,c=f+s.displaySize[0]);let d=e.top*a,y=e.bottom*a;return r==="height"||r==="both"?(h=n[1]+d-i[0],p=n[1]+y+i[2]):(h=n[1]+(d+y-s.displaySize[1])/2,p=h+s.displaySize[1]),{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}var Ic=32640;function Cc(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new st(t+1))};if(r.kind==="source")return{kind:"source"};if(r.kind==="composite"){let{minZoom:i,maxZoom:n}=Db(r.zoomStops,t);return{kind:"composite",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=_b(r),n=r.evaluate(new st(t+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function Db(t,e){let r=0;for(;rt.evaluate(new st(e===-1/0?t.zoomStops[1]-1:e)))}var Jr=class Yd extends B{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new Yd(this.x,this.y,this.angle,this.segment)}};C("Anchor",Jr);function Wd(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;oi;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=c.dist(p)}return!0}function Zd(t){let e=0;for(let r=0;ru){let d=(u-l)/f,y=new Jr(gr.number(c.x,p.x,d),gr.number(c.y,p.y,d),p.angleTo(c),h);return y._round(),!s||Wd(t,y,o,s,e)?y:void 0}l+=f}}function Sb(t,e,r,i,n,a,s,o,l){let u=Hd(i,a,s),h=Kd(i,n),c=h*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-c=0&&b=0&&D=0&&p+u<=h){let A=new Jr(b,D,x,d);A._round(),(!i||Wd(t,A,a,i,n))&&f.push(A)}}c+=g}return!o&&!f.length&&!s&&(f=Jd(t,c/2,r,i,n,a,s,!0,l)),f}function Eb(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l=i&&h.x>=i)&&(u.x>=i?u=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round():h.x>=i&&(h=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round()),!(u.y>=n&&h.y>=n)&&(u.y>=n?u=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y>=n&&(h=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),(!o||!u.equals(o[o.length-1]))&&(o=[u],a.push(o)),o.push(h)))))}}return a}function Qd(t,e,r,i,n,a){let s=Mc(t,e,r,n,0);return s=Mc(s,e,i,a,1),s}function Mc(t,e,r,i,n){switch(e){case 1:return Fb(t,r,i,n);case 2:return Bc(t,r,i,n,!1);case 3:return Bc(t,r,i,n,!0)}return[]}function Fb(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function kb(t,e,r,i,n){let a=i===0?Tb:Ib,s=[],o=[];for(let h=0;he&&s.push(a(c,p,e)):f>r?d=e&&(s.push(a(c,p,e)),y=!0),d>r&&f<=r&&(s.push(a(c,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new B(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function Bc(t,e,r,i,n){let a=[];for(let s of t){let o=kb(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function Tb(t,e,r){let i=(r-t.x)/(e.x-t.x);return new B(r,t.y+(e.y-t.y)*i)}function Ib(t,e,r){let i=(r-t.y)/(e.y-t.y);return new B(t.x+(e.x-t.x)*i,r)}function Pc(t,e,r,i){let n=[],a=t.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(F,$)=>F+$[1]-$[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,v=0,b=d,D=0,A=y,_=0,S=m;if(a.content&&i){let F=a.content,$=F[2]-F[0],U=F[3]-F[1];(a.textFitWidth||a.textFitHeight)&&(u=Xd(t)),g=ia(h,0,F[0]),v=ia(c,0,F[1]),x=ia(h,F[0],F[2]),b=ia(c,F[1],F[3]),D=F[0]-g,_=F[1]-v,A=$-x,S=U-b}let k=u.x1,z=u.y1,O=u.x2-k,P=u.y2-z,L=(F,$,U,T)=>{let q=na(F.stretch-g,x,O,k),at=aa(F.fixed-D,A,F.stretch,f),ot=na($.stretch-v,b,P,z),pt=aa($.fixed-_,S,$.stretch,d),Et=na(U.stretch-g,x,O,k),qt=aa(U.fixed-D,A,U.stretch,f),Ht=na(T.stretch-v,b,P,z),Ve=aa(T.fixed-_,S,T.stretch,d),ye=new B(q,ot),Kt=new B(Et,ot),Oe=new B(Et,Ht),kr=new B(q,Ht),rr=new B(at/s,pt/s),fi=new B(qt/s,Ve/s),kt=e*Math.PI/180;if(kt){let R=Math.sin(kt),J=Math.cos(kt),W=[J,-R,R,J];ye._matMult(W),Kt._matMult(W),kr._matMult(W),Oe._matMult(W)}let Ee=F.stretch+F.fixed,ir=U.stretch+U.fixed,Tr=$.stretch+$.fixed,Ir=T.stretch+T.fixed;return{tl:ye,tr:Kt,bl:kr,br:Oe,tex:{x:a.paddedRect.x+1+Ee,y:a.paddedRect.y+1+Tr,w:ir-Ee,h:Ir-Tr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:rr,pixelOffsetBR:fi,minFontScaleX:A/s/O,minFontScaleY:S/s/P,isSDF:r}};if(!i||!a.stretchX&&!a.stretchY)n.push(L({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));else{let F=zc(h,y,f),$=zc(c,m,d);for(let U=0;U0&&(d=Math.max(10,d),this.circleDiameter=d)}else{let c=(h=a.image)!=null&&h.content&&(a.image.textFitWidth||a.image.textFitHeight)?Xd(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-o[0],c.y2=c.y2*s+o[2],c.x1=c.x1*s-o[3],c.x2=c.x2*s+o[1];let p=a.collisionPadding;if(p&&(c.x1-=p[0]*s,c.y1-=p[1]*s,c.x2+=p[2]*s,c.y2+=p[3]*s),u){let f=new B(c.x1,c.y1),d=new B(c.x2,c.y1),y=new B(c.x1,c.y2),m=new B(c.x2,c.y2),g=u*Math.PI/180;f._rotate(g),d._rotate(g),y._rotate(g),m._rotate(g),c.x1=Math.min(f.x,d.x,y.x,m.x),c.x2=Math.max(f.x,d.x,y.x,m.x),c.y1=Math.min(f.y,d.y,y.y,m.y),c.y2=Math.max(f.y,d.y,y.y,m.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,i,n)}this.boxEndIndex=t.length}},Mb=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}};function Bb(t,e=1){let r=Fa.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new Mb([],Pb),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new B(s,o);for(let p=s;pc.d||!c.d)&&(c=p),!(p.max-c.d<=e)&&(n=p.h/2,a.push(new qr(p.p.x-n,p.p.y-n,n,t)),a.push(new qr(p.p.x+n,p.p.y-n,n,t)),a.push(new qr(p.p.x-n,p.p.y+n,n,t)),a.push(new qr(p.p.x+n,p.p.y+n,n,t)))}return h.d>0&&c.d-h.d<=e?h.p:c.p}function Pb(t,e){return e.max-t.max}var qr=class{constructor(t,e,r,i){this.p=new B(t,e),this.h=r,this.d=zb(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function zb(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;at.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,td(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function Lb(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;ap*24);h.startsWith("top")?c[1]-=7:h.startsWith("bottom")&&(c[1]+=7),l[u+1]=c}return new De(l)}let a=i.get("text-variable-anchor");if(a){let o;o=t._unevaluatedLayout.getValue("text-radial-offset")===void 0?i.get("text-offset").evaluate(e,{},r).map(u=>u*24):[i.get("text-radial-offset").evaluate(e,{},r)*24,lu];let l=[];for(let u of a)l.push(u,ty(u,o));return new De(l)}return null}function Ob(t){var h,c;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=mt/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new st(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new st(p),t.canonical),n["text-size"].possiblyEvaluate(new st(f),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new st(p),t.canonical),n["icon-size"].possiblyEvaluate(new st(f),t.canonical)]}let s=i.get("text-line-height")*24,o=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",l=i.get("text-keep-upright"),u=i.get("text-size");for(let p of t.bucket.features){let f=i.get("text-font").evaluate(p,{},t.canonical).join(","),d=u.evaluate(p,{},t.canonical),y=a.layoutTextSize.evaluate(p,{},t.canonical),m=a.layoutIconSize.evaluate(p,{},t.canonical),g={horizontal:{},vertical:void 0},x=p.text,v=[0,0];if(x){let _=x.toString(),S=i.get("text-letter-spacing").evaluate(p,{},t.canonical)*24,k=bv(_)?S:0,z=i.get("text-anchor").evaluate(p,{},t.canonical),O=ey(r,p,t.canonical);if(!O){let $=i.get("text-radial-offset").evaluate(p,{},t.canonical);v=$?ty(z,[$*24,lu]):i.get("text-offset").evaluate(p,{},t.canonical).map(U=>U*24)}let P=o?"center":i.get("text-justify").evaluate(p,{},t.canonical),L=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(p,{},t.canonical)*24:1/0,F=()=>{t.bucket.allowVerticalPlacement&&el(_)&&(g.vertical=ra(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,L,s,z,"left",k,v,2,!0,y,d))};if(!o&&O){let $=new Set;if(P==="auto")for(let T=0;T{T.x<0||T.x>=8192||T.y<0||T.y>=8192||Nb(t,T,U,r,i,n,L,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,[D,D,D,D],S,l,v,A,k,d,e,a,u,h,s)};if(z==="line")for(let U of Eb(e.geometry,0,0,mt,mt)){let T=cr(U,F),q=Sb(T,b,_,r.vertical||y,i,24,x,t.overscaling,mt);for(let at of q){let ot=y;(!ot||!Ub(t,ot.text,O,at))&&$(T,at)}}else if(z==="line-center"){for(let U of e.geometry)if(U.length>1){let T=cr(U,F),q=Ab(T,_,r.vertical||y,i,24,x);q&&$(T,q)}}else if(e.type==="Polygon")for(let U of Ra(e.geometry,0)){let T=Bb(U,16);$(cr(U[0],F,!0),new Jr(T.x,T.y,0))}else if(e.type==="LineString")for(let U of e.geometry){let T=cr(U,F);$(T,new Jr(T[0].x,T[0].y,0))}else if(e.type==="Point")for(let U of e.geometry)for(let T of U)$([T],new Jr(T.x,T.y,0))}function $b(t,e){let r=t.length,i=e==null?void 0:e.values;if((i==null?void 0:i.length)>0)for(let n=0;n32640&&Bt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):g.kind==="composite"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Bt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,m,x,o,a,s,h,e,u.lineStartIndex,u.lineLength,f,y,l);for(let v of c)p[v]=t.text.placedSymbolArray.length-1;return m.length*4}function ry(t){for(let e in t)return t[e];return null}function Nb(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S){let k=t.addToLineVertexArray(e,r),z=o.layout.get("symbol-height-offset").evaluate(b,{},_);z>t.maxHeightOffset&&(t.maxHeightOffset=z);let O,P,L,F,$=0,U=0,T=0,q=0,at=-1,ot=-1,pt={},Et=(0,Mo.default)("");if(t.allowVerticalPlacement&&i.vertical){let J=o.layout.get("text-rotate").evaluate(b,{},_)+90,W=i.vertical;L=new sa(l,e,u,h,c,W,p,f,d,J),s&&(F=new sa(l,e,u,h,c,s,m,g,d,J))}if(n){let J=o.layout.get("icon-rotate").evaluate(b,{}),W=o.layout.get("icon-text-fit")!=="none",M=Pc(n,J,A,W),ut=s?Pc(s,J,A,W):void 0;P=new sa(l,e,u,h,c,n,m,g,!1,J),$=M.length*4;let X=t.iconSizeData,G=null;X.kind==="source"?(G=[128*o.layout.get("icon-size").evaluate(b,{})],G[0]>32640&&Bt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):X.kind==="composite"&&(G=[128*D.compositeIconSizes[0].evaluate(b,{},_),128*D.compositeIconSizes[1].evaluate(b,{},_)],(G[0]>32640||G[1]>32640)&&Bt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,M,G,v,x,b,0,e,k.lineStartIndex,k.lineLength,-1,_,z),at=t.icon.placedSymbolArray.length-1,ut&&(U=ut.length*4,t.addSymbols(t.icon,ut,G,v,x,b,2,e,k.lineStartIndex,k.lineLength,-1,_,z),ot=t.icon.placedSymbolArray.length-1)}let qt=Object.keys(i.horizontal);for(let J of qt){let W=i.horizontal[J];O||(O=(Et=(0,Mo.default)(W.text),new sa(l,e,u,h,c,W,p,f,d,o.layout.get("text-rotate").evaluate(b,{},_))));let M=W.positionedLines.length===1;if(T+=Vc(t,e,W,a,o,d,b,y,z,k,i.vertical?1:3,M?qt:[J],pt,at,D,_),M)break}i.vertical&&(q+=Vc(t,e,i.vertical,a,o,d,b,y,z,k,2,["vertical"],pt,ot,D,_));let Ht=O?O.boxStartIndex:t.collisionBoxArray.length,Ve=O?O.boxEndIndex:t.collisionBoxArray.length,ye=L?L.boxStartIndex:t.collisionBoxArray.length,Kt=L?L.boxEndIndex:t.collisionBoxArray.length,Oe=P?P.boxStartIndex:t.collisionBoxArray.length,kr=P?P.boxEndIndex:t.collisionBoxArray.length,rr=F?F.boxStartIndex:t.collisionBoxArray.length,fi=F?F.boxEndIndex:t.collisionBoxArray.length,kt=-1,Ee=(J,W)=>J!=null&&J.circleDiameter?Math.max(J.circleDiameter,W):W;kt=Ee(O,kt),kt=Ee(L,kt),kt=Ee(P,kt),kt=Ee(F,kt);let ir=+(kt>-1);ir&&(kt*=S/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Bt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let Tr=ey(o,b,_),[Ir,R]=$b(t.textAnchorOffsets,Tr);t.symbolInstances.emplaceBack(e.x,e.y,pt.right>=0?pt.right:-1,pt.center>=0?pt.center:-1,pt.left>=0?pt.left:-1,pt.vertical||-1,at,ot,Et,Ht,Ve,ye,Kt,Oe,kr,rr,fi,u,T,q,$,U,ir,0,p,kt,Ir,R,z)}function Ub(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Cc(this.zoom,e["text-size"]),this.iconSizeData=Cc(this.zoom,e["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap=Oc(r,"text-overlap","text-allow-overlap")!=="never"||Oc(r,"icon-overlap","icon-allow-overlap")!=="never"||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=n!=="viewport-y"&&!i.isConstant();let a=n==="viewport-y"||n==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(s=>Nd[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new al(new vr(this.layers,this.zoom,t=>t.startsWith("text"))),this.icon=new al(new vr(this.layers,this.zoom,t=>t.startsWith("icon"))),this.glyphOffsetArray=new Uf,this.lineVertexArray=new qf,this.symbolInstances=new Nf,this.textAnchorOffsets=new Gf}calculateGlyphDependencies(t,e,r,i,n){var l;let a=(i||this.allowVerticalPlacement)&&n,s=iu.fromFeature(t,r),o=s.graphemes();for(let u=0;u0)&&(a.value.kind!=="constant"||a.value.value.length>0),u=o.value.kind!=="constant"||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let c=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new st(this.zoom);for(let{feature:m,id:g,index:x,sourceLayerIndex:v}of t){let b=i._featureFilter.needGeometry,D=hi(m,b);if(!i._featureFilter.filter(d,D,r))continue;b||(D.geometry=Ar(m));let A;if(l){let z=i.getValueAndResolveTokens("text-field",D,r,f),O=ze.factory(z);this.hasRTLText||(this.hasRTLText=Gb(O)),A=gv(O,i,D)}let _;if(u){let z=i.getValueAndResolveTokens("icon-image",D,r,f);_=z instanceof _e?z:_e.fromString(z)}if(!A&&!_)continue;let S=this.sortFeaturesByKey?h.evaluate(D,{},r):void 0,k={id:g,text:A,icon:_,index:x,sourceLayerIndex:v,geometry:D.geometry,properties:m.properties,type:Dn.types[m.type],sortKey:S};if(this.features.push(k),_&&(c[_.name]=!0),A){let z=a.evaluate(D,{},r).join(","),O=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point";this.allowVerticalPlacement=(y=this.writingModes)==null?void 0:y.includes(2);let P=el(A.toString());this.calculateGlyphDependencies(A,p,z,O,P);for(let L of A.sections)L.image&&(c[L.image.name]=!0)}}n.get("symbol-placement")==="line"&&(this.features=xv(this.features)),this.sortFeaturesByKey&&this.features.sort((m,g)=>m.sortKey-g.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){Ob({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;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}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;ni[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];(r==null?void 0:r.sortKey)===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};C("SymbolBucket",iy,{omit:["layers","collisionBoxArray","features","compareText"]});function Xb(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):"")}var Yb,Wb=()=>Yb||(Yb=new Xt({"symbol-placement":new V(w.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new V(w.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new V(w.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new N(w.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new V(w.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new V(w.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new V(w.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new V(w.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new V(w.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new N(w.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new N(w.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new V(w.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new V(w.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new N(w.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new N(w.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new N(w.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new V(w.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new N(w.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new N(w.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new V(w.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new V(w.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new V(w.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new N(w.layout_symbol["text-field"],"text-field"),"text-font":new N(w.layout_symbol["text-font"],"text-font"),"text-size":new N(w.layout_symbol["text-size"],"text-size"),"text-max-width":new N(w.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new V(w.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new N(w.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new N(w.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new N(w.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new V(w.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new N(w.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new N(w.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new V(w.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new V(w.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new N(w.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new V(w.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new V(w.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new N(w.layout_symbol["text-transform"],"text-transform"),"text-offset":new N(w.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new V(w.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new V(w.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new V(w.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new V(w.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new N(w.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new V(w.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})),Zb,Hb=()=>Zb||(Zb=new Xt({"icon-opacity":new N(w.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new N(w.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new N(w.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new N(w.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new N(w.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new V(w.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new V(w.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new N(w.paint_symbol["text-opacity"],"text-opacity"),"text-color":new N(w.paint_symbol["text-color"],"text-color",{runtimeType:ce,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new N(w.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new N(w.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new N(w.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new V(w.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new V(w.paint_symbol["text-translate-anchor"],"text-translate-anchor")})),Ys={get paint(){return Hb()},get layout(){return Wb()}},ny=class{constructor(t){if(t.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:dn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e!=null&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};C("FormatSectionOverride",ny,{omit:["defaultValue"]});var Kb=class ol extends de{constructor(e,r){super(e,Ys,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new se(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!ja(s.value)&&a?Xb(r.properties,a):a}createBucket(e){return new iy(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Ys.paint.overridableProperties){if(!ol.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Il(new ny(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind==="constant"||r.value.kind==="source"?new an("source",i):new wa("composite",i,r.value.zoomStops),this.paint._values[e]=new se(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:ol.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get("text-field"),n=Ys.paint.properties[r],a=!1,s=o=>{var l;for(let u of o)if((l=n.overrides)!=null&&l.hasOverride(u)){a=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof ze)s(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let o=u=>{if(!a)if(u instanceof ri&&_t(u.value)===yn){let h=u.value;s(h.sections)}else u instanceof Ep?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function Jb(t,e,r,i=1){var a;let n=(a=t.get("icon-padding").evaluate(e,{},r))==null?void 0:a.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var Qb,tw=()=>Qb||(Qb=new Xt({"background-color":new V(w.paint_background["background-color"],"background-color"),"background-pattern":new Lf(w.paint_background["background-pattern"],"background-pattern"),"background-opacity":new V(w.paint_background["background-opacity"],"background-opacity")})),ew={get paint(){return tw()}};var rw=class extends de{constructor(t,e){super(t,ew,e)}};var iw=class extends de{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function ay(t,e){if(t.type==="custom")return new iw(t,e);switch(t.type){case"background":return new rw(t,e);case"circle":return new Bg(t,e);case"color-relief":return new Yg(t,e);case"fill":return new Ex(t,e);case"fill-extrusion":return new Hx(t,e);case"heatmap":return new Rg(t,e);case"hillshade":return new qg(t,e);case"line":return new G2(t,e);case"raster":return new Xm(t,e);case"symbol":return new Kb(t,e)}}var nw=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var t;this._triggered||(this._triggered=!0,(t=this._channel)==null||t.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},aw={once:!0},sy=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new nw(()=>this.process()),this.subscription=hh(this.target,"message",r=>this.receive(r),!1),this.globalScope=mr(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?hh(e.signal,"abort",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:"",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new dl(e.signal.reason))},aw):null;this.resolveRejects[n]={resolve:l=>{a==null||a.unsubscribe(),r(l)},reject:l=>{a==null||a.unsubscribe(),i(l)}};let s=[],o=Si(je({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:Yi(t.data,s)});this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=["file://","resource://android","null"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===""){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort();return}if(mr(self)||e.mustQueue){this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,e){return rt(this,null,function*(){if(e.type===""){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(Ki(Wi(e.error))):n.resolve(Wi(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=Wi(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=yield this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,Ki(n))}})}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?Yi(e):null,data:Yi(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function sw(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var oy=class{constructor(t,e,r){if(!sw(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=Hi(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){let i=lw(this.x,this.y,this.z),n=uw(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,i)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new B((t.x*e-this.x)*mt,(t.y*e-this.y)*mt)}toString(){return`${this.z}/${this.x}/${this.y}`}},ow=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Hi(t,e.z,e.z,e.x,e.y)}},uu=class ne{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new oy(i,+n,+a),this.key=Hi(r,e,i,n,a)}clone(){return new ne(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new ne(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ne(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?Hi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Hi(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ne(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new ne(r,this.wrap,r,i,n),new ne(r,this.wrap,r,i+1,n),new ne(r,this.wrap,r,i,n+1),new ne(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrape.wrap?!1:this.overscaledZe.overscaledZ?!1:this.canonical.xe.canonical.x?!1:this.canonical.y=0&&e=0&&r=u)return null;let c=this.canonical.x+n,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new ne(this.overscaledZ,p,l,c,h),x:s,y:o}}};function Hi(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<0;n--){let a=1<pw(n,a,r),t.layers[i])}function pw(t,e,r=""){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s>31}function yw(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(Zs(1,o));let l=i===3?s.length-1:s.length;for(let u=0;u=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can\'t be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},gw=class{constructor(t,e,r,i,n){this.type="Feature",this._vectorTileFeature=t,this._x=r,this._y=i,this._z=e;for(let a in t.properties)typeof t.properties[a]=="string"&&t.properties[a].startsWith("__$json__:")&&(t.properties[a]=JSON.parse(t.properties[a].slice(10)));this.properties=t.properties,this.id=n}projectPoint(t,e,r,i){return[(t.x+e)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+r)*2/i)*Math.PI))-90]}projectLine(t,e,r,i){return t.map(n=>this.projectPoint(n,e,r,i))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,e=t.extent*2**this._z,r=t.extent*this._x,i=t.extent*this._y,n=t.loadGeometry();switch(t.type){case 1:{let a=[];for(let o of n)a.push(o[0]);let s=this.projectLine(a,r,i,e);this._geometry=a.length===1?{type:"Point",coordinates:s[0]}:{type:"MultiPoint",coordinates:s};break}case 2:{let a=n.map(s=>this.projectLine(s,r,i,e));this._geometry=a.length===1?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a};break}case 3:{let a=dd(n),s=[];for(let o of a)s.push(o.map(l=>this.projectLine(l,r,i,e)));this._geometry=s.length===1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)e!=="_geometry"&&e!=="_vectorTileFeature"&&e!=="_x"&&e!=="_y"&&e!=="_z"&&(t[e]=this[e]);return t}},Sr=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r=="number"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){var e;return((e=this.nullabilityBuffer)==null?void 0:e.get(t))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},ts=class extends Sr{},pu=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},fu=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},uy=class extends Sr{constructor(t,e,r,i){super(t,e,i),this.delta=r}},du=class extends uy{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},yu=class extends Sr{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},xw=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var t;return(t=this._propertyVectors)!=null?t:[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r>>32-t;var ul=mu,py=65536;function gu(t,e){return t-t%e}function vw(t){return gu(t+31,32)}function bw(t){if(!Number.isFinite(t)||t<=0)return py;let e=gu(Math.floor(t),256);return e===0?256:e}function ww(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function Dw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function _w(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function Aw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function Sw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function Ew(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(h&3)<<4)&63,r[n++]=h>>>2&63,r[n++]=h>>>8&63,r[n++]=h>>>14&63,r[n++]=h>>>20&63,r[n]=h>>>26&63}function Fw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(h&1)<<6)&127,r[n++]=h>>>1&127,r[n++]=h>>>8&127,r[n++]=h>>>15&127,r[n++]=h>>>22&127,r[n++]=(h>>>29|(c&15)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n]=c>>>25&127}function kw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function Tw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(h&3)<<7)&511,r[n++]=h>>>2&511,r[n++]=h>>>11&511,r[n++]=h>>>20&511,r[n++]=(h>>>29|(c&63)<<3)&511,r[n++]=c>>>6&511,r[n++]=c>>>15&511,r[n++]=(c>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function Iw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=h>>>0&1023,r[n++]=h>>>10&1023,r[n++]=h>>>20&1023,r[n++]=(h>>>30|(c&255)<<2)&1023,r[n++]=c>>>8&1023,r[n++]=c>>>18&1023,r[n++]=(c>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function Cw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(h&31)<<6)&2047,r[n++]=h>>>5&2047,r[n++]=h>>>16&2047,r[n++]=(h>>>27|(c&63)<<5)&2047,r[n++]=c>>>6&2047,r[n++]=c>>>17&2047,r[n++]=(c>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Mw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(h&255)<<4)&4095,r[n++]=h>>>8&4095,r[n++]=h>>>20&4095,r[n++]=c>>>0&4095,r[n++]=c>>>12&4095,r[n++]=(c>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function Bw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,v=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function Pw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function zw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Lw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function Vw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=h>>>0&15,r[n++]=h>>>4&15,r[n++]=h>>>8&15,r[n++]=h>>>12&15,r[n++]=h>>>16&15,r[n++]=h>>>20&15,r[n++]=h>>>24&15,r[n++]=h>>>28&15}}function Ow(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(h&15)<<1)&31,r[n++]=h>>>4&31,r[n++]=h>>>9&31,r[n++]=h>>>14&31,r[n++]=h>>>19&31,r[n++]=h>>>24&31,r[n++]=(h>>>29|(c&3)<<3)&31,r[n++]=c>>>2&31,r[n++]=c>>>7&31,r[n++]=c>>>12&31,r[n++]=c>>>17&31,r[n++]=c>>>22&31,r[n++]=c>>>27&31}}function Rw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=h>>>0&63,r[n++]=h>>>6&63,r[n++]=h>>>12&63,r[n++]=h>>>18&63,r[n++]=h>>>24&63,r[n++]=(h>>>30|(c&15)<<2)&63,r[n++]=c>>>4&63,r[n++]=c>>>10&63,r[n++]=c>>>16&63,r[n++]=c>>>22&63,r[n++]=(c>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function $w(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(h&3)<<5)&127,r[n++]=h>>>2&127,r[n++]=h>>>9&127,r[n++]=h>>>16&127,r[n++]=h>>>23&127,r[n++]=(h>>>30|(c&31)<<2)&127,r[n++]=c>>>5&127,r[n++]=c>>>12&127,r[n++]=c>>>19&127,r[n++]=(c>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function Nw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function Uw(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function qw(t,e,r,i,n){let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+n<=32){let p=l>>>o&a;r[u+c]=p|0,o+=n,o===32&&(o=0,s++,c!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<>>0)}}var hl=bw(py),jw=3*hl/256+hl|0;function fy(){let t=new Uint8Array(jw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Gw(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:fy()}}function Xw(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function Yw(t,e,r,i){i.byteContainer.length>>2;if(n.byteOffset&3)for(let o=0;o>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u>>(u<<3)&255}return n}function Ww(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=vw(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length>>5)|0,r.exceptionSizes[a]=s}return e}function Zw(t,e,r,i,n){switch(n){case 1:Pw(t,e,r,i);break;case 2:zw(t,e,r,i);break;case 3:Lw(t,e,r,i);break;case 4:Vw(t,e,r,i);break;case 5:Ow(t,e,r,i);break;case 6:Rw(t,e,r,i);break;case 7:$w(t,e,r,i);break;case 8:Nw(t,e,r,i);break;case 16:Uw(t,e,r,i);break;default:qw(t,e,r,i,n)}return e+(n<<3)|0}function Hw(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function Kw(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function Jw(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=Kw(n,a,s,r,i,l);if(s=c,h===1){let m=1<y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m0&&(c=Jw(n,m,d,y,o,l,c,u,p))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function t3(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,h=t[u]>>>0,c=h+3>>>2,p=u+1,f=p+c;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=Yw(t,p,h,a),y=h,m=Ww(t,f,a);return a.dataPointers.fill(0),Qw(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function e3(t,e,r,i,n,a){let s=i+gu(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(hl,s-o);l=t3(t,e,l,o,u,a),o=o+u|0}return l}function r3(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,h=n,c=n+a,p=0,f=0;for(;o>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${h-u}/${a}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function i3(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r!=null?r:fy();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=e3(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return r3(t,i,o,a,n,l),a}function n3(t,e,r,i,n){switch(n){case 2:Dw(t,e,r,i);return;case 3:_w(t,e,r,i);return;case 4:Aw(t,e,r,i);return;case 5:Sw(t,e,r,i);return;case 6:Ew(t,e,r,i);return;case 7:Fw(t,e,r,i);return;case 8:kw(t,e,r,i);return;case 9:Tw(t,e,r,i);return;case 10:Iw(t,e,r,i);return;case 11:Cw(t,e,r,i);return;case 12:Mw(t,e,r,i);return;case 16:Bw(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let h=l>>>o&a;r[i+u]=h|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=t[s]>>>0;let p=ul[n-h]>>>0,f=(c|(l&p)<t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length0){let o=t.byteOffset+e;if(o&3)for(let l=0;l=64)throw Error("Varint too long")}return e.set(n),r}function o3(t,e,r){let i=new Float64Array(r);for(let n=0;n>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error("Expected varint not more than 10 bytes")}function h3(t,e,r,i){return c3(t,e,r,i,Gw(r>>>2))}function c3(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=Xw(n,s);a3(t,a,r,o);let l=i3(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function et(t){return t>>>1^-(t&1)}function Ot(t){return t>>BigInt(1)^-(t&BigInt(1))}function We(t){return t%2==1?(t+1)/-2:t/2}function p3(t){let e=new Int32Array(t.length);for(let r=0;r=4)for(;i=4)for(;i=4)for(;r=4)for(let i=t[0];r=4)for(;i=4)for(;l>>0;for(let r=1;r>>0;return e}function jc(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ot(t[0]));for(let r=1;r>>0,e[1]=et(t[1])>>>0;for(let r=2;r>>0,e[r+1]=e[r-1]+et(t[r+1])>>>0;return e}function F3(t,e,r,i){let n=yy(t,e,r,i);return new Uint32Array(n)}function k3(t){return t[1]}function T3(t){return et(t[1])}function I3(t){if(t.length===2){let e=et(t[1]);return[e,e]}return[et(t[2]),et(t[3])]}function C3(t){return t[1]}function M3(t){return Ot(t[1])}function B3(t){if(t.length===2){let e=Ot(t[1]);return[e,e]}return[Ot(t[2]),Ot(t[3])]}var St;(function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"})(St||(St={}));var jt;(function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"})(jt||(jt={}));var Me;(function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"})(Me||(Me={}));var Ct;(function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"})(Ct||(Ct={}));var P3=[St.PRESENT,St.DATA,St.OFFSET,St.LENGTH],Gc=[H.NONE,H.DELTA,H.COMPONENTWISE_DELTA,H.RLE,H.MORTON],z3=[le.NONE,le.FAST_PFOR,le.VARINT],L3=[jt.NONE,jt.SINGLE,jt.SHARED,jt.VERTEX,jt.MORTON,jt.FSST],V3=[Me.VERTEX,Me.INDEX,Me.STRING,Me.KEY],O3=[Ct.VAR_BINARY,Ct.GEOMETRIES,Ct.PARTS,Ct.RINGS,Ct.TRIANGLES,Ct.SYMBOL,Ct.DICTIONARY];function ct(t,e){let r=N3(t,e);return r.logicalLevelTechnique1===H.MORTON?R3(r,t,e):(H.RLE===r.logicalLevelTechnique1||H.RLE===r.logicalLevelTechnique2)&&le.NONE!==r.physicalLevelTechnique?$3(r,t,e):r}function R3(t,e,r){let i=$t(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function $3(t,e,r){let i=$t(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function N3(t,e){let r=t[e.get()],i=P3[r>>4],n={};switch(i){case St.DATA:n={dictionaryType:L3[r&15]};break;case St.OFFSET:n={offsetType:V3[r&15]};break;case St.LENGTH:n={lengthType:O3[r&15]}}e.increment();let a=t[e.get()],s=Gc[a>>5],o=Gc[a>>2&7],l=z3[a&3];e.increment();let u=$t(t,e,2),h=u[0],c=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var ht;(function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(ht||(ht={}));var fe=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<>r&1}size(){return this._size}getBuffer(){return this.values}};function Er(t,e,r){if(!e)return t;let i=e.size(),n=t.constructor,a=new n(i),s=0;for(let o=0;o=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],h=Math.min(a+l,e);n.fill(u,a,h),a=h}else{let l=256-o;for(let u=0;u=12?X3.decode(t.subarray(e,r)):Y3(t,e,r)}function Y3(t,e,r){let i="",n=e;for(;n239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function Ta(t,e,r,i,n){return J3(pi(t,e,r),r,i,n)}function Vt(t,e,r,i,n){return Q3(pi(t,e,r),r,i,n)}function Ze(t,e,r){return e6(pi(t,e,r),r)}function pi(t,e,r){let i=r.physicalLevelTechnique;switch(i){case le.FAST_PFOR:return h3(t,r.numValues,r.byteLength,e);case le.VARINT:return $t(t,e,r.numValues);case le.NONE:return j3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function _n(t,e,r){let i=r.physicalLevelTechnique;switch(i){case le.VARINT:return xu(t,e,r.numValues);case le.NONE:return G3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function W3(t,e,r){let i=pi(t,e,r);return i.length===1?et(i[0]):T3(i)}function wu(t,e,r){let i=pi(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?et(i[0]):i[0]:k3(i)}function vy(t,e,r){return I3(pi(t,e,r))}function by(t,e,r){return B3(xu(t,e,r.numValues))}function wy(t,e,r,i){return _y(_n(t,e,r),r,i)}function Du(t,e,r,i){return Ay(_n(t,e,r),r,i)}function Z3(t,e,r,i){let n=H3(t,e,r,!1);return i?Er(n,i,0):n}function H3(t,e,r,i){if(r.physicalLevelTechnique===le.VARINT)return t6(o3(t,e,r.numValues),r,i);let n=_n(t,e,r),a=i?_y(n,r):Ay(n,r);return Float64Array.from(a,Number)}function K3(t,e,r){let i=_n(t,e,r);return i.length===1?Ot(i[0]):M3(i)}function Dy(t,e,r){let i=_n(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?Ot(i[0]):i[0]:C3(i)}function J3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;if(!i)return A3(t,a.runs,a.numRleValues);t=cl(t,a.runs,a.numRleValues),n=Nc(t)}else n=Nc(t);break;case H.RLE:n=m3(t,e.runs,e.numRleValues);break;case H.MORTON:vu(t),n=new Int32Array(t);break;case H.COMPONENTWISE_DELTA:if(r&&!i)return yy(t,r.scale,r.min,r.max);n=b3(t);break;case H.NONE:n=p3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Er(n,i,0):n}function Q3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;n=qc(cl(t,a.runs,a.numRleValues))}else n=qc(t);break;case H.RLE:n=cl(t,e.runs,e.numRleValues);break;case H.MORTON:vu(t),n=t;break;case H.COMPONENTWISE_DELTA:n=r&&!i?F3(t,r.scale,r.min,r.max):E3(t);break;case H.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Er(n,i,0):n}function _y(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;if(!r)return S3(t,n.runs,n.numRleValues);t=pl(t,n.runs,n.numRleValues),i=Uc(t)}else i=Uc(t);break;case H.RLE:i=g3(t,e.runs,e.numRleValues);break;case H.NONE:i=f3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Er(i,r,BigInt(0)):i}function Ay(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;i=jc(pl(t,n.runs,n.numRleValues))}else i=jc(t);break;case H.RLE:i=pl(t,e.runs,e.numRleValues);break;case H.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Er(i,r,BigInt(0)):i}function t6(t,e,r){switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let i=e;t=dy(t,i.runs,i.numRleValues)}return y3(t),t;case H.RLE:return i6(t,e,r);case H.NONE:return r&&d3(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function e6(t,e){if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.NONE)return w3(t);if(e.logicalLevelTechnique1===H.RLE&&e.logicalLevelTechnique2===H.NONE){let r=e;return _3(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===H.NONE&&e.logicalLevelTechnique2===H.NONE){v3(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.RLE){let r=e,i=D3(t,r.runs,r.numRleValues);return vu(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function es(t,e,r,i,n="int32"){let a=t.logicalLevelTechnique1;if(a===H.RLE)return t.runs===1?ht.CONST:ht.FLAT;if(a!==H.DELTA||t.logicalLevelTechnique2!==H.RLE)return t.numValues===1?ht.CONST:ht.FLAT;let s=e instanceof fe?e.size():e,o=t;if(o.numRleValues!==s)return ht.FLAT;if(o.runs===1)return ht.SEQUENCE;if(o.runs!==2)return t.numValues===1?ht.CONST:ht.FLAT;let l=i.get();if(t.physicalLevelTechnique===le.VARINT)return r6(r,i,n)?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT;let u=i.get(),h=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),h[2]===2&&h[3]===2?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT}function r6(t,e,r){let i=new cy(e.get());if(r==="int64"){let a=xu(t,i,4);return a[2]===BigInt(2)&&a[3]===BigInt(2)}let n=$t(t,i,4);return n[2]===2&&n[3]===2}function i6(t,e,r){return r?x3(t,e.runs,e.numRleValues):dy(t,e.runs,e.numRleValues)}var Sy=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},Ey=class extends uy{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function _u(t,e,r){return{x:Xc(t,e)-r,y:Xc(t>>1,e)-r}}function Xc(t,e){let r=0;for(let i=0;i>i;return r}var Rt;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"})(Rt||(Rt={}));var n6;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"})(n6||(n6={}));var Fr;(function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"})(Fr||(Fr={}));function a6(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g[D]),r+=v,i+=v}break;case Rt.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=c[r]-c[r-1],r++;let b;d?(b=Or(m,s,v,!1),s+=v*2):(b=lr(t.vertexBufferType,m,f,o,v,!1,l),o+=v),e[a++]=[b],h&&n++}break;case Rt.POLYGON:{let v=c[r]-c[r-1];r++;let b=Array(v-1),D,A=p[i]-p[i-1];if(i++,d){D=Or(m,s,A,!0),s+=A*2;for(let _=0;_r?e[a++]:1);return i}function Zc(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l0;)n[a++]=t[u++]}}return n}var By=class extends Au{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s!=null?s:e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){var n,a,s;(s=this.decodedDictionary)!=null||(this.decodedDictionary=(n=this.sharedDictionaryCache)==null?void 0:n.decodedDictionary,(a=this.decodedDictionary)!=null||(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return bu(this.decodedDictionary,r,i)}decodeDictionary(){var t;return(t=this.symbolLengthBuffer)!=null||(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),v6(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=ct(t,e);m=new fe(ci(t,x.numValues,x.byteLength,e),x.numValues)}let g=Vt(t,e,ct(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${y}"`);h[p++]=new By(y,g,n,a,s,o,m,c)}else h[p++]=new Qr(y,g,n,a,m)}return h}var Kc=class extends Sr{constructor(t,e,r){super(t,new Uint8Array,r!=null?r:e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},Be;(function(t){t[t.STRING=1]="STRING",t[t.INT32=2]="INT32",t[t.UINT32=4]="UINT32",t[t.INT64=8]="INT64",t[t.UINT64=16]="UINT64",t[t.FLOAT=32]="FLOAT",t[t.DOUBLE=64]="DOUBLE",t[t.PRESENCE=128]="PRESENCE"})(Be||(Be={}));var pr;(function(t){t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t[t.START_MAP=2]="START_MAP",t[t.START_LIST=3]="START_LIST",t[t.COUNT=4]="COUNT"})(pr||(pr={}));function A6(t,e,r,i){let n=S6(r);if(i===0)return n.map(h=>new Kc(h,[]));let a=E6(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let h=0;h{var i;return t.name+((i=r.name)!=null?i:"")})}function E6(t,e,r){let i=t[e.get()];e.add(1);let n=Vt(t,e,ct(t,e)),a=r-1,s=[];i&Be.STRING&&(a-=F6(t,e,s)),a-=k6(t,e,i,s),a-=T6(t,e,i,s);let o,l=0;if(i&Be.PRESENCE){let h=I6(t,e);o=h.value,l=h.count,a--}let u=new Uint32Array;if(a>0&&(u=Vt(t,e,ct(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function F6(t,e,r){let i=t[e.get()];e.add(1);let n=Py("",t,e,i);if(n)for(let a=0;aa.length)throw Error("Merged map counts underflow while decoding child streams");let f=Array(r),d=i,y=n;for(let x=0;xs.length)throw Error("Map value stream underflow while decoding feature payload");let b=M6(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x=r)throw Error("Unexpected end of map value stream");let n=t[e];if(n===pr.FALSE)return{value:!1,nextIndex:e+1};if(n===pr.TRUE)return{value:!0,nextIndex:e+1};if(n===pr.START_MAP){let a=Jc(t,e,r);return{value:zy(t,e+2,a,i).value,nextIndex:a}}if(n===pr.START_LIST){let a=Jc(t,e,r),s=[],o=e+2;for(;o=r)throw Error("Missing length for nested map/list payload");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error("Nested payload exceeds containing payload bounds");return n}function Ly(t,e){let r=t-pr.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function Xr(t,e){for(let r of e)t.push(r)}function B6(t,e,r,i,n,a){var s;return r.type==="scalarType"?a&&!a.has(r.name)?(my(i,t,e),null):P6(i,t,e,n,r.scalarType,r):((s=r.complexType)==null?void 0:s.physicalType)===Qe.MAP?A6(t,e,r,i):i===0?null:_6(t,e,r,a)}function P6(t,e,r,i,n,a){var l;let s;if(t===0)return null;if(a.nullable){let u=ct(e,r),h=u.numValues,c=r.get(),p=ci(e,h,u.byteLength,r);r.set(c+u.byteLength),s=new fe(p,u.numValues)}let o=s!=null?s:i;switch(n.physicalType){case it.UINT_32:case it.INT_32:return R6(e,r,a,n,o);case it.STRING:{let u=a.nullable?t-1:t;return(l=Py(a.name,e,r,u,s))!=null?l:null}case it.BOOLEAN:return z6(e,r,a,i,o);case it.UINT_64:case it.INT_64:return O6(e,r,a,o,n);case it.FLOAT:return L6(e,r,a,o);case it.DOUBLE:return V6(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function z6(t,e,r,i,n){let a=ct(t,e),s=a.numValues,o=e.get(),l=An(n)?n:void 0,u=ci(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let h=new fe(u,s);return new m6(r.name,h,n)}function L6(t,e,r,i){let n=ct(t,e),a=An(i)?i:void 0,s=gy(t,e,n.numValues,a);return new g6(r.name,s,i)}function V6(t,e,r,i){let n=ct(t,e),a=An(i)?i:void 0,s=xy(t,e,n.numValues,a);return new fu(r.name,s,i)}function O6(t,e,r,i,n){let a=ct(t,e),s=es(a,i,t,e,"int64"),o=n.physicalType===it.INT_64;if(s===ht.FLAT){let u=An(i)?i:void 0,h=o?wy(t,e,a,u):Du(t,e,a,u);return new Sy(r.name,h,i)}if(s===ht.SEQUENCE){let u=by(t,e,a);return new Ey(r.name,u[0],u[1],a.numRleValues,o)}let l=o?K3(t,e,a):Dy(t,e,a);return new My(r.name,l,i,o)}function R6(t,e,r,i,n){let a=ct(t,e),s=es(a,n,t,e),o=i.physicalType===it.INT_32;if(s===ht.FLAT){let u=An(n)?n:void 0,h=o?Ta(t,e,a,void 0,u):Vt(t,e,a,void 0,u);return new pu(r.name,h,n)}if(s===ht.SEQUENCE){let u=vy(t,e,a);return new du(r.name,u[0],u[1],a.numRleValues,o)}let l=o?W3(t,e,a):wu(t,e,a);return new yu(r.name,l,n,o)}function An(t){return t instanceof fe}var It={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function Vy(t){switch(t){case It.ID:case It.ID|It.ID_NULLABLE:case It.ID|It.ID_LONG:case It.ID|It.ID_LONG|It.ID_NULLABLE:return{nullable:(t&It.ID_NULLABLE)!==0,columnScope:qi.FEATURE,type:"scalarType",scalarType:{longID:(t&It.ID_LONG)!==0,type:"logicalType",logicalType:hy.ID}};case It.GEOMETRY:return{nullable:!1,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.GEOMETRY,children:[]}};case It.STRUCT:return{nullable:!1,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.STRUCT,children:[]}};case It.MAP:return{nullable:!0,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.MAP,children:[]}};default:return j6(t)}}function $6(t){return t>=It.SCALAR_BASE}function Oy(t){return t===It.STRUCT||t===It.MAP}function N6(t){if(t.type==="scalarType"){let e=t.scalarType;if(e.type==="physicalType")switch(e.physicalType){case it.BOOLEAN:case it.INT_8:case it.UINT_8:case it.INT_32:case it.UINT_32:case it.INT_64:case it.UINT_64:case it.FLOAT:case it.DOUBLE:return!1;case it.STRING:return!0;default:return!1}if(e.type==="logicalType")return!1}else if(t.type==="complexType"){let e=t.complexType;if(e.type==="physicalType")switch(e.physicalType){case Qe.GEOMETRY:case Qe.STRUCT:case Qe.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}function U6(t){var e;return t.type==="scalarType"&&((e=t.scalarType)==null?void 0:e.type)==="logicalType"&&t.scalarType.logicalType===hy.ID}function q6(t){var e;return t.type==="complexType"&&((e=t.complexType)==null?void 0:e.type)==="physicalType"&&t.complexType.physicalType===Qe.GEOMETRY}function j6(t){let e;switch(t){case 10:case 11:e=it.BOOLEAN;break;case 12:case 13:e=it.INT_8;break;case 14:case 15:e=it.UINT_8;break;case 16:case 17:e=it.INT_32;break;case 18:case 19:e=it.UINT_32;break;case 20:case 21:e=it.INT_64;break;case 22:case 23:e=it.UINT_64;break;case 24:case 25:e=it.FLOAT;break;case 26:case 27:e=it.DOUBLE;break;case 28:case 29:e=it.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:qi.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:e}}}var G6=new TextDecoder,Qc="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function Eu(t,e){let r=$t(t,e,1)[0];if(r===0)return"";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),G6.decode(a)}function X6(t){let e=t.name,r=t.nullable;return t.type==="scalarType"?{type:"scalarField",scalarField:t.scalarType,name:e,nullable:r}:{type:"complexField",complexField:t.complexType,name:e,nullable:r}}function Ry(t,e){let r=$t(t,e,1)[0]>>>0,i=r>=It.SCALAR_BASE?Vy(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n=Si(je({},i),{name:Eu(t,e)});if(n.type==="complexType"&&Oy(r)){let a=n.complexType,s=$t(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o>>0,i=Vy(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${Qc}`);let n;if($6(r))n=Eu(t,e);else if(r>>0,o=a.complexType;o.children=Array(s);for(let l=0;l>>0,a=$t(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=$t(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=W6(t,i),h=l.featureTables[0],c=null,p=null,f=[],d=0;for(let m of h.columns){let g=m.name;if(U6(m)){let x=null;if(m.nullable){let b=ct(t,i),D=i.get(),A=ci(t,b.numValues,b.byteLength,i);i.set(D+b.byteLength),x=new fe(A,b.numValues)}let v=ct(t,i);d=x?x.size():v.decompressedCount,c=H6(t,m,i,g,v,x!=null?x:d,r)}else if(q6(m)){let x=$t(t,i,1)[0];if(d===0){let v=i.get();d=ct(t,i).decompressedCount,i.set(v)}e&&(e.scale=e.extent/u),p=f6(t,x,i,d,e)}else{let x=N6(m)?$t(t,i,1)[0]:1;if(x===0)continue;let v=B6(t,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new xw(h.name,p,c,f,u);n.push(y),i.set(s)}return n}function H6(t,e,r,i,n,a,s=!1){var h;let o=(h=e.scalarType)!=null&&h.longID?it.UINT_64:it.UINT_32,l=typeof a=="number"?void 0:a,u=es(n,a,t,r,o===it.UINT_64?"int64":"int32");if(o===it.UINT_32)switch(u){case ht.FLAT:return new pu(i,Vt(t,r,n,void 0,l),a);case ht.SEQUENCE:{let c=vy(t,r,n);return new du(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new yu(i,wu(t,r,n),a,!1)}switch(u){case ht.FLAT:return s?new fu(i,Z3(t,r,n,l),a):new Sy(i,Du(t,r,n,l),a);case ht.SEQUENCE:{let c=by(t,r,n);return new Ey(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new My(i,Dy(t,r,n),a,!1)}throw Error("Vector type not supported for id column.")}var K6=class{constructor(t,e){var r;switch(this._featureData=t,this.properties=this._featureData.properties||{},(r=this._featureData.geometry)==null?void 0:r.type){case Rt.POINT:case Rt.MULTIPOINT:this.type=1;break;case Rt.LINESTRING:case Rt.MULTILINESTRING:this.type=2;break;case Rt.POLYGON:case Rt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new B(i.x,i.y));t.push(r)}return t}},J6=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new K6(this.features[t],this.extent)}},Fu=class{constructor(t){this.layers={};let e=Z6(new Uint8Array(t));this.layers=e.reduce((r,i)=>Si(je({},r),{[i.name]:new J6(i)}),{})}},ku=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new uo(mt,16,0),this.grid3D=new uo(mt,16,0),this.featureIndexArray=new Yf,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new Fu(this.rawTileData).layers:this.vtLayers=new Xl(new au(this.rawTileData)).layers,this.sourceLayerCoder=new cu(this.vtLayers?Object.keys(this.vtLayers).sort():[ll])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=mt/t.tileSize/t.scale,s=ai(n.filter,"queryRenderedFeatures filter",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Fa.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=Fa.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(y,m,g,x)=>vg(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)h.push(y);h.sort(t5);let f={},d;for(let y of h){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,i,(x,v,b)=>(g||(g=Ar(x)),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,transform:t.transform,pixelsToTileUnits:a,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,h){let c=this.bucketLayerIDs[e];if(a&&!c.some(y=>a.has(y)))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(i);if(n.needGeometry){let y=hi(f,!0);if(!n.filter(new st(this.tileID.overscaledZ),y,this.tileID.canonical))return}else if(!n.filter(new st(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let y of c){if(a&&!a.has(y))continue;let m=o[y];if(!m)continue;let g={};d&&u&&(g=u.getState(m.sourceLayer||"_geojsonTileLayer",d));let x=Gt({},l[y]);x.paint=tp(x.paint,m.paint,f,g,s),x.layout=tp(x.layout,m.layout,f,g,s);let v=!h||h(f,m,g);if(!v)continue;let b=new gw(f,this.z,this.x,this.y,d);b.layer=x;let D=t[y];D===void 0&&(D=t[y]=[]),D.push({featureIndex:i,feature:b,intersectionZ:v})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=ai(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let h of t)this.loadMatchingFeature(l,r,i,h,u,a,s,o,e);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){var i;let r=t.id;if(this.promoteId){let n=typeof this.promoteId=="string"?this.promoteId:this.promoteId[e];r=t.properties[n],typeof r=="boolean"&&(r=Number(r)),r===void 0&&((i=t.properties)!=null&&i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};C("FeatureIndex",ku,{omit:["rawTileData","sourceLayerCoder"]});function Q6(t){return typeof t=="object"&&!!t&&"evaluate"in t}function tp(t,e,r,i,n){return Ia(t,(a,s)=>{let o=e instanceof Ya?e.get(s):null;return Q6(o)?o.evaluate(r,i,void 0,n):o})}function t5(t,e){return e-t}var $y=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}};function Tu(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n="[";for(let a of t)n+=`${Tu(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i="{";for(let n=0;nthis._layers[c.id]),s=a[0];if(s.isHidden())continue;let o=s.source||"",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]={});let u=s.sourceLayer||"_geojsonTileLayer",h=l[u];h||(h=l[u]=[]),h.push(a)}}},qy=class{constructor(t){let e={},r=[];for(let s in t){let o=t[s],l=e[s]={};for(let u in o){let h=o[u];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let c={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};r.push(c),l[u]={rect:c,metrics:h.metrics}}}let{w:i,h:n}=su(r),a=new Ja({width:i||1,height:n||1});for(let s in t){let o=t[s];for(let l in o){let u=o[l];if(!u||u.bitmap.width===0||u.bitmap.height===0)continue;let h=e[s][l].rect;Ja.copy(u.bitmap,a,{x:0,y:0},{x:h.x+1,y:h.y+1},u.bitmap)}}this.image=a,this.positions=e}};C("GlyphAtlas",qy);var jy=class{constructor(t){this.tileID=new uu(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,e,r,i,n){return rt(this,null,function*(){this.data=t,this.collisionBoxArray=new Ll;let a=new cu(Object.keys(t.layers).sort()),s=new ku(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let S in u){let k=t.layers[S];if(!k)continue;k.version===1&&Bt(`Vector tile source "${this.source}" layer "${S}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let z=a.encode(S),O=[];for(let P=0;PF.id)))}}let h=Ia(l.glyphDependencies,S=>Object.keys(S));for(let S of this.inFlightDependencies)S==null||S.abort();this.inFlightDependencies=[];let c=Promise.resolve({});if(Object.keys(h).length){let S=new AbortController;this.inFlightDependencies.push(S),c=i.sendAsync({type:"GG",data:{stacks:h,source:this.source,tileID:this.tileID,type:"glyphs"}},S)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let S=new AbortController;this.inFlightDependencies.push(S),f=i.sendAsync({type:"GI",data:{icons:p,source:this.source,tileID:this.tileID,type:"icons"}},S)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let S=new AbortController;this.inFlightDependencies.push(S),y=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},S)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let S=new AbortController;this.inFlightDependencies.push(S),g=i.sendAsync({type:"GDA",data:{dashes:m}},S)}let[x,v,b,D]=yield Promise.all([c,f,y,g]),A=new qy(x),_=new ou(v,b);for(let S in o){let k=o[S];k.hasDependencies&&(Ny(k.layers,this.zoom,r),k.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:A.positions,iconMap:v,iconPositions:_.iconPositions,patternMap:b,patternPositions:_.patternPositions,dashPositions:D,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(S=>!S.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:A.image,imageAtlas:_,dashPositions:D,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?A.positions:null}})}};function Ny(t,e,r){let i=new st(e);for(let n of t)n.recalculate(i,r)}var Gy=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e!=null&&e.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},Xy=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},n5=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new B(e.x,e.y)))}},a5=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},s5=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function o5(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l0&&l.addLayer(d)}let h={vectorTile:l,rawData:hu(l).buffer};return this.overzoomedTileResultCache.set(s,h),h}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}},u5=class{constructor(){this.loaded={}}loadTile(t){return rt(this,null,function*(){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,h=Ca(i)?new Zt({width:l,height:u},yield ap(i,-2,-2,l,u)):i,c=new jl(e,h,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=c,c})}removeTile(t){let e=this.loaded,r=t.uid;e!=null&&e[r]&&delete e[r]}},h5=class{constructor(t,e,r,i=c5){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new Gy,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new ly(n.features,{version:2,extent:mt});return{vectorTile:a,rawData:hu(a,np).buffer}}loadTile(t){return rt(this,null,function*(){let{uid:e}=t,r=new jy(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),yield this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}})}_parseWorkerTile(t,e){return rt(this,null,function*(){let r=this.tileState.getParsing(t.uid),i=yield t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=Gt({rawTileData:n.slice(0),encoding:"mvt"},i),this.tileState.removeParsing(t.uid)}return i})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}loadData(t){return rt(this,null,function*(){var r;(r=this._pendingRequest)==null||r.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let i={};return t.request&&(i.data=t.data),this._finishRequestTiming(e,t,i),i}catch(i){if(delete this._pendingRequest,!yl(i))throw i;return{abandoned:!0}}})}_startRequestTiming(t){var e;if((e=t.request)!=null&&e.collectResourceTiming)return new Xy(t.request.url)}_finishRequestTiming(t,e,r){let i=t==null?void 0:t.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return yield this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}loadAndProcessGeoJSON(t,e){return rt(this,null,function*(){var r;if(t.request&&(t.data=(yield up(t.request,e)).data),t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source),this._geoJSONIndex=this._createGeoJSONIndex(t.data,t);return}if(t.dataDiff){(r=this._geoJSONIndex)!=null||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},t)),this._geoJSONIndex.updateData(t.dataDiff,this._getFilterPredicate(t.filter,t.source));return}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,Yy(t)),this._geoJSONIndex==null)throw Error(`Input data given to \'${t.source}\' is not a valid GeoJSON object.`)})}_filterGeoJSON(t,e,r){if(t.type!=="FeatureCollection")return t;let i=this._getFilterPredicate(e,r);return i?{type:"FeatureCollection",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!="boolean"&&!(t!=null&&t.length))return;let r=er(t,`sources.${e}.filter`,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(r.result==="error")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(", "));return i=>r.value.evaluate({zoom:0},i)}removeSource(t){return rt(this,null,function*(){var e;(e=this._pendingRequest)==null||e.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getClusterChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset)}};function c5(t,e){let r=Gt(e.geojsonVtOptions||{},{updateable:!0,clusterOptions:Yy(e)});return new Td(t,r)}function Yy({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,h]=e[l],c=er(h,`sources.${r}.clusterProperties.${l}[1]`),p=er(typeof u=="string"?[u,["accumulated"],["get",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=c.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let h of o)u[h]=i[h].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let h of o)a.accumulated=l[h],l[h]=n[h].evaluate(a,s)},t.clusterOptions}function Uy(t){return rt(this,null,function*(){if(t.endsWith(".mjs")){yield import(t);return}let e=yield fetch(t,{credentials:"same-origin"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=yield e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{yield import(i)}finally{URL.revokeObjectURL(i)}return}globalThis.eval(r)})}var p5=class{constructor(t){this.self=t,this.actor=new sy(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=sp,this.self.removeProtocol=op,this.self.registerRTLTextPlugin=e=>{wr.setMethods(e)},this.self.makeRequest=Ma,this.actor.registerMessageHandler("LDT",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler("RDT",(e,r)=>rt(this,null,function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})),this.actor.registerMessageHandler("GCEZ",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})),this.actor.registerMessageHandler("GCC",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})),this.actor.registerMessageHandler("GCL",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})),this.actor.registerMessageHandler("LD",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler("LT",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler("RT",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler("AT",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler("RMT",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler("RS",(e,r)=>rt(this,null,function*(){var n,a;if(!((a=(n=this.workerSources[e])==null?void 0:n[r.type])!=null&&a[r.source]))return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)})),this.actor.registerMessageHandler("RM",e=>rt(this,null,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)})),this.actor.registerMessageHandler("SR",(e,r)=>rt(this,null,function*(){this.referrer=r})),this.actor.registerMessageHandler("SRPS",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler("IS",(e,r)=>rt(this,null,function*(){yield Uy(r)})),this.actor.registerMessageHandler("SI",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler("UL",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))})),this.actor.registerMessageHandler("UGS",(e,r)=>rt(this,null,function*(){let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]})),this.actor.registerMessageHandler("SL",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).replace(r,this._getGlobalState(e))}))}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}_setImages(t,e){return rt(this,null,function*(){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}})}_syncRTLPluginState(t,e){return rt(this,null,function*(){return yield wr.syncState(e,Uy)})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i5),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case"vector":this.workerSources[t][e][r]=new l5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new h5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new u5),this.demWorkerSources[t][e]}};mr(self)&&(self.worker=new p5(self));export{p5 as default};\n/*! Bundled license information:\n\nmaplibre-gl/dist/maplibre-gl-shared.mjs:\nmaplibre-gl/dist/maplibre-gl-worker.mjs:\n (**\n * MapLibre GL JS\n * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.9.0/LICENSE.txt\n *)\n*/\n'}}),Use=de({"src/plots/map/layers.js"(e,r){"use strict";var t=Qt(),i=Zo().sanitizeHTML,a=s9(),o=L0();function s(f,h){this.subplot=f,this.uid=f.uid+"-"+h,this.index=h,this.idSource="source-"+this.uid,this.idLayer=o.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var l=s.prototype;l.update=function(h){this.visible?this.needsNewImage(h)?this.updateImage(h):this.needsNewSource(h)?(this.removeLayer(),this.updateSource(h),this.updateLayer(h)):this.needsNewLayer(h)?this.updateLayer(h):this.updateStyle(h):(this.updateSource(h),this.updateLayer(h)),this.visible=n(h)},l.needsNewImage=function(f){var h=this.subplot.map;return h.getSource(this.idSource)&&this.sourceType==="image"&&f.sourcetype==="image"&&(this.source!==f.source||JSON.stringify(this.coordinates)!==JSON.stringify(f.coordinates))},l.needsNewSource=function(f){return this.sourceType!==f.sourcetype||JSON.stringify(this.source)!==JSON.stringify(f.source)||this.layerType!==f.type},l.needsNewLayer=function(f){return this.layerType!==f.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(f){var h=this.subplot.map;h.getSource(this.idSource).updateImage({url:f.source,coordinates:f.coordinates});var d=this.findFollowingMapLayerId(this.lookupBelow());d!==null&&this.subplot.map.moveLayer(this.idLayer,d)},l.updateSource=function(f){var h=this.subplot.map;if(h.getSource(this.idSource)&&h.removeSource(this.idSource),this.sourceType=f.sourcetype,this.source=f.source,!!n(f)){var d=c(f);h.addSource(this.idSource,d)}},l.findFollowingMapLayerId=function(f){if(f==="traces")for(var h=this.subplot.getMapLayers(),d=0;d0){for(var d=0;d0}function u(f){var h={},d={};switch(f.type){case"circle":t.extendFlat(d,{"circle-radius":f.circle.radius,"circle-color":f.color,"circle-opacity":f.opacity});break;case"line":t.extendFlat(d,{"line-width":f.line.width,"line-color":f.color,"line-opacity":f.opacity,"line-dasharray":f.line.dash});break;case"fill":t.extendFlat(d,{"fill-color":f.color,"fill-outline-color":f.fill.outlinecolor,"fill-opacity":f.opacity});break;case"symbol":var p=f.symbol,g=a(p.textposition,p.iconsize);t.extendFlat(h,{"icon-image":p.icon,"icon-size":p.iconsize/10,"text-field":p.text,"text-size":p.textfont.size,"text-anchor":g.anchor,"text-offset":g.offset,"symbol-placement":p.placement}),t.extendFlat(d,{"icon-color":f.color,"text-color":p.textfont.color,"text-opacity":f.opacity});break;case"raster":t.extendFlat(d,{"raster-fade-duration":0,"raster-opacity":f.opacity});break}return{layout:h,paint:d}}function c(f){var h=f.sourcetype,d=f.source,p={type:h},g;return h==="geojson"?g="data":h==="vector"?g=typeof d=="string"?"url":"tiles":h==="raster"?(g="tiles",p.tileSize=256):h==="image"&&(g="url",p.coordinates=f.coordinates),p[g]=d,f.sourceattribution&&(p.attribution=i(f.sourceattribution)),p}r.exports=function(h,d,p){var g=new s(h,d);return g.update(p),g}}}),qse=de({"src/plots/map/map.js"(e,r){"use strict";var t=(Nse(),ti(C5)),i=jse(),a=!1,o=()=>{a||(a=!0,t.setWorkerUrl(URL.createObjectURL(new Blob([i],{type:"text/javascript"}))))},s=Qt(),l=Pp(),n=Sa(),u=nn(),c=Uc(),f=$s(),h=Zd(),d=h.drawMode,p=h.selectMode,g=Zl().prepSelect,m=Zl().clearOutline,y=Zl().clearSelectionsCache,_=Zl().selectOnClick,v=L0(),x=Use();function S(E,T){this.id=T,this.gd=E;var F=E._fullLayout,D=E._context;this.container=F._glcontainer.node(),this.isStatic=D.staticPlot,this.uid=F._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(F),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var M=S.prototype;M.plot=function(E,T,F){var D=this,R;D.map?R=new Promise(function(P,z){D.updateMap(E,T,P,z)}):R=new Promise(function(P,z){D.createMap(E,T,P,z)}),F.push(R)},M.createMap=function(E,T,F,D){var R=this,P=T[R.id],z=R.styleObj=A(P.style),I=P.bounds,L=I?[[I.west,I.south],[I.east,I.north]]:null;let B={container:R.div,style:z.style,center:b(P.center),zoom:P.zoom,bearing:P.bearing,pitch:P.pitch,maxBounds:L,interactive:!R.isStatic,canvasContextAttributes:{preserveDrawingBuffer:R.isStatic},doubleClickZoom:!1,boxZoom:!1,attributionControl:!1},O=P._fitBounds;O&&(B.bounds=[[O.west,O.south],[O.east,O.north]],B.fitBoundsOptions={padding:v.fitBoundsPadding}),o();let G=R.map=new t.Map(B).addControl(new t.AttributionControl({compact:!0})),W={};G.setMissingStyleImageResolver(Z=>(!W[Z]&&/^[a-zA-Z0-9-]+$/.test(Z)&&(W[Z]=new Promise(J=>{let N=new Image(15,15);N.onload=()=>{G.addImage(Z,N,{sdf:!0}),J()},N.onerror=()=>J(),N.crossOrigin="Anonymous",N.src=`https://cdn.jsdelivr.net/npm/@mapbox/maki@8.2.0/icons/${Z}.svg`})),W[Z])),G.setTransformRequest(function(Z){return Z=Z.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),Z=Z.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),Z=Z.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:Z}}),G._canvas.style.left="0px",G._canvas.style.top="0px",R.rejectOnError(D),R.isStatic||R.initFx(E,T);var X=[];X.push(new Promise(function(Z){G.once("load",Z)})),X=X.concat(l.fetchTraceGeoData(E)),Promise.all(X).then(function(){O&&C(R,P),w(R,P),R.fillBelowLookup(E,T),R.updateData(E),R.updateLayout(T),R.resolveOnRender(F)}).catch(D)},M.updateMap=function(E,T,F,D){var R=this,P=R.map,z=T[this.id];R.rejectOnError(D);var I=[],L=A(z.style);JSON.stringify(R.styleObj)!==JSON.stringify(L)&&(R.styleObj=L,P.setStyle(L.style),R.traceHash={},I.push(new Promise(function(B){P.once("styledata",B)}))),I=I.concat(l.fetchTraceGeoData(E)),Promise.all(I).then(function(){R.fillBelowLookup(E,T),R.updateData(E);let B=z._fitBounds;B&&(P.fitBounds([[B.west,B.south],[B.east,B.north]],{padding:v.fitBoundsPadding,animate:!1}),C(R,z),w(R,z)),R.updateLayout(T),R.resolveOnRender(F)}).catch(D)};function C(E,T){let{center:F,zoom:D}=E.getView();T._input.center=T.center=F,T._input.zoom=T.zoom=D,T._input._fitView={center:Nt({},F),zoom:D}}function w(E,T){let F=E.getView();E.viewInitial={center:s.extendFlat({},F.center),bearing:T.bearing,pitch:T.pitch,zoom:F.zoom}}M.fillBelowLookup=function(E,T){var F=T[this.id],D=F.layers,R,P,z=this.belowLookup={},I=!1;for(R=0;R1)for(R=0;RT.project(D).x,_subplot:T},T.yaxis={_id:"y",c2p:D=>T.project(D).y,_subplot:T},T.updateFramework(E),T.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(T.mockAxis,E)},M.initFx=function(E,T){var F=this,D=F.gd,R=F.map;R.on("moveend",function(I){if(F.map){var L=D._fullLayout;if(I.originalEvent||F.wheeling){var B=L[F.id];n.call("_storeDirectGUIEdit",D.layout,L._preGUI,F.getViewEdits(B));var O=F.getView();B._input.center=B.center=O.center,B._input.zoom=B.zoom=O.zoom,B._input.bearing=B.bearing=O.bearing,B._input.pitch=B.pitch=O.pitch,D.emit("plotly_relayout",F.getViewEditsWithDerived(O))}I.originalEvent&&I.originalEvent.type==="mouseup"?F.dragging=!1:F.wheeling&&(F.wheeling=!1),L&&L._rehover&&L._rehover()}}),R.on("wheel",function(){F.wheeling=!0}),R.on("mousemove",function(I){var L=F.div.getBoundingClientRect(),B=[I.originalEvent.offsetX,I.originalEvent.offsetY];I.target.getBoundingClientRect=function(){return L},F.xaxis.p2c=function(){return R.unproject(B).lng},F.yaxis.p2c=function(){return R.unproject(B).lat},D._fullLayout._rehover=function(){D._fullLayout._hoversubplot===F.id&&D._fullLayout[F.id]&&f.hover(D,I,F.id)},f.hover(D,I,F.id),D._fullLayout._hoversubplot=F.id});function P(){f.loneUnhover(T._hoverlayer)}R.on("dragstart",function(){F.dragging=!0,P()}),R.on("zoomstart",P),R.on("mouseout",function(){D._fullLayout._hoversubplot=null});function z(){var I=F.getView();D.emit("plotly_relayouting",F.getViewEditsWithDerived(I))}R.on("drag",z),R.on("zoom",z),R.on("dblclick",function(){var I=D._fullLayout[F.id];n.call("_storeDirectGUIEdit",D.layout,D._fullLayout._preGUI,F.getViewEdits(I));var L=F.viewInitial;R.setCenter(b(L.center)),R.setZoom(L.zoom),R.setBearing(L.bearing),R.setPitch(L.pitch);var B=F.getView();I._input.center=I.center=B.center,I._input.zoom=I.zoom=B.zoom,I._input.bearing=I.bearing=B.bearing,I._input.pitch=I.pitch=B.pitch,D.emit("plotly_doubleclick",null),D.emit("plotly_relayout",F.getViewEditsWithDerived(B))}),F.clearOutline=function(){y(F.dragOptions),m(F.dragOptions.gd)},F.onClickInPanFn=function(I){return function(L){var B=D._fullLayout.clickmode;B.indexOf("select")>-1&&_(L.originalEvent,D,[F.xaxis],[F.yaxis],F.id,I),B.indexOf("event")>-1&&f.click(D,L.originalEvent)}}},M.updateFx=function(E){var T=this,F=T.map,D=T.gd;if(T.isStatic)return;function R(L){var B=T.map.unproject(L);return[B.lng,B.lat]}var P=E.dragmode,z;z=function(L,B){if(B.isRect){var O=L.range={};O[T.id]=[R([B.xmin,B.ymin]),R([B.xmax,B.ymax])]}else{var G=L.lassoPoints={};G[T.id]=B.map(R)}};var I=T.dragOptions;T.dragOptions=s.extendDeep(I||{},{dragmode:E.dragmode,element:T.div,gd:D,plotinfo:{id:T.id,domain:E[T.id].domain,xaxis:T.xaxis,yaxis:T.yaxis,fillRangeItems:z},xaxes:[T.xaxis],yaxes:[T.yaxis],subplot:T.id}),F.off("click",T.onClickInPanHandler),p(P)||d(P)?(F.dragPan.disable(),F.on("zoomstart",T.clearOutline),T.dragOptions.prepFn=function(L,B,O){g(L,B,O,T.dragOptions,P)},c.init(T.dragOptions)):(F.dragPan.enable(),F.off("zoomstart",T.clearOutline),T.div.onmousedown=null,T.div.ontouchstart=null,T.div.removeEventListener("touchstart",T.div._ontouchstart),T.onClickInPanHandler=T.onClickInPanFn(T.dragOptions),F.on("click",T.onClickInPanHandler))},M.updateFramework=function(E){var T=E[this.id].domain,F=E._size,D=this.div.style;D.width=F.w*(T.x[1]-T.x[0])+"px",D.height=F.h*(T.y[1]-T.y[0])+"px",D.left=F.l+T.x[0]*F.w+"px",D.top=F.t+(1-T.y[1])*F.h+"px",this.xaxis._offset=F.l+T.x[0]*F.w,this.xaxis._length=F.w*(T.x[1]-T.x[0]),this.yaxis._offset=F.t+(1-T.y[1])*F.h,this.yaxis._length=F.h*(T.y[1]-T.y[0])},M.updateLayers=function(E){var T=E[this.id],F=T.layers,D=this.layerList,R;if(F.length!==D.length){for(R=0;RVse});function Vse(e,r){let t=[];for(let n of e){if(n.subplot!==r||n.visible!==!0)continue;if(n.type==="choroplethmap")return null;let{lat:u,lon:c}=n;if(!c||!u)continue;let f=Math.min(c.length,u.length);for(let h=0;hA/2){var b=M.split("|").join("
");w.text(b).attr("data-unformatted",b).call(n.convertToTspans,f),k=l.bBox(w.node())}w.attr("transform",t(-3,-k.height+8)),C.insert("rect",".static-attribution").attr({x:-k.width-6,y:-k.height-3,width:k.width+6,height:k.height+3,fill:"rgba(255, 255, 255, 0.75)"});var E=1;k.width+6>A&&(E=A/(k.width+6));var T=[p.l+p.w*y.x[1],p.t+p.h*(1-y.y[0])];C.attr("transform",t(T[0],T[1])+i(E))}},e.updateFx=function(f){for(var h=f._fullLayout,d=h._subplots[c],p=0;p=0;u--)l.removeLayer(n[u][1])},s.dispose=function(){var l=this.subplot.map;this._removeLayers(),l.removeSource(this.sourceId)},r.exports=function(n,u){var c=u[0].trace,f=new o(n,c.uid),h=f.sourceId,d=t(u),p=f.below=n.belowLookup["trace-"+c.uid];return n.map.addSource(h,{type:"geojson",data:d.geojson}),f._addLayers(d,p),u[0].trace._glTrace=f,f}}}),Zse=de({"src/traces/choroplethmap/index.js"(e,r){"use strict";r.exports={attributes:z8(),supplyDefaults:Yse(),colorbar:w1(),calc:h7(),plot:Xse(),hoverPoints:d7(),eventData:p7(),selectPoints:v7(),styleOnSelect:function(t,i){if(i){var a=i[0].trace;a._glTrace.updateOnSelect(i)}},getBelow:function(t,i){for(var a=i.getMapLayers(),o=a.length-2;o>=0;o--){var s=a[o].id;if(typeof s=="string"&&s.indexOf("water")===0){for(var l=o+1;l0?+y[g]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:S},properties:M})}}var w=o.extractOpts(c),k=w.reversescale?o.flipScale(w.colorscale):w.colorscale,A=k[0][1],b=a.opacity(A)<1?A:a.addOpacity(A,0),E=["interpolate",["linear"],["heatmap-density"],0,b];for(g=1;g=0;n--)s.removeLayer(l[n][1])},o.dispose=function(){var s=this.subplot.map;this._removeLayers(),s.removeSource(this.sourceId)},r.exports=function(l,n){var u=n[0].trace,c=new a(l,u.uid),f=c.sourceId,h=t(n),d=c.below=l.belowLookup["trace-"+u.uid];return l.map.addSource(f,{type:"geojson",data:h.geojson}),c._addLayers(h,d),c}}}),rle=de({"src/traces/densitymap/hover.js"(e,r){"use strict";var t=nn(),i=z4().hoverPoints,a=z4().getExtraText;r.exports=function(s,l,n){var u=i(s,l,n);if(u){var c=u[0],f=c.cd,h=f[0].trace,d=f[c.index];if(delete c.color,"z"in d){var p=c.subplot.mockAxis;c.z=d.z,c.zLabel=t.tickText(p,p.c2l(d.z),"hover").text}return c.extraText=a(h,d,f[0].t.labels),[c]}}}}),ile=de({"src/traces/densitymap/event_data.js"(e,r){"use strict";r.exports=function(i,a){return i.lon=a.lon,i.lat=a.lat,i.z=a.z,i}}}),ale=de({"src/traces/densitymap/index.js"(e,r){"use strict";r.exports={attributes:O8(),supplyDefaults:Jse(),colorbar:w1(),formatLabels:o9(),calc:Qse(),plot:tle(),hoverPoints:rle(),eventData:ile(),getBelow:function(t,i){for(var a=i.getMapLayers(),o=0;ox[F%x.length];v("color",_.label.map((F,D)=>a.addOpacity(S(D),.8))),v("customdata");var M=f.link||{},C=l.newContainer(h,"link");function w(F,D){return t.coerce(M,C,i.link,F,D)}w("label"),w("arrowlen"),w("source"),w("target"),w("value"),w("line.color"),w("line.width"),w("hoverinfo",f.hoverinfo),s(M,C,w,m),w("hovertemplate"),w("sort");var k=a.luminosity(p.paper_bgcolor)<.333,A=k?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",b=w("color",A);function E(F){if(!a.isValid(F))return F;let D=a.opacity(F);return D<=.8?a.addOpacity(F,D+.2):k?a.brighten(F,10):a.adjustLightness(F,-10)}w("hovercolor",Array.isArray(b)?b.map(E):E(b)),w("customdata"),n(M,C,{name:"colorscales",handleItemDefaults:u}),o(h,p,g),g("orientation"),g("direction"),g("valueformat"),g("valuesuffix");let T=_.x.length&&_.y.length?"freeform":void 0;g("arrangement",T),t.coerceFont(g,"textfont",p.font,{autoShadowDflt:!0}),h._length=null};function u(c,f){function h(d,p){return t.coerce(c,f,i.link.colorscales,d,p)}h("label"),h("cmin"),h("cmax"),h("colorscale")}}}),j8=de({"node_modules/strongly-connected-components/scc.js"(e,r){"use strict";r.exports=t;function t(i){for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),n=new Array(a),u=new Array(a),c=new Array(a),f=0;f0;){v=S[S.length-1];var M=i[v];if(n[v]=0&&c[v].push(u[w])}n[v]=C}else{if(s[v]===o[v]){for(var k=[],A=[],b=0,C=x.length-1;C>=0;--C){var E=x[C];if(l[E]=!1,k.push(E),A.push(c[E]),b+=c[E].length,u[E]=d.length,E===v){x.length=C;break}}d.push(k);for(var T=new Array(b),C=0;Cw&&(w=h.source[x]),h.target[x]>w&&(w=h.target[x]);var k=w+1;c.node._count=k;var A,b=c.node.groups,E={};for(x=0;x0&&s(z,k)&&s(I,k)&&!(E.hasOwnProperty(z)&&E.hasOwnProperty(I)&&E[z]===E[I])){E.hasOwnProperty(I)&&(I=E[I]),E.hasOwnProperty(z)&&(z=E[z]),z=+z,I=+I,y[z]=y[I]=!0;var L="";h.label&&h.label[x]&&(L=h.label[x]);var B=null;L&&_.hasOwnProperty(L)&&(B=_[L]),d.push({pointNumber:x,label:L,color:p?h.color[x]:h.color,hovercolor:g?h.hovercolor[x]:h.hovercolor,customdata:m?h.customdata[x]:h.customdata,concentrationscale:B,source:z,target:I,value:+P}),R.source.push(z),R.target.push(I)}}var O=k+b.length,G=o(f.color),W=o(f.customdata),X=[];for(x=0;xk-1,childrenNodes:[],pointNumber:x,label:Z,color:G?f.color[x]:f.color,customdata:W?f.customdata[x]:f.customdata})}var J=!1;return u(O,R.source,R.target)&&(J=!0),{circular:J,links:d,nodes:X,groups:b,groupLookup:E}}function u(c,f,h){for(var d=i.init2dArray(c,0),p=0;p1})}r.exports=function(f,h){var d=n(h);return a({circular:d.circular,_nodes:d.nodes,_links:d.links,_groups:d.groups,_groupLookup:d.groupLookup})}}}),lle=de({"node_modules/d3-quadtree/dist/d3-quadtree.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=t||self,i(t.d3=t.d3||{}))})(e,function(t){"use strict";function i(k){var A=+this._x.call(null,k),b=+this._y.call(null,k);return a(this.cover(A,b),A,b,k)}function a(k,A,b,E){if(isNaN(A)||isNaN(b))return k;var T,F=k._root,D={data:E},R=k._x0,P=k._y0,z=k._x1,I=k._y1,L,B,O,G,W,X,Z,J;if(!F)return k._root=D,k;for(;F.length;)if((W=A>=(L=(R+z)/2))?R=L:z=L,(X=b>=(B=(P+I)/2))?P=B:I=B,T=F,!(F=F[Z=X<<1|W]))return T[Z]=D,k;if(O=+k._x.call(null,F.data),G=+k._y.call(null,F.data),A===O&&b===G)return D.next=F,T?T[Z]=D:k._root=D,k;do T=T?T[Z]=new Array(4):k._root=new Array(4),(W=A>=(L=(R+z)/2))?R=L:z=L,(X=b>=(B=(P+I)/2))?P=B:I=B;while((Z=X<<1|W)===(J=(G>=B)<<1|O>=L));return T[J]=F,T[Z]=D,k}function o(k){var A,b,E=k.length,T,F,D=new Array(E),R=new Array(E),P=1/0,z=1/0,I=-1/0,L=-1/0;for(b=0;bI&&(I=T),FL&&(L=F));if(P>I||z>L)return this;for(this.cover(P,z).cover(I,L),b=0;bk||k>=T||E>A||A>=F;)switch(z=(AI||(R=G.y0)>L||(P=G.x1)=Z)<<1|k>=X)&&(G=B[B.length-1],B[B.length-1]=B[B.length-1-W],B[B.length-1-W]=G)}else{var J=k-+this._x.call(null,O.data),N=A-+this._y.call(null,O.data),H=J*J+N*N;if(H=(B=(D+P)/2))?D=B:P=B,(W=L>=(O=(R+z)/2))?R=O:z=O,A=b,!(b=b[X=W<<1|G]))return this;if(!b.length)break;(A[X+1&3]||A[X+2&3]||A[X+3&3])&&(E=A,Z=X)}for(;b.data!==k;)if(T=b,!(b=b.next))return this;return(F=b.next)&&delete b.next,T?(F?T.next=F:delete T.next,this):A?(F?A[X]=F:delete A[X],(b=A[0]||A[1]||A[2]||A[3])&&b===(A[3]||A[2]||A[1]||A[0])&&!b.length&&(E?E[Z]=b:this._root=b),this):(this._root=F,this)}function h(k){for(var A=0,b=k.length;A=y.length)return v!=null&&w.sort(v),x!=null?x(w):w;for(var E=-1,T=w.length,F=y[k++],D,R,P=o(),z,I=A();++Ey.length)return w;var A,b=_[k-1];return x!=null&&k>=y.length?A=w.entries():(A=[],w.each(function(E,T){A.push({key:T,values:C(E,k)})})),b!=null?A.sort(function(E,T){return b(E.key,T.key)}):A}return S={object:function(w){return M(w,0,l,n)},map:function(w){return M(w,0,u,c)},entries:function(w){return C(M(w,0,u,c),0)},key:function(w){return y.push(w),S},sortKeys:function(w){return _[y.length-1]=w,S},sortValues:function(w){return v=w,S},rollup:function(w){return x=w,S}}}function l(){return{}}function n(y,_,v){y[_]=v}function u(){return o()}function c(y,_,v){y.set(_,v)}function f(){}var h=o.prototype;f.prototype=d.prototype={constructor:f,has:h.has,add:function(y){return y+="",this[i+y]=y,this},remove:h.remove,clear:h.clear,values:h.keys,size:h.size,empty:h.empty,each:h.each};function d(y,_){var v=new f;if(y instanceof f)y.each(function(M){v.add(M)});else if(y){var x=-1,S=y.length;if(_==null)for(;++x=0&&(h=f.slice(d+1),f=f.slice(0,d)),f&&!c.hasOwnProperty(f))throw new Error("unknown type: "+f);return{type:f,name:h}})}o.prototype=a.prototype={constructor:o,on:function(u,c){var f=this._,h=s(u+"",f),d,p=-1,g=h.length;if(arguments.length<2){for(;++p0)for(var f=new Array(d),h=0,d,p;h=0&&k._call.call(null,A),k=k._next;--i}function v(){c=(u=h.now())+f,i=a=0;try{_()}finally{i=0,S(),c=0}}function x(){var k=h.now(),A=k-u;A>s&&(f-=A,u=k)}function S(){for(var k,A=l,b,E=1/0;A;)A._call?(E>A._time&&(E=A._time),k=A,A=A._next):(b=A._next,A._next=null,A=k?k._next=b:l=b);n=k,M(E)}function M(k){if(!i){a&&(a=clearTimeout(a));var A=k-c;A>24?(k<1/0&&(a=setTimeout(v,k-h.now()-f)),o&&(o=clearInterval(o))):(o||(u=h.now(),o=setInterval(x,s)),i=1,d(v))}}function C(k,A,b){var E=new m;return A=A==null?0:+A,E.restart(function(T){E.stop(),k(T+A)},A,b),E}function w(k,A,b){var E=new m,T=A;return A==null?(E.restart(k,A,b),E):(A=+A,b=b==null?p():+b,E.restart(function F(D){D+=T,E.restart(F,T+=A,b),k(D)},A,b),E)}t.interval=w,t.now=p,t.timeout=C,t.timer=y,t.timerFlush=_,Object.defineProperty(t,"__esModule",{value:!0})})}}),fle=de({"node_modules/d3-force/dist/d3-force.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e,lle(),U8(),ule(),cle()):i(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3)})(e,(function(t,i,a,o,s){"use strict";function l(k,A){var b;k==null&&(k=0),A==null&&(A=0);function E(){var T,F=b.length,D,R=0,P=0;for(T=0;TL.index){var Y=B-V.x-V.vx,K=O-V.y-V.vy,te=Y*Y+K*K;teB+q||$O+q||UP.r&&(P.r=P[z].r)}function R(){if(A){var P,z=A.length,I;for(b=new Array(z),P=0;P1?(W==null?R.remove(G):R.set(G,O(W)),A):R.get(G)},find:function(G,W,X){var Z=0,J=k.length,N,H,$,U,V;for(X==null?X=1/0:X*=X,Z=0;Z1?(z.on(G,W),A):z.on(G)}}}function S(){var k,A,b,E=n(-30),T,F=1,D=1/0,R=.81;function P(B){var O,G=k.length,W=i.quadtree(k,m,y).visitAfter(I);for(b=B,O=0;O=D)return;(B.data!==A||B.next)&&(X===0&&(X=u(),N+=X*X),Z===0&&(Z=u(),N+=Z*Z),Nyt?1:gt>=yt?0:NaN}function a(gt){let yt=gt,kt=gt;gt.length===1&&(yt=(mr,br)=>gt(mr)-br,kt=o(gt));function Lt(mr,br,Er,Tr){for(Er==null&&(Er=0),Tr==null&&(Tr=mr.length);Er>>1;kt(mr[Ur],br)<0?Er=Ur+1:Tr=Ur}return Er}function Ct(mr,br,Er,Tr){for(Er==null&&(Er=0),Tr==null&&(Tr=mr.length);Er>>1;kt(mr[Ur],br)>0?Tr=Ur:Er=Ur+1}return Er}function $t(mr,br,Er,Tr){Er==null&&(Er=0),Tr==null&&(Tr=mr.length);let Ur=Lt(mr,br,Er,Tr-1);return Ur>Er&&yt(mr[Ur-1],br)>-yt(mr[Ur],br)?Ur-1:Ur}return{left:Lt,center:$t,right:Ct}}function o(gt){return(yt,kt)=>i(gt(yt),kt)}function s(gt){return gt===null?NaN:+gt}function*l(gt,yt){if(yt===void 0)for(let kt of gt)kt!=null&&(kt=+kt)>=kt&&(yield kt);else{let kt=-1;for(let Lt of gt)(Lt=yt(Lt,++kt,gt))!=null&&(Lt=+Lt)>=Lt&&(yield Lt)}}let n=a(i),u=n.right,c=n.left,f=a(s).center;function h(gt,yt){let kt=0;if(yt===void 0)for(let Lt of gt)Lt!=null&&(Lt=+Lt)>=Lt&&++kt;else{let Lt=-1;for(let Ct of gt)(Ct=yt(Ct,++Lt,gt))!=null&&(Ct=+Ct)>=Ct&&++kt}return kt}function d(gt){return gt.length|0}function p(gt){return!(gt>0)}function g(gt){return typeof gt!="object"||"length"in gt?gt:Array.from(gt)}function m(gt){return yt=>gt(...yt)}function y(...gt){let yt=typeof gt[gt.length-1]=="function"&&m(gt.pop());gt=gt.map(g);let kt=gt.map(d),Lt=gt.length-1,Ct=new Array(Lt+1).fill(0),$t=[];if(Lt<0||kt.some(p))return $t;for(;;){$t.push(Ct.map((br,Er)=>gt[Er][br]));let mr=Lt;for(;++Ct[mr]===kt[mr];){if(mr===0)return yt?$t.map(yt):$t;Ct[mr--]=0}}}function _(gt,yt){var kt=0,Lt=0;return Float64Array.from(gt,yt===void 0?Ct=>kt+=+Ct||0:Ct=>kt+=+yt(Ct,Lt++,gt)||0)}function v(gt,yt){return ytgt?1:yt>=gt?0:NaN}function x(gt,yt){let kt=0,Lt,Ct=0,$t=0;if(yt===void 0)for(let mr of gt)mr!=null&&(mr=+mr)>=mr&&(Lt=mr-Ct,Ct+=Lt/++kt,$t+=Lt*(mr-Ct));else{let mr=-1;for(let br of gt)(br=yt(br,++mr,gt))!=null&&(br=+br)>=br&&(Lt=br-Ct,Ct+=Lt/++kt,$t+=Lt*(br-Ct))}if(kt>1)return $t/(kt-1)}function S(gt,yt){let kt=x(gt,yt);return kt&&Math.sqrt(kt)}function M(gt,yt){let kt,Lt;if(yt===void 0)for(let Ct of gt)Ct!=null&&(kt===void 0?Ct>=Ct&&(kt=Lt=Ct):(kt>Ct&&(kt=Ct),Lt=$t&&(kt=Lt=$t):(kt>$t&&(kt=$t),Lt<$t&&(Lt=$t)))}return[kt,Lt]}class C{constructor(){this._partials=new Float64Array(32),this._n=0}add(yt){let kt=this._partials,Lt=0;for(let Ct=0;Ct0){for(mr=yt[--kt];kt>0&&(Lt=mr,Ct=yt[--kt],mr=Lt+Ct,$t=Ct-(mr-Lt),!$t););kt>0&&($t<0&&yt[kt-1]<0||$t>0&&yt[kt-1]>0)&&(Ct=$t*2,Lt=mr+Ct,Ct==Lt-mr&&(mr=Lt))}return mr}}function w(gt,yt){let kt=new C;if(yt===void 0)for(let Lt of gt)(Lt=+Lt)&&kt.add(Lt);else{let Lt=-1;for(let Ct of gt)(Ct=+yt(Ct,++Lt,gt))&&kt.add(Ct)}return+kt}function k(gt,yt){let kt=new C,Lt=-1;return Float64Array.from(gt,yt===void 0?Ct=>kt.add(+Ct||0):Ct=>kt.add(+yt(Ct,++Lt,gt)||0))}class A extends Map{constructor(yt,kt=D){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:kt}}),yt!=null)for(let[Lt,Ct]of yt)this.set(Lt,Ct)}get(yt){return super.get(E(this,yt))}has(yt){return super.has(E(this,yt))}set(yt,kt){return super.set(T(this,yt),kt)}delete(yt){return super.delete(F(this,yt))}}class b extends Set{constructor(yt,kt=D){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:kt}}),yt!=null)for(let Lt of yt)this.add(Lt)}has(yt){return super.has(E(this,yt))}add(yt){return super.add(T(this,yt))}delete(yt){return super.delete(F(this,yt))}}function E({_intern:gt,_key:yt},kt){let Lt=yt(kt);return gt.has(Lt)?gt.get(Lt):kt}function T({_intern:gt,_key:yt},kt){let Lt=yt(kt);return gt.has(Lt)?gt.get(Lt):(gt.set(Lt,kt),kt)}function F({_intern:gt,_key:yt},kt){let Lt=yt(kt);return gt.has(Lt)&&(kt=gt.get(kt),gt.delete(Lt)),kt}function D(gt){return gt!==null&&typeof gt=="object"?gt.valueOf():gt}function R(gt){return gt}function P(gt,...yt){return W(gt,R,R,yt)}function z(gt,...yt){return W(gt,Array.from,R,yt)}function I(gt,yt,...kt){return W(gt,R,yt,kt)}function L(gt,yt,...kt){return W(gt,Array.from,yt,kt)}function B(gt,...yt){return W(gt,R,G,yt)}function O(gt,...yt){return W(gt,Array.from,G,yt)}function G(gt){if(gt.length!==1)throw new Error("duplicate key");return gt[0]}function W(gt,yt,kt,Lt){return(function Ct($t,mr){if(mr>=Lt.length)return kt($t);let br=new A,Er=Lt[mr++],Tr=-1;for(let Ur of $t){let Ai=Er(Ur,++Tr,$t),oi=br.get(Ai);oi?oi.push(Ur):br.set(Ai,[Ur])}for(let[Ur,Ai]of br)br.set(Ur,Ct(Ai,mr));return yt(br)})(gt,0)}function X(gt,yt){return Array.from(yt,kt=>gt[kt])}function Z(gt,...yt){if(typeof gt[Symbol.iterator]!="function")throw new TypeError("values is not iterable");gt=Array.from(gt);let[kt=i]=yt;if(kt.length===1||yt.length>1){let Lt=Uint32Array.from(gt,(Ct,$t)=>$t);return yt.length>1?(yt=yt.map(Ct=>gt.map(Ct)),Lt.sort((Ct,$t)=>{for(let mr of yt){let br=i(mr[Ct],mr[$t]);if(br)return br}})):(kt=gt.map(kt),Lt.sort((Ct,$t)=>i(kt[Ct],kt[$t]))),X(gt,Lt)}return gt.sort(kt)}function J(gt,yt,kt){return(yt.length===1?Z(I(gt,yt,kt),(([Lt,Ct],[$t,mr])=>i(Ct,mr)||i(Lt,$t))):Z(P(gt,kt),(([Lt,Ct],[$t,mr])=>yt(Ct,mr)||i(Lt,$t)))).map(([Lt])=>Lt)}var N=Array.prototype,H=N.slice;function $(gt){return function(){return gt}}var U=Math.sqrt(50),V=Math.sqrt(10),j=Math.sqrt(2);function q(gt,yt,kt){var Lt,Ct=-1,$t,mr,br;if(yt=+yt,gt=+gt,kt=+kt,gt===yt&&kt>0)return[gt];if((Lt=yt0){let Er=Math.round(gt/br),Tr=Math.round(yt/br);for(Er*bryt&&--Tr,mr=new Array($t=Tr-Er+1);++Ct<$t;)mr[Ct]=(Er+Ct)*br}else{br=-br;let Er=Math.round(gt*br),Tr=Math.round(yt*br);for(Er/bryt&&--Tr,mr=new Array($t=Tr-Er+1);++Ct<$t;)mr[Ct]=(Er+Ct)/br}return Lt&&mr.reverse(),mr}function Y(gt,yt,kt){var Lt=(yt-gt)/Math.max(0,kt),Ct=Math.floor(Math.log(Lt)/Math.LN10),$t=Lt/Math.pow(10,Ct);return Ct>=0?($t>=U?10:$t>=V?5:$t>=j?2:1)*Math.pow(10,Ct):-Math.pow(10,-Ct)/($t>=U?10:$t>=V?5:$t>=j?2:1)}function K(gt,yt,kt){var Lt=Math.abs(yt-gt)/Math.max(0,kt),Ct=Math.pow(10,Math.floor(Math.log(Lt)/Math.LN10)),$t=Lt/Ct;return $t>=U?Ct*=10:$t>=V?Ct*=5:$t>=j&&(Ct*=2),yt0?(gt=Math.floor(gt/Ct)*Ct,yt=Math.ceil(yt/Ct)*Ct):Ct<0&&(gt=Math.ceil(gt*Ct)/Ct,yt=Math.floor(yt*Ct)/Ct),Lt=Ct}}function ne(gt){return Math.ceil(Math.log(h(gt))/Math.LN2)+1}function se(){var gt=R,yt=M,kt=ne;function Lt(Ct){Array.isArray(Ct)||(Ct=Array.from(Ct));var $t,mr=Ct.length,br,Er=new Array(mr);for($t=0;$t=Ai)if(ja>=Ai&&yt===M){let pa=Y(Ur,Ai,ya);isFinite(pa)&&(pa>0?Ai=(Math.floor(Ai/pa)+1)*pa:pa<0&&(Ai=(Math.ceil(Ai*-pa)+1)/-pa))}else oi.pop()}for(var Qr=oi.length;oi[0]<=Ur;)oi.shift(),--Qr;for(;oi[Qr-1]>Ai;)oi.pop(),--Qr;var ea=new Array(Qr+1),$i;for($t=0;$t<=Qr;++$t)$i=ea[$t]=[],$i.x0=$t>0?oi[$t-1]:Ur,$i.x1=$t=Lt)&&(kt=Lt);else{let Lt=-1;for(let Ct of gt)(Ct=yt(Ct,++Lt,gt))!=null&&(kt=Ct)&&(kt=Ct)}return kt}function ce(gt,yt){let kt;if(yt===void 0)for(let Lt of gt)Lt!=null&&(kt>Lt||kt===void 0&&Lt>=Lt)&&(kt=Lt);else{let Lt=-1;for(let Ct of gt)(Ct=yt(Ct,++Lt,gt))!=null&&(kt>Ct||kt===void 0&&Ct>=Ct)&&(kt=Ct)}return kt}function pe(gt,yt,kt=0,Lt=gt.length-1,Ct=i){for(;Lt>kt;){if(Lt-kt>600){let Er=Lt-kt+1,Tr=yt-kt+1,Ur=Math.log(Er),Ai=.5*Math.exp(2*Ur/3),oi=.5*Math.sqrt(Ur*Ai*(Er-Ai)/Er)*(Tr-Er/2<0?-1:1),Qr=Math.max(kt,Math.floor(yt-Tr*Ai/Er+oi)),ea=Math.min(Lt,Math.floor(yt+(Er-Tr)*Ai/Er+oi));pe(gt,yt,Qr,ea,Ct)}let $t=gt[yt],mr=kt,br=Lt;for(xe(gt,kt,yt),Ct(gt[Lt],$t)>0&&xe(gt,kt,Lt);mr0;)--br}Ct(gt[kt],$t)===0?xe(gt,kt,br):(++br,xe(gt,br,Lt)),br<=yt&&(kt=br+1),yt<=br&&(Lt=br-1)}return gt}function xe(gt,yt,kt){let Lt=gt[yt];gt[yt]=gt[kt],gt[kt]=Lt}function ye(gt,yt,kt){if(gt=Float64Array.from(l(gt,kt)),!!(Lt=gt.length)){if((yt=+yt)<=0||Lt<2)return ce(gt);if(yt>=1)return le(gt);var Lt,Ct=(Lt-1)*yt,$t=Math.floor(Ct),mr=le(pe(gt,$t).subarray(0,$t+1)),br=ce(gt.subarray($t+1));return mr+(br-mr)*(Ct-$t)}}function fe(gt,yt,kt=s){if(Lt=gt.length){if((yt=+yt)<=0||Lt<2)return+kt(gt[0],0,gt);if(yt>=1)return+kt(gt[Lt-1],Lt-1,gt);var Lt,Ct=(Lt-1)*yt,$t=Math.floor(Ct),mr=+kt(gt[$t],$t,gt),br=+kt(gt[$t+1],$t+1,gt);return mr+(br-mr)*(Ct-$t)}}function ae(gt,yt,kt){return Math.ceil((kt-yt)/(2*(ye(gt,.75)-ye(gt,.25))*Math.pow(h(gt),-1/3)))}function ee(gt,yt,kt){return Math.ceil((kt-yt)/(3.5*S(gt)*Math.pow(h(gt),-1/3)))}function ie(gt,yt){let kt,Lt=-1,Ct=-1;if(yt===void 0)for(let $t of gt)++Ct,$t!=null&&(kt<$t||kt===void 0&&$t>=$t)&&(kt=$t,Lt=Ct);else for(let $t of gt)($t=yt($t,++Ct,gt))!=null&&(kt<$t||kt===void 0&&$t>=$t)&&(kt=$t,Lt=Ct);return Lt}function Q(gt,yt){let kt=0,Lt=0;if(yt===void 0)for(let Ct of gt)Ct!=null&&(Ct=+Ct)>=Ct&&(++kt,Lt+=Ct);else{let Ct=-1;for(let $t of gt)($t=yt($t,++Ct,gt))!=null&&($t=+$t)>=$t&&(++kt,Lt+=$t)}if(kt)return Lt/kt}function ue(gt,yt){return ye(gt,.5,yt)}function*ge(gt){for(let yt of gt)yield*Ia(yt)}function Me(gt){return Array.from(ge(gt))}function Te(gt,yt){let kt,Lt=-1,Ct=-1;if(yt===void 0)for(let $t of gt)++Ct,$t!=null&&(kt>$t||kt===void 0&&$t>=$t)&&(kt=$t,Lt=Ct);else for(let $t of gt)($t=yt($t,++Ct,gt))!=null&&(kt>$t||kt===void 0&&$t>=$t)&&(kt=$t,Lt=Ct);return Lt}function je(gt,yt=Ve){let kt=[],Lt,Ct=!1;for(let $t of gt)Ct&&kt.push(yt(Lt,$t)),Lt=$t,Ct=!0;return kt}function Ve(gt,yt){return[gt,yt]}function Ke(gt,yt,kt){gt=+gt,yt=+yt,kt=(Ct=arguments.length)<2?(yt=gt,gt=0,1):Ct<3?1:+kt;for(var Lt=-1,Ct=Math.max(0,Math.ceil((yt-gt)/kt))|0,$t=new Array(Ct);++Lt0:i(mr,mr)===0)&&(kt=$t,Ct=mr,Lt=!0)}}else for(let Ct of gt)(Lt?yt(Ct,kt)>0:yt(Ct,Ct)===0)&&(kt=Ct,Lt=!0);return kt}function Pt(gt,yt=i){if(yt.length===1)return ie(gt,yt);let kt,Lt=-1,Ct=-1;for(let $t of gt)++Ct,(Lt<0?yt($t,$t)===0:yt($t,kt)>0)&&(kt=$t,Lt=Ct);return Lt}function mt(gt,yt){let kt=vt(gt,yt);return kt<0?void 0:kt}var Mt=lt(Math.random);function lt(gt){return function(kt,Lt=0,Ct=kt.length){let $t=Ct-(Lt=+Lt);for(;$t;){let mr=gt()*$t--|0,br=kt[$t+Lt];kt[$t+Lt]=kt[mr+Lt],kt[mr+Lt]=br}return kt}}function qe(gt,yt){let kt=0;if(yt===void 0)for(let Lt of gt)(Lt=+Lt)&&(kt+=Lt);else{let Lt=-1;for(let Ct of gt)(Ct=+yt(Ct,++Lt,gt))&&(kt+=Ct)}return kt}function Ye(gt){if(!($t=gt.length))return[];for(var yt=-1,kt=ce(gt,me),Lt=new Array(kt);++ytyt(kt,Lt,gt))}function Qe(gt,yt,kt){if(typeof yt!="function")throw new TypeError("reducer is not a function");let Lt=gt[Symbol.iterator](),Ct,$t,mr=-1;if(arguments.length<3){if({done:Ct,value:kt}=Lt.next(),Ct)return;++mr}for(;{done:Ct,value:$t}=Lt.next(),!Ct;)kt=yt(kt,$t,++mr,gt);return kt}function Ue(gt){if(typeof gt[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(gt).reverse()}function at(gt,...yt){gt=new Set(gt);for(let kt of yt)for(let Lt of kt)gt.delete(Lt);return gt}function rt(gt,yt){let kt=yt[Symbol.iterator](),Lt=new Set;for(let Ct of gt){if(Lt.has(Ct))return!1;let $t,mr;for(;({value:$t,done:mr}=kt.next())&&!mr;){if(Object.is(Ct,$t))return!1;Lt.add($t)}}return!0}function ht(gt){return gt instanceof Set?gt:new Set(gt)}function At(gt,...yt){gt=new Set(gt),yt=yt.map(ht);e:for(let kt of gt)for(let Lt of yt)if(!Lt.has(kt)){gt.delete(kt);continue e}return gt}function dt(gt,yt){let kt=gt[Symbol.iterator](),Lt=new Set;for(let Ct of yt){if(Lt.has(Ct))continue;let $t,mr;for(;{value:$t,done:mr}=kt.next();){if(mr)return!1;if(Lt.add($t),Object.is(Ct,$t))break}}return!0}function Ht(gt,yt){return dt(yt,gt)}function fr(...gt){let yt=new Set;for(let kt of gt)for(let Lt of kt)yt.add(Lt);return yt}t.Adder=C,t.InternMap=A,t.InternSet=b,t.ascending=i,t.bin=se,t.bisect=u,t.bisectCenter=f,t.bisectLeft=c,t.bisectRight=u,t.bisector=a,t.count=h,t.cross=y,t.cumsum=_,t.descending=v,t.deviation=S,t.difference=at,t.disjoint=rt,t.every=Ae,t.extent=M,t.fcumsum=k,t.filter=Ee,t.fsum=w,t.greatest=xt,t.greatestIndex=Pt,t.group=P,t.groupSort=J,t.groups=z,t.histogram=se,t.index=B,t.indexes=O,t.intersection=At,t.least=Je,t.leastIndex=vt,t.map=De,t.max=le,t.maxIndex=ie,t.mean=Q,t.median=ue,t.merge=Me,t.min=ce,t.minIndex=Te,t.nice=te,t.pairs=je,t.permute=X,t.quantile=ye,t.quantileSorted=fe,t.quickselect=pe,t.range=Ke,t.reduce=Qe,t.reverse=Ue,t.rollup=I,t.rollups=L,t.scan=mt,t.shuffle=Mt,t.shuffler=lt,t.some=ke,t.sort=Z,t.subset=Ht,t.sum=qe,t.superset=dt,t.thresholdFreedmanDiaconis=ae,t.thresholdScott=ee,t.thresholdSturges=ne,t.tickIncrement=Y,t.tickStep=K,t.ticks=q,t.transpose=Ye,t.union=fr,t.variance=x,t.zip=_e,Object.defineProperty(t,"__esModule",{value:!0})}))}}),dle=de({"node_modules/d3-path/dist/d3-path.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e):(t=t||self,i(t.d3=t.d3||{}))})(e,function(t){"use strict";var i=Math.PI,a=2*i,o=1e-6,s=a-o;function l(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function n(){return new l}l.prototype=n.prototype={constructor:l,moveTo:function(u,c){this._+="M"+(this._x0=this._x1=+u)+","+(this._y0=this._y1=+c)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(u,c){this._+="L"+(this._x1=+u)+","+(this._y1=+c)},quadraticCurveTo:function(u,c,f,h){this._+="Q"+ +u+","+ +c+","+(this._x1=+f)+","+(this._y1=+h)},bezierCurveTo:function(u,c,f,h,d,p){this._+="C"+ +u+","+ +c+","+ +f+","+ +h+","+(this._x1=+d)+","+(this._y1=+p)},arcTo:function(u,c,f,h,d){u=+u,c=+c,f=+f,h=+h,d=+d;var p=this._x1,g=this._y1,m=f-u,y=h-c,_=p-u,v=g-c,x=_*_+v*v;if(d<0)throw new Error("negative radius: "+d);if(this._x1===null)this._+="M"+(this._x1=u)+","+(this._y1=c);else if(x>o)if(!(Math.abs(v*m-y*_)>o)||!d)this._+="L"+(this._x1=u)+","+(this._y1=c);else{var S=f-p,M=h-g,C=m*m+y*y,w=S*S+M*M,k=Math.sqrt(C),A=Math.sqrt(x),b=d*Math.tan((i-Math.acos((C+x-w)/(2*k*A)))/2),E=b/A,T=b/k;Math.abs(E-1)>o&&(this._+="L"+(u+E*_)+","+(c+E*v)),this._+="A"+d+","+d+",0,0,"+ +(v*S>_*M)+","+(this._x1=u+T*m)+","+(this._y1=c+T*y)}},arc:function(u,c,f,h,d,p){u=+u,c=+c,f=+f,p=!!p;var g=f*Math.cos(h),m=f*Math.sin(h),y=u+g,_=c+m,v=1^p,x=p?h-d:d-h;if(f<0)throw new Error("negative radius: "+f);this._x1===null?this._+="M"+y+","+_:(Math.abs(this._x1-y)>o||Math.abs(this._y1-_)>o)&&(this._+="L"+y+","+_),f&&(x<0&&(x=x%a+a),x>s?this._+="A"+f+","+f+",0,1,"+v+","+(u-g)+","+(c-m)+"A"+f+","+f+",0,1,"+v+","+(this._x1=y)+","+(this._y1=_):x>o&&(this._+="A"+f+","+f+",0,"+ +(x>=i)+","+v+","+(this._x1=u+f*Math.cos(d))+","+(this._y1=c+f*Math.sin(d))))},rect:function(u,c,f,h){this._+="M"+(this._x0=this._x1=+u)+","+(this._y0=this._y1=+c)+"h"+ +f+"v"+ +h+"h"+-f+"Z"},toString:function(){return this._}},t.path=n,Object.defineProperty(t,"__esModule",{value:!0})})}}),q8=de({"node_modules/d3-shape/dist/d3-shape.js"(e,r){(function(t,i){typeof e=="object"&&typeof r<"u"?i(e,dle()):(t=t||self,i(t.d3=t.d3||{},t.d3))})(e,function(t,i){"use strict";function a(ze){return function(){return ze}}var o=Math.abs,s=Math.atan2,l=Math.cos,n=Math.max,u=Math.min,c=Math.sin,f=Math.sqrt,h=1e-12,d=Math.PI,p=d/2,g=2*d;function m(ze){return ze>1?0:ze<-1?d:Math.acos(ze)}function y(ze){return ze>=1?p:ze<=-1?-p:Math.asin(ze)}function _(ze){return ze.innerRadius}function v(ze){return ze.outerRadius}function x(ze){return ze.startAngle}function S(ze){return ze.endAngle}function M(ze){return ze&&ze.padAngle}function C(ze,tt,ft,wt,jt,It,Kt,qt){var vr=ft-ze,Br=wt-tt,Pr=Kt-jt,Mi=qt-It,gi=Mi*vr-Pr*Br;if(!(gi*giln*ln+on*on&&(tn=Kn,Mn=zn),{cx:tn,cy:Mn,x01:-Pr,y01:-Mi,x11:tn*(jt/pn-1),y11:Mn*(jt/pn-1)}}function k(){var ze=_,tt=v,ft=a(0),wt=null,jt=x,It=S,Kt=M,qt=null;function vr(){var Br,Pr,Mi=+ze.apply(this,arguments),gi=+tt.apply(this,arguments),ba=jt.apply(this,arguments)-p,Hi=It.apply(this,arguments)-p,Za=o(Hi-ba),oa=Hi>ba;if(qt||(qt=Br=i.path()),gih))qt.moveTo(0,0);else if(Za>g-h)qt.moveTo(gi*l(ba),gi*c(ba)),qt.arc(0,0,gi,ba,Hi,!oa),Mi>h&&(qt.moveTo(Mi*l(Hi),Mi*c(Hi)),qt.arc(0,0,Mi,Hi,ba,oa));else{var Cn=ba,_n=Hi,Li=ba,In=Hi,pn=Za,Ka=Za,Rn=Kt.apply(this,arguments)/2,tn=Rn>h&&(wt?+wt.apply(this,arguments):f(Mi*Mi+gi*gi)),Mn=u(o(gi-Mi)/2,+ft.apply(this,arguments)),Kn=Mn,zn=Mn,ua,Ea;if(tn>h){var ln=y(tn/Mi*c(Rn)),on=y(tn/gi*c(Rn));(pn-=ln*2)>h?(ln*=oa?1:-1,Li+=ln,In-=ln):(pn=0,Li=In=(ba+Hi)/2),(Ka-=on*2)>h?(on*=oa?1:-1,Cn+=on,_n-=on):(Ka=0,Cn=_n=(ba+Hi)/2)}var ao=gi*l(Cn),ho=gi*c(Cn),Jn=Mi*l(In),lo=Mi*c(In);if(Mn>h){var Fo=gi*l(_n),uo=gi*c(_n),Qn=Mi*l(Li),jo=Mi*c(Li),Yn;if(Zah?zn>h?(ua=w(Qn,jo,ao,ho,gi,zn,oa),Ea=w(Fo,uo,Jn,lo,gi,zn,oa),qt.moveTo(ua.cx+ua.x01,ua.cy+ua.y01),znh)||!(pn>h)?qt.lineTo(Jn,lo):Kn>h?(ua=w(Jn,lo,Fo,uo,Mi,-Kn,oa),Ea=w(ao,ho,Qn,jo,Mi,-Kn,oa),qt.lineTo(ua.cx+ua.x01,ua.cy+ua.y01),Kn=gi;--ba)qt.point(_n[ba],Li[ba]);qt.lineEnd(),qt.areaEnd()}oa&&(_n[Mi]=+ze(Za,Mi,Pr),Li[Mi]=+ft(Za,Mi,Pr),qt.point(tt?+tt(Za,Mi,Pr):_n[Mi],wt?+wt(Za,Mi,Pr):Li[Mi]))}if(Cn)return qt=null,Cn+""||null}function Br(){return F().defined(jt).curve(Kt).context(It)}return vr.x=function(Pr){return arguments.length?(ze=typeof Pr=="function"?Pr:a(+Pr),tt=null,vr):ze},vr.x0=function(Pr){return arguments.length?(ze=typeof Pr=="function"?Pr:a(+Pr),vr):ze},vr.x1=function(Pr){return arguments.length?(tt=Pr==null?null:typeof Pr=="function"?Pr:a(+Pr),vr):tt},vr.y=function(Pr){return arguments.length?(ft=typeof Pr=="function"?Pr:a(+Pr),wt=null,vr):ft},vr.y0=function(Pr){return arguments.length?(ft=typeof Pr=="function"?Pr:a(+Pr),vr):ft},vr.y1=function(Pr){return arguments.length?(wt=Pr==null?null:typeof Pr=="function"?Pr:a(+Pr),vr):wt},vr.lineX0=vr.lineY0=function(){return Br().x(ze).y(ft)},vr.lineY1=function(){return Br().x(ze).y(wt)},vr.lineX1=function(){return Br().x(tt).y(ft)},vr.defined=function(Pr){return arguments.length?(jt=typeof Pr=="function"?Pr:a(!!Pr),vr):jt},vr.curve=function(Pr){return arguments.length?(Kt=Pr,It!=null&&(qt=Kt(It)),vr):Kt},vr.context=function(Pr){return arguments.length?(Pr==null?It=qt=null:qt=Kt(It=Pr),vr):It},vr}function R(ze,tt){return ttze?1:tt>=ze?0:NaN}function P(ze){return ze}function z(){var ze=P,tt=R,ft=null,wt=a(0),jt=a(g),It=a(0);function Kt(qt){var vr,Br=qt.length,Pr,Mi,gi=0,ba=new Array(Br),Hi=new Array(Br),Za=+wt.apply(this,arguments),oa=Math.min(g,Math.max(-g,jt.apply(this,arguments)-Za)),Cn,_n=Math.min(Math.abs(oa)/Br,It.apply(this,arguments)),Li=_n*(oa<0?-1:1),In;for(vr=0;vr0&&(gi+=In);for(tt!=null?ba.sort(function(pn,Ka){return tt(Hi[pn],Hi[Ka])}):ft!=null&&ba.sort(function(pn,Ka){return ft(qt[pn],qt[Ka])}),vr=0,Mi=gi?(oa-Br*Li)/gi:0;vr0?In*Mi:0)+Li,Hi[Pr]={data:qt[Pr],index:vr,value:In,startAngle:Za,endAngle:Cn,padAngle:_n};return Hi}return Kt.value=function(qt){return arguments.length?(ze=typeof qt=="function"?qt:a(+qt),Kt):ze},Kt.sortValues=function(qt){return arguments.length?(tt=qt,ft=null,Kt):tt},Kt.sort=function(qt){return arguments.length?(ft=qt,tt=null,Kt):ft},Kt.startAngle=function(qt){return arguments.length?(wt=typeof qt=="function"?qt:a(+qt),Kt):wt},Kt.endAngle=function(qt){return arguments.length?(jt=typeof qt=="function"?qt:a(+qt),Kt):jt},Kt.padAngle=function(qt){return arguments.length?(It=typeof qt=="function"?qt:a(+qt),Kt):It},Kt}var I=B(b);function L(ze){this._curve=ze}L.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(ze,tt){this._curve.point(tt*Math.sin(ze),tt*-Math.cos(ze))}};function B(ze){function tt(ft){return new L(ze(ft))}return tt._curve=ze,tt}function O(ze){var tt=ze.curve;return ze.angle=ze.x,delete ze.x,ze.radius=ze.y,delete ze.y,ze.curve=function(ft){return arguments.length?tt(B(ft)):tt()._curve},ze}function G(){return O(F().curve(I))}function W(){var ze=D().curve(I),tt=ze.curve,ft=ze.lineX0,wt=ze.lineX1,jt=ze.lineY0,It=ze.lineY1;return ze.angle=ze.x,delete ze.x,ze.startAngle=ze.x0,delete ze.x0,ze.endAngle=ze.x1,delete ze.x1,ze.radius=ze.y,delete ze.y,ze.innerRadius=ze.y0,delete ze.y0,ze.outerRadius=ze.y1,delete ze.y1,ze.lineStartAngle=function(){return O(ft())},delete ze.lineX0,ze.lineEndAngle=function(){return O(wt())},delete ze.lineX1,ze.lineInnerRadius=function(){return O(jt())},delete ze.lineY0,ze.lineOuterRadius=function(){return O(It())},delete ze.lineY1,ze.curve=function(Kt){return arguments.length?tt(B(Kt)):tt()._curve},ze}function X(ze,tt){return[(tt=+tt)*Math.cos(ze-=Math.PI/2),tt*Math.sin(ze)]}var Z=Array.prototype.slice;function J(ze){return ze.source}function N(ze){return ze.target}function H(ze){var tt=J,ft=N,wt=E,jt=T,It=null;function Kt(){var qt,vr=Z.call(arguments),Br=tt.apply(this,vr),Pr=ft.apply(this,vr);if(It||(It=qt=i.path()),ze(It,+wt.apply(this,(vr[0]=Br,vr)),+jt.apply(this,vr),+wt.apply(this,(vr[0]=Pr,vr)),+jt.apply(this,vr)),qt)return It=null,qt+""||null}return Kt.source=function(qt){return arguments.length?(tt=qt,Kt):tt},Kt.target=function(qt){return arguments.length?(ft=qt,Kt):ft},Kt.x=function(qt){return arguments.length?(wt=typeof qt=="function"?qt:a(+qt),Kt):wt},Kt.y=function(qt){return arguments.length?(jt=typeof qt=="function"?qt:a(+qt),Kt):jt},Kt.context=function(qt){return arguments.length?(It=qt??null,Kt):It},Kt}function $(ze,tt,ft,wt,jt){ze.moveTo(tt,ft),ze.bezierCurveTo(tt=(tt+wt)/2,ft,tt,jt,wt,jt)}function U(ze,tt,ft,wt,jt){ze.moveTo(tt,ft),ze.bezierCurveTo(tt,ft=(ft+jt)/2,wt,ft,wt,jt)}function V(ze,tt,ft,wt,jt){var It=X(tt,ft),Kt=X(tt,ft=(ft+jt)/2),qt=X(wt,ft),vr=X(wt,jt);ze.moveTo(It[0],It[1]),ze.bezierCurveTo(Kt[0],Kt[1],qt[0],qt[1],vr[0],vr[1])}function j(){return H($)}function q(){return H(U)}function Y(){var ze=H(V);return ze.angle=ze.x,delete ze.x,ze.radius=ze.y,delete ze.y,ze}var K={draw:function(ze,tt){var ft=Math.sqrt(tt/d);ze.moveTo(ft,0),ze.arc(0,0,ft,0,g)}},te={draw:function(ze,tt){var ft=Math.sqrt(tt/5)/2;ze.moveTo(-3*ft,-ft),ze.lineTo(-ft,-ft),ze.lineTo(-ft,-3*ft),ze.lineTo(ft,-3*ft),ze.lineTo(ft,-ft),ze.lineTo(3*ft,-ft),ze.lineTo(3*ft,ft),ze.lineTo(ft,ft),ze.lineTo(ft,3*ft),ze.lineTo(-ft,3*ft),ze.lineTo(-ft,ft),ze.lineTo(-3*ft,ft),ze.closePath()}},ne=Math.sqrt(1/3),se=ne*2,le={draw:function(ze,tt){var ft=Math.sqrt(tt/se),wt=ft*ne;ze.moveTo(0,-ft),ze.lineTo(wt,0),ze.lineTo(0,ft),ze.lineTo(-wt,0),ze.closePath()}},ce=.8908130915292852,pe=Math.sin(d/10)/Math.sin(7*d/10),xe=Math.sin(g/10)*pe,ye=-Math.cos(g/10)*pe,fe={draw:function(ze,tt){var ft=Math.sqrt(tt*ce),wt=xe*ft,jt=ye*ft;ze.moveTo(0,-ft),ze.lineTo(wt,jt);for(var It=1;It<5;++It){var Kt=g*It/5,qt=Math.cos(Kt),vr=Math.sin(Kt);ze.lineTo(vr*ft,-qt*ft),ze.lineTo(qt*wt-vr*jt,vr*wt+qt*jt)}ze.closePath()}},ae={draw:function(ze,tt){var ft=Math.sqrt(tt),wt=-ft/2;ze.rect(wt,wt,ft,ft)}},ee=Math.sqrt(3),ie={draw:function(ze,tt){var ft=-Math.sqrt(tt/(ee*3));ze.moveTo(0,ft*2),ze.lineTo(-ee*ft,-ft),ze.lineTo(ee*ft,-ft),ze.closePath()}},Q=-.5,ue=Math.sqrt(3)/2,ge=1/Math.sqrt(12),Me=(ge/2+1)*3,Te={draw:function(ze,tt){var ft=Math.sqrt(tt/Me),wt=ft/2,jt=ft*ge,It=wt,Kt=ft*ge+ft,qt=-It,vr=Kt;ze.moveTo(wt,jt),ze.lineTo(It,Kt),ze.lineTo(qt,vr),ze.lineTo(Q*wt-ue*jt,ue*wt+Q*jt),ze.lineTo(Q*It-ue*Kt,ue*It+Q*Kt),ze.lineTo(Q*qt-ue*vr,ue*qt+Q*vr),ze.lineTo(Q*wt+ue*jt,Q*jt-ue*wt),ze.lineTo(Q*It+ue*Kt,Q*Kt-ue*It),ze.lineTo(Q*qt+ue*vr,Q*vr-ue*qt),ze.closePath()}},je=[K,te,le,ae,fe,ie,Te];function Ve(){var ze=a(K),tt=a(64),ft=null;function wt(){var jt;if(ft||(ft=jt=i.path()),ze.apply(this,arguments).draw(ft,+tt.apply(this,arguments)),jt)return ft=null,jt+""||null}return wt.type=function(jt){return arguments.length?(ze=typeof jt=="function"?jt:a(jt),wt):ze},wt.size=function(jt){return arguments.length?(tt=typeof jt=="function"?jt:a(+jt),wt):tt},wt.context=function(jt){return arguments.length?(ft=jt??null,wt):ft},wt}function Ke(){}function Je(ze,tt,ft){ze._context.bezierCurveTo((2*ze._x0+ze._x1)/3,(2*ze._y0+ze._y1)/3,(ze._x0+2*ze._x1)/3,(ze._y0+2*ze._y1)/3,(ze._x0+4*ze._x1+tt)/6,(ze._y0+4*ze._y1+ft)/6)}function vt(ze){this._context=ze}vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Je(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Je(this,ze,tt);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=tt}};function xt(ze){return new vt(ze)}function Pt(ze){this._context=ze}Pt.prototype={areaStart:Ke,areaEnd:Ke,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._x2=ze,this._y2=tt;break;case 1:this._point=2,this._x3=ze,this._y3=tt;break;case 2:this._point=3,this._x4=ze,this._y4=tt,this._context.moveTo((this._x0+4*this._x1+ze)/6,(this._y0+4*this._y1+tt)/6);break;default:Je(this,ze,tt);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=tt}};function mt(ze){return new Pt(ze)}function Mt(ze){this._context=ze}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var ft=(this._x0+4*this._x1+ze)/6,wt=(this._y0+4*this._y1+tt)/6;this._line?this._context.lineTo(ft,wt):this._context.moveTo(ft,wt);break;case 3:this._point=4;default:Je(this,ze,tt);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=tt}};function lt(ze){return new Mt(ze)}function qe(ze,tt){this._basis=new vt(ze),this._beta=tt}qe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var ze=this._x,tt=this._y,ft=ze.length-1;if(ft>0)for(var wt=ze[0],jt=tt[0],It=ze[ft]-wt,Kt=tt[ft]-jt,qt=-1,vr;++qt<=ft;)vr=qt/ft,this._basis.point(this._beta*ze[qt]+(1-this._beta)*(wt+vr*It),this._beta*tt[qt]+(1-this._beta)*(jt+vr*Kt));this._x=this._y=null,this._basis.lineEnd()},point:function(ze,tt){this._x.push(+ze),this._y.push(+tt)}};var Ye=(function ze(tt){function ft(wt){return tt===1?new vt(wt):new qe(wt,tt)}return ft.beta=function(wt){return ze(+wt)},ft})(.85);function me(ze,tt,ft){ze._context.bezierCurveTo(ze._x1+ze._k*(ze._x2-ze._x0),ze._y1+ze._k*(ze._y2-ze._y0),ze._x2+ze._k*(ze._x1-tt),ze._y2+ze._k*(ze._y1-ft),ze._x2,ze._y2)}function _e(ze,tt){this._context=ze,this._k=(1-tt)/6}_e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:me(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2,this._x1=ze,this._y1=tt;break;case 2:this._point=3;default:me(this,ze,tt);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var Ae=(function ze(tt){function ft(wt){return new _e(wt,tt)}return ft.tension=function(wt){return ze(+wt)},ft})(0);function ke(ze,tt){this._context=ze,this._k=(1-tt)/6}ke.prototype={areaStart:Ke,areaEnd:Ke,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._x3=ze,this._y3=tt;break;case 1:this._point=2,this._context.moveTo(this._x4=ze,this._y4=tt);break;case 2:this._point=3,this._x5=ze,this._y5=tt;break;default:me(this,ze,tt);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var Ee=(function ze(tt){function ft(wt){return new ke(wt,tt)}return ft.tension=function(wt){return ze(+wt)},ft})(0);function De(ze,tt){this._context=ze,this._k=(1-tt)/6}De.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:me(this,ze,tt);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var Qe=(function ze(tt){function ft(wt){return new De(wt,tt)}return ft.tension=function(wt){return ze(+wt)},ft})(0);function Ue(ze,tt,ft){var wt=ze._x1,jt=ze._y1,It=ze._x2,Kt=ze._y2;if(ze._l01_a>h){var qt=2*ze._l01_2a+3*ze._l01_a*ze._l12_a+ze._l12_2a,vr=3*ze._l01_a*(ze._l01_a+ze._l12_a);wt=(wt*qt-ze._x0*ze._l12_2a+ze._x2*ze._l01_2a)/vr,jt=(jt*qt-ze._y0*ze._l12_2a+ze._y2*ze._l01_2a)/vr}if(ze._l23_a>h){var Br=2*ze._l23_2a+3*ze._l23_a*ze._l12_a+ze._l12_2a,Pr=3*ze._l23_a*(ze._l23_a+ze._l12_a);It=(It*Br+ze._x1*ze._l23_2a-tt*ze._l12_2a)/Pr,Kt=(Kt*Br+ze._y1*ze._l23_2a-ft*ze._l12_2a)/Pr}ze._context.bezierCurveTo(wt,jt,It,Kt,ze._x2,ze._y2)}function at(ze,tt){this._context=ze,this._alpha=tt}at.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){if(ze=+ze,tt=+tt,this._point){var ft=this._x2-ze,wt=this._y2-tt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(ft*ft+wt*wt,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2;break;case 2:this._point=3;default:Ue(this,ze,tt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var rt=(function ze(tt){function ft(wt){return tt?new at(wt,tt):new _e(wt,0)}return ft.alpha=function(wt){return ze(+wt)},ft})(.5);function ht(ze,tt){this._context=ze,this._alpha=tt}ht.prototype={areaStart:Ke,areaEnd:Ke,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(ze,tt){if(ze=+ze,tt=+tt,this._point){var ft=this._x2-ze,wt=this._y2-tt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(ft*ft+wt*wt,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=ze,this._y3=tt;break;case 1:this._point=2,this._context.moveTo(this._x4=ze,this._y4=tt);break;case 2:this._point=3,this._x5=ze,this._y5=tt;break;default:Ue(this,ze,tt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var At=(function ze(tt){function ft(wt){return tt?new ht(wt,tt):new ke(wt,0)}return ft.alpha=function(wt){return ze(+wt)},ft})(.5);function dt(ze,tt){this._context=ze,this._alpha=tt}dt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){if(ze=+ze,tt=+tt,this._point){var ft=this._x2-ze,wt=this._y2-tt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(ft*ft+wt*wt,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ue(this,ze,tt);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=tt}};var Ht=(function ze(tt){function ft(wt){return tt?new dt(wt,tt):new De(wt,0)}return ft.alpha=function(wt){return ze(+wt)},ft})(.5);function fr(ze){this._context=ze}fr.prototype={areaStart:Ke,areaEnd:Ke,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(ze,tt){ze=+ze,tt=+tt,this._point?this._context.lineTo(ze,tt):(this._point=1,this._context.moveTo(ze,tt))}};function gt(ze){return new fr(ze)}function yt(ze){return ze<0?-1:1}function kt(ze,tt,ft){var wt=ze._x1-ze._x0,jt=tt-ze._x1,It=(ze._y1-ze._y0)/(wt||jt<0&&-0),Kt=(ft-ze._y1)/(jt||wt<0&&-0),qt=(It*jt+Kt*wt)/(wt+jt);return(yt(It)+yt(Kt))*Math.min(Math.abs(It),Math.abs(Kt),.5*Math.abs(qt))||0}function Lt(ze,tt){var ft=ze._x1-ze._x0;return ft?(3*(ze._y1-ze._y0)/ft-tt)/2:tt}function Ct(ze,tt,ft){var wt=ze._x0,jt=ze._y0,It=ze._x1,Kt=ze._y1,qt=(It-wt)/3;ze._context.bezierCurveTo(wt+qt,jt+qt*tt,It-qt,Kt-qt*ft,It,Kt)}function $t(ze){this._context=ze}$t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ct(this,this._t0,Lt(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,tt){var ft=NaN;if(ze=+ze,tt=+tt,!(ze===this._x1&&tt===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2;break;case 2:this._point=3,Ct(this,Lt(this,ft=kt(this,ze,tt)),ft);break;default:Ct(this,this._t0,ft=kt(this,ze,tt));break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=tt,this._t0=ft}}};function mr(ze){this._context=new br(ze)}(mr.prototype=Object.create($t.prototype)).point=function(ze,tt){$t.prototype.point.call(this,tt,ze)};function br(ze){this._context=ze}br.prototype={moveTo:function(ze,tt){this._context.moveTo(tt,ze)},closePath:function(){this._context.closePath()},lineTo:function(ze,tt){this._context.lineTo(tt,ze)},bezierCurveTo:function(ze,tt,ft,wt,jt,It){this._context.bezierCurveTo(tt,ze,wt,ft,It,jt)}};function Er(ze){return new $t(ze)}function Tr(ze){return new mr(ze)}function Ur(ze){this._context=ze}Ur.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var ze=this._x,tt=this._y,ft=ze.length;if(ft)if(this._line?this._context.lineTo(ze[0],tt[0]):this._context.moveTo(ze[0],tt[0]),ft===2)this._context.lineTo(ze[1],tt[1]);else for(var wt=Ai(ze),jt=Ai(tt),It=0,Kt=1;Kt=0;--tt)jt[tt]=(Kt[tt]-jt[tt+1])/It[tt];for(It[ft-1]=(ze[ft]+jt[ft-1])/2,tt=0;tt=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(ze,tt){switch(ze=+ze,tt=+tt,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,tt):this._context.moveTo(ze,tt);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,tt),this._context.lineTo(ze,tt);else{var ft=this._x*(1-this._t)+ze*this._t;this._context.lineTo(ft,this._y),this._context.lineTo(ft,tt)}break}}this._x=ze,this._y=tt}};function ea(ze){return new Qr(ze,.5)}function $i(ze){return new Qr(ze,0)}function ja(ze){return new Qr(ze,1)}function ya(ze,tt){if((Kt=ze.length)>1)for(var ft=1,wt,jt,It=ze[tt[0]],Kt,qt=It.length;ft=0;)ft[tt]=tt;return ft}function xi(ze,tt){return ze[tt]}function bi(){var ze=a([]),tt=pa,ft=ya,wt=xi;function jt(It){var Kt=ze.apply(this,arguments),qt,vr=It.length,Br=Kt.length,Pr=new Array(Br),Mi;for(qt=0;qt0){for(var ft,wt,jt=0,It=ze[0].length,Kt;jt0)for(var ft,wt=0,jt,It,Kt,qt,vr,Br=ze[tt[0]].length;wt0?(jt[0]=Kt,jt[1]=Kt+=It):It<0?(jt[1]=qt,jt[0]=qt+=It):(jt[0]=0,jt[1]=It)}function pi(ze,tt){if((jt=ze.length)>0){for(var ft=0,wt=ze[tt[0]],jt,It=wt.length;ft0)||!((It=(jt=ze[tt[0]]).length)>0))){for(var ft=0,wt=1,jt,It,Kt;wtIt&&(It=jt,ft=tt);return ft}function Et(ze){var tt=ze.map(St);return pa(ze).sort(function(ft,wt){return tt[ft]-tt[wt]})}function St(ze){for(var tt=0,ft=-1,wt=ze.length,jt;++ft[D(xe,ye,le),xe]));for(let[xe,ye]of ce.entries()){ye.index=xe;let{source:fe,target:ae}=ye;typeof fe!="object"&&(fe=ye.source=_(pe,fe)),typeof ae!="object"&&(ae=ye.target=_(pe,ae)),fe.sourceLinks.push(ye),ae.targetLinks.push(ye)}if(z!=null)for(let{sourceLinks:xe,targetLinks:ye}of le)xe.sort(z),ye.sort(z)}function X({nodes:le}){for(let ce of le)ce.value=ce.fixedValue===void 0?Math.max(i.sum(ce.sourceLinks,p),i.sum(ce.targetLinks,p)):ce.fixedValue}function Z({nodes:le}){let ce=le.length,pe=new Set(le),xe=new Set,ye=0;for(;pe.size;){for(let fe of pe){fe.depth=ye;for(let{target:ae}of fe.sourceLinks)xe.add(ae)}if(++ye>ce)throw new Error("circular link");pe=xe,xe=new Set}}function J({nodes:le}){let ce=le.length,pe=new Set(le),xe=new Set,ye=0;for(;pe.size;){for(let fe of pe){fe.height=ye;for(let{source:ae}of fe.targetLinks)xe.add(ae)}if(++ye>ce)throw new Error("circular link");pe=xe,xe=new Set}}function N({nodes:le}){let ce=i.max(le,ye=>ye.depth)+1,pe=(A-w-E)/(ce-1),xe=new Array(ce);for(let ye of le){let fe=Math.max(0,Math.min(ce-1,Math.floor(R.call(null,ye,ce))));ye.layer=fe,ye.x0=w+fe*pe,ye.x1=ye.x0+E,xe[fe]?xe[fe].push(ye):xe[fe]=[ye]}if(P)for(let ye of xe)ye.sort(P);return xe}function H(le){let ce=i.min(le,pe=>(b-k-(pe.length-1)*F)/i.sum(pe,p));for(let pe of le){let xe=k;for(let ye of pe){ye.y0=xe,ye.y1=xe+ye.value*ce,xe=ye.y1+F;for(let fe of ye.sourceLinks)fe.width=fe.value*ce}xe=(b-xe+F)/(pe.length+1);for(let ye=0;yepe.length)-1)),H(ce);for(let pe=0;pe0))continue;let Q=(ee/ie-ae.y0)*ce;ae.y0+=Q,ae.y1+=Q,K(ae)}P===void 0&&fe.sort(d),j(fe,pe)}}function V(le,ce,pe){for(let xe=le.length,ye=xe-2;ye>=0;--ye){let fe=le[ye];for(let ae of fe){let ee=0,ie=0;for(let{target:ue,value:ge}of ae.sourceLinks){let Me=ge*(ue.layer-ae.layer);ee+=se(ae,ue)*Me,ie+=Me}if(!(ie>0))continue;let Q=(ee/ie-ae.y0)*ce;ae.y0+=Q,ae.y1+=Q,K(ae)}P===void 0&&fe.sort(d),j(fe,pe)}}function j(le,ce){let pe=le.length>>1,xe=le[pe];Y(le,xe.y0-F,pe-1,ce),q(le,xe.y1+F,pe+1,ce),Y(le,b,le.length-1,ce),q(le,k,0,ce)}function q(le,ce,pe,xe){for(;pe1e-6&&(ye.y0+=fe,ye.y1+=fe),ce=ye.y1+F}}function Y(le,ce,pe,xe){for(;pe>=0;--pe){let ye=le[pe],fe=(ye.y1-ce)*xe;fe>1e-6&&(ye.y0-=fe,ye.y1-=fe),ce=ye.y0-F}}function K({sourceLinks:le,targetLinks:ce}){if(z===void 0){for(let{source:{sourceLinks:pe}}of ce)pe.sort(h);for(let{target:{targetLinks:pe}}of le)pe.sort(f)}}function te(le){if(z===void 0)for(let{sourceLinks:ce,targetLinks:pe}of le)ce.sort(h),pe.sort(f)}function ne(le,ce){let pe=le.y0-(le.sourceLinks.length-1)*F/2;for(let{target:xe,width:ye}of le.sourceLinks){if(xe===ce)break;pe+=ye+F}for(let{source:xe,width:ye}of ce.targetLinks){if(xe===le)break;pe-=ye}return pe}function se(le,ce){let pe=ce.y0-(ce.targetLinks.length-1)*F/2;for(let{source:xe,width:ye}of ce.targetLinks){if(xe===le)break;pe+=ye+F}for(let{target:xe,width:ye}of le.sourceLinks){if(xe===ce)break;pe-=ye}return pe}return G}function S(w){return[w.source.x1,w.y0]}function M(w){return[w.target.x0,w.y1]}function C(){return a.linkHorizontal().source(S).target(M)}t.sankey=x,t.sankeyCenter=u,t.sankeyJustify=n,t.sankeyLeft=s,t.sankeyLinkHorizontal=C,t.sankeyRight=l,Object.defineProperty(t,"__esModule",{value:!0})})}}),vle=de({"node_modules/@plotly/d3-sankey-circular/node_modules/d3-array/dist/d3-array.js"(e,r){(function(t,i){i(typeof e=="object"&&typeof r<"u"?e:t.d3=t.d3||{})})(e,(function(t){"use strict";function i($,U){return $U?1:$>=U?0:NaN}function a($){return $.length===1&&($=o($)),{left:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)<0?j=Y+1:q=Y}return j},right:function(U,V,j,q){for(j==null&&(j=0),q==null&&(q=U.length);j>>1;$(U[Y],V)>0?q=Y:j=Y+1}return j}}}function o($){return function(U,V){return i($(U),V)}}var s=a(i),l=s.right,n=s.left;function u($,U){U==null&&(U=c);for(var V=0,j=$.length-1,q=$[0],Y=new Array(j<0?0:j);V$?1:U>=$?0:NaN}function d($){return $===null?NaN:+$}function p($,U){var V=$.length,j=0,q=-1,Y=0,K,te,ne=0;if(U==null)for(;++q1)return ne/(j-1)}function g($,U){var V=p($,U);return V&&Math.sqrt(V)}function m($,U){var V=$.length,j=-1,q,Y,K;if(U==null){for(;++j=q)for(Y=K=q;++jq&&(Y=q),K=q)for(Y=K=q;++jq&&(Y=q),K0)return[$];if((j=U<$)&&(Y=$,$=U,U=Y),(te=b($,U,V))===0||!isFinite(te))return[];if(te>0)for($=Math.ceil($/te),U=Math.floor(U/te),K=new Array(Y=Math.ceil(U-$+1));++q=0?(Y>=C?10:Y>=w?5:Y>=k?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(Y>=C?10:Y>=w?5:Y>=k?2:1)}function E($,U,V){var j=Math.abs(U-$)/Math.max(0,V),q=Math.pow(10,Math.floor(Math.log(j)/Math.LN10)),Y=j/q;return Y>=C?q*=10:Y>=w?q*=5:Y>=k&&(q*=2),U<$?-q:q}function T($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function F(){var $=S,U=m,V=T;function j(q){var Y,K=q.length,te,ne=new Array(K);for(Y=0;Yce;)pe.pop(),--xe;var ye=new Array(xe+1),fe;for(Y=0;Y<=xe;++Y)fe=ye[Y]=[],fe.x0=Y>0?pe[Y-1]:le,fe.x1=Y=1)return+V($[j-1],j-1,$);var j,q=(j-1)*U,Y=Math.floor(q),K=+V($[Y],Y,$),te=+V($[Y+1],Y+1,$);return K+(te-K)*(q-Y)}}function R($,U,V){return $=v.call($,d).sort(i),Math.ceil((V-U)/(2*(D($,.75)-D($,.25))*Math.pow($.length,-1/3)))}function P($,U,V){return Math.ceil((V-U)/(3.5*g($)*Math.pow($.length,-1/3)))}function z($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jY&&(Y=q)}else for(;++j=q)for(Y=q;++jY&&(Y=q);return Y}function I($,U){var V=$.length,j=V,q=-1,Y,K=0;if(U==null)for(;++q=0;)for(K=$[U],V=K.length;--V>=0;)Y[--q]=K[V];return Y}function O($,U){var V=$.length,j=-1,q,Y;if(U==null){for(;++j=q)for(Y=q;++jq&&(Y=q)}else for(;++j=q)for(Y=q;++jq&&(Y=q);return Y}function G($,U){for(var V=U.length,j=new Array(V);V--;)j[V]=$[U[V]];return j}function W($,U){if(V=$.length){var V,j=0,q=0,Y,K=$[q];for(U==null&&(U=i);++j=M})}function m(M){g(M);for(var C=a,w=t(C),k=w.components.filter(function(R){return R.length>1}),A=1/0,b,E=0;E"u"?"undefined":d(_e))!=="object"&&(_e=Ye.source=w(qe,_e)),(typeof Ae>"u"?"undefined":d(Ae))!=="object"&&(Ae=Ye.target=w(qe,Ae)),_e.sourceLinks.push(Ye),Ae.targetLinks.push(Ye)}),lt}function Je(lt){lt.nodes.forEach(function(qe){qe.partOfCycle=!1,qe.value=Math.max(i.sum(qe.sourceLinks,y),i.sum(qe.targetLinks,y)),qe.sourceLinks.forEach(function(Ye){Ye.circular&&(qe.partOfCycle=!0,qe.circularLinkType=Ye.circularLinkType)}),qe.targetLinks.forEach(function(Ye){Ye.circular&&(qe.partOfCycle=!0,qe.circularLinkType=Ye.circularLinkType)})})}function vt(lt){var qe=0,Ye=0,me=0,_e=0,Ae=i.max(lt.nodes,function(ke){return ke.column});return lt.links.forEach(function(ke){ke.circular&&(ke.circularLinkType=="top"?qe=qe+ke.width:Ye=Ye+ke.width,ke.target.column==0&&(_e=_e+ke.width),ke.source.column==Ae&&(me=me+ke.width))}),qe=qe>0?qe+A+b:qe,Ye=Ye>0?Ye+A+b:Ye,me=me>0?me+A+b:me,_e=_e>0?_e+A+b:_e,{top:qe,bottom:Ye,left:_e,right:me}}function xt(lt,qe){var Ye=i.max(lt.nodes,function(Qe){return Qe.column}),me=xe-ce,_e=ye-pe,Ae=me+qe.right+qe.left,ke=_e+qe.top+qe.bottom,Ee=me/Ae,De=_e/ke;return ce=ce*Ee+qe.left,xe=qe.right==0?xe:xe*Ee,pe=pe*De+qe.top,ye=ye*De,lt.nodes.forEach(function(Qe){Qe.x0=ce+Qe.column*((xe-ce-fe)/Ye),Qe.x1=Qe.x0+fe}),De}function Pt(lt){var qe,Ye,me;for(qe=lt.nodes,Ye=[],me=0;qe.length;++me,qe=Ye,Ye=[])qe.forEach(function(_e){_e.depth=me,_e.sourceLinks.forEach(function(Ae){Ye.indexOf(Ae.target)<0&&!Ae.circular&&Ye.push(Ae.target)})});for(qe=lt.nodes,Ye=[],me=0;qe.length;++me,qe=Ye,Ye=[])qe.forEach(function(_e){_e.height=me,_e.targetLinks.forEach(function(Ae){Ye.indexOf(Ae.source)<0&&!Ae.circular&&Ye.push(Ae.source)})});lt.nodes.forEach(function(_e){_e.column=Math.floor(ie.call(null,_e,me))})}function mt(lt,qe,Ye){var me=a.nest().key(function(Qe){return Qe.column}).sortKeys(i.ascending).entries(lt.nodes).map(function(Qe){return Qe.values});ke(Ye),De();for(var _e=1,Ae=qe;Ae>0;--Ae)Ee(_e*=.99,Ye),De();function ke(Qe){if(Te){var Ue=1/0;me.forEach(function(At){var dt=ye*Te/(At.length+1);Ue=dt0))if(At==0&&ht==1)Ht=dt.y1-dt.y0,dt.y0=ye/2-Ht/2,dt.y1=ye/2+Ht/2;else if(At==at-1&&ht==1)Ht=dt.y1-dt.y0,dt.y0=ye/2-Ht/2,dt.y1=ye/2+Ht/2;else{var fr=0,gt=i.mean(dt.sourceLinks,x),yt=i.mean(dt.targetLinks,v);gt&&yt?fr=(gt+yt)/2:fr=gt||yt;var kt=(fr-_(dt))*Qe;dt.y0+=kt,dt.y1+=kt}})})}function De(){me.forEach(function(Qe){var Ue,at,rt=pe,ht=Qe.length,At;for(Qe.sort(m),At=0;At0&&(Ue.y0+=at,Ue.y1+=at),rt=Ue.y1+ae;if(at=rt-ae-ye,at>0)for(rt=Ue.y0-=at,Ue.y1-=at,At=ht-2;At>=0;--At)Ue=Qe[At],at=Ue.y1+ae-rt,at>0&&(Ue.y0-=at,Ue.y1-=at),rt=Ue.y0})}}function Mt(lt){lt.nodes.forEach(function(qe){qe.sourceLinks.sort(g),qe.targetLinks.sort(p)}),lt.nodes.forEach(function(qe){var Ye=qe.y0,me=Ye,_e=qe.y1,Ae=_e;qe.sourceLinks.forEach(function(ke){ke.circular?(ke.y0=_e-ke.width/2,_e=_e-ke.width):(ke.y0=Ye+ke.width/2,Ye+=ke.width)}),qe.targetLinks.forEach(function(ke){ke.circular?(ke.y1=Ae-ke.width/2,Ae=Ae-ke.width):(ke.y1=me+ke.width/2,me+=ke.width)})})}return Ve}function F(ce,pe,xe){var ye=0;if(xe===null){for(var fe=[],ae=0;aepe.source.column)}function z(ce,pe){var xe=0;ce.sourceLinks.forEach(function(fe){xe=fe.circular&&!se(fe,pe)?xe+1:xe});var ye=0;return ce.targetLinks.forEach(function(fe){ye=fe.circular&&!se(fe,pe)?ye+1:ye}),xe+ye}function I(ce){var pe=ce.source.sourceLinks,xe=0;pe.forEach(function(ae){xe=ae.circular?xe+1:xe});var ye=ce.target.targetLinks,fe=0;return ye.forEach(function(ae){fe=ae.circular?fe+1:fe}),!(xe>1||fe>1)}function L(ce,pe,xe){return ce.sort(G),ce.forEach(function(ye,fe){var ae=0;if(se(ye,xe)&&I(ye))ye.circularPathData.verticalBuffer=ae+ye.width/2;else{var ee=0;for(ee;eeae?ie:ae}ye.circularPathData.verticalBuffer=ae+ye.width/2}}),ce}function B(ce,pe,xe,ye){var fe=5,ae=i.min(ce.links,function(Q){return Q.source.y0});ce.links.forEach(function(Q){Q.circular&&(Q.circularPathData={})});var ee=ce.links.filter(function(Q){return Q.circularLinkType=="top"});L(ee,pe,ye);var ie=ce.links.filter(function(Q){return Q.circularLinkType=="bottom"});L(ie,pe,ye),ce.links.forEach(function(Q){if(Q.circular){if(Q.circularPathData.arcRadius=Q.width+b,Q.circularPathData.leftNodeBuffer=fe,Q.circularPathData.rightNodeBuffer=fe,Q.circularPathData.sourceWidth=Q.source.x1-Q.source.x0,Q.circularPathData.sourceX=Q.source.x0+Q.circularPathData.sourceWidth,Q.circularPathData.targetX=Q.target.x0,Q.circularPathData.sourceY=Q.y0,Q.circularPathData.targetY=Q.y1,se(Q,ye)&&I(Q))Q.circularPathData.leftSmallArcRadius=b+Q.width/2,Q.circularPathData.leftLargeArcRadius=b+Q.width/2,Q.circularPathData.rightSmallArcRadius=b+Q.width/2,Q.circularPathData.rightLargeArcRadius=b+Q.width/2,Q.circularLinkType=="bottom"?(Q.circularPathData.verticalFullExtent=Q.source.y1+A+Q.circularPathData.verticalBuffer,Q.circularPathData.verticalLeftInnerExtent=Q.circularPathData.verticalFullExtent-Q.circularPathData.leftLargeArcRadius,Q.circularPathData.verticalRightInnerExtent=Q.circularPathData.verticalFullExtent-Q.circularPathData.rightLargeArcRadius):(Q.circularPathData.verticalFullExtent=Q.source.y0-A-Q.circularPathData.verticalBuffer,Q.circularPathData.verticalLeftInnerExtent=Q.circularPathData.verticalFullExtent+Q.circularPathData.leftLargeArcRadius,Q.circularPathData.verticalRightInnerExtent=Q.circularPathData.verticalFullExtent+Q.circularPathData.rightLargeArcRadius);else{var ue=Q.source.column,ge=Q.circularLinkType,Me=ce.links.filter(function(Ve){return Ve.source.column==ue&&Ve.circularLinkType==ge});Q.circularLinkType=="bottom"?Me.sort(X):Me.sort(W);var Te=0;Me.forEach(function(Ve,Ke){Ve.circularLinkID==Q.circularLinkID&&(Q.circularPathData.leftSmallArcRadius=b+Q.width/2+Te,Q.circularPathData.leftLargeArcRadius=b+Q.width/2+Ke*pe+Te),Te=Te+Ve.width}),ue=Q.target.column,Me=ce.links.filter(function(Ve){return Ve.target.column==ue&&Ve.circularLinkType==ge}),Q.circularLinkType=="bottom"?Me.sort(J):Me.sort(Z),Te=0,Me.forEach(function(Ve,Ke){Ve.circularLinkID==Q.circularLinkID&&(Q.circularPathData.rightSmallArcRadius=b+Q.width/2+Te,Q.circularPathData.rightLargeArcRadius=b+Q.width/2+Ke*pe+Te),Te=Te+Ve.width}),Q.circularLinkType=="bottom"?(Q.circularPathData.verticalFullExtent=Math.max(xe,Q.source.y1,Q.target.y1)+A+Q.circularPathData.verticalBuffer,Q.circularPathData.verticalLeftInnerExtent=Q.circularPathData.verticalFullExtent-Q.circularPathData.leftLargeArcRadius,Q.circularPathData.verticalRightInnerExtent=Q.circularPathData.verticalFullExtent-Q.circularPathData.rightLargeArcRadius):(Q.circularPathData.verticalFullExtent=ae-A-Q.circularPathData.verticalBuffer,Q.circularPathData.verticalLeftInnerExtent=Q.circularPathData.verticalFullExtent+Q.circularPathData.leftLargeArcRadius,Q.circularPathData.verticalRightInnerExtent=Q.circularPathData.verticalFullExtent+Q.circularPathData.rightLargeArcRadius)}Q.circularPathData.leftInnerExtent=Q.circularPathData.sourceX+Q.circularPathData.leftNodeBuffer,Q.circularPathData.rightInnerExtent=Q.circularPathData.targetX-Q.circularPathData.rightNodeBuffer,Q.circularPathData.leftFullExtent=Q.circularPathData.sourceX+Q.circularPathData.leftLargeArcRadius+Q.circularPathData.leftNodeBuffer,Q.circularPathData.rightFullExtent=Q.circularPathData.targetX-Q.circularPathData.rightLargeArcRadius-Q.circularPathData.rightNodeBuffer}if(Q.circular)Q.path=O(Q);else{var je=o.linkHorizontal().source(function(Ve){var Ke=Ve.source.x0+(Ve.source.x1-Ve.source.x0),Je=Ve.y0;return[Ke,Je]}).target(function(Ve){var Ke=Ve.target.x0,Je=Ve.y1;return[Ke,Je]});Q.path=je(Q)}})}function O(ce){var pe="";return ce.circularLinkType=="top"?pe="M"+ce.circularPathData.sourceX+" "+ce.circularPathData.sourceY+" L"+ce.circularPathData.leftInnerExtent+" "+ce.circularPathData.sourceY+" A"+ce.circularPathData.leftLargeArcRadius+" "+ce.circularPathData.leftSmallArcRadius+" 0 0 0 "+ce.circularPathData.leftFullExtent+" "+(ce.circularPathData.sourceY-ce.circularPathData.leftSmallArcRadius)+" L"+ce.circularPathData.leftFullExtent+" "+ce.circularPathData.verticalLeftInnerExtent+" A"+ce.circularPathData.leftLargeArcRadius+" "+ce.circularPathData.leftLargeArcRadius+" 0 0 0 "+ce.circularPathData.leftInnerExtent+" "+ce.circularPathData.verticalFullExtent+" L"+ce.circularPathData.rightInnerExtent+" "+ce.circularPathData.verticalFullExtent+" A"+ce.circularPathData.rightLargeArcRadius+" "+ce.circularPathData.rightLargeArcRadius+" 0 0 0 "+ce.circularPathData.rightFullExtent+" "+ce.circularPathData.verticalRightInnerExtent+" L"+ce.circularPathData.rightFullExtent+" "+(ce.circularPathData.targetY-ce.circularPathData.rightSmallArcRadius)+" A"+ce.circularPathData.rightLargeArcRadius+" "+ce.circularPathData.rightSmallArcRadius+" 0 0 0 "+ce.circularPathData.rightInnerExtent+" "+ce.circularPathData.targetY+" L"+ce.circularPathData.targetX+" "+ce.circularPathData.targetY:pe="M"+ce.circularPathData.sourceX+" "+ce.circularPathData.sourceY+" L"+ce.circularPathData.leftInnerExtent+" "+ce.circularPathData.sourceY+" A"+ce.circularPathData.leftLargeArcRadius+" "+ce.circularPathData.leftSmallArcRadius+" 0 0 1 "+ce.circularPathData.leftFullExtent+" "+(ce.circularPathData.sourceY+ce.circularPathData.leftSmallArcRadius)+" L"+ce.circularPathData.leftFullExtent+" "+ce.circularPathData.verticalLeftInnerExtent+" A"+ce.circularPathData.leftLargeArcRadius+" "+ce.circularPathData.leftLargeArcRadius+" 0 0 1 "+ce.circularPathData.leftInnerExtent+" "+ce.circularPathData.verticalFullExtent+" L"+ce.circularPathData.rightInnerExtent+" "+ce.circularPathData.verticalFullExtent+" A"+ce.circularPathData.rightLargeArcRadius+" "+ce.circularPathData.rightLargeArcRadius+" 0 0 1 "+ce.circularPathData.rightFullExtent+" "+ce.circularPathData.verticalRightInnerExtent+" L"+ce.circularPathData.rightFullExtent+" "+(ce.circularPathData.targetY+ce.circularPathData.rightSmallArcRadius)+" A"+ce.circularPathData.rightLargeArcRadius+" "+ce.circularPathData.rightSmallArcRadius+" 0 0 1 "+ce.circularPathData.rightInnerExtent+" "+ce.circularPathData.targetY+" L"+ce.circularPathData.targetX+" "+ce.circularPathData.targetY,pe}function G(ce,pe){return N(ce)==N(pe)?ce.circularLinkType=="bottom"?X(ce,pe):W(ce,pe):N(pe)-N(ce)}function W(ce,pe){return ce.y0-pe.y0}function X(ce,pe){return pe.y0-ce.y0}function Z(ce,pe){return ce.y1-pe.y1}function J(ce,pe){return pe.y1-ce.y1}function N(ce){return ce.target.column-ce.source.column}function H(ce){return ce.target.x0-ce.source.x1}function $(ce,pe){var xe=R(ce),ye=H(pe)/Math.tan(xe),fe=ne(ce)=="up"?ce.y1+ye:ce.y1-ye;return fe}function U(ce,pe){var xe=R(ce),ye=H(pe)/Math.tan(xe),fe=ne(ce)=="up"?ce.y1-ye:ce.y1+ye;return fe}function V(ce,pe,xe,ye){ce.links.forEach(function(fe){if(!fe.circular&&fe.target.column-fe.source.column>1){var ae=fe.source.column+1,ee=fe.target.column-1,ie=1,Q=ee-ae+1;for(ie=1;ae<=ee;ae++,ie++)ce.nodes.forEach(function(ue){if(ue.column==ae){var ge=ie/(Q+1),Me=Math.pow(1-ge,3),Te=3*ge*Math.pow(1-ge,2),je=3*Math.pow(ge,2)*(1-ge),Ve=Math.pow(ge,3),Ke=Me*fe.y0+Te*fe.y0+je*fe.y1+Ve*fe.y1,Je=Ke-fe.width/2,vt=Ke+fe.width/2,xt;Je>ue.y0&&Jeue.y0&&vtue.y1&&q(Pt,xt,pe,xe)})):Jeue.y1&&(xt=vt-ue.y0+10,ue=q(ue,xt,pe,xe),ce.nodes.forEach(function(Pt){k(Pt,ye)==k(ue,ye)||Pt.column!=ue.column||Pt.y0ue.y1&&q(Pt,xt,pe,xe)}))}})}})}function j(ce,pe){return ce.y0>pe.y0&&ce.y0pe.y0&&ce.y1pe.y1}function q(ce,pe,xe,ye){return ce.y0+pe>=xe&&ce.y1+pe<=ye&&(ce.y0=ce.y0+pe,ce.y1=ce.y1+pe,ce.targetLinks.forEach(function(fe){fe.y1=fe.y1+pe}),ce.sourceLinks.forEach(function(fe){fe.y0=fe.y0+pe})),ce}function Y(ce,pe,xe,ye){ce.nodes.forEach(function(fe){ye&&fe.y+(fe.y1-fe.y0)>pe&&(fe.y=fe.y-(fe.y+(fe.y1-fe.y0)-pe));var ae=ce.links.filter(function(Q){return k(Q.source,xe)==k(fe,xe)}),ee=ae.length;ee>1&&ae.sort(function(Q,ue){if(!Q.circular&&!ue.circular){if(Q.target.column==ue.target.column)return Q.y1-ue.y1;if(te(Q,ue)){if(Q.target.column>ue.target.column){var ge=U(ue,Q);return Q.y1-ge}if(ue.target.column>Q.target.column){var Me=U(Q,ue);return Me-ue.y1}}else return Q.y1-ue.y1}if(Q.circular&&!ue.circular)return Q.circularLinkType=="top"?-1:1;if(ue.circular&&!Q.circular)return ue.circularLinkType=="top"?1:-1;if(Q.circular&&ue.circular)return Q.circularLinkType===ue.circularLinkType&&Q.circularLinkType=="top"?Q.target.column===ue.target.column?Q.target.y1-ue.target.y1:ue.target.column-Q.target.column:Q.circularLinkType===ue.circularLinkType&&Q.circularLinkType=="bottom"?Q.target.column===ue.target.column?ue.target.y1-Q.target.y1:Q.target.column-ue.target.column:Q.circularLinkType=="top"?-1:1});var ie=fe.y0;ae.forEach(function(Q){Q.y0=ie+Q.width/2,ie=ie+Q.width}),ae.forEach(function(Q,ue){if(Q.circularLinkType=="bottom"){var ge=ue+1,Me=0;for(ge;ge1&&fe.sort(function(ie,Q){if(!ie.circular&&!Q.circular){if(ie.source.column==Q.source.column)return ie.y0-Q.y0;if(te(ie,Q)){if(Q.source.column0?"up":"down"}function se(ce,pe){return k(ce.source,pe)==k(ce.target,pe)}function le(ce,pe,xe){var ye=ce.nodes,fe=ce.links,ae=!1,ee=!1;if(fe.forEach(function(Te){Te.circularLinkType=="top"?ae=!0:Te.circularLinkType=="bottom"&&(ee=!0)}),ae==!1||ee==!1){var ie=i.min(ye,function(Te){return Te.y0}),Q=i.max(ye,function(Te){return Te.y1}),ue=Q-ie,ge=xe-pe,Me=ge/ue;ye.forEach(function(Te){var je=(Te.y1-Te.y0)*Me;Te.y0=(Te.y0-ie)*Me,Te.y1=Te.y0+je}),fe.forEach(function(Te){Te.y0=(Te.y0-ie)*Me,Te.y1=(Te.y1-ie)*Me,Te.width=Te.width*Me})}}t.sankeyCircular=T,t.sankeyCenter=f,t.sankeyLeft=n,t.sankeyRight=u,t.sankeyJustify=c,Object.defineProperty(t,"__esModule",{value:!0})}))}}),V8=de({"src/traces/sankey/constants.js"(e,r){"use strict";r.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),yle=de({"src/traces/sankey/render.js"(e,r){"use strict";var t=fle(),i=(Uv(),ti(S0)).interpolateNumber,a=Yr(),o=ple(),s=gle(),l=V8(),n=ta(),u=hn(),c=Qt(),f=c.strTranslate,h=c.strRotate,d=ap(),p=d.keyFun,g=d.repeat,m=d.unwrap,y=Zo(),_=Sa(),v=Bl(),x=v.CAP_SHIFT,S=v.LINE_SPACING,M=3;function C(H,$,U){var V=m($),j=V.trace,q=j.domain,Y=j.orientation==="h",K=j.direction==="reversed",te=j.node.pad,ne=j.node.thickness,se={justify:o.sankeyJustify,left:o.sankeyLeft,right:o.sankeyRight,center:o.sankeyCenter}[j.node.align],le=H.width*(q.x[1]-q.x[0]),ce=H.height*(q.y[1]-q.y[0]),pe=V._nodes,xe=V._links,ye=V.circular,fe;ye?fe=s.sankeyCircular().circularLinkGap(0):fe=o.sankey(),fe.iterations(l.sankeyIterations).size(Y?[le,ce]:[ce,le]).nodeWidth(ne).nodePadding(te).nodeId(function(mt){return mt.pointNumber}).nodeAlign(se).nodes(pe).links(xe);function ae(mt){j[mt].sort==="input"&&(ye?c.warn(`Circular Sankey diagrams do not support the "input" ${mt}.sort mode; falling back to the default sort.`):fe[`${mt}Sort`](null))}ae("link"),ae("node");var ee=fe();fe.nodePadding()=Ye||(qe=Ye-lt.y0,qe>1e-6&&(lt.y0+=qe,lt.y1+=qe)),Ye=lt.y1+te})}function Je(mt){var Mt=mt.map(function(ke,Ee){return{x0:ke.x0,index:Ee}}).sort(function(ke,Ee){return ke.x0-Ee.x0}),lt=[],qe=-1,Ye,me=-1/0,_e;for(ie=0;ieme+ne&&(qe+=1,Ye=Ae.x0),me=Ae.x0,lt[qe]||(lt[qe]=[]),lt[qe].push(Ae),_e=Ye-Ae.x0,Ae.x0+=_e,Ae.x1+=_e}return lt}if(j.node.x.length&&j.node.y.length){for(ie=0;ie0?" L "+j.targetX+" "+j.targetY:"")+"Z"):(U="M "+(j.targetX-$)+" "+(j.targetY-V)+" L "+(j.rightInnerExtent-$)+" "+(j.targetY-V)+" A "+(j.rightLargeArcRadius+V)+" "+(j.rightSmallArcRadius+V)+" 0 0 0 "+(j.rightFullExtent-V-$)+" "+(j.targetY+j.rightSmallArcRadius)+" L "+(j.rightFullExtent-V-$)+" "+j.verticalRightInnerExtent,q&&Y?U+=" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.rightInnerExtent-V-$)+" "+(j.verticalFullExtent+V)+" L "+(j.rightFullExtent+V-$-(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent+V)+" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.leftFullExtent+V)+" "+j.verticalLeftInnerExtent:q?U+=" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.rightFullExtent-$-V-(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent-V)+" L "+(j.leftFullExtent+V+(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent-V)+" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.leftFullExtent+V)+" "+j.verticalLeftInnerExtent:U+=" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.rightInnerExtent-$)+" "+(j.verticalFullExtent+V)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent+V)+" A "+(j.leftLargeArcRadius+V)+" "+(j.leftLargeArcRadius+V)+" 0 0 0 "+(j.leftFullExtent+V)+" "+j.verticalLeftInnerExtent,U+=" L "+(j.leftFullExtent+V)+" "+(j.sourceY+j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+V)+" "+(j.leftSmallArcRadius+V)+" 0 0 0 "+j.leftInnerExtent+" "+(j.sourceY-V)+" L "+j.sourceX+" "+(j.sourceY-V)+" L "+j.sourceX+" "+(j.sourceY+V)+" L "+j.leftInnerExtent+" "+(j.sourceY+V)+" A "+(j.leftLargeArcRadius-V)+" "+(j.leftSmallArcRadius-V)+" 0 0 1 "+(j.leftFullExtent-V)+" "+(j.sourceY+j.leftSmallArcRadius)+" L "+(j.leftFullExtent-V)+" "+j.verticalLeftInnerExtent,q&&Y?U+=" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.leftFullExtent-V-(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent-V)+" L "+(j.rightFullExtent+V-$+(j.rightLargeArcRadius-V))+" "+(j.verticalFullExtent-V)+" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.rightFullExtent+V-$)+" "+j.verticalRightInnerExtent:q?U+=" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.leftFullExtent+V)+" "+(j.verticalFullExtent+V)+" L "+(j.rightFullExtent-$-V)+" "+(j.verticalFullExtent+V)+" A "+(j.rightLargeArcRadius+V)+" "+(j.rightLargeArcRadius+V)+" 0 0 0 "+(j.rightFullExtent+V-$)+" "+j.verticalRightInnerExtent:U+=" A "+(j.leftLargeArcRadius-V)+" "+(j.leftLargeArcRadius-V)+" 0 0 1 "+j.leftInnerExtent+" "+(j.verticalFullExtent-V)+" L "+(j.rightInnerExtent-$)+" "+(j.verticalFullExtent-V)+" A "+(j.rightLargeArcRadius-V)+" "+(j.rightLargeArcRadius-V)+" 0 0 1 "+(j.rightFullExtent+V-$)+" "+j.verticalRightInnerExtent,U+=" L "+(j.rightFullExtent+V-$)+" "+(j.targetY+j.rightSmallArcRadius)+" A "+(j.rightLargeArcRadius-V)+" "+(j.rightSmallArcRadius-V)+" 0 0 1 "+(j.rightInnerExtent-$)+" "+(j.targetY+V)+" L "+(j.targetX-$)+" "+(j.targetY+V)+($>0?" L "+j.targetX+" "+j.targetY:"")+"Z"),U}function A(){var H=.5;function $(U){var V=U.linkArrowLength;if(U.link.circular)return k(U.link,V);var j=Math.abs((U.link.target.x0-U.link.source.x1)/2);V>j&&(V=j);var q=U.link.source.x1,Y=U.link.target.x0-V,K=i(q,Y),te=K(H),ne=K(1-H),se=U.link.y0-U.link.width/2,le=U.link.y0+U.link.width/2,ce=U.link.y1-U.link.width/2,pe=U.link.y1+U.link.width/2,xe="M"+q+","+se,ye="C"+te+","+se+" "+ne+","+ce+" "+Y+","+ce,fe="C"+ne+","+pe+" "+te+","+le+" "+q+","+le,ae=V>0?"L"+(Y+V)+","+(ce+U.link.width/2):"";return ae+="L"+Y+","+pe,xe+ye+ae+fe+"Z"}return $}function b(H,$){var U=l.nodePadAcross,V=H.nodePad/2;$.dx=$.x1-$.x0,$.dy=$.y1-$.y0;var j=$.dx,q=Math.max(.5,$.dy),Y="node_"+$.pointNumber;return $.group&&(Y=c.randstr()),$.trace=H.trace,$.curveNumber=H.trace.index,{index:$.pointNumber,key:Y,partOfGroup:$.partOfGroup||!1,group:$.group,traceId:H.key,trace:H.trace,node:$,nodePad:H.nodePad,nodeLineColor:H.nodeLineColor,nodeLineWidth:H.nodeLineWidth,textFont:H.textFont,size:H.horizontal?H.height:H.width,visibleWidth:Math.ceil(j),visibleHeight:q,zoneX:-U,zoneY:-V,zoneWidth:j+2*U,zoneHeight:q+2*V,labelY:H.horizontal?$.dy/2+1:$.dx/2+1,left:$.originalLayer===1,sizeAcross:H.width,forceLayouts:H.forceLayouts,horizontal:H.horizontal,reversed:H.reversed,rgb:n.rgb($.color),alpha:n.parse($.color).alpha,valueFormat:H.valueFormat,valueSuffix:H.valueSuffix,sankey:H.sankey,graph:H.graph,arrangement:H.arrangement,uniqueNodeLabelPathId:[H.guid,H.key,Y].join("_"),interactionState:H.interactionState,figure:H}}function E(H){H.attr("transform",function($){return f($.node.x0.toFixed(3),$.node.y0.toFixed(3))})}function T(H){H.call(E)}function F(H,$){H.call(T),$.attr("d",A())}function D(H){H.attr("width",function($){return $.node.x1-$.node.x0}).attr("height",function($){return $.visibleHeight})}function R(H){return H.link.width>1||H.linkLineWidth>0}function P(H){return H.horizontal?H.reversed?f(H.translateX+H.width,H.translateY)+"matrix(-1 0 0 1 0 0)":f(H.translateX,H.translateY)+"matrix(1 0 0 1 0 0)":H.reversed?f(H.translateX,H.translateY+H.height)+"matrix(0 -1 1 0 0 0)":f(H.translateX,H.translateY)+"matrix(0 1 1 0 0 0)"}function z(H,$,U){H.on(".basic",null).on("mouseover.basic",function(V){!V.interactionState.dragInProgress&&!V.partOfGroup&&(U.hover(this,V,$),V.interactionState.hovered=[this,V])}).on("mousemove.basic",function(V){!V.interactionState.dragInProgress&&!V.partOfGroup&&(U.follow(this,V),V.interactionState.hovered=[this,V])}).on("mouseout.basic",function(V){!V.interactionState.dragInProgress&&!V.partOfGroup&&(U.unhover(this,V,$),V.interactionState.hovered=!1)}).on("click.basic",function(V){V.interactionState.hovered&&(U.unhover(this,V,$),V.interactionState.hovered=!1),!V.interactionState.dragInProgress&&!V.partOfGroup&&U.select(this,V,$)})}function I(H,$,U,V){var j=a.behavior.drag().origin(function(q){return{x:q.node.x0+q.visibleWidth/2,y:q.node.y0+q.visibleHeight/2}}).on("dragstart",function(q){if(q.arrangement!=="fixed"&&(c.ensureSingle(V._fullLayout._infolayer,"g","dragcover",function(K){V._fullLayout._dragCover=K}),c.raiseToTop(this),q.interactionState.dragInProgress=q.node,X(q.node),q.interactionState.hovered&&(U.nodeEvents.unhover.apply(0,q.interactionState.hovered),q.interactionState.hovered=!1),q.arrangement==="snap")){var Y=q.traceId+"|"+q.key;q.forceLayouts[Y]?q.forceLayouts[Y].alpha(1):L(H,Y,q,V),B(H,$,q,Y,V)}}).on("drag",function(q){if(q.arrangement!=="fixed"){var Y=a.event.x,K=a.event.y;q.arrangement==="snap"?(q.node.x0=Y-q.visibleWidth/2,q.node.x1=Y+q.visibleWidth/2,q.node.y0=K-q.visibleHeight/2,q.node.y1=K+q.visibleHeight/2):(q.arrangement==="freeform"&&(q.node.x0=Y-q.visibleWidth/2,q.node.x1=Y+q.visibleWidth/2),K=Math.max(0,Math.min(q.size-q.visibleHeight/2,K)),q.node.y0=K-q.visibleHeight/2,q.node.y1=K+q.visibleHeight/2),X(q.node),q.arrangement!=="snap"&&(q.sankey.update(q.graph),F(H.filter(Z(q)),$))}}).on("dragend",function(q){if(q.arrangement!=="fixed"){q.interactionState.dragInProgress=!1;for(var Y=0;Y0)window.requestAnimationFrame(q);else{var te=U.node.originalX;U.node.x0=te-U.visibleWidth/2,U.node.x1=te+U.visibleWidth/2,G(U,j)}})}function O(H,$,U,V){return function(){for(var q=0,Y=0;Y0&&V.forceLayouts[$].alpha(0)}}function G(H,$){for(var U=[],V=[],j=0;jR(fe)?n.rgb(fe.linkLineColor):fe.rgb).style("stroke-opacity",fe=>R(fe)?n.opacity(fe.linkLineColor):fe.alpha).style("fill",fe=>fe.rgb).style("fill-opacity",fe=>fe.alpha).style("stroke-width",fe=>R(fe)?fe.linkLineWidth:1).attr("d",A()),le.style("opacity",function(){return H._context.staticPlot||Y||K?1:0}).transition().ease(l.ease).duration(l.duration).style("opacity",1),le.exit().transition().ease(l.ease).duration(l.duration).style("opacity",0).remove();var ce=ne.selectAll("."+l.cn.sankeyNodeSet).data(g,p);ce.enter().append("g").classed(l.cn.sankeyNodeSet,!0),ce.style("cursor",function(fe){switch(fe.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var pe=ce.selectAll("."+l.cn.sankeyNode).data(function(fe){var ae=fe.graph.nodes;return W(ae),ae.map(b.bind(null,fe))},p);pe.enter().append("g").classed(l.cn.sankeyNode,!0).call(E).style("opacity",function(fe){return(H._context.staticPlot||Y)&&!fe.partOfGroup?1:0}),pe.call(z,ne,j.nodeEvents).call(I,le,j,H),pe.transition().ease(l.ease).duration(l.duration).call(E).style("opacity",function(fe){return fe.partOfGroup?0:1}),pe.exit().transition().ease(l.ease).duration(l.duration).style("opacity",0).remove();var xe=pe.selectAll("."+l.cn.nodeRect).data(g);xe.enter().append("rect").classed(l.cn.nodeRect,!0).call(D),xe.style("stroke-width",function(fe){return fe.nodeLineWidth}).style("stroke",function(fe){return n.rgb(fe.nodeLineColor)}).style("stroke-opacity",function(fe){return n.opacity(fe.nodeLineColor)}).style("fill",fe=>fe.rgb).style("fill-opacity",fe=>fe.alpha),xe.transition().ease(l.ease).duration(l.duration).call(D);var ye=pe.selectAll("."+l.cn.nodeLabel).data(g);ye.enter().append("text").classed(l.cn.nodeLabel,!0).style("cursor","default"),ye.attr("data-notex",1).text(function(fe){return fe.node.label}).each(function(fe){var ae=a.select(this);u.font(ae,fe.textFont),y.convertToTspans(ae,H)}).attr("text-anchor",function(fe){return fe.horizontal&&fe.left!==fe.reversed?"end":"start"}).attr("transform",function(fe){var ae=a.select(this),ee=y.lineCount(ae),ie=fe.textFont.size*((ee-1)*S-x),Q=fe.nodeLineWidth/2+M;if(!fe.horizontal){var Me=fe.reversed?(fe.visibleWidth+ie)/2:(fe.visibleWidth-ie)/2,ue=fe.reversed?h(90):"scale(-1,1)"+h(90);return f(Me,Q)+ue}var ge=Q,Me=(fe.visibleHeight-ie)/2;return fe.left?ge=-ge:ge+=fe.visibleWidth,f(ge,Me)+(fe.reversed?"scale(-1,1)":"")}),ye.transition().ease(l.ease).duration(l.duration)}}}),G8=de({"src/traces/sankey/plot.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=i.numberFormat,o=yle(),s=$s(),l=ta(),n=V8().cn,u=i._;function c(S){return S!==""}function f(S,M){return S.filter(function(C){return C.key===M.traceId})}function h(S,M){t.select(S).select("path").style("fill-opacity",M),t.select(S).select("rect").style("fill-opacity",M)}function d(S){t.select(S).select("text.name").style("fill","black")}function p(S){return function(M){return S.node.sourceLinks.indexOf(M.link)!==-1||S.node.targetLinks.indexOf(M.link)!==-1}}function g(S){return function(M){return M.node.sourceLinks.indexOf(S.link)!==-1||M.node.targetLinks.indexOf(S.link)!==-1}}function m(S,M,C){M&&C&&f(C,M).selectAll("."+n.sankeyLink).filter(p(M)).call(_.bind(0,M,C,!1))}function y(S,M,C){M&&C&&f(C,M).selectAll("."+n.sankeyLink).filter(p(M)).call(v.bind(0,M,C,!1))}function _(S,M,C,w){w.style("fill",function(k){if(!k.link.concentrationscale)return k.hoverRgb}).style("fill-opacity",function(k){if(!k.link.concentrationscale)return k.hoverAlpha}),w.each(function(k){var A=k.link.label;A!==""&&f(M,S).selectAll("."+n.sankeyLink).filter(function(b){return b.link.label===A}).style("fill",function(b){if(!b.link.concentrationscale)return b.hoverRgb}).style("fill-opacity",function(b){if(!b.link.concentrationscale)return b.hoverAlpha})}),C&&f(M,S).selectAll("."+n.sankeyNode).filter(g(S)).call(m)}function v(S,M,C,w){w.style("fill",function(k){return k.rgb}).style("fill-opacity",function(k){return k.alpha}),w.each(function(k){var A=k.link.label;A!==""&&f(M,S).selectAll("."+n.sankeyLink).filter(function(b){return b.link.label===A}).style("fill",b=>b.rgb).style("fill-opacity",b=>b.alpha)}),C&&f(M,S).selectAll(n.sankeyNode).filter(g(S)).call(y)}function x(S,M){var C=S.hoverlabel||{},w=i.nestedProperty(C,M).get();return Array.isArray(w)?!1:w}r.exports=function(M,C){for(var w=M._fullLayout,k=w._paper,A=w._size,b=0;b"),color:x(N,"bgcolor")||l.addOpacity(j.color,1),borderColor:x(N,"bordercolor"),fontFamily:x(N,"font.family"),fontSize:x(N,"font.size"),fontColor:x(N,"font.color"),fontWeight:x(N,"font.weight"),fontStyle:x(N,"font.style"),fontVariant:x(N,"font.variant"),fontTextcase:x(N,"font.textcase"),fontLineposition:x(N,"font.lineposition"),fontShadow:x(N,"font.shadow"),nameLength:x(N,"namelength"),textAlign:x(N,"align"),idealAlign:t.event.x"),color:x(N,"bgcolor")||J.rgb,borderColor:x(N,"bordercolor"),fontFamily:x(N,"font.family"),fontSize:x(N,"font.size"),fontColor:x(N,"font.color"),fontWeight:x(N,"font.weight"),fontStyle:x(N,"font.style"),fontVariant:x(N,"font.variant"),fontTextcase:x(N,"font.textcase"),fontLineposition:x(N,"font.lineposition"),fontShadow:x(N,"font.shadow"),nameLength:x(N,"namelength"),textAlign:x(N,"align"),idealAlign:"left",hovertemplate:N.hovertemplate,hovertemplateLabels:Y,eventData:[J.node]},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:M});h(ne,.85),d(ne)}}},X=function(Z,J,N){M._fullLayout.hovermode!==!1&&(t.select(Z).call(y,J,N),J.node.trace.node.hoverinfo!=="skip"&&(J.node.fullData=J.node.trace,M.emit("plotly_unhover",{event:t.event,points:[J.node]})),s.loneUnhover(w._hoverlayer.node()))};o(M,k,C,{width:A.w,height:A.h,margin:{t:A.t,r:A.r,b:A.b,l:A.l}},{linkEvents:{hover:F,follow:L,unhover:B,select:T},nodeEvents:{hover:G,follow:W,unhover:X,select:O}})}}}),_le=de({"src/traces/sankey/base_plot.js"(e){"use strict";var r=Is().overrideAll,t=$u().getModuleCalcData,i=G8(),a=La(),o=gd(),s=Uc(),l=Zl().prepSelect,n=Qt(),u=Sa(),c="sankey";e.name=c,e.baseLayoutAttrOverrides=r({hoverlabel:a.hoverlabel},"plot","nested"),e.plot=function(h){var d=t(h.calcdata,c)[0];i(h,d),e.updateFx(h)},e.clean=function(h,d,p,g){var m=g._has&&g._has(c),y=d._has&&d._has(c);m&&!y&&(g._paperdiv.selectAll(".sankey").remove(),g._paperdiv.selectAll(".bgsankey").remove())},e.updateFx=function(h){for(var d=0;d0}r.exports=function(P,z,I,L){var B=P._fullLayout,O;S(I)&&L&&(O=L()),o.makeTraceGroups(B._indicatorlayer,z,"trace").each(function(G){var W=G[0],X=W.trace,Z=t.select(this),J=X._hasGauge,N=X._isAngular,H=X._isBullet,$=X.domain,U={w:B._size.w*($.x[1]-$.x[0]),h:B._size.h*($.y[1]-$.y[0]),l:B._size.l+B._size.w*$.x[0],r:B._size.r+B._size.w*(1-$.x[1]),t:B._size.t+B._size.h*(1-$.y[1]),b:B._size.b+B._size.h*$.y[0]},V=U.l+U.w/2,j=U.t+U.h/2,q=Math.min(U.w/2,U.h),Y=f.innerRadius*q,K,te,ne,se=X.align||"center";if(te=j,!J)K=U.l+v[se]*U.w,ne=function(Q){return E(Q,U.w,U.h)};else if(N&&(K=V,te=j+q/2,ne=function(Q){return T(Q,.9*Y)}),H){var le=f.bulletPadding,ce=1-f.bulletNumberDomainSize+le;K=U.l+(ce+(1-ce)*v[se])*U.w,ne=function(Q){return E(Q,(f.bulletNumberDomainSize-le)*U.w,U.h)}}w(P,Z,G,{numbersX:K,numbersY:te,numbersScaler:ne,transitionOpts:I,onComplete:O});var pe,xe;J&&(pe={range:X.gauge.axis.range,color:X.gauge.bgcolor,line:{color:X.gauge.bordercolor,width:0},thickness:1},xe={range:X.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:X.gauge.bordercolor,width:X.gauge.borderwidth},thickness:1});var ye=Z.selectAll("g.angular").data(N?G:[]);ye.exit().remove();var fe=Z.selectAll("g.angularaxis").data(N?G:[]);fe.exit().remove(),N&&C(P,Z,G,{radius:q,innerRadius:Y,gauge:ye,layer:fe,size:U,gaugeBg:pe,gaugeOutline:xe,transitionOpts:I,onComplete:O});var ae=Z.selectAll("g.bullet").data(H?G:[]);ae.exit().remove();var ee=Z.selectAll("g.bulletaxis").data(H?G:[]);ee.exit().remove(),H&&M(P,Z,G,{gauge:ae,layer:ee,size:U,gaugeBg:pe,gaugeOutline:xe,transitionOpts:I,onComplete:O});var ie=Z.selectAll("text.title").data(G);ie.exit().remove(),ie.enter().append("text").classed("title",!0),ie.attr("text-anchor",function(){return H?_.right:_[X.title.align]}).text(X.title.text).call(c.font,X.title.font).call(h.convertToTspans,P),ie.attr("transform",function(){var Q=U.l+U.w*v[X.title.align],ue,ge=f.titlePadding,Me=c.bBox(ie.node());if(J){if(N)if(X.gauge.axis.visible){var Te=c.bBox(fe.node());ue=Te.top-ge-Me.bottom}else ue=U.t+U.h/2-q/2-Me.bottom-ge;H&&(ue=te-(Me.top+Me.bottom)/2,Q=U.l-f.bulletPadding*U.w)}else ue=X._numbersTop-ge-Me.bottom;return l(Q,ue)})})};function M(R,P,z,I){var L=z[0].trace,B=I.gauge,O=I.layer,G=I.gaugeBg,W=I.gaugeOutline,X=I.size,Z=L.domain,J=I.transitionOpts,N=I.onComplete,H,$,U,V,j;B.enter().append("g").classed("bullet",!0),B.attr("transform",l(X.l,X.t)),O.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),O.selectAll("g.xbulletaxistick,path,text").remove();var q=X.h,Y=L.gauge.bar.thickness*q,K=Z.x[0],te=Z.x[0]+(Z.x[1]-Z.x[0])*(L._hasNumber||L._hasDelta?1-f.bulletNumberDomainSize:1);H=b(R,L.gauge.axis),H._id="xbulletaxis",H.domain=[K,te],H.setScale(),$=d.calcTicks(H),U=d.makeTransTickFn(H),V=d.getTickSigns(H)[2],j=X.t+X.h,H.visible&&(d.drawTicks(R,H,{vals:H.ticks==="inside"?d.clipEnds(H,$):$,layer:O,path:d.makeTickPath(H,j,V),transFn:U}),d.drawLabels(R,H,{vals:$,layer:O,transFn:U,labelFns:d.makeLabelFns(H,j)}));function ne(fe){fe.attr("width",function(ae){return Math.max(0,H.c2p(ae.range[1])-H.c2p(ae.range[0]))}).attr("x",function(ae){return H.c2p(ae.range[0])}).attr("y",function(ae){return .5*(1-ae.thickness)*q}).attr("height",function(ae){return ae.thickness*q})}var se=[G].concat(L.gauge.steps),le=B.selectAll("g.bg-bullet").data(se);le.enter().append("g").classed("bg-bullet",!0).append("rect"),le.select("rect").call(ne).call(k),le.exit().remove();var ce=B.selectAll("g.value-bullet").data([L.gauge.bar]);ce.enter().append("g").classed("value-bullet",!0).append("rect"),ce.select("rect").attr("height",Y).attr("y",(q-Y)/2).call(k),S(J)?ce.select("rect").transition().duration(J.duration).ease(J.easing).each("end",function(){N&&N()}).each("interrupt",function(){N&&N()}).attr("width",Math.max(0,H.c2p(Math.min(L.gauge.axis.range[1],z[0].y)))):ce.select("rect").attr("width",typeof z[0].y=="number"?Math.max(0,H.c2p(Math.min(L.gauge.axis.range[1],z[0].y))):0),ce.exit().remove();var pe=z.filter(function(){return L.gauge.threshold.value||L.gauge.threshold.value===0}),xe=B.selectAll("g.threshold-bullet").data(pe);xe.enter().append("g").classed("threshold-bullet",!0).append("line"),xe.select("line").attr("x1",H.c2p(L.gauge.threshold.value)).attr("x2",H.c2p(L.gauge.threshold.value)).attr("y1",(1-L.gauge.threshold.thickness)/2*q).attr("y2",(1-(1-L.gauge.threshold.thickness)/2)*q).call(y.stroke,L.gauge.threshold.line.color).style("stroke-width",L.gauge.threshold.line.width),xe.exit().remove();var ye=B.selectAll("g.gauge-outline").data([W]);ye.enter().append("g").classed("gauge-outline",!0).append("rect"),ye.select("rect").call(ne).call(k),ye.exit().remove()}function C(R,P,z,I){var L=z[0].trace,B=I.size,O=I.radius,G=I.innerRadius,W=I.gaugeBg,X=I.gaugeOutline,Z=[B.l+B.w/2,B.t+B.h/2+O/2],J=I.gauge,N=I.layer,H=I.transitionOpts,$=I.onComplete,U=Math.PI/2;function V(je){var Ve=L.gauge.axis.range[0],Ke=L.gauge.axis.range[1],Je=(je-Ve)/(Ke-Ve)*Math.PI-U;return Je<-U?-U:Je>U?U:Je}function j(je){return t.svg.arc().innerRadius((G+O)/2-je/2*(O-G)).outerRadius((G+O)/2+je/2*(O-G)).startAngle(-U)}function q(je){je.attr("d",function(Ve){return j(Ve.thickness).startAngle(V(Ve.range[0])).endAngle(V(Ve.range[1]))()})}var Y,K,te,ne;J.enter().append("g").classed("angular",!0),J.attr("transform",l(Z[0],Z[1])),N.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),N.selectAll("g.xangularaxistick,path,text").remove(),Y=b(R,L.gauge.axis),Y.type="linear",Y.range=L.gauge.axis.range,Y._id="xangularaxis",Y.ticklabeloverflow="allow",Y.setScale();var se=function(je){return(Y.range[0]-je.x)/(Y.range[1]-Y.range[0])*Math.PI+Math.PI},le={},ce=d.makeLabelFns(Y,0),pe=ce.labelStandoff;le.xFn=function(je){var Ve=se(je);return Math.cos(Ve)*pe},le.yFn=function(je){var Ve=se(je),Ke=Math.sin(Ve)>0?.2:1;return-Math.sin(Ve)*(pe+je.fontSize*Ke)+Math.abs(Math.cos(Ve))*(je.fontSize*u)},le.anchorFn=function(je){var Ve=se(je),Ke=Math.cos(Ve);return Math.abs(Ke)<.1?"middle":Ke>0?"start":"end"},le.heightFn=function(je,Ve,Ke){var Je=se(je);return-.5*(1+Math.sin(Je))*Ke};var xe=function(je){return l(Z[0]+O*Math.cos(je),Z[1]-O*Math.sin(je))};te=function(je){return xe(se(je))};var ye=function(je){var Ve=se(je);return xe(Ve)+"rotate("+-n(Ve)+")"};if(K=d.calcTicks(Y),ne=d.getTickSigns(Y)[2],Y.visible){ne=Y.ticks==="inside"?-1:1;var fe=(Y.linewidth||1)/2;d.drawTicks(R,Y,{vals:K,layer:N,path:"M"+ne*fe+",0h"+ne*Y.ticklen,transFn:ye}),d.drawLabels(R,Y,{vals:K,layer:N,transFn:te,labelFns:le})}var ae=[W].concat(L.gauge.steps),ee=J.selectAll("g.bg-arc").data(ae);ee.enter().append("g").classed("bg-arc",!0).append("path"),ee.select("path").call(q).call(k),ee.exit().remove();var ie=j(L.gauge.bar.thickness),Q=J.selectAll("g.value-arc").data([L.gauge.bar]);Q.enter().append("g").classed("value-arc",!0).append("path");var ue=Q.select("path");S(H)?(ue.transition().duration(H.duration).ease(H.easing).each("end",function(){$&&$()}).each("interrupt",function(){$&&$()}).attrTween("d",A(ie,V(z[0].lastY),V(z[0].y))),L._lastValue=z[0].y):ue.attr("d",typeof z[0].y=="number"?ie.endAngle(V(z[0].y)):"M0,0Z"),ue.call(k),Q.exit().remove(),ae=[];var ge=L.gauge.threshold.value;(ge||ge===0)&&ae.push({range:[ge,ge],color:L.gauge.threshold.color,line:{color:L.gauge.threshold.line.color,width:L.gauge.threshold.line.width},thickness:L.gauge.threshold.thickness});var Me=J.selectAll("g.threshold-arc").data(ae);Me.enter().append("g").classed("threshold-arc",!0).append("path"),Me.select("path").call(q).call(k),Me.exit().remove();var Te=J.selectAll("g.gauge-outline").data([X]);Te.enter().append("g").classed("gauge-outline",!0).append("path"),Te.select("path").call(q).call(k),Te.exit().remove()}function w(R,P,z,I){var L=z[0].trace,B=I.numbersX,O=I.numbersY,G=L.align||"center",W=_[G],X=I.transitionOpts,Z=I.onComplete,J=o.ensureSingle(P,"g","numbers"),N,H,$,U=[];L._hasNumber&&U.push("number"),L._hasDelta&&(U.push("delta"),L.delta.position==="left"&&U.reverse());var V=J.selectAll("text").data(U);V.enter().append("text"),V.attr("text-anchor",function(){return W}).attr("class",function(xe){return xe}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),V.exit().remove();function j(xe,ye,fe,ae){if(xe.match("s")&&fe>=0!=ae>=0&&!ye(fe).slice(-1).match(x)&&!ye(ae).slice(-1).match(x)){var ee=xe.slice().replace("s","f").replace(/\d+/,function(Q){return parseInt(Q)-1}),ie=b(R,{tickformat:ee});return function(Q){return Math.abs(Q)<1?d.tickText(ie,Q).text:ye(Q)}}else return ye}function q(){var xe=b(R,{tickformat:L.number.valueformat},L._range);xe.setScale(),d.prepTicks(xe);var ye=function(Q){return d.tickText(xe,Q).text},fe=L.number.suffix,ae=L.number.prefix,ee=J.select("text.number");function ie(){var Q=typeof z[0].y=="number"?ae+ye(z[0].y)+fe:"-";ee.text(Q).call(c.font,L.number.font).call(h.convertToTspans,R)}return S(X)?ee.transition().duration(X.duration).ease(X.easing).each("end",function(){ie(),Z&&Z()}).each("interrupt",function(){ie(),Z&&Z()}).attrTween("text",function(){var Q=t.select(this),ue=a(z[0].lastY,z[0].y);L._lastValue=z[0].y;var ge=j(L.number.valueformat,ye,z[0].lastY,z[0].y);return function(Me){Q.text(ae+ge(ue(Me))+fe)}}):ie(),N=F(ae+ye(z[0].y)+fe,L.number.font,W,R),ee}function Y(){var xe=b(R,{tickformat:L.delta.valueformat},L._range);xe.setScale(),d.prepTicks(xe);var ye=function(Me){return d.tickText(xe,Me).text},fe=L.delta.suffix,ae=L.delta.prefix,ee=function(Me){var Te=L.delta.relative?Me.relativeDelta:Me.delta;return Te},ie=function(Me,Te){return Me===0||typeof Me!="number"||isNaN(Me)?"-":(Me>0?L.delta.increasing.symbol:L.delta.decreasing.symbol)+ae+Te(Me)+fe},Q=function(Me){return Me.delta>=0?L.delta.increasing.color:L.delta.decreasing.color};L._deltaLastValue===void 0&&(L._deltaLastValue=ee(z[0]));var ue=J.select("text.delta");ue.call(c.font,L.delta.font).call(y.fill,Q({delta:L._deltaLastValue}));function ge(){ue.text(ie(ee(z[0]),ye)).call(y.fill,Q(z[0])).call(h.convertToTspans,R)}return S(X)?ue.transition().duration(X.duration).ease(X.easing).tween("text",function(){var Me=t.select(this),Te=ee(z[0]),je=L._deltaLastValue,Ve=j(L.delta.valueformat,ye,je,Te),Ke=a(je,Te);return L._deltaLastValue=Te,function(Je){Me.text(ie(Ke(Je),Ve)),Me.call(y.fill,Q({delta:Ke(Je)}))}}).each("end",function(){ge(),Z&&Z()}).each("interrupt",function(){ge(),Z&&Z()}):ge(),H=F(ie(ee(z[0]),ye),L.delta.font,W,R),ue}var K=L.mode+L.align,te;if(L._hasDelta&&(te=Y(),K+=L.delta.position+L.delta.font.size+L.delta.font.family+L.delta.valueformat,K+=L.delta.increasing.symbol+L.delta.decreasing.symbol,$=H),L._hasNumber&&(q(),K+=L.number.font.size+L.number.font.family+L.number.valueformat+L.number.suffix+L.number.prefix,$=N),L._hasDelta&&L._hasNumber){var ne=[(N.left+N.right)/2,(N.top+N.bottom)/2],se=[(H.left+H.right)/2,(H.top+H.bottom)/2],le,ce,pe=.75*L.delta.font.size;L.delta.position==="left"&&(le=D(L,"deltaPos",0,-1*(N.width*v[L.align]+H.width*(1-v[L.align])+pe),K,Math.min),ce=ne[1]-se[1],$={width:N.width+H.width+pe,height:Math.max(N.height,H.height),left:H.left+le,right:N.right,top:Math.min(N.top,H.top+ce),bottom:Math.max(N.bottom,H.bottom+ce)}),L.delta.position==="right"&&(le=D(L,"deltaPos",0,N.width*(1-v[L.align])+H.width*v[L.align]+pe,K,Math.max),ce=ne[1]-se[1],$={width:N.width+H.width+pe,height:Math.max(N.height,H.height),left:N.left,right:H.right+le,top:Math.min(N.top,H.top+ce),bottom:Math.max(N.bottom,H.bottom+ce)}),L.delta.position==="bottom"&&(le=null,ce=H.height,$={width:Math.max(N.width,H.width),height:N.height+H.height,left:Math.min(N.left,H.left),right:Math.max(N.right,H.right),top:N.bottom-N.height,bottom:N.bottom+H.height}),L.delta.position==="top"&&(le=null,ce=N.top,$={width:Math.max(N.width,H.width),height:N.height+H.height,left:Math.min(N.left,H.left),right:Math.max(N.right,H.right),top:N.bottom-N.height-H.height,bottom:N.bottom}),te.attr({dx:le,dy:ce})}(L._hasNumber||L._hasDelta)&&J.attr("transform",function(){var xe=I.numbersScaler($);K+=xe[2];var ye=D(L,"numbersScale",1,xe[0],K,Math.min),fe;L._scaleNumbers||(ye=1),L._isAngular?fe=O-ye*$.bottom:fe=O-ye*($.top+$.bottom)/2,L._numbersTop=ye*$.top+fe;var ae=$[G];G==="center"&&(ae=($.left+$.right)/2);var ee=B-ye*ae;return ee=D(L,"numbersTranslate",0,ee,K,Math.max),l(ee,fe)+s(ye)})}function k(R){R.each(function(P){y.stroke(t.select(this),P.line.color)}).each(function(P){y.fill(t.select(this),P.color)}).style("stroke-width",function(P){return P.line.width})}function A(R,P,z){return function(){var I=i(P,z);return function(L){return R.endAngle(I(L))()}}}function b(R,P,z){var I=R._fullLayout,L=o.extendFlat({type:"linear",ticks:"outside",range:z,showline:!0},P),B={type:"linear",_id:"x"+P._id},O={letter:"x",font:I.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function G(W,X){return o.coerce(L,B,m,W,X)}return p(L,B,G,O,I),g(L,B,G,O),B}function E(R,P,z){var I=Math.min(P/R.width,z/R.height);return[I,R,P+"x"+z]}function T(R,P){var z=Math.sqrt(R.width/2*(R.width/2)+R.height*R.height),I=P/z;return[I,R,P]}function F(R,P,z,I){var L=document.createElementNS("http://www.w3.org/2000/svg","text"),B=t.select(L);return B.text(R).attr("x",0).attr("y",0).attr("text-anchor",z).attr("data-unformatted",R).call(h.convertToTspans,I).call(c.font,P),c.bBox(B.node())}function D(R,P,z,I,L,B){var O="_cache"+P;R[O]&&R[O].key===L||(R[O]={key:L,value:z});var G=o.aggNums(B,null,[R[O].value,I],2);return R[O].value=G,G}}}),Ele=de({"src/traces/indicator/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"indicator",basePlotModule:Tle(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:H8(),supplyDefaults:Ale().supplyDefaults,calc:Mle().calc,plot:Sle(),meta:{}}}}),kle=de({"lib/indicator.js"(e,r){"use strict";r.exports=Ele()}}),W8=de({"src/traces/table/attributes.js"(e,r){"use strict";var t=y0(),i=fn().extendFlat,a=Is().overrideAll,o=us(),s=Rs().attributes,l=Ns().descriptionOnlyNumbers,n=r.exports=a({domain:s({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:i({},t.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:i({},o({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:i({},t.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:i({},o({arrayOk:!0}))}},"calc","from-root")}}),Cle=de({"src/traces/table/defaults.js"(e,r){"use strict";var t=Qt(),i=W8(),a=Rs().defaults;function o(s,l){for(var n=s.columnorder||[],u=s.header.values.length,c=n.slice(0,u),f=c.slice().sort(function(p,g){return p-g}),h=c.map(function(p){return f.indexOf(p)}),d=h.length;d",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),Lle=de({"src/traces/table/data_preparation_helper.js"(e,r){"use strict";var t=Y8(),i=fn().extendFlat,a=da(),o=Do().isTypedArray,s=Do().isArrayOrTypedArray;r.exports=function(m,y){var _=u(y.cells.values),v=function(W){return W.slice(y.header.values.length,W.length)},x=u(y.header.values);x.length&&!x[0].length&&(x[0]=[""],x=u(x));var S=x.concat(v(_).map(function(){return c((x[0]||[""]).length)})),M=y.domain,C=Math.floor(m._fullLayout._size.w*(M.x[1]-M.x[0])),w=Math.floor(m._fullLayout._size.h*(M.y[1]-M.y[0])),k=y.header.values.length?S[0].map(function(){return y.header.height}):[t.emptyHeaderHeight],A=_.length?_[0].map(function(){return y.cells.height}):[],b=k.reduce(n,0),E=w-b,T=E+t.uplift,F=d(A,T),D=d(k,b),R=h(D,[]),P=h(F,R),z={},I=y.columnorder;s(I)&&(I=Array.from(I)),I=I.concat(v(_.map(function(W,X){return X})));var L=S.map(function(W,X){var Z=s(y.columnwidth)?y.columnwidth[Math.min(X,y.columnwidth.length-1)]:y.columnwidth;return a(Z)?Number(Z):1}),B=L.reduce(n,0);L=L.map(function(W){return W/B*C});var O=Math.max(l(y.header.line.width),l(y.cells.line.width)),G={key:y.uid+m._context.staticPlot,translateX:M.x[0]*m._fullLayout._size.w,translateY:m._fullLayout._size.h*(1-M.y[1]),size:m._fullLayout._size,width:C,maxLineWidth:O,height:w,columnOrder:I,groupHeight:w,rowBlocks:P,headerRowBlocks:R,scrollY:0,cells:i({},y.cells,{values:_}),headerCells:i({},y.header,{values:S}),gdColumns:S.map(function(W){return W[0]}),gdColumnsOriginalOrder:S.map(function(W){return W[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:S.map(function(W,X){var Z=z[W];z[W]=(Z||0)+1;var J=W+"__"+z[W];return{key:J,label:W,specIndex:X,xIndex:I[X],xScale:f,x:void 0,calcdata:void 0,columnWidth:L[X]}})};return G.columns.forEach(function(W){W.calcdata=G,W.x=f(W)}),G};function l(g){if(s(g)){for(var m=0,y=0;y=m||w===g.length-1)&&(y[v]=S,S.key=C++,S.firstRowIndex=M,S.lastRowIndex=w,S=p(),v+=x,M=w+1,x=0);return y}function p(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),Fle=de({"src/traces/table/data_split_helpers.js"(e){"use strict";var r=fn().extendFlat;e.splitToPanels=function(i){var a=[0,0],o=r({},i,{key:"header",type:"header",page:0,prevPages:a,currentRepaint:[null,null],dragHandle:!0,values:i.calcdata.headerCells.values[i.specIndex],rowBlocks:i.calcdata.headerRowBlocks,calcdata:r({},i.calcdata,{cells:i.calcdata.headerCells})}),s=r({},i,{key:"cells1",type:"cells",page:0,prevPages:a,currentRepaint:[null,null],dragHandle:!1,values:i.calcdata.cells.values[i.specIndex],rowBlocks:i.calcdata.rowBlocks}),l=r({},i,{key:"cells2",type:"cells",page:1,prevPages:a,currentRepaint:[null,null],dragHandle:!1,values:i.calcdata.cells.values[i.specIndex],rowBlocks:i.calcdata.rowBlocks});return[s,l,o]},e.splitToCells=function(i){var a=t(i);return(i.values||[]).slice(a[0],a[1]).map(function(o,s){var l=typeof o=="string"&&o.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:s+l,key:a[0]+s,column:i,calcdata:i.calcdata,page:i.page,rowBlocks:i.rowBlocks,value:o}})};function t(i){var a=i.rowBlocks[i.page],o=a?a.rows[0].rowIndex:0,s=a?o+a.rows.length:0;return[o,s]}}}),X8=de({"src/traces/table/plot.js"(e,r){"use strict";var t=Y8(),i=Yr(),a=Qt(),o=a.numberFormat,s=ap(),l=hn(),n=Zo(),u=Qt().raiseToTop,c=Qt().strTranslate,f=Qt().cancelTransition,h=Lle(),d=Fle(),p=ta();r.exports=function(K,te){var ne=!K._context.staticPlot,se=K._fullLayout._paper.selectAll("."+t.cn.table).data(te.map(function(Te){var je=s.unwrap(Te),Ve=je.trace;return h(K,Ve)}),s.keyFun);se.exit().remove(),se.enter().append("g").classed(t.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),se.attr("width",function(Te){return Te.width+Te.size.l+Te.size.r}).attr("height",function(Te){return Te.height+Te.size.t+Te.size.b}).attr("transform",function(Te){return c(Te.translateX,Te.translateY)});var le=se.selectAll("."+t.cn.tableControlView).data(s.repeat,s.keyFun),ce=le.enter().append("g").classed(t.cn.tableControlView,!0).style("box-sizing","content-box");if(ne){var pe="onwheel"in document?"wheel":"mousewheel";ce.on("mousemove",function(Te){le.filter(function(je){return Te===je}).call(v,K)}).on(pe,function(Te){if(!Te.scrollbarState.wheeling){Te.scrollbarState.wheeling=!0;var je=Te.scrollY+i.event.deltaY,Ve=W(K,le,null,je)(Te);Ve||(i.event.stopPropagation(),i.event.preventDefault()),Te.scrollbarState.wheeling=!1}}).call(v,K,!0)}le.attr("transform",function(Te){return c(Te.size.l,Te.size.t)});var xe=le.selectAll("."+t.cn.scrollBackground).data(s.repeat,s.keyFun);xe.enter().append("rect").classed(t.cn.scrollBackground,!0).attr("fill","none"),xe.attr("width",function(Te){return Te.width}).attr("height",function(Te){return Te.height}),le.each(function(Te){l.setClipUrl(i.select(this),m(K,Te),K)});var ye=le.selectAll("."+t.cn.yColumn).data(function(Te){return Te.columns},s.keyFun);ye.enter().append("g").classed(t.cn.yColumn,!0),ye.exit().remove(),ye.attr("transform",function(Te){return c(Te.x,0)}),ne&&ye.call(i.behavior.drag().origin(function(Te){var je=i.select(this);return z(je,Te,-t.uplift),u(this),Te.calcdata.columnDragInProgress=!0,v(le.filter(function(Ve){return Te.calcdata.key===Ve.key}),K),Te}).on("drag",function(Te){var je=i.select(this),Ve=function(vt){return(Te===vt?i.event.x:vt.x)+vt.columnWidth/2};Te.x=Math.max(-t.overdrag,Math.min(Te.calcdata.width+t.overdrag-Te.columnWidth,i.event.x));var Ke=_(ye).filter(function(vt){return vt.calcdata.key===Te.calcdata.key}),Je=Ke.sort(function(vt,xt){return Ve(vt)-Ve(xt)});Je.forEach(function(vt,xt){vt.xIndex=xt,vt.x=Te===vt?vt.x:vt.xScale(vt)}),ye.filter(function(vt){return Te!==vt}).transition().ease(t.transitionEase).duration(t.transitionDuration).attr("transform",function(vt){return c(vt.x,0)}),je.call(f).attr("transform",c(Te.x,-t.uplift))}).on("dragend",function(Te){var je=i.select(this),Ve=Te.calcdata;Te.x=Te.xScale(Te),Te.calcdata.columnDragInProgress=!1,z(je,Te,0),R(K,Ve,Ve.columns.map(function(Ke){return Ke.xIndex}))})),ye.each(function(Te){l.setClipUrl(i.select(this),y(K,Te),K)});var fe=ye.selectAll("."+t.cn.columnBlock).data(d.splitToPanels,s.keyFun);fe.enter().append("g").classed(t.cn.columnBlock,!0).attr("id",function(Te){return Te.key}),fe.style("cursor",function(Te){return Te.dragHandle?"ew-resize":Te.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var ae=fe.filter(L),ee=fe.filter(I);ne&&ee.call(i.behavior.drag().origin(function(Te){return i.event.stopPropagation(),Te}).on("drag",W(K,le,-1)).on("dragend",function(){})),x(K,le,ae,fe),x(K,le,ee,fe);var ie=le.selectAll("."+t.cn.scrollAreaClip).data(s.repeat,s.keyFun);ie.enter().append("clipPath").classed(t.cn.scrollAreaClip,!0).attr("id",function(Te){return m(K,Te)});var Q=ie.selectAll("."+t.cn.scrollAreaClipRect).data(s.repeat,s.keyFun);Q.enter().append("rect").classed(t.cn.scrollAreaClipRect,!0).attr("x",-t.overdrag).attr("y",-t.uplift).attr("fill","none"),Q.attr("width",function(Te){return Te.width+2*t.overdrag}).attr("height",function(Te){return Te.height+t.uplift});var ue=ye.selectAll("."+t.cn.columnBoundary).data(s.repeat,s.keyFun);ue.enter().append("g").classed(t.cn.columnBoundary,!0);var ge=ye.selectAll("."+t.cn.columnBoundaryClippath).data(s.repeat,s.keyFun);ge.enter().append("clipPath").classed(t.cn.columnBoundaryClippath,!0),ge.attr("id",function(Te){return y(K,Te)});var Me=ge.selectAll("."+t.cn.columnBoundaryRect).data(s.repeat,s.keyFun);Me.enter().append("rect").classed(t.cn.columnBoundaryRect,!0).attr("fill","none"),Me.attr("width",function(Te){return Te.columnWidth+2*g(Te)}).attr("height",function(Te){return Te.calcdata.height+2*g(Te)+t.uplift}).attr("x",function(Te){return-g(Te)}).attr("y",function(Te){return-g(Te)}),G(null,ee,le)};function g(Y){return Math.ceil(Y.calcdata.maxLineWidth/2)}function m(Y,K){return"clip"+Y._fullLayout._uid+"_scrollAreaBottomClip_"+K.key}function y(Y,K){return"clip"+Y._fullLayout._uid+"_columnBoundaryClippath_"+K.calcdata.key+"_"+K.specIndex}function _(Y){return[].concat.apply([],Y.map(function(K){return K})).map(function(K){return K.__data__})}function v(Y,K,te){function ne(ye){var fe=ye.rowBlocks;return $(fe,fe.length-1)+(fe.length?U(fe[fe.length-1],1/0):1)}var se=Y.selectAll("."+t.cn.scrollbarKit).data(s.repeat,s.keyFun);se.enter().append("g").classed(t.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),se.each(function(ye){var fe=ye.scrollbarState;fe.totalHeight=ne(ye),fe.scrollableAreaHeight=ye.groupHeight-B(ye),fe.currentlyVisibleHeight=Math.min(fe.totalHeight,fe.scrollableAreaHeight),fe.ratio=fe.currentlyVisibleHeight/fe.totalHeight,fe.barLength=Math.max(fe.ratio*fe.currentlyVisibleHeight,t.goldenRatio*t.scrollbarWidth),fe.barWiggleRoom=fe.currentlyVisibleHeight-fe.barLength,fe.wiggleRoom=Math.max(0,fe.totalHeight-fe.scrollableAreaHeight),fe.topY=fe.barWiggleRoom===0?0:ye.scrollY/fe.wiggleRoom*fe.barWiggleRoom,fe.bottomY=fe.topY+fe.barLength,fe.dragMultiplier=fe.wiggleRoom/fe.barWiggleRoom}).attr("transform",function(ye){var fe=ye.width+t.scrollbarWidth/2+t.scrollbarOffset;return c(fe,B(ye))});var le=se.selectAll("."+t.cn.scrollbar).data(s.repeat,s.keyFun);le.enter().append("g").classed(t.cn.scrollbar,!0);var ce=le.selectAll("."+t.cn.scrollbarSlider).data(s.repeat,s.keyFun);ce.enter().append("g").classed(t.cn.scrollbarSlider,!0),ce.attr("transform",function(ye){return c(0,ye.scrollbarState.topY||0)});var pe=ce.selectAll("."+t.cn.scrollbarGlyph).data(s.repeat,s.keyFun);pe.enter().append("line").classed(t.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",t.scrollbarWidth).attr("stroke-linecap","round").attr("y1",t.scrollbarWidth/2),pe.attr("y2",function(ye){return ye.scrollbarState.barLength-t.scrollbarWidth/2}).attr("stroke-opacity",function(ye){return ye.columnDragInProgress||!ye.scrollbarState.barWiggleRoom||te?0:.4}),pe.transition().delay(0).duration(0),pe.transition().delay(t.scrollbarHideDelay).duration(t.scrollbarHideDuration).attr("stroke-opacity",0);var xe=le.selectAll("."+t.cn.scrollbarCaptureZone).data(s.repeat,s.keyFun);xe.enter().append("line").classed(t.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",t.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(ye){var fe=i.event.y,ae=this.getBoundingClientRect(),ee=ye.scrollbarState,ie=fe-ae.top,Q=i.scale.linear().domain([0,ee.scrollableAreaHeight]).range([0,ee.totalHeight]).clamp(!0);ee.topY<=ie&&ie<=ee.bottomY||W(K,Y,null,Q(ie-ee.barLength/2))(ye)}).call(i.behavior.drag().origin(function(ye){return i.event.stopPropagation(),ye.scrollbarState.scrollbarScrollInProgress=!0,ye}).on("drag",W(K,Y)).on("dragend",function(){})),xe.attr("y2",function(ye){return ye.scrollbarState.scrollableAreaHeight}),K._context.staticPlot&&(pe.remove(),xe.remove())}function x(Y,K,te,ne){var se=S(te),le=M(se);A(le);var ce=C(le);E(ce);var pe=k(le),xe=w(pe);b(xe),T(xe,K,ne,Y),H(le)}function S(Y){var K=Y.selectAll("."+t.cn.columnCells).data(s.repeat,s.keyFun);return K.enter().append("g").classed(t.cn.columnCells,!0),K.exit().remove(),K}function M(Y){var K=Y.selectAll("."+t.cn.columnCell).data(d.splitToCells,function(te){return te.keyWithinBlock});return K.enter().append("g").classed(t.cn.columnCell,!0),K.exit().remove(),K}function C(Y){var K=Y.selectAll("."+t.cn.cellRect).data(s.repeat,function(te){return te.keyWithinBlock});return K.enter().append("rect").classed(t.cn.cellRect,!0),K}function w(Y){var K=Y.selectAll("."+t.cn.cellText).data(s.repeat,function(te){return te.keyWithinBlock});return K.enter().append("text").classed(t.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){i.event.stopPropagation()}),K}function k(Y){var K=Y.selectAll("."+t.cn.cellTextHolder).data(s.repeat,function(te){return te.keyWithinBlock});return K.enter().append("g").classed(t.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),K}function A(Y){Y.each(function(K,te){var ne=K.calcdata.cells.font,se=K.column.specIndex,le={size:P(ne.size,se,te),color:P(ne.color,se,te),family:P(ne.family,se,te),weight:P(ne.weight,se,te),style:P(ne.style,se,te),variant:P(ne.variant,se,te),textcase:P(ne.textcase,se,te),lineposition:P(ne.lineposition,se,te),shadow:P(ne.shadow,se,te)};K.rowNumber=K.key,K.align=P(K.calcdata.cells.align,se,te),K.cellBorderWidth=P(K.calcdata.cells.line.width,se,te),K.font=le})}function b(Y){Y.each(function(K){l.font(i.select(this),K.font)})}function E(Y){Y.attr("width",function(K){return K.column.columnWidth}).attr("stroke-width",function(K){return K.cellBorderWidth}).each(function(K){var te=i.select(this);p.stroke(te,P(K.calcdata.cells.line.color,K.column.specIndex,K.rowNumber)),p.fill(te,P(K.calcdata.cells.fill.color,K.column.specIndex,K.rowNumber))})}function T(Y,K,te,ne){Y.text(function(se){var le=se.column.specIndex,ce=se.rowNumber,pe=se.value,xe=typeof pe=="string",ye=xe&&pe.match(/
/i),fe=!xe||ye;se.mayHaveMarkup=xe&&pe.match(/[<&>]/);var ae=F(pe);se.latex=ae;var ee=ae?"":P(se.calcdata.cells.prefix,le,ce)||"",ie=ae?"":P(se.calcdata.cells.suffix,le,ce)||"",Q=ae?null:P(se.calcdata.cells.format,le,ce)||null,ue=ee+(Q?o(Q)(se.value):se.value)+ie,ge;se.wrappingNeeded=!se.wrapped&&!fe&&!ae&&(ge=D(ue)),se.cellHeightMayIncrease=ye||ae||se.mayHaveMarkup||(ge===void 0?D(ue):ge),se.needsConvertToTspans=se.mayHaveMarkup||se.wrappingNeeded||se.latex;var Me;if(se.wrappingNeeded){var Te=t.wrapSplitCharacter===" "?ue.replace(/se&&ne.push(le),se+=xe}return ne}function G(Y,K,te){var ne=_(K)[0];if(ne!==void 0){var se=ne.rowBlocks,le=ne.calcdata,ce=$(se,se.length),pe=ne.calcdata.groupHeight-B(ne),xe=le.scrollY=Math.max(0,Math.min(ce-pe,le.scrollY)),ye=O(se,xe,pe);ye.length===1&&(ye[0]===se.length-1?ye.unshift(ye[0]-1):ye.push(ye[0]+1)),ye[0]%2&&ye.reverse(),K.each(function(fe,ae){fe.page=ye[ae],fe.scrollY=xe}),K.attr("transform",function(fe){var ae=$(fe.rowBlocks,fe.page)-fe.scrollY;return c(0,ae)}),Y&&(X(Y,te,K,ye,ne.prevPages,ne,0),X(Y,te,K,ye,ne.prevPages,ne,1),v(te,Y))}}function W(Y,K,te,ne){return function(le){var ce=le.calcdata?le.calcdata:le,pe=K.filter(function(ae){return ce.key===ae.key}),xe=te||ce.scrollbarState.dragMultiplier,ye=ce.scrollY;ce.scrollY=ne===void 0?ce.scrollY+xe*i.event.dy:ne;var fe=pe.selectAll("."+t.cn.yColumn).selectAll("."+t.cn.columnBlock).filter(I);return G(Y,fe,pe),ce.scrollY===ye}}function X(Y,K,te,ne,se,le,ce){var pe=ne[ce]!==se[ce];pe&&(clearTimeout(le.currentRepaint[ce]),le.currentRepaint[ce]=setTimeout(function(){var xe=te.filter(function(ye,fe){return fe===ce&&ne[fe]!==se[fe]});x(Y,K,xe,te),se[ce]=ne[ce]}))}function Z(Y,K,te,ne){return function(){var le=i.select(K.parentNode);le.each(function(ce){var pe=ce.fragments;le.selectAll("tspan.line").each(function(ue,ge){pe[ge].width=this.getComputedTextLength()});var xe=pe[pe.length-1].width,ye=pe.slice(0,-1),fe=[],ae,ee,ie=0,Q=ce.column.columnWidth-2*t.cellPad;for(ce.value="";ye.length;)ae=ye.shift(),ee=ae.width+xe,ie+ee>Q&&(ce.value+=fe.join(t.wrapSpacer)+t.lineBreaker,fe=[],ie=0),fe.push(ae.text),ie+=ee;ie&&(ce.value+=fe.join(t.wrapSpacer)),ce.wrapped=!0}),le.selectAll("tspan.line").remove(),T(le.select("."+t.cn.cellText),te,Y,ne),i.select(K.parentNode.parentNode).call(H)}}function J(Y,K,te,ne,se){return function(){if(!se.settledY){var ce=i.select(K.parentNode),pe=j(se),xe=se.key-pe.firstRowIndex,ye=pe.rows[xe].rowHeight,fe=se.cellHeightMayIncrease?K.parentNode.getBoundingClientRect().height+2*t.cellPad:ye,ae=Math.max(fe,ye),ee=ae-pe.rows[xe].rowHeight;ee&&(pe.rows[xe].rowHeight=ae,Y.selectAll("."+t.cn.columnCell).call(H),G(null,Y.filter(I),0),v(te,ne,!0)),ce.attr("transform",function(){var ie=this,Q=ie.parentNode,ue=Q.getBoundingClientRect(),ge=i.select(ie.parentNode).select("."+t.cn.cellRect).node().getBoundingClientRect(),Me=ie.transform.baseVal.consolidate(),Te=ge.top-ue.top+(Me?Me.matrix.f:t.cellPad);return c(N(se,i.select(ie.parentNode).select("."+t.cn.cellTextHolder).node().getBoundingClientRect().width),Te)}),se.settledY=!0}}}function N(Y,K){switch(Y.align){case"left":return t.cellPad;case"right":return Y.column.columnWidth-(K||0)-t.cellPad;case"center":return(Y.column.columnWidth-(K||0))/2;default:return t.cellPad}}function H(Y){Y.attr("transform",function(K){var te=K.rowBlocks[0].auxiliaryBlocks.reduce(function(ce,pe){return ce+U(pe,1/0)},0),ne=j(K),se=U(ne,K.key),le=se+te;return c(0,le)}).selectAll("."+t.cn.cellRect).attr("height",function(K){return q(j(K),K.key).rowHeight})}function $(Y,K){for(var te=0,ne=K-1;ne>=0;ne--)te+=V(Y[ne]);return te}function U(Y,K){for(var te=0,ne=0;neo.length&&(a=a.slice(0,o.length)):a=[],l=0;l90&&(m-=180,f=-f),{angle:m,flip:f,p:i.c2p(s,a,o),offsetMultplier:h}}}}),qle=de({"src/traces/carpet/plot.js"(e,r){"use strict";var t=Yr(),i=hn(),a=Z8(),o=K8(),s=Ule(),l=Zo(),n=Qt(),u=n.strRotate,c=n.strTranslate,f=Bl();r.exports=function(x,S,M,C){var w=x._context.staticPlot,k=S.xaxis,A=S.yaxis,b=x._fullLayout,E=b._clips;n.makeTraceGroups(C,M,"trace").each(function(T){var F=t.select(this),D=T[0],R=D.trace,P=R.aaxis,z=R.baxis,I=n.ensureSingle(F,"g","minorlayer"),L=n.ensureSingle(F,"g","majorlayer"),B=n.ensureSingle(F,"g","boundarylayer"),O=n.ensureSingle(F,"g","labellayer");F.style("opacity",R.opacity),d(k,A,L,P,"a",P._gridlines,!0,w),d(k,A,L,z,"b",z._gridlines,!0,w),d(k,A,I,P,"a",P._minorgridlines,!0,w),d(k,A,I,z,"b",z._minorgridlines,!0,w),d(k,A,B,P,"a-boundary",P._boundarylines,w),d(k,A,B,z,"b-boundary",z._boundarylines,w);var G=p(x,k,A,R,D,O,P._labels,"a-label"),W=p(x,k,A,R,D,O,z._labels,"b-label");g(x,O,R,D,k,A,G,W),h(R,D,E,k,A)})};function h(v,x,S,M,C){var w,k,A,b,E=S.select("#"+v._clipPathId);E.size()||(E=S.append("clipPath").classed("carpetclip",!0));var T=n.ensureSingle(E,"path","carpetboundary"),F=x.clipsegments,D=[];for(b=0;b0?"start":"end","data-notex":1}).call(i.font,F.font).text(F.text).call(l.convertToTspans,v),L=i.bBox(this);I.attr("transform",c(R.p[0],R.p[1])+u(R.angle)+c(F.axis.labelpadding*z,L.height*.3)),E=Math.max(E,L.width+F.axis.labelpadding)}),b.exit().remove(),T.maxExtent=E,T}function g(v,x,S,M,C,w,k,A){var b,E,T,F,D=n.aggNums(Math.min,null,S.a),R=n.aggNums(Math.max,null,S.a),P=n.aggNums(Math.min,null,S.b),z=n.aggNums(Math.max,null,S.b);b=.5*(D+R),E=P,T=S.ab2xy(b,E,!0),F=S.dxyda_rough(b,E),k.angle===void 0&&n.extendFlat(k,s(S,C,w,T,S.dxydb_rough(b,E))),_(v,x,S,M,T,F,S.aaxis,C,w,k,"a-title"),b=D,E=.5*(P+z),T=S.ab2xy(b,E,!0),F=S.dxydb_rough(b,E),A.angle===void 0&&n.extendFlat(A,s(S,C,w,T,S.dxyda_rough(b,E))),_(v,x,S,M,T,F,S.baxis,C,w,A,"b-title")}var m=f.LINE_SPACING,y=(1-f.MID_SHIFT)/m+1;function _(v,x,S,M,C,w,k,A,b,E,T){var F=[];k.title.text&&F.push(k.title.text);var D=x.selectAll("text."+T).data(F),R=E.maxExtent;D.enter().append("text").classed(T,!0),D.each(function(){var P=s(S,A,b,C,w);["start","both"].indexOf(k.showticklabels)===-1&&(R=0);var z=k.title.font.size;R+=z+k.title.offset;var I=E.angle+(E.flip<0?180:0),L=(I-P.angle+450)%360,B=L>90&&L<270,O=t.select(this);O.text(k.title.text).call(l.convertToTspans,v),B&&(R=(-l.lineCount(O)+y)*m*z-R),O.attr("transform",c(P.p[0],P.p[1])+u(P.angle)+c(0,R)).attr("text-anchor","middle").call(i.font,k.title.font)}),D.exit().remove()}}}),Vle=de({"src/traces/carpet/cheater_basis.js"(e,r){"use strict";var t=Qt().isArrayOrTypedArray;r.exports=function(i,a,o){var s,l,n,u,c,f,h=[],d=t(i)?i.length:i,p=t(a)?a.length:a,g=t(i)?i:null,m=t(a)?a:null;g&&(n=(g.length-1)/(g[g.length-1]-g[0])/(d-1)),m&&(u=(m.length-1)/(m[m.length-1]-m[0])/(p-1));var y,_=1/0,v=-1/0;for(l=0;l=10)return null;for(var s=1/0,l=-1/0,n=a.length,u=0;u0&&(U=o.dxydi([],G-1,X,0,Z),Y.push(J[0]+U[0]/3),K.push(J[1]+U[1]/3),V=o.dxydi([],G-1,X,1,Z),Y.push($[0]-V[0]/3),K.push($[1]-V[1]/3)),Y.push($[0]),K.push($[1]),J=$;else for(G=o.a2i(O),N=Math.floor(Math.max(0,Math.min(P-2,G))),H=G-N,te.length=P,te.crossLength=z,te.xy=function(ne){return o.evalxy([],G,ne)},te.dxy=function(ne,se){return o.dxydj([],N,ne,H,se)},W=0;W0&&(j=o.dxydj([],N,W-1,H,0),Y.push(J[0]+j[0]/3),K.push(J[1]+j[1]/3),q=o.dxydj([],N,W-1,H,1),Y.push($[0]-q[0]/3),K.push($[1]-q[1]/3)),Y.push($[0]),K.push($[1]),J=$;return te.axisLetter=s,te.axis=C,te.crossAxis=E,te.value=O,te.constvar=l,te.index=g,te.x=Y,te.y=K,te.smoothing=E.smoothing,te}function B(O){var G,W,X,Z,J,N=[],H=[],$={};if($.length=M.length,$.crossLength=b.length,s==="b")for(X=Math.max(0,Math.min(z-2,O)),J=Math.min(1,Math.max(0,O-X)),$.xy=function(U){return o.evalxy([],U,O)},$.dxy=function(U,V){return o.dxydi([],U,X,V,J)},G=0;GM.length-1)&&w.push(i(B(u),{color:C.gridcolor,width:C.gridwidth,dash:C.griddash}));for(g=d;gM.length-1)&&!(_<0||_>M.length-1))for(v=M[c],x=M[_],n=0;nM[M.length-1])&&k.push(i(L(y),{color:C.minorgridcolor,width:C.minorgridwidth,dash:C.minorgriddash})));C.startline&&A.push(i(B(0),{color:C.startlinecolor,width:C.startlinewidth})),C.endline&&A.push(i(B(M.length-1),{color:C.endlinecolor,width:C.endlinewidth}))}else{for(f=5e-15,h=[Math.floor((M[M.length-1]-C.tick0)/C.dtick*(1+f)),Math.ceil((M[0]-C.tick0)/C.dtick/(1+f))].sort(function(O,G){return O-G}),d=h[0],p=h[1],g=d;g<=p;g++)m=C.tick0+C.dtick*g,w.push(i(L(m),{color:C.gridcolor,width:C.gridwidth,dash:C.griddash}));for(g=d-1;gM[M.length-1])&&k.push(i(L(y),{color:C.minorgridcolor,width:C.minorgridwidth,dash:C.minorgriddash}));C.startline&&A.push(i(L(M[0]),{color:C.startlinecolor,width:C.startlinewidth})),C.endline&&A.push(i(L(M[M.length-1]),{color:C.endlinecolor,width:C.endlinewidth}))}}}}),$le=de({"src/traces/carpet/calc_labels.js"(e,r){"use strict";var t=nn(),i=fn().extendFlat;r.exports=function(o,s){var l,n,u,c,f,h=s._labels=[],d=s._gridlines;for(l=0;l=0;l--)n[d-l]=i[p][l],u[d-l]=a[p][l];for(c.push({x:n,y:u,bicubic:f}),l=p,n=[],u=[];l>=0;l--)n[p-l]=i[l][0],u[p-l]=a[l][0];return c.push({x:n,y:u,bicubic:h}),c}}}),Yle=de({"src/traces/carpet/smooth_fill_2d_array.js"(e,r){"use strict";var t=Qt();r.exports=function(a,o,s){var l,n,u,c=[],f=[],h=a[0].length,d=a.length;function p(W,X){var Z=0,J,N=0;return W>0&&(J=a[X][W-1])!==void 0&&(N++,Z+=J),W0&&(J=a[X-1][W])!==void 0&&(N++,Z+=J),X0&&n0&&lb);return t.log("Smoother converged to",E,"after",F,"iterations"),a}}}),Xle=de({"src/traces/carpet/constants.js"(e,r){"use strict";r.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Zle=de({"src/traces/carpet/catmull_rom.js"(e,r){"use strict";var t=.5;r.exports=function(a,o,s,l){var n=a[0]-o[0],u=a[1]-o[1],c=s[0]-o[0],f=s[1]-o[1],h=Math.pow(n*n+u*u,t/2),d=Math.pow(c*c+f*f,t/2),p=(d*d*n-h*h*c)*l,g=(d*d*u-h*h*f)*l,m=d*(h+d)*3,y=h*(h+d)*3;return[[o[0]+(m&&p/m),o[1]+(m&&g/m)],[o[0]-(y&&p/y),o[1]-(y&&g/y)]]}}}),Kle=de({"src/traces/carpet/compute_control_points.js"(e,r){"use strict";var t=Zle(),i=Qt().ensureArray;function a(o,s,l){var n=-.5*l[0]+1.5*s[0],u=-.5*l[1]+1.5*s[1];return[(2*n+o[0])/3,(2*u+o[1])/3]}r.exports=function(s,l,n,u,c,f){var h,d,p,g,m,y,_,v,x,S,M=n[0].length,C=n.length,w=c?3*M-2:M,k=f?3*C-2:C;for(s=i(s,k),l=i(l,k),p=0;pm&&w_&&ky||k<_||k>v},u.setScale=function(){var w=u._x,k=u._y,A=a(u._xctrl,u._yctrl,w,k,p.smoothing,g.smoothing);u._xctrl=A[0],u._yctrl=A[1],u.evalxy=o([u._xctrl,u._yctrl],h,d,p.smoothing,g.smoothing),u.dxydi=s([u._xctrl,u._yctrl],p.smoothing,g.smoothing),u.dxydj=l([u._xctrl,u._yctrl],p.smoothing,g.smoothing)},u.i2a=function(w){var k=Math.max(0,Math.floor(w[0]),h-2),A=w[0]-k;return(1-A)*c[k]+A*c[k+1]},u.j2b=function(w){var k=Math.max(0,Math.floor(w[1]),h-2),A=w[1]-k;return(1-A)*f[k]+A*f[k+1]},u.ij2ab=function(w){return[u.i2a(w[0]),u.j2b(w[1])]},u.a2i=function(w){var k=Math.max(0,Math.min(i(w,c),h-2)),A=c[k],b=c[k+1];return Math.max(0,Math.min(h-1,k+(w-A)/(b-A)))},u.b2j=function(w){var k=Math.max(0,Math.min(i(w,f),d-2)),A=f[k],b=f[k+1];return Math.max(0,Math.min(d-1,k+(w-A)/(b-A)))},u.ab2ij=function(w){return[u.a2i(w[0]),u.b2j(w[1])]},u.i2c=function(w,k){return u.evalxy([],w,k)},u.ab2xy=function(w,k,A){if(!A&&(wc[h-1]|kf[d-1]))return[!1,!1];var b=u.a2i(w),E=u.b2j(k),T=u.evalxy([],b,E);if(A){var F=0,D=0,R=[],P,z,I,L;wc[h-1]?(P=h-2,z=1,F=(w-c[h-1])/(c[h-1]-c[h-2])):(P=Math.max(0,Math.min(h-2,Math.floor(b))),z=b-P),kf[d-1]?(I=d-2,L=1,D=(k-f[d-1])/(f[d-1]-f[d-2])):(I=Math.max(0,Math.min(d-2,Math.floor(E))),L=E-I),F&&(u.dxydi(R,P,I,z,L),T[0]+=R[0]*F,T[1]+=R[1]*F),D&&(u.dxydj(R,P,I,z,L),T[0]+=R[0]*D,T[1]+=R[1]*D)}return T},u.c2p=function(w,k,A){return[k.c2p(w[0]),A.c2p(w[1])]},u.p2x=function(w,k,A){return[k.p2c(w[0]),A.p2c(w[1])]},u.dadi=function(w){var k=Math.max(0,Math.min(c.length-2,w));return c[k+1]-c[k]},u.dbdj=function(w){var k=Math.max(0,Math.min(f.length-2,w));return f[k+1]-f[k]},u.dxyda=function(w,k,A,b){var E=u.dxydi(null,w,k,A,b),T=u.dadi(w,A);return[E[0]/T,E[1]/T]},u.dxydb=function(w,k,A,b){var E=u.dxydj(null,w,k,A,b),T=u.dbdj(k,b);return[E[0]/T,E[1]/T]},u.dxyda_rough=function(w,k,A){var b=x*(A||.1),E=u.ab2xy(w+b,k,!0),T=u.ab2xy(w-b,k,!0);return[(E[0]-T[0])*.5/b,(E[1]-T[1])*.5/b]},u.dxydb_rough=function(w,k,A){var b=S*(A||.1),E=u.ab2xy(w,k+b,!0),T=u.ab2xy(w,k-b,!0);return[(E[0]-T[0])*.5/b,(E[1]-T[1])*.5/b]},u.dpdx=function(w){return w._m},u.dpdy=function(w){return w._m}}}}),rue=de({"src/traces/carpet/calc.js"(e,r){"use strict";var t=nn(),i=Qt().isArray1D,a=Vle(),o=Gle(),s=Hle(),l=$le(),n=Wle(),u=t3(),c=Yle(),f=e3(),h=tue();r.exports=function(p,g){var m=t.getFromId(p,g.xaxis),y=t.getFromId(p,g.yaxis),_=g.aaxis,v=g.baxis,x=g.x,S=g.y,M=[];x&&i(x)&&M.push("x"),S&&i(S)&&M.push("y"),M.length&&f(g,_,v,"a","b",M);var C=g._a=g._a||g.a,w=g._b=g._b||g.b;x=g._x||g.x,S=g._y||g.y;var k={};if(g._cheater){var A=_.cheatertype==="index"?C.length:C,b=v.cheatertype==="index"?w.length:w;x=a(A,b,g.cheaterslope)}g._x=x=u(x),g._y=S=u(S),c(x,C,w),c(S,C,w),h(g),g.setScale();var E=o(x),T=o(S),F=.5*(E[1]-E[0]),D=.5*(E[1]+E[0]),R=.5*(T[1]-T[0]),P=.5*(T[1]+T[0]),z=1.3;return E=[D-F*z,D+F*z],T=[P-R*z,P+R*z],g._extremes[m._id]=t.findExtremes(m,E,{padded:!0}),g._extremes[y._id]=t.findExtremes(y,T,{padded:!0}),s(g,"a","b"),s(g,"b","a"),l(g,_),l(g,v),k.clipsegments=n(g._xctrl,g._yctrl,_,v),k.x=x,k.y=S,k.a=C,k.b=w,[k]}}}),iue=de({"src/traces/carpet/index.js"(e,r){"use strict";r.exports={attributes:IS(),supplyDefaults:jle(),plot:qle(),calc:rue(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:ml(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),aue=de({"lib/carpet.js"(e,r){"use strict";r.exports=iue()}}),J8=de({"src/traces/scattercarpet/attributes.js"(e,r){"use strict";var t=Jd(),i=tl(),a=ri(),{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=Vo(),n=cs(),u=fn().extendFlat,c=i.marker,f=i.line,h=c.line;r.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:u({},i.mode,{dflt:"markers"}),text:u({},i.text,{}),texttemplate:s({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:l({editType:"plot"}),hovertext:u({},i.hovertext,{}),line:{color:f.color,width:f.width,dash:f.dash,backoff:f.backoff,shape:u({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:i.connectgaps,fill:u({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:t(),marker:u({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:u({width:h.width,dash:h.dash,editType:"calc"},n("marker.line")),gradient:c.gradient,editType:"calc"},n("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:u({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:i.hoveron,hovertemplate:o(),hovertemplatefallback:l(),zorder:i.zorder}}}),nue=de({"src/traces/scattercarpet/defaults.js"(e,r){"use strict";var t=Qt(),i=Kd(),a=bs(),o=jh(),s=_d(),l=v1(),n=xd(),u=Qd(),c=J8();r.exports=function(h,d,p,g){function m(C,w){return t.coerce(h,d,c,C,w)}m("carpet"),d.xaxis="x",d.yaxis="y";var y=m("a"),_=m("b"),v=Math.min(y.length,_.length);if(!v){d.visible=!1;return}d._length=v,m("text"),m("texttemplate"),m("texttemplatefallback"),m("hovertext");var x=v0?k=C.labelprefix.replace(/ = $/,""):k=C._hovertitle,v.push(k+": "+w.toFixed(3)+C.labelsuffix)}if(!m.hovertemplate){var S=g.hi||m.hoverinfo,M=S.split("+");M.indexOf("all")!==-1&&(M=["a","b","text"]),M.indexOf("a")!==-1&&x(y.aaxis,g.a),M.indexOf("b")!==-1&&x(y.baxis,g.b),v.push("y: "+c.yLabel),M.indexOf("text")!==-1&&i(g,m,v),c.extraText=v.join("
")}return u}}}),cue=de({"src/traces/scattercarpet/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){var n=s[l];return i.a=n.a,i.b=n.b,i.y=n.y,i}}}),fue=de({"src/traces/scattercarpet/index.js"(e,r){"use strict";r.exports={attributes:J8(),supplyDefaults:nue(),colorbar:Yu(),formatLabels:oue(),calc:sue(),plot:lue(),style:lf().style,styleOnSelect:lf().styleOnSelect,hoverPoints:uue(),selectPoints:Sv(),eventData:cue(),moduleType:"trace",name:"scattercarpet",basePlotModule:ml(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),hue=de({"lib/scattercarpet.js"(e,r){"use strict";r.exports=fue()}}),Q8=de({"src/traces/contourcarpet/attributes.js"(e,r){"use strict";var t=b1(),i=Vy(),a=cs(),o=fn().extendFlat,s=i.contours;r.exports=o({carpet:{valType:"string",editType:"calc"},z:t.z,a:t.x,a0:t.x0,da:t.dx,b:t.y,b0:t.y0,db:t.dy,text:t.text,hovertext:t.hovertext,transpose:t.transpose,atype:t.xtype,btype:t.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},zorder:i.zorder},a("",{cLetter:"z",autoColorDflt:!1}))}}),ej=de({"src/traces/contourcarpet/defaults.js"(e,r){"use strict";var t=Qt(),i=Qw(),a=Q8(),o=Hk(),s=d3(),l=p3();r.exports=function(u,c,f,h){function d(y,_){return t.coerce(u,c,a,y,_)}function p(y){return t.coerce2(u,c,a,y)}if(d("carpet"),u.a&&u.b){var g=i(u,c,d,h,"a","b");if(!g){c.visible=!1;return}d("text");var m=d("contours.type")==="constraint";m?o(u,c,d,h,f,{hasHover:!1}):(s(u,c,d,p),l(u,c,d,h,{hasHover:!1}))}else c._defaultColor=f,c._length=null;d("zorder")}}}),due=de({"src/traces/contourcarpet/calc.js"(e,r){"use strict";var t=hc(),i=Qt(),a=e3(),o=t3(),s=r3(),l=i3(),n=Ck(),u=ej(),c=RS(),f=zk();r.exports=function(p,g){var m=g._carpetTrace=c(p,g);if(!(!m||!m.visible||m.visible==="legendonly")){if(!g.a||!g.b){var y=p.data[m.index],_=p.data[g.index];_.a||(_.a=y.a),_.b||(_.b=y.b),u(_,g,g._defaultColor,p._fullLayout)}var v=h(p,g);return f(g,g._z),v}};function h(d,p){var g=p._carpetTrace,m=g.aaxis,y=g.baxis,_,v,x,S,M,C,w;m._minDtick=0,y._minDtick=0,i.isArray1D(p.z)&&a(p,m,y,"a","b",["z"]),_=p._a=p._a||p.a,S=p._b=p._b||p.b,_=_?m.makeCalcdata(p,"_a"):[],S=S?y.makeCalcdata(p,"_b"):[],v=p.a0||0,x=p.da||1,M=p.b0||0,C=p.db||1,w=p._z=o(p._z||p.z,p.transpose),p._emptypoints=l(w),s(w,p._emptypoints);var k=i.maxRowLength(w),A=p.xtype==="scaled"?"":_,b=n(p,A,v,x,k,m),E=p.ytype==="scaled"?"":S,T=n(p,E,M,C,w.length,y),F={a:b,b:T,z:w};return p.contours.type==="levels"&&p.contours.coloring!=="none"&&t(d,p,{vals:w,containerStr:"",cLetter:"z"}),[F]}}}),pue=de({"src/traces/carpet/axis_aligned_line.js"(e,r){"use strict";var t=Qt().isArrayOrTypedArray;r.exports=function(i,a,o,s){var l,n,u,c,f,h,d,p,g,m,y,_,v,x=t(o)?"a":"b",S=x==="a"?i.aaxis:i.baxis,M=S.smoothing,C=x==="a"?i.a2i:i.b2j,w=x==="a"?o:s,k=x==="a"?s:o,A=x==="a"?a.a.length:a.b.length,b=x==="a"?a.b.length:a.a.length,E=Math.floor(x==="a"?i.b2j(k):i.a2i(k)),T=x==="a"?function(X){return i.evalxy([],X,E)}:function(X){return i.evalxy([],E,X)};M&&(u=Math.max(0,Math.min(b-2,E)),c=E-u,n=x==="a"?function(X,Z){return i.dxydi([],X,u,Z,c)}:function(X,Z){return i.dxydj([],u,X,c,Z)});var F=C(w[0]),D=C(w[1]),R=F0?Math.floor:Math.ceil,I=R>0?Math.ceil:Math.floor,L=R>0?Math.min:Math.max,B=R>0?Math.max:Math.min,O=z(F+P),G=I(D-P);d=T(F);var W=[[d]];for(l=O;l*R=0;te--)q=B.clipsegments[te],Y=i([],q.x,F.c2p),K=i([],q.y,D.c2p),Y.reverse(),K.reverse(),ne.push(a(Y,K,q.bicubic));var se="M"+ne.join("L")+"Z";M(P,B.clipsegments,F,D,Z,N),C(I,P,F,D,j,$,H,L,B,N,se),y(P,X,A,z,W,b,L),o.setClipUrl(P,L._clipPathId,A)})};function m(k,A){var b,E,T,F,D,R,P,z,I;for(b=0;bX&&(E.max=X),E.len=E.max-E.min}function v(k,A,b){var E=k.getPointAtLength(A),T=k.getPointAtLength(b),F=T.x-E.x,D=T.y-E.y,R=Math.sqrt(F*F+D*D);return[F/R,D/R]}function x(k){var A=Math.sqrt(k[0]*k[0]+k[1]*k[1]);return[k[0]/A,k[1]/A]}function S(k,A){var b=Math.abs(k[0]*A[0]+k[1]*A[1]),E=Math.sqrt(1-b*b);return E/b}function M(k,A,b,E,T,F){var D,R,P,z,I=s.ensureSingle(k,"g","contourbg"),L=I.selectAll("path").data(F==="fill"&&!T?[0]:[]);L.enter().append("path"),L.exit().remove();var B=[];for(z=0;z=0&&(O=Y,W=X):Math.abs(B[1]-O[1])=0&&(O=Y,W=X):s.log("endpt to newendpt is not vert. or horz.",B,O,Y)}if(W>=0)break;z+=j(B,O),B=O}if(W===A.edgepaths.length){s.log("unclosed perimeter path");break}P=W,L=I.indexOf(P)===-1,L&&(P=I[0],z+=j(B,O)+"Z",B=null)}for(P=0;Pw):C=R>T,w=R;var P=m(T,F,D,R);P.pos=E,P.yc=(T+R)/2,P.i=b,P.dir=C?"increasing":"decreasing",P.x=P.pos,P.y=[D,F],k&&(P.orig_p=d[b]),S&&(P.tx=h.text[b]),M&&(P.htx=h.hovertext[b]),A.push(P)}else A.push({pos:E,empty:!0})}return h._extremes[g._id]=a.findExtremes(g,t.concat(v,_),{padded:!0}),A.length&&(A[0].t={labels:{open:i(f,"open:")+" ",high:i(f,"high:")+" ",low:i(f,"low:")+" ",close:i(f,"close:")+" "}}),A}function c(f,h,d){var p=d._minDiff;if(!p){var g=f._fullData,m=[];p=1/0;var y;for(y=0;y"+x.labels[E]+t.hoverLabelText(_,T,v.yhoverformat)):(D=i.extendFlat({},M),D.y0=D.y1=F,D.yLabelVal=T,D.yLabel=x.labels[E]+t.hoverLabelText(_,T,v.yhoverformat),D.name="",S.push(D),A[T]=D)}return S}function h(d,p,g,m){var y=d.cd,_=d.ya,v=y[0].trace,x=y[0].t,S=c(d,p,g,m);if(!S)return[];var M=S.index,C=y[M],w=S.index=C.i,k=C.dir;function A(P){return x.labels[P]+t.hoverLabelText(_,v[P][w],v.yhoverformat)}var b=C.hi||v.hoverinfo||"",E=b.split("+"),T=b==="all",F=T||E.indexOf("y")!==-1,D=T||E.indexOf("text")!==-1,R=F?[A("open"),A("high"),A("low"),A("close")+" "+n[k]]:[];return D&&s(C,v,R),S.extraText=R.join("
"),S.y0=S.y1=_.c2p(C.yc,!0),[S]}r.exports={hoverPoints:u,hoverSplit:f,hoverOnPoints:h}}}),aj=de({"src/traces/ohlc/select.js"(e,r){"use strict";r.exports=function(i,a){var o=i.cd,s=i.xaxis,l=i.yaxis,n=[],u,c=o[0].t.bPos||0;if(a===!1)for(u=0;up?function(v){return v<=0}:function(v){return v>=0};c.c2g=function(v){var x=c.c2l(v)-d;return(_(x)?x:0)+y},c.g2c=function(v){return c.l2c(v+d-y)},c.g2p=function(v){return v*m},c.c2p=function(v){return c.g2p(c.c2g(v))}}}function l(c,f){return f==="degrees"?a(c):c}function n(c,f){return f==="degrees"?o(c):c}function u(c,f){var h=c.type;if(h==="linear"){var d=c.d2c,p=c.c2d;c.d2c=function(g,m){return l(d(g),m)},c.c2d=function(g,m){return p(n(g,m))}}c.makeCalcdata=function(g,m){var y=g[m],_=g._length,v,x,S=function(A){return c.d2c(A,g.thetaunit)};if(y)for(v=new Array(_),x=0;x<_;x++)v[x]=S(y[x]);else{var M=m+"0",C="d"+m,w=M in g?S(g[M]):0,k=g[C]?S(g[C]):(c.period||2*Math.PI)/_;for(v=new Array(_),x=0;x<_;x++)v[x]=w+x*k}return v},c.setGeometry=function(){var g=f.sector,m=g.map(a),y={clockwise:-1,counterclockwise:1}[c.direction],_=a(c.rotation),v=function(b){return y*b+_},x=function(b){return(b-_)/y},S,M,C,w;switch(h){case"linear":M=S=t.identity,w=a,C=o,c.range=t.isFullCircle(m)?[g[0],g[0]+360]:m.map(x).map(o);break;case"category":var k=c._categories.length,A=c.period?Math.max(c.period,k):k;A===0&&(A=1),M=w=function(b){return b*2*Math.PI/A},S=C=function(b){return b*A/Math.PI/2},c.range=[0,A];break}c.c2g=function(b){return v(M(b))},c.g2c=function(b){return S(x(b))},c.t2g=function(b){return v(w(b))},c.g2t=function(b){return C(x(b))}}}}}),BS=de({"src/plots/polar/constants.js"(e,r){"use strict";r.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}}),OS=de({"src/plots/polar/helpers.js"(e,r){"use strict";var t=Qt(),i=Fy().tester,a=t.findIndexOfMin,o=t.isAngleInsideSector,s=t.angleDelta,l=t.angleDist;function n(x,S,M,C,w){if(!o(S,C))return!1;var k,A;M[0]0?A:1/0},C=a(S,M),w=t.mod(C+1,S.length);return[S[C],S[w]]}function m(x){return Math.abs(x)>1e-10?x:0}function y(x,S,M){S=S||0,M=M||0;for(var C=x.length,w=new Array(C),k=0;k0?1:0}function i(n){var u=n[0],c=n[1];if(!isFinite(u)||!isFinite(c))return[1,0];var f=(u+1)*(u+1)+c*c;return[(u*u+c*c-1)/f,2*c/f]}function a(n,u){var c=u[0],f=u[1];return[c*n.radius+n.cx,-f*n.radius+n.cy]}function o(n,u){return u*n.radius}function s(n,u,c,f){var h=a(n,i([c,u])),d=h[0],p=h[1],g=a(n,i([f,u])),m=g[0],y=g[1];if(u===0)return["M"+d+","+p,"L"+m+","+y].join(" ");var _=o(n,1/Math.abs(u));return["M"+d+","+p,"A"+_+","+_+" 0 0,"+(u<0?1:0)+" "+m+","+y].join(" ")}function l(n,u,c,f){var h=o(n,1/(u+1)),d=a(n,i([u,c])),p=d[0],g=d[1],m=a(n,i([u,f])),y=m[0],_=m[1];if(t(c)!==t(f)){var v=a(n,i([u,0])),x=v[0],S=v[1];return["M"+p+","+g,"A"+h+","+h+" 0 0,"+(0pe?(xe=Y,ye=Y*pe,ee=(K-ye)/$.h/2,fe=[j[0],j[1]],ae=[q[0]+ee,q[1]-ee]):(xe=K/pe,ye=K,ee=(Y-xe)/$.w/2,fe=[j[0]+ee,j[1]-ee],ae=[q[0],q[1]]),N.xLength2=xe,N.yLength2=ye,N.xDomain2=fe,N.yDomain2=ae;var ie=N.xOffset2=$.l+$.w*fe[0],Q=N.yOffset2=$.t+$.h*(1-ae[1]),ue=N.radius=xe/se,ge=N.innerRadius=N.getHole(J)*ue,Me=N.cx=ie-ue*ne[0],Te=N.cy=Q+ue*ne[3],je=N.cxx=Me-ie,Ve=N.cyy=Te-Q,Ke=U.side,Je;Ke==="counterclockwise"?(Je=Ke,Ke="top"):Ke==="clockwise"&&(Je=Ke,Ke="bottom"),N.radialAxis=N.mockAxis(Z,J,U,{_id:"x",side:Ke,_trueSide:Je,domain:[ge/$.w,ue/$.w]}),N.angularAxis=N.mockAxis(Z,J,V,{side:"right",domain:[0,Math.PI],autorange:!1}),N.doAutoRange(Z,J),N.updateAngularAxis(Z,J),N.updateRadialAxis(Z,J),N.updateRadialAxisTitle(Z,J),N.xaxis=N.mockCartesianAxis(Z,J,{_id:"x",domain:fe}),N.yaxis=N.mockCartesianAxis(Z,J,{_id:"y",domain:ae});var vt=N.pathSubplot();N.clipPaths.forTraces.select("path").attr("d",vt).attr("transform",s(je,Ve)),H.frontplot.attr("transform",s(ie,Q)).call(n.setClipUrl,N._hasClipOnAxisFalse?null:N.clipIds.forTraces,N.gd),H.bg.attr("d",vt).attr("transform",s(Me,Te)).call(l.fill,J.bgcolor)},B.mockAxis=function(Z,J,N,H){var $=a.extendFlat({},N,H);return h($,J,Z),$},B.mockCartesianAxis=function(Z,J,N){var H=this,$=H.isSmith,U=N._id,V=a.extendFlat({type:"linear"},N);f(V,Z);var j={x:[0,2],y:[1,3]};return V.setRange=function(){var q=H.sectorBBox,Y=j[U],K=H.radialAxis._rl,te=(K[1]-K[0])/(1-H.getHole(J));V.range=[q[Y[0]]*te,q[Y[1]]*te]},V.isPtWithinRange=U==="x"&&!$?function(q){return H.isPtInside(q)}:function(){return!0},V.setRange(),V.setScale(),V},B.doAutoRange=function(Z,J){var N=this,H=N.gd,$=N.radialAxis,U=N.getRadial(J);d(H,$);var V=$.range;if(U.range=V.slice(),U._input.range=V.slice(),$._rl=[$.r2l(V[0],null,"gregorian"),$.r2l(V[1],null,"gregorian")],$.minallowed!==void 0){var j=$.r2l($.minallowed);$._rl[0]>$._rl[1]?$._rl[1]=Math.max($._rl[1],j):$._rl[0]=Math.max($._rl[0],j)}if($.maxallowed!==void 0){var q=$.r2l($.maxallowed);$._rl[0]<$._rl[1]?$._rl[1]=Math.min($._rl[1],q):$._rl[0]=Math.min($._rl[0],q)}},B.updateRadialAxis=function(Z,J){var N=this,H=N.gd,$=N.layers,U=N.radius,V=N.innerRadius,j=N.cx,q=N.cy,Y=N.getRadial(J),K=P(N.getSector(J)[0],360),te=N.radialAxis,ne=V90&&K<=270&&(te.tickangle=180);var le=se?function(ue){var ge=D(N,E([ue.x,0]));return s(ge[0]-j,ge[1]-q)}:function(ue){return s(te.l2p(ue.x)+V,0)},ce=se?function(ue){return F(N,ue.x,-1/0,1/0)}:function(ue){return N.pathArc(te.r2p(ue.x)+V)},pe=O(Y);if(N.radialTickLayout!==pe&&($["radial-axis"].selectAll(".xtick").remove(),N.radialTickLayout=pe),ne){te.setScale();var xe=0,ye=se?(te.tickvals||[]).filter(function(ue){return ue>=0}).map(function(ue){return c.tickText(te,ue,!0,!1)}):c.calcTicks(te),fe=se?ye:c.clipEnds(te,ye),ae=c.getTickSigns(te)[2];se&&((te.ticks==="top"&&te.side==="bottom"||te.ticks==="bottom"&&te.side==="top")&&(ae=-ae),te.ticks==="top"&&te.side==="top"&&(xe=-te.ticklen),te.ticks==="bottom"&&te.side==="bottom"&&(xe=te.ticklen)),c.drawTicks(H,te,{vals:ye,layer:$["radial-axis"],path:c.makeTickPath(te,0,ae),transFn:le,crisp:!1}),c.drawGrid(H,te,{vals:fe,layer:$["radial-grid"],path:ce,transFn:a.noop,crisp:!1}),c.drawLabels(H,te,{vals:ye,layer:$["radial-axis"],transFn:le,labelFns:c.makeLabelFns(te,xe)})}var ee=N.radialAxisAngle=N.vangles?I(W(z(Y.angle),N.vangles)):Y.angle,ie=s(j,q),Q=ie+o(-ee);X($["radial-axis"],ne&&(Y.showticklabels||Y.ticks),{transform:Q}),X($["radial-grid"],ne&&Y.showgrid,{transform:se?"":ie}),X($["radial-line"].select("line"),ne&&Y.showline,{x1:se?-U:V,y1:0,x2:U,y2:0,transform:Q}).attr("stroke-width",Y.linewidth).call(l.stroke,Y.linecolor)},B.updateRadialAxisTitle=function(Z,J,N){if(!this.isSmith){var H=this,$=H.gd,U=H.radius,V=H.cx,j=H.cy,q=H.getRadial(J),Y=H.id+"title",K=0;if(q.title){var te=n.bBox(H.layers["radial-axis"].node()).height,ne=q.title.font.size,se=q.side;K=se==="top"?ne:se==="counterclockwise"?-(te+ne*.4):te+ne*.8}var le=N!==void 0?N:H.radialAxisAngle,ce=z(le),pe=Math.cos(ce),xe=Math.sin(ce),ye=V+U/2*pe+K*xe,fe=j-U/2*xe+K*pe;H.layers["radial-axis-title"]=y.draw($,Y,{propContainer:q,propName:H.id+".radialaxis.title.text",placeholder:R($,"Click to enter radial axis title"),attributes:{x:ye,y:fe,"text-anchor":"middle"},transform:{rotate:-le}})}},B.updateAngularAxis=function(Z,J){var N=this,H=N.gd,$=N.layers,U=N.radius,V=N.innerRadius,j=N.cx,q=N.cy,Y=N.getAngular(J),K=N.angularAxis,te=N.isSmith;te||(N.fillViewInitialKey("angularaxis.rotation",Y.rotation),K.setGeometry(),K.setScale());var ne=te?function(ge){var Me=D(N,E([0,ge.x]));return Math.atan2(Me[0]-j,Me[1]-q)-Math.PI/2}:function(ge){return K.t2g(ge.x)};K.type==="linear"&&K.thetaunit==="radians"&&(K.tick0=I(K.tick0),K.dtick=I(K.dtick));var se=function(ge){return s(j+U*Math.cos(ge),q-U*Math.sin(ge))},le=te?function(ge){var Me=D(N,E([0,ge.x]));return s(Me[0],Me[1])}:function(ge){return se(ne(ge))},ce=te?function(ge){var Me=D(N,E([0,ge.x])),Te=Math.atan2(Me[0]-j,Me[1]-q)-Math.PI/2;return s(Me[0],Me[1])+o(-I(Te))}:function(ge){var Me=ne(ge);return se(Me)+o(-I(Me))},pe=te?function(ge){return T(N,ge.x,0,1/0)}:function(ge){var Me=ne(ge),Te=Math.cos(Me),je=Math.sin(Me);return"M"+[j+V*Te,q-V*je]+"L"+[j+U*Te,q-U*je]},xe=c.makeLabelFns(K,0),ye=xe.labelStandoff,fe={};fe.xFn=function(ge){var Me=ne(ge);return Math.cos(Me)*ye},fe.yFn=function(ge){var Me=ne(ge),Te=Math.sin(Me)>0?.2:1;return-Math.sin(Me)*(ye+ge.fontSize*Te)+Math.abs(Math.cos(Me))*(ge.fontSize*w)},fe.anchorFn=function(ge){var Me=ne(ge),Te=Math.cos(Me);return Math.abs(Te)<.1?"middle":Te>0?"start":"end"},fe.heightFn=function(ge,Me,Te){var je=ne(ge);return-.5*(1+Math.sin(je))*Te};var ae=O(Y);N.angularTickLayout!==ae&&($["angular-axis"].selectAll("."+K._id+"tick").remove(),N.angularTickLayout=ae);var ee=te?[1/0].concat(K.tickvals||[]).map(function(ge){return c.tickText(K,ge,!0,!1)}):c.calcTicks(K);te&&(ee[0].text="\u221E",ee[0].fontSize*=1.75);var ie;if(J.gridshape==="linear"?(ie=ee.map(ne),a.angleDelta(ie[0],ie[1])<0&&(ie=ie.slice().reverse())):ie=null,N.vangles=ie,K.type==="category"&&(ee=ee.filter(function(ge){return a.isAngleInsideSector(ne(ge),N.sectorInRad)})),K.visible){var Q=K.ticks==="inside"?-1:1,ue=(K.linewidth||1)/2;c.drawTicks(H,K,{vals:ee,layer:$["angular-axis"],path:"M"+Q*ue+",0h"+Q*K.ticklen,transFn:ce,crisp:!1}),c.drawGrid(H,K,{vals:ee,layer:$["angular-grid"],path:pe,transFn:a.noop,crisp:!1}),c.drawLabels(H,K,{vals:ee,layer:$["angular-axis"],repositionOnUpdate:!0,transFn:le,labelFns:fe})}X($["angular-line"].select("path"),Y.showline,{d:N.pathSubplot(),transform:s(j,q)}).attr("stroke-width",Y.linewidth).call(l.stroke,Y.linecolor)},B.updateFx=function(Z,J){if(!this.gd._context.staticPlot){var N=!this.isSmith;N&&(this.updateAngularDrag(Z),this.updateRadialDrag(Z,J,0),this.updateRadialDrag(Z,J,1)),this.updateHoverAndMainDrag(Z)}},B.updateHoverAndMainDrag=function(Z){var J=this,N=J.isSmith,H=J.gd,$=J.layers,U=Z._zoomlayer,V=k.MINZOOM,j=k.OFFEDGE,q=J.radius,Y=J.innerRadius,K=J.cx,te=J.cy,ne=J.cxx,se=J.cyy,le=J.sectorInRad,ce=J.vangles,pe=J.radialAxis,xe=A.clampTiny,ye=A.findXYatLength,fe=A.findEnclosingVertexAngles,ae=k.cornerHalfWidth,ee=k.cornerLen/2,ie,Q,ue=p.makeDragger($,"path","maindrag",Z.dragmode===!1?"none":"crosshair");t.select(ue).attr("d",J.pathSubplot()).attr("transform",s(K,te)),ue.onmousemove=function(ht){m.hover(H,ht,J.id),H._fullLayout._lasthover=ue,H._fullLayout._hoversubplot=J.id},ue.onmouseout=function(ht){H._dragging||g.unhover(H,ht)};var ge={element:ue,gd:H,subplot:J.id,plotinfo:{id:J.id,xaxis:J.xaxis,yaxis:J.yaxis},xaxes:[J.xaxis],yaxes:[J.yaxis]},Me,Te,je,Ve,Ke,Je,vt,xt,Pt;function mt(ht,At){return Math.sqrt(ht*ht+At*At)}function Mt(ht,At){return mt(ht-ne,At-se)}function lt(ht,At){return Math.atan2(se-At,ht-ne)}function qe(ht,At){return[ht*Math.cos(At),ht*Math.sin(-At)]}function Ye(ht,At){if(ht===0)return J.pathSector(2*ae);var dt=ee/ht,Ht=At-dt,fr=At+dt,gt=Math.max(0,Math.min(ht,q)),yt=gt-ae,kt=gt+ae;return"M"+qe(yt,Ht)+"A"+[yt,yt]+" 0,0,0 "+qe(yt,fr)+"L"+qe(kt,fr)+"A"+[kt,kt]+" 0,0,1 "+qe(kt,Ht)+"Z"}function me(ht,At,dt){if(ht===0)return J.pathSector(2*ae);var Ht=qe(ht,At),fr=qe(ht,dt),gt=xe((Ht[0]+fr[0])/2),yt=xe((Ht[1]+fr[1])/2),kt,Lt;if(gt&&yt){var Ct=yt/gt,$t=-1/Ct,mr=ye(ae,Ct,gt,yt);kt=ye(ee,$t,mr[0][0],mr[0][1]),Lt=ye(ee,$t,mr[1][0],mr[1][1])}else{var br,Er;yt?(br=ee,Er=ae):(br=ae,Er=ee),kt=[[gt-br,yt-Er],[gt+br,yt-Er]],Lt=[[gt-br,yt+Er],[gt+br,yt+Er]]}return"M"+kt.join("L")+"L"+Lt.reverse().join("L")+"Z"}function _e(){je=null,Ve=null,Ke=J.pathSubplot(),Je=!1;var ht=H._fullLayout[J.id];vt=l.luminosity(ht.bgcolor),xt=p.makeZoombox(U,vt,K,te,Ke),xt.attr("fill-rule","evenodd"),Pt=p.makeCorners(U,K,te),x(H)}function Ae(ht,At){return At=Math.max(Math.min(At,q),Y),htV?(ht-1&&ht===1&&v(At,H,[J.xaxis],[J.yaxis],J.id,ge),dt.indexOf("event")>-1&&m.click(H,At,J.id)}ge.prepFn=function(ht,At,dt){var Ht=H._fullLayout.dragmode,fr=ue.getBoundingClientRect();H._fullLayout._calcInverseTransform(H);var gt=H._fullLayout._invTransform;ie=H._fullLayout._invScaleX,Q=H._fullLayout._invScaleY;var yt=a.apply3DTransform(gt)(At-fr.left,dt-fr.top);if(Me=yt[0],Te=yt[1],ce){var kt=A.findPolygonOffset(q,le[0],le[1],ce);Me+=ne+kt[0],Te+=se+kt[1]}switch(Ht){case"zoom":ge.clickFn=rt,N||(ce?ge.moveFn=Qe:ge.moveFn=Ee,ge.doneFn=Ue,_e(ht,At,dt));break;case"select":case"lasso":_(ht,At,dt,ge,Ht);break}},g.init(ge)},B.updateRadialDrag=function(Z,J,N){var H=this,$=H.gd,U=H.layers,V=H.radius,j=H.innerRadius,q=H.cx,Y=H.cy,K=H.radialAxis,te=k.radialDragBoxSize,ne=te/2;if(!K.visible)return;var se=z(H.radialAxisAngle),le=K._rl,ce=le[0],pe=le[1],xe=le[N],ye=.75*(le[1]-le[0])/(1-H.getHole(J))/V,fe,ae,ee;N?(fe=q+(V+ne)*Math.cos(se),ae=Y-(V+ne)*Math.sin(se),ee="radialdrag"):(fe=q+(j-ne)*Math.cos(se),ae=Y-(j-ne)*Math.sin(se),ee="radialdrag-inner");var ie=p.makeRectDragger(U,ee,"crosshair",-ne,-ne,te,te),Q={element:ie,gd:$};Z.dragmode===!1&&(Q.dragmode=!1),X(t.select(ie),K.visible&&j0!=(N?Me>ce:Me=90||$>90&&U>=450?se=1:j<=0&&Y<=0?se=0:se=Math.max(j,Y),$<=180&&U>=180||$>180&&U>=540?K=-1:V>=0&&q>=0?K=0:K=Math.min(V,q),$<=270&&U>=270||$>270&&U>=630?te=-1:j>=0&&Y>=0?te=0:te=Math.min(j,Y),U>=360?ne=1:V<=0&&q<=0?ne=0:ne=Math.max(V,q),[K,te,ne,se]}function W(Z,J){var N=function($){return a.angleDist(Z,$)},H=a.findIndexOfMin(J,N);return J[H]}function X(Z,J,N){return J?(Z.attr("display",null),Z.attr(N)):Z&&Z.attr("display","none"),Z}}}),uj=de({"src/plots/polar/layout_attributes.js"(e,r){"use strict";var t=Jo(),i=Mu(),a=Rs().attributes,o=Qt().extendFlat,s=Is().overrideAll,l=s({color:i.color,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash},"plot","from-root"),n=s({tickmode:i.minor.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,minorloglabels:i.minorloglabels,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,layer:i.layer},"plot","from-root"),u={visible:o({},i.visible,{dflt:!0}),type:o({},i.type,{values:["-","linear","log","date","category"]}),autotypenumbers:i.autotypenumbers,autorangeoptions:{minallowed:i.autorangeoptions.minallowed,maxallowed:i.autorangeoptions.maxallowed,clipmin:i.autorangeoptions.clipmin,clipmax:i.autorangeoptions.clipmax,include:i.autorangeoptions.include,editType:"plot"},autorange:o({},i.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:o({},i.minallowed,{editType:"plot"}),maxallowed:o({},i.maxallowed,{editType:"plot"}),range:o({},i.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:i.categoryorder,categoryarray:i.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:i.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:o({},i.title.text,{editType:"plot",dflt:""}),font:o({},i.title.font,{editType:"plot"}),editType:"plot"},hoverformat:i.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};o(u,l,n);var c={visible:o({},i.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:i.autotypenumbers,categoryorder:i.categoryorder,categoryarray:i.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:i.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};o(c,l,n),r.exports={domain:a({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:t.background},radialaxis:u,angularaxis:c,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),Eue=de({"src/plots/polar/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=Ro(),o=kv(),s=$u().getSubplotData,l=xv(),n=h1(),u=d0(),c=p0(),f=Ow(),h=Ry(),d=LE(),p=d1(),g=uj(),m=oj(),y=BS(),_=y.axisNames;function v(S,M,C,w){var k=C("bgcolor");w.bgColor=i.combine(k,w.paper_bgcolor);var A=C("sector");C("hole");var b=s(w.fullData,y.name,w.id),E=w.layoutOut,T;function F(ne,se){return C(T+"."+ne,se)}for(var D=0;D<_.length;D++){T=_[D],t.isPlainObject(S[T])||(S[T]={});var R=S[T],P=a.newContainer(M,T);P._id=P._name=T,P._attr=w.id+"."+T,P._traceIndices=b.map(function(ne){return ne.index});var z=y.axisName2dataArray[T],I=x(R,P,F,b,z,w);f(R,P,F,{axData:b,dataAttr:z});var L=F("visible");switch(m(P,M,E),F("uirevision",M.uirevision),P._m=1,T){case"radialaxis":F("minallowed"),F("maxallowed");var B=F("range"),O=P.getAutorangeDflt(B),G=F("autorange",O),W;B&&(B[0]===null&&B[1]===null||(B[0]===null||B[1]===null)&&(G==="reversed"||G===!0)||B[0]!==null&&(G==="min"||G==="max reversed")||B[1]!==null&&(G==="max"||G==="min reversed"))&&(B=void 0,delete P.range,P.autorange=!0,W=!0),W||(O=P.getAutorangeDflt(B),G=F("autorange",O)),R.autorange=G,G&&(d(F,G,B),(I==="linear"||I==="-")&&F("rangemode"),P.isReversed()&&(P._m=-1)),P.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if(I==="date"){t.log("Polar plots do not support date angular axes yet.");for(var X=0;X")}}r.exports={hoverPoints:i,makeHoverPointText:a}}}),Due=de({"src/traces/scatterpolar/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:NS(),categories:["polar","symbols","showLegend","scatter-like"],attributes:W2(),supplyDefaults:jS().supplyDefaults,colorbar:Yu(),formatLabels:US(),calc:kue(),plot:Cue(),style:lf().style,styleOnSelect:lf().styleOnSelect,hoverPoints:qS().hoverPoints,selectPoints:Sv(),meta:{}}}}),Lue=de({"lib/scatterpolar.js"(e,r){"use strict";r.exports=Due()}}),cj=de({"src/traces/scatterpolargl/attributes.js"(e,r){"use strict";var t=W2(),{cliponaxis:i,hoveron:a}=t,o=Lr(t,["cliponaxis","hoveron"]),{connectgaps:s,line:{color:l,dash:n,width:u},fill:c,fillcolor:f,marker:h,textfont:d,textposition:p}=__();r.exports=ar(Nt({},o),{connectgaps:s,fill:c,fillcolor:f,line:{color:l,dash:n,editType:"calc",width:u},marker:h,textfont:d,textposition:p})}}),Fue=de({"src/traces/scatterpolargl/defaults.js"(e,r){"use strict";var t=Qt(),i=bs(),a=jS().handleRThetaDefaults,o=jh(),s=_d(),l=xd(),n=Qd(),u=Kd().PTS_LINESONLY,c=cj();r.exports=function(h,d,p,g){function m(_,v){return t.coerce(h,d,c,_,v)}var y=a(h,d,g,m);if(!y){d.visible=!1;return}m("thetaunit"),m("mode",y=n&&(w.marker.cluster=x.tree),w.marker&&(w.markerSel.positions=w.markerUnsel.positions=w.marker.positions=E),w.line&&E.length>1&&l.extendFlat(w.line,s.linePositions(f,v,E)),w.text&&(l.extendFlat(w.text,{positions:E},s.textPosition(f,v,w.text,w.marker)),l.extendFlat(w.textSel,{positions:E},s.textPosition(f,v,w.text,w.markerSel)),l.extendFlat(w.textUnsel,{positions:E},s.textPosition(f,v,w.text,w.markerUnsel))),w.fill&&!m.fill2d&&(m.fill2d=!0),w.marker&&!m.scatter2d&&(m.scatter2d=!0),w.line&&!m.line2d&&(m.line2d=!0),w.text&&!m.glText&&(m.glText=!0),m.lineOptions.push(w.line),m.fillOptions.push(w.fill),m.markerOptions.push(w.marker),m.markerSelectedOptions.push(w.markerSel),m.markerUnselectedOptions.push(w.markerUnsel),m.textOptions.push(w.text),m.textSelectedOptions.push(w.textSel),m.textUnselectedOptions.push(w.textUnsel),m.selectBatch.push([]),m.unselectBatch.push([]),x.x=T,x.y=F,x.rawx=T,x.rawy=F,x.r=M,x.theta=C,x.positions=E,x._scene=m,x.index=m.count,m.count++}}),a(f,h,d)}},r.exports.reglPrecompiled=u}}),Oue=de({"src/traces/scatterpolargl/index.js"(e,r){"use strict";var t=zue();t.plot=Bue(),r.exports=t}}),Nue=de({"lib/scatterpolargl.js"(e,r){"use strict";r.exports=Oue()}}),fj=de({"src/traces/barpolar/attributes.js"(e,r){"use strict";var{hovertemplateAttrs:t,templatefallbackAttrs:i}=Vo(),a=fn().extendFlat,o=W2(),s=tp();r.exports={r:o.r,theta:o.theta,r0:o.r0,dr:o.dr,theta0:o.theta0,dtheta:o.dtheta,thetaunit:o.thetaunit,base:a({},s.base,{}),offset:a({},s.offset,{}),width:a({},s.width,{}),text:a({},s.text,{}),hovertext:a({},s.hovertext,{}),marker:l(),hoverinfo:o.hoverinfo,hovertemplate:t(),hovertemplatefallback:i(),selected:s.selected,unselected:s.unselected};function l(){var n=a({},s.marker);return delete n.cornerradius,n}}}),hj=de({"src/traces/barpolar/layout_attributes.js"(e,r){"use strict";r.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),jue=de({"src/traces/barpolar/defaults.js"(e,r){"use strict";var t=Qt(),i=jS().handleRThetaDefaults,a=Ww(),o=fj();r.exports=function(l,n,u,c){function f(d,p){return t.coerce(l,n,o,d,p)}var h=i(l,n,c,f);if(!h){n.visible=!1;return}f("thetaunit"),f("base"),f("offset"),f("width"),f("text"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),a(l,n,f,u,c),t.coerceSelectionMarkerOpacity(n,f)}}}),Uue=de({"src/traces/barpolar/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=hj();r.exports=function(a,o,s){var l={},n;function u(h,d){return t.coerce(a[n]||{},o[n],i,h,d)}for(var c=0;c0?(g=d,m=p):(g=p,m=d);var y=s.findEnclosingVertexAngles(g,n.vangles)[0],_=s.findEnclosingVertexAngles(m,n.vangles)[1],v=[y,(g+m)/2,_];return s.pathPolygonAnnulus(f,h,g,m,v,u,c)}:function(f,h,d,p){return a.pathAnnulus(f,h,d,p,u,c)}}}}),Vue=de({"src/traces/barpolar/hover.js"(e,r){"use strict";var t=$s(),i=Qt(),a=_1().getTraceColor,o=i.fillText,s=qS().makeHoverPointText,l=OS().isPtInsidePolygon;r.exports=function(u,c,f){var h=u.cd,d=h[0].trace,p=u.subplot,g=p.radialAxis,m=p.angularAxis,y=p.vangles,_=y?l:i.isPtInsideSector,v=u.maxHoverDistance,x=m._period||2*Math.PI,S=Math.abs(g.g2p(Math.sqrt(c*c+f*f))),M=Math.atan2(f,c);g.range[0]>g.range[1]&&(M+=Math.PI);var C=function(b){return _(S,M,[b.rp0,b.rp1],[b.thetag0,b.thetag1],y)?v+Math.min(1,Math.abs(b.thetag1-b.thetag0)/x)-1+(b.rp1-S)/(b.rp1-b.rp0)-1:1/0};if(t.getClosest(h,C,u),u.index!==!1){var w=u.index,k=h[w];u.x0=u.x1=k.ct[0],u.y0=u.y1=k.ct[1];var A=i.extendFlat({},k,{r:k.s,theta:k.p});return o(k,d,u),s(A,d,p,u),u.hovertemplate=d.hovertemplate,u.color=a(d,k),u.xLabelVal=u.yLabelVal=void 0,k.s<0&&(u.idealAlign="left"),[u]}}}}),Gue=de({"src/traces/barpolar/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"barpolar",basePlotModule:NS(),categories:["polar","bar","showLegend"],attributes:fj(),layoutAttributes:hj(),supplyDefaults:jue(),supplyLayoutDefaults:Uue(),calc:dj().calc,crossTraceCalc:dj().crossTraceCalc,plot:que(),colorbar:Yu(),formatLabels:US(),style:Vh().style,styleOnSelect:Vh().styleOnSelect,hoverPoints:Vue(),selectPoints:x1(),meta:{}}}}),Hue=de({"lib/barpolar.js"(e,r){"use strict";r.exports=Gue()}}),pj=de({"src/plots/smith/constants.js"(e,r){"use strict";r.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),vj=de({"src/plots/smith/layout_attributes.js"(e,r){"use strict";var t=Jo(),i=Mu(),a=Rs().attributes,o=Qt().extendFlat,s=Is().overrideAll,l=s({color:i.color,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash},"plot","from-root"),n=s({ticklen:i.ticklen,tickwidth:o({},i.tickwidth,{dflt:2}),tickcolor:i.tickcolor,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,tickfont:i.tickfont,tickformat:i.tickformat,hoverformat:i.hoverformat,layer:i.layer},"plot","from-root"),u=o({visible:o({},i.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:o({},i.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},l,n),c=o({visible:o({},i.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:i.ticks,editType:"calc"},l,n);r.exports={domain:a({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:t.background},realaxis:u,imaginaryaxis:c,editType:"calc"}}}),$ue=de({"src/plots/smith/layout_defaults.js"(e,r){"use strict";var t=Qt(),i=ta(),a=Ro(),o=kv(),s=$u().getSubplotData,l=p0(),n=d0(),u=Ry(),c=Xd(),f=vj(),h=pj(),d=h.axisNames,p=m(function(y){return t.isTypedArray(y)&&(y=Array.from(y)),y.slice().reverse().map(function(_){return-_}).concat([0]).concat(y)},String);function g(y,_,v,x){var S=v("bgcolor");x.bgColor=i.combine(S,x.paper_bgcolor);var M=s(x.fullData,h.name,x.id),C=x.layoutOut,w;function k(O,G){return v(w+"."+O,G)}for(var A=0;A")}}r.exports={hoverPoints:i,makeHoverPointText:a}}}),Que=de({"src/traces/scattersmith/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"scattersmith",basePlotModule:Wue(),categories:["smith","symbols","showLegend","scatter-like"],attributes:mj(),supplyDefaults:Yue(),colorbar:Yu(),formatLabels:Xue(),calc:Zue(),plot:Kue(),style:lf().style,styleOnSelect:lf().styleOnSelect,hoverPoints:Jue().hoverPoints,selectPoints:Sv(),meta:{}}}}),ece=de({"lib/scattersmith.js"(e,r){"use strict";r.exports=Que()}}),gj=de({"src/traces/quiver/attributes.js"(e,r){"use strict";var t=ri(),i=Vo().hovertemplateAttrs,a=Ns().axisHoverFormat,o=fn().extendFlat,s=cs(),l=fu().dash,n=y0(),u=tl(),c={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:u.x0,dx:u.dx,y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:u.y0,dy:u.dy,u:{valType:"data_array",editType:"calc",anim:!0},v:{valType:"data_array",editType:"calc",anim:!0},arrowref:{valType:"enumerated",values:["paper","data"],dflt:"data",editType:"calc"},lengthmode:{valType:"enumerated",values:["scaled","raw"],editType:"calc",dflt:"scaled"},lengthfactor:{valType:"number",min:0,editType:"calc",dflt:1},anchor:{valType:"enumerated",values:["tip","tail","center"],dflt:"tail",editType:"calc"},xhoverformat:a("x"),yhoverformat:a("y"),uhoverformat:a("u","noDate"),vhoverformat:a("v","noDate"),hoverinfo:o({},t.hoverinfo,{flags:["x","y","u","v","text","name"],dflt:"all"}),hovertemplate:i({},{keys:["x","y","u","v","text","name"]}),text:u.text,textposition:u.textposition,textfont:u.textfont,marker:o({arrowsize:o({},n.arrowsize,{editType:"calc"}),line:{width:{valType:"number",min:0,dflt:2,editType:"style"},dash:l,editType:"style"},editType:"calc"},s("marker",{showScaleDflt:!0,editTypeOverride:"calc"})),selected:{marker:{color:{valType:"color",editType:"style"},line:{width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{color:{valType:"color",editType:"style"},line:{width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"}};r.exports=c}}),tce=de({"src/traces/quiver/defaults.js"(e,r){"use strict";var t=Qt(),i=gj(),a=Tv(),o=Wu().hasColorscale,s=hu();r.exports=function(n,u,c,f){function h(S,M){return t.coerce(n,u,i,S,M)}var d=a(n,u,f,h);if(!d){u.visible=!1;return}var p=h("u"),g=h("v");if(!t.isArrayOrTypedArray(p)||p.length===0){u.u=new Array(d);for(var m=0;mR&&(R=p[W]),g[W]z&&(z=g[W]),NL&&(L=N),HO&&(O=H);var $=Math.sqrt(N*N+H*H);if($>v&&(v=$),$<_&&(_=$),C){var U=M[W];X.mc=U,a(U)&&(US&&(S=U))}}else X.x=o,X.y=o}if(f._maxNorm=v,b==="scaled"||E==="paper"){let le=R-D,ce=z-P;var V;le===0&&ce===0?V=1:V=(le+ce+Math.sqrt((le-ce)*(le-ce)+4*G*le*ce))/(2*(G-1)),V*=n,f._scaleFactor=V/f._maxNorm}else f._scaleFactor=1;f._scaleFactor*=f.lengthfactor;let j=new Array(m),q=new Array(m),Y=new Array(m),K=new Array(m);for(var te,ne,W=0;Wg.i&&isFinite(m[g.i]))y=m[g.i];else{var _=h.u&&h.u[g.i]||0,v=h.v&&h.v[g.i]||0;y=Math.sqrt(_*_+v*v)}return g.mcc=p(y),g.mcc})}function n(f){var h=t.select(f).selectAll("g.trace.quiver");h.each(function(d){c(f,d,t.select(this))})}function u(f,h,d){c(f,h,d)}function c(f,h,d){var p=h[0].trace,g=p.marker||{},m=g.line||{},y=i.isArrayOrTypedArray(g.color)?void 0:g.color,_=p._hasColorscale;if(d)if(p.selectedpoints){var v=(p.selected||{}).marker||{},x=(p.unselected||{}).marker||{},S=v.line||{},M=x.line||{};d.selectAll("path.js-line").each(function(w){var k=t.select(this),A=!w.selected,b=A?x.color:v.color,E=A?M.width!==void 0?M.width:m.width:S.width!==void 0?S.width:m.width;b?(a.lineGroupStyle(k,E,b,m.dash),k.style("stroke-opacity",1)):(a.lineGroupStyle(k,E,y,m.dash),_&&l(k,p),k.style("stroke-opacity",A?s:1))}),a.selectedTextStyle(d.selectAll("text"),p)}else{var C=d.selectAll("path.js-line");C.call(a.lineGroupStyle,m.width,y,m.dash),_&&l(C,p),C.style("stroke-opacity",1),a.textPointStyle(d.selectAll("text"),p,f)}}r.exports={style:n,styleOnSelect:u,colorscaleStroke:l}}}),ace=de({"src/traces/quiver/plot.js"(e,r){"use strict";var t=Yr(),i=Qt(),a=hn(),o=VS().colorscaleStroke,s=Math.PI/12,l=5.8,n=1.5,u=.7;r.exports=function(h,d,p,g,m,y){var _,v,x=!m,S=!!m&&m.duration>0;if(_=g.selectAll("g.trace").data(p,function(C){return C[0].trace.uid}),_.enter().append("g").attr("class",function(C){return"trace quiver trace"+C[0].trace.uid}).style("stroke-miterlimit",2),_.order(),S){y&&(v=y());var M=t.transition().duration(m.duration).ease(m.easing).each("end",function(){v&&v()}).each("interrupt",function(){v&&v()});M.each(function(){g.selectAll("g.trace").each(function(C,w){c(h,w,d,C,p,this,m)})})}else _.each(function(C,w){c(h,w,d,C,p,this,m)});x&&_.exit().remove()};function c(f,h,d,p,g,m,y){var _=p[0].trace,v=d.xaxis,x=d.yaxis;p[0][d.isRangePlot?"nodeRangePlot3":"node3"]=t.select(m);var S=t.select(m).selectAll("g.lines").data([p]);S.enter().append("g").classed("lines",!0),a.setClipUrl(S,d.layerClipId,f);var M=S.selectAll("path.js-line").data(p);M.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke"),M.exit().remove();let{anchor:C,maxNorm:w=0,arrowref:k}=_,A=k==="paper"?_._scaleFactor*Math.sqrt(Math.abs(v._m*x._m)):_._scaleFactor,b=_.marker.arrowsize;M.each(function(z){let I=t.select(this);if(z.x===void 0||z.y===void 0){I.attr("d",null);return}let L=(k==="paper"?z._u*Math.sign(v._m):t.round(v._m*z._u))*A,B=(k==="paper"?z._v*Math.sign(x._m):t.round(x._m*z._v))*A,O=(_._input.marker||{}).arrowsize!==void 0;var G,W,X,Z;C==="tip"?(G=v.c2p(z.x)-L,X=x.c2p(z.y)-B,W=v.c2p(z.x),Z=x.c2p(z.y)):C==="center"?(G=v.c2p(z.x)-L/2,X=x.c2p(z.y)-B/2,W=v.c2p(z.x)+L/2,Z=x.c2p(z.y)+B/2):(G=v.c2p(z.x),X=x.c2p(z.y),W=v.c2p(z.x)+L,Z=x.c2p(z.y)+B),z._px0=G,z._py0=X,z._px1=W,z._py1=Z;var J=_.marker.line.width;O||(J=Math.max(J,n));let N=Math.sqrt((W-G)*(W-G)+(Z-X)*(Z-X)),H=u*N,$=Math.min(l*b*J,H),U=Math.atan2(Z-X,W-G),V=W-$*Math.cos(U-s),j=Z-$*Math.sin(U-s),q=W-$*Math.cos(U+s),Y=Z-$*Math.sin(U+s),K="M"+G+","+X+"L"+W+","+Z+"L"+V+","+j+"L"+W+","+Z+"L"+q+","+Y;I.attr("d",K)});var E=_.marker||{},T=E.line||{},F=i.isArrayOrTypedArray(E.color)?void 0:E.color;a.lineGroupStyle(M,T.width,F,T.dash),_._hasColorscale&&o(M,_);var D=t.select(m).selectAll("g.text").data([p]);D.enter().append("g").classed("text",!0),a.setClipUrl(D,d.layerClipId,f);var R=D.selectAll("g.textpoint").data(p);if(R.enter().append("g").classed("textpoint",!0).append("text"),R.exit().remove(),R.each(function(z){var I=t.select(this),L=a.translatePoint(z,I.select("text"),v,x);L||I.remove()}),R.selectAll("text").call(a.textPointStyle,_,f).each(function(z){var I=v.c2p(z.x),L=x.c2p(z.y);t.select(this).selectAll("tspan.line").each(function(){t.select(this).attr({x:I,y:L})})}),y&&y.duration>0){var P=t.transition().duration(y.duration).ease(y.easing);M.transition(P).style("opacity",1)}}}}),nce=de({"src/traces/quiver/hover.js"(e,r){"use strict";var t=Qt(),i=$s(),a=g1();function o(s,l,n,u,c,f){let h=c-n,d=f-u,p=h*h+d*d;if(!p)return Math.sqrt((s-n)*(s-n)+(l-u)*(l-u));var g=((s-n)*h+(l-u)*d)/p;g=Math.max(0,Math.min(1,g));let m=n+g*h,y=u+g*d;return Math.sqrt((s-m)*(s-m)+(l-y)*(l-y))}r.exports=function(l,n,u,c){var f=l.cd,h=f[0].trace,d=l.xa,p=l.ya,g=d.c2p(n),m=p.c2p(u),y=function(k){return k._px0===void 0?1/0:o(g,m,k._px0,k._py0,k._px1,k._py1)};if(i.getClosest(f,y,l),l.index!==!1){var _=f[l.index],v=d.c2p(_.x,!0),x=p.c2p(_.y,!0),S=Math.sqrt((g-v)*(g-v)+(m-x)*(m-x));l.index=_.i;var M=h.u?h.u[_.i]:0,C=h.v?h.v[_.i]:0,w="u: "+M+", v: "+C;return t.extendFlat(l,{color:a(h,_),x0:v-3,x1:v+3,xLabelVal:_.x,y0:x-3,y1:x+3,yLabelVal:_.y,uLabelVal:M,vLabelVal:C,extraText:w,spikeDistance:S,hovertemplate:h.hovertemplate}),t.fillText(_,h,l),[l]}}}}),oce=de({"src/traces/quiver/format_labels.js"(e,r){"use strict";var t=nn(),i=Qt();r.exports=function(o,s,l){var n={},u={_fullLayout:l},c=t.getFromTrace(u,s,"x"),f=t.getFromTrace(u,s,"y"),h=o.x,d=o.y;n.xLabel=t.tickText(c,c.c2l(h),!0).text,n.yLabel=t.tickText(f,f.c2l(d),!0).text;var p=s.u?s.u[o.i]:0,g=s.v?s.v[o.i]:0,m=s.uhoverformat,y=s.vhoverformat;return n.uLabel=m?i.numberFormat(m)(p):String(p),n.vLabel=y?i.numberFormat(y)(g):String(g),n}}}),sce=de({"src/traces/quiver/event_data.js"(e,r){"use strict";r.exports=function(i,a,o,s,l){return i.x=a.x,i.y=a.y,i.u=o.u?o.u[l]:void 0,i.v=o.v?o.v[l]:void 0,i}}}),lce=de({"src/traces/quiver/index.js"(e,r){"use strict";r.exports={moduleType:"trace",name:"quiver",basePlotModule:ml(),categories:["cartesian","svg","showLegend","scatter-like","zoomScale"],attributes:gj(),supplyDefaults:tce(),calc:rce(),crossTraceCalc:ice(),plot:ace(),style:VS().style,styleOnSelect:VS().styleOnSelect,hoverPoints:nce(),formatLabels:oce(),eventData:sce(),selectPoints:Sv(),colorbar:Yu(),animatable:!0,meta:{}}}}),uce=de({"lib/quiver.js"(e,r){"use strict";r.exports=lce()}}),_c=de({"node_modules/world-calendars/dist/main.js"(e,r){var t=du();function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}t(i.prototype,{instance:function(u,c){u=(u||"gregorian").toLowerCase(),c=c||"";var f=this._localCals[u+"-"+c];if(!f&&this.calendars[u]&&(f=new this.calendars[u](c),this._localCals[u+"-"+c]=f),!f)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,u);return f},newDate:function(u,c,f,h,d){return h=(u!=null&&u.year?u.calendar():typeof h=="string"?this.instance(h,d):h)||this.instance(),h.newDate(u,c,f)},substituteDigits:function(u){return function(c){return(c+"").replace(/[0-9]/g,function(f){return u[f]})}},substituteChineseDigits:function(u,c){return function(f){for(var h="",d=0;f>0;){var p=f%10;h=(p===0?"":u[p]+c[d])+h,d++,f=Math.floor(f/10)}return h.indexOf(u[1]+c[1])===0&&(h=h.substr(1)),h||u[0]}}});function a(u,c,f,h){if(this._calendar=u,this._year=c,this._month=f,this._day=h,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(n.local.invalidDate||n.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(u,c){return u=""+u,"000000".substring(0,c-u.length)+u}t(a.prototype,{newDate:function(u,c,f){return this._calendar.newDate(u??this,c,f)},year:function(u){return arguments.length===0?this._year:this.set(u,"y")},month:function(u){return arguments.length===0?this._month:this.set(u,"m")},day:function(u){return arguments.length===0?this._day:this.set(u,"d")},date:function(u,c,f){if(!this._calendar.isValid(u,c,f))throw(n.local.invalidDate||n.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=u,this._month=c,this._day=f,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(u,c){return this._calendar.add(this,u,c)},set:function(u,c){return this._calendar.set(this,u,c)},compareTo:function(u){if(this._calendar.name!==u._calendar.name)throw(n.local.differentCalendars||n.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,u._calendar.local.name);var c=this._year!==u._year?this._year-u._year:this._month!==u._month?this.monthOfYear()-u.monthOfYear():this._day-u._day;return c===0?0:c<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(u){return this._calendar.fromJD(u)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(u){return this._calendar.fromJSDate(u)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}});function s(){this.shortYearCutoff="+10"}t(s.prototype,{_validateLevel:0,newDate:function(u,c,f){return u==null?this.today():(u.year&&(this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate),f=u.day(),c=u.month(),u=u.year()),new a(this,u,c,f))},today:function(){return this.fromJSDate(new Date)},epoch:function(u){var c=this._validate(u,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return c.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(u){var c=this._validate(u,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return(c.year()<0?"-":"")+o(Math.abs(c.year()),4)},monthsInYear:function(u){return this._validate(u,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),12},monthOfYear:function(u,c){var f=this._validate(u,c,this.minDay,n.local.invalidMonth||n.regionalOptions[""].invalidMonth);return(f.month()+this.monthsInYear(f)-this.firstMonth)%this.monthsInYear(f)+this.minMonth},fromMonthOfYear:function(u,c){var f=(c+this.firstMonth-2*this.minMonth)%this.monthsInYear(u)+this.minMonth;return this._validate(u,f,this.minDay,n.local.invalidMonth||n.regionalOptions[""].invalidMonth),f},daysInYear:function(u){var c=this._validate(u,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return this.leapYear(c)?366:365},dayOfYear:function(u,c,f){var h=this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate);return h.toJD()-this.newDate(h.year(),this.fromMonthOfYear(h.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(u,c,f){var h=this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(h))+2)%this.daysInWeek()},extraInfo:function(u,c,f){return this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate),{}},add:function(u,c,f){return this._validate(u,this.minMonth,this.minDay,n.local.invalidDate||n.regionalOptions[""].invalidDate),this._correctAdd(u,this._add(u,c,f),c,f)},_add:function(u,c,f){if(this._validateLevel++,f==="d"||f==="w"){var h=u.toJD()+c*(f==="w"?this.daysInWeek():1),d=u.calendar().fromJD(h);return this._validateLevel--,[d.year(),d.month(),d.day()]}try{var p=u.year()+(f==="y"?c:0),g=u.monthOfYear()+(f==="m"?c:0),d=u.day(),m=function(v){for(;gx-1+v.minMonth;)p++,g-=x,x=v.monthsInYear(p)};f==="y"?(u.month()!==this.fromMonthOfYear(p,g)&&(g=this.newDate(p,u.month(),this.minDay).monthOfYear()),g=Math.min(g,this.monthsInYear(p)),d=Math.min(d,this.daysInMonth(p,this.fromMonthOfYear(p,g)))):f==="m"&&(m(this),d=Math.min(d,this.daysInMonth(p,this.fromMonthOfYear(p,g))));var y=[p,this.fromMonthOfYear(p,g),d];return this._validateLevel--,y}catch(_){throw this._validateLevel--,_}},_correctAdd:function(u,c,f,h){if(!this.hasYearZero&&(h==="y"||h==="m")&&(c[0]===0||u.year()>0!=c[0]>0)){var d={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[h],p=f<0?-1:1;c=this._add(u,f*d[0]+p*d[1],d[2])}return u.date(c[0],c[1],c[2])},set:function(u,c,f){this._validate(u,this.minMonth,this.minDay,n.local.invalidDate||n.regionalOptions[""].invalidDate);var h=f==="y"?c:u.year(),d=f==="m"?c:u.month(),p=f==="d"?c:u.day();return(f==="y"||f==="m")&&(p=Math.min(p,this.daysInMonth(h,d))),u.date(h,d,p)},isValid:function(u,c,f){this._validateLevel++;var h=this.hasYearZero||u!==0;if(h){var d=this.newDate(u,c,this.minDay);h=c>=this.minMonth&&c-this.minMonth=this.minDay&&f-this.minDay13.5?13:1),_=d-(y>2.5?4716:4715);return _<=0&&_--,this.newDate(_,y,m)},toJSDate:function(u,c,f){var h=this._validate(u,c,f,n.local.invalidDate||n.regionalOptions[""].invalidDate),d=new Date(h.year(),h.month()-1,h.day());return d.setHours(0),d.setMinutes(0),d.setSeconds(0),d.setMilliseconds(0),d.setHours(d.getHours()>12?d.getHours()+2:0),d},fromJSDate:function(u){return this.newDate(u.getFullYear(),u.getMonth()+1,u.getDate())}});var n=r.exports=new i;n.cdate=a,n.baseCalendar=s,n.calendars.gregorian=l}}),cce=de({"node_modules/world-calendars/dist/plus.js"(){var e=du(),r=_c();e(r.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),r.local=r.regionalOptions[""],e(r.cdate.prototype,{formatDate:function(t,i){return typeof t!="string"&&(i=t,t=""),this._calendar.formatDate(t||"",this,i)}}),e(r.baseCalendar.prototype,{UNIX_EPOCH:r.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:r.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,i,a){if(typeof t!="string"&&(a=i,i=t,t=""),!i)return"";if(i.calendar()!==this)throw r.local.invalidFormat||r.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat,a=a||{};for(var o=a.dayNamesShort||this.local.dayNamesShort,s=a.dayNames||this.local.dayNames,l=a.monthNumbers||this.local.monthNumbers,n=a.monthNamesShort||this.local.monthNamesShort,u=a.monthNames||this.local.monthNames,c=a.calculateWeek||this.local.calculateWeek,f=function(M,C){for(var w=1;S+w1},h=function(M,C,w,k){var A=""+C;if(f(M,k))for(;A.length1},x=function(F,D){var R=v(F,D),P=[2,3,R?4:2,R?4:2,10,11,20]["oyYJ@!".indexOf(F)+1],z=new RegExp("^-?\\d{1,"+P+"}"),I=i.substring(A).match(z);if(!I)throw(r.local.missingNumberAt||r.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=I[0].length,parseInt(I[0],10)},S=this,M=function(){if(typeof u=="function"){v("m");var F=u.call(S,i.substring(A));return A+=F.length,F}return x("m")},C=function(F,D,R,P){for(var z=v(F,P)?R:D,I=0;I-1){p=1,g=m;for(var T=this.daysInMonth(d,p);g>T;T=this.daysInMonth(d,p))p++,g-=T}return h>-1?this.fromJD(h):this.newDate(d,p,g)},determineDate:function(t,i,a,o,s){a&&typeof a!="object"&&(s=o,o=a,a=null),typeof o!="string"&&(s=o,o="");var l=this,n=function(u){try{return l.parseDate(o,u,s)}catch{}u=u.toLowerCase();for(var c=(u.match(/^c/)&&a?a.newDate():null)||l.today(),f=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,h=f.exec(u);h;)c.add(parseInt(h[1],10),h[2]||"d"),h=f.exec(u);return c};return i=i?i.newDate():null,t=t==null?i:typeof t=="string"?n(t):typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?i:l.today().add(t,"d"):l.newDate(t),t}})}}),fce=de({"node_modules/world-calendars/dist/calendars/chinese.js"(){var e=_c(),r=du(),t=e.instance();function i(h){this.local=this.regionalOptions[h||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,r(i.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(h,d){if(typeof h=="string"){var p=h.match(o);return p?p[0]:""}var g=this._validateYear(h),m=h.month(),y=""+this.toChineseMonth(g,m);return d&&y.length<2&&(y="0"+y),this.isIntercalaryMonth(g,m)&&(y+="i"),y},monthNames:function(h){if(typeof h=="string"){var d=h.match(s);return d?d[0]:""}var p=this._validateYear(h),g=h.month(),m=this.toChineseMonth(p,g),y=["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"][m-1];return this.isIntercalaryMonth(p,g)&&(y="\u95F0"+y),y},monthNamesShort:function(h){if(typeof h=="string"){var d=h.match(l);return d?d[0]:""}var p=this._validateYear(h),g=h.month(),m=this.toChineseMonth(p,g),y=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][m-1];return this.isIntercalaryMonth(p,g)&&(y="\u95F0"+y),y},parseMonth:function(h,d){h=this._validateYear(h);var p=parseInt(d),g;if(isNaN(p))d[0]==="\u95F0"&&(g=!0,d=d.substring(1)),d[d.length-1]==="\u6708"&&(d=d.substring(0,d.length-1)),p=1+["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"].indexOf(d);else{var m=d[d.length-1];g=m==="i"||m==="I"}var y=this.toMonthIndex(h,p,g);return y},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(h,d){if(h.year&&(h=h.year()),typeof h!="number"||h<1888||h>2111)throw d.replace(/\{0\}/,this.local.name);return h},toMonthIndex:function(h,d,p){var g=this.intercalaryMonth(h),m=p&&d!==g;if(m||d<1||d>12)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);var y;return g?!p&&d<=g?y=d-1:y=d:y=d-1,y},toChineseMonth:function(h,d){h.year&&(h=h.year(),d=h.month());var p=this.intercalaryMonth(h),g=p?12:11;if(d<0||d>g)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);var m;return p?d>13;return p},isIntercalaryMonth:function(h,d){h.year&&(h=h.year(),d=h.month());var p=this.intercalaryMonth(h);return!!p&&p===d},leapYear:function(h){return this.intercalaryMonth(h)!==0},weekOfYear:function(h,d,p){var g=this._validateYear(h,e.local.invalidyear),m=u[g-u[0]],y=m>>9&4095,_=m>>5&15,v=m&31,x;x=t.newDate(y,_,v),x.add(4-(x.dayOfWeek()||7),"d");var S=this.toJD(h,d,p)-x.toJD();return 1+Math.floor(S/7)},monthsInYear:function(h){return this.leapYear(h)?13:12},daysInMonth:function(h,d){h.year&&(d=h.month(),h=h.year()),h=this._validateYear(h);var p=n[h-n[0]],g=p>>13,m=g?12:11;if(d>m)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);var y=p&1<<12-d?30:29;return y},weekDay:function(h,d,p){return(this.dayOfWeek(h,d,p)||7)<6},toJD:function(h,d,p){var g=this._validate(h,y,p,e.local.invalidDate);h=this._validateYear(g.year()),d=g.month(),p=g.day();var m=this.isIntercalaryMonth(h,d),y=this.toChineseMonth(h,d),_=f(h,y,p,m);return t.toJD(_.year,_.month,_.day)},fromJD:function(h){var d=t.fromJD(h),p=c(d.year(),d.month(),d.day()),g=this.toMonthIndex(p.year,p.month,p.isIntercalary);return this.newDate(p.year,g,p.day)},fromString:function(h){var d=h.match(a),p=this._validateYear(+d[1]),g=+d[2],m=!!d[3],y=this.toMonthIndex(p,g,m),_=+d[4];return this.newDate(p,y,_)},add:function(h,d,p){var g=h.year(),m=h.month(),y=this.isIntercalaryMonth(g,m),_=this.toChineseMonth(g,m),v=Object.getPrototypeOf(i.prototype).add.call(this,h,d,p);if(p==="y"){var x=v.year(),S=v.month(),M=this.isIntercalaryMonth(x,_),C=y&&M?this.toMonthIndex(x,_,!0):this.toMonthIndex(x,_,!1);C!==S&&v.month(C)}return v}});var a=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,o=/^\d?\d[iI]?/m,s=/^闰?十?[一二三四五六七八九]?月/m,l=/^闰?十?[一二三四五六七八九]?/m;e.calendars.chinese=i;var n=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],u=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function c(h,d,p,g){var m,y;if(typeof h=="object")m=h,y=d||{};else{var _=typeof h=="number"&&h>=1888&&h<=2111;if(!_)throw new Error("Solar year outside range 1888-2111");var v=typeof d=="number"&&d>=1&&d<=12;if(!v)throw new Error("Solar month outside range 1 - 12");var x=typeof p=="number"&&p>=1&&p<=31;if(!x)throw new Error("Solar day outside range 1 - 31");m={year:h,month:d,day:p},y=g||{}}var S=u[m.year-u[0]],M=m.year<<9|m.month<<5|m.day;y.year=M>=S?m.year:m.year-1,S=u[y.year-u[0]];var C=S>>9&4095,w=S>>5&15,k=S&31,A,b=new Date(C,w-1,k),E=new Date(m.year,m.month-1,m.day);A=Math.round((E-b)/(24*3600*1e3));var T=n[y.year-n[0]],F;for(F=0;F<13;F++){var D=T&1<<12-F?30:29;if(A>13;return!R||F=1888&&h<=2111;if(!v)throw new Error("Lunar year outside range 1888-2111");var x=typeof d=="number"&&d>=1&&d<=12;if(!x)throw new Error("Lunar month outside range 1 - 12");var S=typeof p=="number"&&p>=1&&p<=30;if(!S)throw new Error("Lunar day outside range 1 - 30");var M;typeof g=="object"?(M=!1,y=g):(M=!!g,y=m||{}),_={year:h,month:d,day:p,isIntercalary:M}}var C;C=_.day-1;var w=n[_.year-n[0]],k=w>>13,A;k&&(_.month>k||_.isIntercalary)?A=_.month:A=_.month-1;for(var b=0;b>9&4095,D=T>>5&15,R=T&31,P=new Date(F,D-1,R+C);return y.year=P.getFullYear(),y.month=1+P.getMonth(),y.day=P.getDate(),y}}}),hce=de({"node_modules/world-calendars/dist/calendars/coptic.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),o=a.year()+(a.year()<0?1:0);return o%4===3||o%4===-1},monthsInYear:function(i){return this._validate(i,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(-s.dayOfWeek(),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInMonth:function(i,a){var o=this._validate(i,a,this.minDay,e.local.invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===13&&this.leapYear(o.year())?1:0)},weekDay:function(i,a,o){return(this.dayOfWeek(i,a,o)||7)<6},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);return i=s.year(),i<0&&i++,s.day()+(s.month()-1)*30+(i-1)*365+Math.floor(i/4)+this.jdEpoch-1},fromJD:function(i){var a=Math.floor(i)+.5-this.jdEpoch,o=Math.floor((a-Math.floor((a+366)/1461))/365)+1;o<=0&&o--,a=Math.floor(i)+.5-this.newDate(o,1,1).toJD();var s=Math.floor(a/30)+1,l=a-(s-1)*30+1;return this.newDate(o,s,l)}}),e.calendars.coptic=t}}),dce=de({"node_modules/world-calendars/dist/calendars/discworld.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(a){return this._validate(a,this.minMonth,this.minDay,e.local.invalidYear),!1},monthsInYear:function(a){return this._validate(a,this.minMonth,this.minDay,e.local.invalidYear),13},daysInYear:function(a){return this._validate(a,this.minMonth,this.minDay,e.local.invalidYear),400},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/8)+1},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);return(l.day()+1)%8},weekDay:function(a,o,s){var l=this.dayOfWeek(a,o,s);return l>=2&&l<=6},extraInfo:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);return{century:i[Math.floor((l.year()-1)/100)+1]||""}},toJD:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);return a=l.year()+(l.year()<0?1:0),o=l.month(),s=l.day(),s+(o>1?16:0)+(o>2?(o-2)*32:0)+(a-1)*400+this.jdEpoch-1},fromJD:function(a){a=Math.floor(a+.5)-Math.floor(this.jdEpoch)-1;var o=Math.floor(a/400)+1;a-=(o-1)*400,a+=a>15?16:0;var s=Math.floor(a/32)+1,l=a-(s-1)*32+1;return this.newDate(o<=0?o-1:o,s,l)}});var i={20:"Fruitbat",21:"Anchovy"};e.calendars.discworld=t}}),pce=de({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),o=a.year()+(a.year()<0?1:0);return o%4===3||o%4===-1},monthsInYear:function(i){return this._validate(i,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(-s.dayOfWeek(),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInMonth:function(i,a){var o=this._validate(i,a,this.minDay,e.local.invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===13&&this.leapYear(o.year())?1:0)},weekDay:function(i,a,o){return(this.dayOfWeek(i,a,o)||7)<6},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);return i=s.year(),i<0&&i++,s.day()+(s.month()-1)*30+(i-1)*365+Math.floor(i/4)+this.jdEpoch-1},fromJD:function(i){var a=Math.floor(i)+.5-this.jdEpoch,o=Math.floor((a-Math.floor((a+366)/1461))/365)+1;o<=0&&o--,a=Math.floor(i)+.5-this.newDate(o,1,1).toJD();var s=Math.floor(a/30)+1,l=a-(s-1)*30+1;return this.newDate(o,s,l)}}),e.calendars.ethiopian=t}}),vce=de({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear);return this._leapYear(o.year())},_leapYear:function(a){return a=a<0?a+1:a,i(a*7+1,19)<7},monthsInYear:function(a){return this._validate(a,this.minMonth,this.minDay,e.local.invalidYear),this._leapYear(a.year?a.year():a)?13:12},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear);return a=o.year(),this.toJD(a===-1?1:a+1,7,1)-this.toJD(a,7,1)},daysInMonth:function(a,o){return a.year&&(o=a.month(),a=a.year()),this._validate(a,o,this.minDay,e.local.invalidMonth),o===12&&this.leapYear(a)||o===8&&i(this.daysInYear(a),10)===5?30:o===9&&i(this.daysInYear(a),10)===3?29:this.daysPerMonth[o-1]},weekDay:function(a,o,s){return this.dayOfWeek(a,o,s)!==6},extraInfo:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);return{yearType:(this.leapYear(l)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(l)%10-3]}},toJD:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);a=l.year(),o=l.month(),s=l.day();var n=a<=0?a+1:a,u=this.jdEpoch+this._delay1(n)+this._delay2(n)+s+1;if(o<7){for(var c=7;c<=this.monthsInYear(a);c++)u+=this.daysInMonth(a,c);for(var c=1;c=this.toJD(o===-1?1:o+1,7,1);)o++;for(var s=athis.toJD(o,s,this.daysInMonth(o,s));)s++;var l=a-this.toJD(o,s,1)+1;return this.newDate(o,s,l)}});function i(a,o){return a-o*Math.floor(a/o)}e.calendars.hebrew=t}}),mce=de({"node_modules/world-calendars/dist/calendars/islamic.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012Bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(i){var a=this._validate(i,this.minMonth,this.minDay,e.local.invalidYear);return(a.year()*11+14)%30<11},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(-s.dayOfWeek(),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInYear:function(i){return this.leapYear(i)?355:354},daysInMonth:function(i,a){var o=this._validate(i,a,this.minDay,e.local.invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===12&&this.leapYear(o.year())?1:0)},weekDay:function(i,a,o){return this.dayOfWeek(i,a,o)!==5},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);return i=s.year(),a=s.month(),o=s.day(),i=i<=0?i+1:i,o+Math.ceil(29.5*(a-1))+(i-1)*354+Math.floor((3+11*i)/30)+this.jdEpoch-1},fromJD:function(i){i=Math.floor(i)+.5;var a=Math.floor((30*(i-this.jdEpoch)+10646)/10631);a=a<=0?a-1:a;var o=Math.min(12,Math.ceil((i-29-this.toJD(a,1,1))/29.5)+1),s=i-this.toJD(a,o,1)+1;return this.newDate(a,o,s)}}),e.calendars.islamic=t}}),gce=de({"node_modules/world-calendars/dist/calendars/julian.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),o=a.year()<0?a.year()+1:a.year();return o%4===0},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(4-(s.dayOfWeek()||7),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInMonth:function(i,a){var o=this._validate(i,a,this.minDay,e.local.invalidMonth);return this.daysPerMonth[o.month()-1]+(o.month()===2&&this.leapYear(o.year())?1:0)},weekDay:function(i,a,o){return(this.dayOfWeek(i,a,o)||7)<6},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);return i=s.year(),a=s.month(),o=s.day(),i<0&&i++,a<=2&&(i--,a+=12),Math.floor(365.25*(i+4716))+Math.floor(30.6001*(a+1))+o-1524.5},fromJD:function(i){var a=Math.floor(i+.5),o=a+1524,s=Math.floor((o-122.1)/365.25),l=Math.floor(365.25*s),n=Math.floor((o-l)/30.6001),u=n-Math.floor(n<14?1:13),c=s-Math.floor(u>2?4716:4715),f=o-l-Math.floor(30.6001*n);return c<=0&&c--,this.newDate(c,u,f)}}),e.calendars.julian=t}}),yce=de({"node_modules/world-calendars/dist/calendars/mayan.js"(){var e=_c(),r=du();function t(o){this.local=this.regionalOptions[o||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(o){return this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),!1},formatYear:function(o){var s=this._validate(o,this.minMonth,this.minDay,e.local.invalidYear);o=s.year();var l=Math.floor(o/400);o=o%400,o+=o<0?400:0;var n=Math.floor(o/20);return l+"."+n+"."+o%20},forYear:function(o){if(o=o.split("."),o.length<3)throw"Invalid Mayan year";for(var s=0,l=0;l19||l>0&&n<0)throw"Invalid Mayan year";s=s*20+n}return s},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),18},weekOfYear:function(o,s,l){return this._validate(o,s,l,e.local.invalidDate),0},daysInYear:function(o){return this._validate(o,this.minMonth,this.minDay,e.local.invalidYear),360},daysInMonth:function(o,s){return this._validate(o,s,this.minDay,e.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(o,s,l){var n=this._validate(o,s,l,e.local.invalidDate);return n.day()},weekDay:function(o,s,l){return this._validate(o,s,l,e.local.invalidDate),!0},extraInfo:function(o,s,l){var n=this._validate(o,s,l,e.local.invalidDate),u=n.toJD(),c=this._toHaab(u),f=this._toTzolkin(u);return{haabMonthName:this.local.haabMonths[c[0]-1],haabMonth:c[0],haabDay:c[1],tzolkinDayName:this.local.tzolkinMonths[f[0]-1],tzolkinDay:f[0],tzolkinTrecena:f[1]}},_toHaab:function(o){o-=this.jdEpoch;var s=i(o+8+340,365);return[Math.floor(s/20)+1,i(s,20)]},_toTzolkin:function(o){return o-=this.jdEpoch,[a(o+20,20),a(o+4,13)]},toJD:function(o,s,l){var n=this._validate(o,s,l,e.local.invalidDate);return n.day()+n.month()*20+n.year()*360+this.jdEpoch},fromJD:function(o){o=Math.floor(o)+.5-this.jdEpoch;var s=Math.floor(o/360);o=o%360,o+=o<0?360:0;var l=Math.floor(o/20),n=o%20;return this.newDate(s,l,n)}});function i(o,s){return o-s*Math.floor(o/s)}function a(o,s){return i(o-1,s)+1}e.calendars.mayan=t}}),_ce=de({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar;var i=e.instance("gregorian");r(t.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear);return i.leapYear(o.year()+(o.year()<1?1:0)+1469)},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(1-(l.dayOfWeek()||7),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===12&&this.leapYear(s.year())?1:0)},weekDay:function(a,o,s){return(this.dayOfWeek(a,o,s)||7)<6},toJD:function(n,o,s){var l=this._validate(n,o,s,e.local.invalidMonth),n=l.year();n<0&&n++;for(var u=l.day(),c=1;c=this.toJD(o+1,1,1);)o++;for(var s=a-Math.floor(this.toJD(o,1,1)+.5)+1,l=1;s>this.daysInMonth(o,l);)s-=this.daysInMonth(o,l),l++;return this.newDate(o,l,s)}}),e.calendars.nanakshahi=t}}),xce=de({"node_modules/world-calendars/dist/calendars/nepali.js"(){var e=_c(),r=du();function t(i){this.local=this.regionalOptions[i||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(i){return this.daysInYear(i)!==this.daysPerYear},weekOfYear:function(i,a,o){var s=this.newDate(i,a,o);return s.add(-s.dayOfWeek(),"d"),Math.floor((s.dayOfYear()-1)/7)+1},daysInYear:function(i){var a=this._validate(i,this.minMonth,this.minDay,e.local.invalidYear);if(i=a.year(),typeof this.NEPALI_CALENDAR_DATA[i]>"u")return this.daysPerYear;for(var o=0,s=this.minMonth;s<=12;s++)o+=this.NEPALI_CALENDAR_DATA[i][s];return o},daysInMonth:function(i,a){return i.year&&(a=i.month(),i=i.year()),this._validate(i,a,this.minDay,e.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[i]>"u"?this.daysPerMonth[a-1]:this.NEPALI_CALENDAR_DATA[i][a]},weekDay:function(i,a,o){return this.dayOfWeek(i,a,o)!==6},toJD:function(i,a,o){var s=this._validate(i,a,o,e.local.invalidDate);i=s.year(),a=s.month(),o=s.day();var l=e.instance(),n=0,u=a,c=i;this._createMissingCalendarData(i);var f=i-(u>9||u===9&&o>=this.NEPALI_CALENDAR_DATA[c][0]?56:57);for(a!==9&&(n=o,u--);u!==9;)u<=0&&(u=12,c--),n+=this.NEPALI_CALENDAR_DATA[c][u],u--;return a===9?(n+=o-this.NEPALI_CALENDAR_DATA[c][0],n<0&&(n+=l.daysInYear(f))):n+=this.NEPALI_CALENDAR_DATA[c][9]-this.NEPALI_CALENDAR_DATA[c][0],l.newDate(f,1,1).add(n,"d").toJD()},fromJD:function(i){var a=e.instance(),o=a.fromJD(i),s=o.year(),l=o.dayOfYear(),n=s+56;this._createMissingCalendarData(n);for(var u=9,c=this.NEPALI_CALENDAR_DATA[n][0],f=this.NEPALI_CALENDAR_DATA[n][u]-c+1;l>f;)u++,u>12&&(u=1,n++),f+=this.NEPALI_CALENDAR_DATA[n][u];var h=this.NEPALI_CALENDAR_DATA[n][u]-(f-l);return this.newDate(n,u,h)},_createMissingCalendarData:function(i){var a=this.daysPerMonth.slice(0);a.unshift(17);for(var o=i-1;o"u"&&(this.NEPALI_CALENDAR_DATA[o]=a)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),e.calendars.nepali=t}}),bce=de({"node_modules/world-calendars/dist/calendars/persian.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}function i(a){var o=a-475;a<0&&o++;var s=.242197,l=s*o,n=s*(o+1),u=l-Math.floor(l),c=n-Math.floor(n);return u>c}t.prototype=new e.baseCalendar,r(t.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chah\u0101rshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear);return i(o.year())},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(-((l.dayOfWeek()+1)%7),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===12&&this.leapYear(s.year())?1:0)},weekDay:function(a,o,s){return this.dayOfWeek(a,o,s)!==5},toJD:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate);a=l.year(),o=l.month(),s=l.day();var n=0;if(a>0)for(var u=1;u0?a-1:a)*365+n+this.jdEpoch-1},fromJD:function(a){a=Math.floor(a)+.5;var o=475+(a-this.toJD(475,1,1))/365.242197,s=Math.floor(o);s<=0&&s--,a>this.toJD(s,12,i(s)?30:29)&&(s++,s===0&&s++);var l=a-this.toJD(s,1,1)+1,n=l<=186?Math.ceil(l/31):Math.ceil((l-6)/30),u=a-this.toJD(s,n,1)+1;return this.newDate(s,n,u)}}),e.calendars.persian=t,e.calendars.jalali=t}}),wce=de({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var e=_c(),r=du(),t=e.instance();function i(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,r(i.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(s){var o=this._validate(s,this.minMonth,this.minDay,e.local.invalidYear),s=this._t2gYear(o.year());return t.leapYear(s)},weekOfYear:function(n,o,s){var l=this._validate(n,this.minMonth,this.minDay,e.local.invalidYear),n=this._t2gYear(l.year());return t.weekOfYear(n,l.month(),l.day())},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===2&&this.leapYear(s.year())?1:0)},weekDay:function(a,o,s){return(this.dayOfWeek(a,o,s)||7)<6},toJD:function(n,o,s){var l=this._validate(n,o,s,e.local.invalidDate),n=this._t2gYear(l.year());return t.toJD(n,l.month(),l.day())},fromJD:function(a){var o=t.fromJD(a),s=this._g2tYear(o.year());return this.newDate(s,o.month(),o.day())},_t2gYear:function(a){return a+this.yearsOffset+(a>=-this.yearsOffset&&a<=-1?1:0)},_g2tYear:function(a){return a-this.yearsOffset-(a>=1&&a<=this.yearsOffset?1:0)}}),e.calendars.taiwan=i}}),Tce=de({"node_modules/world-calendars/dist/calendars/thai.js"(){var e=_c(),r=du(),t=e.instance();function i(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,r(i.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(s){var o=this._validate(s,this.minMonth,this.minDay,e.local.invalidYear),s=this._t2gYear(o.year());return t.leapYear(s)},weekOfYear:function(n,o,s){var l=this._validate(n,this.minMonth,this.minDay,e.local.invalidYear),n=this._t2gYear(l.year());return t.weekOfYear(n,l.month(),l.day())},daysInMonth:function(a,o){var s=this._validate(a,o,this.minDay,e.local.invalidMonth);return this.daysPerMonth[s.month()-1]+(s.month()===2&&this.leapYear(s.year())?1:0)},weekDay:function(a,o,s){return(this.dayOfWeek(a,o,s)||7)<6},toJD:function(n,o,s){var l=this._validate(n,o,s,e.local.invalidDate),n=this._t2gYear(l.year());return t.toJD(n,l.month(),l.day())},fromJD:function(a){var o=t.fromJD(a),s=this._g2tYear(o.year());return this.newDate(s,o.month(),o.day())},_t2gYear:function(a){return a-this.yearsOffset-(a>=1&&a<=this.yearsOffset?1:0)},_g2tYear:function(a){return a+this.yearsOffset+(a>=-this.yearsOffset&&a<=-1?1:0)}}),e.calendars.thai=i}}),Ace=de({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var e=_c(),r=du();function t(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}t.prototype=new e.baseCalendar,r(t.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012Bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(a){var o=this._validate(a,this.minMonth,this.minDay,e.local.invalidYear);return this.daysInYear(o.year())===355},weekOfYear:function(a,o,s){var l=this.newDate(a,o,s);return l.add(-l.dayOfWeek(),"d"),Math.floor((l.dayOfYear()-1)/7)+1},daysInYear:function(a){for(var o=0,s=1;s<=12;s++)o+=this.daysInMonth(a,s);return o},daysInMonth:function(a,o){for(var s=this._validate(a,o,this.minDay,e.local.invalidMonth),l=s.toJD()-24e5+.5,n=0,u=0;ul)return i[n]-i[n-1];n++}return 30},weekDay:function(a,o,s){return this.dayOfWeek(a,o,s)!==5},toJD:function(a,o,s){var l=this._validate(a,o,s,e.local.invalidDate),n=12*(l.year()-1)+l.month()-15292,u=l.day()+i[n-1]-1;return u+24e5-.5},fromJD:function(a){for(var o=a-24e5+.5,s=0,l=0;lo);l++)s++;var n=s+15292,u=Math.floor((n-1)/12),c=u+1,f=n-12*u,h=o-i[s-1]+1;return this.newDate(c,f,h)},isValid:function(a,o,s){var l=e.baseCalendar.prototype.isValid.apply(this,arguments);return l&&(a=a.year!=null?a.year:a,l=a>=1276&&a<=1500),l},_validate:function(a,o,s,l){var n=e.baseCalendar.prototype._validate.apply(this,arguments);if(n.year<1276||n.year>1500)throw l.replace(/\{0\}/,this.local.name);return n}}),e.calendars.ummalqura=t;var i=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),Mce=de({"src/components/calendars/calendars.js"(e,r){"use strict";r.exports=_c(),cce(),fce(),hce(),dce(),pce(),vce(),mce(),gce(),yce(),_ce(),xce(),bce(),wce(),Tce(),Ace()}}),Sce=de({"src/components/calendars/index.js"(e,r){"use strict";var t=Mce(),i=Qt(),a=cn(),o=a.EPOCHJD,s=a.ONEDAY,l={valType:"enumerated",values:i.sortObjectKeys(t.calendars),editType:"calc",dflt:"gregorian"},n=function(w,k,A,b){var E={};return E[A]=l,i.coerce(w,k,E,A,b)},u=function(w,k,A,b){for(var E=0;E{ct.preventDefault(),ct.stopPropagation(),ct.clipboardData.setData("text",Pe),Ne.removeEventListener("copy",Ze,!0)};Ne.addEventListener("copy",Ze,!0),document.execCommand("copy")}We.copyText=oe})(Tj||(Tj={}));var Fs;(function(We){function oe(ct){let Xt=window.getComputedStyle(ct),Ot=parseFloat(Xt.borderTopWidth)||0,Zt=parseFloat(Xt.borderLeftWidth)||0,nr=parseFloat(Xt.borderRightWidth)||0,Gt=parseFloat(Xt.borderBottomWidth)||0,er=parseFloat(Xt.paddingTop)||0,ur=parseFloat(Xt.paddingLeft)||0,ir=parseFloat(Xt.paddingRight)||0,Nt=parseFloat(Xt.paddingBottom)||0,ar=Zt+ur+ir+nr,Lr=Ot+er+Nt+Gt;return{borderTop:Ot,borderLeft:Zt,borderRight:nr,borderBottom:Gt,paddingTop:er,paddingLeft:ur,paddingRight:ir,paddingBottom:Nt,horizontalSum:ar,verticalSum:Lr}}We.boxSizing=oe;function Pe(ct){let Xt=window.getComputedStyle(ct),Ot=parseFloat(Xt.minWidth)||0,Zt=parseFloat(Xt.minHeight)||0,nr=parseFloat(Xt.maxWidth)||1/0,Gt=parseFloat(Xt.maxHeight)||1/0;return nr=Math.max(Ot,nr),Gt=Math.max(Zt,Gt),{minWidth:Ot,minHeight:Zt,maxWidth:nr,maxHeight:Gt}}We.sizeLimits=Pe;function Ne(ct,Xt,Ot){let Zt=ct.getBoundingClientRect();return Xt>=Zt.left&&Xt=Zt.top&&Ot=Ot.bottom)){if(Zt.topOt.bottom&&Zt.height>=Ot.height){ct.scrollTop-=Ot.top-Zt.top;return}if(Zt.topOt.height){ct.scrollTop-=Ot.bottom-Zt.bottom;return}if(Zt.bottom>Ot.bottom&&Zt.height{let Gt=Element.prototype;return Gt.matches||Gt.matchesSelector||Gt.mozMatchesSelector||Gt.msMatchesSelector||Gt.oMatchesSelector||Gt.webkitMatchesSelector||function(er){let ur=this,ir=ur.ownerDocument?ur.ownerDocument.querySelectorAll(er):[];return Array.prototype.indexOf.call(ir,ur)!==-1}})();function oe(Gt){Gt=Gt.split(",",1)[0];let er=0,ur=0,ir=0;function Nt(ar){let Lr=Gt.match(ar);return Lr===null?!1:(Gt=Gt.slice(Lr[0].length),!0)}for(Gt=Gt.replace(nr," $1 ");Gt.length>0;){if(Nt(Pe)){er++;continue}if(Nt(Ne)){ur++;continue}if(Nt(Ze)){ur++;continue}if(Nt(Xt)){ir++;continue}if(Nt(Ot)){ur++;continue}if(Nt(ct)){ir++;continue}if(!Nt(Zt))return 0}return er=Math.min(er,255),ur=Math.min(ur,255),ir=Math.min(ir,255),er<<16|ur<<8|ir}We.calculateSingle=oe;let Pe=/^#[^\s\+>~#\.\[:]+/,Ne=/^\.[^\s\+>~#\.\[:]+/,Ze=/^\[[^\]]+\]/,ct=/^[^\s\+>~#\.\[:]+/,Xt=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,Ot=/^:[^\s\+>~#\.\[:]+/,Zt=/^[\s\+>~\*]+/,nr=/:not\(([^\)]+)\)/g})(dd||(dd={}));var vp=dp(uv());var Jm=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let oe=this._first;for(;oe;)yield oe.value,oe=oe.next}*retro(){let oe=this._last;for(;oe;)yield oe.value,oe=oe.prev}*nodes(){let oe=this._first;for(;oe;)yield oe,oe=oe.next}*retroNodes(){let oe=this._last;for(;oe;)yield oe,oe=oe.prev}assign(oe){this.clear();for(let Pe of oe)this.addLast(Pe)}push(oe){this.addLast(oe)}pop(){return this.removeLast()}shift(oe){this.addFirst(oe)}unshift(){return this.removeFirst()}addFirst(oe){let Pe=new pp.LinkedListNode(this,oe);return this._first?(Pe.next=this._first,this._first.prev=Pe,this._first=Pe):(this._first=Pe,this._last=Pe),this._size++,Pe}addLast(oe){let Pe=new pp.LinkedListNode(this,oe);return this._last?(Pe.prev=this._last,this._last.next=Pe,this._last=Pe):(this._first=Pe,this._last=Pe),this._size++,Pe}insertBefore(oe,Pe){if(!Pe||Pe===this._first)return this.addFirst(oe);if(!(Pe instanceof pp.LinkedListNode)||Pe.list!==this)throw new Error("Reference node is not owned by the list.");let Ne=new pp.LinkedListNode(this,oe),Ze=Pe,ct=Ze.prev;return Ne.next=Ze,Ne.prev=ct,Ze.prev=Ne,ct.next=Ne,this._size++,Ne}insertAfter(oe,Pe){if(!Pe||Pe===this._last)return this.addLast(oe);if(!(Pe instanceof pp.LinkedListNode)||Pe.list!==this)throw new Error("Reference node is not owned by the list.");let Ne=new pp.LinkedListNode(this,oe),Ze=Pe,ct=Ze.next;return Ne.next=ct,Ne.prev=Ze,Ze.next=Ne,ct.prev=Ne,this._size++,Ne}removeFirst(){let oe=this._first;if(oe)return oe===this._last?(this._first=null,this._last=null):(this._first=oe.next,this._first.prev=null),oe.list=null,oe.next=null,oe.prev=null,this._size--,oe.value}removeLast(){let oe=this._last;if(oe)return oe===this._first?(this._first=null,this._last=null):(this._last=oe.prev,this._last.next=null),oe.list=null,oe.next=null,oe.prev=null,this._size--,oe.value}removeNode(oe){if(!(oe instanceof pp.LinkedListNode)||oe.list!==this)throw new Error("Node is not owned by the list.");let Pe=oe;Pe===this._first&&Pe===this._last?(this._first=null,this._last=null):Pe===this._first?(this._first=Pe.next,this._first.prev=null):Pe===this._last?(this._last=Pe.prev,this._last.next=null):(Pe.next.prev=Pe.prev,Pe.prev.next=Pe.next),Pe.list=null,Pe.next=null,Pe.prev=null,this._size--}clear(){let oe=this._first;for(;oe;){let Pe=oe.next;oe.list=null,oe.prev=null,oe.next=null,oe=Pe}this._first=null,this._last=null,this._size=0}};(function(We){function oe(Pe){let Ne=new We;return Ne.assign(Pe),Ne}We.from=oe})(Jm||(Jm={}));var pp;(function(We){class oe{constructor(Ne,Ze){this.list=null,this.next=null,this.prev=null,this.list=Ne,this.value=Ze}}We.LinkedListNode=oe})(pp||(pp={}));var rf=class{constructor(oe){this.type=oe}get isConflatable(){return!1}conflate(oe){return!1}},s0=class extends rf{get isConflatable(){return!0}conflate(oe){return!0}},za;(function(We){let oe=null,Pe=(Ki=>Ia=>{let _i=!1;return Ki.then(()=>!_i&&Ia()),()=>{_i=!0}})(Promise.resolve());function Ne(Ki,Ia){let _i=ur.get(Ki);if(!_i||_i.length===0){Ir(Ki,Ia);return}(0,vp.every)((0,vp.retro)(_i),Yr=>Yr?Lr(Yr,Ki,Ia):!0)&&Ir(Ki,Ia)}We.sendMessage=Ne;function Ze(Ki,Ia){if(!Ia.isConflatable){de(Ki,Ia);return}(0,vp.some)(er,ia=>ia.handler!==Ki||!ia.msg||ia.msg.type!==Ia.type||!ia.msg.isConflatable?!1:ia.msg.conflate(Ia))||de(Ki,Ia)}We.postMessage=Ze;function ct(Ki,Ia){let _i=ur.get(Ki);_i&&_i.indexOf(Ia)!==-1||(_i?_i.push(Ia):ur.set(Ki,[Ia]))}We.installMessageHook=ct;function Xt(Ki,Ia){let _i=ur.get(Ki);if(!_i)return;let ia=_i.indexOf(Ia);ia!==-1&&(_i[ia]=null,qr(_i))}We.removeMessageHook=Xt;function Ot(Ki){let Ia=ur.get(Ki);Ia&&Ia.length>0&&(vp.ArrayExt.fill(Ia,null),qr(Ia));for(let _i of er)_i.handler===Ki&&(_i.handler=null,_i.msg=null)}We.clearData=Ot;function Zt(){ar||oe===null||(oe(),oe=null,ar=!0,Mr(),ar=!1)}We.flush=Zt;function nr(){return Nt}We.getExceptionHandler=nr;function Gt(Ki){let Ia=Nt;return Nt=Ki,Ia}We.setExceptionHandler=Gt;let er=new Jm,ur=new WeakMap,ir=new Set,Nt=Ki=>{console.error(Ki)},ar=!1;function Lr(Ki,Ia,_i){let ia=!0;try{typeof Ki=="function"?ia=Ki(Ia,_i):ia=Ki.messageHook(Ia,_i)}catch(Yr){Nt(Yr)}return ia}function Ir(Ki,Ia){try{Ki.processMessage(Ia)}catch(_i){Nt(_i)}}function de(Ki,Ia){er.addLast({handler:Ki,msg:Ia}),oe===null&&(oe=Pe(Mr))}function Mr(){if(oe=null,er.isEmpty)return;let Ki={handler:null,msg:null};for(er.addLast(Ki);;){let Ia=er.removeFirst();if(Ia===Ki)return;Ia.handler&&Ia.msg&&Ne(Ia.handler,Ia.msg)}}function qr(Ki){ir.size===0&&Pe(Vr),ir.add(Ki)}function Vr(){ir.forEach(ti),ir.clear()}function ti(Ki){vp.ArrayExt.removeAllWhere(Ki,Xr)}function Xr(Ki){return Ki===null}})(za||(za={}));var af=class{constructor(oe){this._pid=cv.nextPID(),this.name=oe.name,this._create=oe.create,this._coerce=oe.coerce||null,this._compare=oe.compare||null,this._changed=oe.changed||null}get(oe){let Pe,Ne=cv.ensureMap(oe);return this._pid in Ne?Pe=Ne[this._pid]:Pe=Ne[this._pid]=this._createValue(oe),Pe}set(oe,Pe){let Ne,Ze=cv.ensureMap(oe);this._pid in Ze?Ne=Ze[this._pid]:Ne=Ze[this._pid]=this._createValue(oe);let ct=this._coerceValue(oe,Pe);this._maybeNotify(oe,Ne,Ze[this._pid]=ct)}coerce(oe){let Pe,Ne=cv.ensureMap(oe);this._pid in Ne?Pe=Ne[this._pid]:Pe=Ne[this._pid]=this._createValue(oe);let Ze=this._coerceValue(oe,Pe);this._maybeNotify(oe,Pe,Ne[this._pid]=Ze)}_createValue(oe){let Pe=this._create;return Pe(oe)}_coerceValue(oe,Pe){let Ne=this._coerce;return Ne?Ne(oe,Pe):Pe}_compareValue(oe,Pe){let Ne=this._compare;return Ne?Ne(oe,Pe):oe===Pe}_maybeNotify(oe,Pe,Ne){let Ze=this._changed;Ze&&!this._compareValue(Pe,Ne)&&Ze(oe,Pe,Ne)}};(function(We){function oe(Pe){cv.ownerData.delete(Pe)}We.clearData=oe})(af||(af={}));var cv;(function(We){We.ownerData=new WeakMap,We.nextPID=(()=>{let Pe=0;return()=>`pid-${`${Math.random()}`.slice(2)}-${Pe++}`})();function oe(Pe){let Ne=We.ownerData.get(Pe);return Ne||(Ne=Object.create(null),We.ownerData.set(Pe,Ne),Ne)}We.ensureMap=oe})(cv||(cv={}));var ew=dp(uv()),zce=dp(Q2()),Ss=class{constructor(oe){this.sender=oe}connect(oe,Pe){return rh.connect(this,oe,Pe)}disconnect(oe,Pe){return rh.disconnect(this,oe,Pe)}emit(oe){rh.emit(this,oe)}};(function(We){function oe(Zt,nr){rh.disconnectBetween(Zt,nr)}We.disconnectBetween=oe;function Pe(Zt){rh.disconnectSender(Zt)}We.disconnectSender=Pe;function Ne(Zt){rh.disconnectReceiver(Zt)}We.disconnectReceiver=Ne;function Ze(Zt){rh.disconnectAll(Zt)}We.disconnectAll=Ze;function ct(Zt){rh.disconnectAll(Zt)}We.clearData=ct;function Xt(){return rh.exceptionHandler}We.getExceptionHandler=Xt;function Ot(Zt){let nr=rh.exceptionHandler;return rh.exceptionHandler=Zt,nr}We.setExceptionHandler=Ot})(Ss||(Ss={}));var rh;(function(We){We.exceptionHandler=de=>{console.error(de)};function oe(de,Mr,qr){qr=qr||void 0;let Vr=Zt.get(de.sender);if(Vr||(Vr=[],Zt.set(de.sender,Vr)),ur(Vr,de,Mr,qr))return!1;let ti=qr||Mr,Xr=nr.get(ti);Xr||(Xr=[],nr.set(ti,Xr));let Ki={signal:de,slot:Mr,thisArg:qr};return Vr.push(Ki),Xr.push(Ki),!0}We.connect=oe;function Pe(de,Mr,qr){qr=qr||void 0;let Vr=Zt.get(de.sender);if(!Vr||Vr.length===0)return!1;let ti=ur(Vr,de,Mr,qr);if(!ti)return!1;let Xr=qr||Mr,Ki=nr.get(Xr);return ti.signal=null,Nt(Vr),Nt(Ki),!0}We.disconnect=Pe;function Ne(de,Mr){let qr=Zt.get(de);if(!qr||qr.length===0)return;let Vr=nr.get(Mr);if(!(!Vr||Vr.length===0)){for(let ti of Vr)ti.signal&&ti.signal.sender===de&&(ti.signal=null);Nt(qr),Nt(Vr)}}We.disconnectBetween=Ne;function Ze(de){let Mr=Zt.get(de);if(!(!Mr||Mr.length===0)){for(let qr of Mr){if(!qr.signal)continue;let Vr=qr.thisArg||qr.slot;qr.signal=null,Nt(nr.get(Vr))}Nt(Mr)}}We.disconnectSender=Ze;function ct(de){let Mr=nr.get(de);if(!(!Mr||Mr.length===0)){for(let qr of Mr){if(!qr.signal)continue;let Vr=qr.signal.sender;qr.signal=null,Nt(Zt.get(Vr))}Nt(Mr)}}We.disconnectReceiver=ct;function Xt(de){Ze(de),ct(de)}We.disconnectAll=Xt;function Ot(de,Mr){let qr=Zt.get(de.sender);if(!(!qr||qr.length===0))for(let Vr=0,ti=qr.length;Vrti.signal===Mr&&ti.slot===qr&&ti.thisArg===Vr)}function ir(de,Mr){let{signal:qr,slot:Vr,thisArg:ti}=de;try{Vr.call(ti,qr.sender,Mr)}catch(Xr){We.exceptionHandler(Xr)}}function Nt(de){Gt.size===0&&er(ar),Gt.add(de)}function ar(){Gt.forEach(Lr),Gt.clear()}function Lr(de){ew.ArrayExt.removeAllWhere(de,Ir)}function Ir(de){return de.signal===null}})(rh||(rh={}));var l0=class{constructor(oe){this._fn=oe}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let oe=this._fn;this._fn=null,oe()}};var cy=class{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(oe=>{oe.dispose()}),this._items.clear())}contains(oe){return this._items.has(oe)}add(oe){this._items.add(oe)}remove(oe){this._items.delete(oe)}clear(){this._items.clear()}};(function(We){function oe(Pe){let Ne=new We;for(let Ze of Pe)Ne.add(Ze);return Ne}We.from=oe})(cy||(cy={}));var tw=class extends cy{constructor(){super(...arguments),this._disposed=new Ss(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),Ss.clearData(this))}};(function(We){function oe(Pe){let Ne=new We;for(let Ze of Pe)Ne.add(Ze);return Ne}We.from=oe})(tw||(tw={}));var nf=class We{constructor(oe){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:Pe,edge:Ne,distance:Ze}=this._scrollTarget,ct=jc.SCROLL_EDGE_SIZE-Ze,Xt=Math.pow(ct/jc.SCROLL_EDGE_SIZE,2),Ot=Math.max(1,Math.round(Xt*jc.SCROLL_EDGE_SIZE));switch(Ne){case"top":Pe.scrollTop-=Ot;break;case"left":Pe.scrollLeft-=Ot;break;case"right":Pe.scrollLeft+=Ot;break;case"bottom":Pe.scrollTop+=Ot;break}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=oe.document||document,this.mimeData=oe.mimeData,this.dragImage=oe.dragImage||null,this.proposedAction=oe.proposedAction||"copy",this.supportedActions=oe.supportedActions||"all",this.source=oe.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let oe=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});jc.dispatchDragLeave(this,this._currentTarget,null,oe)}this._finalize("none")}}get isDisposed(){return this._disposed}start(oe,Pe){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(oe,Pe),this._promise=new Promise(Ze=>{this._resolve=Ze});let Ne=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:oe,clientY:Pe});return document.dispatchEvent(Ne),this._promise}handleEvent(oe){switch(oe.type){case"pointermove":this._evtPointerMove(oe);break;case"pointerup":this._evtPointerUp(oe);break;case"keydown":this._evtKeyDown(oe);break;default:oe.preventDefault(),oe.stopPropagation();break}}moveDragImage(oe,Pe){if(!this.dragImage)return;let Ne=this.dragImage.style;Ne.transform=`translate(${oe}px, ${Pe}px)`}_evtPointerMove(oe){oe.preventDefault(),oe.stopPropagation(),this._updateCurrentTarget(oe),this._updateDragScroll(oe),this.moveDragImage(oe.clientX,oe.clientY)}_evtPointerUp(oe){if(oe.preventDefault(),oe.stopPropagation(),oe.button!==0)return;if(this._updateCurrentTarget(oe),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){jc.dispatchDragLeave(this,this._currentTarget,null,oe),this._finalize("none");return}let Pe=jc.dispatchDrop(this,this._currentTarget,oe);this._finalize(Pe)}_evtKeyDown(oe){oe.preventDefault(),oe.stopPropagation(),oe.keyCode===27&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(oe){let Pe=jc.findScrollTarget(oe);!this._scrollTarget&&!Pe||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=Pe)}_updateCurrentTarget(oe){let Pe=this._currentTarget,Ne=this._currentTarget,Ze=this._currentElement,ct=jc.findElementBehindBackdrop(oe,this.document);this._currentElement=ct,ct!==Ze&&ct!==Ne&&jc.dispatchDragExit(this,Ne,ct,oe),ct!==Ze&&ct!==Ne&&(Ne=jc.dispatchDragEnter(this,ct,Ne,oe)),Ne!==Pe&&(this._currentTarget=Ne,jc.dispatchDragLeave(this,Pe,Ne,oe));let Xt=jc.dispatchDragOver(this,Ne,oe);this._setDropAction(Xt)}_attachDragImage(oe,Pe){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let Ne=this.dragImage.style;Ne.pointerEvents="none",Ne.position="fixed",Ne.transform=`translate(${oe}px, ${Pe}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let oe=this.dragImage.parentNode;oe&&oe.removeChild(this.dragImage)}_setDropAction(oe){if(oe=jc.validateAction(oe,this.supportedActions),!(this._override&&this._dropAction===oe))switch(oe){case"none":this._dropAction=oe,this._override=We.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=oe,this._override=We.overrideCursor("copy",this.document);break;case"link":this._dropAction=oe,this._override=We.overrideCursor("alias",this.document);break;case"move":this._dropAction=oe,this._override=We.overrideCursor("move",this.document);break}}_finalize(oe){let Pe=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,Pe&&Pe(oe)}};(function(We){class oe extends DragEvent{constructor(Ze,ct){super(ct.type,{bubbles:!0,cancelable:!0,altKey:Ze.altKey,button:Ze.button,clientX:Ze.clientX,clientY:Ze.clientY,ctrlKey:Ze.ctrlKey,detail:0,metaKey:Ze.metaKey,relatedTarget:ct.related,screenX:Ze.screenX,screenY:Ze.screenY,shiftKey:Ze.shiftKey,view:window});let{drag:Xt}=ct;this.dropAction="none",this.mimeData=Xt.mimeData,this.proposedAction=Xt.proposedAction,this.supportedActions=Xt.supportedActions,this.source=Xt.source}}We.Event=oe;function Pe(Ne,Ze=document){return jc.overrideCursor(Ne,Ze)}We.overrideCursor=Pe})(nf||(nf={}));var jc;(function(We){We.SCROLL_EDGE_SIZE=20;function oe(qr,Vr){return er[qr]&ur[Vr]?qr:"none"}We.validateAction=oe;function Pe(qr,Vr=document){if(qr){if(Ne&&qr==Ne.event)return Ne.element;We.cursorBackdrop.style.zIndex="-1000";let ti=Vr.elementFromPoint(qr.clientX,qr.clientY);return We.cursorBackdrop.style.zIndex="",Ne={event:qr,element:ti},ti}else{let ti=We.cursorBackdrop.style.transform;if(Ze&&ti===Ze.transform)return Ze.element;let Xr=We.cursorBackdrop.getBoundingClientRect();We.cursorBackdrop.style.zIndex="-1000";let Ki=Vr.elementFromPoint(Xr.left+Xr.width/2,Xr.top+Xr.height/2);return We.cursorBackdrop.style.zIndex="",Ze={transform:ti,element:Ki},Ki}}We.findElementBehindBackdrop=Pe;let Ne=null,Ze=null;function ct(qr){let Vr=qr.clientX,ti=qr.clientY,Xr=Pe(qr);for(;Xr;Xr=Xr.parentElement){if(!Xr.hasAttribute("data-lm-dragscroll"))continue;let Ki=0,Ia=0;Xr===document.body&&(Ki=window.pageXOffset,Ia=window.pageYOffset);let _i=Xr.getBoundingClientRect(),ia=_i.top+Ia,Yr=_i.left+Ki,Ba=Yr+_i.width,eo=ia+_i.height;if(Vr=Ba||ti=eo)continue;let rs=Vr-Yr+1,Oo=ti-ia+1,da=Ba-Vr,cn=eo-ti,Es=Math.min(rs,Oo,da,cn);if(Es>We.SCROLL_EDGE_SIZE)continue;let is;switch(Es){case cn:is="bottom";break;case Oo:is="top";break;case da:is="right";break;case rs:is="left";break;default:throw"unreachable"}let Do=Xr.scrollWidth-Xr.clientWidth,sl=Xr.scrollHeight-Xr.clientHeight,cu;switch(is){case"top":cu=sl>0&&Xr.scrollTop>0;break;case"left":cu=Do>0&&Xr.scrollLeft>0;break;case"right":cu=Do>0&&Xr.scrollLeft0&&Xr.scrollTop{ti===Mr&&We.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",Nt,!0),We.cursorBackdrop.removeEventListener("scroll",ar,!0),Xr.removeChild(We.cursorBackdrop))})}We.overrideCursor=ir;function Nt(qr){if(We.cursorBackdrop){We.cursorBackdrop.style.transform=`translate(${qr.clientX}px, ${qr.clientY}px)`;try{We.cursorBackdrop.hasPointerCapture(qr.pointerId)||We.cursorBackdrop.setPointerCapture(qr.pointerId)}catch{}}}function ar(qr){if(!We.cursorBackdrop)return;let Vr=Pe();if(!Vr)return;let ti=Vr.closest("[data-lm-dragscroll]");ti&&(ti.scrollTop+=We.cursorBackdrop.scrollTop-Ir,ti.scrollLeft+=We.cursorBackdrop.scrollLeft-Ir,Lr())}function Lr(){We.cursorBackdrop.scrollTop=Ir,We.cursorBackdrop.scrollLeft=Ir}let Ir=500;function de(){let qr=document.createElement("div");return qr.classList.add("lm-cursor-backdrop"),qr}let Mr=0;We.cursorBackdrop=de()})(jc||(jc={}));var Aj=dp(uv()),cc=dp(Q2());function Qm(){return YS.keyboardLayout}var fy=class We{constructor(oe,Pe,Ne=[]){this.name=oe,this._codes=Pe,this._keys=We.extractKeys(Pe),this._modifierKeys=We.convertToKeySet(Ne)}keys(){return Object.keys(this._keys)}isValidKey(oe){return oe in this._keys}isModifierKey(oe){return oe in this._modifierKeys}keyForKeydownEvent(oe){return this._codes[oe.keyCode]||""}};(function(We){function oe(Ne){let Ze=Object.create(null);for(let ct in Ne)Ze[Ne[ct]]=!0;return Ze}We.extractKeys=oe;function Pe(Ne){let Ze=Object(null);for(let ct=0,Xt=Ne.length;ct{this._commands.delete(oe),this._commandChanged.emit({id:oe,type:"removed"})})}notifyCommandChanged(oe){if(oe!==void 0&&!this._commands.has(oe))throw new Error(`Command '${oe}' is not registered.`);this._commandChanged.emit({id:oe,type:oe?"changed":"many-changed"})}describedBy(oe,Pe=cc.JSONExt.emptyObject){var Ne;let Ze=this._commands.get(oe);return Promise.resolve((Ne=Ze?.describedBy.call(void 0,Pe))!==null&&Ne!==void 0?Ne:{args:null})}label(oe,Pe=cc.JSONExt.emptyObject){var Ne;let Ze=this._commands.get(oe);return(Ne=Ze?.label.call(void 0,Pe))!==null&&Ne!==void 0?Ne:""}mnemonic(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.mnemonic.call(void 0,Pe):-1}icon(oe,Pe=cc.JSONExt.emptyObject){var Ne;return(Ne=this._commands.get(oe))===null||Ne===void 0?void 0:Ne.icon.call(void 0,Pe)}iconClass(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.iconClass.call(void 0,Pe):""}iconLabel(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.iconLabel.call(void 0,Pe):""}caption(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.caption.call(void 0,Pe):""}usage(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.usage.call(void 0,Pe):""}className(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.className.call(void 0,Pe):""}dataset(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.dataset.call(void 0,Pe):{}}isEnabled(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.isEnabled.call(void 0,Pe):!1}isToggled(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.isToggled.call(void 0,Pe):!1}isToggleable(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.isToggleable:!1}isVisible(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);return Ne?Ne.isVisible.call(void 0,Pe):!1}execute(oe,Pe=cc.JSONExt.emptyObject){let Ne=this._commands.get(oe);if(!Ne)return Promise.reject(new Error(`Command '${oe}' not registered.`));let Ze;try{Ze=Ne.execute.call(void 0,Pe)}catch(Xt){Ze=Promise.reject(Xt)}let ct=Promise.resolve(Ze);return this._commandExecuted.emit({id:oe,args:Pe,result:ct}),ct}addKeyBinding(oe){let Pe=vd.createKeyBinding(oe);return this._keyBindings.push(Pe),this._keyBindingChanged.emit({binding:Pe,type:"added"}),new l0(()=>{Aj.ArrayExt.removeFirstOf(this._keyBindings,Pe),this._keyBindingChanged.emit({binding:Pe,type:"removed"})})}processKeydownEvent(oe){if(oe.defaultPrevented||this._replaying)return;let Pe=We.keystrokeForKeydownEvent(oe);if(!Pe){this._replayKeydownEvents(),this._clearPendingState();return}if(We.isModifierKeyPressed(oe)){let{exact:Xt}=vd.matchKeyBinding(this._keyBindings,[Pe],oe);Xt?(oe.preventDefault(),oe.stopPropagation(),this._startModifierTimer(Xt)):this._clearModifierTimer();return}this._keystrokes.push(Pe);let{exact:Ne,partial:Ze}=vd.matchKeyBinding(this._keyBindings,this._keystrokes,oe),ct=Ze.length!==0;if(!Ne&&!ct){this._replayKeydownEvents(),this._clearPendingState();return}if((Ne?.preventDefault||Ze.some(Xt=>Xt.preventDefault))&&(oe.preventDefault(),oe.stopPropagation()),this._keydownEvents.push(oe),Ne&&!ct){this._executeKeyBinding(Ne),this._clearPendingState();return}Ne&&(this._exactKeyMatch=Ne),this._startTimer()}holdKeyBindingExecution(oe,Pe){this._holdKeyBindingPromises.set(oe,Pe)}processKeyupEvent(oe){this._clearModifierTimer()}_startModifierTimer(oe){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(oe)},vd.modifierkeyTimeOut)}_clearModifierTimer(){this._timerModifierID!==0&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},vd.CHORD_TIMEOUT)}_clearTimer(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(vd.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(oe){if(this._holdKeyBindingPromises.size!==0){let ct=[...this._keydownEvents],Xt=(await Promise.race([Promise.all(ct.map(async Ot=>{var Zt;return(Zt=this._holdKeyBindingPromises.get(Ot))!==null&&Zt!==void 0?Zt:Promise.resolve(!0)})),new Promise(Ot=>{setTimeout(()=>Ot([!1]),vd.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!Xt)return}let{command:Pe,args:Ne}=oe,Ze={_luminoEvent:{type:"keybinding",keys:oe.keys},...Ne};if(!this.hasCommand(Pe)||!this.isEnabled(Pe,Ze)){let ct=this.hasCommand(Pe)?"enabled":"registered",Ot=`Cannot execute key binding '${oe.keys.join(", ")}':`,Zt=`command '${Pe}' is not ${ct}.`;console.warn(`${Ot} ${Zt}`);return}await this.execute(Pe,Ze)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}};(function(We){function oe(Ot){let Zt="",nr=!1,Gt=!1,er=!1,ur=!1;for(let ir of Ot.split(/\s+/))ir==="Accel"?Nc.IS_MAC?Gt=!0:er=!0:ir==="Alt"?nr=!0:ir==="Cmd"?Gt=!0:ir==="Ctrl"?er=!0:ir==="Shift"?ur=!0:ir.length>0&&(Zt=ir);return{cmd:Gt,ctrl:er,alt:nr,shift:ur,key:Zt}}We.parseKeystroke=oe;function Pe(Ot){let Zt="",nr=oe(Ot);return nr.ctrl&&(Zt+="Ctrl "),nr.alt&&(Zt+="Alt "),nr.shift&&(Zt+="Shift "),nr.cmd&&Nc.IS_MAC&&(Zt+="Cmd "),nr.key?Zt+nr.key:Zt.trim()}We.normalizeKeystroke=Pe;function Ne(Ot){let Zt;return Nc.IS_WIN?Zt=Ot.winKeys||Ot.keys:Nc.IS_MAC?Zt=Ot.macKeys||Ot.keys:Zt=Ot.linuxKeys||Ot.keys,Zt.map(Pe)}We.normalizeKeys=Ne;function Ze(Ot){return typeof Ot=="string"?Zt(Ot):Ot.map(Zt).join(", ");function Zt(nr){let Gt=[],er=Nc.IS_MAC?" ":"+",ur=oe(nr);return ur.ctrl&&Gt.push("Ctrl"),ur.alt&&Gt.push("Alt"),ur.shift&&Gt.push("Shift"),Nc.IS_MAC&&ur.cmd&&Gt.push("Cmd"),Gt.push(ur.key),Gt.map(vd.formatKey).join(er)}}We.formatKeystroke=Ze;function ct(Ot){let Zt=Qm(),nr=Zt.keyForKeydownEvent(Ot);return Zt.isModifierKey(nr)}We.isModifierKeyPressed=ct;function Xt(Ot){let Zt=Qm(),nr=Zt.keyForKeydownEvent(Ot),Gt=[];return Ot.ctrlKey&&Gt.push("Ctrl"),Ot.altKey&&Gt.push("Alt"),Ot.shiftKey&&Gt.push("Shift"),Ot.metaKey&&Nc.IS_MAC&&Gt.push("Cmd"),Zt.isModifierKey(nr)||Gt.push(nr),Gt.join(" ")}We.keystrokeForKeydownEvent=Xt})(mp||(mp={}));var vd;(function(We){We.CHORD_TIMEOUT=1e3,We.KEYBINDING_HOLD_TIMEOUT=1e3,We.modifierkeyTimeOut=500;function oe(Mr){return{execute:Mr.execute,describedBy:Nt(typeof Mr.describedBy=="function"?Mr.describedBy:{args:null,...Mr.describedBy},()=>({args:null})),label:Nt(Mr.label,Zt),mnemonic:Nt(Mr.mnemonic,nr),icon:Nt(Mr.icon,ir),iconClass:Nt(Mr.iconClass,Zt),iconLabel:Nt(Mr.iconLabel,Zt),caption:Nt(Mr.caption,Zt),usage:Nt(Mr.usage,Zt),className:Nt(Mr.className,Zt),dataset:Nt(Mr.dataset,ur),isEnabled:Mr.isEnabled||Gt,isToggled:Mr.isToggled||er,isToggleable:Mr.isToggleable||!!Mr.isToggled,isVisible:Mr.isVisible||Gt}}We.createCommand=oe;function Pe(Mr){var qr;return{keys:mp.normalizeKeys(Mr),selector:ar(Mr),command:Mr.command,args:Mr.args||cc.JSONExt.emptyObject,preventDefault:(qr=Mr.preventDefault)!==null&&qr!==void 0?qr:!0}}We.createKeyBinding=Pe;function Ne(Mr,qr,Vr){let ti=null,Xr=[],Ki=1/0,Ia=0;for(let _i=0,ia=Mr.length;_iKi)continue;let rs=pd.calculateSpecificity(Yr.selector);(!ti||eo=Ia)&&(ti=Yr,Ki=eo,Ia=rs)}return{exact:ti,partial:Xr}}We.matchKeyBinding=Ne;function Ze(Mr){Mr.target.dispatchEvent(de(Mr))}We.replayKeyEvent=Ze;function ct(Mr){return Nc.IS_MAC?Xt.hasOwnProperty(Mr)?Xt[Mr]:Mr:Ot.hasOwnProperty(Mr)?Ot[Mr]:Mr}We.formatKey=ct;let Xt={Backspace:"\u232B",Tab:"\u21E5",Enter:"\u23CE",Shift:"\u21E7",Ctrl:"\u2303",Alt:"\u2325",Escape:"\u238B",PageUp:"\u21DE",PageDown:"\u21DF",End:"\u2198",Home:"\u2196",ArrowLeft:"\u2190",ArrowUp:"\u2191",ArrowRight:"\u2192",ArrowDown:"\u2193",Delete:"\u2326",Cmd:"\u2318"},Ot={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},Zt=()=>"",nr=()=>-1,Gt=()=>!0,er=()=>!1,ur=()=>({}),ir=()=>{};function Nt(Mr,qr){return Mr===void 0?qr:typeof Mr=="function"?Mr:()=>Mr}function ar(Mr){if(Mr.selector.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${Mr.selector}`);if(!pd.isValid(Mr.selector))throw new Error(`Invalid selector: ${Mr.selector}`);return Mr.selector}function Lr(Mr,qr){if(Mr.lengthqr.length?2:1}function Ir(Mr,qr){let Vr=qr.target,ti=qr.currentTarget;for(let Xr=0;Vr!==null;Vr=Vr.parentElement,++Xr){if(Vr.hasAttribute("data-lm-suppress-shortcuts"))return-1;if(pd.matches(Vr,Mr))return Xr;if(Vr===ti)return-1}return-1}function de(Mr){let qr=document.createEvent("Event"),Vr=Mr.bubbles||!0,ti=Mr.cancelable||!0;return qr.initEvent(Mr.type||"keydown",Vr,ti),qr.key=Mr.key||"",qr.keyCode=Mr.keyCode||0,qr.which=Mr.keyCode||0,qr.ctrlKey=Mr.ctrlKey||!1,qr.altKey=Mr.altKey||!1,qr.shiftKey=Mr.shiftKey||!1,qr.metaKey=Mr.metaKey||!1,qr.view=Mr.view||window,qr}})(vd||(vd={}));var e1=dp(uv()),t1=class{constructor(oe){this.type="text",this.content=oe}},hy=class{constructor(oe,Pe,Ne,Ze){this.type="element",this.tag=oe,this.attrs=Pe,this.children=Ne,this.renderer=Ze}};function Ps(We){let oe={},Pe,Ne=[];for(let ct=1,Xt=arguments.length;ct=Ir.length){Pe(ar[qr],ir);continue}let Vr=Ir[qr],ti=ar[qr];if(Vr===ti){de=de.nextSibling;continue}if(Vr.type==="text"&&ti.type==="text"){de.textContent!==ti.content&&(de.textContent=ti.content),de=de.nextSibling;continue}if(Vr.type==="text"||ti.type==="text"){e1.ArrayExt.insert(Ir,qr,ti),Pe(ti,ir,de);continue}if(!Vr.renderer!=!ti.renderer){e1.ArrayExt.insert(Ir,qr,ti),Pe(ti,ir,de);continue}let Xr=ti.attrs.key;if(Xr&&Xr in Lr){let Ia=Lr[Xr];Ia.vNode!==Vr&&(e1.ArrayExt.move(Ir,Ir.indexOf(Ia.vNode,qr+1),qr),ir.insertBefore(Ia.element,de),Vr=Ia.vNode,de=Ia.element)}if(Vr===ti){de=de.nextSibling;continue}let Ki=Vr.attrs.key;if(Ki&&Ki!==Xr){e1.ArrayExt.insert(Ir,qr,ti),Pe(ti,ir,de);continue}if(Vr.tag!==ti.tag){e1.ArrayExt.insert(Ir,qr,ti),Pe(ti,ir,de);continue}Ot(de,Vr.attrs,ti.attrs),ti.renderer?ti.renderer.render(de,{attrs:ti.attrs,children:ti.children}):Ne(de,Vr.children,ti.children),de=de.nextSibling}Ze(ir,Ir,Mr,!0)}We.updateContent=Ne;function Ze(ir,Nt,ar,Lr){for(let Ir=Nt.length-1;Ir>=ar;--Ir){let de=Nt[Ir],Mr=Lr?ir.lastChild:ir.childNodes[Ir];de.type==="text"||(de.renderer&&de.renderer.unrender?de.renderer.unrender(Mr,{attrs:de.attrs,children:de.children}):Ze(Mr,de.children,0,!1)),Lr&&ir.removeChild(Mr)}}let ct={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function Xt(ir,Nt){for(let ar in Nt)ar in ct||(ar.substr(0,2)==="on"?ir[ar]=Nt[ar]:ir.setAttribute(ar,Nt[ar]));Nt.className!==void 0&&ir.setAttribute("class",Nt.className),Nt.htmlFor!==void 0&&ir.setAttribute("for",Nt.htmlFor),Nt.dataset&&Zt(ir,Nt.dataset),Nt.style&&Gt(ir,Nt.style)}function Ot(ir,Nt,ar){if(Nt===ar)return;let Lr;for(Lr in Nt)Lr in ct||Lr in ar||(Lr.substr(0,2)==="on"?ir[Lr]=null:ir.removeAttribute(Lr));for(Lr in ar)Lr in ct||Nt[Lr]===ar[Lr]||(Lr.substr(0,2)==="on"?ir[Lr]=ar[Lr]:ir.setAttribute(Lr,ar[Lr]));Nt.className!==ar.className&&(ar.className!==void 0?ir.setAttribute("class",ar.className):ir.removeAttribute("class")),Nt.htmlFor!==ar.htmlFor&&(ar.htmlFor!==void 0?ir.setAttribute("for",ar.htmlFor):ir.removeAttribute("for")),Nt.dataset!==ar.dataset&&nr(ir,Nt.dataset||{},ar.dataset||{}),Nt.style!==ar.style&&er(ir,Nt.style||{},ar.style||{})}function Zt(ir,Nt){for(let ar in Nt)ir.setAttribute(`data-${ar}`,Nt[ar])}function nr(ir,Nt,ar){for(let Lr in Nt)Lr in ar||ir.removeAttribute(`data-${Lr}`);for(let Lr in ar)Nt[Lr]!==ar[Lr]&&ir.setAttribute(`data-${Lr}`,ar[Lr])}function Gt(ir,Nt){let ar=ir.style,Lr;for(Lr in Nt)ar[Lr]=Nt[Lr]}function er(ir,Nt,ar){let Lr=ir.style,Ir;for(Ir in Nt)Ir in ar||(Lr[Ir]="");for(Ir in ar)Nt[Ir]!==ar[Ir]&&(Lr[Ir]=ar[Ir])}function ur(ir,Nt){let ar=ir.firstChild,Lr=Object.create(null);for(let Ir of Nt)Ir.type==="element"&&Ir.attrs.key&&(Lr[Ir.attrs.key]={vNode:Ir,element:ar}),ar=ar.nextSibling;return Lr}})(fv||(fv={}));var Yd=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}},ah;(function(We){function oe(ct,Xt){let Ot=ct.length;if(Ot===0)return Xt;let Zt=0,nr=0,Gt=0,er=0,ur=0;for(let ar=0;ar0&&(er+=Lr.stretch,ur++)}if(Xt===Gt)return 0;if(Xt<=Zt){for(let ar=0;ar=nr){for(let ar=0;ar0&&ar>ir;){let Lr=ar,Ir=er;for(let de=0;de0&&ar>ir;){let Lr=ar/Nt;for(let Ir=0;Ir0&&ar>ir;){let Lr=ar,Ir=er;for(let de=0;de=Mr.maxSize?(ar-=Mr.maxSize-Mr.size,er-=Mr.stretch,Mr.size=Mr.maxSize,Mr.done=!0,Nt--,ur--):(ar-=qr,Mr.size+=qr)}}for(;Nt>0&&ar>ir;){let Lr=ar/Nt;for(let Ir=0;Ir=de.maxSize?(ar-=de.maxSize-de.size,de.size=de.maxSize,de.done=!0,Nt--):(ar-=Lr,de.size+=Lr))}}}return 0}We.calc=oe;function Pe(ct,Xt,Ot){ct.length===0||Ot===0||(Ot>0?Ne(ct,Xt,Ot):Ze(ct,Xt,-Ot))}We.adjust=Pe;function Ne(ct,Xt,Ot){let Zt=0;for(let ur=0;ur<=Xt;++ur){let ir=ct[ur];Zt+=ir.maxSize-ir.size}let nr=0;for(let ur=Xt+1,ir=ct.length;ur=0&&Gt>0;--ur){let ir=ct[ur],Nt=ir.maxSize-ir.size;Nt>=Gt?(ir.sizeHint=ir.size+Gt,Gt=0):(ir.sizeHint=ir.size+Nt,Gt-=Nt)}let er=Ot;for(let ur=Xt+1,ir=ct.length;ur0;++ur){let Nt=ct[ur],ar=Nt.size-Nt.minSize;ar>=er?(Nt.sizeHint=Nt.size-er,er=0):(Nt.sizeHint=Nt.size-ar,er-=ar)}}function Ze(ct,Xt,Ot){let Zt=0;for(let ur=Xt+1,ir=ct.length;ur0;++ur){let Nt=ct[ur],ar=Nt.maxSize-Nt.size;ar>=Gt?(Nt.sizeHint=Nt.size+Gt,Gt=0):(Nt.sizeHint=Nt.size+ar,Gt-=ar)}let er=Ot;for(let ur=Xt;ur>=0&&er>0;--ur){let ir=ct[ur],Nt=ir.size-ir.minSize;Nt>=er?(ir.sizeHint=ir.size-er,er=0):(ir.sizeHint=ir.size-Nt,er-=Nt)}}})(ah||(ah={}));var dy=class{constructor(oe){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Ss(this),this._isDisposed=!1,this.owner=oe.owner,oe.label!==void 0&&(this._label=oe.label),oe.mnemonic!==void 0&&(this._mnemonic=oe.mnemonic),oe.icon!==void 0&&(this._icon=oe.icon),oe.iconClass!==void 0&&(this._iconClass=oe.iconClass),oe.iconLabel!==void 0&&(this._iconLabel=oe.iconLabel),oe.caption!==void 0&&(this._caption=oe.caption),oe.className!==void 0&&(this._className=oe.className),oe.closable!==void 0&&(this._closable=oe.closable),this._dataset=oe.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(oe){this._label!==oe&&(this._label=oe,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(oe){this._mnemonic!==oe&&(this._mnemonic=oe,this._changed.emit(void 0))}get icon(){return this._icon}set icon(oe){this._icon!==oe&&(this._icon=oe,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(oe){this._iconClass!==oe&&(this._iconClass=oe,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(oe){this._iconLabel!==oe&&(this._iconLabel=oe,this._changed.emit(void 0))}get caption(){return this._caption}set caption(oe){this._caption!==oe&&(this._caption=oe,this._changed.emit(void 0))}get className(){return this._className}set className(oe){this._className!==oe&&(this._className=oe,this._changed.emit(void 0))}get closable(){return this._closable}set closable(oe){this._closable!==oe&&(this._closable=oe,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(oe){this._dataset!==oe&&(this._dataset=oe,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,Ss.clearData(this))}},Ya=class We{constructor(oe={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new Ss(this),this._hiddenMode=We.HiddenMode.Display,this.node=rw.createNode(oe),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(We.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&We.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Ss.clearData(this),za.clearData(this),af.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(We.Flag.IsDisposed)}get isAttached(){return this.testFlag(We.Flag.IsAttached)}get isHidden(){return this.testFlag(We.Flag.IsHidden)}get isVisible(){let oe=this;do{if(oe.isHidden||!oe.isAttached)return!1;oe=oe.parent}while(oe!=null);return!0}get title(){return rw.titleProperty.get(this)}get id(){return this.node.id}set id(oe){this.node.id=oe}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(oe){this._hiddenMode!==oe&&(this.isHidden&&this._toggleHidden(!1),oe==We.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=oe,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(oe){if(this._parent!==oe){if(oe&&this.contains(oe))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let Pe=new We.ChildMessage("child-removed",this);za.sendMessage(this._parent,Pe)}if(this._parent=oe,this._parent&&!this._parent.isDisposed){let Pe=new We.ChildMessage("child-added",this);za.sendMessage(this._parent,Pe)}this.isDisposed||za.sendMessage(this,We.Msg.ParentChanged)}}get layout(){return this._layout}set layout(oe){if(this._layout!==oe){if(this.testFlag(We.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(oe.parent)throw new Error("Cannot change layout parent.");this._layout=oe,oe.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(oe){for(let Pe=oe;Pe;Pe=Pe._parent)if(Pe===this)return!0;return!1}hasClass(oe){return this.node.classList.contains(oe)}addClass(oe){this.node.classList.add(oe)}removeClass(oe){this.node.classList.remove(oe)}toggleClass(oe,Pe){return Pe===!0?(this.node.classList.add(oe),!0):Pe===!1?(this.node.classList.remove(oe),!1):this.node.classList.toggle(oe)}update(){za.postMessage(this,We.Msg.UpdateRequest)}fit(){za.postMessage(this,We.Msg.FitRequest)}activate(){za.postMessage(this,We.Msg.ActivateRequest)}close(){za.sendMessage(this,We.Msg.CloseRequest)}show(){if(this.testFlag(We.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&za.sendMessage(this,We.Msg.BeforeShow),this.clearFlag(We.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&za.sendMessage(this,We.Msg.AfterShow),this.parent)){let oe=new We.ChildMessage("child-shown",this);za.sendMessage(this.parent,oe)}}hide(){if(!this.testFlag(We.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&za.sendMessage(this,We.Msg.BeforeHide),this.setFlag(We.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&za.sendMessage(this,We.Msg.AfterHide),this.parent)){let oe=new We.ChildMessage("child-hidden",this);za.sendMessage(this.parent,oe)}}setHidden(oe){oe?this.hide():this.show()}testFlag(oe){return(this._flags&oe)!==0}setFlag(oe){this._flags|=oe}clearFlag(oe){this._flags&=~oe}processMessage(oe){switch(oe.type){case"resize":this.notifyLayout(oe),this.onResize(oe);break;case"update-request":this.notifyLayout(oe),this.onUpdateRequest(oe);break;case"fit-request":this.notifyLayout(oe),this.onFitRequest(oe);break;case"before-show":this.notifyLayout(oe),this.onBeforeShow(oe);break;case"after-show":this.setFlag(We.Flag.IsVisible),this.notifyLayout(oe),this.onAfterShow(oe);break;case"before-hide":this.notifyLayout(oe),this.onBeforeHide(oe);break;case"after-hide":this.clearFlag(We.Flag.IsVisible),this.notifyLayout(oe),this.onAfterHide(oe);break;case"before-attach":this.notifyLayout(oe),this.onBeforeAttach(oe);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(We.Flag.IsVisible),this.setFlag(We.Flag.IsAttached),this.notifyLayout(oe),this.onAfterAttach(oe);break;case"before-detach":this.notifyLayout(oe),this.onBeforeDetach(oe);break;case"after-detach":this.clearFlag(We.Flag.IsVisible),this.clearFlag(We.Flag.IsAttached),this.notifyLayout(oe),this.onAfterDetach(oe);break;case"activate-request":this.notifyLayout(oe),this.onActivateRequest(oe);break;case"close-request":this.notifyLayout(oe),this.onCloseRequest(oe);break;case"child-added":this.notifyLayout(oe),this.onChildAdded(oe);break;case"child-removed":this.notifyLayout(oe),this.onChildRemoved(oe);break;default:this.notifyLayout(oe);break}}notifyLayout(oe){this._layout&&this._layout.processParentMessage(oe)}onCloseRequest(oe){this.parent?this.parent=null:this.isAttached&&We.detach(this)}onResize(oe){}onUpdateRequest(oe){}onFitRequest(oe){}onActivateRequest(oe){}onBeforeShow(oe){}onAfterShow(oe){}onBeforeHide(oe){}onAfterHide(oe){}onBeforeAttach(oe){}onAfterAttach(oe){}onBeforeDetach(oe){}onAfterDetach(oe){}onChildAdded(oe){}onChildRemoved(oe){}_toggleHidden(oe){if(oe)switch(this._hiddenMode){case We.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case We.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case We.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1",this.node.style.opacity="0";break}else switch(this._hiddenMode){case We.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case We.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case We.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="",this.node.style.opacity="";break}}};(function(We){(function(ct){ct[ct.Display=0]="Display",ct[ct.Scale=1]="Scale",ct[ct.ContentVisibility=2]="ContentVisibility"})(We.HiddenMode||(We.HiddenMode={})),(function(ct){ct[ct.IsDisposed=1]="IsDisposed",ct[ct.IsAttached=2]="IsAttached",ct[ct.IsHidden=4]="IsHidden",ct[ct.IsVisible=8]="IsVisible",ct[ct.DisallowLayout=16]="DisallowLayout"})(We.Flag||(We.Flag={})),(function(ct){ct.BeforeShow=new rf("before-show"),ct.AfterShow=new rf("after-show"),ct.BeforeHide=new rf("before-hide"),ct.AfterHide=new rf("after-hide"),ct.BeforeAttach=new rf("before-attach"),ct.AfterAttach=new rf("after-attach"),ct.BeforeDetach=new rf("before-detach"),ct.AfterDetach=new rf("after-detach"),ct.ParentChanged=new rf("parent-changed"),ct.UpdateRequest=new s0("update-request"),ct.FitRequest=new s0("fit-request"),ct.ActivateRequest=new s0("activate-request"),ct.CloseRequest=new s0("close-request")})(We.Msg||(We.Msg={}));class oe extends rf{constructor(Xt,Ot){super(Xt),this.child=Ot}}We.ChildMessage=oe;class Pe extends rf{constructor(Xt,Ot){super("resize"),this.width=Xt,this.height=Ot}}We.ResizeMessage=Pe,(function(ct){ct.UnknownSize=new ct(-1,-1)})(Pe=We.ResizeMessage||(We.ResizeMessage={}));function Ne(ct,Xt,Ot=null){if(ct.parent)throw new Error("Cannot attach a child widget.");if(ct.isAttached||ct.node.isConnected)throw new Error("Widget is already attached.");if(!Xt.isConnected)throw new Error("Host is not attached.");za.sendMessage(ct,We.Msg.BeforeAttach),Xt.insertBefore(ct.node,Ot),za.sendMessage(ct,We.Msg.AfterAttach)}We.attach=Ne;function Ze(ct){if(ct.parent)throw new Error("Cannot detach a child widget.");if(!ct.isAttached||!ct.node.isConnected)throw new Error("Widget is not attached.");za.sendMessage(ct,We.Msg.BeforeDetach),ct.node.parentNode.removeChild(ct.node),za.sendMessage(ct,We.Msg.AfterDetach)}We.detach=Ze})(Ya||(Ya={}));var rw;(function(We){We.titleProperty=new af({name:"title",create:Pe=>new dy({owner:Pe})});function oe(Pe){return Pe.node||document.createElement(Pe.tag||"div")}We.createNode=oe})(rw||(rw={}));var xp=class{constructor(oe={}){this._disposed=!1,this._parent=null,this._fitPolicy=oe.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,Ss.clearData(this),af.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(oe){if(this._parent!==oe){if(this._parent)throw new Error("Cannot change parent widget.");if(oe.layout!==this)throw new Error("Invalid parent widget.");this._parent=oe,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(oe){if(this._fitPolicy!==oe&&(this._fitPolicy=oe,this._parent)){let Pe=this._parent.node.style;Pe.minWidth="",Pe.minHeight="",Pe.maxWidth="",Pe.maxHeight="",this._parent.fit()}}processParentMessage(oe){switch(oe.type){case"resize":this.onResize(oe);break;case"update-request":this.onUpdateRequest(oe);break;case"fit-request":this.onFitRequest(oe);break;case"before-show":this.onBeforeShow(oe);break;case"after-show":this.onAfterShow(oe);break;case"before-hide":this.onBeforeHide(oe);break;case"after-hide":this.onAfterHide(oe);break;case"before-attach":this.onBeforeAttach(oe);break;case"after-attach":this.onAfterAttach(oe);break;case"before-detach":this.onBeforeDetach(oe);break;case"after-detach":this.onAfterDetach(oe);break;case"child-removed":this.onChildRemoved(oe);break;case"child-shown":this.onChildShown(oe);break;case"child-hidden":this.onChildHidden(oe);break}}init(){for(let oe of this)oe.parent=this.parent}onResize(oe){for(let Pe of this)za.sendMessage(Pe,Ya.ResizeMessage.UnknownSize)}onUpdateRequest(oe){for(let Pe of this)za.sendMessage(Pe,Ya.ResizeMessage.UnknownSize)}onBeforeAttach(oe){for(let Pe of this)za.sendMessage(Pe,oe)}onAfterAttach(oe){for(let Pe of this)za.sendMessage(Pe,oe)}onBeforeDetach(oe){for(let Pe of this)za.sendMessage(Pe,oe)}onAfterDetach(oe){for(let Pe of this)za.sendMessage(Pe,oe)}onBeforeShow(oe){for(let Pe of this)Pe.isHidden||za.sendMessage(Pe,oe)}onAfterShow(oe){for(let Pe of this)Pe.isHidden||za.sendMessage(Pe,oe)}onBeforeHide(oe){for(let Pe of this)Pe.isHidden||za.sendMessage(Pe,oe)}onAfterHide(oe){for(let Pe of this)Pe.isHidden||za.sendMessage(Pe,oe)}onChildRemoved(oe){this.removeWidget(oe.child)}onFitRequest(oe){}onChildShown(oe){}onChildHidden(oe){}};(function(We){function oe(ct){return r1.horizontalAlignmentProperty.get(ct)}We.getHorizontalAlignment=oe;function Pe(ct,Xt){r1.horizontalAlignmentProperty.set(ct,Xt)}We.setHorizontalAlignment=Pe;function Ne(ct){return r1.verticalAlignmentProperty.get(ct)}We.getVerticalAlignment=Ne;function Ze(ct,Xt){r1.verticalAlignmentProperty.set(ct,Xt)}We.setVerticalAlignment=Ze})(xp||(xp={}));var pv=class{constructor(oe){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=oe,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let oe=this.widget.node.style;oe.position="",oe.top="",oe.left="",oe.width="",oe.height="",oe.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let oe=Fs.sizeLimits(this.widget.node);this._minWidth=oe.minWidth,this._minHeight=oe.minHeight,this._maxWidth=oe.maxWidth,this._maxHeight=oe.maxHeight}update(oe,Pe,Ne,Ze){let ct=Math.max(this._minWidth,Math.min(Ne,this._maxWidth)),Xt=Math.max(this._minHeight,Math.min(Ze,this._maxHeight));if(ct"center",changed:oe}),We.verticalAlignmentProperty=new af({name:"verticalAlignment",create:()=>"top",changed:oe});function oe(Pe){Pe.parent&&Pe.parent.layout&&Pe.parent.update()}})(r1||(r1={}));var i1=class extends xp{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(oe){this.insertWidget(this._widgets.length,oe)}insertWidget(oe,Pe){Pe.parent=this.parent;let Ne=this._widgets.indexOf(Pe),Ze=Math.max(0,Math.min(oe,this._widgets.length));if(Ne===-1){Ma.ArrayExt.insert(this._widgets,Ze,Pe),this.parent&&this.attachWidget(Ze,Pe);return}Ze===this._widgets.length&&Ze--,Ne!==Ze&&(Ma.ArrayExt.move(this._widgets,Ne,Ze),this.parent&&this.moveWidget(Ne,Ze,Pe))}removeWidget(oe){this.removeWidgetAt(this._widgets.indexOf(oe))}removeWidgetAt(oe){let Pe=Ma.ArrayExt.removeAt(this._widgets,oe);Pe&&this.parent&&this.detachWidget(oe,Pe)}init(){super.init();let oe=0;for(let Pe of this)this.attachWidget(oe++,Pe)}attachWidget(oe,Pe){let Ne=this.parent.node.children[oe];this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.BeforeAttach),this.parent.node.insertBefore(Pe.node,Ne),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.AfterAttach)}moveWidget(oe,Pe,Ne){this.parent.isAttached&&za.sendMessage(Ne,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Ne.node),this.parent.isAttached&&za.sendMessage(Ne,Ya.Msg.AfterDetach);let Ze=this.parent.node.children[Pe];this.parent.isAttached&&za.sendMessage(Ne,Ya.Msg.BeforeAttach),this.parent.node.insertBefore(Ne.node,Ze),this.parent.isAttached&&za.sendMessage(Ne,Ya.Msg.AfterAttach)}detachWidget(oe,Pe){this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Pe.node),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.AfterDetach)}},py;(function(We){function oe(Ne){return Math.max(0,Math.floor(Ne))}We.clampDimension=oe;function Pe(Ne){return"pointerType"in Ne&&Ne.pointerType==="touch"}We.isTouchEvent=Pe})(py||(py={}));var ih=py,bp=class We extends i1{constructor(oe){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=oe.renderer,oe.orientation!==void 0&&(this._orientation=oe.orientation),oe.alignment!==void 0&&(this._alignment=oe.alignment),oe.spacing!==void 0&&(this._spacing=py.clampDimension(oe.spacing))}dispose(){for(let oe of this._items)oe.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(oe){this._orientation!==oe&&(this._orientation=oe,this.parent&&(this.parent.dataset.orientation=oe,this.parent.fit()))}get alignment(){return this._alignment}set alignment(oe){this._alignment!==oe&&(this._alignment=oe,this.parent&&(this.parent.dataset.alignment=oe,this.parent.update()))}get spacing(){return this._spacing}set spacing(oe){oe=py.clampDimension(oe),this._spacing!==oe&&(this._spacing=oe,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(oe=>oe.size)}relativeSizes(){return yp.normalize(this._sizers.map(oe=>oe.size))}setRelativeSizes(oe,Pe=!0){let Ne=this._sizers.length,Ze=oe.slice(0,Ne);for(;Ze.length0&&(ct.sizeHint=ct.size);ah.adjust(this._sizers,oe,Ze),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(oe,Pe){let Ne=new pv(Pe),Ze=yp.createHandle(this.renderer),ct=yp.averageSize(this._sizers),Xt=yp.createSizer(ct);Ma.ArrayExt.insert(this._items,oe,Ne),Ma.ArrayExt.insert(this._sizers,oe,Xt),Ma.ArrayExt.insert(this._handles,oe,Ze),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.BeforeAttach),this.parent.node.appendChild(Pe.node),this.parent.node.appendChild(Ze),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.AfterAttach),this.parent.fit()}moveWidget(oe,Pe,Ne){Ma.ArrayExt.move(this._items,oe,Pe),Ma.ArrayExt.move(this._sizers,oe,Pe),Ma.ArrayExt.move(this._handles,oe,Pe),this.parent.fit()}detachWidget(oe,Pe){let Ne=Ma.ArrayExt.removeAt(this._items,oe),Ze=Ma.ArrayExt.removeAt(this._handles,oe);Ma.ArrayExt.removeAt(this._sizers,oe),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Pe.node),this.parent.node.removeChild(Ze),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.AfterDetach),Ne.dispose(),this.parent.fit()}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}updateItemPosition(oe,Pe,Ne,Ze,ct,Xt,Ot){let Zt=this._items[oe];if(Zt.isHidden)return;let nr=this._handles[oe].style;Pe?(Ne+=this.widgetOffset,Zt.update(Ne,Ze,Ot,ct),Ne+=Ot,nr.top=`${Ze}px`,nr.left=`${Ne}px`,nr.width=`${this._spacing}px`,nr.height=`${ct}px`):(Ze+=this.widgetOffset,Zt.update(Ne,Ze,Xt,Ot),Ze+=Ot,nr.top=`${Ze}px`,nr.left=`${Ne}px`,nr.width=`${Xt}px`,nr.height=`${this._spacing}px`)}_fit(){let oe=0,Pe=-1;for(let Zt=0,nr=this._items.length;Zt0&&(er.sizeHint=er.size),Gt.isHidden){er.minSize=0,er.maxSize=0;continue}Gt.fit(),er.stretch=We.getStretch(Gt.widget),Ne?(er.minSize=Gt.minWidth,er.maxSize=Gt.maxWidth,Ze+=Gt.minWidth,ct=Math.max(ct,Gt.minHeight)):(er.minSize=Gt.minHeight,er.maxSize=Gt.maxHeight,ct+=Gt.minHeight,Ze=Math.max(Ze,Gt.minWidth))}let Xt=this._box=Fs.boxSizing(this.parent.node);Ze+=Xt.horizontalSum,ct+=Xt.verticalSum;let Ot=this.parent.node.style;Ot.minWidth=`${Ze}px`,Ot.minHeight=`${ct}px`,this._dirty=!0,this.parent.parent&&za.sendMessage(this.parent.parent,Ya.Msg.FitRequest),this._dirty&&za.sendMessage(this.parent,Ya.Msg.UpdateRequest)}_update(oe,Pe){this._dirty=!1;let Ne=0;for(let er=0,ur=this._items.length;er0){let er;if(Gt?er=Math.max(0,Xt-this._fixed):er=Math.max(0,Ot-this._fixed),this._hasNormedSizes){for(let ir of this._sizers)ir.sizeHint*=er;this._hasNormedSizes=!1}let ur=ah.calc(this._sizers,er);if(ur>0)switch(this._alignment){case"start":break;case"center":Zt=0,nr=ur/2;break;case"end":Zt=0,nr=ur;break;case"justify":Zt=ur/Ne,nr=0;break;default:throw"unreachable"}}for(let er=0,ur=this._items.length;er0,coerce:(Xt,Ot)=>Math.max(0,Math.floor(Ot)),changed:ct});function oe(Xt){let Ot=new Yd;return Ot.sizeHint=Math.floor(Xt),Ot}We.createSizer=oe;function Pe(Xt){let Ot=Xt.createHandle();return Ot.style.position="absolute",Ot.style.contain="style",Ot}We.createHandle=Pe;function Ne(Xt){return Xt.reduce((Ot,Zt)=>Ot+Zt.size,0)/Xt.length||0}We.averageSize=Ne;function Ze(Xt){let Ot=Xt.length;if(Ot===0)return[];let Zt=Xt.reduce((nr,Gt)=>nr+Math.abs(Gt),0);return Zt===0?Xt.map(nr=>1/Ot):Xt.map(nr=>nr/Zt)}We.normalize=Ze;function ct(Xt){Xt.parent&&Xt.parent.layout instanceof bp&&Xt.parent.fit()}})(yp||(yp={}));var XS=class extends bp{constructor(oe){super({...oe,orientation:oe.orientation||"vertical"}),this._titles=[],this.titleSpace=oe.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(oe){oe=ih.clampDimension(oe),this.widgetOffset!==oe&&(this.widgetOffset=oe,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(oe,Pe){let Ne=this._titles[oe],Ze=Ne.classList.contains("lm-mod-expanded"),ct=iw.createTitle(this.renderer,Pe.title,Ze);this._titles[oe]=ct,this.parent.node.replaceChild(ct,Ne)}insertWidget(oe,Pe){Pe.id||(Pe.id=`id-${_p.UUID.uuid4()}`),super.insertWidget(oe,Pe)}attachWidget(oe,Pe){let Ne=iw.createTitle(this.renderer,Pe.title,!Pe.isHidden);Ma.ArrayExt.insert(this._titles,oe,Ne),this.parent.node.appendChild(Ne),Pe.node.setAttribute("role","region"),Pe.node.setAttribute("aria-labelledby",Ne.id),super.attachWidget(oe,Pe)}moveWidget(oe,Pe,Ne){Ma.ArrayExt.move(this._titles,oe,Pe),super.moveWidget(oe,Pe,Ne)}detachWidget(oe,Pe){let Ne=Ma.ArrayExt.removeAt(this._titles,oe);this.parent.node.removeChild(Ne),super.detachWidget(oe,Pe)}updateItemPosition(oe,Pe,Ne,Ze,ct,Xt,Ot){let Zt=this._titles[oe].style;Zt.top=`${Ze}px`,Zt.left=`${Ne}px`,Zt.height=`${this.widgetOffset}px`,Pe?Zt.width=`${ct}px`:Zt.width=`${Xt}px`,super.updateItemPosition(oe,Pe,Ne,Ze,ct,Xt,Ot)}},iw;(function(We){function oe(Pe,Ne,Ze=!0){let ct=Pe.createSectionTitle(Ne);return ct.style.position="absolute",ct.style.contain="strict",ct.setAttribute("aria-label",`${Ne.label} Section`),ct.setAttribute("aria-expanded",Ze?"true":"false"),ct.setAttribute("aria-controls",Ne.owner.id),Ze&&ct.classList.add("lm-mod-expanded"),ct}We.createTitle=oe})(iw||(iw={}));var aw=class extends Ya{constructor(oe={}){super(),this.addClass("lm-Panel"),this.layout=ZS.createLayout(oe)}get widgets(){return this.layout.widgets}addWidget(oe){this.layout.addWidget(oe)}insertWidget(oe,Pe){this.layout.insertWidget(oe,Pe)}},ZS;(function(We){function oe(Pe){return Pe.layout||new i1}We.createLayout=oe})(ZS||(ZS={}));var vv=class extends aw{constructor(oe={}){super({layout:KS.createLayout(oe)}),this._handleMoved=new Ss(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(oe){this.layout.orientation=oe}get alignment(){return this.layout.alignment}set alignment(oe){this.layout.alignment=oe}get spacing(){return this.layout.spacing}set spacing(oe){this.layout.spacing=oe}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(oe,Pe=!0){this.layout.setRelativeSizes(oe,Pe)}handleEvent(oe){switch(oe.type){case"pointerdown":this._evtPointerDown(oe);break;case"pointermove":this._evtPointerMove(oe);break;case"pointerup":this._evtPointerUp(oe);break;case"keydown":this._evtKeyDown(oe);break;case"contextmenu":oe.preventDefault(),oe.stopPropagation();break}}onBeforeAttach(oe){this.node.addEventListener("pointerdown",this)}onAfterDetach(oe){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(oe){oe.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(oe){oe.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(oe){this._pressData&&(oe.preventDefault(),oe.stopPropagation()),oe.keyCode===27&&this._releaseMouse()}_evtPointerDown(oe){if(oe.button!==0)return;let Pe=this.layout,Ne=Ma.ArrayExt.findFirstIndex(Pe.handles,nr=>nr.contains(oe.target));if(Ne===-1)return;oe.preventDefault(),oe.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let Ze,ct=Pe.handles[Ne],Xt=ct.getBoundingClientRect();Pe.orientation==="horizontal"?Ze=oe.clientX-Xt.left:Ze=oe.clientY-Xt.top;let Ot=window.getComputedStyle(ct),Zt=nf.overrideCursor(Ot.cursor);this._pressData={index:Ne,delta:Ze,override:Zt}}_evtPointerMove(oe){oe.preventDefault(),oe.stopPropagation();let Pe,Ne=this.layout,Ze=this.node.getBoundingClientRect();Ne.orientation==="horizontal"?Pe=oe.clientX-Ze.left-this._pressData.delta:Pe=oe.clientY-Ze.top-this._pressData.delta,Ne.moveHandle(this._pressData.index,Pe)}_evtPointerUp(oe){oe.button===0&&(oe.preventDefault(),oe.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}};(function(We){class oe{createHandle(){let ct=document.createElement("div");return ct.className="lm-SplitPanel-handle",ct}}We.Renderer=oe,We.defaultRenderer=new oe;function Pe(Ze){return bp.getStretch(Ze)}We.getStretch=Pe;function Ne(Ze,ct){bp.setStretch(Ze,ct)}We.setStretch=Ne})(vv||(vv={}));var KS;(function(We){function oe(Pe){return Pe.layout||new bp({renderer:Pe.renderer||vv.defaultRenderer,orientation:Pe.orientation,alignment:Pe.alignment,spacing:Pe.spacing})}We.createLayout=oe})(KS||(KS={}));var vy=class extends vv{constructor(oe={}){super({...oe,layout:JS.createLayout(oe)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new Ss(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(oe){this.layout.titleSpace=oe}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(oe){super.addWidget(oe),oe.title.changed.connect(this._onTitleChanged,this)}collapse(oe){let Pe=this.layout.widgets[oe];Pe&&!Pe.isHidden&&this._toggleExpansion(oe)}expand(oe){let Pe=this.layout.widgets[oe];Pe&&Pe.isHidden&&this._toggleExpansion(oe)}insertWidget(oe,Pe){super.insertWidget(oe,Pe),Pe.title.changed.connect(this._onTitleChanged,this)}handleEvent(oe){switch(super.handleEvent(oe),oe.type){case"click":this._evtClick(oe);break;case"keydown":this._eventKeyDown(oe);break}}onBeforeAttach(oe){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(oe)}onAfterDetach(oe){super.onAfterDetach(oe),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(oe){let Pe=Ma.ArrayExt.findFirstIndex(this.widgets,Ne=>Ne.contains(oe.owner));Pe>=0&&(this.layout.updateTitle(Pe,oe.owner),this.update())}_computeWidgetSize(oe){let Pe=this.layout,Ne=Pe.widgets[oe];if(!Ne)return;let Ze=Ne.isHidden,ct=Pe.absoluteSizes(),Xt=(Ze?-1:1)*this.spacing,Ot=ct.reduce((nr,Gt)=>nr+Gt),Zt=[...ct];if(Ze){let nr=this._widgetSizesCache.get(Ne);if(!nr)return;Zt[oe]+=nr;let Gt=Zt.map(er=>er-nr>0).lastIndexOf(!0);Gt===-1?Zt.forEach((er,ur)=>{ur!==oe&&(Zt[ur]-=ct[ur]/Ot*(nr-Xt))}):Zt[Gt]-=nr-Xt}else{let nr=ct[oe];this._widgetSizesCache.set(Ne,nr),Zt[oe]=0;let Gt=Zt.map(er=>er>0).lastIndexOf(!0);if(Gt===-1)return;Zt[Gt]=ct[Gt]+nr+Xt}return Zt.map(nr=>nr/(Ot+Xt))}_evtClick(oe){let Pe=oe.target;if(Pe){let Ne=Ma.ArrayExt.findFirstIndex(this.titles,Ze=>Ze.contains(Pe));Ne>=0&&(oe.preventDefault(),oe.stopPropagation(),this._toggleExpansion(Ne))}}_eventKeyDown(oe){if(oe.defaultPrevented)return;let Pe=oe.target,Ne=!1;if(Pe){let Ze=Ma.ArrayExt.findFirstIndex(this.titles,ct=>ct.contains(Pe));if(Ze>=0){let ct=oe.keyCode.toString();if(oe.key.match(/Space|Enter/)||ct.match(/13|32/))Pe.click(),Ne=!0;else if(this.orientation==="horizontal"?oe.key.match(/ArrowLeft|ArrowRight/)||ct.match(/37|39/):oe.key.match(/ArrowUp|ArrowDown/)||ct.match(/38|40/)){let Xt=oe.key.match(/ArrowLeft|ArrowUp/)||ct.match(/37|38/)?-1:1,Ot=this.titles.length,Zt=(Ze+Ot+Xt)%Ot;this.titles[Zt].focus(),Ne=!0}else oe.key==="End"||ct==="35"?(this.titles[this.titles.length-1].focus(),Ne=!0):(oe.key==="Home"||ct==="36")&&(this.titles[0].focus(),Ne=!0)}Ne&&oe.preventDefault()}}_toggleExpansion(oe){let Pe=this.titles[oe],Ne=this.layout.widgets[oe],Ze=this._computeWidgetSize(oe);Ze&&this.setRelativeSizes(Ze,!1),Ne.isHidden?(Pe.classList.add("lm-mod-expanded"),Pe.setAttribute("aria-expanded","true"),Ne.show()):(Pe.classList.remove("lm-mod-expanded"),Pe.setAttribute("aria-expanded","false"),Ne.hide()),this._expansionToggled.emit(oe)}};(function(We){class oe extends vv.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++oe._nInstance}createCollapseIcon(Ne){return document.createElement("span")}createSectionTitle(Ne){let Ze=document.createElement("h3");Ze.setAttribute("tabindex","0"),Ze.id=this.createTitleKey(Ne),Ze.className=this.titleClassName;for(let Ot in Ne.dataset)Ze.dataset[Ot]=Ne.dataset[Ot];let ct=Ze.appendChild(this.createCollapseIcon(Ne));ct.className="lm-AccordionPanel-titleCollapser";let Xt=Ze.appendChild(document.createElement("span"));return Xt.className="lm-AccordionPanel-titleLabel",Xt.textContent=Ne.label,Xt.title=Ne.caption||Ne.label,Ze}createTitleKey(Ne){let Ze=this._titleKeys.get(Ne);return Ze===void 0&&(Ze=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(Ne,Ze)),Ze}}oe._nInstance=0,We.Renderer=oe,We.defaultRenderer=new oe})(vy||(vy={}));var JS;(function(We){function oe(Pe){return Pe.layout||new XS({renderer:Pe.renderer||vy.defaultRenderer,orientation:Pe.orientation,alignment:Pe.alignment,spacing:Pe.spacing,titleSpace:Pe.titleSpace})}We.createLayout=oe})(JS||(JS={}));var Wd=class We extends i1{constructor(oe={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",oe.direction!==void 0&&(this._direction=oe.direction),oe.alignment!==void 0&&(this._alignment=oe.alignment),oe.spacing!==void 0&&(this._spacing=ih.clampDimension(oe.spacing))}dispose(){for(let oe of this._items)oe.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(oe){this._direction!==oe&&(this._direction=oe,this.parent&&(this.parent.dataset.direction=oe,this.parent.fit()))}get alignment(){return this._alignment}set alignment(oe){this._alignment!==oe&&(this._alignment=oe,this.parent&&(this.parent.dataset.alignment=oe,this.parent.update()))}get spacing(){return this._spacing}set spacing(oe){oe=ih.clampDimension(oe),this._spacing!==oe&&(this._spacing=oe,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(oe,Pe){Ma.ArrayExt.insert(this._items,oe,new pv(Pe)),Ma.ArrayExt.insert(this._sizers,oe,new Yd),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.BeforeAttach),this.parent.node.appendChild(Pe.node),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.AfterAttach),this.parent.fit()}moveWidget(oe,Pe,Ne){Ma.ArrayExt.move(this._items,oe,Pe),Ma.ArrayExt.move(this._sizers,oe,Pe),this.parent.update()}detachWidget(oe,Pe){let Ne=Ma.ArrayExt.removeAt(this._items,oe);Ma.ArrayExt.removeAt(this._sizers,oe),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Pe.node),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.AfterDetach),Ne.dispose(),this.parent.fit()}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}_fit(){let oe=0;for(let Ot=0,Zt=this._items.length;Ot0)switch(this._alignment){case"start":break;case"center":nr=0,Gt=Zt/2;break;case"end":nr=0,Gt=Zt;break;case"justify":nr=Zt/Ne,Gt=0;break;default:throw"unreachable"}for(let er=0,ur=this._items.length;er0,coerce:(Ze,ct)=>Math.max(0,Math.floor(ct)),changed:Ne}),We.sizeBasisProperty=new af({name:"sizeBasis",create:()=>0,coerce:(Ze,ct)=>Math.max(0,Math.floor(ct)),changed:Ne});function oe(Ze){return Ze==="left-to-right"||Ze==="right-to-left"}We.isHorizontal=oe;function Pe(Ze){return Math.max(0,Math.floor(Ze))}We.clampSpacing=Pe;function Ne(Ze){Ze.parent&&Ze.parent.layout instanceof Wd&&Ze.parent.fit()}})(hv||(hv={}));var nw=class extends aw{constructor(oe={}){super({layout:QS.createLayout(oe)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(oe){this.layout.direction=oe}get alignment(){return this.layout.alignment}set alignment(oe){this.layout.alignment=oe}get spacing(){return this.layout.spacing}set spacing(oe){this.layout.spacing=oe}onChildAdded(oe){oe.child.addClass("lm-BoxPanel-child")}onChildRemoved(oe){oe.child.removeClass("lm-BoxPanel-child")}};(function(We){function oe(ct){return Wd.getStretch(ct)}We.getStretch=oe;function Pe(ct,Xt){Wd.setStretch(ct,Xt)}We.setStretch=Pe;function Ne(ct){return Wd.getSizeBasis(ct)}We.getSizeBasis=Ne;function Ze(ct,Xt){Wd.setSizeBasis(ct,Xt)}We.setSizeBasis=Ze})(nw||(nw={}));var QS;(function(We){function oe(Pe){return Pe.layout||new Wd(Pe)}We.createLayout=oe})(QS||(QS={}));var ow=class We extends Ya{constructor(oe){super({node:gp.createNode()}),this._activeIndex=-1,this._itemTriggered=new Ss(this),this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(Ya.Flag.DisallowLayout),this.commands=oe.commands,this.renderer=oe.renderer||We.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get itemTriggered(){return this._itemTriggered}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(oe){let Pe=gp.createItem(this.commands,oe);return this._items.push(Pe),this.refresh(),Pe}addItems(oe){let Pe=oe.map(Ne=>gp.createItem(this.commands,Ne));return Pe.forEach(Ne=>this._items.push(Ne)),this.refresh(),Pe}removeItem(oe){this.removeItemAt(this._items.indexOf(oe))}removeItemAt(oe){Ma.ArrayExt.removeAt(this._items,oe)&&this.refresh()}clearItems(){this._items.length!==0&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,this.inputNode.value!==""){let oe=this.node.getElementsByClassName("lm-close-icon")[0];oe.style.display="inherit"}else{let oe=this.node.getElementsByClassName("lm-close-icon")[0];oe.style.display="none"}this.update()}handleEvent(oe){switch(oe.type){case"click":this._evtClick(oe);break;case"keydown":this._evtKeyDown(oe);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}search(oe){return We.search(this.items,oe)}initialActiveIndex(oe,Pe){return oe?Ma.ArrayExt.findFirstIndex(Pe,gp.canActivate):-1}onBeforeAttach(oe){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(oe){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(oe){this.update(),super.onAfterShow(oe)}onActivateRequest(oe){if(this.isAttached){let Pe=this.inputNode;Pe.focus(),Pe.select()}}onUpdateRequest(oe){if(!this.isVisible){$d.render(null,this.contentNode);return}let Pe=this.inputNode.value,Ne=this.contentNode,Ze=this._results;if(Ze||(Ze=this._results=this.search(Pe),this._activeIndex=this.initialActiveIndex(Pe,Ze)),!Pe&&Ze.length===0){$d.render(null,Ne);return}if(Pe&&Ze.length===0){let Zt=this.renderer.renderEmptyMessage({query:Pe});$d.render(Zt,Ne);return}let ct=this.renderer,Xt=this._activeIndex,Ot=new Array(Ze.length);for(let Zt=0,nr=Ze.length;Zt=Ze.length)Ne.scrollTop=0;else{let Zt=Ne.children[Xt];Fs.scrollIntoViewIfNeeded(Ne,Zt)}}_evtClick(oe){if(oe.button!==0)return;if(oe.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let Pe=Ma.ArrayExt.findFirstIndex(this.contentNode.children,Ne=>Ne.contains(oe.target));Pe!==-1&&(oe.preventDefault(),oe.stopPropagation(),this._execute(Pe))}_evtKeyDown(oe){if(!(oe.altKey||oe.ctrlKey||oe.metaKey||oe.shiftKey))switch(oe.keyCode){case 13:oe.preventDefault(),oe.stopPropagation(),this._execute(this._activeIndex);break;case 38:oe.preventDefault(),oe.stopPropagation(),this._activatePreviousItem();break;case 40:oe.preventDefault(),oe.stopPropagation(),this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0)return;let oe=this._activeIndex,Pe=this._results.length,Ne=oeKi-Ia),ti=de.slice(0,Vr),Xr=de.slice(Vr);for(let Ki=0,Ia=Xr.length;Kiar.command===ir&&_p.JSONExt.deepEqual(ar.args,Nt))||null}}})(gp||(gp={}));var dv=class We extends Ya{constructor(oe){super({node:of.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._pendingTouchActivation=!1,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new Ss(this),this._menuRequested=new Ss(this),this.addClass("lm-Menu"),this.setFlag(Ya.Flag.DisallowLayout),this.commands=oe.commands,this.renderer=oe.renderer||We.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let oe=this;for(;oe._parentMenu;)oe=oe._parentMenu;return oe}get leafMenu(){let oe=this;for(;oe._childMenu;)oe=oe._childMenu;return oe}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(oe){this.activeIndex=oe?this._items.indexOf(oe):-1}get activeIndex(){return this._activeIndex}set activeIndex(oe){(oe<0||oe>=this._items.length)&&(oe=-1),oe!==-1&&!of.canActivate(this._items[oe])&&(oe=-1),this._activeIndex!==oe&&(this._activeIndex=oe,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let oe=this._items.length,Pe=this._activeIndex,Ne=Pe{this.activeIndex=Ot}})}$d.render(Xt,this.contentNode)}onCloseRequest(oe){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1,this._pendingTouchActivation=!1;let Pe=this._childMenu;Pe&&(this._childIndex=-1,this._childMenu=null,Pe._parentMenu=null,Pe.close());let Ne=this._parentMenu;Ne&&(this._parentMenu=null,Ne._childIndex=-1,Ne._childMenu=null,Ne.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(oe)}_evtKeyDown(oe){oe.preventDefault(),oe.stopPropagation();let Pe=oe.keyCode;if(Pe===13){this.triggerActiveItem();return}if(Pe===27){this.close();return}if(Pe===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(Pe===38){this.activatePreviousItem();return}if(Pe===39){let Xt=this.activeItem;Xt&&Xt.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(Pe===40){this.activateNextItem();return}let Ne=Qm().keyForKeydownEvent(oe);if(!Ne)return;let Ze=this._activeIndex+1,ct=of.findMnemonic(this._items,Ne,Ze);ct.index!==-1&&!ct.multiple?(this.activeIndex=ct.index,this.triggerActiveItem()):ct.index!==-1?this.activeIndex=ct.index:ct.auto!==-1&&(this.activeIndex=ct.auto)}_evtPointerUp(oe){if(oe.button===0){if(ih.isTouchEvent(oe)){this._pendingTouchActivation=this._activateItemFromEvent(oe),oe.stopPropagation();return}oe.preventDefault(),oe.stopPropagation(),this._activateItemFromEvent(oe),this.triggerActiveItem()}}_evtClick(oe){this._pendingTouchActivation&&(this._pendingTouchActivation=!1,oe.preventDefault(),oe.stopPropagation(),this._activateItemFromEvent(oe)&&this.triggerActiveItem())}_evtPointerMove(oe){if(ih.isTouchEvent(oe))return;let Pe=Ma.ArrayExt.findFirstIndex(this.contentNode.children,Ze=>Fs.hitTest(Ze,oe.clientX,oe.clientY));if(Pe===this._activeIndex)return;if(this.activeIndex=Pe,Pe=this.activeIndex,Pe===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();let Ne=this.activeItem;!Ne||Ne.type!=="submenu"||!Ne.submenu||this._startOpenTimer()}_evtPointerEnter(oe){if(!ih.isTouchEvent(oe))for(let Pe=this._parentMenu;Pe;Pe=Pe._parentMenu)Pe._cancelOpenTimer(),Pe._cancelCloseTimer(),Pe.activeIndex=Pe._childIndex}_evtPointerLeave(oe){if(ih.isTouchEvent(oe))return;if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:Pe,clientY:Ne}=oe;if(Fs.hitTest(this._childMenu.node,Pe,Ne)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtPointerDown(oe){this._pendingTouchActivation=!1,!this._parentMenu&&(of.hitTestMenus(this,oe.clientX,oe.clientY)?(ih.isTouchEvent(oe)||oe.preventDefault(),oe.stopPropagation()):this.close())}_openChildMenu(oe=!1){let Pe=this.activeItem;if(!Pe||Pe.type!=="submenu"||!Pe.submenu){this._closeChildMenu();return}let Ne=Pe.submenu;if(Ne===this._childMenu)return;We.saveWindowData(),this._closeChildMenu(),this._childMenu=Ne,this._childIndex=this._activeIndex,Ne._parentMenu=this,za.sendMessage(this,Ya.Msg.UpdateRequest);let Ze=this.contentNode.children[this._activeIndex];of.openSubmenu(Ne,Ze),oe&&(Ne.activeIndex=-1,Ne.activateNextItem()),Ne.activate()}_activateItemFromEvent(oe){let Pe=Ma.ArrayExt.findFirstIndex(this.contentNode.children,Ne=>Fs.hitTest(Ne,oe.clientX,oe.clientY));return Pe===-1?!1:(this.activeIndex=Pe,!0)}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){this._openTimerID===0&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},of.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},of.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){of.saveWindowData()}};(function(We){class oe{renderItem(Ne){let Ze=this.createItemClass(Ne),ct=this.createItemDataset(Ne),Xt=this.createItemARIA(Ne);return Ps.li({className:Ze,dataset:ct,tabindex:"0",onfocus:Ne.onfocus,...Xt},this.renderIcon(Ne),this.renderLabel(Ne),this.renderShortcut(Ne),this.renderSubmenu(Ne))}renderIcon(Ne){let Ze=this.createIconClass(Ne);return Ps.div({className:Ze},Ne.item.icon,Ne.item.iconLabel)}renderLabel(Ne){let Ze=this.formatLabel(Ne);return Ps.div({className:"lm-Menu-itemLabel"},Ze)}renderShortcut(Ne){let Ze=this.formatShortcut(Ne);return Ps.div({className:"lm-Menu-itemShortcut"},Ze)}renderSubmenu(Ne){return Ps.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(Ne){let Ze="lm-Menu-item";Ne.item.isEnabled||(Ze+=" lm-mod-disabled"),Ne.item.isToggled&&(Ze+=" lm-mod-toggled"),Ne.item.isVisible||(Ze+=" lm-mod-hidden"),Ne.active&&(Ze+=" lm-mod-active"),Ne.collapsed&&(Ze+=" lm-mod-collapsed");let ct=Ne.item.className;return ct&&(Ze+=` ${ct}`),Ze}createItemDataset(Ne){let Ze,{type:ct,command:Xt,dataset:Ot}=Ne.item;return ct==="command"?Ze={...Ot,type:ct,command:Xt}:Ze={...Ot,type:ct},Ze}createIconClass(Ne){let Ze="lm-Menu-itemIcon",ct=Ne.item.iconClass;return ct?`${Ze} ${ct}`:Ze}createItemARIA(Ne){let Ze={};switch(Ne.item.type){case"separator":Ze.role="presentation";break;case"submenu":Ze["aria-haspopup"]="true",Ne.item.isEnabled||(Ze["aria-disabled"]="true");break;default:Ne.item.isEnabled||(Ze["aria-disabled"]="true"),Ne.item.isToggleable||Ne.item.isToggled?(Ze.role="menuitemcheckbox",Ze["aria-checked"]=`${Ne.item.isToggled}`):Ze.role="menuitem"}return Ze}formatLabel(Ne){let{label:Ze,mnemonic:ct}=Ne.item;if(ct<0||ct>=Ze.length)return Ze;let Xt=Ze.slice(0,ct),Ot=Ze.slice(ct+1),Zt=Ze[ct],nr=Ps.span({className:"lm-Menu-itemMnemonic"},Zt);return[Xt,nr,Ot]}formatShortcut(Ne){let Ze=Ne.item.keyBinding;return Ze?mp.formatKeystroke(Ze.keys):null}}We.Renderer=oe,We.defaultRenderer=new oe})(dv||(dv={}));var of;(function(We){We.TIMER_DELAY=300,We.SUBMENU_OVERLAP=3;let oe=null,Pe=0;function Ne(){return Pe>0?(Pe--,oe):Gt()}function Ze(){oe=Gt(),Pe++}We.saveWindowData=Ze;function ct(){let ar=document.createElement("div"),Lr=document.createElement("ul");return Lr.className="lm-Menu-content",ar.appendChild(Lr),Lr.setAttribute("role","menu"),ar.tabIndex=0,ar}We.createNode=ct;function Xt(ar){return ar.type!=="separator"&&ar.isEnabled&&ar.isVisible}We.canActivate=Xt;function Ot(ar,Lr){return new Nt(ar.commands,Lr)}We.createItem=Ot;function Zt(ar,Lr,Ir){for(let de=ar;de;de=de.childMenu)if(Fs.hitTest(de.node,Lr,Ir))return!0;return!1}We.hitTestMenus=Zt;function nr(ar){let Lr=new Array(ar.length);Ma.ArrayExt.fill(Lr,!1);let Ir=0,de=ar.length;for(;Ir=0;--Mr){let Vr=ar[Mr];if(Vr.isVisible){if(Vr.type!=="separator")break;Lr[Mr]=!0}}let qr=!1;for(;++IrKi+_i&&(Lr=Ki+_i-rs),!Mr&&Ir+Oo>Ia+ia&&(Ir>Ia+ia?Ir=Ia+ia-Oo:Ir=Ir-Oo),eo.transform=`translate(${Math.max(0,Lr)}px, ${Math.max(0,Ir)}px`,eo.opacity="1"}We.openRootMenu=er;function ur(ar,Lr){let Ir=Ne(),de=Ir.pageXOffset,Mr=Ir.pageYOffset,qr=Ir.clientWidth,Vr=Ir.clientHeight;za.sendMessage(ar,Ya.Msg.UpdateRequest);let ti=Vr,Xr=ar.node,Ki=Xr.style;Ki.opacity="0",Ki.maxHeight=`${ti}px`,Ya.attach(ar,document.body);let{width:Ia,height:_i}=Xr.getBoundingClientRect(),ia=Fs.boxSizing(ar.node),Yr=Lr.getBoundingClientRect(),Ba=Yr.right-We.SUBMENU_OVERLAP;Ba+Ia>de+qr&&(Ba=Yr.left+We.SUBMENU_OVERLAP-Ia);let eo=Yr.top-ia.borderTop-ia.paddingTop;eo+_i>Mr+Vr&&(eo=Yr.bottom+ia.borderBottom+ia.paddingBottom-_i),Ki.transform=`translate(${Math.max(0,Ba)}px, ${Math.max(0,eo)}px`,Ki.opacity="1"}We.openSubmenu=ur;function ir(ar,Lr,Ir){let de=-1,Mr=-1,qr=!1,Vr=Lr.toUpperCase();for(let ti=0,Xr=ar.length;ti=0&&ia<_i.length){_i[ia].toUpperCase()===Vr&&(de===-1?de=Ki:qr=!0);continue}Mr===-1&&_i[0].toUpperCase()===Vr&&(Mr=Ki)}return{index:de,multiple:qr,auto:Mr}}We.findMnemonic=ir;class Nt{constructor(Lr,Ir){this._commands=Lr,this.type=Ir.type||"command",this.command=Ir.command||"",this.args=Ir.args||_p.JSONExt.emptyObject,this.submenu=Ir.submenu||null}get label(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""}get mnemonic(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1}get icon(){if(this.type==="command")return this._commands.icon(this.command,this.args);if(this.type==="submenu"&&this.submenu)return this.submenu.title.icon}get iconClass(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""}get iconLabel(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""}get caption(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""}get className(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""}get dataset(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}}get isEnabled(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0}get isToggled(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1}get isToggleable(){return this.type==="command"?this._commands.isToggleable(this.command,this.args):!1}get isVisible(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0}get keyBinding(){if(this.type==="command"){let{command:Lr,args:Ir}=this;return Ma.ArrayExt.findLastValue(this._commands.keyBindings,de=>de.command===Lr&&_p.JSONExt.deepEqual(de.args,Ir))||null}return null}}})(of||(of={}));var Mj;(function(We){function oe(Xt,Ot){let Zt=Ne(Xt.selector),nr=Xt.rank!==void 0?Xt.rank:1/0;return{...Xt,selector:Zt,rank:nr,id:Ot}}We.createItem=oe;function Pe(Xt,Ot,Zt,nr){let Gt=Ot.target;if(!Gt)return null;let er=Ot.currentTarget;if(!er||!er.contains(Gt)&&(Gt=document.elementFromPoint(Ot.clientX,Ot.clientY),!Gt||!er.contains(Gt)))return null;let ur=[],ir=Xt.slice();for(;Gt!==null;){let Nt=[];for(let ar=0,Lr=ir.length;ar=this._titles.length)&&(oe=-1),this._currentIndex===oe)return;let Pe=this._currentIndex,Ne=this._titles[Pe]||null,Ze=oe,ct=this._titles[Ze]||null;this._currentIndex=Ze,this._previousTitle=Ne,this.update(),this._currentChanged.emit({previousIndex:Pe,previousTitle:Ne,currentIndex:Ze,currentTitle:ct})}get name(){return this._name}set name(oe){this._name=oe,oe?this.contentNode.setAttribute("aria-label",oe):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(oe){this._orientation!==oe&&(this._releaseMouse(),this._orientation=oe,this.dataset.orientation=oe,this.contentNode.setAttribute("aria-orientation",oe))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(oe){this._addButtonEnabled!==oe&&(this._addButtonEnabled=oe,oe?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(oe){return this.insertTab(this._titles.length,oe)}insertTab(oe,Pe){this._releaseMouse();let Ne=Bh.asTitle(Pe),Ze=this._titles.indexOf(Ne),ct=Math.max(0,Math.min(oe,this._titles.length));return Ze===-1?(Ma.ArrayExt.insert(this._titles,ct,Ne),Ne.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(ct,Ne),Ne):(ct===this._titles.length&&ct--,Ze===ct||(Ma.ArrayExt.move(this._titles,Ze,ct),this.update(),this._adjustCurrentForMove(Ze,ct)),Ne)}removeTab(oe){this.removeTabAt(this._titles.indexOf(oe))}removeTabAt(oe){let Pe=oe>=0&&oe-1?this._currentIndex:0;for(let Zt=0,nr=Ne.length;ZtFs.hitTest(Xt,oe.clientX,oe.clientY));if(Ne===-1)return;let Ze=this.titles[Ne],ct=Pe[Ne].querySelector(".lm-TabBar-tabLabel");if(ct&&ct.contains(oe.target)){let Xt=Ze.label||"",Ot=ct.innerHTML;ct.innerHTML="";let Zt=document.createElement("input");Zt.classList.add("lm-TabBar-tabInput"),Zt.value=Xt,ct.appendChild(Zt);let nr=()=>{Zt.removeEventListener("blur",nr),ct.innerHTML=Ot,this.node.addEventListener("keydown",this)};Zt.addEventListener("dblclick",Gt=>Gt.stopPropagation()),Zt.addEventListener("blur",nr),Zt.addEventListener("keydown",Gt=>{Gt.key==="Enter"?(Zt.value!==""&&(Ze.label=Ze.caption=Zt.value),nr()):Gt.key==="Escape"&&nr()}),this.node.removeEventListener("keydown",this),Zt.select(),Zt.focus(),ct.children.length>0&&ct.children[0].focus()}}_evtKeyDownCapturing(oe){oe.eventPhase===Event.CAPTURING_PHASE&&(oe.preventDefault(),oe.stopPropagation(),oe.key==="Escape"&&this._releaseMouse())}_evtKeyDown(oe){var Pe,Ne,Ze;if(!(oe.key==="Tab"||oe.eventPhase===Event.CAPTURING_PHASE)){if(oe.key==="Enter"||oe.key==="Spacebar"||oe.key===" "){let ct=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(ct))oe.preventDefault(),oe.stopPropagation(),this._addRequested.emit();else{let Xt=Ma.ArrayExt.findFirstIndex(this.contentNode.children,Ot=>Ot.contains(ct));Xt>=0&&(oe.preventDefault(),oe.stopPropagation(),this.currentIndex=Xt)}}else if(Oce.includes(oe.key)){let ct=[...this.contentNode.children];if(this.addButtonEnabled&&ct.push(this.addButtonNode),ct.length<=1)return;oe.preventDefault(),oe.stopPropagation();let Xt=ct.indexOf(document.activeElement);Xt===-1&&(Xt=this._currentIndex);let Ot;oe.key==="ArrowRight"&&this._orientation==="horizontal"||oe.key==="ArrowDown"&&this._orientation==="vertical"?Ot=(Pe=ct[Xt+1])!==null&&Pe!==void 0?Pe:ct[0]:oe.key==="ArrowLeft"&&this._orientation==="horizontal"||oe.key==="ArrowUp"&&this._orientation==="vertical"?Ot=(Ne=ct[Xt-1])!==null&&Ne!==void 0?Ne:ct[ct.length-1]:oe.key==="Home"?Ot=ct[0]:oe.key==="End"&&(Ot=ct[ct.length-1]),Ot&&((Ze=ct[Xt])===null||Ze===void 0||Ze.setAttribute("tabindex","-1"),Ot?.setAttribute("tabindex","0"),Ot.focus())}}}_evtPointerDown(oe){if(this._pendingTouchCloseRequest=null,oe.button!==0&&oe.button!==1||this._dragData||oe.target.classList.contains("lm-TabBar-tabInput"))return;let Pe=this.addButtonEnabled&&this.addButtonNode.contains(oe.target),Ne=this.contentNode.children,Ze=Ma.ArrayExt.findFirstIndex(Ne,Ot=>Fs.hitTest(Ot,oe.clientX,oe.clientY));if(Ze===-1&&!Pe)return;let ct=Ze!==-1?Ne[Ze].querySelector(this.renderer.closeIconSelector):null,Xt=!!ct&&ct.contains(oe.target);(!Xt||!ih.isTouchEvent(oe))&&oe.preventDefault(),oe.stopPropagation(),this._dragData={tab:Ne[Ze],index:Ze,pressX:oe.clientX,pressY:oe.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),!(oe.button===1||Pe)&&(Xt||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===Ze?this.currentIndex=-1:this.currentIndex=Ze,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle})))}_evtPointerMove(oe){let Pe=this._dragData;if(!Pe)return;oe.preventDefault(),oe.stopPropagation();let Ne=this.contentNode.children;if(!(!Pe.dragActive&&!Bh.dragExceeded(Pe,oe))){if(!Pe.dragActive){let Ze=Pe.tab.getBoundingClientRect();this._orientation==="horizontal"?(Pe.tabPos=Pe.tab.offsetLeft,Pe.tabSize=Ze.width,Pe.tabPressPos=Pe.pressX-Ze.left):(Pe.tabPos=Pe.tab.offsetTop,Pe.tabSize=Ze.height,Pe.tabPressPos=Pe.pressY-Ze.top),Pe.tabPressOffset={x:Pe.pressX-Ze.left,y:Pe.pressY-Ze.top},Pe.tabLayout=Bh.snapTabLayout(Ne,this._orientation),Pe.contentRect=this.contentNode.getBoundingClientRect(),Pe.override=nf.overrideCursor("default"),Pe.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),Pe.dragActive=!0}if(!Pe.detachRequested&&Bh.detachExceeded(Pe,oe)){Pe.detachRequested=!0;let Ze=Pe.index,ct=oe.clientX,Xt=oe.clientY,Ot=Ne[Ze],Zt=this._titles[Ze];if(this._tabDetachRequested.emit({index:Ze,title:Zt,tab:Ot,clientX:ct,clientY:Xt,offset:Pe.tabPressOffset}),Pe.dragAborted)return}Bh.layoutTabs(Ne,Pe,oe,this._orientation)}}_evtPointerUp(oe){if(oe.button!==0&&oe.button!==1)return;let Pe=this._dragData;if(!Pe)return;let Ne=ih.isTouchEvent(oe);if(Ne||oe.preventDefault(),oe.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!Pe.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(oe.target)){this._addRequested.emit(void 0);return}let Xt=this.contentNode.children,Ot=Ma.ArrayExt.findFirstIndex(Xt,Gt=>Fs.hitTest(Gt,oe.clientX,oe.clientY));if(Ot!==Pe.index)return;let Zt=this._titles[Ot];if(!Zt.closable)return;if(oe.button===1){this._tabCloseRequested.emit({index:Ot,title:Zt});return}let nr=Xt[Ot].querySelector(this.renderer.closeIconSelector);if(nr&&nr.contains(oe.target)){if(this._tabSizeFrozen=!0,Ne){this._pendingTouchCloseRequest={index:Ot,title:Zt};return}this._tabCloseRequested.emit({index:Ot,title:Zt});return}return}if(oe.button!==0)return;Bh.finalizeTabPosition(Pe,this._orientation),Pe.tab.classList.remove("lm-mod-dragging");let Ze=Bh.parseTransitionDuration(Pe.tab);setTimeout(()=>{if(Pe.dragAborted)return;this._dragData=null,Bh.resetTabPositions(this.contentNode.children,this._orientation),Pe.override.dispose(),this.removeClass("lm-mod-dragging");let ct=Pe.index,Xt=Pe.targetIndex;Xt===-1||ct===Xt||(Ma.ArrayExt.move(this._titles,ct,Xt),this._adjustCurrentForMove(ct,Xt),this._tabMoved.emit({fromIndex:ct,toIndex:Xt,title:this._titles[Xt]}),za.sendMessage(this,Ya.Msg.UpdateRequest))},Ze)}_releaseMouse(){let oe=this._dragData;oe&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),oe.dragAborted=!0,oe.dragActive&&(Bh.resetTabPositions(this.contentNode.children,this._orientation),oe.override.dispose(),oe.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(oe,Pe){let Ne=this.currentTitle,Ze=this._currentIndex,ct=this.insertBehavior;if(ct==="select-tab"||ct==="select-tab-if-needed"&&Ze===-1){this._currentIndex=oe,this._previousTitle=Ne,this._currentChanged.emit({previousIndex:Ze,previousTitle:Ne,currentIndex:oe,currentTitle:Pe});return}Ze>=oe&&this._currentIndex++}_evtClick(oe){let Pe=this._pendingTouchCloseRequest;if(!Pe)return;this._pendingTouchCloseRequest=null,oe.preventDefault(),oe.stopPropagation();let Ne=this.contentNode.children[Pe.index],Ze=Ne?.querySelector(this.renderer.closeIconSelector);if(this._titles[Pe.index]!==Pe.title||!Ze||!Ze.contains(oe.target)){this._clearTabSizeFreezeState();return}this._tabCloseRequested.emit(Pe)}_adjustCurrentForMove(oe,Pe){this._currentIndex===oe?this._currentIndex=Pe:this._currentIndex=Pe?this._currentIndex++:this._currentIndex>oe&&this._currentIndex<=Pe&&this._currentIndex--}_adjustCurrentForRemove(oe,Pe){let Ne=this._currentIndex,Ze=this.removeBehavior;if(Ne!==oe){Ne>oe&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:oe,previousTitle:Pe,currentIndex:-1,currentTitle:null});return}if(Ze==="select-tab-after"){this._currentIndex=Math.min(oe,this._titles.length-1),this._currentChanged.emit({previousIndex:oe,previousTitle:Pe,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(Ze==="select-tab-before"){this._currentIndex=Math.max(0,oe-1),this._currentChanged.emit({previousIndex:oe,previousTitle:Pe,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(Ze==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(oe,this._titles.length-1),this._currentChanged.emit({previousIndex:oe,previousTitle:Pe,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:oe,previousTitle:Pe,currentIndex:-1,currentTitle:null})}_onTitleChanged(oe){this.update()}_evtPointerLeave(oe){if(!this._tabSizeFrozen)return;this._tabSizeFrozen=!1,this._frozenTabWidths=null,this._unfreezeRunID++;let Pe=this._unfreezeRunID;this._clearUnfreezeTransitionState(),this.addClass("lm-mod-unfreezing");let Ne=this.contentNode.children;for(let Ze=0,ct=Ne.length;Ze{let Xt=ct.propertyName;(Xt==="width"||Xt==="flex-basis")&&this._finalizeUnfreezeRun(Pe)};this._unfreezeTransitionListener=Ze,this.node.addEventListener("transitionend",Ze),this.node.addEventListener("transitioncancel",Ze),this._unfreezeFallbackTimerID=window.setTimeout(()=>{this._finalizeUnfreezeRun(Pe)},2e3)}this.update()}_setFrozenTabSize(oe,Pe){let Ne=`${Pe}px`;oe.style.width=Ne,oe.style.flexBasis=Ne}_finalizeUnfreezeRun(oe){oe===this._unfreezeRunID&&(this._clearUnfreezeTransitionState(),this.removeClass("lm-mod-unfreezing"))}_clearUnfreezeTransitionState(){this._unfreezeTransitionListener&&(this.node.removeEventListener("transitionend",this._unfreezeTransitionListener),this.node.removeEventListener("transitioncancel",this._unfreezeTransitionListener),this._unfreezeTransitionListener=null),this._unfreezeFallbackTimerID!==0&&(clearTimeout(this._unfreezeFallbackTimerID),this._unfreezeFallbackTimerID=0)}_clearTabSizeFreezeState(){this._tabSizeFrozen=!1,this._frozenTabWidths=null,this.removeClass("lm-mod-unfreezing");let oe=this.contentNode.children;for(let Pe=0,Ne=oe.length;Pe=We.DRAG_THRESHOLD||ir>=We.DRAG_THRESHOLD}We.dragExceeded=ct;function Xt(Gt,er){let ur=Gt.contentRect;return er.clientX=ur.right+We.DETACH_THRESHOLD||er.clientY=ur.bottom+We.DETACH_THRESHOLD}We.detachExceeded=Xt;function Ot(Gt,er,ur,ir){let Nt,ar,Lr,Ir;ir==="horizontal"?(Nt=er.pressX,ar=ur.clientX-er.contentRect.left,Lr=ur.clientX,Ir=er.contentRect.width):(Nt=er.pressY,ar=ur.clientY-er.contentRect.top,Lr=ur.clientY,Ir=er.contentRect.height);let de=er.index,Mr=ar-er.tabPressPos,qr=Mr+er.tabSize;for(let Vr=0,ti=Gt.length;Vr>1);if(Vrer.index&&qr>Ia)Xr=`${-er.tabSize-Ki.margin}px`,de=Math.max(de,Vr);else if(Vr===er.index){let _i=Lr-Nt,ia=Ir-(er.tabPos+er.tabSize);Xr=`${Math.max(-er.tabPos,Math.min(_i,ia))}px`}else Xr="";ir==="horizontal"?Gt[Vr].style.left=Xr:Gt[Vr].style.top=Xr}er.targetIndex=de}We.layoutTabs=Ot;function Zt(Gt,er){let ur;er==="horizontal"?ur=Gt.contentRect.width:ur=Gt.contentRect.height;let ir;if(Gt.targetIndex===Gt.index)ir=0;else if(Gt.targetIndex>Gt.index){let Lr=Gt.tabLayout[Gt.targetIndex];ir=Lr.pos+Lr.size-Gt.tabSize-Gt.tabPos}else ir=Gt.tabLayout[Gt.targetIndex].pos-Gt.tabPos;let Nt=ur-(Gt.tabPos+Gt.tabSize),ar=Math.max(-Gt.tabPos,Math.min(ir,Nt));er==="horizontal"?Gt.tab.style.left=`${ar}px`:Gt.tab.style.top=`${ar}px`}We.finalizeTabPosition=Zt;function nr(Gt,er){for(let ur of Gt)er==="horizontal"?ur.style.left="":ur.style.top=""}We.resetTabPositions=nr})(Bh||(Bh={}));var eE=class extends xp{constructor(oe){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=oe.renderer,oe.spacing!==void 0&&(this._spacing=ih.clampDimension(oe.spacing)),this._document=oe.document||document,this._hiddenMode=oe.hiddenMode!==void 0?oe.hiddenMode:Ya.HiddenMode.Display}dispose(){let oe=this[Symbol.iterator]();this._items.forEach(Pe=>{Pe.dispose()}),this._box=null,this._root=null,this._items.clear();for(let Pe of oe)Pe.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(oe){if(this._hiddenMode!==oe){this._hiddenMode=oe;for(let Pe of this.tabBars())if(Pe.titles.length>1)for(let Ne of Pe.titles)Ne.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(oe){oe=ih.clampDimension(oe),this._spacing!==oe&&(this._spacing=oe,this.parent&&this.parent.fit())}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,Ma.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,Ma.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,Ma.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,Ma.empty)()}handles(){return this._root?this._root.iterHandles():(0,Ma.empty)()}moveHandle(oe,Pe,Ne){let Ze=oe.classList.contains("lm-mod-hidden");if(!this._root||Ze)return;let ct=this._root.findSplitNode(oe);if(!ct)return;let Xt;ct.node.orientation==="horizontal"?Xt=Pe-oe.offsetLeft:Xt=Ne-oe.offsetTop,Xt!==0&&(ct.node.holdSizes(),ah.adjust(ct.node.sizers,ct.index,Xt),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(oe){let Pe=new Set,Ne;oe.main?Ne=Xl.normalizeAreaConfig(oe.main,Pe):Ne=null;let Ze=this.widgets(),ct=this.tabBars(),Xt=this.handles();this._root=null;for(let Ot of Ze)Pe.has(Ot)||(Ot.parent=null);for(let Ot of ct)Ot.dispose();for(let Ot of Xt)Ot.parentNode&&Ot.parentNode.removeChild(Ot);for(let Ot of Pe)Ot.parent=this.parent;Ne?this._root=Xl.realizeAreaConfig(Ne,{createTabBar:Ot=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(Pe.forEach(Ot=>{this.attachWidget(Ot)}),this.parent.fit())}addWidget(oe,Pe={}){let Ne=Pe.ref||null,Ze=Pe.mode||"tab-after",ct=null;if(this._root&&Ne&&(ct=this._root.findTabNode(Ne)),Ne&&!ct)throw new Error("Reference widget is not in the layout.");switch(oe.parent=this.parent,Ze){case"tab-after":this._insertTab(oe,Ne,ct,!0);break;case"tab-before":this._insertTab(oe,Ne,ct,!1);break;case"split-top":this._insertSplit(oe,Ne,ct,"vertical",!1);break;case"split-left":this._insertSplit(oe,Ne,ct,"horizontal",!1);break;case"split-right":this._insertSplit(oe,Ne,ct,"horizontal",!0);break;case"split-bottom":this._insertSplit(oe,Ne,ct,"vertical",!0);break;case"merge-top":this._insertSplit(oe,Ne,ct,"vertical",!1,!0);break;case"merge-left":this._insertSplit(oe,Ne,ct,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(oe,Ne,ct,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(oe,Ne,ct,"vertical",!0,!0);break}this.parent&&(this.attachWidget(oe),this.parent.fit())}removeWidget(oe){this._removeWidget(oe),this.parent&&(this.detachWidget(oe),this.parent.fit())}hitTestTabAreas(oe,Pe){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=Fs.boxSizing(this.parent.node));let Ne=this.parent.node.getBoundingClientRect(),Ze=oe-Ne.left-this._box.borderLeft,ct=Pe-Ne.top-this._box.borderTop,Xt=this._root.hitTestTabNodes(Ze,ct);if(!Xt)return null;let{tabBar:Ot,top:Zt,left:nr,width:Gt,height:er}=Xt,ur=this._box.borderLeft+this._box.borderRight,ir=this._box.borderTop+this._box.borderBottom,Nt=Ne.width-ur-(nr+Gt),ar=Ne.height-ir-(Zt+er);return{tabBar:Ot,x:Ze,y:ct,top:Zt,left:nr,right:Nt,bottom:ar,width:Gt,height:er}}init(){super.init();for(let oe of this)this.attachWidget(oe);for(let oe of this.handles())this.parent.node.appendChild(oe);this.parent.fit()}attachWidget(oe){this.parent.node!==oe.node.parentNode&&(this._items.set(oe,new pv(oe)),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.BeforeAttach),this.parent.node.appendChild(oe.node),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.AfterAttach))}detachWidget(oe){if(this.parent.node!==oe.node.parentNode)return;this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(oe.node),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.AfterDetach);let Pe=this._items.get(oe);Pe&&(this._items.delete(oe),Pe.dispose())}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}_removeWidget(oe){if(!this._root)return;let Pe=this._root.findTabNode(oe);if(!Pe)return;if(Xl.removeAria(oe),Pe.tabBar.titles.length>1){if(Pe.tabBar.removeTab(oe.title),this._hiddenMode===Ya.HiddenMode.Scale&&Pe.tabBar.titles.length==1){let ur=Pe.tabBar.titles[0].owner;ur.hiddenMode=Ya.HiddenMode.Display}return}if(Pe.tabBar.dispose(),this._root===Pe){this._root=null;return}this._root.holdAllSizes();let Ne=Pe.parent;Pe.parent=null;let Ze=Ma.ArrayExt.removeFirstOf(Ne.children,Pe),ct=Ma.ArrayExt.removeAt(Ne.handles,Ze);if(Ma.ArrayExt.removeAt(Ne.sizers,Ze),ct.parentNode&&ct.parentNode.removeChild(ct),Ne.children.length>1){Ne.syncHandles();return}let Xt=Ne.parent;Ne.parent=null;let Ot=Ne.children[0],Zt=Ne.handles[0];if(Ne.children.length=0,Ne.handles.length=0,Ne.sizers.length=0,Zt.parentNode&&Zt.parentNode.removeChild(Zt),this._root===Ne){Ot.parent=null,this._root=Ot;return}let nr=Xt,Gt=nr.children.indexOf(Ne);if(Ot instanceof Xl.TabLayoutNode){Ot.parent=nr,nr.children[Gt]=Ot;return}let er=Ma.ArrayExt.removeAt(nr.handles,Gt);Ma.ArrayExt.removeAt(nr.children,Gt),Ma.ArrayExt.removeAt(nr.sizers,Gt),er.parentNode&&er.parentNode.removeChild(er);for(let ur=0,ir=Ot.children.length;ur=this._left+this._width||Nt=this._top+this._height?null:this}createConfig(){let ir=this.tabBar.titles.map(ar=>ar.owner),Nt=this.tabBar.currentIndex;return{type:"tab-area",widgets:ir,currentIndex:Nt}}holdAllSizes(){}fit(ir,Nt){let ar=0,Lr=0,Ir=1/0,de=1/0,Mr=Nt.get(this.tabBar),qr=this.tabBar.currentTitle,Vr=qr?Nt.get(qr.owner):void 0,[ti,Xr]=this.sizers;return Mr&&Mr.fit(),Vr&&Vr.fit(),Mr&&!Mr.isHidden?(ar=Math.max(ar,Mr.minWidth),Lr+=Mr.minHeight,ti.minSize=Mr.minHeight,ti.maxSize=Mr.maxHeight):(ti.minSize=0,ti.maxSize=0),Vr&&!Vr.isHidden?(ar=Math.max(ar,Vr.minWidth),Lr+=Vr.minHeight,Xr.minSize=Vr.minHeight,Xr.maxSize=1/0):(Xr.minSize=0,Xr.maxSize=1/0),{minWidth:ar,minHeight:Lr,maxWidth:Ir,maxHeight:de}}update(ir,Nt,ar,Lr,Ir,de){this._top=Nt,this._left=ir,this._width=ar,this._height=Lr;let Mr=de.get(this.tabBar),qr=this.tabBar.currentTitle,Vr=qr?de.get(qr.owner):void 0;if(ah.calc(this.sizers,Lr),Mr&&!Mr.isHidden){let ti=this.sizers[0].size;Mr.update(ir,Nt,ar,ti),Nt+=ti}if(Vr&&!Vr.isHidden){let ti=this.sizers[1].size;Vr.update(ir,Nt,ar,ti)}}}We.TabLayoutNode=Ze;class ct{constructor(ir){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=ir}*iterAllWidgets(){for(let ir of this.children)yield*ir.iterAllWidgets()}*iterUserWidgets(){for(let ir of this.children)yield*ir.iterUserWidgets()}*iterSelectedWidgets(){for(let ir of this.children)yield*ir.iterSelectedWidgets()}*iterTabBars(){for(let ir of this.children)yield*ir.iterTabBars()}*iterHandles(){yield*this.handles;for(let ir of this.children)yield*ir.iterHandles()}findTabNode(ir){for(let Nt=0,ar=this.children.length;NtLr.createConfig());return{type:"split-area",orientation:ir,children:ar,sizes:Nt}}syncHandles(){this.handles.forEach((ir,Nt)=>{ir.setAttribute("data-orientation",this.orientation),Nt===this.handles.length-1?ir.classList.add("lm-mod-hidden"):ir.classList.remove("lm-mod-hidden")})}holdSizes(){for(let ir of this.sizers)ir.sizeHint=ir.size}holdAllSizes(){for(let ir of this.children)ir.holdAllSizes();this.holdSizes()}normalizeSizes(){let ir=this.sizers.length;if(ir===0)return;this.holdSizes();let Nt=this.sizers.reduce((ar,Lr)=>ar+Lr.sizeHint,0);if(Nt===0)for(let ar of this.sizers)ar.size=ar.sizeHint=1/ir;else for(let ar of this.sizers)ar.size=ar.sizeHint/=Nt;this.normalized=!0}createNormalizedSizes(){let ir=this.sizers.length;if(ir===0)return[];let Nt=this.sizers.map(Lr=>Lr.size),ar=Nt.reduce((Lr,Ir)=>Lr+Ir,0);if(ar===0)for(let Lr=Nt.length-1;Lr>-1;Lr--)Nt[Lr]=1/ir;else for(let Lr=Nt.length-1;Lr>-1;Lr--)Nt[Lr]/=ar;return Nt}fit(ir,Nt){let ar=this.orientation==="horizontal",Lr=Math.max(0,this.children.length-1)*ir,Ir=ar?Lr:0,de=ar?0:Lr,Mr=1/0,qr=1/0;for(let Vr=0,ti=this.children.length;Vr=Nt.length)&&(ar=0),{type:"tab-area",widgets:Nt,currentIndex:ar}}function nr(ur,ir){let Nt=ur.orientation,ar=[],Lr=[];for(let Ir=0,de=ur.children.length;Ir{let de=Ne(Lr,ir,Nt),Mr=oe(ur.sizes[Ir]),qr=ir.createHandle();ar.children.push(de),ar.handles.push(qr),ar.sizers.push(Mr),de.parent=ar}),ar.syncHandles(),ar.normalizeSizes(),ar}})(Xl||(Xl={}));var sw=class We extends Ya{constructor(oe={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new Ss(this),this._addRequested=new Ss(this),this.addClass("lm-DockPanel"),this._document=oe.document||document,this._mode=oe.mode||"multiple-document",this._renderer=oe.renderer||We.defaultRenderer,this._edges=oe.edges||Rl.DEFAULT_EDGES,oe.tabsMovable!==void 0&&(this._tabsMovable=oe.tabsMovable),oe.tabsConstrained!==void 0&&(this._tabsConstrained=oe.tabsConstrained),oe.addButtonEnabled!==void 0&&(this._addButtonEnabled=oe.addButtonEnabled),this.dataset.mode=this._mode;let Pe={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new eE({document:this._document,renderer:Pe,spacing:oe.spacing,hiddenMode:oe.hiddenMode}),this.overlay=oe.overlay||new We.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(oe){this.layout.hiddenMode=oe}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(oe){this.layout.spacing=oe}get mode(){return this._mode}set mode(oe){if(this._mode===oe)return;this._mode=oe,this.dataset.mode=oe;let Pe=this.layout;switch(oe){case"multiple-document":for(let Ne of Pe.tabBars())Ne.show();break;case"single-document":Pe.restoreLayout(Rl.createSingleDocumentConfig(this));break;default:throw"unreachable"}za.postMessage(this,Rl.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(oe){this._tabsMovable=oe;for(let Pe of this.tabBars())Pe.tabsMovable=oe}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(oe){this._tabsConstrained=oe}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(oe){this._addButtonEnabled=oe;for(let Pe of this.tabBars())Pe.addButtonEnabled=oe}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(oe){let Pe=(0,Ma.find)(this.tabBars(),Ne=>Ne.titles.indexOf(oe.title)!==-1);if(!Pe)throw new Error("Widget is not contained in the dock panel.");Pe.currentTitle=oe.title}activateWidget(oe){this.selectWidget(oe),oe.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(oe){this._mode="multiple-document",this.layout.restoreLayout(oe),(Nc.IS_EDGE||Nc.IS_IE)&&za.flush(),za.postMessage(this,Rl.LayoutModified)}addWidget(oe,Pe={}){this._mode==="single-document"?this.layout.addWidget(oe):this.layout.addWidget(oe,Pe),za.postMessage(this,Rl.LayoutModified)}processMessage(oe){oe.type==="layout-modified"?this._layoutModified.emit(void 0):super.processMessage(oe)}handleEvent(oe){switch(oe.type){case"lm-dragenter":this._evtDragEnter(oe);break;case"lm-dragleave":this._evtDragLeave(oe);break;case"lm-dragover":this._evtDragOver(oe);break;case"lm-drop":this._evtDrop(oe);break;case"pointerdown":this._evtPointerDown(oe);break;case"pointermove":this._evtPointerMove(oe);break;case"pointerup":this._evtPointerUp(oe);break;case"keydown":this._evtKeyDown(oe);break;case"contextmenu":oe.preventDefault(),oe.stopPropagation();break}}onBeforeAttach(oe){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(oe){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(oe){Rl.isGeneratedTabBarProperty.get(oe.child)||oe.child.addClass("lm-DockPanel-widget")}onChildRemoved(oe){Rl.isGeneratedTabBarProperty.get(oe.child)||(oe.child.removeClass("lm-DockPanel-widget"),za.postMessage(this,Rl.LayoutModified))}_evtDragEnter(oe){oe.mimeData.hasData("application/vnd.lumino.widget-factory")&&(oe.preventDefault(),oe.stopPropagation())}_evtDragLeave(oe){oe.preventDefault(),!(this._tabsConstrained&&oe.source!==this)&&(oe.stopPropagation(),this.overlay.hide(1))}_evtDragOver(oe){oe.preventDefault(),this._tabsConstrained&&oe.source!==this||this._showOverlay(oe.clientX,oe.clientY)==="invalid"?oe.dropAction="none":(oe.stopPropagation(),oe.dropAction=oe.proposedAction)}_evtDrop(oe){if(oe.preventDefault(),this.overlay.hide(0),oe.proposedAction==="none"){oe.dropAction="none";return}let{clientX:Pe,clientY:Ne}=oe,{zone:Ze,target:ct}=Rl.findDropTarget(this,Pe,Ne,this._edges);if(this._tabsConstrained&&oe.source!==this||Ze==="invalid"){oe.dropAction="none";return}let Ot=oe.mimeData.getData("application/vnd.lumino.widget-factory");if(typeof Ot!="function"){oe.dropAction="none";return}let Zt=Ot();if(!(Zt instanceof Ya)){oe.dropAction="none";return}if(Zt.contains(this)){oe.dropAction="none";return}let nr=ct?Rl.getDropRef(ct.tabBar):null;switch(Ze){case"root-all":this.addWidget(Zt);break;case"root-top":this.addWidget(Zt,{mode:"split-top"});break;case"root-left":this.addWidget(Zt,{mode:"split-left"});break;case"root-right":this.addWidget(Zt,{mode:"split-right"});break;case"root-bottom":this.addWidget(Zt,{mode:"split-bottom"});break;case"widget-all":this.addWidget(Zt,{mode:"tab-after",ref:nr});break;case"widget-top":this.addWidget(Zt,{mode:"split-top",ref:nr});break;case"widget-left":this.addWidget(Zt,{mode:"split-left",ref:nr});break;case"widget-right":this.addWidget(Zt,{mode:"split-right",ref:nr});break;case"widget-bottom":this.addWidget(Zt,{mode:"split-bottom",ref:nr});break;case"widget-tab":this.addWidget(Zt,{mode:"tab-after",ref:nr});break;default:throw"unreachable"}oe.dropAction=oe.proposedAction,oe.stopPropagation(),this.activateWidget(Zt)}_evtKeyDown(oe){oe.preventDefault(),oe.stopPropagation(),oe.keyCode===27&&(this._releaseMouse(),za.postMessage(this,Rl.LayoutModified))}_evtPointerDown(oe){if(oe.button!==0)return;let Pe=this.layout,Ne=oe.target,Ze=(0,Ma.find)(Pe.handles(),Gt=>Gt.contains(Ne));if(!Ze)return;oe.preventDefault(),oe.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let ct=Ze.getBoundingClientRect(),Xt=oe.clientX-ct.left,Ot=oe.clientY-ct.top,Zt=window.getComputedStyle(Ze),nr=nf.overrideCursor(Zt.cursor,this._document);this._pressData={handle:Ze,deltaX:Xt,deltaY:Ot,override:nr}}_evtPointerMove(oe){if(!this._pressData)return;oe.preventDefault(),oe.stopPropagation();let Pe=this.node.getBoundingClientRect(),Ne=oe.clientX-Pe.left-this._pressData.deltaX,Ze=oe.clientY-Pe.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,Ne,Ze)}_evtPointerUp(oe){oe.button===0&&(oe.preventDefault(),oe.stopPropagation(),this._releaseMouse(),za.postMessage(this,Rl.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(oe,Pe){let{zone:Ne,target:Ze}=Rl.findDropTarget(this,oe,Pe,this._edges);if(Ne==="invalid")return this.overlay.hide(100),Ne;let ct,Xt,Ot,Zt,nr=Fs.boxSizing(this.node),Gt=this.node.getBoundingClientRect();switch(Ne){case"root-all":ct=nr.paddingTop,Xt=nr.paddingLeft,Ot=nr.paddingRight,Zt=nr.paddingBottom;break;case"root-top":ct=nr.paddingTop,Xt=nr.paddingLeft,Ot=nr.paddingRight,Zt=Gt.height*Rl.GOLDEN_RATIO;break;case"root-left":ct=nr.paddingTop,Xt=nr.paddingLeft,Ot=Gt.width*Rl.GOLDEN_RATIO,Zt=nr.paddingBottom;break;case"root-right":ct=nr.paddingTop,Xt=Gt.width*Rl.GOLDEN_RATIO,Ot=nr.paddingRight,Zt=nr.paddingBottom;break;case"root-bottom":ct=Gt.height*Rl.GOLDEN_RATIO,Xt=nr.paddingLeft,Ot=nr.paddingRight,Zt=nr.paddingBottom;break;case"widget-all":ct=Ze.top,Xt=Ze.left,Ot=Ze.right,Zt=Ze.bottom;break;case"widget-top":ct=Ze.top,Xt=Ze.left,Ot=Ze.right,Zt=Ze.bottom+Ze.height/2;break;case"widget-left":ct=Ze.top,Xt=Ze.left,Ot=Ze.right+Ze.width/2,Zt=Ze.bottom;break;case"widget-right":ct=Ze.top,Xt=Ze.left+Ze.width/2,Ot=Ze.right,Zt=Ze.bottom;break;case"widget-bottom":ct=Ze.top+Ze.height/2,Xt=Ze.left,Ot=Ze.right,Zt=Ze.bottom;break;case"widget-tab":{let er=Ze.tabBar.node.getBoundingClientRect().height;ct=Ze.top,Xt=Ze.left,Ot=Ze.right,Zt=Ze.bottom+Ze.height-er;break}default:throw"unreachable"}return this.overlay.show({top:ct,left:Xt,right:Ot,bottom:Zt}),Ne}_createTabBar(){let oe=this._renderer.createTabBar(this._document);return Rl.isGeneratedTabBarProperty.set(oe,!0),this._mode==="single-document"&&oe.hide(),oe.tabsMovable=this._tabsMovable,oe.allowDeselect=!1,oe.addButtonEnabled=this._addButtonEnabled,oe.removeBehavior="select-previous-tab",oe.insertBehavior="select-tab-if-needed",oe.tabMoved.connect(this._onTabMoved,this),oe.currentChanged.connect(this._onCurrentChanged,this),oe.tabCloseRequested.connect(this._onTabCloseRequested,this),oe.tabDetachRequested.connect(this._onTabDetachRequested,this),oe.tabActivateRequested.connect(this._onTabActivateRequested,this),oe.addRequested.connect(this._onTabAddRequested,this),oe}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){za.postMessage(this,Rl.LayoutModified)}_onCurrentChanged(oe,Pe){let{previousTitle:Ne,currentTitle:Ze}=Pe;Ne&&Ne.owner.hide(),Ze&&Ze.owner.show(),(Nc.IS_EDGE||Nc.IS_IE)&&za.flush(),za.postMessage(this,Rl.LayoutModified)}_onTabAddRequested(oe){this._addRequested.emit(oe)}_onTabActivateRequested(oe,Pe){Pe.title.owner.activate()}_onTabCloseRequested(oe,Pe){Pe.title.owner.close()}_onTabDetachRequested(oe,Pe){if(this._drag)return;oe.releaseMouse();let{title:Ne,tab:Ze,clientX:ct,clientY:Xt,offset:Ot}=Pe,Zt=new _p.MimeData,nr=()=>Ne.owner;Zt.setData("application/vnd.lumino.widget-factory",nr);let Gt=Ze.cloneNode(!0);Ot&&(Gt.style.top=`-${Ot.y}px`,Gt.style.left=`-${Ot.x}px`),this._drag=new nf({document:this._document,mimeData:Zt,dragImage:Gt,proposedAction:"move",supportedActions:"move",source:this}),Ze.classList.add("lm-mod-hidden");let er=()=>{this._drag=null,Ze.classList.remove("lm-mod-hidden")};this._drag.start(ct,Xt).then(er)}};(function(We){class oe{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(Ze){let ct=this.node.style;ct.top=`${Ze.top}px`,ct.left=`${Ze.left}px`,ct.right=`${Ze.right}px`,ct.bottom=`${Ze.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(Ze){if(!this._hidden){if(Ze<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},Ze))}}}We.Overlay=oe;class Pe{createTabBar(Ze){let ct=new a1({document:Ze});return ct.addClass("lm-DockPanel-tabBar"),ct}createHandle(){let Ze=document.createElement("div");return Ze.className="lm-DockPanel-handle",Ze}}We.Renderer=Pe,We.defaultRenderer=new Pe})(sw||(sw={}));var Rl;(function(We){We.GOLDEN_RATIO=.618,We.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},We.LayoutModified=new s0("layout-modified"),We.isGeneratedTabBarProperty=new af({name:"isGeneratedTabBar",create:()=>!1});function oe(Ze){if(Ze.isEmpty)return{main:null};let ct=Array.from(Ze.widgets()),Xt=Ze.selectedWidgets().next().value,Ot=Xt?ct.indexOf(Xt):-1;return{main:{type:"tab-area",widgets:ct,currentIndex:Ot}}}We.createSingleDocumentConfig=oe;function Pe(Ze,ct,Xt,Ot){if(!Fs.hitTest(Ze.node,ct,Xt))return{zone:"invalid",target:null};let Zt=Ze.layout;if(Zt.isEmpty)return{zone:"root-all",target:null};if(Ze.mode==="multiple-document"){let Mr=Ze.node.getBoundingClientRect(),qr=ct-Mr.left+1,Vr=Xt-Mr.top+1,ti=Mr.right-ct,Xr=Mr.bottom-Xt;switch(Math.min(Vr,ti,Xr,qr)){case Vr:if(Vrar&&ur>ar&&er>Lr&&ir>Lr)return{zone:"widget-all",target:nr};Gt/=ar,er/=Lr,ur/=ar,ir/=Lr;let Ir=Math.min(Gt,er,ur,ir),de;switch(Ir){case Gt:de="widget-left";break;case er:de="widget-top";break;case ur:de="widget-right";break;case ir:de="widget-bottom";break;default:throw"unreachable"}return{zone:de,target:nr}}We.findDropTarget=Pe;function Ne(Ze){return Ze.titles.length===0?null:Ze.currentTitle?Ze.currentTitle.owner:Ze.titles[Ze.titles.length-1].owner}We.getDropRef=Ne})(Rl||(Rl={}));var my=class We extends xp{constructor(oe={}){super(oe),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new Yd],this._columnSizers=[new Yd],this._box=null,oe.rowCount!==void 0&&Au.reallocSizers(this._rowSizers,oe.rowCount),oe.columnCount!==void 0&&Au.reallocSizers(this._columnSizers,oe.columnCount),oe.rowSpacing!==void 0&&(this._rowSpacing=Au.clampValue(oe.rowSpacing)),oe.columnSpacing!==void 0&&(this._columnSpacing=Au.clampValue(oe.columnSpacing))}dispose(){for(let oe of this._items){let Pe=oe.widget;oe.dispose(),Pe.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(oe){oe!==this.rowCount&&(Au.reallocSizers(this._rowSizers,oe),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(oe){oe!==this.columnCount&&(Au.reallocSizers(this._columnSizers,oe),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(oe){oe=Au.clampValue(oe),this._rowSpacing!==oe&&(this._rowSpacing=oe,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(oe){oe=Au.clampValue(oe),this._columnSpacing!==oe&&(this._columnSpacing=oe,this.parent&&this.parent.fit())}rowStretch(oe){let Pe=this._rowSizers[oe];return Pe?Pe.stretch:-1}setRowStretch(oe,Pe){let Ne=this._rowSizers[oe];Ne&&(Pe=Au.clampValue(Pe),Ne.stretch!==Pe&&(Ne.stretch=Pe,this.parent&&this.parent.update()))}columnStretch(oe){let Pe=this._columnSizers[oe];return Pe?Pe.stretch:-1}setColumnStretch(oe,Pe){let Ne=this._columnSizers[oe];Ne&&(Pe=Au.clampValue(Pe),Ne.stretch!==Pe&&(Ne.stretch=Pe,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(let oe of this._items)yield oe.widget}addWidget(oe){Ma.ArrayExt.findFirstIndex(this._items,Ne=>Ne.widget===oe)===-1&&(this._items.push(new pv(oe)),this.parent&&this.attachWidget(oe))}removeWidget(oe){let Pe=Ma.ArrayExt.findFirstIndex(this._items,Ze=>Ze.widget===oe);if(Pe===-1)return;let Ne=Ma.ArrayExt.removeAt(this._items,Pe);this.parent&&this.detachWidget(oe),Ne.dispose()}init(){super.init();for(let oe of this)this.attachWidget(oe)}attachWidget(oe){this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.BeforeAttach),this.parent.node.appendChild(oe.node),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.AfterAttach),this.parent.fit()}detachWidget(oe){this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(oe.node),this.parent.isAttached&&za.sendMessage(oe,Ya.Msg.AfterDetach),this.parent.fit()}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}_fit(){for(let Zt=0,nr=this.rowCount;Zt!Zt.isHidden);for(let Zt=0,nr=oe.length;Zt({row:0,column:0,rowSpan:1,columnSpan:1}),changed:Ot});function oe(Zt){let nr=Math.max(0,Math.floor(Zt.row||0)),Gt=Math.max(0,Math.floor(Zt.column||0)),er=Math.max(1,Math.floor(Zt.rowSpan||0)),ur=Math.max(1,Math.floor(Zt.columnSpan||0));return{row:nr,column:Gt,rowSpan:er,columnSpan:ur}}We.normalizeConfig=oe;function Pe(Zt){return Math.max(0,Math.floor(Zt))}We.clampValue=Pe;function Ne(Zt,nr){let Gt=We.cellConfigProperty.get(Zt.widget),er=We.cellConfigProperty.get(nr.widget);return Gt.rowSpan-er.rowSpan}We.rowSpanCmp=Ne;function Ze(Zt,nr){let Gt=We.cellConfigProperty.get(Zt.widget),er=We.cellConfigProperty.get(nr.widget);return Gt.columnSpan-er.columnSpan}We.columnSpanCmp=Ze;function ct(Zt,nr){for(nr=Math.max(1,Math.floor(nr));Zt.lengthnr&&(Zt.length=nr)}We.reallocSizers=ct;function Xt(Zt,nr,Gt,er){if(Gt=er)return;let ir=(er-ur)/(Gt-nr+1);for(let Nt=nr;Nt<=Gt;++Nt)Zt[Nt].minSize+=ir}We.distributeMin=Xt;function Ot(Zt){Zt.parent&&Zt.parent.layout instanceof my&&Zt.parent.fit()}})(Au||(Au={}));var lw=class We extends Ya{constructor(oe={}){super({node:uw.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(Ya.Flag.DisallowLayout),this.renderer=oe.renderer||We.defaultRenderer,this._forceItemsPosition=oe.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=oe.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(oe){this.activeIndex=oe?this._menus.indexOf(oe):-1}get activeIndex(){return this._activeIndex}set activeIndex(oe){(oe<0||oe>=this._menus.length)&&(oe=-1),oe>-1&&this._menus[oe].items.length===0&&(oe=-1),this._activeIndex!==oe&&(this._activeIndex=oe,this.update())}get menus(){return this._menus}openActiveMenu(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(oe,Pe=!0){this.insertMenu(this._menus.length,oe,Pe)}insertMenu(oe,Pe,Ne=!0){this._closeChildMenu();let Ze=this._menus.indexOf(Pe),ct=Math.max(0,Math.min(oe,this._menus.length));if(Ze===-1){Ma.ArrayExt.insert(this._menus,ct,Pe),Pe.addClass("lm-MenuBar-menu"),Pe.aboutToClose.connect(this._onMenuAboutToClose,this),Pe.menuRequested.connect(this._onMenuMenuRequested,this),Pe.title.changed.connect(this._onTitleChanged,this),Ne&&this.update();return}ct===this._menus.length&&ct--,Ze!==ct&&(Ma.ArrayExt.move(this._menus,Ze,ct),Ne&&this.update())}removeMenu(oe,Pe=!0){this.removeMenuAt(this._menus.indexOf(oe),Pe)}removeMenuAt(oe,Pe=!0){this._closeChildMenu();let Ne=Ma.ArrayExt.removeAt(this._menus,oe);Ne&&(Ne.aboutToClose.disconnect(this._onMenuAboutToClose,this),Ne.menuRequested.disconnect(this._onMenuMenuRequested,this),Ne.title.changed.disconnect(this._onTitleChanged,this),Ne.removeClass("lm-MenuBar-menu"),Pe&&this.update())}clearMenus(){if(this._menus.length!==0){this._closeChildMenu();for(let oe of this._menus)oe.aboutToClose.disconnect(this._onMenuAboutToClose,this),oe.menuRequested.disconnect(this._onMenuMenuRequested,this),oe.title.changed.disconnect(this._onTitleChanged,this),oe.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(oe){switch(oe.type){case"keydown":this._evtKeyDown(oe);break;case"pointerdown":this._evtPointerDown(oe);break;case"pointermove":case"pointerleave":this._evtPointerMove(oe);break;case"focusout":this._evtFocusOut(oe);break;case"contextmenu":oe.preventDefault(),oe.stopPropagation();break}}onBeforeAttach(oe){this.node.addEventListener("keydown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("pointermove",this),this.node.addEventListener("pointerleave",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(oe){this.node.removeEventListener("keydown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("pointermove",this),this.node.removeEventListener("pointerleave",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(oe){this.isAttached&&this._focusItemAt(0)}onResize(oe){this.update(),super.onResize(oe)}onUpdateRequest(oe){var Pe;let Ne=this._menus,Ze=this.renderer,ct=this._activeIndex,Xt=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:Ne.length,Zt=0,nr=!1;Ot=this._overflowMenu!==null?Ot-1:Ot;let Gt=new Array(Ot);for(let er=0;er{this._tabFocusIndex=er,this.activeIndex=er}}),Zt+=this._menuItemSizes[er],Ne[er].title.label===this._overflowMenuOptions.title&&(nr=!0,Ot--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!nr){if(this._overflowMenu===null){let er=(Pe=this._overflowMenuOptions.title)!==null&&Pe!==void 0?Pe:"...";this._overflowMenu=new dv({commands:new mp}),this._overflowMenu.title.label=er,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let er=Ne.length-2;er>=Ot;er--){let ur=this.menus[er];ur.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:ur}),this.removeMenu(ur,!1)}Gt[Ot]=Ze.renderItem({title:this._overflowMenu.title,active:Ot===ct&&Ne[Ot].items.length!==0,tabbable:Ot===Xt,disabled:Ne[Ot].items.length===0,onfocus:()=>{this._tabFocusIndex=Ot,this.activeIndex=Ot}}),Ot++}else if(this._overflowMenu!==null){let er=this._overflowMenu.items,ur=this.node.offsetWidth,ir=this._overflowMenu.items.length;for(let Nt=0;Ntthis._menuItemSizes[ar]){let Lr=er[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(Ot,Lr,!1),Gt[Ot]=Ze.renderItem({title:Lr.title,active:!1,tabbable:Ot===Xt,disabled:Ne[Ot].items.length===0,onfocus:()=>{this._tabFocusIndex=Ot,this.activeIndex=Ot}}),Ot++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),Gt.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}$d.render(Gt,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let oe=this.contentNode.childNodes,Pe=this.node.offsetWidth,Ne=0,Ze=-1,ct=oe.length;if(this._menuItemSizes.length==0)for(let Xt=0;XtPe&&Ze===-1&&(Ze=Xt)}else for(let Xt=0;XtPe){Ze=Xt;break}this._overflowIndex=Ze}_evtKeyDown(oe){let Pe=oe.keyCode;if(Pe===9){this.activeIndex=-1;return}if(oe.preventDefault(),oe.stopPropagation(),Pe===13||Pe===32||Pe===38||Pe===40){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(Pe===27){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(Pe===37||Pe===39){let Xt=Pe===37?-1:1,Ot=this._tabFocusIndex+Xt,Zt=this._menus.length;for(let nr=0;nrFs.hitTest(Ne,oe.clientX,oe.clientY));if(Pe===-1){this._closeChildMenu();return}if(oe.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=Pe;else{oe.preventDefault();let Ne=this._positionForMenu(Pe);dv.saveWindowData(),this.activeIndex=Pe,this._openChildMenu(Ne)}}_evtPointerMove(oe){if(ih.isTouchEvent(oe))return;let Pe=Ma.ArrayExt.findFirstIndex(this.contentNode.children,Ze=>Fs.hitTest(Ze,oe.clientX,oe.clientY));if(Pe===this._activeIndex||Pe===-1&&this._childMenu)return;let Ne=Pe>=0&&this._childMenu?this._positionForMenu(Pe):null;dv.saveWindowData(),this.activeIndex=Pe,Ne&&this._openChildMenu(Ne)}_positionForMenu(oe){let Pe=this.contentNode.children[oe],{left:Ne,bottom:Ze}=Pe.getBoundingClientRect();return{top:Ze,left:Ne}}_evtFocusOut(oe){!this._childMenu&&!this.node.contains(oe.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(oe){let Pe=this.contentNode.childNodes[oe];Pe&&Pe.focus()}_openChildMenu(oe={}){let Pe=this.activeMenu;if(!Pe){this._closeChildMenu();return}let Ne=this._childMenu;if(Ne===Pe)return;this._childMenu=Pe,Ne?Ne.close():document.addEventListener("pointerdown",this,!0),this._tabFocusIndex=this.activeIndex,za.sendMessage(this,Ya.Msg.UpdateRequest);let{left:Ze,top:ct}=oe;(typeof Ze>"u"||typeof ct>"u")&&({left:Ze,top:ct}=this._positionForMenu(this._activeIndex)),Ne||this.addClass("lm-mod-active"),Pe.items.length>0&&Pe.open(Ze,ct,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("pointerdown",this,!0);let oe=this._childMenu;this._childMenu=null,oe.close(),this.activeIndex=-1}_onMenuAboutToClose(oe){oe===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("pointerdown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(oe,Pe){if(oe!==this._childMenu)return;let Ne=this._activeIndex,Ze=this._menus.length;switch(Pe){case"next":this.activeIndex=Ne===Ze-1?0:Ne+1;break;case"previous":this.activeIndex=Ne===0?Ze-1:Ne-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}};(function(We){class oe{renderItem(Ne){let Ze=this.createItemClass(Ne),ct=this.createItemDataset(Ne),Xt=this.createItemARIA(Ne);return Ps.li({className:Ze,dataset:ct,...Ne.disabled?{}:{tabindex:Ne.tabbable?"0":"-1"},onfocus:Ne.onfocus,...Xt},this.renderIcon(Ne),this.renderLabel(Ne))}renderIcon(Ne){let Ze=this.createIconClass(Ne);return Ps.div({className:Ze},Ne.title.icon,Ne.title.iconLabel)}renderLabel(Ne){let Ze=this.formatLabel(Ne);return Ps.div({className:"lm-MenuBar-itemLabel"},Ze)}createItemClass(Ne){let Ze="lm-MenuBar-item";return Ne.title.className&&(Ze+=` ${Ne.title.className}`),Ne.active&&!Ne.disabled&&(Ze+=" lm-mod-active"),Ze}createItemDataset(Ne){return Ne.title.dataset}createItemARIA(Ne){return{role:"menuitem","aria-haspopup":"true","aria-disabled":Ne.disabled?"true":"false"}}createIconClass(Ne){let Ze="lm-MenuBar-itemIcon",ct=Ne.title.iconClass;return ct?`${Ze} ${ct}`:Ze}formatLabel(Ne){let{label:Ze,mnemonic:ct}=Ne.title;if(ct<0||ct>=Ze.length)return Ze;let Xt=Ze.slice(0,ct),Ot=Ze.slice(ct+1),Zt=Ze[ct],nr=Ps.span({className:"lm-MenuBar-itemMnemonic"},Zt);return[Xt,nr,Ot]}}We.Renderer=oe,We.defaultRenderer=new oe})(lw||(lw={}));var uw;(function(We){function oe(){let Ne=document.createElement("div"),Ze=document.createElement("ul");return Ze.className="lm-MenuBar-content",Ne.appendChild(Ze),Ze.setAttribute("role","menubar"),Ne}We.createNode=oe;function Pe(Ne,Ze,ct){let Xt=-1,Ot=-1,Zt=!1,nr=Ze.toUpperCase();for(let Gt=0,er=Ne.length;Gt=0&&Nt1&&this.widgets.forEach(Pe=>{Pe.hiddenMode=this._hiddenMode}))}dispose(){for(let oe of this._items)oe.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(oe,Pe){this._hiddenMode===Ya.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=Ya.HiddenMode.Scale),Pe.hiddenMode=Ya.HiddenMode.Scale):Pe.hiddenMode=Ya.HiddenMode.Display,Ma.ArrayExt.insert(this._items,oe,new pv(Pe)),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.BeforeAttach),this.parent.node.appendChild(Pe.node),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.AfterAttach),this.parent.fit()}moveWidget(oe,Pe,Ne){Ma.ArrayExt.move(this._items,oe,Pe),this.parent.update()}detachWidget(oe,Pe){let Ne=Ma.ArrayExt.removeAt(this._items,oe);this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.BeforeDetach),this.parent.node.removeChild(Pe.node),this.parent.isAttached&&za.sendMessage(Pe,Ya.Msg.AfterDetach),Ne.widget.node.style.zIndex="",this._hiddenMode===Ya.HiddenMode.Scale&&(Pe.hiddenMode=Ya.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=Ya.HiddenMode.Display)),Ne.dispose(),this.parent.fit()}onBeforeShow(oe){super.onBeforeShow(oe),this.parent.update()}onBeforeAttach(oe){super.onBeforeAttach(oe),this.parent.fit()}onChildShown(oe){this.parent.fit()}onChildHidden(oe){this.parent.fit()}onResize(oe){this.parent.isVisible&&this._update(oe.width,oe.height)}onUpdateRequest(oe){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(oe){this.parent.isAttached&&this._fit()}_fit(){let oe=0,Pe=0;for(let ct=0,Xt=this._items.length;ct{this.createGraph(this._model)})}renderModel(oe){if(this.hasGraphElement()){let Ne=this._model?.data[this._mimeType];return JSON.stringify(Ne)===JSON.stringify(oe.data[this._mimeType])?Promise.resolve():(this._model=oe,this.createGraph(oe))}this._model=oe;let Pe=oe.data["image/png"];return Pe!=null?(this.updateImage(Pe),Promise.resolve()):this.createGraph(oe)}hasGraphElement(){return this.node.querySelector(".plot-container")!==null}updateImage(oe){this.hideGraph(),this._img_el.src="data:image/png;base64,"+oe,this.showImage()}hideGraph(){let oe=this.node.querySelector(".plot-container");oe!=null&&(oe.style.display="none")}showGraph(){let oe=this.node.querySelector(".plot-container");oe!=null&&(oe.style.display="block")}hideImage(){let oe=this.node.querySelector(".plot-img");oe!=null&&(oe.style.display="none")}showImage(){let oe=this.node.querySelector(".plot-img");oe!=null&&(oe.style.display="block")}createGraph(oe){let{data:Pe,layout:Ne,frames:Ze,config:ct}=oe.data[this._mimeType];return Ne.height||(Ne.height=360),(async()=>(We.Plotly===null&&(We.Plotly=await Promise.resolve().then(()=>dp(hU())),We._resolveLoadingPlotly()),We.loadingPlotly))().then(()=>We.Plotly.react(this.node,Pe,Ne,ct)).then(Ot=>{this.showGraph(),this.hideImage(),this.update(),Ze&&We.Plotly.addFrames(this.node,Ze),this.node.offsetWidth>0&&this.node.offsetHeight>0&&We.Plotly.toImage(Ot,{format:"png",width:this.node.offsetWidth,height:this.node.offsetHeight}).then(Zt=>{let nr=Zt.split(",")[1];oe.data["image/png"]!==nr&&oe.setData({data:{...oe.data,"image/png":nr}})}),this.node.on("plotly_webglcontextlost",()=>{let Zt=oe.data["image/png"];if(Zt!=null)return this.updateImage(Zt),Promise.resolve()})})}onAfterShow(oe){this.update()}onResize(oe){this.update()}onUpdateRequest(oe){We.Plotly&&this.isVisible&&this.hasGraphElement()&&We.Plotly.redraw(this.node).then(()=>{We.Plotly.Plots.resize(this.node)})}static{this.Plotly=null}static{this.loadingPlotly=new Promise(oe=>{We._resolveLoadingPlotly=oe})}},Uce={safe:!0,mimeTypes:[dU],createRenderer:We=>new cE(We)},qce=[{id:"@jupyterlab/plotly-extension:factory",rendererFactory:Uce,rank:2,dataType:"json",fileTypes:[{name:"plotly",mimeTypes:[dU],extensions:[".plotly",".plotly.json"],iconClass:jce}],documentWidgetFactoryOptions:{name:"Plotly",primaryFileType:"plotly",fileTypes:["plotly","json"],defaultFor:["plotly"]}}],$me=qce;export{dU as MIME_TYPE,cE as RenderedPlotly,$me as default,Uce as rendererFactory}; /*! Bundled license information: plotly.js/dist/plotly.js: diff --git a/js/package-lock.json b/js/package-lock.json index 95b197fdfb..9b917a808d 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -9,7 +9,7 @@ "version": "7.1.0", "license": "MIT", "dependencies": { - "@lumino/widgets": "~2.9.0", + "@lumino/widgets": "~2.10.0", "lodash-es": "^4.17.21", "plotly.js": "4.1.1" }, @@ -577,15 +577,15 @@ } }, "node_modules/@jupyter/builder": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@jupyter/builder/-/builder-1.2.3.tgz", - "integrity": "sha512-QnST5NZPmYHT7IMfLu1TxQobkxgNbDWULuDQcWRJObxLn6yyZ76hSXkNqlQh7GNLq3MNx3IG54a985ExTwLRDw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@jupyter/builder/-/builder-1.2.4.tgz", + "integrity": "sha512-yt5azwJoaEra3SWrphPn7u0CYKRxRPQumVkqrE9xcoi+buiXBGDnOowhzRqPzBpPsZ0lpv5FfoehbHn/C4D4kg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@jupyterlab/core-meta": "^4.6.1", + "@jupyterlab/core-meta": "^4.6.4", "@module-federation/runtime-tools": "^2.0.0", - "@rspack/core": "^2.1.7", + "@rspack/core": "^2.2.8", "ajv": "^8.12.0", "commander": "^9.4.1", "css-loader": "^7.1.4", @@ -601,213 +601,6 @@ "webpack-merge": "^5.8.0" } }, - "node_modules/@jupyter/builder/node_modules/@napi-rs/wasm-runtime": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", - "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@tybys/wasm-util": "^0.10.3" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@emnapi/core": "^1.7.1", - "@emnapi/runtime": "^1.7.1" - } - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-2.1.8.tgz", - "integrity": "sha512-tmAyHzDbPiy8V7HvQqtuPsbs6dPgwV0YjzW5XrPRV9gzf+Hdm7pvsZJKE1QKO9WV5RuvGYav98xIX6O+abZxzQ==", - "dev": true, - "license": "MIT", - "optionalDependencies": { - "@rspack/binding-darwin-arm64": "2.1.8", - "@rspack/binding-darwin-x64": "2.1.8", - "@rspack/binding-linux-arm64-gnu": "2.1.8", - "@rspack/binding-linux-arm64-musl": "2.1.8", - "@rspack/binding-linux-riscv64-gnu": "2.1.8", - "@rspack/binding-linux-riscv64-musl": "2.1.8", - "@rspack/binding-linux-x64-gnu": "2.1.8", - "@rspack/binding-linux-x64-musl": "2.1.8", - "@rspack/binding-wasm32-wasi": "2.1.8", - "@rspack/binding-win32-arm64-msvc": "2.1.8", - "@rspack/binding-win32-ia32-msvc": "2.1.8", - "@rspack/binding-win32-x64-msvc": "2.1.8" - } - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-darwin-arm64": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-2.1.8.tgz", - "integrity": "sha512-kia+eWtyWPvR4ntg1bWYoVU8nLPbUg2fG3zgBEocsTcsh5ZENSiEPxEKymDgMyIMONUqj611E0775cdUBoNmqw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-darwin-x64": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-2.1.8.tgz", - "integrity": "sha512-08pBkFhlD3Y3Qzh94w/Fc3skaIE3e96kl2P14m8+tnYTcglpOfpA2OwS3iHt9fOqy0HjoAVe6/MW3cBgs5iabA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-linux-arm64-gnu": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-2.1.8.tgz", - "integrity": "sha512-KLniMc9GzhKpVqhPzaJo3KJwzdAllXVVqZIk/uL1QipXOxs57fgM4u7IexKPFVla0o/u1PQG/Ah2YLDmda24Ow==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-linux-arm64-musl": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-2.1.8.tgz", - "integrity": "sha512-yUKAxHNGnICtw5RnxFWu4dHtsz/tdt7rbeFcsINNVre9HcrRxf5XP+FbOGL/SMxd9oM9XCo10paU2WckTKwbEA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-linux-x64-gnu": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-2.1.8.tgz", - "integrity": "sha512-EyegohSx0BJRqieCg9f/caCqFARRWkqI5hwJt6k530MoOTLeq8I3vsbeg24/2MktwIC1dmJi8bl0+WhPKQs4eQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-linux-x64-musl": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-2.1.8.tgz", - "integrity": "sha512-I6E+goN+UQ297q4r1qdbiAyNCI3t0+a5Y0xDIAPOZfRDRxDTnH/LF8/y65gjsJoKRKyn7zxRC0T/NURTkRNQ9A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-wasm32-wasi": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-2.1.8.tgz", - "integrity": "sha512-om7GAKWAU3lcSvbCon2m7mzw8v9OTrO2LW2MZ1lGe/uVJJmwGGkl9HVoXFyWFLrN6YVFyx8iP+AkN4owDWB9Cw==", - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "1.11.3", - "@emnapi/runtime": "1.11.3", - "@napi-rs/wasm-runtime": "1.1.6" - } - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-win32-arm64-msvc": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-2.1.8.tgz", - "integrity": "sha512-WDnsP/SUb9zbxyGX9XjPw5AXrX86u5oidn0MDdfJduOOqdCSpHwmRjlQ8NUJhbBq9WqVJMFlcab7NwZVWX/yyg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-win32-ia32-msvc": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-2.1.8.tgz", - "integrity": "sha512-QiMQMPNDiY3dhhaIdaFPzcPDC06cEYkNY89ea+EmDvNVgZq6V+2mFS/WnzZVMeEbGAYJCjsv/ABhhLT1hlYMvg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/binding-win32-x64-msvc": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-2.1.8.tgz", - "integrity": "sha512-b7sA5eB64vo2mbsuc//MOYzVLeCKHPn0dfP/GmNEoHdWbhRgZ/orZLWurYMQj04ELTLW6YCJEy59g5KRzNYHfw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@jupyter/builder/node_modules/@rspack/core": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/core/-/core-2.1.8.tgz", - "integrity": "sha512-na1kyA6Mj8/LWw9O3A8NsrG9rNKN3Iq2WiXrEuIwsU5r/Nl/evm3hO7bWKHxgsRyydI6W7okwx3MXgf8rzel6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rspack/binding": "2.1.8" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "peerDependencies": { - "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0", - "@swc/helpers": "^0.5.23" - }, - "peerDependenciesMeta": { - "@module-federation/runtime-tools": { - "optional": true - }, - "@swc/helpers": { - "optional": true - } - } - }, "node_modules/@jupyter/builder/node_modules/balanced-match": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", @@ -947,9 +740,9 @@ } }, "node_modules/@jupyterlab/core-meta": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@jupyterlab/core-meta/-/core-meta-4.6.2.tgz", - "integrity": "sha512-OniB/NCYrTSOK4EOsHrUllv5d78bEZy7ccqTU5/d7Nw+CiGymmVhi2ijtWN+YPCmQ/xh3zZlO2cL5a/YW4Ty2Q==", + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/@jupyterlab/core-meta/-/core-meta-4.6.4.tgz", + "integrity": "sha512-tcjDx4TxJXAZndeLPzTZzZh/KV37cWFBVwH+DYT62T82aIPp5T7wBENSDp2clJDu70N1V+m6vJnRpUqmeooAVA==", "dev": true, "license": "BSD-3-Clause" }, @@ -1059,9 +852,9 @@ } }, "node_modules/@lumino/widgets": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/@lumino/widgets/-/widgets-2.9.0.tgz", - "integrity": "sha512-cLiHV/QJxP54Bg+Ixa24VDzj48YkgtW7drBI4gRAZqM1e3zcDF4HoDT0BsobRq4A7oaFmqNhzD/PMTtw9w9zJg==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@lumino/widgets/-/widgets-2.10.0.tgz", + "integrity": "sha512-8fQOw9/nD909CwiIVPa4VkvWFYWnCaD8IuPckR+7lBdGsx6bdZVfepHmH8o2dJaz+1BRxwKdy+RLsryqAofQug==", "license": "BSD-3-Clause", "dependencies": { "@lumino/algorithm": "^2.0.5", @@ -1223,6 +1016,25 @@ "@module-federation/sdk": "2.8.2" } }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, "node_modules/@plotly/d3": { "version": "3.8.2", "resolved": "https://registry.npmjs.org/@plotly/d3/-/d3-3.8.2.tgz", @@ -1271,14 +1083,119 @@ "resolved": "https://registry.npmjs.org/@plotly/regl/-/regl-2.1.2.tgz", "integrity": "sha512-Mdk+vUACbQvjd0m/1JJjOOafmkp/EpmHjISsopEz5Av44CBq7rPC05HHNbYGKVyNUF2zmEoBS/TT0pd0SPFFyw==" }, + "node_modules/@rspack/binding": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-2.2.9.tgz", + "integrity": "sha512-Y8wDJoRo8n0KXDGq6J3KGVekkUQcOcUHSppMHoJv8JLbNBEsyaaKiDx4ljNTGEDtTON0CRbMEWbSiLRe+bJxOQ==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "@rspack/binding-darwin-arm64": "2.2.9", + "@rspack/binding-darwin-x64": "2.2.9", + "@rspack/binding-linux-arm64-gnu": "2.2.9", + "@rspack/binding-linux-arm64-musl": "2.2.9", + "@rspack/binding-linux-ppc64-gnu": "2.2.9", + "@rspack/binding-linux-riscv64-gnu": "2.2.9", + "@rspack/binding-linux-riscv64-musl": "2.2.9", + "@rspack/binding-linux-s390x-gnu": "2.2.9", + "@rspack/binding-linux-x64-gnu": "2.2.9", + "@rspack/binding-linux-x64-musl": "2.2.9", + "@rspack/binding-wasm32-wasi": "2.2.9", + "@rspack/binding-win32-arm64-msvc": "2.2.9", + "@rspack/binding-win32-ia32-msvc": "2.2.9", + "@rspack/binding-win32-x64-msvc": "2.2.9" + } + }, + "node_modules/@rspack/binding-darwin-arm64": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-2.2.9.tgz", + "integrity": "sha512-aIHkk/wngpwgWkwVQFz2AIkmG9WpWtWlkqy4BlYhs5a7l9z0BrB0kXnUb6VSbqZ7Tc3cRepKw7ipkGjKa8KKXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rspack/binding-darwin-x64": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-2.2.9.tgz", + "integrity": "sha512-QtUS7lyOE5oxdMm7RH/Fw176jqwdHiTW2qEsmbdCYzPw3t7QkmI5ohoyiuxOp3czJfaayXP6bVyvm2FqqnWPAw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rspack/binding-linux-arm64-gnu": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-2.2.9.tgz", + "integrity": "sha512-GMKxtBJAMoqBPqXZVi0QanDkneWwgiKRpTgHW/pbKPY/2XMfZJ98thm4YlATO18XZJ2KET+GfsNfaf1o5Y+aaA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rspack/binding-linux-arm64-musl": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-2.2.9.tgz", + "integrity": "sha512-aW3fcM64R5mY2+ym6Q8okAo/pcVIjAliqxFOc9lf9hCyS7hHaabWo30smeMX3neEjsqw+iyNbzWMuH0G5AugTw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rspack/binding-linux-ppc64-gnu": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-2.2.9.tgz", + "integrity": "sha512-dVEiyZdANq+g/qugI64vKnxO+PCVicidu/GQ6sO0QEWGVzdSUbxHztHviSnMwdvRs6OLrN7Lwhaw536hJ/cU8w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rspack/binding-linux-riscv64-gnu": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-2.1.8.tgz", - "integrity": "sha512-gg4S1jaitwYPHR9HZ3zNGH1EK2GXINm66p4kEpOP1gbc+akyOouVF/dMcu9NGPlRg58FbEhVRZYKu7Z/zcpKHg==", + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-2.2.9.tgz", + "integrity": "sha512-uBHWmfMm502145le0EUOsBoV6bJ9XA5s3NQLL4smSMoSEuMbNrRhqDJ2+B1u8aXVfjfhxCPyNlMDmgbsdVaO0Q==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1286,19 +1203,156 @@ ] }, "node_modules/@rspack/binding-linux-riscv64-musl": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-2.1.8.tgz", - "integrity": "sha512-b/aU5j1h368SLNyz5u+flqpZVhzSZ1UIslaj9sZJuAvqkGWv3xsjc/28/PTo/RYXCxd0FNVAxTxWHKvRiAAS8w==", + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-2.2.9.tgz", + "integrity": "sha512-MR7e6PP7KcG3jHYWznk17npBBvjUXQg7qQbS+yrAu0R3p/27wLp+aP5m/zk4ev1Iq93ccIBIAGVRGA3v1fSKew==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rspack/binding-linux-s390x-gnu": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-2.2.9.tgz", + "integrity": "sha512-Tc9Nuv7XvkrAG79Ps/6F7vT4bxZqiaiQ3Rd3BidKUjVYiwTPJogk1W3gPXp7Lw+AMoN/dY63W22bMJ7Oh0FeZw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ "linux" ] }, + "node_modules/@rspack/binding-linux-x64-gnu": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-2.2.9.tgz", + "integrity": "sha512-xQYhQwC8q3mSCzHV+yi76Gt2Lt9BhnmeJnQgXGjuhyvjZWBB9jFNp9Uj6umun7tlMliMRhoqTesqvK4Vo/kkcQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rspack/binding-linux-x64-musl": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-2.2.9.tgz", + "integrity": "sha512-FfEYdFhOd1nZL+U/up8nlbcRTTyWX4ohXUQcApQMYKIZoR1EJ0g/oBhS915+TSray0DchA+NT6yVL1sqWJOFaQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rspack/binding-wasm32-wasi": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-2.2.9.tgz", + "integrity": "sha512-+29JEBiUi2TMDOGYmT3Tm3JGk3f19+CbjxNEt1bVreR8axuZZj+wOSwB/sx85lKQkL5fuNPh0BhOZ7cdkDxQpA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.3", + "@emnapi/runtime": "1.11.3", + "@napi-rs/wasm-runtime": "1.1.6" + } + }, + "node_modules/@rspack/binding-win32-arm64-msvc": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-2.2.9.tgz", + "integrity": "sha512-x/BDAwQCkR+ANWAAWV+15PFWuae2z9DzL+QcVeb+5taOri+tHa/iQdG8e3GJ60d0amsR+u9BJ2CBtJLK1fQkxw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rspack/binding-win32-ia32-msvc": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-2.2.9.tgz", + "integrity": "sha512-i622t0Mom3STiDi8VHLaX62LKwhbT2kg37fKjzv3wQT+9bJvQ/+St6QQzFZg9C7fV53LXqAw8jFi5yIPIjg0Qw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rspack/binding-win32-x64-msvc": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-2.2.9.tgz", + "integrity": "sha512-K98FPCAv0VpDPAz5ZqZ0XI1CmdJu9Kw1FmUDl4rN/zQIt9iqYn+Hgxq6Nk6Zx7g938jiG7ABLwITXSIKGbs6aw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rspack/core": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/@rspack/core/-/core-2.2.9.tgz", + "integrity": "sha512-Tp6/ZdM5UrGB3BeLfvh69l1iX03PZ46IgXjKqubVEuJVAhnOjpshooH/YAxcxR0AymcBLKA997Z4v+LV2aXzCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rspack/binding": "2.2.9" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0", + "@swc/helpers": "^0.5.23" + }, + "peerDependenciesMeta": { + "@module-federation/runtime-tools": { + "optional": true + }, + "@swc/helpers": { + "optional": true + } + } + }, "node_modules/@turf/area": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/@turf/area/-/area-7.4.0.tgz", @@ -1357,9 +1411,9 @@ } }, "node_modules/@tybys/wasm-util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", - "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", + "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", "dev": true, "license": "MIT", "optional": true, diff --git a/js/package.json b/js/package.json index b79868d73e..87bfb61a1f 100644 --- a/js/package.json +++ b/js/package.json @@ -20,7 +20,7 @@ "dependencies": { "lodash-es": "^4.17.21", "plotly.js": "4.1.1", - "@lumino/widgets": "~2.9.0" + "@lumino/widgets": "~2.10.0" }, "devDependencies": { "@jupyter/builder": "^1.2.2", diff --git a/plotly/labextension/package.json b/plotly/labextension/package.json index 57ea10da4a..b846b67343 100644 --- a/plotly/labextension/package.json +++ b/plotly/labextension/package.json @@ -20,7 +20,7 @@ "dependencies": { "lodash-es": "^4.17.21", "plotly.js": "4.1.1", - "@lumino/widgets": "~2.9.0" + "@lumino/widgets": "~2.10.0" }, "devDependencies": { "@jupyter/builder": "^1.2.2", @@ -33,7 +33,7 @@ "outputDir": "../plotly/labextension", "webpackConfig": "./webpack.config.js", "_build": { - "load": "static/remoteEntry.954b872b457cd897.js", + "load": "static/remoteEntry.abb48f6ec9793506.js", "mimeExtension": "./mimeExtension" } } diff --git a/plotly/labextension/static/0.449902a1d9ae1138.js b/plotly/labextension/static/0.449902a1d9ae1138.js new file mode 100644 index 0000000000..2e7a1553f6 --- /dev/null +++ b/plotly/labextension/static/0.449902a1d9ae1138.js @@ -0,0 +1,3526 @@ +(self.rspackChunkjupyterlab_plotly=self.rspackChunkjupyterlab_plotly||[]).push([[0],{2(e,t,r){"use strict";let i,n,a,o,s,l,u,c,h,d,f,p;r.r(t);var m,g,y,v,x,b,_,w,T,A,M,k,S=r(3),E=Object.create,D=Object.defineProperty,C=Object.getOwnPropertyDescriptor,I=Object.getOwnPropertyNames,L=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty,z=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}},F=(e,t,r)=>(r=null!=e?E(L(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of I(t))P.call(e,i)||void 0===i||D(e,i,{get:()=>t[i],enumerable:!(r=C(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?r:D(r,"default",{value:e,enumerable:!0}),e)),O=z((e,t)=>{var r,i;r=e,i=function(e){var t;function r(e,t){let r=0;for(let i of e)if(!1===t(i,r++))return!1;return!0}e.ArrayExt=void 0,function(e){function t(e,r,i=0,n=-1){let a,o=e.length;if(0===o)return -1;i=i<0?Math.max(0,i+o):Math.min(i,o-1),a=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))=r)return;let i=e[t];for(let i=t+1;i0;){let i=s>>1,n=o+i;0>r(e[n],t)?(o=n+1,s-=i+1):s=i}return o},e.upperBound=function(e,t,r,i=0,n=-1){let a=e.length;if(0===a)return 0;i=i<0?Math.max(0,i+a):Math.min(i,a-1),n=n<0?Math.max(0,n+a):Math.min(n,a-1);let o=i,s=n-i+1;for(;s>0;){let i=s>>1,n=o+i;r(e[n],t)>0?s=i:(o=n+1,s-=i+1)}return o},e.shallowEqual=function(e,t,r){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i=o&&(i=a<0?o-1:o),void 0===n?n=a<0?-1:o:n<0?n=Math.max(n+o,a<0?-1:0):n>=o&&(n=a<0?o-1:o),r=a<0&&n>=i||a>0&&i>=n?0:a<0?Math.floor((n-i+1)/a+1):Math.floor((n-i-1)/a+1);let s=[];for(let t=0;t=(i=i<0?Math.max(0,i+n):Math.min(i,n-1)))return;let o=i-r+1;if(t>0?t%=o:t<0&&(t=(t%o+o)%o),0===t)return;let s=r+t;a(e,r,s-1),a(e,s,i),a(e,r,i)},e.fill=function(e,t,r=0,i=-1){let n,a=e.length;if(0!==a){r=r<0?Math.max(0,r+a):Math.min(r,a-1),n=(i=i<0?Math.max(0,i+a):Math.min(i,a-1))t;--r)e[r]=e[r-1];e[t]=r},e.removeAt=o,e.removeFirstOf=function(e,r,i=0,n=-1){let a=t(e,r,i,n);return -1!==a&&o(e,a),a},e.removeLastOf=function(e,t,i=-1,n=0){let a=r(e,t,i,n);return -1!==a&&o(e,a),a},e.removeAllOf=function(e,t,r=0,i=-1){let n=e.length;if(0===n)return 0;r=r<0?Math.max(0,r+n):Math.min(r,n-1),i=i<0?Math.max(0,i+n):Math.min(i,n-1);let a=0;for(let o=0;o=r&&o<=i&&e[o]===t||i=r)&&e[o]===t?a++:a>0&&(e[o-a]=e[o]);return a>0&&(e.length=n-a),a},e.removeFirstWhere=function(e,t,r=0,n=-1){let a,s=i(e,t,r,n);return -1!==s&&(a=o(e,s)),{index:s,value:a}},e.removeLastWhere=function(e,t,r=-1,i=0){let a,s=n(e,t,r,i);return -1!==s&&(a=o(e,s)),{index:s,value:a}},e.removeAllWhere=function(e,t,r=0,i=-1){let n=e.length;if(0===n)return 0;r=r<0?Math.max(0,r+n):Math.min(r,n-1),i=i<0?Math.max(0,i+n):Math.min(i,n-1);let a=0;for(let o=0;o=r&&o<=i&&t(e[o],o)||i=r)&&t(e[o],o)?a++:a>0&&(e[o-a]=e[o]);return a>0&&(e.length=n-a),a}}(e.ArrayExt||(e.ArrayExt={})),(t||(t={})).rangeLength=function(e,t,r){return 0===r?1/0:e>t&&r>0||et)}}(e.StringExt||(e.StringExt={})),e.chain=function*(...e){for(let t of e)yield*t},e.each=function(e,t){let r=0;for(let i of e)if(!1===t(i,r++))return},e.empty=function*(){},e.enumerate=function*(e,t=0){for(let r of e)yield[t++,r]},e.every=r,e.filter=function*(e,t){let r=0;for(let i of e)t(i,r++)&&(yield i)},e.find=function(e,t){let r=0;for(let i of e)if(t(i,r++))return i},e.findIndex=function(e,t){let r=0;for(let i of e)if(t(i,r++))return r-1;return -1},e.map=function*(e,t){let r=0;for(let i of e)yield t(i,r++)},e.max=function(e,t){let r;for(let i of e){if(void 0===r){r=i;continue}t(i,r)>0&&(r=i)}return r},e.min=function(e,t){let r;for(let i of e){if(void 0===r){r=i;continue}0>t(i,r)&&(r=i)}return r},e.minmax=function(e,t){let r=!0,i,n;for(let a of e)r?(i=a,n=a,r=!1):0>t(a,i)?i=a:t(a,n)>0&&(n=a);return r?void 0:[i,n]},e.once=function*(e){yield e},e.range=function*(e,r,i){void 0===r?(r=e,e=0,i=1):void 0===i&&(i=1);let n=t.rangeLength(e,r,i);for(let t=0;t-1;t--)yield e[t]},e.some=function(e,t){let r=0;for(let i of e)if(t(i,r++))return!0;return!1},e.stride=function*(e,t){let r=0;for(let i of e)r++%t==0&&(yield i)},e.take=function*(e,t){if(t<1)return;let r=e[Symbol.iterator](),i;for(;0e[Symbol.iterator]()),i=t.map(e=>e.next());for(;r(i,e=>!e.done);i=t.map(e=>e.next()))yield i.map(e=>e.value)}},"object"==typeof e&&"u">typeof t?i(e):"function"==typeof define&&define.amd?define(["exports"],i):i((r="u">typeof globalThis?globalThis:r||self).lumino_algorithm={})}),R=z((e,t)=>{var r,i;r=e,i=function(e,t){let r;e.JSONExt=void 0,function(e){function t(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e}function r(e){return Array.isArray(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=r;e.isObject=function(e){return!t(e)&&!r(e)},e.deepEqual=function e(i,n){if(i===n)return!0;if(t(i)||t(n))return!1;let a=r(i),o=r(n);return a===o&&(a&&o?function(t,r){if(t===r)return!0;if(t.length!==r.length)return!1;for(let i=0,n=t.length;i{if(i===e.provides)return!0;let o=r.get(i);if(!o)return!1;let s=t.get(o),l=[...s.requires,...s.optional];return 0!==l.length&&(a.push(o),!!l.some(n)||(a.pop(),!1))};if(!e.provides||0===i.length)return;let a=[e.id];if(i.some(n))throw ReferenceError(`Cycle detected: ${a.join(" -> ")}.`)},n.findDependents=function(e,r,i){let n=[],a=e=>{let t=r.get(e),a=[...t.requires,...t.optional];n.push(...a.reduce((t,r)=>{let n=i.get(r);return n&&t.push([e,n]),t},[]))};for(let e of r.keys())a(e);let o=n.filter(t=>t[1]===e),s=0;for(;o.length>s;){let e=o.length;for(let e of new Set(o.map(e=>e[0])))n.filter(t=>t[1]===e).forEach(e=>{o.includes(e)||o.push(e)});s=e}let l=t.topologicSort(o),u=l.findIndex(t=>t===e);return -1===u?[e]:l.slice(0,u+1)},n.collectStartupPlugins=function(e,t){let r=new Set;for(let t of e.keys())!0===e.get(t).autoStart&&r.add(t);if(t.startPlugins)for(let e of t.startPlugins)r.add(e);if(t.ignorePlugins)for(let e of t.ignorePlugins)r.delete(e);return Array.from(r)};e.Random=void 0,(e.Random||(e.Random={})).getRandomValues=(r="u">typeof window&&(window.crypto||window.msCrypto)||null)&&"function"==typeof r.getRandomValues?function(e){return r.getRandomValues(e)}:function(e){let t=0;for(let r=0,i=e.length;r>>0),e[r]=255&t,t>>>=8},e.UUID=void 0,(e.UUID||(e.UUID={})).uuid4=function(e){let t=new Uint8Array(16),r=Array(256);for(let e=0;e<16;++e)r[e]="0"+e.toString(16);for(let e=16;e<256;++e)r[e]=e.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],r[t[0]]+r[t[1]]+r[t[2]]+r[t[3]]+"-"+r[t[4]]+r[t[5]]+"-"+r[t[6]]+r[t[7]]+"-"+r[t[8]]+r[t[9]]+"-"+r[t[10]]+r[t[11]]+r[t[12]]+r[t[13]]+r[t[14]]+r[t[15]]}}(e.Random.getRandomValues),e.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(e){return -1!==this._types.indexOf(e)}getData(e){let t=this._types.indexOf(e);return -1!==t?this._values[t]:void 0}setData(e,t){this.clearData(e),this._types.push(e),this._values.push(t)}clearData(e){let t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))}clear(){this._types.length=0,this._values.length=0}},e.PluginRegistry=class{constructor(e={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,e.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=e.validatePlugin)}get application(){return this._application}set application(e){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=e}get deferredPlugins(){return Array.from(this._plugins).filter(([e,t])=>"defer"===t.autoStart).map(([e,t])=>e)}getPluginDescription(e){var t,r;return null!=(r=null==(t=this._plugins.get(e))?void 0:t.description)?r:""}hasPlugin(e){return this._plugins.has(e)}isPluginActivated(e){var t,r;return null!=(r=null==(t=this._plugins.get(e))?void 0:t.activated)&&r}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(e){if(this._plugins.has(e.id))throw TypeError(`Plugin '${e.id}' is already registered.`);if(!this._validatePlugin(e))throw Error(`Plugin '${e.id}' is not valid.`);let t=i.createPluginData(e);i.ensureNoCycle(t,this._plugins,this._services),t.provides&&this._services.set(t.provides,t.id),this._plugins.set(t.id,t)}registerPlugins(e){for(let t of e)this.registerPlugin(t)}deregisterPlugin(e,t){let r=this._plugins.get(e);if(r){if(r.activated&&!t)throw Error(`Plugin '${e}' is still active.`);this._plugins.delete(e)}}async activatePlugin(e){let t=this._plugins.get(e);if(!t)throw ReferenceError(`Plugin '${e}' is not registered.`);if(t.activated)return;if(t.promise)return t.promise;let r=t.requires.map(e=>this.resolveRequiredService(e)),i=t.optional.map(e=>this.resolveOptionalService(e));return t.promise=Promise.all([...r,...i]).then(e=>t.activate.apply(void 0,[this.application,...e])).then(e=>{t.service=e,t.activated=!0,t.promise=null}).catch(e=>{throw t.promise=null,e}),t.promise}async activatePlugins(e,t={}){switch(e){case"defer":{let e=this.deferredPlugins.filter(e=>this._plugins.get(e).autoStart).map(e=>this.activatePlugin(e));await Promise.all(e);break}case"startUp":{let e=i.collectStartupPlugins(this._plugins,t).map(async e=>{try{return await this.activatePlugin(e)}catch(t){console.error(`Plugin '${e}' failed to activate.`,t)}});await Promise.all(e)}}}async deactivatePlugin(e){let t=this._plugins.get(e);if(!t)throw ReferenceError(`Plugin '${e}' is not registered.`);if(!t.activated)return[];if(!t.deactivate)throw TypeError(`Plugin '${e}'#deactivate() method missing`);let r=i.findDependents(e,this._plugins,this._services),n=r.map(e=>this._plugins.get(e));for(let t of n)if(!t.deactivate)throw TypeError(`Plugin ${t.id}#deactivate() method missing (depends on ${e})`);for(let e of n){let t=[...e.requires,...e.optional].map(e=>{let t=this._services.get(e);return t?this._plugins.get(t).service:null});await e.deactivate(this.application,...t),e.service=null,e.activated=!1}return r.pop(),r}async resolveRequiredService(e){let t=this._services.get(e);if(!t)throw TypeError(`No provider for: ${e.name}.`);let r=this._plugins.get(t);return r.activated||await this.activatePlugin(t),r.service}async resolveOptionalService(e){let t=this._services.get(e);if(!t)return null;let r=this._plugins.get(t);if(!r.activated)try{await this.activatePlugin(t)}catch(e){return console.error(e),null}return r.service}},e.PromiseDelegate=class{constructor(){this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){(0,this._resolve)(e)}reject(e){(0,this._reject)(e)}},e.Token=class{constructor(e,t){this.name=e,this.description=t??"",this._tokenStructuralPropertyT=null}}},"object"==typeof e&&"u">typeof t?i(e,O()):"function"==typeof define&&define.amd?define(["exports","@lumino/algorithm"],i):i((r="u">typeof globalThis?globalThis:r||self).lumino_coreutils={},r.lumino_algorithm)}),B=z((e,t)=>{var r,i;r="u">typeof self?self:e,i=()=>{var e=(()=>{var e=Object.create,t=Object.defineProperty,r=Object.defineProperties,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),h=(e,r,i)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,d=(e,t)=>{for(var r in t||(t={}))l.call(t,r)&&h(e,r,t[r]);if(o)for(var r of o(t))u.call(t,r)&&h(e,r,t[r]);return e},f=(e,t)=>r(e,n(t)),p=(e,t,r)=>function(){if(r)throw r[0];try{return e&&(t=(0,e[a(e)[0]])(e=0)),t}catch(e){throw r=[e],e}},m=(e,t)=>function(){try{return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}},g=(e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:!0})},y=(e,r,n,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let s of a(r))l.call(e,s)||s===n||t(e,s,{get:()=>r[s],enumerable:!(o=i(r,s))||o.enumerable});return e},v=(r,i,n)=>(n=null!=r?e(s(r)):{},y(!i&&r&&r.__esModule?n:t(n,"default",{value:r,enumerable:!0}),r)),x=e=>y(t({},"__esModule",{value:!0}),e),b=(e,t,r)=>new Promise((i,n)=>{var a=e=>{try{s(r.next(e))}catch(e){n(e)}},o=e=>{try{s(r.throw(e))}catch(e){n(e)}},s=e=>e.done?i(e.value):Promise.resolve(e.value).then(a,o);s((r=r.apply(e,t)).next())}),_=function(e,t){this[0]=e,this[1]=t},w=e=>{var t,r=e[c("asyncIterator")],i=!1,n={};return null==r?(r=e[c("iterator")](),t=e=>n[e]=t=>r[e](t)):(r=r.call(e),t=e=>n[e]=t=>{if(i){if(i=!1,"throw"===e)throw t;return t}return i=!0,{done:!1,value:new _(new Promise(i=>{var n=r[e](t);n instanceof Object||(e=>{throw TypeError(e)})("Object expected"),i(n)}),1)}}),n[c("iterator")]=()=>n,t("next"),"throw"in r?t("throw"):n.throw=e=>{throw e},"return"in r&&t("return"),n},T=m({"src/version.js"(e){e.version="4.1.1"}}),A=m({"node_modules/native-promise-only/lib/npo.src.js"(e,t){var r,i;r="Promise",i="u">typeof window?window:e,i[r]=i[r]||function(){var e,t,r,i=Object.prototype.toString,n="u">typeof setImmediate?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,r,i){return Object.defineProperty(e,t,{value:r,writable:!0,configurable:!1!==i})}}catch{e=function(e,t,r){return e[t]=r,e}}function a(e,i){r.add(e,i),t||(t=n(r.drain))}function o(e){var t,r=typeof e;return null!=e&&("object"==r||"function"==r)&&(t=e.then),"function"==typeof t&&t}function s(){for(var e=0;e0&&a(s,r))}catch(e){u.call(new h(r),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function c(e,t,r,i){for(var n=0;ntypeof t&&t.exports&&(t.exports=i[r])}}),M=m({"node_modules/@plotly/d3/d3.js"(e,t){(function(){var e={version:"3.8.2"},r=[].slice,i=function(e){return r.call(e)},n=self.document;function a(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(n)try{i(n.documentElement.childNodes)[0].nodeType}catch{i=function(e){for(var t=e.length,r=Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),n)try{n.createElement("DIV").style.setProperty("opacity",0,"")}catch{var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,h=c.setProperty;s.setAttribute=function(e,t){l.call(this,e,t+"")},s.setAttributeNS=function(e,t,r){u.call(this,e,t,r+"")},c.setProperty=function(e,t,r){h.call(this,e,t+"",r)}}function d(e,t){return et?1:e>=t?0:0/0}function f(e){return null===e?0/0:+e}function p(e){return!isNaN(e)}function m(e){return{left:function(t,r,i,n){for(arguments.length<3&&(i=0),arguments.length<4&&(n=t.length);i>>1;0>e(t[a],r)?i=a+1:n=a}return i},right:function(t,r,i,n){for(arguments.length<3&&(i=0),arguments.length<4&&(n=t.length);i>>1;e(t[a],r)>0?n=a:i=a+1}return i}}}e.ascending=d,e.descending=function(e,t){return te?1:t>=e?0:0/0},e.min=function(e,t){var r,i,n=-1,a=e.length;if(1==arguments.length){for(;++n=i){r=i;break}for(;++ni&&(r=i)}else{for(;++n=i){r=i;break}for(;++ni&&(r=i)}return r},e.max=function(e,t){var r,i,n=-1,a=e.length;if(1==arguments.length){for(;++n=i){r=i;break}for(;++nr&&(r=i)}else{for(;++n=i){r=i;break}for(;++nr&&(r=i)}return r},e.extent=function(e,t){var r,i,n,a=-1,o=e.length;if(1==arguments.length){for(;++a=i){r=n=i;break}for(;++ai&&(r=i),n=i){r=n=i;break}for(;++ai&&(r=i),n1)return o/(l-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t&&Math.sqrt(t)};var g=m(d);function y(e){return e.length}e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return m(1===e.length?function(t,r){return d(e(t),r)}:e)},e.shuffle=function(e,t,r){(a=arguments.length)<3&&(r=e.length,a<2&&(t=0));for(var i,n,a=r-t;a;)n=Math.random()*a--|0,i=e[a+t],e[a+t]=e[n+t],e[n+t]=i;return e},e.permute=function(e,t){for(var r=t.length,i=Array(r);r--;)i[r]=e[t[r]];return i},e.pairs=function(e){for(var t=0,r=e.length-1,i=e[0],n=Array(r<0?0:r);t=0;)for(t=(i=e[n]).length;--t>=0;)r[--o]=i[t];return r};var v=Math.abs;function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function b(){this._=Object.create(null)}function _(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function w(e){return"\0"===(e+="")[0]?e.slice(1):e}function T(e){return _(e)in this._}function A(e){return(e=_(e))in this._&&delete this._[e]}function M(){var e=[];for(var t in this._)e.push(w(t));return e}function k(){var e=0;for(var t in this._)++e;return e}function S(){for(var e in this._)return!1;return!0}function E(){this._=Object.create(null)}function D(e){return e}function C(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,i=I.length;rt;)n.push(i/a);else for(;(i=e+r*++o)=n.length)return r?r.call(i,a):t?a.sort(t):a;for(var l,u,c,h,d=-1,f=a.length,p=n[s++],m=new b;++d=n.length)return t;var i=[],o=a[r++];return t.forEach(function(t,n){i.push({key:t,values:e(n,r)})}),o?i.sort(function(e,t){return o(e.key,t.key)}):i}(o(e.map,t,0),0)},i.key=function(e){return n.push(e),i},i.sortKeys=function(e){return a[n.length-1]=e,i},i.sortValues=function(e){return t=e,i},i.rollup=function(e){return r=e,i},i},e.set=function(e){var t=new E;if(e)for(var r=0,i=e.length;r=0&&(i=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(i):this[e].on(i,t);if(2==arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(i,null);return this}},e.event=null,e.requote=function(e){return e.replace(B,"\\$&")};var B=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,j={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function N(e){return j(e,G),e}var V=function(e,t){return t.querySelector(e)},U=function(e,t){return t.querySelectorAll(e)},q=function(e,t){var r=e.matches||e[C(e,"matchesSelector")];return(q=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(V=function(e,t){return Sizzle(e,t)[0]||null},U=Sizzle,q=Sizzle.matchesSelector),e.selection=function(){return e.select(n.documentElement)};var G=e.selection.prototype=[];function H(e){return"function"==typeof e?e:function(){return V(e,this)}}function $(e){return"function"==typeof e?e:function(){return U(e,this)}}G.select=function(e){var t,r,i,n,a=[];e=H(e);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),Y.hasOwnProperty(r)?{space:Y[r],local:e}:e}},G.attr=function(t,r){if(arguments.length<2){if("string"==typeof t){var i=this.node();return(t=e.ns.qualify(t)).local?i.getAttributeNS(t.space,t.local):i.getAttribute(t)}for(r in t)this.each(Z(r,t[r]));return this}return this.each(Z(t,r))},G.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),i=(e=J(e)).length,n=-1;if(t=r.classList){for(;++n=0;)(r=i[n])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},G.sort=function(e){e=es.apply(this,arguments);for(var t=-1,r=this.length;++t0&&(t=t.slice(0,o));var l=ed.get(t);function u(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}return l&&(t=l,s=ep),o?r?function(){var e=s(r,i(arguments));u.call(this),this.addEventListener(t,this[a]=e,e.$=n),e._=r}:u:r?L:function(){var r,i=RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var n in this)if(r=n.match(i)){var a=this[n];this.removeEventListener(r[1],a,a.$),delete this[n]}}}e.selection.enter=eu,e.selection.enter.prototype=ec,ec.append=G.append,ec.empty=G.empty,ec.node=G.node,ec.call=G.call,ec.size=G.size,ec.select=function(e){for(var t,r,i,n,a,o=[],s=-1,l=this.length;++s=i&&(i=t+1);!(o=s[i])&&++i1?eA:e<-1?-eA:Math.asin(e)}function eE(e){return((e=Math.exp(e))+1/e)/2}var eD=Math.SQRT2;e.interpolateZoom=function(e,t){var r,i,n=e[0],a=e[1],o=e[2],s=t[0],l=t[1],u=t[2],c=s-n,h=l-a,d=c*c+h*h;if(d<1e-12)i=Math.log(u/o)/eD,r=function(e){return[n+e*c,a+e*h,o*Math.exp(eD*e*i)]};else{var f=Math.sqrt(d),p=(u*u-o*o+4*d)/(2*o*2*f),m=(u*u-o*o-4*d)/(2*u*2*f),g=Math.log(Math.sqrt(p*p+1)-p);i=(Math.log(Math.sqrt(m*m+1)-m)-g)/eD,r=function(e){var t,r,s=e*i,l=eE(g),u=o/(2*f)*(l*(((t=Math.exp(2*(t=eD*s+g)))-1)/(t+1))-((r=Math.exp(r=g))-1/r)/2);return[n+u*c,a+u*h,o*l/eE(eD*s+g)]}}return r.duration=1e3*i,r},e.behavior.zoom=function(){var t,r,i,a,s,l,u,c,h,d={x:0,y:0,k:1},f=[960,500],p=eL,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=R(w,"zoomstart","zoom","zoomend");function w(e){e.on(y,I).on(eI+".zoom",P).on("dblclick.zoom",z).on(b,L)}function T(e){return[(e[0]-d.x)/d.k,(e[1]-d.y)/d.k]}function A(e){d.k=Math.max(p[0],Math.min(p[1],e))}function M(e,t){var r;t=[(r=t)[0]*d.k+d.x,r[1]*d.k+d.y],d.x+=e[0]-t[0],d.y+=e[1]-t[1]}function k(t,i,n,a){t.__chart__={x:d.x,y:d.y,k:d.k},A(Math.pow(2,a)),M(r=i,n),t=e.select(t),m>0&&(t=t.transition().duration(m)),t.call(w.event)}function S(){u&&u.domain(l.range().map(function(e){return(e-d.x)/d.k}).map(l.invert)),h&&h.domain(c.range().map(function(e){return(e-d.y)/d.k}).map(c.invert))}function E(e){g++||e({type:"zoomstart"})}function D(e){S(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function C(e){--g||(e({type:"zoomend"}),r=null)}function I(){var t=this,r=_.of(t,arguments),i=0,n=e.select(o(t)).on(v,function(){i=1,M(e.mouse(t),a),D(r)}).on(x,function(){n.on(v,null).on(x,null),s(i),C(r)}),a=T(e.mouse(t)),s=ey(t);iH.call(t),E(r)}function L(){var t,r=this,i=_.of(r,arguments),n={},a=0,o=".zoom-"+e.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],h=e.select(r),f=ey(r);function p(){var i=e.touches(r);return t=d.k,i.forEach(function(e){e.identifier in n&&(n[e.identifier]=T(e))}),i}function m(){var t=e.event.target;e.select(t).on(l,g).on(u,v),c.push(t);for(var i=e.event.changedTouches,o=0,h=i.length;o1){var y=f[0],x=f[1],b=y[0]-x[0],_=y[1]-x[1];a=b*b+_*_}}function g(){var o,l,u,c,h=e.touches(r);iH.call(r);for(var d=0,f=h.length;d360?t-=360:t<0&&(t+=360),t<60?i+(n-i)*t/60:t<180?n:t<240?i+(n-i)*(240-t)/60:i))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=(r=r<0?0:r>1?1:r)<=.5?r*(1+t):r+t-r*t,i=2*r-n,new eY(a(e+120),a(e),a(e-120))}function eR(t,r,i){return this instanceof eR?(this.h=+t,this.c=+r,void(this.l=+i)):arguments.length<2?t instanceof eR?new eR(t.h,t.c,t.l):t instanceof eN?eG(t.l,t.a,t.b):eG((t=e1((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new eR(t,r,i)}eF.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new ez(this.h,this.s,this.l/e)},eF.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new ez(this.h,this.s,e*this.l)},eF.rgb=function(){return eO(this.h,this.s,this.l)},e.hcl=eR;var eB=eR.prototype=new eP;function ej(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new eN(r,Math.cos(e*=eM)*t,Math.sin(e)*t)}function eN(e,t,r){return this instanceof eN?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof eN?new eN(e.l,e.a,e.b):e instanceof eR?ej(e.h,e.c,e.l):e1((e=eY(e)).r,e.g,e.b):new eN(e,t,r)}eB.brighter=function(e){return new eR(this.h,this.c,Math.min(100,this.l+eV*(arguments.length?e:1)))},eB.darker=function(e){return new eR(this.h,this.c,Math.max(0,this.l-eV*(arguments.length?e:1)))},eB.rgb=function(){return ej(this.h,this.c,this.l).rgb()},e.lab=eN;var eV=18,eU=eN.prototype=new eP;function eq(e,t,r){var i=(e+16)/116,n=i+t/500,a=i-r/200;return n=.95047*eH(n),new eY(eW(3.2404542*n-1.5371385*(i=+eH(i))-.4985314*(a=1.08883*eH(a))),eW(-.969266*n+1.8760108*i+.041556*a),eW(.0556434*n-.2040259*i+1.0572252*a))}function eG(e,t,r){return e>0?new eR(Math.atan2(r,t)*ek,Math.sqrt(t*t+r*r),e):new eR(0/0,0/0,e)}function eH(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function e$(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function eW(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function eY(e,t,r){return this instanceof eY?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof eY?new eY(e.r,e.g,e.b):eQ(""+e,eY,eO):new eY(e,t,r)}function eZ(e){return new eY(e>>16,e>>8&255,255&e)}function eX(e){return eZ(e)+""}eU.brighter=function(e){return new eN(Math.min(100,this.l+eV*(arguments.length?e:1)),this.a,this.b)},eU.darker=function(e){return new eN(Math.max(0,this.l-eV*(arguments.length?e:1)),this.a,this.b)},eU.rgb=function(){return eq(this.l,this.a,this.b)},e.rgb=eY;var eK=eY.prototype=new eP;function eJ(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function eQ(e,t,r){var i,n,a,o=0,s=0,l=0;if(i=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(n=i[2].split(","),i[1]){case"hsl":return r(parseFloat(n[0]),parseFloat(n[1])/100,parseFloat(n[2])/100);case"rgb":return t(e3(n[0]),e3(n[1]),e3(n[2]))}return(a=e5.get(e))?t(a.r,a.g,a.b):(null==e||"#"!==e.charAt(0)||isNaN(a=parseInt(e.slice(1),16))||(4===e.length?(o=(o=(3840&a)>>4)>>4|o,s=(s=240&a)>>4|s,l=(l=15&a)<<4|l):7===e.length&&(o=(0xff0000&a)>>16,s=(65280&a)>>8,l=255&a)),t(o,s,l))}function e0(e,t,r){var i,n,a=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-a,l=(o+a)/2;return s?(n=l<.5?s/(o+a):s/(2-o-a),i=(e==o?(t-r)/s+6*(t0&&l<1?0:i),new ez(i,n,l)}function e1(e,t,r){e=e2(e);var i=e$((.4124564*e+.3575761*(t=e2(t))+.1804375*(r=e2(r)))/.95047),n=e$((.2126729*e+.7151522*t+.072175*r)/1);return eN(116*n-16,500*(i-n),200*(n-e$((.0193339*e+.119192*t+.9503041*r)/1.08883)))}function e2(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function e3(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}eK.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,i=this.b;return t||r||i?(t&&t<30&&(t=30),r&&r<30&&(r=30),i&&i<30&&(i=30),new eY(Math.min(255,t/e),Math.min(255,r/e),Math.min(255,i/e))):new eY(30,30,30)},eK.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new eY(e*this.r,e*this.g,e*this.b)},eK.hsl=function(){return e0(this.r,this.g,this.b)},eK.toString=function(){return"#"+eJ(this.r)+eJ(this.g)+eJ(this.b)};var e5=e.map({aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32});function e4(e){return"function"==typeof e?e:function(){return e}}function e6(e){return function(t,r,i){return 2==arguments.length&&"function"==typeof r&&(i=r,r=null),e8(t,r,e,i)}}function e8(t,r,n,a){var o,s={},l=e.dispatch("beforesend","progress","load","error"),u={},c=new XMLHttpRequest,h=null;function d(){var e,t,r,i=c.status;if(!i&&((t=(e=c).responseType)&&"text"!==t?e.response:e.responseText)||i>=200&&i<300||304===i){try{r=n.call(s,c)}catch(e){l.error.call(s,e);return}l.load.call(s,r)}else l.error.call(s,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=d:c.onreadystatechange=function(){c.readyState>3&&d()},c.onprogress=function(t){var r=e.event;e.event=t;try{l.progress.call(s,c)}finally{e.event=r}},s.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?u[e]:(null==t?delete u[e]:u[e]=t+"",s)},s.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",s):r},s.responseType=function(e){return arguments.length?(h=e,s):h},s.response=function(e){return n=e,s},["get","post"].forEach(function(e){s[e]=function(){return s.send.apply(s,[e].concat(i(arguments)))}}),s.send=function(e,i,n){if(2==arguments.length&&"function"==typeof i&&(n=i,i=null),c.open(e,t,!0),null==r||"accept"in u||(u.accept=r+",*/*"),c.setRequestHeader)for(var a in u)c.setRequestHeader(a,u[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=h&&(c.responseType=h),null!=n&&s.on("error",n).on("load",function(e){n(null,e)}),l.beforesend.call(s,c),c.send(i??null),s},s.abort=function(){return c.abort(),s},e.rebind(s,l,"on"),null==a?s:s.get(1===(o=a).length?function(e,t){o(null==e?t:null)}:o)}e5.forEach(function(e,t){e5.set(e,eZ(t))}),e.functor=e4,e.xhr=e6(D),e.dsv=function(e,t){var r=RegExp('["'+e+` +]`),i=e.charCodeAt(0);function n(e,r,i){arguments.length<3&&(i=r,r=null);var n=e8(e,t,null==r?a:o(r),i);return n.row=function(e){return arguments.length?n.response(null==(r=e)?a:o(e)):r},n}function a(e){return n.parse(e.responseText)}function o(e){return function(t){return n.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return n.parse=function(e,t){var r;return n.parseRows(e,function(e,i){if(r)return r(e,i-1);var n=function(t){for(var r={},i=e.length,n=0;n=l)return o;if(n)return n=!1,a;var t=u;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(tt),tt=setTimeout(tn,t)),te=0):(te=1,tr(tn))}function ta(){for(var e=Date.now(),t=e7;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function to(){for(var e,t=e7,r=1/0;t;)t.c?(t.t1&&0>=(t=e[a[o-2]],r=e[a[o-1]],i=e[s],(r[0]-t[0])*(i[1]-t[1])-(r[1]-t[1])*(i[0]-t[0]));)--o;a[o++]=s}return a.slice(0,o)}function tc(e,t){return e[0]-t[0]||e[1]-t[1]}e.timer=function(){ti.apply(this,arguments)},e.timer.flush=function(){ta(),to()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},e.geom={},e.geom.hull=function(e){var t=ts,r=tl;if(arguments.length)return i(e);function i(e){if(e.length<3)return[];var i,n=e4(t),a=e4(r),o=e.length,s=[],l=[];for(i=0;i=0;--i)f.push(e[s[u[i]][2]]);for(i=+h;i=-1e-12)){var f=l*l+u*u,p=c*c+h*h,m=(h*f-u*p)/d,g=(l*p-c*f)/d,h=g+s,y=t_.pop()||new tE;y.arc=e,y.site=n,y.x=m+o,y.y=h+Math.sqrt(m*m+g*g),y.cy=h,e.circle=y;for(var v=null,x=tx._;x;)if(y.y1e-6)s=s.L;else if((n=a-function(e,t){var r=e.N;if(r)return tM(r,t);var i=e.site;return i.y===t?i.x:1/0}(s,o))>1e-6){if(!s.R){t=s;break}s=s.R}else{i>-1e-6?(t=s.P,r=s):n>-1e-6?(t=s,r=s.N):t=r=s;break}var l=tT(e);if(ty.insert(t,l),!(!t&&!r)){if(t===r){tC(t),r=tT(t.site),ty.insert(l,r),l.edge=r.edge=tL(t.site,l.site),tD(t),tD(r);return}if(!r){l.edge=tL(t.site,l.site);return}tC(t),tC(r);var u=t.site,c=u.x,h=u.y,d=e.x-c,f=e.y-h,p=r.site,m=p.x-c,g=p.y-h,y=2*(d*g-f*m),v=d*d+f*f,x=m*m+g*g,b={x:(g*v-f*x)/y+c,y:(d*x-m*v)/y+h};tP(r.edge,u,p,b),l.edge=tL(u,e,null,b),r.edge=tL(e,p,null,b),tD(t),tD(r)}}(a),r=a.x,i=a.y),a=e.pop();else if(n)!function(e){var t=e.circle,r=t.x,i=t.cy,n={x:r,y:i},a=e.P,o=e.N,s=[e];tA(e);for(var l=a;l.circle&&1e-6>v(r-l.circle.x)&&1e-6>v(i-l.circle.cy);)a=l.P,s.unshift(l),tA(l),l=a;s.unshift(l),tC(l);for(var u=o;u.circle&&1e-6>v(r-u.circle.x)&&1e-6>v(i-u.circle.cy);)o=u.N,s.push(u),tA(u),u=o;s.push(u),tC(u);var c,h=s.length;for(c=1;c0)){if(a/=p,p<0){if(a0){if(a>f)return;a>d&&(d=a)}if(a=i-l,!(!p&&a<0)){if(a/=p,p<0){if(a>f)return;a>d&&(d=a)}else if(p>0){if(a0)){if(a/=m,m<0){if(a0){if(a>f)return;a>d&&(d=a)}if(a=n-u,!(!m&&a<0)){if(a/=m,m<0){if(a>f)return;a>d&&(d=a)}else if(m>0){if(a0&&(e.a={x:l+d*p,y:u+d*m}),f<1&&(e.b={x:l+f*p,y:u+f*m}),e}}}}}),l=o.length;l--;)(!function(e,t){var r=e.b;if(r)return!0;var i,n,a=e.a,o=t[0][0],s=t[1][0],l=t[0][1],u=t[1][1],c=e.l,h=e.r,d=c.x,f=c.y,p=h.x,m=h.y,g=(d+p)/2;if(m===f){if(g=s)return;if(d>p){if(a){if(a.y>=u)return}else a={x:g,y:l};r={x:g,y:u}}else{if(a){if(a.y1)if(d>p){if(a){if(a.y>=u)return}else a={x:(l-n)/i,y:l};r={x:(u-n)/i,y:u}}else{if(a){if(a.y=s)return}else a={x:o,y:i*o+n};r={x:s,y:i*s+n}}else{if(a){if(a.xv(a.a.x-a.b.x)&&1e-6>v(a.a.y-a.b.y))&&(a.a=a.b=null,o.splice(l,1))}(t),function(e){for(var t,r,i,n,a,o,s,l,u,c,h=e[0][0],d=e[1][0],f=e[0][1],p=e[1][1],m=tg,g=m.length;g--;)if(!(!(a=m[g])||!a.prepare()))for(l=(s=a.edges).length,o=0;o1e-6||v(n-r)>1e-6)&&(s.splice(o,0,new tz(function(e,t,r){var i=new tI(e,null);return i.a=t,i.b=r,tm.push(i),i}(a.site,c,1e-6>v(i-h)&&p-n>1e-6?{x:h,y:1e-6>v(t-h)?r:p}:1e-6>v(n-p)&&d-i>1e-6?{x:1e-6>v(r-p)?t:d,y:p}:1e-6>v(i-d)&&n-f>1e-6?{x:d,y:1e-6>v(t-d)?r:f}:1e-6>v(n-f)&&i-h>1e-6?{x:1e-6>v(r-f)?t:h,y:f}:null),a.site,null)),++l)}(t));var o={cells:tg,edges:tm};return ty=tx=tm=tg=null,o}function tV(e,t){return t.y-e.y||t.x-e.x}tk.prototype.prepare=function(){for(var e,t=this.edges,r=t.length;r--;)(e=t[r].edge).b&&e.a||t.splice(r,1);return t.sort(tS),t.length},tz.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},tF.prototype={insert:function(e,t){var r,i,n;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=tj(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)i=r.U,r===i.L?(n=i.R)&&n.C?(r.C=n.C=!1,i.C=!0,e=i):(e===r.R&&(tR(this,r),r=(e=r).U),r.C=!1,i.C=!0,tB(this,i)):(n=i.L)&&n.C?(r.C=n.C=!1,i.C=!0,e=i):(e===r.L&&(tB(this,r),r=(e=r).U),r.C=!1,i.C=!0,tR(this,i)),r=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,r,i,n=e.U,a=e.L,o=e.R;if(r=a?o?tj(o):a:o,n?n.L===e?n.L=r:n.R=r:this._=r,a&&o?(i=r.C,r.C=e.C,r.L=a,a.U=r,r!==o?(n=r.U,r.U=e.U,e=r.R,n.L=e,r.R=o,o.U=r):(r.U=n,n=r,e=r.R)):(i=e.C,e=r),e&&(e.U=n),!i){if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===n.L){if((t=n.R).C&&(t.C=!1,n.C=!0,tR(this,n),t=n.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,tB(this,t),t=n.R),t.C=n.C,n.C=t.R.C=!1,tR(this,n),e=this._;break}}else if((t=n.L).C&&(t.C=!1,n.C=!0,tB(this,n),t=n.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,tR(this,t),t=n.L),t.C=n.C,n.C=t.L.C=!1,tB(this,n),e=this._;break}t.C=!0,e=n,n=n.U}while(!e.C);e&&(e.C=!1)}}},e.geom.voronoi=function(e){var t=ts,r=tl,i=t,n=r,a=tU;if(e)return o(e);function o(e){var t=Array(e.length),r=a[0][0],i=a[0][1],n=a[1][0],o=a[1][1];return tN(s(e),a).cells.forEach(function(a,s){var l=a.edges,u=a.site;(t[s]=l.length?l.map(function(e){var t=e.start();return[t.x,t.y]}):u.x>=r&&u.x<=n&&u.y>=i&&u.y<=o?[[r,o],[n,o],[n,i],[r,i]]:[]).point=e[s]}),t}function s(e){return e.map(function(e,t){return{x:1e-6*Math.round(i(e,t)/1e-6),y:1e-6*Math.round(n(e,t)/1e-6),i:t}})}return o.links=function(e){return tN(s(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},o.triangles=function(e){var t=[];return tN(s(e)).cells.forEach(function(r,i){for(var n,a,o,s,l=r.site,u=r.edges.sort(tS),c=-1,h=u.length,d=u[h-1].edge,f=d.l===l?d.r:d.l;++c(n=l,a=s,o=f,(n.x-o.x)*(a.y-n.y)-(n.x-a.x)*(o.y-n.y))&&t.push([e[i],e[s.i],e[f.i]])}}),t},o.x=function(e){return arguments.length?(i=e4(t=e),o):t},o.y=function(e){return arguments.length?(n=e4(r=e),o):r},o.clipExtent=function(e){return arguments.length?(a=e??tU,o):a===tU?null:a},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):a===tU?null:a&&a[1]},o};var tU=[[-1e6,-1e6],[1e6,1e6]];function tq(e){return e.x}function tG(e){return e.y}function tH(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function t$(t,r){t=e.rgb(t),r=e.rgb(r);var i=t.r,n=t.g,a=t.b,o=r.r-i,s=r.g-n,l=r.b-a;return function(e){return"#"+eJ(Math.round(i+o*e))+eJ(Math.round(n+s*e))+eJ(Math.round(a+l*e))}}function tW(e,t){var r,i={},n={};for(r in e)r in t?i[r]=tJ(e[r],t[r]):n[r]=e[r];for(r in t)r in e||(n[r]=t[r]);return function(e){for(r in i)n[r]=i[r](e);return n}}function tY(e,t){return e*=1,t*=1,function(r){return e*(1-r)+t*r}}function tZ(e,t){var r,i,n,a=tX.lastIndex=tK.lastIndex=0,o=-1,s=[],l=[];for(e+="",t+="";(r=tX.exec(e))&&(i=tK.exec(t));)(n=i.index)>a&&(n=t.slice(a,n),s[o]?s[o]+=n:s[++o]=n),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:tY(r,i)})),a=tK.lastIndex;return am&&(m=l.x),l.y>g&&(g=l.y),u.push(l.x),c.push(l.y);else for(h=0;hm&&(m=b),_>g&&(g=_),u.push(b),c.push(_)}var w=m-f,T=g-p;function A(e,t,r,i,n,a,o,s){if(!(isNaN(r)||isNaN(i)))if(e.leaf){var l=e.x,u=e.y;if(null!=l)if(v(l-r)+v(u-i)<.01)M(e,t,r,i,n,a,o,s);else{var c=e.point;e.x=e.y=e.point=null,M(e,c,l,u,n,a,o,s),M(e,t,r,i,n,a,o,s)}else e.x=r,e.y=i,e.point=t}else M(e,t,r,i,n,a,o,s)}function M(e,t,r,i,n,a,o,s){var l=(n+o)*.5,u=(a+s)*.5,c=r>=l,h=i>=u,d=h<<1|c;e.leaf=!1,e=e.nodes[d]||(e.nodes[d]=tH()),c?n=l:o=l,h?a=u:s=u,A(e,t,r,i,n,a,o,s)}w>T?g=p+w:m=f+T;var k=tH();if(k.add=function(e){A(k,e,+y(e,++h),+x(e,h),f,p,m,g)},k.visit=function(e){!function e(t,r,i,n,a,o){if(!t(r,i,n,a,o)){var s=(i+a)*.5,l=(n+o)*.5,u=r.nodes;u[0]&&e(t,u[0],i,n,s,l),u[1]&&e(t,u[1],s,n,a,l),u[2]&&e(t,u[2],i,l,s,o),u[3]&&e(t,u[3],s,l,a,o)}}(e,k,f,p,m,g)},k.find=function(e){var t,r,i,n,a,o,s,l,u;return t=k,r=e[0],i=e[1],u=1/0,function e(t,c,h,d,f){if(!(c>o||h>s||d=b,T=i>=_,A=T<<1|w,M=A+4;A=0&&!(i=e.interpolators[n](t,r)););return i}function tQ(e,t){var r,i=[],n=[],a=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function t7(e){return 1-Math.cos(e*eA)}function t9(e){return Math.pow(2,10*(e-1))}function re(e){return 1-Math.sqrt(1-e*e)}function rt(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function rr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function ri(e){var t,r,i,n=[e.a,e.b],a=[e.c,e.d],o=ra(n),s=rn(n,a),l=ra((t=a,r=n,i=-s,t[0]+=i*r[0],t[1]+=i*r[1],t))||0;n[0]*a[1]=0?e.slice(0,i):e,a=i>=0?e.slice(i+1):"in";return n=t1.get(n)||t0,t=(a=t2.get(a)||D)(n.apply(null,r.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var i=t.h,n=t.c,a=t.l,o=r.h-i,s=r.c-n,l=r.l-a;return isNaN(s)&&(s=0,n=isNaN(n)?r.c:n),isNaN(o)?(o=0,i=isNaN(i)?r.h:i):o>180?o-=360:o<-180&&(o+=360),function(e){return ej(i+o*e,n+s*e,a+l*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var i=t.h,n=t.s,a=t.l,o=r.h-i,s=r.s-n,l=r.l-a;return isNaN(s)&&(s=0,n=isNaN(n)?r.s:n),isNaN(o)?(o=0,i=isNaN(i)?r.h:i):o>180?o-=360:o<-180&&(o+=360),function(e){return eO(i+o*e,n+s*e,a+l*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var i=t.l,n=t.a,a=t.b,o=r.l-i,s=r.a-n,l=r.b-a;return function(e){return eq(i+o*e,n+s*e,a+l*e)+""}},e.interpolateRound=rr,e.transform=function(t){var r=n.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new ri(t?t.matrix:ro)})(t)},ri.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ro={a:1,b:0,c:0,d:1,e:0,f:0};function rs(e){return e.length?e.pop()+",":""}function rl(t,r){var i,n,a,o,s=[],l=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,i){if(e[0]!==t[0]||e[1]!==t[1]){var n=r.push("translate(",null,",",null,")");i.push({i:n-4,x:tY(e[0],t[0])},{i:n-2,x:tY(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,s,l),i=t.rotate,n=r.rotate,i!==n?(i-n>180?n+=360:n-i>180&&(i+=360),l.push({i:s.push(rs(s)+"rotate(",null,")")-2,x:tY(i,n)})):n&&s.push(rs(s)+"rotate("+n+")"),a=t.skew,o=r.skew,a!==o?l.push({i:s.push(rs(s)+"skewX(",null,")")-2,x:tY(a,o)}):o&&s.push(rs(s)+"skewX("+o+")"),function(e,t,r,i){if(e[0]!==t[0]||e[1]!==t[1]){var n=r.push(rs(r)+"scale(",null,",",null,")");i.push({i:n-4,x:tY(e[0],t[0])},{i:n-2,x:tY(e[1],t[1])})}else(1!==t[0]||1!==t[1])&&r.push(rs(r)+"scale("+t+")")}(t.scale,r.scale,s,l),t=r=null,function(e){for(var t,r=-1,i=l.length;++r0?i=e:(t.c=null,t.t=0/0,t=null,l.end({type:"end",alpha:i=0})):e>0&&(l.start({type:"start",alpha:i=e}),t=ti(s.tick)),s):i},s.start=function(){var e,t,r,i=y.length,l=v.length,c=u[0],p=u[1];for(e=0;e=0;)n.push(i[r])}function r_(e,t){for(var r=[e],i=[];null!=(e=r.pop());)if(i.push(e),(a=e.children)&&(n=a.length))for(var n,a,o=-1;++o=0;)u.push(s=o[a]),s.parent=l,s.depth=l.depth+1;r&&(l.value=0),l.children=o}else r&&(l.value=+r.call(i,l,l.depth)||0),delete l.children;return r_(n,function(t){var i,n;e&&(i=t.children)&&i.sort(e),r&&(n=t.parent)&&(n.value+=t.value)}),c}return i.sort=function(t){return arguments.length?(e=t,i):e},i.children=function(e){return arguments.length?(t=e,i):t},i.value=function(e){return arguments.length?(r=e,i):r},i.revalue=function(e){return r&&(rb(e,function(e){e.children&&(e.value=0)}),r_(e,function(e){var t;e.children||(e.value=+r.call(i,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)})),e},i},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function i(e,i){var n=t.call(this,e,i);return function e(t,r,i,n){var a=t.children;if(t.x=r,t.y=t.depth*n,t.dx=i,t.dy=n,a&&(o=a.length)){var o,s,l,u=-1;for(i=t.value?i/t.value:0;++us&&(s=i),o.push(i)}for(r=0;rn&&(i=r,n=t);return i}function rF(e){return e.reduce(rO,0)}function rO(e,t){return e+t[1]}function rR(e,t){return rB(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function rB(e,t){for(var r=-1,i=+e[0],n=(e[1]-i)/t,a=[];++r<=t;)a[r]=n*r+i;return a}function rj(t){return[e.min(t),e.max(t)]}function rN(e,t){return e.value-t.value}function rV(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function rU(e,t){e._pack_next=t,t._pack_prev=e}function rq(e,t){var r=t.x-e.x,i=t.y-e.y,n=e.r+t.r;return .999*n*n>r*r+i*i}function rG(e){if((t=e.children)&&(l=t.length)){var t,r,i,n,a,o,s,l,u=1/0,c=-1/0,h=1/0,d=-1/0;if(t.forEach(rH),(r=t[0]).x=-r.r,r.y=0,x(r),l>1&&((i=t[1]).x=i.r,i.y=0,x(i),l>2))for(rW(r,i,n=t[2]),x(n),rV(r,n),r._pack_prev=n,rV(n,i),i=r._pack_next,a=3;a0)for(o=-1;++o=h[0]&&l<=h[1]&&(s=u[e.bisect(d,l,1,p)-1],s.y+=m,s.push(a[o]));return u}return a.value=function(e){return arguments.length?(r=e,a):r},a.range=function(e){return arguments.length?(i=e4(e),a):i},a.bins=function(e){return arguments.length?(n="number"==typeof e?function(t){return rB(t,e)}:e4(e),a):n},a.frequency=function(e){return arguments.length?(t=!!e,a):t},a},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(rN),i=0,n=[1,1];function a(e,a){var o=r.call(this,e,a),s=o[0],l=n[0],u=n[1],c=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,r_(s,function(e){e.r=+c(e.value)}),r_(s,rG),i){var h=i*(t?1:Math.max(2*s.r/l,2*s.r/u))/2;r_(s,function(e){e.r+=h}),r_(s,rG),r_(s,function(e){e.r-=h})}return function e(t,r,i,n){var a=t.children;if(t.x=r+=n*t.x,t.y=i+=n*t.y,t.r*=n,a)for(var o=-1,s=a.length;++of.x&&(f=e),e.depth>p.depth&&(p=e)});var m=r(d,f)/2-d.x,g=i[0]/(f.x+r(f,d)/2+m),y=i[1]/(p.depth||1);rb(c,function(e){e.x=(e.x+m)*g,e.y=e.depth*y})}return u}function o(e){var t=e.children,i=e.parent.children,n=e.i?i[e.i-1]:null;if(t.length){!function(e){for(var t,r=0,i=0,n=e.children,a=n.length;--a>=0;)t=n[a],t.z+=r,t.m+=r,r+=t.s+(i+=t.c)}(e);var a=(t[0].z+t[t.length-1].z)/2;n?(e.z=n.z+r(e._,n._),e.m=e.z-a):e.z=a}else n&&(e.z=n.z+r(e._,n._));e.parent.A=function(e,t,i){if(t){for(var n,a,o,s,l=e,u=e,c=t,h=l.parent.children[0],d=l.m,f=u.m,p=c.m,m=h.m;c=rX(c),l=rZ(l),c&&l;){h=rZ(h),(u=rX(u)).a=e,(s=c.z+p-l.z-d+r(c._,l._))>0&&(function(e,t,r){var i=r/(t.i-e.i);t.c-=i,t.s+=r,e.c+=i,t.z+=r,t.m+=r}((n=c,a=e,o=i,n.a.parent===a.parent?n.a:o),e,s),d+=s,f+=s),p+=c.m,d+=l.m,m+=h.m,f+=u.m}c&&!rX(u)&&(u.t=c,u.m+=p-f),l&&!rZ(h)&&(h.t=l,h.m+=d-m,i=e)}return i}(e,n,e.parent.A||i[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=i[0],e.y=e.depth*i[1]}return a.separation=function(e){return arguments.length?(r=e,a):r},a.size=function(e){return arguments.length?(n=null==(i=e)?l:null,a):n?null:i},a.nodeSize=function(e){return arguments.length?(n=null==(i=e)?null:l,a):n?i:null},rx(a,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=rY,i=[1,1],n=!1;function a(a,o){var s,l=t.call(this,a,o),u=l[0],c=0;r_(u,function(t){var i,n,a=t.children;a&&a.length?(t.x=(i=a).reduce(function(e,t){return e+t.x},0)/i.length,n=a,t.y=1+e.max(n,function(e){return e.y})):(t.x=s?c+=r(t,s):0,t.y=0,s=t)});var h=function e(t){var r=t.children;return r&&r.length?e(r[0]):t}(u),d=function e(t){var r,i=t.children;return i&&(r=i.length)?e(i[r-1]):t}(u),f=h.x-r(h,d)/2,p=d.x+r(d,h)/2;return r_(u,n?function(e){e.x=(e.x-u.x)*i[0],e.y=(u.y-e.y)*i[1]}:function(e){e.x=(e.x-f)/(p-f)*i[0],e.y=(1-(u.y?e.y/u.y:1))*i[1]}),l}return a.separation=function(e){return arguments.length?(r=e,a):r},a.size=function(e){return arguments.length?(n=null==(i=e),a):n?null:i},a.nodeSize=function(e){return arguments.length?(n=null!=(i=e),a):n?i:null},rx(a,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),i=Math.round,n=[1,1],a=null,o=rK,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(e,t){for(var r,i,n=-1,a=e.length;++nr.dy)&&(c=r.dy);++or.dx)&&(c=r.dx);++o0;)d.push(i=f[a-1]),d.area+=i.area,"squarify"!==l||(n=function(e,t){for(var r,i=e.area,n=0,a=1/0,o=-1,s=e.length;++on&&(n=r));return i*=i,t*=t,i?Math.max(t*n*u/i,i/(t*a*u)):1/0}(d,m))<=p?(f.pop(),p=n):(d.area-=d.pop().area,h(d,m,s,!1),m=Math.min(s.dx,s.dy),d.length=d.area=0,p=1/0);d.length&&(h(d,m,s,!0),d.length=d.area=0),r.forEach(e)}})(a),s&&(t=i),i}return d.size=function(e){return arguments.length?(n=e,d):n},d.padding=function(e){var t;return arguments.length?(o=null==(a=e)?rK:"function"==(t=typeof e)?function(t){var r=e.call(d,t,t.depth);return null==r?rK(t):rJ(t,"number"==typeof r?[r,r,r,r]:r)}:("number"===t&&(e=[e,e,e,e]),function(t){return rJ(t,e)}),d):a},d.round=function(e){return arguments.length?(i=e?Math.round:Number,d):i!=Number},d.sticky=function(e){return arguments.length?(s=e,t=null,d):s},d.ratio=function(e){return arguments.length?(u=e,d):u},d.mode=function(e){return arguments.length?(l=e+"",d):l},rx(d,r)},e.random={normal:function(e,t){var r=arguments.length;return r<2&&(t=1),r<1&&(e=0),function(){var r,i,n;do n=(r=2*Math.random()-1)*r+(i=2*Math.random()-1)*i;while(!n||n>1);return e+t*r*Math.sqrt(-2*Math.log(n)/n)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?r4:r1,s=n?rc:ru;return a=e(t,r,s,i),o=e(r,t,s,tJ),l}function l(e){return a(e)}return l.invert=function(e){return o(e)},l.domain=function(e){return arguments.length?(t=e.map(Number),s()):t},l.range=function(e){return arguments.length?(r=e,s()):r},l.rangeRound=function(e){return l.range(e).interpolate(rr)},l.clamp=function(e){return arguments.length?(n=e,s()):n},l.interpolate=function(e){return arguments.length?(i=e,s()):i},l.ticks=function(e){return r9(t,e)},l.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},l.nice=function(e){return r8(t,e),s()},l.copy=function(){return e(t,r,i,n)},s()}([0,1],[0,1],tJ,!1)},e.scale.log=function(){return function e(t,r,i,n){function a(e){return(i?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(r)}function o(e){return i?Math.pow(r,e):-Math.pow(r,-e)}function s(e){return t(a(e))}return s.invert=function(e){return o(t.invert(e))},s.domain=function(e){return arguments.length?(i=e[0]>=0,t.domain((n=e.map(Number)).map(a)),s):n},s.base=function(e){return arguments.length?(r=+e,t.domain(n.map(a)),s):r},s.nice=function(){var e=r2(n.map(a),i?Math:ie);return t.domain(e),n=e.map(o),s},s.ticks=function(){var e=rQ(n),t=[],s=e[0],l=e[1],u=Math.floor(a(s)),c=Math.ceil(a(l)),h=r%1?2:r;if(isFinite(c-u)){if(i){for(;u0;d--)t.push(o(u)*d);for(u=0;t[u]l;c--);t=t.slice(u,c)}return t},s.copy=function(){return e(t.copy(),r,i,n)},r6(s,t)}(e.scale.linear().domain([0,1]),10,!0,[1,10])};var ie={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function it(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}e.scale.pow=function(){return function e(t,r,i){var n=it(r),a=it(1/r);function o(e){return t(n(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(t.domain((i=e.map(Number)).map(n)),o):i},o.ticks=function(e){return r9(i,e)},o.tickFormat=function(e,t){return d3_scale_linearTickFormat(i,e,t)},o.nice=function(e){return o.domain(r8(i,e))},o.exponent=function(e){return arguments.length?(n=it(r=e),a=it(1/r),t.domain(i.map(n)),o):r},o.copy=function(){return e(t.copy(),r,i)},r6(o,t)}(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return function t(r,i){var n,a,o;function s(e){return a[((n.get(e)||("range"===i.t?n.set(e,r.push(e)):0/0))-1)%a.length]}function l(t,i){return e.range(r.length).map(function(e){return t+i*e})}return s.domain=function(e){if(!arguments.length)return r;r=[],n=new b;for(var t,a=-1,o=e.length;++a0?n[e-1]:r[0],eh?0:1;if(u=eT)return l(u,f)+(s?l(s,1-f):"")+"Z";var p,m,g,y,v,x,b,_,w,T,A,M,k=0,S=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=i===il?Math.sqrt(s*s+u*u):+i.apply(this,arguments),f||(S*=-1),u&&(S=eS(g/u*Math.sin(y))),s&&(k=eS(g/s*Math.sin(y)))),u){v=u*Math.cos(c+S),x=u*Math.sin(c+S),b=u*Math.cos(h-S),_=u*Math.sin(h-S);var D=Math.abs(h-c-2*S)<=e_?0:1;if(S&&im(v,x,b,_)===f^D){var C=(c+h)/2;v=u*Math.cos(C),x=u*Math.sin(C),b=_=null}}else v=x=0;if(s){w=s*Math.cos(h-k),T=s*Math.sin(h-k),A=s*Math.cos(c+k),M=s*Math.sin(c+k);var I=Math.abs(c-h+2*k)<=e_?0:1;if(k&&im(w,T,A,M)===1-f^I){var L=(c+h)/2;w=s*Math.cos(L),T=s*Math.sin(L),A=M=null}}else w=T=0;if(d>1e-6&&(p=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function ig(e,t,r,i,n){var a=e[0]-t[0],o=e[1]-t[1],s=(n?i:-i)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=e[0]+l,h=e[1]+u,d=t[0]+l,f=t[1]+u,p=(c+d)/2,m=(h+f)/2,g=d-c,y=f-h,v=g*g+y*y,x=r-i,b=c*f-d*h,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-b*b)),w=(b*y-g*_)/v,T=(-b*g-y*_)/v,A=(b*y+g*_)/v,M=(-b*g+y*_)/v,k=w-p,S=T-m,E=A-p,D=M-m;return k*k+S*S>E*E+D*D&&(w=A,T=M),[[w-l,T-u],[w*r/x,T*r/x]]}function iy(){return!0}function iv(e){var t=ts,r=tl,i=iy,n=ib,a=n.key,o=.7;function s(a){var s,l=[],u=[],c=-1,h=a.length,d=e4(t),f=e4(r);function p(){l.push("M",n(e(u),o))}for(;++c1&&n.push("H",i[0]),n.join("")},"step-before":iw,"step-after":iT,basis:ik,"basis-open":function(e){if(e.length<4)return ib(e);for(var t,r=[],i=-1,n=e.length,a=[0],o=[0];++i<3;)t=e[i],a.push(t[0]),o.push(t[1]);for(r.push(iS(iC,a)+","+iS(iC,o)),--i;++iv(t=iL(e[s],e[s+1]))?o[s]=o[s+1]=0:(n=(r=o[s]/t)*r+(i=o[s+1]/t)*i)>9&&(n=3*t/Math.sqrt(n),o[s]=n*r,o[s+1]=n*i);for(s=-1;++s<=l;)a.push([(n=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])))||0,o[s]*n||0]);return a}(e))}});function ib(e){return e.length>1?e.join("L"):e+"Z"}function i_(e){return e.join("L")+"Z"}function iw(e){for(var t=0,r=e.length,i=e[0],n=[i[0],",",i[1]];++t1){s=t[1],a=e[l],l++,i+="C"+(n[0]+o[0])+","+(n[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;ue_)+",1 "+t}return a.radius=function(e){return arguments.length?(r=e4(e),a):r},a.source=function(t){return arguments.length?(e=e4(t),a):e},a.target=function(e){return arguments.length?(t=e4(e),a):t},a.startAngle=function(e){return arguments.length?(i=e4(e),a):i},a.endAngle=function(e){return arguments.length?(n=e4(e),a):n},a},e.svg.diagonal=function(){var e=iF,t=iO,r=iB;function i(i,n){var a=e.call(this,i,n),o=t.call(this,i,n),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return i.source=function(t){return arguments.length?(e=e4(t),i):e},i.target=function(e){return arguments.length?(t=e4(e),i):t},i.projection=function(e){return arguments.length?(r=e,i):r},i},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=iB,i=t.projection;return t.projection=function(e){var t;return arguments.length?i((t=r=e,function(){var e=t.apply(this,arguments),r=e[0],i=e[1]-eA;return[r*Math.cos(i),r*Math.sin(i)]})):r},t},e.svg.symbol=function(){var e=iN,t=ij;function r(r,i){return(iU.get(e.call(this,r,i))||iV)(t.call(this,r,i))}return r.type=function(t){return arguments.length?(e=e4(t),r):e},r.size=function(e){return arguments.length?(t=e4(e),r):t},r};var iU=e.map({circle:iV,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*iG)),r=t*iG;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/iq),r=t*iq/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/iq),r=t*iq/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=iU.keys();var iq=Math.sqrt(3),iG=Math.tan(30*eM);G.transition=function(e){for(var t,r,i=iY||++iK,n=i0(e),a=[],o=iZ||{time:Date.now(),ease:t8,delay:0,duration:250},s=-1,l=this.length;++s0;)u[--d].call(e,o);if(a>=1)return h.event&&h.event.end.call(e,e.__data__,t),--c.count?delete c[i]:delete e[r],1}h||(o=ti(function(e){var t=h.delay;if(o.t=t+a,t<=e)return d(e-t);o.c=d},0,a=n.time),h=c[i]={tween:new b,time:a,timer:o,delay:n.delay,duration:n.duration,ease:n.ease,index:t},n=null,++c.count)}iX.call=G.call,iX.empty=G.empty,iX.node=G.node,iX.size=G.size,e.transition=function(t,r){return t&&t.transition?iY?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=iX,iX.select=function(e){var t,r,i,n=this.id,a=this.namespace,o=[];e=H(e);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(e){e.select(".extent").attr("y",l[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=e.select(e.event.target),x=i.of(y,arguments),b=e.select(y),_=v.datum(),w=!/^(n|s)$/.test(_)&&n,T=!/^(e|w)$/.test(_)&&a,A=v.classed("extent"),M=ey(y),k=e.mouse(y),S=e.select(o(y)).on("keydown.brush",function(){32==e.event.keyCode&&(A||(h=null,k[0]-=s[1],k[1]-=l[1],A=2),F())}).on("keyup.brush",function(){32==e.event.keyCode&&2==A&&(k[0]+=s[1],k[1]+=l[1],A=0,F())});if(e.event.changedTouches?S.on("touchmove.brush",C).on("touchend.brush",L):S.on("mousemove.brush",C).on("mouseup.brush",L),b.interrupt().selectAll("*").interrupt(),A)k[0]=s[0]-k[0],k[1]=l[0]-k[1];else if(_){var E=+/w$/.test(_),D=+/^n/.test(_);g=[s[1-E]-k[0],l[1-D]-k[1]],k[0]=s[E],k[1]=l[D]}else e.event.altKey&&(h=k.slice());function C(){var t=e.mouse(y),r=!1;g&&(t[0]+=g[0],t[1]+=g[1]),A||(e.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),k[0]=s[+(t[0]0))return o;do o.push(a=new Date(+t)),n(t,i),e(t);while(a=r)for(;e(r),!t(r);)r.setTime(r-1)},function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;n(e,-1),!t(e););else for(;--r>=0;)for(;n(e,1),!t(e););})},a&&(s.count=function(i,n){return t.setTime(+i),r.setTime(+n),e(t),e(r),Math.floor(a(t,r))},s.every=function(e){return isFinite(e=Math.floor(e))&&e>0?e>1?s.filter(o?function(t){return o(t)%e==0}:function(t){return s.count(0,t)%e==0}):s:null}),s}var n=i(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});n.every=function(e){return isFinite(e=Math.floor(e))&&e>0?e>1?i(function(t){t.setTime(Math.floor(t/e)*e)},function(t,r){t.setTime(+t+r*e)},function(t,r){return(r-t)/e}):n:null};var a=n.range,o=i(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()}),s=o.range,l=i(function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},function(e,t){e.setTime(+e+6e4*t)},function(e,t){return(t-e)/6e4},function(e){return e.getMinutes()}),u=l.range,c=i(function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getHours()}),h=c.range,d=i(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5},function(e){return e.getDate()-1}),f=d.range;function p(e){return i(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5})}var m=p(0),g=p(1),y=p(2),v=p(3),x=p(4),b=p(5),_=p(6),w=m.range,T=g.range,A=y.range,M=v.range,k=x.range,S=b.range,E=_.range,D=i(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()}),C=D.range,I=i(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});I.every=function(e){return isFinite(e=Math.floor(e))&&e>0?i(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,r){t.setFullYear(t.getFullYear()+r*e)}):null};var L=I.range,P=i(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+6e4*t)},function(e,t){return(t-e)/6e4},function(e){return e.getUTCMinutes()}),z=P.range,F=i(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getUTCHours()}),O=F.range,R=i(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/864e5},function(e){return e.getUTCDate()-1}),B=R.range;function j(e){return i(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/6048e5})}var N=j(0),V=j(1),U=j(2),q=j(3),G=j(4),H=j(5),$=j(6),W=N.range,Y=V.range,Z=U.range,X=q.range,K=G.range,J=H.range,Q=$.range,ee=i(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()}),et=ee.range,er=i(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});er.every=function(e){return isFinite(e=Math.floor(e))&&e>0?i(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)}):null};var ei=er.range;e.timeDay=d,e.timeDays=f,e.timeFriday=b,e.timeFridays=S,e.timeHour=c,e.timeHours=h,e.timeInterval=i,e.timeMillisecond=n,e.timeMilliseconds=a,e.timeMinute=l,e.timeMinutes=u,e.timeMonday=g,e.timeMondays=T,e.timeMonth=D,e.timeMonths=C,e.timeSaturday=_,e.timeSaturdays=E,e.timeSecond=o,e.timeSeconds=s,e.timeSunday=m,e.timeSundays=w,e.timeThursday=x,e.timeThursdays=k,e.timeTuesday=y,e.timeTuesdays=A,e.timeWednesday=v,e.timeWednesdays=M,e.timeWeek=m,e.timeWeeks=w,e.timeYear=I,e.timeYears=L,e.utcDay=R,e.utcDays=B,e.utcFriday=H,e.utcFridays=J,e.utcHour=F,e.utcHours=O,e.utcMillisecond=n,e.utcMilliseconds=a,e.utcMinute=P,e.utcMinutes=z,e.utcMonday=V,e.utcMondays=Y,e.utcMonth=ee,e.utcMonths=et,e.utcSaturday=$,e.utcSaturdays=Q,e.utcSecond=o,e.utcSeconds=s,e.utcSunday=N,e.utcSundays=W,e.utcThursday=G,e.utcThursdays=K,e.utcTuesday=U,e.utcTuesdays=Z,e.utcWednesday=q,e.utcWednesdays=X,e.utcWeek=N,e.utcWeeks=W,e.utcYear=er,e.utcYears=ei,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof e&&"u">typeof t?e:(r=r||self).d3=r.d3||{})}}),E=m({"node_modules/d3-time-format/dist/d3-time-format.js"(e,t){var r,i;r=e,i=function(e,t){function r(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function i(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function n(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function a(e){var a=e.dateTime,o=e.date,l=e.time,u=e.periods,c=e.days,h=e.shortDays,d=e.months,$=e.shortMonths,ed=f(u),eA=p(u),eM=f(c),ek=p(c),eS=f(h),eE=p(h),eD=f(d),eC=p(d),eI=f($),eL=p($),eP={a:function(e){return h[e.getDay()]},A:function(e){return c[e.getDay()]},b:function(e){return $[e.getMonth()]},B:function(e){return d[e.getMonth()]},c:null,d:F,e:F,f:N,g:K,G:Q,H:O,I:R,j:B,L:j,m:V,M:U,p:function(e){return u[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ew,s:eT,S:q,u:G,U:H,V:W,w:Y,W:Z,x:null,X:null,y:X,Y:J,Z:ee,"%":e_},ez={a:function(e){return h[e.getUTCDay()]},A:function(e){return c[e.getUTCDay()]},b:function(e){return $[e.getUTCMonth()]},B:function(e){return d[e.getUTCMonth()]},c:null,d:et,e:et,f:eo,g:ey,G:ex,H:er,I:ei,j:en,L:ea,m:es,M:el,p:function(e){return u[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ew,s:eT,S:eu,u:ec,U:eh,V:ef,w:ep,W:em,x:null,X:null,y:eg,Y:ev,Z:eb,"%":e_},eF={a:function(e,t,r){var i=eS.exec(t.slice(r));return i?(e.w=eE[i[0].toLowerCase()],r+i[0].length):-1},A:function(e,t,r){var i=eM.exec(t.slice(r));return i?(e.w=ek[i[0].toLowerCase()],r+i[0].length):-1},b:function(e,t,r){var i=eI.exec(t.slice(r));return i?(e.m=eL[i[0].toLowerCase()],r+i[0].length):-1},B:function(e,t,r){var i=eD.exec(t.slice(r));return i?(e.m=eC[i[0].toLowerCase()],r+i[0].length):-1},c:function(e,t,r){return eB(e,a,t,r)},d:M,e:M,f:I,g:_,G:b,H:S,I:S,j:k,L:C,m:A,M:E,p:function(e,t,r){var i=ed.exec(t.slice(r));return i?(e.p=eA[i[0].toLowerCase()],r+i[0].length):-1},q:T,Q:P,s:z,S:D,u:g,U:y,V:v,w:m,W:x,x:function(e,t,r){return eB(e,o,t,r)},X:function(e,t,r){return eB(e,l,t,r)},y:_,Y:b,Z:w,"%":L};function eO(e,t){return function(r){var i,n,a,o=[],l=-1,u=0,c=e.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in u||(u.w=1),"Z"in u?(s=(l=(s=i(n(u.y,0,1))).getUTCDay())>4||0===l?t.utcMonday.ceil(s):t.utcMonday(s),s=t.utcDay.offset(s,(u.V-1)*7),u.y=s.getUTCFullYear(),u.m=s.getUTCMonth(),u.d=s.getUTCDate()+(u.w+6)%7):(s=(l=(s=r(n(u.y,0,1))).getDay())>4||0===l?t.timeMonday.ceil(s):t.timeMonday(s),s=t.timeDay.offset(s,(u.V-1)*7),u.y=s.getFullYear(),u.m=s.getMonth(),u.d=s.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:+("W"in u)),l="Z"in u?i(n(u.y,0,1)).getUTCDay():r(n(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(l+5)%7:u.w+7*u.U-(l+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,i(u)):r(u)}}function eB(e,t,r,i){for(var n,a,o=0,l=t.length,u=r.length;o=u)return -1;if(37===(n=t.charCodeAt(o++))){if(!(a=eF[(n=t.charAt(o++))in s?t.charAt(o++):n])||(i=a(e,r,i))<0)return -1}else if(n!=r.charCodeAt(i++))return -1}return i}return eP.x=eO(o,eP),eP.X=eO(l,eP),eP.c=eO(a,eP),ez.x=eO(o,ez),ez.X=eO(l,ez),ez.c=eO(a,ez),{format:function(e){var t=eO(e+="",eP);return t.toString=function(){return e},t},parse:function(e){var t=eR(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=eO(e+="",ez);return t.toString=function(){return e},t},utcParse:function(e){var t=eR(e+="",!0);return t.toString=function(){return e},t}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,u=/^%/,c=/[\\^$*+?|[\]().{}]/g;function h(e,t,r){var i=e<0?"-":"",n=(i?-e:e)+"",a=n.length;return i+(a68?1900:2e3),r+i[0].length):-1}function w(e,t,r){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),r+i[0].length):-1}function T(e,t,r){var i=l.exec(t.slice(r,r+1));return i?(e.q=3*i[0]-3,r+i[0].length):-1}function A(e,t,r){var i=l.exec(t.slice(r,r+2));return i?(e.m=i[0]-1,r+i[0].length):-1}function M(e,t,r){var i=l.exec(t.slice(r,r+2));return i?(e.d=+i[0],r+i[0].length):-1}function k(e,t,r){var i=l.exec(t.slice(r,r+3));return i?(e.m=0,e.d=+i[0],r+i[0].length):-1}function S(e,t,r){var i=l.exec(t.slice(r,r+2));return i?(e.H=+i[0],r+i[0].length):-1}function E(e,t,r){var i=l.exec(t.slice(r,r+2));return i?(e.M=+i[0],r+i[0].length):-1}function D(e,t,r){var i=l.exec(t.slice(r,r+2));return i?(e.S=+i[0],r+i[0].length):-1}function C(e,t,r){var i=l.exec(t.slice(r,r+3));return i?(e.L=+i[0],r+i[0].length):-1}function I(e,t,r){var i=l.exec(t.slice(r,r+6));return i?(e.L=Math.floor(i[0]/1e3),r+i[0].length):-1}function L(e,t,r){var i=u.exec(t.slice(r,r+1));return i?r+i[0].length:-1}function P(e,t,r){var i=l.exec(t.slice(r));return i?(e.Q=+i[0],r+i[0].length):-1}function z(e,t,r){var i=l.exec(t.slice(r));return i?(e.s=+i[0],r+i[0].length):-1}function F(e,t){return h(e.getDate(),t,2)}function O(e,t){return h(e.getHours(),t,2)}function R(e,t){return h(e.getHours()%12||12,t,2)}function B(e,r){return h(1+t.timeDay.count(t.timeYear(e),e),r,3)}function j(e,t){return h(e.getMilliseconds(),t,3)}function N(e,t){return j(e,t)+"000"}function V(e,t){return h(e.getMonth()+1,t,2)}function U(e,t){return h(e.getMinutes(),t,2)}function q(e,t){return h(e.getSeconds(),t,2)}function G(e){var t=e.getDay();return 0===t?7:t}function H(e,r){return h(t.timeSunday.count(t.timeYear(e)-1,e),r,2)}function $(e){var r=e.getDay();return r>=4||0===r?t.timeThursday(e):t.timeThursday.ceil(e)}function W(e,r){return e=$(e),h(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),r,2)}function Y(e){return e.getDay()}function Z(e,r){return h(t.timeMonday.count(t.timeYear(e)-1,e),r,2)}function X(e,t){return h(e.getFullYear()%100,t,2)}function K(e,t){return h((e=$(e)).getFullYear()%100,t,2)}function J(e,t){return h(e.getFullYear()%1e4,t,4)}function Q(e,r){var i=e.getDay();return h((e=i>=4||0===i?t.timeThursday(e):t.timeThursday.ceil(e)).getFullYear()%1e4,r,4)}function ee(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+h(t/60|0,"0",2)+h(t%60,"0",2)}function et(e,t){return h(e.getUTCDate(),t,2)}function er(e,t){return h(e.getUTCHours(),t,2)}function ei(e,t){return h(e.getUTCHours()%12||12,t,2)}function en(e,r){return h(1+t.utcDay.count(t.utcYear(e),e),r,3)}function ea(e,t){return h(e.getUTCMilliseconds(),t,3)}function eo(e,t){return ea(e,t)+"000"}function es(e,t){return h(e.getUTCMonth()+1,t,2)}function el(e,t){return h(e.getUTCMinutes(),t,2)}function eu(e,t){return h(e.getUTCSeconds(),t,2)}function ec(e){var t=e.getUTCDay();return 0===t?7:t}function eh(e,r){return h(t.utcSunday.count(t.utcYear(e)-1,e),r,2)}function ed(e){var r=e.getUTCDay();return r>=4||0===r?t.utcThursday(e):t.utcThursday.ceil(e)}function ef(e,r){return e=ed(e),h(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),r,2)}function ep(e){return e.getUTCDay()}function em(e,r){return h(t.utcMonday.count(t.utcYear(e)-1,e),r,2)}function eg(e,t){return h(e.getUTCFullYear()%100,t,2)}function ey(e,t){return h((e=ed(e)).getUTCFullYear()%100,t,2)}function ev(e,t){return h(e.getUTCFullYear()%1e4,t,4)}function ex(e,r){var i=e.getUTCDay();return h((e=i>=4||0===i?t.utcThursday(e):t.utcThursday.ceil(e)).getUTCFullYear()%1e4,r,4)}function eb(){return"+0000"}function e_(){return"%"}function ew(e){return+e}function eT(e){return Math.floor(e/1e3)}function eA(t){return e.timeFormat=(o=a(t)).format,e.timeParse=o.parse,e.utcFormat=o.utcFormat,e.utcParse=o.utcParse,o}eA({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var eM="%Y-%m-%dT%H:%M:%S.%LZ",ek=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat(eM),eS=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse(eM);e.isoFormat=ek,e.isoParse=eS,e.timeFormatDefaultLocale=eA,e.timeFormatLocale=a,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&"u">typeof t?i(e,k()):i((r=r||self).d3=r.d3||{},r.d3)}}),D=m({"node_modules/d3-format/dist/d3-format.js"(e,t){var r;r=e,function(e){function t(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,i=e.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+e.slice(r+1)]}function r(e){return(e=t(Math.abs(e)))?e[1]:0/0}var i,n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(e){var t;if(!(t=a.exec(e)))throw Error("invalid format: "+e);return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function s(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function l(e,r){var i=t(e,r);if(!i)return e+"";var n=i[0],a=i[1];return a<0?"0."+Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+Array(a-n.length+2).join("0")}o.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var u={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return l(100*e,t)},r:l,s:function(e,r){var n=t(e,r);if(!n)return e+"";var a=n[0],o=n[1],s=o-(i=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+Array(1-s).join("0")+t(e,Math.max(0,r+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var h=Array.prototype.map,d=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function f(e){var t,n,a,s=void 0===e.grouping||void 0===e.thousands?c:(t=h.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(n)}),l=void 0===e.currency?"":e.currency[0]+"",f=void 0===e.currency?"":e.currency[1]+"",p=void 0===e.decimal?".":e.decimal+"",m=void 0===e.numerals?c:(a=h.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return a[+e]})}),g=void 0===e.percent?"%":e.percent+"",y=void 0===e.minus?"-":e.minus+"",v=void 0===e.nan?"NaN":e.nan+"";function x(e){var t=(e=o(e)).fill,r=e.align,n=e.sign,a=e.symbol,c=e.zero,h=e.width,x=e.comma,b=e.precision,_=e.trim,w=e.type;"n"===w?(x=!0,w="g"):u[w]||(void 0===b&&(b=12),_=!0,w="g"),(c||"0"===t&&"="===r)&&(c=!0,t="0",r="=");var T="$"===a?l:"#"===a&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",A="$"===a?f:/[%p]/.test(w)?g:"",M=u[w],k=/[defgprs%]/.test(w);function S(e){var a,o,l,u=T,f=A;if("c"===w)f=M(e)+f,e="";else{var g=(e*=1)<0||1/e<0;if(e=isNaN(e)?v:M(Math.abs(e),b),_&&(e=function(e){e:for(var t,r=e.length,i=1,n=-1;i0&&(n=0)}return n>0?e.slice(0,n)+e.slice(t+1):e}(e)),g&&0==+e&&"+"!==n&&(g=!1),u=(g?"("===n?n:y:"-"===n||"("===n?"":n)+u,f=("s"===w?d[8+i/3]:"")+f+(g&&"("===n?")":""),k){for(a=-1,o=e.length;++a(l=e.charCodeAt(a))||l>57){f=(46===l?p+e.slice(a+1):e.slice(a))+f,e=e.slice(0,a);break}}}x&&!c&&(e=s(e,1/0));var S=u.length+e.length+f.length,E=S>1)+u+e+f+E.slice(S);break;default:e=E+u+e+f}return m(e)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),S.toString=function(){return e+""},S}return{format:x,formatPrefix:function(e,t){var i=x(((e=o(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(r(t)/3))),a=Math.pow(10,-n),s=d[8+n/3];return function(e){return i(a*e)+s}}}}function p(t){return e.format=(n=f(t)).format,e.formatPrefix=n.formatPrefix,n}p({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),e.FormatSpecifier=s,e.formatDefaultLocale=p,e.formatLocale=f,e.formatSpecifier=o,e.precisionFixed=function(e){return Math.max(0,-r(Math.abs(e)))},e.precisionPrefix=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(t)/3)))-r(Math.abs(e)))},e.precisionRound=function(e,t){return Math.max(0,r(t=Math.abs(t)-(e=Math.abs(e)))-r(e))+1},Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof e&&"u">typeof t?e:(r="u">typeof globalThis?globalThis:r||self).d3=r.d3||{})}}),C=m({"node_modules/is-string-blank/index.js"(e,t){t.exports=function(e){for(var t,r=e.length,i=0;i13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}}}),I=m({"node_modules/fast-isnumeric/index.js"(e,t){var r=C();t.exports=function(e){var t=typeof e;if("string"===t){var i=e;if(0==(e*=1)&&r(i))return!1}else if("number"!==t)return!1;return e-e<1}}}),L=m({"src/constants/numerical.js"(e,t){t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}}),P=m({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(e,t){var r;r=e,function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),i=0;i>4,h[u++]=(15&n)<<4|a>>2,h[u++]=(3&a)<<6|63&o;return c},e.encode=function(e){var r,i=new Uint8Array(e),n=i.length,a="";for(r=0;r>2],a+=t[(3&i[r])<<4|i[r+1]>>4],a+=t[(15&i[r+1])<<2|i[r+2]>>6],a+=t[63&i[r+2]];return n%3==2?a=a.substring(0,a.length-1)+"=":n%3==1&&(a=a.substring(0,a.length-2)+"=="),a},Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof e&&"u">typeof t?e:(r="u">typeof globalThis?globalThis:r||self)["base64-arraybuffer"]={})}}),z=m({"src/lib/is_plain_object.js"(e,t){t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}}}),F=m({"src/lib/array.js"(e){var t=P().decode,r=z(),i=Array.isArray,n=ArrayBuffer,a=DataView;function o(e){return n.isView(e)&&!(e instanceof a)}function s(e){return i(e)||o(e)}e.isTypedArray=o,e.isArrayOrTypedArray=s,e.isArray1D=function(e){return!s(e[0])},e.ensureArray=function(e,t){return i(e)||(e=[]),e.length=t,e};var l={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};function u(e){return e.constructor===ArrayBuffer}function c(e,t,r){if(s(e))if(!s(e[0]))return e.length;else{for(var i=r,n=0;n2)return u[t]=2|u[t],d.set(e,null);if(h){for(o=t;o0)return Math.log(e)/Math.LN10;var i=Math.log(Math.min(t[0],t[1]))/Math.LN10;return r(i)||(i=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),i}}}),N=m({"src/lib/relink_private.js"(e,t){var r=F().isArrayOrTypedArray,i=z();t.exports=function e(t,n){for(var a in n){var o=n[a],s=t[a];if(s!==o)if("_"===a.charAt(0)||"function"==typeof o){if(a in t)continue;t[a]=o}else if(r(o)&&r(s)&&i(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),u=0;ut/2?e-Math.round(e/t)*t:e}g(V,{mod:()=>U,modHalf:()=>q});var G=p({"src/lib/mod.ts"(){}}),H=m({"src/lib/extend.js"(e){var t=z(),r=Array.isArray;function i(e,n,a,o){var s,l,u,c,h,d,f=e[0],p=e.length;if(2===p&&r(f)&&r(e[1])&&0===f.length){if(function(e,t){var r,i;for(r=0;rtypeof c||a)&&(f[l]=c);return f}e.extendFlat=function(...e){return i(e,!1,!1,!1)},e.extendDeep=function(...e){return i(e,!0,!1,!1)},e.extendDeepAll=function(...e){return i(e,!0,!0,!1)},e.extendDeepNoArrays=function(...e){return i(e,!0,!1,!0)}}}),$=m({"src/plots/font_attributes.js"(e,t){t.exports=function(e){var t=e.variantValues,r=e.editType,i=e.colorEditType;void 0===i&&(i=r);var n={editType:r,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};e.noNumericWeightValues&&(n.valType="enumerated",n.values=n.extras,n.extras=void 0,n.min=void 0,n.max=void 0);var a={family:{valType:"string",noBlank:!0,strict:!0,editType:r},size:{valType:"number",min:1,editType:r},color:{valType:"color",editType:i},weight:n,style:{editType:r,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:e.noFontVariant?void 0:{editType:r,valType:"enumerated",values:t||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:e.noFontTextcase?void 0:{editType:r,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:e.noFontLineposition?void 0:{editType:r,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:e.noFontShadow?void 0:{editType:r,valType:"string",dflt:e.autoShadowDflt?"auto":"none"},editType:r};return e.autoSize&&(a.size.dflt="auto"),e.autoColor&&(a.color.dflt="auto"),e.arrayOk&&(a.family.arrayOk=!0,a.weight.arrayOk=!0,a.style.arrayOk=!0,e.noFontVariant||(a.variant.arrayOk=!0),e.noFontTextcase||(a.textcase.arrayOk=!0),e.noFontLineposition||(a.lineposition.arrayOk=!0),e.noFontShadow||(a.shadow.arrayOk=!0),a.size.arrayOk=!0,a.color.arrayOk=!0),a}}}),W=m({"src/components/fx/constants.js"(e,t){t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}}),Y=m({"src/components/fx/layout_attributes.js"(e,t){var r=W(),i=$(),n=i({editType:"none"});n.family.dflt=r.HOVERFONT,n.size.dflt=r.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversort:{valType:"enumerated",values:["trace","value descending","value ascending"],dflt:"trace",editType:"none"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoveranywhere:{valType:"boolean",dflt:!1,editType:"none"},clickanywhere:{valType:"boolean",dflt:!1,editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:n,grouptitlefont:i({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}}),Z=m({"src/components/fx/attributes.js"(e,t){var r=$(),i=Y().hoverlabel,n=H().extendFlat;t.exports={hoverlabel:{bgcolor:n({},i.bgcolor,{arrayOk:!0}),bordercolor:n({},i.bordercolor,{arrayOk:!0}),font:r({arrayOk:!0,editType:"none"}),align:n({},i.align,{arrayOk:!0}),namelength:n({},i.namelength,{arrayOk:!0}),showarrow:n({},i.showarrow),editType:"none"}}}}),X=m({"src/plots/attributes.js"(e,t){var r=$(),i=Z();t.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:r({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:i.hoverlabel,uirevision:{valType:"any",editType:"none"}}}}),K=m({"node_modules/culori/bundled/culori.cjs"(e,t){let r,i,n;var a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,u={};((e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0})})(u,{a98:()=>nt,average:()=>eH,averageAngle:()=>eq,averageNumber:()=>eG,blend:()=>it,blerp:()=>en,clampChroma:()=>ij,clampGamut:()=>iB,clampRgb:()=>iR,colorsNamed:()=>h,convertA98ToXyz65:()=>eh,convertCubehelixToRgb:()=>eI,convertDlchToLab65:()=>e9,convertHsiToRgb:()=>ta,convertHslToRgb:()=>tl,convertHsvToRgb:()=>tp,convertHwbToRgb:()=>ty,convertItpToXyz65:()=>tA,convertJabToJch:()=>tO,convertJabToRgb:()=>tz,convertJabToXyz65:()=>tL,convertJchToJab:()=>tR,convertLab65ToDlch:()=>te,convertLab65ToRgb:()=>e1,convertLab65ToXyz65:()=>e0,convertLabToLch:()=>eW,convertLabToRgb:()=>tG,convertLabToXyz50:()=>tU,convertLchToLab:()=>eY,convertLchuvToLuv:()=>t2,convertLrgbToOklab:()=>rn,convertLrgbToRgb:()=>ev,convertLuvToLchuv:()=>t1,convertLuvToXyz50:()=>re,convertOkhslToOklab:()=>rp,convertOkhsvToOklab:()=>ry,convertOklabToLrgb:()=>ro,convertOklabToOkhsl:()=>rf,convertOklabToOkhsv:()=>rg,convertOklabToRgb:()=>rs,convertP3ToXyz65:()=>rT,convertProphotoToXyz50:()=>rD,convertRec2020ToXyz65:()=>rz,convertRgbToCubehelix:()=>eC,convertRgbToHsi:()=>to,convertRgbToHsl:()=>tu,convertRgbToHsv:()=>tm,convertRgbToHwb:()=>tv,convertRgbToJab:()=>tP,convertRgbToLab:()=>tY,convertRgbToLab65:()=>e5,convertRgbToLrgb:()=>em,convertRgbToOklab:()=>ra,convertRgbToXyb:()=>rB,convertRgbToXyz50:()=>tH,convertRgbToXyz65:()=>eg,convertRgbToYiq:()=>r$,convertXybToRgb:()=>rN,convertXyz50ToLab:()=>tW,convertXyz50ToLuv:()=>t8,convertXyz50ToProphoto:()=>rS,convertXyz50ToRgb:()=>tq,convertXyz50ToXyz65:()=>rG,convertXyz65ToA98:()=>ef,convertXyz65ToItp:()=>tk,convertXyz65ToJab:()=>tC,convertXyz65ToLab65:()=>e3,convertXyz65ToP3:()=>rA,convertXyz65ToRec2020:()=>rL,convertXyz65ToRgb:()=>ex,convertXyz65ToXyz50:()=>rq,convertYiqToRgb:()=>rW,converter:()=>S,cubehelix:()=>nr,differenceCie76:()=>eO,differenceCie94:()=>eR,differenceCiede2000:()=>eB,differenceCmc:()=>ej,differenceEuclidean:()=>eF,differenceHueChroma:()=>ez,differenceHueNaive:()=>eP,differenceHueSaturation:()=>eL,differenceHyab:()=>eN,differenceItp:()=>eU,differenceKotsarenkoRamos:()=>eV,displayable:()=>iF,dlab:()=>ni,dlch:()=>nn,easingGamma:()=>iD,easingInOutSine:()=>i7,easingMidpoint:()=>iu,easingSmootherstep:()=>i8,easingSmoothstep:()=>i4,easingSmoothstepInverse:()=>i6,filterBrightness:()=>iG,filterContrast:()=>iH,filterDeficiencyDeuter:()=>i3,filterDeficiencyProt:()=>i2,filterDeficiencyTrit:()=>i5,filterGrayscale:()=>iY,filterHueRotate:()=>iX,filterInvert:()=>iZ,filterSaturate:()=>iW,filterSepia:()=>i$,fixupAlpha:()=>el,fixupHueDecreasing:()=>ek,fixupHueIncreasing:()=>eM,fixupHueLonger:()=>eA,fixupHueShorter:()=>eT,formatCss:()=>r4,formatHex:()=>r6,formatHex8:()=>r8,formatHsl:()=>r9,formatRgb:()=>r7,getMode:()=>z,hsi:()=>na,hsl:()=>no,hsv:()=>ns,hwb:()=>nl,inGamut:()=>iO,interpolate:()=>ih,interpolateWith:()=>id,interpolateWithPremultipliedAlpha:()=>ip,interpolatorLinear:()=>es,interpolatorPiecewise:()=>eo,interpolatorSplineBasis:()=>ig,interpolatorSplineBasisClosed:()=>iy,interpolatorSplineMonotone:()=>ik,interpolatorSplineMonotone2:()=>iS,interpolatorSplineMonotoneClosed:()=>iE,interpolatorSplineNatural:()=>ix,interpolatorSplineNaturalClosed:()=>ib,itp:()=>nu,jab:()=>nc,jch:()=>nh,lab:()=>nd,lab65:()=>nf,lch:()=>np,lch65:()=>nm,lchuv:()=>ng,lerp:()=>er,lrgb:()=>ny,luv:()=>nv,mapAlphaDivide:()=>io,mapAlphaMultiply:()=>ia,mapTransferGamma:()=>il,mapTransferLinear:()=>is,mapper:()=>ii,modeA98:()=>eb,modeCubehelix:()=>e$,modeDlab:()=>ti,modeDlch:()=>tn,modeHsi:()=>ts,modeHsl:()=>tf,modeHsv:()=>tg,modeHwb:()=>tb,modeItp:()=>tS,modeJab:()=>tF,modeJch:()=>tB,modeLab:()=>tX,modeLab65:()=>tK,modeLch:()=>tQ,modeLch65:()=>t0,modeLchuv:()=>rt,modeLrgb:()=>rr,modeLuv:()=>ri,modeOkhsl:()=>rm,modeOkhsv:()=>rv,modeOklab:()=>rb,modeOklch:()=>rw,modeP3:()=>rM,modeProphoto:()=>rC,modeRec2020:()=>rF,modeRgb:()=>eu,modeXyb:()=>rV,modeXyz50:()=>rU,modeXyz65:()=>rH,modeYiq:()=>rY,nearest:()=>iV,okhsl:()=>nx,okhsv:()=>nb,oklab:()=>n_,oklch:()=>nw,p3:()=>nT,parse:()=>Q,parseHex:()=>g,parseHsl:()=>td,parseHslLegacy:()=>th,parseHwb:()=>tx,parseLab:()=>tZ,parseLch:()=>tJ,parseNamed:()=>p,parseOklab:()=>rx,parseOklch:()=>r_,parseRgb:()=>ee,parseRgbLegacy:()=>M,parseTransparent:()=>et,prophoto:()=>nA,random:()=>ir,rec2020:()=>nM,removeParser:()=>O,rgb:()=>nk,round:()=>rZ,samples:()=>iC,serializeHex:()=>r1,serializeHex8:()=>r2,serializeHsl:()=>r5,serializeRgb:()=>r3,toGamut:()=>iN,trilerp:()=>ea,unlerp:()=>ei,useMode:()=>P,useParser:()=>F,wcagContrast:()=>ne,wcagLuminance:()=>i9,xyb:()=>nS,xyz50:()=>nE,xyz65:()=>nD,yiq:()=>nC}),t.exports=((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of s(t))l.call(e,i)||void 0===i||a(e,i,{get:()=>t[i],enumerable:!(r=o(t,i))||r.enumerable});return e})(a({},"__esModule",{value:!0}),u);var c=(e,t)=>{if("number"==typeof e){if(3===t)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|240&e)/255,b:(15&e|e<<4&240)/255};if(4===t)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|240&e)/255,alpha:(15&e|e<<4&240)/255};if(6===t)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255};if(8===t)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(255&e)/255}}},h={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},p=e=>c(h[e.toLowerCase()],6),m=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,g=e=>{let t;return(t=e.match(m))?c(parseInt(t[1],16),t[1].length):void 0},y="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",v=`${y}%`,x=`(?:${y}%|${y})`,b=`(?:${y}%|${y}|none)`,_=`(?:${y}(deg|grad|rad|turn)|${y})`,w="\\s*,\\s*",T=(RegExp("^"+b+"$"),RegExp(`^rgba?\\(\\s*${y}${w}${y}${w}${y}\\s*(?:,\\s*${x}\\s*)?\\)$`)),A=RegExp(`^rgba?\\(\\s*${v}${w}${v}${w}${v}\\s*(?:,\\s*${x}\\s*)?\\)$`),M=e=>{let t={mode:"rgb"},r;if(r=e.match(T))void 0!==r[1]&&(t.r=r[1]/255),void 0!==r[2]&&(t.g=r[2]/255),void 0!==r[3]&&(t.b=r[3]/255);else{if(!(r=e.match(A)))return;void 0!==r[1]&&(t.r=r[1]/100),void 0!==r[2]&&(t.g=r[2]/100),void 0!==r[3]&&(t.b=r[3]/100)}return void 0!==r[4]?t.alpha=Math.max(0,Math.min(1,r[4]/100)):void 0!==r[5]&&(t.alpha=Math.max(0,Math.min(1,+r[5]))),t},k=(e,t)=>void 0===e?void 0:"object"!=typeof e?Q(e):void 0!==e.mode?e:t?f(d({},e),{mode:t}):void 0,S=(e="rgb")=>t=>void 0!==(t=k(t,e))?t.mode===e?t:E[t.mode][e]?E[t.mode][e](t):"rgb"===e?E[t.mode].rgb(t):E.rgb[e](E[t.mode].rgb(t)):void 0,E={},D={},C=[],I={},L=e=>e,P=e=>(E[e.mode]=d(d({},E[e.mode]),e.toMode),Object.keys(e.fromMode||{}).forEach(t=>{E[t]||(E[t]={}),E[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(void 0===e.ranges[t]&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw Error(`Missing interpolator for: ${t}`);"function"==typeof e.interpolate[t]&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=L)}),D[e.mode]=e,(e.parse||[]).forEach(t=>{F(t,e.mode)}),S(e.mode)),z=e=>D[e],F=(e,t)=>{if("string"==typeof e){if(!t)throw Error("'mode' required when 'parser' is a string");I[e]=t}else"function"==typeof e&&0>C.indexOf(e)&&C.push(e)},O=e=>{if("string"==typeof e)delete I[e];else if("function"==typeof e){let t=C.indexOf(e);t>0&&C.splice(t,1)}},R=/[^\x00-\x7F]|[a-zA-Z_]/,B=/[^\x00-\x7F]|[-\w]/,j="function",N="ident",V="number",U="percentage",q="none",G="alpha",H=0;function $(e){let t=e[H],r=e[H+1];return"-"===t||"+"===t?/\d/.test(r)||"."===r&&/\d/.test(e[H+2]):"."===t?/\d/.test(r):/\d/.test(t)}function W(e){if(H>=e.length)return!1;let t=e[H];if(R.test(t))return!0;if("-"===t){if(e.length-H<2)return!1;let t=e[H+1];return!!("-"===t||R.test(t))}return!1}var Y={deg:1,rad:180/Math.PI,grad:.9,turn:360};function Z(e){let t="";if(("-"===e[H]||"+"===e[H])&&(t+=e[H++]),t+=X(e),"."===e[H]&&/\d/.test(e[H+1])&&(t+=e[H++]+X(e)),("e"===e[H]||"E"===e[H])&&(("-"===e[H+1]||"+"===e[H+1])&&/\d/.test(e[H+2])?t+=e[H++]+e[H++]+X(e):/\d/.test(e[H+1])&&(t+=e[H++]+X(e))),W(e)){let r=K(e);return"deg"===r||"rad"===r||"turn"===r||"grad"===r?{type:"hue",value:t*Y[r]}:void 0}return"%"===e[H]?(H++,{type:U,value:+t}):{type:V,value:+t}}function X(e){let t="";for(;/\d/.test(e[H]);)t+=e[H++];return t}function K(e){let t="";for(;H4)){if(4===r.length){if(r[3].type!==G)return;r[3]=r[3].value}return 3===r.length&&r.push({type:q,value:void 0}),r.every(e=>e.type!==G)?r:void 0}}var Q=e=>{if("string"!=typeof e)return;let t=function(e=""){let t=e.trim(),r=[],i;for(H=0;H"transparent"===e?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,er=(e,t,r)=>e+r*(t-e),ei=(e,t,r)=>(r-e)/(t-e),en=(e,t,r,i,n,a)=>er(er(e,t,n),er(r,i,n),a),ea=(e,t,r,i,n,a,o,s,l,u,c)=>er(en(e,t,r,i,l,u),en(n,a,o,s,l,u),c),eo=e=>t=>{let r=(e=>{let t=[];for(let r=0;r{let i=t*r.length,n=t>=1?r.length-1:Math.max(Math.floor(i),0),a=r[n];return void 0===a?void 0:e(a[0],a[1],i-n)}},es=eo(er),el=e=>{let t=!1,r=e.map(e=>void 0!==e?(t=!0,e):1);return t?r:e},eu={mode:"rgb",channels:["r","g","b","alpha"],parse:[ee,g,M,p,et,"srgb"],serialize:"srgb",interpolate:{r:es,g:es,b:es,alpha:{use:es,fixup:el}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},ec=(e=0)=>Math.pow(Math.abs(e),563/256)*Math.sign(e),eh=e=>{let t=ec(e.r),r=ec(e.g),i=ec(e.b),n={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*r+.1882286462349947*i,y:.297344975250536*t+.6273635662554661*r+.0752914584939979*i,z:.0270313613864123*t+.0706888525358272*r+.9913375368376386*i};return void 0!==e.alpha&&(n.alpha=e.alpha),n},ed=e=>Math.pow(Math.abs(e),256/563)*Math.sign(e),ef=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"a98",r:ed(2.0415879038107465*e-.5650069742788597*t-.3447313507783297*r),g:ed(-.9692436362808798*e+1.8759675015077206*t+.0415550574071756*r),b:ed(.0134442806320312*e-.1183623922310184*t+1.0151749943912058*r)};return void 0!==i&&(n.alpha=i),n},ep=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},em=({r:e,g:t,b:r,alpha:i})=>{let n={mode:"lrgb",r:ep(e),g:ep(t),b:ep(r)};return void 0!==i&&(n.alpha=i),n},eg=e=>{let{r:t,g:r,b:i,alpha:n}=em(e),a={mode:"xyz65",x:.4123907992659593*t+.357584339383878*r+.1804807884018343*i,y:.2126390058715102*t+.715168678767756*r+.0721923153607337*i,z:.0193308187155918*t+.119194779794626*r+.9505321522496607*i};return void 0!==n&&(a.alpha=n),a},ey=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,1/2.4)-.055):12.92*e},ev=({r:e,g:t,b:r,alpha:i},n="rgb")=>{let a={mode:n,r:ey(e),g:ey(t),b:ey(r)};return void 0!==i&&(a.alpha=i),a},ex=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=ev({r:3.2409699419045226*e-1.537383177570094*t-.4986107602930034*r,g:-.9692436362808796*e+1.8759675015077204*t+.0415550574071756*r,b:.0556300796969936*e-.2039769588889765*t+1.0569715142428784*r});return void 0!==i&&(n.alpha=i),n},eb=f(d({},eu),{mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>ef(eg(e)),xyz65:ef},toMode:{rgb:e=>ex(eh(e)),xyz65:eh}}),e_=e=>(e%=360)<0?e+360:e,ew=(e,t)=>e.map((r,i,n)=>{if(void 0===r)return r;let a=e_(r);return 0===i||void 0===e[i-1]?a:t(a-e_(n[i-1]))}).reduce((e,t)=>(e.length&&void 0!==t&&void 0!==e[e.length-1]?e.push(t+e[e.length-1]):e.push(t),e),[]),eT=e=>ew(e,e=>180>=Math.abs(e)?e:e-360*Math.sign(e)),eA=e=>ew(e,e=>Math.abs(e)>=180||0===e?e:e-360*Math.sign(e)),eM=e=>ew(e,e=>e>=0?e:e+360),ek=e=>ew(e,e=>e<=0?e:e-360),eS=Math.PI/180,eE=180/Math.PI,eD=-1.78277*.29227-.1347134789,eC=({r:e,g:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=(eD*r+-1.7884503806*e-3.5172982438*t)/(eD+-1.7884503806-3.5172982438),a=r-n,o=-((1.97294*(t-n)- -.29227*a)/.90649),s={mode:"cubehelix",l:n,s:0===n||1===n?void 0:Math.sqrt(a*a+o*o)/(1.97294*n*(1-n))};return s.s&&(s.h=Math.atan2(o,a)*eE-120),void 0!==i&&(s.alpha=i),s},eI=({h:e,s:t,l:r,alpha:i})=>{let n={mode:"rgb"};e=(void 0===e?0:e+120)*eS,void 0===r&&(r=0);let a=void 0===t?0:t*r*(1-r),o=Math.cos(e),s=Math.sin(e);return n.r=r+a*(-.14861*o+1.78277*s),n.g=r+a*(-.29227*o+-.90649*s),n.b=r+a*(1.97294*o+0*s),void 0!==i&&(n.alpha=i),n},eL=(e,t)=>{if(void 0===e.h||void 0===t.h||!e.s||!t.s)return 0;let r=e_(e.h),i=Math.sin((e_(t.h)-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*i},eP=(e,t)=>{if(void 0===e.h||void 0===t.h)return 0;let r=e_(e.h),i=e_(t.h);return Math.abs(i-r)>180?r-(i-360*Math.sign(i-r)):i-r},ez=(e,t)=>{if(void 0===e.h||void 0===t.h||!e.c||!t.c)return 0;let r=e_(e.h),i=Math.sin((e_(t.h)-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*i},eF=(e="rgb",t=[1,1,1,0])=>{let r=z(e),i=r.channels,n=r.difference,a=S(e);return(e,r)=>{let o=a(e),s=a(r);return Math.sqrt(i.reduce((e,r,i)=>{let a=n[r]?n[r](o,s):o[r]-s[r];return e+(t[i]||0)*Math.pow(isNaN(a)?0:a,2)},0))}},eO=()=>eF("lab65"),eR=(e=1,t=.045,r=.015)=>{let i=S("lab65");return(n,a)=>{let o=i(n),s=i(a),l=o.l,u=o.a,c=o.b,h=Math.sqrt(u*u+c*c),d=s.l,f=s.a,p=s.b,m=Math.pow(h-Math.sqrt(f*f+p*p),2),g=Math.pow(u-f,2)+Math.pow(c-p,2)-m;return Math.sqrt(Math.pow(l-d,2)/Math.pow(e,2)+m/Math.pow(1+t*h,2)+g/Math.pow(1+r*h,2))}},eB=(e=1,t=1,r=1)=>{let i=S("lab65");return(n,a)=>{let o=i(n),s=i(a),l=o.l,u=o.a,c=o.b,h=Math.sqrt(u*u+c*c),d=s.l,f=s.a,p=s.b,m=(h+Math.sqrt(f*f+p*p))/2,g=.5*(1-Math.sqrt(Math.pow(m,7)/(Math.pow(m,7)+0x16bcc41e9))),y=u*(1+g),v=f*(1+g),x=Math.sqrt(y*y+c*c),b=Math.sqrt(v*v+p*p),_=Math.abs(y)+Math.abs(c)===0?0:Math.atan2(c,y);_+=(_<0)*2*Math.PI;let w=Math.abs(v)+Math.abs(p)===0?0:Math.atan2(p,v);w+=(w<0)*2*Math.PI;let T=b-x,A=x*b==0?0:w-_;A-=(A>Math.PI)*2*Math.PI,A+=(A<-Math.PI)*2*Math.PI;let M=2*Math.sqrt(x*b)*Math.sin(A/2),k=(x+b)/2,S;x*b==0?S=_+w:(S=(_+w)/2-(Math.abs(_-w)>Math.PI)*Math.PI,S+=(S<0)*2*Math.PI);let E=Math.pow((l+d)/2-50,2),D=1-.17*Math.cos(S-Math.PI/6)+.24*Math.cos(2*S)+.32*Math.cos(3*S+Math.PI/30)-.2*Math.cos(4*S-63*Math.PI/180),C=1+.015*E/Math.sqrt(20+E),I=1+.045*k,L=1+.015*k*D,P=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*S-275)/25,2)),z=2*Math.sqrt(Math.pow(k,7)/(Math.pow(k,7)+0x16bcc41e9)),F=-1*Math.sin(2*P)*z;return Math.sqrt(Math.pow((d-l)/(e*C),2)+Math.pow(T/(t*I),2)+Math.pow(M/(r*L),2)+F*T/(t*I)*M/(r*L))}},ej=(e=1,t=1)=>{let r=S("lab65");return(i,n)=>{let a=r(i),o=a.l,s=a.a,l=a.b,u=Math.sqrt(s*s+l*l),c=Math.atan2(l,s);c+=2*Math.PI*(c<0);let h=r(n),d=h.l,f=h.a,p=h.b,m=Math.sqrt(f*f+p*p),g=Math.pow(o-d,2),y=Math.pow(u-m,2),v=Math.pow(s-f,2)+Math.pow(l-p,2)-y,x=Math.sqrt(Math.pow(u,4)/(Math.pow(u,4)+1900)),b=c>=164/180*Math.PI&&c<=345/180*Math.PI?.56+Math.abs(.2*Math.cos(c+168/180*Math.PI)):.36+Math.abs(.4*Math.cos(c+35/180*Math.PI)),_=.0638*u/(1+.0131*u)+.638;return Math.sqrt(g/Math.pow(e*(o<16?.511:.040975*o/(1+.01765*o)),2)+y/Math.pow(t*_,2)+v/Math.pow(_*(x*b+1-x),2))}},eN=()=>{let e=S("lab65");return(t,r)=>{let i=e(t),n=e(r),a=i.l-n.l,o=i.a-n.a,s=i.b-n.b;return Math.abs(a)+Math.sqrt(o*o+s*s)}},eV=()=>eF("yiq",[.5053,.299,.1957]),eU=()=>eF("itp",[518400,129600,518400]),eq=e=>{let t=e.reduce((e,t)=>{if(void 0!==t){let r=t*Math.PI/180;e.sin+=Math.sin(r),e.cos+=Math.cos(r)}return e},{sin:0,cos:0}),r=180*Math.atan2(t.sin,t.cos)/Math.PI;return r<0?360+r:r},eG=e=>{let t=e.filter(e=>void 0!==e);return t.length?t.reduce((e,t)=>e+t,0)/t.length:void 0};function eH(e,t="rgb",r){let i=z(t),n=e.map(S(t));return i.channels.reduce((e,t)=>{let a=n.map(e=>e[t]).filter(e=>void 0!==e);if(a.length){let n;n="function"==typeof r?r:r&&"function"==typeof r[t]?r[t]:i.average&&"function"==typeof i.average[t]?i.average[t]:eG,e[t]=n(a,t)}return e},{mode:t})}var e$={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:eC},toMode:{rgb:eI},interpolate:{h:{use:es,fixup:eT},s:es,l:es,alpha:{use:es,fixup:el}},difference:{h:eL},average:{h:eq}},eW=({l:e,a:t,b:r,alpha:i},n="lch")=>{void 0===t&&(t=0),void 0===r&&(r=0);let a=Math.sqrt(t*t+r*r),o={mode:n,l:e,c:a};return a&&(o.h=e_(180*Math.atan2(r,t)/Math.PI)),void 0!==i&&(o.alpha=i),o},eY=({l:e,c:t,h:r,alpha:i},n="lab")=>{void 0===r&&(r=0);let a={mode:n,l:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return void 0!==i&&(a.alpha=i),a},eZ=24389/27,eX=216/24389,eK={X:.3457/.3585,Y:1,Z:.2958/.3585},eJ={X:.3127/.329,Y:1,Z:.3583/.329},eQ=e=>Math.pow(e,3)>eX?Math.pow(e,3):(116*e-16)/eZ,e0=({l:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=(e+16)/116,a=t/500+n,o=n-r/200,s={mode:"xyz65",x:eQ(a)*eJ.X,y:eQ(n)*eJ.Y,z:eQ(o)*eJ.Z};return void 0!==i&&(s.alpha=i),s},e1=e=>ex(e0(e)),e2=e=>e>eX?Math.cbrt(e):(eZ*e+16)/116,e3=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=e2(e/eJ.X),a=e2(t/eJ.Y),o={mode:"lab65",l:116*a-16,a:500*(n-a),b:200*(a-e2(r/eJ.Z))};return void 0!==i&&(o.alpha=i),o},e5=e=>{let t=e3(eg(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},e4=26/180*Math.PI,e6=Math.cos(e4),e8=Math.sin(e4),e7=100/Math.log(1.39),e9=({l:e,c:t,h:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"lab65",l:(Math.exp(e/e7)-1)/.0039},a=(Math.exp(.0435*t*1)-1)/.075,o=a*Math.cos(r/180*Math.PI-e4),s=a*Math.sin(r/180*Math.PI-e4);return n.a=o*e6-s/.83*e8,n.b=o*e8+s/.83*e6,void 0!==i&&(n.alpha=i),n},te=({l:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=t*e6+r*e8,a=.83*(r*e6-t*e8),o={mode:"dlch",l:e7/1*Math.log(1+.0039*e),c:Math.log(1+.075*Math.sqrt(n*n+a*a))/.0435};return o.c&&(o.h=e_((Math.atan2(a,n)+e4)/Math.PI*180)),void 0!==i&&(o.alpha=i),o},tt=e=>e9(eW(e,"dlch")),tr=e=>eY(te(e),"dlab"),ti={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:tt,rgb:e=>e1(tt(e))},fromMode:{lab65:tr,rgb:e=>tr(e5(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:es,a:es,b:es,alpha:{use:es,fixup:el}}},tn={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:e9,dlab:e=>eY(e,"dlab"),rgb:e=>e1(e9(e))},fromMode:{lab65:te,dlab:e=>eW(e,"dlch"),rgb:e=>te(e5(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:es,c:es,h:{use:es,fixup:eT},alpha:{use:es,fixup:el}},difference:{h:ez},average:{h:eq}};function ta({h:e,s:t,i:r,alpha:i}){e=e_(void 0!==e?e:0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:r*(1+t*(3/(2-n)-1)),g:r*(1+t*(3*(1-n)/(2-n)-1)),b:r*(1-t)};break;case 1:a={r:r*(1+t*(3*(1-n)/(2-n)-1)),g:r*(1+t*(3/(2-n)-1)),b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r*(1+t*(3/(2-n)-1)),b:r*(1+t*(3*(1-n)/(2-n)-1))};break;case 3:a={r:r*(1-t),g:r*(1+t*(3*(1-n)/(2-n)-1)),b:r*(1+t*(3/(2-n)-1))};break;case 4:a={r:r*(1+t*(3*(1-n)/(2-n)-1)),g:r*(1-t),b:r*(1+t*(3/(2-n)-1))};break;case 5:a={r:r*(1+t*(3/(2-n)-1)),g:r*(1-t),b:r*(1+t*(3*(1-n)/(2-n)-1))};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",void 0!==i&&(a.alpha=i),a}function to({r:e,g:t,b:r,alpha:i}){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.max(e,t,r),a=Math.min(e,t,r),o={mode:"hsi",s:e+t+r===0?0:1-3*a/(e+t+r),i:(e+t+r)/3};return n-a!=0&&(o.h=(n===e?(t-r)/(n-a)+(t{let t=e.match(tc);if(!t)return;let r={mode:"hsl"};return void 0!==t[3]?r.h=+t[3]:void 0!==t[1]&&void 0!==t[2]&&(r.h=((e,t)=>{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return 360*e}})(t[1],t[2])),void 0!==t[4]&&(r.s=Math.min(Math.max(0,t[4]/100),1)),void 0!==t[5]&&(r.l=Math.min(Math.max(0,t[5]/100),1)),void 0!==t[6]?r.alpha=Math.max(0,Math.min(1,t[6]/100)):void 0!==t[7]&&(r.alpha=Math.max(0,Math.min(1,+t[7]))),r},td=function(e,t){if(!t||"hsl"!==t[0]&&"hsla"!==t[0])return;let r={mode:"hsl"},[,i,n,a,o]=t;if(i.type!==q){if(i.type===U)return;r.h=i.value}if(n.type!==q){if("hue"===n.type)return;r.s=n.value/100}if(a.type!==q){if("hue"===a.type)return;r.l=a.value/100}return o.type!==q&&(r.alpha=Math.min(1,Math.max(0,o.type===V?o.value:o.value/100))),r},tf={mode:"hsl",toMode:{rgb:tl},fromMode:{rgb:tu},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[td,th],serialize:e=>`hsl(${void 0!==e.h?e.h:"none"} ${void 0!==e.s?100*e.s+"%":"none"} ${void 0!==e.l?100*e.l+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:es,fixup:eT},s:es,l:es,alpha:{use:es,fixup:el}},difference:{h:eL},average:{h:eq}};function tp({h:e,s:t,v:r,alpha:i}){e=e_(void 0!==e?e:0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:r,g:r*(1-t*n),b:r*(1-t)};break;case 1:a={r:r*(1-t*n),g:r,b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r,b:r*(1-t*n)};break;case 3:a={r:r*(1-t),g:r*(1-t*n),b:r};break;case 4:a={r:r*(1-t*n),g:r*(1-t),b:r};break;case 5:a={r:r,g:r*(1-t),b:r*(1-t*n)};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",void 0!==i&&(a.alpha=i),a}function tm({r:e,g:t,b:r,alpha:i}){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.max(e,t,r),a=Math.min(e,t,r),o={mode:"hsv",s:0===n?0:1-a/n,v:n};return n-a!=0&&(o.h=(n===e?(t-r)/(n-a)+(t1){let e=t+r;t/=e,r/=e}return tp({h:e,s:1===r?1:1-t/(1-r),v:1-r,alpha:i})}function tv(e){let t=tm(e);if(void 0===t)return;let r=void 0!==t.s?t.s:0,i=void 0!==t.v?t.v:0,n={mode:"hwb",w:(1-r)*i,b:1-i};return void 0!==t.h&&(n.h=t.h),void 0!==t.alpha&&(n.alpha=t.alpha),n}var tx=function(e,t){if(!t||"hwb"!==t[0])return;let r={mode:"hwb"},[,i,n,a,o]=t;if(i.type!==q){if(i.type===U)return;r.h=i.value}if(n.type!==q){if("hue"===n.type)return;r.w=n.value/100}if(a.type!==q){if("hue"===a.type)return;r.b=a.value/100}return o.type!==q&&(r.alpha=Math.min(1,Math.max(0,o.type===V?o.value:o.value/100))),r},tb={mode:"hwb",toMode:{rgb:ty},fromMode:{rgb:tv},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[tx],serialize:e=>`hwb(${void 0!==e.h?e.h:"none"} ${void 0!==e.w?100*e.w+"%":"none"} ${void 0!==e.b?100*e.b+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:es,fixup:eT},w:es,b:es,alpha:{use:es,fixup:el}},difference:{h:eP},average:{h:eq}};function t_(e){if(e<0)return 0;let t=Math.pow(e,1/78.84375);return 1e4*Math.pow(Math.max(0,t-.8359375)/(18.8515625-18.6875*t),1/.1593017578125)}function tw(e){if(e<0)return 0;let t=Math.pow(e/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*t)/(1+18.6875*t),78.84375)}var tT=e=>Math.max(e/203,0),tA=({i:e,t:t,p:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=t_(e+.008609037037932761*t+.11102962500302593*r),a=t_(e-.00860903703793275*t-.11102962500302599*r),o=t_(e+.5600313357106791*t-.32062717498731885*r),s={mode:"xyz65",x:tT(2.070152218389422*n-1.3263473389671556*a+.2066510476294051*o),y:tT(.3647385209748074*n+.680566024947227*a-.0453045459220346*o),z:tT(-.049747207535812*n-.0492609666966138*a+1.1880659249923042*o)};return void 0!==i&&(s.alpha=i),s},tM=(e=0)=>Math.max(203*e,0),tk=({x:e,y:t,z:r,alpha:i})=>{let n=tM(e),a=tM(t),o=tM(r),s=tw(.3592832590121217*n+.6976051147779502*a-.0358915932320289*o),l=tw(-.1920808463704995*n+1.1004767970374323*a+.0753748658519118*o),u=tw(.0070797844607477*n+.0748396662186366*a+.8433265453898765*o),c={mode:"itp",i:.5*s+.5*l,t:1.61376953125*s-3.323486328125*l+1.709716796875*u,p:4.378173828125*s-4.24560546875*l-.132568359375*u};return void 0!==i&&(c.alpha=i),c},tS={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:tA,rgb:e=>ex(tA(e))},fromMode:{xyz65:tk,rgb:e=>tk(eg(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:es,t:es,p:es,alpha:{use:es,fixup:el}}},tE=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*t)/(1+18.6875*t),134.03437499999998)},tD=(e=0)=>Math.max(203*e,0),tC=({x:e,y:t,z:r,alpha:i})=>{e=tD(e),t=tD(t);let n=1.15*e-.15*(r=tD(r)),a=.66*t+.34*e,o=tE(.41478972*n+.579999*a+.014648*r),s=tE(-.20151*n+1.120649*a+.0531008*r),l=tE(-.0166008*n+.2648*a+.6684799*r),u=(o+s)/2,c={mode:"jab",j:.44*u/(1-.56*u)-16295499532821565e-27,a:3.524*o-4.066708*s+.542708*l,b:.199076*o+1.096799*s-1.295875*l};return void 0!==i&&(c.alpha=i),c},tI=e=>{if(e<0)return 0;let t=Math.pow(e,.007460772656268216);return 1e4*Math.pow((.8359375-t)/(18.6875*t-18.8515625),1/.1593017578125)},tL=({j:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=(e+16295499532821565e-27)/(.44+.56*(e+16295499532821565e-27)),a=tI(n+.13860504*t+.058047316*r),o=tI(n-.13860504*t-.058047316*r),s=tI(n-.096019242*t-.8118919*r),l={mode:"xyz65",x:(1.661373024652174*a-.914523081304348*o+.23136208173913045*s)/203,y:(-.3250758611844533*a+1.571847026732543*o-.21825383453227928*s)/203,z:(-.090982811*a-.31272829*o+1.5227666*s)/203};return void 0!==i&&(l.alpha=i),l},tP=e=>{let t=tC(eg(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},tz=e=>ex(tL(e)),tF={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:tP,xyz65:tC},toMode:{rgb:tz,xyz65:tL},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:es,a:es,b:es,alpha:{use:es,fixup:el}}},tO=({j:e,a:t,b:r,alpha:i})=>{void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.sqrt(t*t+r*r),a={mode:"jch",j:e,c:n};return n&&(a.h=e_(180*Math.atan2(r,t)/Math.PI)),void 0!==i&&(a.alpha=i),a},tR=({j:e,c:t,h:r,alpha:i})=>{void 0===r&&(r=0);let n={mode:"jab",j:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return void 0!==i&&(n.alpha=i),n},tB={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:tR,rgb:e=>tz(tR(e))},fromMode:{rgb:e=>tO(tP(e)),jab:tO},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:es,fixup:eT},c:es,j:es,alpha:{use:es,fixup:el}},difference:{h:ez},average:{h:eq}},tj=24389/27,tN=216/24389,tV=e=>Math.pow(e,3)>tN?Math.pow(e,3):(116*e-16)/tj,tU=({l:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=(e+16)/116,a=t/500+n,o=n-r/200,s={mode:"xyz50",x:tV(a)*eK.X,y:tV(n)*eK.Y,z:tV(o)*eK.Z};return void 0!==i&&(s.alpha=i),s},tq=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=ev({r:3.1341359569958707*e-1.6173863321612538*t-.4906619460083532*r,g:-.978795502912089*e+1.916254567259524*t+.03344273116131949*r,b:.07195537988411677*e-.2289768264158322*t+1.405386058324125*r});return void 0!==i&&(n.alpha=i),n},tG=e=>tq(tU(e)),tH=e=>{let{r:t,g:r,b:i,alpha:n}=em(e),a={mode:"xyz50",x:.436065742824811*t+.3851514688337912*r+.14307845442264197*i,y:.22249319175623702*t+.7168870538238823*r+.06061979053616537*i,z:.013923904500943465*t+.09708128566574634*r+.7140993584005155*i};return void 0!==n&&(a.alpha=n),a},t$=e=>e>tN?Math.cbrt(e):(tj*e+16)/116,tW=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=t$(e/eK.X),a=t$(t/eK.Y),o={mode:"lab",l:116*a-16,a:500*(n-a),b:200*(a-t$(r/eK.Z))};return void 0!==i&&(o.alpha=i),o},tY=e=>{let t=tW(tH(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},tZ=function(e,t){if(!t||"lab"!==t[0])return;let r={mode:"lab"},[,i,n,a,o]=t;if("hue"!==i.type&&"hue"!==n.type&&"hue"!==a.type)return i.type!==q&&(r.l=Math.min(Math.max(0,i.value),100)),n.type!==q&&(r.a=n.type===V?n.value:125*n.value/100),a.type!==q&&(r.b=a.type===V?a.value:125*a.value/100),o.type!==q&&(r.alpha=Math.min(1,Math.max(0,o.type===V?o.value:o.value/100))),r},tX={mode:"lab",toMode:{xyz50:tU,rgb:tG},fromMode:{xyz50:tW,rgb:tY},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[tZ],serialize:e=>`lab(${void 0!==e.l?e.l:"none"} ${void 0!==e.a?e.a:"none"} ${void 0!==e.b?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:es,a:es,b:es,alpha:{use:es,fixup:el}}},tK=f(d({},tX),{mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:e0,rgb:e1},fromMode:{xyz65:e3,rgb:e5},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}}),tJ=function(e,t){if(!t||"lch"!==t[0])return;let r={mode:"lch"},[,i,n,a,o]=t;if(i.type!==q){if("hue"===i.type)return;r.l=Math.min(Math.max(0,i.value),100)}if(n.type!==q&&(r.c=Math.max(0,n.type===V?n.value:150*n.value/100)),a.type!==q){if(a.type===U)return;r.h=a.value}return o.type!==q&&(r.alpha=Math.min(1,Math.max(0,o.type===V?o.value:o.value/100))),r},tQ={mode:"lch",toMode:{lab:eY,rgb:e=>tG(eY(e))},fromMode:{rgb:e=>eW(tY(e)),lab:eW},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[tJ],serialize:e=>`lch(${void 0!==e.l?e.l:"none"} ${void 0!==e.c?e.c:"none"} ${void 0!==e.h?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:es,fixup:eT},c:es,l:es,alpha:{use:es,fixup:el}},difference:{h:ez},average:{h:eq}},t0=f(d({},tQ),{mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>eY(e,"lab65"),rgb:e=>e1(eY(e,"lab65"))},fromMode:{rgb:e=>eW(e5(e),"lch65"),lab65:e=>eW(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}}),t1=({l:e,u:t,v:r,alpha:i})=>{void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.sqrt(t*t+r*r),a={mode:"lchuv",l:e,c:n};return n&&(a.h=e_(180*Math.atan2(r,t)/Math.PI)),void 0!==i&&(a.alpha=i),a},t2=({l:e,c:t,h:r,alpha:i})=>{void 0===r&&(r=0);let n={mode:"luv",l:e,u:t?t*Math.cos(r/180*Math.PI):0,v:t?t*Math.sin(r/180*Math.PI):0};return void 0!==i&&(n.alpha=i),n},t3=(e,t,r)=>4*e/(e+15*t+3*r),t5=(e,t,r)=>9*t/(e+15*t+3*r),t4=t3(eK.X,eK.Y,eK.Z),t6=t5(eK.X,eK.Y,eK.Z),t8=({x:e,y:t,z:r,alpha:i})=>{let n;void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let a=(n=t/eK.Y)<=tN?tj*n:116*Math.cbrt(n)-16,o=t3(e,t,r),s=t5(e,t,r);isFinite(o)&&isFinite(s)?(o=13*a*(o-t4),s=13*a*(s-t6)):a=o=s=0;let l={mode:"luv",l:a,u:o,v:s};return void 0!==i&&(l.alpha=i),l},t7=(r=eK.X,4*r/(r+15*eK.Y+3*eK.Z)),t9=(i=eK.X,9*(n=eK.Y)/(i+15*n+3*eK.Z)),re=({l:e,u:t,v:r,alpha:i})=>{if(void 0===e&&(e=0),0===e)return{mode:"xyz50",x:0,y:0,z:0};void 0===t&&(t=0),void 0===r&&(r=0);let n=t/(13*e)+t7,a=r/(13*e)+t9,o=eK.Y*(e<=8?e/tj:Math.pow((e+16)/116,3)),s={mode:"xyz50",x:9*n*o/(4*a),y:o,z:o*(12-3*n-20*a)/(4*a)};return void 0!==i&&(s.alpha=i),s},rt={mode:"lchuv",toMode:{luv:t2,rgb:e=>tq(re(t2(e)))},fromMode:{rgb:e=>t1(t8(tH(e))),luv:t1},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:es,fixup:eT},c:es,l:es,alpha:{use:es,fixup:el}},difference:{h:ez},average:{h:eq}},rr=f(d({},eu),{mode:"lrgb",toMode:{rgb:ev},fromMode:{rgb:em},parse:["srgb-linear"],serialize:"srgb-linear"}),ri={mode:"luv",toMode:{xyz50:re,rgb:e=>tq(re(e))},fromMode:{xyz50:t8,rgb:e=>t8(tH(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:es,u:es,v:es,alpha:{use:es,fixup:el}}},rn=({r:e,g:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*r),a=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*r),o=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*r),s={mode:"oklab",l:.210454268309314*n+.7936177747023054*a-.0040720430116193*o,a:1.9779985324311684*n-2.42859224204858*a+.450593709617411*o,b:.0259040424655478*n+.7827717124575296*a-.8086757549230774*o};return void 0!==i&&(s.alpha=i),s},ra=e=>{let t=rn(em(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},ro=({l:e,a:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=Math.pow(e+.3963377773761749*t+.2158037573099136*r,3),a=Math.pow(e-.1055613458156586*t-.0638541728258133*r,3),o=Math.pow(e-.0894841775298119*t-1.2914855480194092*r,3),s={mode:"lrgb",r:4.076741636075957*n-3.3077115392580616*a+.2309699031821044*o,g:-1.2684379732850317*n+2.6097573492876887*a-.3413193760026573*o,b:-.0041960761386756*n-.7034186179359362*a+1.7076146940746117*o};return void 0!==i&&(s.alpha=i),s},rs=e=>ev(ro(e));function rl(e){return .5*(1.170873786407767*e-.206+Math.sqrt((1.170873786407767*e-.206)*(1.170873786407767*e-.206)+.14050485436893204*e))}function ru(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function rc(e,t){let r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x=(-1.88170328*e-.80936493*t>1?(r=1.19086277,i=1.76576728,n=.59662641,a=.75515197,o=.56771245,s=4.0767416621,l=-3.3077115913,u=.2309699292):1.81444104*e-1.19445276*t>1?(r=.73956515,i=-.45954404,n=.08285427,a=.1254107,o=.14503204,s=-1.2684380046,l=2.6097574011,u=-.3413193965):(r=1.35733652,i=-.00915799,n=-1.1513021,a=-.50559606,o=.00692167,s=-.0041960863,l=-.7034186147,u=1.707614701),c=r+i*e+n*t+a*e*e+o*e*t,h=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,f=-.0894841775*e-1.291485548*t,y=s*((p=1+c*h)*p*p)+l*((m=1+c*d)*m*m)+u*((g=1+c*f)*g*g),c-=y*(v=3*h*p*p*s+3*d*m*m*l+3*f*g*g*u)/(v*v-.5*y*(6*h*h*p*s+6*d*d*m*l+6*f*f*g*u))),b=ro({l:1,a:x*e,b:x*t}),_=Math.cbrt(1/Math.max(b.r,b.g,b.b));return[_,_*x]}function rh(e,t,r=null){r||(r=rc(e,t));let i=r[0],n=r[1];return[n/i,n/(1-i)]}function rd(e,t,r){let i=rc(t,r),n=function(e,t,r,i,n=null){let a;if(n||(n=rc(e,t)),(r-i)*n[1]-(n[0]-i)*1<=0)a=n[1]*i/(+n[0]+n[1]*(i-r));else{a=n[1]*(i-1)/(+(n[0]-1)+n[1]*(i-r));{let n=r-i,o=.3963377774*e+.2158037573*t,s=-.1055613458*e-.0638541728*t,l=-.0894841775*e-1.291485548*t,u=n+ +o,c=n+ +s,h=n+ +l;{let e=i*(1-a)+a*r,t=+a,n=e+t*o,d=e+t*s,f=e+t*l,p=n*n*n,m=d*d*d,g=f*f*f,y=3*u*n*n,v=3*c*d*d,x=3*h*f*f,b=6*u*u*n,_=6*c*c*d,w=6*h*h*f,T=4.0767416621*p-3.3077115913*m+.2309699292*g-1,A=4.0767416621*y-3.3077115913*v+.2309699292*x,M=A/(A*A-.5*T*(4.0767416621*b-3.3077115913*_+.2309699292*w)),k=-T*M,S=-1.2684380046*p+2.6097574011*m-.3413193965*g-1,E=-1.2684380046*y+2.6097574011*v-.3413193965*x,D=E/(E*E-.5*S*(-1.2684380046*b+2.6097574011*_-.3413193965*w)),C=-S*D,I=-.0041960863*p-.7034186147*m+1.707614701*g-1,L=-.0041960863*y-.7034186147*v+1.707614701*x,P=L/(L*L-.5*I*(-.0041960863*b-.7034186147*_+1.707614701*w)),z=-I*P;a+=Math.min(k=M>=0?k:1e6,Math.min(C=D>=0?C:1e6,z=P>=0?z:1e6))}}}return a}(t,r,e,e,i),a=rh(t,r,i),o=.11516993+1/(7.4477897+4.1590124*r+t*(-2.19557347+1.75198401*r+t*(-2.13704948-10.02301043*r+t*(-4.24894561+5.38770819*r+4.69891013*t)))),s=.11239642+1/(1.6132032-.68124379*r+t*(.40370612+.90148123*r+t*(-.27087943+.6122399*r+t*(.00299215-.45399568*r-.14661872*t)))),l=n/Math.min(e*a[0],(1-e)*a[1]),u=e*o,c=(1-e)*s,h=.9*l*Math.sqrt(Math.sqrt(1/(1/(u*u*u*u)+1/(c*c*c*c))));return[Math.sqrt(1/(1/((u=.4*e)*u)+1/((c=(1-e)*.8)*c))),h,n]}function rf(e){let t=void 0!==e.l?e.l:0,r=void 0!==e.a?e.a:0,i=void 0!==e.b?e.b:0,n={mode:"okhsl",l:rl(t)};void 0!==e.alpha&&(n.alpha=e.alpha);let a=Math.sqrt(r*r+i*i);if(!a)return n.s=0,n;let[o,s,l]=rd(t,r/a,i/a),u;if(arf(ra(e))},toMode:{oklab:rp,rgb:e=>rs(rp(e))}});function rg(e){let t=void 0!==e.l?e.l:0,r=void 0!==e.a?e.a:0,i=void 0!==e.b?e.b:0,n=Math.sqrt(r*r+i*i),a=n?r/n:1,o=n?i/n:1,[s,l]=rh(a,o),u=l/(n+t*l),c=u*t,h=u*n,d=ru(c),f=h*d/c,p=ro({l:d,a:a*f,b:o*f}),m=Math.cbrt(1/Math.max(p.r,p.g,p.b,0));t/=m;let g={mode:"okhsv",s:(n=n/m*rl(t)/t)?(.5+l)*h/(.5*l+l*(1-.5/s)*h):0,v:(t=rl(t))?t/c:0};return g.s&&(g.h=e_(180*Math.atan2(i,r)/Math.PI)),void 0!==e.alpha&&(g.alpha=e.alpha),g}function ry(e){let t={mode:"oklab"};void 0!==e.alpha&&(t.alpha=e.alpha);let r=void 0!==e.h?e.h:0,i=void 0!==e.s?e.s:0,n=void 0!==e.v?e.v:0,a=Math.cos(r/180*Math.PI),o=Math.sin(r/180*Math.PI),[s,l]=rh(a,o),u=1-.5/s,c=1-.5*i/(.5+l-l*u*i),h=i*l*.5/(.5+l-l*u*i),d=ru(c),f=h*d/c,p=ro({l:d,a:a*f,b:o*f}),m=Math.cbrt(1/Math.max(p.r,p.g,p.b,0)),g=ru(n*c),y=h*g/c;return t.l=g*m,t.a=y*a*m,t.b=y*o*m,t}var rv=f(d({},tg),{mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:rg,rgb:e=>rg(ra(e))},toMode:{oklab:ry,rgb:e=>rs(ry(e))}}),rx=function(e,t){if(!t||"oklab"!==t[0])return;let r={mode:"oklab"},[,i,n,a,o]=t;if("hue"!==i.type&&"hue"!==n.type&&"hue"!==a.type)return i.type!==q&&(r.l=Math.min(Math.max(0,i.type===V?i.value:i.value/100),1)),n.type!==q&&(r.a=n.type===V?n.value:.4*n.value/100),a.type!==q&&(r.b=a.type===V?a.value:.4*a.value/100),o.type!==q&&(r.alpha=Math.min(1,Math.max(0,o.type===V?o.value:o.value/100))),r},rb=f(d({},tX),{mode:"oklab",toMode:{lrgb:ro,rgb:rs},fromMode:{lrgb:rn,rgb:ra},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[rx],serialize:e=>`oklab(${void 0!==e.l?e.l:"none"} ${void 0!==e.a?e.a:"none"} ${void 0!==e.b?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`}),r_=function(e,t){if(!t||"oklch"!==t[0])return;let r={mode:"oklch"},[,i,n,a,o]=t;if(i.type!==q){if("hue"===i.type)return;r.l=Math.min(Math.max(0,i.type===V?i.value:i.value/100),1)}if(n.type!==q&&(r.c=Math.max(0,n.type===V?n.value:.4*n.value/100)),a.type!==q){if(a.type===U)return;r.h=a.value}return o.type!==q&&(r.alpha=Math.min(1,Math.max(0,o.type===V?o.value:o.value/100))),r},rw=f(d({},tQ),{mode:"oklch",toMode:{oklab:e=>eY(e,"oklab"),rgb:e=>rs(eY(e,"oklab"))},fromMode:{rgb:e=>eW(ra(e),"oklch"),oklab:e=>eW(e,"oklch")},parse:[r_],serialize:e=>`oklch(${void 0!==e.l?e.l:"none"} ${void 0!==e.c?e.c:"none"} ${void 0!==e.h?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}}),rT=e=>{let{r:t,g:r,b:i,alpha:n}=em(e),a={mode:"xyz65",x:.486570948648216*t+.265667693169093*r+.1982172852343625*i,y:.2289745640697487*t+.6917385218365062*r+.079286914093745*i,z:0*t+.0451133818589026*r+1.043944368900976*i};return void 0!==n&&(a.alpha=n),a},rA=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=ev({r:2.4934969119414263*e-.9313836179191242*t-.402710784450717*r,g:-.8294889695615749*e+1.7626640603183465*t+.0236246858419436*r,b:.0358458302437845*e-.0761723892680418*t+.9568845240076871*r},"p3");return void 0!==i&&(n.alpha=i),n},rM=f(d({},eu),{mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>rA(eg(e)),xyz65:rA},toMode:{rgb:e=>ex(rT(e)),xyz65:rT}}),rk=e=>{let t=Math.abs(e);return t>=1/512?Math.sign(e)*Math.pow(t,1/1.8):16*e},rS=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"prophoto",r:rk(1.3457868816471585*e-.2555720873797946*t-.0511018649755453*r),g:rk(-.5446307051249019*e+1.5082477428451466*t+.0205274474364214*r),b:rk(0*e+0*t+1.2119675456389452*r)};return void 0!==i&&(n.alpha=i),n},rE=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},rD=e=>{let t=rE(e.r),r=rE(e.g),i=rE(e.b),n={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*r+.0313477341283922*i,y:.2880748288194013*t+.7118352342418731*r+899369387256e-16*i,z:0*t+0*r+.8251046025104602*i};return void 0!==e.alpha&&(n.alpha=e.alpha),n},rC=f(d({},eu),{mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:rS,rgb:e=>rS(tH(e))},toMode:{xyz50:rD,rgb:e=>tq(rD(e))}}),rI=e=>{let t=Math.abs(e);return t>.018053968510807?(Math.sign(e)||1)*(1.09929682680944*Math.pow(t,.45)-.09929682680944008):4.5*e},rL=({x:e,y:t,z:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"rec2020",r:rI(1.7166511879712683*e-.3556707837763925*t-.2533662813736599*r),g:rI(-.6666843518324893*e+1.6164812366349395*t+.0157685458139111*r),b:rI(.0176398574453108*e-.0427706132578085*t+.9421031212354739*r)};return void 0!==i&&(n.alpha=i),n},rP=(e=0)=>{let t=Math.abs(e);return t<.08124285829863151?e/4.5:(Math.sign(e)||1)*Math.pow((t+1.09929682680944-1)/1.09929682680944,1/.45)},rz=e=>{let t=rP(e.r),r=rP(e.g),i=rP(e.b),n={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*r+.1688809751641721*i,y:.262700212011267*t+.6779980715188708*r+.059301716469862*i,z:0*t+.0280726930490874*r+1.0609850577107909*i};return void 0!==e.alpha&&(n.alpha=e.alpha),n},rF=f(d({},eu),{mode:"rec2020",fromMode:{xyz65:rL,rgb:e=>rL(eg(e))},toMode:{xyz65:rz,rgb:e=>ex(rz(e))},parse:["rec2020"],serialize:"rec2020"}),rO=Math.cbrt(.0037930732552754493),rR=e=>Math.cbrt(e)-rO,rB=e=>{let{r:t,g:r,b:i,alpha:n}=em(e),a=rR(.3*t+.622*r+.078*i+.0037930732552754493),o=rR(.23*t+.692*r+.078*i+.0037930732552754493),s={mode:"xyb",x:(a-o)/2,y:(a+o)/2,b:rR(.2434226892454782*t+.2047674442449682*r+.5518098665095535*i+.0037930732552754493)-(a+o)/2};return void 0!==n&&(s.alpha=n),s},rj=e=>Math.pow(e+rO,3),rN=({x:e,y:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n=rj(e+t)-.0037930732552754493,a=rj(t-e)-.0037930732552754493,o=rj(r+t)-.0037930732552754493,s=ev({r:11.031566904639861*n-9.866943908131562*a-.16462299650829934*o,g:-3.2541473810744237*n+4.418770377582723*a-.16462299650829934*o,b:-3.6588512867136815*n+2.7129230459360922*a+1.9459282407775895*o});return void 0!==i&&(s.alpha=i),s},rV={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:rN},fromMode:{rgb:rB},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:es,y:es,b:es,alpha:{use:es,fixup:el}}},rU={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:tq,lab:tW},fromMode:{rgb:tH,lab:tU},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:es,y:es,z:es,alpha:{use:es,fixup:el}}},rq=e=>{let{x:t,y:r,z:i,alpha:n}=e;void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*r-.0501922295431356*i,y:.0296278156881593*t+.990434484573249*r-.0170738250293851*i,z:-.0092430581525912*t+.0150551448965779*r+.7518742899580008*i};return void 0!==n&&(a.alpha=n),a},rG=e=>{let{x:t,y:r,z:i,alpha:n}=e;void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*r+.0632593086610217*i,y:-.0283697069632081*t+1.0099954580058226*r+.021041398966943*i,z:.0123140016883199*t-.0205076964334779*r+1.3303659366080753*i};return void 0!==n&&(a.alpha=n),a},rH={mode:"xyz65",toMode:{rgb:ex,xyz50:rq},fromMode:{rgb:eg,xyz50:rG},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:es,y:es,z:es,alpha:{use:es,fixup:el}}},r$=({r:e,g:t,b:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*r,i:.59597799*e-.2741761*t-.32180189*r,q:.21147017*e-.52261711*t+.31114694*r};return void 0!==i&&(n.alpha=i),n},rW=({y:e,i:t,q:r,alpha:i})=>{void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0);let n={mode:"rgb",r:e+.95608445*t+.6208885*r,g:e-.27137664*t-.6486059*r,b:e-1.10561724*t+1.70250126*r};return void 0!==i&&(n.alpha=i),n},rY={mode:"yiq",toMode:{rgb:rW},fromMode:{rgb:r$},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:es,i:es,q:es,alpha:{use:es,fixup:el}}},rZ=(e=4)=>t=>{let r;return"number"==typeof t?Math.round(t*(r=Math.pow(10,r=e)))/r:t},rX=rZ(2),rK=e=>Math.max(0,Math.min(1,e||0)),rJ=e=>Math.round(255*rK(e)),rQ=S("rgb"),r0=S("hsl"),r1=e=>{if(void 0!==e)return"#"+(0x1000000|rJ(e.r)<<16|rJ(e.g)<<8|rJ(e.b)).toString(16).slice(1)},r2=e=>{if(void 0===e)return;let t=rJ(void 0!==e.alpha?e.alpha:1);return r1(e)+(256|t).toString(16).slice(1)},r3=e=>{if(void 0===e)return;let t=rJ(e.r),r=rJ(e.g),i=rJ(e.b);return void 0===e.alpha||1===e.alpha?`rgb(${t}, ${r}, ${i})`:`rgba(${t}, ${r}, ${i}, ${rX(rK(e.alpha))})`},r5=e=>{if(void 0===e)return;let t=rX(e.h||0),r=rX(100*rK(e.s))+"%",i=rX(100*rK(e.l))+"%";return void 0===e.alpha||1===e.alpha?`hsl(${t}, ${r}, ${i})`:`hsla(${t}, ${r}, ${i}, ${rX(rK(e.alpha))})`},r4=e=>{let t=k(e);if(!t)return;let r=z(t.mode);if(!r.serialize||"string"==typeof r.serialize){let e=`color(${r.serialize||`--${t.mode}`} `;return r.channels.forEach((r,i)=>{"alpha"!==r&&(e+=(i?" ":"")+(void 0!==t[r]?t[r]:"none"))}),void 0!==t.alpha&&t.alpha<1&&(e+=` / ${t.alpha}`),e+")"}if("function"==typeof r.serialize)return r.serialize(t)},r6=e=>r1(rQ(e)),r8=e=>r2(rQ(e)),r7=e=>r3(rQ(e)),r9=e=>r5(r0(e)),ie={normal:(e,t)=>t,multiply:(e,t)=>e*t,screen:(e,t)=>e+t-e*t,"hard-light":(e,t)=>t<.5?2*e*t:2*t*(1-e)-1,overlay:(e,t)=>e<.5?2*t*e:2*e*(1-t)-1,darken:(e,t)=>Math.min(e,t),lighten:(e,t)=>Math.max(e,t),"color-dodge":(e,t)=>0===e?0:1===t?1:Math.min(1,e/(1-t)),"color-burn":(e,t)=>1===e?1:0===t?0:1-Math.min(1,(1-e)/t),"soft-light":(e,t)=>t<.5?e-(1-2*t)*e*(1-e):e+(2*t-1)*((e<.25?((16*e-12)*e+4)*e:Math.sqrt(e))-e),difference:(e,t)=>Math.abs(e-t),exclusion:(e,t)=>e+t-2*e*t},it=(e,t="normal",r="rgb")=>{let i="function"==typeof t?t:ie[t],n=S(r),a=z(r).channels;return e.map(e=>{let t=n(e);return void 0===t.alpha&&(t.alpha=1),t}).reduce((e,t)=>{if(void 0===e)return t;let n=t.alpha+e.alpha*(1-t.alpha);return a.reduce((r,a)=>("alpha"!==a&&(0===n?r[a]=0:(r[a]=t.alpha*(1-e.alpha)*t[a]+t.alpha*e.alpha*i(e[a],t[a])+(1-t.alpha)*e.alpha*e[a],r[a]=Math.max(0,Math.min(1,r[a]/n)))),r),{mode:r,alpha:n})})},ir=(e="rgb",t={})=>{let r=z(e),i=Object.keys(t).reduce((e,r)=>{let i=t[r];return e[r]=Array.isArray(i)?i:[i,i],e},{});return r.channels.reduce((e,t)=>((i.alpha||"alpha"!==t)&&(e[t]=(([e,t])=>e+Math.random()*(t-e))(i[t]||r.ranges[t])),e),{mode:e})},ii=(e,t="rgb",r=!1)=>{let i=t?z(t).channels:null,n=t?S(t):k;return a=>{let o=n(a);if(!o)return;let s=(i||z(o.mode).channels).reduce((r,i)=>{let n=e(o[i],i,o,t);return void 0===n||isNaN(n)||(r[i]=n),r},{mode:o.mode});if(!r)return s;let l=k(a);return l&&l.mode!==s.mode?S(l.mode)(s):s}},ia=(e,t,r)=>"alpha"!==t?(e||0)*(void 0!==r.alpha?r.alpha:1):e,io=(e,t,r)=>"alpha"!==t&&0!==r.alpha?(e||0)/(void 0!==r.alpha?r.alpha:1):e,is=(e=1,t=0)=>(r,i)=>"alpha"!==i?r*e+t:r,il=(e=1,t=1,r=0)=>(i,n)=>"alpha"!==n?e*Math.pow(i,t)+r:i,iu=(e=.5)=>t=>e<=0?1:e>=1?0:Math.pow(t,Math.log(.5)/Math.log(e)),ic=(e,t="rgb",r,i)=>{let n=z(t),a=S(t),o=[],s=[],l={};e.forEach(e=>{Array.isArray(e)?(o.push(a(e[0])),s.push(e[1])):"number"==typeof e||"function"==typeof e?l[s.length]=e:(o.push(a(e)),s.push(void 0))}),(e=>{void 0===e[0]&&(e[0]=0),void 0===e[e.length-1]&&(e[e.length-1]=1);let t=1,r,i,n,a;for(;t{let i,a,s;return i=r&&"object"==typeof r&&(a=r[t])&&"object"==typeof a&&r[t].fixup?r[t].fixup:(s=n.interpolate[t])&&"object"==typeof s&&n.interpolate[t].fixup?n.interpolate[t].fixup:e=>e,e[t]=i(o.map(e=>e[t])),e},{});if(i){let e=o.map((e,r)=>n.channels.reduce((e,t)=>(e[t]=u[t][r],e),{mode:t}));u=n.channels.reduce((r,n)=>(r[n]=e.map(e=>{let r=i(e[n],n,e,t);return isNaN(r)?void 0:r}),r),{})}let c=n.channels.reduce((e,t)=>{let i,a,o;return"function"==typeof r?i=r:r&&"object"==typeof r&&"function"==typeof r[t]?i=r[t]:r&&"object"==typeof r&&(a=r[t])&&"object"==typeof a&&r[t].use?i=r[t].use:"function"==typeof n.interpolate[t]?i=n.interpolate[t]:(o=n.interpolate[t])&&"object"==typeof o&&(i=n.interpolate[t].use),e[t]=i(u[t]),e},{}),h=o.length-1;return e=>{if((e=Math.min(Math.max(0,e),1))<=s[0])return o[0];if(e>s[h])return o[h];let r=0;for(;s[r]{let r=c[t](f);return void 0!==r&&(e[t]=r),e},{mode:t})}},ih=(e,t="rgb",r)=>ic(e,t,r),id=(e,t)=>(r,i="rgb",n)=>{let a=t?ii(t,i):void 0,o=ic(r,i,n,e);return a?e=>a(o(e)):o},ip=id(ia,io),im=(e,t,r,i,n)=>{let a=n*n,o=a*n;return((1-3*n+3*a-o)*e+(4-6*a+3*o)*t+(1+3*n+3*a-3*o)*r+o*i)/6},ig=e=>t=>{let r=e.length-1,i=t>=1?r-1:Math.max(0,Math.floor(t*r));return im(i>0?e[i-1]:2*e[i]-e[i+1],e[i],e[i+1],it=>{let r,i,n,a,o=e.length-1,s=Math.floor(t*o);return im(e[(s-1+(r=e.length))%r],e[(s+(i=e.length))%i],e[(s+1+(n=e.length))%n],e[(s+2+(a=e.length))%a],(t-s/o)*o)},iv=e=>{let t,r=e.length-1,i=Array(r),n=Array(r),a=Array(r);for(i[1]=.25,n[1]=(6*e[1]-e[0])/4,t=2;t0&&(a[r-1]=n[r-1]),t=r-2;t>0;--t)a[t]=n[t]-i[t]*a[t+1];return a},ix=e=>ig(iv(e)),ib=e=>iy(iv(e)),i_=Math.sign,iw=Math.min,iT=Math.abs,iA=e=>{let t=e.length-1,r=[],i=[],n=[];for(let a=0;a0?.5*(e[a+1]-e[a-1])*t:void 0),n.push(a>0?(i_(r[a-1])+i_(r[a]))*iw(iT(r[a-1]),iT(r[a]),.5*iT(i[a])):void 0);return[r,i,n]},iM=(e,t,r)=>{let i=e.length-1,n=i*i;return a=>{let o;o=a>=1?i-1:Math.max(0,Math.floor(a*i));let s=a-o/i,l=s*s;return(t[o]+t[o+1]-2*r[o])*n*(l*s)+(3*r[o]-2*t[o]-t[o+1])*i*l+t[o]*s+e[o]}},ik=e=>{if(e.length<3)return es(e);let t=e.length-1,[r,,i]=iA(e);return i[0]=r[0],i[t]=r[t-1],iM(e,i,r)},iS=e=>{if(e.length<3)return es(e);let t=e.length-1,[r,i,n]=iA(e);return i[0]=(2*e[1]-1.5*e[0]-.5*e[2])*t,i[t]=(1.5*e[t]-2*e[t-1]+.5*e[t-2])*t,n[0]=i[0]*r[0]<=0?0:iT(i[0])>2*iT(r[0])?2*r[0]:i[0],n[t]=i[t]*r[t-1]<=0?0:iT(i[t])>2*iT(r[t-1])?2*r[t-1]:i[t],iM(e,n,r)},iE=e=>{let t=e.length-1,[r,i,n]=iA(e);i[0]=.5*(e[1]-e[t])*t,i[t]=.5*(e[0]-e[t-1])*t;let a=(e[0]-e[t])*t;return n[0]=(i_(a)+i_(r[0]))*iw(iT(a),iT(r[0]),.5*iT(i[0])),n[t]=(i_(r[t-1])+i_(a))*iw(iT(r[t-1]),iT(a),.5*iT(i[t])),iM(e,n,r)},iD=(e=1)=>1===e?e=>e:t=>Math.pow(t,e),iC=(e=2,t=1)=>{let r=iD(t);if(e<2)return e<1?[]:[r(.5)];let i=[];for(let t=0;t{let t={mode:e.mode,r:Math.max(0,Math.min(void 0!==e.r?e.r:0,1)),g:Math.max(0,Math.min(void 0!==e.g?e.g:0,1)),b:Math.max(0,Math.min(void 0!==e.b?e.b:0,1))};return void 0!==e.alpha&&(t.alpha=e.alpha),t},iP=e=>iL(iI(e)),iz=e=>void 0!==e&&(void 0===e.r||e.r>=0&&e.r<=1)&&(void 0===e.g||e.g>=0&&e.g<=1)&&(void 0===e.b||e.b>=0&&e.b<=1);function iF(e){return iz(iI(e))}function iO(e="rgb"){let{gamut:t}=z(e);if(!t)return e=>!0;let r=S("string"==typeof t?t:e);return e=>iz(r(e))}function iR(e){return void 0===(e=k(e))||iF(e)?e:S(e.mode)(iP(e))}function iB(e="rgb"){let{gamut:t}=z(e);if(!t)return e=>k(e);let r="string"==typeof t?t:e,i=S(r),n=iO(r);return e=>{let t=k(e);if(!t)return;let r=i(t);if(n(r))return t;let a=iL(r);return t.mode===a.mode?a:S(t.mode)(a)}}function ij(e,t="lch",r="rgb"){e=k(e);let i="rgb"===r?iF:iO(r),n="rgb"===r?iP:iB(r);if(void 0===e||i(e))return e;let a=S(e.mode),o=f(d({},e=S(t)(e)),{c:0});if(!i(o))return a(n(o));let s=0,l=void 0!==e.c?e.c:0,u=z(t).ranges.c,c=(u[1]-u[0])/8192,h=o.c;for(;l-s>c;)o.c=s+(l-s)*.5,i(o)?(h=o.c,s=o.c):l=o.c;return a(i(o)?o:f(d({},o),{c:h}))}function iN(e="rgb",t="oklch",r=eF("oklch"),i=.02){let n=S(e),a=z(e);if(!a.gamut)return e=>n(e);let o=iO(e),s=iB(e),l=S(t),{ranges:u}=z(t);if(!u.l||!u.c)throw Error("LCH-like space expected");return t=>{if(void 0===(t=k(t)))return;let c=d({},l(t));if(void 0===c.l&&(c.l=0),void 0===c.c&&(c.c=0),c.l>=u.l[1]){let r=f(d({},a.white),{mode:e});return void 0!==t.alpha&&(r.alpha=t.alpha),r}if(c.l<=u.l[0]){let r=f(d({},a.black),{mode:e});return void 0!==t.alpha&&(r.alpha=t.alpha),r}if(o(c))return n(c);let h=0,p=c.c,m=(u.c[1]-u.c[0])/4e3,g=s(c);for(;p-h>m;)c.c=(h+p)*.5,g=s(c),o(c)||r&&i>0&&r(c,g)<=i?h=c.c:p=c.c;return n(o(c)?c:g)}}var iV=(e,t=eF(),r=e=>e)=>{let i=e.map((e,t)=>({color:r(e),i:t}));return(r,n=1,a=1/0)=>(isFinite(n)&&(n=Math.max(1,Math.min(n,i.length-1))),i.forEach(e=>{e.d=t(r,e.color)}),i.sort((e,t)=>e.d-t.d).slice(0,n).filter(e=>e.de[t.i]))},iU=e=>Math.max(Math.min(e,1),0),iq=(e,t,r=!1)=>{let i=S(t),n=z(t).channels;return a=>{let o=i(a);if(!o)return;let s={mode:t},l,u=n.length;for(let t=0;tii(is(Math.max(e,0)),t,!0),iH=(e=1,t="rgb")=>{let r=Math.max(e,0);return ii(is(r,(1-r)/2),t,!0)},i$=(e=1,t="rgb")=>{let r;return iq([.393+.607*(r=1-iU(e)),.769-.769*r,.189-.189*r,0,.349-.349*r,.686+.314*r,.168-.168*r,0,.272-.272*r,.534-.534*r,.131+.869*r,0,0,0,0,1],t,!0)},iW=(e=1,t="rgb")=>{let r;return iq([.213+.787*(r=Math.max(e,0)),.715-.715*r,.072-.072*r,0,.213-.213*r,.715+.285*r,.072-.072*r,0,.213-.213*r,.715-.715*r,.072+.928*r,0,0,0,0,1],t,!0)},iY=(e=1,t="rgb")=>{let r;return iq([.2126+.7874*(r=1-iU(e)),.7152-.7152*r,.0722-.0722*r,0,.2126-.2126*r,.7152+.2848*r,.0722-.0722*r,0,.2126-.2126*r,.7152-.7152*r,.0722+.9278*r,0,0,0,0,1],t,!0)},iZ=(e=1,t="rgb")=>{let r=iU(e);return ii((e,t)=>{let i;return"alpha"===t?e:(i=1-r,void 0===r||void 0===i?void 0:r+e*(i-r))},t,!0)},iX=(e=0,t="rgb")=>{let r,i,n;return iq([.213+.787*(i=Math.cos(r=Math.PI*e/180))-.213*(n=Math.sin(r)),.715-.715*i-.715*n,.072-.072*i+.928*n,0,.213-.213*i+.143*n,.715+.285*i+.14*n,.072-.072*i-.283*n,0,.213-.213*i-.787*n,.715-.715*i+.715*n,.072+.928*i+.072*n,0,0,0,0,1],t,!0)},iK=S("rgb"),iJ=[[1,0,-0,0,1,0,-0,-0,1],[.856167,.182038,-.038205,.029342,.955115,.015544,-.00288,-.001563,1.004443],[.734766,.334872,-.069637,.05184,.919198,.028963,-.004928,-.004209,1.009137],[.630323,.465641,-.095964,.069181,.890046,.040773,-.006308,-.007724,1.014032],[.539009,.579343,-.118352,.082546,.866121,.051332,-.007136,-.011959,1.019095],[.458064,.679578,-.137642,.092785,.846313,.060902,-.007494,-.016807,1.024301],[.38545,.769005,-.154455,.100526,.829802,.069673,-.007442,-.02219,1.029632],[.319627,.849633,-.169261,.106241,.815969,.07779,-.007025,-.028051,1.035076],[.259411,.923008,-.18242,.110296,.80434,.085364,-.006276,-.034346,1.040622],[.203876,.990338,-.194214,.112975,.794542,.092483,-.005222,-.041043,1.046265],[.152286,1.052583,-.204868,.114503,.786281,.099216,-.003882,-.048116,1.051998]],iQ=[[1,0,-0,0,1,0,-0,-0,1],[.866435,.177704,-.044139,.049567,.939063,.01137,-.003453,.007233,.99622],[.760729,.319078,-.079807,.090568,.889315,.020117,-.006027,.013325,.992702],[.675425,.43385,-.109275,.125303,.847755,.026942,-.00795,.018572,.989378],[.605511,.52856,-.134071,.155318,.812366,.032316,-.009376,.023176,.9862],[.547494,.607765,-.155259,.181692,.781742,.036566,-.01041,.027275,.983136],[.498864,.674741,-.173604,.205199,.754872,.039929,-.011131,.030969,.980162],[.457771,.731899,-.18967,.226409,.731012,.042579,-.011595,.034333,.977261],[.422823,.781057,-.203881,.245752,.709602,.044646,-.011843,.037423,.974421],[.392952,.82361,-.216562,.263559,.69021,.046232,-.01191,.040281,.97163],[.367322,.860646,-.227968,.280085,.672501,.047413,-.01182,.04294,.968881]],i0=[[1,0,-0,0,1,0,-0,-0,1],[.92667,.092514,-.019184,.021191,.964503,.014306,.008437,.054813,.93675],[.89572,.13333,-.02905,.029997,.9454,.024603,.013027,.104707,.882266],[.905871,.127791,-.033662,.026856,.941251,.031893,.01341,.148296,.838294],[.948035,.08949,-.037526,.014364,.946792,.038844,.010853,.193991,.795156],[1.017277,.027029,-.044306,-.006113,.958479,.047634,.006379,.248708,.744913],[1.104996,-.046633,-.058363,-.032137,.971635,.060503,.001336,.317922,.680742],[1.193214,-.109812,-.083402,-.058496,.97941,.079086,-.002346,.403492,.598854],[1.257728,-.139648,-.118081,-.078003,.975409,.102594,-.003316,.501214,.502102],[1.278864,-.125333,-.153531,-.084748,.957674,.127074,-989e-6,.601151,.399838],[1.255528,-.076749,-.178779,-.078411,.930809,.147602,.004733,.691367,.3039]],i1=(e,t)=>{let r=Math.max(0,Math.min(1,t)),i=Math.round(r/.1),n=Math.round(r%.1),a=e[i];if(n>0&&ier(a[r],t[r],n))}return e=>{let t=k(e);if(void 0===t)return;let{r:r,g:i,b:n}=iK(t),o={mode:"rgb",r:a[0]*r+a[1]*i+a[2]*n,g:a[3]*r+a[4]*i+a[5]*n,b:a[6]*r+a[7]*i+a[8]*n};return void 0!==t.alpha&&(o.alpha=t.alpha),S(t.mode)(o)}},i2=(e=1)=>i1(iJ,e),i3=(e=1)=>i1(iQ,e),i5=(e=1)=>i1(i0,e),i4=e=>e*e*(3-2*e),i6=e=>.5-Math.sin(Math.asin(1-2*e)/3),i8=e=>e*e*e*(e*(6*e-15)+10),i7=e=>(1-Math.cos(e*Math.PI))/2;function i9(e){let t=S("lrgb")(e);return .2126*t.r+.7152*t.g+.0722*t.b}function ne(e,t){let r=i9(e),i=i9(t);return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}var nt=P(eb),nr=P(e$),ni=P(ti),nn=P(tn),na=P(ts),no=P(tf),ns=P(tg),nl=P(tb),nu=P(tS),nc=P(tF),nh=P(tB),nd=P(tX),nf=P(tK),np=P(tQ),nm=P(t0),ng=P(rt),ny=P(rr),nv=P(ri),nx=P(rm),nb=P(rv),n_=P(rb),nw=P(rw),nT=P(rM),nA=P(rC),nM=P(rF),nk=P(eu),nS=P(rV),nE=P(rU),nD=P(rH),nC=P(rY)}}),J=m({"src/plot_api/plot_config.js"(e,t){var r={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:"https://cloud.plotly.com/newchart"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:500,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},displayNotifier:{valType:"boolean",dflt:!0},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!0},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},i={};(function e(t,r){for(var i in t){var n=t[i];n.valType?r[i]=n.dflt:(r[i]||(r[i]={}),e(n,r[i]))}})(r,i),t.exports={configAttributes:r,dfltConfig:i}}}),Q=m({"src/lib/notifier.js"(e,t){var r=M(),i=I(),n=[];t.exports=function(e,t,a){if((null==(o=a?._context)?void 0:o.displayNotifier)!==!1&&-1===n.indexOf(e)){n.push(e);var o,s=1e3;i(t)?s=t:"long"===t&&(s=3e3);var l=r.select("body").selectAll(".plotly-notifier").data([0]);l.enter().append("div").classed("plotly-notifier",!0),l.selectAll(".notifier-note").data(n).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(e){var i=r.select(this);i.append("button").classed("notifier-close",!0).html("×").on("click",function(){i.transition().call(u)});for(var n=i.append("p"),a=e.split(//g),o=0;o1){var t=["LOG:"];for(e=0;e1){var n=[];for(e=0;e"),"long")}},n.warn=function(){var e;if(r.logging>0){var t=["WARN:"];for(e=0;e0){var n=[];for(e=0;e"),"stick")}},n.error=function(){var e;if(r.logging>0){var t=["ERROR:"];for(e=0;e0){var n=[];for(e=0;e"),"stick")}}}}),et=m({"src/components/color/attributes.js"(e){e.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],e.defaultLine="#444",e.lightLine="#eee",e.background="#fff",e.borderLine="#BEC8D9",e.lightFraction=1e3/11}}),er=m({"src/components/color/index.js"(e,t){var{converter:r,formatHex:i,formatRgb:n,wcagContrast:a,wcagLuminance:o}=K(),{isArrayOrTypedArray:s}=F(),{warn:l}=ee(),{background:u,defaultLine:c,defaults:h,lightLine:p}=et(),m=r("rgb"),g=r("hsl"),y=e=>{if("string"!=typeof e)return;let t=e.trim().toLowerCase();if(!/^[0-9a-f]+$/.test(t))try{return m(t)}catch{return}},v=e=>e>0?e>1?1:e:0,x={mode:"rgb",r:0,g:0,b:0,alpha:1},b=e=>Math.round(255e6*e)/255e6,_=e=>f(d({},e),{r:b(e.r),g:b(e.g),b:b(e.b)}),w=e=>n(_(e)),T=(e,t)=>{var r,i,n,a;let o=y(e);return o?(null!=o.alpha||(o.alpha=1),o):(t||null==e||l(`Invalid color specifier: ${"string"==typeof e?`"${e}"`:s(e)?`${null!=(i=null==(r=e.constructor)?void 0:r.name)?i:"Array"}(${e.length})`:"object"==typeof e?null!=(a=null==(n=e.constructor)?void 0:n.name)?a:"Object":`${typeof e} ${e}`}. Defaulting to "#000"`),x)},A=e=>w(f(d({},T(e)),{alpha:1})),M=e=>s(e)&&e.length>2&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2]),k=(e,t)=>{let r=T(e),i=r.alpha;if(1===i)return w(r);let n=T(t||u),a=n.alpha,o=(e,t)=>(1===a?t:1-a+t*a)*(1-i)+e*i;return w({mode:"rgb",r:o(r.r,n.r),g:o(r.g,n.g),b:o(r.b,n.b)})},S=(e,t)=>{let r=T(e),i=g(r)||{mode:"hsl",h:0,s:0,l:0};return w(m(f(d({},i),{l:v((100*i.l+t)/100),alpha:r.alpha})))},E=(e,t)=>a(T(e),T(t)),D=e=>E(e,u)>E(e,c),C=w(T(u)),I=w(T(c));t.exports={addOpacity:(e,t)=>w(f(d({},T(e)),{alpha:v(t)})),adjustLightness:S,background:u,brighten:(e,t)=>{t=0===t?0:t||10;let r=T(e),i=t/100;return w(f(d({},r),{r:v(r.r+i),g:v(r.g+i),b:v(r.b+i)}))},combine:k,contrast:(e,t,r)=>(1!==T(e).alpha&&(e=k(e,u)),D(e)?t?S(e,t):C:r?S(e,-r):I),defaultLine:c,defaults:h,equals:(e,t)=>!!(e&&t&&A(e)===A(t)),fill:(e,t)=>{e.style({fill:A(t),"fill-opacity":T(t).alpha})},hexString:e=>i(_(T(e))).toUpperCase(),interpolate:(e,t,r)=>{let i=T(e),n=T(t),a=(e,t)=>r*e+(1-r)*t;return w({mode:"rgb",r:a(i.r,n.r),g:a(i.g,n.g),b:a(i.b,n.b)})},isChannelArray:M,isDark:D,isValid:e=>void 0!==y(e),lightLine:p,luminosity:e=>{let t=T(e);return o({mode:"rgb",r:v(t.r),g:v(t.g),b:v(t.b)})},mix:(e,t,r)=>{let i=T(e),n=T(t),a=r/100,o=n.alpha-i.alpha,s=2*a-1,l=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,u=1-l,c=(e,t)=>u*e+l*t;return w({mode:"rgb",r:c(i.r,n.r),g:c(i.g,n.g),b:c(i.b,n.b),alpha:i.alpha*(1-a)+n.alpha*a})},mostReadable:(e,t=["#000","#fff"])=>{let r,i=-1/0;for(let n of t){let t=E(e,n);t>i&&(i=t,r=w(T(n)))}return r},normalize:(e,t)=>{let r=M(e)?(e=>{let[t,r,i,n]=e,a=Math.max(t,r,i)>1?1/255:1,o=n??1;return{mode:"rgb",r:t*a,g:r*a,b:i*a,alpha:o>1?o/255:o}})(e):T(e,!0),i=[v(r.r),v(r.g),v(r.b),v(r.alpha)];return"uint8"===t||"uint8_clamped"===t?Uint8Array.from(i,e=>Math.round(255*e)):"float32"===t?Float32Array.from(i):"float64"===t?Float64Array.from(i):i},opacity:e=>e?T(e).alpha:0,parse:T,rgb:A,rgbaArray:e=>{let t=T(e);return[255*v(t.r),255*v(t.g),255*v(t.b),v(t.alpha)]},rgbaArrayToString:([e,t,r,i])=>w({mode:"rgb",r:e/255,g:t/255,b:r/255,alpha:i}),rgbaString:e=>w(T(e)),stroke:(e,t)=>{e.style({stroke:A(t),"stroke-opacity":T(t).alpha})},wcagContrast:E}}}),ei=m({"src/components/colorscale/scales.js"(e,t){var r=er(),i={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},n=i.RdBu;function a(e){var t=0;if(!Array.isArray(e)||e.length<2||!e[0]||!e[e.length-1]||0!=+e[0][0]||1!=+e[e.length-1][0])return!1;for(var i=0;ieo});var es,el=p({"src/lib/regex.ts"(){es="([2-9]|[1-9][0-9]+)?"}}),eu=m({"src/lib/coerce.js"(e){var t=I(),r=H().extendFlat,i=X(),n=ei(),a=er(),o=en().DESELECTDIM,s=O(),l=(el(),x(ea)).counter,u=(G(),x(V)).modHalf,c=F().isArrayOrTypedArray,h=F().isTypedArraySpec,d=F().decodeTypedArraySpec;function f(t,r){var i=e.valObjectMeta[r.valType];if(r.arrayOk&&c(t))return!0;if(i.validateFunction)return i.validateFunction(t,r);var n={},a=n;return i.coerceFunction(t,{set:function(e){a=e}},n,r),a!==n}e.valObjectMeta={data_array:{coerceFunction:function(e,t,r){t.set(c(e)?e:h(e)?d(e):r)}},enumerated:{coerceFunction:function(e,t,r,i){i.coerceNumber&&(e*=1),-1===i.values.indexOf(e)?t.set(r):t.set(e)},validateFunction:function(e,t){t.coerceNumber&&(e*=1);for(var r=t.values,i=0;i!0===e||!1===e;n(e)||i.arrayOk&&Array.isArray(e)&&e.length>0&&e.every(n)?t.set(e):t.set(r)}},number:{coerceFunction:function(e,r,i,n){h(e)&&(e=d(e)),!t(e)||void 0!==n.min&&en.max?r.set(i):r.set(+e)}},integer:{coerceFunction:function(e,r,i,n){-1!==(n.extras||[]).indexOf(e)?r.set(e):(h(e)&&(e=d(e)),e%1||!t(e)||void 0!==n.min&&en.max?r.set(i):r.set(+e))}},string:{coerceFunction:function(e,t,r,i){if("string"!=typeof e){var n="number"==typeof e;!0!==i.strict&&n?t.set(String(e)):t.set(r)}else i.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){h(e)&&(e=d(e)),a.isValid(e)?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every(e=>a.isValid(e))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(n.get(e,r))}},angle:{coerceFunction:function(e,r,i){h(e)&&(e=d(e)),"auto"===e?r.set("auto"):t(e)?r.set(u(+e,360)):r.set(i)}},subplotid:{coerceFunction:function(e,t,r,i){var n=i.regex||l(r);let a=e=>"string"==typeof e&&n.test(e);a(e)||i.arrayOk&&c(e)&&e.length>0&&e.every(a)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!l(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,i){if(-1!==(i.extras||[]).indexOf(e))return void t.set(e);if("string"!=typeof e)return void t.set(r);for(var n=e.split("+"),a=0;aMath.abs(I)?null:(E*=I=1/I,D*=I,C*=I,n=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],l=t[1],u=t[2],c=t[3],h=t[4],d=t[5],f=t[6],p=t[7],m=t[8],g=t[9],y=t[10],v=t[11],x=E*E*o+a,b=D*E*o+C*n,_=C*E*o-D*n,w=E*D*o-C*n,T=D*D*o+a,A=C*D*o+E*n,M=E*C*o+D*n,k=D*C*o-E*n,S=C*C*o+a,e[0]=s*x+h*b+m*_,e[1]=l*x+d*b+g*_,e[2]=u*x+f*b+y*_,e[3]=c*x+p*b+v*_,e[4]=s*w+h*T+m*A,e[5]=l*w+d*T+g*A,e[6]=u*w+f*T+y*A,e[7]=c*w+p*T+v*A,e[8]=s*M+h*k+m*S,e[9]=l*M+d*k+g*S,e[10]=u*M+f*k+y*S,e[11]=c*M+p*k+v*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}}}),eA=m({"node_modules/gl-mat4/rotateX.js"(e,t){t.exports=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*i,e[5]=o*n+c*i,e[6]=s*n+h*i,e[7]=l*n+d*i,e[8]=u*n-a*i,e[9]=c*n-o*i,e[10]=h*n-s*i,e[11]=d*n-l*i,e}}}),eM=m({"node_modules/gl-mat4/rotateY.js"(e,t){t.exports=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-u*i,e[1]=o*n-c*i,e[2]=s*n-h*i,e[3]=l*n-d*i,e[8]=a*i+u*n,e[9]=o*i+c*n,e[10]=s*i+h*n,e[11]=l*i+d*n,e}}}),ek=m({"node_modules/gl-mat4/rotateZ.js"(e,t){t.exports=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(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[0]=a*n+u*i,e[1]=o*n+c*i,e[2]=s*n+h*i,e[3]=l*n+d*i,e[4]=u*n-a*i,e[5]=c*n-o*i,e[6]=h*n-s*i,e[7]=d*n-l*i,e}}}),eS=m({"node_modules/gl-mat4/fromRotation.js"(e,t){t.exports=function(e,t,r){var i,n,a,o=r[0],s=r[1],l=r[2],u=Math.sqrt(o*o+s*s+l*l);return 1e-6>Math.abs(u)?null:(o*=u=1/u,s*=u,l*=u,i=Math.sin(t),a=1-(n=Math.cos(t)),e[0]=o*o*a+n,e[1]=s*o*a+l*i,e[2]=l*o*a-s*i,e[3]=0,e[4]=o*s*a-l*i,e[5]=s*s*a+n,e[6]=l*s*a+o*i,e[7]=0,e[8]=o*l*a+s*i,e[9]=s*l*a-o*i,e[10]=l*l*a+n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}}}),eE=m({"node_modules/gl-mat4/fromRotationTranslation.js"(e,t){t.exports=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=i+i,l=n+n,u=a+a,c=i*s,h=i*l,d=i*u,f=n*l,p=n*u,m=a*u,g=o*s,y=o*l,v=o*u;return e[0]=1-(f+m),e[1]=h+v,e[2]=d-y,e[3]=0,e[4]=h-v,e[5]=1-(c+m),e[6]=p+g,e[7]=0,e[8]=d+y,e[9]=p-g,e[10]=1-(c+f),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}}}),eD=m({"node_modules/gl-mat4/fromScaling.js"(e,t){t.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),eC=m({"node_modules/gl-mat4/fromTranslation.js"(e,t){t.exports=function(e,t){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]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}}}),eI=m({"node_modules/gl-mat4/fromXRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),eL=m({"node_modules/gl-mat4/fromYRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),eP=m({"node_modules/gl-mat4/fromZRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=i,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}}}),ez=m({"node_modules/gl-mat4/fromQuat.js"(e,t){t.exports=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r+r,s=i+i,l=n+n,u=r*o,c=i*o,h=i*s,d=n*o,f=n*s,p=n*l,m=a*o,g=a*s,y=a*l;return e[0]=1-h-p,e[1]=c+y,e[2]=d-g,e[3]=0,e[4]=c-y,e[5]=1-u-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),eF=m({"node_modules/gl-mat4/frustum.js"(e,t){t.exports=function(e,t,r,i,n,a,o){var s=1/(r-t),l=1/(n-i),u=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(n+i)*l,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0,e}}}),eO=m({"node_modules/gl-mat4/perspective.js"(e,t){t.exports=function(e,t,r,i,n){var a=1/Math.tan(t/2),o=1/(i-n);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(n+i)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*n*i*o,e[15]=0,e}}}),eR=m({"node_modules/gl-mat4/perspectiveFromFieldOfView.js"(e,t){t.exports=function(e,t,r,i){var n=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(n+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((o-s)*l*.5),e[9]=(n-a)*u*.5,e[10]=i/(r-i),e[11]=-1,e[12]=0,e[13]=0,e[14]=i*r/(r-i),e[15]=0,e}}}),eB=m({"node_modules/gl-mat4/ortho.js"(e,t){t.exports=function(e,t,r,i,n,a,o){var s=1/(t-r),l=1/(i-n),u=1/(a-o);return e[0]=-2*s,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*u,e[11]=0,e[12]=(t+r)*s,e[13]=(n+i)*l,e[14]=(o+a)*u,e[15]=1,e}}}),ej=m({"node_modules/gl-mat4/lookAt.js"(e,t){var r=em();t.exports=function(e,t,i,n){var a,o,s,l,u,c,h,d,f,p,m=t[0],g=t[1],y=t[2],v=n[0],x=n[1],b=n[2],_=i[0],w=i[1],T=i[2];return 1e-6>Math.abs(m-_)&&1e-6>Math.abs(g-w)&&1e-6>Math.abs(y-T)?r(e):(p=1/Math.sqrt((h=m-_)*h+(d=g-w)*d+(f=y-T)*f),h*=p,d*=p,f*=p,(p=Math.sqrt((a=x*f-b*d)*a+(o=b*h-v*f)*o+(s=v*d-x*h)*s))?(a*=p=1/p,o*=p,s*=p):(a=0,o=0,s=0),(p=Math.sqrt((l=d*s-f*o)*l+(u=f*a-h*s)*u+(c=h*o-d*a)*c))?(l*=p=1/p,u*=p,c*=p):(l=0,u=0,c=0),e[0]=a,e[1]=l,e[2]=h,e[3]=0,e[4]=o,e[5]=u,e[6]=d,e[7]=0,e[8]=s,e[9]=c,e[10]=f,e[11]=0,e[12]=-(a*m+o*g+s*y),e[13]=-(l*m+u*g+c*y),e[14]=-(h*m+d*g+f*y),e[15]=1,e)}}}),eN=m({"node_modules/gl-mat4/str.js"(e,t){t.exports=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]+")"}}}),eV=m({"node_modules/gl-mat4/index.js"(e,t){t.exports={create:ed(),clone:ef(),copy:ep(),identity:em(),transpose:eg(),invert:ey(),adjoint:ev(),determinant:ex(),multiply:eb(),translate:e_(),scale:ew(),rotate:eT(),rotateX:eA(),rotateY:eM(),rotateZ:ek(),fromRotation:eS(),fromRotationTranslation:eE(),fromScaling:eD(),fromTranslation:eC(),fromXRotation:eI(),fromYRotation:eL(),fromZRotation:eP(),fromQuat:ez(),frustum:eF(),perspective:eO(),perspectiveFromFieldOfView:eR(),ortho:eB(),lookAt:ej(),str:eN()}}}),eU=m({"src/lib/matrix.js"(e){var t=eV();e.init2dArray=function(e,t){for(var r=Array(e),i=0;id({valType:"string",dflt:"",editType:e},!1!==t?{arrayOk:!0}:{}),e.texttemplateAttrs=({editType:e="calc",arrayOk:t}={},r={})=>d({valType:"string",dflt:"",editType:e},!1!==t?{arrayOk:!0}:{}),e.shapeTexttemplateAttrs=({editType:e="arraydraw",newshape:t}={},r={})=>({valType:"string",dflt:"",editType:e}),e.templatefallbackAttrs=({editType:e="none"}={})=>({valType:"any",dflt:"-",editType:e})}}),eZ=m({"src/components/shapes/label_texttemplate.js"(e,t){function r(e,t){return t?t.d2l(e):e}function i(e){return e.x0shift||0}function n(e){return e.x1shift||0}function a(e){return e.y0shift||0}function o(e){return e.y1shift||0}function s(e,t){return r(e.x1,t)+n(e)-r(e.x0,t)-i(e)}function l(e,t,i){return r(e.y1,i)+o(e)-r(e.y0,i)-a(e)}t.exports={x0:function(e){return e.x0},x1:function(e){return e.x1},y0:function(e){return e.y0},y1:function(e){return e.y1},slope:function(e,t,r){return"line"!==e.type?void 0:l(e,t,r)/s(e,t)},dx:s,dy:l,width:function(e,t){return Math.abs(s(e,t))},height:function(e,t,r){return Math.abs(l(e,t,r))},length:function(e,t,r){return"line"!==e.type?void 0:Math.sqrt(Math.pow(s(e,t),2)+Math.pow(l(e,t,r),2))},xcenter:function(e,t){var a;return a=(r(e.x1,t)+n(e)+r(e.x0,t)+i(e))/2,t?t.l2d(a):a},ycenter:function(e,t,i){var n;return n=(r(e.y1,i)+o(e)+r(e.y0,i)+a(e))/2,i?i.l2d(n):n},simpleXVariables:["x0","x1","y0","y1","dy","height","ycenter"],simpleYVariables:["x0","x1","y0","y1","dx","width","xcenter"]}}}),eX=m({"src/components/shapes/draw_newshape/attributes.js"(e,t){var r=eH().overrideAll,i=X(),n=$(),a=e$().dash,o=H().extendFlat,{shapeTexttemplateAttrs:s,templatefallbackAttrs:l}=eY(),u=eZ();t.exports=r({newshape:{visible:o({},i.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:o({},i.legend,{}),legendgroup:o({},i.legendgroup,{}),legendgrouptitle:{text:o({},i.legendgrouptitle.text,{}),font:n({})},legendrank:o({},i.legendrank,{}),legendwidth:o({},i.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:o({},a,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:o({},i.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:s({newshape:!0},{keys:Object.keys(u)}),texttemplatefallback:l({editType:"arraydraw"}),font:n({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),eK=m({"src/components/selections/draw_newselection/attributes.js"(e,t){var r=e$().dash;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:(0,H().extendFlat)({},r,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),eJ=m({"src/plots/pad_attributes.js"(e,t){t.exports=function(e){var t=e.editType;return{t:{valType:"number",dflt:0,editType:t},r:{valType:"number",dflt:0,editType:t},b:{valType:"number",dflt:0,editType:t},l:{valType:"number",dflt:0,editType:t},editType:t}}}}),eQ=m({"src/plots/layout_attributes.js"(e,t){var r=$(),i=eG(),n=et(),a=eX(),o=eK(),s=eJ(),l=H().extendFlat,u=r({editType:"calc"});u.family.dflt='"Open Sans", verdana, arial, sans-serif',u.size.dflt=12,u.color.dflt=n.defaultLine,t.exports={font:u,title:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:l(s({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:n.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:n.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:n.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:a.newshape,activeshape:a.activeshape,newselection:o.newselection,activeselection:o.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:l({},i.transition,{editType:"none"})}}}),e0=m({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){if(!document.getElementById("9f215cf04c5486422605d13261cb87401f4e7763b6296af81e98efbc0130da53")){var e=document.createElement("style");e.id="9f215cf04c5486422605d13261cb87401f4e7763b6296af81e98efbc0130da53",e.textContent='.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media (hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22none%22%20stroke%3D%22%23333%22%20viewBox%3D%220%200%2022%2022%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M17.5%2011c0%204.819-3.02%208.5-6.5%208.5S4.5%2015.819%204.5%2011%207.52%202.5%2011%202.5s6.5%203.681%206.5%208.5Z%22%2F%3E%3Cpath%20d%3D%22M13.5%2011c0%202.447-.331%204.64-.853%206.206-.262.785-.562%201.384-.872%201.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831%2015.64%208.5%2013.446%208.5%2011s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872%201.777.522%201.565.853%203.76.853%206.206Z%22%2F%3E%3Cpath%20d%3D%22M11%207.5c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138q.07-.058.224-.138c.299-.151.763-.302%201.379-.434C7.378%205.666%209.091%205.5%2011%205.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0%209c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138%201.3%201.3%200%200%201%20.224-.138c.299-.151.763-.302%201.379-.434C7.378%2014.666%209.091%2014.5%2011%2014.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138a1.3%201.3%200%200%201-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0-4c-2.46%200-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5%201.5%200%200%201-.39-.272.3.3%200%200%201-.047-.064.3.3%200%200%201%20.048-.064c.066-.073.189-.167.389-.272.399-.21%201.009-.413%201.805-.59C6.328%209.722%208.54%209.5%2011%209.5s4.672.222%206.256.574c.795.177%201.405.38%201.804.59.2.105.323.2.39.272a.3.3%200%200%201%20.047.064.3.3%200%200%201-.048.064%201.4%201.4%200%200%201-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0%20.018v.002zm17.002.002v-.002zm0-.018v-.002z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22none%22%20stroke%3D%22%2333b5e5%22%20viewBox%3D%220%200%2022%2022%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M17.5%2011c0%204.819-3.02%208.5-6.5%208.5S4.5%2015.819%204.5%2011%207.52%202.5%2011%202.5s6.5%203.681%206.5%208.5Z%22%2F%3E%3Cpath%20d%3D%22M13.5%2011c0%202.447-.331%204.64-.853%206.206-.262.785-.562%201.384-.872%201.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831%2015.64%208.5%2013.446%208.5%2011s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872%201.777.522%201.565.853%203.76.853%206.206Z%22%2F%3E%3Cpath%20d%3D%22M11%207.5c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138q.07-.058.224-.138c.299-.151.763-.302%201.379-.434C7.378%205.666%209.091%205.5%2011%205.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0%209c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138%201.3%201.3%200%200%201%20.224-.138c.299-.151.763-.302%201.379-.434C7.378%2014.666%209.091%2014.5%2011%2014.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138a1.3%201.3%200%200%201-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0-4c-2.46%200-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5%201.5%200%200%201-.39-.272.3.3%200%200%201-.047-.064.3.3%200%200%201%20.048-.064c.066-.073.189-.167.389-.272.399-.21%201.009-.413%201.805-.59C6.328%209.722%208.54%209.5%2011%209.5s4.672.222%206.256.574c.795.177%201.405.38%201.804.59.2.105.323.2.39.272a.3.3%200%200%201%20.047.064.3.3%200%200%201-.048.064%201.4%201.4%200%200%201-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0%20.018v.002zm17.002.002v-.002zm0-.018v-.002z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cpath%20d%3D%22m1.754%2013.406%204.453-4.851%203.09%203.09%203.281%203.277.969-.969-3.309-3.312%203.844-4.121%206.148%206.886h1.082v-.855l-7.207-8.07-4.84%205.187L6.169%206.57l-5.48%205.965v.871ZM.688%2016.844h20.625v1.375H.688Zm0%200%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cpath%20d%3D%22m1.754%2013.406%204.453-4.851%203.09%203.09%203.281%203.277.969-.969-3.309-3.312%203.844-4.121%206.148%206.886h1.082v-.855l-7.207-8.07-4.84%205.187L6.169%206.57l-5.48%205.965v.871ZM.688%2016.844h20.625v1.375H.688Zm0%200%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23aaa%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e58978%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e54e33%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23999%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e58978%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e54e33%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23666%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@media (prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:rgba(0,0,0,.4);position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}',document.head.appendChild(e)}}}),e1=m({"src/registry.js"(e){var t=ee(),r=ec(),i=eh(),n=(eq().addStyleRule,H()),a=X(),o=eQ(),s=n.extendFlat,l=n.extendDeepAll;function u(t){if(t.layoutAttributes){var r=t.layoutAttributes._arrayAttrRegexps;if(r)for(var n=0;n=t&&i<=r?i:l}if("string"!=typeof i&&"number"!=typeof i)return l;i=String(i);var x=b(n),_=i.charAt(0);x&&("G"===_||"g"===_)&&(i=i.slice(1),n="");var w=x&&"chinese"===n.slice(0,7),T=i.match(w?y:g);if(!T)return l;var A=T[1],M=T[3]||"1",k=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),D=Number(T[11]||0);if(x){if(2===A.length)return l;A=Number(A);try{var C,I=p.getComponentMethod("calendars","getCal")(n);if(w){var L="i"===M.charAt(M.length-1);M=parseInt(M,10),C=I.newDate(A,I.toMonthIndex(A,M,L),k)}else C=I.newDate(A,Number(M),k)}catch{return l}return C?(C.toJD()-f)*u+S*c+E*h+D*d:l}A=2===A.length?(Number(A)+2e3-v)%100+v:Number(A);var P=new Date(Date.UTC(2e3,M-=1,k,S,E));return P.setUTCFullYear(A),P.getUTCMonth()!==M||P.getUTCDate()!==k?l:P.getTime()+D*d},t=e.MIN_MS=e.dateTime2ms("-9999"),r=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(t,r){return e.dateTime2ms(t,r)!==l};var w=90*u,T=3*c,A=5*h;function M(e,t,r,i,n){if((t||r||i||n)&&(e+=" "+_(t,2)+":"+_(r,2),(i||n)&&(e+=":"+_(i,2),n))){for(var a=4;n%10==0;)a-=1,n/=10;e+="."+_(n,a)}return e}e.ms2DateTime=function(e,i,n){if("number"!=typeof e||!(e>=t&&e<=r))return l;i||(i=0);var a,s,g,y,v,x,_=Math.floor(10*o(e+.05,1)),k=Math.round(e-_/10);if(b(n)){var S=Math.floor(k/u)+f,E=Math.floor(o(e,u));try{a=p.getComponentMethod("calendars","getCal")(n).fromJD(S).formatDate("yyyy-mm-dd")}catch{a=m("G%Y-%m-%d")(new Date(k))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.slice(1);else for(;a.length<10;)a="0"+a;s=i=t+u&&e<=r-u))return l;var n=Math.floor(10*o(e+.05,1)),a=new Date(Math.round(e-n/10));return M(i("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+n)},e.cleanDate=function(t,r,i){if(t===l)return r;if(e.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(i))return a.error("JS Dates and milliseconds are incompatible with world calendars",t),r;if(!(t=e.ms2DateTimeLocal(+t))&&void 0!==r)return r}else if(!e.isDateTime(t,i))return a.error("unrecognized date",t),r;return t};var k=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function C(e,t,r,i){e=e.replace(k,function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).slice(2).replace(/0+$/,"")||"0"});var n=new Date(Math.floor(t+.05));if(e=e.replace(S,function(){return D[r("%q")(n)]}),b(i))try{e=p.getComponentMethod("calendars","worldCalFmt")(e,t,i)}catch{return"Invalid"}return r(e)(n)}var P=[59,59.9,59.99,59.999,59.9999];e.formatDate=function(e,t,r,i,a,s){if(a=b(a)&&a,!t)if("y"===r)t=s.year;else if("m"===r)t=s.month;else{if("d"!==r)return function(e,t){var r=o(e+.05,u),i=_(Math.floor(r/c),2)+":"+_(o(Math.floor(r/h),60),2);if("M"!==t){n(t)||(t=0);var a=(100+Math.min(o(e/d,60),P[t])).toFixed(t).slice(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),i+=":"+a}return i}(e,r)+` +`+C(s.dayMonthYear,e,i,a);t=s.dayMonth+` +`+s.year}return C(t,e,i,a)};var z=3*u;e.incrementMonth=function(e,t,r){r=b(r)&&r;var i=o(e,u);if(e=Math.round(e-i),r)try{var n=Math.round(e/u)+f,s=p.getComponentMethod("calendars","getCal")(r),l=s.fromJD(n);return t%12?s.add(l,t,"m"):s.add(l,t/12,"y"),(l.toJD()-f)*u+i}catch{a.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+z);return c.setUTCMonth(c.getUTCMonth()+t)+i-z},e.findExactDates=function(e,t){for(var r,i,a=0,o=0,s=0,l=0,c=b(t)&&p.getComponentMethod("calendars","getCal")(t),h=0;ht}function l(e,t){return e>=t}e.findBin=function(e,i,n){if(t(i.start))return n?Math.ceil((e-i.start)/i.size-1e-9)-1:Math.floor((e-i.start)/i.size+1e-9);var u,c,h=0,d=i.length,f=0,p=d>1?(i[d-1]-i[0])/(d-1):1;for(c=p>=0?n?a:o:n?l:s,e+=1e-9*p*(n?-1:1)*(p>=0?1:-1);h90&&r.log("Long binary search..."),h-1},e.sorterAsc=function(e,t){return e-t},e.sorterDes=function(e,t){return t-e},e.distinctVals=function(t){var r=t.slice();for(r.sort(e.sorterAsc),i=r.length-1;i>-1&&r[i]===n;i--);for(var i,a,o=r[i]-r[0]||1,s=o/(i||1)/1e4,l=[],u=0;u<=i;u++){var c=r[u],h=c-a;void 0===a?(l.push(c),a=c):h>s&&(o=Math.min(o,h),l.push(c),a=c)}return{vals:l,minDiff:o}},e.roundUp=function(e,t,r){for(var i,n=0,a=t.length-1,o=0,s=+!r,l=+!!r,u=r?Math.ceil:Math.floor;n0&&(i=1),r&&i)return e.sort(t)}return i?e:e.reverse()},e.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ae8});var e8,e7=p({"src/lib/sort_object_keys.ts"(){e8=e6}}),e9=m({"src/lib/stats.js"(e){var t=I(),r=F().isArrayOrTypedArray;e.aggNums=function(i,n,a,o){var s,l;if((!o||o>a.length)&&(o=a.length),t(n)||(n=!1),r(a[0])){for(l=Array(o),s=0;se.length-1)return e[e.length-1];var i=r%1;return i*e[Math.ceil(r)]+(1-i)*e[Math.floor(r)]}}}),te=m({"src/lib/angles.js"(e,t){var r=(G(),x(V)),i=r.mod,n=r.modHalf,a=Math.PI,o=2*a;function s(e){return Math.abs(e[1]-e[0])>o-1e-14}function l(e,t){return n(t-e,o)}function u(e,t){if(s(t))return!0;t[0](n=i(n,o))&&(n+=o);var r,n,a=i(e,o),l=a+o;return a>=r&&a<=n||l>=r&&l<=n}function c(e,t,r,i,n,l,u){n=n||0,l=l||0;var c,h,d,f,p,m,g=s([r,i]);function y(e,t){return[e*Math.cos(t)+n,l-e*Math.sin(t)]}g?(h=0,d=a,f=o):r=n&&e<=a)},pathArc:function(e,t,r,i,n){return c(null,e,t,r,i,n,0)},pathSector:function(e,t,r,i,n){return c(null,e,t,r,i,n,1)},pathAnnulus:function(e,t,r,i,n,a){return c(e,t,r,i,n,a,1)}}}}),tt=m({"src/lib/anchor_utils.js"(e){e.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},e.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},e.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},e.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},e.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},e.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}}}),tr=m({"src/lib/geometry2d.js"(e){var t,r,i,n=(G(),x(V)).mod;function a(e,t,r,i,n,a,o,s){var l=r-e,u=n-e,c=o-n,h=i-t,d=a-t,f=s-a,p=l*f-c*h;if(0===p)return null;var m=(u*f-c*d)/p,g=(u*h-l*d)/p;return g<0||g>1||m<0||m>1?null:{x:e+l*m,y:t+h*m}}function o(e,t,r,i,n){var a=i*e+n*t;if(a<0)return i*i+n*n;if(a>r){var o=i-e,s=n-t;return o*o+s*s}var l=i*t-n*e;return l*l/r}e.segmentsIntersect=a,e.segmentDistance=function(e,t,r,i,n,s,l,u){if(a(e,t,r,i,n,s,l,u))return 0;var c=r-e,h=i-t,d=l-n,f=u-s,p=c*c+h*h,m=d*d+f*f;return Math.sqrt(Math.min(o(c,h,p,n-e,s-t),o(c,h,p,l-e,u-t),o(d,f,m,e-n,t-s),o(d,f,m,r-n,i-s)))},e.getTextLocation=function(e,a,o,s){if((e!==r||s!==i)&&(t={},r=e,i=s),t[o])return t[o];var l=e.getPointAtLength(n(o-s/2,a)),u=e.getPointAtLength(n(o+s/2,a)),c=Math.atan((u.y-l.y)/(u.x-l.x)),h=e.getPointAtLength(n(o,a)),d={x:(4*h.x+l.x+u.x)/6,y:(4*h.y+l.y+u.y)/6,theta:c};return t[o]=d,d},e.clearLocationCache=function(){r=null},e.getVisibleSegment=function(e,t,r){var i,n,a=t.left,o=t.right,s=t.top,l=t.bottom,u=0,c=e.getTotalLength(),h=c;function d(t){var r=e.getPointAtLength(t);0===t?i=r:t===c&&(n=r);var u=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(u*u+h*h)}for(var f=d(u);f;){if((u+=f+r)>h)return;f=d(u)}for(f=d(h);f;){if(u>(h-=f+r))return;f=d(h)}return{min:u,max:h,len:h-u,total:c,isClosed:0===u&&h===c&&.1>Math.abs(i.x-n.x)&&.1>Math.abs(i.y-n.y)}},e.findPointOnPath=function(e,t,r,i){i=i||{};for(var n,a,o,s=i.pathLength||e.getTotalLength(),l=i.tolerance||.001,u=i.iterationLimit||30,c=e.getPointAtLength(0)[r]>e.getPointAtLength(s)[r]?-1:1,h=0,d=0,f=s;h0?f=n:d=n,h++;return a}}}),ti=m({"src/lib/throttle.js"(e){var t={};function r(e){e&&null!==e.timer&&(clearTimeout(e.timer),e.timer=null)}e.throttle=function(e,i,n){var a=t[e],o=Date.now();if(!a){for(var s in t)t[s].tsa.ts+i)?l():a.timer=setTimeout(function(){l(),a.timer=null},i)},e.done=function(e){var r=t[e];return r&&r.timer?new Promise(function(e){var t=r.onDone;r.onDone=function(){t&&t(),e(),r.onDone=null}}):Promise.resolve()},e.clear=function(i){if(i)r(t[i]),delete t[i];else for(var n in t)e.clear(n)}}}),tn=m({"src/lib/clear_responsive.js"(e,t){t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)}}}),ta=m({"node_modules/is-mobile/index.js"(e,t){t.exports=a,t.exports.isMobile=a,t.exports.default=a;var r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/CrOS/,n=/android|ipad|playbook|silk/i;function a(e){e||(e={});let t=e.ua;if(!t&&"u">typeof navigator&&(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;let a=r.test(t)&&!i.test(t)||!!e.tablet&&n.test(t);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(a=!0),a}}}),to=m({"src/lib/preserve_drawing_buffer.js"(e,t){var r=I(),i=ta();t.exports=function(e){if("string"!=typeof(n=e&&e.hasOwnProperty("userAgent")?e.userAgent:("u">typeof navigator&&(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),t)))return!0;var t,n,a=i({ua:{headers:{"user-agent":n}},tablet:!0,featureDetect:!1});if(!a){for(var o=n.split(" "),s=1;s-1;l--){var u=o[l];if("Version/"===u.slice(0,8)){var c=u.slice(8).split(".")[0];if(r(c)&&(c*=1),c>=13)return!0}}}return a}}}),ts=m({"src/lib/make_trace_groups.js"(e,t){var r=M();t.exports=function(e,t,i){var n=e.selectAll("g."+i.replace(/\s/g,".")).data(t,function(e){return e[0].trace.uid});n.exit().remove(),n.enter().append("g").attr("class",i),n.order();var a=e.classed("rangeplot")?"nodeRangePlot3":"node3";return n.each(function(e){e[0][a]=r.select(this)}),n}}}),tl=m({"src/lib/localize.js"(e,t){var r=e1();t.exports=function(e,t){for(var i=e._context.locale,n=0;n<2;n++){for(var a=e._context.locales,o=0;o<2;o++){var s=(a[i]||{}).dictionary;if(s){var l=s[t];if(l)return l}a=r.localeRegistry}var u=i.split("-")[0];if(u===i)break;i=u}return t}}}),tu=m({"src/lib/filter_unique.js"(e,t){t.exports=function(e){for(var t={},r=[],i=0,n=0;n1?(r*e+r*t)/r:e+t,n=String(i).length;if(n>16){var a=String(t).length;if(n>=String(e).length+a){var o=parseFloat(i).toPrecision(12);-1===o.indexOf("e+")&&(i=+o)}}return i}}}),td={};function tf(e){return"string"==typeof e&&(e=e.replace(tg,"")),(0,tp.default)(e)?Number(e):tm.BADNUM}g(td,{default:()=>ty});var tp,tm,tg,ty,tv=p({"src/lib/clean_number.ts"(){tp=v(I()),tm=v(L()),tg=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,ty=tf}}),tx=m({"src/lib/slugify.js"(e,t){var r=/<[^>]*>/g,i=/[\p{S}\p{P}]/gu,n=/[\p{Cc}\p{Cf}\uFE00-\uFE0F\u20E3]/gu,a=/�/g,o=/\s+/g,s="-".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=RegExp(s+"{3,}","g"),u=RegExp(s+"$","g");t.exports=function(e,t=60){var s,c=("function"==typeof(s=e??"").toWellFormed?s.toWellFormed():new TextDecoder().decode(new TextEncoder().encode(s))).replace(a,"").replace(r," ").replace(i,e=>"-"===e?e:"").toLowerCase().trim().replace(o,"-").replace(n,"").replace(l,"-");return c.length<=t?c:Array.from(c).slice(0,t).join("").replace(u,"")}}}),tb=m({"src/lib/index.js"(e,t){var r=M(),i=E().utcFormat,n=D().format,a=I(),o=L(),s=o.FP_SAFE,l=-s,u=o.BADNUM,c=t.exports={};c.adjustFormat=function(e){if(!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e))return e;if("0.f"===e)return"~f";if(/^\d%/.test(e))return"~%";if(/^\ds/.test(e))return"~s";var t=(e.match(/^[+\-( ]?/)||[""])[0],r=e.slice(t.length);return!/^[~,.0$#]/.test(r)&&/[&fps]/.test(r)?t+"~"+r:e};var h={};c.warnBadFormat=function(e){var t=String(e);h[t]||(h[t]=1,c.warn('encountered bad format: "'+t+'"'))},c.noFormat=function(e){return String(e)},c.numberFormat=function(e){var t;try{t=n(c.adjustFormat(e))}catch{return c.warnBadFormat(e),c.noFormat}return t},c.nestedProperty=O(),c.keyedContainer=R(),c.relativeAttr=B(),c.isPlainObject=z(),c.toLogRange=j(),c.relinkPrivateKeys=N();var p=F();c.isArrayBuffer=p.isArrayBuffer,c.isTypedArray=p.isTypedArray,c.isArrayOrTypedArray=p.isArrayOrTypedArray,c.isArray1D=p.isArray1D,c.ensureArray=p.ensureArray,c.concat=p.concat,c.maxRowLength=p.maxRowLength,c.minRowLength=p.minRowLength;var m=(G(),x(V));c.mod=m.mod,c.modHalf=m.modHalf;var g=eu();c.valObjectMeta=g.valObjectMeta,c.coerce=g.coerce,c.coerce2=g.coerce2,c.coerceFont=g.coerceFont,c.coercePattern=g.coercePattern,c.coerceHoverinfo=g.coerceHoverinfo,c.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,c.validate=g.validate;var y=e2();c.dateTime2ms=y.dateTime2ms,c.isDateTime=y.isDateTime,c.ms2DateTime=y.ms2DateTime,c.ms2DateTimeLocal=y.ms2DateTimeLocal,c.cleanDate=y.cleanDate,c.isJSDate=y.isJSDate,c.formatDate=y.formatDate,c.incrementMonth=y.incrementMonth,c.dateTick0=y.dateTick0,c.dfltRange=y.dfltRange,c.findExactDates=y.findExactDates,c.MIN_MS=y.MIN_MS,c.MAX_MS=y.MAX_MS;var v=e5();c.findBin=v.findBin,c.sorterAsc=v.sorterAsc,c.sorterDes=v.sorterDes,c.distinctVals=v.distinctVals,c.roundUp=v.roundUp,c.sort=v.sort,c.findIndexOfMin=v.findIndexOfMin,c.sortObjectKeys=(e7(),x(e4)).default;var b=e9();c.aggNums=b.aggNums,c.len=b.len,c.mean=b.mean,c.geometricMean=b.geometricMean,c.median=b.median,c.midRange=b.midRange,c.variance=b.variance,c.stdev=b.stdev,c.interp=b.interp;var _=eU();c.init2dArray=_.init2dArray,c.transposeRagged=_.transposeRagged,c.dot=_.dot,c.translationMatrix=_.translationMatrix,c.rotationMatrix=_.rotationMatrix,c.rotationXYMatrix=_.rotationXYMatrix,c.apply3DTransform=_.apply3DTransform,c.apply2DTransform=_.apply2DTransform,c.apply2DTransform2=_.apply2DTransform2,c.convertCssMatrix=_.convertCssMatrix,c.inverseTransformMatrix=_.inverseTransformMatrix;var w=te();c.deg2rad=w.deg2rad,c.rad2deg=w.rad2deg,c.angleDelta=w.angleDelta,c.angleDist=w.angleDist,c.isFullCircle=w.isFullCircle,c.isAngleInsideSector=w.isAngleInsideSector,c.isPtInsideSector=w.isPtInsideSector,c.pathArc=w.pathArc,c.pathSector=w.pathSector,c.pathAnnulus=w.pathAnnulus;var T=tt();c.isLeftAnchor=T.isLeftAnchor,c.isCenterAnchor=T.isCenterAnchor,c.isRightAnchor=T.isRightAnchor,c.isTopAnchor=T.isTopAnchor,c.isMiddleAnchor=T.isMiddleAnchor,c.isBottomAnchor=T.isBottomAnchor;var A=tr();c.segmentsIntersect=A.segmentsIntersect,c.segmentDistance=A.segmentDistance,c.getTextLocation=A.getTextLocation,c.clearLocationCache=A.clearLocationCache,c.getVisibleSegment=A.getVisibleSegment,c.findPointOnPath=A.findPointOnPath;var k=H();c.extendFlat=k.extendFlat,c.extendDeep=k.extendDeep,c.extendDeepAll=k.extendDeepAll,c.extendDeepNoArrays=k.extendDeepNoArrays;var S=ee();c.log=S.log,c.warn=S.warn,c.error=S.error,c.counterRegex=(el(),x(ea)).counter;var C=ti();c.throttle=C.throttle,c.throttleDone=C.done,c.clearThrottle=C.clear;var P=eq();c.getGraphDiv=P.getGraphDiv,c.isPlotDiv=P.isPlotDiv,c.removeElement=P.removeElement,c.addStyleRule=P.addStyleRule,c.addRelatedStyleRule=P.addRelatedStyleRule,c.deleteRelatedStyleRule=P.deleteRelatedStyleRule,c.setStyleOnHover=P.setStyleOnHover,c.getFullTransformMatrix=P.getFullTransformMatrix,c.getElementTransformMatrix=P.getElementTransformMatrix,c.getElementAndAncestors=P.getElementAndAncestors,c.equalDomRects=P.equalDomRects,c.clearResponsive=tn(),c.preserveDrawingBuffer=to(),c.makeTraceGroups=ts(),c._=tl(),c.notifier=Q(),c.filterUnique=tu(),c.filterVisible=tc(),c.pushUnique=eh(),c.increment=th(),c.cleanNumber=(tv(),x(td)).default,c.slugify=tx(),c.ensureNumber=function(e){return a(e)?(e=Number(e))>s||e=t))&&a(e)&&e>=0&&e%1==0},c.noop=ec(),c.identity=e3(),c.repeat=function(e,t){for(var r=Array(t),i=0;ir?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},c.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},c.simpleMap=function(e,t,r,i,n){for(var a=e.length,o=Array(a),s=0;s=Math.pow(2,r)?n>10?(c.warn("randstr failed uniqueness"),s):e(t,r,i,(n||0)+1):s},c.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={};return r.optionList=[],r._newoption=function(i){i[t]=e,r[i.name]=i,r.optionList.push(i)},r["_"+t]=e,r},c.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,i,n,a,o=e.length,s=2*o,l=2*t-1,u=Array(l),c=Array(o);for(r=0;r=s&&(n-=s*Math.floor(n/s)),n<0?n=-1-n:n>=o&&(n=s-1-n),a+=e[n]*u[i];c[r]=a}return c},c.syncOrAsync=function(e,t,r){var i;function n(){return c.syncOrAsync(e,t,r)}for(;e.length;)if((i=(0,e.splice(0,1)[0])(t))&&i.then)return i.then(n);return r&&r(t)},c.stripTrailingSlash=function(e){return"/"===e.slice(-1)?e.slice(0,-1):e},c.noneOrAll=function(e,t,r){if(e){var i,n=!1,a=!0;for(i=0;i0?t:0})},c.fillArray=function(e,t,r,i){if(i=i||c.identity,c.isArrayOrTypedArray(e))for(var n=0;n$.test(window.navigator.userAgent);var W=/Firefox\/(\d+)\.\d+/;c.getFirefoxVersion=function(){var e=W.exec(window.navigator.userAgent);if(e&&2===e.length){var t=parseInt(e[1]);if(!isNaN(t))return t}return null},c.isD3Selection=function(e){return e instanceof r.selection},c.ensureSingle=function(e,t,r,i){var n=e.select(t+(r?"."+r:""));if(n.size())return n;var a=e.append(t);return r&&a.classed(r,!0),i&&a.call(i),a},c.ensureSingleById=function(e,t,r,i){var n=e.select(t+"#"+r);if(n.size())return n;var a=e.append(t).attr("id",r);return i&&a.call(i),a},c.objectFromPath=function(e,t){for(var r,i=e.split("."),n=r={},a=0;a1?n+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;i.test(s);)s=s.replace(i,"$1"+a+"$2");return s+l},c.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var K=/^\w*$/;c.templateString=function(e,t){var r={};return e.replace(c.TEMPLATE_STRING_REGEX,function(e,i){var n;return K.test(i)?n=t[i]:(r[i]=r[i]||c.nestedProperty(t,i).get,n=r[i](!0)),void 0!==n?n:""})};var J={max:10,count:0,name:"hovertemplate"};c.hovertemplateString=e=>eo(f(d({},e),{opts:J}));var et={max:10,count:0,name:"texttemplate"};c.texttemplateString=e=>eo(f(d({},e),{opts:et}));var er=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,ei={max:10,count:0,name:"texttemplate",parseMultDiv:!0};c.texttemplateStringForShapes=e=>eo(f(d({},e),{opts:ei}));var en=/^[:|\|]/;function eo({data:e=[],locale:t,fallback:r,labels:n={},opts:a,template:o}){return o.replace(c.TEMPLATE_STRING_REGEX,(o,s,l)=>{let u,h=["xother","yother"].includes(s),d=["_xother","_yother"].includes(s),f=["_xother_","_yother_"].includes(s),p=["xother_","yother_"].includes(s),m=h||d||p||f;(d||f)&&(s=s.substring(1)),(p||f)&&(s=s.substring(0,s.length-1));let g=null,y=null;if(a.parseMultDiv){var v,x,b,_=(x=(v=s).match(er))?{key:x[1],op:x[2],number:Number(x[3])}:{key:v,op:null,number:null};s=_.key,g=_.op,y=_.number}if(m){if(void 0===n[s])return"";u=n[s]}else for(let t of e)if(t){if(t.hasOwnProperty(s)){u=t[s];break}if(K.test(s)||(u=c.nestedProperty(t,s).get(!0)),void 0!==u)break}if(void 0===u){let{count:e,max:t,name:i}=a,n=!1===r?o:r;return e=48&&o<=57,u=s>=48&&s<=57;if(l&&(i=10*i+o-48),u&&(n=10*n+s-48),!l||!u){if(i!==n)return i-n;if(o!==s)return o-s}}return n-i};var es=2e9;c.seedPseudoRandom=function(){es=2e9},c.pseudoRandom=function(){var e=es;return 0x19999999>Math.abs((es=(69069*es+1)%0x100000000)-e)?c.pseudoRandom():es/0x100000000},c.fillText=function(e,t,r){var i=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},n=c.extractOption(e,t,"htx","hovertext");if(c.isValidTextValue(n))return i(n);var a=c.extractOption(e,t,"tx","text");if(c.isValidTextValue(a))return i(a)},c.isValidTextValue=function(e){return e||0===e},c.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",i=0;i1&&(u=1):u=0,c.strTranslate(n-u*(r+o),a-u*(i+s))+c.strScale(u)+(l?"rotate("+l+(t?"":" "+r+" "+i)+")":"")},c.setTransormAndDisplay=function(e,t){e.attr("transform",c.getTextTransform(t)),e.style("display",t.scale?null:"none")},c.ensureUniformFontSize=function(e,t){var r=c.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},c.join2=function(e,t,r){var i=e.length;return i>1?e.slice(0,-1).join(t)+r+e[i-1]:e.join(t)},c.bigFont=function(e){return Math.round(1.2*e)};var ed=c.getFirefoxVersion(),ef=null!==ed&&ed<86;c.getPositionFromD3Event=function(){return ef?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),t_=m({"build/plotcss.js"(){var e,t,r=tb(),i={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .plotly-cloud-dialog":'font-family:"Open Sans",verdana,arial,sans-serif;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1001;display:flex;align-items:center;justify-content:center;background-color:rgba(0,0,0,.4);',"X .plotly-cloud-dialog .plotly-cloud-dialog-box":"box-sizing:border-box;min-width:300px;max-width:420px;padding:20px 24px;background-color:#fff;border:1px solid #e0e2e5;border-radius:4px;box-shadow:0 4px 16px rgba(0,0,0,.25);font-size:13px;color:#2a3f5f;","X .plotly-cloud-dialog .plotly-cloud-dialog-title":"font-size:16px;font-weight:bold;margin-bottom:12px;","X .plotly-cloud-dialog .plotly-cloud-dialog-message":"line-height:1.5;overflow-wrap:break-word;word-wrap:break-word;","X .plotly-cloud-dialog .plotly-cloud-dialog-message--hostname":"font-weight:bold;text-decoration:underline;","X .plotly-cloud-dialog .plotly-cloud-dialog-message--account":"margin-top:16px;padding:8px;border-radius:3px;font-size:.9em;background-color:#edf1f8;","X .plotly-cloud-dialog .plotly-cloud-dialog-buttons":"display:flex;justify-content:flex-end;margin-top:20px;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn":"font-family:inherit;font-size:13px;padding:7px 16px;margin-left:8px;border-radius:3px;border:1px solid rgba(0,0,0,0);cursor:pointer;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn:focus-visible":"outline:2px solid #447adb;outline-offset:1px;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel":"background-color:#f3f3f3;margin-left:auto;color:#777;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel:hover":"background-color:#e0e2e5;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm":"background-color:#447adb;color:#fff;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm:hover":"background-color:#1d3b84;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(t in i)e=t.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(e,i[t])}}),tw=m({"node_modules/is-browser/client.js"(e,t){t.exports=!0}}),tT=m({"node_modules/has-hover/index.js"(e,t){var r=tw();t.exports="function"==typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:r}}),tA=m({"node_modules/events/events.js"(e,t){var r,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(e,t){return new Promise(function(r,i){var n,a,o;function s(r){e.removeListener(t,l),i(r)}function l(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}g(e,t,l,{once:!0}),"error"!==t&&(n=e,a=s,o={once:!0},"function"==typeof n.on&&g(n,"error",a,o))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,i){var n,a,o;if(l(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=u(e))>0&&o.length>n&&!o.warned){o.warned=!0;var s=Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function f(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var o,s=Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var u=l.length,c=m(l,u),r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,n=a;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}),tM=m({"src/lib/events.js"(e,t){var r=tA().EventEmitter;t.exports={init:function(e){if(e._ev instanceof r)return e;var t=new r,i=new r;return e._ev=t,e._internalEv=i,e.on=t.on.bind(t),e.once=t.once.bind(t),e.removeListener=t.removeListener.bind(t),e.removeAllListeners=t.removeAllListeners.bind(t),e._internalOn=i.on.bind(i),e._internalOnce=i.once.bind(i),e._removeInternalListener=i.removeListener.bind(i),e._removeAllInternalListeners=i.removeAllListeners.bind(i),e.emit=function(e,r){t.emit(e,r),i.emit(e,r)},"function"==typeof e.addEventListener&&e.addEventListener("wheel",()=>{},{passive:!0}),e},triggerHandler:function(e,t,r){var i,n=e._ev;if(n){var a=n._events[t];if(a){for(a=Array.isArray(a)?a:[a],i=0;ii.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},n.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},n.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},n.undo=function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=a.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!x(o))return!1;e=a[n][o]}else e=a[n]}else e=a}}return e}function x(e){return e===Math.round(e)&&e>=0}function b(t){var r,i;return r=t,e.crawl(r,function(t,r,i){!e.isValObject(t)&&c(t)&&(t.role="object")}),i=t,e.crawl(i,function(e,t,r){if(e){var i=e[m];i&&(delete e[m],r[t]={items:{}},r[t].items[i]=e,r[t].role="object")}}),!function e(t){for(var r in t)if(c(t[r]))e(t[r]);else if(Array.isArray(t[r]))for(var i=0;i=a&&(n._input||{})._templateitemname;s&&(o=a);var l,u=r+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][i]=s)}function h(e,r){s?t.nestedProperty(l[u],e).set(r):l[u+"."+e]=r}function d(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:h,getUpdateObj:d,applyUpdate:function(r,i){r&&h(r,i);var n=d();for(var a in n)t.nestedProperty(e,a).set(n[a])}}}}}),tC=m({"src/plots/cartesian/constants.js"(e,t){var r=(el(),x(ea)).counter;t.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),tI=m({"src/plots/cartesian/axis_ids.js"(e){var t=e1(),r=tC();function i(e,t){if(t&&t.length){for(var r=0;ri?1:-1:(e.slice(1)||1)-(t.slice(1)||1)},e.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},e.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}}}),tL=m({"src/components/shapes/handle_outline.js"(e,t){t.exports={clearOutlineControllers:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".outline-controllers").remove()},clearOutline:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".select-outline").remove(),e._fullLayout._outlining=!1}}}}),tP=m({"src/traces/scatter/layout_attributes.js"(e,t){t.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),tz=m({"src/plots/get_data.js"(e){var t=e1();tC().SUBPLOT_PATTERN,e.getSubplotCalcData=function(e,r,i){var n=t.subplotsRegistry[r];if(!n)return[];for(var a=n.attr,o=[],s=0;s0?".":"")+a;r.isPlainObject(s)?o(s,t,l,n+1):t(l,a,s)}})}e.manageCommandObserver=function(t,n,a,o){var s={},l=!0;n&&n._commandObserver&&(s=n._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=e.hasSimpleAPICommandBindings(t,a,s.lookupTable);if(n&&n._commandObserver){if(u)return s;if(n._commandObserver.remove)return n._commandObserver.remove(),n._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h1&&P.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&P.length>15&&0===l.shapes.length&&0===l.images.length,_.linkSubplots(d,l,h,a),_.cleanPlot(d,l,h,a);var j=!!(a._has&&a._has("cartesian")),N=!!(l._has&&l._has("cartesian"));j&&!N?a._bgLayer.remove():N&&!j&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&p({_fullLayout:a}),function(e,t){var r,i=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var n=0;n0){var h=1-2*s;i=Math.round(h*i),a=Math.round(h*a)}}var d=_.layoutAttributes.width.min,f=_.layoutAttributes.height.min;i1,m=!t.height&&Math.abs(r.height-a)>1;(m||p)&&(p&&(r.width=i),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:i,height:a}),_.sanitizeMargins(r)},_.supplyLayoutModuleDefaults=function(e,t,r,i){var n,a,o,l=s.componentsRegistry,u=t._basePlotModules,h=s.subplotsRegistry.cartesian;for(n in l)(o=l[n]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in u.length||u.push(h),t._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(e,t),h.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(c.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;p[t]={l:{val:x,size:r.l+g},r:{val:b,size:r.r+g},b:{val:T,size:r.b+g},t:{val:w,size:r.t+g}},m[t]=1}else delete p[t],delete m[t];if(!i._replotting)return _.doAutoMargin(e)}},_.doAutoMargin=function(e){var t,r,i=e._fullLayout,a=i.width,o=i.height;i._size||(i._size={}),z(i);var l=i._size,u=i.margin,h={t:0,b:0,l:0,r:0},d=c.extendFlat({},l),p=u.l,m=u.r,g=u.t,y=u.b,v=i._pushmargin,x=i._pushmarginIds,b=i.minreducedwidth,w=i.minreducedheight;if(!1!==u.autoexpand){for(var T in v)x[T]||delete v[T];var A=e._fullLayout._reservedMargin;for(var M in A)for(var k in A[M]){var S=A[M][k];h[k]=Math.max(h[k],S)}for(var E in v.base={l:{val:0,size:p},r:{val:1,size:m},t:{val:1,size:g},b:{val:0,size:y}},h){var D=0;for(var C in v)"base"!==C&&n(v[C][E].size)&&(D=v[C][E].size>D?v[C][E].size:D);var I=Math.max(0,u[E]-D);h[E]=Math.max(0,h[E]-I)}for(var L in v){var P=v[L].l||{},F=v[L].b||{},O=P.val,R=P.size,B=F.val,j=F.size,N=a-h.r-h.l,V=o-h.t-h.b;for(var U in v){if(n(R)&&v[U].r){var q=v[U].r.val,G=v[U].r.size;if(q>O){var H=(R*q+(G-N)*O)/(q-O),$=(G*(1-O)+(R-N)*(1-q))/(q-O);H+$>p+m&&(p=H,m=$)}}if(n(j)&&v[U].t){var W=v[U].t.val,Y=v[U].t.size;if(W>B){var Z=(j*W+(Y-V)*B)/(W-B),X=(Y*(1-B)+(j-V)*(1-W))/(W-B);Z+X>y+g&&(y=Z,g=X)}}}}}var K=c.constrain(a-u.l-u.r,2,b),J=c.constrain(o-u.t-u.b,2,w),Q=Math.max(0,a-K),ee=Math.max(0,o-J);if(Q){var et=(p+m)/Q;et>1&&(p/=et,m/=et)}if(ee){var er=(y+g)/ee;er>1&&(y/=er,g/=er)}if(l.l=Math.round(p)+h.l,l.r=Math.round(m)+h.r,l.t=Math.round(g)+h.t,l.b=Math.round(y)+h.b,l.p=Math.round(u.pad),l.w=Math.round(a)-l.l-l.r,l.h=Math.round(o)-l.t-l.b,!i._replotting&&(_.didMarginChange(d,l)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=f.list(e,"",!0);for(var r in t)if(t[r].autoshift||t[r].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in i?i._redrawFromAutoMarginCount++:i._redrawFromAutoMarginCount=1;var ei=3*(1+Object.keys(x).length);if(i._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push(function(){i=!0}),r.redraw&&e._transitionData._interruptCallbacks.push(function(){return s.call("redraw",e)}),e._transitionData._interruptCallbacks.push(function(){e.emit("plotly_transitioninterrupted",[])});var a=0,o=0;function l(){return a++,function(){var t;o++,i||o!==a||(t=n,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return s.call("redraw",e)}).then(function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])}).then(t)))}}r.runFn(l),setTimeout(l())})}],a=c.syncOrAsync(n,e);return a&&a.then||(a=Promise.resolve()),a.then(function(){return e})}_.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},_.graphJson=function(e,t=!1,r="json",i=!1,n=!1){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&_.supplyDefaults(e);var o=i?e._fullData:e.data,s=i?e._fullLayout:e.layout,l=(e._transitionData||{})._frames;function u(e,t){if("function"==typeof e)return t?"_function_":null;if(c.isPlainObject(e)){var r={};return Object.keys(e).sort().forEach(function(i){if(-1===["_","["].indexOf(i.charAt(0))){if("function"==typeof e[i]){t&&(r[i]="_function");return}r[i]=u(e[i],t)}}),r}var i=Array.isArray(e),n=c.isTypedArray(e);if((i||n)&&e.dtype&&e.shape){var o=e.bdata;return u({dtype:e.dtype,shape:e.shape,bdata:c.isArrayBuffer(o)?a.encode(o):o},t)}return i?e.map(function(e){return u(e,t)}):n?c.simpleMap(e,c.identity):c.isJSDate(e)?c.ms2DateTimeLocal(+e):e}var h={data:(o||[]).map(function(e){var r=u(e);return t&&delete r.fit,r})};if(!t&&(h.layout=u(s),i)){var d=s._size;h.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return l&&(h.frames=u(l)),n&&(h.config=u(e._context,!0)),"object"===r?h:JSON.stringify(h)},_.modifyFrames=function(e,t){var r,i,n,a=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;re?e.match(o):null;e.matchTex=s,e.convertToTspans=function(o,y,M){let D;var C=o.text(),P=!o.attr("data-notex")&&y&&y._context.typesetMath&&s(C);P&&!(3===(D=h())||4===D||(null===D?d||(d=!0,r.warn("MathJax is not loaded. Math equations will not be rendered.")):f||(f=!0,r.warn("Unsupported MathJax version:",MathJax.version)),0))&&(P=null);var z=t.select(o.node().parentNode);if(!z.empty()){var F=o.attr("class")?o.attr("class").split(" ")[0]:"text";return F+="-math",z.selectAll("svg."+F).remove(),z.selectAll("g."+F+"-group").remove(),o.style("display",null).attr({"data-unformatted":C,"data-math":"N"}),P?(y&&y._promises||[]).push(new Promise(function(e){let n;o.style("display","none");var a,s,d,f,p=parseInt(o.node().style.fontSize,10),m={fontSize:p},g=o.attr("text-anchor");a=P[2],s=m,d=function(t,r,n){z.selectAll("svg."+F).remove(),z.selectAll("g."+F+"-group").remove();var a=t&&t.select("svg");if(!a||!a.node()){O(),e();return}o.style("display","none");var s=z.append("g").classed(F+"-group",!0).attr({"pointer-events":"none","data-unformatted":C,"data-math":"Y"});s.node().appendChild(a.node()),r&&r.node()&&a.node().insertBefore(r.node().cloneNode(!0),a.node().firstChild);var l=n.width,u=n.height;a.attr({class:F,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none","font-size":m.fontSize+"px"});var c=o.node().style.fill||"black",h=a.select("g");h.attr({fill:c,stroke:c});var d=h.node().getBoundingClientRect(),f=d.width,y=d.height;(f>l||y>u)&&(a.style("overflow","hidden"),f=(d=a.node().getBoundingClientRect()).width,y=d.height);var v=+o.attr("x"),x=+o.attr("y"),b=-(p||o.node().getBoundingClientRect().height)/4;"y"===F[0]?s.attr({transform:"rotate("+[-90,v,x]+")"+i(-f/2,b-y/2)}):"l"===F[0]?x=b-y/2:"a"===F[0]&&0!==F.indexOf("atitle")?(v=0,x=b):(v-=f*("middle"===g?.5:+("end"===g)),x=x+b-y/2),a.attr({x:v,y:x}),M&&M.call(o,s),e(s)},n=h(),Promise.resolve().then(function(){if(!c){let e=MathJax._.output.svg_ts.SVG,t=r.extendFlat({},MathJax.config.svg,{fontCache:"local"});4===n&&(t.linebreaks=r.extendFlat({},t.linebreaks,{inline:!1})),c=MathJax._.mathjax.mathjax.document(document,r.extendFlat({},MathJax.config.options,{InputJax:MathJax.startup.input,OutputJax:new e(t)}))}let e="math-output-"+r.randstr({},64);f=t.select("body").append("div").attr({id:e}).style({visibility:"hidden",position:"absolute","font-size":s.fontSize+"px"});let i=a.replace(l,"\\lt ").replace(u,"\\gt ").replace(/^\$+|\$+$/g,"");return MathJax._.mathjax.mathjax.handleRetriesFor(function(){return c.convert(i,{display:!1})}).then(function(e){f.node().appendChild(e)})}).then(function(){let e=f.select(".MathJax"),t=!e.empty()&&f.select("svg").node();if(t){let r=t.getBoundingClientRect(),i=e.select("defs");d(e,i,r)}else r.log("There was an error in the tex syntax.",a),d();f.remove()}).catch(e=>{r.log("MathJax typesetting failed.",a,e),f&&f.remove(),d()})})):O(),o}function O(){z.empty()||(F=o.attr("class")+"-math",z.select("svg."+F).remove()),o.text("").style("white-space","pre"),function(e,i){i=i.replace(v," ");var o,s=!1,l=[],u=-1;function c(){u++;var r=document.createElementNS(n.svg,"tspan");t.select(r).attr({class:"line",dy:u*a+"em"}),e.appendChild(r),o=r;var i=l;if(l=[{node:r}],i.length>1)for(var s=1;s.",i);var t=l.pop();e!==t.type&&r.log("Start tag <"+t.type+"> doesnt match end tag <"+e+">. Pretending it did match.",i),o=l[l.length-1].node}(C);else{var z=D[4],F={type:C},O=S(z,w);if(O?(O=O.replace(E,"$1 fill:"),P&&(O+=";"+P)):P&&(O=P),O&&(F.style=O),"a"===C){s=!0;var R=S(z,T);if(R){var B=L(R);B&&(F.href=B,F.target=S(z,A)||"_blank",F.popup=S(z,k))}}h(F)}}return s}(o.node(),C)&&o.style("pointer-events","all"),e.positionText(o),M&&M.call(o)}};var l=/(<|<|<)/g,u=/(>|>|>)/g,c=null,h=()=>"u">typeof MathJax&&MathJax.version?parseInt(MathJax.version.split(".")[0]):null,d=!1,f=!1,p={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},m={sub:"0.3em",sup:"-0.6em"},g={sub:"-0.21em",sup:"0.42em"},y=["http:","https:","mailto:","",void 0,":"],v=e.NEWLINES=/(\r\n?|\n)/g,x=/(<[^<>]*>)/,b=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=//i;e.BR_TAG_ALL=//gi;var w=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,T=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,A=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function S(e,t){if(!e)return null;var r=e.match(t),i=r&&(r[3]||r[4]);return i&&I(i)}var E=/(^|;)\s*color:/;e.plainText=function(e,t){t=t||{};for(var r=void 0!==t.len&&-1!==t.len?t.len:1/0,i=void 0!==t.allowedTags?t.allowedTags:["br"],n=e.split(x),a=[],o="",s=0,l=0;l3?a.push(u.slice(0,Math.max(0,f-3))+"..."):a.push(u.slice(0,f));break}o=""}}return a.join("")};var D={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},C=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function I(e){return e.replace(C,function(e,t){return("#"===t.charAt(0)?function(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r((e>>10)+55232,e%1024+56320)}}("x"===t.charAt(1)?parseInt(t.slice(2),16):parseInt(t.slice(1),10)):D[t])||e})}function L(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),i=document.createElement("a");r.href=e,i.href=t;var n=r.protocol,a=i.protocol;return -1!==y.indexOf(n)&&-1!==y.indexOf(a)?t:""}function P(e,t,i){var n,a,o,s=i.horizontalAlign,l=i.verticalAlign||"top",u=e.node().getBoundingClientRect(),c=t.node().getBoundingClientRect();return a="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var e=o()-c.left,t=a()-c.top,s=i.gd||{};if(i.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(e,t);e=l[0],t=l[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}e.convertEntities=I,e.sanitizeHTML=function(e){e=e.replace(v," ");for(var r=document.createElement("p"),i=r,n=[],a=e.split(x),o=0;o=0;i--,n++){var a=e[i];r[n]=[1-a[0],a[1]]}return r}function d(e,t){t=t||{};for(var n=e.domain,o=e.range,s=o.length,l=Array(s),u=0;um-f?f=m-(p-m):p-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}}),t4=m({"src/components/colorscale/index.js"(e,t){var r=ei(),i=tN();t.exports={moduleType:"component",name:"colorscale",attributes:tG(),layoutAttributes:tH(),supplyLayoutDefaults:t2(),handleDefaults:t1(),crossTraceDefaults:t3(),calc:t5(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:i.hasColorscale,extractOpts:i.extractOpts,extractScale:i.extractScale,flipScale:i.flipScale,makeColorScaleFunc:i.makeColorScaleFunc,makeColorScaleFuncFromTrace:i.makeColorScaleFuncFromTrace}}}),t6=m({"src/traces/scatter/subtypes.js"(e,t){var r=tb(),i=F().isTypedArraySpec;t.exports={hasLines:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("lines")},hasMarkers:function(e){return e.visible&&(e.mode&&-1!==e.mode.indexOf("markers")||"splom"===e.type)},hasText:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("text")},isBubble:function(e){var t=e.marker;return r.isPlainObject(t)&&(r.isArrayOrTypedArray(t.size)||i(t.size))}}}}),t8=m({"src/traces/scatter/make_bubble_size_func.js"(e,t){var r=I();t.exports=function(e,t){t||(t=2);var i=e.marker,n=i.sizeref||1,a=i.sizemin||0,o="area"===i.sizemode?function(e){return Math.sqrt(e/n)}:function(e){return e/n};return function(e){var i=o(e/t);return r(i)&&i>0?Math.max(i,a):0}}}}),t7=m({"src/components/fx/helpers.js"(e){var t=tb();e.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},e.isTraceInSubplots=function(t,r){if("splom"===t.type){for(var i=t.xaxes||[],n=t.yaxes||[],a=0;a=0&&r.index{let o,s=i.toLowerCase(),l=i,u=(o=a.match(n))?o.map(Number):[];for("m"===s&&u.length>2&&(t.push([l,...u.splice(0,2)]),s="l",l="m"===l?"l":"L");;){if(u.length===r[s])return t.push([l,...u]),"";if(u.length=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}k.symbolNumber=function(e){if(f(e))e*=1;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=k.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=L||e>=400?0:Math.floor(Math.max(e,0))};var z=d("~f"),F={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function O(e,t,r,i,n,a,o,s,l,u){var d,f=n.length;"linear"===i?d={node:"linearGradient",attrs:{x1:o.x,y1:o.y,x2:s.x,y2:s.y,gradientUnits:l?"userSpaceOnUse":"objectBoundingBox"},reversed:u}:"radial"===i&&(d={node:"radialGradient",reversed:u});for(var p=Array(f),g=0;g=0&&void 0===e.i&&(e.i=a.i),t.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(e):void 0===e.mo?o.opacity:e.mo),i.ms2mrc){l="various"===e.ms||"various"===o.size?3:i.ms2mrc(e.ms),e.mrc=l,i.selectedSizeFn&&(l=e.mrc=i.selectedSizeFn(e));var l,u=k.symbolNumber(e.mx||o.symbol)||0;e.om=u%200>=100;var c=ea(e,r),d=J(e,r);t.attr("d",P(u,l,c,d))}var f,p,g,y=!1;if(e.so)g=s.outlierwidth,p=s.outliercolor,f=o.outliercolor;else{var v=(s||{}).width;g=(e.mlw+1||v+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,p="mlc"in e?e.mlcc=i.lineScale(e.mlc):h.isArrayOrTypedArray(s.color)?m.defaultLine:s.color,h.isArrayOrTypedArray(o.color)&&(f=m.defaultLine,y=!0),f="mc"in e?e.mcc=i.markerScale(e.mc):o.color||o.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(f=i.selectedColorFn(e))}let x=e.mld||(s||{}).dash;if(x&&k.dashLine(t,x,g),e.om)t.call(m.stroke,f).style({"stroke-width":(g||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:g)+"px");var b=o.gradient,_=e.mgt;_?y=!0:_=b&&b.type,h.isArrayOrTypedArray(_)&&(F[_=_[0]]||(_=0));var w=o.pattern,T=k.getPatternAttr,A=w&&(T(w.shape,e.i,"")||T(w.path,e.i,""));if(_&&"none"!==_){var M=e.mgc;M?y=!0:M=b.color;var S=r.uid;y&&(S+="-"+e.i),k.gradient(t,n,S,_,[[0,M],[1,f]],"fill")}else if(A){var E=!1,D=w.fgcolor;!D&&a&&a.color&&(D=a.color,E=!0);var C=T(D,e.i,a&&a.color||null),I=T(w.bgcolor,e.i,null),L=w.fgopacity,z=T(w.size,e.i,8),O=T(w.solidity,e.i,.3);E=E||e.mcc||h.isArrayOrTypedArray(w.shape)||h.isArrayOrTypedArray(w.path)||h.isArrayOrTypedArray(w.bgcolor)||h.isArrayOrTypedArray(w.fgcolor)||h.isArrayOrTypedArray(w.size)||h.isArrayOrTypedArray(w.solidity);var R=r.uid;E&&(R+="-"+e.i),k.pattern(t,"point",n,R,A,z,O,e.mcc,w.fillmode,I,C,L)}else h.isArrayOrTypedArray(f)?m.fill(t,f[e.i]):m.fill(t,f);g&&m.stroke(t,p)}},k.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=k.tryColorscale(r,""),t.lineScale=k.tryColorscale(r,"line"),p.traceIs(e,"symbols")&&(t.ms2mrc=w.isBubble(e)?T(e):function(){return(r.size||6)/2}),e.selectedpoints&&h.extendFlat(t,k.makeSelectedPointStyleFns(e)),t},k.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},i=e.unselected||{},n=e.marker||{},a=r.marker||{},o=i.marker||{},s=n.opacity,l=a.opacity,u=o.opacity,c=void 0!==l,d=void 0!==u;(h.isArrayOrTypedArray(s)||c||d)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?n.opacity:e.mo;return e.selected?c?l:t:d?u:_*t});var f=n.color,m=a.color,g=o.color;(m||g)&&(t.selectedColorFn=function(e){var t=e.mcc||f;return e.selected?m||t:g||t});var y=n.size,v=a.size,x=o.size,b=void 0!==v,w=void 0!==x;return p.traceIs(e,"symbols")&&(b||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?b?v/2:t:w?x/2:t}),t},k.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},i=e.unselected||{},n=e.textfont||{},a=r.textfont||{},o=i.textfont||{},s=n.color,l=a.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?l||t:u||(l?t:m.addOpacity(t,_))},t},k.selectedPointStyle=function(e,t){if(!(!e.size()||!t.selectedpoints)){var r=k.makeSelectedPointStyleFns(t),i=t.marker||{},n=[];r.selectedOpacityFn&&n.push(function(e,t){e.style("opacity",r.selectedOpacityFn(t))}),r.selectedColorFn&&n.push(function(e,t){m.fill(e,r.selectedColorFn(t))}),r.selectedSizeFn&&n.push(function(e,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);e.attr("d",P(k.symbolNumber(a),o,ea(n,t),J(n,t))),n.mrc2=o}),n.length&&e.each(function(e){for(var t=c.select(this),r=0;r0?r:0}function N(e,t,r){return r&&(e=$(e)),t?U(e[1]):V(e[0])}function V(e){var t=c.round(e,2);return r=t,t}function U(e){var t=c.round(e,2);return i=t,t}function q(e,t,r,i){var n=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(n*n+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*n-l*l*o)*i,h=(u*u*a-l*l*s)*i,d=3*u*(l+u),f=3*l*(l+u);return[[V(t[0]+(d&&c/d)),U(t[1]+(d&&h/d))],[V(t[0]-(f&&c/f)),U(t[1]-(f&&h/f))]]}k.textPointStyle=function(e,t,r){if(e.size()){if(t.selectedpoints){var i;i=k.makeSelectedTextStyleFns(t).selectedTextColorFn}var n=t.texttemplate,a=r._fullLayout;e.each(function(e){var o=c.select(this),s=n?h.extractOption(e,t,"txt","texttemplate"):h.extractOption(e,t,"tx","text");if(!s&&0!==s)return void o.remove();if(n){var l=t._module.formatLabels,u=l?l(e,t,a):{},d={};A(d,t,e.i),s=h.texttemplateString({data:[d,e,t._meta],fallback:t.texttemplatefallback,labels:u,locale:a._d3locale,template:s})}var f=e.tp||t.textposition,p=j(e,t),m=i?i(e):e.tc||t.textfont.color;o.call(k.font,{family:e.tf||t.textfont.family,weight:e.tw||t.textfont.weight,style:e.ty||t.textfont.style,variant:e.tv||t.textfont.variant,textcase:e.tC||t.textfont.textcase,lineposition:e.tE||t.textfont.lineposition,shadow:e.tS||t.textfont.shadow,size:p,color:m}).text(s).call(v.convertToTspans,r).call(B,f,p,e.mrc)})}},k.selectedTextStyle=function(e,t){if(!(!e.size()||!t.selectedpoints)){var r=k.makeSelectedTextStyleFns(t);e.each(function(e){var i=c.select(this),n=r.selectedTextColorFn(e),a=e.tp||t.textposition,o=j(e,t);m.fill(i,n);var s=p.traceIs(t,"bar-like");B(i,a,o,e.mrc2||e.mrc,s)})}},k.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,i="M"+e[0],n=[];for(r=1;r=c||_>=f&&_<=c)&&(w<=p&&w>=d||w>=p&&w<=d)&&(e=[_,w])}return e}k.steps=function(e){var t=G[e]||H;return function(e){for(var r="M"+V(e[0][0])+","+U(e[0][1]),i=e.length,n=1;n=1e4&&(k.savedBBoxes={},W=0),r&&(k.savedBBoxes[r]=m),W++,h.extendFlat({},m)},k.setClipUrl=function(e,t,r){e.attr("clip-path",Z(t,r))},k.getTranslate=function(e){var t=e.attr?"attr":"getAttribute",r=(e[t]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(e,t,r){return[t,r].join(" ")}).split(" ");return{x:+r[0]||0,y:+r[1]||0}},k.setTranslate=function(e,t,r){var i=e.attr?"attr":"getAttribute",n=e.attr?"attr":"setAttribute",a=e[i]("transform")||"";return t=t||0,r=r||0,a=(a=a.replace(/(\btranslate\(.*?\);?)/,"").trim()+y(t,r)).trim(),e[n]("transform",a),a},k.getScale=function(e){var t=e.attr?"attr":"getAttribute",r=(e[t]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(e,t,r){return[t,r].join(" ")}).split(" ");return{x:+r[0]||1,y:+r[1]||1}},k.setScale=function(e,t,r){var i=e.attr?"attr":"getAttribute",n=e.attr?"attr":"setAttribute",a=e[i]("transform")||"";return t=t||1,r=r||1,a=(a=a.replace(/(\bscale\(.*?\);?)/,"").trim()+("scale("+t+","+r)+")").trim(),e[n]("transform",a),a};var X=/\s*sc.*/;k.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var i=1===t&&1===r?"":"scale("+t+","+r+")";e.each(function(){var e=(this.getAttribute("transform")||"").replace(X,"");e+=i,e=e.trim(),this.setAttribute("transform",e)})}};var K=/translate\([^)]*\)\s*$/;function J(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}k.setTextPointsScale=function(e,t,r){e&&e.each(function(){var e,i=c.select(this),n=i.select("text");if(n.node()){var a=parseFloat(n.attr("x")||0),o=parseFloat(n.attr("y")||0),s=(i.attr("transform")||"").match(K);e=1===t&&1===r?[]:[y(a,o),"scale("+t+","+r+")",y(-a,-o)],s&&e.push(s),i.attr("transform",e.join(""))}})},k.getMarkerStandoff=J;var Q=Math.atan2,ee=Math.cos,et=Math.sin;function ei(e,t){var r=t[0],i=t[1];return[r*ee(e)-i*et(e),r*et(e)+i*ee(e)]}function ea(e,t){var r=e.ma;void 0===r&&(!f(r=t.marker.angle)||h.isArrayOrTypedArray(r))&&(r=0);var i,c,d=t.marker.angleref;if("previous"===d||"north"===d){if(t._geo){var p=t._geo.project(e.lonlat);i=p[0],c=p[1]}else{var m=t._xA,g=t._yA;if(!m||!g)return 90;i=m.c2p(e.x),c=g.c2p(e.y)}if(t._geo){var y,v=e.lonlat[0],x=e.lonlat[1],b=t._geo.project([v,x+1e-5]),_=t._geo.project([v+1e-5,x]),w=Q(_[1]-c,_[0]-i),T=Q(b[1]-c,b[0]-i);if("north"===d)y=r/180*Math.PI;else if("previous"===d){var A=x/180*Math.PI,M=a/180*Math.PI,k=n/180*Math.PI-v/180*Math.PI;y=-Q(ee(M)*et(k),et(M)*ee(A)-ee(M)*et(A)*ee(k))-Math.PI,n=v,a=x}var S=ei(w,[ee(y),0]),E=ei(T,[et(y),0]);r=Q(S[1]+E[1],S[0]+E[0])/Math.PI*180,"previous"===d&&(u!==t.uid||e.i!==l+1)&&(r=null)}if("previous"===d&&!t._geo)if(u===t.uid&&e.i===l+1&&f(i)&&f(c)){var D=i-o,C=c-s,I=t.line&&t.line.shape||"",L=I.slice(I.length-1);"h"===L&&(C=0),"v"===L&&(D=0),r+=Q(C,D)/Math.PI*180+90}else r=null}return o=i,s=c,l=e.i,u=t.uid,r}k.getMarkerAngle=ea}}),rr=m({"src/components/titles/index.js"(e,t){var r=M(),i=I(),n=tO(),a=e1(),o=tb(),s=o.strTranslate,l=rt(),u=er(),c=tj(),h=en(),d=tB().OPPOSITE_SIDE,f=/ [XY][0-9]* /;t.exports={draw:function(e,t,p){var m,g=e._fullLayout,y=p.propContainer,v=p.propName,x=p.placeholder,b=p.traceIndex,_=p.avoid||{},w=p.attributes,T=p.transform,A=p.containerGroup,M=1,k=y.title,S=(k&&k.text?k.text:"").trim(),E=!1,D=k&&k.font?k.font:{},C=D.family,I=D.size,L=D.color,P=D.weight,z=D.style,F=D.variant,O=D.textcase,R=D.lineposition,B=D.shadow,j=!!p.subtitlePropName,N=p.subtitlePlaceholder,V=(y.title||{}).subtitle||{text:"",font:{}},U=(V.text||"").trim(),q=!1,G=1,H=V.font,$=H.family,W=H.size,Y=H.color,Z=H.weight,X=H.style,K=H.variant,J=H.textcase,Q=H.lineposition,ee=H.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":-1!==v.indexOf("colorbar")&&(m="colorbarTitleText");var et=e._context.edits[m];function er(e,t){return void 0!==e&&void 0!==t&&e.replace(f," % ")===t.replace(f," % ")}""===S?M=0:er(S,x)&&(et||(S=""),M=.2,E=!0),j&&(""===U?G=0:er(U,N)&&(et||(U=""),G=.2,q=!0)),p._meta?S=o.templateString(S,p._meta):g._meta&&(S=o.templateString(S,g._meta));var ei,en=S||U||et;A||(A=o.ensureSingle(g._infolayer,"g","g-"+t),ei=g._hColorbarMoveTitle);var ea=A.selectAll("text."+t).data(en?[0]:[]);ea.enter().append("text"),ea.text(S).attr("class",t),ea.exit().remove();var eo=null,es=t+"-subtitle",el=U||et;if(j&&((eo=A.selectAll("text."+es).data(el?[0]:[])).enter().append("text"),eo.text(U).attr("class",es),eo.exit().remove()),!en)return A;function eu(e,t){o.syncOrAsync([ec,eh],{title:e,subtitle:t})}function ec(i){var a,h=i.title,d=i.subtitle;if(!T&&ei&&(T={}),T?(a="",T.rotate&&(a+="rotate("+[T.rotate,w.x,w.y]+")"),(T.offset||ei)&&(a+=s(0,(T.offset||0)-(ei||0)))):a=null,h.attr("transform",a),h.style("opacity",M*u.opacity(L)).call(l.font,{color:u.rgb(L),size:r.round(I,2),family:C,weight:P,style:z,variant:F,textcase:O,shadow:B,lineposition:R}).attr(w).call(c.convertToTspans,e,function(e){if(e){var t=r.select(e.node().parentNode).select("."+es);if(!t.empty()){var i=e.node().getBBox();if(i.height){var n=i.y+i.height+1.6*W;t.attr("y",n)}}}}),d&&!d.empty()){var f=A.select("."+t+"-math-group"),p=h.node().getBBox(),m=f.node()?f.node().getBBox():void 0,g=m?m.y+m.height+1.6*W:p.y+p.height+1.6*W,y=o.extendFlat({},w,{y:g});d.attr("transform",a),d.style("opacity",G*u.opacity(Y)).call(l.font,{color:u.rgb(Y),size:r.round(W,2),family:$,weight:Z,style:X,variant:K,textcase:J,shadow:ee,lineposition:Q}).attr(y).call(c.convertToTspans,e)}return n.previousPromises(e)}function eh(t){var n=t.title,a=r.select(n.node().parentNode);if(_&&_.selection&&_.side&&S){a.attr("transform",null);var u=d[_.side],c="left"===_.side||"top"===_.side?-1:1,h=i(_.pad)?_.pad:2,f=l.bBox(a.node()),p={t:0,b:0,l:0,r:0},m=e._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var b=m[v][x];p[x]=Math.max(p[x],b)}var w={left:p.l,top:p.t,right:g.width-p.r,bottom:g.height-p.b},T=_.maxShift||c*(w[_.side]-f[_.side]),A=0;if(T<0)A=T;else{var M=_.offsetLeft||0,k=_.offsetTop||0;f.left-=M,f.right-=M,f.top-=k,f.bottom-=k,_.selection.each(function(){var e=l.bBox(this);o.bBoxIntersect(f,e,h)&&(A=Math.max(A,c*(e[_.side]-f[u])+h))}),y._titleScoot=Math.abs(A=Math.min(T,A))}if(A>0||T<0){var E={left:[-A,0],right:[A,0],top:[0,-A],bottom:[0,A]}[_.side];a.attr("transform",s(E[0],E[1]))}}}function ed(e,t){e.text(t).on("mouseover.opacity",function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})}if(ea.call(eu,eo),et&&(S?ea.on(".opacity",null):(ed(ea,x),E=!0),ea.call(c.makeEditable,{gd:e}).on("edit",function(t){void 0!==b?a.call("_guiRestyle",e,v,t,b):a.call("_guiRelayout",e,v,t)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(eu)}).on("input",function(e){this.text(e||" ").call(c.positionText,w.x,w.y)}),j)){if(j&&!S){var ef=ea.node().getBBox(),ep=ef.y+ef.height+1.6*W;eo.attr("y",ep)}U?eo.on(".opacity",null):(ed(eo,N),q=!0),eo.call(c.makeEditable,{gd:e}).on("edit",function(t){a.call("_guiRelayout",e,"title.subtitle.text",t)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(eu)}).on("input",function(e){this.text(e||" ").call(c.positionText,eo.attr("x"),eo.attr("y"))})}return ea.classed("js-placeholder",E),eo&&!eo.empty()&&eo.classed("js-placeholder",q),A},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),ri=m({"src/plots/cartesian/set_convert.js"(e,t){var r=M(),i=E().utcFormat,n=tb(),a=n.numberFormat,o=I(),s=n.cleanNumber,l=n.ms2DateTime,u=n.dateTime2ms,c=n.ensureNumber,h=n.isArrayOrTypedArray,d=L(),f=d.FP_SAFE,p=d.BADNUM,m=d.LOG_CLIP,g=d.ONEWEEK,y=d.ONEDAY,v=d.ONEHOUR,x=d.ONEMIN,b=d.ONESEC,_=tI(),w=tC(),T=w.HOUR_PATTERN,A=w.WEEKDAY_PATTERN;function k(e){return Math.pow(10,e)}t.exports=function(e,t){t=t||{};var d=e._id||"x",M=d.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(!(t<=0)||!r||!e.range||2!==e.range.length)return p;var i=e.range[0],n=e.range[1];return .5*(i+n-2*m*Math.abs(i-n))}function E(t,r,i,a){if((a||{}).msUTC&&o(t))return+t;var s=u(t,i||e.calendar);if(s===p)if(!o(t))return p;else{t*=1;var l=Math.floor(10*n.mod(t+.05,1));s=u(new Date(Math.round(t-l/10)))+l/10}return s}function D(t,r,i){return l(t,r,i||e.calendar)}function C(t){return e._categories[Math.round(t)]}function I(t){if(null!=t){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return p}function L(t){if(e._categoriesMap)return e._categoriesMap[t]}function P(e){var t=L(e);return void 0!==t?t:o(e)?+e:void 0}function z(e){return o(e)?+e:L(e)}function F(e,t,i){return r.round(i+t*e,2)}var O=function(t){return o(t)?F(t,e._m,e._b):p},R=function(t){var r;return r=e._m,(t-e._b)/r};if(e.rangebreaks){var B="y"===M;O=function(t){if(!o(t))return p;var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);var i=B;e.range[0]>e.range[1]&&(i=!i);for(var n=i?-1:1,a=n*t,s=0,l=0;lc)s=l+1;else{s=a<(u+c)/2?l:l+1;break}}var h=e._B[s]||0;return isFinite(h)?F(t,e._m2,h):0},R=function(t){var r,i,n=e._rangebreaks.length;if(!n)return r=e._m,(t-e._b)/r;for(var a=0,o=0;oe._rangebreaks[o].pmax&&(a=o+1);return i=e._m2,(t-e._B[a])/i}}e.c2l="log"===e.type?S:c,e.l2c="log"===e.type?k:c,e.l2p=O,e.p2l=R,e.c2p="log"===e.type?function(e,t){return O(S(e,t))}:O,e.p2c="log"===e.type?function(e){return k(R(e))}:R,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=c,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=R,e.cleanPos=c):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return k(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=c,e.c2r=S,e.l2d=k,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return k(R(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=R,e.cleanPos=c):"date"===e.type?(e.d2r=e.r2d=n.identity,e.d2c=e.r2c=e.d2l=e.r2l=E,e.c2d=e.c2r=e.l2d=e.l2r=D,e.d2p=e.r2p=function(t,r,i){return e.l2p(E(t,0,i))},e.p2d=e.p2r=function(e,t,r){return D(R(e),t,r)},e.cleanPos=function(t){return n.cleanDate(t,p,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=I,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=c,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(R(e))},e.r2p=e.d2p,e.p2r=R,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:c(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=P,e.r2c=function(t){var r=P(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=L,e.l2r=e.c2r=c,e.r2l=P,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(R(e))},e.r2p=e.d2p,e.p2r=R,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:c(e)},e.setupMultiCategory=function(r){var i,a,o=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length){for(var l in s)if(l!==d){var u=t[_.id2name(l)];o=o.concat(u._traceIndices)}}var c=[[0,{}],[0,{}]],f=[];for(i=0;il[1]&&(a[+!s]=i,o[1]=l[1]),o[0]>=o[1])if(void 0!==r){var u=l[0]+1;void 0!==i&&(u=Math.min(u,l[1])),a[+!s]=e.l2r(u)}else void 0!==i&&(a[+!!s]=e.l2r(l[1]-1))}},e.cleanRange=function(t,r){e._cleanRange(t,r),e.limitRange(t)},e._cleanRange=function(t,r){r||(r={}),t||(t="range");var i,a,s=n.nestedProperty(e,t).get();if(a=(a="date"===e.type?n.dfltRange(e.calendar):"y"===M?w.DFLTRANGEY:"realaxis"===e._name?[0,1]:r.dfltRange||w.DFLTRANGEX).slice(),("tozero"===e.rangemode||"nonnegative"===e.rangemode)&&(a[0]=0),!s||2!==s.length)return void n.nestedProperty(e,t).set(a);var l=null===s[0],u=null===s[1];for("date"!==e.type||e.autorange||(s[0]=n.cleanDate(s[0],p,e.calendar),s[1]=n.cleanDate(s[1],p,e.calendar)),i=0;i<2;i++)if("date"===e.type){if(!n.isDateTime(s[i],e.calendar)){e[t]=a;break}if(e.r2l(s[0])===e.r2l(s[1])){var c=n.constrain(e.r2l(s[0]),n.MIN_MS+1e3,n.MAX_MS-1e3);s[0]=e.l2r(c-1e3),s[1]=e.l2r(c+1e3);break}}else{if(!o(s[i]))if(!(l||u)&&o(s[1-i]))s[i]=s[1-i]*(i?10:.1);else{e[t]=a;break}if(s[i]<-f?s[i]=-f:s[i]>f&&(s[i]=f),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}},e.setScale=function(r){var i,n,a=t._size;if(e.overlaying){var o=_.getFromId({_fullLayout:t},e.overlaying);e.domain=o.domain}var s=r&&e._r?"_r":"range",l=e.calendar;e.cleanRange(s);var u=e.r2l(e[s][0],l),c=e.r2l(e[s][1],l),h="y"===M;if(h?(e._offset=a.t+(1-e.domain[1])*a.h,e._length=a.h*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c):(e._offset=a.l+e.domain[0]*a.w,e._length=a.w*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(u,c),Math.max(u,c)),e._rangebreaks.length)){for(i=0;ic&&(d=!d),d&&e._rangebreaks.reverse();var f=d?-1:1;for(e._m2=f*e._length/(Math.abs(c-u)-e._lBreaks),e._B.push(-e._m2*(h?c:u)),i=0;ia&&(a+=7,oa&&(a+=24,o=i&&o=i&&t=s.min&&(es.max&&(s.max=i),a=!1)}a&&u.push({min:e,max:i})}};for(i=0;i2*s}(h,t))return"date";var g="strict"!==i.autotypenumbers;return!function(e,t){for(var r=e.length,i=u(r),a=0,o=0,c={},h=0;h2*a}(h,g)?!function(e,t){for(var i,n=e.length,a=0;a0&&((M=C-s(_)-l(w))>I?k/M>L&&(T=_,A=w,L=k/M):k/C>L&&(T={val:_.val,nopad:1},A={val:w.val,nopad:1},L=k/C));if(m===g){var P=m-1,z=m+1;if(E)if(0===m)a=[0,1];else{var F=(m>0?h:c).reduce(function(e,t){return Math.max(e,l(t))},0),O=m/(1-Math.min(.5,F/C));a=m>0?[0,O]:[O,0]}else a=D?[Math.max(0,P),Math.max(1,z)]:[P,z]}else E?(T.val>=0&&(T={val:0,nopad:1}),A.val<=0&&(A={val:0,nopad:1})):D&&(T.val-L*s(T)<0&&(T={val:0,nopad:1}),A.val<=0&&(A={val:1,nopad:1})),L=(A.val-T.val-d(t,_.val,w.val))/(C-s(T)-l(A)),a=[T.val-L*s(T),A.val+L*l(A)];return a=b(a,t),t.limitRange&&t.limitRange(),v&&a.reverse(),n.simpleMap(a,t.l2r||Number)}function d(e,t,r){var i=0;if(e.rangebreaks)for(var n=e.locateBreaks(t,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),E=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),D=k(r.vpadplus||r.vpad),C=k(r.vpadminus||r.vpad);if(!A){if(d=1/0,f=-1/0,T)for(n=0;n0&&(d=o),o>f&&o-a&&(d=o),o>f&&o=P;n--)L(n);return{min:p,max:x,opts:r}},concatExtremes:p};function m(e,t,r,i,n){for(var a=i.tozero,o=i.extrapad,s=!0,l=0;l=r&&(u.extrapad||!o)){s=!1;break}n(t,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(e.splice(l,1),l--)}if(s){var c=a&&0===t;e.push({val:t,pad:c?0:r,extrapad:!c&&o})}}function g(e){return i(e)&&Math.abs(e)=t}function x(e,t,r){return void 0===t||void 0===r||(t=e.d2l(t))<(r=e.d2l(r))}function b(e,t){if(!t||!t.autorangeoptions)return e;var r,i,a,o,s=e[0],l=e[1],u=t.autorangeoptions.include;if(void 0!==u){var c=t.d2l(s),h=t.d2l(l);n.isArrayOrTypedArray(u)||(u=[u]);for(var d=0;d=f&&(c=f,s=f),h<=f&&(h=f,l=f)}}return r=s,s=(i=t.autorangeoptions)&&void 0!==i.minallowed&&x(t,i.minallowed,i.maxallowed)?i.minallowed:i&&void 0!==i.clipmin&&x(t,i.clipmin,i.clipmax)?Math.max(r,t.d2l(i.clipmin)):r,a=l,[s,l=(o=t.autorangeoptions)&&void 0!==o.maxallowed&&x(t,o.minallowed,o.maxallowed)?o.maxallowed:o&&void 0!==o.clipmax&&x(t,o.clipmin,o.clipmax)?Math.min(a,t.d2l(o.clipmax)):a]}}}),ro=m({"src/plots/cartesian/axes.js"(e,t){var r=M(),i=I(),n=tO(),a=e1(),o=tb(),s=o.strTranslate,l=tj(),u=rr(),c=er(),h=rt(),d=tU(),f=tW(),p=(tC(),L()),m=p.ONEMAXYEAR,g=p.ONEAVGYEAR,y=p.ONEMINYEAR,v=p.ONEMAXQUARTER,x=p.ONEAVGQUARTER,b=p.ONEMINQUARTER,_=p.ONEMAXMONTH,w=p.ONEAVGMONTH,T=p.ONEMINMONTH,A=p.ONEWEEK,k=p.ONEDAY,S=k/2,E=p.ONEHOUR,D=p.ONEMIN,C=p.ONESEC,P=p.ONEMILLI,z=p.ONEMICROSEC,F=p.MINUS_SIGN,O=p.BADNUM,R={K:"zeroline"},B={K:"gridline",L:"path"},j={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},V={K:"tick",L:"text"},U={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},q=tB(),G=q.MID_SHIFT,H=q.CAP_SHIFT,$=q.LINE_SPACING,W=q.OPPOSITE_SIDE,Y=t.exports={};Y.setConvert=ri();var Z=rn(),X=tI(),K=X.idSort,J=X.isLinked;Y.id2name=X.id2name,Y.name2id=X.name2id,Y.cleanId=X.cleanId,Y.list=X.list,Y.listIds=X.listIds,Y.getFromId=X.getFromId,Y.getFromTrace=X.getFromTrace;var Q=ra();function ee(e){var t=(e[1]-e[0])*1e-4;return[e[0]-t,e[1]+t]}Y.getAutoRange=Q.getAutoRange,Y.findExtremes=Q.findExtremes,Y.coerceRef=function(e,t,r,i,n,a){var s=i.charAt(i.length-1),l=r._fullLayout._subplots[s+"axis"],u=i+"ref",c={};return n||(n=l[0]||("string"==typeof a?a:a[0])),a||(a=n),l=l.concat(l.map(function(e){return e+" domain"})),c[u]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:n},o.coerce(e,t,c,u)},Y.coerceRefArray=function(e,t,r,i,n,a,s){let l=i.charAt(i.length-1);var u=r._fullLayout._subplots[l+"axis"];let c=i+"ref";var h=e[c];n||(n=u[0]||("string"==typeof a?a:a[0])),u=(u=u.concat(u.map(e=>e+" domain"))).concat(a||[]),h.length>s?(o.warn("Array attribute "+c+" has more entries than expected, truncating to "+s),h=h.slice(0,s)):h.lengthMath.abs((e/t+.5)%1-.5)}function eo(e,t){return .001>Math.abs(e/t-1)}function es(e){return+e.substring(1)}function el(e,t){return e.rangebreaks&&(t=t.filter(function(t){return e.maskBreaks(t.x)!==O})),t}function eu(e,t){var r=ee(o.simpleMap(e.range,e.r2l)),i=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]),a="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var s=[],l=0;l<=1;l++)if(!(void 0!==t&&(t&&l||!1===t&&!l))&&!(l&&!e.minor)){var u=l?e.minor.tickvals:e.tickvals,c=l?[]:e.ticktext;if(u){o.isArrayOrTypedArray(c)||(c=[]);var h=-1,d=-1;if(!l)for(var f=0;fi&&pi&&g2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},Y.saveRangeInitial=function(e,t){for(var r=Y.list(e,"",!0),i=!1,n=0;n.3*d||c(n)||c(a))){var f=r.dtick/2;e+=e+f.8){var s=Number(r.slice(1));a.exactYears>.8&&s%12==0?e=Y.tickIncrement(e,"M6","reverse")+1.5*k:a.exactMonths>.8?e=Y.tickIncrement(e,"M1","reverse")+15.5*k:e-=S;var l=Y.tickIncrement(e,r);if(l<=i)return l}return e}(v,e,y,l,a)),m=v,g=0;m<=u;)m=Y.tickIncrement(m,y,!1,a),g++;return{start:t.c2r(v,0,a),end:t.c2r(m,0,a),size:y,_dataSpan:u-l}},Y.prepMinorTicks=function(e,t,r){var n,a;if(!(null!=(n=t.minor)&&n.dtick)){delete e.dtick;var s,l=t.dtick&&i(t._tmin);if(l){var u=Y.tickIncrement(t._tmin,t.dtick,!0);s=[t._tmin,.99*u+.01*t._tmin]}else{var c=o.simpleMap(t.range,t.r2l);s=[c[0],.8*c[0]+.2*c[1]]}if(e.range=o.simpleMap(s,t.l2r),e._isMinor=!0,Y.prepTicks(e,r),l){var h=i(t.dtick),d=i(e.dtick),f=h?t.dtick:+t.dtick.substring(1),p=d?e.dtick:+e.dtick.substring(1);h&&d?ea(f,p)?f===2*A&&p===2*k&&(e.dtick=A):f===2*A&&p===3*k?e.dtick=A:f!==A||(t._input.minor||{}).nticks?eo(f/p,2.5)?e.dtick=f/2:e.dtick=f:e.dtick=k:"M"===String(t.dtick).charAt(0)?d?e.dtick="M1":ea(f,p)?f>=12&&2===p&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ea(f,p)||(e.dtick=eo(f/p,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}(null==(a=t.minor)?void 0:a._tick0Init)===void 0&&(e.tick0=t.tick0)},Y.prepTicks=function(e,t){var r=o.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?o.bigFont(e.tickfont.size||12):15,a=e._length/n):(n="y"===e._id.charAt(0)?40:80,a=o.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(a*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(a*=100),e._roughDTick=Math.abs(r[1]-r[0])/a,Y.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){function t(){return!(i(e.dtick)||"M"!==e.dtick.charAt(0))}var r,n=t(),a=Y.getTickFormat(e);if(a){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(r=E,o&&!n&&e.dtickes(e.dtick):e.dtickes(e.dtick):e.dtickes(e.dtick):e.dticke.range[1],c=!e.ticklabelindex||o.isArrayOrTypedArray(e.ticklabelindex)?e.ticklabelindex:[e.ticklabelindex],h=o.simpleMap(e.range,e.r2l,void 0,void 0,t),d=h[1]=+!N;V--){var U,q=!V;V?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):N&&(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var G=V?e:o.extendFlat({},e,N?e.minor:{minor:{}});if(q?Y.prepMinorTicks(G,e,t):Y.prepTicks(G,t),"array"===G.tickmode){V?(F=[],I=eu(e,!q)):(R=[],L=eu(e,!q));continue}if("sync"===G.tickmode){F=[],I=function(e){var t=e._mainAxis,r=[];if(t._vals){for(var i=-1,n=-1,a=0;a=W:et<=W;et=Y.tickIncrement(et,er,d,a)){if(V&&J++,G.rangebreaks&&!d){if(et<$)continue;if(G.maskBreaks(et)===O&&eR(et,G)>=p)break}if(F.length>M||et===Q)break;Q=et;var en={value:function(e,t,r){if(![r,e,t].every(i)||0===r)return e;let n=Math.round((e-t)/r),a=t+n*r;return e!==a&&Math.abs(e-a)<1e-6*Math.abs(r)?a:e}(et,ei,er)};V?(et===K&&(en.first=!0),X&&et!==(0|et)&&(en.simpleLabel=!0),s>1&&J%s&&(en.skipLabel=!0),F.push(en)):(en.minor=!0,R.push(en))}}if(!R||R.length<3?c=!1:(ex=(R[2].value-R[1].value)*(u?-1:1),eb=e.tickformat,(/%f/.test(eb)?ex>=z:/%L/.test(eb)?ex>=P:/%[SX]/.test(eb)?ex>=C:/%M/.test(eb)?ex>=D:/%[HI]/.test(eb)?ex>=E:/%p/.test(eb)?ex>=S:/%[Aadejuwx]/.test(eb)?ex>=k:/%[UVW]/.test(eb)?ex>=A:/%[Bbm]/.test(eb)?ex>=T:/%[q]/.test(eb)?ex>=b:!/%[Yy]/.test(eb)||ex>=y)||(c=!1,R=R.slice(1))),c){var ea=F.concat(R);l&&F.length&&(ea=ea.slice(1)),(ea=ea.sort(function(e,t){return e.value-t.value}).filter(function(e,t,r){return 0===t||e.value!==r[t-1].value})).map(function(e,t){return void 0!==e.minor||e.skipLabel?null:t}).filter(function(e){return null!==e}).forEach(function(e){c.map(function(t){var r=e+t;r>=0&&r0?i-1:i,s=i);var l=e[o].value,u=Math.abs(e[s].value-l),c=r||u,h=0;c>=y?h=u>=y&&u<=m?u:g:r===x&&c>=b?h=u>=b&&u<=v?u:x:c>=T?h=u>=T&&u<=_?u:w:r===A&&c>=A?h=A:c>=k?h=k:r===S&&c>=S?h=S:r===E&&c>=E&&(h=E),h>=u&&(h=u,n=!0);var d=a+h;if(t.rangebreaks&&h>0){for(var f=0,p=0;p<84;p++){var M=(p+.5)/84;t.maskBreaks(a*(1-M)+M*d)!==O&&f++}(h*=f/84)||(e[i].drop=!0),n&&u>A&&(h=u)}(h>0||0===i)&&(e[i].periodX=a+h/2)}}(B,e,e._definedDelta),e.rangebreaks){var em="y"===e._id.charAt(0),eg=1;"auto"===e.tickmode&&(eg=e.tickfont?e.tickfont.size:12);var ey=0/0;for(e_=F.length-1;e_>-1;e_--){if(F[e_].drop){F.splice(e_,1);continue}F[e_].value=eR(F[e_].value,e);var ev=e.c2p(F[e_].value);(em?ey>ev-eg:eyp||ip&&(r.periodX=p),i10||"01-01"!==n.slice(5)?e._tickround="d":e._tickround=t.slice(1)%12==0?"y":"m";else if(t>=k&&a<=10||t>=15*k)e._tickround="d";else if(t>=D&&a<=16||t>=E)e._tickround="M";else if(t>=C&&a<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(a,o)-20,e._tickround<0&&(e._tickround=4)}}else if(i(t)||"L"===t.charAt(0)){var s=e.range.map(e.r2d||Number);i(t)||(t=Number(t.slice(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var l=Math.floor(Math.log(Math.max(Math.abs(s[0]),Math.abs(s[1])))/Math.LN10+.01);Math.abs(l)>(void 0===e.minexponent?3:e.minexponent)&&(ew(e.exponentformat)&&"SI extended"!==e.exponentformat&&!eT(l)||ew(e.exponentformat)&&"SI extended"===e.exponentformat&&!eA(l)?e._tickexponent=3*Math.round((l-1)/3):e._tickexponent=l)}else e._tickround=null}function ex(e,t,r){var i=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:i.size,font:i.family,fontWeight:i.weight,fontStyle:i.style,fontVariant:i.variant,fontTextcase:i.textcase,fontLineposition:i.lineposition,fontShadow:i.shadow,fontColor:i.color}}Y.autoTicks=function(e,t,r){var n;function a(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=o.dateTick0(e.calendar,0);var s=2*t;if(s>g)t/=g,n=a(10),e.dtick="M"+12*ey(t,n,ec);else if(s>w)e.dtick="M"+ey(t/=w,1,eh);else if(s>k){if(e.dtick=ey(t,k,e._hasDayOfWeekBreaks?[1,2,7,14]:ef),!r){var l=Y.getTickFormat(e),u="period"===e.ticklabelmode;u&&(e._rawTick0=e.tick0),/%[uVW]/.test(l)?e.tick0=o.dateTick0(e.calendar,2):e.tick0=o.dateTick0(e.calendar,1),u&&(e._dowTick0=e.tick0)}}else s>E?e.dtick=ey(t,E,eh):s>D?e.dtick=ey(t,D,ed):s>C?e.dtick=ey(t,C,ed):(n=a(10),e.dtick=ey(t,n,ec))}else if("log"===e.type){e.tick0=0;var c=o.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(1>Math.abs(c[1]-c[0])){var h=1.5*Math.abs((c[1]-c[0])/t);t=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/h,n=a(10),e.dtick="L"+ey(t,n,ec)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):eO(e)?(e.tick0=0,e.dtick=ey(t,n=1,eg)):(e.tick0=0,n=a(10),e.dtick=ey(t,n,ec));if(0===e.dtick&&(e.dtick=1),!i(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},Y.tickIncrement=function(e,t,n,a){var s=n?-1:1;if(i(t))return o.increment(e,s*t);var l=t.charAt(0),u=s*Number(t.slice(1));if("M"===l)return o.incrementMonth(e,u,a);if("L"===l)return Math.log(Math.pow(10,e)+u)/Math.LN10;if("D"===l){var c="D2"===t?em:ep,h=e+.01*s,d=o.roundUp(o.mod(h,1),c,n);return Math.floor(h)+Math.log(r.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},Y.tickFirst=function(e,t){var n=e.r2l||Number,a=o.simpleMap(e.range,n,void 0,void 0,t),s=a[1]=0&&r<=e._length?t:null};if(M&&o.isArrayOrTypedArray(e.ticktext)){var C=o.simpleMap(e.range,e.r2l),I=(Math.abs(C[1]-C[0])-(e._lBreaks||0))/1e4;for(_=0;_ ")}else e._prevDateHead=l,u+="
"+l;t.text=u}(e,A,r,k):"log"===S?function(e,t,r,n){var a=e.dtick,s=t.x,l=e.tickformat,u="string"==typeof a&&a.charAt(0);if("never"===n&&(n=""),r&&"L"!==u&&(a="L3",u="L"),l||"L"===u)t.text=eM(Math.pow(10,s),e,n,r);else if(i(a)||"D"===u&&("complete"===e.minorloglabels||.1>o.mod(s+.01,1))){"complete"!==e.minorloglabels||.1>o.mod(s+.01,1)||(t.fontSize*=.75);var c=Math.pow(10,s).toExponential(0).split("e"),h=+c[1],d=Math.abs(h),f=e.exponentformat;"power"===f||ew(f)&&"SI extended"!==f&&eT(h)||ew(f)&&"SI extended"===f&&eA(h)?(t.text=c[0],d>0&&(t.text+="x10"),"1x10"===t.text&&(t.text="10"),0!==h&&1!==h&&(t.text+=""+(h>0?"":F)+d+""),t.fontSize*=1.25):("e"===f||"E"===f)&&d>2?t.text=c[0]+f+(h>0?"+":F)+d:(t.text=eM(Math.pow(10,s),e,"","fakehover"),"D1"===a&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else if("D"===u)t.text="none"===e.minorloglabels?"":String(Math.round(Math.pow(10,o.mod(s,1)))),t.fontSize*=.75;else throw"unrecognized dtick "+String(a);if("D1"===e.dtick){var p=String(t.text).charAt(0);("0"===p||"1"===p)&&("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,A,k,P):"category"===S?(s=e,l=A,void 0===(u=s._categories[Math.round(l.x)])&&(u=""),l.text=String(u)):"multicategory"===S?(c=e,h=A,d=r,f=Math.round(h.x),m=void 0===(p=c._categories[f]||[])[1]?"":String(p[1]),g=void 0===p[0]?"":String(p[0]),d?h.text=g+" - "+m:(h.text=m,h.text2=g)):eO(e)?function(e,t,r,i,n){if("radians"!==e.thetaunit||r)t.text=eM(t.x,e,n,i);else{var a=t.x/180;if(0===a)t.text="0";else{var s=function(e){function t(e,t){return 1e-6>=Math.abs(e-t)}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),i=e*r,n=Math.abs(function e(r,i){return t(i,0)?r:e(i,r%i)}(i,r));return[Math.round(i/n),Math.round(r/n)]}(a);if(s[1]>=100)t.text=eM(o.deg2rad(t.x),e,n,i);else{var l=t.x<0;1===s[1]?1===s[0]?t.text="π":t.text=s[0]+"π":t.text=["",s[0],"","⁄","",s[1],"","π"].join(""),l&&(t.text=F+t.text)}}}}(e,A,r,k,P):(y=e,v=A,x=k,"never"===(b=P)?b="":"all"===y.showexponent&&1e-6>Math.abs(v.x/y.dtick)&&(b="hide"),v.text=eM(v.x,y,b,x)),n||(e.tickprefix&&!L(e.showtickprefix)&&(A.text=e.tickprefix+A.text),e.ticksuffix&&!L(e.showticksuffix)&&(A.text+=e.ticksuffix)),e.labelalias&&e.labelalias.hasOwnProperty(A.text)){var z=e.labelalias[A.text];"string"==typeof z&&(A.text=z)}return("boundaries"===e.tickson||e.showdividers)&&(A.xbnd=[D(A.x-.5),D(A.x+e.dtick-.5)]),A},Y.hoverLabelText=function(e,t,r){r&&(e=o.extendFlat({},e,{hoverformat:r}));var i=o.isArrayOrTypedArray(t)?t[0]:t,n=o.isArrayOrTypedArray(t)?t[1]:void 0;if(void 0!==n&&n!==i)return Y.hoverLabelText(e,i,r)+" - "+Y.hoverLabelText(e,n,r);var a="log"===e.type&&i<=0,s=Y.tickText(e,e.c2l(a?-i:i),"hover").text;return a?0===i?"0":F+s:s};var eb=["f","p","n","μ","m","","k","M","G","T"],e_=["q","r","y","z","a",...eb,"P","E","Z","Y","R","Q"],ew=e=>["SI","SI extended","B"].includes(e);function eT(e){return e>14||e<-15}function eA(e){return e>32||e<-30}function eM(e,t,r,n){var a,s,l,u=e<0,c=t._tickround,h=r||t.exponentformat||"B",d=t._tickexponent,f=Y.getTickFormat(t),p=t.separatethousands;if(n){var m={exponentformat:h,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:i(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};ev(m),c=(Number(m._tickround)||0)+4,d=m._tickexponent,t.hoverformat&&(f=t.hoverformat)}if(f)return t._numFormat(f)(e).replace(/-/g,F);"none"===h&&(d=0);let g=Math.pow(10,-c)/2;if((e=Math.abs(e))"+l+"":"B"===h&&9===d?e+="B":ew(h)&&(e+="SI extended"===h?e_[d/3+10]:eb[d/3+5])),u?F+e:e}function ek(e,t){if(e){var r=Object.keys(U).reduce(function(e,r){return -1!==t.indexOf(r)&&U[r].forEach(function(t){e[t]=1}),e},{});Object.keys(e).forEach(function(t){r[t]||(1===t.length?e[t]=0:delete e[t])})}}function eS(e){return void 0!==e.periodX?e.periodX:e.x}function eE(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join("_")}function eD(e){var t=e.title.font.size,r=(e.title.text.match(l.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty("standoff")?t*(H+r*$):r?t*(r+1)*$:t}function eC(e,t){var r=e.l2p(t);return r>1&&r=n.min&&e0)switch(e.type){case"date":case"linear":for(t=0;t=i(e))}(e.dtick,i.dtickrange,n)){r=i;break}break;case"log":for(t=0;t=0,o=0>=a(e,t[1]);return(r||n)&&(i||o)}(e.dtick,i.dtickrange)){r=i;break}}return r?r.value:e.tickformat},Y.getSubplots=function(e,t){var r=e._fullLayout._subplots,i=r.cartesian.concat(r.gl2d||[]),n=t?Y.findSubplotsWithAxis(i,t):i;return n.sort(function(e,t){var r=e.slice(1).split("y"),i=t.slice(1).split("y");return r[0]===i[0]?r[1]-i[1]:r[0]-i[0]}),n},Y.findSubplotsWithAxis=function(e,t){for(var r=new RegExp("x"===t._id.charAt(0)?"^"+t._id+"y":t._id+"$"),i=[],n=0;n=0&&n.unshift(n.splice(i,1).shift())}});var s={false:{left:0,right:0}};return o.syncOrAsync(n.map(function(t){return function(){if(t){var i=Y.getFromId(e,t);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var n=Y.drawOne(e,i,r);return i._shiftPusher&&eN(i,i._fullDepth||0,s,!0),i._r=i.range.slice(),i._rl=o.simpleMap(i._r,i.r2l),n}}}))},Y.drawOne=function(e,t,r){var i,s,d,f=(r=r||{}).axShifts||{},p=r.overlayingShiftedAx||[];t.setScale();var m=e._fullLayout,g=t._id,y=g.charAt(0),v=Y.counterLetter(g),x=m._plots[t._mainSubplot],b="above traces"===t.zerolinelayer;if(x){if(t._shiftPusher=t.autoshift||-1!==p.indexOf(t._id)||-1!==p.indexOf(t.overlaying),t._shiftPusher&"free"===t.anchor){var _=t.linewidth/2||0;"inside"===t.ticks&&(_+=t.ticklen),eN(t,_,f,!0),eN(t,t.shift||0,f,!1)}(!0!==r.skipTitle||void 0===t._shift)&&(D=t,C=f,t._shift=D.autoshift?C[D.overlaying][D.side]:D.shift||0);var w=x[y+"axislayer"],T=t._mainLinePosition,A=T+=t._shift,M=t._mainMirrorPosition,k=t._vals=Y.calcTicks(t),S=[t.mirror,A,M].join("_");for(i=0;i0?r.bottom-c:0,h))));var d=0,f=0;if(t._shiftPusher&&(d=Math.max(h,r.height>0?"l"===l?c-r.left:r.right-c:0),t.title.text!==m._dfltTitle[y]&&(f=(t._titleStandoff||0)+(t._titleScoot||0),"l"===l&&(f+=eD(t))),t._fullDepth=Math.max(d,f)),t.automargin){i={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1],g="number"==typeof t._shift?t._shift:0;if("x"===y){if("b"===l?i[l]=t._depth:(i[l]=t._depth=Math.max(r.width>0?c-r.top:0,h),p.reverse()),r.width>0){var x=r.right-(t._offset+t._length);x>0&&(i.xr=1,i.r=x);var b=t._offset-r.left;b>0&&(i.xl=0,i.l=b)}}else if("l"===l?(t._depth=Math.max(r.height>0?c-r.left:0,h),i[l]=t._depth-g):(t._depth=Math.max(r.height>0?r.right-c:0,h),i[l]=t._depth+g,p.reverse()),r.height>0){var _=r.bottom-(t._offset+t._length);_>0&&(i.yb=0,i.b=_);var w=t._offset-r.top;w>0&&(i.yt=1,i.t=w)}i[v]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==m._dfltTitle[y]&&(i[l]+=eD(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(o[u]+=h),!0===t.mirror||"ticks"===t.mirror?o[v]=t._anchorAxis.domain[p[1]]:("all"===t.mirror||"allticks"===t.mirror)&&(o[v]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ep&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ek(i,t.automargin),ek(o,t.automargin)),n.autoMargin(e,eL(t),i),n.autoMargin(e,eP(t),o),n.autoMargin(e,ez(t),s)}),o.syncOrAsync(ed)}}function em(e){var r=g+(e||"tick");return E[r]||(E[r]=function(e,t,r){var i,n,a,o;if(e._selections[t].size())i=1/0,n=-1/0,a=1/0,o=-1/0,e._selections[t].each(function(){var e=eI(this);if("none"!==e.node().style.display){var t=h.bBox(e.node().parentNode);i=Math.min(i,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),o=Math.max(o,t.right)}});else{var s=Y.makeLabelFns(e,r);i=n=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:i,bottom:n,left:a,right:o,height:n-i,width:o-a}}(t,r,A)),E[r]}},Y.getTickSigns=function(e,t){var r=e._id.charAt(0),i=e.side===({x:"top",y:"right"})[r]?1:-1,n=[-1,1,i,-i];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(n=n.map(function(e){return-e})),e.side&&n.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),n},Y.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},Y.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=e.tickson||"",i=function(e){return -1!==t.indexOf(e)},n=i("top"),a=i("left"),o=i("right"),s=i("bottom"),l=i("inside"),u="boundaries"!==r&&(s||a||n||o);if(!u&&!l)return[0,0];var c=e.side,h=u?(e.tickwidth||0)/2:0,d=3,f=e.tickfont?e.tickfont.size:12;return(s||n)&&(h+=f*H,d+=(e.linewidth||0)/2),(a||o)&&(h+=(e.linewidth||0)/2,d+=3),l&&"top"===c&&(d-=f*(1-H)),(a||n)&&(h=-h),("bottom"===c||"right"===c)&&(d=-d),[u?h:0,l?d:0]}(e),r=e.ticklabelshift||0,i=e.ticklabelstandoff||0,n=t[0],a=t[1],o=e.range[0]>e.range[1],l=e.ticklabelposition&&-1!==e.ticklabelposition.indexOf("inside");if(r&&(r*=o?-1:1),i){var u=e.side;i*=l&&("top"===u||"left"===u)||!l&&("bottom"===u||"right"===u)?1:-1}return"x"===e._id.charAt(0)?function(t){return s(n+e._offset+e.l2p(eS(t))+r,a+i)}:function(t){return s(a+i,n+e._offset+e.l2p(eS(t))+r)}},Y.makeTickPath=function(e,t,r,i){i||(i={});var n=i.minor;if(n&&!e.minor)return"";var a=void 0!==i.len?i.len:n?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),s=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+s*r)+"v"+a*r:"M"+(t+s*r)+",0h"+a*r},Y.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",a=e.tickson||"",s=function(e){return -1!==n.indexOf(e)},l=s("top"),u=s("left"),c=s("right"),h=s("bottom"),d="boundaries"!==a&&(h||u||l||c),f=s("inside"),p="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==a,m=0,g=0,y=p?e.ticklen:0;if(f?y*=-1:d&&(y=0),p&&(m+=y,r)){var v=o.deg2rad(r);m=y*Math.cos(v)+1,g=y*Math.sin(v)}e.showticklabels&&(p||e.showline)&&(m+=.2*e.tickfont.size);var x,b,_,w,T,A={labelStandoff:m+=(e.linewidth||1)/2*(f?-1:1),labelShift:g},M=0,k=e.side,S=e._id.charAt(0),E=e.tickangle;if("x"===S)w=(T=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(w*=-1),x=g*w,b=t+m*w,_=T?1:-.2,90===Math.abs(E)&&(f?_+=G:_=-90===E&&"bottom"===k?H:90===E&&"top"===k?G:.5,M=G/2*(E/90)),A.xFn=function(e){return e.dx+x+M*e.fontSize},A.yFn=function(e){return e.dy+b+e.fontSize*_},A.anchorFn=function(e,t){if(d){if(u)return"end";if(c)return"start"}return i(t)&&0!==t&&180!==t?t*w<0!==f?"end":"start":"middle"},A.heightFn=function(t,r,i){return r<-60||r>60?-.5*i:"top"===e.side!==f?-i:0};else if("y"===S){if(w=(T=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(w*=-1),x=m,b=g*w,_=0,f||90!==Math.abs(E)||(_=-90===E&&"left"===k||90===E&&"right"===k?H:.5),f){var D=i(E)?+E:0;0!==D&&(M=Math.abs(Math.sin(o.deg2rad(D)))*H*w,_=0)}A.xFn=function(e){return e.dx+t-(x+e.fontSize*_)*w+M*e.fontSize},A.yFn=function(e){return e.dy+b+e.fontSize*G},A.anchorFn=function(e,t){return i(t)&&90===Math.abs(t)?"middle":T?"end":"start"},A.heightFn=function(t,r,i){return"right"===e.side&&(r*=-1),r<-30?-i:r<30?-.5*i:0}}return A},Y.drawTicks=function(e,t,i){i=i||{};var n=t._id+"tick",a=[].concat(t.minor&&t.minor.ticks?i.vals.filter(function(e){return e.minor&&!e.noTick}):[]).concat(t.ticks?i.vals.filter(function(e){return!e.minor&&!e.noTick}):[]),o=i.layer.selectAll("path."+n).data(a,eE);o.exit().remove(),o.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==i.crisp).each(function(e){return c.stroke(r.select(this),e.minor?t.minor.tickcolor:t.tickcolor)}).style("stroke-width",function(r){return h.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"}).attr("d",i.path).style("display",null),ej(t,[N]),o.attr("transform",i.transFn)},Y.drawGrid=function(e,t,i){if(i=i||{},"sync"!==t.tickmode){var n=t._id+"grid",a=t.minor&&t.minor.showgrid,o=a?i.vals.filter(function(e){return e.minor}):[],s=t.showgrid?i.vals.filter(function(e){return!e.minor}):[],l=i.counterAxis;if(l&&Y.shouldShowZeroLine(e,t,l))for(var u="array"===t.tickmode,d=0;d=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+n).data(y?s:o,eE);x.exit().remove(),x.enter().append("path").classed(n,1).classed("crisp",!1!==i.crisp),x.attr("transform",i.transFn).attr("d",i.path).each(function(e){return c.stroke(r.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")}).style("stroke-dasharray",function(e){return h.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)}).style("stroke-width",function(e){return(e.minor?p:t._gw)+"px"}).style("display",null),"function"==typeof i.path&&x.attr("d",i.path)}}ej(t,[B,j])}},Y.drawZeroLine=function(e,t,r){r=r||r;var i=t._id+"zl",n=Y.shouldShowZeroLine(e,t,r.counterAxis),a=r.layer.selectAll("path."+i).data(n?[{x:0,id:t._id}]:[]);a.exit().remove(),a.enter().append("path").classed(i,1).classed("zl",1).classed("crisp",!1!==r.crisp).each(function(){r.layer.selectAll("path").sort(function(e,t){return K(e.id,t.id)})}),a.attr("transform",r.transFn).attr("d",r.path).call(c.stroke,t.zerolinecolor||c.defaultLine).style("stroke-width",h.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),ej(t,[R])},Y.drawLabels=function(e,t,n){n=n||{};var a=e._fullLayout,u=t._id,c="above traces"===t.zerolinelayer,d=n.cls||u+"tick",f=n.vals.filter(function(e){return e.text}),p=n.labelFns,m=n.secondary?0:t.tickangle,g=(t._prevTickAngles||{})[d],y=n.layer.selectAll("g."+d).data(t.showticklabels?f:[],eE),v=[];function x(e,a){e.each(function(e){var o=r.select(this),u=o.select(".text-math-group"),c=p.anchorFn(e,a),d=n.transFn.call(o.node(),e)+(i(a)&&0!=+a?" rotate("+a+","+p.xFn(e)+","+(p.yFn(e)-e.fontSize/2)+")":""),f=l.lineCount(o),m=$*e.fontSize,g=p.heightFn(e,i(a)?+a:0,(f-1)*m);if(g&&(d+=s(0,g)),u.empty()){var y=o.select("text");y.attr({transform:d,"text-anchor":c}),y.style("display",null),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var v=h.bBox(u.node()).width;u.attr("transform",d+s(v*({end:-.5,start:.5})[c],0))}})}y.enter().append("g").classed(d,1).append("text").attr("text-anchor","middle").each(function(t){var i=r.select(this),n=e._promises.length;i.call(l.positionText,p.xFn(t),p.yFn(t)).call(h.font,{family:t.font,size:t.fontSize,color:t.fontColor,weight:t.fontWeight,style:t.fontStyle,variant:t.fontVariant,textcase:t.fontTextcase,lineposition:t.fontLineposition,shadow:t.fontShadow}).text(t.text).call(l.convertToTspans,e),e._promises[n]?v.push(e._promises.pop().then(function(){x(i,m)})):x(i,m)}),ej(t,[V]),y.exit().remove(),n.repositionOnUpdate&&y.each(function(e){r.select(this).select("text").call(l.positionText,p.xFn(e),p.yFn(e))}),t._adjustTickLabelsOverflow=function(){var i=t.ticklabeloverflow;if(!(!i||"allow"===i)){var n=-1!==i.indexOf("hide"),s="x"===t._id.charAt(0),l=0,u=s?e._fullLayout.width:e._fullLayout.height;if(-1!==i.indexOf("domain")){var c=o.simpleMap(t.range,t.r2l);l=t.l2p(c[0])+t._offset,u=t.l2p(c[1])+t._offset}var d=Math.min(l,u),f=Math.max(l,u),p=t.side,m=1/0,g=-1/0;for(var v in y.each(function(e){var i=r.select(this);if(i.select(".text-math-group").empty()){var a=h.bBox(i.node()),o=0;s?(a.right>f||a.leftf||a.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+i._id]?l.style("display","none"):"tick"!==e.K||n||"none"===l.node().style.display||l.style("display",null)})})})})},x(y,g+1?g:m);var b=null;t._selections&&(t._selections[d]=y);var _=[function(){return v.length&&Promise.all(v)}];t.automargin&&a._redrawFromAutoMarginCount&&90===g?(b=g,_.push(function(){x(y,g)})):_.push(function(){if(x(y,m),f.length&&t.autotickangles&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=t.autotickangles[0];var e,r=0,i=[],a=1;y.each(function(e){r=Math.max(r,e.fontSize);var n=t.l2p(e.x),o=eI(this),s=h.bBox(o.node());a=Math.max(a,l.lineCount(o)),i.push({top:0,bottom:10,height:10,left:n-s.width/2,right:n+s.width/2+2,width:s.width+2})});var s=("boundaries"===t.tickson||t.showdividers)&&!n.secondary,u=f.length,c=Math.abs((f[u-1].x-f[0].x)*t._m)/(u-1),d=s?c/2:c,p=Math.sqrt(Math.pow(d,2)+Math.pow(s?t.ticklen:1.25*r*a,2)),g=d/p,v=t.autotickangles.map(function(e){return e*Math.PI/180}),_=v.find(function(e){return Math.abs(Math.cos(e))<=g});void 0===_&&(_=v.reduce(function(e,t){return Math.abs(Math.cos(e))O*F&&(L=F,D[E]=C[E]=P[E])}var U=Math.abs(L-I);U-M>0?(U-=M,M*=1+M/U):M=0,"y"!==t._id.charAt(0)&&(M=-M),D[S]=T.p2r(T.r2p(C[S])+k*M),"min"===T.autorange||"max reversed"===T.autorange?(D[0]=null,T._rangeInitial0=void 0,T._rangeInitial1=void 0):("max"===T.autorange||"min reversed"===T.autorange)&&(D[1]=null,T._rangeInitial0=void 0,T._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[T._name+".range"]=D}var q=o.syncOrAsync(_);return q&&q.then&&e._promises.push(q),q},Y.getPxPosition=function(e,t){var r,i=e._fullLayout._size,n=t._id.charAt(0),a=t.side;return("free"!==t.anchor?r=t._anchorAxis:"x"===n?r={_offset:i.t+(1-(t.position||0))*i.h,_length:0}:"y"===n&&(r={_offset:i.l+(t.position||0)*i.w+t._shift,_length:0}),"top"===a||"left"===a)?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},Y.shouldShowZeroLine=function(e,t,r){var i=o.simpleMap(t.range,t.r2l);return i[0]*i[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===O)&&(eC(t,0)||!function(e,t,r,i){var n=r._mainAxis;if(n){var a=e._fullLayout,o=t._id.charAt(0),s=Y.counterLetter(t._id),l=t._offset+(Math.abs(i[0])1)for(i=1;i4/3-s?o:s}}}),rd=m({"src/components/dragelement/cursor.js"(e,t){var r=tb(),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,n,a){return e="left"===n?0:"center"===n?1:"right"===n?2:r.constrain(Math.floor(3*e),0,2),i[t="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*t),0,2)][e]}}}),rf=m({"src/components/dragelement/unhover.js"(e,t){var r=tM(),i=ti(),n=eq().getGraphDiv,a=W(),o=t.exports={};o.wrapped=function(e,t,r){var s;(e=n(e))._fullLayout&&i.clear(e._fullLayout._uid+a.HOVERID);let l=e._hoverdata;o.raw(e,t,r)&&e._hoverAnywhereActive&&(e._hoverAnywhereActive=!1,null!=(s=e._fullLayout)&&s.hoveranywhere&&t?.target&&!l&&e.emit("plotly_unhover",{event:t,points:[]}))},o.raw=function(e,t){var i=e._fullLayout,n=e._hoverdata;return t||(t={}),(!t.target||!!e._dragged||!1!==r.triggerHandler(e,"plotly_beforehover",t))&&(i._hoverlayer.selectAll("g").remove(),i._hoverlayer.selectAll("line").remove(),i._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&n&&e.emit("plotly_unhover",{event:t,points:n}),!0)}}}),rp=m({"src/components/dragelement/index.js"(e,t){var r=ru(),i=tT(),n=rc(),a=tb().removeElement,o=tC(),s=t.exports={};s.align=rh(),s.getCursor=rd();var l=rf();function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=0x3b9ac9ff,t.background="none",document.body.appendChild(e),e}function c(e){return r(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(e){var t,r,l,h,d,f,p,m,g=e.gd,y=1,v=g._context.doubleClickDelay,x=e.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,n?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)"u"&&typeof n.clientY>"u"&&(n.clientX=t,n.clientY=r),(l=new Date().getTime())-g._mouseDownTimev&&(y=Math.max(y-1,1)),g._dragged)e.doneFn&&e.doneFn();else{var r;f.target===p?r=f:(r={target:p,srcElement:p,toElement:p},Object.keys(f).concat(Object.keys(f.__proto__)).forEach(e=>{var t=f[e];r[e]||"function"==typeof t||(r[e]=t)})),e.clickFn&&e.clickFn(y,r),m||p.dispatchEvent(new MouseEvent("click",t))}g._dragging=!1,g._dragged=!1}},s.coverSlip=u}}),rm=m({"src/lib/setcursor.js"(e,t){t.exports=function(e,t){(e.attr("class")||"").split(" ").forEach(function(t){0===t.indexOf("cursor-")&&e.classed(t,!1)}),t&&e.classed("cursor-"+t,!0)}}}),rg=m({"src/lib/override_cursor.js"(e,t){var r=rm(),i="data-savedcursor";t.exports=function(e,t){var n=e.attr(i);if(t){if(!n){for(var a=(e.attr("class")||"").split(" "),o=0;ot.legend.length)for(var i=t.legend.length;i+("legend"===e));if(!1===E&&(u[e]=void 0),!1===E&&!d.uirevision||(p("uirevision",u.uirevision),!1===E))return;p("borderwidth");var D,C,I,L=p("orientation"),P=p("yref"),z=p("xref"),F="h"===L,O="paper"===P,R="paper"===z,B="left";F?(D=0,r.getComponentMethod("rangeslider","isVisible")(t.xaxis)?O?(C=1.1,I="bottom"):(C=1,I="top"):O?(C=-.1,I="top"):(C=0,I="bottom")):(C=1,I="auto",R?D=1.02:(D=1,B="right")),i.coerce(d,f,{x:{valType:"number",editType:"legend",min:R?-2:0,max:R?3:1,dflt:D}},"x"),i.coerce(d,f,{y:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:C}},"y"),p("traceorder",w),l.isGrouped(u[e])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("indentation"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick");let j=p("groupclick");if(p("groupdoubleclick",j),p("xanchor",B),p("yanchor",I),p("maxheight"),p("valign"),i.noneOrAll(d,f,["x","y"]),p("title.text")){p("title.side",F?"left":"top");var N=i.extendFlat({},m,{size:i.bigFont(m.size)});i.coerceFont(p,"title.font",N);let e=h>1;p("titleclick",!!e&&"toggle"),p("titledoubleclick",!!e&&"toggleothers")}})(g,e,t,h,m.length),t[g]&&(t[g]._id=g),t._legends.push(g)}}}}),rb=m({"src/components/legend/handle_click.js"(e){var t=e1(),r=tb(),i=r.pushUnique,n=rv(),a=!0;e.handleItemClick=function(e,n,o,s,l){var u=n._fullLayout;if(n._dragged||n._editing)return;var c=e.data()[0][0];if(c.groupTitle&&c.noClick)return;let h=2===l?o.groupdoubleclick:o.groupclick;"toggle"===s&&"toggleothers"===o.itemdoubleclick&&a&&n.data&&n._context.showTips&&(r.notifier(r._(n,"Double-click on legend to isolate one trace"),"long",n),a=!1);var d="togglegroup"===h,f=u.hiddenlabels?u.hiddenlabels.slice():[],p=n._fullData;let m=(u.shapes||[]).filter(e=>e.showlegend||e.legendgroup);var g=p.concat(m),y=c.trace;y._isShape&&(y=u.shapes[y.index]);var v,x,b,_,w,T=y.legendgroup,A={},M=[],k=[],S=[],E=(u.shapes||[]).map(function(e){return e._input}),D=!1;function C(e,t){if(!(c.groupTitle&&!d)){var r,i,n,a=e._isShape,o=e.index;void 0===o&&(o=e._index);var s=!1!==e.visible&&t;a?(E[o].visible=s,D=!0):(r=o,i=M.indexOf(r),(n=A.visible)||(n=A.visible=[]),-1===M.indexOf(r)&&(M.push(r),i=M.length-1),n[i]=s)}}var I=y.legend;if(!y._isShape&&t.traceIs(y,"pie-like")){var L=c.label,P=f.indexOf(L);if("toggle"===s)-1===P?f.push(L):f.splice(P,1);else if("toggleothers"===s){var z=-1!==P,F=[];for(v=0;ve.showlegend||e.legendgroup),u=o.concat(l);function c(e){return(e.legend||"legend")===s}"toggle"===i?(p=!u.some(function(e){return c(e)&&!0===e.visible}),m=!1):(p=!0,m=!u.some(function(e){return!c(e)&&!0===e.visible&&!1!==e.showlegend}));let h={visible:[]},d=[],f=(a.shapes||[]).map(function(e){return e._input});for(var p,m,g=!1,y=0;yI&&(D=I)}S[o][0]._groupMinRank=D,S[o][0]._preGroupSort=o}var L=function(e,t){return(r(e.trace.legendrank)?e.trace.legendrank[e.i]:e.trace.legendrank)-(r(t.trace.legendrank)?t.trace.legendrank[t.i]:t.trace.legendrank)||e._preSort-t._preSort};for(S.forEach(function(e,t){e[0]._preGroupSort=t}),S.sort(function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort}),o=0;or?r:e}t.exports=function(e,t,g){var y=t._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,b=a((x+2*d.itemGap)/2,0),_=function(e,t,r,i){var n;if(e+1)n=e;else{if(!t||!(t.width>0))return 0;n=t.width}return v?i:Math.min(n,r)};function w(e,n,a){var u=e[0].trace,c=u.marker||{},h=c.line||{},d=c.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",f=a?u.visible&&u.type===a:i.traceIs(u,"bar"),p=r.select(n).select("g.legendpoints").selectAll("path.legend"+a).data(f?[e]:[]);p.enter().append("path").classed("legend"+a,!0).attr("d",d).attr("transform",b),p.exit().remove(),p.each(function(e){var i=r.select(this),n=e[0],a=_(n.mlw,c.line,5,2);i.style("stroke-width",a+"px");var d=n.mcc;if(!g._inHover&&"mc"in n){var f=l(c),p=f.mid;void 0===p&&(p=(f.max+f.min)/2),d=o.tryColorscale(c,"")(p)}var y=d||n.mc||c.color,v=c.pattern,x=o.getPatternAttr,b=v&&(x(v.shape,0,"")||x(v.path,0,""));if(b){var w=x(v.bgcolor,0,null),T=x(v.fgcolor,0,null),A=v.fgopacity,M=m(v.size,8,10),k=m(v.solidity,.5,1),S="legend-"+u.uid;i.call(o.pattern,"legend",t,S,b,M,k,d,v.fillmode,w,T,A)}else i.call(s.fill,y);a&&s.stroke(i,n.mlc||h.color)})}function T(e,a,o){var s=e[0],l=s.trace,u=o?l.visible&&l.type===o:i.traceIs(l,o),d=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(u?[e]:[]);if(d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),d.exit().remove(),d.size()){var f=l.marker||{},p=_(h(f.line.width,s.pts),f.line,5,2),m="pieLike",g=n.minExtend(l,{marker:{line:{width:p}}},m);c(d,n.minExtend(s,{trace:g},m),g,t)}}e.each(function(e){var t=r.select(this),i=n.ensureSingle(t,"g","layers");i.style("opacity",e[0].trace.opacity);var o=g.indentation,s=g.valign,l=e[0].lineHeight,u=e[0].height;if(("middle"!==s||0!==o)&&l&&u){var c=g.indentation;i.attr("transform",a(c,.5*(l-u+3)*({top:1,bottom:-1})[s]||0))}else i.attr("transform",null);i.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var h=i.selectAll("g.legendsymbols").data([e]);h.enter().append("g").classed("legendsymbols",!0),h.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)}).each(function(e){var i,a=e[0].trace,u=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],i=!0;break;case"choropleth":case"choroplethmap":u=[["M-6,-6V6H6V-6Z"]],i=!0;break;case"densitymap":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],i="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],i=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],i=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],i=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],i=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],i=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],i=!1}var c=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),c.exit().remove(),c.each(function(e,u){var c,h=r.select(this),d=l(a),p=d.colorscale,m=d.reversescale;if(p){if(!i){var g=p.length;c=0===u?p[m?g-1:0][1]:1===u?p[m?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;c=n.isArrayOrTypedArray(y)?y[u]||y[0]:y}h.attr("d",e[0]),c?h.call(s.fill,c):h.call(function(e){if(e.size()){var r="legendfill-"+a.uid;o.gradient(e,t,r,f(m,"radial"===i),p,"fill")}})})}).each(function(e){var t=e[0].trace,i="waterfall"===t.type;if(e[0]._distinct&&i){var n=e[0].trace[e[0].dir].marker;return e[0].mc=n.color,e[0].mlw=n.line.width,e[0].mlc=n.line.color,w(e,this,"waterfall")}var a=[];t.visible&&i&&(a=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",b).style("stroke-miterlimit",1),o.exit().remove(),o.each(function(e){var i=r.select(this),n=t[e[0]].marker,a=_(void 0,n.line,5,2);i.attr("d",e[1]).style("stroke-width",a+"px").call(s.fill,n.color),a&&i.call(s.stroke,n.line.color)})}).each(function(e){w(e,this,"funnel")}).each(function(e){w(e,this)}).each(function(e){var a=e[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&i.traceIs(a,"box-violin")?[e]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),l.exit().remove(),l.each(function(){var e=r.select(this);if(("all"===a.boxpoints||"all"===a.points)&&0===s.opacity(a.fillcolor)&&0===s.opacity((a.line||{}).color)){var i=n.minExtend(a,{marker:{size:v?12:n.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,i,t)}else{var u=_(void 0,a.line,5,2);e.style("stroke-width",u+"px").call(s.fill,a.fillcolor),u&&s.stroke(e,a.line.color)}})}).each(function(e){T(e,this,"funnelarea")}).each(function(e){T(e,this,"pie")}).each(function(e){var i,a,s=p(e),c=s.showFill,h=s.showLine,d=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=e[0],b=v.trace,w=l(b),T=w.colorscale,A=w.reversescale,M=u.hasMarkers(b)||!g?"M5,0":y?"M5,-2":"M5,-3",k=r.select(this),S=k.select(".legendfill").selectAll("path").data(c||m?[e]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+x+"v6h-"+x+"z").call(function(e){if(e.size())if(c)o.fillGroupStyle(e,t,!0);else{var r="legendfill-"+b.uid;o.gradient(e,t,r,f(A),T,"fill")}}),h||d){var E=_(void 0,b.line,10,5);a=n.minExtend(b,{line:{width:E}}),i=[n.minExtend(v,{trace:a})]}var D=k.select(".legendlines").selectAll("path").data(h||d?[i]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",M+(d?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;o.lineGroupStyle(e),o.gradient(e,t,r,f(A),T,"stroke")}})}).each(function(e){var i,a,s=p(e),l=s.anyFill,c=s.anyLine,h=s.showLine,d=s.showMarker,f=e[0],m=f.trace,g=!d&&!c&&!l&&u.hasText(m);function y(e,t,r,i){var a=n.nestedProperty(m,e).get(),o=n.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==i&&(o=i),r){if(or[1])return r[1]}return o}function x(e){return f._distinct&&f.index&&e[f.index]?e[f.index]:e[0]}if(d||g||h){var _={},w={};if(d){_.mc=y("marker.color",x),_.mx="scattermap"===m.type?"circle":y("marker.symbol",x),_.mo=y("marker.opacity",n.mean,[.2,1]),_.mlc=y("marker.line.color",x),_.mlw=y("marker.line.width",n.mean,[0,5],2),_.mld=y("marker.line.dash",x),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=y("marker.size",n.mean,[2,16],12);_.ms=T,w.marker.size=T}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(_.tx="Aa",_.tp=y("textposition",x),_.ts=10,_.tc=y("textfont.color",x),_.tf=y("textfont.family",x),_.tw=y("textfont.weight",x),_.ty=y("textfont.style",x),_.tv=y("textfont.variant",x),_.tC=y("textfont.textcase",x),_.tE=y("textfont.lineposition",x),_.tS=y("textfont.shadow",x)),i=[n.minExtend(f,_)],(a=n.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var A=r.select(this).select("g.legendpoints"),M=A.selectAll("path.scatterpts").data(d?i:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),M.exit().remove(),M.call(o.pointStyle,a,t),d&&(i[0].mrc=3);var k=A.selectAll("g.pointtext").data(g?i:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),k.exit().remove(),k.selectAll("text").call(o.textPointStyle,a,t)}).each(function(e){var t=e[0].trace,i=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);i.enter().append("path").classed("legendcandle",!0).attr("d",function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",b).style("stroke-miterlimit",1),i.exit().remove(),i.each(function(e,i){var n=r.select(this),a=t[i?"increasing":"decreasing"],o=_(void 0,a.line,5,2);n.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(n,a.line.color)})}).each(function(e){var t=e[0].trace,i=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);i.enter().append("path").classed("legendohlc",!0).attr("d",function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",b).style("stroke-miterlimit",1),i.exit().remove(),i.each(function(e,i){var n=r.select(this),a=t[i?"increasing":"decreasing"],l=_(void 0,a.line,5,2);n.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(n,a.line.color)})})}}}),rS=m({"src/components/legend/draw.js"(e,t){var r=M(),i=tb(),n=tO(),a=e1(),o=tM(),s=rp(),l=rt(),u=er(),c=tj(),h=rb().handleItemClick,d=rb().handleTitleClick,f=r_(),p=tB(),m=p.LINE_SPACING,g=p.FROM_TL,y=p.FROM_BR,v=rw(),x=rk(),b=rv(),_=/^legend[0-9]*$/;function w(e,t){var h,p,_=t||{},w=e._fullLayout,M=b.getId(_),S=_._inHover;if(S?(p=_.layer,h="hover"):(p=w._infolayer,h=M),p){if(h+=w._uid,e._legendMouseDownTime||(e._legendMouseDownTime=0),S){if(!_.entries)return;L=v(_.entries,_)}else{for(var L,P,z=(e.calcdata||[]).slice(),F=w.shapes,O=0;O1)}var j=w.hiddenlabels||[];if(!S&&(!w.showlegend||!L.length))return p.selectAll("."+M).remove(),w._topdefs.select("#"+h).remove(),n.autoMargin(e,M);var N=i.ensureSingle(p,"g",M,function(e){S||e.attr("pointer-events","all")}),V=i.ensureSingleById(w._topdefs,"clipPath",h,function(e){e.append("rect")}),U=i.ensureSingle(N,"rect","bg",function(e){e.attr("shape-rendering","crispEdges")});U.call(u.stroke,_.bordercolor).call(u.fill,_.bgcolor).style("stroke-width",_.borderwidth+"px");var q=i.ensureSingle(N,"g","scrollbox"),G=_.title;_._titleWidth=0,_._titleHeight=0,G.text?((P=i.ensureSingle(q,"text",M+"titletext")).attr("text-anchor","start").call(l.font,G.font).text(G.text),D(P,q,e,_,1),!S&&(_.titleclick||_.titledoubleclick)&&function(e,t,n,s){if(t._fullData.some(function(e){let t=e.legend||"legend";return(Array.isArray(t)?t.includes(s):t===s)&&a.traceIs(e,"pie-like")}))return;let l=t._context.doubleClickDelay;var c,h=1;let f=i.ensureSingle(e,"rect",s+"titletoggle",function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")});t._context.staticPlot||(f.on("mousedown",function(){(c=new Date().getTime())-t._legendMouseDownTimel&&(h=Math.max(h-1,1));let e={event:r.event,legendId:s,data:t.data,layout:t.layout,fullData:t._fullData,fullLayout:t._fullLayout};if(1===h&&n.titleclick){if(!1===o.triggerHandler(t,"plotly_legendtitleclick",e))return;n._titleClickTimeout=setTimeout(function(){t._fullLayout&&d(t,n,n.titleclick)},l)}else 2===h&&(n._titleClickTimeout&&clearTimeout(n._titleClickTimeout),t._legendMouseDownTime=0,!1!==o.triggerHandler(t,"plotly_legendtitledoubleclick",e)&&n.titledoubleclick&&d(t,n,n.titledoubleclick))}))}(q,e,_,M)):(q.selectAll("."+M+"titletext").remove(),q.selectAll("."+M+"titletoggle").remove());var H=i.ensureSingle(N,"rect","scrollbar",function(e){e.attr(f.scrollBarEnterAttrs).call(u.fill,f.scrollBarColor)}),$=q.selectAll("g.groups").data(L);$.enter().append("g").attr("class","groups"),$.exit().remove();var W=$.selectAll("g.traces").data(i.identity);W.enter().append("g").attr("class","traces"),W.exit().remove(),W.style("opacity",function(t){let r=t[0],i=r.trace;if(r.groupTitle){let t=i.legendgroup,r=(w.shapes||[]).filter(function(e){return e.showlegend});return e._fullData.concat(r).some(function(e){return e.legendgroup===t&&(e.legend||"legend")===M&&!0===e.visible})?1:.5}return a.traceIs(i,"pie-like")?-1!==j.indexOf(t[0].label)?.5:1:"legendonly"===i.visible?.5:1}).each(function(){r.select(this).call(k,e,_)}).call(x,e,_).each(function(t){S||t[0].groupTitle&&"toggleitem"===_.groupclick||r.select(this).call(E,e,M)}),i.syncOrAsync([n.previousPromises,function(){return function(e,t,i,n,a){var o,s,u,h,d=e._fullLayout,p=b.getId(n);n||(n=d[p]);var g=d._size,y=b.isVertical(n),v=b.isGrouped(n),x="fraction"===n.entrywidthmode,_=n.borderwidth,w=2*_,A=f.itemGap,M=n.indentation+n.itemwidth+2*A,k=2*(_+A),S=I(n),E=n.y<0||0===n.y&&"top"===S,D=n.y>1||1===n.y&&"bottom"===S,L=n.tracegroupgap,P={};let{orientation:z,yref:F}=n,{maxheight:O}=n,R=E||D||"v"!==z||"paper"!==F;O||(O=R?.5:1);let B=R?d.height:g.h;n._maxHeight=Math.max(O>1?O:O*B,30);var j=0;n._width=0,n._height=0;var N=(s=0,u=0,(h=(o=n).title.side)&&(-1!==h.indexOf("left")&&(s=o._titleWidth),-1!==h.indexOf("top")&&(u=o._titleHeight)),[s,u]);if(y)i.each(function(e){var t=e[0].height;l.setTranslate(this,_+N[0],_+N[1]+n._height+t/2+A),n._height+=t,n._width=Math.max(n._width,e[0].width)}),j=M+n._width,n._width+=A+M+w,n._height+=k,v&&(t.each(function(e,t){l.setTranslate(this,0,t*n.tracegroupgap)}),n._height+=(n._lgroupsLength-1)*n.tracegroupgap);else{var V=C(n),U=n.x<0||0===n.x&&"right"===V,q=n.x>1||1===n.x&&"left"===V,G=D||E,H=d.width/2;n._maxWidth=Math.max(U?G&&"left"===V?g.l+g.w:H:q?G&&"right"===V?g.r+g.w:H:g.w,2*M);var $=0,W=0;i.each(function(e){var t=T(e,n,M);$=Math.max($,t),W+=t}),j=null;var Y=0;if(v){var Z=0,X=0,K=0;t.each(function(){var e=0,t=0;r.select(this).selectAll("g.traces").each(function(r){var i=T(r,n,M),a=r[0].height;l.setTranslate(this,N[0],N[1]+_+A+a/2+t),t+=a,e=Math.max(e,i),P[r[0].trace.legendgroup]=e});var i=e+A;X>0&&i+_+X>n._maxWidth?(Y=Math.max(Y,X),X=0,K+=Z+L,Z=t):Z=Math.max(Z,t),l.setTranslate(this,X,K),X+=i}),n._width=Math.max(Y,X)+_,n._height=K+Z+k}else{var J=i.size(),Q=W+w+(J-1)*A=n._maxWidth&&(Y=Math.max(Y,ei),et=0,er+=ee,n._height+=ee,ee=0),l.setTranslate(this,N[0]+_+et,N[1]+_+er+t/2+A),ei=et+r+A,et+=i,ee=Math.max(ee,t)}),Q?(n._width=et+w,n._height=ee+k):(n._width=Math.max(Y,ei)+w,n._height+=ee+k)}}n._width=Math.ceil(Math.max(n._width+N[0],n._titleWidth+2*(_+f.titlePad))),n._height=Math.ceil(Math.max(n._height+N[1],n._titleHeight+2*(_+f.itemGap))),n._effHeight=Math.min(n._height,n._maxHeight);var en=e._context.edits,ea=en.legendText||en.legendPosition;i.each(function(e){var t=r.select(this).select("."+p+"toggle"),i=e[0].height,a=e[0].trace.legendgroup,o=T(e,n,M);v&&""!==a&&(o=P[a]);var s=ea?M:j||o;y||x||(s+=A/2),l.setRect(t,0,-i/2,s,i)});var eo=a.select("."+p+"titletext");eo.node()&&function(e,t,r){if("top center"===t.title.side||"top right"===t.title.side){var i=t.title.font.size*m,n=0,a=e.node(),o=l.bBox(a).width;"top center"===t.title.side?n=.5*(t._width-2*r-2*f.titlePad-o):"top right"===t.title.side&&(n=t._width-2*r-2*f.titlePad-o),c.positionText(e,r+f.titlePad+n,r+i)}}(eo,n,_);var es=a.select("."+p+"titletoggle");if(es.size()&&eo.node()){var el=eo.attr("x")||0,eu=f.titlePad;l.setRect(es,el-eu,_,n._titleWidth+2*eu,n._titleHeight+2*eu)}}(e,$,W,_,q)},function(){var t,o,u,c,d=w._size,m=_.borderwidth,v="paper"===_.xref,x="paper"===_.yref;if(G.text){let t=(w.shapes||[]).filter(function(e){return e.showlegend}),r=e._fullData.concat(t).some(function(e){let t=e.legend||"legend";return(Array.isArray(t)?t.includes(M):t===M)&&!0===e.visible});P.style("opacity",r?1:.5)}if(!S){if(function(e,t,r,i){var a=e._fullLayout,o=a[t],s=C(o),l=I(o),u="paper"===o.xref,c="paper"===o.yref;e._fullLayout._reservedMargin[t]={};var h=o.y<.5?"b":"t",d=o.x<.5?"l":"r",f={r:a.width-r,l:r+o._width,b:a.height-i,t:i+o._effHeight};if(u&&c)return n.autoMargin(e,t,{x:o.x,y:o.y,l:o._width*g[s],r:o._width*y[s],b:o._effHeight*y[l],t:o._effHeight*g[l]});u?e._fullLayout._reservedMargin[t][h]=f[h]:c||"v"===o.orientation?e._fullLayout._reservedMargin[t][d]=f[d]:e._fullLayout._reservedMargin[t][h]=f[h]}(e,M,O=v?d.l+d.w*_.x-g[C(_)]*_._width:w.width*_.x-g[C(_)]*_._width,R=x?d.t+d.h*(1-_.y)-g[I(_)]*_._effHeight:w.height*(1-_.y)-g[I(_)]*_._effHeight))return;if(w.margin.autoexpand){var b=O,T=R;O=v?i.constrain(O,0,w.width-_._width):b,R=x?i.constrain(R,0,w.height-_._effHeight):T,O!==b&&i.log("Constrain "+M+".x to make legend fit inside graph"),R!==T&&i.log("Constrain "+M+".y to make legend fit inside graph")}l.setTranslate(N,O,R)}if(H.on(".drag",null),N.on("wheel",null),S||_._height<=_._maxHeight||e._context.staticPlot){var k=_._effHeight;S&&(k=_._height),U.attr({width:_._width-m,height:k-m,x:m/2,y:m/2}),l.setTranslate(q,0,0),V.select("rect").attr({width:_._width-2*m,height:k-2*m,x:m,y:m}),l.setClipUrl(q,h,e),l.setRect(H,0,0,0,0),delete _._scrollY}else{var E=Math.max(f.scrollBarMinHeight,_._effHeight*_._effHeight/_._height),D=_._effHeight-E-2*f.scrollBarMargin,L=_._height-_._effHeight,z=D/L,F=Math.min(_._scrollY||0,L);U.attr({width:_._width-2*m+f.scrollBarWidth+f.scrollBarMargin,height:_._effHeight-m,x:m/2,y:m/2}),V.select("rect").attr({width:_._width-2*m+f.scrollBarWidth+f.scrollBarMargin,height:_._effHeight-2*m,x:m,y:m+F}),l.setClipUrl(q,h,e),K(F,E,z),N.on("wheel",function(){K(F=i.constrain(_._scrollY+r.event.deltaY/L*D,0,L),E,z),0!==F&&F!==L&&r.event.preventDefault()});var O,R,B,j,$,W=function(e,t,r){var n=(r-t)/z+e;return i.constrain(n,0,L)},Y=function(e,t,r){var n=(t-r)/z+e;return i.constrain(n,0,L)},Z=r.behavior.drag().on("dragstart",function(){var e=r.event.sourceEvent;B="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,$=F}).on("drag",function(){var e=r.event.sourceEvent;2===e.buttons||e.ctrlKey||(j="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,K(F=W($,B,j),E,z))});H.call(Z);var X=r.behavior.drag().on("dragstart",function(){var e=r.event.sourceEvent;"touchstart"===e.type&&(B=e.changedTouches[0].clientY,$=F)}).on("drag",function(){var e=r.event.sourceEvent;"touchmove"===e.type&&(j=e.changedTouches[0].clientY,K(F=Y($,B,j),E,z))});q.call(X)}function K(t,r,i){_._scrollY=e._fullLayout[M]._scrollY=t,l.setTranslate(q,0,-t),l.setRect(H,_._width,f.scrollBarMargin+t*i,f.scrollBarWidth,r),V.select("rect").attr("y",m+t)}e._context.edits.legendPosition&&(N.classed("cursor-move",!0),s.init({element:N.node(),gd:e,prepFn:function(e){if(e.target!==H.node()){var t=l.getTranslate(N);u=t.x,c=t.y}},moveFn:function(e,r){if(void 0!==u&&void 0!==c){var i=u+e,n=c+r;l.setTranslate(N,i,n),t=s.align(i,_._width,d.l,d.l+d.w,_.xanchor),o=s.align(n+_._height,-_._height,d.t+d.h,d.t,_.yanchor)}},doneFn:function(){if(void 0!==t&&void 0!==o){var r={};r[M+".x"]=t,r[M+".y"]=o,a.call("_guiRelayout",e,r)}},clickFn:function(t,r){var i=p.selectAll("g.traces").filter(function(){var e=this.getBoundingClientRect();return r.clientX>=e.left&&r.clientX<=e.right&&r.clientY>=e.top&&r.clientY<=e.bottom});i.size()>0&&A(e,_,i,t,r)}}))}],e)}}function T(e,t,r){var i=e[0],n=i.width,a=t.entrywidthmode,o=i.trace.legendwidth||t.entrywidth;return"fraction"===a?t._maxWidth*o:r+(o||n)}function A(e,t,r,i,n){var s=e._fullLayout,l=r.data()[0][0].trace,u=t.itemclick,c=t.itemdoubleclick,d={event:n,node:r.node(),curveNumber:l.index,expandedIndex:l.index,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:s};l._group&&(d.group=l._group),a.traceIs(l,"pie-like")&&(d.label=r.datum()[0].label);var f=o.triggerHandler(e,"plotly_legendclick",d);if(1===i){if(!1===f)return;t._clickTimeout=setTimeout(function(){e._fullLayout&&u&&h(r,e,t,u,i)},e._context.doubleClickDelay)}else 2===i&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==o.triggerHandler(e,"plotly_legenddoubleclick",d)&&!1!==f&&c&&h(r,e,t,c,i))}function k(e,t,r){var n,o,s=b.getId(r),u=e.data()[0][0],h=u.trace,d=a.traceIs(h,"pie-like"),p=!r._inHover&&t._context.edits.legendText&&!d,m=r._maxNameLength;u.groupTitle?(n=u.groupTitle.text,o=u.groupTitle.font):(o=r.font,r.entries?n=u.text:(n=d?u.label:h.name,h._meta&&(n=i.templateString(n,h._meta))));var g=i.ensureSingle(e,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(p?S(n,m):n);var y=r.indentation+r.itemwidth+2*f.itemGap;c.positionText(g,y,0),p?g.call(c.makeEditable,{gd:t,text:n}).call(D,e,t,r).on("edit",function(i){this.text(S(i,m)).call(D,e,t,r);var n={};return n.name=i,u.trace._isShape?a.call("_guiRelayout",t,"shapes["+h.index+"].name",n.name):a.call("_guiRestyle",t,n,h.index)}):D(g,e,t,r)}function S(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;e=e||"";for(var i=r-e.length;i>0;i--)e+=" ";return e}function E(e,t,n){var a,o=t._context.doubleClickDelay,s=1,l=i.ensureSingle(e,"rect",n+"toggle",function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")});t._context.staticPlot||(l.on("mousedown",function(){(a=new Date().getTime())-t._legendMouseDownTimeo&&(s=Math.max(s-1,1)),A(t,i,e,s,r.event)}}))}function D(e,t,r,i,n){i._inHover&&e.attr("data-notex",!0),c.convertToTspans(e,r,function(){!function(e,t,r,i){var n=e.data()[0][0],a=n&&n.trace.showlegend;if(Array.isArray(a)&&(a=!1!==a[n.i]),!r._inHover&&n&&!a)return e.remove();var o=e.select("g[class*=math-group]"),s=o.node(),u=b.getId(r);r||(r=t._fullLayout[u]);var h,d,p=r.borderwidth,g=(1===i?r.title.font:n.groupTitle?n.groupTitle.font:r.font).size*m;if(s){var y=l.bBox(s);h=y.height,d=y.width,1===i?l.setTranslate(o,p,p+.75*h):l.setTranslate(o,0,.25*h)}else{var v=e.select("."+u+(1===i?"title":"")+"text"),x=c.lineCount(v),_=v.node();if(h=g*x,d=_?l.bBox(_).width:0,1===i)"left"===r.title.side&&(d+=2*f.itemGap),c.positionText(v,p+f.titlePad,p+g);else{var w=2*f.itemGap+r.indentation+r.itemwidth;n.groupTitle&&(w=f.itemGap,d-=r.indentation+r.itemwidth),c.positionText(v,w,-g*((x-1)/2-.3))}}1===i?(r._titleWidth=d,r._titleHeight=h):(n.lineHeight=g,n.height=Math.max(h,16)+3,n.width=d)}(t,r,i,n)})}function C(e){return i.isRightAnchor(e)?"right":i.isCenterAnchor(e)?"center":"left"}function I(e){return i.isBottomAnchor(e)?"bottom":i.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){if(t)w(e,t);else{var i=e._fullLayout,n=i._legends;i._infolayer.selectAll('[class^="legend"]').each(function(){var e=r.select(this),t=e.attr("class").split(" ")[0];t.match(_)&&-1===n.indexOf(t)&&e.remove()});for(var a=0;aZ[0]._length||eb<0||eb>X[0]._length)return d.unhoverRaw(e,a)}else ex="xpx"in a?a.xpx:Z[0]._length/2,eb="ypx"in a?a.ypx:X[0]._length/2;if(a.pointerX=ex+Z[0]._offset,a.pointerY=eb+X[0]._offset,er="xval"in a?g.flat(b,a.xval):g.p2c(Z,ex),ei="yval"in a?g.flat(b,a.yval):g.p2c(X,eb),e._hoverPointerX=a.pointerX,e._hoverPointerY=a.pointerY,!r(er[0])||!r(ei[0]))return i.warn("Fx.hover failed",a,e),d.unhoverRaw(e,a)}_.clickanywhere&&(e._hoverXVals=er,e._hoverYVals=ei,e._hoverXAxes=Z,e._hoverYAxes=X);var eA=1/0;function eM(t,n){for(ea=0;eaep&&(em.splice(0,ep),eA=em[0].distance),S&&0!==et&&0===em.length){ef.distance=et,ef.index=!1;var c=es._module.hoverPoints(ef,eh,ed,"closest",{hoverLayer:_._hoverlayer});if(c&&(c=c.filter(function(e){return e.spikeDistance<=et})),c&&c.length){var d,p=c.filter(function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap});if(p.length){var m=p[0];r(m.x0)&&r(m.y0)&&(d=eS(m),(!ey.vLinePoint||ey.vLinePoint.spikeDistance>d.spikeDistance)&&(ey.vLinePoint=d))}var y=c.filter(function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap});if(y.length){var v=y[0];r(v.x0)&&r(v.y0)&&(d=eS(v),(!ey.hLinePoint||ey.hLinePoint.spikeDistance>d.spikeDistance)&&(ey.hLinePoint=d))}}}}}function ek(e,t,r){for(var i,n=null,a=1/0,o=0;oe.trace.index===ez.trace.index):[ez]).length;eM(V("x",ez,_),V("y",ez,_));var eO,eR=[],eB={},ej=0,eN=function(e){var t=E[e.trace.type]?L(e):e.trace.index;if(eB[t]){var r=eB[t]-1,i=eR[r];r>0&&Math.abs(e.distance)eF-1;eO--)eN(em[eO]);em=eR,eC()}var eV=e._hoverdata,eU=[],eq=U(e),eG=q(e);for(let e of em){var eH=g.makeEventData(e,e.trace,e.cd);if(!1!==e.hovertemplate){var e$=!1;e.cd[e.index]&&e.cd[e.index].ht&&(e$=e.cd[e.index].ht),e.hovertemplate=e$||e.trace.hovertemplate||!1}if(e.xa&&e.ya){var eW=e.x0+e.xa._offset,eY=e.x1+e.xa._offset,eZ=e.y0+e.ya._offset,eX=e.y1+e.ya._offset;eH.bbox={x0:Math.min(eW,eY)+eG,x1:Math.max(eW,eY)+eG,y0:Math.min(eZ,eX)+eq,y1:Math.max(eZ,eX)+eq},eH.xPixel=(eW+eY)/2,eH.yPixel=(eZ+eX)/2}e.eventData=[eH],eU.push(eH)}e._hoverdata=eU;var eK="y"===I&&(eg.length>1||em.length>1)||"closest"===I&&ev&&em.length>1,eJ=h.combine(_.plot_bgcolor||h.background,_.paper_bgcolor),eQ=z(em,{gd:e,hovermode:I,rotateLabels:eK,bgColor:eJ,container:_._hoverlayer,outerContainer:_._paper.node(),commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance}),e0=eQ.hoverLabels;if(g.isUnifiedHover(I)||(function(e,t,r,i){var n,a,o,s,l,u,c,h=t?"xa":"ya",d=t?"ya":"xa",f=0,p=1,m=e.size(),g=Array(m),y=0,v=i.minX,x=i.maxX,b=i.minY,_=i.maxY,T=function(e){return e*r._invScaleX},A=function(e){return e*r._invScaleY};function M(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,o=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(o<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=o;n=!1}if(n){var i=0;for(s=0;st.pmax&&i++;for(s=e.length-1;s>=0&&!(i<=0);s--)(u=e[s]).pos>t.pmax-1&&(u.del=!0,i--);for(s=0;s=0;l--)e[l].dp-=o;for(s=e.length-1;s>=0&&!(i<=0);s--)(u=e[s]).pos+u.dp+u.size>t.pmax&&(u.del=!0,i--)}}}for(e.each(function(e){var i=e[h],n=e[d],a="x"===i._id.charAt(0),o=i.range;0===y&&o&&o[0]>o[1]!==a&&(p=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var u,c,f=O(e,t),m=e.anchor,M="end"===m?-1:1;if("middle"===m)c=(u=e.crossPos+(a?A(f.y-e.by/2):T(e.bx/2+e.tx2width/2)))+(a?A(e.by):T(e.bx));else if(a)c=(u=e.crossPos+A(k+f.y)-A(e.by/2-k))+A(e.by);else{var S=T(M*k+f.x),E=S+T(M*e.bx);u=e.crossPos+Math.min(S,E),c=e.crossPos+Math.max(S,E)}a?void 0!==b&&void 0!==_&&Math.min(c,_)-Math.max(u,b)>1&&("left"===n.side?(s=n._mainLinePosition,l=r.width):l=n._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(c,x)-Math.max(u,v)>1&&("top"===n.side?(s=n._mainLinePosition,l=r.height):l=n._mainLinePosition)}g[y++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?w:1)/2,pmin:s,pmax:l}]}),g.sort(function(e,t){return e[0].posref-t[0].posref||p*(t[0].traceIndex-e[0].traceIndex)});!n&&f<=m;){for(f++,n=!0,s=0;s.01){for(l=E.length-1;l>=0;l--)E[l].dp+=a;for(S.push.apply(S,E),g.splice(s+1,1),c=0,l=S.length-1;l>=0;l--)c+=S[l].dp;for(o=c/S.length,l=S.length-1;l>=0;l--)S[l].dp-=o;n=!1}else s++}g.forEach(M)}for(s=g.length-1;s>=0;s--){var I=g[s];for(l=I.length-1;l>=0;l--){var L=I[l],P=L.datum;P.offset=L.dp,P.del=L.del}}}(e0,eK,_,eQ.commonLabelBoundingBox),R(e0,eK,_._invScaleX,_._invScaleY)),c&&c.tagName){var e1=m.getComponentMethod("annotations","hasClickToShow")(e,eU);u(t.select(c),e1?"pointer":"")}var e2=function(e,t){if(!t||t.length!==e._hoverdata.length)return!0;for(var r=t.length-1;r>=0;r--){var i=t[r],n=e._hoverdata[r];if(i.curveNumber!==n.curveNumber||String(i.pointNumber)!==String(n.pointNumber)||String(i.pointNumbers)!==String(n.pointNumbers)||i.binNumber!==n.binNumber)return!0}return!1}(e,eV);function e3(t){e.emit("plotly_hover",{event:a,points:t,xaxes:Z,yaxes:X,xvals:g.c2dApply(Z,er),yvals:g.c2dApply(X,ei),xPixel:a.pointerX,yPixel:a.pointerY})}c&&!l&&(e2||_.hoveranywhere)&&(eV&&e2&&e.emit("plotly_unhover",{event:a,points:eV}),e3(e._hoverdata))}(e,a,o,l,c)})},e.loneHover=function(e,r){var i=!0;Array.isArray(e)||(i=!1,e=[e]);var n=r.gd,a=U(n),o=q(n),s=z(e.map(function(e){var t=e._x0||e.x0||e.x||0,i=e._x1||e.x1||e.x||0,s=e._y0||e.y0||e.y||0,l=e._y1||e.y1||e.y||0,u=e.eventData;if(u){var c=Math.min(t,i),d=Math.max(t,i),f=Math.min(s,l),p=Math.max(s,l),g=e.trace;if(m.traceIs(g,"gl3d")){var y=n._fullLayout[g.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;c+=v,d+=v,f+=x,p+=x}u.bbox={x0:c+o,x1:d+o,y0:f+a,y1:p+a},u.xPixel=(t+i)/2,u.yPixel=(s+l)/2,r.inOut_bbox&&r.inOut_bbox.push(u.bbox)}else u=!1;return{color:e.color||h.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontVariant:e.fontVariant,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:u}}),{gd:n,hovermode:"closest",rotateLabels:!1,bgColor:r.bgColor||h.background,container:t.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,l=0,u=0;return s.sort(function(e,t){return e.y0-t.y0}).each(function(e,t){var i=e.y0-e.by/2;i-5([\s\S]*)<\/extra>/;function z(e,r){var n=r.gd,s=n._fullLayout,u=r.hovermode,d=r.rotateLabels,f=r.bgColor,p=r.container,_=r.outerContainer,w=r.commonLabelOpts||{};if(0===e.length)return[[]];var T=r.fontFamily||y.HOVERFONT,A=r.fontSize||y.HOVERFONTSIZE,M=r.fontWeight||s.font.weight,E=r.fontStyle||s.font.style,D=r.fontVariant||s.font.variant,C=r.fontTextcase||s.font.textcase,I=r.fontLineposition||s.font.lineposition,P=r.fontShadow||s.font.shadow,z=e[0],O=z.xa,R=z.ya,B=u.charAt(0),j=B+"Label",N=z[j];if(void 0===N&&"multicategory"===O.type)for(var V=0;Vs.width-_&&(L=s.width-_),r.attr("d","M"+(y-L)+",0L"+(y-L+k)+","+b+k+"H"+_+"v"+b+(2*S+x.height)+"H"+-_+"V"+b+k+"H"+(y-L-k)+"Z"),Q.minX=(y=L)-_,Q.maxX=y+_,"top"===O.side?(Q.minY=v-(2*S+x.height),Q.maxY=v-S):(Q.minY=v+S,Q.maxY=v+(2*S+x.height))}else{"right"===R.side?(F="start",B=1,j="",y=O._offset+O._length):(F="end",B=-1,j="-",y=O._offset),v=R._offset+(z.y0+z.y1)/2,o.attr("text-anchor",F),r.attr("d","M0,0L"+j+k+","+k+"V"+(S+x.height/2)+"h"+j+(2*S+x.width)+"V-"+(S+x.height/2)+"H"+j+k+"V-"+k+"Z"),Q.minY=v-(S+x.height/2),Q.maxY=v+(S+x.height/2),"right"===R.side?(Q.minX=y+k,Q.maxX=y+k+(2*S+x.width)):(Q.minX=y-k-(2*S+x.width),Q.maxX=y-k);var F,B,j,V,U=x.height/2,H=q-x.top-U,$="clip"+s._uid+"commonlabel"+R._id;if(y"none"!==e.hoverinfo);if(0===t.length)return[];var ee,et,er,ei,en=s.hoverlabel,ea=en.font,eo=t[0],es=(("x unified"===u?eo.xa:eo.ya).unifiedhovertitle||{}).text,el={showlegend:!0,legend:{title:{text:es?i.hovertemplateString({data:"x unified"===u?[{xa:eo.xa,x:eo.xVal}]:[{ya:eo.ya,y:eo.yVal}],fallback:eo.trace.hovertemplatefallback,locale:s._d3locale,template:es}):N,font:ea},font:ea,bgcolor:en.bgcolor,bordercolor:en.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:s.legend?s.legend.traceorder:void 0,orientation:"v"}},eu={font:ea};v(el,eu,n._fullData);var ec=eu.legend;ec.entries=[];for(var eh=0;eh=0?ee:et+e_=0?et:eS+e_=0?ey:ev+ew<$&&ev>=0?ev:eE+ew<$?eE:ey-eM=0,("top"===e.idealAlign||!K)&&J?(j-=U/2,e.anchor="end"):K?(j+=U/2,e.anchor="start"):e.anchor="middle",e.crossPos=j;else{if(e.pos=j,K=B+V/2+Q<=H,J=B-V/2-Q>=0,("left"===e.idealAlign||!K)&&J)B-=V/2,e.anchor="end";else if(K)B+=V/2,e.anchor="start";else{e.anchor="middle";var ee=Q/2,et=B+ee-H,er=B-ee;et>0&&(B-=et),er<0&&(B+=-er)}e.crossPos=B}w.attr("text-anchor",e.anchor),z&&L.attr("text-anchor",e.anchor),r.attr("transform",a(B,j)+(d?o(b):""))}),{hoverLabels:eD,commonLabelBoundingBox:Q}}function F(e,t,r,n,a,o){var s,l,u="",c="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=i.templateString(e.name,e.trace._meta)),u=N(e.name,e.nameLength));var h=r.charAt(0);void 0!==e.zLabel?(void 0!==e.xLabel&&(c+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(c+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmap"!==e.trace.type&&(c+=(c?"z: ":"")+e.zLabel)):t&&e[h+"Label"]===a?c=e[("x"===h?"y":"x")+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(c=e.yLabel):c=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",(e.text||0===e.text)&&!Array.isArray(e.text)&&(c+=(c?"
":"")+e.text),void 0!==e.extraText&&(c+=(c?"
":"")+e.extraText),o&&""===c&&!e.hovertemplate&&(""===u&&o.remove(),c=u),null!=(l=null==(s=e.trace)?void 0:s.hoverlabel)&&l.split&&(e.hovertemplate="");let{hovertemplate:d=!1}=e;if(d){let t=e.hovertemplateLabels||e;e[h+"Label"]!==a&&(t[h+"other"]=t[h+"Val"],t[h+"otherLabel"]=t[h+"Label"]),c=(c=i.hovertemplateString({data:[e.eventData[0]||{},e.trace._meta],fallback:e.trace.hovertemplatefallback,labels:t,locale:n._d3locale,template:d})).replace(P,(t,r)=>(u=N(r,e.nameLength),""))}return[c,u]}function O(e,t){var r=0,i=e.offset;return t&&(i*=-A,r=e.offset*T),{x:r,y:i}}function R(e,r,i,n){var a=function(e){return e*i},o=function(e){return e*n};e.each(function(e){var i=t.select(this);if(e.del)return i.remove();var n,s,u,h,d=i.select("text.nums"),f=e.anchor,p="end"===f?-1:1,m=(u=(s=(n=({start:1,end:-1,middle:0})[e.anchor])*(k+S))+n*(e.txwidth+S),"middle"===e.anchor&&(s-=e.tx2width/2,u+=e.txwidth/2+S),{alignShift:n,textShiftX:s,text2ShiftX:u}),g=O(e,r),y=g.x,v=g.y,x="middle"===f,b=!("hoverlabel"in e.trace)||e.trace.hoverlabel.showarrow;h=x?"M-"+a(e.bx/2+e.tx2width/2)+","+o(v-e.by/2)+"h"+a(e.bx)+"v"+o(e.by)+"h-"+a(e.bx)+"Z":b?"M0,0L"+a(p*k+y)+","+o(k+v)+"v"+o(e.by/2-k)+"h"+a(p*e.bx)+"v-"+o(e.by)+"H"+a(p*k+y)+"V"+o(v-k)+"Z":"M"+a(p*k+y)+","+o(v-e.by/2)+"h"+a(p*e.bx)+"v"+o(e.by)+"h"+a(-p*e.bx)+"Z",i.select("path").attr("d",h);var _=y+m.textShiftX,w=v+e.ty0-e.by/2+S,T=e.textAlign||"auto";"auto"!==T&&("left"===T&&"start"!==f?(d.attr("text-anchor","start"),_=x?-e.bx/2-e.tx2width/2+S:-e.bx-S):"right"===T&&"end"!==f&&(d.attr("text-anchor","end"),_=x?e.bx/2-e.tx2width/2-S:e.bx+S)),d.call(l.positionText,a(_),o(w)),e.tx2width&&(i.select("text.name").call(l.positionText,a(m.text2ShiftX+m.alignShift*S+y),o(v+e.ty0-e.by/2+S)),i.select("rect").call(c.setRect,a(m.text2ShiftX+(m.alignShift-1)*e.tx2width/2+y),o(v-e.by/2-1),a(e.tx2width),o(e.by+2)))})}function B(e,t,r){var i,n,a=r.container,o=r.fullLayout,s=o._size,l=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(a.selectAll(".spikeline").remove(),d||u){var p=h.combine(o.plot_bgcolor,o.paper_bgcolor);if(u){var m,g,y=t.hLinePoint;i=y&&y.xa,"cursor"===(n=y&&y.ya).spikesnap?(m=l.pointerX,g=l.pointerY):(m=i._offset+y.x,g=n._offset+y.y);var v,x,b=1.5>h.wcagContrast(y.color,p)?h.contrast(p):y.color,_=n.spikemode,w=n.spikethickness,T=n.spikecolor||b,A=f.getPxPosition(e,n);if(-1!==_.indexOf("toaxis")||-1!==_.indexOf("across")){if(-1!==_.indexOf("toaxis")&&(v=A,x=m),-1!==_.indexOf("across")){var M=n._counterDomainMin,k=n._counterDomainMax;"free"===n.anchor&&(M=Math.min(M,n.position),k=Math.max(k,n.position)),v=s.l+M*s.w,x=s.l+k*s.w}a.insert("line",":first-child").attr({x1:v,x2:x,y1:g,y2:g,"stroke-width":w,stroke:T,"stroke-dasharray":c.dashStyle(n.spikedash,w)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:v,x2:x,y1:g,y2:g,"stroke-width":w+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==_.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:A+("right"!==n.side?w:-w),cy:g,r:w,fill:T}).classed("spikeline",!0)}if(d){var S,E,D=t.vLinePoint;i=D&&D.xa,n=D&&D.ya,"cursor"===i.spikesnap?(S=l.pointerX,E=l.pointerY):(S=i._offset+D.x,E=n._offset+D.y);var C,I,L=1.5>h.wcagContrast(D.color,p)?h.contrast(p):D.color,P=i.spikemode,z=i.spikethickness,F=i.spikecolor||L,O=f.getPxPosition(e,i);if(-1!==P.indexOf("toaxis")||-1!==P.indexOf("across")){if(-1!==P.indexOf("toaxis")&&(C=O,I=E),-1!==P.indexOf("across")){var R=i._counterDomainMin,B=i._counterDomainMax;"free"===i.anchor&&(R=Math.min(R,i.position),B=Math.max(B,i.position)),C=s.t+(1-B)*s.h,I=s.t+(1-R)*s.h}a.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:I,"stroke-width":z,stroke:F,"stroke-dasharray":c.dashStyle(i.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:I,"stroke-width":z+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==P.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:S,cy:O-("top"!==i.side?z:-z),r:z,fill:F}).classed("spikeline",!0)}}}function j(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function N(e,t){return l.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function V(e,t,r){var i=t[e+"a"],n=t[e+"Val"],a=t.cd[0];if("category"===i.type||"multicategory"===i.type)n=i._categoriesMap[n];else if("date"===i.type){var o=t.trace[e+"periodalignment"];if(o){var s=t.cd[t.index],l=s[e+"Start"];void 0===l&&(l=s[e]);var u=s[e+"End"];void 0===u&&(u=s[e]);var c=u-l;"end"===o?n+=c:"middle"===o&&(n+=c/2)}n=i.d2c(n)}return a&&a.t&&a.t.posLetter===i._id&&("group"===r.boxmode||"group"===r.violinmode)&&(n+=a.t.dPos),n}var U=e=>e.offsetTop+e.clientTop,q=e=>e.offsetLeft+e.clientLeft;function G(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,u=i.apply3DTransform(r._invTransform)(a,o),c=i.apply3DTransform(r._invTransform)(s,l),h=u[0],d=u[1],f=c[0],p=c[1];return{x:h,y:d,width:f-h,height:p-d,top:Math.min(d,p),left:Math.min(h,f),right:Math.max(h,f),bottom:Math.max(d,p)}}}}),rD=m({"src/components/fx/hoverlabel_defaults.js"(e,t){var r=tb(),i=er(),n=t7().isUnifiedHover;t.exports=function(e,t,a,o){o=o||{};var s=t.legend;function l(e){o.font[e]||(o.font[e]=s?t.legend.font[e]:t.font[e])}t&&n(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=i.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),a("hoverlabel.bgcolor",o.bgcolor),a("hoverlabel.bordercolor",o.bordercolor),a("hoverlabel.namelength",o.namelength),a("hoverlabel.showarrow",o.showarrow),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}}),rC=m({"src/components/fx/layout_global_defaults.js"(e,t){var r=tb(),i=rD(),n=Y();t.exports=function(e,t){i(e,t,function(i,a){return r.coerce(e,t,n,i,a)})}}}),rI=m({"src/components/fx/defaults.js"(e,t){var r=tb(),i=Z(),n=rD();t.exports=function(e,t,a,o){var s=r.extendFlat({},o.hoverlabel);t.hovertemplate&&(s.namelength=-1),n(e,t,function(n,a){return r.coerce(e,t,i,n,a)},s)}}}),rL=m({"src/components/fx/hovermode_defaults.js"(e,t){var r=tb(),i=Y();t.exports=function(e,t){function n(n,a){return void 0!==t[n]?t[n]:r.coerce(e,t,i,n,a)}return n("clickmode"),n("hoversubplots"),n("hoveranywhere"),n("clickanywhere"),n("hovermode")}}}),rP=m({"src/components/fx/layout_defaults.js"(e,t){var r=tb(),i=Y(),n=rL(),a=rD();t.exports=function(e,t){function o(n,a){return r.coerce(e,t,i,n,a)}var s=n(e,t);s&&(o("hoverdistance"),o("spikedistance"),-1!==s.indexOf("unified")&&o("hoversort")),"select"===o("dragmode")&&o("selectdirection");var l=t._has("map"),u=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||u)&&1===c||l&&u&&2===c)&&(t.dragmode="pan"),a(e,t,o),r.coerceFont(o,"hoverlabel.grouptitlefont",t.hoverlabel.font)}}}),rz=m({"src/components/fx/calc.js"(e,t){var r=tb(),i=e1();function n(e,t,i,n){n=n||r.identity,Array.isArray(e)&&(t[0][i]=n(e))}t.exports=function(e){for(var t=e.calcdata,a=e._fullLayout,o=0;o plotly-logomark "}}}}),rN=m({"src/components/shapes/draw_newshape/constants.js"(e,t){t.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),rV=m({"src/components/selections/helpers.js"(e,t){var r=tb().strTranslate;function i(e,t){switch(e.type){case"log":return e.p2d(t);case"date":return e.p2r(t,0,e.calendar);default:return e.p2r(t)}}t.exports={p2r:i,r2p:function(e,t){switch(e.type){case"log":return e.d2p(t);case"date":return e.r2p(t,0,e.calendar);default:return e.r2p(t)}},axValue:function(e){var t=+("y"===e._id.charAt(0));return function(r){return i(e,r[t])}},getTransform:function(e){return r(e.xaxis._offset,e.yaxis._offset)}}}}),rU=m({"src/components/shapes/draw_newshape/helpers.js"(e){var t=t9(),r=rN(),i=r.CIRCLE_SIDES,n=r.SQRT2,a=rV(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],u=[0,3,4,1,2];function c(e,t){return 1e-6>=Math.abs(e-t)}function h(e,t){var r=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+i*i)}e.writePaths=function(e){var t=e.length;if(!t)return"M0,0Z";for(var r="",i=0;i0&&ce+ +(void 0!==a[t.charAt(0)].drawn),0)},e.getDataToPixel=function(t,r,i,a,o){var s,l=t._fullLayout._size;if(r)if("domain"===o)s=function(e){return r._length*(a?1-e:e)+r._offset};else{var u=e.shapePositionToRange(r);s=function(e){var t=n(r,i);return r._offset+r.r2p(u(e,!0))+t},"date"===r.type&&(s=e.decodeDate(s))}else s=a?function(e){return l.t+l.h*(1-e)}:function(e){return l.l+l.w*e};return s},e.getPixelToData=function(t,r,i,n){var a,o=t._fullLayout._size;if(r)if("domain"===n)a=function(e){var t=(e-r._offset)/r._length;return i?1-t:t};else{var s=e.rangeToShapePosition(r);a=function(e){return s(r.p2r(e-r._offset))}}else a=i?function(e){return 1-(e-o.t)/o.h}:function(e){return(e-o.l)/o.w};return a},e.roundPositionForSharpStrokeRendering=function(e,t){var r=Math.round(e);return 1===Math.round(t%2)?r+.5:r},e.makeShapesOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.shapes[t]||{},i=e._fullLayout._plots[r.xref+r.yref];return i?i._hadPlotinfo=!0:(i={},r.xref&&"paper"!==r.xref&&(i.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(i.yaxis=e._fullLayout[r.yref+"axis"])),i.xsizemode=r.xsizemode,i.ysizemode=r.ysizemode,i.xanchor=r.xanchor,i.yanchor=r.yanchor,{options:r,plotinfo:i}},e.makeSelectionsOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.selections[t]||{},i=e._fullLayout._plots[r.xref+r.yref];return i?i._hadPlotinfo=!0:(i={},r.xref&&(i.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&(i.yaxis=e._fullLayout[r.yref+"axis"])),{options:r,plotinfo:i}},e.getPathString=function(a,o){let s=o.type,l=i.getRefType(o.xref),u=i.getRefType(o.yref),c=a._fullLayout._size;function h(t,r,i,n){var a;if(t)if("domain"===r)a=n?function(e){return t._offset+t._length*(1-e)}:function(e){return t._offset+t._length*e};else{let r=e.shapePositionToRange(t);a=function(e){return t._offset+t.r2p(r(e,!0))},"path"===i&&"date"===t.type&&(a=e.decodeDate(a))}else a=n?function(e){return c.t+c.h*(1-e)}:function(e){return c.l+c.w*e};return a}if("array"===l?(T=[],y=o.xref.map(function(e){return i.getFromId(a,e)}),T=o.xref.map(function(e,t){return h(y[t],i.getRefType(e),s,!1)})):T=h(y=i.getFromId(a,o.xref),l,s,!1),"array"===u?(A=[],v=o.yref.map(function(e){return i.getFromId(a,e)}),A=o.yref.map(function(e,t){return h(v[t],i.getRefType(e),s,!0)})):A=h(v=i.getFromId(a,o.yref),u,s,!0),"path"===s){var d,f,p,m,g;let e,i,n,a,s,l,u;return d=o,f=T,p=A,e=d.path,i=d.xsizemode,n=d.ysizemode,a=d.xanchor,s=d.yanchor,l=Array.isArray(d.xref),u=Array.isArray(d.yref),m=0,g=0,e.replace(t.segmentRE,function(e){var o=0,c=e.charAt(0),h=t.paramIsX[c],d=t.paramIsY[c],y=t.numParams[c];let v=void 0!==h.drawn,x=void 0!==d.drawn,b=l?f[m]:f,_=u?p[g]:p;var w=e.slice(1).replace(t.paramRE,function(e){return h[o]?e="pixel"===i?b(a)+Number(e):b(e):d[o]&&(e="pixel"===n?_(s)-Number(e):_(e)),++o>y&&(e="X"),e});return o>y&&(w=w.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+e)),v&&m++,x&&g++,c+w})}if("array"===l)x=n(y[0],o.x0shift),b=n(y[1],o.x1shift),M=T[0](o.x0)+x,k=T[1](o.x1)+b;else if(x=n(y,o.x0shift),b=n(y,o.x1shift),"pixel"===o.xsizemode){let e=T(o.xanchor);M=e+o.x0+x,k=e+o.x1+b}else M=T(o.x0)+x,k=T(o.x1)+b;if("array"===u)_=n(v[0],o.y0shift),w=n(v[1],o.y1shift),S=A[0](o.y0)+_,E=A[1](o.y1)+w;else if(_=n(v,o.y0shift),w=n(v,o.y1shift),"pixel"===o.ysizemode){let e=A(o.yanchor);S=e-o.y0+_,E=e-o.y1+w}else S=A(o.y0)+_,E=A(o.y1)+w;if("line"===s)return"M"+M+","+S+"L"+k+","+E;if("rect"===s)return"M"+M+","+S+"H"+k+"V"+E+"H"+M+"Z";var y,v,x,b,_,w,T,A,M,k,S,E,D=(M+k)/2,C=(S+E)/2,I=Math.abs(D-M),L=Math.abs(C-S),P="A"+I+","+L,z=D+I+","+C;return"M"+z+P+" 0 1,1 "+D+","+(C-L)+P+" 0 0,1 "+z+"Z"},e.getPixelShift=n}}),rW=m({"src/components/shapes/display_labels.js"(e,t){var r=tb(),i=ro(),n=tj(),a=rt(),o=rU().readPaths,s=r$(),l=s.getPathString,u=eZ(),c=tB().FROM_TL;t.exports=function(e,t,h,d){if(d.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){if(h.label.texttemplate){var f={};if("path"!==h.type){var p=i.getFromId(e,h.xref),m=i.getFromId(e,h.yref);let t=Array.isArray(h.xref),r=Array.isArray(h.yref);for(var g in u){var y="function"==typeof u[g],v=!t||u.simpleXVariables.includes(g),x=!r||u.simpleYVariables.includes(g);if(y&&v&&x){var b=u[g](h,p,m);void 0!==b&&(f[g]=b)}}}_=r.texttemplateStringForShapes({data:[f],fallback:h.label.texttemplatefallback,locale:e._fullLayout._d3locale,template:h.label.texttemplate})}else _=h.label.text;var _,w,T,A,M,k=h.label.font,S=d.append("g").attr({"data-index":t}).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(_);if(h.path){var E=o(l(e,h),e);w=1/0,A=1/0,T=-1/0,M=-1/0;for(var D=0;Ds.getDataToPixel(e,i,r,!1,n)(t),m=(t,r,i,n)=>s.getDataToPixel(e,i,r,!0,n)(t);if("pixel"===h.xsizemode){let e=p(h.xanchor,void 0,n,u),t=s.getPixelShift(n,h.x0shift),r=s.getPixelShift(n,h.x1shift);w=e+h.x0+t,T=e+h.x1+r}else w=p(h.x0,h.x0shift,n,u),T=p(h.x1,h.x1shift,a,c);if("pixel"===h.ysizemode){let e=m(h.yanchor,void 0,o,d),t=s.getPixelShift(o,h.y0shift),r=s.getPixelShift(o,h.y1shift);A=e-h.y0+t,M=e-h.y1+r}else A=m(h.y0,h.y0shift,o,d),M=m(h.y1,h.y1shift,l,f)}var F=h.label.textangle;"auto"===F&&(F="line"===h.type?function(e,t,r,i){var n;return n=Math.abs(r-e),-180/Math.PI*Math.atan2(r>=e?t-i:i-t,n)}(w,A,T,M):0),S.call(function(t){return t.call(a.font,k).attr({}),n.convertToTspans(t,e),t});var O=function(e,t,r,i,n,a,o){var s,l,u,h,d=n.label.textposition,f=n.label.textangle,p=n.label.padding,m=n.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=n.label.xanchor,b=n.label.yanchor;if("line"===m){"start"===d?(s=e,l=t):"end"===d?(s=r,l=i):(s=(e+r)/2,l=(t+i)/2),"auto"===x&&(x="start"===d?"auto"===f?r>e?"left":re?"right":re?"right":re?"left":r1&&(2!==e.length||"Z"!==e[1][0])&&(0===S&&(e[0][0]="M"),t[k]=e,C(),I())}}()}}function V(e,r){(function(e,r){if(t.length)for(var i=0;iS?(C=M,z="y0",I=S,F="y1"):(C=S,z="y1",I=M,F="y0"),eo(r),eu(u,o),i=t,n=o,s=e,l=n.xref,c=n.yref,d=a.getFromId(s,l),f=a.getFromId(s,c),p="","paper"===l||d.autorange||(p+=l),"paper"===c||f.autorange||(p+=c),h.setClipUrl(i,p?"clip"+s._fullLayout._uid+p:null,s),ea.moveFn="move"===j?es:el,ea.altKey=r.altKey)},doneFn:function(){b(e)||(m(t),ec(u),T(t,e,o),i.call("_guiRelayout",e,c.getUpdateObj()))},clickFn:function(){b(e)||ec(u)}};function eo(r){if(b(e)){j=null;return}if(U)j="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var i=ea.element.getBoundingClientRect(),n=i.right-i.left,a=i.bottom-i.top,o=r.clientX-i.left,s=r.clientY-i.top,l=!q&&n>10&&a>10&&!r.shiftKey?f.getCursor(o/n,1-s/a):"move";m(t,l),j=l.split("-")[0]}}function es(r,i){if("path"===o.type){var n=function(e){return e},a=n,c=n;N?G("xanchor",o.xanchor=er(E+r)):(a=function(e){return er(ee(e)+r)},$&&"date"===$.type&&(a=y.encodeDate(a))),V?G("yanchor",o.yanchor=ei(D+i)):(c=function(e){return ei(et(e)+i)},Y&&"date"===Y.type&&(c=y.encodeDate(c))),G("path",o.path=A(B,a,c))}else N?G("xanchor",o.xanchor=er(E+r)):(G("x0",o.x0=er(w+r)),G("x1",o.x1=er(k+r))),V?G("yanchor",o.yanchor=ei(D+i)):(G("y0",o.y0=ei(M+i)),G("y1",o.y1=ei(S+i)));t.attr("d",v(e,o)),eu(u,o),l(e,s,o,H)}function el(r,i){if(q){var n=function(e){return e},a=n,c=n;N?G("xanchor",o.xanchor=er(E+r)):(a=function(e){return er(ee(e)+r)},$&&"date"===$.type&&(a=y.encodeDate(a))),V?G("yanchor",o.yanchor=ei(D+i)):(c=function(e){return ei(et(e)+i)},Y&&"date"===Y.type&&(c=y.encodeDate(c))),G("path",o.path=A(B,a,c))}else if(U){if("resize-over-start-point"===j){var h=w+r,d=V?M-i:M+i;G("x0",o.x0=N?h:er(h)),G("y0",o.y0=V?d:ei(d))}else if("resize-over-end-point"===j){var f=k+r,p=V?S-i:S+i;G("x1",o.x1=N?f:er(f)),G("y1",o.y1=V?p:ei(p))}}else{var m=function(e){return -1!==j.indexOf(e)},g=m("n"),x=m("s"),b=m("w"),_=m("e"),T=g?C+i:C,W=x?I+i:I,Z=b?L+r:L,X=_?P+r:P;V&&(g&&(T=C-i),x&&(W=I-i)),(!V&&W-T>10||V&&T-W>10)&&(G(z,o[z]=V?T:ei(T)),G(F,o[F]=V?W:ei(W))),X-Z>10&&(G(O,o[O]=N?Z:er(Z)),G(R,o[R]=N?X:er(X)))}t.attr("d",v(e,o)),eu(u,o),l(e,s,o,H)}function eu(e,t){(N||V)&&function(){var r="path"!==t.type,i=e.selectAll(".visual-cue").data([0]);i.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=ee(N?t.xanchor:n.midRange(r?[t.x0,t.x1]:y.extractPathCoords(t.path,g.paramIsX))),o=et(V?t.yanchor:n.midRange(r?[t.y0,t.y1]:y.extractPathCoords(t.path,g.paramIsY)));if(a=y.roundPositionForSharpStrokeRendering(a,1),o=y.roundPositionForSharpStrokeRendering(o,1),N&&V){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";i.attr("d",s)}else if(N){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";i.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";i.attr("d",u)}}()}function ec(e){e.selectAll(".visual-cue").remove()}f.init(ea),en.node().onmousemove=eo}(e,B,w,t,u,S):!0===w.editable&&B.style("pointer-events",F||c.opacity(I)*C<=.5?"stroke":"all");B.node().addEventListener("click",function(){var t=e,r=B;if(_(t)){var i=+r.node().getAttribute("data-index");if(i>=0){if(i===t._fullLayout._activeShapeIndex)return void k(t);t._fullLayout._activeShapeIndex=i,t._fullLayout._deactivateShape=k,x(t)}}}),function(e,t,r){if(!r?.id)return;let i=t.node();function n(e){var t;let i=r.mainplotinfo||r,n=null==(t=i?.draglayer)?void 0:t.select(".nsewdrag").node();return n?{clientX:e.clientX,clientY:e.clientY,target:n}:null}i.addEventListener("mousemove",t=>{if(!e._dragging&&e._fullLayout.hoveranywhere){let i=n(t);i&&p.hover(e,i,r.id)}}),i.addEventListener("click",t=>{if(!e._dragged&&e._fullLayout.clickanywhere){let i=n(t);i&&p.click(e,i,r.id)}})}(e,B,M)}("above"===w.layer?e._fullLayout._shapeUpperLayer:w.xref.includes("paper")||w.yref.includes("paper")?e._fullLayout._shapeLowerLayer:"between"!==w.layer||S?M._hadPlotinfo?(M.mainplotinfo||M).shapelayer:e._fullLayout._shapeLowerLayer:M.shapelayerBetween)}function T(e,t,r){let i=r.xref,o=r.yref;if(Array.isArray(i)||Array.isArray(o)){let s="clip"+t._fullLayout._uid+"shape"+r._index,l=function(e,t,r){let i=e._fullLayout._size;function n(t,r){let n=(Array.isArray(t)?t:[t]).map(t=>a.getFromId(e,t)).filter(Boolean);return n.length?[Math.min(...n.map(function(e){return e._offset})),Math.max(...n.map(function(e){return e._offset+e._length}))]:r?[i.t,i.t+i.h]:[i.l,i.l+i.w]}let o=n(t,!1),s=n(r,!0);return{x:o[0],y:s[0],width:o[1]-o[0],height:s[1]-s[0]}}(t,i,o);n.ensureSingleById(t._fullLayout._clips,"clipPath",s,function(e){e.append("rect")}).select("rect").attr(l),h.setClipUrl(e,s,t)}else{let r=(i+o).replace(/paper/g,"").replace(/[xyz][0-9]* *domain/g,"");h.setClipUrl(e,r?"clip"+t._fullLayout._uid+r:null,t)}}function A(e,t,r){return e.replace(g.segmentRE,function(e){var i=0,n=e.charAt(0),a=g.paramIsX[n],o=g.paramIsY[n],s=g.numParams[n];return n+e.slice(1).replace(g.paramRE,function(e){return i>=s||(a[i]?e=t(e):o[i]&&(e=r(e)),i++),e})})}function k(e){_(e)&&e._fullLayout._activeShapeIndex>=0&&(u(e),delete e._fullLayout._activeShapeIndex,x(e))}t.exports={draw:x,drawOne:w,eraseActiveShape:function(e){if(_(e)){u(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t{let o=r.select(e._fullLayout._paperdiv.node());o.selectAll(".plotly-cloud-dialog").remove();let s=o.append("div").classed("plotly-cloud-dialog",!0),l=()=>{s.remove(),document.removeEventListener("keydown",u)},u=e=>{("Escape"===e.key||27===e.keyCode)&&l()};document.addEventListener("keydown",u),s.on("click",()=>{r.event.target===s.node()&&l()}),((e,t,r,a,o)=>{let s=n(e),l=t.append("div").classed("plotly-cloud-dialog-box",!0);if(l.append("div").classed("plotly-cloud-dialog-title",!0).text(s.DIALOG_TITLE),r===i.plotlyServerURL){let e=l.append("div").classed("plotly-cloud-dialog-message",!0),t=new URL(r).origin,i=s.DIALOG_MESSAGE_CLOUD.split(/(\{|\})/),n=i[0],a=i[2],o=i[4];e.append("span").text(n),e.append("a").classed("plotly-cloud-dialog-message--hostname",!0).attr("href",t).attr("target","_blank").text(a),e.append("span").text(o),e.append("div").classed("plotly-cloud-dialog-message--account",!0).text(s.DIALOG_MESSAGE_CLOUD_ACCOUNT)}else{let e=new URL(r),t=e.hostname,i=e.origin,n=s.DIALOG_MESSAGE_OTHER.split(/(\{|\})/),a=n[0],o=n[4],u=l.append("div").classed("plotly-cloud-dialog-message",!0);u.append("span").text(a),u.append("a").classed("plotly-cloud-dialog-message--hostname",!0).attr("href",i).attr("target","_blank").text(t),u.append("span").text(o)}let u=l.append("div").classed("plotly-cloud-dialog-buttons",!0);u.append("button").classed("plotly-cloud-dialog-btn",!0).classed("plotly-cloud-dialog-btn--cancel",!0).text(s.DIALOG_CANCEL).on("click",o),u.append("button").classed("plotly-cloud-dialog-btn",!0).classed("plotly-cloud-dialog-btn--confirm",!0).text(s.DIALOG_CONFIRM).on("click",a)})(e,s,t,()=>{l(),a()},l)}}}),rJ=m({"src/components/modebar/buttons.js"(e,t){var r=e1(),i=tO(),n=tI(),a=rj(),o=rZ().eraseActiveShape,s=rK(),l=tb(),u=l._,c=t.exports={};function h(e,t){var i,a,o=t.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=e._fullLayout,c={},h=n.list(e,null,!0),d=u._cartesianSpikesEnabled;if("zoom"===s){var f,p="in"===l?.5:2,m=(1+p)/2,g=(1-p)/2;for(a=0;a-e),[h,d]=a.invert(l.midPt),{minscale:f}=n.projection,p=null!=(i=n.projection.maxscale)?i:1/0,m=Math.min(f,p),g=Math.max(f,p),y="in"===o?2*s:.5*s;y>g?y=g:yr2});var r1,r2,r3=p({"src/components/modebar/attributes.ts"(){r1=v(rQ()),r2={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar",description:"Sets the orientation of the modebar."},bgcolor:{valType:"color",editType:"modebar",description:"Sets the background color of the modebar."},color:{valType:"color",editType:"modebar",description:"Sets the color of the icons in the modebar."},activecolor:{valType:"color",editType:"modebar",description:"Sets the color of the active or hovered on icons in the modebar."},uirevision:{valType:"any",editType:"none",description:"Controls persistence of user-driven changes related to the modebar, including `hovermode`, `dragmode`, and `showspikes` at both the root level and inside subplots. Defaults to `layout.uirevision`."},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:`Determines which predefined modebar buttons to add. Please note that these buttons will only be shown if they are compatible with all trace types used in a graph. Similar to \`config.modeBarButtonsToAdd\` option. This may include *${r1.default.backButtons.join("*, *")}*.`},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:`Determines which predefined modebar buttons to remove. Similar to \`config.modeBarButtonsToRemove\` option. This may include *${r1.default.foreButtons.join("*, *")}*.`}}}}),r5=m({"src/components/modebar/defaults.js"(e,t){var r=tb(),i=er(),n=tD(),a=(r3(),x(r0)).default;t.exports=function(e,t){var o=e.modebar||{},s=n.newContainer(t,"modebar");function l(e,t){return r.coerce(o,s,a,e,t)}l("orientation"),l("bgcolor",i.addOpacity(t.paper_bgcolor,.5));var u=i.contrast(i.rgb(t.modebar.bgcolor));l("color",i.addOpacity(u,.3)),l("activecolor",i.addOpacity(u,.7)),l("uirevision",t.uirevision),l("add"),l("remove")}}}),r4=m({"src/components/modebar/modebar.js"(e,t){var r=M(),i=I(),n=tb(),a=rj(),o=T().version,s=new DOMParser;function l(e){this.container=e.container,this.element=document.createElement("div"),this.update(e.graphInfo,e.buttons),this.container.appendChild(this.element)}var u=l.prototype;u.update=function(e,t){this.graphInfo=e;var r=this.graphInfo._context,i=this.graphInfo._fullLayout,a="modebar-"+i._uid;this.element.setAttribute("id",a),this.element.setAttribute("role","toolbar"),this._uid=a,this.element.className="modebar modebar--custom","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===i.modebar.orientation&&(this.element.className+=" vertical",t=t.reverse());var o=i.modebar;document.querySelectorAll("#"+a+" .modebar-group").forEach(function(e){e.style.backgroundColor=o.bgcolor});var s=!this.hasButtons(t),l=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(s||l||u)&&(this.removeAllButtons(),this.updateButtons(t),r.watermark||r.displaylogo)){var c=this.getLogo();r.watermark&&(c.className=c.className+" watermark"),"v"===i.modebar.orientation?this.element.insertBefore(c,this.element.childNodes[0]):this.element.appendChild(c),this.hasLogo=!0}this.updateActiveButton(),n.setStyleOnHover("#"+a+" .modebar-btn",".active",".icon path","fill: "+o.activecolor,"fill: "+o.color,this.element)},u.updateButtons=function(e){var t=this;this.buttons=e,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(e){var r=t.createGroup();e.forEach(function(e){var i=e.name;if(!i)throw Error("must provide button 'name' in button config");if(-1!==t.buttonsNames.indexOf(i))throw Error("button name '"+i+"' is taken");t.buttonsNames.push(i);var n=t.createButton(e);t.buttonElements.push(n),r.appendChild(n)}),t.element.appendChild(r)})},u.createGroup=function(){var e=document.createElement("div");e.className="modebar-group";var t=this.graphInfo._fullLayout.modebar;return e.style.backgroundColor=t.bgcolor,e},u.createButton=function(e){var t=this,i=document.createElement("button");i.setAttribute("type","button"),i.setAttribute("rel","tooltip"),i.className="modebar-btn";var n=e.title;void 0===n?n=e.name:"function"==typeof n&&(n=n(this.graphInfo)),(n||0===n)&&(i.setAttribute("data-title",n),i.setAttribute("aria-label",n)),void 0!==e.attr&&i.setAttribute("data-attr",e.attr);var o=e.val;if(void 0!==o&&("function"==typeof o&&(o=o(this.graphInfo)),i.setAttribute("data-val",o)),"function"!=typeof e.click)throw Error("must provide button 'click' function in button config");i.addEventListener("click",function(r){e.click(t.graphInfo,r),t.updateActiveButton(r.currentTarget)}),i.setAttribute("data-toggle",e.toggle||!1),e.toggle&&r.select(i).classed("active",!0);var s=e.icon;return"function"==typeof s?i.appendChild(s()):i.appendChild(this.createIcon(s||a.question)),i.setAttribute("data-gravity",e.gravity||"n"),i},u.createIcon=function(e){var t,r=i(e.height)?Number(e.height):e.ascent-e.descent,n="http://www.w3.org/2000/svg";if(e.path){(t=document.createElementNS(n,"svg")).setAttribute("viewBox",["0 0",e.width,r].join(" ")),t.setAttribute("class","icon");var a=document.createElementNS(n,"path");a.setAttribute("d",e.path),e.transform?a.setAttribute("transform",e.transform):void 0!==e.ascent&&a.setAttribute("transform","matrix(1 0 0 -1 0 "+e.ascent+")"),t.appendChild(a)}return e.svg&&(t=s.parseFromString(e.svg,"application/xml").childNodes[0]),t.setAttribute("height","1em"),t.setAttribute("width","1em"),t},u.updateActiveButton=function(e){var t=this.graphInfo._fullLayout,i=void 0!==e?e.getAttribute("data-attr"):null;this.buttonElements.forEach(function(e){var a=e.getAttribute("data-val")||!0,o=e.getAttribute("data-attr"),s="true"===e.getAttribute("data-toggle"),l=r.select(e),u=function(e,r){var i=t.modebar,n=e.querySelector(".icon path");n&&(r||e.matches(":hover")?n.style.fill=i.activecolor:n.style.fill=i.color)};if(s){if(o===i){var c=!l.classed("active");l.classed("active",c),u(e,c)}}else{var h=null===o?o:n.nestedProperty(t,o).get();l.classed("active",h===a),u(e,h===a)}})},u.hasButtons=function(e){var t=this.buttons;if(!t||e.length!==t.length)return!1;for(var r=0;r1?(I=["toggleHover"],L=["resetViews"]):y?(C=["zoomInGeo","zoomOutGeo"],I=["hoverClosestGeo"],L=["resetGeo"]):g?(I=["hoverClosest3d"],L=["resetCameraDefault3d","resetCameraLastSave3d"]):_?(C=["zoomInMap","zoomOutMap"],I=["toggleHover"],L=["resetViewMap"]):v?I=["hoverClosestPie"]:A?(I=["hoverClosestCartesian","hoverCompareCartesian"],L=["resetViewSankey"]):I=["toggleHover"],m&&I.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(e){for(var t=0;ti?n.slice(i):a.slice(r))+o:n+a+e*t:o}function f(e,t){var r=e._inputDomain,i=l[e.constraintoward],n=r[0]+(r[1]-r[0])*i;e.domain=e._input.domain=[n+(r[0]-n)/t,n+(r[1]-n)/t],e.setScale()}e.handleDefaults=function(e,r,a){var s,l,d,f,p,m,g,y,v=a.axIds,x=a.axHasImage,b=r._axisConstraintGroups=[],_=r._axisMatchGroups=[];for(s=0;ss*v&&!w)){for(n=0;nL&&OC&&(C=O);d/=(C-D)/(2*I),D=u.l2r(D),C=u.l2r(C),u.range=u._input.range=k=e[1]||n[1]<=e[0])&&a[0]t[0])return!0}return!1}(U,q,N)&&-1===S.indexOf(v)){var H=G.node(),$=E.bg=n.ensureSingle(G,"rect","bg");H.insertBefore($.node(),H.childNodes[0]),j.push(S)}else G.select("rect.bg").remove(),N.push([U,q]),V||(B.push(S),j.push(S))}var W=L._bgLayer.selectAll(".bg").data(B);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each(function(e){L._plots[e].bg=t.select(this)}),k=0;k.5?"t":"b",l=e._fullLayout.margin[s],u=0;return"paper"===t.yref?u=r+t.pad.t+t.pad.b:"container"===t.yref&&(i=e._fullLayout.height,n=0,"middle"===o&&(n+=r/2),"t"===s?("top"===o&&(n+=r),n+=i-a*i):("bottom"===o&&(n+=r),n+=a*i),u=n+t.pad.t+t.pad.b),u>l?u:0}(e,A,I);if(L>0){(function(e,t,r,a){var o,s,l="title.automargin",u=e._fullLayout.title,c=u.y>.5?"t":"b",h={x:u.x,y:u.y,t:0,b:0},d={};"paper"===u.yref&&(o="paper"===u.yref?e._fullLayout._size.h:e._fullLayout.height,s=n.isTopAnchor(u)?t:t-a,!(n.isTopAnchor(u)&&"t"===c||n.isBottomAnchor(u)&&"b"===c)&&("b"===c?o-s:s)=0;T--){var A=n.append("path").attr(m).style("opacity",T?.1:g).call(a.stroke,v).call(a.fill,y).call(o.dashLine,T?"solid":b,T?4+x:x);if(function(e,t,r){var i=r.xref+r.yref;o.setClipUrl(e,"clip"+t._fullLayout._uid+i,t)}(A,e,d),_){var M=s(e.layout,"selections",d);A.style({cursor:"move"});var k={element:A.node(),plotinfo:p,gd:e,editHelpers:M,isActiveSelection:!0};i(r(l,e),A,k)}else A.style("pointer-events",T?"all":"none");w[T]=A}var S=w[0];w[1].node().addEventListener("click",function(){var t=e,r=S;if(h(t)){var i=+r.node().getAttribute("data-index");if(i>=0){if(i===t._fullLayout._activeSelectionIndex)return void f(t);t._fullLayout._activeSelectionIndex=i,t._fullLayout._deactivateSelection=f,c(t)}}})}(e._fullLayout._selectionLayer)}function f(e){h(e)&&e._fullLayout._activeSelectionIndex>=0&&(n(e),delete e._fullLayout._activeSelectionIndex,c(e))}t.exports={draw:c,drawOne:d,activateLastSelection:function(e){if(h(e)){var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=f,c(e)}}}}}),ir=m({"node_modules/polybooljs/lib/build-log.js"(e,t){t.exports=function(){var e,t=0,r=!1;function i(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return i("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return i("div_seg",{seg:e,pt:t}),i("chop",{seg:e,pt:t})},statusRemove:function(e){return i("pop_seg",{seg:e})},segmentUpdate:function(e){return i("seg_update",{seg:e})},segmentNew:function(e,t){return i("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return i("rem_seg",{seg:e})},tempStatus:function(e,t,r){return i("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return i("rewind",{seg:e})},status:function(e,t,r){return i("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,i("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),i("log",{txt:e})},reset:function(){return i("reset")},selected:function(e){return i("selected",{segs:e})},chainStart:function(e){return i("chain_start",{seg:e})},chainRemoveHead:function(e,t){return i("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return i("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return i("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return i("chain_match",{index:e})},chainClose:function(e){return i("chain_close",{index:e})},chainAddHead:function(e,t){return i("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return i("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return i("chain_con",{index1:e,index2:t})},chainReverse:function(e){return i("chain_rev",{index:e})},chainJoin:function(e,t){return i("chain_join",{index1:e,index2:t})},done:function(){return i("done")}}}}}),ii=m({"node_modules/polybooljs/lib/epsilon.js"(e,t){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,i){var n=r[0],a=r[1],o=i[0],s=i[1],l=t[0];return(o-n)*(t[1]-a)-(s-a)*(l-n)>=-e},pointBetween:function(t,r,i){var n=t[1]-r[1],a=i[0]-r[0],o=t[0]-r[0],s=i[1]-r[1],l=o*a+n*s;return!(l-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-n>e&&(a-u)*(n-c)/(o-c)+u-i>e&&(s=!s),a=u,o=c}return s}};return t}}}),ia=m({"node_modules/polybooljs/lib/linked-list.js"(e,t){t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,r){for(var i=e.root,n=e.root.next;null!==n;){if(r(n)){t.prev=n.prev,t.next=n,n.prev.next=t,n.prev=t;return}i=n,n=n.next}i.next=t,t.prev=i,t.next=null},findTransition:function(t){for(var r=e.root,i=e.root.next;null!==i&&!t(i);)r=i,i=i.next;return{before:r===e.root?null:r,after:i,insert:function(e){return e.prev=r,e.next=i,r.next=e,null!==i&&(i.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}}}),io=m({"node_modules/polybooljs/lib/intersecter.js"(e,t){var r=ia();t.exports=function(e,t,i){function n(e,t,r){return{id:i?i.segmentId():-1,start:e,end:t,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var a=r.create();function o(e,r){a.insertBefore(e,function(i){var n,a,o,s,l,u;return n=e.isStart,a=e.pt,o=i.isStart,s=i.pt,l=i.other.pt,(0!==(u=t.pointsCompare(a,s))?u:t.pointsSame(r,l)?0:n!==o?n?1:-1:t.pointAboveOrOnLine(r,o?s:l,o?l:s)?1:-1)<0})}function s(e,t){var i,n,a=(o(i=r.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null}),e.end),i);return n=r.node({isStart:!1,pt:e.end,seg:e,primary:t,other:a,status:null}),a.other=n,o(n,a.pt),a}function l(e,t){var r=n(t,e.seg.end,e.seg);return i&&i.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,o(e.other,e.pt),s(r,e.primary)}function u(n,o){var s=r.create();function u(e,r){var n=e.seg,a=r.seg,o=n.start,s=n.end,u=a.start,c=a.end;i&&i.checkIntersection(n,a);var h=t.linesIntersect(o,s,u,c);if(!1===h){if(!t.pointsCollinear(o,s,u)||t.pointsSame(o,c)||t.pointsSame(s,u))return!1;var d=t.pointsSame(o,u),f=t.pointsSame(s,c);if(d&&f)return r;var p=!d&&t.pointBetween(o,u,c),m=!f&&t.pointBetween(s,u,c);if(d)return m?l(r,s):l(e,c),r;p&&(f||(m?l(r,s):l(e,c)),l(r,o))}else 0===h.alongA&&(-1===h.alongB?l(e,u):0===h.alongB?l(e,h.pt):1===h.alongB&&l(e,c)),0===h.alongB&&(-1===h.alongA?l(r,o):0===h.alongA?l(r,h.pt):1===h.alongA&&l(r,s));return!1}for(var c=[];!a.isEmpty();){var h=a.getHead();if(i&&i.vert(h.pt[0]),h.isStart){i&&i.segmentNew(h.seg,h.primary);var d,f,p=function(e){return s.findTransition(function(r){var i,n,a,o,s;return i=r.ev,n=e.seg.start,a=e.seg.end,o=i.seg.start,s=i.seg.end,(t.pointsCollinear(n,o,s)?t.pointsCollinear(a,o,s)||t.pointAboveOrOnLine(a,o,s)?1:-1:t.pointAboveOrOnLine(n,o,s)?1:-1)>0})}(h),m=p.before?p.before.ev:null,g=p.after?p.after.ev:null;i&&i.tempStatus(h.seg,!!m&&m.seg,!!g&&g.seg);var y=function(){if(m){var e=u(h,m);if(e)return e}return!!g&&u(h,g)}();if(y&&(e?(d=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above):y.seg.otherFill=h.seg.myFill,i&&i.segmentUpdate(y.seg),h.other.remove(),h.remove()),a.getHead()!==h){i&&i.rewind(h.seg);continue}e?(d=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,g?h.seg.myFill.below=g.seg.myFill.above:h.seg.myFill.below=n,d?h.seg.myFill.above=!h.seg.myFill.below:h.seg.myFill.above=h.seg.myFill.below):null===h.seg.otherFill&&(f=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:n,h.seg.otherFill={above:f,below:f}),i&&i.status(h.seg,!!m&&m.seg,!!g&&g.seg),h.other.status=p.insert(r.node({ev:h}))}else{var v=h.status;if(null===v)throw Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(v.prev)&&s.exists(v.next)&&u(v.prev.ev,v.next.ev),i&&i.statusRemove(v.ev.seg),v.remove(),!h.primary){var x=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=x}c.push(h.seg)}a.getHead().remove()}return i&&i.done(),c}return e?{addRegion:function(e){for(var r,n=e[e.length-1],a=0;aa!=f>a&&n<(d-c)*(a-h)/(f-h)+c&&(o=!o)}return o}}}),id=m({"src/lib/polygon.js"(e,t){var r=eU().dot,i=L().BADNUM,n=t.exports={};n.tester=function(e){var t,r=e.slice(),n=r[0][0],a=n,o=r[0][1],s=o;for((r[r.length-1][0]!==r[0][0]||r[r.length-1][1]!==r[0][1])&&r.push(r[0]),t=1;ta||u===i||us||t&&l(e))}:function(e,t){var l=e[0],u=e[1];if(l===i||la||u===i||us)return!1;var c,h,d,f,p,m=r.length,g=r[0][0],y=r[0][1],v=0;for(c=1;cMath.max(h,g)||u>Math.max(d,y)))if(uc||Math.abs(r(o,d))>n)return!0;return!1},n.filter=function(e,t){var r=[e[0]],i=0,a=0;function o(o){e.push(o);var s=r.length,l=i;r.splice(a+1);for(var u=l+1;u1&&o(e.pop()),{addPt:o,raw:e,filtered:r}}}}),ip=m({"src/components/selections/constants.js"(e,t){t.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),im=m({"src/components/selections/select.js"(e,t){var r=ic(),i=ih(),n=e1(),a=rt().dashStyle,o=er(),s=rO(),l=t7().makeEventData,u=rR(),c=u.freeMode,h=u.rectMode,d=u.drawMode,f=u.openMode,p=u.selectMode,m=r$(),g=rH(),y=rY(),v=tL().clearOutline,x=rU(),b=x.handleEllipse,_=x.readPaths,w=rq().newShapes,T=rG(),A=it().activateLastSelection,M=tb(),k=M.sorterAsc,S=id(),E=ti(),D=tI().getFromId,C=rB(),I=ie().redrawReglTraces,L=ip(),P=L.MINSELECT,z=S.filter,F=S.tester,O=rV(),R=O.p2r,B=O.axValue,j=O.getTransform;function N(e){return void 0!==e.subplot}function V(e,t,r,i,n,a,o){var s,l,u,c,h,d,p,m,g,v=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if((_=v)&&Array.isArray(_)&&!0!==_[0].hoverOnBox){G(e,t,a);var _,w,T=function(e,t){var r,i,n=e[0],a=-1,o=[];for(i=0;i0?function(e,t){var r,i,n,a=[];for(n=0;n0&&a.push(r);if(1===a.length&&a[0]===t.searchInfo&&(i=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(n=0;ni.selectedpoints.indexOf(t.pointNumbers[n]))return!1;return!0}return!1}(s,T):function(e){var t,r,i=0;for(r=0;r1||(i+=t.selectedpoints.length)>1))return!1;return 1===i}(s)&&(d=Z(T))){for(o&&o.remove(),g=0;g=0&&a._fullLayout._deactivateShape(a),a._fullLayout._activeSelectionIndex>=0&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=d(r),l=p(r);if(s||l){var u,c,h=o.selectAll(".select-outline-"+i.id);h&&a._fullLayout._outlining&&(s&&(u=w(h,e)),u&&n.call("_guiRelayout",a,{shapes:u}),l&&!N(e)&&(c=T(h,e)),c&&(a._fullLayout._noEmitSelectedAtStart=!0,n.call("_guiRelayout",a,{selections:c}).then(function(){t&&A(a)})),a._fullLayout._outlining=!1)}i.selection={},i.selection.selectionDefs=e.selectionDefs=[],i.selection.mergedPolygons=e.mergedPolygons=[]}function $(e){return e._id}function W(e,t,r,i){if(!e.calcdata)return[];var n,a,o,s=[],l=t.map($),u=r.map($);for(o=0;o0?i[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(n)>-1}function X(e,t,r){var i,a;for(i=0;i-1&&t;if(!a&&t){var ep=en(e,!0);if(ep.length){var em=ep[0].xref,eg=ep[0].yref;if(em&&eg){var ey=es(ep);el([D(e,em,"x"),D(e,eg,"y")])(ed,ey)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ef&&eu(e,ed),f._reselect=!1}if(!a&&f._deselect){var ev=f._deselect;(function(e,t,r){for(var i=0;i=0)return void S._fullLayout._deactivateShape(S);if(!_){var r=D.clickmode;E.done(eE).then(function(){if(E.clear(eE),2===e){for(ew.remove(),ea=0;ea-1&&V(t,S,i.xaxes,i.yaxes,i.subplot,i,ew),"event"===r&&eu(S,void 0);s.click(S,t,R.id)}).catch(M.error)}},i.doneFn=function(){ek.remove(),E.done(eE).then(function(){E.clear(eE),!C&&en&&i.selectionDefs&&(en.subtract=e_,i.selectionDefs.push(en),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,er)),(C||_)&&H(i,C),i.doneFnCompleted&&i.doneFnCompleted(eD),w&&eu(S,eh)}).catch(M.error)}},clearOutline:v,clearSelectionsCache:H,selectOnClick:V}}}),ig=m({"src/components/annotations/arrow_paths.js"(e,t){t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),iy=m({"src/constants/axis_placeable_objects.js"(e,t){t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e,"axis and a",e,"position of 0.5 refers to the point between the",t,"and the",r,"of the domain of the second",e,"axis."].join(" ")}}}}),iv=m({"src/components/annotations/attributes.js"(e,t){var r=ig(),i=$(),n=tC(),a=tD().templatedArray;iy(),t.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",n.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",n.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),ix=m({"src/traces/scatter/constants.js"(e,t){t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),ib=m({"src/traces/scatter/fillcolor_attribute.js"(e,t){t.exports=function(e){return{valType:"color",editType:"style",anim:!0}}}}),i_=m({"src/traces/scatter/attributes.js"(e,t){var r=tV().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=eY(),o=tG(),s=$(),l=e$().dash,u=e$().pattern,c=rt(),h=ix(),d=H().extendFlat,f=ib();function p(e){return{valType:"any",dflt:0,editType:"calc"}}function m(e){return{valType:"any",editType:"calc"}}function g(e){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:p("x"),yperiod:p("y"),xperiod0:m("x0"),yperiod0:m("y0"),xperiodalignment:g("x"),yperiodalignment:g("y"),xhoverformat:r("x"),yhoverformat:r("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n(),texttemplatefallback:a({editType:"calc"}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:h.eventDataKeys}),hovertemplatefallback:a(),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:d({},l,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:f(!0),fillgradient:d({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:u,marker:d({symbol:{valType:"enumerated",values:c.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:d({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},dash:d({},l,{arrayOk:!0}),editType:"calc"},o("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},o("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:s({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),iw=m({"src/components/selections/attributes.js"(e,t){var r=iv(),i=i_().line,n=e$().dash,a=H().extendFlat,o=eH().overrideAll,s=tD().templatedArray;iy(),t.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:i.color,width:a({},i.width,{min:1,dflt:1}),dash:a({},n,{dflt:"dot"})}}),"arraydraw","from-root")}}),iT=m({"src/components/selections/defaults.js"(e,t){var r=tb(),i=ro(),n=tK(),a=iw(),o=r$();function s(e,t,n){function s(i,n){return r.coerce(e,t,a,i,n)}var l=s("path"),u="path"!==s("type",l?"path":"rect");u&&delete t.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var c=["x","y"],h=0;h<2;h++){var d,f,p,m=c[h],g={_fullLayout:n},y=i.coerceRef(e,t,g,m);if((d=i.getFromId(g,y))._selectionIndices.push(t._index),p=o.rangeToShapePosition(d),f=o.shapePositionToRange(d),u){var v=m+"0",x=m+"1",b=e[v],_=e[x];e[v]=f(e[v],!0),e[x]=f(e[x],!0),i.coercePosition(t,g,s,y,v),i.coercePosition(t,g,s,y,x);var w=t[v],T=t[x];void 0!==w&&void 0!==T&&(t[v]=p(w),t[x]=p(T),e[v]=b,e[x]=_)}}u&&r.noneOrAll(e,t,["x0","x1","y0","y1"])}t.exports=function(e,t){n(e,t,{name:"selections",handleItemDefaults:s});for(var r=t.selections,i=0;i.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",s(r,i)).attr("d",n+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",s(t,r)).attr("d","M0,0Z")}function j(e,t,r,i,n,a){e.attr("d",i+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),N(e,t,n,a)}function N(e,t,r,i){r||(e.transition().style("fill",i>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){I&&e.data&&e._context.showTips&&(i.notifier(i._(e,"Double-click to zoom back out"),"long",e),I=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,a){for(var o,s,l,u,c=!1,h={},d={},f=(a||{}).xaHash,p=(a||{}).yaHash,m=0;m=0)return void s._fullLayout._deactivateShape(s);var u=s._fullLayout.clickmode;if(V(s),2!==i||eD||function(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,r=[];eg&&(r=r.concat(el)),ey&&(r=r.concat(eu)),em.xaxes&&(r=r.concat(em.xaxes)),em.yaxes&&(r=r.concat(em.yaxes));var i,n,a={};if("reset+autosize"===t)for(t="autosize",n=0;n-1&&k(a,s,el,eu,t.id,eL),u.indexOf("event")>-1&&h.click(s,a,t.id);else if(1===i&&eD){var c,d,f,p,m=M?ea:en,g=+("s"!==M&&"w"!==I),y=m._name+".range["+g+"]",v=(c=m,d=g,p=Math.abs((f=c.range[d])-c.range[1-d]),"date"===c.type?f:"log"===c.type?n("."+(Math.ceil(Math.max(0,-Math.log(p)/Math.LN10))+3)+"g")(Math.pow(10,f)):n("."+String(Math.floor(Math.log(Math.abs(f))/Math.LN10)-Math.floor(Math.log(p)/Math.LN10)+4)+"g")(f)),x="left",b="middle";if(m.fixedrange)return;M?(b="n"===M?"top":"bottom","right"===m.side&&(x="right")):"e"===I&&(x="right"),s._context.showAxisRangeEntryBoxes&&r.select(eI).call(l.makeEditable,{gd:s,immediate:!0,background:s._fullLayout.paper_bgcolor,text:String(v),fill:m.tickfont?m.tickfont.color:"#444",horizontalAlign:x,verticalAlign:b}).on("edit",function(e){var t=m.d2r(e);void 0!==t&&o.call("_guiRelayout",s,y,t)})}}function eF(t,r){if(e._transitioningWithDuration)return!1;var i,n,a,o,s=Math.max(0,Math.min(ed,eM*t+Y)),l=Math.max(0,Math.min(ef,ek*r+Z)),u=Math.abs(s-Y),c=Math.abs(l-Z);function h(){ee="",X.r=X.l,X.t=X.b,er.attr("d","M0,0Z")}if(X.l=Math.min(Y,s),X.r=Math.max(Y,s),X.t=Math.min(Z,l),X.b=Math.max(Z,l),ep.isSubplotConstrained)u>C||c>C?(ee="xy",u/ed>c/ef?(c=u*ef/ed,Z>l?X.t=Z-c:X.b=Z+c):(u=c*ed/ef,Y>s?X.l=Y-u:X.r=Y+u),er.attr("d",q(X))):h();else if(em.isSubplotConstrained)if(u>C||c>C){ee="xy";var d=Math.min(X.l/ed,(ef-X.b)/ef),f=Math.max(X.r/ed,(ef-X.t)/ef);X.l=d*ed,X.r=f*ed,X.b=(1-d)*ef,X.t=(1-f)*ef,er.attr("d",q(X))}else h();else{!ey||c0){if(em.isSubplotConstrained||!eg&&1===ey.length){for(a=0;a=0?Math.min(l,.9):1/(1/Math.max(l,-.3)+3.222)));var l,u=s.l2r(n);!1!==u&&void 0!==u&&(s.range[t]=u)}}return i._length*(i._rl[t]-n)/(i._rl[t]-i._rl[a])}}function eq(e,t){for(var r=em.isSubplotConstrained?({x:eu,y:el})[e]:em[e+"axes"],i=em.isSubplotConstrained?({x:el,y:eu})[e]:[],n=0;n1&&(void 0!==a.maxallowed&&ex===(a.range[0]1&&(void 0!==s.maxallowed&&eb===(s.range[0]1&&i.warn("Full array edits are incompatible with other edits",d);var x=l[""][""];if(s(x))t.set(null);else{if(!Array.isArray(x))return i.warn("Unrecognized full array edit value",d,x),!0;t.set(x)}return!g&&(f(y,v),p(e),!0)}var b,_,w,T,A,M,k,S,E=Object.keys(l).map(Number).sort(n),D=t.get(),C=D||[],I=c(v,d).get(),L=[],P=-1,z=C.length;for(b=0;bC.length-!k){i.warn("index out of range",d,w);continue}if(void 0!==M)A.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",d,w),s(M)?L.push(w):k?("add"===M&&(M={}),C.splice(w,0,M),I&&I.splice(w,0,{})):i.warn("Unrecognized full object edit value",d,w,M),-1===P&&(P=w);else for(_=0;_=0;b--)C.splice(L[b],1),I&&I.splice(L[b],1);if(C.length?D||t.set(C):t.set(null),g)return!1;if(f(y,v),m!==r){if(-1===P)h=E;else{for(z=Math.max(C.length,z),h=[],b=0;b=P);b++)h.push(w);for(b=P;b0&&i.log("Clearing previous rejected promises from queue."),e._promises=[]},e.cleanLayout=function(t){t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var r,a=(n.subplotsRegistry.cartesian||{}).attrRegex,s=((n.subplotsRegistry.polar||{}).attrRegex,(n.subplotsRegistry.ternary||{}).attrRegex,(n.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(t));for(r=0;r3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t},e.cleanData=function(t){for(var a=0;a0)return e.slice(0,t)}e.hasParent=function(e,t){for(var r=m(t);r;){if(r in e)return!0;r=m(r)}return!1},e.clearAxisTypes=function(e,t,r){for(var n=0;n{let r=(...e)=>e.every(e=>i.isPlainObject(e))||e.every(e=>Array.isArray(e));if([e,t].every(e=>Array.isArray(e))){if(e.length!==t.length)return!1;for(let i=0;ii.isPlainObject(e))){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e){if(i.startsWith("_"))continue;let n=e[i],a=t[i];if(n!==a&&!(r(n,a)&&g(n,a)))return!1}return!0}return!1};e.collectionsAreEqual=g}}),iL=m({"src/plot_api/plot_api.js"(e){var t=M(),r=I(),i=tT(),n=tb(),a=n.nestedProperty,o=tM(),s=tk(),l=e1(),u=tE(),c=tO(),h=ro(),d=rl(),f=tU(),p=rt(),m=er(),g=iE().initInteractions,y=tR(),v=ik().clearOutline,x=J().dfltConfig,b=iC(),_=iI(),w=ie(),T=eH(),A=tC().AX_NAME_PATTERN,k=0;function S(e){var t=e._fullLayout;t._redrawFromAutoMarginCount?t._redrawFromAutoMarginCount--:e.emit("plotly_afterplot")}function E(e,t){try{e._fullLayout._paper.style("background",t)}catch(e){n.error(e)}}function D(e,t){E(e,m.combine(t,"white"))}function C(e,r){if(!e._context){e._context=n.extendDeep({},x);var a=t.select("base");e._context._baseUrl=a.size()&&a.attr("href")?window.location.href.split("#")[0]:""}var o,s,l,u=e._context;if(r){for(s=Object.keys(r),o=0;o=e.data.length||n<-e.data.length)throw Error(r+" must be valid indices for gd.data.");if(t.indexOf(n,i+1)>-1||n>=0&&t.indexOf(-e.data.length+n)>-1||n<0&&t.indexOf(e.data.length+n)>-1)throw Error("each index in "+r+" must be unique.")}}function z(e,t,r){if(!Array.isArray(e.data))throw Error("gd.data must be an array.");if(typeof t>"u")throw Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),P(e,t,"currentIndices"),"u">typeof r&&!Array.isArray(r)&&(r=[r]),"u">typeof r&&P(e,r,"newIndices"),"u">typeof r&&t.length!==r.length)throw Error("current and new indices must be of equal length.")}function F(e,t,i,o,s){var l=n.isPlainObject(o);if(!Array.isArray(e.data))throw Error("gd.data must be an array");if(!n.isPlainObject(t))throw Error("update must be a key:value object");if(typeof i>"u")throw Error("indices must be an integer or array of integers");for(var u in P(e,i,"indices"),t){if(!Array.isArray(t[u])||t[u].length!==i.length)throw Error("attribute "+u+" must be an array of length equal to indices array length");if(l&&(!(u in o)||!Array.isArray(o[u])||o[u].length!==t[u].length))throw Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}for(var c=function(e,t,i,o){var s,l,u,c,h=n.isPlainObject(o),d=[];for(var f in Array.isArray(i)||(i=[i]),i=L(i,e.data.length-1),t)for(var p=0;p0&&"string"!=typeof P.parts[O];)O--;var R=P.parts[O],N=P.parts[O-1]+"."+R,V=P.parts.slice(0,O).join("."),U=a(e.layout,V).get(),q=a(c,V).get(),G=P.get();if(void 0!==z){k[L]=z,S[L]="reverse"===R?z:B(G);var Y=u.getLayoutValObject(c,P.parts);if(Y&&Y.impliedEdits&&null!==z)for(var X in Y.impliedEdits)E(n.relativeAttr(L,X),Y.impliedEdits[X]);if(-1!==["width","height"].indexOf(L))if(z){E("autosize",null);var K="height"===L?"width":"height";E(K,c[K])}else c[L]=e._initialAutoSize[L];else if("autosize"===L)E("width",z?null:c.width),E("height",z?null:c.height);else if(N.match(H))I(N),a(c,V+"._inputRange").set(null);else if(N.match($)){I(N),a(c,V+"._inputRange").set(null);var J=a(c,V).get();J._inputDomain&&(J._input.domain=J._inputDomain.slice())}else N.match(W)&&a(c,V+"._inputDomain").set(null);if("type"===R){D=U;var Q="linear"===q.type&&"log"===z,ee="log"===q.type&&"linear"===z;if(Q||ee){if(D&&D.range)if(q.autorange)Q&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var et=D.range[0],er=D.range[1];Q?(et<=0&&er<=0&&E(V+".autorange",!0),et<=0?et=er/1e6:er<=0&&(er=et/1e6),E(V+".range[0]",Math.log(et)/Math.LN10),E(V+".range[1]",Math.log(er)/Math.LN10)):(E(V+".range[0]",Math.pow(10,et)),E(V+".range[1]",Math.pow(10,er)))}else E(V+".autorange",!0);Array.isArray(c._subplots.polar)&&c._subplots.polar.length&&c[P.parts[0]]&&"radialaxis"===P.parts[1]&&delete c[P.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(e,q,z,E),l.getComponentMethod("images","convertCoords")(e,q,z,E)}else E(V+".autorange",!0),E(V+".range",null);a(c,V+"._inputRange").set(null)}else if(R.match(A)){var ei=a(c,L).get(),en=(z||{}).type;en&&"-"!==en||(en="linear"),l.getComponentMethod("annotations","convertCoords")(e,ei,en,E),l.getComponentMethod("images","convertCoords")(e,ei,en,E)}var ea=b.containerArrayMatch(L);if(ea){r=ea.array,i=ea.index;var eo=ea.property,es=Y||{editType:"calc"};""!==i&&""===eo&&(b.isAddVal(z)?S[L]=null:b.isRemoveVal(z)?S[L]=(a(s,r).get()||[])[i]:n.warn("unrecognized full object value",t)),T.update(M,es),y[r]||(y[r]={});var el=y[r][i];el||(el=y[r][i]={}),el[eo]=z,delete t[L]}else"reverse"===R?(U.range?U.range.reverse():(E(V+".autorange",!0),U.range=[1,0]),q.autorange?M.calc=!0:M.plot=!0):("dragmode"===L&&(!1===z&&!1!==G||!1!==z&&!1===G)||c._has("scatter-like")&&c._has("regl")&&"dragmode"===L&&("lasso"===z||"select"===z)&&"lasso"!==G&&"select"!==G?M.plot=!0:Y?T.update(M,Y):M.calc=!0,P.set(z))}}for(r in y)b.applyContainerArrayChanges(e,f(s,r),y[r],M,f)||(M.plot=!0);for(var eu in C){var ec=(D=h.getFromId(e,eu))&&D._constraintGroup;if(ec)for(var eh in M.calc=!0,ec)C[eh]||(h.getFromId(e,eh)._constraintShrinkable=!0)}(Z(e)||t.height||t.width)&&(M.plot=!0);var ed=c.shapes;for(i=0;i1;)if(i.pop(),void 0!==(r=a(t,i.join(".")+".uirevision").get()))return r;return t.uirevision}function en(e,t){var r=n.isPlainObject(e),i=Array.isArray(e);return r||i?(r&&n.isPlainObject(t)||i&&Array.isArray(t))&&JSON.stringify(e)===JSON.stringify(t):e===t}function ea(e,t,r,i){var a,o,s,l=i.getValObject,u=i.flags,c=i.immutable,h=i.inArray,d=i.arrayIndex;function f(){var e=a.editType;h&&-1!==e.indexOf("arraydraw")?n.pushUnique(u.arrays[h],d):(T.update(u,a),"none"!==e&&u.nChanges++,i.transition&&a.anim&&u.nChangesAnim++,(H.test(s)||$.test(s))&&(u.rangesAltered[r[0]]=1),"datarevision"===o&&(u.newDataRevision=1))}function p(e){return"data_array"===e.valType||e.arrayOk}for(o in e){if(u.calc&&!i.transition)return;var m=e[o],g=t[o],y=r.concat(o);if(s=y.join("."),"_"!==o.charAt(0)&&"function"!=typeof m&&m!==g){if(("tick0"===o||"dtick"===o)&&"geo"!==r[0]){var v=t.tickmode;if("auto"===v||"array"===v||!v)continue}if(!("range"===o&&t.autorange)&&("zmin"!==o&&"zmax"!==o||"contourcarpet"!==t.type)&&(a=l(y))&&!(a._compareAsJSON&&JSON.stringify(m)===JSON.stringify(g))){var x,b=a.valType,_=p(a),w=Array.isArray(m),A=Array.isArray(g);if(w&&A){var M="_input_"+o,k=e[M],S=t[M];if(Array.isArray(k)&&k===S)continue}if(void 0===g)_&&w?u.calc=!0:f();else if(a._isLinkedToArray){var E=[],D=!1;h||(u.arrays[o]=E);var C=Math.min(m.length,g.length),I=Math.max(m.length,g.length);if(C!==I)if("arraydraw"===a.editType)D=!0;else{f();continue}for(x=0;x=a.length?e.transitionOpts=a[u]:e.transitionOpts=a[0]:e.transitionOpts=a,u++,e}var d,f,p=[],m=null==t,g=Array.isArray(t);if(!m&&!g&&n.isPlainObject(t))p.push({type:"object",data:h(n.extendFlat({},t))});else if(m||-1!==["string","number"].indexOf(typeof t))for(d=0;d0&&xx)&&b.push(f);p=b}}p.length>0?function(t){if(0!==t.length){for(var n,u=0;u=o.length?o[0]:o[h]:o),m=(d=u,Array.isArray(a)?d>=a.length?a[0]:a[d]:a);m.duration=Math.min(m.duration,p.duration);var g={frame:f,name:t[u].name,frameOpts:p,transitionOpts:m};u===t.length-1&&(g.onComplete=function(e){var t=0;return function(){if(e&&2==++t)return e()}}(s),g.onInterrupt=l),i._frameQueue.push(g)}"immediate"===r.mode&&(i._lastFrameAt=-1/0),i._animationRaf||(e.emit("plotly_animating"),i._lastFrameAt=-1/0,i._timeToNext=0,i._runningTransitions=0,i._currentFrame=null,(n=function(){i._animationRaf=window.requestAnimationFrame(n),Date.now()-i._lastFrameAt>i._timeToNext&&function(){i._currentFrame&&i._currentFrame.onComplete&&i._currentFrame.onComplete();var t=i._currentFrame=i._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,i._lastFrameAt=Date.now(),i._timeToNext=t.frameOpts.duration,c.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then(function(){t.onComplete&&t.onComplete()}),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(i._animationRaf),i._animationRaf=null}()})())}}(p):(e.emit("plotly_animated"),s())})},e.addFrames=function(e,t,r){if(e=n.getGraphDiv(e),null==t)return Promise.resolve();if(!n.isPlotDiv(e))throw Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var i,a,o,l,u=e._transitionData._frames,h=e._transitionData._frameHash;if(!Array.isArray(t))throw Error("addFrames failure: frameList must be an Array of frame definitions"+t);var d=u.length+2*t.length,f=[],p={};for(i=t.length-1;i>=0;i--)if(n.isPlainObject(t[i])){var m=t[i].name,g=(h[m]||p[m]||{}).name,y=t[i].name,v=h[g]||p[g];g&&y&&"number"==typeof y&&v&&k<5&&(k++,n.warn('addFrames: overwriting frame "'+(h[g]||p[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&n.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[m]={name:m},f.push({frame:c.supplyFrameDefaults(t[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:d+i})}f.sort(function(e,t){return e.index>t.index?-1:+(e.index=0;i--){if("number"==typeof(a=f[i].frame).name&&n.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+e._transitionData._counter++];);if(h[a.name]){for(o=0;o=0;r--)i=t[r],o.push({type:"delete",index:i}),l.unshift({type:"insert",index:i,value:a[i]});var u=c.modifyFrames,h=c.modifyFrames,d=[e,l],f=[e,o];return s&&s.add(e,u,d,h,f),c.modifyFrames(e,o)},e.addTraces=function t(r,i,a){r=n.getGraphDiv(r);var o,l,u=[],c=e.deleteTraces,h=[r,u],d=[r,i];for(function(e,t,r){var i,n;if(!Array.isArray(e.data))throw Error("gd.data must be an array.");if(typeof t>"u")throw Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),i=0;itypeof r&&!Array.isArray(r)&&(r=[r]),"u">typeof r&&r.length!==t.length)throw Error("if indices is specified, traces.length must equal indices.length")}(r,i,a),Array.isArray(i)||(i=[i]),i=i.map(function(e){return n.extendFlat({},e)}),_.cleanData(i),o=0;o"u")return l=e.redraw(r),s.add(r,c,h,t,d),l;Array.isArray(a)||(a=[a]);try{z(r,u,a)}catch(e){throw r.data.splice(r.data.length-i.length,i.length),e}return s.startSequence(r),s.add(r,c,h,t,d),l=e.moveTraces(r,u,a),s.stopSequence(r),l},e.deleteTraces=function t(r,i){r=n.getGraphDiv(r);var a,o,l=[],u=e.addTraces,c=[r,l,i],h=[r,i];if(typeof i>"u")throw Error("indices must be an integer or array of integers.");for(Array.isArray(i)||(i=[i]),P(r,i,"indices"),(i=L(i,r.data.length-1)).sort(n.sorterDes),a=0;a=0&&r"u")for(a=[],o=0;o=0&&r[e,t._ev.listeners(e)]);h=e.newPlot(t,r,i,o).then(()=>{for(let[e,r]of n)r.forEach(r=>t.on(e,r));return e.react(t,r,i,o)})}else{t.data=r||[],_.cleanData(t.data),t.layout=i||{},_.cleanLayout(t.layout),function(e,t,r,i){var o,s,l,u,c,h,d,f,p,m,g=i._preGUI,y=[],v={},x={};for(o in g){if(c=et(o,Q)){if(p=c.head,m=c.tail,(u=(l=a(i,s=c.attr||p+".uirevision").get())&&ei(s,t))&&u===l){if(null===(h=g[o])&&(h=void 0),en(f=(d=a(t,o)).get(),h)){void 0===f&&"autorange"===m&&y.push(p),d.set(B(a(i,o).get()));continue}else if("autorange"===m||"range["===m.slice(0,6)){var b=g[p+".range[0]"],_=g[p+".range[1]"],w=g[p+".autorange"];if(w||null===w&&null===b&&null===_){if(!(p in v)){var T=a(t,p).get();v[p]=T&&(T.autorange||!1!==T.autorange&&(!T.range||2!==T.range.length))}if(v[p]){d.set(B(a(i,o).get()));continue}}}}}else n.warn("unrecognized GUI edit: "+o);delete g[o],c&&"range["===c.tail.slice(0,6)&&(x[c.head]=1)}for(var A=0;A(m||t.emit("plotly_react",{config:o,data:r,layout:i}),t))},e.redraw=function(t){if(t=n.getGraphDiv(t),!n.isPlotDiv(t))throw Error("This element is not a Plotly plot: "+t);return _.cleanData(t.data),_.cleanLayout(t.layout),t.calcdata=void 0,e._doPlot(t).then(function(){return t.emit("plotly_redraw"),t})},e.relayout=U,e.restyle=R,e.setPlotConfig=function(e){return n.extendFlat(x,e)},e.update=X,e._guiRelayout=K(U),e._guiRestyle=K(R),e._guiUpdate=K(X),e._storeDirectGUIEdit=function(e,t,r){for(var i in r){var n=a(e,i);N(i,n.get(),r[i],t)}}}}),iP=m({"src/snapshot/helpers.js"(e){var t=e1();e.getDelay=function(e){return e._has&&(e._has("gl3d")||e._has("map"))?500:0},e.getRedrawFunc=function(e){return function(){t.getComponentMethod("colorbar","draw")(e)}},e.encodeSVG=function(e){return"data:image/svg+xml,"+encodeURIComponent(e)},e.encodeJSON=function(e){return"data:application/json,"+encodeURIComponent(e)};var r=window.URL||window.webkitURL;e.createObjectURL=function(e){return r.createObjectURL(e)},e.revokeObjectURL=function(e){return r.revokeObjectURL(e)},e.createBlob=function(e,t){if("svg"===t)return new window.Blob([e],{type:"image/svg+xml;charset=utf-8"});if("full-json"===t)return new window.Blob([e],{type:"application/json;charset=utf-8"});var r=function(e){for(var t=e.length,r=new ArrayBuffer(t),i=new Uint8Array(r),n=0;n{let t=e.toLowerCase();return l.includes(t)?e:u.includes(t)?"<":c.includes(t)?">":e.includes("<")||e.includes(">")?"":d.html(e).text()}),d.remove(),k=(k=(k=f).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(s,"'")}}}),iF=m({"src/snapshot/svgtoimg.js"(e,t){var r=tb(),i=tA().EventEmitter,n=iP();t.exports=function(e){var t=e.emitter||new i,a=new Promise(function(i,a){var o,s,l=window.Image,u=e.svg,c=e.format||"png",h=e.canvas,d=e.scale||1,f=e.width||300,p=e.height||150,m=d*f,g=d*p,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===c||r.isSafari()?s=n.encodeSVG(u):(o=n.createBlob(u,"svg"),s=n.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,n.revokeObjectURL(s),"svg"!==c&&y.drawImage(v,0,0,m,g),c){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(Error(l)),!e.promise)return t.emit("error",l)}i(r),e.promise||t.emit("success",r)},v.onerror=function(r){if(o=null,n.revokeObjectURL(s),a(r),!e.promise)return t.emit("error",r)},v.src=s});return e.promise?a:t}}}),iO=m({"src/plot_api/to_image.js"(e,t){var r=I(),i=iL(),n=tO(),a=tb(),o=iP(),s=iz(),l=iF(),u=T().version,c={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){function h(e){return!(e in t)||a.validate(t[e],c[e])}if(t=t||{},a.isPlainObject(e)?(d=e.data||[],f=e.layout||{},p=e.config||{},m={}):(e=a.getGraphDiv(e),d=a.extendDeep([],e.data),f=a.extendDeep({},e.layout),p=e._context,m=e._fullLayout||{}),!h("width")&&null!==t.width||!h("height")&&null!==t.height)throw Error("Height and width should be pixel values.");if(!h("format"))throw Error("Export format is not "+a.join2(c.format.values,", "," or ")+".");var d,f,p,m,g={};function y(e,r){return a.coerce(t,g,c,e,r)}var v=y("format"),x=y("width"),b=y("height"),_=y("scale"),w=y("setBackground"),T=y("imageDataOnly"),A=document.createElement("div");A.style.position="absolute",A.style.left="-5000px",document.body.appendChild(A);var M=a.extendFlat({},f);x?M.width=x:null===t.width&&r(m.width)&&(M.width=m.width),b?M.height=b:null===t.height&&r(m.height)&&(M.height=m.height);var k=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=o.getRedrawFunc(A);function E(){return new Promise(function(e){setTimeout(e,o.getDelay(A._fullLayout))})}function D(){return new Promise(function(e,t){var r=s(A,v,_),c=A._fullLayout.width,h=A._fullLayout.height;function d(){i.purge(A),document.body.removeChild(A)}if("full-json"===v){var f=n.graphJson(A,!1,"object",!0,!0);return f.version=u,f=JSON.stringify(f),d(),e(T?f:o.encodeJSON(f))}if(d(),"svg"===v)return e(T?r:o.encodeSVG(r));var p=document.createElement("canvas");p.id=a.randstr(),l({format:v,width:c,height:h,scale:_,canvas:p,svg:r,promise:!0}).then(e).catch(t)})}return new Promise(function(e,t){i.newPlot(A,d,M,k).then(S).then(E).then(D).then(function(t){e(T?t.replace(o.IMAGE_URL_PREFIX,""):t)}).catch(function(e){t(e)})})}}}),iR=m({"src/plot_api/validate.js"(e,t){var r=tb(),i=tO(),n=tE(),a=J().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function u(e,t,i,n,a,c){c=c||[];for(var h=Object.keys(e),f=0;fv.length&&n.push(d("unused",a,g.concat(v.length)));var A,M,k,S,E,D,C,I=v.length,L=Array.isArray(T);if(L&&(I=Math.min(I,T.length)),2===x.dimensions)for(S=0;Sv[S].length&&n.push(d("unused",a,g.concat(S,v[S].length)));var P=v[S].length;for(k=0;k<(L?Math.min(P,T[S].length):P);k++)E=L?T[S][k]:T,D=y[S][k],C=v[S][k],r.validate(D,E)?C!==D&&C!==+D&&n.push(d("dynamic",a,g.concat(S,k),D,C)):n.push(d("value",a,g.concat(S,k),D))}else n.push(d("array",a,g.concat(S),y[S]));else for(S=0;S1&&f.push(d("object","layout"))),i.supplyDefaults(p);for(var m=p._fullData,g=l.length,y=0;yw?h.push({code:"unused",traceType:y,templateCount:_,dataCount:w}):w>_&&h.push({code:"reused",traceType:y,templateCount:_,dataCount:w})}}else h.push({code:"data"});if(function e(t,i){for(var n in t)if("_"!==n.charAt(0)){var a=t[n],o=f(t,n,i);r(a)?(Array.isArray(t)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),e(a,o)):Array.isArray(a)&&function(e){for(var t=0;t=0;h--){var d=e[h];if("scatter"===d.type&&d.xaxis===u.xaxis&&d.yaxis===u.yaxis){d.opacity=void 0;break}}}}}}}),iQ=m({"src/traces/scatter/layout_defaults.js"(e,t){var r=tb(),i=tP();t.exports=function(e,t){var n,a="group"===t.barmode;"group"===t.scattermode&&(n=a?t.bargap:.2,r.coerce(e,t,i,"scattergap",n))}}}),i0=m({"src/plots/cartesian/align_period.js"(e,t){var r=I(),i=tb(),n=i.dateTime2ms,a=i.incrementMonth,o=L().ONEAVGMONTH;t.exports=function(e,t,i,s){if("date"!==t.type)return{vals:s};var l=e[i+"periodalignment"];if(!l)return{vals:s};var u,c=e[i+"period"];if(r(c)){if((c*=1)<=0)return{vals:s}}else if("string"==typeof c&&"M"===c.charAt(0)){var h=+c.substring(1);if(!(h>0)||Math.round(h)!==h)return{vals:s};u=h}for(var d=t.calendar,f="start"===l,p="end"===l,m=e[i+"period0"],g=n(m,d)||0,y=[],v=[],x=[],b=s.length,_=0;_M;)A=a(A,-u,d);for(;A<=M;)A=a(A,u,d);T=a(A,-u,d)}else{for(w=Math.round((M-g)/c),A=g+w*c;A>M;)A-=c;for(;A<=M;)A+=c;T=A-c}y[_]=f?T:p?A:(T+A)/2,v[_]=T,x[_]=A}return{vals:y,starts:v,ends:x}}}}),i1=m({"src/traces/scatter/colorscale_calc.js"(e,t){var r=tN().hasColorscale,i=t5(),n=t6();t.exports=function(e,t){n.hasLines(t)&&r(t,"line")&&i(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),n.hasMarkers(t)&&(r(t,"marker")&&i(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),r(t,"marker.line")&&i(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),i2=m({"src/traces/scatter/arrays_to_calcdata.js"(e,t){var r=tb();t.exports=function(e,t){for(var i=0;ip&&C[y].gap;)y--;for(x=C[y].s,g=C.length-1;g>y;g--)C[g].s=x;for(;ph+u||!r(c))}for(var f=0;fn(e))):n(e.text);let a=e.outsidetextfont.size*c*r+u;return{ppadplus:t.some(e=>e.s<0)?a:0,ppadminus:t.some(e=>e.s>=0)?a:0}}return{ppadplus:void 0,ppadminus:void 0}}function b(e){return e._id.charAt(0)}t.exports={crossTraceCalc:function(e,t){for(var r=t.xaxis,i=t.yaxis,n=e._fullLayout,o=e._fullData,s=e.calcdata,l=[],u=[],c=0;cS[h]&&h0?o:s)/(D._m*L*(D._m>0?o:s)))),a*=1e3}if(l===n){if(I&&(l=D.c2p(i.y,!0)),l===n)return!1;l*=1e3}return[a,l]}function W(e,t,r,i){var n=r-e,a=i-t,o=.5-e,s=.5-t,l=n*n+a*a,u=n*o+a*s;if(u>0&&ueo||e[1]el)return[c(e[0],ea,eo),c(e[1],es,el)]}function eh(e,t){if(e[0]===t[0]&&(e[0]===ea||e[0]===eo)||e[1]===t[1]&&(e[1]===es||e[1]===el))return!0}function ed(e,t,r){return function(i,n){var a,o=ec(i),s=ec(n),u=[];if(o&&s&&eh(o,s))return u;o&&u.push(o),s&&u.push(s);var c=2*l.constrain((i[e]+n[e])/2,t,r)-((o||i)[e]+(s||n)[e]);return c&&(a=o&&s?c>0==o[e]>s[e]?o:s:o||s,a[e]+=c),u}}function ef(e){var t=e[0],r=e[1],i=t===G[H-1][0],n=r===G[H-1][1];if(!(i&&n))if(H>1){var a=t===G[H-2][0],o=r===G[H-2][1];i&&(t===ea||t===eo)&&a?o?H--:G[H-1]=e:n&&(r===es||r===el)&&o?a?H--:G[H-1]=e:G[H++]=e}else G[H++]=e}function ep(e){G[H-1][0]!==e[0]&&G[H-1][1]!==e[1]&&ef([ee,et]),ef(e),er=null,ee=et=0}"linear"===B||"spline"===B?i=function(e,t){for(var r=[],i=0,n=0;n<4;n++){var a=eu[n],o=u(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!i||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],i&&Z(o,e)eo?eo:0,Q=t[1]el?el:0,J||Q){if(H)if(er){var r,n,o,s=i(er,t);s.length>1&&(ep(s[0]),G[H++]=s[1])}else ei=i(G[H-1],t)[0],G[H++]=ei;else G[H++]=[J||t[0],Q||t[1]];var l=G[H-1];J&&Q&&(l[0]!==J||l[1]!==Q)?(er&&(ee!==J&&et!==Q?ef(ee&&et?(r=er,n=t[0]-r[0],o=(t[1]-r[1])/n,(r[1]*t[0]-t[1]*r[0])/n>0?[o>0?ea:eo,el]:[o>0?eo:ea,es]):[ee||J,et||Q]):ee&&et&&ef([ee,et])),ef([J,Q])):ee-J&&et-Q&&ef([J||ee,Q||et]),er=t,ee=J,et=Q}else er&&ep(i(er,t)[0]),G[H++]=t}for(a=0;aY(g,ey))break;f=g,(T=x[0]*v[0]+x[1]*v[1])>_?(_=T,p=g,y=!1):T=e.length||!g)break;eg(g),d=g}}er&&ef([ee||er[0],et||er[1]]),V.push(G.slice(0,H))}var ev=B.slice(B.length-1);if(z&&"h"!==ev&&"v"!==ev){for(var ex=!1,eb=-1,e_=[],ew=0;ew=0?l=f:(l=f=d,d++),l=u[0]&&e.x<=u[1]&&e.y>=c[0]&&e.y<=c[1]}),p=Math.ceil(f.length/d),m=0;a.forEach(function(t,r){var i=t[0].trace;l.hasMarkers(i)&&i.marker.maxdisplayed>0&&r0;function x(e){return v?e.transition():e}var b=c.xaxis,_=c.yaxis,w=d[0].trace,T=w.line,A=r.select(p),M=a(A,"g","errorbars"),k=a(A,"g","lines"),S=a(A,"g","points"),E=a(A,"g","text");if(i.getComponentMethod("errorbars","plot")(e,M,c,m),!0===w.visible){x(A).style("opacity",w.opacity);var D,C,I=w.fill.charAt(w.fill.length-1);"x"!==I&&"y"!==I&&(I=""),"y"===I?(R=1,B=_.c2p(0,!0)):"x"===I&&(R=0,B=b.c2p(0,!0)),d[0][c.isRangePlot?"nodeRangePlot3":"node3"]=A;var L="",P=[],z=w._prevtrace,F=null,O=null;z&&(L=z._prevRevpath||"",C=z._nextFill,P=z._ownPolygons,F=z._fillsegments,O=z._fillElement);var R,B,j,N,V,U,q,G,H,$="",W="",Y=[];w._polygons=[];var Z=[],X=[],K=n.noop;if(D=w._ownFill,l.hasLines(w)||"none"!==w.fill){C&&C.datum(d),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(V=s.steps(T.shape),U=s.steps(T.shape.split("").reverse().join(""))):V=U="spline"===T.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),T.smoothing):s.smoothopen(e,T.smoothing)}:function(e){return"M"+e.join("L")},Z=Array((X=u(d,{xaxis:b,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:w.fill})).length);var J=0;for(g=0;g0,x=c(e,t,i);((m=n.selectAll("g.trace").data(x,function(e){return e[0].trace.uid})).enter().append("g").attr("class",function(e){return"trace scatter trace"+e[0].trace.uid}).style("stroke-miterlimit",2),m.order(),h=e,f=m,p=t,f.each(function(e){var t=a(r.select(this),"g","fills");s.setClipUrl(t,p.layerClipId,h);var i=e[0].trace;i._ownFill=null,i._nextFill=null;var n=[];i._ownfill&&n.push("_ownFill"),i._nexttrace&&n.push("_nextFill");var l=t.selectAll("g").data(n,o);l.enter().append("g"),l.exit().remove(),l.order().each(function(e){i[e]=a(r.select(this),"path","js-fill")})}),v)?(u&&(g=u()),r.transition().duration(l.duration).ease(l.easing).each("end",function(){g&&g()}).each("interrupt",function(){g&&g()}).each(function(){n.selectAll("g.trace").each(function(r,i){d(e,i,t,r,x,this,l)})})):m.each(function(r,i){d(e,i,t,r,x,this,l)}),y&&m.exit().remove(),n.selectAll("path:not([d])").remove()}}}),nr=m({"src/traces/scatter/marker_colorbar.js"(e,t){t.exports={container:"marker",min:"cmin",max:"cmax"}}}),ni=m({"src/traces/scatter/format_labels.js"(e,t){var r=ro();t.exports=function(e,t,i){var n={},a={_fullLayout:i},o=r.getFromTrace(a,t,"x"),s=r.getFromTrace(a,t,"y"),l=e.orig_x;void 0===l&&(l=e.x);var u=e.orig_y;return void 0===u&&(u=e.y),n.xLabel=r.tickText(o,o.c2l(l),!0).text,n.yLabel=r.tickText(s,s.c2l(u),!0).text,n}}}),nn=m({"src/traces/scatter/style.js"(e,t){var r=M(),i=rt(),n=e1();function a(e,t,r){i.pointStyle(e.selectAll("path.point"),t,r)}function o(e,t,r){i.textPointStyle(e.selectAll("text"),t,r)}t.exports={style:function(e){var t=r.select(e).selectAll("g.trace.scatter");t.style("opacity",function(e){return e[0].trace.opacity}),t.selectAll("g.points").each(function(t){a(r.select(this),t.trace||t[0].trace,e)}),t.selectAll("g.text").each(function(t){o(r.select(this),t.trace||t[0].trace,e)}),t.selectAll("g.trace path.js-line").call(i.lineGroupStyle),t.selectAll("g.trace path.js-fill").call(i.fillGroupStyle,e,!1),n.getComponentMethod("errorbars","style")(t)},stylePoints:a,styleText:o,styleOnSelect:function(e,t,r){var n=t[0].trace;n.selectedpoints?(i.selectedPointStyle(r.selectAll("path.point"),n),i.selectedTextStyle(r.selectAll("text"),n)):(a(r,n,e),o(r,n,e))}}}}),na=m({"src/traces/scatter/get_trace_color.js"(e,t){var r=er(),i=t6();t.exports=function(e,t){if("lines"===e.mode)return(n=e.line.color)&&r.opacity(n)?n:e.fillcolor;if("none"===e.mode)return e.fill?e.fillcolor:"";var n,a,o=t.mcc||t.mc||(e.marker||{}).color,s=t.mlcc||((e.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(t.mlw||((e.marker||{}).line||{}).width)?s:"")?.3>r.opacity(a)?r.addOpacity(a,.3):a:(n=(e.line||{}).color)&&r.opacity(n)&&i.hasLines(e)&&e.line.width?n:e.fillcolor}}}),no=m({"src/traces/scatter/hover.js"(e,t){var r=tb(),i=rO(),n=e1(),a=na(),o=er(),s=r.fillText;t.exports=function(e,t,l,u){var c=e.cd,h=c[0].trace,d=e.xa,f=e.ya,p=d.c2p(t),m=f.c2p(l),g=[p,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,b=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var _=function(e){var t=Math.max(v,e.mrc||0),r=d.c2p(e.x)-p,i=f.c2p(e.y)-m;return Math.max(Math.sqrt(r*r+i*i)-t,1-v/t)},w=i.getDistanceFunction(u,function(e){if(x){var t=d.c2p(e.xStart),r=d.c2p(e.xEnd);return p>=Math.min(t,r)&&p<=Math.max(t,r)?0:1/0}var i=Math.max(3,e.mrc||0),n=1-1/i,a=Math.abs(d.c2p(e.x)-p);return a=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var i=Math.max(3,e.mrc||0),n=1-1/i,a=Math.abs(f.c2p(e.y)-m);return au!=(s=r[t][1])>=u&&(n=r[t-1][0],a=r[t][0],s-o&&(h=Math.min(h,i=n+(a-n)*(u-o)/(s-o)),p=Math.max(p,i)));return{x0:h=Math.max(h,0),x1:p=Math.min(p,d._length),y0:u,y1:u}}(h._polygons);null===L&&(L={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var P=o.defaultLine;return o.opacity(h.fillcolor)?P=h.fillcolor:o.opacity((h.line||{}).color)&&(P=h.line.color),r.extendFlat(e,{distance:e.maxHoverDistance,x0:L.x0,x1:L.x1,y0:L.y0,y1:L.y1,color:P,hovertemplate:!1}),delete e.index,h.text&&!r.isArrayOrTypedArray(h.text)?e.text=String(h.text):e.text=h.name,[e]}}}}),ns=m({"src/traces/scatter/select.js"(e,t){var r=t6();t.exports=function(e,t){var i,n,a,o,s=e.cd,l=e.xaxis,u=e.yaxis,c=[],h=s[0].trace;if(h.mode&&!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===t)for(i=0;i0&&(n["_"+r+"axes"]||{})[t]||(n[r+"axis"]||r)===t&&(a(n,r)||(n[r]||[]).length||n[r+"0"]))return n}}(t,s,l);if(u){if("histogram"===u.type&&l===({v:"y",h:"x"})[u.orientation||"v"]){e.type="linear";return}var c=l+"calendar",h=u[c],d={noMultiCategory:!r(u,"cartesian")||r(u,"noMultiCategory")};if("box"===u.type&&u._hasPreCompStats&&l===({h:"x",v:"y"})[u.orientation||"v"]&&(d.noMultiCategory=!0),d.autotypenumbers=e.autotypenumbers,a(u,l)){var f=n(u),p=[];for(o=0;o0||r(o);s&&(a="array");var l,u=i("categoryorder",a);"array"===u&&(l=i("categoryarray")),s||"array"!==u||(u=t.categoryorder="trace"),"trace"===u?t._initialCategories=[]:"array"===u?t._initialCategories=l.slice():(l=(function(e,t){var r,i,n,a=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],i=0;i=2){var l,u,c="";if(2===o.length){for(l=0;l<2;l++)if(u=b(o[l])){c=g;break}}var h=a("pattern",c);if(h===g)for(l=0;l<2;l++)(u=b(o[l]))&&(t.bounds[l]=o[l]=u-1);if(h)for(l=0;l<2;l++)switch(u=o[l],h){case g:if(!r(u)||(u*=1)!==Math.floor(u)||u<0||u>=7){t.enabled=!1;return}t.bounds[l]=o[l]=u;break;case y:if(!r(u)||(u*=1)<0||u>24){t.enabled=!1;return}t.bounds[l]=o[l]=u}if(!1===i.autorange){var d=i.range;if(d[0]d[1]){t.enabled=!1;return}}else if(o[0]>d[0]&&o[1]b[1]-1/4096&&(t.domain=s),i.noneOrAll(e.domain,t.domain,s),"sync"===t.tickmode&&(t.tickmode="auto")}return n("layer"),t}}}),np=m({"src/plots/cartesian/layout_defaults.js"(e,t){var r=tb(),i=er(),n=t7().isUnifiedHover,a=rL(),o=tD(),s=eQ(),l=tU(),u=nu(),c=nd(),h=r9(),d=nf(),f=tI(),p=f.id2name,m=f.name2id,g=tC().AX_ID_PATTERN,y=e1(),v=y.traceIs,x=y.getComponentMethod;function b(e,t,r){Array.isArray(e[t])?e[t].push(r):e[t]=[r]}t.exports=function(e,t,y){var _,w,T=t.autotypenumbers,A={},M={},k={},S={},E={},D={},C={},I={},L={},P={};for(_=0;_ rect").call(a.setTranslate,0,0).call(a.setScale,1,1),e.plot.call(a.setTranslate,t._offset,r._offset).call(a.setScale,1,1);var i=e.plot.selectAll(".scatterlayer .trace");i.selectAll(".point").call(a.setPointGroupScale,1,1),i.selectAll(".textpoint").call(a.setTextPointsScale,1,1),i.call(a.hideOutsideRangePoints,e)}l&&(h=l());var h,d,f,p,m=r.ease(s.easing);return e._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(p),p=null,function(){for(var r={},n=0;ns.duration?(function(){for(var r={},n=0;n1,m=t.mainplotinfo;if(!t.mainplot||p)if(f)t.xlines=c(i,"path","xlines-above"),t.ylines=c(i,"path","ylines-above"),t.xaxislayer=c(i,"g","xaxislayer-above"),t.yaxislayer=c(i,"g","yaxislayer-above");else{if(!a){var g=c(i,"g","layer-subplot");t.shapelayer=c(g,"g","shapelayer"),t.imagelayer=c(g,"g","imagelayer"),m&&p?(t.minorGridlayer=m.minorGridlayer,t.gridlayer=m.gridlayer,t.zerolinelayer=m.zerolinelayer):(t.minorGridlayer=c(i,"g","minor-gridlayer"),t.gridlayer=c(i,"g","gridlayer"),t.zerolinelayer=c(i,"g","zerolinelayer"));var y=c(i,"g","layer-between");t.shapelayerBetween=c(y,"g","shapelayer"),t.imagelayerBetween=c(y,"g","imagelayer"),c(i,"path","xlines-below"),c(i,"path","ylines-below"),t.overlinesBelow=c(i,"g","overlines-below"),c(i,"g","xaxislayer-below"),c(i,"g","yaxislayer-below"),t.overaxesBelow=c(i,"g","overaxes-below")}t.overplot=c(i,"g","overplot"),t.plot=c(t.overplot,"g",n),m&&p?t.zerolinelayerAbove=m.zerolinelayerAbove:t.zerolinelayerAbove=c(i,"g","zerolinelayer-above"),a||(t.xlines=c(i,"path","xlines-above"),t.ylines=c(i,"path","ylines-above"),t.overlinesAbove=c(i,"g","overlines-above"),c(i,"g","xaxislayer-above"),c(i,"g","yaxislayer-above"),t.overaxesAbove=c(i,"g","overaxes-above"),t.xlines=i.select(".xlines-"+o),t.ylines=i.select(".ylines-"+u),t.xaxislayer=i.select(".xaxislayer-"+o),t.yaxislayer=i.select(".yaxislayer-"+u))}else{var v=m.plotgroup,x=n+"-x",b=n+"-y";t.minorGridlayer=m.minorGridlayer,t.gridlayer=m.gridlayer,t.zerolinelayer=m.zerolinelayer,t.zerolinelayerAbove=m.zerolinelayerAbove,c(m.overlinesBelow,"path",x),c(m.overlinesBelow,"path",b),c(m.overaxesBelow,"g",x),c(m.overaxesBelow,"g",b),t.plot=c(m.overplot,"g",n),c(m.overlinesAbove,"path",x),c(m.overlinesAbove,"path",b),c(m.overaxesAbove,"g",x),c(m.overaxesAbove,"g",b),t.xlines=v.select(".overlines-"+o).select("."+x),t.ylines=v.select(".overlines-"+u).select("."+b),t.xaxislayer=v.select(".overaxes-"+o).select("."+x),t.yaxislayer=v.select(".overaxes-"+u).select("."+b)}a||(f||(h(t.minorGridlayer,"g",t.xaxis._id),h(t.minorGridlayer,"g",t.yaxis._id),t.minorGridlayer.selectAll("g").map(function(e){return e[0]}).sort(s.idSort),h(t.gridlayer,"g",t.xaxis._id),h(t.gridlayer,"g",t.yaxis._id),t.gridlayer.selectAll("g").map(function(e){return e[0]}).sort(s.idSort)),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0))}function m(e,r){if(e){var i={};for(var n in e.each(function(e){var n=e[0];t.select(this).remove(),g(n,r),i[n]=!0}),r._plots)for(var a=r._plots[n],o=a.overlays||[],s=0;s0){var g=m.id;if(-1!==g.indexOf(d))continue;g+=d+(c+1),m=i.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x1&&(w+=d+_),b.push(i+w),r=0;r=0,x=t.indexOf("end")>=0,b=p.backoff*g+a.standoff,_=m.backoff*y+a.startstandoff;if("line"===f.nodeName){u={x:+e.attr("x1"),y:+e.attr("y1")},c={x:+e.attr("x2"),y:+e.attr("y2")};var w=u.x-c.x,T=u.y-c.y;if(d=(h=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void F();if(b){if(b*b>w*w+T*T)return void F();var A=b*Math.cos(h),M=b*Math.sin(h);c.x+=A,c.y+=M,e.attr({x2:c.x,y2:c.y})}if(_){if(_*_>w*w+T*T)return void F();var k=_*Math.cos(h),S=_*Math.sin(h);u.x-=k,u.y-=S,e.attr({x1:u.x,y1:u.y})}}else if("path"===f.nodeName){var E=f.getTotalLength(),D="";if(E2/3?"right":"center"),({center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5})[t]}for(var Y=!1,Z=["x","y"],X=0;X1)&&(en===ei?((ep=ea.r2fraction(t["a"+er]))<0||ep>1)&&(Y=!0):Y=!0),K=ea._offset+ea.r2p(t[er]),ee=.5}else{var em="domain"===ef;"x"===er?(Q=t[er],K=em?ea._offset+ea._length*Q:K=T.l+T.w*Q):(Q=1-t[er],K=em?ea._offset+ea._length*Q:K=T.t+T.h*Q),ee=t.showarrow?.5:Q}if(t.showarrow){ed.head=K;var eg=t["a"+er];if(et=es*W(.5,t.xanchor)-el*W(.5,t.yanchor),en===ei){var ey=s.getRefType(en);"domain"===ey?("y"===er&&(eg=1-eg),ed.tail=ea._offset+ea._length*eg):"paper"===ey?"y"===er?(eg=1-eg,ed.tail=T.t+T.h*eg):ed.tail=T.l+T.w*eg:ed.tail=ea._offset+ea.r2p(eg),J=et}else ed.tail=K+eg,J=et+eg;ed.text=ed.tail+et;var ev=w["x"===er?"width":"height"];if("paper"===ei&&(ed.head=a.constrain(ed.head,1,ev-1)),"pixel"===en){var ex=-Math.max(ed.tail-3,ed.text),eb=Math.min(ed.tail+3,ed.text)-ev;ex>0?(ed.tail+=ex,ed.text+=ex):eb>0&&(ed.tail-=eb,ed.text-=eb)}ed.tail+=eh,ed.head+=eh}else J=et=eu*W(ee,ec),ed.text=K+et;ed.text+=eh,et+=eh,J+=eh,t["_"+er+"padplus"]=eu/2+J,t["_"+er+"padminus"]=eu/2-J,t["_"+er+"size"]=eu,t["_"+er+"shift"]=et}if(Y)return void R.remove();var e_=0,ew=0;if("left"!==t.align&&(e_=(F-_)*("center"===t.align?.5:1)),"top"!==t.valign&&(ew=(q-M)*("middle"===t.valign?.5:1)),p)c.select("svg").attr({x:j+e_-1,y:j+ew}).call(u.setClipUrl,V?D:null,e);else{var eT=j+ew-b.top,eA=j+e_-b.left;H.call(h.positionText,eA,eT).call(u.setClipUrl,V?D:null,e)}U.select("rect").call(u.setRect,j,j,F,q),N.call(u.setRect,B/2,B/2,G-B,$-B),R.call(u.setTranslate,Math.round(C.x.text-G/2),Math.round(C.y.text-$/2)),P.attr({transform:"rotate("+I+","+C.x.text+","+C.y.text+")"});var eM=function(r,n){L.selectAll(".annotation-arrow-g").remove();var s=C.x.head,c=C.y.head,h=C.x.tail+r,d=C.y.tail+n,p=C.x.text+r,b=C.y.text+n,_=a.rotationXYMatrix(I,p,b),w=a.apply2DTransform(_),M=a.apply2DTransform2(_),D=+N.attr("width"),z=+N.attr("height"),F=p-.5*D,O=F+D,B=b-.5*z,j=B+z,V=[[F,B,F,j],[F,j,O,j],[O,j,O,B],[O,B,F,B]].map(M);if(!V.reduce(function(e,t){return e^!!a.segmentsIntersect(s,c,s+1e6,c+1e6,t[0],t[1],t[2],t[3])},!1)){V.forEach(function(e){var t=a.segmentsIntersect(h,d,s,c,e[0],e[1],e[2],e[3]);t&&(h=t.x,d=t.y)});var U=t.arrowwidth,q=t.arrowcolor,G=t.arrowside,H=L.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),$=H.append("path").attr("d","M"+h+","+d+"L"+s+","+c).style("stroke-width",U+"px").call(l.stroke,l.rgb(q));if(m($,G,t),A.annotationPosition&&$.node().parentNode&&!g){var W=s,Y=c;if(t.standoff){var Z=Math.sqrt(Math.pow(s-h,2)+Math.pow(c-d,2));W+=t.standoff*(h-s)/Z,Y+=t.standoff*(d-c)/Z}var X,K,J=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-Y),transform:o(W,Y)}).style("stroke-width",U+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");f.init({element:J.node(),gd:e,prepFn:function(){var e=u.getTranslate(R);X=e.x,K=e.y,v&&v.autorange&&k(v._name+".autorange",!0),x&&x.autorange&&k(x._name+".autorange",!0)},moveFn:function(e,r){var i=w(X,K),n=i[0]+e,a=i[1]+r;R.call(u.setTranslate,n,a),S("x",y(v,e,"x",T,t)),S("y",y(x,r,"y",T,t)),t.axref===t.xref&&S("ax",y(v,e,"ax",T,t)),t.ayref===t.yref&&S("ay",y(x,r,"ay",T,t)),H.attr("transform",o(e,r)),P.attr({transform:"rotate("+I+","+n+","+a+")"})},doneFn:function(){i.call("_guiRelayout",e,E());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};t.showarrow&&eM(0,0),z&&f.init({element:R.node(),gd:e,prepFn:function(){r=P.attr("transform")},moveFn:function(e,i){var n="pointer";if(t.showarrow)t.axref===t.xref?S("ax",y(v,e,"ax",T,t)):S("ax",t.ax+e),t.ayref===t.yref?S("ay",y(x,i,"ay",T.w,t)):S("ay",t.ay+i),eM(e,i);else{if(g)return;if(v)a=y(v,e,"x",T,t);else{var a,s,l=t._xsize/T.w,u=t.x+(t._xshift-t.xshift)/T.w-l/2;a=f.align(u+e/T.w,l,0,1,t.xanchor)}if(x)s=y(x,i,"y",T,t);else{var c=t._ysize/T.h,h=t.y-(t._yshift+t.yshift)/T.h-c/2;s=f.align(h-i/T.h,c,0,1,t.yanchor)}S("x",a),S("y",s),v&&x||(n=f.getCursor(v?.5:a,x?.5:s,t.xanchor,t.yanchor))}P.attr({transform:o(e,i)+r}),d(R,n)},clickFn:function(r,i){t.captureevents&&e.emit("plotly_clickannotation",O(i))},doneFn:function(){d(R),i.call("_guiRelayout",e,E());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}A.annotationText?H.call(h.makeEditable,{delegate:R,gd:e}).call($).on("edit",function(r){t.text=r,this.call($),S("text",r),v&&v.autorange&&k(v._name+".autorange",!0),x&&x.autorange&&k(x._name+".autorange",!0),i.call("_guiRelayout",e,E())}):H.call($)}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var o,s,l=a(e,t),u=l.on,c=l.off.concat(l.explicitOff),h={},d=e._fullLayout.annotations;if(u.length||c.length){for(o=0;o1){u=!0;break}}u?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+s+'"]').remove():(l._pdata=i(e.glplot.cameraParams,[t.xaxis.r2l(l.x)*a[0],t.yaxis.r2l(l.y)*a[1],t.zaxis.r2l(l.z)*a[2]]),r(e.graphDiv,l,s,e.id,l._xa,l._ya))}}}}),nI=m({"src/components/annotations3d/index.js"(e,t){var r=e1(),i=tb();t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:nk()}}},layoutAttributes:nk(),handleDefaults:nS(),includeBasePlot:function(e,t){var n=r.subplotsRegistry.gl3d;if(n)for(var a=n.attrRegex,o=Object.keys(e),s=0;s{var l,g,y,v,x=a+"anchor",b="x"===a?d:f,_={_fullLayout:n};let w=e[a+"ref"];if(Array.isArray(w)&&w.length>0){let r=o.countDefiningCoords(c,u,a);v=i.coerceRefArray(e,t,_,a,void 0,"paper",r),t["_"+a+"refArray"]=!0}else v=i.coerceRef(e,t,_,a,void 0,"paper");if(Array.isArray(v))v.forEach(function(e){"range"===i.getRefType(e)&&(l=i.getFromId(_,e))&&-1===l._shapeIndices.indexOf(t._index)&&l._shapeIndices.push(t._index)}),h&&[0,1].forEach(function(n){let u=v[n];"range"===i.getRefType(u)?(l=i.getFromId(_,u),g=o.shapePositionToRange(l),y=o.rangeToShapePosition(l),("category"===l.type||"multicategory"===l.type)&&s(a+n+"shift")):g=y=r.identity;let c=a+n,h=e[c];if(e[c]=g(e[c],!0),"pixel"===b?s(c,m[n]):i.coercePosition(t,_,s,u,c,p[n]),t[c]=y(t[c]),e[c]=h,0===n&&"pixel"===b){let r=e[x];e[x]=g(e[x],!0),i.coercePosition(t,_,s,u,x,.25),t[x]=y(t[x]),e[x]=r}});else{if("range"===i.getRefType(v)?((l=i.getFromId(_,v))._shapeIndices.push(t._index),y=o.rangeToShapePosition(l),g=o.shapePositionToRange(l),h&&("category"===l.type||"multicategory"===l.type)&&(s(a+"0shift"),s(a+"1shift"))):g=y=r.identity,h){let r=a+"0",n=a+"1",o=e[r],l=e[n];e[r]=g(e[r],!0),e[n]=g(e[n],!0),"pixel"===b?(s(r,m[0]),s(n,m[1])):(i.coercePosition(t,_,s,v,r,p[0]),i.coercePosition(t,_,s,v,n,p[1])),t[r]=y(t[r]),t[n]=y(t[n]),e[r]=o,e[n]=l}if("pixel"===b){let r=e[x];e[x]=g(e[x],!0),i.coercePosition(t,_,s,v,x,.25),t[x]=y(t[x]),e[x]=r}}}),h&&r.noneOrAll(e,t,["x0","x1","y0","y1"]);var g,y,v="line"===c;if(h&&(g=s("label.texttemplate"),s("label.texttemplatefallback")),g||(y=s("label.text")),y||g){s("label.textangle");var x=s("label.textposition",v?"middle":"middle center");s("label.xanchor"),s("label.yanchor",v?"bottom":-1!==x.indexOf("top")?"top":-1!==x.indexOf("bottom")?"bottom":"middle"),s("label.padding"),r.coerceFont(s,"label.font",n.font)}}t.exports=function(e,t){n(e,t,{name:"shapes",handleItemDefaults:s})}}}),nz=m({"src/components/shapes/draw_newshape/defaults.js"(e,t){var r=er(),i=tb();t.exports=function(e,t,n){if(n("newshape.visible"),n("newshape.name"),n("newshape.showlegend"),n("newshape.legend"),n("newshape.legendwidth"),n("newshape.legendgroup"),n("newshape.legendgrouptitle.text"),i.coerceFont(n,"newshape.legendgrouptitle.font"),n("newshape.legendrank"),n("newshape.drawdirection"),n("newshape.layer"),n("newshape.fillcolor"),n("newshape.fillrule"),n("newshape.opacity"),n("newshape.line.width")){var a=(e||{}).plot_bgcolor||"#FFF";n("newshape.line.color",r.contrast(a)),n("newshape.line.dash")}var o="drawline"===e.dragmode,s=n("newshape.label.text"),l=n("newshape.label.texttemplate");if(n("newshape.label.texttemplatefallback"),s||l){n("newshape.label.textangle");var u=n("newshape.label.textposition",o?"middle":"middle center");n("newshape.label.xanchor"),n("newshape.label.yanchor",o?"bottom":-1!==u.indexOf("top")?"top":-1!==u.indexOf("bottom")?"bottom":"middle"),n("newshape.label.padding"),i.coerceFont(n,"newshape.label.font",t.font)}n("activeshape.fillcolor"),n("activeshape.opacity")}}}),nF=m({"src/components/shapes/calc_autorange.js"(e,t){var r=tb(),i=ro(),n=rH(),a=r$();function o(e,t,r){let o=t[r+"ref"],s="x"===r?n.paramIsX:n.paramIsY;function l(e,t){"paper"===e||"domain"===i.getRefType(e)||(u[e]||(u[e]=[]),u[e].push(t))}let u={};if("path"===t.type&&t.path){let e=t.path.match(n.segmentRE)||[];for(var c=0,h=0;hr&&(l(o[c],i[r]),c++)}}else l(o[0],t[r+"0"]),l(o[1],t[r+"1"]);let d={};for(let t in u){let r=i.getFromId(e,t);if(r){var f="category"===r.type||"multicategory"===r.type?r.r2c:r.d2c;"date"===r.type&&(f=a.decodeDate(f)),d[r._id]=u[t].map(f)}}return d}function s(e){return u(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function l(e){return u(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function u(e,t,i,o,s,l){var u=e/2;if("pixel"!==t)return{ppad:u};var c=s?a.extractPathCoords(s,l?n.paramIsY:n.paramIsX):[i,o],h=r.aggNums(Math.max,null,c),d=r.aggNums(Math.min,null,c),f=d<0?Math.abs(d)+u:u,p=h>0?h+u:u;return{ppad:u,ppadplus:l?f:p,ppadminus:l?p:f}}function c(e,t,r){var i,o,s="x"===e._id.charAt(0)?"x":"y",l="category"===e.type||"multicategory"===e.type,u=0,c=0,h=l?e.r2c:e.d2c;if("scaled"===t[s+"sizemode"]?(i=t[s+"0"],o=t[s+"1"],l&&(u=t[s+"0shift"],c=t[s+"1shift"])):(i=t[s+"anchor"],o=t[s+"anchor"]),void 0!==i)return[h(i)+u,h(o)+c];if(t.path){var d,f,p,m,g=1/0,y=-1/0,v=t.path.match(n.segmentRE);for("date"===e.type&&(h=a.decodeDate(h)),d=0;dy&&(y=m));if(y>=g)return[g,y]}}t.exports=function(e){var t=e._fullLayout,a=r.filterVisible(t.shapes);if(!(!a.length||!e._fullData.length))for(var u=0;u{d=i.getFromId(e,t),h._extremes[d._id]=i.findExtremes(d,r,s(h))}):"paper"!==h.xref&&"domain"!==p&&(f=c(d=i.getFromId(e,h.xref),h,n.paramIsX))&&(h._extremes[d._id]=i.findExtremes(d,f,s(h))),"array"===m?Object.entries(o(e,h,"y")).forEach(([t,r])=>{d=i.getFromId(e,t),h._extremes[d._id]=i.findExtremes(d,r,l(h))}):"paper"!==h.yref&&"domain"!==m&&(f=c(d=i.getFromId(e,h.yref),h,n.paramIsY))&&(h._extremes[d._id]=i.findExtremes(d,f,l(h)))}}}}),nO=m({"src/components/shapes/index.js"(e,t){var r=rZ();t.exports={moduleType:"component",name:"shapes",layoutAttributes:nL(),supplyLayoutDefaults:nP(),supplyDrawNewShapeDefaults:nz(),includeBasePlot:iM()("shapes"),calcAutorange:nF(),draw:r.draw,drawOne:r.drawOne}}}),nR=m({"src/components/images/attributes.js"(e,t){var r=tC(),i=tD().templatedArray;iy(),t.exports=i("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",r.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",r.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),nB=m({"src/components/images/defaults.js"(e,t){var r=tb(),i=ro(),n=tK(),a=nR();function o(e,t,n){function o(i,n){return r.coerce(e,t,a,i,n)}var s=o("source");if(!o("visible",!!s))return t;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var l={_fullLayout:n},u=["x","y"],c=0;c<2;c++){var h=u[c],d=i.coerceRef(e,t,l,h,"paper",void 0);"paper"!==d&&i.getFromId(l,d)._imgIndices.push(t._index),i.coercePosition(t,l,o,d,h,0)}return t}t.exports=function(e,t){n(e,t,{name:"images",handleItemDefaults:o})}}}),nj=m({"src/components/images/draw.js"(e,t){var r=M(),i=rt(),n=ro(),a=tI(),o=tR();t.exports=function(e){var t,s,l=e._fullLayout,u=[],c={},h=[];for(s=0;s0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(e,t){function i(i,n){return r.coerce(e,t,o,i,n)}i("visible","skip"===e.method||Array.isArray(e.args))&&(i("method"),i("args"),i("args2"),i("label"),i("execute"))}t.exports=function(e,t){i(e,t,{name:a,handleItemDefaults:s})}}}),nH=m({"src/components/updatemenus/scrollbox.js"(e,t){t.exports=o;var r=M(),i=er(),n=rt(),a=tb();function o(e,t,r){this.gd=e,this.container=t,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor="#808BA4",o.prototype.enable=function(e,t,a){var s=this.gd._fullLayout,l=s.width,u=s.height;this.position=e;var c,h,d,f,p=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,b="left"===v,_="up"===v,w=m,T=y;x||b||"right"===v||_||(this.position.direction="down",x=!0),x||_?(h=(c=p)+w,x?T=(f=Math.min((d=g)+T,u))-d:(d=Math.max((f=g+T)-T,0),T=f-d)):(f=(d=g)+T,b?(c=Math.max((h=p+w)-w,0),w=h-c):w=(h=Math.min((c=p)+w,l))-c),this._box={l:c,t:d,w:w,h:T};var A=m>w,M=o.barLength+2*o.barPad,k=o.barWidth+2*o.barPad,S=g+y;S+k>u&&(S=u-k);var E=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,o.barColor),A?(this.hbar=E.attr({rx:o.barRadius,ry:o.barRadius,x:p,y:S,width:M,height:k}),this._hbarXMin=p+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var D=y>T,C=o.barWidth+2*o.barPad,I=o.barLength+2*o.barPad,L=p+m;L+C>l&&(L=l-C);var P=this.container.selectAll("rect.scrollbar-vertical").data(D?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,o.barColor),D?(this.vbar=P.attr({rx:o.barRadius,ry:o.barRadius,x:L,y:g,width:C,height:I}),this._vbarYMin=g+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,F=c-.5,O=D?h+C+.5:h+.5,R=d-.5,B=A?f+k+.5:f+.5,j=s._topdefs.selectAll("#"+z).data(A||D?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",z).append("rect"),A||D?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(R),width:Math.ceil(O)-Math.floor(F),height:Math.ceil(B)-Math.floor(R)}),this.container.call(n.setClipUrl,z,this.gd),this.bg.attr({x:p,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(n.setClipUrl,null),delete this._clipRect),A||D){var N=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(N);var V=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(V),D&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(n.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},o.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=r.event.dx),this.vbar&&(t-=r.event.dy),this.setTranslate(e,t)},o.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=r.event.deltaY),this.vbar&&(t+=r.event.deltaY),this.setTranslate(e,t)},o.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var i=e+this._hbarXMin,n=i+this._hbarTranslateMax;e=(a.constrain(r.event.x,i,n)-i)/(n-i)*(this.position.w-this._box.w)}if(this.vbar){var o=t+this._vbarYMin,s=o+this._vbarTranslateMax;t=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(e,t)},o.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,i=this.position.h-this._box.h;if(e=a.constrain(e||0,0,r),t=a.constrain(t||0,0,i),this.translateX=e,this.translateY=t,this.container.call(n.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var o=e/r;this.hbar.call(n.setTranslate,e+o*this._hbarTranslateMax,t)}if(this.vbar){var s=t/i;this.vbar.call(n.setTranslate,e,t+s*this._vbarTranslateMax)}}}}),n$=m({"src/components/updatemenus/draw.js"(e,t){var r=M(),i=tO(),n=er(),a=rt(),o=tb(),s=tj(),l=tD().arrayEditor,u=tB().LINE_SPACING,c=nU(),h=nH();function d(e){return e._index}function f(e,t){return+e.attr(c.menuIndexAttrName)===t._index}function p(e,t,r,i,n,a,o,s){t.active=o,l(e.layout,c.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,i,null,null,t):"dropdown"===t.type&&(n.attr(c.menuIndexAttrName,"-1"),m(e,i,n,a,t),s||g(e,i,n,a,t))}function m(e,t,r,i,n){var s=o.ensureSingle(t,"g",c.headerClassName,function(e){e.style("pointer-events","all")}),l=n._dims,u=n.active,h=n.buttons[u]||c.blankHeaderOpts,d={y:n.pad.t,yPad:0,x:n.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};s.call(y,n,h,e).call(A,n,d,p),o.ensureSingle(t,"text",c.headerArrowClassName,function(e){e.attr("text-anchor","end").call(a.font,n.font).text(c.arrowSymbol[n.direction])}).attr({x:l.headerWidth-c.arrowOffsetX+n.pad.l,y:l.headerHeight/2+c.textOffsetY+n.pad.t}),s.on("click",function(){r.call(k,String(f(r,n)?-1:n._index)),g(e,t,r,i,n)}),s.on("mouseover",function(){s.call(_)}),s.on("mouseout",function(){s.call(w,n)}),a.setTranslate(t,l.lx,l.ly)}function g(e,t,n,a,s){n||(n=t).attr("pointer-events","all");var l,u,h,d=-1==+n.attr(c.menuIndexAttrName)&&"buttons"!==s.type?[]:s.buttons,f="dropdown"===s.type?c.dropdownButtonClassName:c.buttonClassName,m=n.selectAll("g."+f).data(o.filterVisible(d)),g=m.enter().append("g").classed(f,!0),v=m.exit();"dropdown"===s.type?(g.attr("opacity","0").transition().attr("opacity","1"),v.transition().attr("opacity","0").remove()):v.remove();var x=0,T=0,M=s._dims,k=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(k?T=M.headerHeight+c.gapButtonHeader:x=M.headerWidth+c.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(T=-c.gapButtonHeader+c.gapButton-M.openHeight),"dropdown"===s.type&&"left"===s.direction&&(x=-c.gapButtonHeader+c.gapButton-M.openWidth);var S={x:M.lx+x+s.pad.l,y:M.ly+T+s.pad.t,yPad:c.gapButton,xPad:c.gapButton,index:0},E={l:S.x+s.borderwidth,t:S.y+s.borderwidth};m.each(function(o,l){var u=r.select(this);u.call(y,s,o,e).call(A,s,S),u.on("click",function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(p(e,s,o,t,n,a,-1),i.executeAPICommand(e,o.method,o.args2)):(p(e,s,o,t,n,a,l),i.executeAPICommand(e,o.method,o.args))),e.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))}),u.on("mouseover",function(){u.call(_)}),u.on("mouseout",function(){u.call(w,s),m.call(b,s)})}),m.call(b,s),k?(E.w=Math.max(M.openWidth,M.headerWidth),E.h=S.y-E.t):(E.w=S.x-E.l,E.h=Math.max(M.openHeight,M.headerHeight)),E.direction=s.direction,a&&(m.size()?function(e,t,r){var i,n,a,o=t.direction,s=t._dims,l=t.active;if("up"===o||"down"===o)for(n=0,a=0;a0?[0]:[]);if(v.enter().append("g").classed(c.containerClassName,!0).style("cursor","pointer"),v.exit().each(function(){r.select(this).selectAll("g."+c.headerGroupClassName).each(l)}).remove(),0!==n.length){var x=v.selectAll("g."+c.headerGroupClassName).data(n,d);x.enter().append("g").classed(c.headerGroupClassName,!0);for(var b=o.ensureSingle(v,"g",c.dropdownButtonGroupClassName,function(e){e.style("pointer-events","all")}),_=0;_0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*c.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,t))}function E(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function D(e,t,r){var i=r._dims,s=o.ensureSingle(e,"rect",c.railTouchRectClass,function(i){i.call(T,t,e,r).style("pointer-events","all")});s.attr({width:i.inputAreaLength,height:Math.max(i.inputAreaWidth,c.tickOffset+r.ticklen+i.labelHeight)}).call(n.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,i.currentValueTotalHeight)}function C(e,t){var r=t._dims,i=r.inputAreaLength-2*c.railInset,s=o.ensureSingle(e,"rect",c.railRectClass);s.attr({width:i,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(n.stroke,t.bordercolor).call(n.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),a.setTranslate(s,c.railInset,(r.inputAreaWidth-c.railWidth)*.5+r.currentValueTotalHeight)}t.exports=function(e){var t=e._context.staticPlot,n=e._fullLayout,s=function(e,t){for(var r=e[c.name],i=[],n=0;n0?[0]:[]);function h(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),i.autoMargin(e,m(t))}if(u.enter().append("g").classed(c.containerClassName,!0).style("cursor",t?null:"ew-resize"),u.exit().each(function(){r.select(this).selectAll("g."+c.groupClassName).each(h)}).remove(),0!==s.length){var d=u.selectAll("g."+c.groupClassName).data(s,g);d.enter().append("g").classed(c.groupClassName,!0),d.exit().each(h).remove();for(var _=0;_0?e.touches[0].clientX:0}function g(e,t,r,i){var n=a.ensureSingle(e,"rect",p.bgClassName,function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),u=i.borderwidth%2==0?i.borderwidth:i.borderwidth-1,c=-i._offsetShift,h=s.crispRound(t,i.borderwidth);n.attr({width:i._width+u,height:i._height+u,transform:o(c,c),"stroke-width":h}).call(l.stroke,i.bordercolor).call(l.fill,i.bgcolor)}function y(e,t,r,i){var n=t._fullLayout;a.ensureSingleById(n._topdefs,"clipPath",i._clipId,function(e){e.append("rect").attr({x:0,y:0})}).select("rect").attr({width:i._width,height:i._height})}function v(e,t,i,o){var l,u=t.calcdata,d=e.selectAll("g."+p.rangePlotClassName).data(i._subplotsWith,a.identity);d.enter().append("g").attr("class",function(e){return p.rangePlotClassName+" "+e}).call(s.setClipUrl,o._clipId,t),d.order(),d.exit().remove(),d.each(function(e,a){var s=r.select(this),d=h.getFromId(t,e,"y"),f=d._name,p=o[f],m={data:[],layout:{xaxis:{type:i.type,domain:[0,1],range:o.range.slice(),calendar:i.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:t._context};i.rangebreaks&&(m.layout.xaxis.rangebreaks=i.rangebreaks),m.layout[f]={type:d.type,domain:[0,1],range:"match"!==p.rangemode?p.range.slice():d.range.slice(),calendar:d.calendar},d.rangebreaks&&(m.layout[f].rangebreaks=d.rangebreaks),n.supplyDefaults(m);var g=m._fullLayout.xaxis,y=m._fullLayout[f];g.clearCalc(),g.setScale(),y.clearCalc(),y.setScale();var v={id:e,plotgroup:s,xaxis:g,yaxis:y,isRangePlot:!0};0===a?l=v:(v.mainplot="xy",v.mainplotinfo=l),c.rangePlot(t,v,function(e,t){for(var r=[],i=0;i=i.max)t=B[r+1];else if(e=i.pmax)t=B[r+1];else if(en._length||v+_<0)return;c=y+_,d=v+_;break;case l:if(b="col-resize",y+_>n._length)return;c=y+_,d=v;break;case u:if(b="col-resize",v+_<0)return;c=y,d=v+_;break;default:b="ew-resize",c=g,d=g+_}if(d0)){var m=function(e,t,r){for(var i=r.filter(function(r){return t[r].anchor===e._id}),n=0,a=0;a1))return void delete t.grid;d||f||p||"independent"===A("pattern")&&(d=!0),g._hasSubplotGrid=d;var x,b,_=A("roworder"),w=d?.2:.1,T=d?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),g._domains={x:u("x",A,w,x,v),y:u("y",A,T,b,y,"top to bottom"===_)}}function A(e,t){return r.coerce(i,g,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(!(!r||!r._domains)){var i,n,a,o,s,u,h,d=e.grid||{},f=t._subplots,p=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(p){var x=d.subplots||[];u=r.subplots=Array(m);var b=1;for(i=0;i0,h=e._context.staticPlot;t.each(function(t){var d,f=t[0].trace,p=f.error_x||{},m=f.error_y||{};f.ids&&(d=function(e){return e.id});var g=a.hasMarkers(f)&&f.marker.maxdisplayed>0;m.visible||p.visible||(t=[]);var y=r.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);c&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),n.setClipUrl(y,o.layerClipId,e),y.each(function(e){var t=r.select(this),n=(a=e,o=l,d=u,f={x:o.c2p(a.x),y:d.c2p(a.y)},void 0!==a.yh&&(f.yh=d.c2p(a.yh),f.ys=d.c2p(a.ys),i(f.ys)||(f.noYS=!0,f.ys=d.c2p(a.ys,!0))),void 0!==a.xh&&(f.xh=o.c2p(a.xh),f.xs=o.c2p(a.xs),i(f.xs)||(f.noXS=!0,f.xs=o.c2p(a.xs,!0))),f);if(!(g&&!e.vis)){var a,o,d,f,y,v=t.select("path.yerror");if(m.visible&&i(n.x)&&i(n.yh)&&i(n.ys)){var x=m.width;y="M"+(n.x-x)+","+n.yh+"h"+2*x+"m-"+x+",0V"+n.ys,n.noYS||(y+="m-"+x+",0h"+2*x),v.size()?c&&(v=v.transition().duration(s.duration).ease(s.easing)):v=t.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),v.attr("d",y)}else v.remove();var b=t.select("path.xerror");if(p.visible&&i(n.y)&&i(n.xh)&&i(n.xs)){var _=(p.copy_ystyle?m:p).width;y="M"+n.xh+","+(n.y-_)+"v"+2*_+"m0,-"+_+"H"+n.xs,n.noXS||(y+="m0,-"+_+"v"+2*_),b.size()?c&&(b=b.transition().duration(s.duration).ease(s.easing)):b=t.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),b.attr("d",y)}else b.remove()}})}})}}}),ac=m({"src/components/errorbars/style.js"(e,t){var r=M(),i=er();t.exports=function(e){e.each(function(e){var t=e[0].trace,n=t.error_y||{},a=t.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(i.stroke,n.color),a.copy_ystyle&&(a=n),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}}}),ah=m({"src/components/errorbars/index.js"(e,t){var r=tb(),i=eH().overrideAll,n=aa(),a={error_x:r.extendFlat({},n),error_y:r.extendFlat({},n)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},n),error_y:r.extendFlat({},n),error_z:r.extendFlat({},n)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,t.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:i(o,"calc","nested"),scattergl:i(a,"calc","nested")}},supplyDefaults:ao(),calc:al(),makeComputeError:as(),plot:au(),style:ac(),hoverInfo:function(e,t,r){(t.error_y||{}).visible&&(r.yerr=e.yh-e.y,t.error_y.symmetric||(r.yerrneg=e.y-e.ys)),(t.error_x||{}).visible&&(r.xerr=e.xh-e.x,t.error_x.symmetric||(r.xerrneg=e.x-e.xs))}}}}),ad=m({"src/components/colorbar/constants.js"(e,t){t.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),af=m({"src/components/colorbar/draw.js"(e,t){var r=M(),i=tO(),n=e1(),a=ro(),o=rp(),s=tb(),l=s.strTranslate,u=H().extendFlat,c=rm(),h=rt(),d=er(),f=rr(),p=tj(),m=tN().flipScale,g=nd(),y=nf(),v=tU(),x=tB(),b=x.LINE_SPACING,_=x.FROM_TL,w=x.FROM_BR,T=ad().cn,A=(e,t)=>[Math.min(e[0]+t,e[1]),e[1]],k=(e,t)=>[e[0],Math.max(e[1]-t,e[0])];t.exports={draw:function(e){var t=e._fullLayout._infolayer.selectAll("g."+T.colorbar).data(function(e){var t,r,i,n,a=e._fullLayout,o=e.calcdata,s=[];function l(e){return u(e,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof n.calc?n.calc(e,i,t):(t._fillgradient=r.reversescale?m(r.colorscale):r.colorscale,t._zrange=[r[n.min],r[n.max]])}for(var h=0;h0?r>=s:r<=s));i++)r>u&&r0?r>=s:r<=s));i++)r>t[0]&&r1){var ep=Math.pow(10,Math.floor(Math.log(ef)/Math.LN10));eh*=ep*s.roundUp(ef/ep,[2,5,10]),(Math.abs(W.start)/W.size+1e-6)%1<2e-6&&(eu.tick0=0)}eu.dtick=eh}var em=o?P/j.h:L/j.w;eu.domain=k(A([es,es+ee],em),em),eu.setScale(),e.attr("transform",l(Math.round(j.l),Math.round(j.t)));var eg,ey=e.select("."+T.cbtitleunshift).attr("transform",l(-Math.round(j.l),-Math.round(j.t))),ev=eu.ticklabelposition,ex=eu.title.font.size,eb=e.select("."+T.cbaxis),e_=0,ew=0;function eT(r,i){var a={propContainer:eu,propName:t._propPrefix+"title.text",traceIndex:t._traceIndex,_meta:t._meta,placeholder:B._dfltTitle.colorbar,containerGroup:e.select("."+T.cbtitle)},o="h"===r.charAt(0)?r.slice(1):"h"+r;e.selectAll("."+o+",."+o+"-math-group").remove(),f.draw(n,r,u(a,i||{}))}return s.syncOrAsync([i.previousPromises,function(){if(o&&ec||!o&&!ec){var e,t;"top"===q&&(e=L+j.l+et*z,t=P+j.t+er*(1-es-ee)+3+.75*ex),"bottom"===q&&(e=L+j.l+et*z,t=P+j.t+er*(1-es)-3-.25*ex),"right"===q&&(t=P+j.t+er*F+3+.75*ex,e=L+j.l+et*es),eT(eu._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}})}},function(){if(!o&&!ec||o&&ec){var i,u=e.select("."+T.cbtitle),c=u.select("text"),f=[-S/2,S/2],m=u.select(".h"+eu._id+"title-math-group").node(),g=15.6;if(c.node()&&(g=parseInt(c.node().style.fontSize,10)*b),m?(ew=(i=h.bBox(m)).width,(e_=i.height)>g&&(f[1]-=(e_-g)/2)):c.node()&&!c.classed(T.jsPlaceholder)&&(ew=(i=h.bBox(c.node())).width,e_=i.height),o){if(e_){if(e_+=5,"top"===q)eu.domain=k(eu.domain,e_/j.h),f[1]*=-1;else{eu.domain=A(eu.domain,e_/j.h);var y=p.lineCount(c);f[1]+=(1-y)*g}u.attr("transform",l(f[0],f[1])),eu.setScale()}}else ew&&("right"===q&&(eu.domain=A(eu.domain,(ew+ex/2)/j.w)),u.attr("transform",l(f[0],f[1])),eu.setScale())}e.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",o?l(0,Math.round(j.h*(1-eu.domain[1]))):l(Math.round(j.w*eu.domain[0]),0)),eb.attr("transform",o?l(0,Math.round(-j.t)):l(Math.round(-j.l),0));var v=e.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(Z);v.enter().append("rect").classed(T.cbfill,!0).attr("style",""),v.exit().remove();var x=G.map(eu.c2p).map(Math.round).sort(function(e,t){return e-t});v.each(function(e,i){var a=[0===i?G[0]:(Z[i]+Z[i-1])/2,i===Z.length-1?G[1]:(Z[i]+Z[i+1])/2].map(eu.c2p).map(Math.round);o&&(a[1]=s.constrain(a[1]+(a[1]>a[0])?1:-1,x[0],x[1]));var l=r.select(this).attr(o?"x":"y",ei).attr(o?"y":"x",r.min(a)).attr(o?"width":"height",Math.max(K,2)).attr(o?"height":"width",Math.max(r.max(a)-r.min(a),2));if(t._fillgradient)h.gradient(l,n,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=$(e).replace("e-","");l.attr("fill",d.hexString(u))}});var _=e.select("."+T.cblines).selectAll("path."+T.cbline).data(V.color&&V.width?X:[]);_.enter().append("path").classed(T.cbline,!0),_.exit().remove(),_.each(function(e){var t=Math.round(eu.c2p(e))+V.width/2%1;r.select(this).attr("d","M"+(o?ei+","+t:t+","+ei)+(o?"h":"v")+K).call(h.lineGroupStyle,V.width,H(e),V.dash)}),eb.selectAll("g."+eu._id+"tick,path").remove();var w=ei+K+(S||0)/2-("outside"===t.ticks),M=a.calcTicks(eu),E=a.getTickSigns(eu)[2];return a.drawTicks(n,eu,{vals:"inside"===eu.ticks?a.clipEnds(eu,M):M,layer:eb,path:a.makeTickPath(eu,w,E),transFn:a.makeTransTickFn(eu)}),a.drawLabels(n,eu,{vals:M,layer:eb,transFn:a.makeTransTickLabelFn(eu),labelFns:a.makeLabelFns(eu,w)})},function(){if(o&&!ec||!o&&ec){var e,i,a=eu.position||0,s=eu._offset+eu._length/2;if("right"===q)i=s,e=j.l+et*a+10+ex*(eu.showticklabels?1:.5);else if(e=s,"bottom"===q&&(i=j.t+er*a+10+(-1===ev.indexOf("inside")?eu.tickfont.size:0)+("inside"!==eu.ticks&&t.ticklen||0)),"top"===q){var l=U.text.split("
").length;i=j.t+er*a+10-K-b*ex*l}eT((o?"h":"v")+eu._id+"title",{avoid:{selection:r.select(n).selectAll("g."+eu._id+"tick"),side:q,offsetTop:o?0:j.t,offsetLeft:o?j.l:0,maxShift:o?B.width:B.height},attributes:{x:e,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var r,a=K+S/2;-1===ev.indexOf("inside")&&(r=h.bBox(eb.node()),a+=o?r.width:r.height),eg=ey.select("text");var s=0,u=o&&"top"===q,f=!o&&"right"===q,p=0;if(eg.node()&&!eg.classed(T.jsPlaceholder)){var g,y=ey.select(".h"+eu._id+"title-math-group").node();y&&(o&&ec||!o&&!ec)?(s=(r=h.bBox(y)).width,g=r.height):(s=(r=h.bBox(ey.node())).right-j.l-(o?ei:el),g=r.bottom-j.t-(o?el:ei),o||"top"!==q||(a+=r.height,p=r.height)),f&&(eg.attr("transform",l(s/2+ex/2,0)),s*=2),a=Math.max(a,o?s:g)}var v=(o?L:P)*2+a+E+S/2,b=0;!o&&U.text&&"bottom"===I&&F<=0&&(b=v/2,v+=b,p+=b),B._hColorbarMoveTitle=b,B._hColorbarMoveCBTitle=p;var A=E+S,k=(o?ei:el)-A/2-(o?L:0),N=(o?el:ei)-(o?Q:P+p-b);e.select("."+T.cbbg).attr("x",k).attr("y",N).attr(o?"width":"height",Math.max(v-b,2)).attr(o?"height":"width",Math.max(Q+A,2)).call(d.fill,D).call(d.stroke,t.bordercolor).style("stroke-width",E);var V=f?Math.max(s-10,0):0;e.selectAll("."+T.cboutline).attr("x",(o?ei:el+L)+V).attr("y",(o?el+P-Q:ei)+(u?e_:0)).attr(o?"width":"height",Math.max(K,2)).attr(o?"height":"width",Math.max(Q-(o?2*P+e_:2*L+V),2)).call(d.stroke,t.outlinecolor).style({fill:"none","stroke-width":S});var G=o?en*v:0,H=o?0:(1-ea)*v-p;if(G=R?j.l-G:-G,H=O?j.t-H:-H,e.attr("transform",l(G,H)),!o&&(E||d.opacity(D)&&!d.equals(B.paper_bgcolor,D))){var $=eb.selectAll("text"),W=$[0].length,Y=e.select("."+T.cbbg).node(),Z=h.bBox(Y),X=h.getTranslate(e);$.each(function(e,t){var r=W-1;if(0===t||t===r){var i,n=h.bBox(this),a=h.getTranslate(this);if(t===r){var o=n.right+a.x;(i=Z.right+X.x+el-E-2+z-o)>0&&(i=0)}else if(0===t){var s=n.left+a.x;(i=Z.left+X.x+el+E+2-s)<0&&(i=0)}i&&(W<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var J={},ee=_[C],et=w[C],er=_[I],eo=w[I],es=v-K;o?("pixels"===m?(J.y=F,J.t=Q*er,J.b=Q*eo):(J.t=J.b=0,J.yt=F+c*er,J.yb=F-c*eo),"pixels"===M?(J.x=z,J.l=v*ee,J.r=v*et):(J.l=es*ee,J.r=es*et,J.xl=z-x*ee,J.xr=z+x*et)):("pixels"===m?(J.x=z,J.l=Q*ee,J.r=Q*et):(J.l=J.r=0,J.xl=z+c*ee,J.xr=z-c*et),"pixels"===M?(J.y=1-F,J.t=v*er,J.b=v*eo):(J.t=es*er,J.b=es*eo,J.yt=F-x*er,J.yb=F+x*eo));var eh=t.y<.5?"b":"t",ed=t.x<.5?"l":"r";n._fullLayout._reservedMargin[t._id]={};var ef={r:B.width-k-G,l:k+J.r,b:B.height-N-H,t:N+J.b};R&&O?i.autoMargin(n,t._id,J):R?n._fullLayout._reservedMargin[t._id][eh]=ef[eh]:O||o?n._fullLayout._reservedMargin[t._id][ed]=ef[ed]:n._fullLayout._reservedMargin[t._id][eh]=ef[eh]}],n)}(L,t,e);P&&P.then&&(e._promises||[]).push(P),e._context.edits.colorbarPosition&&(m=L,x=t,M=e,C="v"===x.orientation,I=M._fullLayout._size,o.init({element:m.node(),gd:M,prepFn:function(){S=m.attr("transform"),c(m)},moveFn:function(e,t){m.attr("transform",S+l(e,t)),E=o.align((C?x._uFrac:x._vFrac)+e/I.w,C?x._thickFrac:x._lenFrac,0,1,x.xanchor),D=o.align((C?x._vFrac:1-x._uFrac)-t/I.h,C?x._lenFrac:x._thickFrac,0,1,x.yanchor),c(m,o.getCursor(E,D,x.xanchor,x.yanchor))},doneFn:function(){if(c(m),void 0!==E&&void 0!==D){var e={};e[x._propPrefix+"x"]=E,e[x._propPrefix+"y"]=D,void 0!==x._traceIndex?n.call("_guiRestyle",M,e,x._traceIndex):n.call("_guiRelayout",M,e)}}}))}),t.exit().each(function(t){i.autoMargin(e,t._id)}).remove(),t.order()}}}}),ap=m({"src/components/colorbar/index.js"(e,t){t.exports={moduleType:"component",name:"colorbar",attributes:tq(),supplyDefaults:t0(),draw:af().draw,hasColorbar:t$()}}}),am=m({"src/components/legend/index.js"(e,t){t.exports={moduleType:"component",name:"legend",layoutAttributes:ry(),supplyLayoutDefaults:rx(),draw:rS(),style:rk()}}}),ag=m({"src/locale-en.js"(e,t){t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),ay=m({"src/locale-en-us.js"(e,t){t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),av=m({"src/snapshot/cloneplot.js"(e,t){var r=e1(),i=tb(),n=i.extendFlat,a=i.extendDeep;function o(e){var t;switch(e){case"themes__thumb":t={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":t={title:{text:""},showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:t={}}return t}t.exports=function(e,t){var i,s=e.data,l=e.layout,u=a([],s),c=a({},l,o(t.tileClass));if(e._context,t.width&&(c.width=t.width),t.height&&(c.height=t.height),"thumbnail"===t.tileClass||"themes__thumb"===t.tileClass){c.annotations=[];var h=Object.keys(c);for(i=0;i-1&&(c[h[i]].title={text:""});for(i=0;i=0)return e}else if("string"==typeof e&&"%"===(e=e.trim()).slice(-1)&&r(e.slice(0,-1))&&(e=+e.slice(0,-1))>=0)return e+"%"}function f(e,t,r,n,a,o){var s=!1!==(o=o||{}).moduleHasSelected,l=!1!==o.moduleHasUnselected,u=!1!==o.moduleHasConstrain,c=!1!==o.moduleHasCliponaxis,d=!1!==o.moduleHasTextangle,f=!1!==o.moduleHasInsideanchor,p=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(n,"textfont",r.font),x=i.extendFlat({},v),b=!(e.textfont&&e.textfont.color);if(b&&delete x.color,h(n,"insidetextfont",x),p){var _=i.extendFlat({},v);b&&delete _.color,h(n,"pathbar.textfont",_)}y&&h(n,"outsidetextfont",v),s&&n("selected.textfont.color"),l&&n("unselected.textfont.color"),u&&n("constraintext"),c&&n("cliponaxis"),d&&n("textangle"),n("texttemplate"),n("texttemplatefallback")}g&&f&&n("insidetextanchor")}t.exports={supplyDefaults:function(e,t,r,u){function h(r,n){return i.coerce(e,t,c,r,n)}if(!o(e,t,u,h)){t.visible=!1;return}s(e,t,u,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",t.x&&!t.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback");var d=h("textposition");f(e,t,u,h,d,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(e,t,h,r,u);var p=(t.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(e,t,p||n.defaultLine,{axis:"y"}),m(e,t,p||n.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(t,h)},crossTraceDefaults:function(e,t){var r,n;function a(e,t){return i.coerce(n._input,n,c,e,t)}for(var o=0;o0&&!d[y]&&(h=!0)),d[y]=!0,g.visible&&"histogram"===g.type&&"category"!==i.getFromId({_fullLayout:t},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(c=!0)}}u?("overlay"!==f&&l("barnorm"),l("bargap",c&&!h?0:.2),l("bargroupgap"),t.barcornerradius=o(l("barcornerradius"))):delete t.barmode}}}),aE=m({"src/traces/bar/arrays_to_calcdata.js"(e,t){var r=tb();t.exports=function(e,t){for(var i=0;ia))return t}return void 0!==i?i:e.dflt},e.coerceColor=function(e,r,i){return t.isValid(r)?r:void 0!==i?i:e.dflt},e.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t*=1),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},e.getValue=function(e,t){var r;return i(e)?t1||0===n.bargap&&0===n.bargroupgap&&!e[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")}),t.selectAll("g.points").each(function(t){f(r.select(this),t[0].trace,e)}),o.getComponentMethod("errorbars","style")(t)},styleTextPoints:p,styleOnSelect:function(e,t,i){var s,l,u,c,h,d,p=t[0].trace;p.selectedpoints?(s=i,l=p,u=e,n.selectedPointStyle(s.selectAll("path"),l),c=s.selectAll("text"),h=l,d=u,c.each(function(e){var t,i=r.select(this);if(e.selected){t=a.ensureUniformFontSize(d,m(i,e,h,d));var o=h.selected.textfont&&h.selected.textfont.color;o&&(t.color=o),n.font(i,t)}else n.selectedTextStyle(i,h)})):(f(i,p,e),o.getComponentMethod("errorbars","style")(i))},getInsideTextFont:y,getOutsideTextFont:v,getBarColor:b,resizeText:s}}}),aP=m({"src/traces/bar/plot.js"(e,t){var r=M(),i=I(),n=tb(),a=tj(),o=er(),s=rt(),l=e1(),u=ro().tickText,c=aC(),h=c.recordMinTextSize,d=c.clearMinTextSize,f=aL(),p=aI(),m=i6(),g=aT(),y=g.text,v=g.textposition,x=t7().appendArrayPointValue,b=m.TEXTPAD;function _(e){return e.id}function w(e,t,r,i){var n;return!t.uniformtext.mode&&T(r)?(i&&(n=i()),e.transition().duration(r.duration).ease(r.easing).each("end",function(){n&&n()}).each("interrupt",function(){n&&n()})):e}function T(e){return e&&e.duration>0}function A(e,t,r,i,n){return!(e<0)&&!(t<0)&&(r<=e&&i<=t||r<=t&&i<=e||(n?e>=t/i*r:t>=e/r*i))}function k(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,i=Math.abs(Math.sin(r)),n=Math.abs(Math.cos(r));return{x:e.width*n+e.height*i,y:e.width*i+e.height*n}}function E(e,t,r,i,n,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,u=a.anchor,c="end"===u,h="start"===u,d=((a.leftToRight||0)+1)/2,f=1-d,p=a.hasB,m=a.r,g=a.overhead,y=n.width,v=n.height,x=Math.abs(t-e),_=Math.abs(i-r),w=x>2*b&&_>2*b?b:0;x-=2*w,_-=2*w;var T=k(l);"auto"===l&&!(y<=x&&v<=_)&&(y>x||v>_)&&(!(y>_||v>x)||yb){var D,C,I,L,P,z,F,O,R,B,j,N,V,U,q,G,H,$=(D=e,C=t,I=r,L=i,P=E,z=m,F=g,O=o,R=p,U=Math.max(0,Math.abs(C-D)-2*b),q=Math.max(0,Math.abs(L-I)-2*b),G=z-b,H=F?G-Math.sqrt(G*G-(G-F)*(G-F)):G,P.y/P.x>=q/(U-(R?2*G:O?G-F:2*H))?N=q/P.y:P.y/P.x<=(q-(R?2*G:O?2*H:G-F))/U?N=U/P.x:!R&&O?(B=P.x*P.x+P.y*P.y/4,N=(-(j=-2*P.x*(U-G)-P.y*(q/2-G))+Math.sqrt(j*j-4*B*((U-G)*(U-G)+(q/2-G)*(q/2-G)-G*G)))/(2*B)):R?(B=(P.x*P.x+P.y*P.y)/4,N=(-(j=-P.x*(U/2-G)-P.y*(q/2-G))+Math.sqrt(j*j-4*B*((U/2-G)*(U/2-G)+(q/2-G)*(q/2-G)-G*G)))/(2*B)):(B=P.x*P.x/4+P.y*P.y,N=(-(j=-P.x*(U/2-G)-2*P.y*(q-G))+Math.sqrt(j*j-4*B*((U/2-G)*(U/2-G)+(q-G)*(q-G)-G*G)))/(2*B)),N=Math.min(1,N),V=O?Math.max(0,G-Math.sqrt(Math.max(0,G*G-(G-(q-P.y*N)/2)*(G-(q-P.y*N)/2)))-F):Math.max(0,G-Math.sqrt(Math.max(0,G*G-(G-(U-P.x*N)/2)*(G-(U-P.x*N)/2)))-F),{scale:N,pad:V});A=$.scale,M=$.pad}else A=1,s&&(A=Math.min(1,x/E.x,_/E.y)),M=0;var W=n.left*f+n.right*d,Y=(n.top+n.bottom)/2,Z=(e+b)*f+(t-b)*d,X=(r+i)/2,K=0,J=0;if(h||c){var Q=(o?E.x:E.y)/2;m&&(c||p)&&(w+=M);var ee=o?eo.opacity(Q)||J>.01?$:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?$(e):e>t?Math.ceil(e):Math.floor(e)};e._context.staticPlot||(z=W(z,V,j),V=W(V,z,j),U=W(U,q,!j),q=W(q,U,!j));var Y,Z,X,K,J,Q,ee,et=j?D.c2p:C.c2p;ee=c.s0>0?c._sMax:c.s0<0?c._sMin:c.s1>0?c._sMax:c._sMin;var er,ei,en=O||F?function(e,t){if(!e)return 0;var r=Math.abs(j?q-U:V-z),i=Math.abs(j?V-z:q-U),n=W(Math.abs(et(ee,!0)-et(0,!0))),a=c.hasB?Math.min(r/2,i/2):Math.min(r/2,n);return W(Math.max(Math.min("%"===t?Math.min(50,e)/100*r:e,a),0))}(m.cornerradiusvalue,m.cornerradiusform):0,ea="M"+z+","+U+"V"+q+"H"+V+"V"+U+"Z",eo=0;if(en&&c.s){var es,el,eu,ec=0==((es=c.s0)>0)-(es<0)||((el=c.s)>0)-(el<0)==((eu=c.s0)>0)-(eu<0)?c.s1:c.s0;if((eo=W(c.hasB?0:Math.abs(et(ee,!0)-et(ec,!0))))0?Math.sqrt(eo*(2*en-eo)):0,eg=eh>0?Math.max:Math.min;er="M"+z+","+U+"V"+(q-ep*ed)+"H"+eg(V-(en-eo)*eh,z)+"A "+en+","+en+" 0 0 "+ef+" "+V+","+(q-en*ed-em)+"V"+(U+en*ed+em)+"A "+en+","+en+" 0 0 "+ef+" "+eg(V-(en-eo)*eh,z)+","+(U+ep*ed)+"Z"}else if(c.hasB)er="M"+(z+en*eh)+","+U+"A "+en+","+en+" 0 0 "+ef+" "+z+","+(U+en*ed)+"V"+(q-en*ed)+"A "+en+","+en+" 0 0 "+ef+" "+(z+en*eh)+","+q+"H"+(V-en*eh)+"A "+en+","+en+" 0 0 "+ef+" "+V+","+(q-en*ed)+"V"+(U+en*ed)+"A "+en+","+en+" 0 0 "+ef+" "+(V-en*eh)+","+U+"Z";else{var ey=(ei=Math.abs(q-U)+eo)0?Math.sqrt(eo*(2*en-eo)):0,ex=ed>0?Math.max:Math.min;er="M"+(z+ey*eh)+","+U+"V"+ex(q-(en-eo)*ed,U)+"A "+en+","+en+" 0 0 "+ef+" "+(z+en*eh-ev)+","+q+"H"+(V-en*eh+ev)+"A "+en+","+en+" 0 0 "+ef+" "+(V-ey*eh)+","+ex(q-(en-eo)*ed,U)+"V"+U+"Z"}}else er=ea}else er=ea;var eb=w(n.ensureSingle(T,"path"),I,g,M);if(eb.style("vector-effect",L?"none":"non-scaling-stroke").attr("d",isNaN((V-z)*(q-U))||G&&e._context.staticPlot?"M0,0Z":er).call(s.setClipUrl,t.layerClipId,e),!I.uniformtext.mode&&N){var e_=s.makePointStyleFns(d);s.singlePointStyle(c,eb,d,e_,e)}(function(e,t,r,i,o,l,c,d,m,g,_,T,M){var D,C,I,L,P,z,F,O,R,B,j,N,V,U,q,G,H,$,W,Y,Z,X,K,J,Q,ee,et=t.xaxis,er=t.yaxis,ei=e._fullLayout;function en(t,r,i){return n.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+ee,"text-anchor":"middle","data-notex":1}).call(s.font,i).call(a.convertToTspans,e)}var ea=i[0].trace,eo="h"===ea.orientation,es=function(e,t,r,i){for(var n=!1,a=!1,o=0;o0?n=!0:s<0&&(a=!0),n&&a)return 0}var l=t?r:i,u=-(l.range[0]1;g("percent initial")&&(h=n.formatPercent(f.begR),b&&(h+=" of initial"),m.push(h)),g("percent previous")&&(h=n.formatPercent(f.difR),b&&(h+=" of previous"),m.push(h)),g("percent total")&&(h=n.formatPercent(f.sumR),b&&(h+=" of total"),m.push(h))}return m.join("
")}(e_,ew,eT,eA):p.getValue(ek.text,ew),p.coerceString(y,eM));eS=ea,eE=o,eD=p.getValue(eS.textposition,eE),ee=p.coerceEnumerated(v,eD);var eu="stack"===T.mode||"relative"===T.mode,ec=i[o],eh=!eu||ec._outmost,ed=ec.hasB,ef=g&&g-_>b;if(!el||"none"===ee||(ec.isBlank||l===c||d===m)&&("auto"===ee||"inside"===ee))return r.select("text").remove();var ep=ei.font,em=f.getBarColor(i[o],ea),eg=f.getInsideTextFont(ea,o,ep,em),ey=f.getOutsideTextFont(ea,o,ep),ev=ea.insidetextanchor||"end",ex=r.datum();eo?"log"===et.type&&ex.s0<=0&&(l=et.range[0]0&&eP>0;eR=ef?ed?A(eF-2*g,eO,eL,eP,eo)||A(eF,eO-2*g,eL,eP,eo):eo?A(eF-(g-_),eO,eL,eP,eo)||A(eF,eO-2*(g-_),eL,eP,eo):A(eF,eO-(g-_),eL,eP,eo)||A(eF-2*(g-_),eO,eL,eP,eo):A(eF,eO,eL,eP,eo),eB&&eR?ee="inside":(ee="outside",eC.remove(),eC=null)}else ee="inside";if(!eC){var ej=(eC=en(r,el,ez=n.ensureUniformFontSize(e,"outside"===ee?ey:eg))).attr("transform");if(eC.attr("transform",""),eL=(eI=s.bBox(eC.node())).width,eP=eI.height,eC.attr("transform",ej),eL<=0||eP<=0)return eC.remove()}var eN,eV=ea.textangle;(eN="outside"===ee?(D=l,C=c,I=d,L=m,P=eI,O=!!(z={isHorizontal:eo,constrained:"both"===ea.constraintext||"outside"===ea.constraintext,angle:eV,zeroBarDir:es}).isHorizontal,R=!!z.constrained,B=z.angle||0,j=P.width,N=P.height,V=Math.abs(C-D),U=Math.abs(L-I),F=O?U>2*b?b:0:V>2*b?b:0,q=1,R&&(q=O?Math.min(1,U/N):Math.min(1,V/j)),$=S(P,H=k(B)),W=(O?$.x:$.y)/2,Y=(P.left+P.right)/2,Z=(P.top+P.bottom)/2,X=(D+C)/2,K=(I+L)/2,J=0,Q=0,G=(O?D===C:I===L)&&z.zeroBarDir?z.zeroBarDir:O?C0?t+=r:c<0&&(t-=r)}return t}function P(e){var t=c,i=e.b,n=L(e);return r.inbox(i-t,n-t,_+(n-t)/(n-i)-1)}var z=e[h+"a"],F=e[d+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var O=r.getDistanceFunction(n,f,p,function(e){return(f(e)+p(e))/2});if(r.getClosest(g,O,e),!1!==e.index&&g[e.index].p!==l){x||T||(E=function(e){return Math.min(A(e),e.p-v.bargroupwidth/2)},D=function(e){return Math.max(M(e),e.p+v.bargroupwidth/2)});var R,B,j,N=g[e.index],V=y.base?N.b+N.s:N.s;e[d+"0"]=e[d+"1"]=F.c2p(N[d],!0),e[d+"LabelVal"]=V;var U=v.extents[v.extents.round(N.p)];e[h+"0"]=z.c2p(x?E(N):U[0],!0),e[h+"1"]=z.c2p(x?D(N):U[1],!0);var q=void 0!==N.orig_p;return e[h+"LabelVal"]=q?N.orig_p:N.p,e.labelLabel=s(z,e[h+"LabelVal"],y[h+"hoverformat"]),e.valueLabel=s(F,e[d+"LabelVal"],y[d+"hoverformat"]),e.baseLabel=s(F,N.b,y[d+"hoverformat"]),R=c,B=N.b,j=L(N),e.spikeDistance=(r.inbox(B-R,j-R,w+(j-R)/(j-B)-1)+C(A(N),M(N),w))/2,e[h+"Spike"]=z.c2p(N.p,!0),a(N,y,e),e.hovertemplate=y.hovertemplate,e}}function c(e,t){var r=t.mcc||e.marker.color,i=t.mlcc||e.marker.line.color,a=o(e,t);return n.opacity(r)?r:n.opacity(i)&&a?i:void 0}t.exports={hoverPoints:function(e,t,r,n,a){var o=u(e,t,r,n,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=c(l,h),i.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:u,getTraceColor:c}}}),aF=m({"src/traces/bar/event_data.js"(e,t){t.exports=function(e,t,r){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),"h"===r.orientation?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e}}}),aO=m({"src/traces/bar/select.js"(e,t){t.exports=function(e,t){var r,i=e.cd,n=e.xaxis,a=e.yaxis,o=i[0].trace,s="funnel"===o.type,l="h"===o.orientation,u=[];if(!1===t)for(r=0;r0?(g="v",y=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",y=Math.min(_)):y=0;if(!y){t.visible=!1;return}t._length=y;var S=n("orientation",g);t._hasPreCompStats?"v"===S&&0===x?(n("x0",0),n("dx",1)):"h"===S&&0===v&&(n("y0",0),n("dy",1)):"v"===S&&0===x?n("x0"):"h"===S&&0===v&&n("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a)}function c(e,t,i,n){var a=n.prefix,o=r.coerce2(e,t,l,"marker.outliercolor"),s=i("marker.line.outliercolor"),u="outliers";t._hasPreCompStats?u="all":(o||s)&&(u="suspectedoutliers");var c=i(a+"points",u);c?(i("jitter",.3*("all"===c)),i("pointpos","all"===c?-1.5:0),i("marker.symbol"),i("marker.opacity"),i("marker.size"),i("marker.angle"),i("marker.color",t.line.color),i("marker.line.color"),i("marker.line.width"),"suspectedoutliers"===c&&(i("marker.line.outliercolor",t.marker.color),i("marker.line.outlierwidth")),i("selected.marker.color"),i("unselected.marker.color"),i("selected.marker.size"),i("unselected.marker.size"),i("text"),i("hovertext")):delete t.marker;var h=i("hoveron");("all"===h||-1!==h.indexOf("points"))&&(i("hovertemplate"),i("hovertemplatefallback")),r.coerceSelectionMarkerOpacity(t,i)}t.exports={supplyDefaults:function(e,t,i,o){function s(i,n){return r.coerce(e,t,l,i,n)}if(u(e,t,s,o),!1!==t.visible){a(e,t,o,s),s("xhoverformat"),s("yhoverformat");var h=t._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||i),s("line.width"),s("fillcolor",n.addOpacity(t.line.color,.5));var d=!1;if(h){var f=s("mean"),p=s("sd");f&&f.length&&(d=!0,p&&p.length&&(d="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",d)),s("showwhiskers","quartiles"===g),("sd"===g||"sd"===m)&&s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(e.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),c(e,t,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(e,t){var i,n;function a(e){return r.coerce(n._input,n,l,e)}for(var s=0;sE.uf};if(t._hasPreCompStats){var V=t[x],U=function(e){return v.d2c((t[e]||[])[l])},q=1/0,G=-1/0;for(l=0;l=E.q1&&E.q3>=E.med){var $,W=U("lowerfence");E.lf=W!==o&&W<=E.q1?W:d(E,C,I);var Y=U("upperfence");E.uf=Y!==o&&Y>=E.q3?Y:f(E,C,I);var Z=U("mean");E.mean=Z!==o?Z:I?a.mean(C,I):(E.q1+E.q3)/2;var X=U("sd");E.sd=Z!==o&&X>=0?X:I?a.stdev(C,I,E.mean):E.q3-E.q1,E.lo=p(E),E.uo=m(E);var K=U("notchspan");K=K!==o&&K>0?K:g(E,I),E.ln=E.med-K,E.un=E.med+K;var J=E.lf,Q=E.uf;t.boxpoints&&C.length&&(J=Math.min(J,C[0]),Q=Math.max(Q,C[I-1])),t.notched&&(J=Math.min(J,E.ln),Q=Math.max(Q,E.un)),E.min=J,E.max=Q}else a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join(` +`)),$=E.med!==o?E.med:E.q1!==o?E.q3!==o?(E.q1+E.q3)/2:E.q1:E.q3!==o?E.q3:0,E.med=$,E.q1=E.q3=$,E.lf=E.uf=$,E.mean=E.sd=$,E.ln=E.un=$,E.min=E.max=$;q=Math.min(q,E.min),G=Math.max(G,E.max),E.pts2=D.filter(N),k.push(E)}}t._extremes[v._id]=i.findExtremes(v,[q,G],{padded:!0})}else{var ee,et,er=v.makeCalcdata(t,x),ei=function(e,t){for(var r=e.length,i=Array(r+1),n=0;n=0&&eo0){((E={}).pos=E[_]=B[l],D=E.pts=ea[l].sort(c),I=(C=E[x]=D.map(h)).length,E.min=C[0],E.max=C[I-1],E.mean=a.mean(C,I),E.sd=a.stdev(C,I,E.mean)*t.sdmultiple,E.med=a.interp(C,.5),I%2&&(ec||eh))?(ec?(ee=C.slice(0,I/2),et=C.slice(I/2+1)):eh&&(ee=C.slice(0,I/2+1),et=C.slice(I/2)),E.q1=a.interp(ee,.5),E.q3=a.interp(et,.5)):(E.q1=a.interp(C,.25),E.q3=a.interp(C,.75)),E.lf=d(E,C,I),E.uf=f(E,C,I),E.lo=p(E),E.uo=m(E);var ed=g(E,I);E.ln=E.med-ed,E.un=E.med+ed,es=Math.min(es,E.ln),el=Math.max(el,E.un),E.pts2=D.filter(N),k.push(E)}t.notched&&a.isTypedArray(er)&&(er=Array.from(er)),t._extremes[v._id]=i.findExtremes(v,t.notched?er.concat([es,el]):er,{padded:!0})}return function(e,t){if(a.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(k[0].t={num:T[S],dPos:j,posLetter:_,valLetter:x,labels:{med:s(e,"median:"),min:s(e,"min:"),q1:s(e,"q1:"),q3:s(e,"q3:"),max:s(e,"max:"),mean:"sd"===t.boxmean||"sd"===t.sizemode?s(e,"mean \xb1 σ:").replace("σ",1===t.sdmultiple?"σ":t.sdmultiple+"σ"):s(e,"mean:"),lf:s(e,"lower fence:"),uf:s(e,"upper fence:")}},T[S]++,k):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function u(e,t,r){for(var i in l)a.isArrayOrTypedArray(t[i])&&(Array.isArray(r)?a.isArrayOrTypedArray(t[i][r[0]])&&(e[l[i]]=t[i][r[0]][r[1]]):e[l[i]]=t[i][r])}function c(e,t){return e.v-t.v}function h(e){return e.v}function d(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(a.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function f(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(a.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function p(e){return 4*e.q1-3*e.q3}function m(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}}}),aG=m({"src/traces/box/cross_trace_calc.js"(e,t){var r=ro(),i=tb(),n=r9().getAxisGroup,a=["v","h"];function o(e,t,a,o){var s,l,u,c=t.calcdata,h=t._fullLayout,d=o._id,f=d.charAt(0),p=[],m=0;for(s=0;s1,b=1-h[e+"gap"],_=1-h[e+"groupgap"];for(s=0;s0;if("positive"===D?(z=w*(E?1:.5),O=U,F=O=A):"negative"===D?(z=O=A,F=w*(E?1:.5),R=U):(z=F=w,O=R=U),G){var H=k.pointpos,$=k.jitter,W=k.marker.size/2,Y=0;H+$>=0&&((Y=U*(H+$))>z?(q=!0,N=W,B=Y):Y>O&&(N=W,B=z)),Y<=z&&(B=z);var Z=0;H-$<=0&&((Z=-U*(H-$))>F?(q=!0,V=W,j=Z):Z>R&&(V=W,j=F)),Z<=F&&(j=F)}else B=z,j=F;var X=Array(u.length);for(l=0;le.lo&&(x.so=!0)}return a});d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(n.translatePoints,o,s)}function s(e,t,n,a){var o,s,l=t.val,u=t.pos,c=!!u.rangebreaks,h=a.bPos,d=a.bPosPxOffset||0,f=n.boxmean||(n.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var p=e.selectAll("path.mean").data("box"===n.type&&n.boxmean||"violin"===n.type&&n.box.visible&&n.meanline.visible?i.identity:[]);p.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),p.exit().remove(),p.each(function(e){var t=u.c2l(e.pos+h,!0),i=u.l2p(t-o)+d,a=u.l2p(t+s)+d,p=c?(i+a)/2:u.l2p(t)+d,m=l.c2p(e.mean,!0),g=l.c2p(e.mean-e.sd,!0),y=l.c2p(e.mean+e.sd,!0);"h"===n.orientation?r.select(this).attr("d","M"+m+","+i+"V"+a+("sd"===f?"m0,0L"+g+","+p+"L"+m+","+i+"L"+y+","+p+"Z":"")):r.select(this).attr("d","M"+i+","+m+"H"+a+("sd"===f?"m0,0L"+p+","+g+"L"+i+","+m+"L"+p+","+y+"Z":""))})}t.exports={plot:function(e,t,n,l){var u=e._context.staticPlot,c=t.xaxis,h=t.yaxis;i.makeTraceGroups(l,n,"trace boxes").each(function(e){var t,i,n=r.select(this),l=e[0],d=l.t,f=l.trace;(d.wdPos=d.bdPos*f.whiskerwidth,!0!==f.visible||d.empty)?n.remove():("h"===f.orientation?(t=h,i=c):(t=c,i=h),a(n,{pos:t,val:i},f,d,u),o(n,{x:c,y:h},f,d),s(n,{pos:t,val:i},f,d))})},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),a$=m({"src/traces/box/style.js"(e,t){var r=M(),i=er(),n=rt();t.exports={style:function(e,t,a){var o=a||r.select(e).selectAll("g.trace.boxes");o.style("opacity",function(e){return e[0].trace.opacity}),o.each(function(t){var a=r.select(this),o=t[0].trace,s=o.line.width;function l(e,t,r,n){e.style("stroke-width",t+"px").call(i.stroke,r).call(i.fill,n)}var u=a.selectAll("path.box");if("candlestick"===o.type)u.each(function(e){if(!e.empty){var t=r.select(this),i=o[e.dir];l(t,i.line.width,i.line.color,i.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}});else{l(u,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(i.stroke,o.line.color);var c=a.selectAll("path.point");n.pointStyle(c,o,e)}})},styleOnSelect:function(e,t,r){var i=t[0].trace,a=r.selectAll("path.point");i.selectedpoints?n.selectedPointStyle(a,i):n.pointStyle(a,i,e)}}}}),aW=m({"src/traces/box/hover.js"(e,t){var r=ro(),i=tb(),n=rO(),a=er(),o=i.fillText;function s(e,t,o,s){var l,u,c,h,d,f,p,m,g,y,v,x,b,_,w=e.cd,T=e.xa,A=e.ya,M=w[0].trace,k=w[0].t,S="violin"===M.type,E=k.bdPos,D=k.wHover,C=function(e){return h.c2l(e.pos)+k.bPos-h.c2l(p)};S&&"both"!==M.side?("positive"===M.side&&(y=function(e){var t=C(e);return n.inbox(t,t+D,v)},b=E,_=0),"negative"===M.side&&(y=function(e){var t=C(e);return n.inbox(t-D,t,v)},b=0,_=E)):(y=function(e){var t=C(e);return n.inbox(t-D,t+D,v)},b=_=E),l=S?function(e){return n.inbox(e.span[0]-f,e.span[1]-f,v)}:function(e){return n.inbox(e.min-f,e.max-f,v)},"h"===M.orientation?(f=t,p=o,m=l,g=y,u="y",h=A,c="x",d=T):(f=o,p=t,m=y,g=l,u="x",h=T,c="y",d=A);var I=Math.min(1,E/Math.abs(h.r2c(h.range[1])-h.r2c(h.range[0])));function L(e){return(m(e)+g(e))/2}v=e.maxHoverDistance-I,x=e.maxSpikeDistance-I;var P=n.getDistanceFunction(s,m,g,L);if(n.getClosest(w,P,e),!1===e.index)return[];var z=w[e.index],F=M.line.color,O=(M.marker||{}).color;a.opacity(F)&&M.line.width?e.color=F:a.opacity(O)&&M.boxpoints?e.color=O:e.color=M.fillcolor,e[u+"0"]=h.c2p(z.pos+k.bPos-_,!0),e[u+"1"]=h.c2p(z.pos+k.bPos+b,!0),e[u+"LabelVal"]=void 0!==z.orig_p?z.orig_p:z.pos;var R=u+"Spike";e.spikeDistance=L(z)*x/v,e[R]=h.c2p(z.pos,!0);var B=M.boxmean||"sd"===M.sizemode||(M.meanline||{}).visible,j=M.boxpoints||M.points,N=j&&B?["max","uf","q3","med","mean","q1","lf","min"]:j&&!B?["max","uf","q3","med","q1","lf","min"]:!j&&B?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],V=d.range[1]0&&(a=!0);for(var l=0;la){var o=a-i[e];return i[e]=a,o}}return 0},max:function(e,t,i,n){var a=n[t];if(r(a)){if(a=Number(a),!r(i[e]))return i[e]=a,a;else if(i[e]a){var l=d(t,o,s),u=d(r,o,s),c=+(e!==i);return l[c]!==u[c]}return Math.floor(r/e)-Math.floor(t/e)>.1}(c,e,t,s,r,n))l=c;else break}return l}function h(e,t){return t&&e>l?e>a?e>1.1*i?i:e>1.1*n?n:a:e>o?o:e>s?s:l:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function d(e,t,r){var n=t.c2d(e,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,o){var s,l,h=-1.1*t,d=-.1*t,f=e-d,p=r[0],m=r[1],g=Math.min(c(p+d,p+f,n,o),c(m+d,m+f,n,o)),y=Math.min(c(p+h,p+d,n,o),c(m+h,m+d,n,o));if(g>y&&ya){var v=s===i?1:6,x=s===i?"M12":"M1";return function(t,r){var a=n.c2d(t,i,o),s=a.indexOf("-",v);s>0&&(a=a.slice(0,s));var c=n.d2c(a,0,o);if(co.r2l(B)&&(N=a.tickIncrement(N,_.size,!0,p)),z.start=o.l2r(N),R||i.nestedProperty(t,v+".start").set(z.start)}var V=_.end,U=o.r2l(P.end),q=void 0!==U;if((_.endFound||q)&&U!==o.r2l(V)){var G=q?U:i.aggNums(Math.max,null,m);z.end=o.l2r(G),q||i.nestedProperty(t,v+".start").set(z.end)}var H="autobin"+s;return!1===t._input[H]&&(t._input[v]=i.extendFlat({},t[v]||{}),delete t._input[H],delete t[H]),[z,m]}t.exports={calc:function(e,t){var n,p,m,g,y,v=[],x=[],b="h"===t.orientation,_=a.getFromId(e,b?t.yaxis:t.xaxis),w=b?"y":"x",T={x:"y",y:"x"}[w],A=t[w+"calendar"],M=t.cumulative,k=f(e,t,_,w),S=k[0],E=k[1],D="string"==typeof S.size,C=[],I=D?C:S,L=[],P=[],z=[],F=0,O=t.histnorm,R=t.histfunc,B=-1!==O.indexOf("density");M.enabled&&B&&(O=O.replace(/ ?density$/,""),B=!1);var j,N="max"===R||"min"===R?null:0,V=u.count,U=c[O],q=!1,G=function(e){return _.r2c(e,0,A)};for(i.isArrayOrTypedArray(t[T])&&"count"!==R&&(j=t[T],q="avg"===R,V=u[R]),p=G(S.start),g=G(S.end)+(p-a.tickIncrement(p,S.size,!1,A))/1e6;p=0&&y=0;i--)s(i);else if("increasing"===t){for(i=1;i=0;i--)e[i]+=e[i+1];"exclude"===r&&(e.push(0),e.shift())}}(x,M.direction,M.currentbin);var Q=Math.min(v.length,x.length),ee=[],et=0,er=Q-1;for(p=0;p=et;p--)if(x[p]){er=p;break}for(p=et;p<=er;p++)if(r(v[p])&&r(x[p])){var ei={p:v[p],s:x[p],b:0};M.enabled||(ei.pts=z[p],Y?ei.ph0=ei.ph1=z[p].length?E[z[p][0]]:v[p]:(t._computePh=!0,ei.ph0=n(C[p]),ei.ph1=n(C[p+1],!0))),ee.push(ei)}return 1===ee.length&&(ee[0].width1=a.tickIncrement(ee[0].p,S.size,!1,A)-ee[0].p),o(t,"marker")&&s(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),o(t,"marker.line")&&s(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),l(ee,t),i.isArrayOrTypedArray(t.selectedpoints)&&i.tagSelected(ee,t,K),ee},calcAllAutoBins:f}}}),a7=m({"src/traces/histogram2d/calc.js"(e,t){var r=tb(),i=ro(),n=a3(),a=a5(),o=a4(),s=a6(),l=a8().calcAllAutoBins;function u(e,t,r,i){var n,a=Array(e);if(i)for(n=0;nD&&M.splice(D,M.length-D),E.length>D&&E.splice(D,E.length-D);var C=[],I=[],L=[],P="string"==typeof A.size,z="string"==typeof S.size,F=[],O=[],R=P?F:A,B=z?O:S,j=0,N=[],V=[],U=t.histnorm,q=t.histfunc,G=-1!==U.indexOf("density"),H="max"===q||"min"===q?null:0,$=n.count,W=a[U],Y=!1,Z=[],X=[],K="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";K&&"count"!==q&&(Y="avg"===q,$=n[q]);var J=A.size,Q=_(A.start),ee=_(A.end)+(Q-i.tickIncrement(Q,J,!1,x))/1e6;for(f=Q;f=0&&m=0&&gm&&(y=Math.max(y,Math.abs(e[a][o]-p)/(g-m))))}return y}t.exports=function(e,t){var i,a=1;for(n(e,t),i=0;i.01;i++)a=n(e,t,.5-.25*Math.min(1,.5*a));return a>.01&&r.log("interp2d didn't converge quickly",a),e}}}),or=m({"src/traces/heatmap/find_empties.js"(e,t){var r=tb().maxRowLength;t.exports=function(e){var t,i,n,a,o,s,l,u,c=[],h={},d=[],f=e[0],p=[],m=[0,0,0],g=r(e);for(i=0;i=0;o--)(s=((h[[(i=(a=d[o])[0])-1,n=a[1]]]||m)[2]+(h[[i+1,n]]||m)[2]+(h[[i,n-1]]||m)[2]+(h[[i,n+1]]||m)[2])/20)&&(l[a]=[i,n,s],d.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(e,t){return t[2]-e[2]})}}}),oi=m({"src/traces/heatmap/make_bound_array.js"(e,t){var r=e1(),i=tb().isArrayOrTypedArray;t.exports=function(e,t,n,a,o,s){var l,u,c,h=[],d=r.traceIs(e,"contour"),f=r.traceIs(e,"histogram");if(i(t)&&t.length>1&&!f&&"category"!==s.type){var p=t.length;if(!(p<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d)h=Array.from(t).slice(0,o);else if(1===o)h="log"===s.type?[.5*t[0],2*t[0]]:[t[0]-.5,t[0]+.5];else if("log"===s.type){for(h=[Math.pow(t[0],1.5)/Math.pow(t[1],.5)],c=1;c1){var t=(e[e.length-1]-e[0])/(e.length-1),r=Math.abs(t/100);for(A=0;Ar)return!1}return!0}(k.rangebreaks||S.rangebreaks)&&(T=function(e,t,r){for(var i=[],n=-1,a=0;a0;)T=A.c2p(B[D]),D--;for(T0;)E=M.c2p(j[D]),D--;E=A._length||T<=0||S>=M._length||E<=0){L.selectAll("image").data([]).exit().remove(),v(L);return}"fast"===Y?(Q=H,ee=G):(Q=X,ee=K);var J=document.createElement("canvas");J.width=Q,J.height=ee;var Q,ee,et,er,ei=J.getContext("2d",{willReadFrequently:!0}),en=h(z,{noNumericCheck:!0,returnArray:!0});"fast"===Y?(et=$?function(e){return H-1-e}:o.identity,er=W?function(e){return G-1-e}:o.identity):(et=function(e){return o.constrain(Math.round(A.c2p(B[e])-w),0,X)},er=function(e){return o.constrain(Math.round(M.c2p(j[e])-S),0,K)});var ea,eo,es,el,eu=er(0),ec=[eu,eu],eh=+!$,ed=+!W,ef=0,ep=0,em=0,eg=0;function ey(e,t=0){if(void 0===e)return[0,0,0,0];var r=en(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),ef+=t,ep+=r[0]*t,em+=r[1]*t,eg+=r[2]*t,r}if("default"!==Y){var ev,ex=0;try{ev=new Uint8Array(Q*ee*4)}catch{ev=Array(Q*ee*4)}if("smooth"===Y){var eb,e_,ew,eT=N||B,eA=V||j,eM=Array(eT.length),ek=Array(eA.length),eS=Array(X),eE=N?b:x,eD=V?b:x;for(D=0;De$||e$>M._length))for(C=eq;CeZ||eZ>A._length)){var eX=l({x:eY,y:eW},z,e._fullLayout);eX.x=eY,eX.y=eW;var eK=P.z[D][C];void 0===eK?(eX.z="",eX.zLabel=""):(eX.z=eK,eX.zLabel=a.tickText(eB,eK,"hover").text);var eJ=P.text&&P.text[D]&&P.text[D][C];(void 0===eJ||!1===eJ)&&(eJ=""),eX.text=eJ;var eQ=o.texttemplateString({data:[eX,z._meta],fallback:z.texttemplatefallback,labels:eX,locale:e._fullLayout._d3locale,template:eO});if(eQ){var e0=eQ.split("
"),e1=e0.length,e2=0;for(I=0;I=_[0].length||f<0||f>_.length)return}else{if(r.inbox(t-x[0],t-x[x.length-1],0)>0||r.inbox(s-b[0],s-b[b.length-1],0)>0)return;if(p){for(k=[2*x[0]-x[1]],E=1;E=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),oD=m({"src/traces/contour/attributes.js"(e,t){var r=aJ(),i=i_(),n=tV(),a=n.axisHoverFormat,o=n.descriptionOnlyNumbers,s=tG(),l=e$().dash,u=$(),c=H().extendFlat,h=oE(),d=h.COMPARISON_OPS2,f=h.INTERVAL_OPS,p=i.line;t.exports=c({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:i.xperiod0,yperiod0:i.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,hovertemplatefallback:r.hovertemplatefallback,texttemplate:c({},r.texttemplate,{}),texttemplatefallback:r.texttemplatefallback,textfont:c({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:c({},r.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:u({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(d).concat(f),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:c({},p.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:c({},p.smoothing,{}),editType:"plot"},zorder:i.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),oC=m({"src/traces/histogram2dcontour/attributes.js"(e,t){var r=ow(),i=oD(),n=tG(),a=tV().axisHoverFormat,o=H().extendFlat;t.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:{color:i.line.color,width:o({},i.line.width,{dflt:.5}),dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,hovertemplatefallback:r.hovertemplatefallback,texttemplate:i.texttemplate,texttemplatefallback:i.texttemplatefallback,textfont:i.textfont},n("",{cLetter:"z",editTypeOverride:"calc"}))}}),oI=m({"src/traces/contour/contours_defaults.js"(e,t){t.exports=function(e,t,r,i){var n=i("contours.start"),a=i("contours.end"),o=r("contours.size");((!1===n||!1===a?t.autocontour=!0:r("autocontour",!1))||!o)&&r("ncontours")}}}),oL=m({"src/traces/contour/label_defaults.js"(e,t){var r=tb();t.exports=function(e,t,i,n){if(n||(n={}),e("contours.showlabels")){var a=t.font;r.coerceFont(e,"contours.labelfont",a,{overrideDflt:{color:i}}),e("contours.labelformat")}!1!==n.hasHover&&e("zhoverformat")}}}),oP=m({"src/traces/contour/style_defaults.js"(e,t){var r=t1(),i=oL();t.exports=function(e,t,n,a,o){var s,l=n("contours.coloring"),u="";"fill"===l&&(s=n("contours.showlines")),!1!==s&&("lines"!==l&&(u=n("line.color","#000")),n("line.width",.5),n("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,r(e,t,a,n,{prefix:"",cLetter:"z"})),n("line.smoothing"),i(n,a,u,o)}}}),oz=m({"src/traces/histogram2dcontour/defaults.js"(e,t){var r=tb(),i=oT(),n=oI(),a=oP(),o=a0(),s=oC();t.exports=function(e,t,l,u){function c(i,n){return r.coerce(e,t,s,i,n)}i(e,t,c,u),!1!==t.visible&&(n(e,t,c,function(i){return r.coerce2(e,t,s,i)}),a(e,t,c,u),c("xhoverformat"),c("yhoverformat"),c("hovertemplate"),c("hovertemplatefallback"),t.contours&&"heatmap"===t.contours.coloring&&o(c,u))}}}),oF=m({"src/traces/contour/set_contours.js"(e,t){var r=ro(),i=tb();function n(e,t,i){var n={type:"linear",range:[e,t]};return r.autoTicks(n,(t-e)/(i||15)),n}t.exports=function(e,t){var a=e.contours;if(e.autocontour){var o=e.zmin,s=e.zmax;(e.zauto||void 0===o)&&(o=i.aggNums(Math.min,null,t)),(e.zauto||void 0===s)&&(s=i.aggNums(Math.max,null,t));var l=n(o,s,e.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),e._input.contours||(e._input.contours={}),i.extendFlat(e._input.contours,{start:a.start,end:a.end,size:a.size}),e._input.autocontour=!0}else if("constraint"!==a.type){var u=a.start,c=a.end,h=e._input.contours;u>c&&(a.start=h.start=c,c=a.end=h.end=u,u=a.start),a.size>0||(h.size=a.size=u===c?1:n(u,c,e.ncontours).dtick)}}}}),oO=m({"src/traces/contour/end_plus.js"(e,t){t.exports=function(e){return e.end+e.size/1e6}}}),oR=m({"src/traces/contour/calc.js"(e,t){var r=t4(),i=on(),n=oF(),a=oO();t.exports=function(e,t){var o=i(e,t),s=o[0].z;n(t,s);var l,u=t.contours,c=r.extractOpts(t);if("heatmap"===u.coloring&&c.auto&&!1===t.autocontour){var h=u.start,d=a(u),f=u.size||1,p=Math.floor((d-h)/f)+1;isFinite(f)||(f=1,p=1);var m=h-f/2,g=m+p*f;l=[m,g]}else l=s;return r.calc(e,t,{vals:l,cLetter:"z"}),o}}}),oB=m({"src/traces/contour/constants.js"(e,t){t.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),oj=m({"src/traces/contour/make_crossings.js"(e,t){var r=oB();t.exports=function(e){var t,i,n,a,o,s,l,u,c,h=e[0].z,d=h.length,f=h[0].length,p=2===d||2===f;for(i=0;ie?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}((u=e[c]).level,s))&&(u.crossings[o]=l,-1!==n.indexOf(l)&&(u.starts.push([t,i]),p&&-1!==n.indexOf(l,n.indexOf(l)+1)&&u.starts.push([t,i])))}}}),oN=m({"src/traces/contour/find_all_paths.js"(e,t){var r=tb(),i=oB();function n(e,t,r,i){return Math.abs(e[0]-t[0])20&&c?208===u||1114===u?d=0===h[0]?1:-1:f=0===h[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(u)?f=1:-1!==i.LEFTSTART.indexOf(u)?d=1:-1!==i.TOPSTART.indexOf(u)?f=-1:d=-1,[d,f]),v=[o(e,t,[-y[0],-y[1]])],x=e.z.length,b=e.z[0].length,_=t.slice(),w=y.slice();for(p=0;p<1e4;p++){if(g>20?(g=i.CHOOSESADDLE[g][0>(y[0]||y[1])?0:1],e.crossings[m]=i.SADDLEREMAINDER[g]):delete e.crossings[m],!(y=i.NEWDELTA[g])){r.log("Found bad marching index:",g,t,e.level);break}v.push(o(e,t,y)),t[0]+=y[0],t[1]+=y[1],m=t.join(","),n(v[v.length-1],v[v.length-2],s,l)&&v.pop();var T=y[0]&&(t[0]<0||t[0]>b-2)||y[1]&&(t[1]<0||t[1]>x-2);if(t[0]===_[0]&&t[1]===_[1]&&y[0]===w[0]&&y[1]===w[1]||a&&T)break;g=e.crossings[m]}1e4===p&&r.log("Infinite loop in contour?");var A,M,k,S,E,D,C,I,L,P,z,F=n(v[0],v[v.length-1],s,l),O=0,R=.2*e.smoothing,B=[],j=0;for(p=1;p=j;p--)if((A=B[p])=j&&A+B[M]I&&L--,e.edgepaths[L]=z.concat(v,P));break}q||(e.edgepaths[I]=v.concat(P))}for(I=0;I":o(">"),"<":o("<"),"=":o("=")}}}),oU=m({"src/traces/contour/empty_pathinfo.js"(e,t){var r=tb(),i=oV(),n=oO();t.exports=function(e,t,a){for(var o="constraint"===e.type?i[e._operation](e.value):e,s=o.size,l=[],u=n(o),c=a.trace._carpetTrace,h=c?{xaxis:c.aaxis,yaxis:c.baxis,x:a.a,y:a.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:a.x,y:a.y},d=o.start;d1e3){r.warn("Too many contours, clipping at 1000",e);break}return l}}}),oq=m({"src/traces/contour/convert_to_constraints.js"(e,t){var r=tb();function i(e){return r.extendFlat({},e,{edgepaths:r.extendDeep([],e.edgepaths),paths:r.extendDeep([],e.paths),starts:r.extendDeep([],e.starts)})}t.exports=function(e,t){var n,a,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&r.warn("Contour data invalid for the specified inequality operation."),a=e[0],n=0;no.level||o.starts.length&&a===o.level)}break;case"constraint":if(i.prefixBoundary=!1,i.edgepaths.length)return;var s=i.x.length,l=i.y.length,u=-1/0,c=1/0;for(r=0;r":f>u&&(i.prefixBoundary=!0);break;case"<":(fu||i.starts.length&&d===c)&&(i.prefixBoundary=!0);break;case"][":h=Math.min(f[0],f[1]),d=Math.max(f[0],f[1]),hu&&(i.prefixBoundary=!0)}}}}}),oH=m({"src/traces/contour/plot.js"(e){var t=M(),r=tb(),i=rt(),n=t4(),a=tj(),o=ro(),s=ri(),l=os(),u=oj(),c=oN(),h=oU(),d=oq(),f=oG(),p=oB(),m=p.LABELOPTIMIZER;function g(e,t){var n,a,o,s,l,u,c="",h=0,d=e.edgepaths.map(function(e,t){return t}),f=!0;function p(e){return .01>Math.abs(e[0]-t[2][0])}for(;d.length;){for(u=i.smoothopen(e.edgepaths[h],e.smoothing),c+=f?u:u.replace(/^M/,"L"),d.splice(d.indexOf(h),1),n=e.edgepaths[h][e.edgepaths[h].length-1],s=-1,o=0;o<4;o++){if(!n){r.log("Missing end?",h,e);break}for(.01>Math.abs(n[1]-t[0][1])&&!p(n)?a=t[1]:.01>Math.abs(n[0]-t[0][0])?a=t[0]:.01>Math.abs(n[1]-t[2][1])?a=t[3]:p(n)&&(a=t[2]),l=0;lMath.abs(n[0]-a[0])?.01>Math.abs(n[0]-m[0])&&(m[1]-n[1])*(a[1]-m[1])>=0&&(a=m,s=l):.01>Math.abs(n[1]-a[1])?.01>Math.abs(n[1]-m[1])&&(m[0]-n[0])*(a[0]-m[0])>=0&&(a=m,s=l):r.log("endpt to newendpt is not vert. or horz.",n,a,m)}if(n=a,s>=0)break;c+="L"+a}if(s===e.edgepaths.length){r.log("unclosed perimeter path");break}h=s,(f=-1===d.indexOf(h))&&(h=d[0],c+="Z")}for(h=0;hn.center?n.right-s:s-n.left)/(c+Math.abs(Math.sin(u)*o)),f=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(h)+Math.cos(u)*o);if(d<1||f<1)return 1/0;var p=m.EDGECOST*(1/(d-1)+1/(f-1));p+=m.ANGLECOST*u*u;for(var g=s-c,y=l-h,v=s+c,x=l+h,b=0;b2*m.MAXCOST)break;f&&(s/=2),l=(o=u-s/2)+1.5*s}if(d<=m.MAXCOST)return c},e.addLabelData=function(e,t,r,i){var n=t.fontSize,a=t.width+n/3,o=Math.max(0,t.height-n/3),s=e.x,l=e.y,u=e.theta,c=Math.sin(u),h=Math.cos(u),d=function(e,t){return[s+e*h-t*c,l+e*c+t*h]},f=[d(-a/2,-o/2),d(-a/2,o/2),d(a/2,o/2),d(a/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:u,level:t.level,width:a,height:o}),i.push(f)},e.drawLabels=function(e,i,n,o,s){var l=e.selectAll("text").data(i,function(e){return e.text+","+e.x+","+e.y+","+e.theta});if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(e){var r=e.x+Math.sin(e.theta)*e.dy,i=e.y-Math.cos(e.theta)*e.dy;t.select(this).text(e.text).attr({x:r,y:i,transform:"rotate("+180*e.theta/Math.PI+" "+r+" "+i+")"}).call(a.convertToTspans,n)}),s){for(var u="",c=0;c=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,u=0),d=0;dy&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]2?p.value=p.value.slice(2):0===p.length?p.value=[0,1]:p.length<2?(m=parseFloat(p.value[0]),p.value=[m,m+1]):p.value=[parseFloat(p.value[0]),parseFloat(p.value[1])]:r(p.value)&&(m=parseFloat(p.value),p.value=[m,m+1])):(f("contours.value",0),r(p.value)||(l(p.value)?p.value=parseFloat(p.value[0]):p.value=0)),"="===b?g=x.showlines=!0:(g=n("contours.showlines"),v=n("fillcolor",a((e.line||{}).color||h,.5))),g&&(y=n("line.color",v&&o(v)?a(t.fillcolor,1):h),n("line.width",2),n("line.dash")),n("line.smoothing"),i(n,s,y,d)}}}),oQ=m({"src/traces/contour/defaults.js"(e,t){var r=tb(),i=aQ(),n=iq(),a=oJ(),o=oI(),s=oP(),l=a0(),u=oD();t.exports=function(e,t,c,h){function d(i,n){return r.coerce(e,t,u,i,n)}if(!i(e,t,d,h)){t.visible=!1;return}n(e,t,h,d),d("xhoverformat"),d("yhoverformat"),d("text"),d("hovertext"),d("hoverongaps"),d("hovertemplate"),d("hovertemplatefallback");var f="constraint"===d("contours.type");d("connectgaps",r.isArray1D(t.z)),f?a(e,t,d,h,c):(o(e,t,d,function(i){return r.coerce2(e,t,u,i)}),s(e,t,d,h)),t.contours&&"heatmap"===t.contours.coloring&&l(d,h),d("zorder")}}}),o0=m({"src/traces/contour/index.js"(e,t){t.exports={attributes:oD(),supplyDefaults:oQ(),calc:oR(),plot:oH().plot,style:oW(),colorbar:oY(),hoverPoints:oZ(),moduleType:"trace",name:"contour",basePlotModule:ng(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),o1=m({"lib/contour.js"(e,t){t.exports=o0()}}),o2=m({"src/traces/scatterternary/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:i,templatefallbackAttrs:n}=eY(),a=ib(),o=i_(),s=X(),l=tG(),u=e$().dash,c=H().extendFlat,h=o.marker,d=o.line,f=h.line;t.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},o.mode,{dflt:"markers"}),text:c({},o.text,{}),texttemplate:i({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:n({editType:"plot"}),hovertext:c({},o.hovertext,{}),line:{color:d.color,width:d.width,dash:u,backoff:d.backoff,shape:c({},d.shape,{values:["linear","spline"]}),smoothing:d.smoothing,editType:"calc"},connectgaps:o.connectgaps,cliponaxis:o.cliponaxis,fill:c({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a(),marker:c({symbol:h.symbol,opacity:h.opacity,angle:h.angle,angleref:h.angleref,standoff:h.standoff,maxdisplayed:h.maxdisplayed,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,line:c({width:f.width,dash:f.dash,editType:"calc"},l("marker.line")),gradient:h.gradient,editType:"calc"},l("marker")),textfont:o.textfont,textposition:o.textposition,selected:o.selected,unselected:o.unselected,hoverinfo:c({},s.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:o.hoveron,hovertemplate:r(),hovertemplatefallback:n()}}}),o3=m({"src/traces/scatterternary/defaults.js"(e,t){var r=tb(),i=ix(),n=t6(),a=iH(),o=i$(),s=iW(),l=iY(),u=iZ(),c=o2();t.exports=function(e,t,h,d){function f(i,n){return r.coerce(e,t,c,i,n)}var p,m=f("a"),g=f("b"),y=f("c");if(m?(p=m.length,g?(p=Math.min(p,g.length),y&&(p=Math.min(p,y.length))):p=y?Math.min(p,y.length):0):g&&y&&(p=Math.min(g.length,y.length)),!p){t.visible=!1;return}t._length=p,f("sum"),f("text"),f("hovertext"),"fills"!==t.hoveron&&(f("hovertemplate"),f("hovertemplatefallback")),f("mode",p"),o.hovertemplate=d.hovertemplate,a}function x(e,t){y.push(e._hovertitle+": "+t)}}}}),o7=m({"src/traces/scatterternary/event_data.js"(e,t){t.exports=function(e,t,r,i,n){if(t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),i[n]){var a=i[n];e.a=a.a,e.b=a.b,e.c=a.c}else e.a=t.a,e.b=t.b,e.c=t.c;return e}}}),o9=m({"src/plots/ternary/ternary.js"(e,t){var r=M(),i=e1(),n=tb(),a=n.strTranslate,o=n._,s=er(),l=rt(),u=ri(),c=H().extendFlat,h=tO(),d=ro(),f=rp(),p=rO(),m=rR(),g=m.freeMode,y=m.rectMode,v=rr(),x=ik().prepSelect,b=ik().selectOnClick,_=ik().clearOutline,w=ik().clearSelectionsCache,T=tC();function A(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.updateFx(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=A;var k=A.prototype;k.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},k.plot=function(e,t){var r=t[this.id],i=t._size;this._hasClipOnAxisFalse=!1;for(var n=0;nS*b?n=(o=b)*S:o=(n=x)/S,h=y*n/x,d=v*o/b,r=t.l+t.w*m-n/2,i=t.t+t.h*(1-g)-o/2,f.x0=r,f.y0=i,f.w=n,f.h=o,f.sum=_,f.xaxis={type:"linear",range:[w+2*A-_,_-w-2*T],domain:[m-h/2,m+h/2],_id:"x"},u(f.xaxis,f.graphDiv._fullLayout),f.xaxis.setScale(),f.xaxis.isPtWithinRange=function(e){return e.a>=f.aaxis.range[0]&&e.a<=f.aaxis.range[1]&&e.b>=f.baxis.range[1]&&e.b<=f.baxis.range[0]&&e.c>=f.caxis.range[1]&&e.c<=f.caxis.range[0]},f.yaxis={type:"linear",range:[w,_-T-A],domain:[g-d/2,g+d/2],_id:"y"},u(f.yaxis,f.graphDiv._fullLayout),f.yaxis.setScale(),f.yaxis.isPtWithinRange=function(){return!0};var M=f.yaxis.domain[0],k=f.aaxis=c({},e.aaxis,{range:[w,_-T-A],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[M,M+d*S],anchor:"free",position:0,_id:"y",_length:n});u(k,f.graphDiv._fullLayout),k.setScale();var E=f.baxis=c({},e.baxis,{range:[_-w-A,T],side:"bottom",domain:f.xaxis.domain,anchor:"free",position:0,_id:"x",_length:n});u(E,f.graphDiv._fullLayout),E.setScale();var D=f.caxis=c({},e.caxis,{range:[_-w-T,A],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[M,M+d*S],anchor:"free",position:0,_id:"y",_length:n});u(D,f.graphDiv._fullLayout),D.setScale();var C="M"+r+","+(i+o)+"h"+n+"l-"+n/2+",-"+o+"Z";f.clipDef.select("path").attr("d",C),f.layers.plotbg.select("path").attr("d",C);var I="M0,"+o+"h"+n+"l-"+n/2+",-"+o+"Z";f.clipDefRelative.select("path").attr("d",I);var L=a(r,i);f.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",L),f.clipDefRelative.select("path").attr("transform",null);var P=a(r-E._offset,i+o);f.layers.baxis.attr("transform",P),f.layers.bgrid.attr("transform",P);var z=a(r+n/2,i)+"rotate(30)"+a(0,-k._offset);f.layers.aaxis.attr("transform",z),f.layers.agrid.attr("transform",z);var F=a(r+n/2,i)+"rotate(-30)"+a(0,-D._offset);f.layers.caxis.attr("transform",F),f.layers.cgrid.attr("transform",F),f.drawAxes(!0),f.layers.aline.select("path").attr("d",k.showline?"M"+r+","+(i+o)+"l"+n/2+",-"+o:"M0,0").call(s.stroke,k.linecolor||"#000").style("stroke-width",(k.linewidth||0)+"px"),f.layers.bline.select("path").attr("d",E.showline?"M"+r+","+(i+o)+"h"+n:"M0,0").call(s.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),f.layers.cline.select("path").attr("d",D.showline?"M"+(r+n/2)+","+i+"l"+n/2+","+o:"M0,0").call(s.stroke,D.linecolor||"#000").style("stroke-width",(D.linewidth||0)+"px"),f.graphDiv._context.staticPlot||f.initInteractions(),l.setClipUrl(f.layers.frontplot,f._hasClipOnAxisFalse?null:f.clipId,f.graphDiv)},k.drawAxes=function(e){var t=this.graphDiv,r=this.id.slice(7)+"title",i=this.layers,n=this.aaxis,a=this.baxis,s=this.caxis;if(this.drawAx(n),this.drawAx(a),this.drawAx(s),e){var l=Math.max(n.showticklabels?n.tickfont.size/2:0,(s.showticklabels?.75*s.tickfont.size:0)+("outside"===s.ticks?.87*s.ticklen:0)),u=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;i["a-title"]=v.draw(t,"a"+r,{propContainer:n,propName:this.id+".aaxis.title.text",placeholder:o(t,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.title.font.size/3-l,"text-anchor":"middle"}}),i["b-title"]=v.draw(t,"b"+r,{propContainer:a,propName:this.id+".baxis.title.text",placeholder:o(t,"Click to enter Component B title"),attributes:{x:this.x0-u,y:this.y0+this.h+.83*a.title.font.size+u,"text-anchor":"middle"}}),i["c-title"]=v.draw(t,"c"+r,{propContainer:s,propName:this.id+".caxis.title.text",placeholder:o(t,"Click to enter Component C title"),attributes:{x:this.x0+this.w+u,y:this.y0+this.h+.83*s.title.font.size+u,"text-anchor":"middle"}})}},k.drawAx=function(e){var t,r=this.graphDiv,i=e._name,a=i.charAt(0),o=e._id,s=this.layers[i],l=a+"tickLayout",u=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);this[l]!==u&&(s.selectAll("."+o+"tick").remove(),this[l]=u),e.setScale();var c=d.calcTicks(e),h=d.clipEnds(e,c),f=d.makeTransTickFn(e),p=d.getTickSigns(e)[2],m=n.deg2rad(30),g=p*(e.linewidth||1)/2,y=p*e.ticklen,v=this.w,x=this.h,b="b"===a?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,_={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[a];d.drawTicks(r,e,{vals:"inside"===e.ticks?h:c,layer:s,path:b,transFn:f,crisp:!1}),d.drawGrid(r,e,{vals:h,layer:this.layers[a+"grid"],path:_,transFn:f,crisp:!1}),d.drawLabels(r,e,{vals:c,layer:s,transFn:f,labelFns:d.makeLabelFns(e,0,30)})};var E=T.MINZOOM/2+.87,D="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",C="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",I="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",L=!0;function P(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}k.clearOutline=function(){w(this.dragOptions),_(this.dragOptions.gd)},k.initInteractions=function(){var e,t,r,u,c,h,d,m,v,_,w,A,M=this,k=M.layers.plotbg.select("path").node(),E=M.graphDiv,z=E._fullLayout._zoomlayer;function F(e){var t={};return t[M.id+".aaxis.min"]=e.a,t[M.id+".baxis.min"]=e.b,t[M.id+".caxis.min"]=e.c,t}function O(e,t){var r=E._fullLayout.clickmode;P(E),2===e&&(E.emit("plotly_doubleclick",null),i.call("_guiRelayout",E,F({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&b(t,E,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&p.click(E,t,M.id)}this.dragOptions={element:k,gd:E,plotinfo:{id:M.id,domain:E._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(i,o,l){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],w=E._fullLayout._invScaleX,A=E._fullLayout._invScaleY;var f,p,b,T,S,D=M.dragOptions.dragmode=E._fullLayout.dragmode;g(D)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===D?(M.dragOptions.moveFn=j,M.dragOptions.clickFn=O,M.dragOptions.doneFn=N,f=o,p=l,e=f-(b=k.getBoundingClientRect()).left,t=p-b.top,E._fullLayout._calcInverseTransform(E),T=E._fullLayout._invTransform,e=(S=n.apply3DTransform(T)(e,t))[0],t=S[1],c=r={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},u=M.aaxis.range[1]-r.a,h=s.luminosity(M.graphDiv._fullLayout[M.id].bgcolor),d="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",m=!1,v=z.append("path").attr("class","zoombox").attr("transform",a(M.x0,M.y0)).style({fill:h>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",d),_=z.append("path").attr("class","zoombox-corners").attr("transform",a(M.x0,M.y0)).style({fill:s.background,stroke:s.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(E)):"pan"===D?(M.dragOptions.moveFn=V,M.dragOptions.clickFn=O,M.dragOptions.doneFn=U,c=r={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},M.clearOutline(E)):(y(D)||g(D))&&x(i,o,l,M.dragOptions,D)}};function R(e,t){return 1-(e+(M.h-t)/Math.sqrt(3))/M.w}function B(e,t){return(e-(M.h-t)/Math.sqrt(3))/M.w}function j(i,n){var a=e+i*w,o=t+n*A,s=Math.max(0,Math.min(1,1-t/M.h,1-o/M.h)),l=Math.max(0,Math.min(1,R(e,t),R(a,o))),f=Math.max(0,Math.min(1,B(e,t),B(a,o))),p=(s/2+f)*M.w,g=(1-s/2-l)*M.w,y=(p+g)/2,x=g-p,b=(1-s)*M.h,k=b-x/S;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),_.transition().style("opacity",1).duration(200),m=!0),E.emit("plotly_relayouting",F(c))}function N(){P(E),c!==r&&(i.call("_guiRelayout",E,F(c)),L&&E.data&&E._context.showTips&&(n.notifier(o(E,"Double-click to zoom back out"),"long",E),L=!1))}function V(e,t){var i=e/M.xaxis._m,o=t/M.yaxis._m,s=[(c={a:r.a-o,b:r.b+(i+o)/2,c:r.c-(i-o)/2}).a,c.b,c.c].sort(n.sorterAsc),u={a:s.indexOf(c.a),b:s.indexOf(c.b),c:s.indexOf(c.c)};s[0]<0&&(s[1]+s[0]/2<0?(s[2]+=s[0]+s[1],s[0]=s[1]=0):(s[2]+=s[0]/2,s[1]+=s[0]/2,s[0]=0),c={a:s[u.a],b:s[u.b],c:s[u.c]},t=(r.a-c.a)*M.yaxis._m,e=(r.c-c.c-r.b+c.b)*M.xaxis._m);var h=a(M.x0+e,M.y0+t);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var d=a(-e,-t);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[c.a,M.sum-c.b-c.c],M.baxis.range=[M.sum-c.a-c.c,c.b],M.caxis.range=[M.sum-c.a-c.b,c.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(l.hideOutsideRangePoints,M),E.emit("plotly_relayouting",F(c))}function U(){i.call("_guiRelayout",E,F(c))}k.onmousemove=function(e){p.hover(E,e,M.id),E._fullLayout._lasthover=k,E._fullLayout._hoversubplot=M.id},k.onmouseout=function(e){E._dragging||f.unhover(E,e)},f.init(this.dragOptions)}}}),se=m({"src/plots/ternary/layout_attributes.js"(e,t){var r=et(),i=ai().attributes,n=tU(),a=eH().overrideAll,o=H().extendFlat,s={title:{text:n.title.text,font:n.title.font},color:n.color,tickmode:n.minor.tickmode,nticks:o({},n.nticks,{dflt:6,min:1}),tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,ticklabelstep:n.ticklabelstep,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:o({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:o({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash,layer:n.layer,min:{valType:"number",dflt:0,min:0}},l=t.exports=a({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}}),st=m({"src/plots/subplot_defaults.js"(e,t){var r=tb(),i=tD(),n=ai().defaults;t.exports=function(e,t,a,o){var s,l,u=o.type,c=o.attributes,h=o.handleDefaults,d=o.partition||"x",f=t._subplots[u],p=f.length,m=p&&f[0].replace(/\d+$/,"");function g(e,t){return r.coerce(s,l,c,e,t)}for(var y=0;y=m&&(b.min=0,_.min=0,w.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}t.exports=function(e,t,r){a(e,t,r,{type:"ternary",attributes:h,handleDefaults:f,font:t.font,paper_bgcolor:t.paper_bgcolor})}}}),si=m({"src/plots/ternary/index.js"(e){var t=o9(),r=tz().getSubplotCalcData,i=tb().counterRegex,n="ternary";e.name=n;var a=e.attr="subplot";e.idRoot=n,e.idRegex=e.attrRegex=i(n),(e.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},e.layoutAttributes=se(),e.supplyLayoutDefaults=sr(),e.plot=function(e){for(var i=e._fullLayout,a=e.calcdata,o=i._subplots[n],s=0;s0){var b,_,w,T,A,M=e.xa,k=e.ya;"h"===p.orientation?(A=t,b="y",w=k,_="x",T=M):(A=s,b="x",w=M,_="y",T=k);var S=f[e.index];if(A>=S.span[0]&&A<=S.span[1]){var E=i.extendFlat({},e),D=T.c2p(A,!0),C=o.getKdeValue(S,p,A),I=o.getPositionOnKdePath(S,p,D),L=w._offset,P=w._length;E[b+"0"]=I[0],E[b+"1"]=I[1],E[_+"0"]=E[_+"1"]=D,E[_+"Label"]=_+": "+n.hoverLabelText(T,A,p[_+"hoverformat"])+", "+f[0].t.labels.kde+" "+C.toFixed(3);for(var z=0,F=0;F path").each(function(e){if(!e.isBlank){var t=s.marker;r.select(this).call(n.fill,e.mc||t.color).call(n.stroke,e.mlc||t.line.color).call(i.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?a:1)}}),l(o,s,e),o.selectAll(".regions").each(function(){r.select(this).selectAll("path").style("stroke-width",0).call(n.fill,s.connector.fillcolor)}),o.selectAll(".lines").each(function(){var e=s.connector.line;i.lineGroupStyle(r.select(this).selectAll("path"),e.width,e.color,e.dash)})})}}}}),sE=m({"src/traces/funnel/hover.js"(e,t){var r=er().opacity,i=az().hoverOnBars,n=tb().formatPercent;t.exports=function(e,t,a,o,s){var l=i(e,t,a,o,s);if(l){var u,c,h,d,f,p,m=l.cd,g=m[0].trace,y="h"===g.orientation,v=m[l.index];l[(y?"x":"y")+"LabelVal"]=v.s,l.percentInitial=v.begR,l.percentInitialLabel=n(v.begR,1),l.percentPrevious=v.difR,l.percentPreviousLabel=n(v.difR,1),l.percentTotal=v.sumR,l.percentTotalLabel=n(v.sumR,1);var x=v.hi||g.hoverinfo,b=[];if(x&&"none"!==x&&"skip"!==x){var _="all"===x,w=x.split("+"),T=function(e){return _||-1!==w.indexOf(e)};T("percent initial")&&b.push(l.percentInitialLabel+" of initial"),T("percent previous")&&b.push(l.percentPreviousLabel+" of previous"),T("percent total")&&b.push(l.percentTotalLabel+" of total")}return l.extraText=b.join("
"),u=g,c=v,h=u.marker,d=c.mc||h.color,f=c.mlc||h.line.color,p=c.mlw||h.line.width,l.color=r(d)?d:r(f)&&p?f:void 0,[l]}}}}),sD=m({"src/traces/funnel/event_data.js"(e,t){t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"percentInitial"in t&&(e.percentInitial=t.percentInitial),"percentPrevious"in t&&(e.percentPrevious=t.percentPrevious),"percentTotal"in t&&(e.percentTotal=t.percentTotal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}}),sC=m({"src/traces/funnel/index.js"(e,t){t.exports={attributes:sx(),layoutAttributes:sb(),supplyDefaults:s_().supplyDefaults,crossTraceDefaults:s_().crossTraceDefaults,supplyLayoutDefaults:sw(),calc:sA(),crossTraceCalc:sM(),plot:sk(),style:sS().style,hoverPoints:sE(),eventData:sD(),selectPoints:aO(),moduleType:"trace",name:"funnel",basePlotModule:ng(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),sI=m({"lib/funnel.js"(e,t){t.exports=sC()}}),sL=m({"src/traces/waterfall/constants.js"(e,t){t.exports={eventDataKeys:["initial","delta","final"]}}}),sP=m({"src/traces/waterfall/attributes.js"(e,t){var r=aT(),i=i_().line,n=X(),a=tV().axisHoverFormat,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=eY(),u=sL(),c=H().extendFlat,h=er();function d(e){return{marker:{color:c({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},r.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}t.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:u.eventDataKeys}),hovertemplatefallback:l(),hoverinfo:c({},n.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:u.eventDataKeys.concat(["label"])}),texttemplatefallback:l({editType:"plot"}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:d("increasing"),decreasing:d("decreasing"),totals:d("intermediate sums and total"),connector:{line:{color:c({},i.color,{dflt:h.defaultLine}),width:c({},i.width,{editType:"plot"}),dash:i.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),sz=m({"src/traces/waterfall/layout_attributes.js"(e,t){t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),sF=m({"src/constants/delta.js"(e,t){t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),sO=m({"src/traces/waterfall/defaults.js"(e,t){var r=tb(),i=iK(),n=ak().handleText,a=iU(),o=iq(),s=sP(),l=er(),u=sF(),c=u.INCREASING.COLOR,h=u.DECREASING.COLOR;function d(e,t,r){e(t+".marker.color",r),e(t+".marker.line.color",l.defaultLine),e(t+".marker.line.width")}t.exports={supplyDefaults:function(e,t,i,l){function u(i,n){return r.coerce(e,t,s,i,n)}if(!a(e,t,l,u)){t.visible=!1;return}o(e,t,l,u),u("xhoverformat"),u("yhoverformat"),u("measure"),u("orientation",t.x&&!t.y?"h":"v"),u("base"),u("offset"),u("width"),u("text"),u("hovertext"),u("hovertemplate"),u("hovertemplatefallback");var f=u("textposition");n(e,t,l,u,f,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==t.textposition&&(u("texttemplate"),u("texttemplatefallback"),t.texttemplate||u("textinfo")),d(u,"increasing",c),d(u,"decreasing",h),d(u,"totals","#4499FF"),u("connector.visible")&&(u("connector.mode"),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash"))),u("zorder")},crossTraceDefaults:function(e,t){var n;function a(e){return r.coerce(n._input,n,s,e)}if("group"===t.waterfallmode)for(var o=0;o0&&(l?A+="M"+w[0]+","+T[1]+"V"+T[0]:A+="M"+w[1]+","+T[0]+"H"+w[0]),"between"!==u&&(e.isSum||t path").each(function(e){if(!e.isBlank){var t=s[e.dir].marker;r.select(this).call(n.fill,t.color).call(n.stroke,t.line.color).call(i.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?a:1)}}),l(o,s,e),o.selectAll(".lines").each(function(){var e=s.connector.line;i.lineGroupStyle(r.select(this).selectAll("path"),e.width,e.color,e.dash)})})}}}}),sU=m({"src/traces/waterfall/hover.js"(e,t){var r=ro().hoverLabelText,i=er().opacity,n=az().hoverOnBars,a=sF(),o={increasing:a.INCREASING.SYMBOL,decreasing:a.DECREASING.SYMBOL};t.exports=function(e,t,a,s,l){var u=n(e,t,a,s,l);if(u){var c,h,d,f,p=u.cd,m=p[0].trace,g="h"===m.orientation,y=g?"x":"y",v=g?e.xa:e.ya,x=p[u.index],b=x.isSum?x.b+x.s:x.rawS;u.initial=x.b+x.s-b,u.delta=b,u.final=u.initial+u.delta;var _=S(Math.abs(u.delta));u.deltaLabel=b<0?"("+_+")":_,u.finalLabel=S(u.final),u.initialLabel=S(u.initial);var w=x.hi||m.hoverinfo,T=[];if(w&&"none"!==w&&"skip"!==w){var A="all"===w,M=w.split("+"),k=function(e){return A||-1!==M.indexOf(e)};x.isSum||(!k("final")||k(g?"x":"y")||T.push(u.finalLabel),k("delta")&&(b<0?T.push(u.deltaLabel+" "+o.decreasing):T.push(u.deltaLabel+" "+o.increasing)),k("initial")&&T.push("Initial: "+u.initialLabel))}return T.length&&(u.extraText=T.join("
")),h=(c=m[x.dir].marker).color,d=c.line.color,f=c.line.width,u.color=i(h)?h:i(d)&&f?d:void 0,[u]}function S(e){return r(v,e,m[y+"hoverformat"])}}}}),sq=m({"src/traces/waterfall/event_data.js"(e,t){t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"initial"in t&&(e.initial=t.initial),"delta"in t&&(e.delta=t.delta),"final"in t&&(e.final=t.final),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}}),sG=m({"src/traces/waterfall/index.js"(e,t){t.exports={attributes:sP(),layoutAttributes:sz(),supplyDefaults:sO().supplyDefaults,crossTraceDefaults:sO().crossTraceDefaults,supplyLayoutDefaults:sR(),calc:sB(),crossTraceCalc:sj(),plot:sN(),style:sV().style,hoverPoints:sU(),eventData:sq(),selectPoints:aO(),moduleType:"trace",name:"waterfall",basePlotModule:ng(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),sH=m({"lib/waterfall.js"(e,t){t.exports=sG()}}),s$=m({"src/traces/image/constants.js"(e,t){t.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(e){return e.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(e){var t=e.slice(0,3);return t[1]=t[1]+"%",t[2]=t[2]+"%",t},suffix:["\xb0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(e){var t=e.slice(0,4);return t[1]=t[1]+"%",t[2]=t[2]+"%",t},suffix:["\xb0","%","%",""]}}}}}),sW={};g(sW,{default:()=>s2});var sY,sZ,sX,sK,sJ,sQ,s0,s1,s2,s3=p({"src/traces/image/attributes.ts"(){for(let e of(sY=v(H()),sZ=v(X()),sX=v(eY()),sK=v(i_()),sJ=v(s$()),s0=[],s1=[],sQ=["rgb","rgba","rgba256","hsl","hsla"])){let t=sJ.colormodel[e];s0.push(`For the \`${e}\` colormodel, it is [${(t.zminDflt||t.min).join(", ")}].`),s1.push(`For the \`${e}\` colormodel, it is [${(t.zmaxDflt||t.max).join(", ")}].`)}s2={source:{valType:"string",editType:"calc",description:'Specifies the data URI of the image to be visualized. The URI consists of "data:image/[][;base64\\\\],"'},z:{valType:"data_array",editType:"calc",description:"A 2-dimensional array in which each element is an array of 3 or 4 numbers representing a color."},colormodel:{valType:"enumerated",values:sQ,editType:"calc",description:"Color model used to map the numerical color components described in `z` into colors. If `source` is specified, this attribute will be set to `rgba256` otherwise it defaults to `rgb`."},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot",description:"Picks a smoothing algorithm used to smooth `z` data. This only applies for image traces that use the `source` attribute."},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["Array defining the lower bound for each color component. Note that the default value will depend on the colormodel.",s0.join(" ")].join(" ")},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["Array defining the higher bound for each color component. Note that the default value will depend on the colormodel.",s1.join(" ")].join(" ")},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",description:"Set the image's x position. The left edge of the image (or the right edge if the x axis is reversed or dx is negative) will be found at xmin=x0-dx/2"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",description:"Set the image's y position. The top edge of the image (or the bottom edge if the y axis is NOT reversed or if dy is negative) will be found at ymin=y0-dy/2. By default when an image trace is included, the y axis will be reversed so that the image is right-side-up, but you can disable this by setting yaxis.autorange=true or by providing an explicit y axis range."},dx:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's horizontal size."},dy:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's vertical size"},text:{valType:"data_array",editType:"plot",description:"Sets the text elements associated with each z value."},hovertext:{valType:"data_array",editType:"plot",description:"Same as `text`."},hoverinfo:(0,sY.extendFlat)({},sZ.default.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:(0,sX.hovertemplateAttrs)({},{keys:["z","color","colormodel"]}),hovertemplatefallback:(0,sX.templatefallbackAttrs)(),zorder:sK.zorder}}}),s5=m({"src/traces/image/defaults.js"(e,t){var r=tb(),i=(s3(),x(sW)).default,n=s$(),a=iP().IMAGE_URL_PREFIX;t.exports=function(e,t){function o(n,a){return r.coerce(e,t,i,n,a)}o("source"),t.source&&!t.source.match(a)&&delete t.source,t._hasSource=!!t.source;var s,l=o("z");if(t._hasZ=!(void 0===l||!l.length||!l[0]||!l[0].length),!t._hasZ&&!t._hasSource){t.visible=!1;return}o("x0"),o("y0"),o("dx"),o("dy"),t._hasZ?(o("colormodel","rgb"),o("zmin",(s=n.colormodel[t.colormodel]).zminDflt||s.min),o("zmax",s.zmaxDflt||s.max)):t._hasSource&&(t.colormodel="rgba256",s=n.colormodel[t.colormodel],t.zmin=s.zminDflt,t.zmax=s.zmaxDflt),o("zsmooth"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),t._length=null,o("zorder")}}}),s4=m({"node_modules/inherits/inherits_browser.js"(e,t){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}}),s6=m({"node_modules/readable-stream/lib/internal/streams/stream-browser.js"(e,t){t.exports=tA().EventEmitter}}),s8=m({"node_modules/base64-js/index.js"(e){e.byteLength=function(e){var t=s(e),r=t[0],i=t[1];return(r+i)*3/4-i},e.toByteArray=function(e){var t,r,i=s(e),o=i[0],l=i[1],u=new a((o+l)*3/4-l),c=0,h=l>0?o-4:o;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},e.fromByteArray=function(e){for(var t,r=e.length,n=r%3,a=[],o=0,s=r-n;o>18&63]+i[n>>12&63]+i[n>>6&63]+i[63&n]);return a.join("")}(e,o,o+16383>s?s:o+16383));return 1===n?a.push(i[(t=e[r-1])>>2]+i[t<<4&63]+"=="):2===n&&a.push(i[(t=(e[r-2]<<8)+e[r-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),a.join("")};var t,r,i=[],n=[],a="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,r=o.length;t0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}n[45]=62,n[95]=63}}),s7=m({"node_modules/ieee754/index.js"(e){e.read=function(e,t,r,i,n){var a,o,s=8*n-i-1,l=(1<>1,c=-7,h=r?n-1:0,d=r?-1:1,f=e[t+h];for(h+=d,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+h],h+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=i;c>0;o=256*o+e[t+h],h+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?0/0:(f?-1:1)*2e308;o+=Math.pow(2,i),a-=u}return(f?-1:1)*o*Math.pow(2,a-i)},e.write=function(e,t,r,i,n,a){var o,s,l,u=8*a-n-1,c=(1<>1,d=5960464477539062e-23*(23===n),f=i?0:a-1,p=i?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(s=+!!isNaN(t),o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?t+=d/l:t+=d*Math.pow(2,1-h),t*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(t*l-1)*Math.pow(2,n),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;e[r+f]=255&s,f+=p,s/=256,n-=8);for(o=o<0;e[r+f]=255&o,f+=p,o/=256,u-=8);e[r+f-p]|=128*m}}}),s9=m({"node_modules/buffer/index.js"(e){var t=s8(),r=s7(),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function n(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return o(e,t,r)}function o(e,t,r){if("string"==typeof e){var i=e,o=t;if(("string"!=typeof o||""===o)&&(o="utf8"),!a.isEncoding(o))throw TypeError("Unknown encoding: "+o);let r=0|d(i,o),s=n(r),l=s.write(i,o);return l!==r&&(s=s.slice(0,l)),s}if(ArrayBuffer.isView(e)){var s=e;if(F(s,Uint8Array)){let e=new Uint8Array(s);return c(e.buffer,e.byteOffset,e.byteLength)}return u(s)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(F(e,ArrayBuffer)||e&&F(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(F(e,SharedArrayBuffer)||e&&F(e.buffer,SharedArrayBuffer)))return c(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let l=e.valueOf&&e.valueOf();if(null!=l&&l!==e)return a.from(l,t,r);let f=function(e){if(a.isBuffer(e)){let t=0|h(e.length),r=n(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?n(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(f)return f;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return s(e),n(e<0?0:0|h(e))}function u(e){let t=e.length<0?0:0|h(e.length),r=n(t);for(let i=0;i=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(e).length;default:if(n)return i?-1:L(e).length;t=(""+t).toLowerCase(),n=!0}}function f(e,r,i){let n=!1;if((void 0===r||r<0)&&(r=0),r>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0)||(i>>>=0)<=(r>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return -1;r=e.length-1}else if(r<0)if(!n)return -1;else r=0;if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,n);throw TypeError("val must be string, number or Buffer")}function g(e,t,r,i,n){let a,o=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){let i=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let i=0;i239?4:t>223?3:t>191?2:1;if(n+o<=r){let r,i,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:(192&(r=e[n+1]))==128&&(l=(31&t)<<6|63&r)>127&&(a=l);break;case 3:r=e[n+1],i=e[n+2],(192&r)==128&&(192&i)==128&&(l=(15&t)<<12|(63&r)<<6|63&i)>2047&&(l<55296||l>57343)&&(a=l);break;case 4:r=e[n+1],i=e[n+2],s=e[n+3],(192&r)==128&&(192&i)==128&&(192&s)==128&&(l=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&s)>65535&&l<1114112&&(a=l)}}null===a?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),n+=o}var a=i;let o=a.length;if(o<=4096)return String.fromCharCode.apply(String,a);let s="",l=0;for(;lr)throw RangeError("Trying to access beyond buffer length")}function x(e,t,r,i,n,o){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw RangeError("Index out of range")}function b(e,t,r,i,n){E(t,i,n,e,r,7);let a=Number(t&BigInt(0xffffffff));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function _(e,t,r,i,n){E(t,i,n,e,r,7);let a=Number(t&BigInt(0xffffffff));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function w(e,t,r,i,n,a){if(r+i>e.length||r<0)throw RangeError("Index out of range")}function T(e,t,i,n,a){return t*=1,i>>>=0,a||w(e,t,i,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,i,n,23,4),i+4}function A(e,t,i,n,a){return t*=1,i>>>=0,a||w(e,t,i,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,i,n,52,8),i+8}e.Buffer=a,e.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return o(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return s(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)},a.allocUnsafe=function(e){return l(e)},a.allocUnsafeSlow=function(e){return l(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(F(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),F(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,a=Math.min(r,i);ni.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else if(a.isBuffer(t))t.copy(i,n);else throw TypeError('"list" argument must be an Array of Buffers');n+=t.length}return i},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(t+=" ... "),""},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(e,t,r,i,n){if(F(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;let o=n-i,s=r-t,l=Math.min(o,s),u=this.slice(i,n),c=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let f=!1;for(;;)switch(i){case"hex":return function(e,t,r,i){let n;r=Number(r)||0;let a=e.length-r;i?(i=Number(i))>a&&(i=a):i=a;let o=t.length;for(i>o/2&&(i=o/2),n=0;n>8,n.push(r%256),n.push(i);return n}(e,this.length-c),this,c,h);default:if(f)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||v(e,t,this.length);let i=this[e],n=1,a=0;for(;++a>>=0,t>>>=0,r||v(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=R(function(e){D(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&C(e,this.length-8);let i=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],n=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(i)+(BigInt(n)<>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&C(e,this.length-8);let i=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],n=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<>>=0,t>>>=0,r||v(e,t,this.length);let i=this[e],n=1,a=0;for(;++a=(n*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);let i=t,n=1,a=this[e+--i];for(;i>0&&(n*=256);)a+=this[e+--i]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=R(function(e){D(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&C(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&C(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<>>=0,t||v(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;x(this,e,t,r,i,0)}let n=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;x(this,e,t,r,i,0)}let n=r-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=R(function(e,t=0){return b(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=R(function(e,t=0){return _(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,r,i){if(e*=1,t>>>=0,!i){let i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=0,a=1,o=0;for(this[t]=255&e;++n>>=0,!i){let i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=r-1,a=1,o=0;for(this[t+n]=255&e;--n>=0&&(a*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/a|0)-o&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=R(function(e,t=0){return b(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=R(function(e,t=0){return _(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return A(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return A(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,i){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function E(e,t,r,i,n,a){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(a+1)*8}${i}`:`>= -(2${i} ** ${(a+1)*8-1}${i}) and < 2 ** ${(a+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new M.ERR_OUT_OF_RANGE("value",n,e)}D(n,"offset"),(void 0===i[n]||void 0===i[n+a])&&C(n,i.length-(a+1))}function D(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function C(e,t,r){throw Math.floor(e)!==e?(D(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}k("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),k("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),k("ERR_OUT_OF_RANGE",function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?n=S(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=S(n)),n+="n"),i+=` It must be ${t}. Received ${n}`},RangeError);var I=/[^+/0-9A-Za-z-_]/g;function L(e,t){t=t||1/0;let r,i=e.length,n=null,a=[];for(let o=0;o55295&&r<57344){if(!n){if(r>56319||o+1===i){(t-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function P(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,r,i){let n;for(n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var O=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function R(e){return typeof BigInt>"u"?B:e}function B(){throw Error("BigInt not supported")}}}),le=m({"node_modules/has-symbols/shams.js"(e,t){t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}}}),lt=m({"node_modules/has-tostringtag/shams.js"(e,t){var r=le();t.exports=function(){return r()&&!!Symbol.toStringTag}}}),lr=m({"node_modules/es-object-atoms/index.js"(e,t){t.exports=Object}}),li=m({"node_modules/es-errors/index.js"(e,t){t.exports=Error}}),ln=m({"node_modules/es-errors/eval.js"(e,t){t.exports=EvalError}}),la=m({"node_modules/es-errors/range.js"(e,t){t.exports=RangeError}}),lo=m({"node_modules/es-errors/ref.js"(e,t){t.exports=ReferenceError}}),ls=m({"node_modules/es-errors/syntax.js"(e,t){t.exports=SyntaxError}}),ll=m({"node_modules/es-errors/type.js"(e,t){t.exports=TypeError}}),lu=m({"node_modules/es-errors/uri.js"(e,t){t.exports=URIError}}),lc=m({"node_modules/math-intrinsics/abs.js"(e,t){t.exports=Math.abs}}),lh=m({"node_modules/math-intrinsics/floor.js"(e,t){t.exports=Math.floor}}),ld=m({"node_modules/math-intrinsics/max.js"(e,t){t.exports=Math.max}}),lf=m({"node_modules/math-intrinsics/min.js"(e,t){t.exports=Math.min}}),lp=m({"node_modules/math-intrinsics/pow.js"(e,t){t.exports=Math.pow}}),lm=m({"node_modules/math-intrinsics/round.js"(e,t){t.exports=Math.round}}),lg=m({"node_modules/math-intrinsics/isNaN.js"(e,t){t.exports=Number.isNaN||function(e){return e!=e}}}),ly=m({"node_modules/math-intrinsics/sign.js"(e,t){var r=lg();t.exports=function(e){return r(e)||0===e?e:e<0?-1:1}}}),lv=m({"node_modules/gopd/gOPD.js"(e,t){t.exports=Object.getOwnPropertyDescriptor}}),lx=m({"node_modules/gopd/index.js"(e,t){var r=lv();if(r)try{r([],"length")}catch{r=null}t.exports=r}}),lb=m({"node_modules/es-define-property/index.js"(e,t){var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}t.exports=r}}),l_=m({"node_modules/has-symbols/index.js"(e,t){var r="u">typeof Symbol&&Symbol,i=le();t.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&i()}}}),lw=m({"node_modules/get-proto/Reflect.getPrototypeOf.js"(e,t){t.exports="u">typeof Reflect&&Reflect.getPrototypeOf||null}}),lT=m({"node_modules/get-proto/Object.getPrototypeOf.js"(e,t){t.exports=lr().getPrototypeOf||null}}),lA=m({"node_modules/function-bind/implementation.js"(e,t){var r=Object.prototype.toString,i=Math.max,n=function(e,t){for(var r=[],i=0;itypeof Reflect&&Reflect&&Reflect.apply}}),lD=m({"node_modules/call-bind-apply-helpers/actualApply.js"(e,t){var r=lM(),i=lS(),n=lk();t.exports=lE()||r.call(n,i)}}),lC=m({"node_modules/call-bind-apply-helpers/index.js"(e,t){var r=lM(),i=ll(),n=lk(),a=lD();t.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return a(r,n,e)}}}),lI=m({"node_modules/dunder-proto/get.js"(e,t){var r,i=lC(),n=lx();try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!r&&n&&n(Object.prototype,"__proto__"),o=Object,s=o.getPrototypeOf;t.exports=a&&"function"==typeof a.get?i([a.get]):"function"==typeof s&&function(e){return s(null==e?e:o(e))}}}),lL=m({"node_modules/get-proto/index.js"(e,t){var r=lw(),i=lT(),n=lI();t.exports=r?function(e){return r(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("getProto: not an object");return i(e)}:n?function(e){return n(e)}:null}}),lP=m({"node_modules/hasown/index.js"(e,t){var r=Function.prototype.call,i=Object.prototype.hasOwnProperty;t.exports=lM().call(r,i)}}),lz=m({"node_modules/get-intrinsic/index.js"(e,t){var r,i=lr(),n=li(),a=ln(),o=la(),s=lo(),l=ls(),u=ll(),c=lu(),h=lc(),d=lh(),f=ld(),p=lf(),m=lp(),g=lm(),y=ly(),v=Function,x=function(e){try{return v('"use strict"; return ('+e+").constructor;")()}catch{}},b=lx(),_=lb(),w=function(){throw new u},T=b?function(){try{return arguments.callee,w}catch{try{return b(arguments,"callee").get}catch{return w}}}():w,A=l_()(),M=lL(),k=lT(),S=lw(),E=lS(),D=lk(),C={},I=typeof Uint8Array>"u"||!M?r:M(Uint8Array),L={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":A&&M?M([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&M?M(M([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":!(typeof Map>"u")&&A&&M?M(new Map()[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":!(typeof Set>"u")&&A&&M?M(new Set()[Symbol.iterator]()):r,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&M?M(""[Symbol.iterator]()):r,"%Symbol%":A?Symbol:r,"%SyntaxError%":l,"%ThrowTypeError%":T,"%TypedArray%":I,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":D,"%Function.prototype.apply%":E,"%Object.defineProperty%":_,"%Object.getPrototypeOf%":k,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":f,"%Math.min%":p,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":y,"%Reflect.getPrototypeOf%":S};if(M)try{null.error}catch(e){P=M(M(e)),L["%Error.prototype%"]=P}var P,z=function e(t){var r;if("%AsyncFunction%"===t)r=x("async function () {}");else if("%GeneratorFunction%"===t)r=x("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=x("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&M&&(r=M(n.prototype))}return L[t]=r,r},F={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=lM(),R=lP(),B=O.call(D,Array.prototype.concat),j=O.call(E,Array.prototype.splice),N=O.call(D,String.prototype.replace),V=O.call(D,String.prototype.slice),U=O.call(D,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,H=function(e){var t=V(e,0,1),r=V(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var i=[];return N(e,q,function(e,t,r,n){i[i.length]=r?N(n,G,"$1"):t||e}),i},$=function(e,t){var r,i=e;if(R(F,i)&&(i="%"+(r=F[i])[0]+"%"),R(L,i)){var n=L[i];if(n===C&&(n=z(i)),typeof n>"u"&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new l("intrinsic "+e+" does not exist!")};t.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=H(e),i=r.length>0?r[0]:"",n=$("%"+i+"%",t),a=n.name,o=n.value,s=!1,c=n.alias;c&&(i=c[0],j(r,B([0,1],c)));for(var h=1,d=!0;h=r.length){var g=b(o,f);o=(d=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[f]}else d=R(o,f),o=o[f];d&&!s&&(L[a]=o)}}return o}}}),lF=m({"node_modules/call-bound/index.js"(e,t){var r=lz(),i=lC(),n=i([r("%String.prototype.indexOf%")]);t.exports=function(e,t){var a=r(e,!!t);return"function"==typeof a&&n(e,".prototype.")>-1?i([a]):a}}}),lO=m({"node_modules/is-arguments/index.js"(e,t){var r=lt()(),i=lF()("Object.prototype.toString"),n=function(e){return(!r||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===i(e)},a=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=a,t.exports=o?n:a}}),lR=m({"node_modules/is-regex/index.js"(e,t){var r,i,n,a,o,s,l=lF(),u=lt()(),c=lP(),h=lx();u?(r=l("RegExp.prototype.exec"),i={},a={toString:n=function(){throw i},valueOf:n},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=n),s=function(e){if(!e||"object"!=typeof e)return!1;var t=h(e,"lastIndex");if(!(t&&c(t,"value")))return!1;try{r(e,a)}catch(e){return e===i}}):(o=l("Object.prototype.toString"),s=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"[object RegExp]"===o(e)}),t.exports=s}}),lB=m({"node_modules/safe-regex-test/index.js"(e,t){var r=lF(),i=lR(),n=r("RegExp.prototype.exec"),a=ll();t.exports=function(e){if(!i(e))throw new a("`regex` must be a RegExp");return function(t){return null!==n(e,t)}}}}),lj=m({"node_modules/generator-function/index.js"(e,t){var r=(function*(){}).constructor;t.exports=()=>r}}),lN=m({"node_modules/is-generator-function/index.js"(e,t){var r=lF(),i=lB()(/^\s*(?:function)?\*/),n=lt()(),a=lL(),o=r("Object.prototype.toString"),s=r("Function.prototype.toString"),l=lj();t.exports=function(e){if("function"!=typeof e)return!1;if(i(s(e)))return!0;if(!n)return"[object GeneratorFunction]"===o(e);if(!a)return!1;var t=l();return t&&a(e)===t.prototype}}}),lV=m({"node_modules/is-callable/index.js"(e,t){var r,i,n,a=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{i=Object.defineProperty({},"length",{get:function(){throw n}}),n={},o(function(){throw 42},null,i)}catch(e){e!==n&&(o=null)}else o=null;var s=/^\s*class\b/,l=function(e){try{var t=a.call(e);return s.test(t)}catch{return!1}},u=function(e){try{return!l(e)&&(a.call(e),!0)}catch{return!1}},c=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),f=function(){return!1};"object"==typeof document&&(r=document.all,c.call(r)===c.call(document.all)&&(f=function(e){if((d||!e)&&(typeof e>"u"||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch{}return!1})),t.exports=o?function(e){if(f(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,i)}catch(e){if(e!==n)return!1}return!l(e)&&u(e)}:function(e){if(f(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;if(h)return u(e);if(l(e))return!1;var t=c.call(e);return("[object Function]"===t||"[object GeneratorFunction]"===t||!!/^\[object HTML/.test(t))&&u(e)}}}),lU=m({"node_modules/for-each/index.js"(e,t){var r=lV(),i=Object.prototype.toString,n=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var i=0,a=e.length;i=3&&(l=n),"[object Array]"===i.call(e)?a(e,t,l):"string"==typeof e?o(e,t,l):s(e,t,l)}}}),lq=m({"node_modules/possible-typed-array-names/index.js"(e,t){t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}}),lG=m({"node_modules/available-typed-arrays/index.js"(e,t){var r=lq(),i=typeof globalThis>"u"?window:globalThis;t.exports=function(){for(var e=[],t=0;t3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new n("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],h=!!a&&a(e,t);if(r)r(e,t,{configurable:null===u&&h?h.configurable:!u,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else if(!c&&(s||l||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else e[t]=o}}}),l$=m({"node_modules/has-property-descriptors/index.js"(e,t){var r=lb(),i=function(){return!!r};i.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch{return!0}},t.exports=i}}),lW=m({"node_modules/set-function-length/index.js"(e,t){var r=lz(),i=lH(),n=l$()(),a=lx(),o=ll(),s=r("%Math.floor%");t.exports=function(e,t){if("function"!=typeof e)throw new o("`fn` is not a function");if("number"!=typeof t||t<0||t>0xffffffff||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&a){var c=a(e,"length");c&&!c.configurable&&(l=!1),c&&!c.writable&&(u=!1)}return(l||u||!r)&&(n?i(e,"length",t,!0,!0):i(e,"length",t)),e}}}),lY=m({"node_modules/call-bind-apply-helpers/applyBind.js"(e,t){var r=lM(),i=lS(),n=lD();t.exports=function(){return n(r,i,arguments)}}}),lZ=m({"node_modules/call-bind/index.js"(e,t){var r=lW(),i=lb(),n=lC(),a=lY();t.exports=function(e){var t=n(arguments),i=1+e.length-(arguments.length-1);return r(t,i>0?i:0,!0)},i?i(t.exports,"apply",{value:a}):t.exports.apply=a}}),lX=m({"node_modules/which-typed-array/index.js"(e,t){var r=lU(),i=lG(),n=lZ(),a=lF(),o=lx(),s=lL(),l=a("Object.prototype.toString"),u=lt()(),c=typeof globalThis>"u"?window:globalThis,h=i(),d=a("String.prototype.slice"),f=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1?n:"Object"===n&&(i=!1,r(p,function(t,r){if(!i)try{t(e),i=d(r,1)}catch{}}),i)}return o?(t=!1,r(p,function(r,i){if(!t)try{"$"+r(e)===i&&(t=d(i,1))}catch{}}),t):null}}}),lK=m({"node_modules/is-typed-array/index.js"(e,t){var r=lX();t.exports=function(e){return!!r(e)}}}),lJ=m({"node_modules/util/support/types.js"(e){var t,r,i=lO(),n=lN(),a=lX(),o=lK();function s(e){return e.call.bind(e)}var l="u">typeof BigInt,u="u">typeof Symbol,c=s(Object.prototype.toString),h=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),f=s(Boolean.prototype.valueOf);function p(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch{return!1}}function m(e){return"[object Map]"===c(e)}function g(e){return"[object Set]"===c(e)}function y(e){return"[object WeakMap]"===c(e)}function v(e){return"[object WeakSet]"===c(e)}function x(e){return"[object ArrayBuffer]"===c(e)}function b(e){return!(typeof ArrayBuffer>"u")&&(x.working?x(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===c(e)}function w(e){return!(typeof DataView>"u")&&(_.working?_(e):e instanceof DataView)}l&&(t=s(BigInt.prototype.valueOf)),u&&(r=s(Symbol.prototype.valueOf)),e.isArgumentsObject=i,e.isGeneratorFunction=n,e.isTypedArray=o,e.isPromise=function(e){return"u">typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},e.isArrayBufferView=function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||w(e)},e.isUint8Array=function(e){return"Uint8Array"===a(e)},e.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},e.isUint16Array=function(e){return"Uint16Array"===a(e)},e.isUint32Array=function(e){return"Uint32Array"===a(e)},e.isInt8Array=function(e){return"Int8Array"===a(e)},e.isInt16Array=function(e){return"Int16Array"===a(e)},e.isInt32Array=function(e){return"Int32Array"===a(e)},e.isFloat32Array=function(e){return"Float32Array"===a(e)},e.isFloat64Array=function(e){return"Float64Array"===a(e)},e.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},e.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},m.working="u">typeof Map&&m(new Map),e.isMap=function(e){return!(typeof Map>"u")&&(m.working?m(e):e instanceof Map)},g.working="u">typeof Set&&g(new Set),e.isSet=function(e){return!(typeof Set>"u")&&(g.working?g(e):e instanceof Set)},y.working="u">typeof WeakMap&&y(new WeakMap),e.isWeakMap=function(e){return!(typeof WeakMap>"u")&&(y.working?y(e):e instanceof WeakMap)},v.working="u">typeof WeakSet&&v(new WeakSet),e.isWeakSet=function(e){return v(e)},x.working="u">typeof ArrayBuffer&&x(new ArrayBuffer),e.isArrayBuffer=b,_.working="u">typeof ArrayBuffer&&"u">typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=w;var T="u">typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===c(e)}function M(e){return!(typeof T>"u")&&(typeof A.working>"u"&&(A.working=A(new T)),A.working?A(e):e instanceof T)}function k(e){return p(e,h)}function S(e){return p(e,d)}function E(e){return p(e,f)}function D(e){return l&&p(e,t)}function C(e){return u&&p(e,r)}e.isSharedArrayBuffer=M,e.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},e.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},e.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},e.isGeneratorObject=function(e){return"[object Generator]"===c(e)},e.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},e.isNumberObject=k,e.isStringObject=S,e.isBooleanObject=E,e.isBigIntObject=D,e.isSymbolObject=C,e.isBoxedPrimitive=function(e){return k(e)||S(e)||E(e)||D(e)||C(e)},e.isAnyArrayBuffer=function(e){return"u">typeof Uint8Array&&(b(e)||M(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+" is not supported in userland")}})})}}),lQ=m({"node_modules/util/support/isBufferBrowser.js"(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}}}),l0=m({"(disabled):node_modules/util/util.js"(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},i=0;i=o)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}default:return e}}),l=n[i];itypeof S&&!0===S.noDeprecation)return t;if(typeof S>"u")return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(S.throwDeprecation)throw Error(r);S.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var i={},n=/^$/;function a(t,r){var i={seen:[],stylize:s};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),d(r)?i.showHidden=r:r&&e._extend(i,r),g(i.showHidden)&&(i.showHidden=!1),g(i.depth)&&(i.depth=2),g(i.colors)&&(i.colors=!1),g(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=o),l(i,t,i.depth)}function o(e,t){var r=a.styles[t];return r?"\x1b["+a.colors[r][0]+"m"+e+"\x1b["+a.colors[r][1]+"m":e}function s(e,t){return e}function l(t,r,i){if(t.customInspect&&r&&_(r.inspect)&&r.inspect!==e.inspect&&!(r.constructor&&r.constructor.prototype===r)){var n,a,o,s,v,w,T=r.inspect(i,t);return m(T)||(T=l(t,T,i)),T}var A=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return p(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(t,r);if(A)return A;var k=Object.keys(r),S=(v={},k.forEach(function(e,t){v[e]=!0}),v);if(t.showHidden&&(k=Object.getOwnPropertyNames(r)),b(r)&&(k.indexOf("message")>=0||k.indexOf("description")>=0))return u(r);if(0===k.length){if(_(r)){var E=r.name?": "+r.name:"";return t.stylize("[Function"+E+"]","special")}if(y(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return t.stylize(Date.prototype.toString.call(r),"date");if(b(r))return u(r)}var D="",C=!1,I=["{","}"];return(h(r)&&(C=!0,I=["[","]"]),_(r)&&(D=" [Function"+(r.name?": "+r.name:"")+"]"),y(r)&&(D=" "+RegExp.prototype.toString.call(r)),x(r)&&(D=" "+Date.prototype.toUTCString.call(r)),b(r)&&(D=" "+u(r)),0!==k.length||C&&0!=r.length)?i<0?y(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),w=C?function(e,t,r,i,n){for(var a=[],o=0,s=t.length;o=0&&s++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?o[0]+(""===a?"":a+` + `)+" "+n.join(`, + `)+" "+o[1]:o[0]+a+" "+n.join(", ")+" "+o[1]):I[0]+D+I[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,i,n,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),M(i,n)||(o="["+n+"]"),s||(0>e.seen.indexOf(u.value)?(s=f(r)?l(e,u.value,null):l(e,u.value,r-1)).indexOf(` +`)>-1&&(s=a?s.split(` +`).map(function(e){return" "+e}).join(` +`).slice(2):` +`+s.split(` +`).map(function(e){return" "+e}).join(` +`)):s=e.stylize("[Circular]","special")),g(o)){if(a&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function f(e){return null===e}function p(e){return"number"==typeof e}function m(e){return"string"==typeof e}function g(e){return void 0===e}function y(e){return v(e)&&"[object RegExp]"===w(e)}function v(e){return"object"==typeof e&&null!==e}function x(e){return v(e)&&"[object Date]"===w(e)}function b(e){return v(e)&&("[object Error]"===w(e)||e instanceof Error)}function _(e){return"function"==typeof e}function w(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}n=RegExp("^"+"false".replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()+"$","i"),e.debuglog=function(t){if(!i[t=t.toUpperCase()])if(n.test(t)){var r=S.pid;i[t]=function(){var i=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,i)}}else i[t]=function(){};return i[t]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=lJ(),e.isArray=h,e.isBoolean=d,e.isNull=f,e.isNullOrUndefined=function(e){return null==e},e.isNumber=p,e.isString=m,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=g,e.isRegExp=y,e.types.isRegExp=y,e.isObject=v,e.isDate=x,e.types.isDate=x,e.isError=b,e.types.isNativeError=b,e.isFunction=_,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||typeof e>"u"},e.isBuffer=lQ();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){var t,r;console.log("%s - %s",(r=[T((t=new Date).getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"),[t.getDate(),A[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=s4(),e._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};var k="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(k&&e[k]){var r=e[k];if("function"!=typeof r)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,k,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var t,r,i=new Promise(function(e,i){t=e,r=i}),n=[],a=0;a0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,i=a.allocUnsafe(e>>>0),n=this.head,o=0;n;)t=n.data,r=o,a.prototype.copy.call(t,i,r),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(a===n.length?i+=n:i+=n.slice(0,e),0==(e-=a)){a===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(a));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,o=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,o),0==(e-=o)){o===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(o));break}++i}return this.length-=i,t}},{key:s,value:function(e,t){return o(this,i(i({},t),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var r=0;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,r){if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(l="must not be",t=t.replace(/^not /,"")):l="must be",a=" argument",(void 0===o||o>e.length)&&(o=e.length),e.substring(o-a.length,o)===a)u="The ".concat(e," ").concat(l," ").concat(n(t,"type"));else{var i,a,o,s,l,u,c=("number"!=typeof s&&(s=0),s+1>e.length||-1===e.indexOf(".",s))?"argument":"property";u='The "'.concat(e,'" ').concat(c," ").concat(l," ").concat(n(t,"type"))}return u+". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r}}),l5=m({"node_modules/readable-stream/lib/internal/streams/state.js"(e,t){var r=l3().codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,i,n){var a=null!=t.highWaterMark?t.highWaterMark:n?t[i]:null;if(null!=a){if(!(isFinite(a)&&Math.floor(a)===a)||a<0)throw new r(n?i:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}}}),l4=m({"node_modules/util-deprecate/browser.js"(e,t){t.exports=function(e,t){if(r("noDeprecation"))return e;var i=!1;return function(){if(!i){if(r("throwDeprecation"))throw Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}};function r(e){try{if(!window.localStorage)return!1}catch{return!1}var t=window.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}}}),l6=m({"node_modules/readable-stream/lib/_stream_writable.js"(e,t){function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var r=t,i=e,n=r.entry;for(r.entry=null;n;){var a=n.callback;i.pendingcb--,a(void 0),n=n.next}i.corkedRequestsFree.next=r}}t.exports=T,T.WritableState=w;var i,n,a={deprecate:l4()},o=s6(),s=s9().Buffer,l=("u">typeof window||"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},u=l2(),c=l5().getHighWaterMark,h=l3().codes,d=h.ERR_INVALID_ARG_TYPE,f=h.ERR_METHOD_NOT_IMPLEMENTED,p=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,y=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,x=h.ERR_UNKNOWN_ENCODING,b=u.errorOrDestroy;function _(){}function w(e,t,n){i=i||l8(),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=c(this,e,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new p;if(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t)--r.pendingcb,i?(S.nextTick(n,t),S.nextTick(C,e,r),e._writableState.errorEmitted=!0,b(e,t)):(n(t),e._writableState.errorEmitted=!0,b(e,t),C(e,r));else{var a=E(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||k(e,r),i?S.nextTick(M,e,r,a,n):M(e,r,a,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function T(e){var t=this instanceof(i=i||l8());if(!t&&!n.call(T,this))return new T(e);this._writableState=new w(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function A(e,t,r,i,n,a,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(n,t.onwrite):e._write(n,a,t.onwrite),t.sync=!1}function M(e,t,r,i){var n,a;r||(n=e,0===(a=t).length&&a.needDrain&&(a.needDrain=!1,n.emit("drain"))),t.pendingcb--,i(),C(e,t)}function k(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=Array(t.bufferedRequestCount),a=t.corkedRequestsFree;a.entry=i;for(var o=0,s=!0;i;)n[o]=i,i.isBuf||(s=!1),i=i.next,o+=1;n.allBuffers=s,A(e,t,!0,t.length,n,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;i;){var l=i.chunk,u=i.encoding,c=i.callback,h=t.objectMode?1:l.length;if(A(e,t,!1,h,l,u,c),i=i.next,t.bufferedRequestCount--,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function D(e,t){e._final(function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)})}function C(e,t){var r=E(t);if(r&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,S.nextTick(D,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}s4()(T,o),w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(n=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!n.call(this,e)||this===T&&e&&e._writableState instanceof w}})):n=function(e){return e instanceof this},T.prototype.pipe=function(){b(this,new m)},T.prototype.write=function(e,t,r){var i,n,a,o,u,c,h,f=this._writableState,p=!1,m=!f.objectMode&&(i=e,s.isBuffer(i)||i instanceof l);return m&&!s.isBuffer(e)&&(n=e,e=s.from(n)),"function"==typeof t&&(r=t,t=null),m?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof r&&(r=_),f.ending?(a=r,b(this,o=new v),S.nextTick(a,o)):(m||(u=e,c=r,null===u?h=new y:"string"==typeof u||f.objectMode||(h=new d("chunk",["string","Buffer"],u)),!h||(b(this,h),S.nextTick(c,h),0)))&&(f.pendingcb++,p=function(e,t,r,i,n,a){if(!r){var o,l,u=(o=i,l=n,t.objectMode||!1===t.decodeStrings||"string"!=typeof o||(o=s.from(o,l)),o);i!==u&&(r=!0,n="buffer",i=u)}var c=t.objectMode?1:i.length;t.length+=c;var h=t.length-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new f("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var i,n,a,o=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||(i=this,n=o,a=r,n.ending=!0,C(i,n),a&&(n.finished?S.nextTick(a):i.once("finish",a)),n.ended=!0,i.writable=!1),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=u.destroy,T.prototype._undestroy=u.undestroy,T.prototype._destroy=function(e,t){t(e)}}}),l8=m({"node_modules/readable-stream/lib/_stream_duplex.js"(e,t){var r,i,n,a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var o=ui(),s=l6();for(s4()(l,o),r=a(s.prototype),n=0;n>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}e.StringDecoder=i,i.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(a>0&&(e.lastNeed=a-1),a):--i=0?(a>0&&(e.lastNeed=a-2),a):--i=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}}}),ue=m({"node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(e,t){var r=l3().codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,n,a){if("function"==typeof n)return e(t,null,n);n||(n={}),o=a||i,s=!1,a=function(){if(!s){s=!0;for(var e=arguments.length,t=Array(e),r=0;rtypeof window||"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},l=l0();i=l&&l.debuglog?l.debuglog("stream"):function(){};var u,c,h,d=l1(),f=l2(),p=l5().getHighWaterMark,m=l3().codes,g=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,v=m.ERR_METHOD_NOT_IMPLEMENTED,x=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;s4()(T,a);var b=f.errorOrDestroy,_=["error","close","destroy","pause","resume"];function w(e,t,i){r=r||l8(),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=l9().StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function T(e){if(r=r||l8(),!(this instanceof T))return new T(e);var t=this instanceof r;this._readableState=new w(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function A(e,t,r,n,a){i("readableAddChunk",t);var l,u,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?E(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,D(e)))}}(e,c);else if(a||(u=function(e,t){var r;return o.isBuffer(t)||t instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t)),r}(c,t)),u)b(e,u);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===o.prototype||(l=t,t=o.from(l)),n)c.endEmitted?b(e,new x):M(e,c,t,!0);else if(c.ended)b(e,new y);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?M(e,c,t,!1):C(e,c)):M(e,c,t,!1)}else n||(c.reading=!1,C(e,c));return!c.ended&&(c.lengtht.highWaterMark&&((r=e)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),t.highWaterMark=r),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,S.nextTick(D,e))}function D(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,F(e)}function C(e,t){t.readingMore||(t.readingMore=!0,S.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function P(e){i("readable nexttick read 0"),e.read(0)}function z(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function R(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,S.nextTick(B,t,e))}function B(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function j(e,t){for(var r=0,i=e.length;r=r.highWaterMark:r.length>0)||r.ended))return i("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?R(this):E(this),null;if(0===(e=k(e,r))&&r.ended)return 0===r.length&&R(this),null;var a=r.needReadable;return i("need readable",a),(0===r.length||r.length-e0?O(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&R(this)),null!==t&&this.emit("data",t),t},T.prototype._read=function(e){b(this,new v("_read()"))},T.prototype.pipe=function(e,t){var r,a=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,i("pipe count=%d opts=%j",o.pipesCount,t);var s=t&&!1===t.end||e===S.stdout||e===S.stderr?m:l;function l(){i("onend"),e.end()}o.endEmitted?S.nextTick(s):a.once("end",s),e.on("unpipe",function t(r,n){i("onunpipe"),r===a&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",t),a.removeListener("end",l),a.removeListener("end",m),a.removeListener("data",h),c=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u())});var u=(r=a,function(){var e=r._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&n(r,"data")&&(e.flowing=!0,F(r))});e.on("drain",u);var c=!1;function h(t){i("ondata");var r=e.write(t);i("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==j(o.pipes,e))&&!c&&(i("false write response, pause",o.awaitDrain),o.awaitDrain++),a.pause())}function d(t){i("onerror",t),m(),e.removeListener("error",d),0===n(e,"error")&&b(e,t)}function f(){e.removeListener("finish",p),m()}function p(){i("onfinish"),e.removeListener("close",f),m()}function m(){i("unpipe"),a.unpipe(e)}return a.on("data",h),!function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",a),o.flowing||(i("pipe resume"),a.resume()),e},T.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?E(this):n.reading||S.nextTick(P,this)),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&S.nextTick(L,this),r},T.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&S.nextTick(L,this),t},T.prototype.resume=function(){var e,t,r=this._readableState;return r.flowing||(i("resume"),r.flowing=!r.readableListening,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,S.nextTick(z,e,t))),r.paused=!1,this},T.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){i("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a||!r.objectMode&&(!a||!a.length)||t.push(a)||(n=!0,e.pause())}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var o=0;o<_.length;o++)e.on(_[o],this.emit.bind(this,_[o]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=ut()),c(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),T._fromList=O,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(e,t){return void 0===h&&(h=ur()),h(T,e,t)})}}),un=m({"node_modules/readable-stream/lib/_stream_transform.js"(e,t){t.exports=u;var r=l3().codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,n=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,s=l8();function l(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length0,l=o=function(e){h||(h=e),e&&d.forEach(s),m||(d.forEach(s),u(h))},c=!1,o=function(){c||(c=!0,l.apply(void 0,arguments))},f=!1,e.on("close",function(){f=!0}),void 0===r&&(r=ue()),r(e,{readable:m,writable:n},function(e){if(e)return o(e);f=!0,o()}),p=!1,function(t){if(!f&&!p){if(p=!0,e.setHeader&&"function"==typeof e.abort)return e.abort();if("function"==typeof e.destroy)return e.destroy();o(t||new a("pipe"))}}});return t.reduce(l)}}}),us=m({"node_modules/stream-browserify/index.js"(e,t){t.exports=i;var r=tA().EventEmitter;function i(){r.call(this)}s4()(i,r),i.Readable=ui(),i.Writable=l6(),i.Duplex=l8(),i.Transform=un(),i.PassThrough=ua(),i.finished=ue(),i.pipeline=uo(),i.Stream=i,i.prototype.pipe=function(e,t){var i=this;function n(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function a(){i.readable&&i.resume&&i.resume()}i.on("data",n),e.on("drain",a),e._isStdio||t&&!1===t.end||(i.on("end",s),i.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){i.removeListener("data",n),e.removeListener("drain",a),i.removeListener("end",s),i.removeListener("close",l),i.removeListener("error",u),e.removeListener("error",u),i.removeListener("end",c),i.removeListener("close",c),e.removeListener("close",c)}return i.on("error",u),e.on("error",u),i.on("end",c),i.on("close",c),e.on("close",c),e.emit("pipe",i),e}}}),ul=m({"node_modules/util/util.js"(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},i=0;i=o)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}default:return e}}),l=n[i];itypeof S&&!0===S.noDeprecation)return t;if(typeof S>"u")return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(S.throwDeprecation)throw Error(r);S.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var i={},n=/^$/;function a(t,r){var i={seen:[],stylize:s};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),d(r)?i.showHidden=r:r&&e._extend(i,r),g(i.showHidden)&&(i.showHidden=!1),g(i.depth)&&(i.depth=2),g(i.colors)&&(i.colors=!1),g(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=o),l(i,t,i.depth)}function o(e,t){var r=a.styles[t];return r?"\x1b["+a.colors[r][0]+"m"+e+"\x1b["+a.colors[r][1]+"m":e}function s(e,t){return e}function l(t,r,i){if(t.customInspect&&r&&_(r.inspect)&&r.inspect!==e.inspect&&!(r.constructor&&r.constructor.prototype===r)){var n,a,o,s,v,w,T=r.inspect(i,t);return m(T)||(T=l(t,T,i)),T}var A=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return p(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(t,r);if(A)return A;var k=Object.keys(r),S=(v={},k.forEach(function(e,t){v[e]=!0}),v);if(t.showHidden&&(k=Object.getOwnPropertyNames(r)),b(r)&&(k.indexOf("message")>=0||k.indexOf("description")>=0))return u(r);if(0===k.length){if(_(r)){var E=r.name?": "+r.name:"";return t.stylize("[Function"+E+"]","special")}if(y(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return t.stylize(Date.prototype.toString.call(r),"date");if(b(r))return u(r)}var D="",C=!1,I=["{","}"];return(h(r)&&(C=!0,I=["[","]"]),_(r)&&(D=" [Function"+(r.name?": "+r.name:"")+"]"),y(r)&&(D=" "+RegExp.prototype.toString.call(r)),x(r)&&(D=" "+Date.prototype.toUTCString.call(r)),b(r)&&(D=" "+u(r)),0!==k.length||C&&0!=r.length)?i<0?y(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),w=C?function(e,t,r,i,n){for(var a=[],o=0,s=t.length;o=0&&s++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?o[0]+(""===a?"":a+` + `)+" "+n.join(`, + `)+" "+o[1]:o[0]+a+" "+n.join(", ")+" "+o[1]):I[0]+D+I[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,i,n,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),M(i,n)||(o="["+n+"]"),s||(0>e.seen.indexOf(u.value)?(s=f(r)?l(e,u.value,null):l(e,u.value,r-1)).indexOf(` +`)>-1&&(s=a?s.split(` +`).map(function(e){return" "+e}).join(` +`).slice(2):` +`+s.split(` +`).map(function(e){return" "+e}).join(` +`)):s=e.stylize("[Circular]","special")),g(o)){if(a&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function f(e){return null===e}function p(e){return"number"==typeof e}function m(e){return"string"==typeof e}function g(e){return void 0===e}function y(e){return v(e)&&"[object RegExp]"===w(e)}function v(e){return"object"==typeof e&&null!==e}function x(e){return v(e)&&"[object Date]"===w(e)}function b(e){return v(e)&&("[object Error]"===w(e)||e instanceof Error)}function _(e){return"function"==typeof e}function w(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}n=RegExp("^"+"false".replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()+"$","i"),e.debuglog=function(t){if(!i[t=t.toUpperCase()])if(n.test(t)){var r=S.pid;i[t]=function(){var i=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,i)}}else i[t]=function(){};return i[t]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=lJ(),e.isArray=h,e.isBoolean=d,e.isNull=f,e.isNullOrUndefined=function(e){return null==e},e.isNumber=p,e.isString=m,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=g,e.isRegExp=y,e.types.isRegExp=y,e.isObject=v,e.isDate=x,e.types.isDate=x,e.isError=b,e.types.isNativeError=b,e.isFunction=_,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||typeof e>"u"},e.isBuffer=lQ();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){var t,r;console.log("%s - %s",(r=[T((t=new Date).getHours()),T(t.getMinutes()),T(t.getSeconds())].join(":"),[t.getDate(),A[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=s4(),e._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};var k="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(k&&e[k]){var r=e[k];if("function"!=typeof r)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,k,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var t,r,i=new Promise(function(e,i){t=e,r=i}),n=[],a=0;a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var e,t=n(l);return e=o?Reflect.construct(t,arguments,n(this).constructor):t.apply(this,arguments),function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");var i=e;if(void 0===i)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return i}(this,e)});function l(r,i,n){var a;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,l),(a=s.call(this,"string"==typeof t?t:t(r,i,n))).code=e,a}return Object.defineProperty(l,"prototype",{writable:!1}),l}(a);s[e]=o}function u(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(e,t,i){if(void 0===a&&(a=uS()),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(n="not ",t.substr(0,n.length)===n)?(c="must not be",t=t.replace(/^not /,"")):c="must be",o=" argument",(void 0===s||s>e.length)&&(s=e.length),e.substring(s-o.length,s)===o)h="The ".concat(e," ").concat(c," ").concat(u(t,"type"));else{var n,o,s,l,c,h,d=("number"!=typeof l&&(l=0),l+1>e.length||-1===e.indexOf(".",l))?"argument":"property";h='The "'.concat(e,'" ').concat(d," ").concat(c," ").concat(u(t,"type"))}return h+". Received type ".concat(r(i))},TypeError),l("ERR_INVALID_ARG_VALUE",function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===o&&(o=ul());var i=o.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(i)},TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",function(e,t,i){var n;return n=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(r(i)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(n,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=Array(e),r=0;r0,"At least one arg needs to be specified");var i="The ",n=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),n){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,n-1).join(", "),i+=", and ".concat(t[n-1]," arguments")}return"".concat(i," must be specified")},TypeError),t.exports.codes=s}}),uc=m({"node_modules/assert/build/internal/assert/assertion_error.js"(e,t){function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function i(e){for(var t=1;ttypeof t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return l(e,arguments,h(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c(i,e)})(e)}function l(e,t,r){return(l=u()?Reflect.construct.bind():function(e,t,r){var i=[null];i.push.apply(i,t);var n=new(Function.bind.apply(e,i));return r&&c(n,r.prototype),n}).apply(null,arguments)}function u(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}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})(e)}var f=ul().inspect,p=uu().codes.ERR_INVALID_ARG_TYPE;function m(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var g="",y="",v="",x="",b={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function w(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}t.exports=function(e,t){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");T.prototype=Object.create(e&&e.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),e&&c(T,e);var r,s,l=(r=u(),function(){var e,t=h(T);return e=r?Reflect.construct(t,arguments,h(this).constructor):t.apply(this,arguments),a(this,e)});function T(e){if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,T),"object"!==d(e)||null===e)throw new p("options","Object",e);var t,r=e.message,i=e.operator,n=e.stackStartFn,s=e.actual,u=e.expected,c=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=l.call(this,String(r));else if(S.stderr&&S.stderr.isTTY&&(S.stderr&&S.stderr.getColorDepth&&1!==S.stderr.getColorDepth()?(g="\x1b[34m",y="\x1b[32m",x="\x1b[39m",v="\x1b[31m"):(g="",y="",x="",v="")),"object"===d(s)&&null!==s&&"object"===d(u)&&null!==u&&"stack"in s&&s instanceof Error&&"stack"in u&&u instanceof Error&&(s=_(s),u=_(u)),"deepStrictEqual"===i||"strictEqual"===i)t=l.call(this,function(e,t,r){var i="",n="",a=0,o="",s=!1,l=w(e),u=l.split(` +`),c=w(t).split(` +`),h=0,f="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===c.length&&u[0]!==c[0]){var p=u[0].length+c[0].length;if(p<=10){if(("object"!==d(e)||null===e)&&("object"!==d(t)||null===t)&&(0!==e||0!==t))return"".concat(b[r],` + +`)+"".concat(u[0]," !== ").concat(c[0],` +`)}else if("strictEqualObject"!==r&&p<(S.stderr&&S.stderr.isTTY?S.stderr.columns:80)){for(;u[0][h]===c[0][h];)h++;h>2&&(f=` + `.concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var _=u[u.length-1],T=c[c.length-1];_===T&&(h++<2?o=` + `.concat(_).concat(o):i=_,u.pop(),c.pop(),0!==u.length&&0!==c.length);)_=u[u.length-1],T=c[c.length-1];var A=Math.max(u.length,c.length);if(0===A){var M=l.split(` +`);if(M.length>30)for(M[26]="".concat(g,"...").concat(x);M.length>27;)M.pop();return"".concat(b.notIdentical,` + +`).concat(M.join(` +`),` +`)}h>3&&(o=` +`.concat(g,"...").concat(x).concat(o),s=!0),""!==i&&(o=` + `.concat(i).concat(o),i="");var k=0,E=b[r]+` +`.concat(y,"+ actual").concat(x," ").concat(v,"- expected").concat(x),D=" ".concat(g,"...").concat(x," Lines skipped");for(h=0;h1&&h>2&&(C>4?(n+=` +`.concat(g,"...").concat(x),s=!0):C>3&&(n+=` + `.concat(c[h-2]),k++),n+=` + `.concat(c[h-1]),k++),a=h,i+=` +`.concat(v,"-").concat(x," ").concat(c[h]),k++;else if(c.length1&&h>2&&(C>4?(n+=` +`.concat(g,"...").concat(x),s=!0):C>3&&(n+=` + `.concat(u[h-2]),k++),n+=` + `.concat(u[h-1]),k++),a=h,n+=` +`.concat(y,"+").concat(x," ").concat(u[h]),k++;else{var I=c[h],L=u[h],P=L!==I&&(!m(L,",")||L.slice(0,-1)!==I);P&&m(I,",")&&I.slice(0,-1)===L&&(P=!1,L+=","),P?(C>1&&h>2&&(C>4?(n+=` +`.concat(g,"...").concat(x),s=!0):C>3&&(n+=` + `.concat(u[h-2]),k++),n+=` + `.concat(u[h-1]),k++),a=h,n+=` +`.concat(y,"+").concat(x," ").concat(L),i+=` +`.concat(v,"-").concat(x," ").concat(I),k+=2):(n+=i,i="",(1===C||0===h)&&(n+=` + `.concat(L),k++))}if(k>20&&h30)for(f[26]="".concat(g,"...").concat(x);f.length>27;)f.pop();t=1===f.length?l.call(this,"".concat(h," ").concat(f[0])):l.call(this,"".concat(h,` + +`).concat(f.join(` +`),` +`))}else{var A=w(s),M="",k=b[i];"notDeepEqual"===i||"notEqual"===i?(A="".concat(b[i],` + +`).concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(M="".concat(w(u)),A.length>512&&(A="".concat(A.slice(0,509),"...")),M.length>512&&(M="".concat(M.slice(0,509),"...")),"deepEqual"===i||"equal"===i?A="".concat(k,` + +`).concat(A,` + +should equal + +`):M=" ".concat(i," ").concat(M)),t=l.call(this,"".concat(A).concat(M))}return Error.stackTraceLimit=c,t.generatedMessage=!r,Object.defineProperty(o(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=s,t.expected=u,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(o(t),n),t.stack,t.name="AssertionError",a(t)}return s=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return f(this,i(i({},t),{},{customInspect:!1,depth:0}))}}],function(e,t){for(var r=0;r=0&&"[object Function]"===r.call(e.callee)),i}}}),ud=m({"node_modules/object-keys/implementation.js"(e,t){var r,i,n,a,o,s,l,u,c,h,d,f;Object.keys||(i=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=uh(),s=!(o=Object.prototype.propertyIsEnumerable).call({toString:null},"toString"),l=o.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{c(window[e])}catch{return!0}}catch{return!0}return!1}(),f=function(e){if(typeof window>"u"||!d)return c(e);try{return c(e)}catch{return!1}},r=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===n.call(e),o=a(e),c=t&&"[object String]"===n.call(e),h=[];if(!t&&!r&&!o)throw TypeError("Object.keys called on a non-object");var d=l&&r;if(c&&e.length>0&&!i.call(e,0))for(var p=0;p0)for(var m=0;m-1?i(a):a}}}),ux=m({"node_modules/define-properties/index.js"(e,t){var r=uf(),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),n=Object.prototype.toString,a=Array.prototype.concat,o=lH(),s=l$()(),l=function(e,t,r,i){if(t in e){if(!0===i){if(e[t]===r)return}else if("function"!=typeof i||"[object Function]"!==n.call(i)||!i())return}s?o(e,t,r,!0):o(e,t,r)},u=function(e,t){var n=arguments.length>2?arguments[2]:{},o=r(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;stypeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=0x100000000}function L(e){return Object.keys(e).filter(I).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function P(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,n=0,a=Math.min(r,i);n1?r-1:0),n=1;n1?r-1:0),n=1;n1?r-1:0),n=1;n1?r-1:0),n=1;n0){var o=e;if(!((o=String(o)).length>100)){var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(s){var l=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*l;case"days":case"day":case"d":return 864e5*l;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*l;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*l;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*l;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:break}}}return}if("number"===a&&!1===isNaN(e)){return t.long?r(i=e,864e5,"day")||r(i,36e5,"hour")||r(i,6e4,"minute")||r(i,1e3,"second")||i+" ms":(n=e)>=864e5?Math.round(n/864e5)+"d":n>=36e5?Math.round(n/36e5)+"h":n>=6e4?Math.round(n/6e4)+"m":n>=1e3?Math.round(n/1e3)+"s":n+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}}),uD=m({"node_modules/debug/src/debug.js"(e,t){var r;function i(t){function i(){if(i.enabled){var t=+new Date;i.diff=t-(r||t),i.prev=r,i.curr=t,r=t;for(var n=Array(arguments.length),a=0;atypeof S&&"env"in S&&(t=S.env.DEBUG),t}(e=t.exports=uD()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),r){var i="color: "+this.color;t.splice(1,0,i,"color: inherit");var n=0,a=0;t[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(a=n))}),t.splice(a,0,i)}},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch{}},e.load=r,e.useColors=function(){return"u">typeof window&&!!window.process&&"renderer"===window.process.type||"u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="u">typeof chrome&&"u">typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},e.enable(r())}}),uI=m({"node_modules/stream-parser/index.js"(e,t){var r=uS(),i=uC()("stream-parser");function n(e){i("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function a(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||n(this),i("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||n(this),i("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function s(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||n(this),i("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function l(e,t,r){this._parserInit||n(this),i("write(%o bytes)",e.length),"function"==typeof t&&(r=t),h(this,e,null,r)}function u(e,t,r){this._parserInit||n(this),i("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),h(this,e,t,r)}function c(e,t,r,n){if(e._parserBytesLeft-=t.length,i("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return n;var a=e._parserCallback;if(a&&0===e._parserState&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),a){var o=[];t&&o.push(t),r&&o.push(r);var s=a.length>o.length;s&&o.push(d(n));var l=a.apply(e,o);if(!s||n===l)return n}}t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),e._bytes=a,e._skipBytes=o,t&&(e._passthrough=s),t?e._transform=u:e._write=l};var h=d(function e(t,r,i,n){return t._parserBytesLeft<=0?n(Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return c(t,r,i,n)}:function(){var a=r.slice(0,t._parserBytesLeft);return c(t,a,i,function(o){return o?n(o):r.length>a.length?function(){return e(t,r.slice(a.length),i,n)}:void 0})}});function d(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}}),uL=m({"node_modules/probe-image-size/lib/common.js"(e){var t=us().Transform,r=uI();function i(){t.call(this,{readableObjectMode:!0})}function n(e,t,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||"",this.name=this.constructor.name,this.message=e,t&&(this.code=t),r&&(this.statusCode=r)}i.prototype=Object.create(t.prototype),i.prototype.constructor=i,r(i.prototype),e.ParserStream=i,e.sliceEq=function(e,t,r){for(var i=t,n=0;n>16},e.readInt16BE=function(t,r){return e.readUInt16BE(t,r)<<16>>16},e.readUInt32LE=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+0x1000000*e[t+3]},e.readUInt32BE=function(e,t){return 0x1000000*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3])},e.readInt32LE=function(t,r){return 0|e.readUInt32LE(t,r)},e.readInt32BE=function(t,r){return 0|e.readUInt32BE(t,r)},n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,e.ProbeError=n}}),uP=m({"node_modules/probe-image-size/lib/miaf_utils.js"(e,t){var r=uL().readUInt16BE,i=uL().readUInt32BE;function n(e,t){if(e.length<4+t)return null;var r=i(e,t);return e.length>4&15,n=15&e[4],o=e[5]>>4&15,s=r(e,6),l=8,u=0;ut.width||e.width===t.width&&e.height>t.height?e:t}),l=o.reduce(function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}),s.width>l.height||s.width===l.height&&s.height>l.width?s:l),c=1;t.transforms.forEach(function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(0===e.value?c=r[c]:(c=t[c=r[c]],c=t[c])),"irot"===e.type)for(var i=0;i0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?0x1000000*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+0x1000000*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},i.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return this.input[t];case 6:return(r=this.input[t])|(128&r)*0x1fffffe;case 3:return this.read_uint16(t);case 8:return(r=this.read_uint16(t))|(32768&r)*131070;case 4:return this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));default:return null}},i.prototype.scan_ifd=function(e,t,i){var n=this.read_uint16(t);t+=2;for(var a=0;athis.input.length)throw r("unexpected EOF","EBADDATA");for(var f=[],p=h,m=0;m0&&(this.ifds_to_read.push({id:o,offset:f[0]}),d=!0),!1===i({is_big_endian:this.big_endian,ifd:e,tag:o,format:s,count:l,entry_offset:t+this.start,data_length:c,data_offset:h+this.start,value:f,is_subifd_link:d})){this.aborted=!0;return}t+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.length).each(function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1}),t}catch{return -1}}}}),uF=m({"node_modules/probe-image-size/lib/parse_sync/avif.js"(e,t){var r=uL().str2arr,i=uL().sliceEq,n=uL().readUInt32BE,a=uP(),o=uz(),s=r("ftyp");t.exports=function(e){if(i(e,4,s)){var t=a.unbox(e,0);if(t){var r=a.getMimeType(t.data);if(r){for(var l,u=t.end;;){var c=a.unbox(e,u);if(!c)break;if(u=c.end,"mdat"===c.boxtype)return;if("meta"===c.boxtype){l=c.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var d={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(d.variants=h.variants),h.orientation&&(d.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=e.length){var f=n(e,h.exif_location.offset),p=e.slice(h.exif_location.offset+f+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(p);m>0&&(d.orientation=m)}return d}}}}}}}}),uO=m({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(e,t){var r=uL().str2arr,i=uL().sliceEq,n=uL().readInt16LE,a=uL().readInt32LE,o=uL().readUInt32LE,s=r("BM");t.exports=function(e){if(!(e.length<26)&&i(e,0,s)){var t,r,l=o(e,14);if(12===l)r=n(e,18),t=n(e,20);else{if(!(l>12))return;r=a(e,18),t=a(e,22)}return{width:r,height:Math.abs(t),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}}),uR=m({"node_modules/probe-image-size/lib/parse_sync/gif.js"(e,t){var r=uL().str2arr,i=uL().sliceEq,n=uL().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");t.exports=function(e){if(!(e.length<10)&&!(!i(e,0,a)&&!i(e,0,o)))return{width:n(e,6),height:n(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),uB=m({"node_modules/probe-image-size/lib/parse_sync/ico.js"(e,t){var r=uL().readUInt16LE;t.exports=function(e){var t=r(e,0),i=r(e,2),n=r(e,4);if(!(0!==t||1!==i||!n)&&!(e.length<6+16*n)){for(var a=[],o={width:0,height:0},s=0;so.width||u>o.height)&&(o=c)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),uj=m({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(e,t){var r=uL().readUInt16BE,i=uL().str2arr,n=uL().sliceEq,a=uz(),o=i("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var i,s,l=e[t++];255===l;)l=e[t++];if(l>=208&&l<=217||1===l)s=0;else{if(!(l>=192)||!(l<=254)||e.length-t<2)return;s=r(e,t)-2,t+=2}if(217===l||218===l)return;if(225===l&&s>=10&&n(e,t,o)&&(i=a.get_orientation(e.slice(t+6,t+s))),s>=5&&l>=192&&l<=207&&196!==l&&200!==l&&204!==l){if(e.length-t0&&(u.orientation=i),u}t+=s}}}}),uN=m({"node_modules/probe-image-size/lib/parse_sync/png.js"(e,t){var r=uL().str2arr,i=uL().sliceEq,n=uL().readUInt32BE,a=r(`\x89PNG\r +\x1a +`),o=r("IHDR");t.exports=function(e){if(!(e.length<24)&&i(e,0,a)&&i(e,12,o))return{width:n(e,16),height:n(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),uV=m({"node_modules/probe-image-size/lib/parse_sync/psd.js"(e,t){var r=uL().str2arr,i=uL().sliceEq,n=uL().readUInt32BE,a=r("8BPS\0\x01");t.exports=function(e){if(!(e.length<22)&&i(e,0,a))return{width:n(e,18),height:n(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),uU=m({"node_modules/probe-image-size/lib/parse_sync/svg.js"(e,t){function r(e){return"number"==typeof e&&isFinite(e)&&e>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,n=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,a=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,o=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,l=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(e){return l.test(e)?e.match(l)[0]:"px"}t.exports=function(e){if(function(e){var t,r=0,i=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);re.length)){for(;t+8=10?r=r||function(e,t){if(157===e[t+3]&&1===e[t+4]&&42===e[t+5])return{width:16383&n(e,t+6),height:16383&n(e,t+8),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}(e,t+8):"VP8L"===d&&f>=5?r=r||function(e,t){if(47===e[t]){var r=a(e,t+1);return{width:(16383&r)+1,height:(r>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}(e,t+8):"VP8X"===d&&f>=10?r=r||{width:(e[(h=t+8)+6]<<16|e[h+5]<<8|e[h+4])+1,height:(e[h+9]<<16|e[h+8]<<8|e[h+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}:"EXIF"===d&&(u=o.get_orientation(e.slice(t+8,t+8+f)),t=1/0),t+=8+f}if(r)return u>0&&(r.orientation=u),r}}}}}),uH=m({"node_modules/probe-image-size/lib/parsers_sync.js"(e,t){t.exports={avif:uF(),bmp:uO(),gif:uR(),ico:uB(),jpeg:uj(),png:uN(),psd:uV(),svg:uU(),tiff:uq(),webp:uG()}}}),u$=m({"node_modules/probe-image-size/sync.js"(e,t){var r=uH();t.exports=function(e){for(var t=Object.keys(r),i=0;i0&&n.height>0?n:null}return null},t.exports.parsers=r}}),uW=m({"src/traces/image/helpers.js"(e){var t=u$(),r=iP().IMAGE_URL_PREFIX,i=s9().Buffer;e.getImageSize=function(e){return t(new i(e.replace(r,""),"base64"))}}}),uY=m({"src/traces/image/calc.js"(e,t){var r=tb(),i=s$(),n=I(),a=ro(),o=tb().maxRowLength,s=uW().getImageSize;t.exports=function(e,t){if(t._hasZ)u=t.z.length,c=o(t.z);else if(t._hasSource){var l=s(t.source);u=l.height,c=l.width}var u,c,h,d=a.getFromId(e,t.xaxis||"x"),f=a.getFromId(e,t.yaxis||"y"),p=d.d2c(t.x0)-t.dx/2,m=f.d2c(t.y0)-t.dy/2,g=[p,p+c*t.dx],y=[m,m+u*t.dy];if(d&&"log"===d.type)for(h=0;h0;)g=h.c2p(w+b*k),b--;for(b=0;void 0===v&&b0;)x=d.c2p(T+b*S),b--;gz[0];if(F||O){var R=m+E/2,B=v+D/2;L+="transform:"+n(R+"px",B+"px")+"scale("+(F?-1:1)+","+(O?-1:1)+")"+n(-R+"px",-B+"px")+";"}}I.attr("style",L);var j=new Promise(function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===A&&c._canvas.el.height===M&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=A,t.height=M;var r=t.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var i=c._image;i.onload=function(){r.drawImage(i,0,0),c._canvas={el:t,source:c.source},e()},i.setAttribute("src",c.source)}}).then(function(){var e;if(c._hasZ)e=C(function(e,t){var r=_[t][e];return i.isTypedArray(r)&&(r=Array.from(r)),r}).toDataURL("image/png");else if(c._hasSource)if(p)e=c.source;else{var t=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,A,M).data;e=C(function(e,r){var i=4*(r*A+e);return[t[i],t[i+1],t[i+2],t[i+3]]}).toDataURL("image/png")}I.attr({"xlink:href":e,height:D,width:E,x:m,y:v})});e._promises.push(j)})}}}),uX=m({"src/traces/image/style.js"(e,t){var r=M();t.exports=function(e){r.select(e).selectAll(".im image").style("opacity",function(e){return e[0].trace.opacity})}}}),uK=m({"src/traces/image/hover.js"(e,t){var r=rO(),i=tb(),n=i.isArrayOrTypedArray,a=s$();t.exports=function(e,t,o){var s=e.cd[0],l=s.trace,u=e.xa,c=e.ya;if(!(r.inbox(t-s.x0,t-(s.x0+s.w*l.dx),0)>0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,d=Math.floor((t-s.x0)/l.dx),f=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[f][d]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(d,f,1,1).data),h){var p,m,g=s.hi||l.hoverinfo;if(g){var y=g.split("+");-1!==y.indexOf("all")&&(y=["color"]),-1!==y.indexOf("color")&&(m=!0)}var v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,b=x.length,_=l._scaler(h),w=v.suffix,T=[];(l.hovertemplate||m)&&(T.push("["+[_[0]+w[0],_[1]+w[1],_[2]+w[2]].join(", ")),4===b&&T.push(", "+_[3]+w[3]),T.push("]"),T=T.join(""),e.extraText=x.toUpperCase()+": "+T),n(l.hovertext)&&n(l.hovertext[f])?p=l.hovertext[f][d]:n(l.text)&&n(l.text[f])&&(p=l.text[f][d]);var A=c.c2p(s.y0+(f+.5)*l.dy),M=s.x0+(d+.5)*l.dx,k=s.y0+(f+.5)*l.dy,S="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[i.extendFlat(e,{index:[f,d],x0:u.c2p(s.x0+d*l.dx),x1:u.c2p(s.x0+(d+1)*l.dx),y0:A,y1:A,color:_,xVal:M,xLabelVal:M,yVal:k,yLabelVal:k,zLabelVal:S,text:p,hovertemplateLabels:{zLabel:S,colorLabel:T,"color[0]Label":_[0]+w[0],"color[1]Label":_[1]+w[1],"color[2]Label":_[2]+w[2],"color[3]Label":_[3]+w[3]}})]}}}}}),uJ=m({"src/traces/image/event_data.js"(e,t){t.exports=function(e,t){return"xVal"in t&&(e.x=t.xVal),"yVal"in t&&(e.y=t.yVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e.color=t.color,e.colormodel=t.trace.colormodel,e.z||(e.z=t.color),e}}}),uQ=m({"src/traces/image/index.js"(e,t){t.exports={attributes:(s3(),x(sW)).default,supplyDefaults:s5(),calc:uY(),plot:uZ(),style:uX(),hoverPoints:uK(),eventData:uJ(),moduleType:"trace",name:"image",basePlotModule:ng(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),u0=m({"lib/image.js"(e,t){t.exports=uQ()}}),u1=m({"src/traces/pie/attributes.js"(e,t){var r=X(),i=ai().attributes,n=$(),a=et(),{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=eY(),u=H().extendFlat,c=e$().pattern,h=n({editType:"plot",arrayOk:!0,colorEditType:"plot"});t.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:l(),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:l({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},h,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},h,{}),outsidetextfont:u({},h,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:u({},r.showlegend,{arrayOk:!0}),legend:u({},r.legend,{arrayOk:!0}),legendrank:u({},r.legendrank,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},h,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:i({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),u2=m({"src/traces/pie/defaults.js"(e,t){var r=I(),i=tb(),n=u1(),a=ai().defaults,o=ak().handleText,s=tb().coercePattern;function l(e,t){var n=i.isArrayOrTypedArray(e),a=i.isArrayOrTypedArray(t),o=Math.min(n?e.length:1/0,a?t.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,l=0;l0){s=!0;break}}s||(o=0)}return{hasLabels:n,hasValues:a,len:o}}function u(e,t,r,i,n){i("marker.line.width")&&i("marker.line.color",n?void 0:r.paper_bgcolor);var a=i("marker.colors");s(i,"marker.pattern",a),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}t.exports={handleLabelsAndValues:l,handleMarkerDefaults:u,supplyDefaults:function(e,t,r,s){function c(r,a){return i.coerce(e,t,n,r,a)}var h,d=l(c("labels"),c("values")),f=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),!f){t.visible=!1;return}t._length=f,u(e,t,s,c,!0),c("scalegroup");var p=c("text"),m=c("texttemplate");if(c("texttemplatefallback"),m||(h=c("textinfo",i.isArrayOrTypedArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),m||h&&"none"!==h){var g=c("textposition");o(e,t,s,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&c("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&c("insidetextorientation")}else"none"===h&&c("textposition","none");a(t,s,c);var y=c("hole");if(c("title.text")){var v=c("title.position",y?"middle center":"top center");y||"middle center"!==v||(t.title.position="top center"),i.coerceFont(c,"title.font",s.font)}c("sort"),c("direction"),c("rotation"),c("pull")}}}}),u3=m({"src/traces/pie/layout_attributes.js"(e,t){t.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),u5=m({"src/traces/pie/layout_defaults.js"(e,t){var r=tb(),i=u3();t.exports=function(e,t){function n(n,a){return r.coerce(e,t,i,n,a)}n("hiddenlabels"),n("piecolorway",t.colorway),n("extendpiecolors")}}}),u4=m({"src/traces/pie/calc.js"(e,t){var r=I(),i=er(),n={};function a(e){return function(t,r){if(!t||!i.isValid(t))return!1;let n=i.rgbaString(t);return e[r]||(e[r]=n),n}}function o(e,t){var r,n=JSON.stringify(e),a=t[n];if(!a){for(a=e.slice(),r=0;r=0}),("funnelarea"===t.type?y:t.sort)&&o.sort(function(e,t){return t.v-e.v}),o[0]&&(o[0].vTotal=g),o},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var i=e._fullLayout,a=e.calcdata,s=i[r+"colorway"],l=i["_"+r+"colormap"];i["extend"+r+"colors"]&&(s=o(s,n));for(var u=0,c=0;c"),name:h.hovertemplate||-1!==d.indexOf("name")?h.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,e.pts)||e.color,borderColor:m.castOption(_.bordercolor,e.pts),fontFamily:m.castOption(w.family,e.pts),fontSize:m.castOption(w.size,e.pts),fontColor:m.castOption(w.color,e.pts),nameLength:m.castOption(_.namelength,e.pts),textAlign:m.castOption(_.align,e.pts),hovertemplate:m.castOption(h.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,h)]},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],u._hasHoverLabel=!0}u._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,h)],event:r.event})}}),e.on("mouseout",function(e){var i=t._fullLayout,a=t._fullData[u.index],o=r.select(this).datum();u._hasHoverEvent&&(e.originalEvent=r.event,t.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),u._hasHoverEvent=!1),u._hasHoverLabel&&(n.loneUnhover(i._hoverlayer.node()),u._hasHoverLabel=!1)}),e.on("click",function(e){var i=t._fullLayout,a=t._fullData[u.index];t._dragging||!1===i.hovermode||(t._hoverdata=[g(e,a)],n.click(t,r.event))})}function x(e,t,r){var i=m.castOption(e.insidetextfont.color,t.pts);!i&&e._input.textfont&&(i=m.castOption(e._input.textfont.color,t.pts));var n=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,o=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size,s=m.castOption(e.insidetextfont.weight,t.pts)||m.castOption(e.textfont.weight,t.pts)||r.weight,l=m.castOption(e.insidetextfont.style,t.pts)||m.castOption(e.textfont.style,t.pts)||r.style,u=m.castOption(e.insidetextfont.variant,t.pts)||m.castOption(e.textfont.variant,t.pts)||r.variant,c=m.castOption(e.insidetextfont.textcase,t.pts)||m.castOption(e.textfont.textcase,t.pts)||r.textcase,h=m.castOption(e.insidetextfont.lineposition,t.pts)||m.castOption(e.textfont.lineposition,t.pts)||r.lineposition,d=m.castOption(e.insidetextfont.shadow,t.pts)||m.castOption(e.textfont.shadow,t.pts)||r.shadow;return{color:i||a.contrast(t.color),family:n,size:o,weight:s,style:l,variant:u,textcase:c,lineposition:h,shadow:d}}function b(e,t){for(var r,i,n=0;nl&&l>c||u=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||f){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||p||h){if((a={scale:n*i*2/Math.sqrt(e.width*e.width+e.height*e.height),rCenter:1-n,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,a.scale>=1)return a;m.push(a)}(p||f)&&((a=w(e,i,o,l,u)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(a)),(p||d)&&((a=T(e,i,o,l,u)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(a));for(var v=0,x=0,b=0;b=1)break}return m[v]}function w(e,t,r,i,n){t=Math.max(0,t-2*p);var a=e.width/e.height,o=S(a,i,t,r);return{scale:2*o/e.height,rCenter:A(a,o/t),rotate:k(n)}}function T(e,t,r,i,n){t=Math.max(0,t-2*p);var a=e.height/e.width,o=S(a,i,t,r);return{scale:2*o/e.width,rCenter:A(a,o/t),rotate:k(n+Math.PI/2)}}function A(e,t){return Math.cos(t)-e*t}function k(e){return(180/Math.PI*e+720)%180-90}function S(e,t,r,i){var n=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(n*n+.5)+n),i/(Math.sqrt(e*e+i/2)+e))}function E(e,t){var r=t.pxmid[0],i=t.pxmid[1],n=e.width/2,a=e.height/2;return r<0&&(n*=-1),i<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:n+Math.abs(a)*(n>0?1:-1)/2,y:a/(1+r*r/(i*i)),outside:!0}}function D(e,t){var r,i,n,a=1,o=1,s=e.trace,l={x:e.cx,y:e.cy},u={tx:0,ty:0};u.ty+=s.title.font.size,n=I(s),-1!==s.title.position.indexOf("top")?(l.y-=(1+n)*e.r,u.ty-=e.titleBox.height):-1!==s.title.position.indexOf("bottom")&&(l.y+=(1+n)*e.r);var c=(r=e.r,r/(void 0===(i=e.trace.aspectratio)?1:i)),h=t.w*(s.domain.x[1]-s.domain.x[0])/2;return -1!==s.title.position.indexOf("left")?(h+=c,l.x-=(1+n)*c,u.tx+=e.titleBox.width/2):-1!==s.title.position.indexOf("center")?h*=2:-1!==s.title.position.indexOf("right")&&(h+=c,l.x+=(1+n)*c,u.tx-=e.titleBox.width/2),a=h/e.titleBox.width,o=C(e,t)/e.titleBox.height,{x:l.x,y:l.y,scale:Math.min(a,o),tx:u.tx,ty:u.ty}}function C(e,t){var r=e.trace,i=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,i/2)}function I(e){var t,r=e.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function L(e,t){for(var r=[],i=0;i1?l=(s=r.r)/n.aspectratio:s=(l=r.r)*n.aspectratio,s*=(1+n.baseratio)/2,o=s*l),u=Math.min(u,o/r.vTotal));for(i=0;i")}if(a){var x=s.castOption(n,t.i,"texttemplate");if(x){var b={label:t.label,value:t.v,valueLabel:m.formatPieValue(t.v,i.separators),percent:t.v/r.vTotal,percentLabel:m.formatPiePercent(t.v/r.vTotal,i.separators),color:t.color,text:t.text,customdata:s.castOption(n,t.i,"customdata")},_=m.getFirstFilled(n.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=s.texttemplateString({data:[b,n._meta],fallback:n.texttemplatefallback,labels:b,locale:e._fullLayout._d3locale,template:x})}else t.text=""}}function F(e,t){var r=e.rotate*Math.PI/180,i=Math.cos(r),n=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*i-o*n,e.textY=a*n+o*i,e.noCenter=!0}t.exports={plot:function(e,t){var n=e._context.staticPlot,h=e._fullLayout,p=h._size;f("pie",h),b(t,e),L(t,p);var g=s.makeTraceGroups(h._pielayer,t,"trace").each(function(t){var f=r.select(this),g=t[0],y=g.trace;(function(e){var t,r,i,n=e[0],a=n.r,o=n.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/n.vTotal,u="px0",c="px1";if("counterclockwise"===o.direction){for(t=0;tn.vTotal/2),r.halfangle=Math.PI*Math.min(r.v/n.vTotal,.5),r.ring=1-o.hole,r.rInscribed=r.v!==n.vTotal||n.trace.hole?Math.min(1/(1+1/Math.sin(r.halfangle)),r.ring/2):1)})(t),f.attr("stroke-linejoin","round"),f.each(function(){var b,w,T=r.select(this).selectAll("g.slice").data(t);T.enter().append("g").classed("slice",!0),T.exit().remove();var A=[[[],[]],[[],[]]],M=!1;T.each(function(i,a){if(i.hidden)return void r.select(this).selectAll("path,g").remove();i.pointNumber=i.i,i.curveNumber=y.index,A[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var l=g.cx,u=g.cy,f=r.select(this),p=f.selectAll("path.surface").data([i]);if(p.enter().append("path").classed("surface",!0).style({"pointer-events":n?"none":"all"}),f.call(v,e,t),y.pull){var b=+m.castOption(y.pull,i.pts)||0;b>0&&(l+=b*i.pxmid[0],u+=b*i.pxmid[1])}function w(e,t,r,n){var a=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*g.r+","+n*g.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}i.cxFinal=l,i.cyFinal=u;var T=y.hole;if(i.v===g.vTotal){var k="M"+(l+i.px0[0])+","+(u+i.px0[1])+w(i.px0,i.pxmid,!0,1)+w(i.pxmid,i.px0,!0,1)+"Z";T?p.attr("d","M"+(l+T*i.px0[0])+","+(u+T*i.px0[1])+w(i.px0,i.pxmid,!1,T)+w(i.pxmid,i.px0,!1,T)+"Z"+k):p.attr("d",k)}else{var S=w(i.px0,i.px1,!0,1);if(T){var D=1-T;p.attr("d","M"+(l+T*i.px1[0])+","+(u+T*i.px1[1])+w(i.px1,i.px0,!1,T)+"l"+D*i.px0[0]+","+D*i.px0[1]+S+"Z")}else p.attr("d","M"+l+","+u+"l"+i.px0[0]+","+i.px0[1]+S+"Z")}z(e,i,g);var C=m.castOption(y.textposition,i.pts),I=f.selectAll("g.slicetext").data(i.text&&"none"!==C?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each(function(){var n=s.ensureSingle(r.select(this),"text","",function(e){e.attr("data-notex",1)}),f=s.ensureUniformFontSize(e,"outside"===C?(p=y,v=i,b=h.font,{color:m.castOption(p.outsidetextfont.color,v.pts)||m.castOption(p.textfont.color,v.pts)||b.color,family:m.castOption(p.outsidetextfont.family,v.pts)||m.castOption(p.textfont.family,v.pts)||b.family,size:m.castOption(p.outsidetextfont.size,v.pts)||m.castOption(p.textfont.size,v.pts)||b.size,weight:m.castOption(p.outsidetextfont.weight,v.pts)||m.castOption(p.textfont.weight,v.pts)||b.weight,style:m.castOption(p.outsidetextfont.style,v.pts)||m.castOption(p.textfont.style,v.pts)||b.style,variant:m.castOption(p.outsidetextfont.variant,v.pts)||m.castOption(p.textfont.variant,v.pts)||b.variant,textcase:m.castOption(p.outsidetextfont.textcase,v.pts)||m.castOption(p.textfont.textcase,v.pts)||b.textcase,lineposition:m.castOption(p.outsidetextfont.lineposition,v.pts)||m.castOption(p.textfont.lineposition,v.pts)||b.lineposition,shadow:m.castOption(p.outsidetextfont.shadow,v.pts)||m.castOption(p.textfont.shadow,v.pts)||b.shadow}):x(y,i,h.font));n.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,f).call(c.convertToTspans,e);var p,v,b,w,T=o.bBox(n.node());if("outside"===C)w=E(T,i);else if(w=_(T,i,g),"auto"===C&&w.scale<1){var A=s.ensureUniformFontSize(e,y.outsidetextfont);n.call(o.font,A),w=E(T=o.bBox(n.node()),i)}var k=w.textPosAngle,S=void 0===k?i.pxmid:P(g.r,k);if(w.targetX=l+S[0]*w.rCenter+(w.x||0),w.targetY=u+S[1]*w.rCenter+(w.y||0),F(w,T),w.outside){var D=w.targetY;i.yLabelMin=D-T.height/2,i.yLabelMid=D,i.yLabelMax=D+T.height/2,i.labelExtraX=0,i.labelExtraY=0,M=!0}w.fontSize=f.size,d(y.type,w,h),t[a].transform=w,s.setTransormAndDisplay(n,w)})});var k=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each(function(){var t,i,n,a=s.ensureSingle(r.select(this),"text","",function(e){e.attr("data-notex",1)}),h=y.title.text;y._meta&&(h=s.templateString(h,y._meta)),a.text(h).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(c.convertToTspans,e),n="middle center"===y.title.position?(i=Math.sqrt((t=g).titleBox.width*t.titleBox.width+t.titleBox.height*t.titleBox.height),{x:t.cx,y:t.cy,scale:t.trace.hole*t.r*2/i,tx:0,ty:-t.titleBox.height/2+t.trace.title.font.size}):D(g,p),a.attr("transform",u(n.x,n.y)+l(Math.min(1,n.scale))+u(n.tx,n.ty))}),M&&function(e,t){var r,i,n,a,o,l,u,c,h,d,f,p,g;function y(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}for(i=0;i<2;i++)for(n=i?y:v,o=i?Math.max:Math.min,u=i?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(c=e[i][r]).sort(n),d=(h=e[1-i][r]).concat(c),p=[],f=0;f0&&(e.labelExtraY=x),s.isArrayOrTypedArray(t.pull))for(c=0;c=(m.castOption(t.pull,h.pts)||0))&&((e.pxmid[1]-h.pxmid[1])*u>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-e.labelExtraY)*u>0&&(e.labelExtraY+=x):(y+e.labelExtraY-v)*u>0&&(n=3*l*Math.abs(c-d.indexOf(e)),(f=h.cxFinal+a(h.px0[0],h.px1[0])+n-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=f)))}(p[f],x)}}}(A,y),b=T,w=y,b.each(function(e){var t=r.select(this);if(!e.labelExtraX&&!e.labelExtraY)return void t.select("path.textline").remove();var i=t.select("g.slicetext text");e.transform.targetX+=e.labelExtraX,e.transform.targetY+=e.labelExtraY,s.setTransormAndDisplay(i,e.transform);var n=e.cxFinal+e.pxmid[0],o="M"+n+","+(e.cyFinal+e.pxmid[1]),l=(e.yLabelMax-e.yLabelMin)*(e.pxmid[0]<0?-1:1)/4;if(e.labelExtraX){var u=e.labelExtraX*e.pxmid[1]/e.pxmid[0],c=e.yLabelMid+e.labelExtraY-(e.cyFinal+e.pxmid[1]);Math.abs(u)>Math.abs(c)?o+="l"+c*e.pxmid[0]/e.pxmid[1]+","+c+"H"+(n+e.labelExtraX+l):o+="l"+e.labelExtraX+","+u+"v"+(c-u)+"h"+l}else o+="V"+(e.yLabelMid+e.labelExtraY)+"h"+l;s.ensureSingle(t,"path","textline").call(a.stroke,w.outsidetextfont.color).attr({"stroke-width":Math.min(2,w.outsidetextfont.size/8),d:o,fill:"none"})}),M&&y.automargin){var S=o.bBox(f.node()),C=y.domain,I=p.w*(C.x[1]-C.x[0]),L=p.h*(C.y[1]-C.y[0]),O=(.5*I-g.r)/p.w,R=(.5*L-g.r)/p.h;i.autoMargin(e,"pie."+y.uid+".automargin",{xl:C.x[0]-O,xr:C.x[1]+O,yb:C.y[0]-R,yt:C.y[1]+R,l:Math.max(g.cx-g.r-S.left,0),r:Math.max(S.right-(g.cx+g.r),0),b:Math.max(S.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-S.top,0),pad:5})}})});setTimeout(function(){g.selectAll("tspan").each(function(){var e=r.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))})},0)},formatSliceLabel:z,transformInsideText:_,determineInsideTextFont:x,positionTitleOutside:D,prerenderTitles:b,layoutAreas:L,attachFxHandlers:v,computeTransform:F}}}),u7=m({"src/traces/pie/style.js"(e,t){var r=M(),i=rM(),n=aC().resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");n(e,t,"pie"),t.each(function(t){var n=t[0].trace,a=r.select(this);a.style({opacity:n.opacity}),a.selectAll("path.surface").each(function(t){r.select(this).call(i,t,n,e)})})}}}),u9=m({"src/traces/pie/base_plot.js"(e){var t=tO();e.name="pie",e.plot=function(r,i,n,a){t.plotBasePlot(e.name,r,i,n,a)},e.clean=function(r,i,n,a){t.cleanBasePlot(e.name,r,i,n,a)}}}),ce=m({"src/traces/pie/index.js"(e,t){t.exports={attributes:u1(),supplyDefaults:u2().supplyDefaults,supplyLayoutDefaults:u5(),layoutAttributes:u3(),calc:u4().calc,crossTraceCalc:u4().crossTraceCalc,plot:u8().plot,style:u7(),styleOne:rM(),moduleType:"trace",name:"pie",basePlotModule:u9(),categories:["pie-like","pie","showLegend"],meta:{}}}}),ct=m({"lib/pie.js"(e,t){t.exports=ce()}}),cr=m({"src/traces/sunburst/base_plot.js"(e){var t=tO();e.name="sunburst",e.plot=function(r,i,n,a){t.plotBasePlot(e.name,r,i,n,a)},e.clean=function(r,i,n,a){t.cleanBasePlot(e.name,r,i,n,a)}}}),ci=m({"src/traces/sunburst/constants.js"(e,t){t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),cn=m({"src/traces/sunburst/attributes.js"(e,t){var r=X(),{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=eY(),o=tG(),s=ai().attributes,l=u1(),u=ci(),c=H().extendFlat,h=e$().pattern;t.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},l.marker.line.color,{dflt:null}),width:c({},l.marker.line.width,{dflt:1}),editType:"calc"},pattern:h,editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:l.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:n({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),hovertext:l.hovertext,hoverinfo:c({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:i({},{keys:u.eventDataKeys}),hovertemplatefallback:a(),textfont:l.textfont,insidetextorientation:l.insidetextorientation,insidetextfont:l.insidetextfont,outsidetextfont:c({},l.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:l.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:s({name:"sunburst",trace:!0,editType:"calc"})}}}),ca=m({"src/traces/sunburst/layout_attributes.js"(e,t){t.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),co=m({"src/traces/sunburst/defaults.js"(e,t){var r=tb(),i=cn(),n=ai().defaults,a=ak().handleText,o=u2().handleMarkerDefaults,s=t4(),l=s.hasColorscale,u=s.handleDefaults;t.exports=function(e,t,s,c){function h(n,a){return r.coerce(e,t,i,n,a)}var d=h("labels"),f=h("parents");if(!d||!d.length||!f||!f.length){t.visible=!1;return}var p=h("values");h(p&&p.length?"branchvalues":"count"),h("level"),h("maxdepth"),o(e,t,c,h);var m=t._hasColorscale=l(e,"marker","colors")||(e.marker||{}).coloraxis;m&&u(e,t,c,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),h("texttemplatefallback"),t.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),a(e,t,c,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),n(t,c,h),t._length=null}}}),cs=m({"src/traces/sunburst/layout_defaults.js"(e,t){var r=tb(),i=ca();t.exports=function(e,t){function n(n,a){return r.coerce(e,t,i,n,a)}n("sunburstcolorway",t.colorway),n("extendsunburstcolors")}}}),cl=m({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(e,t){var r;r=e,function(e){function t(e,t){return e.parent===t.parent?1:2}function r(e,t){return e+t.x}function i(e,t){return Math.max(e,t.y)}function n(e){var t=0,r=e.children,i=r&&r.length;if(i)for(;--i>=0;)t+=r[i].value;else t=1;e.value=t}function a(e,t){var r,i,n,a,s,c=new u(e),h=+e.value&&(c.value=e.value),d=[c];for(null==t&&(t=o);r=d.pop();)if(h&&(r.value=+r.data.value),(n=t(r.data))&&(s=n.length))for(r.children=Array(s),a=s-1;a>=0;--a)d.push(i=r.children[a]=new u(n[a])),i.parent=r,i.depth=r.depth+1;return c.eachBefore(l)}function o(e){return e.children}function s(e){e.data=e.data.data}function l(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function u(e){this.data=e,this.depth=this.height=0,this.parent=null}u.prototype=a.prototype={constructor:u,count:function(){return this.eachAfter(n)},each:function(e){var t,r,i,n,a=this,o=[a];do for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(i=0,n=r.length;i=0;--r)n.push(t[r]);return this},sum:function(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,i=t.children,n=i&&i.length;--n>=0;)r+=i[n].value;t.value=r})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),i=t.ancestors(),n=null;for(e=r.pop(),t=i.pop();e===t;)n=e,e=r.pop(),t=i.pop();return n}(t,e),i=[t];t!==r;)i.push(t=t.parent);for(var n=i.length;e!==r;)i.splice(n,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each(function(t){e.push(t)}),e},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t},copy:function(){return a(this).eachBefore(s)}};var c=Array.prototype.slice;function h(e){for(var t,r,i=0,n=(e=function(e){for(var t,r,i=e.length;i;)r=Math.random()*i--|0,t=e[i],e[i]=e[r],e[r]=t;return e}(c.call(e))).length,a=[];i0&&r*r>i*i+n*n}function p(e,t){for(var r=0;r(o*=o)?(i=(u+o-n)/(2*u),a=Math.sqrt(Math.max(0,o/u-i*i)),r.x=e.x-i*s-a*l,r.y=e.y-i*l+a*s):(i=(u+n-o)/(2*u),a=Math.sqrt(Math.max(0,n/u-i*i)),r.x=t.x+i*s-a*l,r.y=t.y+i*l+a*s)):(r.x=t.x+r.r,r.y=t.y)}function v(e,t){var r=e.r+t.r-1e-6,i=t.x-e.x,n=t.y-e.y;return r>0&&r*r>i*i+n*n}function x(e){var t=e._,r=e.next._,i=t.r+r.r,n=(t.x*r.r+r.x*t.r)/i,a=(t.y*r.r+r.y*t.r)/i;return n*n+a*a}function b(e){this._=e,this.next=null,this.previous=null}function _(e){var t,r,i,n,a,o,s,l,u,c,d;if(!(n=e.length))return 0;if((t=e[0]).x=0,t.y=0,!(n>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(n>2))return t.r+r.r;y(r,t,i=e[2]),t=new b(t),r=new b(r),i=new b(i),t.next=i.previous=r,r.next=t.previous=i,i.next=r.previous=t;e:for(s=3;sd&&(d=s),(f=Math.max(d/(g=c*c*m),g/h))>p){c-=s;break}p=f}y.push(o={value:c,dice:l1?t:1)},r}(N),q=function e(t){function r(e,r,i,n,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,u,c,h=-1,d=o.length,f=e.value;++h1?t:1)},r}(N);e.cluster=function(){var e=t,n=1,a=1,o=!1;function s(t){var s,l=0;t.eachAfter(function(t){var n=t.children;n?(t.x=n.reduce(r,0)/n.length,t.y=1+n.reduce(i,0)):(t.x=s?l+=e(t,s):0,t.y=0,s=t)});var u=function(e){for(var t;t=e.children;)e=t[0];return e}(t),c=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(t),h=u.x-e(u,c)/2,d=c.x+e(c,u)/2;return t.eachAfter(o?function(e){e.x=(e.x-t.x)*n,e.y=(t.y-e.y)*a}:function(e){e.x=(e.x-h)/(d-h)*n,e.y=(1-(t.y?e.y/t.y:1))*a})}return s.separation=function(t){return arguments.length?(e=t,s):e},s.size=function(e){return arguments.length?(o=!1,n=+e[0],a=+e[1],s):o?null:[n,a]},s.nodeSize=function(e){return arguments.length?(o=!0,n=+e[0],a=+e[1],s):o?[n,a]:null},s},e.hierarchy=a,e.pack=function(){var e=null,t=1,r=1,i=T;function n(n){return n.x=t/2,n.y=r/2,e?n.eachBefore(k(e)).eachAfter(S(i,.5)).eachBefore(E(1)):n.eachBefore(k(M)).eachAfter(S(T,1)).eachAfter(S(i,n.r/Math.min(t,r))).eachBefore(E(Math.min(t,r)/(2*n.r))),n}return n.radius=function(t){return arguments.length?(e=null==t?null:w(t),n):e},n.size=function(e){return arguments.length?(t=+e[0],r=+e[1],n):[t,r]},n.padding=function(e){return arguments.length?(i="function"==typeof e?e:A(+e),n):i},n},e.packEnclose=h,e.packSiblings=function(e){return _(e),e},e.partition=function(){var e=1,t=1,r=0,i=!1;function n(n){var a,o,s=n.height+1;return n.x0=n.y0=r,n.x1=e,n.y1=t/s,n.eachBefore((a=t,o=s,function(e){e.children&&C(e,e.x0,a*(e.depth+1)/o,e.x1,a*(e.depth+2)/o);var t=e.x0,i=e.y0,n=e.x1-r,s=e.y1-r;n0)throw Error("cycle");return a}return r.id=function(t){return arguments.length?(e=w(t),r):e},r.parentId=function(e){return arguments.length?(t=w(e),r):t},r},e.tree=function(){var e=F,t=1,r=1,i=null;function n(n){var l=function(e){for(var t,r,i,n,a,o=new B(e,0),s=[o];t=s.pop();)if(i=t._.children)for(t.children=Array(a=i.length),n=a-1;n>=0;--n)s.push(r=t.children[n]=new B(i[n],n)),r.parent=t;return(o.parent=new B(null,0)).children=[o],o}(n);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),i)n.eachBefore(s);else{var u=n,c=n,h=n;n.eachBefore(function(e){e.xc.x&&(c=e),e.depth>h.depth&&(h=e)});var d=u===c?1:e(u,c)/2,f=d-u.x,p=t/(c.x+d+f),m=r/(h.depth||1);n.eachBefore(function(e){e.x=(e.x+f)*p,e.y=e.depth*m})}return n}function a(t){var r=t.children,i=t.parent.children,n=t.i?i[t.i-1]:null;if(r){!function(e){for(var t,r=0,i=0,n=e.children,a=n.length;--a>=0;)t=n[a],t.z+=r,t.m+=r,r+=t.s+(i+=t.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;n?(t.z=n.z+e(t._,n._),t.m=t.z-a):t.z=a}else n&&(t.z=n.z+e(t._,n._));t.parent.A=function(t,r,i){if(r){for(var n,a,o,s=t,l=t,u=r,c=s.parent.children[0],h=s.m,d=l.m,f=u.m,p=c.m;u=R(u),s=O(s),u&&s;)c=O(c),(l=R(l)).a=t,(o=u.z+f-s.z-h+e(u._,s._))>0&&(function(e,t,r){var i=r/(t.i-e.i);t.c-=i,t.s+=r,e.c+=i,t.z+=r,t.m+=r}((n=u,a=i,n.a.parent===t.parent?n.a:a),t,o),h+=o,d+=o),f+=u.m,h+=s.m,p+=c.m,d+=l.m;u&&!R(l)&&(l.t=u,l.m+=f-d),s&&!O(c)&&(c.t=s,c.m+=h-p,i=t)}return i}(t,n,t.parent.A||i[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(e){return arguments.length?(i=!1,t=+e[0],r=+e[1],n):i?null:[t,r]},n.nodeSize=function(e){return arguments.length?(i=!0,t=+e[0],r=+e[1],n):i?[t,r]:null},n},e.treemap=function(){var e=U,t=!1,r=1,i=1,n=[0],a=T,o=T,s=T,l=T,u=T;function c(e){return e.x0=e.y0=0,e.x1=r,e.y1=i,e.eachBefore(h),n=[0],t&&e.eachBefore(D),e}function h(t){var r=n[t.depth],i=t.x0+r,c=t.y0+r,h=t.x1-r,d=t.y1-r;h=r-1){var c=s[t];c.x0=n,c.y0=a,c.x1=o,c.y1=l;return}for(var h=u[t],d=i/2+h,f=t+1,p=r-1;f>>1;u[m]l-a){var v=(n*y+o*g)/i;e(t,f,g,n,a,v,l),e(f,r,y,v,a,o,l)}else{var x=(a*y+l*g)/i;e(t,f,g,n,a,o,x),e(f,r,y,n,x,o,l)}}(0,l,e.value,t,r,i,n)},e.treemapDice=C,e.treemapResquarify=q,e.treemapSlice=j,e.treemapSliceDice=function(e,t,r,i,n){(1&e.depth?j:C)(e,t,r,i,n)},e.treemapSquarify=U,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof e&&"u">typeof t?e:(r=r||self).d3=r.d3||{})}}),cu=m({"src/traces/sunburst/calc.js"(e){var t=cl(),r=I(),i=tb(),n=t4().makeColorScaleFuncFromTrace,a=u4().makePullColorFn,o=u4().generateExtendedColors,s=t4().calc,l=L().ALMOST_EQUAL,u={},c={},h={};e.calc=function(e,o){var u,c,h,d=e._fullLayout,f=o.ids,p=i.isArrayOrTypedArray(f),m=o.labels,g=o.parents,y=o.values,v=i.isArrayOrTypedArray(y),x=[],b={},_={},w=function(e){return e||"number"==typeof e},T=function(e){return!v||r(y[e])&&y[e]>=0};p?(u=Math.min(f.length,g.length),c=function(e){return w(f[e])&&T(e)},h=function(e){return String(f[e])}):(u=Math.min(m.length,g.length),c=function(e){return w(m[e])&&T(e)},h=function(e){return String(m[e])}),v&&(u=Math.min(u,y.length));for(var A=0;A1){for(var E=i.randstr(),D=0;D>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?cb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?cb(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=cq.exec(e))?new cT(t[1],t[2],t[3],1):(t=cG.exec(e))?new cT(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=cH.exec(e))?cb(t[1],t[2],t[3],t[4]):(t=c$.exec(e))?cb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=cW.exec(e))?cC(t[1],t[2]/100,t[3]/100,1):(t=cY.exec(e))?cC(t[1],t[2]/100,t[3]/100,t[4]):cZ.hasOwnProperty(e)?cx(cZ[e]):"transparent"===e?new cT(0/0,0/0,0/0,0):null}function cx(e){return new cT(e>>16&255,e>>8&255,255&e,1)}function cb(e,t,r,i){return i<=0&&(e=t=r=0/0),new cT(e,t,r,i)}function c_(e){return e instanceof cf||(e=cv(e)),e?new cT((e=e.rgb()).r,e.g,e.b,e.opacity):new cT}function cw(e,t,r,i){return 1==arguments.length?c_(e):new cT(e,t,r,i??1)}function cT(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}function cA(){return`#${cD(this.r)}${cD(this.g)}${cD(this.b)}`}function cM(){return`#${cD(this.r)}${cD(this.g)}${cD(this.b)}${cD((isNaN(this.opacity)?1:this.opacity)*255)}`}function ck(){let e=cS(this.opacity);return`${1===e?"rgb(":"rgba("}${cE(this.r)}, ${cE(this.g)}, ${cE(this.b)}${1===e?")":`, ${e})`}`}function cS(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cE(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cD(e){return((e=cE(e))<16?"0":"")+e.toString(16)}function cC(e,t,r,i){return i<=0?e=t=r=0/0:r<=0||r>=1?e=t=0/0:t<=0&&(e=0/0),new cP(e,t,r,i)}function cI(e){if(e instanceof cP)return new cP(e.h,e.s,e.l,e.opacity);if(e instanceof cf||(e=cv(e)),!e)return new cP;if(e instanceof cP)return e;var t=(e=e.rgb()).r/255,r=e.g/255,i=e.b/255,n=Math.min(t,r,i),a=Math.max(t,r,i),o=0/0,s=a-n,l=(a+n)/2;return s?(o=t===a?(r-i)/s+(r0&&l<1?0:o,new cP(o,s,l,e.opacity)}function cL(e,t,r,i){return 1==arguments.length?cI(e):new cP(e,t,r,i??1)}function cP(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}function cz(e){return(e=(e||0)%360)<0?e+360:e}function cF(e){return Math.max(0,Math.min(1,e||0))}function cO(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var cR,cB,cj,cN,cV,cU,cq,cG,cH,c$,cW,cY,cZ,cX,cK,cJ=p({"node_modules/d3-color/src/color.js"(){cd(),cB=1/(cR=.7),cj="\\s*([+-]?\\d+)\\s*",cN="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cV="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cU=/^#([0-9a-f]{3,8})$/,cq=RegExp(`^rgb\\(${cj},${cj},${cj}\\)$`),cG=RegExp(`^rgb\\(${cV},${cV},${cV}\\)$`),cH=RegExp(`^rgba\\(${cj},${cj},${cj},${cN}\\)$`),c$=RegExp(`^rgba\\(${cV},${cV},${cV},${cN}\\)$`),cW=RegExp(`^hsl\\(${cN},${cV},${cV}\\)$`),cY=RegExp(`^hsla\\(${cN},${cV},${cV},${cN}\\)$`),cZ={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},cc(cf,cv,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:cp,formatHex:cp,formatHex8:cm,formatHsl:cg,formatRgb:cy,toString:cy}),cc(cT,cw,ch(cf,{brighter(e){return e=null==e?cB:Math.pow(cB,e),new cT(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?cR:Math.pow(cR,e),new cT(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cT(cE(this.r),cE(this.g),cE(this.b),cS(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cA,formatHex:cA,formatHex8:cM,formatRgb:ck,toString:ck})),cc(cP,cL,ch(cf,{brighter(e){return e=null==e?cB:Math.pow(cB,e),new cP(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?cR:Math.pow(cR,e),new cP(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,n=2*r-i;return new cT(cO(e>=240?e-240:e+120,n,i),cO(e,n,i),cO(e<120?e+240:e-120,n,i),this.opacity)},clamp(){return new cP(cz(this.h),cF(this.s),cF(this.l),cS(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=cS(this.opacity);return`${1===e?"hsl(":"hsla("}${cz(this.h)}, ${100*cF(this.s)}%, ${100*cF(this.l)}%${1===e?")":`, ${e})`}`}}))}}),cQ=p({"node_modules/d3-color/src/math.js"(){cX=Math.PI/180,cK=180/Math.PI}});function c0(e){if(e instanceof c2)return new c2(e.l,e.a,e.b,e.opacity);if(e instanceof c7)return c9(e);e instanceof cT||(e=c_(e));var t,r,i=c6(e.r),n=c6(e.g),a=c6(e.b),o=c3((.2225045*i+.7168786*n+.0606169*a)/ht);return i===n&&n===a?t=r=o:(t=c3((.4360747*i+.3850649*n+.1430804*a)/he),r=c3((.0139322*i+.0971045*n+.7141733*a)/hr)),new c2(116*o-16,500*(t-o),200*(o-r),e.opacity)}function c1(e,t,r,i){return 1==arguments.length?c0(e):new c2(e,t,r,i??1)}function c2(e,t,r,i){this.l=+e,this.a=+t,this.b=+r,this.opacity=+i}function c3(e){return e>ho?Math.pow(e,.3333333333333333):e/ha+hi}function c5(e){return e>hn?e*e*e:ha*(e-hi)}function c4(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055)}function c6(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function c8(e,t,r,i){return 1==arguments.length?function(e){if(e instanceof c7)return new c7(e.h,e.c,e.l,e.opacity);if(e instanceof c2||(e=c0(e)),0===e.a&&0===e.b)return new c7(0/0,0=1?(r=1,t-1):Math.floor(r*t),n=e[i],a=e[i+1],o=i>0?e[i-1]:2*n-a,s=i()=>e}});function hM(e,t){return function(r){return e+r*t}}function hk(e,t){var r=t-e;return r?hM(e,r>180||r<-180?r-360*Math.round(r/360):r):hw(isNaN(e)?t:e)}function hS(e,t){var r=t-e;return r?hM(e,r):hw(isNaN(e)?t:e)}var hE=p({"node_modules/d3-interpolate/src/color.js"(){hA()}});function hD(e){return function(t){var r,i,n=t.length,a=Array(n),o=Array(n),s=Array(n);for(r=0;rs&&(o=t.slice(s,o),u[l]?u[l]+=o:u[++l]=o),(n=n[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,c.push({i:l,x:hU(n,a)})),s=hY.lastIndex;return s180?l+=360:l-s>180&&(s+=360),d.push({i:h.push(n(h)+"rotate(",null,i)-2,x:hU(s,l)})):l&&h.push(n(h)+"rotate("+l+i),u=a.skewX,c=o.skewX,u!==c?d.push({i:h.push(n(h)+"skewX(",null,i)-2,x:hU(u,c)}):c&&h.push(n(h)+"skewX("+c+i),function(e,t,r,i,a,o){if(e!==r||t!==i){var s=a.push(n(a)+"scale(",null,",",null,")");o.push({i:s-4,x:hU(e,r)},{i:s-2,x:hU(t,i)})}else(1!==r||1!==i)&&a.push(n(a)+"scale("+r+","+i+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,h,d),a=o=null,function(e){for(var t,r=-1,i=d.length;++rhX,interpolateArray:()=>hR,interpolateBasis:()=>hx,interpolateBasisClosed:()=>h_,interpolateCubehelix:()=>d_,interpolateCubehelixLong:()=>dw,interpolateDate:()=>hN,interpolateDiscrete:()=>hJ,interpolateHcl:()=>dy,interpolateHclLong:()=>dv,interpolateHsl:()=>dh,interpolateHslLong:()=>dd,interpolateHue:()=>h0,interpolateLab:()=>dp,interpolateNumber:()=>hU,interpolateNumberArray:()=>hz,interpolateObject:()=>hG,interpolateRgb:()=>hC,interpolateRgbBasis:()=>hI,interpolateRgbBasisClosed:()=>hL,interpolateRound:()=>h2,interpolateString:()=>h$,interpolateTransformCss:()=>di,interpolateTransformSvg:()=>dn,interpolateZoom:()=>dl,piecewise:()=>dA,quantize:()=>dk});var dD=p({"node_modules/d3-interpolate/src/index.js"(){hK(),hj(),hb(),hT(),hV(),hQ(),h1(),hq(),hO(),hH(),h3(),hZ(),da(),du(),hP(),df(),dm(),dx(),dT(),dM(),dS()}}),dC=m({"src/traces/sunburst/fill_one.js"(e,t){var r=rt(),i=er();t.exports=function(e,t,n,a,o){var s=t.data.data,l=s.i,u=o||s.color;if(l>=0){t.i=s.i;var c=n.marker;c.pattern&&c.colors&&c.pattern.shape||(c.color=u,t.color=u),r.pointStyle(e,n,a,t)}else i.fill(e,u)}}}),dI=m({"src/traces/sunburst/style.js"(e,t){var r=M(),i=er(),n=tb(),a=aC().resizeText,o=dC();function s(e,t,r,a){var s=t.data.data,l=!t.children,u=s.i,c=n.castOption(r,u,"marker.line.color")||i.defaultLine,h=n.castOption(r,u,"marker.line.width")||0;e.call(o,t,r,a).style("stroke-width",h).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");a(e,t,"sunburst"),t.each(function(t){var i=r.select(this),n=t[0].trace;i.style("opacity",n.opacity),i.selectAll("path.surface").each(function(t){r.select(this).call(s,t,n,e)})})},styleOne:s}}}),dL=m({"src/traces/sunburst/helpers.js"(e){var t=tb(),r=er(),i=rm(),n=rT();function a(e){return e.data.data.pid}e.findEntryWithLevel=function(t,r){var i;return r&&t.eachAfter(function(t){if(e.getPtId(t)===r)return i=t.copy()}),i||t},e.findEntryWithChild=function(t,r){var i;return t.eachAfter(function(t){for(var n=t.children||[],a=0;a0)},e.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},e.isHeader=function(t,r){return!(e.isLeaf(t)||t.depth===r._maxDepth-1)},e.getParent=function(t,r){return e.findEntryWithLevel(t,a(r))},e.listPath=function(t,r){var i=t.parent;if(!i)return[];var n=r?[i.data[r]]:[i];return e.listPath(i,r).concat(n)},e.getPath=function(t){return e.listPath(t,"label").join("/")+"/"},e.formatValue=n.formatPieValue,e.formatPercent=function(e,r){var i=t.formatPercent(e,0);return"0%"===i&&(i=n.formatPiePercent(e,r)),i}}}),dP=m({"src/traces/sunburst/fx.js"(e,t){var r=M(),i=e1(),n=t7().appendArrayPointValue,a=rO(),o=tb(),s=tM(),l=dL(),u=rT().formatPieValue;function c(e,t,r){for(var i=e.data.data,a={curveNumber:t.index,pointNumber:i.i,data:t._input,fullData:t},o=0;o"),name:M||I("name")?v.name:void 0,color:A("hoverlabel.bgcolor")||x.color,borderColor:A("hoverlabel.bordercolor"),fontFamily:A("hoverlabel.font.family"),fontSize:A("hoverlabel.font.size"),fontColor:A("hoverlabel.font.color"),fontWeight:A("hoverlabel.font.weight"),fontStyle:A("hoverlabel.font.style"),fontVariant:A("hoverlabel.font.variant"),nameLength:A("hoverlabel.namelength"),textAlign:A("hoverlabel.align"),hovertemplate:M,hovertemplateLabels:E,eventData:h};g&&(R.x0=L-i.rInscribed*i.rpx1,R.x1=L+i.rInscribed*i.rpx1,R.idealAlign=i.pxmid[0]<0?"left":"right"),y&&(R.x=L,R.idealAlign=L<0?"left":"right");var B=[];a.loneHover(R,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:n,inOut_bbox:B}),h[0].bbox=B[0],p._hasHoverLabel=!0}if(y){var j=e.select("path.surface");d.styleOne(j,i,v,n,{hovered:!0})}p._hasHoverEvent=!0,n.emit("plotly_hover",{points:h||[c(i,v,d.eventDataKeys)],event:r.event})}}),e.on("mouseout",function(t){var i=n._fullLayout,o=n._fullData[p.index],s=r.select(this).datum();if(p._hasHoverEvent&&(t.originalEvent=r.event,n.emit("plotly_unhover",{points:[c(s,o,d.eventDataKeys)],event:r.event}),p._hasHoverEvent=!1),p._hasHoverLabel&&(a.loneUnhover(i._hoverlayer.node()),p._hasHoverLabel=!1),y){var l=e.select("path.surface");d.styleOne(l,s,o,n,{hovered:!1})}}),e.on("click",function(e){var t=n._fullLayout,o=n._fullData[p.index],u=g&&(l.isHierarchyRoot(e)||l.isLeaf(e)),h=l.getPtId(e),f=l.isEntry(e)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(f),v={points:[c(e,o,d.eventDataKeys)],event:r.event};u||(v.nextLevel=y);var x=s.triggerHandler(n,"plotly_"+p.type+"click",v);if(!1!==x&&t.hovermode&&(n._hoverdata=[c(e,o,d.eventDataKeys)],a.click(n,r.event)),!u&&!1!==x&&!n._dragging&&!n._transitioning){i.call("_storeDirectGUIEdit",o,t._tracePreGUI[o.uid],{level:o.level});var b={data:[{level:y}],traces:[p.index]},_={frame:{redraw:!1,duration:d.transitionTime},transition:{duration:d.transitionTime,easing:d.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(t._hoverlayer.node()),i.call("animate",n,b,_)}})}}}),dz=m({"src/traces/sunburst/plot.js"(e){var t=M(),r=cl(),i=(dD(),x(dE)).interpolate,n=rt(),a=tb(),o=tj(),s=aC(),l=s.recordMinTextSize,u=s.clearMinTextSize,c=u8(),h=rT().getRotationAngle,d=c.computeTransform,f=c.transformInsideText,p=dI().styleOne,m=aL().resizeText,g=dP(),y=ci(),v=dL();function b(s,u,c,m){var x,b=s._context.staticPlot,w=s._fullLayout,T=!w.uniformtext.mode&&v.hasTransition(m),A=t.select(c).selectAll("g.slice"),M=u[0],k=M.trace,S=M.hierarchy,E=v.findEntryWithLevel(S,k.level),D=v.getMaxDepth(k),C=w._size,I=k.domain,L=C.w*(I.x[1]-I.x[0]),P=C.h*(I.y[1]-I.y[0]),z=.5*Math.min(L,P),F=M.cx=C.l+C.w*(I.x[1]+I.x[0])/2,O=M.cy=C.t+C.h*(1-I.y[0])-P/2;if(!E)return A.remove();var R=null,B={};T&&A.each(function(e){B[v.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!R&&v.isEntry(e)&&(R=e)});var j=(x=E,r.partition().size([2*Math.PI,x.height+1])(x)).descendants(),N=E.height+1,V=0,U=D;M.hasMultipleRoots&&v.isHierarchyRoot(E)&&(j=j.slice(1),N-=1,V=1,U+=1),j=j.filter(function(e){return e.y1<=U});var q=h(k.rotation);q&&j.forEach(function(e){e.x0+=q,e.x1+=q});var G=Math.min(N,D),H=function(e){return(e-V)/G*z},$=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},W=function(e){return a.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,F,O)},Y=function(e){return F+_(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},Z=function(e){return O+_(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(A=A.data(j,v.getPtId)).enter().append("g").classed("slice",!0),T?A.exit().transition().each(function(){var e=t.select(this);e.select("path.surface").transition().attrTween("d",function(e){var t=function(e){var t,r=v.getPtId(e),n=B[r],a=B[v.getPtId(E)];if(a){var o=(e.x1>a.x1?2*Math.PI:0)+q;t=e.rpx1X?2*Math.PI:0)+q;t={x0:o,x1:o}}else t={rpx0:z,rpx1:z},a.extendFlat(t,Q(e));else t={rpx0:0,rpx1:0};else t={x0:q,x1:q};return i(t,n)}(e);return function(e){return W(t(e))}}):m.attr("d",W),h.call(g,E,s,u,{eventDataKeys:y.eventDataKeys,transitionTime:y.CLICK_TRANSITION_TIME,transitionEasing:y.CLICK_TRANSITION_EASING}).call(v.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),m.call(p,r,k,s);var x=a.ensureSingle(h,"g","slicetext"),_=a.ensureSingle(x,"text","",function(e){e.attr("data-notex",1)}),A=a.ensureUniformFontSize(s,v.determineTextFont(k,r,w.font));_.text(e.formatSliceLabel(r,E,k,u,w)).classed("slicetext",!0).attr("text-anchor","middle").call(n.font,A).call(o.convertToTspans,s);var S=n.bBox(_.node());r.transform=f(S,r,M),r.transform.targetX=Y(r),r.transform.targetY=Z(r);var D=function(e,t){var r=e.transform;return d(r,t),r.fontSize=A.size,l(k.type,r,w),a.getTextTransform(r)};T?_.transition().attrTween("transform",function(e){var t=function(e){var t,r=B[v.getPtId(e)],n=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},R)if(e.parent)if(X){var o=e.x1>X?2*Math.PI:0;t.x0=t.x1=o}else a.extendFlat(t,Q(e));else t.x0=t.x1=q;else t.x0=t.x1=q;var s=i(t.transform.textPosAngle,e.transform.textPosAngle),u=i(t.rpx1,e.rpx1),c=i(t.x0,e.x0),h=i(t.x1,e.x1),d=i(t.transform.scale,n.scale),f=i(t.transform.rotate,n.rotate),p=0===n.rCenter?3:0===t.transform.rCenter?1/3:1,m=i(t.transform.rCenter,n.rCenter);return function(e){var t=u(e),r=c(e),i=h(e),a=m(Math.pow(e,p)),o={pxmid:$(t,(r+i)/2),rpx1:t,transform:{textPosAngle:s(e),rCenter:a,x:n.x,y:n.y}};return l(k.type,n,w),{transform:{targetX:Y(o),targetY:Z(o),scale:d(e),rotate:f(e),rCenter:a}}}}(e);return function(e){return D(t(e),S)}}):_.attr("transform",D(r,S))})}function _(e){var t,r;return t=e.rpx1,[t*Math.sin(r=e.transform.textPosAngle),-t*Math.cos(r)]}e.plot=function(e,r,i,n){var a,o,s=e._fullLayout,l=s._sunburstlayer,c=!i,h=!s.uniformtext.mode&&v.hasTransition(i);(u("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,function(e){return e[0].trace.uid})).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h)?(n&&(o=n()),t.transition().duration(i.duration).ease(i.easing).each("end",function(){o&&o()}).each("interrupt",function(){o&&o()}).each(function(){l.selectAll("g.trace").each(function(t){b(e,t,this,i)})})):(a.each(function(t){b(e,t,this,i)}),s.uniformtext.mode&&m(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),c&&a.exit().remove()},e.formatSliceLabel=function(e,t,r,i,n){var o=r.texttemplate,s=r.textinfo;if(!o&&(!s||"none"===s))return"";var l=n.separators,u=i[0],c=e.data.data,h=u.hierarchy,d=v.isHierarchyRoot(e),f=v.getParent(h,e),p=v.getValue(e);if(!o){var m,g=s.split("+"),y=function(e){return -1!==g.indexOf(e)},x=[];if(y("label")&&c.label&&x.push(c.label),c.hasOwnProperty("v")&&y("value")&&x.push(v.formatValue(c.v,l)),!d){y("current path")&&x.push(v.getPath(e.data));var b=0;y("percent parent")&&b++,y("percent entry")&&b++,y("percent root")&&b++;var _=b>1;if(b){var w,T=function(e){m=v.formatPercent(w,l),_&&(m+=" of "+e),x.push(m)};y("percent parent")&&!d&&(w=p/v.getValue(f),T("parent")),y("percent entry")&&(w=p/v.getValue(t),T("entry")),y("percent root")&&(w=p/v.getValue(h),T("root"))}}return y("text")&&(m=a.castOption(r,c.i,"text"),a.isValidTextValue(m)&&x.push(m)),x.join("
")}var A=a.castOption(r,c.i,"texttemplate");if(!A)return"";var M={};c.label&&(M.label=c.label),c.hasOwnProperty("v")&&(M.value=c.v,M.valueLabel=v.formatValue(c.v,l)),M.currentPath=v.getPath(e.data),d||(M.percentParent=p/v.getValue(f),M.percentParentLabel=v.formatPercent(M.percentParent,l),M.parent=v.getPtLabel(f)),M.percentEntry=p/v.getValue(t),M.percentEntryLabel=v.formatPercent(M.percentEntry,l),M.entry=v.getPtLabel(t),M.percentRoot=p/v.getValue(h),M.percentRootLabel=v.formatPercent(M.percentRoot,l),M.root=v.getPtLabel(h),c.hasOwnProperty("color")&&(M.color=c.color);var k=a.castOption(r,c.i,"text");return(a.isValidTextValue(k)||""===k)&&(M.text=k),M.customdata=a.castOption(r,c.i,"customdata"),a.texttemplateString({data:[M,r._meta],fallback:r.texttemplatefallback,labels:M,locale:n._d3locale,template:A})}}}),dF=m({"src/traces/sunburst/index.js"(e,t){t.exports={moduleType:"trace",name:"sunburst",basePlotModule:cr(),categories:[],animatable:!0,attributes:cn(),layoutAttributes:ca(),supplyDefaults:co(),supplyLayoutDefaults:cs(),calc:cu().calc,crossTraceCalc:cu().crossTraceCalc,plot:dz().plot,style:dI().style,colorbar:nr(),meta:{}}}}),dO=m({"lib/sunburst.js"(e,t){t.exports=dF()}}),dR=m({"src/traces/treemap/base_plot.js"(e){var t=tO();e.name="treemap",e.plot=function(r,i,n,a){t.plotBasePlot(e.name,r,i,n,a)},e.clean=function(r,i,n,a){t.cleanBasePlot(e.name,r,i,n,a)}}}),dB=m({"src/traces/treemap/constants.js"(e,t){t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),dj=m({"src/traces/treemap/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:i,templatefallbackAttrs:n}=eY(),a=tG(),o=ai().attributes,s=u1(),l=cn(),u=dB(),c=H().extendFlat,h=e$().pattern;t.exports={labels:l.labels,parents:l.parents,values:l.values,branchvalues:l.branchvalues,count:l.count,level:l.level,maxdepth:l.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:c({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:l.marker.colors,pattern:h,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:l.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),texttemplatefallback:n({editType:"plot"}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:r({},{keys:u.eventDataKeys}),hovertemplatefallback:n(),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}}}),dN=m({"src/traces/treemap/layout_attributes.js"(e,t){t.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),dV=m({"src/traces/treemap/defaults.js"(e,t){var r=tb(),i=dj(),n=er(),a=ai().defaults,o=ak().handleText,s=i6().TEXTPAD,l=u2().handleMarkerDefaults,u=t4(),c=u.hasColorscale,h=u.handleDefaults;t.exports=function(e,t,u,d){function f(n,a){return r.coerce(e,t,i,n,a)}var p=f("labels"),m=f("parents");if(!p||!p.length||!m||!m.length){t.visible=!1;return}var g=f("values");f(g&&g.length?"branchvalues":"count"),f("level"),f("maxdepth"),"squarify"===f("tiling.packing")&&f("tiling.squarifyratio"),f("tiling.flip"),f("tiling.pad");var y=f("text");f("texttemplate"),f("texttemplatefallback"),t.texttemplate||f("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback");var v=f("pathbar.visible");o(e,t,d,f,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition");var x=-1!==t.textposition.indexOf("bottom");l(e,t,d,f),(t._hasColorscale=c(e,"marker","colors")||(e.marker||{}).coloraxis)?h(e,t,d,f,{prefix:"marker.",cLetter:"c"}):f("marker.depthfade",!(t.marker.colors||[]).length);var b=2*t.textfont.size;f("marker.pad.t",x?b/4:b),f("marker.pad.l",b/4),f("marker.pad.r",b/4),f("marker.pad.b",x?b:b/4),f("marker.cornerradius"),t._hovered={marker:{line:{width:2,color:n.contrast(d.paper_bgcolor)}}},v&&(f("pathbar.thickness",t.pathbar.textfont.size+2*s),f("pathbar.side"),f("pathbar.edgeshape")),f("sort"),f("root.color"),a(t,d,f),t._length=null}}}),dU=m({"src/traces/treemap/layout_defaults.js"(e,t){var r=tb(),i=dN();t.exports=function(e,t){function n(n,a){return r.coerce(e,t,i,n,a)}n("treemapcolorway",t.colorway),n("extendtreemapcolors")}}}),dq=m({"src/traces/treemap/calc.js"(e){var t=cu();e.calc=function(e,r){return t.calc(e,r)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc("treemap",e)}}}),dG=m({"src/traces/treemap/flip_tree.js"(e,t){t.exports=function e(t,r,i){i.swapXY&&(n=t.x0,t.x0=t.y0,t.y0=n,n=t.x1,t.x1=t.y1,t.y1=n),i.flipX&&(n=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-n),i.flipY&&(n=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-n);var n,a=t.children;if(a)for(var o=0;o0)for(var b=0;b").join(" ")||"";var p=i.ensureSingle(d,"g","slicetext"),T=i.ensureSingle(p,"text","",function(e){e.attr("data-notex",1)}),D=i.ensureUniformFontSize(e,u.determineTextFont(C,o,E.font,{onPathbar:!0}));T.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(n.font,D).call(a.convertToTspans,e),o.textBB=n.bBox(T.node()),o.transform=b(o,{fontSize:D.size,onPathbar:!0}),o.transform.fontSize=D.size,w?T.transition().attrTween("transform",function(e){var t=M(e,!0,k,[m,g]);return function(e){return _(t(e))}}):T.attr("transform",_(o))})}}}),dY=m({"src/traces/treemap/plot_one.js"(e,t){var r=M(),i=(dD(),x(dE)).interpolate,n=dL(),a=tb(),o=i6().TEXTPAD,s=aP().toMoveInsideBar,l=aC().recordMinTextSize,u=dB(),c=dW();function h(e){return n.isHierarchyRoot(e)?"":n.getPtId(e)}t.exports=function(e,t,d,f,p){var m=e._fullLayout,g=t[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,b=n.findEntryWithLevel(x,y.level),_=r.select(d),w=_.selectAll("g.pathbar"),T=_.selectAll("g.slice");if(!b){w.remove(),T.remove();return}var A=n.isHierarchyRoot(b),M=!m.uniformtext.mode&&n.hasTransition(f),k=n.getMaxDepth(y),S=m._size,E=y.domain,D=S.w*(E.x[1]-E.x[0]),C=S.h*(E.y[1]-E.y[0]),I=y.pathbar.thickness,L=y.marker.line.width+u.gapWithPathbar,P=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?C+L:-(I+L):0,z={x0:D,x1:D,y0:P,y1:P+I},F=function(e,t,r){var i=y.tiling.pad,n=function(e){return e-i<=t.x0},a=function(e){return e+i>=t.x1},o=function(e){return e-i<=t.y0},s=function(e){return e+i>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:n(e.x0-i)?0:a(e.x0-i)?r[0]:e.x0,x1:n(e.x1+i)?0:a(e.x1+i)?r[0]:e.x1,y0:o(e.y0-i)?0:s(e.y0-i)?r[1]:e.y0,y1:o(e.y1+i)?0:s(e.y1+i)?r[1]:e.y1}},O=null,R={},B={},j=null,N=function(e,t){return t?R[h(e)]:B[h(e)]},V=function(e,t,r,i){if(t)return R[h(x)]||z;var n=B[y.level]||r;return e.data.depth-b.data.depth=(i-=(v?Q:Q.r)-o)){var f,p=(r+i)/2;r=p,i=p}en?n<(f=a-(v?Q:Q.b))&&f"===J?(l.x-=a,u.x-=a,c.x-=a,h.x-=a):"/"===J?(c.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===J?(l.x-=a,u.x-=a,o.x-=a/2,s.x-=a/2):"<"===J&&(o.x-=a,s.x-=a),K(l),K(h),K(o),K(u),K(c),K(s),"M"+(l.x+",")+l.y+"L"+(u.x+",")+u.y+"L"+(s.x+",")+s.y+"L"+(c.x+",")+c.y+"L"+(h.x+",")+h.y+"L"+(o.x+",")+o.y+"Z"},toMoveInsideSlice:ea,makeUpdateSliceInterpolator:el,makeUpdateTextInterpolator:eu,handleSlicesExit:ec,hasTransition:M,strTransform:eh}):w.remove()}}}),dZ=m({"src/traces/treemap/draw.js"(e,t){var r=M(),i=dL(),n=aC().clearMinTextSize,a=aL().resizeText,o=dY();t.exports=function(e,t,s,l,u){var c,h,d=u.type,f=u.drawDescendants,p=e._fullLayout,m=p["_"+d+"layer"],g=!s;(n(d,p),(c=m.selectAll("g.trace."+d).data(t,function(e){return e[0].trace.uid})).enter().append("g").classed("trace",!0).classed(d,!0),c.order(),!p.uniformtext.mode&&i.hasTransition(s))?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){m.selectAll("g.trace").each(function(t){o(e,t,this,s,f)})})):(c.each(function(t){o(e,t,this,s,f)}),p.uniformtext.mode&&a(e,m.selectAll(".trace"),d)),g&&c.exit().remove()}}}),dX=m({"src/traces/treemap/draw_descendants.js"(e,t){var r=M(),i=tb(),n=rt(),a=tj(),o=dH(),s=d$().styleOne,l=dB(),u=dL(),c=dP(),h=dz().formatSliceLabel;t.exports=function(e,t,d,f,p){var m=p.width,g=p.height,y=p.viewX,v=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,A=p.makeUpdateSliceInterpolator,M=p.makeUpdateTextInterpolator,k=p.prevEntry,S=e._context.staticPlot,E=e._fullLayout,D=t[0].trace,C=-1!==D.textposition.indexOf("left"),I=-1!==D.textposition.indexOf("right"),L=-1!==D.textposition.indexOf("bottom"),P=!L&&!D.marker.pad.t||L&&!D.marker.pad.b,z=o(d,[m,g],{packing:D.tiling.packing,squarifyratio:D.tiling.squarifyratio,flipX:D.tiling.flip.indexOf("x")>-1,flipY:D.tiling.flip.indexOf("y")>-1,pad:{inner:D.tiling.pad,top:D.marker.pad.t,left:D.marker.pad.l,right:D.marker.pad.r,bottom:D.marker.pad.b}}).descendants(),F=1/0,O=-1/0;z.forEach(function(e){var t=e.depth;t>=D._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(F=Math.min(F,t),O=Math.max(O,t))}),f=f.data(z,u.getPtId),D._maxVisibleLayers=isFinite(O)?O-F+1:0,f.enter().append("g").classed("slice",!0),T(f,!1,{},[m,g],x),f.order();var R=null;if(w&&k){var B=u.getPtId(k);f.each(function(e){null===R&&u.getPtId(e)===B&&(R={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})})}var j=function(){return R||{x0:0,x1:m,y0:0,y1:g}},N=f;return w&&(N=N.transition().each("end",function(){var t=r.select(this);u.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),N.each(function(o){var f=u.isHeader(o,D);o._x0=y(o.x0),o._x1=y(o.x1),o._y0=v(o.y0),o._y1=v(o.y1),o._hoverX=y(o.x1-D.marker.pad.r),o._hoverY=v(L?o.y1-D.marker.pad.b/2:o.y0+D.marker.pad.t/2);var p=r.select(this),T=i.ensureSingle(p,"path","surface",function(e){e.style("pointer-events",S?"none":"all")});w?T.transition().attrTween("d",function(e){var t=A(e,!1,j(),[m,g]);return function(e){return x(t(e))}}):T.attr("d",x),p.call(c,d,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,e,{isTransitioning:e._transitioning}),T.call(s,o,D,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":f?o._text=P?"":u.getPtLabel(o)||"":o._text=h(o,d,D,t,E)||"";var k=i.ensureSingle(p,"g","slicetext"),z=i.ensureSingle(k,"text","",function(e){e.attr("data-notex",1)}),F=i.ensureUniformFontSize(e,u.determineTextFont(D,o,E.font)),O=o._text||" ",R=f&&-1===O.indexOf("
");z.text(O).classed("slicetext",!0).attr("text-anchor",I?"end":C||R?"start":"middle").call(n.font,F).call(a.convertToTspans,e),o.textBB=n.bBox(z.node()),o.transform=b(o,{fontSize:F.size,isHeader:f}),o.transform.fontSize=F.size,w?z.transition().attrTween("transform",function(e){var t=M(e,!1,j(),[m,g]);return function(e){return _(t(e))}}):z.attr("transform",_(o))}),R}}}),dK=m({"src/traces/treemap/plot.js"(e,t){var r=dZ(),i=dX();t.exports=function(e,t,n,a){return r(e,t,n,a,{type:"treemap",drawDescendants:i})}}}),dJ=m({"src/traces/treemap/index.js"(e,t){t.exports={moduleType:"trace",name:"treemap",basePlotModule:dR(),categories:[],animatable:!0,attributes:dj(),layoutAttributes:dN(),supplyDefaults:dV(),supplyLayoutDefaults:dU(),calc:dq().calc,crossTraceCalc:dq().crossTraceCalc,plot:dK(),style:d$().style,colorbar:nr(),meta:{}}}}),dQ=m({"lib/treemap.js"(e,t){t.exports=dJ()}}),d0=m({"src/traces/icicle/base_plot.js"(e){var t=tO();e.name="icicle",e.plot=function(r,i,n,a){t.plotBasePlot(e.name,r,i,n,a)},e.clean=function(r,i,n,a){t.cleanBasePlot(e.name,r,i,n,a)}}}),d1=m({"src/traces/icicle/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:i,templatefallbackAttrs:n}=eY(),a=tG(),o=ai().attributes,s=u1(),l=cn(),u=dj(),c=dB(),h=H().extendFlat,d=e$().pattern;t.exports={labels:l.labels,parents:l.parents,values:l.values,branchvalues:l.branchvalues,count:l.count,level:l.level,maxdepth:l.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:u.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:h({colors:l.marker.colors,line:l.marker.line,pattern:d,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:l.leaf,pathbar:u.pathbar,text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),texttemplatefallback:n({editType:"plot"}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:r({},{keys:c.eventDataKeys}),hovertemplatefallback:n(),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u.outsidetextfont,textposition:u.textposition,sort:s.sort,root:l.root,domain:o({name:"icicle",trace:!0,editType:"calc"})}}}),d2=m({"src/traces/icicle/layout_attributes.js"(e,t){t.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),d3=m({"src/traces/icicle/defaults.js"(e,t){var r=tb(),i=d1(),n=er(),a=ai().defaults,o=ak().handleText,s=i6().TEXTPAD,l=u2().handleMarkerDefaults,u=t4(),c=u.hasColorscale,h=u.handleDefaults;t.exports=function(e,t,u,d){function f(n,a){return r.coerce(e,t,i,n,a)}var p=f("labels"),m=f("parents");if(!p||!p.length||!m||!m.length){t.visible=!1;return}var g=f("values");f(g&&g.length?"branchvalues":"count"),f("level"),f("maxdepth"),f("tiling.orientation"),f("tiling.flip"),f("tiling.pad");var y=f("text");f("texttemplate"),f("texttemplatefallback"),t.texttemplate||f("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback");var v=f("pathbar.visible");o(e,t,d,f,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("textposition"),l(e,t,d,f);var x=t._hasColorscale=c(e,"marker","colors")||(e.marker||{}).coloraxis;x&&h(e,t,d,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",x?1:.7),t._hovered={marker:{line:{width:2,color:n.contrast(d.paper_bgcolor)}}},v&&(f("pathbar.thickness",t.pathbar.textfont.size+2*s),f("pathbar.side"),f("pathbar.edgeshape")),f("sort"),f("root.color"),a(t,d,f),t._length=null}}}),d5=m({"src/traces/icicle/layout_defaults.js"(e,t){var r=tb(),i=d2();t.exports=function(e,t){function n(n,a){return r.coerce(e,t,i,n,a)}n("iciclecolorway",t.colorway),n("extendiciclecolors")}}}),d4=m({"src/traces/icicle/calc.js"(e){var t=cu();e.calc=function(e,r){return t.calc(e,r)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc("icicle",e)}}}),d6=m({"src/traces/icicle/partition.js"(e,t){var r=cl(),i=dG();t.exports=function(e,t,n){var a=n.flipX,o=n.flipY,s="h"===n.orientation,l=n.maxDepth,u=t[0],c=t[1];l&&(u=(e.height+1)*t[0]/Math.min(e.height+1,l),c=(e.height+1)*t[1]/Math.min(e.height+1,l));var h=r.partition().padding(n.pad.inner).size(s?[t[1],u]:[t[0],c])(e);return(s||a||o)&&i(h,t,{swapXY:s,flipX:a,flipY:o}),h}}}),d8=m({"src/traces/icicle/style.js"(e,t){var r=M(),i=er(),n=tb(),a=aC().resizeText,o=dC();function s(e,t,r,a){var s=t.data.data,l=!t.children,u=s.i,c=n.castOption(r,u,"marker.line.color")||i.defaultLine,h=n.castOption(r,u,"marker.line.width")||0;e.call(o,t,r,a).style("stroke-width",h).call(i.stroke,c).style("opacity",l?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");a(e,t,"icicle"),t.each(function(t){var i=r.select(this),n=t[0].trace;i.style("opacity",n.opacity),i.selectAll("path.surface").each(function(t){r.select(this).call(s,t,n,e)})})},styleOne:s}}}),d7=m({"src/traces/icicle/draw_descendants.js"(e,t){var r=M(),i=tb(),n=rt(),a=tj(),o=d6(),s=d8().styleOne,l=dB(),u=dL(),c=dP(),h=dz().formatSliceLabel;t.exports=function(e,t,d,f,p){var m=p.width,g=p.height,y=p.viewX,v=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,A=p.makeUpdateSliceInterpolator,M=p.makeUpdateTextInterpolator,k=p.prevEntry,S=e._context.staticPlot,E=e._fullLayout,D=t[0].trace,C=-1!==D.textposition.indexOf("left"),I=-1!==D.textposition.indexOf("right"),L=-1!==D.textposition.indexOf("bottom"),P=o(d,[m,g],{flipX:D.tiling.flip.indexOf("x")>-1,flipY:D.tiling.flip.indexOf("y")>-1,orientation:D.tiling.orientation,pad:{inner:D.tiling.pad},maxDepth:D._maxDepth}).descendants(),z=1/0,F=-1/0;P.forEach(function(e){var t=e.depth;t>=D._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(z=Math.min(z,t),F=Math.max(F,t))}),f=f.data(P,u.getPtId),D._maxVisibleLayers=isFinite(F)?F-z+1:0,f.enter().append("g").classed("slice",!0),T(f,!1,{},[m,g],x),f.order();var O=null;if(w&&k){var R=u.getPtId(k);f.each(function(e){null===O&&u.getPtId(e)===R&&(O={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})})}var B=function(){return O||{x0:0,x1:m,y0:0,y1:g}},j=f;return w&&(j=j.transition().each("end",function(){var t=r.select(this);u.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),j.each(function(o){o._x0=y(o.x0),o._x1=y(o.x1),o._y0=v(o.y0),o._y1=v(o.y1),o._hoverX=y(o.x1-D.tiling.pad),o._hoverY=v(L?o.y1-D.tiling.pad/2:o.y0+D.tiling.pad/2);var f=r.select(this),p=i.ensureSingle(f,"path","surface",function(e){e.style("pointer-events",S?"none":"all")});w?p.transition().attrTween("d",function(e){var t=A(e,!1,B(),[m,g],{orientation:D.tiling.orientation,flipX:D.tiling.flip.indexOf("x")>-1,flipY:D.tiling.flip.indexOf("y")>-1});return function(e){return x(t(e))}}):p.attr("d",x),f.call(c,d,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,e,{isTransitioning:e._transitioning}),p.call(s,o,D,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,d,D,t,E)||"";var T=i.ensureSingle(f,"g","slicetext"),k=i.ensureSingle(T,"text","",function(e){e.attr("data-notex",1)}),P=i.ensureUniformFontSize(e,u.determineTextFont(D,o,E.font));k.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",I?"end":C?"start":"middle").call(n.font,P).call(a.convertToTspans,e),o.textBB=n.bBox(k.node()),o.transform=b(o,{fontSize:P.size}),o.transform.fontSize=P.size,w?k.transition().attrTween("transform",function(e){var t=M(e,!1,B(),[m,g]);return function(e){return _(t(e))}}):k.attr("transform",_(o))}),O}}}),d9=m({"src/traces/icicle/plot.js"(e,t){var r=dZ(),i=d7();t.exports=function(e,t,n,a){return r(e,t,n,a,{type:"icicle",drawDescendants:i})}}}),fe=m({"src/traces/icicle/index.js"(e,t){t.exports={moduleType:"trace",name:"icicle",basePlotModule:d0(),categories:[],animatable:!0,attributes:d1(),layoutAttributes:d2(),supplyDefaults:d3(),supplyLayoutDefaults:d5(),calc:d4().calc,crossTraceCalc:d4().crossTraceCalc,plot:d9(),style:d8().style,colorbar:nr(),meta:{}}}}),ft=m({"lib/icicle.js"(e,t){t.exports=fe()}}),fr=m({"src/traces/funnelarea/base_plot.js"(e){var t=tO();e.name="funnelarea",e.plot=function(r,i,n,a){t.plotBasePlot(e.name,r,i,n,a)},e.clean=function(r,i,n,a){t.cleanBasePlot(e.name,r,i,n,a)}}}),fi=m({"src/traces/funnelarea/attributes.js"(e,t){var r=u1(),i=X(),n=ai().attributes,{hovertemplateAttrs:a,texttemplateAttrs:o,templatefallbackAttrs:s}=eY(),l=H().extendFlat;t.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:l({},r.marker.line.color,{dflt:null}),width:l({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:l({},r.scalegroup,{}),textinfo:l({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:s({editType:"plot"}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:s(),textposition:l({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:l({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:n({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),fn=m({"src/traces/funnelarea/layout_attributes.js"(e,t){t.exports={hiddenlabels:u3().hiddenlabels,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),fa=m({"src/traces/funnelarea/defaults.js"(e,t){var r=tb(),i=fi(),n=ai().defaults,a=ak().handleText,o=u2().handleLabelsAndValues,s=u2().handleMarkerDefaults;t.exports=function(e,t,l,u){function c(n,a){return r.coerce(e,t,i,n,a)}var h,d=o(c("labels"),c("values")),f=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),!f){t.visible=!1;return}t._length=f,s(e,t,u,c),c("scalegroup");var p=c("text"),m=c("texttemplate");if(c("texttemplatefallback"),m||(h=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),m||h&&"none"!==h){var g=c("textposition");a(e,t,u,c,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===h&&c("textposition","none");n(t,u,c),c("title.text")&&(c("title.position"),r.coerceFont(c,"title.font",u.font)),c("aspectratio"),c("baseratio")}}}),fo=m({"src/traces/funnelarea/layout_defaults.js"(e,t){var r=tb(),i=fn();t.exports=function(e,t){function n(n,a){return r.coerce(e,t,i,n,a)}n("hiddenlabels"),n("funnelareacolorway",t.colorway),n("extendfunnelareacolors")}}}),fs=m({"src/traces/funnelarea/calc.js"(e,t){var r=u4();t.exports={calc:function(e,t){return r.calc(e,t)},crossTraceCalc:function(e){r.crossTraceCalc(e,{type:"funnelarea"})}}}}),fl=m({"src/traces/funnelarea/plot.js"(e,t){var r=M(),i=rt(),n=tb(),a=n.strScale,o=n.strTranslate,s=tj(),l=aP().toMoveInsideBar,u=aC(),c=u.recordMinTextSize,h=u.clearMinTextSize,d=rT(),f=u8(),p=f.attachFxHandlers,m=f.determineInsideTextFont,g=f.layoutAreas,y=f.prerenderTitles,v=f.positionTitleOutside,x=f.formatSliceLabel;function b(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var u=e._context.staticPlot,f=e._fullLayout;h("funnelarea",f),y(t,e),g(t,f._size),n.makeTraceGroups(f._funnelarealayer,t,"trace").each(function(t){var h=r.select(this),g=t[0],y=g.trace;(function(e){if(e.length){var t,r,i=e[0],n=i.trace,a=n.aspectratio,o=n.baseratio;o>.999&&(o=.999);var s,l=Math.pow(o,2),u=i.vTotal,c=u*l/(1-l)/u,h=[];for(h.push(S()),t=e.length-1;t>-1;t--)if(!(r=e[t]).hidden){var d=r.v/u;c+=d,h.push(S())}var f=1/0,p=-1/0;for(t=0;t-1;t--)if(!(r=e[t]).hidden){var T,A,M=h[w+=1][0],k=h[w][1];r.TL=[-M,k],r.TR=[M,k],r.BL=b,r.BR=_,r.pxmid=(T=r.TR,A=r.BR,[.5*(T[0]+A[0]),.5*(T[1]+A[1])]),b=r.TL,_=r.TR}}function S(){var e,t={x:e=Math.sqrt(c),y:-e};return[t.x,t.y]}})(t),h.each(function(){var h=r.select(this).selectAll("g.slice").data(t);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each(function(a,o){if(a.hidden)return void r.select(this).selectAll("path,g").remove();a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,_=r.select(this),w=_.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),_.call(p,e,t);var T="M"+(h+a.TR[0])+","+(v+a.TR[1])+b(a.TR,a.BR)+b(a.BR,a.BL)+b(a.BL,a.TL)+"Z";w.attr("d",T),x(e,a,g);var A=d.castOption(y.textposition,a.pts),M=_.selectAll("g.slicetext").data(a.text&&"none"!==A?[0]:[]);M.enter().append("g").classed("slicetext",!0),M.exit().remove(),M.each(function(){var u=n.ensureSingle(r.select(this),"text","",function(e){e.attr("data-notex",1)}),d=n.ensureUniformFontSize(e,m(y,a,f.font));u.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,d).call(s.convertToTspans,e);var p,g=i.bBox(u.node()),x=Math.min(a.BL[1],a.BR[1])+v,b=Math.max(a.TL[1],a.TR[1])+v;(p=l(Math.max(a.TL[0],a.BL[0])+h,Math.min(a.TR[0],a.BR[0])+h,x,b,g,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=d.size,c(y.type,p,f),t[o].transform=p,n.setTransormAndDisplay(u,p)})});var _=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);_.enter().append("g").classed("titletext",!0),_.exit().remove(),_.each(function(){var t=n.ensureSingle(r.select(this),"text","",function(e){e.attr("data-notex",1)}),l=y.title.text;y._meta&&(l=n.templateString(l,y._meta)),t.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,y.title.font).call(s.convertToTspans,e);var u=v(g,f._size);t.attr("transform",o(u.x,u.y)+a(Math.min(1,u.scale))+o(u.tx,u.ty))})})})}}}),fu=m({"src/traces/funnelarea/style.js"(e,t){var r=M(),i=rM(),n=aC().resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");n(e,t,"funnelarea"),t.each(function(t){var n=t[0].trace,a=r.select(this);a.style({opacity:n.opacity}),a.selectAll("path.surface").each(function(t){r.select(this).call(i,t,n,e)})})}}}),fc=m({"src/traces/funnelarea/index.js"(e,t){t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:fr(),categories:["pie-like","funnelarea","showLegend"],attributes:fi(),layoutAttributes:fn(),supplyDefaults:fa(),supplyLayoutDefaults:fo(),calc:fs().calc,crossTraceCalc:fs().crossTraceCalc,plot:fl(),style:fu(),styleOne:rM(),meta:{}}}}),fh=m({"lib/funnelarea.js"(e,t){t.exports=fc()}}),fd=m({"stackgl_modules/index.js"(e,t){var r={3065(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},6296(e,t,r){e.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],u=e.mode||"turntable",c=i(),h=n(),d=a();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,t,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,t,r,s),d.setDistanceLimits(l[0],l[1]),d.lookAt(0,t,r,s),new o({turntable:c,orbit:h,matrix:d},u)};var i=r(7261),n=r(9977),a=r(1811);function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map(function(t){return e[t]}),this._mode=t,this._active=e[t],this._active||(this._mode="turntable",this._active=e.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(e){for(var t=this._controllerList,r=0;r"u"?r(1538):WeakMap,n=r(2762),a=r(8116),o=new i;e.exports=function(e){var t=o.get(e),r=t&&(t._triangleBuffer.handle||t._triangleBuffer.buffer);if(!r||!e.isBuffer(r)){var i=n(e,new Float32Array([-1,-1,-1,4,4,-1]));(t=a(e,[{buffer:i,type:e.FLOAT,size:2}]))._triangleBuffer=i,o.set(e,t)}t.bind(),e.drawArrays(e.TRIANGLES,0,3),t.unbind()}},1085(e,t,r){var i=r(1371);e.exports=function(e,t,r){t="number"==typeof t?t:1,r=r||": ";var n=e.split(/\r?\n/),a=String(n.length+t-1).length;return n.map(function(e,n){var o=n+t,s=String(o).length;return i(o,a-s)+r+e}).join(` +`)}},3952(e,t,r){e.exports=function(e){var t=e.length;if(0===t)return[];if(1===t)return[0];for(var r=e[0].length,n=[e[0]],a=[0],o=1;o0?o-4:o;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,a=[],o=0,s=i-n;o>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return a.join("")}(e,o,o+16383>s?s:o+16383));return 1===n?a.push(r[(t=e[i-1])>>2]+r[t<<4&63]+"=="):2===n&&a.push(r[(t=(e[i-2]<<8)+e[i-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],i=[],n="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}i[45]=62,i[95]=63},3865(e,t,r){var i=r(869);e.exports=function(e,t){return i(e[0].mul(t[1]).add(t[0].mul(e[1])),e[1].mul(t[1]))}},1318(e){e.exports=function(e,t){return e[0].mul(t[1]).cmp(t[0].mul(e[1]))}},8697(e,t,r){var i=r(869);e.exports=function(e,t){return i(e[0].mul(t[1]),e[1].mul(t[0]))}},7842(e,t,r){var i=r(6330),n=r(1533),a=r(2651),o=r(6768),s=r(869),l=r(8697);e.exports=function e(t,r){if(i(t))return r?l(t,e(r)):[t[0].clone(),t[1].clone()];var u,c,h=0;if(n(t))u=t.clone();else if("string"==typeof t)u=o(t);else{if(0===t)return[a(0),a(1)];if(t===Math.floor(t))u=a(t);else{for(;t!==Math.floor(t);)t*=1157920892373162e62,h-=256;u=a(t)}}if(i(r))u.mul(r[1]),c=r[0].clone();else if(n(r))c=r.clone();else if("string"==typeof r)c=o(r);else if(r)if(r===Math.floor(r))c=a(r);else{for(;r!==Math.floor(r);)r*=1157920892373162e62,h+=256;c=a(r)}else c=a(1);return h>0?u=u.ushln(h):h<0&&(c=c.ushln(-h)),s(u,c)}},6330(e,t,r){var i=r(1533);e.exports=function(e){return Array.isArray(e)&&2===e.length&&i(e[0])&&i(e[1])}},5716(e,t,r){var i=r(6859);e.exports=function(e){return e.cmp(new i(0))}},1369(e,t,r){var i=r(5716);e.exports=function(e){var t=e.length,r=e.words,n=0;if(1===t)n=r[0];else if(2===t)n=r[0]+0x4000000*r[1];else for(var a=0;a20?52:r+32}},1533(e,t,r){r(6859),e.exports=function(e){return e&&"object"==typeof e&&!!e.words}},2651(e,t,r){var i=r(6859),n=r(2361);e.exports=function(e){var t=n.exponent(e);return t<52?new i(e):new i(e*Math.pow(2,52-t)).ushln(t-52)}},869(e,t,r){var i=r(2651),n=r(5716);e.exports=function(e,t){var r=n(e),a=n(t);if(0===r)return[i(0),i(1)];if(0===a)return[i(0),i(0)];a<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},6768(e,t,r){var i=r(6859);e.exports=function(e){return new i(e)}},6504(e,t,r){var i=r(869);e.exports=function(e,t){return i(e[0].mul(t[0]),e[1].mul(t[1]))}},7721(e,t,r){var i=r(5716);e.exports=function(e){return i(e[0])*i(e[1])}},5572(e,t,r){var i=r(869);e.exports=function(e,t){return i(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},946(e,t,r){var i=r(1369),n=r(4025);e.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var a=t.abs().divmod(r.abs()),o=i(a.div),s=a.mod,l=t.negative!==r.negative?-1:1;if(0===s.cmpn(0))return l*o;if(o){var u=n(o)+4,c=i(s.ushln(u).divRound(r));return l*(o+c*Math.pow(2,-u))}var h=r.bitLength()-s.bitLength()+53,c=i(s.ushln(h).divRound(r));return h<1023?l*c*Math.pow(2,-h):l*(c*=11125369292536007e-324)*Math.pow(2,1023-h)}},2478(e){function t(e,t,r,i,n){for(var a=n+1;i<=n;){var o=i+n>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,n=o-1):i=o+1}return a}function r(e,t,r,i,n){for(var a=n+1;i<=n;){var o=i+n>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,n=o-1):i=o+1}return a}function i(e,t,r,i,n){for(var a=i-1;i<=n;){var o=i+n>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,i=o+1):n=o-1}return a}function n(e,t,r,i,n){for(var a=i-1;i<=n;){var o=i+n>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,i=o+1):n=o-1}return a}function a(e,t,r,i,n){for(;i<=n;){var a=i+n>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?i=a+1:n=a-1}return -1}function o(e,t,r,i,n,a){return"function"==typeof r?a(e,t,r,void 0===i?0:0|i,void 0===n?e.length-1:0|n):a(e,t,void 0,void 0===r?0:0|r,void 0===i?e.length-1:0|i)}e.exports={ge:function(e,r,i,n,a){return o(e,r,i,n,a,t)},gt:function(e,t,i,n,a){return o(e,t,i,n,a,r)},lt:function(e,t,r,n,a){return o(e,t,r,n,a,i)},le:function(e,t,r,i,a){return o(e,t,r,i,a,n)},eq:function(e,t,r,i,n){return o(e,t,r,i,n,a)}}},8828(e,t){function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),0xff00ff&e&&(t-=8),0xf0f0f0f&e&&(t-=4),0x33333333&e&&(t-=2),0x55555555&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=0x7fffffff,t.INT_MIN=-0x80000000,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,(t|=r)|e>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:+(e>=10)},t.popCount=function(e){return e-=e>>>1&0x55555555,((e=(0x33333333&e)+(e>>>2&0x33333333))+(e>>>4)&0xf0f0f0f)*0x1010101>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var i=Array(256);(function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|i[e>>>16&255]<<8|i[e>>>24&255]},t.interleave2=function(e,t){return e&=65535,t&=65535,(e=((e=((e=((e=(e|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=(t|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1},t.deinterleave2=function(e,t){return(e=((e=((e=((e=((e=e>>>t&0x55555555)|e>>>1)&0x33333333)|e>>>2)&0xf0f0f0f)|e>>>4)&0xff00ff)|e>>>16)&65535)<<16>>16},t.interleave3=function(e,t,r){return e&=1023,t&=1023,r&=1023,r=((r=((r=((r=(r|r<<16)&0xff0000ff)|r<<8)&0xf00f00f)|r<<4)&0xc30c30c3)|r<<2)&0x49249249,(e=((e=((e=((e=(e|e<<16)&0xff0000ff)|e<<8)&0xf00f00f)|e<<4)&0xc30c30c3)|e<<2)&0x49249249|(t=((t=((t=((t=(t|t<<16)&0xff0000ff)|t<<8)&0xf00f00f)|t<<4)&0xc30c30c3)|t<<2)&0x49249249)<<1)|r<<2},t.deinterleave3=function(e,t){return(e=((e=((e=((e=((e=e>>>t&0x49249249)|e>>>2)&0xc30c30c3)|e>>>4)&0xf00f00f)|e>>>8)&0xff0000ff)|e>>>16)&1023)<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6859(e,t,r){!function(e,t){function i(e,t){if(!e)throw Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{u="u">typeof window&&"u">typeof window.Buffer?window.Buffer:r(7790).Buffer}catch{}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var i=o(e,r);return r-1>=t&&(i|=o(e,r-1)<<4),i}function l(e,t,r,i){for(var n=0,a=Math.min(e.length,r),o=t;o=49?n+=s-49+10:s>=17?n+=s-17+10:n+=s}return n}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return 0>e.cmp(t)?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=o<>>26-s&0x3ffffff,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(n=0,a=0;n>>26-s&0x3ffffff,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i=0;i=t;i-=2)n=s(e,t,i)<=18?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,o=a%i,s=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u,c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function f(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],o=n*a,s=0x3ffffff&o,l=o/0x4000000|0;r.words[0]=s;for(var u=1;u>>26,h=0x3ffffff&l,d=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=d;f++){var p=u-f|0;c+=(o=(n=0|e.words[p])*(a=0|t.words[f])+h)/0x4000000|0,h=0x3ffffff&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}a.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,n=0,a=0,o=0;o>>24-n&0xffffff,(n+=2)>=26&&(n-=26,o--),r=0!==a||o!==this.length-1?c[6-l.length]+l+r:l+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:c[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i("u">typeof u),this.toArrayLike(u,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),a=r||Math.max(1,n);i(n<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var o,s,l=new e(a),u=this.clone();if("le"===t){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),l[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-r,n++);n=0);var r=e/26|0,n=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var a=0,o=0;o>26,this.words[o]=0x3ffffff&i;for(;0!==a&&o>26,this.words[o]=0x3ffffff&i;if(0===a&&o>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,A=w>>>13,M=0|o[5],k=8191&M,S=M>>>13,E=0|o[6],D=8191&E,C=E>>>13,I=0|o[7],L=8191&I,P=I>>>13,z=0|o[8],F=8191&z,O=z>>>13,R=0|o[9],B=8191&R,j=R>>>13,N=0|s[0],V=8191&N,U=N>>>13,q=0|s[1],G=8191&q,H=q>>>13,$=0|s[2],W=8191&$,Y=$>>>13,Z=0|s[3],X=8191&Z,K=Z>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,et=0|s[5],er=8191&et,ei=et>>>13,en=0|s[6],ea=8191&en,eo=en>>>13,es=0|s[7],el=8191&es,eu=es>>>13,ec=0|s[8],eh=8191&ec,ed=ec>>>13,ef=0|s[9],ep=8191&ef,em=ef>>>13;r.negative=e.negative^t.negative,r.length=19,i=Math.imul(h,V),n=(n=Math.imul(h,U))+Math.imul(d,V)|0,a=Math.imul(d,U);var eg=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eg>>>26)|0,eg&=0x3ffffff,i=Math.imul(p,V),n=(n=Math.imul(p,U))+Math.imul(m,V)|0,a=Math.imul(m,U),i=i+Math.imul(h,G)|0,n=(n=n+Math.imul(h,H)|0)+Math.imul(d,G)|0,a=a+Math.imul(d,H)|0;var ey=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(y,V),n=(n=Math.imul(y,U))+Math.imul(v,V)|0,a=Math.imul(v,U),i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,H)|0,i=i+Math.imul(h,W)|0,n=(n=n+Math.imul(h,Y)|0)+Math.imul(d,W)|0,a=a+Math.imul(d,Y)|0;var ev=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(b,V),n=(n=Math.imul(b,U))+Math.imul(_,V)|0,a=Math.imul(_,U),i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,H)|0)+Math.imul(v,G)|0,a=a+Math.imul(v,H)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,Y)|0,i=i+Math.imul(h,X)|0,n=(n=n+Math.imul(h,K)|0)+Math.imul(d,X)|0,a=a+Math.imul(d,K)|0;var ex=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(T,V),n=(n=Math.imul(T,U))+Math.imul(A,V)|0,a=Math.imul(A,U),i=i+Math.imul(b,G)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,H)|0,i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(v,W)|0,a=a+Math.imul(v,Y)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(m,X)|0,a=a+Math.imul(m,K)|0,i=i+Math.imul(h,Q)|0,n=(n=n+Math.imul(h,ee)|0)+Math.imul(d,Q)|0,a=a+Math.imul(d,ee)|0;var eb=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(k,V),n=(n=Math.imul(k,U))+Math.imul(S,V)|0,a=Math.imul(S,U),i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,H)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,H)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,Y)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,K)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,K)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0,i=i+Math.imul(h,er)|0,n=(n=n+Math.imul(h,ei)|0)+Math.imul(d,er)|0,a=a+Math.imul(d,ei)|0;var e_=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(D,V),n=(n=Math.imul(D,U))+Math.imul(C,V)|0,a=Math.imul(C,U),i=i+Math.imul(k,G)|0,n=(n=n+Math.imul(k,H)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,H)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,Y)|0,i=i+Math.imul(b,X)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(_,X)|0,a=a+Math.imul(_,K)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,ee)|0,i=i+Math.imul(p,er)|0,n=(n=n+Math.imul(p,ei)|0)+Math.imul(m,er)|0,a=a+Math.imul(m,ei)|0,i=i+Math.imul(h,ea)|0,n=(n=n+Math.imul(h,eo)|0)+Math.imul(d,ea)|0,a=a+Math.imul(d,eo)|0;var ew=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(L,V),n=(n=Math.imul(L,U))+Math.imul(P,V)|0,a=Math.imul(P,U),i=i+Math.imul(D,G)|0,n=(n=n+Math.imul(D,H)|0)+Math.imul(C,G)|0,a=a+Math.imul(C,H)|0,i=i+Math.imul(k,W)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,Y)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,K)|0)+Math.imul(A,X)|0,a=a+Math.imul(A,K)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,i=i+Math.imul(y,er)|0,n=(n=n+Math.imul(y,ei)|0)+Math.imul(v,er)|0,a=a+Math.imul(v,ei)|0,i=i+Math.imul(p,ea)|0,n=(n=n+Math.imul(p,eo)|0)+Math.imul(m,ea)|0,a=a+Math.imul(m,eo)|0,i=i+Math.imul(h,el)|0,n=(n=n+Math.imul(h,eu)|0)+Math.imul(d,el)|0,a=a+Math.imul(d,eu)|0;var eT=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,i=Math.imul(F,V),n=(n=Math.imul(F,U))+Math.imul(O,V)|0,a=Math.imul(O,U),i=i+Math.imul(L,G)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(P,G)|0,a=a+Math.imul(P,H)|0,i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,Y)|0,i=i+Math.imul(k,X)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(S,X)|0,a=a+Math.imul(S,K)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(A,Q)|0,a=a+Math.imul(A,ee)|0,i=i+Math.imul(b,er)|0,n=(n=n+Math.imul(b,ei)|0)+Math.imul(_,er)|0,a=a+Math.imul(_,ei)|0,i=i+Math.imul(y,ea)|0,n=(n=n+Math.imul(y,eo)|0)+Math.imul(v,ea)|0,a=a+Math.imul(v,eo)|0,i=i+Math.imul(p,el)|0,n=(n=n+Math.imul(p,eu)|0)+Math.imul(m,el)|0,a=a+Math.imul(m,eu)|0,i=i+Math.imul(h,eh)|0,n=(n=n+Math.imul(h,ed)|0)+Math.imul(d,eh)|0,a=a+Math.imul(d,ed)|0;var eA=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,i=Math.imul(B,V),n=(n=Math.imul(B,U))+Math.imul(j,V)|0,a=Math.imul(j,U),i=i+Math.imul(F,G)|0,n=(n=n+Math.imul(F,H)|0)+Math.imul(O,G)|0,a=a+Math.imul(O,H)|0,i=i+Math.imul(L,W)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(P,W)|0,a=a+Math.imul(P,Y)|0,i=i+Math.imul(D,X)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(C,X)|0,a=a+Math.imul(C,K)|0,i=i+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,ee)|0)+Math.imul(S,Q)|0,a=a+Math.imul(S,ee)|0,i=i+Math.imul(T,er)|0,n=(n=n+Math.imul(T,ei)|0)+Math.imul(A,er)|0,a=a+Math.imul(A,ei)|0,i=i+Math.imul(b,ea)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(_,ea)|0,a=a+Math.imul(_,eo)|0,i=i+Math.imul(y,el)|0,n=(n=n+Math.imul(y,eu)|0)+Math.imul(v,el)|0,a=a+Math.imul(v,eu)|0,i=i+Math.imul(p,eh)|0,n=(n=n+Math.imul(p,ed)|0)+Math.imul(m,eh)|0,a=a+Math.imul(m,ed)|0,i=i+Math.imul(h,ep)|0,n=(n=n+Math.imul(h,em)|0)+Math.imul(d,ep)|0,a=a+Math.imul(d,em)|0;var eM=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(B,G),n=(n=Math.imul(B,H))+Math.imul(j,G)|0,a=Math.imul(j,H),i=i+Math.imul(F,W)|0,n=(n=n+Math.imul(F,Y)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,Y)|0,i=i+Math.imul(L,X)|0,n=(n=n+Math.imul(L,K)|0)+Math.imul(P,X)|0,a=a+Math.imul(P,K)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,ee)|0)+Math.imul(C,Q)|0,a=a+Math.imul(C,ee)|0,i=i+Math.imul(k,er)|0,n=(n=n+Math.imul(k,ei)|0)+Math.imul(S,er)|0,a=a+Math.imul(S,ei)|0,i=i+Math.imul(T,ea)|0,n=(n=n+Math.imul(T,eo)|0)+Math.imul(A,ea)|0,a=a+Math.imul(A,eo)|0,i=i+Math.imul(b,el)|0,n=(n=n+Math.imul(b,eu)|0)+Math.imul(_,el)|0,a=a+Math.imul(_,eu)|0,i=i+Math.imul(y,eh)|0,n=(n=n+Math.imul(y,ed)|0)+Math.imul(v,eh)|0,a=a+Math.imul(v,ed)|0,i=i+Math.imul(p,ep)|0,n=(n=n+Math.imul(p,em)|0)+Math.imul(m,ep)|0,a=a+Math.imul(m,em)|0;var ek=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,i=Math.imul(B,W),n=(n=Math.imul(B,Y))+Math.imul(j,W)|0,a=Math.imul(j,Y),i=i+Math.imul(F,X)|0,n=(n=n+Math.imul(F,K)|0)+Math.imul(O,X)|0,a=a+Math.imul(O,K)|0,i=i+Math.imul(L,Q)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,ee)|0,i=i+Math.imul(D,er)|0,n=(n=n+Math.imul(D,ei)|0)+Math.imul(C,er)|0,a=a+Math.imul(C,ei)|0,i=i+Math.imul(k,ea)|0,n=(n=n+Math.imul(k,eo)|0)+Math.imul(S,ea)|0,a=a+Math.imul(S,eo)|0,i=i+Math.imul(T,el)|0,n=(n=n+Math.imul(T,eu)|0)+Math.imul(A,el)|0,a=a+Math.imul(A,eu)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,ed)|0)+Math.imul(_,eh)|0,a=a+Math.imul(_,ed)|0,i=i+Math.imul(y,ep)|0,n=(n=n+Math.imul(y,em)|0)+Math.imul(v,ep)|0,a=a+Math.imul(v,em)|0;var eS=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(B,X),n=(n=Math.imul(B,K))+Math.imul(j,X)|0,a=Math.imul(j,K),i=i+Math.imul(F,Q)|0,n=(n=n+Math.imul(F,ee)|0)+Math.imul(O,Q)|0,a=a+Math.imul(O,ee)|0,i=i+Math.imul(L,er)|0,n=(n=n+Math.imul(L,ei)|0)+Math.imul(P,er)|0,a=a+Math.imul(P,ei)|0,i=i+Math.imul(D,ea)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(C,ea)|0,a=a+Math.imul(C,eo)|0,i=i+Math.imul(k,el)|0,n=(n=n+Math.imul(k,eu)|0)+Math.imul(S,el)|0,a=a+Math.imul(S,eu)|0,i=i+Math.imul(T,eh)|0,n=(n=n+Math.imul(T,ed)|0)+Math.imul(A,eh)|0,a=a+Math.imul(A,ed)|0,i=i+Math.imul(b,ep)|0,n=(n=n+Math.imul(b,em)|0)+Math.imul(_,ep)|0,a=a+Math.imul(_,em)|0;var eE=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(B,Q),n=(n=Math.imul(B,ee))+Math.imul(j,Q)|0,a=Math.imul(j,ee),i=i+Math.imul(F,er)|0,n=(n=n+Math.imul(F,ei)|0)+Math.imul(O,er)|0,a=a+Math.imul(O,ei)|0,i=i+Math.imul(L,ea)|0,n=(n=n+Math.imul(L,eo)|0)+Math.imul(P,ea)|0,a=a+Math.imul(P,eo)|0,i=i+Math.imul(D,el)|0,n=(n=n+Math.imul(D,eu)|0)+Math.imul(C,el)|0,a=a+Math.imul(C,eu)|0,i=i+Math.imul(k,eh)|0,n=(n=n+Math.imul(k,ed)|0)+Math.imul(S,eh)|0,a=a+Math.imul(S,ed)|0,i=i+Math.imul(T,ep)|0,n=(n=n+Math.imul(T,em)|0)+Math.imul(A,ep)|0,a=a+Math.imul(A,em)|0;var eD=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eD>>>26)|0,eD&=0x3ffffff,i=Math.imul(B,er),n=(n=Math.imul(B,ei))+Math.imul(j,er)|0,a=Math.imul(j,ei),i=i+Math.imul(F,ea)|0,n=(n=n+Math.imul(F,eo)|0)+Math.imul(O,ea)|0,a=a+Math.imul(O,eo)|0,i=i+Math.imul(L,el)|0,n=(n=n+Math.imul(L,eu)|0)+Math.imul(P,el)|0,a=a+Math.imul(P,eu)|0,i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,ed)|0)+Math.imul(C,eh)|0,a=a+Math.imul(C,ed)|0,i=i+Math.imul(k,ep)|0,n=(n=n+Math.imul(k,em)|0)+Math.imul(S,ep)|0,a=a+Math.imul(S,em)|0;var eC=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,i=Math.imul(B,ea),n=(n=Math.imul(B,eo))+Math.imul(j,ea)|0,a=Math.imul(j,eo),i=i+Math.imul(F,el)|0,n=(n=n+Math.imul(F,eu)|0)+Math.imul(O,el)|0,a=a+Math.imul(O,eu)|0,i=i+Math.imul(L,eh)|0,n=(n=n+Math.imul(L,ed)|0)+Math.imul(P,eh)|0,a=a+Math.imul(P,ed)|0,i=i+Math.imul(D,ep)|0,n=(n=n+Math.imul(D,em)|0)+Math.imul(C,ep)|0,a=a+Math.imul(C,em)|0;var eI=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(B,el),n=(n=Math.imul(B,eu))+Math.imul(j,el)|0,a=Math.imul(j,eu),i=i+Math.imul(F,eh)|0,n=(n=n+Math.imul(F,ed)|0)+Math.imul(O,eh)|0,a=a+Math.imul(O,ed)|0,i=i+Math.imul(L,ep)|0,n=(n=n+Math.imul(L,em)|0)+Math.imul(P,ep)|0,a=a+Math.imul(P,em)|0;var eL=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eL>>>26)|0,eL&=0x3ffffff,i=Math.imul(B,eh),n=(n=Math.imul(B,ed))+Math.imul(j,eh)|0,a=Math.imul(j,ed),i=i+Math.imul(F,ep)|0,n=(n=n+Math.imul(F,em)|0)+Math.imul(O,ep)|0,a=a+Math.imul(O,em)|0;var eP=(u+i|0)+((8191&n)<<13)|0;u=(a+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(B,ep),n=(n=Math.imul(B,em))+Math.imul(j,ep)|0,a=Math.imul(j,em);var ez=(u+i|0)+((8191&n)<<13)|0;return u=(a+(n>>>13)|0)+(ez>>>26)|0,ez&=0x3ffffff,l[0]=eg,l[1]=ey,l[2]=ev,l[3]=ex,l[4]=eb,l[5]=e_,l[6]=ew,l[7]=eT,l[8]=eA,l[9]=eM,l[10]=ek,l[11]=eS,l[12]=eE,l[13]=eD,l[14]=eC,l[15]=eI,l[16]=eL,l[17]=eP,l[18]=ez,0!==u&&(l[19]=u,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=f),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a>>26)|0)>>>26,o&=0x3ffffff}r.words[a]=s,i=o,o=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):m(this,e,t)},g.prototype.makeRBT=function(e){for(var t=Array(e),r=a.prototype._countBits(e)-1,i=0;i>=1;return i},g.prototype.permute=function(e,t,r,i,n,a){for(var o=0;o>>=1)n++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=(n/0x4000000|0)+(a>>>26),this.words[r]=0x3ffffff&a}return 0!==t&&(this.words[r]=t,this.length++),0===e&&(this.length=1,this._normSign()),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new a(1);for(var r=this,i=0;i=0);var t,r=e%26,n=(e-r)/26,a=0x3ffffff>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0);var n=t?(t-t%26)/26:0,a=e%26,o=Math.min((e-a)/26,this.length),s=0x3ffffff^0x3ffffff>>>a<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=n);l--){var c=0|this.words[l];this.words[l]=u<<26-a|c>>>a,u=c&s}return r&&0!==u&&(r.words[r.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var t=e%26,r=(e-t)/26;return(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<=0x4000000;t++)this.words[t]-=0x4000000,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/0x4000000|0),this.words[n+r]=0x3ffffff&o}for(;n>26,this.words[n+r]=0x3ffffff&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n>26,this.words[n]=0x3ffffff&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var s,l=i.length-n.length;if("mod"!==t){(s=new a(null)).length=l+1,s.words=Array(s.length);for(var u=0;u=0;h--){var d=(0|i.words[n.length+h])*0x4000000+(0|i.words[n.length+h-1]);for(d=Math.min(d/o|0,0x3ffffff),i._ishlnsubmul(n,d,h);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,h),i.isZero()||(i.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},a.prototype.divmod=function(e,t,r){var n,o,s;return(i(!e.isZero()),this.isZero())?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):(this.negative&e.negative)!=0?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||0>this.cmp(e)?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.mod.abs(),i=e.abs().iushrn(1),n=1&e.words[0],o=r.cmp(i);if(o<0||1===n&&0===o)return t.div;var s=new a(1);return s.negative=this.negative^e.negative,t.div.iadd(s)},a.prototype.modn=function(e){i(e<=0x3ffffff);for(var t=0x4000000%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},a.prototype.idivn=function(e){i(e<=0x3ffffff);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+0x4000000*t;this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var d=0,f=1;(t.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(c),o.isub(h)),n.iushrn(1),o.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(h)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(l)):(r.isub(t),s.isub(n),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t,r=this,n=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var o=new a(1),s=new a(0),l=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,c=1;(r.words[0]&c)==0&&u<26;++u,c<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,d=1;(n.words[0]&d)==0&&h<26;++h,d<<=1);if(h>0)for(n.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);r.cmp(n)>=0?(r.isub(n),o.isub(s)):(n.isub(r),s.isub(o))}return 0>(t=0===r.cmpn(1)?o:s).cmpn(0)&&t.iadd(e),t},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return(1&this.words[0])==0},a.prototype.isOdd=function(){return(1&this.words[0])==1},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,s&=0x3ffffff,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return -1===this.cmpn(e)},a.prototype.lt=function(e){return -1===this.cmp(e)},a.prototype.lten=function(e){return 0>=this.cmpn(e)},a.prototype.lte=function(e){return 0>=this.cmp(e)},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new T(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(x,v),x.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=a}n>>>=22,e.words[i-10]=n,0===n&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){var t;if(y[e])return y[e];if("k256"===e)t=new x;else if("p224"===e)t=new b;else if("p192"===e)t=new _;else if("p25519"===e)t=new w;else throw Error("Unknown prime "+e);return y[e]=t,t},T.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){i((e.negative|t.negative)==0,"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,n),d=this.pow(e,n.addn(1).iushrn(1)),f=this.pow(e,n),p=o;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var u=t.words[i],c=l-1;c>=0;c--){var h=u>>c&1;if(n!==r[0]&&(n=this.sqr(n)),0===h&&0===o){s=0;continue}o<<=1,o|=h,(4==++s||0===i&&0===c)&&(n=this.mul(n,r[o]),s=0,o=0)}l=26}return n},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new A(e)},n(A,T),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):0>n.cmpn(0)&&(a=n.iadd(this.m)),a._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6204(e){e.exports=function(e){var t,r,i,n=e.length,a=0;for(t=0;t>>1;if(!(c<=0)){var h,d=n.mallocDouble(2*c*l),f=n.mallocInt32(l);if((l=s(e,c,d,f))>0){if(1===c&&i)a.init(l),h=a.sweepComplete(c,r,0,l,d,f,0,l,d,f);else{var p=n.mallocDouble(2*c*u),m=n.mallocInt32(u);(u=s(t,c,p,m))>0&&(a.init(l+u),h=1===c?a.sweepBipartite(c,r,0,l,d,f,0,u,p,m):o(c,r,i,l,d,f,u,p,m),n.free(p),n.free(m))}n.free(d),n.free(f)}return h}}}function u(e,t){i.push([e,t])}},2455(e,t){function r(e){return e?function(e,t,r,i,n,a,o,s,l,u,c){return n-i>l-s?function(e,t,r,i,n,a,o,s,l,u,c){for(var h=2*e,d=i,f=h*i;du-l?i?function(e,t,r,i,n,a,o,s,l,u,c){for(var h=2*e,d=i,f=h*i;d0;){var I=6*(D-=1),L=y[I],P=y[I+1],z=y[I+2],F=y[I+3],O=y[I+4],R=y[I+5],B=2*D,j=v[B],N=v[B+1],V=1&R,U=!!(16&R),q=c,G=b,H=w,$=T;if(V&&(q=w,G=T,H=c,$=b),!(2&R&&(z=f(e,L,P,z,q,G,N),P>=z))&&!(4&R&&(P=p(e,L,P,z,q,G,j))>=z)){var W=z-P,Y=O-F;if(U){if(e*W*(W+Y)<4194304){if(void 0!==(E=l.scanComplete(e,L,t,P,z,q,G,F,O,H,$)))return E;continue}}else if(e*Math.min(W,Y)<128){if(void 0!==(E=o(e,L,t,V,P,z,q,G,F,O,H,$)))return E;continue}else if(e*W*Y<4194304){if(void 0!==(E=l.scanBipartite(e,L,t,V,P,z,q,G,F,O,H,$)))return E;continue}var Z=h(e,L,P,z,q,G,j,N);if(P=p0)&&!(p1>=hi)"),d=c("lo===p0"),f=c("lo>>1,c=2*e,h=u,d=a[c*u+t];sr&&n[h+t]>u;--c,h-=o){for(var d=h,f=h+o,p=0;p=y?(h=g,d=y):m>=x?(h=p,d=m):(h=v,d=x):y>=x?(h=g,d=y):x>=m?(h=p,d=m):(h=v,d=x);for(var b=c*(l-1),_=c*h,w=0;wh;++h,l+=s)if(n[l+t]===o)if(c===h)c+=1,u+=s;else{for(var d=0;s>d;++d){var f=n[l+d];n[l+d]=n[u],n[u++]=f}var p=a[h];a[h]=a[c],a[c++]=p}return c},"loh;++h,l+=s)if(n[l+t]d;++d){var f=n[l+d];n[l+d]=n[u],n[u++]=f}var p=a[h];a[h]=a[c],a[c++]=p}return c},"lo<=p0":function(e,t,r,i,n,a,o){for(var s=2*e,l=s*r,u=l,c=r,h=e+t,d=r;i>d;++d,l+=s)if(n[l+h]<=o)if(c===d)c+=1,u+=s;else{for(var f=0;s>f;++f){var p=n[l+f];n[l+f]=n[u],n[u++]=p}var m=a[d];a[d]=a[c],a[c++]=m}return c},"hi<=p0":function(e,t,r,i,n,a,o){for(var s=2*e,l=s*r,u=l,c=r,h=e+t,d=r;i>d;++d,l+=s)if(n[l+h]<=o)if(c===d)c+=1,u+=s;else{for(var f=0;s>f;++f){var p=n[l+f];n[l+f]=n[u],n[u++]=p}var m=a[d];a[d]=a[c],a[c++]=m}return c},"lod;++d,l+=s){var f=n[l+t],p=n[l+h];if(fm;++m){var g=n[l+m];n[l+m]=n[u],n[u++]=g}var y=a[d];a[d]=a[c],a[c++]=y}}return c},"lo<=p0&&p0<=hi":function(e,t,r,i,n,a,o){for(var s=2*e,l=s*r,u=l,c=r,h=e+t,d=r;i>d;++d,l+=s){var f=n[l+t],p=n[l+h];if(f<=o&&o<=p)if(c===d)c+=1,u+=s;else{for(var m=0;s>m;++m){var g=n[l+m];n[l+m]=n[u],n[u++]=g}var y=a[d];a[d]=a[c],a[c++]=y}}return c},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,i,n,a,o,s){for(var l=2*e,u=l*r,c=u,h=r,d=e+t,f=r;i>f;++f,u+=l){var p=n[u+t],m=n[u+d];if(!(p>=o)&&!(s>=m))if(h===f)h+=1,c+=l;else{for(var g=0;l>g;++g){var y=n[u+g];n[u+g]=n[c],n[c++]=y}var v=a[f];a[f]=a[h],a[h++]=v}}return h}}},4192(e){function t(e,t,r){for(var i=2*(e+1),n=e+1;n<=t;++n){for(var a=r[i++],o=r[i++],s=n,l=i-2;s-- >e;){var u=r[l-2],c=r[l-1];if(ur[t+1])}function o(e,t,r,i){var n=i[e*=2];return n>1,p=f-c,m=f+c,g=h,y=p,v=f,x=m,b=d,_=s+1,w=l-1,T=0;a(g,y,u)&&(T=g,g=y,y=T),a(x,b,u)&&(T=x,x=b,b=T),a(g,v,u)&&(T=g,g=v,v=T),a(y,v,u)&&(T=y,y=v,v=T),a(g,x,u)&&(T=g,g=x,x=T),a(v,x,u)&&(T=v,v=x,x=T),a(y,b,u)&&(T=y,y=b,b=T),a(y,v,u)&&(T=y,y=v,v=T),a(x,b,u)&&(T=x,x=b,b=T);for(var A=u[2*y],M=u[2*y+1],k=u[2*x],S=u[2*x+1],E=2*g,D=2*v,C=2*b,I=2*h,L=2*f,P=2*d,z=0;z<2;++z){var F=u[E+z],O=u[D+z],R=u[C+z];u[I+z]=F,u[L+z]=O,u[P+z]=R}i(p,s,u),i(m,l,u);for(var B=_;B<=w;++B)if(o(B,A,M,u))B!==_&&r(B,_,u),++_;else if(!o(B,k,S,u))for(;;)if(o(w,k,S,u)){o(w,A,M,u)?(function(e,t,r,i){e*=2,t*=2,r*=2;var n=i[e],a=i[e+1];i[e]=i[t],i[e+1]=i[t+1],i[t]=i[r],i[t+1]=i[r+1],i[r]=n,i[r+1]=a}(B,_,w,u),++_):r(B,w,u),--w;break}else{if(--w>>1;a(d,k);for(var S=0,E=0,w=0;w=0x10000000)D=D-0x10000000|0,f(l,u,E--,D);else if(D>=0)f(o,s,S--,D);else if(D<=-0x10000000){D=-D-0x10000000|0;for(var C=0;C>>1;a(d,E);for(var D=0,C=0,I=0,A=0;A>1==d[2*A+3]>>1&&(P=2,A+=1),L<0){for(var z=-(L>>1)-1,F=0;F>1)-1;0===P?f(o,s,D--,z):1===P?f(l,u,C--,z):2===P&&f(c,h,I--,z)}}},scanBipartite:function(e,t,r,i,n,l,u,c,h,m,g,y){var v=0,x=2*e,b=t+e,_=1,w=1;i?w=0x10000000:_=0x10000000;for(var T=n;T>>1;a(d,S);for(var E=0,T=0;T=0x10000000?(C=!i,A-=0x10000000):(C=!!i,A-=1),C)p(o,s,E++,A);else{var I=y[A],L=x*A,P=g[L+t+1],z=g[L+t+1+e];e:for(var F=0;F>>1;a(d,_);for(var w=0,y=0;y<_;++y){var T=0|d[2*y+1];if(T<0){var v=-T;if(v>=0x10000000)o[w++]=v-0x10000000;else{var A=f[v-=1],M=m*v,k=h[M+t+1],S=h[M+t+1+e];e:for(var E=0;E=0;--E)if(o[E]===v){for(var L=E+1;L0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var i=e,n=t;if(("string"!=typeof n||""===n)&&(n="utf8"),!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);var a=0|p(i,n),l=o(a),u=l.write(i,n);return u!==a&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e)){var c=e;if(D(c,Uint8Array)){var m=new Uint8Array(c);return d(m.buffer,m.byteOffset,m.byteLength)}return h(c)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(D(e,SharedArrayBuffer)||e&&D(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var g=e.valueOf&&e.valueOf();if(null!=g&&g!==e)return s.from(g,t,r);var y=function(e){if(s.isBuffer(e)){var t=0|f(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?o(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(y)return y;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|f(e))}function h(e){for(var t=e.length<0?0:0|f(e.length),r=o(t),i=0;i=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return S(e).length;default:if(n)return i?-1:k(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n,a,o,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var n="",a=t;a0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r*=1)!=a&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return -1;r=e.length-1}else if(r<0)if(!n)return -1;else r=0;if("string"==typeof t&&(t=s.from(t,i)),s.isBuffer(t))return 0===t.length?-1:v(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,i,n);throw TypeError("val must be string, number or Buffer")}function v(e,t,r,i,n){var a,o=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var h=!0,d=0;d239?4:u>223?3:u>191?2:1;if(n+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:(192&(a=e[n+1]))==128&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[n+1],o=e[n+2],(192&a)==128&&(192&o)==128&&(l=(15&u)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[n+1],o=e[n+2],s=e[n+3],(192&a)==128&&(192&o)==128&&(192&s)==128&&(l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),n+=h}var d=i,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var p="",m=0;mr)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,i,n,a){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw RangeError("Index out of range")}function w(e,t,r,i,n,a){if(r+i>e.length||r<0)throw RangeError("Index out of range")}function T(e,t,r,i,a){return t*=1,r>>>=0,a||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}function A(e,t,r,i,a){return t*=1,r>>>=0,a||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}t.hp=s,t.IS=50,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return u(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(D(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),D(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,i=t.length,n=0,a=Math.min(r,i);ni.length?s.from(a).copy(i,n):Uint8Array.prototype.set.call(i,a,n);else if(s.isBuffer(a))a.copy(i,n);else throw TypeError('"list" argument must be an Array of Buffers');n+=a.length}return i},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},a&&(s.prototype[a]=s.prototype.inspect),s.prototype.compare=function(e,t,r,i,n){if(D(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;for(var a=n-i,o=r-t,l=Math.min(a,o),u=this.slice(i,n),c=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var n,a,o,s,l,u,c,h,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var f=!1;;)switch(i){case"hex":return function(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;var a=t.length;i>a/2&&(i=a/2);for(var o=0;o>8,n.push(r%256),n.push(i);return n}(e,this.length-c),this,c,h);default:if(f)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e],n=1,a=0;++a>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e+--t],n=1;t>0&&(n*=256);)i+=this[e+--t]*n;return i},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=this[e],n=1,a=0;++a=(n*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var i=t,n=1,a=this[e+--i];i>0&&(n*=256);)a+=this[e+--i]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),n.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;_(this,e,t,r,n,0)}var a=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!i){var n=Math.pow(2,8*r)-1;_(this,e,t,r,n,0)}var a=r-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,r,i){if(e*=1,t>>>=0,!i){var n=Math.pow(2,8*r-1);_(this,e,t,r,n-1,-n)}var a=0,o=1,s=0;for(this[t]=255&e;++a>>=0,!i){var n=Math.pow(2,8*r-1);_(this,e,t,r,n-1,-n)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,r){return T(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return T(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return A(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return A(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,i){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n55295&&r<57344){if(!n){if(r>56319||o+1===i){(t-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function S(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var C=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()},2538(e,t,r){var i=r(8902),n=r(5542),a=r(2272),o=r(5023);function s(e){return[Math.min(e[0],e[1]),Math.max(e[0],e[1])]}function l(e,t){return e[0]-t[0]||e[1]-t[1]}function u(e,t,r){return t in e?e[t]:r}e.exports=function(e,t,r){Array.isArray(t)?(r=r||{},t=t||[]):(r=t||{},t=[]);var c=!!u(r,"delaunay",!0),h=!!u(r,"interior",!0),d=!!u(r,"exterior",!0),f=!!u(r,"infinity",!1);if(!h&&!d||0===e.length)return[];var p=i(e,t);if(!c&&h===d&&!f)return p;for(var m=n(e.length,t.map(s).sort(l)),g=0;gi(e[n],e[a],e[o],e[s])&&r.push(n,a)}}r(2478),e.exports=function(e,t){for(var r=[],a=e.length,o=t.stars,s=0;si(e[s],e[c],e[h],e[d])&&r.push(s,c)}}for(;r.length>0;){for(var c=r.pop(),s=r.pop(),h=-1,d=-1,l=o[s],p=1;p=0||(t.flip(s,c),n(e,t,r,h,s,d),n(e,t,r,s,d,h),n(e,t,r,d,c,h),n(e,t,r,c,h,d))}}},5023(e,t,r){var i,n=r(2478);function a(e,t,r,i,n,a,o){this.cells=e,this.neighbor=t,this.flags=i,this.constraint=r,this.active=n,this.next=a,this.boundary=o}function o(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}e.exports=function(e,t,r){var i=function(e,t){for(var r=e.cells(),i=r.length,n=0;n0||l.length>0;){for(;s.length>0;){var f=s.pop();if(u[f]!==-n){u[f]=n,c[f];for(var p=0;p<3;++p){var m=d[3*f+p];m>=0&&0===u[m]&&(h[3*f+p]?l.push(m):(s.push(m),u[m]=n))}}}var g=l;l=s,s=g,l.length=0,n=-n}var y=function(e,t,r){for(var i=0,n=0;nm[0]&&h.push(new o(m,p,2,d),new o(p,m,1,d))}h.sort(s);for(var g=h[0].a[0]-(1+Math.abs(h[0].a[0]))*2220446049250313e-31,y=[new a([g,1],[g,0],-1,[],[])],v=[],d=0,x=h.length;d1&&n(r[d[f-2]],r[d[f-1]],a)>0;)e.push([d[f-1],d[f-2],o]),f-=1;d.length=f,d.push(o);for(var p=h.upperIds,f=p.length;f>1&&0>n(r[p[f-2]],r[p[f-1]],a);)e.push([p[f-2],p[f-1],o]),f-=1;p.length=f,p.push(o)}}(v,y,e,b.a,b.idx):2===_?function(e,t){var r=i.le(e,t,u),n=e[r],o=n.upperIds,s=o[o.length-1];n.upperIds=[s],e.splice(r+1,0,new a(t.a,t.b,t.idx,[s],o))}(y,b):function(e,t){var r=t.a;t.a=t.b,t.b=r;var n=i.eq(e,t,u),a=e[n];e[n-1].upperIds=a.upperIds,e.splice(n,1)}(y,b)}return v}},5542(e,t,r){var i=r(2478);function n(e,t){this.stars=e,this.edges=t}e.exports=function(e,t){for(var r=Array(e),i=0;i=0}}(),a.removeTriangle=function(e,t,r){var i=this.stars;o(i[e],t,r),o(i[t],r,e),o(i[r],e,t)},a.addTriangle=function(e,t,r){var i=this.stars;i[e].push(t,r),i[t].push(r,e),i[r].push(e,t)},a.opposite=function(e,t){for(var r=this.stars[t],i=1,n=r.length;i=0;--a){var x=i[a],b=t[c=x[0]],_=b[0],w=b[1],T=e[_],A=e[w];if(0>(T[0]-A[0]||T[1]-A[1])){var M=_;_=w,w=M}b[0]=_;var k,S=b[1]=x[1];for(n&&(k=b[2]);a>0&&i[a-1][0]===c;){var x=i[--a],E=x[1];n?t.push([S,E,k]):t.push([S,E]),S=E}n?t.push([S,w,k]):t.push([S,w])}return d}(e,t,g,x,r),_=p(e,b,v);return y(t,_,r),!!_||g.length>0||x.length>0}(e,t,!!r);)_=!0;if(r&&_){i.length=0,r.length=0;for(var x=0;xt[2]))}function y(e,t,r){if(0!==e.length){if(t)for(var i=0;if+1)throw Error(h+" map requires nshades to be at least size "+c.length);m=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"==typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=c.map(function(e){return Math.round(e.index*f)}),m[0]=Math.min(Math.max(m[0],0),1),m[1]=Math.min(Math.max(m[1],0),1);var t,r,l,u,c,h,d,f,p,m,g,y=c.map(function(e,t){var r=c[t].index,i=c[t].rgb.slice();return 4===i.length&&i[3]>=0&&i[3]<=1||(i[3]=m[0]+(m[1]-m[0])*r),i}),p=[];for(g=0;g0||l(e,t,a)?-1:1:0===s?u>0||l(e,t,r)?1:-1:n(u-s)}var h=i(e,t,r);return h>0?o>0&&i(e,t,a)>0?1:-1:h<0?o>0||i(e,t,a)>0?1:-1:i(e,t,a)>0||l(e,t,r)?1:-1};var i=r(3250),n=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(e,t,r){var i=a(e[0],-t[0]),n=a(e[1],-t[1]),l=a(r[0],-t[0]),u=a(r[1],-t[1]),c=s(o(i,l),o(n,u));return c[c.length-1]>=0}},8572(e){e.exports=function(e){return e<0?-1:+(e>0)}},8507(e){e.exports=function(e,i){var n=e.length,a=e.length-i.length;if(a)return a;switch(n){case 0:return 0;case 1:return e[0]-i[0];case 2:return e[0]+e[1]-i[0]-i[1]||t(e[0],e[1])-t(i[0],i[1]);case 3:var o=e[0]+e[1],s=i[0]+i[1];if(a=o+e[2]-(s+i[2]))return a;var l=t(e[0],e[1]),u=t(i[0],i[1]);return t(l,e[2])-t(u,i[2])||t(l+e[2],o)-t(u+i[2],s);case 4:var c=e[0],h=e[1],d=e[2],f=e[3],p=i[0],m=i[1],g=i[2],y=i[3];return c+h+d+f-(p+m+g+y)||t(c,h,d,f)-t(p,m,g,y,p)||t(c+h,c+d,c+f,h+d,h+f,d+f)-t(p+m,p+g,p+y,m+g,m+y,g+y)||t(c+h+d,c+h+f,c+d+f,h+d+f)-t(p+m+g,p+m+y,p+g+y,m+g+y);default:for(var v=e.slice().sort(r),x=i.slice().sort(r),b=0;be[r][0]&&(r=i);return tr?[[r],[t]]:[[t]]}},4750(e,t,r){e.exports=function(e){var t=i(e),r=t.length;if(r<=2)return[];for(var n=Array(r),a=t[r-1],o=0;o=t[l]&&(s+=1);a[o]=s}}return e}(i(function(e,t){for(var r=e.length,i=Array(r),n=0;nt.indexOf(n)&&(i[a++]=e[n]);return i}(e,r),!0),r)}};var i=r(8954),n=r(3952)},4769(e){e.exports=function(e,t,r,i,n,a){var o=n-1,s=n*n,l=o*o,u=(1+2*n)*l,c=n*l,h=s*(3-2*n),d=s*o;if(e.length){a||(a=Array(e.length));for(var f=e.length-1;f>=0;--f)a[f]=u*e[f]+c*t[f]+h*r[f]+d*i[f];return a}return u*e+c*t+h*r+d*i},e.exports.derivative=function(e,t,r,i,n,a){var o=6*n*n-6*n,s=3*n*n-4*n+1,l=-6*n*n+6*n,u=3*n*n-2*n;if(e.length){a||(a=Array(e.length));for(var c=e.length-1;c>=0;--c)a[c]=o*e[c]+s*t[c]+l*r[c]+u*i[c];return a}return o*e+s*t+l*r[c]+u*i}},7642(e,t,r){var i=r(8954),n=r(1682);function a(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,i=t.point,n=r.length,a=0;a=2)return!1;e[r]=i}return!0}):_.filter(function(e){for(var t=0;t<=s;++t){var r=y[e[t]];if(r<0)return!1;e[t]=r}return!0}),1&s)for(var c=0;c<_.length;++c){var b=_[c],d=b[0];b[0]=b[1],b[1]=d}return _}},2361(e){var t=!1;if("u">typeof Float64Array){var r=new Float64Array(1),i=new Uint32Array(r.buffer);(r[0]=1,t=!0,0x3ff00000===i[1])?(e.exports=function(e){return r[0]=e,[i[0],i[1]]},e.exports.pack=function(e,t){return i[0]=e,i[1]=t,r[0]},e.exports.lo=function(e){return r[0]=e,i[0]},e.exports.hi=function(e){return r[0]=e,i[1]}):0x3ff00000===i[0]?(e.exports=function(e){return r[0]=e,[i[1],i[0]]},e.exports.pack=function(e,t){return i[1]=e,i[0]=t,r[0]},e.exports.lo=function(e){return r[0]=e,i[1]},e.exports.hi=function(e){return r[0]=e,i[0]}):t=!1}if(!t){var n=new Buffer(8);e.exports=function(e){return n.writeDoubleLE(e,0,!0),[n.readUInt32LE(0,!0),n.readUInt32LE(4,!0)]},e.exports.pack=function(e,t){return n.writeUInt32LE(e,0,!0),n.writeUInt32LE(t,4,!0),n.readDoubleLE(0,!0)},e.exports.lo=function(e){return n.writeDoubleLE(e,0,!0),n.readUInt32LE(0,!0)},e.exports.hi=function(e){return n.writeDoubleLE(e,0,!0),n.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),i=e.exports.hi(t),n=1048575&i;return 0x7ff00000&i&&(n+=1048576),[r,n]},e.exports.denormalized=function(t){return!(0x7ff00000&e.exports.hi(t))}},1338(e){e.exports=function(e,t){switch(typeof t>"u"&&(t=0),typeof e){case"number":if(e>0){var r,i,n=0|e,a=t;for(r=Array(n),i=0;i=r-1)for(var d=l.length-1,p=e-t[r-1],f=0;f=r-1)for(var c=s.length-1,h=(t[r-1],0);h=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e0;--h)i.push(a(l[h-1],u[h-1],arguments[h])),n.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e1e-6?1/s:0;this._time.push(e);for(var d=r;d>0;--d){var f=a(u[d-1],c[d-1],arguments[d]);i.push(f),n.push((f-i[o++])*h)}}},s.set=function(e){var t=this.dimension;if(!(e0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),i.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var i=this._state,n=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=e-t,h=c>1e-6?1/c:0;this._time.push(e);for(var d=r;d>0;--d){var f=arguments[d];i.push(a(l[d-1],u[d-1],i[o++]+f)),n.push(f*h)}}},s.idle=function(e){var t=this.lastT();if(!(e=0;--h)i.push(a(l[h],u[h],i[o]+c*n[o])),n.push(0),o+=1}}},3840(e){function t(e,t,r,i,n,a){this._color=e,this.key=t,this.value=r,this.left=i,this.right=n,this._count=a}function r(e){return new t(e._color,e.key,e.value,e.left,e.right,e._count)}function i(e,r){return new t(e,r.key,r.value,r.left,r.right,r._count)}function n(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}e.exports=function(e){return new a(e||c,null)};var o=a.prototype;function s(e,t){this.tree=e,this._stack=t}Object.defineProperty(o,"keys",{get:function(){var e=[];return this.forEach(function(t,r){e.push(t)}),e}}),Object.defineProperty(o,"values",{get:function(){var e=[];return this.forEach(function(t,r){e.push(r)}),e}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(e,r){for(var o=this._compare,s=this.root,l=[],u=[];s;){var c=o(e,s.key);l.push(s),u.push(c),s=c<=0?s.left:s.right}l.push(new t(0,e,r,null,null,1));for(var h=l.length-2;h>=0;--h){var s=l[h];u[h]<=0?l[h]=new t(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new t(s._color,s.key,s.value,s.left,l[h+1],s._count+1)}for(var h=l.length-1;h>1;--h){var d=l[h-1],s=l[h];if(1===d._color||1===s._color)break;var f=l[h-2];if(f.left===d)if(d.left===s){var p=f.right;if(p&&0===p._color)d._color=1,f.right=i(1,p),f._color=0,h-=1;else{if(f._color=0,f.left=d.right,d._color=1,d.right=f,l[h-2]=d,l[h-1]=s,n(f),n(d),h>=3){var m=l[h-3];m.left===f?m.left=d:m.right=d}break}}else{var p=f.right;if(p&&0===p._color)d._color=1,f.right=i(1,p),f._color=0,h-=1;else{if(d.right=s.left,f._color=0,f.left=s.right,s._color=1,s.left=d,s.right=f,l[h-2]=s,l[h-1]=d,n(f),n(d),n(s),h>=3){var m=l[h-3];m.left===f?m.left=s:m.right=s}break}}else if(d.right===s){var p=f.left;if(p&&0===p._color)d._color=1,f.left=i(1,p),f._color=0,h-=1;else{if(f._color=0,f.right=d.left,d._color=1,d.left=f,l[h-2]=d,l[h-1]=s,n(f),n(d),h>=3){var m=l[h-3];m.right===f?m.right=d:m.left=d}break}}else{var p=f.left;if(p&&0===p._color)d._color=1,f.left=i(1,p),f._color=0,h-=1;else{if(d.left=s.right,f._color=0,f.right=s.left,s._color=1,s.right=d,s.left=f,l[h-2]=s,l[h-1]=d,n(f),n(d),n(s),h>=3){var m=l[h-3];m.right===f?m.right=s:m.left=s}break}}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return function e(t,r){if(r.left){var i=e(t,r.left);if(i)return i}var i=t(r.key,r.value);return i||(r.right?e(t,r.right):void 0)}(e,this.root);case 2:return function e(t,r,i,n){if(0>=r(t,n.key)){if(n.left){var a=e(t,r,i,n.left);if(a)return a}var a=i(n.key,n.value);if(a)return a}if(n.right)return e(t,r,i,n.right)}(t,this._compare,e,this.root);case 3:return this._compare(t,r)>=0?void 0:function e(t,r,i,n,a){var o,s=i(t,a.key),l=i(r,a.key);return s<=0&&(a.left&&(o=e(t,r,i,n,a.left))||l>0&&(o=n(a.key,a.value)))?o:l>0&&a.right?e(t,r,i,n,a.right):void 0}(t,r,this._compare,e,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new s(this,e)}}),Object.defineProperty(o,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new s(this,e)}}),o.at=function(e){if(e<0)return new s(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e=t.right._count)break;t=t.right}else break}return new s(this,[])},o.ge=function(e){for(var t=this._compare,r=this.root,i=[],n=0;r;){var a=t(e,r.key);i.push(r),a<=0&&(n=i.length),r=a<=0?r.left:r.right}return i.length=n,new s(this,i)},o.gt=function(e){for(var t=this._compare,r=this.root,i=[],n=0;r;){var a=t(e,r.key);i.push(r),a<0&&(n=i.length),r=a<0?r.left:r.right}return i.length=n,new s(this,i)},o.lt=function(e){for(var t=this._compare,r=this.root,i=[],n=0;r;){var a=t(e,r.key);i.push(r),a>0&&(n=i.length),r=a<=0?r.left:r.right}return i.length=n,new s(this,i)},o.le=function(e){for(var t=this._compare,r=this.root,i=[],n=0;r;){var a=t(e,r.key);i.push(r),a>=0&&(n=i.length),r=a<0?r.left:r.right}return i.length=n,new s(this,i)},o.find=function(e){for(var t=this._compare,r=this.root,i=[];r;){var n=t(e,r.key);if(i.push(r),0===n)return new s(this,i);r=n<=0?r.left:r.right}return new s(this,[])},o.remove=function(e){var t=this.find(e);return t?t.remove():this},o.get=function(e){for(var t=this._compare,r=this.root;r;){var i=t(e,r.key);if(0===i)return r.value;r=i<=0?r.left:r.right}};var l=s.prototype;function u(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function c(e,t){return et)}Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new s(this.tree,this._stack.slice())},l.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var o=Array(e.length),s=e[e.length-1];o[o.length-1]=new t(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=e.length-2;l>=0;--l){var s=e[l];s.left===e[l+1]?o[l]=new t(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count)}if((s=o[o.length-1]).left&&s.right){var c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var h=o[c-1];o.push(new t(s._color,h.key,h.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value;for(var l=o.length-2;l>=c;--l)s=o[l],o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}if(0===(s=o[o.length-1])._color){var d=o[o.length-2];d.left===s?d.left=null:d.right===s&&(d.right=null),o.pop();for(var l=0;l=0;--l){if(t=e[l],0===l){t._color=1;return}if((a=e[l-1]).left===t){if((o=a.right).right&&0===o.right._color){if(s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,t._color=1,a._color=1,s._color=1,n(a),n(o),l>1){var u=e[l-2];u.left===a?u.left=o:u.right=o}e[l-1]=o;return}if(o.left&&0===o.left._color){if(s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,t._color=1,n(a),n(o),n(s),l>1){var u=e[l-2];u.left===a?u.left=s:u.right=s}e[l-1]=s;return}if(1===o._color)if(0===a._color){a._color=1,a.right=i(0,o);return}else{a.right=i(0,o);continue}if(a.right=(o=r(o)).left,o.left=a,o._color=a._color,a._color=0,n(a),n(o),l>1){var u=e[l-2];u.left===a?u.left=o:u.right=o}e[l-1]=o,e[l]=a,l+11){var u=e[l-2];u.right===a?u.right=o:u.left=o}e[l-1]=o;return}if(o.right&&0===o.right._color){if(s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,t._color=1,n(a),n(o),n(s),l>1){var u=e[l-2];u.right===a?u.right=s:u.left=s}e[l-1]=s;return}if(1===o._color)if(0===a._color){a._color=1,a.left=i(0,o);return}else{a.left=i(0,o);continue}if(a.left=(o=r(o)).right,o.right=a,o._color=a._color,a._color=0,n(a),n(o),l>1){var u=e[l-2];u.right===a?u.right=o:u.left=o}e[l-1]=o,e[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var i=t.length-2;i>=0;--i)t[i+1]===t[i].right&&(++e,t[i].left&&(e+=t[i].left._count));return e},enumerable:!0}),l.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),l.update=function(e){var r=this._stack;if(0===r.length)throw Error("Can't update empty node!");var i=Array(r.length),n=r[r.length-1];i[i.length-1]=new t(n._color,n.key,e,n.left,n.right,n._count);for(var o=r.length-2;o>=0;--o)(n=r[o]).left===r[o+1]?i[o]=new t(n._color,n.key,n.value,i[o+1],n.right,n._count):i[o]=new t(n._color,n.key,n.value,n.left,i[o+1],n._count);return new a(this.tree._compare,i[0])},l.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},3837(e,t,r){e.exports=function(e,t){var r=new f(e);return r.update(t),r};var i=r(4935),n=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=ArrayBuffer,c=DataView;function h(e){return Array.isArray(e)||u.isView(e)&&!(e instanceof c)}function d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function f(e){this.gl=e,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(e)}var p=f.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}p.update=function(e){function t(t,r,i){if(i in e){var n,a=e[i],o=this[i];(t?h(a)&&h(a[0]):h(a))?this[i]=n=[r(a[0]),r(a[1]),r(a[2])]:this[i]=n=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(n[s]!==o[s])return!0}return!1}e=e||{};var r,a=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),u=t.bind(this,!0,function(e){if(h(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]}),c=!1,d=!1;if("bounds"in e)for(var f=e.bounds,p=0;p<2;++p)for(var m=0;m<3;++m)f[p][m]!==this.bounds[p][m]&&(d=!0),this.bounds[p][m]=f[p][m];if("ticks"in e){r=e.ticks,c=!0,this.autoTicks=!1;for(var p=0;p<3;++p)this.tickSpacing[p]=0}else a("tickSpacing")&&(this.autoTicks=!0,d=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),d=!0,c=!0,this._firstInit=!1),d&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),c=!0),c){for(var p=0;p<3;++p)r[p].sort(function(e,t){return e.x-t.x});s.equal(r,this.ticks)?c=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(c=!0),l("tickFontStyle")&&(c=!0),l("tickFontWeight")&&(c=!0),l("tickFontVariant")&&(c=!0),a("tickSize"),a("tickAngle"),a("tickPad"),u("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),u("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),u("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),u("lineTickColor"),o("gridEnable"),a("gridWidth"),u("gridColor"),o("zeroEnable"),u("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),u("backgroundColor");var y=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],v=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||c)&&this._text.update(this.bounds,this.labels,y,this.ticks,v):this._text=i(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=n(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m],y=[0,0,0],v={model:l,view:l,projection:l,_ortho:!1};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(e){};var x=[0,0,0],b=[0,0,0],_=[0,0,0];p.draw=function(e){e=e||v;for(var t,r,i,n=this.gl,a=e.model||l,s=e.view||l,u=e.projection||l,c=this.bounds,h=e._ortho||!1,f=o(a,s,u,c,h),p=f.cubeEdges,m=f.axis,w=s[12],T=s[13],A=s[14],M=s[15],k=h?2:1,S=k*this.pixelRatio*(u[3]*w+u[7]*T+u[11]*A+u[15]*M)/n.drawingBufferHeight,E=0;E<3;++E)this.lastCubeProps.cubeEdges[E]=p[E],this.lastCubeProps.axis[E]=m[E];for(var E=0;E<3;++E)!function(e,t,r,i,n){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,u=i[t],c=0;c<3;++c)if(t!==c){var h=a,d=s,f=o,p=l;u&1<0?(f[c]=-1,p[c]=0):(f[c]=0,p[c]=1)}}(g[E],E,this.bounds,p,m);for(var n=this.gl,E=0;E<3;++E)this.backgroundEnable[E]?y[E]=m[E]:y[E]=0;this._background.draw(a,s,u,c,y,this.backgroundColor),this._lines.bind(a,s,u,this);for(var E=0;E<3;++E){var D=[0,0,0];m[E]>0?D[E]=c[1][E]:D[E]=c[0][E];for(var C=0;C<2;++C){var I=(E+1+C)%3,L=(E+1+(1^C))%3;this.gridEnable[I]&&this._lines.drawGrid(I,L,this.bounds,D,this.gridColor[I],this.gridWidth[I]*this.pixelRatio)}for(var C=0;C<2;++C){var I=(E+1+C)%3,L=(E+1+(1^C))%3;this.zeroEnable[L]&&0>=Math.min(c[0][L],c[1][L])&&Math.max(c[0][L],c[1][L])>=0&&this._lines.drawZero(I,L,this.bounds,D,this.zeroLineColor[L],this.zeroLineWidth[L]*this.pixelRatio)}}for(var E=0;E<3;++E){this.lineEnable[E]&&this._lines.drawAxisLine(E,this.bounds,g[E].primalOffset,this.lineColor[E],this.lineWidth[E]*this.pixelRatio),this.lineMirror[E]&&this._lines.drawAxisLine(E,this.bounds,g[E].mirrorOffset,this.lineColor[E],this.lineWidth[E]*this.pixelRatio);for(var P=d(x,g[E].primalMinor),z=d(b,g[E].mirrorMinor),F=this.lineTickLength,C=0;C<3;++C){var O=S/a[5*C];P[C]*=F[C]*O,z[C]*=F[C]*O}this.lineTickEnable[E]&&this._lines.drawAxisTicks(E,g[E].primalOffset,P,this.lineTickColor[E],this.lineTickWidth[E]*this.pixelRatio),this.lineTickMirror[E]&&this._lines.drawAxisTicks(E,g[E].mirrorOffset,z,this.lineTickColor[E],this.lineTickWidth[E]*this.pixelRatio)}function R(e){(i=[0,0,0])[e]=1}this._lines.unbind(),this._text.bind(a,s,u,this.pixelRatio);for(var E=0;E<3;++E){for(var B=g[E].primalMinor,j=g[E].mirrorMinor,N=d(_,g[E].primalOffset),C=0;C<3;++C)this.lineTickEnable[E]&&(N[C]+=S*B[C]*Math.max(this.lineTickLength[C],0)/a[5*C]);var V=[0,0,0];if(V[E]=1,this.tickEnable[E]){-3600===this.tickAngle[E]?(this.tickAngle[E]=0,this.tickAlign[E]="auto"):this.tickAlign[E]=-1,r=1,"auto"===(t=[this.tickAlign[E],.5,r])[0]?t[0]=0:t[0]=parseInt(""+t[0]),i=[0,0,0],function(e,t,r){var i=(e+1)%3,n=(e+2)%3,a=t[i],o=t[n],s=r[i],l=r[n];if(a>0&&l>0||a>0&&l<0)return R(i);a<0&&l>0||a<0&&l<0?R(i):o>0&&s>0||o>0&&s<0||o<0&&s>0?R(n):o<0&&s<0&&R(n)}(E,B,j);for(var C=0;C<3;++C)N[C]+=S*B[C]*this.tickPad[C]/a[5*C];this._text.drawTicks(E,this.tickSize[E],this.tickAngle[E],N,this.tickColor[E],V,i,t)}if(this.labelEnable[E]){r=0,i=[0,0,0],this.labels[E].length>4&&(R(E),r=1),"auto"===(t=[this.labelAlign[E],.5,r])[0]?t[0]=0:t[0]=parseInt(""+t[0]);for(var C=0;C<3;++C)N[C]+=S*B[C]*this.labelPad[C]/a[5*C];N[E]+=.5*(c[0][E]+c[1][E]),this._text.drawLabel(E,this.labelSize[E],this.labelAngle[E],N,this.labelColor[E],[0,0,0],i,t)}}this._text.unbind()},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304(e,t,r){e.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],d=[0,0,0],f=-1;f<=1;f+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=f,d[l]=f;for(var p=-1;p<=1;p+=2){h[u]=p;for(var m=-1;m<=1;m+=2)h[c]=m,t.push(h[0],h[1],h[2],d[0],d[1],d[2]),s+=1}var g=u;u=c,c=g}var y=i(e,new Float32Array(t)),v=i(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),x=n(e,[{buffer:y,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:e.FLOAT,size:3,offset:12,stride:24}],v),b=a(e);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(e,y,x,b)};var i=r(2762),n=r(8116),a=r(1879).bg;function o(e,t,r,i){this.gl=e,this.buffer=t,this.vao=r,this.shader=i}var s=o.prototype;s.draw=function(e,t,r,i,n,a){for(var o=!1,s=0;s<3;++s)o=o||n[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:i,enable:n,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429(e,t,r){e.exports=function(e,t,r,d,y){n(s,t,e),n(s,r,s);for(var v=0,x=0;x<2;++x){c[2]=d[x][2];for(var b=0;b<2;++b){c[1]=d[b][1];for(var _=0;_<2;++_)c[0]=d[_][0],function(e,t,r){for(var i=0;i<4;++i){e[i]=r[12+i];for(var n=0;n<3;++n)e[i]+=t[n]*r[4*n+i]}}(l[v],c,s),v+=1}}for(var w=-1,x=0;x<8;++x){for(var T=l[x][3],A=0;A<3;++A)u[x][A]=l[x][A]/T;y&&(u[x][2]*=-1),T<0&&(w<0||u[x][2]o(u[I],u[L],u[P],h)||(C?E=1:D=1)}if(E<0||D<0){D>E&&(w|=1<E){w|=1<u[x][1])&&(O=x);for(var R=-1,x=0;x<3;++x){var B=O^1<u[j][0]&&(j=B)}}p[0]=p[1]=p[2]=0,p[i.log2(R^O)]=O&R,p[i.log2(O^j)]=O&j;var N=7^j;N===w||N===F?(N=7^R,p[i.log2(j^N)]=N&j):p[i.log2(R^N)]=N&R;for(var V=w,M=0;M<3;++M)V&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ? + b - PI : + b; +} + +float look_horizontal_or_vertical(float a, float ratio) { + // ratio controls the ratio between being horizontal to (vertical + horizontal) + // if ratio is set to 0.5 then it is 50%, 50%. + // when using a higher ratio e.g. 0.75 the result would + // likely be more horizontal than vertical. + + float b = positive_angle(a); + + return + (b < ( ratio) * HALF_PI) ? 0.0 : + (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : + (b < (2.0 + ratio) * HALF_PI) ? 0.0 : + (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : + 0.0; +} + +float roundTo(float a, float b) { + return float(b * floor((a + 0.5 * b) / b)); +} + +float look_round_n_directions(float a, int n) { + float b = positive_angle(a); + float div = TWO_PI / float(n); + float c = roundTo(b, div); + return look_upwards(c); +} + +float applyAlignOption(float rawAngle, float delta) { + return + (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions + (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical + (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis + (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards + (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal + rawAngle; // otherwise return back raw input angle +} + +bool isAxisTitle = (axis.x == 0.0) && + (axis.y == 0.0) && + (axis.z == 0.0); + +void main() { + //Compute world offset + float axisDistance = position.z; + vec3 dataPosition = axisDistance * axis + offset; + + float beta = angle; // i.e. user defined attributes for each tick + + float axisAngle; + float clipAngle; + float flip; + + if (enableAlign) { + axisAngle = (isAxisTitle) ? HALF_PI : + computeViewAngle(dataPosition, dataPosition + axis); + clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); + + axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; + clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; + + flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), + vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; + + beta += applyAlignOption(clipAngle, flip * PI); + } + + //Compute plane offset + vec2 planeCoord = position.xy * pixelScale; + + mat2 planeXform = scale * mat2( + cos(beta), sin(beta), + -sin(beta), cos(beta) + ); + + vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; + + //Compute clip position + vec3 clipPosition = project(dataPosition); + + //Apply text offset in clip coordinates + clipPosition += vec3(viewOffset, 0.0); + + //Done + gl_Position = vec4(clipPosition, 1.0); +} +`]),l=i([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);t.Q=function(e){return n(e,s,l,null,[{name:"position",type:"vec3"}])};var u=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec3 normal; + +uniform mat4 model, view, projection; +uniform vec3 enable; +uniform vec3 bounds[2]; + +varying vec3 colorChannel; + +void main() { + + vec3 signAxis = sign(bounds[1] - bounds[0]); + + vec3 realNormal = signAxis * normal; + + if(dot(realNormal, enable) > 0.0) { + vec3 minRange = min(bounds[0], bounds[1]); + vec3 maxRange = max(bounds[0], bounds[1]); + vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); + gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); + } else { + gl_Position = vec4(0,0,0,0); + } + + colorChannel = abs(realNormal); +} +`]),c=i([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 colors[3]; + +varying vec3 colorChannel; + +void main() { + gl_FragColor = colorChannel.x * colors[0] + + colorChannel.y * colors[1] + + colorChannel.z * colors[2]; +}`]);t.bg=function(e){return n(e,u,c,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935(e,t,r){e.exports=function(e,t,r,a,s,l){var c=i(e),h=n(e,[{buffer:c,size:3}]),d=o(e);d.attributes.position.location=0;var f=new u(e,d,c,h);return f.update(t,r,a,s,l),f};var i=r(2762),n=r(8116),a=r(4359),o=r(1879).Q,s=window||S.global||{},l=s.__TEXT_CACHE||{};function u(e,t,r,i){this.gl=e,this.shader=t,this.buffer=r,this.vao=i,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var c=u.prototype,h=[0,0];c.bind=function(e,t,r,i){this.vao.bind(),this.shader.bind();var n=this.shader.uniforms;n.model=e,n.view=t,n.projection=r,n.pixelScale=i,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},c.unbind=function(){this.vao.unbind()},c.update=function(e,t,r,i,n){var o=[];function s(e,t,r,i,n,s){var u=[r.style,r.weight,r.variant,r.family].join("_"),c=l[u];c||(c=l[u]={});var h=c[t];h||(h=c[t]=function(e,t){try{return a(e,t)}catch(t){return console.warn('error vectorizing text:"'+e+'" error:',t),{cells:[],positions:[]}}}(t,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:n,styletags:s}));for(var d=(i||12)/12,f=h.positions,p=h.cells,m=0,g=p.length;m=0;--v){var x=f[y[v]];o.push(d*x[0],-d*x[1],e)}}for(var u=[0,0,0],c=[0,0,0],h=[0,0,0],d=[0,0,0],f={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},p=0;p<3;++p){h[p]=o.length/3|0,s(.5*(e[0][p]+e[1][p]),t[p],r[p],12,1.25,f),d[p]=(o.length/3|0)-h[p],u[p]=o.length/3|0;for(var m=0;m=0&&(n=r.length-i-1);var a=Math.pow(10,n),o=Math.round(e*t*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),!n)return c;for(var h=""+u;h.length=e[0][n];--o)a.push({x:o*t[n],text:r(t[n],o)});i.push(a)}return i},t.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var i=0;ir)throw Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,a,n),r}function c(e,t){for(var r=i.malloc(e.length,t),n=e.length,a=0;atypeof e.shape){var r,s=e.dtype;if(0>o.indexOf(s)&&(s="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(s=gl.getExtension("OES_element_index_uint")&&"uint16"!==s?"uint32":"uint16"),s===e.dtype&&function(e,t){for(var r=1,i=t.length-1;i>=0;--i){if(t[i]!==r)return!1;r*=e[i]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=u(this.gl,this.type,this.length,this.usage,e.data,t):this.length=u(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var l=i.malloc(e.size,s),h=a(l,e.shape);n.assign(h,e),t<0?this.length=u(this.gl,this.type,this.length,this.usage,l,t):this.length=u(this.gl,this.type,this.length,this.usage,l.subarray(0,e.size),t),i.free(l)}}else if(Array.isArray(e))r=this.type===this.gl.ELEMENT_ARRAY_BUFFER?c(e,"uint16"):c(e,"float32"),t<0?this.length=u(this.gl,this.type,this.length,this.usage,r,t):this.length=u(this.gl,this.type,this.length,this.usage,r.subarray(0,e.length),t),i.free(r);else if("object"==typeof e&&"number"==typeof e.length)this.length=u(this.gl,this.type,this.length,this.usage,e,t);else if("number"==typeof e||void 0===e){if(t>=0)throw Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}else throw Error("gl-buffer: Invalid data type")},e.exports=function(e,t,r,i){if(r=r||e.ARRAY_BUFFER,i=i||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.ELEMENT_ARRAY_BUFFER)throw Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==e.DYNAMIC_DRAW&&i!==e.STATIC_DRAW&&i!==e.STREAM_DRAW)throw Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var n=e.createBuffer(),a=new s(e,r,n,0,i);return a.update(t),a}},6405(e,t,r){var i=r(2931);e.exports=function(e,t){var r=e.positions,n=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,u=1/0,c=-1/0,h=1/0,d=-1/0,f=null,p=null,m=[],g=1/0,y=!1,v="raw"===e.coneSizemode,x=0;xo&&(o=i.length(_)),x&&!v){var w=2*i.distance(f,b)/(i.length(p)+i.length(_));w?(g=Math.min(g,w),y=!1):y=!0}y||(f=b,p=_),m.push(_)}var T=[s,u,h],A=[l,c,d];t&&(t[0]=T,t[1]=A),0===o&&(o=1);var M=1/o;isFinite(g)||(g=1),a.vectorScale=g;var k=e.coneSize||(v?1:.5);e.absoluteConeSize&&(k=e.absoluteConeSize*M),a.coneScale=k;for(var x=0,S=0;x=1},f.isTransparent=function(){return this.opacity<1},f.pickSlots=1,f.setPickBase=function(e){this.pickId=e},f.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"lightPosition"in e&&(this.lightPosition=e.lightPosition),"opacity"in e&&(this.opacity=e.opacity),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e){for(var t=c({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),i=0;i<256;++i){for(var n=t[i],a=0;a<3;++a)r[4*i+a]=n[a];r[4*i+3]=255*n[3]}return u(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,i=e.positions,n=e.vectors;if(!(!i||!r||!n)){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=i,this.vectors=n;var d=e.meshColor||[1,1,1,1],f=e.vertexIntensity,p=1/0,m=-1/0;if(f)if(e.vertexIntensityBounds)p=+e.vertexIntensityBounds[0],m=+e.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=u,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},f.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||h,i=e.view||h,n=e.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(i),this._projection=[].slice.call(n),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:i,projection:n,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},f.pick=function(e){if(!e||e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],i=this.positions[r[1]].slice(0,3),n={position:i,dataCoordinate:i,index:Math.floor(r[1]/48)};return"cone"===this.traceType?n.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(n.intensity=this.intensity[r[1]],n.velocity=this.vectors[r[1]].slice(0,3),n.divergence=this.vectors[r[1]][3],n.index=t),n},f.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(e,t,r){var s,l,c=r.shaders;1==arguments.length&&(e=(t=e).gl);var h=((s=i(e,c.meshShader.vertex,c.meshShader.fragment,null,c.meshShader.attributes)).attributes.position.location=0,s.attributes.color.location=2,s.attributes.uv.location=3,s.attributes.vector.location=4,s),f=((l=i(e,c.pickShader.vertex,c.pickShader.fragment,null,c.pickShader.attributes)).attributes.position.location=0,l.attributes.id.location=1,l.attributes.vector.location=4,l),p=o(e,u(new Uint8Array([255,255,255,255]),[1,1,4]));p.generateMipmap(),p.minFilter=e.LINEAR_MIPMAP_LINEAR,p.magFilter=e.LINEAR;var m=n(e),g=n(e),y=n(e),v=n(e),x=n(e),b=a(e,[{buffer:m,type:e.FLOAT,size:4},{buffer:x,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:y,type:e.FLOAT,size:4},{buffer:v,type:e.FLOAT,size:2},{buffer:g,type:e.FLOAT,size:4}]),_=new d(e,p,h,f,m,g,x,y,v,b,r.traceType||"cone");return _.update(t),_}},614(e,t,r){var i=r(3236),n=i([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec3 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, coneScale, coneOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * conePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(conePosition, 1.0); + vec4 t_position = view * conePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = conePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),a=i([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),o=i([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float vectorScale, coneScale, coneOffset; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + gl_Position = projection * (view * conePosition); + f_id = id; + f_position = position.xyz; +} +`]),s=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);t.meshShader={vertex:n,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171(e,t,r){var i=r(737);e.exports=function(e){return i[e]}},9165(e,t,r){e.exports=function(e){var t=e.gl,r=i(t),o=n(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=a(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var u=new s(t,r,o,l);return u.update(e),u};var i=r(2762),n=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,i){this.gl=e,this.shader=i,this.buffer=t,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function u(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var i=r.view=e.view||o,n=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=i[12],s=i[13],l=i[14],u=i[15],c=(e._ortho?2:1)*this.pixelRatio*(n[3]*a+n[7]*s+n[11]*l+n[15]*u)/t.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)t.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*c,this.lineCount[h]&&t.drawArrays(t.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var c=function(){for(var e=[,,,],t=0;t<3;++t){for(var r=[],i=1;i<=2;++i)for(var n=-1;n<=1;n+=2){var a=[0,0,0];a[(i+t)%3]=n,r.push(a)}e[t]=r}return e}();function h(e,t,r,i){for(var n=c[i],a=0;a0){var m=c.slice();m[s]+=f[1][s],n.push(c[0],c[1],c[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),u(this.bounds,m),o+=2+h(n,m,p,s)}}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(n)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436(e,t,r){var i=r(3236),n=r(9405),a=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, offset; +attribute vec4 color; +uniform mat4 model, view, projection; +uniform float capSize; +varying vec4 fragColor; +varying vec3 fragPosition; + +void main() { + vec4 worldPosition = model * vec4(position, 1.0); + worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); + gl_Position = projection * (view * worldPosition); + fragColor = color; + fragPosition = position; +}`]),o=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float opacity; +varying vec3 fragPosition; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], fragPosition) || + fragColor.a * opacity == 0. + ) discard; + + gl_FragColor = opacity * fragColor; +}`]);e.exports=function(e){return n(e,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260(e,t,r){var i=r(7766);e.exports=function(e,t,r,i){n||(n=e.FRAMEBUFFER_UNSUPPORTED,a=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var u=e.getExtension("WEBGL_draw_buffers");if(!l&&u&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=Array(r+1);for(var i=0;i<=r;++i){for(var n=Array(r),a=0;ac||r<0||r>c)throw Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(i=i||{})){if((h=Math.max(0|i.color,0))<0)throw Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1)if(u){if(h>e.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL))throw Error("gl-fbo: Context does not support "+h+" draw buffers")}else throw Error("gl-fbo: Multiple draw buffer extension not supported")}var d=e.UNSIGNED_BYTE,f=e.getExtension("OES_texture_float");if(i.float&&h>0){if(!f)throw Error("gl-fbo: Context does not support floating point textures");d=e.FLOAT}else i.preferFloat&&h>0&&f&&(d=e.FLOAT);var m=!0;"depth"in i&&(m=!!i.depth);var g=!1;return"stencil"in i&&(g=!!i.stencil),new p(e,t,r,d,h,m,g,u)};var n,a,o,s,l=null;function u(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function c(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function h(e){switch(e){case n:throw Error("gl-fbo: Framebuffer unsupported");case a:throw Error("gl-fbo: Framebuffer incomplete attachment");case o:throw Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw Error("gl-fbo: Framebuffer failed for unspecified reason")}}function d(e,t,r,n,a,o){if(!n)return null;var s=i(e,t,r,a,n);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function f(e,t,r,i,n){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,i,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a),a}function p(e,t,r,i,n,a,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=Array(n);for(var p=0;p1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?p?e.depth=d(r,n,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(e.depth=d(r,n,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&p?e._depth_rb=f(r,n,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?e._depth_rb=f(r,n,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(e._depth_rb=f(r,n,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null);for(var y=0;yn||r<0||r>n)throw Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var a=u(i),o=0;o max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D dashTexture; +uniform float dashScale; +uniform float opacity; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], worldPosition) || + fragColor.a * opacity == 0. + ) discard; + + float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; + if(dashWeight < 0.5) { + discard; + } + gl_FragColor = fragColor * opacity; +} +`]),s=i([`precision highp float; +#define GLSLIFY 1 + +#define FLOAT_MAX 1.70141184e38 +#define FLOAT_MIN 1.17549435e-38 + +// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl +vec4 packFloat(float v) { + float av = abs(v); + + //Handle special cases + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; + } + + vec4 c = vec4(0,0,0,0); + + //Compute exponent and mantissa + float e = floor(log2(av)); + float m = av * pow(2.0, -e) - 1.0; + + //Unpack mantissa + c[1] = floor(128.0 * m); + m -= c[1] / 128.0; + c[2] = floor(32768.0 * m); + m -= c[2] / 32768.0; + c[3] = floor(8388608.0 * m); + + //Unpack exponent + float ebias = e + 127.0; + c[0] = floor(ebias / 2.0); + ebias -= c[0] * 2.0; + c[1] += floor(ebias) * 128.0; + + //Unpack sign bit + c[0] += 128.0 * step(0.0, -v); + + //Scale back to range + return c / 255.0; +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform float pickId; +uniform vec3 clipBounds[2]; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; + + gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); +}`]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(e){return n(e,a,o,null,l)},t.createPickShader=function(e){return n(e,a,s,null,l)}},5714(e,t,r){e.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=h(t);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=d(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=i(t),l=n(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),c=u(Array(1024),[256,1,4]),f=0;f<1024;++f)c.data[f]=255;var p=a(t,c);p.wrap=t.REPEAT;var m=new g(t,r,o,s,l,p);return m.update(e),m};var i=r(2762),n=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),u=r(9618),c=r(7319),h=c.createShader,d=c.createPickShader,f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function m(e,t,r,i){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=i}function g(e,t,r,i,n,a){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=i,this.vao=n,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=g.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(e){this.pickId=e},y.drawTransparent=y.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,i=this.vao;r.bind(),r.uniforms={model:e.model||f,view:e.view||f,projection:e.projection||f,clipBounds:p(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},i.bind(),i.draw(t.TRIANGLE_STRIP,this.vertexCount),i.unbind()}},y.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,i=this.vao;r.bind(),r.uniforms={model:e.model||f,view:e.view||f,projection:e.projection||f,pickId:this.pickId,clipBounds:p(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},i.bind(),i.draw(t.TRIANGLE_STRIP,this.vertexCount),i.unbind()}},y.update=function(e){this.dirty=!0;var t=!!e.connectGaps;"dashScale"in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var r=[],i=[],n=[],a=0,o=0,s=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],c=e.position||e.positions;if(c){var h=e.color||e.colors||[0,0,0,1],d=e.lineWidth||1,f=!1;e:for(p=1;p0){for(var _=0;_<24;++_)r.push(r[r.length-12]);o+=2,f=!0}continue e}s[0][m]=Math.min(s[0][m],x[m],b[m]),s[1][m]=Math.max(s[1][m],x[m],b[m])}Array.isArray(h[0])?(g=h.length>p-1?h[p-1]:h.length>0?h[h.length-1]:[0,0,0,1],y=h.length>p?h[p]:h.length>0?h[h.length-1]:[0,0,0,1]):g=y=h,3===g.length&&(g=[g[0],g[1],g[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&g[3]<1&&(this.hasAlpha=!0),v=Array.isArray(d)?d.length>p-1?d[p-1]:d.length>0?d[d.length-1]:[0,0,0,1]:d;var w=a;if(a+=function(e,t){for(var r=0,i=0;i<3;++i){var n=e[i]-t[i];r+=n*n}return Math.sqrt(r)}(x,b),f){for(m=0;m<2;++m)r.push(x[0],x[1],x[2],b[0],b[1],b[2],w,v,g[0],g[1],g[2],g[3]);o+=2,f=!1}r.push(x[0],x[1],x[2],b[0],b[1],b[2],w,v,g[0],g[1],g[2],g[3],x[0],x[1],x[2],b[0],b[1],b[2],w,-v,g[0],g[1],g[2],g[3],b[0],b[1],b[2],x[0],x[1],x[2],a,-v,y[0],y[1],y[2],y[3],b[0],b[1],b[2],x[0],x[1],x[2],a,v,y[0],y[1],y[2],y[3]),o+=4}}if(this.buffer.update(r),i.push(a),n.push(c[c.length-1].slice()),this.bounds=s,this.vertexCount=o,this.points=n,this.arcLength=i,"dashes"in e){var T=e.dashes.slice();for(T.unshift(0),p=1;pMath.abs(m-_)&&1e-6>Math.abs(g-w)&&1e-6>Math.abs(y-T)?i(e):(p=1/Math.sqrt((h=m-_)*h+(d=g-w)*d+(f=y-T)*f),h*=p,d*=p,f*=p,(p=Math.sqrt((a=x*f-b*d)*a+(o=b*h-v*f)*o+(s=v*d-x*h)*s))?(a*=p=1/p,o*=p,s*=p):(a=0,o=0,s=0),(p=Math.sqrt((l=d*s-f*o)*l+(u=f*a-h*s)*u+(c=h*o-d*a)*c))?(l*=p=1/p,u*=p,c*=p):(l=0,u=0,c=0),e[0]=a,e[1]=l,e[2]=h,e[3]=0,e[4]=o,e[5]=u,e[6]=d,e[7]=0,e[8]=s,e[9]=c,e[10]=f,e[11]=0,e[12]=-(a*m+o*g+s*y),e[13]=-(l*m+u*g+c*y),e[14]=-(h*m+d*g+f*y),e[15]=1,e)}},6760(e){e.exports=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*i+b*s+_*h+w*m,e[1]=x*n+b*l+_*d+w*g,e[2]=x*a+b*u+_*f+w*y,e[3]=x*o+b*c+_*p+w*v,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*i+b*s+_*h+w*m,e[5]=x*n+b*l+_*d+w*g,e[6]=x*a+b*u+_*f+w*y,e[7]=x*o+b*c+_*p+w*v,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*i+b*s+_*h+w*m,e[9]=x*n+b*l+_*d+w*g,e[10]=x*a+b*u+_*f+w*y,e[11]=x*o+b*c+_*p+w*v,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*i+b*s+_*h+w*m,e[13]=x*n+b*l+_*d+w*g,e[14]=x*a+b*u+_*f+w*y,e[15]=x*o+b*c+_*p+w*v,e}},4040(e){e.exports=function(e,t,r,i,n,a,o){var s=1/(t-r),l=1/(i-n),u=1/(a-o);return e[0]=-2*s,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*u,e[11]=0,e[12]=(t+r)*s,e[13]=(n+i)*l,e[14]=(o+a)*u,e[15]=1,e}},4772(e){e.exports=function(e,t,r,i,n){var a=1/Math.tan(t/2),o=1/(i-n);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(n+i)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*n*i*o,e[15]=0,e}},6079(e){e.exports=function(e,t,r,i){var n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E=i[0],D=i[1],C=i[2],I=Math.sqrt(E*E+D*D+C*C);return 1e-6>Math.abs(I)?null:(E*=I=1/I,D*=I,C*=I,n=Math.sin(r),o=1-(a=Math.cos(r)),s=t[0],l=t[1],u=t[2],c=t[3],h=t[4],d=t[5],f=t[6],p=t[7],m=t[8],g=t[9],y=t[10],v=t[11],x=E*E*o+a,b=D*E*o+C*n,_=C*E*o-D*n,w=E*D*o-C*n,T=D*D*o+a,A=C*D*o+E*n,M=E*C*o+D*n,k=D*C*o-E*n,S=C*C*o+a,e[0]=s*x+h*b+m*_,e[1]=l*x+d*b+g*_,e[2]=u*x+f*b+y*_,e[3]=c*x+p*b+v*_,e[4]=s*w+h*T+m*A,e[5]=l*w+d*T+g*A,e[6]=u*w+f*T+y*A,e[7]=c*w+p*T+v*A,e[8]=s*M+h*k+m*S,e[9]=l*M+d*k+g*S,e[10]=u*M+f*k+y*S,e[11]=c*M+p*k+v*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},5567(e){e.exports=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*i,e[5]=o*n+c*i,e[6]=s*n+h*i,e[7]=l*n+d*i,e[8]=u*n-a*i,e[9]=c*n-o*i,e[10]=h*n-s*i,e[11]=d*n-l*i,e}},2408(e){e.exports=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-u*i,e[1]=o*n-c*i,e[2]=s*n-h*i,e[3]=l*n-d*i,e[8]=a*i+u*n,e[9]=o*i+c*n,e[10]=s*i+h*n,e[11]=l*i+d*n,e}},7089(e){e.exports=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(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[0]=a*n+u*i,e[1]=o*n+c*i,e[2]=s*n+h*i,e[3]=l*n+d*i,e[4]=u*n-a*i,e[5]=c*n-o*i,e[6]=h*n-s*i,e[7]=d*n-l*i,e}},2504(e){e.exports=function(e,t,r){var i=r[0],n=r[1],a=r[2];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]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},7656(e){e.exports=function(e,t,r){var i,n,a,o,s,l,u,c,h,d,f,p,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=i,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=i*m+s*g+h*y+t[12],e[13]=n*m+l*g+d*y+t[13],e[14]=a*m+u*g+f*y+t[14],e[15]=o*m+c*g+p*y+t[15]),e}},5665(e){e.exports=function(e,t){if(e===t){var r=t[1],i=t[2],n=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=n,e[13]=o,e[14]=s}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}},7626(e,t,r){var i=r(2642),n=r(9346);function a(e,t){for(var r=[0,0,0,0],i=0;i<4;++i)for(var n=0;n<4;++n)r[n]+=e[4*i+n]*t[i];return r}e.exports=function(e,t,r,o,s,l){if(1===e.length)return[0,e[0].slice()];for(var u=Array(e.length),c=0;c1.0001)return null;g+=m[c]}return Math.abs(g-1)>.001?null:[h,function(e,t){for(var r=[0,0,0],i=0;i max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness + , fresnel + , kambient + , kdiffuse + , kspecular; +uniform sampler2D texture; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (f_color.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], f_data) + ) discard; + + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d + + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * f_color.a; +} +`]),o=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model, view, projection; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_color = color; + f_data = position; + f_uv = uv; +}`]),s=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; + + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),l=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; +attribute float pointSize; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + } + gl_PointSize = pointSize; + f_color = color; + f_uv = uv; +}`]),u=i([`precision highp float; +#define GLSLIFY 1 + +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); + if(dot(pointR, pointR) > 0.25) { + discard; + } + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),c=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 id; + +uniform mat4 model, view, projection; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_id = id; + f_position = position; +}`]),h=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]),d=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute float pointSize; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + gl_PointSize = pointSize; + } + f_id = id; + f_position = position; +}`]),f=i([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; + +uniform mat4 model, view, projection; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); +}`]),p=i([`precision highp float; +#define GLSLIFY 1 + +uniform vec3 contourColor; + +void main() { + gl_FragColor = vec4(contourColor, 1.0); +} +`]);t.meshShader={vertex:n,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:c,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:d,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:f,fragment:p,attributes:[{name:"position",type:"vec3"}]}},7201(e,t,r){var i=r(9405),n=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),u=r(7608),c=r(9618),h=r(6729),d=r(7765),f=r(1888),p=r(840),m=r(7626),g=p.meshShader,y=p.wireShader,v=p.pointShader,x=p.pickShader,b=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,T,A,M,k,S){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=i,this.pointShader=n,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=d,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=f,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=A,this.pointIds=b,this.pointVAO=M,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var A=T.prototype;function M(e,t){if(!t||!t.length)return 1;for(var r=0;re&&r>0){var i=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-i)+i*t[r-1][1]}}return 1}A.isOpaque=function(){return!this.hasAlpha},A.isTransparent=function(){return this.hasAlpha},A.pickSlots=1,A.setPickBase=function(e){this.pickId=e},A.highlight=function(e){if(!e||!this.contourEnable){this.contourCount=0;return}for(var t=d(this.cells,this.intensity,e.intensity),r=t.cells,i=t.vertexIds,n=t.vertexWeights,a=r.length,o=f.mallocFloat32(6*a),s=0,l=0;l0){var p=this.triShader;p.bind(),p.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var p=this.lineShader;p.bind(),p.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var p=this.pointShader;p.bind(),p.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var p=this.contourShader;p.bind(),p.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind()}},A.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||w,i=e.view||w,n=e.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(i),this._projection=[].slice.call(n),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:i,projection:n,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()}},A.pick=function(e){if(!e||e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],i=this.positions,n=Array(r.length),a=0;aMath.abs(t))u.rotate(a,0,0,-e*r*Math.PI*p.rotateSpeed/window.innerWidth);else if(!p._ortho){var o=-p.zoomSpeed*n*t/window.innerHeight*(a-u.lastT())/20;u.pan(a,0,0,h*(Math.exp(o)-1))}}},!0)},p.enableMouseListeners(),p};var i=r(3025),n=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799(e,t,r){var i=r(3236),n=r(9405),a=i([`precision mediump float; +#define GLSLIFY 1 +attribute vec2 position; +varying vec2 uv; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),o=i([`precision mediump float; +#define GLSLIFY 1 + +uniform sampler2D accumBuffer; +varying vec2 uv; + +void main() { + vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); + gl_FragColor = min(vec4(1,1,1,1), accum); +}`]);e.exports=function(e){return n(e,a,o,null,[{name:"position",type:"vec2"}])}},4100(e,t,r){var i=r(4437),n=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),u=r(7169),c=r(351),h=r(4772),d=r(4040),f=r(799),p=r(2431)({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(e){return"boolean"!=typeof e||e}e.exports={createScene:function(e){(e=e||{}).camera=e.camera||{};var t=e.canvas;t||((t=document.createElement("canvas"),e.container)?e.container.appendChild(t):document.body.appendChild(t));var r=e.gl;if(r||(e.glOptions&&(p=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch{return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:p})),!r)throw Error("webgl not supported");var y=e.bounds||[[-10,-10,-10],[10,10,10]],v=new m,x=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!p}),b=f(r),_=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,w={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||"turntable",_ortho:_},T=e.axes||{},A=n(r,T);A.enable=!T.disable;var M=e.spikes||{},k=o(r,M),S=[],E=[],D=[],C=[],I=!0,L=!0,P={view:null,projection:Array(16),model:Array(16),_ortho:!1},L=!0,z=[r.drawingBufferWidth,r.drawingBufferHeight],F=e.cameraObject||i(t,w),O={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:v,camera:F,axes:A,axesPixels:null,spikes:k,bounds:y,objects:S,shape:z,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:g(e.autoResize),autoBounds:g(e.autoBounds),autoScale:!!e.autoScale,autoCenter:g(e.autoCenter),clipToBounds:g(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:P,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,L=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},R=[r.drawingBufferWidth/O.pixelRatio|0,r.drawingBufferHeight/O.pixelRatio|0];function B(){if(!O._stopped&&O.autoResize){var e=t.parentNode,r=1,i=1;e&&e!==document.body?(r=e.clientWidth,i=e.clientHeight):(r=window.innerWidth,i=window.innerHeight);var n=0|Math.ceil(r*O.pixelRatio),a=0|Math.ceil(i*O.pixelRatio);if(n!==t.width||a!==t.height){t.width=n,t.height=a;var o=t.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=i+"px",I=!0}}}function j(){for(var e=S.length,t=C.length,i=0;i0&&0===D[t-1];)D.pop(),C.pop().dispose()}function N(){if(O.contextLost)return!0;r.isContextLost()&&(O.contextLost=!0,O.mouseListener.enabled=!1,O.selection.object=null,O.oncontextloss&&O.oncontextloss())}O.autoResize&&B(),window.addEventListener("resize",B),O.update=function(e){O._stopped||(e=e||{},I=!0,L=!0)},O.add=function(e){O._stopped||(e.axes=A,S.push(e),E.push(-1),I=!0,L=!0,j())},O.remove=function(e){if(!O._stopped){var t=S.indexOf(e);t<0||(S.splice(t,1),E.pop(),I=!0,L=!0,j())}},O.dispose=function(){if(!O._stopped&&(O._stopped=!0,window.removeEventListener("resize",B),t.removeEventListener("webglcontextlost",N),O.mouseListener.enabled=!1,!O.contextLost)){A.dispose(),k.dispose();for(var e=0;ev.distance)continue;for(var u=0;u0){var r=Math.round(Math.pow(10,t));return Math.ceil(e/r)*r}return Math.ceil(e)}((m[1][o]-m[0][o])/10);A.autoTicks?A.update({bounds:m,tickSpacing:w}):A.update({bounds:m})}var T=r.drawingBufferWidth,M=r.drawingBufferHeight;z[0]=T,z[1]=M,R[0]=0|Math.max(T/O.pixelRatio,1),R[1]=0|Math.max(M/O.pixelRatio,1),function(e,t){var r=e.bounds,i=e.cameraParams,n=i.projection,a=i.model,o=e.gl.drawingBufferWidth,s=e.gl.drawingBufferHeight,l=e.zNear,u=e.zFar,c=e.fovy,f=o/s;t?(d(n,-f,f,-1,1,l,u),i._ortho=!0):(h(n,c,f,l,u),i._ortho=!1);for(var p=0;p<16;++p)a[p]=0;a[15]=1;for(var m=0,p=0;p<3;++p)m=Math.max(m,r[1][p]-r[0][p]);for(var p=0;p<3;++p)e.autoScale?a[5*p]=e.aspect[p]/(r[1][p]-r[0][p]):a[5*p]=1/m,e.autoCenter&&(a[12+p]=-(.5*a[5*p])*(r[0][p]+r[1][p]))}(O,_);for(var o=0;o1e-6?(o=Math.sin(n=Math.acos(a)),s=Math.sin((1-i)*n)/o,l=Math.sin(i*n)/o):(s=1-i,l=i),e[0]=s*u+l*f,e[1]=s*c+l*p,e[2]=s*h+l*m,e[3]=s*d+l*g,e}},5964(e){e.exports=function(e){return e||0===e?e.toString():""}},9366(e,t,r){var i=r(4359);e.exports=function(e,t,r){var a=[t.style,t.weight,t.variant,t.family].join("_"),o=n[a];if(o||(o=n[a]={}),e in o)return o[e];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:t.family,fontStyle:t.style,fontWeight:t.weight,fontVariant:t.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};s.triangles=!0;var l=i(e,s);s.triangles=!1;var u,c,h=i(e,s);if(r&&1!==r){for(u=0;u max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform vec4 highlightId; +uniform float highlightScale; +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = 1.0; + if(distance(highlightId, id) < 0.0001) { + scale = highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1); + vec4 viewPosition = view * worldPosition; + viewPosition = viewPosition / viewPosition.w; + vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0)); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),o=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float highlightScale, pixelRatio; +uniform vec4 highlightId; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float scale = pixelRatio; + if(distance(highlightId.bgr, id.bgr) < 0.001) { + scale *= highlightScale; + } + + vec4 worldPosition = model * vec4(position, 1.0); + vec4 viewPosition = view * worldPosition; + vec4 clipPosition = projection * viewPosition; + clipPosition /= clipPosition.w; + + gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0); + interpColor = color; + pickId = id; + dataCoordinate = position; + } +}`]),s=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 glyph; +attribute vec4 id; + +uniform float highlightScale; +uniform vec4 highlightId; +uniform vec3 axes[2]; +uniform mat4 model, view, projection; +uniform vec2 screenSize; +uniform vec3 clipBounds[2]; +uniform float scale, pixelRatio; + +varying vec4 interpColor; +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0,0,0,0); + } else { + float lscale = pixelRatio * scale; + if(distance(highlightId, id) < 0.0001) { + lscale *= highlightScale; + } + + vec4 clipCenter = projection * (view * (model * vec4(position, 1))); + vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y; + vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1))); + + gl_Position = clipPosition; + interpColor = color; + pickId = id; + dataCoordinate = dataPosition; + } +} +`]),l=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float opacity; + +varying vec4 interpColor; +varying vec3 dataCoordinate; + +void main() { + if ( + outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) || + interpColor.a * opacity == 0. + ) discard; + gl_FragColor = interpColor * opacity; +} +`]),u=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 fragClipBounds[2]; +uniform float pickGroup; + +varying vec4 pickId; +varying vec3 dataCoordinate; + +void main() { + if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard; + + gl_FragColor = vec4(pickGroup, pickId.bgr); +}`]),c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:c},d={vertex:o,fragment:l,attributes:c},f={vertex:s,fragment:l,attributes:c},p={vertex:a,fragment:u,attributes:c},m={vertex:o,fragment:u,attributes:c},g={vertex:s,fragment:u,attributes:c};function y(e,t){var r=i(e,t),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}t.createPerspective=function(e){return y(e,h)},t.createOrtho=function(e){return y(e,d)},t.createProject=function(e){return y(e,f)},t.createPickPerspective=function(e){return y(e,p)},t.createPickOrtho=function(e){return y(e,m)},t.createPickProject=function(e){return y(e,g)}},8418(e,t,r){var i=r(5219),n=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),u=r(9366),c=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],d=ArrayBuffer,f=DataView;function p(e){return Array.isArray(e)||d.isView(e)&&!(e instanceof f)}function m(e,t){var r=e[0],i=e[1],n=e[2],a=e[3];return e[0]=t[0]*r+t[4]*i+t[8]*n+t[12]*a,e[1]=t[1]*r+t[5]*i+t[9]*n+t[13]*a,e[2]=t[2]*r+t[6]*i+t[10]*n+t[14]*a,e[3]=t[3]*r+t[7]*i+t[11]*n+t[15]*a,e}function g(e,t,r,i){return m(i,i),m(i,i),m(i,i)}function y(e,t){this.index=e,this.dataCoordinate=this.position=t}function v(e){return!0===e||e>1?1:e}function x(e,t,r,i,n,a,o,s,l,u,c,h){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=i,this.pointBuffer=n,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=u,this.pickOrthoShader=c,this.pickProjectShader=h,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(e){var t=e.gl,r=l.createPerspective(t),i=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),u=l.createPickOrtho(t),c=l.createPickProject(t),h=n(t),d=n(t),f=n(t),p=n(t),m=a(t,[{buffer:h,size:3,type:t.FLOAT},{buffer:d,size:4,type:t.FLOAT},{buffer:f,size:2,type:t.FLOAT},{buffer:p,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),g=new x(t,r,i,o,h,d,f,p,m,s,u,c);return g.update(e),g};var b=x.prototype;b.pickSlots=1,b.setPickBase=function(e){this.pickId=e},b.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},b.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var _=[0,0],w=[0,0,0],T=[0,0,0],A=[0,0,0,1],M=[0,0,0,1],k=h.slice(),S=[0,0,0],E=[[0,0,0],[0,0,0]];function D(e){return e[0]=e[1]=e[2]=0,e}function C(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function I(e,t,r,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=i,e}var L=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function P(e,t,r,i,n,a,o){var l=r.gl;if((a===r.projectHasAlpha||o)&&function(e,t,r,i){var n,a=t.axesProject,o=t.gl,l=e.uniforms,u=r.model||h,c=r.view||h,d=r.projection||h,f=t.axesBounds,p=function(e){for(var t=0;t<2;++t)for(var r=0;r<3;++r)E[t][r]=Math.max(Math.min(e[t][r],1e8),-1e8);return E}(t.clipBounds);n=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],_[0]=2/o.drawingBufferWidth,_[1]=2/o.drawingBufferHeight,e.bind(),l.view=c,l.projection=d,l.screenSize=_,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=p,l.pickGroup=t.pickId/255,l.pixelRatio=i;for(var m=0;m<3;++m)if(a[m]){l.scale=t.projectScale[m],l.opacity=t.projectOpacity[m];for(var y=0;y<16;++y)k[y]=0;for(var y=0;y<4;++y)k[5*y]=1;k[5*m]=0,n[m]<0?k[12+m]=f[0][m]:k[12+m]=f[1][m],s(k,u,k),l.model=k;var v=(m+1)%3,x=(m+2)%3,b=D(w),L=D(T);b[v]=1,L[x]=1;var P=g(d,c,u,C(A,b)),z=g(d,c,u,C(M,L));if(Math.abs(P[1])>Math.abs(z[1])){var F=P;P=z,z=F,F=b,b=L,L=F;var O=v;v=x,x=O}P[0]<0&&(b[v]=-1),z[1]>0&&(L[x]=-1);for(var R=0,B=0,y=0;y<4;++y)R+=Math.pow(u[4*v+y],2),B+=Math.pow(u[4*x+y],2);b[v]/=Math.sqrt(R),L[x]/=Math.sqrt(B),l.axes[0]=b,l.axes[1]=L,l.fragClipBounds[0]=I(S,p[0],m,-1e8),l.fragClipBounds[1]=I(S,p[1],m,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*i),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}(t,r,i,n),a===r.hasAlpha||o){e.bind();var u=e.uniforms;u.model=i.model||h,u.view=i.view||h,u.projection=i.projection||h,_[0]=2/l.drawingBufferWidth,_[1]=2/l.drawingBufferHeight,u.screenSize=_,u.highlightId=r.highlightId,u.highlightScale=r.highlightScale,u.fragClipBounds=L,u.clipBounds=r.axes.bounds,u.opacity=r.opacity,u.pickGroup=r.pickId/255,u.pixelRatio=n,r.vao.bind(),r.vao.draw(l.TRIANGLES,r.vertexCount),r.lineWidth>0&&(l.lineWidth(r.lineWidth*n),r.vao.draw(l.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function z(e,t,r,n){var a=c(a=p(e)?t=this.pointCount||t<0)return null;var r=this.points[t],i=this._selectResult;i.index=t;for(var n=0;n<3;++n)i.position[n]=i.dataCoordinate[n]=r[n];return i},b.highlight=function(e){if(e){var t=e.index;this.highlightId=[(255&t)/255,(t>>8&255)/255,(t>>16&255)/255,0]}else this.highlightId=[1,1,1,1]},b.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(p(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(p(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){if(p(e.projectOpacity))this.projectOpacity=e.projectOpacity.slice();else{var r=+e.projectOpacity;this.projectOpacity=[r,r,r]}for(var i=0;i<3;++i)this.projectOpacity[i]=v(this.projectOpacity[i]),this.projectOpacity[i]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=v(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var n,a,s=e.position,l={family:e.font||"normal",style:e.fontStyle||"normal",weight:e.fontWeight||"normal",variant:e.fontVariant||"normal"},u=e.alignment||[0,0];if(2===u.length)n=u[0],a=u[1];else{n=[],a=[];for(var i=0;i0){var F=0,O=b,R=[0,0,0,1],B=[0,0,0,1],j=p(f)&&p(f[0]),N=p(y)&&p(y[0]);e:for(var i=0;i0?1-E[0][0]:Y<0?1+E[1][0]:1,W*=W>0?1-E[0][1]:W<0?1+E[1][1]:1;for(var Z=[Y,W],X=k.cells||[],K=k.positions||[],A=0;Athis.buffer.length){n.free(this.buffer);for(var i=this.buffer=n.mallocUint8(o(r*t*4)),a=0;ar)for(e=r;et)for(e=t;e=0){for(var T=0|w.type.charAt(w.type.length-1),A=Array(T),M=0;M=0;)k+=1;_[v]=k}var S=Array(r.length);function E(){d.program=o.program(f,d._vref,d._fref,b,_);for(var e=0;e=0){var f=h.charCodeAt(h.length-1)-48;if(f<2||f>4)throw new i("","Invalid data type for attribute "+c+": "+h);s(e,t,d[0],n,f,a,c)}else if(h.indexOf("mat")>=0){var f=h.charCodeAt(h.length-1)-48;if(f<2||f>4)throw new i("","Invalid data type for attribute "+c+": "+h);!function(e,t,r,i,n,a,o){for(var l=Array(n),u=Array(n),c=0;c4)throw new n("","Invalid data type");switch(y.charAt(0)){case"b":case"i":e["uniform"+g+"iv"](s[c],h);break;case"v":e["uniform"+g+"fv"](s[c],h);break;default:throw new n("","Unrecognized data type for vector "+name+": "+y)}}else if(0===y.indexOf("mat")&&4===y.length){if((g=y.charCodeAt(y.length-1)-48)<2||g>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+y);e["uniformMatrix"+g+"fv"](s[c],!1,h);break}else throw new n("","Unknown uniform data type for "+name+": "+y)}}}}}function u(e,t,i){if("object"==typeof i)Object.defineProperty(e,t,{get:a(c(i)),set:l(i),enumerable:!0,configurable:!1});else s[i]?Object.defineProperty(e,t,{get:function(e,t,r){return e.getUniform(t.program,r[i])},set:l(i),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){var r=e.charCodeAt(e.length-1)-48;if(r<2||r>4)throw new n("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r=e.charCodeAt(e.length-1)-48;if(r<2||r>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new n("","Unknown uniform data type for "+name+": "+e)}}(r[i].type)}function c(e){var t;if(Array.isArray(e)){t=Array(e.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u1)for(var l=0;l"u"?r(606):WeakMap),o=0;function s(e,t,r,i,n,a,o){this.id=e,this.src=t,this.type=r,this.shader=i,this.count=a,this.programs=[],this.cache=o}function l(e){this.gl=e,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0==--this.count){for(var e=this.cache,t=e.gl,r=this.programs,i=0,n=r.length;i 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, tubeScale; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * tubePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(tubePosition, 1.0); + vec4 t_position = view * tubePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = tubePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),a=i([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),o=i([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float tubeScale; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + gl_Position = projection * (view * tubePosition); + f_id = id; + f_position = position.xyz; +} +`]),s=i([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);t.meshShader={vertex:n,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815(e,t,r){var i=r(2931),n=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t,r,a){for(var o=e.points,s=e.velocities,l=e.divergences,u=[],c=[],h=[],d=[],f=[],p=[],m=0,g=0,y=n.create(),v=n.create(),x=0;x0)for(var T=0;T<8;T++){var A=(T+1)%8;u.push(d[T],f[T],f[A],f[A],d[A],d[T]),h.push(v,y,y,y,v,v),p.push(m,g,g,g,m,m);var M=u.length;c.push([M-6,M-5,M-4],[M-3,M-2,M-1])}var k=d;d=f,f=k;var S=v;v=y,y=S;var E=m;m=g,g=E}return{positions:u,cells:c,vectors:h,vertexIntensity:p}},s=function(e,t,r,n){for(var a=0,s=0;st)return r-1}return r},u=function(e,t,r){return er?r:e},c=function(e,t,r){var n,a,o,s,c,h,d=t.vectors,f=t.meshgrid,p=e[0],m=e[1],g=e[2],y=f[0].length,v=f[1].length,x=f[2].length,b=l(f[0],p),_=l(f[1],m),w=l(f[2],g),T=b+1,A=_+1,M=w+1;if(b=u(b,0,y-1),T=u(T,0,y-1),_=u(_,0,v-1),A=u(A,0,v-1),w=u(w,0,x-1),M=u(M,0,x-1),b<0||_<0||w<0||T>y-1||A>v-1||M>x-1)return i.create();var k=f[0][b],S=f[0][T],E=f[1][_],D=f[1][A],C=f[2][w],I=f[2][M],L=(p-k)/(S-k),P=(m-E)/(D-E),z=(g-C)/(I-C);switch(isFinite(L)||(L=.5),isFinite(P)||(P=.5),isFinite(z)||(z=.5),r.reversedX&&(b=y-1-b,T=y-1-T),r.reversedY&&(_=v-1-_,A=v-1-A),r.reversedZ&&(w=x-1-w,M=x-1-M),r.filled){case 5:c=w,h=M,o=_*x,s=A*x,n=b*x*v,a=T*x*v;break;case 4:c=w,h=M,n=b*x,a=T*x,o=_*x*y,s=A*x*y;break;case 3:o=_,s=A,c=w*v,h=M*v,n=b*v*x,a=T*v*x;break;case 2:o=_,s=A,n=b*v,a=T*v,c=w*v*y,h=M*v*y;break;case 1:n=b,a=T,c=w*y,h=M*y,o=_*y*x,s=A*y*x;break;default:n=b,a=T,o=_*y,s=A*y,c=w*y*v,h=M*y*v}var F=d[n+o+c],O=d[n+o+h],R=d[n+s+c],B=d[n+s+h],j=d[a+o+c],N=d[a+o+h],V=d[a+s+c],U=d[a+s+h],q=i.create(),G=i.create(),H=i.create(),$=i.create();i.lerp(q,F,j,L),i.lerp(G,O,N,L),i.lerp(H,R,V,L),i.lerp($,B,U,L);var W=i.create(),Y=i.create();i.lerp(W,q,H,P),i.lerp(Y,G,$,P);var Z=i.create();return i.lerp(Z,W,Y,z),Z},h=function(e){var t=1/0;e.sort(function(e,t){return e-t});for(var r=e.length,i=1;i1&&(A=d(r));for(var S=0;SM&&(M=F),P.push(F),m.push({points:D,velocities:C,divergences:P});for(var O=0;O<100*n&&D.lengthx||rb||i_)}(E);){O++;var R=i.clone(I),B=i.squaredLength(R);if(0===B)break;if(B>T&&i.scale(R,R,w/Math.sqrt(B)),i.add(R,R,E),I=f(R),i.squaredDistance(L,R)-T>-1e-4*T){D.push(R),L=R,C.push(I);var z=p(R,I),F=i.length(z);isFinite(F)&&F>M&&(M=F),P.push(F)}E=R}}var j=s(m,e.colormap,M,A);return l?j.tubeScale=l:(0===M&&(M=1),j.tubeScale=.5*o*A/M),j};var f=r(6740),p=r(6405).createMesh;e.exports.createTubeMesh=function(e,t){return p(e,t,{shaders:f,traceType:"streamtube"})}},990(e,t,r){var i=r(9405),n=r(3236),a=n([`precision highp float; +#define GLSLIFY 1 + +attribute vec4 uv; +attribute vec3 f; +attribute vec3 normal; + +uniform vec3 objectOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 lightPosition, eyePosition; +uniform sampler2D colormap; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + vec3 localCoordinate = vec3(uv.zw, f.x); + worldCoordinate = objectOffset + localCoordinate; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0); + vec4 clipPosition = projection * (view * worldPosition); + gl_Position = clipPosition; + kill = f.y; + value = f.z; + planeCoordinate = uv.xy; + + vColor = texture2D(colormap, vec2(value, value)); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * worldPosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + lightDirection = lightPosition - cameraCoordinate.xyz; + eyeDirection = eyePosition - cameraCoordinate.xyz; + surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz); +} +`]),o=n([`precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float beckmannSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness) { + return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 lowerBound, upperBound; +uniform float contourTint; +uniform vec4 contourColor; +uniform sampler2D colormap; +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform float vertexColor; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + if ( + kill > 0.0 || + vColor.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) + ) discard; + + vec3 N = normalize(surfaceNormal); + vec3 V = normalize(eyeDirection); + vec3 L = normalize(lightDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = max(beckmannSpecular(L, V, N, roughness), 0.); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + //decide how to interpolate color — in vertex or in fragment + vec4 surfaceColor = + step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + + step(.5, vertexColor) * vColor; + + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; +} +`]),s=n([`precision highp float; +#define GLSLIFY 1 + +attribute vec4 uv; +attribute float f; + +uniform vec3 objectOffset; +uniform mat3 permutation; +uniform mat4 model, view, projection; +uniform float height, zOffset; +uniform sampler2D colormap; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 lightDirection, eyeDirection, surfaceNormal; +varying vec4 vColor; + +void main() { + vec3 dataCoordinate = permutation * vec3(uv.xy, height); + worldCoordinate = objectOffset + dataCoordinate; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); + + vec4 clipPosition = projection * (view * worldPosition); + clipPosition.z += zOffset; + + gl_Position = clipPosition; + value = f + objectOffset.z; + kill = -1.0; + planeCoordinate = uv.zw; + + vColor = texture2D(colormap, vec2(value, value)); + + //Don't do lighting for contours + surfaceNormal = vec3(1,0,0); + eyeDirection = vec3(0,1,0); + lightDirection = vec3(0,0,1); +} +`]),l=n([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec2 shape; +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying float value, kill; +varying vec3 worldCoordinate; +varying vec2 planeCoordinate; +varying vec3 surfaceNormal; + +vec2 splitFloat(float v) { + float vh = 255.0 * v; + float upper = floor(vh); + float lower = fract(vh); + return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); +} + +void main() { + if ((kill > 0.0) || + (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; + + vec2 ux = splitFloat(planeCoordinate.x / shape.x); + vec2 uy = splitFloat(planeCoordinate.y / shape.y); + gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); +} +`]);t.createShader=function(e){var t=i(e,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createPickShader=function(e){var t=i(e,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createContourShader=function(e){var t=i(e,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},t.createPickContourShader=function(e){var t=i(e,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},9499(e,t,r){e.exports=function(e){var t=e.gl,r=v(t),i=b(t),s=x(t),l=_(t),u=n(t),c=a(t,[{buffer:u,size:4,stride:40,offset:0},{buffer:u,size:3,stride:40,offset:16},{buffer:u,size:3,stride:40,offset:28}]),h=n(t),d=a(t,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),f=n(t),p=a(t,[{buffer:f,size:2,type:t.FLOAT}]),m=o(t,1,256,t.RGBA,t.UNSIGNED_BYTE);m.minFilter=t.LINEAR,m.magFilter=t.LINEAR;var g=new C(t,[0,0],[[0,0,0],[0,0,0]],r,i,u,c,m,s,l,h,d,f,p,[0,0,0]),y={levels:[[],[],[]]};for(var w in e)y[w]=e[w];return y.colormap=y.colormap||"jet",g.update(y),g};for(var i=r(8828),n=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),u=r(5298),c=r(9994),h=r(9618),d=r(3711),f=r(6760),p=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,b=y.createPickShader,_=y.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],A=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],M=0;M<3;++M){var k=A[M],S=(M+1)%3,E=(M+2)%3;k[S+0]=1,k[E+3]=1,k[M+6]=1}function D(e,t,r,i,n){this.position=e,this.index=t,this.uv=r,this.level=i,this.dataCoordinate=n}function C(e,t,r,i,n,a,o,l,u,c,d,f,p,m,g){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=i,this._pickShader=n,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=d,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new D([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[0/0,0/0,0/0],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var I=C.prototype;I.genColormap=function(e,t){var r=!1,i=c([l({colormap:e,nshades:256,format:"rgba"}).map(function(e,i){var n=t?function(e,t){if(!t||!t.length)return 1;for(var r=0;re&&r>0){var i=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-i)+i*t[r-1][1]}}return 1}(i/255,t):e[3];return n<1&&(r=!0),[e[0],e[1],e[2],255*n]})]);return u.divseq(i,255),this.hasAlphaScale=r,i},I.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},I.isOpaque=function(){return!this.isTransparent()},I.pickSlots=1,I.setPickBase=function(e){this.pickId=e};var L=[0,0,0],P={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function z(e,t){var r,i,n,a=t.axes&&t.axes.lastCubeProps.axis||L,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],i=0;i<3;++i)s=s||t.contourProject[r][i];for(r=0;r<3;++r){var l=P.projections[r];for(i=0;i<16;++i)l[i]=0;for(i=0;i<4;++i)l[5*i]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(a[r]>0)][r],f(l,e.model,l);var u=P.clipBounds[r];for(n=0;n<2;++n)for(i=0;i<3;++i)u[n][i]=e.clipBounds[n][i];u[0][r]=-1e8,u[1][r]=1e8}return P.showSurface=o,P.showContour=s,P}var F={model:w,view:w,projection:w,inverseModel:w.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=w.slice(),R=[1,0,0,0,1,0,0,0,1];function B(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0),F.model=e.model||w,F.view=e.view||w,F.projection=e.projection||w,F.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],F.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],F.objectOffset=this.objectOffset,F.contourColor=this.contourColor[0],F.inverseModel=p(F.inverseModel,F.model);for(var i=0;i<2;++i)for(var n=F.clipBounds[i],a=0;a<3;++a)n[a]=Math.min(Math.max(this.clipBounds[i][a],-1e8),1e8);for(F.kambient=this.ambientLight,F.kdiffuse=this.diffuseLight,F.kspecular=this.specularLight,F.roughness=this.roughness,F.fresnel=this.fresnel,F.opacity=this.opacity,F.height=0,F.permutation=R,F.vertexColor=this.vertexColor,f(O,F.view,F.model),f(O,F.projection,O),p(O,O),i=0;i<3;++i)F.eyePosition[i]=O[12+i]/O[15];var o=O[15];for(i=0;i<3;++i)o+=this.lightPosition[i]*O[4*i+3];for(i=0;i<3;++i){var s=O[12+i];for(a=0;a<3;++a)s+=O[4*a+i]*this.lightPosition[a];F.lightPosition[i]=s/o}var l=z(F,this);if(l.showSurface){for(this._shader.bind(),this._shader.uniforms=F,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=l.projections[i],this._shader.uniforms.clipBounds=l.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(l.showContour){var u=this._contourShader;F.kambient=1,F.kdiffuse=0,F.kspecular=0,F.opacity=1,u.bind(),u.uniforms=F;var c=this._contourVAO;for(c.bind(),i=0;i<3;++i)for(u.uniforms.permutation=A[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),a=0;a>4)/16)/255,n=Math.floor(i),a=i-n,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;n+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,d=0;d<2;++d)for(var f=d?l:1-l,p=n+c,g=s+d,y=h*f,v=0;v<3;++v)u[v]+=this._field[v].get(p,g)*y;for(var x=this._pickResult.level,b=0;b<3;++b)if(x[b]=m.le(this.contourLevels[b],u[b]),x[b]<0)this.contourLevels[b].length>0&&(x[b]=0);else if(x[b]Math.abs(w-u[b])&&(x[b]+=1)}for(r.index[0]=a<.5?n:n+1,r.index[1]=l<.5?s:s+1,r.uv[0]=i/t[0],r.uv[1]=o/t[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},I.padField=function(e,t){var r=t.shape.slice(),i=e.shape.slice();u.assign(e.lo(1,1).hi(r[0],r[1]),t),u.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),u.assign(e.lo(1,i[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),u.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),u.assign(e.lo(i[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,i[1]-1,t.get(0,r[1]-1)),e.set(i[0]-1,0,t.get(r[0]-1,0)),e.set(i[0]-1,i[1]-1,t.get(r[0]-1,r[1]-1))},I.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=N(e.contourWidth,Number)),"showContour"in e&&(this.showContour=N(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=N(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=U(e.contourColor)),"contourProject"in e&&(this.contourProject=N(e.contourProject,function(e){return N(e,Boolean)})),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=U(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=N(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=N(e.dynamicWidth,Number)),"opacity"in e&&(this.opacity=e.opacity),"opacityscale"in e&&(this.opacityscale=e.opacityscale),"colorBounds"in e&&(this.colorBounds=e.colorBounds),"vertexColor"in e&&(this.vertexColor=+!!e.vertexColor),"colormap"in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,r=!1;if(t||(t=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in e||"coords"in e){var n=(t.shape[0]+2)*(t.shape[1]+2);n>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(i.nextPow2(n))),this._field[2]=h(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=l[o];for(y=0;y<2;++y)if(u.shape[y]!==a[y])throw Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],u)}}else if(e.ticks){var c=e.ticks;if(!Array.isArray(c)||2!==c.length)throw Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var f=c[o];if((Array.isArray(f)||f.length)&&(f=h(f)),f.shape[0]!==a[o])throw Error("gl-surface: invalid tick length");var p=h(f.data,a);p.stride[o]=f.stride[0],p.stride[1^o]=0,this.padField(this._field[o],p)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var ex=0;ex<5;++ex)J.pop();j-=1}continue e}J.push(ei[0],ei[1],eo[0],eo[1],ei[2]),j+=1}}er.push(j)}this._contourOffsets[Q]=et,this._contourCounts[Q]=er}var eb=s.mallocFloat(J.length);for(o=0;os||o[1]<0||o[1]>s)throw Error("gl-texture2d: Invalid texture size");var l=p(o,t.stride.slice()),u=0;"float32"===r?u=e.FLOAT:"float64"===r?(u=e.FLOAT,l=!1,r="float32"):"uint8"===r?u=e.UNSIGNED_BYTE:(u=e.UNSIGNED_BYTE,l=!1,r="uint8");var h=0;if(2===o.length)h=e.LUMINANCE,o=[o[0],o[1],1],t=i(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else if(3===o.length)if(1===o[2])h=e.ALPHA;else if(2===o[2])h=e.LUMINANCE_ALPHA;else if(3===o[2])h=e.RGB;else if(4===o[2])h=e.RGBA;else throw Error("gl-texture2d: Invalid shape for pixel coords");else throw Error("gl-texture2d: Invalid shape for texture");u!==e.FLOAT||e.getExtension("OES_texture_float")||(u=e.UNSIGNED_BYTE,l=!1);var f,g,y=t.size;if(l)f=0===t.offset&&t.data.length===y?t.data:t.data.subarray(t.offset,t.offset+y);else{var v=[o[2],o[2]*o[0],1],x=i(g=a.malloc(y,r),o,v,0);("float32"===r||"float64"===r)&&u===e.UNSIGNED_BYTE?c(x,t):n.assign(x,t),f=g.subarray(0,y)}var b=m(e);return e.texImage2D(e.TEXTURE_2D,0,h,o[0],o[1],0,h,u,f),l||a.free(g),new d(e,b,o[0],o[1],h,u)}(e,v)}throw Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function u(e){return"u">typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"u">typeof HTMLImageElement&&e instanceof HTMLImageElement||"u">typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"u">typeof ImageData&&e instanceof ImageData}var c=function(e,t){n.muls(e,t,255)};function h(e,t,r){var i=e.gl,n=i.getParameter(i.MAX_TEXTURE_SIZE);if(t<0||t>n||r<0||r>n)throw Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),i.texImage2D(i.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function d(e,t,r,i,n,a){this.gl=e,this.handle=t,this.format=n,this.type=a,this._shape=[r,i],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=l}var f=d.prototype;function p(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function m(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function g(e,t,r,i,n){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw Error("gl-texture2d: Invalid texture shape");if(n===e.FLOAT&&!e.getExtension("OES_texture_float"))throw Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(e);return e.texImage2D(e.TEXTURE_2D,0,i,t,r,0,i,n,null),new d(e,o,t,r,i,n)}Object.defineProperties(f,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),0>s.indexOf(e))throw Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),0>s.indexOf(e))throw Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=0|Math.max(e,1),t!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),0>l.indexOf(e))throw Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),0>l.indexOf(e))throw Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),2!==e.length)throw Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(0>l.indexOf(e[t]))throw Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return h(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return h(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,h(this,this._shape[0],e),e}}}),f.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},f.dispose=function(){this.gl.deleteTexture(this.handle)},f.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)0>this._mipLevels.indexOf(t)&&this._mipLevels.push(t)},f.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=u(e)?e:e.raw;if(l)0>this._mipLevels.indexOf(o)?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else if(e.shape&&e.stride&&e.data){if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,u,h){var d=h.dtype,f=h.shape.slice();if(f.length<2||f.length>3)throw Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=p(f,h.stride.slice());"float32"===d?m=e.FLOAT:"float64"===d?(m=e.FLOAT,y=!1,d="float32"):"uint8"===d?m=e.UNSIGNED_BYTE:(m=e.UNSIGNED_BYTE,y=!1,d="uint8");if(2===f.length)g=e.LUMINANCE,f=[f[0],f[1],1],h=i(h.data,f,[h.stride[0],h.stride[1],1],h.offset);else if(3===f.length){if(1===f[2])g=e.ALPHA;else if(2===f[2])g=e.LUMINANCE_ALPHA;else if(3===f[2])g=e.RGB;else if(4===f[2])g=e.RGBA;else throw Error("gl-texture2d: Invalid shape for pixel coords");f[2]}else throw Error("gl-texture2d: Invalid shape for texture");if((g===e.LUMINANCE||g===e.ALPHA)&&(s===e.LUMINANCE||s===e.ALPHA)&&(g=s),g!==s)throw Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=0>u.indexOf(o);if(x&&u.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,h.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,h.data):x?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var b=l===e.FLOAT?a.mallocFloat32(v):a.mallocUint8(v),_=i(b,f,[f[2],f[2]*f[0],1]);m===e.FLOAT&&l===e.UNSIGNED_BYTE?c(_,h):n.assign(_,h),x?e.texImage2D(e.TEXTURE_2D,o,s,f[0],f[1],0,s,l,b.subarray(0,v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,f[0],f[1],s,l,b.subarray(0,v)),l===e.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}else throw Error("gl-texture2d: Unsupported data type")}},1433(e){e.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var i=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>i)throw Error("gl-vao: Too many vertex attributes");for(var n=0;n1?0:Math.acos(s)};var i=r(2825),n=r(3536),a=r(244)},9226(e){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},3126(e){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},3990(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},1091(e){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},5911(e){e.exports=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=n*l-a*s,e[1]=a*o-i*l,e[2]=i*s-n*o,e}},5455(e,t,r){e.exports=r(7056)},7056(e){e.exports=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+i*i+n*n)}},4008(e,t,r){e.exports=r(6690)},6690(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},244(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},2613(e){e.exports=1e-6},9922(e,t,r){e.exports=function(e,t){var r=e[0],n=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=i*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=i*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(a-l)<=i*Math.max(1,Math.abs(a),Math.abs(l))};var i=r(2613)},9265(e){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},2681(e){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},5137(e,t,r){e.exports=function(e,t,r,n,a,o){var s,l;for(t||(t=3),r||(r=0),l=n?Math.min(n*t+r,e.length):e.length,s=r;s0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}},7636(e){e.exports=function(e,t){var r=2*Math.random()*Math.PI,i=2*Math.random()-1,n=Math.sqrt(1-i*i)*(t=t||1);return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=i*t,e}},6894(e){e.exports=function(e,t,r,i){var n=r[1],a=r[2],o=t[1]-n,s=t[2]-a,l=Math.sin(i),u=Math.cos(i);return e[0]=t[0],e[1]=n+o*u-s*l,e[2]=a+o*l+s*u,e}},109(e){e.exports=function(e,t,r,i){var n=r[0],a=r[2],o=t[0]-n,s=t[2]-a,l=Math.sin(i),u=Math.cos(i);return e[0]=n+s*l+o*u,e[1]=t[1],e[2]=a+s*u-o*l,e}},8692(e){e.exports=function(e,t,r,i){var n=r[0],a=r[1],o=t[0]-n,s=t[1]-a,l=Math.sin(i),u=Math.cos(i);return e[0]=n+o*u-s*l,e[1]=a+o*l+s*u,e[2]=t[2],e}},2447(e){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},6621(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},8489(e){e.exports=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e}},1463(e){e.exports=function(e,t,r,i){return e[0]=t,e[1]=r,e[2]=i,e}},6141(e,t,r){e.exports=r(2953)},5486(e,t,r){e.exports=r(3066)},2953(e){e.exports=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2];return r*r+i*i+n*n}},3066(e){e.exports=function(e){var t=e[0],r=e[1],i=e[2];return t*t+r*r+i*i}},2229(e,t,r){e.exports=r(6843)},6843(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},492(e){e.exports=function(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e}},5673(e){e.exports=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[3]*i+r[7]*n+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/o,e[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/o,e[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/o,e}},264(e){e.exports=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2],u=r[3],c=s*a-l*n,h=l*i-o*a,d=o*n-s*i;return c*=2,h*=2,d*=2,e[0]=i+u*c+s*d-l*h,e[1]=n+u*h+l*c-o*d,e[2]=a+u*d+o*h-s*c,e}},4361(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},2335(e){e.exports=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},2933(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},7536(e){e.exports=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},4691(e){e.exports=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+i*i+n*n+a*a)}},1373(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},3750(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},3390(e){e.exports=function(e,t,r,i){var n=new Float32Array(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}},9970(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},6808(e){e.exports=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return Math.sqrt(t*t+r*r+i*i+n*n)}},2573(e){e.exports=function(e,t,r,i){var n=t[0],a=t[1],o=t[2],s=t[3];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=o+i*(r[2]-o),e[3]=s+i*(r[3]-s),e}},160(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},2334(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},3576(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},1498(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},5177(e){e.exports=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=r*r+i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=i*o,e[2]=n*o,e[3]=a*o),e}},9131(e,t,r){var i=r(5177),n=r(9288);e.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),i(e,e),n(e,e,t),e}},9288(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},4844(e){e.exports=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e}},4578(e){e.exports=function(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}},7960(e){e.exports=function(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return r*r+i*i+n*n+a*a}},483(e){e.exports=function(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}},6860(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},5352(e){e.exports=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,e}},4041(e){e.exports=function(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*i+s*a-l*n,h=u*n+l*i-o*a,d=u*a+o*n-s*i,f=-o*i-s*n-l*a;return e[0]=c*u+-(f*o)+-(h*l)- -(d*s),e[1]=h*u+-(f*s)+-(d*o)- -(c*l),e[2]=d*u+-(f*l)+-(c*s)- -(h*o),e[3]=t[3],e}},1848(e,t,r){var i=r(4905),n=r(6468);e.exports=function(e){for(var t=Array.isArray(e)?e:i(e),r=0;r0)continue;r=e.slice(0,1).join("")}return M(r),y+=r.length,(f=f.slice(r.length)).length}}};var i=r(620),n=r(7827),a=r(6852),o=r(7932),s=r(3508),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508(e,t,r){var i=r(6852);e.exports=(i=i.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)})).concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932(e,t,r){e.exports=r(620).slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905(e,t,r){var i=r(5874);e.exports=function(e,t){var r=i(t),n=[];return(n=n.concat(r(e))).concat(r(null))}},3236(e){e.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],i=0;i>1,c=-7,h=r?n-1:0,d=r?-1:1,f=e[t+h];for(h+=d,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+e[t+h],h+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=i;c>0;o=256*o+e[t+h],h+=d,c-=8);if(0===a)a=1-u;else{if(a===l)return o?0/0:(f?-1:1)*2e308;o+=Math.pow(2,i),a-=u}return(f?-1:1)*o*Math.pow(2,a-i)},t.write=function(e,t,r,i,n,a){var o,s,l,u=8*a-n-1,c=(1<>1,d=5960464477539062e-23*(23===n),f=i?0:a-1,p=i?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(s=+!!isNaN(t),o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?t+=d/l:t+=d*Math.pow(2,1-h),t*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(t*l-1)*Math.pow(2,n),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;e[r+f]=255&s,f+=p,s/=256,n-=8);for(o=o<0;e[r+f]=255&o,f+=p,o/=256,u-=8);e[r+f-p]|=128*m}},8954(e,t,r){e.exports=function(e,t){var r=e.length;if(0===r)throw Error("Must have at least d+1 points");var n=e[0].length;if(r<=n)throw Error("Must input at least d+1 points");var o=e.slice(0,n+1),s=i.apply(void 0,o);if(0===s)throw Error("Input not in general position");for(var l=Array(n+1),c=0;c<=n;++c)l[c]=c;s<0&&(l[0]=1,l[1]=0);for(var h=new a(l,Array(n+1),!1),d=h.adjacent,f=Array(n+2),c=0;c<=n;++c){for(var p=l.slice(),m=0;m<=n;++m)m===c&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var y=new a(p,Array(n+1),!0);d[c]=y,f[c]=y}f[n+1]=h;for(var c=0;c<=n;++c)for(var p=d[c].vertices,v=d[c].adjacent,m=0;m<=n;++m){var x=p[m];if(x<0){v[m]=h;continue}for(var b=0;b<=n;++b)0>d[b].vertices.indexOf(x)&&(v[m]=d[b])}for(var _=new u(n,o,f),w=!!t,c=n+1;c0;){e=o.pop();for(var s=e.adjacent,l=0;l<=r;++l){var u=s[l];if(!(!u.boundary||u.lastVisited<=-i)){for(var c=u.vertices,h=0;h<=r;++h){var d=c[h];d<0?n[h]=t:n[h]=a[d]}var f=this.orient();if(f>0)return u;u.lastVisited=-i,0===f&&o.push(u)}}}return null},c.walk=function(e,t){var r=this.vertices.length-1,i=this.dimension,n=this.vertices,a=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=i;++c)a[c]=n[l[c]];s.lastVisited=r;for(var c=0;c<=i;++c){var h=u[c];if(!(h.lastVisited>=r)){var d=a[c];a[c]=e;var f=this.orient();if(a[c]=d,f<0){s=h;continue e}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},c.addPeaks=function(e,t){var r=this.vertices.length-1,i=this.dimension,n=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,u.push(t);for(var d=[];h.length>0;){var t=h.pop(),f=t.vertices,p=t.adjacent,m=f.indexOf(r);if(!(m<0)){for(var g=0;g<=i;++g)if(g!==m){var y=p[g];if(!(!y.boundary||y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,b=0;b<=i;++b)v[b]<0?(x=b,l[b]=e):l[b]=n[v[b]];if(this.orient()>0){v[x]=r,y.boundary=!1,u.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var _=y.adjacent,w=f.slice(),T=p.slice(),A=new a(w,T,!0);c.push(A);var M=_.indexOf(t);if(!(M<0)){_[M]=A,T[m]=y,w[g]=-1,T[g]=t,p[g]=A,A.flip();for(var b=0;b<=i;++b){var k=w[b];if(!(k<0||k===r)){for(var S=Array(i-1),E=0,D=0;D<=i;++D){var C=w[D];C<0||D===b||(S[E++]=C)}d.push(new o(S,A,b))}}}}}}}d.sort(s);for(var g=0;g+1=0?o[l++]=s[c]:u=1&c;if(u===(1&e)){var h=o[0];o[0]=o[1],o[1]=h}t.push(o)}}return t}},3352(e,t,r){var i=r(2478);function n(e,t,r,i,n){this.mid=e,this.left=t,this.right=r,this.leftPoints=i,this.rightPoints=n,this.count=(t?t.count:0)+(r?r.count:0)+i.length}e.exports=function(e){return new y(e&&0!==e.length?g(e):null)};var a=n.prototype;function o(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function s(e,t){var r=g(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function u(e,t){var r=e.intervals([]),i=r.indexOf(t);return i<0?0:(r.splice(i,1),s(e,r),1)}function c(e,t,r){for(var i=0;i=0&&e[i][1]>=t;--i){var n=r(e[i]);if(n)return n}}function d(e,t){for(var r=0;r>1],a=[],o=[],s=[],r=0;r3*(t+1)?l(this,e):this.left.insert(e):this.left=g([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=g([e]);else{var r=i.ge(this.leftPoints,e,p),n=i.ge(this.rightPoints,e,m);this.leftPoints.splice(r,0,e),this.rightPoints.splice(n,0,e)}},a.remove=function(e){var t=this.count-this.leftPoints;if(e[1]3*(t-1))return u(this,e);var r=this.left.remove(e);return 2===r?(this.left=null,this.count-=1,1):(1===r&&(this.count-=1),r)}if(e[0]>this.mid){if(!this.right)return 0;if(4*(this.left?this.left.count:0)>3*(t-1))return u(this,e);var r=this.right.remove(e);return 2===r?(this.right=null,this.count-=1,1):(1===r&&(this.count-=1),r)}if(1===this.count)return 2*(this.leftPoints[0]===e);if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var n=this,a=this.left;a.right;)n=a,a=a.right;if(n===this)a.right=this.right;else{var s=this.left,r=this.right;n.count-=a.count,n.right=a.left,a.left=s,a.right=r}o(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(var s=i.ge(this.leftPoints,e,p);sthis.mid))return d(this.leftPoints,t);if(this.right){var r=this.right.queryPoint(e,t);if(r)return r}return h(this.rightPoints,e,t)},a.queryInterval=function(e,t,r){if(ethis.mid&&this.right){var i=this.right.queryInterval(e,t,r);if(i)return i}return tthis.mid?h(this.rightPoints,e,r):d(this.leftPoints,r)};var v=y.prototype;v.insert=function(e){this.root?this.root.insert(e):this.root=new n(e[0],null,null,[e],[e])},v.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},v.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},v.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507(e){e.exports=!0},7163(e){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){var r;return null!=e&&(t(e)||"function"==typeof(r=e).readFloatLE&&"function"==typeof r.slice&&t(r.slice(0,0))||!!e._isBuffer)}},2431(e){e.exports=n,e.exports.isMobile=n,e.exports.default=n;let t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,i=/android|ipad|playbook|silk/i;function n(e){e||(e={});let n=e.ua;if(!n&&"u">typeof navigator&&(n=navigator.userAgent),n&&n.headers&&"string"==typeof n.headers["user-agent"]&&(n=n.headers["user-agent"]),"string"!=typeof n)return!1;let a=t.test(n)&&!r.test(n)||!!e.tablet&&i.test(n);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==n.indexOf("Macintosh")&&-1!==n.indexOf("Safari")&&(a=!0),a}},5219(e){e.exports=function(e){for(var t,r=e.length,i=0;i13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},395(e){e.exports=function(e,t,r){return e*(1-r)+t*r}},2652(e,t,r){var i=r(4335),n=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),u={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},c=n(),h=n(),d=[0,0,0,0],f=[[0,0,0],[0,0,0],[0,0,0]],p=[0,0,0];function m(e,t,r,i,n){e[0]=t[0]*i+r[0]*n,e[1]=t[1]*i+r[1]*n,e[2]=t[2]*i+r[2]*n}e.exports=function(e,t,r,n,g,y){if(t||(t=[0,0,0]),r||(r=[0,0,0]),n||(n=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!i(c,e)||(a(h,c),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(1e-8>o(h))))return!1;var v,x,b,_,w,T,A,M,k,S=c[3],E=c[7],D=c[11],C=c[12],I=c[13],L=c[14],P=c[15];if(0!==S||0!==E||0!==D){if(d[0]=S,d[1]=E,d[2]=D,d[3]=P,!s(h,h))return!1;l(h,h),v=g,x=d,b=h,_=x[0],w=x[1],T=x[2],A=x[3],v[0]=b[0]*_+b[4]*w+b[8]*T+b[12]*A,v[1]=b[1]*_+b[5]*w+b[9]*T+b[13]*A,v[2]=b[2]*_+b[6]*w+b[10]*T+b[14]*A,v[3]=b[3]*_+b[7]*w+b[11]*T+b[15]*A}else g[0]=g[1]=g[2]=0,g[3]=1;if(t[0]=C,t[1]=I,t[2]=L,M=f,k=c,M[0][0]=k[0],M[0][1]=k[1],M[0][2]=k[2],M[1][0]=k[4],M[1][1]=k[5],M[1][2]=k[6],M[2][0]=k[8],M[2][1]=k[9],M[2][2]=k[10],r[0]=u.length(f[0]),u.normalize(f[0],f[0]),n[0]=u.dot(f[0],f[1]),m(f[1],f[1],f[0],1,-n[0]),r[1]=u.length(f[1]),u.normalize(f[1],f[1]),n[0]/=r[1],n[1]=u.dot(f[0],f[2]),m(f[2],f[2],f[0],1,-n[1]),n[2]=u.dot(f[1],f[2]),m(f[2],f[2],f[1],1,-n[2]),r[2]=u.length(f[2]),u.normalize(f[2],f[2]),n[1]/=r[2],n[2]/=r[2],u.cross(p,f[1],f[2]),0>u.dot(f[0],p))for(var z=0;z<3;z++)r[z]*=-1,f[z][0]*=-1,f[z][1]*=-1,f[z][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+f[0][0]-f[1][1]-f[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-f[0][0]+f[1][1]-f[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-f[0][0]-f[1][1]+f[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+f[0][0]+f[1][1]+f[2][2],0)),f[2][1]>f[1][2]&&(y[0]=-y[0]),f[0][2]>f[2][0]&&(y[1]=-y[1]),f[1][0]>f[0][1]&&(y[2]=-y[2]),!0}},4335(e){e.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var i=1/r,n=0;n<16;n++)e[n]=t[n]*i;return!0}},7442(e,t,r){var i=r(6658),n=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),u=h(),c=h();function h(){return{translate:d(),scale:d(1),skew:d(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function d(e){return[e||0,e||0,e||0]}e.exports=function(e,t,r,h){if(0===o(t)||0===o(r))return!1;var d=a(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),f=a(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion);return!!d&&!!f&&(i(c.translate,l.translate,u.translate,h),i(c.skew,l.skew,u.skew,h),i(c.scale,l.scale,u.scale,h),i(c.perspective,l.perspective,u.perspective,h),s(c.quaternion,l.quaternion,u.quaternion,h),n(e,c.translate,c.scale,c.skew,c.perspective,c.quaternion),!0)}},7182(e,t,r){var i={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},n=(i.create(),i.create());e.exports=function(e,t,r,a,o,s){return i.identity(e),i.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],i.identity(n),0!==a[2]&&(n[9]=a[2],i.multiply(e,e,n)),0!==a[1]&&(n[9]=0,n[8]=a[1],i.multiply(e,e,n)),0!==a[0]&&(n[8]=0,n[4]=a[0],i.multiply(e,e,n)),i.scale(e,e,r),e}},1811(e,t,r){var i=r(2478),n=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),u=r(6582),c=r(7656),h=(r(2504),r(3536)),d=[0,0,0];function f(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(e){return new f((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=f.prototype;p.recalcMatrix=function(e){var t=this._time,r=i.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,u=0;u<16;++u)o[u]=s[l++];else{for(var c=t[r+1]-t[r],l=16*r,d=this.prevMatrix,f=!0,u=0;u<16;++u)d[u]=s[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=s[l++],f=f&&d[u]===p[u];if(c<1e-6||f)for(var u=0;u<16;++u)o[u]=d[u];else n(o,d,p,(e-t[r])/c)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;for(var x=this.computedCenter,b=Math.exp(this.computedRadius[0]),u=0;u<3;++u)x[u]=y[u]-o[2+4*u]*b}},p.idle=function(e){if(!(e1&&0>=i(e[o[c-2]],e[o[c-1]],u);)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(e[s[c-2]],e[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=Array(s.length+o.length-2),h=0,n=0,d=o.length;n0;--f)r[h++]=s[f];return r};var i=r(3250)[3]},351(e,t,r){e.exports=function(e,t){t||(t=e,e=window);var r=0,n=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function u(e,s){var u=i.x(s),c=i.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||u!==n||c!==a||l(s))&&(r=0|e,n=u||0,a=c||0,t&&t(r,n,a,o))}function c(e){u(0,e)}function h(){(r||n||a||o.shift||o.alt||o.meta||o.control)&&(n=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function d(e){l(e)&&t&&t(r,n,a,o)}function f(e){0===i.buttons(e)?u(0,e):u(r,e)}function p(e){u(r|i.buttons(e),e)}function m(e){u(r&~i.buttons(e),e)}function g(){s||(s=!0,e.addEventListener("mousemove",f),e.addEventListener("mousedown",p),e.addEventListener("mouseup",m),e.addEventListener("mouseleave",c),e.addEventListener("mouseenter",c),e.addEventListener("mouseout",c),e.addEventListener("mouseover",c),e.addEventListener("blur",h),e.addEventListener("keyup",d),e.addEventListener("keydown",d),e.addEventListener("keypress",d),e!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}g();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?g():s&&(s=!1,e.removeEventListener("mousemove",f),e.removeEventListener("mousedown",p),e.removeEventListener("mouseup",m),e.removeEventListener("mouseleave",c),e.removeEventListener("mouseenter",c),e.removeEventListener("mouseout",c),e.removeEventListener("mouseover",c),e.removeEventListener("blur",h),e.removeEventListener("keyup",d),e.removeEventListener("keydown",d),e.removeEventListener("keypress",d),e!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return n},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var i=r(4687)},24(e){var t={left:0,top:0};e.exports=function(e,r,i){r=r||e.currentTarget||e.srcElement,Array.isArray(i)||(i=[0,0]);var n,a=e.clientX||0,o=e.clientY||0,s=(n=r)===window||n===document||n===document.body?t:n.getBoundingClientRect();return i[0]=a-s.left,i[1]=o-s.top,i}},4687(e,t){function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"==typeof e){if("buttons"in e)return e.buttons;if("which"in e){var t=e.which;if(2===t)return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1<(e.scalarArguments||0)&&t("Scalar arg count must be > 0"),"function"!=typeof e.vertex&&t("Must specify vertex creation function"),"function"!=typeof e.cell&&t("Must specify cell creation function"),"function"!=typeof e.phase&&t("Must specify phase function");for(var u=e.getters||[],c=Array(l),h=0;h=0?c[h]=!0:c[h]=!1;return r=e.vertex,a=e.cell,o=e.phase,(0,n[[c,s].join(",")])(r,a,o,i.mallocUint32,i.freeUint32)};var n={"false,0,1":function(e,t,r,i,n){return function(a,o,s,l){var u,c=0|a.shape[0],h=0|a.shape[1],d=a.data,f=0|a.offset,p=0|a.stride[0],m=0|a.stride[1],g=f,y=0|-p,v=0,x=0|-m,b=0,_=-p-m|0,w=0,T=0|p,A=m-p*c|0,M=0,k=0,S=0,E=2*c|0,D=i(E),C=i(E),I=0,L=0,P=-1,z=-1,F=0,O=0|-c,R=0|c,B=0,j=-c-1|0,N=c-1|0,V=0,U=0,q=0;for(M=0;M0){if(k=1,D[I++]=r(d[g],o,s,l),g+=T,c>0)for(M=1,u=d[g],L=D[I]=r(u,o,s,l),F=D[I+P],B=D[I+O],V=D[I+j],(L!==F||L!==B||L!==V)&&(v=d[g+y],e(M,k,u,v,b=d[g+x],w=d[g+_],L,F,B,V,o,s,l),U=C[I]=S++),I+=1,g+=T,M=2;M0)for(M=1,u=d[g],L=D[I]=r(u,o,s,l),F=D[I+P],B=D[I+O],V=D[I+j],(L!==F||L!==B||L!==V)&&(v=d[g+y],e(M,k,u,v,b=d[g+x],w=d[g+_],L,F,B,V,o,s,l),U=C[I]=S++,V!==B&&t(C[I+O],U,b,w,B,V,o,s,l)),I+=1,g+=T,M=2;M0){if(M=1,D[I++]=r(d[g],o,s,l),g+=T,h>0)for(k=1,u=d[g],L=D[I]=r(u,o,s,l),B=D[I+O],F=D[I+P],V=D[I+j],(L!==B||L!==F||L!==V)&&(v=d[g+y],e(M,k,u,v,b=d[g+x],w=d[g+_],L,B,F,V,o,s,l),U=C[I]=S++),I+=1,g+=T,k=2;k0)for(k=1,u=d[g],L=D[I]=r(u,o,s,l),B=D[I+O],F=D[I+P],V=D[I+j],(L!==B||L!==F||L!==V)&&(v=d[g+y],e(M,k,u,v,b=d[g+x],w=d[g+_],L,B,F,V,o,s,l),U=C[I]=S++,V!==B&&t(C[I+O],U,w,v,V,B,o,s,l)),I+=1,g+=T,k=2;k2&&a[1]>2&&i(n.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(n.pick(0,-1).lo(1).hi(a[1]-2),e.pick(0,-1,1).lo(1).hi(a[1]-2)),t(e.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(n.pick(a[0]-1,-1).lo(1).hi(a[1]-2),e.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),t(e.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(n.pick(-1,0).lo(1).hi(a[0]-2),e.pick(-1,0,0).lo(1).hi(a[0]-2)),t(e.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(n.pick(-1,a[1]-1).lo(1).hi(a[0]-2),e.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),t(e.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(a[0]-1,0,0,0),e.set(a[0]-1,0,1,0),e.set(0,a[1]-1,0,0),e.set(0,a[1]-1,1,0),e.set(a[0]-1,a[1]-1,0,0),e.set(a[0]-1,a[1]-1,1,0),e}}e.exports=function(e,t,r){return(Array.isArray(r)||(r="string"==typeof r?i(t.dimension,r):i(t.dimension,"clamp")),0===t.size)?e:0===t.dimension?(e.set(0),e):(function(e){var t,r=e.join(),i=u[r];if(i)return i;for(var n=e.length,a=[c,h],o=1;o<=n;++o)a.push((t=o)in l?l[t]:l[t]=s({funcName:"fdTemplate"+t}));var i=d.apply(void 0,a);return u[r]=i,i})(r)(e,t)}},4317(e){function t(e,t){var r=Math.floor(t),i=t-r,n=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|e[1];b>0;){b<64?(u=b,b=0):(u=64,b-=64),i=y+x*h+b*d,o=v+x*p+b*m;var _=0,w=0,T=0,A=h-c*f,M=d-l*h,k=p-c*g,S=m-l*p;for(T=0;T0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|e[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),i=f+m*c+g*u,o=p+m*d+g*h;var y=0,v=0,x=u-l*c,b=h-l*d;for(v=0;v0;){v<64?(u=v,v=0):(u=64,v-=64);for(var x=0|e[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|e[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),i=g+v*d+x*c+b*h,o=y+v*m+x*f+b*p;var _=0,w=0,T=0,A=c-u*d,M=h-s*c,k=f-u*m,S=p-s*f;for(T=0;Tr;){for(y=0,v=m-o,g=0;gb)break;v+=h,y+=d}for(y=m,v=m-o,g=0;g>1,G=q-N,H=q+N,$=V,W=G,Y=q,Z=H,X=U,K=n+1,J=a-1,Q=!0,ee=0,et=0,er=0,ei=t(h),en=t(h);for(M=l*$,k=l*W,j=s,A=0;A0){g=$,$=W,W=g;break}if(er<0)break;j+=f}for(M=l*Z,k=l*X,j=s,A=0;A0){g=Z,Z=X,X=g;break}if(er<0)break;j+=f}for(M=l*$,k=l*Y,j=s,A=0;A0){g=$,$=Y,Y=g;break}if(er<0)break;j+=f}for(M=l*W,k=l*Y,j=s,A=0;A0){g=W,W=Y,Y=g;break}if(er<0)break;j+=f}for(M=l*$,k=l*Z,j=s,A=0;A0){g=$,$=Z,Z=g;break}if(er<0)break;j+=f}for(M=l*Y,k=l*Z,j=s,A=0;A0){g=Y,Y=Z,Z=g;break}if(er<0)break;j+=f}for(M=l*W,k=l*X,j=s,A=0;A0){g=W,W=X,X=g;break}if(er<0)break;j+=f}for(M=l*W,k=l*Y,j=s,A=0;A0){g=W,W=Y,Y=g;break}if(er<0)break;j+=f}for(M=l*Z,k=l*X,j=s,A=0;A0){g=Z,Z=X,X=g;break}if(er<0)break;j+=f}for(M=l*$,k=l*W,S=l*Y,E=l*Z,D=l*X,C=l*V,I=l*q,L=l*U,B=0,j=s,A=0;A0)J--;else if(er<0){for(M=l*b,k=l*K,S=l*J,j=s,A=0;A0)for(;;){for(_=s+J*l,B=0,A=0;A0){if(--JU){e:for(;;){for(_=s+K*l,B=0,j=s,A=0;A1&&l?u(h,l[0],l[1]):u(h));return c(h,d)}},446(e,t,r){var i=r(7640),n={};e.exports=function(e){var t=e.order,r=e.dtype,a=[t,r].join(":"),o=n[a];return o||(n[a]=o=i(t,r)),o(e),e}},9618(e,t,r){var i=r(7163),n="u">typeof Float64Array;function a(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=Array(t.length);for(e=0;e=0&&(t+=a*(r=0|e),n-=r),new i(this.data,n,a,t)},n.step=function(e){var t=this.shape[0],r=this.stride[0],n=this.offset,a=0,o=Math.ceil;return"number"==typeof e&&((a=0|e)<0?(n+=r*(t-1),t=o(-t/a)):t=o(t/a),r*=a),new i(this.data,t,r,n)},n.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new i(this.data,t[e],r[e],this.offset)},n.pick=function(e){var r=[],i=[],n=this.offset;return"number"==typeof e&&e>=0?n=n+this.stride[0]*e|0:(r.push(this.shape[0]),i.push(this.stride[0])),(0,t[r.length+1])(this.data,r,i,n)},function(e,t,r,n){return new i(e,t[0],r[0],n)}},2:function(e,t,r){function i(e,t,r,i,n,a){this.data=e,this.shape=[t,r],this.stride=[i,n],this.offset=0|a}var n=i.prototype;return n.dtype=e,n.dimension=2,Object.defineProperty(n,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(n,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),n.set=function(t,r,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=i},n.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},n.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},n.hi=function(e,t){return new i(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},n.lo=function(e,t){var r=this.offset,n=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof e&&e>=0&&(r+=s*(n=0|e),a-=n),"number"==typeof t&&t>=0&&(r+=l*(n=0|t),o-=n),new i(this.data,a,o,s,l,r)},n.step=function(e,t){var r=this.shape[0],n=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,u=Math.ceil;return"number"==typeof e&&((l=0|e)<0?(s+=a*(r-1),r=u(-r/l)):r=u(r/l),a*=l),"number"==typeof t&&((l=0|t)<0?(s+=o*(n-1),n=u(-n/l)):n=u(n/l),o*=l),new i(this.data,r,n,a,o,s)},n.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,n=this.stride;return new i(this.data,r[e],r[t],n[e],n[t],this.offset)},n.pick=function(e,r){var i=[],n=[],a=this.offset;return"number"==typeof e&&e>=0?a=a+this.stride[0]*e|0:(i.push(this.shape[0]),n.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(i.push(this.shape[1]),n.push(this.stride[1])),(0,t[i.length+1])(this.data,i,n,a)},function(e,t,r,n){return new i(e,t[0],t[1],r[0],r[1],n)}},3:function(e,t,r){function i(e,t,r,i,n,a,o,s){this.data=e,this.shape=[t,r,i],this.stride=[n,a,o],this.offset=0|s}var n=i.prototype;return n.dtype=e,n.dimension=3,Object.defineProperty(n,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(n,"order",{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),n.set=function(t,r,i,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i]=n},n.get=function(t,r,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i]},n.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},n.hi=function(e,t,r){return new i(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},n.lo=function(e,t,r){var n=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.stride[0],c=this.stride[1],h=this.stride[2];return"number"==typeof e&&e>=0&&(n+=u*(a=0|e),o-=a),"number"==typeof t&&t>=0&&(n+=c*(a=0|t),s-=a),"number"==typeof r&&r>=0&&(n+=h*(a=0|r),l-=a),new i(this.data,o,s,l,u,c,h,n)},n.step=function(e,t,r){var n=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],u=this.stride[2],c=this.offset,h=0,d=Math.ceil;return"number"==typeof e&&((h=0|e)<0?(c+=s*(n-1),n=d(-n/h)):n=d(n/h),s*=h),"number"==typeof t&&((h=0|t)<0?(c+=l*(a-1),a=d(-a/h)):a=d(a/h),l*=h),"number"==typeof r&&((h=0|r)<0?(c+=u*(o-1),o=d(-o/h)):o=d(o/h),u*=h),new i(this.data,n,a,o,s,l,u,c)},n.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var n=this.shape,a=this.stride;return new i(this.data,n[e],n[t],n[r],a[e],a[t],a[r],this.offset)},n.pick=function(e,r,i){var n=[],a=[],o=this.offset;return"number"==typeof e&&e>=0?o=o+this.stride[0]*e|0:(n.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(n.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof i&&i>=0?o=o+this.stride[2]*i|0:(n.push(this.shape[2]),a.push(this.stride[2])),(0,t[n.length+1])(this.data,n,a,o)},function(e,t,r,n){return new i(e,t[0],t[1],t[2],r[0],r[1],r[2],n)}},4:function(e,t,r){function i(e,t,r,i,n,a,o,s,l,u){this.data=e,this.shape=[t,r,i,n],this.stride=[a,o,s,l],this.offset=0|u}var n=i.prototype;return n.dtype=e,n.dimension=4,Object.defineProperty(n,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(n,"order",{get:r}),n.set=function(t,r,i,n,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n]=a},n.get=function(t,r,i,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n]},n.index=function(e,t,r,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*i},n.hi=function(e,t,r,n){return new i(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof n||n<0?this.shape[3]:0|n,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},n.lo=function(e,t,r,n){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],h=this.stride[0],d=this.stride[1],f=this.stride[2],p=this.stride[3];return"number"==typeof e&&e>=0&&(a+=h*(o=0|e),s-=o),"number"==typeof t&&t>=0&&(a+=d*(o=0|t),l-=o),"number"==typeof r&&r>=0&&(a+=f*(o=0|r),u-=o),"number"==typeof n&&n>=0&&(a+=p*(o=0|n),c-=o),new i(this.data,s,l,u,c,h,d,f,p,a)},n.step=function(e,t,r,n){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],u=this.stride[0],c=this.stride[1],h=this.stride[2],d=this.stride[3],f=this.offset,p=0,m=Math.ceil;return"number"==typeof e&&((p=0|e)<0?(f+=u*(a-1),a=m(-a/p)):a=m(a/p),u*=p),"number"==typeof t&&((p=0|t)<0?(f+=c*(o-1),o=m(-o/p)):o=m(o/p),c*=p),"number"==typeof r&&((p=0|r)<0?(f+=h*(s-1),s=m(-s/p)):s=m(s/p),h*=p),"number"==typeof n&&((p=0|n)<0?(f+=d*(l-1),l=m(-l/p)):l=m(l/p),d*=p),new i(this.data,a,o,s,l,u,c,h,d,f)},n.transpose=function(e,t,r,n){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,n=void 0===n?3:0|n;var a=this.shape,o=this.stride;return new i(this.data,a[e],a[t],a[r],a[n],o[e],o[t],o[r],o[n],this.offset)},n.pick=function(e,r,i,n){var a=[],o=[],s=this.offset;return"number"==typeof e&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof i&&i>=0?s=s+this.stride[2]*i|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"==typeof n&&n>=0?s=s+this.stride[3]*n|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,t[a.length+1])(this.data,a,o,s)},function(e,t,r,n){return new i(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],n)}},5:function(e,t,r){function i(e,t,r,i,n,a,o,s,l,u,c,h){this.data=e,this.shape=[t,r,i,n,a],this.stride=[o,s,l,u,c],this.offset=0|h}var n=i.prototype;return n.dtype=e,n.dimension=5,Object.defineProperty(n,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(n,"order",{get:r}),n.set=function(t,r,i,n,a,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n+this.stride[4]*a]=o},n.get=function(t,r,i,n,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n+this.stride[4]*a]},n.index=function(e,t,r,i,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*i+this.stride[4]*n},n.hi=function(e,t,r,n,a){return new i(this.data,"number"!=typeof e||e<0?this.shape[0]:0|e,"number"!=typeof t||t<0?this.shape[1]:0|t,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof n||n<0?this.shape[3]:0|n,"number"!=typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},n.lo=function(e,t,r,n,a){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],h=this.shape[3],d=this.shape[4],f=this.stride[0],p=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"==typeof e&&e>=0&&(o+=f*(s=0|e),l-=s),"number"==typeof t&&t>=0&&(o+=p*(s=0|t),u-=s),"number"==typeof r&&r>=0&&(o+=m*(s=0|r),c-=s),"number"==typeof n&&n>=0&&(o+=g*(s=0|n),h-=s),"number"==typeof a&&a>=0&&(o+=y*(s=0|a),d-=s),new i(this.data,l,u,c,h,d,f,p,m,g,y,o)},n.step=function(e,t,r,n,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.shape[4],h=this.stride[0],d=this.stride[1],f=this.stride[2],p=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"==typeof e&&((y=0|e)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"==typeof t&&((y=0|t)<0?(g+=d*(s-1),s=v(-s/y)):s=v(s/y),d*=y),"number"==typeof r&&((y=0|r)<0?(g+=f*(l-1),l=v(-l/y)):l=v(l/y),f*=y),"number"==typeof n&&((y=0|n)<0?(g+=p*(u-1),u=v(-u/y)):u=v(u/y),p*=y),"number"==typeof a&&((y=0|a)<0?(g+=m*(c-1),c=v(-c/y)):c=v(c/y),m*=y),new i(this.data,o,s,l,u,c,h,d,f,p,m,g)},n.transpose=function(e,t,r,n,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,n=void 0===n?3:0|n,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new i(this.data,o[e],o[t],o[r],o[n],o[a],s[e],s[t],s[r],s[n],s[a],this.offset)},n.pick=function(e,r,i,n,a){var o=[],s=[],l=this.offset;return"number"==typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof i&&i>=0?l=l+this.stride[2]*i|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof n&&n>=0?l=l+this.stride[3]*n|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,n){return new i(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],n)}}},l={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(e,t,r,a){if(void 0===e){var u=l.array[0];return u([])}"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var c=t.length;if(void 0===r){r=Array(c);for(var h=c-1,d=1;h>=0;--h)r[h]=d,d*=t[h]}if(void 0===a){a=0;for(var h=0;he==e>0?0xffffffff===n?(r+=1,n=0):n+=1:0===n?(n=0xffffffff,r-=1):n-=1,i.pack(n,r)}},8406(e,t){t.vertexNormals=function(e,t,r){for(var i=t.length,n=Array(i),a=void 0===r?1e-6:r,o=0;oa)for(var b=n[u],_=1/Math.sqrt(g*v),x=0;x<3;++x){var w=(x+1)%3,T=(x+2)%3;b[x]+=_*(y[w]*m[T]-y[T]*m[w])}}for(var o=0;oa)for(var _=1/Math.sqrt(A),x=0;x<3;++x)b[x]*=_;else for(var x=0;x<3;++x)b[x]=0}return n},t.faceNormals=function(e,t,r){for(var i=e.length,n=Array(i),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(f):0;for(var u=0;u<3;++u)d[u]*=f;n[o]=d}return n}},4081(e){e.exports=function(e,t,r,i,n,a,o,s,l,u){var c=t+a+u;if(h>0){var h=Math.sqrt(c+1);e[0]=.5*(o-l)/h,e[1]=.5*(s-i)/h,e[2]=.5*(r-a)/h,e[3]=.5*h}else{var d=Math.max(t,a,u),h=Math.sqrt(2*d-c+1);t>=d?(e[0]=.5*h,e[1]=.5*(n+r)/h,e[2]=.5*(s+i)/h,e[3]=.5*(o-l)/h):a>=d?(e[0]=.5*(r+n)/h,e[1]=.5*h,e[2]=.5*(l+o)/h,e[3]=.5*(s-i)/h):(e[0]=.5*(i+s)/h,e[1]=.5*(o+l)/h,e[2]=.5*h,e[3]=.5*(r-n)/h)}return e}},9977(e,t,r){e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],i=e.radius||1;t=[].slice.call(t,0,3),c(r=[].slice.call(r,0,4),r);var n=new h(r,t,Math.log(i));return n.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&n.lookAt(0,e.eye,e.center,e.up),n};var i=r(9215),n=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function u(e,t,r,i){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(i,2))}function c(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=u(r,i,n,a);o>1e-6?(e[0]=r/o,e[1]=i/o,e[2]=n/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function h(e,t,r){this.radius=i([r]),this.center=i(t),this.rotation=i(e),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var d=h.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;c(t,t);var r=this.computedMatrix;a(r,t);var i=this.computedCenter,n=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);n[0]=i[0]+s*r[2],n[1]=i[1]+s*r[6],n[2]=i[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,h=0;h<3;++h)u+=r[l+4*h]*n[h];r[12+l]=-u}},d.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var i=0;i<16;++i)t[i]=r[i];return t}return r},d.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},d.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},d.pan=function(e,t,r,i){t=t||0,r=r||0,i=i||0,this.recalcMatrix(e);var n=this.computedMatrix,a=n[1],o=n[5],s=n[9],u=l(a,o,s);a/=u,o/=u,s/=u;var c=n[0],h=n[4],d=n[8],f=c*a+h*o+d*s;c-=a*f;var p=l(c,h-=o*f,d-=s*f);c/=p,h/=p,d/=p;var m=n[2],g=n[6],y=n[10],v=m*a+g*o+y*s,x=m*c+g*h+y*d;m-=v*a+x*c;var b=l(m,g-=v*o+x*h,y-=v*s+x*d);m/=b,g/=b,y/=b;var _=c*t+a*r,w=h*t+o*r,T=d*t+s*r;this.center.move(e,_,w,T);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+i),this.radius.set(e,Math.log(A))},d.rotate=function(e,t,r,i){this.recalcMatrix(e),t=t||0,r=r||0;var n=this.computedMatrix,a=n[0],o=n[4],s=n[8],c=n[1],h=n[5],d=n[9],f=n[2],p=n[6],m=n[10],g=t*a+r*c,y=t*o+r*h,v=t*s+r*d,x=-(p*v-m*y),b=-(m*g-f*v),_=-(f*y-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),T=u(x,b,_,w);T>1e-6?(x/=T,b/=T,_/=T,w/=T):(x=b=_=0,w=1);var A=this.computedRotation,M=A[0],k=A[1],S=A[2],E=A[3],D=M*w+E*x+k*_-S*b,C=k*w+E*b+S*x-M*_,I=S*w+E*_+M*b-k*x,L=E*w-M*x-k*b-S*_;if(i){x=f;var P=Math.sin(i)/l(x,b=p,_=m);x*=P,b*=P,_*=P,D=D*(w=Math.cos(t))+L*x+C*_-I*b,C=C*w+L*b+I*x-D*_,I=I*w+L*_+D*b-C*x,L=L*w-D*x-C*b-I*_}var z=u(D,C,I,L);z>1e-6?(D/=z,C/=z,I/=z,L/=z):(D=C=I=0,L=1),this.rotation.set(e,D,C,I,L)},d.lookAt=function(e,t,r,i){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,i=i||this.computedUp;var a=this.computedMatrix;n(a,t,r,i);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),c(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var l=0,u=0;u<3;++u)l+=Math.pow(r[u]-t[u],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},d.translate=function(e,t,r,i){this.center.move(e,t||0,r||0,i||0)},d.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),c(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var i=this.computedMatrix;o(i,t);var n=i[15];if(Math.abs(n)>1e-6){var a=i[12]/n,l=i[13]/n,u=i[14]/n;this.recalcMatrix(e);var h=Math.exp(this.computedRadius[0]);this.center.set(e,a-i[2]*h,l-i[6]*h,u-i[10]*h),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},d.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},d.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=Math.max(t=t>0?Math.log(t):1/0,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},d.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(e){var t=this.lastT(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var i=e.rotation;i&&this.rotation.set(t,i[0],i[1],i[2],i[3]);var n=e.distance;n&&n>0&&this.radius.set(t,Math.log(n)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},1371(e,t,r){var i=r(3233);e.exports=function(e,t,r){return i(r="u">typeof r?r+"":" ",t)+e}},3202(e){e.exports=function(e,t){t||(t=[0,""]);var r=parseFloat(e=String(e),10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},3088(e,t,r){e.exports=function(e,t){for(var r=0|t.length,n=e.length,a=[Array(r),Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var d=a[h][r],f=0;f0&&(o=p,s=m,l=h)}return n||o&&u(o,l),s}for(var o=0;o0;){a[0][o].length;var f=function(e,r){var n=a[r][e][0],o=[e];u(n,r);for(var s=n[1^r];;){for(;s!==e;)o.push(s),s=c(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var l=o[o.length-1],h=o[1],d=c(l,e,!0);if(0>i(t[l],t[e],t[h],t[d]))break;o.push(e),s=c(l,e)}return o}(o,h);f[1]===f[f.length-1]?d.push.apply(d,f):(d.length>0&&l.push(d),d=f)}d.length>0&&l.push(d)}return l};var i=r(3140)},5609(e,t,r){e.exports=function(e,t){for(var r=i(e,t.length),n=Array(t.length),a=Array(t.length),o=[],s=0;s0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;s0});for(var m=p.length,g=Array(m),y=Array(m),f=0;f0;){var B=O.pop(),j=E[B];l(j,function(e,t){return e-t});var N,V=j.length,U=R[B];if(0===U){var w=p[B];N=[w]}for(var f=0;f=0)&&(R[q]=1^U,O.push(q),0===U)){var w=p[q];F(w)||(w.reverse(),N.push(w))}}0===U&&r.push(N)}return r};var i=r(3134),n=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),u=r(5609);function c(e,t){for(var r=Array(e),i=0;i0)||a[t]!==e[0])return 1;else n=r[t-1];for(var s=1;n;){var l=n.key,u=i(e,l[0],l[1]);if(l[0][0]0))return 0;s=-1,n=n.right}else if(u>0)n=n.left;else{if(!(u<0))return 0;s=1,n=n.right}}return s});return 0===d.length?_:(s=l(d),function(e){return s(e[0],e[1])?0:_(e)})};var i=r(3250)[3],n=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(e){for(var t={},r=0;r=f?(A=1,w=f+2*g+v):(A=-g/f,w=g*A+v)):(A=0,y>=0?(M=0,w=v):-y>=m?(M=1,w=m+2*y+v):(M=-y/m,w=y*M+v));else if(M<0)M=0,g>=0?(A=0,w=v):-g>=f?(A=1,w=f+2*g+v):(A=-g/f,w=g*A+v);else{var k=1/T;A*=k,M*=k,w=A*(f*A+p*M+2*g)+M*(p*A+m*M+2*y)+v}else A<0?(l=p+g,(u=m+y)>l?(c=u-l)>=(h=f-2*p+m)?(A=1,M=0,w=f+2*g+v):(M=1-(A=c/h),w=A*(f*A+p*M+2*g)+M*(p*A+m*M+2*y)+v):(A=0,u<=0?(M=1,w=m+2*y+v):y>=0?(M=0,w=v):(M=-y/m,w=y*M+v))):M<0?(l=p+y,(u=f+g)>l?(c=u-l)>=(h=f-2*p+m)?(M=1,A=0,w=m+2*y+v):w=(A=1-(M=c/h))*(f*A+p*M+2*g)+M*(p*A+m*M+2*y)+v:(M=0,u<=0?(A=1,w=f+2*g+v):g>=0?(A=0,w=v):(A=-g/f,w=g*A+v))):(c=m+y-p-g)<=0?(A=0,M=1,w=m+2*y+v):c>=(h=f-2*p+m)?(A=1,M=0,w=f+2*g+v):(M=1-(A=c/h),w=A*(f*A+p*M+2*g)+M*(p*A+m*M+2*y)+v);for(var S=1-A-M,d=0;d0){var u=e[r-1];if(0===i(s,u)&&a(u)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},3233(e){var t,r="";e.exports=function(e,i){if("string"!=typeof e)throw TypeError("expected a string");if(1===i)return e;if(2===i)return e+e;var n=e.length*i;if(t!==e||typeof t>"u")t=e,r="";else if(r.length>=n)return r.substr(0,n);for(;n>r.length&&i>1;)1&i&&(r+=e),i>>=1,e+=e;return r+=e,r=r.substr(0,n)}},3025(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004(e){e.exports=function(e){for(var t=e.length,r=e[e.length-1],i=t,n=t-2;n>=0;--n){var a=r,o=e[n],s=(r=a+o)-a,l=o-s;l&&(e[--i]=r,r=l)}for(var u=0,n=i;n0){if(a<=0)return o;i=n+a}else{if(!(n<0)||a>=0)return o;i=-(n+a)}var s=33306690738754716e-32*i;return o>=s||o<=-s?o:l(e,t,r)},function(e,t,r,i){var n=e[0]-i[0],a=t[0]-i[0],o=r[0]-i[0],s=e[1]-i[1],l=t[1]-i[1],c=r[1]-i[1],h=e[2]-i[2],d=t[2]-i[2],f=r[2]-i[2],p=a*c,m=o*l,g=o*s,y=n*c,v=n*l,x=a*s,b=h*(p-m)+d*(g-y)+f*(v-x),_=7771561172376103e-31*((Math.abs(p)+Math.abs(m))*Math.abs(h)+(Math.abs(g)+Math.abs(y))*Math.abs(d)+(Math.abs(v)+Math.abs(x))*Math.abs(f));return b>_||-b>_?b:u(e,t,r,i)}];c.length<=5;)c.push(s(c.length));e.exports=(function(e,t,r,i,n,a,o){return function(t,r,s,l,u){switch(arguments.length){case 0:case 1:return 0;case 2:return i(t,r);case 3:return n(t,r,s);case 4:return a(t,r,s,l);case 5:return o(t,r,s,l,u)}for(var c=Array(arguments.length),h=0;h0&&o>0||a<0&&o<0)return!1;var s=i(r,e,t),l=i(n,e,t);return(!(s>0)||!(l>0))&&(!(s<0)||!(l<0))&&(0!==a||0!==o||0!==s||0!==l||function(e,t,r,i){for(var n=0;n<2;++n){var a=e[n],o=t[n],s=Math.min(a,o),l=Math.max(a,o),u=r[n],c=i[n],h=Math.min(u,c);if(Math.max(u,c)=i?(u=g,(f+=1)=i?(u=g,(f+=1)"u"&&(s=function(e){for(var t=e.length,r=0,i=0;i>1,u=t[2*l+1];if(u===a)return l;a>1,u=t[2*l+1];if(u===a)return l;a>1,u=t[2*l+1];if(u===a)return l;a0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,(t|=r)|e>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:+(e>=10)},t.popCount=function(e){return e-=e>>>1&0x55555555,((e=(0x33333333&e)+(e>>>2&0x33333333))+(e>>>4)&0xf0f0f0f)*0x1010101>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var i=Array(256);(function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|i[e>>>16&255]<<8|i[e>>>24&255]},t.interleave2=function(e,t){return e&=65535,t&=65535,(e=((e=((e=((e=(e|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=(t|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1},t.deinterleave2=function(e,t){return(e=((e=((e=((e=((e=e>>>t&0x55555555)|e>>>1)&0x33333333)|e>>>2)&0xf0f0f0f)|e>>>4)&0xff00ff)|e>>>16)&65535)<<16>>16},t.interleave3=function(e,t,r){return e&=1023,t&=1023,r&=1023,r=((r=((r=((r=(r|r<<16)&0xff0000ff)|r<<8)&0xf00f00f)|r<<4)&0xc30c30c3)|r<<2)&0x49249249,(e=((e=((e=((e=(e|e<<16)&0xff0000ff)|e<<8)&0xf00f00f)|e<<4)&0xc30c30c3)|e<<2)&0x49249249|(t=((t=((t=((t=(t|t<<16)&0xff0000ff)|t<<8)&0xf00f00f)|t<<4)&0xc30c30c3)|t<<2)&0x49249249)<<1)|r<<2},t.deinterleave3=function(e,t){return(e=((e=((e=((e=((e=e>>>t&0x49249249)|e>>>2)&0xc30c30c3)|e>>>4)&0xf00f00f)|e>>>8)&0xff0000ff)|e>>>16)&1023)<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},2014(e,t,r){var i=r(3105),n=r(4623);function a(e,t){var r=e.length,i=e.length-t.length,n=Math.min;if(i)return i;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:var a=e[0]+e[1]-t[0]-t[1];return a||n(e[0],e[1])-n(t[0],t[1]);case 3:var o=e[0]+e[1],s=t[0]+t[1];if(a=o+e[2]-(s+t[2]))return a;var l=n(e[0],e[1]),u=n(t[0],t[1]),a=n(l,e[2])-n(u,t[2]);return a||n(l+e[2],o)-n(u+t[2],s);default:var c=e.slice(0);c.sort();var h=t.slice(0);h.sort();for(var d=0;d>1,s=a(e[o],t);s<=0?(0===s&&(n=o),r=o+1):s>0&&(i=o-1)}return n}function c(e,t){for(var r=Array(e.length),n=0,o=r.length;n=e.length||0!==a(e[g],s)););}return r}function h(e,t){if(t<0)return[];for(var r=[],n=(1<>>c&1&&u.push(n[c]);t.push(u)}return s(t)},t.skeleton=h,t.boundary=function(e){for(var t=[],r=0,i=e.length;r0;){var r,i=1&(r=e)?r-1>>1:(r>>1)-1;if(i>=0&&t0){var e=w[0];return g(0,A-1),A-=1,v(0),e}return -1}function _(e,t){var r=w[e];return u[r]===t?e:(u[r]=-1/0,x(e),b(),u[r]=t,x((A+=1)-1))}for(var w=[],T=Array(a),h=0;h>1;h>=0;--h)v(h);for(;;){var M=b();if(M<0||u[M]>r)break;!function(e){if(!c[e]){c[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),T[t]>=0&&_(T[t],m(t)),T[r]>=0&&_(T[r],m(r))}}(M)}for(var k=[],h=0;h=0&&r>=0&&t!==r){var i=T[t],n=T[r];i!==n&&E.push([i,n])}}),n.unique(n.normalize(E)),{positions:k,edges:E}};var i=r(3250),n=r(2014)},1303(e,t,r){e.exports=function(e,t){if(t[0][0]t[1][0]))return n(t,e);r=t[1],a=t[0]}if(e[0][0]e[1][0]))return-n(e,t);o=e[1],s=e[0]}var r,a,o,s,l=i(r,a,s),u=i(r,a,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=i(s,o,a),u=i(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return a[0]-s[0]};var i=r(3250);function n(e,t){if(t[0][0]t[1][0])r=t[1],n=t[0];else{var r,n,a,o,s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),u=Math.min(t[0][1],t[1][1]),c=Math.max(t[0][1],t[1][1]);return lc?s-c:l-c}e[0][1]0)if(t[0]!==o[1][0])r=e,e=e.right;else{var l=u(e.right,t);if(l)return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l=u(e.right,t);if(l)return l;e=e.left}}return r}function c(e,t,r,i){this.y=e,this.index=t,this.start=r,this.closed=i}function h(e,t,r,i){this.x=e,this.segment=t,this.create=r,this.index=i}s.prototype.castUp=function(e){var t=i.le(this.coordinates,e[0]);if(t<0)return -1;this.slabs[t];var r=u(this.slabs[t],e),n=-1;if(r&&(n=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var c=u(this.slabs[t-1],e);c&&(s?o(c.key,s)>0&&(s=c.key,n=c.value):(n=c.value,s=c.key))}var h=this.horizontal[t];if(h.length>0){var d=i.ge(h,e[1],l);if(d=h.length)return n;f=h[d]}}if(f.start)if(s){var p=a(s[0],s[1],[e[0],f.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(n=f.index)}else n=f.index;else f.y!==e[1]&&(n=f.index)}}}return n}},5202(e,t,r){var i=r(1944),n=r(8210);function a(e,t){var r=n(i(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,i){var n=-t/(i-t);n<0?n=0:n>1&&(n=1);for(var a=1-n,o=e.length,s=Array(o),l=0;l0||n>0&&c<0){var h=o(s,c,l,n);r.push(h),i.push(h.slice())}c<0?i.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),i.push(l.slice())),n=c}return{positive:r,negative:i}},e.exports.positive=function(e,t){for(var r=[],i=a(e[e.length-1],t),n=e[e.length-1],s=e[0],l=0;l0||i>0&&u<0)&&r.push(o(n,u,s,i)),u>=0&&r.push(s.slice()),i=u}return r},e.exports.negative=function(e,t){for(var r=[],i=a(e[e.length-1],t),n=e[e.length-1],s=e[0],l=0;l0||i>0&&u<0)&&r.push(o(n,u,s,i)),u<=0&&r.push(s.slice()),i=u}return r}},3387(e,t,r){var i;!function(){var n=/[^T]/,a=/[^v]/,o=/[diefg]/,s=/[bcdiefguxX]/,l=/[j]/,u=/^[^\x25]+/,c=/^\x25{2}/,h=/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,d=/^([a-z_][a-z_\d]*)/i,f=/^\.([a-z_][a-z_\d]*)/i,p=/^\[(\d+)\]/,m=/^[+-]/;function g(e){return function(e,t){var r,i,u,c,h,d,f,p,y,v=1,x=e.length,b="";for(i=0;i=0),c.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,c.width?parseInt(c.width):0);break;case"e":r=c.precision?parseFloat(r).toExponential(c.precision):parseFloat(r).toExponential();break;case"f":r=c.precision?parseFloat(r).toFixed(c.precision):parseFloat(r);break;case"g":r=c.precision?String(Number(r.toPrecision(c.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=c.precision?r.substring(0,c.precision):r;break;case"t":r=String(!!r),r=c.precision?r.substring(0,c.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=c.precision?r.substring(0,c.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=c.precision?r.substring(0,c.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}l.test(c.type)?b+=r:(o.test(c.type)&&(!p||c.sign)?(y=p?"+":"-",r=r.toString().replace(m,"")):y="",d=c.pad_char?"0"===c.pad_char?"0":c.pad_char.charAt(1):" ",f=c.width-(y+r).length,h=c.width&&f>0?d.repeat(f):"",b+=c.align?y+r+h:"0"===d?y+h+r:h+y+r)}return b}(function(e){if(v[e])return v[e];for(var t,r=e,i=[],n=0;r;){if(null!==(t=u.exec(r)))i.push(t[0]);else if(null!==(t=c.exec(r)))i.push("%");else if(null!==(t=h.exec(r))){if(t[2]){n|=1;var a=[],o=t[2],s=[];if(null!==(s=d.exec(o)))for(a.push(s[1]);""!==(o=o.substring(s[0].length));)if(null!==(s=f.exec(o)))a.push(s[1]);else if(null!==(s=p.exec(o)))a.push(s[1]);else throw SyntaxError("[sprintf] failed to parse named argument key");else throw SyntaxError("[sprintf] failed to parse named argument key");t[2]=a}else n|=2;if(3===n)throw Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}else throw SyntaxError("[sprintf] unexpected placeholder");r=r.substring(t[0].length)}return v[e]=i}(e),arguments)}function y(e,t){return g.apply(null,[e].concat(t||[]))}var v=Object.create(null);t.sprintf=g,t.vsprintf=y,"u">typeof window&&(window.sprintf=g,window.vsprintf=y,void 0!==(i=(function(){return{sprintf:g,vsprintf:y}}).call(t,r,t,e))&&(e.exports=i))}()},3711(e,t,r){e.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=n(e,t),i=r.length,a=Array(i),o=Array(i),s=0;si|0},vertex:function(e,t,r,i,n,a,o,s,l,u,c,h,d){var f=(0|o)+(s<<1)+(l<<2)+(u<<3)|0;if(0!==f&&15!==f)switch(f){case 0:case 15:c.push([e-.5,t-.5]);break;case 1:c.push([e-.25-.25*(i+r-2*d)/(r-i),t-.25-.25*(n+r-2*d)/(r-n)]);break;case 2:c.push([e-.75-.25*(-i-r+2*d)/(i-r),t-.25-.25*(a+i-2*d)/(i-a)]);break;case 3:c.push([e-.5,t-.5-.5*(n+r+a+i-4*d)/(r-n+i-a)]);break;case 4:c.push([e-.25-.25*(a+n-2*d)/(n-a),t-.75-.25*(-n-r+2*d)/(n-r)]);break;case 5:c.push([e-.5-.5*(i+r+a+n-4*d)/(r-i+n-a),t-.5]);break;case 6:c.push([e-.5-.25*(-i-r+a+n)/(i-r+n-a),t-.5-.25*(-n-r+a+i)/(n-r+i-a)]);break;case 7:c.push([e-.75-.25*(a+n-2*d)/(n-a),t-.75-.25*(a+i-2*d)/(i-a)]);break;case 8:c.push([e-.75-.25*(-a-n+2*d)/(a-n),t-.75-.25*(-a-i+2*d)/(a-i)]);break;case 9:c.push([e-.5-.25*(i+r+-a-n)/(r-i+a-n),t-.5-.25*(n+r+-a-i)/(r-n+a-i)]);break;case 10:c.push([e-.5-.5*(-i-r+-a-n+4*d)/(i-r+a-n),t-.5]);break;case 11:c.push([e-.25-.25*(-a-n+2*d)/(a-n),t-.75-.25*(n+r-2*d)/(r-n)]);break;case 12:c.push([e-.5,t-.5-.5*(-n-r+-a-i+4*d)/(n-r+a-i)]);break;case 13:c.push([e-.75-.25*(i+r-2*d)/(r-i),t-.25-.25*(-a-i+2*d)/(a-i)]);break;case 14:c.push([e-.25-.25*(-i-r+2*d)/(i-r),t-.25-.25*(-n-r+2*d)/(n-r)])}},cell:function(e,t,r,i,n,a,o,s,l){n?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],n=[];return i(e,r,n,t),{positions:r,cells:n}}}},o={}},7261(e,t,r){e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.up||[0,1,0],i=e.right||h(r),n=e.radius||1,a=e.theta||0,c=e.phi||0;if(t=[].slice.call(t,0,3),s(r=[].slice.call(r,0,3),r),s(i=[].slice.call(i,0,3),i),"eye"in e){var f=e.eye,p=[f[0]-t[0],f[1]-t[1],f[2]-t[2]];o(i,p,r),1e-6>u(i[0],i[1],i[2])?i=h(r):s(i,i),n=u(p[0],p[1],p[2]);var m=l(r,p)/n,g=l(i,p)/n;c=Math.acos(m),a=Math.acos(g)}return n=Math.log(n),new d(e.zoomMin,e.zoomMax,t,r,i,n,a,c)};var i=r(9215),n=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function u(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function c(e){return Math.min(1,Math.max(-1,e))}function h(e){var t=Math.abs(e[0]),r=Math.abs(e[1]),i=Math.abs(e[2]),n=[0,0,0];t>Math.max(r,i)?n[2]=1:r>Math.max(t,i)?n[0]=1:n[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=e[l]*e[l],o+=n[l]*e[l];for(var l=0;l<3;++l)n[l]-=o/a*e[l];return s(n,n),n}function d(e,t,r,n,a,o,s,l){this.center=i(r),this.up=i(n),this.right=i(a),this.radius=i([o]),this.angle=i([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}var f=d.prototype;f.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=Math.max(t=t>0?Math.log(t):1/0,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},f.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},f.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,r=this.computedRight,i=0,n=0,a=0;a<3;++a)n+=t[a]*r[a],i+=t[a]*t[a];for(var l=Math.sqrt(i),c=0,a=0;a<3;++a)r[a]-=t[a]*n/i,c+=r[a]*r[a],t[a]/=l;for(var h=Math.sqrt(c),a=0;a<3;++a)r[a]/=h;var d=this.computedToward;o(d,t,r),s(d,d);for(var f=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),y=Math.sin(p),v=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*v,w=y*v,T=-g*x,A=-y*x,M=this.computedEye,k=this.computedMatrix,a=0;a<3;++a){var S=_*r[a]+w*d[a]+x*t[a];k[4*a+1]=T*r[a]+A*d[a]+v*t[a],k[4*a+2]=S,k[4*a+3]=0}var E=k[1],D=k[5],C=k[9],I=k[2],L=k[6],P=k[10],z=D*P-C*L,F=C*I-E*P,O=E*L-D*I,R=u(z,F,O);z/=R,F/=R,O/=R,k[0]=z,k[4]=F,k[8]=O;for(var a=0;a<3;++a)M[a]=b[a]+k[2+4*a]*f;for(var a=0;a<3;++a){for(var c=0,B=0;B<3;++B)c+=k[a+4*B]*M[B];k[12+a]=-c}k[15]=1},f.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var i=0;i<16;++i)t[i]=r[i];return t}return r};var p=[0,0,0];f.rotate=function(e,t,r,i){if(this.angle.move(e,t,r),i){this.recalcMatrix(e);var n=this.computedMatrix;p[0]=n[2],p[1]=n[6],p[2]=n[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,u=0;u<3;++u)n[4*u]=o[u],n[4*u+1]=s[u],n[4*u+2]=l[u];a(n,n,i,p);for(var u=0;u<3;++u)o[u]=n[4*u],s[u]=n[4*u+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},f.pan=function(e,t,r,i){t=t||0,r=r||0,i=i||0,this.recalcMatrix(e);var n=this.computedMatrix,a=(this.computedRadius[0],n[1]),o=n[5],s=n[9],l=u(a,o,s);a/=l,o/=l,s/=l;var c=n[0],h=n[4],d=n[8],f=c*a+h*o+d*s;c-=a*f;var p=u(c,h-=o*f,d-=s*f);c/=p,h/=p,d/=p;var m=c*t+a*r,g=h*t+o*r,y=d*t+s*r;this.center.move(e,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+i),this.radius.set(e,Math.log(v))},f.translate=function(e,t,r,i){this.center.move(e,t||0,r||0,i||0)},f.setMatrix=function(e,t,r,i){var a,o,s=1;"number"==typeof r&&(s=0|r),(s<0||s>3)&&(s=1);var l=(s+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var h=t[s],d=t[s+4],f=t[s+8];if(i){var p=Math.abs(h),m=Math.abs(f),g=Math.max(p,Math.abs(d),m);p===g?(h=h<0?-1:1,d=f=0):m===g?(f=f<0?-1:1,h=d=0):(d=d<0?-1:1,h=f=0)}else{var y=u(h,d,f);h/=y,d/=y,f/=y}var v=t[l],x=t[l+4],b=t[l+8],_=v*h+x*d+b*f;v-=h*_;var w=u(v,x-=d*_,b-=f*_);v/=w,x/=w;var T=d*(b/=w)-f*x,A=f*v-h*b,M=h*x-d*v,k=u(T,A,M);if(T/=k,A/=k,M/=k,this.center.jump(e,q,G,H),this.radius.idle(e),this.up.jump(e,h,d,f),this.right.jump(e,v,x,b),2===s){var S=t[1],E=t[5],D=t[9],C=S*v+E*x+D*b,I=S*T+E*A+D*M;a=F<0?-Math.PI/2:Math.PI/2,o=Math.atan2(I,C)}else{var L=t[2],P=t[6],z=t[10],F=L*h+P*d+z*f,O=L*v+P*x+z*b,R=L*T+P*A+z*M;a=Math.asin(c(F)),o=Math.atan2(R,O)}this.angle.jump(e,o,a),this.recalcMatrix(e);var B=t[2],j=t[6],N=t[10],V=this.computedMatrix;n(V,t);var U=V[15],q=V[12]/U,G=V[13]/U,H=V[14]/U,$=Math.exp(this.computedRadius[0]);this.center.jump(e,q-B*$,G-j*$,H-N*$)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},f.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},f.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},f.lookAt=function(e,t,r,i){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var n=(i=i||this.computedUp)[0],a=i[1],o=i[2],s=u(n,a,o);if(!(s<1e-6)){n/=s,a/=s,o/=s;var l=t[0]-r[0],h=t[1]-r[1],d=t[2]-r[2],f=u(l,h,d);if(!(f<1e-6)){l/=f,h/=f,d/=f;var p=this.computedRight,m=p[0],g=p[1],y=p[2],v=n*m+a*g+o*y;m-=v*n;var x=u(m,g-=v*a,y-=v*o);if(!(x<.01&&(x=u(m=a*d-o*h,g=o*l-n*d,y=n*h-a*l))<1e-6)){m/=x,g/=x,y/=x,this.up.set(e,n,a,o),this.right.set(e,m,g,y),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(f));var b=a*y-o*g,_=o*m-n*y,w=n*g-a*m,T=u(b,_,w);b/=T;var A=n*l+a*h+o*d,M=m*l+g*h+y*d,k=b*l+(_/=T)*h+(w/=T)*d,S=Math.asin(c(A)),E=Math.atan2(k,M),D=this.angle._state,C=D[D.length-1],I=D[D.length-2],L=Math.abs((C%=2*Math.PI)+2*Math.PI-E),P=Math.abs(C-E),z=Math.abs(C-2*Math.PI-E);Ltypeof Uint8ClampedArray,s="u">typeof BigUint64Array,l="u">typeof BigInt64Array,u=r.g.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=n([32,0])),u.BIGUINT64||(u.BIGUINT64=n([32,0])),u.BIGINT64||(u.BIGINT64=n([32,0])),u.BUFFER||(u.BUFFER=n([32,0]));var c=u.DATA,h=u.BUFFER;function d(e){if(e){var t=e.length||e.byteLength;c[i.log2(t)].push(e)}}function f(e){var e=i.nextPow2(e),t=c[i.log2(e)];return t.length>0?t.pop():new ArrayBuffer(e)}function p(e){return new Uint8Array(f(e),0,e)}function m(e){return new Uint16Array(f(2*e),0,e)}function g(e){return new Uint32Array(f(4*e),0,e)}function y(e){return new Int8Array(f(e),0,e)}function v(e){return new Int16Array(f(2*e),0,e)}function x(e){return new Int32Array(f(4*e),0,e)}function b(e){return new Float32Array(f(4*e),0,e)}function _(e){return new Float64Array(f(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(f(e),0,e):p(e)}function T(e){return s?new BigUint64Array(f(8*e),0,e):null}function A(e){return l?new BigInt64Array(f(8*e),0,e):null}function M(e){return new DataView(f(e),0,e)}function k(e){e=i.nextPow2(e);var t=h[i.log2(e)];return t.length>0?t.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))h[i.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength;c[0|i.log2(t)].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){d(e.buffer)},t.freeArrayBuffer=d,t.freeBuffer=function(e){h[i.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return f(e);switch(t){case"uint8":return p(e);case"uint16":return m(e);case"uint32":return g(e);case"int8":return y(e);case"int16":return v(e);case"int32":return x(e);case"float":case"float32":return b(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return A(e);case"biguint64":return T(e);case"buffer":return k(e);case"data":case"dataview":return M(e);default:return null}},t.mallocArrayBuffer=f,t.mallocUint8=p,t.mallocUint16=m,t.mallocUint32=g,t.mallocInt8=y,t.mallocInt16=v,t.mallocInt32=x,t.mallocFloat32=t.mallocFloat=b,t.mallocFloat64=t.mallocDouble=_,t.mallocUint8Clamped=w,t.mallocBigUint64=T,t.mallocBigInt64=A,t.mallocDataView=M,t.mallocBuffer=k,t.clearCache=function(){for(var e=0;e<32;++e)u.UINT8[e].length=0,u.UINT16[e].length=0,u.UINT32[e].length=0,u.INT8[e].length=0,u.INT16[e].length=0,u.INT32[e].length=0,u.FLOAT[e].length=0,u.DOUBLE[e].length=0,u.BIGUINT64[e].length=0,u.BIGINT64[e].length=0,u.UINT8C[e].length=0,c[e].length=0,h[e].length=0}},1755(e){function t(e){this.roots=Array(e),this.ranks=Array(e);for(var t=0;ttypeof document&&((n=document.createElement("canvas")).width=8192,n.height=1024,a=n.getContext("2d"))},7718(e,t,r){e.exports=function(e,t,r,i){var a=64,o=1.25,s={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return i&&(i.size&&i.size>0&&(a=i.size),i.lineSpacing&&i.lineSpacing>0&&(o=i.lineSpacing),i.styletags&&i.styletags.breaklines&&(s.breaklines=!!i.styletags.breaklines),i.styletags&&i.styletags.bolds&&(s.bolds=!!i.styletags.bolds),i.styletags&&i.styletags.italics&&(s.italics=!!i.styletags.italics),i.styletags&&i.styletags.subscripts&&(s.subscripts=!!i.styletags.subscripts),i.styletags&&i.styletags.superscripts&&(s.superscripts=!!i.styletags.superscripts)),r.font=[i.fontStyle,i.fontVariant,i.fontWeight,a+"px",i.font].filter(function(e){return e}).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",h(function(e,t,r,i,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,` +`):r.replace(/\/g," ");var s="",l=[];for(x=0;x-1?parseInt(e[1+n]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(i=i.replace(k(),"?px "),w*=Math.pow(.75,l-s),i=i.replace("?px ",k())),_+=.25*p*(l-s)}if(!0===o.superscripts){var u=e.indexOf("+"),c=r.indexOf("+"),h=u>-1?parseInt(e[1+u]):0,d=c>-1?parseInt(r[1+c]):0;h!==d&&(i=i.replace(k(),"?px "),w*=Math.pow(.75,d-h),i=i.replace("?px ",k())),_-=.25*p*(d-h)}if(!0===o.bolds){var f=e.indexOf("b|")>-1,m=r.indexOf("b|")>-1;!f&&m&&(i=g?i.replace("italic ","italic bold "):"bold "+i),f&&!m&&(i=i.replace("bold ",""))}if(!0===o.italics){var g=e.indexOf("i|")>-1,y=r.indexOf("i|")>-1;!g&&y&&(i="italic "+i),g&&!y&&(i=i.replace("italic ",""))}t.font=i}(s,E),s=E))}M(),T+=S.length;var D=0|Math.round(b+2*i);g",a="",o=n.length,s=a.length,l="+"===t[0]||"-"===t[0],u=0,c=-s;u>-1&&!(-1===(u=r.indexOf(n,u))||-1===(c=r.indexOf(a,u+o))||c<=u);){for(var h=u;h=c)i[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==i[h]){var d=i[h].indexOf(t[0]);-1===d?i[h]+=t:l&&(i[h]=i[h].substr(0,d+1)+(1+parseInt(i[h][d+1]))+i[h].substr(d+2))}var f=u+o,p=r.substr(f,c-f).indexOf(n);u=-1!==p?p:c+s}return i}function c(e,t,r,n){var u,c=(u=i(e,128),n?a(u.cells,u.positions,.25):{edges:u.cells,positions:u.positions}),h=function(e,t,r){for(var i=t.textAlign||"start",n=t.textBaseline||"alphabetic",a=[0x40000000,0x40000000],o=[0,0],s=e.length,l=0;ltypeof ses)||!ses.ok||ses.ok()){"u">typeof ses&&(ses.weakMapPermitHostObjects=v);var t,r,i,n=!1;if("function"==typeof WeakMap){var a=WeakMap;if(!("u">typeof navigator&&/Firefox/.test(navigator.userAgent))){var o=new a,s=Object.freeze({});if(o.set(s,1),1!==o.get(s))n=!0;else{e.exports=WeakMap;return}}}Object.prototype.hasOwnProperty;var l=Object.getOwnPropertyNames,u=Object.defineProperty,c=Object.isExtensible,h="weakmap:",d=h+"ident:"+Math.random()+"___";if("u">typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var f=new Uint8Array(new ArrayBuffer(25));crypto.getRandomValues(f),d=h+"rand:"+Array.prototype.map.call(f,function(e){return(e%36).toString(36)}).join("")+"___"}if(u(Object,"getOwnPropertyNames",{value:function(e){return l(e).filter(x)}}),"getPropertyNames"in Object){var p=Object.getPropertyNames;u(Object,"getPropertyNames",{value:function(e){return p(e).filter(x)}})}t=Object.freeze,u(Object,"freeze",{value:function(e){return b(e),t(e)}}),r=Object.seal,u(Object,"seal",{value:function(e){return b(e),r(e)}}),i=Object.preventExtensions,u(Object,"preventExtensions",{value:function(e){return b(e),i(e)}});var m=!1,g=0,y=function(){this instanceof y||w();var e=[],t=[],r=g++;return Object.create(y.prototype,{get___:{value:_(function(i,n){var a,o=b(i);return o?r in o?o[r]:n:(a=e.indexOf(i))>=0?t[a]:n})},has___:{value:_(function(t){var i=b(t);return i?r in i:e.indexOf(t)>=0})},set___:{value:_(function(i,n){var a,o=b(i);return o?o[r]=n:(a=e.indexOf(i))>=0?t[a]=n:(t[a=e.length]=n,e[a]=i),this})},delete___:{value:_(function(i){var n,a,o=b(i);return o?r in o&&delete o[r]:!((n=e.indexOf(i))<0)&&(a=e.length-1,e[n]=void 0,t[n]=t[a],e[n]=e[a],e.length=a,t.length=a,!0)})}})};y.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),"function"==typeof a?function(){function t(){this instanceof y||w();var e,t=new a,r=void 0,i=!1;return e=n?function(e,i){return t.set(e,i),t.has(e)||(r||(r=new y),r.set(e,i)),this}:function(e,n){if(i)try{t.set(e,n)}catch{r||(r=new y),r.set___(e,n)}else t.set(e,n);return this},Object.create(y.prototype,{get___:{value:_(function(e,i){return r?t.has(e)?t.get(e):r.get___(e,i):t.get(e,i)})},has___:{value:_(function(e){return t.has(e)||!!r&&r.has___(e)})},set___:{value:_(e)},delete___:{value:_(function(e){var i=!!t.delete(e);return r&&r.delete___(e)||i})},permitHostObjects___:{value:_(function(e){if(e===v)i=!0;else throw Error("bogus call to permitHostObjects___")})}})}n&&"u">typeof Proxy&&(Proxy=void 0),t.prototype=y.prototype,e.exports=t,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("u">typeof Proxy&&(Proxy=void 0),e.exports=y)}function v(e){e.permitHostObjects___&&e.permitHostObjects___(v)}function x(e){return e.substr(0,h.length)!=h||"___"!==e.substr(e.length-3)}function b(e){if(e!==Object(e))throw TypeError("Not an object: "+e);var t=e[d];if(t&&t.key===e)return t;if(c(e)){t={key:e};try{return u(e,d,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch{return}}}function _(e){return e.prototype=null,Object.freeze(e)}function w(){!m&&"u">typeof console&&(m=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236(e,t,r){var i=r(8284);e.exports=function(){var e={};return function(t){if(("object"!=typeof t||null===t)&&"function"!=typeof t)throw Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:i(t,e)}}},8284(e){e.exports=function(e,t){var r={identity:t},i=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?i.apply(this,arguments):r},writable:!0}),r}},606(e,t,r){var i=r(236);e.exports=function(){var e=i();return{get:function(t,r){var i=e(t);return i.hasOwnProperty("value")?i.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},3349(e){var t,r;t=(function(){return function(e,t,r,i,n,a){var o=e[0],s=r[0],l=[0];i|=0;var u=0;for(u=0;u=0!=h>=0&&n.push(l[0]+.5+.5*(c+h)/(c-h)),i+=s,++l[0]}}}).bind(void 0,{funcName:"zeroCrossings"}),r={},e.exports=function(e,i,n){var a=e.dtype,o=e.order,s=[a,o.join()].join(),l=r[s];return l||(r[s]=l=t([a,o])),l(e.shape.slice(0),e.data,e.stride,0|e.offset,i,n)}},781(e,t,r){e.exports=function(e,t){var r=[];return t=+t||0,i(e.hi(e.shape[0]-1),r,t),r};var i=r(3349)},7790(){}};let i={};function n(e){let t=i[e];if(void 0!==t)return t.exports;let a=i[e]={id:e,loaded:!1,exports:{}};return r[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch{if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.exports=n(3065)}}),ff=m({"src/lib/str2rgbarray.js"(e,t){var{normalize:r}=er();t.exports=function(e){return e?r(e):[0,0,0,1]}}}),fp=m({"src/lib/gl_format_color.js"(e,t){var r=I(),i=t4(),n=er(),a=et().defaultLine,o=F().isArrayOrTypedArray,s=n.normalize(a);function l(e,t){return[e[0],e[1],e[2],e[3]*t]}function u(e){return!r(e)&&(n.isChannelArray(e)||n.isValid(e))?n.normalize(e):s}function c(e){return r(e)?e:1}t.exports={formatColor:function(e,t,r){var a=e.color;a&&a._inputArray&&(a=a._inputArray);var h,d,f,p,m,g=o(a),y=o(t),v=i.extractOpts(e),x=[];if(h=void 0!==v.colorscale?i.makeColorScaleFuncFromTrace(e):u,d=g?(e,t)=>void 0===e[t]?s:void 0===v.colorscale?h(e[t]):n.normalize(h(e[t])):u,f=y?function(e,t){return void 0===e[t]?1:c(e[t])}:c,g||y)for(var b=0;b0){var d=n.c2l(c);n._lowerLogErrorBound||(n._lowerLogErrorBound=d),n._lowerErrorBound=Math.min(n._lowerLogErrorBound,d)}}else o[s]=[-l[0]*i,l[1]*i]}return o}t.exports=function(e,t,r){var n=[i(e.x,e.error_x,t[0],r.xaxis),i(e.y,e.error_y,t[1],r.yaxis),i(e.z,e.error_z,t[2],r.zaxis)],a=function(e){for(var t=0;t-1?-1:+(e.indexOf("right")>-1)}function x(e){return null==e?0:e.indexOf("top")>-1?-1:+(e.indexOf("bottom")>-1)}function b(e,t){return t(4*e)}function _(e){return d[e]}function w(e,t,r,i,n){var a=null;if(s.isArrayOrTypedArray(e)){a=[];for(var o=0;o=0){var E=function(e,t,r){var i,n=(r+1)%3,a=(r+2)%3,s=[],l=[];for(i=0;i=0&&h("surfacecolor",b||_);for(var w=["x","y","z"],T=0;T<3;++T){var A="projection."+w[T];h(A+".show")&&(h(A+".opacity"),h(A+".scale"))}var M=r.getComponentMethod("errorbars","supplyDefaults");M(e,t,b||_||u,{axis:"z"}),M(e,t,b||_||u,{axis:"y",inherit:"z"}),M(e,t,b||_||u,{axis:"x",inherit:"z"})}}}),f_=m({"src/traces/scatter3d/calc.js"(e,t){var r=i2(),i=i1();t.exports=function(e,t){var n=[{x:!1,y:!1,trace:t,t:{}}];return r(n,t),i(e,t),n}}}),fw=m({"node_modules/get-canvas-context/index.js"(e,t){t.exports=function(e,t){if("string"!=typeof e)throw TypeError("must specify type string");if(t=t||{},typeof document>"u"&&!t.canvas)return null;var r=t.canvas||document.createElement("canvas");"number"==typeof t.width&&(r.width=t.width),"number"==typeof t.height&&(r.height=t.height);var i,n=t;try{var a=[e];0===e.indexOf("webgl")&&a.push("experimental-"+e);for(var o=0;o/g," "));l[u]=f,c.tickmode=h}}t.ticks=l;for(var u=0;u<3;++u){a[u]=.5*(e.glplot.bounds[0][u]+e.glplot.bounds[1][u]);for(var p=0;p<2;++p)t.bounds[p][u]=e.glplot.bounds[p][u]}e.contourLevels=function(e){for(var t=[,,,],r=0;r<3;++r){for(var i=e[r],n=Array(i.length),a=0;ar.deltaY?1.1:.9090909090909091,a=e.glplot.getAspectratio();e.glplot.setAspectratio({x:i*a.x,y:i*a.y,z:i*a.z})}n(e)}},!!l&&{passive:!1}),e.glplot.canvas.addEventListener("mousemove",function(){if(!1!==e.fullSceneLayout.dragmode&&0!==e.camera.mouseListener.buttons){var t=i();e.graphDiv.emit("plotly_relayouting",t)}}),e.staticMode||e.glplot.canvas.addEventListener("webglcontextlost",function(r){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:r,layer:e.id})},!1)),e.glplot.oncontextloss=function(){e.recoverContext()},e.glplot.onrender=function(){e.render()},!0},T.render=function(){var e,t=this,r=t.graphDiv,i=t.svgContainer,n=t.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=n.width*a,l=n.height*o;i.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),i.setAttributeNS(null,"width",s),i.setAttributeNS(null,"height",l),x(t),t.glplot.axes.update(t.axesOptions);for(var u=Object.keys(t.traces),h=null,p=t.glplot.selection,m=0;m")):"isosurface"===e.type||"volume"===e.type?(T.valueLabel=d.hoverLabelText(t._mockAxis,t._mockAxis.d2l(p.traceCoordinate[3]),e.valuehoverformat),E.push("value: "+T.valueLabel),p.textLabel&&E.push(p.textLabel),S=E.join("
")):S=p.textLabel;var D={x:p.traceCoordinate[0],y:p.traceCoordinate[1],z:p.traceCoordinate[2],data:b._input,fullData:b,curveNumber:b.index,pointNumber:w};f.appendArrayPointValue(D,b,w),e._module.eventData&&(D=b._module.eventData(D,p,b,{},w));var C={points:[D]};if(t.fullSceneLayout.hovermode){var I=[];f.loneHover({trace:b,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:S,name:h.name,color:f.castHoverOption(b,w,"bgcolor")||h.color,borderColor:f.castHoverOption(b,w,"bordercolor"),fontFamily:f.castHoverOption(b,w,"font.family"),fontSize:f.castHoverOption(b,w,"font.size"),fontColor:f.castHoverOption(b,w,"font.color"),nameLength:f.castHoverOption(b,w,"namelength"),textAlign:f.castHoverOption(b,w,"align"),hovertemplate:c.castOption(b,w,"hovertemplate"),hovertemplateLabels:c.extendFlat({},D,T),eventData:[D]},{container:i,gd:r,inOut_bbox:I}),D.bbox=I[0]}p.distance<5&&(p.buttons||_)?r.emit("plotly_click",C):r.emit("plotly_hover",C),this.oldEventData=C}else f.loneUnhover(i),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;t.drawAnnotations(t)},T.recoverContext=function(){var e=this;e.glplot.dispose();var t=function(){e.glplot.gl.isContextLost()?requestAnimationFrame(t):e.initializeGLPlot()?e.plot.apply(e,e.plotArgs):c.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(t)};var M=["xaxis","yaxis","zaxis"];T.plot=function(e,t,r){if(this.plotArgs=[e,t,r],!this.glplot.contextLost){var i,n,a,o,s,l,u=t[this.id],h=r[this.id];this.fullLayout=t,this.fullSceneLayout=u,this.axesOptions.merge(t,u),this.spikeOptions.merge(u),this.setViewport(u),this.updateFx(u.dragmode,u.hovermode),this.camera.enableWheel=this.graphDiv._context._scrollZoom.gl3d,this.glplot.setClearColor(p(u.bgcolor)),this.setConvert(s),e?Array.isArray(e)||(e=[e]):e=[];var d=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(a=0;ag[1][a])g[0][a]=-1,g[1][a]=1;else{var C=g[1][a]-g[0][a];g[0][a]-=C/32,g[1][a]+=C/32}if(x=b(x=[g[0][a],g[1][a]],s),g[0][a]=x[0],g[1][a]=x[1],s.isReversed()){var I=g[0][a];g[0][a]=g[1][a],g[1][a]=I}}else x=s.range,g[0][a]=s.r2l(x[0]),g[1][a]=s.r2l(x[1]);g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),y[a]=g[1][a]-g[0][a],s.range=[g[0][a],g[1][a]],s.limitRange(),this.glplot.setBounds(a,{min:s.range[0]*f[a],max:s.range[1]*f[a]})}var L,P=u.aspectmode;if("cube"===P)L=[1,1,1];else if("manual"===P){var z=u.aspectratio;L=[z.x,z.y,z.z]}else if("auto"===P||"data"===P){var F=[1,1,1];for(a=0;a<3;++a){var O=v[l=(s=u[M[a]]).type];F[a]=Math.pow(O.acc,1/O.count)/f[a]}L="data"===P||Math.max.apply(null,F)/Math.min.apply(null,F)<=4?F:[1,1,1]}else throw Error("scene.js aspectRatio was not one of the enumerated types");u.aspectratio.x=h.aspectratio.x=L[0],u.aspectratio.y=h.aspectratio.y=L[1],u.aspectratio.z=h.aspectratio.z=L[2],this.glplot.setAspectratio(u.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=u.aspectmode);var R=u.domain||null,B=t._size||null;if(R&&B){var j=this.container.style;j.position="absolute",j.left=B.l+R.x[0]*B.w+"px",j.top=B.t+(1-R.y[1])*B.h+"px",j.width=B.w*(R.x[1]-R.x[0])+"px",j.height=B.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},T.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},T.getCamera=function(){var e;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(e=this.camera).up[0],y:e.up[1],z:e.up[2]},center:{x:e.center[0],y:e.center[1],z:e.center[2]},eye:{x:e.eye[0],y:e.eye[1],z:e.eye[2]},projection:{type:!0===e._ortho?"orthographic":"perspective"}}},T.setViewport=function(e){var t=e.camera;this.camera.lookAt.apply(this,[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]),this.glplot.setAspectratio(e.aspectratio),"orthographic"===t.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},T.isCameraChanged=function(e){var t=this.getCamera(),r=c.nestedProperty(e,this.id+".camera").get(),i=!1;if(void 0===r)i=!0;else{for(var n=0;n<3;n++)for(var a=0;a<3;a++)if(!function(e,t,r,i){var n=["up","center","eye"],a=["x","y","z"];return t[n[r]]&&e[n[r]][a[i]]===t[n[r]][a[i]]}(t,r,n,a)){i=!0;break}(!r.projection||t.projection&&t.projection.type!==r.projection.type)&&(i=!0)}return i},T.isAspectChanged=function(e){var t=this.glplot.getAspectratio(),r=c.nestedProperty(e,this.id+".aspectratio").get();return void 0===r||r.x!==t.x||r.y!==t.y||r.z!==t.z},T.saveLayout=function(e){var t,r,i,n,a,o,s=this.fullLayout,l=this.isCameraChanged(e),h=this.isAspectChanged(e),d=l||h;if(d){var f={};l&&(t=this.getCamera(),i=(r=c.nestedProperty(e,this.id+".camera")).get(),f[this.id+".camera"]=i),h&&(n=this.glplot.getAspectratio(),o=(a=c.nestedProperty(e,this.id+".aspectratio")).get(),f[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",e,s._preGUI,f),l&&(r.set(t),c.nestedProperty(s,this.id+".camera").set(t)),h&&(a.set(n),c.nestedProperty(s,this.id+".aspectratio").set(n),this.glplot.redraw())}return d},T.updateFx=function(e,t){var r=this.camera;if(r)if("orbit"===e)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===e){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var i=this.graphDiv,n=i._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var h=this.id+".camera.up",d={x:0,y:0,z:1},f={};f[h]=d;var p=i.layout;u.call("_storeDirectGUIEdit",p,n._preGUI,f),a.up=d,c.nestedProperty(p,h).set(d)}}else r.keyBindingMode=e;this.fullSceneLayout.hovermode=t},T.toImage=function(e){e||(e="png"),this.staticMode&&this.container.appendChild(r),this.glplot.redraw();var t,i=this.glplot.gl,n=i.drawingBufferWidth,a=i.drawingBufferHeight;i.bindFramebuffer(i.FRAMEBUFFER,null);var o=new Uint8Array(n*a*4);i.readPixels(0,0,n,a,i.RGBA,i.UNSIGNED_BYTE,o),function(e,t,r){for(var i=0,n=r-1;i0)for(var s=255/o,l=0;l<3;++l)e[a+l]=Math.min(s*e[a+l],255)}}(o,n,a);var s=document.createElement("canvas");s.width=n,s.height=a;var l=s.getContext("2d",{willReadFrequently:!0}),u=l.createImageData(n,a);switch(u.data.set(o),l.putImageData(u,0,0),e){case"jpeg":t=s.toDataURL("image/jpeg");break;case"webp":t=s.toDataURL("image/webp");break;default:t=s.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(r),t},T.setConvert=function(){for(var e=0;e<3;e++){var t=this.fullSceneLayout[M[e]];d.setConvert(t,this.fullLayout),t.setScale=c.noop}},T.make4thDimension=function(){var e=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(this._mockAxis,e)},t.exports=w}}),fD=m({"src/plots/gl3d/layout/attributes.js"(e,t){t.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),fC=m({"src/plots/gl3d/layout/axis_attributes.js"(e,t){var r=er(),i=tU(),n=H().extendFlat;t.exports=(0,eH().overrideAll)({visible:i.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:i.color,categoryorder:i.categoryorder,categoryarray:i.categoryarray,title:{text:i.title.text,font:i.title.font},type:n({},i.type,{values:["-","linear","log","date","category"]}),autotypenumbers:i.autotypenumbers,autorange:i.autorange,autorangeoptions:{minallowed:i.autorangeoptions.minallowed,maxallowed:i.autorangeoptions.maxallowed,clipmin:i.autorangeoptions.clipmin,clipmax:i.autorangeoptions.clipmax,include:i.autorangeoptions.include,editType:"plot"},rangemode:i.rangemode,minallowed:i.minallowed,maxallowed:i.maxallowed,range:n({},i.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:i.minor.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,mirror:i.mirror,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,labelalias:i.labelalias,tickfont:i.tickfont,tickangle:i.tickangle,tickprefix:i.tickprefix,showtickprefix:i.showtickprefix,ticksuffix:i.ticksuffix,showticksuffix:i.showticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:n({},i.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth},"plot","from-root")}}),fI=m({"src/plots/gl3d/layout/layout_attributes.js"(e,t){var r=fC(),i=ai().attributes,n=H().extendFlat;function a(e,t,r){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:t,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}t.exports={_arrayAttrRegexps:[(0,tb().counterRegex)("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:n(a(0,0,1),{}),center:n(a(0,0,0),{}),eye:n(a(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:r,yaxis:r,zaxis:r,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),fL=m({"src/plots/gl3d/layout/axis_defaults.js"(e,t){var r=er(),i=tb(),n=tD(),a=fC(),o=nu(),s=nd(),l=["xaxis","yaxis","zaxis"],u=13600/187;t.exports=function(e,t,c){var h,d;function f(e,t){return i.coerce(h,d,a,e,t)}for(var p=0;p.999)&&(g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}t.exports=function(e,t,i){var n=t._basePlotModules.length>1;a(e,t,i,{type:u,attributes:s,handleDefaults:c,fullLayout:t,font:t.font,fullData:i,getDfltFromLayout:function(t){if(!n&&r.validate(e[t],s[t]))return e[t]},autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,calendar:t.calendar})}}}),fz=m({"src/plots/gl3d/index.js"(e){var t=eH().overrideAll,r=Y(),i=fE(),n=tz().getSubplotData,a=tb(),o=tR(),s="gl3d",l="scene";e.name=s,e.attr=l,e.idRoot=l,e.idRegex=e.attrRegex=a.counterRegex("scene"),e.attributes=fD(),e.layoutAttributes=fI(),e.baseLayoutAttrOverrides=t({hoverlabel:r.hoverlabel},"plot","nested"),e.supplyLayoutDefaults=fP(),e.plot=function(e){for(var t=e._fullLayout,r=e._fullData,a=t._subplots[s],o=0;o720;)i--,i/=function(e){for(var t=p(e),r=e,i=0;i0){r=f[i];break}return r}(i),++i<120&&(i=720);var n=Math.round(i/e);return n>1?n:1},d.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,a=e[0].shape[0],o=e[0].shape[1],s=0|Math.floor(e[0].shape[0]*t+1),l=0|Math.floor(e[0].shape[1]*r+1),u=1+a+1,c=1+o+1,h=i(new Float32Array(u*c),[u,c]),d=[1/t,0,0,0,1/r,0,0,0,1],f=0;f0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(n[e]=!0,t=this.contourStart[e];tb&&(this.minValues[y]=b),this.maxValues[y]l&&(t.isomin=null,t.isomax=null);var u=o("x"),c=o("y"),h=o("z"),d=o("value");if(!u||!u.length||!c||!c.length||!h||!h.length||!d||!d.length){t.visible=!1;return}i.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],n),o("valuehoverformat"),["x","y","z"].forEach(function(e){o(e+"hoverformat");var t="caps."+e;o(t+".show")&&o(t+".fill");var r="slices."+e;o(r+".show")&&(o(r+".fill"),o(r+".locations"))}),o("spaceframe.show")&&o("spaceframe.fill"),o("surface.show")&&(o("surface.count"),o("surface.fill"),o("surface.pattern")),o("contour.show")&&(o("contour.color"),o("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(e){o(e)}),a(e,t,n,o,{prefix:"",cLetter:"c"}),t._length=null}t.exports={supplyDefaults:function(e,t,i,a){o(e,t,i,a,function(i,a){return r.coerce(e,t,n,i,a)})},supplyIsoDefaults:o}}}),f$=m({"src/traces/streamtube/calc.js"(e,t){var r=tb(),i=t5();function n(e){var t,i,n,o,s,l,u,c,h,d,f,p,m=e._x,g=e._y,y=e._z,v=e._len,x=-1/0,b=1/0,_=-1/0,w=1/0,T=-1/0,A=1/0,M="";for(v&&(u=m[0],h=g[0],f=y[0]),v>1&&(c=m[v-1],d=g[v-1],p=y[v-1]),t=0;tc?"-":"+")+"x")).replace("y",(h>d?"-":"+")+"y")).replace("z",(f>p?"-":"+")+"z");var D=function(){v=0,k=[],S=[],E=[]};(!v||v0;r--){var i=Math.min(t[r],t[r-1]),n=Math.max(t[r],t[r-1]);if(n>i&&i-1}function P(l,u,c){i=r;var h=[u],d=[c];if(t>=1)h=[u],d=[c];else if(t>0){var f,p,m,y,v,x,b,_,w,T,A,M,k,S=(f=u,p=c,m=f[0],_=I(x=function(e,t,r){for(var i=[],n=0;n-1?c[F]:function(e,t,r){for(var l=s.length,u=i;u-1?z[F]=N:z[F]=C(O,R,B,null===l?j:l)}D=z[0],L=z[1],P=z[2],e._meshI.push(D),e._meshJ.push(L),e._meshK.push(P),++g}}function z(e,t,r,i){var n=e[3];ni&&(n=i);for(var a=(e[3]-n)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*e[s]+a*t[s];return o}function F(e){var t=.001*(E-S);return e>=S-t&&e<=E+t}function O(t){for(var r=[],i=0;i<4;i++){var n=t[i];r.push([e._x[n],e._y[n],e._z[n],e._value[n]])}return r}function R(e,t,r,i,n,a){a||(a=1),r=[-1,-1,-1];var o,s,l,u=!1,c=[(o=t[0][3],o>=i&&o<=n),(s=t[1][3],s>=i&&s<=n),(l=t[2][3],l>=i&&l<=n)];if(!c[0]&&!c[1]&&!c[2])return!1;var h=function(e,t,r){return F(t[0][3])&&F(t[1][3])&&F(t[2][3])?(P(e,t,r),!0):a<3&&R(e,t,r,S,E,++a)};if(c[0]&&c[1]&&c[2])return h(e,t,r)||u;var d=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(a){if(c[a[0]]&&c[a[1]]&&!c[a[2]]){var o=t[a[0]],s=t[a[1]],l=t[a[2]],f=z(l,o,i,n),p=z(l,s,i,n);u=h(e,[p,f,o],[-1,-1,r[a[0]]])||u,u=h(e,[o,s,p],[r[a[0]],r[a[1]],-1])||u,d=!0}}),d||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(a){if(c[a[0]]&&!c[a[1]]&&!c[a[2]]){var o=t[a[0]],s=t[a[1]],l=t[a[2]],f=z(s,o,i,n);u=h(e,[z(l,o,i,n),f,o],[-1,-1,r[a[0]]])||u,d=!0}}),u}function B(e,t,r,i){var n,a,o,s,l,u=!1,c=O(t),h=[(n=c[0][3],n>=r&&n<=i),(a=c[1][3],a>=r&&a<=i),(o=c[2][3],o>=r&&o<=i),(s=c[3][3],s>=r&&s<=i)];if(!h[0]&&!h[1]&&!h[2]&&!h[3])return u;if(h[0]&&h[1]&&h[2]&&h[3])return m&&((l=function(r,i,n){P(e,[c[r],c[i],c[n]],[t[r],t[i],t[n]])})(0,1,2),l(3,0,1),l(2,3,0),l(1,2,3)),u;var d=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(n){if(h[n[0]]&&h[n[1]]&&h[n[2]]&&!h[n[3]]){var a=c[n[0]],o=c[n[1]],s=c[n[2]],l=c[n[3]];u=m?P(e,[a,o,s],[t[n[0]],t[n[1]],t[n[2]]])||u:P(null,[z(l,a,r,i),z(l,o,r,i),z(l,s,r,i)],[-1,-1,-1])||u,d=!0}}),d||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function(n){if(h[n[0]]&&h[n[1]]&&!h[n[2]]&&!h[n[3]]){var a,o,s,l=c[n[0]],f=c[n[1]],p=c[n[2]],g=c[n[3]],y=z(p,l,r,i),v=z(p,f,r,i),x=z(g,f,r,i),b=z(g,l,r,i);m?(u=P(e,[l,b,y],[t[n[0]],-1,-1])||u,u=P(e,[f,v,x],[t[n[1]],-1,-1])||u):(a=[y,v,x,b],o=[-1,-1,-1,-1],(s=function(e,t,r){P(null,[a[e],a[t],a[r]],[o[e],o[t],o[r]])})(0,1,2),s(2,3,0)),d=!0}}),d)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(n){if(h[n[0]]&&!h[n[1]]&&!h[n[2]]&&!h[n[3]]){var a=c[n[0]],o=c[n[1]],s=c[n[2]],l=c[n[3]],f=z(o,a,r,i),p=z(s,a,r,i),g=z(l,a,r,i);m?(u=P(e,[a,f,p],[t[n[0]],-1,-1])||u,u=P(e,[a,p,g],[t[n[0]],-1,-1])||u,u=P(e,[a,g,f],[t[n[0]],-1,-1])||u):u=P(null,[f,p,g],[-1,-1,-1])||u,d=!0}}),u}function j(e,t,r,i,n,a,o,s,l,u,c){var h=!1;return p&&(L(e,"A")&&(h=B(null,[t,r,i,a],u,c)||h),L(e,"B")&&(h=B(null,[r,i,n,l],u,c)||h),L(e,"C")&&(h=B(null,[r,a,o,l],u,c)||h),L(e,"D")&&(h=B(null,[i,a,s,l],u,c)||h),L(e,"E")&&(h=B(null,[r,i,a,l],u,c)||h)),m&&(h=B(e,[r,i,a,l],u,c)||h),h}function N(e,t,r,i,n,a,o,s){return[!0===s[0]||R(e,O([t,r,i]),[t,r,i],a,o),!0===s[1]||R(e,O([i,n,t]),[i,n,t],a,o)]}function V(e,t,r,i,n,a,o,s,l){return s?N(e,t,r,n,i,a,o,l):N(e,r,n,i,t,a,o,l)}function U(e,t,r,i,n,a,o){var s,l,u,c,h=!1,d=function(){h=R(e,[s,l,u],[-1,-1,-1],n,a)||h,h=R(e,[u,c,s],[-1,-1,-1],n,a)||h},f=o[0],p=o[1],m=o[2];return f&&(s=I(O([A(t,r-0,i-0)])[0],O([A(t-1,r-0,i-0)])[0],f),l=I(O([A(t,r-0,i-1)])[0],O([A(t-1,r-0,i-1)])[0],f),u=I(O([A(t,r-1,i-1)])[0],O([A(t-1,r-1,i-1)])[0],f),c=I(O([A(t,r-1,i-0)])[0],O([A(t-1,r-1,i-0)])[0],f),d()),p&&(s=I(O([A(t-0,r,i-0)])[0],O([A(t-0,r-1,i-0)])[0],p),l=I(O([A(t-0,r,i-1)])[0],O([A(t-0,r-1,i-1)])[0],p),u=I(O([A(t-1,r,i-1)])[0],O([A(t-1,r-1,i-1)])[0],p),c=I(O([A(t-1,r,i-0)])[0],O([A(t-1,r-1,i-0)])[0],p),d()),m&&(s=I(O([A(t-0,r-0,i)])[0],O([A(t-0,r-0,i-1)])[0],m),l=I(O([A(t-0,r-1,i)])[0],O([A(t-0,r-1,i-1)])[0],m),u=I(O([A(t-1,r-1,i)])[0],O([A(t-1,r-1,i-1)])[0],m),c=I(O([A(t-1,r-0,i)])[0],O([A(t-1,r-0,i-1)])[0],m),d()),h}function q(e,t,r,i,n){for(var a=[],o=0,s=0;sMath.abs(P-k)?[M,P]:[P,k];T=z[0],I=z[1],p=!0,$(r,T,I),p=!1}}var F=[[Math.min(S,k),Math.max(S,k)],[Math.min(M,E),Math.max(M,E)]];["x","y","z"].forEach(function(r){for(var i=[],n=0;n0&&(h.push(p.id),"x"===r?d.push([p.distRatio,0,0]):"y"===r?d.push([0,p.distRatio,0]):d.push([0,0,p.distRatio]))}else c="x"===r?W(1,b-1):"y"===r?W(1,_-1):W(1,w-1);h.length>0&&("x"===r?i[a]=function(e,t,r,i,n){for(var a=[],o=0,s=0;s0&&("x"===r?i[a]=q(null,c,o,s,i[a]):"y"===r?i[a]=G(null,c,o,s,i[a]):i[a]=H(null,c,o,s,i[a]),a++)}var m=e.caps[r];m.show&&m.fill&&(t=m.fill,"x"===r?i[a]=q(null,[0,b-1],o,s,i[a]):"y"===r?i[a]=G(null,[0,_-1],o,s,i[a]):i[a]=H(null,[0,w-1],o,s,i[a]),a++)}}),0===g&&D(),e._meshX=n,e._meshY=a,e._meshZ=o,e._meshIntensity=s,e._Xs=y,e._Ys=v,e._Zs=x}(),e}t.exports={findNearestOnAxis:l,generateIsoMeshes:d,createIsosurfaceTrace:function(e,t){var i=r({gl:e.glplot.gl}),n=new u(e,i,t.uid);return i._trace=n,n.update(t),e.glplot.add(i),n}}}}),fX=m({"src/traces/isosurface/index.js"(e,t){t.exports={attributes:fG(),supplyDefaults:fH().supplyDefaults,calc:fW(),colorbar:{min:"cmin",max:"cmax"},plot:fZ().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:fz(),categories:["gl3d","showLegend"],meta:{}}}}),fK=m({"lib/isosurface.js"(e,t){t.exports=fX()}}),fJ=m({"src/traces/volume/attributes.js"(e,t){var r=tG(),i=fG(),n=fR(),a=X(),o=H().extendFlat,s=t.exports=(0,eH().overrideAll)(o({x:i.x,y:i.y,z:i.z,value:i.value,isomin:i.isomin,isomax:i.isomax,surface:i.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:i.slices,caps:i.caps,text:i.text,hovertext:i.hovertext,xhoverformat:i.xhoverformat,yhoverformat:i.yhoverformat,zhoverformat:i.zhoverformat,valuehoverformat:i.valuehoverformat,hovertemplate:i.hovertemplate,hovertemplatefallback:i.hovertemplatefallback},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:i.colorbar,opacity:i.opacity,opacityscale:n.opacityscale,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");s.x.editType=s.y.editType=s.z.editType=s.value.editType="calc+clearAxisTypes"}}),fQ=m({"src/traces/volume/defaults.js"(e,t){var r=tb(),i=fJ(),n=fH().supplyIsoDefaults,a=fB().opacityscaleDefaults;t.exports=function(e,t,o,s){function l(n,a){return r.coerce(e,t,i,n,a)}n(e,t,o,s,l),a(e,t,s,l)}}}),f0=m({"src/traces/volume/convert.js"(e,t){var r=fd().gl_mesh3d,i=fp().parseColorScale,n=tb().isArrayOrTypedArray,a=ff(),o=t4().extractOpts,s=fY(),l=fZ().findNearestOnAxis,u=fZ().generateIsoMeshes;function c(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.data=null,this.showContour=!1}var h=c.prototype;h.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,r=this.data._meshX[t],i=this.data._meshY[t],a=this.data._meshZ[t],o=this.data._Ys.length,s=this.data._Zs.length,u=l(r,this.data._Xs).id,c=l(i,this.data._Ys).id,h=e.index=l(a,this.data._Zs).id+s*c+s*o*u;e.traceCoordinate=[this.data._meshX[h],this.data._meshY[h],this.data._meshZ[h],this.data._value[h]];var d=this.data.hovertext||this.data.text;return n(d)&&void 0!==d[h]?e.textLabel=d[h]:d&&(e.textLabel=d),!0}},h.update=function(e){var t=this.scene,r=t.fullSceneLayout;function n(e,t,r,i){return t.map(function(t){return e.d2l(t,0,i)*r})}this.data=u(e);var l={positions:s(n(r.xaxis,e._meshX,t.dataScale[0],e.xcalendar),n(r.yaxis,e._meshY,t.dataScale[1],e.ycalendar),n(r.zaxis,e._meshZ,t.dataScale[2],e.zcalendar)),cells:s(e._meshI,e._meshJ,e._meshK),lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,opacityscale:e.opacityscale,contourEnable:e.contour.show,contourColor:a(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading},c=o(e);l.vertexIntensity=e._meshIntensity,l.vertexIntensityBounds=[c.min,c.max],l.colormap=i(e),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var i=r({gl:e.glplot.gl}),n=new c(e,i,t.uid);return i._trace=n,n.update(t),e.glplot.add(i),n}}}),f1=m({"src/traces/volume/index.js"(e,t){t.exports={attributes:fJ(),supplyDefaults:fQ(),calc:fW(),colorbar:{min:"cmin",max:"cmax"},plot:f0(),moduleType:"trace",name:"volume",basePlotModule:fz(),categories:["gl3d","showLegend"],meta:{}}}}),f2=m({"lib/volume.js"(e,t){t.exports=f1()}}),f3=m({"src/traces/mesh3d/defaults.js"(e,t){var r=e1(),i=tb(),n=t1(),a=fq();t.exports=function(e,t,o,s){function l(r,n){return i.coerce(e,t,a,r,n)}function u(e){var t=e.map(function(e){var t=l(e);return t&&i.isArrayOrTypedArray(t)?t:null});return t.every(function(e){return e&&e.length===t[0].length})&&t}if(!u(["x","y","z"])||(u(["i","j","k"]),t.i&&(!t.j||!t.k)||t.j&&(!t.k||!t.i)||t.k&&(!t.i||!t.j))){t.visible=!1;return}r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(e){l(e)}),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in e?(l("intensity"),l("intensitymode"),n(e,t,s,l,{prefix:"",cLetter:"c"})):(t.showscale=!1,"facecolor"in e?l("facecolor"):"vertexcolor"in e?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),t._length=null}}}),f5=m({"src/traces/mesh3d/calc.js"(e,t){var r=t5();t.exports=function(e,t){t.intensity&&r(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}}}),f4=m({"src/traces/mesh3d/convert.js"(e,t){var r=fd().gl_mesh3d,i=fd().delaunay_triangulate,n=fd().alpha_shape,a=fd().convex_hull,o=fp().parseColorScale,s=tb().isArrayOrTypedArray,l=ff(),u=t4().extractOpts,c=fY();function h(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var d=h.prototype;function f(e){for(var t=[],r=e.length,i=0;i=t-.5)return!1;return!0}d.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},d.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var s,h=e.x.length,d=c(p(r.xaxis,e.x,t.dataScale[0],e.xcalendar),p(r.yaxis,e.y,t.dataScale[1],e.ycalendar),p(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!g(e.i,h)||!g(e.j,h)||!g(e.k,h))return;s=c(m(e.i),m(e.j),m(e.k))}else s=0===e.alphahull?a(d):e.alphahull>0?n(e.alphahull,d):function(e,t){for(var r=["x","y","z"].indexOf(e),n=[],a=t.length,o=0;o2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function d(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function f(e,t){var i=e.fullSceneLayout,u=e.dataScale,c=t._len,f={};function p(e,t){var r=i[t],a=u[l[t]];return n.simpleMap(e,function(e){return r.d2l(e)*a})}if(f.vectors=s(p(t._u,"xaxis"),p(t._v,"yaxis"),p(t._w,"zaxis"),c),!c)return{positions:[],cells:[]};var m=p(t._Xs,"xaxis"),g=p(t._Ys,"yaxis"),y=p(t._Zs,"zaxis");if(f.meshgrid=[m,g,y],f.gridFill=t._gridFill,t._slen)f.startingPositions=s(p(t._startsX,"xaxis"),p(t._startsY,"yaxis"),p(t._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),b=h(y),_=Array(x.length*b.length),w=0,T=0;To&&(o=e[0]),e[1]s&&(s=e[1])}for(t in e.arcs.forEach(function(e){for(var t,r=-1,l=e.length;++ro&&(o=t[0]),t[1]s&&(s=t[1])}),e.objects)!function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}(e.objects[t]);return[n,a,o,s]}function n(e,t){var r=t.id,i=t.bbox,n=null==t.properties?{}:t.properties,o=a(e,t);return null==r&&null==i?{type:"Feature",properties:n,geometry:o}:null==i?{type:"Feature",id:r,properties:n,geometry:o}:{type:"Feature",id:r,bbox:i,properties:n,geometry:o}}function a(e,t){var i=r(e.transform),n=e.arcs;function a(e){return i(e)}function o(e){for(var t=[],r=0,a=e.length;r1)i=function(e,t){var r,i=[],n=[];function a(e){var t=e<0?~e:e;(n[t]||(n[t]=[])).push({i:e,g:r})}function o(e){e.forEach(a)}function s(e){e.forEach(o)}return function e(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":o(t.arcs);break;case"MultiLineString":case"Polygon":s(t.arcs);break;case"MultiPolygon":t.arcs.forEach(s)}}(e),n.forEach(null==t?function(e){i.push(e[0].i)}:function(e){t(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(t,r);else for(n=0,i=Array(a=e.arcs.length);n1)for(var a,s,u=1,c=l(n[0]);uc&&(s=n[0],n[0]=n[u],n[u]=s,c=a);return n}).filter(function(e){return e.length>0})}}function u(e,t){for(var r=0,i=e.length;r>>1;e[n]=2))throw Error("n must be ≥2");var r,n=(l=e.bbox||i(e))[0],a=l[1],o=l[2],s=l[3];t={scale:[o-n?(o-n)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[n,a]}}var l,u,h=c(t),d=e.objects,f={};function p(e){return h(e)}for(u in d)f[u]=function e(t){var r;switch(t.type){case"GeometryCollection":r={type:"GeometryCollection",geometries:t.geometries.map(e)};break;case"Point":r={type:"Point",coordinates:p(t.coordinates)};break;case"MultiPoint":r={type:"MultiPoint",coordinates:t.coordinates.map(p)};break;default:return t}return null!=t.id&&(r.id=t.id),null!=t.bbox&&(r.bbox=t.bbox),null!=t.properties&&(r.properties=t.properties),r}(d[u]);return{type:"Topology",bbox:l,transform:t,objects:f,arcs:e.arcs.map(function(e){var t,r=0,i=1,n=e.length,a=Array(n);for(a[0]=h(e[0],0);++rtypeof t?e:(r=r||self).topojson=r.topojson||{})}}),pm=m({"src/lib/topojson_utils.js"(e,t){var r=t.exports={},i=pf().locationmodeToLayer,n=pp().feature;r.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(e,t){return e+=e.endsWith("/")?"":"/",`${e}${t}.json`},r.getTopojsonFeatures=function(e,t){var r=i[e.locationmode],a=t.objects[r];return n(t,a).features}}}),pg=m({"src/lib/geojson_utils.js"(e){var t=L().BADNUM;e.calcTraceToLineCoords=function(e){for(var r=e[0].trace,i=r.connectgaps,n=[],a=[],o=0;o0&&(n.push(a),a=[])}return a.length>0&&n.push(a),n},e.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},e.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=Array(e.length),r=0;r{for(var i in t)r(e,i,{get:t[i],enumerable:!0})})(o,{COUNTRIES:()=>s,byAlpha2:()=>p,byAlpha3:()=>f,byM49:()=>m,createLookup:()=>u,lookup:()=>h,lookupAlpha3:()=>d,sanitize:()=>l}),t.exports=((e,t,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of n(t))a.call(e,s)||void 0===s||r(e,s,{get:()=>t[s],enumerable:!(o=i(t,s))||o.enumerable});return e})(r({},"__esModule",{value:!0}),o);var s=[{iso3:"ABW",iso2:"AW",m49:"533",name:"Aruba",aliases:["\uD83C\uDDE6\uD83C\uDDFC","country of aruba","land aruba","pais aruba"]},{iso3:"AFG",iso2:"AF",m49:"004",name:"Afghanistan",aliases:["\uD83C\uDDE6\uD83C\uDDEB","affghanistan","affghanisthan","affghaunistan","afghania","afghanisthan","afghaunistan","afghaunistaun","afgoniston","de afghanistan islami jumhuriyat","owganystan","афғонистон","أفغانستان","افغانستان","د افغانستان اسلامی جمهوریت"]},{iso3:"AGO",iso2:"AO",m49:"024",name:"Angola",aliases:["\uD83C\uDDE6\uD83C\uDDF4","republic of angola","republica de angola"]},{iso3:"AIA",iso2:"AI",m49:"660",name:"Anguilla",aliases:["\uD83C\uDDE6\uD83C\uDDEE","malliouhana"]},{iso3:"ALA",iso2:"AX",m49:"248",name:"\xc5land Islands",aliases:["\uD83C\uDDE6\uD83C\uDDFD","aaland","aaland islands","ahvenanmaa","aland","aland isles","aland region","alands lan","landskapet aland"]},{iso3:"ALB",iso2:"AL",m49:"008",name:"Albania",aliases:["\uD83C\uDDE6\uD83C\uDDF1","peoples republic of albania","peoples socialist republic of albania","republic of albania","republika e shqiperise","shqiperi","shqiperia","shqiperise","socialist republic of albania"]},{iso3:"AND",iso2:"AD",m49:"020",name:"Andorra",aliases:["\uD83C\uDDE6\uD83C\uDDE9","el pais dels pirineus","les valls dandorra","principality of andorra","principality of the valleys of andorra","principat dandorra","valls dandorra"]},{iso3:"ARE",iso2:"AE",m49:"784",name:"United Arab Emirates",aliases:["\uD83C\uDDE6\uD83C\uDDEA","emirates","uae","الإمارات","الإمارات العربية المتحدة","الامارات","الامارات العربية المتحدة","دولة الإمارات العربية المتحدة"]},{iso3:"ARG",iso2:"AR",m49:"032",name:"Argentina",aliases:["\uD83C\uDDE6\uD83C\uDDF7","argentine republic","nacion argentina","republic of argentina","republica argentina"]},{iso3:"ARM",iso2:"AM",m49:"051",name:"Armenia",aliases:["\uD83C\uDDE6\uD83C\uDDF2","hayastan","hayastani hanrapetutyun","republic of armenia","հայաստան","հայաստանի հանրապետություն","հայք","հհ"]},{iso3:"ASM",iso2:"AS",m49:"016",name:"American Samoa",aliases:["\uD83C\uDDE6\uD83C\uDDF8","amerika samoa","east samoa","samoa american","samoa united states","territory of american samoa","us samoa"]},{iso3:"ATA",iso2:"AQ",m49:"010",name:"Antarctica",aliases:["\uD83C\uDDE6\uD83C\uDDF6","antarctica treaty area"]},{iso3:"ATF",iso2:"TF",m49:"260",name:"French Southern Territories",aliases:["\uD83C\uDDF9\uD83C\uDDEB","taaf","terres australes et antarctiques francaises","terres australes francaises","terres australes francaises les","territoire des terres australes et antarctiques francaises"]},{iso3:"ATG",iso2:"AG",m49:"028",name:"Antigua and Barbuda",aliases:["\uD83C\uDDE6\uD83C\uDDEC","antigua","antigua barbuda","barbuda"]},{iso3:"AUS",iso2:"AU",m49:"036",name:"Australia",aliases:["\uD83C\uDDE6\uD83C\uDDFA","commonwealth of australia","new holland","new hollandia","nova hollandia"]},{iso3:"AUT",iso2:"AT",m49:"040",name:"Austria",aliases:["\uD83C\uDDE6\uD83C\uDDF9","osterreich","republic of austria","republik osterreich","zweite republik"]},{iso3:"AZE",iso2:"AZ",m49:"031",name:"Azerbaijan",aliases:["\uD83C\uDDE6\uD83C\uDDFF","azərbaycan","azərbaycan respublikası","republic of azerbaijan"]},{iso3:"BDI",iso2:"BI",m49:"108",name:"Burundi",aliases:["\uD83C\uDDE7\uD83C\uDDEE","gouvernement du burundi","la republique du burundi","republic of burundi","republika yu burundi","republika yuburundi","republique du burundi","repuburika yuburundi","uburundi"]},{iso3:"BEL",iso2:"BE",m49:"056",name:"Belgium",aliases:["\uD83C\uDDE7\uD83C\uDDEA","belg","belgie","belgien","belgique","kingdom of belgium","konigreich belgien","koninkrijk belgie","royaume de belgique"]},{iso3:"BEN",iso2:"BJ",m49:"204",name:"Benin",aliases:["\uD83C\uDDE7\uD83C\uDDEF","dahomey","la republique du benin","republic of benin","republique du benin"]},{iso3:"BES",iso2:"BQ",m49:"535",name:"Bonaire, Sint Eustatius and Saba",aliases:["\uD83C\uDDE7\uD83C\uDDF6","bes eilanden","bes islands","bijzondere gemeente","bonaire","bonaire saint eustatius and saba","bonaire sint eustatius en saba","caraibisch nederland","caribbean netherlands","caribisch nederland","hulanda karibense","islanan bes","netherlands antilles","saba","sint eustatius"]},{iso3:"BFA",iso2:"BF",m49:"854",name:"Burkina Faso",aliases:["\uD83C\uDDE7\uD83C\uDDEB","republic of burkina faso","republic of upper volta"]},{iso3:"BGD",iso2:"BD",m49:"050",name:"Bangladesh",aliases:["\uD83C\uDDE7\uD83C\uDDE9","bangla desh","east pakistan","gonaoprojatontri bangladesh","peoples republic of bangladesh","গণপ্রজাতন্ত্রী বাংলাদেশ","বাংলা দেশ","বাংলাদেশ","বিডি"]},{iso3:"BGR",iso2:"BG",m49:"100",name:"Bulgaria",aliases:["\uD83C\uDDE7\uD83C\uDDEC","bulgarian republic","republic of bulgaria","republika bulgaria","republika bulgariya","бг","българия","република българия"]},{iso3:"BHR",iso2:"BH",m49:"048",name:"Bahrain",aliases:["\uD83C\uDDE7\uD83C\uDDED","bahrein islands","kingdom of bahrain","البحرين","دولة البحرين","مملكة البحرين"]},{iso3:"BHS",iso2:"BS",m49:"044",name:"Bahamas",aliases:["\uD83C\uDDE7\uD83C\uDDF8","bahama islands","bahamas the","commonwealth of the bahamas"]},{iso3:"BIH",iso2:"BA",m49:"070",name:"Bosnia and Herzegovina",aliases:["\uD83C\uDDE7\uD83C\uDDE6","bosna","bosna i hercegovina","bosnia","bosnia and hercegovina","bosnia herzegovina","hercegovina","herzegovina","бих","босна","босна и херцеговина","бх"]},{iso3:"BLM",iso2:"BL",m49:"652",name:"Saint Barth\xe9lemy",aliases:["\uD83C\uDDE7\uD83C\uDDF1","collectivite doutre mer de saint barthelemy","collectivite territoriale de saint barthelemy","collectivity of saint barthelemy","saint barth","saint barths","saint barts","saint bartz"]},{iso3:"BLR",iso2:"BY",m49:"112",name:"Belarus",aliases:["\uD83C\uDDE7\uD83C\uDDFE","republic of belarus","respublika belarus","respublika byelarus","беларуская рэспубліка","беларусь","белая русь","белоруссия","рб","республика беларусь","рэспубліка беларусь"]},{iso3:"BLZ",iso2:"BZ",m49:"084",name:"Belize",aliases:["\uD83C\uDDE7\uD83C\uDDFF"]},{iso3:"BMU",iso2:"BM",m49:"060",name:"Bermuda",aliases:["\uD83C\uDDE7\uD83C\uDDF2","barmuda","barmuda i","barmuda isl","barmuda islands","barmudas","bermoothes","bermuda islands","bermudas","bermudian islands","colony of bermuda","devils isles","isle of devils","somers islands","somers isles","summers isles","territory of bermuda","virgineola"]},{iso3:"BOL",iso2:"BO",m49:"068",name:"Bolivia (Plurinational State of)",aliases:["\uD83C\uDDE7\uD83C\uDDF4","bolivia","bulibiya","estado plurinacional de bolivia","plurinational state of bolivia","puliwya","republic of bolivia","republica de bolivia","volivia","wuliwiya","wuliwya"]},{iso3:"BRA",iso2:"BR",m49:"076",name:"Brazil",aliases:["\uD83C\uDDE7\uD83C\uDDF7","brasil","federative republic of brazil","pindorama","republica federativa do brasil"]},{iso3:"BRB",iso2:"BB",m49:"052",name:"Barbados",aliases:["\uD83C\uDDE7\uD83C\uDDE7","barbadoes"]},{iso3:"BRN",iso2:"BN",m49:"096",name:"Brunei Darussalam",aliases:["\uD83C\uDDE7\uD83C\uDDF3","brunei","nation of brunei the abode of peace","negara brunei darussalam"]},{iso3:"BTN",iso2:"BT",m49:"064",name:"Bhutan",aliases:["\uD83C\uDDE7\uD83C\uDDF9","kingdom of bhutan","འབྲུག","འབྲུག་ཡུལ་","འབྲུགཡུལ་་"]},{iso3:"BVT",iso2:"BV",m49:"074",name:"Bouvet Island",aliases:["\uD83C\uDDE7\uD83C\uDDFB"]},{iso3:"BWA",iso2:"BW",m49:"072",name:"Botswana",aliases:["\uD83C\uDDE7\uD83C\uDDFC","lefatshe la botswana","republic of botswana"]},{iso3:"CAF",iso2:"CF",m49:"140",name:"Central African Republic",aliases:["\uD83C\uDDE8\uD83C\uDDEB","centrafricaine republique","centrafrique","central africa","kodorosese ti beafrika","la republique","rep centrafrique","republique centrafricaine"]},{iso3:"CAN",iso2:"CA",m49:"124",name:"Canada",aliases:["\uD83C\uDDE8\uD83C\uDDE6","le canada"]},{iso3:"CCK",iso2:"CC",m49:"166",name:"Cocos (Keeling) Islands",aliases:["\uD83C\uDDE8\uD83C\uDDE8","cocos islands","keeling islands","territory of the cocos keeling islands"]},{iso3:"CHE",iso2:"CH",m49:"756",name:"Switzerland",aliases:["\uD83C\uDDE8\uD83C\uDDED","confederation helvetique","confederation suisse","confederazione elvetica","confederazione svizzera","confederaziun svizra","confoederatio helvetica","confœderatio helvetica","eidgenossenschaft","elvezia","helvetie","la confederation suisse","schweiz","schweizerische eidgenossenschaft","suisse","svizra","svizzera","swiss","swiss confederation"]},{iso3:"CHL",iso2:"CL",m49:"152",name:"Chile",aliases:["\uD83C\uDDE8\uD83C\uDDF1","republic of chile","republica de chile"]},{iso3:"CHN",iso2:"CN",m49:"156",name:"China",aliases:["\uD83C\uDDE8\uD83C\uDDF3","china pr","peoples republic of china","pr china","prc","中华人民共和国","中国"]},{iso3:"CIV",iso2:"CI",m49:"384",name:"C\xf4te d'Ivoire",aliases:["\uD83C\uDDE8\uD83C\uDDEE","cote ivoire","ivory coast","republic of cote divoire","republic of ivory coast","republic of the ivory coast","republique de cote divoire"]},{iso3:"CMR",iso2:"CM",m49:"120",name:"Cameroon",aliases:["\uD83C\uDDE8\uD83C\uDDF2","cameroun","la republique du cameroun","republic of cameroon","republique du cameroun"]},{iso3:"COD",iso2:"CD",m49:"180",name:"Democratic Republic of the Congo",aliases:["\uD83C\uDDE8\uD83C\uDDE9","congo belge","congo democratic republic of the","congo kinshasa","dem rep congo","dem republic of congo","dem republic of the congo","democratic republic of congo","dr congo","drc","rd congo","rep demcongo","republic of the congo","republique democratique du congo","republique du zaire","zaire"]},{iso3:"COG",iso2:"CG",m49:"178",name:"Congo",aliases:["\uD83C\uDDE8\uD83C\uDDEC","congo brazza","congo brazzaville","congo republic","rep congo","republic of congo","republique du congo"]},{iso3:"COK",iso2:"CK",m49:"184",name:"Cook Islands",aliases:["\uD83C\uDDE8\uD83C\uDDF0","cook group","hervey islands"]},{iso3:"COL",iso2:"CO",m49:"170",name:"Colombia",aliases:["\uD83C\uDDE8\uD83C\uDDF4","republic of colombia","republica de colombia"]},{iso3:"COM",iso2:"KM",m49:"174",name:"Comoros",aliases:["\uD83C\uDDF0\uD83C\uDDF2","comores","comores archipel","etat comorien","lunion des comores","republique des comores","republique federale et islamique des comores","republique federale islamique des comores","territoire des comores","union des comores","union of the comoros","إتحاد القمر","اتحاد جزر القمر","الاتحاد القمري","القمر","جزر القمر","جمهورية القمر المتحدة","جمهورية جزر القمر الاتحادية الإسلامية","جمهورية جزرالقمر المتحدة"]},{iso3:"CPV",iso2:"CV",m49:"132",name:"Cabo Verde",aliases:["\uD83C\uDDE8\uD83C\uDDFB","cape verde","cape verde islands","kab verd","kabu verdi","kauberdi","republic of cabo verde","republic of cape verde","republica de cabo verde"]},{iso3:"CRI",iso2:"CR",m49:"188",name:"Costa Rica",aliases:["\uD83C\uDDE8\uD83C\uDDF7","republic of costa rica","republica de costa rica"]},{iso3:"CUB",iso2:"CU",m49:"192",name:"Cuba",aliases:["\uD83C\uDDE8\uD83C\uDDFA","isla juana","republic of cuba","republica de cuba"]},{iso3:"CUW",iso2:"CW",m49:"531",name:"Cura\xe7ao",aliases:["\uD83C\uDDE8\uD83C\uDDFC","corsou","corsouw","corsow","country of curacao","curacau","curacoa","curazao","curaςao","curocao","island territory of curacao","korsou","land curacao","pais korsou"]},{iso3:"CXR",iso2:"CX",m49:"162",name:"Christmas Island",aliases:["\uD83C\uDDE8\uD83C\uDDFD","christmas island other territories","christmas island other territories australia","territory of christmas island"]},{iso3:"CYM",iso2:"KY",m49:"136",name:"Cayman Islands",aliases:["\uD83C\uDDF0\uD83C\uDDFE","caymans"]},{iso3:"CYP",iso2:"CY",m49:"196",name:"Cyprus",aliases:["\uD83C\uDDE8\uD83C\uDDFE","greek administration of southern cyprus","greek cypriot state","guney kıbrıs","guney kıbrıs rum cumhuriyeti","guney kıbrıs rum kesimi","guney kıbrıs rum yonetimi","kipriaki dhimokratia","kıbrıs","kıbrıs cumhuriyeti","kıbrıs rum kesimi","kypriaki dimokratia","kypros","republic of cyprus","κυπριακη δημοκρατια","κυπρος"]},{iso3:"CZE",iso2:"CZ",m49:"203",name:"Czechia",aliases:["\uD83C\uDDE8\uD83C\uDDFF","ceska republika","ceske kraje","ceske uzemi","ceske zeme","cesko","cr","czech republic"]},{iso3:"DEU",iso2:"DE",m49:"276",name:"Germany",aliases:["\uD83C\uDDE9\uD83C\uDDEA","br deutschland","bundesrepublik","bundesrepublik deutschland","deutschland","federal republic of germany"]},{iso3:"DJI",iso2:"DJ",m49:"262",name:"Djibouti",aliases:["\uD83C\uDDE9\uD83C\uDDEF","la republique de djibouti","republic of djibouti","republique de djibouti","جمهورية جيبوتي","جيبوتي"]},{iso3:"DMA",iso2:"DM",m49:"212",name:"Dominica",aliases:["\uD83C\uDDE9\uD83C\uDDF2","commonwealth of dominica","island of dominica","waitu kubuli"]},{iso3:"DNK",iso2:"DK",m49:"208",name:"Denmark",aliases:["\uD83C\uDDE9\uD83C\uDDF0","dania","danmark","denmark proper","kongeriget danmark","metropolitan denmark"]},{iso3:"DOM",iso2:"DO",m49:"214",name:"Dominican Republic",aliases:["\uD83C\uDDE9\uD83C\uDDF4","dominicana","domrep","haiti espanol","quisqueya","republica de santo domingo","republica dominicana","santo domingo"]},{iso3:"DZA",iso2:"DZ",m49:"012",name:"Algeria",aliases:["\uD83C\uDDE9\uD83C\uDDFF","peoples democratic republic of algeria","الجزائر","الجزاير","الجمهورية الجزائرية الديمقراطية الشعبية","الدزاير","دزاير"]},{iso3:"ECU",iso2:"EC",m49:"218",name:"Ecuador",aliases:["\uD83C\uDDEA\uD83C\uDDE8","ecuadorian state","el ecuador","estado ecuatoriano","republic of ecuador","republic of equator","republic of the equator","republica del ecuador"]},{iso3:"EGY",iso2:"EG",m49:"818",name:"Egypt",aliases:["\uD83C\uDDEA\uD83C\uDDEC","arab rep egypt","arab republic of egypt","rep egypt","republic of egypt","جمهورية مصر العربية","مصر"]},{iso3:"ERI",iso2:"ER",m49:"232",name:"Eritrea",aliases:["\uD83C\uDDEA\uD83C\uDDF7","ertra","hagere ertra","hagere iertra","iertra","iritriya","state of eritrea","إرتريا","إريتريا","ارتريا","ارتيريا","اريتريا","دولة إرتريا","دولة إريتريا","ሃገረ ኤርትራ","ኤርትራ"]},{iso3:"ESH",iso2:"EH",m49:"732",name:"Western Sahara",aliases:["\uD83C\uDDEA\uD83C\uDDED","southern provinces","spanish sahara","west sahara"]},{iso3:"ESP",iso2:"ES",m49:"724",name:"Spain",aliases:["\uD83C\uDDEA\uD83C\uDDF8","espana","estado espanol","kingdom of spain","reino de espana"]},{iso3:"EST",iso2:"EE",m49:"233",name:"Estonia",aliases:["\uD83C\uDDEA\uD83C\uDDEA","eesti","eesti noukogude sotsialistlik vabariik","eesti vabariik","estland","republic of estonia"]},{iso3:"ETH",iso2:"ET",m49:"231",name:"Ethiopia",aliases:["\uD83C\uDDEA\uD83C\uDDF9","federal democratic republic of ethiopia","ityopiya","yeityopiya federalawi demokrasiyawi ripeblik","yeityopiya hizbawi dimokrasiyawi ripublik","ኢትዮጵያ","የኢትዮጵያ ፌዴራላዊ ዴሞክራሲያዊ ሪፐብሊክ"]},{iso3:"FIN",iso2:"FI",m49:"246",name:"Finland",aliases:["\uD83C\uDDEB\uD83C\uDDEE","republic of finland","republiken finland","suomen tasavalta","suomi"]},{iso3:"FJI",iso2:"FJ",m49:"242",name:"Fiji",aliases:["\uD83C\uDDEB\uD83C\uDDEF","fiji ganarajya","matanitu ko viti","matanitu tugalala o viti","republic of fiji","republic of the fiji islands","viti"]},{iso3:"FLK",iso2:"FK",m49:"238",name:"Falkland Islands (Malvinas)",aliases:["\uD83C\uDDEB\uD83C\uDDF0","colony of the falkland islands","falkland islands","falklands","islas malvinas","malvinas","malvinas islands"]},{iso3:"FRA",iso2:"FR",m49:"250",name:"France",aliases:["\uD83C\uDDEB\uD83C\uDDF7","fr","french republic","la france","la republique francaise","lhexagone","republique francaise"]},{iso3:"FRO",iso2:"FO",m49:"234",name:"Faroe Islands",aliases:["\uD83C\uDDEB\uD83C\uDDF4","faer oer","f\xe6r\xf8","faeroe is","faeroe islands","faeroe isles","f\xe6r\xf8erne","faeroes","far oer","faroe island","faroe isles","faroes","faroese islands","f\xf8roya","f\xf8royar","f\xf8royum"]},{iso3:"FSM",iso2:"FM",m49:"583",name:"Micronesia (Federated States of)",aliases:["\uD83C\uDDEB\uD83C\uDDF2","fed sts micronesia","fed sts of micronesia","federated states of micronesia","federated states of micronesia fsm","micronesia"]},{iso3:"GAB",iso2:"GA",m49:"266",name:"Gabon",aliases:["\uD83C\uDDEC\uD83C\uDDE6","gabonese republic","la republique gabonaise","le gabon","republique du gabon","republique gabonaise"]},{iso3:"GBR",iso2:"GB",m49:"826",name:"United Kingdom of Great Britain and Northern Ireland",aliases:["\uD83C\uDDEC\uD83C\uDDE7","britain","england","great britain","great britain and northern ireland","northern ireland","scotland","uk","united kingdom","wales"]},{iso3:"GEO",iso2:"GE",m49:"268",name:"Georgia",aliases:["\uD83C\uDDEC\uD83C\uDDEA","georgia country","republic of georgia","sakartvelo","қырҭтәыла","საქართველო","საქართველოს რესპუბლიკა"]},{iso3:"GGY",iso2:"GG",m49:"831",name:"Guernsey",aliases:["\uD83C\uDDEC\uD83C\uDDEC","bailiwick of guernsey","bailliage de guernesey","bailliage de guernesi","giernesi","great britain guernsey","guernesey","lisia"]},{iso3:"GHA",iso2:"GH",m49:"288",name:"Ghana",aliases:["\uD83C\uDDEC\uD83C\uDDED","republic of ghana"]},{iso3:"GIB",iso2:"GI",m49:"292",name:"Gibraltar",aliases:["\uD83C\uDDEC\uD83C\uDDEE","rock of gibraltar"]},{iso3:"GIN",iso2:"GN",m49:"324",name:"Guinea",aliases:["\uD83C\uDDEC\uD83C\uDDF3","guinee","guinee conakry","republic of guinea","republique de guinee"]},{iso3:"GLP",iso2:"GP",m49:"312",name:"Guadeloupe",aliases:["\uD83C\uDDEC\uD83C\uDDF5"]},{iso3:"GMB",iso2:"GM",m49:"270",name:"Gambia",aliases:["\uD83C\uDDEC\uD83C\uDDF2","islamic republic of the gambia","republic of the gambia"]},{iso3:"GNB",iso2:"GW",m49:"624",name:"Guinea-Bissau",aliases:["\uD83C\uDDEC\uD83C\uDDFC","guine bissau","republic of guinea bissau","republica da guine bissau"]},{iso3:"GNQ",iso2:"GQ",m49:"226",name:"Equatorial Guinea",aliases:["\uD83C\uDDEC\uD83C\uDDF6","guine equatorial","guinea ecuatorial","guinea espanola","guinee equat","guinee equatoriale","la republique de guinee equatoriale","posesiones espanolas del golfo de guinea","provincia de la guinea ecuatorial","republic of equatorial guinea","republica da guine equatorial","republica de guinea ecuatorial","territorios espanoles del golfo de guinea"]},{iso3:"GRC",iso2:"GR",m49:"300",name:"Greece",aliases:["\uD83C\uDDEC\uD83C\uDDF7","ellada","ellas","elliniki dhimokratia","elliniki dimokratia","greek republic","hellas","hellas greece","hellenic republic","vasilion tis ellados","δημοκρατια της ελλαδας","δημοκρατια της ελλαδος","ελλαδα","ελλας","ελλας ελλαδα","ελληνικη δημοκρατια"]},{iso3:"GRD",iso2:"GD",m49:"308",name:"Grenada",aliases:["\uD83C\uDDEC\uD83C\uDDE9"]},{iso3:"GRL",iso2:"GL",m49:"304",name:"Greenland",aliases:["\uD83C\uDDEC\uD83C\uDDF1","kalaallit nunaat"]},{iso3:"GTM",iso2:"GT",m49:"320",name:"Guatemala",aliases:["\uD83C\uDDEC\uD83C\uDDF9","republic of guatemala","republica de guatemala"]},{iso3:"GUF",iso2:"GF",m49:"254",name:"French Guiana",aliases:["\uD83C\uDDEC\uD83C\uDDEB","fr 973","guiana","guiana france","guyane","guyane francaise","gwiyann","gwiyann franse","lagwiyann"]},{iso3:"GUM",iso2:"GU",m49:"316",name:"Guam",aliases:["\uD83C\uDDEC\uD83C\uDDFA","guahan","guam usa","islan guahan","island of guam","territory of guam"]},{iso3:"GUY",iso2:"GY",m49:"328",name:"Guyana",aliases:["\uD83C\uDDEC\uD83C\uDDFE","co operative republic of guyana","republic of guyana"]},{iso3:"HKG",iso2:"HK",m49:"344",name:"Hong Kong",aliases:["\uD83C\uDDED\uD83C\uDDF0","hksar","hong kong sar","hong kong special administrative region","hong kong special administrative region of the peoples republic of china","hongkong"]},{iso3:"HMD",iso2:"HM",m49:"334",name:"Heard Island and McDonald Islands",aliases:["\uD83C\uDDED\uD83C\uDDF2","heard","heard & mcdonald islands","heard and macdonald islands","heard island","himi","mcdonald","mcdonald island","territory of heard island and mcdonald islands"]},{iso3:"HND",iso2:"HN",m49:"340",name:"Honduras",aliases:["\uD83C\uDDED\uD83C\uDDF3","guaymuras","higueras","honduran republic","republic of honduras","republica de honduras"]},{iso3:"HRV",iso2:"HR",m49:"191",name:"Croatia",aliases:["\uD83C\uDDED\uD83C\uDDF7","hrvatska","republic of croatia","republika hrvatska"]},{iso3:"HTI",iso2:"HT",m49:"332",name:"Haiti",aliases:["\uD83C\uDDED\uD83C\uDDF9","ayiti","haitian republic","la republique dhaiti","repiblik d ayiti","republic of haiti","republique dhaiti"]},{iso3:"HUN",iso2:"HU",m49:"348",name:"Hungary",aliases:["\uD83C\uDDED\uD83C\uDDFA","a magyar koztarsasag","a magyar nepkoztarsasag","harmadik magyar koztarsasag","magyar koztarsasag","magyar nepkoztarsasag","magyarorszag","mo"]},{iso3:"IDN",iso2:"ID",m49:"360",name:"Indonesia",aliases:["\uD83C\uDDEE\uD83C\uDDE9","negara kesatuan republik indonesia","nkri","republic of indonesia","republik indonesia"]},{iso3:"IMN",iso2:"IM",m49:"833",name:"Isle of Man",aliases:["\uD83C\uDDEE\uD83C\uDDF2","ellan vannin","i man","i mann","i mannin","isle of mann","mann","mannin","manx"]},{iso3:"IND",iso2:"IN",m49:"356",name:"India",aliases:["\uD83C\uDDEE\uD83C\uDDF3","al hind","bharat","bharat ganarajya","bharata","bharatvarsh","hindoostan","hindustan","indostan","republic of india","tenjiku","tianzhu","आर्यवर्त","इंडिया","इण्डिया","भारत","भारत गणराज्य","भारतवर्ष","हिंदुस्तान","हिन्दुस्तान","हिन्दोस्तान"]},{iso3:"IOT",iso2:"IO",m49:"086",name:"British Indian Ocean Territory",aliases:["\uD83C\uDDEE\uD83C\uDDF4","biot"]},{iso3:"IRL",iso2:"IE",m49:"372",name:"Ireland",aliases:["\uD83C\uDDEE\uD83C\uDDEA","eire","hibernia","irish republic","poblacht na heireann","republic of ireland","southern ireland"]},{iso3:"IRN",iso2:"IR",m49:"364",name:"Iran (Islamic Republic of)",aliases:["\uD83C\uDDEE\uD83C\uDDF7","iran","islamic rep iran","islamic republic of iran","persia","ایران","ایرانزمین","پارس","جمهوری اسلامی ايران","جمهوری اسلامی ایران","كشور شاهنشاهی ايران"]},{iso3:"IRQ",iso2:"IQ",m49:"368",name:"Iraq",aliases:["\uD83C\uDDEE\uD83C\uDDF6","eraq","iraqe","komar i eraq","republic of iraq","الجمهورية العراقية","العراق","جمهورية العراق","عراق","عێراق"]},{iso3:"ISL",iso2:"IS",m49:"352",name:"Iceland",aliases:["\uD83C\uDDEE\uD83C\uDDF8","icelandic republic","island","ly\xf0veldi\xf0 island","republic of iceland","ysland"]},{iso3:"ISR",iso2:"IL",m49:"376",name:"Israel",aliases:["\uD83C\uDDEE\uD83C\uDDF1","erez yisrael","medinat yisrael","state of israel","yisrael","ישראל","מדינת ישראל"]},{iso3:"ITA",iso2:"IT",m49:"380",name:"Italy",aliases:["\uD83C\uDDEE\uD83C\uDDF9","il bel paese","italia","italian republic","repubblica italiana","republic of italy"]},{iso3:"JAM",iso2:"JM",m49:"388",name:"Jamaica",aliases:["\uD83C\uDDEF\uD83C\uDDF2","commonwealth of jamaica","jamieka","jomieka","jumieka"]},{iso3:"JEY",iso2:"JE",m49:"832",name:"Jersey",aliases:["\uD83C\uDDEF\uD83C\uDDEA","bailliage de jerri","bailliage de jersey","balliwick of jersey","i iersey","i jersey","iersey","iersey i","isle of jersey","jerri","jersey i","jersey island"]},{iso3:"JOR",iso2:"JO",m49:"400",name:"Jordan",aliases:["\uD83C\uDDEF\uD83C\uDDF4","giordania","hashemite kingdom of jordan","kingdom of jordan","state of jordan","yarden","الأردن","الاردن","المملكة الأردنية الهاشمية","المملكة الاردنية الهاشمية"]},{iso3:"JPN",iso2:"JP",m49:"392",name:"Japan",aliases:["\uD83C\uDDEF\uD83C\uDDF5","state of japan","あきつしま","おおやしま","しきしま","ジャパン","しんしゅう","にっぽん","にっぽんこく","にほん","にほんこく","ひいずるくに","ふそう","大八州","扶木之地","扶桑","扶桑国","敷島","日出る国","日本","榑木之地","瑞穂国","神州","秋津島","葦原中国"]},{iso3:"KAZ",iso2:"KZ",m49:"398",name:"Kazakhstan",aliases:["\uD83C\uDDF0\uD83C\uDDFF","qazaqstan","qazaqstan respublikasy","republic of kazakhstan","казахстан","қазақстан","қазақстан республикасы","республика казахстан","рк"]},{iso3:"KEN",iso2:"KE",m49:"404",name:"Kenya",aliases:["\uD83C\uDDF0\uD83C\uDDEA","jamhuri ya kenya","republic of kenya"]},{iso3:"KGZ",iso2:"KG",m49:"417",name:"Kyrgyzstan",aliases:["\uD83C\uDDF0\uD83C\uDDEC","kyrgyz republic","kyrgyz respublikasy","kyrgyzstan respublikasy","кр","кыргыз республикасы","кыргызстан"]},{iso3:"KHM",iso2:"KH",m49:"116",name:"Cambodia",aliases:["\uD83C\uDDF0\uD83C\uDDED","camboya","campuchia","kambodzha","kamboja","kampuchea","kingdom of cambodia","កម្ពុជា","ព្រះរាជាណាចក្រកម្ពុជា"]},{iso3:"KIR",iso2:"KI",m49:"296",name:"Kiribati",aliases:["\uD83C\uDDF0\uD83C\uDDEE","republic of kiribati"]},{iso3:"KNA",iso2:"KN",m49:"659",name:"Saint Kitts and Nevis",aliases:["\uD83C\uDDF0\uD83C\uDDF3","federation of saint christopher and nevis","federation of saint kitts and nevis","kitts & nevis","nevis","saint christopher","saint christopher and nevis","saint kitts"]},{iso3:"KOR",iso2:"KR",m49:"410",name:"Republic of Korea",aliases:["\uD83C\uDDF0\uD83C\uDDF7","korea","korea republic","korea republic of","korea south","rep korea","s korea","south korea","taehan minguk","남조선","남한","대한","대한민국","코리아","한국"]},{iso3:"KWT",iso2:"KW",m49:"414",name:"Kuwait",aliases:["\uD83C\uDDF0\uD83C\uDDFC","state of kuwait","الكويت","دولة الكويت"]},{iso3:"LAO",iso2:"LA",m49:"418",name:"Lao People's Democratic Republic",aliases:["\uD83C\uDDF1\uD83C\uDDE6","laos","sathalanalat paxathipatai paxaxon lao","ສາທາລະນະລັດ ປະຊາທິປະໄຕ ປະຊາຊົນລາວ","ປະເທດລາວ","ລາວ"]},{iso3:"LBN",iso2:"LB",m49:"422",name:"Lebanon",aliases:["\uD83C\uDDF1\uD83C\uDDE7","lebanese republic","republic of lebanon","state of lebanon","الجمهورية اللبنانية","لبنان"]},{iso3:"LBR",iso2:"LR",m49:"430",name:"Liberia",aliases:["\uD83C\uDDF1\uD83C\uDDF7","liber","republic of liberia"]},{iso3:"LBY",iso2:"LY",m49:"434",name:"Libya",aliases:["\uD83C\uDDF1\uD83C\uDDFE","state of libya","الجماهيرية العربية الليبية الشعبية الإشتراكية","الجمهورية الليبية","الليبي","الليبية","الليبين","دولة ليبيا","ليببيا","ليبي","ليبيا","ليبية"]},{iso3:"LCA",iso2:"LC",m49:"662",name:"Saint Lucia",aliases:["\uD83C\uDDF1\uD83C\uDDE8","hewanorra","iyonola"]},{iso3:"LIE",iso2:"LI",m49:"438",name:"Liechtenstein",aliases:["\uD83C\uDDF1\uD83C\uDDEE","furstentum lichtenstein","furstentum liechtenstein","principality of liechtenstein"]},{iso3:"LKA",iso2:"LK",m49:"144",name:"Sri Lanka",aliases:["\uD83C\uDDF1\uD83C\uDDF0","ceylan","ceylon","democratic socialist republic of sri lanka","ilankaic cananayaka cocalicak kutiyarcu","lankava","prajatantravadi samajavadi janarajaya sri lanka","serendib","srilanka","taprobane","இலங்கை","இலங்கை சனநாயக சோசலிசக் குடியரசு","இலங்கை சனநாயக சோஷலிசக் குடியரசு","ஈழம்","சிலோன்","ලංකාව","ශ්රී ලංකා ප්රජාතන්ත්රවාදී සමාජවාදී ජනරජය","ශ්රී ලංකාව","ශ්‍රී ලංකාව"]},{iso3:"LSO",iso2:"LS",m49:"426",name:"Lesotho",aliases:["\uD83C\uDDF1\uD83C\uDDF8","kingdom of lesotho","mmuso wa lesotho","mountain kingdom"]},{iso3:"LTU",iso2:"LT",m49:"440",name:"Lithuania",aliases:["\uD83C\uDDF1\uD83C\uDDF9","lietuva","lietuvos respublika","republic of lithuania"]},{iso3:"LUX",iso2:"LU",m49:"442",name:"Luxembourg",aliases:["\uD83C\uDDF1\uD83C\uDDFA","grand duche","grand duche de luxembourg","grand duchy of luxembourg","gro\xdfherzogtum luxemburg","groussherzogtum letzebuerg","le grand duche de luxembourg","letzebuerg","letzebuerger land","lux","luxemburg"]},{iso3:"LVA",iso2:"LV",m49:"428",name:"Latvia",aliases:["\uD83C\uDDF1\uD83C\uDDFB","latveja","latvejas republika","latvian republic","latvija","latvijas republika","letmо","letmо vabamо","republic of latvia"]},{iso3:"MAC",iso2:"MO",m49:"446",name:"Macao",aliases:["\uD83C\uDDF2\uD83C\uDDF4","aomen","macao sar","macao special administrative region","macao special administrative region of the peoples republic of china","macau","macau rae da china","macau sar","macau special administrative region","macau special administrative region of the peoples republic of china","raem","regiao administrativa especial de macau","regiao administrativa especial de macau da republica popular da china","中國澳門特別行政區","澳門"]},{iso3:"MAF",iso2:"MF",m49:"663",name:"Saint Martin (French Part)",aliases:["\uD83C\uDDF2\uD83C\uDDEB","collectivite de saint martin","collectivity of saint martin","saint martin","saint martin antilles francaises","saint martin france"]},{iso3:"MAR",iso2:"MA",m49:"504",name:"Morocco",aliases:["\uD83C\uDDF2\uD83C\uDDE6","kingdom of morocco","المغرب","المملكة المغربية","ⴰⵎⵓⵔ ⵏ ⵡⴰⴽⵓⵛ","ⴰⵎⵕⵕⵓⴽ","ⵍⵎⵕⵕⵓⴽ","ⵍⵎⵖⵔⵉⴱ","ⵜⴰⴳⵍⴷⵉⵜ ⵏ ⵍⵎⵖⵔⵉⴱ"]},{iso3:"MCO",iso2:"MC",m49:"492",name:"Monaco",aliases:["\uD83C\uDDF2\uD83C\uDDE8","fort hercule","la principaute de monaco","monaco rattachee au district de menton en 1793","munegu","principality and diocese of monaco","principality of monaco","principatu de munegu","principaute de monaco"]},{iso3:"MDA",iso2:"MD",m49:"498",name:"Republic of Moldova",aliases:["\uD83C\uDDF2\uD83C\uDDE9","moldavia","moldova","moldova republic of","moldova republica","r moldova","rep moldova","republica moldova","молдова"]},{iso3:"MDG",iso2:"MG",m49:"450",name:"Madagascar",aliases:["\uD83C\uDDF2\uD83C\uDDEC","la republique de madagascar","madagasikara","repoblikani madagasikara","republic of madagascar","republique de madagascar"]},{iso3:"MDV",iso2:"MV",m49:"462",name:"Maldives",aliases:["\uD83C\uDDF2\uD83C\uDDFB","dhivehi raajjeyge jumhooriyyaa","republic of maldives","ދިވެހި ރާއްޖެ","ދިވެހިރާއްޖެ","ދިވެހިރާއްޖޭގެ ޖުމުހޫރިއްޔާ","ދިވެހިރާއްޖޭގެ ޖުމްހޫރިއްޔާ"]},{iso3:"MEX",iso2:"MX",m49:"484",name:"Mexico",aliases:["\uD83C\uDDF2\uD83C\uDDFD","estados unidos mejicanos","estados unidos mexicanos","mejico","mexican republic","mexican united states","mexihco","mexihko","mexika sentik wexteyowalko","mexiko","mexko","mexko axkayotl","mexko tlalli","nueva espana","republica mejicana","republica mexicana","united mexican states","united states of mexico"]},{iso3:"MHL",iso2:"MH",m49:"584",name:"Marshall Islands",aliases:["\uD83C\uDDF2\uD83C\uDDED","aelon kein ad","aolepan aorokin majel","jolet jen anij","majel","majol","republic of the marshall islands"]},{iso3:"MKD",iso2:"MK",m49:"807",name:"North Macedonia",aliases:["\uD83C\uDDF2\uD83C\uDDF0","former yugoslav republic of macedonia","fyr macedonia","fyrom","irjm","ish republika jugosllave e maqedonise","macedonia","macedonia former yugoslav republic of","macedonia fyr","maqedoni","maqedonia","maqedonia e veriut","republic of macedonia","republic of north macedonia","republika e maqedonise","republika e maqedonise se veriut","македонија","република македонија","република северна македонија","рм","рсм","северна македонија"]},{iso3:"MLI",iso2:"ML",m49:"466",name:"Mali",aliases:["\uD83C\uDDF2\uD83C\uDDF1","maali","republic of mali"]},{iso3:"MLT",iso2:"MT",m49:"470",name:"Malta",aliases:["\uD83C\uDDF2\uD83C\uDDF9","malta island","repubblika ta malta","republic of malta"]},{iso3:"MMR",iso2:"MM",m49:"104",name:"Myanmar",aliases:["\uD83C\uDDF2\uD83C\uDDF2","burma","pyidaungzu myanma naingngandaw","pyidaungzu thammada myanma naingngandaw","republic of the union of myanmar","union of burma","ပြည်ထောင်စု မြန်မာနိုင်ငံ","ပြည်ထောင်စု မြန်မာနိုင်ငံတော်","ပြည်ထောင်စု သမ္မတ မြန်မာနိုင်ငံ","ပြည်ထောင်စု သမ္မတ မြန်မာနိုင်ငံတော်","ပြည်ထောင်စုမြန်မာနိုင်ငံတော်","ပြည်ထောင်စုသမ္မတမြန်မာနိုင်ငံ","ပြ‌ည်ထောင်စုသမ္မတမြန်မာနိုင်ငံ","ပြည်ထောင်စုသမ္မတမြန်မာနိုင်ငံတော်","ဗမာပြည်","မြန်မာ","မြန်မာနိုင်ငံ","မြန်မာနိုင်ငံတော်","မြန်မာပြည်"]},{iso3:"MNE",iso2:"ME",m49:"499",name:"Montenegro",aliases:["\uD83C\uDDF2\uD83C\uDDEA","crna cora","црна гора"]},{iso3:"MNG",iso2:"MN",m49:"496",name:"Mongolia",aliases:["\uD83C\uDDF2\uD83C\uDDF3","bugd nayramdah mongol ard uls","mongol uls","state of mongolia","монгол","монгол улс","ᠮᠤᠩᠭᠤᠯ ᠤᠯᠤᠰ"]},{iso3:"MNP",iso2:"MP",m49:"580",name:"Northern Mariana Islands",aliases:["\uD83C\uDDF2\uD83C\uDDF5","cnmi","commonwealth of the northern maria islands","commonwealth of the northern mariana islands","northern marianas","notte marianas","sankattan siha na islas marianas"]},{iso3:"MOZ",iso2:"MZ",m49:"508",name:"Mozambique",aliases:["\uD83C\uDDF2\uD83C\uDDFF","mocambique","republic of mozambique","republica de mocambique"]},{iso3:"MRT",iso2:"MR",m49:"478",name:"Mauritania",aliases:["\uD83C\uDDF2\uD83C\uDDF7","islamic republic of mauritania","الجمهورية الإسلامية الموريتانية","موريتانيا"]},{iso3:"MSR",iso2:"MS",m49:"500",name:"Montserrat",aliases:["\uD83C\uDDF2\uD83C\uDDF8","island of montserrat"]},{iso3:"MTQ",iso2:"MQ",m49:"474",name:"Martinique",aliases:["\uD83C\uDDF2\uD83C\uDDF6","territorial collectivity of martinique"]},{iso3:"MUS",iso2:"MU",m49:"480",name:"Mauritius",aliases:["\uD83C\uDDF2\uD83C\uDDFA","ile maurice","la republique de maurice","maurice","moris","republic of mauritius","republique de maurice"]},{iso3:"MWI",iso2:"MW",m49:"454",name:"Malawi",aliases:["\uD83C\uDDF2\uD83C\uDDFC","republic of malawi"]},{iso3:"MYS",iso2:"MY",m49:"458",name:"Malaysia",aliases:["\uD83C\uDDF2\uD83C\uDDFE","federation of malaysia","malaysia federation","negara seberang tambak","persekutuan malaysia"]},{iso3:"MYT",iso2:"YT",m49:"175",name:"Mayotte",aliases:["\uD83C\uDDFE\uD83C\uDDF9","departement de mayotte","departement region de mayotte","department of mayotte"]},{iso3:"NAM",iso2:"NA",m49:"516",name:"Namibia",aliases:["\uD83C\uDDF3\uD83C\uDDE6","republic of namibia"]},{iso3:"NCL",iso2:"NC",m49:"540",name:"New Caledonia",aliases:["\uD83C\uDDF3\uD83C\uDDE8","caledonie","kanaky","kanaky nouvelle caledonie","nouvelle caledonie","territoire de la nouvelle caledonie et dependances","territoire des nouvelle caledonie et dependances","territory of new caledonia and dependencies"]},{iso3:"NER",iso2:"NE",m49:"562",name:"Niger",aliases:["\uD83C\uDDF3\uD83C\uDDEA","jamhuriyar nijar","nijar","republic niger","republic of niger","republic of the niger"]},{iso3:"NFK",iso2:"NF",m49:"574",name:"Norfolk Island",aliases:["\uD83C\uDDF3\uD83C\uDDEB","norfolk island australia","norfolk island other territories","norfolk island other territories australia","territory of norfolk island"]},{iso3:"NGA",iso2:"NG",m49:"566",name:"Nigeria",aliases:["\uD83C\uDDF3\uD83C\uDDEC","federal republic of nigeria","naija"]},{iso3:"NIC",iso2:"NI",m49:"558",name:"Nicaragua",aliases:["\uD83C\uDDF3\uD83C\uDDEE","republic of nicaragua","republica de nicaragua"]},{iso3:"NIU",iso2:"NU",m49:"570",name:"Niue",aliases:["\uD83C\uDDF3\uD83C\uDDFA"]},{iso3:"NLD",iso2:"NL",m49:"528",name:"Kingdom of the Netherlands",aliases:["\uD83C\uDDF3\uD83C\uDDF1","hollandt","kingdom of netherlands","koninkrijk der nederlanden","nederland","nederlanden","nederlandt","netherlands","netherlands kingdom of the"]},{iso3:"NOR",iso2:"NO",m49:"578",name:"Norway",aliases:["\uD83C\uDDF3\uD83C\uDDF4","kingdom of norway","kongeriket noreg","kongeriket norge","noreg","norge"]},{iso3:"NPL",iso2:"NP",m49:"524",name:"Nepal",aliases:["\uD83C\uDDF3\uD83C\uDDF5","bal bo","bal poi yul","bal yul","balbo","balpo","balpo yul","nipal","sanghiya loktantrik ganatantra nepal","नेपाल","संघिय लोकतान्त्रिक गणतन्त्र नेपाल","संघिय लोकतान्त्रिक गणतन्त्रात्मक नेपाल","संघीय लोकतान्त्रिक गणतन्त्र नेपाल"]},{iso3:"NRU",iso2:"NR",m49:"520",name:"Naoero",aliases:["\uD83C\uDDF3\uD83C\uDDF7","nauru","pleasant island","republic of naoero","republic of nauru"]},{iso3:"NZL",iso2:"NZ",m49:"554",name:"New Zealand",aliases:["\uD83C\uDDF3\uD83C\uDDFF","aotearoa","aotearoa new zealand","dominion of new zealand"]},{iso3:"OMN",iso2:"OM",m49:"512",name:"Oman",aliases:["\uD83C\uDDF4\uD83C\uDDF2","sultanate of oman","uman","سلطنة عمان","عمان"]},{iso3:"PAK",iso2:"PK",m49:"586",name:"Pakistan",aliases:["\uD83C\uDDF5\uD83C\uDDF0","hoi quoc","islamic republic of pakistan","republic of pakistan","tay hoi","اسلامی جمہوریہ پاکستان","باکستان","پاکستان"]},{iso3:"PAN",iso2:"PA",m49:"591",name:"Panama",aliases:["\uD83C\uDDF5\uD83C\uDDE6","republic of panama","republica de panama"]},{iso3:"PCN",iso2:"PN",m49:"612",name:"Pitcairn",aliases:["\uD83C\uDDF5\uD83C\uDDF3","occas island","pisskern aliеn","pitcairn henderson ducie and oeno islands","pitcairn island","pitcairn islands","pitkern ailen"]},{iso3:"PER",iso2:"PE",m49:"604",name:"Peru",aliases:["\uD83C\uDDF5\uD83C\uDDEA","piruw","piruw ripuwlika","republic of peru","republica del peru"]},{iso3:"PHL",iso2:"PH",m49:"608",name:"Philippines",aliases:["\uD83C\uDDF5\uD83C\uDDED","philippine islands","republic of the philippines"]},{iso3:"PLW",iso2:"PW",m49:"585",name:"Palau",aliases:["\uD83C\uDDF5\uD83C\uDDFC","belau","peeloo","pelew","pelew islands","pellew","republic of belau","republic of palau","パラオ","パラオ共和国"]},{iso3:"PNG",iso2:"PG",m49:"598",name:"Papua New Guinea",aliases:["\uD83C\uDDF5\uD83C\uDDEC","independent state of papua new guinea","papua niugini"]},{iso3:"POL",iso2:"PL",m49:"616",name:"Poland",aliases:["\uD83C\uDDF5\uD83C\uDDF1","polska","republic of poland","rzeczpospolita polska"]},{iso3:"PRI",iso2:"PR",m49:"630",name:"Puerto Rico",aliases:["\uD83C\uDDF5\uD83C\uDDF7","boriken","borinquen","boriquen","commonwealth of puerto rico","estado libre asociado de puerto rico","free associated state of puerto rico","isla del encanto","island of enchantment","isle of enchantment","mancomunidad de puerto rico","porto rico","territorio de puerto rico","territorio estadounidense de puerto rico","territory of porto rico","territory of puerto rico"]},{iso3:"PRK",iso2:"KP",m49:"408",name:"Democratic People's Republic of Korea",aliases:["\uD83C\uDDF0\uD83C\uDDF5","choson minjujuui inmin konghwaguk","dpr korea","dprk","korea democratic peoples republic of","n korea","north korea","공화국","북조선","북한","조선","조선민주주의인민공화국"]},{iso3:"PRT",iso2:"PT",m49:"620",name:"Portugal",aliases:["\uD83C\uDDF5\uD83C\uDDF9","republica portuguesa"]},{iso3:"PRY",iso2:"PY",m49:"600",name:"Paraguay",aliases:["\uD83C\uDDF5\uD83C\uDDFE","paraguai","republic of paraguay","republica del paraguay","teta paraguai"]},{iso3:"PSE",iso2:"PS",m49:"275",name:"State of Palestine",aliases:["\uD83C\uDDF5\uD83C\uDDF8","palestine","palestine state of","palestinian authority","palestinian national authority","palestinian territory","west bank and gaza","أراضي فلسطينية","الأراضي الفلسطينية","الدولة الفلسطينية","السلطة الفلسطينية","السلطة الوطنية الفلسطينية","الضفة الغربية وقطاع غزة","دولة فلسطين","فلسطين"]},{iso3:"PYF",iso2:"PF",m49:"258",name:"French Polynesia",aliases:["\uD83C\uDDF5\uD83C\uDDEB","f oh","french establishments in oceania","french oceania","french settlements in oceania","polynesie francaise","territoire de la polynesie francaise","territory of french polynesia"]},{iso3:"QAT",iso2:"QA",m49:"634",name:"Qatar",aliases:["\uD83C\uDDF6\uD83C\uDDE6","state of qatar","إمارة قطر","دولة قطر","قطر"]},{iso3:"REU",iso2:"RE",m49:"638",name:"R\xe9union",aliases:["\uD83C\uDDF7\uD83C\uDDEA","ile bourbon","ile de la reunion","la reunion","re","region reunion","reunion island"]},{iso3:"ROU",iso2:"RO",m49:"642",name:"Romania",aliases:["\uD83C\uDDF7\uD83C\uDDF4"]},{iso3:"RUS",iso2:"RU",m49:"643",name:"Russian Federation",aliases:["\uD83C\uDDF7\uD83C\uDDFA","federation of russia","russia","россииская федерация","россия","рф"]},{iso3:"RWA",iso2:"RW",m49:"646",name:"Rwanda",aliases:["\uD83C\uDDF7\uD83C\uDDFC","igihugu cyimisozi igihumbi","jamhuri ya rwanda","la republique du rwanda","land of a thousand hills","republic of rwanda","republika yu rwanda","republique du rwanda","republique rwandaise","repubulika yu rwanda","u rwanda"]},{iso3:"SAU",iso2:"SA",m49:"682",name:"Saudi Arabia",aliases:["\uD83C\uDDF8\uD83C\uDDE6","kingdom of saudi arabia","الدولة السعودية","الدوله السعوديه","السعودية","السعوديه","العربية السعودية","المملكة","المملكة السعودية","المملكة العربية","المملكة العربية السعودية","المملكه","المملكه العربيه السعوديه","بلاد الحرمين الشريفين","دولة آل سعود","سعودية","سعوديه","منبع الرسالة","مهبط الوحي"]},{iso3:"SDN",iso2:"SD",m49:"729",name:"Sudan",aliases:["\uD83C\uDDF8\uD83C\uDDE9","al sudan","as sudan","north sudan","republic of sudan","republic of the sudan","soudan","السودان","جمهورية السودان"]},{iso3:"SEN",iso2:"SN",m49:"686",name:"Senegal",aliases:["\uD83C\uDDF8\uD83C\uDDF3","la republique du senegal","republic of senegal","republique du senegal","sen","senegaal"]},{iso3:"SGP",iso2:"SG",m49:"702",name:"Singapore",aliases:["\uD83C\uDDF8\uD83C\uDDEC","garden city","lion city","republic of singapore","republik singapura","singapore city","singapura","spore","சிங்கப்பூர்","சிங்கப்பூர் குடியரசு","சிங்கை","ஸிங்கபூர்"]},{iso3:"SGS",iso2:"GS",m49:"239",name:"South Georgia and the South Sandwich Islands",aliases:["\uD83C\uDDEC\uD83C\uDDF8","falkland islands dependencies","sgssi","south georgia","south georgia & south sandwich islands","south sandwich islands"]},{iso3:"SHN",iso2:"SH",m49:"654",name:"Saint Helena",aliases:["\uD83C\uDDF8\uD83C\uDDED","ascension","saint helena and dependencies","saint helena ascension and tristan da cunha","tristan da cunha"]},{iso3:"SJM",iso2:"SJ",m49:"744",name:"Svalbard and Jan Mayen Islands",aliases:["\uD83C\uDDF8\uD83C\uDDEF","jan mayen","svalbard","svalbard and jan mayen","svalbard og jan mayen"]},{iso3:"SLB",iso2:"SB",m49:"090",name:"Solomon Islands",aliases:["\uD83C\uDDF8\uD83C\uDDE7"]},{iso3:"SLE",iso2:"SL",m49:"694",name:"Sierra Leone",aliases:["\uD83C\uDDF8\uD83C\uDDF1","republic of sierra leone"]},{iso3:"SLV",iso2:"SV",m49:"222",name:"El Salvador",aliases:["\uD83C\uDDF8\uD83C\uDDFB","republic of el salvador","republica de el salvador","salvador"]},{iso3:"SMR",iso2:"SM",m49:"674",name:"San Marino",aliases:["\uD83C\uDDF8\uD83C\uDDF2","most serene republic of san marino","repubblica di san marino","serenissima repubblica di san marino"]},{iso3:"SOM",iso2:"SO",m49:"706",name:"Somalia",aliases:["\uD83C\uDDF8\uD83C\uDDF4","as sumal","federal republic of somalia","jamhuuriyadda federaalka soomaaliya","jamhuuriyadda soomaaliyeed","soomaaliya","soomaaliyeey toosoo","الصومال","جمهورية الصومال","جمهورية الصومال الديموقراطية","جمهورية الصومال الفيدرالية","صومال"]},{iso3:"SPM",iso2:"PM",m49:"666",name:"Saint Pierre and Miquelon",aliases:["\uD83C\uDDF5\uD83C\uDDF2","collectivite territoriale de saint pierre et miquelon","miquelon","saint pierre","saint pierre et miquelon","territorial collectivity of saint pierre and miquelon"]},{iso3:"SRB",iso2:"RS",m49:"688",name:"Serbia",aliases:["\uD83C\uDDF7\uD83C\uDDF8","republic of serbia","republika srbija","република србија","србија"]},{iso3:"SSD",iso2:"SS",m49:"728",name:"South Sudan",aliases:["\uD83C\uDDF8\uD83C\uDDF8","republic of south sudan","southern sudan"]},{iso3:"STP",iso2:"ST",m49:"678",name:"Sao Tome and Principe",aliases:["\uD83C\uDDF8\uD83C\uDDF9","democratic republic of sao tome and principe","principe","republica democratica de sao tome e principe","sao tome","sao tome e principe","sao tome og principe"]},{iso3:"SUR",iso2:"SR",m49:"740",name:"Suriname",aliases:["\uD83C\uDDF8\uD83C\uDDF7","dutch guiana","republic of surinam","republic of suriname","republiek suriname","surinam","surrinam"]},{iso3:"SVK",iso2:"SK",m49:"703",name:"Slovakia",aliases:["\uD83C\uDDF8\uD83C\uDDF0","slovak republic","slovenska republika","slovensko"]},{iso3:"SVN",iso2:"SI",m49:"705",name:"Slovenia",aliases:["\uD83C\uDDF8\uD83C\uDDEE","republic of slovenia","republika slovenija","slovenija"]},{iso3:"SWE",iso2:"SE",m49:"752",name:"Sweden",aliases:["\uD83C\uDDF8\uD83C\uDDEA","kingdom of sweden","konungadomet sverige","konungariket sverige","kungadomet sverige","kungariket sverige","sverige","swedish kingdom"]},{iso3:"SWZ",iso2:"SZ",m49:"748",name:"Eswatini",aliases:["\uD83C\uDDF8\uD83C\uDDFF","kingdom of eswatini","kingdom of swaziland","swaziland","umbuso weswatini"]},{iso3:"SXM",iso2:"SX",m49:"534",name:"Sint Maarten (Dutch part)",aliases:["\uD83C\uDDF8\uD83C\uDDFD","country of sint maarten","eilandgebied sint maarten","land sint maarten","saint maarten","saint martin dutch part","sint maarten","sint martin"]},{iso3:"SYC",iso2:"SC",m49:"690",name:"Seychelles",aliases:["\uD83C\uDDF8\uD83C\uDDE8","la republique des seychelles","repiblik sesel","republic of seychelles","republique des seychelles"]},{iso3:"SYR",iso2:"SY",m49:"760",name:"Syrian Arab Republic",aliases:["\uD83C\uDDF8\uD83C\uDDFE","surya","syria","الجمهورية العربية السورية","الشام","سوريا","سورية"]},{iso3:"TCA",iso2:"TC",m49:"796",name:"Turks and Caicos Islands",aliases:["\uD83C\uDDF9\uD83C\uDDE8","caicos","caicos islands","turks","turks & caicos","turks islands"]},{iso3:"TCD",iso2:"TD",m49:"148",name:"Chad",aliases:["\uD83C\uDDF9\uD83C\uDDE9","la republique du tchad","republic of chad","republique du tchad","tchad","تشاد","جمهورية تشاد"]},{iso3:"TGO",iso2:"TG",m49:"768",name:"Togo",aliases:["\uD83C\uDDF9\uD83C\uDDEC","la republique togolaise","republique togolaise","togolese republic"]},{iso3:"THA",iso2:"TH",m49:"764",name:"Thailand",aliases:["\uD83C\uDDF9\uD83C\uDDED","kingdom of siam","kingdom of thailand","siam","thai","ไทย","ประเทศไทย","ประเทศสยาม","เมืองไทย","ราชอาณาจักรไทย","ราชอาณาจักรสยาม","สยาม"]},{iso3:"TJK",iso2:"TJ",m49:"762",name:"Tajikistan",aliases:["\uD83C\uDDF9\uD83C\uDDEF","jumhurii tojikiston","republic of tajikistan","тоҷикистон","тҷ","тҷк","ҷт","ҷумҳурии тоҷикистон"]},{iso3:"TKL",iso2:"TK",m49:"772",name:"Tokelau",aliases:["\uD83C\uDDF9\uD83C\uDDF0","tokelau islands","union islands"]},{iso3:"TKM",iso2:"TM",m49:"795",name:"Turkmenistan",aliases:["\uD83C\uDDF9\uD83C\uDDF2"]},{iso3:"TLS",iso2:"TL",m49:"626",name:"Timor-Leste",aliases:["\uD83C\uDDF9\uD83C\uDDF1","democratic republic of timor leste","east timor","republica democratica de timor leste","republika demokratika timor lorosae","timor loro sae","timor lorosae"]},{iso3:"TON",iso2:"TO",m49:"776",name:"Tonga",aliases:["\uD83C\uDDF9\uD83C\uDDF4","friendly islands","kingdom of tonga","puleanga fakatui o tonga","tonga islands"]},{iso3:"TTO",iso2:"TT",m49:"780",name:"Trinidad and Tobago",aliases:["\uD83C\uDDF9\uD83C\uDDF9","republic of trinidad and tobago","tobago","trinidad"]},{iso3:"TUN",iso2:"TN",m49:"788",name:"Tunisia",aliases:["\uD83C\uDDF9\uD83C\uDDF3","republic of tunisia","tunisian republic","الجمهورية التونسية","تونس","تونس الخضراء"]},{iso3:"TUR",iso2:"TR",m49:"792",name:"T\xfcrkiye",aliases:["\uD83C\uDDF9\uD83C\uDDF7","republic of turkey","republic of turkiye","turkey","turkiye cumhuriyeti"]},{iso3:"TUV",iso2:"TV",m49:"798",name:"Tuvalu",aliases:["\uD83C\uDDF9\uD83C\uDDFB","ellice islands"]},{iso3:"TWN",iso2:"TW",m49:"158",name:"Taiwan",aliases:["\uD83C\uDDF9\uD83C\uDDFC","chinese republic","chinese taipei","chunghwa minkuo","chunghwa minkwo","conghwaminku","cunghwa minkwo","cyukamingkok","formosa","nanasian","nationalist china","republic of china","republic of china taiwan","roc","taivang","taiwan province of china","taiwan roc","taywan","taywang","teywan","中華民國","中華民國(臺灣)","中華臺北","台灣","臺澎金馬","臺灣"]},{iso3:"TZA",iso2:"TZ",m49:"834",name:"United Republic of Tanzania",aliases:["\uD83C\uDDF9\uD83C\uDDFF","jamhuri ya muungano wa tanganyika na zanzibar","jamhuri ya muungano wa tanzania","tanzania","tanzania jamhuri ya muungano wa","tanzania united republic of","united republic of tanganyika and zanzibar"]},{iso3:"UGA",iso2:"UG",m49:"800",name:"Uganda",aliases:["\uD83C\uDDFA\uD83C\uDDEC","jamhuri ya uganda","lulu ya afrika","ouganda","pearl of africa","republic of uganda","ugandah"]},{iso3:"UKR",iso2:"UA",m49:"804",name:"Ukraine",aliases:["\uD83C\uDDFA\uD83C\uDDE6","ukr","ukraina","ukrainia","ukrayina","вкраіна","украіна"]},{iso3:"UMI",iso2:"UM",m49:"581",name:"United States Minor Outlying Islands",aliases:["\uD83C\uDDFA\uD83C\uDDF2","us minor outlying islands","us outlying islands","usmoi"]},{iso3:"URY",iso2:"UY",m49:"858",name:"Uruguay",aliases:["\uD83C\uDDFA\uD83C\uDDFE","eastern republic of uruguay","oriental republic of uruguay"]},{iso3:"USA",iso2:"US",m49:"840",name:"United States of America",aliases:["\uD83C\uDDFA\uD83C\uDDF8","amelika","amelika hui pu ia","amelika huipuia","amelika mokuaina hui pu ia","america","eeuu","eeuu de america","estados unidos","estados unidos de america","los estados","los estados unidos","los estados unidos de america","mokuaina hui pu ia","union americana","united states","us","us of a","us of america","usa"]},{iso3:"UZB",iso2:"UZ",m49:"860",name:"Uzbekistan",aliases:["\uD83C\uDDFA\uD83C\uDDFF","ozbek","ozbekiston","ozbekiston respublikasi","republic of uzbekistan","uzbekiston respublikasi"]},{iso3:"VAT",iso2:"VA",m49:"336",name:"Holy See",aliases:["\uD83C\uDDFB\uD83C\uDDE6","citta del vaticano","civitas vaticana","colle vaticano","papal state","santa sede citta del vaticano","state of vatican city","stato della citta del vaticano","status civitatis vaticanae","status civitatis vatican\xe6","vatican","vatican city","vatican city state","vaticano"]},{iso3:"VCT",iso2:"VC",m49:"670",name:"Saint Vincent and the Grenadines",aliases:["\uD83C\uDDFB\uD83C\uDDE8","grenadines","saint vincent","saint vincent and grenadines"]},{iso3:"VEN",iso2:"VE",m49:"862",name:"Venezuela (Bolivarian Republic of)",aliases:["\uD83C\uDDFB\uD83C\uDDEA","bolivarian republic of venezuela","br venezuela","estados unidos de venezuela","rb venezuela","republic of venezuela","republica bolivariana de venezuela","republica de venezuela","venezuela"]},{iso3:"VGB",iso2:"VG",m49:"092",name:"British Virgin Islands",aliases:["\uD83C\uDDFB\uD83C\uDDEC","bvi","virgin islands british","virgin islands of the united kingdom","virgin islands united kingdom"]},{iso3:"VIR",iso2:"VI",m49:"850",name:"United States Virgin Islands",aliases:["\uD83C\uDDFB\uD83C\uDDEE","american virgin islands","us virgin islands","virgin islands of the united states","virgin islands us"]},{iso3:"VNM",iso2:"VN",m49:"704",name:"Viet Nam",aliases:["\uD83C\uDDFB\uD83C\uDDF3","chxhcn viet nam","chxhcnvn","cong hoa xa hoi chu nghia viet nam","socialist republic of viet nam","socialist republic of vietnam","vietnam"]},{iso3:"VUT",iso2:"VU",m49:"548",name:"Vanuatu",aliases:["\uD83C\uDDFB\uD83C\uDDFA","la republique du vanuatu","republic of vanuatu","republique de vanuatu","ripablik blong vanuatu"]},{iso3:"WLF",iso2:"WF",m49:"876",name:"Wallis and Futuna Islands",aliases:["\uD83C\uDDFC\uD83C\uDDEB","collectivite des iles wallis et futuna","emeni simete","futuna","iles wallis et futuna","makape papilio","territoire de wallis et futuna","territoire des iles wallis et futuna","wallis","wallis & futuna","wallis et futuna"]},{iso3:"WSM",iso2:"WS",m49:"882",name:"Samoa",aliases:["\uD83C\uDDFC\uD83C\uDDF8","independent state of samoa","malo saoloto tutoatasi o samoa","samoa i sisifo","western samoa"]},{iso3:"YEM",iso2:"YE",m49:"887",name:"Yemen",aliases:["\uD83C\uDDFE\uD83C\uDDEA","rep yemen","republic of yemen","الجمهورية اليمنية","اليمن","دولة اليمن"]},{iso3:"ZAF",iso2:"ZA",m49:"710",name:"South Africa",aliases:["\uD83C\uDDFF\uD83C\uDDE6","aferika borwa","aforika borwa","afrika boroa","afrika borwa","afrika dzonga","afurika tshipembe","emzantsi afrika","iningizimu afrika","iriphabhulikhi ye ningizimu afrika","iriphabhulikhi yeningizimu afrika","iriphabhuliki yase ningizimu afrika","iriphabliki yasemzantsi afrika","iriphabliki yaseningizimu afrika","iriphabliki yom zantsi afrika","isewula afrika","repabliki ya afrika borwa","rephaboliki ya aforika borwa","rephaboliki ya afrika borwa","republic of south africa","republiek van suid afrika","riphabliki ra afrika dzonga","rsa","suid afrika","umzansi","umzantsi afrika","unie van suid afrika","union of south africa"]},{iso3:"ZMB",iso2:"ZM",m49:"894",name:"Zambia",aliases:["\uD83C\uDDFF\uD83C\uDDF2","northern rhodesia","republic of zambia"]},{iso3:"ZWE",iso2:"ZW",m49:"716",name:"Zimbabwe",aliases:["\uD83C\uDDFF\uD83C\uDDFC","ezimbabwe","izimbabwe","republic of zimbabwe","rhodesia","southern rhodesia","zimbabwe rhodesia","zimbagwe"]}];function l(e){return e.normalize("NFD").replace(/[\u0300-\u036F]/g,"").normalize("NFC").toLowerCase().replace(/[\u064B-\u065F]/g,"").replace(/['\u2018\u2019\u02BB\u02BC\u02BD\u02C8\u2032`]/g,"").replace(/&/g," and ").replace(/([,(])\s*the\b/g,"$1").replace(/[.(),[\]]/g,"").replace(/[-\u2013\u2014]/g," ").replace(/\bst\b/g,"saint").trim().replace(/\s+/g," ").replace(/^the\s+/,"")}function u(e){let t=new Map,r=new Map,i=new Map;for(let n of e)t.set(n.iso3,n),n.iso2&&r.set(n.iso2,n),n.m49&&i.set(n.m49,n);let n=new Map;for(let t of e)for(let e of[t.name,...t.aliases]){let r=l(e),i=n.get(r);if(void 0!==i&&i!==t.iso3)throw Error(`Duplicate name/alias "${r}": ${i} vs ${t.iso3}`);n.set(r,t.iso3)}function a(e){if(null==e)return;let a=String(e).trim();if(!a)return;if(/^\d+$/.test(a)){let e=i.get(String(parseInt(a,10)).padStart(3,"0"));if(e)return e}if(/^[A-Za-z]{2}$/.test(a)){let e=r.get(a.toUpperCase());if(e)return e}if(/^[A-Za-z]{3}$/.test(a)){let e=t.get(a.toUpperCase());if(e)return e}let o=n.get(l(a));return void 0===o?void 0:t.get(o)}return{lookup:a,lookupAlpha3:function(e){var t;return null==(t=a(e))?void 0:t.iso3},byAlpha3:t,byAlpha2:r,byM49:i}}var c=u(s),h=c.lookup,d=c.lookupAlpha3,f=c.byAlpha3,p=c.byAlpha2,m=c.byM49}}),pv=m({"node_modules/@turf/helpers/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t={centimeters:0x25f96350,centimetres:0x25f96350,degrees:360/(2*Math.PI),feet:20902260.511392,inches:39.37*6371008.8,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:0x17bbde120,millimetres:0x17bbde120,nauticalmiles:6371008.8/1852,radians:1,yards:1.0936*6371008.8},r={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(e,t,r={}){let n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function n(e,t,r={}){if(!e)throw Error("coordinates is required");if(!Array.isArray(e))throw Error("coordinates must be an Array");if(e.length<2)throw Error("coordinates must be at least 2 numbers long");if(!p(e[0])||!p(e[1]))throw Error("coordinates must contain numbers");return i({type:"Point",coordinates:e},t,r)}function a(e,t,r={}){for(let t of e){if(t.length<4)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(t[t.length-1].length!==t[0].length)throw Error("First and last Position are not equivalent.");for(let e=0;e180?e-360:e<-180?e+360:e},e.bearingToAzimuth=function(e){let t=e%360;return t<0&&(t+=360),t},e.convertArea=function(e,t="meters",i="kilometers"){if(!(e>=0))throw Error("area must be a positive number");let n=r[t];if(!n)throw Error("invalid original units");let a=r[i];if(!a)throw Error("invalid final units");return e/n*a},e.convertLength=function(e,t="kilometers",r="kilometers"){if(!(e>=0))throw Error("length must be a positive number");return h(d(e,t),r)},e.degreesToRadians=function(e){return e%360*Math.PI/180},e.earthRadius=6371008.8,e.factors=t,e.feature=i,e.featureCollection=s,e.geometry=function(e,t,r={}){switch(e){case"Point":return n(t).geometry;case"LineString":return o(t).geometry;case"Polygon":return a(t).geometry;case"MultiPoint":return u(t).geometry;case"MultiLineString":return l(t).geometry;case"MultiPolygon":return c(t).geometry;default:throw Error(e+" is invalid")}},e.geometryCollection=function(e,t,r={}){return i({type:"GeometryCollection",geometries:e},t,r)},e.isNumber=p,e.isObject=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)},e.lengthToDegrees=function(e,t){return f(d(e,t))},e.lengthToRadians=d,e.lineString=o,e.lineStrings=function(e,t,r={}){return s(e.map(e=>o(e,t)),r)},e.multiLineString=l,e.multiPoint=u,e.multiPolygon=c,e.point=n,e.points=function(e,t,r={}){return s(e.map(e=>n(e,t)),r)},e.polygon=a,e.polygons=function(e,t,r={}){return s(e.map(e=>a(e,t)),r)},e.radiansToDegrees=f,e.radiansToLength=h,e.round=function(e,t=0){if(t&&!(t>=0))throw Error("precision must be a positive number");let r=Math.pow(10,t||0);return Math.round(e*r)/r},e.validateBBox=function(e){if(!e)throw Error("bbox is required");if(!Array.isArray(e))throw Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw Error("bbox must be an Array of 4 or 6 numbers");e.forEach(e=>{if(!p(e))throw Error("bbox must only contain numbers")})},e.validateId=function(e){if(!e)throw Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw Error("id must be a number or a string")}}}),px=m({"node_modules/@turf/meta/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=pv();function r(e,t,i){if(null!==e)for(var n,a,o,s,l,u,c,h,d=0,f=0,p=e.type,m="FeatureCollection"===p,g="Feature"===p,y=m?e.features.length:1,v=0;vu||f>c||p>h){l=r,u=n,c=f,h=p,o=0;return}if(!1===i(t.lineString.call(void 0,[l,r],e.properties),n,a,p,o))return!1;o++,l=r}))return!1}}})}function l(e,r){if(!e)throw Error("geojson is required");o(e,function(e,i,n){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===r(e,i,n,0,0))return!1;break;case"Polygon":for(var s=0;se+function(e){let t=0,r;switch(e.type){case"Polygon":return n(e.coordinates);case"MultiPolygon":for(r=0;r0){t+=Math.abs(s(e[0]));for(let r=1;r=t?(i+2)%t:i+2],l=n[0]*o,u=a[1]*o;r+=(s[0]*o-l)*Math.sin(u),i++}return r*a}e.area=i,e.default=i}}),p_=m({"node_modules/@turf/centroid/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=pv(),r=px();function i(e,n={}){let a=0,o=0,s=0;return r.coordEach.call(void 0,e,function(e){a+=e[0],o+=e[1],s++},!0),t.point.call(void 0,[a/s,o/s],n.properties)}e.centroid=i,e.default=i}}),pw=m({"node_modules/d3-geo/node_modules/d3-array/dist/d3-array.js"(e,t){(function(e){function t(e,t){return et?1:e>=t?0:0/0}function r(e){var r;return 1===e.length&&(r=e,e=function(e,i){return t(r(e),i)}),{left:function(t,r,i,n){for(null==i&&(i=0),null==n&&(n=t.length);i>>1;0>e(t[a],r)?i=a+1:n=a}return i},right:function(t,r,i,n){for(null==i&&(i=0),null==n&&(n=t.length);i>>1;e(t[a],r)>0?n=a:i=a+1}return i}}}var i=r(t),n=i.right,a=i.left;function o(e,t){return[e,t]}function s(e){return null===e?0/0:+e}function l(e,t){var r,i,n=e.length,a=0,o=-1,l=0,u=0;if(null==t)for(;++o1)return u/(a-1)}function u(e,t){var r=l(e,t);return r&&Math.sqrt(r)}function c(e,t){var r,i,n,a=e.length,o=-1;if(null==t){for(;++o=r)for(i=n=r;++or&&(i=r),n=r)for(i=n=r;++or&&(i=r),n=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=y?10:a>=v?5:a>=x?2:1)}function _(e,t,r){var i=Math.abs(t-e)/Math.max(0,r),n=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),a=i/n;return a>=y?n*=10:a>=v?n*=5:a>=x&&(n*=2),t=1)return+r(e[i-1],i-1,e);var i,n=(i-1)*t,a=Math.floor(n),o=+r(e[a],a,e);return o+(r(e[a+1],a+1,e)-o)*(n-a)}}function A(e,t){var r,i,n=e.length,a=-1;if(null==t){for(;++a=r)for(i=r;++ar&&(i=r)}else for(;++a=r)for(i=r;++ar&&(i=r);return i}function M(e){if(!(n=e.length))return[];for(var t=-1,r=A(e,k),i=Array(r);++te?1:t>=e?0:0/0},e.deviation=u,e.extent=c,e.histogram=function(){var e=m,t=c,r=w;function i(i){var a,o,s=i.length,l=Array(s);for(a=0;ah;)d.pop(),--f;var p,m=Array(f+1);for(a=0;a<=f;++a)(p=m[a]=[]).x0=a>0?d[a-1]:c,p.x1=a=r)for(i=r;++ai&&(i=r)}else for(;++a=r)for(i=r;++ai&&(i=r);return i},e.mean=function(e,t){var r,i=e.length,n=i,a=-1,o=0;if(null==t)for(;++a=0;)for(t=(i=e[n]).length;--t>=0;)r[--o]=i[t];return r},e.min=A,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,i=e.length-1,n=e[0],a=Array(i<0?0:i);rr(n=e[a],s)||0!==r(s,s))&&(s=n,o=a);if(0===r(s,s))return o}},e.shuffle=function(e,t,r){for(var i,n,a=(r??e.length)-(t=null==t?0:+t);a;)n=Math.random()*a--|0,i=e[a+t],e[a+t]=e[n+t],e[n+t]=i;return e},e.sum=function(e,t){var r,i=e.length,n=-1,a=0;if(null==t)for(;++n0)return[e];if((i=t0)for(e=Math.ceil(e/o),a=Array(n=Math.ceil((t=Math.floor(t/o))-e+1));++stypeof t?e:e.d3=e.d3||{})}}),pT=m({"node_modules/d3-geo/dist/d3-geo.js"(e,t){var r,i;r=e,i=function(e,t){function r(){return new i}function i(){this.reset()}i.prototype={constructor:i,reset:function(){this.s=this.t=0},add:function(e){a(n,e,this.t),a(this,n.s,this.s),this.s?this.t+=n.t:this.s=n.t},valueOf:function(){return this.s}};var n=new i;function a(e,t,r){var i=e.s=t+r,n=i-t;e.t=t-(i-n)+(r-n)}var o=Math.PI,s=o/2,l=o/4,u=2*o,c=180/o,h=o/180,d=Math.abs,f=Math.atan,p=Math.atan2,m=Math.cos,g=Math.ceil,y=Math.exp,v=Math.log,x=Math.pow,b=Math.sin,_=Math.sign||function(e){return e>0?1:e<0?-1:0},w=Math.sqrt,T=Math.tan;function A(e){return e>1?0:e<-1?o:Math.acos(e)}function M(e){return e>1?s:e<-1?-s:Math.asin(e)}function k(){}function S(e,t){e&&D.hasOwnProperty(e.type)&&D[e.type](e,t)}var E={Feature:function(e,t){S(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,i=-1,n=r.length;++i=0?1:-1,n=i*r,a=m(t),o=b(t),s=R*o,u=O*a+s*m(n),c=s*i*b(n);B.add(p(c,u)),F=e,O=a,R=o}function H(e){return[p(e[1],e[0]),M(e[2])]}function $(e){var t=e[0],r=e[1],i=m(r);return[i*m(t),i*b(t),b(r)]}function W(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Y(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Z(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function X(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function K(e){var t=w(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var J,Q,ee,et,er,ei,en,ea,eo,es,el=r(),eu={point:ec,lineStart:ed,lineEnd:ef,polygonStart:function(){eu.point=ep,eu.lineStart=em,eu.lineEnd=eg,el.reset(),N.polygonStart()},polygonEnd:function(){N.polygonEnd(),eu.point=ec,eu.lineStart=ed,eu.lineEnd=ef,B<0?(J=-(ee=180),Q=-(et=90)):el>1e-6?et=90:el<-1e-6&&(Q=-90),es[0]=J,es[1]=ee},sphere:function(){J=-(ee=180),Q=-(et=90)}};function ec(e,t){eo.push(es=[J=e,ee=e]),tet&&(et=t)}function eh(e,t){var r=$([e*h,t*h]);if(ea){var i=Y(ea,r),n=Y([i[1],-i[0],0],i);K(n),n=H(n);var a,o=e-er,s=o>0?1:-1,l=n[0]*c*s,u=d(o)>180;u^(s*eret&&(et=a):u^(s*er<(l=(l+360)%360-180)&&let&&(et=t)),u?eey(J,ee)&&(ee=e):ey(e,ee)>ey(J,ee)&&(J=e):ee>=J?(eee&&(ee=e)):e>er?ey(J,e)>ey(J,ee)&&(ee=e):ey(e,ee)>ey(J,ee)&&(J=e)}else eo.push(es=[J=e,ee=e]);tet&&(et=t),ea=r,er=e}function ed(){eu.point=eh}function ef(){es[0]=J,es[1]=ee,eu.point=ec,ea=null}function ep(e,t){if(ea){var r=e-er;el.add(d(r)>180?r+(r>0?360:-360):r)}else ei=e,en=t;N.point(e,t),eh(e,t)}function em(){N.lineStart()}function eg(){ep(ei,en),N.lineEnd(),d(el)>1e-6&&(J=-(ee=180)),es[0]=J,es[1]=ee,ea=null}function ey(e,t){return(t-=e)<0?t+360:t}function ev(e,t){return e[0]-t[0]}function ex(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:to?e+Math.round(-e/u)*u:e,t]}function eX(e,t,r){return(e%=u)?t||r?eY(eJ(e),eQ(t,r)):eJ(e):t||r?eQ(t,r):eZ}function eK(e){return function(t,r){return[(t+=e)>o?t-u:t<-o?t+u:t,r]}}function eJ(e){var t=eK(e);return t.invert=eK(-e),t}function eQ(e,t){var r=m(e),i=b(e),n=m(t),a=b(t);function o(e,t){var o=m(t),s=m(e)*o,l=b(e)*o,u=b(t),c=u*r+s*i;return[p(l*n-c*a,s*r-u*i),M(c*n+l*a)]}return o.invert=function(e,t){var o=m(t),s=m(e)*o,l=b(e)*o,u=b(t),c=u*n-l*a;return[p(l*n+u*a,s*r+c*i),M(c*r-s*i)]},o}function e0(e){function t(t){return t=e(t[0]*h,t[1]*h),t[0]*=c,t[1]*=c,t}return e=eX(e[0]*h,e[1]*h,e.length>2?e[2]*h:0),t.invert=function(t){return t=e.invert(t[0]*h,t[1]*h),t[0]*=c,t[1]*=c,t},t}function e1(e,t,r,i,n,a){if(r){var o=m(t),s=b(t),l=i*r;null==n?(n=t+i*u,a=t-l/2):(n=e2(o,n),a=e2(o,a),(i>0?na)&&(n+=i*u));for(var c,h=n;i>0?h>a:h-t[2]?-r:r)+u-1e-6)%u}function e3(){var e,t=[];return{point:function(t,r,i){e.push([t,r,i])},lineStart:function(){t.push(e=[])},lineEnd:k,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}function e5(e,t){return 1e-6>d(e[0]-t[0])&&1e-6>d(e[1]-t[1])}function e4(e,t,r,i){this.x=e,this.z=t,this.o=r,this.e=i,this.v=!1,this.n=this.p=null}function e6(e,t,r,i,n){var a,o,s=[],l=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,r,i=e[0],o=e[t];if(e5(i,o)){if(!i[2]&&!o[2]){for(n.lineStart(),a=0;a=0;--a)n.point((c=u[a])[0],c[1]);else i(d.x,d.p.x,-1,n);d=d.p}u=(d=d.o).z,f=!f}while(!d.v);n.lineEnd()}}}function e8(e){if(t=e.length){for(var t,r,i=0,n=e[0];++i=0?1:-1,P=L*I,z=P>o,F=w*D;if(e7.add(p(F*L*b(P),T*C+F*m(P))),c+=z?I+L*u:I,z^x>=r^S>=r){var O=Y($(v),$(k));K(O);var R=Y(a,O);K(R);var B=(z^I>=0?-1:1)*M(R[2]);(i>B||i===B&&(O[0]||O[1]))&&(h+=z^I>=0?1:-1)}}return(c<-1e-6||c<1e-6&&e7<-1e-6)^1&h}function tt(e,r,i,n){return function(a){var o,s,l,u=r(a),c=e3(),h=r(c),d=!1,f={point:p,lineStart:g,lineEnd:y,polygonStart:function(){f.point=v,f.lineStart=x,f.lineEnd=b,s=[],o=[]},polygonEnd:function(){f.point=p,f.lineStart=g,f.lineEnd=y,s=t.merge(s);var e=te(o,n);s.length?(d||(a.polygonStart(),d=!0),e6(s,ti,e,i,a)):e&&(d||(a.polygonStart(),d=!0),a.lineStart(),i(null,null,1,a),a.lineEnd()),d&&(a.polygonEnd(),d=!1),s=o=null},sphere:function(){a.polygonStart(),a.lineStart(),i(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function p(t,r){e(t,r)&&a.point(t,r)}function m(e,t){u.point(e,t)}function g(){f.point=m,u.lineStart()}function y(){f.point=p,u.lineEnd()}function v(e,t){l.push([e,t]),h.point(e,t)}function x(){h.lineStart(),l=[]}function b(){v(l[0][0],l[0][1]),h.lineEnd();var e,t,r,i,n=h.clean(),u=c.result(),f=u.length;if(l.pop(),o.push(l),l=null,f){if(1&n){if((t=(r=u[0]).length-1)>0){for(d||(a.polygonStart(),d=!0),a.lineStart(),e=0;e1&&2&n&&u.push(u.pop().concat(u.shift())),s.push(u.filter(tr))}}return f}}function tr(e){return e.length>1}function ti(e,t){return((e=e.x)[0]<0?e[1]-s-1e-6:s-e[1])-((t=t.x)[0]<0?t[1]-s-1e-6:s-t[1])}var tn=tt(function(){return!0},function(e){var t,r=0/0,i=0/0,n=0/0;return{lineStart:function(){e.lineStart(),t=1},point:function(a,l){var u,c,h,p,g,y,v,x=a>0?o:-o,_=d(a-r);1e-6>d(_-o)?(e.point(r,i=(i+l)/2>0?s:-s),e.point(n,i),e.lineEnd(),e.lineStart(),e.point(x,i),e.point(a,i),t=0):n!==x&&_>=o&&(1e-6>d(r-n)&&(r-=1e-6*n),1e-6>d(a-x)&&(a-=1e-6*x),u=r,c=i,h=a,p=l,i=d(v=b(u-h))>1e-6?f((b(c)*(y=m(p))*b(h)-b(p)*(g=m(c))*b(u))/(g*y*v)):(c+p)/2,e.point(n,i),e.lineEnd(),e.lineStart(),e.point(x,i),t=0),e.point(r=a,i=l),n=x},lineEnd:function(){e.lineEnd(),r=i=0/0},clean:function(){return 2-t}}},function(e,t,r,i){var n;if(null==e)n=r*s,i.point(-o,n),i.point(0,n),i.point(o,n),i.point(o,0),i.point(o,-n),i.point(0,-n),i.point(-o,-n),i.point(-o,0),i.point(-o,n);else if(d(e[0]-t[0])>1e-6){var a=e[0]0,n=d(t)>1e-6;function a(e,r){return m(e)*m(r)>t}function s(e,r,i){var n=$(e),a=$(r),s=[1,0,0],l=Y(n,a),u=W(l,l),c=l[0],h=u-c*c;if(!h)return!i&&e;var f=Y(s,l),p=X(s,t*u/h);Z(p,X(l,-t*c/h));var m=W(p,f),g=W(f,f),y=m*m-g*(W(p,p)-1);if(!(y<0)){var v=w(y),x=X(f,(-m-v)/g);if(Z(x,p),x=H(x),!i)return x;var b,_=e[0],T=r[0],A=e[1],M=r[1];T<_&&(b=_,_=T,T=b);var k=T-_,S=1e-6>d(k-o);if(!S&&M0^x[1]<(1e-6>d(x[0]-_)?A:M):A<=x[1]&&x[1]<=M:k>o^(_<=x[0]&&x[0]<=T)){var E=X(f,(-m+v)/g);return Z(E,p),[x,H(E)]}}}function l(t,r){var n=i?e:o-e,a=0;return t<-n?a|=1:t>n&&(a|=2),r<-n?a|=4:r>n&&(a|=8),a}return tt(a,function(e){var t,r,u,c,h;return{lineStart:function(){c=u=!1,h=1},point:function(d,f){var p,m,g=[d,f],y=a(d,f),v=i?y?0:l(d,f):y?l(d+(d<0?o:-o),f):0;(!t&&(c=u=y)&&e.lineStart(),y!==u&&(!(m=s(t,g))||e5(t,m)||e5(g,m))&&(g[2]=1),y!==u)?(h=0,y?(e.lineStart(),m=s(g,t),e.point(m[0],m[1])):(m=s(t,g),e.point(m[0],m[1],2),e.lineEnd()),t=m):n&&t&&i^y&&!(v&r)&&(p=s(g,t,!0))&&(h=0,i?(e.lineStart(),e.point(p[0][0],p[0][1]),e.point(p[1][0],p[1][1]),e.lineEnd()):(e.point(p[1][0],p[1][1]),e.lineEnd(),e.lineStart(),e.point(p[0][0],p[0][1],3))),!y||t&&e5(t,g)||e.point(g[0],g[1]),t=g,u=y,r=v},lineEnd:function(){u&&e.lineEnd(),t=null},clean:function(){return h|(c&&u)<<1}}},function(t,i,n,a){e1(a,e,r,n,t,i)},i?[0,-e]:[-o,e-o])}function to(e,r,i,n){function a(t,a){return e<=t&&t<=i&&r<=a&&a<=n}function o(t,a,o,l){var c=0,h=0;if(null==t||(c=s(t,o))!==(h=s(a,o))||0>u(t,a)^o>0)do l.point(0===c||3===c?e:i,c>1?n:r);while((c=(c+o+4)%4)!==h);else l.point(a[0],a[1])}function s(t,n){return 1e-6>d(t[0]-e)?n>0?0:3:1e-6>d(t[0]-i)?n>0?2:1:1e-6>d(t[1]-r)?+(n>0):n>0?3:2}function l(e,t){return u(e.x,t.x)}function u(e,t){var r=s(e,1),i=s(t,1);return r!==i?r-i:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(s){var u,c,h,d,f,p,m,g,y,v,x,b=s,_=e3(),w={point:T,lineStart:function(){w.point=A,c&&c.push(h=[]),v=!0,y=!1,m=g=0/0},lineEnd:function(){u&&(A(d,f),p&&y&&_.rejoin(),u.push(_.result())),w.point=T,y&&b.lineEnd()},polygonStart:function(){b=_,u=[],c=[],x=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,i=c.length;rn&&(d-a)*(n-o)>(f-o)*(e-a)&&++t:f<=n&&(d-a)*(n-o)<(f-o)*(e-a)&&--t;return t}(),i=x&&r,a=(u=t.merge(u)).length;(i||a)&&(s.polygonStart(),i&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),a&&e6(u,l,r,o,s),s.polygonEnd()),b=s,u=c=h=null}};function T(e,t){a(e,t)&&b.point(e,t)}function A(t,o){var s=a(t,o);if(c&&h.push([t,o]),v)d=t,f=o,p=s,v=!1,s&&(b.lineStart(),b.point(t,o));else if(s&&y)b.point(t,o);else{var l=[m=Math.max(-1e9,Math.min(1e9,m)),g=Math.max(-1e9,Math.min(1e9,g))],u=[t=Math.max(-1e9,Math.min(1e9,t)),o=Math.max(-1e9,Math.min(1e9,o))];!function(e,t,r,i,n,a){var o,s=e[0],l=e[1],u=t[0],c=t[1],h=0,d=1,f=u-s,p=c-l;if(o=r-s,!(!f&&o>0)){if(o/=f,f<0){if(o0){if(o>d)return;o>h&&(h=o)}if(o=n-s,!(!f&&o<0)){if(o/=f,f<0){if(o>d)return;o>h&&(h=o)}else if(f>0){if(o0)){if(o/=p,p<0){if(o0){if(o>d)return;o>h&&(h=o)}if(o=a-l,!(!p&&o<0)){if(o/=p,p<0){if(o>d)return;o>h&&(h=o)}else if(p>0){if(o0&&(e[0]=s+h*f,e[1]=l+h*p),d<1&&(t[0]=s+d*f,t[1]=l+d*p),!0}}}}}(l,u,e,r,i,n)?s&&(b.lineStart(),b.point(t,o),x=!1):(y||(b.lineStart(),b.point(l[0],l[1])),b.point(u[0],u[1]),s||b.lineEnd(),x=!1)}m=t,g=o,y=s}return w}}var ts,tl,tu,tc=r(),th={sphere:k,point:k,lineStart:function(){th.point=tf,th.lineEnd=td},lineEnd:k,polygonStart:k,polygonEnd:k};function td(){th.point=th.lineEnd=k}function tf(e,t){e*=h,t*=h,ts=e,tl=b(t),tu=m(t),th.point=tp}function tp(e,t){e*=h;var r=b(t*=h),i=m(t),n=d(e-ts),a=m(n),o=i*b(n),s=tu*r-tl*i*a,l=tl*r+tu*i*a;tc.add(p(w(o*o+s*s),l)),ts=e,tl=r,tu=i}function tm(e){return tc.reset(),L(e,th),+tc}var tg=[null,null],ty={type:"LineString",coordinates:tg};function tv(e,t){return tg[0]=e,tg[1]=t,tm(ty)}var tx={Feature:function(e,t){return t_(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,i=-1,n=r.length;++i0&&(n=tv(e[a],e[a-1]))>0&&r<=n&&i<=n&&(r+i-n)*(1-Math.pow((r-i)/n,2))<1e-12*n)return!0;r=i}return!1}function tT(e,t){return!!te(e.map(tA),tM(t))}function tA(e){return(e=e.map(tM)).pop(),e}function tM(e){return[e[0]*h,e[1]*h]}function tk(e,r,i){var n=t.range(e,r-1e-6,i).concat(r);return function(e){return n.map(function(t){return[e,t]})}}function tS(e,r,i){var n=t.range(e,r-1e-6,i).concat(r);return function(e){return n.map(function(t){return[t,e]})}}function tE(){var e,r,i,n,a,o,s,l,u,c,h,f,p=10,m=10,y=90,v=360,x=2.5;function b(){return{type:"MultiLineString",coordinates:_()}}function _(){return t.range(g(n/y)*y,i,y).map(h).concat(t.range(g(l/v)*v,s,v).map(f)).concat(t.range(g(r/p)*p,e,p).filter(function(e){return d(e%y)>1e-6}).map(u)).concat(t.range(g(o/m)*m,a,m).filter(function(e){return d(e%v)>1e-6}).map(c))}return b.lines=function(){return _().map(function(e){return{type:"LineString",coordinates:e}})},b.outline=function(){return{type:"Polygon",coordinates:[h(n).concat(f(s).slice(1),h(i).reverse().slice(1),f(l).reverse().slice(1))]}},b.extent=function(e){return arguments.length?b.extentMajor(e).extentMinor(e):b.extentMinor()},b.extentMajor=function(e){return arguments.length?(n=+e[0][0],i=+e[1][0],l=+e[0][1],s=+e[1][1],n>i&&(e=n,n=i,i=e),l>s&&(e=l,l=s,s=e),b.precision(x)):[[n,l],[i,s]]},b.extentMinor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),b.precision(x)):[[r,o],[e,a]]},b.step=function(e){return arguments.length?b.stepMajor(e).stepMinor(e):b.stepMinor()},b.stepMajor=function(e){return arguments.length?(y=+e[0],v=+e[1],b):[y,v]},b.stepMinor=function(e){return arguments.length?(p=+e[0],m=+e[1],b):[p,m]},b.precision=function(t){return arguments.length?(x=+t,u=tk(o,a,90),c=tS(r,e,x),h=tk(l,s,90),f=tS(n,i,x),b):x},b.extentMajor([[-180,-90+1e-6],[180,90-1e-6]]).extentMinor([[-180,-80-1e-6],[180,80+1e-6]])}function tD(e){return e}var tC,tI,tL,tP,tz=r(),tF=r(),tO={point:k,lineStart:k,lineEnd:k,polygonStart:function(){tO.lineStart=tR,tO.lineEnd=tN},polygonEnd:function(){tO.lineStart=tO.lineEnd=tO.point=k,tz.add(d(tF)),tF.reset()},result:function(){var e=tz/2;return tz.reset(),e}};function tR(){tO.point=tB}function tB(e,t){tO.point=tj,tC=tL=e,tI=tP=t}function tj(e,t){tF.add(tP*e-tL*t),tL=e,tP=t}function tN(){tj(tC,tI)}var tV,tU,tq,tG,tH=1/0,t$=1/0,tW=-1/0,tY=-1/0,tZ={point:function(e,t){etW&&(tW=e),ttY&&(tY=t)},lineStart:k,lineEnd:k,polygonStart:k,polygonEnd:k,result:function(){var e=[[tH,t$],[tW,tY]];return tW=tY=-(t$=tH=1/0),e}},tX=0,tK=0,tJ=0,tQ=0,t0=0,t1=0,t2=0,t3=0,t5=0,t4={point:t6,lineStart:t8,lineEnd:re,polygonStart:function(){t4.lineStart=rt,t4.lineEnd=rr},polygonEnd:function(){t4.point=t6,t4.lineStart=t8,t4.lineEnd=re},result:function(){var e=t5?[t2/t5,t3/t5]:t1?[tQ/t1,t0/t1]:tJ?[tX/tJ,tK/tJ]:[0/0,0/0];return tX=tK=tJ=tQ=t0=t1=t2=t3=t5=0,e}};function t6(e,t){tX+=e,tK+=t,++tJ}function t8(){t4.point=t7}function t7(e,t){t4.point=t9,t6(tq=e,tG=t)}function t9(e,t){var r=e-tq,i=t-tG,n=w(r*r+i*i);tQ+=n*(tq+e)/2,t0+=n*(tG+t)/2,t1+=n,t6(tq=e,tG=t)}function re(){t4.point=t6}function rt(){t4.point=ri}function rr(){rn(tV,tU)}function ri(e,t){t4.point=rn,t6(tV=tq=e,tU=tG=t)}function rn(e,t){var r=e-tq,i=t-tG,n=w(r*r+i*i);tQ+=n*(tq+e)/2,t0+=n*(tG+t)/2,t1+=n,t2+=(n=tG*e-tq*t)*(tq+e),t3+=n*(tG+t),t5+=3*n,t6(tq=e,tG=t)}function ra(e){this._context=e}ra.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=0/0},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=0/0},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,u)}},result:k};var ro,rs,rl,ru,rc,rh=r(),rd={point:k,lineStart:function(){rd.point=rf},lineEnd:function(){ro&&rp(rs,rl),rd.point=k},polygonStart:function(){ro=!0},polygonEnd:function(){ro=null},result:function(){var e=+rh;return rh.reset(),e}};function rf(e,t){rd.point=rp,rs=ru=e,rl=rc=t}function rp(e,t){ru-=e,rc-=t,rh.add(w(ru*ru+rc*rc)),ru=e,rc=t}function rm(){this._string=[]}function rg(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function ry(e){return function(t){var r=new rv;for(var i in e)r[i]=e[i];return r.stream=t,r}}function rv(){}function rx(e,t,r){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=i&&e.clipExtent(null),L(r,e.stream(tZ)),t(tZ.result()),null!=i&&e.clipExtent(i),e}function rb(e,t,r){return rx(e,function(r){var i=t[1][0]-t[0][0],n=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),n/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,s=+t[0][1]+(n-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,s])},r)}function r_(e,t,r){return rb(e,[[0,0],t],r)}function rw(e,t,r){return rx(e,function(r){var i=+t,n=i/(r[1][0]-r[0][0]),a=(i-n*(r[1][0]+r[0][0]))/2,o=-n*r[0][1];e.scale(150*n).translate([a,o])},r)}function rT(e,t,r){return rx(e,function(r){var i=+t,n=i/(r[1][1]-r[0][1]),a=-n*r[0][0],o=(i-n*(r[1][1]+r[0][1]))/2;e.scale(150*n).translate([a,o])},r)}rm.prototype={_radius:4.5,_circle:rg(4.5),pointRadius:function(e){return(e*=1)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=0/0},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=0/0},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=rg(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(!this._string.length)return null;var e=this._string.join("");return this._string=[],e}},rv.prototype={constructor:rv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var rA=m(30*h);function rM(e,t){var r;return+t?function(e,t){function r(i,n,a,o,s,l,u,c,h,f,m,g,y,v){var x=u-i,b=c-n,_=x*x+b*b;if(_>4*t&&y--){var T=o+f,A=s+m,k=l+g,S=w(T*T+A*A+k*k),E=M(k/=S),D=1e-6>d(d(k)-1)||1e-6>d(a-h)?(a+h)/2:p(A,T),C=e(D,E),I=C[0],L=C[1],P=I-i,z=L-n,F=b*P-x*z;(F*F/_>t||d((x*P+b*z)/_-.5)>.3||o*f+s*m+l*g2?e[2]%360*h:0,L()):[v*c,x*c,b*c]},C.angle=function(e){return arguments.length?(_=e%360*h,L()):_*c},C.reflectX=function(e){return arguments.length?(T=e?-1:1,L()):T<0},C.reflectY=function(e){return arguments.length?(A=e?-1:1,L()):A<0},C.precision=function(e){return arguments.length?(o=rM(s,D=e*e),P()):w(D)},C.fitExtent=function(e,t){return rb(C,e,t)},C.fitSize=function(e,t){return r_(C,e,t)},C.fitWidth=function(e,t){return rw(C,e,t)},C.fitHeight=function(e,t){return rT(C,e,t)},function(){return t=e.apply(this,arguments),C.invert=t.invert&&I,L()}}function rC(e){var t=0,r=o/3,i=rD(e),n=i(t,r);return n.parallels=function(e){return arguments.length?i(t=e[0]*h,r=e[1]*h):[t*c,r*c]},n}function rI(e,t){var r=b(e),i=(r+b(t))/2;if(1e-6>d(i)){var n=m(e);function a(e,t){return[e*n,b(t)/n]}return a.invert=function(e,t){return[e/n,M(t*n)]},a}var s=1+r*(2*i-r),l=w(s)/i;function u(e,t){var r=w(s-2*i*b(t))/i;return[r*b(e*=i),l-r*m(e)]}return u.invert=function(e,t){var r=l-t,n=p(e,d(r))*_(r);return r*i<0&&(n-=o*_(e)*_(r)),[n/i,M((s-(e*e+r*r)*i*i)/(2*i))]},u}function rL(){return rC(rI).scale(155.424).center([0,33.6442])}function rP(){return rL().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function rz(e){return function(t,r){var i=m(t),n=m(r),a=e(i*n);return[a*n*b(t),a*b(r)]}}function rF(e){return function(t,r){var i=w(t*t+r*r),n=e(i),a=b(n);return[p(t*a,i*m(n)),M(i&&r*a/i)]}}var rO=rz(function(e){return w(2/(1+e))});rO.invert=rF(function(e){return 2*M(e/2)});var rR=rz(function(e){return(e=A(e))&&e/b(e)});function rB(e,t){return[e,v(T((s+t)/2))]}function rj(e){var t,r,i,n=rE(e),a=n.center,s=n.scale,l=n.translate,u=n.clipExtent,c=null;function h(){var a=o*s(),l=n(e0(n.rotate()).invert([0,0]));return u(null==c?[[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]]:e===rB?[[Math.max(l[0]-a,c),t],[Math.min(l[0]+a,r),i]]:[[c,Math.max(l[1]-a,t)],[r,Math.min(l[1]+a,i)]])}return n.scale=function(e){return arguments.length?(s(e),h()):s()},n.translate=function(e){return arguments.length?(l(e),h()):l()},n.center=function(e){return arguments.length?(a(e),h()):a()},n.clipExtent=function(e){return arguments.length?(null==e?c=t=r=i=null:(c=+e[0][0],t=+e[0][1],r=+e[1][0],i=+e[1][1]),h()):null==c?null:[[c,t],[r,i]]},h()}function rN(e){return T((s+e)/2)}function rV(e,t){var r=m(e),i=e===t?b(e):v(r/m(t))/v(rN(t)/rN(e)),n=r*x(rN(e),i)/i;if(!i)return rB;function a(e,t){n>0?t<-s+1e-6&&(t=-s+1e-6):t>s-1e-6&&(t=s-1e-6);var r=n/x(rN(t),i);return[r*b(i*e),n-r*m(i*e)]}return a.invert=function(e,t){var r=n-t,a=_(i)*w(e*e+r*r),l=p(e,d(r))*_(r);return r*i<0&&(l-=o*_(e)*_(r)),[l/i,2*f(x(n/a,1/i))-s]},a}function rU(e,t){return[e,t]}function rq(e,t){var r=m(e),i=e===t?b(e):(r-m(t))/(t-e),n=r/i+e;if(1e-6>d(i))return rU;function a(e,t){var r=n-t,a=i*e;return[r*b(a),n-r*m(a)]}return a.invert=function(e,t){var r=n-t,a=p(e,d(r))*_(r);return r*i<0&&(a-=o*_(e)*_(r)),[a/i,n-_(i)*w(e*e+r*r)]},a}rR.invert=rF(function(e){return e}),rB.invert=function(e,t){return[e,2*f(y(t))-s]},rU.invert=rU;var rG=w(3)/2;function rH(e,t){var r=M(rG*b(t)),i=r*r,n=i*i*i;return[e*m(r)/(rG*(1.340264+-3*.081106*i+n*(7*893e-6+.034164*i))),r*(1.340264+-.081106*i+n*(893e-6+.003796*i))]}function r$(e,t){var r=m(t),i=m(e)*r;return[r*b(e)/i,b(t)/i]}function rW(e,t){var r=t*t,i=r*r;return[e*(.8707-.131979*r+i*(-.013791+i*(.003971*r-.001529*i))),t*(1.007226+r*(.015085+i*(-.044475+.028874*r-.005916*i)))]}function rY(e,t){return[m(t)*b(e),b(t)]}function rZ(e,t){var r=m(t),i=1+m(e)*r;return[r*b(e)/i,b(t)/i]}function rX(e,t){return[v(T((s+t)/2)),-e]}rH.invert=function(e,t){for(var r,i,n=t,a=n*n,o=a*a*a,s=0;s<12&&(i=n*(1.340264+-.081106*a+o*(893e-6+.003796*a))-t,n-=r=i/(1.340264+-3*.081106*a+o*(7*893e-6+.034164*a)),o=(a=n*n)*a*a,!(1e-12>d(r)));++s);return[rG*e*(1.340264+-3*.081106*a+o*(7*893e-6+.034164*a))/m(n),M(b(n)/rG)]},r$.invert=rF(f),rW.invert=function(e,t){var r,i=t,n=25;do{var a=i*i,o=a*a;i-=r=(i*(1.007226+a*(.015085+o*(-.044475+.028874*a-.005916*o)))-t)/(1.007226+a*(.045255+o*(-.311325+.259866*a-.005916*11*o)))}while(d(r)>1e-6&&--n>0);return[e/(.8707+(a=i*i)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),i]},rY.invert=rF(M),rZ.invert=rF(function(e){return 2*f(e)}),rX.invert=function(e,t){return[-t,2*f(y(e))-s]},e.geoAlbers=rP,e.geoAlbersUsa=function(){var e,t,r,i,n,a,o=rP(),s=rL().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=rL().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){a=[e,t]}};function c(e){var t=e[0],o=e[1];return a=null,r.point(t,o),a||(i.point(t,o),a)||(n.point(t,o),a)}function h(){return e=t=null,c}return c.invert=function(e){var t=o.scale(),r=o.translate(),i=(e[0]-r[0])/t,n=(e[1]-r[1])/t;return(n>=.12&&n<.234&&i>=-.425&&i<-.214?s:n>=.166&&n<.234&&i>=-.214&&i<-.115?l:o).invert(e)},c.stream=function(r){var i,n;return e&&t===r?e:(n=(i=[o.stream(t=r),s.stream(r),l.stream(r)]).length,e={point:function(e,t){for(var r=-1;++rey(i[0],i[1])&&(i[1]=n[1]),ey(n[0],i[1])>ey(i[0],i[1])&&(i[0]=n[0])):a.push(i=n);for(o=-1/0,r=a.length-1,t=0,i=a[r];t<=r;i=n,++t)n=a[t],(s=ey(i[1],n[0]))>o&&(o=s,J=n[0],ee=i[1])}return eo=es=null,1/0===J||1/0===Q?[[0/0,0/0],[0/0,0/0]]:[[J,Q],[ee,et]]},e.geoCentroid=function(e){eb=e_=ew=eT=eA=eM=ek=eS=eE=eD=eC=0,L(e,eO);var t=eE,r=eD,i=eC,n=t*t+r*r+i*i;return n<1e-12&&(t=eM,r=ek,i=eS,e_<1e-6&&(t=ew,r=eT,i=eA),(n=t*t+r*r+i*i)<1e-12)?[0/0,0/0]:[p(r,t)*c,M(i/w(n))*c]},e.geoCircle=function(){var e,t,r=eW([0,0]),i=eW(90),n=eW(6),a={point:function(r,i){e.push(r=t(r,i)),r[0]*=c,r[1]*=c}};function o(){var o=r.apply(this,arguments),s=i.apply(this,arguments)*h,l=n.apply(this,arguments)*h;return e=[],t=eX(-o[0]*h,-o[1]*h,0).invert,e1(a,s,l,1),o={type:"Polygon",coordinates:[e]},e=t=null,o}return o.center=function(e){return arguments.length?(r="function"==typeof e?e:eW([+e[0],+e[1]]),o):r},o.radius=function(e){return arguments.length?(i="function"==typeof e?e:eW(+e),o):i},o.precision=function(e){return arguments.length?(n="function"==typeof e?e:eW(+e),o):n},o},e.geoClipAntimeridian=tn,e.geoClipCircle=ta,e.geoClipExtent=function(){var e,t,r,i=0,n=0,a=960,o=500;return r={stream:function(r){return e&&t===r?e:e=to(i,n,a,o)(t=r)},extent:function(s){return arguments.length?(i=+s[0][0],n=+s[0][1],a=+s[1][0],o=+s[1][1],e=t=null,r):[[i,n],[a,o]]}}},e.geoClipRectangle=to,e.geoConicConformal=function(){return rC(rV).scale(109.5).parallels([30,30])},e.geoConicConformalRaw=rV,e.geoConicEqualArea=rL,e.geoConicEqualAreaRaw=rI,e.geoConicEquidistant=function(){return rC(rq).scale(131.154).center([0,13.9389])},e.geoConicEquidistantRaw=rq,e.geoContains=function(e,t){return(e&&tx.hasOwnProperty(e.type)?tx[e.type]:t_)(e,t)},e.geoDistance=tv,e.geoEqualEarth=function(){return rE(rH).scale(177.158)},e.geoEqualEarthRaw=rH,e.geoEquirectangular=function(){return rE(rU).scale(152.63)},e.geoEquirectangularRaw=rU,e.geoGnomonic=function(){return rE(r$).scale(144.049).clipAngle(60)},e.geoGnomonicRaw=r$,e.geoGraticule=tE,e.geoGraticule10=function(){return tE()()},e.geoIdentity=function(){var e,t,r,i,n,a,o,s=1,l=0,u=0,d=1,f=1,p=0,g=null,y=1,v=1,x=ry({point:function(e,t){var r=T([e,t]);this.stream.point(r[0],r[1])}}),_=tD;function w(){return y=s*d,v=s*f,a=o=null,T}function T(r){var i=r[0]*y,n=r[1]*v;if(p){var a=n*e-i*t;i=i*e+n*t,n=a}return[i+l,n+u]}return T.invert=function(r){var i=r[0]-l,n=r[1]-u;if(p){var a=n*e+i*t;i=i*e-n*t,n=a}return[i/y,n/v]},T.stream=function(e){return a&&o===e?a:a=x(_(o=e))},T.postclip=function(e){return arguments.length?(_=e,g=r=i=n=null,w()):_},T.clipExtent=function(e){return arguments.length?(_=null==e?(g=r=i=n=null,tD):to(g=+e[0][0],r=+e[0][1],i=+e[1][0],n=+e[1][1]),w()):null==g?null:[[g,r],[i,n]]},T.scale=function(e){return arguments.length?(s=+e,w()):s},T.translate=function(e){return arguments.length?(l=+e[0],u=+e[1],w()):[l,u]},T.angle=function(r){return arguments.length?(t=b(p=r%360*h),e=m(p),w()):p*c},T.reflectX=function(e){return arguments.length?(d=e?-1:1,w()):d<0},T.reflectY=function(e){return arguments.length?(f=e?-1:1,w()):f<0},T.fitExtent=function(e,t){return rb(T,e,t)},T.fitSize=function(e,t){return r_(T,e,t)},T.fitWidth=function(e,t){return rw(T,e,t)},T.fitHeight=function(e,t){return rT(T,e,t)},T},e.geoInterpolate=function(e,t){var r,i,n=e[0]*h,a=e[1]*h,o=t[0]*h,s=t[1]*h,l=m(a),u=b(a),d=m(s),f=b(s),g=l*m(n),y=l*b(n),v=d*m(o),x=d*b(o),_=2*M(w((r=b((r=s-a)/2))*r+l*d*((i=b((i=o-n)/2))*i))),T=b(_),A=_?function(e){var t=b(e*=_)/T,r=b(_-e)/T,i=r*g+t*v,n=r*y+t*x;return[p(n,i)*c,p(r*u+t*f,w(i*i+n*n))*c]}:function(){return[n*c,a*c]};return A.distance=_,A},e.geoLength=tm,e.geoMercator=function(){return rj(rB).scale(961/u)},e.geoMercatorRaw=rB,e.geoNaturalEarth1=function(){return rE(rW).scale(175.295)},e.geoNaturalEarth1Raw=rW,e.geoOrthographic=function(){return rE(rY).scale(249.5).clipAngle(90+1e-6)},e.geoOrthographicRaw=rY,e.geoPath=function(e,t){var r,i,n=4.5;function a(e){return e&&("function"==typeof n&&i.pointRadius(+n.apply(this,arguments)),L(e,r(i))),i.result()}return a.area=function(e){return L(e,r(tO)),tO.result()},a.measure=function(e){return L(e,r(rd)),rd.result()},a.bounds=function(e){return L(e,r(tZ)),tZ.result()},a.centroid=function(e){return L(e,r(t4)),t4.result()},a.projection=function(t){return arguments.length?(r=null==t?(e=null,tD):(e=t).stream,a):e},a.context=function(e){return arguments.length?(i=null==e?(t=null,new rm):new ra(t=e),"function"!=typeof n&&i.pointRadius(n),a):t},a.pointRadius=function(e){return arguments.length?(n="function"==typeof e?e:(i.pointRadius(+e),+e),a):n},a.projection(e).context(t)},e.geoProjection=rE,e.geoProjectionMutator=rD,e.geoRotation=e0,e.geoStereographic=function(){return rE(rZ).scale(250).clipAngle(142)},e.geoStereographicRaw=rZ,e.geoStream=L,e.geoTransform=function(e){return{stream:ry(e)}},e.geoTransverseMercator=function(){var e=rj(rX),t=e.center,r=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return arguments.length?r([e[0],e[1],e.length>2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)},e.geoTransverseMercatorRaw=rX,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&"u">typeof t?i(e,pw()):i((r=r||self).d3=r.d3||{},r.d3)}}),pA=m({"src/lib/usa_location_names.js"(e,t){var r={alabama:"AL",alaska:"AK",arizona:"AZ",arkansas:"AR",california:"CA",colorado:"CO",connecticut:"CT",delaware:"DE","district of columbia":"DC",florida:"FL",georgia:"GA",hawaii:"HI",idaho:"ID",illinois:"IL",indiana:"IN",iowa:"IA",kansas:"KS",kentucky:"KY",louisiana:"LA",maine:"ME",maryland:"MD",massachusetts:"MA",michigan:"MI",minnesota:"MN",mississippi:"MS",missouri:"MO",montana:"MT",nebraska:"NE",nevada:"NV","new hampshire":"NH","new jersey":"NJ","new mexico":"NM","new york":"NY","north carolina":"NC","north dakota":"ND",ohio:"OH",oklahoma:"OK",oregon:"OR",pennsylvania:"PA","rhode island":"RI","south carolina":"SC","south dakota":"SD",tennessee:"TN",texas:"TX",utah:"UT",vermont:"VT",virginia:"VA",washington:"WA","washington dc":"DC","washington d.c.":"DC","west virginia":"WV",wisconsin:"WI",wyoming:"WY"};t.exports={usaLocationAbbreviations:new Set(Object.values(r)),usaLocationList:r}}}),pM={};g(pM,{COUNTRIES_X:()=>pk});var pk,pS=p({"src/lib/custom_country_codes.ts"(){pk=[{iso3:"XAC",iso2:"",m49:"",name:"Aksai Chin",aliases:[]},{iso3:"XAP",iso2:"",m49:"",name:"Arunachal Pradesh",aliases:[]},{iso3:"XBT",iso2:"",m49:"",name:"Bir Tawil",aliases:[]},{iso3:"XHT",iso2:"",m49:"",name:"Halaib Triangle",aliases:[]},{iso3:"XIT",iso2:"",m49:"",name:"Ilemi Triangle",aliases:[]},{iso3:"XJK",iso2:"",m49:"",name:"Jammu and Kashmir",aliases:[]}]}}),pE=m({"src/lib/geo_location_utils.js"(e,t){var r=M(),{COUNTRIES:i,createLookup:n}=py(),{area:a}=pb(),{centroid:o}=p_(),{coordAll:s}=px(),{geoBounds:l}=pT(),u=e3(),c=ee(),h=z(),d=O(),f=id(),{usaLocationAbbreviations:p,usaLocationList:m}=pA(),{COUNTRIES_X:g}=(pS(),x(pM)),{lookupAlpha3:y}=n([...i,...g]),v={"ISO-3":u,"USA-states":function(e){return e=e.trim(),(p.has(e.toUpperCase())?e.toUpperCase():m[e.toLowerCase()])||(c.log("Unrecognized US location: "+e+"."),!1)},"country names":function(e){return y(e)||(c.log("Unrecognized country name: "+e+"."),!1)}};function b(e){for(let t=0;t0&&e[t+1][0]<0)return t;return null}function _(e){var t=e.geojson,r=window.PlotlyGeoAssets||{},i="string"==typeof t?r[t]:t;return h(i)?i:(c.error("Oops ... something went wrong when fetching "+t),!1)}function w(e){try{return s(e)}catch{return[]}}function T(e){if(0===e.length)return null;if(1===e.length){let[t,r]=e[0];return[t,r,t,r]}let[[t,r],[i,n]]=l({type:"MultiPoint",coordinates:e});return[t,r,k([t,i])[1],n]}var A=(e,t)=>"geojson"===t.fitbounds&&"geojson-id"===e.locationmode?w(_(e)):[];function k([e,t]){return[e,e>t?t+360:t]}t.exports={locationToFeature:function(e,t,r){var i;if(!t||"string"!=typeof t)return!1;let n=v[e](t);if(n){let t;if("USA-states"===e)for(let e of(t=[],r))(null==(i=e?.properties)?void 0:i.gu)==="USA"&&t.push(e);else t=r;for(let e of t)if(e.id===n)return e;c.log(`Location with id ${n} does not have a matching topojson feature at this resolution.`)}return!1},feature2polygons:function(e){var t,r,i,n,a=e.geometry,o=a.coordinates,s=e.id,l=[];switch(t="RUS"===s||"FJI"===s?function(e){var t;if(null===b(e))t=e;else for(t=Array(e.length),n=0;nt?r[i++]=[e[n][0]+360,e[n][1]]:n===t?(r[i++]=e[n],r[i++]=[e[n][0],-90]):r[i++]=e[n];var a=f.tester(r);a.pts.pop(),l.push(a)}:function(e){l.push(f.tester(e))},a.type){case"MultiPolygon":for(r=0;rn&&(n=u,t=l)}else t=r;return t&&t.coordinates.some(e=>e.length>0)?o(t).geometry.coordinates:[0/0,0/0]}(u),isNaN(u.properties.ct[0])&&c.log(["Location",i.loc,"has no polygon with positive area. Its centroid could not be computed, so hover and selection will not work for it."].join(" ")),i.fIn=e,i.fOut=u,s.push(u)}else c.log(["Location",i.loc,"does not have a valid GeoJSON geometry. Traces with locationmode *geojson-id* only support *Polygon* and *MultiPolygon* geometries."].join(" "))}delete n[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(i=0;i100?(clearInterval(a),i("Unexpected error while fetching from "+e)):void n++},50)})}(a)):(t[a]="pending",i.push(function(e){return new Promise(function(i,n){r.json(e,function(r,a){return r?(delete t[e],n(Error(404===r.status?'GeoJSON at URL "'+e+'" does not exist.':"Unexpected error while fetching from "+e))):(t[e]=a,i(a))})})}(a))))}return i},boundsOfCoords:T,computeBbox:e=>T(w(e)),coordsOf:w,doesCrossAntiMeridian:b,fitGeojsonBbox:(e,t)=>T(A(e,t)),fitGeojsonCoords:A,unwrapLonRange:k,ANTIMERIDIAN_LON_SHIFT:360}}}),pD=m({"src/traces/scattergeo/style.js"(e,t){var r=M(),i=rt(),n=er(),a=nn(),o=a.stylePoints,s=a.styleText;t.exports=function(e,t){var a,l,u,c;t&&(a=e,u=(l=t)[0].trace,(c=l[0].node3).style("opacity",l[0].trace.opacity),o(c,u,a),s(c,u,a),c.selectAll("path.js-line").style("fill","none").each(function(e){var t=r.select(this),a=e.trace,o=a.line||{};t.call(n.stroke,o.color).call(i.dashLine,o.dash||"",o.width||0),"none"!==a.fill&&t.call(n.fill,a.fillcolor)}))}}}),pC=m({"src/traces/scattergeo/plot.js"(e,t){var r=M(),i=tb(),n=pm().getTopojsonFeatures,a=pg(),o=pE(),s=ra().findExtremes,l=L().BADNUM,u=i5().calcMarkerSize,c=t6(),h=pD();t.exports={calcGeoJSON:function(e,t){var r,a,c=e[0].trace,h=t[c.geo],d=h._subplot,f=c._length;if(i.isArrayOrTypedArray(c.locations)){var p=c.locationmode,m="geojson-id"===p?o.extractTraceFeature(e):n(c,d.topojson);for(r=0;r")}}(u,m,e,l[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}}}}),pL=m({"src/traces/scattergeo/event_data.js"(e,t){t.exports=function(e,t,r,i,n){e.lon=t.lon,e.lat=t.lat,e.location=t.loc?t.loc:null;var a=i[n];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e}}}),pP=m({"src/traces/scattergeo/select.js"(e,t){var r=t6(),i=L().BADNUM;t.exports=function(e,t){var n,a,o,s,l,u=e.cd,c=e.xaxis,h=e.yaxis,d=[],f=u[0].trace;if(!r.hasMarkers(f)&&!r.hasText(f))return[];if(!1===t)for(l=0;lt?1:e>=t?0:0/0}function r(e){var r;return 1===e.length&&(r=e,e=function(e,i){return t(r(e),i)}),{left:function(t,r,i,n){for(null==i&&(i=0),null==n&&(n=t.length);i>>1;0>e(t[a],r)?i=a+1:n=a}return i},right:function(t,r,i,n){for(null==i&&(i=0),null==n&&(n=t.length);i>>1;e(t[a],r)>0?n=a:i=a+1}return i}}}var i=r(t),n=i.right,a=i.left;function o(e,t){return[e,t]}function s(e){return null===e?0/0:+e}function l(e,t){var r,i,n=e.length,a=0,o=-1,l=0,u=0;if(null==t)for(;++o1)return u/(a-1)}function u(e,t){var r=l(e,t);return r&&Math.sqrt(r)}function c(e,t){var r,i,n,a=e.length,o=-1;if(null==t){for(;++o=r)for(i=n=r;++or&&(i=r),n=r)for(i=n=r;++or&&(i=r),n=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=y?10:a>=v?5:a>=x?2:1)}function _(e,t,r){var i=Math.abs(t-e)/Math.max(0,r),n=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),a=i/n;return a>=y?n*=10:a>=v?n*=5:a>=x&&(n*=2),t=1)return+r(e[i-1],i-1,e);var i,n=(i-1)*t,a=Math.floor(n),o=+r(e[a],a,e);return o+(r(e[a+1],a+1,e)-o)*(n-a)}}function A(e,t){var r,i,n=e.length,a=-1;if(null==t){for(;++a=r)for(i=r;++ar&&(i=r)}else for(;++a=r)for(i=r;++ar&&(i=r);return i}function M(e){if(!(n=e.length))return[];for(var t=-1,r=A(e,k),i=Array(r);++te?1:t>=e?0:0/0},e.deviation=u,e.extent=c,e.histogram=function(){var e=m,t=c,r=w;function i(i){var a,o,s=i.length,l=Array(s);for(a=0;ah;)d.pop(),--f;var p,m=Array(f+1);for(a=0;a<=f;++a)(p=m[a]=[]).x0=a>0?d[a-1]:c,p.x1=a=r)for(i=r;++ai&&(i=r)}else for(;++a=r)for(i=r;++ai&&(i=r);return i},e.mean=function(e,t){var r,i=e.length,n=i,a=-1,o=0;if(null==t)for(;++a=0;)for(t=(i=e[n]).length;--t>=0;)r[--o]=i[t];return r},e.min=A,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,i=e.length-1,n=e[0],a=Array(i<0?0:i);rr(n=e[a],s)||0!==r(s,s))&&(s=n,o=a);if(0===r(s,s))return o}},e.shuffle=function(e,t,r){for(var i,n,a=(r??e.length)-(t=null==t?0:+t);a;)n=Math.random()*a--|0,i=e[a+t],e[a+t]=e[n+t],e[n+t]=i;return e},e.sum=function(e,t){var r,i=e.length,n=-1,a=0;if(null==t)for(;++n0)return[e];if((i=t0)for(e=Math.ceil(e/o),a=Array(n=Math.ceil((t=Math.floor(t/o))-e+1));++stypeof t?e:e.d3=e.d3||{})}}),pF=m({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(e,t){var r;r=function(e,t,r){var i=Math.abs,n=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,u=Math.log,c=Math.max,h=Math.min,d=Math.pow,f=Math.round,p=Math.sign||function(e){return e>0?1:e<0?-1:0},m=Math.sin,g=Math.tan,y=Math.PI,v=y/2,x=y/4,b=Math.SQRT1_2,_=E(2),w=E(y),T=2*y,A=180/y,M=y/180;function k(e){return e>1?v:e<-1?-v:Math.asin(e)}function S(e){return e>1?0:e<-1?y:Math.acos(e)}function E(e){return e>0?Math.sqrt(e):0}function D(e){return(s(e)-s(-e))/2}function C(e){return(s(e)+s(-e))/2}function I(e){var t=g(e/2),r=2*u(o(e/2))/(t*t);function n(e,t){var i=o(e),n=o(t),a=m(t),s=n*i,l=-((1-s?u((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*n*m(e),l*a]}return n.invert=function(t,n){var s,l=E(t*t+n*n),c=-e/2,h=50;if(!l)return[0,0];do{var d=c/2,f=o(d),p=m(d),g=p/f,y=-u(i(f));c-=s=(2/g*y-r*g-l)/(-y/(p*p)+1-r/(2*f*f))*(f<0?.7:1)}while(i(s)>1e-6&&--h>0);var v=m(c);return[a(t*v,l*o(c)),k(n*v/l)]},n}function L(e,t){var r,i=o(t),n=(r=S(i*o(e/=2)))?r/Math.sin(r):1;return[2*i*m(e)*n,m(t)*n]}function P(e){var t=m(e),r=o(e),n=e>=0?1:-1,s=g(n*e),l=(1+t-r)/2;function u(e,i){var u=o(i),c=o(e/=2);return[(1+u)*m(e),(n*i>-a(c,s)-.001?0:-(10*n))+l+m(i)*r-(1+u)*t*c]}return u.invert=function(e,u){var c=0,h=0,d=50;do{var f=o(c),p=m(c),g=o(h),y=m(h),v=1+g,x=v*p-e,b=l+y*r-v*t*f-u,_=v*f/2,w=-p*y,T=t*v*p/2,A=r*g+t*f*y,M=w*T-A*_,k=(b*w-x*A)/M/2,S=(x*T-b*_)/M;i(S)>2&&(S/=2),c-=k,h-=S}while((i(k)>1e-6||i(S)>1e-6)&&--d>0);return n*h>-a(o(c),s)-.001?[2*c,h]:null},u}function z(e,t){var r=g(t/2),i=E(1-r*r),n=1+i*o(e/=2),a=m(e)*i/n,s=r/n,l=a*a,u=s*s;return[4/3*a*(3+l-3*u),4/3*s*(3+3*l-u)]}L.invert=function(e,t){if(!(e*e+4*t*t>y*y+1e-6)){var r=e,n=t,a=25;do{var s,l=m(r),u=m(r/2),c=o(r/2),h=m(n),d=o(n),f=m(2*n),p=h*h,g=d*d,v=u*u,x=1-g*c*c,b=x?S(d*c)*E(s=1/x):s=0,_=2*b*d*u-e,w=b*h-t,T=s*(g*v+b*d*c*p),A=s*(.5*l*f-2*b*h*u),M=.25*s*(f*u-b*h*g*l),k=s*(p*c+b*v*d),D=A*M-k*T;if(!D)break;var C=(w*A-_*k)/D,I=(_*M-w*T)/D;r-=C,n-=I}while((i(C)>1e-6||i(I)>1e-6)&&--a>0);return[r,n]}},z.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&i(t)>1)return null;var r,n,s=1+e*e+t*t,l=E((s-E(s*s-4*t*t))/2),c=k(l)/3,h=l?u((r=i(t/l))+E(r*r-1))/3:u((n=i(e))+E(n*n+1))/3,d=o(c),f=C(h),g=f*f-d*d;return[2*p(e)*a(D(h)*d,.25-g),2*p(t)*a(f*m(c),.25+g)]};var F=E(8),O=u(1+_);function R(e,t){var r=i(t);return rv){var l=a(s[1],s[0]),u=E(s[0]*s[0]+s[1]*s[1]),c=r*f((l-v)/r)+v,h=a(m(l-=c),2-o(l));l=c+k(y/u*m(h))-h,s[0]=u*o(l),s[1]=u*m(l)}return s}return s.invert=function(e,i){var s=E(e*e+i*i);if(s>v){var l=a(i,e),u=r*f((l-v)/r)+v,c=l>u?-1:1,h=s*o(u-l),d=1/g(c*S((h-y)/E(y*(y-2*h)+s*s)));e=s*o(l=u+2*n((d+c*E(d*d-3))/3)),i=s*m(l)}return t.geoAzimuthalEquidistantRaw.invert(e,i)},s}function j(e,r){if(arguments.length<2&&(r=e),1===r)return t.geoAzimuthalEqualAreaRaw;if(1/0===r)return N;function i(i,n){var a=t.geoAzimuthalEqualAreaRaw(i/r,n);return a[0]*=e,a}return i.invert=function(i,n){var a=t.geoAzimuthalEqualAreaRaw.invert(i/e,n);return a[0]*=r,a},i}function N(e,t){return[e*o(t)/o(t/=2),2*m(t)]}function V(e,t,r){var n,a,o,s=100;r=void 0===r?0:+r,t*=1;do(a=e(r))===(o=e(r+1e-6))&&(o=a+1e-6),r-=n=-1e-6*(a-t)/(a-o);while(s-- >0&&i(n)>1e-6);return s<0?0/0:r}function U(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=1e-12),function(n,a,o,s){var l,u,c;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;hl){o-=u/=2,s-=c/=2;continue}l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=e(o+g,s),x=e(o,s+y),b=(v[0]-d[0])/g,_=(v[1]-d[1])/g,w=(x[0]-d[0])/y,T=(x[1]-d[1])/y,A=T*b-_*w,M=(.5>i(A)?.5:1)/A;if(u=(p*w-f*T)*M,c=(f*_-p*b)*M,o+=u,s+=c,i(u)0&&(n[1]*=1+a/1.5*n[0]*n[0]),n}return t.invert=U(t),t}function G(e,t){var r,n=e*m(t),a=30;do t-=r=(t+m(t)-n)/(1+o(t));while(i(r)>1e-6&&--a>0);return t/2}function H(e,t,r){function i(i,n){return[e*i*o(n=G(r,n)),t*m(n)]}return i.invert=function(i,n){return[i/(e*o(n=k(n/t))),k((2*n+m(2*n))/r)]},i}R.invert=function(e,t){if((a=i(t))1e-12&&--c>0);return[e/(o(l)*(F-1/m(l))),p(t)*l]},N.invert=function(e,t){var r=2*k(t/2);return[e*o(r/2)/o(r),r]};var $=H(_/v,_,y);function W(e,t){var r=G(y,t);return[2.00276*e/(1/o(t)+1.11072/o(r)),(t+_*m(r))/2.00276]}function Y(e){var r=0,i=t.geoProjectionMutator(e),n=i(r);return n.parallel=function(e){return arguments.length?i(r=e*M):r*A},n}function Z(e,t){return[e*o(t),t]}function X(e){if(!e)return Z;var t=1/g(e);function r(r,i){var n=t+e-i,a=n&&r*o(i)/n;return[n*m(a),t-n*o(a)]}return r.invert=function(r,i){var n=E(r*r+(i=t-i)*i),s=t+e-n;return[n/o(s)*a(r,i),s]},r}function K(e){function t(t,r){var i=v-r,n=i&&t*e*m(i)/i;return[i*m(n)/e,v-i*o(n)]}return t.invert=function(t,r){var i=t*e,n=v-r,o=E(i*i+n*n),s=a(i,n);return[(o?o/m(o):1)*s/e,v-o]},t}W.invert=function(e,t){var r,n,a=2.00276*t,s=t<0?-x:x,l=25;do n=a-_*m(s),s-=r=(m(2*s)+2*s-y*m(n))/(2*o(2*s)+2+y*o(n)*_*o(s));while(i(r)>1e-6&&--l>0);return[e*(1/o(n=a-_*m(s))+1.11072/o(s))/2.00276,n]},Z.invert=function(e,t){return[e/o(t),t]};var J=H(1,4/y,y);function Q(e,t,r,n,s,l){var u,c=o(l);if(i(e)>1||i(l)>1)u=S(r*s+t*n*c);else{var h=m(e/2),d=m(l/2);u=2*k(E(h*h+t*n*d*d))}return i(u)>1e-6?[u,a(n*m(l),t*s-r*n*c)]:[0,0]}function ee(e,t,r){return S((e*e+t*t-r*r)/(2*e*t))}function et(e,t,r){for(var i,n=[[e[0],e[1],m(e[1]),o(e[1])],[t[0],t[1],m(t[1]),o(t[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=n[2],s=0;s<3;++s,a=i)i=n[s],a.v=Q(i[1]-a[1],a[3],a[2],i[3],i[2],i[0]-a[0]),a.point=[0,0];var u=ee(n[0].v[0],n[2].v[0],n[1].v[0]),c=ee(n[0].v[0],n[1].v[0],n[2].v[0]),h=y-u;n[2].point[1]=0,n[0].point[0]=-(n[1].point[0]=n[0].v[0]/2);var d=[n[2].point[0]=n[0].point[0]+n[2].v[0]*o(u),2*(n[0].point[1]=n[1].point[1]=n[2].v[0]*m(u))];return function(e,t){var r,i=m(t),a=o(t),s=[,,,];for(r=0;r<3;++r){var u,f=n[r];if(s[r]=Q(t-f[1],f[3],f[2],a,i,e-f[0]),!s[r][0])return f.point;s[r][1]=(u=s[r][1]-f.v[1])-2*y*l((u+y)/(2*y))}var p=d.slice();for(r=0;r<3;++r){var g=2==r?0:r+1,v=ee(n[r].v[0],s[r][0],s[g][0]);s[r][1]<0&&(v=-v),r?1==r?(v=c-v,p[0]-=s[r][0]*o(v),p[1]-=s[r][0]*m(v)):(v=h-v,p[0]+=s[r][0]*o(v),p[1]+=s[r][0]*m(v)):(p[0]+=s[r][0]*o(v),p[1]-=s[r][0]*m(v))}return p[0]/=3,p[1]/=3,p}}function er(e){return e[0]*=M,e[1]*=M,e}function ei(e,r,i){var n=t.geoCentroid({type:"MultiPoint",coordinates:[e,r,i]}),a=[-n[0],-n[1]],o=t.geoRotation(a),s=et(er(o(e)),er(o(r)),er(o(i)));s.invert=U(s);var l=t.geoProjection(s).rotate(a),u=l.center;return delete l.rotate,l.center=function(e){return arguments.length?u(o(e)):o.invert(u())},l.clipAngle(90)}function en(e,t){var r=E(1-m(t));return[2/w*e*r,w*(1-r)]}function ea(e){var t=g(e);function r(e,r){return[e,(e?e/m(e):1)*(m(r)*o(e)-t*o(r))]}return r.invert=t?function(e,r){e&&(r*=m(e)/e);var i=o(e);return[e,2*a(E(i*i+t*t-r*r)-i,t-r)]}:function(e,t){return[e,k(e?t*g(e)/e:t)]},r}en.invert=function(e,t){var r=(r=t/w-1)*r;return[r>0?e*E(y/r)/2:0,k(1-r)]};var eo=E(3);function es(e,t){return[eo*e*(2*o(2*t/3)-1)/w,eo*w*m(t/3)]}function el(e){var t=o(e);function r(e,r){return[e*t,m(r)/t]}return r.invert=function(e,r){return[e/t,k(r*t)]},r}function eu(e){var t=o(e);function r(e,r){return[e*t,(1+t)*g(r/2)]}return r.invert=function(e,r){return[e/t,2*n(r/(1+t))]},r}function ec(e,t){var r=E(8/(3*y));return[r*e*(1-i(t)/y),r*t]}function eh(e,t){var r=E(4-3*m(i(t)));return[2/E(6*y)*e*r,p(t)*E(2*y/3)*(2-r)]}function ed(e,t){var r=E(y*(4+y));return[2/r*e*(1+E(1-4*t*t/(y*y))),4/r*t]}function ef(e,t){var r=(2+v)*m(t);t/=2;for(var n=0,a=1/0;n<10&&i(a)>1e-6;n++){var s=o(t);t-=a=(t+m(t)*(s+2)-r)/(2*s*(1+s))}return[2/E(y*(4+y))*e*(1+o(t)),2*E(y/(4+y))*m(t)]}function ep(e,t){return[e*(1+o(t))/E(2+y),2*t/E(2+y)]}function em(e,t){for(var r=(1+v)*m(t),n=0,a=1/0;n<10&&i(a)>1e-6;n++)t-=a=(t+m(t)-r)/(1+o(t));return r=E(2+y),[e*(1+o(t))/r,2*t/r]}es.invert=function(e,t){var r=3*k(t/(eo*w));return[w*e/(eo*(2*o(2*r/3)-1)),r]},ec.invert=function(e,t){var r=E(8/(3*y)),n=t/r;return[e/(r*(1-i(n)/y)),n]},eh.invert=function(e,t){var r=2-i(t)/E(2*y/3);return[e*E(6*y)/(2*r),p(t)*k((4-r*r)/3)]},ed.invert=function(e,t){var r=E(y*(4+y))/2;return[e*r/(1+E(1-t*t*(4+y)/(4*y))),t*r/2]},ef.invert=function(e,t){var r=t*E((4+y)/y)/2,i=k(r),n=o(i);return[e/(2/E(y*(4+y))*(1+n)),k((i+r*(n+2))/(2+v))]},ep.invert=function(e,t){var r=E(2+y),i=t*r/2;return[r*e/(1+o(i)),i]},em.invert=function(e,t){var r=1+v,i=E(r/2);return[2*e*i/(1+o(t*=i)),k((t+m(t))/r)]};var eg=3+2*_;function ey(e,t){var r=m(e/=2),i=o(e),a=E(o(t)),s=o(t/=2),l=m(t)/(s+_*i*a),c=E(2/(1+l*l)),h=E((_*s+(i+r)*a)/(_*s+(i-r)*a));return[eg*(c*(h-1/h)-2*u(h)),eg*(c*l*(h+1/h)-2*n(l))]}ey.invert=function(e,t){if(!(r=z.invert(e/1.2,1.065*t)))return null;var r,a=r[0],s=r[1],l=20;e/=eg,t/=eg;do{var d=a/2,f=s/2,p=m(d),g=o(d),y=m(f),x=o(f),w=o(s),T=E(w),A=y/(x+_*g*T),M=A*A,k=E(2/(1+M)),S=(_*x+(g+p)*T)/(_*x+(g-p)*T),D=E(S),C=D-1/D,I=D+1/D,L=k*C-2*u(D)-e,P=k*A*I-2*n(A)-t,F=y&&b*T*p*M/y,O=(_*g*x+T)/(2*(x+_*g*T)*(x+_*g*T)*T),R=-.5*A*k*k*k,B=R*F,j=R*O,N=(N=2*x+_*T*(g-p))*N*D,V=(_*g*x*T+w)/N,U=-(_*p*y)/(T*N),q=C*B-2*V/D+k*(V+V/S),G=C*j-2*U/D+k*(U+U/S),H=A*I*B-2*F/(1+M)+k*I*F+k*A*(V-V/S),$=A*I*j-2*O/(1+M)+k*I*O+k*A*(U-U/S),W=G*H-$*q;if(!W)break;var Y=(P*G-L*$)/W,Z=(L*H-P*q)/W;a-=Y,s=c(-v,h(v,s-Z))}while((i(Y)>1e-6||i(Z)>1e-6)&&--l>0);return 1e-6>i(i(s)-v)?[0,s]:l&&[a,s]};var ev=o(35*M);function ex(e,t){var r=g(t/2);return[e*ev*E(1-r*r),(1+ev)*r]}function eb(e,t){var r=t/2,i=o(r);return[2*e/w*o(t)*i*i,w*g(r)]}function e_(e){var t=1-e,r=n(y,0)[0]-n(-y,0)[0],i=E(2*(n(0,v)[1]-n(0,-v)[1])/r);function n(r,i){var n=o(i),a=m(i);return[n/(t+e*n)*r,t*i+e*a]}function a(e,t){var r=n(e,t);return[r[0]*i,r[1]/i]}function s(e){return a(0,e)[1]}return a.invert=function(r,n){var a=V(s,n);return[r/i*(e+t/o(a)),a]},a}function ew(e){return[e[0]/2,k(g(e[1]/2*M))*A]}function eT(e){return[2*e[0],2*n(m(e[1]*M))*A]}function eA(e,r){var n=2*y/r,s=e*e;function l(r,l){var u=t.geoAzimuthalEquidistantRaw(r,l),c=u[0],h=u[1],d=c*c+h*h;if(d>s){var p=E(d),g=a(h,c),x=n*f(g/n),b=g-x,_=e*o(b),w=(e*m(b)-b*m(_))/(v-_),T=eM(b,w),A=(y-e)/ek(T,_,y);c=p;var M,k=50;do c-=M=(e+ek(T,_,c)*A-p)/(T(c)*A);while(i(M)>1e-6&&--k>0);h=b*m(c),cs){var c=E(u),h=a(l,r),d=n*f(h/n),p=h-d;r=c*o(p),l=c*m(p);for(var g=r-v,x=m(r),b=l/x,_=ri(_)||!--w)break;b-=_=(b*x-S*g-l)/(x-2*g*(k*(A+b*T*o(A)-M)-T*(T-b*M))/(k*k))}r=(c=e+ek(D,A,r)*(y-e)/ek(D,A,y))*o(h=d+b),l=c*m(h)}return t.geoAzimuthalEquidistantRaw.invert(r,l)},l}function eM(e,t){return function(r){var i=e*o(r);return r1e-6||i(f)>1e-6)&&--v>0);return[p,g]},c}ex.invert=function(e,t){var r=t/(1+ev);return[e&&e/(ev*E(1-r*r)),2*n(r)]},eb.invert=function(e,t){var r=n(t/w),i=o(r),a=2*r;return[e*w/2/(o(a)*i*i),a]};var eE=eS(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),eD=eS(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),eC=eS(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function eI(e,t){var r=e*e,i=t*t;return[e*(1-.162388*i)*(.87-952426e-9*r*r),t*(1+i/12)]}eI.invert=function(e,t){var r,n=e,a=t,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-t)/(1+s/4)}while(i(r)>1e-6&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=n*n)*l;n-=r=(n*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(i(r)>1e-6&&--o>0);return[n,a]};var eL=eS(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function eP(e){var t=e(v,0)[0]-e(-v,0)[0];function r(r,i){var n=r>0?-.5:.5,a=e(r+n*y,i);return a[0]-=n*t,a}return e.invert&&(r.invert=function(r,i){var n=r>0?-.5:.5,a=e.invert(r+n*t,i),o=a[0]-n*y;return o<-y?o+=2*y:o>y&&(o-=2*y),a[0]=o,a}),r}function ez(e,t){var r=p(e),n=p(t),s=o(t),l=o(e)*s,u=m(e)*s,c=m(n*t);e=i(a(u,c)),t=k(l),i(e-v)>1e-6&&(e%=v);var h=function(e,t){if(t===v)return[0,0];var r,n,a=m(t),s=a*a,l=s*s,u=1+l,c=1+3*l,h=1-l,d=k(1/E(u)),f=h+s*u*d,p=(1-a)/f,g=E(p),x=p*u,b=E(x),_=g*h;if(0===e)return[0,-(_+s*b)];var w,T=o(t),A=1/T,M=2*a*T,S=(-f*T-(-3*s+d*c)*M*(1-a))/(f*f),D=s*u*S+p*c*M,C=-A*M,I=-A*D,L=-2*A*(.5*S/g*h-2*s*g*M),P=4*e/y;if(e>.222*y||t.175*y){if(r=(_+s*E(x*(1+l)-_*_))/(1+l),e>y/4)return[r,r];var z=r,F=.5*r;r=.5*(F+z),n=50;do{var O=E(x-r*r),R=r*(L+C*O)+I*k(r/b)-P;if(!R)break;R<0?F=r:z=r,r=.5*(F+z)}while(i(z-F)>1e-6&&--n>0)}else{r=1e-6,n=25;do{var B=r*r,j=E(x-B),N=L+C*j,V=r*N+I*k(r/b)-P,U=N+(I-C*B)/j;r-=w=j?V/U:0}while(i(w)>1e-6&&--n>0)}return[r,-_-s*E(x-r*r)]}(e>y/4?v-e:e,t);return e>y/4&&(c=h[0],h[0]=-h[1],h[1]=-c),h[0]*=r,h[1]*=-n,h}function eF(e,t){if(t<1e-6)return c=m(e),l=o(e),a=t*(e-c*l)/4,[c-a*l,l+a*c,1-t*c*c/2,e-a];if(t>=1-1e-6){var r;return a=(1-t)/4,l=C(e),c=((r=s(2*(r=e)))-1)/(r+1),u=1/l,[c+a*((h=l*D(e))-e)/(l*l),u-a*c*u*(h-e),u+a*c*u*(h+e),2*n(s(e))-v+a*(h-e)/l]}var a,l,u,c,h,d=[1,0,0,0,0,0,0,0,0],f=[E(t),0,0,0,0,0,0,0,0],p=0;for(l=E(1-t),h=1;i(f[p]/d[p])>1e-6&&p<8;)a=d[p++],f[p]=(a-l)/2,d[p]=(a+l)/2,l=E(a*l),h*=2;u=h*d[p]*e;do u=(k(c=f[p]*m(l=u)/d[p])+u)/2;while(--p);return[m(u),c=o(u),c/o(u-l),u]}function eO(e,t){if(!t)return e;if(1===t)return u(g(e/2+x));for(var r=1,a=E(1-t),o=E(t),s=0;i(o)>1e-6;s++){if(e%y){var l=n(a*g(e)/r);l<0&&(l+=y),e+=l+~~(e/y)*y}else e+=e;o=(r+a)/2,a=E(r*a),o=((r=o)-a)/2}return e/(d(2,s)*r)}function eR(e,t){var r,l,c,h,d,f=(_-1)/(_+1),x=E(1-f*f),b=eO(v,x*x),w=s(-1*u(g(y/4+i(t)/2)))/E(f),T=(r=w*o(-1*e),l=w*m(-1*e),c=r*r,h=l+1,[.5*((r>=0?v:-v)-a(d=1-c-l*l,2*r)),-.25*u(d*d+4*c)+.5*u(h*h+c)]),A=function(e,t,r){var a=i(e),o=D(i(t));if(a){var s=1/m(a),l=1/(g(a)*g(a)),u=-(l+o*o*s*s*r-1+r),c=(-u+E(u*u-(r-1)*l*4))/2;return[eO(n(1/E(c)),r)*p(e),eO(n(E((c/l-1)/r)),1-r)*p(t)]}return[0,eO(n(o),1-r)*p(t)]}(T[0],T[1],x*x);return[-A[1],(t>=0?1:-1)*(.5*b-A[0])]}function eB(e){var t=m(e),r=o(e),n=ej(e);function s(e,a){var s=n(e,a);e=s[0];var l=m(a=s[1]),u=o(a),c=o(e),h=S(t*l+r*u*c),d=m(h),f=i(d)>1e-6?h/d:1;return[f*r*m(e),(i(e)>v?f:-f)*(t*u-r*l*c)]}return n.invert=ej(-e),s.invert=function(e,r){var i=E(e*e+r*r),s=-m(i),l=o(i),u=i*l,c=-r*s,h=i*t,d=E(u*u+c*c-h*h),f=a(u*h+c*d,c*h-u*d),p=(i>v?-1:1)*a(e*s,i*o(f)*l+r*m(f)*s);return n.invert(p,f)},s}function ej(e){var t=m(e),r=o(e);return function(e,i){var n=o(i),s=o(e)*n,l=m(e)*n,u=m(i);return[a(l,s*r-u*t),k(u*r+s*t)]}}ez.invert=function(e,t){i(e)>1&&(e=2*p(e)-e),i(t)>1&&(t=2*p(t)-t);var r=p(e),n=p(t),s=-r*e,l=-n*t,u=l/s<1,c=function(e,t){for(var r=0,n=1,a=.5,s=50;;){var l=a*a,u=E(a),c=k(1/E(1+l)),h=1-l+a*(1+l)*c,d=(1-u)/h,f=E(d),p=d*(1+l),m=f*(1-l),g=E(p-e*e),v=t+m+a*g;if(1e-12>i(n-r)||0==--s||0===v)break;v>0?r=a:n=a,a=.5*(r+n)}if(!s)return null;var x=k(u),b=o(x),_=1/b,w=2*u*b,T=(-h*b-(-3*a+c*(1+3*l))*w*(1-u))/(h*h),A=.5*T/f*(1-l)-2*a*f*w,M=-_*(a*(1+l)*T+d*(1+3*l)*w);return[y/4*(e*(-2*_*A+-_*w*g)+M*k(e/E(p))),x]}(u?l:s,u?s:l),h=c[0],d=c[1],f=o(d);return u&&(h=-v-h),[r*(a(m(h)*f,-m(d))+y),n*k(o(h)*f)]},eR.invert=function(e,t){var r,i,o,l,c,h,d,f,p,m=(_-1)/(_+1),g=E(1-m*m),y=(r=.5*eO(v,g*g)-t,i=-e,o=g*g,r?(l=eF(r,o),i?(h=(c=eF(i,1-o))[1]*c[1]+o*l[0]*l[0]*c[0]*c[0],[[l[0]*c[2]/h,l[1]*l[2]*c[0]*c[1]/h],[l[1]*c[1]/h,-l[0]*l[2]*c[0]*c[2]/h],[l[2]*c[1]*c[2]/h,-o*l[0]*l[1]*c[0]/h]]):[[l[0],0],[l[1],0],[l[2],0]]):[[0,(c=eF(i,1-o))[0]/c[1]],[1/c[1],0],[c[2]/c[1],0]]),x=(d=y[0],p=(f=y[1])[0]*f[0]+f[1]*f[1],[(d[0]*f[0]+d[1]*f[1])/p,(d[1]*f[0]-d[0]*f[1])/p]);return[-(a(x[1],x[0])/1),2*n(s(-.5*u(m*x[0]*x[0]+m*x[1]*x[1])))-v]};var eN=k(1-1/3)*A,eV=el(0);function eU(e){var t=eN*M,r=en(y,t)[0]-en(-y,t)[0],n=eV(0,t)[1],a=en(0,t)[1],o=w-a,s=T/e,u=4/T,d=n+o*o*4/T;function f(f,p){var m,g=i(p);if(g>t){var v=h(e-1,c(0,l((f+y)/s)));f+=y*(e-1)/e-v*s,(m=en(f,g))[0]=m[0]*T/r-T*(e-1)/(2*e)+v*T/e,m[1]=n+(m[1]-a)*4*o/T,p<0&&(m[1]=-m[1])}else m=eV(f,p);return m[0]*=u,m[1]/=d,m}return f.invert=function(t,f){t/=u;var p=i(f*=d);if(p>n){var m=h(e-1,c(0,l((t+y)/s)));t=(t+y*(e-1)/e-m*s)*r/T;var g=en.invert(t,.25*(p-n)*T/o+a);return g[0]-=y*(e-1)/e-m*s,f<0&&(g[1]=-g[1]),g}return eV.invert(t,f)},f}function eq(e,t){return[e,1&t?90-1e-6:eN]}function eG(e,t){return[e,1&t?-90+1e-6:-eN]}function eH(e){return[e[0]*(1-1e-6),e[1]]}function e$(e){var t,r=1+e,n=k(m(1/r)),s=2*E(y/(t=y+4*n*r)),l=.5*s*(r+E(e*(2+e))),u=e*e,c=r*r;function h(h,d){var f,p,g=1-m(d);if(g&&g<2){var x,b=v-d,_=25;do{var w=m(b),T=o(b),A=n+a(w,r-T),M=1+c-2*r*T;b-=x=(b-u*n-r*w+M*A-.5*g*t)/(2*r*w*A)}while(i(x)>1e-12&&--_>0);f=s*E(M),p=h*A/y}else f=s*(e+g),p=h*n/y;return[f*m(p),l-f*o(p)]}return h.invert=function(e,i){var o=e*e+(i-=l)*i,h=(1+c-o/(s*s))/(2*r),d=S(h),f=m(d),p=n+a(f,r-h);return[k(e/E(o))*y/p,k(1-2*(d-u*n-r*f+(1+c-2*r*h)*p)/t)]},h}function eW(e,t){return t>-.7109889596207567?(e=$(e,t),e[1]+=.0528035274542,e):Z(e,t)}function eY(e,t){return i(t)>.7109889596207567?(e=$(e,t),e[1]-=t>0?.0528035274542:-.0528035274542,e):Z(e,t)}function eZ(e,t,r,i){var n=E(4*y/(2*r+(1+e-t/2)*m(2*r)+(e+t)/2*m(4*r)+t/2*m(6*r))),a=E(i*m(r)*E((1+e*o(2*r)+t*o(4*r))/(1+e+t))),s=r*u(1);function l(r){return E(1+e*o(2*r)+t*o(4*r))}function u(i){var n=i*r;return(2*n+(1+e-t/2)*m(2*n)+(e+t)/2*m(4*n)+t/2*m(6*n))/r}function c(e){return l(e)*m(e)}var h=function(e,t){var i=r*V(u,s*m(t)/r,t/y);isNaN(i)&&(i=r*p(t));var c=n*l(i);return[c*a*e/y*o(i),c/a*m(i)]};return h.invert=function(e,t){var i=V(c,t*a/n);return[e*y/(o(i)*n*a*l(i)),k(r*u(i/r)/s)]},0===r&&(n=E(i/y),(h=function(e,t){return[e*n,m(t)/n]}).invert=function(e,t){return[e/n,k(t*n)]}),h}function eX(e,t,r){function n(r){return e+(1-e)*d(1-d(r,t),1/t)}function a(e){var t,r,i,a,o;return void 0===t&&(t=20),r=n(0),o=(r+4*(i=n(.5*(0+e)))+(a=n(e)))*(e-0)/6,function e(t,r,i,n,a,o,s,l,u,c,h){var d,f,p,m,g,y,v,x,b,_;if(h.nanEncountered)return 0/0;if(d=i-r,f=t(r+.25*d),p=t(i-.25*d),isNaN(f)||isNaN(p)){h.nanEncountered=!0;return}return _=((y=(m=d*(n+4*f+a)/12)+(g=d*(a+4*p+o)/12))-s)/15,c>u?(h.maxDepthCount++,y+_):Math.abs(_)e?r=i:t=i,i=t+r>>1;while(i>t);var n=l[i+1]-l[i];return n&&(n=(e-l[i+1])/n),(i+1+n)/1e3}var h=2*c(1)/y*o/r,f=function(e,t){var r=c(i(m(t))),a=n(r)*e;return r/=h,[a,t>=0?r:-r]};return f.invert=function(e,t){var r;return 1>i(t*=h)&&(r=p(t)*k(a(i(t))*o)),[e/n(i(t)),r]},f}function eK(e,t){for(var r,i,n,a=-1,o=e.length,s=e[0],l=[];++aa[o][2][0];++o);var l=e(t-a[o][1][0],r);return l[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}a?o.invert=a(o):e.invert&&(o.invert=function(t,r){for(var a=l[+(r<0)],s=n[+(r<0)],u=0,c=a.length;ui(d[0]-f[0])&&1e-6>i(d[1]-f[1]))?p:null}}});var s,l,u=t.geoProjection(o),c=u.stream;return u.stream=function(e){var r=u.rotate(),i=c(e),n=(u.rotate([0,0]),c(e));return u.rotate(r),i.sphere=function(){t.geoStream(s,n)},i},u.lobes=function(t){return arguments.length?(s=function(e){var t,i,n,a,o,s,l,u=[],c=e[0].length;for(l=0;l=0;--l)i=(t=e[1][l])[0][0],n=t[0][1],a=t[1][1],o=t[2][0],s=t[2][1],u.push(eK([[o-1e-6,s-1e-6],[o-1e-6,a+1e-6],[i+1e-6,a+1e-6],[i+1e-6,n-1e-6]],30));return{type:"Polygon",coordinates:[r.merge(u)]}}(t),l=(n=t.map(function(e){return e.map(function(e){return[[e[0][0]*M,e[0][1]*M],[e[1][0]*M,e[1][1]*M],[e[2][0]*M,e[2][1]*M]]})})).map(function(t){return t.map(function(t){var r,i=e(t[0][0],t[0][1])[0],n=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[i,a],[n,o]]})}),u):n.map(function(e){return e.map(function(e){return[[e[0][0]*A,e[0][1]*A],[e[1][0]*A,e[1][1]*A],[e[2][0]*A,e[2][1]*A]]})})},null!=n&&u.lobes(n),u}eW.invert=function(e,t){return t>-.7109889596207567?$.invert(e,t-.0528035274542):Z.invert(e,t)},eY.invert=function(e,t){return i(t)>.7109889596207567?$.invert(e,t+(t>0?.0528035274542:-.0528035274542)):Z.invert(e,t)};var eQ=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],e0=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],e1=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],e2=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],e3=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],e5=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function e4(e,t){return[3/T*e*E(y*y/3-t*t),t]}function e6(e){function t(t,r){if(1e-6>i(i(r)-v))return[0,r<0?-2:2];var n=m(r),a=d((1+n)/(1-n),e/2),s=.5*(a+1/a)+o(t*=e);return[2*m(t)/s,(a-1/a)/s]}return t.invert=function(t,r){var n=i(r);if(1e-6>i(n-2))return t?null:[0,p(r)*v];if(n>2)return null;t/=2,r/=2;var o=t*t,s=r*r,l=2*r/(1+o+s);return l=d((1+l)/(1-l),1/e),[a(2*t,1-o-s)/e,k((l-1)/(l+1))]},t}e4.invert=function(e,t){return[T/3*e/E(y*y/3-t*t),t]};var e8=y/_;function e7(e,t){return[e*(1+E(o(t)))/2,t/(o(t/2)*o(e/6))]}function e9(e,t){var r=e*e,i=t*t;return[e*(.975534+i*(-.119161+-.0143059*r+-.0547009*i)),t*(1.00384+r*(.0802894+-.02855*i+199025e-9*r)+i*(.0998909+-.0491032*i))]}function te(e,t){return[m(e)/o(t),g(t)*o(e)]}function tt(e){var t=o(e),r=g(x+e/2);function n(n,a){var o=a-e,s=1e-6>i(o)?n*t:1e-6>i(s=x+a/2)||1e-6>i(i(s)-v)?0:n*o/u(g(s)/r);return[s,o]}return n.invert=function(n,a){var o,s=a+e;return[1e-6>i(a)?n/t:1e-6>i(o=x+s/2)||1e-6>i(i(o)-v)?0:n*u(g(o)/r)/a,s]},n}function tr(e,t){return[e,1.25*u(g(x+.4*t))]}function ti(e){var t=e.length-1;function r(r,i){for(var n,a=o(i),s=2/(1+a*o(r)),l=s*a*m(r),u=s*m(i),c=t,h=e[c],d=h[0],f=h[1];--c>=0;)d=(h=e[c])[0]+l*(n=d)-u*f,f=h[1]+l*f+u*n;return[d=l*(n=d)-u*f,f=l*f+u*n]}return r.invert=function(r,s){var l=20,u=r,c=s;do{for(var h,d=t,f=e[d],p=f[0],g=f[1],y=0,v=0;--d>=0;)f=e[d],y=p+u*(h=y)-c*v,v=g+u*v+c*h,p=f[0]+u*(h=p)-c*g,g=f[1]+u*g+c*h;y=p+u*(h=y)-c*v,v=g+u*v+c*h,p=u*(h=p)-c*g-r,g=u*g+c*h-s;var x,b,_=y*y+v*v;u-=x=(p*y+g*v)/_,c-=b=(g*y-p*v)/_}while(i(x)+i(b)>1e-12&&--l>0);if(l){var w=E(u*u+c*c),T=2*n(.5*w),A=m(T);return[a(u*A,w*o(T)),w?k(c*A/w):0]}},r}e7.invert=function(e,t){var r=i(e),n=i(t),a=1e-6,s=v;ni(A)&&1e-6>i(M))break}return[e<0?-a:a,t<0?-s:s]},e9.invert=function(e,t){var r=p(e)*y,n=t/2,a=50;do{var o=r*r,s=n*n,l=r*n,u=r*(.975534+s*(-.119161+-.0143059*o+-.0547009*s))-e,c=n*(1.00384+o*(.0802894+-.02855*s+199025e-9*o)+s*(.0998909+-.0491032*s))-t,h=.975534-s*(.119161+3*o*.0143059+.0547009*s),d=-l*(.238322+.2188036*s+.0286118*o),f=l*(.1605788+7961e-7*o+-.0571*s),m=1.00384+o*(.0802894+199025e-9*o)+s*(3*(.0998909-.02855*o)-.245516*s),g=d*f-m*h,v=(c*d-u*m)/g,x=(u*f-c*h)/g;r-=v,n-=x}while((i(v)>1e-6||i(x)>1e-6)&&--a>0);return a&&[r,n]},te.invert=function(e,t){var r=e*e,i=t*t+1,n=r+i,a=e?b*E((n-E(n*n-4*r))/r):1/E(i);return[k(e*a),p(t)*S(a)]},tr.invert=function(e,t){return[e,2.5*n(s(.8*t))-.625*y]};var tn=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],ta=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],to=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],ts=[[.9245,0],[0,0],[.01943,0]],tl=[[.721316,0],[0,0],[-.00881625,-.00617325]];function tu(e,r){var i=t.geoProjection(ti(e)).rotate(r).clipAngle(90),n=t.geoRotation(r),a=i.center;return delete i.rotate,i.center=function(e){return arguments.length?a(n(e)):n.invert(a())},i}var tc=E(6),th=E(7);function td(e,t){var r=k(7*m(t)/(3*tc));return[tc*e*(2*o(2*r/3)-1)/th,9*m(r/3)/th]}function tf(e,t){for(var r,n=(1+b)*m(t),a=t,s=0;s<25&&(a-=r=(m(a/2)+m(a)-n)/(.5*o(a/2)+o(a)),!(1e-6>i(r)));s++);return[e*(1+2*o(a)/o(a/2))/(3*_),2*E(3)*m(a/2)/E(2+_)]}function tp(e,t){for(var r,n=E(6/(4+y)),a=(1+y/4)*m(t),s=t/2,l=0;l<25&&(s-=r=(s/2+m(s)-a)/(.5+o(s)),!(1e-6>i(r)));l++);return[n*(.5+o(s))*e/1.5,n*s]}function tm(e,t){var r=t*t,i=r*r,n=r*i;return[e*(.84719-.13063*r+n*n*(-.04515+.05494*r-.02326*i+.00331*n)),t*(1.01183+i*i*(-.02625+.01926*r-.00396*i))]}function tg(e,t){return[e*(1+o(t))/2,2*(t-g(t/2))]}td.invert=function(e,t){var r=3*k(t*th/9);return[e*th/(tc*(2*o(2*r/3)-1)),k(3*m(r)*tc/7)]},tf.invert=function(e,t){var r=t*E(2+_)/(2*E(3)),i=2*k(r);return[3*_*e/(1+2*o(i)/o(i/2)),k((r+m(i))/(1+b))]},tp.invert=function(e,t){var r=E(6/(4+y)),n=t/r;return 1e-6>i(i(n)-v)&&(n=n<0?-v:v),[1.5*e/(r*(.5+o(n))),k((n/2+m(n))/(1+y/4))]},tm.invert=function(e,t){var r,n,a,o,s=t,l=25;do a=(n=s*s)*n,s-=r=(s*(1.01183+a*a*(-.02625+.01926*n-.00396*a))-t)/(1.01183+a*a*(-.23625+.21186*n+-.05148*a));while(i(r)>1e-12&&--l>0);return a=(n=s*s)*n,o=n*a,[e/(.84719-.13063*n+o*o*(-.04515+.05494*n-.02326*a+.00331*o)),s]},tg.invert=function(e,t){for(var r=t/2,n=0,a=1/0;n<10&&i(a)>1e-6;++n){var s=o(t/2);t-=a=(t-g(t/2)-r)/(1-.5/(s*s))}return[2*e/(1+o(t)),t]};var ty=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function tv(e,t){var r=m(t),n=o(t),a=p(e);if(0===e||i(t)===v)return[0,t];if(0===t)return[e,0];if(i(e)===v)return[e*n,v*r];var s=y/(2*e)-2*e/y,l=2*t/y,u=(1-l*l)/(r-l),c=s*s,h=u*u,d=1+c/h,f=1+h/c,g=(s*r/u-s/2)/d,x=(h*r/c+u/2)/f,b=x*x-(h*r*r/c+u*r-1)/f;return[v*(g+E(g*g+n*n/d)*a),v*(x+E(b<0?0:b)*p(-t*s)*a)]}tv.invert=function(e,t){e/=v,t/=v;var r=e*e,i=r+t*t,n=y*y;return[e?(i-1+E((1-i)*(1-i)+4*r))/(2*e)*v:0,V(function(e){return i*(y*m(e)-2*e)*y+4*e*e*(t-m(e))+2*y*e-n*t},0)]};var tx=5*.23185;function tb(e,t){var r=t*t;return[e,t*(1.0148+r*r*(.23185+r*(-.14499+.02406*r)))]}function t_(e,t){if(1e-6>i(t))return[e,0];var r=g(t),n=e*m(t);return[m(n)/r,t+(1-o(n))/r]}function tw(e,t){return[e[0]*t[0]+e[1]*t[3],e[0]*t[1]+e[1]*t[4],e[0]*t[2]+e[1]*t[5]+e[2],e[3]*t[0]+e[4]*t[3],e[3]*t[1]+e[4]*t[4],e[3]*t[2]+e[4]*t[5]+e[5]]}function tT(e,t){return[e[0]-t[0],e[1]-t[1]]}function tA(e){return E(e[0]*e[0]+e[1]*e[1])}function tM(e,r,n){function s(e,t){var i,n=r(e,t),a=n.project([e*A,t*A]);return(i=n.transform)?[i[0]*a[0]+i[1]*a[1]+i[2],-(i[3]*a[0]+i[4]*a[1]+i[5])]:(a[1]=-a[1],a)}!function e(t,r){if(t.edges=function(e){for(var t=e.length,r=[],i=e[t-1],n=0;n=0;)if(i=t[s],r[0]===i[0]&&r[1]===i[1]){if(a)return[a,r];a=r}}}(t.face,r.face),p=(s=f.map(r.project),l=f.map(t.project),i=u=tT(s[1],s[0]),n=c=tT(l[1],l[0]),h=a(i[0]*n[1]-i[1]*n[0],i[0]*n[0]+i[1]*n[1]),d=tA(u)/tA(c),tw([1,0,s[0][0],0,1,s[0][1]],tw([d,0,0,0,d,0],tw([o(h),m(h),0,-m(h),o(h),0],[1,0,-l[0][0],0,1,-l[0][1]]))));t.transform=r.transform?tw(r.transform,p):p;for(var g=r.edges,y=0,v=g.length;y1.790857183?t=1.790857183:t<-1.790857183&&(t=-1.790857183);var r,n=t;do{var a=n*n;n-=r=(n*(1.0148+a*a*(.23185+a*(-.14499+.02406*a)))-t)/(1.0148+a*a*(tx+a*(-1.01493+.21654*a)))}while(i(r)>1e-6);return[e,n]},t_.invert=function(e,t){if(1e-6>i(t))return[e,0];var r,n=e*e+t*t,a=.5*t,s=10;do{var l=g(a),u=1/o(a),c=n-2*t*a+a*a;a-=r=(l*c+2*(a-t))/(2+c*u*u+2*(a-t)*l)}while(i(r)>1e-6&&--s>0);return l=g(a),[(i(t)i^f>i&&r<(d-u)*(i-c)/(f-c)+u&&(n=!n)}return n}(e[0],r))return e.push(t),!0})||e.push([t])}),tj=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function tq(e){var r=e(v,0)[0]-e(-v,0)[0];function n(t,n){var a=i(t)0?t-y:t+y,n),s=(o[0]-o[1])*b,l=(o[0]+o[1])*b;if(a)return[s,l];var u=r*b,c=s>0^l>0?-1:1;return[c*s-p(l)*u,c*l-p(s)*u]}return e.invert&&(n.invert=function(t,n){var a=(t+n)*b,o=(n-t)*b,s=i(a)<.5*r&&i(o)<.5*r;if(!s){var l=r*b,u=a>0^o>0?-1:1,c=-u*t+(o>0?1:-1)*l,h=-u*n+(a>0?1:-1)*l;a=(-c-h)*b,o=(c-h)*b}var d=e.invert(a,o);return s||(d[0]+=a>0?y:-y),d}),t.geoProjection(n).rotate([-90,-90,45]).clipAngle(179.999)}function tG(){return tq(eR).scale(111.48)}function tH(e){var t=m(e);function r(r,i){var a=t?g(r*t/2)/t:r/2;if(!i)return[2*a,-e];var s=2*n(a*m(i)),l=1/g(i);return[m(s)*l,i+(1-o(s))*l-e]}return r.invert=function(r,a){if(1e-6>i(a+=e))return[t?2*n(t*r/2)/t:r,0];var s,l=r*r+a*a,u=0,c=10;do{var h=g(u),d=1/o(u),f=l-2*a*u+u*u;u-=s=(h*f+2*(u-a))/(2+f*d*d+2*(u-a)*h)}while(i(s)>1e-6&&--c>0);var p=r*(h=g(u)),v=g(i(a)0?v:-v)*(d+o*(p-u)/2+o*o*(p-2*d+u)/2)]}function tY(e,t){var r=function(e){function t(t,r){var i=o(r),n=(e-1)/(e-i*o(t));return[n*i*m(t),n*m(r)]}return t.invert=function(t,r){var i=t*t+r*r,n=E(i),o=(e-E(1-i*(e+1)/(e-1)))/((e-1)/n+n/(e-1));return[a(t*o,n*E(1-o*o)),n?k(r*o/n):0]},t}(e);if(!t)return r;var i=o(t),n=m(t);function s(t,a){var o=r(t,a),s=o[1],l=s*n/(e-1)+i;return[o[0]*i/l,s/l]}return s.invert=function(t,a){var o=(e-1)/(e-1-a*n);return r.invert(o*t,o*a*i)},s}t$.forEach(function(e){e[1]*=1.0144}),tW.invert=function(e,t){var r=t/v,n=90*r,a=h(18,i(n/5)),o=c(0,l(a));do{var s=t$[o][1],u=t$[o+1][1],d=t$[h(19,o+2)][1],f=d-s,p=d-2*u+s,m=2*(i(r)-u)/f,g=p/f,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){n=(t>=0?5:-5)*(y+a);var x,b=50;do o=l(a=h(18,i(n)/5)),y=a-o,s=t$[o][1],n-=(x=(t>=0?v:-v)*((u=t$[o+1][1])+y*((d=t$[h(19,o+2)][1])-s)/2+y*y*(d-2*u+s)/2)-t)*A;while(i(x)>1e-12&&--b>0);break}}while(--o>=0);var _=t$[o][0],w=t$[o+1][0],T=t$[h(19,o+2)][0];return[e/(w+y*(T-_)/2+y*y*(T-2*w+_)/2),n*M]};function tZ(e){return e.length>0}function tX(e){return -90===e||90===e?[0,e]:[-180,Math.floor(1e4*e)/1e4]}function tK(e){var t=e[0],r=e[1],i=!1;return t<=-179.9999?(t=-180,i=!0):t>=179.9999&&(t=180,i=!0),r<=-89.9999?(r=-90,i=!0):r>=89.9999&&(r=90,i=!0),i?[t,r]:e}function tJ(e){return e.map(tK)}function tQ(e,t,r){for(var i=0,n=e.length;i=179.9999||c<=-89.9999||c>=89.9999){a[o]=tK(l);for(var h=o+1;h-179.9999&&f<179.9999&&p>-89.9999&&p<89.9999)break}if(h===o+1)continue;if(o){var m={index:-1,polygon:t,ring:a.slice(0,o+1)};m.ring[m.ring.length-1]=tX(c),r[r.length-1]=m}else r.pop();if(h>=s)break;r.push({index:-1,polygon:t,ring:a=a.slice(h-1)}),a[0]=tX(a[0][1]),o=-1,s=a.length}}}}function t0(e){var t,r,i,n,a,o,s=e.length,l={},u={};for(t=0;t0?y-l:l)*A],c=t.geoProjection(e(s)).rotate(u),h=t.geoRotation(u),d=c.center;return delete c.rotate,c.center=function(e){return arguments.length?d(h(e)):h.invert(d())},c.clipAngle(90)}function t4(e){var r=o(e);function i(e,i){var n=t.geoGnomonicRaw(e,i);return n[0]*=r,n}return i.invert=function(e,i){return t.geoGnomonicRaw.invert(e/r,i)},i}function t6(e,t){return t5(t4,e,t)}function t8(e){if(!(e*=2))return t.geoAzimuthalEquidistantRaw;var r=-e/2,i=-r,n=e*e,s=g(i),l=.5/m(i);function u(t,a){var s=S(o(a)*o(t-r)),l=S(o(a)*o(t-i)),u=a<0?-1:1;return s*=s,l*=l,[(s-l)/(2*e),u*E(4*n*l-(n-s+l)*(n-s+l))/(2*e)]}return u.invert=function(e,t){var n,u,c=t*t,h=o(E(c+(n=e+r)*n)),d=o(E(c+(n=e+i)*n));return[a(u=h-d,n=(h+d)*s),(t<0?-1:1)*S(E(n*n+u*u)*l)]},u}function t7(e,t){return t5(t8,e,t)}function t9(e,t){if(1e-6>i(t))return[e,0];var r=i(t/v),n=k(r);if(1e-6>i(e)||1e-6>i(i(t)-v))return[0,p(t)*y*g(n/2)];var a=o(n),s=i(y/e-e/y)/2,l=s*s,u=a/(r+a-1),c=u*(2/r-1),h=c*c,d=h+l,f=u-h,m=l+u;return[p(e)*y*(s*f+E(l*f*f-d*(u*u-h)))/d,p(t)*y*(c*m-s*E((l+1)*d-m*m))/d]}function re(e,t){if(1e-6>i(t))return[e,0];var r=i(t/v),n=k(r);if(1e-6>i(e)||1e-6>i(i(t)-v))return[0,p(t)*y*g(n/2)];var a=o(n),s=i(y/e-e/y)/2,l=s*s,u=a*(E(1+l)-s*a)/(1+l*r*r);return[p(e)*y*u,p(t)*y*E(1-u*(2*s+u))]}function rt(e,t){if(1e-6>i(t))return[e,0];var r=t/v,n=k(r);if(1e-6>i(e)||1e-6>i(i(t)-v))return[0,y*g(n/2)];var a=(y/e-e/y)/2,s=r/(1+o(n));return[y*(p(e)*E(a*a+1-s*s)-a),y*s]}function rr(e,t){if(!t)return[e,0];var r=i(t);if(!e||r===v)return[0,t];var n=r/v,a=n*n,o=(8*n-a*(a+2)-5)/(2*a*(n-1)),s=o*o,l=n*o,u=a+s+2*l,c=n+3*o,h=e/v,d=h+1/h,f=p(i(e)-v)*E(d*d-4),m=f*f,g=u*(a+s*m-1)+(1-a)*(a*(c*c+4*s)+12*l*s+4*s*s),y=(f*(u+s-1)+2*E(g))/(4*u+m);return[p(e)*v*y,p(t)*v*E(1+f*i(y)-y*y)]}function ri(e,t,r,i){var n=y/3;e=c(e,1e-6),t=c(t,1e-6),e=h(e,v),t=h(t,y-1e-6),r=h(r=c(r,0),100-1e-6);var s=(i=c(i,1e-6))/100,l=S((r/100+1)*o(n))/n,u=m(e)/m(l*v),d=t/y,f=E(s*m(e/2)/m(t/2)),p=f/E(d*u*l),x=1/(f*E(d*u*l));function b(e,t){var r=u*m(l*t),i=E(1-r*r),n=E(2/(1+i*o(e*=d)));return[p*i*n*m(e),x*r*n]}return b.invert=function(e,t){var r=e/p,i=t/x,n=E(r*r+i*i),o=2*k(n/2);return[a(e*g(o),p*n)/d,n&&k(t*m(o)/(x*u*n))/l]},b}function rn(){var e=65*M,r=60*M,i=20,n=200,a=t.geoProjectionMutator(ri),o=a(e,r,i,n);return o.poleline=function(t){return arguments.length?a(e=t*M,r,i,n):e*A},o.parallels=function(t){return arguments.length?a(e,r=t*M,i,n):r*A},o.inflation=function(t){return arguments.length?a(e,r,i=+t,n):i},o.ratio=function(t){return arguments.length?a(e,r,i,n=+t):n},o.scale(163.775)}t3.invert=function(e,t){var r=t/1.70711,i=m(x*r);return[e/(.74482-.34588*i*i),2*n(r)]},t9.invert=function(e,t){if(1e-6>i(t))return[e,0];if(1e-6>i(e))return[0,v*m(2*n(t/y))];var r=(e/=y)*e,a=(t/=y)*t,s=r+a,l=s*s,u=-i(t)*(1+s),c=u-2*a+r,h=-2*u+1+2*a+l,d=a/h+(2*c*c*c/(h*h*h)-9*u*c/(h*h))/27,f=(u-c*c/(3*h))/h,g=2*E(-f/3),x=S(3*d/(f*g))/3;return[y*(s-1+E(1+2*(r-a)+l))/(2*e),p(t)*y*(-g*o(x+y/3)-c/(3*h))]},re.invert=function(e,t){if(!e)return[0,v*m(2*n(t/y))];var r=i(e/y),o=(1-r*r-(t/=y)*t)/(2*r),s=E(o*o+1);return[p(e)*y*(s-o),p(t)*v*m(2*a(E((1-2*o*r)*(o+s)-r),E(s+o+r)))]},rt.invert=function(e,t){if(!t)return[e,0];var r=t/y,i=(y*y*(1-r*r)-e*e)/(2*y*e);return[e?y*(p(e)*E(i*i+1)-i):0,v*m(2*n(r))]},rr.invert=function(e,t){if(!e||!t)return[e,t];t/=y;var r,n=p(e)*e/v,a=(n*n-1+4*t*t)/i(n),o=a*a,s=2*t,l=50;do{var u=s*s,c=(8*s-u*(u+2)-5)/(2*u*(s-1)),h=(3*s-u*s-10)/(2*u*s),d=c*c,f=s*c,m=s+c,g=m*m,x=s+3*c,b=g*(u+d*o-1)+(1-u)*(u*(x*x+4*d)+d*(12*f+4*d)),_=-2*m*(4*f*d+(1-4*u+3*u*u)*(1+h)+d*(-6+14*u-o+(-8+8*u-2*o)*h)+f*(-8+12*u+(-10+10*u-o)*h)),w=E(b);s-=r=(a*(g+d-1)+2*w-n*(4*g+o))/(a*(2*c*h+2*m*(1+h))+_/w-8*m*(a*(-1+d+g)+2*w)*(1+h)/(o+4*g))}while(r>1e-6&&--l>0);return[p(e)*(E(a*a+4)+a)*y/4,v*s]};var ra=4*y+3*E(3),ro=2*E(2*y*E(3)/ra),rs=H(ro*E(3)/y,ro,ra/6);function rl(e,t){return[e*E(1-3*t*t/(y*y)),t]}function ru(e,t){var r=o(t),i=o(e)*r,n=1-i,s=o(e=a(m(e)*r,-m(t))),l=m(e);return[l*(r=E(1-i*i))-s*n,-s*r-l*n]}function rc(e,t){var r=L(e,t);return[(r[0]+e/v)/2,(r[1]+t)/2]}rl.invert=function(e,t){return[e/E(1-3*t*t/(y*y)),t]},ru.invert=function(e,t){var r=-((e*e+t*t)/2),i=E(-r*(2+r)),n=t*r+e*i,o=e*r-t*i,s=E(o*o+n*n);return[a(i*n,s*(1+r)),s?-k(i*o/s):0]},rc.invert=function(e,t){var r=e,n=t,a=25;do{var s,l=o(n),u=m(n),c=m(2*n),h=u*u,d=l*l,f=m(r),p=o(r/2),g=m(r/2),y=g*g,x=1-d*p*p,b=x?S(l*p)*E(s=1/x):s=0,_=.5*(2*b*l*g+r/v)-e,w=.5*(b*u+n)-t,T=.5*s*(d*y+b*l*p*h)+.5/v,A=s*(f*c/4-b*u*g),M=.125*s*(c*g-b*u*d*f),k=.5*s*(h*p+b*y*l)+.5,D=A*M-k*T,C=(w*A-_*k)/D,I=(_*M-w*T)/D;r-=C,n-=I}while((i(C)>1e-6||i(I)>1e-6)&&--a>0);return[r,n]},e.geoNaturalEarth=t.geoNaturalEarth1,e.geoNaturalEarthRaw=t.geoNaturalEarth1Raw,e.geoAiry=function(){var e=v,r=t.geoProjectionMutator(I),i=r(e);return i.radius=function(t){return arguments.length?r(e=t*M):e*A},i.scale(179.976).clipAngle(147)},e.geoAiryRaw=I,e.geoAitoff=function(){return t.geoProjection(L).scale(152.63)},e.geoAitoffRaw=L,e.geoArmadillo=function(){var e=20*M,r=e>=0?1:-1,i=g(r*e),n=t.geoProjectionMutator(P),s=n(e),l=s.stream;return s.parallel=function(t){return arguments.length?(i=g((r=(e=t*M)>=0?1:-1)*e),n(e)):e*A},s.stream=function(t){var n=s.rotate(),u=l(t),c=(s.rotate([0,0]),l(t)),h=s.precision();return s.rotate(n),u.sphere=function(){c.polygonStart(),c.lineStart();for(var t=-180*r;r*t<180;t+=90*r)c.point(t,90*r);if(e)for(;r*(t-=3*r*h)>=-180;)c.point(t,-(r*a(o(t*M/2),i))*A);c.lineEnd(),c.polygonEnd()},u},s.scale(218.695).center([0,28.0974])},e.geoArmadilloRaw=P,e.geoAugust=function(){return t.geoProjection(z).scale(66.1603)},e.geoAugustRaw=z,e.geoBaker=function(){return t.geoProjection(R).scale(112.314)},e.geoBakerRaw=R,e.geoBerghaus=function(){var e=5,r=t.geoProjectionMutator(B),i=r(e),n=i.stream,s=-o(.01*M),l=m(.01*M);return i.lobes=function(t){return arguments.length?r(e=+t):e},i.stream=function(t){var r=i.rotate(),u=n(t),c=(i.rotate([0,0]),n(t));return i.rotate(r),u.sphere=function(){c.polygonStart(),c.lineStart();for(var t=0,r=360/e,i=2*y/e,n=90-180/e,u=v;t=0;)e.point((t=r[n])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},i.scale(79.4187).parallel(45).clipAngle(179.999)},e.geoHammerRetroazimuthalRaw=eB,e.geoHealpix=function(){var e=4,i=t.geoProjectionMutator(eU),n=i(e),a=n.stream;return n.lobes=function(t){return arguments.length?i(e=+t):e},n.stream=function(i){var o=n.rotate(),s=a(i),l=(n.rotate([0,0]),a(i));return n.rotate(o),s.sphere=function(){var i,n;t.geoStream((i=180/e,n=[].concat(r.range(-180,180+i/2,i).map(eq),r.range(180,-180-i/2,-i).map(eG)),{type:"Polygon",coordinates:[180===i?n.map(eH):n]}),l)},s},n.scale(239.75)},e.geoHealpixRaw=eU,e.geoHill=function(){var e=1,r=t.geoProjectionMutator(e$),i=r(e);return i.ratio=function(t){return arguments.length?r(e=+t):e},i.scale(167.774).center([0,18.67])},e.geoHillRaw=e$,e.geoHomolosine=function(){return t.geoProjection(eY).scale(152.63)},e.geoHomolosineRaw=eY,e.geoHufnagel=function(){var e=1,r=0,i=45*M,n=2,a=t.geoProjectionMutator(eZ),o=a(e,r,i,n);return o.a=function(t){return arguments.length?a(e=+t,r,i,n):e},o.b=function(t){return arguments.length?a(e,r=+t,i,n):r},o.psiMax=function(t){return arguments.length?a(e,r,i=t*M,n):i*A},o.ratio=function(t){return arguments.length?a(e,r,i,n=+t):n},o.scale(180.739)},e.geoHufnagelRaw=eZ,e.geoHyperelliptical=function(){var e=0,r=2.5,i=1.183136,n=t.geoProjectionMutator(eX),a=n(e,r,i);return a.alpha=function(t){return arguments.length?n(e=+t,r,i):e},a.k=function(t){return arguments.length?n(e,r=+t,i):r},a.gamma=function(t){return arguments.length?n(e,r,i=+t):i},a.scale(152.63)},e.geoHyperellipticalRaw=eX,e.geoInterrupt=eJ,e.geoInterruptedBoggs=function(){return eJ(W,eQ).scale(160.857)},e.geoInterruptedHomolosine=function(){return eJ(eY,e0).scale(152.63)},e.geoInterruptedMollweide=function(){return eJ($,e1).scale(169.529)},e.geoInterruptedMollweideHemispheres=function(){return eJ($,e2).scale(169.529).rotate([20,0])},e.geoInterruptedSinuMollweide=function(){return eJ(eW,e3,U).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoInterruptedSinusoidal=function(){return eJ(Z,e5).scale(152.63).rotate([-20,0])},e.geoKavrayskiy7=function(){return t.geoProjection(e4).scale(158.837)},e.geoKavrayskiy7Raw=e4,e.geoLagrange=function(){var e=.5,r=t.geoProjectionMutator(e6),i=r(e);return i.spacing=function(t){return arguments.length?r(e=+t):e},i.scale(124.75)},e.geoLagrangeRaw=e6,e.geoLarrivee=function(){return t.geoProjection(e7).scale(97.2672)},e.geoLarriveeRaw=e7,e.geoLaskowski=function(){return t.geoProjection(e9).scale(139.98)},e.geoLaskowskiRaw=e9,e.geoLittrow=function(){return t.geoProjection(te).scale(144.049).clipAngle(89.999)},e.geoLittrowRaw=te,e.geoLoximuthal=function(){return Y(tt).parallel(40).scale(158.837)},e.geoLoximuthalRaw=tt,e.geoMiller=function(){return t.geoProjection(tr).scale(108.318)},e.geoMillerRaw=tr,e.geoModifiedStereographic=tu,e.geoModifiedStereographicRaw=ti,e.geoModifiedStereographicAlaska=function(){return tu(tn,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},e.geoModifiedStereographicGs48=function(){return tu(ta,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},e.geoModifiedStereographicGs50=function(){return tu(to,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},e.geoModifiedStereographicMiller=function(){return tu(ts,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},e.geoModifiedStereographicLee=function(){return tu(tl,[165,10]).scale(250).clipAngle(130).center([-165,-10])},e.geoMollweide=function(){return t.geoProjection($).scale(169.529)},e.geoMollweideRaw=$,e.geoMtFlatPolarParabolic=function(){return t.geoProjection(td).scale(164.859)},e.geoMtFlatPolarParabolicRaw=td,e.geoMtFlatPolarQuartic=function(){return t.geoProjection(tf).scale(188.209)},e.geoMtFlatPolarQuarticRaw=tf,e.geoMtFlatPolarSinusoidal=function(){return t.geoProjection(tp).scale(166.518)},e.geoMtFlatPolarSinusoidalRaw=tp,e.geoNaturalEarth2=function(){return t.geoProjection(tm).scale(175.295)},e.geoNaturalEarth2Raw=tm,e.geoNellHammer=function(){return t.geoProjection(tg).scale(152.63)},e.geoNellHammerRaw=tg,e.geoInterruptedQuarticAuthalic=function(){return eJ(j(1/0),ty).rotate([20,0]).scale(152.63)},e.geoNicolosi=function(){return t.geoProjection(tv).scale(127.267)},e.geoNicolosiRaw=tv,e.geoPatterson=function(){return t.geoProjection(tb).scale(139.319)},e.geoPattersonRaw=tb,e.geoPolyconic=function(){return t.geoProjection(t_).scale(103.74)},e.geoPolyconicRaw=t_,e.geoPolyhedral=tM,e.geoPolyhedralButterfly=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=tE.map(function(t){return{face:t,project:e(t)}});return[-1,0,0,1,0,1,4,5].forEach(function(e,t){var i=r[e];i&&(i.children||(i.children=[])).push(r[t])}),tM(r[0],function(e,t){return r[e<-y/2?t<0?6:4:e<0?2*(t<0):e0?[-r[0],0]:[180-r[0],180])};var r=tE.map(function(t){return{face:t,project:e(t)}});return[-1,0,0,1,0,1,4,5].forEach(function(e,t){var i=r[e];i&&(i.children||(i.children=[])).push(r[t])}),tM(r[0],function(e,t){return r[e<-y/2?t<0?6:4:e<0?2*(t<0):etI(l[0],n)?8+3*s:0>tI(l[1],n)?8+3*s+1:0>tI(l[2],n)?8+3*s+2:s]}).angle(-30).scale(110.625).center([0,45])},e.geoProject=function(e,t){var r,i=t.stream;if(!i)throw Error("invalid projection");switch(e&&e.type){case"Feature":r=tO;break;case"FeatureCollection":r=tF;break;default:r=tR}return r(e,i)},e.geoGringortenQuincuncial=function(){return tq(ez).scale(176.423)},e.geoPeirceQuincuncial=tG,e.geoPierceQuincuncial=tG,e.geoQuantize=function(e,t){if(!(0<=(t*=1)&&t<=20))throw Error("invalid digits");function r(e){var r=e.length,i=2,n=Array(r);for(n[0]=+e[0].toFixed(t),n[1]=+e[1].toFixed(t);i2||a[0]!=t[0]||a[1]!=t[1])&&(i.push(a),t=a)}return 1===i.length&&e.length>1&&i.push(r(e[e.length-1])),i}function n(e){return e.map(i)}function a(e){var t;if(null==e)return e;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(a)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:e.coordinates.map(r)};break;case"LineString":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:n(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(n)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function o(e){var t={type:"Feature",properties:e.properties,geometry:a(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return o(e);case"FeatureCollection":var s={type:"FeatureCollection",features:e.features.map(o)};return null!=e.bbox&&(s.bbox=e.bbox),s;default:return a(e)}return e},e.geoQuincuncial=tq,e.geoRectangularPolyconic=function(){return Y(tH).scale(131.215)},e.geoRectangularPolyconicRaw=tH,e.geoRobinson=function(){return t.geoProjection(tW).scale(152.63)},e.geoRobinsonRaw=tW,e.geoSatellite=function(){var e=2,r=0,i=t.geoProjectionMutator(tY),n=i(e,r);return n.distance=function(t){return arguments.length?i(e=+t,r):e},n.tilt=function(t){return arguments.length?i(e,r=t*M):r*A},n.scale(432.147).clipAngle(S(1/e)*A-1e-6)},e.geoSatelliteRaw=tY,e.geoSinuMollweide=function(){return t.geoProjection(eW).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoSinuMollweideRaw=eW,e.geoSinusoidal=function(){return t.geoProjection(Z).scale(152.63)},e.geoSinusoidalRaw=Z,e.geoStitch=function(e){if(null==e)return e;switch(e.type){case"Feature":return t1(e);case"FeatureCollection":var t={type:"FeatureCollection",features:e.features.map(t1)};return null!=e.bbox&&(t.bbox=e.bbox),t;default:return t2(e)}},e.geoTimes=function(){return t.geoProjection(t3).scale(146.153)},e.geoTimesRaw=t3,e.geoTwoPointAzimuthal=t6,e.geoTwoPointAzimuthalRaw=t4,e.geoTwoPointAzimuthalUsa=function(){return t6([-158,21.5],[-77,39]).clipAngle(60).scale(400)},e.geoTwoPointEquidistant=t7,e.geoTwoPointEquidistantRaw=t8,e.geoTwoPointEquidistantUsa=function(){return t7([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},e.geoVanDerGrinten=function(){return t.geoProjection(t9).scale(79.4183)},e.geoVanDerGrintenRaw=t9,e.geoVanDerGrinten2=function(){return t.geoProjection(re).scale(79.4183)},e.geoVanDerGrinten2Raw=re,e.geoVanDerGrinten3=function(){return t.geoProjection(rt).scale(79.4183)},e.geoVanDerGrinten3Raw=rt,e.geoVanDerGrinten4=function(){return t.geoProjection(rr).scale(127.16)},e.geoVanDerGrinten4Raw=rr,e.geoWagner=rn,e.geoWagner7=function(){return rn().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},e.geoWagnerRaw=ri,e.geoWagner4=function(){return t.geoProjection(rs).scale(176.84)},e.geoWagner4Raw=rs,e.geoWagner6=function(){return t.geoProjection(rl).scale(152.63)},e.geoWagner6Raw=rl,e.geoWiechel=function(){return t.geoProjection(ru).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},e.geoWiechelRaw=ru,e.geoWinkel3=function(){return t.geoProjection(rc).scale(158.837)},e.geoWinkel3Raw=rc,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&"u">typeof t?r(e,pT(),pz()):r(e.d3=e.d3||{},e.d3,e.d3)}}),pO=m({"src/plots/geo/zoom.js"(e,t){var r=M(),i=tb(),n=e1(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function u(e,t){return r.behavior.zoom().translate(t.translate()).scaleExtent(t.scaleExtent()).scale(t.scale())}function c(e,t,r){var a=e.id,o=e.graphDiv,s=o.layout,l=s[a],u=o._fullLayout,c=u[a],h={},d={};function f(e,t){h[a+"."+e]=i.nestedProperty(l,e).get(),n.call("_storeDirectGUIEdit",s,u._preGUI,h);var r=i.nestedProperty(c,e);r.get()!==t&&(r.set(t),i.nestedProperty(l,e).set(t),d[a+"."+e]=t)}r(f),f("projection.scale",t.scale()/e.fitScale),f("fitbounds",!1),o.emit("plotly_relayout",d)}function h(e,t){var i=u(e,t);function n(r){var i=t.invert(e.midPt);r("center.lon",i[0]),r("center.lat",i[1])}return i.on("zoomstart",function(){r.select(this).style(s)}).on("zoom",function(){t.scale(r.event.scale).translate(r.event.translate),e.render(!0);var i=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":i[0],"geo.center.lat":i[1]})}).on("zoomend",function(){r.select(this).style(l),c(e,t,n)}),i}function d(e,t){var i,n,a,o,h,d,f,p,m,g=u(e,t);function y(e){return t.invert(e)}function v(r){var i=t.rotate(),n=t.invert(e.midPt);r("projection.rotation.lon",-i[0]),r("center.lon",n[0]),r("center.lat",n[1])}return g.on("zoomstart",function(){r.select(this).style(s);let{x:e,y:l,width:u,height:c}=this.getBBox();i=r.event.sourceEvent?r.mouse(this):[e+u/2,l+c/2],n=t.rotate(),a=t.translate(),o=n,h=y(i)}).on("zoom",function(){let{x:s,y:l,width:u,height:c}=this.getBBox();if(d=r.event.sourceEvent?r.mouse(this):[s+u/2,l+c/2],function(e){var r=y(e);if(!r)return!0;var i=t(r);return Math.abs(i[0]-e[0])>2||Math.abs(i[1]-e[1])>2}(i)){g.scale(t.scale()),g.translate(t.translate());return}t.scale(r.event.scale),t.translate([a[0],r.event.translate[1]]),h?y(d)&&(p=y(d),f=[o[0]+(p[0]-h[0]),n[1],n[2]],t.rotate(f),o=f):h=y(i=d),m=!0,e.render(!0);var v=t.rotate(),x=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":x[0],"geo.center.lat":x[1],"geo.projection.rotation.lon":-v[0]})}).on("zoomend",function(){r.select(this).style(l),m&&c(e,t,v)}),g}function f(e,t){var i,n={r:t.rotate(),k:t.scale()},h=u(e,t),d=function(e){for(var t=0,i=arguments.length,n=[];++t(H=Math.sqrt(B*B+j*j))?(R=(U>0?90:-90)-G,O=0):(R=Math.asin(U/H)*o-G,O=Math.sqrt(H*H-U*U)),$=180-R-2*G,W=(Math.atan2(q,V)-Math.atan2(N,O))*o,Y=(Math.atan2(q,V)-Math.atan2(N,-O))*o,n.r=m(D[0],D[1],R,W)<=m(D[0],D[1],$,Y)?[R,W,D[2]]:[$,Y,D[2]]);isFinite(X[0])&&isFinite(X[1])&&isFinite(X[2])||(X=L),t.rotate(X),L=X}}else i=p(t,C=u);c=d.of(this,arguments),c({type:"zoom"})}),M=d.of(this,arguments),f++||M({type:"zoomstart"})}).on("zoomend",function(){var i;r.select(this).style(l),g.call(h,"zoom",null),i=d.of(this,arguments),--f||i({type:"zoomend"}),c(e,t,x)}).on("zoom.redraw",function(){e.render(!0);var r=t.rotate();e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})}),r.rebind(h,d,"on")}function p(e,t){var r,i,n,o,s=e.invert(t);return s&&isFinite(s[0])&&isFinite(s[1])&&(i=(r=s)[0]*a,[(o=Math.cos(n=r[1]*a))*Math.cos(i),o*Math.sin(i),Math.sin(n)])}function m(e,t,r,i){var n=g(r-e),a=g(i-t);return Math.sqrt(n*n+a*a)}function g(e){return(e%360+540)%360-180}function y(e,t,r){var i=r*a,n=e.slice(),o=+(0===t),s=2===t?1:2,l=Math.cos(i),u=Math.sin(i);return n[o]=e[o]*l-e[s]*u,n[s]=e[s]*l+e[o]*u,n}function v(e,t){for(var r=0,i=0,n=e.length;i0&&o._module.calcGeoJSON(a,t)}if(!r){if(this.updateProjection(e,t))return;this.viewInitial&&this.scope===i.scope||this.saveViewInitial(i)}this.scope=i.scope,this.updateBaseLayers(t,i),this.updateDims(t,i),this.updateFx(t,i),f.generalUpdatePerTraceModule(this.graphDiv,this,e,i);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},C.updateProjection=function(e,t){var r=this.graphDiv,s=t[this.id],u=t._size,c=s.domain,h=s.projection,d=s.lonaxis,f=s.lataxis,p=d._ax,v=f._ax,x=this.projection=function(e){var t=e.projection,r=t.type,s=T.projNames[r];s="geo"+l.titleCase(s);for(var u=i[s]||o[s],c=u(),h=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?T.lonaxisSpan[r]/2:null,d=["center","rotate","parallels","clipExtent"],f=function(e){return e?c:[]},p=0;ph*Math.PI/180},c.getPath=function(){return n().projection(c)},c.getBounds=function(e){return c.getPath().bounds(e)},c.precision(T.precision),e._isSatellite&&c.tilt(t.tilt).distance(t.distance),h&&c.clipAngle(h-T.clipPad),c}(s),b=[[u.l+u.w*c.x[0],u.t+u.h*(1-c.y[1])],[u.l+u.w*c.x[1],u.t+u.h*(1-c.y[0])]],_=s.center||{},w=h.rotation||{},M=d.range||[],k=f.range||[];if(s.fitbounds){p._length=b[1][0]-b[0][0],v._length=b[1][1]-b[0][1],p.range=g(r,p),v.range=g(r,v);let i=[];for(let t of e){let e=t[0].trace;!0===e.visible&&e._module.fitCoords&&i.push(e._module.fitCoords(t,s))}let n=m(r,p),a=n.min.reduce((e,{val:t})=>Math.min(e,t),1/0),o=n.max.reduce((e,{val:t})=>Math.max(e,t),-1/0)-a,l=A.boundsOfCoords(i.flat()),[u,,c]=l||[],d=c-u;if(l&&(o>360||o<360&&dMath.max(t,e(r)),0),a=n.max.reduce((e,t)=>Math.max(e,r(t)),0),o=p._length-i-a,s=o>p._length/10?d*p._length/o:d,l=(u+c)/2;p.range=[l-s/2,l+s/2]}var S=(p.range[0]+p.range[1])/2,E=(v.range[0]+v.range[1])/2;if(s._isScoped)_={lon:S,lat:E};else if(s._isClipped){_={lon:S,lat:E},w={lon:S,lat:E,roll:w.roll};var D=h.type,C=T.lonaxisSpan[D]/2||180,L=T.lataxisSpan[D]/2||90;M=[S-C,S+C],k=[E-L,E+L]}else _={lon:S,lat:E},w={lon:S,lat:w.lat,roll:w.roll}}x.center([_.lon-w.lon,_.lat-w.lat]).rotate([-w.lon,-w.lat,w.roll]).parallels(h.parallels);var P=I(M,k);x.fitExtent(b,P);var z=this.bounds=x.getBounds(P),F=this.fitScale=x.scale(),O=x.translate();if(x.scaleExtent=()=>{var e;let{minscale:t}=h,r=null!=(e=h.maxscale)?e:1/0;return[F*Math.min(t,r),F*Math.max(t,r)]},s.fitbounds){var R=x.getBounds(I(p.range,v.range)),B=Math.min((z[1][0]-z[0][0])/(R[1][0]-R[0][0]),(z[1][1]-z[0][1])/(R[1][1]-R[0][1]));isFinite(B)?x.scale(B*F):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else x.scale(h.scale*F);var j=this.midPt=[(z[0][0]+z[1][0])/2,(z[0][1]+z[1][1])/2];if(x.translate([O[0]+(j[0]-O[0]),O[1]+(j[1]-O[1])]).clipExtent(z),s._isAlbersUsa){var N=x([_.lon,_.lat]);if(N){var V=x.translate();x.translate([V[0]-(N[0]-V[0]),V[1]-(N[1]-V[1])])}}},C.updateBaseLayers=function(e,t){var i=this,n=i.topojson,a=i.layers,o=i.basePaths;function s(e){return"lonaxis"===e||"lataxis"===e}function l(e){return!!T.lineLayers[e]}function u(e){return!!T.fillLayers[e]}var d=(this.hasChoropleth?T.layersForChoropleth:T.layers).filter(function(e){return l(e)||u(e)?t["show"+e]:!s(e)||t[e].showgrid}),f=i.framework.selectAll(".layer").data(d,String);f.exit().each(function(e){delete a[e],delete o[e],r.select(this).remove()}),f.enter().append("g").attr("class",function(e){return"layer "+e}).each(function(e){var t=a[e]=r.select(this);"bg"===e?i.bgRect=t.append("rect").style("pointer-events","all"):s(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):l(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):u(e)&&(o[e]=t.append("path").style("stroke","none"))}),f.order(),f.each(function(r){var i=o[r],a=T.layerNameToAdjective[r];"frame"===r?i.datum(T.sphereSVG):l(r)||u(r)?i.datum(E(n,n.objects[r])):s(r)&&i.datum(function(e,t,r){var i,n,a,o=t[e],s=T.scopeDefaults[t.scope];"lonaxis"===e?(i=s.lonaxisRange,n=s.lataxisRange,a=function(e,t){return[e,t]}):"lataxis"===e&&(i=s.lataxisRange,n=s.lonaxisRange,a=function(e,t){return[t,e]});var l={type:"linear",range:[i[0],i[1]-1e-6],tick0:o.tick0,dtick:o.dtick};p.setConvert(l,r);var u=p.calcTicks(l);t.isScoped||"lonaxis"!==e||u.pop();for(var c=u.length,h=Array(c),d=0;dn)&&e.event(a)}a.on("dblclick.zoom",function(){var e=i.viewInitial,t={};for(var r in e)t[i.id+"."+r]=e[r];s.call("_guiRelayout",n,t),n.emit("plotly_doubleclick",null)}),n._context._scrollZoom.geo||a.on("wheel.zoom",null)}else("select"===o||"lasso"===o)&&(a.on(".zoom",null),c.prepFn=function(e,t,r){x(e,t,r,c,o)},v.init(c));a.on("mousemove",function(){var e=i.projection.invert(l.getPositionFromD3Event());if(!e)return v.unhover(n,r.event);i.xaxis.p2c=function(){return e[0]},i.yaxis.p2c=function(){return e[1]},d.hover(n,r.event,i.id)}),a.on("mouseout",function(){n._dragging||v.unhover(n,r.event)}),a.on("click",function(){"select"!==o&&"lasso"!==o&&(u.indexOf("select")>-1&&_(r.event,n,[i.xaxis],[i.yaxis],i.id,c),u.indexOf("event")>-1&&d.click(n,r.event))})}function h(e){return i.projection.invert([e[0]+i.xaxis._offset,e[1]+i.yaxis._offset])}},C.makeFramework=function(){var e=this,t=e.graphDiv,i=t._fullLayout,n="clip"+i._uid+e.id;e.clipDef=i._clips.append("clipPath").attr("id",n),e.clipRect=e.clipDef.append("rect"),e.framework=r.select(e.container).append("g").attr("class","geo "+e.id).call(h.setClipUrl,n,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(e.mockAxis,i)},C.saveViewInitial=function(e){var t,r=e.center||{},i=e.projection,n=i.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":i.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":n.lon,"projection.rotation.lat":n.lat,"center.lon":r.lon,"center.lat":r.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":n.lon},l.extendFlat(this.viewInitial,t)},C.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},C._render=function(){var e,t=this.projection,r=t.getPath();function i(e){var r=t(e.lonlat);return r?u(r[0],r[1]):null}function n(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",function(e){return r(e.geojson)});for(e in this.dataPoints)this.dataPoints[e].attr("display",n).attr("transform",i)}}}),pB=m({"src/plots/geo/layout_attributes.js"(e,t){var r=et(),i=ai().attributes,n=e$().dash,a=pf(),o=eH().overrideAll,s=(e7(),x(e4)).default,l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:n};(t.exports=o({domain:i({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:"locations",editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:s(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1},minscale:{valType:"number",min:0,dflt:0},maxscale:{valType:"number",min:0,dflt:null}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),pj=m({"src/plots/geo/layout_defaults.js"(e,t){var r=tb(),i=st(),n=tz().getSubplotData,{unwrapLonRange:a}=pE(),o=pf(),s=pB(),l=o.axesNames;function u(e,t,i,s){var u,c,h=n(s.fullData,"geo",s.id).map(function(e){return e.index}),d=i("resolution"),f=i("scope"),p=o.scopeDefaults[f],m=i("projection.type",p.projType),g=t._isAlbersUsa="albers usa"===m;g&&(f=t.scope="usa");var y=t._isScoped="world"!==f,v=t._isSatellite="satellite"===m,x=t._isConic=-1!==m.indexOf("conic")||"albers"===m,b=t._isClipped=!!o.lonaxisSpan[m];if(!1===e.visible){var _=r.extendDeep({},t._template);_.showcoastlines=!1,_.showcountries=!1,_.showframe=!1,_.showlakes=!1,_.showland=!1,_.showocean=!1,_.showrivers=!1,_.showsubunits=!1,_.lonaxis&&(_.lonaxis.showgrid=!1),_.lataxis&&(_.lataxis.showgrid=!1),t._template=_}for(var w,T=i("visible"),A=0;Anull!=e[t])||o.fitboundsIncompatible.has(m)?t.fitbounds=!1:l.forEach(({dst:e,key:t})=>e&&(e[t]=null))}}t.exports=function(e,t,r){i(e,t,r,{type:"geo",attributes:s,handleDefaults:u,fullData:r,partition:"y"})}}}),pN=m({"src/plots/geo/index.js"(e,t){var r=tz().getSubplotCalcData,i=tb().counterRegex,n=pR(),a=i("geo"),o={};o.geo={valType:"subplotid",dflt:"geo",editType:"calc"},t.exports={attr:"geo",name:"geo",idRoot:"geo",idRegex:a,attrRegex:a,attributes:o,layoutAttributes:pB(),supplyLayoutDefaults:pj(),plot:function(e){for(var t=e._fullLayout,i=e.calcdata,a=t._subplots.geo,o=0;o")}}(e,d,s),[e]}}}),pZ=m({"src/traces/choropleth/event_data.js"(e,t){t.exports=function(e,t,r,i,n){e.location=t.location,e.z=t.z;var a=i[n];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e.ct=a.ct,e}}}),pX=m({"src/traces/choropleth/select.js"(e,t){t.exports=function(e,t){var r,i,n,a,o,s=e.cd,l=e.xaxis,u=e.yaxis,c=[];if(!1===t)for(r=0;r=Math.min(L,P)&&f<=Math.max(L,P)?0:1/0}if(M=Math.min(z,F)&&p<=Math.max(z,F)?0:1/0}E=Math.sqrt(M*M+k*k),_=n[A]}}}else for(A=n.length-1;A>-1;A--)w=h[b=n[A]],T=d[b],(S=Math.sqrt((M=u.c2p(w)-f)*M+(k=c.c2p(T)-p)*k))100},e.isDotSymbol=function(e){return"string"==typeof e?t.DOT_RE.test(e):e>200}}}),p3=m({"src/traces/scattergl/defaults.js"(e,t){var r=tb(),i=e1(),n=p2(),a=p1(),o=ix(),s=t6(),l=iU(),u=iq(),c=iH(),h=i$(),d=iZ(),f=iY();t.exports=function(e,t,p,m){function g(i,n){return r.coerce(e,t,a,i,n)}var y=!!e.marker&&n.isOpenSymbol(e.marker.symbol),v=s.isBubble(e),x=l(e,t,m,g);if(!x){t.visible=!1;return}u(e,t,m,g),g("xhoverformat"),g("yhoverformat");var b=x>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,n=o-1):i=o+1}return a}function i(e,t,r,i,n){for(var a=n+1;i<=n;){var o=i+n>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,n=o-1):i=o+1}return a}function n(e,t,r,i,n){for(var a=i-1;i<=n;){var o=i+n>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,i=o+1):n=o-1}return a}function a(e,t,r,i,n){for(var a=i-1;i<=n;){var o=i+n>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,i=o+1):n=o-1}return a}function o(e,t,r,i,n){for(;i<=n;){var a=i+n>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?i=a+1:n=a-1}return -1}function s(e,t,r,i,n,a){return"function"==typeof r?a(e,t,r,void 0===i?0:0|i,void 0===n?e.length-1:0|n):a(e,t,void 0,void 0===r?0:0|r,void 0===i?e.length-1:0|i)}t.exports={ge:function(e,t,i,n,a){return s(e,t,i,n,a,r)},gt:function(e,t,r,n,a){return s(e,t,r,n,a,i)},lt:function(e,t,r,i,a){return s(e,t,r,i,a,n)},le:function(e,t,r,i,n){return s(e,t,r,i,n,a)},eq:function(e,t,r,i,n){return s(e,t,r,i,n,o)}}}}),p6=m({"node_modules/clamp/index.js"(e,t){t.exports=function(e,t,r){return tr?r:e:et?t:e}}}),p8=m({"node_modules/pick-by-alias/index.js"(e,t){t.exports=function(e,t,r){var n,a,o={};if("string"==typeof t&&(t=i(t)),Array.isArray(t)){var s={};for(a=0;a1&&(e=arguments),"string"==typeof e?e=e.split(/\s/).map(parseFloat):"number"==typeof e&&(e=[e]),e.length&&"number"==typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(t={x:(e=r(e,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}}}),p9=m({"node_modules/array-bounds/index.js"(e,t){t.exports=function(e,t){if(!e||null==e.length)throw Error("Argument should be an array");t=null==t?1:Math.floor(t);for(var r=Array(2*t),i=0;in&&(n=e[o]),e[o]typeof arguments[e])return arguments[e]}}}),mt=m({"node_modules/dtype/index.js"(e,t){t.exports=function(e){switch(e){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),mr=m({"node_modules/flatten-vertex-data/index.js"(e,t){var r=mt();t.exports=function(e,t,i){if(!e)throw TypeError("must specify data as first parameter");if(i=0|(i||0),Array.isArray(e)&&e[0]&&"number"==typeof e[0][0]){var n,a,o,s,l=e[0].length,u=e.length*l;t&&"string"!=typeof t||(t=new(r(t||"float32"))(u+i));var c=t.length-i;if(u!==c)throw Error("source length "+u+" ("+l+"x"+e.length+") does not match destination length "+c);for(n=0,o=i;n>>1,g;t.dtype||(t.dtype="array"),"string"==typeof t.dtype?g=new(c(t.dtype))(m):t.dtype&&Array.isArray(g=t.dtype)&&(g.length=m);for(let e=0;ei||s>0x40000000){for(let e=0;eu||_>h||T=M||o===s)return;let d=y[a];void 0===s&&(s=d.length);for(let t=o;t=l&&i<=p&&n>=c&&n<=m&&k.push(r)}let f=v[a],x=f[4*o+0],b=f[4*o+1],w=f[4*o+2],S=f[4*o+3],E=function(e,t){let r=null,i=0;for(;null===r;)if(r=e[4*t+i],++i>e.length)return null;return r}(f,o+1),D=.5*n,C=a+1;t(r,i,D,C,x,b||w||S||E),t(r,i+D,D,C,b,w||S||E),t(r+D,i,D,C,w,S||E),t(r+D,i+D,D,C,S,E)}(0,0,1,0,0,1),k},g;function w(e,t,r){let i=1,n=.5,a=.5,o=.5;for(let s=0;s2&&(t.push([i].concat(a.splice(0,2))),s="l",i="m"==i?"l":"L");;){if(a.length==r[s])return a.unshift(i),t.push(a);if(a.length1&&(n=1),n<-1&&(n=-1),(e*i-t*r<0?-1:1)*Math.acos(n)},s=function(e,t,r,n,a,s,l,u,c,h,d,f){var p=Math.pow(a,2),m=Math.pow(s,2),g=Math.pow(d,2),y=Math.pow(f,2),v=p*m-p*y-m*g;v<0&&(v=0),v/=p*y+m*g;var x=(v=Math.sqrt(v)*(l===u?-1:1))*a/s*f,b=-(v*s)/a*d,_=(d-x)/a,w=(f-b)/s,T=o(1,0,_,w),A=o(_,w,(-d-x)/a,(-f-b)/s);return 0===u&&A>0&&(A-=i),1===u&&A<0&&(A+=i),[h*x-c*b+(e+r)/2,c*x+h*b+(t+n)/2,T,A]};e.default=function(e){var t=e.px,o=e.py,l=e.cx,u=e.cy,c=e.rx,h=e.ry,d=e.xAxisRotation,f=void 0===d?0:d,p=e.largeArcFlag,m=e.sweepFlag,g=[];if(0===c||0===h)return[];var y=Math.sin(f*i/360),v=Math.cos(f*i/360),x=v*(t-l)/2+y*(o-u)/2,b=-y*(t-l)/2+v*(o-u)/2;if(0===x&&0===b)return[];var _=Math.pow(x,2)/Math.pow(c=Math.abs(c),2)+Math.pow(b,2)/Math.pow(h=Math.abs(h),2);_>1&&(c*=Math.sqrt(_),h*=Math.sqrt(_));var w=r(s(t,o,l,u,c,h,void 0===p?0:p,void 0===m?0:m,y,v,x,b),4),T=w[0],A=w[1],M=w[2],k=w[3],S=Math.abs(k)/(i/4);1e-7>Math.abs(1-S)&&(S=1);var E=Math.max(Math.ceil(S),1);k/=E;for(var D=0;D4?(o=g[g.length-4],s=g[g.length-3]):(o=d,s=f),a.push(g)}return a};var r=mu();function i(e,t,r,i){return["C",e,t,r,i,r,i]}function n(e,t,r,i,n,a){return["C",e/3+2/3*r,t/3+2/3*i,n/3+2/3*r,a/3+2/3*i,n,a]}}}),mh=m({"node_modules/is-svg-path/index.js"(e,t){t.exports=function(e){return"string"==typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}}}),md=m({"node_modules/svg-path-bounds/index.js"(e,t){var r=ms(),i=ml(),n=mc(),a=mh();t.exports=function(e){if(Array.isArray(e)&&1===e.length&&"string"==typeof e[0]&&(e=e[0]),"string"==typeof e){if(!a(e))throw Error("String is not an SVG path.");e=r(e)}if(!Array.isArray(e))throw Error("Argument should be a string or an array of path segments.");if(!(e=n(e=i(e))).length)return[0,0,0,0];for(var t=[1/0,1/0,-1/0,-1/0],o=0,s=e.length;ot[2]&&(t[2]=l[u+0]),l[u+1]>t[3]&&(t[3]=l[u+1]);return t}}}),mf=m({"node_modules/bitmap-sdf/index.js"(e,t){function r(e,t,r,n,a,o,s){for(var l=0;l0?"white":"black",mb.lineWidth=Math.abs(a)),mb.translate(.5*r,.5*i),mb.scale(l,l);let u=new Path2D(e);return mb.fill(u),a&&mb.stroke(u),mb.setTransform(1,0,0,1,0,0),(0,mv.default)(mb,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*n})}g(mp,{default:()=>mm});var mg,my,mv,mx,mb,m_=p({"node_modules/svg-path-sdf/svg-path-sdf.js"(){mg=v(md()),my=v(mh()),mv=v(mf()),mb=(mx=document.createElement("canvas")).getContext("2d",{willReadFrequently:!0})}}),mw=m({"src/traces/scattergl/convert.js"(e,t){var r=I(),i=(m_(),x(mp)).default,{normalize:n}=er(),a=e1(),o=tb(),s=o.isArrayOrTypedArray,l=rt(),u=tI(),c=fp().formatColor,h=t6(),d=t8(),f=p2(),p=p0(),m=en().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=t7().appendArrayPointValue;function v(e,t){var i,n=e._fullLayout,a=t._length,l=t.textfont,u=t.textposition,c=s(u)?u:[u],h=l.color,d=l.size,f=l.family,p=l.weight,m=l.style,g=l.variant,v={},x=e._context.plotGlPixelRatio,_=t.texttemplate;if(_){v.text=[];var w=n._d3locale,T=Array.isArray(_),A=T?Math.min(_.length,a):a,M=T?function(e){return _[e]}:function(){return _};for(i=0;i500?"bold":"normal":e}function _(e,t){var r,i,a=t._length,o=t.marker,l={},u=s(o.symbol),h=s(o.angle),p=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(u||(i=f.isOpenSymbol(o.symbol)),u||p||m||g||h){l.symbols=Array(a),l.angles=Array(a),l.colors=Array(a),l.borderColors=Array(a);var x=o.symbol,b=o.angle,_=c(o,o.opacity,a),w=c(o.line,o.opacity,a);if(!s(w[0])){var T=w;for(w=Array(a),r=0;rp.TOO_MANY_POINTS||h.hasMarkers(t)?"rect":"round";if(u&&t.connectgaps){var d=i[0],f=i[1];for(n=0;n1?u[n]:u[0]:u,m=s(c)?c.length>1?c[n]:c[0]:c,y=g[p],v=g[m],x=d?d/.8+1:0,b=-v*x-.5*v;o.offset[n]=[y*x/f,b/f]}}return o}}}}),mT=m({"src/traces/scattergl/scene_update.js"(e,t){var r=tb();t.exports=function(e,t){var i=t._scene,n={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return t._scene||((i=t._scene={}).init=function(){r.extendFlat(i,a,n)},i.init(),i.update=function(e){var t=r.repeat(e,i.count);if(i.fill2d&&i.fill2d.update(t),i.scatter2d&&i.scatter2d.update(t),i.line2d&&i.line2d.update(t),i.error2d&&i.error2d.update(t.concat(t)),i.select2d&&i.select2d.update(t),i.glText)for(var n=0;n=m,T=2*_,A={},M=v.makeCalcdata(t,"x"),k=x.makeCalcdata(t,"y"),S=o(t,v,"x",M),E=o(t,x,"y",k),D=S.vals,C=E.vals;t._x=D,t._y=C,t.xperiodalignment&&(t._origX=M,t._xStarts=S.starts,t._xEnds=S.ends),t.yperiodalignment&&(t._origY=k,t._yStarts=E.starts,t._yEnds=E.ends);var I=Array(T),L=Array(_);for(s=0;s<_;s++)I[2*s]=D[s]===p?0/0:D[s],I[2*s+1]=C[s]===p?0/0:C[s],L[s]=s;if("log"===v.type)for(s=0;s1&&i.extendFlat(o.line,d.linePositions(e,t,r)),o.errorX||o.errorY){var s=d.errorBarPositions(e,t,r,n,a);o.errorX&&i.extendFlat(o.errorX,s.x),o.errorY&&i.extendFlat(o.errorY,s.y)}return o.text&&(i.extendFlat(o.text,{positions:r},d.textPosition(e,t,o.text,o.marker)),i.extendFlat(o.textSel,{positions:r},d.textPosition(e,t,o.text,o.markerSel)),i.extendFlat(o.textUnsel,{positions:r},d.textPosition(e,t,o.text,o.markerUnsel))),o}(e,t,I,D,C),z=f(e,b);return c(y,t),w?P.marker&&(a=P.marker.sizeAvg||Math.max(P.marker.size,3)):a=l(t,_),u(e,t,v,x,D,C,a),P.errorX&&g(t,v,P.errorX),P.errorY&&g(t,x,P.errorY),P.fill&&!z.fill2d&&(z.fill2d=!0),P.marker&&!z.scatter2d&&(z.scatter2d=!0),P.line&&!z.line2d&&(z.line2d=!0),(P.errorX||P.errorY)&&!z.error2d&&(z.error2d=!0),P.text&&!z.glText&&(z.glText=!0),P.marker&&(P.marker.snap=_),z.lineOptions.push(P.line),z.errorXOptions.push(P.errorX),z.errorYOptions.push(P.errorY),z.fillOptions.push(P.fill),z.markerOptions.push(P.marker),z.markerSelectedOptions.push(P.markerSel),z.markerUnselectedOptions.push(P.markerUnsel),z.textOptions.push(P.text),z.textSelectedOptions.push(P.textSel),z.textUnselectedOptions.push(P.textUnsel),z.selectBatch.push([]),z.unselectBatch.push([]),A._scene=z,A.index=z.count,A.x=D,A.y=C,A.positions=I,z.count++,[{x:!1,y:!1,t:A,trace:t}]}}}),mM=m({"src/traces/scattergl/edit_style.js"(e,t){var r=tb(),i=er(),n=en().DESELECTDIM;t.exports={styleTextSelection:function(e){var t,a,o=e[0],s=o.trace,l=o.t,u=l._scene,c=l.index,h=u.selectBatch[c],d=u.unselectBatch[c],f=u.textOptions[c],p=u.textSelectedOptions[c]||{},m=u.textUnselectedOptions[c]||{},g=r.extendFlat({},f);if(h.length||d.length){var y=p.color,v=m.color,x=f.color,b=r.isArrayOrTypedArray(x);for(g.color=Array(s._length),t=0;t10&&/[0-9](?:\s|\/)/.test(e)&&(a=e.match(/([0-9]+)/g).map(function(e){return parseFloat(e)}),n=e.match(/([a-z])/ig).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(a=[e[0],e[1],e[2]],n="rgb",o=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(n="rgb",a=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(n="hsl",a=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),o=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(o/=100)):(n="rgb",a=[e>>>16,(65280&e)>>>8,255&e]);return{space:n,values:a,alpha:o}};var i={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),mC=m({"node_modules/color-rgba/index.js"(e,t){var r=mD();t.exports=function(e){Array.isArray(e)&&e.raw&&(e=String.raw.apply(null,arguments));var t,i=r(e);if(!i.space)return[];var n="h"===i.space[0]?[360,100,100]:[255,255,255];return(t=[,,,])[0]=Math.min(Math.max(i.values[0],0),n[0]),t[1]=Math.min(Math.max(i.values[1],0),n[1]),t[2]=Math.min(Math.max(i.values[2],0),n[2]),"h"===i.space[0]&&(t=function(e){var t,r,i,n,a,o=e[0]/360,s=e[1]/100,l=e[2]/100,u=0;if(0===s)return[a=255*l,a,a];for(r=l<.5?l*(1+s):l+s-l*s,t=2*l-r,n=[0,0,0];u<3;)(i=o+-(1/3*(u-1)))<0?i++:i>1&&i--,a=6*i<1?t+(r-t)*6*i:2*i<1?r:3*i<2?t+(r-t)*(2/3-i)*6:t,n[u++]=255*a;return n}(t)),t.push(Math.min(Math.max(i.alpha,0),1)),t}}}),mI=m({"node_modules/color-normalize/index.js"(e,t){var r=mC(),i=mt();t.exports=function(e,t){"float"!==t&&t||(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var n,a=new(i(t))(4),o="uint8"!==t&&"uint8_clamped"!==t;return e.length&&"string"!=typeof e||(e=r(e),e[0]/=255,e[1]/=255,e[2]/=255),(n=e)instanceof Uint8Array||n instanceof Uint8ClampedArray||Array.isArray(n)&&(n[0]>1||0===n[0])&&(n[1]>1||0===n[1])&&(n[2]>1||0===n[2])&&(!n[3]||n[3]>1)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=null!=e[3]?e[3]:255,o&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255)):o?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=null!=e[3]?e[3]:1):(a[0]=Math.min(Math.max(Math.floor(255*e[0]),0),255),a[1]=Math.min(Math.max(Math.floor(255*e[1]),0),255),a[2]=Math.min(Math.max(Math.floor(255*e[2]),0),255),a[3]=null==e[3]?255:Math.min(Math.max(Math.floor(255*e[3]),0),255)),a}}}),mL=m({"node_modules/color-id/index.js"(e,t){var r=p6();function i(e,t){null==t&&(t=!0);var i=e[0],n=e[1],a=e[2],o=e[3];return null==o&&(o=t?1:255),t&&(i*=255,n*=255,a*=255,o*=255),i=255&r(i,0,255),n=255&r(n,0,255),0x1000000*i+(n<<16)+((a=255&r(a,0,255))<<8)+(o=255&r(o,0,255))}t.exports=i,t.exports.to=i,t.exports.from=function(e,t){var r=(e*=1)>>>24,i=(0xff0000&e)>>>16,n=(65280&e)>>>8,a=255&e;return!1===t?[r,i,n,a]:[r/255,i/255,n/255,a/255]}}}),mP=m({"node_modules/glslify/browser.js"(e,t){t.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],i=0;i[255*!this.tooManyColors,i.height],pixelRatio:e.context("pixelRatio"),scale:e.prop("scale"),scaleFract:e.prop("scaleFract"),translate:e.prop("translate"),translateFract:e.prop("translateFract"),markerTexture:e.prop("markerTexture"),paletteTexture:i},attributes:{x:(e,t)=>t.xAttr||{buffer:t.positionBuffer,stride:8,offset:0},y:(e,t)=>t.yAttr||{buffer:t.positionBuffer,stride:8,offset:4},xFract:(e,t)=>t.xAttr?{constant:[0,0]}:{buffer:t.positionFractBuffer,stride:8,offset:0},yFract:(e,t)=>t.yAttr?{constant:[0,0]}:{buffer:t.positionFractBuffer,stride:8,offset:4},size:(e,t)=>t.size.length?{buffer:t.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(255*t.size/this.maxSize)]},borderSize:(e,t)=>t.borderSize.length?{buffer:t.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*t.borderSize/this.maxSize)]},colorId:(e,t)=>t.color.length?{buffer:t.colorBuffer,stride:this.tooManyColors?8:4,offset:0}:{constant:this.tooManyColors?n.slice(4*t.color,4*t.color+4):[t.color]},borderColorId:(e,t)=>t.borderColor.length?{buffer:t.colorBuffer,stride:this.tooManyColors?8:4,offset:this.tooManyColors?4:2}:{constant:this.tooManyColors?n.slice(4*t.borderColor,4*t.borderColor+4):[t.borderColor]},isActive:(e,t)=>!0===t.activation?{constant:[1]}:t.activation?t.activation:{constant:[0]}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:e.prop("elements"),count:e.prop("count"),offset:e.prop("offset"),primitive:"points"},s=Object.assign({},a);s.frag=o([`precision highp float; +#define GLSLIFY 1 + +uniform float opacity; +uniform sampler2D markerTexture; + +varying vec4 fragColor, fragBorderColor; +varying float fragWidth, fragBorderColorLevel, fragColorLevel; + +float smoothStep(float x, float y) { + return 1.0 / (1.0 + exp(50.0*(x - y))); +} + +void main() { + float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth; + + // max-distance alpha + if (dist < 0.003) discard; + + // null-border case + if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) { + float colorAmt = smoothstep(.5 - delta, .5 + delta, dist); + gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity); + } + else { + float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist); + float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist); + + vec4 color = fragBorderColor; + color.a *= borderColorAmt; + color = mix(color, fragColor, colorAmt); + color.a *= opacity; + + gl_FragColor = color; + } + +} +`]),s.vert=o([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +// \`invariant\` effectively turns off optimizations for the position. +// We need this because -fast-math on M1 Macs is re-ordering +// floating point operations in a way that causes floating point +// precision limits to put points in the wrong locations. +invariant gl_Position; + +uniform bool constPointSize; +uniform float pixelRatio; +uniform vec2 scale, scaleFract, translate, translateFract, paletteSize; +uniform sampler2D paletteTexture; + +const float maxSize = 100.; +const float borderLevel = .5; + +varying vec4 fragColor, fragBorderColor; +varying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel; + +float pointSizeScale = (constPointSize) ? 2. : pixelRatio; + +bool isDirect = (paletteSize.x < 1.); + +vec4 getColor(vec4 id) { + return isDirect ? id / 255. : texture2D(paletteTexture, + vec2( + (id.x + .5) / paletteSize.x, + (id.y + .5) / paletteSize.y + ) + ); +} + +void main() { + // ignore inactive points + if (isActive == 0.) return; + + vec2 position = vec2(x, y); + vec2 positionFract = vec2(xFract, yFract); + + vec4 color = getColor(colorId); + vec4 borderColor = getColor(borderColorId); + + float size = size * maxSize / 255.; + float borderSize = borderSize * maxSize / 255.; + + gl_PointSize = 2. * size * pointSizeScale; + fragPointSize = size * pixelRatio; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + gl_Position = vec4(pos * 2. - 1., 0., 1.); + + fragColor = color; + fragBorderColor = borderColor; + fragWidth = 1. / gl_PointSize; + + fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.); + fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.); +} +`]),this.drawMarker=e(s);let l=Object.assign({},a);l.frag=o([`precision highp float; +#define GLSLIFY 1 + +varying vec4 fragColor, fragBorderColor; +varying float fragBorderRadius, fragWidth; + +uniform float opacity; + +float smoothStep(float edge0, float edge1, float x) { + float t; + t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); + return t * t * (3.0 - 2.0 * t); +} + +void main() { + float radius, alpha = 1.0, delta = fragWidth; + + radius = length(2.0 * gl_PointCoord.xy - 1.0); + + if (radius > 1.0 + delta) { + discard; + } + + alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); + + float borderRadius = fragBorderRadius; + float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); + vec4 color = mix(fragColor, fragBorderColor, ratio); + color.a *= alpha * opacity; + gl_FragColor = color; +} +`]),l.vert=o([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +// \`invariant\` effectively turns off optimizations for the position. +// We need this because -fast-math on M1 Macs is re-ordering +// floating point operations in a way that causes floating point +// precision limits to put points in the wrong locations. +invariant gl_Position; + +uniform bool constPointSize; +uniform float pixelRatio; +uniform vec2 paletteSize, scale, scaleFract, translate, translateFract; +uniform sampler2D paletteTexture; + +const float maxSize = 100.; + +varying vec4 fragColor, fragBorderColor; +varying float fragBorderRadius, fragWidth; + +float pointSizeScale = (constPointSize) ? 2. : pixelRatio; + +bool isDirect = (paletteSize.x < 1.); + +vec4 getColor(vec4 id) { + return isDirect ? id / 255. : texture2D(paletteTexture, + vec2( + (id.x + .5) / paletteSize.x, + (id.y + .5) / paletteSize.y + ) + ); +} + +void main() { + // ignore inactive points + if (isActive == 0.) return; + + vec2 position = vec2(x, y); + vec2 positionFract = vec2(xFract, yFract); + + vec4 color = getColor(colorId); + vec4 borderColor = getColor(borderColorId); + + float size = size * maxSize / 255.; + float borderSize = borderSize * maxSize / 255.; + + gl_PointSize = (size + borderSize) * pointSizeScale; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + gl_Position = vec4(pos * 2. - 1., 0., 1.); + + fragBorderRadius = 1. - 2. * borderSize / (size + borderSize); + fragColor = color; + fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; + fragWidth = 1. / gl_PointSize; +} +`]),this.drawCircle=e(l)}d.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},d.prototype.render=function(){return arguments.length&&this.update(...arguments),this.draw(),this},d.prototype.draw=function(){for(var e=arguments.length,t=Array(e),r=0;r{this.drawItem(t)});return this},d.prototype.drawItem=function(e,t){let{groups:r}=this,i=r[e];if("number"==typeof t&&(e=t,i=r[t],t=null),!(i&&i.count&&i.opacity))return;i.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,i,t));let n=[];for(let e=1;e{let r=n[t];if(void 0===e)return r;null===e?e={positions:null}:"function"==typeof e?e={ondraw:e}:"number"==typeof e[0]&&(e={positions:e}),null===(e=s(e,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"})).positions&&(e.positions=[]),null!=e.tooManyColors&&(this.tooManyColors=e.tooManyColors),r||(n[t]=r={id:t,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:f.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:f.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:f.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:f.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:f.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},e=Object.assign({},d.defaults,e)),!e.positions||"marker"in e||(e.marker=r.marker,delete r.marker),!e.marker||"positions"in e||(e.positions=r.positions,delete r.positions);let y=0,v=0;if(l(r,e,[{snap:!0,size:(e,t)=>(null==e&&(e=d.defaults.size),y+=e&&e.length?1:0,e),borderSize:(e,t)=>(null==e&&(e=d.defaults.borderSize),y+=e&&e.length?1:0,e),opacity:parseFloat,color:(e,t)=>(null==e&&(e=d.defaults.color),e=this.updateColor(e),v++,e),borderColor:(e,t)=>(null==e&&(e=d.defaults.borderColor),e=this.updateColor(e),v++,e),bounds:(e,t,r)=>("range"in r||(r.range=null),e),positions:(e,t,r)=>{let{snap:n}=t,{positionBuffer:o,positionFractBuffer:s,selectionBuffer:l}=t;if(e.x||e.y)return e.x.length?t.xAttr={buffer:f.buffer(e.x),offset:0,stride:4,count:e.x.length}:t.xAttr={buffer:e.x.buffer,offset:4*e.x.offset||0,stride:4*(e.x.stride||1),count:e.x.count},e.y.length?t.yAttr={buffer:f.buffer(e.y),offset:0,stride:4,count:e.y.length}:t.yAttr={buffer:e.y.buffer,offset:4*e.y.offset||0,stride:4*(e.y.stride||1),count:e.y.count},t.count=Math.max(t.xAttr.count,t.yAttr.count),e;let h=t.count=Math.floor((e=u(e,"float64")).length/2),d=t.bounds=h?i(e,2):null;if(r.range||t.range||(delete t.range,r.range=d),r.marker||t.marker||(delete t.marker,r.marker=null),n&&(!0===n||h>n)?t.tree=a(e,{bounds:d}):n&&n.length&&(t.tree=n),t.tree){let e={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(e):t.elements=f.elements(e)}var p=c.float32(e);return o({data:p,usage:"dynamic"}),s({data:c.fract32(e,p),usage:"dynamic"}),l({data:new Uint8Array(h),type:"uint8",usage:"stream"}),e}},{marker:(e,t,r)=>{let{activation:i}=t;if(i.forEach(e=>e&&e.destroy&&e.destroy()),i.length=0,e&&"number"!=typeof e[0]){let r=[];for(let i=0,n=Math.min(e.length,t.count);i{let i=t.bounds;if(i)return e||(e=i),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=c.fract(t.scale),t.translateFract=c.fract(t.translate),e},viewport:e=>h(e||[o.drawingBufferWidth,o.drawingBufferHeight])}]),y){let{count:e,size:t,borderSize:i,sizeBuffer:n}=r,a=new Uint8Array(2*e);if(t.length||i.length)for(let r=0;r=0)return a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(let r=0,i=e.length;r4*a&&(this.tooManyColors=!0),this.updatePalette(i),1===o.length?o[0]:o},d.prototype.updatePalette=function(e){if(this.tooManyColors)return;let{maxColors:t,paletteTexture:r}=this,i=Math.ceil(.25*e.length/t);if(i>1){e=e.slice();for(let r=.25*e.length%t;r{e.sizeBuffer.destroy(),e.positionBuffer.destroy(),e.positionFractBuffer.destroy(),e.colorBuffer.destroy(),e.activation.forEach(e=>e&&e.destroy&&e.destroy()),e.selectionBuffer.destroy(),e.elements&&e.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(e=>e&&e.destroy&&e.destroy()),this},t.exports=function(e,t){var r=new d(e,t),i=r.render.bind(r);return Object.assign(i,{render:i,update:r.update.bind(r),draw:r.draw.bind(r),destroy:r.destroy.bind(r),regl:r.regl,gl:r.gl,canvas:r.gl.canvas,groups:r.groups,markers:r.markerCache,palette:r.palette}),i}}}),mR=m({"node_modules/object-assign/index.js"(e,t){var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=!function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==i.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch{return!1}}()?function(e,t){for(var a,o,s=function(e){if(null==e)throw TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l=a.next.y&&a.next.y!==a.y){var h=a.x+(u-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(h<=o&&h>c&&(c=h,n=a.x=a.x&&a.x>=m&&o!==a.x&&s(un.x||a.x===n.x&&(r=n,i=a,0>l(r.prev,r,i.prev)&&0>l(i.next,r,r.next))))&&(n=a,y=d)),a=a.next}while(a!==p);return n}(e,t);if(!r)return t;var i=p(r,e);return n(i,i.next),n(r,r.next)}(g[u],r);return r}(e,t,T,r)),e.length>80*r){h=m=e[0],d=y=e[1];for(var M=r;Mm&&(m=v),x>y&&(y=x);b=0!==(b=Math.max(m-h,y-d))?32767/b:0}return function e(t,r,i,a,h,d,m){if(t){!m&&d&&function(e,t,r,i){var n=e;do 0===n.z&&(n.z=o(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,r,i,n,a,o,s,l,u=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,i=r,s=0,t=0;t0||l>0&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;r=i}a.nextZ=null,u*=2}while(o>1)}(n)}(t,a,h,d);for(var y,v,x=t;t.prev!==t.next;){if(y=t.prev,v=t.next,d?function(e,t,r,i){var n=e.prev,a=e.next;if(l(n,e,a)>=0)return!1;for(var u=n.x,c=e.x,h=a.x,d=n.y,f=e.y,p=a.y,m=uc?u>h?u:h:c>h?c:h,v=d>f?d>p?d:p:f>p?f:p,x=o(m,g,t,r,i),b=o(y,v,t,r,i),_=e.prevZ,w=e.nextZ;_&&_.z>=x&&w&&w.z<=b;){if(_.x>=m&&_.x<=y&&_.y>=g&&_.y<=v&&_!==n&&_!==a&&s(u,d,c,f,h,p,_.x,_.y)&&l(_.prev,_,_.next)>=0||(_=_.prevZ,w.x>=m&&w.x<=y&&w.y>=g&&w.y<=v&&w!==n&&w!==a&&s(u,d,c,f,h,p,w.x,w.y)&&l(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;_&&_.z>=x;){if(_.x>=m&&_.x<=y&&_.y>=g&&_.y<=v&&_!==n&&_!==a&&s(u,d,c,f,h,p,_.x,_.y)&&l(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;w&&w.z<=b;){if(w.x>=m&&w.x<=y&&w.y>=g&&w.y<=v&&w!==n&&w!==a&&s(u,d,c,f,h,p,w.x,w.y)&&l(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}(t,a,h,d):function(e){var t=e.prev,r=e.next;if(l(t,e,r)>=0)return!1;for(var i=t.x,n=e.x,a=r.x,o=t.y,u=e.y,c=r.y,h=in?i>a?i:a:n>a?n:a,p=o>u?o>c?o:c:u>c?u:c,m=r.next;m!==t;){if(m.x>=h&&m.x<=f&&m.y>=d&&m.y<=p&&s(i,o,n,u,a,c,m.x,m.y)&&l(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}(t)){r.push(y.i/i|0),r.push(t.i/i|0),r.push(v.i/i|0),g(t),t=v.next,x=v.next;continue}if((t=v)===x){m?1===m?e(t=function(e,t,r){var i=e;do{var a=i.prev,o=i.next.next;!u(a,o)&&c(a,i,i.next,o)&&f(a,o)&&f(o,a)&&(t.push(a.i/r|0),t.push(i.i/r|0),t.push(o.i/r|0),g(i),g(i.next),i=e=o),i=i.next}while(i!==e);return n(i)}(n(t),r,i),r,i,a,h,d,2):2===m&&function(t,r,i,a,o,s){var h=t;do{for(var d,m,g=h.next.next;g!==h.prev;){if(h.i!==g.i&&(d=h,m=g,d.next.i!==m.i&&d.prev.i!==m.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&c(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(d,m)&&(f(d,m)&&f(m,d)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==e);return i}(d,m)&&(l(d.prev,d,m.prev)||l(d,m.prev,m))||u(d,m)&&l(d.prev,d,d.next)>0&&l(m.prev,m,m.next)>0))){var y=p(h,g);h=n(h,h.next),y=n(y,y.next),e(h,r,i,a,o,s,0),e(y,r,i,a,o,s,0);return}g=g.next}h=h.next}while(h!==t)}(t,r,i,a,h,d):e(n(t),r,i,a,h,d,1);break}}}}(T,A,r,h,d,b,0),A}function i(e,t,r,i,n){var a,o;if(n===v(e,t,r,i)>0)for(a=t;a=t;a-=i)o=m(a,e[a],e[a+1],o);return o&&u(o,o.next)&&(g(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var r,i=e;do if(r=!1,!i.steiner&&(u(i,i.next)||0===l(i.prev,i,i.next))){if(g(i),(i=t=i.prev)===i.next)break;r=!0}else i=i.next;while(r||i!==t);return t}function a(e,t){return e.x-t.x}function o(e,t,r,i,n){return(e=((e=((e=((e=((e=(e-r)*n|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-i)*n|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function s(e,t,r,i,n,a,o,s){return(n-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(i-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(n-o)*(i-s)}function l(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function u(e,t){return e.x===t.x&&e.y===t.y}function c(e,t,r,i){var n=d(l(e,t,r)),a=d(l(e,t,i)),o=d(l(r,i,e)),s=d(l(r,i,t));return!!(n!==a&&o!==s||0===n&&h(e,r,t)||0===a&&h(e,i,t)||0===o&&h(r,e,i)||0===s&&h(r,t,i))}function h(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function d(e){return e>0?1:e<0?-1:0}function f(e,t){return 0>l(e.prev,e,e.next)?l(e,t,e.next)>=0&&l(e,e.prev,t)>=0:0>l(e,t,e.prev)||0>l(e,e.next,t)}function p(e,t){var r=new y(e.i,e.x,e.y),i=new y(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function m(e,t,r,i){var n=new y(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function g(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 y(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function v(e,t,r,i){for(var n=0,a=t,o=r-i;a0&&(i+=e[n-1].length,r.holes.push(i))}return r}}}),mj=m({"node_modules/array-normalize/index.js"(e,t){var r=p9();t.exports=function(e,t,i){if(!e||null==e.length)throw Error("Argument should be an array");null==t&&(t=1),null==i&&(i=r(e,t));for(var n=0;n-1}}}),gt=m({"node_modules/es5-ext/string/#/contains/index.js"(e,t){t.exports=m9()()?String.prototype.contains:ge()}}),gr=m({"node_modules/d/index.js"(e,t){var r=mK(),i=m1(),n=m8(),a=m7(),o=gt();(t.exports=function(e,t){var i,s,l,u,c;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],r(e)?(i=o.call(e,"c"),s=o.call(e,"e"),l=o.call(e,"w")):(i=l=!0,s=!1),c={value:t,configurable:i,enumerable:s,writable:l},u?n(a(u),c):c}).gs=function(e,t,s){var l,u,c,h;return"string"!=typeof e?(c=s,s=t,t=e,e=null):c=arguments[3],r(t)?i(t)?r(s)?i(s)||(c=s,s=void 0):s=void 0:(c=t,t=s=void 0):t=void 0,r(e)?(l=o.call(e,"c"),u=o.call(e,"e")):(l=!0,u=!1),h={get:t,set:s,configurable:l,enumerable:u},c?n(a(c),h):h}}}),gi=m({"node_modules/es5-ext/function/is-arguments.js"(e,t){var r=Object.prototype.toString,i=r.call(function(){return arguments}());t.exports=function(e){return r.call(e)===i}}}),gn=m({"node_modules/es5-ext/string/is-string.js"(e,t){var r=Object.prototype.toString,i=r.call("");t.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===i)||!1}}}),ga=m({"node_modules/ext/global-this/is-implemented.js"(e,t){t.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}}}),go=m({"node_modules/ext/global-this/implementation.js"(e,t){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),gs=m({"node_modules/ext/global-this/index.js"(e,t){t.exports=ga()()?globalThis:go()}}),gu=m({"node_modules/es6-symbol/is-implemented.js"(e,t){var r=gs(),i={object:!0,symbol:!0};t.exports=function(){var e,t=r.Symbol;if("function"!=typeof t)return!1;e=t("test symbol");try{String(e)}catch{return!1}return!(!i[typeof t.iterator]||!i[typeof t.toPrimitive]||!i[typeof t.toStringTag])}}}),gc=m({"node_modules/es6-symbol/is-symbol.js"(e,t){t.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])}}}),gh=m({"node_modules/es6-symbol/validate-symbol.js"(e,t){var r=gc();t.exports=function(e){if(!r(e))throw TypeError(e+" is not a symbol");return e}}}),gd=m({"node_modules/es6-symbol/lib/private/generate-name.js"(e,t){var r=gr(),i=Object.defineProperty,n=Object.prototype,a=(0,Object.create)(null);t.exports=function(e){for(var t,o,s=0;a[e+(s||"")];)++s;return a[e+=s||""]=!0,i(n,t="@@"+e,r.gs(null,function(e){o||(o=!0,i(this,t,r(e)),o=!1)})),t}}}),gf=m({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(e,t){var r=gr(),i=gs().Symbol;t.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",i&&i.hasInstance||e("hasInstance")),isConcatSpreadable:r("",i&&i.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",i&&i.iterator||e("iterator")),match:r("",i&&i.match||e("match")),replace:r("",i&&i.replace||e("replace")),search:r("",i&&i.search||e("search")),species:r("",i&&i.species||e("species")),split:r("",i&&i.split||e("split")),toPrimitive:r("",i&&i.toPrimitive||e("toPrimitive")),toStringTag:r("",i&&i.toStringTag||e("toStringTag")),unscopables:r("",i&&i.unscopables||e("unscopables"))})}}}),gp=m({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(e,t){var r=gr(),i=gh(),n=Object.create(null);t.exports=function(e){return Object.defineProperties(e,{for:r(function(t){return n[t]?n[t]:n[t]=e(String(t))}),keyFor:r(function(e){var t;for(t in i(e),n)if(n[t]===e)return t})})}}}),gm=m({"node_modules/es6-symbol/polyfill.js"(e,t){var r,i,n,a=gr(),o=gh(),s=gs().Symbol,l=gd(),u=gf(),c=gp(),h=Object.create,d=Object.defineProperties,f=Object.defineProperty;if("function"==typeof s)try{String(s()),n=!0}catch{}else s=null;i=function(e){if(this instanceof i)throw TypeError("Symbol is not a constructor");return r(e)},t.exports=r=function e(t){if(this instanceof e)throw TypeError("Symbol is not a constructor");return n?s(t):d(h(i.prototype),{__description__:a("",t=void 0===t?"":String(t)),__name__:a("",l(t))})},u(r),c(r),d(i.prototype,{constructor:a(r),toString:a("",function(){return this.__name__})}),d(r.prototype,{toString:a(function(){return"Symbol ("+o(this).__description__+")"}),valueOf:a(function(){return o(this)})}),f(r.prototype,r.toPrimitive,a("",function(){var e=o(this);return"symbol"==typeof e?e:e.toString()})),f(r.prototype,r.toStringTag,a("c","Symbol")),f(i.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),f(i.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}}),gg=m({"node_modules/es6-symbol/index.js"(e,t){t.exports=gu()()?gs().Symbol:gm()}}),gy=m({"node_modules/es5-ext/array/#/clear.js"(e,t){var r=mH();t.exports=function(){return r(this).length=0,this}}}),gv=m({"node_modules/es5-ext/object/valid-callable.js"(e,t){t.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return e}}}),gx=m({"node_modules/type/string/coerce.js"(e,t){var r=mK(),i=mJ(),n=Object.prototype.toString;t.exports=function(e){if(!r(e))return null;if(i(e)){var t=e.toString;if("function"!=typeof t||t===n)return null}try{return""+e}catch{return null}}}}),gb=m({"node_modules/type/lib/safe-to-string.js"(e,t){t.exports=function(e){try{return e.toString()}catch{try{return String(e)}catch{return null}}}}}),g_=m({"node_modules/type/lib/to-short-string.js"(e,t){var r=gb(),i=/[\n\r\u2028\u2029]/g;t.exports=function(e){var t=r(e);return null===t?"":(t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(i,function(e){switch(e){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("Unexpected character")}}))}}}),gw=m({"node_modules/type/lib/resolve-error-message.js"(e,t){var r=gx(),i=g_();t.exports=function(e,t,n){n&&n.errorMessage&&(e=r(n.errorMessage));var a=e.indexOf("%v"),o=a>-1?i(t):null;if(n&&n.name){var s,l,u,c,h=e.indexOf("%n");if(h>-1)return a>-1?(h>a?(s=o,u=a,l=n.name,c=h):(s=n.name,u=h,l=o,c=a),e.slice(0,u)+s+e.slice(u+2,c)+l+e.slice(c+2)):e.slice(0,h)+n.name+e.slice(h+2)}return a>-1?e.slice(0,a)+o+e.slice(a+2):e}}}),gT=m({"node_modules/type/lib/resolve-exception.js"(e,t){var r=mK(),i=gw();t.exports=function(e,t,n){if(n&&!r(e)){if("default"in n)return n.default;if(n.isOptional)return null}var a=new(n&&n.Error||TypeError)(i(t,e,n));throw n&&n.errorCode&&(a.code=n.errorCode),a}}}),gA=m({"node_modules/type/value/ensure.js"(e,t){var r=gT(),i=mK();t.exports=function(e){if(i(e))return e;var t=arguments[1];return r(e,t&&t.name?"Expected a value for %n, received %v":"Cannot use %v",t)}}}),gM=m({"node_modules/type/plain-function/ensure.js"(e,t){var r=gT(),i=m1();t.exports=function(e){if(i(e))return e;var t=arguments[1];return r(e,t&&t.name?"Expected a plain function for %n, received %v":"%v is not a plain function",t)}}}),gk=m({"node_modules/es5-ext/array/from/is-implemented.js"(e,t){t.exports=function(){var e,t,r=Array.from;return"function"==typeof r&&!!((t=r(e=["raz","dwa"]))&&t!==e&&"dwa"===t[1])}}}),gS=m({"node_modules/es5-ext/function/is-function.js"(e,t){var r=Object.prototype.toString,i=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(e){return"function"==typeof e&&i(r.call(e))}}}),gE=m({"node_modules/es5-ext/math/sign/is-implemented.js"(e,t){t.exports=function(){var e=Math.sign;return"function"==typeof e&&1===e(10)&&-1===e(-20)}}}),gD=m({"node_modules/es5-ext/math/sign/shim.js"(e,t){t.exports=function(e){return isNaN(e=Number(e))||0===e?e:e>0?1:-1}}}),gC=m({"node_modules/es5-ext/math/sign/index.js"(e,t){t.exports=gE()()?Math.sign:gD()}}),gI=m({"node_modules/es5-ext/number/to-integer.js"(e,t){var r=gC(),i=Math.abs,n=Math.floor;t.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*n(i(e)):e}}}),gL=m({"node_modules/es5-ext/number/to-pos-integer.js"(e,t){var r=gI(),i=Math.max;t.exports=function(e){return i(0,r(e))}}}),gP=m({"node_modules/es5-ext/array/from/shim.js"(e,t){var r=gg().iterator,i=gi(),n=gS(),a=gL(),o=gv(),s=mH(),l=mU(),u=gn(),c=Array.isArray,h=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;t.exports=function(e){var t,p,m,g,y,v,x,b,_,w,T=arguments[1],A=arguments[2];if(e=Object(s(e)),l(T)&&o(T),this&&this!==Array&&n(this))t=this;else{if(!T){if(i(e))return 1!==(y=e.length)?Array.apply(null,e):((g=[,])[0]=e[0],g);if(c(e)){for(g=Array(y=e.length),p=0;p=55296&&v<=56319&&(w+=e[++p]),w=T?h.call(T,A,w,m):w,t?(d.value=w,f(g,m,d)):g[m]=w,++m;y=m}}if(void 0===y)for(y=a(e.length),t&&(g=new t(y)),p=0;p=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void c(this,"__redo__",s("c",[e]));this.__redo__.forEach(function(t,r){t>=e&&(this.__redo__[r]=++t)},this),this.__redo__.push(e)}}),_onDelete:s(function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach(function(t,r){t>e&&(this.__redo__[r]=--t)},this)))}),_onClear:s(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),c(r.prototype,u.iterator,s(function(){return this}))}}),gV=m({"node_modules/es6-iterator/array.js"(e,t){var r,i=mY(),n=gt(),a=gr(),o=gg(),s=gN(),l=Object.defineProperty;r=t.exports=function(e,t){if(!(this instanceof r))throw TypeError("Constructor requires 'new'");s.call(this,e),l(this,"__kind__",a("",t=t?n.call(t,"key+value")?"key+value":n.call(t,"key")?"key":"value":"value"))},i&&i(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a(function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e})}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}}),gU=m({"node_modules/es6-iterator/string.js"(e,t){var r,i=mY(),n=gr(),a=gg(),o=gN(),s=Object.defineProperty;r=t.exports=function(e){if(!(this instanceof r))throw TypeError("Constructor requires 'new'");e=String(e),o.call(this,e),s(this,"__length__",n("",e.length))},i&&i(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:n(function(){if(this.__list__){if(this.__nextIndex__=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r})}),s(r.prototype,a.toStringTag,n("c","String Iterator"))}}),gq=m({"node_modules/es6-iterator/is-iterable.js"(e,t){var r=gi(),i=mU(),n=gn(),a=gg().iterator,o=Array.isArray;t.exports=function(e){return!!i(e)&&(!!(o(e)||n(e)||r(e))||"function"==typeof e[a])}}}),gG=m({"node_modules/es6-iterator/valid-iterable.js"(e,t){var r=gq();t.exports=function(e){if(!r(e))throw TypeError(e+" is not iterable");return e}}}),gH=m({"node_modules/es6-iterator/get.js"(e,t){var r=gi(),i=gn(),n=gV(),a=gU(),o=gG(),s=gg().iterator;t.exports=function(e){return"function"==typeof o(e)[s]?e[s]():r(e)?new n(e):i(e)?new a(e):new n(e)}}}),g$=m({"node_modules/es6-iterator/for-of.js"(e,t){var r=gi(),i=gv(),n=gn(),a=gH(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;t.exports=function(e,t){var u,c,h,d,f,p,m,g,y=arguments[2];if(o(e)||r(e)?u="array":n(e)?u="string":e=a(e),i(t),h=function(){d=!0},"array"===u)return void l.call(e,function(e){return s.call(t,y,e,h),d});if("string"===u){for(p=e.length,f=0;f=55296&&g<=56319&&(m+=e[++f]),s.call(t,y,m,h),!d);++f);return}for(c=e.next();!c.done;){if(s.call(t,y,c.value,h),d)return;c=e.next()}}}}),gW=m({"node_modules/es6-weak-map/is-native-implemented.js"(e,t){t.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),gY=m({"node_modules/es6-weak-map/polyfill.js"(e,t){var r,i=mU(),n=mY(),a=mZ(),o=mH(),s=mX(),l=gr(),u=gH(),c=g$(),h=gg().toStringTag,d=gW(),f=Array.isArray,p=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;t.exports=r=function(){var e,t=arguments[0];if(!(this instanceof r))throw TypeError("Constructor requires 'new'");return e=d&&n&&WeakMap!==r?n(new WeakMap,g(this)):this,i(t)&&(f(t)||(t=u(t))),p(e,"__weakMapData__",l("c","$weakMap$"+s())),t&&c(t,function(t){o(t),e.set(t[0],t[1])}),e},d&&(n&&n(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l(function(e){return!!m.call(a(e),this.__weakMapData__)&&(delete e[this.__weakMapData__],!0)}),get:l(function(e){if(m.call(a(e),this.__weakMapData__))return e[this.__weakMapData__]}),has:l(function(e){return m.call(a(e),this.__weakMapData__)}),set:l(function(e,t){return p(a(e),this.__weakMapData__,l("c",t)),this}),toString:l(function(){return"[object WeakMap]"})}),p(r.prototype,h,l("c","WeakMap"))}}),gZ=m({"node_modules/es6-weak-map/index.js"(e,t){t.exports=mN()()?WeakMap:gY()}}),gX=m({"node_modules/array-find-index/index.js"(e,t){t.exports=function(e,t,r){if("function"==typeof Array.prototype.findIndex)return e.findIndex(t,r);if("function"!=typeof t)throw TypeError("predicate must be a function");var i=Object(e),n=i.length;if(0===n)return -1;for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) { + //handle miter clipping + bTopCoord -= normalWidth * endTopJoin; + bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; + } + + if (nextReverse) { + //make join rectangular + vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; + float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); + bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; + bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; + } + else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { + //handle miter clipping + aBotCoord -= normalWidth * startBotJoin; + aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; + } + + vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; + vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; + + vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; + vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; + + //position is normalized 0..1 coord on the screen + vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; + + startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; + endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2.0 - 1.0, depth, 1); + + enableStartMiter = step(dot(currTangent, prevTangent), .5); + enableEndMiter = step(dot(currTangent, nextTangent), .5); + + //bevel miter cutoffs + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } + + //round miter cutoffs + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } +} +`,x=` +precision highp float; + +uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; +uniform sampler2D dashTexture; + +varying vec4 fragColor; +varying vec2 tangent; +varying vec4 startCutoff, endCutoff; +varying vec2 startCoord, endCoord; +varying float enableStartMiter, enableEndMiter; + +float distToLine(vec2 p, vec2 a, vec2 b) { + vec2 diff = b - a; + vec2 perp = normalize(vec2(-diff.y, diff.x)); + return dot(p - a, perp); +} + +void main() { + float alpha = 1., distToStart, distToEnd; + float cutoff = thickness * .5; + + //bevel miter + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < -1.) { + discard; + return; + } + alpha *= min(max(distToStart + 1., 0.), 1.); + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < -1.) { + discard; + return; + } + alpha *= min(max(distToEnd + 1., 0.), 1.); + } + } + + // round miter + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < 0.) { + float radius = length(gl_FragCoord.xy - startCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < 0.) { + float radius = length(gl_FragCoord.xy - endCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + } + + float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; + float dash = texture2D(dashTexture, vec2(t, .5)).r; + + gl_FragColor = fragColor; + gl_FragColor.a *= alpha * opacity * dash; +} +`;function b(e,t){if(!(this instanceof b))return new b(e,t);if("function"==typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=e._gl,this.regl=e,this.passes=[],this.shaders=b.shaders.has(e)?b.shaders.get(e):b.shaders.set(e,b.createShaders(e)).get(e),this.update(t)}t.exports=b,b.dashMult=2,b.maxPatternLength=256,b.precisionThreshold=3e6,b.maxPoints=1e4,b.maxLines=2048,b.shaders=new h,b.createShaders=function(e){let t=e.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),r={primitive:"triangle strip",instances:e.prop("count"),count:4,offset:0,uniforms:{miterMode:(e,t)=>"round"===t.join?2:1,miterLimit:e.prop("miterLimit"),scale:e.prop("scale"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),thickness:e.prop("thickness"),dashTexture:e.prop("dashTexture"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),dashLength:e.prop("dashLength"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight],depth:e.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(e,t)=>!t.overlay},stencil:{enable:!1},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport")},i=e(n({vert:p,frag:m,attributes:{lineEnd:{buffer:t,divisor:0,stride:8,offset:0},lineTop:{buffer:t,divisor:0,stride:8,offset:4},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},r)),a;try{a=e(n({cull:{enable:!0,face:"back"},vert:v,frag:x,attributes:{lineEnd:{buffer:t,divisor:0,stride:8,offset:0},lineTop:{buffer:t,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},r))}catch{a=i}return{fill:e({primitive:"triangle",elements:(e,t)=>t.triangles,offset:0,vert:g,frag:y,uniforms:{scale:e.prop("scale"),color:e.prop("fill"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},attributes:{position:{buffer:e.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8}},blend:r.blend,depth:{enable:!1},scissor:r.scissor,stencil:r.stencil,viewport:r.viewport}),rect:i,miter:a}},b.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},b.prototype.render=function(...e){e.length&&this.update(...e),this.draw()},b.prototype.draw=function(...e){return(e.length?e:this.passes).forEach((e,t)=>{if(e&&Array.isArray(e))return this.draw(...e);"number"==typeof e&&(e=this.passes[e]),e&&e.count>1&&e.opacity&&(this.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&this.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>b.precisionThreshold||e.scale[1]*e.viewport.height>b.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=b.maxPoints)?this.shaders.rect(e):this.shaders.miter(e)))}),this},b.prototype.update=function(e){if(!e)return;null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);let{regl:t,gl:h}=this;if(e.forEach((e,p)=>{let m=this.passes[p];if(void 0!==e){if(null===e){this.passes[p]=null;return}if("number"==typeof e[0]&&(e={positions:e}),e=a(e,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),m||(this.passes[p]=m={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:t.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:t.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:t.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},e=n({},b.defaults,e)),null!=e.thickness&&(m.thickness=parseFloat(e.thickness)),null!=e.opacity&&(m.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(m.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(m.overlay=!!e.overlay,pe-t),t=[],n=0,a=null!=m.hole?m.hole[0]:null;if(null!=a){let t=f(e,e=>e>=a);(e=e.slice(0,t)).push(a)}for(let i=0;it-a+(e[i]-n)));o=o.map(t=>t+n+(t+n{e.colorBuffer.destroy(),e.positionBuffer.destroy(),e.dashTexture.destroy()}),this.passes.length=0,this}}}),gJ=m({"node_modules/regl-error2d/index.js"(e,t){var r=p9(),i=mI(),n=mz(),a=p8(),o=mR(),s=mr(),{float32:l,fract32:u}=mF();t.exports=function(e,t){if("function"==typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h=e._gl,d,f,p,m,g,y,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return m=e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),f=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),y=e.buffer({usage:"static",type:"float",data:c}),T(t),d=e({vert:` + precision highp float; + + attribute vec2 position, positionFract; + attribute vec4 error; + attribute vec4 color; + + attribute vec2 direction, lineOffset, capOffset; + + uniform vec4 viewport; + uniform float lineWidth, capSize; + uniform vec2 scale, scaleFract, translate, translateFract; + + varying vec4 fragColor; + + void main() { + fragColor = color / 255.; + + vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; + + vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; + + vec2 position = position + dxy; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + pos += pixelOffset / viewport.zw; + + gl_Position = vec4(pos * 2. - 1., 0, 1); + } + `,frag:` + precision highp float; + + varying vec4 fragColor; + + uniform float opacity; + + void main() { + gl_FragColor = fragColor; + gl_FragColor.a *= opacity; + } + `,uniforms:{range:e.prop("range"),lineWidth:e.prop("lineWidth"),capSize:e.prop("capSize"),opacity:e.prop("opacity"),scale:e.prop("scale"),translate:e.prop("translate"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},attributes:{color:{buffer:m,offset:(e,t)=>4*t.offset,divisor:1},position:{buffer:f,offset:(e,t)=>8*t.offset,divisor:1},positionFract:{buffer:p,offset:(e,t)=>8*t.offset,divisor:1},error:{buffer:g,offset:(e,t)=>16*t.offset,divisor:1},direction:{buffer:y,stride:24,offset:0},lineOffset:{buffer:y,stride:24,offset:8},capOffset:{buffer:y,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport"),stencil:!1,instances:e.prop("count"),count:c.length}),o(b,{update:T,draw:_,destroy:A,regl:e,gl:h,canvas:h.canvas,groups:x}),b;function b(e){e?T(e):null===e&&A(),_()}function _(t){if("number"==typeof t)return w(t);t&&!Array.isArray(t)&&(t=[t]),e._refresh(),x.forEach((e,r)=>{if(e){if(t&&(t[r]?e.draw=!0:e.draw=!1),!e.draw){e.draw=!0;return}w(r)}})}function w(e){"number"==typeof e&&(e=x[e]),null!=e&&e&&e.count&&e.color&&e.opacity&&e.positions&&e.positions.length>1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],d(e),e.after&&e.after(e))}function T(e){if(!e)return;null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);let t=0,c=0;if(b.groups=x=e.map((e,l)=>{let d=x[l];return e&&("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),e=a(e,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),d||(x[l]=d={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=o({},v,e)),n(d,e,[{lineWidth:e=>.5*e,capSize:e=>.5*e,opacity:parseFloat,errors:e=>(e=s(e),c+=e.length,e),positions:(e,i)=>(i.count=Math.floor((e=s(e,"float64")).length/2),i.bounds=r(e,2),i.offset=t,t+=i.count,e)},{color:(e,t)=>{let r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"==typeof e[0]){let t=e;e=Array(r);for(let i=0;i{let i=t.bounds;return e||(e=i),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=u(t.scale),t.translateFract=u(t.translate),e},viewport:e=>{let t;return Array.isArray(e)?t={x:e[0],y:e[1],width:e[2]-e[0],height:e[3]-e[1]}:e?(t={x:e.x||e.left||0,y:e.y||e.top||0},e.right?t.width=e.right-t.x:t.width=e.w||e.width||0,e.bottom?t.height=e.bottom-t.y:t.height=e.h||e.height||0):t={x:0,y:0,width:h.drawingBufferWidth,height:h.drawingBufferHeight},t}}])),d}),t||c){let e=x.reduce((e,t,r)=>e+(t?t.count:0),0),t=new Float64Array(2*e),r=new Uint8Array(4*e),i=new Float32Array(4*e);x.forEach((e,n)=>{if(!e)return;let{positions:a,count:o,offset:s,color:l,errors:u}=e;o&&(r.set(l,4*s),i.set(u,4*s),t.set(a,2*s))});var d=l(t);f(d),p(u(t,d)),m(r),g(i)}}function A(){f.destroy(),p.destroy(),m.destroy(),g.destroy(),y.destroy()}};var c=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]}}),gQ=m({"node_modules/unquote/index.js"(e,t){var r=/[\'\"]/;t.exports=function(e){return e?(r.test(e.charAt(0))&&(e=e.substr(1)),r.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}}}),g0=m({"node_modules/css-global-keywords/index.json"(e,t){t.exports=["inherit","initial","unset"]}}),g1=m({"node_modules/css-system-font-keywords/index.json"(e,t){t.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),g2=m({"node_modules/css-font-weight-keywords/index.json"(e,t){t.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),g3=m({"node_modules/css-font-style-keywords/index.json"(e,t){t.exports=["normal","italic","oblique"]}}),g5=m({"node_modules/css-font-stretch-keywords/index.json"(e,t){t.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),g4=m({"node_modules/parenthesis/index.js"(e,t){function r(e,t){if("string"!=typeof e)return[e];var r=[e];"string"==typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var i=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],n=t.escape||"___",a=!!t.flat;i.forEach(function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),i=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return i.push(s),n+s+n}r.forEach(function(e,i){for(var n,o=0;e!=n;)if(n=e,e=e.replace(t,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[i]=e}),i=i.reverse(),r=r.map(function(t){return i.forEach(function(r){t=t.replace(RegExp("(\\"+n+r+"\\"+n+")","g"),e[0]+"$1"+e[1])}),t})});var o=RegExp("\\"+n+"([0-9]+)\\"+n);return a?r:function e(t,r,i){for(var n,a=[],s=0;n=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,n.index)),a.push(e(r[n[1]],r)),t=t.slice(n.index+n[0].length)}return a.push(t),a}(r[0],r)}function i(e,t){if(t&&t.flat){var r,i=t&&t.escape||"___",n=e[0];if(!n)return"";for(var a=RegExp("\\"+i+"([0-9]+)\\"+i),o=0;n!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=n,n=n.replace(a,s)}return n}return e.reduce(function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r},"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function n(e,t){return Array.isArray(e)?i(e,t):r(e,t)}n.parse=r,n.stringify=i,t.exports=n}}),g6=m({"node_modules/string-split-by/index.js"(e,t){var r=g4();t.exports=function(e,t,i){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");i?("string"==typeof i||Array.isArray(i))&&(i={ignore:i}):i={},null==i.escape&&(i.escape=!0),null==i.ignore?i.ignore=["[]","()","{}","<>",'""',"''","``","“”","\xab\xbb"]:("string"==typeof i.ignore&&(i.ignore=[i.ignore]),i.ignore=i.ignore.map(function(e){return 1===e.length&&(e+=e),e}));var n=r.parse(e,{flat:!0,brackets:i.ignore}),a=n[0].split(t);if(i.escape){for(var o=[],s=0;s1&&r===n&&('"'===r||"'"===r))return['"'+i(t.substr(1,t.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(a)return e(t.substr(0,a.index)).concat(e(a[1])).concat(e(t.substr(a.index+a[0].length)));var o=t.split(".");if(1===o.length)return['"'+i(t)+'"'];for(var s=[],l=0;ltypeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function u(e){return"string"==typeof e?e.split():e}function c(e){return"string"==typeof e?document.querySelector(e):e}function h(e,t){for(var r=Array(e),i=0;i65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,(t|=r)|e>>1}function f(){var e=h(8,function(){return[]});function t(t){var r=function(e){for(var t=16;t<=0x10000000;t*=16)if(e<=t)return t;return 0}(t),i=e[d(r)>>2];return i.length>0?i.pop():new ArrayBuffer(r)}function r(t){e[d(t.byteLength)>>2].push(t)}return{alloc:t,free:r,allocType:function(e,r){var i=null;switch(e){case 5120:i=new Int8Array(t(r),0,r);break;case 5121:i=new Uint8Array(t(r),0,r);break;case 5122:i=new Int16Array(t(2*r),0,r);break;case 5123:i=new Uint16Array(t(2*r),0,r);break;case 5124:i=new Int32Array(t(4*r),0,r);break;case 5125:i=new Uint32Array(t(4*r),0,r);break;case 5126:i=new Float32Array(t(4*r),0,r);break;default:return null}return i.length!==r?i.subarray(0,r):i},freeType:function(e){r(e.buffer)}}}var p=f();p.zero=f();var m=function(e,t){var r=1;t.ext_texture_filter_anisotropic&&(r=e.getParameter(34047));var i=1,n=1;t.webgl_draw_buffers&&(i=e.getParameter(34852),n=e.getParameter(36063));var a=!!t.oes_texture_float;if(a){var o=e.createTexture();e.bindTexture(3553,o),e.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var s=e.createFramebuffer();if(e.bindFramebuffer(36160,s),e.framebufferTexture2D(36160,36064,3553,o,0),e.bindTexture(3553,null),36053!==e.checkFramebufferStatus(36160))a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var l=p.allocType(5126,4);e.readPixels(0,0,1,1,6408,5126,l),e.getError()?a=!1:(e.deleteFramebuffer(s),e.deleteTexture(o),a=1===l[0]),p.freeType(l)}}var u="u">typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),c=!0;if(!u){var h=e.createTexture(),d=p.allocType(5121,36);e.activeTexture(33984),e.bindTexture(34067,h),e.texImage2D(34069,0,6408,3,3,0,6408,5121,d),p.freeType(d),e.bindTexture(34067,null),e.deleteTexture(h),c=!e.getError()}return{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter(function(e){return!!t[e]}),maxAnisotropic:r,maxDrawbuffers:i,maxColorAttachments:n,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:a,npotTextureCube:c}},g=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray};function y(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||g(e.data))}var v=function(e){return Object.keys(e).map(function(t){return e[t]})},x=function(e){for(var t=[],r=e;r.length;r=r[0])t.push(r.length);return t},b=function(e,t,r,i){var n=1;if(t.length)for(var a=0;a>>31<<15,a=(i<<1>>>24)-127,o=i>>13&1023;if(a<-24)t[r]=n;else if(a<-14){var s=-14-a;t[r]=n+(o+1024>>s)}else a>15?t[r]=n+31744:t[r]=n+(a+15<<10)+o}return t}function P(e){return Array.isArray(e)||g(e)}var z=[9984,9986,9985,9987],F=[0,6409,6410,6407,6408],O={};function R(e){return"[object "+e+"]"}O[6409]=O[6406]=O[6402]=1,O[34041]=O[6410]=2,O[6407]=O[35904]=3,O[6408]=O[35906]=4;var B=R("HTMLCanvasElement"),j=R("OffscreenCanvas"),N=R("CanvasRenderingContext2D"),V=R("ImageBitmap"),U=R("HTMLImageElement"),q=R("HTMLVideoElement"),G=Object.keys(w).concat([B,j,N,V,U,q]),H=[];H[5121]=1,H[5126]=4,H[36193]=2,H[5123]=2,H[5125]=4;var $=[];function W(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function Y(e){return!!Array.isArray(e)&&!(0===e.length||!P(e[0]))}function Z(e){return Object.prototype.toString.call(e)}function X(e){if(!e)return!1;var t=Z(e);return G.indexOf(t)>=0||W(e)||Y(e)||y(e)}function K(e){return 0|w[Object.prototype.toString.call(e)]}function J(e,t){return p.allocType(36193===e.type?5126:e.type,t)}function Q(e,t){36193===e.type?(e.data=L(t),p.freeType(t)):e.data=t}function ee(e,t,r,i,n,a){var o;if(o="u">typeof $[e]?$[e]:O[e]*H[t],a&&(o*=6),!n)return o*r*i;for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}$[32854]=2,$[32855]=2,$[36194]=2,$[34041]=4,$[33776]=.5,$[33777]=.5,$[33778]=1,$[33779]=1,$[35986]=.5,$[35987]=1,$[34798]=1,$[35840]=.5,$[35841]=.25,$[35842]=.5,$[35843]=.25,$[36196]=.5;var et=[];et[32854]=2,et[32855]=2,et[36194]=2,et[33189]=2,et[36168]=1,et[34041]=4,et[35907]=4,et[34836]=16,et[34842]=8,et[34843]=6;var er=function(e,t,r,i,n){var a={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(a.srgba=35907),t.ext_color_buffer_half_float&&(a.rgba16f=34842,a.rgb16f=34843),t.webgl_color_buffer_float&&(a.rgba32f=34836);var o=[];Object.keys(a).forEach(function(e){o[a[e]]=e});var s=0,l={};function u(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=32854,this.width=0,this.height=0,n.profile&&(this.stats={size:0})}function c(t){var r=t.renderbuffer;e.bindRenderbuffer(36161,null),e.deleteRenderbuffer(r),t.renderbuffer=null,t.refCount=0,delete l[t.id],i.renderbufferCount--}return u.prototype.decRef=function(){--this.refCount<=0&&c(this)},n.profile&&(i.getTotalRenderbufferSize=function(){var e=0;return Object.keys(l).forEach(function(t){e+=l[t].stats.size}),e}),{create:function(t,r){var s=new u(e.createRenderbuffer());function c(t,r){var i,l,u,h=0,d=0,f=32854;if("object"==typeof t&&t){if("shape"in t){var p=t.shape;h=0|p[0],d=0|p[1]}else"radius"in t&&(h=d=0|t.radius),"width"in t&&(h=0|t.width),"height"in t&&(d=0|t.height);"format"in t&&(f=a[t.format])}else"number"==typeof t?(h=0|t,d="number"==typeof r?0|r:h):t||(h=d=1);if(h!==s.width||d!==s.height||f!==s.format)return c.width=s.width=h,c.height=s.height=d,s.format=f,e.bindRenderbuffer(36161,s.renderbuffer),e.renderbufferStorage(36161,f,h,d),n.profile&&(s.stats.size=(i=s.format,l=s.width,u=s.height,et[i]*l*u)),c.format=o[s.format],c}return l[s.id]=s,i.renderbufferCount++,c(t,r),c.resize=function(t,r){var i,a,o,l=0|t,u=0|r||l;return l===s.width&&u===s.height||(c.width=s.width=l,c.height=s.height=u,e.bindRenderbuffer(36161,s.renderbuffer),e.renderbufferStorage(36161,s.format,l,u),n.profile&&(s.stats.size=(i=s.format,a=s.width,o=s.height,et[i]*a*o))),c},c._reglType="renderbuffer",c._renderbuffer=s,n.profile&&(c.stats=s.stats),c.destroy=function(){s.decRef()},c},clear:function(){v(l).forEach(c)},restore:function(){v(l).forEach(function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)}),e.bindRenderbuffer(36161,null)}}},ei=[];ei[6408]=4,ei[6407]=3;var en=[];function ea(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function eo(e,t){return e>>>t|e<<32-t}en[5121]=1,en[5126]=4,en[36193]=2;var es=[0x428a2f98,0x71374491,-0x4a3f0431,-0x164a245b,0x3956c25b,0x59f111f1,-0x6dc07d5c,-0x54e3a12b,-0x27f85568,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,-0x7f214e02,-0x6423f959,-0x3e640e8c,-0x1b64963f,-0x1041b87a,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,-0x67c1aeae,-0x57ce3993,-0x4ffcd838,-0x40a68039,-0x391ff40d,-0x2a586eb9,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,-0x7e3d36d2,-0x6d8dd37b,-0x5d40175f,-0x57e599b5,-0x3db47490,-0x3893ae5d,-0x2e6d17e7,-0x2966f9dc,-0xbf1ca7b,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,-0x7b3787ec,-0x7338fdf8,-0x6f410006,-0x5baf9315,-0x41065c09,-0x398e870e];function el(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function eu(e){return Array.prototype.slice.call(e)}function ec(e){return eu(e).join("")}var eh="xyzw".split(""),ed="dither",ef="blend.enable",ep="blend.color",em="blend.equation",eg="blend.func",ey="depth.enable",ev="depth.func",ex="depth.range",eb="depth.mask",e_="colorMask",ew="cull.enable",eT="cull.face",eA="frontFace",eM="lineWidth",ek="polygonOffset.enable",eS="polygonOffset.offset",eE="sample.alpha",eD="sample.enable",eC="sample.coverage",eI="stencil.enable",eL="stencil.mask",eP="stencil.func",ez="stencil.opFront",eF="stencil.opBack",eO="scissor.enable",eR="scissor.box",eB="viewport",ej="profile",eN="framebuffer",eV="vert",eU="frag",eq="elements",eG="primitive",eH="count",e$="offset",eW="instances",eY="Width",eZ="Height",eX=eN+eY,eK=eN+eZ,eJ=eB+eY,eQ=eB+eZ,e0="drawingBuffer",e1=e0+eY,e2=e0+eZ,e3=[eg,em,eP,ez,eF,eC,eB,eR,eS],e5={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},e4={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},e6={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},e8={cw:2304,ccw:2305};function e7(e){return Array.isArray(e)||g(e)||y(e)}function e9(e){return e.sort(function(e,t){return e===eB?-1:t===eB?1:e=1,i>=2,t)}if(4===r){var n=e.data;return new te(n.thisDep,n.contextDep,n.propDep,t)}if(5===r)return new te(!1,!1,!1,t);if(6!==r)return new te(3===r,2===r,1===r,t);for(var a=!1,o=!1,s=!1,l=0;l=1&&(o=!0),c>=2&&(s=!0)}else 4===u.type&&(a=a||u.data.thisDep,o=o||u.data.contextDep,s=s||u.data.propDep)}return new te(a,o,s,t)}var tn=new te(!1,!1,!1,function(){}),ta=function(e,t){if(!t.ext_disjoint_timer_query)return null;var r=[],i=[];function n(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[],o=[];function s(e,t,r){var i=a.pop()||new n;i.startQueryIndex=e,i.endQueryIndex=t,i.sum=0,i.stats=r,o.push(i)}var l=[],u=[];return{beginQuery:function(e){var n=r.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),s(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:s,update:function(){var e,n,s=i.length;if(0!==s){u.length=Math.max(u.length,s+1),l.length=Math.max(l.length,s+1),l[0]=0,u[0]=0;var c=0;for(e=0,n=0;n"u"?1:window.devicePixelRatio,f=!1,p={},m=function(e){},g=function(){};if("string"==typeof o?r=document.querySelector(o):"object"==typeof o&&("string"==typeof o.nodeName&&"function"==typeof o.appendChild&&"function"==typeof o.getBoundingClientRect?r=o:"function"==typeof o.drawArrays||"function"==typeof o.drawElements?n=(a=o).canvas:("gl"in o?a=o.gl:"canvas"in o?n=c(o.canvas):"container"in o&&(i=c(o.container)),"attributes"in o&&(s=o.attributes),"extensions"in o&&(l=u(o.extensions)),"optionalExtensions"in o&&(h=u(o.optionalExtensions)),"onDone"in o&&(m=o.onDone),"profile"in o&&(f=!!o.profile),"pixelRatio"in o&&(d=+o.pixelRatio),"cachedCode"in o&&(p=o.cachedCode))),r&&("canvas"===r.nodeName.toLowerCase()?n=r:i=r),!a){if(!n){var y=function(t,r){var i,n=document.createElement("canvas");function a(){var e=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=n.getBoundingClientRect();e=a.right-a.left,i=a.bottom-a.top}n.width=r*e,n.height=r*i}return e(n.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),t.appendChild(n),t===document.body&&(n.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver(function(){setTimeout(a)})).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:n,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(n)}}}(i||document.body,d);if(!y)return null;n=y.canvas,g=y.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),a=function(e,t){function r(r){try{return e.getContext(r,t)}catch{return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(n,s)}return a?{gl:a,canvas:n,container:i,extensions:l,optionalExtensions:h,pixelRatio:d,profile:f,cachedCode:p,onDone:m,onDestroy:g}:(g(),m("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}(t);if(!f)return null;var _=f.gl,w=_.getContextAttributes(),C=(_.isContextLost(),function(e,t){var r={};function i(t){var i,n=t.toLowerCase();try{i=r[n]=e.getExtension(n)}catch{}return!!i}for(var n=0;n0)if(Array.isArray(t[0])){o=x(t);for(var o,s,u=1,c=1;c0){if("number"==typeof e[0]){var n=p.allocType(h.dtype,e.length);S(n,e),f(n,i),p.freeType(n)}else if(Array.isArray(e[0])||g(e[0])){r=x(e);var a=b(e,r,h.dtype);f(a,i),p.freeType(a)}}}else if(y(e)){r=e.shape;var o=e.stride,s=0,l=0,u=0,c=0;1===r.length?(s=r[0],l=1,u=o[0],c=0):2===r.length&&(s=r[0],l=r[1],u=o[0],c=o[1]);var m=Array.isArray(e.data)?h.dtype:k(e.data),v=p.allocType(m,s*l);E(v,e.data,s,l,u,c,e.offset),f(v,i),p.freeType(v)}return d},r.profile&&(d.stats=h.stats),d.destroy=function(){c(h)},d},createStream:function(e,t){var r=s.pop();return r||(r=new o(e)),r.bind(),u(r,t,35040,0,1,!1),r},destroyStream:function(e){s.push(e)},clear:function(){v(a).forEach(c),s.forEach(c)},getBuffer:function(e){return e&&e._buffer instanceof o?e._buffer:null},restore:function(){v(a).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})},_initBuffer:u}}(_,R,f,function(e){return tf.destroyBuffer(e)}),td=function(e,t,r,i){var n={},a=0,o={uint8:5121,uint16:5123};function s(e){this.id=a++,n[this.id]=this,this.buffer=e,this.primType=4,this.vertCount=0,this.type=0}t.oes_element_index_uint&&(o.uint32=5125),s.prototype.bind=function(){this.buffer.bind()};var l=[];function u(i,n,a,o,s,l,u){if(i.buffer.bind(),n){var c,h=u;!u&&(!g(n)||y(n)&&!g(n.data))&&(h=t.oes_element_index_uint?5125:5123),r._initBuffer(i.buffer,n,a,h,3)}else e.bufferData(34963,l,a),i.buffer.dtype=c||5121,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=l;if(c=u,!u){switch(i.buffer.dtype){case 5121:case 5120:c=5121;break;case 5123:case 5122:c=5123;break;case 5125:case 5124:c=5125}i.buffer.dtype=c}i.type=c;var d=s;d<0&&(d=i.buffer.byteLength,5123===c?d>>=1:5125===c&&(d>>=2)),i.vertCount=d;var f=o;if(o<0){f=4;var p=i.buffer.dimension;1===p&&(f=0),2===p&&(f=1),3===p&&(f=4)}i.primType=f}function c(e){i.elementsCount--,delete n[e.id],e.buffer.destroy(),e.buffer=null}return{create:function(e,t){var n=r.create(null,34963,!0),a=new s(n._buffer);function l(e){if(e)if("number"==typeof e)n(e),a.primType=4,a.vertCount=0|e,a.type=5121;else{var t=null,r=35044,i=-1,s=-1,c=0,h=0;Array.isArray(e)||g(e)||y(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=A[e.usage]),"primitive"in e&&(i=D[e.primitive]),"count"in e&&(s=0|e.count),"type"in e&&(h=o[e.type]),"length"in e?c=0|e.length:(c=s,5123===h||5122===h?c*=2:(5125===h||5124===h)&&(c*=4))),u(a,t,r,i,s,c,h)}else n(),a.primType=4,a.vertCount=0,a.type=5121;return l}return i.elementsCount++,l(e),l._reglType="elements",l._elements=a,l.subdata=function(e,t){return n.subdata(e,t),l},l.destroy=function(){c(a)},l},createStream:function(e){var t=l.pop();return t||(t=new s(r.create(null,34963,!0,!1)._buffer)),u(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof s?e._elements:null},clear:function(){v(n).forEach(c)}}}(_,H,th,R),tf=function(e,t,r,i,n,a,o){for(var s=r.maxAttributes,l=Array(s),u=0;u=f.byteLength?c.subdata(f):(c.destroy(),t.buffers[l]=null)),t.buffers[l]||(c=t.buffers[l]=n.create(h,34962,!1,!0)),d.buffer=n.getBuffer(c),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1,o[l]=1):n.getBuffer(h)?(d.buffer=n.getBuffer(h),d.size=0|d.buffer.dimension,d.normalized=!1,d.type=d.buffer.dtype,d.offset=0,d.stride=0,d.divisor=0,d.state=1):n.getBuffer(h.buffer)?(d.buffer=n.getBuffer(h.buffer),d.size=0|(+h.size||d.buffer.dimension),d.normalized=!!h.normalized,"type"in h?d.type=T[h.type]:d.type=d.buffer.dtype,d.offset=0|(h.offset||0),d.stride=0|(h.stride||0),d.divisor=0|(h.divisor||0),d.state=1):"x"in h&&(d.x=+h.x||0,d.y=+h.y||0,d.z=+h.z||0,d.w=+h.w||0,d.state=2)}for(var p=0;p1)for(var y=0;ye&&(e=t.stats.uniformsCount)}),e},i.getMaxAttributesCount=function(){var e=0;return h.forEach(function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)}),e}),{clear:function(){var e=t.deleteShader.bind(t);v(a).forEach(e),a={},v(o).forEach(e),o={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,c={},i.shaderCount=0},program:function(r,n,s,l){var u=c[n];u||(u=c[n]={});var d=u[r];if(d&&(d.refCount++,!l))return d;var m=new f(n,r);return i.shaderCount++,p(m,s,l),d||(u[r]=m),h.push(m),e(m,{destroy:function(){if(m.refCount--,m.refCount<=0){t.deleteProgram(m.program);var e=h.indexOf(m);h.splice(e,1),i.shaderCount--}u[m.vertId].refCount<=0&&(t.deleteShader(o[m.vertId]),delete o[m.vertId],delete c[m.fragId][m.vertId]),Object.keys(c[m.fragId]).length||(t.deleteShader(a[m.fragId]),delete a[m.fragId],delete c[m.fragId])}})},restore:function(){a={},o={};for(var e=0;e=0&&(m[e]=t)});var T=Object.keys(m);i.textureFormats=T;var A=[];Object.keys(m).forEach(function(e){A[m[e]]=e});var M=[];Object.keys(f).forEach(function(e){M[f[e]]=e});var k=[];Object.keys(c).forEach(function(e){k[c[e]]=e});var S=[];Object.keys(h).forEach(function(e){S[h[e]]=e});var E=[];Object.keys(u).forEach(function(e){E[u[e]]=e});var D=T.reduce(function(e,t){var i=m[t];return 6409===i||6406===i||6409===i||6410===i||6402===i||34041===i||r.ext_srgb&&(35904===i||35906===i)?e[i]=i:32855===i||t.indexOf("rgba")>=0?e[i]=6408:e[i]=6407,e},{});function C(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function R(e,t){if(!("object"!=typeof t||!t)){"premultiplyAlpha"in t&&(e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(e.flipY=t.flipY),"alignment"in t&&(e.unpackAlignment=t.alignment),"colorSpace"in t&&(e.colorSpace=d[t.colorSpace]),"type"in t&&(e.type=f[t.type]);var r=e.width,i=e.height,n=e.channels,a=!1;"shape"in t?(r=t.shape[0],i=t.shape[1],3===t.shape.length&&(n=t.shape[2],a=!0)):("radius"in t&&(r=i=t.radius),"width"in t&&(r=t.width),"height"in t&&(i=t.height),"channels"in t&&(n=t.channels,a=!0)),e.width=0|r,e.height=0|i,e.channels=0|n;var o=!1;if("format"in t){var s=t.format,l=e.internalformat=m[s];e.format=D[l],s in f&&("type"in t||(e.type=f[s])),s in _&&(e.compressed=!0),o=!0}!a&&o?e.channels=O[e.format]:a&&!o&&e.channels!==F[e.format]&&(e.format=e.internalformat=F[e.channels])}}function G(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function H(){C.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function $(e,t){var r=null;if(X(t)?r=t:t&&(R(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),X(t.data)&&(r=t.data)),t.copy){var i=a.viewportWidth,n=a.viewportHeight;e.width=e.width||i-e.xOffset,e.height=e.height||n-e.yOffset,e.needsCopy=!0}else if(r){if(g(r))e.channels=e.channels||4,e.data=r,"type"in t||5121!==e.type||(e.type=K(r));else if(W(r))e.channels=e.channels||4,function(e,t){var r=t.length;switch(e.type){case 5121:case 5123:case 5125:case 5126:var i=p.allocType(e.type,r);i.set(t),e.data=i;break;case 36193:e.data=L(t)}}(e,r),e.alignment=1,e.needsFree=!0;else if(y(r)){var o=r.data;Array.isArray(o)||5121!==e.type||(e.type=K(o));var s,l,u,c,h,d,f=r.shape,m=r.stride;3===f.length?(u=f[2],d=m[2]):(u=1,d=1),s=f[0],l=f[1],c=m[0],h=m[1],e.alignment=1,e.width=s,e.height=l,e.channels=u,e.format=e.internalformat=F[u],e.needsFree=!0,function(e,t,r,i,n,a){for(var o=e.width,s=e.height,l=e.channels,u=J(e,o*s*l),c=0,h=0;h>=n,r.height>>=n,$(r,i[n]),e.mipmask|=1<=0)||"faces"in t||(e.genMipmaps=!0)),"mag"in t&&(e.magFilter=c[t.mag]);var r=e.wrapS,i=e.wrapT;if("wrap"in t){var n=t.wrap;"string"==typeof n?r=i=u[n]:Array.isArray(n)&&(r=u[n[0]],i=u[n[1]])}else"wrapS"in t&&(r=u[t.wrapS]),"wrapT"in t&&(i=u[t.wrapT]);if(e.wrapS=r,e.wrapT=i,"anisotropic"in t&&(t.anisotropic,e.anisotropic=t.anisotropic),"mipmap"in t){var a=!1;switch(typeof t.mipmap){case"string":e.mipmapHint=l[t.mipmap],e.genMipmaps=!0,a=!0;break;case"boolean":a=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,a=!0}!a||"min"in t||(e.minFilter=9984)}}function ep(e,i){t.texParameteri(i,10241,e.minFilter),t.texParameteri(i,10240,e.magFilter),t.texParameteri(i,10242,e.wrapS),t.texParameteri(i,10243,e.wrapT),r.ext_texture_filter_anisotropic&&t.texParameteri(i,34046,e.anisotropic),e.genMipmaps&&(t.hint(33170,e.mipmapHint),t.generateMipmap(i))}var em=0,eg={},ey=i.maxTextureUnits,ev=Array(ey).map(function(){return null});function ex(e){C.call(this),this.mipmask=0,this.internalformat=6408,this.id=em++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new ed,s.profile&&(this.stats={size:0})}function eb(e){t.activeTexture(33984),t.bindTexture(e.target,e.texture)}function e_(){var e=ev[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(3553,null)}function ew(e){var r=e.texture,i=e.unit,n=e.target;i>=0&&(t.activeTexture(33984+i),t.bindTexture(n,null),ev[i]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete eg[e.id],o.textureCount--}return e(ex.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(e<0){for(var r=0;r0)continue;i.unit=-1}ev[r]=this,e=r;break}s.profile&&o.maxTextureUnits>l)-o,u.height=u.height||(i.height>>l)-s,eb(i),et(u,3553,o,s,l),e_(),en(u),n},n.resize=function(e,r){var a=0|e,o=0|r||a;if(a===i.width&&o===i.height)return n;n.width=i.width=a,n.height=i.height=o,eb(i);for(var l=0;i.mipmask>>l;++l){var u=a>>l,c=o>>l;if(!u||!c)break;t.texImage2D(3553,l,i.format,u,c,0,i.format,i.type,null)}return e_(),s.profile&&(i.stats.size=ee(i.internalformat,i.type,a,o,!1,!1)),n},n._reglType="texture2d",n._texture=i,s.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,i,n,a,l){var u=new ex(34067);eg[u.id]=u,o.cubeCount++;var c=Array(6);function h(e,t,r,i,n,a){var o,l=u.texInfo;for(ed.call(l),o=0;o<6;++o)c[o]=ec();if("number"!=typeof e&&e){if("object"==typeof e)if(t)es(c[0],e),es(c[1],t),es(c[2],r),es(c[3],i),es(c[4],n),es(c[5],a);else if(ef(l,e),R(u,e),"faces"in e){var d=e.faces;for(o=0;o<6;++o)I(c[o],u),es(c[o],d[o])}else for(o=0;o<6;++o)es(c[o],e)}else{var f=0|e||1;for(o=0;o<6;++o)eo(c[o],f,f)}for(I(u,c[0]),l.genMipmaps?u.mipmask=(c[0].width<<1)-1:u.mipmask=c[0].mipmask,u.internalformat=c[0].internalformat,h.width=c[0].width,h.height=c[0].height,eb(u),o=0;o<6;++o)el(c[o],34069+o);for(ep(l,34067),e_(),s.profile&&(u.stats.size=ee(u.internalformat,u.type,h.width,h.height,l.genMipmaps,!0)),h.format=A[u.internalformat],h.type=M[u.type],h.mag=k[l.magFilter],h.min=S[l.minFilter],h.wrapS=E[l.wrapS],h.wrapT=E[l.wrapT],o=0;o<6;++o)eh(c[o]);return h}return h(e,r,i,n,a,l),h.subimage=function(e,t,r,i,n){var a=0|r,o=0|i,s=0|n,l=ei();return I(l,u),l.width=0,l.height=0,$(l,t),l.width=l.width||(u.width>>s)-a,l.height=l.height||(u.height>>s)-o,eb(u),et(l,34069+e,a,o,s),e_(),en(l),h},h.resize=function(e){var r=0|e;if(r!==u.width){h.width=u.width=r,h.height=u.height=r,eb(u);for(var i=0;i<6;++i)for(var n=0;u.mipmask>>n;++n)t.texImage2D(34069+i,n,u.format,r>>n,r>>n,0,u.format,u.type,null);return e_(),s.profile&&(u.stats.size=ee(u.internalformat,u.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=u,s.profile&&(h.stats=u.stats),h.destroy=function(){u.decRef()},h},clear:function(){for(var e=0;e>r,e.height>>r,0,e.internalformat,e.type,null);else for(var i=0;i<6;++i)t.texImage2D(34069+i,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);ep(e.texInfo,e.target)})},refresh:function(){for(var e=0;e=0?d=!0:u.indexOf(p)>=0&&(d=!1))),("depthTexture"in e||"depthStencilTexture"in e)&&(A=!!(e.depthTexture||e.depthStencilTexture)),"depth"in e&&("boolean"==typeof e.depth?s=e.depth:(b=e.depth,c=!1)),"stencil"in e&&("boolean"==typeof e.stencil?c=e.stencil:(_=e.stencil,s=!1)),"depthStencil"in e&&("boolean"==typeof e.depthStencil?s=c=e.depthStencil:(w=e.depthStencil,s=!1,c=!1))}else a=o=1;var S=null,E=null,D=null,C=null;if(Array.isArray(h))S=h.map(m);else if(h)S=[m(h)];else for(S=Array(x),r=0;r0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[o]?r[o](s):r[o]=k(s)}return e(i,{width:l,height:l,color:a})}return i(t),e(i,{faces:r,resize:function(e){var t,n=0|e;if(n===i.width)return i;var a=i.color;for(t=0;t0&&(t.push(e,"="),t.push.apply(t,eu(arguments)),t.push(";")),e},toString:function(){return ec([r.length>0?"var "+r.join(",")+";":"",ec(t)])}})}function l(){var t=s(),r=s(),i=t.toString,n=r.toString;function a(e,i){r(e,i,"=",t.def(e,i),";")}return e(function(){t.apply(t,eu(arguments))},{def:t.def,entry:t,exit:r,save:a,set:function(e,r,i){a(e,r),t(e,r,"=",i,";")},toString:function(){return i()+n()}})}var u=s(),c={};return{global:u,link:function(e,t){var r=t&&t.stable;if(!r){for(var s=0;s>>4&15)+r.charAt(15&t);return i}(function(e){for(var t=function(e,t){var r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w=[0x6a09e667,-0x4498517b,0x3c6ef372,-0x5ab00ac6,0x510e527f,-0x64fa9774,0x1f83d9ab,0x5be0cd19],T=Array(64);for(e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t,v=0;v>>10,T[x-7]),eo(i=T[x-15],7)^eo(i,18)^i>>>3),T[x-16]),b=el(el(el(el(y,eo(n=p,6)^eo(n,11)^eo(n,25)),(a=p)&m^~a&g),es[x]),T[x]),_=el(eo(o=c,2)^eo(o,13)^eo(o,22),(s=c)&(l=h)^s&(u=d)^l&u),y=g,g=m,m=p,p=el(f,b),f=d,d=h,h=c,c=el(b,_)}w[0]=el(c,w[0]),w[1]=el(h,w[1]),w[2]=el(d,w[2]),w[3]=el(f,w[3]),w[4]=el(p,w[4]),w[5]=el(m,w[5]),w[6]=el(g,w[6]),w[7]=el(y,w[7])}return w}(function(e){for(var t=Array(e.length>>2),r=0;r>5]|=(255&e.charCodeAt(r/8))<<24-r%32;return t}(e),8*e.length),r="",i=0;i<32*t.length;i+=8)r+=String.fromCharCode(t[i>>5]>>>24-i%32&255);return r}(function(e){for(var t,r,i="",n=-1;++n>>6&31,128|63&t):t<=65535?i+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(i+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return i}(i)))])return r[t].apply(null,a);var o=Function.apply(null,n.concat(i));return r&&(r[t]=o),o.apply(null,a)}}}({cache:v}),r=t.link,n=t.global;t.id=J++,t.batchId="0";var a=r(X),o=t.shared={props:"a0"};Object.keys(X).forEach(function(e){o[e]=n.def(a,".",e)});var s=t.next={},l=t.current={};Object.keys(H).forEach(function(e){Array.isArray(V[e])&&(s[e]=n.def(o.next,".",e),l[e]=n.def(o.current,".",e))});var u=t.constants={};Object.keys(K).forEach(function(e){u[e]=n.def(JSON.stringify(K[e]))}),t.invoke=function(e,i){switch(i.type){case 0:var n=["this",o.context,o.props,t.batchId];return e.def(r(i.data),".call(",n.slice(0,Math.max(i.data.length+1,4)),")");case 1:return e.def(o.props,i.data);case 2:return e.def(o.context,i.data);case 3:return e.def("this",i.data);case 4:return i.data.append(t,e),i.data.ref;case 5:return i.data.toString();case 6:return i.data.map(function(r){return t.invoke(e,r)})}},t.attribCache={};var c={};return t.scopeAttrib=function(e){var t=i.id(e);if(t in c)return c[t];var n=f.scope[t];return n||(n=f.scope[t]=new O),c[t]=r(n)},t}function ee(e,t,r){var i=e.shared.context,n=e.scope();Object.keys(r).forEach(function(a){t.save(i,"."+a);var o=r[a].append(e,t);Array.isArray(o)?n(i,".",a,"=[",o.join(),"];"):n(i,".",a,"=",o,";")}),t(n)}function et(e,t,r,i){var n,a=e.shared,o=a.gl,s=a.framebuffer;j&&(n=t.def(a.extensions,".webgl_draw_buffers"));var l,u=e.constants,c=u.drawBuffer,h=u.backBuffer;l=r?r.append(e,t):t.def(s,".next"),i||t("if(",l,"!==",s,".cur){"),t("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),j&&t(n,".drawBuffersWEBGL(",c,"[",l,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",36160,",null);"),j&&t(n,".drawBuffersWEBGL(",h,");"),t("}",s,".cur=",l,";"),i||t("}")}function er(e,t,r){var i=e.shared,n=i.gl,a=e.current,o=e.next,s=i.current,l=i.next,u=e.cond(s,".dirty");q.forEach(function(t){var i,c,d=$(t);if(!(d in r.state))if(d in o){i=o[d],c=a[d];var f=h(V[d].length,function(e){return u.def(i,"[",e,"]")});u(e.cond(f.map(function(e,t){return e+"!=="+c+"["+t+"]"}).join("||")).then(n,".",H[d],"(",f,");",f.map(function(e,t){return c+"["+t+"]="+e}).join(";"),";"))}else{i=u.def(l,".",d);var p=e.cond(i,"!==",s,".",d);u(p),d in G?p(e.cond(i).then(n,".enable(",G[d],");").else(n,".disable(",G[d],");"),s,".",d,"=",i,";"):p(n,".",H[d],"(",i,");",s,".",d,"=",i,";")}}),0===Object.keys(r.state).length&&u(s,".dirty=false;"),t(u)}function ei(e,t,r,i){var n,a=e.shared,o=e.current,s=a.current,l=a.gl;e9(Object.keys(r)).forEach(function(a){var u=r[a];if(!(i&&!i(u))){var c=u.append(e,t);if(G[a]){var h=G[a];tt(u)?(n=e.link(c,{stable:!0}),t(e.cond(n).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",n,";")):(t(e.cond(c).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",c,";"))}else if(P(c)){var d=o[a];t(l,".",H[a],"(",c,");",c.map(function(e,t){return d+"["+t+"]="+e}).join(";"),";")}else tt(u)?(n=e.link(c,{stable:!0}),t(l,".",H[a],"(",n,");",s,".",a,"=",n,";")):t(l,".",H[a],"(",c,");",s,".",a,"=",c,";")}})}function en(e,t){B&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function ea(e,t,r,i,n){var a,o,s,l=e.shared,u=e.stats,c=l.current,h=l.timer,d=r.profile;function f(){return typeof performance>"u"?"Date.now()":"performance.now()"}function p(e){e(a=t.def(),"=",f(),";"),"string"==typeof n?e(u,".count+=",n,";"):e(u,".count++;"),y&&(i?e(o=t.def(),"=",h,".getNumPendingQueries();"):e(h,".beginQuery(",u,");"))}function m(e){e(u,".cpuTime+=",f(),"-",a,";"),y&&(i?e(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",u,");"):e(h,".endQuery();"))}function g(e){var r=t.def(c,".profile");t(c,".profile=",e,";"),t.exit(c,".profile=",r,";")}if(d){if(tt(d))return void(d.enable?(p(t),m(t.exit),g("true")):g("false"));g(s=d.append(e,t))}else s=t.def(c,".profile");var v=e.block();p(v),t("if(",s,"){",v,"}");var x=e.block();m(x),t.exit("if(",s,"){",x,"}")}function eY(e,t,r,i,n){var a=e.shared;i.forEach(function(i){var o,s=i.name,l=r.attributes[s];if(l){if(!n(l))return;o=l.append(e,t)}else{if(!n(tn))return;var u=e.scopeAttrib(s);o={},Object.keys(new O).forEach(function(e){o[e]=t.def(u,".",e)})}!function(r,i,n){var o=a.gl,s=t.def(r,".location"),l=t.def(a.attributes,"[",s,"]"),u=n.state,c=n.buffer,h=[n.x,n.y,n.z,n.w],d=["buffer","normalized","offset","stride"];function f(){t("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=n.type;if(r=n.size?t.def(n.size,"||",i):i,t("if(",l,".type!==",a,"||",l,".size!==",r,"||",d.map(function(e){return l+"."+e+"!=="+n[e]}).join("||"),"){",o,".bindBuffer(",34962,",",c,".buffer);",o,".vertexAttribPointer(",[s,r,a,n.normalized,n.stride,n.offset],");",l,".type=",a,";",l,".size=",r,";",d.map(function(e){return l+"."+e+"="+n[e]+";"}).join(""),"}"),B){var u=n.divisor;t("if(",l,".divisor!==",u,"){",e.instancing,".vertexAttribDivisorANGLE(",[s,u],");",l,".divisor=",u,";}")}}function p(){t("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",eh.map(function(e,t){return l+"."+e+"!=="+h[t]}).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",eh.map(function(e,t){return l+"."+e+"="+h[t]+";"}).join(""),"}")}1===u?f():2===u?p():(t("if(",u,"===",1,"){"),f(),t("}else{"),p(),t("}"))}(e.link(i),function(e){switch(e){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(i.info.type),o)})}function eZ(e,t,r,n,a,o){for(var s,l=e.shared,u=l.gl,c=0;c1){for(var k=[],S=[],E=0;E>1)",c],");")}function t(){r(h,".drawArraysInstancedANGLE(",[v,x,b,c],");")}g&&"null"!==g?w?e():(r("if(",g,"){"),e(),r("}else{"),t(),r("}")):t()}function A(){function e(){r(f+".drawElements("+[v,b,_,x+"<<(("+_+"-5121)>>1)"]+");")}function t(){r(f+".drawArrays("+[v,x,b]+");")}g&&"null"!==g?w?e():(r("if(",g,"){"),e(),r("}else{"),t(),r("}")):t()}B&&("number"!=typeof c||c>=0)?"string"==typeof c?(r("if(",c,">0){"),T(),r("}else if(",c,"<0){"),A(),r("}")):T():A()}function ta(e,t,r,i,n){var a=Q(),o=a.proc("body",n);return B&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),e(a,o,r,i),a.compile().body}function to(e,t,r,i){en(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),eY(e,t,r,i.attributes,function(){return!0})),eZ(e,t,r,i.uniforms,function(){return!0},!1),e0(e,t,t,r)}function ts(e,t,r,i){function n(){return!0}e.batchId="a1",en(e,t),eY(e,t,r,i.attributes,n),eZ(e,t,r,i.uniforms,n,!1),e0(e,t,t,r)}function tl(e,t,r,i){en(e,t);var n=r.contextDep,a=t.def(),o=t.def();e.shared.props=o,e.batchId=a;var s=e.scope(),l=e.scope();function u(e){return e.contextDep&&n||e.propDep}function c(e){return!u(e)}if(t(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&ee(e,l,r.context),r.needsFramebuffer&&et(e,l,r.framebuffer),ei(e,l,r.state,u),r.profile&&u(r.profile)&&ea(e,l,r,!1,!0),i)r.useVAO?r.drawVAO?u(r.drawVAO)?l(e.shared.vao,".setVAO(",r.drawVAO.append(e,l),");"):s(e.shared.vao,".setVAO(",r.drawVAO.append(e,s),");"):s(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(s(e.shared.vao,".setVAO(null);"),eY(e,s,r,i.attributes,c),eY(e,l,r,i.attributes,u)),eZ(e,s,r,i.uniforms,c,!1),eZ(e,l,r,i.uniforms,u,!0),e0(e,s,l,r);else{var h=e.global.def("{}"),d=r.shader.progVar.append(e,l),f=l.def(d,".id"),p=l.def(h,"[",f,"]");l(e.shared.gl,".useProgram(",d,".program);","if(!",p,"){",p,"=",h,"[",f,"]=",e.link(function(t){return ta(ts,e,r,t,2)}),"(",d,");}",p,".call(this,a0[",a,"],",a,");")}}function tu(e,t,i){var n=t.static[i];if(n&&function(e){if(!("object"!=typeof e||P(e))){for(var t=Object.keys(e),r=0;r0)return null;var i=t.static,n=Object.keys(i);if(n.length>0&&"number"==typeof i[n[0]]){for(var a=[],o=0;o0,F={framebuffer:k,draw:E,shader:I,state:C,dirty:z,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(F.profile=function(e){var t,r=e.static,i=e.dynamic;if(ej in r){var n=!!r[ej];(t=tr(function(e,t){return n})).enable=n}else if(ej in i){var a=i[ej];t=ti(a,function(e,t){return e.invoke(t,a)})}return t}(e),m=r.static,g=r.dynamic,y={},Object.keys(m).forEach(function(e){var t,r=m[e];if("number"==typeof r||"boolean"==typeof r)t=tr(function(){return r});else if("function"==typeof r){var i=r._reglType;"texture2d"===i||"textureCube"===i?t=tr(function(e){return e.link(r)}):("framebuffer"===i||"framebufferCube"===i)&&(t=tr(function(e){return e.link(r.color[0])}))}else P(r)&&(t=tr(function(e){return e.global.def("[",h(r.length,function(e){return r[e]}),"]")}));t.value=r,y[e]=t}),Object.keys(g).forEach(function(e){var t=g[e];y[e]=ti(t,function(e,r){return e.invoke(r,t)})}),F.uniforms=y,F.drawVAO=F.scopeVAO=E.vao,!F.drawVAO&&I.program&&!M&&n.angle_instanced_arrays&&E.static.elements){var B=!0,j=I.program.attributes.map(function(e){var r=t.static[e];return B=B&&!!r,r});if(B&&j.length>0){var N=f.getVAO(f.createVAO({attributes:j,elements:E.static.elements}));F.drawVAO=new te(null,null,null,function(e,t){return e.link(N)}),F.useVAO=!0}}return M?F.useVAO=!0:(v=t.static,x=t.dynamic,b={},Object.keys(v).forEach(function(e){var t=v[e],r=i.id(e),n=new O;if(e7(t))n.state=1,n.buffer=l.getBuffer(l.create(t,34962,!1,!0)),n.type=0;else{var a=l.getBuffer(t);if(a)n.state=1,n.buffer=a,n.type=0;else if("constant"in t){var o=t.constant;n.buffer="null",n.state=2,"number"==typeof o?n.x=o:eh.forEach(function(e,t){t"+t+"?"+i+".constant["+t+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",c,"=",s,".createStream(",34962,",",i,".buffer);","}else{",c,"=",s,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",c,".dtype;",l.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",c,");","}"),l})}),F.attributes=b),_=a.static,w=a.dynamic,A={},Object.keys(_).forEach(function(e){var t=_[e];A[e]=tr(function(e,r){return"number"==typeof t||"boolean"==typeof t?""+t:e.link(t)})}),Object.keys(w).forEach(function(e){var t=w[e];A[e]=ti(t,function(e,r){return e.invoke(r,t)})}),F.context=A,F}(t,r,a,o);return m.shader.program&&(m.shader.program.attributes.sort(function(e,t){return e.name0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(d,m),function(e,t){var r=e.proc("scope",3);e.batchId="a2";var n=e.shared,a=n.current;if(ee(e,r,t.context),t.framebuffer&&t.framebuffer.append(e,r),e9(Object.keys(t.state)).forEach(function(i){var a=t.state[i],o=a.append(e,r);P(o)?o.forEach(function(t,n){Z(t)?r.set(e.next[i],"["+n+"]",t):r.set(e.next[i],"["+n+"]",e.link(t,{stable:!0}))}):tt(a)?r.set(n.next,"."+i,e.link(o,{stable:!0})):r.set(n.next,"."+i,o)}),ea(e,r,t,!0,!0),[eq,e$,eH,eW,eG].forEach(function(i){var a=t.draw[i];if(a){var o=a.append(e,r);Z(o)?r.set(n.draw,"."+i,o):r.set(n.draw,"."+i,e.link(o),{stable:!0})}}),Object.keys(t.uniforms).forEach(function(a){var o=t.uniforms[a].append(e,r);Array.isArray(o)&&(o="["+o.map(function(t){return Z(t)?t:e.link(t,{stable:!0})})+"]"),r.set(n.uniforms,"["+e.link(i.id(a),{stable:!0})+"]",o)}),Object.keys(t.attributes).forEach(function(i){var n=t.attributes[i].append(e,r),a=e.scopeAttrib(i);Object.keys(new O).forEach(function(e){r.set(a,"."+e,n[e])})}),t.scopeVAO){var o=t.scopeVAO.append(e,r);Z(o)?r.set(n.vao,".targetVAO",o):r.set(n.vao,".targetVAO",e.link(o,{stable:!0}))}function s(i){var a=t.shader[i];if(a){var o=a.append(e,r);Z(o)?r.set(n.shader,"."+i,o):r.set(n.shader,"."+i,e.link(o,{stable:!0}))}}s(eV),s(eU),Object.keys(t.state).length>0&&(r(a,".dirty=true;"),r.exit(a,".dirty=true;")),r("a1(",e.shared.context,",a0,",e.batchId,");")}(d,m),function(e,t){var r=e.proc("batch",2);e.batchId="0",en(e,r);var i=!1,n=!0;Object.keys(t.context).forEach(function(e){i=i||t.context[e].propDep}),i||(ee(e,r,t.context),n=!1);var a=t.framebuffer,o=!1;function s(e){return e.contextDep&&i||e.propDep}a?(a.propDep?i=o=!0:a.contextDep&&i&&(o=!0),o||et(e,r,a)):et(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(i=!0),er(e,r,t),ei(e,r,t.state,function(e){return!s(e)}),t.profile&&s(t.profile)||ea(e,r,t,!1,"a1"),t.contextDep=i,t.needsContext=n,t.needsFramebuffer=o;var l=t.shader.progVar;if(l.contextDep&&i||l.propDep)tl(e,r,t,null);else{var u=l.append(e,r);if(r(e.shared.gl,".useProgram(",u,".program);"),t.shader.program)tl(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var c=e.global.def("{}"),h=r.def(u,".id"),d=r.def(c,"[",h,"]");r(e.cond(d).then(d,".call(this,a0,a1);").else(d,"=",c,"[",h,"]=",e.link(function(r){return ta(tl,e,t,r,2)}),"(",u,");",d,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(d,m),e(d.compile(),{destroy:function(){m.shader.program.destroy()}})}}}(_,I,H,tc,th,td,ty,{},tf,tp,tu,e0,$,G,f),tx=function(e,t,r,i){function n(n){var a=null===t.next?5121:t.next.colorAttachments[0].texture._texture.type,o=0,s=0,l=i.framebufferWidth,u=i.framebufferHeight,c=null;g(n)?c=n:n&&(o=0|n.x,s=0|n.y,l=0|(n.width||i.framebufferWidth-o),u=0|(n.height||i.framebufferHeight-s),c=n.data||null),r();var h=l*u*4;return c||(5121===a?c=new Uint8Array(h):5126===a&&(c=c||new Float32Array(h))),e.pixelStorei(3333,4),e.readPixels(o,s,l,u,6408,a,c),c}return function(e){var r;return e&&"framebuffer"in e?(t.setFBO({framebuffer:e.framebuffer},function(){r=n(e)}),r):n(e)}}(_,ty,tv.procs.poll,e0),tb=tv.next,t_=_.canvas,tw=[],tT=[],tA=[],tM=[f.onDestroy],tk=null;function tS(){if(0===tw.length){$&&$.update(),tk=null;return}tk=s.next(tS),tR();for(var e=tw.length-1;e>=0;--e){var t=tw[e];t&&t(e0,null,0)}_.flush(),$&&$.update()}function tE(){!tk&&tw.length>0&&(tk=s.next(tS))}function tD(){tk&&(s.cancel(tS),tk=null)}function tC(e){e.preventDefault(),tD(),tT.forEach(function(e){e()})}function tI(e){_.getError(),C.restore(),tp.restore(),th.restore(),tm.restore(),tg.restore(),ty.restore(),tf.restore(),$&&$.restore(),tv.procs.refresh(),tE(),tA.forEach(function(e){e()})}function tL(t){function r(e,t){var r={},i={};return Object.keys(e).forEach(function(n){var s=e[n];if(a(s)){i[n]=o(s,n);return}if(t&&Array.isArray(s)){for(var l=0;l0)return d.call(this,function(e){for(;p.length=0},read:tx,destroy:function(){tw.length=0,tD(),t_&&(t_.removeEventListener(to,tC),t_.removeEventListener(ts,tI)),tp.clear(),ty.clear(),tg.clear(),tf.clear(),tm.clear(),td.clear(),th.clear(),$&&$.clear(),tM.forEach(function(e){e()})},_gl:_,_refresh:tB,poll:function(){tR(),$&&$.update()},now:tj,stats:R,getCachedCode:function(){return G},preloadCachedCode:function(e){Object.entries(e).forEach(function(e){G[e[0]]=e[1]})}});return f.onDone(null,tN),tN}},"object"==typeof e&&"u">typeof t?t.exports=r():e.createREGL=r()}}),yi=m({"node_modules/gl-util/context.js"(e,t){var r=p8();function i(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*window.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*window.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function n(e){return"function"==typeof e.getContext&&"width"in e&&"height"in e}function a(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}t.exports=function(e){if(e?"string"==typeof e&&(e={container:e}):e={},(e=n(e)||"string"==typeof(t=e).nodeName&&"function"==typeof t.appendChild&&"function"==typeof t.getBoundingClientRect?{container:e}:"function"==typeof(o=e).drawArrays||"function"==typeof o.drawElements?{gl:e}:r(e,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(e.pixelRatio=window.pixelRatio||1),e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"==typeof e.container){var t,o,s=document.querySelector(e.container);if(!s)throw Error("Element "+e.container+" is not found");e.container=s}n(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=a(),e.container.appendChild(e.canvas),i(e))}else if(!e.canvas)if("u">typeof document)e.container=document.body||document.documentElement,e.canvas=a(),e.container.appendChild(e.canvas),i(e);else throw Error("Not DOM environment. Use headless-gl.");return e.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(t){try{e.gl=e.canvas.getContext(t,e.attrs)}catch{}return e.gl}),e.gl}}}),yn=m({"node_modules/font-atlas/index.js"(e,t){var r=ye(),i=[32,126];t.exports=function(e){var t=(e=e||{}).shape?e.shape:e.canvas?[e.canvas.width,e.canvas.height]:[512,512],n=e.canvas||document.createElement("canvas"),a=e.font,o="number"==typeof e.step?[e.step,e.step]:e.step||[32,32],s=e.chars||i;if(a&&"string"!=typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],u=s[0],c=0;u<=s[1];u++)l[c++]=String.fromCharCode(u);s=l}}else s=String(s).split("");n.width=(t=t.slice())[0],n.height=t[1];var h=n.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,n.width,n.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";for(var d=o[0]/2,f=o[1]/2,u=0;ut[0]-o[0]/2&&(d=o[0]/2,f+=o[1]);return n}}}),ya=m({"node_modules/bit-twiddle/twiddle.js"(e){function t(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),0xff00ff&e&&(t-=8),0xf0f0f0f&e&&(t-=4),0x33333333&e&&(t-=2),0x55555555&e&&(t-=1),t}e.INT_BITS=32,e.INT_MAX=0x7fffffff,e.INT_MIN=-0x80000000,e.sign=function(e){return(e>0)-(e<0)},e.abs=function(e){var t=e>>31;return(e^t)-t},e.min=function(e,t){return t^(e^t)&-(e65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,(t|=r)|e>>1},e.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:+(e>=10)},e.popCount=function(e){return e-=e>>>1&0x55555555,((e=(0x33333333&e)+(e>>>2&0x33333333))+(e>>>4)&0xf0f0f0f)*0x1010101>>>24},e.countTrailingZeros=t,e.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},e.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},e.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var r=Array(256);(function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|r[e>>>16&255]<<8|r[e>>>24&255]},e.interleave2=function(e,t){return e&=65535,t&=65535,(e=((e=((e=((e=(e|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=(t|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1},e.deinterleave2=function(e,t){return(e=((e=((e=((e=((e=e>>>t&0x55555555)|e>>>1)&0x33333333)|e>>>2)&0xf0f0f0f)|e>>>4)&0xff00ff)|e>>>16)&65535)<<16>>16},e.interleave3=function(e,t,r){return e&=1023,t&=1023,r&=1023,r=((r=((r=((r=(r|r<<16)&0xff0000ff)|r<<8)&0xf00f00f)|r<<4)&0xc30c30c3)|r<<2)&0x49249249,(e=((e=((e=((e=(e|e<<16)&0xff0000ff)|e<<8)&0xf00f00f)|e<<4)&0xc30c30c3)|e<<2)&0x49249249|(t=((t=((t=((t=(t|t<<16)&0xff0000ff)|t<<8)&0xf00f00f)|t<<4)&0xc30c30c3)|t<<2)&0x49249249)<<1)|r<<2},e.deinterleave3=function(e,t){return(e=((e=((e=((e=((e=e>>>t&0x49249249)|e>>>2)&0xc30c30c3)|e>>>4)&0xf00f00f)|e>>>8)&0xff0000ff)|e>>>16)&1023)<<22>>22},e.nextCombination=function(e){var r=e|e-1;return r+1|(~r&-~r)-1>>>t(e)+1}}}),yo=m({"node_modules/dup/dup.js"(e,t){t.exports=function(e,t){switch(typeof t>"u"&&(t=0),typeof e){case"number":if(e>0){var r,i,n=0|e,a=t;for(r=Array(n),i=0;itypeof Uint8ClampedArray,a="u">typeof BigUint64Array,o="u">typeof BigInt64Array,s=window.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=r([32,0])),s.BIGUINT64||(s.BIGUINT64=r([32,0])),s.BIGINT64||(s.BIGINT64=r([32,0])),s.BUFFER||(s.BUFFER=r([32,0]));var l=s.DATA,u=s.BUFFER;function c(e){if(e){var r=e.length||e.byteLength;l[t.log2(r)].push(e)}}function h(e){var e=t.nextPow2(e),r=l[t.log2(e)];return r.length>0?r.pop():new ArrayBuffer(e)}function d(e){return new Uint8Array(h(e),0,e)}function f(e){return new Uint16Array(h(2*e),0,e)}function p(e){return new Uint32Array(h(4*e),0,e)}function m(e){return new Int8Array(h(e),0,e)}function g(e){return new Int16Array(h(2*e),0,e)}function y(e){return new Int32Array(h(4*e),0,e)}function v(e){return new Float32Array(h(4*e),0,e)}function x(e){return new Float64Array(h(8*e),0,e)}function b(e){return n?new Uint8ClampedArray(h(e),0,e):d(e)}function _(e){return a?new BigUint64Array(h(8*e),0,e):null}function w(e){return o?new BigInt64Array(h(8*e),0,e):null}function T(e){return new DataView(h(e),0,e)}function A(e){e=t.nextPow2(e);var r=u[t.log2(e)];return r.length>0?r.pop():new i(e)}e.free=function(e){if(i.isBuffer(e))u[t.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var r=e.length||e.byteLength;l[0|t.log2(r)].push(e)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(e){c(e.buffer)},e.freeArrayBuffer=c,e.freeBuffer=function(e){u[t.log2(e.length)].push(e)},e.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return h(e);switch(t){case"uint8":return d(e);case"uint16":return f(e);case"uint32":return p(e);case"int8":return m(e);case"int16":return g(e);case"int32":return y(e);case"float":case"float32":return v(e);case"double":case"float64":return x(e);case"uint8_clamped":return b(e);case"bigint64":return w(e);case"biguint64":return _(e);case"buffer":return A(e);case"data":case"dataview":return T(e);default:return null}},e.mallocArrayBuffer=h,e.mallocUint8=d,e.mallocUint16=f,e.mallocUint32=p,e.mallocInt8=m,e.mallocInt16=g,e.mallocInt32=y,e.mallocFloat32=e.mallocFloat=v,e.mallocFloat64=e.mallocDouble=x,e.mallocUint8Clamped=b,e.mallocBigUint64=_,e.mallocBigInt64=w,e.mallocDataView=T,e.mallocBuffer=A,e.clearCache=function(){for(var e=0;e<32;++e)s.UINT8[e].length=0,s.UINT16[e].length=0,s.UINT32[e].length=0,s.INT8[e].length=0,s.INT16[e].length=0,s.INT32[e].length=0,s.FLOAT[e].length=0,s.DOUBLE[e].length=0,s.BIGUINT64[e].length=0,s.BIGINT64[e].length=0,s.UINT8C[e].length=0,l[e].length=0,u[e].length=0}}}),yl=m({"node_modules/is-plain-obj/index.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}}}),yu=m({"node_modules/parse-unit/index.js"(e,t){t.exports=function(e,t){t||(t=[0,""]);var r=parseFloat(e=String(e),10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}}}),yc=m({"node_modules/gl-text/node_modules/to-px/topx.js"(e,t){var r=yu();function i(e,t){var i=r(getComputedStyle(e).getPropertyValue(t));return i[0]*n(i[1],e)}function n(e,t){switch(t=t||document.body,e=(e||"px").trim().toLowerCase(),(t===window||t===document)&&(t=document.body),e){case"%":return t.clientHeight/100;case"ch":case"ex":var r,n,a,o;return r=e,n=t,(a=document.createElement("div")).style["font-size"]="128"+r,n.appendChild(a),o=i(a,"font-size")/128,n.removeChild(a),o;case"em":return i(t,"font-size");case"rem":return i(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}t.exports=n}}),yh=m({"node_modules/detect-kerning/index.js"(e,t){t.exports=n;var r=(n.canvas=document.createElement("canvas")).getContext("2d"),i=a([32,126]);function n(e,t){Array.isArray(e)&&(e=e.join(", "));var n,o={},s=16,l=.05;t&&(2===t.length&&"number"==typeof t[0]?n=a(t):Array.isArray(t)?n=t:(t.o?n=a(t.o):t.pairs&&(n=t.pairs),t.fontSize&&(s=t.fontSize),null!=t.threshold&&(l=t.threshold))),n||(n=i),r.font=s+"px "+e;for(var u=0;us*l){var f=(d-h)/s;o[c]=1e3*f}}return o}function a(e){for(var t=[],r=e[0];r<=e[1];r++)for(var i=String.fromCharCode(r),n=e[0];n0;i-=4)if(0!==r[i])return Math.floor((i-3)*.25/t)}t.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}}),yf=m({"node_modules/gl-text/dist.js"(e,t){var r=yt(),i=p8(),n=yr(),a=yi(),o=gZ(),s=mI(),l=yn(),u=ys(),c=p7(),h=yl(),d=yu(),f=yc(),p=yh(),m=mR(),g=yd(),y=mr(),v=ya().nextPow2,x=new o,b=!1;document.body&&((_=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(_).fontStretch&&(b=!0),document.body.removeChild(_));var _,w=function(e){var t;"function"==typeof(t=e)&&t._gl&&t.prop&&t.texture&&t.buffer?(e={regl:e},this.gl=e.regl._gl):this.gl=a(e),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||n({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(h(e)?e:{})};w.prototype.createShader=function(){var e=this.regl,t=e({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:e.prop("count"),offset:e.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:e.this("sizeBuffer")},width:{offset:0,stride:8,buffer:e.this("sizeBuffer")},char:e.this("charBuffer"),position:e.this("position")},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop("color"),opacity:e.prop("opacity"),viewport:e.this("viewportArray"),scale:e.this("scale"),align:e.prop("align"),baseline:e.prop("baseline"),translate:e.this("translate"),positionOffset:e.prop("positionOffset")},primitive:"points",viewport:e.this("viewport"),vert:` + precision highp float; + attribute float width, charOffset, char; + attribute vec2 position; + uniform float fontSize, charStep, em, align, baseline; + uniform vec4 viewport; + uniform vec4 color; + uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; + varying vec2 charCoord, charId; + varying float charWidth; + varying vec4 fontColor; + void main () { + vec2 offset = floor(em * (vec2(align + charOffset, baseline) + + vec2(positionOffset.x, -positionOffset.y))) + / (viewport.zw * scale.xy); + + vec2 position = (position + translate) * scale; + position += offset * scale; + + charCoord = position * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2. - 1., 0, 1); + + gl_PointSize = charStep; + + charId.x = mod(char, atlasDim.x); + charId.y = floor(char / atlasDim.x); + + charWidth = width * em; + + fontColor = color / 255.; + }`,frag:` + precision highp float; + uniform float fontSize, charStep, opacity; + uniform vec2 atlasSize; + uniform vec4 viewport; + uniform sampler2D atlas; + varying vec4 fontColor; + varying vec2 charCoord, charId; + varying float charWidth; + + float lightness(vec4 color) { + return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; + } + + void main () { + vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; + float halfCharStep = floor(charStep * .5 + .5); + + // invert y and shift by 1px (FF expecially needs that) + uv.y = charStep - uv.y; + + // ignore points outside of character bounding box + float halfCharWidth = ceil(charWidth * .5); + if (floor(uv.x) > halfCharStep + halfCharWidth || + floor(uv.x) < halfCharStep - halfCharWidth) return; + + uv += charId * charStep; + uv = uv / atlasSize; + + vec4 color = fontColor; + vec4 mask = texture2D(atlas, uv); + + float maskY = lightness(mask); + // float colorY = lightness(color); + color.a *= maskY; + color.a *= opacity; + + // color.a += .1; + + // antialiasing, see yiq color space y-channel formula + // color.rgb += (1. - color.rgb) * (1. - mask.rgb); + + gl_FragColor = color; + }`});return{regl:e,draw:t,atlas:{}}},w.prototype.update=function(e){var t,n,a=this;if("string"==typeof e)e={text:e};else if(!e)return;null!=(e=i(e,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map(function(e){return parseFloat(e)}):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=c(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"==typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=y(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||e.font||(e.font=w.baseFontSize+"px sans-serif");var o=!1,h=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach(function(e,t){if("string"==typeof e)try{e=r.parse(e)}catch{e=r.parse(w.baseFontSize+"px "+e)}else{var i=e.style,n=e.weight,s=e.stretch,l=e.variant;e=r.parse(r.stringify(e)),i&&(e.style=i),n&&(e.weight=n),s&&(e.stretch=s),l&&(e.variant=l)}var u=r.stringify({size:w.baseFontSize,family:e.family,stretch:b?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),c=d(e.size),p=Math.round(c[0]*f(c[1]));if(p!==a.fontSize[t]&&(h=!0,a.fontSize[t]=p),(!a.font[t]||u!=a.font[t].baseString)&&(o=!0,a.font[t]=w.fonts[u],!a.font[t])){var m=e.family.join(", "),y=[e.style];e.style!=e.variant&&y.push(e.variant),e.variant!=e.weight&&y.push(e.weight),b&&e.weight!=e.stretch&&y.push(e.stretch),a.font[t]={baseString:u,family:m,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:g(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:y.join(" ")})},w.fonts[u]=a.font[t]}}),(o||h)&&this.font.forEach(function(t,i){var n=r.stringify({size:a.fontSize[i],family:t.family,stretch:b?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style});if(a.fontAtlas[i]=a.shader.atlas[n],!a.fontAtlas[i]){var o=t.metrics;a.shader.atlas[n]=a.fontAtlas[i]={fontString:n,step:2*Math.ceil(a.fontSize[i]*o.bottom*.5),em:a.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:a.regl.texture()}}null==e.text&&(e.text=a.text)}),"string"==typeof e.text&&e.position&&e.position.length>2){for(var x=Array(.5*e.position.length),_=0;_2){for(var A=!e.position[0].length,M=u.mallocFloat(2*this.count),k=0,S=0;k1?a.align[t]:a.align[0]:a.align;if("number"==typeof r)return r;switch(r){case"right":case"end":return-e;case"center":case"centre":case"middle":return-(.5*e)}return 0})),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(e,t){var r,i=(a.font[t]||a.font[0]).metrics;return r=0+.5*i.bottom,"number"==typeof e?r+=e-i.baseline:r+=-i[e],r*=-1})),null!=e.color)if(e.color||(e.color="transparent"),"string"!=typeof e.color&&isNaN(e.color)){if("number"==typeof e.color[0]&&e.color.length>this.counts.length){var H=e.color.length;n=u.mallocUint8(H);for(var $=(e.color.subarray||e.color.slice).bind(e.color),W=0;W4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var X=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(X);for(var K=0;K1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},t.exports=w}}),yp=m({"src/lib/prepare_regl.js"(e,t){var r=fA(),i=yr();t.exports=function(e,t,n){var a=e._fullLayout,o=!0;return a._glcanvas.each(function(r){if(r.regl)return void r.regl.preloadCachedCode(n);if(!(r.pick&&!a._has("parcoords"))){try{r.regl=i({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||window.devicePixelRatio,extensions:t||[],cachedCode:n||{}})}catch{o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(t){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:t,layer:r.key})},!1)}}),o||r({container:a._glcontainer.node()}),o}}}),ym=m({"src/traces/scattergl/plot.js"(e,t){var r=mO(),i=gK(),n=gJ(),a=yf(),o=tb(),s=rR().selectMode,l=yp(),u=t6(),c=ne(),h=mM().styleTextSelection,d={},e=t.exports=function(e,t,f){if(f.length){var p,m,g=e._fullLayout,y=t._scene,v=t.xaxis,x=t.yaxis;if(y){if(!l(e,["ANGLE_instanced_arrays","OES_element_index_uint"],d))return void y.init();var b,_,w,T,A,M,k,S,E,D,C=y.count,I=g._glcanvas.data()[0].regl;if(c(e,t,f),y.dirty){if((y.line2d||y.error2d)&&!(y.scatter2d||y.fill2d||y.glText)&&I.clear({color:!0,depth:!0}),!0===y.error2d&&(y.error2d=n(I)),!0===y.line2d&&(y.line2d=i(I)),!0===y.scatter2d&&(y.scatter2d=r(I)),!0===y.fill2d&&(y.fill2d=i(I)),!0===y.glText)for(y.glText=Array(C),p=0;py.glText.length){var L=C-y.glText.length;for(p=0;pr&&(isNaN(t[i])||isNaN(t[i+1]));)i-=2;e.positions=t.slice(r,i+2)}return e}),y.line2d.update(y.lineOptions)),y.error2d){var z=(y.errorXOptions||[]).concat(y.errorYOptions||[]).map(function(e){return e||{positions:[],errors:[]}});y.error2d.update(z)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=o.repeat(null,C),y.fill2d&&(y.fillOptions=y.fillOptions.map(function(e,t){var r=f[t];if(!(!e||!r||!r[0]||!r[0].trace)){var i,n,a=r[0],o=a.trace,s=a.t,l=y.lineOptions[t],u=[];o._ownfill&&u.push(t),o._nexttrace&&u.push(t+1),u.length&&(y.fillOrder[t]=u);var c,h,d=[],p=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(c=0;cc&&isNaN(p[h+1]);)h-=2;0!==p[c+1]&&(d=[p[c],0]),d=d.concat(p.slice(c,h+2)),0!==p[h+1]&&(d=d.concat([p[h],0]))}else if("tozerox"===o.fill){for(c=0;cc&&isNaN(p[h]);)h-=2;0!==p[c]&&(d=[0,p[c+1]]),d=d.concat(p.slice(c,h+2)),0!==p[h]&&(d=d.concat([0,p[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(d=[],i=0,e.splitNull=!0,n=0;n-1;for(let[e]of f)if(e){var R=e.trace,B=e.t,j=B.index,N=R._length,V=B.x,U=B.y;if(R.selectedpoints||F||O){if(F||(F=!0),R.selectedpoints){var q=y.selectBatch[j]=R.selectedpoints,G={};for(m=0;mn&&s||ih?b.sizeAvg||Math.max(b.size,3):n(t,x),p=0;ptypeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:"u">typeof S&&null!==S&&S.hrtime?(t.exports=function(){return(e()-n)/1e6},r=S.hrtime,n=(e=function(){var e;return 1e9*(e=r())[0]+e[1]})()-1e9*S.uptime()):Date.now?(t.exports=function(){return Date.now()-i},i=Date.now()):(t.exports=function(){return new Date().getTime()-i},i=new Date().getTime())}).call(e)}}),yA=m({"node_modules/raf/index.js"(e,t){var r,i,n,a,o,s=yT(),l=window,u=["moz","webkit"],c="AnimationFrame",h=l["request"+c],d=l["cancel"+c]||l["cancelRequest"+c];for(r=0;!h&&r2?(s[0],s[2],i=s[1],n=s[3]):s.length?(i=s[0],n=s[1]):(s.x,i=s.y,s.x+s.width,n=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,i,o,n]}function h(e){if("number"==typeof e)return[e,e,e,e];if(2===e.length)return[e[0],e[1],e[0],e[1]];{let t=s(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}}t.exports=u,u.prototype.render=function(...e){return e.length&&this.update(...e),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,a(()=>{this.dirty=!1})),this)},u.prototype.update=function(...e){if(!e.length)return;for(let t=0;tt||!u.lower&&e{t[a+r]=i})}this.scatter.draw(...t)}else this.scatter.draw();return this},u.prototype.destroy=function(){return this.traces.forEach(e=>{e.buffer&&e.buffer.destroy&&e.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this}}}),yS=m({"src/traces/splom/plot.js"(e,t){var r=yk(),i=tb(),n=tI(),a=rR().selectMode;t.exports=function(e,t,o){if(o.length)for(var s=0;s-1,D=a(x)||!!f.selectedpoints||E,C=!0;if(D){var I=f._length;if(f.selectedpoints){m.selectBatch=f.selectedpoints;var L=f.selectedpoints,P={};for(l=0;l=t[r][0]&&e<=t[r][1])return!0;return!1}(r,i))return r;var n=e?-1:1,a=0,o=t.length-1;if(n<0){var s=a;a=o,o=s}for(var c=t[a],h=c,d=a;n*dt){f=i;break}}if(isNaN(o=h)&&(o=isNaN(d)||isNaN(f)?isNaN(d)?f:d:t-c[d][1]e[1]+i||t=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(g,t);y&&(s.interval=u[o],s.intervalPix=g,s.region=y)}}if(e.ordinal&&!s.region){var v=e.unitTickvals,x=e.unitToPaddedPx.invert(t);for(i=0;i=b[0]&&x<=b[1]){s.clickableOrdinalRange=b;break}}}return s}function x(e,t){i.event.sourceEvent.stopPropagation();var n=t.height-i.mouse(e)[1]-2*r.verticalPadding,a=t.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[n-a.grabPoint,n+a.barLength-a.grabPoint].map(t.unitToPaddedPx.invert):a.newExtent=[a.startExtent,t.unitToPaddedPx.invert(n)].sort(o),t.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(t),y(e.parentNode)}function b(e,t){var n=t.height-i.mouse(e)[1]-2*r.verticalPadding,a=v(t,n),o="crosshair";a.clickableOrdinalRange?o="pointer":a.region&&(o=a.region+"-resize"),i.select(document.body).style("cursor",o)}function _(e){e.on("mousemove",function(e){i.event.preventDefault(),e.parent.inBrushDrag||b(this,e)}).on("mouseleave",function(e){e.parent.inBrushDrag||m()}).call(i.behavior.drag().on("dragstart",function(e){!function(e,t){i.event.sourceEvent.stopPropagation();var n=t.height-i.mouse(e)[1]-2*r.verticalPadding,a=t.unitToPaddedPx.invert(n),o=t.brush,s=v(t,n),l=s.interval,u=o.svgBrush;if(u.wasDragged=!1,u.grabbingBar="ns"===s.region,u.grabbingBar){var c=l.map(t.unitToPaddedPx);u.grabPoint=n-c[0]-r.verticalPadding,u.barLength=c[1]-c[0]}u.clickableOrdinalRange=s.clickableOrdinalRange,u.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(u.stayingIntervals=u.stayingIntervals.filter(function(e){return e[0]!==l[0]&&e[1]!==l[1]})),u.startExtent=s.region?l[+("s"===s.region)]:a,t.parent.inBrushDrag=!0,u.brushStartCallback()}(this,e)}).on("drag",function(e){x(this,e)}).on("dragend",function(e){!function(e,t){var r=t.brush,n=r.filter,a=r.svgBrush;a._dragging||(b(e,t),x(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,m(),!a.wasDragged){a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&T(r)):T(r),a.brushCallback(t),y(e.parentNode),a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);return}var s=function(){n.set(n.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(u?[a.newExtent]:[]),a.extent.length||T(r),a.brushCallback(t),u?y(e.parentNode,s):(s(),y(e.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,e)}))}function w(e,t){return e[0]-t[0]}function T(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function A(e){for(var t,r=e.slice(),i=[],n=r.shift();n;){for(t=n.slice();(n=r.shift())&&n[0]<=t[1];)t[1]=Math.max(t[1],n[1]);i.push(t)}return 1===i.length&&i[0][0]>i[0][1]&&(i=[]),i}t.exports={makeBrush:function(e,t,r,i,n,a){var s,l,u,c=(u=[],{set:function(e){1===(u=e.map(function(e){return e.slice().sort(o)}).sort(w)).length&&-1/0===u[0][0]&&1/0===u[0][1]&&(u=[[0,-1]]),s=A(u),l=u.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0])},get:function(){return u.slice()},getConsolidated:function(){return s},getBounds:function(){return l}});return c.set(r),{filter:c,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:i,brushCallback:function(e){var t=e.brush,r=t.svgBrush.extent.map(function(e){return e.slice()}).slice();t.filter.set(r),n()},brushEndCallback:a}}},ensureAxisBrush:function(e,t,i){var o,l,u,c,f=e.selectAll("."+r.cn.axisBrush).data(a,n);f.enter().append("g").classed(r.cn.axisBrush,!0),o=i._context.staticPlot,(l=f.selectAll(".background").data(a)).enter().append("rect").classed("background",!0).call(h).call(d).style("pointer-events",o?"none":"auto").attr("transform",s(0,r.verticalPadding)),l.call(_).attr("height",function(e){return e.height-r.verticalPadding}),(u=f.selectAll(".highlight-shadow").data(a)).enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",t).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),u.attr("y1",function(e){return e.height}).call(g),(c=f.selectAll(".highlight").data(a)).enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",function(e){return e.height}).call(g)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map(function(e){return e.sort(o)}),e=t.multiselect?A(e.sort(w)):[e[0]]):e=[e.sort(o)],t.tickvals){var r=t.tickvals.slice().sort(o);if(!(e=e.map(function(e){var t=[c(0,r,e[0],[]),c(1,r,e[1],[])];if(t[1]>t[0])return t}).filter(function(e){return e})).length)return}return e.length>1?e:e[0]}}}}),yN=m({"src/traces/parcoords/defaults.js"(e,t){var r=tb(),i=tN().hasColorscale,n=t1(),a=ai().defaults,o=tK(),s=ro(),l=yO(),u=yj(),c=yR().maxDimensionCount,h=yx();function d(e,t,i,n){function a(i,n){return r.coerce(e,t,l.dimensions,i,n)}var o=a("values"),c=a("visible");if(o&&o.length||(c=t.visible=!1),c){a("label"),a("tickvals"),a("ticktext"),a("tickformat"),t._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:a("range")},s.setConvert(t._ax,n.layout),a("multiselect");var h=a("constraintrange");h&&(t.constraintrange=u.cleanRanges(h,t))}}t.exports=function(e,t,s,u){function f(i,n){return r.coerce(e,t,l,i,n)}var p=e.dimensions;Array.isArray(p)&&p.length>c&&(r.log("parcoords traces support up to "+c+" dimensions at the moment"),p.splice(c));var m=o(e,t,{name:"dimensions",layout:u,handleItemDefaults:d}),g=function(e,t,a,o,s){var l=s("line.color",a);if(i(e,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),n(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=a}return 1/0}(e,t,s,u,f);a(t,u,f),Array.isArray(m)&&m.length||(t.visible=!1),h(t,m,"values",g);var y=r.extendFlat({},u.font,{size:Math.round(u.font.size/1.2)});r.coerceFont(f,"labelfont",y),r.coerceFont(f,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(f,"rangefont",y),f("labelangle"),f("labelside"),f("unselected.line.color"),f("unselected.line.opacity")}}}),yV=m({"src/traces/parcoords/calc.js"(e,t){var r=tb().isArrayOrTypedArray,i=t4(),n=yB().wrap;t.exports=function(e,t){var a,o;return i.hasColorscale(t,"line")&&r(t.line.color)?(a=t.line.color,o=i.extractOpts(t.line).colorscale,i.calc(e,t,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(e){for(var t=Array(e),r=0;r 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),i=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` +`),n=yR().maxDimensionCount,a=tb(),o=new Uint8Array(4),s=new Uint8Array(4),l={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function u(e,t,r,i,n){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,r,i,n),e.clear({color:[0,0,0,0],depth:1})}function c(e,t){return(e>>>8*t)%256/255}function h(e){return("0"+e).slice(-2)}function d(e){return ed&&(d=e[i].dim1.canvasX,s=i);0===l&&u(x,0,0,h.canvasWidth,h.canvasHeight);var b=function(e){var t,r,i,n=[[],[]];for(i=0;i<64;i++){var a=!e&&is._length&&(L=L.slice(0,s._length));var P,z=s.tickvals;function F(e,t){return{val:e,text:P[t]}}function O(e,t){return e.val-t.val}if(n(z)&&z.length){i.isTypedArray(z)&&(z=Array.from(z)),n(P=s.ticktext)&&P.length?P.length>z.length?P=P.slice(0,z.length):z.length>P.length&&(z=z.slice(0,P.length)):P=z.map(a(s.tickformat));for(var R=1;R=i)&&!(l>=n)){var u=e.lineLayer.readPixel(s,n-1-l),c=0!==u[3],h=c?u[2]+256*(u[1]+256*u[0]):null,d={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:h};h!==j&&(c?a.hover(d):a.unhover&&a.unhover(d),j=h)}}}),B.style("opacity",function(e){return+!e.pick}),T.style("background","rgba(255, 255, 255, 0)");var N=T.selectAll("."+v.cn.parcoords).data(R,p);N.exit().remove(),N.enter().append("g").classed(v.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),N.attr("transform",function(e){return u(e.model.translateX,e.model.translateY)});var V=N.selectAll("."+v.cn.parcoordsControlView).data(m,p);V.enter().append("g").classed(v.cn.parcoordsControlView,!0),V.attr("transform",function(e){return u(e.model.pad.l,e.model.pad.t)});var U=V.selectAll("."+v.cn.yAxis).data(function(e){return e.dimensions},p);U.enter().append("g").classed(v.cn.yAxis,!0),V.each(function(e){I(U,e,z)}),B.each(function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=b(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}}),U.attr("transform",function(e){return u(e.xScale(e.xIndex),0)}),U.call(r.behavior.drag().origin(function(e){return e}).on("drag",function(e){var t=e.parent;O.linePickActive(!1),e.x=Math.max(-v.overdrag,Math.min(e.model.width+v.overdrag,r.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,U.sort(function(e,t){return e.x-t.x}).each(function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio}),I(U,t,z),U.filter(function(t){return 0!==Math.abs(e.xIndex-t.xIndex)}).attr("transform",function(e){return u(e.xScale(e.xIndex),0)}),r.select(this).attr("transform",u(e.x,0)),U.each(function(r,i,n){n===e.parent.key&&(t.dimensions[i]=r)}),t.contextLayer&&t.contextLayer.render(t.panels,!1,!k(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)}).on("dragend",function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,I(U,t,z),r.select(this).attr("transform",function(e){return u(e.x,0)}),t.contextLayer&&t.contextLayer.render(t.panels,!1,!k(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),O.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map(function(e){return e.crossfilterDimensionIndex}))})),U.exit().remove();var q=U.selectAll("."+v.cn.axisOverlays).data(m,p);q.enter().append("g").classed(v.cn.axisOverlays,!0),q.selectAll("."+v.cn.axis).remove();var G=q.selectAll("."+v.cn.axis).data(m,p);G.enter().append("g").classed(v.cn.axis,!0),G.each(function(e){var t=e.model.height/e.model.tickDistance,i=e.domainScale,n=i.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?n:null).tickFormat(function(t){return y.isOrdinal(e)?t:L(e.model.dimensions[e.visibleIndex],t)}).scale(i)),h.font(G.selectAll("text"),e.model.tickFont)}),G.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),G.selectAll("text").style("cursor","default");var H=q.selectAll("."+v.cn.axisHeading).data(m,p);H.enter().append("g").classed(v.cn.axisHeading,!0);var $=H.selectAll("."+v.cn.axisTitle).data(m,p);$.enter().append("text").classed(v.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",f?"none":"auto"),$.text(function(e){return e.label}).each(function(t){var i=r.select(this);h.font(i,t.model.labelFont),c.convertToTspans(i,e)}).attr("transform",function(e){var t=C(e.model.labelAngle,e.model.labelSide),r=v.axisTitleOffset;return(t.dir>0?"":u(0,2*r+e.model.height))+l(t.degrees)+u(-r*t.dx,-r*t.dy)}).attr("text-anchor",function(e){var t=C(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"});var W=q.selectAll("."+v.cn.axisExtent).data(m,p);W.enter().append("g").classed(v.cn.axisExtent,!0);var Y=W.selectAll("."+v.cn.axisExtentTop).data(m,p);Y.enter().append("g").classed(v.cn.axisExtentTop,!0),Y.attr("transform",u(0,-v.axisExtentOffset));var Z=Y.selectAll("."+v.cn.axisExtentTopText).data(m,p);Z.enter().append("text").classed(v.cn.axisExtentTopText,!0).call(D),Z.text(function(e){return P(e,!0)}).each(function(e){h.font(r.select(this),e.model.rangeFont)});var X=W.selectAll("."+v.cn.axisExtentBottom).data(m,p);X.enter().append("g").classed(v.cn.axisExtentBottom,!0),X.attr("transform",function(e){return u(0,e.model.height+v.axisExtentOffset)});var K=X.selectAll("."+v.cn.axisExtentBottomText).data(m,p);K.enter().append("text").classed(v.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(D),K.text(function(e){return P(e,!1)}).each(function(e){h.font(r.select(this),e.model.rangeFont)}),x.ensureAxisBrush(q,F,e)}}}),yH=m({"src/traces/parcoords/plot.js"(e,t){var r=yG(),i=yp(),n=yU().isVisible,a={};function o(e,t,r){var i=t.indexOf(r),n=e.indexOf(i);return -1===n&&(n+=t.length),n}var e=t.exports=function(e,t){var s=e._fullLayout;if(i(e,[],a)){var l={},u={},c={},h=s._size;t.forEach(function(t,r){var i=t[0].trace,n=c[r]=i.index;l[r]=e.data[n].dimensions,u[r]=e.data[n].dimensions.slice()}),r(e,t,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(t,r,i){var n=u[t][r],a=i.map(function(e){return e.slice()}),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[e._fullData[c[t]].uid];if(void 0===l[o]){var h=n.constraintrange;l[o]=h||null}var d=e._fullData[c[t]].dimensions[r];a.length?(1===a.length&&(a=a[0]),n.constraintrange=a,d.constraintrange=a.slice(),a=[a]):(delete n.constraintrange,delete d.constraintrange,a=null);var f={};f[o]=a,e.emit("plotly_restyle",[f,[c[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var i,a=(i=u[t].filter(n),function(e,t){return o(r,i,e)-o(r,i,t)});l[t].sort(a),u[t].filter(function(e){return!n(e)}).sort(function(e){return u[t].indexOf(e)}).forEach(function(e){l[t].splice(l[t].indexOf(e),1),l[t].splice(u[t].indexOf(e),0,e)}),e.emit("plotly_restyle",[{dimensions:[l[t]]},[c[t]]])}})}};e.reglPrecompiled=a}}),y$=m({"src/traces/parcoords/base_plot.js"(e){var t=M(),r=tz().getModuleCalcData,i=yH(),n=tR();e.name="parcoords",e.plot=function(e){var t=r(e.calcdata,"parcoords")[0];t.length&&i(e,t)},e.clean=function(e,t,r,i){var n=i._has&&i._has("parcoords"),a=t._has&&t._has("parcoords");n&&!a&&(i._paperdiv.selectAll(".parcoords").remove(),i._glimages.selectAll("*").remove())},e.toSVG=function(e){var r=e._fullLayout._glimages,i=t.select(e).selectAll(".svg-container");i.filter(function(e,t){return t===i.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var e=this.toDataURL("image/png");r.append("svg:image").attr({xmlns:n.svg,"xlink:href":e,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})}),window.setTimeout(function(){t.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),yW=m({"src/traces/parcoords/base_index.js"(e,t){t.exports={attributes:yO(),supplyDefaults:yN(),calc:yV(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:y$(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),yY=m({"src/traces/parcoords/index.js"(e,t){var r=yW();r.plot=yH(),t.exports=r}}),yZ=m({"lib/parcoords.js"(e,t){t.exports=yY()}}),yX=m({"src/traces/parcats/attributes.js"(e,t){var r=H().extendFlat,i=X(),n=$(),a=tG(),{hovertemplateAttrs:o,templatefallbackAttrs:s}=eY(),l=ai().attributes,u=r({editType:"calc"},a("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:s({editType:"plot"})});t.exports={domain:l({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},i.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:s({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:n({editType:"calc"}),tickfont:n({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:u,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),yK=m({"src/traces/parcats/defaults.js"(e,t){var r=tb(),i=tN().hasColorscale,n=t1(),a=ai().defaults,o=tK(),s=yX(),l=yx(),u=F().isTypedArraySpec;function c(e,t){function i(i,n){return r.coerce(e,t,s.dimensions,i,n)}var n=i("values"),a=i("visible");if(n&&n.length||(a=t.visible=!1),a){i("label"),i("displayindex",t._index);var o,l=e.categoryarray,c=r.isArrayOrTypedArray(l)&&l.length>0||u(l);c&&(o="array");var h=i("categoryorder",o);"array"===h?(i("categoryarray"),i("ticktext")):(delete e.categoryarray,delete e.ticktext),c||"array"!==h||(t.categoryorder="trace")}}t.exports=function(e,t,u,h){function d(i,n){return r.coerce(e,t,s,i,n)}var f=o(e,t,{name:"dimensions",handleItemDefaults:c}),p=function(e,t,a,o,s){s("line.shape"),s("line.hovertemplate"),s("line.hovertemplatefallback");var l=s("line.color",o.colorway[0]);if(i(e,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),n(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=a}return 1/0}(e,t,u,h,d);a(t,h,d),Array.isArray(f)&&f.length||(t.visible=!1),l(t,f,"values",p),d("hoveron"),d("hovertemplate"),d("hovertemplatefallback"),d("arrangement"),d("bundlecolors"),d("sortpaths"),d("counts");var m=h.font;r.coerceFont(d,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(d,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}}),yJ=m({"src/traces/parcats/calc.js"(e,t){var r=yB().wrap,i=tN().hasColorscale,n=t5(),a=tu(),o=rt(),s=tb(),l=I();t.exports=function(e,t){var u,c,h,d,f,p,m=s.filterVisible(t.dimensions);if(0===m.length)return[];var g,y,v,x=m.map(function(e){var t;if("trace"===e.categoryorder)t=null;else if("array"===e.categoryorder)t=e.categoryarray;else{t=a(e.values);for(var r=!0,i=0;i=e.length||void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(e.map(function(e){return e.displayindex})))for(t=0;tt.model.rawColor?1:e.model.rawColor"),D=r.mouse(h)[0];o.loneHover({trace:d,x:b-p.left+m.left,y:w-p.top+m.top,text:E,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:Da.mostReadable(e.model.color)).attr("stroke-width",.3)}function w(e){e.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function T(e){e.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function A(e){var t=e.parcatsViewModel.pathSelection,r=e.categoryViewModel.model.dimensionInd,i=e.categoryViewModel.model.categoryInd;return t.filter(function(t){return t.model.categoryInds[r]===i&&t.model.color===e.color})}function k(e,t,i){var n=r.select(e).datum(),a=n.categoryViewModel.model,o=n.parcatsViewModel.graphDiv,s=r.select(e.parentNode).selectAll("rect.bandrect"),l=[];s.each(function(e){A(e).each(function(e){Array.prototype.push.apply(l,g(e))})});var u={};u[a.dimensionInd]=a.categoryValue,o.emit(t,{points:l,event:i,constraints:u})}function S(e,t,i){var n=r.select(e).datum(),a=n.categoryViewModel.model,o=n.parcatsViewModel.graphDiv,s=A(n),l=[];s.each(function(e){Array.prototype.push.apply(l,g(e))});var u={};u[a.dimensionInd]=a.categoryValue,void 0!==n.rawColor&&(u.color=n.rawColor),o.emit(t,{points:l,event:i,constraints:u})}function E(e,t,i){e._fullLayout._calcInverseTransform(e);var n,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=r.select(i.parentNode).select("rect.catrect"),u=l.node().getBoundingClientRect(),c=l.datum(),h=c.parcatsViewModel,d=h.model.dimensions[c.model.dimensionInd],f=h.trace,p=u.top+u.height/2;h.dimensions.length>1&&d.displayInd===h.dimensions.length-1?(n=u.left,a="left"):(n=u.left+u.width,a="right");var m=c.model.count,g=c.model.categoryLabel,y=m/c.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==c.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==c.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var b=x.join("
");return{trace:f,x:o*(n-t.left),y:s*(p-t.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:f.hovertemplate,hovertemplateLabels:v,eventData:[{data:f._input,fullData:f,count:m,category:g,probability:y}]}}function D(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){var t;if(!(r.mouse(this)[1]<-1)){var i,n,l,u,c,h,d,f,p,m,g,y,v,x,b,w,T,M,D,C,I,L,P,z,F,O,R,B=e.parcatsViewModel.graphDiv,j=B._fullLayout,N=j._paperdiv.node().getBoundingClientRect(),V=e.parcatsViewModel.hoveron;("color"===V?(_(l=A(n=r.select(this).datum())),l.each(function(){s.raiseToTop(this)}),r.select(this.parentNode).selectAll("rect.bandrect").filter(function(e){return e.color===n.color}).each(function(){s.raiseToTop(this),r.select(this).attr("stroke","black").attr("stroke-width",1.5)}),S(this,"plotly_hover",r.event)):(i=this,r.select(i.parentNode).selectAll("rect.bandrect").each(function(e){var t=A(e);_(t),t.each(function(){s.raiseToTop(this)})}),r.select(i.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5),k(this,"plotly_hover",r.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none"))&&("category"===V?t=E(B,N,this):"color"===V?(B._fullLayout._calcInverseTransform(B),h=B._fullLayout._invScaleX,d=B._fullLayout._invScaleY,f=this.getBoundingClientRect(),y=(g=(m=(p=r.select(this).datum()).categoryViewModel).parcatsViewModel).model.dimensions[m.model.dimensionInd],v=g.trace,x=f.y+f.height/2,g.dimensions.length>1&&y.displayInd===g.dimensions.length-1?(u=f.left,c="left"):(u=f.left+f.width,c="right"),b=m.model.categoryLabel,w=p.parcatsViewModel.model.count,T=0,p.categoryViewModel.bands.forEach(function(e){e.color===p.color&&(T+=e.count)}),M=m.model.count,D=0,g.pathSelection.each(function(e){e.model.color===p.color&&(D+=e.model.count)}),C=T/w,I=T/D,L=T/M,P={countLabel:T,categoryLabel:b,probabilityLabel:C.toFixed(3)},z=[],-1!==m.parcatsViewModel.hoverinfoItems.indexOf("count")&&z.push(["Count:",P.countLabel].join(" ")),-1!==m.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(z.push("P(color ∩ "+b+"): "+P.probabilityLabel),z.push("P("+b+" | color): "+I.toFixed(3)),z.push("P(color | "+b+"): "+L.toFixed(3))),F=z.join("
"),O=a.mostReadable(p.color),t={trace:v,x:h*(u-N.left),y:d*(x-N.top),text:F,color:p.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:O,fontSize:10,idealAlign:c,hovertemplate:v.hovertemplate,hovertemplateLabels:P,eventData:[{data:v._input,fullData:v,category:b,count:w,probability:C,categorycount:M,colorcount:D,bandcolorcount:T}]}):"dimension"===V&&(R=[],r.select(this.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){R.push(E(B,N,this))}),t=R),t&&o.loneHover(t,{container:j._hoverlayer.node(),outerContainer:j._paper.node(),gd:B}))}}}function C(e){var t=e.parcatsViewModel;t.dragDimension||(b(t.pathSelection),w(t.dimensionSelection.selectAll("g.category")),T(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(f),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?S(this,"plotly_unhover",r.event):k(this,"plotly_unhover",r.event))}function I(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map(function(e){return e.displayInd}),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each(function(t){var i=r.mouse(this)[0],n=r.mouse(this)[1];-2<=i&&i<=t.width+2&&-2<=n&&n<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map(function(e){return e.displayInd}),t.model.dragY=t.y,s.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each(function(t){t.yu.y+u.height/2&&(n.model.displayInd=u.model.displayInd,u.model.displayInd=o),e.dragCategoryDisplayInd=n.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){i.model.dragX=r.event.x;var c=e.parcatsViewModel.dimensions[t-1],h=e.parcatsViewModel.dimensions[t+1];void 0!==c&&i.model.dragXh.x&&(i.model.displayInd=h.model.displayInd,h.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=i.model.displayInd}N(e.parcatsViewModel),j(e.parcatsViewModel),O(e.parcatsViewModel),F(e.parcatsViewModel)}}function P(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var t={},i=z(e.parcatsViewModel),a=e.parcatsViewModel.model.dimensions.map(function(e){return e.displayInd}),o=e.initialDragDimensionDisplayInds.some(function(e,t){return e!==a[t]});o&&a.forEach(function(r,i){t["dimensions["+e.parcatsViewModel.model.dimensions[i].containerInd+"].displayindex"]=r});var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map(function(e){return e.displayInd});if(s=e.initialDragCategoryDisplayInds.some(function(e,t){return e!==l[t]})){var u=e.model.categories.slice().sort(function(e,t){return e.displayInd-t.displayInd}),c=u.map(function(e){return e.categoryValue}),h=u.map(function(e){return e.categoryLabel});t["dimensions["+e.model.containerInd+"].categoryarray"]=[c],t["dimensions["+e.model.containerInd+"].ticktext"]=[h],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?S(e.potentialClickBand,"plotly_click",r.event.sourceEvent):k(e.potentialClickBand,"plotly_click",r.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,N(e.parcatsViewModel),j(e.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each(function(){O(e.parcatsViewModel,!0),F(e.parcatsViewModel,!0)}).each("end",function(){(o||s)&&n.restyle(e.parcatsViewModel.graphDiv,t,[i])})}}function z(e){for(var t,r=e.graphDiv._fullData,i=0;i=0;s--)c+="C"+u[s]+","+(t[s+1]+n)+" "+l[s]+","+(t[s]+n)+" "+(e[s]+r[s])+","+(t[s]+n)+("l-"+r[s])+",0 ";return c+"Z"}function j(e){var t=e.dimensions,r=e.model,i=t.map(function(e){return e.categories.map(function(e){return e.y})}),n=e.model.dimensions.map(function(e){return e.categories.map(function(e){return e.displayInd})}),a=e.model.dimensions.map(function(e){return e.displayInd}),o=e.dimensions.map(function(e){return e.model.dimensionInd}),s=t.map(function(e){return e.x}),l=t.map(function(e){return e.width}),u=[];for(var c in r.paths)r.paths.hasOwnProperty(c)&&u.push(r.paths[c]);function h(e){var t=e.categoryInds.map(function(e,t){return n[t][e]});return o.map(function(e){return t[e]})}u.sort(function(t,r){var i=h(t),n=h(r);return"backward"===e.sortpaths&&(i.reverse(),n.reverse()),i.push(t.valueInds[0]),n.push(r.valueInds[0]),e.bundlecolors&&(i.unshift(t.rawColor),n.unshift(r.rawColor)),function(e,t){for(var r=0;rn)return 1;if(i!==n){var a=isNaN(i);if(a!==isNaN(n))return a?1:-1}}return e.length-t.length}(i,n)});for(var d=Array(u.length),f=t[0].model.count,p=t[0].categories.map(function(e){return e.height}).reduce(function(e,t){return e+t}),m=0;m0?p*(v.count/f):0;for(var x=Array(i.length),b=0;b1?(e.width-80-16)/(i-1):0)*n;var a,o,s,l,u,c=[],h=e.model.maxCats,d=t.categories.length,f=t.count,p=e.height-8*(h-1),m=(h-d)*8/2,g=t.categories.map(function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}});for(g.sort(function(e,t){return e.displayInd-t.displayInd}),u=0;u0?o.count/f*p:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:e},m=m+a+8,c.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:c,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}(e,a))}e.dimensions=r}t.exports=function(e,t,i,n){var a,o,g,y,x,_,A,M,k,S,E,z;a=e._context.staticPlot,o=i.map(R.bind(0,e,n)),(g=t.selectAll("g.parcatslayer").data([null])).enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all"),x=(y=g.selectAll("g.trace.parcats").data(o,h)).enter().append("g").attr("class","trace parcats"),y.attr("transform",function(e){return l(e.x,e.y)}),x.append("g").attr("class","paths"),(_=y.select("g.paths").selectAll("path.path").data(function(e){return e.paths},h)).attr("fill",function(e){return e.model.color}),b(A=_.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(e){return e.model.color}).attr("fill-opacity",0)),_.attr("d",function(e){return e.svgD}),A.empty()||_.sort(f),_.exit().remove(),_.on("mouseover",p).on("mouseout",m).on("click",v),x.append("g").attr("class","dimensions"),(M=y.select("g.dimensions").selectAll("g.dimension").data(function(e){return e.dimensions},h)).enter().append("g").attr("class","dimension"),M.attr("transform",function(e){return l(e.x,0)}),M.exit().remove(),S=(k=M.selectAll("g.category").data(function(e){return e.categories},h)).enter().append("g").attr("class","category"),k.attr("transform",function(e){return l(0,e.y)}),S.append("rect").attr("class","catrect").attr("pointer-events","none"),k.select("rect.catrect").attr("fill","none").attr("width",function(e){return e.width}).attr("height",function(e){return e.height}),w(S),(E=k.selectAll("rect.bandrect").data(function(e){return e.bands},h)).each(function(){s.raiseToTop(this)}),E.attr("fill",function(e){return e.color}),z=E.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(e){return e.color}).attr("fill-opacity",0),E.attr("fill",function(e){return e.color}).attr("width",function(e){return e.width}).attr("height",function(e){return e.height}).attr("y",function(e){return e.y}).attr("cursor",function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"perpendicular"===e.parcatsViewModel.arrangement?"ns-resize":"move"}),T(z),E.exit().remove(),S.append("text").attr("class","catlabel").attr("pointer-events","none"),k.select("text.catlabel").attr("text-anchor",function(e){return d(e)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(e){return d(e)?e.width+5:-5}).attr("y",function(e){return e.height/2}).text(function(e){return e.model.categoryLabel}).each(function(t){u.font(r.select(this),t.parcatsViewModel.categorylabelfont),c.convertToTspans(r.select(this),e)}),S.append("text").attr("class","dimlabel"),k.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"ew-resize"}).attr("x",function(e){return e.width/2}).attr("y",-5).text(function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null}).each(function(e){u.font(r.select(this),e.parcatsViewModel.labelfont)}),k.selectAll("rect.bandrect").on("mouseover",D).on("mouseout",C),k.exit().remove(),M.call(r.behavior.drag().origin(function(e){return{x:e.x,y:0}}).on("dragstart",I).on("drag",L).on("dragend",P)),y.each(function(e){e.traceSelection=r.select(this),e.pathSelection=r.select(this).selectAll("g.paths").selectAll("path.path"),e.dimensionSelection=r.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),y.exit().remove()}}}),y0=m({"src/traces/parcats/plot.js"(e,t){var r=yQ();t.exports=function(e,t,i,n){var a=e._fullLayout,o=a._paper,s=a._size;r(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},i,n)}}}),y1=m({"src/traces/parcats/base_plot.js"(e){var t=tz().getModuleCalcData,r=y0(),i="parcats";e.name=i,e.plot=function(e,n,a,o){var s=t(e.calcdata,i);s.length&&r(e,s[0],a,o)},e.clean=function(e,t,r,i){var n=i._has&&i._has("parcats"),a=t._has&&t._has("parcats");n&&!a&&i._paperdiv.selectAll(".parcats").remove()}}}),y2=m({"src/traces/parcats/index.js"(e,t){t.exports={attributes:yX(),supplyDefaults:yK(),calc:yJ(),plot:y0(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:y1(),categories:["noOpacity"],meta:{}}}}),y3=m({"lib/parcats.js"(e,t){t.exports=y2()}}),y5=m({"src/plots/map/styles/arcgis-sat-hybrid.js"(e,t){t.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI ©
ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} +{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),y4=m({"src/plots/map/styles/arcgis-sat.js"(e,t){t.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),y6=m({"src/plots/map/constants.js"(e,t){var r=(e7(),x(e4)).default,i=y5(),n=y4(),a="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",s="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",l={basic:s,streets:s,outdoors:s,light:a,dark:o,satellite:n,"satellite-streets":i,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'\xa9 OpenStreetMap contributors',tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":a,"carto-darkmatter":o,"carto-voyager":s,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},u=r(l);t.exports={styleValueDflt:"basic",stylesMap:l,styleValuesMap:u,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",u.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error.",fitBoundsPadding:20}}}),y8=m({"src/plots/map/layout_attributes.js"(e,t){var r=tb(),i=er().defaultLine,n=ai().attributes,a=$(),o=i_().textposition,s=eH().overrideAll,l=tD().templatedArray,u=y6(),c=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(t.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:n({name:"map"}),style:{valType:"any",values:u.styleValuesMap,dflt:u.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},fitbounds:{valType:"enumerated",values:[!1,"locations"],dflt:"locations"},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:c,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),y7=m({"src/traces/scattermap/attributes.js"(e,t){var{hovertemplateAttrs:r,texttemplateAttrs:i,templatefallbackAttrs:n}=eY(),a=ib(),o=pu(),s=i_(),l=y8(),u=X(),c=tG(),h=H().extendFlat,d=eH().overrideAll,f=y8(),p=o.line,m=o.marker;t.exports=d({lon:o.lon,lat:o.lat,cluster:{enabled:{valType:"boolean"},maxzoom:h({},f.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:h({},m.opacity,{dflt:1})},mode:h({},s.mode,{dflt:"markers"}),text:h({},s.text,{}),texttemplate:i({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:n({editType:"plot"}),hovertext:h({},s.hovertext,{}),line:{color:p.color,width:p.width},connectgaps:s.connectgaps,marker:h({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:m.opacity,size:m.size,sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode},c("marker")),fill:o.fill,fillcolor:a(),textfont:l.layers.symbol.textfont,textposition:l.layers.symbol.textposition,below:{valType:"string"},selected:{marker:s.selected.marker},unselected:{marker:s.unselected.marker},hoverinfo:h({},u.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r(),hovertemplatefallback:n()},"calc","nested")}}),y9=m({"src/traces/scattermap/constants.js"(e,t){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];t.exports={isSupportedFont:function(e){return -1!==r.indexOf(e)}}}}),ve=m({"src/traces/scattermap/defaults.js"(e,t){var r=tb(),i=t6(),n=iH(),a=i$(),o=iY(),s=iZ(),l=y7(),u=y9().isSupportedFont;t.exports=function(e,t,c,h){function d(i,n){return r.coerce(e,t,l,i,n)}function f(i,n){return r.coerce2(e,t,l,i,n)}if(p=t,g=(m=d)("lon")||[],y=m("lat")||[],p._length=v=Math.min(g.length,y.length),!v){t.visible=!1;return}if(d("text"),d("texttemplate"),d("texttemplatefallback"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback"),d("mode"),d("below"),i.hasMarkers(t)){n(e,t,c,h,d,{noLine:!0,noAngle:!0}),d("marker.allowoverlap"),d("marker.angle");var p,m,g,y,v,x=t.marker;"circle"!==x.symbol&&(r.isArrayOrTypedArray(x.size)&&(x.size=x.size[0]),r.isArrayOrTypedArray(x.color)&&(x.color=x.color[0]))}i.hasLines(t)&&(a(e,t,c,h,d,{noDash:!0}),d("connectgaps"));var b=f("cluster.maxzoom"),_=f("cluster.step"),w=f("cluster.color",t.marker&&t.marker.color||c),T=f("cluster.size"),A=f("cluster.opacity");if(d("cluster.enabled",!1!==b||!1!==_||!1!==w||!1!==T||!1!==A)||i.hasText(t)){var M=h.font.family;o(e,t,h,d,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:u(M)?M:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}d("fill"),"none"!==t.fill&&s(e,t,c,d),r.coerceSelectionMarkerOpacity(t,d)}}}),vt=m({"src/traces/scattermap/format_labels.js"(e,t){var r=ro();t.exports=function(e,t,i){var n={},a=i[t.subplot]._subplot.mockAxis,o=e.lonlat;return n.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,n.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,n}}}),vr=m({"src/plots/map/convert_text_opts.js"(e,t){var r=tb();t.exports=function(e,t){var i=e.split(" "),n=i[0],a=i[1],o=r.isArrayOrTypedArray(t)?r.mean(t):t,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(n){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}}}),vi=m({"src/traces/scattermap/convert.js"(e,t){var r=I(),i=tb(),n=L().BADNUM,a=pg(),o=t4(),s=rt(),l=t8(),u=t6(),c=y9().isSupportedFont,h=vr(),d=t7().appendArrayPointValue,f=tj().NEWLINES,p=tj().BR_TAG_ALL;function m(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(e,t){return i.isArrayOrTypedArray(e)?t?function(t){return r(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return""}function v(e,t){var r;if(i.isArrayOrTypedArray(e)&&i.isArrayOrTypedArray(t)){r=["step",["get","point_count"],e[0]];for(var n=1;n850?s+=" Black":n>750?s+=" Extra Bold":n>650?s+=" Bold":n>550?s+=" Semi Bold":n>450?s+=" Medium":n>350?s+=" Regular":n>250?s+=" Light":n>150?s+=" Extra Light":s+=" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",n>750?s+=" Extrabold":n>650?s+=" Bold":n>550?s+=" Semibold":n>350?s+=" Regular":s+=" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=n>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),c(s)||(s=r),s.split(", ")}t.exports=function(e,t){var c,b=t[0].trace,_=!0===b.visible&&0!==b._length,w="none"!==b.fill,T=u.hasLines(b),A=u.hasMarkers(b),M=u.hasText(b),k=A&&"circle"===b.marker.symbol,S=A&&"circle"!==b.marker.symbol,E=b.cluster&&b.cluster.enabled,D=m("fill"),C=m("line"),I=m("circle"),L=m("symbol"),P={fill:D,line:C,circle:I,symbol:L};if(!_)return P;if((w||T)&&(c=a.calcTraceToLineCoords(t)),w&&(D.geojson=a.makePolygon(c),D.layout.visibility="visible",i.extendFlat(D.paint,{"fill-color":b.fillcolor})),T&&(C.geojson=a.makeLine(c),C.layout.visibility="visible",i.extendFlat(C.paint,{"line-width":b.line.width,"line-color":b.line.color,"line-opacity":b.opacity})),k){var z=function(e){var t,a,u,c,h,d=e[0].trace,f=d.marker,p=d.selectedpoints,m=i.isArrayOrTypedArray(f.color),g=i.isArrayOrTypedArray(f.size),y=i.isArrayOrTypedArray(f.opacity);function v(e){return d.opacity*e}m&&(t=o.hasColorscale(d,"marker")?o.makeColorScaleFuncFromTrace(f):i.identity),g&&(a=l(d)),y&&(u=function(e){return v(r(e)?+i.constrain(e,0,1):0)});var x=[];for(h=0;h=0;t--){var r=a[t];n.removeLayer(h.layerIds[r])}e||n.removeSource(h.sourceIds.circle)}(e):function(e){for(var t=o.length-1;t>=0;t--){var r=o[t];n.removeLayer(h.layerIds[r]),e||n.removeSource(h.sourceIds[r])}}(e)}function f(e){u?function(e){e||h.addSource("circle",s.circle,t.cluster);for(var r=0;r=0;r--){var i=t[r];e.removeLayer(this.layerIds[i]),e.removeSource(this.sourceIds[i])}},t.exports=function(e,t){var r,n,l,u=t[0].trace,c=u.cluster&&u.cluster.enabled,h=!0!==u.visible,d=new s(e,u.uid,c,h),f=i(e.gd,t),p=d.below=e.belowLookup["trace-"+u.uid];if(c)for(d.addSource("circle",f.circle,u.cluster),r=0;r")}}t.exports={hoverPoints:function(e,t,a){var u=e.cd,c=u[0].trace,h=e.xa,d=e.ya,f=e.subplot,p=[],m=s+c.uid+"-circle",g=c.cluster&&c.cluster.enabled;g&&(p=f.map.queryRenderedFeatures(null,{layers:[m]}).map(function(e){return e.id}));var y=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),v=t-y;if(r.getClosest(u,function(e){var t=e.lonlat;if(t[0]===o||g&&-1===p.indexOf(e.i+1))return 1/0;var r=i.modHalf(t[0],360),n=t[1],s=f.project([r,n]),l=s.x-h.c2p([v,n]),u=s.y-d.c2p([r,a]),c=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-c,1-3/c)},e),!1!==e.index){var x=u[e.index],b=x.lonlat,_=[i.modHalf(b[0],360)+y,b[1]],w=h.c2p(_),T=d.c2p(_),A=x.mrc||1;e.x0=w-A,e.x1=w+A,e.y0=T-A,e.y1=T+A;var M={};M[c.subplot]={_subplot:f};var k=c._module.formatLabels(x,c,M);return e.lonLabel=k.lonLabel,e.latLabel=k.latLabel,e.color=n(c,x),e.extraText=l(c,x,u[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}},getExtraText:l}}}),vo=m({"src/traces/scattermap/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}}),vs=m({"src/traces/scattermap/select.js"(e,t){var r=tb(),i=t6(),{BADNUM:n}=L(),a=(e,t,r,i)=>[e.c2p([r,i]),t.c2p([r,i])];t.exports=function(e,t){var o;let{cd:s,xaxis:l,yaxis:u}=e,{trace:c}=s[0];if(!i.hasMarkers(c))return[];if(!1===t){for(let e of s)e.selected=0;return[]}let h=null==(o=l._subplot)?void 0:o.map,d=!!h?.getRenderWorldCopies()&&t.xmax>t.xmin,f=[];for(let i=0;iMath.abs(l-(n[0]-s[0]))&&.001>Math.abs(u-(n[1]-s[1]));return{dx:l,dy:u,uniform:c}}(l,u,p,h,m),n=function(e,t,r){let i=-1/0,n=1/0,a=(e,t,r)=>{if(.001>Math.abs(e))return;let a=t/e,o=r/e;i=Math.max(i,Math.min(a,o)),n=Math.min(n,Math.max(a,o))};return a(e.dx,r.xmin-t[0],r.xmax-t[0]),a(e.dy,r.ymin-t[1],r.ymax-t[1]),isFinite(i)&&isFinite(n)&&!(i>n)?[Math.floor(i)-1,Math.ceil(n)+1]:null}(r,m,t);for(let o=n?n[0]:0;n&&o<=n[1]&&!g;o++){let n=r.uniform?[m[0]+o*r.dx,m[1]+o*r.dy]:a(l,u,p+360*o,h);g=t.contains(n,null,i,e)}}else g=t.contains(m,null,i,e);g?(f.push({pointNumber:i,lon:c,lat:h}),o.selected=1):o.selected=0}return f}}});function vl(e,t){this.x=e,this.y=t}function vu(){return Mr??(Mr="u">typeof OffscreenCanvas&&!!new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),Mr}function vc(){if(null==Mi&&(Mi=!1,vu())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let r=4*t;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){Mi=!0;break}}}return Mi||!1}function vh(){var e=new Mn(9);return Mn!=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}function vd(){var e=new Mn(16);return Mn!=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}function vf(e){var t=new Mn(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}function vp(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 vm(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],y=t[15],v=r*s-i*o,x=r*l-n*o,b=r*u-a*o,_=i*l-n*s,w=i*u-a*s,T=n*u-a*l,A=c*m-h*p,M=c*g-d*p,k=c*y-f*p,S=h*g-d*m,E=h*y-f*m,D=d*y-f*g,C=v*D-x*E+b*S+_*k-w*M+T*A;return C?(C=1/C,e[0]=(s*D-l*E+u*S)*C,e[1]=(n*E-i*D-a*S)*C,e[2]=(m*T-g*w+y*_)*C,e[3]=(d*w-h*T-f*_)*C,e[4]=(l*k-o*D-u*M)*C,e[5]=(r*D-n*k+a*M)*C,e[6]=(g*b-p*T-y*x)*C,e[7]=(c*T-d*b+f*x)*C,e[8]=(o*E-s*k+u*A)*C,e[9]=(i*k-r*E-a*A)*C,e[10]=(p*w-m*b+y*v)*C,e[11]=(h*b-c*w-f*v)*C,e[12]=(s*M-o*S-l*A)*C,e[13]=(r*S-i*M+n*A)*C,e[14]=(m*x-p*_-g*v)*C,e[15]=(c*_-h*x+d*v)*C,e):null}function vg(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*i+b*s+_*h+w*m,e[1]=x*n+b*l+_*d+w*g,e[2]=x*a+b*u+_*f+w*y,e[3]=x*o+b*c+_*p+w*v,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*i+b*s+_*h+w*m,e[5]=x*n+b*l+_*d+w*g,e[6]=x*a+b*u+_*f+w*y,e[7]=x*o+b*c+_*p+w*v,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*i+b*s+_*h+w*m,e[9]=x*n+b*l+_*d+w*g,e[10]=x*a+b*u+_*f+w*y,e[11]=x*o+b*c+_*p+w*v,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*i+b*s+_*h+w*m,e[13]=x*n+b*l+_*d+w*g,e[14]=x*a+b*u+_*f+w*y,e[15]=x*o+b*c+_*p+w*v,e}function vy(e,t,r){var i,n,a,o,s,l,u,c,h,d,f,p,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(i=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=i,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=i*m+s*g+h*y+t[12],e[13]=n*m+l*g+d*y+t[13],e[14]=a*m+u*g+f*y+t[14],e[15]=o*m+c*g+p*y+t[15]),e}function vv(e,t,r){var i=r[0],n=r[1],a=r[2];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]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function vx(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*i,e[5]=o*n+c*i,e[6]=s*n+h*i,e[7]=l*n+d*i,e[8]=u*n-a*i,e[9]=c*n-o*i,e[10]=h*n-s*i,e[11]=d*n-l*i,e}function vb(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-u*i,e[1]=o*n-c*i,e[2]=s*n-h*i,e[3]=l*n-d*i,e[8]=a*i+u*n,e[9]=o*i+c*n,e[10]=s*i+h*n,e[11]=l*i+d*n,e}function v_(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(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[0]=a*n+u*i,e[1]=o*n+c*i,e[2]=s*n+h*i,e[3]=l*n+d*i,e[4]=u*n-a*i,e[5]=c*n-o*i,e[6]=h*n-s*i,e[7]=d*n-l*i,e}function vw(e,t,r,i,n){var a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,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&&1/0!==n){var o=1/(i-n);e[10]=(n+i)*o,e[14]=2*n*i*o}else e[10]=-1,e[14]=-2*i;return e}function vT(e,t,r,i,n,a,o){var s=1/(t-r),l=1/(i-n),u=1/(a-o);return e[0]=-2*s,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*u,e[11]=0,e[12]=(t+r)*s,e[13]=(n+i)*l,e[14]=(o+a)*u,e[15]=1,e}function vA(){var e=new Mn(3);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function vM(e){var t=new Mn(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function vk(e){var t=e[0],r=e[1],i=e[2];return Math.sqrt(t*t+r*r+i*i)}function vS(e,t,r){var i=new Mn(3);return i[0]=e,i[1]=t,i[2]=r,i}function vE(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function vD(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function vC(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function vI(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e}function vL(e,t){var r=t[0],i=t[1],n=t[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function vP(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function vz(e,t,r){var i=t[0],n=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=n*l-a*s,e[1]=a*o-i*l,e[2]=i*s-n*o,e}function vF(e,t,r){var i=r[0],n=r[1],a=r[2],o=r[3],s=t[0],l=t[1],u=t[2],c=n*u-a*l,h=a*s-i*u,d=i*l-n*s;return c+=c,h+=h,d+=d,e[0]=s+o*c+n*d-a*h,e[1]=l+o*h+a*c-i*d,e[2]=u+o*d+i*h-n*c,e}function vO(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function vR(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function vB(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function vj(e,t,r,i){var n=new Mn(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function vN(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function vV(e,t,r){var i=t[0],n=t[1],a=t[2],o=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,e}function vU(){var e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function vq(e,t,r,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",a=Math.PI/360;t*=a,i*=a,r*=a;var o=Math.sin(t),s=Math.cos(t),l=Math.sin(r),u=Math.cos(r),c=Math.sin(i),h=Math.cos(i);switch(n){case"xyz":e[0]=o*u*h+s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h-o*l*c;break;case"xzy":e[0]=o*u*h-s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h+o*l*c;break;case"yxz":e[0]=o*u*h+s*l*c,e[1]=s*l*h-o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h+o*l*c;break;case"yzx":e[0]=o*u*h+s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h-o*l*c;break;case"zxy":e[0]=o*u*h-s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c+o*l*h,e[3]=s*u*h-o*l*c;break;case"zyx":e[0]=o*u*h-s*l*c,e[1]=s*l*h+o*u*c,e[2]=s*u*c-o*l*h,e[3]=s*u*h+o*l*c;break;default:throw Error("Unknown angle order "+n)}return e}function vG(){var e=new Mn(2);return Mn!=Float32Array&&(e[0]=0,e[1]=0),e}function vH(e,t){var r=new Mn(2);return r[0]=e,r[1]=t,r}function v$(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function vW(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function vY(e){var t=e[0],r=e[1];return t*t+r*r}function vZ(e){return e[0]=0,e[1]=0,e}function vX(e,t,r){return t*(Md/(e.tileSize*2**(r-e.tileID.overscaledZ)))}function vK(e){return e instanceof Error?e:Error("string"==typeof e?e:String(e))}function vJ(){return new Float64Array(4)}function vQ(){return new Float64Array(3)}function v0(){return new Float64Array(16)}function v1(){let e=new Float64Array(16);return vp(e),e}function v2(){let e=new Float32Array(16);return vp(e),e}function v3(e,t,r,i,n=!1){if(!r[0]&&!r[1])return[0,0];let a=n?"map"===i?-e.bearingInRadians:0:"viewport"===i?e.bearingInRadians:0;if(a){let e=Math.sin(a),t=Math.cos(a);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}return[n?r[0]:vX(t,r[0],e.zoom),n?r[1]:vX(t,r[1],e.zoom)]}function v5(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]}function v4(e,t,r){var i,n,a,o,s,l,u,c,h,d;let f=(n=(i=[e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2]])[0],a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],c=i[6],h=i[7],n*((d=i[8])*l-u*h)+a*(-d*s+u*c)+o*(h*s-l*c));if(0===f)return null;let p=vz([],[t[0],t[1],t[2]],[r[0],r[1],r[2]]),m=vz([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),g=vz([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),y=vC([],p,-e[3]);return vE(y,y,vC([],m,-t[3])),vE(y,y,vC([],g,-r[3])),vC(y,y,1/f),y}function v6(e,t,r,i){let n=Math.sqrt(e*e+t*t),a=Math.sqrt(r*r+i*i);e/=n,t/=n;let o=Math.acos(e*(r/=a)+t*(i/=a));return-t*r+e*i>0?o:-o}function v8(e,t){let r=(e%360+360)%360,i=(t%360+360)%360,n=i-r,a=i>r?n-360:n+360;return Math.abs(n)=1)return 1;let r=e;for(let i=0;i<8;i++){let i=((o*r+a)*r+n)*r-e;if(Math.abs(i)Math.abs(c))break;r-=i/c}let i=0,c=1;r=e;for(let s=0;s<20;s++){let s=((o*r+a)*r+n)*r;if(Math.abs(s-e)s?i=r:c=r,r=(i+c)*.5}return((u*r+l)*r+s)*r}}function xt(e,t,r){return Math.min(r,Math.max(t,e))}function xr(e,t,r){let i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function xi(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}function xn(e,t){let r={};for(let i of t)i in e&&(r[i]=e[i]);return r}function xa(e){return 2**e}function xo(e){return Math.log(e)/Math.LN2}function xs(e,t,r){if(t<=0)return e;let i=1/t;return void 0===r||1e-10>Math.abs(r)?Math.round(e*i)/i:(r>0?Math.ceil(e*i-1e-9):Math.floor(e*i+1e-10))/i}function xl(e,t,r){let i={};for(let n in e)i[n]=t.call(r||this,e[n],n,e);return i}function xu(e,t,r){let i={};for(let n in e)t.call(r||this,e[n],n,e)&&(i[n]=e[n]);return i}function xc(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;rtypeof console&&console.warn(e),Mm[e]=!0)}function xf(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function xp(e){return"u">typeof WorkerGlobalScope&&void 0!==e&&e instanceof WorkerGlobalScope}function xm(e){return"u">typeof ImageBitmap&&e instanceof ImageBitmap}function xg(e,t,r,i){return e.addEventListener(t,r,i),{unsubscribe:()=>{e.removeEventListener(t,r,i)}}}function xy(e){return e*Math.PI/180}function xv(e){return e/Math.PI*180}function xx(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing}function xb(e,t,r){let i=vH(t.x-r.x,t.y-r.y),n=vH(e.x-r.x,e.y-r.y);return xv(Math.atan2(i[0]*n[1]-i[1]*n[0],i[0]*n[0]+i[1]*n[1]))}function x_(e,t,r){let i=new Float64Array(4);return vq(i,e,t-90,r),i}function xw(e){return e instanceof Error&&"AbortError"===e.name}function xT(e){if(e.aborted)throw new Mw(e.reason)}function xA(e){return MT.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}function xM(e,t){MT.REGISTERED_PROTOCOLS[e]=t}function xk(e){delete MT.REGISTERED_PROTOCOLS[e]}function xS(){var e;if(xp(self))return null==(e=self.worker)?void 0:e.referrer;if("blob:"===window.location.protocol)try{return window.parent.location.href}catch{}return window.location.href}function xE(e){if(!e||e.startsWith("data:image/"))return!0;if(e.startsWith("blob:")&&(e=e.slice(5)).startsWith("null"))return!1;if(0>=e.indexOf("://"))return!0;let t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function xD(e,t,r){var i;null!=(i=r[e])&&i.includes(t)||(r[e]||(r[e]=[]),r[e].push(t))}function xC(e,t,r){if(r?.[e]){let i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}function xI(e,t){return{kind:"array",itemType:e,N:t}}function xL(e){if("array"===e.kind){let t=xL(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}function xP(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!xP(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(let e of MQ)if(!xP(e,t))return null}}return`Expected ${xL(e)} but found ${xL(t)} instead.`}function xz(e,t){return t.some(t=>t.kind===e.kind)}function xF(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)}function xO(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}function xR(e){return(e%=360)<0&&(e+=360),e}function xB([e,t,r,i]){e=xj(e);let n,a,o=xN((.2225045*e+.7168786*(t=xj(t))+.0606169*(r=xj(r)))/1);e===t&&t===r?n=a=o:(n=xN((.4360747*e+.3850649*t+.1430804*r)/M0),a=xN((.0139322*e+.0971045*t+.7141733*r)/M1));let s=116*o-16;return[s<0?0:s,500*(n-o),200*(o-a),i]}function xj(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function xN(e){return e>.008856451679035631?e**.3333333333333333:e/M5+M2}function xV([e,t,r,i]){let n=(e+16)/116,a=isNaN(t)?n:n+t/500,o=isNaN(r)?n:n-r/200;return n=+xq(n),[xU(3.1338561*(a=M0*xq(a))-1.6168667*n-.4906146*(o=M1*xq(o))),xU(-.9787684*a+1.9161415*n+.033454*o),xU(.0719453*a-.2289914*n+1.4052427*o),i]}function xU(e){return(e=e<=.00304?12.92*e:1.055*e**.4166666666666667-.055)<0?0:e>1?1:e}function xq(e){return e>M3?e*e*e:M5*(e-M2)}function xG(e,t){return M8(e,t)?e[t]:void 0}function xH(e){return parseInt(e.padEnd(2,e),16)/255}function x$(e,t){return xW(t?e/100:e,0,1)}function xW(e,t,r){return Math.min(Math.max(t,e),r)}function xY(e){return!e.some(Number.isNaN)}function xZ(e,t,r){return e+r*(t-e)}function xX(e,t,r){return e.map((e,i)=>e+r*(t[i]-e))}function xK(e,t,r,i){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function xJ(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof kh||e instanceof ke||e instanceof kd||e instanceof ki||e instanceof kn||e instanceof ka||e instanceof ko||e instanceof ku||e instanceof kc)return!0;if(Array.isArray(e)){for(let t of e)if(!xJ(t))return!1;return!0}if("object"==typeof e){for(let t in e)if(!xJ(e[t]))return!1;return!0}return!1}function xQ(e){if(null===e)return MR;if("string"==typeof e)return Mj;if("boolean"==typeof e)return MN;if("number"==typeof e)return MB;if(e instanceof ke)return MV;if(e instanceof kh)return MU;if(e instanceof kd)return M$;if(e instanceof ki)return MW;if(e instanceof kn)return MY;if(e instanceof ka)return MX;if(e instanceof ko)return MZ;if(e instanceof ku)return MJ;if(e instanceof kc)return MK;if(Array.isArray(e)){let t=e.length,r;for(let t of e){let e=xQ(t);if(r){if(r===e)continue;r=MG;break}r=e}return xI(r||MG,t)}return Mq}function x0(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof ke||e instanceof kh||e instanceof ki||e instanceof kn||e instanceof ka||e instanceof ko||e instanceof ku||e instanceof kc?e.toString():JSON.stringify(e)}function x1(e,t,r){let i=e.length-1,n=0,a=i,o=0,s,l;for(;n<=a;)if(s=e[o=Math.floor((n+a)/2)],l=e[o+1],s<=t){if(o===i||tt)a=o-1;else throw new ks("Input is not a number.",r);return 0}function x2(e,t,r,i){let n=i-r,a=e-r;return 0===n?0:1===t?a/n:(t**a-1)/(t**n-1)}function x3(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function x5(e,t){if(e.length<=1)return[e];let r=[],i,n;for(let t of e){let e=function(e){let t=0;for(let r=0,i=e.length,n=i-1,a,o;r1)for(let e=0;et)}){for(;n>i;){if(n-i>600){let o=n-i+1,s=r-i+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-s*u/o+c)),Math.min(n,Math.floor(r+(o-s)*u/o+c)),a)}let o=t[r],s=i,l=n;for(x3(t,i,r),a(t[n],o)>0&&x3(t,i,n);sa(t[s],o);)s++;for(;a(t[l],o)>0;)l--}0===a(t[i],o)?x3(t,i,l):x3(t,++l,n),l<=r&&(i=l+1),r<=l&&(n=l-1)}}(r[e],t,1,r[e].length-1,x4),r[e]=r[e].slice(0,t));return r}function x4(e,t){return t.area-e.area}function x6(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 x8(e,t,r){return t===r}function x7(e,t,r){return t!==r}function x9(e,t,r){return tr}function bt(e,t,r){return t<=r}function br(e,t,r){return t>=r}function bi(e,t,r,i){return 0===i.compare(t,r)}function bn(e,t,r,i){return!bi(e,t,r,i)}function ba(e,t,r,i){return 0>i.compare(t,r)}function bo(e,t,r,i){return i.compare(t,r)>0}function bs(e,t,r,i){return 0>=i.compare(t,r)}function bl(e,t,r,i){return i.compare(t,r)>=0}function bu(e,t,r){let i="=="!==e&&"!="!==e;return class n{constructor(e,t,r,i){this.lhs=e,this.rhs=t,this.key=r,this.collator=i,this.type=MN,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.");let r=e[0],a=t.parse(e[1],1,MG);if(!a)return null;if(!x6(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${xL(a.type)}'.`);let o=t.parse(e[2],2,MG);if(!o)return null;if(!x6(r,o.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${xL(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${xL(a.type)}' and '${xL(o.type)}'.`);i&&("value"===a.type.kind&&"value"!==o.type.kind?a=new k_(o.type,[a],t.key):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new k_(a.type,[o],t.key)));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,M$)))return null}return new n(a,o,t.key,s)}evaluate(n){let a=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){let t=xQ(a),r=xQ(o);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new ks(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let e=xQ(a),r=xQ(o);if("string"!==e.kind||"string"!==r.kind)return t(n,a,o)}return this.collator?r(n,a,o,this.collator.evaluate(n)):t(n,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}function bc(e,t){let r=2**t.z;return[360*((e[0]/kq+t.x)/r)-180,360/Math.PI*Math.atan(Math.exp((180-360*((e[1]/kq+t.y)/r))*Math.PI/180))-90]}function bh(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function bd(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function bf(e,t,r,i){var n,a;let o=[t[0]-e[0],t[1]-e[1]];return 0!=(n=[i[0]-r[0],i[1]-r[1]],n[0]*(a=o)[1]-n[1]*a[0])&&!!(bg(e,t,r,i)&&bg(r,i,e,t))}function bp(e,t,r=!1){let i=!1;for(let o of t)for(let t=0;te[1]!=a[1]>e[1]&&e[0]<(a[0]-n[0])*(e[1]-n[1])/(a[1]-n[1])+n[0]&&(i=!i)}return i}function bm(e,t){for(let r of e)if(!bp(r,t))return!1;for(let r=0;r0&&h<0||c<0&&h>0}function by(e,t,r){let i=[];for(let n=0;nr[2]){let t=.5*i,n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}bh(t,e)}function bb(e,t,r,i){let n=2**i.z*kq,a=[i.x*kq,i.y*kq],o=[];for(let i of e)for(let e of i){let i=[e.x+a[0],e.y+a[1]];bx(i,t,r,n),o.push(i)}return o}function b_(e,t,r,i){let n=2**i.z*kq,a=[i.x*kq,i.y*kq],o=[];for(let r of e){let e=[];for(let i of r){let r=[i.x+a[0],i.y+a[1]];bh(t,r),e.push(r)}o.push(e)}if(t[2]-t[0]<=n/2){for(let e of(t[0]=t[1]=1/0,t[2]=t[3]=-1/0,o))for(let i of e)bx(i,t,r,n)}return o}function bw(e,t){return t[0]-e[0]}function bT(e){return e[1]-e[0]+1}function bA(e,t){return e[1]>=e[0]&&e[1]e[1])return[null,null];let r=bT(e);if(t){if(2===r)return[e,null];let t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];let i=Math.floor(r/2)-1;return[[e[0],e[0]+i],[e[0]+i+1,e[1]]]}function bk(e,t){if(!bA(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=t[0];i<=t[1];++i)bh(r,e[i]);return r}function bS(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let e of r)bh(t,e);return t}function bE(e){return -1/0!==e[0]&&-1/0!==e[1]&&1/0!==e[2]&&1/0!==e[3]}function bD(e,t,r){if(!bE(e)||!bE(t))return 0/0;let i=0,n=0;return e[2]t[2]&&(i=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]0;){let n=o.pop();if(n[0]>=a)continue;let l=n[1],u=t?50:100;if(bT(l)<=u){if(!bA(l,e.length))return 0/0;if(t){let t=function(e,t,r,i){if(!bA(t,e.length))return 0/0;for(let i=t[0];i<=t[1];++i)if(bp(e[i],r,!0))return 0;let n=1/0;for(let a=t[0];a0;){let a=s.pop();if(a[0]>=o)continue;let l=a[1],u=a[2],c=t?50:100,h=i?50:100;if(bT(l)<=c&&bT(u)<=h){if(!bA(l,e.length)&&bA(u,r.length))return 0/0;if(t&&i)o=Math.min(o,function(e,t,r,i,n){if(!(bA(t,e.length)&&bA(i,r.length)))return 1/0;let a=1/0;for(let o=t[0];o({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}function bB(e,[t,r,i,n],a){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);let o=n?n.evaluate(e):1,s=xK(t,r,i,o);if(s)throw new ks(s,a);return new ke(t/255,r/255,i/255,o,!1)}function bj(e,t){return e in t&&void 0!==t[e]}function bN(e,t){let r=t[e];return void 0===r?null:r}function bV(e){return{type:e}}function bU(e){if(e instanceof kM)return bU(e.boundExpression);if(e instanceof k1&&"error"===e.name||e instanceof kj||e instanceof kG||e instanceof kY||e instanceof kX)return!1;let t=e instanceof kT||e instanceof k_,r=!0;return e.eachChild(e=>{r&&(r=t?bU(e):e instanceof kf)}),!!r&&bq(e)&&bH(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function bq(e){if(e instanceof k1&&("get"===e.name&&1===e.args.length||"feature-state"===e.name||"has"===e.name&&1===e.args.length||"properties"===e.name||"geometry-type"===e.name||"id"===e.name||/^filter-/.test(e.name))||e instanceof kG||e instanceof kY)return!1;let t=!0;return e.eachChild(e=>{t&&!bq(e)&&(t=!1)}),t}function bG(e){if(e instanceof k1&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!bG(e)&&(t=!1)}),t}function bH(e,t){if(e instanceof k1&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!bH(e,t)&&(r=!1)}),r}function b$(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function bW(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function bY(e){return!!e.expression&&e.expression.interpolated}function bZ(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}function bX(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function bK(e){return"object"==typeof e&&!!e&&!Array.isArray(e)&&xQ(e)===Mq}function bJ(e){return e}function bQ(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function b0(e,t,r,i,n){return bQ(typeof r===n?i[r]:void 0,e.default,t.default)}function b1(e,t,r){if("number"!==bX(r))return bQ(e.default,t.default);let i=e.stops.length;if(1===i||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let n=x1(e.stops.map(e=>e[0]),r,"");return e.stops[n][1]}function b2(e,t,r){var i,n,a;let o,s,l=void 0===e.base?1:e.base;if("number"!==bX(r))return bQ(e.default,t.default);let u=e.stops.length;if(1===u||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[u-1][0])return e.stops[u-1][1];let c=x1(e.stops.map(e=>e[0]),r,""),h=(i=r,n=l,a=e.stops[c][0],o=e.stops[c+1][0]-a,s=i-a,0===o?0:1===n?s/o:(n**s-1)/(n**o-1)),d=e.stops[c][1],f=e.stops[c+1][1],p=kv[t.type]||bJ;return"function"==typeof d.evaluate?{evaluate(...t){let r=d.evaluate.apply(void 0,t),i=f.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return p(r,i,h,e.colorSpace)}}:p(d,f,h,e.colorSpace)}function b3(e,t,r){switch(t.type){case"color":r=ke.parse(r);break;case"formatted":r=ki.fromString(r.toString());break;case"resolvedImage":r=kc.fromString(r.toString());break;case"padding":r=kn.parse(r);break;case"colorArray":r=ko.parse(r);break;case"numberArray":r=ka.parse(r);break;default:bX(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return bQ(r,e.default,t.default)}function b5(e){return{result:"success",value:e}}function b4(e){return{result:"error",value:e}}function b6(e,t,r,i){return`${e}${t}: ${r}${null==i?"":` Falling back to ${String(i)}.`}`}function b8(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function b7(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in kK}function b9(e,t,r,i){var n;let a;b8(t);let o=new k0(kK,bU,[],r?(n=r,a={color:MV,string:Mj,number:MB,enum:Mj,boolean:MN,formatted:MW,padding:MY,numberArray:MX,colorArray:MZ,projectionDefinition:MU,resolvedImage:MK,variableAnchorOffsetCollection:MJ},"array"===n.type?xI(a[n.value]||MG,n.length):a[n.type]):void 0),s=o.parse(e,void 0,void 0,void 0,r&&"string"===r.type?{typeAnnotation:"coerce"}:void 0);return s?b5(new k3(s,t,r,i)):b4(o.errors)}function _e(e,t,r,i){let n=b9(e,t,r,i);if("error"===n.result)return n;let a=n.value.expression,o=bq(a);if(!o&&!b$(r))return b4([new kJ("","data expressions not supported")]);let s=bH(a,["zoom"]);if(!s&&!bW(r))return b4([new kJ("","zoom expressions not supported")]);let l=function e(t){let r=null;if(t instanceof kA)r=e(t.result);else if(t instanceof kL){for(let i of t.args)if(r=e(i))break}else(t instanceof kg||t instanceof ky)&&t.input instanceof k1&&"zoom"===t.input.name&&(r=t);return r instanceof kJ||t.eachChild(t=>{let i=e(t);i instanceof kJ?r=i:!r&&i?r=new kJ("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&i&&r!==i&&(r=new kJ("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}(a);if(!l&&!s)return b4([new kJ("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof kJ)return b4([l]);if(l instanceof ky&&!bY(r))return b4([new kJ("",'"interpolate" expressions cannot be used with this property')]);if(!l)return b5(o?new k5("constant",n.value,i):new k5("source",n.value,i));let u=l instanceof ky?l.interpolation:void 0;return b5(o?new k4("camera",n.value,l.labels,u,i):new k4("composite",n.value,l.labels,u,i))}function _t(e,t=new Set){return e instanceof kX&&t.add(e.key),e.eachChild(e=>{_t(e,t)}),t}function _r(e){if("color"===e.type&&bK(e.default))return new ke(0,0,0,0);switch(e.type){case"color":return ke.parse(e.default)||null;case"padding":return kn.parse(e.default)||null;case"numberArray":return ka.parse(e.default)||null;case"colorArray":return ko.parse(e.default)||null;case"variableAnchorOffsetCollection":return ku.parse(e.default)||null;case"projectionDefinition":return kh.parse(e.default)||null;default:return void 0===e.default?null:e.default}}function _i(e,t){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:o,accumulated:s}=e??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:o,accumulated:s,globalState:t}}function _n(e){return"legacy"!==function e(t){if("boolean"==typeof t)return"neutral";if(!Array.isArray(t)||0===t.length)return"legacy";switch(t[0]){case"has":return t.length<2||"$id"===t[1]||"$type"===t[1]?"legacy":2===t.length?"neutral":"expression";case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":case"none":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"any":case"all":var r=t.slice(1);let i=!1;for(let t of r){let r=e(t);if("expression"===r)return"expression";"legacy"===r&&(i=!0)}return i?"legacy":"neutral";default:return"expression"}}(e)}function _a(e){return"$type"===e?["geometry-type"]:"$id"===e?["id"]:["get",e]}function _o(e){if(("<"===e[0]||"<="===e[0]||">"===e[0]||">="===e[0])&&"$type"===e[1])return`"$type" cannot be use with operator "${e[0]}"`;let t=function(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return 3!==e.length||"string"!=typeof e[1]?null:[e[0],_a(e[1]),e[2]];case"in":case"!in":{if(e.length<2||"string"!=typeof e[1])return null;let t=["in",_a(e[1]),["literal",e.slice(2)]];return"!in"===e[0]?["!",t]:t}case"has":case"!has":{if(2!==e.length||"string"!=typeof e[1]||"$type"===e[1]||"$id"===e[1])return null;let t=["has",e[1]];return"!has"===e[0]?["!",t]:t}default:return null}}(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function _s(e,t,r){let i=r[e];return Array.isArray(i)?_n(i)?_l(i,t.concat(e)):{path:t.concat(e),legacyFilter:i}:null}function _l(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let r=1;r!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};_n(e)?function(e,t){let r=_l(e);if(!r||typeof console>"u")return;let i=r.path.map(e=>`[${e}]`).join("");console.warn(`${t}${i}: ${_o(r.legacyFilter)}`)}(e,t):e=function e(t){if(!t)return!0;let r=t[0];return t.length<=1?"any"!==r:"=="===r?_h(t[1],t[2],"=="):"!="===r?_p(_h(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?_h(t[1],t[2],r):"any"===r?["any"].concat(t.slice(1).map(e)):"all"===r?["all"].concat(t.slice(1).map(e)):"none"===r?["all"].concat(t.slice(1).map(e).map(_p)):"in"===r?_d(t[1],t.slice(2)):"!in"===r?_p(_d(t[1],t.slice(2))):"has"===r?_f(t[1]):"!has"!==r||_p(_f(t[1]))}(e);let i=b9(e,t,k8,r);if("error"===i.result)throw Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,r)=>i.value.evaluate(e,t,{},r),needGeometry:function e(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let r=1;r_t(i.value.expression)}}function _c(e,t){return et)}function _h(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function _d(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(_c)]]:["filter-in-small",e,["literal",t]]}}function _f(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function _p(e){return["!",e]}function _m(e){let t=e.key,r=e.value;return r?[new MO(t,r,"constants have been deprecated as of v8")]:[]}function _g(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function _y(e){if(Array.isArray(e))return e.map(_y);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=_y(e[r]);return t}return _g(e)}function _v(e){let t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,l=[],u=bX(r);if("object"!==u)return[new MO(t,r,`object expected, ${u} found`)];for(let e in r){let u=e.split(".")[0],c=xG(i,u)||i["*"],h;if(xG(n,u))h=n[u];else if(xG(i,u)){if(void 0===r[e])continue;h=s}else if(n["*"])h=n["*"];else if(i["*"])h=s;else{l.push(new MO(t,r[e],`unknown property "${e}"`));continue}l=l.concat(h({key:(t&&`${t}.`)+e,value:r[e],valueSpec:c,style:a,styleSpec:o,object:r,objectKey:e,validateSpec:s},r))}for(let e in i)n[e]||i[e].required&&void 0===i[e].default&&void 0===r[e]&&l.push(new MO(t,r,`missing required property "${e}"`));return l}function _x(e){let t=e.value,r=e.valueSpec,i=e.validateSpec,n=e.style,a=e.styleSpec,o=e.key,s=e.arrayElementValidator||i;if("array"!==bX(t))return[new MO(o,t,`array expected, ${bX(t)} found`)];if(r.length&&t.length!==r.length)return[new MO(o,t,`array length ${r.length} expected, length ${t.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),"object"===bX(r.value)&&(l=r.value);let u=[];for(let r=0;ri.maximum?[new MO(t,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new MO(t,r,`number expected, ${n} found`)]}function __(e){let t=e.valueSpec,r=_g(e.value.type),i,n={},a,o,s="categorical"!==r&&void 0===e.value.property,l="array"===bX(e.value.stops)&&"array"===bX(e.value.stops[0])&&"object"===bX(e.value.stops[0][0]),u=_v({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new MO(e.key,e.value,'identity function may not have a "stops" property')];let t=[],i=e.value;return t=t.concat(_x({key:e.key,value:i,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:c})),"array"===bX(i)&&0===i.length&&t.push(new MO(e.key,i,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&s&&u.push(new MO(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||u.push(new MO(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!bY(e.valueSpec)&&u.push(new MO(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(s||b$(e.valueSpec)?s&&!bW(e.valueSpec)&&u.push(new MO(e.key,e.value,"zoom functions not supported")):u.push(new MO(e.key,e.value,"property functions not supported"))),("categorical"===r||l)&&void 0===e.value.property&&u.push(new MO(e.key,e.value,'"property" property is required')),u;function c(e){let r=[],i=e.value,s=e.key;if("array"!==bX(i))return[new MO(s,i,`array expected, ${bX(i)} found`)];if(2!==i.length)return[new MO(s,i,`array length 2 expected, length ${i.length} found`)];if(l){if("object"!==bX(i[0]))return[new MO(s,i,`object expected, ${bX(i[0])} found`)];if(void 0===i[0].zoom)return[new MO(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new MO(s,i,"object stop key must have value")];if(o&&o>_g(i[0].zoom))return[new MO(s,i[0].zoom,"stop zoom values must appear in ascending order")];_g(i[0].zoom)!==o&&(o=_g(i[0].zoom),a=void 0,n={}),r=r.concat(_v({key:`${s}[0]`,value:i[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:_b,value:h}}))}else r=r.concat(h({key:`${s}[0]`,value:i[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},i));return b7(_y(i[1]))?r.concat([new MO(`${s}[1]`,i[1],"expressions are not allowed in function stops.")]):r.concat(e.validateSpec({key:`${s}[1]`,value:i[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function h(e,o){let s=bX(e.value),l=_g(e.value),u=null===e.value?o:e.value;if(i){if(s!==i)return[new MO(e.key,u,`${s} stop domain type must match previous stop domain type ${i}`)]}else i=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new MO(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==r){let i=`number expected, ${s} found`;return b$(t)&&void 0===r&&(i+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new MO(e.key,u,i)]}return"categorical"!==r||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===s&&void 0!==a&&lnew MO(`${e.key}${t.key}`,e.value,t.message));let r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new MO(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!bG(r))return[new MO(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!bG(r))return[new MO(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!bH(r,["zoom","feature-state"]))return[new MO(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!bq(r))return[new MO(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function _T(e){let t=e.value,r=e.key,i=bX(t);return"boolean"===i?[]:[new MO(r,t,`boolean expected, ${i} found`)]}function _A(e){let t=e.key,r=e.value,i=bX(r);return"string"===i?ke.parse(String(r))?[]:[new MO(t,r,`color expected, "${r}" found`)]:[new MO(t,r,`color expected, ${i} found`)]}function _M(e){let t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(_g(r))&&n.push(new MO(t,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(i.values).indexOf(_g(r))&&n.push(new MO(t,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function _k(e){let t,r=_y(e.value);return _n(r)?[...(t=_l(r))?[new MO(`${e.key}${t.path.map(e=>`[${e}]`).join("")}`,function(e,t){let r=e;for(let e of t)r=r[e];return r}(e.value,t.path),_o(t.legacyFilter),null,"warning")]:[],..._w(bZ({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:function e(t){let r=t.value,i=t.key;if("array"!==bX(r))return[new MO(i,r,`array expected, ${bX(r)} found`)];let n=t.styleSpec,a,o=[];if(r.length<1)return[new MO(i,r,"filter array must have at least 1 element")];switch(o=o.concat(_M({key:`${i}[0]`,value:r[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),_g(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===_g(r[1])&&o.push(new MO(i,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":3!==r.length&&o.push(new MO(i,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&"string"!==(a=bX(r[1]))&&o.push(new MO(`${i}[1]`,r[1],`string expected, ${a} found`));for(let e=2;e{e in n&&i.push(new MO(a,n[e],`"${e}" is prohibited for ref layers`))}),o.layers.forEach(t=>{_g(t.id)===u&&(e=t)}),e?e.ref?i.push(new MO(a,n.ref,"ref cannot reference another ref layer")):l=_g(e.type):i.push(new MO(a,n.ref,`ref layer "${u}" not found`))}else if("background"!==l)if(n.source){let e=o.sources&&o.sources[n.source],t=e&&_g(e.type);e?"vector"===t&&"raster"===l?i.push(new MO(a,n.source,`layer "${n.id}" requires a raster source`)):"raster-dem"!==t&&"hillshade"===l||"raster-dem"!==t&&"color-relief"===l?i.push(new MO(a,n.source,`layer "${n.id}" requires a raster-dem source`)):"raster"===t&&"raster"!==l?i.push(new MO(a,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==t||n["source-layer"]?"raster-dem"===t&&"hillshade"!==l&&"color-relief"!==l?i.push(new MO(a,n.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"===l&&n.paint&&n.paint["line-gradient"]&&("geojson"!==t||!e.lineMetrics)&&i.push(new MO(a,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new MO(a,n,`layer "${n.id}" must specify a "source-layer"`)):i.push(new MO(a,n.source,`source "${n.source}" not found`))}else i.push(new MO(a,n,'missing required property "source"'));return"raster"===l&&null!=(t=n.paint)&&t.resampling&&null!=(r=n.paint)&&r["raster-resampling"]&&i.push(new MO(a,n.paint,`layer "${n.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),i=i.concat(_v({key:a,value:n,valueSpec:s.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${a}.type`,value:n.type,valueSpec:s.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:n,objectKey:"type"}),filter:_k,layout:e=>_v({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>_D(bZ({layerType:l},e))}}),paint:e=>_v({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>_E(bZ({layerType:l},e))}})}}))}function _I(e){let t=e.value,r=e.key,i=bX(t);return"string"===i?[]:[new MO(r,t,`string expected, ${i} found`)]}function _L(e){let t=e.value,r=e.key,i=e.styleSpec,n=e.style,a=e.validateSpec;if(!t.type)return[new MO(r,t,'"type" is required')];let o=_g(t.type),s;switch(o){case"vector":case"raster":return _v({key:r,value:t,valueSpec:i[`source_${o.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:k7,validateSpec:a});case"raster-dem":return function(e){var t;let r=null!=(t=e.sourceName)?t:"",i=e.value,n=e.styleSpec,a=n.source_raster_dem,o=e.style,s=[],l=bX(i);if(void 0===i)return s;if("object"!==l)return s.push(new MO("source_raster_dem",i,`object expected, ${l} found`)),s;let u="custom"===_g(i.encoding),c=["redFactor","greenFactor","blueFactor","baseShift"],h=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let t in i)!u&&c.includes(t)?s.push(new MO(t,i[t],`In "${r}": "${t}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[t]?s=s.concat(e.validateSpec({key:t,value:i[t],valueSpec:a[t],validateSpec:e.validateSpec,style:o,styleSpec:n})):s.push(new MO(t,i[t],`unknown property "${t}"`));return s}({sourceName:r,value:t,style:e.style,styleSpec:i,validateSpec:a});case"geojson":if(s=_v({key:r,value:t,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:k7}),t.cluster)for(let e in t.clusterProperties){let[i,n]=t.clusterProperties[e],o="string"==typeof i?[i,["accumulated"],["get",e]]:i;s.push(..._w({key:`${r}.${e}.map`,value:n,validateSpec:a,expressionContext:"cluster-map"})),s.push(..._w({key:`${r}.${e}.reduce`,value:o,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return _v({key:r,value:t,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return _v({key:r,value:t,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new MO(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return _M({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function _P({key:e,value:t}){if("string"===bX(t))return _I({key:e,value:t});{let r=[];for(let i in t)r.push(..._I({key:`${e}.${i}`,value:t[i]}));return r}}function _z(e){let t=e.value,r=e.styleSpec,i=r.light,n=e.style,a=[],o=bX(t);if(void 0===t)return a;if("object"!==o)return a.concat([new MO("light",t,`object expected, ${o} found`)]);for(let o in t){let s=o.match(k2);a=s&&i[s[1]]&&i[s[1]].transition?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r.transition,validateSpec:e.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:i[o],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new MO(o,t[o],`unknown property "${o}"`)])}return a}function _F(e){let t=e.value,r=e.styleSpec,i=r.sky,n=e.style,a=bX(t);if(void 0===t)return[];if("object"!==a)return[new MO("sky",t,`object expected, ${a} found`)];let o=[];for(let a in t){let s=a.match(k2);o=s&&i[s[1]]&&i[s[1]].transition?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r.transition,style:n,styleSpec:r})):i[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:i[a],style:n,styleSpec:r})):o.concat([new MO(a,t[a],`unknown property "${a}"`)])}return o}function _O(e){let t=e.value,r=e.styleSpec,i=r.terrain,n=e.style,a=[],o=bX(t);if(void 0===t)return a;if("object"!==o)return a.concat([new MO("terrain",t,`object expected, ${o} found`)]);for(let o in t)a=i[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:i[o],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new MO(o,t[o],`unknown property "${o}"`)]);return a}function _R(e){return 0===_I(e).length?[]:_w(e)}function _B(e){return 0===_I(e).length?[]:_w(e)}function _j(e){let t=e.key,r=e.value;if("array"===bX(r)){if(r.length<1||r.length>4)return[new MO(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a[new MO(e,t,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],n=r.match(Se);if(!n)return i();let[,a,o,s]=n;if(void 0!==s)return s.length>6?i():[];let l=parseInt(a,16),u=void 0===o?l:parseInt(o,16);return l>k9||u>k9?[new MO(e,t,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new MO(e,t,`unicode range start must not be greater than its end, but ${r} is`)]:[]}(`${t}.unicode-range[${e}]`,r))}}else l.push(new MO(`${i}.${e}`,t,`string or array expected, ${r} found`))}return l}function _Z(e){let t=e.value,r=e.valueSpec,i=e.styleSpec;return e.validateSpec=_Z,r.expression&&bK(_g(t))?__(e):r.expression&&b7(_y(t))?_w(e):r.type&&St[r.type]?St[r.type](e):_v(bZ({},e,{valueSpec:r.type?i[r.type]:r}))}function _X(e){let t=e.value,r=e.key,i=_I(e);return i.length||(-1===t.indexOf("{fontstack}")&&i.push(new MO(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&i.push(new MO(r,t,'"glyphs" url must include a "{range}" token'))),i}function _K(e,t=Mz){let r=[];return r=r.concat(_Z({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:_Z,objectElementValidators:{glyphs:_X,"*":()=>[]}})),e.constants&&(r=r.concat(_m({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:_Z}))),_Q(r)}function _J(e){return function(t){return e(Object.assign({},t,{validateSpec:_Z}))}}function _Q(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function _0(e){return function(...t){return _Q(e.apply(this,t))}}function _1(e,t){var r;let i=Object.entries(null!=(r=t.sources)?r:{}).filter(([,e])=>!Sa.has(e.type)).map(([e])=>`sources.${e}`);return _2(e,Sn(t).filter(({message:e})=>!i.some(t=>e.startsWith(`${t}:`)||e.startsWith(`${t}.`))))}function _2(e,t){let r=!1;for(let i of t){if("warning"===i.severity){xd(i.message);continue}e.fire(new MI(Error(i.message))),r=!0}return r}function _3(e,t,r,i){return i?.validate!==!1&&_2(e,t(d({styleSpec:Mz},r)))}function _5(e,t,r={}){if(Ss[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Ss[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}function _4(e){var t;return e&&"u">typeof ArrayBuffer&&(e instanceof ArrayBuffer||(null==(t=e.constructor)?void 0:t.name)==="ArrayBuffer")}function _6(e){let t=e.constructor;return e.$name||t._classRegistryKey}function _8(e){return!function(e){if("object"!=typeof e||!e)return!1;let t=_6(e);return t&&"Object"!==t}(e)&&(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||e instanceof Blob||e instanceof Error||_4(e)||xm(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function _7(e,t){if(_8(e))return(_4(e)||xm(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let r=[];for(let i of e)r.push(_7(i,t));return r}if("object"!=typeof e)throw Error(`can't serialize object of type ${typeof e}`);let r=_6(e);if(!r)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!Ss[r])throw Error(`${r} is not registered.`);let{klass:i}=Ss[r],n=i.serialize?i.serialize(e,t):{};if(i.serialize){if(n===t?.[t.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let i in e){if(!e.hasOwnProperty(i)||Ss[r].omit.includes(i))continue;let a=e[i];void 0!==a&&(n[i]=Ss[r].shallow.includes(i)?a:_7(a,t))}e instanceof Error&&(n.message=e.message)}if(n.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(n.$name=r),n}function _9(e){if(_8(e))return e;if(Array.isArray(e))return e.map(_9);if("object"!=typeof e)throw Error(`can't deserialize object of type ${typeof e}`);let t=_6(e)||"Object";if(!Ss[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:r}=Ss[t];if(!r)throw Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);let i=Object.create(r.prototype);for(let r of Object.keys(e)){if("$name"===r)continue;let n=e[r];i[r]=Ss[t].shallow.includes(r)?n:_9(n)}return i}function we(e){if(Array.isArray(e))return e.length;let t=e?.values;return Array.isArray(t)?t.length:void 0}function wt(e,t){let r=we(e),i=we(t);return void 0!==r&&void 0!==i&&r!==i}function wr(e,t=1){let r=0,i=0;return{members:e.map(e=>{let n=SI[e.type].BYTES_PER_ELEMENT,a=r=wi(r,Math.max(t,n)),o=e.components||1;return i=Math.max(i,n),r+=n*o,{name:e.name,type:e.type,components:o,offset:a}}),size:wi(r,Math.max(i,t)),alignment:t}}function wi(e,t){return Math.ceil(e/t)*t}function wn(e,t){return 256*(e=xt(Math.floor(e),0,255))+(t=xt(Math.floor(t),0,255))}function wa(e){let t=+e;return!isNaN(t)&&t<=0x1fffffffffffff?t:(0,EP.default)(String(e))}function wo(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function ws(e){return[wn(255*e.r,255*e.g),wn(255*e.b,255*e.a)]}function wl(e,t,r){var i;let n={color:{source:Sj,composite:S3},number:{source:SJ,composite:Sj}};return(null==(i=({"line-pattern":{source:Ep,composite:Ep},"fill-pattern":{source:Ep,composite:Ep},"fill-extrusion-pattern":{source:Ep,composite:Ep},"line-dasharray":{source:Em,composite:Em}})[e])?void 0:i[r])||n[t][r]}function wu(e){let t=Md/e.extent,r=e.loadGeometry();for(let e of r)for(let r of e){let e=Math.round(r.x*t),i=Math.round(r.y*t);r.x=xt(e,E2,E1),r.y=xt(i,E2,E1),(er.x+1||ir.y+1)&&xd("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function wc(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?wu(e):[]}}function wh(e,t){for(let r of e)if(wv(t,r))return!0;for(let r of t)if(wv(e,r))return!0;return wp(e,t)}function wd(e,t,r){return!!wv(e,t)||wm(t,e,r)}function wf(e,t){if(1===e.length)return wy(t,e[0]);for(let r of t)for(let t of r)if(wv(e,t))return!0;for(let r of e)if(wy(t,r))return!0;for(let r of t)if(wp(e,r))return!0;return!1}function wp(e,t){if(0===e.length||0===t.length)return!1;for(let o=0;o1?e.distSqr(r):e.distSqr(r.sub(t)._mult(n)._add(t))}function wy(e,t){let r=!1,i,n;for(let a of e)for(let e=0,o=a.length-1;et.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(r=!r);return r}function wv(e,t){let r=!1;for(let i=0,n=e.length-1;it.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function wx(e,t,r){let i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function wb(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function w_(e,t,r,i,n){if(!t[0]&&!t[1])return e;let a=vl.convert(t)._mult(n);"viewport"===r&&a._rotate(-i);let o=[];for(let t of e)o.push(t.sub(a));return o}function ww({queryGeometry:e,size:t},r){return wd(e,r,t)}function wT({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return wd(e,a,t*(r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera/r.cameraToCenterDistance))}function wA({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){let o=r.projectTileCoordinates(a.x,a.y,i,n?.(a.x,a.y)).signedDistanceFromCamera,s=t*(r.cameraToCenterDistance/o);return wd(e,wS(a,r,i,n),s)}function wM({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return wd(e,wS(a,r,i,n),t)}function wk({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a="map",pitchScale:o="map"},s){let l="map"===a?"map"===o?ww:wT:"map"===o?wA:wM,u={queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n};for(let e of s)for(let t of e)if(l(u,t))return!0;return!1}function wS(e,t,r,i){let n=t.projectTileCoordinates(e.x,e.y,r,i?.(e.x,e.y)).point;return new vl((.5*n.x+.5)*t.width,(-(.5*n.y)+.5)*t.height)}function wE(e,{width:t,height:r},i,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${t*r*i}`)}else n=new Uint8Array(t*r*i);return e.width=t,e.height=r,e.data=n,e}function wD(e,{width:t,height:r},i){if(t===e.width&&r===e.height)return;let n=wE({},{width:t,height:r},i);wC(e,n,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},i),e.width=t,e.height=r,e.data=n.data}function wC(e,t,r,i,n,a){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw RangeError("out of range destination coordinates for image copy");let o=e.data,s=t.data;if(o===s)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l{t[e.evaluationKey]=o;let s=e.expression.evaluate(t);n.setPixel(i/4/r,a/4,s)};if(e.clips)for(let t=0,n=0;t0)for(let n=t;n=t;n-=i)a=wJ(n/i|0,e[n],e[n+1],a);return a&&wW(a,a.next)&&(wQ(a),a=a.next),a}function wB(e,t=e){let r=t===e,i=e,n;do n=!1,i!==i.next&&(0===Dx.size||!Dx.has(i))&&(wW(i,i.next)||0===w$(i.prev,i,i.next))?((r||i===t)&&(t=i.prev),Db=!0,wQ(i),i=i.prev,n=!0):(r||i!==t)&&(i=i.next,n=!r);while(n||i!==t);return t}function wj(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function wN(e,t){let r=e;do{let e=DT++;DA[e]=r;let i=1/0,n=1/0,a=-1/0,o=-1/0,s=0;do{let t=r.next;r.z=e,r.xa&&(a=r.x),r.yo&&(o=r.y),t.xa&&(a=t.x),t.yo&&(o=t.y),r=t}while(++s<16&&r!==t);DM[e]=r;let l=4*e;Dw[l]=i,Dw[l+1]=n,Dw[l+2]=a,Dw[l+3]=o}while(r!==t)}function wV(e){let t=DM[e];for(;t.prev.next!==t;)t=t.next;return DM[e]=t,t}function wU(e){let t=DA[e];for(;t.prev.next!==t;)t=t.next;return DA[e]=t,t}function wq(e,t,r,i,n,a){DC.fill(0);for(let t=0;t>>a&255]++;let o=0;for(let e=0;e<256;e++){let t=DC[e];DC[e]=o,o+=t}for(let o=0;o>>a&255]++;i[s]=t[o],n[s]=e}}function wG(e,t,r,i,n){return(e=((e=((e=((e=((e=(e-r)*n|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-i)*n|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function wH(e,t,r,i,n,a,o,s){return(n-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(i-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(n-o)*(i-s)}function w$(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function wW(e,t){return e.x===t.x&&e.y===t.y}function wY(e,t,r,i,n=!0){let a=w$(e,t,r),o=w$(e,t,i),s=w$(r,i,e),l=w$(r,i,t);return(a>0&&o<0||a<0&&o>0)&&(s>0&&l<0||s<0&&l>0)||!!n&&!!(0===a&&wZ(e,r,t)||0===o&&wZ(e,i,t)||0===s&&wZ(r,e,i)||0===l&&wZ(r,t,i))}function wZ(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function wX(e,t){return 0>w$(e.prev,e,e.next)?w$(e,t,e.next)>=0&&w$(e,e.prev,t)>=0:0>w$(e,t,e.prev)||0>w$(e,e.next,t)}function wK(e,t){let r=w0(e.i,e.x,e.y),i=w0(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function wJ(e,t,r,i){let n=w0(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function wQ(e){var t,r;let i;e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),D_&&(t=e.prev,r=e.next,i=4*t.z,r.xDw[i+2]&&(Dw[i+2]=r.x),r.y>Dw[i+3]&&(Dw[i+3]=r.y))}function w0(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function w1(e,t,r,i=!0){return new DO(r,t).subdividePolygonInternal(e,i)}function w2(e,t,r=!1){if(!e||e.length<1||e.length<2)return[];let i=e[0],n=e[e.length-1],a=r&&(i.x!==n.x||i.y!==n.y);if(t<2)return a?[...e,e[0]]:[...e];let o=Math.floor(Md/t),s=[];s.push(new vl(e[0].x,e[0].y));let l=e.length,u=a?l:l-1;for(let t=0;t0?(Math.floor(y/o)+1)*o:(Math.ceil(y/o)-1)*o,t=p>0?(Math.floor(v/o)+1)*o:(Math.ceil(v/o)-1)*o,r=Math.abs(y-e),i=Math.abs(v-t),n=Math.abs(v-c),a=h?r/m:1/0,l=d?i/g:1/0;if((Math.abs(y-u)<=r||!h)&&(n<=i||!d))break;if(aEE.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=s.count,m=!0,g=!0,y=!0,c=0);let x=w5(o,i,a,s,d,m,u),b=w5(o,i,a,s,f,g,u),_=w5(o,i,a,s,p,y,u);r.emplaceBack(c+x-l,c+b-l,c+_-l),u.primitiveLength++}})(t,r,i,n,a,e),c&&function(e,t,r,i,n,a){let o=[];for(let e=0;eEE.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=s.count,p=!0,m=!0,c=0);let y=w5(o,i,a,s,d,p,u),v=w5(o,i,a,s,f,m,u);r.emplaceBack(c+y-l,c+v-l),u.primitiveLength++}}(o,r,s,n,l,e),t.forceNewSegmentOnNextPrepare(),o?.forceNewSegmentOnNextPrepare()}function w5(e,t,r,i,n,a,o){if(a){let a=i.count;return r(t[2*n],t[2*n+1]),e[n]=i.count,i.count++,o.vertexLength++,a}return e[n]}function w4(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function w6(e){return e.every(e=>e.x<0)||e.every(e=>e.x>8192)||e.every(e=>e.y<0)||e.every(e=>e.y>8192)}function w8(e){let t=e.length;if(t<=1)return[e];let r=[],i,n;for(let a=0;a(function(e,t){if(!e||e.length<3)return e;let r=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,i=r?e.length-1:e.length;if(i<3)return e;let n=[];for(let r=0;rMath.cos(5*Math.PI/180))return e.push(r.clone());let c=Math.min(n,.2*s,.2*l),h=r.add(a.mult(c)),d=r.add(o.mult(c)),f=Math.sqrt((1+u)/2),p=r.add(a.add(o)._unit()._mult(c/f)),m=h.sub(p).angleWith(d.sub(p)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let t=0;t<=g;t++)e.push(h.rotateAround(t/g*m,p))}(n,a,o,s,t)}let a=function(e){let t=[];for(let r of e){let e=r.round(),i=t[t.length-1];(i?.x!==e.x||i?.y!==e.y)&&t.push(e)}for(;t.length>1&&t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y;)t.pop();return t}(n);return a.length<3?e:(r&&a.push(a[0].clone()),a)})(e,o))}function Th(e,t,r,i,n,a,o,s){e.emplaceBack(t,r,2*Math.floor(i*D2)+o,n*D2*2,a*D2*2,Math.round(s))}function Td(e,t){return e.x*t.x+e.y*t.y}function Tf(e,t){if(1===e.length){let r=0,i=t[r++],n;for(;!n||i.equals(n);)if(!(n=t[r++]))return 1/0;for(;r=0&&(t=r[e],/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(t)||RegExp("^\\p{gc=Mc}","u").test(i))?r[e]+=i:r.push(i)}return r}function Ty(e){let t=e.codePointAt(0);return e.length>(t>65535?2:1)}function Tv(e){return/\s/u.test(String.fromCodePoint(e))}function Tx(e){for(let t of e)if(Tp(t.codePointAt(0)))return!0;return!1}function Tb(e){return!(Tp(e)||/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e)))}function T_(e){return RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(e))}function Tw(e){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function TT(e){for(let t of e)if(Tw(t.codePointAt(0)))return!0;return!1}function TA(e,t,r,i,n,a){if("fontStack"in t){let i=r[t.fontStack],a=i?.[e];if(a)return a.metrics.advance*t.scale+n;let o=0;for(let r of e){let e=i?.[r];e&&(o+=e.metrics.advance*t.scale+n)}return o}{let e=i[t.imageName];return e?e.displaySize[0]*t.scale*24/a+n:0}}function TM(e,t,r,i){let n=(e-t)**2;return i?et>0&&te-t),i=[];for(let e=0;e+1e.start))).map(([t,n])=>{var a,o;return function(e,t,r,i,n){let a=function(e,t,r,i){let n=[],a=r;for(let o of Tg(e.slice(r,i)))n.push({index:a,text:o,level:t[a]}),a+=o.length;return n}(e,t,i,n),o=!0;for(let e=a.length-1;e>=0;e--){let t=CC.getBidiCharTypeName(a[e].text[0]);CP.has(t)?(a[e].level=r,o=!0):o&&CL.has(t)?a[e].level=r:o=!1}let s="",l=[];for(let e of function(e,t){let r=t,i=1/0;for(let{level:t}of e)t>r&&(r=t),(1|t)=i;e--)for(let t=0;t=e;)r++;for(let e=t,i=r;et>=e.start&&t<=e.end))?void 0:a.level)?o:0,t,n)})}function TD(e,t,r){1===e&&r.readMessage(TC,t)}function TC(e,t,r){if(3===e){let{id:e,bitmap:i,width:n,height:a,left:o,top:s,advance:l}=r.readMessage(TI,{});t.push({id:e,bitmap:new Dr({width:n+6,height:a+6},i),metrics:{width:n,height:a,left:o,top:s,advance:l}})}}function TI(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function TL(e){return"function"==typeof e?.renderWithWebGL}function TP(e){let t=0,r=0;for(let i of e)t+=i.w*i.h,r=Math.max(r,i.w);e.sort((e,t)=>t.h-e.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],n=0,a=0;for(let t of e)for(let e=i.length-1;e>=0;e--){let r=i[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,a=Math.max(a,t.y+t.h),n=Math.max(n,t.x+t.w),t.w===r.w&&t.h===r.h){let t=i.pop();t&&e=r;e--)t.push(e);r=i+1}else{for(let e=r;ei[e]),t,a.map(e=>{var t;return null!=(t=r[n[e]])?t:0}))}function TR(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p){let m=CD.fromFeature(e,n);2===h&&m.verticalizePunctuation();let g=m.determineLineBreaks(u,a,t,i,f),y=TT(m.text)?function(e,t){var r;let i=t.map(t=>e.toCodeUnitIndex(t)),n=Cy.isParsed()?Cy:null;if(1===e.sections.length)return n?n.processBidirectionalText(e.toString(),i).map(t=>TO(t,e.sections,[...t].map(()=>0))):TE(e.toString(),i).map(e=>e.text).map(t=>Tz([...t],e.sections,[...t].map(()=>0)));let a=function(e){let t=[],r=0;for(let i of e.graphemes())t.push(...Array(i.length).fill(e.sectionIndex[r])),r++;return t}(e);return n?n.processStyledBidirectionalText(e.text,a,i).map(([t,r])=>TO(t,e.sections,r)):(r=e.text,TE(r,i).map(e=>[e.text,e.sourceIndices.map(e=>{var t;return null!=(t=a[e])?t:0})])).map(([t,r])=>{let i=[...t];return Tz(i,e.sections,TF(i).map(e=>{var t;return null!=(t=r[e])?t:0}))})}(m,g):function(e,t){let r=[],i=0;for(let n of t)r.push(e.substring(i,n)),i=n;return ie.codePointAt(0)),i=r.map(Tp),n=t=>!i[t]&&!Tv(r[t])&&!("imageName"in e.getSection(t));for(let e=0;eTN(e)||/[\p{P}\p{S}]/u.test(String.fromCodePoint(e))),r=e.length<=3&&e.every(e=>TV(e)||TN(e));return t||r}(r.slice(e,t+1)))for(let n=e;n<=t;n++){var a;i[n]=(TN(a=r[n])||TV(a))&&!T_(a)}e=t}return function(e,t){let r=!1;for(let i=0;ih){let e=Math.ceil(a/h);n*=e/o,o=e}return{x1:i,y1:n,x2:i+a,y2:n+o}}function Tq(e,t,r,i,n,a){let o=e.image,s;if(o.content){let e=o.content,t=o.pixelRatio||1;s=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}let l=t.left*a,u=t.right*a,c,h,d,f;"width"===r||"both"===r?(f=n[0]+l-i[3],h=n[0]+u+i[1]):h=(f=n[0]+(l+u-o.displaySize[0])/2)+o.displaySize[0];let p=t.top*a,m=t.bottom*a;return"height"===r||"both"===r?(c=n[1]+p-i[0],d=n[1]+m+i[2]):d=(c=n[1]+(p+m-o.displaySize[1])/2)+o.displaySize[1],{image:o,top:c,right:h,bottom:d,left:f,collisionPadding:s}}function TG(e,t){let{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Su(e+1))};if("source"===r.kind)return{kind:"source"};if("composite"===r.kind){let{minZoom:t,maxZoom:i}=function(e,t){let r=0;for(;ri.evaluate(new Su(-1/0===e?i.zoomStops[1]-1:e))),n=r.evaluate(new Su(e+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:t,layoutSize:n,interpolationType:r.interpolationType}}}function TH(e,{uSize:t,uSizeT:r},{lowerSize:i,upperSize:n}){return"source"===e.kind?i/128:"composite"===e.kind?kv.number(i/128,n/128,r):t}function T$(e,t){let r=0,i=0;return"constant"===e.kind?i=e.layoutSize:"camera"===e.kind?i=function({zoomStops:e,sizes:t,layoutSize:r,interpolationType:i},n){let a=e.length-1;for(;a>0&&e[a]>n;)a--;let o=Math.min(a+1,e.length-1),s=i?xt(ky.interpolationFactor(i,n,e[a],e[o]),0,1):0;return Math.min(kv.number(t[a],t[o],s),r)}(e,t):"composite"===e.kind&&(r=function({interpolationType:e,minZoom:t,maxZoom:r},i){return e?xt(ky.interpolationFactor(e,i,t,r),0,1):0}(e,t)),{uSizeT:r,uSize:i}}function TW(e,t,r,i,n){if(void 0===t.segment||0===r)return!0;let a=t,o=t.segment+1,s=0;for(;s>-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;let l=[],u=0;for(;si;)u-=l.shift().angleDelta;if(u>n)return!1;o++,s+=r.dist(a)}return!0}function TY(e){let t=0;for(let r=0;r=i&&u.x>=i)&&(l.x>=i?l=new vl(i,l.y+(u.y-l.y)*((i-l.x)/(u.x-l.x)))._round():u.x>=i&&(u=new vl(i,l.y+(u.y-l.y)*((i-l.x)/(u.x-l.x)))._round()),l.y>=n&&u.y>=n||(l.y>=n?l=new vl(l.x+(u.x-l.x)*((n-l.y)/(u.y-l.y)),n)._round():u.y>=n&&(u=new vl(l.x+(u.x-l.x)*((n-l.y)/(u.y-l.y)),n)._round()),e&&l.equals(e[e.length-1])||(e=[l],a.push(e)),e.push(u)))))}}return a}function TK(e,t,r,i){let n=[],a=e.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},c=a.stretchX||[[0,s]],h=a.stretchY||[[0,l]],d=(e,t)=>e+t[1]-t[0],f=c.reduce(d,0),p=h.reduce(d,0),m=s-f,g=l-p,y=0,v=f,x=0,b=p,_=0,w=m,T=0,A=g;if(a.content&&i){let t=a.content,r=t[2]-t[0],i=t[3]-t[1];(a.textFitWidth||a.textFitHeight)&&(u=TU(e)),y=TJ(c,0,t[0]),x=TJ(h,0,t[1]),v=TJ(c,t[0],t[2]),b=TJ(h,t[1],t[3]),_=t[0]-y,T=t[1]-x,w=r-v,A=i-b}let M=u.x1,k=u.y1,S=u.x2-M,E=u.y2-k,D=(e,i,n,s)=>{var l,u,c,h,d,m,g,D,C,I,L,P,z,F,O,R;let B=(l=e.stretch-y,l/v*S+M),j=(u=e.fixed-_,c=w,h=e.stretch,u-c*h/f),N=(d=i.stretch-x,d/b*E+k),V=(m=i.fixed-T,g=A,D=i.stretch,m-g*D/p),U=(C=n.stretch-y,C/v*S+M),q=(I=n.fixed-_,L=w,P=n.stretch,I-L*P/f),G=(z=s.stretch-x,z/b*E+k),H=(F=s.fixed-T,O=A,R=s.stretch,F-O*R/p),$=new vl(B,N),W=new vl(U,N),Y=new vl(U,G),Z=new vl(B,G),X=new vl(j/o,V/o),K=new vl(q/o,H/o),J=t*Math.PI/180;if(J){let e=Math.sin(J),t=Math.cos(J),r=[t,-e,e,t];$._matMult(r),W._matMult(r),Z._matMult(r),Y._matMult(r)}let Q=e.stretch+e.fixed,ee=n.stretch+n.fixed,et=i.stretch+i.fixed,er=s.stretch+s.fixed;return{tl:$,tr:W,bl:Z,br:Y,tex:{x:a.paddedRect.x+1+Q,y:a.paddedRect.y+1+et,w:ee-Q,h:er-et},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:X,pixelOffsetBR:K,minFontScaleX:w/o/S,minFontScaleY:A/o/E,isSDF:r}};if(i&&(a.stretchX||a.stretchY)){let e=TQ(c,m,f),t=TQ(h,g,p);for(let r=0;r24*e);i.startsWith("top")?n[1]-=7:i.startsWith("bottom")&&(n[1]+=7),t[r+1]=n}return new ku(t)}let o=n.get("text-variable-anchor");if(o){let i;i=void 0===e._unevaluatedLayout.getValue("text-radial-offset")?n.get("text-offset").evaluate(t,{},r).map(e=>24*e):[24*n.get("text-radial-offset").evaluate(t,{},r),C$];let a=[];for(let e of o)a.push(e,T1(e,i));return new ku(a)}return null}function T3(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 T5(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m){let g=function(e,t,r,i,n,a,o){let s=r.layout.get("text-rotate").evaluate(n,{})*Math.PI/180,l=[];for(let r of e.positionedLines)for(let n of r.positionedGlyphs){if(!n.rect)continue;let u=n.rect||{},c=4,h=!0,d=1,f=0,p=(i||o)&&n.vertical,m=n.metrics.advance*n.scale/2;if(o&&e.verticalizable){let e=(n.scale-1)*24,t=(24-n.metrics.width*n.scale)/2;f=r.lineOffset/2-(n.imageName?-t:e)}if(n.imageName){let e=a[n.imageName];h=e.sdf,c=1/(d=e.pixelRatio)}let g=i?[n.x+m,n.y]:[0,0],y=i?[0,0]:[n.x+m+t[0],n.y+t[1]-f],v=[0,0];p&&(v=y,y=[0,0]);let x=n.metrics.isDoubleResolution?2:1,b=(n.metrics.left-c)*n.scale-m+y[0],_=(-n.metrics.top-c)*n.scale+y[1],w=b+u.w/x*n.scale/d,T=_+u.h/x*n.scale/d,A=new vl(b,_),M=new vl(w,_),k=new vl(b,T),S=new vl(w,T);if(p){let e=new vl(-m,m- -17),t=-Math.PI/2,r=12-m,i=n.imageName?r:0,a=new vl(22-r,-i),o=new vl(...v);A._rotateAround(t,e)._add(a)._add(o),M._rotateAround(t,e)._add(a)._add(o),k._rotateAround(t,e)._add(a)._add(o),S._rotateAround(t,e)._add(a)._add(o)}if(s){let e=Math.sin(s),t=Math.cos(s),r=[t,-e,e,t];A._matMult(r),M._matMult(r),k._matMult(r),S._matMult(r)}let E=new vl(0,0),D=new vl(0,0);l.push({tl:A,tr:M,bl:k,br:S,tex:u,writingMode:e.writingMode,glyphOffset:g,sectionIndex:n.sectionIndex,isSDF:h,pixelOffsetTL:E,pixelOffsetBR:D,minFontScaleX:0,minFontScaleY:0})}return l}(r,s,n,a,o,i,e.allowVerticalPlacement),y=e.textSizeData,v=null;for(let r of("source"===y.kind?(v=[128*n.layout.get("text-size").evaluate(o,{})])[0]>32640&&xd(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`):"composite"===y.kind&&((v=[128*p.compositeTextSizes[0].evaluate(o,{},m),128*p.compositeTextSizes[1].evaluate(o,{},m)])[0]>32640||v[1]>32640)&&xd(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`),e.addSymbols(e.text,g,v,s,a,o,c,t,u.lineStartIndex,u.lineLength,f,m,l),h))d[r]=e.text.placedSymbolArray.length-1;return 4*g.length}function T4(e){for(let t in e)return e[t];return null}function T6(e,t,r){let i="never",n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}function T8(e,t,r,i,n,a,o,s,l,u,c,h,d,f){let p=s?Math.min(CN,Math.round(s[0])):0,m=s?Math.min(CN,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*i),Math.round(32*n),a,o,(p<<1)+ +!!l,m,16*u,16*c,256*h,256*d,f)}function T7(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function T9(e,t){if("custom"===e.type)return new C7(e,t);switch(e.type){case"background":return new C6(e,t);case"circle":return new E7(e,t);case"color-relief":return new Dg(e,t);case"fill":return new DU(e,t);case"fill-extrusion":return new D7(e,t);case"heatmap":return new Do(e,t);case"hillshade":return new Dc(e,t);case"line":return new Ch(e,t);case"raster":return new SC(e,t);case"symbol":return new C2(e,t)}}function Ae(e,t){let{x:r,y:i}=D0.fromLngLat(t);return!(e<0||e>25||i<0||i>=1||r<0||r>=1)}function At(e,t,r,i,n){(e*=2)<0&&(e=-1*e-1);let a=1<>>2),exceptionSizes:new Int32Array(33)}}function Aa(e,t,r){let i=new Uint32Array(r),n=0,a=t.get();for(let t=0;t=64)throw Error("Varint too long")}return t.set(n),r}(e,t);return i}function As(e){return e>>>1^-(1&e)}function Al(e){return e>>BigInt("1")^-(e&BigInt("1"))}function Au(e){return e%2==1?-((e+1)/2):e/2}function Ac(e,t,r){if(void 0===r){r=0;for(let i=0;i=4)for(;i=4)for(;i=4)for(let i=e[0];r=4)for(;l>>0;for(let r=1;r>>0;return t}function Ax(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,Al(e[0]));for(let r=1;r>4],n={};switch(i){case ID.DATA:n={dictionaryType:IO[15&r]};break;case ID.OFFSET:n={offsetType:IR[15&r]};break;case ID.LENGTH:n={lengthType:IB[15&r]}}t.increment();let a=e[t.get()],o=Iz[a>>5],s=Iz[a>>2&7],l=IF[3&a];t.increment();let u=Aa(e,t,2),c=u[0];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:o,logicalLevelTechnique2:s,physicalLevelTechnique:l,numValues:c,byteLength:u[1],decompressedCount:c}}(e,t);return o.logicalLevelTechnique1===Iw.MORTON?(r=o,n=Aa(e,t,2),{physicalStreamType:r.physicalStreamType,logicalStreamType:r.logicalStreamType,logicalLevelTechnique1:r.logicalLevelTechnique1,logicalLevelTechnique2:r.logicalLevelTechnique2,physicalLevelTechnique:r.physicalLevelTechnique,numValues:r.numValues,byteLength:r.byteLength,decompressedCount:r.decompressedCount,numBits:n[0],coordinateShift:n[1]}):(Iw.RLE===o.logicalLevelTechnique1||Iw.RLE===o.logicalLevelTechnique2)&&IT.NONE!==o.physicalLevelTechnique?(i=o,a=Aa(e,t,2),{physicalStreamType:i.physicalStreamType,logicalStreamType:i.logicalStreamType,logicalLevelTechnique1:i.logicalLevelTechnique1,logicalLevelTechnique2:i.logicalLevelTechnique2,physicalLevelTechnique:i.physicalLevelTechnique,numValues:i.numValues,byteLength:i.byteLength,decompressedCount:a[1],runs:a[0],numRleValues:a[1]}):o}function A_(e,t,r){if(!t)return e;let i=t.size(),n=new e.constructor(i),a=0;for(let o=0;o=o);){let r=e[i.increment()];if(r<=127){let o=r+3,s=e[i.increment()],l=Math.min(a+o,t);n.fill(s,a,l),a=l}else{let o=256-r;for(let r=0;r=12?IV.decode(e.subarray(t,r)):function(e,t,r){let i="",n=t;for(;n239?4:s>223?3:s>191?2:1;if(n+u>r)break;1===u?s<128&&(l=s):2===u?(192&(t=e[n+1]))==128&&(l=(31&s)<<6|63&t)<=127&&(l=null):3===u?(t=e[n+1],a=e[n+2],(192&t)==128&&(192&a)==128&&((l=(15&s)<<12|(63&t)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(t=e[n+1],a=e[n+2],o=e[n+3],(192&t)==128&&(192&a)==128&&(192&o)==128&&((l=(15&s)<<18|(63&t)<<12|(63&a)<<6|63&o)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=u}return i}(e,t,r)}function AS(e,t,r,i,n){let a;var o=AC(e,t,r),s=r,l=i,u=n;switch(s.logicalLevelTechnique1){case Iw.DELTA:if(s.logicalLevelTechnique2===Iw.RLE){if(!u)return function(e,t,r){let i=new Int32Array(r),n=0,a=0;for(let r=0;r=4)for(;i>>0,t[1]=As(e[1])>>>0;for(let r=2;r>>0,t[r+1]=t[r-1]+As(e[r+1])>>>0;return t}(e);break;case Iw.NONE:n=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return i?A_(n,i,0):n}(AC(e,t,r),r,i,n)}function AD(e,t,r){return function(e,t){if(t.logicalLevelTechnique1===Iw.DELTA&&t.logicalLevelTechnique2===Iw.NONE){let t=new Int32Array(e.length+1);t[0]=0,t[1]=As(e[0]);let r=t[1];for(let i=2;i!==t.length;++i)r+=As(e[i-1]),t[i]=t[i-1]+r;return new Uint32Array(t)}if(t.logicalLevelTechnique1===Iw.RLE&&t.logicalLevelTechnique2===Iw.NONE)return function(e,t,r){let i=new Uint32Array(r+1);i[0]=0;let n=1,a=i[0];for(let r=0;r>>2,s=function(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let r=new Uint32Array(Math.max(16,2*t));return e.encodedWords=r,r}(n,o);!function(e,t,r,i){if(t<0||r<0||t+r>e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${t}, byteLength=${r}, bytes.length=${e.length})`);let n=Math.floor(r/4),a=r%4!=0,o=a?n+1:n;if(i.length0){let r=e.byteOffset+t;if(3&r)for(let r=0;r>>0;return((255&t)<<24|(65280&t)<<8|t>>>8&65280|t>>>24&255)>>>0}(t[e])}}if(a){let a=t+4*n,o=r-4*n,s=0;for(let t=0;t0){let t=0|e[i];if(i=i+1|0,255&t)throw Error(`FastPFOR decode: invalid alignedLength=${t} (expected multiple of 256)`);if(n+t>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${t}, out.length=${a.length})`);i=function(e,t,r,i,n,a){let o=i+(n-n%256),s=i,l=r;for(;s!==o;){let r=Math.min(IS,o-s);l=function(e,t,r,i,n,a){let o=0|r,s=0|e[o];if(s<=0||o+s>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${s} at pageStart=${o} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let l=o+s|0,u=e[l]>>>0,c=u+3>>>2,h=l+1,d=h+c;if(d>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${u} (metaInts=${c}, pageStart=${o}, packedEnd=${l}, byteContainerStart=${h}) causes bitmapPos=${d} out of bounds (encoded.length=${e.length})`);let f=function(e,t,r,i){i.byteContainer.length>>2;if(3&n.byteOffset)for(let r=0;r>>8&255,n[a+2|0]=i>>>16&255,n[a+3|0]=i>>>24&255}else{let r=i.byteContainerI32;(!r||r.buffer!==n.buffer||r.byteOffset!==n.byteOffset||r.length>>2)),r.set(e.subarray(t,t+a))}let o=3&r;if(o>0){let r=0|e[t+a|0],i=a<<2;for(let e=0;e>>(e<<3)&255}return n}(e,h,u,a),p=function(e,t,r){let i=0|e[t++],n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let o=e[t++]>>>0,s=function(e){var t;return(t=e+31)-t%32}(o),l=o*a+31>>>5;if(t+l>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${o}, streamWordIndex=${t}, needWords=${l}, availableWords=${e.length-t}, encodedWords=${e.length})`);let u=n[a];(!u||u.length>>0,s=e[t+1]>>>0,r[a++]=o>>>0&3,r[a++]=o>>>2&3,r[a++]=o>>>4&3,r[a++]=o>>>6&3,r[a++]=o>>>8&3,r[a++]=o>>>10&3,r[a++]=o>>>12&3,r[a++]=o>>>14&3,r[a++]=o>>>16&3,r[a++]=o>>>18&3,r[a++]=o>>>20&3,r[a++]=o>>>22&3,r[a++]=o>>>24&3,r[a++]=o>>>26&3,r[a++]=o>>>28&3,r[a++]=o>>>30&3,r[a++]=s>>>0&3,r[a++]=s>>>2&3,r[a++]=s>>>4&3,r[a++]=s>>>6&3,r[a++]=s>>>8&3,r[a++]=s>>>10&3,r[a++]=s>>>12&3,r[a++]=s>>>14&3,r[a++]=s>>>16&3,r[a++]=s>>>18&3,r[a++]=s>>>20&3,r[a++]=s>>>22&3,r[a++]=s>>>24&3,r[a++]=s>>>26&3,r[a++]=s>>>28&3,r[a]=s>>>30&3;return;case 3:let l,u,c,h;l=i,u=e[t]>>>0,c=e[t+1]>>>0,h=e[t+2]>>>0,r[l++]=u>>>0&7,r[l++]=u>>>3&7,r[l++]=u>>>6&7,r[l++]=u>>>9&7,r[l++]=u>>>12&7,r[l++]=u>>>15&7,r[l++]=u>>>18&7,r[l++]=u>>>21&7,r[l++]=u>>>24&7,r[l++]=u>>>27&7,r[l++]=(u>>>30|(1&c)<<2)&7,r[l++]=c>>>1&7,r[l++]=c>>>4&7,r[l++]=c>>>7&7,r[l++]=c>>>10&7,r[l++]=c>>>13&7,r[l++]=c>>>16&7,r[l++]=c>>>19&7,r[l++]=c>>>22&7,r[l++]=c>>>25&7,r[l++]=c>>>28&7,r[l++]=(c>>>31|(3&h)<<1)&7,r[l++]=h>>>2&7,r[l++]=h>>>5&7,r[l++]=h>>>8&7,r[l++]=h>>>11&7,r[l++]=h>>>14&7,r[l++]=h>>>17&7,r[l++]=h>>>20&7,r[l++]=h>>>23&7,r[l++]=h>>>26&7,r[l]=h>>>29&7;return;case 4:let d,f,p,m,g;d=i,f=e[t]>>>0,p=e[t+1]>>>0,m=e[t+2]>>>0,g=e[t+3]>>>0,r[d++]=f>>>0&15,r[d++]=f>>>4&15,r[d++]=f>>>8&15,r[d++]=f>>>12&15,r[d++]=f>>>16&15,r[d++]=f>>>20&15,r[d++]=f>>>24&15,r[d++]=f>>>28&15,r[d++]=p>>>0&15,r[d++]=p>>>4&15,r[d++]=p>>>8&15,r[d++]=p>>>12&15,r[d++]=p>>>16&15,r[d++]=p>>>20&15,r[d++]=p>>>24&15,r[d++]=p>>>28&15,r[d++]=m>>>0&15,r[d++]=m>>>4&15,r[d++]=m>>>8&15,r[d++]=m>>>12&15,r[d++]=m>>>16&15,r[d++]=m>>>20&15,r[d++]=m>>>24&15,r[d++]=m>>>28&15,r[d++]=g>>>0&15,r[d++]=g>>>4&15,r[d++]=g>>>8&15,r[d++]=g>>>12&15,r[d++]=g>>>16&15,r[d++]=g>>>20&15,r[d++]=g>>>24&15,r[d]=g>>>28&15;return;case 5:let y,v,x,b,_,w;y=i,v=e[t]>>>0,x=e[t+1]>>>0,b=e[t+2]>>>0,_=e[t+3]>>>0,w=e[t+4]>>>0,r[y++]=v>>>0&31,r[y++]=v>>>5&31,r[y++]=v>>>10&31,r[y++]=v>>>15&31,r[y++]=v>>>20&31,r[y++]=v>>>25&31,r[y++]=(v>>>30|(7&x)<<2)&31,r[y++]=x>>>3&31,r[y++]=x>>>8&31,r[y++]=x>>>13&31,r[y++]=x>>>18&31,r[y++]=x>>>23&31,r[y++]=(x>>>28|(1&b)<<4)&31,r[y++]=b>>>1&31,r[y++]=b>>>6&31,r[y++]=b>>>11&31,r[y++]=b>>>16&31,r[y++]=b>>>21&31,r[y++]=b>>>26&31,r[y++]=(b>>>31|(15&_)<<1)&31,r[y++]=_>>>4&31,r[y++]=_>>>9&31,r[y++]=_>>>14&31,r[y++]=_>>>19&31,r[y++]=_>>>24&31,r[y++]=(_>>>29|(3&w)<<3)&31,r[y++]=w>>>2&31,r[y++]=w>>>7&31,r[y++]=w>>>12&31,r[y++]=w>>>17&31,r[y++]=w>>>22&31,r[y]=w>>>27&31;return;case 6:let T,A,M,k,S,E,D;T=i,A=e[t]>>>0,M=e[t+1]>>>0,k=e[t+2]>>>0,S=e[t+3]>>>0,E=e[t+4]>>>0,D=e[t+5]>>>0,r[T++]=A>>>0&63,r[T++]=A>>>6&63,r[T++]=A>>>12&63,r[T++]=A>>>18&63,r[T++]=A>>>24&63,r[T++]=(A>>>30|(15&M)<<2)&63,r[T++]=M>>>4&63,r[T++]=M>>>10&63,r[T++]=M>>>16&63,r[T++]=M>>>22&63,r[T++]=(M>>>28|(3&k)<<4)&63,r[T++]=k>>>2&63,r[T++]=k>>>8&63,r[T++]=k>>>14&63,r[T++]=k>>>20&63,r[T++]=k>>>26&63,r[T++]=S>>>0&63,r[T++]=S>>>6&63,r[T++]=S>>>12&63,r[T++]=S>>>18&63,r[T++]=S>>>24&63,r[T++]=(S>>>30|(15&E)<<2)&63,r[T++]=E>>>4&63,r[T++]=E>>>10&63,r[T++]=E>>>16&63,r[T++]=E>>>22&63,r[T++]=(E>>>28|(3&D)<<4)&63,r[T++]=D>>>2&63,r[T++]=D>>>8&63,r[T++]=D>>>14&63,r[T++]=D>>>20&63,r[T]=D>>>26&63;return;case 7:let C,I,L,P,z,F,O,R;C=i,I=e[t]>>>0,L=e[t+1]>>>0,P=e[t+2]>>>0,z=e[t+3]>>>0,F=e[t+4]>>>0,O=e[t+5]>>>0,R=e[t+6]>>>0,r[C++]=I>>>0&127,r[C++]=I>>>7&127,r[C++]=I>>>14&127,r[C++]=I>>>21&127,r[C++]=(I>>>28|(7&L)<<4)&127,r[C++]=L>>>3&127,r[C++]=L>>>10&127,r[C++]=L>>>17&127,r[C++]=L>>>24&127,r[C++]=(L>>>31|(63&P)<<1)&127,r[C++]=P>>>6&127,r[C++]=P>>>13&127,r[C++]=P>>>20&127,r[C++]=(P>>>27|(3&z)<<5)&127,r[C++]=z>>>2&127,r[C++]=z>>>9&127,r[C++]=z>>>16&127,r[C++]=z>>>23&127,r[C++]=(z>>>30|(31&F)<<2)&127,r[C++]=F>>>5&127,r[C++]=F>>>12&127,r[C++]=F>>>19&127,r[C++]=(F>>>26|(1&O)<<6)&127,r[C++]=O>>>1&127,r[C++]=O>>>8&127,r[C++]=O>>>15&127,r[C++]=O>>>22&127,r[C++]=(O>>>29|(15&R)<<3)&127,r[C++]=R>>>4&127,r[C++]=R>>>11&127,r[C++]=R>>>18&127,r[C]=R>>>25&127;return;case 8:let B,j,N,V,U,q,G,H,$;B=i,j=e[t]>>>0,N=e[t+1]>>>0,V=e[t+2]>>>0,U=e[t+3]>>>0,q=e[t+4]>>>0,G=e[t+5]>>>0,H=e[t+6]>>>0,$=e[t+7]>>>0,r[B++]=j>>>0&255,r[B++]=j>>>8&255,r[B++]=j>>>16&255,r[B++]=j>>>24&255,r[B++]=N>>>0&255,r[B++]=N>>>8&255,r[B++]=N>>>16&255,r[B++]=N>>>24&255,r[B++]=V>>>0&255,r[B++]=V>>>8&255,r[B++]=V>>>16&255,r[B++]=V>>>24&255,r[B++]=U>>>0&255,r[B++]=U>>>8&255,r[B++]=U>>>16&255,r[B++]=U>>>24&255,r[B++]=q>>>0&255,r[B++]=q>>>8&255,r[B++]=q>>>16&255,r[B++]=q>>>24&255,r[B++]=G>>>0&255,r[B++]=G>>>8&255,r[B++]=G>>>16&255,r[B++]=G>>>24&255,r[B++]=H>>>0&255,r[B++]=H>>>8&255,r[B++]=H>>>16&255,r[B++]=H>>>24&255,r[B++]=$>>>0&255,r[B++]=$>>>8&255,r[B++]=$>>>16&255,r[B]=$>>>24&255;return;case 9:let W,Y,Z,X,K,J,Q,ee,et,er;W=i,Y=e[t]>>>0,Z=e[t+1]>>>0,X=e[t+2]>>>0,K=e[t+3]>>>0,J=e[t+4]>>>0,Q=e[t+5]>>>0,ee=e[t+6]>>>0,et=e[t+7]>>>0,er=e[t+8]>>>0,r[W++]=Y>>>0&511,r[W++]=Y>>>9&511,r[W++]=Y>>>18&511,r[W++]=(Y>>>27|(15&Z)<<5)&511,r[W++]=Z>>>4&511,r[W++]=Z>>>13&511,r[W++]=Z>>>22&511,r[W++]=(Z>>>31|(255&X)<<1)&511,r[W++]=X>>>8&511,r[W++]=X>>>17&511,r[W++]=(X>>>26|(7&K)<<6)&511,r[W++]=K>>>3&511,r[W++]=K>>>12&511,r[W++]=K>>>21&511,r[W++]=(K>>>30|(127&J)<<2)&511,r[W++]=J>>>7&511,r[W++]=J>>>16&511,r[W++]=(J>>>25|(3&Q)<<7)&511,r[W++]=Q>>>2&511,r[W++]=Q>>>11&511,r[W++]=Q>>>20&511,r[W++]=(Q>>>29|(63&ee)<<3)&511,r[W++]=ee>>>6&511,r[W++]=ee>>>15&511,r[W++]=(ee>>>24|(1&et)<<8)&511,r[W++]=et>>>1&511,r[W++]=et>>>10&511,r[W++]=et>>>19&511,r[W++]=(et>>>28|(31&er)<<4)&511,r[W++]=er>>>5&511,r[W++]=er>>>14&511,r[W]=er>>>23&511;return;case 10:let ei,en,ea,eo,es,el,eu,ec,eh,ed,ef;ei=i,en=e[t]>>>0,ea=e[t+1]>>>0,eo=e[t+2]>>>0,es=e[t+3]>>>0,el=e[t+4]>>>0,eu=e[t+5]>>>0,ec=e[t+6]>>>0,eh=e[t+7]>>>0,ed=e[t+8]>>>0,ef=e[t+9]>>>0,r[ei++]=en>>>0&1023,r[ei++]=en>>>10&1023,r[ei++]=en>>>20&1023,r[ei++]=(en>>>30|(255&ea)<<2)&1023,r[ei++]=ea>>>8&1023,r[ei++]=ea>>>18&1023,r[ei++]=(ea>>>28|(63&eo)<<4)&1023,r[ei++]=eo>>>6&1023,r[ei++]=eo>>>16&1023,r[ei++]=(eo>>>26|(15&es)<<6)&1023,r[ei++]=es>>>4&1023,r[ei++]=es>>>14&1023,r[ei++]=(es>>>24|(3&el)<<8)&1023,r[ei++]=el>>>2&1023,r[ei++]=el>>>12&1023,r[ei++]=el>>>22&1023,r[ei++]=eu>>>0&1023,r[ei++]=eu>>>10&1023,r[ei++]=eu>>>20&1023,r[ei++]=(eu>>>30|(255&ec)<<2)&1023,r[ei++]=ec>>>8&1023,r[ei++]=ec>>>18&1023,r[ei++]=(ec>>>28|(63&eh)<<4)&1023,r[ei++]=eh>>>6&1023,r[ei++]=eh>>>16&1023,r[ei++]=(eh>>>26|(15&ed)<<6)&1023,r[ei++]=ed>>>4&1023,r[ei++]=ed>>>14&1023,r[ei++]=(ed>>>24|(3&ef)<<8)&1023,r[ei++]=ef>>>2&1023,r[ei++]=ef>>>12&1023,r[ei]=ef>>>22&1023;return;case 11:let ep,em,eg,ey,ev,ex,eb,e_,ew,eT,eA,eM;ep=i,em=e[t]>>>0,eg=e[t+1]>>>0,ey=e[t+2]>>>0,ev=e[t+3]>>>0,ex=e[t+4]>>>0,eb=e[t+5]>>>0,e_=e[t+6]>>>0,ew=e[t+7]>>>0,eT=e[t+8]>>>0,eA=e[t+9]>>>0,eM=e[t+10]>>>0,r[ep++]=em>>>0&2047,r[ep++]=em>>>11&2047,r[ep++]=(em>>>22|(1&eg)<<10)&2047,r[ep++]=eg>>>1&2047,r[ep++]=eg>>>12&2047,r[ep++]=(eg>>>23|(3&ey)<<9)&2047,r[ep++]=ey>>>2&2047,r[ep++]=ey>>>13&2047,r[ep++]=(ey>>>24|(7&ev)<<8)&2047,r[ep++]=ev>>>3&2047,r[ep++]=ev>>>14&2047,r[ep++]=(ev>>>25|(15&ex)<<7)&2047,r[ep++]=ex>>>4&2047,r[ep++]=ex>>>15&2047,r[ep++]=(ex>>>26|(31&eb)<<6)&2047,r[ep++]=eb>>>5&2047,r[ep++]=eb>>>16&2047,r[ep++]=(eb>>>27|(63&e_)<<5)&2047,r[ep++]=e_>>>6&2047,r[ep++]=e_>>>17&2047,r[ep++]=(e_>>>28|(127&ew)<<4)&2047,r[ep++]=ew>>>7&2047,r[ep++]=ew>>>18&2047,r[ep++]=(ew>>>29|(255&eT)<<3)&2047,r[ep++]=eT>>>8&2047,r[ep++]=eT>>>19&2047,r[ep++]=(eT>>>30|(511&eA)<<2)&2047,r[ep++]=eA>>>9&2047,r[ep++]=eA>>>20&2047,r[ep++]=(eA>>>31|(1023&eM)<<1)&2047,r[ep++]=eM>>>10&2047,r[ep]=eM>>>21&2047;return;case 12:let ek,eS,eE,eD,eC,eI,eL,eP,ez,eF,eO,eR,eB;ek=i,eS=e[t]>>>0,eE=e[t+1]>>>0,eD=e[t+2]>>>0,eC=e[t+3]>>>0,eI=e[t+4]>>>0,eL=e[t+5]>>>0,eP=e[t+6]>>>0,ez=e[t+7]>>>0,eF=e[t+8]>>>0,eO=e[t+9]>>>0,eR=e[t+10]>>>0,eB=e[t+11]>>>0,r[ek++]=eS>>>0&4095,r[ek++]=eS>>>12&4095,r[ek++]=(eS>>>24|(15&eE)<<8)&4095,r[ek++]=eE>>>4&4095,r[ek++]=eE>>>16&4095,r[ek++]=(eE>>>28|(255&eD)<<4)&4095,r[ek++]=eD>>>8&4095,r[ek++]=eD>>>20&4095,r[ek++]=eC>>>0&4095,r[ek++]=eC>>>12&4095,r[ek++]=(eC>>>24|(15&eI)<<8)&4095,r[ek++]=eI>>>4&4095,r[ek++]=eI>>>16&4095,r[ek++]=(eI>>>28|(255&eL)<<4)&4095,r[ek++]=eL>>>8&4095,r[ek++]=eL>>>20&4095,r[ek++]=eP>>>0&4095,r[ek++]=eP>>>12&4095,r[ek++]=(eP>>>24|(15&ez)<<8)&4095,r[ek++]=ez>>>4&4095,r[ek++]=ez>>>16&4095,r[ek++]=(ez>>>28|(255&eF)<<4)&4095,r[ek++]=eF>>>8&4095,r[ek++]=eF>>>20&4095,r[ek++]=eO>>>0&4095,r[ek++]=eO>>>12&4095,r[ek++]=(eO>>>24|(15&eR)<<8)&4095,r[ek++]=eR>>>4&4095,r[ek++]=eR>>>16&4095,r[ek++]=(eR>>>28|(255&eB)<<4)&4095,r[ek++]=eB>>>8&4095,r[ek]=eB>>>20&4095;return;case 16:let ej,eN,eV,eU,eq,eG,eH,e$,eW,eY,eZ,eX,eK,eJ,eQ,e0,e1;ej=i,eN=e[t]>>>0,eV=e[t+1]>>>0,eU=e[t+2]>>>0,eq=e[t+3]>>>0,eG=e[t+4]>>>0,eH=e[t+5]>>>0,e$=e[t+6]>>>0,eW=e[t+7]>>>0,eY=e[t+8]>>>0,eZ=e[t+9]>>>0,eX=e[t+10]>>>0,eK=e[t+11]>>>0,eJ=e[t+12]>>>0,eQ=e[t+13]>>>0,e0=e[t+14]>>>0,e1=e[t+15]>>>0,r[ej++]=eN>>>0&65535,r[ej++]=eN>>>16&65535,r[ej++]=eV>>>0&65535,r[ej++]=eV>>>16&65535,r[ej++]=eU>>>0&65535,r[ej++]=eU>>>16&65535,r[ej++]=eq>>>0&65535,r[ej++]=eq>>>16&65535,r[ej++]=eG>>>0&65535,r[ej++]=eG>>>16&65535,r[ej++]=eH>>>0&65535,r[ej++]=eH>>>16&65535,r[ej++]=e$>>>0&65535,r[ej++]=e$>>>16&65535,r[ej++]=eW>>>0&65535,r[ej++]=eW>>>16&65535,r[ej++]=eY>>>0&65535,r[ej++]=eY>>>16&65535,r[ej++]=eZ>>>0&65535,r[ej++]=eZ>>>16&65535,r[ej++]=eX>>>0&65535,r[ej++]=eX>>>16&65535,r[ej++]=eK>>>0&65535,r[ej++]=eK>>>16&65535,r[ej++]=eJ>>>0&65535,r[ej++]=eJ>>>16&65535,r[ej++]=eQ>>>0&65535,r[ej++]=eQ>>>16&65535,r[ej++]=e0>>>0&65535,r[ej++]=e0>>>16&65535,r[ej++]=e1>>>0&65535,r[ej]=e1>>>16&65535;return;case 32:for(let n=0;n<32;n=n+1|0)r[i+n|0]=0|e[t+n|0];return}let e2=IM[n]>>>0,e3=t,e5=0,e4=e[e3]>>>0;for(let t=0;t<32;t++)if(e5+n<=32){let a=e4>>>e5&e2;r[i+t]=0|a,32===(e5+=n)&&(e5=0,e3++,31!==t&&(e4=e[e3]>>>0))}else{let a=32-e5,o=(e4>>>e5|((e4=e[++e3]>>>0)&IM[n-a]>>>0)<>>5)|0,r.exceptionSizes[a]=o}return t}(e,d,a);return a.dataPointers.fill(0),function(e,t,r,i,n,a,o,s,l,u){let c=0|r,h=0;for(let t=0;tt)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${t})`);let n=e[r++],a=e[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}(s,l,h,t);h=r.bytePosIn;let i=r.bitWidth,o=r.exceptionCount,d=a+256*t|0;switch(i){case 0:n.fill(0,d,d+256);break;case 32:for(let t=0;t<256;t=t+1|0)n[d+t|0]=0|e[c+t|0];c=c+256|0;break;default:c=function(e,t,r,i,n){switch(n){case 1:let a=i,o=t;for(let t=0;t<8;t++){let t=e[o++]>>>0;r[a++]=t>>>0&1,r[a++]=t>>>1&1,r[a++]=t>>>2&1,r[a++]=t>>>3&1,r[a++]=t>>>4&1,r[a++]=t>>>5&1,r[a++]=t>>>6&1,r[a++]=t>>>7&1,r[a++]=t>>>8&1,r[a++]=t>>>9&1,r[a++]=t>>>10&1,r[a++]=t>>>11&1,r[a++]=t>>>12&1,r[a++]=t>>>13&1,r[a++]=t>>>14&1,r[a++]=t>>>15&1,r[a++]=t>>>16&1,r[a++]=t>>>17&1,r[a++]=t>>>18&1,r[a++]=t>>>19&1,r[a++]=t>>>20&1,r[a++]=t>>>21&1,r[a++]=t>>>22&1,r[a++]=t>>>23&1,r[a++]=t>>>24&1,r[a++]=t>>>25&1,r[a++]=t>>>26&1,r[a++]=t>>>27&1,r[a++]=t>>>28&1,r[a++]=t>>>29&1,r[a++]=t>>>30&1,r[a++]=t>>>31&1}break;case 2:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0;r[n++]=t>>>0&3,r[n++]=t>>>2&3,r[n++]=t>>>4&3,r[n++]=t>>>6&3,r[n++]=t>>>8&3,r[n++]=t>>>10&3,r[n++]=t>>>12&3,r[n++]=t>>>14&3,r[n++]=t>>>16&3,r[n++]=t>>>18&3,r[n++]=t>>>20&3,r[n++]=t>>>22&3,r[n++]=t>>>24&3,r[n++]=t>>>26&3,r[n++]=t>>>28&3,r[n++]=t>>>30&3,r[n++]=i>>>0&3,r[n++]=i>>>2&3,r[n++]=i>>>4&3,r[n++]=i>>>6&3,r[n++]=i>>>8&3,r[n++]=i>>>10&3,r[n++]=i>>>12&3,r[n++]=i>>>14&3,r[n++]=i>>>16&3,r[n++]=i>>>18&3,r[n++]=i>>>20&3,r[n++]=i>>>22&3,r[n++]=i>>>24&3,r[n++]=i>>>26&3,r[n++]=i>>>28&3,r[n++]=i>>>30&3}}(e,t,r,i);break;case 3:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,o=e[a++]>>>0;r[n++]=t>>>0&7,r[n++]=t>>>3&7,r[n++]=t>>>6&7,r[n++]=t>>>9&7,r[n++]=t>>>12&7,r[n++]=t>>>15&7,r[n++]=t>>>18&7,r[n++]=t>>>21&7,r[n++]=t>>>24&7,r[n++]=t>>>27&7,r[n++]=(t>>>30|(1&i)<<2)&7,r[n++]=i>>>1&7,r[n++]=i>>>4&7,r[n++]=i>>>7&7,r[n++]=i>>>10&7,r[n++]=i>>>13&7,r[n++]=i>>>16&7,r[n++]=i>>>19&7,r[n++]=i>>>22&7,r[n++]=i>>>25&7,r[n++]=i>>>28&7,r[n++]=(i>>>31|(3&o)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n++]=o>>>29&7}}(e,t,r,i);break;case 4:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0;r[n++]=t>>>0&15,r[n++]=t>>>4&15,r[n++]=t>>>8&15,r[n++]=t>>>12&15,r[n++]=t>>>16&15,r[n++]=t>>>20&15,r[n++]=t>>>24&15,r[n++]=t>>>28&15,r[n++]=i>>>0&15,r[n++]=i>>>4&15,r[n++]=i>>>8&15,r[n++]=i>>>12&15,r[n++]=i>>>16&15,r[n++]=i>>>20&15,r[n++]=i>>>24&15,r[n++]=i>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15}}(e,t,r,i);break;case 5:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,l=e[a++]>>>0;r[n++]=t>>>0&31,r[n++]=t>>>5&31,r[n++]=t>>>10&31,r[n++]=t>>>15&31,r[n++]=t>>>20&31,r[n++]=t>>>25&31,r[n++]=(t>>>30|(7&i)<<2)&31,r[n++]=i>>>3&31,r[n++]=i>>>8&31,r[n++]=i>>>13&31,r[n++]=i>>>18&31,r[n++]=i>>>23&31,r[n++]=(i>>>28|(1&o)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(15&s)<<1)&31,r[n++]=s>>>4&31,r[n++]=s>>>9&31,r[n++]=s>>>14&31,r[n++]=s>>>19&31,r[n++]=s>>>24&31,r[n++]=(s>>>29|(3&l)<<3)&31,r[n++]=l>>>2&31,r[n++]=l>>>7&31,r[n++]=l>>>12&31,r[n++]=l>>>17&31,r[n++]=l>>>22&31,r[n++]=l>>>27&31}}(e,t,r,i);break;case 6:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0;r[n++]=t>>>0&63,r[n++]=t>>>6&63,r[n++]=t>>>12&63,r[n++]=t>>>18&63,r[n++]=t>>>24&63,r[n++]=(t>>>30|(15&i)<<2)&63,r[n++]=i>>>4&63,r[n++]=i>>>10&63,r[n++]=i>>>16&63,r[n++]=i>>>22&63,r[n++]=(i>>>28|(3&o)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=s>>>0&63,r[n++]=s>>>6&63,r[n++]=s>>>12&63,r[n++]=s>>>18&63,r[n++]=s>>>24&63,r[n++]=(s>>>30|(15&l)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(3&u)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63}}(e,t,r,i);break;case 7:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,c=e[a++]>>>0;r[n++]=t>>>0&127,r[n++]=t>>>7&127,r[n++]=t>>>14&127,r[n++]=t>>>21&127,r[n++]=(t>>>28|(7&i)<<4)&127,r[n++]=i>>>3&127,r[n++]=i>>>10&127,r[n++]=i>>>17&127,r[n++]=i>>>24&127,r[n++]=(i>>>31|(63&o)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(3&s)<<5)&127,r[n++]=s>>>2&127,r[n++]=s>>>9&127,r[n++]=s>>>16&127,r[n++]=s>>>23&127,r[n++]=(s>>>30|(31&l)<<2)&127,r[n++]=l>>>5&127,r[n++]=l>>>12&127,r[n++]=l>>>19&127,r[n++]=(l>>>26|(1&u)<<6)&127,r[n++]=u>>>1&127,r[n++]=u>>>8&127,r[n++]=u>>>15&127,r[n++]=u>>>22&127,r[n++]=(u>>>29|(15&c)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n++]=c>>>25&127}}(e,t,r,i);break;case 8:!function(e,t,r,i){let n=i,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,i=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,c=e[a++]>>>0,h=e[a++]>>>0;r[n++]=t>>>0&255,r[n++]=t>>>8&255,r[n++]=t>>>16&255,r[n++]=t>>>24&255,r[n++]=i>>>0&255,r[n++]=i>>>8&255,r[n++]=i>>>16&255,r[n++]=i>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255}}(e,t,r,i);break;case 16:let s=i,l=t;for(let t=0;t<128;t++){let t=e[l++]>>>0;r[s++]=65535&t,r[s++]=t>>>16&65535}break;default:!function(e,t,r,i,n){let a=IM[n]>>>0,o=t,s=0,l=e[o]>>>0,u=i;for(let t=0;t<8;t++){for(let t=0;t<32;t++)if(s+n<=32){let i=l>>>s&a;r[u+t]=0|i,32===(s+=n)&&(s=0,o++,31!==t&&(l=e[o]>>>0))}else{let i=32-s,c=l>>>s;l=e[++o]>>>0;let h=n-i,d=(c|(l&-1>>>32-h>>>0)<>>0)}}(e,t,r,i,n)}return t+(n<<3)|0}(e,c,n,d,i)}o>0&&(h=function(e,t,r,i,n,a,o,s,l){let{maxBits:u,exceptionBitWidth:c,bytePosIn:h}=function(e,t,r,i,n,a){if(r+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${t})`);let o=e[r++];if(o32)throw Error(`FastPFOR decode: invalid maxBits=${o} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let s=o-i|0;if(s<1||s>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${s} at block=${a} (bitWidth=${i}, maxBits=${o})`);if(r+n>t)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${t-r})`);return{maxBits:o,exceptionBitWidth:s,bytePosIn:r}}(n,a,o,r,i,l);if(o=h,1===c){let a=1<m)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${c} (ptr=${p}, need ${i}, size=${m}) at block ${l}`);for(let a=0;a>>o&255;if(o+=8,s+=o>>>5,o&=31,h|=(127&t)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${d}, partial=${h}, decoded=${u-n}/${a}, inPos=${s}, inEnd=${l})`)}if(u!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${u-n}, expected=${a}, consumedWords=${s-t}/${r}, vbyteStart=${t}, vbyteEnd=${l})`)}(e,i,s,a,n,l),a}(s.subarray(0,o),t,n.decoderWorkspace);return i.add(r),l}(e,n,a=r.byteLength,t,function(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);return{encodedWords:new Uint32Array(Math.max(16,0|e)),decoderWorkspace:An()}}(a>>>2));case IT.VARINT:return Aa(e,t,r.numValues);case IT.NONE:return function(e,t,r){let i=t.get(),n=r*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=new Uint32Array(r);for(let e=0;e>1,t)-r}}function AV(e,t){let r=0;for(let i=0;i>i;return r}function AU(e,t,r,i,n,a,o){return e===I$.MORTON?function(e,t,r,i,n,a){let o=Array(n?i+1:i);for(let n=0;nr?t[a++]:1);return i}function A$(e,t,r,i){let n=new Uint32Array(t[t.length-1]+1),a=0;n[0]=a;let o=1,s=0;for(let l=0;l=r)throw Error("Unexpected end of map value stream");let n=e[t];if(n===I7.FALSE)return{value:!1,nextIndex:t+1};if(n===I7.TRUE)return{value:!0,nextIndex:t+1};if(n===I7.START_MAP){let n=AX(e,t,r);return{value:AY(e,t+2,n,i).value,nextIndex:n}}if(n===I7.START_LIST){let n=AX(e,t,r),a=[],o=t+2;for(;o=r)throw Error("Missing length for nested map/list payload");let i=e[t+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=t+i;if(n>r)throw Error("Nested payload exceeds containing payload bounds");return n}function AK(e,t){let r=e-I7.COUNT;if(r<0||r>=t.length)throw Error(`Scalar dictionary index out of range: ${e}`);return t[r]}function AJ(e,t){for(let r of t)e.push(r)}function AQ(e){return e instanceof IN}function A0(e){switch(e){case I9.ID:case I9.ID|I9.ID_NULLABLE:case I9.ID|I9.ID_LONG:case I9.ID|I9.ID_LONG|I9.ID_NULLABLE:return{nullable:(e&I9.ID_NULLABLE)!=0,columnScope:Iy.FEATURE,type:"scalarType",scalarType:{longID:(e&I9.ID_LONG)!=0,type:"logicalType",logicalType:Ib.ID}};case I9.GEOMETRY:return{nullable:!1,columnScope:Iy.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Ix.GEOMETRY,children:[]}};case I9.STRUCT:return{nullable:!1,columnScope:Iy.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Ix.STRUCT,children:[]}};case I9.MAP:return{nullable:!0,columnScope:Iy.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Ix.MAP,children:[]}};default:let t;var r=e;switch(r){case 10:case 11:t=Iv.BOOLEAN;break;case 12:case 13:t=Iv.INT_8;break;case 14:case 15:t=Iv.UINT_8;break;case 16:case 17:t=Iv.INT_32;break;case 18:case 19:t=Iv.UINT_32;break;case 20:case 21:t=Iv.INT_64;break;case 22:case 23:t=Iv.UINT_64;break;case 24:case 25:t=Iv.FLOAT;break;case 26:case 27:t=Iv.DOUBLE;break;case 28:case 29:t=Iv.STRING;break;default:return null}return{nullable:!!(1&r),columnScope:Iy.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:t}}}}function A1(e){return e===I9.STRUCT||e===I9.MAP}function A2(e,t){let r=Aa(e,t,1)[0];if(0===r)return"";let i=t.get(),n=e.subarray(i,i+r);return t.add(r),Le.decode(n)}function A3(e,t,r,i,n){return xl(e,(e,a)=>{let o=t instanceof Sv?t.get(a):null;return"object"==typeof o&&o&&"evaluate"in o?o.evaluate(r,i,void 0,n):o})}function A5(e,t){return t-e}var A4,A6,A8,A7,A9,Me,Mt,Mr,Mi,Mn,Ma,Mo,Ms,Ml,Mu,Mc,Mh,Md,Mf,Mp,Mm,Mg,My,Mv,Mx,Mb,M_,Mw,MT,MA,MM,Mk,MS,ME,MD,MC,MI,ML,MP,Mz,MF,MO,MR,MB,Mj,MN,MV,MU,Mq,MG,MH,M$,MW,MY,MZ,MX,MK,MJ,MQ,M0,M1,M2,M3,M5,M4,M6,M8,M7,M9,ke,kt,kr,ki,kn,ka,ko,ks,kl,ku,kc,kh,kd,kf,kp,km,kg,ky,kv,kx,kb,k_,kw,kT,kA,kM,kk,kS,kE,kD,kC,kI,kL,kP,kz,kF,kO,kR,kB,kj,kN,kV,kU,kq,kG,kH,k$,kW,kY,kZ,kX,kK,kJ,kQ,k0,k1,k2,k3,k5,k4,k6,k8,k7,k9,Se,St,Sr,Si,Sn,Sa,So,Ss,Sl,Su,Sc,Sh,Sd,Sf,Sp,Sm,Sg,Sy,Sv,Sx,Sb,S_,Sw,ST,SA,SM,Sk,SS,SE,SD,SC,SI,SL,SP,Sz,SF,SO,SR,SB,Sj,SN,SV,SU,Sq,SG,SH,S$,SW,SY,SZ,SX,SK,SJ,SQ,S0,S1,S2,S3,S5,S4,S6,S8,S7,S9,Ee,Et,Er,Ei,En,Ea,Eo,Es,El,Eu,Ec,Eh,Ed,Ef,Ep,Em,Eg,Ey,Ev,Ex,Eb,E_,Ew,ET,EA,EM,Ek,ES,EE,ED,EC,EI,EL,EP,Ez,EF,EO,ER,EB,Ej,EN,EV,EU,Eq,EG,EH,E$,EW,EY,EZ,EX,EK,EJ,EQ,E0,E1,E2,E3,E5,E4,E6,E8,E7,E9,De,Dt,Dr,Di,Dn,Da,Do,Ds,Dl,Du,Dc,Dh,Dd,Df,Dp,Dm,Dg,Dy,Dv,Dx,Db,D_,Dw,DT,DA,DM,Dk,DS,DE,DD,DC,DI,DL,DP,Dz,DF,DO,DR,DB,Dj,DN,DV,DU,Dq,DG,DH,D$,DW,DY,DZ,DX,DK,DJ,DQ,D0,D1,D2,D3,D5,D4,D6,D8,D7,D9,Ce,Ct,Cr,Ci,Cn,Ca,Co,Cs,Cl,Cu,Cc,Ch,Cd,Cf,Cp,Cm,Cg,Cy,Cv,Cx,Cb,C_,Cw,CT,CA,CM,Ck,CS,CE,CD,CC,CI,CL,CP,Cz,CF,CO,CR,CB,Cj,CN,CV,CU,Cq,CG,CH,C$,CW,CY,CZ,CX,CK,CJ,CQ,C0,C1,C2,C3,C5,C4,C6,C8,C7,C9,Ie,It,Ir,Ii,In,Ia,Io,Is,Il,Iu,Ic,Ih,Id,If,Ip,Im,Ig,Iy,Iv,Ix,Ib,I_,Iw,IT,IA,IM,Ik,IS,IE,ID,IC,II,IL,IP,Iz,IF,IO,IR,IB,Ij,IN,IV,IU,Iq,IG,IH,I$,IW,IY,IZ,IX,IK,IJ,IQ,I0,I1,I2,I3,I5,I4,I6,I8,I7,I9,Le,Lt,Lr,Li,Ln,La=p({"node_modules/maplibre-gl/dist/maplibre-gl-shared.mjs"(){var e,t,r,i,n,a,o,s,l,u,c,h,p,m,g;let y,v;for(let t in A4=Object.create,A6=Object.defineProperty,A8=Object.getOwnPropertyDescriptor,A7=Object.getOwnPropertyNames,A9=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty,Mt=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),vl.prototype={clone(){return new vl(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),r=Math.sin(e),i=t*this.x-r*this.y,n=r*this.x+t*this.y;return this.x=i,this.y=n,this},_rotateAround(e,t){let r=Math.cos(e),i=Math.sin(e),n=t.x+r*(this.x-t.x)-i*(this.y-t.y),a=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:vl},vl.convert=function(e){if(e instanceof vl)return e;if(Array.isArray(e))return new vl(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new vl(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")},Mn="u">typeof Float32Array?Float32Array:Array,Ma=vw,Mo=vT,Ms=vD,Ml=vk,vA(),Mu=vN,e=new Mn(4),Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),Mc=vj,vA(),vS(1,0,0),vS(0,1,0),vU(),vU(),vh(),Mh=vY,vG(),Md=8192,Mf=xe(.25,.1,.25,1),Mp=1,Mm={},Mg=null,My=(e,t)=>b(null,null,function*(){let r=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(r,t)}catch(e){throw Error(`Could not load image because of ${vK(e).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),Mv=e=>new Promise((t,r)=>{let i=new Image;i.onload=()=>{t(i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame(()=>i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=")},i.onerror=()=>r(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let n=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=URL.createObjectURL(n)}),Mx=85.051129,Mb={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},M_={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},Mw=class extends Error{constructor(e="AbortError"){super(e instanceof Error?e.message:e),this.name="AbortError",e instanceof Error&&e.stack&&(this.stack=e.stack)}},MT={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""},MA="global-dispatcher",MM=class extends Error{constructor(e,t,r,i){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=i}},Mk=function(e,t){return b(this,null,function*(){var r,i,n,a,o,s;if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let i=xA(e.url);if(i){let r=yield i(e,t);return r.data||"arrayBuffer"!==e.type?r:xi(r,{data:new ArrayBuffer(0)})}if(xp(self)&&null!=(r=self.worker)&&r.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:MA},t)}if(!((o=e.url).startsWith("file:")||(null==(s=xS())?void 0:s.startsWith("file:"))&&!/^\w+:/.test(o))){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return function(e,t){return b(this,null,function*(){let r,i,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:xS(),referrerPolicy:e.referrerPolicy,signal:t.signal});"json"!==e.type||n.headers.has("Accept")||n.headers.set("Accept","application/json");try{r=yield fetch(n)}catch(t){throw xw(t)?t:new MM(0,vK(t).message,e.url,new Blob)}if(!r.ok){let t=yield r.blob();throw new MM(r.status,r.statusText,e.url,t)}i="arrayBuffer"===e.type||"image"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text();let a=yield i;return xT(t.signal),{data:a,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),etag:r.headers.get("ETag")}})}(e,t);if(xp(self)&&null!=(i=self.worker)&&i.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:MA},t)}return n=e,a=t,new Promise((e,t)=>{var r;let i=new XMLHttpRequest;for(let e in i.open(n.method||"GET",n.url,!0),("arrayBuffer"===n.type||"image"===n.type)&&(i.responseType="arraybuffer"),n.headers)i.setRequestHeader(e,n.headers[e]);"json"===n.type&&(i.responseType="text",null!=(r=n.headers)&&r.Accept||i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===n.credentials,i.onerror=()=>{t(Error(i.statusText))},i.onload=()=>{if(!a.signal.aborted)if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let r=i.response;if("json"===n.type)try{r=JSON.parse(i.response)}catch(e){t(e);return}e({data:r,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires"),etag:i.getResponseHeader("ETag")})}else{let e=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});t(new MM(i.status,i.statusText,n.url,e))}},a.signal.addEventListener("abort",()=>{i.abort(),t(new Mw(a.signal.reason))}),i.send(n.body)})})},MS=(e,t)=>Mk(xi(e,{type:"json"}),t),ME=(e,t)=>Mk(xi(e,{type:"arrayBuffer"}),t),MD=e=>{let t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{for(let i of(t.onloadstart=()=>{r(t)},e)){let e=window.document.createElement("source");xE(i)||(t.crossOrigin="Anonymous"),e.src=i,t.appendChild(e)}})},MC=class{constructor(e,t={}){xi(this,t),this.type=e}},MI=class extends MC{constructor(e,t={}){super("error",xi({error:e},t))}},ML=class{on(e,t){return this._listeners||(this._listeners={}),xD(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return xC(e,t,this._listeners),xC(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||(this._oneTimeListeners={}),xD(e,t,this._oneTimeListeners),this):new Promise(t=>this.once(e,t))}fire(e,t){var r,i,n,a,o,s;let l="string"==typeof e?new MC(e,t||{}):e,u=l.type;if(this.listens(u)){for(let e of(l.target=this,null!=(n=null==(i=null==(r=this._listeners)?void 0:r[u])?void 0:i.slice())?n:[]))e.call(this,l);for(let e of null!=(s=null==(o=null==(a=this._oneTimeListeners)?void 0:a[u])?void 0:o.slice())?s:[])xC(u,e,this._oneTimeListeners),e.call(this,l);let e=this._eventedParent;e&&(xi(l,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),e.fire(l))}else l instanceof MI&&console.error(l.error);return this}listens(e){var t,r,i,n,a;return!!(null!=(r=null==(t=this._listeners)?void 0:t[e])&&r.length||null!=(n=null==(i=this._oneTimeListeners)?void 0:i[e])&&n.length||null!=(a=this._eventedParent)&&a.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}},Mz=MP={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},MF=["type","source","source-layer","minzoom","maxzoom","filter","layout"],MO=class{constructor(e,t,r,i,n="error"){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),this.severity=n,null!=t&&t.__line__&&(this.line=t.__line__)}},MH={kind:"error"},M$={kind:"collator"},MY={kind:"padding"},MZ={kind:"colorArray"},MX={kind:"numberArray"},MK={kind:"resolvedImage"},MJ={kind:"variableAnchorOffsetCollection"},MQ=[MR={kind:"null"},MB={kind:"number"},Mj={kind:"string"},MN={kind:"boolean"},MV={kind:"color"},MU={kind:"projectionDefinition"},MW={kind:"formatted"},Mq={kind:"object"},xI(MG={kind:"value"}),MY,MX,MZ,MK,MJ],M0=.96422,M1=.82521,M2=4/29,M5=3*(M3=6/29)*M3,M4=Math.PI/180,M6=180/Math.PI,M8=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},M7={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},(M9=class{constructor(e,t,r,i=1,n=!0){this.r=e,this.g=t,this.b=r,this.a=i,n||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,t,r,i]))}static parse(e){if(e instanceof M9)return e;if("string"!=typeof e)return;let t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=xG(M7,e);if(t){let[e,r,i]=t;return[e/255,r/255,i/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,r=1;return[xH(e.slice(r,r+=t)),xH(e.slice(r,r+=t)),xH(e.slice(r,r+=t)),xH(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,r,i,n,a,o,s,l,u,c,h,d]=t,f=[n||" ",s||" ",c].join("");if(" "===f||" /"===f||",,"===f||",,,"===f){let e=[i,o,u].join(""),t="%%%"===e?100:255*(""===e);if(t){let e=[xW(r/t,0,1),xW(a/t,0,1),xW(l/t,0,1),h?x$(+h,d):1];if(xY(e))return e}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[e,t,i,n,a,o,s,l,u]=r,c=[i||" ",a||" ",s].join("");if(" "===c||" /"===c||",,"===c||",,,"===c){let e=[+t,xW(+n,0,100),xW(+o,0,100),l?x$(+l,u):1];if(xY(e))return function([e,t,r,i]){function n(i){let n=(i+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(n-3,9-n,1))}return e=xR(e),t/=100,r/=100,[n(0),n(8),n(4),i]}(e)}}}(e);if(t)return new M9(...t,!1)}get rgb(){let{r:e,g:t,b:r,a:i}=this,n=i||1/0;return this.overwriteGetter("rgb",[e/n,t/n,r/n,i])}get hcl(){return this.overwriteGetter("hcl",function(e){let[t,r,i,n]=xB(e),a=Math.sqrt(r*r+i*i);return[Math.round(1e4*a)?xR(Math.atan2(i,r)*M6):0/0,a,t,n]}(this.rgb))}get lab(){return this.overwriteGetter("lab",xB(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,r,i]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${i})`}static interpolate(e,t,r,i="rgb"){switch(i){case"rgb":{let[i,n,a,o]=xX(e.rgb,t.rgb,r);return new M9(i,n,a,o,!1)}case"hcl":{var n,a,o;let[i,s,l,u]=e.hcl,[c,h,d,f]=t.hcl,p,m;if(isNaN(i)||isNaN(c))isNaN(i)?isNaN(c)?p=0/0:(p=c,(1===l||0===l)&&(m=h)):(p=i,(1===d||0===d)&&(m=s));else{let e=c-i;c>i&&e>180?e-=360:c180&&(e+=360),p=i+r*e}let[g,y,v,x]=function([e,t,r,i]){return xV([r,Math.cos(e=isNaN(e)?0:e*M4)*t,Math.sin(e)*t,i])}([p,m??(n=s)+r*(h-n),(a=l)+r*(d-a),(o=u)+r*(f-o)]);return new M9(g,y,v,x,!1)}case"lab":{let[i,n,a,o]=xV(xX(e.lab,t.lab,r));return new M9(i,n,a,o,!1)}}}}).black=new M9(0,0,0,1),M9.white=new M9(1,1,1,1),M9.transparent=new M9(0,0,0,0),M9.red=new M9(1,0,0,1),ke=M9,kt=["bottom","center","top"],kr=class{constructor(e,t,r,i,n,a){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},ki=class e{constructor(e){this.sections=e}static fromString(t){return new e([new kr(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}},kn=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new e(xX(t.values,r.values,i))}},ka=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t]);if(Array.isArray(t)){for(let e of t)if("number"!=typeof e)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i){return new e(xX(t.values,r.values,i))}},ko=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("string"==typeof t){let r=ke.parse(t);return r?new e([r]):void 0}if(!Array.isArray(t))return;let r=[];for(let e of t){if("string"!=typeof e)return;let t=ke.parse(e);if(!t)return;r.push(t)}return new e(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,i,n="rgb"){let a=[];if(t.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let e=0;e=i)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);let u=r.parse(o,l,a);if(!u)return null;a||(a=u.type),n.push([i,u])}return new e(a,i,n,r.key)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);let n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[x1(t,i,this.key)].evaluate(e)}eachChild(e){for(let t of(e(this.input),this.outputs))e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}},ky=class e{constructor(e,t,r,i,n,a){for(let[o,s]of(this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.key=a,this.labels=[],this.outputs=[],n))this.labels.push(o),this.outputs.push(s)}static interpolationFactor(e,t,r,i){let n=0;if("exponential"===e.name)n=x2(t,e.base,r,i);else if("linear"===e.name)n=x2(t,1,r,i);else if("cubic-bezier"===e.name){var a,o,s,l;let u,c,h,d,f,p,m=e.controlPoints;n=(a=m[0],o=m[1],s=m[2],l=m[3],u=3*a,c=3*(s-a)-u,h=1-u-c,d=3*o,f=3*(l-o)-d,p=1-d-f,function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let r=e;for(let i=0;i<8;i++){let i=((h*r+c)*r+u)*r-e;if(Math.abs(i)Math.abs(n))break;r-=i/n}let i=0,n=1;r=e;for(let a=0;a<20;a++){let a=((h*r+c)*r+u)*r;if(Math.abs(a-e)a?i=r:n=r,r=(i+n)*.5}return((p*r+f)*r+d)*r})(x2(t,1,r,i))}return n}static parse(t,r){let[i,n,a,...o]=t;if(!Array.isArray(n)||0===n.length)return r.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){let e=n[1];if("number"!=typeof e)return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);let e=n.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(a=r.parse(a,2,MB)))return null;let s=[],l=null;("interpolate-hcl"===i||"interpolate-lab"===i)&&r.expectedType!=MZ?l=MV:r.expectedType&&"value"!==r.expectedType.kind&&(l=r.expectedType);for(let e=0;e=t)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);let u=r.parse(i,a,l);if(!u)return null;l||(l=u.type),s.push([t,u])}return xO(l,MB)||xO(l,MU)||xO(l,MV)||xO(l,MY)||xO(l,MX)||xO(l,MZ)||xO(l,MJ)||xO(l,xI(MB))?new e(l,i,n,a,s,r.key):r.error(`Type ${xL(l)} is not interpolatable.`)}evaluate(t){let r=this.labels,i=this.outputs;if(1===r.length)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(t);let o=x1(r,n,this.key),s=r[o],l=r[o+1],u=e.interpolationFactor(this.interpolation,n,s,l),c=i[o].evaluate(t),h=i[o+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":var d;return(d=c)+u*(h-d);case"color":return ke.interpolate(c,h,u);case"padding":return kn.interpolate(c,h,u);case"colorArray":return ko.interpolate(c,h,u);case"numberArray":return ka.interpolate(c,h,u);case"variableAnchorOffsetCollection":return ku.interpolate(c,h,u,this.key);case"array":return xX(c,h,u);case"projectionDefinition":return kh.interpolate(c,h,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return ke.interpolate(c,h,u,"hcl");case"colorArray":return ko.interpolate(c,h,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return ke.interpolate(c,h,u,"lab");case"colorArray":return ko.interpolate(c,h,u,"lab")}}}eachChild(e){for(let t of(e(this.input),this.outputs))e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}},kv={color:ke.interpolate,number:xZ,padding:kn.interpolate,numberArray:ka.interpolate,colorArray:ko.interpolate,variableAnchorOffsetCollection:ku.interpolate,array:xX},kx=class e{constructor(e){this.type=MW,this.sections=e}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let e=1;e<=t.length-1;++e){let i=t[e];if(a&&"object"==typeof i&&!Array.isArray(i)){a=!1;let e=null;if(i["font-scale"]&&!(e=r.parse(i["font-scale"],1,MB)))return null;let t=null;if(i["text-font"]&&!(t=r.parse(i["text-font"],1,xI(Mj))))return null;let o=null;if(i["text-color"]&&!(o=r.parse(i["text-color"],1,MV)))return null;let s=null;if(i["vertical-align"]){if("string"==typeof i["vertical-align"]&&!kt.includes(i["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${i["vertical-align"]}' instead.`);if(!(s=r.parse(i["vertical-align"],1,Mj)))return null}let l=n[n.length-1];l.scale=e,l.font=t,l.textColor=o,l.verticalAlign=s}else{let i=r.parse(t[e],1,MG);if(!i)return null;let o=i.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:i,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(n)}evaluate(e){return new ki(this.sections.map(t=>{let r=t.content.evaluate(e);return xQ(r)===MK?new kr("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new kr(x0(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}},kb={string:Mj,number:MB,boolean:MN,object:Mq},k_=class e{constructor(e,t,r){this.type=e,this.args=t,this.key=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=1,n,a=t[0];if("array"===a){let e,a;if(t.length>2){let n=t[1];if("string"!=typeof n||!(n in kb)||"object"===n)return r.error('The item type argument of "array" must be one of string, number, boolean',1);e=kb[n],i++}else e=MG;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);a=t[2],i++}n=xI(e,a)}else{if(!kb[a])throw Error(`Types doesn't contain name = ${a}`);n=kb[a]}let o=[];for(;ie.outputDefined())}},kw={"to-boolean":MN,"to-color":MV,"to-number":MB,"to-string":Mj},kT=class e{constructor(e,t,r){this.type=e,this.args=t,this.key=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[0];if(!kw[i])throw Error(`Can't parse ${i} as it is not part of the known types`);if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return r.error("Expected one argument.");let n=kw[i],a=[];for(let e=1;e4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:xK(t[0],t[1],t[2],t[3])))return new ke(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new ks(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"padding":{let t;for(let r of this.args){t=r.evaluate(e);let i=kn.parse(t);if(i)return i}throw new ks(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"numberArray":{let t;for(let r of this.args){t=r.evaluate(e);let i=ka.parse(t);if(i)return i}throw new ks(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"colorArray":{let t;for(let r of this.args){t=r.evaluate(e);let i=ko.parse(t);if(i)return i}throw new ks(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"variableAnchorOffsetCollection":{let t;for(let r of this.args){t=r.evaluate(e);let i=ku.parse(t);if(i)return i}throw new ks(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"number":{let t=null;for(let r of this.args){if(null===(t=r.evaluate(e)))return 0;let i=Number(t);if(!isNaN(i))return i}throw new ks(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case"formatted":return ki.fromString(x0(this.args[0].evaluate(e)));case"resolvedImage":return kc.fromString(x0(this.args[0].evaluate(e)));case"projectionDefinition":{let t=this.args[0].evaluate(e);if(kh.parse(t))return t;throw new ks(`Could not parse projectionDefinition from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}default:return x0(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},kA=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let i=[];for(let e=1;e=r.length)throw new ks(`Array index out of bounds: ${t} > ${r.length-1}.`,this.key);if(t!==Math.floor(t))throw new ks(`Array index must be an integer, but found ${t} instead.`,this.key);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},kS=class e{constructor(e,t,r){this.needle=e,this.haystack=t,this.key=r,this.type=MN}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,MG),n=r.parse(t[2],2,MG);return i&&n?xz(i.type,[MN,Mj,MB,MR,MG])?new e(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${xL(i.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!xF(t,["boolean","string","number","null"]))throw new ks(`Expected first argument to be of type boolean, string, number or null, but found ${xL(xQ(t))} instead.`,this.key);if(!xF(r,["string","array"]))throw new ks(`Expected second argument to be of type array or string, but found ${xL(xQ(r))} instead.`,this.key);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},kE=class e{constructor(e,t,r,i){this.needle=e,this.haystack=t,this.key=r,this.fromIndex=i,this.type=MB}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,MG),n=r.parse(t[2],2,MG);if(!i||!n)return null;if(!xz(i.type,[MN,Mj,MB,MR,MG]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${xL(i.type)} instead`);if(4===t.length){let a=r.parse(t[3],3,MB);return a?new e(i,n,r.key,a):null}return new e(i,n,r.key)}evaluate(e){let t,r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!xF(r,["boolean","string","number","null"]))throw new ks(`Expected first argument to be of type boolean, string, number or null, but found ${xL(xQ(r))} instead.`,this.key);if(this.fromIndex&&(t=this.fromIndex.evaluate(e)),xF(i,["string"])){let e=i.indexOf(r,t);return -1===e?-1:[...i.slice(0,e)].length}if(xF(i,["array"]))return i.indexOf(r,t);throw new ks(`Expected second argument to be of type array or string, but found ${xL(xQ(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},kD=class e{constructor(e,t,r,i,n,a){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=a}static parse(t,r){let i,n;if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);let a={},o=[];for(let e=2;e0x1fffffffffffff)return u.error("Branch labels must be integers no larger than 9007199254740991.");if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,xQ(e)))return null}else i=xQ(e);if(void 0!==a[String(e)])return u.error("Branch labels must be unique.");a[String(e)]=o.length}let c=r.parse(l,e,n);if(!c)return null;n||(n=c.type),o.push(c)}let s=r.parse(t[1],1,MG);if(!s)return null;let l=r.parse(t[t.length-1],t.length-1,n);return!l||"value"!==s.type.kind&&r.concat(1).checkSubtype(i,s.type)?null:new e(i,n,s,a,o,l)}evaluate(e){let t=this.input.evaluate(e);return(xQ(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()}},kC=class e{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(t,r){let i;if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);let n=[];for(let e=1;et.outputDefined())&&this.otherwise.outputDefined()}},kI=class e{constructor(e,t,r,i,n){this.type=e,this.input=t,this.beginIndex=r,this.key=i,this.endIndex=n}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let i=r.parse(t[1],1,MG),n=r.parse(t[2],2,MB);if(!i||!n)return null;if(!xz(i.type,[xI(MG),Mj,MG]))return r.error(`Expected first argument to be of type array or string, but found ${xL(i.type)} instead`);if(4===t.length){let a=r.parse(t[3],3,MB);return a?new e(i.type,i,n,r.key,a):null}return new e(i.type,i,n,r.key)}evaluate(e){let t=this.input.evaluate(e),r=this.beginIndex.evaluate(e),i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),xF(t,["string"]))return[...t].slice(r,i).join("");if(xF(t,["array"]))return t.slice(r,i);throw new ks(`Expected first argument to be of type array or string, but found ${xL(xQ(t))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},kL=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&"value"!==n.kind&&(i=n);let a=[];for(let e of t.slice(1)){let t=r.parse(e,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i||(i=t.type),a.push(t)}if(!i)throw Error("No output type");return n&&a.some(e=>xP(n,e.type))?new e(MG,a):new e(i,a)}evaluate(e){let t=null,r=0,i;for(let n of this.args)if(r++,(t=n.evaluate(e))&&t instanceof kc&&!t.available&&(i||(i=t.name),t=null,r===this.args.length&&(t=i)),null!==t)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},kP=bu("==",x8,bi),kz=bu("!=",x7,bn),kF=bu("<",x9,ba),kO=bu(">",be,bo),kR=bu("<=",bt,bs),kB=bu(">=",br,bl),kj=class e{constructor(e,t,r){this.type=M$,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,r){if(2!==t.length)return r.error("Expected one argument.");let i=t[1];if("object"!=typeof i||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,MN);if(!n)return null;let a=r.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,MN);if(!a)return null;let o=null;return!i.locale||(o=r.parse(i.locale,1,Mj))?new e(n,a,o):null}evaluate(e){return new kd(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},kN=class e{constructor(e,t,r,i,n,a){this.type=Mj,this.number=e,this.locale=t,this.currency=r,this.unit=i,this.minFractionDigits=n,this.maxFractionDigits=a}static parse(t,r){if(3!==t.length)return r.error("Expected two arguments.");let i=r.parse(t[1],1,MB);if(!i)return null;let n=t[2];if("object"!=typeof n||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&!(a=r.parse(n.locale,1,Mj)))return null;let o=null;if(n.currency&&!(o=r.parse(n.currency,1,Mj)))return null;let s=null;if(n.unit&&!(s=r.parse(n.unit,1,Mj)))return null;if(o&&s)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&!(l=r.parse(n["min-fraction-digits"],1,MB)))return null;let u=null;return!n["max-fraction-digits"]||(u=r.parse(n["max-fraction-digits"],1,MB))?new e(i,a,o,s,l,u):null}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}},kV=class e{constructor(e){this.type=MK,this.input=e}static parse(t,r){if(2!==t.length)return r.error("Expected two arguments.");let i=r.parse(t[1],1,Mj);return i?new e(i):r.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),r=kc.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}},kU=class e{constructor(e,t){this.input=e,this.key=t,this.type=MB}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=r.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?r.error(`Expected argument of type string or array, but found ${xL(i.type)} instead.`):new e(i,r.key):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new ks(`Expected value to be of type string or array, but found ${xL(xQ(t))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},kq=8192,kG=class e{constructor(e,t){this.type=MN,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(xJ(t[1])){let r=t[1];if("FeatureCollection"===r.type){let t=[];for(let e of r.features){let{type:r,coordinates:i}=e.geometry;"Polygon"===r&&t.push(i),"MultiPolygon"===r&&t.push(...i)}if(t.length)return new e(r,{type:"MultiPolygon",coordinates:t})}else if("Feature"===r.type){let t=r.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new e(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new e(r,r)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=by(t.coordinates,i,n),o=bb(e.geometry(),r,i,n);if(!bd(r,i))return!1;for(let e of o)if(!bp(e,a))return!1}if("MultiPolygon"===t.type){let a=bv(t.coordinates,i,n),o=bb(e.geometry(),r,i,n);if(!bd(r,i))return!1;for(let e of o)if(!function(e,t){for(let r of t)if(bp(e,r))return!0;return!1}(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=by(t.coordinates,i,n),o=b_(e.geometry(),r,i,n);if(!bd(r,i))return!1;for(let e of o)if(!bm(e,a))return!1}if("MultiPolygon"===t.type){let a=bv(t.coordinates,i,n),o=b_(e.geometry(),r,i,n);if(!bd(r,i))return!1;for(let e of o)if(!function(e,t){for(let r of t)if(bm(e,r))return!0;return!1}(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},kH=class{constructor(e=[],t=(e,t)=>et)){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;let 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){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;er(t[a],t[i])&&(i=a),r(t[i],n)>=0)break;t[e]=t[i],e=i}t[e]=n}},k$=Math.PI/180,kW=class{constructor(e){let t=6378.137*k$*1e3,r=Math.cos(e*k$),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=t*n*r,this.ky=t*n*i*.9933056200098587}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(e,t){let r=1/0,i,n,a,o;for(let s=0;s1?(l=e[s+1][0],u=e[s+1][1]):d>0&&(l+=c/this.kx*d,u+=h/this.ky*d));let f=(c=this.wrap(t[0]-l)*this.kx)*c+(h=(t[1]-u)*this.ky)*h;f180;)e-=360;return e}},kY=class e{constructor(e,t){this.type=MB,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(xJ(t[1])){let r=t[1];if("FeatureCollection"===r.type)return new e(r,r.features.map(e=>bR(e.geometry)).flat());if("Feature"===r.type)return new e(r,bR(r.geometry));if("type"in r&&"coordinates"in r)return new e(r,bR(r))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=e.geometry(),i=r.flat().map(t=>bc([t.x,t.y],e.canonical));if(0===r.length)return 0/0;let n=new kW(i[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,bO(i,!1,[e.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,bO(i,!1,e.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,bF(i,!1,e.coordinates,n,a))}if(0===a)break}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=e.geometry(),i=r.flat().map(t=>bc([t.x,t.y],e.canonical));if(0===r.length)return 0/0;let n=new kW(i[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,bO(i,!0,[e.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,bO(i,!0,e.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,bF(i,!0,e.coordinates,n,a))}if(0===a)break}return a}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){let r=e.geometry();if(0===r.length||0===r[0].length)return 0/0;let i=x5(r,0).map(t=>t.map(t=>t.map(t=>bc([t.x,t.y],e.canonical)))),n=new kW(i[0][0][0][1]),a=1/0;for(let e of t)for(let t of i){switch(e.type){case"Point":a=Math.min(a,bF([e.coordinates],!1,t,n,a));break;case"LineString":a=Math.min(a,bF(e.coordinates,!0,t,n,a));break;case"Polygon":a=Math.min(a,function(e,t,r,i=1/0){let n=bS(e),a=bS(t);if(1/0!==i&&bD(n,a,r)>=i)return i;if(bd(n,a)){if(bL(e,t))return 0}else if(bL(t,e))return 0;let o=1/0;for(let i of e)for(let e=0,n=i.length,a=n-1;er.parse(e,null,MG))):new kf(n,i)}evaluate(e){return this.arr.map(t=>t.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},kK={"==":kP,"!=":kz,">":kO,"<":kF,">=":kB,"<=":kR,array:k_,at:kk,boolean:k_,case:kC,coalesce:kL,collator:kj,format:kx,image:kV,in:kS,"index-of":kE,interpolate:ky,"interpolate-hcl":ky,"interpolate-lab":ky,length:kU,let:kA,literal:kf,match:kD,number:k_,"number-format":kN,object:k_,semiliteral:kZ,slice:kI,step:kg,string:k_,"to-boolean":kT,"to-color":kT,"to-number":kT,"to-string":kT,var:kM,within:kG,distance:kY,"global-state":kX=class e{constructor(e){this.key=e,this.type=MG}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let i=t[1];return null==i?r.error("Global state property must be defined."):"string"==typeof i?new e(i):r.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(e){var t,r;let i=null==(t=e.globals)?void 0:t.globalState;return i&&0!==Object.keys(i).length&&null!=(r=xG(i,this.key))?r:null}eachChild(){}outputDefined(){return!1}}},kJ=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},kQ=class e{constructor(e,t=[]){for(let[r,i]of(this.parent=e,this.bindings={},t))this.bindings[r]=i}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}},k0=class e{constructor(e,t,r=[],i,n=new kQ,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=n,this.errors=a,this.expectedType=i,this._isConstant=t}parse(e,t,r,i,n={}){return t?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]);let r=this.key;function i(e,t,i){return"assert"===i?new k_(t,[e],r):"coerce"===i?new kT(t,[e],r):e}if(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", []].');let r=e[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let n=this.registry[r];if(n){let r=n.parse(e,this);if(!r)return null;if(this.expectedType){let e=this.expectedType,n=r.type;if(("string"===e.kind||"number"===e.kind||"boolean"===e.kind||"object"===e.kind||"array"===e.kind)&&"value"===n.kind)r=i(r,e,t.typeAnnotation||"assert");else if("projectionDefinition"===e.kind&&["string","array","value"].includes(n.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(n.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(n.kind)||"colorArray"===e.kind&&["value","string","array"].includes(n.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(n.kind))r=i(r,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,n))return null}if(!(r instanceof kf)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){let e=new km;try{r=new kf(r.type,r.evaluate(e))}catch(e){return this.error(e.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(t,r,i){let n="number"==typeof t?this.path.concat(t):this.path,a=i?this.scope.concat(i):this.scope;return new e(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...t){let r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new kJ(r,e))}checkSubtype(e,t){let r=xP(e,t);return r&&this.error(r),r}},(k1=class e{constructor(e,t,r,i,n){this.name=e,this.type=t,this._evaluate=r,this.args=i,this.key=n}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,r){let i=t[0],n=e.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),l=null;for(let[n,o]of s){l=new k0(r.registry,bU,r.path,null,r.scope);let s=[],u=!1;for(let e=1;e{var t;return Array.isArray(t=e)?`(${t.map(xL).join(", ")})`:`(${xL(t.type)}...)`}).join(" | "),i=[];for(let e=1;e{throw new ks(t.evaluate(e),r)}],typeof:[Mj,[MG],(e,[t])=>xL(xQ(t.evaluate(e)))],"to-rgba":[xI(MB,4),[MV],(e,[t])=>{let[r,i,n,a]=t.evaluate(e).rgb;return[255*r,255*i,255*n,a]}],rgb:[MV,[MB,MB,MB],bB],rgba:[MV,[MB,MB,MB,MB],bB],has:{type:MN,overloads:[[[Mj],(e,[t])=>bj(t.evaluate(e),e.properties())],[[Mj,Mq],(e,[t,r])=>bj(t.evaluate(e),r.evaluate(e))]]},get:{type:MG,overloads:[[[Mj],(e,[t])=>bN(t.evaluate(e),e.properties())],[[Mj,Mq],(e,[t,r])=>bN(t.evaluate(e),r.evaluate(e))]]},"feature-state":[MG,[Mj],(e,[t])=>bN(t.evaluate(e),e.featureState||{})],properties:[Mq,[],e=>e.properties()],"geometry-type":[Mj,[],e=>e.geometryType()],id:[MG,[],e=>e.id()],zoom:[MB,[],e=>e.globals.zoom],"heatmap-density":[MB,[],e=>e.globals.heatmapDensity||0],elevation:[MB,[],e=>e.globals.elevation||0],"line-progress":[MB,[],e=>e.globals.lineProgress||0],accumulated:[MG,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[MB,bV(MB),(e,t)=>{let r=0;for(let i of t)r+=i.evaluate(e);return r}],"*":[MB,bV(MB),(e,t)=>{let r=1;for(let i of t)r*=i.evaluate(e);return r}],"-":{type:MB,overloads:[[[MB,MB],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[MB],(e,[t])=>-t.evaluate(e)]]},"/":[MB,[MB,MB],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[MB,[MB,MB],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[MB,[],()=>Math.LN2],pi:[MB,[],()=>Math.PI],e:[MB,[],()=>Math.E],"^":[MB,[MB,MB],(e,[t,r])=>t.evaluate(e)**r.evaluate(e)],sqrt:[MB,[MB],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[MB,[MB],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[MB,[MB],(e,[t])=>Math.log(t.evaluate(e))],log2:[MB,[MB],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[MB,[MB],(e,[t])=>Math.sin(t.evaluate(e))],cos:[MB,[MB],(e,[t])=>Math.cos(t.evaluate(e))],tan:[MB,[MB],(e,[t])=>Math.tan(t.evaluate(e))],asin:[MB,[MB],(e,[t])=>Math.asin(t.evaluate(e))],acos:[MB,[MB],(e,[t])=>Math.acos(t.evaluate(e))],atan:[MB,[MB],(e,[t])=>Math.atan(t.evaluate(e))],min:[MB,bV(MB),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[MB,bV(MB),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[MB,[MB],(e,[t])=>Math.abs(t.evaluate(e))],round:[MB,[MB],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[MB,[MB],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[MB,[MB],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[MN,[Mj,MG],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[MN,[MG],(e,[t])=>e.id()===t.value],"filter-type-==":[MN,[Mj],(e,[t])=>e.geometryType()===t.value],"filter-<":[MN,[Mj,MG],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i{let r=e.id(),i=t.value;return typeof r==typeof i&&r":[MN,[Mj,MG],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[MN,[MG],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[MN,[Mj,MG],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[MN,[MG],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[MN,[Mj,MG],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[MN,[MG],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[MN,[MG],(e,[t])=>{let r=t.value,i=e.properties();return r in i&&void 0!==i[r]}],"filter-has-id":[MN,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[MN,[xI(Mj)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[MN,[xI(MG)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[MN,[Mj,xI(MG)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[MN,[Mj,xI(MG)],(e,[t,r])=>(function(e,t,r,i){for(;r<=i;){let n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1})(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:MN,overloads:[[[MN,MN],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[bV(MN),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:MN,overloads:[[[MN,MN],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[bV(MN),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[MN,[MN],(e,[t])=>!t.evaluate(e)],"is-supported-script":[MN,[Mj],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[Mj,[Mj],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Mj,[Mj],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Mj,bV(MG),(e,t)=>t.map(t=>x0(t.evaluate(e))).join("")],split:[xI(Mj),[Mj,Mj],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[Mj,[xI(Mj),Mj],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[Mj,[M$],(e,[t])=>t.evaluate(e).resolvedLocale()]}),k2=/^(.*)-transition$/,k3=class{constructor(e,t,r,i){this.expression=e,this._warningHistory={},this._evaluator=new km,this._defaultValue=r?_r(r):null,this._enumValues=r&&"enum"===r.type?r.values:null,this._globalState=i,this._rootKey=t}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=_i(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,a){this._globalState&&(e=_i(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new ks(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`,"");return e}catch(r){let e=r instanceof ks?r.path:"",t=`${e}|${r.message}`;return this._warningHistory[t]||(this._warningHistory[t]=!0,"u">typeof console&&console.warn(b6(this._rootKey,e,r.message,this._defaultValue))),this._defaultValue}}},k5=class{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!bG(t.expression),this.globalStateRefs=_t(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=_i(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=_i(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}},k4=class{constructor(e,t,r,i,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!bG(t.expression),this.globalStateRefs=_t(t.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=_i(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=_i(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}interpolationFactor(e,t,r){return this.interpolationType?ky.interpolationFactor(this.interpolationType,e,t,r):0}},k6=class e{constructor(e,t,r){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,b8(t),this._parameters=e,this._specification=r,this._rootKey=t,this._defaultValue=_r(r),this._warningHistory={};let i=function e(t,r){var i;let n=t.stops&&"object"==typeof t.stops[0][0],a=n||void 0!==t.property,o=t.type||(bY(r)?"exponential":"interval"),s=function(e){switch(e.type){case"color":return ke.parse;case"padding":return kn.parse;case"numberArray":return ka.parse;case"colorArray":return ko.parse;default:return null}}(r);if(s&&((t=bZ({},t)).stops&&(t.stops=t.stops.map(e=>[e[0],s(e[1])])),t.default?t.default=s(t.default):t.default=s(r.default)),t.colorSpace&&"rgb"!==(i=t.colorSpace)&&"hcl"!==i&&"lab"!==i)throw Error(`Unknown color space: "${t.colorSpace}"`);let l=function(e){switch(e){case"exponential":return b2;case"interval":return b1;case"categorical":return b0;case"identity":return b3;default:throw Error(`Unknown function type "${e}"`)}}(o),u,c;if("categorical"===o){for(let e of(u=Object.create(null),t.stops))u[e[0]]=e[1];c=typeof t.stops[0][0]}if(n){let i={},n=[];for(let e=0;ee[0]),evaluate:({zoom:e},i)=>b2({stops:a,base:t.base},r,e).evaluate(e,i)}}if(n||!a){let e="exponential"===o?{name:"exponential",base:void 0===t.base?1:t.base}:null;return{kind:"camera",interpolationType:e,interpolationFactor:ky.interpolationFactor.bind(void 0,e),zoomStops:t.stops.map(e=>e[0]),evaluate:({zoom:e})=>l(t,r,e,u,c)}}return{kind:"source",evaluate(e,i){let n=i&&i.properties?i.properties[t.property]:void 0;return void 0===n?bQ(t.default,r.default):l(t,r,n,u,c)}}}(this._parameters,this._specification);this.kind=i.kind,this.interpolationFactor=i.interpolationFactor,this.zoomStops=i.zoomStops,this.interpolationType=i.interpolationType,this._innerEvaluate=i.evaluate}evaluate(e,t){try{return this._innerEvaluate(e,t)}catch(r){let e=r instanceof Error?r.message:String(r),t=`|${e}`;return this._warningHistory[t]||(this._warningHistory[t]=!0,"u">typeof console&&console.warn(b6(this._rootKey,"",e,this._defaultValue))),this._defaultValue}}static deserialize(t){return new e(t._parameters,t._rootKey,t._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}},k8={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},k7={promoteId:_P},k9=1114111,Se=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i,St={"*":()=>[],array:_x,boolean:_T,number:_b,color:_A,constants:_m,enum:_M,filter:_k,function:__,layer:_C,object:_v,source:_L,light:_z,sky:_F,terrain:_O,projection:_G,projectionDefinition:_H,string:_I,formatted:_R,resolvedImage:_B,padding:_j,numberArray:_N,colorArray:_V,variableAnchorOffsetCollection:_U,sprite:_q,state:_W,fontFaces:_Y},_K.source=_0(_J(_L)),_K.sprite=_0(_J(_q)),_K.glyphs=_0(_J(_X)),_K.fontFaces=_0(_J(_Y)),_K.light=_0(_J(_z)),_K.sky=_0(_J(_F)),_K.terrain=_0(_J(_O)),_K.state=_0(_J(_W)),_K.layer=_0(_J(_C)),_K.filter=_0(_J(_k)),_K.paintProperty=_0(_J(_E)),_K.layoutProperty=_0(_J(_D)),Sr={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},Si=class{constructor(e,t,r){this._rootKey=t,this._globalState=r,this.setValue(e)}evaluate(){var e;return null!=(e=this._literalValue)?e:this._compiledValue.evaluate({})}setValue(e){if(null==e||"visible"===e||"none"===e){this._literalValue="none"===e?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let t=b9(e,this._rootKey,Sr,this._globalState);if("error"===t.result)throw this._literalValue="visible",this._compiledValue=void 0,Error(t.value.map(e=>`${e.key}: ${e.message}`).join(", "));this._literalValue=void 0,this._compiledValue=t.value,this._globalStateRefs=_t(t.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}},Sn=_K,Sa=new Set(Object.keys(Mz).filter(e=>e.startsWith("source_")).map(e=>e.slice(7).replaceAll("_","-"))),So=class e{constructor(e,t,r){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let n=new Int32Array(this.arrayBuffer);e=n[0],t=n[1],r=n[2],this.d=t+2*r;for(let e=0;e=u[l+0]&&i>=u[l+1])?(o[c]=!0,a.push(n[c])):o[c]=!1}}}_forEachCell(e,t,r,i,n,a,o,s){let l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i);for(let d=l;d<=c;d++)for(let l=u;l<=h;l++){let u=this.d*l+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(l),this._convertFromCellCoord(d+1),this._convertFromCellCoord(l+1)))&&n.call(this,e,t,r,i,u,a,o,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,r=0;for(let e of this.cells)r+=e.length;let i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let n=t;for(let t=0;tr?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}},Sc="-transition",Sh=class{constructor(e,t,r,i){this.property=e,this.value=t,this.expression=function(e,t,r,i){if(bK(e))return new k6(e,t,r);if(b7(e)){let n=_e(e,t,r,i);if("error"===n.result)throw Error(n.value.map(e=>`${e.key}: ${e.message}`).join(", "));return n.value}{let t=e;return"color"===r.type&&"string"==typeof e?t=ke.parse(e):"padding"===r.type&&("number"==typeof e||Array.isArray(e))?t=kn.parse(e):"numberArray"===r.type&&("number"==typeof e||Array.isArray(e))?t=ka.parse(e):"colorArray"===r.type&&("string"==typeof e||Array.isArray(e))?t=ko.parse(e):"variableAnchorOffsetCollection"===r.type&&Array.isArray(e)?t=ku.parse(e):"projectionDefinition"===r.type&&"string"==typeof e&&(t=kh.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>t}}}(void 0===t?e.specification.default:t,r,e.specification,i)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}},Sd=class{constructor(e,t,r){this.property=e,this.value=new Sh(e,void 0,t,r)}transitioned(e,t){return new Sp(this.property,this.value,t,xi({},e.transition,this.transition),e.now)}untransitioned(){return new Sp(this.property,this.value,null,{},0)}},Sf=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return xh(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new Sd(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new Sh(this._values[e].property,null===t?void 0:xh(t),this._propertyRootKey(e),this._globalState)}getTransition(e){return xh(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new Sd(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=xh(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r);let i=this.getTransition(t);void 0!==i&&(e[`${t}${Sc}`]=i)}return e}transitioned(e,t){let r=new Sm(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){let e=new Sm(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}},Sp=class{constructor(e,t,r,i,n){this.property=e,this.value=t,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(i=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}}},Sm=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let i=new Sv(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},Sg=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasValue(e){return void 0!==this._values[e].value}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return xh(this._values[e].value)}setValue(e,t){this._values[e]=new Sh(this._values[e].property,null===t?void 0:xh(t),this._propertyRootKey(e),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let i=new Sv(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}},Sy=class{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}},Sv=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}},Sx=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){if(wt(e,t))return xd(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let i=kv[this.specification.type];return i?i(e,t,r):e}},Sb=class{constructor(e,t,r){this.specification=e,this.name=t,this.overrides=r}possiblyEvaluate(e,t,r,i){return"constant"===e.expression.kind||"camera"===e.expression.kind?new Sy(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)},t):new Sy(this,e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Sy(this,{kind:"constant",value:void 0},e.parameters);if(wt(e.value.value,t.value.value))return xd(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let i=kv[this.specification.type];return i?new Sy(this,{kind:"constant",value:i(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,i,n,a){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,a)}},S_=class extends Sb{possiblyEvaluate(e,t,r,i){if(void 0===e.value)return new Sy(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i),a="resolvedImage"===e.property.specification.type&&"string"!=typeof n?n.name:n;return new Sy(this,{kind:"constant",value:this._calculate(a,a,a,t)},t)}return"camera"===e.expression.kind?new Sy(this,{kind:"constant",value:this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t)},t):new Sy(this,e.expression,t)}evaluate(e,t,r,i,n,a){if("source"===e.kind){let o=e.evaluate(t,r,i,n,a);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},Sw=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,i){if(void 0!==e.value){if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new Su(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Su(Math.floor(t.zoom),t)),e.expression.evaluate(new Su(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},ST=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}},SA=class{constructor(e){for(let t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let i=this.defaultPropertyValues[t]=new Sh(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[t]=new Sd(r,r.name,void 0);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}},_5("DataDrivenProperty",Sb),_5("DataConstantProperty",Sx),_5("CrossFadedDataDrivenProperty",S_),_5("CrossFadedProperty",Sw),_5("ColorRampProperty",ST),SM=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",Sk=class extends ML{constructor(e,t,r){var i,n;if(super(),this.id=e.id,this.type=e.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(i=this.visibility,n=`layers[${this.id}].layout.visibility`,new Si(i,n,r)),"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=_u(e.filter,`layers[${this.id}].filter`,r)),t.layout&&(this._unevaluatedLayout=new Sg(t.layout,`layers[${this.id}].layout`,r)),t.paint)){for(let i in this._transitionablePaint=new Sf(t.paint,`layers[${this.id}].paint`,r),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Sv(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=_u(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){var t;if("visibility"===e)return this.visibility;if(null!=(t=this._transitionablePaint)&&t.hasProperty(e))throw Error(e+" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?");if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let t of this._visibilityExpression.getGlobalStateRefs())e.add(t);if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values)for(let r of this._unevaluatedLayout._values[t].getGlobalStateRefs())e.add(r);for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){var e;let t=new globalThis.Map;if(this._transitionablePaint)for(let r in this._transitionablePaint._values){let i=this._transitionablePaint._values[r].value;for(let n of i.getGlobalStateRefs()){let a=null!=(e=t.get(n))?e:[];a.push({name:r,value:i.value}),t.set(n,a)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,t,r={}){var i;if("visibility"===e){this.visibility=t,this._visibilityExpression.setValue(t),this.recalculateVisibility();return}null!=(i=this._transitionablePaint)&&i.hasProperty(e)?this.fire(new MI(Error(e+" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?"))):null!=t&&this._validate(Sn.layoutProperty,`layers.${this.id}.layout.${e}`,e,t,r)||this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){var t,r;if(e.endsWith("-transition")){let r=e.slice(0,-11);if("visibility"===r||null!=(t=this._unevaluatedLayout)&&t.hasProperty(r))throw Error(e+SM);return this._transitionablePaint.getTransition(r)}if("visibility"===e||null!=(r=this._unevaluatedLayout)&&r.hasProperty(e))throw Error(e+SM);return this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){var i;if("visibility"===e||null!=(i=this._unevaluatedLayout)&&i.hasProperty(e))return this.fire(new MI(Error(e+SM))),!1;if(null!=t&&this._validate(Sn.paintProperty,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith("-transition"))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let r=this._transitionablePaint._values[e],i="cross-faded-data-driven"===r.property.specification["property-type"],n=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let o=this._transitionablePaint._values[e].value;return o.isDataDriven()||n||i||this._handleOverridablePaintPropertyUpdate(e,a,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e=this.minzoom,t=!1){return!!(this.minzoom&&e<(t?Math.floor(this.minzoom):this.minzoom))||!!this.maxzoom&&e>=this.maxzoom||"none"===this._evaluatedVisibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){var e,t;let r={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:null==(e=this._unevaluatedLayout)?void 0:e.serialize(),paint:null==(t=this._transitionablePaint)?void 0:t.serialize()};return this.visibility&&(r.layout||(r.layout={}),r.layout.visibility=this.visibility),xu(r,(e,t)=>void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length))}_validate(e,t,r,i,n={}){return _3(this,e,{key:t,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof Sy&&b$(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}},SE={get paint(){return SS||(SS=new SA({"raster-opacity":new Sx(Mz.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new Sx(Mz.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new Sx(Mz.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new Sx(Mz.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new Sx(Mz.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new Sx(Mz.paint_raster["raster-contrast"],"raster-contrast"),resampling:new Sx(Mz.paint_raster.resampling,"resampling"),"raster-resampling":new Sx(Mz.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new Sx(Mz.paint_raster["raster-fade-duration"],"raster-fade-duration")}))}},SD=e=>"raster"===e.type,SC=class extends Sk{constructor(e,t){super(e,SE,t)}},SI={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},SL=class{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}},SP=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let 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);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}},Sz=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}},Sz.prototype.bytesPerElement=4,_5("StructArrayLayout2i4",Sz),SF=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}},SF.prototype.bytesPerElement=6,_5("StructArrayLayout3i6",SF),SO=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,e}},SO.prototype.bytesPerElement=8,_5("StructArrayLayout4i8",SO),SR=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,e}},SR.prototype.bytesPerElement=12,_5("StructArrayLayout2i4i12",SR),SB=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,o){let s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=o,e}},SB.prototype.bytesPerElement=8,_5("StructArrayLayout2i4ub8",SB),Sj=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}},Sj.prototype.bytesPerElement=8,_5("StructArrayLayout2f8",Sj),SN=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,i,n,a,o,s,l,u)}emplace(e,t,r,i,n,a,o,s,l,u,c){let h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,e}},SN.prototype.bytesPerElement=20,_5("StructArrayLayout10ui20",SN),SV=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,r,i,n,a,o,s)}emplace(e,t,r,i,n,a,o,s,l){let u=8*e;return this.uint16[u+0]=t,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,e}},SV.prototype.bytesPerElement=16,_5("StructArrayLayout8ui16",SV),SU=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l,u,c,h,d){let f=this.length;return this.resize(f+1),this.emplace(f,e,t,r,i,n,a,o,s,l,u,c,h,d)}emplace(e,t,r,i,n,a,o,s,l,u,c,h,d,f){let p=14*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=i,this.int16[p+3]=n,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=u,this.int16[p+9]=c,this.int16[p+10]=h,this.int16[p+11]=d,this.float32[7*e+6]=f,e}},SU.prototype.bytesPerElement=28,_5("StructArrayLayout4i4ui4i1f28",SU),Sq=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}},Sq.prototype.bytesPerElement=12,_5("StructArrayLayout3f12",Sq),SG=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[+e+0]=t,e}},SG.prototype.bytesPerElement=4,_5("StructArrayLayout1ul4",SG),SH=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,i,n,a,o,s,l)}emplace(e,t,r,i,n,a,o,s,l,u){let c=10*e;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=a,this.int16[c+5]=o,this.uint32[5*e+3]=s,this.uint16[c+8]=l,this.uint16[c+9]=u,e}},SH.prototype.bytesPerElement=20,_5("StructArrayLayout6i1ul2ui20",SH),S$=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,e}},S$.prototype.bytesPerElement=12,_5("StructArrayLayout2i2i2i12",S$),SW=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n)}emplace(e,t,r,i,n,a){let o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=i,this.int16[s+6]=n,this.int16[s+7]=a,e}},SW.prototype.bytesPerElement=16,_5("StructArrayLayout2f1f2i16",SW),SY=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,o){let s=16*e,l=4*e,u=8*e;return this.uint8[s+0]=t,this.uint8[s+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=o,e}},SY.prototype.bytesPerElement=16,_5("StructArrayLayout2ub2f2i16",SY),SZ=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}},SZ.prototype.bytesPerElement=6,_5("StructArrayLayout3ui6",SZ),SX=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y){let v=this.length;return this.resize(v+1),this.emplace(v,e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y)}emplace(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v){let x=26*e,b=13*e,_=52*e;return this.int16[x+0]=t,this.int16[x+1]=r,this.uint16[x+2]=i,this.uint16[x+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=o,this.uint32[b+4]=s,this.uint16[x+10]=l,this.uint16[x+11]=u,this.uint16[x+12]=c,this.float32[b+7]=h,this.float32[b+8]=d,this.uint8[_+36]=f,this.uint8[_+37]=p,this.uint8[_+38]=m,this.uint32[b+10]=g,this.int16[x+22]=y,this.float32[b+12]=v,e}},SX.prototype.bytesPerElement=52,_5("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",SX),SK=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E){let D=this.length;return this.resize(D+1),this.emplace(D,e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E)}emplace(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D){let C=34*e,I=17*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=i,this.int16[C+3]=n,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=u,this.uint16[C+9]=c,this.uint16[C+10]=h,this.uint16[C+11]=d,this.uint16[C+12]=f,this.uint16[C+13]=p,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=b,this.uint16[C+20]=_,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[I+12]=A,this.float32[I+13]=M,this.float32[I+14]=k,this.uint16[C+30]=S,this.uint16[C+31]=E,this.float32[I+16]=D,e}},SK.prototype.bytesPerElement=68,_5("StructArrayLayout8i15ui1ul2f2ui1f68",SK),SJ=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[+e+0]=t,e}},SJ.prototype.bytesPerElement=4,_5("StructArrayLayout1f4",SJ),SQ=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.uint16[6*e+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}},SQ.prototype.bytesPerElement=12,_5("StructArrayLayout1ui2f12",SQ),S0=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=4*e;return this.uint32[2*e+0]=t,this.uint16[n+2]=r,this.uint16[n+3]=i,e}},S0.prototype.bytesPerElement=8,_5("StructArrayLayout1ul2ui8",S0),S1=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}},S1.prototype.bytesPerElement=4,_5("StructArrayLayout2ui4",S1),S2=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[+e+0]=t,e}},S2.prototype.bytesPerElement=2,_5("StructArrayLayout1ui2",S2),(S3=class extends SP{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,e}}).prototype.bytesPerElement=16,_5("StructArrayLayout4f16",S3),(S5=class extends SL{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new vl(this.anchorPointX,this.anchorPointY)}}).prototype.size=20,_5("CollisionBoxArray",S4=class extends SH{get(e){return new S5(this,e)}}),(S6=class extends SL{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}}).prototype.size=52,_5("PlacedSymbolArray",S8=class extends SX{get(e){return new S6(this,e)}}),(S7=class extends SL{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}}).prototype.size=68,_5("SymbolInstanceArray",S9=class extends SK{get(e){return new S7(this,e)}}),_5("GlyphOffsetArray",Ee=class extends SJ{getoffsetX(e){return this.float32[+e+0]}}),_5("SymbolLineVertexArray",Et=class extends SF{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}),(Er=class extends SL{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}).prototype.size=12,_5("TextAnchorOffsetArray",Ei=class extends SQ{get(e){return new Er(this,e)}}),(En=class extends SL{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]}}).prototype.size=8,_5("FeatureIndexArray",Ea=class extends S0{get(e){return new En(this,e)}}),Eo=class extends Sz{},Es=class extends SF{},El=class extends SO{},Eu=class extends Sz{},Ec=class extends Sz{},Eh=class extends SR{},Ed=class extends SB{},Ef=class extends Sj{},Ep=class extends SN{},Em=class extends SV{},Eg=class extends SU{},Ey=class extends Sq{},Ev=class extends SG{},Ex=class extends S${},Eb=class extends SW{},E_=class extends SY{},Ew=class extends SZ{},ET=class extends SZ{},EA=class extends S1{},EM=class extends S2{},ES=(Ek=wr([{name:"a_pos",components:2,type:"Int16"}],4)).members,Ek.size,Ek.alignment,(EE=class e{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(t,r,i,n){let a=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&xd(`Max vertices per segment is ${e.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${e.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,t,r){let i={vertexOffset:e.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==r&&(i.sortKey=r),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(i),i}getOrCreateLatestSegment(e,t,r){return this.prepareSegment(0,e,t,r)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(t,r,i,n){return new e([{vertexOffset:t,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}}).MAX_VERTEX_ARRAY_LENGTH=65535,_5("SegmentVector",EE),ED=wr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),EC=wr([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),EI=Mt((e,t)=>{void 0!==t&&(t.exports=function(e,t){for(var r,i,n=3&e.length,a=e.length-n,o=t,s=0;s>>16)*0xcc9e2d51&65535)<<16)|0)<<15|i>>>17))*0x1b873593+(((i>>>16)*0x1b873593&65535)<<16)|0,o=(65535&(r=(65535&(o=o<<13|o>>>19))*5+(((o>>>16)*5&65535)<<16)|0))+27492+(((r>>>16)+58964&65535)<<16);switch(i=0,n){case 3:i^=(255&e.charCodeAt(s+2))<<16;case 2:i^=(255&e.charCodeAt(s+1))<<8;case 1:i^=255&e.charCodeAt(s),o^=i=(65535&(i=(i=(65535&i)*0xcc9e2d51+(((i>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|i>>>17))*0x1b873593+(((i>>>16)*0x1b873593&65535)<<16)|0}return o^=e.length,o^=o>>>16,o=(65535&o)*0x85ebca6b+(((o>>>16)*0x85ebca6b&65535)<<16)|0,o^=o>>>13,o=(65535&o)*0xc2b2ae35+(((o>>>16)*0xc2b2ae35&65535)<<16)|0,(o^=o>>>16)>>>0})}),EL=Mt((e,t)=>{t.exports=function(e,t){for(var r,i=e.length,n=t^i,a=0;i>=4;)r=(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))*0x5bd1e995+(((r>>>16)*0x5bd1e995&65535)<<16),r^=r>>>24,n=(65535&n)*0x5bd1e995+(((n>>>16)*0x5bd1e995&65535)<<16)^(r=(65535&r)*0x5bd1e995+(((r>>>16)*0x5bd1e995&65535)<<16)),i-=4,++a;switch(i){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n^=255&e.charCodeAt(a),n=(65535&n)*0x5bd1e995+(((n>>>16)*0x5bd1e995&65535)<<16)}return n^=n>>>13,n=(65535&n)*0x5bd1e995+(((n>>>16)*0x5bd1e995&65535)<<16),(n^=n>>>15)>>>0}}),v=null==(y=Mt((e,t)=>{var r=EI(),i=EL();t.exports=r,t.exports.murmur3=r,t.exports.murmur2=i})())?{}:A4(A9(y)),EP=((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var i,n=A7(t),a=0,o=n.length;at[e]).bind(null,i),enumerable:!(r=A8(t,i))||r.enumerable});return e})(A6(v,"default",{value:y,enumerable:!0}),y),_5("FeaturePositionMap",Ez=class e{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,i){this.ids.push(wa(e)),this.positions.push(t,r,i)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let t=wa(e),r=0,i=this.ids.length-1;for(;r>1;this.ids[e]>=t?i=e:r=e+1}let n=[];for(;this.ids[r]===t;){let e=this.positions[3*r],t=this.positions[3*r+1],i=this.positions[3*r+2];n.push({index:e,start:t,end:i}),r++}return n}static serialize(e,t){let r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return function e(t,r,i,n){for(;i>1],o=i-1,s=n+1;for(;;){do o++;while(t[o]a);if(o>=s)break;wo(t,o,s),wo(r,3*o,3*s),wo(r,3*o+1,3*s+1),wo(r,3*o+2,3*s+2)}s-i`u_${e}`),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new EV(e,t):new ER(e,t)}},EW=class{constructor(e,t){this.uniformNames=t.map(e=>`u_${e}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}setUniform(e,t,r,i){let n=null;"u_pattern_to"===i?n=this.patternTo:"u_pattern_from"===i?n=this.patternFrom:"u_dasharray_to"===i?n=this.dashTo:"u_dasharray_from"===i?n=this.dashFrom:"u_pixel_ratio_to"===i?n=this.pixelRatioTo:"u_pixel_ratio_from"===i&&(n=this.pixelRatioFrom),null!==n&&e.set(n)}getBinding(e,t,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new EN(e,t):new ER(e,t)}},EY=class{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,t,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new Su(0,r),t,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(i,e,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new Su(0,n),r,i);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if("color"===this.type){let i=ws(r);for(let r=e;r`u_${e}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,t,r){let i=this.expression.evaluate(new Su(this.zoom,r),t,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new Su(this.zoom+1,r),t,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(a,e,i,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new Su(this.zoom,n),r,i),o=this.expression.evaluate(new Su(this.zoom+1,n),r,i);this._setPaintValue(e,t,a,o)}_setPaintValue(e,t,r,i){if("color"===this.type){let n=ws(r),a=ws(i);for(let r=e;r`#define HAS_UNIFORM_${e}`))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof EY||r instanceof EZ)for(let t of r.paintVertexAttributes)e.push(t.name);else if(r instanceof EX)for(let t of r.getVertexAttributes())e.push(t.name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof E$||r instanceof EW||r instanceof EZ)for(let t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof E$||n instanceof EW||n instanceof EZ){for(let a of n.uniformNames)if(t[a]){let o=n.getBinding(e,t[a],a);r.push({name:a,property:i,binding:o})}}}return r}setUniforms(e,t,r,i){for(let{name:e,property:n,binding:a}of t)this.binders[n].setUniform(a,i,r.get(n),e)}updatePaintBuffers(e){for(let t in this._buffers=[],this.binders){let r=this.binders[t];if(e&&r instanceof EX){let t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof EY||r instanceof EZ)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof EY||r instanceof EZ||r instanceof EX)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof EY||t instanceof EZ||t instanceof EX)&&t.destroy()}}},E0=class{constructor(e,t,r=()=>!0){for(let i of(this.programConfigurations={},e))this.programConfigurations[i.id]=new EQ(i,t,r);this.needsUpload=!1,this._featureMap=new Ez,this._bufferOffset=0}populatePaintArrays(e,t,r,i){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,i);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}},_5("ConstantBinder",E$),_5("CrossFadedConstantBinder",EW),_5("SourceExpressionBinder",EY),_5("CrossFadedPatternBinder",EK),_5("CrossFadedDasharrayBinder",EJ),_5("CompositeExpressionBinder",EZ),_5("ProgramConfiguration",EQ,{omit:["_buffers"]}),_5("ProgramConfigurationSet",E0),E2=-(E1=16383)-1,E3=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Eu,this.indexArray=new ET,this.segments=new EE,this.programConfigurations=new E0(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){let i=this.layers[0],n=[],a=null,o=!1,s="heatmap"===i.type;"circle"===i.type&&(o=!(a=i.layout.get("circle-sort-key")).isConstant(),s||(s="map"===i.paint.get("circle-pitch-alignment")));let l=s?t.subdivisionGranularity.circle:1,u=new Su(this.zoom),c=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:i,index:s,sourceLayerIndex:l}of e){let e=wc(t,c);if(!this.layers[0]._featureFilter.filter(u,e,r))continue;let h=o?a.evaluate(e,{},r):void 0,d={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:c?e.geometry:wu(t),patterns:{},sortKey:h};n.push(d)}for(let i of(o&&n.sort((e,t)=>e.sortKey-t.sortKey),n)){let{geometry:n,index:a,sourceLayerIndex:o}=i,s=e[a].feature;this.addFeature(i,n,a,r,l),t.featureIndex.insert(s,n,a,o,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures(e){}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ES),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let o=a.length;for(let r of t)for(let t of r){let r=t.x,i=t.y;if(r<0||r>=8192||i<0||i>=8192)continue;let n=this.segments.prepareSegment(o*o,this.layoutVertexArray,this.indexArray,e.sortKey),c=n.vertexLength;for(let e=0;e"circle"===e.type,E7=class extends Sk{constructor(e,t){super(e,E6,t)}createBucket(e){return new E3(e)}queryRadius(e){return wx("circle-radius",this,e)+wx("circle-stroke-width",this,e)+wb(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){let l=w_(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c=this.paint.get("circle-pitch-scale"),h=this.paint.get("circle-pitch-alignment"),d,f;return"map"===h?(d=l,f=u*a):(d=l.map(e=>wS(e,n,o,s)),f=u),wk({queryGeometry:d,size:f,transform:n,unwrappedTileID:o,getElevation:s,pitchAlignment:h,pitchScale:c},i)}},_5("HeatmapBucket",E9=class extends E3{},{omit:["layers"]}),Dt={get paint(){return De||(De=new SA({"heatmap-radius":new Sb(Mz.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new Sb(Mz.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new Sx(Mz.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new ST(Mz.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new Sx(Mz.paint_heatmap["heatmap-opacity"],"heatmap-opacity")}))}},Dr=class e{constructor(e,t){wE(this,e,1,t)}resize(e){wD(this,e,1)}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){wC(e,t,r,i,n,1)}},Di=class e{constructor(e,t){wE(this,e,4,t)}resize(e){wD(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){wC(e,t,r,i,n,4)}setPixel(e,t,r){let i=(e*this.width+t)*4;this.data[i+0]=Math.round(255*r.r/r.a),this.data[i+1]=Math.round(255*r.g/r.a),this.data[i+2]=Math.round(255*r.b/r.a),this.data[i+3]=Math.round(255*r.a)}},_5("AlphaImage",Dr),_5("RGBAImage",Di),Dn="big-fb",Da=e=>"heatmap"===e.type,Do=class extends Sk{createBucket(e){return new E9(e)}constructor(e,t){super(e,Dt,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=wL({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(Dn)}queryRadius(e){return wx("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){return wk({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(t,r)*a,transform:n,unwrappedTileID:o,getElevation:s},i)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}},Dl={get paint(){return Ds||(Ds=new SA({"hillshade-illumination-direction":new Sx(Mz.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new Sx(Mz.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new Sx(Mz.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new Sx(Mz.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new Sx(Mz.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new Sx(Mz.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new Sx(Mz.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new Sx(Mz.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new Sx(Mz.paint_hillshade.resampling,"resampling")}))}},Du=e=>"hillshade"===e.type,Dc=class extends Sk{constructor(e,t){super(e,Dl,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,t=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(e.length,t.length,r.length,i.length);e=e.concat(Array(n-e.length).fill(e.at(-1))),t=t.concat(Array(n-t.length).fill(t.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=t.map(xy);return{directionRadians:e.map(xy),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}},Dd={get paint(){return Dh||(Dh=new SA({"color-relief-opacity":new Sx(Mz["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new ST(Mz["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new Sx(Mz["paint_color-relief"].resampling,"resampling")}))}},Df=class{constructor(e,t,r,i){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(t,i)}update(e,t,r){var i;let{width:n,height:a}=e,o=((null==(i=this.size)?void 0:i[0])!==n||this.size[1]!==a)&&!r,{context:s}=this,{gl:l}=s;this.useMipmap=!!t?.useMipmap,o&&this.size&&this.format===l.RGBA&&(l.deleteTexture(this.texture),this.texture=l.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let u=this.format===l.RGBA&&t?.premultiply!==!1;if(o)if(this.size=[n,a],this.format===l.RGBA&&n>0&&a>0){let t=this.useMipmap?Math.floor(Math.log2(Math.max(n,a)))+1:1;if(l.texStorage2D(l.TEXTURE_2D,t,l.RGBA8,n,a),wP(e)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:t}=e;u&&t&&(t=wI(t)),t&&l.texSubImage2D(l.TEXTURE_2D,0,0,0,n,a,l.RGBA,l.UNSIGNED_BYTE,t)}else s.pixelStoreUnpackPremultiplyAlpha.set(u),l.texSubImage2D(l.TEXTURE_2D,0,0,0,l.RGBA,l.UNSIGNED_BYTE,e)}else wP(e)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,u,n,a,l)):(s.pixelStoreUnpackPremultiplyAlpha.set(u),this._uploadDomImage(e,l));else{let{x:t,y:i}=r||{x:0,y:0};wP(e)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,u,t,i,n,a,l)):(s.pixelStoreUnpackPremultiplyAlpha.set(u),this._updateDomImage(e,t,i,l))}this.useMipmap&&!(wP(e)&&null===e.data)&&l.generateMipmap(l.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,t){t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,e)}_uploadRawData(e,t,r,i,n){let{data:a}=e;t&&a&&(a=wI(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(e,t,r,i){i.texSubImage2D(i.TEXTURE_2D,0,t,r,i.RGBA,i.UNSIGNED_BYTE,e)}_updateRawData(e,t,r,i,n,a,o){let{data:s}=e;t&&s&&(s=wI(s)),o.texSubImage2D(o.TEXTURE_2D,0,r,i,n,a,o.RGBA,o.UNSIGNED_BYTE,s)}bind(e,t,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST&&r!==n.LINEAR_MIPMAP_LINEAR||this.useMipmap||(r=n.LINEAR);let a=r||e;e!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),this.magFilter=e),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)}generateMipmap(){if(!this.useMipmap)return;let{gl:e}=this.context;e.bindTexture(e.TEXTURE_2D,this.texture),e.generateMipmap(e.TEXTURE_2D)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},(Dp=class{constructor(e,t,r,i=1,n=1,a=1,o=0){if(this.uid=e,t.height!==t.width)throw RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void xd(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=t.height;let s=this.dim=t.height-4;switch(this.data=new Uint32Array(t.data.buffer),Dp.byteViewCache.set(this,new Uint8Array(this.data.buffer)),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=n,this.blueFactor=a,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=-2;e=s)&&this.data.copyWithin(this._idx(0,e),t,t+s),this.data.fill(this.data[t],this._idx(-2,e),this._idx(0,e)),this.data.fill(this.data[t+s-1],this._idx(s,e),this._idx(s+1,e)+1)}let l=this._getByteView();this.min=0x1fffffffffffff,this.max=-0x1fffffffffffff;for(let e=0;ethis.max&&(this.max=i),i=this.dim||i<-1||i>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);let n=this._getByteView(),a=((i+2)*this.stride+r+2)*4,o=4*this.stride,s=e-r,l=t-i;return this._unpackAtIndex(n,a)*(1-s)*(1-l)+this._unpackAtIndex(n,a+4)*s*(1-l)+this._unpackAtIndex(n,a+o)*(1-s)*l+this._unpackAtIndex(n,a+o+4)*s*l}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-2||e>=this.dim+2||t<-2||t>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);return(t+2)*this.stride+(e+2)}unpack(e,t,r){return e*this.redFactor+t*this.greenFactor+r*this.blueFactor-this.baseShift}pack(e){return wz(e,this.getUnpackVector())}getPixels(){return new Di({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,t,r){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let i=t*this.dim,n=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case -1:i=n-2;break;case 1:n=i+2}switch(r){case -1:a=o-2;break;case 1:o=a+2}let s=-t*this.dim,l=-r*this.dim;for(let t=a;t"color-relief"===e.type,Dg=class extends Sk{constructor(e,t){super(e,Dd,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values["color-relief-color"].value.expression;if(r instanceof k5&&r._styleExpression.expression instanceof ky){this.colorRampExpression=r;let e=r._styleExpression.expression;for(let r of(t.elevationStops=e.labels,t.colorStops=[],t.elevationStops))t.colorStops.push(e.evaluate({globals:{elevation:r}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[ke.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let i={elevationStops:[],colorStops:[]},n=(t.elevationStops.length-1)/(e-1);for(let e=0;ee)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<32767||t>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=0|Math.round(e),i=0|Math.round(t),n=this._getKey(r,i);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,a),this._vertexBuffer.push(r,i),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return function(e,t){let r=[];for(let i=0;i0?(r.push(n),r.push(o),r.push(a)):(r.push(n),r.push(a),r.push(o))}return r}(this._vertexBuffer,e);let t=[],r=e.length;for(let i=0;i=0?o-1:a-1,n=(s+1)%a,l=e[2*t[i]],u=e[2*t[i]+1],c=e[2*t[n]],h=e[2*t[n]+1],d=e[2*t[o]],f=e[2*t[o]+1],p=e[2*t[s]],m=e[2*t[s]+1],g=!1;if(lc)g=!1;else{let e=m-f,t=-(p-d),r=f((c-d)*e+(h-f)*t)*r&&(g=!0)}if(g){let e=t[i],n=t[o],l=t[s];e!==n&&e!==l&&n!==l&&r.push(l,n,e),--o<0&&(o=a-1)}else{let e=t[n],i=t[o],l=t[s];e!==i&&e!==l&&i!==l&&r.push(l,i,e),++s>=a&&(s=0)}if(i===n)break}}(this._vertexBuffer,i,t)}}return t}_scanlineGenerateVertexRingForCellRow(e,t,r){let i=e*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let e=0;e<3;e++){let o=t[2*e],s=t[2*e+1],l=t[(e+1)*2%6],u=t[((e+1)*2+1)%6],c=t[(e+2)*2%6],h=t[((e+2)*2+1)%6],d=l-o,f=u-s,p=0===d,m=0===f,g=(i-s)/f,y=(n-s)/f,v=Math.min(g,y),x=Math.max(g,y);if(!m&&(v>=1||x<=0)||m&&(sn)){u>=i&&u<=n&&a.push(r[(e+1)%3]);continue}if(!m&&v>0){let e=o+d*v,t=s+f*v;a.push(this._vertexToIndex(e,t))}let b=o+d*Math.max(v,0),_=o+d*Math.min(x,1);if(p||this._generateIntraEdgeVertices(a,o,s,l,u,b,_),!m&&x<1){let e=o+d*x,t=s+f*x;a.push(this._vertexToIndex(e,t))}(m||u>=i&&u<=n)&&a.push(r[(e+1)%3]),!m&&(u<=i||u>=n)&&this._generateInterEdgeVertices(a,o,s,l,u,c,h,_,i,n)}return a}_generateIntraEdgeVertices(e,t,r,i,n,a,o){let s=i-t,l=n-r,u=0===l,c=u?Math.min(t,i):Math.min(a,o),h=u?Math.max(t,i):Math.max(a,o),d=Math.floor(c/this._granularityCellSize)+1,f=Math.ceil(h/this._granularityCellSize)-1;if(u?t=d;i--){let n=i*this._granularityCellSize,a=r+l*(n-t)/s;e.push(this._vertexToIndex(n,a))}}_generateInterEdgeVertices(e,t,r,i,n,a,o,s,l,u){let c=o-n,h=(l-n)/c,d=(u-n)/c,f=Math.min(h,d),p=Math.max(h,d),m=i+(a-i)*f,g=Math.floor(Math.min(m,s)/this._granularityCellSize)+1,y=Math.ceil(Math.max(m,s)/this._granularityCellSize)-1,v=s=1||p<=0){let e=r-o,i=a+(t-a)*Math.min((l-o)/e,(u-o)/e);g=Math.floor(Math.min(i,s)/this._granularityCellSize)+1,y=Math.ceil(Math.max(i,s)/this._granularityCellSize)-1,v=s0?u:l;if(v)for(let t=g;t<=y;t++){let r=t*this._granularityCellSize;e.push(this._vertexToIndex(r,b))}else for(let t=y;t>=g;t--){let r=t*this._granularityCellSize;e.push(this._vertexToIndex(r,b))}}_generateOutline(e){let t=[];for(let r of e){let e=w2(r,this._granularity,!0),i=this._pointArrayToIndices(e),n=[];for(let e=1;en==(-32768===a)?(e.push(r),e.push(t),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(n,a)),e.push(r)):(e.push(t),e.push(r),e.push(this._vertexToIndex(i,a)),e.push(r),e.push(this._vertexToIndex(n,a))),e.push(this._vertexToIndex(i,a))}_fillPoles(e,t,r){let i=this._vertexBuffer,n=Md,a=e.length;for(let o=2;oDw[s+3]||Dw[s]>i||Dw[s+2]<=a)continue;let l=wV(t);r=wU(t);do{if(r.prev.next===r){if(wW(e,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let e=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=i&&e>a&&(a=e,o=r.xi||Dw[p+3]c)continue;let m=wV(t);r=wU(t);do{if(r.prev.next===r&&i>=r.x&&r.x>=s&&i!==r.x&&wH(ni)&&(to.x||r.x===o.x&&(d=o,f=r,0>w$(d.prev,d,f.prev)&&0>w$(f.next,d,d.next))))&&(o=r,h=t)}r=r.next}while(r!==m)}return o}(e,t);if(!r)return t;let i=wK(r,e);return wN(r,i.next.next),wB(i,i.next),wB(r,r.next)}(s[e],r);return D_=!1,wB(r)}(e,t,a,r)),e.length>80*r){s=e[0],l=e[1];let t=s,i=l;for(let a=r;at&&(t=r),n>i&&(i=n)}u=0===(u=Math.max(t-s,i-l))?0:32767/u}return function e(t,r,i,n,a){a&&function(e,t,r,i){let n=e,a=0;do n.z=wG(n.x,n.y,t,r,i),Dk[a++]=n,n=n.next;while(n!==e);!function(e){if(e<=32){for(let t=1;t=0&&Dk[i].z>r;)Dk[i+1]=Dk[i],i--;Dk[i+1]=e}return}DE.lengthw$(l,t,u)&&(a?function(e,t,r,i){let n=e.prev,a=e.next,o=n.x,s=e.x,l=a.x,u=n.y,c=e.y,h=a.y,d=Math.min(o,s,l),f=Math.min(u,c,h),p=Math.max(o,s,l),m=Math.max(u,c,h),g=wG(d,f,t,r,i),y=wG(p,m,t,r,i),v=e.prevZ;for(;v&&v.z>=g;){if(v.x>=d&&v.x<=p&&v.y>=f&&v.y<=m&&v!==a&&(o!==v.x||u!==v.y)&&wH(o,u,s,c,l,h,v.x,v.y)&&w$(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let x=e.nextZ;for(;x&&x.z<=y;){if(x.x>=d&&x.x<=p&&x.y>=f&&x.y<=m&&x!==a&&(o!==x.x||u!==x.y)&&wH(o,u,s,c,l,h,x.x,x.y)&&w$(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}(t,i,n,a):function(e){let t=e.prev,r=e.next,i=t.x,n=e.x,a=r.x,o=t.y,s=e.y,l=r.y,u=Math.min(i,n,a),c=Math.min(o,s,l),h=Math.max(i,n,a),d=Math.max(o,s,l),f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=h&&f.y>=c&&f.y<=d&&(i!==f.x||o!==f.y)&&wH(i,o,n,s,a,l,f.x,f.y)&&w$(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}(t))){r.push(l.i,t.i,u.i),wQ(t),t=u,o=u;continue}if((t=u)===o){if(Db=!1,t=wB(t),Db){o=t;continue}if(!s){o=t=function(e,t){let r=e,i=!1;do{let n=r.prev,a=r.next.next;wY(n,r,r.next,a,!1)&&wX(n,a)&&wX(a,n)&&(t.push(n.i,r.i,a.i),wQ(r),wQ(r.next),r=e=a,i=!0),r=r.next}while(r!==e);return i?wB(r):r}(t,r),s=!0;continue}!function(t,r,i,n,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&function(e,t){let r=wW(e,t)&&w$(e.prev,e,e.next)>0&&w$(t.prev,t,t.next)>0;return e.next.i!==t.i&&(r||wX(e,t)&&wX(t,e)&&(0!==w$(e.prev,e,t.prev)||0!==w$(e,t.prev,t)))&&!function(e,t){let r=Math.min(e.x,t.x),i=Math.max(e.x,t.x),n=Math.min(e.y,t.y),a=Math.max(e.y,t.y),o=e;do{let s=o.next;if(o.x>i&&s.x>i||o.xa&&s.y>a||o.ya!=e.y>a&&n<(e.x-r.x)*(a-r.y)/(e.y-r.y)+r.x&&(i=!i),r=e}while(r!==e);return i}(e,t))}(o,t)){let s=wK(o,t);o=wB(o,o.next),s=wB(s,s.next),e(o,r,i,n,a),e(s,r,i,n,a);return}t=t.next}o=o.next}while(o!==t)}(t,r,i,n,a);break}}}(a,o,s,l,u),o}(n,a),t=this._convertIndices(n,e);i=this._subdivideTrianglesScanline(t)}catch(e){console.error(e)}let o=[];return t&&(o=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(i),this._granularity>=2&&(null==(r=this._canonical)?void 0:r.z)===0&&(i=this._removeTrianglesOutsideTileX(i),o=o.map(e=>this._removeLinesOutsideTileX(e))),{verticesFlattened:this._vertexBuffer,indicesTriangles:i,indicesLineList:o}}_vertexOutsideTileX(e){let t=this._vertexBuffer[2*e];return t<0||t>8192}_removeTrianglesOutsideTileX(e){let t=[];for(let r=0;re.id),this.index=e.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new Ec,this.indexArray=new ET,this.indexArray2=new EA,this.programConfigurations=new E0(e.layers,e.zoom),this.segments=new EE,this.segments2=new EE,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.hasDependencies=wF("fill",this.layers,t);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],o=new Su(this.zoom),s=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of e){let e=wc(l,s);if(!this.layers[0]._featureFilter.filter(o,e,r))continue;let d=n?i.evaluate(e,{},r,t.availableImages):void 0,f={id:u,properties:l.properties,type:l.type,sourceLayerIndex:h,index:c,geometry:s?e.geometry:wu(l),patterns:{},sortKey:d};a.push(f)}for(let i of(n&&a.sort((e,t)=>e.sortKey-t.sortKey),a)){let{geometry:n,index:a,sourceLayerIndex:o}=i;if(this.hasDependencies){let e=wO("fill",this.layers,i,{zoom:this.zoom},t);this.patternFeatures.push(e)}else this.addFeature(i,n,a,r,{},t.subdivisionGranularity);let s=e[a].feature;t.featureIndex.insert(s,n,a,o,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:e,canonical:t,patternPositions:r,patternMap:i}){for(let n of(this.detectSdfPatterns(i),this.patternFeatures))this.addFeature(n,n.geometry,n.index,t,r,e.subdivisionGranularity)}detectSdfPatterns(e){for(let t of this.patternFeatures)for(let r in t.patterns){let i=t.patterns[r];this.recordSdfPattern(r,e[i.min]),this.recordSdfPattern(r,e[i.mid]),this.recordSdfPattern(r,e[i.max])}for(let t of this.layers){let r=t.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(t.id,e[r.from.toString()]),this.recordSdfPattern(t.id,e[r.to.toString()]))}}recordSdfPattern(e,t){if(!t)return;let r=!0===t.sdf,i=this.sdfPatterns[e];void 0===i?this.sdfPatterns[e]=r:i!==r&&xd(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${e}"`)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Dv),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,r,i,n,a){for(let e of x5(t,500)){let t=w1(e,i,a.fill.getGranularityForZoomLevel(i.z)),r=this.layoutVertexArray;w3((e,t)=>{r.emplaceBack(e,t)},this.segments,this.layoutVertexArray,this.indexArray,t.verticesFlattened,t.indicesTriangles,this.segments2,this.indexArray2,t.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}},{omit:["layers","patternFeatures"]}),DN={get paint(){return Dj||(Dj=new SA({"fill-antialias":new Sx(Mz.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new Sb(Mz.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new Sx(Mz.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new Sb(Mz.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new Sb(Mz.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new Sx(Mz.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new Sx(Mz.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new S_(Mz.paint_fill["fill-pattern"],"fill-pattern")}))},get layout(){return DB||(DB=new SA({"fill-sort-key":new Sb(Mz.layout_fill["fill-sort-key"],"fill-sort-key")}))}},DV=e=>"fill"===e.type,DU=class extends Sk{constructor(e,t){super(e,DN,t)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new DR(e)}queryRadius(){return wb(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:r,pixelsToTileUnits:i}){return wf(w_(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),t)}isTileClipped(){return!0}},Dq=wr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),DG=wr([{name:"a_centroid",components:2,type:"Int16"}],4),DH=Dq.members,Dq.size,Dq.alignment,DW=(D$=class e{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(t){let r=new e;return r.extend(t(new vl(this.minX,this.minY))),r.extend(t(new vl(this.maxX,this.minY))),r.extend(t(new vl(this.minX,this.maxY))),r.extend(t(new vl(this.maxX,this.maxY))),r}static fromPoints(t){let r=new e;for(let e of t)r.extend(e);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}}).fromPoints([new vl(0,0),new vl(Md,Md)]),(DY=class{constructor(e,t,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n;e.pos>3))continue}if(a--,1===n)o+=e.readSVarint(),s+=e.readSVarint(),i&&r.push(i),i=[new vl(o,s)];else if(2===n)o+=e.readSVarint(),s+=e.readSVarint(),i&&i.push(new vl(o,s));else if(7===n)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=1,i=0,n=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;for(;e.pos>3))continue}if(i--,1===r||2===r)n+=e.readSVarint(),a+=e.readSVarint(),ns&&(s=n),au&&(u=a);else if(7!==r)throw Error(`unknown command ${r}`)}return[o,l,s,u]}toGeoJSON(e,t,r){let i,n=this.extent*2**r,a=this.extent*e,o=this.extent*t,s=this.loadGeometry();function l(e){return[(e.x+a)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+o)*2/n)*Math.PI))-90]}function u(e){return e.map(l)}if(1===this.type){let e=[];for(let t of s)e.push(t[0]);let t=u(e);i=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){let e=s.map(u);i=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else if(3===this.type){let e=w8(s),t=[];for(let r of e)t.push(r.map(u));i=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}else throw Error("unknown feature type");let c={type:"Feature",geometry:i,properties:this.properties};return null!=this.id&&(c.id=this.id),c}}).types=["Unknown","Point","LineString","Polygon"],DZ=class{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],void 0===t&&(t=e.length);e.pos=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new DY(this._pbf,t,this.extent,this._keys,this._values)}},DX=class{constructor(e,t=e.length){let r=Object.create(null);for(;e.pos90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new e(xr(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let t=Math.PI/180,r=this.lat*t,i=e.lat*t,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return DK*Math.acos(Math.min(n,1))}static convert(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&t)return new e(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}},DQ=2*Math.PI*DK,D0=class e{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(t,r=0){let i=DJ.convert(t);return new e(w9(i.lng),Te(i.lat),r/w7(i.lat))}toLngLat(){return new DJ(Tt(this.x),Tr(this.y))}toAltitude(){return this.z*w7(Tr(this.y))}meterInMercatorCoordinateUnits(){return 1/DQ*(1/Math.cos(Tr(this.y)*Math.PI/180))}},D1=89.25,D2=8192,_5("FillExtrusionBucket",D3=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Eh,this.centroidVertexArray=new Eo,this.indexArray=new ET,this.programConfigurations=new E0(e.layers,e.zoom),this.segments=new EE,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.features=[],this.hasDependencies=wF("fill-extrusion",this.layers,t);let i=new Su(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),o=n._featureFilter.needGeometry;for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of e){let e=wc(s,o);if(!n._featureFilter.filter(i,e,r))continue;let h=o?e.geometry:wu(s),d={id:l,sourceLayerIndex:c,index:u,geometry:a>0?Tc(h,a,r):h,properties:s.properties,type:s.type,patterns:{}};this.hasDependencies?this.features.push(wO("fill-extrusion",this.layers,d,{zoom:this.zoom},t)):this.addFeature(d,d.geometry,u,r,{},t.subdivisionGranularity),t.featureIndex.insert(s,d.geometry,u,c,this.index,!0)}}addFeatures({options:e,canonical:t,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,t,r,e.subdivisionGranularity)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,DH),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,DG.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,i,n,a){let o=this.layers[0],s=o.layout?o.layout.get("fill-extrusion-rounded-corner-distance"):0;for(let r of x5(s>0?Tc(t,s,i):t,500)){let t={x:0,y:0,sampleCount:0},n=this.layoutVertexArray.length;this.processPolygon(t,i,e,r,a);let o=this.layoutVertexArray.length-n,s=Math.floor(t.x/t.sampleCount),l=Math.floor(t.y/t.sampleCount);for(let e=0;e{Th(u,e,t,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(e,t){let r=0;for(let i=1;iEE.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=n.sub(a)._perp()._unit(),s=a.dist(n);r+s>32768&&(r=0),Th(this.layoutVertexArray,n.x,n.y,o.x,o.y,0,0,r),Th(this.layoutVertexArray,n.x,n.y,o.x,o.y,0,1,r),r+=s,Th(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,0,r),Th(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,1,r);let l=t.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}},{omit:["layers","features"]}),D6={get paint(){return D4||(D4=new SA({"fill-extrusion-opacity":new Sx(Mz["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new Sb(Mz["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new Sx(Mz["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new Sx(Mz["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new S_(Mz["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new Sb(Mz["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new Sb(Mz["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new Sx(Mz["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")}))},get layout(){return D5||(D5=new SA({"fill-extrusion-rounded-corner-distance":new Sx(Mz["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")}))}},D8=e=>"fill-extrusion"===e.type,D7=class extends Sk{constructor(e,t){super(e,D6,t)}createBucket(e){return new D3(e)}queryRadius(){return wb(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:o}){let s=w_(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(t,r),u=this.paint.get("fill-extrusion-base").evaluate(t,r),c=function(e,t){let r=[];for(let i of e){let e=[i.x,i.y,0,1];vV(e,e,t),r.push(new vl(e[0]/e[3],e[1]/e[3]))}return r}(s,o),h=function(e,t,r,i){let n=[],a=[],o=i[8]*t,s=i[9]*t,l=i[10]*t,u=i[11]*t,c=i[8]*r,h=i[9]*r,d=i[10]*r,f=i[11]*r;for(let t of e){let e=[],r=[];for(let n of t){let t=n.x,a=n.y,p=i[0]*t+i[4]*a+i[12],m=i[1]*t+i[5]*a+i[13],g=i[2]*t+i[6]*a+i[14],y=i[3]*t+i[7]*a+i[15],v=p+o,x=m+s,b=g+l,_=y+u,w=p+c,T=m+h,A=g+d,M=y+f,k=new vl(v/_,x/_);k.z=b/_,e.push(k);let S=new vl(w/M,T/M);S.z=A/M,r.push(S)}n.push(e),a.push(r)}return[n,a]}(i,u,l,o);return function(e,t,r){let i=1/0;wf(r,t)&&(i=Tf(r,t[0]));for(let n=0;ne.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers))this.gradients[t.id]={};this.layoutVertexArray=new Ed,this.layoutVertexArray2=new Ef,this.indexArray=new ET,this.programConfigurations=new E0(e.layers,e.zoom),this.segments=new EE,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.hasDependencies=wF("line",this.layers,t)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],o=new Su(this.zoom),s=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:l,index:u,sourceLayerIndex:c}of e){let e=wc(t,s);if(!this.layers[0]._featureFilter.filter(o,e,r))continue;let h=n?i.evaluate(e,{},r):void 0,d={id:l,properties:t.properties,type:t.type,sourceLayerIndex:c,index:u,geometry:s?e.geometry:wu(t),patterns:{},dashes:{},sortKey:h};a.push(d)}for(let i of(n&&a.sort((e,t)=>e.sortKey-t.sortKey),a)){let{geometry:n,index:a,sourceLayerIndex:o}=i;this.hasDependencies?(wF("line",this.layers,t)?wO("line",this.layers,i,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,i,this.zoom,t),this.patternFeatures.push(i)):this.addFeature(i,n,a,r,{},{},t.subdivisionGranularity);let s=e[a].feature;t.featureIndex.insert(s,n,a,o,this.index)}}update(e,t,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:e,canonical:t,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r,i,e.subdivisionGranularity)}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,Cr)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ce),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,"geojsonvt_clip_start")&&Object.hasOwn(e.properties,"geojsonvt_clip_end"))return{start:+e.properties.geojsonvt_clip_start,end:+e.properties.geojsonvt_clip_end}}addFeature(e,t,r,i,n,a,o){let s=this.layers[0].layout,l=s.get("line-join").evaluate(e,{}),u=s.get("line-cap").evaluate(e,{}),c=s.get("line-miter-limit").evaluate(e,{}),h=s.get("line-round-limit").evaluate(e,{});for(let r of(this.lineClips=this.lineFeatureClips(e),t))this.addLine(r,e,l,u,c,h,i,o);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(e,t,r,i,n,a,o,s){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=o?s.line.getGranularityForZoomLevel(o.z):1;if(e=w2(e,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t=2&&e[c-1].equals(e[c-2]);)c--;let h=0;for(;h0;if(_&&t>h){let e=p.dist(m);if(e>2*d){let t=p.sub(p.sub(m)._mult(d/e)._round());this.updateDistance(m,t),this.addCurrentVertex(t,y,0,0,f),m=t}}let T=m&&g,A=T?r:u?"butt":i;if(T&&"round"===A&&(xn&&(A="bevel"),"bevel"===A&&(x>2&&(A="flipbevel"),x100)o=v.mult(-1);else{let e=x*y.add(v).mag()/y.sub(v).mag();o._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(p,o,0,0,f),this.addCurrentVertex(p,o.mult(-1),0,0,f)}else if("bevel"===A||"fakeround"===A){let e=-Math.sqrt(x*x-1),t=w?e:0,r=w?0:e;if(m&&this.addCurrentVertex(p,y,t,r,f),"fakeround"===A){let e=Math.round(180*b/Math.PI/20);for(let t=1;t2*d){let t=p.add(g.sub(p)._mult(d/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,v,0,0,f),p=t}}}}addCurrentVertex(e,t,r,i,n,a=!1){let o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*i,u=-t.y-t.x*i;this.addHalfVertex(e,o,s,a,!1,r,n),this.addHalfVertex(e,l,u,a,!0,-i,n),this.distance>16384&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,i,n,a))}addHalfVertex({x:e,y:t},r,i,n,a,o,s){let l=(this.lineClips?32767*this.scaledDistance:this.scaledDistance)*.5;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!n,(t<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*i)+128,(0===o?0:o<0?-1:1)+1|(63&l)<<2,l>>6),this.lineClips){let e=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(e,this.lineClipsArray.length)}let u=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),s.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let e=t.paint.get("line-dasharray");if(e&&!e.isConstant())return!0}return!1}addLineDashDependencies(e,t,r,i){for(let n of e){let e=n.paint.get("line-dasharray");if(!e||"constant"===e.value.kind)continue;let a="round"===n.layout.get("line-cap").evaluate(t,{}),o={dasharray:e.value.evaluate({zoom:r-1},t,{}),round:a},s={dasharray:e.value.evaluate({zoom:r},t,{}),round:a},l={dasharray:e.value.evaluate({zoom:r+1},t,{}),round:a},u=`${o.dasharray.join(",")},${o.round}`,c=`${s.dasharray.join(",")},${s.round}`,h=`${l.dasharray.join(",")},${l.round}`;i.dashDependencies[u]=o,i.dashDependencies[c]=s,i.dashDependencies[h]=l,t.dashes[n.id]={min:u,mid:c,max:h}}}},{omit:["layers","patternFeatures"]}),Cs={get paint(){return Co||(Co=new SA({"line-opacity":new Sb(Mz.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new Sx(Mz.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new Sb(Mz.paint_line["line-color"],"line-color"),"line-translate":new Sx(Mz.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new Sx(Mz.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new Sb(Mz.paint_line["line-width"],"line-width"),"line-gap-width":new Sb(Mz.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new Sb(Mz.paint_line["line-offset"],"line-offset"),"line-blur":new Sb(Mz.paint_line["line-blur"],"line-blur"),"line-dasharray":new S_(Mz.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new S_(Mz.paint_line["line-pattern"],"line-pattern"),"line-gradient":new ST(Mz.paint_line["line-gradient"],"line-gradient")}))},get layout(){return Ca||(Ca=new SA({"line-cap":new Sb(Mz.layout_line["line-cap"],"line-cap"),"line-join":new Sb(Mz.layout_line["line-join"],"line-join"),"line-miter-limit":new Sb(Mz.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new Sb(Mz.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new Sb(Mz.layout_line["line-sort-key"],"line-sort-key")}))}},Cl=class extends Sb{possiblyEvaluate(e,t){return t=new Su(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=xi({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}},Cc=e=>"line"===e.type,Ch=class extends Sk{constructor(e,t){super(e,Cs,t),this.gradientVersion=0,Cu||((Cu=new Cl(Cs.paint.properties["line-width"].specification,"line-floorwidth")).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this.gradientExpression();this.stepInterpolant=void 0!==e._styleExpression&&e._styleExpression.expression instanceof kg,this.gradientVersion=(this.gradientVersion+1)%0x1fffffffffffff}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Cu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Cn(e)}queryRadius(e){var t,r;return t=wx("line-width",this,e),((r=wx("line-gap-width",this,e))>0?r+2*t:t)/2+Math.abs(wx("line-offset",this,e))+wb(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){var o,s;let l=w_(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),u=a/2*(o=this.paint.get("line-width").evaluate(t,r),(s=this.paint.get("line-gap-width").evaluate(t,r))>0?s+2*o:o),c=this.paint.get("line-offset").evaluate(t,r);return c&&(i=function(e,t){let r=[];for(let i of e){let e=function(e){let t=[];for(let r=0;r=3){for(let t of i)if(wv(e,t))return!0}if(function(e,t,r){if(e.length>1){if(wp(e,t))return!0;for(let i of t)if(wm(i,e,r))return!0}for(let i of e)if(wm(i,t,r))return!0;return!1}(e,i,r))return!0}return!1}(l,i,u)}isTileClipped(){return!0}},Cd=wr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),Cf=wr([{name:"a_projected_pos",components:3,type:"Float32"}],4),wr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Cp=wr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),wr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Cm=wr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Cg=wr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),wr([{name:"triangle",components:3,type:"Uint16"}]),wr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),wr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),wr([{type:"Float32",name:"offsetX"}]),wr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),wr([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]),Cy=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Cy.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}syncState(e,t){return b(this,null,function*(){if(this.isParsed())return this.getState();if("loading"!==e.pluginStatus)return this.setState(e),e;let r=e.pluginURL,i=new Promise(e=>{this.loadScriptResolve=e}),n=new Promise(e=>setTimeout(()=>e(),this.TIMEOUT));if(yield t(r),yield Promise.race([i,n]),this.isParsed()){let e={pluginStatus:"loaded",pluginURL:r};return this.setState(e),e}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)})}},Cv={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},Cx={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},Cb={لآ:[65269,65270],لأ:[65271,65272],لإ:[65273,65274],لا:[65275,65276]},C_=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/,Cw=new Map,Object.entries(Cv)))!function(e,t,r){let i=0;for(let n of e.split(";")){let[e,a]=n.split(",").map(e=>parseInt(e,36)),o=i+e;for(let e=o;etypeof Intl&&"Segmenter"in Intl,Ck={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","\xa2":"¢","\xa3":"£","\xa5":"¥","\xa6":"¦","\xac":"¬","\xaf":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},CS={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},CE={40:!0},CD=class e{constructor(e="",t=[],r=[]){this.text=e,this.sections=t,this.sectionIndex=r,this.imageSectionID=null,this._graphemes=null}graphemes(){return null!=this._graphemes||(this._graphemes=Tg(this.text)),this._graphemes}static fromFeature(t,r){let i=new e;for(let e of t.sections)e.image?i.addImageSection(e):i.addTextSection(e,r);return i}length(){return this.graphemes().length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=function(e){let t="",r={premature:!0,value:void 0},i=e[Symbol.iterator](),n=i.next(),a=e[Symbol.iterator]();a.next();let o=a.next();for(;!n.done;)(o.done||!Tb(o.value.codePointAt(0))||Ck[o.value])&&(r.premature||!Tb(r.value.codePointAt(0))||Ck[r.value])&&Ck[n.value]?t+=Ck[n.value]:t+=n.value,r={value:n.value,premature:!1},n=i.next(),o=a.next();return t}(this.text),this._graphemes=null}hasZeroWidthSpaces(){return this.text.includes("​")}trim(){let e=this.graphemes(),t=0;for(;tt&&Tk(e[r-1]);)r--;this.text=e.slice(t,r).join(""),this.sectionIndex=this.sectionIndex.slice(t,r),this._graphemes=null}substring(t,r){let i=this.graphemes().slice(t,r).join(""),n=this.sectionIndex.slice(t,r);return new e(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,t)=>Math.max(e,this.sections[t].scale),0)}getMaxImageSize(e){let t=0,r=0;for(let i=0;i0?r[r.length-1]:"",n=Tg(i+e);this.text+=e,this._graphemes=r.slice(0,i?-1:void 0).concat(n);let a=n.length-!!i;for(let e=0;e=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,t,r,i,n){let a=[],o=this.determineAverageLineWidth(e,t,r,i,n),s=this.hasZeroWidthSpaces(),l=this.graphemes(),u=null,c=0,h=0;for(let t=0;t0){let e=l[t-1].codePointAt(0),r=d.codePointAt(0),i=/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e)),n=Tm(e)&&Tm(r);(CS[e]||i||"imageName"in this.getSection(t-1)||void 0!==l[t+1]&&CE[r]||n&&(u??(u=function(e){let t=new Set;if(CT){for(let{index:r}of(CM??(CM=new Intl.Segmenter(void 0,{granularity:"word"})),CM.segment(e)))t.add(r);return t}let r=0;for(let i of e.split(RegExp("\\b|(?=\\p{Ideo})","u")))t.add(r),r+=i.length;return t}(this.text))).has(h))&&a.push(TS(t,c,o,a,function(e,t,r){let i=0;return(10===e||13===e)&&(i-=1e4),r&&(i+=150),(40===e||65288===e)&&(i+=50),(41===t||65289===t)&&(i+=50),i}(e,r,i&&s),!1))}Tv(d.codePointAt(0))||(c+=TA(d,this.getSection(t),r,i,e,n)),h+=d.length}return function e(t){return t?e(t.priorBreak).concat(t.index):[]}(TS(this.length(),c,o,a,0,!0))}determineAverageLineWidth(e,t,r,i,n){let a=0,o=0;for(let t of this.graphemes())a+=TA(t,this.getSection(o),r,i,e,n),o++;let s=Math.max(1,Math.ceil(a/t));return a/s}},CC=function(e){var t,r,i,n,a={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},o={},s={};o.L=1,s[1]="L",Object.keys(a).forEach(function(e,t){o[e]=1<"),u=l[0],c=l[1];u=String.fromCodePoint(i+=parseInt(u,36)),c=String.fromCodePoint(i+=parseInt(c,36)),n.set(u,c),t&&a.set(c,u)}}),{map:n,reverseMap:a}}function g(){if(!t){var e=m("14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",!0),n=e.map,a=e.reverseMap;t=n,r=a,i=m("6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye",!1).map}}function y(e){return g(),t.get(e)||null}function v(e){return g(),r.get(e)||null}function x(e){return g(),i.get(e)||null}var b=o.L,_=o.R,w=o.EN,T=o.ES,A=o.ET,M=o.AN,k=o.CS,S=o.B,E=o.S,D=o.ON,C=o.BN,I=o.NSM,L=o.AL,P=o.LRO,z=o.RLO,F=o.LRE,O=o.RLE,R=o.PDF,B=o.LRI,j=o.RLI,N=o.FSI,V=o.PDI;function U(e){return function(){if(!n){var e=m("14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",!0),t=e.map;e.reverseMap.forEach(function(e,r){t.set(r,e)}),n=t}}(),n.get(e)||null}function q(e,t,r,i){var n=e.length;r=Math.max(0,null==r?0:+r),i=Math.min(n-1,null==i?n-1:+i);var a=[];return t.paragraphs.forEach(function(n){var o=Math.max(r,n.start),s=Math.min(i,n.end);if(o=o&&p(e[u])&d;u--)l[u]=n.level;for(var c=n.level,h=1/0,f=0;fc&&(c=m),m=h;g--)for(var y=0;y=g){for(var v=y;y+1=g;)y++;y>v&&a.push([v+o,y+o])}}}),a}function G(e,t,r,i){for(var n=q(e,t,r,i),a=[],o=0;o0)Y--;else if(X>0){for(Z=0;!$[$.length-1]._isolate;)$.pop();var er=$[$.length-1]._isolInitIndex;null!=er&&(s.set(er,K),s.set(K,er)),$.pop(),X--}W=$[$.length-1],o[K]=W._level,W._override&&a(K,W._override)}else J&R?(0===Y&&(Z>0?Z--:!W._isolate&&$.length>1&&($.pop(),W=$[$.length-1])),o[K]=W._level):J&S&&(o[K]=m.level);else o[K]=W._level,W._override&&J!==C&&a(K,W._override)}for(var ei=[],en=null,ea=m.start;ea<=m.end;ea++){var eo=r[ea];if(!(eo&h)){var es=o[ea],el=eo&l,eu=eo===V;en&&es===en._level?(en._end=ea,en._endsWithIsolInit=el):ei.push(en={_start:ea,_end:ea,_level:es,_startsWithPDI:eu,_endsWithIsolInit:el})}}for(var ec=[],eh=0;eh=0;ew--)if(!(r[ew]&h)){e_=o[ew];break}var eT=eg[eg.length-1],eA=o[eT],eM=m.level;if(!(r[eT]&l)){for(var ek=eT+1;ek<=m.end;ek++)if(!(r[ek]&h)){eM=o[ek];break}}ec.push({_seqIndices:eg,_sosType:Math.max(e_,eb)%2?_:b,_eosType:Math.max(eM,eA)%2?_:b})}}for(var eS=0;eS=0;eO--)if(!(r[eD[eO]]&h)){eF=r[eD[eO]];break}a(ez,eF&(l|V)?D:eF)}}if(n.get(w))for(var eR=0;eR=-1;ej--){var eN=-1===ej?eC:r[eD[ej]];if(eN&u){eN===L&&a(eB,M);break}}}if(n.get(L))for(var eV=0;eV=0&&(eH=r[eD[eW]])&h;eW--);for(var eY=eq+1;eY=0&&r[eD[eX]]&(A|h);eX--)a(eD[eX],w);for(eZ++;eZ=0&&r[eD[eQ]]&h;eQ--)a(eD[eQ],D);for(var e0=eK+1;e0=0;tr--){var ti=e7[tr].char;if(ti===tt||ti===v(x(te))||y(x(ti))===te){e8.push([e7[tr].seqIndex,e9]),e7.length=tr;break}}}e8.sort(function(e,t){return e[0]-t[0]});for(var tn=0;tn=0;tf--){var tp=eD[tf];if(r[tp]&e6){var tm=r[tp]&e4?_:b;tu=tm===eL?eL:tm;break}}}if(tu){if(r[eD[to]]=r[eD[ts]]=tu,tu!==eL){for(var tg=to+1;tg=0;tw--)if(r[eD[tw]]&h)tx=tw;else{t_=r[eD[tw]]&e4?_:b;break}for(var tT=eI,tA=tv+1;tA=0&&p(e[tD])&d;tD--)o[tD]=m.level}}return{levels:o,paragraphs:f};function tC(t,i){for(var n=t;n"u"?null:new TextDecoder("utf-8"),CF=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,r=this.length){let i;for(;i=this.nextField(r);)e(i,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getUint32(this.pos+4,!0);return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getInt32(this.pos+4,!0);return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,r=t[this.pos++];if(r<128)return r;let i=127&r,n;return i|=(127&(n=t[this.pos++]))<<7,n<128||(i|=(127&(n=t[this.pos++]))<<14,n<128)||(i|=(127&(n=t[this.pos++]))<<21,n<128)?i:function(e,t,r){let i=r.buf,n,a;if(n=(112&(a=i[r.pos++]))>>4,a<128||(n|=(127&(a=i[r.pos++]))<<3,a<128)||(n|=(127&(a=i[r.pos++]))<<10,a<128)||(n|=(127&(a=i[r.pos++]))<<17,a<128)||(n|=(127&(a=i[r.pos++]))<<24,a<128)||(n|=(1&(a=i[r.pos++]))<<31,a<128)){var o,s;return o=e,s=n,t?0x100000000*s+(o>>>0):(s>>>0)*0x100000000+(o>>>0)}throw Error("Expected varint not more than 10 bytes")}(i|=(15&(n=t[this.pos]))<<28,e,this)}readSVarint(){let e=this.readVarint();return e%2==1?-((e+1)/2):e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Cz?Cz.decode(this.buf.subarray(t,e)):function(e,t,r){let i="",n=t;for(;n239?4:s>223?3:s>191?2:1;if(n+u>r)break;1===u?s<128&&(l=s):2===u?(192&(t=e[n+1]))==128&&(l=(31&s)<<6|63&t)<=127&&(l=null):3===u?(t=e[n+1],a=e[n+2],(192&t)==128&&(192&a)==128&&((l=(15&s)<<12|(63&t)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(t=e[n+1],a=e[n+2],o=e[n+3],(192&t)==128&&(192&a)==128&&(192&o)==128&&((l=(15&s)<<18|(63&t)<<12|(63&a)<<6|63&o)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=u}return i}(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let r=this.readPackedEnd();for(;this.pos=e)return 0;let t=this.readVarint();return this.type=7&t,this._valueStart=this.pos,t>>>3}skip(e){let t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else if(1===t)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}},CO=class{constructor(e,{pixelRatio:t,version:r,isWebGLImage:i=!1,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=n,this.stretchY=a,this.content=o,this.version=r,this.needsFirstWebGLRender=i,this.textFitWidth=s,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},CR=class{constructor(e,t){let r={},i={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let n=[];this.addImages(e,r,n),this.addImages(t,i,n);let{w:a,h:o}=TP(n),s=new Di({width:a||1,height:o||1});for(let t in e){let i=e[t];if(i.isWebGLImage)continue;let n=r[t].paddedRect;Di.copy(i.data,s,{x:0,y:0},{x:n.x+1,y:n.y+1},i.data)}for(let e in t){let r=t[e],n=i[e].paddedRect,a=n.x+1,o=n.y+1,l=r.data.width,u=r.data.height;Di.copy(r.data,s,{x:0,y:0},{x:a,y:o},r.data),Di.copy(r.data,s,{x:0,y:u-1},{x:a,y:o-1},{width:l,height:1}),Di.copy(r.data,s,{x:0,y:0},{x:a,y:o+u},{width:l,height:1}),Di.copy(r.data,s,{x:l-1,y:0},{x:a-1,y:o},{width:1,height:u}),Di.copy(r.data,s,{x:0,y:0},{x:a+l,y:o},{width:1,height:u})}this.image=s,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(let i in e){let n=e[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),t[i]=new CO(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){if(e.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==e.updateVersion){for(let r in this.patchedUpdateVersion=e.updateVersion,this.iconPositions)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t);for(let r in this.patternPositions)this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}}patchUpdatedImage(e,t,r){var i;if(!e||!t||!e.needsFirstWebGLRender&&e.version===t.version)return;e.needsFirstWebGLRender=!1,e.version=t.version;let[n,a]=e.tl,o=null==(i=t.userImage)?void 0:i.data;if(!TL(o))return void r.update(t.data,void 0,{x:n,y:a});let{width:s,height:l}=t.data;r.context.setCustomLayerDefaults(),o.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:n,y:a,width:s,height:l}),r.context.setDirty()}},_5("ImagePosition",CO),_5("ImageAtlas",CR),(t=CB||{})[t.none=0]="none",t[t.horizontal=1]="horizontal",t[t.vertical=2]="vertical",t[t.horizontalOnly=3]="horizontalOnly",CB=t,Cj=RegExp("^\\p{gc=M}$","u"),CN=32640,_5("Anchor",CV=class e extends vl{constructor(e,t,r,i){super(e,t),this.angle=r,void 0!==i&&(this.segment=i)}clone(){return new e(this.x,this.y,this.angle,this.segment)}}),CU=class{constructor(e,t,r,i,n,a,o,s,l,u){var c;if(this.boxStartIndex=e.length,l){let e=a.top,t=a.bottom,r=a.collisionPadding;r&&(e-=r[1],t+=r[3]);let i=t-e;i>0&&(i=Math.max(10,i),this.circleDiameter=i)}else{let l=null!=(c=a.image)&&c.content&&(a.image.textFitWidth||a.image.textFitHeight)?TU(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*o-s[0],l.y2=l.y2*o+s[2],l.x1=l.x1*o-s[3],l.x2=l.x2*o+s[1];let h=a.collisionPadding;if(h&&(l.x1-=h[0]*o,l.y1-=h[1]*o,l.x2+=h[2]*o,l.y2+=h[3]*o),u){let e=new vl(l.x1,l.y1),t=new vl(l.x2,l.y1),r=new vl(l.x1,l.y2),i=new vl(l.x2,l.y2),n=u*Math.PI/180;e._rotate(n),t._rotate(n),r._rotate(n),i._rotate(n),l.x1=Math.min(e.x,t.x,r.x,i.x),l.x2=Math.max(e.x,t.x,r.x,i.x),l.y1=Math.min(e.y,t.y,r.y,i.y),l.y2=Math.max(e.y,t.y,r.y,i.y)}e.emplaceBack(t.x,t.y,l.x1,l.y1,l.x2,l.y2,r,i,n)}this.boxEndIndex=e.length}},Cq=class{constructor(e=[],t=(e,t)=>et)){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;let 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){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;er(t[a],t[i])&&(i=a),r(t[i],n)>=0)break;t[e]=t[i],e=i}t[e]=n}},CG=class{constructor(e,t,r,i){this.p=new vl(e,t),this.h=r,this.d=function(e,t){let r=!1,i=1/0;for(let n of t)for(let t=0,a=n.length,o=a-1;te.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r),i=Math.min(i,wg(e,a,s))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}},(r={})[r.center=1]="center",r[r.left=2]="left",r[r.right=3]="right",r[r.top=4]="top",r[r.bottom=5]="bottom",r[r["top-left"]=6]="top-left",r[r["top-right"]=7]="top-right",r[r["bottom-left"]=8]="bottom-left",r[r["bottom-right"]=9]="bottom-right",CH=r,C$=1/0,CW=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}],_5("SymbolBuffers",CY=class{constructor(e){this.layoutVertexArray=new Eg,this.indexArray=new ET,this.programConfigurations=e,this.segments=new EE,this.dynamicLayoutVertexArray=new Ey,this.opacityVertexArray=new Ev,this.hasVisibleVertices=!1,this.placedSymbolArray=new S8}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Cd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Cf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,CW,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&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())}}),_5("CollisionBuffers",CZ=class{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new EE,this.collisionVertexArray=new E_}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Cp.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}),_5("SymbolBucket",CX=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=TG(this.zoom,t["text-size"]),this.iconSizeData=TG(this.zoom,t["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap="never"!==T6(r,"text-overlap","text-allow-overlap")||"never"!==T6(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==n&&!i.isConstant();let a="viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map(e=>CB[e])),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=e.sourceID}createArrays(){this.text=new CY(new E0(this.layers,this.zoom,e=>e.startsWith("text"))),this.icon=new CY(new E0(this.layers,this.zoom,e=>e.startsWith("icon"))),this.glyphOffsetArray=new Ee,this.lineVertexArray=new Et,this.symbolInstances=new S9,this.textAnchorOffsets=new Ei}calculateGlyphDependencies(e,t,r,i,n){var a;let o=(i||this.allowVerticalPlacement)&&n,s=CD.fromFeature(e,r),l=s.graphemes();for(let e=0;e0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!u&&!c)return;let d=t.iconDependencies,f=t.glyphDependencies,p=t.availableImages,m=new Su(this.zoom);for(let{feature:t,id:s,index:l,sourceLayerIndex:g}of e){let e,y,v=n._featureFilter.needGeometry,x=wc(t,v);if(!n._featureFilter.filter(m,x,r))continue;if(v||(x.geometry=wu(t)),u){let t=n.getValueAndResolveTokens("text-field",x,r,p),i=ki.factory(t);this.hasRTLText||(this.hasRTLText=function(e){for(let t of e.sections)if(TT(t.text))return!0;return!1}(i)),e=function(e,t,r){for(let i of e.sections)i.text=function(e,t,r){var i;let n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),(null!=(i=Cy.applyArabicShaping)?i:function(e){if(!C_.test(e))return e;let t=[...e].map(e=>{var t;let r=e.codePointAt(0);return{codePoint:r,type:null!=(t=Cw.get(r))?t:"U",form:null}});return function(e){let t=e.filter(e=>"T"!==e.type);for(let e=0;e0&&("D"===(r=t[e-1].type)||"L"===r||"C"===r),s=e+1String.fromCodePoint(function(e){if(null===e.form)return e.codePoint;let t=Cx[e.codePoint];return t&&(t[e.form]||t[0])||e.codePoint}(e))).join("")})(e)}(i.text,t,r);return e}(i,n,x)}if(c){let e=n.getValueAndResolveTokens("icon-image",x,r,p);y=e instanceof kc?e:kc.fromString(e)}if(!e&&!y)continue;let b=this.sortFeaturesByKey?h.evaluate(x,{},r):void 0,_={id:s,text:e,icon:y,index:l,sourceLayerIndex:g,geometry:x.geometry,properties:t.properties,type:DY.types[t.type],sortKey:b};if(this.features.push(_),y&&(d[y.name]=!0),e){let t=o.evaluate(x,{},r).join(","),n="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=null==(i=this.writingModes)?void 0:i.includes(2);let s=Tx(e.toString());for(let r of(this.calculateGlyphDependencies(e,f,t,n,s),e.sections))r.image&&(d[r.image.name]=!0)}}"line"===a.get("symbol-placement")&&(this.features=function(e){let t={},r={},i=[],n=0;function a(t){i.push(e[t]),n++}function o(e,t,n){let a=r[e];return delete r[e],r[t]=a,i[a].geometry[0].pop(),i[a].geometry[0]=i[a].geometry[0].concat(n[0]),a}function s(e,r,n){let a=t[r];return delete t[r],t[e]=a,i[a].geometry[0].shift(),i[a].geometry[0]=n[0].concat(i[a].geometry[0]),a}function l(e,t,r){let i=r?t[0][t[0].length-1]:t[0][0];return`${e}:${i.x}:${i.y}`}for(let u=0;ue.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((e,t)=>e.sortKey-t.sortKey)}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}))}addFeatures({options:e,canonical:t,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:o}){!function(e){var t,r;e.bucket.createArrays();let i=512*e.bucket.overscaling;e.bucket.tilePixelRatio=Md/i,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let n=e.bucket.layers[0],a=n.layout,o=n._unevaluatedLayout._values,s={layoutIconSize:o["icon-size"].possiblyEvaluate(new Su(e.bucket.zoom+1),e.canonical),layoutTextSize:o["text-size"].possiblyEvaluate(new Su(e.bucket.zoom+1),e.canonical),textMaxSize:o["text-size"].possiblyEvaluate(new Su(18))};if("composite"===e.bucket.textSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.textSizeData;s.compositeTextSizes=[o["text-size"].possiblyEvaluate(new Su(t),e.canonical),o["text-size"].possiblyEvaluate(new Su(r),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.iconSizeData;s.compositeIconSizes=[o["icon-size"].possiblyEvaluate(new Su(t),e.canonical),o["icon-size"].possiblyEvaluate(new Su(r),e.canonical)]}let l=24*a.get("text-line-height"),u="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement"),c=a.get("text-keep-upright"),h=a.get("text-size");for(let i of e.bucket.features){let o=a.get("text-font").evaluate(i,{},e.canonical).join(","),d=h.evaluate(i,{},e.canonical),f=s.layoutTextSize.evaluate(i,{},e.canonical),p=s.layoutIconSize.evaluate(i,{},e.canonical),m={horizontal:{},vertical:void 0},g=i.text,y=[0,0];if(g){let t=g.toString(),r=24*a.get("text-letter-spacing").evaluate(i,{},e.canonical),s=!function(e){for(let t of e)if(!function(e){return!/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}(t.codePointAt(0)))return!1;return!0}(t)?0:r,h=a.get("text-anchor").evaluate(i,{},e.canonical),p=T2(n,i,e.canonical);if(!p){let t=a.get("text-radial-offset").evaluate(i,{},e.canonical);y=t?T1(h,[24*t,C$]):a.get("text-offset").evaluate(i,{},e.canonical).map(e=>24*e)}let v=u?"center":a.get("text-justify").evaluate(i,{},e.canonical),x="point"===a.get("symbol-placement")?24*a.get("text-max-width").evaluate(i,{},e.canonical):1/0,b=()=>{e.bucket.allowVerticalPlacement&&Tx(t)&&(m.vertical=TR(g,e.glyphMap,e.glyphPositions,e.imagePositions,o,x,l,h,"left",s,y,2,!0,f,d))};if(!u&&p){let t=new Set;if("auto"===v)for(let e=0;e{h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A){let M=e.addToLineVertexArray(t,r),k=s.layout.get("symbol-height-offset").evaluate(b,{},T);k>e.maxHeightOffset&&(e.maxHeightOffset=k);let S,E,D,C,I=0,L=0,P=0,z=0,F=-1,O=-1,R={},B=(0,EP.default)("");if(e.allowVerticalPlacement&&i.vertical){let e=s.layout.get("text-rotate").evaluate(b,{},T)+90;D=new CU(l,t,u,c,h,i.vertical,d,f,p,e),o&&(C=new CU(l,t,u,c,h,o,g,y,p,e))}if(n){let r=s.layout.get("icon-rotate").evaluate(b,{}),i="none"!==s.layout.get("icon-text-fit"),a=TK(n,r,w,i),d=o?TK(o,r,w,i):void 0;E=new CU(l,t,u,c,h,n,g,y,!1,r),I=4*a.length;let f=e.iconSizeData,p=null;"source"===f.kind?(p=[128*s.layout.get("icon-size").evaluate(b,{})])[0]>32640&&xd(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`):"composite"===f.kind&&((p=[128*_.compositeIconSizes[0].evaluate(b,{},T),128*_.compositeIconSizes[1].evaluate(b,{},T)])[0]>32640||p[1]>32640)&&xd(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`),e.addSymbols(e.icon,a,p,x,v,b,0,t,M.lineStartIndex,M.lineLength,-1,T,k),F=e.icon.placedSymbolArray.length-1,d&&(L=4*d.length,e.addSymbols(e.icon,d,p,x,v,b,2,t,M.lineStartIndex,M.lineLength,-1,T,k),O=e.icon.placedSymbolArray.length-1)}let j=Object.keys(i.horizontal);for(let r of j){let n=i.horizontal[r];S||(B=(0,EP.default)(n.text),S=new CU(l,t,u,c,h,n,d,f,p,s.layout.get("text-rotate").evaluate(b,{},T)));let o=1===n.positionedLines.length;if(P+=T5(e,t,n,a,s,p,b,m,k,M,i.vertical?1:3,o?j:[r],R,F,_,T),o)break}i.vertical&&(z+=T5(e,t,i.vertical,a,s,p,b,m,k,M,2,["vertical"],R,O,_,T));let N=S?S.boxStartIndex:e.collisionBoxArray.length,V=S?S.boxEndIndex:e.collisionBoxArray.length,U=D?D.boxStartIndex:e.collisionBoxArray.length,q=D?D.boxEndIndex:e.collisionBoxArray.length,G=E?E.boxStartIndex:e.collisionBoxArray.length,H=E?E.boxEndIndex:e.collisionBoxArray.length,$=C?C.boxStartIndex:e.collisionBoxArray.length,W=C?C.boxEndIndex:e.collisionBoxArray.length,Y=-1,Z=(e,t)=>e?.circleDiameter?Math.max(e.circleDiameter,t):t;Y=Z(S,-1),Y=Z(D,Y),Y=Z(E,Y);let X=+((Y=Z(C,Y))>-1);X&&(Y*=A/24),e.glyphOffsetArray.length>=e.maxGlyphs&&xd("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);let K=T2(s,b,T),[J,Q]=function(e,t){let r=e.length,i=t?.values;if(i?.length>0)for(let t=0;t=0?R.right:-1,R.center>=0?R.center:-1,R.left>=0?R.left:-1,R.vertical||-1,F,O,B,N,V,U,q,G,H,$,W,u,P,z,I,L,X,0,d,Y,J,Q,k)}(e,h,s,r,i,n,D,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,y,[_,_,_,_],A,l,x,w,M,p,t,a,u,c,o)};if("line"===k)for(let n of TX(t.geometry,0,0,Md,Md)){let t=w2(n,C);for(let n of function(e,t,r,i,n,a,o,s){let l=i?.6*24*a:0,u=TZ(i,n),c=u*a,h=0===e[0].x||e[0].x===s||0===e[0].y||e[0].y===s;return t-c=0&&y=0&&v=0&&f+c<=h){let r=new CV(y,v,m,e);r._round(),(!n||TW(t,r,o,n,a))&&p.push(r)}}d+=l}return l||p.length||s||(p=e(t,d/2,i,n,a,o,s,!0,u)),p}(e,h?t/2*o%t:(u/2+48)*a*o%t,t,l,r,c,h,!1,s)}(t,b,T,r.vertical||m,i,v,e.overscaling,Md))m&&function(e,t,r,i){let n=e.compareText;if(t in n){let e=n[t];for(let t=e.length-1;t>=0;t--)if(i.dist(e[t])1){let t=w2(e,C),n=function(e,t,r,i,n){let a=r?.6*24*n:0,o=TZ(r,i)*n,s=0,l=TY(e)/2;for(let r=0;rl){let c=(l-s)/u,h=new CV(kv.number(i.x,n.x,c),kv.number(i.y,n.y,c),n.angleTo(i),r);return h._round(),!a||TW(e,h,o,a,t)?h:void 0}s+=u}}(t,T,r.vertical||m,i,v);n&&I(t,n)}}else if("Polygon"===t.type)for(let e of x5(t.geometry,0)){let t=function(e,t=1){let r=D$.fromPoints(e[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new Cq([],T0),{minX:o,minY:s,maxX:l,maxY:u}=r;if(0===i)return new vl(o,s);for(let t=o;th.d||!h.d)&&(h=r),r.max-h.d<=t||(n=r.h/2,a.push(new CG(r.p.x-n,r.p.y-n,n,e)),a.push(new CG(r.p.x+n,r.p.y-n,n,e)),a.push(new CG(r.p.x-n,r.p.y+n,n,e)),a.push(new CG(r.p.x+n,r.p.y+n,n,e)))}return c.d>0&&h.d-c.d<=t?c.p:h.p}(e,16);I(w2(e[0],C,!0),new CV(t.x,t.y,0))}else if("LineString"===t.type)for(let e of t.geometry){let t=w2(e,C);I(t,new CV(t[0].x,t[0].y,0))}else if("Point"===t.type)for(let e of t.geometry)for(let t of e)I([t],new CV(t.x,t.y,0))}(e.bucket,i,m,v,e.imageMap,s,f,p,y,x,e.canonical,e.subdivisionGranularity)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()}({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:o,canonical:t,subdivisionGranularity:e.subdivisionGranularity})}isEmpty(){return 0===this.symbolInstances.length}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),i=e.dist(t[e.segment]),n={};for(let i=e.segment+1;i=0;r--)n[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:i},r>0&&(i+=t[r-1].dist(t[r]));for(let e=0;e0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;ti[e]-i[t]||n[t]-n[e]),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===t?r.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)){for(let t of(this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[],this.symbolInstanceIndexes)){let e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex);let r=[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex];for(let e=0;e=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}},{omit:["layers","collisionBoxArray","features","compareText"]}),CQ={get paint(){return CJ||(CJ=new SA({"icon-opacity":new Sb(Mz.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new Sb(Mz.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new Sb(Mz.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new Sb(Mz.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new Sb(Mz.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new Sx(Mz.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new Sx(Mz.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new Sb(Mz.paint_symbol["text-opacity"],"text-opacity"),"text-color":new Sb(Mz.paint_symbol["text-color"],"text-color",{runtimeType:MV,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Sb(Mz.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new Sb(Mz.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new Sb(Mz.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new Sx(Mz.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new Sx(Mz.paint_symbol["text-translate-anchor"],"text-translate-anchor")}))},get layout(){return CK||(CK=new SA({"symbol-placement":new Sx(Mz.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new Sx(Mz.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new Sx(Mz.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new Sb(Mz.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new Sx(Mz.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new Sx(Mz.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new Sx(Mz.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new Sx(Mz.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new Sx(Mz.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new Sb(Mz.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new Sb(Mz.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new Sx(Mz.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new Sx(Mz.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new Sb(Mz.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new Sb(Mz.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new Sb(Mz.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new Sx(Mz.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new Sb(Mz.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new Sb(Mz.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new Sx(Mz.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new Sx(Mz.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new Sx(Mz.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new Sb(Mz.layout_symbol["text-field"],"text-field"),"text-font":new Sb(Mz.layout_symbol["text-font"],"text-font"),"text-size":new Sb(Mz.layout_symbol["text-size"],"text-size"),"text-max-width":new Sb(Mz.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new Sx(Mz.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new Sb(Mz.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new Sb(Mz.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new Sb(Mz.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new Sx(Mz.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new Sb(Mz.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new Sb(Mz.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new Sx(Mz.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new Sx(Mz.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new Sb(Mz.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new Sx(Mz.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new Sx(Mz.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new Sb(Mz.layout_symbol["text-transform"],"text-transform"),"text-offset":new Sb(Mz.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new Sx(Mz.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new Sx(Mz.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new Sx(Mz.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new Sx(Mz.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new Sb(Mz.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new Sx(Mz.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")}))}},_5("FormatSectionOverride",C0=class{constructor(e){if(void 0===e.property.overrides)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:MR,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(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}},{omit:["defaultValue"]}),C1=e=>"symbol"===e.type,C2=class e extends Sk{constructor(e,t){super(e,CQ,t)}recalculate(e,t){super.recalculate(e,t);let r=this.layout.get("icon-rotation-alignment");if(("constant"!==r.value.kind||"auto"===r.value.value)&&(this.layout._values["icon-rotation-alignment"]=new Sy(r.property,{kind:"constant",value:"point"===this.layout.get("symbol-placement")?"viewport":"map"},r.parameters)),"auto"===this.layout.get("text-rotation-alignment")&&("point"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),"point"===this.layout.get("symbol-placement")){let e=this.layout.get("text-writing-mode");if(e){let t=[];for(let r of e)t.includes(r)||t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,i){var n;let a=this.layout.get(e).evaluate(t,{},r,i),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||b7(o.value)||!a?a:(n=t.properties,a.replace(/{([^{}]+)}/g,(e,t)=>n&&t in n?String(n[t]):""))}createBucket(e){return new CX(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of CQ.paint.overridableProperties){if(!e.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),i=new k3(new C0(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n="constant"===r.value.kind||"source"===r.value.kind?new k5("source",i):new k4("composite",i,r.value.zoomStops),this.paint._values[t]=new Sy(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)}static hasPaintOverride(e,t){let r=e.get("text-field"),i=CQ.paint.properties[t],n=!1,a=e=>{var t;for(let r of e)if(null!=(t=i.overrides)&&t.hasOverride(r)){n=!0;return}};if("constant"===r.value.kind&&r.value.value instanceof ki)a(r.value.value.sections);else if("source"===r.value.kind||"composite"===r.value.kind){let e=t=>{n||(t instanceof kf&&xQ(t.value)===MW?a(t.value.sections):t instanceof kx?a(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return n}},C5={get paint(){return C3||(C3=new SA({"background-color":new Sx(Mz.paint_background["background-color"],"background-color"),"background-pattern":new Sw(Mz.paint_background["background-pattern"],"background-pattern"),"background-opacity":new Sx(Mz.paint_background["background-opacity"],"background-opacity")}))}},C4=e=>"background"===e.type,C6=class extends Sk{constructor(e,t){super(e,C5,t)}},C8=e=>"custom"===e.type,C7=class extends Sk{constructor(e,t){super(e,{},t),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}},C9=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var e;this._triggered||(this._triggered=!0,null==(e=this._channel)||e.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},Ie={once:!0},It=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new C9(()=>this.process()),this.subscription=xg(this.target,"message",e=>this.receive(e),!1),this.globalScope=xp(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,t){return new Promise((r,i)=>{let n=Math.round(1e18*Math.random()).toString(36).substring(0,10),a=t?xg(t.signal,"abort",()=>{a?.unsubscribe(),delete this.resolveRejects[n];let r={id:n,type:"",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(r),i(new Mw(t.signal.reason))},Ie):null;this.resolveRejects[n]={resolve:e=>{a?.unsubscribe(),r(e)},reject:e=>{a?.unsubscribe(),i(e)}};let o=[],s=f(d({},e),{id:n,sourceMapId:this.mapId,origin:location.origin,data:_7(e.data,o)});this.target.postMessage(s,{transfer:o})})}receive(e){let t=e.data,r=t.id,i=["file://","resource://android","null"],n=[t.origin,location.origin],a=t.origin===location.origin,o=n.some(e=>i.includes(e));if((a||o)&&!(t.targetMapId&&this.mapId!==t.targetMapId)){if(""===t.type){delete this.tasks[r];let e=this.abortControllers[r];delete this.abortControllers[r],e&&e.abort();return}if(xp(self)||t.mustQueue){this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,t)}}process(){if(0===this.taskQueue.length)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}processTask(e,t){return b(this,null,function*(){if(""===t.type){let r=this.resolveRejects[e];if(delete this.resolveRejects[e],!r)return;t.error?r.reject(vK(_9(t.error))):r.resolve(_9(t.data));return}if(!this.messageHandlers[t.type])return void this.completeTask(e,null,null);let r=_9(t.data),i=new AbortController;this.abortControllers[e]=i;try{let n=yield this.messageHandlers[t.type](t.sourceMapId,r,i);this.completeTask(e,null,n)}catch(t){this.completeTask(e,vK(t))}})}completeTask(e,t,r){let i=[];delete this.abortControllers[e];let n={id:e,type:"",sourceMapId:this.mapId,origin:location.origin,error:t?_7(t):null,data:_7(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},Ir=class{constructor(e,t,r){if(e<0||e>25||r<0||r>=2**e||t<0||t>=2**e)throw Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=t,this.y=r,this.key=At(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){var i,n,a;let o,s,l=(i=this.x,n=this.y,a=this.z,o=Ar(256*i,256*(n=2**a-n-1),a),s=Ar((i+1)*256,(n+1)*256,a),`${o[0]},${o[1]},${s[0]},${s[1]}`),u=function(e,t,r){let i="";for(let n=e;n>0;n--){let e=1<1?"@2x":"").replace(/{quadkey}/g,u).replace(/{bbox-epsg-3857}/g,l)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=2**this.z;return new vl((e.x*t-this.x)*Md,(e.y*t-this.y)*Md)}toString(){return`${this.z}/${this.x}/${this.y}`}},Ii=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=At(e,t.z,t.z,t.x,t.y)}},In=class e{constructor(e,t,r,i,n){if(this.terrainRttPosMatrix32f=null,e= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new Ir(r,+i,+n),this.key=At(t,e,r,i,n)}clone(){return new e(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(t){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,t){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?At(this.wrap*t,e,this.canonical.z,this.canonical.x,this.canonical.y):At(this.wrap*t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(0===e.overscaledZ)return this.overscaledZ>0;let t=this.canonical.z-e.canonical.z;return!(t<0)&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new e(r,this.wrap,r,i,n),new e(r,this.wrap,r,i+1,n),new e(r,this.wrap,r,i,n+1),new e(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=0&&t=0&&r=s)return null;let u=this.canonical.x+n,c=this.wrap;return u<0?(c-=Math.ceil(-u/s),u=(u%s+s)%s):u>=s&&(c+=Math.floor(u/s),u%=s),{tileID:new e(this.overscaledZ,c,o,u,l),x:t-n*i,y:r-a*i}}},Ia=6378137*Math.PI,_5("CanonicalTileID",Ir),_5("OverscaledTileID",In,{omit:["terrainRttPosMatrix32f"]}),Io="_geojsonTileLayer",Is=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},Il=class{constructor(e,t,r,i,n){for(let n in this.type="Feature",this._vectorTileFeature=e,this._x=r,this._y=i,this._z=t,e.properties)"string"==typeof e.properties[n]&&e.properties[n].startsWith("__$json__:")&&(e.properties[n]=JSON.parse(e.properties[n].slice(10)));this.properties=e.properties,this.id=n}projectPoint(e,t,r,i){return[(e.x+t)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+r)*2/i)*Math.PI))-90]}projectLine(e,t,r,i){return e.map(e=>this.projectPoint(e,t,r,i))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,t=e.extent*2**this._z,r=e.extent*this._x,i=e.extent*this._y,n=e.loadGeometry();switch(e.type){case 1:{let e=[];for(let t of n)e.push(t[0]);let a=this.projectLine(e,r,i,t);this._geometry=1===e.length?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a};break}case 2:{let e=n.map(e=>this.projectLine(e,r,i,t));this._geometry=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e};break}case 3:{let e=w8(n),a=[];for(let n of e)a.push(n.map(e=>this.projectLine(e,r,i,t)));this._geometry=1===a.length?{type:"Polygon",coordinates:a[0]}:{type:"MultiPolygon",coordinates:a};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&"_x"!==t&&"_y"!==t&&"_z"!==t&&(e[t]=this[t]);return e}},Iu=class{constructor(e,t,r){this._name=e,this.dataBuffer=t,"number"==typeof r?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){var t;return(null==(t=this.nullabilityBuffer)?void 0:t.get(e))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Ic=class extends Iu{},Ih=class extends Ic{getValueFromBuffer(e){return this.dataBuffer[e]}},Id=class extends Ic{getValueFromBuffer(e){return this.dataBuffer[e]}},If=class extends Iu{constructor(e,t,r,i){super(e,t,i),this.delta=r}},Ip=class extends If{constructor(e,t,r,i,n){super(e,n?Int32Array.of(t):Uint32Array.of(t),r,i)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},Im=class extends Iu{constructor(e,t,r,i){super(e,i?Int32Array.of(t):Uint32Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}},Ig=class{constructor(e,t,r,i,n=4096){if(this._name=e,this._geometryVector=t,this._idVector=r,this._propertyVectors=i,this._extent=n,0===e.length)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var e;return null!=(e=this._propertyVectors)?e:[]}getPropertyVector(e){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],t=this.geometryVector.getGeometries();for(let r=0;r>>32-e;IM=IA,IE=3*(IS=function(e){var t;if(!Number.isFinite(e)||e<=0)return Ik;let r=(t=Math.floor(e))-t%256;return 0===r?256:r}(Ik=65536))/256+IS|0,(a=ID||(ID={})).PRESENT="PRESENT",a.DATA="DATA",a.OFFSET="OFFSET",a.LENGTH="LENGTH",(o=IC||(IC={})).NONE="NONE",o.SINGLE="SINGLE",o.SHARED="SHARED",o.VERTEX="VERTEX",o.MORTON="MORTON",o.FSST="FSST",(s=II||(II={})).VERTEX="VERTEX",s.INDEX="INDEX",s.STRING="STRING",s.KEY="KEY",(l=IL||(IL={})).VAR_BINARY="VAR_BINARY",l.GEOMETRIES="GEOMETRIES",l.PARTS="PARTS",l.RINGS="RINGS",l.TRIANGLES="TRIANGLES",l.SYMBOL="SYMBOL",l.DICTIONARY="DICTIONARY",IP=[ID.PRESENT,ID.DATA,ID.OFFSET,ID.LENGTH],Iz=[Iw.NONE,Iw.DELTA,Iw.COMPONENTWISE_DELTA,Iw.RLE,Iw.MORTON],IF=[IT.NONE,IT.FAST_PFOR,IT.VARINT],IO=[IC.NONE,IC.SINGLE,IC.SHARED,IC.VERTEX,IC.MORTON,IC.FSST],IR=[II.VERTEX,II.INDEX,II.STRING,II.KEY],IB=[IL.VAR_BINARY,IL.GEOMETRIES,IL.PARTS,IL.RINGS,IL.TRIANGLES,IL.SYMBOL,IL.DICTIONARY],(u=Ij||(Ij={}))[u.FLAT=0]="FLAT",u[u.CONST=1]="CONST",u[u.SEQUENCE=2]="SEQUENCE",u[u.DICTIONARY=3]="DICTIONARY",u[u.FSST_DICTIONARY=4]="FSST_DICTIONARY",IN=class{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8);return(this.values[t]>>e%8&1)==1}set(e,t){let r=Math.floor(e/8);this.values[r]=this.values[r]|!!t<>e%8&1}size(){return this._size}getBuffer(){return this.values}},IV=new TextDecoder,IU=class extends Ic{getValueFromBuffer(e){return this.dataBuffer[e]}},Iq=class extends If{constructor(e,t,r,i,n){super(e,n?BigInt64Array.of(t):BigUint64Array.of(t),r,i)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}},(c=IG||(IG={}))[c.POINT=0]="POINT",c[c.LINESTRING=1]="LINESTRING",c[c.POLYGON=2]="POLYGON",c[c.MULTIPOINT=3]="MULTIPOINT",c[c.MULTILINESTRING=4]="MULTILINESTRING",c[c.MULTIPOLYGON=5]="MULTIPOLYGON",(h=IH||(IH={}))[h.POINT=0]="POINT",h[h.LINESTRING=1]="LINESTRING",h[h.POLYGON=2]="POLYGON",(p=I$||(I$={}))[p.MORTON=0]="MORTON",p[p.VEC_2=1]="VEC_2",p[p.VEC_3=2]="VEC_3",IW=class{constructor(e,t,r,i,n){this._vertexBufferType=e,this._topologyVector=t,this._vertexOffsets=r,this._vertexBuffer=i,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let t=this.vertexOffsets[e],r=AN(this.vertexBuffer[t],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[r.x,r.y]}let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return function(e){let t=Array(e.numGeometries),r=1,i=1,n=1,a=0,o=0,s=0,l=e.mortonSettings,u=e.topologyVector,c=u.geometryOffsets,h=u.partOffsets,d=u.ringOffsets,f=e.vertexOffsets,p=!f||0===f.length,m=e.containsPolygonGeometry(),g=e.vertexBuffer;for(let u=0;u[e]),r+=h,i+=h}break;case IG.LINESTRING:{let u,y;m?(u=d[i]-d[i-1],i++):u=h[r]-h[r-1],r++,p?(y=Aq(g,o,u,!1),o+=2*u):(y=AU(e.vertexBufferType,g,f,s,u,!1,l),s+=u),t[a++]=[y],c&&n++}break;case IG.POLYGON:{let u=h[r]-h[r-1];r++;let m=Array(u-1),y,v=d[i]-d[i-1];if(i++,p){y=Aq(g,o,v,!0),o+=2*v;for(let e=0;e0;)n[a++]=e[o++]}}return n}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(e){let t=new Uint32Array(e.length-1),r=e[0];for(let i=1;i>>0,a=r.get()+n;if(a>e.length)throw Error(`Block overruns tile: ${a} > ${e.length}`);let o=Aa(e,r,1)[0]>>>0;if(1!==o&&2!==o){r.set(a);continue}let[s,l]=function(e,t){let r={};r.featureTables=[];let i={};if(i.name=A2(e,t),0===i.name.length)throw Error("Missing layer name");let n=Aa(e,t,1)[0]>>>0,a=Aa(e,t,1)[0]>>>0;i.columns=Array(a);for(let r=0;r>>0,n=A0(i);if(!n)throw Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)`);if(i>=I9.SCALAR_BASE)r=A2(e,t);else if(i>>0,i=a.complexType;i.children=Array(r);for(let n=0;n>>0,o=a>=I9.SCALAR_BASE?A0(a):null;if(!o)throw Error(`Unsupported field type code ${a}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let s=f(d({},o),{name:A2(t,r)});if("complexType"===s.type&&A1(a)){let i=s.complexType,n=Aa(t,r,1)[0]>>>0;i.children=Array(n);for(let a=0;a=4)for(;r>4,n<128||(n=t[r.get()],r.increment(),i|=(127&n)<<3,n<128)||(n=t[r.get()],r.increment(),i|=(127&n)<<10,n<128)||(n=t[r.get()],r.increment(),i|=(127&n)<<17,n<128)||(n=t[r.get()],r.increment(),i|=(127&n)<<24,n<128)||(n=t[r.get()],r.increment(),i|=(1&n)<<31,n<128))return 0x100000000*i+(e>>>0);throw Error("Expected varint not more than 10 bytes")}(r|=(15&(i=e[t.get()]))<<28,e,t)}(e,t);return i}(e,t,r.numValues),r,i);let n=AI(e,t,r),a=i?AR(n,r):AB(n,r);return Float64Array.from(a,Number)}(e,r,n,!1),u?A_(h,u,0):h),a):new IU(i,AF(e,r,n,u),a);case Ij.SEQUENCE:{let t=Az(e,r,n);return new Iq(i,t[0],t[1],n.numRleValues,!1)}case Ij.CONST:return new I1(i,AO(e,r,n),a,!1)}throw Error("Vector type not supported for id column.")}(e,i,r,n,o,a??m,t)}else if(function(e){var t;return"complexType"===e.type&&(null==(t=e.complexType)?void 0:t.type)==="physicalType"&&e.complexType.physicalType===Ix.GEOMETRY}(i)){let t=Aa(e,r,1)[0];if(0===m){let t=r.get();m=Ab(e,r).decompressedCount,r.set(t)}h=function(e,t,r,i,n){var a,o,s,l,u,c,h,d,f,p,m;let g,y,v,x=Ab(e,r),b,_,w,T;if(Aj(x,i,e,r)===Ij.CONST){let d=AL(e,r,x),f,p,m,g;for(let i=0;i{var r;return e.name+(null!=(r=t.name)?r:"")}):[e.name]}(r);if(0===i)return n.map(e=>new I6(e,[]));let a=function(e,t,r){let i=e[t.get()];t.add(1);let n=AE(e,t,Ab(e,t)),a=r-1,o=[];i&I8.STRING&&(a-=function(e,t,r){let i=e[t.get()];t.add(1);let n=AW("",e,t,i);if(n)for(let e=0;e0&&(u=AE(e,t,Ab(e,t)),a--),0!==a)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:o,presentStream:s,presentCount:l,flattenedValues:u}}(e,t,i),o=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,s=[],l=0,u=0;for(let e=0;ea.length)throw Error("Merged map counts underflow while decoding child streams");let f=Array(r),p=i,m=n;for(let e=0;eo.length)throw Error("Map value stream underflow while decoding feature payload");let r=(g=o,y=m,v=t,x=l,v-y==1||g[y]===I7.START_LIST?AZ(g,y,v,x):AY(g,y,v,x));f[e]=r.value,m=r.nextIndex}let b=0;for(let e=i;e1&&!l.nullable||1===f&&l.nullable)throw Error(`The number of streams for the child field ${l.name} does not match its nullability. nullibilty: ${l.nullable}, numStreams: ${f}`);if(l.nullable){let r=Ab(e,t);u=new IN(AT(e,r.numValues,r.byteLength,t),r.numValues)}let m=AE(e,t,Ab(e,t),void 0,u);if(s){if(!o)throw Error(`Incomplete shared FSST dictionary for column "${p}"`);c[d++]=new I4(p,m,n,a,o,s,u,h)}else c[d++]=new I5(p,m,n,a,u)}return c}(e,t,r,a)}(e,r,i,t,m,void 0);if(n)if(Array.isArray(n))for(let e of n)p.push(e);else p.push(n)}}let g=new Ig(u.name,h,c,p,l);i.push(g),r.set(a)}return i}(new Uint8Array(e));this.layers=t.reduce((e,t)=>f(d({},e),{[t.name]:new Lr(t)}),{})}},_5("FeatureIndex",class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new So(Md,16,0),this.grid3D=new So(Md,16,0),this.featureIndexArray=new Ea,this.promoteId=t}insert(e,t,r,i,n,a){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let s=a?this.grid3D:this.grid;for(let e of t){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)t[0]=Math.min(t[0],r.x),t[1]=Math.min(t[1],r.y),t[2]=Math.max(t[2],r.x),t[3]=Math.max(t[3],r.y);t[0]<8192&&t[1]<8192&&t[2]>=0&&t[3]>=0&&s.insert(o,t[0],t[1],t[2],t[3])}}loadVTLayers(){return this.vtLayers||("mlt"===this.encoding?this.vtLayers=new Li(this.rawTileData).layers:this.vtLayers=new DX(new CF(this.rawTileData)).layers,this.sourceLayerCoder=new Is(this.vtLayers?Object.keys(this.vtLayers).sort():[Io])),this.vtLayers}query(e,t,r,i){this.loadVTLayers();let n=e.params,a=Md/e.tileSize/e.scale,o=_u(n.filter,"queryRenderedFeatures filter",n.globalState),s=e.queryGeometry,l=e.queryPadding*a,u=D$.fromPoints(s),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),h=D$.fromPoints(e.cameraQueryGeometry).expandBy(l);for(let t of this.grid3D.query(h.minX,h.minY,h.maxX,h.maxY,(t,r,i,n)=>(function(e,t,r,i,n){for(let a of e)if(t<=a.x&&r<=a.y&&i>=a.x&&n>=a.y)return!0;let a=[new vl(t,r),new vl(t,n),new vl(i,n),new vl(i,r)];if(e.length>2){for(let t of a)if(wv(e,t))return!0}for(let t=0;tn.x&&t.x>n.x||e.yn.y&&t.y>n.y)return!1;let a=xf(e,t,r[0]);return a!==xf(e,t,r[1])||a!==xf(e,t,r[2])||a!==xf(e,t,r[3])}(e[t],e[t+1],a))return!0;return!1})(e.cameraQueryGeometry,t-l,r-l,i+l,n+l)))c.push(t);c.sort(A5);let d={},f;for(let l of c){if(l===f)continue;f=l;let u=this.featureIndexArray.get(l),c=null;this.loadMatchingFeature(d,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,o,n.layers,n.availableImages,t,r,i,(t,r,i)=>(c||(c=wu(t)),r.queryIntersectsFeature({queryGeometry:s,feature:t,featureState:i,geometry:c,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return d}loadMatchingFeature(e,t,r,i,n,a,o,s,l,u,c){let h=this.bucketLayerIDs[t];if(a&&!h.some(e=>a.has(e)))return;let d=this.sourceLayerCoder.decode(r),f=this.vtLayers[d].feature(i);if(n.needGeometry){let e=wc(f,!0);if(!n.filter(new Su(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new Su(this.tileID.overscaledZ),f))return;let p=this.getId(f,d);for(let t of h){if(a&&!a.has(t))continue;let r=s[t];if(!r)continue;let n={};p&&u&&(n=u.getState(r.sourceLayer||"_geojsonTileLayer",p));let h=xi({},l[t]);h.paint=A3(h.paint,r.paint,f,n,o),h.layout=A3(h.layout,r.layout,f,n,o);let d=!c||c(f,r,n);if(!d)continue;let m=new Il(f,this.z,this.x,this.y,p);m.layer=h;let g=e[t];void 0===g&&(g=e[t]=[]),g.push({featureIndex:i,feature:m,intersectionZ:d})}}lookupSymbolFeatures(e,t,r,i,n,a,o,s){let l={};this.loadVTLayers();let u=_u(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let n of e)this.loadMatchingFeature(l,r,i,n,u,a,o,s,t);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){var r;let i=e.id;if(this.promoteId){let n="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];"boolean"==typeof(i=e.properties[n])&&(i=Number(i)),void 0===i&&null!=(r=e.properties)&&r.cluster&&this.promoteId&&(i=Number(e.properties.cluster_id))}return i}},{omit:["rawTileData","sourceLayerCoder"]}),Ln=class{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,r){let i=e.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);let n={value:t,timeout:void 0};if(void 0!==r&&(n.timeout=setTimeout(()=>{this.remove(e,n)},r)),this.data[i].push(n),this.order.push(i),this.order.length>this.max){let 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){let 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){let 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;let r=e.wrapped().key,i=void 0===t?0:this.data[r].indexOf(t),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){let t=[];for(let r in this.data)for(let i of this.data[r])e(i.value)||t.push(i);for(let e of t)this.remove(e.value.tileID,e)}}}}),Lo={};function Ls(){var e=new Mn(4);return Mn!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function Ll(){return zH.getCurrentTime()}function Lu(e){zH.setNow(e)}function Lc(){zH.restoreNow()}function Lh(){return zH.isFrozen()}function Ld(e){e=e.slice();let t=Object.create(null);for(let r=0;r{e in t&&(r[e]=t[e])}),r}(e[r],t[e[r].ref]));return e}function Lf(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r0){let r=[];for(let{id:i,url:n}of e){let e=`${i}${n}`;r.includes(e)||(r.push(e),t.push({id:i,url:n}))}}return t}function L_(e,t,r){try{let i=new URL(e);return i.pathname+=`${t}${r}`,i.toString()}catch{throw Error(`Invalid sprite URL "${e}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function Lw(e,t){return e>t||e>Fr?null:{start:e,end:Math.min(t,Fr)}}function LT(e,t,r,i,n,a,o,s,l){for(let u=t;u-1);a[++l]=s,o[l]=u,o[l+1]=Fo}for(let s=0,l=0;sMk(t,r)),Fw}function LC(e,t){let r=e.tileID,i=t.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}function LI(e,t){let r=e.feature,i=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=i}function LL(e,t,r,i){return b(this,null,function*(){let n=e;if(e.url?n=(yield MS((yield t.transformRequest(e.url,"Source")),r)).data:yield zG.frameAsync(r,i),!n)return null;let a=xn(xi(n,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in n&&n.vector_layers&&(a.vectorLayerIds=n.vector_layers.map(e=>e.id)),a})}function LP(e,t){return t?e.properties[t]:e.id}g(Lo,{AJAXError:()=>MM,AttributionControl:()=>j_,BoxZoomHandler:()=>B0,CanvasSource:()=>FR,CooperativeGesturesHandler:()=>jp,DoubleClickZoomHandler:()=>jl,DragPanHandler:()=>jh,DragRotateHandler:()=>jd,EXTENT:()=>Md,EdgeInsets:()=>Ob,ErrorEvent:()=>MI,Event:()=>MC,Evented:()=>ML,FullscreenControl:()=>jK,FullscreenEvent:()=>jX,GPUInitializationError:()=>Bq,GeoJSONSource:()=>FE,GeolocateControl:()=>jW,GeolocateErrorEvent:()=>j$,GeolocateEvent:()=>jG,GeolocatePositionEvent:()=>jH,GlobeControl:()=>jQ,Hash:()=>BG,ImageSource:()=>FF,KeyboardHandler:()=>jo,LngLat:()=>DJ,LngLatBounds:()=>FT,LogoControl:()=>jw,Map:()=>jC,MapBoxZoomEvent:()=>z4,MapContextEvent:()=>z7,MapLibreEvent:()=>zK,MapLibreMap:()=>jC,MapMouseEvent:()=>z2,MapMovementEvent:()=>zJ,MapProjectionEvent:()=>z8,MapSourceDataEvent:()=>z1,MapStyleDataEvent:()=>z0,MapStyleImageMissingEvent:()=>z9,MapStyleLoadEvent:()=>zQ,MapTerrainEvent:()=>z6,MapTouchEvent:()=>z3,MapWheelEvent:()=>z5,Marker:()=>jN,MarkerClickEvent:()=>jj,MarkerDragEvent:()=>jB,MercatorCoordinate:()=>D0,NavigationControl:()=>jL,Point:()=>vl,Popup:()=>j2,PopupEvent:()=>j1,RasterDEMTileSource:()=>FS,RasterTileSource:()=>Fk,ScaleControl:()=>jZ,ScrollZoomHandler:()=>js,Style:()=>Oq,TerrainControl:()=>jJ,TwoFingersTouchPitchHandler:()=>jn,TwoFingersTouchRotateHandler:()=>ji,TwoFingersTouchZoomHandler:()=>jr,TwoFingersTouchZoomRotateHandler:()=>jf,VectorTileSource:()=>FM,VideoSource:()=>FO,addProtocol:()=>xM,addSourceType:()=>FN,clearPrewarmedResources:()=>LE,config:()=>MT,createTileMesh:()=>LB,getGlobalDispatcher:()=>LD,getMaxParallelImageRequests:()=>zF,getRTLTextPluginStatus:()=>zI,getVersion:()=>zL,getWorkerCount:()=>zP,getWorkerUrl:()=>zR,importScriptInWorkers:()=>zj,isTimeFrozen:()=>Lh,now:()=>Ll,prewarm:()=>LS,removeProtocol:()=>xk,restoreNow:()=>Lc,setMaxParallelImageRequests:()=>zO,setNow:()=>Lu,setRTLTextPlugin:()=>zC,setWorkerCount:()=>zz,setWorkerUrl:()=>zB});function Lz(e){var t,r;if(!e)return{};let i={};return i.removeAll=e.removeAll,i.remove=new Set(e.remove||[]),i.add=new Map(null==(t=e.add)?void 0:t.map(e=>[e.id,e])),i.update=new Map(null==(r=e.update)?void 0:r.map(e=>[e.id,e])),i}function LF(e){return"GeometryCollection"===e.type?e.geometries.flatMap(e=>LF(e)):function e(t){return t&&0!==t.length?"number"==typeof t[0]?[t]:t.flatMap(t=>e(t)):[]}(e.coordinates)}function LO(e){let t=new FT,r;switch(e.type){case"FeatureCollection":r=e.features.flatMap(e=>LF(e.geometry));break;case"Feature":r=LF(e.geometry);break;default:r=LF(e)}if(0===r.length)return t;for(let e of r){let[r,i]=e;t.extend([r,i])}return t}function LR(e,t){let r=LB(t,"16bit"),i=Eo.deserialize({arrayBuffer:r.vertices,length:r.vertices.byteLength/2/2}),n=ET.deserialize({arrayBuffer:r.indices,length:r.indices.byteLength/2/3});return new FL(e.createVertexBuffer(i,FP.members),e.createIndexBuffer(n),EE.simpleSegment(0,0,i.length,n.length))}function LB(e,t){let r=void 0===e.granularity?1:Math.max(e.granularity,1),i=r+2*!!e.generateBorders,n=r+(e.extendToNorthPole||e.generateBorders?1:0)+(e.extendToSouthPole||e.generateBorders?1:0),a=i+1,o=n+1,s=e.generateBorders?-1:0,l=e.generateBorders||e.extendToNorthPole?-1:0,u=r+ +!!e.generateBorders,c=r+(e.generateBorders||e.extendToSouthPole?1:0),h=i*n*6,d=a*o>65536;if(d&&"16bit"===t)throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let f=d||"32bit"===t,p=new Int16Array(a*o*2),m=0;for(let t=l;t<=c;t++)for(let i=s;i<=u;i++){let n=i/r*Md;-1===i&&(n=-Fz),i===r+1&&(n=Md+Fz);let a=t/r*Md;-1===t&&(a=e.extendToNorthPole?Dz:-Fz),t===r+1&&(a=e.extendToSouthPole?DF:Md+Fz),p[m++]=n,p[m++]=a}let g=f?new Uint32Array(h):new Uint16Array(h),y=0;for(let e=0;e0){let r=Math.hypot(l[0],l[1],l[2]);if(r>0){let i=1+t.maxContentElevation/DK,n=Math.cos(Math.acos(xt(-l[3]/r,-1,1))+Math.acos(1/i));l=[l[0],l[1],l[2],-n*r],s=function(e,t,r){let i=e.planes[1],n=e.points.map(e=>{if(Math.abs(i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3])>1e-6)return e;let n=[e[0]-r[0],e[1]-r[1],e[2]-r[2]],a=i[0]*n[0]+i[1]*n[1]+i[2]*n[2];if(a>=-1e-9)return e;let o=-(t/a);return[e[0]+n[0]*o,e[1]+n[1]*o,e[2]+n[2]*o,e[3]]}),a=e.planes.map((e,r)=>1===r?[e[0],e[1],e[2],e[3]+t]:e),o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0];for(let e of n)for(let t=0;t<3;t++)o[t]=Math.min(o[t],e[t]),s[t]=Math.max(s[t],e[t]);return new FW(n,a,new F$(o,s))}(s,Math.sqrt(i*i-1),e.cameraPosition)}}let u=(n=1/w7((i=e).center.lat)*i.worldSize,Tl(i.center,i.elevation,i.pitch,i.bearing,i.cameraToCenterDistance/n)),c=D0.fromLngLat(e.center,e.elevation),h=(r=t.maxContentElevation,a=xt((15-(D1-e.pitch-e.fov/2))/15,0,1),o=Math.max(500,r??0),e.elevation+a*o),d=e.getCoveringTilesDetailsProvider(),f=d.allowVariableZoom(e,t),p=LG(e,t),m=t.minzoom||0,g=void 0===t.maxzoom?e.maxZoom:t.maxzoom,y=Math.min(Math.max(0,p),g),v=2**y,x=[v*u.x,v*u.y,0],b=[v*c.x,v*c.y,0],_=Math.hypot(c.x-u.x,c.y-u.y),w=Math.abs(c.z-u.z),T=Math.hypot(_,w),A=e=>({zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),M=[],k=[];if(e.renderWorldCopies&&d.allowWorldCopies())for(let e=1;e<=3;e++)M.push(A(-e)),M.push(A(e));for(M.push(A(0));M.length>0;){let r=M.pop(),i=r.x,n=r.y,a=r.fullyVisible,o={x:i,y:n,z:r.zoom},v=d.getTileBoundingVolume(o,r.wrap,h,t);if(!a){let e=function(e,t,r){let i=t.intersectsFrustum(e);if(!r||0===i)return i;let n=t.intersectsPlane(r);return 0===n?0:2===i&&2===n?2:1}(s,v,l);if(0===e)continue;a=2===e}let _=d.distanceToTile2d(u.x,u.y,o,v),A=p;f&&(A=(t.calculateTileZoom||FY)(e.zoom+xo(e.tileSize/t.tileSize),_,w,T,e.fov));let S=Math.min(A=Math.max(0,A=(t.roundZoom?Math.round:Math.floor)(A)),g);if(r.wrap=d.getWrap(c,o,r.wrap),r.zoom>=S){if(r.zoom>1),s=r.zoom+1;M.push({zoom:s,x:t,y:o,wrap:r.wrap,fullyVisible:a})}}return k.sort((e,t)=>e.distanceSq-t.distanceSq).map(e=>e.tileID)}function L$(e){return"raster"===e||"image"===e||"video"===e}function LW(e,t,r,i,n,a,o){if(r[0].overscaledZ>=a)return!1;let s=!1;for(let a of r){let r=e.getLoadedTile(a);if(!r)continue;let{fadingRole:l,fadingDirection:u,fadingParentID:c}=r;0===l&&0===u&&c||(r.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:t.tileID,fadeEndTime:n+o}),t.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:n+o})),i[a.key]=a,s=!0}return s}function LY(e,t){var r;e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0;let i=t.tileID.canonical.x-e.tileID.canonical.x,n=t.tileID.canonical.y-e.tileID.canonical.y,a=2**e.tileID.canonical.z,o=t.tileID.key;(0!==i||0!==n)&&(Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+a)?i+=a:1===Math.abs(i-a)&&(i-=a)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,i,n),null!=(r=e.neighboringTiles)&&r[o]&&(e.neighboringTiles[o].backfilled=!0))))}function LZ(e,t,r,i,n){return n?e?e(t,r)+i:0===i?void 0:i:i}function LX(e,t){let r=!0;return"always"===e||("never"===e||"never"===t)&&(r=!1),r}function LK(e,t,r){let i=vd();if(!e){var n,a,o,s,l;let{vecSouth:e,vecEast:r}=LJ(t),u=Ls();u[0]=r[0],u[1]=r[1],u[2]=e[0],u[3]=e[1],n=u[0],a=u[1],o=u[2],(l=n*(s=u[3])-o*a)&&(l=1/l,u[0]=s*l,u[1]=-a*l,u[2]=-o*l,u[3]=n*l),i[0]=u[0],i[1]=u[1],i[4]=u[2],i[5]=u[3]}return vv(i,i,[1/r,1/r,1]),i}function LJ(e){let t=Math.cos(e.rollInRadians),r=Math.sin(e.rollInRadians),i=Math.cos(e.pitchInRadians),n=Math.cos(e.bearingInRadians),a=Math.sin(e.bearingInRadians),o=vG();o[0]=-n*i*r-a*t,o[1]=-a*i*r+n*t;let s=vW(o);s<1e-9?vZ(o):v$(o,o,1/s);let l=vG();l[0]=n*i*t-a*r,l[1]=a*i*t+n*r;let u=vW(l);return u<1e-9?vZ(l):v$(l,l,1/u),{vecEast:l,vecSouth:o}}function LQ(e,t,r){var i,n;return LZ(e.getElevation,t,r,null!=(i=e.heightOffset)?i:0,null==(n=e.heightAnchorGround)||n)}function L0(e,t,r,i){let n;null==i?Pr(n=[e,t,0,1],n,r):vV(n=[e,t,i,1],n,r);let a=n[3];return{point:new vl(n[0]/a,n[1]/a),signedDistanceFromCamera:a,isOccluded:!1}}function L1(e,t,r,i,n,a,o,s){let l=a.glyphStartIndex+a.numGlyphs,u=a.lineStartIndex,c=a.lineStartIndex+a.lineLength,h=t.getoffsetX(a.glyphStartIndex),d=t.getoffsetX(l-1),f=Pe(e*h,r,i,n,a.segment,u,c,s,o);if(!f)return null;let p=Pe(e*d,r,i,n,a.segment,u,c,s,o);return!p||s.projectionCache.anyProjectionOccluded?null:{first:f,last:p}}function L2(e,t,r,i){return 1===e&&Math.abs(r.y-t.y)>Math.abs(r.x-t.x)*i?{useVertical:!0}:(2===e?t.yr.x)?{needsFlipping:!0}:null}function L3(e){let{projectionContext:t,pitchedLabelPlaneMatrixInverse:r,symbol:i,fontSize:n,flip:a,keepUpright:o,glyphOffsetArray:s,dynamicLayoutVertexArray:l,aspectRatio:u,rotateToLine:c}=e,h=n/24,d=i.lineOffsetX*h,f=i.lineOffsetY*h,p;if(i.numGlyphs>1){let e=i.glyphStartIndex+i.numGlyphs,n=i.lineStartIndex,l=i.lineStartIndex+i.lineLength,m=L1(h,s,d,f,a,i,c,t);if(!m)return{notEnoughRoom:!0};let g=L8(m.first.point.x,m.first.point.y,t,r),y=L8(m.last.point.x,m.last.point.y,t,r);if(o&&!a){let e=L2(i.writingMode,g,y,u);if(e)return e}p=[m.first];for(let r=i.glyphStartIndex+1;r0?o.point:L5(t.tileAnchorPoint,a,e,1,t),l=L8(e.x,e.y,t,r),c=L8(s.x,s.y,t,r),h=L2(i.writingMode,l,c,u);if(h)return h}let e=Pe(h*s.getoffsetX(i.glyphStartIndex),d,f,a,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,t,c);if(!e||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};p=[e]}for(let e of p)T7(l,e.point,e.angle);return{}}function L5(e,t,r,i,n){let a=e.add(e.sub(t)._unit()),o=L6(a.x,a.y,n).point,s=r.sub(o);return r.add(s._mult(i/s.mag()))}function L4(e,t,r){let i=t.projectionCache;if(i.projections[e])return i.projections[e];let n=new vl(t.lineVertexArray.getx(e),t.lineVertexArray.gety(e)),a=L6(n.x,n.y,t);if(a.signedDistanceFromCamera>0)return i.projections[e]=a.point,i.anyProjectionOccluded||(i.anyProjectionOccluded=a.isOccluded),a.point;let o=e-r.direction,s=0===r.distanceFromAnchor?t.tileAnchorPoint:new vl(t.lineVertexArray.getx(o),t.lineVertexArray.gety(o)),l=r.absOffsetX-r.distanceFromAnchor+1;return L5(s,n,r.previousVertex,l,t)}function L6(e,t,r){let i=e+r.translation[0],n=t+r.translation[1],a;return r.pitchWithMap?(a=L0(i,n,r.pitchedLabelPlaneMatrix,LQ(r,i,n))).isOccluded=!1:((a=r.transform.projectTileCoordinates(i,n,r.unwrappedTileID,LQ(r,i,n))).point.x=(.5*a.point.x+.5)*r.width,a.point.y=(-(.5*a.point.y)+.5)*r.height),a}function L8(e,t,r,i){if(r.pitchWithMap){let n=[e,t,0,1];vV(n,n,i);let a=n[0]/n[3],o=n[1]/n[3];return r.transform.projectTileCoordinates(a,o,r.unwrappedTileID,LQ(r,a,o)).point}return{x:e/r.width*2-1,y:1-t/r.height*2}}function L7(e,t,r){return r.transform.projectTileCoordinates(e,t,r.unwrappedTileID,LQ(r,e,t))}function L9(e,t,r){return e._unit()._perp()._mult(t*r)}function Pe(e,t,r,i,n,a,o,s,l){let u=i?e-t:e+t,c=u>0?1:-1,h=0;i&&(c*=-1,h=Math.PI),c<0&&(h+=Math.PI);let d=c>0?a+n:a+n+1,f;s.projectionCache.cachedAnchorPoint?f=s.projectionCache.cachedAnchorPoint:(f=L6(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=f);let p=f,m=f,g,y,v=0,x=0,b=Math.abs(u),_=[],w;for(;v+x<=b;){if((d+=c)=o)return null;v+=x,m=p,y=g;let e={absOffsetX:b,direction:c,distanceFromAnchor:v,previousVertex:m};if(p=L4(d,s,e),0===r)_.push(m),w=p.sub(m);else{let t,i=p.sub(m);t=0===i.mag()?L9(L4(d+c,s,e).sub(p),r,c):L9(i,r,c),y||(y=m.add(t)),g=function(e,t,r,i,n,a,o,s,l){if(s.projectionCache.offsets[e])return s.projectionCache.offsets[e];let u=r.add(t);if(e+l.direction=n)return s.projectionCache.offsets[e]=u,u;let c=L4(e+l.direction,s,l),h=L9(c.sub(r),o,l.direction),d=r.add(h),f=c.add(h);return s.projectionCache.offsets[e]=function(e,t,r,i){let n=t.y-e.y,a=t.x-e.x,o=i.y-r.y,s=i.x-r.x,l=o*a-s*n;if(0===l)return null;let u=(s*(e.y-r.y)-o*(e.x-r.x))/l;return new vl(e.x+u*a,e.y+u*n)}(a,u,d,f)||u,s.projectionCache.offsets[e]}(d,t,p,a,o,y,r,s,e),_.push(y),w=g.sub(y)}x=w.mag()}let T=(b-v)/x,A=w._mult(T)._add(y||m),M=h+Math.atan2(p.y-m.y,p.x-m.x);return _.push(A),{point:A,angle:l?M:0,path:_}}function Pt(e,t){for(let r=0;r(l[n]=!0,"define"===t?` +#ifndef HAS_UNIFORM_u_${n} +in ${r} ${i} ${n}; +#else +uniform ${r} ${i} u_${n}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${n} + ${r} ${i} ${n} = u_${n}; +#endif +`)),vertexSource:t=t.replace(r,(e,t,r,i,n)=>{let a="float"===i?"vec2":"vec4",o=n.match(/color/)?"color":a;return l[n]?"define"===t?` +#ifndef HAS_UNIFORM_u_${n} +uniform lowp float u_${n}_t; +layout(location = ${s++}) in ${r} ${a} a_${n}; +out ${r} ${i} ${n}; +#else +uniform ${r} ${i} u_${n}; +#endif +`:"vec4"===o?` +#ifndef HAS_UNIFORM_u_${n} + ${n} = a_${n}; +#else + ${r} ${i} ${n} = u_${n}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${n} + ${n} = unpack_mix_${o}(a_${n}, u_${n}_t); +#else + ${r} ${i} ${n} = u_${n}; +#endif +`:"define"===t?` +#ifndef HAS_UNIFORM_u_${n} +uniform lowp float u_${n}_t; +layout(location = ${s++}) in ${r} ${a} a_${n}; +#else +uniform ${r} ${i} u_${n}; +#endif +`:"vec4"===o?` +#ifndef HAS_UNIFORM_u_${n} + ${r} ${i} ${n} = a_${n}; +#else + ${r} ${i} ${n} = u_${n}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${n} + ${r} ${i} ${n} = unpack_mix_${o}(a_${n}, u_${n}_t); +#else + ${r} ${i} ${n} = u_${n}; +#endif +`}),staticAttributes:i,staticUniforms:o}}function Pc(e,t){if(!e.renderWorldCopies||e.lngRange)return;let r=t.lng-e.center.lng;t.lng+=r>180?-360:360*(r<-180)}function Ph(e){return Math.max(0,Math.floor(e))}function Pd(e,t,r,i){if(i<0||i>=1)return OS;let n=Math.floor(r),a=r-n;for(let r of e.zooms){let o=1<n;a++){let n=(r+i)/2;t(e,n)?i=n:r=n}return{lo:r,hi:i}}function Pm(e,t){return Pd(e.index,e.exaggeration,(e.near[0]+t*e.dx)/e.worldSize,(e.near[1]+t*e.dy)/e.worldSize)}function Pg(e,t){return Pf(Pm(e,t),e.near[2]+t*e.dz)}function Py(){xd("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Pv(e){if(e.useSlerp)if(e.k<1){var t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D,C,I;let L,P,z,F,O=x_(e.startEulerAngles.roll,e.startEulerAngles.pitch,e.startEulerAngles.bearing),R=x_(e.endEulerAngles.roll,e.endEulerAngles.pitch,e.endEulerAngles.bearing),B=new Float64Array(4);t=e.k,o=O[0],s=O[1],l=O[2],u=O[3],c=R[0],h=R[1],(p=o*c+s*h+l*(d=R[2])+u*(f=R[3]))<0&&(p=-p,c=-c,h=-h,d=-d,f=-f),1-p>1e-6?(i=Math.sin(r=Math.acos(p)),n=Math.sin((1-t)*r)/i,a=Math.sin(t*r)/i):(n=1-t,a=t),B[0]=n*o+a*c,B[1]=n*s+a*h,B[2]=n*l+a*d,B[3]=n*u+a*f;let j=(m=L=new Float64Array(9),g=B[0],y=B[1],v=B[2],x=B[3],b=g+g,_=y+y,w=v+v,T=g*b,A=y*b,M=y*_,k=v*b,S=v*_,E=v*w,D=x*b,C=x*_,I=x*w,m[0]=1-M-E,m[3]=A-I,m[6]=k+C,m[1]=A+I,m[4]=1-T-E,m[7]=S-D,m[2]=k-C,m[5]=S+D,m[8]=1-T-M,P=xv(-Math.asin(xt(L[2],-1,1))),.001>Math.hypot(L[5],L[8])?(z=0,F=-xv(Math.atan2(L[3],L[4]))):(z=xv(0===L[5]&&0===L[8]?0:Math.atan2(L[5],L[8])),F=xv(0===L[1]&&0===L[0]?0:Math.atan2(L[1],L[0]))),{roll:z,pitch:P+90,bearing:F});e.tr.setRoll(j.roll),e.tr.setPitch(j.pitch),e.tr.setBearing(j.bearing)}else e.tr.setRoll(e.endEulerAngles.roll),e.tr.setPitch(e.endEulerAngles.pitch),e.tr.setBearing(e.endEulerAngles.bearing);else e.tr.setRoll(kv.number(e.startEulerAngles.roll,e.endEulerAngles.roll,e.k)),e.tr.setPitch(kv.number(e.startEulerAngles.pitch,e.endEulerAngles.pitch,e.k)),e.tr.setBearing(kv.number(e.startEulerAngles.bearing,e.endEulerAngles.bearing,e.k))}function Px(e,t,r,i,n){let a=n.padding,o=Tn(n.worldSize,r.getNorthWest()),s=Tn(n.worldSize,r.getNorthEast()),l=Tn(n.worldSize,r.getSouthEast()),u=Tn(n.worldSize,r.getSouthWest()),c=xy(-i),h=o.rotate(c),d=s.rotate(c),f=l.rotate(c),p=u.rotate(c),m=new vl(Math.max(h.x,d.x,p.x,f.x),Math.max(h.y,d.y,p.y,f.y)),g=new vl(Math.min(h.x,d.x,p.x,f.x),Math.min(h.y,d.y,p.y,f.y)),y=m.sub(g),v=n.width-(a.left+a.right+t.left+t.right),x=n.height-(a.top+a.bottom+t.top+t.bottom),b=v/y.x,_=x/y.y;if(_<0||b<0)return void Py();let w=Math.min(xo(n.scale*Math.min(b,_)),e.maxZoom),T=vl.convert(e.offset),A=new vl((t.left-t.right)/2,(t.top-t.bottom)/2).rotate(xy(i)),M=T.add(A).mult(n.scale/xa(w));return{center:Ta(n.worldSize,o.add(l).div(2).sub(M)),zoom:w,bearing:i}}function Pb(e){return 2*Math.PI*PT(e.worldSize,e.center.lat)}function P_(e,t,r,i,n){var a;let o=1/(1<1e-6){let i=e[0]/r,n=Math.acos(e[2]/r);return new DJ(xr((i>0?n:-n)/Math.PI*180,-180,180),t)}return new DJ(0,t)}function Pk(e,t){let r=e.cameraPosition,i=vk(r);if(i<=1)return e.screenPointToLocation(t);let n=vQ();vL(n,r);let a=e.getRayDirectionFromPixel(t),o=-vP(a,n),s=vQ();vI(s,a,n,o);let l=vk(s);if(l<1e-9)return e.screenPointToLocation(t);let u=Math.atan2(l,o),c=.9*Math.asin(1/i);if(u1){let a=(Math.sign(e.lat+r)===Math.sign(e.lat)?Math.abs(e.lat):-Math.abs(e.lat))*Math.PI/180,o=Math.abs(e.lat+r)*Math.PI/180,s=PD(a+i*(o-a)),l=PD(a),u=PD(o),c=e.lng+(s-l)/(u-l)*t;return new DJ(c,n)}{let r=e.lng+t*i;return new DJ(r,n)}}function PI(e,t,r=1){let i=vP(e,t),n=r*r,a=vQ(),o=vQ();vC(o,t,i),Ms(a,e,o);let s=n-vP(a,a);if(s<0)return null;let l=vP(e,e)-n,u=-i+(i<0?1:-1)*Math.sqrt(s),c=l/u;return{tMin:Math.min(c,u),tMax:Math.max(c,u)}}function PL(e,t,r){let i=e-t;return i<0?-i:Math.max(0,i-r)}function PP(e,t,r,i,n){let a=e-r;return Math.max(a<0?Math.min(-a,1+a-n):a>n?Math.min(Math.max(a-n,0),1-a):0,PL(t,i,n))}function Pz(e,t){let r=1/0,i=-1/0;for(let n of t){let t=vP(e,n);r=Math.min(r,t),i=Math.max(i,t)}return{min:r,max:i}}function PF(e,t){let r=vQ();vI(r,e.origin,e.direction,t);let i=vk(r),n=vQ();vC(n,r,1/i);let a=PM(n),o=D0.fromLngLat(a),s=new D0(o.x,xt(o.y,0,.999999999)),l=Pd(e.index,e.exaggeration,s.x,s.y),u=Math.abs(a.lat)>85.051129?0:l.elevation;return{sample:f(d({},l),{elevation:u}),radius:i,mercator:s}}function PO(e,t){let{sample:r,radius:i}=PF(e,t);return Pf(r,(i-1)*DK)}function PR(e){let t={},r=0;for(let{name:i,type:n}of e){let[e,a]=OK[n];r=Math.ceil(r/a)*a,t[i]=r,r+=e}return{offsets:t,contentWords:r,sizeWords:4*Math.ceil(r/4)}}function PB(e){let t=[];for(let r of e){if(null===r)continue;let e=r.split(" ");t.push(e.pop())}return t}function Pj(e,t,r){let i=1/vX(r,1,t.transform.tileZoom),n=2**r.tileID.overscaledZ,a=r.tileSize*2**t.transform.tileZoom/n,o=a*(r.tileID.canonical.x+r.tileID.wrap*n),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}function PN(e,t){return 1/vX(e,1,t.tileZoom)}function PV(e,t,r){return v3(e.transform,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}function PU(e,t,r,i,n){var a,o;let s=e.context,l=e.transform,u=s.gl,c=e.useProgram("collisionBox"),h=[],d=0,f=0;for(let o of i){let i=t.getTile(o).getBucket(r);if(!i)continue;let p=n?i.textCollisionBox:i.iconCollisionBox,m=i.collisionCircleArray;m.length>0&&(h.push({circleArray:m,circleOffset:f,coord:o}),d+=m.length/4,f=d),p&&c.draw(s,u.LINES,BE.disabled,BD.disabled,e.colorModeForRenderPass(),BC.disabled,null,null==(a=e.style.map.terrain)?void 0:a.getTerrainData(o),l.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,null,e.transform.zoom,null,null,p.collisionVertexBuffer)}if(!n||!h.length)return;let p=e.useProgram("collisionCircle"),m=new Eb;m.resize(4*d),m._trim();let g=0;for(let e of h)for(let t=0;th.getElevation(n,e,t):void 0;!function(e,t,r,i,n,a,o,s,l,u,c,h,d){let f=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,m=e.icon.dynamicLayoutVertexArray,g={};p.clear();for(let m=0;m=0&&(g[y.associatedIconIndex]={shiftedAnchor:E,angle:D})}else Pt(y.numGlyphs,p)}if(l){m.clear();let t=e.icon.placedSymbolArray;for(let e=0;ee.style.map.terrain.getElevation(s,t,r):void 0;!function(e,t,r,i,n,a,o,s,l,u,c,h,d){let f=r?e.textSizeData:e.iconSizeData,p=T$(f,t.transform.zoom),m=[256/t.width*2+1,256/t.height*2+1],g=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;g.clear();let y=e.lineVertexArray,v=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,x=t.transform.width/t.transform.height,b=!1;for(let r=0;r=-m[0]&&_.x<=m[0]&&_.y>=-m[1])||!(_.y<=m[1])){Pt(w.numGlyphs,g);continue}let k=M.signedDistanceFromCamera,S=.5+t.transform.cameraToCenterDistance/k*.5,E=TH(f,p,w),D=a?E*t.transform.getPitchedTextCorrection(w.anchorX,w.anchorY,l)/S:E*S,C=L3({projectionContext:A,pitchedLabelPlaneMatrixInverse:n,symbol:w,fontSize:D,flip:!1,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:x,rotateToLine:s});b=C.useVertical,(C.notEnoughRoom||b||C.needsFlipping&&L3({projectionContext:A,pitchedLabelPlaneMatrixInverse:n,symbol:w,fontSize:D,flip:!0,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:x,rotateToLine:s}).notEnoughRoom)&&Pt(w.numGlyphs,g)}r?e.text.dynamicLayoutVertexBuffer.updateData(g):e.icon.dynamicLayoutVertexBuffer.updateData(g)}(l,e,n,B,t,x,u,"map"===r.layout.get("text-rotation-alignment"),s.toUnwrapped(),y.width,y.height,N,i)}let $=n&&M||q,W=x?B:e.transform.clipSpaceToPixelsMatrix,Y=b||$?BL:W,Z=p&&0!==r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),X={program:E,buffers:c,uniformValues:p?l.iconsInText?RR(m.kind,D,_,x,b,$,e,Y,j,N,I,L,S,G,H):RO(m.kind,D,_,x,b,$,e,Y,j,N,n,I,Z,S,G,H):RF(m.kind,D,_,x,b,$,e,Y,j,N,n,I,S,G,H),projectionData:V,atlasTexture:P,atlasTextureIcon:F,atlasInterpolation:z,atlasInterpolationIcon:O,isSDF:p,hasHalo:Z};if(w&&l.canOverlap)for(let e of(T=!0,c.segments.get()))k.push({segments:new EE([e]),sortKey:e.sortKey,state:X,terrainData:C});else k.push({segments:c.segments,sortKey:0,state:X,terrainData:C})}T&&k.sort((e,t)=>e.sortKey-t.sortKey);let E=null!=(p=r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(null))?p:1/0,D=24*r.layout.get("text-letter-spacing").constantOr(0)<0||E>1;for(let t of k){let i=t.state;m.activeTexture.set(g.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,g.CLAMP_TO_EDGE),i.atlasTextureIcon&&(m.activeTexture.set(g.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,g.CLAMP_TO_EDGE));let n=i.isSDF&&i.hasHalo;if(n){let n=i.uniformValues;n.u_is_halo=1,D&&(n.u_is_plain=0,PH(i.buffers,t.segments,r,e,i.program,A,c,h,n,i.projectionData,t.terrainData),n.u_is_halo=0,n.u_is_plain=1)}PH(i.buffers,t.segments,r,e,i.program,A,c,h,i.uniformValues,i.projectionData,t.terrainData),n&&!D&&(i.uniformValues.u_is_halo=0)}}function PH(e,t,r,i,n,a,o,s,l,u,c){let h=i.context,d=h.gl;n.draw(h,d.TRIANGLES,a,o,s,BC.backCCW,l,c,u,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,i.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function P$(e,t,r,i,n){var a;if("translucent"!==n.currentPass)return;let{isRenderingToTexture:o}=n,s=r.paint.get("circle-opacity"),l=r.paint.get("circle-stroke-width"),u=r.paint.get("circle-stroke-opacity"),c=!r.layout.get("circle-sort-key").isConstant();if(0===s.constantOr(1)&&(0===l.constantOr(1)||0===u.constantOr(1)))return;let h=e.context,d=h.gl,f=e.transform,p=e.getDepthModeForSublayer(0,BE.ReadOnly),m=BD.disabled,g=e.colorModeForRenderPass(),y=[],v=f.getCircleRadiusCorrection();for(let n of i){let i=t.getTile(n),s=i.getBucket(r);if(!s)continue;let l=v3(f,i,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u=s.programConfigurations.get(r.id),h=e.useProgram("circle",u),d=s.layoutVertexBuffer,p=s.indexBuffer,m=null==(a=e.style.map.terrain)?void 0:a.getTerrainData(n),g={programConfiguration:u,program:h,layoutVertexBuffer:d,indexBuffer:p,uniformValues:Rs(e,i,r,l,v),terrainData:m,projectionData:f.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!o,applyTerrainMatrix:!0})};if(c)for(let e of s.segments.get())y.push({segments:new EE([e]),sortKey:e.sortKey,state:g});else y.push({segments:s.segments,sortKey:0,state:g})}for(let t of(c&&y.sort((e,t)=>e.sortKey-t.sortKey),y)){let{programConfiguration:i,program:n,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l,projectionData:u}=t.state,c=t.segments;n.draw(h,d.TRIANGLES,p,m,g,BC.backCCW,s,l,u,r.id,a,o,c,r.paint,e.transform.zoom,i)}}function PW(e,t,r,i,n){if(0===r.paint.get("heatmap-opacity"))return;let a=e.context,{isRenderingToTexture:o,isRenderingGlobe:s}=n;if(e.style.map.terrain){for(let a of i){let i=t.getTile(a);t.hasRenderableParent(a)||("offscreen"===n.currentPass?function(e,t,r,i,n){let a=e.context,o=a.gl,s=BD.disabled,l=new Bk([o.ONE,o.ONE],ke.transparent,[!0,!0,!0,!0]),u=t.getBucket(r);if(!u)return;let c=i.key,h=r.heatmapFbos.get(c);h||(h=PY(a,t.tileSize,t.tileSize),r.heatmapFbos.set(c,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,t.tileSize,t.tileSize]),a.clear({color:ke.transparent});let d=u.programConfigurations.get(r.id),f=e.useProgram("heatmap",d,!n),p=e.transform.getProjectionData({overscaledTileID:t.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),m=e.style.map.terrain.getTerrainData(i);f.draw(a,o.TRIANGLES,BE.disabled,s,l,BC.disabled,Rd(t,e.transform.zoom,r.paint.get("heatmap-intensity"),1),m,p,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,e.transform.zoom,d)}(e,i,r,a,s):"translucent"===n.currentPass&&function(e,t,r,i,n){let a=e.context,o=a.gl,s=e.transform;a.setColorMode(e.colorModeForRenderPass());let l=PZ(a,t),u=r.key,c=t.heatmapFbos.get(u);if(!c)return;a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,c.colorAttachment.get()),a.activeTexture.set(o.TEXTURE1),l.bind(o.LINEAR,o.CLAMP_TO_EDGE);let h=s.getProjectionData({overscaledTileID:r,applyTerrainMatrix:n,applyGlobeMatrix:!i});e.useProgram("heatmapTexture").draw(a,o.TRIANGLES,BE.disabled,BD.disabled,e.colorModeForRenderPass(),BC.disabled,Rf(e,t,0,1),null,h,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,s.zoom),c.destroy(),t.heatmapFbos.delete(u)}(e,r,a,o,s))}a.viewport.set([0,0,e.width,e.height])}else{var l,u;let a,o,s;"offscreen"===n.currentPass?function(e,t,r,i){var n,a,o;let s,l,u=e.context,c=u.gl,h=e.transform,d=BD.disabled,f=new Bk([c.ONE,c.ONE],ke.transparent,[!0,!0,!0,!0]);for(let p of(n=u,a=e,o=r,s=n.gl,n.activeTexture.set(s.TEXTURE1),n.viewport.set([0,0,a.width/4,a.height/4]),(l=o.heatmapFbos.get(Dn))?(s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get()),n.bindFramebuffer.set(l.framebuffer)):(l=PY(n,a.width/4,a.height/4),o.heatmapFbos.set(Dn,l)),u.clear({color:ke.transparent}),i)){if(t.hasRenderableParent(p))continue;let i=t.getTile(p),n=i.getBucket(r);if(!n)continue;let a=n.programConfigurations.get(r.id),o=e.useProgram("heatmap",a),s=h.getProjectionData({overscaledTileID:p,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),l=h.getCircleRadiusCorrection();o.draw(u,c.TRIANGLES,BE.disabled,d,f,BC.backCCW,Rd(i,h.zoom,r.paint.get("heatmap-intensity"),l),null,s,r.id,n.layoutVertexBuffer,n.indexBuffer,n.segments,r.paint,h.zoom,a)}u.viewport.set([0,0,e.width,e.height])}(e,t,r,i):"translucent"===n.currentPass&&(l=e,u=r,o=(a=l.context).gl,a.setColorMode(l.colorModeForRenderPass()),(s=u.heatmapFbos.get(Dn))&&(a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,s.colorAttachment.get()),a.activeTexture.set(o.TEXTURE1),PZ(a,u).bind(o.LINEAR,o.CLAMP_TO_EDGE),l.useProgram("heatmapTexture").draw(a,o.TRIANGLES,BE.disabled,BD.disabled,l.colorModeForRenderPass(),BC.disabled,Rf(l,u,0,1),null,null,u.id,l.viewportBuffer,l.quadTriangleIndexBuffer,l.viewportSegments,u.paint,l.transform.zoom)))}}function PY(e,t,r){let i=e.gl,n=i.createTexture();i.bindTexture(i.TEXTURE_2D,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texStorage2D(i.TEXTURE_2D,1,i.RGBA16F,t,r);let a=e.createFramebuffer(t,r,!1,!1);return a.colorAttachment.set(n),a}function PZ(e,t){return t.colorRampTexture||(t.colorRampTexture=new Df(e,t.colorRamp,e.gl.RGBA)),t.colorRampTexture}function PX(e,t,r,i){let n=e.context,a=n.bindFramebuffer.get(),o=n.viewport.get(),[,,s,l]=o;return function(e,t,r){let i=e.context.gl;if(!e.layerOpacityFbo){let n=e.context.createFramebuffer(t,r,!0,!0),a=i.createTexture();i.bindTexture(i.TEXTURE_2D,a),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,r,0,i.RGBA,i.UNSIGNED_BYTE,null),n.colorAttachment.set(a),n.depthAttachment.set(e.context.createRenderbuffer(i.DEPTH_STENCIL,t,r)),e.layerOpacityFbo=n,e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}if(e.layerOpacityFbo.width===t&&e.layerOpacityFbo.height===r)return e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);let n=e.layerOpacityFbo;i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,r,0,i.RGBA,i.UNSIGNED_BYTE,null),e.context.bindRenderbuffer.set(n.depthAttachment.get()),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t,r),e.context.bindRenderbuffer.set(null),n.width=t,n.height=r,e.context.bindFramebuffer.set(n.framebuffer)}(e,s,l),n.viewport.set([0,0,s,l]),n.clear({color:ke.transparent,depth:1,stencil:0}),e.currentStencilSource=void 0,e.renderTileClippingMasks(t,r,i),{compositeTarget:a,compositeViewport:o}}function PK(e,t,r,i){let n=e.context,a=n.gl;n.bindFramebuffer.set(r.compositeTarget),n.viewport.set(r.compositeViewport),n.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,e.layerOpacityFbo.colorAttachment.get()),e.useProgram("layerOpacity").draw(n,a.TRIANGLES,BE.disabled,BD.disabled,e.colorModeForRenderPass(),BC.disabled,RI(t,0),null,null,i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom),e.currentStencilSource=void 0}function PJ(e,t,r,i,n,a,o,s){let l=256;if(n.stepInterpolant){var u;let i=t.getSource().maxzoom,n=o.canonical.z===i?Math.ceil(1<e.options.anisotropicFilterPitch&&p.texParameterf(p.TEXTURE_2D,f.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,f.extTextureFilterAnisotropicMax);let C=e.getTerrainDataForTile(A,c),I=g.getProjectionData({overscaledTileID:A,aligned:x,applyGlobeMatrix:!c,applyTerrainMatrix:!0}),L=FI(E,S,D.fadeMix,r,s,l),P=h??y.getMeshFromTileID(f,A.canonical,a,o,"raster"),z=n?n[A.overscaledZ]:BD.disabled;m.draw(f,p.TRIANGLES,i,z,v,u?BC.frontCCW:BC.backCCW,L,C,I,r.id,P.vertexBuffer,P.indexBuffer,P.segments)}}function zn(e,t,r,i,n){let a=r.paint.get("background-color"),o=r.paint.get("background-opacity");if(0===o)return;let{isRenderingToTexture:s}=n,l=e.context,u=l.gl,c=e.style.projection,h=e.transform,d=h.tileSize,f=r.paint.get("background-pattern");if(e.isPatternMissing(f))return;let p=!f&&1===a.a&&1===o&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(n.currentPass!==p)return;let m=BD.disabled,g=e.getDepthModeForSublayer(0,"opaque"===p?BE.ReadWrite:BE.ReadOnly),y=e.colorModeForRenderPass(),v=e.useProgram(f?"backgroundPattern":"background"),x=i||LH(h,{tileSize:d,terrain:e.style.map.terrain});f&&(l.activeTexture.set(u.TEXTURE0),e.patternAtlas.bind(e.context));let b=r.getCrossfadeParameters();for(let t of x){let i=h.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),n=f?RV(o,e,f,{tileID:t,tileSize:d},b):RN(o,a),p=e.getTerrainDataForTile(t,s),x=c.getMeshFromTileID(l,t.canonical,!1,!0,"raster");v.draw(l,u.TRIANGLES,g,m,y,BC.backCCW,n,p,i,r.id,x.vertexBuffer,x.indexBuffer,x.segments)}}function za(e){var t,r,i,n;let a=e.transform.padding;zo(e,e.transform.height-(a.top||0),3,BF),zo(e,a.bottom||0,3,BO),zs(e,a.left||0,3,BR),zs(e,e.transform.width-(a.right||0),3,BB);let o=e.transform.centerPoint;t=e,r=o.x,i=e.transform.height-o.y,zl(t,r-1,i-10,2,20,n=Bj),zl(t,r-10,i-1,20,2,n)}function zo(e,t,r,i){zl(e,0,t+r/2,e.transform.width,r,i)}function zs(e,t,r,i){zl(e,t-r/2,0,r,e.transform.height,i)}function zl(e,t,r,i,n,a){let o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,r*e.pixelRatio,i*e.pixelRatio,n*e.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function zu(e,t,r){for(let i of r)!function(e,t,r){var i,n;let a=e.context,o=a.gl,s=e.useProgram("debug"),l=BE.disabled,u=BD.disabled,c=e.colorModeForRenderPass(),h="$debug",d=null==(i=e.style.map.terrain)?void 0:i.getTerrainData(r);a.activeTexture.set(o.TEXTURE0);let f=Math.floor(((null==(n=t.getTileByID(r.key).latestRawTileData)?void 0:n.byteLength)||0)/1024),p=512/Math.min(t.getTile(r).tileSize,512)*(r.overscaledZ/e.transform.zoom)*.5,m=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(m+=` => ${r.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();let r=e.debugOverlayCanvas,i=e.context.gl,n=e.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.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(r),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,`${m} ${f}kB`);let g=e.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});s.draw(a,o.TRIANGLES,l,u,Bk.alphaBlended,BC.disabled,Ru(ke.transparent,p),null,g,h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(a,o.LINE_STRIP,l,u,c,BC.disabled,Ru(ke.red),d,g,h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}(e,t,i)}function zc(e,t,r,i){let{isRenderingGlobe:n}=i,a=e.context,o=r.implementation,s=e.style.projection,l=e.transform,u=l.getProjectionDataForCustomLayer(n),c={farZ:l.farZ,nearZ:l.nearZ,fov:l.fov*Math.PI/180,modelViewProjectionMatrix:l.modelViewProjectionMatrix,projectionMatrix:l.projectionMatrix,shaderData:{variantName:s.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793; +uniform mat4 u_projection_matrix; +${s.shaderPreludeCode.vertexSource}`,define:s.shaderDefine},defaultProjectionData:u,getProjectionData:e=>{var t;return l.getProjectionData({overscaledTileID:new In(e.tileID.canonical.z,null!=(t=e.tileID.wrap)?t:0,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),aligned:e.aligned,applyGlobeMatrix:e.applyGlobeMatrix,applyTerrainMatrix:e.applyTerrainMatrix})}},h=o.renderingMode?o.renderingMode:"2d";if("offscreen"===i.currentPass){let t=o.prerender;t&&(e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),t.call(o,a.gl,c),a.setDirty(),e.setBaseState())}else if("translucent"===i.currentPass){e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),a.setStencilMode(BD.disabled);let t="3d"===h?e.getDepthModeFor3D():e.getDepthModeForSublayer(0,BE.ReadOnly);a.setDepthMode(t),o.render(a.gl,c),a.setDirty(),e.setBaseState(),a.bindFramebuffer.set(null)}}function zh(e,t){let r=e.context,i=r.gl,n=e.transform,a=Bk.unblended,o=new BE(i.LEQUAL,BE.ReadWrite,[0,1]),s=t.tileManager.getRenderableTiles(),l=e.useProgram("terrainDepth");for(let u of(r.bindFramebuffer.set(t.getFramebuffer().framebuffer),r.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),r.clear({color:ke.white,depth:1}),s)){let e=t.getTerrainMesh(u.tileID),s=t.getTerrainData(u.tileID),c=n.getProjectionData({overscaledTileID:u.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),h=OZ(t.getSkirtLength(n.zoom));l.draw(r,i.TRIANGLES,o,BD.disabled,a,BC.backCCW,h,s,c,"terrain",e.vertexBuffer,e.indexBuffer,e.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,e.width,e.height])}function zd(e,t){if(!t.mesh){let r=new Eo;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);let i=new ET;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),t.mesh=new FL(e.createVertexBuffer(r,FP.members),e.createIndexBuffer(i),EE.simpleSegment(0,0,r.length,i.length))}return t.mesh}function zf(e,t){let r=e.context,i=r.gl,n=RH(t,e.transform,e.pixelRatio),a=new BE(i.LEQUAL,BE.ReadWrite,[0,1]),o=BD.disabled,s=e.colorModeForRenderPass(),l=e.useProgram("sky"),u=zd(r,t);l.draw(r,i.TRIANGLES,a,o,s,BC.disabled,n,null,void 0,"sky",u.vertexBuffer,u.indexBuffer,u.segments)}function zp(e,t,r){var i,n,a,o,s,l;let u,c,h=e.context,d=h.gl,f=e.useProgram("atmosphere"),p=new BE(d.LEQUAL,BE.ReadOnly,[0,1]),m=e.transform,g=(i=e.transform,n=u=r.getCartesianPosition(),n[0]=-u[0],n[1]=-u[1],n[2]=-u[2],c=vp(new Float64Array(16)),"map"===r.properties.get("anchor")&&(v_(c,c,i.rollInRadians),vx(c,c,-i.pitchInRadians),v_(c,c,i.bearingInRadians),vx(c,c,i.center.lat*Math.PI/180),vb(c,c,-i.center.lng*Math.PI/180)),a=u[0],o=u[1],s=u[2],(l=c[3]*a+c[7]*o+c[11]*s+c[15])||(l=1),u[0]=(c[0]*a+c[4]*o+c[8]*s+c[12])/l,u[1]=(c[1]*a+c[5]*o+c[9]*s+c[13])/l,u[2]=(c[2]*a+c[6]*o+c[10]*s+c[14])/l,u),y=m.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),v=t.properties.get("atmosphere-blend")*y.projectionTransition;if(0===v)return;let x=PT(m.worldSize,m.center.lat),b=PA(m),_=Rq(g,v,b,x,m.inverseProjectionMatrix),w=zd(h,t);f.draw(h,d.TRIANGLES,p,BD.disabled,Bk.alphaBlended,BC.disabled,_,null,null,"atmosphere",w.vertexBuffer,w.indexBuffer,w.segments)}function zm(e,t){let r=!1,i=null,n,a=()=>{i=null,r&&(e(...n),i=setTimeout(a,t),r=!1)};return(...e)=>(r=!0,n=e,i||a(),i)}function zg(e,t){(!e.duration||e.durationMath.abs(e.x)}function zT(e){return e*(2-e)}function zA(e){var t;return(null==(t=e.panDelta)?void 0:t.mag())||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}function zM(e,t,r,i=!1){if(i||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let n=new DJ(e.lng,e.lat);if(e=new DJ(e.lng,e.lat),t){let i=new DJ(e.lng-360,e.lat),n=new DJ(e.lng+360,e.lat),a=r.locationToScreenPoint(e).distSqr(t);r.locationToScreenPoint(i).distSqr(t)180;){let t=r.locationToScreenPoint(e);if(t.x>=0&&t.y>=0&&t.x<=r.width&&t.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e.lng!==n.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(e))?e:n}function zk(e,t,r){let i=e.classList;for(let e in jF)i.remove(`maplibregl-${r}-anchor-${e}`);i.add(`maplibregl-${r}-anchor-${t}`)}function zS(e,t,r=[]){let i=zY.createNS("http://www.w3.org/2000/svg",e);for(let e in t)i.setAttributeNS(null,e,t[e]);for(let e of r)i.appendChild(e);return i}function zE(e,t,r){let i=r?.maxWidth||100,n=e._container.clientHeight/2,a=e._container.clientWidth/2,o=e.unproject([a-i/2,n]),s=e.unproject([a+i/2,n]),l=Math.min(i,Math.round(e.project(s).x-e.project(o).x),e._container.clientWidth),u=o.distanceTo(s);if(r?.unit==="imperial"){let r=3.2808*u;r>5280?zD(t,l,r/5280,e._getUIString("ScaleControl.Miles")):zD(t,l,r,e._getUIString("ScaleControl.Feet"))}else r?.unit==="nautical"?zD(t,l,u/1852,e._getUIString("ScaleControl.NauticalMiles")):u>=1e3?zD(t,l,u/1e3,e._getUIString("ScaleControl.Kilometers")):zD(t,l,u,e._getUIString("ScaleControl.Meters"))}function zD(e,t,r,i){var n,a;let o,s,l,u=(n=r,s=10**(`${Math.floor(n)}`.length-1),l=n/s,s*(l=l>=10?10:l>=5?5:l>=3?3:l>=2?2:l>=1?1:(a=l,o=10**Math.ceil(-Math.log(a)/Math.LN10),Math.round(a*o)/o))),c=u/r;e.style.width=`${t*c}px`,e.innerHTML=`${u} ${i}`}function zC(e,t){return LN().setRTLTextPlugin(e,t)}function zI(){return LN().getRTLTextPluginStatus()}function zL(){return j3}function zP(){return Fv.workerCount}function zz(e){Fv.workerCount=e}function zF(){return MT.MAX_PARALLEL_IMAGE_REQUESTS}function zO(e){MT.MAX_PARALLEL_IMAGE_REQUESTS=e}function zR(){return MT.WORKER_URL}function zB(e){MT.WORKER_URL=e}function zj(e){return b(this,null,function*(){yield LD().broadcast("IS",e)})}var zN,zV,zU,zq,zG,zH,z$,zW,zY,zZ,zX,zK,zJ,zQ,z0,z1,z2,z3,z5,z4,z6,z8,z7,z9,Fe,Ft,Fr,Fi,Fn,Fa,Fo,Fs,Fl,Fu,Fc,Fh,Fd,Ff,Fp,Fm,Fg,Fy,Fv,Fx,Fb,F_,Fw,FT,FA,FM,Fk,FS,FE,FD,FC,FI,FL,FP,Fz,FF,FO,FR,FB,Fj,FN,FV,FU,Fq,FG,FH,F$,FW,FY,FZ,FX,FK,FJ,FQ,F0,F1,F2,F3,F5,F4,F6,F8,F7,F9,Oe,Ot,Or,Oi,On,Oa,Oo,Os,Ol,Ou,Oc,Oh,Od,Of,Op,Om,Og,Oy,Ov,Ox,Ob,O_,Ow,OT,OA,OM,Ok,OS,OE,OD,OC,OI,OL,OP,Oz,OF,OO,OR,OB,Oj,ON,OV,OU,Oq,OG,OH,O$,OW,OY,OZ,OX,OK,OJ,OQ,O0,O1,O2,O3,O5,O4,O6,O8,O7,O9,Re,Rt,Rr,Ri,Rn,Ra,Ro,Rs,Rl,Ru,Rc,Rh,Rd,Rf,Rp,Rm,Rg,Ry,Rv,Rx,Rb,R_,Rw,RT,RA,RM,Rk,RS,RE,RD,RC,RI,RL,RP,Rz,RF,RO,RR,RB,Rj,RN,RV,RU,Rq,RG,RH,R$,RW,RY,RZ,RX,RK,RJ,RQ,R0,R1,R2,R3,R5,R4,R6,R8,R7,R9,Be,Bt,Br,Bi,Bn,Ba,Bo,Bs,Bl,Bu,Bc,Bh,Bd,Bf,Bp,Bm,Bg,By,Bv,Bx,Bb,B_,Bw,BT,BA,BM,Bk,BS,BE,BD,BC,BI,BL,BP,Bz,BF,BO,BR,BB,Bj,BN,BV,BU,Bq,BG,BH,B$,BW,BY,BZ,BX,BK,BJ,BQ,B0,B1,B2,B3,B5,B4,B6,B8,B7,B9,je,jt,jr,ji,jn,ja,jo,js,jl,ju,jc,jh,jd,jf,jp,jm,jg,jy,jv,jx,jb,j_,jw,jT,jA,jM,jk,jS,jE,jD,jC,jI,jL,jP,jz,jF,jO,jR,jB,jj,jN,jV,jU,jq,jG,jH,j$,jW,jY,jZ,jX,jK,jJ,jQ,j0,j1,j2,j3,j5=p({"node_modules/maplibre-gl/dist/maplibre-gl.mjs"(){var e;let t,r,i,n,a,o,s;La(),zN={},zG={frame(e,t,r,i){let n=i||window,a=n.requestAnimationFrame(e=>{o(),t(e)}),{unsubscribe:o}=xg(e.signal,"abort",()=>{o(),n.cancelAnimationFrame(a),r(new Mw(e.signal.reason))},!1)},frameAsync(e,t){return new Promise((r,i)=>{this.frame(e,r,i,t)})},getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t;if(vu()&&!vc())t=new OffscreenCanvas(e.width,e.height).getContext("2d",{willReadFrequently:!0});else{let r=window.document.createElement("canvas");r.width=e.width,r.height=e.height,t=r.getContext("2d",{willReadFrequently:!0})}if(!t)throw Error("failed to create canvas 2d context");return t.drawImage(e,0,0,e.width,e.height),t},resolveURL:e=>(zV||(zV=document.createElement("a")),zV.href=e,zV.href),get hardwareConcurrency(){return"u">typeof navigator&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return void 0===zq?!!matchMedia&&(zU??(zU=matchMedia("(prefers-reduced-motion: reduce)")),zU.matches):zq},set prefersReducedMotion(e){zq=e}},zH=new class{constructor(){this._frozenAt=null}getCurrentTime(){return null===this._frozenAt?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return null!==this._frozenAt}},(zW=class{static create(e,t,r){let i=window.document.createElement(e);return void 0!==t&&(i.className=t),r&&r.appendChild(i),i}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){zW.docStyle&&zW.selectProp&&(zW.userSelect=zW.docStyle[zW.selectProp],zW.docStyle[zW.selectProp]="none")}static enableDrag(){zW.docStyle&&zW.selectProp&&(zW.docStyle[zW.selectProp]=zW.userSelect)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",zW.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",zW.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",zW.suppressClickInternal,!0)},0)}static getScale(e){let t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,t,r){let i=t.boundingClientRect;return new vl((r.clientX-i.left)/t.x-e.clientLeft,(r.clientY-i.top)/t.y-e.clientTop)}static mousePos(e,t){let r=zW.getScale(e);return zW.getPoint(e,r,t)}static touchPos(e,t){let r=[],i=zW.getScale(e);for(let n of t)r.push(zW.getPoint(e,i,n));return r}static sanitize(e){let t=new DOMParser().parseFromString(e,"text/html").body||document.createElement("body");for(let e of t.querySelectorAll("script, iframe"))e.remove();return zW.clean(t),t.innerHTML}static isPossiblyDangerous(e,t){let r=t.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(e)&&(r.includes("javascript:")||r.includes("data:"))||"srcdoc"===e||e.startsWith("on"))return!0}static clean(e){for(let t of e.children)zW.removeAttributes(t),zW.clean(t)}static removeAttributes(e){for(let{name:t,value:r}of Array.from(e.attributes))zW.isPossiblyDangerous(t,r)&&e.removeAttribute(t)}}).docStyle="u">typeof window&&(null==(z$=window.document)?void 0:z$.documentElement.style),zW.selectProp=!zW.docStyle||"userSelect"in zW.docStyle?"userSelect":"webkitUserSelect",zY=zW,(e=zZ||(zZ={})).resetRequestQueue=()=>{t=[],r=0,i=0,n={}},e.addThrottleControl=e=>{let t=i++;return n[t]=e,t},e.removeThrottleControl=e=>{delete n[e],o()},e.transformAndGetImage=function(e,t,r,i,n=!0,a){return b(this,null,function*(){let o=yield e.transformRequest(t,r);return xT(i.signal),zZ.getImage(o,i,n,a)})},e.getImage=(e,r,i=!0,n)=>new Promise((a,s)=>{e.headers||(e.headers={}),e.headers.accept="image/webp,*/*",xi(e,{type:"image"}),t.push({abortController:r,requestParameters:e,supportImageRefresh:i,imageBitmapOptions:n,state:"queued",onError:e=>{s(e)},onSuccess:e=>{a(e)}}),o()}),a=e=>b(null,null,function*(){e.state="running";let{requestParameters:t,supportImageRefresh:i,imageBitmapOptions:n,onError:a,onSuccess:l,abortController:u}=e,c=!1===i&&!n&&!xp(self)&&!xA(t.url)&&(!t.headers||Object.keys(t.headers).reduce((e,t)=>e&&"accept"===t,!0));r++;let h=c?s(t,u):Mk(t,u);try{let t,r=yield h;delete e.abortController,e.state="completed",r.data instanceof HTMLImageElement||xm(r.data)?l(r):l(r.data&&0!==r.data.byteLength?{data:yield(t=r.data,"function"==typeof createImageBitmap?My(t,n):Mv(t)),cacheControl:r.cacheControl,expires:r.expires}:{data:null,cacheControl:r.cacheControl,expires:r.expires})}catch(t){delete e.abortController,a(vK(t))}finally{r--,o()}}),o=()=>{let e=(()=>{for(let e of Object.keys(n))if(n[e]())return!0;return!1})()?MT.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:MT.MAX_PARALLEL_IMAGE_REQUESTS;for(let i=r;i0;i++){let e=t.shift();if(e.abortController.signal.aborted){i--;continue}a(e)}},s=(e,t)=>new Promise((r,i)=>{let n=new Image,a=e.url,o=e.credentials;o&&"include"===o?n.crossOrigin="use-credentials":(o&&"same-origin"===o||!xE(a))&&(n.crossOrigin="anonymous"),t.signal.addEventListener("abort",()=>{n.src="",i(new Mw(t.signal.reason))}),n.fetchPriority="high",n.onload=()=>{n.onerror=n.onload=null,r({data:n})},n.onerror=()=>{n.onerror=n.onload=null,t.signal.aborted||i(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},n.src=a}),zZ.resetRequestQueue(),zX=class{constructor(e){this._transformRequestFn=e??null}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}},zK=class extends MC{},zJ=class extends zK{},zQ=class extends zK{constructor(e={}){super("style.load",e)}},z0=class extends zK{constructor(e,t={}){super(e,t),this.dataType="style"}},z1=class extends zK{constructor(e,t={}){super(e,t),this.dataType="source"}},z2=class extends zK{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r,i={}){r=r instanceof MouseEvent?r:new MouseEvent(e,r);let n=zY.mousePos(t.getCanvas(),r),a=t.unproject(n);super(e,xi({point:n,lngLat:a,originalEvent:r},i)),this._defaultPrevented=!1,this.target=t}},z3=class extends zK{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){let i="touchend"===e?r.changedTouches:r.touches,n=zY.touchPos(t.getCanvasContainer(),i),a=n.map(e=>t.unproject(e)),o=n.reduce((e,t,r,i)=>e.add(t.div(i.length)),new vl(0,0)),s=t.unproject(o);super(e,{points:n,point:o,lngLats:a,lngLat:s,originalEvent:r}),this._defaultPrevented=!1}},z5=class extends zK{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}},z4=class extends zK{},z6=class extends zK{constructor(e={}){super("terrain",e)}},z8=class extends zK{constructor(e={}){super("projectiontransition",e)}},z7=class extends zK{},z9=class extends zK{constructor(e={}){super("styleimagemissing",e)}},Fe=class extends ML{constructor(){super(),this.images={},this.updateVersion=0,this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this._spriteImagesIds={},this._imagesIds=null,this._renderCallbacksDispatchedThisFrame={}}destroy(){for(let e of Object.keys(this.images))this.removeImage(e);this._spriteImagesIds={}}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){let t=this.images[e];if(t&&!t.data&&t.spriteData){let e=t.spriteData;t.data=new Di({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),t.spriteData=null}return t}addImage(e,t){if(this.images[e])throw Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t,this._imagesIds=null,t.isWebGLImage&&this.updateImage(e,t,!1))}_validate(e,t){let r=!0,i=t.data||t.spriteData;return this._validateStretch(t.stretchX,i?.width)||(this.fire(new MI(Error(`Image "${e}" has invalid "stretchX" value`))),r=!1),this._validateStretch(t.stretchY,i?.height)||(this.fire(new MI(Error(`Image "${e}" has invalid "stretchY" value`))),r=!1),this._validateContent(t.content,t)||(this.fire(new MI(Error(`Image "${e}" has invalid "content" value`))),r=!1),r}_validateStretch(e,t){if(!e)return!0;let r=0;for(let i of e){if(i[0]=e[1]}updateImage(e,t,r=!0){var i;let n=this.images[e];if(r){let e=n.data||n.spriteData;if(e.width!==t.data.width||e.height!==t.data.height)throw Error(`size mismatch between old image (${e.width}x${e.height}) and new image (${t.data.width}x${t.data.height}).`)}t.version=(null!=(i=n.version)?i:0)+1,this.images[e]=t,this.updateVersion++}removeImage(e){var t;let r=this.images[e];r&&(delete this.images[e],this._imagesIds=null,null!=(t=r.userImage)&&t.onRemove&&r.userImage.onRemove())}listImages(){return null!=this._imagesIds||(this._imagesIds=Object.keys(this.images)),this._imagesIds}_getSpriteImageId(e,t){return"default"===e?t:`${e}:${t}`}setSpriteImages(e,t){var r;let i=null!=(r=this._spriteImagesIds[e])?r:[],n=[];for(let r in t){let i=this._getSpriteImageId(e,r);n.push(i),i in this.images?this.updateImage(i,t[r],!1):this.addImage(i,t[r])}let a=new Set(n),o=i.filter(e=>!a.has(e));for(let e of o)this.removeImage(e);return this._spriteImagesIds[e]=n,{loaded:n,removed:o}}removeSpriteImages(e){var t;let r=null!=(t=this._spriteImagesIds[e])?t:[];for(let e of r)this.removeImage(e);return delete this._spriteImagesIds[e],r}removeAllSpriteImages(){let e=Object.values(this._spriteImagesIds).flat();for(let t of e)this.removeImage(t);return this._spriteImagesIds={},e}setMissingImageResolver(e){this.missingImageResolver=e}getImages(e){return new Promise((t,r)=>{let i=!0;if(!this.isLoaded())for(let t of e)this.images[t]||(i=!1);this.isLoaded()||i?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})})}_getImagesForIds(e){return b(this,null,function*(){var t;let r=new Set(e.filter(e=>!this.getImage(e))),i=this.missingImageResolver;i&&(yield Promise.allSettled(Array.from(r,e=>i(e))));let n={};for(let i of e){let e=this.getImage(i);e&&(r.delete(i),n[i]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:!!(null!=(t=e.userImage)&&t.render),isWebGLImage:e.isWebGLImage})}for(let e of r)this.fire(new z9({id:e})),xd(`Image "${e}" could not be loaded. Please make sure you have added the image before it is needed with map.addImage(), resolved it with map.setMissingStyleImageResolver(), or included it in a "sprite" property in your style.`);return n})}beginFrame(){this._renderCallbacksDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let t of e){if(this._renderCallbacksDispatchedThisFrame[t])continue;this._renderCallbacksDispatchedThisFrame[t]=!0;let e=this.getImage(t);e||xd(`Image with ID: "${t}" was not found`),function(e){let{userImage:t}=e;return!!t?.render&&!!t.render()&&(TL(t.data)||e.data.replace(new Uint8Array(t.data.buffer)),!0)}(e)&&this.updateImage(t,e)}}cloneImages(){let e={};for(let t in this.images){let r=this.images[t];e[t]=f(d({},r),{data:r.data?r.data.clone():null})}return e}},Ft=class{constructor(e){this._imageManager=e,this._entries={},this._image=new Di({width:1,height:1}),this._dirty=!0}destroy(){this._texture&&(this._texture=(this._texture.destroy(),null)),this._entries={},this._image=new Di({width:1,height:1}),this._dirty=!0}getPixelSize(){let{width:e,height:t}=this._image;return{width:e,height:t}}getPattern(e){let t=this._imageManager.getImage(e);if(!t)return null;let r=this._entries[e];if(r?.image!==t){let r={w:t.data.width+2,h:t.data.height+2,x:0,y:0};this._entries[e]={bin:r,position:new CO(r,t),image:t}}else{if(r.position.version===t.version)return r.position;r.position.version=t.version}return this._update(),this._entries[e].position}bind(e){let t=e.gl;this._texture?this._dirty&&(this._dirty=(this._texture.update(this._image),!1)):(this._texture=new Df(e,this._image,t.RGBA),this._dirty=!1),this._texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_update(){for(let e in this._entries)this._imageManager.getImage(e)||delete this._entries[e];let e=[];for(let t in this._entries)e.push(this._entries[t].bin);let{w:t,h:r}=TP(e),i=this._image;for(let e in i.resize({width:t||1,height:r||1}),this._entries){let{bin:t}=this._entries[e],r=t.x+1,n=t.y+1,a=this._entries[e].image.data,o=a.width,s=a.height;Di.copy(a,i,{x:0,y:0},{x:r,y:n},{width:o,height:s}),Di.copy(a,i,{x:0,y:s-1},{x:r,y:n-1},{width:o,height:1}),Di.copy(a,i,{x:0,y:0},{x:r,y:n+s},{width:o,height:1}),Di.copy(a,i,{x:o-1,y:0},{x:r-1,y:n},{width:1,height:s}),Di.copy(a,i,{x:0,y:0},{x:r+o,y:n},{width:1,height:s})}this._dirty=!0}},Fi={start:0,end:Fr=1114111},Fn=0,Fa=class{constructor(e){this.requestManager=e,this._faces={},this._registered=new Set}setFontFaces(e){for(let[t,r]of(this._unregisterAll(),this._faces={},Object.entries(e??{}))){let e=Array.isArray(r)?r:[r];this._faces[t]=e.map(e=>this._declareFontFace(t,e)).filter(e=>null!==e)}}hasFontFaces(){return Object.keys(this._faces).length>0}getFontFamily(e,t){return b(this,null,function*(){var r;for(let i of e.split(","))for(let e of null!=(r=this._faces[i.trim()])?r:[])if(function(e,t){return e.ranges.some(({start:e,end:r})=>t>=e&&t<=r)}(e,t)&&(null!=e.loaded||(e.loaded=this._loadFontFace(e)),yield e.loaded))return e.family;return null})}_declareFontFace(e,t){let r="string"==typeof t?{url:t}:t;if("string"!=typeof r?.url)return xd(`Ignoring the font face declared for "${e}": it has no URL.`),null;let i=`maplibre-gl-font-face-${Fn++}`,n=r["unicode-range"];if(!n?.length)return{url:r.url,ranges:[Fi],family:i};let a=[];for(let e of n){let t=function(e){let t=/^u\+([0-9a-f]*)(\?+)$/i.exec(e);if(t){let[,e,r]=t;return e.length+r.length>6?null:Lw(parseInt(`${e}${"0".repeat(r.length)}`,16),parseInt(`${e}${"f".repeat(r.length)}`,16))}let r=/^u\+([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?$/i.exec(e);if(!r)return null;let i=parseInt(r[1],16);return Lw(i,void 0===r[2]?i:parseInt(r[2],16))}(e);if(!t){xd(`Ignoring the unicode range "${e}" of the font face at ${r.url}: it is not a valid range.`);continue}a.push(t)}return a.length?{url:r.url,ranges:a,family:i}:null}_loadFontFace(e){return b(this,null,function*(){let t;if(typeof FontFace>"u"||typeof document>"u"||!document.fonts)return xd(`Ignoring the font face at ${e.url}: this environment has no CSS Font Loading API.`),!1;try{return t=new FontFace(e.family,(yield this._downloadFontFile(e.url))),!!Object.values(this._faces).some(t=>t.includes(e))&&(document.fonts.add(t),this._registered.add(t),yield t.load(),!0)}catch(r){return t&&this._unregister(t),xd(`Ignoring the font face at ${e.url}: ${vK(r).message}`),!1}})}_downloadFontFile(e){return b(this,null,function*(){let t=yield this.requestManager.transformRequest(e,"Glyphs"),r=yield ME(t,new AbortController);if(!r?.data)throw Error(`the response was empty for the font file at ${e}`);return r.data})}_unregister(e){var t;null==(t=document.fonts)||t.delete(e),this._registered.delete(e)}_unregisterAll(){var e;for(let t of this._registered)null==(e=document.fonts)||e.delete(t);this._registered.clear()}destroy(){this._unregisterAll(),this._faces={}}},Fo=1e20,Fs=new Float64Array(256);for(let e=0;e<256;e++){let t=.5-(e/255)**.45454545454545453;Fs[e]=t*Math.abs(t)}Fs[255]=-1e20,Fl=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:i=.25,fontFamily:n="sans-serif",fontWeight:a="normal",fontStyle:o="normal",lang:s=null}={}){this.buffer=t,this.radius=r,this.cutoff=i,this.lang=s;let l=this.size=e+4*t,u=this._createCanvas(l),c=this.ctx=u.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${e}px ${n}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){if("u">typeof OffscreenCanvas)return new OffscreenCanvas(e,e);let t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:i,actualBoundingBoxLeft:n,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(r),s=Math.floor(-n),l=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a)-s)),u=Math.max(0,Math.min(this.size-this.buffer,o+Math.ceil(i))),c=l+2*this.buffer,h=u+2*this.buffer,d=Math.max(c*h,0),f=new Uint8ClampedArray(d),p={data:f,width:c,height:h,glyphWidth:l,glyphHeight:u,glyphTop:o,glyphLeft:s,glyphAdvance:t};if(0===l||0===u)return p;let{ctx:m,buffer:g,gridInner:y,gridOuter:v}=this;this.lang&&(m.lang=this.lang),m.clearRect(g,g,l,u),m.fillText(e,g-s,g+o);let x=m.getImageData(g,g,l,u);v.fill(Fo,0,d),y.fill(0,0,d);let b=3;for(let e=0;e{let r=new Fl(e);return r.buffer=t,r},Fh=class{constructor(e,t,r,i=Fc){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={},this.lang=r,this.fontFaceManager=new Fa(e),this.createRasterizer=i}setURL(e){this.url=e}setFontFaces(e){this.fontFaceManager.setFontFaces(e),this.entries={}}getGlyphs(e){return b(this,null,function*(){let t=[];for(let r in e)for(let i of e[r])t.push(this._getAndCacheGlyphsPromise(r,i));let r=yield Promise.all(t),i={};for(let{stack:e,id:t,glyph:n}of r)i[e]||(i[e]={}),i[e][t]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics};return i})}_getAndCacheGlyphsPromise(e,t){return b(this,null,function*(){var r;null!=(r=this.entries)[e]||(r[e]={glyphs:{},requests:{},ranges:{}});let i=this.entries[e],n=i.glyphs[t];if(void 0!==n)return{stack:e,id:t,glyph:n};let a=t.codePointAt(0),o=this.fontFaceManager.hasFontFaces()?yield this.fontFaceManager.getFontFamily(e,a):null;return o?(n=i.glyphs[t]=yield this._drawGlyph(i,e,t,o),{stack:e,id:t,glyph:n}):!this.url||Ty(t)||this._charUsesLocalIdeographFontFamily(a)?(n=i.glyphs[t]=yield this._drawGlyph(i,e,t),{stack:e,id:t,glyph:n}):yield this._downloadAndCacheRangePromise(e,t)})}_downloadAndCacheRangePromise(e,t){return b(this,null,function*(){var r;let i=t.codePointAt(0),n=this.entries[e],a=Math.floor(i/256);if(n.ranges[a])return{stack:e,id:t,glyph:null};(r=n.requests)[a]||(r[a]=this._loadGlyphRange(e,a));try{let r=yield n.requests[a];for(let e in r)n.glyphs[String.fromCodePoint(+e)]=r[+e];return n.ranges[a]=!0,{stack:e,id:t,glyph:r[i]||null}}catch(o){let r=n.glyphs[t]=yield this._drawGlyph(n,e,t);return this._warnOnMissingGlyphRange(r,a,i,vK(o)),{stack:e,id:t,glyph:r}}})}_loadGlyphRange(e,t){return b(this,null,function*(){var r;let i=256*t,n=i+255,a=yield this.requestManager.transformRequest(this.url.replace("{fontstack}",e).replace("{range}",`${i}-${n}`),"Glyphs"),o=yield ME(a,new AbortController);if(!o?.data)throw Error(`Could not load glyph range. range: ${t}, ${i}-${n}`);let s={};for(let e of(r=o.data,new CF(r).readFields(TD,[])))s[e.id]=e;return s})}_warnOnMissingGlyphRange(e,t,r,i){let n=256*t,a=r.toString(16).padStart(4,"0").toUpperCase();xd(`Unable to load glyph range ${t}, ${n}-${n+255}. Rendering codepoint U+${a} locally instead. ${i}`)}_charUsesLocalIdeographFontFamily(e){return!!this.localIdeographFontFamily&&/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}_drawGlyph(e,t,r,i){return b(this,null,function*(){let n=(yield this._getTinySDF(e,t,r,i)).draw(r),a=RegExp("^\\p{gc=Cf}+$","u").test(r);return{id:r.codePointAt(0),bitmap:new Dr({width:n.width||60,height:n.height||60},n.data),metrics:{width:a?0:n.glyphWidth/2||24,height:n.glyphHeight/2||24,left:n.glyphLeft/2+.5||0,top:n.glyphTop/2-27.5||-8,advance:a?0:n.glyphAdvance/2||24,isDoubleResolution:!0}}})}_getTinySDF(e,t,r,i){var n,a;let o=Ty(r);if(i){let t=o?"clusterTinySDFs":"fontFaceTinySDFs";return null!=e[t]||(e[t]={}),(n=e[t])[i]||(n[i]=this._createTinySDF(i,!1,o?3:1)),e[t][i]}let s=t===Fu&&""!==this.localIdeographFontFamily&&this._charUsesLocalIdeographFontFamily(r.codePointAt(0)),l=s?this.localIdeographFontFamily:t;if(o)return null!=e.clusterTinySDFs||(e.clusterTinySDFs={}),(a=e.clusterTinySDFs)[l]||(a[l]=this._createTinySDF(l,!0,3)),e.clusterTinySDFs[l];let u=s?"ideographTinySDF":"tinySDF";return e[u]||(e[u]=this._createTinySDF(l)),e[u]}_createTinySDF(e,t=!0,r=1){return b(this,null,function*(){var i;let n=e?e.split(","):[];n.push("sans-serif");let a=n.map(e=>/[-\w]+/.test(e)?e:`'${CSS.escape(e)}'`).join(","),o=t?this._fontWeight(n[0]):void 0,s=t?this._fontStyle(n[0]):"normal";if("u">typeof document&&null!=(i=document.fonts)&&i.load)try{yield document.fonts.load(`${s} ${o||"normal"} 48px ${a}`)}catch(e){xd(`Failed to load font "${a}": ${vK(e).message}`)}return this.createRasterizer({fontSize:48,buffer:Math.max(6,Math.ceil(48*(r-1)/4)),radius:16,cutoff:.25,fontFamily:a,fontWeight:o,fontStyle:s,lang:this.lang},6)})}_fontStyle(e){return/italic/i.test(e)?"italic":/oblique/i.test(e)?"oblique":"normal"}_fontWeight(e){let t;for(let[r,i]of Object.entries({thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950}))RegExp(`\\b${r}\\b`,"i").test(e)&&(t=`${i}`);return t}destroy(){for(let e in this.entries){let t=this.entries[e];t.tinySDF=null,t.ideographTinySDF=null,t.fontFaceTinySDFs={},t.glyphs={},t.requests={},t.ranges={}}this.entries={},this.fontFaceManager.destroy()}},Ff=class extends ML{constructor(e,t){super(),this._transitionable=new Sf(Fd||(Fd=new SA({anchor:new Sx(Mz.light.anchor,"anchor"),position:new Sx(Mz.light.position,"position"),color:new Sx(Mz.light.color,"color"),intensity:new Sx(Mz.light.intensity,"intensity")})),"light",t),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}getCartesianPosition(){return function([e,t,r]){return t+=90,[e*Math.cos(t*=Math.PI/180)*Math.sin(r*=Math.PI/180),e*Math.sin(t)*Math.sin(r),e*Math.cos(r)]}(this.properties.get("position"))}setLight(e,t={}){if(!this._validate(Sn.light,e,t))for(let t in e){let r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-Sc.length),r):this._transitionable.setValue(t,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,t,r){return _3(this,e,{value:t},r)}},Fm=class extends ML{constructor(e,t){super(),this._transitionable=new Sf(Fp||(Fp=new SA({"sky-color":new Sx(Mz.sky["sky-color"],"sky-color"),"horizon-color":new Sx(Mz.sky["horizon-color"],"horizon-color"),"fog-color":new Sx(Mz.sky["fog-color"],"fog-color"),"fog-ground-blend":new Sx(Mz.sky["fog-ground-blend"],"fog-ground-blend"),"horizon-fog-blend":new Sx(Mz.sky["horizon-fog-blend"],"horizon-fog-blend"),"sky-horizon-blend":new Sx(Mz.sky["sky-horizon-blend"],"sky-horizon-blend"),"atmosphere-blend":new Sx(Mz.sky["atmosphere-blend"],"atmosphere-blend")})),"sky",t),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Su(0))}setSky(e,t={}){if(!this._validate(Sn.sky,e,t))for(let t in e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0}),e){let r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-Sc.length),r):this._transitionable.setValue(t,r)}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,t,r={}){return _3(this,e,{value:t},r)}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}},Fg=class{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){var r;let i=e.join(",")+String(t);return(r=this.dashEntry)[i]||(r[i]=this.addDash(e,t)),this.dashEntry[i]}getDashRanges(e,t,r){let i=e.length%2==1,n=[],a=i?-e[e.length-1]*r:0,o=e[0]*r,s=!0;n.push({left:a,right:o,isDash:s,zeroLength:0===e[0]});let l=e[0];for(let t=1;t1&&(s=e[++o]);let l=Math.min(Math.abs(n-s.left),Math.abs(n-s.right)),u,c=t/r*(i+1);if(s.isDash){let e=i-Math.abs(c);u=Math.sqrt(l*l+e*e)}else u=i-Math.sqrt(l*l+c*c);this.data[a+n]=Math.max(0,Math.min(255,u+128))}}}addRegularDash(e){for(let t=e.length-1;t>=0;--t){let r=e[t],i=e[t+1];r.zeroLength?e.splice(t,1):i?.isDash===r.isDash&&(i.left=r.left,e.splice(t,1))}let t=e[0],r=e[e.length-1];t.isDash===r.isDash&&(t.left=r.left-this.width,r.right=t.right+this.width);let i=this.width*this.nextRow,n=0,a=e[0];for(let t=0;t1&&(a=e[++n]);let r=Math.min(Math.abs(t-a.left),Math.abs(t-a.right)),o=a.isDash?r:-r;this.data[i+t]=Math.max(0,Math.min(255,o+128))}}addDash(e,t){let r=7*!!t,i=2*r+1;if(this.nextRow+i>this.height)return xd("LineAtlas out of space"),null;let n=0;for(let t of e)n+=t;if(0!==n){let i=this.width/n,a=this.getDashRanges(e,this.width,i);t?this.addRoundDash(a,i,r):this.addRegularDash(a)}let a={y:this.nextRow+r,height:2*r,width:n};return this.nextRow+=i,this.dirty=!0,a}bind(e){let t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}},Fy="maplibre_preloaded_worker_pool",Fv=class e{constructor(){this.active={},this.workersPromise=null}acquire(t){return b(this,null,function*(){if(this.active[t]=!0,!this.workersPromise){let t=[];for(;t.length{for(let t of e)t.terminate()})}}isPreloaded(){return!!this.active[Fy]}numActive(){return Object.keys(this.active).length}},Fx=Math.floor(zG.hardwareConcurrency/2),Fv.workerCount=!function(e){if(null==Mg){let t=e.navigator?e.navigator.userAgent:null;Mg=!!e.safari||!!(t&&(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Mg}(globalThis)?1:Math.max(Math.min(Fx,3),1),F_=class{constructor(e,t){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=t,this.removed=!1,this.actorsPromise=this.initActors(t)}initActors(e){return b(this,null,function*(){let t=yield this.workerPool.acquire(e);if(this.removed)return[];if(this.actors=t.map((t,r)=>{let i=new It(t,e);return i.name=`Worker ${r}`,i}),!this.actors.length)throw Error("No actors found");return this.actors})}broadcast(e,t){return b(this,null,function*(){return Promise.all((yield this.actorsPromise).map(r=>r.sendAsync({type:e,data:t})))})}getActor(){return b(this,null,function*(){let e=yield this.actorsPromise;return this.currentActor=(this.currentActor+1)%e.length,e[this.currentActor]})}waitForInitComplete(){return b(this,null,function*(){0===this.actors.length&&(yield this.actorsPromise)})}getReadyActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){for(let e of(this.removed=!0,this.actors))e.remove();this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,t){return b(this,null,function*(){for(let r of yield this.actorsPromise)r.registerMessageHandler(e,t)})}unregisterMessageHandler(e){return b(this,null,function*(){for(let t of yield this.actorsPromise)t.unregisterMessageHandler(e)})}},FT=class e{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof DJ?new DJ(e.lng,e.lat):DJ.convert(e),this}setSouthWest(e){return this._sw=e instanceof DJ?new DJ(e.lng,e.lat):DJ.convert(e),this}extend(t){let r=this._sw,i=this._ne,n,a;if(t instanceof DJ)n=t,a=t;else if(t instanceof e){if(n=t._sw,a=t._ne,!n||!a)return this}else return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(e.convert(t)):this.extend(DJ.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(DJ.convert(t)):this;return r||i?(r.lng=Math.min(n.lng,r.lng),r.lat=Math.min(n.lat,r.lat),i.lng=Math.max(a.lng,i.lng),i.lat=Math.max(a.lat,i.lat)):(this._sw=new DJ(n.lng,n.lat),this._ne=new DJ(a.lng,a.lat)),this}getCenter(){return new DJ((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 DJ(this.getWest(),this.getNorth())}getSouthEast(){return new DJ(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){let{lng:t,lat:r}=DJ.convert(e),i=this._sw.lat<=r&&r<=this._ne.lat,n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),i&&n}intersects(t){if(!((t=e.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;let r=Math.abs(this.getEast()-this.getWest()),i=Math.abs(t.getEast()-t.getWest());if(r>=360||i>=360)return!0;let n=xr(this.getWest(),-180,180),a=xr(this.getEast(),-180,180),o=xr(t.getWest(),-180,180),s=xr(t.getEast(),-180,180),l=n>a,u=o>s;return!!l&&!!u||(l?s>=n||o<=a:u?a>=o||n<=s:o<=a&&s>=n)}static convert(t){return t instanceof e||!t?t:new e(t)}static fromLngLat(t,r=0){let i=360*r/0x2637f09,n=i/Math.cos(Math.PI/180*t.lat);return new e(new DJ(t.lng-n,t.lat-i),new DJ(t.lng+n,t.lat+i))}adjustAntiMeridian(){let t=new DJ(this._sw.lng,this._sw.lat),r=new DJ(this._ne.lng,this._ne.lat);return t.lng>r.lng?new e(t,new DJ(r.lng+360,r.lat)):new e(t,r)}},FA=class{constructor(e,t,r){this.bounds=FT.convert(this.validateBounds(e)),this.minzoom=t||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(e){let t=2**e.z,r={minX:Math.floor(w9(this.bounds.getWest())*t),minY:Math.floor(Te(this.bounds.getNorth())*t),maxX:Math.ceil(w9(this.bounds.getEast())*t),maxY:Math.ceil(Te(this.bounds.getSouth())*t)};return e.x>=r.minX&&e.x=r.minY&&e.y{this.tiles=e,this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}serialize(){return xi({},this._options)}loadTile(e){return b(this,null,function*(){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:yield this.map._requestManager.transformRequest(t,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(e),etag:e.etag};r.request.collectResourceTiming=this._collectResourceTiming,yield this.dispatcher.waitForInitComplete();let i="RT";if(e.actor&&"expired"!==e.state){if("loading"===e.state)return new Promise((t,r)=>{e.reloadPromise={resolve:t,reject:r}})}else e.actor=this.dispatcher.getReadyActor(),i="LT";e.abortController=new AbortController;try{let t=yield e.actor.sendAsync({type:i,data:r},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t);let n={};return t?.etagUnmodified&&(n.unmodified=!0),n}catch(t){if(delete e.abortController,e.aborted||xw(t))return;if(t&&404!==t.status)throw t;this._afterTileLoadWorkerResponse(e,null)}})}_getOverzoomParameters(e){return b(this,null,function*(){if(e.tileID.canonical.z<=this.maxzoom||void 0===this.map._zoomLevelsToOverscale)return;let t=e.tileID.scaledTo(this.maxzoom).canonical,r=t.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:t,overzoomRequest:yield this.map._requestManager.transformRequest(r,"Tile")}})}_afterTileLoadWorkerResponse(e,t){if(t?.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.etag=t?.etag,e.loadVectorData(t,this.map.painter),e.reloadPromise){let t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return b(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return b(this,null,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}},Fk=class extends ML{constructor(e,t,r,i){super(),this.id=e,this.dispatcher=r,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._premultiplyAlpha=!0,this._options=xi({type:"raster"},t),xi(this,xn(t,["url","scheme","tileSize"]))}load(e=!1){return b(this,null,function*(){this._loaded=!1,this.fire(new z1("dataloading")),this._tileJSONRequest=new AbortController;try{let t=yield LL(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,t&&(xi(this,t),t.bounds&&(this.tileBounds=new FA(t.bounds,this.minzoom,this.maxzoom)),this.fire(new z1("data",{sourceDataType:"metadata"})),this.fire(new z1("data",{sourceDataType:"content",sourceDataChanged:e})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,xw(e)||this.fire(new MI(vK(e)))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null)),e(),this.load(!0)}setTiles(e){return this.setSourceProperty(()=>{this.tiles=e,this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return xi({},this._options)}setPremultiplyAlpha(e){return this._premultiplyAlpha===e||this.setSourceProperty(()=>{this._premultiplyAlpha=e}),this}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return b(this,null,function*(){var t;let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i=this._premultiplyAlpha,n=i?void 0:{premultiplyAlpha:"none"};e.abortController=new AbortController;try{let a=yield zZ.transformAndGetImage(this.map._requestManager,r,"Tile",e.abortController,this.map._refreshExpiredTiles,n);if(delete e.abortController,e.aborted){e.state="unloaded";return}if(a){this.map._refreshExpiredTiles&&(a.cacheControl||a.expires)&&e.setExpiryData({cacheControl:a.cacheControl,expires:a.expires});let r=this.map.painter.context,n=r.gl,o=null!=(t=a.data)?t:new Di({width:1,height:1},new Uint8Array(4));e.texture=this.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0,premultiply:i}):(e.texture=new Df(r,o,n.RGBA,{useMipmap:!0,premultiply:i}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}})}abortTile(e){return b(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return b(this,null,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}},FS=class extends Fk{constructor(e,t,r,i){super(e,t,r,i),this.type="raster-dem",this.maxzoom=22,this._options=xi({type:"raster-dem"},t),this.encoding=t.encoding||"mapbox",this.redFactor=t.redFactor,this.greenFactor=t.greenFactor,this.blueFactor=t.blueFactor,this.baseShift=t.baseShift}loadTile(e){return b(this,null,function*(){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let r=yield zZ.transformAndGetImage(this.map._requestManager,t,"Tile",e.abortController,this.map._refreshExpiredTiles,{colorSpaceConversion:"none"});if(delete e.abortController,e.aborted){e.state="unloaded";return}if(r){if(this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires}),!r.data){e.state="loaded";return}let t=r.data,i=xm(t)&&vu()?t:yield this.readImageNow(t),n={type:this.type,uid:e.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(e.actor&&"expired"!==e.state&&"reloading"!==e.state)return;yield this.dispatcher.waitForInitComplete(),e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getReadyActor()),e.dem=yield e.actor.sendAsync({type:"LDT",data:n}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.needsColorReliefPrepare=!0,e.state="loaded"}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}})}readImageNow(e){return b(this,null,function*(){if("u">typeof VideoFrame&&vc()){let t=e.width+4,r=e.height+4;try{return new Di({width:t,height:r},(yield function(e,t,r){return b(this,null,function*(){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let i=new VideoFrame(e,{timestamp:0});try{let n,a=i?.format;if(!a||!(a.startsWith("BGR")||a.startsWith("RGB")))throw Error(`Unrecognized format ${a}`);let o=a.startsWith("BGR"),s=new Uint8ClampedArray(t*r*4);if(yield i.copyTo(s,(n=2*t*4+8,{rect:{x:0,y:0,width:Math.min(e.width,-2+t)-0,height:Math.min(e.height,-2+r)-0},layout:[{offset:n,stride:4*t}]})),o)for(let e=0;e0&&(s[new In(e.overscaledZ,n,t.z,i,t.y-1).key]={backfilled:!1},s[new In(e.overscaledZ,e.wrap,t.z,t.x,t.y-1).key]={backfilled:!1},s[new In(e.overscaledZ,o,t.z,a,t.y-1).key]={backfilled:!1}),t.y+1!r.has(e.key))}return(e.removeAllProperties||t.removeAllProperties)&&(r.removeAllProperties=!0),(e.removeProperties||t.removeProperties)&&(r.removeProperties=[...e.removeProperties||[],...t.removeProperties||[]]),(e.addOrUpdateProperties||t.addOrUpdateProperties)&&(r.addOrUpdateProperties=[...e.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(e.newGeometry||t.newGeometry)&&(r.newGeometry=t.newGeometry||e.newGeometry),r}(r,t)),o.update.delete(e))}let l={};if((i.removeAll||n.removeAll)&&(l.removeAll=!0),l.remove=new Set([...i.remove,...n.remove]),l.add=new Map([...i.add,...n.add]),l.update=new Map([...i.update,...n.update]),l.remove.size&&l.add.size)for(let e of l.add.keys())l.remove.delete(e);return r={},(a=l).removeAll&&(r.removeAll=a.removeAll),a.remove&&(r.remove=Array.from(a.remove)),a.add&&(r.add=Array.from(a.add.values())),a.update&&(r.update=Array.from(a.update.values())),r}(this._pendingWorkerUpdate.diff,e),this._updateWorkerData()}getData(){return b(this,null,function*(){return this._data.url&&(yield this.once("data")),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}})}getBounds(){return b(this,null,function*(){return LO((yield this.getData()))})}setClusterOptions(e){return this.workerOptions.geojsonVtOptions.cluster=e.cluster,void 0!==e.clusterRadius&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),void 0!==e.clusterMaxZoom&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData()}getClusterOptions(){let{cluster:e,clusterOptions:t}=this.workerOptions.geojsonVtOptions;return{cluster:e,clusterMaxZoom:t.maxZoom,clusterRadius:this._tileUnitsToPixels(t.radius)}}getClusterExpansionZoom(e){return b(this,null,function*(){return(yield this.actorPromise).sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})})}getClusterChildren(e){return b(this,null,function*(){return(yield this.actorPromise).sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})})}getClusterLeaves(e,t,r){return b(this,null,function*(){return(yield this.actorPromise).sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:r}})})}_updateWorkerData(){return b(this,null,function*(){if(this._isUpdatingWorker)return this._updatePromise;if(!this._hasPendingWorkerUpdate())return void xd(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:e,diff:t,updateCluster:r}=this._pendingWorkerUpdate,i=this._getLoadGeoJSONParameters(e,t,r);void 0===e?t?this._pendingWorkerUpdate.diff=void 0:r&&(this._pendingWorkerUpdate.updateCluster=void 0):this._pendingWorkerUpdate.data=void 0,this._updatePromise=this._dispatchWorkerUpdate(i),yield this._updatePromise})}_getLoadGeoJSONParameters(e,t,r){return b(this,null,function*(){let i=xi({type:this.type,source:this.id},this.workerOptions);return"string"==typeof e?(i.request=yield this.map._requestManager.transformRequest(zG.resolveURL(e),"Source"),i.request.collectResourceTiming=this._collectResourceTiming,i):void 0!==e?(i.data=e,i):t?(i.dataDiff=t,i):r?(i.updateCluster=!0,i):void 0})}_dispatchWorkerUpdate(e){return b(this,null,function*(){this._isUpdatingWorker=!0,this.fire(new z1("dataloading"));try{let t=yield e,r=yield(yield this.actorPromise).sendAsync({type:"LD",data:t});if(this._isUpdatingWorker=!1,this._removed||r.abandoned)return void this.fire(new z1("dataabort"));r.data&&(this._data={geojson:r.data});let i=this._applyDiffToSource(t.dataDiff),n=this._getShouldReloadTileOptions(i),a={};this._applyResourceTiming(a,r),this.fire(new z1("data",f(d({},a),{sourceDataType:"metadata"}))),this.fire(new z1("data",f(d({},a),{sourceDataType:"content",shouldReloadTileOptions:n})))}catch(e){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new z1("dataabort"));this.fire(new MI(vK(e)))}finally{this._hasPendingWorkerUpdate()&&(yield this._updateWorkerData())}})}_applyResourceTiming(e,t){var r;if(!this._collectResourceTiming)return;let i=null==(r=t.resourceTiming)?void 0:r[this.id];if(!i)return;let n=i.slice(0);n?.length&&xi(e,{resourceTiming:n})}_applyDiffToSource(e){if(!e)return;let t="string"==typeof this.promoteId?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let e=function(e,t){let r=new Map;if(null==e||null==e.type)return r;if("Feature"===e.type){let i=LP(e,t);return null==i?void 0:(r.set(i,e),r)}if("FeatureCollection"===e.type){let i=new Set;for(let n of e.features){let e=LP(n,t);if(null==e||i.has(e))return;i.add(e),r.set(e,n)}return r}}(this._data.geojson,t);if(!e)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:e}}if(!this._data.updateable)return;let r=function(e,t,r){var i,n;let a=[];if(t.removeAll)e.clear();else if(t.remove)for(let r of t.remove){let t=e.get(r);t&&(a.push(t.geometry),e.delete(r))}if(t.add)for(let i of t.add){let t=LP(i,r);if(null==t)continue;let n=e.get(t);n&&a.push(n.geometry),a.push(i.geometry),e.set(t,i)}if(t.update)for(let r of t.update){let t=e.get(r.id);if(!t)continue;let o=!!r.newGeometry,s=r.removeAllProperties||(null==(i=r.removeProperties)?void 0:i.length)>0||(null==(n=r.addOrUpdateProperties)?void 0:n.length)>0;if(!o&&!s)continue;a.push(t.geometry);let l=d({},t);if(e.set(r.id,l),o&&(a.push(r.newGeometry),l.geometry=r.newGeometry),s){if(l.properties=r.removeAllProperties?{}:d({},l.properties||{}),r.removeProperties)for(let e of r.removeProperties)delete l.properties[e];if(r.addOrUpdateProperties)for(let{key:e,value:t}of r.addOrUpdateProperties)l.properties[e]=t}}return a}(this._data.updateable,e,t);if(!(e.removeAll||this._options.cluster))return r}_getShouldReloadTileOptions(e){if(e)return{affectedBounds:e.filter(Boolean).map(e=>LO(e))}}shouldReloadTile(e,{affectedBounds:t}){if("loading"===e.state)return!0;if("unloaded"===e.state)return!1;let{buffer:r,extent:i}=this.workerOptions.geojsonVtOptions,n=function({x:e,y:t,z:r},i=0){let n=Tt((e-i)/2**r),a=Tr((t+1+i)/2**r),o=Tt((e+1+i)/2**r),s=Tr((t-i)/2**r);return new FT([n,a],[o,s])}(e.tileID.canonical,r/i);for(let e of t)if(n.intersects(e))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(e){return b(this,null,function*(){let t=e.actor?"RT":"LT";e.actor=yield this.actorPromise;let r={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;try{let i=yield(yield this.actorPromise).sendAsync({type:t,data:r},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(i,this.map.painter,"RT"===t)}catch(t){if(delete e.abortController,e.aborted||xw(t))return;throw t}})}abortTile(e){return b(this,null,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return b(this,null,function*(){e.unloadVectorData(),yield(yield this.actorPromise).sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actorPromise.then(e=>e.sendAsync({type:"RS",data:{type:this.type,source:this.id}}))}serialize(){return xi({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}},FD=[0,0,1],FC=(e,t)=>({u_tl_parent:new EB(e,t.u_tl_parent),u_scale_parent:new ER(e,t.u_scale_parent),u_buffer_scale:new ER(e,t.u_buffer_scale),u_image_warp:new Ej(e,t.u_image_warp),u_fade_t:new ER(e,t.u_fade_t),u_opacity:new ER(e,t.u_opacity),u_image0:new EO(e,t.u_image0),u_image1:new EO(e,t.u_image1),u_brightness_low:new ER(e,t.u_brightness_low),u_brightness_high:new ER(e,t.u_brightness_high),u_saturation_factor:new ER(e,t.u_saturation_factor),u_contrast_factor:new ER(e,t.u_contrast_factor),u_spin_weights:new Ej(e,t.u_spin_weights),u_coords_top:new EN(e,t.u_coords_top),u_coords_bottom:new EN(e,t.u_coords_bottom)}),FI=(e,t,r,i,n,a)=>{var o,s,l;let u,c;return{u_tl_parent:e,u_scale_parent:t,u_buffer_scale:1,u_image_warp:a,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"))>0?1-1/(1.001-o):-o,u_contrast_factor:(s=i.paint.get("raster-contrast"))>0?1/(1-s):1+s,u_spin_weights:(u=Math.sin(l=i.paint.get("raster-hue-rotate")*(Math.PI/180)),[(2*(c=Math.cos(l))+1)/3,(-Math.sqrt(3)*u-c+1)/3,(Math.sqrt(3)*u-c+1)/3]),u_coords_top:[n[0].x,n[0].y,n[1].x,n[1].y],u_coords_bottom:[n[3].x,n[3].y,n[2].x,n[2].y]}},FL=class{constructor(e,t,r){this.vertexBuffer=e,this.indexBuffer=t,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}},FP=wr([{name:"a_pos",type:"Int16",components:2}]),Fz=Md/128,FF=class extends ML{constructor(e,t,r,i){super(),this.imageWarp=FD,this.flippedWindingOrder=!1,this._warp="auto",this._imageDirty=!1,this._subdividedQuad=!1,this._subdividedMesh=null,this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=t}load(e){return b(this,null,function*(){if(void 0===this.options.url){this._loaded=!0,this._finishLoading();return}this._loaded=!1,this.fire(new z1("dataloading")),this.url=this.options.url,this._abortController=new AbortController;try{let t=yield zZ.transformAndGetImage(this.map._requestManager,this.url,"Image",this._abortController);this._abortController=null,this._loaded=!0,t?.data?(this._setImage(t.data),e&&(this.coordinates=e),this._finishLoading()):this.fire(new MI(Error(`Could not load image ${this.url}: the response is empty`)))}catch(e){if(xw(e))return;this._abortController=null,this._loaded=!0,this.fire(new MI(vK(e)))}})}loaded(){return this._loaded}updateImage(e){return this._abortController&&(this._abortController=(this._abortController.abort(),null)),"image"in e?(this._loaded=!0,this._setImage(e.image),e.coordinates&&(this.coordinates=e.coordinates),this._finishLoading()):e.url&&(this.options.url=e.url,this.load(e.coordinates)),this}_setImage(e){this.image=e,this._imageDirty=!0}getMesh(e,t){return!this._subdividedQuad||t?null:(null!=this._subdividedMesh||(this._subdividedMesh=LR(e,{granularity:16})),this._subdividedMesh)}_disposeTexture(){var e;null==(e=this.texture)||e.destroy(),this.texture=null}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new z1("data",{sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){var e;this._abortController&&(this._abortController=(this._abortController.abort(),null)),this._disposeTexture(),null==(e=this._subdividedMesh)||e.destroy(),this._subdividedMesh=null,this.image=null,this.tiles={}}setWarp(e){return this._warp===e||(this._warp=e,this.tileCoords&&this.setCoordinates(this.coordinates)),this}getWarp(){return this._warp}setCoordinates(e){var t;let r,i,n,a,o,s;this.coordinates=e;let l=e.map(D0.fromLngLat);return this.tileID=(i=Math.max(0,Math.floor(-Math.log(Math.max((r=D$.fromPoints(l)).width(),r.height()))/Math.LN2)),n=2**i,new Ir(i,Math.floor((r.minX+r.maxX)/2*n),Math.floor((r.minY+r.maxY)/2*n))),this.terrainTileRanges=this._getOverlappingTileRanges(l),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=l.map(e=>this.tileID.getTilePoint(e)._round()),this.imageWarp=function(e,t){if("flat"===t||Lj(e))return FD;let[r,i,n,a]=e,o=r.x-i.x+n.x-a.x,s=r.y-i.y+n.y-a.y,l=[i.x-n.x,i.y-n.y,a.x-n.x,a.y-n.y],[u,c,h,d]=l,f=l[0]*l[3]-l[2]*l[1],p=(o*d-h*s)/f,m=(u*s-o*c)/f,g=[1,1+p,1+p+m,1+m],y=Math.max(...g)/Math.min(...g),v="perspective"===t?0:Math.max(0,(1-4/y)/.9921875);return!(y>=1&&y<=512)||v>=1?FD:[p,m,v]}(this.tileCoords,this._warp),this._subdividedQuad=this.imageWarp[2]>0&&!Lj(this.tileCoords),this.flippedWindingOrder=(a=(t=this.tileCoords)[1].x-t[0].x,o=t[1].y-t[0].y,s=t[2].x-t[0].x,a*(t[2].y-t[0].y)-o*s<0),this.fire(new z1("data",{sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;let e=this.map.painter.context,t=e.gl;this.texture?this._imageDirty&&(this.texture.update(this.image),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)):(this.texture=new Df(e,this.image,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)),this._imageDirty=!1;let r=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,r=!0)}r&&this.fire(new z1("data",{sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return b(this,null,function*(){var t;null!=(t=this.tileID)&&t.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){let e={type:"image",coordinates:this.coordinates};return void 0!==this.options.url&&(e.url=this.options.url),e}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:t,minY:r,maxX:i,maxY:n}=D$.fromPoints(e),a={};for(let e=0;e<=25;e++){let o=2**e,s=Math.floor(t*o),l=Math.floor(r*o),u=Math.floor(i*o),c=Math.floor(n*o),h=(s%o+o)%o,d=u%o,f=Math.floor(s/o),p=Math.floor(u/o);a[e]={minWrap:f,maxWrap:p,minTileXWrapped:h,maxTileXWrapped:d,minTileY:l,maxTileY:c}}return a}},FO=class extends FF{constructor(e,t,r,i){super(e,t,r,i),this._onPlayingHandler=()=>{var e;null==(e=this.map)||e.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=t}load(){return b(this,null,function*(){this._loaded=!1;let e=this.options;for(let t of(this.urls=[],e.urls))this.urls.push((yield this.map._requestManager.transformRequest(t,"Source")).url);try{let e=yield MD(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(e){this.fire(new MI(vK(e)))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let t=this.video.seekable;et.end(0)?this.fire(new MI(new MO(`sources.${this.id}`,null,`Playback for this video can be set only between the ${t.start(0)} and ${t.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let e=this.map.painter.context,t=e.gl;this.texture?this.video.paused||(this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this.texture=new Df(e,this.video,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));let r=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,r=!0)}r&&this.fire(new z1("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},FR=class extends FF{constructor(e,t,r,i){super(e,t,r,i),t.coordinates?(!Array.isArray(t.coordinates)||4!==t.coordinates.length||t.coordinates.some(e=>!Array.isArray(e)||2!==e.length||e.some(e=>"number"!=typeof e)))&&this.fire(new MI(new MO(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new MI(new MO(`sources.${e}`,null,'missing required property "coordinates"'))),t.animate&&"boolean"!=typeof t.animate&&this.fire(new MI(new MO(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),t.canvas?"string"==typeof t.canvas||t.canvas instanceof HTMLCanvasElement||this.fire(new MI(new MO(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new MI(new MO(`sources.${e}`,null,'missing required property "canvas"'))),this.options=t,this.animate=void 0===t.animate||t.animate}load(){return b(this,null,function*(){(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions())?this.fire(new MI(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._playing=(this.prepare(),!1))},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this._playing=!1,super.onRemove()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;let t=this.map.painter.context,r=t.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new Df(t,this.canvas,r.RGBA,{premultiply:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let i=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,i=!0)}i&&this.fire(new z1("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},FB={},Fj=e=>{switch(e){case"geojson":return FE;case"image":return FF;case"raster":return Fk;case"raster-dem":return FS;case"vector":return FM;case"video":return FO;case"canvas":return FR}return FB[e]},FN=(e,t)=>b(null,null,function*(){var r,i;if(Fj(e))throw Error(`A source type called "${e}" already exists.`);r=e,i=t,FB[r]=i}),FV="RTLPluginLoaded",FU=class extends ML{constructor(...e){super(...e),this.status="unavailable",this.url=null,this.dispatcher=LD()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(e=>{throw this.status="error",e})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e,t=!1){return b(this,null,function*(){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=zG.resolveURL(e),!this.url)throw Error(`requested url ${e} is invalid`);if("unavailable"===this.status)if(!t)return this._requestImport();else this.status="deferred",this._syncState(this.status);else if("requested"===this.status)return this._requestImport()})}_requestImport(){return b(this,null,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new MC(FV))})}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}},Fq=null,FG=class{constructor(e,t){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=Mp++,this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rttObjects=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading",this.featureStateRevision=-1}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:t,fadingParentID:r,fadeEndTime:i}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=t,this.fadingParentID=r,this.fadeEndTime=i}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Ll(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}getRTT(e){return this.rttObjects[e]}acquireRTT(e,t,r){return this.rttObjects[t]=e.acquireRTT(r)}releaseRTT(e){if(0!==this.rttObjects.length){for(let t of this.rttObjects)t&&e.releaseRTT(t);this.rttObjects.length=0}}loadVectorData(e,t,r){if(e?.etagUnmodified===!0){this.state="loaded";return}if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e){this.collisionBoxArray=new S4;return}for(let i in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestEncoding=e.encoding,this.latestFeatureIndex.rawTileData=e.rawTileData,this.latestFeatureIndex.encoding=e.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){let r={};if(!t)return r;for(let i of e){let e=i.layerIds.map(e=>t.getLayer(e)).filter(Boolean);if(0!==e.length)for(let t of(i.layers=e,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map(t=>e.filter(e=>e.id===t)[0])),e))r[t.id]=i}return r}(e.buckets,t?.style),this.hasSymbolBuckets=!1,this.buckets){let e=this.buckets[i];if(e instanceof CX)if(this.hasSymbolBuckets=!0,r)e.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let e in this.buckets){let t=this.buckets[e];if(t instanceof CX&&t.hasRTLText){this.hasRTLText=!0,LN().lazyLoad();break}}for(let e in this.queryPadding=0,this.buckets){let r=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(e).queryRadius(r))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let t in this.buckets){let r=this.buckets[t];r.uploadPending()&&r.upload(e)}let t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Df(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasImage=(this.glyphAtlasTexture=new Df(e,this.glyphAtlasImage,t.ALPHA),null))}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,i,n,a,o,s,l,u,c){var h;return null!=(h=this.latestFeatureIndex)&&h.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:a,tileSize:this.tileSize,pixelPosMatrix:u,transform:s,params:o,queryPadding:this.queryPadding*l,getElevation:c},e,t,r):{}}querySourceFeatures(e,t){let r=this.latestFeatureIndex;if(!r?.rawTileData)return;let i=r.loadVTLayers(),n=t?.sourceLayer?t.sourceLayer:"",a=i._geojsonTileLayer||i[n];if(!a)return;let o=_u(t?.filter,`querySourceFeatures[${n}].filter`,t?.globalState),{z:s,x:l,y:u}=this.tileID.canonical,c={z:s,x:l,y:u};for(let t=0;t@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(e,r,i,n)=>{let a=i||n;return t[r]=!a||a.toLowerCase(),""}),t["max-age"]){let e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}(e.cacheControl);t["max-age"]&&(this.expirationTime=Date.now()+1e3*t["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let e=Date.now(),r=!1;if(this.expirationTime>e)r=!1;else if(t)if(this.expirationTimethis.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]0?(t+=e[i]*this.min[i],r+=e[i]*this.max[i]):(r+=e[i]*this.min[i],t+=e[i]*this.max[i]);return t>=0?2:r<0?0:1}},FW=class e{constructor(e,t,r){this.points=e,this.planes=t,this.aabb=r}static fromInvProjectionMatrix(t,r=1,i=0,n,a){let o=a?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],s=2**i,l=[[-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(e=>{let i,n;return n=1/(i=vV([],e,t))[3]/r*s,Mu(i,i,[n,n,1/i[3],n])});n&&function(e,t,r,i){var n,a;let o,s,l,u=4*!!i,c=4*!i,h=0,d=[],f=[];for(let t=0;t<4;t++){let r=Ms([],e[t+c],e[t+u]),i=vk(r);vC(r,r,1/i),d.push(i),f.push(r)}for(let t=0;t<4;t++){let i=function(e,t,r){let i=e[0]*r[0]+e[1]*r[1]+e[2]*r[2],n=t[0]*r[0]+t[1]*r[1]+t[2]*r[2];return 0===n?null:(-i-r[3])/n}(e[t+u],f[t],r);h=null!==i&&i>=0?Math.max(h,i):Math.max(h,d[t])}let p=(o=Ms([],(n=e)[(a=t)[0]],n[a[1]]),s=Ms([],n[a[2]],n[a[1]]),vL(l=[0,0,0,0],vz([],o,s)),l[3]=-vP(l,n[a[0]]),l),m=function(e,t){var r,i;let n=Ml(e),a=(r=[],i=1/n,r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r[3]=e[3]*i,r),o=Ms([],t,vC([],a,vP(t,a))),s=Ml(o);if(s>0){let e=Math.sqrt(1-a[3]*a[3]);return v5(t,vE([],vC([],a,-a[3]),vC([],o,e/s)))}return null}(r,p);null!==m&&(h=Math.min(h,m/vP(f[0],p)));for(let t=0;t<4;t++){let r=Math.min(h,d[t]);e[t+c]=[e[t+u][0]+f[t][0]*r,e[t+u][1]+f[t][1]*r,e[t+u][2]+f[t][2]*r,1]}}(l,o[0],n,a);let u=o.map(e=>{let t=vL([],vz([],Ms([],l[e[0]],l[e[1]]),Ms([],l[e[2]],l[e[1]]))),r=-vP(t,l[e[1]]);return t.concat(r)}),c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0];for(let e of l)for(let t=0;t<3;t++)c[t]=Math.min(c[t],e[t]),h[t]=Math.max(h[t],e[t]);return new e(l,u,new F$(c,h))}},FY=Lq(9.314,3),FZ=class{constructor(){this._tiles={}}handleWrapJump(e){let t={};for(let r in this._tiles){let i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),t[i.tileID.key]=i}this._tiles=t}setFeatureState(e,t,r){for(let i in this._tiles)this._tiles[i].setFeatureState(e,t,r)}getAllTiles(){return Object.values(this._tiles)}getAllIds(e=!1){return e?Object.values(this._tiles).map(e=>e.tileID).sort(Ai).map(e=>e.key):Object.keys(this._tiles)}getTileById(e){return this._tiles[e]}setTile(e,t){this._tiles[e]=t}deleteTileById(e){delete this._tiles[e]}getLoadedTile(e){let t=this.getTileById(e.key);return t?.hasData()?t:null}isIdRenderable(e,t=!1){var r;return null==(r=this.getTileById(e))?void 0:r.isRenderable(t)}getRenderableIds(e=0,t){let r=[];for(let e of this.getAllIds())this.isIdRenderable(e,t)&&r.push(this.getTileById(e));return t?r.sort((t,r)=>{let i=t.tileID,n=r.tileID,a=new vl(i.canonical.x,i.canonical.y)._rotate(-e),o=new vl(n.canonical.x,n.canonical.y)._rotate(-e);return i.overscaledZ-n.overscaledZ||o.y-a.y||o.x-a.x}).map(e=>e.tileID.key):r.map(e=>e.tileID).sort(Ai).map(e=>e.key)}},(FX=class extends ML{constructor(e,t,r){super(),this._maxContentElevationSeen=0,this.id=e,this.dispatcher=r,this.on("data",e=>{this._dataHandler(e)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((e,t,r,i)=>{let n=new(Fj(t.type))(e,t,r,i);if(n.id!==e)throw Error(`Expected Source id to be ${e} instead of ${n.id}`);return n})(e,t,r,this),this._inViewTiles=new FZ,this._outOfViewCache=new Ln(0,e=>this._unloadTile(e)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new FH,this._didEmitContent=!1,this._updated=!1}onAdd(e){var t;this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,null!=(t=this._source)&&t.onAdd&&this._source.onAdd(e)}onRemove(e){var t;for(let e of this._inViewTiles.getAllTiles())e.unloadVectorData();this.clearTiles(),null!=(t=this._source)&&t.onRemove&&this._source.onRemove(e),this._inViewTiles=new FZ}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((void 0!==this.used||void 0!==this.usedForTerrain)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let e of this._inViewTiles.getAllTiles())if("loaded"!==e.state&&"errored"!==e.state)return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,t,r,i){return b(this,null,function*(){try{let n=yield this._source.loadTile(e);this._tileLoaded(e,t,r,i,n)}catch(t){e.state="errored",404===t.status?this.update(this.transform,this.terrain):this._source.fire(new MI(vK(t),{tile:e}))}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new z1("dataabort",{tile:e,coord:e.tileID}))}serialize(){return this._source.serialize()}prepare(e){for(let t of(this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null),this._inViewTiles.getAllTiles()))t.upload(e),t.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(e){var t;return this._inViewTiles.getRenderableIds(null==(t=this.transform)?void 0:t.bearingInRadians,e)}hasRenderableParent(e){let t=e.overscaledZ-1;if(t>=this._source.minzoom){let r=this.getLoadedTile(e.scaledTo(t));if(r)return this._inViewTiles.isIdRenderable(r.tileID.key)}return!1}reload(e,t){if(this._paused){this._shouldReloadOnResume=!0;return}for(let r of(this._outOfViewCache.reset(),this._inViewTiles.getAllIds())){let i=this._inViewTiles.getTileById(r);(!t||this._source.shouldReloadTile(i,t))&&(e?this._reloadTile(r,"errored"===i.state?"loading":"expired"):"errored"!==i.state&&this._reloadTile(r,"reloading"))}}_reloadTile(e,t){return b(this,null,function*(){let r=this._inViewTiles.getTileById(e);if(!r)return;let i=r.hasData();"loading"!==r.state&&(r.state=t),yield this._loadTile(r,e,t,i)})}_tileLoaded(e,t,r,i,n){i||(e.timeAdded=Ll(),e.selfFading&&(e.fadeEndTime=e.timeAdded+this._rasterFadeDuration)),"expired"===r&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),!n?.unmodified&&("raster-dem"===this.getSource().type&&e.dem&&function(e,t){var r,i,n;for(let a of t.getRenderableIds()){if(!(null!=(r=e.neighboringTiles)&&r[a]))continue;let o=t.getTileById(a);e.neighboringTiles[a].backfilled||LY(e,o),null!=(n=null==(i=o.neighboringTiles)?void 0:i[e.tileID.key])&&n.backfilled||LY(o,e)}}(e,this._inViewTiles),e.featureStateRevision=-1,this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new z1("data",{tile:e,coord:e.tileID})))}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._inViewTiles.getTileById(e)}_retainLoadedChildren(e,t){let r=this._getLoadedDescendents(t),i=new Set;for(let n of t){let t=r[n.key];if(!t?.length){i.add(n);continue}let a=n.overscaledZ+FX.maxOverzooming,o=t.filter(e=>e.tileID.overscaledZ<=a);if(!o.length){i.add(n);continue}let s=Math.min(...o.map(e=>e.tileID.overscaledZ)),l=o.filter(e=>e.tileID.overscaledZ===s).map(e=>e.tileID);for(let t of l)e[t.key]=t;this._areDescendentsComplete(l,s,n.overscaledZ)||i.add(n)}return i}_getLoadedDescendents(e){var t;let r={};for(let i of this._inViewTiles.getAllTiles().filter(e=>e.hasData()))for(let n of e)i.tileID.isChildOf(n)&&(r[t=n.key]||(r[t]=[]),r[n.key].push(i));return r}_areDescendentsComplete(e,t,r){return 1===e.length&&e[0].isOverscaled()?e[0].overscaledZ===t:4**(t-r)===e.length}getLoadedTile(e){return this._inViewTiles.getLoadedTile(e)}updateCacheSize(e){let t=Math.floor((Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1)*(null===this._maxTileCacheZoomLevels?MT.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,t):t;this._outOfViewCache.setMaxSize(r)}handleWrapJump(e){let t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);this._prevLng=e,t&&(this._inViewTiles.handleWrapJump(t),this._resetTileReloadTimers())}_updateMaxContentElevation(){var e,t;let r=this._maxContentElevationSeen,i=null==(t=null==(e=this.map)?void 0:e.style)?void 0:t._layers;if(!i)return r;let n=this._inViewTiles.getAllTiles();for(let e in i){let t=i[e];if(!("symbol"!==t.type||t.source!==this.id||t.isHidden(this.transform.zoom))&&t.layout)for(let e of(r=Math.max(r,t.layout.get("symbol-height-offset").constantOr(0)),n)){let i=e.getBucket(t);i&&i.maxHeightOffset>r&&(r=i.maxHeightOffset)}}return this._maxContentElevationSeen=r,r}update(e,t){let r;if(!this._sourceLoaded||this._paused)return;this.transform=e,this.terrain=t,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(e=>new In(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)):(r=LH(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:"vector"===this._source.type&&void 0!==this.map._zoomLevelsToOverscale?Math.max(this._source.maxzoom,e.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:t,calculateTileZoom:this._source.calculateTileZoom,maxContentElevation:this._updateMaxContentElevation()}),this._source.hasTile&&(r=r.filter(e=>this._source.hasTile(e)))):r=[],this.usedForTerrain&&(r=this._addTerrainIdealTiles(r));let i=0===r.length&&!this._updated&&this._didEmitContent;this._updated=!0,i&&this.fire(new z1("data",{sourceDataType:"idle",sourceId:this.id}));let n=LG(e,this._source),a=this._updateRetainedTiles(r,n),o=L$(this._source.type);o&&this._rasterFadeDuration>0&&!t&&function(e,t,r,i,n,a,o){let s=Ll(),l=function(e){if(!e.length)return new Set;let t=Math.max(...e.map(e=>e.canonical.z)),r=1/0,i=-1/0,n=1/0,a=-1/0,o=[];for(let s of e){let{x:e,y:l,z:u}=s.canonical,c=2**(t-u),h=e*c,d=l*c;o.push({id:s,x:h,y:d}),hi&&(i=h),da&&(a=d)}let s=new Set;for(let e of o)(e.x===r||e.x===i||e.y===n||e.y===a)&&s.add(e.id);return s}(t);for(let u of t){let t=e.getTileById(u.key);(0===t.fadingDirection||0===t.fadeOpacity)&&t.resetFadeLogic(),!function(e,t,r,i,n,a,o){if(!t.hasData())return!1;let{tileID:s,fadingRole:l,fadingDirection:u,fadingParentID:c}=t;if(0===l&&1===u&&c)return r[c.key]=c,!0;let h=Math.max(s.overscaledZ-n,a);for(let n=s.overscaledZ-1;n>=h;n--){let a=s.scaledTo(n),l=e.getLoadedTile(a);if(l)return t.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:l.tileID,fadeEndTime:i+o}),l.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:i+o}),r[a.key]=a,!0}return!1}(e,t,r,s,i,n,o)&&(function(e,t,r,i,n,a){if(!t.hasData())return!1;let o=t.tileID.children(n),s=LW(e,t,o,r,i,n,a);if(s)return!0;for(let l of o)LW(e,t,l.children(n),r,i,n,a)&&(s=!0);return s}(e,t,r,s,a,o)||function(e,t,r,i){let n=e.tileID;return!!e.selfFading||!e.hasData()&&!!t.has(n)&&(e.setSelfFadeLogic(r+i),!0)}(t,l,s,o)||t.resetFadeLogic())}}(this._inViewTiles,r,a,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),o?this._cleanUpRasterTiles(a):this._cleanUpVectorTiles(a)}_cleanUpRasterTiles(e){for(let t of this._inViewTiles.getAllIds())e[t]||this._removeTile(t)}_cleanUpVectorTiles(e){for(let t of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(t);if(e[t]){r.clearSymbolFadeHold();continue}if(!r.hasSymbolBuckets){this._removeTile(t);continue}r.holdingForSymbolFade()?r.symbolFadeFinished()&&this._removeTile(t):r.setSymbolHoldDuration(this.map._fadeDuration)}}_addTerrainIdealTiles(e){let t=[];for(let r of e)if(r.canonical.z>this._source.minzoom){let e=r.scaledTo(r.canonical.z-1);t.push(e);let i=r.scaledTo(Math.max(this._source.minzoom,Math.min(r.canonical.z,5)));t.push(i)}return e.concat(t)}releaseSymbolFadeTiles(){for(let e of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(e).holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){var r;let i=new Set;for(let t of e)this._addTile(t).hasData()||i.add(t);let n=e.reduce((e,t)=>(e[t.key]=t,e),{}),a=this._retainLoadedChildren(n,i),o={},s=Math.max(t-FX.maxUnderzooming,this._source.minzoom);for(let e of a){let t=this._inViewTiles.getTileById(e.key),i=t?.wasRequested();for(let a=e.overscaledZ-1;a>=s;--a){let s=e.scaledTo(a);if(o[s.key])break;if(o[s.key]=!0,(t=this.getTile(s))||!i||(t=this._addTile(s)),t){let e=t.hasData();if((e||!(null!=(r=this.map)&&r.cancelPendingTileRequestsWhileZooming)||i)&&(n[s.key]=s),i=t.wasRequested(),e)break}}}return n}_addTile(e){let t=this._inViewTiles.getTileById(e.key);if(t)return t;(t=this._outOfViewCache.getAndRemove(e))&&(t.resetFadeLogic(),this._setTileReloadTimer(e.key,t),t.tileID=e,this._state.initializeTileState(t,this.map?this.map.painter:null));let r=t;return t||(t=new FG(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(t,e.key,t.state,!1)),t.uses++,this._inViewTiles.setTile(e.key,t),r||this._source.fire(new z1("dataloading",{tile:t,coord:t.tileID})),t}_setTileReloadTimer(e,t){this._clearTileReloadTimer(e);let r=t.getExpiryTimeout();if(r){let t=()=>{this._reloadTile(e,"expired"),delete this._timers[e]};this._timers[e]=setTimeout(t,r)}}_clearTileReloadTimer(e){let t=this._timers[e];t&&(clearTimeout(t),delete this._timers[e])}_resetTileReloadTimers(){for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e of this._inViewTiles.getAllIds()){let t=this._inViewTiles.getTileById(e);this._setTileReloadTimer(e,t)}}refreshTiles(e){for(let t of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(t);(this._inViewTiles.isIdRenderable(t)||"errored"==r.state)&&e.some(e=>e.equals(r.tileID.canonical))&&this._reloadTile(t,"expired")}}_removeTile(e){let t=this._inViewTiles.getTileById(e);t&&(t.uses--,this._inViewTiles.deleteTileById(e),this._clearTileReloadTimer(e),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._outOfViewCache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){if("source"===e.dataType){if("metadata"===e.sourceDataType){this._sourceLoaded=!0;return}"content"===e.sourceDataType&&this._sourceLoaded&&!this._paused&&(this.reload(e.sourceDataChanged,e.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}}resetMaxContentElevation(){this._maxContentElevationSeen=0}clearTiles(){for(let e of(this._shouldReloadOnResume=!1,this._paused=!1,this.resetMaxContentElevation(),this._inViewTiles.getAllIds()))this._removeTile(e);this._outOfViewCache.reset()}tilesIn(e,t,r){let i=[],n=this.transform;if(!n)return i;let a=n.getCoveringTilesDetailsProvider().allowWorldCopies(),o=r?n.getCameraQueryGeometry(e):e,s=e=>n.screenPointToMercatorCoordinate(e,this.terrain),l=this.transformBbox(e,s,!a),u=this.transformBbox(o,s,!a),c=this.getIds(),h=D$.fromPoints(u);for(let e of c){let r=this._inViewTiles.getTileById(e);if(r.holdingForSymbolFade())continue;let o=a?[r.tileID]:[r.tileID.unwrapTo(-1),r.tileID.unwrapTo(0)],s=2**(n.zoom-r.tileID.overscaledZ),c=t*r.queryPadding*Md/r.tileSize/s;for(let e of o){let t=h.map(t=>e.getTilePoint(new D0(t.x,t.y)));if(t.expandBy(c),t.intersects(DW)){let t=l.map(t=>e.getTilePoint(t)),n=u.map(t=>e.getTilePoint(t));i.push({tile:r,tileID:a?e:e.unwrapTo(0),queryGeometry:t,cameraQueryGeometry:n,scale:s})}}}return i}transformBbox(e,t,r){let i=e.map(t);if(r){let r=D$.fromPoints(e);r.shrinkBy(.001*Math.min(r.width(),r.height()));let n=r.map(t);D$.fromPoints(i).covers(n)||(i=i.map(e=>e.x>.5?new D0(e.x-1,e.y,e.z):e))}return i}getVisibleCoordinates(e){let t=this.getRenderableIds(e).map(e=>this._inViewTiles.getTileById(e).tileID);return this.transform&&this.transform.populateCache(t),t}hasTransition(){return!!this._source.hasTransition()||L$(this._source.type)&&function(e,t){if(t<=0)return!1;let r=Ll();for(let t of e.getAllTiles())if(t.fadeEndTime>=r)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,t,r){e||(e=Io),this._state.updateState(e,t,r)}removeFeatureState(e,t,r){e||(e=Io),this._state.removeFeatureState(e,t,r)}getFeatureState(e,t){return e||(e=Io),this._state.getState(e,t)}setDependencies(e,t,r){let i=this._inViewTiles.getTileById(e);i&&i.setDependencies(t,r)}reloadTilesForDependencies(e,t){for(let r of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(r).hasDependency(e,t)&&this._reloadTile(r,"reloading");this._outOfViewCache.filter(r=>!r.hasDependency(e,t))}areTilesLoaded(){for(let e of this._inViewTiles.getAllTiles())if("loaded"!==e.state&&"errored"!==e.state)return!1;return!0}}).maxUnderzooming=10,FX.maxOverzooming=3,FK=FX,FJ=class{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e0?(i-a)/o:0;return this.points[n].mult(1-s).add(this.points[t].mult(s))}},FQ=class{constructor(e,t,r){let i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let e=0;ethis.width||i<0||t>this.height)return[];let s=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=i){if(n)return[{key:null,x1:e,y1:t,x2:r,y2:i}];for(let e=0;e0}hitTestCircle(e,t,r,i,n){let a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!1;let u=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,u,{hitTest:!0,overlapMode:i,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},n),u.length>0}_queryCell(e,t,r,i,n,a,o,s){let{seenUids:l,hitTest:u,overlapMode:c}=o,h=this.boxCells[n];if(null!==h){let n=this.bboxes;for(let o of h)if(!l.box[o]){l.box[o]=!0;let h=4*o,d=this.boxKeys[o];if(e<=n[h+2]+1e-6&&t<=n[h+3]+1e-6&&r>=n[h+0]-1e-6&&i>=n[h+1]-1e-6&&(!s||s(d))&&(!u||!LX(c,d.overlapMode))&&(a.push({key:d,x1:n[h],y1:n[h+1],x2:n[h+2],y2:n[h+3]}),u))return!0}}let d=this.circleCells[n];if(null!==d){let n=this.circles;for(let o of d)if(!l.circle[o]){l.circle[o]=!0;let h=3*o,d=this.circleKeys[o];if(this._circleAndRectCollide(n[h],n[h+1],n[h+2],e,t,r,i)&&(!s||s(d))&&(!u||!LX(c,d.overlapMode))){let e=n[h],t=n[h+1],r=n[h+2];if(a.push({key:d,x1:e-r,y1:t-r,x2:e+r,y2:t+r}),u)return!0}}}return!1}_queryCellCircle(e,t,r,i,n,a,o,s){let{circle:l,seenUids:u,overlapMode:c}=o,h=this.boxCells[n];if(null!==h){let e=this.bboxes;for(let t of h)if(!u.box[t]){u.box[t]=!0;let r=4*t,i=this.boxKeys[t];if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!s||s(i))&&!LX(c,i.overlapMode))return a.push(!0),!0}}let d=this.circleCells[n];if(null!==d){let e=this.circles;for(let t of d)if(!u.circle[t]){u.circle[t]=!0;let r=3*t,i=this.circleKeys[t];if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!s||s(i))&&!LX(c,i.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,r,i,n,a,o,s){let l=this._convertToXCellCoord(e),u=this._convertToYCellCoord(t),c=this._convertToXCellCoord(r),h=this._convertToYCellCoord(i);for(let d=l;d<=c;d++)for(let l=u;l<=h;l++){let u=this.xCellCount*l+d;if(n.call(this,e,t,r,i,u,a,o,s))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,r,i,n,a){let o=i-e,s=n-t,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(e,t,r,i,n,a,o){let s=(a-i)/2,l=Math.abs(e-(i+s));if(l>s+r)return!1;let u=(o-n)/2,c=Math.abs(t-(n+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;let h=l-s,d=c-u;return h*h+d*d<=r*r}},F0=vd(),F1=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]),F2=class{constructor(e,t=new FQ(e.width+200,e.height+200,25),r=new FQ(e.width+200,e.height+200,25)){this.transform=e,this.grid=t,this.ignoredGrid=r,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,r,i,n,a,o,s,l,u,c,h,d=0,f=!0){let p=e.anchorPointX+s[0],m=e.anchorPointY+s[1],g=this.projectAndGetPerspectiveRatio(p,m,n,LZ(u,p,m,d,f),h),y=r*g.perspectiveRatio,v;if(a||o)v=this._projectCollisionBox(e,y,i,n,a,o,s,g,u,c,h,d,f);else{let t=g.x+(c?c.x*y:0),r=g.y+(c?c.y*y:0);v={allPointsOccluded:!1,box:[t+e.x1*y,r+e.y1*y,t+e.x2*y,r+e.y2*y]}}let[x,b,_,w]=v.box,T=a?v.allPointsOccluded:g.isOccluded,A=T;return A||(A=g.perspectiveRatio=1;e--)d.push(a.path[e]);for(let e=1;ee.signedDistanceFromCamera<=0)?[]:e.map(e=>e.point)}let m=[];if(d.length>0){let e=d[0].clone(),t=d[0].clone();for(let r=1;r=r.x&&t.x<=i.x&&e.y>=r.y&&t.y<=i.y?[d]:t.xi.x||t.yi.y?[]:TX([d],r.x,r.y,i.x,i.y)}for(let r of m){n.reset(r,.25*t);let i=0;i=n.length<=.5*t?1:Math.ceil(n.paddedLength/f)+1;for(let r=0;rr&&(r=n,t=i);return e.slice(t,t+r)}((i=1/((r=t.pitchedLabelPlaneMatrix)[0]*r[5]-r[1]*r[4]),F0[0]=r[5]*i,F0[1]=-r[1]*i,F0[2]=0,F0[3]=0,F0[4]=-r[4]*i,F0[5]=r[0]*i,F0[6]=0,F0[7]=0,F0[8]=0,F0[9]=0,F0[10]=1/r[10],F0[11]=0,F0[12]=0,F0[13]=0,F0[14]=0,F0[15]=1/r[15],e.map(e=>{let r=L0(e.x,e.y,F0,LQ(t,e.x,e.y)),i=t.transform.projectTileCoordinates(r.point.x,r.point.y,t.unwrappedTileID,LQ(t,r.point.x,r.point.y));return i.point.x=(.5*i.point.x+.5)*t.width,i.point.y=(-(.5*i.point.y)+.5)*t.height,i})))}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let t=[],r=new D$;for(let i of e){let e=new vl(i.x+100,i.y+100);r.extend(e),t.push(e)}let{minX:i,minY:n,maxX:a,maxY:o}=r,s=this.grid.query(i,n,a,o).concat(this.ignoredGrid.query(i,n,a,o)),l={},u={};for(let e of s){let r=e.key;void 0===l[r.bucketInstanceId]&&(l[r.bucketInstanceId]={}),!l[r.bucketInstanceId][r.featureIndex]&&wh(t,[new vl(e.x1,e.y1),new vl(e.x2,e.y1),new vl(e.x2,e.y2),new vl(e.x1,e.y2)])&&(l[r.bucketInstanceId][r.featureIndex]=!0,void 0===u[r.bucketInstanceId]&&(u[r.bucketInstanceId]=[]),u[r.bucketInstanceId].push(r.featureIndex))}return u}insertCollisionBox(e,t,r,i,n,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,i,n,a){let o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:a,overlapMode:t};for(let t=0;t=this.screenRightBoundary||i<100||t>this.screenBottomBoundary}isInsideGrid(e,t,r,i){return r>=0&&e=0&&tthis.projectAndGetPerspectiveRatio(e.x,e.y,i,LZ(l,e.x,e.y,h,d),c));D=e.some(e=>!e.isOccluded),E=e.map(e=>new vl(e.x,e.y))}else D=!0;return{box:function(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y);return[t,r,i,n]}(E),allPointsOccluded:!D}}},F3=class{constructor(e,t,r,i){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):i&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}},F5=class{constructor(e,t,r,i,n){this.text=new F3(e?e.text:null,t,r,n),this.icon=new F3(e?e.icon:null,t,i,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},F4=class{constructor(e,t,r){this.text=e,this.icon=t,this.skipFade=r}},F6=class{constructor(e,t,r,i,n){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n}},F8=class{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}},F7=class{constructor(e,t,r,i,n){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new F2(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new F8(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let t=this.terrain;if(t)return(r,i)=>t.getElevation(e,r,i)}getBucketParts(e,t,r,i){let n=r.getBucket(t),a=r.latestFeatureIndex;if(!n||!a||t.id!==n.layerIds[0])return;let o=r.collisionBoxArray,s=n.layers[0].layout,l=n.layers[0].paint,u=2**(this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/Md,h=r.tileID.toUnwrapped(),d="map"===s.get("text-rotation-alignment"),f=vX(r,1,this.transform.zoom),p=v3(this.collisionIndex.transform,r,l.get("text-translate"),l.get("text-translate-anchor")),m=v3(this.collisionIndex.transform,r,l.get("icon-translate"),l.get("icon-translate-anchor")),g=LK(d,this.transform,f);this.retainedQueryData[n.bucketInstanceId]=new F6(n.bucketInstanceId,a,n.sourceLayerIndex,n.index,r.tileID);let y={bucket:n,layout:s,translationText:p,translationIcon:m,unwrappedTileID:h,pitchedLabelPlaneMatrix:g,scale:u,textPixelRatio:c,holdingForFade:r.holdingForSymbolFade(),collisionBoxArray:o,partiallyEvaluatedTextSize:T$(n.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(n.sourceID)};if(i)for(let t of n.sortKeyRanges){let{sortKey:r,symbolInstanceStart:i,symbolInstanceEnd:n}=t;e.push({sortKey:r,symbolInstanceStart:i,symbolInstanceEnd:n,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:y})}attemptAnchorPlacement(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_){var w,T,A;let M=CH[e.textAnchor],k=[e.textOffset0,e.textOffset1],S=Pi(M,r,i,k,n),E=this.collisionIndex.placeCollisionBox(t,h,s,l,u,o,a,m,c.predicate,v,S,x,b,_);if((!y||this.collisionIndex.placeCollisionBox(y,h,s,l,u,o,a,g,c.predicate,v,S,x,b,_).placeable)&&E.placeable){let e;if(null!=(w=this.prevPlacement)&&w.variableOffsets[d.crossTileID]&&null!=(A=null==(T=this.prevPlacement)?void 0:T.placements[d.crossTileID])&&A.text&&(e=this.prevPlacement.variableOffsets[d.crossTileID].anchor),0===d.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[d.crossTileID]={textOffset:k,width:r,height:i,anchor:M,textBoxScale:n,prevAnchor:e},this.markUsedJustification(f,M,d,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,d),this.placedOrientations[d.crossTileID]=p),{shift:S,placedGlyphBoxes:E}}}placeLayerBucketPart(e,t,r){let{bucket:i,layout:n,translationText:a,translationIcon:o,unwrappedTileID:s,pitchedLabelPlaneMatrix:l,textPixelRatio:u,holdingForFade:c,collisionBoxArray:h,partiallyEvaluatedTextSize:d,collisionGroup:f}=e.parameters,p=n.get("text-optional"),m=n.get("icon-optional"),g=T6(n,"text-overlap","text-allow-overlap"),y="always"===g,v=T6(n,"icon-overlap","icon-allow-overlap"),x="always"===v,b="map"===n.get("text-rotation-alignment"),_="map"===n.get("text-pitch-alignment"),w="none"!==n.get("icon-text-fit"),T="viewport-y"===n.get("symbol-z-order"),A="ground"===n.get("symbol-height-anchor"),M=y&&(x||!i.hasIconData()||m),k=x&&(y||!i.hasTextData()||p);!i.collisionArrays&&h&&i.deserializeCollisionBoxes(h);let S=this.retainedQueryData[i.bucketInstanceId].tileID,E=this._getTerrainElevationFunc(S),D=this.transform.getFastPathSimpleProjectionMatrix(S),C=(e,h,x)=>{var T,C;if(t[e.crossTileID])return;if(c){this.placements[e.crossTileID]=new F4(!1,!1,!1);return}let I=e.heightOffset,L=!1,P=!1,z=!0,F=null,O={box:null,placeable:!1,offscreen:null,occluded:!1},R={box:null,placeable:!1,offscreen:null},B=null,j=null,N=null,V=0,U=0,q=0;h.textFeatureIndex?V=h.textFeatureIndex:e.useRuntimeCollisionCircles&&(V=e.featureIndex),h.verticalTextFeatureIndex&&(U=h.verticalTextFeatureIndex);let G=h.textBox;if(G){let t=t=>{let r=1;if(i.allowVerticalPlacement&&!t&&this.prevPlacement){let t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,r=t,this.markUsedOrientation(i,r,e))}return r},n=(t,r)=>{if(i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&h.verticalTextBox){for(let e of i.writingModes)if(2===e?R=O=r():O=t(),O?.placeable)break}else O=t()},l=e.textAnchorOffsetStartIndex,c=e.textAnchorOffsetEndIndex;if(c===l){let r=(t,r)=>{let n=this.collisionIndex.placeCollisionBox(t,g,u,S,s,_,b,a,f.predicate,E,void 0,D,I,A);return n?.placeable&&(this.markUsedOrientation(i,r,e),this.placedOrientations[e.crossTileID]=r),n};n(()=>r(G,1),()=>{let t=h.verticalTextBox;return i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&t?r(t,2):{box:null,offscreen:null}}),t(O?.placeable)}else{let d=CH[null==(C=null==(T=this.prevPlacement)?void 0:T.variableOffsets[e.crossTileID])?void 0:C.anchor],p=(t,n,h)=>{let p=t.x2-t.x1,m=t.y2-t.y1,y=e.textBoxScale,x=w&&"never"===v?n:null,T=null,M="never"===g?1:2,k="never";d&&M++;for(let r=0;rp(G,h.iconBox,1),()=>{let t=h.verticalTextBox,r=O?.placeable;return i.allowVerticalPlacement&&!r&&e.numVerticalGlyphVertices>0&&t?p(t,h.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}}),O&&(L=O.placeable,z=O.offscreen);let m=t(O?.placeable);if(!L&&this.prevPlacement){let t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(i,t.anchor,e,m))}}}if(B=O,L=B?.placeable,z=B?.offscreen,e.useRuntimeCollisionCircles&&e.centerJustifiedTextSymbolIndex>=0){let t=i.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),o=TH(i.textSizeData,d,t),u=n.get("text-padding"),c=e.collisionCircleDiameter;(j=this.collisionIndex.placeCollisionCircles(g,t,i.lineVertexArray,i.glyphOffsetArray,o,s,l,r,_,f.predicate,c,u,a,E)).circles.length&&j.collisionDetected&&!r&&xd("Collisions detected, but collision boxes are not shown"),L=y||j.circles.length>0&&!j.collisionDetected,z&&(z=j.offscreen)}if(h.iconFeatureIndex&&(q=h.iconFeatureIndex),h.iconBox){let e=e=>this.collisionIndex.placeCollisionBox(e,v,u,S,s,_,b,o,f.predicate,E,w&&F?F:void 0,D,I,A);P=R&&R.placeable&&h.verticalIconBox?(N=e(h.verticalIconBox)).placeable:(N=e(h.iconBox)).placeable,z&&(z=N.offscreen)}let H=p||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,$=m||0===e.numIconVertices;H||$?$?H||P&&(P=L):L=P&&L:P=L=P&&L;let W=L&&B.placeable,Y=P&&N.placeable;if(W&&(R&&R.placeable&&U?this.collisionIndex.insertCollisionBox(B.box,g,n.get("text-ignore-placement"),i.bucketInstanceId,U,f.ID):this.collisionIndex.insertCollisionBox(B.box,g,n.get("text-ignore-placement"),i.bucketInstanceId,V,f.ID)),Y&&this.collisionIndex.insertCollisionBox(N.box,v,n.get("icon-ignore-placement"),i.bucketInstanceId,q,f.ID),j&&L&&this.collisionIndex.insertCollisionCircles(j.circles,g,n.get("text-ignore-placement"),i.bucketInstanceId,V,f.ID),r&&this.storeCollisionData(i.bucketInstanceId,x,h,B,N,j),0===e.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw Error("bucket.bucketInstanceId can't be 0");let Z=(L||M)&&!B?.occluded,X=(P||k)&&!N?.occluded;this.placements[e.crossTileID]=new F4(Z,X,z||i.justReloaded),t[e.crossTileID]=!0};if(T){if(0!==e.symbolInstanceStart)throw Error("bucket.bucketInstanceId should be 0");let t=i.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let e=t.length-1;e>=0;--e){let r=t[e];C(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let t=e.symbolInstanceStart;t=0&&(a>=0&&o!==a?e.text.placedSymbolArray.get(o).crossTileID=0:e.text.placedSymbolArray.get(o).crossTileID=r.crossTileID)}markUsedOrientation(e,t,r){let i=1===t||3===t?t:0;for(let t of[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex])e.text.placedSymbolArray.get(t).placedOrientation=i;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=2===t?t:0)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let i=t?t.symbolFadeChange(e):1,n=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(let e in this.placements){let t=this.placements[e],a=n[e];a?(this.opacities[e]=new F5(a,i,t.text,t.icon),r||(r=t.text!==a.text.placed),r||(r=t.icon!==a.icon.placed)):(this.opacities[e]=new F5(null,i,t.text,t.icon,t.skipFade),r||(r=t.text||t.icon))}for(let e in n){let t=n[e];if(!this.opacities[e]){let n=new F5(t,i,!1,!1);n.isHidden()||(this.opacities[e]=n,r||(r=t.text.placed),r||(r=t.icon.placed))}}for(let e in a)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=a[e]);for(let e in o)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=o[e]);if(t&&void 0===t.lastPlacementChangeTime)throw Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let r={};for(let i of t){let t=i.getBucket(e);t&&i.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,i.tileID,r,i.collisionBoxArray)}}updateBucketOpacities(e,t,r,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let n=e.layers[0],a=n.layout,o=new F5(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),u=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),c="map"===a.get("text-rotation-alignment"),h="map"===a.get("text-pitch-alignment"),d="none"!==a.get("icon-text-fit"),f=new F5(null,0,s&&(l||!e.hasIconData()||a.get("icon-optional")),l&&(s||!e.hasTextData()||a.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);let p=(e,t,r)=>{for(let i=0;i0||a>0,v=i.numIconVertices>0,x=this.placedOrientations[i.crossTileID],b=2===x,_=1===x||3===x;if(y){let t=Pa(g.text),r=b?Oi:t;p(e.text,n,r);let o=_?Oi:t;p(e.text,a,o);let s=g.text.isHidden();for(let t of[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex])t>=0&&(e.text.placedSymbolArray.get(t).hidden=s||b?1:0);i.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=s||_?1:0);let l=this.variableOffsets[i.crossTileID];l&&this.markUsedJustification(e,l.anchor,i,x);let u=this.placedOrientations[i.crossTileID];u&&(this.markUsedJustification(e,"left",i,u),this.markUsedOrientation(e,u,i))}if(v){let t=Pa(g.icon),r=!(d&&i.verticalPlacedIconSymbolIndex&&b);if(i.placedIconSymbolIndex>=0){let n=r?t:Oi;p(e.icon,i.numIconVertices,n),e.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=g.icon.isHidden()}if(i.verticalPlacedIconSymbolIndex>=0){let n=r?Oi:t;p(e.icon,i.numVerticalIconVertices,n),e.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden()}}let w=m?.has(t)?m.get(t):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let r=e.collisionArrays[t];if(r){let t=new vl(0,0);if(r.textBox||r.verticalTextBox){let i=!0;if(u){let e=this.variableOffsets[s];e?(t=Pi(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),c&&t._rotate(h?-this.transform.bearingInRadians:this.transform.bearingInRadians)):i=!1}if(r.textBox||r.verticalTextBox){let n;r.textBox&&(n=b),r.verticalTextBox&&(n=_),Pn(e.textCollisionBox.collisionVertexArray,g.text.placed,!i||n,w.text,t.x,t.y)}}if(r.iconBox||r.verticalIconBox){let i=!(_||!r.verticalIconBox),n;r.iconBox&&(n=i),r.verticalIconBox&&(n=!i),Pn(e.iconCollisionBox.collisionVertexArray,g.icon.placed,n,w.icon,d?t.x:0,d?t.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return 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}},F9=0x2000000,Oe=0x1000000,Ot=131072,Or=65536,Oi=0,On=class{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,r,i,n){let a=this._bucketParts;for(;this._currentTileIndexe.sortKey-t.sortKey));this._currentPartIndex!this._forceFullPlacement&&Ll()-i>2;for(;this._currentPlacementIndex>=0;){let i=t[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if(C1(i)&&i.layout&&(!i.minzoom||i.minzoom<=a)&&(!i.maxzoom||i.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new On(i)),this._inProgressLayer.continuePlacement(r[i.source],this.placement,this._showCollisionBoxes,i,n))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}},Oo=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Os=new Uint32Array(96),Ol=class e{static from(t){if(!t||void 0===t.byteLength||t.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(t,0,2);if(219!==r)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(1!==n)throw Error(`Got v${n} data when expected v1.`);let a=Oo[15&i];if(!a)throw Error("Unrecognized array type.");let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,void 0,t)}constructor(e,t=64,r=Float64Array,i=ArrayBuffer,n){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=Oo.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(a<0)throw Error(`Unexpected typed array class: ${r}.`);if(n)this.data=n,this.ids=new this.IndexArrayType(n,8,e),this.coords=new r(n,8+s+l,2*e),this._pos=2*e,this._finished=!0;else{let n=this.data=new i(8+o+s+l);this.ids=new this.IndexArrayType(n,8,e),this.coords=new r(n,8+s+l,2*e),this._pos=0,this._finished=!1,new Uint8Array(n,0,2).set([219,16+a]),new Uint16Array(n,2,1)[0]=t,new Uint32Array(n,4,1)[0]=e}}add(e,t){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return function e(t,r,i,n,a,o){if(a-n<=i)return;let s=n+a>>1;(function e(t,r,i,n,a,o){for(;a>n;){if(a-n>600){let s=a-n+1,l=i-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);e(t,r,i,Math.max(n,Math.floor(i-l*c/s+h)),Math.min(a,Math.floor(i+(s-l)*c/s+h)),o)}let s=r[2*i+o],l=n,u=a;for(Po(t,r,n,i),r[2*a+o]>s&&Po(t,r,n,a);ls;)u--}r[2*n+o]===s?Po(t,r,n,u):Po(t,r,++u,a),u<=i&&(n=u+1),i<=u&&(a=u-1)}})(t,r,s,n,a,o),e(t,r,i,n,s-1,1-o),e(t,r,i,s+1,a,1-o)}(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,i){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:n,coords:a,nodeSize:o}=this;Os[0]=0,Os[1]=n.length-1,Os[2]=0;let s=3,l=[];for(;s>0;){let u=Os[--s],c=Os[--s],h=Os[--s];if(c-h<=o){for(let o=h;o<=c;o++){let s=a[2*o],u=a[2*o+1];s>=e&&s<=r&&u>=t&&u<=i&&l.push(n[o])}continue}let d=h+c>>1,f=a[2*d],p=a[2*d+1];f>=e&&f<=r&&p>=t&&p<=i&&l.push(n[d]),(0===u?e<=f:t<=p)&&(Os[s++]=h,Os[s++]=d-1,Os[s++]=1-u),(0===u?r>=f:i>=p)&&(Os[s++]=d+1,Os[s++]=c,Os[s++]=1-u)}return l}within(e,t,r){let i=[];return this.withinInto(e,t,r,i),i}withinInto(e,t,r,i){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:n,coords:a,nodeSize:o}=this;Os[0]=0,Os[1]=n.length-1,Os[2]=0;let s=3,l=0,u=r*r;for(;s>0;){let c=Os[--s],h=Os[--s],d=Os[--s];if(h-d<=o){for(let r=d;r<=h;r++)Pl(a[2*r],a[2*r+1],e,t)<=u&&(i[l++]=n[r]);continue}let f=d+h>>1,p=a[2*f],m=a[2*f+1];Pl(p,m,e,t)<=u&&(i[l++]=n[f]),(0===c?e-r<=p:t-r<=m)&&(Os[s++]=d,Os[s++]=f-1,Os[s++]=1-c),(0===c?e+r>=p:t+r>=m)&&(Os[s++]=f+1,Os[s++]=h,Os[s++]=1-c)}return l}},Ou=512/Md/2,Oc=class{constructor(e,t,r){this.tileID=e,this.bucketInstanceId=r,this._symbolsByKey={};let i=new Map;for(let e=0;e({x:Math.floor(e.anchorX*Ou),y:Math.floor(e.anchorY*Ou)})),crossTileIDs:t.map(e=>e.crossTileID)};if(r.positions.length>128){let e=new Ol(r.positions.length,16,Uint16Array);for(let{x:t,y:i}of r.positions)e.add(t,i);e.finish(),delete r.positions,r.index=e}this._symbolsByKey[e]=r}}getScaledCoordinates(e,t){let{x:r,y:i,z:n}=this.tileID.canonical,{x:a,y:o,z:s}=t.canonical,l=Ou/2**(s-n),u=(a*Md+e.anchorX)*l,c=(o*Md+e.anchorY)*l;return{x:Math.floor(u-r*Md*Ou),y:Math.floor(c-i*Md*Ou)}}findMatches(e,t,r){let i=this.tileID.canonical.ze)}},Oh=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},Od=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(0!==t)for(let e in this.indexes){let r=this.indexes[e],i={};for(let e in r){let n=r[e];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),i[n.tileID.key]=n}this.indexes[e]=i}this.lng=e}addBucket(e,t,r){var i,n,a;if(null!=(i=this.indexes[e.overscaledZ])&&i[e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;ee.overscaledZ)for(let r in i){let n=i[r];n.tileID.isChildOf(e)&&n.findMatches(t.symbolInstances,e,o)}else{let n=i[e.scaledTo(Number(r)).key];n&&n.findMatches(t.symbolInstances,e,o)}}for(let e=0;e> 3)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) { +#ifdef GLOBE +vec3 center_vector=projectToSphere(circle_center); +#endif +float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else { +#ifdef GLOBE +vec4 projected_center=interpolateProjection(circle_center,center_vector,ele); +#else +vec4 projected_center=projectTileWithElevation(circle_center,ele); +#endif +corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);} +#ifdef GLOBE +vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele); +#else +gl_Position=projectTileWithElevation(corner_position,ele); +#endif +} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,Ov={prelude:Pu(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +out highp vec4 fragColor;layout(std140) uniform ProjectionUBO {highp mat4 u_projection_matrix;highp mat4 u_projection_fallback_matrix;highp vec4 u_projection_tile_mercator_coords;highp vec4 u_projection_clipping_plane;highp float u_projection_transition;highp int u_projection_clip_antimeridian;};layout(std140) uniform FrameUBO {highp vec2 u_units_to_pixels;highp vec2 u_world_size;highp float u_camera_to_center_distance;highp float u_symbol_fade_change;highp float u_aspect_ratio;highp float u_device_pixel_ratio;highp vec2 u_viewport_size;highp vec2 u_pixel_extrude_scale;highp float u_pitch;};`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const uint packedOpacity) {return vec2(float(packedOpacity >> 1u)/127.0,float(packedOpacity & 1u));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c +);} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform highp sampler2D u_depth;layout(std140) uniform TerrainUBO {highp mat4 u_terrain_matrix;highp vec4 u_terrain_unpack;highp float u_terrain_dim;highp float u_terrain_exaggeration;}; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(ivec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texelFetch(u_terrain,pos,0)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +#ifdef GLOBE +if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;} +#endif +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+2.0;vec2 f=fract(coord);ivec2 c=ivec2(floor(coord));ivec2 hi=textureSize(u_terrain,0)-1;float tl=ele(clamp(c,ivec2(0),hi));float tr=ele(clamp(c+ivec2(1,0),ivec2(0),hi));float bl=ele(clamp(c+ivec2(0,1),ivec2(0),hi));float br=ele(clamp(c+ivec2(1,1),ivec2(0),hi));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}const float PI=3.141592653589793; +#define PROJECTION_UBO +layout(std140) uniform ProjectionUBO {highp mat4 u_projection_matrix;highp mat4 u_projection_fallback_matrix;highp vec4 u_projection_tile_mercator_coords;highp vec4 u_projection_clipping_plane;highp float u_projection_transition;highp int u_projection_clip_antimeridian;};layout(std140) uniform FrameUBO {highp vec2 u_units_to_pixels;highp vec2 u_world_size;highp float u_camera_to_center_distance;highp float u_symbol_fade_change;highp float u_aspect_ratio;highp float u_device_pixel_ratio;highp vec2 u_viewport_size;highp vec2 u_pixel_extrude_scale;highp float u_pitch;};`),projectionMercator:Pu(` +void clipAntimeridian() {}`,"float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:Pu("in highp float v_projection_tile_x;void clipAntimeridian() {if (u_projection_clip_antimeridian !=0 && (v_projection_tile_x < 0.0 || v_projection_tile_x >=8192.0)) {discard;}}",`#define GLOBE_RADIUS 6371008.8 +#ifndef PROJECTION_UBO +uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix; +#endif +out highp float v_projection_tile_x;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos +);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float t=exp(PI-(mercator_pos_y*PI*2.0));return (2.0*t)/(t*t+1.0);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY);if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;float spherical_x=mercator_pos.x*PI*2.0+PI;float t=exp(PI-(mercator_pos.y*PI*2.0));float t2=t*t;float denom=t2+1.0;float sin_sy=(t2-1.0)/denom;float cos_sy=(2.0*t)/denom;vec3 pos=vec3(sin(spherical_x)*cos_sy,sin_sy,cos(spherical_x)*cos_sy +);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:Pu(Op,"layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Pu(Om,"uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Pu(Og,Oy),clippingMask:Pu("void main() {fragColor=vec4(1.0);}","layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Pu(`uniform highp float u_intensity;in vec2 v_extrude; +#pragma maplibre: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma maplibre: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;layout(location=0) in ivec2 a_pos;out vec2 v_extrude; +#pragma maplibre: define highp float weight +#pragma maplibre: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma maplibre: initialize highp float weight +#pragma maplibre: initialize mediump float radius +ivec2 pos_raw=a_pos+32768;vec2 unscaled_extrude=vec2(pos_raw & 7)/7.0*2.0-1.0;float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=vec2(pos_raw >> 3); +#ifdef GLOBE +vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0); +#else +gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center)); +#endif +}`),heatmapTexture:Pu(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world_size,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Pu("flat in float v_placed;flat in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","layout(location=0) in vec2 a_anchor_pos;layout(location=1) in vec2 a_placed;layout(location=2) in vec2 a_box_real;flat out float v_placed;flat out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Pu("flat in float v_radius;in vec2 v_extrude;flat in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","layout(location=0) in vec2 a_pos;layout(location=1) in float a_radius;layout(location=2) in vec2 a_flags;flat out float v_radius;out vec2 v_extrude;flat out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:Pu(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {vec4 data=texelFetch(u_elevation_stops,ivec2(stop,0),0)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else +{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0)); +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,"uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=2.0/u_dimension;float scale=(u_dimension.x-4.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:Pu("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","layout(location=0) in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:Pu("void main() {fragColor=vec4(1.0);}",`layout(location=0) in vec2 a_pos;void main() { +#ifdef GLOBE +gl_Position=projectTileFor3D(a_pos,0.0); +#else +gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0); +#endif +}`),fill:Pu(`#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp float opacity +void main() { +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize lowp float opacity +fragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos; +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp float opacity +void main() { +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize lowp float opacity +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:Pu(`in vec2 v_pos; +#ifdef GLOBE +in float v_depth; +#endif +#pragma maplibre: define highp vec4 outline_color +#pragma maplibre: define lowp float opacity +void main() { +#pragma maplibre: initialize highp vec4 outline_color +#pragma maplibre: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity); +#ifdef GLOBE +if (v_depth > 1.0) {discard;} +#endif +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos; +#ifdef GLOBE +out float v_depth; +#endif +#pragma maplibre: define highp vec4 outline_color +#pragma maplibre: define lowp float opacity +void main() { +#pragma maplibre: initialize highp vec4 outline_color +#pragma maplibre: initialize lowp float opacity +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world_size; +#ifdef GLOBE +v_depth=gl_Position.z/gl_Position.w; +#endif +}`),fillOutlinePattern:Pu(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;uniform bool u_sdf_pattern;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos; +#ifdef GLOBE +in float v_depth; +#endif +#pragma maplibre: define lowp float opacity +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp vec4 pattern_from +#pragma maplibre: define lowp vec4 pattern_to +void main() { +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize mediump vec4 pattern_from +#pragma maplibre: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);if (u_sdf_pattern) {highp float sdf_edge=(256.0-64.0)/256.0;highp float sdf_gamma_a=max(fwidth(color1.a)*0.5,1.0/255.0/16.0);highp float sdf_gamma_b=max(fwidth(color2.a)*0.5,1.0/255.0/16.0);float sdf_alpha_a=smoothstep(sdf_edge-sdf_gamma_a,sdf_edge+sdf_gamma_a,color1.a);float sdf_alpha_b=smoothstep(sdf_edge-sdf_gamma_b,sdf_edge+sdf_gamma_b,color2.a);fragColor=mix(color*sdf_alpha_a,color*sdf_alpha_b,u_fade)*alpha*opacity;} else {fragColor=mix(color1,color2,u_fade)*alpha*opacity;} +#ifdef GLOBE +if (v_depth > 1.0) {discard;} +#endif +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos; +#ifdef GLOBE +out float v_depth; +#endif +#pragma maplibre: define lowp float opacity +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp vec4 pattern_from +#pragma maplibre: define lowp vec4 pattern_to +#pragma maplibre: define lowp float pixel_ratio_from +#pragma maplibre: define lowp float pixel_ratio_to +void main() { +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize mediump vec4 pattern_from +#pragma maplibre: initialize mediump vec4 pattern_to +#pragma maplibre: initialize lowp float pixel_ratio_from +#pragma maplibre: initialize lowp float pixel_ratio_to +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world_size; +#ifdef GLOBE +v_depth=gl_Position.z/gl_Position.w; +#endif +}`),fillPattern:Pu(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform bool u_sdf_pattern;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b; +#pragma maplibre: define lowp float opacity +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp vec4 pattern_from +#pragma maplibre: define lowp vec4 pattern_to +void main() { +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize mediump vec4 pattern_from +#pragma maplibre: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);if (u_sdf_pattern) {highp float sdf_edge=(256.0-64.0)/256.0;highp float sdf_gamma_a=max(fwidth(color1.a)*0.5,1.0/255.0/16.0);highp float sdf_gamma_b=max(fwidth(color2.a)*0.5,1.0/255.0/16.0);float sdf_alpha_a=smoothstep(sdf_edge-sdf_gamma_a,sdf_edge+sdf_gamma_a,color1.a);float sdf_alpha_b=smoothstep(sdf_edge-sdf_gamma_b,sdf_edge+sdf_gamma_b,color2.a);fragColor=mix(color*sdf_alpha_a,color*sdf_alpha_b,u_fade)*opacity;} else {fragColor=mix(color1,color2,u_fade)*opacity;} +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b; +#pragma maplibre: define lowp float opacity +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp vec4 pattern_from +#pragma maplibre: define lowp vec4 pattern_to +#pragma maplibre: define lowp float pixel_ratio_from +#pragma maplibre: define lowp float pixel_ratio_to +void main() { +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize mediump vec4 pattern_from +#pragma maplibre: initialize mediump vec4 pattern_to +#pragma maplibre: initialize lowp float pixel_ratio_from +#pragma maplibre: initialize lowp float pixel_ratio_to +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Pu(`in vec4 v_color;void main() {fragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;layout(location=1) in ivec4 a_normal_ed; +#ifdef TERRAIN3D +layout(location=2) in vec2 a_centroid; +#endif +out vec4 v_color; +#pragma maplibre: define highp float base +#pragma maplibre: define highp float height +#pragma maplibre: define highp vec4 color +void main() { +#pragma maplibre: initialize highp float base +#pragma maplibre: initialize highp float height +#pragma maplibre: initialize highp vec4 color +vec3 normal=vec3(a_normal_ed.xyz); +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; +#ifdef GLOBE +vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); +#else +gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); +#endif +float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0); +#ifdef GLOBE +mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition); +#endif +directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Pu(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting; +#pragma maplibre: define lowp float base +#pragma maplibre: define lowp float height +#pragma maplibre: define lowp vec4 pattern_from +#pragma maplibre: define lowp vec4 pattern_to +#pragma maplibre: define lowp float pixel_ratio_from +#pragma maplibre: define lowp float pixel_ratio_to +void main() { +#pragma maplibre: initialize lowp float base +#pragma maplibre: initialize lowp float height +#pragma maplibre: initialize mediump vec4 pattern_from +#pragma maplibre: initialize mediump vec4 pattern_to +#pragma maplibre: initialize lowp float pixel_ratio_from +#pragma maplibre: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;layout(location=0) in vec2 a_pos;layout(location=1) in ivec4 a_normal_ed; +#ifdef TERRAIN3D +layout(location=2) in vec2 a_centroid; +#endif +#ifdef GLOBE +out vec3 v_sphere_pos; +#endif +out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting; +#pragma maplibre: define lowp float base +#pragma maplibre: define lowp float height +#pragma maplibre: define lowp vec4 pattern_from +#pragma maplibre: define lowp vec4 pattern_to +#pragma maplibre: define lowp float pixel_ratio_from +#pragma maplibre: define lowp float pixel_ratio_to +void main() { +#pragma maplibre: initialize lowp float base +#pragma maplibre: initialize lowp float height +#pragma maplibre: initialize mediump vec4 pattern_from +#pragma maplibre: initialize mediump vec4 pattern_to +#pragma maplibre: initialize lowp float pixel_ratio_from +#pragma maplibre: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=vec3(a_normal_ed.xyz);float edgedistance=float(a_normal_ed.w);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; +#ifdef GLOBE +vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); +#else +gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); +#endif +vec2 pos=a_normal_ed.x==1 && a_normal_ed.y==0 && a_normal_ed.z==16384 +? a_pos +: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Pu(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(ivec2 texel) {vec4 data=texelFetch(u_image,texel,0)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {ivec2 pos=ivec2(gl_FragCoord.xy)+ivec2(1);float tileSize=u_dimension.x-4.0;float a=getElevation(pos+ivec2(-1,-1));float b=getElevation(pos+ivec2(0,-1));float c=getElevation(pos+ivec2(1,-1));float d=getElevation(pos+ivec2(-1,0));float e=getElevation(pos);float f=getElevation(pos+ivec2(1,0));float g=getElevation(pos+ivec2(-1,1));float h=getElevation(pos+ivec2(0,1));float i=getElevation(pos+ivec2(1,1));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;layout(location=1) 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:Pu(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES]; +#define PI 3.141592653589793 +#define STANDARD 0 +#define COMBINED 1 +#define IGOR 2 +#define MULTIDIRECTIONAL 3 +#define BASIC 4 +float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else +{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else +{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec2 size=vec2(textureSize(u_image,0));vec2 texturePos=(v_pos*(size-2.0)+1.0)/size;vec4 pixel=texture(u_image,texturePos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);} +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:Pu(`flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale; +#ifdef GLOBE +in float v_depth; +#endif +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +void main() { +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity); +#ifdef GLOBE +if (v_depth > 1.0) {discard;} +#endif +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar; +#ifdef GLOBE +out float v_depth; +#endif +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +#pragma maplibre: define mediump float gapwidth +#pragma maplibre: define lowp float offset +#pragma maplibre: define mediump float width +void main() { +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize mediump float gapwidth +#pragma maplibre: initialize lowp float offset +#pragma maplibre: initialize mediump float width +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);v_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*2.0;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; +#ifdef GLOBE +v_depth=gl_Position.z/gl_Position.w; +#endif +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:Pu(`uniform sampler2D u_image;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv; +#ifdef GLOBE +in float v_depth; +#endif +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +void main() { +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity); +#ifdef GLOBE +if (v_depth > 1.0) {discard;} +#endif +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_image_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv; +#ifdef GLOBE +out float v_depth; +#endif +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +#pragma maplibre: define mediump float gapwidth +#pragma maplibre: define lowp float offset +#pragma maplibre: define mediump float width +void main() { +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize mediump float gapwidth +#pragma maplibre: initialize lowp float offset +#pragma maplibre: initialize mediump float width +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; +#ifdef GLOBE +v_depth=gl_Position.z/gl_Position.w; +#endif +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),linePattern:Pu(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;flat in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;flat in float v_width; +#ifdef GLOBE +in float v_depth; +#endif +#pragma maplibre: define lowp vec4 pattern_from +#pragma maplibre: define lowp vec4 pattern_to +#pragma maplibre: define lowp float pixel_ratio_from +#pragma maplibre: define lowp float pixel_ratio_to +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +void main() { +#pragma maplibre: initialize mediump vec4 pattern_from +#pragma maplibre: initialize mediump vec4 pattern_to +#pragma maplibre: initialize lowp float pixel_ratio_from +#pragma maplibre: initialize lowp float pixel_ratio_to +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +clipAntimeridian();vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity; +#ifdef GLOBE +if (v_depth > 1.0) {discard;} +#endif +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;flat out float v_width; +#ifdef GLOBE +out float v_depth; +#endif +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +#pragma maplibre: define lowp float offset +#pragma maplibre: define mediump float gapwidth +#pragma maplibre: define mediump float width +#pragma maplibre: define lowp float floorwidth +#pragma maplibre: define lowp vec4 pattern_from +#pragma maplibre: define lowp vec4 pattern_to +#pragma maplibre: define lowp float pixel_ratio_from +#pragma maplibre: define lowp float pixel_ratio_to +void main() { +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize lowp float offset +#pragma maplibre: initialize mediump float gapwidth +#pragma maplibre: initialize mediump float width +#pragma maplibre: initialize lowp float floorwidth +#pragma maplibre: initialize mediump vec4 pattern_from +#pragma maplibre: initialize mediump vec4 pattern_to +#pragma maplibre: initialize lowp float pixel_ratio_from +#pragma maplibre: initialize lowp float pixel_ratio_to +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; +#ifdef GLOBE +v_depth=gl_Position.z/gl_Position.w; +#endif +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Pu(`uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale; +#ifdef GLOBE +in float v_depth; +#endif +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +#pragma maplibre: define mediump float width +#pragma maplibre: define lowp float floorwidth +#pragma maplibre: define mediump vec4 dasharray_from +#pragma maplibre: define mediump vec4 dasharray_to +void main() { +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize mediump float width +#pragma maplibre: initialize lowp float floorwidth +#pragma maplibre: initialize mediump vec4 dasharray_from +#pragma maplibre: initialize mediump vec4 dasharray_to +clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity); +#ifdef GLOBE +if (v_depth > 1.0) {discard;} +#endif +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale; +#ifdef GLOBE +out float v_depth; +#endif +#pragma maplibre: define highp vec4 color +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +#pragma maplibre: define mediump float gapwidth +#pragma maplibre: define lowp float offset +#pragma maplibre: define mediump float width +#pragma maplibre: define lowp float floorwidth +#pragma maplibre: define mediump vec4 dasharray_from +#pragma maplibre: define mediump vec4 dasharray_to +void main() { +#pragma maplibre: initialize highp vec4 color +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize mediump float gapwidth +#pragma maplibre: initialize lowp float offset +#pragma maplibre: initialize mediump float width +#pragma maplibre: initialize lowp float floorwidth +#pragma maplibre: initialize mediump vec4 dasharray_from +#pragma maplibre: initialize mediump vec4 dasharray_to +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; +#ifdef GLOBE +v_depth=gl_Position.z/gl_Position.w; +#endif +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:Pu(`uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv; +#ifdef GLOBE +in float v_depth; +#endif +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +#pragma maplibre: define mediump float width +#pragma maplibre: define lowp float floorwidth +#pragma maplibre: define mediump vec4 dasharray_from +#pragma maplibre: define mediump vec4 dasharray_to +void main() { +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize mediump float width +#pragma maplibre: initialize lowp float floorwidth +#pragma maplibre: initialize mediump vec4 dasharray_from +#pragma maplibre: initialize mediump vec4 dasharray_to +clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity); +#ifdef GLOBE +if (v_depth > 1.0) {discard;} +#endif +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b; +#ifdef GLOBE +out float v_depth; +#endif +#pragma maplibre: define lowp float blur +#pragma maplibre: define lowp float opacity +#pragma maplibre: define mediump float gapwidth +#pragma maplibre: define lowp float offset +#pragma maplibre: define mediump float width +#pragma maplibre: define lowp float floorwidth +#pragma maplibre: define mediump vec4 dasharray_from +#pragma maplibre: define mediump vec4 dasharray_to +void main() { +#pragma maplibre: initialize lowp float blur +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize mediump float gapwidth +#pragma maplibre: initialize lowp float offset +#pragma maplibre: initialize mediump float width +#pragma maplibre: initialize lowp float floorwidth +#pragma maplibre: initialize mediump vec4 dasharray_from +#pragma maplibre: initialize mediump vec4 dasharray_to +if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; +#ifdef GLOBE +v_depth=gl_Position.z/gl_Position.w; +#endif +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),layerOpacity:Pu(`uniform sampler2D u_image;uniform float u_opacity;in vec2 v_pos;void main() {fragColor=texture(u_image,v_pos)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(0.0); +#endif +}`,"layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos.x*2.0-1.0,1.0-a_pos.y*2.0,0.0,1.0);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),raster:Pu(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec3 v_pos0;in vec3 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0.xy/v_pos0.z);vec4 color1=texture(u_image1,v_pos1.xy/v_pos1.z);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec3 u_image_warp;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;layout(location=0) in vec2 a_pos;out vec3 v_pos0;out vec3 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 topLeft=u_coords_top.xy;vec2 topRight=u_coords_top.zw;vec2 bottomLeft=u_coords_bottom.xy;vec2 bottomRight=u_coords_bottom.zw;vec2 bilinearPos=mix(mix(topLeft,topRight,fractionalPos.x),mix(bottomLeft,bottomRight,fractionalPos.x),fractionalPos.y);float denominator=dot(u_image_warp.xy,fractionalPos)+1.0;vec2 acrossTop=topRight-topLeft+u_image_warp.x*topRight;vec2 downLeft=bottomLeft-topLeft+u_image_warp.y*bottomLeft;vec2 projectivePos=(acrossTop*fractionalPos.x+downLeft*fractionalPos.y+topLeft)/denominator;vec2 position=mix(projectivePos,bilinearPos,u_image_warp.z);gl_Position=projectTile(position,position);vec2 texturePos=((fractionalPos-0.5)/u_buffer_scale)+0.5; +#ifdef GLOBE +if (a_pos.y <-32767.5) {texturePos.y=0.0;}if (a_pos.y > 32766.5) {texturePos.y=1.0;} +#endif +float perspectiveRatio=mix(1.0/denominator,1.0,u_image_warp.z);v_pos0=vec3(texturePos*perspectiveRatio,perspectiveRatio);vec2 parentPos=(texturePos*u_scale_parent)+u_tl_parent;v_pos1=vec3(parentPos*perspectiveRatio,perspectiveRatio);}`),symbolIcon:Pu(`uniform sampler2D u_texture;in vec2 v_tex;flat in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity; +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in uint a_fade_opacity;layout(location=5) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform bool u_rotate_symbol;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec2 v_tex;flat out float v_total_opacity; +#pragma maplibre: define lowp float opacity +void main() { +#pragma maplibre: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float visibility=calculate_visibility(projectedPoint);v_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; +#ifdef GLOBE +if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} +#endif +vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:Pu(`#define SDF_PX 8.0 +uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1; +#pragma maplibre: define highp vec4 fill_color +#pragma maplibre: define highp vec4 halo_color +#pragma maplibre: define lowp float halo_width +#pragma maplibre: define lowp float halo_blur +void main() { +#pragma maplibre: initialize highp vec4 fill_color +#pragma maplibre: initialize highp vec4 halo_color +#pragma maplibre: initialize lowp float halo_width +#pragma maplibre: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;} +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in uint a_fade_opacity;layout(location=5) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform bool u_rotate_symbol;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec2 v_data0;out vec3 v_data1; +#pragma maplibre: define highp vec4 fill_color +#pragma maplibre: define highp vec4 halo_color +#pragma maplibre: define lowp float opacity +#pragma maplibre: define lowp float halo_width +#pragma maplibre: define lowp float halo_blur +void main() { +#pragma maplibre: initialize highp vec4 fill_color +#pragma maplibre: initialize highp vec4 halo_color +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize lowp float halo_width +#pragma maplibre: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; +#ifdef GLOBE +if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} +#endif +vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:Pu(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;in vec4 v_data0;in vec3 v_data1;flat in float v_is_sdf; +#pragma maplibre: define highp vec4 fill_color +#pragma maplibre: define highp vec4 halo_color +#pragma maplibre: define lowp float halo_width +#pragma maplibre: define lowp float halo_blur +void main() { +#pragma maplibre: initialize highp vec4 fill_color +#pragma maplibre: initialize highp vec4 halo_color +#pragma maplibre: initialize lowp float halo_width +#pragma maplibre: initialize lowp float halo_blur +float total_opacity=v_data1[2];if (v_is_sdf==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity; +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;} +#ifdef OVERDRAW_INSPECTOR +fragColor=vec4(1.0); +#endif +}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec3 a_projected_pos;layout(location=3) in uint a_fade_opacity;layout(location=4) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec4 v_data0;out vec3 v_data1;flat out float v_is_sdf; +#pragma maplibre: define highp vec4 fill_color +#pragma maplibre: define highp vec4 halo_color +#pragma maplibre: define lowp float opacity +#pragma maplibre: define lowp float halo_width +#pragma maplibre: define lowp float halo_blur +void main() { +#pragma maplibre: initialize highp vec4 fill_color +#pragma maplibre: initialize highp vec4 halo_color +#pragma maplibre: initialize lowp float opacity +#pragma maplibre: initialize lowp float halo_width +#pragma maplibre: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);float is_sdf=float(a_data.z & 1u);float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; +#ifdef GLOBE +if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} +#endif +vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec3(gamma_scale,size,total_opacity);v_is_sdf=is_sdf;}`),terrain:Pu("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","layout(location=0) in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Pu("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","layout(location=0) in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),atmosphere:Pu(`#ifdef GL_ES +precision highp float; +#endif +in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758 +);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Pu("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;uniform vec3 u_globe_position;uniform float u_globe_radius;in vec3 v_view_direction;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (u_sky_blend > 0.0) {vec3 ray=normalize(v_view_direction);float globe_distance=length(u_globe_position);float angle_to_globe_center=acos(clamp(dot(ray,u_globe_position)/globe_distance,-1.0,1.0));float horizon_angle=asin(min(u_globe_radius/globe_distance,1.0));blend=mix(blend,(angle_to_globe_center-horizon_angle)*u_camera_to_center_distance*u_device_pixel_ratio,u_sky_blend);}if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 v_view_direction;void main() {v_view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,1.0,1.0);}")},Ox=class{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return"mercator"}get shaderDefine(){return"#define PROJECTION_MERCATOR"}get shaderPreludeCode(){return Ov.projectionMercator}get vertexShaderPreludeCode(){return Ov.projectionMercator.vertexSource}get subdivisionGranularity(){return DP.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}destroy(){}getMeshFromTileID(e,t,r,i,n){if(this._cachedMesh)return this._cachedMesh;let a=new Eo;a.emplaceBack(0,0),a.emplaceBack(Md,0),a.emplaceBack(0,Md),a.emplaceBack(Md,Md);let o=e.createVertexBuffer(a,FP.members),s=EE.simpleSegment(0,0,4,2),l=new ET;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3);let u=e.createIndexBuffer(l);return this._cachedMesh=new FL(o,u,s),this._cachedMesh}recalculate(){}hasTransition(){return!1}},Ob=class e{constructor(e=0,t=0,r=0,i=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(i)||i<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=i}interpolate(e,t,r){return null!=t.top&&null!=e.top&&(this.top=kv.number(e.top,t.top,r)),null!=t.bottom&&null!=e.bottom&&(this.bottom=kv.number(e.bottom,t.bottom,r)),null!=t.left&&null!=e.left&&(this.left=kv.number(e.left,t.left,r)),null!=t.right&&null!=e.right&&(this.right=kv.number(e.right,t.right,r)),this}getCenter(e,t){return new vl(xt((this.left+e-this.right)/2,0,e),xt((this.top+t-this.bottom)/2,0,t))}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new e(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}},O_=class{constructor(e,t){var r;this.applyConstrain=(e,t)=>null===this._constrainOverride?this._callbacks.defaultConstrain(e,t):this._constrainOverride(e,t),this._callbacks=e,this._tileSize=512,this._renderWorldCopies=t?.renderWorldCopies===void 0||!!t?.renderWorldCopies,this._minZoom=t?.minZoom||0,this._maxZoom=t?.maxZoom||22,this._minPitch=t?.minPitch===void 0||t?.minPitch===null?0:t?.minPitch,this._maxPitch=t?.maxPitch===void 0||t?.maxPitch===null?60:t?.maxPitch,this._constrainOverride=null!=(r=t?.constrainOverride)?r:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new DJ(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Ph(this._zoom),this._scale=xa(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Ob,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,t,r){this._constrainOverride=e.constrainOverride,this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=Ph(this._zoom),this._scale=xa(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new Ob(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!r&&e.autoCalculateNearFarZ,t&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){if(this._minZoom===e)return;this._minZoom=e;let t=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=t}get maxZoom(){return this._maxZoom}setMaxZoom(e){if(this._maxZoom===e)return;this._maxZoom=e;let t=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=t}get minPitch(){return this._minPitch}setMinPitch(e){if(this._minPitch===e)return;this._minPitch=e;let t=this._unmodified;this.setPitch(Math.max(this.pitch,e)),this._unmodified=t}get maxPitch(){return this._maxPitch}setMaxPitch(e){if(this._maxPitch===e)return;this._maxPitch=e;let t=this._unmodified;this.setPitch(Math.min(this.pitch,e)),this._unmodified=t}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get constrainOverride(){return this._constrainOverride}setConstrainOverride(e){void 0===e&&(e=null),this._constrainOverride!==e&&(this._constrainOverride=e,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new vl(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){var t,r,i,n,a,o,s,l,u;let c=xr(e,-180,180)*Math.PI/180;this._bearingInRadians!==c&&(this._unmodified=!1,this._bearingInRadians=c,this._calcMatrices(),this._rotationMatrix=Ls(),t=this._rotationMatrix,r=this._rotationMatrix,i=-this._bearingInRadians,n=r[0],a=r[1],o=r[2],s=r[3],l=Math.sin(i),u=Math.cos(i),t[0]=n*u+o*l,t[1]=a*u+s*l,t[2]=-(n*l)+o*u,t[3]=-(a*l)+s*u)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){let t=xt(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==t&&(this._unmodified=!1,this._pitchInRadians=t,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){let t=e/180*Math.PI;this._rollInRadians!==t&&(this._unmodified=!1,this._rollInRadians=t,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return xv(this._fovInRadians)}setFov(e){e=xt(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=xy(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){let t=this.applyConstrain(this._center,e).zoom;this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this._tileZoom=Math.max(0,Math.floor(t)),this._scale=xa(t),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(e){(e.lat!==this._center.lat||e.lng!==this._center.lng)&&(this._unmodified=!1,this._center=e,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,t){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=t,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this.constrainInternal(),this._calcMatrices()}resize(e,t,r=!0){this._width=e,this._height=t,r&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){var e,t;return(null==(e=this._latRange)?void 0:e.length)!==2||(null==(t=this._lngRange)?void 0:t.length)!==2?null:new FT([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-Mx,Mx])}getCameraQueryGeometry(e,t){if(1===t.length)return[t[0],e];{let{minX:r,minY:i,maxX:n,maxY:a}=D$.fromPoints(t).extend(e);return[new vl(r,i),new vl(n,i),new vl(n,a),new vl(r,a),new vl(r,i)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:r}=this.applyConstrain(this.center,this.zoom);this.setCenter(t),this.setZoom(r),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._pixelPerMeter=1/w7(this.center.lat)*this.worldSize,!this._width||!this._height)return;this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=vp(new Float64Array(16));vv(e,e,[this._width/2,-this._height/2,1]),vy(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,vv(e=vp(new Float64Array(16)),e,[1,-1,1]),vy(e,e,[-1,-1,0]),vv(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e;let t=this.fovInRadians/2;this._cameraToCenterDistance=.5/Math.tan(t)*this._height,this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,t,r,i){let n=void 0===r?this.bearing:r,a=i=void 0===i?this.pitch:i,{distanceToCenter:o,clampedElevation:s}=this._distanceToCenterFromAltElevationPitch(t,this.elevation,a),{x:l,y:u}=Tu(a,n),c=D0.fromLngLat(e,t),h=+w7(Tr(c.y)),d,f,p=0;do{if((p+=1)>10)break;let e=l*(f=o/h),t=u*f;h=1/(d=new D0(c.x+e,c.y+t)).meterInMercatorCoordinateUnits()}while(Math.abs(o-f*h)>1e-12);return{center:d.toLngLat(),elevation:s,zoom:xo(this.height/2/Math.tan(this.fovInRadians/2)/f/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e==0)return;let t=1/this.worldSize,r=1/w7(this.center.lat)*this.worldSize,i=D0.fromLngLat(this.center,this.elevation),n=i.x/t,a=i.y/t,o=i.z/t,s=this.pitch,{x:l,y:u,z:c}=Tu(s,this.bearing),h=this.cameraToCenterDistance,{distanceToCenter:d,clampedElevation:f}=this._distanceToCenterFromAltElevationPitch((o+h*c)/r,e,s),p=d*r,m=new D0((n+-(h*l)+l*p)*t,(a+-(h*u)+u*p)*t,0).toLngLat(),g=1/w7(m.lat),y=xo(this.height/2/Math.tan(this.fovInRadians/2)/d/g/this.tileSize);this._elevation=f,this._center=m,this.setZoom(y)}_distanceToCenterFromAltElevationPitch(e,t,r){let i=-Math.cos(xy(r)),n=e-t,a,o=t;return i*n>=0||.1>Math.abs(i)?o=e+(a=1e4)*i:a=-n/i,{distanceToCenter:a,clampedElevation:o}}getCameraPoint(){let e=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new vl(e*Math.sin(this.rollInRadians),e*Math.cos(this.rollInRadians)))}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];let t=e.canonical.z>=0?1<r}allowWorldCopies(){return!0}prepareNextFrame(){}},OT=wr([{name:"a_pos3d",type:"Int16",components:3}]),OA=class extends ML{constructor(e){super(),this._lastTilesetChange=Ll(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,t){this.tileManager.update(e,t),this._renderableTilesKeys=[];let r={},i=!1;for(let n of LH(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:t,calculateTileZoom:this.tileManager._source.calculateTileZoom}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.terrainRttPosMatrix32f=new Float32Array(16),Mo(n.terrainRttPosMatrix32f,0,Md,Md,0,0,1),this._tiles[n.key]=new FG(n,this.tileSize),this._lastTilesetChange=Ll(),i=!0);for(let e in this._tiles)r[e]||(this._tiles[e].releaseRTT(this.tileManager.map.painter),delete this._tiles[e],i=!0);return i}releaseRTT(e){for(let t in this._tiles){let r=this._tiles[t];(r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&r.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let t={};for(let r of this._renderableTilesKeys){let i=this._tiles[r].tileID,n=e.clone(),a=v0();if(i.canonical.equals(e.canonical))Mo(a,0,Md,Md,0,0,1);else if(i.canonical.isChildOf(e.canonical)){let t=i.canonical.z-e.canonical.z,r=i.canonical.x-(i.canonical.x>>t<>t<>t;Mo(a,0,o,o,0,0,1),vy(a,a,[-r*o,-n*o,0])}else{if(!e.canonical.isChildOf(i.canonical))continue;let t=e.canonical.z-i.canonical.z,r=e.canonical.x-(e.canonical.x>>t<>t<>t;Mo(a,0,Md,Md,0,0,1),vy(a,a,[r*o,n*o,0]),vv(a,a,[1/2**t,1/2**t,0])}n.terrainRttPosMatrix32f=new Float32Array(a),t[r]=n}return t}_getTerrainCoordsForTileRanges(e,t){let r={};for(let i of this._renderableTilesKeys){let n=this._tiles[i].tileID;if(!this._isWithinTileRanges(n,t))continue;let a=e.clone(),o=v0();if(n.canonical.z===e.canonical.z){let t=e.canonical.x-n.canonical.x+e.wrap*(1<e.canonical.z){let t=n.canonical.z-e.canonical.z,r=n.canonical.x-(n.canonical.x>>t<>t<>t),s=e.canonical.y-(n.canonical.y>>t),l=Md>>t;Mo(o,0,l,l,0,0,1),vy(o,o,[-r*l+a*Md,-i*l+s*Md,0])}else{let t=e.canonical.z-n.canonical.z,r=e.canonical.x-(e.canonical.x>>t<>t<>t)-n.canonical.x,s=(e.canonical.y>>t)-n.canonical.y,l=Md<n.maxzoom&&(a=n.maxzoom),a=n.minzoom&&!o?.dem;)o=this.findTileInCaches(e.scaledTo(a--).key);return o}findTileInCaches(e){let t=this.tileManager.getTileByID(e);return t||(t=this.tileManager._outOfViewCache.getByKey(e))}anyTilesAfterTime(e=Ll()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){let r=t[e.canonical.z];return!!r&&(e.wrap>r.minWrap||e.wrap=r.minTileXWrapped&&e.canonical.x<=r.maxTileXWrapped&&e.canonical.y>=r.minTileY&&e.canonical.y<=r.maxTileY)}},OM=Md*(1-1e-12),Ok=class{constructor(e,t,r,i="auto"){this._meshCache={},this.painter=e,this.tileManager=new OA(t),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this._terrainSkirtLength=i,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this._elevationSamplerCache=new Map}destroy(){for(let e in this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null)),this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,t,r,i=Md){let n=e.normalizeCoordinates(t,r,i);if(!n)return 0;let a=this.getElevationSampler(n.tileID);return a?a(n.x,n.y,i):0}getElevationForLngLatZoom(e,t){if(!Ae(t,e.wrap()))return 0;let{tileID:r,mercatorX:i,mercatorY:n}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getElevation(r,i%Md,n%Md,Md)}getElevationForLngLat(e,t){let r=this.getCoverageIndex();if(r){let t=D0.fromLngLat(e),i=Pd(r,this.exaggeration,t.x,t.y);if(i.demLoaded)return i.elevation}let i=LH(t,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),n=0;for(let e of i)e.canonical.z>n&&(n=Math.min(e.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(e,n)}getElevation(e,t,r,i=Md){return this.getDEMElevation(e,t,r,i)*this.exaggeration}resetElevationCache(){this._elevationSamplerCache.clear(),this._coverageIndex=void 0}getCoverageIndex(){return void 0===this._coverageIndex&&(this._coverageIndex=this._buildCoverageIndex()),this._coverageIndex}_buildCoverageIndex(){let e=[],t=new Map,r=0,i=0;for(let n of this.tileManager.getRenderableTiles()){if(!n)continue;let{canonical:a,wrap:o}=n.tileID;e.includes(a.z)||e.push(a.z);let s=this.getElevationSampler(n.tileID);t.set(`${o}/${a.z}/${a.x}/${a.y}`,s);let{minElevation:l,maxElevation:u}=this.getMinMaxElevation(n.tileID);r=Math.min(r,l??0),i=Math.max(i,u??0)}return 0===t.size?null:(e.sort((e,t)=>t-e),{zooms:e,samplerPerTile:t,minElevation:r-10,maxElevation:i+10})}getElevationSampler(e){let t=e.key,r=this._elevationSamplerCache.get(t);if(r)return r;let i=this.tileManager.getSourceTile(e,!0),n=i?.dem;if(!i||!n)return null;let a=this._getDEMTileMatrix(e,i),o=a[0]*n.dim,s=a[5]*n.dim,l=a[12]*n.dim,u=a[13]*n.dim,c=(e,t,r)=>{let i=8192===r?1:Md/r;return n.sampleBilinear(e*i*o+l,t*i*s+u)};return this._elevationSamplerCache.set(t,c),c}_getDEMTileMatrix(e,t){var r,i;let n=`${t.tileID.key}/${e.key}`,a=this._demMatrixCache.get(n);if(a)return a;let o=this.tileManager.getSource().maxzoom,s=e.canonical.z-t.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=o?s=e.canonical.z-o:xd("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let l=e.canonical.x-(e.canonical.x>>s<>s<0,i=r&&0===e.canonical.y,n=r&&e.canonical.y===(1<{t=xt(+t,this.minZoom,this.maxZoom);let r={center:new DJ(e.lng,e.lat),zoom:t},i=this._helper._lngRange;this._helper._renderWorldCopies||null!==i||(i=[-179.9999999999,180-1e-10]);let n=this.tileSize*xa(r.zoom),a=0,o=n,s=0,l=n,u=0,c=0,{x:h,y:d}=this.size;if(this._helper._latRange){let e=this._helper._latRange;a=Te(e[1])*n,(o=Te(e[0])*n)-ao&&(g=o-e)}if(i){let e=(s+l)/2,t=f;this._helper._renderWorldCopies&&(t=xr(f,e-n/2,e+n/2));let r=h/2;t-rl&&(m=l-r)}return(void 0!==m||void 0!==g)&&(r.center=Ta(n,new vl(m??f,g??p)).wrap()),r},this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new O_({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._coveringTilesDetailsProvider=new Ow}clone(){let t=new e;return t.apply(this,!1),t}apply(e,t,r){this._helper.apply(e,t,r)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(e){let t=[new Ii(0,e)];if(this._helper._renderWorldCopies){let r=this.screenPointToMercatorCoordinate(new vl(0,0)),i=this.screenPointToMercatorCoordinate(new vl(this._helper._width,0)),n=this.screenPointToMercatorCoordinate(new vl(this._helper._width,this._helper._height)),a=this.screenPointToMercatorCoordinate(new vl(0,this._helper._height)),o=Math.floor(Math.min(r.x,i.x,n.x,a.x)),s=Math.floor(Math.max(r.x,i.x,n.x,a.x));for(let r=o-1;r<=s+1;r++)0!==r&&t.push(new Ii(r,e))}return t}getCameraFrustum(){return FW.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){let t=this.screenPointToLocation(this.centerPoint,e),r=e?e.getElevationForLngLat(t,this):0;this._helper.recalculateZoomAndCenter(r)}setLocationAtPoint(e,t,r=this.elevation){let i=r-this.elevation,n=this.screenPointToMercatorCoordinateAtZ(t,i),a=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,0),o=D0.fromLngLat(e),s=new D0(o.x-(n.x-a.x),o.y-(n.y-a.y));this.setCenter(s?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,t){return t?this.coordinatePoint(D0.fromLngLat(e),t.getElevationForLngLat(e,this),this._pixelMatrix3D):this.coordinatePoint(D0.fromLngLat(e))}screenPointToLocation(e,t){var r;return null==(r=this.screenPointToMercatorCoordinate(e,t))?void 0:r.toLngLat()}screenPointToLocationAtElevation(e,t){var r;return null==(r=this.screenPointToMercatorCoordinateAtZ(e,t-this.elevation))?void 0:r.toLngLat()}screenPointToMercatorCoordinate(e,t){if(t){let r=this.screenTerrainPointToMercatorCoordinate(e,t);if(null!=r)return r}return this.screenPointToMercatorCoordinateAtZ(e)}screenTerrainPointToMercatorCoordinate(e,t){let r=t.getCoverageIndex();if(!r)return null;let{near:i,far:n}=this.getRaySegmentFromPixel(e),a=this.worldSize,o=n[0]-i[0],s=n[1]-i[1],l=n[2]-i[2],u={index:r,exaggeration:t.exaggeration,near:i,dx:o,dy:s,dz:l,worldSize:a},c=0,h=1;if(0===l){if(i[2]>r.maxElevation||i[2](h=Math.min(h,Math.max(e,t))))return null}let d=Math.hypot(o,s),f=xt(Math.ceil(d*(h-c)/4),1,512),p=0,m=!Pg(u,0);for(let e=0;e<=f;e++){let t=c+(h-c)*e/f;if(m){if(Pg(u,t)){let{lo:e,hi:r}=Pp(u,Pg,p,t,.001/d),n=Pm(u,e),c=Pm(u,r),h=i[2]+e*l-n.elevation,f=i[2]+r*l-c.elevation,m=n.covered&&h>f?xt(e+h*(r-e)/(h-f),e,r):r;return new D0((i[0]+m*o)/a,(i[1]+m*s)/a,Pm(u,m).elevation)}}else m=!Pg(u,t);p=t}return null}getRaySegmentFromPixel(e){let t=[e.x,e.y,0,1],r=[e.x,e.y,1,1];vV(t,t,this._pixelMatrixInverse),vV(r,r,this._pixelMatrixInverse);let i=t[3],n=r[3],a=this.elevation;return{near:[t[0]/i,t[1]/i,t[2]/i+a],far:[r[0]/n,r[1]/n,r[2]/n+a]}}screenPointToMercatorCoordinateAtZ(e,t){let r=t||0,{near:i,far:n}=this.getRaySegmentFromPixel(e),a=i[2]===n[2]?0:(r+this.elevation-i[2])/(n[2]-i[2]);return new D0(kv.number(i[0],n[0],a)/this.worldSize,kv.number(i[1],n[1],a)/this.worldSize,r)}coordinatePoint(e,t=0,r=this._pixelMatrix){let i=[e.x*this.worldSize,e.y*this.worldSize,t,1];return vV(i,i,r),new vl(i[0]/i[3],i[1]/i[3])}getBounds(){let e=Math.max(0,this._helper._height/2-To(this));return new FT().extend(this.screenPointToLocation(new vl(0,e))).extend(this.screenPointToLocation(new vl(this._helper._width,e))).extend(this.screenPointToLocation(new vl(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new vl(0,this._helper._height)))}isPointOnMapSurface(e,t){return t?null!=this.screenTerrainPointToMercatorCoordinate(e,t):e.y>this.height/2-To(this)}calculatePosMatrix(e,t=!1,r=!1){var i;let n=null!=(i=e.key)?i:At(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),a=t?this._alignedPosMatrixCache:this._posMatrixCache;if(a.has(n)){let e=a.get(n);return r?e.f32:e.f64}let o=Ts(e,this.worldSize);vg(o,t?this._alignedProjMatrix:this._viewProjMatrix,o);let s={f64:o,f32:new Float32Array(o)};return a.set(n,s),r?s.f32:s.f64}calculateFogMatrix(e){let t=e.key,r=this._fogMatrixCacheF32;if(r.has(t))return r.get(t);let i=Ts(e,this.worldSize);return vg(i,this._fogMatrix,i),r.set(t,new Float32Array(i)),r.get(t)}calculateCenterFromCameraLngLatAlt(e,t,r,i){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,r,i)}calculateCameraOptionsFromTo(e,t,r,i){let n=D0.fromLngLat(e,t),a=D0.fromLngLat(r,i),o=a.x-n.x,s=a.y-n.y,l=a.z-n.z,u=Math.hypot(o,s,l);if(0===u)throw Error("Can't calculate camera options with same From and To");let c=Math.hypot(o,s),h=xo(this.cameraToCenterDistance/u/this.tileSize),d=xv(Math.atan2(o,-s)),f=xv(Math.acos(c/u));return f=l<0?90-f:90+f,{center:a.toLngLat(),elevation:i,zoom:h,pitch:f,bearing:d}}_calculateNearFarZIfNeeded(e,t,r){if(!this._helper.autoCalculateNearFarZ)return;let i=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),n=e-i*this._helper._pixelPerMeter/Math.cos(t),a=i<0?n:e,o=Math.PI/2+this.pitchInRadians,s=xy(this.fov)*(Math.abs(Math.cos(xy(this.roll)))*this.height+Math.abs(Math.sin(xy(this.roll)))*this.width)/this.height*(.5+r.y/this.height),l=Math.sin(s)*a/Math.sin(xt(Math.PI-o-s,.01,Math.PI-.01)),u=To(this),c=Math.atan(u/this._helper.cameraToCenterDistance),h=xy(90-D1),d=c>h?2*c*(.5+r.y/(2*u)):h,f=Math.min(l,Math.sin(d)*a/Math.sin(xt(Math.PI-o-d,.01,Math.PI-.01)));this._helper._farZ=(Math.cos(Math.PI/2-t)*f+a)*1.01,this._helper._nearZ=this._helper._height/50}_calcMatrices(){var e,t;let r,i=this.centerOffset,n=Tn(this.worldSize,this.center),a=n.x,o=n.y,s=xy(Math.min(this.pitch,D1)),l=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(s));this._calculateNearFarZIfNeeded(l,s,i),r=new Float64Array(16),Ma(r,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),e=this._invProjMatrix,t=r,e[0]=1/t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1/t[5],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=1/t[14],e[12]=0,e[13]=0,e[14]=-1,e[15]=t[10]/t[14],r[8]=-(2*i.x)/this._helper._width,r[9]=2*i.y/this._helper._height,this._projectionMatrix=vf(r),vv(r,r,[1,-1,1]),vy(r,r,[0,0,-this._helper.cameraToCenterDistance]),v_(r,r,-this.rollInRadians),vx(r,r,this.pitchInRadians),v_(r,r,-this.bearingInRadians),vy(r,r,[-a,-o,0]),this._mercatorMatrix=vv([],r,[this.worldSize,this.worldSize,this.worldSize]),vv(r,r,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=vg(new Float64Array(16),this.clipSpaceToPixelsMatrix,r),vy(r,r,[0,0,-this.elevation]),this._viewProjMatrix=r,this._invViewProjMatrix=vm([],r);let u=[0,0,-1,1];vV(u,u,this._invViewProjMatrix),this._cameraPosition=[u[0]/u[3],u[1]/u[3],u[2]/u[3]],this._fogMatrix=new Float64Array(16),Ma(this._fogMatrix,this.fovInRadians,this.width/this.height,l,this._helper._farZ),this._fogMatrix[8]=-(2*i.x)/this.width,this._fogMatrix[9]=2*i.y/this.height,vv(this._fogMatrix,this._fogMatrix,[1,-1,1]),vy(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),v_(this._fogMatrix,this._fogMatrix,-this.rollInRadians),vx(this._fogMatrix,this._fogMatrix,this.pitchInRadians),v_(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),vy(this._fogMatrix,this._fogMatrix,[-a,-o,0]),vv(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),vy(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=vg(new Float64Array(16),this.clipSpaceToPixelsMatrix,r);let c=this._helper._width%2/2,h=this._helper._height%2/2,d=Math.cos(this.bearingInRadians),f=Math.sin(-this.bearingInRadians),p=a-Math.round(a)+d*c+f*h,m=o-Math.round(o)+d*h+f*c,g=new Float64Array(r);if(vy(g,g,[p>.5?p-1:p,m>.5?m-1:m,0]),this._alignedProjMatrix=g,!(r=vm(new Float64Array(16),this._pixelMatrix)))throw Error("failed to invert matrix");this._pixelMatrixInverse=r,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let e=this.screenPointToMercatorCoordinate(new vl(0,0)),t=[e.x*this.worldSize,e.y*this.worldSize,0,1];return vV(t,t,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this.cameraToCenterDistance/this.pixelsPerMeter+this.elevation}getCameraLngLat(){let e=1/w7(this.center.lat)*this.worldSize,t=this._helper.cameraToCenterDistance/e;return Tl(this.center,this.elevation,this.pitch,this.bearing,t).toLngLat()}lngLatToCameraDepth(e,t){let r=D0.fromLngLat(e),i=[r.x*this.worldSize,r.y*this.worldSize,t,1];return vV(i,i,this._viewProjMatrix),i[2]/i[3]}getProjectionData(e){let{overscaledTileID:t,aligned:r,applyTerrainMatrix:i}=e,n=this._helper.getMercatorTileCoordinates(t),a=t?this.calculatePosMatrix(t,r,!0):null,o;return{mainMatrix:o=t?.terrainRttPosMatrix32f&&i?t.terrainRttPosMatrix32f:a||v2(),tileMercatorCoords:n,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:o,clipAntimeridian:!1}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,t,r){return 1}transformLightDirection(e){return vM(e)}getRayDirectionFromPixel(e){throw Error("Not implemented.")}projectTileCoordinates(e,t,r,i){let n=this.calculatePosMatrix(r),a;null==i?Pr(a=[e,t,0,1],a,n):vV(a=[e,t,i,1],a,n);let o=a[3];return{point:new vl(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}populateCache(e){for(let t of e)this.calculatePosMatrix(t)}getProjectionDataForCustomLayer(e=!0){let t=new In(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:t,applyGlobeMatrix:e}),i=Ts(t,this.worldSize);vg(i,this._viewProjMatrix,i);let n=[Md,Md,this.worldSize/this._helper.pixelsPerMeter],a=v0();return vv(a,i,n),f(d({},r),{tileMercatorCoords:[0,0,1,1],fallbackMatrix:a,mainMatrix:a})}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}},OD=class{get useGlobeControls(){return!1}handlePanInertia(e,t){let r=e.mag(),i=Math.abs(To(t));return{easingOffset:e.mult(Math.min(.75*i/r,1)),easingCenter:t.center}}handleMapControlsRollPitchBearingZoom(e,t){e.bearingDelta&&t.setBearing(t.bearing+e.bearingDelta),e.pitchDelta&&t.setPitch(t.pitch+e.pitchDelta),e.rollDelta&&t.setRoll(t.roll+e.rollDelta),e.zoomDelta&&t.setZoom(t.zoom+e.zoomDelta)}handleMapControlsPan(e,t,r){.01>e.around.distSqr(t.centerPoint)||t.setLocationAtPoint(r,e.around,e.aroundElevation)}cameraForBoxAndBearing(e,t,r,i,n){return Px(e,t,r,i,n)}handleJumpToCenterZoom(e,t){let r=void 0===t.zoom?e.zoom:+t.zoom;e.zoom!==r&&e.setZoom(+t.zoom),void 0!==t.center&&e.setCenter(DJ.convert(t.center))}handleEaseTo(e,t){let r=e.zoom,i=e.padding,n={roll:e.roll,pitch:e.pitch,bearing:e.bearing},a={roll:void 0===t.roll?e.roll:t.roll,pitch:void 0===t.pitch?e.pitch:t.pitch,bearing:void 0===t.bearing?e.bearing:t.bearing},o=void 0!==t.zoom,s=!e.isPaddingEqual(t.padding),l=!1,u=o?+t.zoom:e.zoom,c=e.centerPoint.add(t.offsetAsPoint),h=e.screenPointToLocation(c),{center:d,zoom:f}=e.applyConstrain(DJ.convert(t.center||h),u??r);Pc(e,d);let p=Tn(e.worldSize,h),m=Tn(e.worldSize,d).sub(p),g=xa(f-r);return{easeFunc:o=>{if(l&&e.setZoom(kv.number(r,f,o)),xx(n,a)||Pv({startEulerAngles:n,endEulerAngles:a,tr:e,k:o,useSlerp:n.roll!=a.roll}),s&&(e.interpolatePadding(i,t.padding,o),c=e.centerPoint.add(t.offsetAsPoint)),t.around)e.setLocationAtPoint(t.around,t.aroundPoint);else{let t=xa(e.zoom-r),i=(f>r?Math.min(2,g):Math.max(.5,g))**(1-o),n=Ta(e.worldSize,p.add(m.mult(o*i)).mult(t));e.setLocationAtPoint(e.renderWorldCopies?n.wrap():n,c)}},isZooming:l=f!==r,elevationCenter:d}}handleFlyTo(e,t){let r=void 0!==t.zoom,i=e.zoom,n=e.applyConstrain(DJ.convert(t.center||t.locationAtOffset),r?+t.zoom:i),a=n.center,o=n.zoom;Pc(e,a);let s=e.worldSize,l=Tn(s,t.locationAtOffset),u=Tn(s,a).sub(l),c=u.mag(),h=xa(o-i),d=Math.min(Math.max(void 0===t.minZoom?e.minZoom:+t.minZoom,e.minZoom),i,o),f=e.applyConstrain(a,d).zoom;return{easeFunc:(t,r,n,c)=>{e.setZoom(1===t?o:i+xo(r));let h=1===t?a:Ta(s,l.add(u.mult(n)));e.setLocationAtPoint(e.renderWorldCopies?h.wrap():h,c)},scaleOfZoom:h,targetCenter:a,scaleOfMinZoom:xa(f-i),pixelPathLength:c}}},OI=new DP({fill:new DI(128,2),line:new DI(512,0),tile:new DI(128,32),stencil:new DI(128,1),circle:3}),OL=class{constructor(){this._tileMeshCache={}}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return Ov.projectionGlobe}get vertexShaderPreludeCode(){return Ov.projectionMercator.vertexSource}get subdivisionGranularity(){return OI}get useGlobeControls(){return!0}destroy(){}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?"b":""}${e.extendToNorthPole?"n":""}${e.extendToSouthPole?"s":""}`}getMeshFromTileID(e,t,r,i,n){let a=("stencil"===n?OI.stencil:OI.tile).getGranularityForZoomLevel(t.z),o=0===t.y&&i,s=t.y===(1<0}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}getMeshFromTileID(e,t,r,i,n){return this.currentProjection.getMeshFromTileID(e,t,r,i,n)}setProjection(e){this._transitionable.setValue("type",e?.type||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}},Oz=.98*Math.PI,OF=class{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;let e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,t,r,i){let n=`${e.z}_${e.x}_${e.y}_${i?.terrain?"t":""}_${Math.round(r)}`,a=this._cache.get(n);if(a)return a;let o=this._cachePrevious.get(n);if(o)return this._cache.set(n,o),o;let s=this._boundingVolumeFactory(e,t,r,i);return this._cache.set(n,s),this._hadAnyChanges=!0,s}},OO=class e{constructor(e,t,r,i){this.min=r,this.max=i,this.points=e,this.planes=t}static fromAabb(t,r){let i=[];for(let e=0;e<8;e++)i.push([(1&e)==1?r[0]:t[0],(e>>1&1)==1?r[1]:t[1],(e>>2&1)==1?r[2]:t[2]]);return new e(i,[[-1,0,0,r[0]],[1,0,0,-t[0]],[0,-1,0,r[1]],[0,1,0,-t[1]],[0,0,-1,r[2]],[0,0,1,-t[2]]],t,r)}static fromCenterSizeAngles(t,r,i){let n=vq([],i[0],i[1],i[2]),a=vF([],[r[0],0,0],n),o=vF([],[0,r[1],0],n),s=vF([],[0,0,r[2]],n),l=[...t],u=[...t];for(let e=0;e<8;e++)for(let r=0;r<3;r++){let i=t[r]+a[r]*((1&e)==1?1:-1)+o[r]*((e>>1&1)==1?1:-1)+s[r]*((e>>2&1)==1?1:-1);l[r]=Math.min(l[r],i),u[r]=Math.max(u[r],i)}let c=[];for(let e=0;e<8;e++){let r=[...t];vE(r,r,vC([],a,(1&e)==1?1:-1)),vE(r,r,vC([],o,(e>>1&1)==1?1:-1)),vE(r,r,vC([],s,(e>>2&1)==1?1:-1)),c.push(r)}return new e(c,[[...a,-vP(a,c[0])],[...o,-vP(o,c[0])],[...s,-vP(s,c[0])],[-a[0],-a[1],-a[2],-vP(a,c[7])],[-o[0],-o[1],-o[2],-vP(o,c[7])],[-s[0],-s[1],-s[2],-vP(s,c[7])]],l,u)}intersectsFrustum(e){let t=!0,r=this.points.length,i=this.planes.length,n=e.planes.length,a=e.points.length;for(let i=0;i=0&&a++}if(0===a)return 0;a=0&&i++}if(0===i)return 0}return 1}intersectsPlane(e){let t=this.points.length,r=0;for(let i=0;i=0&&r++}return r===t?2:+(0!==r)}},OR=class{constructor(){this._boundingVolumeCache=new OF(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,t,r,i){let n=1<4}allowWorldCopies(){return!1}getTileBoundingVolume(e,t,r,i){return this._boundingVolumeCache.getTileBoundingVolume(e,t,r,i)}_computeTileBoundingVolume(e,t,r,i){var n,a;let o=Math.min(0,r),s=Math.max(0,r);if(i?.terrain){let r=new In(e.z,t,e.z,e.x,e.y),l=i.terrain.getMinMaxElevation(r);o=null!=(n=l.minElevation)?n:o,s=Math.max(null!=(a=l.maxElevation)?a:s,s)}if(o/=DK,s/=DK,o+=1,s+=1,e.z<=0)return OO.fromAabb([-s,-s,-s],[s,s,s]);if(1===e.z)return OO.fromAabb([0===e.x?-s:0,0===e.y?0:-s,-s],[0===e.x?0:s,0===e.y?s:0,s]);{let t=[P_(0,0,e.x,e.y,e.z),P_(Md,0,e.x,e.y,e.z),P_(Md,Md,e.x,e.y,e.z),P_(0,Md,e.x,e.y,e.z)],r=[];for(let e of t)r.push(vC([],e,s));if(s!==o)for(let e of t)r.push(vC([],e,o));0===e.y&&r.push([0,1,0]),e.y===(1<=(1<{let r=xt(e.lat,-Mx,Mx),i=xt(+t,this.minZoom+PE(0,r),this.maxZoom);return{center:new DJ(e.lng,r),zoom:i}},this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new O_({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._coveringTilesDetailsProvider=new OR}clone(){let t=new e;return t.apply(this,!1),t}apply(e,t){this._helper.apply(e,t)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixF64}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let e=vQ();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){let{overscaledTileID:t,applyGlobeMatrix:r}=e,i=this._helper.getMercatorTileCoordinates(t);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:i,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!r,fallbackMatrix:this._globeViewProjMatrix32f,clipAntimeridian:t?.canonical.z===0}}_computeClippingPlane(e){let t=this.pitchInRadians,r=this.cameraToCenterDistance/e,i=Math.sin(t)*r,n=Math.cos(t)*r+1,a=1/Math.sqrt(i*i+n*n)*1,o=-i,s=n,l=Math.sqrt(o*o+s*s),u=[0,o/=l,s/=l];vB(u,u,[0,0,0],-this.bearingInRadians),vO(u,u,[0,0,0],-1*this.center.lat*Math.PI/180),vR(u,u,[0,0,0],this.center.lng*Math.PI/180);let c=1/vk(u);return vC(u,u,c),[...u,-a*c]}isLocationOccluded(e){return!this.isSurfacePointVisible(Pw(e))}transformLightDirection(e){let t=this._helper._center.lng*Math.PI/180,r=this._helper._center.lat*Math.PI/180,i=Math.cos(r),n=[Math.sin(t)*i,Math.sin(r),Math.cos(t)*i],a=[n[2],0,-n[0]],o=[0,0,0];vz(o,a,n),vL(a,a),vL(o,o);let s=[a[0]*e[0]+o[0]*e[1]+n[0]*e[2],a[1]*e[0]+o[1]*e[1]+n[1]*e[2],a[2]*e[0]+o[2]*e[1]+n[2]*e[2]],l=[0,0,0];return vL(l,s),l}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,t,r){var i,n,a;let o=Ti(e,t,r.canonical),s=(i=o.x,n=o.y,[((i*Math.PI*2+Math.PI)%(a=2*Math.PI)+a)%a,2*Math.atan(Math.exp(Math.PI-n*Math.PI*2))-.5*Math.PI]);return this.getCircleRadiusCorrection()/Math.cos(s[1])}projectTileCoordinates(e,t,r,i){let n,a=r.canonical,o=P_(e,t,a.x,a.y,a.z),s=1+(i??0)/DK,l=o[0]*s,u=o[1]*s,c=o[2]*s,h=[l,u,c,1];if(vV(h,h,this._globeViewProjMatrixF64),s<=1){let e=this._cachedClippingPlane;n=e[0]*o[0]+e[1]*o[1]+e[2]*o[2]+e[3]<0}else n=this._isLineOfSightBlocked(l,u,c);return{point:new vl(h[0]/h[3],h[1]/h[3]),signedDistanceFromCamera:h[3],isOccluded:n}}_isLineOfSightBlocked(e,t,r){let i=this._cameraPosition,n=e-i[0],a=t-i[1],o=r-i[2],s=n*n+a*a+o*o;if(0===s)return!1;let l=xt(-(i[0]*n+i[1]*a+i[2]*o)/s,0,1),u=i[0]+l*n,c=i[1]+l*a,h=i[2]+l*o;return u*u+c*c+h*h<1}_calcMatrices(){let e=PT(this.worldSize,this.center.lat),t=v0();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*e),Ma(t,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let r=this.centerOffset;t[8]=-(2*r.x)/this._helper._width,t[9]=2*r.y/this._helper._height,this._projectionMatrix=vf(t),this._globeProjMatrixInverted=v0(),vm(this._globeProjMatrixInverted,t),vy(t,t,[0,0,-this.cameraToCenterDistance]),v_(t,t,this.rollInRadians),vx(t,t,-this.pitchInRadians),v_(t,t,this.bearingInRadians),vy(t,t,[0,0,-e]);let i=vQ();i[0]=e,i[1]=e,i[2]=e,vx(t,t,this.center.lat*Math.PI/180),vb(t,t,-this.center.lng*Math.PI/180),vv(t,t,i),this._globeViewProjMatrixF64=t,this._globeViewProjMatrix32f=new Float32Array(t),this._globeViewProjMatrixF64Inverted=v0(),vm(this._globeViewProjMatrixF64Inverted,t);let n=vQ();this._cameraPosition=vQ(),this._cameraPosition[2]=this.cameraToCenterDistance/e,vB(this._cameraPosition,this._cameraPosition,n,-this.rollInRadians),vO(this._cameraPosition,this._cameraPosition,n,this.pitchInRadians),vB(this._cameraPosition,this._cameraPosition,n,-this.bearingInRadians),vE(this._cameraPosition,this._cameraPosition,[0,0,1]),vO(this._cameraPosition,this._cameraPosition,n,-this.center.lat*Math.PI/180),vR(this._cameraPosition,this._cameraPosition,n,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);let a=vf(this._globeViewProjMatrixF64Inverted);vv(a,a,[1,1,-1]),this._cachedFrustum=FW.fromInvProjectionMatrix(a,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(e){xd("calculateFogMatrix is not supported on globe projection.");let t=v0();return vp(t),t}getVisibleUnwrappedCoordinates(e){return[new Ii(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){e?xd("terrain is not fully supported on vertical perspective projection."):this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return(vk(this._cameraPosition)-1)*DK}getCameraLngLat(){let e=vQ();return vL(e,this._cameraPosition),PM(e)}lngLatToCameraDepth(e,t){let r=Pw(e);vC(r,r,1+t/DK);let i=vJ();return vV(i,[r[0],r[1],r[2],1],this._globeViewProjMatrixF64),i[2]/i[3]}populateCache(e){}getBounds(){let e=.5*this.width,t=.5*this.height,r=[new vl(0,0),new vl(e,0),new vl(this.width,0),new vl(this.width,t),new vl(this.width,this.height),new vl(e,this.height),new vl(0,this.height),new vl(0,t)],i=[];for(let e of r)i.push(this.unprojectScreenPoint(e));let n=0,a=0,o=0,s=0,l=this.center;for(let e of i){let t=v8(l.lng,e.lng),r=v8(l.lat,e.lat);tn&&(n=t),ro&&(o=r)}let u=[l.lng+a,l.lat+s,l.lng+n,l.lat+o];return this.isSurfacePointOnScreen([0,1,0])&&(u[3]=90,u[0]=-180,u[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(u[1]=-90,u[0]=-180,u[2]=180),new FT(u)}calculateCenterFromCameraLngLatAlt(e,t,r,i){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,r,i)}calculateCameraOptionsFromTo(e,t,r,i){var n,a,o;let s=DJ.convert(r),l=Pw(DJ.convert(e));vC(l,l,1+t/DK);let u=Pw(s),c=vC(vQ(),u,1+i/DK),h=vD(vQ(),l,u),d=vk(h);if(d<1e-12||(n=c[0]-l[0],1e-12>Math.sqrt(n*n+(a=c[1]-l[1])*a+(o=c[2]-l[2])*o)))throw Error("Can't calculate camera options with same From and To");let f=vQ();vR(h,h,f,-xy(s.lng)),vO(h,h,f,xy(s.lat));let p=xv(Math.acos(xt(h[2]/d,-1,1))),m=Math.hypot(h[0],h[1])<1e-9*d?this.bearing:xv(Math.atan2(-h[0],-h[1]));return{center:s,elevation:i,zoom:xo(this.cameraToCenterDistance/d/PT(this.tileSize,s.lat)),pitch:p,bearing:m}}setLocationAtPoint(e,t,r){let i=Pw(this.unprojectScreenPoint(t)),n=Pw(e),a=vQ();a[0]=0,a[1]=0,a[2]=0;let o=vQ();vR(o,i,a,-this.center.lng*Math.PI/180),vO(o,o,a,this.center.lat*Math.PI/180);let s=n[0]*n[0]+n[2]*n[2],l=o[0]*o[0];if(s=-g&&f<=g,v=m>=-g&&m<=g,x,b;if(y&&v){let e=this.center.lng*Math.PI/180,t=this.center.lat*Math.PI/180;v7(c,e)+v7(f,t)=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;let t=vJ();return vV(t,[...e,1],this._globeViewProjMatrixF64),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3],t[0]>-1&&t[0]<1&&t[1]>-1&&t[1]<1&&t[2]>-1&&t[2]<1}unprojectScreenPoint(e){var t,r;let i,n,a,o=this._cameraPosition,s=this.getRayDirectionFromPixel(e),l=PI(o,s);if(l){let e=vQ();vE(e,o,[s[0]*l.tMin,s[1]*l.tMin,s[2]*l.tMin]);let t=vQ();return vL(t,e),PM(t)}let u=this._cachedClippingPlane,c=u[0]*s[0]+u[1]*s[1]+u[2]*s[2],h=-v5(u,o)/c,d=vQ();if(h>0)vE(d,o,[s[0]*h,s[1]*h,s[2]*h]);else{let e=vQ();vE(e,o,[2*s[0],2*s[1],2*s[2]]);let t=v5(this._cachedClippingPlane,e);Ms(d,e,[this._cachedClippingPlane[0]*t,this._cachedClippingPlane[1]*t,this._cachedClippingPlane[2]*t])}let f=((i=vQ())[0]=-(u[0]*u[3]),i[1]=-(u[1]*u[3]),i[2]=-(u[2]*u[3]),{center:i,radius:Math.sqrt(1-u[3]*u[3])});return PM((t=f.center,r=f.radius,n=vQ(),Ms(n,d,t),vI(a=vQ(),t,n,r/Ml(n)),a))}getProjectionDataForCustomLayer(e=!0){let t=this.getProjectionData({overscaledTileID:new In(0,0,0,0,0),applyGlobeMatrix:e});return t.tileMercatorCoords=[0,0,1,1],t}getFastPathSimpleProjectionMatrix(e){}},Oj=class e{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,r){this._helper.interpolatePadding(e,t,r)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,r=!0){this._helper.resize(e,t,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(e){this._globeness=e,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(e){this._globeness=1,this.defaultConstrain=(e,t)=>this.currentTransform.defaultConstrain(e,t),this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new O_({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._globeness=1,this._mercatorTransform=new OE,this._verticalPerspectiveTransform=new OB}clone(){let t=new e;return t._globeness=this._globeness,t.apply(this,!1),t}apply(e,t){this._helper.apply(e,t),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(e){let t=this._mercatorTransform.getProjectionData(e),r=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?r.mainMatrix:t.mainMatrix,clippingPlane:r.clippingPlane,tileMercatorCoords:r.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:t.fallbackMatrix,clipAntimeridian:r.clipAntimeridian}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){var e,t,r;return e=this._mercatorTransform.getPixelScale(),t=this._verticalPerspectiveTransform.getPixelScale(),e*(1-(r=this._globeness))+t*r}getCircleRadiusCorrection(){var e,t,r;return e=this._mercatorTransform.getCircleRadiusCorrection(),t=this._verticalPerspectiveTransform.getCircleRadiusCorrection(),e*(1-(r=this._globeness))+t*r}getPitchedTextCorrection(e,t,r){var i;let n=this._mercatorTransform.getPitchedTextCorrection(e,t,r),a=this._verticalPerspectiveTransform.getPitchedTextCorrection(e,t,r);return n*(1-(i=this._globeness))+a*i}projectTileCoordinates(e,t,r,i){return this.currentTransform.projectTileCoordinates(e,t,r,i)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this.currentTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this.currentTransform.getCameraAltitude()}getCameraLngLat(){return this.currentTransform.getCameraLngLat()}lngLatToCameraDepth(e,t){return this.currentTransform.lngLatToCameraDepth(e,t)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(e,t,r,i){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,r,i)}calculateCameraOptionsFromTo(e,t,r,i){return this.currentTransform.calculateCameraOptionsFromTo(e,t,r,i)}setLocationAtPoint(e,t,r){if(!this.isGlobeRendering){this._mercatorTransform.setLocationAtPoint(e,t,r),this.apply(this._mercatorTransform,!1);return}this._verticalPerspectiveTransform.setLocationAtPoint(e,t,r),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(e,t){return this.currentTransform.locationToScreenPoint(e,t)}screenPointToMercatorCoordinate(e,t){return this.currentTransform.screenPointToMercatorCoordinate(e,t)}screenTerrainPointToMercatorCoordinate(e,t){return this.currentTransform.screenTerrainPointToMercatorCoordinate(e,t)}screenPointToLocation(e,t){return this.currentTransform.screenPointToLocation(e,t)}screenPointToLocationAtElevation(e,t){return this.currentTransform.screenPointToLocationAtElevation(e,t)}isPointOnMapSurface(e,t){return this.currentTransform.isPointOnMapSurface(e,t)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getProjectionDataForCustomLayer(e=!0){let t=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return t;let r=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return r.fallbackMatrix=t.mainMatrix,r.projectionTransition=this._globeness,r}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}},ON=class e{get useGlobeControls(){return!0}handlePanInertia(e,t){var r,i,n;let a,o,s,l,u=(a=e.rotate(t.bearingInRadians),o=t.zoom+PE(t.center.lat,0),r=1/PS(t.center.lat),i=1/PS(Math.min(Math.abs(t.center.lat),60)),s=r*(1-(n=v9(o,7,3,0,1)))+i*n,l=360/Pb({worldSize:t.worldSize,center:{lat:t.center.lat}}),new DJ(t.center.lng-a.x*l*s,xt(t.center.lat+a.y*l,-Mx,Mx)));return Math.abs(u.lng-t.center.lng)>180&&(u.lng=t.center.lng+179.5*Math.sign(u.lng-t.center.lng)),{easingCenter:u,easingOffset:new vl(0,0)}}handleMapControlsRollPitchBearingZoom(e,t){let r=e.around,i=t.screenPointToLocation(r);e.bearingDelta&&t.setBearing(t.bearing+e.bearingDelta),e.pitchDelta&&t.setPitch(t.pitch+e.pitchDelta),e.rollDelta&&t.setRoll(t.roll+e.rollDelta);let n=t.zoom;e.zoomDelta&&t.setZoom(t.zoom+e.zoomDelta);let a=t.zoom-n;if(0===a)return;let o=v8(t.center.lng,i.lng),s=o/(Math.abs(o/180)+1),l=v8(t.center.lat,i.lat),u=t.getRayDirectionFromPixel(r),c=t.cameraPosition,h=-1*vP(c,u),d=vQ();vE(d,c,[u[0]*h,u[1]*h,u[2]*h]);let f=vk(d),p=Math.exp(-(.5*Math.max(f-1-.3,0))),m=v9(f,.95,.999,0,1),g=Math.min(p,+(1-m)+v9(PT(t.worldSize,t.center.lat)/Math.min(t.width,t.height),.9,.5,1,.25)*m),y=(1-xa(-a))*g,v=t.center.lat,x=t.zoom,b=new DJ(t.center.lng+s*y,xt(t.center.lat+l*y,-Mx,Mx));t.setLocationAtPoint(i,r);let _=t.center,w=Math.max(v9(Math.abs(o),45,85,0,1),m)**.25,T=v8(_.lng,b.lng),A=v8(_.lat,b.lat);t.setCenter(new DJ(_.lng+T*w,_.lat+A*w).wrap()),t.setZoom(x+PE(v,t.center.lat))}handleMapControlsPan(e,t,r){e.panDelta&&function(e,t,r,i,n=!0){var a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b;let _,w,T,A,M,k,S,E,D,C,I,L,P,z,F=Pk(e,r),O=t;if(i)O=Pk(e,r.sub(i));else if(!e.isPointOnMapSurface(r))return;let R=Pw(F),B=Pw(O),j=(a=e.center,o=e.bearing,vq(vJ(),-a.lng,-a.lat,o)),N=vz(vQ(),B,R),V=Math.sqrt(vP(N,N)),U=Math.acos(xt(vP(B,R),-1,1))/2,q=Math.sin(U),G=V?Mc(N[1]/V*q,-N[0]/V*q,N[2]/V*q,Math.cos(U)):Mc(0,0,0,1),{lng:H,lat:$,bearing:W}=(I=(s=vJ(),l=j[0],u=j[1],c=j[2],h=j[3],d=G[0],f=G[1],p=G[2],m=G[3],s[0]=l*m+h*d+u*p-c*f,s[1]=u*m+h*f+c*d-l*p,s[2]=c*m+h*p+l*f-u*d,s[3]=h*m-l*d-u*f-c*p,g=s)[0],L=g[1],P=g[2],{lng:-(180*Math.atan2(2*((z=g[3])*I+L*P),1-2*(I*I+L*L)))/Math.PI,lat:-(180*Math.asin(xt(2*(z*L-P*I),-1,1)))/Math.PI,bearing:180*Math.atan2(2*(z*P+I*L),1-2*(L*L+P*P))/Math.PI}),Y=e.center.lat,Z=e.zoom,X=xt($,-90,90),K=n?(y=e,v=r,x=i,b=H,_=y.center.lng,T=(w=y.center.lat)>=0?90:-90,A=y.locationToScreenPoint(new DJ(0,T)),M=v.x-A.x,k=v.y-A.y,E=(S=xt(1-(Mx-Math.abs(w))/12,0,1))*S*(3-2*S),D=((b-_+180)%360+360)%360-180,C=0,E>0&&x&&(C=(T>0?1:-1)*((M*x.y-k*x.x)/Math.max(M*M+k*k,400))*180/Math.PI),_+(1-E)*D+E*C):H;e.setCenter(new DJ(xr(K,-180,180),X)),n||e.setBearing(W),e.setZoom(Z+PE(Y,e.center.lat))}(t,r,t.isPointOnMapSurface(e.around)?e.around:t.centerPoint,e.panDelta)}cameraForBoxAndBearing(t,r,i,n,a){let o=Px(t,r,i,n,a),s=r.left/a.width*2-1,l=(a.width-r.right)/a.width*2-1,u=-(r.top/a.height*2)+1,c=-((a.height-r.bottom)/a.height*2)+1,h=0>v8(i.getWest(),i.getEast()),d=h?i.getEast():i.getWest(),f=h?i.getWest():i.getEast(),p=Math.max(i.getNorth(),i.getSouth()),m=Math.min(i.getNorth(),i.getSouth()),g=d+.5*v8(d,f),y=p+.5*v8(p,m),v=a.clone();v.setCenter(o.center),v.setBearing(o.bearing),v.setPitch(0),v.setRoll(0),v.setZoom(o.zoom);let x=v.modelViewProjectionMatrix,b=[Pw(i.getNorthWest()),Pw(i.getNorthEast()),Pw(i.getSouthWest()),Pw(i.getSouthEast()),Pw(new DJ(f,y)),Pw(new DJ(d,y)),Pw(new DJ(g,p)),Pw(new DJ(g,m))],_=Pw(o.center),w=1/0;for(let t of b)s<0&&(w=e.getLesserNonNegativeNonNull(w,e.solveVectorScale(t,_,x,"x",s))),l>0&&(w=e.getLesserNonNegativeNonNull(w,e.solveVectorScale(t,_,x,"x",l))),u>0&&(w=e.getLesserNonNegativeNonNull(w,e.solveVectorScale(t,_,x,"y",u))),c<0&&(w=e.getLesserNonNegativeNonNull(w,e.solveVectorScale(t,_,x,"y",c)));return Number.isFinite(w)&&0!==w?(o.zoom=Math.min(v.zoom+xo(w),t.maxZoom),o):void Py()}handleJumpToCenterZoom(e,t){let r=e.center.lat,i=e.applyConstrain(t.center?DJ.convert(t.center):e.center,e.zoom).center;e.setCenter(i.wrap());let n=void 0===t.zoom?e.zoom+PE(r,i.lat):+t.zoom;e.zoom!==n&&e.setZoom(n)}handleEaseTo(e,t){let r=e.zoom,i=e.center,n=e.padding,a={roll:e.roll,pitch:e.pitch,bearing:e.bearing},o={roll:void 0===t.roll?e.roll:t.roll,pitch:void 0===t.pitch?e.pitch:t.pitch,bearing:void 0===t.bearing?e.bearing:t.bearing},s=void 0!==t.zoom,l=!e.isPaddingEqual(t.padding),u=!1,c=t.center?DJ.convert(t.center):i,h=e.applyConstrain(c,r).center;Pc(e,h);let d=e.clone();d.setCenter(h),d.setZoom(s?+t.zoom:r+PE(i.lat,c.lat)),d.setBearing(t.bearing);let f=new vl(xt(e.centerPoint.x+t.offsetAsPoint.x,0,e.width),xt(e.centerPoint.y+t.offsetAsPoint.y,0,e.height));d.setLocationAtPoint(h,f);let p=(t.offset&&t.offsetAsPoint.mag())>0?d.center:h,m=s?+t.zoom:r+PE(i.lat,p.lat),g=r+PE(i.lat,0),y=m+PE(p.lat,0),v=v8(i.lng,p.lng),x=v8(i.lat,p.lat),b=xa(y-g);return{easeFunc:r=>{if(xx(a,o)||Pv({startEulerAngles:a,endEulerAngles:o,tr:e,k:r,useSlerp:a.roll!=o.roll}),l&&e.interpolatePadding(n,t.padding,r),t.around)xd("Easing around a point is not supported under globe projection."),e.setLocationAtPoint(t.around,t.aroundPoint);else{let t=PC(i,v,x,r*(y>g?Math.min(2,b):Math.max(.5,b))**(1-r));e.setCenter(t.wrap())}if(u){let t=kv.number(g,y,r)+PE(0,e.center.lat);e.setZoom(t)}},isZooming:u=m!==r,elevationCenter:p}}handleFlyTo(e,t){let r=void 0!==t.zoom,i=e.center,n=e.zoom,a=e.padding,o=!e.isPaddingEqual(t.padding),s=e.applyConstrain(DJ.convert(t.center||t.locationAtOffset),n).center,l=r?+t.zoom:e.zoom+PE(e.center.lat,s.lat),u=e.clone();u.setCenter(s),u.setZoom(l),u.setBearing(t.bearing);let c=new vl(xt(e.centerPoint.x+t.offsetAsPoint.x,0,e.width),xt(e.centerPoint.y+t.offsetAsPoint.y,0,e.height));u.setLocationAtPoint(s,c);let h=u.center;Pc(e,h);let d=Math.acos(vP(Pw(i),Pw(h)))/(2*Math.PI)*Pb(e),f=n+PE(i.lat,0),p=l+PE(h.lat,0),m=xa(p-f),g=Math.min(Math.max("number"==typeof t.minZoom?+t.minZoom:e.minZoom,e.minZoom)+PE(h.lat,0),f,p)+PE(0,h.lat),y=xa(e.applyConstrain(h,g).zoom+PE(h.lat,0)-f),v=v8(i.lng,h.lng),x=v8(i.lat,h.lat);return{easeFunc:(r,n,s,u)=>{let c=PC(i,v,x,s);o&&e.interpolatePadding(a,t.padding,r);let d=1===r?h:c;e.setCenter(d.wrap());let p=f+xo(n);e.setZoom(1===r?l:p+PE(0,d.lat))},scaleOfZoom:m,targetCenter:h,scaleOfMinZoom:y,pixelPathLength:d}}static solveVectorScale(e,t,r,i,n){let a="x"===i?[r[0],r[4],r[8],r[12]]:[r[1],r[5],r[9],r[13]],o=[r[3],r[7],r[11],r[15]],s=e[0]*a[0]+e[1]*a[1]+e[2]*a[2],l=e[0]*o[0]+e[1]*o[1]+e[2]*o[2],u=t[0]*a[0]+t[1]*a[1]+t[2]*a[2],c=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],h=(u+a[3]-n*c-n*o[3])/(u-s-n*c+n*l);return u+n*l===s+n*c||o[3]*(s-u)+a[3]*(c-l)+s*c==u*l?null:h}static getLesserNonNegativeNonNull(e,t){return null!==t&&t>=0&&t{for(let e in this.tileManagers){let t=this.tileManagers[e].getSource().type;("vector"===t||"geojson"===t)&&this.tileManagers[e].reload()}},this.map=e,this.dispatcher=new F_(Lk(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(e,t)=>this.getGlyphs(e,t)),this.dispatcher.registerMessageHandler("GI",(e,t)=>this.getImages(e,t)),this.dispatcher.registerMessageHandler("GDA",(e,t)=>this.getDashes(e,t)),this.imageManager=new Fe,this.imageManager.setEventedParent(this),this.imageManager.setMissingImageResolver(e._missingStyleImageResolver),this.patternAtlas=new Ft(this.imageManager);let n=(null==(r=e._container)?void 0:r.lang)||"u">typeof document&&(null==(i=document.documentElement)?void 0:i.lang)||void 0;this.glyphManager=new Fh(e._requestManager,t.localIdeographFontFamily,n),this.lineAtlas=new Fg(256,512),this.crossTileSymbolIndex=new Of,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",xS()),LN().on(FV,this._rtlPluginLoaded),this.on("data",e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;let t=this.tileManagers[e.sourceId];if(!t)return;let r=t.getSource();if(r?.vectorLayerIds)for(let e in this._layers){let t=this._layers[e];t.source===r.id&&this._validateLayer(t)}})}_setInitialValues(){var e;this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new Sl,this._imagesListDirty=!1,this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this._symbolPlacementTriggered=!1,this._placedProjectionTransition=void 0,this.crossTileSymbolIndex=new((null==(e=this.crossTileSymbolIndex)?void 0:e.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(e,t){var r,i,n;this._checkLoaded();let a=null===t?null!=(n=null==(i=null==(r=this.stylesheet.state)?void 0:r[e])?void 0:i.default)?n:null:t;if(xc(a,this._globalState[e]))return this;this._globalState[e]=a,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();let t=[];for(let r in e)xc(this._globalState[r],e[r].default)||(t.push(r),this._globalState[r]=e[r].default);this._applyGlobalStateChanges(t)}_applyGlobalStateChanges(e){if(0===e.length)return;let t=new Set,r={};for(let i of e)for(let e in r[i]=this._globalState[i],this._layers){let r=this._layers[e],n=r.getLayoutAffectingGlobalStateRefs(),a=r.getPaintAffectingGlobalStateRefs(),o=r.getVisibilityAffectingGlobalStateRefs();if(n.has(i)&&t.add(r.source),a.has(i))for(let{name:e,value:t}of a.get(i))this._updatePaintProperty(r,e,t);o?.has(i)&&(r.recalculateVisibility(),this._updateLayer(r))}for(let e in this.dispatcher.broadcast("UGS",r),this.tileManagers)t.has(e)&&(this._reloadSource(e),this._changed=!0)}loadURL(e){return b(this,arguments,function*(e,t={},r){this.fire(new z0("dataloading")),t.validate="boolean"!=typeof t.validate||t.validate,this._loadStyleRequest=new AbortController;let i=this._loadStyleRequest;try{let n=yield this.map._requestManager.transformRequest(e,"Style");xT(i.signal);let a=yield MS(n,i);this._loadStyleRequest===i&&(this._loadStyleRequest=null),this._load(a.data,t,r)}catch(e){this._loadStyleRequest===i&&(this._loadStyleRequest=null),e&&!i.signal.aborted&&this.fire(new MI(vK(e)))}})}loadJSON(e,t={},r){this.fire(new z0("dataloading")),this._frameRequest=new AbortController,zG.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,t.validate=!1!==t.validate,this._load(e,t,r)}).catch(()=>{})}loadEmpty(){this.fire(new z0("dataloading")),this._load(OU,{validate:!1})}_load(e,t,r){var i,n,a;let o=t.transformStyle?t.transformStyle(r,e):e;if(!(t.validate&&_1(this,o))){for(let e in o=d({},o),this._loaded=!0,this.stylesheet=o,o.sources)this.addSource(e,o.sources[e],{validate:!1});o.sprite?this._loadSprite(o.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(o.glyphs),this.glyphManager.setFontFaces(o["font-faces"]),this._createLayers(),this.light=new Ff(null!=(i=this.stylesheet.light)?i:{},this._globalState),this._setProjectionInternal((null==(n=this.stylesheet.projection)?void 0:n.type)||"mercator"),this.sky=new Fm(this.stylesheet.sky,this._globalState),this.map.setTerrain(null!=(a=this.stylesheet.terrain)?a:null,{validate:!1}),this.fire(new z0("data")),this.fire(new zQ)}}_createLayers(){var e,t,r;let i=Ld(this.stylesheet.layers);for(let n of(this.setGlobalState(null!=(e=this.stylesheet.state)?e:null),this.dispatcher.broadcast("SL",i),this._order=i.map(e=>e.id),this._layers={},this._serializedLayers=null,i)){let e=T9(n,this._globalState);if(e.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=e,SD(e)&&this.tileManagers[e.source]){let i=null!=(r=null==(t=n.paint)?void 0:t["raster-fade-duration"])?r:e.paint.get("raster-fade-duration");this.tileManagers[e.source].setRasterFadeDuration(i)}}}_loadSprite(e,t=!1,r){return b(this,null,function*(){let i;this.imageManager.setLoaded(!1);let n=new AbortController;this._spriteRequest=n;try{let r=yield function(e,t,r,i){return b(this,null,function*(){let n=Lb(e),a=r>1?"@2x":"",o={},s={};for(let{id:e,url:r}of n){let n=yield t.transformRequest(L_(r,a,".json"),"SpriteJSON");o[e]=MS(n,i);let l=yield t.transformRequest(L_(r,a,".png"),"SpriteImage");s[e]=zZ.getImage(l,i)}return yield Promise.all([...Object.values(o),...Object.values(s)]),function(e,t){return b(this,null,function*(){let r={};for(let i in e){r[i]={};let n=(yield t[i]).data;if(!n)throw Error(`Could not load sprite image for ${i}: the response is empty`);let a=zG.getImageCanvasContext(n),o=(yield e[i]).data;for(let e in o){let{width:t,height:n,x:s,y:l,sdf:u,pixelRatio:c,stretchX:h,stretchY:d,content:f,textFitWidth:p,textFitHeight:m}=o[e],g={width:t,height:n,x:s,y:l,context:a};r[i][e]={data:null,pixelRatio:c,sdf:u,stretchX:h,stretchY:d,content:f,textFitWidth:p,textFitHeight:m,spriteData:g}}}return r})}(o,s)})}(e,this.map._requestManager,this.map.getPixelRatio(),n);if(!r)return;for(let e in r){let{loaded:i,removed:n}=this.imageManager.setSpriteImages(e,r[e]);this._markImagesChanged(n),t&&this._markImagesChanged(i)}}catch(e){i=e,n.signal.aborted||this.fire(new MI(i))}finally{this._spriteRequest=null,this.imageManager.setLoaded(!0),t&&(this._changed=!0),this.dispatcher.broadcast("SI",this.imageManager.listImages()),this.fire(new z0("data")),r?.(i)}})}_unloadSprite(){this._markImagesChanged(this.imageManager.removeAllSpriteImages()),this._imagesListDirty=!0,this._changed=!0,this.fire(new z0("data"))}_validateLayer(e){let t=this.tileManagers[e.source];if(!t)return;let r=e.sourceLayer;if(!r)return;let i=t.getSource();("geojson"===i.type||i.vectorLayerIds&&!i.vectorLayerIds.includes(r))&&this.fire(new MI(Error(`Source layer "${r}" does not exist on source "${i.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.tileManagers)if(!this.tileManagers[e].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(e,t=!1){let r=this._serializedAllLayers();if(!e||0===e.length)return Object.values(t?xh(r):r);let i=[];for(let n of e)if(r[n]){let e=t?xh(r[n]):r[n];i.push(e)}return i}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;for(let t of(e=this._serializedLayers={},Object.keys(this._layers))){let r=this._layers[t];"custom"!==r.type&&(e[t]=r.serialize())}return e}hasTransitions(){var e,t,r;if(null!=(e=this.light)&&e.hasTransition()||null!=(t=this.sky)&&t.hasTransition()||null!=(r=this.projection)&&r.hasTransition())return!0;for(let e in this.tileManagers)if(this.tileManagers[e].hasTransition())return!0;for(let e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading.")}update(e){if(!this._loaded)return;let t=this._changed;if(t){this._imagesListDirty&&(this._imagesListDirty=(this.dispatcher.broadcast("SI",this.imageManager.listImages()),!1));let t=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);for(let e in(t.length||r.length)&&this._updateWorkerLayers(t,r),this._updatedSources){let t=this._updatedSources[e];if("reload"===t)this._reloadSource(e);else if("clear"===t)this._clearSource(e);else throw Error(`Invalid action ${t}`)}for(let t in this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs(),this._updatedPaintProps)this._layers[t].updateTransitions(e);this._resetUpdates()}let r={};for(let e in this.tileManagers){let t=this.tileManagers[e];r[e]=t.used,t.used=!1}let i=this.imageManager.listImages();for(let t of this._order){let r=this._layers[t];r.recalculate(e,i),!r.isHidden(e.zoom)&&r.source&&(this.tileManagers[r.source].used=!0)}for(let e in r){let t=this.tileManagers[e];!!r[e]!=!!t.used&&t.fire(new z1("data",{sourceDataType:"visibility",sourceId:e}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,t&&this.fire(new z0("data"))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,t={}){var r;this._checkLoaded();let i=this.serialize();if(e=t.transformStyle?t.transformStyle(i,e):e,(null==(r=t.validate)||r)&&_1(this,e))return!1;(e=xh(e)).layers=Ld(e.layers);let n=function(e,t){if(!e)return[{command:"setStyle",args:[t]}];let r=[];try{if(!Lf(e.version,t.version))return[{command:"setStyle",args:[t]}];Lf(e.center,t.center)||r.push({command:"setCenter",args:[t.center]}),Lf(e.state,t.state)||r.push({command:"setGlobalState",args:[t.state]}),Lf(e.centerAltitude,t.centerAltitude)||r.push({command:"setCenterAltitude",args:[t.centerAltitude]}),Lf(e.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),Lf(e.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),Lf(e.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),Lf(e.roll,t.roll)||r.push({command:"setRoll",args:[t.roll]}),Lf(e.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),Lf(e.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),Lf(e["font-faces"],t["font-faces"])||r.push({command:"setFontFaces",args:[t["font-faces"]]}),Lf(e.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),Lf(e.light,t.light)||r.push({command:"setLight",args:[t.light]}),Lf(e.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),Lf(e.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),Lf(e.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});let i={},n=[];!function(e,t,r,i){let n;for(n in e||(e={}),t||(t={}),e)Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(t,n)||Lg(n,r,i));for(n in t){var a;Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)?Lf(e[n],t[n])||("geojson"===e[n].type&&"geojson"===t[n].type&&function(e,t,r){let i;for(i in e[r])if(Object.prototype.hasOwnProperty.call(e[r],i)&&"data"!==i&&!Lf(e[r][i],t[r][i]))return!1;for(i in t[r])if(Object.prototype.hasOwnProperty.call(t[r],i)&&"data"!==i&&!Lf(e[r][i],t[r][i]))return!1;return!0}(e,t,n)?Lp(r,{command:"setGeoJSONSourceData",args:[n,t[n].data]}):(a=t,Lg(n,r,i),Lm(n,a,r))):Lm(n,t,r))}}(e.sources,t.sources,n,i);let a=[];e.layers&&e.layers.forEach(e=>{"source"in e&&i[e.source]?r.push({command:"removeLayer",args:[e.id]}):a.push(e)}),r=r.concat(n),function(e,t,r){e||(e=[]),t||(t=[]);let i=e.map(Lv),n=t.map(Lv),a=e.reduce(Lx,{}),o=t.reduce(Lx,{}),s=i.slice(),l=Object.create(null),u,c,h,d,f;for(let e=0,t=0;e0)throw Error(`Unimplemented: ${a.unimplemented.join(", ")}.`);if(0===a.operations.length)return!1;for(let e of a.operations)e();return this.stylesheet=e,this._serializedLayers=null,this.fire(new zQ({style:this})),!0}_getOperationsToPerform(e){let t=[],r=[];for(let i of e)switch(i.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":t.push(()=>this.addLayer.apply(this,i.args));break;case"removeLayer":t.push(()=>this.removeLayer.apply(this,i.args));break;case"setPaintProperty":t.push(()=>this.setPaintProperty.apply(this,i.args));break;case"setLayoutProperty":t.push(()=>this.setLayoutProperty.apply(this,i.args));break;case"setFilter":t.push(()=>this.setFilter.apply(this,i.args));break;case"addSource":t.push(()=>this.addSource.apply(this,i.args));break;case"removeSource":t.push(()=>this.removeSource.apply(this,i.args));break;case"setLayerZoomRange":t.push(()=>this.setLayerZoomRange.apply(this,i.args));break;case"setLight":t.push(()=>this.setLight.apply(this,i.args));break;case"setGeoJSONSourceData":t.push(()=>this.setGeoJSONSourceData.apply(this,i.args));break;case"setGlyphs":t.push(()=>this.setGlyphs.apply(this,i.args));break;case"setFontFaces":t.push(()=>this.setFontFaces.apply(this,i.args));break;case"setSprite":t.push(()=>this.setSprite.apply(this,i.args));break;case"setTerrain":t.push(()=>this.map.setTerrain.apply(this,i.args));break;case"setSky":t.push(()=>this.setSky.apply(this,i.args));break;case"setProjection":this.setProjection.apply(this,i.args);break;case"setGlobalState":t.push(()=>this.setGlobalState.apply(this,i.args));break;case"setTransition":t.push(()=>{});break;default:r.push(i.command)}return{operations:t,unimplemented:r}}addImage(e,t){this.getImage(e)?this.fire(new MI(Error(`An image named "${e}" already exists.`))):(this.imageManager.addImage(e,t),this._afterImageUpdated(e))}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}setMissingImageResolver(e){this.imageManager.setMissingImageResolver(e)}removeImage(e){this.getImage(e)?(this.imageManager.removeImage(e),this._afterImageUpdated(e)):this.fire(new MI(Error(`An image named "${e}" does not exist.`)))}_markImagesChanged(e){for(let t of e)this._changedImages[t]=!0}_afterImageUpdated(e){this._changedImages[e]=!0,this._imagesListDirty=!0,this._changed=!0,this.fire(new z0("data"))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,t,r={}){var i;if(this._checkLoaded(),void 0!==this.tileManagers[e])throw Error(`Source "${e}" already exists.`);if(!t.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(t).join(", ")}.`);if(Sa.has(t.type)&&this._validate(Sn.source,`sources.${e}`,t,null,r))return;null!=(i=this.map)&&i._collectResourceTiming&&(t.collectResourceTiming=!0);let n=this.tileManagers[e]=new FK(e,t,this.dispatcher);n.style=this,n.setEventedParent(this,()=>({isSourceLoaded:n.loaded(),source:n.serialize(),sourceId:e})),n.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),void 0===this.tileManagers[e])throw Error(`There is no source with this ID=${e}`);for(let t in this._layers)if(this._layers[t].source===e)return this.fire(new MI(Error(`Source "${e}" cannot be removed while layer "${t}" is using it.`)));let t=this.tileManagers[e];delete this.tileManagers[e],delete this._updatedSources[e],t.fire(new z1("data",{sourceDataType:"metadata",sourceId:e})),t.setEventedParent(null),t.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.tileManagers[e])throw Error(`There is no source with this ID=${e}`);let r=this.tileManagers[e].getSource();if("geojson"!==r.type)throw Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(t),this._changed=!0}getSource(e){var t;return null==(t=this.tileManagers[e])?void 0:t.getSource()}addLayer(e,t,r={}){let i;this._checkLoaded();let n=e.id;if(this.getLayer(n))return void this.fire(new MI(Error(`Layer "${n}" already exists on this map.`)));if("custom"===e.type){var a;let t,r;if(_2(this,(t=[],void 0===(r=(a=e).id)&&t.push(new MO(`layers.${r}`,null,'missing required property "id"')),void 0===a.render&&t.push(new MO(`layers.${r}`,null,'missing required method "render"')),a.renderingMode&&"2d"!==a.renderingMode&&"3d"!==a.renderingMode&&t.push(new MO(`layers.${r}`,null,'property "renderingMode" must be either "2d" or "3d"')),t)))return;i=T9(e,this._globalState)}else{if("source"in e&&"object"==typeof e.source&&(this.addSource(n,e.source),e=xi(e=xh(e),{source:n})),this._validate(Sn.layer,`layers.${n}`,e,{arrayIndex:-1},r))return;i=T9(e,this._globalState),this._validateLayer(i),i.setEventedParent(this,{layer:{id:n}})}let o=t?this._order.indexOf(t):this._order.length;if(t&&-1===o)return void this.fire(new MI(Error(`Cannot add layer "${n}" before non-existing layer "${t}".`)));if(this._order.splice(o,0,n),this._layerOrderChanged=!0,this._layers[n]=i,this._removedLayers[n]&&i.source&&"custom"!==i.type){let e=this._removedLayers[n];delete this._removedLayers[n],e.type===i.type?(this._updatedSources[i.source]="reload",this.tileManagers[i.source].pause()):this._updatedSources[i.source]="clear"}this._updateLayer(i),i.onAdd&&i.onAdd(this.map)}moveLayer(e,t){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new MI(Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===t)return;if(t&&!this._order.includes(t))return void this.fire(new MI(Error(`Cannot move layer "${e}" before non-existing layer "${t}".`)));let r=this._order.indexOf(e);this._order.splice(r,1);let i=t?this._order.indexOf(t):this._order.length;this._order.splice(i,0,e),this._layerOrderChanged=!0}removeLayer(e){var t;this._checkLoaded();let r=this._layers[e];if(!r)return void this.fire(new MI(Error(`Cannot remove non-existing layer "${e}".`)));r.setEventedParent(null);let i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],"symbol"===r.type&&r.source&&(null==(t=this.tileManagers[r.source])||t.resetMaxContentElevation()),r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,t,r){this._checkLoaded();let i=this.getLayer(e);i?(i.minzoom!==t||i.maxzoom!==r)&&(null!=t&&(i.minzoom=t),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new MI(Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,t,r={}){this._checkLoaded();let i=this.getLayer(e);if(!i)return void this.fire(new MI(Error(`Cannot filter non-existing layer "${e}".`)));if(!xc(i.filter,t)){if(null==t){i.setFilter(void 0),this._updateLayer(i);return}this._validate(Sn.filter,`layers.${i.id}.filter`,t,null,r)||(i.setFilter(xh(t)),this._updateLayer(i))}}getFilter(e){return xh(this.getLayer(e).filter)}setLayoutProperty(e,t,r,i={}){this._checkLoaded();let n=this.getLayer(e);n?xc(n.getLayoutProperty(t),r)||(n.setLayoutProperty(t,r,i),this._updateLayer(n)):this.fire(new MI(Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,t){let r=this.getLayer(e);return r?r.getLayoutProperty(t):void this.fire(new MI(Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,t,r,i={}){this._checkLoaded();let n=this.getLayer(e);n?xc(n.getPaintProperty(t),r)||this._updatePaintProperty(n,t,r,i):this.fire(new MI(Error(`Cannot style non-existing layer "${e}".`)))}_updatePaintProperty(e,t,r,i={}){e.setPaintProperty(t,r,i)&&this._updateLayer(e),SD(e)&&"raster-fade-duration"===t&&this.tileManagers[e.source].setRasterFadeDuration(r),this._changed=!0,this._updatedPaintProps[e.id]=!0,"symbol"===e.type&&this.triggerSymbolPlacement(),this._serializedLayers=null}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,t){this._checkLoaded();let r=e.source,i=e.sourceLayer,n=this.tileManagers[r];if(void 0===n)return void this.fire(new MI(Error(`The source '${r}' does not exist in the map's style.`)));let a=n.getSource().type;if("geojson"===a&&i)return void this.fire(new MI(Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===a&&!i)return void this.fire(new MI(Error("The sourceLayer parameter must be provided for vector source types.")));if(void 0===e.id)return void this.fire(new MI(Error("The feature id parameter must be provided.")));let o=["__proto__","constructor","prototype"];t&&Object.keys(t).some(e=>o.includes(e))?this.fire(new MI(Error(`The feature state should not include one of the following keys: ${o}`))):n.setFeatureState(i,e.id,t)}removeFeatureState(e,t){this._checkLoaded();let r=e.source,i=this.tileManagers[r];if(void 0===i)return void this.fire(new MI(Error(`The source '${r}' does not exist in the map's style.`)));let n=i.getSource().type,a="vector"===n?e.sourceLayer:void 0;"vector"!==n||a?t&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new MI(Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,t):this.fire(new MI(Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();let t=e.source,r=e.sourceLayer,i=this.tileManagers[t];return void 0===i?void this.fire(new MI(Error(`The source '${t}' does not exist in the map's style.`))):"vector"!==i.getSource().type||r?(void 0===e.id&&this.fire(new MI(Error("The feature id parameter must be provided."))),i.getFeatureState(r,e.id)):void this.fire(new MI(Error("The sourceLayer parameter must be provided for vector source types.")))}getTransition(){var e;return xi({duration:300,delay:0},null==(e=this.stylesheet)?void 0:e.transition)}serialize(){if(!this._loaded)return;let e=xl(this.tileManagers,e=>e.serialize()),t=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,i=this.stylesheet;return xu({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,"font-faces":i["font-faces"],transition:i.transition,projection:i.projection,state:i.state,sources:e,layers:t,terrain:r},e=>void 0!==e)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.tileManagers[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.tileManagers[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let t=e=>"fill-extrusion"===this._layers[e].type,r={},i=[];for(let n=this._order.length-1;n>=0;n--){let a=this._order[n];if(t(a))for(let t of(r[a]=n,e)){let e=t[a];if(e)for(let t of e)i.push(t)}}i.sort((e,t)=>t.intersectionZ-e.intersectionZ);let n=[];for(let a=this._order.length-1;a>=0;a--){let o=this._order[a];if(t(o))for(let e=i.length-1;e>=0;e--){let t=i[e].feature;if(r[t.layer.id]o(i.tileID,e,t):void 0)});var h,d=function(e){let t={},r={};for(let{queryResults:i,wrappedTileID:n}of e){r[n]||(r[n]={});let e=r[n];for(let r in i){let n=i[r];e[r]||(e[r]={});let a=e[r];for(let e of(t[r]||(t[r]=[]),n))a[e.featureIndex]||(a[e.featureIndex]=!0,t[r].push(e))}}return t}(c),f=e;for(let e in d)for(let t of d[e])LI(t,f);return d}(this.tileManagers[o],this._layers,a,e,s,r,this.map.terrain?(e,t,r)=>this.map.terrain.getElevation(e,t,r):void 0));return this.placement&&n.push(function(e,t,r,i,n,a,o){let s={},l=a.queryRenderedSymbols(i),u=[];for(let e of Object.keys(l).map(Number))u.push(o[e]);for(let r of(u.sort(LC),u)){let i=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,{filterSpec:n.filter,globalState:n.globalState},n.layers,n.availableImages,e);for(let e in i){s[e]||(s[e]=[]);let t=i[e];for(let i of(t.sort((e,t)=>{let i=r.featureSortOrder;if(i){let r=i.indexOf(e.featureIndex);return i.indexOf(t.featureIndex)-r}return t.featureIndex-e.featureIndex}),t))s[e].push(i)}}var c=s,h=e,d=r;for(let e in c)for(let t of c[e])LI(t,d[h[e].source]);return c}(this._layers,a,this.tileManagers,e,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(n)}querySourceFeatures(e,t){t?.filter&&this._validate(Sn.filter,"querySourceFeatures.filter",t.filter,null,t);let r=this.tileManagers[e];return r?function(e,t){let r=e.getRenderableIds().map(t=>e.getTileByID(t)),i=[],n={};for(let e of r){let r=e.tileID.canonical.key;n[r]||(n[r]=!0,e.querySourceFeatures(i,t))}return i}(r,t?f(d({},t),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,t={}){this._checkLoaded();let r=this.light.getLight(),i=!1;for(let t in e)if(!xc(e[t],r[t])){i=!0;break}if(!i)return;let n={now:Ll(),transition:xi({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,t),this.light.updateTransitions(n)}getProjection(){var e;return null==(e=this.stylesheet)?void 0:e.projection}setProjection(e){this._checkLoaded();let t=e??{type:"mercator"};if(this.stylesheet.projection=e,this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(t.type)}getSky(){var e;return null==(e=this.stylesheet)?void 0:e.sky}setSky(e,t={}){this._checkLoaded();let r=this.getSky(),i=!1;if(!e&&!r)return;if(e&&!r)i=!0;else if(!e&&r)i=!0;else for(let t in e)if(!xc(e[t],r[t])){i=!0;break}if(!i)return;let n={now:Ll(),transition:xi({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,t),this.sky.updateTransitions(n)}_setProjectionInternal(e){var t;let r=function(e,t,r){let i={constrainOverride:t};if(Array.isArray(e)){let t=new OP({type:e},r);return{projection:t,transform:new Oj(i),cameraHelper:new OV(t)}}switch(e){case"mercator":return{projection:new Ox,transform:new OE(i),cameraHelper:new OD};case"globe":{let e=new OP({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]},{});return{projection:e,transform:new Oj(i),cameraHelper:new OV(e)}}case"vertical-perspective":return{projection:new OL,transform:new OB(i),cameraHelper:new ON};default:return xd(`Unknown projection name: ${e}. Falling back to mercator projection.`),{projection:new Ox,transform:new OE(i),cameraHelper:new OD}}}(e,null==(t=this.map._camera)?void 0:t.transform.constrainOverride,this._globalState);for(let e in this.projection=r.projection,this.map.migrateProjection(r.transform,r.cameraHelper),this.tileManagers)this.tileManagers[e].reload()}_validate(e,t,r,i,n={}){return!1!==n.validate&&_3(this,e,d({key:t,style:this.serialize(),value:r},i),n)}_remove(e=!0){for(let e in this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null)),LN().off(FV,this._rtlPluginLoaded),this._layers)this._layers[e].setEventedParent(null);for(let e in this.tileManagers){let t=this.tileManagers[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.tileManagers[e].clearTiles()}_reloadSource(e){this.tileManagers[e].resume(),this.tileManagers[e].reload()}_updateSources(e){for(let t in this.tileManagers)this.tileManagers[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(let e in this.tileManagers)this._reloadSource(e)}triggerSymbolPlacement(){this._symbolPlacementTriggered=!0}_placementInputsChanged(e,t,r){var i,n,a;let o=this.pauseablePlacement;return!o||this._symbolPlacementTriggered||this._placedProjectionTransition!==(null==(i=this.projection)?void 0:i.transitionState)||o._showCollisionBoxes!==t||o.placement.collisionGroups.crossSourceCollisions!==r||o.placement.transform.renderWorldCopies!==e.renderWorldCopies||(n=o.placement.transform.modelViewProjectionMatrix,a=e.modelViewProjectionMatrix,n[0]!==a[0]||n[1]!==a[1]||n[2]!==a[2]||n[3]!==a[3]||n[4]!==a[4]||n[5]!==a[5]||n[6]!==a[6]||n[7]!==a[7]||n[8]!==a[8]||n[9]!==a[9]||n[10]!==a[10]||n[11]!==a[11]||n[12]!==a[12]||n[13]!==a[13]||n[14]!==a[14]||n[15]!==a[15])}_updatePlacement(e,t,r,i,n=!1){var a,o;let s=!1,l=!1,u={};for(let t of this._order){let r=this._layers[t];if("symbol"!==r.type)continue;if(!u[r.source]){let e=this.tileManagers[r.source];u[r.source]=e.getRenderableIds(!0).map(t=>e.getTileByID(t)).sort((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1))}let i=this.crossTileSymbolIndex.addLayer(r,u[r.source],e.center.lng);s||(s=i)}this.crossTileSymbolIndex.pruneUnusedLayers(this._order),n||(n=this._layerOrderChanged||0===r);let c=s||this._placementInputsChanged(e,t,i),h=(null==(a=this.pauseablePlacement)?void 0:a.isDone())&&!this.placement.stillRecent(Ll(),e.zoom);if((n||!this.pauseablePlacement||h&&(c||this.placement.stale))&&(this._symbolPlacementTriggered=!1,this._placedProjectionTransition=null==(o=this.projection)?void 0:o.transitionState,this.pauseablePlacement=new Oa(e,this.map.terrain,this._order,n,t,r,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?c&&this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(Ll()),l=!0),s&&this.pauseablePlacement.placement.setStale()),l||s)for(let e of this._order){let t=this._layers[e];"symbol"===t.type&&this.placement.updateLayerOpacities(t,u[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Ll())}_releaseSymbolFadeTiles(){for(let e in this.tileManagers)this.tileManagers[e].releaseSymbolFadeTiles()}getImages(e,t){return b(this,null,function*(){let e=yield this.imageManager.getImages(t.icons);this._updateTilesForChangedImages();let r=this.tileManagers[t.source];return r&&r.setDependencies(t.tileID.key,t.type,t.icons),e})}getGlyphs(e,t){return b(this,null,function*(){let e=yield this.glyphManager.getGlyphs(t.stacks),r=this.tileManagers[t.source];return r&&r.setDependencies(t.tileID.key,t.type,[""]),e})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,t={}){this._checkLoaded(),e&&this._validate(Sn.glyphs,"glyphs",e,null,t)||(this._changed=!0,this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}getFontFaces(){return this.stylesheet["font-faces"]||null}setFontFaces(e){this._checkLoaded(),this._changed=!0,this._glyphsDidChange=!0,this.stylesheet["font-faces"]=e,this.glyphManager.setFontFaces(e)}getDashes(e,t){return b(this,null,function*(){let e={};for(let[r,i]of Object.entries(t.dashes))e[r]=this.lineAtlas.getDash(i.dasharray,i.round);return e})}addSprite(e,t,r={},i){this._checkLoaded();let n=[{id:e,url:t}],a=[...Lb(this.stylesheet.sprite),...n];this._validate(Sn.sprite,"sprite",a,null,r)||(this.stylesheet.sprite=a,this._loadSprite(n,!0,i))}removeSprite(e){this._checkLoaded();let t=Lb(this.stylesheet.sprite);if(!t.find(t=>t.id===e))return void this.fire(new MI(Error(`Sprite "${e}" doesn't exists on this map.`)));let r=this.imageManager.removeSpriteImages(e);this._markImagesChanged(r),t.splice(t.findIndex(t=>t.id===e),1),this.stylesheet.sprite=t.length>0?t:void 0,this._imagesListDirty=!0,this._changed=!0,this.fire(new z0("data"))}getSprite(){return Lb(this.stylesheet.sprite)}setSprite(e,t={},r){this._checkLoaded(),!(e&&this._validate(Sn.sprite,"sprite",e,null,t))&&(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,r):(this._unloadSprite(),r&&r(null)))}destroy(){for(let e in this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null)),this.tileManagers){let t=this.tileManagers[e];t.setEventedParent(null),t.onRemove(this.map)}for(let e in this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.patternAtlas.destroy()),this.glyphManager&&this.glyphManager.destroy(),this._layers){let t=this._layers[e];t.setEventedParent(null),t.onRemove&&t.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}},OG=wr([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),OH=class{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,r,i,n,a,o,s,l){this.context=e;let u=this.boundPaintVertexBuffers.length!==i.length;for(let e=0;!u&&e({u_texture:new EO(e,t.u_texture),u_ele_delta:new ER(e,t.u_ele_delta),u_fog_matrix:new EH(e,t.u_fog_matrix),u_fog_color:new EV(e,t.u_fog_color),u_fog_ground_blend:new ER(e,t.u_fog_ground_blend),u_fog_ground_blend_opacity:new ER(e,t.u_fog_ground_blend_opacity),u_horizon_color:new EV(e,t.u_horizon_color),u_horizon_fog_blend:new ER(e,t.u_horizon_fog_blend),u_is_globe_mode:new ER(e,t.u_is_globe_mode)}),OW=(e,t)=>({u_ele_delta:new ER(e,t.u_ele_delta)}),OY=(e,t,r,i,n)=>({u_texture:0,u_ele_delta:e,u_fog_matrix:t,u_fog_color:r?r.properties.get("fog-color"):ke.white,u_fog_ground_blend:r?r.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:n?0:r?r.calculateFogBlendOpacity(i):0,u_horizon_color:r?r.properties.get("horizon-color"):ke.white,u_horizon_fog_blend:r?r.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!n}),OZ=e=>({u_ele_delta:e}),OX={ProjectionUBO:0,TerrainUBO:1,FrameUBO:2},OK={float:[1,1],int:[1,1],vec2:[2,2],vec4:[4,4],mat4:[16,4]},OJ=class{constructor(e,t,r){this.context=e,this.binding=t,this.contentWords=r.contentWords;let i=e.gl;this.buffer=i.createBuffer(),i.bindBuffer(i.UNIFORM_BUFFER,this.buffer),i.bufferData(i.UNIFORM_BUFFER,4*r.sizeWords,i.DYNAMIC_DRAW),i.bindBufferBase(i.UNIFORM_BUFFER,t,this.buffer),this.uploaded=new Float32Array(r.sizeWords),this.pending=new Float32Array(r.sizeWords),this.uploadedWords=new Uint32Array(this.uploaded.buffer),this.pendingWords=new Uint32Array(this.pending.buffer),this.hasData=!1,this.bindingDirty=!1}upload(){let e=this.context.gl,t=!this.hasData;if(!t){let e=this.pendingWords,r=this.uploadedWords;for(let i=0;i=0&&(this.attributes[e]={location:t,isInteger:S.has(e)})}for(let e of(h.deleteShader(A),h.deleteShader(T),x))if(e&&!M[e]){let t=h.getUniformLocation(this.program,e);t&&(M[e]=t)}this.fixedUniforms=i(e,M),this.terrainUniforms={u_depth:new EO(u=e,(c=M).u_depth),u_terrain:new EO(u,c.u_terrain)},this.binderUniforms=r?r.getUniforms(e,M):[]}draw(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v){var x,b,_;let w,T=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(i),e.setColorMode(n),e.setCullFace(a),s){let t;for(let t in e.activeTexture.set(T.TEXTURE2),T.bindTexture(T.TEXTURE_2D,s.depthTexture),e.activeTexture.set(T.TEXTURE3),T.bindTexture(T.TEXTURE_2D,s.texture),this.terrainUniforms)this.terrainUniforms[t].set(s[t]);b=e.terrainUniformBuffer,(t=b.pending).set(s.u_terrain_matrix,O2.u_terrain_matrix),t.set(s.u_terrain_unpack,O2.u_terrain_unpack),t[O2.u_terrain_dim]=s.u_terrain_dim,t[O2.u_terrain_exaggeration]=s.u_terrain_exaggeration,b.upload()}if(l&&(_=e.projectionUniformBuffer,(w=_.pending).set(l.mainMatrix,O0.u_projection_matrix),w.set(l.fallbackMatrix,O0.u_projection_fallback_matrix),w.set(l.tileMercatorCoords,O0.u_projection_tile_mercator_coords),w.set(l.clippingPlane,O0.u_projection_clipping_plane),w[O0.u_projection_transition]=l.projectionTransition,_.pendingWords[O0.u_projection_clip_antimeridian]=+!!l.clipAntimeridian,_.upload()),o)for(let e in this.fixedUniforms)this.fixedUniforms[e].set(o[e]);m&&m.setUniforms(e,this.binderUniforms,f,{zoom:p});let A=0;switch(t){case T.LINES:A=2;break;case T.TRIANGLES:A=3;break;case T.LINE_STRIP:A=1}for(let r of d.get())r.vaos||(r.vaos={}),(x=r.vaos)[u]||(x[u]=new OH),r.vaos[u].bind(e,this,c,m?m.getPaintVertexBuffers():[],h,r.vertexOffset,g,y,v),T.drawElements(t,r.primitiveLength*A,T.UNSIGNED_SHORT,r.primitiveOffset*A*2)}},O5=(e,t)=>({u_lightpos:new Ej(e,t.u_lightpos),u_lightpos_globe:new Ej(e,t.u_lightpos_globe),u_lightintensity:new ER(e,t.u_lightintensity),u_lightcolor:new Ej(e,t.u_lightcolor),u_vertical_gradient:new ER(e,t.u_vertical_gradient),u_opacity:new ER(e,t.u_opacity),u_fill_translate:new EB(e,t.u_fill_translate)}),O4=(e,t)=>({u_lightpos:new Ej(e,t.u_lightpos),u_lightpos_globe:new Ej(e,t.u_lightpos_globe),u_lightintensity:new ER(e,t.u_lightintensity),u_lightcolor:new Ej(e,t.u_lightcolor),u_vertical_gradient:new ER(e,t.u_vertical_gradient),u_height_factor:new ER(e,t.u_height_factor),u_opacity:new ER(e,t.u_opacity),u_fill_translate:new EB(e,t.u_fill_translate),u_image:new EO(e,t.u_image),u_texsize:new EB(e,t.u_texsize),u_pixel_coord_upper:new EB(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new EB(e,t.u_pixel_coord_lower),u_scale:new Ej(e,t.u_scale),u_fade:new ER(e,t.u_fade)}),O6=(e,t,r,i)=>{var n,a,o,s,l,u;let c=e.style.light,h=c.getCartesianPosition(),d=vh();"viewport"===c.properties.get("anchor")&&(a=Math.sin(n=e.transform.bearingInRadians),o=Math.cos(n),d[0]=o,d[1]=a,d[2]=0,d[3]=-a,d[4]=o,d[5]=0,d[6]=0,d[7]=0,d[8]=1),s=h[0],l=h[1],u=h[2],h[0]=s*d[0]+l*d[3]+u*d[6],h[1]=s*d[1]+l*d[4]+u*d[7],h[2]=s*d[2]+l*d[5]+u*d[8];let f=e.transform.transformLightDirection(h),p=c.properties.get("color");return{u_lightpos:h,u_lightpos_globe:f,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[p.r,p.g,p.b],u_vertical_gradient:+t,u_opacity:r,u_fill_translate:i}},O8=(e,t,r,i,n,a,o)=>xi(O6(e,t,r,i),Pj(a,e,o),{u_height_factor:-(2**n.overscaledZ)/o.tileSize/8}),O7=(e,t)=>({u_fill_translate:new EB(e,t.u_fill_translate)}),O9=(e,t)=>({u_image:new EO(e,t.u_image),u_texsize:new EB(e,t.u_texsize),u_pixel_coord_upper:new EB(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new EB(e,t.u_pixel_coord_lower),u_scale:new Ej(e,t.u_scale),u_fade:new ER(e,t.u_fade),u_sdf_pattern:new EO(e,t.u_sdf_pattern),u_fill_translate:new EB(e,t.u_fill_translate)}),Re=(e,t)=>({u_fill_translate:new EB(e,t.u_fill_translate)}),Rt=(e,t)=>({u_image:new EO(e,t.u_image),u_texsize:new EB(e,t.u_texsize),u_pixel_coord_upper:new EB(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new EB(e,t.u_pixel_coord_lower),u_scale:new Ej(e,t.u_scale),u_fade:new ER(e,t.u_fade),u_sdf_pattern:new EO(e,t.u_sdf_pattern),u_fill_translate:new EB(e,t.u_fill_translate)}),Rr=(e,t,r,i,n)=>xi(Pj(t,e,r),{u_fill_translate:i,u_sdf_pattern:+!!n}),Ri=e=>({u_fill_translate:e}),Rn=e=>({u_fill_translate:e}),Ra=(e,t,r,i,n)=>Rr(e,t,r,i,n),Ro=(e,t)=>({u_scale_with_map:new EO(e,t.u_scale_with_map),u_pitch_with_map:new EO(e,t.u_pitch_with_map),u_extrude_scale:new EB(e,t.u_extrude_scale),u_globe_extrude_scale:new ER(e,t.u_globe_extrude_scale),u_translate:new EB(e,t.u_translate)}),Rs=(e,t,r,i,n)=>{let a=e.transform,o,s,l=0;if("map"===r.paint.get("circle-pitch-alignment")){let e=vX(t,1,a.zoom);o=!0,s=[e,e],l=e/(Md*2**t.tileID.overscaledZ)*2*Math.PI*n}else o=!1,s=a.pixelsToGLUnits;return{u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_pitch_with_map:+o,u_extrude_scale:s,u_globe_extrude_scale:l,u_translate:i}},Rl=(e,t)=>({u_color:new EV(e,t.u_color),u_overlay:new EO(e,t.u_overlay),u_overlay_scale:new ER(e,t.u_overlay_scale)}),Ru=(e,t=1)=>({u_color:e,u_overlay:0,u_overlay_scale:t}),Rc=(e,t)=>({u_extrude_scale:new ER(e,t.u_extrude_scale),u_intensity:new ER(e,t.u_intensity),u_globe_extrude_scale:new ER(e,t.u_globe_extrude_scale)}),Rh=(e,t)=>({u_matrix:new EH(e,t.u_matrix),u_image:new EO(e,t.u_image),u_color_ramp:new EO(e,t.u_color_ramp),u_opacity:new ER(e,t.u_opacity)}),Rd=(e,t,r,i)=>{let n=vX(e,1,t)/(Md*2**e.tileID.overscaledZ)*2*Math.PI*i;return{u_extrude_scale:vX(e,1,t),u_intensity:r,u_globe_extrude_scale:n}},Rf=(e,t,r,i)=>{let n=vd();return Mo(n,0,e.width,e.height,0,0,1),{u_matrix:n,u_image:r,u_color_ramp:i,u_opacity:t.paint.get("heatmap-opacity")}},Rp=(e,t)=>({u_image:new EO(e,t.u_image),u_latrange:new EB(e,t.u_latrange),u_exaggeration:new ER(e,t.u_exaggeration),u_altitudes:new Eq(e,t.u_altitudes),u_azimuths:new Eq(e,t.u_azimuths),u_accent:new EV(e,t.u_accent),u_method:new EO(e,t.u_method),u_shadows:new EU(e,t.u_shadows),u_highlights:new EU(e,t.u_highlights)}),Rm=(e,t)=>({u_matrix:new EH(e,t.u_matrix),u_image:new EO(e,t.u_image),u_dimension:new EB(e,t.u_dimension),u_zoom:new ER(e,t.u_zoom),u_unpack:new EN(e,t.u_unpack)}),Rg=(e,t,r)=>{var i;let n,a,o=r.paint.get("hillshade-accent-color"),s;switch(r.paint.get("hillshade-method")){case"basic":s=4;break;case"combined":s=1;break;case"igor":s=2;break;case"multidirectional":s=3;break;default:s=0}let l=r.getIlluminationProperties();for(let t=0;t{let r=t.stride,i=vd();return Mo(i,0,Md,-Md,0,0,1),vy(i,i,[0,-Md,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:e.overscaledZ,u_unpack:t.getUnpackVector()}},Rv=(e,t)=>({u_image:new EO(e,t.u_image),u_unpack:new EN(e,t.u_unpack),u_dimension:new EB(e,t.u_dimension),u_elevation_stops:new EO(e,t.u_elevation_stops),u_color_stops:new EO(e,t.u_color_stops),u_color_ramp_size:new EO(e,t.u_color_ramp_size),u_opacity:new ER(e,t.u_opacity)}),Rx=(e,t,r=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:r,u_opacity:e.paint.get("color-relief-opacity")}),Rb=(e,t)=>({u_translation:new EB(e,t.u_translation),u_ratio:new ER(e,t.u_ratio)}),R_=(e,t)=>({u_translation:new EB(e,t.u_translation),u_ratio:new ER(e,t.u_ratio),u_image:new EO(e,t.u_image),u_image_height:new ER(e,t.u_image_height)}),Rw=(e,t)=>({u_translation:new EB(e,t.u_translation),u_texsize:new EB(e,t.u_texsize),u_ratio:new ER(e,t.u_ratio),u_image:new EO(e,t.u_image),u_scale:new Ej(e,t.u_scale),u_fade:new ER(e,t.u_fade)}),RT=(e,t)=>({u_translation:new EB(e,t.u_translation),u_ratio:new ER(e,t.u_ratio),u_image:new EO(e,t.u_image),u_mix:new ER(e,t.u_mix),u_tileratio:new ER(e,t.u_tileratio),u_crossfade_from:new ER(e,t.u_crossfade_from),u_crossfade_to:new ER(e,t.u_crossfade_to),u_lineatlas_width:new ER(e,t.u_lineatlas_width),u_lineatlas_height:new ER(e,t.u_lineatlas_height)}),RA=(e,t)=>({u_translation:new EB(e,t.u_translation),u_ratio:new ER(e,t.u_ratio),u_image:new EO(e,t.u_image),u_image_height:new ER(e,t.u_image_height),u_tileratio:new ER(e,t.u_tileratio),u_crossfade_from:new ER(e,t.u_crossfade_from),u_crossfade_to:new ER(e,t.u_crossfade_to),u_image_dash:new EO(e,t.u_image_dash),u_mix:new ER(e,t.u_mix),u_lineatlas_width:new ER(e,t.u_lineatlas_width),u_lineatlas_height:new ER(e,t.u_lineatlas_height)}),RM=(e,t,r,i)=>{let n=e.transform;return{u_translation:PV(e,t,r),u_ratio:i/vX(t,1,n.zoom)}},Rk=(e,t,r,i,n)=>xi(RM(e,t,r,i),{u_image:0,u_image_height:n}),RS=(e,t,r,i,n)=>{let a=e.transform,o=PN(t,a);return{u_translation:PV(e,t,r),u_texsize:t.imageAtlasTexture.size,u_ratio:i/vX(t,1,a.zoom),u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t}},RE=(e,t,r,i,n)=>{let a=PN(t,e.transform);return xi(RM(e,t,r,i),{u_tileratio:a,u_crossfade_from:n.fromScale,u_crossfade_to:n.toScale,u_image:0,u_mix:n.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},RD=(e,t,r,i,n,a)=>{let o=PN(t,e.transform);return xi(RM(e,t,r,i),{u_image:0,u_image_height:a,u_tileratio:o,u_crossfade_from:n.fromScale,u_crossfade_to:n.toScale,u_image_dash:1,u_mix:n.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},RC=(e,t)=>({u_image:new EO(e,t.u_image),u_opacity:new ER(e,t.u_opacity)}),RI=(e,t)=>({u_image:t,u_opacity:e}),RL=(e,t)=>({u_is_size_zoom_constant:new EO(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new EO(e,t.u_is_size_feature_constant),u_size_t:new ER(e,t.u_size_t),u_size:new ER(e,t.u_size),u_rotate_symbol:new EO(e,t.u_rotate_symbol),u_label_plane_matrix:new EH(e,t.u_label_plane_matrix),u_coord_matrix:new EH(e,t.u_coord_matrix),u_is_text:new EO(e,t.u_is_text),u_pitch_with_map:new EO(e,t.u_pitch_with_map),u_is_along_line:new EO(e,t.u_is_along_line),u_is_variable_anchor:new EO(e,t.u_is_variable_anchor),u_texsize:new EB(e,t.u_texsize),u_texture:new EO(e,t.u_texture),u_translation:new EB(e,t.u_translation),u_pitched_scale:new ER(e,t.u_pitched_scale),u_is_offset:new EO(e,t.u_is_offset),u_height_anchor_ground:new EO(e,t.u_height_anchor_ground)}),RP=(e,t)=>({u_is_size_zoom_constant:new EO(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new EO(e,t.u_is_size_feature_constant),u_size_t:new ER(e,t.u_size_t),u_size:new ER(e,t.u_size),u_rotate_symbol:new EO(e,t.u_rotate_symbol),u_label_plane_matrix:new EH(e,t.u_label_plane_matrix),u_coord_matrix:new EH(e,t.u_coord_matrix),u_is_text:new EO(e,t.u_is_text),u_pitch_with_map:new EO(e,t.u_pitch_with_map),u_is_along_line:new EO(e,t.u_is_along_line),u_is_variable_anchor:new EO(e,t.u_is_variable_anchor),u_texsize:new EB(e,t.u_texsize),u_texture:new EO(e,t.u_texture),u_gamma_scale:new ER(e,t.u_gamma_scale),u_is_halo:new EO(e,t.u_is_halo),u_is_plain:new EO(e,t.u_is_plain),u_translation:new EB(e,t.u_translation),u_pitched_scale:new ER(e,t.u_pitched_scale),u_is_offset:new EO(e,t.u_is_offset),u_height_anchor_ground:new EO(e,t.u_height_anchor_ground)}),Rz=(e,t)=>({u_is_size_zoom_constant:new EO(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new EO(e,t.u_is_size_feature_constant),u_size_t:new ER(e,t.u_size_t),u_size:new ER(e,t.u_size),u_rotate_symbol:new EO(e,t.u_rotate_symbol),u_label_plane_matrix:new EH(e,t.u_label_plane_matrix),u_coord_matrix:new EH(e,t.u_coord_matrix),u_is_text:new EO(e,t.u_is_text),u_pitch_with_map:new EO(e,t.u_pitch_with_map),u_is_along_line:new EO(e,t.u_is_along_line),u_is_variable_anchor:new EO(e,t.u_is_variable_anchor),u_texsize:new EB(e,t.u_texsize),u_texsize_icon:new EB(e,t.u_texsize_icon),u_texture:new EO(e,t.u_texture),u_texture_icon:new EO(e,t.u_texture_icon),u_gamma_scale:new ER(e,t.u_gamma_scale),u_is_halo:new EO(e,t.u_is_halo),u_translation:new EB(e,t.u_translation),u_pitched_scale:new ER(e,t.u_pitched_scale),u_is_offset:new EO(e,t.u_is_offset),u_height_anchor_ground:new EO(e,t.u_height_anchor_ground)}),RF=(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p)=>({u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_rotate_symbol:+r,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+c,u_pitch_with_map:+i,u_is_along_line:n,u_is_variable_anchor:a,u_texsize:h,u_texture:0,u_translation:u,u_pitched_scale:d,u_is_offset:f,u_height_anchor_ground:+p}),RO=(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m)=>{let g=o.transform;return xi(RF(e,t,r,i,n,a,o,s,l,u,c,h,f,p,m),{u_gamma_scale:i?Math.cos(g.pitch*Math.PI/180)*g.cameraToCenterDistance:1,u_is_halo:+!!d,u_is_plain:1})},RR=(e,t,r,i,n,a,o,s,l,u,c,h,d,f,p)=>xi(RO(e,t,r,i,n,a,o,s,l,u,!0,c,!0,d,f,p),{u_texsize_icon:h,u_texture_icon:1}),RB=(e,t)=>({u_opacity:new ER(e,t.u_opacity),u_color:new EV(e,t.u_color)}),Rj=(e,t)=>({u_opacity:new ER(e,t.u_opacity),u_image:new EO(e,t.u_image),u_pattern_tl_a:new EB(e,t.u_pattern_tl_a),u_pattern_br_a:new EB(e,t.u_pattern_br_a),u_pattern_tl_b:new EB(e,t.u_pattern_tl_b),u_pattern_br_b:new EB(e,t.u_pattern_br_b),u_texsize:new EB(e,t.u_texsize),u_mix:new ER(e,t.u_mix),u_pattern_size_a:new EB(e,t.u_pattern_size_a),u_pattern_size_b:new EB(e,t.u_pattern_size_b),u_scale_a:new ER(e,t.u_scale_a),u_scale_b:new ER(e,t.u_scale_b),u_pixel_coord_upper:new EB(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new EB(e,t.u_pixel_coord_lower),u_tile_units_to_pixels:new ER(e,t.u_tile_units_to_pixels)}),RN=(e,t)=>({u_opacity:e,u_color:t}),RV=(e,t,r,i,n)=>xi(function(e,t,r,i){let n=r.patternAtlas.getPattern(e.from.toString()),a=r.patternAtlas.getPattern(e.to.toString()),{width:o,height:s}=r.patternAtlas.getPixelSize(),l=2**i.tileID.overscaledZ,u=i.tileSize*2**r.transform.tileZoom/l,c=u*(i.tileID.canonical.x+i.tileID.wrap*l),h=u*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:t.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/vX(i,1,r.transform.tileZoom),u_pixel_coord_upper:[c>>16,h>>16],u_pixel_coord_lower:[65535&c,65535&h]}}(r,n,t,i),{u_opacity:e}),RU=(e,t)=>({u_sun_pos:new Ej(e,t.u_sun_pos),u_atmosphere_blend:new ER(e,t.u_atmosphere_blend),u_globe_position:new Ej(e,t.u_globe_position),u_globe_radius:new ER(e,t.u_globe_radius),u_inv_proj_matrix:new EH(e,t.u_inv_proj_matrix)}),Rq=(e,t,r,i,n)=>({u_sun_pos:e,u_atmosphere_blend:t,u_globe_position:r,u_globe_radius:i,u_inv_proj_matrix:n}),RG=(e,t)=>({u_sky_color:new EV(e,t.u_sky_color),u_horizon_color:new EV(e,t.u_horizon_color),u_horizon:new EB(e,t.u_horizon),u_horizon_normal:new EB(e,t.u_horizon_normal),u_sky_horizon_blend:new ER(e,t.u_sky_horizon_blend),u_sky_blend:new ER(e,t.u_sky_blend),u_inv_proj_matrix:new EH(e,t.u_inv_proj_matrix),u_globe_position:new Ej(e,t.u_globe_position),u_globe_radius:new ER(e,t.u_globe_radius)}),RH=(e,t,r)=>{let i=Math.cos(t.rollInRadians),n=Math.sin(t.rollInRadians),a=To(t),o=t.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:e.properties.get("sky-color"),u_horizon_color:e.properties.get("horizon-color"),u_horizon:[(t.width/2-a*n)*r,(t.height/2+a*i)*r],u_horizon_normal:[-n,i],u_sky_horizon_blend:e.properties.get("sky-horizon-blend")*t.height/2*r,u_sky_blend:o,u_inv_proj_matrix:t.inverseProjectionMatrix,u_globe_position:PA(t),u_globe_radius:PT(t.worldSize,t.center.lat)}},RW={fillExtrusion:O5,fillExtrusionPattern:O4,fill:O7,fillPattern:O9,fillOutline:Re,fillOutlinePattern:Rt,circle:Ro,collisionBox:R$=(e,t)=>({}),collisionCircle:R$,debug:Rl,depth:R$,clippingMask:R$,heatmap:Rc,heatmapTexture:Rh,hillshade:Rp,hillshadePrepare:Rm,colorRelief:Rv,line:Rb,lineGradient:R_,linePattern:Rw,lineSDF:RT,lineGradientSDF:RA,layerOpacity:RC,raster:FC,symbolIcon:RL,symbolSDF:RP,symbolTextAndIcon:Rz,background:RB,backgroundPattern:Rj,terrain:O$,terrainDepth:OW,atmosphere:RU,sky:RG},RY=class{constructor(e,t,r){this.context=e;let i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=!!r,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||t.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},RZ={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},RX=class{constructor(e,t,r,i){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=i,this.context=e;let n=e.gl;this.buffer=n.createBuffer(),e.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||t.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let r of this.attributes){let i=t.attributes[r.name];void 0!==i&&e.enableVertexAttribArray(i.location)}}setVertexAttribPointers(e,t,r){for(let i of this.attributes){let n=t.attributes[i.name];if(void 0!==n){let t=i.offset+this.itemSize*(r||0);n.isInteger?e.vertexAttribIPointer(n.location,i.components,e[RZ[i.type]],this.itemSize,t):e.vertexAttribPointer(n.location,i.components,e[RZ[i.type]],!1,this.itemSize,t)}}}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}},RK=class{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)}},RJ=class extends RK{getDefault(){return ke.transparent}set(e){let 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)}},RQ=class extends RK{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}},R0=class extends RK{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}},R1=class extends RK{getDefault(){return[!0,!0,!0,!0]}set(e){let 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)}},R2=class extends RK{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}},R3=class extends RK{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}},R5=class extends RK{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let 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)}},R4=class extends RK{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let 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)}},R6=class extends RK{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}},R8=class extends RK{getDefault(){return[0,1]}set(e){let 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)}},R7=class extends RK{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}},R9=class extends RK{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}},Be=class extends RK{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}},Bt=class extends RK{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}},Br=class extends RK{getDefault(){return ke.transparent}set(e){let 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)}},Bi=class extends RK{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}},Bn=class extends RK{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}},Ba=class extends RK{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}},Bo=class extends RK{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}},Bs=class extends RK{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}},Bl=class extends RK{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}},Bu=class extends RK{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let 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)}},Bc=class extends RK{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},Bh=class extends RK{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},Bd=class extends RK{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}},Bf=class extends RK{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},Bp=class extends RK{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},Bm=class extends RK{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}},Bg=class extends RK{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},By=class extends RK{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},Bv=class extends RK{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},Bx=class extends RK{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}},Bb=class extends Bx{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},B_=class extends Bx{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},Bw=class extends Bx{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},BT=class{constructor(e,t,r,i,n){this.context=e,this.width=t,this.height=r;let a=e.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new Bb(e,o),i)this.depthAttachment=n?new Bw(e,o):new B_(e,o);else if(n)throw Error("Stencil cannot be set without depth")}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}},BM=(BA=PR([{name:"u_units_to_pixels",type:"vec2"},{name:"u_world_size",type:"vec2"},{name:"u_camera_to_center_distance",type:"float"},{name:"u_symbol_fade_change",type:"float"},{name:"u_aspect_ratio",type:"float"},{name:"u_device_pixel_ratio",type:"float"},{name:"u_viewport_size",type:"vec2"},{name:"u_pixel_extrude_scale",type:"vec2"},{name:"u_pitch",type:"float"}])).offsets,(Bk=class{constructor(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r}}).Replace=[1,0],Bk.disabled=new Bk(Bk.Replace,ke.transparent,[!1,!1,!1,!1]),Bk.unblended=new Bk(Bk.Replace,ke.transparent,[!0,!0,!0,!0]),Bk.alphaBlended=new Bk([1,771],ke.transparent,[!0,!0,!0,!0]),BS=class{constructor(e){this.gl=e,this.clearColor=new RJ(this),this.clearDepth=new RQ(this),this.clearStencil=new R0(this),this.colorMask=new R1(this),this.depthMask=new R2(this),this.stencilMask=new R3(this),this.stencilFunc=new R5(this),this.stencilOp=new R4(this),this.stencilTest=new R6(this),this.depthRange=new R8(this),this.depthTest=new R7(this),this.depthFunc=new R9(this),this.blend=new Be(this),this.blendFunc=new Bt(this),this.blendColor=new Br(this),this.blendEquation=new Bi(this),this.cullFace=new Bn(this),this.cullFaceSide=new Ba(this),this.frontFace=new Bo(this),this.program=new Bs(this),this.activeTexture=new Bl(this),this.viewport=new Bu(this),this.bindFramebuffer=new Bc(this),this.bindRenderbuffer=new Bh(this),this.bindTexture=new Bd(this),this.bindVertexBuffer=new Bf(this),this.bindElementBuffer=new Bp(this),this.bindVertexArray=new Bm(this),this.pixelStoreUnpack=new Bg(this),this.pixelStoreUnpackPremultiplyAlpha=new By(this),this.pixelStoreUnpackFlipY=new Bv(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),e.getExtension("EXT_color_buffer_half_float"),e.getExtension("EXT_color_buffer_float"),this.projectionUniformBuffer=new OJ(this,OX.ProjectionUBO,OQ),this.terrainUniformBuffer=new OJ(this,OX.TerrainUBO,O1),this.frameUniformBuffer=new OJ(this,OX.FrameUBO,BA)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0,this.projectionUniformBuffer.bindingDirty=!0,this.terrainUniformBuffer.bindingDirty=!0,this.frameUniformBuffer.bindingDirty=!0}setCustomLayerDefaults(){this.unbindVAO(),this.cullFace.setDefault(),this.activeTexture.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}createIndexBuffer(e,t){return new RY(this,e,t)}createVertexBuffer(e,t,r){return new RX(this,e,t,r)}createRenderbuffer(e,t,r){let i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),n}createFramebuffer(e,t,r,i){return new BT(this,e,t,r,i)}clear({color:e,depth:t,stencil:r}){let i=this.gl,n=0;e&&(n|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(n|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==r&&(n|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),i.clear(n)}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(e){xc(e.blendFunction,Bk.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){return this.gl.createVertexArray()}deleteVertexArray(e){this.gl.deleteVertexArray(e)}unbindVAO(){this.bindVertexArray.set(null)}},(BE=class{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}}).ReadOnly=!1,BE.ReadWrite=!0,BE.disabled=new BE(519,BE.ReadOnly,[0,1]),(BD=class{constructor(e,t,r,i,n,a){this.test=e,this.ref=t,this.mask=r,this.fail=i,this.depthFail=n,this.pass=a}}).disabled=new BD({func:519,mask:0},0,0,7680,7680,7680),(BC=class{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}}).disabled=new BC(!1,1029,2305),BC.backCCW=new BC(!0,1029,2305),BC.frontCCW=new BC(!0,1028,2305),BL=vp(new Float32Array(16)),BP=0,Bz=[new vl(0,0),new vl(Md,0),new vl(Md,Md),new vl(0,Md)],BF=new ke(1,0,0,1),BO=new ke(0,1,0,1),BR=new ke(0,0,1,1),BB=new ke(1,0,1,1),Bj=new ke(0,1,1,1),BN={symbol:Pq,circle:P$,heatmap:PW,line:PQ,fill:P2,fillExtrusion:P6,hillshade:P7,colorRelief:ze,raster:zr,background:zn,sky:zf,atmosphere:zp,custom:zc,debug:zu,debugPadding:za,terrainDepth:zh},(BV=class{constructor(e,t){this.drawFunctions=BN,this.context=new BS(e),this.transform=t,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:vp(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=FK.maxOverzooming+FK.maxUnderzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new Of}resize(e,t,r){if(this.width=Math.floor(e*r),this.height=Math.floor(t*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style._order)this.style._layers[e].resize()}setup(){let e=this.context,t=new Eo;t.emplaceBack(0,0),t.emplaceBack(Md,0),t.emplaceBack(0,Md),t.emplaceBack(Md,Md),this.tileExtentBuffer=e.createVertexBuffer(t,FP.members),this.tileExtentSegments=EE.simpleSegment(0,0,4,2);let r=new Eo;r.emplaceBack(0,0),r.emplaceBack(Md,0),r.emplaceBack(0,Md),r.emplaceBack(Md,Md),this.debugBuffer=e.createVertexBuffer(r,FP.members),this.debugSegments=EE.simpleSegment(0,0,4,5);let i=new El;i.emplaceBack(0,0,0,0),i.emplaceBack(Md,0,Md,0),i.emplaceBack(0,Md,0,Md),i.emplaceBack(Md,Md,Md,Md),this.rasterBoundsBuffer=e.createVertexBuffer(i,OG.members),this.rasterBoundsSegments=EE.simpleSegment(0,0,4,2);let n=new Eo;n.emplaceBack(0,0),n.emplaceBack(Md,0),n.emplaceBack(0,Md),n.emplaceBack(Md,Md),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(n,FP.members),this.rasterBoundsSegmentsPosOnly=EE.simpleSegment(0,0,4,5);let a=new Eo;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,FP.members),this.viewportSegments=EE.simpleSegment(0,0,4,2);let o=new EM;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);let s=new ET;s.emplaceBack(1,0,2),s.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new BD({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.tileExtentMesh=new FL(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let e=this.context,t=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=vd();Mo(r,0,this.width,this.height,0,0,1),vv(r,r,[t.drawingBufferWidth,t.drawingBufferHeight,0]),this.useProgram("clippingMask",null,!0).draw(e,t.TRIANGLES,BE.disabled,this.stencilClearMode,Bk.disabled,BC.disabled,null,null,{mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r,clipAntimeridian:!1},"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(e,t,r){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t?.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let i=this.context;i.setColorMode(Bk.disabled),i.setDepthMode(BE.disabled);let n={};for(let e of t)n[e.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(n,t,r,!0),this._renderTileMasks(n,t,r,!1),this._tileClippingMaskIDs=n}_renderTileMasks(e,t,r,i){let n=this.context,a=n.gl,o=this.style.projection,s=this.transform,l=this.useProgram("clippingMask");for(let u of t){let t=e[u.key],c=this.getTerrainDataForTile(u,r),h=o.getMeshFromTileID(this.context,u.canonical,i,!0,"stencil"),d=s.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!r,applyTerrainMatrix:!0});l.draw(n,a.TRIANGLES,BE.disabled,new BD({func:a.ALWAYS,mask:0},t,255,a.KEEP,a.KEEP,a.REPLACE),Bk.disabled,r?BC.disabled:BC.backCCW,null,c,d,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}getTerrainDataForTile(e,t){var r,i;return t&&(null==(r=this.style.projection)?void 0:r.name)==="mercator"?null:(null==(i=this.style.map.terrain)?void 0:i.getTerrainData(e))||null}_renderTilesDepthBuffer(){var e;let t=this.context,r=t.gl,i=this.style.projection,n=this.transform,a=this.useProgram("depth"),o=this.getDepthModeFor3D();for(let s of LH(n,{tileSize:n.tileSize})){let l=null==(e=this.style.map.terrain)?void 0:e.getTerrainData(s),u=i.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),c=n.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});a.draw(t,r.TRIANGLES,o,BD.disabled,Bk.disabled,BC.backCCW,null,l,c,"$clipping",u.vertexBuffer,u.indexBuffer,u.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new BD({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new BD({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,r=e.sort((e,t)=>t.overscaledZ-e.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();let e={};for(let r=0;rt.overscaledZ-e.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(this.clearStencil(),n>1){let e={},a={};for(let r=0;r0});this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.patternAtlas=e.patternAtlas,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(Ll()),function(e,t){let r=e.pending,{transform:i}=t,n=t.context.gl;r[BM.u_units_to_pixels]=1/i.pixelsToGLUnits[0],r[BM.u_units_to_pixels+1]=1/i.pixelsToGLUnits[1],r[BM.u_world_size]=n.drawingBufferWidth,r[BM.u_world_size+1]=n.drawingBufferHeight,r[BM.u_camera_to_center_distance]=i.cameraToCenterDistance,r[BM.u_symbol_fade_change]=t.options.fadeDuration?t.symbolFadeChange:1,r[BM.u_aspect_ratio]=i.width/i.height,r[BM.u_device_pixel_ratio]=t.pixelRatio,r[BM.u_viewport_size]=i.width,r[BM.u_viewport_size+1]=i.height,r[BM.u_pixel_extrude_scale]=1/i.width,r[BM.u_pixel_extrude_scale+1]=1/i.height,r[BM.u_pitch]=i.pitch/360*2*Math.PI,e.upload()}(this.context.frameUniformBuffer,this),this.imageManager.beginFrame();let u=this.style._order,c=this.style.tileManagers,h={},d={},f={};for(let e in c){let t=c[e];t.used&&t.prepare(this.context),h[e]=t.getVisibleCoordinates(!1),d[e]=h[e].slice().reverse(),f[e]=t.getVisibleCoordinates(!0).reverse()}l.opaquePassCutoff=1/0;for(let e=0;e=0;l.currentLayer--){let e=this.style._layers[u[l.currentLayer]];if(e.isHidden(this.transform.zoom))continue;let t=c[e.source],r=h[e.source];this.renderTileClippingMasks(e,r,!1),this.renderLayer(this,t,e,r,l)}l.currentPass="translucent";let p=!1;for(l.currentLayer=0;l.currentLayerr.source&&!r.isHidden(t)?[e.tileManagers[r.source]]:[]),n=i.filter(e=>"vector"===e.getSource().type),a=i.filter(e=>"vector"!==e.getSource().type),o=e=>{(!r||r.getSource().maxzoom0?t.pop():null}acquireRTT(e){let t=this.context.gl,r=this._rttObjectRecyclePool.pop();if(r)return r.size!==e&&(r.texture.update({width:e,height:e,data:null},{premultiply:!1,useMipmap:!0}),r.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE,t.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&t.texParameterf(t.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),r.size=e),r;let i=new Df(this.context,{width:e,height:e,data:null},t.RGBA,{premultiply:!1,useMipmap:!0});return i.bind(t.LINEAR,t.CLAMP_TO_EDGE,t.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&t.texParameterf(t.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:i,size:e}}bindRTT(e){let t=this.context.gl,r=e.size;if(!this._rttSharedFbo){let e=this.context.createFramebuffer(r,r,!0,!0),i=this.context.createRenderbuffer(t.DEPTH_STENCIL,r,r);e.depthAttachment.set(i),this._rttSharedFbo={fbo:e,depthRenderbuffer:i,size:r}}this._rttSharedFbo.size!==r&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,r,r),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=r,this._rttSharedFbo.fbo.height=r,this._rttSharedFbo.size=r),this._rttSharedFbo.fbo.colorAttachment.set(e.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(e){this._rttObjectRecyclePool.push(e)}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.patternAtlas.getPattern(e.from.toString()),r=this.patternAtlas.getPattern(e.to.toString());return!t||!r}useProgram(e,t,r=!1,i=[]){var n;this.cache||(this.cache={});let a=!!this.style.map.terrain,o=this.style.projection,s=r?Ov.projectionMercator:o.shaderPreludeCode,l=r?"#define PROJECTION_MERCATOR":o.shaderDefine,u=`/${r?"mercator":o.shaderVariantName}`,c=e+(t?t.cacheKey:"")+u+(this._showOverdrawInspector?"/overdraw":"")+(a?"/terrain":"")+(i?`/${i.join("/")}`:"");return(n=this.cache)[c]||(n[c]=new O3(this.context,Ov[e],t,RW[e],this._showOverdrawInspector,a,s,l,i)),this.cache[c]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}setBaseState(){let 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(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let e=this.context.gl;this.debugOverlayTexture=new Df(this.context,this.debugOverlayCanvas,e.RGBA)}}destroy(){var e,t,r;if(this._tileTextures){for(let e in this._tileTextures){let t=this._tileTextures[e];if(t)for(let e of t)e.destroy()}this._tileTextures={}}for(let e of this._rttObjectRecyclePool)e.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let e=this.context.gl;e.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),e.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}if(null==(e=this.layerOpacityFbo)||e.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&(null==(t=this.tileExtentMesh.vertexBuffer)||t.destroy()),this.tileExtentMesh&&(null==(r=this.tileExtentMesh.indexBuffer)||r.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let e in this.cache){let t=this.cache[e];t?.program&&this.context.gl.deleteProgram(t.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}).MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,BU=BV,Bq=class extends Error{constructor(e,t){var r;super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=e,this.statusMessage=null!=(r=t?.statusMessage)?r:null}},BG=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{var e;let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):(null!=(e=[...t.keys()][0])?e:"").split("/")},this._onHashChange=()=>{let e=this._getCurrentHash();if(!this._isValidHash(e))return!1;let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{let e=this._getHashParams();if(this._hashName)e.delete(this._hashName);else{let t=Array.from(e.keys());t.length>0&&e.delete(t[0])}let t=decodeURIComponent(e.toString()).replace(/=&/g,"&").replace(/=$/g,""),r=t?`#${t}`:"",i=window.location.href.replace(/(#.+)?$/,r);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=zm(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let t=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=10**Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.round(t.lng*i)/i,a=Math.round(t.lat*i)/i,o=this._map.getBearing(),s=this._map.getPitch(),l="";if(l+=e?`/${n}/${a}/${r}`:`${r}/${a}/${n}`,(o||s)&&(l+=`/${Math.round(10*o)/10}`),s&&(l+=`/${Math.round(s)}`),this._hashName){let e=this._getHashParams();return e.set(this._hashName,l),`#${decodeURIComponent(e.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${l}`}_isValidHash(e){if(e.length<3||e.some(e=>isNaN(+e)))return!1;try{new DJ(+e[2],+e[1])}catch{return!1}let t=+e[0],r=+(e[3]||0),i=+(e[4]||0);return t>=this._map.getMinZoom()&&t<=this._map.getMaxZoom()&&r>=-180&&r<=180&&i>=this._map.getMinPitch()&&i<=this._map.getMaxPitch()}},B$=xi({deceleration:2500,maxSpeed:1400},BH={linearity:.3,easing:xe(0,0,.3,1)}),BW=xi({deceleration:20,maxSpeed:1400},BH),BY=xi({deceleration:1e3,maxSpeed:360},BH),BZ=xi({deceleration:1e3,maxSpeed:90},BH),BX=xi({deceleration:1e3,maxSpeed:360},BH),BK=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Ll(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=Ll();for(;e.length>0&&t-e[0].time>160;)e.shift()}_getVelocityEntries(){let e=this._inertiaBuffer,t=Ll()-60,r=Math.max(0,e.length-2);for(;r>0&&e[r-1].time>=t;)r--;return e.slice(r)}_onMoveEnd(e){this._drainInertiaBuffer();let t=this._getVelocityEntries();if(t.length<2)return void this.clear();let r={zoom:0,bearing:0,pitch:0,roll:0,pan:new vl(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of t)e.around&&(r.around=e.around),e.pinchAround&&(r.pinchAround=e.pinchAround);for(let{settings:e}of t.slice(1))r.zoom+=e.zoomDelta||0,r.bearing+=e.bearingDelta||0,r.pitch+=e.pitchDelta||0,r.roll+=e.rollDelta||0,e.panDelta&&r.pan._add(e.panDelta);if(!r.pan.mag()&&!r.zoom&&!r.bearing&&!r.pitch&&!r.roll)return void this.clear();let i=Ll()-t[0].time,n={};if(r.pan.mag()){let t=zy(r.pan.mag(),i,xi({},B$,e||{})),a=r.pan.mult(t.amount/r.pan.mag()),o=this._map._camera.cameraHelper.handlePanInertia(a,this._map._camera.transform);n.center=o.easingCenter,n.offset=o.easingOffset,zg(n,t)}if(r.zoom){let e=zy(r.zoom,i,BW);n.zoom=xs(this._map.getZoom()+e.amount,this._map.getZoomSnap(),e.amount),zg(n,e)}if(r.bearing){let e=zy(r.bearing,i,BY);n.bearing=this._map.getBearing()+xt(e.amount,-179,179),zg(n,e)}if(r.pitch){let e=zy(r.pitch,i,BZ);n.pitch=this._map.getPitch()+e.amount,zg(n,e)}if(r.roll){let e=zy(r.roll,i,BX);n.roll=this._map.getRoll()+xt(e.amount,-179,179),zg(n,e)}if(n.zoom||n.bearing){let e=void 0===r.pinchAround?r.around:r.pinchAround;n.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),xi(n,{noMoveStart:!0})}},BJ=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new z5(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new z2(e.type,this._map,e))}mouseup(e){this._map.fire(new z2(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new z2(e.type,this._map,e))}dblclick(e){return this._firePreventable(new z2(e.type,this._map,e))}mouseover(e){this._map.fire(new z2(e.type,this._map,e))}mouseout(e){this._map.fire(new z2(e.type,this._map,e))}touchstart(e){return this._firePreventable(new z3(e.type,this._map,e))}touchmove(e){this._map.fire(new z3(e.type,this._map,e))}touchend(e){this._map.fire(new z3(e.type,this._map,e))}touchcancel(e){this._map.fire(new z3(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},BQ=class{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new z2(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new z2("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new z2(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},B0=class{constructor(e,t,r){this._map=e,this._tr=r,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1,t.boxZoom&&"object"==typeof t.boxZoom&&(this._boxZoomEnd=t.boxZoom.boxZoomEnd)}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&&(zY.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active||this._lastPos.equals(t)||!this._box&&t.dist(this._startPos)e.fitScreenCoordinates(r,t,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box=(this._box.remove(),null)),zY.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new z4(e,{originalEvent:t}))}},B1=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,t,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=function(e){let t=new vl(0,0);for(let r of e)t._add(r);return t.div(e.length)}(t),this.touches=zv(r,t)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;let i=zv(r,t);for(let e in this.touches){let t=this.touches[e],r=i[e];(!r||r.dist(t)>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}},B2=class{constructor(e){this.singleTap=new B1(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){let i=this.singleTap.touchend(e,t,r);if(i){let t=e.timeStamp-this.lastTime<500,r=!this.lastTap||30>this.lastTap.dist(i);if(t&&r||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}},B3=class{constructor(e,t){this._tr=t,this._zoomIn=new B2({numTouches:1,numTaps:2}),this._zoomOut=new B2({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){let i=this._zoomIn.touchend(e,t,r),n=this._zoomOut.touchend(e,t,r),a=this._tr;return i?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:xs(a.zoom+1,t.getZoomSnap()),around:a.unproject(i)},{originalEvent:e})}):n?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:xs(a.zoom-1,t.getZoomSnap()),around:a.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}},B5=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(t)?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);let i=Array.isArray(t)?t[0]:t;if(!(!this._moved&&i.dist(r)!0}),t=new B8){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=t}_executeRelevantHandler(e,t,r){return e instanceof MouseEvent?t(e):"u">typeof TouchEvent&&e instanceof TouchEvent?r(e):void 0}startMove(e){this._executeRelevantHandler(e,e=>{this.mouseMoveStateManager.startMove(e)},e=>{this.oneFingerTouchMoveStateManager.startMove(e)})}endMove(e){this._executeRelevantHandler(e,e=>{this.mouseMoveStateManager.endMove(e)},e=>{this.oneFingerTouchMoveStateManager.endMove(e)})}isValidStartEvent(e){return!!this._executeRelevantHandler(e,e=>this.mouseMoveStateManager.isValidStartEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidStartEvent(e))}isValidMoveEvent(e){return!!this._executeRelevantHandler(e,e=>this.mouseMoveStateManager.isValidMoveEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(e))}isValidEndEvent(e){return!!this._executeRelevantHandler(e,e=>this.mouseMoveStateManager.isValidEndEvent(e),e=>this.oneFingerTouchMoveStateManager.isValidEndEvent(e))}},B9=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}},je=class{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new vl(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active)return this._shouldBePrevented(r.length)?void this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e):(e.preventDefault(),this._calculateTransform(e,t,r))}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,t,r){r.length>0&&(this._active=!0);let i=zv(r,t),n=new vl(0,0),a=new vl(0,0),o=0;for(let e in i){let t=i[e],r=this._touches[e];r&&(n._add(t),a._add(t.sub(r)),o++,i[e]=t)}if(this._touches=i,this._shouldBePrevented(o)||!a.mag())return;let s=a.div(o);if(this._sum._add(s),!(this._sum.mag()=2,n=t.mag()>=2;if(!i&&!n)return;if(!i||!n)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return zw(e)&&zw(t)&&a}},ja={panStep:100,bearingStep:15,pitchStep:10},jo=class{constructor(e,t){this._tr=t,this._panStep=ja.panStep,this._bearingStep=ja.bearingStep,this._pitchStep=ja.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,i=0,n=0,a=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?r=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:zT,zoom:t?xs(s.zoom+t*(e.shiftKey?2:1),o.getZoomSnap()):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+i*this._pitchStep,offset:[-n*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}},js=class{constructor(e,t,r){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=r,this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}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)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=Ll(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==t&&t%4.000244140625==0?this._type="wheel":0!==t&&4>Math.abs(t)?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=200>Math.abs(i*t)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let t=zY.mousePos(this._map.getCanvas(),e),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(DJ.convert(r.center)):t,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let t=e.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=t),"number"==typeof this._targetZoom&&(this._targetZoom+=t)}if(0!==this._delta){let t="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==r&&(r=1/r);let i="number"==typeof this._targetZoom?xa(this._targetZoom):e.scale,n=e.applyConstrain(e.getCameraLngLat(),xo(i*r)).zoom,a=this._map.getZoomSnap();if("wheel"===this._type&&a>0){let t=xs(e.zoom,a);this._targetZoom=xs(n,a,n-t)}else this._targetZoom=n;"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let t="number"==typeof this._targetZoom?this._targetZoom:e.zoom,r=this._startZoom,i=this._easing,n=!1,a;if("wheel"===this._type&&r&&i){let e=Math.min((Ll()-this._lastWheelEventTime+5)/200,1),o=i(e);a=kv.number(r,t,o),e<1?this._needsRerender=!0:n=!0}else a=t,n=!0;return this._active=!0,n&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!n,zoomDelta:a-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=Mf;if(this._prevEase){let e=this._prevEase,r=(Ll()-e.start)/e.duration,i=e.easing(r+.01)-e.easing(r),n=.27/Math.sqrt(i*i+1e-4)*.01,a=Math.sqrt(.0729-n*n);t=xe(n,a,.25,1)}return this._prevEase={start:Ll(),duration:e,easing:t},t}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},jl=class{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()}},ju=class{constructor(e,t){this._tr=t,this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:xs(this._tr.zoom+(e.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},jc=class{constructor(){this._tap=new B2({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,r){if(!this._swipePoint)if(this._tapTime){let i=t[0],n=e.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(i);n&&a?r.length>0&&(this._swipePoint=i,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(e,t,r)}touchmove(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let i=t[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:n/128*this._zoomRate}}}else this._tap.touchmove(e,t,r)}touchend(e,t,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{let i=this._tap.touchend(e,t,r);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},jh=class{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},jd=class{constructor(e,t,r,i){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=r,this._mouseRoll=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},jf=class{constructor(e,t,r,i){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},jp=class{constructor(e,t){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=zY.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=t,this._container.appendChild(i);let n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=r,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,t){this._enabled&&(this._map.fire(new zK("cooperativegestureprevented",{gestureType:e,originalEvent:t})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},jm=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(vl.convert(e),this._camera.terrain)}},jg=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate,jy=class extends MC{},jv=class{get _ownerDocument(){var e;return(null==(e=this._el)?void 0:e.ownerDocument)||document}get _ownerWindow(){var e,t;return(null==(t=null==(e=this._el)?void 0:e.ownerDocument)?void 0:t.defaultView)||window}constructor(e,t,r){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;let r="renderFrame"===e.type?void 0:e,i={needsRenderFrame:!1},n={},a={};for(let{handlerName:s,handler:l,allowed:u}of this._handlers){let c;if(l.isEnabled()){if(this._blockedByActive(a,u,s))l.reset();else if(l[t||e.type]){if(function(e,t){var r,i;if(!M_[t])return!1;let n=(null==(i=null==(r=e?.target)?void 0:r.ownerDocument)?void 0:i.defaultView)||window;return e instanceof n.MouseEvent||e instanceof n.WheelEvent}(e,t||e.type)){let r=zY.mousePos(this._map.getCanvas(),e);c=l[t||e.type](e,r)}else{var o;if(Mb[t||e.type]&&"touches"in e){let r=e.touches,i=this._getMapTouches(r),n=zY.touchPos(this._map.getCanvas(),i);c=l[t||e.type](e,n,i)}else Mb[o=t||e.type]||M_[o]||(c=l[t||e.type](e))}this.mergeHandlerResult(i,n,c,s,r),c?.needsRenderFrame&&this._triggerRenderFrame()}(c||l.isActive())&&(a[s]=l)}}let s={};for(let e in this._previousActiveHandlers)a[e]||(s[e]=r);this._previousActiveHandlers=a,(Object.keys(s).length||zA(i))&&(this._changes.push([i,n,s]),this._triggerRenderFrame()),(Object.keys(a).length||zA(i))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:l}=i;l&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],l(this._map))},this._map=e,this._camera=t,this._transformProvider=new jm(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new BK(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);let i=this._el;for(let[e,t,r]of(this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]],this._listeners))e.addEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(let[e,t,r]of this._listeners)e.removeEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){let t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new BJ(t,e));let i=t.boxZoom=new B0(t,e,this._transformProvider);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let n=t.cooperativeGestures=new jp(t,e.cooperativeGestures);this._add("cooperativeGestures",n),e.cooperativeGestures&&n.enable();let a=new B3(t,this._transformProvider),o=new ju(t,this._transformProvider);t.doubleClickZoom=new jl(o,a),this._add("tapZoom",a),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new jc;this._add("tapDragZoom",s);let l=t.touchPitch=new jn(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let u=()=>t.project(t.getCenter()),c=function({enable:e,clickTolerance:t,aroundCenter:r=!0,minPixelCenterThreshold:i=100,rotateSpeed:n=.8},a){return new B5({clickTolerance:t,move:(e,t)=>{let o=a();if(r&&Math.abs(o.y-e.y)>i)return{bearingDelta:xb(new vl(e.x,t.y),t,o)};let s=(t.x-e.x)*n;return r&&t.y0===e.button&&e.ctrlKey||2===e.button&&!e.ctrlKey}),enable:e,assignEvents:B9})}(e,u),h=function({enable:e,clickTolerance:t,pitchSpeed:r=-.5}){return new B5({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*r}),moveStateManager:new B6({checkCorrectEvent:e=>0===e.button&&e.ctrlKey||2===e.button}),enable:e,assignEvents:B9})}(e),d=function({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:r=.3},i){return new B5({clickTolerance:t,move:(e,t)=>{let n=i(),a=(t.x-e.x)*r;return t.y2===e.button&&e.ctrlKey}),enable:e,assignEvents:B9})}(e,u);t.dragRotate=new jd(e,c,h,d),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",d,["mousePitch"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();let f=function({enable:e,clickTolerance:t}){return new B5({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:new B6({checkCorrectEvent:e=>0===e.button&&!e.ctrlKey}),enable:e,assignEvents:B9})}(e),p=new je(e,t);t.dragPan=new jh(r,f,p),this._add("mousePan",f),this._add("touchPan",p,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let m=new ji,g=new jr;t.touchZoomRotate=new jf(r,g,m,s),this._add("touchRotate",m,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new BQ(t));let y=t.scrollZoom=new js(t,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",y,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let v=t.keyboard=new jo(t,this._transformProvider);this._add("keyboard",v),e.interactive&&e.keyboard&&t.keyboard.enable()}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{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!!jg(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,r){for(let i in e)if(i!==r&&!t?.includes(i))return!0;return!1}_getMapTouches(e){let t=[];for(let r of e){let e=r.target;this._el.contains(e)&&t.push(r)}return t}mergeHandlerResult(e,t,r,i,n){if(!r)return;xi(e,r);let a={handlerName:i,originalEvent:r.originalEvent||n};void 0!==r.zoomDelta&&(t.zoom=a),void 0!==r.panDelta&&(t.drag=a),void 0!==r.rollDelta&&(t.roll=a),void 0!==r.pitchDelta&&(t.pitch=a),void 0!==r.bearingDelta&&(t.rotate=a)}_applyChanges(){let e={},t={},r={};for(let[i,n,a]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new vl(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.rollDelta&&(e.rollDelta=(e.rollDelta||0)+i.rollDelta),void 0!==i.around&&(e.around=i.around),void 0!==i.pinchAround&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),xi(t,n),xi(r,a);this._updateMapTransform(e,t,r),this._changes=[]}_updateMapTransform(e,t,r){let i=this._map,n=this._camera.getTransformForUpdate(),a=i.terrain;if(!zA(e)&&!(a&&this._terrainMovement))return void this._fireEvents(t,r,!0);this._camera.stop(!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:u,rollDelta:c}=e,{around:h,aroundOnSurface:d}=this._resolveAround(e,a,n),f=a?this._terrainGestureElevation(a,h,d,n,t):void 0,p={panDelta:o,zoomDelta:s,rollDelta:c,pitchDelta:u,bearingDelta:l,around:h,aroundElevation:f};this._camera.cameraHelper.useGlobeControls&&!n.isPointOnMapSurface(h)&&(h=n.centerPoint);let m=this._computePreZoomAroundLoc(n,h,o,f);this._handleMapControls({terrain:a,tr:n,deltasForHelper:p,preZoomAroundLoc:m,combinedEventsInProgress:t,panDelta:o}),this._camera.applyUpdatedTransform(n),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r,!0)}_resolveAround(e,t,r){let i=void 0===e.pinchAround?e.around:e.pinchAround;return i||(i=this._camera.transform.centerPoint),t&&!r.isPointOnMapSurface(i)?{around:r.centerPoint,aroundOnSurface:!1}:{around:i,aroundOnSurface:!0}}_terrainGestureElevation(e,t,r,i,n){if(!r)return;if(!this._terrainMovement&&(n.drag||n.zoom)){let r=i.screenTerrainPointToMercatorCoordinate(t,e);this._terrainGestureAnchorElevation=r?r.z:null}if(null===this._terrainGestureAnchorElevation)return;let a=this._terrainGestureAnchorElevation;if(!(.01>t.distSqr(i.centerPoint))&&!(a-i.elevation>=.9*(i.getCameraAltitude()-i.elevation)))return a}_computePreZoomAroundLoc(e,t,r,i){if(.01>t.distSqr(e.centerPoint))return e.center;let n=r?t.sub(r):t;return void 0===i?e.screenPointToLocation(n):e.screenPointToLocationAtElevation(n,i)}_handleMapControls({terrain:e,tr:t,deltasForHelper:r,preZoomAroundLoc:i,combinedEventsInProgress:n,panDelta:a}){let o=this._camera.cameraHelper;if(o.handleMapControlsRollPitchBearingZoom(r,t),!e)return void o.handleMapControlsPan(r,t,i);if(o.useGlobeControls){!this._terrainMovement&&(n.drag||n.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),o.handleMapControlsPan(r,t,i);return}if(!this._terrainMovement&&(n.drag||n.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,o.handleMapControlsPan(r,t,i);return}void 0===r.aroundElevation&&n.drag&&this._terrainMovement&&a?t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):o.handleMapControlsPan(r,t,i)}_fireEvents(e,t,r){let i=jg(this._eventsInProgress),n=jg(e),a={};for(let t in e){let{originalEvent:r}=e[t];this._eventsInProgress[t]||(a[`${t}start`]=r),this._eventsInProgress[t]=e[t]}for(let e in!i&&n&&this._fireEvent("movestart",n.originalEvent),a)this._fireEvent(e,a[e]);for(let t in n&&this._fireEvent("move",n.originalEvent),e){let{originalEvent:r}=e[t];this._fireEvent(t,r)}let o={},s;for(let e in this._eventsInProgress){let{handlerName:r,originalEvent:i}=this._eventsInProgress[e];this._handlersById[r].isActive()||(delete this._eventsInProgress[e],s=t[r]||i,o[`${e}end`]=s)}for(let e in o)this._fireEvent(e,o[e]);let l=jg(this._eventsInProgress),u=(i||n)&&!l;if(u&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let e=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&e.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(e)}if(r&&u){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),t=e=>0!==e&&-this._bearingSnap{delete this._frameId,this.handleEvent(new jy("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}},jx=class extends ML{constructor(e){var t,r,i;super(),this._renderFrameCallback=()=>{let e=Math.min((Ll()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new OE,this.cameraHelper=new OD,void 0!==e.minZoom&&this.transform.setMinZoom(e.minZoom),void 0!==e.maxZoom&&this.transform.setMaxZoom(e.maxZoom),void 0!==e.minPitch&&this.transform.setMinPitch(e.minPitch),void 0!==e.maxPitch&&this.transform.setMaxPitch(e.maxPitch),void 0!==e.renderWorldCopies&&this.transform.setRenderWorldCopies(e.renderWorldCopies),null!==e.transformConstrain&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=null==(t=e.centerClampedToGround)||t,this.transformCameraUpdate=null!=(r=e.transformCameraUpdate)?r:null,this._stopHandlers=null!=(i=e.stopHandlers)?i:()=>{},this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,t){if(e.apply(this.transform,!0),this.transform=e,this.cameraHelper=t,this._requestedCameraState){let t=e.clone();t.apply(this._requestedCameraState,!0),this._requestedCameraState=t}}getCenter(){return new DJ(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,t,r){return e=vl.convert(e).mult(-1),this.panTo(this.transform.center,xi({offset:e},t),r)}panTo(e,t,r){return this.easeTo(xi({center:e},t),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,r){return this.easeTo(xi({zoom:e},t),r)}zoomIn(e,t){return this.zoomTo(xs(this.getZoom()+1,this._zoomSnap),e,t),this}zoomOut(e,t){return this.zoomTo(xs(this.getZoom()-1,this._zoomSnap),e,t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,t){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new zJ("movestart",t)).fire(new zJ("move",t)).fire(new zJ("moveend",t))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}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(e,t,r){return this.easeTo(xi({bearing:e},t),r)}resetNorth(e,t){return this.rotateTo(0,xi({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(xi({bearing:0,pitch:0,roll:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing()){p.easeFunc(i),this.terrain&&!e.freezeElevation&&this._updateElevation(i),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},r=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(t,r)},e),this}_prepareEase(e,t,r={}){this._moving=!0,t||r.moving||this.fire(new zJ("movestart",e)),this._zooming&&!r.zooming&&this.fire(new zJ("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new zJ("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new zJ("pitchstart",e)),this._rolling&&!r.rolling&&this.fire(new zJ("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(e,this.transform),this.elevationFreeze=!0}_updateElevation(e){(void 0===this._elevationStart||void 0===this._elevationCenter)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let t=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(e<1&&t!==this._elevationTarget){let r=this._elevationTarget-this._elevationStart,i=(t-(r*e+this._elevationStart))/(1-e);this._elevationStart+=e*(r-i),this._elevationTarget=t}this.transform.setElevation(kv.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};let t=e.getCameraLngLat(),r=e.getCameraAltitude(),i=this.terrain?this.terrain.getElevationForLngLatZoom(t,e.zoom):0;if(rthis._elevateCameraIfInsideTerrain(e)),this.transformCameraUpdate&&t.push(e=>this.transformCameraUpdate(e)),!t.length)return;let r=e.clone();for(let e of t){let t=r.clone(),{center:i,zoom:n,roll:a,pitch:o,bearing:s,elevation:l}=e(t);i&&t.setCenter(i),void 0!==l&&t.setElevation(l),void 0!==n&&t.setZoom(n),void 0!==a&&t.setRoll(a),void 0!==o&&t.setPitch(o),void 0!==s&&t.setBearing(s),r.apply(t,!1)}this.transform.apply(r,!1)}_fireMoveEvents(e){this.fire(new zJ("move",e)),this._zooming&&this.fire(new zJ("zoom",e)),this._rotating&&this.fire(new zJ("rotate",e)),this._pitching&&this.fire(new zJ("pitch",e)),this._rolling&&this.fire(new zJ("roll",e))}_afterEase(e,t){if(this._easeId&&t&&this._easeId===t)return;delete this._easeId;let r=this._zooming,i=this._rotating,n=this._pitching,a=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,r&&this.fire(new zJ("zoomend",e)),i&&this.fire(new zJ("rotateend",e)),n&&this.fire(new zJ("pitchend",e)),a&&this.fire(new zJ("rollend",e)),this.fire(new zJ("moveend",e))}flyTo(e,t){if(!e.essential&&zG.prefersReducedMotion){let r=xn(e,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(r,t)}this.stop(),void 0!==(e=xi({offset:[0,0],speed:1.2,curve:1.42,easing:Mf},e)).zoom&&this._zoomSnap&&(e.zoom=xs(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=r.bearing,n=r.pitch,a=r.roll,o=r.padding,s=void 0===e.bearing?i:this._normalizeBearing(e.bearing,i),l=void 0===e.pitch?n:+e.pitch,u=void 0===e.roll?a:this._normalizeBearing(e.roll,a),c=void 0===e.padding?r.padding:e.padding,h=vl.convert(e.offset),d=r.centerPoint.add(h),f=r.screenPointToLocation(d),p=this.cameraHelper.handleFlyTo(r,{bearing:s,pitch:l,roll:u,padding:c,locationAtOffset:f,offsetAsPoint:h,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),m=e.curve,g=Math.max(r.width,r.height),y=g/p.scaleOfZoom,v=p.pixelPathLength,x=g/p.scaleOfMinZoom,b=(m=Math.min(m,Math.sqrt(x/v*2)))*m;function _(e){let t=(y*y-g*g+(e?-1:1)*b*b*v*v)/(2*(e?y:g)*b*v);return Math.log(Math.sqrt(t*t+1)-t)}function w(e){return(Math.exp(e)-Math.exp(-e))/2}function T(e){return(Math.exp(e)+Math.exp(-e))/2}let A=_(!1),M=function(e){return T(A)/T(A+m*e)},k=function(e){var t;return g*((T(A)*(w(t=A+m*e)/T(t))-w(A))/b)/v},S=(_(!0)-A)/m;if(2e-6>Math.abs(v)||!isFinite(S)){if(1e-6>Math.abs(g-y))return this.easeTo(e,t);let r=y0,M=e=>Math.exp(r*m*e)}if(void 0!==e.duration)e.duration=+e.duration;else{let t=void 0===e.screenSpeed?+e.speed:e.screenSpeed/m;e.duration=1e3*S/t}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=i!==s,this._pitching=l!==n,this._rolling=u!==a,this._padding=!r.isPaddingEqual(c),this._prepareEase(t,!1),this.terrain&&this._prepareElevation(p.targetCenter),this._ease(f=>{let m=f*S,g=1/M(m),y=k(m);this._rotating&&r.setBearing(kv.number(i,s,f)),this._pitching&&r.setPitch(kv.number(n,l,f)),this._rolling&&r.setRoll(kv.number(a,u,f)),this._padding&&(r.interpolatePadding(o,c,f),d=r.centerPoint.add(h)),p.easeFunc(f,g,y,d),this.terrain&&!e.freezeElevation&&this._updateElevation(f),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(t)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||this._stopHandlers(),this}_ease(e,t,r){!1===r.animate||0===r.duration?(e(1),t()):(this._easeStart=Ll(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){let r=Math.abs((e=xr(e,-180,180))-t);return Math.abs(e-360-t)MapLibre'},j_=class{constructor(e=jb){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=e=>{e&&("terrain"===e.type||"style"===e.dataType||"source"===e.dataType&&("metadata"===e.sourceDataType||"visibility"===e.sourceDataType))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=zY.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=zY.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=zY.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(e=>"string"==typeof e?e:"")):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let t=this._map.style.tileManagers;for(let r in t){let i=t[r];if(i.used||i.usedForTerrain){let t=i.getSource();t.attribution&&!e.includes(t.attribution)&&e.push(t.attribution)}}(e=e.filter(e=>String(e).trim())).sort((e,t)=>e.length-t.length);let r=(e=e.filter((t,r)=>{for(let i=r+1;i{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){var t;this._map=e,this._compact=null==(t=this.options)?void 0:t.compact,this._container=zY.create("div","maplibregl-ctrl");let r=zY.create("a","maplibregl-ctrl-logo");return r.target="_blank",r.rel="noopener nofollow",r.href="https://maplibre.org/",r.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),r.setAttribute("rel","noopener nofollow"),this._container.appendChild(r),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},jT=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning;for(let r of t?this._queue.concat(t):this._queue)if(r.id===e){r.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];let r=!1,i;for(let n of t)if(!n.cancelled){try{n.callback(e)}catch(e){r||(r=!0,i=e)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,r)throw i}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},jA=["none","zoom","sourceTiles","visibleLayers","revision"],jM=class{constructor(e,t,r,i){this._tileKeys=e.map(e=>e.key).sort().join(),this._revision=t,this._zoom=r,this._visibleLayerIds=i}difference(e){return this._revision===e?._revision?this._visibleLayerIds===e._visibleLayerIds?this._tileKeys===e._tileKeys?this._zoom===e._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},jk={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0},jS=class{constructor(e,t){this.needsFollowUpFrame=!1,this.painter=e,this.terrain=t,this.rttSize=t.tileManager.tileSize*t.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}prepareForRender(e,t){let r=t!==this._lastPrepareZoom;this._lastPrepareZoom=t,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(r=>!e._layers[r].isHidden(t));let i=this._renderableLayerIds.join(),n=new Set;for(let t of this._renderableLayerIds){let r=e._layers[t],i=r.source;i&&jk[r.type]&&n.add(i)}for(let r of(this._coordsAscending={},this._rttFingerprints={},n)){let n=e.tileManagers[r];if(!n)continue;this._coordsAscending[r]={};let a=this._coordsAscending[r],o=n.getSource(),s=o instanceof FF?o.terrainTileRanges:null;for(let e of n.getVisibleCoordinates()){let t=this.terrain.tileManager.getTerrainCoords(e,s);for(let e in t)a[e]||(a[e]=[]),a[e].push(t[e])}this._rttFingerprints[r]={};let l=this._rttFingerprints[r],u=n.getState().revision;for(let e in a)l[e]=new jM(a[e],u,t,i)}this.needsFollowUpFrame=!1;let a=r||this.painter.options.moving,o=!1;for(let e of this._renderableTiles){let t=this._textureDifference(e);"none"!==t&&("zoom"===t&&a||"visibleLayers"===t&&r?this.needsFollowUpFrame=!0:"zoom"===t||"sourceTiles"===t?(o?this.needsFollowUpFrame=!0:e.releaseRTT(this.painter),o=!0):e.releaseRTT(this.painter))}}_textureDifference(e){let t="none";for(let r in this._rttFingerprints){let i=this._rttFingerprints[r][e.tileID.key];if(!i)continue;let n=i.difference(e.rttFingerprint[r]);jA.indexOf(n)>jA.indexOf(t)&&(t=n)}return t}renderLayer(e,t){if(e.isHidden(this.painter.transform.zoom))return!1;let r=f(d({},t),{isRenderingToTexture:!0}),i=e.type,n=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(jk[i]&&(this._prevType&&jk[this._prevType]||this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(e.id),!a))return!0;if(jk[this._prevType]||jk[i]&&a){this._prevType=i;let e=this._stacks.length-1,t=this._stacks[e]||[];for(let i of this._renderableTiles){if(this._rttTiles.push(i),i.getRTT(e))continue;let a=i.acquireRTT(n,e,this.rttSize);for(let e of(n.bindRTT(a),n.context.clear({color:ke.transparent,stencil:0}),n.currentStencilSource=void 0,t)){let t=n.style._layers[e],a=t.source?this._coordsAscending[t.source][i.tileID.key]:[i.tileID];n.context.viewport.set([0,0,this.rttSize,this.rttSize]),n.renderTileClippingMasks(t,a,!0),n.renderLayer(n,n.style.tileManagers[t.source],t,a,r),t.source&&(i.rttFingerprint[t.source]=this._rttFingerprints[t.source][i.tileID.key])}a.texture.generateMipmap()}return function(e,t,r,i){let{isRenderingGlobe:n}=i,a=e.context,o=a.gl,s=e.transform,l=e.colorModeForRenderPass(),u=e.getDepthModeFor3D(),c=e.useProgram("terrain");for(let i of(a.bindFramebuffer.set(null),a.viewport.set([0,0,e.width,e.height]),r)){let r=t.getTerrainMesh(i.tileID),h=e.renderToTexture.getTexture(i),d=t.getTerrainData(i.tileID);a.activeTexture.set(o.TEXTURE0),h.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_LINEAR);let f=OY(t.getSkirtLength(s.zoom),s.calculateFogMatrix(i.tileID.toUnwrapped()),e.style.sky,s.pitch,n),p=s.getProjectionData({overscaledTileID:i.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});c.draw(a,o.TRIANGLES,u,BD.disabled,l,BC.backCCW,f,d,p,"terrain",r.vertexBuffer,r.indexBuffer,r.segments)}}(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],jk[i]}return!1}},jE={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},jD={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:jb,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:MT.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},jC=class extends ML{get _ownerWindow(){var e,t;return(null==(t=null==(e=this._container)?void 0:e.ownerDocument)?void 0:t.defaultView)||window}constructor(e){var t,r,i;super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new jT,this._controls=[],this._mapId=Mp++,this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=e=>{if(e.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)return void this.fire(new z7("webglcontextlost",{originalEvent:e}));for(let e of Object.values(this.style._layers))if("custom"===e.type&&console.warn(`Custom layer with id '${e.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),e._listeners)for(let[t]of Object.entries(e._listeners))console.warn(`Custom layer with id '${e.id}' had event listeners for event '${t}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new z7("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style)for(let e in this.style.imageManager.images=this._lostContextStyle.images,this._lostContextStyle.images){let t=this._lostContextStyle.images[e];t.isWebGLImage&&this.style.imageManager.updateImage(e,t,!1)}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(e){this.fire(new MI(e));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new z7("webglcontextrestored",{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let n=f(d(d({},jD),e),{canvasContextAttributes:d(d({},jD.canvasContextAttributes),e.canvasContextAttributes)});if(null!=n.minZoom&&null!=n.maxZoom&&n.minZoom>n.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=n.minPitch&&null!=n.maxPitch&&n.minPitch>n.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=n.minPitch&&n.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=n.maxPitch&&n.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new jx({minZoom:n.minZoom,maxZoom:n.maxZoom,minPitch:n.minPitch,maxPitch:n.maxPitch,bearingSnap:n.bearingSnap,zoomSnap:n.zoomSnap,renderWorldCopies:n.renderWorldCopies,centerClampedToGround:n.centerClampedToGround,terrain:this.terrain,transformConstrain:n.transformConstrain,requestRenderFrame:e=>this._requestRenderFrame(e),cancelRenderFrame:e=>this._cancelRenderFrame(e),transformCameraUpdate:n.transformCameraUpdate,stopHandlers:()=>{var e;return null==(e=this._handlers)?void 0:e.stop(!1)}}),this._camera.setEventedParent(this),this._interactive=n.interactive,this._maxTileCacheSize=n.maxTileCacheSize,this._maxTileCacheZoomLevels=n.maxTileCacheZoomLevels,this._canvasContextAttributes=d({},n.canvasContextAttributes),this._trackResize=!0===n.trackResize,this._terrainSkirtLength=n.terrainSkirtLength,this._refreshExpiredTiles=!0===n.refreshExpiredTiles,this._fadeDuration=n.fadeDuration,this._crossSourceCollisions=!0===n.crossSourceCollisions,this._collectResourceTiming=!0===n.collectResourceTiming,this._locale=d(d({},jE),n.locale),this._clickTolerance=n.clickTolerance,this._overridePixelRatio=n.pixelRatio,this._maxCanvasSize=n.maxCanvasSize,this._zoomLevelsToOverscale=n.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=!0===n.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(n.anisotropicFilterPitch),void 0!==n.reduceMotion&&(zG.prefersReducedMotion=n.reduceMotion),this._requestManager=new zX(n.transformRequest),this._container=this._resolveContainer(n.container),n.maxBounds&&this.setMaxBounds(n.maxBounds),this._setupContainer();try{this._setupPainter()}catch(e){throw this._cleanupContainer(),e}this._imageQueueHandle=zZ.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new jv(this,this._camera,n),"u">typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let a="string"==typeof n.hash&&n.hash||void 0;this._hash=n.hash?new BG(a).addTo(this):void 0,null!=(t=this._hash)&&t._onHashChange()||(this.jumpTo({center:n.center,elevation:n.elevation,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,roll:n.roll}),n.bounds&&(this.resize(),this.fitBounds(n.bounds,xi({},n.fitBoundsOptions,{duration:0}))));let o="string"==typeof n.style||(null==(i=null==(r=n.style)?void 0:r.projection)?void 0:i.type)!=="globe";this.resize(null,o),this._localIdeographFontFamily=n.localIdeographFontFamily,this._validateStyle=n.validateStyle,n.style&&this.setStyle(n.style,{localIdeographFontFamily:n.localIdeographFontFamily}),n.attributionControl&&this.addControl(new j_("boolean"==typeof n.attributionControl?void 0:n.attributionControl)),n.maplibreLogo&&this.addControl(new jw,n.logoPosition),this.on("style.load",()=>{if(o||this._resizeTransform(),this._camera.transform.unmodified){let e=xn(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(e)}}),this.on("data",e=>{this._update("style"===e.dataType),this.fire("style"===e.dataType?new z0("styledata",e):new z1("sourcedata",e))}),this.on("dataloading",e=>{this.fire("style"===e.dataType?new z0("styledataloading",e):new z1("sourcedataloading",e))}),this.on("dataabort",e=>{this.fire(new z1("sourcedataabort",e))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,t){if(void 0===t&&(t=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new MI(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[t];return t.includes("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}removeControl(e){if(!e?.onRemove)return this.fire(new MI(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(e);return t>-1&&this._controls.splice(t,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return LH(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new DJ(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,t){return this._camera.setCenter(e,t),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,t){return this._camera.setCenterElevation(e,t),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,t,r){return this._camera.panBy(e,t,r),this}panTo(e,t,r){return this._camera.panTo(e,t,r),this}getZoom(){return this._camera.transform.zoom}setZoom(e,t){return this._camera.setZoom(e,t),this}zoomTo(e,t,r){return this._camera.zoomTo(e,t,r),this}zoomIn(e,t){return this._camera.zoomIn(e,t),this}zoomOut(e,t){return this._camera.zoomOut(e,t),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,t){return this._camera.setVerticalFieldOfView(e,t),this}getBearing(){return this._camera.transform.bearing}setBearing(e,t){return this._camera.setBearing(e,t),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,t){return this._camera.setPadding(e,t),this}rotateTo(e,t,r){return this._camera.rotateTo(e,t,r),this}resetNorth(e,t){return this._camera.resetNorth(e,t),this}resetNorthPitch(e,t){return this._camera.resetNorthPitch(e,t),this}snapToNorth(e,t){return this._camera.snapToNorth(e,t),this}getPitch(){return this._camera.transform.pitch}setPitch(e,t){return this._camera.setPitch(e,t),this}getRoll(){return this._camera.transform.roll}setRoll(e,t){return this._camera.setRoll(e,t),this}cameraForBounds(e,t){return this._camera.cameraForBounds(e,t)}fitBounds(e,t,r){return this._camera.fitBounds(e,t,r),this}fitScreenCoordinates(e,t,r,i,n){return this._camera.fitScreenCoordinates(e,t,r,i,n),this}jumpTo(e,t){return this._camera.jumpTo(e,t),this}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n)}easeTo(e,t){return this._camera.easeTo(e,t),this}flyTo(e,t){return this._camera.flyTo(e,t),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(DJ.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,t,r,i){return null==i&&this.terrain&&(i=this.terrain.getElevationForLngLat(r,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(e,t,r,i??0)}resize(e,t=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(t);let r=!this._camera._moving;return r&&(this.stop(),this.fire(new zJ("movestart",e)).fire(new zJ("move",e))),this.fire(new zK("resize",e)),r&&this.fire(new zJ("moveend",e)),this}_resizeInternal(e=!0){let[t,r]=this._containerDimensions(),i=this._getClampedPixelRatio(t,r);if(this._resizeCanvas(t,r,i),this.painter.resize(t,r,i),this.painter.overLimit()){let e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];let i=this._getClampedPixelRatio(t,r);this._resizeCanvas(t,r,i),this.painter.resize(t,r,i)}this._resizeTransform(e)}_resizeTransform(e=!0){var t;let[r,i]=this._containerDimensions();this._camera.transform.resize(r,i,e),null==(t=this._camera._requestedCameraState)||t.resize(r,i,e)}_getClampedPixelRatio(e,t){let{0:r,1:i}=this._maxCanvasSize,n=this.getPixelRatio(),a=e*n,o=t*n,s=Math.min(a>r?r/a:1,o>i?i/o:1);return s<1&&xd("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),s*n}getPixelRatio(){var e;return null!=(e=this._overridePixelRatio)?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.transform.setMaxBounds(FT.convert(e)),this._update()}setMinZoom(e){if(e??(e=-2),e>=-2&&e<=this._camera.transform.maxZoom){let t=this._camera.transform.zoom,r=this._camera.getTransformForUpdate();return r.setMinZoom(e),this._camera.applyUpdatedTransform(r),this._update(),t!==this._camera.transform.zoom&&this.fire(new zJ("zoomstart")).fire(new zJ("zoom")).fire(new zJ("zoomend")).fire(new zJ("movestart")).fire(new zJ("move")).fire(new zJ("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(e=!1){let t=this._camera.transform;return e?t.applyConstrain(t.center,t.minZoom).zoom:t.minZoom}setMaxZoom(e){if(e??(e=22),e>=this._camera.transform.minZoom){let t=this._camera.transform.zoom,r=this._camera.getTransformForUpdate();return r.setMaxZoom(e),this._camera.applyUpdatedTransform(r),this._update(),t!==this._camera.transform.zoom&&this.fire(new zJ("zoomstart")).fire(new zJ("zoom")).fire(new zJ("zoomend")).fire(new zJ("movestart")).fire(new zJ("move")).fire(new zJ("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??(e=0),e<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this._camera.transform.maxPitch){let t=this._camera.transform.pitch,r=this._camera.getTransformForUpdate();return r.setMinPitch(e),this._camera.applyUpdatedTransform(r),this._update(),t!==this._camera.transform.pitch&&this.fire(new zJ("pitchstart")).fire(new zJ("pitch")).fire(new zJ("pitchend")).fire(new zJ("movestart")).fire(new zJ("move")).fire(new zJ("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??(e=60),e>180)throw Error("maxPitch must be less than or equal to 180");if(e>=this._camera.transform.minPitch){let t=this._camera.transform.pitch,r=this._camera.getTransformForUpdate();return r.setMaxPitch(e),this._camera.applyUpdatedTransform(r),this._update(),t!==this._camera.transform.pitch&&this.fire(new zJ("pitchstart")).fire(new zJ("pitch")).fire(new zJ("pitchend")).fire(new zJ("movestart")).fire(new zJ("move")).fire(new zJ("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??(e=20),e>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(e<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.transform.setRenderWorldCopies(e),this._update()}setTransformConstrain(e){return this._camera.transform.setConstrainOverride(e),this._update()}project(e){return this._camera.transform.locationToScreenPoint(DJ.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(vl.convert(e),this.terrain)}isMoving(){var e;return this._camera.isMoving()||(null==(e=this._handlers)?void 0:e.isMoving())||!1}isZooming(){var e;return this._camera.isZooming()||(null==(e=this._handlers)?void 0:e.isZooming())||!1}isRotating(){var e;return this._camera.isRotating()||(null==(e=this._handlers)?void 0:e.isRotating())||!1}_createDelegatedListener(e,t,r){if("mouseenter"===e||"mouseover"===e){let i=!1;return{layers:t,listener:r,delegates:{mousemove:n=>{let a=t.filter(e=>this.getLayer(e)),o=0===a.length?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length?i||(i=!0,r.call(this,new z2(e,this,n.originalEvent,{features:o}))):i=!1},mouseout:()=>{i=!1}}}}if("mouseleave"===e||"mouseout"===e){let i=!1;return{layers:t,listener:r,delegates:{mousemove:n=>{let a=t.filter(e=>this.getLayer(e));(0===a.length?[]:this.queryRenderedFeatures(n.point,{layers:a})).length?i=!0:i&&(i=!1,r.call(this,new z2(e,this,n.originalEvent)))},mouseout:t=>{i&&(i=!1,r.call(this,new z2(e,this,t.originalEvent)))}}}}{let i=e=>{let i=t.filter(e=>this.getLayer(e)),n=0===i.length?[]:this.queryRenderedFeatures(e.point,{layers:i});n.length&&(e.features=n,r.call(this,e),delete e.features)};return{layers:t,listener:r,delegates:{[e]:i}}}}_saveDelegatedListener(e,t){var r;this._delegatedListeners||(this._delegatedListeners={}),(r=this._delegatedListeners)[e]||(r[e]=[]),this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,r){var i;if(!(null!=(i=this._delegatedListeners)&&i[e]))return;let n=this._delegatedListeners[e];for(let e=0;et.includes(e))){for(let e in i.delegates)this.off(e,i.delegates[e]);n.splice(e,1);return}}}on(e,t,r){if(void 0===r)return super.on(e,t);let i="string"==typeof t?[t]:t,n=this._createDelegatedListener(e,i,r);for(let t in this._saveDelegatedListener(e,n),n.delegates)this.on(t,n.delegates[t]);return{unsubscribe:()=>{this._removeDelegatedListener(e,i,r)}}}once(e,t,r){if(void 0===r)return super.once(e,t);let i="string"==typeof t?[t]:t,n=this._createDelegatedListener(e,i,r);for(let t in n.delegates){let a=n.delegates[t];n.delegates[t]=(...t)=>{this._removeDelegatedListener(e,i,r),a(...t)}}for(let t in this._saveDelegatedListener(e,n),n.delegates)this.once(t,n.delegates[t]);return this}off(e,t,r){if(void 0===r)return super.off(e,t);let i="string"==typeof t?[t]:t;return this._removeDelegatedListener(e,i,r),this}queryRenderedFeatures(e,t){if(!this.style)return[];let r,i=e instanceof vl||Array.isArray(e),n=i?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(t||(t=(i?{}:e)||{}),n instanceof vl||"number"==typeof n[0])r=[vl.convert(n)];else{let e=vl.convert(n[0]),t=vl.convert(n[1]);r=[e,new vl(t.x,e.y),t,new vl(e.x,t.y),e]}return this.style.queryRenderedFeatures(r,t,this._camera.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,t){return t=xi({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},t),this._styleUrl="string"==typeof e?e:null,!1!==t.diff&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(e,t))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(null==t)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){var r,i,n;if(null==(r=this._diffStyleRequest)||r.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(e,t));let a=this.style&&t.transformStyle?this.style.serialize():void 0;return(this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e)?(this.style=new Oq(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,a):this.style.loadJSON(e,t,a)):(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),null==(n=null==(i=this.style)?void 0:i.projection)||n.destroy(),delete this.style),this}_lazyInitEmptyStyle(){this.style||(this.style=new Oq(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,t){return b(this,null,function*(){var r;if(null==(r=this._diffStyleRequest)||r.abort(),"string"==typeof e){this._diffStyleRequest=new AbortController;let r=this._diffStyleRequest;try{let i=yield this._requestManager.transformRequest(e,"Style");if(r.signal.aborted){this._diffStyleRequest=null;return}let n=yield MS(i,r);this._diffStyleRequest=null,this._updateDiff(n.data,t)}catch(e){this._diffStyleRequest=null,xw(e)||this.fire(new MI(vK(e)))}}else"object"==typeof e&&(this._diffStyleRequest=null,this._updateDiff(e,t))})}_updateDiff(e,t){try{this.style.setState(e,t)&&this._update(!0)}catch(r){xd(`Unable to perform style diff: ${vK(r).message}. Rebuilding the style from scratch.`),this._updateStyle(e,t)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():void xd("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){var t;let r=null==(t=this.style)?void 0:t.tileManagers[e];return void 0===r?void this.fire(new MI(Error(`There is no tile manager with ID '${e}'`))):r.loaded()}setTerrain(e,t={}){if(this.style._checkLoaded(),e&&_3(this,Sn.terrain,{value:e},t))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){let t=this.style.tileManagers[e.source];if(!t)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);for(let r in null===this.terrain&&t.reload(),this.style._layers){let t=this.style._layers[r];"hillshade"===t.type&&t.source===e.source&&xd("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===t.type&&t.source===e.source&&xd("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new Ok(this.painter,t,e,this._terrainSkirtLength),this.painter.renderToTexture=new jS(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=t=>this._handleTerrainDataEvent(t,e.source),this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);return this.style.triggerSymbolPlacement(),this.fire(new z6({terrain:e})),this}_handleTerrainDataEvent(e,t){var r;if("style"===e.dataType)return void this.terrain.tileManager.releaseAllRTT();let i=e.sourceId===t;if(i&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),i&&e.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),e.tile){if((null==(r=e.source)?void 0:r.type)==="image")return void this.terrain.tileManager.releaseAllRTT();this.terrain.tileManager.releaseRTT(e.tile.tileID)}}getTerrain(){var e,t;return null!=(t=null==(e=this.terrain)?void 0:e.options)?t:null}areTilesLoaded(){var e;for(let t of Object.values(null==(e=this.style)?void 0:e.tileManagers))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){var t;return null==(t=this.style)?void 0:t.getSource(e)}setSourceTileLodParams(e,t,r){if(r){let i=this.getSource(r);if(!i)throw Error(`There is no source with ID "${r}", cannot set LOD parameters`);i.calculateTileZoom=Lq(Math.max(1,e),Math.max(1,t))}else for(let r in this.style.tileManagers)this.style.tileManagers[r].getSource().calculateTileZoom=Lq(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,t){let r=this.style.tileManagers[e];if(!r)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);void 0===t?r.reload(!0):r.refreshTiles(t.map(e=>new Ir(e.z,e.x,e.y)))}addImage(e,t,r={}){var i;this._lazyInitEmptyStyle();let n=this._createStyleImage(t,r);return n&&(this.style.addImage(e,n),null!=(i=n.userImage)&&i.onAdd&&n.userImage.onAdd(this,e)),this}setMissingStyleImageResolver(e){var t;return this._missingStyleImageResolver=e,null==(t=this.style)||t.setMissingImageResolver(e),this}_createStyleImage(e,t={}){let{pixelRatio:r=1,sdf:i=!1,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}=t;if(e instanceof HTMLImageElement||xm(e)){let{width:t,height:u,data:c}=zG.getImageData(e);return{data:new Di({width:t,height:u},c),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0}}if(void 0===e.width||void 0===e.height)return this.fire(new MI(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`"))),null;{let{width:t,height:u,data:c}=e,h=TL(e.data);return{data:h?new Di({width:t,height:u}):new Di({width:t,height:u},new Uint8Array(c)),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0,isWebGLImage:h,userImage:e}}}updateImage(e,t){let r=this.style.getImage(e);if(!r)return this.fire(new MI(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:n,data:a}=t instanceof HTMLImageElement||xm(t)?zG.getImageData(t):t;if(void 0===i||void 0===n)return this.fire(new MI(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(i!==r.data.width||n!==r.data.height)return this.fire(new MI(Error("The width and height of the updated image must be that same as the previous version of the image")));if(r.isWebGLImage=TL(a),r.isWebGLImage)r.userImage=t;else{let e=!(t instanceof HTMLImageElement||xm(t));r.data.replace(a,e)}return this.style.updateImage(e,r),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new MI(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return b(this,null,function*(){let t=yield zZ.getImage((yield this._requestManager.transformRequest(e,"Image")),new AbortController);if(!t.data)throw Error(`Could not load image ${e}: the response is empty`);return t})}listImages(){var e,t;return null!=(t=null==(e=this.style)?void 0:e.listImages())?t:[]}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){var t;return null==(t=this.style)?void 0:t.getLayer(e)}getLayersOrder(){var e,t;return null!=(t=null==(e=this.style)?void 0:e.getLayersOrder())?t:[]}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){var i;return null==(i=this.style)||i.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,i={}){var n;return null==(n=this.style)||n.setPaintProperty(e,t,r,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,i={}){return this.style.setLayoutProperty(e,t,r,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(e){return this._lazyInitEmptyStyle(),this.style.setFontFaces(e),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(e,t,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,e=>{e||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,e=>{e||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_shouldHandleInitialResize(){var e;if(!(null!=(e=this._container)&&e.clientWidth)||!this._container.clientHeight)return!1;let[t,r]=this._containerDimensions();return t!==this._camera.transform.width||r!==this._camera.transform.height}_setupResizeObserver(){var e;let t=!1,r=zm(e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())},50),i=null!=(e=this._ownerWindow.ResizeObserver)?e:ResizeObserver;this._resizeObserver=new i(e=>{(t||(t=!0,this._shouldHandleInitialResize()))&&r(e)}),this._resizeObserver.observe(this._container)}_resolveContainer(e){if("string"==typeof e){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&"object"==typeof e&&1===e.nodeType)return e;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let e=this._container;e.classList.add("maplibregl-map");let t=this._canvasContainer=zY.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=zY.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let r=this._containerDimensions(),i=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],i);let n=this._controlContainer=zY.create("div","maplibregl-control-container",e),a=this._controlPositions={};for(let e of["top-left","top-right","bottom-left","bottom-right"])a[e]=zY.create("div",`maplibregl-ctrl-${e} `,n);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(e,t,r){this._canvas.width=Math.floor(r*e),this._canvas.height=Math.floor(r*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let e=f(d({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),t=null;this._canvas.addEventListener("webglcontextcreationerror",e=>{t=e},{once:!0});let r=this._canvas.getContext("webgl2",e);if(!r)throw new Bq(e,t);this.painter=new BU(r,this._camera.transform)}migrateProjection(e,t){this._camera.migrateProjection(e,t),this.painter.transform=e,this.fire(new z8({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){var t;return null!=(t=this.style)&&t._loaded&&(this._styleDirty||(this._styleDirty=e),this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){var t,r,i,n,a;let o=this._idleTriggered?this._fadeDuration:0,s=(null==(t=this.style.projection)?void 0:t.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let l=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let e=this._camera.transform.zoom,t=Ll();this.style.zoomHistory.update(e,t);let r=new Su(e,{now:t,fadeDuration:o,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),i=r.crossFadingFactor();(1!==i||i!==this._crossFadingFactor)&&(l=!0,this._crossFadingFactor=i),this.style.update(r)}let u=(null==(r=this.style.projection)?void 0:r.transitionState)>0!==s;this._camera.transform.setTransitionState(null==(i=this.style.projection)?void 0:i.transitionState),this.style&&(this._sourcesDirty||u)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=null==(n=this.style)?void 0:n._updatePlacement(this._camera.transform,this.showCollisionBoxes,o,this._crossSourceCollisions,u),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new zK("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new zK("load"))),this.style&&(this.style.hasTransitions()||l)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let c=this._sourcesDirty||this._styleDirty||this._placementDirty||(null==(a=this.painter.renderToTexture)?void 0:a.needsFollowUpFrame);return c||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new zK("idle")),!this._loaded||this._fullyLoaded||c||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){var e,t;for(let e of(this._hash&&this._hash.remove(),this._controls))e.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),null==(e=this._diffStyleRequest)||e.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),"u">typeof window&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),zZ.removeThrottleControl(this._imageQueueHandle),null==(t=this._resizeObserver)||t.disconnect();let r=this.painter.context.gl.getExtension("WEBGL_lose_context");r?.loseContext&&r.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new zK("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,zG.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(e){if(!xw(e))throw e}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return"6.9.0"}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}},jI={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0},jL=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom(!0);this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{let e=this._map.getPitch(),t=this._map.getRoll(),r=this._map.getBearing(),i=1/Math.cos(xy(e))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${i}) rotateZ(${-t}deg) rotateX(${e}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${i}) rotateX(${e}deg) rotateZ(${-r}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-r-t}deg)`;return}this._compassIcon.style.transform=`rotate(${-r}deg)`},this._setButtonTitle=(e,t)=>{let r=this._map._getUIString(`NavigationControl.${t}`);e.title=r,e.setAttribute("aria-label",r)},this.options=xi({},jI,e),this._container=zY.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),zY.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),zY.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=zY.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new jP(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){let r=zY.create("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}},jP=class{constructor(e,t,r=!1){this.mousedown=e=>{this.startMove(e,zY.mousePos(this.element,e)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=e=>{this.move(e,zY.mousePos(this.element,e))},this.mouseup=e=>{this._rotatePitchHandler.dragEnd(e),this.offTemp()},this.touchstart=e=>{1===e.targetTouches.length?(this._startPos=this._lastPos=zY.touchPos(this.element,e.targetTouches)[0],this.startMove(e,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=e=>{1===e.targetTouches.length?(this._lastPos=zY.touchPos(this.element,e.targetTouches)[0],this.move(e,this._lastPos)):this.reset()},this.touchend=e=>{0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=t;let i=new B7;this._rotatePitchHandler=new B5({clickTolerance:3,move:(e,i)=>{let n=t.getBoundingClientRect(),a=new vl((n.bottom-n.top)/2,(n.right-n.left)/2);return{bearingDelta:xb(new vl(e.x,i.y),i,a),pitchDelta:r?-((i.y-e.y)*.5):void 0}},moveStateManager:i,enable:!0,assignEvents:()=>{}}),this.map=e,t.addEventListener("mousedown",this.mousedown),t.addEventListener("touchstart",this.touchstart,{passive:!1}),t.addEventListener("touchcancel",this.reset)}startMove(e,t){this._rotatePitchHandler.dragStart(e,t),zY.disableDrag()}move(e,t){let r=this.map,{bearingDelta:i,pitchDelta:n}=this._rotatePitchHandler.dragMove(e,t)||{};i&&r.setBearing(r.getBearing()+i),n&&r.setPitch(r.getPitch()+n)}off(){let e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){zY.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}},jF={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%)"},jO={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},jB=class extends MC{},jj=class extends MC{},jN=class extends ML{constructor(e){if(super(),this._onClick=e=>{this.fire(new jj("click",{originalEvent:e}))},this._onKeyPress=e=>{("Space"===e.code||"Enter"===e.code)&&this.togglePopup()},this._onKeyDown=e=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||e.composedPath()[0]!==this._element||e.altKey||e.ctrlKey||e.metaKey)return;let t=jO[e.key];if(!t)return;e.preventDefault(),e.stopPropagation();let r=e.shiftKey?10:1,i=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new vl(i.x+t[0]*r,i.y+t[1]*r))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new jB("dragstart"))),this.fire(new jB("drag"))},this._onKeyUp=e=>{jO[e.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=e=>{let t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},this._update=e=>{if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();e?.type!=="terrain"&&(e?.type!=="render"||t)||this._map.once("render",this._update),this._lngLat=zM(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?r=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&"moveend"!==e.type||(this._pos=this._pos.round()),this._element.style.transform=`${jF[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${r}`,zG.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(e?.type==="moveend")}).catch(()=>{})},this._onMove=e=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new jB("dragstart"))),this.fire(new jB("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new jB("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e?.anchor||"center",this._color=e?.color||"#3FB1CE",this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||"auto",this._pitchAlignment=e?.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=vl.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=zY.create("div");let t=(jR||(jR=zS("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[zS("g",{"fill-rule":"nonzero"},[zS("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([e,t])=>zS("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:e,ry:t}))),zS("g",{fill:"#3FB1CE"},[zS("path",{d:"M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"})]),zS("g",{opacity:"0.25",fill:"#000000"},[zS("path",{d:"M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"})]),zS("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),zS("g",{transform:"translate(8.0, 8.0)"},[zS("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),zS("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]))).cloneNode(!0);t.setAttributeNS(null,"height",`${41*this._scale}px`),t.setAttributeNS(null,"width",`${27*this._scale}px`),t.firstElementChild.children[1].setAttributeNS(null,"fill",this._color),this._element.appendChild(t),this._offset=vl.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",e=>{e.preventDefault()}),this._element.addEventListener("mousedown",e=>{e.preventDefault()}),zk(this._element,this._anchor,"marker"),e?.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=DJ.convert(e),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),e){if(!("offset"in e.options)){let t=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,-((24.6+t)*1)],"bottom-right":[-t,-((24.6+t)*1)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new jB("dragend")))}getPopup(){return this._popup}togglePopup(){let e=this._popup;return this._element.style.opacity===this._opacityWhenCovered||e&&(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map))),this}_updateOpacity(e=!1){var t,r;let i=null==(t=this._map)?void 0:t.terrain,n=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!i||n){let e=n?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==e&&(this._element.style.opacity=e,this._element.classList.toggle("maplibregl-marker-covered",n));return}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let a=this._map,o=a.terrain.depthAtPoint(this._pos),s=a.terrain.getElevationForLngLat(this._lngLat,a._camera.transform);if(a._camera.transform.lngLatToCameraDepth(this._lngLat,s)-o<.006){this._element.style.opacity=this._opacity,this._element.classList.remove("maplibregl-marker-covered");return}let l=-this._offset.y/a._camera.transform.pixelsPerMeter,u=Math.sin(a.getPitch()*Math.PI/180)*l,c=a.terrain.depthAtPoint(new vl(this._pos.x,this._pos.y-this._offset.y)),h=a._camera.transform.lngLatToCameraDepth(this._lngLat,s+u)-c>.006;null!=(r=this._popup)&&r.isOpen()&&h&&this._popup.remove(),this._element.style.opacity=h?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",h)}getOffset(){return this._offset}setOffset(e){return this._offset=vl.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=("0"===this._element.getAttribute("tabindex")&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let e=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(void 0===this._opacity||void 0===e&&void 0===t)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=String(e)),void 0!==t&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(!0),this}},jV={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},jU=0,jq=!1,jG=class extends MC{},jH=class extends MC{},j$=class extends MC{},jW=class extends ML{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e)){this._setErrorState(),this.fire(new jH("outofmaxbounds",e)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new jH("geolocate",e)),this._finish()}},this._updateCamera=e=>{let t=new DJ(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,i=xi({bearing:this._map.getBearing()},this.options.fitBoundsOptions),n=FT.fromLngLat(t,r);this._map.fitBounds(n,i,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let t=new DJ(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(t).addTo(this._map),this._userLocationDotMarker.setLngLat(t).addTo(this._map),this._accuracy=e.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=e=>{if(this._map){if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&jq)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new j$("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=e=>{if(!this._map)return;let t=e?.[0]instanceof ResizeObserverEntry;e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new jG("trackuserlocationend")),this.fire(new jG("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>{e.preventDefault()}),this._geolocateButton=zY.create("button","maplibregl-ctrl-geolocate",this._container),zY.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(!1===e){xd("Geolocation support is not available so the GeolocateControl will be disabled.");let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{let e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=zY.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new jN({element:this._dotElement}),this._circleElement=zY.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new jN({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=xi({},jV,e)}onAdd(e){return this._map=e,this._container=zY.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(e=!1){return b(this,null,function*(){if(void 0!==jz&&!e)return jz;if(void 0===window.navigator.permissions)return jz=!!window.navigator.geolocation;try{jz="denied"!==(yield window.navigator.permissions.query({name:"geolocation"})).state}catch{jz=!!window.navigator.geolocation}return jz})})().then(e=>this._finishSetupUI(e)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,jU=0,jq=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitudet.getEast()||r.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let e=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!e)return;let t=this._map.project(e),r=this._map.unproject([t.x+100,t.y]),i=e.distanceTo(r)/100,n=2*this._accuracy/i;this._circleElement.style.width=`${n.toFixed(2)}px`,this._circleElement.style.height=`${n.toFixed(2)}px`}trigger(){if(!this._setup)return xd("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 jG("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":jU--,jq=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new jG("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new jG("trackuserlocationstart")),this.fire(new jG("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++jU>1?(e={maximumAge:6e5,timeout:0},jq=!0):(e=this.options.positionOptions,jq=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},jY={maxWidth:100,unit:"metric"},jZ=class{constructor(e){this._onMove=()=>{zE(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,zE(this._map,this._container,this.options)},this.options=d(d({},jY),e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=zY.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}},jX=class extends MC{},jK=class extends ML{constructor(e={}){var t;super(),this._onFullscreenChange=()=>{var e;let t=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;null!=(e=t?.shadowRoot)&&e.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=null!=(t=e.pseudo)&&t,e?.container&&(e.container instanceof HTMLElement?this._container=e.container:xd("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=zY.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let e=this._fullscreenButton=zY.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);zY.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new jX("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new jX("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},jJ=class{constructor(e){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=e}onAdd(e){return this._map=e,this._container=zY.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=zY.create("button","maplibregl-ctrl-terrain",this._container),zY.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},jQ=class{constructor(){this._toggleProjection=()=>{var e;let t=null==(e=this._map.getProjection())?void 0:e.type;"mercator"!==t&&t?this._map.setProjection({type:"mercator"}):this._map.setProjection({type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var e;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),(null==(e=this._map.getProjection())?void 0:e.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(e){return this._map=e,this._container=zY.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=zY.create("button","maplibregl-ctrl-globe",this._container),zY.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},j0={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},j1=class extends MC{},j2=class extends ML{constructor(e){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new j1("close"))),this),this._update=e=>{let t,r=this._lngLat||this._trackPointer;if(!this._map||!r||!this._content)return;if(!this._container){if(this._container=zY.create("div","maplibregl-popup",this._map.getContainer()),this._tip=zY.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let e of this.options.className.split(" "))this._container.classList.add(e);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=zM(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer),e&&"point"in e&&e.point&&(t=e.point),this._trackPointer&&!t)return;let i=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map._camera.transform.locationToScreenPoint(this._lngLat));let n=this.options.anchor,a=function e(t){if(!t)return e(new vl(0,0));if("number"==typeof t){let e=Math.round(Math.abs(t)/Math.SQRT2);return{center:new vl(0,0),top:new vl(0,t),"top-left":new vl(e,e),"top-right":new vl(-e,e),bottom:new vl(0,-t),"bottom-left":new vl(e,-e),"bottom-right":new vl(-e,-e),left:new vl(t,0),right:new vl(-t,0)}}if(t instanceof vl||Array.isArray(t)){let e=vl.convert(t);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:vl.convert(t.center||[0,0]),top:vl.convert(t.top||[0,0]),"top-left":vl.convert(t["top-left"]||[0,0]),"top-right":vl.convert(t["top-right"]||[0,0]),bottom:vl.convert(t.bottom||[0,0]),"bottom-left":vl.convert(t["bottom-left"]||[0,0]),"bottom-right":vl.convert(t["bottom-right"]||[0,0]),left:vl.convert(t.left||[0,0]),right:vl.convert(t.right||[0,0])}}(this.options.offset);if(!n){var o,s,l,u,c;let e=this._container.offsetWidth,t=this._container.offsetHeight,r=(o=this.options.padding)?{top:null!=(s=o.top)?s:0,right:null!=(l=o.right)?l:0,bottom:null!=(u=o.bottom)?u:0,left:null!=(c=o.left)?c:0}:{top:0,right:0,bottom:0,left:0},h;h=i.y+a.bottom.ythis._map._camera.transform.height-t-r.bottom?["bottom"]:[],i.xthis._map._camera.transform.width-e/2-r.right&&h.push("right"),n=0===h.length?"bottom":h.join("-")}let h=i.add(a[n]);this.options.subpixelPositioning||(h=h.round()),this._container.style.transform=`${jF[n]} translate(${h.x}px,${h.y}px)`,zk(this._container,n,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=xi(Object.create(j0),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new j1("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=DJ.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let t=document.createDocumentFragment(),r=document.createElement("body"),i;for(r.innerHTML=e;i=r.firstChild;)t.appendChild(i);return this.setDOMContent(t)}getMaxWidth(){var e;return null==(e=this._container)?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=zY.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}setPadding(e){this.options.padding=e,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=zY.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");e&&e.focus()}},j3="6.9.0"}}),j4=m({"build/maplibre_worker.js"(e,t){t.exports='var t1=Object.defineProperty,e1=Object.defineProperties;var r1=Object.getOwnPropertyDescriptors;var nh=Object.getOwnPropertySymbols;var i1=Object.prototype.hasOwnProperty,n1=Object.prototype.propertyIsEnumerable;var ah=(t,e,r)=>e in t?t1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,je=(t,e)=>{for(var r in e||(e={}))i1.call(e,r)&&ah(t,r,e[r]);if(nh)for(var r of nh(e))n1.call(e,r)&&ah(t,r,e[r]);return t},Si=(t,e)=>e1(t,r1(e));var rt=(t,e,r)=>new Promise((i,n)=>{var a=l=>{try{o(r.next(l))}catch(u){n(u)}},s=l=>{try{o(r.throw(l))}catch(u){n(u)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(a,s);o((r=r.apply(t,e)).next())});var a1=Object.create,ep=Object.defineProperty,s1=Object.getOwnPropertyDescriptor,o1=Object.getOwnPropertyNames,l1=Object.getPrototypeOf,rp=Object.prototype.hasOwnProperty,fl=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),u1=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=o1(e),a=0,s=n.length,o;ae[l]).bind(null,o),enumerable:!(i=s1(e,o))||i.enumerable});return t},h1=(t,e,r)=>(r=t==null?{}:a1(l1(t)),u1(e||!t||!t.__esModule||!rp.call(t,"default")?ep(r,"default",{value:t,enumerable:!0}):r,t));function B(t,e){this.x=t,this.y=e}B.prototype={clone(){return new B(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:B},B.convert=function(t){if(t instanceof B)return t;if(Array.isArray(t))return new B(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new B(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")};function c1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var Nn;function p1(){return Nn!=null||(Nn=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Nn}var Un;function f1(){if(Un==null&&(Un=!1,p1())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){Un=!0;break}}}return Un||!1}var pe=typeof Float32Array<"u"?Float32Array:Array;Math.PI/180,180/Math.PI;function d1(){var t=new pe(9);return pe!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ip(){var t=new pe(3);return pe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function y1(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function sh(t,e,r){var i=new pe(3);return i[0]=t,i[1]=e,i[2]=r,i}function m1(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function g1(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ks(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}var x1=y1;(function(){var t=ip();return function(e,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=i*s,t[2]=n*s,t[3]=a*s,t}function w1(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}(function(){var t=v1();return function(e,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o1e-6?(p=Math.acos(f),d=Math.sin(p),y=Math.sin((1-i)*p)/d,m=Math.sin(i*p)/d):(y=1-i,m=i),t[0]=y*n+m*l,t[1]=y*a+m*u,t[2]=y*s+m*h,t[3]=y*o+m*c,t}function _1(t,e){var r=e[0]+e[4]+e[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[n*3+n]&&(n=2);var a=(n+1)%3,s=(n+2)%3;i=Math.sqrt(e[n*3+n]-e[a*3+a]-e[s*3+s]+1),t[n]=.5*i,i=.5/i,t[3]=(e[a*3+s]-e[s*3+a])*i,t[a]=(e[a*3+n]+e[n*3+a])*i,t[s]=(e[s*3+n]+e[n*3+s])*i}return t}var lh=b1;(function(){var t=ip(),e=sh(1,0,0),r=sh(0,1,0);return function(i,n,a){var s=g1(n,a);return s<-.999999?(ks(t,e,n),x1(t)<1e-6&&ks(t,r,n),m1(t,t),D1(i,t,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(ks(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+s,lh(i,i))}})(),(function(){var t=oh(),e=oh();return function(r,i,n,a,s,o){return Ts(t,i,s,o),Ts(e,n,a,o),Ts(r,t,e,2*o*(1-o)),r}})(),(function(){var t=d1();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],lh(e,_1(e,t))}})();function A1(){var t=new pe(2);return pe!=Float32Array&&(t[0]=0,t[1]=0),t}(function(){var t=A1();return function(e,r,i,n,a,s){var o,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function E1(t,e,r,i){return c1(t,e,r,i)}var d5=E1(.25,.1,.25,1);function Ji(t,e,r){return Math.min(r,Math.max(e,t))}function F1(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function Gt(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function k1(t){return Math.log(t)/Math.LN2%1==0}function Ia(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}function T1(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function He(t){return Array.isArray(t)?t.map(He):typeof t=="object"&&t?Ia(t,He):t}var uh={};function Bt(t){uh[t]||(typeof console<"u"&&console.warn(t),uh[t]=!0)}function Ke(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function mr(t){return typeof WorkerGlobalScope<"u"&&t!==void 0&&t instanceof WorkerGlobalScope}function Ca(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function I1(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),h=Math.min(t.width,e+i),c=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}function C1(t,e,r,i,n){return rt(this,null,function*(){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(t,{timestamp:0});try{let s=a==null?void 0:a.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith("BGR"),l=new Uint8ClampedArray(i*n*4);if(yield a.copyTo(l,I1(t,e,r,i,n)),o)for(let u=0;u{t.removeEventListener(e,r,i)}}}function ch(t){return t*Math.PI/180}var ph="AbortError",dl=class extends Error{constructor(t=ph){super(t instanceof Error?t.message:t),this.name=ph,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function yl(t){return t instanceof Error&&t.name==="AbortError"}function B1(t){if(t.aborted)throw new dl(t.reason)}var ml={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function P1(t){return ml.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function sp(t,e){ml.REGISTERED_PROTOCOLS[t]=e}function op(t){delete ml.REGISTERED_PROTOCOLS[t]}var fh="global-dispatcher",ya=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function lp(){var t;if(mr(self))return(t=self.worker)==null?void 0:t.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch(e){}return window.location.href}var z1=t=>{var e;return t.startsWith("file:")||((e=lp())==null?void 0:e.startsWith("file:"))&&!/^\\w+:/.test(t)};function L1(t,e){return rt(this,null,function*(){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:lp(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=yield fetch(r)}catch(s){throw yl(s)?s:new ya(0,Ki(s).message,t.url,new Blob)}if(!i.ok){let s=yield i.blob();throw new ya(i.status,i.statusText,t.url,s)}let n;n=t.type==="arrayBuffer"||t.type==="image"?i.arrayBuffer():t.type==="json"?i.json():i.text();let a=yield n;return B1(e.signal),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}})}function V1(t,e){return new Promise((r,i)=>{var a;let n=new XMLHttpRequest;n.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(n.responseType="arraybuffer");for(let s in t.headers)n.setRequestHeader(s,t.headers[s]);t.type==="json"&&(n.responseType="text",(a=t.headers)!=null&&a.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=t.credentials==="include",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let s=n.response;if(t.type==="json")try{s=JSON.parse(n.response)}catch(o){i(o);return}r({data:s,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let s=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new ya(n.status,n.statusText,t.url,s))}},e.signal.addEventListener("abort",()=>{n.abort(),i(new dl(e.signal.reason))}),n.send(t.body)})}var Ma=function(t,e){return rt(this,null,function*(){var r,i;if(t.url.includes("://")&&!/^https?:|^file:/.test(t.url)){let n=P1(t.url);if(n){let a=yield n(t,e);return!a.data&&t.type==="arrayBuffer"?Gt(a,{data:new ArrayBuffer(0)}):a}if(mr(self)&&((r=self.worker)!=null&&r.actor))return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:fh},e)}if(!z1(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return L1(t,e);if(mr(self)&&((i=self.worker)!=null&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:fh},e)}return V1(t,e)})},up=(t,e)=>Ma(Gt(t,{type:"json"}),e),hp=(t,e)=>Ma(Gt(t,{type:"arrayBuffer"}),e);function dh(t,e,r){var i;(i=r[t])!=null&&i.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function Is(t,e,r){if(r!=null&&r[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}var cp=class{constructor(t,e={}){Gt(this,e),this.type=t}},ma=class extends cp{constructor(t,e={}){super("error",Gt({error:t},e))}},O1=class{on(t,e){return this._listeners||(this._listeners={}),dh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return Is(t,e,this._listeners),Is(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),dh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){var n,a,s,o,l,u;let r=typeof t=="string"?new cp(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let h=(s=(a=(n=this._listeners)==null?void 0:n[i])==null?void 0:a.slice())!=null?s:[];for(let f of h)f.call(this,r);let c=(u=(l=(o=this._oneTimeListeners)==null?void 0:o[i])==null?void 0:l.slice())!=null?u:[];for(let f of c)Is(i,f,this._oneTimeListeners),f.call(this,r);let p=this._eventedParent;p&&(Gt(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(r))}else r instanceof ma&&console.error(r.error);return this}listens(t){var e,r,i,n,a;return!!((r=(e=this._listeners)==null?void 0:e[t])!=null&&r.length||(n=(i=this._oneTimeListeners)==null?void 0:i[t])!=null&&n.length||(a=this._eventedParent)!=null&&a.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},pp={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},w=pp,fp=["type","source","source-layer","minzoom","maxzoom","filter","layout"],E=class{constructor(t,e,r,i,n="error"){this.message=(t?`${t}: `:"")+r,i&&(this.identifier=i),this.severity=n,e!=null&&e.__line__&&(this.line=e.__line__)}},dn={kind:"null"},I={kind:"number"},Y={kind:"string"},tt={kind:"boolean"},ce={kind:"color"},Ba={kind:"projectionDefinition"},fr={kind:"object"},Z={kind:"value"},R1={kind:"error"},Pa={kind:"collator"},yn={kind:"formatted"},za={kind:"padding"},Qi={kind:"colorArray"},La={kind:"numberArray"},mn={kind:"resolvedImage"},Va={kind:"variableAnchorOffsetCollection"};function Ut(t,e){return{kind:"array",itemType:t,N:e}}function yt(t){if(t.kind==="array"){let e=yt(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}var $1=[dn,I,Y,tt,ce,Ba,yn,fr,Ut(Z),za,La,Qi,mn,Va];function tn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!tn(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of $1)if(!tn(r,e))return null}}return`Expected ${yt(t)} but found ${yt(e)} instead.`}function gl(t,e){return e.some(r=>r.kind===t.kind)}function dr(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function Ge(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}var dp=.96422,yp=.82521,mp=4/29,Ks=6/29,gp=3*Ks*Ks,N1=Math.PI/180,U1=180/Math.PI;function xp(t){return t%=360,t<0&&(t+=360),t}function vp([t,e,r,i]){t=Cs(t),e=Cs(e),r=Cs(r);let n,a,s=Ms((.2225045*t+.7168786*e+.0606169*r)/1);t===e&&e===r?n=a=s:(n=Ms((.4360747*t+.3850649*e+.1430804*r)/dp),a=Ms((.0139322*t+.0971045*e+.7141733*r)/yp));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Cs(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ms(t){return t>.008856451679035631?t**(1/3):t/gp+mp}function bp([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*Ps(n),a=dp*Ps(a),s=yp*Ps(s),[Bs(3.1338561*a-1.6168667*n-.4906146*s),Bs(-.9787684*a+1.9161415*n+.033454*s),Bs(.0719453*a-.2289914*n+1.4052427*s),i]}function Bs(t){return t=t<=.00304?12.92*t:1.055*t**(1/2.4)-.055,t<0?0:t>1?1:t}function Ps(t){return t>Ks?t*t*t:gp*(t-mp)}function q1(t){let[e,r,i,n]=vp(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?xp(Math.atan2(i,r)*U1):NaN,a,e,n]}function j1([t,e,r,i]){return t=isNaN(t)?0:t*N1,bp([r,Math.cos(t)*e,Math.sin(t)*e,i])}function G1([t,e,r,i]){t=xp(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var X1=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function ji(t,e){return X1(t,e)?t[e]:void 0}function Y1(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=ji(W1,t);if(e){let[i,n,a]=e;return[i/255,n/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let i=t.length<6?1:2,n=1;return[qn(t.slice(n,n+=i)),qn(t.slice(n,n+=i)),qn(t.slice(n,n+=i)),qn(t.slice(n,n+i)||"ff")]}if(t.startsWith("rgb")){let i=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(i){let[n,a,s,o,l,u,h,c,p,f,d,y]=i,m=[o||" ",h||" ",f].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let g=[s,u,p].join(""),x=g==="%%%"?100:g===""?255:0;if(x){let v=[Rr(+a/x,0,1),Rr(+l/x,0,1),Rr(+c/x,0,1),d?yh(+d,y):1];if(mh(v))return v}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[i,n,a,s,o,l,u,h,c]=r,p=[a||" ",o||" ",u].join("");if(p===" "||p===" /"||p===",,"||p===",,,"){let f=[+n,Rr(+s,0,100),Rr(+l,0,100),h?yh(+h,c):1];if(mh(f))return G1(f)}}}function qn(t){return parseInt(t.padEnd(2,t),16)/255}function yh(t,e){return Rr(e?t/100:t,0,1)}function Rr(t,e,r){return Math.min(Math.max(e,t),r)}function mh(t){return!t.some(Number.isNaN)}var W1={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Je(t,e,r){return t+r*(e-t)}function ti(t,e,r){return t.map((i,n)=>Je(i,e[n],r))}function Z1(t){return t==="rgb"||t==="hcl"||t==="lab"}var Pt,gt=(Pt=class{constructor(e,r,i,n=1,a=!0){this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,r,i,n]))}static parse(e){if(e instanceof Pt)return e;if(typeof e!="string")return;let r=Y1(e);if(r)return new Pt(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",q1(this.rgb))}get lab(){return this.overwriteGetter("lab",vp(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(",")},${n})`}static interpolate(e,r,i,n="rgb"){switch(n){case"rgb":{let[a,s,o,l]=ti(e.rgb,r.rgb,i);return new Pt(a,s,o,l,!1)}case"hcl":{let[a,s,o,l]=e.hcl,[u,h,c,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=h)):(f=a,(c===1||c===0)&&(d=s));let[y,m,g,x]=j1([f,d!=null?d:Je(s,h,i),Je(o,c,i),Je(l,p,i)]);return new Pt(y,m,g,x,!1)}case"lab":{let[a,s,o,l]=bp(ti(e.lab,r.lab,i));return new Pt(a,s,o,l,!1)}}}},Pt.black=new Pt(0,0,0,1),Pt.white=new Pt(1,1,1,1),Pt.transparent=new Pt(0,0,0,0),Pt.red=new Pt(1,0,0,1),Pt),H1=["bottom","center","top"],Js=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},ze=class la{constructor(e){this.sections=e}static fromString(e){return new la([new Js(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof la?e:la.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Ae=class Li{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Li)return e;if(typeof e=="number")return new Li([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Li(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Li(ti(e.values,r.values,i))}},Se=class Vi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Vi)return e;if(typeof e=="number")return new Vi([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new Vi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Vi(ti(e.values,r.values,i))}},oe=class Oi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Oi)return e;if(typeof e=="string"){let i=gt.parse(e);return i?new Oi([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!="string")return;let n=gt.parse(i);if(!n)return;r.push(n)}return new Oi(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n="rgb"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[t,e,r,i]:[t,e,r]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function ei(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Dr||t instanceof gt||t instanceof xl||t instanceof ze||t instanceof Ae||t instanceof Se||t instanceof oe||t instanceof De||t instanceof _e)return!0;if(Array.isArray(t)){for(let e of t)if(!ei(e))return!1;return!0}if(typeof t=="object"){for(let e in t)if(!ei(t[e]))return!1;return!0}return!1}function _t(t){if(t===null)return dn;if(typeof t=="string")return Y;if(typeof t=="boolean")return tt;if(typeof t=="number")return I;if(t instanceof gt)return ce;if(t instanceof Dr)return Ba;if(t instanceof xl)return Pa;if(t instanceof ze)return yn;if(t instanceof Ae)return za;if(t instanceof Se)return La;if(t instanceof oe)return Qi;if(t instanceof De)return Va;if(t instanceof _e)return mn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=_t(i);if(!r)r=n;else{if(r===n)continue;r=Z;break}}return Ut(r||Z,e)}return fr}function Gi(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof gt||t instanceof Dr||t instanceof ze||t instanceof Ae||t instanceof Se||t instanceof oe||t instanceof De||t instanceof _e?t.toString():JSON.stringify(t)}var ri=class _p{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`\'literal\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=_t(i),a=r.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new _p(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},J1=["Unknown","Point","LineString","Polygon"],Ap=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?J1[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=gt.parse(t),this._parseColorCache.set(t,e)),e}};function Oa(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||ee)a=s-1;else throw new ft("Input is not a number.",r);return 0}var vl=class Sp{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(e[1],1,I);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let s=1;s=o)return r.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',u);let c=r.parse(l,h,a);if(!c)return null;a||(a=c.type),n.push([o,c])}return new Sp(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[Oa(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Q1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var be=class Qs{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name==="exponential")a=zs(r,e.base,i,n);else if(e.name==="linear")a=zs(r,1,i,n);else if(e.name==="cubic-bezier"){let s=e.controlPoints;a=Q1(s[0],s[1],s[2],s[3])(zs(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(h=>typeof h!="number"||h<0||h>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,I),!a)return null;let o=[],l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&r.expectedType!=Qi?l=ce:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u=h)return r.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',p);let d=r.parse(c,f,l);if(!d)return null;l||(l=d.type),o.push([h,d])}return!Ge(l,I)&&!Ge(l,Ba)&&!Ge(l,ce)&&!Ge(l,za)&&!Ge(l,La)&&!Ge(l,Qi)&&!Ge(l,Va)&&!Ge(l,Ut(I))?r.error(`Type ${yt(l)} is not interpolatable.`):new Qs(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=Oa(r,n,this.key),o=r[s],l=r[s+1],u=Qs.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(e),c=i[s+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Je(h,c,u);case"color":return gt.interpolate(h,c,u);case"padding":return Ae.interpolate(h,c,u);case"colorArray":return oe.interpolate(h,c,u);case"numberArray":return Se.interpolate(h,c,u);case"variableAnchorOffsetCollection":return De.interpolate(h,c,u,this.key);case"array":return ti(h,c,u);case"projectionDefinition":return Dr.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return gt.interpolate(h,c,u,"hcl");case"colorArray":return oe.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return gt.interpolate(h,c,u,"lab");case"colorArray":return oe.interpolate(h,c,u,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function zs(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var gr={color:gt.interpolate,number:Je,padding:Ae.interpolate,numberArray:Se.interpolate,colorArray:oe.interpolate,variableAnchorOffsetCollection:De.interpolate,array:ti},Ep=class Fp{constructor(e){this.type=yn,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o=="object"&&!Array.isArray(o)){a=!1;let l=null;if(o["font-scale"]&&(l=r.parse(o["font-scale"],1,I),!l))return null;let u=null;if(o["text-font"]&&(u=r.parse(o["text-font"],1,Ut(Y)),!u))return null;let h=null;if(o["text-color"]&&(h=r.parse(o["text-color"],1,ce),!h))return null;let c=null;if(o["vertical-align"]){if(typeof o["vertical-align"]=="string"&&!H1.includes(o["vertical-align"]))return r.error(`\'vertical-align\' must be one of: \'bottom\', \'center\', \'top\' but found \'${o["vertical-align"]}\' instead.`);if(c=r.parse(o["vertical-align"],1,Y),!c)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=r.parse(e[s],1,Z);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Fp(n)}evaluate(e){return new ze(this.sections.map(r=>{let i=r.content.evaluate(e);return _t(i)===mn?new Js("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new Js(Gi(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}};function kp(t,e,r=0,i=t.length-1,n=t0){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);kp(t,e,Math.max(r,Math.floor(e-u*c/l+p)),Math.min(i,Math.floor(e+(l-u)*c/l+p)),n)}let a=t[e],s=r,o=i;for(ki(t,r,e),n(t[i],a)>0&&ki(t,r,i);s0;)o--}n(t[r],a)===0?ki(t,r,o):(o++,ki(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function ki(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function t0(t,e){return te)}function Ra(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=r0(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a2){let u=e[1];if(typeof u!="string"||!(u in jn)||u==="object")return r.error(\'The item type argument of "array" must be one of string, number, boolean\',1);o=jn[u],i++}else o=Z;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error(\'The length argument to "array" must be a positive integer literal\',2);l=e[2],i++}n=Ut(o,l)}else{if(!jn[a])throw Error(`Types doesn\'t contain name = ${a}`);n=jn[a]}let s=[];for(;ie.outputDefined())}},gh={"to-boolean":tt,"to-color":ce,"to-number":I,"to-string":Y},jr=class Ip{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[0];if(!gh[i])throw Error(`Can\'t parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&e.length!==2)return r.error("Expected one argument.");let n=gh[i],a=[];for(let s=1;s4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Dp(r[0],r[1],r[2],r[3]),!i))return new gt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ft(i||`Could not parse color from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ae.parse(r);if(n)return n}throw new ft(`Could not parse padding from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=Se.parse(r);if(n)return n}throw new ft(`Could not parse numberArray from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=oe.parse(r);if(n)return n}throw new ft(`Could not parse colorArray from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(e);let n=De.parse(r);if(n)return n}throw new ft(`Could not parse variableAnchorOffsetCollection from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new ft(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return ze.fromString(Gi(this.args[0].evaluate(e)));case"resolvedImage":return _e.fromString(Gi(this.args[0].evaluate(e)));case"projectionDefinition":{let r=this.args[0].evaluate(e);if(Dr.parse(r))return r;throw new ft(`Could not parse projectionDefinition from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}default:return Gi(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Cp=class Mp{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a=i.length)throw new ft(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new ft(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},n0=class Lp{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=tt}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);return!i||!n?null:gl(i.type,[tt,Y,I,dn,Z])?new Lp(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!dr(r,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(_t(r))} instead.`,this.key);if(!dr(i,["string","array"]))throw new ft(`Expected second argument to be of type array or string, but found ${yt(_t(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},a0=class to{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=I}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);if(!i||!n)return null;if(!gl(i.type,[tt,Y,I,dn,Z]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new to(i,n,r.key,a):null}return new to(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!dr(r,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(_t(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),dr(i,["string"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(dr(i,["array"]))return i.indexOf(r,n);throw new ft(`Expected second argument to be of type array or string, but found ${yt(_t(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},s0=class Vp{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let a={},s=[];for(let u=2;u2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d=="number"&&Math.floor(d)!==d)return p.error("Numeric branch labels must be integer values.");if(!i)i=_t(d);else if(p.checkSubtype(i,_t(d)))return null;if(a[String(d)]!==void 0)return p.error("Branch labels must be unique.");a[String(d)]=s.length}let f=r.parse(c,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,Z);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!=="value"&&r.concat(1).checkSubtype(i,o.type)?null:new Vp(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(_t(r)===this.inputType&&this.outputs[this.cases[r]]||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()}},o0=class Op{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let s=1;sr.outputDefined())&&this.otherwise.outputDefined()}},l0=class eo{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,I);if(!i||!n)return null;if(!gl(i.type,[Ut(Z),Y,Z]))return r.error(`Expected first argument to be of type array or string, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new eo(i.type,i,n,r.key,a):null}return new eo(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),dr(r,["string"]))return[...r].slice(i,n).join("");if(dr(r,["array"]))return r.slice(i,n);throw new ft(`Expected first argument to be of type array or string, but found ${yt(_t(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},Rp=class ro{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error("No output type");return n&&a.some(s=>tn(n,s.type))?new ro(Z,a):new ro(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof _e&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function xh(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function u0(t,e,r){return e===r}function h0(t,e,r){return e!==r}function c0(t,e,r){return er}function f0(t,e,r){return e<=r}function d0(t,e,r){return e>=r}function $p(t,e,r,i){return i.compare(e,r)===0}function y0(t,e,r,i){return!$p(t,e,r,i)}function m0(t,e,r,i){return i.compare(e,r)<0}function g0(t,e,r,i){return i.compare(e,r)>0}function x0(t,e,r,i){return i.compare(e,r)<=0}function v0(t,e,r,i){return i.compare(e,r)>=0}function li(t,e,r){let i=t!=="=="&&t!=="!=";return class Np{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=tt,this.hasUntypedArgument=a.type.kind==="value"||s.type.kind==="value"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error("Expected two or three arguments.");let o=a[0],l=s.parse(a[1],1,Z);if(!l)return null;if(!xh(o,l.type))return s.concat(1).error(`"${o}" comparisons are not supported for type \'${yt(l.type)}\'.`);let u=s.parse(a[2],2,Z);if(!u)return null;if(!xh(o,u.type))return s.concat(2).error(`"${o}" comparisons are not supported for type \'${yt(u.type)}\'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types \'${yt(l.type)}\' and \'${yt(u.type)}\'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Ie(u.type,[l],s.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Ie(l.type,[u],s.key)));let h=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(h=s.parse(a[3],3,Pa),!h)return null}return new Np(l,u,s.key,h)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=_t(s),u=_t(o);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new ft(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=_t(s),u=_t(o);if(l.kind!=="string"||u.kind!=="string")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var b0=li("==",u0,$p),w0=li("!=",h0,y0),D0=li("<",c0,m0),_0=li(">",p0,g0),A0=li("<=",f0,x0),S0=li(">=",d0,v0),Up=class qp{constructor(e,r,i){this.type=Pa,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let i=e[1];if(typeof i!="object"||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,tt);if(!n)return null;let a=r.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,tt);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,Y),!s)?null:new qp(n,a,s)}evaluate(e){return new xl(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},E0=class jp{constructor(e,r,i,n,a,s){this.type=Y,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let i=r.parse(e[1],1,I);if(!i)return null;let n=e[2];if(typeof n!="object"||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,Y),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,Y),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,Y),!o))return null;if(s&&o)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,I),!l))return null;let u=null;return n["max-fraction-digits"]&&(u=r.parse(n["max-fraction-digits"],1,I),!u)?null:new jp(i,a,s,o,l,u)}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}},F0=class Gp{constructor(e){this.type=mn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let i=r.parse(e[1],1,Y);return i?new Gp(i):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),i=_e.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},k0=class Xp{constructor(e,r){this.input=e,this.key=r,this.type=I}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${yt(i.type)} instead.`):new Xp(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new ft(`Expected value to be of type string or array, but found ${yt(_t(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},we=8192;function T0(t,e){let r=I0(t[0]),i=M0(t[1]),n=2**e.z;return[Math.round(r*n*we),Math.round(i*n*we)]}function bl(t,e){let r=2**e.z,i=(t[0]/we+e.x)/r,n=(t[1]/we+e.y)/r;return[C0(i),B0(n)]}function I0(t){return(180+t)/360}function C0(t){return t*360-180}function M0(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function B0(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function gn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function en(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function P0(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function z0(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function $a(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return R0([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(vh(t,e,r,i)&&vh(r,i,t,e))}function L0(t,e,r){for(let i of r)for(let n=0;n0&&c<0||h<0&&c>0}function wl(t,e,r){let i=[];for(let n=0;nr[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}gn(e,t)}function $0(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function bh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];Zp(u,e,r,n),s.push(u)}return s}function wh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t){let l=[];for(let u of o){let h=[u.x+a[0],u.y+a[1]];gn(e,h),l.push(h)}s.push(l)}if(e[2]-e[0]<=n/2){$0(e);for(let o of s)for(let l of o)Zp(l,e,r,n)}return s}function N0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=wl(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!ui(o,a))return!1}if(e.type==="MultiPolygon"){let a=Wp(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!V0(o,a))return!1}return!0}function U0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=wl(e.coordinates,i,n),s=wh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!Yp(o,a))return!1}if(e.type==="MultiPolygon"){let a=Wp(e.coordinates,i,n),s=wh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!O0(o,a))return!1}return!0}var Dl=class ha{constructor(e,r){this.type=tt,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'within\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type==="FeatureCollection"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s==="Polygon"&&n.push(o),s==="MultiPolygon"&&n.push(...o)}if(n.length)return new ha(i,{type:"MultiPolygon",coordinates:n})}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new ha(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new ha(i,i)}return r.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return N0(e,this.geometries);if(e.geometryType()==="LineString")return U0(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Hp=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}},Dh=Math.PI/180,_l=class{constructor(t){let e=Dh*6378.137*1e3,r=Math.cos(t*Dh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-u)*this.ky;let f=h*h+c*c;f180;)t-=360;return t}};function Kp(t,e){return e[0]-t[0]}function ga(t){return t[1]-t[0]+1}function Le(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];let r=ga(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function no(t,e){if(!Le(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)gn(r,t[i]);return r}function ao(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)gn(e,i);return e}function _h(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Al(t,e,r){if(!_h(t)||!_h(e))return NaN;let i=0,n=0;return t[2]e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]=i)return i;if(en(n,a)){if(Ah(t,e))return 0}else if(Ah(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,h=u-1;l0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],h=e?50:100;if(ga(u)<=h){if(!Le(u,t.length))return NaN;if(e){let c=X0(t,u,r,i);if(isNaN(c)||c===0)return c;a=Math.min(a,c)}else for(let c=u[0];c<=u[1];++c){let p=G0(t[c],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let c=io(u,e);Sh(s,a,i,t,o,c[0]),Sh(s,a,i,t,o,c[1])}}return a}function va(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new Hp([[0,[0,t.length-1],[0,r.length-1]]],Kp);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=e?50:100,p=i?50:100;if(ga(u)<=c&&ga(h)<=p){if(!Le(u,t.length)&&Le(h,r.length))return NaN;let f;if(e&&i)f=q0(t,u,r,h,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=h[0];y<=h[1];++y)if(f=hr(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(h[0],h[1]+1);for(let y=u[0];y<=u[1];++y)if(f=hr(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=j0(t,u,r,h,n),s=Math.min(s,f)}else{let f=io(u,e),d=io(h,i);Gn(o,s,n,t,r,f[0],d[0]),Gn(o,s,n,t,r,f[0],d[1]),Gn(o,s,n,t,r,f[1],d[0]),Gn(o,s,n,t,r,f[1],d[1])}}return s}function W0(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,va(i,!1,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,va(i,!1,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,xa(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function Z0(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,va(i,!0,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,va(i,!0,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,xa(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function H0(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=Ra(r,0).map(s=>s.map(o=>o.map(l=>bl([l.x,l.y],t.canonical)))),n=new _l(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case"Point":a=Math.min(a,xa([s.coordinates],!1,o,n,a));break;case"LineString":a=Math.min(a,xa(s.coordinates,!0,o,n,a));break;case"Polygon":a=Math.min(a,Y0(o,s.coordinates,n,a))}if(a===0)return a}return a}function Ls(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var El=class ca{constructor(e,r){this.type=I,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'distance\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type==="FeatureCollection")return new ca(i,i.features.map(n=>Ls(n.geometry)).flat());if(i.type==="Feature")return new ca(i,Ls(i.geometry));if("type"in i&&"coordinates"in i)return new ca(i,Ls(i))}return r.error("\'distance\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return W0(e,this.geometries);if(e.geometryType()==="LineString")return Z0(e,this.geometries);if(e.geometryType()==="Polygon")return H0(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},K0=class Jp{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=Z;break}this.type=Ut(r!=null?r:Z,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`\'semiliteral\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=_t(i);if(n.kind==="array"){let a=i.map(s=>r.parse(s,null,Z));return new Jp(a)}return new ri(n,i)}evaluate(e){return this.arr.map(r=>r.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},Fl=class Qp{constructor(e){this.key=e,this.type=Z}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error("Global state property must be defined."):typeof i=="string"?new Qp(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){var i,n;let r=(i=e.globals)==null?void 0:i.globalState;return!r||Object.keys(r).length===0?null:(n=ji(r,this.key))!=null?n:null}eachChild(){}outputDefined(){return!1}},Yr={"==":b0,"!=":w0,">":_0,"<":D0,">=":S0,"<=":A0,array:Ie,at:i0,boolean:Ie,case:o0,coalesce:Rp,collator:Up,format:Ep,image:F0,in:n0,"index-of":a0,interpolate:be,"interpolate-hcl":be,"interpolate-lab":be,length:k0,let:Cp,literal:ri,match:s0,number:Ie,"number-format":E0,object:Ie,semiliteral:K0,slice:l0,step:vl,string:Ie,"to-boolean":jr,"to-color":jr,"to-number":jr,"to-string":jr,var:Bp,within:Dl,distance:El,"global-state":Fl},ve=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},J0=class tf{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new tf(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},ef=class rf{constructor(e,r,i=[],n,a=new J0,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(""),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r?this.concat(r,i,n)._parse(e,a):this._parse(e,a)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);let i=this.key;function n(a,s,o){return o==="assert"?new Ie(s,[a],i):o==="coerce"?new jr(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error(\'Expected an array with at least one element. If you wanted a literal array, use ["literal", []].\');let a=e[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")o=n(o,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))o=n(o,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(o instanceof ri)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let l=new Ap;try{o=new ri(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return e===void 0?this.error("\'undefined\' value invalid. Use null instead."):typeof e=="object"?this.error(\'Bare objects invalid. Use ["literal", {...}] instead.\'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e=="number"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new rf(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join("")}`;this.errors.push(new ve(i,e))}checkSubtype(e,r){let i=tn(e,r);return i&&this.error(i),i}},_r=class Ri{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=Ri.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,h]of o){l=new ef(r.registry,ba,r.path,null,r.scope);let c=[],p=!1;for(let f=1;ftm(c)).join(" | "),h=[];for(let c=1;c>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function sr(t){return{type:t}}_r.register(Yr,{error:[R1,[Y],(t,[e],r)=>{throw new ft(e.evaluate(t),r)}],typeof:[Y,[Z],(t,[e])=>yt(_t(e.evaluate(t)))],"to-rgba":[Ut(I,4),[ce],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[ce,[I,I,I],Eh],rgba:[ce,[I,I,I,I],Eh],has:{type:tt,overloads:[[[Y],(t,[e])=>Fh(e.evaluate(t),t.properties())],[[Y,fr],(t,[e,r])=>Fh(e.evaluate(t),r.evaluate(t))]]},get:{type:Z,overloads:[[[Y],(t,[e])=>Vs(e.evaluate(t),t.properties())],[[Y,fr],(t,[e,r])=>Vs(e.evaluate(t),r.evaluate(t))]]},"feature-state":[Z,[Y],(t,[e])=>Vs(e.evaluate(t),t.featureState||{})],properties:[fr,[],t=>t.properties()],"geometry-type":[Y,[],t=>t.geometryType()],id:[Z,[],t=>t.id()],zoom:[I,[],t=>t.globals.zoom],"heatmap-density":[I,[],t=>t.globals.heatmapDensity||0],elevation:[I,[],t=>t.globals.elevation||0],"line-progress":[I,[],t=>t.globals.lineProgress||0],accumulated:[Z,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[I,sr(I),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],"*":[I,sr(I),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],"-":{type:I,overloads:[[[I,I],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[I],(t,[e])=>-e.evaluate(t)]]},"/":[I,[I,I],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[I,[I,I],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[I,[],()=>Math.LN2],pi:[I,[],()=>Math.PI],e:[I,[],()=>Math.E],"^":[I,[I,I],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[I,[I],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[I,[I],(t,[e])=>Math.log(e.evaluate(t))],log2:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[I,[I],(t,[e])=>Math.sin(e.evaluate(t))],cos:[I,[I],(t,[e])=>Math.cos(e.evaluate(t))],tan:[I,[I],(t,[e])=>Math.tan(e.evaluate(t))],asin:[I,[I],(t,[e])=>Math.asin(e.evaluate(t))],acos:[I,[I],(t,[e])=>Math.acos(e.evaluate(t))],atan:[I,[I],(t,[e])=>Math.atan(e.evaluate(t))],min:[I,sr(I),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[I,sr(I),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[I,[I],(t,[e])=>Math.abs(e.evaluate(t))],round:[I,[I],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[I,[I],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[I,[I],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[tt,[Y,Z],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[tt,[Z],(t,[e])=>t.id()===e.value],"filter-type-==":[tt,[Y],(t,[e])=>t.geometryType()===e.value],"filter-<":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{let r=t.id(),i=e.value;return typeof r==typeof i&&r":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[tt,[Z],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],"filter-has-id":[tt,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[tt,[Ut(Y)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[tt,[Ut(Z)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[tt,[Y,Ut(Z)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[tt,[Y,Ut(Z)],(t,[e,r])=>Q0(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[sr(tt),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[sr(tt),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[tt,[tt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[tt,[Y],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[Y,[Y],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Y,[Y],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Y,sr(Z),(t,e)=>e.map(r=>Gi(r.evaluate(t))).join("")],split:[Ut(Y),[Y,Y],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[Y,[Ut(Y),Y],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],"resolved-locale":[Y,[Pa],(t,[e])=>e.evaluate(t).resolvedLocale()]});function tm(t){return Array.isArray(t)?`(${t.map(yt).join(", ")})`:`(${yt(t.type)}...)`}function ba(t){if(t instanceof Bp)return ba(t.boundExpression);if(t instanceof _r&&t.name==="error"||t instanceof Up||t instanceof Dl||t instanceof El||t instanceof Fl)return!1;let e=t instanceof jr||t instanceof Ie,r=!0;return t.eachChild(i=>{r&&(r=e?ba(i):i instanceof ri)}),r?Na(t)&&Ua(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function Na(t){if(t instanceof _r&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof Dl||t instanceof El)return!1;let e=!0;return t.eachChild(r=>{e&&!Na(r)&&(e=!1)}),e}function rn(t){if(t instanceof _r&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!rn(r)&&(e=!1)}),e}function Ua(t,e){if(t instanceof _r&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!Ua(i,e)&&(r=!1)}),r}function ii(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function nf(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function kl(t){return!!t.expression&&t.expression.interpolated}var Tl=/^(.*)-transition$/;function nn(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function Q(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function qa(t){return typeof t=="object"&&!!t&&!Array.isArray(t)&&_t(t)===fr}function em(t){return t}function rm(t){switch(t.type){case"color":return gt.parse;case"padding":return Ae.parse;case"numberArray":return Se.parse;case"colorArray":return oe.parse;default:return null}}function im(t){switch(t){case"exponential":return sf;case"interval":return am;case"categorical":return nm;case"identity":return sm;default:throw Error(`Unknown function type "${t}"`)}}function af(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",i=r||t.property!==void 0,n=r||!i,a=t.type||(kl(e)?"exponential":"interval"),s=rm(e);if(s&&(t=nn({},t),t.stops&&(t.stops=t.stops.map(h=>[h[0],s(h[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!Z1(t.colorSpace))throw Error(`Unknown color space: "${t.colorSpace}"`);let o=im(a),l,u;if(a==="categorical"){l=Object.create(null);for(let h of t.stops)l[h[0]]=h[1];u=typeof t.stops[0][0]}if(r){let h={},c=[];for(let d=0;dd[0]),evaluate({zoom:d},y){return sf({stops:p,base:t.base},e,d).evaluate(d,y)}}}if(n){let h=a==="exponential"?{name:"exponential",base:t.base===void 0?1:t.base}:null;return{kind:"camera",interpolationType:h,interpolationFactor:be.interpolationFactor.bind(void 0,h),zoomStops:t.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(t,e,c,l,u)}}return{kind:"source",evaluate(h,c){let p=c&&c.properties?c.properties[t.property]:void 0;return p===void 0?xn(t.default,e.default):o(t,e,p,l,u)}}}function xn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function nm(t,e,r,i,n){return xn(typeof r===n?i[r]:void 0,t.default,e.default)}function am(t,e,r){if(Q(r)!=="number")return xn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=Oa(t.stops.map(a=>a[0]),r,"");return t.stops[n][1]}function sf(t,e,r){let i=t.base===void 0?1:t.base;if(Q(r)!=="number")return xn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=Oa(t.stops.map(h=>h[0]),r,""),s=om(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=gr[e.type]||em;return typeof o.evaluate=="function"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function sm(t,e,r){switch(e.type){case"color":r=gt.parse(r);break;case"formatted":r=ze.fromString(r.toString());break;case"resolvedImage":r=_e.fromString(r.toString());break;case"padding":r=Ae.parse(r);break;case"colorArray":r=oe.parse(r);break;case"numberArray":r=Se.parse(r);break;default:Q(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return xn(r,t.default,e.default)}function om(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}function so(t){return{result:"success",value:t}}function Nr(t){return{result:"error",value:t}}var Il=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new Ap,this._defaultValue=r?pf(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ft(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let o=s instanceof ft?s.path:"",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(of(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function of(t,e,r,i){return`${t}${e}: ${r}${i==null?"":` Falling back to ${String(i)}.`}`}function lf(t){if(!t)throw Error(\'rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".\')}function ja(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Yr}function er(t,e,r,i){lf(e);let n=new ef(Yr,ba,[],r?hm(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?so(new Il(a,e,r,i)):Nr(n.errors)}var an=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!=="constant"&&!rn(e.expression),this.globalStateRefs=vn(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},wa=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!=="camera"&&!rn(e.expression),this.globalStateRefs=vn(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?be.interpolationFactor(this.interpolationType,t,e,r):0}};function lm(t){return t._styleExpression!==void 0}function uf(t,e,r,i){let n=er(t,e,r,i);if(n.result==="error")return n;let a=n.value.expression,s=Na(a);if(!s&&!ii(r))return Nr([new ve("","data expressions not supported")]);let o=Ua(a,["zoom"]);if(!o&&!nf(r))return Nr([new ve("","zoom expressions not supported")]);let l=pa(a);if(!l&&!o)return Nr([new ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(l instanceof ve)return Nr([l]);if(l instanceof be&&!kl(r))return Nr([new ve("",\'"interpolate" expressions cannot be used with this property\')]);if(!l)return so(s?new an("constant",n.value,i):new an("source",n.value,i));let u=l instanceof be?l.interpolation:void 0;return so(s?new wa("camera",n.value,l.labels,u,i):new wa("composite",n.value,l.labels,u,i))}var hf=class cf{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,lf(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=pf(i),this._warningHistory={};let n=af(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<"u"&&console.warn(of(this._rootKey,"",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new cf(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function um(t,e,r,i){if(qa(t))return new hf(t,e,r);if(ja(t)){let n=uf(t,e,r,i);if(n.result==="error")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(", "));return n.value}{let n=t;return r.type==="color"&&typeof t=="string"?n=gt.parse(t):r.type==="padding"&&(typeof t=="number"||Array.isArray(t))?n=Ae.parse(t):r.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?n=Se.parse(t):r.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?n=oe.parse(t):r.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?n=De.parse(t):r.type==="projectionDefinition"&&typeof t=="string"&&(n=Dr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>n}}}function pa(t){let e=null;if(t instanceof Cp)e=pa(t.result);else if(t instanceof Rp){for(let r of t.args)if(e=pa(r),e)break}else(t instanceof vl||t instanceof be)&&t.input instanceof _r&&t.input.name==="zoom"&&(e=t);return e instanceof ve||t.eachChild(r=>{let i=pa(r);i instanceof ve?e=i:!e&&i?e=new ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):e&&i&&e!==i&&(e=new ve("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),e}function vn(t,e=new Set){return t instanceof Fl&&e.add(t.key),t.eachChild(r=>{vn(r,e)}),e}function hm(t){let e={color:ce,string:Y,number:I,enum:Y,boolean:tt,formatted:yn,padding:za,numberArray:La,colorArray:Qi,projectionDefinition:Ba,resolvedImage:mn,variableAnchorOffsetCollection:Va};return t.type==="array"?Ut(e[t.value]||Z,t.length):e[t.type]}function pf(t){if(t.type==="color"&&qa(t.default))return new gt(0,0,0,0);switch(t.type){case"color":return gt.parse(t.default)||null;case"padding":return Ae.parse(t.default)||null;case"numberArray":return Se.parse(t.default)||null;case"colorArray":return oe.parse(t.default)||null;case"variableAnchorOffsetCollection":return De.parse(t.default)||null;case"projectionDefinition":return Dr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function ni(t,e){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=t!=null?t:{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:e}}function cm(t){let e=!1;for(let r of t){let i=ff(r);if(i==="expression")return"expression";i==="legacy"&&(e=!0)}return e?"legacy":"neutral"}function ff(t){if(typeof t=="boolean")return"neutral";if(!Array.isArray(t)||t.length===0)return"legacy";switch(t[0]){case"has":return t.length<2||t[1]==="$id"||t[1]==="$type"?"legacy":t.length===2?"neutral":"expression";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return cm(t.slice(1));default:return"expression"}}function Cl(t){return ff(t)!=="legacy"}function kh(t){return t==="$type"?["geometry-type"]:t==="$id"?["id"]:["get",t]}function pm(t){switch(t[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return t.length!==3||typeof t[1]!="string"?null:[t[0],kh(t[1]),t[2]];case"in":case"!in":{if(t.length<2||typeof t[1]!="string")return null;let e=["in",kh(t[1]),["literal",t.slice(2)]];return t[0]==="!in"?["!",e]:e}case"has":case"!has":{if(t.length!==2||typeof t[1]!="string"||t[1]==="$type"||t[1]==="$id")return null;let e=["has",t[1]];return t[0]==="!has"?["!",e]:e}default:return null}}function df(t){if((t[0]==="<"||t[0]==="<="||t[0]===">"||t[0]===">=")&&t[1]==="$type")return`"$type" cannot be use with operator "${t[0]}"`;let e=pm(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function Os(t,e,r){let i=r[t];return Array.isArray(i)?Cl(i)?Ml(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Ml(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case"all":case"any":case"none":for(let r=1;r"u")return;let i=r.path.map(n=>`[${n}]`).join("");console.warn(`${e}${i}: ${df(r.legacyFilter)}`)}var dm={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ai(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Cl(t)?fm(t,e):t=Da(t);let i=er(t,e,dm,r);if(i.result==="error")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:yf(t),getGlobalStateRefs:()=>vn(i.value.expression)}}function ym(t,e){return te)}function yf(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e"||e==="<="||e===">="?Rs(t[1],t[2],e):e==="any"?mm(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(Da)):e==="none"?["all"].concat(t.slice(1).map(Da).map(Xn)):e==="in"?Th(t[1],t.slice(2)):e==="!in"?Xn(Th(t[1],t.slice(2))):e==="has"?Ih(t[1]):e!=="!has"||Xn(Ih(t[1]))}function Rs(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function mm(t){return["any"].concat(t.map(Da))}function Th(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(ym)]]:["filter-in-small",t,["literal",e]]}}function Ih(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Xn(t){return["!",t]}function mf(t){let e=t.key,r=t.value;return r?[new E(e,r,"constants have been deprecated as of v8")]:[]}function Dt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function xr(t){if(Array.isArray(t))return t.map(xr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=xr(t[r]);return e}return Dt(t)}function te(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=Q(r);if(u!=="object")return[new E(e,r,`object expected, ${u} found`)];for(let h in r){let c=h.split(".")[0],p=ji(i,c)||i["*"],f;if(ji(n,c))f=n[c];else if(ji(i,c)){if(r[h]===void 0)continue;f=o}else if(n["*"])f=n["*"];else if(i["*"])f=o;else{l.push(new E(e,r[h],`unknown property "${h}"`));continue}l=l.concat(f({key:(e&&`${e}.`)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h,validateSpec:o},r))}for(let h in i)n[h]||i[h].required&&i[h].default===void 0&&r[h]===void 0&&l.push(new E(e,r,`missing required property "${h}"`));return l}function Bl(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(Q(e)!=="array")return[new E(s,e,`array expected, ${Q(e)} found`)];if(r.length&&e.length!==r.length)return[new E(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),Q(r.value)==="object"&&(l=r.value);let u=[];for(let h=0;hi.maximum?[new E(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new E(e,r,`number expected, ${n} found`)]}function gf(t){let e=t.valueSpec,r=Dt(t.value.type),i,n={},a,s,o=r!=="categorical"&&t.value.property===void 0,l=!o,u=Q(t.value.stops)==="array"&&Q(t.value.stops[0])==="array"&&Q(t.value.stops[0][0])==="object",h=te({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:c,default:d}});return r==="identity"&&o&&h.push(new E(t.key,t.value,\'missing required property "property"\')),r!=="identity"&&!t.value.stops&&h.push(new E(t.key,t.value,\'missing required property "stops"\')),r==="exponential"&&t.valueSpec.expression&&!kl(t.valueSpec)&&h.push(new E(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!ii(t.valueSpec)?h.push(new E(t.key,t.value,"property functions not supported")):o&&!nf(t.valueSpec)&&h.push(new E(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&h.push(new E(t.key,t.value,\'"property" property is required\')),h;function c(y){if(r==="identity")return[new E(y.key,y.value,\'identity function may not have a "stops" property\')];let m=[],g=y.value;return m=m.concat(Bl({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),Q(g)==="array"&&g.length===0&&m.push(new E(y.key,g,"array must have at least one stop")),m}function p(y){let m=[],g=y.value,x=y.key;if(Q(g)!=="array")return[new E(x,g,`array expected, ${Q(g)} found`)];if(g.length!==2)return[new E(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(Q(g[0])!=="object")return[new E(x,g,`object expected, ${Q(g[0])} found`)];if(g[0].zoom===void 0)return[new E(x,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new E(x,g,"object stop key must have value")];if(s&&s>Dt(g[0].zoom))return[new E(x,g[0].zoom,"stop zoom values must appear in ascending order")];Dt(g[0].zoom)!==s&&(s=Dt(g[0].zoom),a=void 0,n={}),m=m.concat(te({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:Ga,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return ja(xr(g[1]))?m.concat([new E(`${x}[1]`,g[1],"expressions are not allowed in function stops.")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=Q(y.value),x=Dt(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new E(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new E(y.key,v,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let b=`number expected, ${g} found`;return ii(e)&&r===void 0&&(b+=\'\\nIf you intended to use a categorical function, specify `"type": "categorical"`.\'),[new E(y.key,v,b)]}return r==="categorical"&&g==="number"&&(!isFinite(x)||Math.floor(x)!==x)?[new E(y.key,v,`integer expected, found ${x}`)]:r!=="categorical"&&g==="number"&&a!==void 0&&xnew E(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new E(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!rn(r))return[new E(t.key,t.value,\'"feature-state" data expressions are not supported with layout properties.\')];if(t.expressionContext==="filter"&&!rn(r))return[new E(t.key,t.value,\'"feature-state" data expressions are not supported with filters.\')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Ua(r,["zoom","feature-state"]))return[new E(t.key,t.value,\'"zoom" and "feature-state" expressions are not supported with cluster properties.\')];if(t.expressionContext==="cluster-initial"&&!Na(r))return[new E(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function gm(t){let e=t.value,r=t.key,i=Q(e);return i==="boolean"?[]:[new E(r,e,`boolean expected, ${i} found`)]}function oo(t){let e=t.key,r=t.value,i=Q(r);return i==="string"?gt.parse(String(r))?[]:[new E(e,r,`color expected, "${r}" found`)]:[new E(e,r,`color expected, ${i} found`)]}function sn(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Dt(r))===-1&&n.push(new E(e,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(Dt(r))===-1&&n.push(new E(e,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function xm(t,e){let r=t;for(let i of e)r=r[i];return r}function vm(t,e){let r=Ml(e);return r?[new E(`${t.key}${r.path.map(i=>`[${i}]`).join("")}`,xm(t.value,r.path),df(r.legacyFilter),null,"warning")]:[]}function Pl(t){let e=xr(t.value);return Cl(e)?[...vm(t,e),...si(nn({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:xf(t)}function xf(t){let e=t.value,r=t.key;if(Q(e)!=="array")return[new E(r,e,`array expected, ${Q(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new E(r,e,"filter array must have at least 1 element")];switch(a=a.concat(sn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Dt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Dt(e[1])==="$type"&&a.push(new E(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&a.push(new E(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=Q(e[1]),n!=="string"&&a.push(new E(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s{c in r&&e.push(new E(i,r[c],`"${c}" is prohibited for ref layers`))});let h;n.layers.forEach(c=>{Dt(c.id)===o&&(h=c)}),h?h.ref?e.push(new E(i,r.ref,"ref cannot reference another ref layer")):s=Dt(h.type):e.push(new E(i,r.ref,`ref layer "${o}" not found`))}else if(s!=="background")if(!r.source)e.push(new E(i,r,\'missing required property "source"\'));else{let h=n.sources&&n.sources[r.source],c=h&&Dt(h.type);h?c==="vector"&&s==="raster"?e.push(new E(i,r.source,`layer "${r.id}" requires a raster source`)):c!=="raster-dem"&&s==="hillshade"||c!=="raster-dem"&&s==="color-relief"?e.push(new E(i,r.source,`layer "${r.id}" requires a raster-dem source`)):c==="raster"&&s!=="raster"?e.push(new E(i,r.source,`layer "${r.id}" requires a vector source`)):c==="vector"&&!r["source-layer"]?e.push(new E(i,r,`layer "${r.id}" must specify a "source-layer"`)):c==="raster-dem"&&s!=="hillshade"&&s!=="color-relief"?e.push(new E(i,r.source,"raster-dem source can only be used with layer type \'hillshade\' or \'color-relief\'.")):s==="line"&&r.paint&&r.paint["line-gradient"]&&(c!=="geojson"||!h.lineMetrics)&&e.push(new E(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new E(i,r.source,`source "${r.source}" not found`))}return s==="raster"&&((l=r.paint)!=null&&l.resampling)&&((u=r.paint)!=null&&u["raster-resampling"])&&e.push(new E(i,r.paint,`layer "${r.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),e=e.concat(te({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Pl,layout(h){return te({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{"*"(c){return wf(nn({layerType:s},c))}}})},paint(h){return te({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{"*"(c){return bf(nn({layerType:s},c))}}})}}})),e}function tr(t){let e=t.value,r=t.key,i=Q(e);return i==="string"?[]:[new E(r,e,`string expected, ${i} found`)]}function bm(t){var c;let e=(c=t.sourceName)!=null?c:"",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=Q(r);if(r===void 0)return s;if(o!=="object")return s.push(new E("source_raster_dem",r,`object expected, ${o} found`)),s;let l=Dt(r.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let p in r)!l&&u.includes(p)?s.push(new E(p,r[p],`In "${e}": "${p}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):n[p]?s=s.concat(t.validateSpec({key:p,value:r[p],valueSpec:n[p],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new E(p,r[p],`unknown property "${p}"`));return s}var Ch={promoteId:wm};function _f(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new E(r,e,\'"type" is required\')];let s=Dt(e.type),o;switch(s){case"vector":case"raster":return o=te({key:r,value:e,valueSpec:i[`source_${s.replace("-","_")}`],style:t.style,styleSpec:i,objectElementValidators:Ch,validateSpec:a}),o;case"raster-dem":return o=bm({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case"geojson":if(o=te({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Ch}),e.cluster)for(let l in e.clusterProperties){let[u,h]=e.clusterProperties[l],c=typeof u=="string"?[u,["accumulated"],["get",l]]:u;o.push(...si({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:"cluster-map"})),o.push(...si({key:`${r}.${l}.reduce`,value:c,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return te({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return te({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new E(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return sn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function wm({key:t,value:e}){if(Q(e)==="string")return tr({key:t,value:e});{let r=[];for(let i in e)r.push(...tr({key:`${t}.${i}`,value:e[i]}));return r}}function Af(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=Q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new E("light",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(Tl);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property "${o}"`)])}return a}function Sf(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=Q(e);if(e===void 0)return[];if(a!=="object")return[new E("sky",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(Tl);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new E(o,e[o],`unknown property "${o}"`)])}return s}function Ef(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=Q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new E("terrain",e,`object expected, ${s} found`)]),a;for(let o in e)a=i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property "${o}"`)]);return a}function Dm(t){return tr(t).length===0?[]:si(t)}function _m(t){return tr(t).length===0?[]:si(t)}function Am(t){let e=t.key,r=t.value;if(Q(r)==="array"){if(r.length<1||r.length>4)return[new E(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a[new E(t,e,\'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"\')],n=r.match(Mm);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Mh||u>Mh?[new E(t,e,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new E(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function Tf(t){var o,l;let e=(o=t.key)!=null?o:"font-faces",r=t.value,i=t.validateSpec,n=(l=t.styleSpec)!=null?l:pp,a=t.style;if(!lo(r))return[new E(e,r,`object expected, ${Q(r)} found`)];let s=[];for(let u in r){let h=r[u],c=Q(h);if(c==="string")s.push(...tr({key:`${e}.${u}`,value:h}));else if(c==="array"){let p={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[f,d]of h.entries()){let y=`${e}.${u}[${f}]`;s.push(...te({key:y,value:d,valueSpec:p,styleSpec:n,style:a,validateSpec:i}));let m=lo(d)?d["unicode-range"]:void 0;if(Q(m)==="array")for(let[g,x]of m.entries())s.push(...Bm(`${y}.unicode-range[${g}]`,x))}}else s.push(new E(`${e}.${u}`,h,`string or array expected, ${c} found`))}return s}var Bh={"*"(){return[]},array:Bl,boolean:gm,number:Ga,color:oo,constants:mf,enum:sn,filter:Pl,function:gf,layer:Df,object:te,source:_f,light:Af,sky:Sf,terrain:Ef,projection:km,projectionDefinition:Tm,string:tr,formatted:Dm,resolvedImage:_m,padding:Am,numberArray:Sm,colorArray:Em,variableAnchorOffsetCollection:Fm,sprite:Ff,state:kf,fontFaces:Tf};function Xi(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=Xi,r.expression&&qa(Dt(e))?gf(t):r.expression&&ja(xr(e))?si(t):r.type&&Bh[r.type]?Bh[r.type](t):te(nn({},t,{valueSpec:r.type?i[r.type]:r}))}function If(t){let e=t.value,r=t.key,i=tr(t);return i.length||(e.indexOf("{fontstack}")===-1&&i.push(new E(r,e,\'"glyphs" url must include a "{fontstack}" token\')),e.indexOf("{range}")===-1&&i.push(new E(r,e,\'"glyphs" url must include a "{range}" token\'))),i}function Qt(t,e=w){let r=[];return r=r.concat(Xi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Xi,objectElementValidators:{glyphs:If,"*"(){return[]}}})),t.constants&&(r=r.concat(mf({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:Xi}))),Cf(r)}Qt.source=ie(re(_f)),Qt.sprite=ie(re(Ff)),Qt.glyphs=ie(re(If)),Qt.fontFaces=ie(re(Tf)),Qt.light=ie(re(Af)),Qt.sky=ie(re(Sf)),Qt.terrain=ie(re(Ef)),Qt.state=ie(re(kf)),Qt.layer=ie(re(Df)),Qt.filter=ie(re(Pl)),Qt.paintProperty=ie(re(bf)),Qt.layoutProperty=ie(re(wf));function re(t){return function(e){return t(Object.assign({},e,{validateSpec:Xi}))}}function Cf(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function ie(t){return function(...e){return Cf(t.apply(this,e))}}var Pm={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},zm=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){var t;return(t=this._literalValue)!=null?t:this._compiledValue.evaluate({})}setValue(t){if(t==null||t==="visible"||t==="none"){this._literalValue=t==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=er(t,this._rootKey,Pm,this._globalState);if(e.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=vn(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function Lm(t,e,r){return new zm(t,e,r)}var Ph=Qt,y5=new Set(Object.keys(w).filter(t=>t.startsWith("source_")).map(t=>t.slice(7).replaceAll("_","-")));function Vm(t,e){let r=!1;for(let i of e){if(i.severity==="warning"){Bt(i.message);continue}t.fire(new ma(Error(i.message))),r=!0}return r}function Om(t,e,r,i){return(i==null?void 0:i.validate)!==!1&&Vm(t,e(je({styleSpec:w},r)))}var uo=class Mf{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u=c[f+0]&&n>=c[f+1])?(o[p]=!0,s.push(h[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=c;f++)for(let d=h;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;sr?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},$m="-transition",Xa=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=um(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},ho=class{constructor(t,e,r){this.property=t,this.value=new Xa(t,void 0,e,r)}transitioned(t,e){return new Lh(this.property,this.value,e,Gt({},t.transition,this.transition),t.now)}untransitioned(){return new Lh(this.property,this.value,null,{},0)}},Nm=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return He(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new Xa(this._values[t].property,e===null?void 0:He(e),this._propertyRootKey(t),this._globalState)}getTransition(t){return He(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=He(e)||void 0}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}${$m}`]=i)}return t}transitioned(t,e){let r=new Vh(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new Vh(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},Lh=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(ii.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Lf=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind==="constant"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new st(Math.floor(e.zoom-1),e)),t.expression.evaluate(new st(Math.floor(e.zoom),e)),t.expression.evaluate(new st(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Wa=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Xt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new Xa(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new ho(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};C("DataDrivenProperty",N),C("DataConstantProperty",V),C("CrossFadedDataDrivenProperty",on),C("CrossFadedProperty",Lf),C("ColorRampProperty",Wa);var Rh=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",$s=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",de=class extends O1{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=Lm(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=ai(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new Um(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new Nm(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ya(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=ai(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){var e;if(t==="visibility")return this.visibility;if((e=this._transitionablePaint)!=null&&e.hasProperty(t))throw Error(t+Rh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){var e;let t=new globalThis.Map;if(this._transitionablePaint)for(let r in this._transitionablePaint._values){let i=this._transitionablePaint._values[r].value;for(let n of i.getGlobalStateRefs()){let a=(e=t.get(n))!=null?e:[];a.push({name:r,value:i.value}),t.set(n,a)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){var i;if(t==="visibility"){this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility();return}if((i=this._transitionablePaint)!=null&&i.hasProperty(t)){this.fire(new ma(Error(t+Rh)));return}e!=null&&this._validate(Ph.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){var e,r;if(t.endsWith("-transition")){let i=t.slice(0,-11);if(i==="visibility"||(e=this._unevaluatedLayout)!=null&&e.hasProperty(i))throw Error(t+$s);return this._transitionablePaint.getTransition(i)}if(t==="visibility"||(r=this._unevaluatedLayout)!=null&&r.hasProperty(t))throw Error(t+$s);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){var i;if(t==="visibility"||(i=this._unevaluatedLayout)!=null&&i.hasProperty(t))return this.fire(new ma(Error(t+$s))),!1;if(e!=null&&this._validate(Ph.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith("-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let n=this._transitionablePaint._values[t],a=n.property.specification["property-type"]==="cross-faded-data-driven",s=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let l=this._transitionablePaint._values[t].value;return l.isDataDriven()||s||a||this._handleOverridablePaintPropertyUpdate(t,o,l)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){var e,r;let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)==null?void 0:e.serialize(),paint:(r=this._transitionablePaint)==null?void 0:r.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),T1(t,(i,n)=>i!==void 0&&!(n==="layout"&&!Object.keys(i).length)&&!(n==="paint"&&!Object.keys(i).length))}_validate(t,e,r,i,n={}){return Om(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof se&&ii(e.property.specification)&&(e.value.kind==="source"||e.value.kind==="composite")&&e.value.isStateDependent)return!0}return!1}},qm,jm=()=>qm||(qm=new Xt({"raster-opacity":new V(w.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new V(w.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new V(w.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new V(w.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new V(w.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new V(w.paint_raster["raster-contrast"],"raster-contrast"),resampling:new V(w.paint_raster.resampling,"resampling"),"raster-resampling":new V(w.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new V(w.paint_raster["raster-fade-duration"],"raster-fade-duration")})),Gm={get paint(){return jm()}};var Xm=class extends de{constructor(t,e){super(t,Gm,e)}},Ym={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},bn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},xt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function At(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=Wm(n.type),s=r=$h(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:$h(r,Math.max(i,e)),alignment:e}}function Wm(t){return Ym[t].BYTES_PER_ELEMENT}function $h(t,e){return Math.ceil(t/e)*e}var ln=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};ln.prototype.bytesPerElement=4,C("StructArrayLayout2i4",ln);var co=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};co.prototype.bytesPerElement=6,C("StructArrayLayout3i6",co);var Nh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Nh.prototype.bytesPerElement=8,C("StructArrayLayout4i8",Nh);var po=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};po.prototype.bytesPerElement=12,C("StructArrayLayout2i4i12",po);var fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*4,l=t*8;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,t}};fo.prototype.bytesPerElement=8,C("StructArrayLayout2i4ub8",fo);var un=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};un.prototype.bytesPerElement=8,C("StructArrayLayout2f8",un);var yo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,h){let c=t*10;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};yo.prototype.bytesPerElement=20,C("StructArrayLayout10ui20",yo);var mo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};mo.prototype.bytesPerElement=16,C("StructArrayLayout8ui16",mo);var go=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,h,c,p)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[y+6]=f,t}};go.prototype.bytesPerElement=28,C("StructArrayLayout4i4ui4i1f28",go);var xo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};xo.prototype.bytesPerElement=12,C("StructArrayLayout3f12",xo);var vo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};vo.prototype.bytesPerElement=4,C("StructArrayLayout1ul4",vo);var bo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let h=t*10,c=t*5;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,t}};bo.prototype.bytesPerElement=20,C("StructArrayLayout6i1ul2ui20",bo);var wo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};wo.prototype.bytesPerElement=12,C("StructArrayLayout2i2i2i12",wo);var Uh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};Uh.prototype.bytesPerElement=16,C("StructArrayLayout2f1f2i16",Uh);var Do=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};Do.prototype.bytesPerElement=16,C("StructArrayLayout2ub2f2i16",Do);var _o=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};_o.prototype.bytesPerElement=6,C("StructArrayLayout3ui6",_o);var Ao=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let v=t*26,b=t*13,D=t*52;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=h,this.float32[b+7]=c,this.float32[b+8]=p,this.uint8[D+36]=f,this.uint8[D+37]=d,this.uint8[D+38]=y,this.uint32[b+10]=m,this.int16[v+22]=g,this.float32[b+12]=x,t}};Ao.prototype.bytesPerElement=52,C("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",Ao);var So=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P){let L=this.length;return this.resize(L+1),this.emplace(L,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P,L){let F=t*34,$=t*17;return this.int16[F+0]=e,this.int16[F+1]=r,this.int16[F+2]=i,this.int16[F+3]=n,this.int16[F+4]=a,this.int16[F+5]=s,this.int16[F+6]=o,this.int16[F+7]=l,this.uint16[F+8]=u,this.uint16[F+9]=h,this.uint16[F+10]=c,this.uint16[F+11]=p,this.uint16[F+12]=f,this.uint16[F+13]=d,this.uint16[F+14]=y,this.uint16[F+15]=m,this.uint16[F+16]=g,this.uint16[F+17]=x,this.uint16[F+18]=v,this.uint16[F+19]=b,this.uint16[F+20]=D,this.uint16[F+21]=A,this.uint16[F+22]=_,this.uint32[$+12]=S,this.float32[$+13]=k,this.float32[$+14]=z,this.uint16[F+30]=O,this.uint16[F+31]=P,this.float32[$+16]=L,t}};So.prototype.bytesPerElement=68,C("StructArrayLayout8i15ui1ul2f2ui1f68",So);var _a=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};_a.prototype.bytesPerElement=4,C("StructArrayLayout1f4",_a);var Eo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};Eo.prototype.bytesPerElement=12,C("StructArrayLayout1ui2f12",Eo);var Fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};Fo.prototype.bytesPerElement=8,C("StructArrayLayout1ul2ui8",Fo);var ko=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};ko.prototype.bytesPerElement=4,C("StructArrayLayout2ui4",ko);var qh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};qh.prototype.bytesPerElement=2,C("StructArrayLayout1ui2",qh);var To=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};To.prototype.bytesPerElement=16,C("StructArrayLayout4f16",To);var Vf=class extends bn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new B(this.anchorPointX,this.anchorPointY)}};Vf.prototype.size=20;var Ll=class extends bo{get(t){return new Vf(this,t)}};C("CollisionBoxArray",Ll);var Of=class extends bn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};Of.prototype.size=52;var Rf=class extends Ao{get(t){return new Of(this,t)}};C("PlacedSymbolArray",Rf);var $f=class extends bn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};$f.prototype.size=68;var Nf=class extends So{get(t){return new $f(this,t)}};C("SymbolInstanceArray",Nf);var Uf=class extends _a{getoffsetX(t){return this.float32[t*1+0]}};C("GlyphOffsetArray",Uf);var qf=class extends co{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};C("SymbolLineVertexArray",qf);var jf=class extends bn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};jf.prototype.size=12;var Gf=class extends Eo{get(t){return new jf(this,t)}};C("TextAnchorOffsetArray",Gf);var Xf=class extends bn{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]}};Xf.prototype.size=8;var Yf=class extends Fo{get(t){return new Xf(this,t)}};C("FeatureIndexArray",Yf);var Zm=class extends ln{};var Hm=class extends ln{},Km=class extends ln{},Jm=class extends po{},Qm=class extends fo{},tg=class extends un{},Vr=class extends yo{},jh=class extends mo{},eg=class extends go{},rg=class extends xo{},ig=class extends vo{},Gh=class extends wo{};var ng=class extends Do{};var wn=class extends _o{},Io=class extends ko{};var Co=At([{name:"a_pos",components:2,type:"Int16"}],4),ag=Co.members;Co.size,Co.alignment;var ee=class Ur{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>Ur.MAX_VERTEX_ARRAY_LENGTH&&Bt(`Max vertices per segment is ${Ur.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${Ur.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>Ur.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new Ur([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};ee.MAX_VERTEX_ARRAY_LENGTH=2**16-1,C("SegmentVector",ee);function Xh(t,e){return t=Ji(Math.floor(t),0,255),e=Ji(Math.floor(e),0,255),256*t+e}var sg=At([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),og=At([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),lg=fl(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,h=461845907,c,p=0;p>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)&4294967295,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,a){case 3:c^=(i.charCodeAt(p+2)&255)<<16;case 2:c^=(i.charCodeAt(p+1)&255)<<8;case 1:c^=i.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)&4294967295,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)&4294967295,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),ug=fl(((t,e)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=r})),Mo=h1(fl(((t,e)=>{var r=lg(),i=ug();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),Wf=class Zf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Yh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let r=Yh(e),i=0,n=this.ids.length-1;for(;i>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Bo(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new Zf;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Yh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Mo.default)(String(t))}function Bo(t,e,r,i){for(;r>1],a=r-1,s=i+1;for(;;){do a++;while(t[a]n);if(a>=s)break;Yn(t,a,s),Yn(e,3*a,3*s),Yn(e,3*a+1,3*s+1),Yn(e,3*a+2,3*s+2)}s-r`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type==="color"?new cg(t,e):new Ol(t,e)}},ur=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i==="u_pattern_to"?n=this.patternTo:i==="u_pattern_from"?n=this.patternFrom:i==="u_dasharray_to"?n=this.dashTo:i==="u_dasharray_from"?n=this.dashFrom:i==="u_pixel_ratio_to"?n=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new hg(t,e):new Ol(t,e)}},ke=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new st(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type==="color"){let i=Po(r);for(let n=t;n`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new st(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new st(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(this.zoom,n),r,i),s=this.expression.evaluate(new st(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type==="color"){let n=Po(r),a=Po(i);for(let s=t;s`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof ke||r instanceof he)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof Ye){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof $i||r instanceof ur||r instanceof he)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof $i||n instanceof ur||n instanceof he){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof Ye){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof ke||r instanceof he)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof ke||r instanceof he||r instanceof Ye)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof ke||e instanceof he||e instanceof Ye)&&e.destroy()}}},vr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new Jf(i,e,r);this.needsUpload=!1,this._featureMap=new Wf,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function pg(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function fg(t){return{"line-pattern":{source:Vr,composite:Vr},"fill-pattern":{source:Vr,composite:Vr},"fill-extrusion-pattern":{source:Vr,composite:Vr},"line-dasharray":{source:jh,composite:jh}}[t]}function Wh(t,e,r){var n;let i={color:{source:un,composite:To},number:{source:_a,composite:un}};return((n=fg(t))==null?void 0:n[r])||i[e][r]}C("ConstantBinder",$i),C("CrossFadedConstantBinder",ur),C("SourceExpressionBinder",ke),C("CrossFadedPatternBinder",Hf),C("CrossFadedDasharrayBinder",Kf),C("CompositeExpressionBinder",he),C("ProgramConfiguration",Jf,{omit:["_buffers"]}),C("ProgramConfigurationSet",vr);var zo=2**14-1,Zh=-zo-1;function Ar(t){let e=mt/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=Ji(a,Zh,zo),n.y=Ji(s,Zh,zo),(an.x+1||sn.y+1)&&Bt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function hi(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ar(t):[]}}var Hh=-32768;function dg(t,e,r,i,n){t.emplaceBack(Hh+e*8+i,Hh+r*8+n)}var Rl=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Hm,this.indexArray=new wn,this.segments=new ee,this.programConfigurations=new vr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type==="heatmap";if(i.type==="circle"){let c=i;a=c.layout.get("circle-sort-key"),s=!a.isConstant(),o||(o=c.paint.get("circle-pitch-alignment")==="map")}let l=o?e.subdivisionGranularity.circle:1,u=new st(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:p,index:f,sourceLayerIndex:d}of t){let y=hi(c,h);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:c.properties,type:c.type,sourceLayerIndex:d,index:f,geometry:h?y.geometry:Ar(c),patterns:{},sortKey:m};n.push(g)}s&&n.sort((c,p)=>c.sortKey-p.sortKey);for(let c of n){let{geometry:p,index:f,sourceLayerIndex:d}=c,y=t[f].feature;this.addFeature(c,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ag),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,h=l.y;if(u<0||u>=8192||h<0||h>=8192)continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;for(let f=0;f=3){for(let n of i)if(oi(t,n))return!0}if(gg(t,i,r))return!0}return!1}function gg(t,e,r){if(t.length>1){if($l(t,e))return!0;for(let i of e)if(Lo(i,t,r))return!0}for(let i of t)if(Lo(i,e,r))return!0;return!1}function $l(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Kh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function oi(t,e){let r=!1;for(let i=0,n=t.length-1;ie.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function vg(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new B(e,r),new B(e,n),new B(i,n),new B(i,r)];if(t.length>2){for(let s of a)if(oi(t,s))return!0}for(let s=0;sn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return!1;let a=Ke(t,e,r[0]);return a!==Ke(t,e,r[1])||a!==Ke(t,e,r[2])||a!==Ke(t,e,r[3])}function Wr(t,e,r){let i=e.paint.get(t).value;return i.kind==="constant"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ha(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ka(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=B.convert(e)._mult(n);r==="viewport"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function wg(t){let e=[];for(let r=0;rNl(n,e,r,i))}var kg,Tg=()=>kg||(kg=new Xt({"circle-sort-key":new N(w.layout_circle["circle-sort-key"],"circle-sort-key")})),Ig,Cg=()=>Ig||(Ig=new Xt({"circle-radius":new N(w.paint_circle["circle-radius"],"circle-radius"),"circle-color":new N(w.paint_circle["circle-color"],"circle-color"),"circle-blur":new N(w.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new N(w.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new V(w.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new V(w.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new V(w.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new V(w.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new N(w.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new N(w.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new N(w.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})),Mg={get paint(){return Cg()},get layout(){return Tg()}};var Bg=class extends de{constructor(t,e){super(t,Mg,e)}createBucket(t){return new Rl(t)}queryRadius(t){let e=t;return Wr("circle-radius",this,e)+Wr("circle-stroke-width",this,e)+Ha(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Ka(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),h=this.paint.get("circle-pitch-scale"),c=this.paint.get("circle-pitch-alignment"),p,f;return c==="map"?(p=l,f=u*a):(p=Fg(l,n,s,o),f=u),ed({queryGeometry:p,size:f,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},i)}},rd=class extends Rl{};C("HeatmapBucket",rd,{omit:["layers"]});var Pg,zg=()=>Pg||(Pg=new Xt({"heatmap-radius":new N(w.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new N(w.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new V(w.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Wa(w.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new V(w.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})),Lg={get paint(){return zg()}};function Ul(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function id(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Ul({},{width:e,height:r},i);ql(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function ql(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError("out of range destination coordinates for image copy");let s=t.data,o=e.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;s$g||($g=new Xt({"hillshade-illumination-direction":new V(w.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new V(w.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new V(w.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new V(w.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new V(w.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new V(w.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new V(w.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new V(w.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new V(w.paint_hillshade.resampling,"resampling")})),Ug={get paint(){return Ng()}};var qg=class extends de{constructor(t,e){super(t,Ug,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(ch);return{directionRadians:t.map(ch),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},jg,Gg=()=>jg||(jg=new Xt({"color-relief-opacity":new V(w["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Wa(w["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new V(w["paint_color-relief"].resampling,"resampling")})),Xg={get paint(){return Gg()}};function Wn(t){return"data"in t}var Jh=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){var u;let{width:i,height:n}=t,a=(((u=this.size)==null?void 0:u[0])!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!(e!=null&&e.useMipmap),a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&(e==null?void 0:e.premultiply)!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let h=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,h,o.RGBA8,i,n),Wn(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=t;l&&c&&(c=Ns(c)),c&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,c)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else Wn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:h,y:c}=r||{x:0,y:0};Wn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,h,c,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,h,c,o))}this.useMipmap&&!(Wn(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=Ns(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=Ns(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),(r===n.LINEAR_MIPMAP_NEAREST||r===n.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Pe,jl=(Pe=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i)){Bt(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Pe.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;hthis.max&&(this.max=f),f=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,h=this._unpackAtIndex(a,s),c=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return sd(e,this.getUnpackVector())}getPixels(){return new Zt({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let h=s;h80*r){o=t[0],l=t[1];let h=o,c=l;for(let p=r;ph&&(h=f),d>c&&(c=d)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return Ro(a,s,o,l,u),s}function od(t,e,r,i,n){let a=null;if(n===fx(t,e,r,i)>0)for(let s=e;s=e;s-=i)a=ec(s/i|0,t[s],t[s+1],a);return a&&cn(a,a.next)&&(fn(a),a=a.next),a}function br(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(hn.size===0||!hn.has(i))&&(cn(i,i.next)||Ft(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),Oo=!0,fn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Ro(t,e,r,i,n){n&&ox(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Ft(o,t,l)<0&&(n?Kg(t,r,i,n):Hg(t))){e.push(o.i,t.i,l.i),fn(t),t=l,a=l;continue}if(t=l,t===a){if(Oo=!1,t=br(t),Oo){a=t;continue}if(!s){t=Jg(t,e),a=t,s=!0;continue}Qg(t,e,r,i,n);break}}}function Hg(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,h=Math.min(n,a,s),c=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&(n!==d.x||o!==d.y)&&Ea(n,o,a,l,s,u,d.x,d.y)&&Ft(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Kg(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,h=n.y,c=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(h,c,p),y=Math.max(o,l,u),m=Math.max(h,c,p),g=qo(f,d,e,r,i),x=qo(y,m,e,r,i),v=t.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||h!==v.y)&&Ea(o,h,l,c,u,p,v.x,v.y)&&Ft(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=t.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||h!==b.y)&&Ea(o,h,l,c,u,p,b.x,b.y)&&Ft(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Jg(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;ud(n,r,r.next,a,!1)&&pn(n,a)&&pn(a,n)&&(e.push(n.i,r.i,a.i),fn(r),fn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?br(r):r}function Qg(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&hx(a,s)){let o=hd(a,s);a=br(a,a.next),o=br(o,o.next),Ro(a,e,r,i,n),Ro(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var $o=!1;function tx(t,e,r,i){let n=[];for(let a=0,s=e.length;as&&(s=r.x),r.yo&&(o=r.y),h.xs&&(s=h.x),h.yo&&(o=h.y),r=h}while(++l<16&&r!==e);Uo[i]=r;let u=i*4;wt[u]=n,wt[u+1]=a,wt[u+2]=s,wt[u+3]=o}while(r!==e)}function nx(t,e){let r=t.z*4;e.xwt[r+2]&&(wt[r+2]=e.x),e.y>wt[r+3]&&(wt[r+3]=e.y)}function Qh(t){let e=Uo[t];for(;e.prev.next!==e;)e=e.next;return Uo[t]=e,e}function tc(t){let e=No[t];for(;e.prev.next!==e;)e=e.next;return No[t]=e,e}function ax(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(cn(t,r))return r;for(let p=0,f=0;pwt[f+3]||wt[f]>i||wt[f+2]<=a)continue;let d=Qh(p);r=tc(p);do{if(r.prev.next===r){if(cn(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.xi||wt[f+3]h)continue;let d=Qh(p);r=tc(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&Ea(ni)&&(ys.x||r.x===s.x&&sx(s,r)))&&(s=r,c=y)}r=r.next}while(r!==d)}return s}function sx(t,e){return Ft(t.prev,t,e.prev)<0&&Ft(e.next,t,t.next)<0}var ae=[],Ti=[],or=new Uint32Array,Ii=new Uint32Array,Ci=new Uint32Array(256);function ox(t,e,r,i){let n=t,a=0;do n.z=qo(n.x,n.y,e,r,i),ae[a++]=n,n=n.next;while(n!==t);lx(a);let s=null;for(let o=0;o=0&&ae[n].z>i;)ae[n+1]=ae[n],n--;ae[n+1]=r}return}or.length>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Ci[o];Ci[o]=s,s+=l}for(let o=0;o>>a&255]++;i[u]=e[o],n[u]=l}}function qo(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function ux(t){let e=t,r=t;do(e.x=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function hx(t,e){let r=cn(t,e)&&Ft(t.prev,t,t.next)>0&&Ft(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||pn(t,e)&&pn(e,t)&&(Ft(t.prev,t,e.prev)!==0||Ft(t,e.prev,e)!==0))&&!cx(t,e)&&(r||px(t,e))}function Ft(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function cn(t,e){return t.x===e.x&&t.y===e.y}function ud(t,e,r,i,n=!0){let a=Ft(t,e,r),s=Ft(t,e,i),o=Ft(r,i,t),l=Ft(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&Hn(t,r,e)||s===0&&Hn(t,i,e)||o===0&&Hn(r,t,i)||l===0&&Hn(r,e,i)):!1}function Hn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function cx(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.xa&&o.y>a||s.y=0&&Ft(t,t.prev,e)>=0:Ft(t,e,t.prev)<0||Ft(t,t.next,e)<0}function px(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function hd(t,e){let r=jo(t.i,t.x,t.y),i=jo(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function ec(t,e,r,i){let n=jo(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function fn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),$o&&nx(t.prev,t.next)}function jo(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function fx(t,e,r,i){let n=0;for(let a=e,s=r-i;at)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<32767||e>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,a),this._vertexBuffer.push(r,i),a}_subdivideTrianglesScanline(t){if(this._granularity<2)return gx(this._vertexBuffer,t);let e=[],r=t.length;for(let i=0;i=1||b<=0)||m&&(ln)){h>=i&&h<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let _=o+f*v,S=l+d*v;a.push(this._vertexToIndex(_,S))}let D=o+f*Math.max(v,0),A=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,h,D,A),!m&&b<1){let _=o+f*b,S=l+d*b;a.push(this._vertexToIndex(_,S))}(m||h>=i&&h<=n)&&a.push(r[(s+1)%3]),!m&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,o,l,u,h,c,p,A,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,h=u?Math.min(e,i):Math.min(a,s),c=u?Math.max(e,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(u?e=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let h=n-r,c=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+c*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o=1||m<=0){let _=e-a,S=r-s,k=(l-s)/S,z=(u-s)/S,O=a+_*Math.min(k,z);x=Math.floor(Math.min(O,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(O,o)/this._granularityCellSize)-1,b=o0?u:l;if(b)for(let _=x;_<=v;_++){let S=_*this._granularityCellSize;t.push(this._vertexToIndex(S,A))}else for(let _=v;_>=x;_--){let S=_*this._granularityCellSize;t.push(this._vertexToIndex(S,A))}}_generateOutline(t){let e=[];for(let r of t){let i=cr(r,this._granularity,!0),n=this._pointArrayToIndices(i),a=[];for(let s=1;sn==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=mt,a=t.length;for(let s=2;s=2&&((s=this._canonical)==null?void 0:s.z)===0&&(n=this._removeTrianglesOutsideTileX(n),a=a.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:n,indicesLineList:a}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r0?(Math.floor(_/s)+1)*s:(Math.ceil(_/s)-1)*s,O=b>0?(Math.floor(S/s)+1)*s:(Math.ceil(S/s)-1)*s,P=Math.abs(_-z),L=Math.abs(S-O),F=Math.abs(_-y),$=Math.abs(S-m),U=g?P/D:1/0,T=x?L/A:1/0;if((F<=P||!g)&&($<=L||!x))break;if(U0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function xx(t,e,r){if(e.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,n=t[e[0]*2];for(let l=1;l=0?s-1:a-1,u=(o+1)%a,h=t[e[l]*2],c=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(hp)x=!1;else{let v=g-y,b=-(m-d),D=y((p-d)*v+(f-y)*b)*D&&(x=!0)}if(x){let v=e[l],b=e[s],D=e[o];v!==b&&v!==D&&b!==D&&r.push(D,b,v),s--,s<0&&(s=a-1)}else{let v=e[u],b=e[s],D=e[o];v!==b&&v!==D&&b!==D&&r.push(D,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function pd(t,e,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(uee.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=Zi(s,i,a,o,p,y,u),b=Zi(s,i,a,o,f,m,u),D=Zi(s,i,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+D-l),u.primitiveLength++}}function bx(t,e,r,i,n,a){let s=[];for(let c=0;cee.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,h=0);let x=Zi(s,i,a,o,f,y,u),v=Zi(s,i,a,o,d,m,u);r.emplaceBack(h+x-l,h+v-l),u.primitiveLength++}}var fd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new Km,this.indexArray=new wn,this.indexArray2=new Io,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.segments2=new ee,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Aa("fill",this.layers,e);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Ar(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let f=Gl("fill",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,h,r,{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Bt(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${t}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Wg),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of Ra(e,500)){let o=cd(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;pd((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};C("FillBucket",fd,{omit:["layers","patternFeatures"]});var wx,Dx=()=>wx||(wx=new Xt({"fill-sort-key":new N(w.layout_fill["fill-sort-key"],"fill-sort-key")})),_x,Ax=()=>_x||(_x=new Xt({"fill-antialias":new V(w.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new N(w.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new V(w.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new N(w.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new N(w.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new V(w.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new V(w.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new on(w.paint_fill["fill-pattern"],"fill-pattern")})),Sx={get paint(){return Ax()},get layout(){return Dx()}};var Ex=class extends de{constructor(t,e){super(t,Sx,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new fd(t)}queryRadius(){return Ha(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:r,pixelsToTileUnits:i}){return Qf(Ka(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},Go=At([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Fx=At([{name:"a_centroid",components:2,type:"Int16"}],4),kx=Go.members;Go.size,Go.alignment;var Fa=class Xo{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new Xo;return r.extend(e(new B(this.minX,this.minY))),r.extend(e(new B(this.maxX,this.minY))),r.extend(e(new B(this.minX,this.maxY))),r.extend(e(new B(this.maxX,this.maxY))),r}static fromPoints(e){let r=new Xo;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},g5=Fa.fromPoints([new B(0,0),new B(mt,mt)]);function Yo(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function rc(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var Dn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new B(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new B(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),no&&(o=n),au&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(c){return[(c.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+a)*2/i)*Math.PI))-90]}function l(c){return c.map(o)}let u;if(this.type===1){let c=[];for(let f of s)c.push(f[0]);let p=l(c);u=c.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}}else if(this.type===3){let c=dd(s),p=[];for(let f of c)p.push(f.map(l));u=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw Error("unknown feature type");let h={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};Dn.types=["Unknown","Point","LineString","Polygon"];function dd(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Dn(this._pbf,e,this.extent,this._keys,this._values)}};function Cx(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ui(F1(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return yd*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof Ui)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ui(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e)return new Ui(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}},md=2*Math.PI*yd;function gd(t){return md*Math.cos(t*Math.PI/180)}function Mx(t){return(180+t)/360}function Bx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Px(t,e){return t/gd(e)}function zx(t){return t*360-180}function Wo(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Lx(t,e){return t*gd(Wo(e))}function Vx(t){return 1/Math.cos(t*Math.PI/180)}var Yl=class xd{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=ic.convert(e);return new xd(Mx(i.lng),Bx(i.lat),Px(r,i.lat))}toLngLat(){return new ic(zx(this.x),Wo(this.y))}toAltitude(){return Lx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/md*Vx(Wo(this.y))}};function Ox(t,e,r){let i=1/(1<Nx(n,i))}function $x(t,e){let r=Rx(mt/2,mt/2,e),i=Yl.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function qx(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let h=.2,c=Math.min(n,o*h,l*h),p=r.add(a.mult(c)),f=r.add(s.mult(c)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(c/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var js=8192;function Mi(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*js)*2+s,n*js*2,a*js*2,Math.round(o))}var vd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Jm,this.centroidVertexArray=new Zm,this.indexArray=new wn,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=Aa("fill-extrusion",this.layers,e);let i=new st(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),s=n._featureFilter.needGeometry;for(let{feature:o,id:l,index:u,sourceLayerIndex:h}of t){let c=hi(o,s);if(!n._featureFilter.filter(i,c,r))continue;let p=s?c.geometry:Ar(o),f={id:l,sourceLayerIndex:h,index:u,geometry:a>0?nc(p,a,r):p,properties:o.properties,type:o.type,patterns:{}};this.hasDependencies?this.features.push(Gl("fill-extrusion",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,u,r,{},e.subdivisionGranularity),e.featureIndex.insert(o,f.geometry,u,h,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,kx),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Fx.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){let s=this.layers[0],o=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0,l=o>0?nc(e,o,i):e;for(let u of Ra(l,500)){let h={x:0,y:0,sampleCount:0},c=this.layoutVertexArray.length;this.processPolygon(h,i,t,u,a);let p=this.layoutVertexArray.length-c,f=Math.floor(h.x/h.sampleCount),d=Math.floor(h.y/h.sampleCount);for(let y=0;y{Mi(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0;for(let i=1;iee.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=n.sub(a)._perp()._unit(),o=a.dist(n);r+o>32768&&(r=0),Mi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,0,r),Mi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,1,r),r+=o,Mi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,r),Mi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,r);let l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function jx(t,e){for(let r=0;rGx||(Gx=new Xt({"fill-extrusion-rounded-corner-distance":new V(w["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})),Yx,Wx=()=>Yx||(Yx=new Xt({"fill-extrusion-opacity":new V(w["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new N(w["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new V(w["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new V(w["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new on(w["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new N(w["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new N(w["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new V(w["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})),Zx={get paint(){return Wx()},get layout(){return Xx()}};var Hx=class extends de{constructor(t,e){super(t,Zx,e)}createBucket(t){return new vd(t)}queryRadius(){return Ha(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=Ka(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(e,r),u=this.paint.get("fill-extrusion-base").evaluate(e,r),h=Qx(o,s,0),c=Jx(i,u,l,s),p=c[0],f=c[1];return Kx(p,f,h)}};function Bi(t,e){return t.x*e.x+t.y*e.y}function ac(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r>1),s=r-e,o,l=t[e],u=t[e+1],h=t[r],c=t[r+1];for(let p=e+3;pn){o=p,n=f;continue}if(f===n){let d=Math.abs(p-a);di&&(o-e>3&&Zo(t,e,o,i),t[o+2]=n,r-o>3&&Zo(t,o,r,i))}function t2(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function Mt(t,e,r,i){let n={type:e,geom:r},a={id:t!=null?t:null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case"Point":case"MultiPoint":Pi(a,n.geom);break;case"LineString":Pi(a,n.geom.points);break;case"Polygon":Pi(a,n.geom[0].points);break;case"MultiLineString":for(let s of n.geom)Pi(a,s.points);break;case"MultiPolygon":for(let s of n.geom)Pi(a,s[0].points)}return a}function Wl(t){let e=t;t.points.length>64&&(e.points=new Float64Array(t.points))}function Pi(t,e){for(let r=0;r1024)throw Error("GeometryCollection nesting exceeds supported depth: 1024");if(e.geometry.type==="GeometryCollection"){r2(t,e,e.geometry,r,i,n+1);return}if(!((o=e.geometry.coordinates)!=null&&o.length))return;let a=e2(e,r,i),s=(r.tolerance/((1<0&&(s+=i?(n*h-u*a)/2:Math.sqrt((u-n)**2+(h-a)**2)),n=u,a=h}let o=e.points.length-3;e.points[2]=1,r>0&&Zo(e.points,0,o,r),e.points[o+2]=1,Wl(e),e.size=Math.abs(s),e.start=0,e.end=e.size}function Kl(t,e,r,i){for(let n=0;n1?1:r}function u2(t){return{type:"FeatureCollection",features:t.map(e=>ka(e))}}function ka(t){let e={type:"Feature",geometry:h2(t),properties:t.tags};return t.id!=null&&(e.id=t.id),e}function h2(t){let{type:e,geometry:r}=t;switch(e){case"Point":return{type:e,coordinates:bd(r[0],r[1])};case"MultiPoint":return{type:e,coordinates:Kn(r)};case"LineString":return{type:e,coordinates:Kn(r.points)};case"MultiLineString":case"Polygon":return{type:e,coordinates:r.map(i=>Kn(i.points))};case"MultiPolygon":return{type:e,coordinates:r.map(i=>i.map(n=>Kn(n.points)))}}}function Kn(t){let e=[];for(let r=0;r=r&&s=i)return null;let l=[];for(let u of t){let h=n===0?u.minX:u.minY,c=n===0?u.maxX:u.maxY;if(h>=r&&c=i))switch(u.type){case"Point":case"MultiPoint":c2(u,l,r,i,n);continue;case"LineString":p2(u,l,r,i,n,o);continue;case"MultiLineString":f2(u,l,r,i,n);continue;case"Polygon":d2(u,l,r,i,n);continue;case"MultiPolygon":y2(u,l,r,i,n);continue}}return l.length?l:null}function c2(t,e,r,i,n){let a=[];if(m2(t.geometry,a,r,i,n),!a.length)return;let s=a.length===3?"Point":"MultiPoint";e.push(Mt(t.id,s,a,t.tags))}function p2(t,e,r,i,n,a){let s=[];if(_d(t.geometry,s,r,i,n,!1,a.lineMetrics),s.length){if(a.lineMetrics){for(let o of s)e.push(Mt(t.id,"LineString",o,t.tags));return}if(s.length>1){e.push(Mt(t.id,"MultiLineString",s,t.tags));return}e.push(Mt(t.id,"LineString",s[0],t.tags))}}function f2(t,e,r,i,n){let a=[];if(Jl(t.geometry,a,r,i,n,!1),a.length){if(a.length===1){e.push(Mt(t.id,"LineString",a[0],t.tags));return}e.push(Mt(t.id,"MultiLineString",a,t.tags))}}function d2(t,e,r,i,n){let a=[];Jl(t.geometry,a,r,i,n,!0),a.length&&e.push(Mt(t.id,"Polygon",a,t.tags))}function y2(t,e,r,i,n){let a=[];for(let s of t.geometry){let o=[];Jl(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&e.push(Mt(t.id,"MultiPolygon",a,t.tags))}function m2(t,e,r,i,n){for(let a=0;a=r&&s<=i&&Kr(e,t[a],t[a+1],t[a+2])}}function _d(t,e,r,i,n,a,s){let o=sc(t),l=n===0?g2:x2,u=t.start,h,c;for(let g=0;gr&&(c=l(o,x,v,D,A,r),s&&(o.start=u+h*c)):_>i?S=r&&(c=l(o,x,v,D,A,r),k=!0),S>i&&_<=i&&(c=l(o,x,v,D,A,i),k=!0),!a&&k&&(s&&(o.end=u+h*c),e.push(o),o=sc(t)),s&&(u+=h)}let p=t.points.length-3,f=t.points[p],d=t.points[p+1],y=t.points[p+2],m=n===0?f:d;m>=r&&m<=i&&Kr(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&Kr(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Wl(o),e.push(o))}function sc(t){return{points:[],size:t.size,start:t.start,end:t.end}}function Jl(t,e,r,i,n,a){for(let s of t)_d(s,e,r,i,n,a,!1)}function Kr(t,e,r,i){t.push(e,r,i)}function g2(t,e,r,i,n,a){let s=(a-e)/(i-e);return Kr(t.points,a,r+(n-r)*s,1),s}function x2(t,e,r,i,n,a){let s=(a-r)/(n-r);return Kr(t.points,e+(i-e)*s,a,1),s}function Ql(t,e){let r=e.buffer/e.extent,i=t,n=Te(t,1,-1-r,r,0,-1,2,e),a=Te(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=Te(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=oc(n,1).concat(i)),a&&(i=i.concat(oc(a,-1)))),i}function oc(t,e){let r=[];for(let i of t)switch(i.type){case"Point":case"MultiPoint":{let n=v2(i.geometry,e);r.push(Mt(i.id,i.type,n,i.tags));continue}case"LineString":{let n=Gs(i.geometry,e);r.push(Mt(i.id,i.type,n,i.tags));continue}case"MultiLineString":case"Polygon":{let n=[];for(let a of i.geometry)n.push(Gs(a,e));r.push(Mt(i.id,i.type,n,i.tags));continue}case"MultiPolygon":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push(Gs(o,e));n.push(s)}r.push(Mt(i.id,i.type,n,i.tags));continue}}return r}function v2(t,e){let r=[];for(let i=0;io.id));t=t.filter(o=>!s.has(o.id))}if(i.add.size){let s=Zl({type:"FeatureCollection",features:Array.from(i.add.values())},r);s=Ql(s,r),n=n.concat(s),t=t.concat(s)}}if(i.update.size){let a=new Map,s=[];for(let o of t)i.update.has(o.id)?a.set(o.id,[...a.get(o.id)||[],o]):s.push(o);for(let[o,l]of i.update){let u=a.get(o);if(!u||u.length===0)continue;let h=w2(u,l,r);n=n.concat(u,h),s=s.concat(h)}t=s}return{affected:n,source:t}}function w2(t,e,r){var a,s;let i=!!e.newGeometry,n=e.removeAllProperties||((a=e.removeProperties)==null?void 0:a.length)>0||((s=e.addOrUpdateProperties)==null?void 0:s.length)>0;if(i){let o=t[0],l=Zl({type:"FeatureCollection",features:[{type:"Feature",id:o.id,geometry:e.newGeometry,properties:n?lc(o.tags,e):o.tags}]},r);return l=Ql(l,r),l}if(n){let o=[];for(let l of t){let u=je({},l);u.tags=lc(u.tags,e),o.push(u)}return o}return t}function lc(t,e){if(e.removeAllProperties)return{};let r=je({},t||{});if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function D2(t,e){var r,i;return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map((r=t.add)==null?void 0:r.map(n=>[e.promoteId?n.properties[e.promoteId]:n.id,n])),update:new Map((i=t.update)==null?void 0:i.map(n=>[n.id,n]))}:{remove:new Set,add:new Map,update:new Map}}var uc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],dt=new Uint32Array(96),_2=class Ad{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=uc[i&15];if(!a)throw Error("Unrecognized array type.");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Ad(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=uc.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let h=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(h,8,e),this.coords=new i(h,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=r,new Uint32Array(h,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Ho(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=[];for(;l>0;){let h=dt[--l],c=dt[--l],p=dt[--l];if(c-p<=o){for(let m=p;m<=c;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+c>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(h===0?e<=d:r<=y)&&(dt[l++]=p,dt[l++]=f-1,dt[l++]=1-h),(h===0?i>=d:n>=y)&&(dt[l++]=f+1,dt[l++]=c,dt[l++]=1-h)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=0,h=i*i;for(;l>0;){let c=dt[--l],p=dt[--l],f=dt[--l];if(p-f<=o){for(let g=f;g<=p;g++)hc(s[2*g],s[2*g+1],e,r)<=h&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];hc(y,m,e,r)<=h&&(n[u++]=a[d]),(c===0?e-i<=y:r-i<=m)&&(dt[l++]=f,dt[l++]=d-1,dt[l++]=1-c),(c===0?e+i>=y:r+i>=m)&&(dt[l++]=d+1,dt[l++]=p,dt[l++]=1-c)}return u}};function Ho(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Sd(t,e,s,i,n,a),Ho(t,e,r,i,s-1,1-a),Ho(t,e,r,s+1,n,1-a)}function Sd(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,h=r-i+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);Sd(t,e,r,Math.max(i,Math.floor(r-h*p/u+f)),Math.min(n,Math.floor(r+(u-h)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(zi(t,e,i,r),e[2*n+a]>s&&zi(t,e,i,n);os;)l--}e[2*i+a]===s?zi(t,e,i,l):(l++,zi(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function zi(t,e,r,i){Xs(t,r,i),Xs(e,2*r,2*i),Xs(e,2*r+1,2*i+1)}function Xs(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function hc(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var Ko={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},A2=class{constructor(t){this.options=Object.assign(Object.create(Ko),t),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,[a,s]=[Zr(i),Hr(n)],o={id:r.id,type:"Point",geometry:[a,s],tags:r.properties};e.push(o)}this.createIndex(e)}initialize(t){let e=[];for(let r of t)r.type==="Point"&&e.push(r);this.createIndex(e)}updateIndex(t,e,r){this.options=Object.assign(Object.create(Ko),r.clusterOptions),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;e&&console.time("total time");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=[];for(let o=0;o=r;o--){let l=Date.now();s=this.trees[o]=this.createTree(this.cluster(s,o)),e&&console.log("z%d: %d clusters in %dms",o,s.numItems,Date.now()-l)}e&&console.timeEnd("total time")}getClusters(t,e){return this.getClustersInternal(t,e).map(r=>ka(r))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let h=this.getClustersInternal([r,i,180,a],e),c=this.getClustersInternal([-180,i,n,a],e);return h.concat(c)}let s=this.trees[this.limitZoom(e)],o=s.range(Zr(r),Hr(a),Zr(n),Hr(i)),l=s.flatData,u=[];for(let h of o){let c=this.stride*h;u.push(l[c+5]>1?S2(l,c,this.clusterProps):this.points[l[c+3]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error("No cluster with the specified id: "+t),n=this.trees[r];if(!n)throw i;let a=n.flatData;if(e*this.stride>=a.length)throw i;let s=this.options.radius/(this.options.extent*2**(r-1)),o=a[e*this.stride],l=a[e*this.stride+1],u=n.within(o,l,s),h=[];for(let c of u){let p=c*this.stride;a[p+4]===t&&h.push(a[p+5]>1?E2(a,p,this.clusterProps):ka(this.points[a[p+3]]))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t,{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,h={transformed:!0,features:[],source:null,x:e,y:r,z:t};return this.addTileFeatures(i.range((e-o)/n,l,(e+1+o)/n,u),i.flatData,e,r,n,h),e===0&&this.addTileFeatures(i.range(1-o/n,l,1,u),i.flatData,n,r,n,h),e===n-1&&this.addTileFeatures(i.range(0,l,o/n,u),i.flatData,-1,r,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o!=null&&o.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n1,u,h,c;if(l)u=tu(e,o,this.clusterProps),h=e[o],c=e[o+1];else{let d=this.points[e[o+3]];u=d.tags,[h,c]=d.geometry}let p={type:1,geometry:[[Math.round(this.options.extent*(h*n-r)),Math.round(this.options.extent*(c*n-i))]],tags:u},f;f=l||this.options.generateId?e[o+3]:this.points[e[o+3]].id,f!==void 0&&(p.id=f),a.features.push(p)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*2**e),o=t.flatData,l=[],u=this.stride;for(let h=0;he&&(y+=o[g+5])}if(y>d&&y>=a){let m=c*d,g=p*d,x,v=-1,b=((h/u|0)<<5)+(e+1)+this.points.length;for(let D of f){let A=D*u;if(o[A+2]<=e)continue;o[A+2]=e;let _=o[A+5];m+=o[A]*_,g+=o[A+1]*_,o[A+4]=b,n&&(x||(x=this.map(o,h,!0),v=this.clusterProps.length,this.clusterProps.push(x)),n(x,this.map(o,A)))}o[h+4]=b,l.push(m/y,g/y,1/0,b,-1,y),n&&l.push(v)}else{for(let m=0;m1)for(let m of f){let g=m*u;if(!(o[g+2]<=e)){o[g+2]=e;for(let x=0;x>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+5]>1){let a=this.clusterProps[t[e+6]];return r?Object.assign({},a):a}let i=this.points[t[e+3]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function S2(t,e,r){return{id:t[e+3],type:"Point",tags:tu(t,e,r),geometry:[t[e],t[e+1]]}}function E2(t,e,r){return{type:"Feature",id:t[e+3],properties:tu(t,e,r),geometry:{type:"Point",coordinates:[wd(t[e]),Dd(t[e+1])]}}}function tu(t,e,r){let i=t[e+5],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+6],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+3],point_count:i,point_count_abbreviated:n})}var Ed="geojsonvt_clip_start",Fd="geojsonvt_clip_end";function cc(t,e,r,i,n){let a=e===n.maxZoom?0:n.tolerance/((1<0&&e.size<(n?s:i)){r.numPoints+=e.points.length/3;return}let o=[];for(let l=0;ls)&&(r.numSimplified++,o.push(e.points[l],e.points[l+1])),r.numPoints++;n&&M2(o,a),t.push(o)}function M2(t,e){let r=0;for(let i=0,n=t.length,a=n-2;i0===e)for(let i=0,n=t.length;i1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(e),r.debug>1&&console.timeEnd("invalidating");let[i,n,a]=[0,0,0],s=cc(t,i,n,a,r);s.source=t;let o=Jn(i,n,a);if(this.tiles[o]=s,this.tileCoords.push({z:i,x:n,y:a,id:o}),r.debug){let l=`z${i}`;this.stats[l]=(this.stats[l]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{extent:i,debug:n}=this.options,a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);let o=t,l=e,u=r,h;for(;!h&&o>0;)o--,l>>=1,u>>=1,h=this.tiles[Jn(o,l,u)];return!(h!=null&&h.source)||(n>1&&(console.log("found parent tile z%d-%d-%d",o,l,u),console.time("drilling down")),this.splitTile(h.source,o,l,u,t,e,r),n>1&&console.timeEnd("drilling down"),!this.tiles[s])?null:pc(this.tiles[s],i)}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let h=1<1&&console.time("creation"),p=this.tiles[c]=cc(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:c}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let _=`z${e}`;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let _=n-e;if(r!==a>>_||i!==s>>_)continue}}if(p.source=null,!t.length)continue;u>1&&console.time("clipping");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,D=Te(t,h,r-f,r+y,0,p.minX,p.maxX,l),A=Te(t,h,r+d,r+m,0,p.minX,p.maxX,l);D&&(g=Te(D,h,i-f,i+y,1,p.minY,p.maxY,l),x=Te(D,h,i+d,i+m,1,p.minY,p.maxY,l)),A&&(v=Te(A,h,i-f,i+y,1,p.minY,p.maxY,l),b=Te(A,h,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd("clipping"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(v||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let h=this.tiles[u],c=1<=f||s=y)continue;let m=!1;for(let g of t)if(g.maxX>=p&&g.minX=d&&g.minY1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",h.z,h.x,h.y,h.numFeatures,h.numPoints,h.numSimplified);let g=`z${h.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function Jn(t,e,r){return((1<24)throw Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw Error("promoteId and generateId cannot be used together.");let i=Zl(t,e);r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),i=Ql(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new A2(e.clusterOptions):new z2(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:i,source:n}=b2(this.source,t,r);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(ka(n))||(e.push(n),i.add(n.id)));return t=t.filter(n=>!i.has(n.id)),{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error("to retrieve data the `updateable` option must be set to true");return u2(this.source)}updateClusterOptions(t,e){let r=this.options.cluster;if(this.options.cluster=t,this.options.clusterOptions=e,r==t){this.tileIndex.updateIndex(this.source,[],this.options);return}this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},Jo=At([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),V2=Jo.members;Jo.size,Jo.alignment;var Qo=At([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),O2=Qo.members;Qo.size,Qo.alignment;var R2=Math.cos(75/2*(Math.PI/180)),Id=1/2,fc=2**14/Id,Cd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new Qm,this.layoutVertexArray2=new tg,this.indexArray=new wn,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Aa("line",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Ar(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(Aa("line",this.layers,e)?Gl("line",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,h,r,{},{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,O2)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,V2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,"geojsonvt_clip_start")&&Object.hasOwn(t.properties,"geojsonvt_clip_end"))return{start:+t.properties[Ed],end:+t.properties[Fd]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(t,{}),u=o.get("line-cap").evaluate(t,{}),h=o.get("line-miter-limit").evaluate(t,{}),c=o.get("line-round-limit").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e)this.addLine(p,t,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=cr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v=2&&t[h-1].equals(t[h-2]);)h--;let c=0;for(;c0;if(k&&v>c){let L=d.dist(y);if(L>2*p){let F=d.sub(d.sub(y)._mult(p/L)._round());this.updateDistance(y,F),this.addCurrentVertex(F,g,0,0,f),y=F}}let O=y&&m,P=O?r:u?"butt":i;if(O&&P==="round"&&(_n&&(P="bevel"),P==="bevel"&&(_>2&&(P="flipbevel"),_100)b=x.mult(-1);else{let L=_*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(L*(z?-1:1))}this.addCurrentVertex(d,b,0,0,f),this.addCurrentVertex(d,b.mult(-1),0,0,f)}else if(P==="bevel"||P==="fakeround"){let L=-Math.sqrt(_*_-1),F=z?L:0,$=z?0:L;if(y&&this.addCurrentVertex(d,g,F,$,f),P==="fakeround"){let U=Math.round(S*180/Math.PI/20);for(let T=1;T2*p){let F=d.add(m.sub(d)._mult(p/L)._round());this.updateDistance(d,F),this.addCurrentVertex(F,x,0,0,f),d=F}}}}addCurrentVertex(t,e,r,i,n,a=!1){let s=e.x+e.y*r,o=e.y-e.x*r,l=-e.x+e.y*i,u=-e.y-e.x*i;this.addHalfVertex(t,s,o,a,!1,r,n),this.addHalfVertex(t,l,u,a,!0,-i,n),this.distance>fc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a))}addHalfVertex({x:t,y:e},r,i,n,a,s,o){let l=(this.lineClips?this.scaledDistance*(fc-1):this.scaledDistance)*Id;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!n,(e<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*i)+128,(s===0?0:s<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let r=e.paint.get("line-dasharray");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get("line-dasharray");if(!a||a.value.kind==="constant")continue;let s=n.layout.get("line-cap").evaluate(e,{})==="round",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},h=`${o.dasharray.join(",")},${o.round}`,c=`${l.dasharray.join(",")},${l.round}`,p=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[h]=o,i.dashDependencies[c]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:h,mid:c,max:p}}}};C("LineBucket",Cd,{omit:["layers","patternFeatures"]});var $2,N2=()=>$2||($2=new Xt({"line-cap":new N(w.layout_line["line-cap"],"line-cap"),"line-join":new N(w.layout_line["line-join"],"line-join"),"line-miter-limit":new N(w.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new N(w.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new N(w.layout_line["line-sort-key"],"line-sort-key")})),U2,q2=()=>U2||(U2=new Xt({"line-opacity":new N(w.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new V(w.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new N(w.paint_line["line-color"],"line-color"),"line-translate":new V(w.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new V(w.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new N(w.paint_line["line-width"],"line-width"),"line-gap-width":new N(w.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new N(w.paint_line["line-offset"],"line-offset"),"line-blur":new N(w.paint_line["line-blur"],"line-blur"),"line-dasharray":new on(w.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new on(w.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Wa(w.paint_line["line-gradient"],"line-gradient")})),dc={get paint(){return q2()},get layout(){return N2()}},j2=class extends N{possiblyEvaluate(t,e){return e=new st(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=Gt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,i)}},Qn;var G2=class extends de{constructor(t,e){super(t,dc,e),this.gradientVersion=0,Qn||(Qn=new j2(dc.paint.properties["line-width"].specification,"line-floorwidth"),Qn.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let e=this.gradientExpression();this.stepInterpolant=lm(e)?e._styleExpression.expression instanceof vl:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Qn.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Cd(t)}queryRadius(t){let e=t,r=yc(Wr("line-width",this,e),Wr("line-gap-width",this,e)),i=Wr("line-offset",this,e);return r/2+Math.abs(i)+Ha(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=Ka(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),o=a/2*yc(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(i=Dg(i,l*a)),mg(s,i,o)}isTileClipped(){return!0}};function yc(t,e){return e>0?e+2*t:t}var X2=At([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),Y2=At([{name:"a_projected_pos",components:3,type:"Float32"}],4);At([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var W2=At([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);At([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var mc=At([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),x5=At([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);At([{name:"triangle",components:3,type:"Uint16"}]),At([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),At([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),At([{type:"Float32",name:"offsetX"}]),At([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),At([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wr=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(wr.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,e){return rt(this,null,function*(){if(this.isParsed())return this.getState();if(t.pluginStatus!=="loading")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(yield e(r),yield Promise.race([i,n]),this.isParsed()){let a={pluginStatus:"loaded",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)})}};function Z2(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function H2(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function K2(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function Qa(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function J2(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function Q2(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function gc(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function tv(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||new RegExp("^\\\\p{gc=Mc}","u").test(e)}var ev={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},rv={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},iv={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},xc=1604,nv=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function av(t,e,r){let i=0;for(let n of t.split(";")){let[a,s]=n.split(",").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l{let r=e.codePointAt(0);return{codePoint:r,type:sv(r),form:null}})}function cv(t){let e=t.filter(r=>r.type!=="T");for(let r=0;r0&&ov(e[r-1].type),a=r+1String.fromCodePoint(dv(r))).join("")}function mv(t,e,r){var n;let i=e.layout.get("text-transform").evaluate(r,{});return i==="uppercase"?t=t.toLocaleUpperCase():i==="lowercase"&&(t=t.toLocaleLowerCase()),((n=wr.applyArabicShaping)!=null?n:yv)(t)}function gv(t,e,r){for(let i of t.sections)i.text=mv(i.text,e,r);return t}function xv(t){let e={},r={},i=[],n=0;function a(u){i.push(t[u]),n++}function s(u,h,c){let p=r[u];return delete r[u],r[h]=p,i[p].geometry[0].pop(),i[p].geometry[0]=i[p].geometry[0].concat(c[0]),p}function o(u,h,c){let p=e[h];return delete e[h],e[u]=p,i[p].geometry[0].shift(),i[p].geometry[0]=c[0].concat(i[p].geometry[0]),p}function l(u,h,c){let p=c?h[0][h[0].length-1]:h[0][0];return`${u}:${p.x}:${p.y}`}for(let u=0;uu.geometry)}var Bd=typeof Intl<"u"&&"Segmenter"in Intl,ta,ea;function tl(t){if(!Bd||!Q2(t))return[...t];ta!=null||(ta=new Intl.Segmenter(void 0,{granularity:"grapheme"}));let e=[];for(let{segment:r}of ta.segment(t)){let i=e.length-1;i>=0&&tv(e[i],r)?e[i]+=r:e.push(r)}return e}function vv(t){let e=new Set;if(Bd){ea!=null||(ea=new Intl.Segmenter(void 0,{granularity:"word"}));for(let{index:i}of ea.segment(t))e.add(i);return e}let r=0;for(let i of t.split(new RegExp("\\\\b|(?=\\\\p{Ideo})","u")))e.add(r),r+=i.length;return e}function Pd(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function ru(t){return/\\s/u.test(String.fromCodePoint(t))}function el(t){for(let e of t)if(Qa(e.codePointAt(0)))return!0;return!1}function bv(t){for(let e of t)if(!wv(e.codePointAt(0)))return!1;return!0}function wv(t){return!Z2(t)}function vc(t){return!(Qa(t)||J2(t))}function zd(t){return new RegExp("\\\\p{sc=Arab}","u").test(String.fromCodePoint(t))}function Ld(t){return H2(t)}function Vd(t){for(let e of t)if(Ld(e.codePointAt(0)))return!0;return!1}var Gr={"!":"\\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","\\u22EF":"\\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"};function Dv(t){let e="",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!vc(s.value.codePointAt(0))||Gr[s.value])&&(r.premature||!vc(r.value.codePointAt(0))||Gr[r.value])&&Gr[n.value]?e+=Gr[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var _v={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Av={40:!0};function bc(t,e,r,i,n,a){if("fontStack"in e){let s=r[e.fontStack],o=s==null?void 0:s[t];if(o)return o.metrics.advance*e.scale+n;let l=0;for(let u of t){let h=s==null?void 0:s[u];h&&(l+=h.metrics.advance*e.scale+n)}return l}{let s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}}function wc(t,e,r,i){let n=(t-e)**2;return i?tr&&Dc(e[i-1]);)i--;this.text=e.slice(r,i).join(""),this.sectionIndex=this.sectionIndex.slice(r,i),this._graphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(""),n=this.sectionIndex.slice(e,r);return new rl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n0?i[i.length-1]:"",a=tl(n+e);this.text+=e,this._graphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=[],o=this.determineAverageLineWidth(e,r,i,n,a),l=this.hasZeroWidthSpaces(),u=this.graphemes(),h=null,c=0,p=0;for(let f=0;f0){let y=u[f-1].codePointAt(0),m=d.codePointAt(0),g=K2(y),x=gc(y)&&gc(m);(_v[y]||g||"imageName"in this.getSection(f-1)||u[f+1]!==void 0&&Av[m]||x&&(h!=null?h:h=vv(this.text)).has(p))&&s.push(_c(f,c,o,s,Sv(y,m,g&&l),!1))}ru(d.codePointAt(0))||(c+=bc(d,this.getSection(f),i,n,e,a)),p+=d.length}return Od(_c(this.length(),c,o,s,0,!0))}determineAverageLineWidth(e,r,i,n,a){let s=0,o=0;for(let u of this.graphemes()){let h=this.getSection(o);s+=bc(u,h,i,n,e,a),o++}let l=Math.max(1,Math.ceil(s/r));return s/l}};function Ev(){return(function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},i={};r.L=1,i[1]="L",Object.keys(e).forEach(function(R,J){r[R]=1<1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function d(R,J){var W=0,M=new Map,ut=J&&new Map,X;return R.split(",").forEach(function G(K){if(K.indexOf("+")!==-1)for(var Nt=+K;Nt--;)G(X);else{X=K;var vt=K.split(">"),nt=vt[0],Tt=vt[1];nt=String.fromCodePoint(W+=parseInt(nt,36)),Tt=String.fromCodePoint(W+=parseInt(Tt,36)),M.set(nt,Tt),J&&ut.set(Tt,nt)}}),{map:M,reverseMap:ut}}var y,m,g;function x(){if(!y){var R=d(f.pairs,!0),J=R.map,W=R.reverseMap;y=J,m=W,g=d(f.canonical,!1).map}}function v(R){return x(),y.get(R)||null}function b(R){return x(),m.get(R)||null}function D(R){return x(),g.get(R)||null}var A=r.L,_=r.R,S=r.EN,k=r.ES,z=r.ET,O=r.AN,P=r.CS,L=r.B,F=r.S,$=r.ON,U=r.BN,T=r.NSM,q=r.AL,at=r.LRO,ot=r.RLO,pt=r.LRE,Et=r.RLE,qt=r.PDF,Ht=r.LRI,Ve=r.RLI,ye=r.FSI,Kt=r.PDI;function Oe(R,J){for(var W=125,M=new Uint32Array(R.length),ut=0;ut0)Fe--;else if(rs>0){for(Ne=0;!lt[lt.length-1]._isolate;)lt.pop();var is=lt[lt.length-1]._isolInitIndex;is!=null&&(Nt.set(is,zt),Nt.set(zt,is)),lt.pop(),rs--}bt=lt[lt.length-1],K[zt]=bt._level,bt._override&&G(zt,bt._override)}else Lt&qt?(Fe===0&&(Ne>0?Ne--:!bt._isolate&<.length>1&&(lt.pop(),bt=lt[lt.length-1])),K[zt]=bt._level):Lt&L&&(K[zt]=nt.level);else K[zt]=bt._level,bt._override&&Lt!==U&&G(zt,bt._override)}for(var Cr=[],me=null,ar=nt.start;ar<=nt.end;ar++){var ns=M[ar];if(!(ns&o)){var Bu=K[ar],Pu=ns&n,Wy=ns===Kt;me&&Bu===me._level?(me._end=ar,me._endsWithIsolInit=Pu):Cr.push(me={_start:ar,_end:ar,_level:Bu,_startsWithPDI:Wy,_endsWithIsolInit:Pu})}}for(var as=[],Sn=0;Sn=0;kn--)if(!(M[kn]&o)){Vu=K[kn];break}var us=Mr[Mr.length-1],Hy=K[us],Ou=nt.level;if(!(M[us]&n)){for(var Tn=us+1;Tn<=nt.end;Tn++)if(!(M[Tn]&o)){Ou=K[Tn];break}}as.push({_seqIndices:Mr,_sosType:Math.max(Vu,Zy)%2?_:A,_eosType:Math.max(Ou,Hy)%2?_:A})}}for(var hs=0;hs=0;Cn--)if(!(M[j[Cn]]&o)){ps=M[j[Cn]];break}G(Ru,ps&(n|Kt)?$:ps)}}if(X.get(S))for(var Mn=0;Mn=-1;Bn--){var Nu=Bn===-1?yi:M[j[Bn]];if(Nu&a){Nu===q&&G($u,O);break}}}if(X.get(q))for(var fs=0;fs=0&&(Pr=M[j[ms]],Pr&o);ms--);for(var gs=mi+1;gs=0&&M[j[Pn]]&(z|o);Pn--)G(j[Pn],S);for(ge++;ge=0&&M[j[zn]]&o;zn--)G(j[zn],$);for(var Ln=gi+1;Ln=0;bi--){var bs=zr[bi].char;if(bs===Yu||bs===b(D(vi))||v(D(bs))===vi){Vn.push([zr[bi].seqIndex,Lr]),zr.length=bi;break}}}Vn.sort(function(Yt,ue){return Yt[0]-ue[0]});for(var ws=0;ws=0;As--){var Ju=j[As];if(M[Ju]&Xu){var Qu=M[Ju]&xi?_:A;xe=Qu===Br?Br:Qu;break}}}if(xe){if(M[j[On]]=M[j[Ds]]=xe,xe!==Br){for(var wi=On+1;wi=0;_i--)if(M[j[_i]]&o)th=_i;else{Es=M[j[_i]]&xi?_:A;break}for(var eh=Ky,Ai=Ue+1;Ai=0&&c(R[$n])&l;$n--)K[$n]=nt.level}}return{levels:K,paragraphs:vt};function rh(Yt,ue){for(var Wt=Yt;Wt=K&&c(R[nt])&l;nt--)vt[nt]=G.level;for(var Tt=G.level,di=1/0,nr=0;nrTt&&(Tt=Re),Re=di;$e--)for(var lt=0;lt=$e){for(var bt=lt;lt+1=$e;)lt++;lt>bt&&X.push([bt+K,lt+K])}}}),X}function Tr(R,J,W,M){var ut=Ir(R,J,W,M),X=[].concat(R);return ut.forEach(function(G,K){X[K]=(J.levels[G]&1?kt(R[G]):null)||R[G]}),X.join("")}function Ir(R,J,W,M){for(var ut=ir(R,J,W,M),X=[],G=0;G=0;i--){let n=nu.getBidiCharTypeName(t[i].text[0]);Tv.has(n)?(t[i].level=e,r=!0):r&&kv.has(n)?t[i].level=e:r=!1}}function Mv(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)=i;a--)for(let s=0;s=a;)o++;for(let l=s,u=o;le>=n.start&&e<=n.end))==null?void 0:r.level)!=null?i:0}function zv(t,e,r,i,n){let a=Iv(t,e,i,n);Cv(a,r);let s="",o=[];for(let l of Mv(a,r)){if(Fv.test(l.text))continue;let u=Bv(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function Lv(t,e){let r=e.filter(a=>a>0&&aa-s),n=[];for(let a=0;a+1n.start))).map(([n,a])=>zv(t,r,Pv(i,n),n,a))}function Vv(t,e){return Rd(t,e).map(r=>r.text)}function Ov(t,e,r){return Rd(t,r).map(i=>[i.text,i.sourceIndices.map(n=>{var a;return(a=e[n])!=null?a:0})])}var il=4294967296,Ac=1/il,Sc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),au=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*il;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*il;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,$v(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Sc?Sc.decode(this.buf.subarray(e,t)):tb(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd();for(;this.pos=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},Rv=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e=0&&t<128){this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t;return}if(t>268435455||t<0){Uv(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=eb(this.buf,t,this.pos);let r=this.pos-e;r>=128&&Ec(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&Ec(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,Gv,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,Xv,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,Zv,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,Yv,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,Wv,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,Hv,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Kv,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,Jv,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,Qv,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function $v(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return Nv(t,n,e);throw Error("Expected varint not more than 10 bytes")}function Nv(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Uv(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),qv(r,i,e),jv(i,e)}function qv(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function jv(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Ec(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function Gv(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;sa){e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;continue}for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}e.pos=n}function Xv(t,e){for(let r=0;r239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function eb(t,e,r){for(let i=0,n,a;i55295&&n<57344)if(a){if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}else a&&(a=(t[r++]=239,t[r++]=191,t[r++]=189,null));n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=n&63|128)}return r}function rb(t){return typeof(t==null?void 0:t.renderWithWebGL)=="function"}function su(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o=r;a--)e.push(a);r=i+1}else{for(let a=r;at.toCodeUnitIndex(a)),i=wr.isParsed()?wr:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>kc(a,t.sections,[...a].map(()=>0))):Vv(t.toString(),r).map(a=>nl([...a],t.sections,[...a].map(()=>0)));let n=sb(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>kc(a,t.sections,s)):Ov(t.text,n,r).map(([a,s])=>{let o=[...a];return nl(o,t.sections,Ud(o).map(l=>{var u;return(u=s[l])!=null?u:0}))})}function nl(t,e,r){var a;let i=new iu(t.join(""),e,[]),n=0;for(let s of i.graphemes())i.sectionIndex.push((a=r[n])!=null?a:0),n+=[...s].length;return i}function Ud(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function kc(t,e,r){let i=[...t],n=Ud(i),a=ab(i);return nl(a.map(s=>i[s]),e,a.map(s=>{var o;return(o=r[n[s]])!=null?o:0}))}function ra(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=iu.fromFeature(t,n);c===2&&y.verticalizePunctuation();let m=y.determineLineBreaks(u,a,e,i,f),g=Vd(y.text)?ob(y,m):nb(y,m),x=[],v={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return mb(v,e,r,i,g,s,o,l,c,u,p,d),!ib(x)&&v}function qd(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function lb(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function jd(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}function ub(t,e,r,i){var a;if(t!=null&&t.rect)return t;let n=(a=e[r.fontStack])==null?void 0:a[i];return n?{rect:null,metrics:n.metrics}:null}function hb(t,e,r){return!(t===1||!e&&!Qa(r)||e&&(ru(r)||zd(r)))}function da(t){return new RegExp("\\\\p{Nd}","u").test(String.fromCodePoint(t))}function Gd(t){return new RegExp("\\\\p{Lu}","u").test(String.fromCodePoint(t))}function cb(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function pb(t){let e=t.some(da)&&t.every(i=>da(i)||cb(i)),r=t.length<=3&&t.every(i=>Gd(i)||da(i));return e||r}function fb(t){return(da(t)||Gd(t))&&!zd(t)}function db(t,e){let r=!1;for(let i=0;ia.codePointAt(0)),i=r.map(Qa),n=a=>!i[a]&&!ru(r[a])&&!("imageName"in t.getSection(a));for(let a=0;au){let p=Math.ceil(i/u);r*=p/n,n=p}return{x1:e,y1:r,x2:e+i,y2:r+n}}function Tc(t,e,r,i,n,a){let s=t.image,o;if(s.content){let m=s.content,g=s.pixelRatio||1;o=[m[0]/g,m[1]/g,s.displaySize[0]-m[2]/g,s.displaySize[1]-m[3]/g]}let l=e.left*a,u=e.right*a,h,c,p,f;r==="width"||r==="both"?(f=n[0]+l-i[3],c=n[0]+u+i[1]):(f=n[0]+(l+u-s.displaySize[0])/2,c=f+s.displaySize[0]);let d=e.top*a,y=e.bottom*a;return r==="height"||r==="both"?(h=n[1]+d-i[0],p=n[1]+y+i[2]):(h=n[1]+(d+y-s.displaySize[1])/2,p=h+s.displaySize[1]),{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}var Ic=32640;function Cc(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new st(t+1))};if(r.kind==="source")return{kind:"source"};if(r.kind==="composite"){let{minZoom:i,maxZoom:n}=Db(r.zoomStops,t);return{kind:"composite",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=_b(r),n=r.evaluate(new st(t+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function Db(t,e){let r=0;for(;rt.evaluate(new st(e===-1/0?t.zoomStops[1]-1:e)))}var Jr=class Yd extends B{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new Yd(this.x,this.y,this.angle,this.segment)}};C("Anchor",Jr);function Wd(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;oi;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=c.dist(p)}return!0}function Zd(t){let e=0;for(let r=0;ru){let d=(u-l)/f,y=new Jr(gr.number(c.x,p.x,d),gr.number(c.y,p.y,d),p.angleTo(c),h);return y._round(),!s||Wd(t,y,o,s,e)?y:void 0}l+=f}}function Sb(t,e,r,i,n,a,s,o,l){let u=Hd(i,a,s),h=Kd(i,n),c=h*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-c=0&&b=0&&D=0&&p+u<=h){let A=new Jr(b,D,x,d);A._round(),(!i||Wd(t,A,a,i,n))&&f.push(A)}}c+=g}return!o&&!f.length&&!s&&(f=Jd(t,c/2,r,i,n,a,s,!0,l)),f}function Eb(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l=i&&h.x>=i)&&(u.x>=i?u=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round():h.x>=i&&(h=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round()),!(u.y>=n&&h.y>=n)&&(u.y>=n?u=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y>=n&&(h=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),(!o||!u.equals(o[o.length-1]))&&(o=[u],a.push(o)),o.push(h)))))}}return a}function Qd(t,e,r,i,n,a){let s=Mc(t,e,r,n,0);return s=Mc(s,e,i,a,1),s}function Mc(t,e,r,i,n){switch(e){case 1:return Fb(t,r,i,n);case 2:return Bc(t,r,i,n,!1);case 3:return Bc(t,r,i,n,!0)}return[]}function Fb(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function kb(t,e,r,i,n){let a=i===0?Tb:Ib,s=[],o=[];for(let h=0;he&&s.push(a(c,p,e)):f>r?d=e&&(s.push(a(c,p,e)),y=!0),d>r&&f<=r&&(s.push(a(c,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new B(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function Bc(t,e,r,i,n){let a=[];for(let s of t){let o=kb(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function Tb(t,e,r){let i=(r-t.x)/(e.x-t.x);return new B(r,t.y+(e.y-t.y)*i)}function Ib(t,e,r){let i=(r-t.y)/(e.y-t.y);return new B(t.x+(e.x-t.x)*i,r)}function Pc(t,e,r,i){let n=[],a=t.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(F,$)=>F+$[1]-$[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,v=0,b=d,D=0,A=y,_=0,S=m;if(a.content&&i){let F=a.content,$=F[2]-F[0],U=F[3]-F[1];(a.textFitWidth||a.textFitHeight)&&(u=Xd(t)),g=ia(h,0,F[0]),v=ia(c,0,F[1]),x=ia(h,F[0],F[2]),b=ia(c,F[1],F[3]),D=F[0]-g,_=F[1]-v,A=$-x,S=U-b}let k=u.x1,z=u.y1,O=u.x2-k,P=u.y2-z,L=(F,$,U,T)=>{let q=na(F.stretch-g,x,O,k),at=aa(F.fixed-D,A,F.stretch,f),ot=na($.stretch-v,b,P,z),pt=aa($.fixed-_,S,$.stretch,d),Et=na(U.stretch-g,x,O,k),qt=aa(U.fixed-D,A,U.stretch,f),Ht=na(T.stretch-v,b,P,z),Ve=aa(T.fixed-_,S,T.stretch,d),ye=new B(q,ot),Kt=new B(Et,ot),Oe=new B(Et,Ht),kr=new B(q,Ht),rr=new B(at/s,pt/s),fi=new B(qt/s,Ve/s),kt=e*Math.PI/180;if(kt){let R=Math.sin(kt),J=Math.cos(kt),W=[J,-R,R,J];ye._matMult(W),Kt._matMult(W),kr._matMult(W),Oe._matMult(W)}let Ee=F.stretch+F.fixed,ir=U.stretch+U.fixed,Tr=$.stretch+$.fixed,Ir=T.stretch+T.fixed;return{tl:ye,tr:Kt,bl:kr,br:Oe,tex:{x:a.paddedRect.x+1+Ee,y:a.paddedRect.y+1+Tr,w:ir-Ee,h:Ir-Tr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:rr,pixelOffsetBR:fi,minFontScaleX:A/s/O,minFontScaleY:S/s/P,isSDF:r}};if(!i||!a.stretchX&&!a.stretchY)n.push(L({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));else{let F=zc(h,y,f),$=zc(c,m,d);for(let U=0;U0&&(d=Math.max(10,d),this.circleDiameter=d)}else{let c=(h=a.image)!=null&&h.content&&(a.image.textFitWidth||a.image.textFitHeight)?Xd(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-o[0],c.y2=c.y2*s+o[2],c.x1=c.x1*s-o[3],c.x2=c.x2*s+o[1];let p=a.collisionPadding;if(p&&(c.x1-=p[0]*s,c.y1-=p[1]*s,c.x2+=p[2]*s,c.y2+=p[3]*s),u){let f=new B(c.x1,c.y1),d=new B(c.x2,c.y1),y=new B(c.x1,c.y2),m=new B(c.x2,c.y2),g=u*Math.PI/180;f._rotate(g),d._rotate(g),y._rotate(g),m._rotate(g),c.x1=Math.min(f.x,d.x,y.x,m.x),c.x2=Math.max(f.x,d.x,y.x,m.x),c.y1=Math.min(f.y,d.y,y.y,m.y),c.y2=Math.max(f.y,d.y,y.y,m.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,i,n)}this.boxEndIndex=t.length}},Mb=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}};function Bb(t,e=1){let r=Fa.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new Mb([],Pb),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new B(s,o);for(let p=s;pc.d||!c.d)&&(c=p),!(p.max-c.d<=e)&&(n=p.h/2,a.push(new qr(p.p.x-n,p.p.y-n,n,t)),a.push(new qr(p.p.x+n,p.p.y-n,n,t)),a.push(new qr(p.p.x-n,p.p.y+n,n,t)),a.push(new qr(p.p.x+n,p.p.y+n,n,t)))}return h.d>0&&c.d-h.d<=e?h.p:c.p}function Pb(t,e){return e.max-t.max}var qr=class{constructor(t,e,r,i){this.p=new B(t,e),this.h=r,this.d=zb(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function zb(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;at.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,td(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function Lb(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;ap*24);h.startsWith("top")?c[1]-=7:h.startsWith("bottom")&&(c[1]+=7),l[u+1]=c}return new De(l)}let a=i.get("text-variable-anchor");if(a){let o;o=t._unevaluatedLayout.getValue("text-radial-offset")===void 0?i.get("text-offset").evaluate(e,{},r).map(u=>u*24):[i.get("text-radial-offset").evaluate(e,{},r)*24,lu];let l=[];for(let u of a)l.push(u,ty(u,o));return new De(l)}return null}function Ob(t){var h,c;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=mt/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new st(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new st(p),t.canonical),n["text-size"].possiblyEvaluate(new st(f),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new st(p),t.canonical),n["icon-size"].possiblyEvaluate(new st(f),t.canonical)]}let s=i.get("text-line-height")*24,o=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",l=i.get("text-keep-upright"),u=i.get("text-size");for(let p of t.bucket.features){let f=i.get("text-font").evaluate(p,{},t.canonical).join(","),d=u.evaluate(p,{},t.canonical),y=a.layoutTextSize.evaluate(p,{},t.canonical),m=a.layoutIconSize.evaluate(p,{},t.canonical),g={horizontal:{},vertical:void 0},x=p.text,v=[0,0];if(x){let _=x.toString(),S=i.get("text-letter-spacing").evaluate(p,{},t.canonical)*24,k=bv(_)?S:0,z=i.get("text-anchor").evaluate(p,{},t.canonical),O=ey(r,p,t.canonical);if(!O){let $=i.get("text-radial-offset").evaluate(p,{},t.canonical);v=$?ty(z,[$*24,lu]):i.get("text-offset").evaluate(p,{},t.canonical).map(U=>U*24)}let P=o?"center":i.get("text-justify").evaluate(p,{},t.canonical),L=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(p,{},t.canonical)*24:1/0,F=()=>{t.bucket.allowVerticalPlacement&&el(_)&&(g.vertical=ra(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,L,s,z,"left",k,v,2,!0,y,d))};if(!o&&O){let $=new Set;if(P==="auto")for(let T=0;T{T.x<0||T.x>=8192||T.y<0||T.y>=8192||Nb(t,T,U,r,i,n,L,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,[D,D,D,D],S,l,v,A,k,d,e,a,u,h,s)};if(z==="line")for(let U of Eb(e.geometry,0,0,mt,mt)){let T=cr(U,F),q=Sb(T,b,_,r.vertical||y,i,24,x,t.overscaling,mt);for(let at of q){let ot=y;(!ot||!Ub(t,ot.text,O,at))&&$(T,at)}}else if(z==="line-center"){for(let U of e.geometry)if(U.length>1){let T=cr(U,F),q=Ab(T,_,r.vertical||y,i,24,x);q&&$(T,q)}}else if(e.type==="Polygon")for(let U of Ra(e.geometry,0)){let T=Bb(U,16);$(cr(U[0],F,!0),new Jr(T.x,T.y,0))}else if(e.type==="LineString")for(let U of e.geometry){let T=cr(U,F);$(T,new Jr(T[0].x,T[0].y,0))}else if(e.type==="Point")for(let U of e.geometry)for(let T of U)$([T],new Jr(T.x,T.y,0))}function $b(t,e){let r=t.length,i=e==null?void 0:e.values;if((i==null?void 0:i.length)>0)for(let n=0;n32640&&Bt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):g.kind==="composite"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Bt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,m,x,o,a,s,h,e,u.lineStartIndex,u.lineLength,f,y,l);for(let v of c)p[v]=t.text.placedSymbolArray.length-1;return m.length*4}function ry(t){for(let e in t)return t[e];return null}function Nb(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S){let k=t.addToLineVertexArray(e,r),z=o.layout.get("symbol-height-offset").evaluate(b,{},_);z>t.maxHeightOffset&&(t.maxHeightOffset=z);let O,P,L,F,$=0,U=0,T=0,q=0,at=-1,ot=-1,pt={},Et=(0,Mo.default)("");if(t.allowVerticalPlacement&&i.vertical){let J=o.layout.get("text-rotate").evaluate(b,{},_)+90,W=i.vertical;L=new sa(l,e,u,h,c,W,p,f,d,J),s&&(F=new sa(l,e,u,h,c,s,m,g,d,J))}if(n){let J=o.layout.get("icon-rotate").evaluate(b,{}),W=o.layout.get("icon-text-fit")!=="none",M=Pc(n,J,A,W),ut=s?Pc(s,J,A,W):void 0;P=new sa(l,e,u,h,c,n,m,g,!1,J),$=M.length*4;let X=t.iconSizeData,G=null;X.kind==="source"?(G=[128*o.layout.get("icon-size").evaluate(b,{})],G[0]>32640&&Bt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):X.kind==="composite"&&(G=[128*D.compositeIconSizes[0].evaluate(b,{},_),128*D.compositeIconSizes[1].evaluate(b,{},_)],(G[0]>32640||G[1]>32640)&&Bt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,M,G,v,x,b,0,e,k.lineStartIndex,k.lineLength,-1,_,z),at=t.icon.placedSymbolArray.length-1,ut&&(U=ut.length*4,t.addSymbols(t.icon,ut,G,v,x,b,2,e,k.lineStartIndex,k.lineLength,-1,_,z),ot=t.icon.placedSymbolArray.length-1)}let qt=Object.keys(i.horizontal);for(let J of qt){let W=i.horizontal[J];O||(O=(Et=(0,Mo.default)(W.text),new sa(l,e,u,h,c,W,p,f,d,o.layout.get("text-rotate").evaluate(b,{},_))));let M=W.positionedLines.length===1;if(T+=Vc(t,e,W,a,o,d,b,y,z,k,i.vertical?1:3,M?qt:[J],pt,at,D,_),M)break}i.vertical&&(q+=Vc(t,e,i.vertical,a,o,d,b,y,z,k,2,["vertical"],pt,ot,D,_));let Ht=O?O.boxStartIndex:t.collisionBoxArray.length,Ve=O?O.boxEndIndex:t.collisionBoxArray.length,ye=L?L.boxStartIndex:t.collisionBoxArray.length,Kt=L?L.boxEndIndex:t.collisionBoxArray.length,Oe=P?P.boxStartIndex:t.collisionBoxArray.length,kr=P?P.boxEndIndex:t.collisionBoxArray.length,rr=F?F.boxStartIndex:t.collisionBoxArray.length,fi=F?F.boxEndIndex:t.collisionBoxArray.length,kt=-1,Ee=(J,W)=>J!=null&&J.circleDiameter?Math.max(J.circleDiameter,W):W;kt=Ee(O,kt),kt=Ee(L,kt),kt=Ee(P,kt),kt=Ee(F,kt);let ir=+(kt>-1);ir&&(kt*=S/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Bt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let Tr=ey(o,b,_),[Ir,R]=$b(t.textAnchorOffsets,Tr);t.symbolInstances.emplaceBack(e.x,e.y,pt.right>=0?pt.right:-1,pt.center>=0?pt.center:-1,pt.left>=0?pt.left:-1,pt.vertical||-1,at,ot,Et,Ht,Ve,ye,Kt,Oe,kr,rr,fi,u,T,q,$,U,ir,0,p,kt,Ir,R,z)}function Ub(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Cc(this.zoom,e["text-size"]),this.iconSizeData=Cc(this.zoom,e["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap=Oc(r,"text-overlap","text-allow-overlap")!=="never"||Oc(r,"icon-overlap","icon-allow-overlap")!=="never"||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=n!=="viewport-y"&&!i.isConstant();let a=n==="viewport-y"||n==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(s=>Nd[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new al(new vr(this.layers,this.zoom,t=>t.startsWith("text"))),this.icon=new al(new vr(this.layers,this.zoom,t=>t.startsWith("icon"))),this.glyphOffsetArray=new Uf,this.lineVertexArray=new qf,this.symbolInstances=new Nf,this.textAnchorOffsets=new Gf}calculateGlyphDependencies(t,e,r,i,n){var l;let a=(i||this.allowVerticalPlacement)&&n,s=iu.fromFeature(t,r),o=s.graphemes();for(let u=0;u0)&&(a.value.kind!=="constant"||a.value.value.length>0),u=o.value.kind!=="constant"||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let c=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new st(this.zoom);for(let{feature:m,id:g,index:x,sourceLayerIndex:v}of t){let b=i._featureFilter.needGeometry,D=hi(m,b);if(!i._featureFilter.filter(d,D,r))continue;b||(D.geometry=Ar(m));let A;if(l){let z=i.getValueAndResolveTokens("text-field",D,r,f),O=ze.factory(z);this.hasRTLText||(this.hasRTLText=Gb(O)),A=gv(O,i,D)}let _;if(u){let z=i.getValueAndResolveTokens("icon-image",D,r,f);_=z instanceof _e?z:_e.fromString(z)}if(!A&&!_)continue;let S=this.sortFeaturesByKey?h.evaluate(D,{},r):void 0,k={id:g,text:A,icon:_,index:x,sourceLayerIndex:v,geometry:D.geometry,properties:m.properties,type:Dn.types[m.type],sortKey:S};if(this.features.push(k),_&&(c[_.name]=!0),A){let z=a.evaluate(D,{},r).join(","),O=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point";this.allowVerticalPlacement=(y=this.writingModes)==null?void 0:y.includes(2);let P=el(A.toString());this.calculateGlyphDependencies(A,p,z,O,P);for(let L of A.sections)L.image&&(c[L.image.name]=!0)}}n.get("symbol-placement")==="line"&&(this.features=xv(this.features)),this.sortFeaturesByKey&&this.features.sort((m,g)=>m.sortKey-g.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){Ob({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;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}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;ni[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];(r==null?void 0:r.sortKey)===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};C("SymbolBucket",iy,{omit:["layers","collisionBoxArray","features","compareText"]});function Xb(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):"")}var Yb,Wb=()=>Yb||(Yb=new Xt({"symbol-placement":new V(w.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new V(w.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new V(w.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new N(w.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new V(w.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new V(w.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new V(w.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new V(w.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new V(w.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new N(w.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new N(w.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new V(w.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new V(w.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new N(w.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new N(w.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new N(w.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new V(w.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new N(w.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new N(w.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new V(w.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new V(w.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new V(w.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new N(w.layout_symbol["text-field"],"text-field"),"text-font":new N(w.layout_symbol["text-font"],"text-font"),"text-size":new N(w.layout_symbol["text-size"],"text-size"),"text-max-width":new N(w.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new V(w.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new N(w.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new N(w.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new N(w.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new V(w.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new N(w.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new N(w.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new V(w.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new V(w.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new N(w.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new V(w.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new V(w.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new N(w.layout_symbol["text-transform"],"text-transform"),"text-offset":new N(w.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new V(w.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new V(w.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new V(w.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new V(w.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new N(w.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new V(w.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})),Zb,Hb=()=>Zb||(Zb=new Xt({"icon-opacity":new N(w.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new N(w.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new N(w.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new N(w.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new N(w.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new V(w.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new V(w.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new N(w.paint_symbol["text-opacity"],"text-opacity"),"text-color":new N(w.paint_symbol["text-color"],"text-color",{runtimeType:ce,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new N(w.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new N(w.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new N(w.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new V(w.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new V(w.paint_symbol["text-translate-anchor"],"text-translate-anchor")})),Ys={get paint(){return Hb()},get layout(){return Wb()}},ny=class{constructor(t){if(t.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:dn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e!=null&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};C("FormatSectionOverride",ny,{omit:["defaultValue"]});var Kb=class ol extends de{constructor(e,r){super(e,Ys,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new se(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!ja(s.value)&&a?Xb(r.properties,a):a}createBucket(e){return new iy(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Ys.paint.overridableProperties){if(!ol.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Il(new ny(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind==="constant"||r.value.kind==="source"?new an("source",i):new wa("composite",i,r.value.zoomStops),this.paint._values[e]=new se(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:ol.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get("text-field"),n=Ys.paint.properties[r],a=!1,s=o=>{var l;for(let u of o)if((l=n.overrides)!=null&&l.hasOverride(u)){a=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof ze)s(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let o=u=>{if(!a)if(u instanceof ri&&_t(u.value)===yn){let h=u.value;s(h.sections)}else u instanceof Ep?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function Jb(t,e,r,i=1){var a;let n=(a=t.get("icon-padding").evaluate(e,{},r))==null?void 0:a.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var Qb,tw=()=>Qb||(Qb=new Xt({"background-color":new V(w.paint_background["background-color"],"background-color"),"background-pattern":new Lf(w.paint_background["background-pattern"],"background-pattern"),"background-opacity":new V(w.paint_background["background-opacity"],"background-opacity")})),ew={get paint(){return tw()}};var rw=class extends de{constructor(t,e){super(t,ew,e)}};var iw=class extends de{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function ay(t,e){if(t.type==="custom")return new iw(t,e);switch(t.type){case"background":return new rw(t,e);case"circle":return new Bg(t,e);case"color-relief":return new Yg(t,e);case"fill":return new Ex(t,e);case"fill-extrusion":return new Hx(t,e);case"heatmap":return new Rg(t,e);case"hillshade":return new qg(t,e);case"line":return new G2(t,e);case"raster":return new Xm(t,e);case"symbol":return new Kb(t,e)}}var nw=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var t;this._triggered||(this._triggered=!0,(t=this._channel)==null||t.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},aw={once:!0},sy=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new nw(()=>this.process()),this.subscription=hh(this.target,"message",r=>this.receive(r),!1),this.globalScope=mr(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?hh(e.signal,"abort",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:"",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new dl(e.signal.reason))},aw):null;this.resolveRejects[n]={resolve:l=>{a==null||a.unsubscribe(),r(l)},reject:l=>{a==null||a.unsubscribe(),i(l)}};let s=[],o=Si(je({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:Yi(t.data,s)});this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=["file://","resource://android","null"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===""){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort();return}if(mr(self)||e.mustQueue){this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,e){return rt(this,null,function*(){if(e.type===""){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(Ki(Wi(e.error))):n.resolve(Wi(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=Wi(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=yield this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,Ki(n))}})}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?Yi(e):null,data:Yi(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function sw(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var oy=class{constructor(t,e,r){if(!sw(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=Hi(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){let i=lw(this.x,this.y,this.z),n=uw(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,i)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new B((t.x*e-this.x)*mt,(t.y*e-this.y)*mt)}toString(){return`${this.z}/${this.x}/${this.y}`}},ow=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Hi(t,e.z,e.z,e.x,e.y)}},uu=class ne{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new oy(i,+n,+a),this.key=Hi(r,e,i,n,a)}clone(){return new ne(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new ne(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ne(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?Hi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Hi(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ne(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new ne(r,this.wrap,r,i,n),new ne(r,this.wrap,r,i+1,n),new ne(r,this.wrap,r,i,n+1),new ne(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrape.wrap?!1:this.overscaledZe.overscaledZ?!1:this.canonical.xe.canonical.x?!1:this.canonical.y=0&&e=0&&r=u)return null;let c=this.canonical.x+n,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new ne(this.overscaledZ,p,l,c,h),x:s,y:o}}};function Hi(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<0;n--){let a=1<pw(n,a,r),t.layers[i])}function pw(t,e,r=""){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s>31}function yw(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(Zs(1,o));let l=i===3?s.length-1:s.length;for(let u=0;u=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can\'t be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},gw=class{constructor(t,e,r,i,n){this.type="Feature",this._vectorTileFeature=t,this._x=r,this._y=i,this._z=e;for(let a in t.properties)typeof t.properties[a]=="string"&&t.properties[a].startsWith("__$json__:")&&(t.properties[a]=JSON.parse(t.properties[a].slice(10)));this.properties=t.properties,this.id=n}projectPoint(t,e,r,i){return[(t.x+e)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+r)*2/i)*Math.PI))-90]}projectLine(t,e,r,i){return t.map(n=>this.projectPoint(n,e,r,i))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,e=t.extent*2**this._z,r=t.extent*this._x,i=t.extent*this._y,n=t.loadGeometry();switch(t.type){case 1:{let a=[];for(let o of n)a.push(o[0]);let s=this.projectLine(a,r,i,e);this._geometry=a.length===1?{type:"Point",coordinates:s[0]}:{type:"MultiPoint",coordinates:s};break}case 2:{let a=n.map(s=>this.projectLine(s,r,i,e));this._geometry=a.length===1?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a};break}case 3:{let a=dd(n),s=[];for(let o of a)s.push(o.map(l=>this.projectLine(l,r,i,e)));this._geometry=s.length===1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)e!=="_geometry"&&e!=="_vectorTileFeature"&&e!=="_x"&&e!=="_y"&&e!=="_z"&&(t[e]=this[e]);return t}},Sr=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r=="number"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){var e;return((e=this.nullabilityBuffer)==null?void 0:e.get(t))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},ts=class extends Sr{},pu=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},fu=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},uy=class extends Sr{constructor(t,e,r,i){super(t,e,i),this.delta=r}},du=class extends uy{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},yu=class extends Sr{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},xw=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var t;return(t=this._propertyVectors)!=null?t:[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r>>32-t;var ul=mu,py=65536;function gu(t,e){return t-t%e}function vw(t){return gu(t+31,32)}function bw(t){if(!Number.isFinite(t)||t<=0)return py;let e=gu(Math.floor(t),256);return e===0?256:e}function ww(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function Dw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function _w(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function Aw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function Sw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function Ew(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(h&3)<<4)&63,r[n++]=h>>>2&63,r[n++]=h>>>8&63,r[n++]=h>>>14&63,r[n++]=h>>>20&63,r[n]=h>>>26&63}function Fw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(h&1)<<6)&127,r[n++]=h>>>1&127,r[n++]=h>>>8&127,r[n++]=h>>>15&127,r[n++]=h>>>22&127,r[n++]=(h>>>29|(c&15)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n]=c>>>25&127}function kw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function Tw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(h&3)<<7)&511,r[n++]=h>>>2&511,r[n++]=h>>>11&511,r[n++]=h>>>20&511,r[n++]=(h>>>29|(c&63)<<3)&511,r[n++]=c>>>6&511,r[n++]=c>>>15&511,r[n++]=(c>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function Iw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=h>>>0&1023,r[n++]=h>>>10&1023,r[n++]=h>>>20&1023,r[n++]=(h>>>30|(c&255)<<2)&1023,r[n++]=c>>>8&1023,r[n++]=c>>>18&1023,r[n++]=(c>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function Cw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(h&31)<<6)&2047,r[n++]=h>>>5&2047,r[n++]=h>>>16&2047,r[n++]=(h>>>27|(c&63)<<5)&2047,r[n++]=c>>>6&2047,r[n++]=c>>>17&2047,r[n++]=(c>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Mw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(h&255)<<4)&4095,r[n++]=h>>>8&4095,r[n++]=h>>>20&4095,r[n++]=c>>>0&4095,r[n++]=c>>>12&4095,r[n++]=(c>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function Bw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,v=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function Pw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function zw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Lw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function Vw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=h>>>0&15,r[n++]=h>>>4&15,r[n++]=h>>>8&15,r[n++]=h>>>12&15,r[n++]=h>>>16&15,r[n++]=h>>>20&15,r[n++]=h>>>24&15,r[n++]=h>>>28&15}}function Ow(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(h&15)<<1)&31,r[n++]=h>>>4&31,r[n++]=h>>>9&31,r[n++]=h>>>14&31,r[n++]=h>>>19&31,r[n++]=h>>>24&31,r[n++]=(h>>>29|(c&3)<<3)&31,r[n++]=c>>>2&31,r[n++]=c>>>7&31,r[n++]=c>>>12&31,r[n++]=c>>>17&31,r[n++]=c>>>22&31,r[n++]=c>>>27&31}}function Rw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=h>>>0&63,r[n++]=h>>>6&63,r[n++]=h>>>12&63,r[n++]=h>>>18&63,r[n++]=h>>>24&63,r[n++]=(h>>>30|(c&15)<<2)&63,r[n++]=c>>>4&63,r[n++]=c>>>10&63,r[n++]=c>>>16&63,r[n++]=c>>>22&63,r[n++]=(c>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function $w(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(h&3)<<5)&127,r[n++]=h>>>2&127,r[n++]=h>>>9&127,r[n++]=h>>>16&127,r[n++]=h>>>23&127,r[n++]=(h>>>30|(c&31)<<2)&127,r[n++]=c>>>5&127,r[n++]=c>>>12&127,r[n++]=c>>>19&127,r[n++]=(c>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function Nw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function Uw(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function qw(t,e,r,i,n){let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+n<=32){let p=l>>>o&a;r[u+c]=p|0,o+=n,o===32&&(o=0,s++,c!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<>>0)}}var hl=bw(py),jw=3*hl/256+hl|0;function fy(){let t=new Uint8Array(jw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Gw(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:fy()}}function Xw(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function Yw(t,e,r,i){i.byteContainer.length>>2;if(n.byteOffset&3)for(let o=0;o>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u>>(u<<3)&255}return n}function Ww(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=vw(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length>>5)|0,r.exceptionSizes[a]=s}return e}function Zw(t,e,r,i,n){switch(n){case 1:Pw(t,e,r,i);break;case 2:zw(t,e,r,i);break;case 3:Lw(t,e,r,i);break;case 4:Vw(t,e,r,i);break;case 5:Ow(t,e,r,i);break;case 6:Rw(t,e,r,i);break;case 7:$w(t,e,r,i);break;case 8:Nw(t,e,r,i);break;case 16:Uw(t,e,r,i);break;default:qw(t,e,r,i,n)}return e+(n<<3)|0}function Hw(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function Kw(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function Jw(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=Kw(n,a,s,r,i,l);if(s=c,h===1){let m=1<y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m0&&(c=Jw(n,m,d,y,o,l,c,u,p))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function t3(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,h=t[u]>>>0,c=h+3>>>2,p=u+1,f=p+c;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=Yw(t,p,h,a),y=h,m=Ww(t,f,a);return a.dataPointers.fill(0),Qw(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function e3(t,e,r,i,n,a){let s=i+gu(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(hl,s-o);l=t3(t,e,l,o,u,a),o=o+u|0}return l}function r3(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,h=n,c=n+a,p=0,f=0;for(;o>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${h-u}/${a}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function i3(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r!=null?r:fy();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=e3(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return r3(t,i,o,a,n,l),a}function n3(t,e,r,i,n){switch(n){case 2:Dw(t,e,r,i);return;case 3:_w(t,e,r,i);return;case 4:Aw(t,e,r,i);return;case 5:Sw(t,e,r,i);return;case 6:Ew(t,e,r,i);return;case 7:Fw(t,e,r,i);return;case 8:kw(t,e,r,i);return;case 9:Tw(t,e,r,i);return;case 10:Iw(t,e,r,i);return;case 11:Cw(t,e,r,i);return;case 12:Mw(t,e,r,i);return;case 16:Bw(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let h=l>>>o&a;r[i+u]=h|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=t[s]>>>0;let p=ul[n-h]>>>0,f=(c|(l&p)<t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length0){let o=t.byteOffset+e;if(o&3)for(let l=0;l=64)throw Error("Varint too long")}return e.set(n),r}function o3(t,e,r){let i=new Float64Array(r);for(let n=0;n>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error("Expected varint not more than 10 bytes")}function h3(t,e,r,i){return c3(t,e,r,i,Gw(r>>>2))}function c3(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=Xw(n,s);a3(t,a,r,o);let l=i3(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function et(t){return t>>>1^-(t&1)}function Ot(t){return t>>BigInt(1)^-(t&BigInt(1))}function We(t){return t%2==1?(t+1)/-2:t/2}function p3(t){let e=new Int32Array(t.length);for(let r=0;r=4)for(;i=4)for(;i=4)for(;r=4)for(let i=t[0];r=4)for(;i=4)for(;l>>0;for(let r=1;r>>0;return e}function jc(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ot(t[0]));for(let r=1;r>>0,e[1]=et(t[1])>>>0;for(let r=2;r>>0,e[r+1]=e[r-1]+et(t[r+1])>>>0;return e}function F3(t,e,r,i){let n=yy(t,e,r,i);return new Uint32Array(n)}function k3(t){return t[1]}function T3(t){return et(t[1])}function I3(t){if(t.length===2){let e=et(t[1]);return[e,e]}return[et(t[2]),et(t[3])]}function C3(t){return t[1]}function M3(t){return Ot(t[1])}function B3(t){if(t.length===2){let e=Ot(t[1]);return[e,e]}return[Ot(t[2]),Ot(t[3])]}var St;(function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"})(St||(St={}));var jt;(function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"})(jt||(jt={}));var Me;(function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"})(Me||(Me={}));var Ct;(function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"})(Ct||(Ct={}));var P3=[St.PRESENT,St.DATA,St.OFFSET,St.LENGTH],Gc=[H.NONE,H.DELTA,H.COMPONENTWISE_DELTA,H.RLE,H.MORTON],z3=[le.NONE,le.FAST_PFOR,le.VARINT],L3=[jt.NONE,jt.SINGLE,jt.SHARED,jt.VERTEX,jt.MORTON,jt.FSST],V3=[Me.VERTEX,Me.INDEX,Me.STRING,Me.KEY],O3=[Ct.VAR_BINARY,Ct.GEOMETRIES,Ct.PARTS,Ct.RINGS,Ct.TRIANGLES,Ct.SYMBOL,Ct.DICTIONARY];function ct(t,e){let r=N3(t,e);return r.logicalLevelTechnique1===H.MORTON?R3(r,t,e):(H.RLE===r.logicalLevelTechnique1||H.RLE===r.logicalLevelTechnique2)&&le.NONE!==r.physicalLevelTechnique?$3(r,t,e):r}function R3(t,e,r){let i=$t(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function $3(t,e,r){let i=$t(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function N3(t,e){let r=t[e.get()],i=P3[r>>4],n={};switch(i){case St.DATA:n={dictionaryType:L3[r&15]};break;case St.OFFSET:n={offsetType:V3[r&15]};break;case St.LENGTH:n={lengthType:O3[r&15]}}e.increment();let a=t[e.get()],s=Gc[a>>5],o=Gc[a>>2&7],l=z3[a&3];e.increment();let u=$t(t,e,2),h=u[0],c=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var ht;(function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(ht||(ht={}));var fe=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<>r&1}size(){return this._size}getBuffer(){return this.values}};function Er(t,e,r){if(!e)return t;let i=e.size(),n=t.constructor,a=new n(i),s=0;for(let o=0;o=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],h=Math.min(a+l,e);n.fill(u,a,h),a=h}else{let l=256-o;for(let u=0;u=12?X3.decode(t.subarray(e,r)):Y3(t,e,r)}function Y3(t,e,r){let i="",n=e;for(;n239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function Ta(t,e,r,i,n){return J3(pi(t,e,r),r,i,n)}function Vt(t,e,r,i,n){return Q3(pi(t,e,r),r,i,n)}function Ze(t,e,r){return e6(pi(t,e,r),r)}function pi(t,e,r){let i=r.physicalLevelTechnique;switch(i){case le.FAST_PFOR:return h3(t,r.numValues,r.byteLength,e);case le.VARINT:return $t(t,e,r.numValues);case le.NONE:return j3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function _n(t,e,r){let i=r.physicalLevelTechnique;switch(i){case le.VARINT:return xu(t,e,r.numValues);case le.NONE:return G3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function W3(t,e,r){let i=pi(t,e,r);return i.length===1?et(i[0]):T3(i)}function wu(t,e,r){let i=pi(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?et(i[0]):i[0]:k3(i)}function vy(t,e,r){return I3(pi(t,e,r))}function by(t,e,r){return B3(xu(t,e,r.numValues))}function wy(t,e,r,i){return _y(_n(t,e,r),r,i)}function Du(t,e,r,i){return Ay(_n(t,e,r),r,i)}function Z3(t,e,r,i){let n=H3(t,e,r,!1);return i?Er(n,i,0):n}function H3(t,e,r,i){if(r.physicalLevelTechnique===le.VARINT)return t6(o3(t,e,r.numValues),r,i);let n=_n(t,e,r),a=i?_y(n,r):Ay(n,r);return Float64Array.from(a,Number)}function K3(t,e,r){let i=_n(t,e,r);return i.length===1?Ot(i[0]):M3(i)}function Dy(t,e,r){let i=_n(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?Ot(i[0]):i[0]:C3(i)}function J3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;if(!i)return A3(t,a.runs,a.numRleValues);t=cl(t,a.runs,a.numRleValues),n=Nc(t)}else n=Nc(t);break;case H.RLE:n=m3(t,e.runs,e.numRleValues);break;case H.MORTON:vu(t),n=new Int32Array(t);break;case H.COMPONENTWISE_DELTA:if(r&&!i)return yy(t,r.scale,r.min,r.max);n=b3(t);break;case H.NONE:n=p3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Er(n,i,0):n}function Q3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;n=qc(cl(t,a.runs,a.numRleValues))}else n=qc(t);break;case H.RLE:n=cl(t,e.runs,e.numRleValues);break;case H.MORTON:vu(t),n=t;break;case H.COMPONENTWISE_DELTA:n=r&&!i?F3(t,r.scale,r.min,r.max):E3(t);break;case H.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Er(n,i,0):n}function _y(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;if(!r)return S3(t,n.runs,n.numRleValues);t=pl(t,n.runs,n.numRleValues),i=Uc(t)}else i=Uc(t);break;case H.RLE:i=g3(t,e.runs,e.numRleValues);break;case H.NONE:i=f3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Er(i,r,BigInt(0)):i}function Ay(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;i=jc(pl(t,n.runs,n.numRleValues))}else i=jc(t);break;case H.RLE:i=pl(t,e.runs,e.numRleValues);break;case H.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Er(i,r,BigInt(0)):i}function t6(t,e,r){switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let i=e;t=dy(t,i.runs,i.numRleValues)}return y3(t),t;case H.RLE:return i6(t,e,r);case H.NONE:return r&&d3(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function e6(t,e){if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.NONE)return w3(t);if(e.logicalLevelTechnique1===H.RLE&&e.logicalLevelTechnique2===H.NONE){let r=e;return _3(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===H.NONE&&e.logicalLevelTechnique2===H.NONE){v3(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.RLE){let r=e,i=D3(t,r.runs,r.numRleValues);return vu(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function es(t,e,r,i,n="int32"){let a=t.logicalLevelTechnique1;if(a===H.RLE)return t.runs===1?ht.CONST:ht.FLAT;if(a!==H.DELTA||t.logicalLevelTechnique2!==H.RLE)return t.numValues===1?ht.CONST:ht.FLAT;let s=e instanceof fe?e.size():e,o=t;if(o.numRleValues!==s)return ht.FLAT;if(o.runs===1)return ht.SEQUENCE;if(o.runs!==2)return t.numValues===1?ht.CONST:ht.FLAT;let l=i.get();if(t.physicalLevelTechnique===le.VARINT)return r6(r,i,n)?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT;let u=i.get(),h=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),h[2]===2&&h[3]===2?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT}function r6(t,e,r){let i=new cy(e.get());if(r==="int64"){let a=xu(t,i,4);return a[2]===BigInt(2)&&a[3]===BigInt(2)}let n=$t(t,i,4);return n[2]===2&&n[3]===2}function i6(t,e,r){return r?x3(t,e.runs,e.numRleValues):dy(t,e.runs,e.numRleValues)}var Sy=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},Ey=class extends uy{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function _u(t,e,r){return{x:Xc(t,e)-r,y:Xc(t>>1,e)-r}}function Xc(t,e){let r=0;for(let i=0;i>i;return r}var Rt;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"})(Rt||(Rt={}));var n6;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"})(n6||(n6={}));var Fr;(function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"})(Fr||(Fr={}));function a6(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g[D]),r+=v,i+=v}break;case Rt.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=c[r]-c[r-1],r++;let b;d?(b=Or(m,s,v,!1),s+=v*2):(b=lr(t.vertexBufferType,m,f,o,v,!1,l),o+=v),e[a++]=[b],h&&n++}break;case Rt.POLYGON:{let v=c[r]-c[r-1];r++;let b=Array(v-1),D,A=p[i]-p[i-1];if(i++,d){D=Or(m,s,A,!0),s+=A*2;for(let _=0;_r?e[a++]:1);return i}function Zc(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l0;)n[a++]=t[u++]}}return n}var By=class extends Au{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s!=null?s:e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){var n,a,s;(s=this.decodedDictionary)!=null||(this.decodedDictionary=(n=this.sharedDictionaryCache)==null?void 0:n.decodedDictionary,(a=this.decodedDictionary)!=null||(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return bu(this.decodedDictionary,r,i)}decodeDictionary(){var t;return(t=this.symbolLengthBuffer)!=null||(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),v6(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=ct(t,e);m=new fe(ci(t,x.numValues,x.byteLength,e),x.numValues)}let g=Vt(t,e,ct(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${y}"`);h[p++]=new By(y,g,n,a,s,o,m,c)}else h[p++]=new Qr(y,g,n,a,m)}return h}var Kc=class extends Sr{constructor(t,e,r){super(t,new Uint8Array,r!=null?r:e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},Be;(function(t){t[t.STRING=1]="STRING",t[t.INT32=2]="INT32",t[t.UINT32=4]="UINT32",t[t.INT64=8]="INT64",t[t.UINT64=16]="UINT64",t[t.FLOAT=32]="FLOAT",t[t.DOUBLE=64]="DOUBLE",t[t.PRESENCE=128]="PRESENCE"})(Be||(Be={}));var pr;(function(t){t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t[t.START_MAP=2]="START_MAP",t[t.START_LIST=3]="START_LIST",t[t.COUNT=4]="COUNT"})(pr||(pr={}));function A6(t,e,r,i){let n=S6(r);if(i===0)return n.map(h=>new Kc(h,[]));let a=E6(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let h=0;h{var i;return t.name+((i=r.name)!=null?i:"")})}function E6(t,e,r){let i=t[e.get()];e.add(1);let n=Vt(t,e,ct(t,e)),a=r-1,s=[];i&Be.STRING&&(a-=F6(t,e,s)),a-=k6(t,e,i,s),a-=T6(t,e,i,s);let o,l=0;if(i&Be.PRESENCE){let h=I6(t,e);o=h.value,l=h.count,a--}let u=new Uint32Array;if(a>0&&(u=Vt(t,e,ct(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function F6(t,e,r){let i=t[e.get()];e.add(1);let n=Py("",t,e,i);if(n)for(let a=0;aa.length)throw Error("Merged map counts underflow while decoding child streams");let f=Array(r),d=i,y=n;for(let x=0;xs.length)throw Error("Map value stream underflow while decoding feature payload");let b=M6(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x=r)throw Error("Unexpected end of map value stream");let n=t[e];if(n===pr.FALSE)return{value:!1,nextIndex:e+1};if(n===pr.TRUE)return{value:!0,nextIndex:e+1};if(n===pr.START_MAP){let a=Jc(t,e,r);return{value:zy(t,e+2,a,i).value,nextIndex:a}}if(n===pr.START_LIST){let a=Jc(t,e,r),s=[],o=e+2;for(;o=r)throw Error("Missing length for nested map/list payload");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error("Nested payload exceeds containing payload bounds");return n}function Ly(t,e){let r=t-pr.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function Xr(t,e){for(let r of e)t.push(r)}function B6(t,e,r,i,n,a){var s;return r.type==="scalarType"?a&&!a.has(r.name)?(my(i,t,e),null):P6(i,t,e,n,r.scalarType,r):((s=r.complexType)==null?void 0:s.physicalType)===Qe.MAP?A6(t,e,r,i):i===0?null:_6(t,e,r,a)}function P6(t,e,r,i,n,a){var l;let s;if(t===0)return null;if(a.nullable){let u=ct(e,r),h=u.numValues,c=r.get(),p=ci(e,h,u.byteLength,r);r.set(c+u.byteLength),s=new fe(p,u.numValues)}let o=s!=null?s:i;switch(n.physicalType){case it.UINT_32:case it.INT_32:return R6(e,r,a,n,o);case it.STRING:{let u=a.nullable?t-1:t;return(l=Py(a.name,e,r,u,s))!=null?l:null}case it.BOOLEAN:return z6(e,r,a,i,o);case it.UINT_64:case it.INT_64:return O6(e,r,a,o,n);case it.FLOAT:return L6(e,r,a,o);case it.DOUBLE:return V6(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function z6(t,e,r,i,n){let a=ct(t,e),s=a.numValues,o=e.get(),l=An(n)?n:void 0,u=ci(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let h=new fe(u,s);return new m6(r.name,h,n)}function L6(t,e,r,i){let n=ct(t,e),a=An(i)?i:void 0,s=gy(t,e,n.numValues,a);return new g6(r.name,s,i)}function V6(t,e,r,i){let n=ct(t,e),a=An(i)?i:void 0,s=xy(t,e,n.numValues,a);return new fu(r.name,s,i)}function O6(t,e,r,i,n){let a=ct(t,e),s=es(a,i,t,e,"int64"),o=n.physicalType===it.INT_64;if(s===ht.FLAT){let u=An(i)?i:void 0,h=o?wy(t,e,a,u):Du(t,e,a,u);return new Sy(r.name,h,i)}if(s===ht.SEQUENCE){let u=by(t,e,a);return new Ey(r.name,u[0],u[1],a.numRleValues,o)}let l=o?K3(t,e,a):Dy(t,e,a);return new My(r.name,l,i,o)}function R6(t,e,r,i,n){let a=ct(t,e),s=es(a,n,t,e),o=i.physicalType===it.INT_32;if(s===ht.FLAT){let u=An(n)?n:void 0,h=o?Ta(t,e,a,void 0,u):Vt(t,e,a,void 0,u);return new pu(r.name,h,n)}if(s===ht.SEQUENCE){let u=vy(t,e,a);return new du(r.name,u[0],u[1],a.numRleValues,o)}let l=o?W3(t,e,a):wu(t,e,a);return new yu(r.name,l,n,o)}function An(t){return t instanceof fe}var It={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function Vy(t){switch(t){case It.ID:case It.ID|It.ID_NULLABLE:case It.ID|It.ID_LONG:case It.ID|It.ID_LONG|It.ID_NULLABLE:return{nullable:(t&It.ID_NULLABLE)!==0,columnScope:qi.FEATURE,type:"scalarType",scalarType:{longID:(t&It.ID_LONG)!==0,type:"logicalType",logicalType:hy.ID}};case It.GEOMETRY:return{nullable:!1,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.GEOMETRY,children:[]}};case It.STRUCT:return{nullable:!1,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.STRUCT,children:[]}};case It.MAP:return{nullable:!0,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.MAP,children:[]}};default:return j6(t)}}function $6(t){return t>=It.SCALAR_BASE}function Oy(t){return t===It.STRUCT||t===It.MAP}function N6(t){if(t.type==="scalarType"){let e=t.scalarType;if(e.type==="physicalType")switch(e.physicalType){case it.BOOLEAN:case it.INT_8:case it.UINT_8:case it.INT_32:case it.UINT_32:case it.INT_64:case it.UINT_64:case it.FLOAT:case it.DOUBLE:return!1;case it.STRING:return!0;default:return!1}if(e.type==="logicalType")return!1}else if(t.type==="complexType"){let e=t.complexType;if(e.type==="physicalType")switch(e.physicalType){case Qe.GEOMETRY:case Qe.STRUCT:case Qe.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}function U6(t){var e;return t.type==="scalarType"&&((e=t.scalarType)==null?void 0:e.type)==="logicalType"&&t.scalarType.logicalType===hy.ID}function q6(t){var e;return t.type==="complexType"&&((e=t.complexType)==null?void 0:e.type)==="physicalType"&&t.complexType.physicalType===Qe.GEOMETRY}function j6(t){let e;switch(t){case 10:case 11:e=it.BOOLEAN;break;case 12:case 13:e=it.INT_8;break;case 14:case 15:e=it.UINT_8;break;case 16:case 17:e=it.INT_32;break;case 18:case 19:e=it.UINT_32;break;case 20:case 21:e=it.INT_64;break;case 22:case 23:e=it.UINT_64;break;case 24:case 25:e=it.FLOAT;break;case 26:case 27:e=it.DOUBLE;break;case 28:case 29:e=it.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:qi.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:e}}}var G6=new TextDecoder,Qc="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function Eu(t,e){let r=$t(t,e,1)[0];if(r===0)return"";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),G6.decode(a)}function X6(t){let e=t.name,r=t.nullable;return t.type==="scalarType"?{type:"scalarField",scalarField:t.scalarType,name:e,nullable:r}:{type:"complexField",complexField:t.complexType,name:e,nullable:r}}function Ry(t,e){let r=$t(t,e,1)[0]>>>0,i=r>=It.SCALAR_BASE?Vy(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n=Si(je({},i),{name:Eu(t,e)});if(n.type==="complexType"&&Oy(r)){let a=n.complexType,s=$t(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o>>0,i=Vy(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${Qc}`);let n;if($6(r))n=Eu(t,e);else if(r>>0,o=a.complexType;o.children=Array(s);for(let l=0;l>>0,a=$t(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=$t(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=W6(t,i),h=l.featureTables[0],c=null,p=null,f=[],d=0;for(let m of h.columns){let g=m.name;if(U6(m)){let x=null;if(m.nullable){let b=ct(t,i),D=i.get(),A=ci(t,b.numValues,b.byteLength,i);i.set(D+b.byteLength),x=new fe(A,b.numValues)}let v=ct(t,i);d=x?x.size():v.decompressedCount,c=H6(t,m,i,g,v,x!=null?x:d,r)}else if(q6(m)){let x=$t(t,i,1)[0];if(d===0){let v=i.get();d=ct(t,i).decompressedCount,i.set(v)}e&&(e.scale=e.extent/u),p=f6(t,x,i,d,e)}else{let x=N6(m)?$t(t,i,1)[0]:1;if(x===0)continue;let v=B6(t,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new xw(h.name,p,c,f,u);n.push(y),i.set(s)}return n}function H6(t,e,r,i,n,a,s=!1){var h;let o=(h=e.scalarType)!=null&&h.longID?it.UINT_64:it.UINT_32,l=typeof a=="number"?void 0:a,u=es(n,a,t,r,o===it.UINT_64?"int64":"int32");if(o===it.UINT_32)switch(u){case ht.FLAT:return new pu(i,Vt(t,r,n,void 0,l),a);case ht.SEQUENCE:{let c=vy(t,r,n);return new du(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new yu(i,wu(t,r,n),a,!1)}switch(u){case ht.FLAT:return s?new fu(i,Z3(t,r,n,l),a):new Sy(i,Du(t,r,n,l),a);case ht.SEQUENCE:{let c=by(t,r,n);return new Ey(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new My(i,Dy(t,r,n),a,!1)}throw Error("Vector type not supported for id column.")}var K6=class{constructor(t,e){var r;switch(this._featureData=t,this.properties=this._featureData.properties||{},(r=this._featureData.geometry)==null?void 0:r.type){case Rt.POINT:case Rt.MULTIPOINT:this.type=1;break;case Rt.LINESTRING:case Rt.MULTILINESTRING:this.type=2;break;case Rt.POLYGON:case Rt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new B(i.x,i.y));t.push(r)}return t}},J6=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new K6(this.features[t],this.extent)}},Fu=class{constructor(t){this.layers={};let e=Z6(new Uint8Array(t));this.layers=e.reduce((r,i)=>Si(je({},r),{[i.name]:new J6(i)}),{})}},ku=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new uo(mt,16,0),this.grid3D=new uo(mt,16,0),this.featureIndexArray=new Yf,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new Fu(this.rawTileData).layers:this.vtLayers=new Xl(new au(this.rawTileData)).layers,this.sourceLayerCoder=new cu(this.vtLayers?Object.keys(this.vtLayers).sort():[ll])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=mt/t.tileSize/t.scale,s=ai(n.filter,"queryRenderedFeatures filter",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Fa.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=Fa.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(y,m,g,x)=>vg(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)h.push(y);h.sort(t5);let f={},d;for(let y of h){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,i,(x,v,b)=>(g||(g=Ar(x)),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,transform:t.transform,pixelsToTileUnits:a,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,h){let c=this.bucketLayerIDs[e];if(a&&!c.some(y=>a.has(y)))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(i);if(n.needGeometry){let y=hi(f,!0);if(!n.filter(new st(this.tileID.overscaledZ),y,this.tileID.canonical))return}else if(!n.filter(new st(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let y of c){if(a&&!a.has(y))continue;let m=o[y];if(!m)continue;let g={};d&&u&&(g=u.getState(m.sourceLayer||"_geojsonTileLayer",d));let x=Gt({},l[y]);x.paint=tp(x.paint,m.paint,f,g,s),x.layout=tp(x.layout,m.layout,f,g,s);let v=!h||h(f,m,g);if(!v)continue;let b=new gw(f,this.z,this.x,this.y,d);b.layer=x;let D=t[y];D===void 0&&(D=t[y]=[]),D.push({featureIndex:i,feature:b,intersectionZ:v})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=ai(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let h of t)this.loadMatchingFeature(l,r,i,h,u,a,s,o,e);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){var i;let r=t.id;if(this.promoteId){let n=typeof this.promoteId=="string"?this.promoteId:this.promoteId[e];r=t.properties[n],typeof r=="boolean"&&(r=Number(r)),r===void 0&&((i=t.properties)!=null&&i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};C("FeatureIndex",ku,{omit:["rawTileData","sourceLayerCoder"]});function Q6(t){return typeof t=="object"&&!!t&&"evaluate"in t}function tp(t,e,r,i,n){return Ia(t,(a,s)=>{let o=e instanceof Ya?e.get(s):null;return Q6(o)?o.evaluate(r,i,void 0,n):o})}function t5(t,e){return e-t}var $y=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}};function Tu(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n="[";for(let a of t)n+=`${Tu(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i="{";for(let n=0;nthis._layers[c.id]),s=a[0];if(s.isHidden())continue;let o=s.source||"",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]={});let u=s.sourceLayer||"_geojsonTileLayer",h=l[u];h||(h=l[u]=[]),h.push(a)}}},qy=class{constructor(t){let e={},r=[];for(let s in t){let o=t[s],l=e[s]={};for(let u in o){let h=o[u];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let c={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};r.push(c),l[u]={rect:c,metrics:h.metrics}}}let{w:i,h:n}=su(r),a=new Ja({width:i||1,height:n||1});for(let s in t){let o=t[s];for(let l in o){let u=o[l];if(!u||u.bitmap.width===0||u.bitmap.height===0)continue;let h=e[s][l].rect;Ja.copy(u.bitmap,a,{x:0,y:0},{x:h.x+1,y:h.y+1},u.bitmap)}}this.image=a,this.positions=e}};C("GlyphAtlas",qy);var jy=class{constructor(t){this.tileID=new uu(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,e,r,i,n){return rt(this,null,function*(){this.data=t,this.collisionBoxArray=new Ll;let a=new cu(Object.keys(t.layers).sort()),s=new ku(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let S in u){let k=t.layers[S];if(!k)continue;k.version===1&&Bt(`Vector tile source "${this.source}" layer "${S}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let z=a.encode(S),O=[];for(let P=0;PF.id)))}}let h=Ia(l.glyphDependencies,S=>Object.keys(S));for(let S of this.inFlightDependencies)S==null||S.abort();this.inFlightDependencies=[];let c=Promise.resolve({});if(Object.keys(h).length){let S=new AbortController;this.inFlightDependencies.push(S),c=i.sendAsync({type:"GG",data:{stacks:h,source:this.source,tileID:this.tileID,type:"glyphs"}},S)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let S=new AbortController;this.inFlightDependencies.push(S),f=i.sendAsync({type:"GI",data:{icons:p,source:this.source,tileID:this.tileID,type:"icons"}},S)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let S=new AbortController;this.inFlightDependencies.push(S),y=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},S)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let S=new AbortController;this.inFlightDependencies.push(S),g=i.sendAsync({type:"GDA",data:{dashes:m}},S)}let[x,v,b,D]=yield Promise.all([c,f,y,g]),A=new qy(x),_=new ou(v,b);for(let S in o){let k=o[S];k.hasDependencies&&(Ny(k.layers,this.zoom,r),k.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:A.positions,iconMap:v,iconPositions:_.iconPositions,patternMap:b,patternPositions:_.patternPositions,dashPositions:D,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(S=>!S.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:A.image,imageAtlas:_,dashPositions:D,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?A.positions:null}})}};function Ny(t,e,r){let i=new st(e);for(let n of t)n.recalculate(i,r)}var Gy=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e!=null&&e.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},Xy=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},n5=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new B(e.x,e.y)))}},a5=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},s5=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function o5(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l0&&l.addLayer(d)}let h={vectorTile:l,rawData:hu(l).buffer};return this.overzoomedTileResultCache.set(s,h),h}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}},u5=class{constructor(){this.loaded={}}loadTile(t){return rt(this,null,function*(){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,h=Ca(i)?new Zt({width:l,height:u},yield ap(i,-2,-2,l,u)):i,c=new jl(e,h,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=c,c})}removeTile(t){let e=this.loaded,r=t.uid;e!=null&&e[r]&&delete e[r]}},h5=class{constructor(t,e,r,i=c5){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new Gy,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new ly(n.features,{version:2,extent:mt});return{vectorTile:a,rawData:hu(a,np).buffer}}loadTile(t){return rt(this,null,function*(){let{uid:e}=t,r=new jy(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),yield this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}})}_parseWorkerTile(t,e){return rt(this,null,function*(){let r=this.tileState.getParsing(t.uid),i=yield t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=Gt({rawTileData:n.slice(0),encoding:"mvt"},i),this.tileState.removeParsing(t.uid)}return i})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}loadData(t){return rt(this,null,function*(){var r;(r=this._pendingRequest)==null||r.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let i={};return t.request&&(i.data=t.data),this._finishRequestTiming(e,t,i),i}catch(i){if(delete this._pendingRequest,!yl(i))throw i;return{abandoned:!0}}})}_startRequestTiming(t){var e;if((e=t.request)!=null&&e.collectResourceTiming)return new Xy(t.request.url)}_finishRequestTiming(t,e,r){let i=t==null?void 0:t.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return yield this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}loadAndProcessGeoJSON(t,e){return rt(this,null,function*(){var r;if(t.request&&(t.data=(yield up(t.request,e)).data),t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source),this._geoJSONIndex=this._createGeoJSONIndex(t.data,t);return}if(t.dataDiff){(r=this._geoJSONIndex)!=null||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},t)),this._geoJSONIndex.updateData(t.dataDiff,this._getFilterPredicate(t.filter,t.source));return}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,Yy(t)),this._geoJSONIndex==null)throw Error(`Input data given to \'${t.source}\' is not a valid GeoJSON object.`)})}_filterGeoJSON(t,e,r){if(t.type!=="FeatureCollection")return t;let i=this._getFilterPredicate(e,r);return i?{type:"FeatureCollection",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!="boolean"&&!(t!=null&&t.length))return;let r=er(t,`sources.${e}.filter`,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(r.result==="error")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(", "));return i=>r.value.evaluate({zoom:0},i)}removeSource(t){return rt(this,null,function*(){var e;(e=this._pendingRequest)==null||e.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getClusterChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset)}};function c5(t,e){let r=Gt(e.geojsonVtOptions||{},{updateable:!0,clusterOptions:Yy(e)});return new Td(t,r)}function Yy({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,h]=e[l],c=er(h,`sources.${r}.clusterProperties.${l}[1]`),p=er(typeof u=="string"?[u,["accumulated"],["get",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=c.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let h of o)u[h]=i[h].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let h of o)a.accumulated=l[h],l[h]=n[h].evaluate(a,s)},t.clusterOptions}function Uy(t){return rt(this,null,function*(){if(t.endsWith(".mjs")){yield import(t);return}let e=yield fetch(t,{credentials:"same-origin"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=yield e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{yield import(i)}finally{URL.revokeObjectURL(i)}return}globalThis.eval(r)})}var p5=class{constructor(t){this.self=t,this.actor=new sy(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=sp,this.self.removeProtocol=op,this.self.registerRTLTextPlugin=e=>{wr.setMethods(e)},this.self.makeRequest=Ma,this.actor.registerMessageHandler("LDT",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler("RDT",(e,r)=>rt(this,null,function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})),this.actor.registerMessageHandler("GCEZ",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})),this.actor.registerMessageHandler("GCC",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})),this.actor.registerMessageHandler("GCL",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})),this.actor.registerMessageHandler("LD",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler("LT",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler("RT",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler("AT",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler("RMT",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler("RS",(e,r)=>rt(this,null,function*(){var n,a;if(!((a=(n=this.workerSources[e])==null?void 0:n[r.type])!=null&&a[r.source]))return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)})),this.actor.registerMessageHandler("RM",e=>rt(this,null,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)})),this.actor.registerMessageHandler("SR",(e,r)=>rt(this,null,function*(){this.referrer=r})),this.actor.registerMessageHandler("SRPS",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler("IS",(e,r)=>rt(this,null,function*(){yield Uy(r)})),this.actor.registerMessageHandler("SI",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler("UL",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))})),this.actor.registerMessageHandler("UGS",(e,r)=>rt(this,null,function*(){let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]})),this.actor.registerMessageHandler("SL",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).replace(r,this._getGlobalState(e))}))}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}_setImages(t,e){return rt(this,null,function*(){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}})}_syncRTLPluginState(t,e){return rt(this,null,function*(){return yield wr.syncState(e,Uy)})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i5),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case"vector":this.workerSources[t][e][r]=new l5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new h5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new u5),this.demWorkerSources[t][e]}};mr(self)&&(self.worker=new p5(self));export{p5 as default};\n/*! Bundled license information:\n\nmaplibre-gl/dist/maplibre-gl-shared.mjs:\nmaplibre-gl/dist/maplibre-gl-worker.mjs:\n (**\n * MapLibre GL JS\n * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.9.0/LICENSE.txt\n *)\n*/\n'}}),j6=m({"src/plots/map/layers.js"(e,t){var r=tb(),i=tj().sanitizeHTML,n=vr(),a=y6();function o(e,t){this.subplot=e,this.uid=e.uid+"-"+t,this.index=t,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var i=0;i0}function u(e){var t={},i={};switch(e.type){case"circle":r.extendFlat(i,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":r.extendFlat(i,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":r.extendFlat(i,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var a=e.symbol,o=n(a.textposition,a.iconsize);r.extendFlat(t,{"icon-image":a.icon,"icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(i,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case"raster":r.extendFlat(i,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:i}}s.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=l(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},s.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},s.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},s.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,l(e)){var r,n,a,o,s,u=(a=(r=e).sourcetype,o=r.source,s={type:a},"geojson"===a?n="data":"vector"===a?n="string"==typeof o?"url":"tiles":"raster"===a?(n="tiles",s.tileSize=256):"image"===a&&(n="url",s.coordinates=r.coordinates),s[n]=o,r.sourceattribution&&(s.attribution=i(r.sourceattribution)),s);t.addSource(this.idSource,u)}},s.findFollowingMapLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r(!g[e]&&/^[a-zA-Z0-9-]+$/.test(e)&&(g[e]=new Promise(t=>{let r=new Image(15,15);r.onload=()=>{m.addImage(e,r,{sdf:!0}),t()},r.onerror=()=>t(),r.crossOrigin="Anonymous",r.src=`https://cdn.jsdelivr.net/npm/@mapbox/maki@8.2.0/icons/${e}.svg`})),g[e])),m.setTransformRequest(function(e){return{url:e=(e=(e=e.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular")}}),m._canvas.style.left="0px",m._canvas.style.top="0px",l.rejectOnError(s),l.isStatic||l.initFx(e,t);var y=[];y.push(new Promise(function(e){m.once("load",e)})),Promise.all(y=y.concat(o.fetchTraceGeoData(e))).then(function(){p&&A(l,u),M(l,u),l.fillBelowLookup(e,t),l.updateData(e),l.updateLayout(t),l.resolveOnRender(a)}).catch(s)},T.updateMap=function(e,t,r,i){var n=this,a=n.map,s=t[this.id];n.rejectOnError(i);var l=[],u=S(s.style);JSON.stringify(n.styleObj)!==JSON.stringify(u)&&(n.styleObj=u,a.setStyle(u.style),n.traceHash={},l.push(new Promise(function(e){a.once("styledata",e)}))),Promise.all(l=l.concat(o.fetchTraceGeoData(e))).then(function(){n.fillBelowLookup(e,t),n.updateData(e);let i=s._fitBounds;i&&(a.fitBounds([[i.west,i.south],[i.east,i.north]],{padding:b.fitBoundsPadding,animate:!1}),A(n,s),M(n,s)),n.updateLayout(t),n.resolveOnRender(r)}).catch(i)},T.fillBelowLookup=function(e,t){var r,i,n=t[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r1)for(r=0;rt.project(e).x,_subplot:t},t.yaxis={_id:"y",c2p:e=>t.project(e).y,_subplot:t},t.updateFramework(e),t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},l.setConvert(t.mockAxis,e)},T.initFx=function(e,t){var r=this,i=r.gd,n=r.map;function a(){c.loneUnhover(t._hoverlayer)}function o(){var e=r.getView();i.emit("plotly_relayouting",r.getViewEditsWithDerived(e))}n.on("moveend",function(e){if(r.map){var t=i._fullLayout;if(e.originalEvent||r.wheeling){var n=t[r.id];s.call("_storeDirectGUIEdit",i.layout,t._preGUI,r.getViewEdits(n));var a=r.getView();n._input.center=n.center=a.center,n._input.zoom=n.zoom=a.zoom,n._input.bearing=n.bearing=a.bearing,n._input.pitch=n.pitch=a.pitch,i.emit("plotly_relayout",r.getViewEditsWithDerived(a))}e.originalEvent&&"mouseup"===e.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),t&&t._rehover&&t._rehover()}}),n.on("wheel",function(){r.wheeling=!0}),n.on("mousemove",function(e){var t=r.div.getBoundingClientRect(),a=[e.originalEvent.offsetX,e.originalEvent.offsetY];e.target.getBoundingClientRect=function(){return t},r.xaxis.p2c=function(){return n.unproject(a).lng},r.yaxis.p2c=function(){return n.unproject(a).lat},i._fullLayout._rehover=function(){i._fullLayout._hoversubplot===r.id&&i._fullLayout[r.id]&&c.hover(i,e,r.id)},c.hover(i,e,r.id),i._fullLayout._hoversubplot=r.id}),n.on("dragstart",function(){r.dragging=!0,a()}),n.on("zoomstart",a),n.on("mouseout",function(){i._fullLayout._hoversubplot=null}),n.on("drag",o),n.on("zoom",o),n.on("dblclick",function(){var e=i._fullLayout[r.id];s.call("_storeDirectGUIEdit",i.layout,i._fullLayout._preGUI,r.getViewEdits(e));var t=r.viewInitial;n.setCenter(E(t.center)),n.setZoom(t.zoom),n.setBearing(t.bearing),n.setPitch(t.pitch);var a=r.getView();e._input.center=e.center=a.center,e._input.zoom=e.zoom=a.zoom,e._input.bearing=e.bearing=a.bearing,e._input.pitch=e.pitch=a.pitch,i.emit("plotly_doubleclick",null),i.emit("plotly_relayout",r.getViewEditsWithDerived(a))}),r.clearOutline=function(){y(r.dragOptions),g(r.dragOptions.gd)},r.onClickInPanFn=function(e){return function(t){var n=i._fullLayout.clickmode;n.indexOf("select")>-1&&v(t.originalEvent,i,[r.xaxis],[r.yaxis],r.id,e),n.indexOf("event")>-1&&c.click(i,t.originalEvent)}}},T.updateFx=function(e){var t=this,r=t.map,i=t.gd;if(!t.isStatic){var n=e.dragmode,o=t.dragOptions;t.dragOptions=a.extendDeep(o||{},{dragmode:e.dragmode,element:t.div,gd:i,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:function(e,r){r.isRect?(e.range={})[t.id]=[s([r.xmin,r.ymin]),s([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(s)}},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),p(n)||f(n)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,i){m(e,r,i,t.dragOptions,n)},u.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function s(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},T.updateFramework=function(e){var t=e[this.id].domain,r=e._size,i=this.div.style;i.width=r.w*(t.x[1]-t.x[0])+"px",i.height=r.h*(t.y[1]-t.y[0])+"px",i.left=r.l+t.x[0]*r.w+"px",i.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},T.updateLayers=function(e){var t,r=e[this.id].layers,i=this.layerList;if(r.length!==i.length){for(t=0;tj9});var Ne,Nt=p({"src/plots/map/get_map_fit_bounds.ts"(){Ne=v(pE())}}),Nr=m({"src/plots/map/layout_defaults.js"(e,t){var r=tb(),i=st(),n=tK(),a=y8(),{getMapFitBounds:o}=(Nt(),x(j7));function s(e,t,r,i){r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");let a=r("fitbounds");var s=r("bounds.west"),u=r("bounds.east"),c=r("bounds.south"),h=r("bounds.north");(void 0===s||void 0===u||void 0===c||void 0===h)&&delete t.bounds,n(e,t,{name:"layers",handleItemDefaults:l}),t._fitBounds=null;let{_fitView:{center:d,zoom:f}={},center:p,zoom:m}=e,g=p?.lon===d?.lon&&p?.lat===d?.lat&&m===f;if(a&&g){let e=o(i.fullData,i.id);e&&(t._fitBounds=e)}t._input=e}function l(e,t){function i(i,n){return r.coerce(e,t,a.layers,i,n)}if(i("visible")){var n,o=i("sourcetype"),s="raster"===o||"image"===o;i("source"),i("sourceattribution"),"vector"===o&&i("sourcelayer"),"image"===o&&i("coordinates"),s&&(n="raster");var l=i("type",n);s&&"raster"!==l&&(l=t.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),i("below"),i("color"),i("opacity"),i("minzoom"),i("maxzoom"),"circle"===l&&i("circle.radius"),"line"===l&&(i("line.width"),i("line.dash")),"fill"===l&&i("fill.outlinecolor"),"symbol"===l&&(i("symbol.icon"),i("symbol.iconsize"),i("symbol.text"),r.coerceFont(i,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),i("symbol.textposition"),i("symbol.placement"))}}t.exports=function(e,t,r){i(e,t,r,{type:"map",attributes:a,handleDefaults:s,partition:"y",fullData:r})}}}),Ni=m({"src/plots/map/index.js"(e){var t=tb(),r=t.strTranslate,i=t.strScale,n=tz().getSubplotCalcData,a=tR(),o=M(),s=rt(),l=tj(),u=j8();e.name="map",e.attr="subplot",e.idRoot="map",e.idRegex=e.attrRegex=t.counterRegex("map"),e.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},e.layoutAttributes=y8(),e.supplyLayoutDefaults=Nr(),e.plot=function(e){for(var t=e._fullLayout,r=e.calcdata,i=t._subplots.map,a=0;av/2){var x=p.split("|").join("
");g.text(x).attr("data-unformatted",x).call(l.convertToTspans,e),y=s.bBox(g.node())}g.attr("transform",r(-3,-y.height+8)),m.insert("rect",".static-attribution").attr({x:-y.width-6,y:-y.height-3,width:y.width+6,height:y.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;y.width+6>v&&(b=v/(y.width+6));var _=[u.l+u.w*d.x[1],u.t+u.h*(1-d.y[0])];m.attr("transform",r(_[0],_[1])+i(b))}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots.map,i=0;i=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var i=t[0].trace,n=new a(e,i.uid),o=n.sourceId,s=r(t),l=n.below=e.belowLookup["trace-"+i.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),n._addLayers(s,l),t[0].trace._glTrace=n,n}}}),Nc=m({"src/traces/choroplethmap/index.js"(e,t){t.exports={attributes:No(),supplyDefaults:Ns(),colorbar:ol(),calc:pH(),plot:Nu(),hoverPoints:pY(),eventData:pZ(),selectPoints:pX(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var r=t.getMapLayers(),i=r.length-2;i>=0;i--){var n=r[i].id;if("string"==typeof n&&0===n.indexOf("water")){for(var a=i+1;a0?+f[c]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var b=a.extractOpts(t),_=b.reversescale?a.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,1>n.opacity(w)?w:n.addOpacity(w,0)];for(c=1;c<_.length;c++)T.push(_[c][0],_[c][1]);var A=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(u.heatmap.paint,{"heatmap-weight":p?A:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),u.geojson={type:"FeatureCollection",features:h},u.heatmap.layout.visibility="visible",u}}}),Ng=m({"src/traces/densitymap/plot.js"(e,t){var r=Nm(),i=y6().traceLayerPrefix;function n(e,t){this.type="densitymap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",i+t+"-heatmap"]],this.below=null}var a=n.prototype;a.update=function(e){var t=this.subplot,i=this.layerList,n=r(e),a=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(n.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(n,a),this.below=a);for(var o=0;o=0;r--)e.removeLayer(t[r][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var i=t[0].trace,a=new n(e,i.uid),o=a.sourceId,s=r(t),l=a.below=e.belowLookup["trace-"+i.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),Ny=m({"src/traces/densitymap/hover.js"(e,t){var r=ro(),i=va().hoverPoints,n=va().getExtraText;t.exports=function(e,t,a){var o=i(e,t,a);if(o){var s=o[0],l=s.cd,u=l[0].trace,c=l[s.index];if(delete s.color,"z"in c){var h=s.subplot.mockAxis;s.z=c.z,s.zLabel=r.tickText(h,h.c2l(c.z),"hover").text}return s.extraText=n(u,c,l[0].t.labels),[s]}}}}),Nv=m({"src/traces/densitymap/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}}),Nx=m({"src/traces/densitymap/index.js"(e,t){t.exports={attributes:Nd(),supplyDefaults:Nf(),colorbar:ol(),formatLabels:vt(),calc:Np(),plot:Ng(),hoverPoints:Ny(),eventData:Nv(),getBelow:function(e,t){for(var r=t.getMapLayers(),i=0;in.addOpacity(y[t%y.length],.8))),g("customdata");var v=e.link||{},x=s.newContainer(t,"link");function b(e,t){return r.coerce(v,x,i.link,e,t)}b("label"),b("arrowlen"),b("source"),b("target"),b("value"),b("line.color"),b("line.width"),b("hoverinfo",e.hoverinfo),o(v,x,b,f),b("hovertemplate"),b("sort");var _=.333>n.luminosity(h.paper_bgcolor),w=b("color",_?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function T(e){if(!n.isValid(e))return e;let t=n.opacity(e);return t<=.8?n.addOpacity(e,t+.2):_?n.brighten(e,10):n.adjustLightness(e,-10)}b("hovercolor",Array.isArray(w)?w.map(T):T(w)),b("customdata"),l(v,x,{name:"colorscales",handleItemDefaults:u}),a(t,h,d),d("orientation"),d("direction"),d("valueformat"),d("valuesuffix"),d("arrangement",m.x.length&&m.y.length?"freeform":void 0),r.coerceFont(d,"textfont",h.font,{autoShadowDflt:!0}),t._length=null}}}),NT=m({"node_modules/strongly-connected-components/scc.js"(e,t){t.exports=function(e){for(var t=e.length,r=Array(t),i=Array(t),n=Array(t),a=Array(t),o=Array(t),s=Array(t),l=0;l0;){var f=e[t=d[d.length-1]];if(a[t]=0&&s[t].push(o[m])}a[t]=p}else{if(i[t]===r[t]){for(var g=[],y=[],v=0,p=l.length-1;p>=0;--p){var x=l[p];if(n[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=c.length,x===t){l.length=p;break}}c.push(g);for(var b=Array(v),p=0;px&&(x=l.source[t]),l.target[t]>x&&(x=l.target[t]);var b=x+1;e.node._count=b;var _,w=e.node.groups,T={};for(t=0;t0&&o(C,b)&&o(I,b)&&!(T.hasOwnProperty(C)&&T.hasOwnProperty(I)&&T[C]===T[I])){T.hasOwnProperty(I)&&(I=T[I]),T.hasOwnProperty(C)&&(C=T[C]),I*=1,f[C*=1]=f[I]=!0;var L="";l.label&&l.label[t]&&(L=l.label[t]);var P=null;L&&p.hasOwnProperty(L)&&(P=p[L]),u.push({pointNumber:t,label:L,color:c?l.color[t]:l.color,hovercolor:h?l.hovercolor[t]:l.hovercolor,customdata:d?l.customdata[t]:l.customdata,concentrationscale:P,source:C,target:I,value:+D}),S.push(C),E.push(I)}}var z=b+w.length,F=a(n.color),O=a(n.customdata),R=[];for(t=0;tb-1,childrenNodes:[],pointNumber:t,label:B,color:F?n.color[t]:n.color,customdata:O?n.customdata[t]:n.customdata})}var j=!1;return function(e,t,n){for(var a=i.init2dArray(e,0),o=0;o1})}(z,S,E)&&(j=!0),{circular:j,links:u,nodes:R,groups:w,groupLookup:T}}(t);return n({circular:l.circular,_nodes:l.nodes,_links:l.links,_groups:l.groups,_groupLookup:l.groupLookup})}}}),NM=m({"node_modules/d3-quadtree/dist/d3-quadtree.js"(e,t){var r;r=e,function(e){function t(e,t,r,i){if(isNaN(t)||isNaN(r))return e;var n,a,o,s,l,u,c,h,d,f=e._root,p={data:i},m=e._x0,g=e._y0,y=e._x1,v=e._y1;if(!f)return e._root=p,e;for(;f.length;)if((u=t>=(a=(m+y)/2))?m=a:y=a,(c=r>=(o=(g+v)/2))?g=o:v=o,n=f,!(f=f[h=c<<1|u]))return n[h]=p,e;if(s=+e._x.call(null,f.data),l=+e._y.call(null,f.data),t===s&&r===l)return p.next=f,n?n[h]=p:e._root=p,e;do n=n?n[h]=[,,,,]:e._root=[,,,,],(u=t>=(a=(m+y)/2))?m=a:y=a,(c=r>=(o=(g+v)/2))?g=o:v=o;while((h=c<<1|u)==(d=(l>=o)<<1|s>=a));return n[d]=f,n[h]=p,e}function r(e,t,r,i,n){this.node=e,this.x0=t,this.y0=r,this.x1=i,this.y1=n}function i(e){return e[0]}function n(e){return e[1]}function a(e,t,r){var a=new o(t??i,r??n,0/0,0/0,0/0,0/0);return null==e?a:a.addAll(e)}function o(e,t,r,i,n,a){this._x=e,this._y=t,this._x0=r,this._y0=i,this._x1=n,this._y1=a,this._root=void 0}function s(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var l=a.prototype=o.prototype;l.copy=function(){var e,t,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return r;if(!i.length)return r._root=s(i),r;for(e=[{source:i,target:r._root=[,,,,]}];i=e.pop();)for(var n=0;n<4;++n)(t=i.source[n])&&(t.length?e.push({source:t,target:i.target[n]=[,,,,]}):i.target[n]=s(t));return r},l.add=function(e){var r=+this._x.call(null,e),i=+this._y.call(null,e);return t(this.cover(r,i),r,i,e)},l.addAll=function(e){var r,i,n,a,o=e.length,s=Array(o),l=Array(o),u=1/0,c=1/0,h=-1/0,d=-1/0;for(i=0;ih&&(h=n),ad&&(d=a));if(u>h||c>d)return this;for(this.cover(u,c).cover(h,d),i=0;ie||e>=n||i>t||t>=a;)switch((o=[,,,,])[s=(tf||(o=u.y0)>p||(s=u.x1)=v)<<1|e>=y)&&(u=m[m.length-1],m[m.length-1]=m[m.length-1-c],m[m.length-1-c]=u)}else{var x=e-this._x.call(null,g.data),b=t-this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(p+g)/2))?p=s:g=s,(c=o>=(l=(m+y)/2))?m=l:y=l,t=f,!(f=f[h=c<<1|u]))return this;if(!f.length)break;(t[h+1&3]||t[h+2&3]||t[h+3&3])&&(r=t,d=h)}for(;f.data!==e;)if(i=f,!(f=f.next))return this;return(n=f.next)&&delete f.next,i?n?i.next=n:delete i.next:t?(n?t[h]=n:delete t[h],(f=t[0]||t[1]||t[2]||t[3])&&f===(t[3]||t[2]||t[1]||t[0])&&!f.length&&(r?r[d]=f:this._root=f)):this._root=n,this},l.removeAll=function(e){for(var t=0,r=e.length;ttypeof t?e:(r=r||self).d3=r.d3||{})}}),Nk=m({"node_modules/d3-collection/dist/d3-collection.js"(e,t){(function(e){function t(){}function r(e,r){var i=new t;if(e instanceof t)e.each(function(e,t){i.set(t,e)});else if(Array.isArray(e)){var n,a=-1,o=e.length;if(null==r)for(;++a=l.length)return null!=e&&i.sort(e),null!=t?t(i):i;for(var s,u,h,d=-1,f=i.length,p=l[n++],m=r(),g=a();++dl.length)return r;var n,a=u[i-1];return null!=t&&i>=l.length?n=r.entries():(n=[],r.each(function(t,r){n.push({key:r,values:e(t,i)})})),null!=a?n.sort(function(e,t){return a(e.key,t.key)}):n}(c(e,0,a,o),0)},key:function(e){return l.push(e),s},sortKeys:function(e){return u[l.length-1]=e,s},sortValues:function(t){return e=t,s},rollup:function(e){return t=e,s}}},e.set=u,e.map=r,e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},Object.defineProperty(e,"__esModule",{value:!0})})("object"==typeof e&&"u">typeof t?e:e.d3=e.d3||{})}}),NS=m({"node_modules/d3-dispatch/dist/d3-dispatch.js"(e,t){var r;r=e,function(e){var t={value:function(){}};function r(){for(var e,t=0,r=arguments.length,n={};t=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!i.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),o=-1,s=a.length;if(arguments.length<2){for(;++o0)for(var r,i,n=Array(r),a=0;atypeof t?e:(r=r||self).d3=r.d3||{})}}),NE=m({"node_modules/d3-timer/dist/d3-timer.js"(e,t){var r;r=e,function(e){var t,r,i=0,n=0,a=0,o=0,s=0,l=0,u="object"==typeof performance&&performance.now?performance:Date,c="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function h(){return s||(c(d),s=u.now()+l)}function d(){s=0}function f(){this._call=this._time=this._next=null}function p(e,t,r){var i=new f;return i.restart(e,t,r),i}function m(){h(),++i;for(var e,r=t;r;)(e=s-r._time)>=0&&r._call.call(null,e),r=r._next;--i}function g(){s=(o=u.now())+l,i=n=0;try{m()}finally{i=0,function(){for(var e,i,n=t,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:t=i);r=e,v(a)}(),s=0}}function y(){var e=u.now(),t=e-o;t>1e3&&(l-=t,o=e)}function v(e){!i&&(n&&(n=clearTimeout(n)),e-s>24?(e<1/0&&(n=setTimeout(g,e-u.now()-l)),a&&(a=clearInterval(a))):(a||(o=u.now(),a=setInterval(y,1e3)),i=1,c(g)))}f.prototype=p.prototype={constructor:f,restart:function(e,i,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?h():+n)+(null==i?0:+i),this._next||r===this||(r?r._next=this:t=this,r=this),this._call=e,this._time=n,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},e.interval=function(e,t,r){var i=new f,n=t;return null==t?i.restart(e,t,r):(t*=1,r=null==r?h():+r,i.restart(function a(o){o+=n,i.restart(a,n+=t,r),e(o)},t,r)),i},e.now=h,e.timeout=function(e,t,r){var i=new f;return t=null==t?0:+t,i.restart(function(r){i.stop(),e(r+t)},t,r),i},e.timer=p,e.timerFlush=m,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof e&&"u">typeof t?e:(r=r||self).d3=r.d3||{})}}),ND=m({"node_modules/d3-force/dist/d3-force.js"(e,t){var r;r=function(e,t,r,i,n){function a(e){return function(){return e}}function o(){return(Math.random()-.5)*1e-6}function s(e){return e.x+e.vx}function l(e){return e.y+e.vy}function u(e){return e.index}function c(e,t){var r=e.get(t);if(!r)throw Error("missing: "+t);return r}function h(e){return e.x}function d(e){return e.y}var f=Math.PI*(3-Math.sqrt(5));e.forceCenter=function(e,t){var r;function i(){var i,n,a=r.length,o=0,s=0;for(i=0;ic.index){var h=d-s.x-s.vx,g=f-s.y-s.vy,y=h*h+g*g;yd+u||if+u||ae.r&&(e.r=e[t].r)}function d(){if(r){var t,n,a=r.length;for(i=Array(a),t=0;t=u)){(e.data!==r||e.next)&&(0===h&&(p+=(h=o())*h),0===d&&(p+=(d=o())*d),p1?(null==r?c.remove(e):c.set(e,y(r)),t):c.get(e)},find:function(t,r,i){var n,a,o,s,l,u=0,c=e.length;for(null==i?i=1/0:i*=i,u=0;u1?(d.on(e,r),t):d.on(e)}}},e.forceX=function(e){var t,r,i,n=a(.1);function o(e){for(var n,a=0,o=t.length;atypeof t?r(e,NM(),Nk(),NS(),NE()):r(e.d3=e.d3||{},e.d3,e.d3,e.d3,e.d3)}}),NC=m({"node_modules/d3-array/dist/d3-array.js"(e,t){var r;r=e,function(e){function t(e,t){return et?1:e>=t?0:0/0}function r(e){var r;let i=e,n=e;function a(e,t,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;0>n(e[a],t)?r=a+1:i=a}return r}return 1===e.length&&(i=(t,r)=>e(t)-r,r=e,n=(e,i)=>t(r(e),i)),{left:a,center:function(e,t,r,n){null==r&&(r=0),null==n&&(n=e.length);let o=a(e,t,r,n-1);return o>r&&i(e[o-1],t)>-i(e[o],t)?o-1:o},right:function(e,t,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;n(e[a],t)>0?i=a:r=a+1}return r}}}function i(e){return null===e?0/0:+e}let n=r(t),a=n.right,o=n.left,s=r(i).center;function l(e,t){let r=0;if(void 0===t)for(let t of e)null!=t&&(t*=1)>=t&&++r;else{let i=-1;for(let n of e)null!=(n=t(n,++i,e))&&(n*=1)>=n&&++r}return r}function u(e){return 0|e.length}function c(e){return!(e>0)}function h(e){return"object"!=typeof e||"length"in e?e:Array.from(e)}function d(e,t){let r=0,i,n=0,a=0;if(void 0===t)for(let t of e)null!=t&&(t*=1)>=t&&(i=t-n,n+=i/++r,a+=i*(t-n));else{let o=-1;for(let s of e)null!=(s=t(s,++o,e))&&(s*=1)>=s&&(i=s-n,n+=i/++r,a+=i*(s-n))}if(r>1)return a/(r-1)}function f(e,t){let r=d(e,t);return r&&Math.sqrt(r)}function p(e,t){let r,i;if(void 0===t)for(let t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i=a&&(r=i=a):(r>a&&(r=a),i0){for(a=e[--t];t>0&&(a=(r=a)+(i=e[--t]),!(n=i-(a-r))););t>0&&(n<0&&e[t-1]<0||n>0&&e[t-1]>0)&&(r=a+(i=2*n),i==r-a&&(a=r))}return a}}class g extends Map{constructor(e,t=_){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(let[t,r]of e)this.set(t,r)}get(e){return super.get(v(this,e))}has(e){return super.has(v(this,e))}set(e,t){return super.set(x(this,e),t)}delete(e){return super.delete(b(this,e))}}class y extends Set{constructor(e,t=_){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(let t of e)this.add(t)}has(e){return super.has(v(this,e))}add(e){return super.add(x(this,e))}delete(e){return super.delete(b(this,e))}}function v({_intern:e,_key:t},r){let i=t(r);return e.has(i)?e.get(i):r}function x({_intern:e,_key:t},r){let i=t(r);return e.has(i)?e.get(i):(e.set(i,r),r)}function b({_intern:e,_key:t},r){let i=t(r);return e.has(i)&&(r=e.get(r),e.delete(i)),r}function _(e){return null!==e&&"object"==typeof e?e.valueOf():e}function T(e){return e}function A(e,...t){return S(e,T,T,t)}function M(e,t,...r){return S(e,T,t,r)}function k(e){if(1!==e.length)throw Error("duplicate key");return e[0]}function S(e,t,r,i){return function e(n,a){if(a>=i.length)return r(n);let o=new g,s=i[a++],l=-1;for(let e of n){let t=s(e,++l,n),r=o.get(t);r?r.push(e):o.set(t,[e])}for(let[t,r]of o)o.set(t,e(r,a));return t(o)}(e,0)}function E(e,t){return Array.from(t,t=>e[t])}function D(e,...r){if("function"!=typeof e[Symbol.iterator])throw TypeError("values is not iterable");e=Array.from(e);let[i=t]=r;if(1===i.length||r.length>1){let n=Uint32Array.from(e,(e,t)=>t);return r.length>1?(r=r.map(t=>e.map(t)),n.sort((e,i)=>{for(let n of r){let r=t(n[e],n[i]);if(r)return r}})):(i=e.map(i),n.sort((e,r)=>t(i[e],i[r]))),E(e,n)}return e.sort(i)}var C=Array.prototype.slice;function I(e){return function(){return e}}var L=Math.sqrt(50),P=Math.sqrt(10),z=Math.sqrt(2);function F(e,t,r){var i,n,a,o,s=-1;if(r*=1,(e*=1)==(t*=1)&&r>0)return[e];if((i=t0){let r=Math.round(e/o),i=Math.round(t/o);for(r*ot&&--i,a=Array(n=i-r+1);++st&&--i,a=Array(n=i-r+1);++s=0?(a>=L?10:a>=P?5:a>=z?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=L?10:a>=P?5:a>=z?2:1)}function R(e,t,r){let i;for(;;){let n=O(e,t,r);if(n===i||0===n||!isFinite(n))return[e,t];n>0?(e=Math.floor(e/n)*n,t=Math.ceil(t/n)*n):n<0&&(e=Math.ceil(e*n)/n,t=Math.floor(t*n)/n),i=n}}function B(e){return Math.ceil(Math.log(l(e))/Math.LN2)+1}function j(){var e=T,t=p,r=B;function i(i){Array.isArray(i)||(i=Array.from(i));var n,o,s=i.length,l=Array(s);for(n=0;n=h)if(e>=h&&t===p){let e=O(c,h,r);isFinite(e)&&(e>0?h=(Math.floor(h/e)+1)*e:e<0&&(h=-((Math.ceil(-(h*e))+1)/e)))}else d.pop()}for(var f=d.length;d[0]<=c;)d.shift(),--f;for(;d[f-1]>h;)d.pop(),--f;var m,g=Array(f+1);for(n=0;n<=f;++n)(m=g[n]=[]).x0=n>0?d[n-1]:c,m.x1=n=t)&&(r=t);else{let i=-1;for(let n of e)null!=(n=t(n,++i,e))&&(r=n)&&(r=n)}return r}function V(e,t){let r;if(void 0===t)for(let t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let i=-1;for(let n of e)null!=(n=t(n,++i,e))&&(r>n||void 0===r&&n>=n)&&(r=n)}return r}function U(e,r,i=0,n=e.length-1,a=t){for(;n>i;){if(n-i>600){let t=n-i+1,o=r-i+1,s=Math.log(t),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(t-l)/t)*(o-t/2<0?-1:1),c=Math.max(i,Math.floor(r-o*l/t+u)),h=Math.min(n,Math.floor(r+(t-o)*l/t+u));U(e,r,c,h,a)}let t=e[r],o=i,s=n;for(q(e,i,r),a(e[n],t)>0&&q(e,i,n);oa(e[o],t);)++o;for(;a(e[s],t)>0;)--s}0===a(e[i],t)?q(e,i,s):q(e,++s,n),s<=r&&(i=s+1),r<=s&&(n=s-1)}return e}function q(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function G(e,t,r){if(i=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t*=1)>=t&&(yield t);else{let r=-1;for(let i of e)null!=(i=t(i,++r,e))&&(i*=1)>=i&&(yield i)}}(e,r))).length){if((t*=1)<=0||i<2)return V(e);if(t>=1)return N(e);var i,n=(i-1)*t,a=Math.floor(n),o=N(U(e,a).subarray(0,a+1));return o+(V(e.subarray(a+1))-o)*(n-a)}}function H(e,t){let r,i=-1,n=-1;if(void 0===t)for(let t of e)++n,null!=t&&(r=t)&&(r=t,i=n);else for(let a of e)null!=(a=t(a,++n,e))&&(r=a)&&(r=a,i=n);return i}function $(e,t){let r,i=-1,n=-1;if(void 0===t)for(let t of e)++n,null!=t&&(r>t||void 0===r&&t>=t)&&(r=t,i=n);else for(let a of e)null!=(a=t(a,++n,e))&&(r>a||void 0===r&&a>=a)&&(r=a,i=n);return i}function W(e,t){return[e,t]}function Y(e,r=t){if(1===r.length)return $(e,r);let i,n=-1,a=-1;for(let t of e)++a,(n<0?0===r(t,t):0>r(t,i))&&(i=t,n=a);return n}var Z=X(Math.random);function X(e){return function(t,r=0,i=t.length){let n=i-(r*=1);for(;n;){let i=e()*n--|0,a=t[n+r];t[n+r]=t[i+r],t[i+r]=a}return t}}function K(e){if(!(n=e.length))return[];for(var t=-1,r=V(e,J),i=Array(r);++tt(...e)),i=(e=e.map(h)).map(u),n=e.length-1,a=Array(n+1).fill(0),o=[];if(n<0||i.some(c))return o;for(;;){o.push(a.map((t,r)=>e[r][t]));let t=n;for(;++a[t]===i[t];){if(0===t)return r?o.map(r):o;a[t--]=0}}},e.cumsum=function(e,t){var r=0,i=0;return Float64Array.from(e,void 0===t?e=>r+=+e||0:n=>r+=+t(n,i++,e)||0)},e.descending=function(e,t){return te?1:t>=e?0:0/0},e.deviation=f,e.difference=function(e,...t){for(let r of(e=new Set(e),t))for(let t of r)e.delete(t);return e},e.disjoint=function(e,t){let r=t[Symbol.iterator](),i=new Set;for(let t of e){let e,n;if(i.has(t))return!1;for(;({value:e,done:n}=r.next())&&!n;){if(Object.is(t,e))return!1;i.add(e)}}return!0},e.every=function(e,t){if("function"!=typeof t)throw TypeError("test is not a function");let r=-1;for(let i of e)if(!t(i,++r,e))return!1;return!0},e.extent=p,e.fcumsum=function(e,t){let r=new m,i=-1;return Float64Array.from(e,void 0===t?e=>r.add(+e||0):n=>r.add(+t(n,++i,e)||0))},e.filter=function(e,t){if("function"!=typeof t)throw TypeError("test is not a function");let r=[],i=-1;for(let n of e)t(n,++i,e)&&r.push(n);return r},e.fsum=function(e,t){let r=new m;if(void 0===t)for(let t of e)(t*=1)&&r.add(t);else{let i=-1;for(let n of e)(n=+t(n,++i,e))&&r.add(n)}return+r},e.greatest=function(e,r=t){let i,n=!1;if(1===r.length){let a;for(let o of e){let e=r(o);(n?t(e,a)>0:0===t(e,e))&&(i=o,a=e,n=!0)}}else for(let t of e)(n?r(t,i)>0:0===r(t,t))&&(i=t,n=!0);return i},e.greatestIndex=function(e,r=t){if(1===r.length)return H(e,r);let i,n=-1,a=-1;for(let t of e)++a,(n<0?0===r(t,t):r(t,i)>0)&&(i=t,n=a);return n},e.group=A,e.groupSort=function(e,r,i){return(1===r.length?D(M(e,r,i),([e,r],[i,n])=>t(r,n)||t(e,i)):D(A(e,i),([e,i],[n,a])=>r(i,a)||t(e,n))).map(([e])=>e)},e.groups=function(e,...t){return S(e,Array.from,T,t)},e.histogram=j,e.index=function(e,...t){return S(e,T,k,t)},e.indexes=function(e,...t){return S(e,Array.from,k,t)},e.intersection=function(e,...t){e=new Set(e),t=t.map(Q);e:for(let r of e)for(let i of t)if(!i.has(r)){e.delete(r);continue e}return e},e.least=function(e,r=t){let i,n=!1;if(1===r.length){let a;for(let o of e){let e=r(o);(n?0>t(e,a):0===t(e,e))&&(i=o,a=e,n=!0)}}else for(let t of e)(n?0>r(t,i):0===r(t,t))&&(i=t,n=!0);return i},e.leastIndex=Y,e.map=function(e,t){if("function"!=typeof e[Symbol.iterator])throw TypeError("values is not iterable");if("function"!=typeof t)throw TypeError("mapper is not a function");return Array.from(e,(r,i)=>t(r,i,e))},e.max=N,e.maxIndex=H,e.mean=function(e,t){let r=0,i=0;if(void 0===t)for(let t of e)null!=t&&(t*=1)>=t&&(++r,i+=t);else{let n=-1;for(let a of e)null!=(a=t(a,++n,e))&&(a*=1)>=a&&(++r,i+=a)}if(r)return i/r},e.median=function(e,t){return G(e,.5,t)},e.merge=function(e){return Array.from(function*(e){for(let t of e)yield*w(t)}(e))},e.min=V,e.minIndex=$,e.nice=R,e.pairs=function(e,t=W){let r=[],i,n=!1;for(let a of e)n&&r.push(t(i,a)),i=a,n=!0;return r},e.permute=E,e.quantile=G,e.quantileSorted=function(e,t,r=i){if(n=e.length){if((t*=1)<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,o=Math.floor(a),s=+r(e[o],o,e);return s+(r(e[o+1],o+1,e)-s)*(a-o)}},e.quickselect=U,e.range=function(e,t,r){e*=1,t*=1,r=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+r;for(var i=-1,n=0|Math.max(0,Math.ceil((t-e)/r)),a=Array(n);++i=L?n*=10:a>=P?n*=5:a>=z&&(n*=2),ttypeof t?e:(r="u">typeof globalThis?globalThis:r||self).d3=r.d3||{})}}),NI=m({"node_modules/d3-path/dist/d3-path.js"(e,t){var r;r=e,function(e){var t=Math.PI,r=2*t,i=r-1e-6;function n(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function a(){return new n}n.prototype=a.prototype={constructor:n,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+i)},bezierCurveTo:function(e,t,r,i,n,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +i+","+(this._x1=+n)+","+(this._y1=+a)},arcTo:function(e,r,i,n,a){e*=1,r*=1,i*=1,n*=1,a*=1;var o=this._x1,s=this._y1,l=i-e,u=n-r,c=o-e,h=s-r,d=c*c+h*h;if(a<0)throw Error("negative radius: "+a);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=r);else if(d>1e-6)if(Math.abs(h*l-u*c)>1e-6&&a){var f=i-o,p=n-s,m=l*l+u*u,g=Math.sqrt(m),y=Math.sqrt(d),v=a*Math.tan((t-Math.acos((m+d-(f*f+p*p))/(2*g*y)))/2),x=v/y,b=v/g;Math.abs(x-1)>1e-6&&(this._+="L"+(e+x*c)+","+(r+x*h)),this._+="A"+a+","+a+",0,0,"+ +(h*f>c*p)+","+(this._x1=e+b*l)+","+(this._y1=r+b*u)}else this._+="L"+(this._x1=e)+","+(this._y1=r)},arc:function(e,n,a,o,s,l){e*=1,n*=1,a*=1,l=!!l;var u=a*Math.cos(o),c=a*Math.sin(o),h=e+u,d=n+c,f=1^l,p=l?o-s:s-o;if(a<0)throw Error("negative radius: "+a);null===this._x1?this._+="M"+h+","+d:(Math.abs(this._x1-h)>1e-6||Math.abs(this._y1-d)>1e-6)&&(this._+="L"+h+","+d),a&&(p<0&&(p=p%r+r),p>i?this._+="A"+a+","+a+",0,1,"+f+","+(e-u)+","+(n-c)+"A"+a+","+a+",0,1,"+f+","+(this._x1=h)+","+(this._y1=d):p>1e-6&&(this._+="A"+a+","+a+",0,"+ +(p>=t)+","+f+","+(this._x1=e+a*Math.cos(s))+","+(this._y1=n+a*Math.sin(s))))},rect:function(e,t,r,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +i+"h"+-r+"Z"},toString:function(){return this._}},e.path=a,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof e&&"u">typeof t?e:(r=r||self).d3=r.d3||{})}}),NL=m({"node_modules/d3-shape/dist/d3-shape.js"(e,t){var r,i;r=e,i=function(e,t){function r(e){return function(){return e}}var i=Math.abs,n=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,u=Math.sqrt,c=Math.PI,h=c/2,d=2*c;function f(e){return e>=1?h:e<=-1?-h:Math.asin(e)}function p(e){return e.innerRadius}function m(e){return e.outerRadius}function g(e){return e.startAngle}function y(e){return e.endAngle}function v(e){return e&&e.padAngle}function x(e,t,r,i,n,a,s){var l=e-r,c=t-i,h=(s?a:-a)/u(l*l+c*c),d=h*c,f=-h*l,p=e+d,m=t+f,g=r+d,y=i+f,v=(p+g)/2,x=(m+y)/2,b=g-p,_=y-m,w=b*b+_*_,T=n-a,A=p*y-g*m,M=(_<0?-1:1)*u(o(0,T*T*w-A*A)),k=(A*_-b*M)/w,S=(-A*b-_*M)/w,E=(A*_+b*M)/w,D=(-A*b+_*M)/w,C=k-v,I=S-x,L=E-v,P=D-x;return C*C+I*I>L*L+P*P&&(k=E,S=D),{cx:k,cy:S,x01:-d,y01:-f,x11:k*(n/T-1),y11:S*(n/T-1)}}function b(e){this._context=e}function _(e){return new b(e)}function w(e){return e[0]}function T(e){return e[1]}function A(){var e=w,i=T,n=r(!0),a=null,o=_,s=null;function l(r){var l,u,c,h=r.length,d=!1;for(null==a&&(s=o(c=t.path())),l=0;l<=h;++l)!(l=h;--d)u.point(y[d],v[d]);u.lineEnd(),u.areaEnd()}g&&(y[c]=+e(f,c,r),v[c]=+n(f,c,r),u.point(i?+i(f,c,r):y[c],a?+a(f,c,r):v[c]))}if(p)return u=null,p+""||null}function h(){return A().defined(o).curve(l).context(s)}return c.x=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),i=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),c):e},c.x1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:r(+e),c):i},c.y=function(e){return arguments.length?(n="function"==typeof e?e:r(+e),a=null,c):n},c.y0=function(e){return arguments.length?(n="function"==typeof e?e:r(+e),c):n},c.y1=function(e){return arguments.length?(a=null==e?null:"function"==typeof e?e:r(+e),c):a},c.lineX0=c.lineY0=function(){return h().x(e).y(n)},c.lineY1=function(){return h().x(e).y(a)},c.lineX1=function(){return h().x(i).y(n)},c.defined=function(e){return arguments.length?(o="function"==typeof e?e:r(!!e),c):o},c.curve=function(e){return arguments.length?(l=e,null!=s&&(u=l(s)),c):l},c.context=function(e){return arguments.length?(null==e?s=u=null:u=l(s=e),c):s},c}function k(e,t){return te?1:t>=e?0:0/0}function S(e){return e}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var E=C(_);function D(e){this._curve=e}function C(e){function t(t){return new D(e(t))}return t._curve=e,t}function I(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(C(e)):t()._curve},e}function L(){return I(A().curve(E))}function P(){var e=M().curve(E),t=e.curve,r=e.lineX0,i=e.lineX1,n=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return I(r())},delete e.lineX0,e.lineEndAngle=function(){return I(i())},delete e.lineX1,e.lineInnerRadius=function(){return I(n())},delete e.lineY0,e.lineOuterRadius=function(){return I(a())},delete e.lineY1,e.curve=function(e){return arguments.length?t(C(e)):t()._curve},e}function z(e,t){return[(t*=1)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}D.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),-(t*Math.cos(e)))}};var F=Array.prototype.slice;function O(e){return e.source}function R(e){return e.target}function B(e){var i=O,n=R,a=w,o=T,s=null;function l(){var r,l=F.call(arguments),u=i.apply(this,l),c=n.apply(this,l);if(s||(s=r=t.path()),e(s,+a.apply(this,(l[0]=u,l)),+o.apply(this,l),+a.apply(this,(l[0]=c,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(e){return arguments.length?(i=e,l):i},l.target=function(e){return arguments.length?(n=e,l):n},l.x=function(e){return arguments.length?(a="function"==typeof e?e:r(+e),l):a},l.y=function(e){return arguments.length?(o="function"==typeof e?e:r(+e),l):o},l.context=function(e){return arguments.length?(s=e??null,l):s},l}function j(e,t,r,i,n){e.moveTo(t,r),e.bezierCurveTo(t=(t+i)/2,r,t,n,i,n)}function N(e,t,r,i,n){e.moveTo(t,r),e.bezierCurveTo(t,r=(r+n)/2,i,r,i,n)}function V(e,t,r,i,n){var a=z(t,r),o=z(t,r=(r+n)/2),s=z(i,r),l=z(i,n);e.moveTo(a[0],a[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var U={draw:function(e,t){var r=Math.sqrt(t/c);e.moveTo(r,0),e.arc(0,0,r,0,d)}},q={draw:function(e,t){var r=Math.sqrt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},G=Math.sqrt(1/3),H=2*G,$={draw:function(e,t){var r=Math.sqrt(t/H),i=r*G;e.moveTo(0,-r),e.lineTo(i,0),e.lineTo(0,r),e.lineTo(-i,0),e.closePath()}},W=Math.sin(c/10)/Math.sin(7*c/10),Y=Math.sin(d/10)*W,Z=-Math.cos(d/10)*W,X={draw:function(e,t){var r=Math.sqrt(.8908130915292852*t),i=Y*r,n=Z*r;e.moveTo(0,-r),e.lineTo(i,n);for(var a=1;a<5;++a){var o=d*a/5,s=Math.cos(o),l=Math.sin(o);e.lineTo(l*r,-s*r),e.lineTo(s*i-l*n,l*i+s*n)}e.closePath()}},K={draw:function(e,t){var r=Math.sqrt(t),i=-r/2;e.rect(i,i,r,r)}},J=Math.sqrt(3),Q={draw:function(e,t){var r=-Math.sqrt(t/(3*J));e.moveTo(0,2*r),e.lineTo(-J*r,-r),e.lineTo(J*r,-r),e.closePath()}},ee=Math.sqrt(3)/2,et=1/Math.sqrt(12),er=(et/2+1)*3,ei={draw:function(e,t){var r=Math.sqrt(t/er),i=r/2,n=r*et,a=r*et+r,o=-i;e.moveTo(i,n),e.lineTo(i,a),e.lineTo(o,a),e.lineTo(-.5*i-ee*n,ee*i+-.5*n),e.lineTo(-.5*i-ee*a,ee*i+-.5*a),e.lineTo(-.5*o-ee*a,ee*o+-.5*a),e.lineTo(-.5*i+ee*n,-.5*n-ee*i),e.lineTo(-.5*i+ee*a,-.5*a-ee*i),e.lineTo(-.5*o+ee*a,-.5*a-ee*o),e.closePath()}},en=[U,q,$,K,X,Q,ei];function ea(){}function eo(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function es(e){this._context=e}function el(e){this._context=e}function eu(e){this._context=e}function ec(e,t){this._basis=new es(e),this._beta=t}es.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._y0=this._y1=0/0,this._point=0},lineEnd:function(){switch(this._point){case 3:eo(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:eo(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},el.prototype={areaStart:ea,areaEnd:ea,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=0/0,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:eo(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},eu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._y0=this._y1=0/0,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:eo(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},ec.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i,n=e[0],a=t[0],o=e[r]-n,s=t[r]-a,l=-1;++l<=r;)i=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(n+i*o),this._beta*t[l]+(1-this._beta)*(a+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var eh=function e(t){function r(e){return 1===t?new es(e):new ec(e,t)}return r.beta=function(t){return e(+t)},r}(.85);function ed(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function ef(e,t){this._context=e,this._k=(1-t)/6}ef.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=0/0,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ed(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ed(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ep=function e(t){function r(e){return new ef(e,t)}return r.tension=function(t){return e(+t)},r}(0);function em(e,t){this._context=e,this._k=(1-t)/6}em.prototype={areaStart:ea,areaEnd:ea,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=0/0,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ed(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var eg=function e(t){function r(e){return new em(e,t)}return r.tension=function(t){return e(+t)},r}(0);function ey(e,t){this._context=e,this._k=(1-t)/6}ey.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=0/0,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ed(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ev=function e(t){function r(e){return new ey(e,t)}return r.tension=function(t){return e(+t)},r}(0);function ex(e,t,r){var i=e._x1,n=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,n=(n*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>1e-12){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*u+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*u+e._y1*e._l23_2a-r*e._l12_2a)/c}e._context.bezierCurveTo(i,n,a,o,e._x2,e._y2)}function eb(e,t){this._context=e,this._alpha=t}eb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=0/0,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e*=1,t*=1,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:ex(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var e_=function e(t){function r(e){return t?new eb(e,t):new ef(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function ew(e,t){this._context=e,this._alpha=t}ew.prototype={areaStart:ea,areaEnd:ea,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=0/0,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e*=1,t*=1,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ex(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var eT=function e(t){function r(e){return t?new ew(e,t):new em(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function eA(e,t){this._context=e,this._alpha=t}eA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=0/0},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=0/0,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e*=1,t*=1,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ex(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var eM=function e(t){function r(e){return t?new eA(e,t):new ey(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function ek(e){this._context=e}ek.prototype={areaStart:ea,areaEnd:ea,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e*=1,t*=1,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function eS(e,t,r){var i=e._x1-e._x0,n=t-e._x1,a=(e._y1-e._y0)/(i||n<0&&-0),o=(r-e._y1)/(n||i<0&&-0);return((a<0?-1:1)+(o<0?-1:1))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs((a*n+o*i)/(i+n)))||0}function eE(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function eD(e,t,r){var i=e._x0,n=e._y0,a=e._x1,o=e._y1,s=(a-i)/3;e._context.bezierCurveTo(i+s,n+s*t,a-s,o-s*r,a,o)}function eC(e){this._context=e}function eI(e){this._context=new eL(e)}function eL(e){this._context=e}function eP(e){this._context=e}function ez(e){var t,r,i=e.length-1,n=Array(i),a=Array(i),o=Array(i);for(n[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)n[t]=(o[t]-n[t+1])/a[t];for(a[i-1]=(e[i]+n[i-1])/2,t=0;t1)for(var r,i,n,a=1,o=e[t[0]],s=o.length;a=0;)r[t]=t;return r}function eB(e,t){return e[t]}function ej(e){var t=e.map(eN);return eR(e).sort(function(e,r){return t[e]-t[r]})}function eN(e){for(var t,r=-1,i=0,n=e.length,a=-1/0;++ra&&(a=t,i=r);return i}function eV(e){var t=e.map(eU);return eR(e).sort(function(e,r){return t[e]-t[r]})}function eU(e){for(var t,r=0,i=-1,n=e.length;++i=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}},e.arc=function(){var e=p,o=m,b=r(0),_=null,w=g,T=y,A=v,M=null;function k(){var r,p,m=+e.apply(this,arguments),g=+o.apply(this,arguments),y=w.apply(this,arguments)-h,v=T.apply(this,arguments)-h,k=i(v-y),S=v>y;if(M||(M=r=t.path()),g1e-12)if(k>d-1e-12)M.moveTo(g*a(y),g*l(y)),M.arc(0,0,g,y,v,!S),m>1e-12&&(M.moveTo(m*a(v),m*l(v)),M.arc(0,0,m,v,y,S));else{var E,D,C=y,I=v,L=y,P=v,z=k,F=k,O=A.apply(this,arguments)/2,R=O>1e-12&&(_?+_.apply(this,arguments):u(m*m+g*g)),B=s(i(g-m)/2,+b.apply(this,arguments)),j=B,N=B;if(R>1e-12){var V=f(R/m*l(O)),U=f(R/g*l(O));(z-=2*V)>1e-12?(V*=S?1:-1,L+=V,P-=V):(z=0,L=P=(y+v)/2),(F-=2*U)>1e-12?(U*=S?1:-1,C+=U,I-=U):(F=0,C=I=(y+v)/2)}var q=g*a(C),G=g*l(C),H=m*a(P),$=m*l(P);if(B>1e-12){var W,Y=g*a(I),Z=g*l(I),X=m*a(L),K=m*l(L);if(k1?0:J<-1?c:Math.acos(J))/2),en=u(W[0]*W[0]+W[1]*W[1]);j=s(B,(m-en)/(ei-1)),N=s(B,(g-en)/(ei+1))}}F>1e-12?N>1e-12?(E=x(X,K,q,G,g,N,S),D=x(Y,Z,H,$,g,N,S),M.moveTo(E.cx+E.x01,E.cy+E.y01),N1e-12&&z>1e-12?j>1e-12?(E=x(H,$,Y,Z,m,-j,S),D=x(q,G,X,K,m,-j,S),M.lineTo(E.cx+E.x01,E.cy+E.y01),j0&&(p+=h);for(null!=t?m.sort(function(e,r){return t(g[e],g[r])}):null!=i&&m.sort(function(e,t){return i(r[e],r[t])}),s=0,u=p?(v-f*b)/p:0;s0?h*u:0)+b,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:c,padAngle:x};return g}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:r(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,i=null,s):t},s.sort=function(e){return arguments.length?(i=e,t=null,s):i},s.startAngle=function(e){return arguments.length?(n="function"==typeof e?e:r(+e),s):n},s.endAngle=function(e){return arguments.length?(a="function"==typeof e?e:r(+e),s):a},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:r(+e),s):o},s},e.pointRadial=z,e.radialArea=P,e.radialLine=L,e.stack=function(){var e=r([]),t=eR,i=eO,n=eB;function a(r){var a,o,s=e.apply(this,arguments),l=r.length,u=s.length,c=Array(u);for(a=0;a0)for(var r,i,n,a,o,s,l=0,u=e[t[0]].length;l0?(i[0]=a,i[1]=a+=n):n<0?(i[1]=o,i[0]=o+=n):(i[0]=0,i[1]=n)},e.stackOffsetExpand=function(e,t){if((i=e.length)>0){for(var r,i,n,a=0,o=e[0].length;a0){for(var r,i=0,n=e[t[0]],a=n.length;i0&&(i=(r=e[t[0]]).length)>0){for(var r,i,n,a=0,o=1;otypeof t?i(e,NI()):i((r=r||self).d3=r.d3||{},r.d3)}}),NP=m({"node_modules/@plotly/d3-sankey/dist/@plotly/d3-sankey.js"(e,t){var r,i;r=e,i=function(e,t,r){function i(e){return e.target.depth}function n(e,t){return e.sourceLinks.length?e.depth:t-1}function a(e){return function(){return e}}function o(e,t){return l(e.source,t.source)||e.index-t.index}function s(e,t){return l(e.target,t.target)||e.index-t.index}function l(e,t){return e.y0-t.y0}function u(e){return e.value}function c(e){return e.index}function h(e){return e.nodes}function d(e){return e.links}function f(e,t){let r=e.get(t);if(!r)throw Error("missing: "+t);return r}function p({nodes:e}){for(let t of e){let e=t.y0,r=e;for(let r of t.sourceLinks)r.y0=e+r.width/2,e+=r.width;for(let e of t.targetLinks)e.y1=r+e.width/2,r+=e.width}}function m(e){return[e.source.x1,e.y0]}function g(e){return[e.target.x0,e.y1]}e.sankey=function(){let e=0,r=0,i=1,m=1,g=24,y=8,v,x=c,b=n,_,w,T=h,A=d,M=6,k=2/3;function S(){let n={nodes:T.apply(null,arguments),links:A.apply(null,arguments)};return function({nodes:e,links:t}){for(let[t,r]of e.entries())r.index=t,r.sourceLinks=[],r.targetLinks=[];let r=new Map(e.map((t,r)=>[x(t,r,e),t]));for(let[e,i]of t.entries()){i.index=e;let{source:t,target:n}=i;"object"!=typeof t&&(t=i.source=f(r,t)),"object"!=typeof n&&(n=i.target=f(r,n)),t.sourceLinks.push(i),n.targetLinks.push(i)}if(null!=w)for(let{sourceLinks:t,targetLinks:r}of e)t.sort(w),r.sort(w)}(n),function({nodes:e}){for(let r of e)r.value=void 0===r.fixedValue?Math.max(t.sum(r.sourceLinks,u),t.sum(r.targetLinks,u)):r.fixedValue}(n),function({nodes:e}){let t=e.length,r=new Set(e),i=new Set,n=0;for(;r.size;){for(let e of r)for(let{target:t}of(e.depth=n,e.sourceLinks))i.add(t);if(++n>t)throw Error("circular link");r=i,i=new Set}}(n),function({nodes:e}){let t=e.length,r=new Set(e),i=new Set,n=0;for(;r.size;){for(let e of r)for(let{source:t}of(e.height=n,e.targetLinks))i.add(t);if(++n>t)throw Error("circular link");r=i,i=new Set}}(n),function(n){let a=function({nodes:r}){let n=t.max(r,e=>e.depth)+1,a=(i-e-g)/(n-1),o=Array(n);for(let t of r){let r=Math.max(0,Math.min(n-1,Math.floor(b.call(null,t,n))));t.layer=r,t.x0=e+r*a,t.x1=t.x0+g,o[r]?o[r].push(t):o[r]=[t]}if(_)for(let e of o)e.sort(_);return o}(n);v=Math.min(y,k*(m-r)/(t.max(a,e=>e.length)-1)),function(e){let i=t.min(e,e=>(m-r-(e.length-1)*v)/t.sum(e,u));for(let t of e){let e=r;for(let r of t)for(let t of(r.y0=e,r.y1=e+r.value*i,e=r.y1+v,r.sourceLinks))t.width=t.value*i;e=(m-e+v)/(t.length+1);for(let r=0;r=0;--n){let i=e[n];for(let e of i){let r=0,i=0;for(let{target:t,value:n}of e.sourceLinks){let a=n*(t.layer-e.layer);r+=function(e,t){let r=t.y0-(t.targetLinks.length-1)*v/2;for(let{source:i,width:n}of t.targetLinks){if(i===e)break;r+=n+v}for(let{target:i,width:n}of e.sourceLinks){if(i===t)break;r-=n}return r}(e,t)*a,i+=a}if(!(i>0))continue;let n=(r/i-e.y0)*t;e.y0+=n,e.y1+=n,I(e)}void 0===_&&i.sort(l),E(i,r)}})(a,t,r),function(e,t,r){for(let i=1,n=e.length;i0))continue;let n=(r/i-e.y0)*t;e.y0+=n,e.y1+=n,I(e)}void 0===_&&n.sort(l),E(n,r)}}(a,t,r)}}(n),p(n),n}function E(e,t){let i=e.length>>1,n=e[i];C(e,n.y0-v,i-1,t),D(e,n.y1+v,i+1,t),C(e,m,e.length-1,t),D(e,r,0,t)}function D(e,t,r,i){for(;r1e-6&&(n.y0+=a,n.y1+=a),t=n.y1+v}}function C(e,t,r,i){for(;r>=0;--r){let n=e[r],a=(n.y1-t)*i;a>1e-6&&(n.y0-=a,n.y1-=a),t=n.y0-v}}function I({sourceLinks:e,targetLinks:t}){if(void 0===w){for(let{source:{sourceLinks:e}}of t)e.sort(s);for(let{target:{targetLinks:t}}of e)t.sort(o)}}return S.update=function(e){return p(e),e},S.nodeId=function(e){return arguments.length?(x="function"==typeof e?e:a(e),S):x},S.nodeAlign=function(e){return arguments.length?(b="function"==typeof e?e:a(e),S):b},S.nodeSort=function(e){return arguments.length?(_=e,S):_},S.nodeWidth=function(e){return arguments.length?(g=+e,S):g},S.nodePadding=function(e){return arguments.length?(y=v=+e,S):y},S.nodes=function(e){return arguments.length?(T="function"==typeof e?e:a(e),S):T},S.links=function(e){return arguments.length?(A="function"==typeof e?e:a(e),S):A},S.linkSort=function(e){return arguments.length?(w=e,S):w},S.size=function(t){return arguments.length?(e=r=0,i=+t[0],m=+t[1],S):[i-e,m-r]},S.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],r=+t[0][1],m=+t[1][1],S):[[e,r],[i,m]]},S.iterations=function(e){return arguments.length?(M=+e,S):M},S},e.sankeyCenter=function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,i)-1:0},e.sankeyJustify=n,e.sankeyLeft=function(e){return e.depth},e.sankeyLinkHorizontal=function(){return r.linkHorizontal().source(m).target(g)},e.sankeyRight=function(e,t){return t-1-e.height},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&"u">typeof t?i(e,NC(),NL()):i((r=r||self).d3=r.d3||{},r.d3,r.d3)}}),Nz=m({"node_modules/@plotly/d3-sankey-circular/node_modules/d3-array/dist/d3-array.js"(e,t){(function(e){function t(e,t){return et?1:e>=t?0:0/0}function r(e){var r;return 1===e.length&&(r=e,e=function(e,i){return t(r(e),i)}),{left:function(t,r,i,n){for(null==i&&(i=0),null==n&&(n=t.length);i>>1;0>e(t[a],r)?i=a+1:n=a}return i},right:function(t,r,i,n){for(null==i&&(i=0),null==n&&(n=t.length);i>>1;e(t[a],r)>0?n=a:i=a+1}return i}}}var i=r(t),n=i.right,a=i.left;function o(e,t){return[e,t]}function s(e){return null===e?0/0:+e}function l(e,t){var r,i,n=e.length,a=0,o=-1,l=0,u=0;if(null==t)for(;++o1)return u/(a-1)}function u(e,t){var r=l(e,t);return r&&Math.sqrt(r)}function c(e,t){var r,i,n,a=e.length,o=-1;if(null==t){for(;++o=r)for(i=n=r;++or&&(i=r),n=r)for(i=n=r;++or&&(i=r),n=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=y?10:a>=v?5:a>=x?2:1)}function _(e,t,r){var i=Math.abs(t-e)/Math.max(0,r),n=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),a=i/n;return a>=y?n*=10:a>=v?n*=5:a>=x&&(n*=2),t=1)return+r(e[i-1],i-1,e);var i,n=(i-1)*t,a=Math.floor(n),o=+r(e[a],a,e);return o+(r(e[a+1],a+1,e)-o)*(n-a)}}function A(e,t){var r,i,n=e.length,a=-1;if(null==t){for(;++a=r)for(i=r;++ar&&(i=r)}else for(;++a=r)for(i=r;++ar&&(i=r);return i}function M(e){if(!(n=e.length))return[];for(var t=-1,r=A(e,k),i=Array(r);++te?1:t>=e?0:0/0},e.deviation=u,e.extent=c,e.histogram=function(){var e=m,t=c,r=w;function i(i){var a,o,s=i.length,l=Array(s);for(a=0;ah;)d.pop(),--f;var p,m=Array(f+1);for(a=0;a<=f;++a)(p=m[a]=[]).x0=a>0?d[a-1]:c,p.x1=a=r)for(i=r;++ai&&(i=r)}else for(;++a=r)for(i=r;++ai&&(i=r);return i},e.mean=function(e,t){var r,i=e.length,n=i,a=-1,o=0;if(null==t)for(;++a=0;)for(t=(i=e[n]).length;--t>=0;)r[--o]=i[t];return r},e.min=A,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,i=e.length-1,n=e[0],a=Array(i<0?0:i);rr(n=e[a],s)||0!==r(s,s))&&(s=n,o=a);if(0===r(s,s))return o}},e.shuffle=function(e,t,r){for(var i,n,a=(r??e.length)-(t=null==t?0:+t);a;)n=Math.random()*a--|0,i=e[a+t],e[a+t]=e[n+t],e[n+t]=i;return e},e.sum=function(e,t){var r,i=e.length,n=-1,a=0;if(null==t)for(;++n0)return[e];if((i=t0)for(e=Math.ceil(e/o),a=Array(n=Math.ceil((t=Math.floor(t/o))-e+1));++stypeof t?e:e.d3=e.d3||{})}}),NF=m({"node_modules/elementary-circuits-directed-graph/johnson.js"(e,t){var r=NT();t.exports=function(e,t){var i,n=[],a=[],o=[],s={},l=[];i=0;for(var u=e.length;i=t});for(var n,a=r(e),o=a.components.filter(function(e){return e.length>1}),s=1/0,l=0;l1||n>1)}function A(e,t,r){return e.sort(k),e.forEach(function(i,n){var a=0;if(j(i,r)&&T(i))i.circularPathData.verticalBuffer=a+i.width/2;else{for(var o,s,l=0;ls.source.column)){var u=e[l].circularPathData.verticalBuffer+e[l].width/2+t;a=u>a?u:a}i.circularPathData.verticalBuffer=a+i.width/2}}),e}function M(e,r,n,a){var o=t.min(e.links,function(e){return e.source.y0});e.links.forEach(function(e){e.circular&&(e.circularPathData={})}),A(e.links.filter(function(e){return"top"==e.circularLinkType}),r,a),A(e.links.filter(function(e){return"bottom"==e.circularLinkType}),r,a),e.links.forEach(function(t){if(t.circular){if(t.circularPathData.arcRadius=t.width+10,t.circularPathData.leftNodeBuffer=5,t.circularPathData.rightNodeBuffer=5,t.circularPathData.sourceWidth=t.source.x1-t.source.x0,t.circularPathData.sourceX=t.source.x0+t.circularPathData.sourceWidth,t.circularPathData.targetX=t.target.x0,t.circularPathData.sourceY=t.y0,t.circularPathData.targetY=t.y1,j(t,a)&&T(t))t.circularPathData.leftSmallArcRadius=10+t.width/2,t.circularPathData.leftLargeArcRadius=10+t.width/2,t.circularPathData.rightSmallArcRadius=10+t.width/2,t.circularPathData.rightLargeArcRadius=10+t.width/2,"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=t.source.y1+25+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=t.source.y0-25-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius);else{var s,l=t.source.column,u=t.circularLinkType,c=e.links.filter(function(e){return e.source.column==l&&e.circularLinkType==u});"bottom"==t.circularLinkType?c.sort(E):c.sort(S);var h=0;c.forEach(function(e,i){e.circularLinkID==t.circularLinkID&&(t.circularPathData.leftSmallArcRadius=10+t.width/2+h,t.circularPathData.leftLargeArcRadius=10+t.width/2+i*r+h),h+=e.width}),l=t.target.column,c=e.links.filter(function(e){return e.target.column==l&&e.circularLinkType==u}),"bottom"==t.circularLinkType?c.sort(C):c.sort(D),h=0,c.forEach(function(e,i){e.circularLinkID==t.circularLinkID&&(t.circularPathData.rightSmallArcRadius=10+t.width/2+h,t.circularPathData.rightLargeArcRadius=10+t.width/2+i*r+h),h+=e.width}),"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=Math.max(n,t.source.y1,t.target.y1)+25+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=o-25-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius)}t.circularPathData.leftInnerExtent=t.circularPathData.sourceX+t.circularPathData.leftNodeBuffer,t.circularPathData.rightInnerExtent=t.circularPathData.targetX-t.circularPathData.rightNodeBuffer,t.circularPathData.leftFullExtent=t.circularPathData.sourceX+t.circularPathData.leftLargeArcRadius+t.circularPathData.leftNodeBuffer,t.circularPathData.rightFullExtent=t.circularPathData.targetX-t.circularPathData.rightLargeArcRadius-t.circularPathData.rightNodeBuffer}t.circular?t.path="top"==(s=t).circularLinkType?"M"+s.circularPathData.sourceX+" "+s.circularPathData.sourceY+" L"+s.circularPathData.leftInnerExtent+" "+s.circularPathData.sourceY+" A"+s.circularPathData.leftLargeArcRadius+" "+s.circularPathData.leftSmallArcRadius+" 0 0 0 "+s.circularPathData.leftFullExtent+" "+(s.circularPathData.sourceY-s.circularPathData.leftSmallArcRadius)+" L"+s.circularPathData.leftFullExtent+" "+s.circularPathData.verticalLeftInnerExtent+" A"+s.circularPathData.leftLargeArcRadius+" "+s.circularPathData.leftLargeArcRadius+" 0 0 0 "+s.circularPathData.leftInnerExtent+" "+s.circularPathData.verticalFullExtent+" L"+s.circularPathData.rightInnerExtent+" "+s.circularPathData.verticalFullExtent+" A"+s.circularPathData.rightLargeArcRadius+" "+s.circularPathData.rightLargeArcRadius+" 0 0 0 "+s.circularPathData.rightFullExtent+" "+s.circularPathData.verticalRightInnerExtent+" L"+s.circularPathData.rightFullExtent+" "+(s.circularPathData.targetY-s.circularPathData.rightSmallArcRadius)+" A"+s.circularPathData.rightLargeArcRadius+" "+s.circularPathData.rightSmallArcRadius+" 0 0 0 "+s.circularPathData.rightInnerExtent+" "+s.circularPathData.targetY+" L"+s.circularPathData.targetX+" "+s.circularPathData.targetY:"M"+s.circularPathData.sourceX+" "+s.circularPathData.sourceY+" L"+s.circularPathData.leftInnerExtent+" "+s.circularPathData.sourceY+" A"+s.circularPathData.leftLargeArcRadius+" "+s.circularPathData.leftSmallArcRadius+" 0 0 1 "+s.circularPathData.leftFullExtent+" "+(s.circularPathData.sourceY+s.circularPathData.leftSmallArcRadius)+" L"+s.circularPathData.leftFullExtent+" "+s.circularPathData.verticalLeftInnerExtent+" A"+s.circularPathData.leftLargeArcRadius+" "+s.circularPathData.leftLargeArcRadius+" 0 0 1 "+s.circularPathData.leftInnerExtent+" "+s.circularPathData.verticalFullExtent+" L"+s.circularPathData.rightInnerExtent+" "+s.circularPathData.verticalFullExtent+" A"+s.circularPathData.rightLargeArcRadius+" "+s.circularPathData.rightLargeArcRadius+" 0 0 1 "+s.circularPathData.rightFullExtent+" "+s.circularPathData.verticalRightInnerExtent+" L"+s.circularPathData.rightFullExtent+" "+(s.circularPathData.targetY+s.circularPathData.rightSmallArcRadius)+" A"+s.circularPathData.rightLargeArcRadius+" "+s.circularPathData.rightSmallArcRadius+" 0 0 1 "+s.circularPathData.rightInnerExtent+" "+s.circularPathData.targetY+" L"+s.circularPathData.targetX+" "+s.circularPathData.targetY:t.path=i.linkHorizontal().source(function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]}).target(function(e){return[e.target.x0,e.y1]})(t)})}function k(e,t){return I(e)==I(t)?"bottom"==e.circularLinkType?E(e,t):S(e,t):I(t)-I(e)}function S(e,t){return e.y0-t.y0}function E(e,t){return t.y0-e.y0}function D(e,t){return e.y1-t.y1}function C(e,t){return t.y1-e.y1}function I(e){return e.target.column-e.source.column}function L(e){return e.target.x0-e.source.x1}function P(e,t){var r=_(e),i=L(t)/Math.tan(r);return"up"==B(e)?e.y1+i:e.y1-i}function z(e,t){var r=_(e),i=L(t)/Math.tan(r);return"up"==B(e)?e.y1-i:e.y1+i}function F(e,t,r,i){return e.y0+t>=r&&e.y1+t<=i&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach(function(e){e.y1=e.y1+t}),e.sourceLinks.forEach(function(e){e.y0=e.y0+t})),e}function O(e,t,r,i){e.nodes.forEach(function(n){i&&n.y+(n.y1-n.y0)>t&&(n.y=n.y-(n.y+(n.y1-n.y0)-t));var a=e.links.filter(function(e){return r(e.source)==r(n)}),o=a.length;o>1&&a.sort(function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(r=e,i=t,B(r)!=B(i))return e.y1-t.y1;if(e.target.column>t.target.column){var r,i,n=z(t,e);return e.y1-n}if(t.target.column>e.target.column)return z(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0});var s=n.y0;a.forEach(function(e){e.y0=s+e.width/2,s+=e.width}),a.forEach(function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,i=0;r1&&i.sort(function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(r=e,i=t,B(r)!=B(i))return e.y0-t.y0;if(t.source.column0?"up":"down"}function j(e,t){return t(e.source)==t(e.target)}e.sankeyCircular=function(){var e,i,a=0,_=0,T=1,A=1,k=24,S=g,E=o,D=y,C=v,I=32,L=2,P=null;function z(){var o,s,u={nodes:D.apply(null,arguments),links:C.apply(null,arguments)};(o=u).nodes.forEach(function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}),s=r.map(o.nodes,S),o.links.forEach(function(e,t){e.index=t;var r=e.source,i=e.target;(typeof r>"u"?"undefined":l(r))!=="object"&&(r=e.source=x(s,r)),(typeof i>"u"?"undefined":l(i))!=="object"&&(i=e.target=x(s,i)),r.sourceLinks.push(e),i.targetLinks.push(e)}),function(e,t){var r=0;if(null===t){for(var i=[],a=0;ar.indexOf(e.target)&&!e.circular&&r.push(e.target)})});for(t=e.nodes,r=[],i=0;t.length;++i,t=r,r=[])t.forEach(function(e){e.height=i,e.targetLinks.forEach(function(e){0>r.indexOf(e.source)&&!e.circular&&r.push(e.source)})});e.nodes.forEach(function(e){e.column=Math.floor(E.call(null,e,i))})}(u),b(u,S),function(n,o,s){var l=r.nest().key(function(e){return e.column}).sortKeys(t.ascending).entries(n.nodes).map(function(e){return e.values});(function(r){if(i){var o,s,u,c,h,f,p,m,g,y,v,x,b=1/0;l.forEach(function(e){var t=A*i/(e.length+1);b=t0?o+25+10:o,bottom:s=s>0?s+25+10:s,left:c=c>0?c+25+10:c,right:u=u>0?u+25+10:u}),E=(f=t.max(n.nodes,function(e){return e.column}),p=T-a,m=A-_,g=p+S.right+S.left,y=m+S.top+S.bottom,v=p/g,x=m/y,a=a*v+S.left,T=0==S.right?T:T*v,_=_*x+S.top,A*=x,n.nodes.forEach(function(e){e.x0=a+e.column*((T-a-k)/f),e.x1=e.x0+k}),x);M*=E,n.links.forEach(function(e){e.width=e.value*M}),l.forEach(function(e){var t=e.length;e.forEach(function(e,i){e.depth==l.length-1&&1==t||0==e.depth&&1==t?e.y0=A/2-e.value*M:e.partOfCycle?0==w(e,r)?e.y0=A/2+i:"top"==e.circularLinkType?e.y0=_+i:e.y0=A-e.value*M-i:0==S.top||0==S.bottom?e.y0=(A-_)/t*i:e.y0=(A-_)/2-t/2+i,e.y1=e.y0+e.value*M})})})(s),g();for(var u=1,c=o;c>0;--c)(function(e,r){var i=l.length;l.forEach(function(n){var a=n.length,o=n[0].depth;n.forEach(function(n){var s;if((n.sourceLinks.length||n.targetLinks.length)&&!(n.partOfCycle&&w(n,r)>0))if(0==o&&1==a)s=n.y1-n.y0,n.y0=A/2-s/2,n.y1=A/2+s/2;else if(o==i-1&&1==a)s=n.y1-n.y0,n.y0=A/2-s/2,n.y1=A/2+s/2;else{var l=t.mean(n.sourceLinks,m),u=t.mean(n.targetLinks,p),c=((l&&u?(l+u)/2:l||u)-f(n))*e;n.y0+=c,n.y1+=c}})})})(u*=.99,s),g();function g(){l.forEach(function(t){var r,i,n,a=_,o=t.length;for(t.sort(h),n=0;n0&&(r.y0+=i,r.y1+=i),a=r.y1+e;if((i=a-e-A)>0)for(a=r.y0-=i,r.y1-=i,n=o-2;n>=0;--n)(i=(r=t[n]).y1+e-a)>0&&(r.y0-=i,r.y1-=i),a=r.y0})}}(u,I,S),B(u);for(var c=0;c<4;c++)O(u,A,S),R(u,A,S),function(e,t,r,i){e.links.forEach(function(n){if(!n.circular&&n.target.column-n.source.column>1){var a=n.source.column+1,o=n.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach(function(o){if(o.column==a){var u,c=s/(l+1),h=Math.pow(1-c,3),d=3*c*Math.pow(1-c,2),f=3*Math.pow(c,2)*(1-c),p=Math.pow(c,3),m=h*n.y0+d*n.y0+f*n.y1+p*n.y1,g=m-n.width/2,y=m+n.width/2;g>o.y0&&ga.y0&&n.y0a.y0&&n.y1a.y1)&&F(e,u,t,r))})):y>o.y0&&yo.y1&&F(e,u,t,r)})):go.y1&&(u=y-o.y0+10,o=F(o,u,t,r),e.nodes.forEach(function(e){i(e)==i(o)||e.column!=o.column||e.y0o.y1&&F(e,u,t,r)}))}})}})}(u,_,A,S),O(u,A,S),R(u,A,S);return function(e,r,i){var n=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach(function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)}),!1==o||!1==s){var l=t.min(n,function(e){return e.y0}),u=(i-r)/(t.max(n,function(e){return e.y1})-l);n.forEach(function(e){var t=(e.y1-e.y0)*u;e.y0=(e.y0-l)*u,e.y1=e.y0+t}),a.forEach(function(e){e.y0=(e.y0-l)*u,e.y1=(e.y1-l)*u,e.width=e.width*u})}}(u,_,A),M(u,L,A,S),u}function B(e){e.nodes.forEach(function(e){e.sourceLinks.sort(c),e.targetLinks.sort(u)}),e.nodes.forEach(function(e){var t=e.y0,r=t,i=e.y1,n=i;e.sourceLinks.forEach(function(e){e.circular?(e.y0=i-e.width/2,i-=e.width):(e.y0=t+e.width/2,t+=e.width)}),e.targetLinks.forEach(function(e){e.circular?(e.y1=n-e.width/2,n-=e.width):(e.y1=r+e.width/2,r+=e.width)})})}return z.nodeId=function(e){return arguments.length?(S="function"==typeof e?e:s(e),z):S},z.nodeAlign=function(e){return arguments.length?(E="function"==typeof e?e:s(e),z):E},z.nodeWidth=function(e){return arguments.length?(k=+e,z):k},z.nodePadding=function(t){return arguments.length?(e=+t,z):e},z.nodes=function(e){return arguments.length?(D="function"==typeof e?e:s(e),z):D},z.links=function(e){return arguments.length?(C="function"==typeof e?e:s(e),z):C},z.size=function(e){return arguments.length?(a=_=0,T=+e[0],A=+e[1],z):[T-a,A-_]},z.extent=function(e){return arguments.length?(a=+e[0][0],T=+e[1][0],_=+e[0][1],A=+e[1][1],z):[[a,_],[T,A]]},z.iterations=function(e){return arguments.length?(I=+e,z):I},z.circularLinkGap=function(e){return arguments.length?(L=+e,z):L},z.nodePaddingRatio=function(e){return arguments.length?(i=+e,z):i},z.sortNodes=function(e){return arguments.length?(P=e,z):P},z.update=function(e){return b(e,S),B(e),e.links.forEach(function(e){e.circular&&(e.circularLinkType=e.y0+e.y1typeof t?r(e,Nz(),Nk(),NL(),NF()):r(e.d3=e.d3||{},e.d3,e.d3,e.d3,null)}}),NR=m({"src/traces/sankey/constants.js"(e,t){t.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),NB=m({"src/traces/sankey/render.js"(e,t){var r=ND(),i=(dD(),x(dE)).interpolateNumber,n=M(),a=NP(),o=NO(),s=NR(),l=er(),u=rt(),c=tb(),h=c.strTranslate,d=c.strRotate,f=yB(),p=f.keyFun,m=f.repeat,g=f.unwrap,y=tj(),v=e1(),b=tB(),_=b.CAP_SHIFT,w=b.LINE_SPACING;function T(e,t,r){var i,n=g(t),l=n.trace,u=l.domain,h="h"===l.orientation,d="reversed"===l.direction,f=l.node.pad,p=l.node.thickness,m={justify:a.sankeyJustify,left:a.sankeyLeft,right:a.sankeyRight,center:a.sankeyCenter}[l.node.align],y=e.width*(u.x[1]-u.x[0]),v=e.height*(u.y[1]-u.y[0]),x=n._nodes,b=n._links,_=n.circular;function w(e){"input"===l[e].sort&&(_?c.warn(`Circular Sankey diagrams do not support the "input" ${e}.sort mode; falling back to the default sort.`):i[`${e}Sort`](null))}(i=_?o.sankeyCircular().circularLinkGap(0):a.sankey()).iterations(s.sankeyIterations).size(h?[y,v]:[v,y]).nodeWidth(p).nodePadding(f).nodeId(function(e){return e.pointNumber}).nodeAlign(m).nodes(x).links(b),w("link"),w("node");var T=i();for(var A in i.nodePadding()o+p&&(a+=1,t=s.x0),o=s.x0,n[a]||(n[a]=[]),n[a].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return n})(x=T.nodes).forEach(function(e){var t,r,i,n=0,a=e.length;for(e.sort(function(e,t){return e.y0-t.y0}),i=0;i=n||(r=n-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),n=t.y1+f}),i.update(T)}return{circular:_,key:r,trace:l,guid:c.randstr(),horizontal:h,reversed:d,width:y,height:v,nodePad:l.node.pad,nodeLineColor:l.node.line.color,nodeLineWidth:l.node.line.width,linkLineColor:l.link.line.color,linkLineWidth:l.link.line.width,linkArrowLength:l.link.arrowlen,valueFormat:l.valueformat,valueSuffix:l.valuesuffix,textFont:l.textfont,translateX:u.x[0]*e.width+e.margin.l,translateY:e.height-u.y[1]*e.height+e.margin.t,dragParallel:h?v:y,dragPerpendicular:h?y:v,arrangement:l.arrangement,sankey:i,graph:T,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function A(e,t,r){var i=t.source.label+"|"+t.target.label;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:i+"__"+r,traceId:e.key,pointNumber:t.pointNumber,link:t,rgb:l.rgb(t.color),alpha:l.parse(t.color).alpha,hoverRgb:l.rgb(t.hovercolor),hoverAlpha:l.parse(t.hovercolor).alpha,linkPath:k,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function k(){return function(e){var t,r,n,a,o,s,l,u=e.linkArrowLength;if(e.link.circular)return t=e.link,r=u,n="",a=t.width/2,s=(o=t.circularPathData).sourceX+o.verticalBuffer0?" L "+o.targetX+" "+o.targetY:"")+"Z"):(n="M "+(o.targetX-r)+" "+(o.targetY-a)+" L "+(o.rightInnerExtent-r)+" "+(o.targetY-a)+" A "+(o.rightLargeArcRadius+a)+" "+(o.rightSmallArcRadius+a)+" 0 0 0 "+(o.rightFullExtent-a-r)+" "+(o.targetY+o.rightSmallArcRadius)+" L "+(o.rightFullExtent-a-r)+" "+o.verticalRightInnerExtent,s&&l?n+=" A "+(o.rightLargeArcRadius+a)+" "+(o.rightLargeArcRadius+a)+" 0 0 0 "+(o.rightInnerExtent-a-r)+" "+(o.verticalFullExtent+a)+" L "+(o.rightFullExtent+a-r-(o.rightLargeArcRadius-a))+" "+(o.verticalFullExtent+a)+" A "+(o.rightLargeArcRadius+a)+" "+(o.rightLargeArcRadius+a)+" 0 0 0 "+(o.leftFullExtent+a)+" "+o.verticalLeftInnerExtent:s?n+=" A "+(o.rightLargeArcRadius-a)+" "+(o.rightSmallArcRadius-a)+" 0 0 1 "+(o.rightFullExtent-r-a-(o.rightLargeArcRadius-a))+" "+(o.verticalFullExtent-a)+" L "+(o.leftFullExtent+a+(o.rightLargeArcRadius-a))+" "+(o.verticalFullExtent-a)+" A "+(o.rightLargeArcRadius-a)+" "+(o.rightSmallArcRadius-a)+" 0 0 1 "+(o.leftFullExtent+a)+" "+o.verticalLeftInnerExtent:n+=" A "+(o.rightLargeArcRadius+a)+" "+(o.rightLargeArcRadius+a)+" 0 0 0 "+(o.rightInnerExtent-r)+" "+(o.verticalFullExtent+a)+" L "+o.leftInnerExtent+" "+(o.verticalFullExtent+a)+" A "+(o.leftLargeArcRadius+a)+" "+(o.leftLargeArcRadius+a)+" 0 0 0 "+(o.leftFullExtent+a)+" "+o.verticalLeftInnerExtent,n+=" L "+(o.leftFullExtent+a)+" "+(o.sourceY+o.leftSmallArcRadius)+" A "+(o.leftLargeArcRadius+a)+" "+(o.leftSmallArcRadius+a)+" 0 0 0 "+o.leftInnerExtent+" "+(o.sourceY-a)+" L "+o.sourceX+" "+(o.sourceY-a)+" L "+o.sourceX+" "+(o.sourceY+a)+" L "+o.leftInnerExtent+" "+(o.sourceY+a)+" A "+(o.leftLargeArcRadius-a)+" "+(o.leftSmallArcRadius-a)+" 0 0 1 "+(o.leftFullExtent-a)+" "+(o.sourceY+o.leftSmallArcRadius)+" L "+(o.leftFullExtent-a)+" "+o.verticalLeftInnerExtent,s&&l?n+=" A "+(o.rightLargeArcRadius-a)+" "+(o.rightSmallArcRadius-a)+" 0 0 1 "+(o.leftFullExtent-a-(o.rightLargeArcRadius-a))+" "+(o.verticalFullExtent-a)+" L "+(o.rightFullExtent+a-r+(o.rightLargeArcRadius-a))+" "+(o.verticalFullExtent-a)+" A "+(o.rightLargeArcRadius-a)+" "+(o.rightSmallArcRadius-a)+" 0 0 1 "+(o.rightFullExtent+a-r)+" "+o.verticalRightInnerExtent:s?n+=" A "+(o.rightLargeArcRadius+a)+" "+(o.rightLargeArcRadius+a)+" 0 0 0 "+(o.leftFullExtent+a)+" "+(o.verticalFullExtent+a)+" L "+(o.rightFullExtent-r-a)+" "+(o.verticalFullExtent+a)+" A "+(o.rightLargeArcRadius+a)+" "+(o.rightLargeArcRadius+a)+" 0 0 0 "+(o.rightFullExtent+a-r)+" "+o.verticalRightInnerExtent:n+=" A "+(o.leftLargeArcRadius-a)+" "+(o.leftLargeArcRadius-a)+" 0 0 1 "+o.leftInnerExtent+" "+(o.verticalFullExtent-a)+" L "+(o.rightInnerExtent-r)+" "+(o.verticalFullExtent-a)+" A "+(o.rightLargeArcRadius-a)+" "+(o.rightLargeArcRadius-a)+" 0 0 1 "+(o.rightFullExtent+a-r)+" "+o.verticalRightInnerExtent,n+=" L "+(o.rightFullExtent+a-r)+" "+(o.targetY+o.rightSmallArcRadius)+" A "+(o.rightLargeArcRadius-a)+" "+(o.rightSmallArcRadius-a)+" 0 0 1 "+(o.rightInnerExtent-r)+" "+(o.targetY+a)+" L "+(o.targetX-r)+" "+(o.targetY+a)+(r>0?" L "+o.targetX+" "+o.targetY:"")+"Z"),n;var c=Math.abs((e.link.target.x0-e.link.source.x1)/2);u>c&&(u=c);var h=e.link.source.x1,d=e.link.target.x0-u,f=i(h,d),p=f(.5),m=f(.5),g=e.link.y0-e.link.width/2,y=e.link.y0+e.link.width/2,v=e.link.y1-e.link.width/2,x=e.link.y1+e.link.width/2,b="M"+h+","+g,_="C"+p+","+g+" "+m+","+v+" "+d+","+v,w="C"+m+","+x+" "+p+","+y+" "+h+","+y,T=u>0?"L"+(d+u)+","+(v+e.link.width/2):"";return b+_+(T+="L"+d+","+x)+w+"Z"}}function S(e,t){var r=s.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var n=t.dx,a=Math.max(.5,t.dy),o="node_"+t.pointNumber;return t.group&&(o=c.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:o,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(n),visibleHeight:a,zoneX:-r,zoneY:-i,zoneWidth:n+2*r,zoneHeight:a+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,reversed:e.reversed,rgb:l.rgb(t.color),alpha:l.parse(t.color).alpha,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,o].join("_"),interactionState:e.interactionState,figure:e}}function E(e){e.attr("transform",function(e){return h(e.node.x0.toFixed(3),e.node.y0.toFixed(3))})}function D(e){e.call(E)}function C(e,t){e.call(D),t.attr("d",k())}function I(e){e.attr("width",function(e){return e.node.x1-e.node.x0}).attr("height",function(e){return e.visibleHeight})}function L(e){return e.link.width>1||e.linkLineWidth>0}function P(e){return e.horizontal?e.reversed?h(e.translateX+e.width,e.translateY)+"matrix(-1 0 0 1 0 0)":h(e.translateX,e.translateY)+"matrix(1 0 0 1 0 0)":e.reversed?h(e.translateX,e.translateY+e.height)+"matrix(0 -1 1 0 0 0)":h(e.translateX,e.translateY)+"matrix(0 1 1 0 0 0)"}function z(e,t,r){e.on(".basic",null).on("mouseover.basic",function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.hover(this,e,t),e.interactionState.hovered=[this,e])}).on("mousemove.basic",function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.follow(this,e),e.interactionState.hovered=[this,e])}).on("mouseout.basic",function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.unhover(this,e,t),e.interactionState.hovered=!1)}).on("click.basic",function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),e.interactionState.dragInProgress||e.partOfGroup||r.select(this,e,t)})}function F(e,t,i,a){var o=n.behavior.drag().origin(function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}}).on("dragstart",function(n){if("fixed"!==n.arrangement&&(c.ensureSingle(a._fullLayout._infolayer,"g","dragcover",function(e){a._fullLayout._dragCover=e}),c.raiseToTop(this),n.interactionState.dragInProgress=n.node,R(n.node),n.interactionState.hovered&&(i.nodeEvents.unhover.apply(0,n.interactionState.hovered),n.interactionState.hovered=!1),"snap"===n.arrangement)){var o,l,u,h,d,f=n.traceId+"|"+n.key;n.forceLayouts[f]?n.forceLayouts[f].alpha(1):function(e,t,i){for(var n,a,o,l=i.graph.nodes,u=0;u0&&o.forceLayouts[n].alpha(0)})).stop()}(e,f,n),o=e,l=t,u=n,h=f,d=a,window.requestAnimationFrame(function e(){for(t=0;t0)window.requestAnimationFrame(e);else{var t,r=u.node.originalX;u.node.x0=r-u.visibleWidth/2,u.node.x1=r+u.visibleWidth/2,O(u,d)}})}}).on("drag",function(r){if("fixed"!==r.arrangement){var i=n.event.x,a=n.event.y;"snap"===r.arrangement?(r.node.x0=i-r.visibleWidth/2,r.node.x1=i+r.visibleWidth/2):("freeform"===r.arrangement&&(r.node.x0=i-r.visibleWidth/2,r.node.x1=i+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a))),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2,R(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),C(e.filter(B(r)),t))}}).on("dragend",function(e){if("fixed"!==e.arrangement){e.interactionState.dragInProgress=!1;for(var t=0;tL(e)?l.rgb(e.linkLineColor):e.rgb).style("stroke-opacity",e=>L(e)?l.opacity(e.linkLineColor):e.alpha).style("fill",e=>e.rgb).style("fill-opacity",e=>e.alpha).style("stroke-width",e=>L(e)?e.linkLineWidth:1).attr("d",k()),D.style("opacity",function(){return e._context.staticPlot||f||v?1:0}).transition().ease(s.ease).duration(s.duration).style("opacity",1),D.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var C=b.selectAll("."+s.cn.sankeyNodeSet).data(m,p);C.enter().append("g").classed(s.cn.sankeyNodeSet,!0),C.style("cursor",function(e){switch(e.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var O=C.selectAll("."+s.cn.sankeyNode).data(function(e){var t=e.graph.nodes;return function(e){var t,r=[];for(t=0;te.rgb).style("fill-opacity",e=>e.alpha),R.transition().ease(s.ease).duration(s.duration).call(I);var B=O.selectAll("."+s.cn.nodeLabel).data(m);B.enter().append("text").classed(s.cn.nodeLabel,!0).style("cursor","default"),B.attr("data-notex",1).text(function(e){return e.node.label}).each(function(t){var r=n.select(this);u.font(r,t.textFont),y.convertToTspans(r,e)}).attr("text-anchor",function(e){return e.horizontal&&e.left!==e.reversed?"end":"start"}).attr("transform",function(e){var t=n.select(this),r=y.lineCount(t),i=e.textFont.size*((r-1)*w-_),a=e.nodeLineWidth/2+3;if(!e.horizontal){var o=e.reversed?(e.visibleWidth+i)/2:(e.visibleWidth-i)/2,s=e.reversed?d(90):"scale(-1,1)"+d(90);return h(o,a)+s}var l=a,o=(e.visibleHeight-i)/2;return e.left?l=-l:l+=e.visibleWidth,h(l,o)+(e.reversed?"scale(-1,1)":"")}),B.transition().ease(s.ease).duration(s.duration)}}}),Nj=m({"src/traces/sankey/plot.js"(e,t){var r=M(),i=tb(),n=i.numberFormat,a=NB(),o=rO(),s=er(),l=NR().cn,u=i._;function c(e){return""!==e}function h(e,t){return e.filter(function(e){return e.key===t.traceId})}function d(e,t){r.select(e).select("path").style("fill-opacity",t),r.select(e).select("rect").style("fill-opacity",t)}function f(e){r.select(e).select("text.name").style("fill","black")}function p(e){return function(t){return -1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function m(e){return function(t){return -1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(e,t,r){t&&r&&h(r,t).selectAll("."+l.sankeyLink).filter(p(t)).call(v.bind(0,t,r,!1))}function y(e,t,r){t&&r&&h(r,t).selectAll("."+l.sankeyLink).filter(p(t)).call(x.bind(0,t,r,!1))}function v(e,t,r,i){i.style("fill",function(e){if(!e.link.concentrationscale)return e.hoverRgb}).style("fill-opacity",function(e){if(!e.link.concentrationscale)return e.hoverAlpha}),i.each(function(r){var i=r.link.label;""!==i&&h(t,e).selectAll("."+l.sankeyLink).filter(function(e){return e.link.label===i}).style("fill",function(e){if(!e.link.concentrationscale)return e.hoverRgb}).style("fill-opacity",function(e){if(!e.link.concentrationscale)return e.hoverAlpha})}),r&&h(t,e).selectAll("."+l.sankeyNode).filter(m(e)).call(g)}function x(e,t,r,i){i.style("fill",function(e){return e.rgb}).style("fill-opacity",function(e){return e.alpha}),i.each(function(r){var i=r.link.label;""!==i&&h(t,e).selectAll("."+l.sankeyLink).filter(function(e){return e.link.label===i}).style("fill",e=>e.rgb).style("fill-opacity",e=>e.alpha)}),r&&h(t,e).selectAll(l.sankeyNode).filter(m(e)).call(y)}function b(e,t){var r=e.hoverlabel||{},n=i.nestedProperty(r,t).get();return!Array.isArray(n)&&n}t.exports=function(e,t){for(var i=e._fullLayout,h=i._paper,p=i._size,m=0;m"),color:b(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:b(l,"bordercolor"),fontFamily:b(l,"font.family"),fontSize:b(l,"font.size"),fontColor:b(l,"font.color"),fontWeight:b(l,"font.weight"),fontStyle:b(l,"font.style"),fontVariant:b(l,"font.variant"),fontTextcase:b(l,"font.textcase"),fontLineposition:b(l,"font.lineposition"),fontShadow:b(l,"font.shadow"),nameLength:b(l,"namelength"),textAlign:b(l,"align"),idealAlign:r.event.x"),color:b(s,"bgcolor")||a.rgb,borderColor:b(s,"bordercolor"),fontFamily:b(s,"font.family"),fontSize:b(s,"font.size"),fontColor:b(s,"font.color"),fontWeight:b(s,"font.weight"),fontStyle:b(s,"font.style"),fontVariant:b(s,"font.variant"),fontTextcase:b(s,"font.textcase"),fontLineposition:b(s,"font.lineposition"),fontShadow:b(s,"font.shadow"),nameLength:b(s,"namelength"),textAlign:b(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:e});d(w,.85),f(w)}}},unhover:function(t,n,a){!1!==e._fullLayout.hovermode&&(r.select(t).call(y,n,a),"skip"!==n.node.trace.node.hoverinfo&&(n.node.fullData=n.node.trace,e.emit("plotly_unhover",{event:r.event,points:[n.node]})),o.loneUnhover(i._hoverlayer.node()))},select:function(t,i,n){var a=i.node;a.originalEvent=r.event,e._hoverdata=[a],r.select(t).call(y,i,n),o.click(e,{target:!0})}}})}}}),NN=m({"src/traces/sankey/base_plot.js"(e){var t=eH().overrideAll,r=tz().getModuleCalcData,i=Nj(),n=Y(),a=rm(),o=rp(),s=ik().prepSelect,l=tb(),u=e1(),c="sankey";e.name=c,e.baseLayoutAttrOverrides=t({hoverlabel:n.hoverlabel},"plot","nested"),e.plot=function(t){var n=r(t.calcdata,c)[0];i(t,n),e.updateFx(t)},e.clean=function(e,t,r,i){var n=i._has&&i._has(c),a=t._has&&t._has(c);n&&!a&&(i._paperdiv.selectAll(".sankey").remove(),i._paperdiv.selectAll(".bgsankey").remove())},e.updateFx=function(e){for(var t=0;t0}function T(e){e.each(function(e){y.stroke(r.select(this),e.line.color)}).each(function(e){y.fill(r.select(this),e.color)}).style("stroke-width",function(e){return e.line.width})}function A(e,t,r){var i=e._fullLayout,n=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),o={type:"linear",_id:"x"+t._id},s={letter:"x",font:i.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(e,t){return a.coerce(n,o,g,e,t)}return p(n,o,l,s,i),m(n,o,l,s),o}function k(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function S(e,t,i,n){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",i).attr("data-unformatted",e).call(d.convertToTspans,n).call(c.font,t),c.bBox(o.node())}function E(e,t,r,i,n,o){var s="_cache"+t;e[s]&&e[s].key===n||(e[s]={key:n,value:r});var l=a.aggNums(o,null,[e[s].value,i],2);return e[s].value=l,l}t.exports=function(e,t,p,m){var g,x=e._fullLayout;w(p)&&m&&(g=m()),a.makeTraceGroups(x._indicatorlayer,t,"trace").each(function(t){var m,M,D,C,I,L=t[0].trace,P=r.select(this),z=L._hasGauge,F=L._isAngular,O=L._isBullet,R=L.domain,B={w:x._size.w*(R.x[1]-R.x[0]),h:x._size.h*(R.y[1]-R.y[0]),l:x._size.l+x._size.w*R.x[0],r:x._size.r+x._size.w*(1-R.x[1]),t:x._size.t+x._size.h*(1-R.y[1]),b:x._size.b+x._size.h*R.y[0]},j=B.l+B.w/2,N=B.t+B.h/2,V=Math.min(B.w/2,B.h),U=h.innerRadius*V,q=L.align||"center";if(C=N,z){if(F&&(D=j,C=N+V/2,I=function(e){var t,r;return t=e,[(r=.9*U)/Math.sqrt(t.width/2*(t.width/2)+t.height*t.height),t,r]}),O){var G=h.bulletPadding,H=1-h.bulletNumberDomainSize+G;D=B.l+(H+(1-H)*b[q])*B.w,I=function(e){return k(e,(h.bulletNumberDomainSize-G)*B.w,B.h)}}}else D=B.l+b[q]*B.w,I=function(e){return k(e,B.w,B.h)};(function(e,t,i,l){var u,h,p,m=i[0].trace,g=l.numbersX,x=l.numbersY,T=m.align||"center",M=v[T],k=l.transitionOpts,D=l.onComplete,C=a.ensureSingle(t,"g","numbers"),I=[];m._hasNumber&&I.push("number"),m._hasDelta&&(I.push("delta"),"left"===m.delta.position&&I.reverse());var L=C.selectAll("text").data(I);function P(t,r,i,n){if(!t.match("s")||i>=0==n>=0||r(i).slice(-1).match(_)||r(n).slice(-1).match(_))return r;var a=A(e,{tickformat:t.slice().replace("s","f").replace(/\d+/,function(e){return parseInt(e)-1})});return function(e){return 1>Math.abs(e)?f.tickText(a,e).text:r(e)}}L.enter().append("text"),L.attr("text-anchor",function(){return M}).attr("class",function(e){return e}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),L.exit().remove();var z,F=m.mode+m.align;if(m._hasDelta&&(z=function(){var t=A(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),f.prepTicks(t);var a=function(e){return f.tickText(t,e).text},o=m.delta.suffix,s=m.delta.prefix,l=function(e){return m.delta.relative?e.relativeDelta:e.delta},u=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+t(e)+o},p=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(i[0]));var g=C.select("text.delta");function v(){g.text(u(l(i[0]),a)).call(y.fill,p(i[0])).call(d.convertToTspans,e)}return g.call(c.font,m.delta.font).call(y.fill,p({delta:m._deltaLastValue})),w(k)?g.transition().duration(k.duration).ease(k.easing).tween("text",function(){var e=r.select(this),t=l(i[0]),o=m._deltaLastValue,s=P(m.delta.valueformat,a,o,t),c=n(o,t);return m._deltaLastValue=t,function(t){e.text(u(c(t),s)),e.call(y.fill,p({delta:c(t)}))}}).each("end",function(){v(),D&&D()}).each("interrupt",function(){v(),D&&D()}):v(),h=S(u(l(i[0]),a),m.delta.font,M,e),g}(),F+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,F+=m.delta.increasing.symbol+m.delta.decreasing.symbol,p=h),m._hasNumber&&(function(){var t=A(e,{tickformat:m.number.valueformat},m._range);t.setScale(),f.prepTicks(t);var a=function(e){return f.tickText(t,e).text},o=m.number.suffix,s=m.number.prefix,l=C.select("text.number");function h(){var t="number"==typeof i[0].y?s+a(i[0].y)+o:"-";l.text(t).call(c.font,m.number.font).call(d.convertToTspans,e)}w(k)?l.transition().duration(k.duration).ease(k.easing).each("end",function(){h(),D&&D()}).each("interrupt",function(){h(),D&&D()}).attrTween("text",function(){var e=r.select(this),t=n(i[0].lastY,i[0].y);m._lastValue=i[0].y;var l=P(m.number.valueformat,a,i[0].lastY,i[0].y);return function(r){e.text(s+l(t(r))+o)}}):h(),u=S(s+a(i[0].y)+o,m.number.font,M,e)}(),F+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,p=u),m._hasDelta&&m._hasNumber){var O,R,B=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=[(h.left+h.right)/2,(h.top+h.bottom)/2],N=.75*m.delta.font.size;"left"===m.delta.position&&(O=E(m,"deltaPos",0,-1*(u.width*b[m.align]+h.width*(1-b[m.align])+N),F,Math.min),R=B[1]-j[1],p={width:u.width+h.width+N,height:Math.max(u.height,h.height),left:h.left+O,right:u.right,top:Math.min(u.top,h.top+R),bottom:Math.max(u.bottom,h.bottom+R)}),"right"===m.delta.position&&(O=E(m,"deltaPos",0,u.width*(1-b[m.align])+h.width*b[m.align]+N,F,Math.max),R=B[1]-j[1],p={width:u.width+h.width+N,height:Math.max(u.height,h.height),left:u.left,right:h.right+O,top:Math.min(u.top,h.top+R),bottom:Math.max(u.bottom,h.bottom+R)}),"bottom"===m.delta.position&&(O=null,R=h.height,p={width:Math.max(u.width,h.width),height:u.height+h.height,left:Math.min(u.left,h.left),right:Math.max(u.right,h.right),top:u.bottom-u.height,bottom:u.bottom+h.height}),"top"===m.delta.position&&(O=null,R=u.top,p={width:Math.max(u.width,h.width),height:u.height+h.height,left:Math.min(u.left,h.left),right:Math.max(u.right,h.right),top:u.bottom-u.height-h.height,bottom:u.bottom}),z.attr({dx:O,dy:R})}(m._hasNumber||m._hasDelta)&&C.attr("transform",function(){var e=l.numbersScaler(p);F+=e[2];var t,r=E(m,"numbersScale",1,e[0],F,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?x-r*p.bottom:x-r*(p.top+p.bottom)/2,m._numbersTop=r*p.top+t;var i=p[T];"center"===T&&(i=(p.left+p.right)/2);var n=g-r*i;return s(n=E(m,"numbersTranslate",0,n,F,Math.max),t)+o(r)})})(e,P,t,{numbersX:D,numbersY:C,numbersScaler:I,transitionOpts:p,onComplete:g}),z&&(m={range:L.gauge.axis.range,color:L.gauge.bgcolor,line:{color:L.gauge.bordercolor,width:0},thickness:1},M={range:L.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:L.gauge.bordercolor,width:L.gauge.borderwidth},thickness:1});var $=P.selectAll("g.angular").data(F?t:[]);$.exit().remove();var W=P.selectAll("g.angularaxis").data(F?t:[]);W.exit().remove(),F&&function(e,t,n){var a,o,c,h,d,p,m=t[0].trace,g=n.size,y=n.radius,v=n.innerRadius,x=n.gaugeBg,b=n.gaugeOutline,_=[g.l+g.w/2,g.t+g.h/2+y/2],M=n.gauge,k=n.layer,S=n.transitionOpts,E=n.onComplete,D=Math.PI/2;function C(e){var t=m.gauge.axis.range[0],r=(e-t)/(m.gauge.axis.range[1]-t)*Math.PI-D;return r<-D?-D:r>D?D:r}function I(e){return r.svg.arc().innerRadius((v+y)/2-e/2*(y-v)).outerRadius((v+y)/2+e/2*(y-v)).startAngle(-D)}function L(e){e.attr("d",function(e){return I(e.thickness).startAngle(C(e.range[0])).endAngle(C(e.range[1]))()})}M.enter().append("g").classed("angular",!0),M.attr("transform",s(_[0],_[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(h=A(e,m.gauge.axis)).type="linear",h.range=m.gauge.axis.range,h._id="xangularaxis",h.ticklabeloverflow="allow",h.setScale();var P=function(e){return(h.range[0]-e.x)/(h.range[1]-h.range[0])*Math.PI+Math.PI},z={},F=f.makeLabelFns(h,0).labelStandoff;z.xFn=function(e){return Math.cos(P(e))*F},z.yFn=function(e){var t=P(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(F+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*u)},z.anchorFn=function(e){var t=Math.cos(P(e));return .1>Math.abs(t)?"middle":t>0?"start":"end"},z.heightFn=function(e,t,r){return -.5*(1+Math.sin(P(e)))*r};var O=function(e){return s(_[0]+y*Math.cos(e),_[1]-y*Math.sin(e))};if(d=f.calcTicks(h),p=f.getTickSigns(h)[2],h.visible){p="inside"===h.ticks?-1:1;var R=(h.linewidth||1)/2;f.drawTicks(e,h,{vals:d,layer:k,path:"M"+p*R+",0h"+p*h.ticklen,transFn:function(e){var t=P(e);return O(t)+"rotate("+-l(t)+")"}}),f.drawLabels(e,h,{vals:d,layer:k,transFn:function(e){return O(P(e))},labelFns:z})}var B=[x].concat(m.gauge.steps),j=M.selectAll("g.bg-arc").data(B);j.enter().append("g").classed("bg-arc",!0).append("path"),j.select("path").call(L).call(T),j.exit().remove();var N=I(m.gauge.bar.thickness),V=M.selectAll("g.value-arc").data([m.gauge.bar]);V.enter().append("g").classed("value-arc",!0).append("path");var U=V.select("path");w(S)?(U.transition().duration(S.duration).ease(S.easing).each("end",function(){E&&E()}).each("interrupt",function(){E&&E()}).attrTween("d",(a=N,o=C(t[0].lastY),c=C(t[0].y),function(){var e=i(o,c);return function(t){return a.endAngle(e(t))()}})),m._lastValue=t[0].y):U.attr("d","number"==typeof t[0].y?N.endAngle(C(t[0].y)):"M0,0Z"),U.call(T),V.exit().remove(),B=[];var q=m.gauge.threshold.value;(q||0===q)&&B.push({range:[q,q],color:m.gauge.threshold.color,line:{color:m.gauge.threshold.line.color,width:m.gauge.threshold.line.width},thickness:m.gauge.threshold.thickness});var G=M.selectAll("g.threshold-arc").data(B);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(L).call(T),G.exit().remove();var H=M.selectAll("g.gauge-outline").data([b]);H.enter().append("g").classed("gauge-outline",!0).append("path"),H.select("path").call(L).call(T),H.exit().remove()}(e,t,{radius:V,innerRadius:U,gauge:$,layer:W,size:B,gaugeBg:m,gaugeOutline:M,transitionOpts:p,onComplete:g});var Y=P.selectAll("g.bullet").data(O?t:[]);Y.exit().remove();var Z=P.selectAll("g.bulletaxis").data(O?t:[]);Z.exit().remove(),O&&function(e,t,r){var i,n,a,o,l,u=t[0].trace,c=r.gauge,d=r.layer,p=r.gaugeBg,m=r.gaugeOutline,g=r.size,v=u.domain,x=r.transitionOpts,b=r.onComplete;c.enter().append("g").classed("bullet",!0),c.attr("transform",s(g.l,g.t)),d.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),d.selectAll("g.xbulletaxistick,path,text").remove();var _=g.h,M=u.gauge.bar.thickness*_,k=v.x[0],S=v.x[0]+(v.x[1]-v.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);function E(e){e.attr("width",function(e){return Math.max(0,i.c2p(e.range[1])-i.c2p(e.range[0]))}).attr("x",function(e){return i.c2p(e.range[0])}).attr("y",function(e){return .5*(1-e.thickness)*_}).attr("height",function(e){return e.thickness*_})}(i=A(e,u.gauge.axis))._id="xbulletaxis",i.domain=[k,S],i.setScale(),n=f.calcTicks(i),a=f.makeTransTickFn(i),o=f.getTickSigns(i)[2],l=g.t+g.h,i.visible&&(f.drawTicks(e,i,{vals:"inside"===i.ticks?f.clipEnds(i,n):n,layer:d,path:f.makeTickPath(i,l,o),transFn:a}),f.drawLabels(e,i,{vals:n,layer:d,transFn:a,labelFns:f.makeLabelFns(i,l)}));var D=[p].concat(u.gauge.steps),C=c.selectAll("g.bg-bullet").data(D);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(E).call(T),C.exit().remove();var I=c.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",M).attr("y",(_-M)/2).call(T),w(x)?I.select("rect").transition().duration(x.duration).ease(x.easing).each("end",function(){b&&b()}).each("interrupt",function(){b&&b()}).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],t[0].y)))):I.select("rect").attr("width","number"==typeof t[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],t[0].y))):0),I.exit().remove();var L=t.filter(function(){return u.gauge.threshold.value||0===u.gauge.threshold.value}),P=c.selectAll("g.threshold-bullet").data(L);P.enter().append("g").classed("threshold-bullet",!0).append("line"),P.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*_).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*_).call(y.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),P.exit().remove();var z=c.selectAll("g.gauge-outline").data([m]);z.enter().append("g").classed("gauge-outline",!0).append("rect"),z.select("rect").call(E).call(T),z.exit().remove()}(e,t,{gauge:Y,layer:Z,size:B,gaugeBg:m,gaugeOutline:M,transitionOpts:p,onComplete:g});var X=P.selectAll("text.title").data(t);X.exit().remove(),X.enter().append("text").classed("title",!0),X.attr("text-anchor",function(){return O?v.right:v[L.title.align]}).text(L.title.text).call(c.font,L.title.font).call(d.convertToTspans,e),X.attr("transform",function(){var e,t=B.l+B.w*b[L.title.align],r=h.titlePadding,i=c.bBox(X.node());return z?(F&&(e=L.gauge.axis.visible?c.bBox(W.node()).top-r-i.bottom:B.t+B.h/2-V/2-i.bottom-r),O&&(e=C-(i.top+i.bottom)/2,t=B.l-h.bulletPadding*B.w)):e=L._numbersTop-r-i.bottom,s(t,e)})})}}}),NX=m({"src/traces/indicator/index.js"(e,t){t.exports={moduleType:"trace",name:"indicator",basePlotModule:NG(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:NH(),supplyDefaults:NW().supplyDefaults,calc:NY().calc,plot:NZ(),meta:{}}}}),NK=m({"lib/indicator.js"(e,t){t.exports=NX()}}),NJ=m({"src/traces/table/attributes.js"(e,t){var r=iv(),i=H().extendFlat,n=eH().overrideAll,a=$(),o=ai().attributes,s=tV().descriptionOnlyNumbers;t.exports=n({domain:o({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:i({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:i({},a({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:i({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:i({},a({arrayOk:!0}))}},"calc","from-root")}}),NQ=m({"src/traces/table/defaults.js"(e,t){var r=tb(),i=NJ(),n=ai().defaults;t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}n(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(e,t){for(var r=e.columnorder||[],i=e.header.values.length,n=r.slice(0,i),a=n.slice().sort(function(e,t){return e-t}),o=n.map(function(e){return a.indexOf(e)}),s=o.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),N2=m({"src/traces/table/data_preparation_helper.js"(e,t){var r=N1(),i=H().extendFlat,n=I(),a=F().isTypedArray,o=F().isArrayOrTypedArray;function s(e){if(o(e)){for(var t=0,r=0;r=t||u===e.length-1)&&(i[n]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=u,o=p(),n+=a,s=u+1,a=0);return i}function p(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}t.exports=function(e,t){var a=u(t.cells.values),p=function(e){return e.slice(t.header.values.length,e.length)},m=u(t.header.values);m.length&&!m[0].length&&(m[0]=[""],m=u(m));var g=m.concat(p(a).map(function(){return c((m[0]||[""]).length)})),y=t.domain,v=Math.floor(e._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(e._fullLayout._size.h*(y.y[1]-y.y[0])),b=t.header.values.length?g[0].map(function(){return t.header.height}):[r.emptyHeaderHeight],_=a.length?a[0].map(function(){return t.cells.height}):[],w=b.reduce(l,0),T=f(_,x-w+r.uplift),A=d(f(b,w),[]),M=d(T,A),k={},S=t.columnorder;o(S)&&(S=Array.from(S)),S=S.concat(p(a.map(function(e,t){return t})));var E=g.map(function(e,r){var i=o(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return n(i)?Number(i):1}),D=E.reduce(l,0);E=E.map(function(e){return e/D*v});var C=Math.max(s(t.header.line.width),s(t.cells.line.width)),I={key:t.uid+e._context.staticPlot,translateX:y.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-y.y[1]),size:e._fullLayout._size,width:v,maxLineWidth:C,height:x,columnOrder:S,groupHeight:x,rowBlocks:M,headerRowBlocks:A,scrollY:0,cells:i({},t.cells,{values:a}),headerCells:i({},t.header,{values:g}),gdColumns:g.map(function(e){return e[0]}),gdColumnsOriginalOrder:g.map(function(e){return e[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map(function(e,t){var r=k[e];return k[e]=(r||0)+1,{key:e+"__"+k[e],label:e,specIndex:t,xIndex:S[t],xScale:h,x:void 0,calcdata:void 0,columnWidth:E[t]}})};return I.columns.forEach(function(e){e.calcdata=I,e.x=h(e)}),I}}}),N3=m({"src/traces/table/data_split_helpers.js"(e){var t=H().extendFlat;e.splitToPanels=function(e){var r=[0,0],i=t({},e,{key:"header",type:"header",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:t({},e.calcdata,{cells:e.calcdata.headerCells})});return[t({},e,{key:"cells1",type:"cells",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),t({},e,{key:"cells2",type:"cells",page:1,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),i]},e.splitToCells=function(e){var t,r,i,n,a=(i=(r=(t=e).rowBlocks[t.page])?r.rows[0].rowIndex:0,n=r?i+r.rows.length:0,[i,n]);return(e.values||[]).slice(a[0],a[1]).map(function(t,r){return{keyWithinBlock:r+("string"==typeof t&&t.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:a[0]+r,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:t}})}}}),N5=m({"src/traces/table/plot.js"(e,t){var r=N1(),i=M(),n=tb(),a=n.numberFormat,o=yB(),s=rt(),l=tj(),u=tb().raiseToTop,c=tb().strTranslate,h=tb().cancelTransition,d=N2(),f=N3(),p=er();function m(e){return Math.ceil(e.calcdata.maxLineWidth/2)}function g(e,t){return"clip"+e._fullLayout._uid+"_scrollAreaBottomClip_"+t.key}function y(e,t){return"clip"+e._fullLayout._uid+"_columnBoundaryClippath_"+t.calcdata.key+"_"+t.specIndex}function v(e){return[].concat.apply([],e.map(function(e){return e})).map(function(e){return e.__data__})}function x(e,t,n){var a=e.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each(function(e){var t,i=e.scrollbarState;i.totalHeight=O(t=e.rowBlocks,t.length-1)+(t.length?R(t[t.length-1],1/0):1),i.scrollableAreaHeight=e.groupHeight-E(e),i.currentlyVisibleHeight=Math.min(i.totalHeight,i.scrollableAreaHeight),i.ratio=i.currentlyVisibleHeight/i.totalHeight,i.barLength=Math.max(i.ratio*i.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),i.barWiggleRoom=i.currentlyVisibleHeight-i.barLength,i.wiggleRoom=Math.max(0,i.totalHeight-i.scrollableAreaHeight),i.topY=0===i.barWiggleRoom?0:e.scrollY/i.wiggleRoom*i.barWiggleRoom,i.bottomY=i.topY+i.barLength,i.dragMultiplier=i.wiggleRoom/i.barWiggleRoom}).attr("transform",function(e){return c(e.width+r.scrollbarWidth/2+r.scrollbarOffset,E(e))});var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",function(e){return c(0,e.scrollbarState.topY||0)});var u=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);u.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),u.attr("y2",function(e){return e.scrollbarState.barLength-r.scrollbarWidth/2}).attr("stroke-opacity",function(e){return e.columnDragInProgress||!e.scrollbarState.barWiggleRoom||n?0:.4}),u.transition().delay(0).duration(0),u.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(r){var n=i.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=n-a.top,l=i.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||C(t,e,null,l(s-o.barLength/2))(r)}).call(i.behavior.drag().origin(function(e){return i.event.stopPropagation(),e.scrollbarState.scrollbarScrollInProgress=!0,e}).on("drag",C(t,e)).on("dragend",function(){})),h.attr("y2",function(e){return e.scrollbarState.scrollableAreaHeight}),t._context.staticPlot&&(u.remove(),h.remove())}function b(e,t,n,a){var l,u,c,h,d,m=((u=((l=n.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun)).enter().append("g").classed(r.cn.columnCells,!0),l.exit().remove(),l).selectAll("."+r.cn.columnCell).data(f.splitToCells,function(e){return e.keyWithinBlock})).enter().append("g").classed(r.cn.columnCell,!0),u.exit().remove(),u);m.each(function(e,t){var r=e.calcdata.cells.font,i=e.column.specIndex,n={size:T(r.size,i,t),color:T(r.color,i,t),family:T(r.family,i,t),weight:T(r.weight,i,t),style:T(r.style,i,t),variant:T(r.variant,i,t),textcase:T(r.textcase,i,t),lineposition:T(r.lineposition,i,t),shadow:T(r.shadow,i,t)};e.rowNumber=e.key,e.align=T(e.calcdata.cells.align,i,t),e.cellBorderWidth=T(e.calcdata.cells.line.width,i,t),e.font=n}),((c=m.selectAll("."+r.cn.cellRect).data(o.repeat,function(e){return e.keyWithinBlock})).enter().append("rect").classed(r.cn.cellRect,!0),c).attr("width",function(e){return e.column.columnWidth}).attr("stroke-width",function(e){return e.cellBorderWidth}).each(function(e){var t=i.select(this);p.stroke(t,T(e.calcdata.cells.line.color,e.column.specIndex,e.rowNumber)),p.fill(t,T(e.calcdata.cells.fill.color,e.column.specIndex,e.rowNumber))});var g=((d=((h=m.selectAll("."+r.cn.cellTextHolder).data(o.repeat,function(e){return e.keyWithinBlock})).enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),h).selectAll("."+r.cn.cellText).data(o.repeat,function(e){return e.keyWithinBlock})).enter().append("text").classed(r.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){i.event.stopPropagation()}),d);g.each(function(e){s.font(i.select(this),e.font)}),_(g,t,a,e),F(m)}function _(e,t,n,o){e.text(function(e){var t,i=e.column.specIndex,n=e.rowNumber,o=e.value,s="string"==typeof o,l=s&&o.match(/
/i),u=!s||l;e.mayHaveMarkup=s&&o.match(/[<&>]/);var c="string"==typeof(h=o)&&h.match(r.latexCheck);e.latex=c;var h,d,f=c?"":T(e.calcdata.cells.prefix,i,n)||"",p=c?"":T(e.calcdata.cells.suffix,i,n)||"",m=c?null:T(e.calcdata.cells.format,i,n)||null,g=f+(m?a(m)(e.value):e.value)+p;if(e.wrappingNeeded=!e.wrapped&&!u&&!c&&(d=w(g)),e.cellHeightMayIncrease=l||c||e.mayHaveMarkup||(void 0===d?w(g):d),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var y=(" "===r.wrapSplitCharacter?g.replace(/n&&i.push(a),n+=l}return i}(n,l,s);1===u.length&&(u[0]===n.length-1?u.unshift(u[0]-1):u.push(u[0]+1)),u[0]%2&&u.reverse(),t.each(function(e,t){e.page=u[t],e.scrollY=l}),t.attr("transform",function(e){return c(0,O(e.rowBlocks,e.page)-e.scrollY)}),e&&(I(e,r,t,u,i.prevPages,i,0),I(e,r,t,u,i.prevPages,i,1),x(r,e))}}function C(e,t,n,a){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter(function(e){return s.key===e.key}),u=n||s.scrollbarState.dragMultiplier,c=s.scrollY;return s.scrollY=void 0===a?s.scrollY+u*i.event.dy:a,D(e,l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(k),l),s.scrollY===c}}function I(e,t,r,i,n,a,o){i[o]!==n[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){b(e,t,r.filter(function(e,t){return t===o&&i[t]!==n[t]}),r),n[o]=i[o]}))}function L(e,t,n,a){return function(){var o=i.select(t.parentNode);o.each(function(e){var t=e.fragments;o.selectAll("tspan.line").each(function(e,r){t[r].width=this.getComputedTextLength()});var i,n,a=t[t.length-1].width,s=t.slice(0,-1),l=[],u=0,c=e.column.columnWidth-2*r.cellPad;for(e.value="";s.length;)u+(n=(i=s.shift()).width+a)>c&&(e.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],u=0),l.push(i.text),u+=n;u&&(e.value+=l.join(r.wrapSpacer)),e.wrapped=!0}),o.selectAll("tspan.line").remove(),_(o.select("."+r.cn.cellText),n,e,a),i.select(t.parentNode.parentNode).call(F)}}function P(e,t,n,a,o){return function(){if(!o.settledY){var s=i.select(t.parentNode),l=B(o),u=o.key-l.firstRowIndex,h=l.rows[u].rowHeight,d=Math.max(o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*r.cellPad:h,h);d-l.rows[u].rowHeight&&(l.rows[u].rowHeight=d,e.selectAll("."+r.cn.columnCell).call(F),D(null,e.filter(k),0),x(n,a,!0)),s.attr("transform",function(){var e=this.parentNode.getBoundingClientRect(),t=i.select(this.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),n=this.transform.baseVal.consolidate(),a=t.top-e.top+(n?n.matrix.f:r.cellPad);return c(z(o,i.select(this.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),a)}),o.settledY=!0}}}function z(e,t){switch(e.align){case"left":default:return r.cellPad;case"right":return e.column.columnWidth-(t||0)-r.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function F(e){e.attr("transform",function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce(function(e,t){return e+R(t,1/0)},0);return c(0,R(B(e),e.key)+t)}).selectAll("."+r.cn.cellRect).attr("height",function(e){var t,r;return(t=B(e),r=e.key,t.rows[r-t.firstRowIndex]).rowHeight})}function O(e,t){for(var r=0,i=t-1;i>=0;i--)r+=function(e){var t=e.allRowsHeight;if(void 0!==t)return t;for(var r=0,i=0;it.length&&(e=e.slice(0,t.length)):e=[],n=0;n90&&(d-=180,l=-l),{angle:d,flip:l,p:e.c2p(i,t,r),offsetMultplier:u}}}}),Vs=m({"src/traces/carpet/plot.js"(e,t){var r=M(),i=rt(),n=Vn(),a=Va(),o=Vo(),s=tj(),l=tb(),u=l.strRotate,c=l.strTranslate,h=tB();function d(e,t,o,s,l,u,c){var h="const-"+l+"-lines",d=o.selectAll("."+h).data(u);d.enter().append("path").classed(h,!0).style("vector-effect",c?"none":"non-scaling-stroke"),d.each(function(o){var s=o.x,l=o.y,u="M"+a(n([],s,e.c2p),n([],l,t.c2p),o.smoothing);r.select(this).attr("d",u).style("stroke-width",o.width).style("stroke",o.color).style("stroke-dasharray",i.dashStyle(o.dash,o.width)).style("fill","none")}),d.exit().remove()}function f(e,t,n,a,l,h,d,f){var p=h.selectAll("text."+f).data(d);p.enter().append("text").classed(f,!0);var m=0,g={};return p.each(function(l,h){if("auto"===l.axis.tickangle)d=o(a,t,n,l.xy,l.dxy);else{var d,f=(l.axis.tickangle+180)*Math.PI/180;d=o(a,t,n,l.xy,[Math.cos(f),Math.sin(f)])}h||(g={angle:d.angle,flip:d.flip});var p=(l.endAnchor?-1:1)*d.flip,y=r.select(this).attr({"text-anchor":p>0?"start":"end","data-notex":1}).call(i.font,l.font).text(l.text).call(s.convertToTspans,e),v=i.bBox(this);y.attr("transform",c(d.p[0],d.p[1])+u(d.angle)+c(l.axis.labelpadding*p,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)}),p.exit().remove(),g.maxExtent=m,g}t.exports=function(e,t,i,s){var u=e._context.staticPlot,c=t.xaxis,h=t.yaxis,p=e._fullLayout._clips;l.makeTraceGroups(s,i,"trace").each(function(t){var i,s,m,y,v,x,b,_,w,T,A,M,k,S,E,D,C=r.select(this),I=t[0],L=I.trace,P=L.aaxis,z=L.baxis,F=l.ensureSingle(C,"g","minorlayer"),O=l.ensureSingle(C,"g","majorlayer"),R=l.ensureSingle(C,"g","boundarylayer"),B=l.ensureSingle(C,"g","labellayer");C.style("opacity",L.opacity),d(c,h,O,P,"a",P._gridlines,!0),d(c,h,O,z,"b",z._gridlines,!0),d(c,h,F,P,"a",P._minorgridlines,!0),d(c,h,F,z,"b",z._minorgridlines,!0),d(c,h,R,P,"a-boundary",P._boundarylines,u),d(c,h,R,z,"b-boundary",z._boundarylines,u);var j=f(e,c,h,L,I,B,P._labels,"a-label"),N=f(e,c,h,L,I,B,z._labels,"b-label");i=e,s=B,m=L,y=I,v=c,x=h,b=j,_=N,k=l.aggNums(Math.min,null,m.a),S=l.aggNums(Math.max,null,m.a),E=l.aggNums(Math.min,null,m.b),D=l.aggNums(Math.max,null,m.b),w=.5*(k+S),T=E,A=m.ab2xy(w,T,!0),M=m.dxyda_rough(w,T),void 0===b.angle&&l.extendFlat(b,o(m,v,x,A,m.dxydb_rough(w,T))),g(i,s,m,y,A,M,m.aaxis,v,x,b,"a-title"),w=k,T=.5*(E+D),A=m.ab2xy(w,T,!0),M=m.dxydb_rough(w,T),void 0===_.angle&&l.extendFlat(_,o(m,v,x,A,m.dxyda_rough(w,T))),g(i,s,m,y,A,M,m.baxis,v,x,_,"b-title"),function(e,t,r,i,o){var s,u,c=r.select("#"+e._clipPathId);c.size()||(c=r.append("clipPath").classed("carpetclip",!0));var h=l.ensureSingle(c,"path","carpetboundary"),d=t.clipsegments,f=[];for(u=0;u90&&v<270&&(_=(-s.lineCount(x)+m)*p*a-_),x.attr("transform",c(t.p[0],t.p[1])+u(t.angle)+c(0,_)).attr("text-anchor","middle").call(i.font,d.title.font)}),b.exit().remove()}}}),Vl=m({"src/traces/carpet/cheater_basis.js"(e,t){var r=tb().isArrayOrTypedArray;t.exports=function(e,t,i){var n,a,o,s,l,u=[],c=r(e)?e.length:e,h=r(t)?t.length:t,d=r(e)?e:null,f=r(t)?t:null;d&&(o=(d.length-1)/(d[d.length-1]-d[0])/(c-1)),f&&(s=(f.length-1)/(f[f.length-1]-f[0])/(h-1));var p,m=1/0,g=-1/0;for(a=0;a=10)return null;for(var n=1/0,a=-1/0,o=t.length,s=0;s0&&(f=e.dxydi([],i-1,o,0,s),y.push(l[0]+f[0]/3),v.push(l[1]+f[1]/3),p=e.dxydi([],i-1,o,1,s),y.push(h[0]-p[0]/3),v.push(h[1]-p[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(u=Math.floor(Math.max(0,Math.min(C-2,i=e.a2i(r)))),c=i-u,x.length=C,x.crossLength=I,x.xy=function(t){return e.evalxy([],i,t)},x.dxy=function(t,r){return e.dxydj([],u,t,c,r)},a=0;a0&&(m=e.dxydj([],u,a-1,c,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=e.dxydj([],u,a-1,c,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=t,x.axis=b,x.crossAxis=M,x.value=r,x.constvar=n,x.index=d,x.x=y,x.y=v,x.smoothing=M.smoothing,x}function z(r){var i,a,o,s,l,u=[],c=[],h={};if(h.length=x.length,h.crossLength=A.length,"b"===t)for(o=Math.max(0,Math.min(I-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(t){return e.evalxy([],t,r)},h.dxy=function(t,r){return e.dxydi([],t,o,r,l)},i=0;ix.length-1||_.push(i(z(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(d=c;dx.length-1)&&!(m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;ax[x.length-1]||w.push(i(P(p),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash})));b.startline&&T.push(i(z(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(z(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,c=(u=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort(function(e,t){return e-t}))[0],h=u[1],d=c;d<=h;d++)f=b.tick0+b.dtick*d,_.push(i(P(f),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(d=c-1;dx[x.length-1]||w.push(i(P(p),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&T.push(i(P(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(P(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}}}),Vh=m({"src/traces/carpet/calc_labels.js"(e,t){var r=ro(),i=H().extendFlat;t.exports=function(e,t){var n,a,o,s,l,u=t._labels=[],c=t._gridlines;for(n=0;n=0;n--)a[c-n]=e[h][n],o[c-n]=t[h][n];for(s.push({x:a,y:o,bicubic:l}),n=h,a=[],o=[];n>=0;n--)a[h-n]=e[n][0],o[h-n]=t[n][0];return s.push({x:a,y:o,bicubic:u}),s}}}),Vf=m({"src/traces/carpet/smooth_fill_2d_array.js"(e,t){var r=tb();t.exports=function(e,t,i){var n,a,o,s=[],l=[],u=e[0].length,c=e.length,h=0;for(n=0;n0&&void 0!==(i=e[r][t-1])&&(a++,n+=i),t0&&void 0!==(i=e[r-1][t])&&(a++,n+=i),r0&&a0&&n1e-5);return r.log("Smoother converged to",T,"after",A,"iterations"),e}}}),Vp=m({"src/traces/carpet/constants.js"(e,t){t.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Vm=m({"src/traces/carpet/catmull_rom.js"(e,t){t.exports=function(e,t,r,i){var n=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(n*n+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*n-l*l*o)*i,h=(u*u*a-l*l*s)*i,d=u*(l+u)*3,f=l*(l+u)*3;return[[t[0]+(d&&c/d),t[1]+(d&&h/d)],[t[0]-(f&&c/f),t[1]-(f&&h/f)]]}}}),Vg=m({"src/traces/carpet/compute_control_points.js"(e,t){var r=Vm(),i=tb().ensureArray;function n(e,t,r){var i=-.5*r[0]+1.5*t[0],n=-.5*r[1]+1.5*t[1];return[(2*i+e[0])/3,(2*n+e[1])/3]}t.exports=function(e,t,a,o,s,l){var u,c,h,d,f,p,m,g,y,v,x=a[0].length,b=a.length,_=s?3*x-2:x,w=l?3*b-2:b;for(e=i(e,w),t=i(t,w),h=0;hf&&em&&tp||tg},e.setScale=function(){var t=e._x,r=e._y,i=n(e._xctrl,e._yctrl,t,r,h.smoothing,d.smoothing);e._xctrl=i[0],e._yctrl=i[1],e.evalxy=a([e._xctrl,e._yctrl],u,c,h.smoothing,d.smoothing),e.dxydi=o([e._xctrl,e._yctrl],h.smoothing,d.smoothing),e.dxydj=s([e._xctrl,e._yctrl],h.smoothing,d.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),u-2),i=e[0]-r;return(1-i)*t[r]+i*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),u-2),r=e[1]-t;return(1-r)*l[t]+r*l[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(i(e,t),u-2)),n=t[r],a=t[r+1];return Math.max(0,Math.min(u-1,r+(e-n)/(a-n)))},e.b2j=function(e){var t=Math.max(0,Math.min(i(e,l),c-2)),r=l[t],n=l[t+1];return Math.max(0,Math.min(c-1,t+(e-r)/(n-r)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(r,i,n){if(!n&&(rt[u-1]|il[c-1]))return[!1,!1];var a=e.a2i(r),o=e.b2j(i),s=e.evalxy([],a,o);if(n){var h,d,f,p,m=0,g=0,y=[];rt[u-1]?(h=u-2,d=1,m=(r-t[u-1])/(t[u-1]-t[u-2])):(h=Math.max(0,Math.min(u-2,Math.floor(a))),d=a-h),il[c-1]?(f=c-2,p=1,g=(i-l[c-1])/(l[c-1]-l[c-2])):(f=Math.max(0,Math.min(c-2,Math.floor(o))),p=o-f),m&&(e.dxydi(y,h,f,d,p),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(e.dxydj(y,h,f,d,p),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(l.length-2,e));return l[t+1]-l[t]},e.dxyda=function(t,r,i,n){var a=e.dxydi(null,t,r,i,n),o=e.dadi(t,i);return[a[0]/o,a[1]/o]},e.dxydb=function(t,r,i,n){var a=e.dxydj(null,t,r,i,n),o=e.dbdj(r,n);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,r,i){var n=y*(i||.1),a=e.ab2xy(t+n,r,!0),o=e.ab2xy(t-n,r,!0);return[(a[0]-o[0])*.5/n,(a[1]-o[1])*.5/n]},e.dxydb_rough=function(t,r,i){var n=v*(i||.1),a=e.ab2xy(t,r+n,!0),o=e.ab2xy(t,r-n,!0);return[(a[0]-o[0])*.5/n,(a[1]-o[1])*.5/n]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}}}),V_=m({"src/traces/carpet/calc.js"(e,t){var r=ro(),i=tb().isArray1D,n=Vl(),a=Vu(),o=Vc(),s=Vh(),l=Vd(),u=oe(),c=Vf(),h=a9(),d=Vb();t.exports=function(e,t){var f=r.getFromId(e,t.xaxis),p=r.getFromId(e,t.yaxis),m=t.aaxis,g=t.baxis,y=t.x,v=t.y,x=[];y&&i(y)&&x.push("x"),v&&i(v)&&x.push("y"),x.length&&h(t,m,g,"a","b",x);var b=t._a=t._a||t.a,_=t._b=t._b||t.b;y=t._x||t.x,v=t._y||t.y;var w={};t._cheater&&(y=n("index"===m.cheatertype?b.length:b,"index"===g.cheatertype?_.length:_,t.cheaterslope)),t._x=y=u(y),t._y=v=u(v),c(y,b,_),c(v,b,_),d(t),t.setScale();var T=a(y),A=a(v),M=.5*(T[1]-T[0]),k=.5*(T[1]+T[0]),S=.5*(A[1]-A[0]),E=.5*(A[1]+A[0]);return T=[k-1.3*M,k+1.3*M],A=[E-1.3*S,E+1.3*S],t._extremes[f._id]=r.findExtremes(f,T,{padded:!0}),t._extremes[p._id]=r.findExtremes(p,A,{padded:!0}),o(t,"a","b"),o(t,"b","a"),s(t,m),s(t,g),w.clipsegments=l(t._xctrl,t._yctrl,m,g),w.x=y,w.y=v,w.a=b,w.b=_,[w]}}}),Vw=m({"src/traces/carpet/index.js"(e,t){t.exports={attributes:N9(),supplyDefaults:Vi(),plot:Vs(),calc:V_(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:ng(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),VT=m({"lib/carpet.js"(e,t){t.exports=Vw()}}),VA=m({"src/traces/scattercarpet/attributes.js"(e,t){var r=ib(),i=i_(),n=X(),{hovertemplateAttrs:a,texttemplateAttrs:o,templatefallbackAttrs:s}=eY(),l=tG(),u=H().extendFlat,c=i.marker,h=i.line,d=c.line;t.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:u({},i.mode,{dflt:"markers"}),text:u({},i.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:s({editType:"plot"}),hovertext:u({},i.hovertext,{}),line:{color:h.color,width:h.width,dash:h.dash,backoff:h.backoff,shape:u({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:i.connectgaps,fill:u({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:u({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:u({width:d.width,dash:d.dash,editType:"calc"},l("marker.line")),gradient:c.gradient,editType:"calc"},l("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:u({},n.hoverinfo,{flags:["a","b","text","name"]}),hoveron:i.hoveron,hovertemplate:a(),hovertemplatefallback:s(),zorder:i.zorder}}}),VM=m({"src/traces/scattercarpet/defaults.js"(e,t){var r=tb(),i=ix(),n=t6(),a=iH(),o=i$(),s=iW(),l=iY(),u=iZ(),c=VA();t.exports=function(e,t,h,d){function f(i,n){return r.coerce(e,t,c,i,n)}f("carpet"),t.xaxis="x",t.yaxis="y";var p=f("a"),m=f("b"),g=Math.min(p.length,m.length);if(!g){t.visible=!1;return}t._length=g,f("text"),f("texttemplate"),f("texttemplatefallback"),f("hovertext"),f("mode",g")}return o}function y(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,m.push(r+": "+t.toFixed(3)+e.labelsuffix)}}}}),VI=m({"src/traces/scattercarpet/event_data.js"(e,t){t.exports=function(e,t,r,i,n){var a=i[n];return e.a=a.a,e.b=a.b,e.y=a.y,e}}}),VL=m({"src/traces/scattercarpet/index.js"(e,t){t.exports={attributes:VA(),supplyDefaults:VM(),colorbar:nr(),formatLabels:Vk(),calc:VE(),plot:VD(),style:nn().style,styleOnSelect:nn().styleOnSelect,hoverPoints:VC(),selectPoints:ns(),eventData:VI(),moduleType:"trace",name:"scattercarpet",basePlotModule:ng(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),VP=m({"lib/scattercarpet.js"(e,t){t.exports=VL()}}),Vz=m({"src/traces/contourcarpet/attributes.js"(e,t){var r=aJ(),i=oD(),n=tG(),a=H().extendFlat,o=i.contours;t.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},zorder:i.zorder},n("",{cLetter:"z",autoColorDflt:!1}))}}),VF=m({"src/traces/contourcarpet/defaults.js"(e,t){var r=tb(),i=aQ(),n=Vz(),a=oJ(),o=oI(),s=oP();t.exports=function(e,t,l,u){function c(i,a){return r.coerce(e,t,n,i,a)}if(c("carpet"),e.a&&e.b){if(!i(e,t,c,u,"a","b")){t.visible=!1;return}c("text"),"constraint"===c("contours.type")?a(e,t,c,u,l,{hasHover:!1}):(o(e,t,c,function(i){return r.coerce2(e,t,n,i)}),s(e,t,c,u,{hasHover:!1}))}else t._defaultColor=l,t._length=null;c("zorder")}}}),VO=m({"src/traces/contourcarpet/calc.js"(e,t){var r=t5(),i=tb(),n=a9(),a=oe(),o=ot(),s=or(),l=oi(),u=VF(),c=VS(),h=oF();t.exports=function(e,t){var d=t._carpetTrace=c(e,t);if(!(!d||!d.visible||"legendonly"===d.visible)){if(!t.a||!t.b){var f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D,C=e.data[d.index],I=e.data[t.index];I.a||(I.a=C.a),I.b||(I.b=C.b),u(I,t,t._defaultColor,e._fullLayout)}var L=(f=e,T=(w=(p=t)._carpetTrace).aaxis,A=w.baxis,T._minDtick=0,A._minDtick=0,i.isArray1D(p.z)&&n(p,T,A,"a","b",["z"]),m=p._a=p._a||p.a,v=p._b=p._b||p.b,m=m?T.makeCalcdata(p,"_a"):[],v=v?A.makeCalcdata(p,"_b"):[],g=p.a0||0,y=p.da||1,x=p.b0||0,b=p.db||1,_=p._z=a(p._z||p.z,p.transpose),p._emptypoints=s(_),o(_,p._emptypoints),M=i.maxRowLength(_),k="scaled"===p.xtype?"":m,S=l(p,k,g,y,M,T),E="scaled"===p.ytype?"":v,D=l(p,E,x,b,_.length,A),"levels"===p.contours.type&&"none"!==p.contours.coloring&&r(f,p,{vals:_,containerStr:"",cLetter:"z"}),[{a:S,b:D,z:_}]);return h(t,t._z),L}}}}),VR=m({"src/traces/carpet/axis_aligned_line.js"(e,t){var r=tb().isArrayOrTypedArray;t.exports=function(e,t,i,n){var a,o,s,l,u,c,h,d,f,p,m,g,y,v=r(i)?"a":"b",x=("a"===v?e.aaxis:e.baxis).smoothing,b="a"===v?e.a2i:e.b2j,_="a"===v?i:n,w="a"===v?n:i,T="a"===v?t.a.length:t.b.length,A="a"===v?t.b.length:t.a.length,M=Math.floor("a"===v?e.b2j(w):e.a2i(w)),k="a"===v?function(t){return e.evalxy([],t,M)}:function(t){return e.evalxy([],M,t)};x&&(s=Math.max(0,Math.min(A-2,M)),l=M-s,o="a"===v?function(t,r){return e.dxydi([],t,s,r,l)}:function(t,r){return e.dxydj([],s,t,l,r)});var S=b(_[0]),E=b(_[1]),D=S0?Math.floor:Math.ceil,L=D>0?Math.ceil:Math.floor,P=D>0?Math.min:Math.max,z=D>0?Math.max:Math.min,F=I(S+C),O=L(E-C),R=[[h=k(S)]];for(a=F;a*D=0;J--)X=i([],(Z=k.clipsegments[J]).x,_.c2p),K=i([],Z.y,w.c2p),X.reverse(),K.reverse(),Q.push(n(X,K,Z.bicubic));var ee="M"+Q.join("L")+"Z";(function(e,t,r,a,s,l){var u,c,h=o.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);h.enter().append("path"),h.exit().remove();var d=[];for(c=0;c=0&&(h=E,f=p):Math.abs(c[1]-h[1])<_?Math.abs(c[1]-E[1])<_&&(E[0]-c[0])*(h[0]-E[0])>=0&&(h=E,f=p):o.log("endpt to newendpt is not vert. or horz.",c,h,E)}if(f>=0)break;y+=k(c,h),c=h}if(f===e.edgepaths.length){o.log("unclosed perimeter path");break}u=f,(x=-1===v.indexOf(u))&&(u=v[0],y+=k(c,h)+"Z",c=null)}for(u=0;um&&(i.max=m),i.len=i.max-i.min}function x(e,t){var r=0;return(.1>Math.abs(e[0]-l)||.1>Math.abs(e[0]-u))&&(r=Math.max(r,a*v(t,y(n.dxydb_rough(e[0],e[1],.1)))/2)),(.1>Math.abs(e[1]-c)||.1>Math.abs(e[1]-h))&&(r=Math.max(r,a*v(t,y(n.dxyda_rough(e[0],e[1],.1)))/2)),r}}(this,r,e,i,h,t.height),!(i.len<(t.width+t.height)*c.LABELMIN)))for(var n=Math.min(Math.ceil(i.len/P),c.LABELMAX),a=0;ay):g=M>w,y=M;var k=u(w,T,A,M);k.pos=_,k.yc=(w+M)/2,k.i=b,k.dir=g?"increasing":"decreasing",k.x=k.pos,k.y=[A,T],v&&(k.orig_p=a[b]),p&&(k.tx=t.text[b]),m&&(k.htx=t.hovertext[b]),x.push(k)}else x.push({pos:_,empty:!0})}return t._extremes[l._id]=n.findExtremes(l,r.concat(d,h),{padded:!0}),x.length&&(x[0].t={labels:{open:i(e,"open:")+" ",high:i(e,"high:")+" ",low:i(e,"low:")+" ",close:i(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var i=n.getFromId(e,t.xaxis),o=n.getFromId(e,t.yaxis),u=function(e,t,i){var n=i._minDiff;if(!n){var o,s=e._fullData,l=[];for(o=0,n=1/0;o"+c.labels[v]+r.hoverLabelText(s,x,l.yhoverformat)):((y=i.extendFlat({},d)).y0=y.y1=b,y.yLabelVal=x,y.yLabel=c.labels[v]+r.hoverLabelText(s,x,l.yhoverformat),y.name="",h.push(y),m[x]=y)}return h}function h(e,t,i,n){var a=e.cd,s=e.ya,c=a[0].trace,h=a[0].t,d=u(e,t,i,n);if(!d)return[];var f=a[d.index],p=d.index=f.i,m=f.dir;function g(e){return h.labels[e]+r.hoverLabelText(s,c[e][p],c.yhoverformat)}var y=f.hi||c.hoverinfo||"",v=y.split("+"),x="all"===y,b=x||-1!==v.indexOf("y"),_=x||-1!==v.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return _&&o(f,c,w),d.extraText=w.join("
"),d.y0=d.y1=s.c2p(f.yc,!0),[d]}t.exports={hoverPoints:function(e,t,r,i){return e.cd[0].trace.hoverlabel.split?c(e,t,r,i):h(e,t,r,i)},hoverSplit:c,hoverOnPoints:h}}}),VY=m({"src/traces/ohlc/select.js"(e,t){t.exports=function(e,t){var r,i=e.cd,n=e.xaxis,a=e.yaxis,o=[],s=i[0].t.bPos||0;if(!1===t)for(r=0;rt?function(e){return e<=0}:function(e){return e>=0};s.c2g=function(t){var r=s.c2l(t)-e;return(a(r)?r:0)+n},s.g2c=function(t){return s.l2c(t+e-n)},s.g2p=function(e){return e*i},s.c2p=function(e){return s.g2p(s.c2g(e))}};break;case"angularaxis":var u=e,c=t,h=u.type;if("linear"===h){var d=u.d2c,f=u.c2d;u.d2c=function(e,t){var r;return r=d(e),"degrees"===t?n(r):r},u.c2d=function(e,t){return f("degrees"===t?a(e):e)}}u.makeCalcdata=function(e,t){var r,i,n=e[t],a=e._length,o=function(t){return u.d2c(t,e.thetaunit)};if(n)for(r=Array(a),i=0;i1e-10?e:0}function h(e,t,r){t=t||0,r=r||0;for(var i=e.length,n=Array(i),a=0;a0?r:1/0}),a=r.mod(i+1,t.length);return[t[i],t[a]]},findIntersectionXY:l,findXYatLength:function(e,t,r,i){var n=-t*r,a=t*t+1,o=2*(t*n-r),s=Math.sqrt(o*o-4*a*(n*n+r*r-e*e)),l=(-o+s)/(2*a),u=(-o-s)/(2*a);return[[l,t*l+n+i],[u,t*u+n+i]]},clampTiny:c,pathPolygon:function(e,t,r,i,n,a){return"M"+h(u(e,t,r,i),n,a).join("L")},pathPolygonAnnulus:function(e,t,r,i,n,a,o){e0))!=(a<0?-1:+(a>0))){var f=i(e,r([t,0]));return["M"+l+","+u,"A"+o+","+o+" 0 0,"+(0=90||v>90&&x>=450?1:_<=0&&T<=0?0:Math.max(_,T),[v<=180&&x>=180||v>180&&x>=540?-1:b>=0&&w>=0?0:Math.min(b,w),v<=270&&x>=270||v>270&&x>=630?-1:_>=0&&T>=0?0:Math.min(_,T),x>=360?1:b<=0&&w<=0?0:Math.max(b,w),m]),C=D[2]-D[0],I=Math.abs((D[3]-D[1])/C);d/h>I?(A=h,E=(d-(M=h*I))/i.h/2,k=[u[0],u[1]],S=[c[0]+E,c[1]-E]):(A=d/I,M=d,E=(h-A)/i.w/2,k=[u[0]+E,u[1]-E],S=[c[0],c[1]]),this.xLength2=A,this.yLength2=M,this.xDomain2=k,this.yDomain2=S;var L,P=this.xOffset2=i.l+i.w*k[0],O=this.yOffset2=i.t+i.h*(1-S[1]),R=this.radius=A/C,B=this.innerRadius=this.getHole(t)*R,j=this.cx=P-R*D[0],N=this.cy=O+R*D[3],V=this.cxx=j-P,U=this.cyy=N-O,q=n.side;"counterclockwise"===q?(L=q,q="top"):"clockwise"===q&&(L=q,q="bottom"),this.radialAxis=this.mockAxis(e,t,n,{_id:"x",side:q,_trueSide:L,domain:[B/i.w,R/i.w]}),this.angularAxis=this.mockAxis(e,t,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(e,t),this.updateAngularAxis(e,t),this.updateRadialAxis(e,t),this.updateRadialAxisTitle(e,t),this.xaxis=this.mockCartesianAxis(e,t,{_id:"x",domain:k}),this.yaxis=this.mockCartesianAxis(e,t,{_id:"y",domain:S});var G=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",G).attr("transform",o(V,U)),r.frontplot.attr("transform",o(P,O)).call(l.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",G).attr("transform",o(j,N)).call(s.fill,t.bgcolor)},B.mockAxis=function(e,t,r,i){var a=n.extendFlat({},r,i);return d(a,t,e),a},B.mockCartesianAxis=function(e,t,r){var i=this,a=i.isSmith,o=r._id,s=n.extendFlat({type:"linear"},r);h(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=i.sectorBBox,r=l[o],n=i.radialAxis._rl,a=(n[1]-n[0])/(1-i.getHole(t));s.range=[e[r[0]]*a,e[r[1]]*a]},s.isPtWithinRange="x"!==o||a?function(){return!0}:function(e){return i.isPtInside(e)},s.setRange(),s.setScale(),s},B.doAutoRange=function(e,t){var r=this.gd,i=this.radialAxis,n=this.getRadial(t);f(r,i);var a=i.range;if(n.range=a.slice(),n._input.range=a.slice(),i._rl=[i.r2l(a[0],null,"gregorian"),i.r2l(a[1],null,"gregorian")],void 0!==i.minallowed){var o=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],o):i._rl[0]=Math.max(i._rl[0],o)}if(void 0!==i.maxallowed){var s=i.r2l(i.maxallowed);i._rl[0]90&&m<=270&&(g.tickangle=180);var x=v?function(e){var t=L(r,D([e.x,0]));return o(t[0]-d,t[1]-f)}:function(e){return o(g.l2p(e.x)+h,0)},b=v?function(e){return I(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(g.r2p(e.x)+h)},_=j(p);if(r.radialTickLayout!==_&&(l["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),y){g.setScale();var w=0,T=v?(g.tickvals||[]).filter(function(e){return e>=0}).map(function(e){return c.tickText(g,e,!0,!1)}):c.calcTicks(g),A=v?T:c.clipEnds(g,T),M=c.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(M=-M),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),c.drawTicks(i,g,{vals:T,layer:l["radial-axis"],path:c.makeTickPath(g,0,M),transFn:x,crisp:!1}),c.drawGrid(i,g,{vals:A,layer:l["radial-grid"],path:b,transFn:n.noop,crisp:!1}),c.drawLabels(i,g,{vals:T,layer:l["radial-axis"],transFn:x,labelFns:c.makeLabelFns(g,w)})}var k=r.radialAxisAngle=r.vangles?O(N(F(p.angle),r.vangles)):p.angle,S=o(d,f),E=S+a(-k);V(l["radial-axis"],y&&(p.showticklabels||p.ticks),{transform:E}),V(l["radial-grid"],y&&p.showgrid,{transform:v?"":S}),V(l["radial-line"].select("line"),y&&p.showline,{x1:v?-u:h,y1:0,x2:u,y2:0,transform:E}).attr("stroke-width",p.linewidth).call(s.stroke,p.linecolor)},B.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var i=this.gd,n=this.radius,a=this.cx,o=this.cy,s=this.getRadial(t),u=this.id+"title",c=0;if(s.title){var h=l.bBox(this.layers["radial-axis"].node()).height,d=s.title.font.size,f=s.side;c="top"===f?d:"counterclockwise"===f?-(h+.4*d):h+.8*d}var p=void 0!==r?r:this.radialAxisAngle,m=F(p),g=Math.cos(m),v=Math.sin(m),x=a+n/2*g+c*v,b=o-n/2*v+c*g;this.layers["radial-axis-title"]=y.draw(i,u,{propContainer:s,propName:this.id+".radialaxis.title.text",placeholder:P(i,"Click to enter radial axis title"),attributes:{x:x,y:b,"text-anchor":"middle"},transform:{rotate:-p}})}},B.updateAngularAxis=function(e,t){var r,i=this,l=i.gd,u=i.layers,h=i.radius,d=i.innerRadius,f=i.cx,p=i.cy,m=i.getAngular(t),g=i.angularAxis,y=i.isSmith;y||(i.fillViewInitialKey("angularaxis.rotation",m.rotation),g.setGeometry(),g.setScale());var v=y?function(e){var t=L(i,D([0,e.x]));return Math.atan2(t[0]-f,t[1]-p)-Math.PI/2}:function(e){return g.t2g(e.x)};"linear"===g.type&&"radians"===g.thetaunit&&(g.tick0=O(g.tick0),g.dtick=O(g.dtick));var x=function(e){return o(f+h*Math.cos(e),p-h*Math.sin(e))},b=y?function(e){var t=L(i,D([0,e.x]));return o(t[0],t[1])}:function(e){return x(v(e))},_=y?function(e){var t=L(i,D([0,e.x])),r=Math.atan2(t[0]-f,t[1]-p)-Math.PI/2;return o(t[0],t[1])+a(-O(r))}:function(e){var t=v(e);return x(t)+a(-O(t))},w=y?function(e){return C(i,e.x,0,1/0)}:function(e){var t=v(e),r=Math.cos(t),i=Math.sin(t);return"M"+[f+d*r,p-d*i]+"L"+[f+h*r,p-h*i]},T=c.makeLabelFns(g,0).labelStandoff,M={};M.xFn=function(e){return Math.cos(v(e))*T},M.yFn=function(e){var t=v(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(T+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*A)},M.anchorFn=function(e){var t=Math.cos(v(e));return .1>Math.abs(t)?"middle":t>0?"start":"end"},M.heightFn=function(e,t,r){return -.5*(1+Math.sin(v(e)))*r};var k=j(m);i.angularTickLayout!==k&&(u["angular-axis"].selectAll("."+g._id+"tick").remove(),i.angularTickLayout=k);var S=y?[1/0].concat(g.tickvals||[]).map(function(e){return c.tickText(g,e,!0,!1)}):c.calcTicks(g);if(y&&(S[0].text="∞",S[0].fontSize*=1.75),"linear"===t.gridshape?(r=S.map(v),0>n.angleDelta(r[0],r[1])&&(r=r.slice().reverse())):r=null,i.vangles=r,"category"===g.type&&(S=S.filter(function(e){return n.isAngleInsideSector(v(e),i.sectorInRad)})),g.visible){var E="inside"===g.ticks?-1:1,I=(g.linewidth||1)/2;c.drawTicks(l,g,{vals:S,layer:u["angular-axis"],path:"M"+E*I+",0h"+E*g.ticklen,transFn:_,crisp:!1}),c.drawGrid(l,g,{vals:S,layer:u["angular-grid"],path:w,transFn:n.noop,crisp:!1}),c.drawLabels(l,g,{vals:S,layer:u["angular-axis"],repositionOnUpdate:!0,transFn:b,labelFns:M})}V(u["angular-line"].select("path"),m.showline,{d:i.pathSubplot(),transform:o(f,p)}).attr("stroke-width",m.linewidth).call(s.stroke,m.linecolor)},B.updateFx=function(e,t){this.gd._context.staticPlot||(this.isSmith||(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},B.updateHoverAndMainDrag=function(e){var t,a,l=this,u=l.isSmith,c=l.gd,h=l.layers,d=e._zoomlayer,f=k.MINZOOM,y=k.OFFEDGE,_=l.radius,w=l.innerRadius,T=l.cx,A=l.cy,M=l.cxx,E=l.cyy,D=l.sectorInRad,C=l.vangles,I=l.radialAxis,L=S.clampTiny,P=S.findXYatLength,z=S.findEnclosingVertexAngles,F=k.cornerHalfWidth,O=k.cornerLen/2,R=p.makeDragger(h,"path","maindrag",!1===e.dragmode?"none":"crosshair");r.select(R).attr("d",l.pathSubplot()).attr("transform",o(T,A)),R.onmousemove=function(e){g.hover(c,e,l.id),c._fullLayout._lasthover=R,c._fullLayout._hoversubplot=l.id},R.onmouseout=function(e){c._dragging||m.unhover(c,e)};var B,j,N,V,U,q,G,H,$,W={element:R,gd:c,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Y(e,t){return Math.sqrt(e*e+t*t)}function Z(e,t){return Math.atan2(E-t,e-M)}function X(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function K(e,t){if(0===e)return l.pathSector(2*F);var r=O/e,i=t-r,n=t+r,a=Math.max(0,Math.min(e,_)),o=a-F,s=a+F;return"M"+X(o,i)+"A"+[o,o]+" 0,0,0 "+X(o,n)+"L"+X(s,n)+"A"+[s,s]+" 0,0,1 "+X(s,i)+"Z"}function J(e,t,r){if(0===e)return l.pathSector(2*F);var i,n,a,o,s=X(e,t),u=X(e,r),c=L((s[0]+u[0])/2),h=L((s[1]+u[1])/2);if(c&&h){var d=h/c,f=-1/d,p=P(F,d,c,h);a=P(O,f,p[0][0],p[0][1]),o=P(O,f,p[1][0],p[1][1])}else h?(i=O,n=F):(i=F,n=O),a=[[c-i,h-n],[c+i,h-n]],o=[[c-i,h+n],[c+i,h+n]];return"M"+a.join("L")+"L"+o.reverse().join("L")+"Z"}function Q(e,t){return t=Math.max(Math.min(t,_),w),ef?(e-1&&1===e&&x(t,c,[l.xaxis],[l.yaxis],l.id,W),r.indexOf("event")>-1&&g.click(c,t,l.id)}W.prepFn=function(e,r,i){var o,h=c._fullLayout.dragmode,f=R.getBoundingClientRect();c._fullLayout._calcInverseTransform(c);var m=c._fullLayout._invTransform;t=c._fullLayout._invScaleX,a=c._fullLayout._invScaleY;var g=n.apply3DTransform(m)(r-f.left,i-f.top);if(B=g[0],j=g[1],C){var y=S.findPolygonOffset(_,D[0],D[1],C);B+=M+y[0],j+=E+y[1]}switch(h){case"zoom":W.clickFn=eo,u||(C?W.moveFn=ei:W.moveFn=et,W.doneFn=en,N=null,V=null,U=l.pathSubplot(),q=!1,o=c._fullLayout[l.id],G=s.luminosity(o.bgcolor),(H=p.makeZoombox(d,G,T,A,U)).attr("fill-rule","evenodd"),$=p.makeCorners(d,T,A),b(c));break;case"select":case"lasso":v(e,r,i,W,h)}},m.init(W)},B.updateRadialDrag=function(e,t,s){var l,u,c,h=this,d=h.gd,f=h.layers,g=h.radius,y=h.innerRadius,v=h.cx,x=h.cy,_=h.radialAxis,A=k.radialDragBoxSize,M=A/2;if(_.visible){var S,E,D,C=F(h.radialAxisAngle),I=_._rl,L=I[0],P=I[1],z=I[s],R=.75*(I[1]-I[0])/(1-h.getHole(t))/g;s?(S=v+(g+M)*Math.cos(C),E=x-(g+M)*Math.sin(C),D="radialdrag"):(S=v+(y-M)*Math.cos(C),E=x-(y-M)*Math.sin(C),D="radialdrag-inner");var B=p.makeRectDragger(f,D,"crosshair",-M,-M,A,A),j={element:B,gd:d};!1===e.dragmode&&(j.dragmode=!1),V(r.select(B),_.visible&&y0!=(s?c>L:c")}}t.exports={hoverPoints:function(e,t,n,a){var o=r(e,t,n,a);if(!(!o||!1===o[0].index)){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}}}),Uo=m({"src/traces/scatterpolar/index.js"(e,t){t.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:V9(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Ue(),supplyDefaults:Ut().supplyDefaults,colorbar:nr(),formatLabels:Ur(),calc:Ui(),plot:Un(),style:nn().style,styleOnSelect:nn().styleOnSelect,hoverPoints:Ua().hoverPoints,selectPoints:ns(),meta:{}}}}),Us=m({"lib/scatterpolar.js"(e,t){t.exports=Uo()}}),Ul=m({"src/traces/scatterpolargl/attributes.js"(e,t){var r=Ue(),{cliponaxis:i,hoveron:n}=r,a=((e,t)=>{var r={};for(var i in e)l.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&o)for(var i of o(e))0>t.indexOf(i)&&u.call(e,i)&&(r[i]=e[i]);return r})(r,["cliponaxis","hoveron"]),{connectgaps:s,line:{color:c,dash:h,width:p},fill:m,fillcolor:g,marker:y,textfont:v,textposition:x}=p1();t.exports=f(d({},a),{connectgaps:s,fill:m,fillcolor:g,line:{color:c,dash:h,editType:"calc",width:p},marker:y,textfont:v,textposition:x})}}),Uu=m({"src/traces/scatterpolargl/defaults.js"(e,t){var r=tb(),i=t6(),n=Ut().handleRThetaDefaults,a=iH(),o=i$(),s=iY(),l=iZ(),u=ix().PTS_LINESONLY,c=Ul();t.exports=function(e,t,h,d){function f(i,n){return r.coerce(e,t,c,i,n)}var p=n(e,t,d,f);if(!p){t.visible=!1;return}f("thetaunit"),f("mode",p=l&&(v.marker.cluster=p.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=_),v.line&&_.length>1&&s.extendFlat(v.line,o.linePositions(e,f,_)),v.text&&(s.extendFlat(v.text,{positions:_},o.textPosition(e,f,v.text,v.marker)),s.extendFlat(v.textSel,{positions:_},o.textPosition(e,f,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:_},o.textPosition(e,f,v.text,v.markerUnsel))),v.fill&&!d.fill2d&&(d.fill2d=!0),v.marker&&!d.scatter2d&&(d.scatter2d=!0),v.line&&!d.line2d&&(d.line2d=!0),v.text&&!d.glText&&(d.glText=!0),d.lineOptions.push(v.line),d.fillOptions.push(v.fill),d.markerOptions.push(v.marker),d.markerSelectedOptions.push(v.markerSel),d.markerUnselectedOptions.push(v.markerUnsel),d.textOptions.push(v.text),d.textSelectedOptions.push(v.textSel),d.textUnselectedOptions.push(v.textUnsel),d.selectBatch.push([]),d.unselectBatch.push([]),p.x=w,p.y=T,p.rawx=w,p.rawy=T,p.r=g,p.theta=y,p.positions=_,p._scene=d,p.index=d.count,d.count++}}),n(e,t,u)}},t.exports.reglPrecompiled={}}}),Um=m({"src/traces/scatterpolargl/index.js"(e,t){var r=Uf();r.plot=Up(),t.exports=r}}),Ug=m({"lib/scatterpolargl.js"(e,t){t.exports=Um()}}),Uy=m({"src/traces/barpolar/attributes.js"(e,t){var r,{hovertemplateAttrs:i,templatefallbackAttrs:n}=eY(),a=H().extendFlat,o=Ue(),s=aT();t.exports={r:o.r,theta:o.theta,r0:o.r0,dr:o.dr,theta0:o.theta0,dtheta:o.dtheta,thetaunit:o.thetaunit,base:a({},s.base,{}),offset:a({},s.offset,{}),width:a({},s.width,{}),text:a({},s.text,{}),hovertext:a({},s.hovertext,{}),marker:(r=a({},s.marker),delete r.cornerradius,r),hoverinfo:o.hoverinfo,hovertemplate:i(),hovertemplatefallback:n(),selected:s.selected,unselected:s.unselected}}}),Uv=m({"src/traces/barpolar/layout_attributes.js"(e,t){t.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),Ux=m({"src/traces/barpolar/defaults.js"(e,t){var r=tb(),i=Ut().handleRThetaDefaults,n=aM(),a=Uy();t.exports=function(e,t,o,s){function l(i,n){return r.coerce(e,t,a,i,n)}if(!i(e,t,s,l)){t.visible=!1;return}l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),n(e,t,l,o,s),r.coerceSelectionMarkerOpacity(t,l)}}}),Ub=m({"src/traces/barpolar/layout_defaults.js"(e,t){var r=tb(),i=Uv();t.exports=function(e,t,n){var a,o={};function s(n,o){return r.coerce(e[a]||{},t[a],i,n,o)}for(var l=0;l0?(a=r,s=i):(a=i,s=r);var a,s,h=o.findEnclosingVertexAngles(a,l.vangles)[0],d=o.findEnclosingVertexAngles(s,l.vangles)[1],f=[h,(a+s)/2,d];return o.pathPolygonAnnulus(e,t,a,s,f,u,c)}:function(e,t,r,i){return n.pathAnnulus(e,t,r,i,u,c)}),y=t.layers.frontplot.select("g.barlayer");n.makeTraceGroups(y,s,"trace bars").each(function(){var o=r.select(this),s=n.ensureSingle(o,"g","points").selectAll("g.point").data(n.identity);s.enter().append("g").style("vector-effect",h?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each(function(e){var t,a=r.select(this),o=e.rp0=p.c2p(e.s0),s=e.rp1=p.c2p(e.s1),l=e.thetag0=m.c2g(e.p0),u=e.thetag1=m.c2g(e.p1);if(i(o)&&i(s)&&i(l)&&i(u)&&o!==s&&l!==u){var c=p.c2g(e.s1),h=(l+u)/2;e.ct=[d.c2p(c*Math.cos(h)),f.c2p(c*Math.sin(h))],t=g(o,s,l,u)}else t="M0,0Z";n.ensureSingle(a,"path").attr("d",t)}),a.setClipUrl(o,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)})}}}),UT=m({"src/traces/barpolar/hover.js"(e,t){var r=rO(),i=tb(),n=az().getTraceColor,a=i.fillText,o=Ua().makeHoverPointText,s=V5().isPtInsidePolygon;t.exports=function(e,t,l){var u=e.cd,c=u[0].trace,h=e.subplot,d=h.radialAxis,f=h.angularAxis,p=h.vangles,m=p?s:i.isPtInsideSector,g=e.maxHoverDistance,y=f._period||2*Math.PI,v=Math.abs(d.g2p(Math.sqrt(t*t+l*l))),x=Math.atan2(l,t);if(d.range[0]>d.range[1]&&(x+=Math.PI),r.getClosest(u,function(e){return m(v,x,[e.rp0,e.rp1],[e.thetag0,e.thetag1],p)?g+Math.min(1,Math.abs(e.thetag1-e.thetag0)/y)-1+(e.rp1-v)/(e.rp1-e.rp0)-1:1/0},e),!1!==e.index){var b=u[e.index];e.x0=e.x1=b.ct[0],e.y0=e.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return a(b,c,e),o(_,c,h,e),e.hovertemplate=c.hovertemplate,e.color=n(c,b),e.xLabelVal=e.yLabelVal=void 0,b.s<0&&(e.idealAlign="left"),[e]}}}}),UA=m({"src/traces/barpolar/index.js"(e,t){t.exports={moduleType:"trace",name:"barpolar",basePlotModule:V9(),categories:["polar","bar","showLegend"],attributes:Uy(),layoutAttributes:Uv(),supplyDefaults:Ux(),supplyLayoutDefaults:Ub(),calc:U_().calc,crossTraceCalc:U_().crossTraceCalc,plot:Uw(),colorbar:nr(),formatLabels:Ur(),style:aL().style,styleOnSelect:aL().styleOnSelect,hoverPoints:UT(),selectPoints:aO(),meta:{}}}}),UM=m({"lib/barpolar.js"(e,t){t.exports=UA()}}),Uk=m({"src/plots/smith/constants.js"(e,t){t.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),US=m({"src/plots/smith/layout_attributes.js"(e,t){var r=et(),i=tU(),n=ai().attributes,a=tb().extendFlat,o=eH().overrideAll,s=o({color:i.color,showline:a({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:a({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash},"plot","from-root"),l=o({ticklen:i.ticklen,tickwidth:a({},i.tickwidth,{dflt:2}),tickcolor:i.tickcolor,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,tickfont:i.tickfont,tickformat:i.tickformat,hoverformat:i.hoverformat,layer:i.layer},"plot","from-root"),u=a({visible:a({},i.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},i.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),c=a({visible:a({},i.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:i.ticks,editType:"calc"},s,l);t.exports={domain:n({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:u,imaginaryaxis:c,editType:"calc"}}}),UE=m({"src/plots/smith/layout_defaults.js"(e,t){var r,i,n,a=tb(),o=er(),s=tD(),l=st(),u=tz().getSubplotData,c=tQ(),h=tJ(),d=nh(),f=ri(),p=US(),m=Uk(),g=m.axisNames,y=(r=function(e){return a.isTypedArray(e)&&(e=Array.from(e)),e.slice().reverse().map(function(e){return-e}).concat([0]).concat(e)},i=String,n={},function(e){var t=i?i(e):e;if(t in n)return n[t];var a=r(e);return n[t]=a,a});function v(e,t,r,i){var n=r("bgcolor");i.bgColor=o.combine(n,i.paper_bgcolor);var l,v=u(i.fullData,m.name,i.id),x=i.layoutOut;function b(e,t){return r(l+"."+e,t)}for(var _=0;_")}}t.exports={hoverPoints:function(e,t,n,a){var o=r(e,t,n,a);if(!(!o||!1===o[0].index)){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,u=s.cd[s.index],c=s.trace;if(l.isPtInside(u))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(u,c,l,s),s.hovertemplate=c.hovertemplate,o}},makeHoverPointText:i}}}),UO=m({"src/traces/scattersmith/index.js"(e,t){t.exports={moduleType:"trace",name:"scattersmith",basePlotModule:UD(),categories:["smith","symbols","showLegend","scatter-like"],attributes:UC(),supplyDefaults:UI(),colorbar:nr(),formatLabels:UL(),calc:UP(),plot:Uz(),style:nn().style,styleOnSelect:nn().styleOnSelect,hoverPoints:UF().hoverPoints,selectPoints:ns(),meta:{}}}}),UR=m({"lib/scattersmith.js"(e,t){t.exports=UO()}}),UB=m({"src/traces/quiver/attributes.js"(e,t){var r=X(),i=eY().hovertemplateAttrs,n=tV().axisHoverFormat,a=H().extendFlat,o=tG(),s=e$().dash,l=iv(),u=i_();t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:u.x0,dx:u.dx,y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:u.y0,dy:u.dy,u:{valType:"data_array",editType:"calc",anim:!0},v:{valType:"data_array",editType:"calc",anim:!0},arrowref:{valType:"enumerated",values:["paper","data"],dflt:"data",editType:"calc"},lengthmode:{valType:"enumerated",values:["scaled","raw"],editType:"calc",dflt:"scaled"},lengthfactor:{valType:"number",min:0,editType:"calc",dflt:1},anchor:{valType:"enumerated",values:["tip","tail","center"],dflt:"tail",editType:"calc"},xhoverformat:n("x"),yhoverformat:n("y"),uhoverformat:n("u","noDate"),vhoverformat:n("v","noDate"),hoverinfo:a({},r.hoverinfo,{flags:["x","y","u","v","text","name"],dflt:"all"}),hovertemplate:i({},{keys:["x","y","u","v","text","name"]}),text:u.text,textposition:u.textposition,textfont:u.textfont,marker:a({arrowsize:a({},l.arrowsize,{editType:"calc"}),line:{width:{valType:"number",min:0,dflt:2,editType:"style"},dash:s,editType:"style"},editType:"calc"},o("marker",{showScaleDflt:!0,editTypeOverride:"calc"})),selected:{marker:{color:{valType:"color",editType:"style"},line:{width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{color:{valType:"color",editType:"style"},line:{width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"}}}}),Uj=m({"src/traces/quiver/defaults.js"(e,t){var r=tb(),i=UB(),n=iU(),a=tN().hasColorscale,o=t1();t.exports=function(e,t,s,l){function u(n,a){return r.coerce(e,t,i,n,a)}var c=n(e,t,l,u);if(!c){t.visible=!1;return}var h=u("u"),d=u("v");if(!r.isArrayOrTypedArray(h)||0===h.length){t.u=Array(c);for(var f=0;fE&&(E=c[O]),h[O]C&&(C=h[O]),RL&&(L=R),Bz&&(z=B);var U=Math.sqrt(R*R+B*B);if(U>m&&(m=U),Uy&&(y=q))}}else j.x=a,j.y=a}if(t._maxNorm=m,"scaled"===T||"paper"===A){let e=E-S,r=C-D;t._scaleFactor=(0===e&&0===r?1:(e+r+Math.sqrt((e-r)*(e-r)+4*F*e*r))/(2*(F-1)))*.97/t._maxNorm}else t._scaleFactor=1;t._scaleFactor*=t.lengthfactor;let G=Array(d),H=Array(d),$=Array(d),W=Array(d);for(var Y,Z,X,O=0;Oe.i&&isFinite(o[e.i]))a=o[e.i];else{var s=t.u&&t.u[e.i]||0,l=t.v&&t.v[e.i]||0;a=Math.sqrt(s*s+l*l)}return e.mcc=n(a),e.mcc})}function l(e,t,a){var l=t[0].trace,u=l.marker||{},c=u.line||{},h=i.isArrayOrTypedArray(u.color)?void 0:u.color,d=l._hasColorscale;if(a)if(l.selectedpoints){var f=(l.selected||{}).marker||{},p=(l.unselected||{}).marker||{},m=f.line||{},g=p.line||{};a.selectAll("path.js-line").each(function(e){var t=r.select(this),i=!e.selected,a=i?p.color:f.color,u=i?void 0!==g.width?g.width:c.width:void 0!==m.width?m.width:c.width;a?(n.lineGroupStyle(t,u,a,c.dash),t.style("stroke-opacity",1)):(n.lineGroupStyle(t,u,h,c.dash),d&&s(t,l),t.style("stroke-opacity",i?o:1))}),n.selectedTextStyle(a.selectAll("text"),l)}else{var y=a.selectAll("path.js-line");y.call(n.lineGroupStyle,c.width,h,c.dash),d&&s(y,l),y.style("stroke-opacity",1),n.textPointStyle(a.selectAll("text"),l,e)}}t.exports={style:function(e){r.select(e).selectAll("g.trace.quiver").each(function(t){l(e,t,r.select(this))})},styleOnSelect:function(e,t,r){l(e,t,r)},colorscaleStroke:s}}}),Uq=m({"src/traces/quiver/plot.js"(e,t){var r=M(),i=tb(),n=rt(),a=UU().colorscaleStroke,o=Math.PI/12;function s(e,t,s,l,u,c,h){var d=l[0].trace,f=s.xaxis,p=s.yaxis;l[0][s.isRangePlot?"nodeRangePlot3":"node3"]=r.select(c);var m=r.select(c).selectAll("g.lines").data([l]);m.enter().append("g").classed("lines",!0),n.setClipUrl(m,s.layerClipId,e);var g=m.selectAll("path.js-line").data(l);g.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke"),g.exit().remove();let{anchor:y,maxNorm:v=0,arrowref:x}=d,b="paper"===x?d._scaleFactor*Math.sqrt(Math.abs(f._m*p._m)):d._scaleFactor,_=d.marker.arrowsize;g.each(function(e){let t=r.select(this);if(void 0===e.x||void 0===e.y)return void t.attr("d",null);let i=("paper"===x?e._u*Math.sign(f._m):r.round(f._m*e._u))*b,n=("paper"===x?e._v*Math.sign(p._m):r.round(p._m*e._v))*b,a=void 0!==(d._input.marker||{}).arrowsize;"tip"===y?(s=f.c2p(e.x)-i,u=p.c2p(e.y)-n,l=f.c2p(e.x),c=p.c2p(e.y)):"center"===y?(s=f.c2p(e.x)-i/2,u=p.c2p(e.y)-n/2,l=f.c2p(e.x)+i/2,c=p.c2p(e.y)+n/2):(s=f.c2p(e.x),u=p.c2p(e.y),l=f.c2p(e.x)+i,c=p.c2p(e.y)+n),e._px0=s,e._py0=u,e._px1=l,e._py1=c;var s,l,u,c,h=d.marker.line.width;a||(h=Math.max(h,1.5));let m=Math.min(5.8*_*h,.7*Math.sqrt((l-s)*(l-s)+(c-u)*(c-u))),g=Math.atan2(c-u,l-s),v=l-m*Math.cos(g-o),w=c-m*Math.sin(g-o),T=l-m*Math.cos(g+o),A=c-m*Math.sin(g+o),M="M"+s+","+u+"L"+l+","+c+"L"+v+","+w+"L"+l+","+c+"L"+T+","+A;t.attr("d",M)});var w=d.marker||{},T=w.line||{},A=i.isArrayOrTypedArray(w.color)?void 0:w.color;n.lineGroupStyle(g,T.width,A,T.dash),d._hasColorscale&&a(g,d);var M=r.select(c).selectAll("g.text").data([l]);M.enter().append("g").classed("text",!0),n.setClipUrl(M,s.layerClipId,e);var k=M.selectAll("g.textpoint").data(l);if(k.enter().append("g").classed("textpoint",!0).append("text"),k.exit().remove(),k.each(function(e){var t=r.select(this);n.translatePoint(e,t.select("text"),f,p)||t.remove()}),k.selectAll("text").call(n.textPointStyle,d,e).each(function(e){var t=f.c2p(e.x),i=p.c2p(e.y);r.select(this).selectAll("tspan.line").each(function(){r.select(this).attr({x:t,y:i})})}),h&&h.duration>0){var S=r.transition().duration(h.duration).ease(h.easing);g.transition(S).style("opacity",1)}}t.exports=function(e,t,i,n,a,o){var l,u,c=!a,h=!!a&&a.duration>0;((l=n.selectAll("g.trace").data(i,function(e){return e[0].trace.uid})).enter().append("g").attr("class",function(e){return"trace quiver trace"+e[0].trace.uid}).style("stroke-miterlimit",2),l.order(),h)?(o&&(u=o()),r.transition().duration(a.duration).ease(a.easing).each("end",function(){u&&u()}).each("interrupt",function(){u&&u()}).each(function(){n.selectAll("g.trace").each(function(r,n){s(e,n,t,r,i,this,a)})})):l.each(function(r,n){s(e,n,t,r,i,this,a)}),c&&l.exit().remove()}}}),UG=m({"src/traces/quiver/hover.js"(e,t){var r=tb(),i=rO(),n=na();t.exports=function(e,t,a,o){var s=e.cd,l=s[0].trace,u=e.xa,c=e.ya,h=u.c2p(t),d=c.c2p(a);if(i.getClosest(s,function(e){return void 0===e._px0?1/0:function(e,t,r,i,n,a){let o=n-r,s=a-i,l=o*o+s*s;if(!l)return Math.sqrt((e-r)*(e-r)+(t-i)*(t-i));var u=((e-r)*o+(t-i)*s)/l;let c=r+(u=Math.max(0,Math.min(1,u)))*o,h=i+u*s;return Math.sqrt((e-c)*(e-c)+(t-h)*(t-h))}(h,d,e._px0,e._py0,e._px1,e._py1)},e),!1!==e.index){var f=s[e.index],p=u.c2p(f.x,!0),m=c.c2p(f.y,!0),g=Math.sqrt((h-p)*(h-p)+(d-m)*(d-m));e.index=f.i;var y=l.u?l.u[f.i]:0,v=l.v?l.v[f.i]:0;return r.extendFlat(e,{color:n(l,f),x0:p-3,x1:p+3,xLabelVal:f.x,y0:m-3,y1:m+3,yLabelVal:f.y,uLabelVal:y,vLabelVal:v,extraText:"u: "+y+", v: "+v,spikeDistance:g,hovertemplate:l.hovertemplate}),r.fillText(f,l,e),[e]}}}}),UH=m({"src/traces/quiver/format_labels.js"(e,t){var r=ro(),i=tb();t.exports=function(e,t,n){var a={},o={_fullLayout:n},s=r.getFromTrace(o,t,"x"),l=r.getFromTrace(o,t,"y"),u=e.x,c=e.y;a.xLabel=r.tickText(s,s.c2l(u),!0).text,a.yLabel=r.tickText(l,l.c2l(c),!0).text;var h=t.u?t.u[e.i]:0,d=t.v?t.v[e.i]:0,f=t.uhoverformat,p=t.vhoverformat;return a.uLabel=f?i.numberFormat(f)(h):String(h),a.vLabel=p?i.numberFormat(p)(d):String(d),a}}}),U$=m({"src/traces/quiver/event_data.js"(e,t){t.exports=function(e,t,r,i,n){return e.x=t.x,e.y=t.y,e.u=r.u?r.u[n]:void 0,e.v=r.v?r.v[n]:void 0,e}}}),UW=m({"src/traces/quiver/index.js"(e,t){t.exports={moduleType:"trace",name:"quiver",basePlotModule:ng(),categories:["cartesian","svg","showLegend","scatter-like","zoomScale"],attributes:UB(),supplyDefaults:Uj(),calc:UN(),crossTraceCalc:UV(),plot:Uq(),style:UU().style,styleOnSelect:UU().styleOnSelect,hoverPoints:UG(),formatLabels:UH(),eventData:U$(),selectPoints:ns(),colorbar:nr(),animatable:!0,meta:{}}}}),UY=m({"lib/quiver.js"(e,t){t.exports=UW()}}),UZ=m({"node_modules/world-calendars/dist/main.js"(e,t){var r=mR();function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function n(e,t,r,i){if(this._calendar=e,this._year=t,this._month=r,this._day=i,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(e,t){return e=""+e,"000000".substring(0,t-e.length)+e}function o(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}r(i.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,i,n){return(i=(null!=e&&e.year?e.calendar():"string"==typeof i?this.instance(i,n):i)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,function(t){return e[t]})}},substituteChineseDigits:function(e,t){return function(r){for(var i="",n=0;r>0;){var a=r%10;i=(0===a?"":e[a]+t[n])+i,n++,r=Math.floor(r/10)}return 0===i.indexOf(e[1]+t[1])&&(i=i.substr(1)),i||e[0]}}}),r(n.prototype,{newDate:function(e,t,r){return this._calendar.newDate(e??this,t,r)},year:function(e){return 0==arguments.length?this._year:this.set(e,"y")},month:function(e){return 0==arguments.length?this._month:this.set(e,"m")},day:function(e){return 0==arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(0>this.year()?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),r(o.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new n(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return 0>this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(0>t.year()?"-":"")+a(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var i=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return i.toJD()-this.newDate(i.year(),this.fromMonthOfYear(i.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var i=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(i))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var i=e.toJD()+t*("w"===r?this.daysInWeek():1),n=e.calendar().fromJD(i);return this._validateLevel--,[n.year(),n.month(),n.day()]}try{var a=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0),n=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),n=Math.min(n,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(e){for(;ot-1+e.minMonth;)a++,o-=t,t=e.monthsInYear(a)}(this),n=Math.min(n,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),n];return this._validateLevel--,s}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,i){if(!this.hasYearZero&&("y"===i||"m"===i)&&(0===t[0]||e.year()>0!=t[0]>0)){var n={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[i];t=this._add(e,r*n[0]+(r<0?-1:1)*n[1],n[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var i="y"===r?t:e.year(),n="m"===r?t:e.month(),a="d"===r?t:e.day();return("y"===r||"m"===r)&&(a=Math.min(a,this.daysInMonth(i,n))),e.date(i,n,a)},isValid:function(e,t,r){this._validateLevel++;var i=this.hasYearZero||0!==e;if(i){var n=this.newDate(e,t,this.minDay);i=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDayt.year());return e%4==0&&(e%100!=0||e%400==0)},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(4-(i.dayOfWeek()||7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 6>(this.dayOfWeek(e,t,r)||7)},toJD:function(e,t,r){var i=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);e=i.year(),t=i.month(),r=i.day(),e<0&&e++,t<3&&(t+=12,e--);var n=Math.floor(e/100);return Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r+(2-n+Math.floor(n/4))-1524.5},fromJD:function(e){var t=Math.floor(e+.5),r=Math.floor((t-1867216.25)/36524.25),i=(r=t+1+r-Math.floor(r/4))+1524,n=Math.floor((i-122.1)/365.25),a=Math.floor(365.25*n),o=Math.floor((i-a)/30.6001),s=i-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),u=n-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(e,t,r){var i=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),n=new Date(i.year(),i.month()-1,i.day());return n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0),n.setHours(n.getHours()>12?n.getHours()+2:0),n},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var l=t.exports=new i;l.cdate=n,l.baseCalendar=o,l.calendars.gregorian=s}}),UX=m({"node_modules/world-calendars/dist/plus.js"(){var e=mR(),t=UZ();e(t.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),t.local=t.regionalOptions[""],e(t.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),e(t.baseCalendar.prototype,{UNIX_EPOCH:t.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:t.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,r,i){if("string"!=typeof e&&(i=r,r=e,e=""),!r)return"";if(r.calendar()!==this)throw t.local.invalidFormat||t.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat,i=i||{};for(var n,a,o,s=i.dayNamesShort||this.local.dayNamesShort,l=i.dayNames||this.local.dayNames,u=i.monthNumbers||this.local.monthNumbers,c=i.monthNamesShort||this.local.monthNamesShort,h=i.monthNames||this.local.monthNames,d=(i.calculateWeek||this.local.calculateWeek,function(t,r){for(var i=1;v+i1}),f=function(e,t,r,i){var n=""+t;if(d(e,i))for(;n.length1},x=function(e,i){var n=v(e,i),a=RegExp("^-?\\d{1,"+[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1]+"}"),o=r.substring(T).match(a);if(!o)throw(t.local.missingNumberAt||t.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=o[0].length,parseInt(o[0],10)},b=this,_=function(e,i,n,a){for(var o=v(e,a)?n:i,s=0;s-1){f=1,p=m;for(var k=this.daysInMonth(d,f);p>k;k=this.daysInMonth(d,f))f++,p-=k}return h>-1?this.fromJD(h):this.newDate(d,f,p)},determineDate:function(e,t,r,i,n){r&&"object"!=typeof r&&(n=i,i=r,r=null),"string"!=typeof i&&(n=i,i="");var a=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return a.parseDate(i,e,n)}catch{}e=e.toLowerCase();for(var t=(e.match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||1/0===e||-1/0===e?t:a.today().add(e,"d"):a.newDate(e)}})}}),UK=m({"node_modules/world-calendars/dist/calendars/chinese.js"(){var e=UZ(),t=mR(),r=e.instance();function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,t(i.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(a);return r?r[0]:""}var i=this._validateYear(e),n=e.month(),o=""+this.toChineseMonth(i,n);return t&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(i,n)&&(o+="i"),o},monthNames:function(e){if("string"==typeof e){var t=e.match(o);return t?t[0]:""}var r=this._validateYear(e),i=e.month(),n=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(r,i)-1];return this.isIntercalaryMonth(r,i)&&(n="闰"+n),n},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(s);return t?t[0]:""}var r=this._validateYear(e),i=e.month(),n=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(r,i)-1];return this.isIntercalaryMonth(r,i)&&(n="闰"+n),n},parseMonth:function(e,t){e=this._validateYear(e);var r,i=parseInt(t);if(isNaN(i))"闰"===t[0]&&(r=!0,t=t.substring(1)),"月"===t[t.length-1]&&(t=t.substring(0,t.length-1)),i=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(t);else{var n=t[t.length-1];r="i"===n||"I"===n}return this.toMonthIndex(e,i,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(t,r,i){var n=this.intercalaryMonth(t);if(i&&r!==n||r<1||r>12)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!i&&r<=n?r-1:r:r-1},toChineseMonth:function(t,r){t.year&&(r=(t=t.year()).month());var i=this.intercalaryMonth(t);if(r<0||r>(i?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?r>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(t,i,n){var a,o=u[this._validateYear(t,e.local.invalidyear)-u[0]];return(a=r.newDate(o>>9&4095,o>>5&15,31&o)).add(4-(a.dayOfWeek()||7),"d"),1+Math.floor((this.toJD(t,i,n)-a.toJD())/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(t,r){t.year&&(r=t.month(),t=t.year());var i=l[(t=this._validateYear(t))-l[0]];if(r>(i>>13?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return i&1<<12-r?30:29},weekDay:function(e,t,r){return 6>(this.dayOfWeek(e,t,r)||7)},toJD:function(t,i,n){var a=this._validate(t,s,n,e.local.invalidDate);t=this._validateYear(a.year()),i=a.month(),n=a.day();var o=this.isIntercalaryMonth(t,i),s=this.toChineseMonth(t,i),c=function(e,t,r,i){if("object"==typeof e)a=e,n=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw Error("Lunar day outside range 1 - 30");"object"==typeof i?(o=!1,n=i):(o=!!i,n={}),a={year:e,month:t,day:r,isIntercalary:o}}var n,a,o,s,c=a.day-1,h=l[a.year-l[0]],d=h>>13;s=d&&(a.month>d||a.isIntercalary)?a.month:a.month-1;for(var f=0;f>9&4095,(p>>5&15)-1,(31&p)+c);return n.year=m.getFullYear(),n.month=1+m.getMonth(),n.day=m.getDate(),n}(t,s,n,o);return r.toJD(c.year,c.month,c.day)},fromJD:function(e){var t=r.fromJD(e),i=function(e,t,r){if("object"==typeof e)a=e,o=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},o={}}var i=u[a.year-u[0]],n=a.year<<9|a.month<<5|a.day;o.year=n>=i?a.year:a.year-1;var a,o,s,c=new Date((i=u[o.year-u[0]])>>9&4095,(i>>5&15)-1,31&i);s=Math.round((new Date(a.year,a.month-1,a.day)-c)/864e5);var h,d=l[o.year-l[0]];for(h=0;h<13;h++){var f=d&1<<12-h?30:29;if(s>13;return!p||hr.year());return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(13===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(e,t,r){return 6>(this.dayOfWeek(e,t,r)||7)},toJD:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);return(t=n.year())<0&&t++,n.day()+(n.month()-1)*30+(t-1)*365+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--;var i=Math.floor((t=Math.floor(e)+.5-this.newDate(r,1,1).toJD())/30)+1,n=t-(i-1)*30+1;return this.newDate(r,i,n)}}),e.calendars.coptic=r}}),UQ=m({"node_modules/world-calendars/dist/calendars/discworld.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),400},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/8)+1},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,r,i){return(this._validate(t,r,i,e.local.invalidDate).day()+1)%8},weekDay:function(e,t,r){var i=this.dayOfWeek(e,t,r);return i>=2&&i<=6},extraInfo:function(t,r,n){return{century:i[Math.floor((this._validate(t,r,n,e.local.invalidDate).year()-1)/100)+1]||""}},toJD:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);return t=n.year()+ +(0>n.year()),r=n.month(),(i=n.day())+16*(r>1)+(r>2?(r-2)*32:0)+(t-1)*400+this.jdEpoch-1},fromJD:function(e){var t=Math.floor((e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1)/400)+1;e-=(t-1)*400;var r=Math.floor((e+=16*(e>15))/32)+1,i=e-(r-1)*32+1;return this.newDate(t<=0?t-1:t,r,i)}});var i={20:"Fruitbat",21:"Anchovy"};e.calendars.discworld=r}}),U0=m({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=r.year()+ +(0>r.year());return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(13===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(e,t,r){return 6>(this.dayOfWeek(e,t,r)||7)},toJD:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);return(t=n.year())<0&&t++,n.day()+(n.month()-1)*30+(t-1)*365+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--;var i=Math.floor((t=Math.floor(e)+.5-this.newDate(r,1,1).toJD())/30)+1,n=t-(i-1)*30+1;return this.newDate(r,i,n)}}),e.calendars.ethiopian=r}}),U1=m({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function i(e,t){return e-t*Math.floor(e/t)}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(e){return 7>i(7*(e=e<0?e+1:e)+1,19)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,r){return t.year&&(r=t.month(),t=t.year()),this._validate(t,r,this.minDay,e.local.invalidMonth),12===r&&this.leapYear(t)||8===r&&5===i(this.daysInYear(t),10)?30:9===r&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[r-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);t=n.year(),r=n.month(),i=n.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+i+1;if(r<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(var s=1;si(3*(r+1),7)&&r++,r},_delay2:function(e){var t=this._delay1(e-1),r=this._delay1(e);return this._delay1(e+1)-r==356?2:+(r-t==382)},fromJD:function(e){e=Math.floor(e)+.5;for(var t=Math.floor((e-this.jdEpoch)*98496/0x224f0b7)-1;e>=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var i=e-this.toJD(t,r,1)+1;return this.newDate(t,r,i)}}),e.calendars.hebrew=r}}),U2=m({"node_modules/world-calendars/dist/calendars/islamic.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(12===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);return t=n.year(),r=n.month(),(i=n.day())+Math.ceil(29.5*(r-1))+((t=t<=0?t+1:t)-1)*354+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor((30*((e=Math.floor(e)+.5)-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),i=e-this.toJD(t,r,1)+1;return this.newDate(t,r,i)}}),e.calendars.islamic=r}}),U3=m({"node_modules/world-calendars/dist/calendars/julian.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=0>r.year()?r.year()+1:r.year();return t%4==0},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(4-(i.dayOfWeek()||7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(2===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(e,t,r){return 6>(this.dayOfWeek(e,t,r)||7)},toJD:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);return t=n.year(),r=n.month(),i=n.day(),t<0&&t++,r<=2&&(t--,r+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(r+1))+i-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),i=Math.floor(365.25*r),n=Math.floor((t-i)/30.6001),a=n-Math.floor(n<14?1:13),o=r-Math.floor(a>2?4716:4715),s=t-i-Math.floor(30.6001*n);return o<=0&&o--,this.newDate(o,a,s)}}),e.calendars.julian=r}}),U5=m({"node_modules/world-calendars/dist/calendars/mayan.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function i(e,t){return e-t*Math.floor(e/t)}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),!1},formatYear:function(t){var r=Math.floor((t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year())/400);return t%=400,r+"."+Math.floor((t+=400*(t<0))/20)+"."+t%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&i<0)throw"Invalid Mayan year";t=20*t+i}return t},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),18},weekOfYear:function(t,r,i){return this._validate(t,r,i,e.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),360},daysInMonth:function(t,r){return this._validate(t,r,this.minDay,e.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,r,i){return this._validate(t,r,i,e.local.invalidDate).day()},weekDay:function(t,r,i){return this._validate(t,r,i,e.local.invalidDate),!0},extraInfo:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate).toJD(),a=this._toHaab(n),o=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=i((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,i(t,20)]},_toTzolkin:function(e){return[i((e-=this.jdEpoch)+20-1,20)+1,i(e+4-1,13)+1]},toJD:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(e){var t=Math.floor((e=Math.floor(e)+.5-this.jdEpoch)/360);e%=360;var r=Math.floor((e+=360*(e<0))/20),i=e%20;return this.newDate(t,r,i)}}),e.calendars.mayan=r}}),U4=m({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar;var i=e.instance("gregorian");t(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear);return i.leapYear(r.year()+ +(1>r.year())+1469)},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(1-(i.dayOfWeek()||7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(12===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(e,t,r){return 6>(this.dayOfWeek(e,t,r)||7)},toJD:function(t,r,n){var a=this._validate(t,r,n,e.local.invalidMonth),t=a.year();t<0&&t++;for(var o=a.day(),s=1;s=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,i=1;r>this.daysInMonth(t,i);)r-=this.daysInMonth(t,i),i++;return this.newDate(t,i,r)}}),e.calendars.nanakshahi=r}}),U6=m({"node_modules/world-calendars/dist/calendars/nepali.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),typeof this.NEPALI_CALENDAR_DATA[t]>"u")return this.daysPerYear;for(var r=0,i=this.minMonth;i<=12;i++)r+=this.NEPALI_CALENDAR_DATA[t][i];return r},daysInMonth:function(t,r){return t.year&&(r=t.month(),t=t.year()),this._validate(t,r,this.minDay,e.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[t]>"u"?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[t][r]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(t,r,i){var n=this._validate(t,r,i,e.local.invalidDate);t=n.year(),r=n.month(),i=n.day();var a=e.instance(),o=0,s=r,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&i>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=i,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=i-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var r=e.instance().fromJD(t),i=r.year(),n=r.dayOfYear(),a=i+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var u=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);return this.newDate(a,o,u)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r"u"&&(this.NEPALI_CALENDAR_DATA[r]=t)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),e.calendars.nepali=r}}),U8=m({"node_modules/world-calendars/dist/calendars/persian.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function i(e){var t=e-475;e<0&&t++;var r=.242197*t,i=.242197*(t+1);return r-Math.floor(r)>i-Math.floor(i)}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return i(this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year())},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(-((i.dayOfWeek()+1)%7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(12===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,n){var a=this._validate(t,r,n,e.local.invalidDate);t=a.year(),r=a.month(),n=a.day();var o=0;if(t>0)for(var s=1;s0?t-1:t)*365+o+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(475+((e=Math.floor(e)+.5)-this.toJD(475,1,1))/365.242197);t<=0&&t--,e>this.toJD(t,12,i(t)?30:29)&&0==++t&&t++;var r=e-this.toJD(t,1,1)+1,n=r<=186?Math.ceil(r/31):Math.ceil((r-6)/30),a=e-this.toJD(t,n,1)+1;return this.newDate(t,n,a)}}),e.calendars.persian=r,e.calendars.jalali=r}}),U7=m({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var e=UZ(),t=mR(),r=e.instance();function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,t(i.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var i=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=this._t2gYear(i.year());return r.leapYear(t)},weekOfYear:function(t,i,n){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=this._t2gYear(a.year());return r.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(2===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(e,t,r){return 6>(this.dayOfWeek(e,t,r)||7)},toJD:function(t,i,n){var a=this._validate(t,i,n,e.local.invalidDate),t=this._t2gYear(a.year());return r.toJD(t,a.month(),a.day())},fromJD:function(e){var t=r.fromJD(e),i=this._g2tYear(t.year());return this.newDate(i,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+ +(e>=-this.yearsOffset&&e<=-1)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset)}}),e.calendars.taiwan=i}}),U9=m({"node_modules/world-calendars/dist/calendars/thai.js"(){var e=UZ(),t=mR(),r=e.instance();function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new e.baseCalendar,t(i.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var i=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=this._t2gYear(i.year());return r.leapYear(t)},weekOfYear:function(t,i,n){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),t=this._t2gYear(a.year());return r.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(2===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(e,t,r){return 6>(this.dayOfWeek(e,t,r)||7)},toJD:function(t,i,n){var a=this._validate(t,i,n,e.local.invalidDate),t=this._t2gYear(a.year());return r.toJD(t,a.month(),a.day())},fromJD:function(e){var t=r.fromJD(e),i=this._g2tYear(t.year());return this.newDate(i,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset)},_g2tYear:function(e){return e+this.yearsOffset+ +(e>=-this.yearsOffset&&e<=-1)}}),e.calendars.thai=i}}),qe=m({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var e=UZ(),t=mR();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(e,t,r){var i=this.newDate(e,t,r);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(t,r){for(var n=this._validate(t,r,this.minDay,e.local.invalidMonth),a=n.toJD()-24e5+.5,o=0,s=0;sa)return i[o]-i[o-1];o++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,n){var a=this._validate(t,r,n,e.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+i[o-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=t-i[r-1]+1;return this.newDate(o+1,a-12*o,s)},isValid:function(t,r,i){var n=e.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,r,i,n){var a=e.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),e.calendars.ummalqura=r;var i=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),qt=m({"src/components/calendars/calendars.js"(e,t){t.exports=UZ(),UX(),UK(),UJ(),UQ(),U0(),U1(),U2(),U3(),U5(),U4(),U6(),U8(),U7(),U9(),qe()}}),qr=m({"src/components/calendars/index.js"(e,t){var r=qt(),i=tb(),n=L(),a=n.EPOCHJD,o=n.ONEDAY,s={valType:"enumerated",values:i.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(e,t,r,n){var a={};return a[r]=s,i.coerce(e,t,a,r,n)},u={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:"##",w:"##",c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},c={};function h(e){var t=c[e];return t||(t=c[e]=r.instance(e))}function d(e){return i.extendFlat({},s,{description:e})}function f(e){return"Sets the calendar system to use with `"+e+"` date data."}var p={xcalendar:d(f("x"))},m=i.extendFlat({},p,{ycalendar:d(f("y"))}),g=i.extendFlat({},m,{zcalendar:d(f("z"))}),y=d("Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar`");t.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:m,bar:m,box:m,heatmap:m,contour:m,histogram:m,histogram2d:m,histogram2dcontour:m,scatter3d:g,surface:g,mesh3d:g,scattergl:m,ohlc:p,candlestick:p},layout:{calendar:d("Sets the default calendar system to use for interpreting and displaying dates throughout the plot.")},subplots:{xaxis:{calendar:y},yaxis:{calendar:y},scene:{xaxis:{calendar:y},yaxis:{calendar:y},zaxis:{calendar:y}},polar:{radialaxis:{calendar:y}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(e,t,r,i){for(var n=0;n{i.preventDefault(),i.stopPropagation(),i.clipboardData.setData("text",e),t.removeEventListener("copy",r,!0)};t.addEventListener("copy",r,!0),document.execCommand("copy")},(q=Z||(Z={})).boxSizing=function(e){let t=window.getComputedStyle(e),r=parseFloat(t.borderTopWidth)||0,i=parseFloat(t.borderLeftWidth)||0,n=parseFloat(t.borderRightWidth)||0,a=parseFloat(t.borderBottomWidth)||0,o=parseFloat(t.paddingTop)||0,s=parseFloat(t.paddingLeft)||0,l=parseFloat(t.paddingRight)||0,u=parseFloat(t.paddingBottom)||0;return{borderTop:r,borderLeft:i,borderRight:n,borderBottom:a,paddingTop:o,paddingLeft:s,paddingRight:l,paddingBottom:u,horizontalSum:i+s+l+n,verticalSum:r+o+u+a}},q.sizeLimits=function(e){let t=window.getComputedStyle(e),r=parseFloat(t.minWidth)||0,i=parseFloat(t.minHeight)||0,n=parseFloat(t.maxWidth)||1/0,a=parseFloat(t.maxHeight)||1/0;return n=Math.max(r,n),a=Math.max(i,a),{minWidth:r,minHeight:i,maxWidth:n,maxHeight:a}},q.hitTest=function(e,t,r){let i=e.getBoundingClientRect();return t>=i.left&&t=i.top&&r=r.bottom)){if(i.topr.bottom&&i.height>=r.height){e.scrollTop-=r.top-i.top;return}if(i.topr.height||i.bottom>r.bottom&&i.height0;){if(d(n)){t++;continue}if(d(a)||d(o)){r++;continue}if(d(l)){i++;continue}if(d(u)){r++;continue}if(d(s)){i++;continue}if(!d(c))return 0}return(t=Math.min(t,255))<<16|(r=Math.min(r,255))<<8|(i=Math.min(i,255))},n=/^#[^\s\+>~#\.\[:]+/,a=/^\.[^\s\+>~#\.\[:]+/,o=/^\[[^\]]+\]/,s=/^[^\s\+>~#\.\[:]+/,l=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,u=/^:[^\s\+>~#\.\[:]+/,c=/^[\s\+>~\*]+/,h=/:not\(([^\)]+)\)/g;var V=F(O()),U=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){for(let t of(this.clear(),e))this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new Q.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new Q.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t):this._first=t,this._last=t,this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof Q.LinkedListNode)||t.list!==this)throw Error("Reference node is not owned by the list.");let r=new Q.LinkedListNode(this,e),i=t.prev;return r.next=t,r.prev=i,t.prev=r,i.next=r,this._size++,r}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof Q.LinkedListNode)||t.list!==this)throw Error("Reference node is not owned by the list.");let r=new Q.LinkedListNode(this,e),i=t.next;return r.next=i,r.prev=t,t.next=r,i.prev=r,this._size++,r}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof Q.LinkedListNode)||e.list!==this)throw Error("Node is not owned by the list.");e===this._first&&e===this._last?(this._first=null,this._last=null):e===this._first?(this._first=e.next,this._first.prev=null):e===this._last?(this._last=e.prev,this._last.next=null):(e.next.prev=e.prev,e.prev.next=e.next),e.list=null,e.next=null,e.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}};(W=U||(U={})).from=function(e){let t=new W;return t.assign(e),t},(Q||(Q={})).LinkedListNode=class{constructor(e,t){this.list=null,this.next=null,this.prev=null,this.list=e,this.value=t}};var q,G,H,$,W,Y,Z,X,K,J,Q,ee,et=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}},er=class extends et{get isConflatable(){return!0}conflate(e){return!0}};!function(e){let t,r=null,i=(t=Promise.resolve(),e=>{let r=!1;return t.then(()=>!r&&e()),()=>{r=!0}});function n(e,t){let r=o.get(e);r&&0!==r.length?(0,V.every)((0,V.retro)(r),r=>!r||function(e,t,r){let i=!0;try{i="function"==typeof e?e(t,r):e.messageHook(t,r)}catch(e){l(e)}return i}(r,e,t))&&c(e,t):c(e,t)}e.sendMessage=n,e.postMessage=function(e,t){t.isConflatable&&(0,V.some)(a,r=>r.handler===e&&!!r.msg&&r.msg.type===t.type&&!!r.msg.isConflatable&&r.msg.conflate(t))||h(e,t)},e.installMessageHook=function(e,t){let r=o.get(e);r&&-1!==r.indexOf(t)||(r?r.push(t):o.set(e,[t]))},e.removeMessageHook=function(e,t){let r=o.get(e);if(!r)return;let i=r.indexOf(t);-1!==i&&(r[i]=null,f(r))},e.clearData=function(e){let t=o.get(e);for(let r of(t&&t.length>0&&(V.ArrayExt.fill(t,null),f(t)),a))r.handler===e&&(r.handler=null,r.msg=null)},e.flush=function(){u||null===r||(r(),r=null,u=!0,d(),u=!1)},e.getExceptionHandler=function(){return l},e.setExceptionHandler=function(e){let t=l;return l=e,t};let a=new U,o=new WeakMap,s=new Set,l=e=>{console.error(e)},u=!1;function c(e,t){try{e.processMessage(t)}catch(e){l(e)}}function h(e,t){a.addLast({handler:e,msg:t}),null===r&&(r=i(d))}function d(){if(r=null,a.isEmpty)return;let e={handler:null,msg:null};for(a.addLast(e);;){let t=a.removeFirst();if(t===e)return;t.handler&&t.msg&&n(t.handler,t.msg)}}function f(e){0===s.size&&i(p),s.add(e)}function p(){s.forEach(m),s.clear()}function m(e){V.ArrayExt.removeAllWhere(e,g)}function g(e){return null===e}}(ee||(ee={}));var ei=class{constructor(e){this._pid=e_.nextPID(),this.name=e.name,this._create=e.create,this._coerce=e.coerce||null,this._compare=e.compare||null,this._changed=e.changed||null}get(e){let t=e_.ensureMap(e);return this._pid in t?t[this._pid]:t[this._pid]=this._createValue(e)}set(e,t){let r,i=e_.ensureMap(e);r=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(e);let n=this._coerceValue(e,t);this._maybeNotify(e,r,i[this._pid]=n)}coerce(e){let t,r=e_.ensureMap(e);t=this._pid in r?r[this._pid]:r[this._pid]=this._createValue(e);let i=this._coerceValue(e,t);this._maybeNotify(e,t,r[this._pid]=i)}_createValue(e){return(0,this._create)(e)}_coerceValue(e,t){let r=this._coerce;return r?r(e,t):t}_compareValue(e,t){let r=this._compare;return r?r(e,t):e===t}_maybeNotify(e,t,r){let i=this._changed;i&&!this._compareValue(t,r)&&i(e,t,r)}};(ei||(ei={})).clearData=function(e){e_.ownerData.delete(e)},(eg=e_||(e_={})).ownerData=new WeakMap,d=0,eg.nextPID=()=>`pid-${`${Math.random()}`.slice(2)}-${d++}`,eg.ensureMap=function(e){let t=eg.ownerData.get(e);return t||(t=Object.create(null),eg.ownerData.set(e,t),t)};var en=F(O()),ea=(F(R()),class{constructor(e){this.sender=e}connect(e,t){return ew.connect(this,e,t)}disconnect(e,t){return ew.disconnect(this,e,t)}emit(e){ew.emit(this,e)}});(ey=ea||(ea={})).disconnectBetween=function(e,t){ew.disconnectBetween(e,t)},ey.disconnectSender=function(e){ew.disconnectSender(e)},ey.disconnectReceiver=function(e){ew.disconnectReceiver(e)},ey.disconnectAll=function(e){ew.disconnectAll(e)},ey.clearData=function(e){ew.disconnectAll(e)},ey.getExceptionHandler=function(){return ew.exceptionHandler},ey.setExceptionHandler=function(e){let t=ew.exceptionHandler;return ew.exceptionHandler=e,t},function(e){function t(e){let t=i.get(e);if(!(!t||0===t.length)){for(let e of t){if(!e.signal)continue;let t=e.thisArg||e.slot;e.signal=null,l(n.get(t))}l(t)}}function r(e){let t=n.get(e);if(!(!t||0===t.length)){for(let e of t){if(!e.signal)continue;let t=e.signal.sender;e.signal=null,l(i.get(t))}l(t)}}e.exceptionHandler=e=>{console.error(e)},e.connect=function(e,t,r){r=r||void 0;let a=i.get(e.sender);if(a||(a=[],i.set(e.sender,a)),s(a,e,t,r))return!1;let o=r||t,l=n.get(o);l||(l=[],n.set(o,l));let u={signal:e,slot:t,thisArg:r};return a.push(u),l.push(u),!0},e.disconnect=function(e,t,r){r=r||void 0;let a=i.get(e.sender);if(!a||0===a.length)return!1;let o=s(a,e,t,r);if(!o)return!1;let u=r||t,c=n.get(u);return o.signal=null,l(a),l(c),!0},e.disconnectBetween=function(e,t){let r=i.get(e);if(!r||0===r.length)return;let a=n.get(t);if(!(!a||0===a.length)){for(let t of a)t.signal&&t.signal.sender===e&&(t.signal=null);l(r),l(a)}},e.disconnectSender=t,e.disconnectReceiver=r,e.disconnectAll=function(e){t(e),r(e)},e.emit=function(t,r){let n=i.get(t.sender);if(!(!n||0===n.length))for(let i=0,a=n.length;ie.signal===t&&e.slot===r&&e.thisArg===i)}function l(e){0===a.size&&o(u),a.add(e)}function u(){a.forEach(c),a.clear()}function c(e){en.ArrayExt.removeAllWhere(e,h)}function h(e){return null===e.signal}}(ew||(ew={}));var eo=class{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let e=this._fn;this._fn=null,e()}},es=class{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(e=>{e.dispose()}),this._items.clear())}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}};(ev=es||(es={})).from=function(e){let t=new ev;for(let r of e)t.add(r);return t};var el=class extends es{constructor(){super(...arguments),this._disposed=new ea(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),ea.clearData(this))}};(ex=el||(el={})).from=function(e){let t=new ex;for(let r of e)t.add(r);return t};var eu=class e{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:e,edge:t,distance:r}=this._scrollTarget,i=Math.max(1,Math.round(Math.pow((eT.SCROLL_EDGE_SIZE-r)/eT.SCROLL_EDGE_SIZE,2)*eT.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=i;break;case"left":e.scrollLeft-=i;break;case"right":e.scrollLeft+=i;break;case"bottom":e.scrollTop+=i}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});eT.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(e=>{this._resolve=e});let r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(r),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}}moveDragImage(e,t){this.dragImage&&(this.dragImage.style.transform=`translate(${e}px, ${t}px)`)}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),0!==e.button)return;if(this._updateCurrentTarget(e),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction){eT.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}let t=eT.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=eT.findScrollTarget(e);(this._scrollTarget||t)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,r=this._currentTarget,i=this._currentElement,n=eT.findElementBehindBackdrop(e,this.document);this._currentElement=n,n!==i&&n!==r&&eT.dispatchDragExit(this,r,n,e),n!==i&&n!==r&&(r=eT.dispatchDragEnter(this,n,r,e)),r!==t&&(this._currentTarget=r,eT.dispatchDragLeave(this,t,r,e));let a=eT.dispatchDragOver(this,r,e);this._setDropAction(a)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let r=this.dragImage.style;r.pointerEvents="none",r.position="fixed",r.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(t){if(t=eT.validateAction(t,this.supportedActions),!(this._override&&this._dropAction===t))switch(t){case"none":this._dropAction=t,this._override=e.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=t,this._override=e.overrideCursor("copy",this.document);break;case"link":this._dropAction=t,this._override=e.overrideCursor("alias",this.document);break;case"move":this._dropAction=t,this._override=e.overrideCursor("move",this.document)}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}},ec=eu||(eu={});class eh extends DragEvent{constructor(e,t){super(t.type,{bubbles:!0,cancelable:!0,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});let{drag:r}=t;this.dropAction="none",this.mimeData=r.mimeData,this.proposedAction=r.proposedAction,this.supportedActions=r.supportedActions,this.source=r.source}}ec.Event=eh,ec.overrideCursor=function(e,t=document){return eT.overrideCursor(e,t)},function(e){let t;function r(t,a=document){if(t){if(i&&t==i.event)return i.element;e.cursorBackdrop.style.zIndex="-1000";let r=a.elementFromPoint(t.clientX,t.clientY);return e.cursorBackdrop.style.zIndex="",i={event:t,element:r},r}{let t=e.cursorBackdrop.style.transform;if(n&&t===n.transform)return n.element;let r=e.cursorBackdrop.getBoundingClientRect();e.cursorBackdrop.style.zIndex="-1000";let i=a.elementFromPoint(r.left+r.width/2,r.top+r.height/2);return e.cursorBackdrop.style.zIndex="",n={transform:t,element:i},i}}e.SCROLL_EDGE_SIZE=20,e.validateAction=function(e,t){return a[e]&o[t]?e:"none"},e.findElementBehindBackdrop=r;let i=null,n=null;e.findScrollTarget=function(t){let i=t.clientX,n=t.clientY,a=r(t);for(;a;a=a.parentElement){let t;if(!a.hasAttribute("data-lm-dragscroll"))continue;let r=0,o=0;a===document.body&&(r=window.pageXOffset,o=window.pageYOffset);let s=a.getBoundingClientRect(),l=s.top+o,u=s.left+r,c=u+s.width,h=l+s.height;if(i=c||n=h)continue;let d=i-u+1,f=n-l+1,p=c-i,m=h-n,g=Math.min(d,f,p,m);if(g>e.SCROLL_EDGE_SIZE)continue;switch(g){case m:t="bottom";break;case f:t="top";break;case p:t="right";break;case d:t="left";break;default:throw"unreachable"}let y=a.scrollWidth-a.clientWidth,v=a.scrollHeight-a.clientHeight,x;switch(t){case"top":x=v>0&&a.scrollTop>0;break;case"left":x=y>0&&a.scrollLeft>0;break;case"right":x=y>0&&a.scrollLeft0&&a.scrollTop{i===h&&e.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",s,!0),e.cursorBackdrop.removeEventListener("scroll",l,!0),n.removeChild(e.cursorBackdrop))})};let c=500,h=0;(t=document.createElement("div")).classList.add("lm-cursor-backdrop"),e.cursorBackdrop=t}(eT||(eT={}));var ed=F(O()),ef=F(R());function ep(){return eA.keyboardLayout}var em=class e{constructor(t,r,i=[]){this.name=t,this._codes=r,this._keys=e.extractKeys(r),this._modifierKeys=e.convertToKeySet(i)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}};(eb=em||(em={})).extractKeys=function(e){let t=Object.create(null);for(let r in e)t[e[r]]=!0;return t},eb.convertToKeySet=function(e){let t=Object(null);for(let r=0,i=e.length;r{this._commands.delete(e),this._commandChanged.emit({id:e,type:"removed"})})}notifyCommandChanged(e){if(void 0!==e&&!this._commands.has(e))throw Error(`Command '${e}' is not registered.`);this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=ef.JSONExt.emptyObject){var r;let i=this._commands.get(e);return Promise.resolve(null!=(r=i?.describedBy.call(void 0,t))?r:{args:null})}label(e,t=ef.JSONExt.emptyObject){var r;let i=this._commands.get(e);return null!=(r=i?.label.call(void 0,t))?r:""}mnemonic(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.mnemonic.call(void 0,t):-1}icon(e,t=ef.JSONExt.emptyObject){var r;return null==(r=this._commands.get(e))?void 0:r.icon.call(void 0,t)}iconClass(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.iconClass.call(void 0,t):""}iconLabel(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.iconLabel.call(void 0,t):""}caption(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.caption.call(void 0,t):""}usage(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.usage.call(void 0,t):""}className(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.className.call(void 0,t):""}dataset(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return r?r.dataset.call(void 0,t):{}}isEnabled(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return!!r&&r.isEnabled.call(void 0,t)}isToggled(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return!!r&&r.isToggled.call(void 0,t)}isToggleable(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return!!r&&r.isToggleable}isVisible(e,t=ef.JSONExt.emptyObject){let r=this._commands.get(e);return!!r&&r.isVisible.call(void 0,t)}execute(e,t=ef.JSONExt.emptyObject){let r,i=this._commands.get(e);if(!i)return Promise.reject(Error(`Command '${e}' not registered.`));try{r=i.execute.call(void 0,t)}catch(e){r=Promise.reject(e)}let n=Promise.resolve(r);return this._commandExecuted.emit({id:e,args:t,result:n}),n}addKeyBinding(e){let t=ej.createKeyBinding(e);return this._keyBindings.push(t),this._keyBindingChanged.emit({binding:t,type:"added"}),new eo(()=>{ed.ArrayExt.removeFirstOf(this._keyBindings,t),this._keyBindingChanged.emit({binding:t,type:"removed"})})}processKeydownEvent(t){if(t.defaultPrevented||this._replaying)return;let r=e.keystrokeForKeydownEvent(t);if(!r){this._replayKeydownEvents(),this._clearPendingState();return}if(e.isModifierKeyPressed(t)){let{exact:e}=ej.matchKeyBinding(this._keyBindings,[r],t);e?(t.preventDefault(),t.stopPropagation(),this._startModifierTimer(e)):this._clearModifierTimer();return}this._keystrokes.push(r);let{exact:i,partial:n}=ej.matchKeyBinding(this._keyBindings,this._keystrokes,t),a=0!==n.length;if(!i&&!a){this._replayKeydownEvents(),this._clearPendingState();return}if((i?.preventDefault||n.some(e=>e.preventDefault))&&(t.preventDefault(),t.stopPropagation()),this._keydownEvents.push(t),i&&!a){this._executeKeyBinding(i),this._clearPendingState();return}i&&(this._exactKeyMatch=i),this._startTimer()}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(e)},ej.modifierkeyTimeOut)}_clearModifierTimer(){0!==this._timerModifierID&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},ej.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(ej.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(e){if(0!==this._holdKeyBindingPromises.size){let e=[...this._keydownEvents],t=(await Promise.race([Promise.all(e.map(async e=>{var t;return null!=(t=this._holdKeyBindingPromises.get(e))?t:Promise.resolve(!0)})),new Promise(e=>{setTimeout(()=>e([!1]),ej.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!t)return}let{command:t,args:r}=e,i={_luminoEvent:{type:"keybinding",keys:e.keys},...r};if(!this.hasCommand(t)||!this.isEnabled(t,i)){let r=this.hasCommand(t)?"enabled":"registered",i=`Cannot execute key binding '${e.keys.join(", ")}':`,n=`command '${t}' is not ${r}.`;console.warn(`${i} ${n}`);return}await this.execute(t,i)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}},eS=ek||(ek={});function eE(e){let t="",r=!1,i=!1,n=!1,a=!1;for(let o of e.split(/\s+/))"Accel"===o?X.IS_MAC?i=!0:n=!0:"Alt"===o?r=!0:"Cmd"===o?i=!0:"Ctrl"===o?n=!0:"Shift"===o?a=!0:o.length>0&&(t=o);return{cmd:i,ctrl:n,alt:r,shift:a,key:t}}function eD(e){let t="",r=eE(e);return r.ctrl&&(t+="Ctrl "),r.alt&&(t+="Alt "),r.shift&&(t+="Shift "),r.cmd&&X.IS_MAC&&(t+="Cmd "),r.key?t+r.key:t.trim()}eS.parseKeystroke=eE,eS.normalizeKeystroke=eD,eS.normalizeKeys=function(e){return(X.IS_WIN?e.winKeys||e.keys:X.IS_MAC?e.macKeys||e.keys:e.linuxKeys||e.keys).map(eD)},eS.formatKeystroke=function(e){return"string"==typeof e?t(e):e.map(t).join(", ");function t(e){let t=[],r=X.IS_MAC?" ":"+",i=eE(e);return i.ctrl&&t.push("Ctrl"),i.alt&&t.push("Alt"),i.shift&&t.push("Shift"),X.IS_MAC&&i.cmd&&t.push("Cmd"),t.push(i.key),t.map(ej.formatKey).join(r)}},eS.isModifierKeyPressed=function(e){let t=ep(),r=t.keyForKeydownEvent(e);return t.isModifierKey(r)},eS.keystrokeForKeydownEvent=function(e){let t=ep(),r=t.keyForKeydownEvent(e),i=[];return e.ctrlKey&&i.push("Ctrl"),e.altKey&&i.push("Alt"),e.shiftKey&&i.push("Shift"),e.metaKey&&X.IS_MAC&&i.push("Cmd"),t.isModifierKey(r)||i.push(r),i.join(" ")},function(e){e.CHORD_TIMEOUT=1e3,e.KEYBINDING_HOLD_TIMEOUT=1e3,e.modifierkeyTimeOut=500,e.createCommand=function(e){return{execute:e.execute,describedBy:u("function"==typeof e.describedBy?e.describedBy:{args:null,...e.describedBy},()=>({args:null})),label:u(e.label,i),mnemonic:u(e.mnemonic,n),icon:u(e.icon,l),iconClass:u(e.iconClass,i),iconLabel:u(e.iconLabel,i),caption:u(e.caption,i),usage:u(e.usage,i),className:u(e.className,i),dataset:u(e.dataset,s),isEnabled:e.isEnabled||a,isToggled:e.isToggled||o,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||a}},e.createKeyBinding=function(e){var t;return{keys:ek.normalizeKeys(e),selector:function(e){if(-1!==e.selector.indexOf(","))throw Error(`Selector cannot contain commas: ${e.selector}`);if(!K.isValid(e.selector))throw Error(`Invalid selector: ${e.selector}`);return e.selector}(e),command:e.command,args:e.args||ef.JSONExt.emptyObject,preventDefault:null==(t=e.preventDefault)||t}},e.matchKeyBinding=function(e,t,r){let i=null,n=[],a=1/0,o=0;for(let s=0,l=e.length;st.length?2:1}(l.keys,t);if(0===u)continue;if(2===u){-1!==c(l.selector,r)&&n.push(l);continue}let h=c(l.selector,r);if(-1===h||h>a)continue;let d=K.calculateSpecificity(l.selector);(!i||h=o)&&(i=l,a=h,o=d)}return{exact:i,partial:n}},e.replayKeyEvent=function(e){var t;let r,i,n;e.target.dispatchEvent((t=e,r=document.createEvent("Event"),i=t.bubbles||!0,n=t.cancelable||!0,r.initEvent(t.type||"keydown",i,n),r.key=t.key||"",r.keyCode=t.keyCode||0,r.which=t.keyCode||0,r.ctrlKey=t.ctrlKey||!1,r.altKey=t.altKey||!1,r.shiftKey=t.shiftKey||!1,r.metaKey=t.metaKey||!1,r.view=t.view||window,r))},e.formatKey=function(e){return X.IS_MAC?t.hasOwnProperty(e)?t[e]:e:r.hasOwnProperty(e)?r[e]:e};let t={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},r={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},i=()=>"",n=()=>-1,a=()=>!0,o=()=>!1,s=()=>({}),l=()=>{};function u(e,t){return void 0===e?t:"function"==typeof e?e:()=>e}function c(e,t){let r=t.target,i=t.currentTarget;for(let t=0;null!==r&&!r.hasAttribute("data-lm-suppress-shortcuts");r=r.parentElement,++t){if(K.matches(r,e))return t;if(r===i)break}return -1}}(ej||(ej={}));var eC=F(O()),eI=class{constructor(e){this.type="text",this.content=e}},eL=class{constructor(e,t,r,i){this.type="element",this.tag=e,this.attrs=t,this.children=r,this.renderer=i}};function eP(e){let t={},r,i=[];for(let e=1,n=arguments.length;e=a.length){eF(i[r],t);continue}let s=a[r],l=i[r];if(s===l){o=o.nextSibling;continue}if("text"===s.type&&"text"===l.type){o.textContent!==l.content&&(o.textContent=l.content),o=o.nextSibling;continue}if("text"===s.type||"text"===l.type||!s.renderer!=!l.renderer){eC.ArrayExt.insert(a,r,l),eF(l,t,o);continue}let u=l.attrs.key;if(u&&u in n){let e=n[u];e.vNode!==s&&(eC.ArrayExt.move(a,a.indexOf(e.vNode,r+1),r),t.insertBefore(e.element,o),s=e.vNode,o=e.element)}if(s===l){o=o.nextSibling;continue}let c=s.attrs.key;if(c&&c!==u||s.tag!==l.tag){eC.ArrayExt.insert(a,r,l),eF(l,t,o);continue}(function(e,t,r){let i;if(t!==r){for(i in t)i in eO||i in r||("on"===i.substr(0,2)?e[i]=null:e.removeAttribute(i));for(i in r)i in eO||t[i]===r[i]||("on"===i.substr(0,2)?e[i]=r[i]:e.setAttribute(i,r[i]));t.className!==r.className&&(void 0!==r.className?e.setAttribute("class",r.className):e.removeAttribute("class")),t.htmlFor!==r.htmlFor&&(void 0!==r.htmlFor?e.setAttribute("for",r.htmlFor):e.removeAttribute("for")),t.dataset!==r.dataset&&function(e,t,r){for(let i in t)i in r||e.removeAttribute(`data-${i}`);for(let i in r)t[i]!==r[i]&&e.setAttribute(`data-${i}`,r[i])}(e,t.dataset||{},r.dataset||{}),t.style!==r.style&&function(e,t,r){let i=e.style,n;for(n in t)n in r||(i[n]="");for(n in r)t[n]!==r[n]&&(i[n]=r[n])}(e,t.style||{},r.style||{})}})(o,s.attrs,l.attrs),l.renderer?l.renderer.render(o,{attrs:l.attrs,children:l.children}):e(o,s.children,l.children),o=o.nextSibling}!function e(t,r,i,n){for(let a=r.length-1;a>=i;--a){let i=r[a],o=n?t.lastChild:t.childNodes[a];"text"===i.type||(i.renderer&&i.renderer.unrender?i.renderer.unrender(o,{attrs:i.attrs,children:i.children}):e(o,i.children,0,!1)),n&&t.removeChild(o)}}(t,a,s,!0)};let eO={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};var eR,eB,ej,eN,eV,eU,eq=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}};(eW=eU||(eU={})).calc=function(e,t){let r=e.length;if(0===r)return t;let i=0,n=0,a=0,o=0,s=0;for(let t=0;t0&&(o+=r.stretch,s++)}if(t===a)return 0;if(t<=i){for(let t=0;t=n){for(let t=0;t0&&i>.01;){let t=i,n=o;for(let a=0;a0&&i>.01;){let t=i/l;for(let n=0;n0&&i>.01;){let t=i,n=o;for(let a=0;a=r.maxSize?(i-=r.maxSize-r.size,o-=r.stretch,r.size=r.maxSize,r.done=!0,l--,s--):(i-=u,r.size+=u)}}for(;l>0&&i>.01;){let t=i/l;for(let n=0;n=r.maxSize?(i-=r.maxSize-r.size,r.size=r.maxSize,r.done=!0,l--):(i-=t,r.size+=t))}}}return 0},eW.adjust=function(e,t,r){0===e.length||0===r||(r>0?function(e,t,r){let i=0;for(let r=0;r<=t;++r){let t=e[r];i+=t.maxSize-t.size}let n=0;for(let r=t+1,i=e.length;r=0&&a>0;--r){let t=e[r],i=t.maxSize-t.size;i>=a?(t.sizeHint=t.size+a,a=0):(t.sizeHint=t.size+i,a-=i)}let o=r;for(let r=t+1,i=e.length;r0;++r){let t=e[r],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}(e,t,r):function(e,t,r){let i=0;for(let r=t+1,n=e.length;r0;++r){let t=e[r],i=t.maxSize-t.size;i>=a?(t.sizeHint=t.size+a,a=0):(t.sizeHint=t.size+i,a-=i)}let o=r;for(let r=t;r>=0&&o>0;--r){let t=e[r],i=t.size-t.minSize;i>=o?(t.sizeHint=t.size-o,o=0):(t.sizeHint=t.size-i,o-=i)}}(e,t,-r))};var eG=class{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new ea(this),this._isDisposed=!1,this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon&&(this._icon=e.icon),void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,ea.clearData(this))}},eH=class e{constructor(t={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new ea(this),this._hiddenMode=e.HiddenMode.Display,this.node=eX.createNode(t),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(e.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&e.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),ea.clearData(this),ee.clearData(this),ei.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(e.Flag.IsDisposed)}get isAttached(){return this.testFlag(e.Flag.IsAttached)}get isHidden(){return this.testFlag(e.Flag.IsHidden)}get isVisible(){let e=this;do{if(e.isHidden||!e.isAttached)return!1;e=e.parent}while(null!=e);return!0}get title(){return eX.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(t){this._hiddenMode!==t&&(this.isHidden&&this._toggleHidden(!1),t==e.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=t,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(t){if(this._parent!==t){if(t&&this.contains(t))throw Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let t=new e.ChildMessage("child-removed",this);ee.sendMessage(this._parent,t)}if(this._parent=t,this._parent&&!this._parent.isDisposed){let t=new e.ChildMessage("child-added",this);ee.sendMessage(this._parent,t)}this.isDisposed||ee.sendMessage(this,e.Msg.ParentChanged)}}get layout(){return this._layout}set layout(t){if(this._layout!==t){if(this.testFlag(e.Flag.DisallowLayout))throw Error("Cannot set widget layout.");if(this._layout)throw Error("Cannot change widget layout.");if(t.parent)throw Error("Cannot change layout parent.");this._layout=t,t.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){ee.postMessage(this,e.Msg.UpdateRequest)}fit(){ee.postMessage(this,e.Msg.FitRequest)}activate(){ee.postMessage(this,e.Msg.ActivateRequest)}close(){ee.sendMessage(this,e.Msg.CloseRequest)}show(){if(this.testFlag(e.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&ee.sendMessage(this,e.Msg.BeforeShow),this.clearFlag(e.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&ee.sendMessage(this,e.Msg.AfterShow),this.parent)){let t=new e.ChildMessage("child-shown",this);ee.sendMessage(this.parent,t)}}hide(){if(!this.testFlag(e.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&ee.sendMessage(this,e.Msg.BeforeHide),this.setFlag(e.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&ee.sendMessage(this,e.Msg.AfterHide),this.parent)){let t=new e.ChildMessage("child-hidden",this);ee.sendMessage(this.parent,t)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return(this._flags&e)!=0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(t){switch(t.type){case"resize":this.notifyLayout(t),this.onResize(t);break;case"update-request":this.notifyLayout(t),this.onUpdateRequest(t);break;case"fit-request":this.notifyLayout(t),this.onFitRequest(t);break;case"before-show":this.notifyLayout(t),this.onBeforeShow(t);break;case"after-show":this.setFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterShow(t);break;case"before-hide":this.notifyLayout(t),this.onBeforeHide(t);break;case"after-hide":this.clearFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterHide(t);break;case"before-attach":this.notifyLayout(t),this.onBeforeAttach(t);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(e.Flag.IsVisible),this.setFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterAttach(t);break;case"before-detach":this.notifyLayout(t),this.onBeforeDetach(t);break;case"after-detach":this.clearFlag(e.Flag.IsVisible),this.clearFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterDetach(t);break;case"activate-request":this.notifyLayout(t),this.onActivateRequest(t);break;case"close-request":this.notifyLayout(t),this.onCloseRequest(t);break;case"child-added":this.notifyLayout(t),this.onChildAdded(t);break;case"child-removed":this.notifyLayout(t),this.onChildRemoved(t);break;default:this.notifyLayout(t)}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(t){this.parent?this.parent=null:this.isAttached&&e.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(t){if(t)switch(this._hiddenMode){case e.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case e.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case e.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1",this.node.style.opacity="0"}else switch(this._hiddenMode){case e.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case e.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case e.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="",this.node.style.opacity=""}}};!function(e){var t,r,i,n;(t=e.HiddenMode||(e.HiddenMode={}))[t.Display=0]="Display",t[t.Scale=1]="Scale",t[t.ContentVisibility=2]="ContentVisibility",(r=e.Flag||(e.Flag={}))[r.IsDisposed=1]="IsDisposed",r[r.IsAttached=2]="IsAttached",r[r.IsHidden=4]="IsHidden",r[r.IsVisible=8]="IsVisible",r[r.DisallowLayout=16]="DisallowLayout",(i=e.Msg||(e.Msg={})).BeforeShow=new et("before-show"),i.AfterShow=new et("after-show"),i.BeforeHide=new et("before-hide"),i.AfterHide=new et("after-hide"),i.BeforeAttach=new et("before-attach"),i.AfterAttach=new et("after-attach"),i.BeforeDetach=new et("before-detach"),i.AfterDetach=new et("after-detach"),i.ParentChanged=new et("parent-changed"),i.UpdateRequest=new er("update-request"),i.FitRequest=new er("fit-request"),i.ActivateRequest=new er("activate-request"),i.CloseRequest=new er("close-request"),e.ChildMessage=class extends et{constructor(e,t){super(e),this.child=t}};class a extends et{constructor(e,t){super("resize"),this.width=e,this.height=t}}e.ResizeMessage=a,(n=a=e.ResizeMessage||(e.ResizeMessage={})).UnknownSize=new n(-1,-1),e.attach=function(t,r,i=null){if(t.parent)throw Error("Cannot attach a child widget.");if(t.isAttached||t.node.isConnected)throw Error("Widget is already attached.");if(!r.isConnected)throw Error("Host is not attached.");ee.sendMessage(t,e.Msg.BeforeAttach),r.insertBefore(t.node,i),ee.sendMessage(t,e.Msg.AfterAttach)},e.detach=function(t){if(t.parent)throw Error("Cannot detach a child widget.");if(!t.isAttached||!t.node.isConnected)throw Error("Widget is not attached.");ee.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),ee.sendMessage(t,e.Msg.AfterDetach)}}(eH||(eH={})),(eY=eX||(eX={})).titleProperty=new ei({name:"title",create:e=>new eG({owner:e})}),eY.createNode=function(e){return e.node||document.createElement(e.tag||"div")};var e$=class{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,ea.clearData(this),ei.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw Error("Cannot change parent widget.");if(e.layout!==this)throw Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let e=this._parent.node.style;e.minWidth="",e.minHeight="",e.maxWidth="",e.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}}init(){for(let e of this)e.parent=this.parent}onResize(e){for(let e of this)ee.sendMessage(e,eH.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(let e of this)ee.sendMessage(e,eH.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(let t of this)ee.sendMessage(t,e)}onAfterAttach(e){for(let t of this)ee.sendMessage(t,e)}onBeforeDetach(e){for(let t of this)ee.sendMessage(t,e)}onAfterDetach(e){for(let t of this)ee.sendMessage(t,e)}onBeforeShow(e){for(let t of this)t.isHidden||ee.sendMessage(t,e)}onAfterShow(e){for(let t of this)t.isHidden||ee.sendMessage(t,e)}onBeforeHide(e){for(let t of this)t.isHidden||ee.sendMessage(t,e)}onAfterHide(e){for(let t of this)t.isHidden||ee.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}};(eZ=e$||(e$={})).getHorizontalAlignment=function(e){return eK.horizontalAlignmentProperty.get(e)},eZ.setHorizontalAlignment=function(e,t){eK.horizontalAlignmentProperty.set(e,t)},eZ.getVerticalAlignment=function(e){return eK.verticalAlignmentProperty.get(e)},eZ.setVerticalAlignment=function(e,t){eK.verticalAlignmentProperty.set(e,t)};var eW,eY,eZ,eX,eK,eJ=class{constructor(e){this._top=0/0,this._left=0/0,this._width=0/0,this._height=0/0,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=Z.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,r,i){let n=Math.max(this._minWidth,Math.min(r,this._maxWidth)),a=Math.max(this._minHeight,Math.min(i,this._maxHeight));if(n"center",changed:e0}),eQ.verticalAlignmentProperty=new ei({name:"verticalAlignment",create:()=>"top",changed:e0});var e1,e2=class extends e${constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let r=this._widgets.indexOf(t),i=Math.max(0,Math.min(e,this._widgets.length));if(-1===r){j.ArrayExt.insert(this._widgets,i,t),this.parent&&this.attachWidget(i,t);return}i===this._widgets.length&&i--,r!==i&&(j.ArrayExt.move(this._widgets,r,i),this.parent&&this.moveWidget(r,i,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=j.ArrayExt.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(let t of this)this.attachWidget(e++,t)}attachWidget(e,t){let r=this.parent.node.children[e];this.parent.isAttached&&ee.sendMessage(t,eH.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,r),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.AfterAttach)}moveWidget(e,t,r){this.parent.isAttached&&ee.sendMessage(r,eH.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&ee.sendMessage(r,eH.Msg.AfterDetach);let i=this.parent.node.children[t];this.parent.isAttached&&ee.sendMessage(r,eH.Msg.BeforeAttach),this.parent.node.insertBefore(r.node,i),this.parent.isAttached&&ee.sendMessage(r,eH.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&ee.sendMessage(t,eH.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.AfterDetach)}};(e4=e1||(e1={})).clampDimension=function(e){return Math.max(0,Math.floor(e))},e4.isTouchEvent=function(e){return"pointerType"in e&&"touch"===e.pointerType};var e3=e1,e5=class e extends e2{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,void 0!==e.orientation&&(this._orientation=e.orientation),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=e1.clampDimension(e.spacing))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=e1.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return e7.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let r=this._sizers.length,i=e.slice(0,r);for(;i.length0&&(e.sizeHint=e.size);eU.adjust(this._sizers,e,r),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let r=new eJ(t),i=e7.createHandle(this.renderer),n=e7.averageSize(this._sizers),a=e7.createSizer(n);j.ArrayExt.insert(this._items,e,r),j.ArrayExt.insert(this._sizers,e,a),j.ArrayExt.insert(this._handles,e,i),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(i),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,r){j.ArrayExt.move(this._items,e,t),j.ArrayExt.move(this._sizers,e,t),j.ArrayExt.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let r=j.ArrayExt.removeAt(this._items,e),i=j.ArrayExt.removeAt(this._handles,e);j.ArrayExt.removeAt(this._sizers,e),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(i),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.AfterDetach),r.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,r,i,n,a,o){let s=this._items[e];if(s.isHidden)return;let l=this._handles[e].style;t?(r+=this.widgetOffset,s.update(r,i,o,n),r+=o,l.top=`${i}px`,l.left=`${r}px`,l.width=`${this._spacing}px`,l.height=`${n}px`):(i+=this.widgetOffset,s.update(r,i,a,o),i+=o,l.top=`${i}px`,l.left=`${r}px`,l.width=`${a}px`,l.height=`${this._spacing}px`)}_fit(){let t=0,r=-1;for(let e=0,i=this._items.length;e0&&(o.sizeHint=o.size),r.isHidden){o.minSize=0,o.maxSize=0;continue}r.fit(),o.stretch=e.getStretch(r.widget),i?(o.minSize=r.minWidth,o.maxSize=r.maxWidth,n+=r.minWidth,a=Math.max(a,r.minHeight)):(o.minSize=r.minHeight,o.maxSize=r.maxHeight,a+=r.minHeight,n=Math.max(n,r.minWidth))}let o=this._box=Z.boxSizing(this.parent.node);n+=o.horizontalSum,a+=o.verticalSum;let s=this.parent.node.style;s.minWidth=`${n}px`,s.minHeight=`${a}px`,this._dirty=!0,this.parent.parent&&ee.sendMessage(this.parent.parent,eH.Msg.FitRequest),this._dirty&&ee.sendMessage(this.parent,eH.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let r=0;for(let e=0,t=this._items.length;e0){let e;if(e=u?Math.max(0,a-this._fixed):Math.max(0,o-this._fixed),this._hasNormedSizes){for(let t of this._sizers)t.sizeHint*=e;this._hasNormedSizes=!1}let t=eU.calc(this._sizers,e);if(t>0)switch(this._alignment){case"start":break;case"center":s=0,l=t/2;break;case"end":s=0,l=t;break;case"justify":s=t/r,l=0;break;default:throw"unreachable"}}for(let e=0,t=this._items.length;e0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:function(e){e.parent&&e.parent.layout instanceof e5&&e.parent.fit()}}),e8.createSizer=function(e){let t=new eq;return t.sizeHint=Math.floor(e),t},e8.createHandle=function(e){let t=e.createHandle();return t.style.position="absolute",t.style.contain="style",t},e8.averageSize=function(e){return e.reduce((e,t)=>e+t.size,0)/e.length||0},e8.normalize=function(e){let t=e.length;if(0===t)return[];let r=e.reduce((e,t)=>e+Math.abs(t),0);return 0===r?e.map(e=>1/t):e.map(e=>e/r)};var e4,e6,e8,e7,e9,te=class extends e5{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=e3.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){let r=this._titles[e],i=r.classList.contains("lm-mod-expanded"),n=e9.createTitle(this.renderer,t.title,i);this._titles[e]=n,this.parent.node.replaceChild(n,r)}insertWidget(e,t){t.id||(t.id=`id-${N.UUID.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){let r=e9.createTitle(this.renderer,t.title,!t.isHidden);j.ArrayExt.insert(this._titles,e,r),this.parent.node.appendChild(r),t.node.setAttribute("role","region"),t.node.setAttribute("aria-labelledby",r.id),super.attachWidget(e,t)}moveWidget(e,t,r){j.ArrayExt.move(this._titles,e,t),super.moveWidget(e,t,r)}detachWidget(e,t){let r=j.ArrayExt.removeAt(this._titles,e);this.parent.node.removeChild(r),super.detachWidget(e,t)}updateItemPosition(e,t,r,i,n,a,o){let s=this._titles[e].style;s.top=`${i}px`,s.left=`${r}px`,s.height=`${this.widgetOffset}px`,t?s.width=`${n}px`:s.width=`${a}px`,super.updateItemPosition(e,t,r,i,n,a,o)}};(e9||(e9={})).createTitle=function(e,t,r=!0){let i=e.createSectionTitle(t);return i.style.position="absolute",i.style.contain="strict",i.setAttribute("aria-label",`${t.label} Section`),i.setAttribute("aria-expanded",r?"true":"false"),i.setAttribute("aria-controls",t.owner.id),r&&i.classList.add("lm-mod-expanded"),i};var tt,tr=class extends eH{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=tt.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}};(tt||(tt={})).createLayout=function(e){return e.layout||new e2};var ti=class extends tr{constructor(e={}){super({layout:tL.createLayout(e)}),this._handleMoved=new ea(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()}_evtPointerDown(e){if(0!==e.button)return;let t=this.layout,r=j.ArrayExt.findFirstIndex(t.handles,t=>t.contains(e.target));if(-1===r)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let i,n=t.handles[r],a=n.getBoundingClientRect();i="horizontal"===t.orientation?e.clientX-a.left:e.clientY-a.top;let o=window.getComputedStyle(n),s=eu.overrideCursor(o.cursor);this._pressData={index:r,delta:i,override:s}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,r=this.layout,i=this.node.getBoundingClientRect();t="horizontal"===r.orientation?e.clientX-i.left-this._pressData.delta:e.clientY-i.top-this._pressData.delta,r.moveHandle(this._pressData.index,t)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}},tn=ti||(ti={});class ta{createHandle(){let e=document.createElement("div");return e.className="lm-SplitPanel-handle",e}}tn.Renderer=ta,tn.defaultRenderer=new ta,tn.getStretch=function(e){return e5.getStretch(e)},tn.setStretch=function(e,t){e5.setStretch(e,t)},(tL||(tL={})).createLayout=function(e){return e.layout||new e5({renderer:e.renderer||ti.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})};var to=class extends ti{constructor(e={}){super({...e,layout:tP.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new ea(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){let t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){let t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e)}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){let t=j.ArrayExt.findFirstIndex(this.widgets,t=>t.contains(e.owner));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){let t=this.layout,r=t.widgets[e];if(!r)return;let i=r.isHidden,n=t.absoluteSizes(),a=(i?-1:1)*this.spacing,o=n.reduce((e,t)=>e+t),s=[...n];if(i){let t=this._widgetSizesCache.get(r);if(!t)return;s[e]+=t;let i=s.map(e=>e-t>0).lastIndexOf(!0);-1===i?s.forEach((r,i)=>{i!==e&&(s[i]-=n[i]/o*(t-a))}):s[i]-=t-a}else{let t=n[e];this._widgetSizesCache.set(r,t),s[e]=0;let i=s.map(e=>e>0).lastIndexOf(!0);if(-1===i)return;s[i]=n[i]+t+a}return s.map(e=>e/(o+a))}_evtClick(e){let t=e.target;if(t){let r=j.ArrayExt.findFirstIndex(this.titles,e=>e.contains(t));r>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(r))}}_eventKeyDown(e){if(e.defaultPrevented)return;let t=e.target,r=!1;if(t){let i=j.ArrayExt.findFirstIndex(this.titles,e=>e.contains(t));if(i>=0){let n=e.keyCode.toString();if(e.key.match(/Space|Enter/)||n.match(/13|32/))t.click(),r=!0;else if("horizontal"===this.orientation?e.key.match(/ArrowLeft|ArrowRight/)||n.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||n.match(/38|40/)){let t=e.key.match(/ArrowLeft|ArrowUp/)||n.match(/37|38/)?-1:1,a=this.titles.length;this.titles[(i+a+t)%a].focus(),r=!0}else"End"===e.key||"35"===n?(this.titles[this.titles.length-1].focus(),r=!0):("Home"===e.key||"36"===n)&&(this.titles[0].focus(),r=!0)}r&&e.preventDefault()}}_toggleExpansion(e){let t=this.titles[e],r=this.layout.widgets[e],i=this._computeWidgetSize(e);i&&this.setRelativeSizes(i,!1),r.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),r.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),r.hide()),this._expansionToggled.emit(e)}},ts=to||(to={});class tl extends ti.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++tl._nInstance}createCollapseIcon(e){return document.createElement("span")}createSectionTitle(e){let t=document.createElement("h3");for(let r in t.setAttribute("tabindex","0"),t.id=this.createTitleKey(e),t.className=this.titleClassName,e.dataset)t.dataset[r]=e.dataset[r];t.appendChild(this.createCollapseIcon(e)).className="lm-AccordionPanel-titleCollapser";let r=t.appendChild(document.createElement("span"));return r.className="lm-AccordionPanel-titleLabel",r.textContent=e.label,r.title=e.caption||e.label,t}createTitleKey(e){let t=this._titleKeys.get(e);return void 0===t&&(t=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(e,t)),t}}tl._nInstance=0,ts.Renderer=tl,ts.defaultRenderer=new tl,(tP||(tP={})).createLayout=function(e){return e.layout||new te({renderer:e.renderer||to.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing,titleSpace:e.titleSpace})};var tu=class e extends e2{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==e.direction&&(this._direction=e.direction),void 0!==e.alignment&&(this._alignment=e.alignment),void 0!==e.spacing&&(this._spacing=e3.clampDimension(e.spacing))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=e3.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){j.ArrayExt.insert(this._items,e,new eJ(t)),j.ArrayExt.insert(this._sizers,e,new eq),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,r){j.ArrayExt.move(this._items,e,t),j.ArrayExt.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let r=j.ArrayExt.removeAt(this._items,e);j.ArrayExt.removeAt(this._sizers,e),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.AfterDetach),r.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let t=0;for(let e=0,r=this._items.length;e0)switch(this._alignment){case"start":break;case"center":l=0,u=s/2;break;case"end":l=0,u=s;break;case"justify":l=s/r,u=0;break;default:throw"unreachable"}for(let e=0,t=this._items.length;e0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:th}),tc.sizeBasisProperty=new ei({name:"sizeBasis",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:th}),tc.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e},tc.clampSpacing=function(e){return Math.max(0,Math.floor(e))};var td=class extends tr{constructor(e={}){super({layout:tF.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}};(tC=td||(td={})).getStretch=function(e){return tu.getStretch(e)},tC.setStretch=function(e,t){tu.setStretch(e,t)},tC.getSizeBasis=function(e){return tu.getSizeBasis(e)},tC.setSizeBasis=function(e,t){tu.setSizeBasis(e,t)},(tF||(tF={})).createLayout=function(e){return e.layout||new tu(e)};var tf=class e extends eH{constructor(t){super({node:tO.createNode()}),this._activeIndex=-1,this._itemTriggered=new ea(this),this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(eH.Flag.DisallowLayout),this.commands=t.commands,this.renderer=t.renderer||e.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get itemTriggered(){return this._itemTriggered}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=tO.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){let t=e.map(e=>tO.createItem(this.commands,e));return t.forEach(e=>this._items.push(e)),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){j.ArrayExt.removeAt(this._items,e)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){(this._results=null,""!==this.inputNode.value)?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none",this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}search(t){return e.search(this.items,t)}initialActiveIndex(e,t){return e?j.ArrayExt.findFirstIndex(t,tO.canActivate):-1}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let e=this.inputNode;e.focus(),e.select()}}onUpdateRequest(e){if(!this.isVisible)return void eN.render(null,this.contentNode);let t=this.inputNode.value,r=this.contentNode,i=this._results;if(i||(i=this._results=this.search(t),this._activeIndex=this.initialActiveIndex(t,i)),!t&&0===i.length)return void eN.render(null,r);if(t&&0===i.length){let e=this.renderer.renderEmptyMessage({query:t});eN.render(e,r);return}let n=this.renderer,a=this._activeIndex,o=Array(i.length);for(let e=0,t=i.length;e=i.length)r.scrollTop=0;else{let e=r.children[a];Z.scrollIntoViewIfNeeded(r,e)}}_evtClick(e){if(0!==e.button)return;if(e.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let t=j.ArrayExt.findFirstIndex(this.contentNode.children,t=>t.contains(e.target));-1!==t&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let e=this._activeIndex,t=this._results.length,r=ee-t),c=o.slice(0,u),h=o.slice(u);for(let e=0,t=h.length;er.command===e&&N.JSONExt.deepEqual(r.args,t))||null}}var tx=class e extends eH{constructor(t){super({node:tR.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._pendingTouchActivation=!1,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new ea(this),this._menuRequested=new ea(this),this.addClass("lm-Menu"),this.setFlag(eH.Flag.DisallowLayout),this.commands=t.commands,this.renderer=t.renderer||e.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),-1===e||tR.canActivate(this._items[e])||(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,r=t{this.activeIndex=e}})}eN.render(a,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1,this._pendingTouchActivation=!1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let r=this._parentMenu;r&&(this._parentMenu=null,r._childIndex=-1,r._childMenu=null,r.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(13===t)return void this.triggerActiveItem();if(27===t)return void this.close();if(37===t)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===t)return void this.activatePreviousItem();if(39===t){let e=this.activeItem;e&&"submenu"===e.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(40===t)return void this.activateNextItem();let r=ep().keyForKeydownEvent(e);if(!r)return;let i=this._activeIndex+1,n=tR.findMnemonic(this._items,r,i);-1===n.index||n.multiple?-1!==n.index?this.activeIndex=n.index:-1!==n.auto&&(this.activeIndex=n.auto):(this.activeIndex=n.index,this.triggerActiveItem())}_evtPointerUp(e){if(0===e.button){if(e3.isTouchEvent(e)){this._pendingTouchActivation=this._activateItemFromEvent(e),e.stopPropagation();return}e.preventDefault(),e.stopPropagation(),this._activateItemFromEvent(e),this.triggerActiveItem()}}_evtClick(e){this._pendingTouchActivation&&(this._pendingTouchActivation=!1,e.preventDefault(),e.stopPropagation(),this._activateItemFromEvent(e)&&this.triggerActiveItem())}_evtPointerMove(e){if(e3.isTouchEvent(e))return;let t=j.ArrayExt.findFirstIndex(this.contentNode.children,t=>Z.hitTest(t,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,(t=this.activeIndex)===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let r=this.activeItem;r&&"submenu"===r.type&&r.submenu&&this._startOpenTimer()}_evtPointerEnter(e){if(!e3.isTouchEvent(e))for(let e=this._parentMenu;e;e=e._parentMenu)e._cancelOpenTimer(),e._cancelCloseTimer(),e.activeIndex=e._childIndex}_evtPointerLeave(e){if(e3.isTouchEvent(e))return;if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:t,clientY:r}=e;Z.hitTest(this._childMenu.node,t,r)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtPointerDown(e){this._pendingTouchActivation=!1,this._parentMenu||(tR.hitTestMenus(this,e.clientX,e.clientY)?(e3.isTouchEvent(e)||e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(t=!1){let r=this.activeItem;if(!r||"submenu"!==r.type||!r.submenu)return void this._closeChildMenu();let i=r.submenu;if(i===this._childMenu)return;e.saveWindowData(),this._closeChildMenu(),this._childMenu=i,this._childIndex=this._activeIndex,i._parentMenu=this,ee.sendMessage(this,eH.Msg.UpdateRequest);let n=this.contentNode.children[this._activeIndex];tR.openSubmenu(i,n),t&&(i.activeIndex=-1,i.activateNextItem()),i.activate()}_activateItemFromEvent(e){let t=j.ArrayExt.findFirstIndex(this.contentNode.children,t=>Z.hitTest(t,e.clientX,e.clientY));return -1!==t&&(this.activeIndex=t,!0)}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},tR.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},tR.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){tR.saveWindowData()}},tb=tx||(tx={});class t_{renderItem(e){let t=this.createItemClass(e),r=this.createItemDataset(e),i=this.createItemARIA(e);return eP.li({className:t,dataset:r,tabindex:"0",onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e),this.renderShortcut(e),this.renderSubmenu(e))}renderIcon(e){let t=this.createIconClass(e);return eP.div({className:t},e.item.icon,e.item.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return eP.div({className:"lm-Menu-itemLabel"},t)}renderShortcut(e){let t=this.formatShortcut(e);return eP.div({className:"lm-Menu-itemShortcut"},t)}renderSubmenu(e){return eP.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(e){let t="lm-Menu-item";e.item.isEnabled||(t+=" lm-mod-disabled"),e.item.isToggled&&(t+=" lm-mod-toggled"),e.item.isVisible||(t+=" lm-mod-hidden"),e.active&&(t+=" lm-mod-active"),e.collapsed&&(t+=" lm-mod-collapsed");let r=e.item.className;return r&&(t+=` ${r}`),t}createItemDataset(e){let{type:t,command:r,dataset:i}=e.item;return"command"===t?{...i,type:t,command:r}:{...i,type:t}}createIconClass(e){let t="lm-Menu-itemIcon",r=e.item.iconClass;return r?`${t} ${r}`:t}createItemARIA(e){let t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true",e.item.isEnabled||(t["aria-disabled"]="true");break;default:e.item.isEnabled||(t["aria-disabled"]="true"),e.item.isToggleable||e.item.isToggled?(t.role="menuitemcheckbox",t["aria-checked"]=`${e.item.isToggled}`):t.role="menuitem"}return t}formatLabel(e){let{label:t,mnemonic:r}=e.item;if(r<0||r>=t.length)return t;let i=t.slice(0,r),n=t.slice(r+1),a=t[r];return[i,eP.span({className:"lm-Menu-itemMnemonic"},a),n]}formatShortcut(e){let t=e.item.keyBinding;return t?ek.formatKeystroke(t.keys):null}}tb.Renderer=t_,tb.defaultRenderer=new t_,function(e){e.TIMER_DELAY=300,e.SUBMENU_OVERLAP=3;let t=null,r=0;function i(){return r>0?(r--,t):a()}function n(e){return"separator"!==e.type&&e.isEnabled&&e.isVisible}function a(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}e.saveWindowData=function(){t=a(),r++},e.createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-Menu-content",e.appendChild(t),t.setAttribute("role","menu"),e.tabIndex=0,e},e.canActivate=n,e.createItem=function(e,t){return new o(e.commands,t)},e.hitTestMenus=function(e,t,r){for(let i=e;i;i=i.childMenu)if(Z.hitTest(i.node,t,r))return!0;return!1},e.computeCollapsed=function(e){let t=Array(e.length);j.ArrayExt.fill(t,!1);let r=0,i=e.length;for(;r=0;--n){let r=e[n];if(r.isVisible){if("separator"!==r.type)break;t[n]=!0}}let a=!1;for(;++rc+d&&(t=c+d-y),!a&&r+v>h+f&&(r>h+f?r=h+f-v:r-=v),g.transform=`translate(${Math.max(0,t)}px, ${Math.max(0,r)}px`,g.opacity="1"},e.openSubmenu=function(t,r){let n=i(),a=n.pageXOffset,o=n.pageYOffset,s=n.clientWidth,l=n.clientHeight;ee.sendMessage(t,eH.Msg.UpdateRequest);let u=t.node,c=u.style;c.opacity="0",c.maxHeight=`${l}px`,eH.attach(t,document.body);let{width:h,height:d}=u.getBoundingClientRect(),f=Z.boxSizing(t.node),p=r.getBoundingClientRect(),m=p.right-e.SUBMENU_OVERLAP;m+h>a+s&&(m=p.left+e.SUBMENU_OVERLAP-h);let g=p.top-f.borderTop-f.paddingTop;g+d>o+l&&(g=p.bottom+f.borderBottom+f.paddingBottom-d),c.transform=`translate(${Math.max(0,m)}px, ${Math.max(0,g)}px`,c.opacity="1"},e.findMnemonic=function(e,t,r){let i=-1,a=-1,o=!1,s=t.toUpperCase();for(let t=0,l=e.length;t=0&&dr.command===e&&N.JSONExt.deepEqual(r.args,t))||null}return null}}}(tR||(tR={}));var tw=tB||(tB={});function tT(e,t){let r=e.rank,i=t.rank;return r!==i?r=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,r=this._titles[t]||null,i=e,n=this._titles[i]||null;this._currentIndex=i,this._previousTitle=r,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:r,currentIndex:i,currentTitle:n})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let r=tj.asTitle(t),i=this._titles.indexOf(r),n=Math.max(0,Math.min(e,this._titles.length));return -1===i?(j.ArrayExt.insert(this._titles,n,r),r.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(n,r)):(n===this._titles.length&&n--,i===n||(j.ArrayExt.move(this._titles,i,n),this.update(),this._adjustCurrentForMove(i,n))),r}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){let t=e>=0&&e-1?this._currentIndex:0;for(let e=0,t=r.length;eZ.hitTest(t,e.clientX,e.clientY));if(-1===r)return;let i=this.titles[r],n=t[r].querySelector(".lm-TabBar-tabLabel");if(n&&n.contains(e.target)){let e=i.label||"",t=n.innerHTML;n.innerHTML="";let r=document.createElement("input");r.classList.add("lm-TabBar-tabInput"),r.value=e,n.appendChild(r);let a=()=>{r.removeEventListener("blur",a),n.innerHTML=t,this.node.addEventListener("keydown",this)};r.addEventListener("dblclick",e=>e.stopPropagation()),r.addEventListener("blur",a),r.addEventListener("keydown",e=>{"Enter"===e.key?(""!==r.value&&(i.label=i.caption=r.value),a()):"Escape"===e.key&&a()}),this.node.removeEventListener("keydown",this),r.select(),r.focus(),n.children.length>0&&n.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),"Escape"===e.key&&this._releaseMouse())}_evtKeyDown(e){var t,r,i;if("Tab"!==e.key&&e.eventPhase!==Event.CAPTURING_PHASE){if("Enter"===e.key||"Spacebar"===e.key||" "===e.key){let t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{let r=j.ArrayExt.findFirstIndex(this.contentNode.children,e=>e.contains(t));r>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=r)}}else if(tM.includes(e.key)){let n,a=[...this.contentNode.children];if(this.addButtonEnabled&&a.push(this.addButtonNode),a.length<=1)return;e.preventDefault(),e.stopPropagation();let o=a.indexOf(document.activeElement);-1===o&&(o=this._currentIndex),"ArrowRight"===e.key&&"horizontal"===this._orientation||"ArrowDown"===e.key&&"vertical"===this._orientation?n=null!=(t=a[o+1])?t:a[0]:"ArrowLeft"===e.key&&"horizontal"===this._orientation||"ArrowUp"===e.key&&"vertical"===this._orientation?n=null!=(r=a[o-1])?r:a[a.length-1]:"Home"===e.key?n=a[0]:"End"===e.key&&(n=a[a.length-1]),n&&(null==(i=a[o])||i.setAttribute("tabindex","-1"),n?.setAttribute("tabindex","0"),n.focus())}}}_evtPointerDown(e){if(this._pendingTouchCloseRequest=null,0!==e.button&&1!==e.button||this._dragData||e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),r=this.contentNode.children,i=j.ArrayExt.findFirstIndex(r,t=>Z.hitTest(t,e.clientX,e.clientY));if(-1===i&&!t)return;let n=-1!==i?r[i].querySelector(this.renderer.closeIconSelector):null,a=!!n&&n.contains(e.target);a&&e3.isTouchEvent(e)||e.preventDefault(),e.stopPropagation(),this._dragData={tab:r[i],index:i,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),!(1===e.button||t)&&(a||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===i?this.currentIndex=-1:this.currentIndex=i,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle})))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let r=this.contentNode.children;if(!(!t.dragActive&&!tj.dragExceeded(t,e))){if(!t.dragActive){let e=t.tab.getBoundingClientRect();"horizontal"===this._orientation?(t.tabPos=t.tab.offsetLeft,t.tabSize=e.width,t.tabPressPos=t.pressX-e.left):(t.tabPos=t.tab.offsetTop,t.tabSize=e.height,t.tabPressPos=t.pressY-e.top),t.tabPressOffset={x:t.pressX-e.left,y:t.pressY-e.top},t.tabLayout=tj.snapTabLayout(r,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=eu.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&tj.detachExceeded(t,e)){t.detachRequested=!0;let i=t.index,n=e.clientX,a=e.clientY,o=r[i],s=this._titles[i];if(this._tabDetachRequested.emit({index:i,title:s,tab:o,clientX:n,clientY:a,offset:t.tabPressOffset}),t.dragAborted)return}tj.layoutTabs(r,t,e,this._orientation)}}_evtPointerUp(e){if(0!==e.button&&1!==e.button)return;let t=this._dragData;if(!t)return;let r=e3.isTouchEvent(e);if(r||e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target))return void this._addRequested.emit(void 0);let i=this.contentNode.children,n=j.ArrayExt.findFirstIndex(i,t=>Z.hitTest(t,e.clientX,e.clientY));if(n!==t.index)return;let a=this._titles[n];if(!a.closable)return;if(1===e.button)return void this._tabCloseRequested.emit({index:n,title:a});let o=i[n].querySelector(this.renderer.closeIconSelector);if(o&&o.contains(e.target)){if(this._tabSizeFrozen=!0,r){this._pendingTouchCloseRequest={index:n,title:a};return}this._tabCloseRequested.emit({index:n,title:a})}return}0!==e.button||(tj.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging"),setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,tj.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let e=t.index,r=t.targetIndex;-1===r||e===r||(j.ArrayExt.move(this._titles,e,r),this._adjustCurrentForMove(e,r),this._tabMoved.emit({fromIndex:e,toIndex:r,title:this._titles[r]}),ee.sendMessage(this,eH.Msg.UpdateRequest))},tj.parseTransitionDuration(t.tab)))}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(tj.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let r=this.currentTitle,i=this._currentIndex,n=this.insertBehavior;if("select-tab"===n||"select-tab-if-needed"===n&&-1===i){this._currentIndex=e,this._previousTitle=r,this._currentChanged.emit({previousIndex:i,previousTitle:r,currentIndex:e,currentTitle:t});return}i>=e&&this._currentIndex++}_evtClick(e){let t=this._pendingTouchCloseRequest;if(!t)return;this._pendingTouchCloseRequest=null,e.preventDefault(),e.stopPropagation();let r=this.contentNode.children[t.index],i=r?.querySelector(this.renderer.closeIconSelector);this._titles[t.index]===t.title&&i&&i.contains(e.target)?this._tabCloseRequested.emit(t):this._clearTabSizeFreezeState()}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let r=this._currentIndex,i=this.removeBehavior;if(r!==e){r>e&&this._currentIndex--;return}if(0===this._titles.length){this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if("select-tab-after"===i){this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if("select-tab-before"===i){this._currentIndex=Math.max(0,e-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if("select-previous-tab"===i){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}_onTitleChanged(e){this.update()}_evtPointerLeave(e){if(!this._tabSizeFrozen)return;this._tabSizeFrozen=!1,this._frozenTabWidths=null,this._unfreezeRunID++;let t=this._unfreezeRunID;this._clearUnfreezeTransitionState(),this.addClass("lm-mod-unfreezing");let r=this.contentNode.children;for(let e=0,t=r.length;e{let r=e.propertyName;("width"===r||"flex-basis"===r)&&this._finalizeUnfreezeRun(t)};this._unfreezeTransitionListener=e,this.node.addEventListener("transitionend",e),this.node.addEventListener("transitioncancel",e),this._unfreezeFallbackTimerID=window.setTimeout(()=>{this._finalizeUnfreezeRun(t)},2e3)}this.update()}_setFrozenTabSize(e,t){let r=`${t}px`;e.style.width=r,e.style.flexBasis=r}_finalizeUnfreezeRun(e){e===this._unfreezeRunID&&(this._clearUnfreezeTransitionState(),this.removeClass("lm-mod-unfreezing"))}_clearUnfreezeTransitionState(){this._unfreezeTransitionListener&&(this.node.removeEventListener("transitionend",this._unfreezeTransitionListener),this.node.removeEventListener("transitioncancel",this._unfreezeTransitionListener),this._unfreezeTransitionListener=null),0!==this._unfreezeFallbackTimerID&&(clearTimeout(this._unfreezeFallbackTimerID),this._unfreezeFallbackTimerID=0)}_clearTabSizeFreezeState(){this._tabSizeFrozen=!1,this._frozenTabWidths=null,this.removeClass("lm-mod-unfreezing");let e=this.contentNode.children;for(let t=0,r=e.length;t=tI.DRAG_THRESHOLD||i>=tI.DRAG_THRESHOLD},tI.detachExceeded=function(e,t){let r=e.contentRect;return t.clientX=r.right+tI.DETACH_THRESHOLD||t.clientY=r.bottom+tI.DETACH_THRESHOLD},tI.layoutTabs=function(e,t,r,i){let n,a,o,s;"horizontal"===i?(n=t.pressX,a=r.clientX-t.contentRect.left,o=r.clientX,s=t.contentRect.width):(n=t.pressY,a=r.clientY-t.contentRect.top,o=r.clientY,s=t.contentRect.height);let l=t.index,u=a-t.tabPressPos,c=u+t.tabSize;for(let r=0,a=e.length;r>1);if(rt.index&&c>d)a=`${-t.tabSize-h.margin}px`,l=Math.max(l,r);else if(r===t.index){let e=o-n,r=s-(t.tabPos+t.tabSize);a=`${Math.max(-t.tabPos,Math.min(e,r))}px`}else a="";"horizontal"===i?e[r].style.left=a:e[r].style.top=a}t.targetIndex=l},tI.finalizeTabPosition=function(e,t){let r,i;if(r="horizontal"===t?e.contentRect.width:e.contentRect.height,e.targetIndex===e.index)i=0;else if(e.targetIndex>e.index){let t=e.tabLayout[e.targetIndex];i=t.pos+t.size-e.tabSize-e.tabPos}else i=e.tabLayout[e.targetIndex].pos-e.tabPos;let n=r-(e.tabPos+e.tabSize),a=Math.max(-e.tabPos,Math.min(i,n));"horizontal"===t?e.tab.style.left=`${a}px`:e.tab.style.top=`${a}px`},tI.resetTabPositions=function(e,t){for(let r of e)"horizontal"===t?r.style.left="":r.style.top=""};var tD,tC,tI,tL,tP,tz,tF,tO,tR,tB,tj,tN,tV=class extends e${constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,void 0!==e.spacing&&(this._spacing=e3.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=void 0!==e.hiddenMode?e.hiddenMode:eH.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();for(let t of(this._items.forEach(e=>{e.dispose()}),this._box=null,this._root=null,this._items.clear(),e))t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){for(let t of(this._hiddenMode=e,this.tabBars()))if(t.titles.length>1)for(let e of t.titles)e.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=e3.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,j.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,j.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,j.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,j.empty)()}handles(){return this._root?this._root.iterHandles():(0,j.empty)()}moveHandle(e,t,r){let i,n=e.classList.contains("lm-mod-hidden");if(!this._root||n)return;let a=this._root.findSplitNode(e);a&&0!=(i="horizontal"===a.node.orientation?t-e.offsetLeft:r-e.offsetTop)&&(a.node.holdSizes(),eU.adjust(a.node.sizers,a.index,i),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t=new Set,r;r=e.main?tN.normalizeAreaConfig(e.main,t):null;let i=this.widgets(),n=this.tabBars(),a=this.handles();for(let e of(this._root=null,i))t.has(e)||(e.parent=null);for(let e of n)e.dispose();for(let e of a)e.parentNode&&e.parentNode.removeChild(e);for(let e of t)e.parent=this.parent;r?this._root=tN.realizeAreaConfig(r,{createTabBar:e=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(t.forEach(e=>{this.attachWidget(e)}),this.parent.fit())}addWidget(e,t={}){let r=t.ref||null,i=t.mode||"tab-after",n=null;if(this._root&&r&&(n=this._root.findTabNode(r)),r&&!n)throw Error("Reference widget is not in the layout.");switch(e.parent=this.parent,i){case"tab-after":this._insertTab(e,r,n,!0);break;case"tab-before":this._insertTab(e,r,n,!1);break;case"split-top":this._insertSplit(e,r,n,"vertical",!1);break;case"split-left":this._insertSplit(e,r,n,"horizontal",!1);break;case"split-right":this._insertSplit(e,r,n,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,r,n,"vertical",!0);break;case"merge-top":this._insertSplit(e,r,n,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,r,n,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,r,n,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,r,n,"vertical",!0,!0)}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=Z.boxSizing(this.parent.node));let r=this.parent.node.getBoundingClientRect(),i=e-r.left-this._box.borderLeft,n=t-r.top-this._box.borderTop,a=this._root.hitTestTabNodes(i,n);if(!a)return null;let{tabBar:o,top:s,left:l,width:u,height:c}=a,h=this._box.borderLeft+this._box.borderRight,d=this._box.borderTop+this._box.borderBottom,f=r.width-h-(l+u),p=r.height-d-(s+c);return{tabBar:o,x:i,y:n,top:s,left:l,right:f,bottom:p,width:u,height:c}}init(){for(let e of(super.init(),this))this.attachWidget(e);for(let e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new eJ(e)),this.parent.isAttached&&ee.sendMessage(e,eH.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&ee.sendMessage(e,eH.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&ee.sendMessage(e,eH.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&ee.sendMessage(e,eH.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;if(tN.removeAria(e),t.tabBar.titles.length>1){t.tabBar.removeTab(e.title),this._hiddenMode===eH.HiddenMode.Scale&&1==t.tabBar.titles.length&&(t.tabBar.titles[0].owner.hiddenMode=eH.HiddenMode.Display);return}if(t.tabBar.dispose(),this._root===t){this._root=null;return}this._root.holdAllSizes();let r=t.parent;t.parent=null;let i=j.ArrayExt.removeFirstOf(r.children,t),n=j.ArrayExt.removeAt(r.handles,i);if(j.ArrayExt.removeAt(r.sizers,i),n.parentNode&&n.parentNode.removeChild(n),r.children.length>1)return void r.syncHandles();let a=r.parent;r.parent=null;let o=r.children[0],s=r.handles[0];if(r.children.length=0,r.handles.length=0,r.sizers.length=0,s.parentNode&&s.parentNode.removeChild(s),this._root===r){o.parent=null,this._root=o;return}let l=a.children.indexOf(r);if(o instanceof tN.TabLayoutNode){o.parent=a,a.children[l]=o;return}let u=j.ArrayExt.removeAt(a.handles,l);j.ArrayExt.removeAt(a.children,l),j.ArrayExt.removeAt(a.sizers,l),u.parentNode&&u.parentNode.removeChild(u);for(let e=0,t=o.children.length;e=r.length)&&(i=0),{type:"tab-area",widgets:r,currentIndex:i}}(t,r):function(t,r){let i=t.orientation,n=[],a=[];for(let o=0,s=t.children.length;o{let i=n(e,u,c),a=t(l.sizes[r]),o=u.createHandle();h.children.push(i),h.handles.push(o),h.sizers.push(a),i.parent=h}),h.syncHandles(),h.normalizeSizes(),h)};class r{constructor(e){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let t=new eq,r=new eq;t.stretch=0,r.stretch=1,this.tabBar=e,this.sizers=[t,r]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(let e of this.tabBar.titles)yield e.owner}*iterSelectedWidgets(){let e=this.tabBar.currentTitle;e&&(yield e.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(e){return -1!==this.tabBar.titles.indexOf(e.title)?this:null}findSplitNode(e){return null}findFirstTabNode(){return this}hitTestTabNodes(e,t){return e=this._left+this._width||t=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map(e=>e.owner),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(e,t){let r=0,i=0,n=t.get(this.tabBar),a=this.tabBar.currentTitle,o=a?t.get(a.owner):void 0,[s,l]=this.sizers;return n&&n.fit(),o&&o.fit(),n&&!n.isHidden?(r=Math.max(r,n.minWidth),i+=n.minHeight,s.minSize=n.minHeight,s.maxSize=n.maxHeight):(s.minSize=0,s.maxSize=0),o&&!o.isHidden?(r=Math.max(r,o.minWidth),i+=o.minHeight,l.minSize=o.minHeight):l.minSize=0,l.maxSize=1/0,{minWidth:r,minHeight:i,maxWidth:1/0,maxHeight:1/0}}update(e,t,r,i,n,a){this._top=t,this._left=e,this._width=r,this._height=i;let o=a.get(this.tabBar),s=this.tabBar.currentTitle,l=s?a.get(s.owner):void 0;if(eU.calc(this.sizers,i),o&&!o.isHidden){let i=this.sizers[0].size;o.update(e,t,r,i),t+=i}if(l&&!l.isHidden){let i=this.sizers[1].size;l.update(e,t,r,i)}}}e.TabLayoutNode=r;class i{constructor(e){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=e}*iterAllWidgets(){for(let e of this.children)yield*e.iterAllWidgets()}*iterUserWidgets(){for(let e of this.children)yield*e.iterUserWidgets()}*iterSelectedWidgets(){for(let e of this.children)yield*e.iterSelectedWidgets()}*iterTabBars(){for(let e of this.children)yield*e.iterTabBars()}*iterHandles(){for(let e of(yield*this.handles,this.children))yield*e.iterHandles()}findTabNode(e){for(let t=0,r=this.children.length;te.createConfig()),sizes:t}}syncHandles(){this.handles.forEach((e,t)=>{e.setAttribute("data-orientation",this.orientation),t===this.handles.length-1?e.classList.add("lm-mod-hidden"):e.classList.remove("lm-mod-hidden")})}holdSizes(){for(let e of this.sizers)e.sizeHint=e.size}holdAllSizes(){for(let e of this.children)e.holdAllSizes();this.holdSizes()}normalizeSizes(){let e=this.sizers.length;if(0===e)return;this.holdSizes();let t=this.sizers.reduce((e,t)=>e+t.sizeHint,0);if(0===t)for(let t of this.sizers)t.size=t.sizeHint=1/e;else for(let e of this.sizers)e.size=e.sizeHint/=t;this.normalized=!0}createNormalizedSizes(){let e=this.sizers.length;if(0===e)return[];let t=this.sizers.map(e=>e.size),r=t.reduce((e,t)=>e+t,0);if(0===r)for(let r=t.length-1;r>-1;r--)t[r]=1/e;else for(let e=t.length-1;e>-1;e--)t[e]/=r;return t}fit(e,t){let r="horizontal"===this.orientation,i=Math.max(0,this.children.length-1)*e,n=r?i:0,a=r?0:i;for(let i=0,o=this.children.length;ithis._createTabBar(),createHandle:()=>this._createHandle()},spacing:t.spacing,hiddenMode:t.hiddenMode}),this.overlay=t.overlay||new e.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(let e of t.tabBars())e.show();break;case"single-document":t.restoreLayout(_.createSingleDocumentConfig(this));break;default:throw"unreachable"}ee.postMessage(this,_.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){for(let t of(this._tabsMovable=e,this.tabBars()))t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){for(let t of(this._addButtonEnabled=e,this.tabBars()))t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=(0,j.find)(this.tabBars(),t=>-1!==t.titles.indexOf(e.title));if(!t)throw Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(X.IS_EDGE||X.IS_IE)&&ee.flush(),ee.postMessage(this,_.LayoutModified)}addWidget(e,t={}){"single-document"===this._mode?this.layout.addWidget(e):this.layout.addWidget(e,t),ee.postMessage(this,_.LayoutModified)}processMessage(e){"layout-modified"===e.type?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){_.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){_.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),ee.postMessage(this,_.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||"invalid"===this._showOverlay(e.clientX,e.clientY)?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),"none"===e.proposedAction){e.dropAction="none";return}let{clientX:t,clientY:r}=e,{zone:i,target:n}=_.findDropTarget(this,t,r,this._edges);if(this._tabsConstrained&&e.source!==this||"invalid"===i){e.dropAction="none";return}let a=e.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof a){e.dropAction="none";return}let o=a();if(!(o instanceof eH)||o.contains(this)){e.dropAction="none";return}let s=n?_.getDropRef(n.tabBar):null;switch(i){case"root-all":this.addWidget(o);break;case"root-top":this.addWidget(o,{mode:"split-top"});break;case"root-left":this.addWidget(o,{mode:"split-left"});break;case"root-right":this.addWidget(o,{mode:"split-right"});break;case"root-bottom":this.addWidget(o,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(o,{mode:"tab-after",ref:s});break;case"widget-top":this.addWidget(o,{mode:"split-top",ref:s});break;case"widget-left":this.addWidget(o,{mode:"split-left",ref:s});break;case"widget-right":this.addWidget(o,{mode:"split-right",ref:s});break;case"widget-bottom":this.addWidget(o,{mode:"split-bottom",ref:s});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(o)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&(this._releaseMouse(),ee.postMessage(this,_.LayoutModified))}_evtPointerDown(e){if(0!==e.button)return;let t=this.layout,r=e.target,i=(0,j.find)(t.handles(),e=>e.contains(r));if(!i)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let n=i.getBoundingClientRect(),a=e.clientX-n.left,o=e.clientY-n.top,s=window.getComputedStyle(i),l=eu.overrideCursor(s.cursor,this._document);this._pressData={handle:i,deltaX:a,deltaY:o,override:l}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),r=e.clientX-t.left-this._pressData.deltaX,i=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,r,i)}_evtPointerUp(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),ee.postMessage(this,_.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let{zone:r,target:i}=_.findDropTarget(this,e,t,this._edges);if("invalid"===r)return this.overlay.hide(100),r;let n,a,o,s,l=Z.boxSizing(this.node),u=this.node.getBoundingClientRect();switch(r){case"root-all":n=l.paddingTop,a=l.paddingLeft,o=l.paddingRight,s=l.paddingBottom;break;case"root-top":n=l.paddingTop,a=l.paddingLeft,o=l.paddingRight,s=u.height*_.GOLDEN_RATIO;break;case"root-left":n=l.paddingTop,a=l.paddingLeft,o=u.width*_.GOLDEN_RATIO,s=l.paddingBottom;break;case"root-right":n=l.paddingTop,a=u.width*_.GOLDEN_RATIO,o=l.paddingRight,s=l.paddingBottom;break;case"root-bottom":n=u.height*_.GOLDEN_RATIO,a=l.paddingLeft,o=l.paddingRight,s=l.paddingBottom;break;case"widget-all":n=i.top,a=i.left,o=i.right,s=i.bottom;break;case"widget-top":n=i.top,a=i.left,o=i.right,s=i.bottom+i.height/2;break;case"widget-left":n=i.top,a=i.left,o=i.right+i.width/2,s=i.bottom;break;case"widget-right":n=i.top,a=i.left+i.width/2,o=i.right,s=i.bottom;break;case"widget-bottom":n=i.top+i.height/2,a=i.left,o=i.right,s=i.bottom;break;case"widget-tab":{let e=i.tabBar.node.getBoundingClientRect().height;n=i.top,a=i.left,o=i.right,s=i.bottom+i.height-e;break}default:throw"unreachable"}return this.overlay.show({top:n,left:a,right:o,bottom:s}),r}_createTabBar(){let e=this._renderer.createTabBar(this._document);return _.isGeneratedTabBarProperty.set(e,!0),"single-document"===this._mode&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){ee.postMessage(this,_.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:r,currentTitle:i}=t;r&&r.owner.hide(),i&&i.owner.show(),(X.IS_EDGE||X.IS_IE)&&ee.flush(),ee.postMessage(this,_.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:r,tab:i,clientX:n,clientY:a,offset:o}=t,s=new N.MimeData;s.setData("application/vnd.lumino.widget-factory",()=>r.owner);let l=i.cloneNode(!0);o&&(l.style.top=`-${o.y}px`,l.style.left=`-${o.x}px`),this._drag=new eu({document:this._document,mimeData:s,dragImage:l,proposedAction:"move",supportedActions:"move",source:this}),i.classList.add("lm-mod-hidden");let u=()=>{this._drag=null,i.classList.remove("lm-mod-hidden")};this._drag.start(n,a).then(u)}},tq=tU||(tU={});tq.Overlay=class{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(e){let t=this.node.style;t.top=`${e.top}px`,t.left=`${e.left}px`,t.right=`${e.right}px`,t.bottom=`${e.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(e){if(!this._hidden){if(e<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}-1===this._timer&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},e))}}};class tG{createTabBar(e){let t=new tk({document:e});return t.addClass("lm-DockPanel-tabBar"),t}createHandle(){let e=document.createElement("div");return e.className="lm-DockPanel-handle",e}}tq.Renderer=tG,tq.defaultRenderer=new tG,(m=_||(_={})).GOLDEN_RATIO=.618,m.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},m.LayoutModified=new er("layout-modified"),m.isGeneratedTabBarProperty=new ei({name:"isGeneratedTabBar",create:()=>!1}),m.createSingleDocumentConfig=function(e){if(e.isEmpty)return{main:null};let t=Array.from(e.widgets()),r=e.selectedWidgets().next().value,i=r?t.indexOf(r):-1;return{main:{type:"tab-area",widgets:t,currentIndex:i}}},m.findDropTarget=function(e,t,r,i){let n;if(!Z.hitTest(e.node,t,r))return{zone:"invalid",target:null};let a=e.layout;if(a.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===e.mode){let n=e.node.getBoundingClientRect(),a=t-n.left+1,o=r-n.top+1,s=n.right-t,l=n.bottom-r;switch(Math.min(o,s,l,a)){case o:if(oh&&u>h&&l>d&&c>d)return{zone:"widget-all",target:o};switch(s/=h,l/=d,Math.min(s,l,u/=h,c/=d)){case s:n="widget-left";break;case l:n="widget-top";break;case u:n="widget-right";break;case c:n="widget-bottom";break;default:throw"unreachable"}return{zone:n,target:o}},m.getDropRef=function(e){return 0===e.titles.length?null:e.currentTitle?e.currentTitle.owner:e.titles[e.titles.length-1].owner};var tH=class e extends e${constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new eq],this._columnSizers=[new eq],this._box=null,void 0!==e.rowCount&&w.reallocSizers(this._rowSizers,e.rowCount),void 0!==e.columnCount&&w.reallocSizers(this._columnSizers,e.columnCount),void 0!==e.rowSpacing&&(this._rowSpacing=w.clampValue(e.rowSpacing)),void 0!==e.columnSpacing&&(this._columnSpacing=w.clampValue(e.columnSpacing))}dispose(){for(let e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(w.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(w.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=w.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=w.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let r=this._rowSizers[e];r&&(t=w.clampValue(t),r.stretch!==t&&(r.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let r=this._columnSizers[e];r&&(t=w.clampValue(t),r.stretch!==t&&(r.stretch=t,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(let e of this._items)yield e.widget}addWidget(e){-1===j.ArrayExt.findFirstIndex(this._items,t=>t.widget===e)&&(this._items.push(new eJ(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=j.ArrayExt.findFirstIndex(this._items,t=>t.widget===e);if(-1===t)return;let r=j.ArrayExt.removeAt(this._items,t);this.parent&&this.detachWidget(e),r.dispose()}init(){for(let e of(super.init(),this))this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&ee.sendMessage(e,eH.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&ee.sendMessage(e,eH.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&ee.sendMessage(e,eH.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&ee.sendMessage(e,eH.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let e=0,t=this.rowCount;e!e.isHidden);for(let e=0,r=t.length;e({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(e){e.parent&&e.parent.layout instanceof tH&&e.parent.fit()}}),y.normalizeConfig=function(e){return{row:Math.max(0,Math.floor(e.row||0)),column:Math.max(0,Math.floor(e.column||0)),rowSpan:Math.max(1,Math.floor(e.rowSpan||0)),columnSpan:Math.max(1,Math.floor(e.columnSpan||0))}},y.clampValue=function(e){return Math.max(0,Math.floor(e))},y.rowSpanCmp=function(e,t){let r=y.cellConfigProperty.get(e.widget),i=y.cellConfigProperty.get(t.widget);return r.rowSpan-i.rowSpan},y.columnSpanCmp=function(e,t){let r=y.cellConfigProperty.get(e.widget),i=y.cellConfigProperty.get(t.widget);return r.columnSpan-i.columnSpan},y.reallocSizers=function(e,t){for(t=Math.max(1,Math.floor(t));e.lengtht&&(e.length=t)},y.distributeMin=function(e,t,r,i){if(r=i)return;let a=(i-n)/(r-t+1);for(let i=t;i<=r;++i)e[i].minSize+=a};var t$=class e extends eH{constructor(t={}){super({node:T.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(eH.Flag.DisallowLayout),this.renderer=t.renderer||e.defaultRenderer,this._forceItemsPosition=t.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=t.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&0===this._menus[e].items.length&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,r=!0){this._closeChildMenu();let i=this._menus.indexOf(t),n=Math.max(0,Math.min(e,this._menus.length));if(-1===i){j.ArrayExt.insert(this._menus,n,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),r&&this.update();return}n===this._menus.length&&n--,i!==n&&(j.ArrayExt.move(this._menus,i,n),r&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let r=j.ArrayExt.removeAt(this._menus,e);r&&(r.aboutToClose.disconnect(this._onMenuAboutToClose,this),r.menuRequested.disconnect(this._onMenuMenuRequested,this),r.title.changed.disconnect(this._onTitleChanged,this),r.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(0!==this._menus.length){for(let e of(this._closeChildMenu(),this._menus))e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":case"pointerleave":this._evtPointerMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("pointermove",this),this.node.addEventListener("pointerleave",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("pointermove",this),this.node.removeEventListener("pointerleave",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let r=this._menus,i=this.renderer,n=this._activeIndex,a=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:r.length,s=0,l=!1,u=Array(o=null!==this._overflowMenu?o-1:o);for(let e=0;e{this._tabFocusIndex=e,this.activeIndex=e}}),s+=this._menuItemSizes[e],r[e].title.label===this._overflowMenuOptions.title&&(l=!0,o--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!l){if(null===this._overflowMenu){let e=null!=(t=this._overflowMenuOptions.title)?t:"...";this._overflowMenu=new tx({commands:new ek}),this._overflowMenu.title.label=e,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let e=r.length-2;e>=o;e--){let t=this.menus[e];t.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:t}),this.removeMenu(t,!1)}u[o]=i.renderItem({title:this._overflowMenu.title,active:o===n&&0!==r[o].items.length,tabbable:o===a,disabled:0===r[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}else if(null!==this._overflowMenu){let e=this._overflowMenu.items,t=this.node.offsetWidth,n=this._overflowMenu.items.length;for(let l=0;lthis._menuItemSizes[n]){let t=e[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(o,t,!1),u[o]=i.renderItem({title:t.title,active:!1,tabbable:o===a,disabled:0===r[o].items.length,onfocus:()=>{this._tabFocusIndex=o,this.activeIndex=o}}),o++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),u.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}eN.render(u,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let e=this.contentNode.childNodes,t=this.node.offsetWidth,r=0,i=-1,n=e.length;if(0==this._menuItemSizes.length)for(let a=0;at&&-1===i&&(i=a)}else for(let e=0;et){i=e;break}this._overflowIndex=i}_evtKeyDown(e){let t=e.keyCode;if(9===t){this.activeIndex=-1;return}if(e.preventDefault(),e.stopPropagation(),13===t||32===t||38===t||40===t){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(27===t){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(37===t||39===t){let e=37===t?-1:1,r=this._tabFocusIndex+e,i=this._menus.length;for(let t=0;tZ.hitTest(t,e.clientX,e.clientY));if(-1===t)return void this._closeChildMenu();if(0===e.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();let r=this._positionForMenu(t);tx.saveWindowData(),this.activeIndex=t,this._openChildMenu(r)}}_evtPointerMove(e){if(e3.isTouchEvent(e))return;let t=j.ArrayExt.findFirstIndex(this.contentNode.children,t=>Z.hitTest(t,e.clientX,e.clientY));if(t===this._activeIndex||-1===t&&this._childMenu)return;let r=t>=0&&this._childMenu?this._positionForMenu(t):null;tx.saveWindowData(),this.activeIndex=t,r&&this._openChildMenu(r)}_positionForMenu(e){let{left:t,bottom:r}=this.contentNode.children[e].getBoundingClientRect();return{top:r,left:t}}_evtFocusOut(e){this._childMenu||this.node.contains(e.relatedTarget)||(this.activeIndex=-1)}_focusItemAt(e){let t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t)return void this._closeChildMenu();let r=this._childMenu;if(r===t)return;this._childMenu=t,r?r.close():document.addEventListener("pointerdown",this,!0),this._tabFocusIndex=this.activeIndex,ee.sendMessage(this,eH.Msg.UpdateRequest);let{left:i,top:n}=e;(typeof i>"u"||typeof n>"u")&&({left:i,top:n}=this._positionForMenu(this._activeIndex)),r||this.addClass("lm-mod-active"),t.items.length>0&&t.open(i,n,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("pointerdown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("pointerdown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let r=this._activeIndex,i=this._menus.length;switch(t){case"next":this.activeIndex=r===i-1?0:r+1;break;case"previous":this.activeIndex=0===r?i-1:r-1}this.openActiveMenu()}_onTitleChanged(){this.update()}},tW=t$||(t$={});class tY{renderItem(e){let t=this.createItemClass(e),r=this.createItemDataset(e),i=this.createItemARIA(e);return eP.li({className:t,dataset:r,...e.disabled?{}:{tabindex:e.tabbable?"0":"-1"},onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){let t=this.createIconClass(e);return eP.div({className:t},e.title.icon,e.title.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return eP.div({className:"lm-MenuBar-itemLabel"},t)}createItemClass(e){let t="lm-MenuBar-item";return e.title.className&&(t+=` ${e.title.className}`),e.active&&!e.disabled&&(t+=" lm-mod-active"),t}createItemDataset(e){return e.title.dataset}createItemARIA(e){return{role:"menuitem","aria-haspopup":"true","aria-disabled":e.disabled?"true":"false"}}createIconClass(e){let t="lm-MenuBar-itemIcon",r=e.title.iconClass;return r?`${t} ${r}`:t}formatLabel(e){let{label:t,mnemonic:r}=e.title;if(r<0||r>=t.length)return t;let i=t.slice(0,r),n=t.slice(r+1),a=t[r];return[i,eP.span({className:"lm-MenuBar-itemMnemonic"},a),n]}}tW.Renderer=tY,tW.defaultRenderer=new tY,(v=T||(T={})).createNode=function(){let e=document.createElement("div"),t=document.createElement("ul");return t.className="lm-MenuBar-content",e.appendChild(t),t.setAttribute("role","menubar"),e},v.findMnemonic=function(e,t,r){let i=-1,n=-1,a=!1,o=t.toUpperCase();for(let t=0,s=e.length;t=0&&c1&&this.widgets.forEach(e=>{e.hiddenMode=this._hiddenMode}))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===eH.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=eH.HiddenMode.Scale),t.hiddenMode=eH.HiddenMode.Scale):t.hiddenMode=eH.HiddenMode.Display,j.ArrayExt.insert(this._items,e,new eJ(t)),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,r){j.ArrayExt.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let r=j.ArrayExt.removeAt(this._items,e);this.parent.isAttached&&ee.sendMessage(t,eH.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&ee.sendMessage(t,eH.Msg.AfterDetach),r.widget.node.style.zIndex="",this._hiddenMode===eH.HiddenMode.Scale&&(t.hiddenMode=eH.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=eH.HiddenMode.Display)),r.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let r=0,i=this._items.length;r{this.createGraph(this._model)})}renderModel(e){if(this.hasGraphElement())return JSON.stringify(this._model?.data[this._mimeType])===JSON.stringify(e.data[this._mimeType])?Promise.resolve():(this._model=e,this.createGraph(e));this._model=e;let t=e.data["image/png"];return null!=t?(this.updateImage(t),Promise.resolve()):this.createGraph(e)}hasGraphElement(){return null!==this.node.querySelector(".plot-container")}updateImage(e){this.hideGraph(),this._img_el.src="data:image/png;base64,"+e,this.showImage()}hideGraph(){let e=this.node.querySelector(".plot-container");null!=e&&(e.style.display="none")}showGraph(){let e=this.node.querySelector(".plot-container");null!=e&&(e.style.display="block")}hideImage(){let e=this.node.querySelector(".plot-img");null!=e&&(e.style.display="none")}showImage(){let e=this.node.querySelector(".plot-img");null!=e&&(e.style.display="block")}createGraph(t){let{data:r,layout:i,frames:n,config:a}=t.data[this._mimeType];return i.height||(i.height=360),(async()=>(null===e.Plotly&&(e.Plotly=await Promise.resolve().then(()=>F(B())),e._resolveLoadingPlotly()),e.loadingPlotly))().then(()=>e.Plotly.react(this.node,r,i,a)).then(r=>{this.showGraph(),this.hideImage(),this.update(),n&&e.Plotly.addFrames(this.node,n),this.node.offsetWidth>0&&this.node.offsetHeight>0&&e.Plotly.toImage(r,{format:"png",width:this.node.offsetWidth,height:this.node.offsetHeight}).then(e=>{let r=e.split(",")[1];t.data["image/png"]!==r&&t.setData({data:{...t.data,"image/png":r}})}),this.node.on("plotly_webglcontextlost",()=>{let e=t.data["image/png"];if(null!=e)return this.updateImage(e),Promise.resolve()})})}onAfterShow(e){this.update()}onResize(e){this.update()}onUpdateRequest(t){e.Plotly&&this.isVisible&&this.hasGraphElement()&&e.Plotly.redraw(this.node).then(()=>{e.Plotly.Plots.resize(this.node)})}static{this.Plotly=null}static{this.loadingPlotly=new Promise(t=>{e._resolveLoadingPlotly=t})}},tJ={safe:!0,mimeTypes:[tX],createRenderer:e=>new tK(e)},tQ=[{id:"@jupyterlab/plotly-extension:factory",rendererFactory:tJ,rank:2,dataType:"json",fileTypes:[{name:"plotly",mimeTypes:[tX],extensions:[".plotly",".plotly.json"],iconClass:"jp-MaterialIcon jp-PlotlyIcon"}],documentWidgetFactoryOptions:{name:"Plotly",primaryFileType:"plotly",fileTypes:["plotly","json"],defaultFor:["plotly"]}}];r.d(t,{MIME_TYPE:()=>tX,RenderedPlotly:()=>tK,default:()=>tQ,rendererFactory:()=>tJ})},3(e){var t,r,i,n=e.exports={};function a(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:a}catch(e){t=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===a||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var l=[],u=!1,c=-1;function h(){u&&i&&(u=!1,i.length?l=i.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=s(h);u=!0;for(var t=l.length;t;){for(i=l,l=[];++c1)for(var r=1;r()=>{try{return r||t((r={exports:{}}).exports,r),r.exports}catch(t){throw r=0,t}},O=(t,r,i)=>(i=null!=t?D(P(t)):{},((t,r,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let n of L(r))z.call(t,n)||void 0===n||C(t,n,{get:()=>r[n],enumerable:!(i=I(r,n))||i.enumerable});return t})(!r&&t&&t.__esModule?i:C(i,"default",{value:t,enumerable:!0}),t)),R=F((t,r)=>{var i,n;i=t,n=function(t){var r;function i(t,r){let i=0;for(let n of t)if(!1===r(n,i++))return!1;return!0}t.ArrayExt=void 0,function(t){function r(t,i,n=0,a=-1){let o,s=t.length;if(0===s)return -1;n=n<0?Math.max(0,n+s):Math.min(n,s-1),o=(a=a<0?Math.max(0,a+s):Math.min(a,s-1))=i)return;let n=t[r];for(let n=r+1;n0;){let n=l>>1,a=s+n;0>i(t[a],r)?(s=a+1,l-=n+1):l=n}return s},t.upperBound=function(t,r,i,n=0,a=-1){let o=t.length;if(0===o)return 0;n=n<0?Math.max(0,n+o):Math.min(n,o-1),a=a<0?Math.max(0,a+o):Math.min(a,o-1);let s=n,l=a-n+1;for(;l>0;){let n=l>>1,a=s+n;i(t[a],r)>0?l=n:(s=a+1,l-=n+1)}return s},t.shallowEqual=function(t,r,i){if(t===r)return!0;if(t.length!==r.length)return!1;for(let n=0,a=t.length;n=s&&(n=o<0?s-1:s),void 0===a?a=o<0?-1:s:a<0?a=Math.max(a+s,o<0?-1:0):a>=s&&(a=o<0?s-1:s),i=o<0&&a>=n||o>0&&n>=a?0:o<0?Math.floor((a-n+1)/o+1):Math.floor((a-n-1)/o+1);let l=[];for(let r=0;r=(n=n<0?Math.max(0,n+a):Math.min(n,a-1)))return;let s=n-i+1;if(r>0?r%=s:r<0&&(r=(r%s+s)%s),0===r)return;let l=i+r;o(t,i,l-1),o(t,l,n),o(t,i,n)},t.fill=function(t,r,i=0,n=-1){let a,o=t.length;if(0!==o){i=i<0?Math.max(0,i+o):Math.min(i,o-1),a=(n=n<0?Math.max(0,n+o):Math.min(n,o-1))r;--i)t[i]=t[i-1];t[r]=i},t.removeAt=s,t.removeFirstOf=function(t,i,n=0,a=-1){let o=r(t,i,n,a);return -1!==o&&s(t,o),o},t.removeLastOf=function(t,r,n=-1,a=0){let o=i(t,r,n,a);return -1!==o&&s(t,o),o},t.removeAllOf=function(t,r,i=0,n=-1){let a=t.length;if(0===a)return 0;i=i<0?Math.max(0,i+a):Math.min(i,a-1),n=n<0?Math.max(0,n+a):Math.min(n,a-1);let o=0;for(let s=0;s=i&&s<=n&&t[s]===r||n=i)&&t[s]===r?o++:o>0&&(t[s-o]=t[s]);return o>0&&(t.length=a-o),o},t.removeFirstWhere=function(t,r,i=0,a=-1){let o,l=n(t,r,i,a);return -1!==l&&(o=s(t,l)),{index:l,value:o}},t.removeLastWhere=function(t,r,i=-1,n=0){let o,l=a(t,r,i,n);return -1!==l&&(o=s(t,l)),{index:l,value:o}},t.removeAllWhere=function(t,r,i=0,n=-1){let a=t.length;if(0===a)return 0;i=i<0?Math.max(0,i+a):Math.min(i,a-1),n=n<0?Math.max(0,n+a):Math.min(n,a-1);let o=0;for(let s=0;s=i&&s<=n&&r(t[s],s)||n=i)&&r(t[s],s)?o++:o>0&&(t[s-o]=t[s]);return o>0&&(t.length=a-o),o}}(t.ArrayExt||(t.ArrayExt={})),(r||(r={})).rangeLength=function(t,r,i){return 0===i?1/0:t>r&&i>0||tr)}}(t.StringExt||(t.StringExt={})),t.chain=function*(...t){for(let r of t)yield*r},t.each=function(t,r){let i=0;for(let n of t)if(!1===r(n,i++))return},t.empty=function*(){},t.enumerate=function*(t,r=0){for(let i of t)yield[r++,i]},t.every=i,t.filter=function*(t,r){let i=0;for(let n of t)r(n,i++)&&(yield n)},t.find=function(t,r){let i=0;for(let n of t)if(r(n,i++))return n},t.findIndex=function(t,r){let i=0;for(let n of t)if(r(n,i++))return i-1;return -1},t.map=function*(t,r){let i=0;for(let n of t)yield r(n,i++)},t.max=function(t,r){let i;for(let n of t){if(void 0===i){i=n;continue}r(n,i)>0&&(i=n)}return i},t.min=function(t,r){let i;for(let n of t){if(void 0===i){i=n;continue}0>r(n,i)&&(i=n)}return i},t.minmax=function(t,r){let i=!0,n,a;for(let o of t)i?(n=o,a=o,i=!1):0>r(o,n)?n=o:r(o,a)>0&&(a=o);return i?void 0:[n,a]},t.once=function*(t){yield t},t.range=function*(t,i,n){void 0===i?(i=t,t=0,n=1):void 0===n&&(n=1);let a=r.rangeLength(t,i,n);for(let r=0;r-1;r--)yield t[r]},t.some=function(t,r){let i=0;for(let n of t)if(r(n,i++))return!0;return!1},t.stride=function*(t,r){let i=0;for(let n of t)i++%r==0&&(yield n)},t.take=function*(t,r){if(r<1)return;let i=t[Symbol.iterator](),n;for(;0t[Symbol.iterator]()),n=r.map(t=>t.next());for(;i(n,t=>!t.done);n=r.map(t=>t.next()))yield n.map(t=>t.value)}},"object"==typeof t&&"u">typeof r?n(t):"function"==typeof define&&define.amd?define(["exports"],n):n((i="u">typeof globalThis?globalThis:i||self).lumino_algorithm={})}),B=F((t,r)=>{var i,n;i=t,n=function(t,r){let i;t.JSONExt=void 0,function(t){function r(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function i(t){return Array.isArray(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=r,t.isArray=i;t.isObject=function(t){return!r(t)&&!i(t)},t.deepEqual=function t(n,a){if(n===a)return!0;if(r(n)||r(a))return!1;let o=i(n),s=i(a);return o===s&&(o&&s?function(r,i){if(r===i)return!0;if(r.length!==i.length)return!1;for(let n=0,a=r.length;n{if(n===t.provides)return!0;let s=i.get(n);if(!s)return!1;let l=r.get(s),u=[...l.requires,...l.optional];return 0!==u.length&&(o.push(s),!!u.some(a)||(o.pop(),!1))};if(!t.provides||0===n.length)return;let o=[t.id];if(n.some(a))throw ReferenceError(`Cycle detected: ${o.join(" -> ")}.`)},a.findDependents=function(t,i,n){let a=[],o=t=>{let r=i.get(t),o=[...r.requires,...r.optional];a.push(...o.reduce((r,i)=>{let a=n.get(i);return a&&r.push([t,a]),r},[]))};for(let t of i.keys())o(t);let s=a.filter(r=>r[1]===t),l=0;for(;s.length>l;){let t=s.length;for(let t of new Set(s.map(t=>t[0])))a.filter(r=>r[1]===t).forEach(t=>{s.includes(t)||s.push(t)});l=t}let u=r.topologicSort(s),c=u.findIndex(r=>r===t);return -1===c?[t]:u.slice(0,c+1)},a.collectStartupPlugins=function(t,r){let i=new Set;for(let r of t.keys())!0===t.get(r).autoStart&&i.add(r);if(r.startPlugins)for(let t of r.startPlugins)i.add(t);if(r.ignorePlugins)for(let t of r.ignorePlugins)i.delete(t);return Array.from(i)};t.Random=void 0,(t.Random||(t.Random={})).getRandomValues=(i="u">typeof window&&(window.crypto||window.msCrypto)||null)&&"function"==typeof i.getRandomValues?function(t){return i.getRandomValues(t)}:function(t){let r=0;for(let i=0,n=t.length;i>>0),t[i]=255&r,r>>>=8},t.UUID=void 0,(t.UUID||(t.UUID={})).uuid4=function(t){let r=new Uint8Array(16),i=Array(256);for(let t=0;t<16;++t)i[t]="0"+t.toString(16);for(let t=16;t<256;++t)i[t]=t.toString(16);return function(){return t(r),r[6]=64|15&r[6],r[8]=128|63&r[8],i[r[0]]+i[r[1]]+i[r[2]]+i[r[3]]+"-"+i[r[4]]+i[r[5]]+"-"+i[r[6]]+i[r[7]]+"-"+i[r[8]]+i[r[9]]+"-"+i[r[10]]+i[r[11]]+i[r[12]]+i[r[13]]+i[r[14]]+i[r[15]]}}(t.Random.getRandomValues),t.MimeData=class{constructor(){this._types=[],this._values=[]}types(){return this._types.slice()}hasData(t){return -1!==this._types.indexOf(t)}getData(t){let r=this._types.indexOf(t);return -1!==r?this._values[r]:void 0}setData(t,r){this.clearData(t),this._types.push(t),this._values.push(r)}clearData(t){let r=this._types.indexOf(t);-1!==r&&(this._types.splice(r,1),this._values.splice(r,1))}clear(){this._types.length=0,this._values.length=0}},t.PluginRegistry=class{constructor(t={}){this._application=null,this._validatePlugin=()=>!0,this._plugins=new Map,this._services=new Map,t.validatePlugin&&(console.info("Plugins may be rejected by the custom validation plugin method."),this._validatePlugin=t.validatePlugin)}get application(){return this._application}set application(t){if(null!==this._application)throw Error("PluginRegistry.application is already set. It cannot be overridden.");this._application=t}get deferredPlugins(){return Array.from(this._plugins).filter(([t,r])=>"defer"===r.autoStart).map(([t,r])=>t)}getPluginDescription(t){var r,i;return null!=(i=null==(r=this._plugins.get(t))?void 0:r.description)?i:""}hasPlugin(t){return this._plugins.has(t)}isPluginActivated(t){var r,i;return null!=(i=null==(r=this._plugins.get(t))?void 0:r.activated)&&i}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(t){if(this._plugins.has(t.id))throw TypeError(`Plugin '${t.id}' is already registered.`);if(!this._validatePlugin(t))throw Error(`Plugin '${t.id}' is not valid.`);let r=n.createPluginData(t);n.ensureNoCycle(r,this._plugins,this._services),r.provides&&this._services.set(r.provides,r.id),this._plugins.set(r.id,r)}registerPlugins(t){for(let r of t)this.registerPlugin(r)}deregisterPlugin(t,r){let i=this._plugins.get(t);if(i){if(i.activated&&!r)throw Error(`Plugin '${t}' is still active.`);this._plugins.delete(t)}}async activatePlugin(t){let r=this._plugins.get(t);if(!r)throw ReferenceError(`Plugin '${t}' is not registered.`);if(r.activated)return;if(r.promise)return r.promise;let i=r.requires.map(t=>this.resolveRequiredService(t)),n=r.optional.map(t=>this.resolveOptionalService(t));return r.promise=Promise.all([...i,...n]).then(t=>r.activate.apply(void 0,[this.application,...t])).then(t=>{r.service=t,r.activated=!0,r.promise=null}).catch(t=>{throw r.promise=null,t}),r.promise}async activatePlugins(t,r={}){switch(t){case"defer":{let t=this.deferredPlugins.filter(t=>this._plugins.get(t).autoStart).map(t=>this.activatePlugin(t));await Promise.all(t);break}case"startUp":{let t=n.collectStartupPlugins(this._plugins,r).map(async t=>{try{return await this.activatePlugin(t)}catch(r){console.error(`Plugin '${t}' failed to activate.`,r)}});await Promise.all(t)}}}async deactivatePlugin(t){let r=this._plugins.get(t);if(!r)throw ReferenceError(`Plugin '${t}' is not registered.`);if(!r.activated)return[];if(!r.deactivate)throw TypeError(`Plugin '${t}'#deactivate() method missing`);let i=n.findDependents(t,this._plugins,this._services),a=i.map(t=>this._plugins.get(t));for(let r of a)if(!r.deactivate)throw TypeError(`Plugin ${r.id}#deactivate() method missing (depends on ${t})`);for(let t of a){let r=[...t.requires,...t.optional].map(t=>{let r=this._services.get(t);return r?this._plugins.get(r).service:null});await t.deactivate(this.application,...r),t.service=null,t.activated=!1}return i.pop(),i}async resolveRequiredService(t){let r=this._services.get(t);if(!r)throw TypeError(`No provider for: ${t.name}.`);let i=this._plugins.get(r);return i.activated||await this.activatePlugin(r),i.service}async resolveOptionalService(t){let r=this._services.get(t);if(!r)return null;let i=this._plugins.get(r);if(!i.activated)try{await this.activatePlugin(r)}catch(t){return console.error(t),null}return i.service}},t.PromiseDelegate=class{constructor(){this.promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}resolve(t){(0,this._resolve)(t)}reject(t){(0,this._reject)(t)}},t.Token=class{constructor(t,r){this.name=t,this.description=r??"",this._tokenStructuralPropertyT=null}}},"object"==typeof t&&"u">typeof r?n(t,R()):"function"==typeof define&&define.amd?define(["exports","@lumino/algorithm"],n):n((i="u">typeof globalThis?globalThis:i||self).lumino_coreutils={},i.lumino_algorithm)}),j=F((t,r)=>{var i,n;i="u">typeof self?self:t,n=()=>{var t=(()=>{var t=Object.create,r=Object.defineProperty,i=Object.defineProperties,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,h=(t,r)=>(r=Symbol[t])?r:Symbol.for("Symbol."+t),d=(t,i,n)=>i in t?r(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n,f=(t,r)=>{for(var i in r||(r={}))u.call(r,i)&&d(t,i,r[i]);if(s)for(var i of s(r))c.call(r,i)&&d(t,i,r[i]);return t},p=(t,r)=>i(t,a(r)),m=(t,r,i)=>function(){if(i)throw i[0];try{return t&&(r=(0,t[o(t)[0]])(t=0)),r}catch(t){throw i=[t],t}},g=(t,r)=>function(){try{return r||(0,t[o(t)[0]])((r={exports:{}}).exports,r),r.exports}catch(t){throw r=0,t}},y=(t,i)=>{for(var n in i)r(t,n,{get:i[n],enumerable:!0})},v=(t,i,a,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of o(i))u.call(t,l)||l===a||r(t,l,{get:()=>i[l],enumerable:!(s=n(i,l))||s.enumerable});return t},x=(i,n,a)=>(a=null!=i?t(l(i)):{},v(!n&&i&&i.__esModule?a:r(a,"default",{value:i,enumerable:!0}),i)),b=t=>v(r({},"__esModule",{value:!0}),t),_=(t,r,i)=>new Promise((n,a)=>{var o=t=>{try{l(i.next(t))}catch(t){a(t)}},s=t=>{try{l(i.throw(t))}catch(t){a(t)}},l=t=>t.done?n(t.value):Promise.resolve(t.value).then(o,s);l((i=i.apply(t,r)).next())}),w=function(t,r){this[0]=t,this[1]=r},T=t=>{var r,i=t[h("asyncIterator")],n=!1,a={};return null==i?(i=t[h("iterator")](),r=t=>a[t]=r=>i[t](r)):(i=i.call(t),r=t=>a[t]=r=>{if(n){if(n=!1,"throw"===t)throw r;return r}return n=!0,{done:!1,value:new w(new Promise(n=>{var a=i[t](r);a instanceof Object||(t=>{throw TypeError(t)})("Object expected"),n(a)}),1)}}),a[h("iterator")]=()=>a,r("next"),"throw"in i?r("throw"):a.throw=t=>{throw t},"return"in i&&r("return"),a},A=g({"src/version.js"(t){t.version="4.1.1"}}),M=g({"node_modules/native-promise-only/lib/npo.src.js"(t,r){var i,n;i="Promise",n="u">typeof window?window:t,n[i]=n[i]||function(){var t,r,i,n=Object.prototype.toString,a="u">typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,r,i,n){return Object.defineProperty(t,r,{value:i,writable:!0,configurable:!1!==n})}}catch{t=function(t,r,i){return t[r]=i,t}}function o(t,n){i.add(t,n),r||(r=a(i.drain))}function s(t){var r,i=typeof t;return null!=t&&("object"==i||"function"==i)&&(r=t.then),"function"==typeof r&&r}function l(){for(var t=0;t0&&o(l,i))}catch(t){c.call(new d(i),t)}}}function c(t){var r=this;r.triggered||(r.triggered=!0,r.def&&(r=r.def),r.msg=t,r.state=2,r.chain.length>0&&o(l,r))}function h(t,r,i,n){for(var a=0;atypeof r&&r.exports&&(r.exports=n[i])}}),k=g({"node_modules/@plotly/d3/d3.js"(t,r){(function(){var t={version:"3.8.2"},i=[].slice,n=function(t){return i.call(t)},a=self.document;function o(t){return t&&(t.ownerDocument||t.document||t).documentElement}function s(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch{n=function(t){for(var r=t.length,i=Array(r);r--;)i[r]=t[r];return i}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch{var l=this.Element.prototype,u=l.setAttribute,c=l.setAttributeNS,h=this.CSSStyleDeclaration.prototype,d=h.setProperty;l.setAttribute=function(t,r){u.call(this,t,r+"")},l.setAttributeNS=function(t,r,i){c.call(this,t,r,i+"")},h.setProperty=function(t,r,i){d.call(this,t,r+"",i)}}function f(t,r){return tr?1:t>=r?0:NaN}function p(t){return null===t?NaN:+t}function m(t){return!isNaN(t)}function g(t){return{left:function(r,i,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=r.length);n>>1;0>t(r[o],i)?n=o+1:a=o}return n},right:function(r,i,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=r.length);n>>1;t(r[o],i)>0?a=o:n=o+1}return n}}}t.ascending=f,t.descending=function(t,r){return rt?1:r>=t?0:NaN},t.min=function(t,r){var i,n,a=-1,o=t.length;if(1==arguments.length){for(;++a=n){i=n;break}for(;++an&&(i=n)}else{for(;++a=n){i=n;break}for(;++an&&(i=n)}return i},t.max=function(t,r){var i,n,a=-1,o=t.length;if(1==arguments.length){for(;++a=n){i=n;break}for(;++ai&&(i=n)}else{for(;++a=n){i=n;break}for(;++ai&&(i=n)}return i},t.extent=function(t,r){var i,n,a,o=-1,s=t.length;if(1==arguments.length){for(;++o=n){i=a=n;break}for(;++on&&(i=n),a=n){i=a=n;break}for(;++on&&(i=n),a1)return s/(u-1)},t.deviation=function(){var r=t.variance.apply(this,arguments);return r&&Math.sqrt(r)};var y=g(f);function v(t){return t.length}t.bisectLeft=y.left,t.bisect=t.bisectRight=y.right,t.bisector=function(t){return g(1===t.length?function(r,i){return f(t(r),i)}:t)},t.shuffle=function(t,r,i){(o=arguments.length)<3&&(i=t.length,o<2&&(r=0));for(var n,a,o=i-r;o;)a=Math.random()*o--|0,n=t[o+r],t[o+r]=t[a+r],t[a+r]=n;return t},t.permute=function(t,r){for(var i=r.length,n=Array(i);i--;)n[i]=t[r[i]];return n},t.pairs=function(t){for(var r=0,i=t.length-1,n=t[0],a=Array(i<0?0:i);r=0;)for(r=(n=t[a]).length;--r>=0;)i[--s]=n[r];return i};var x=Math.abs;function b(t,r){for(var i in r)Object.defineProperty(t.prototype,i,{value:r[i],enumerable:!1})}function _(){this._=Object.create(null)}function w(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function T(t){return"\0"===(t+="")[0]?t.slice(1):t}function A(t){return w(t)in this._}function M(t){return(t=w(t))in this._&&delete this._[t]}function k(){var t=[];for(var r in this._)t.push(T(r));return t}function S(){var t=0;for(var r in this._)++t;return t}function E(){for(var t in this._)return!1;return!0}function D(){this._=Object.create(null)}function C(t){return t}function I(t,r){if(r in t)return r;r=r.charAt(0).toUpperCase()+r.slice(1);for(var i=0,n=L.length;ir;)a.push(n/o);else for(;(n=t+i*++s)=a.length)return i?i.call(n,o):r?o.sort(r):o;for(var u,c,h,d,f=-1,p=o.length,m=a[l++],g=new _;++f=a.length)return r;var n=[],s=o[i++];return r.forEach(function(r,a){n.push({key:r,values:t(a,i)})}),s?n.sort(function(t,r){return s(t.key,r.key)}):n}(s(t.map,r,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return o[a.length-1]=t,n},n.sortValues=function(t){return r=t,n},n.rollup=function(t){return i=t,n},n},t.set=function(t){var r=new D;if(t)for(var i=0,n=t.length;i=0&&(n=t.slice(i+1),t=t.slice(0,i)),t)return arguments.length<2?this[t].on(n):this[t].on(n,r);if(2==arguments.length){if(null==r)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,N={}.__proto__?function(t,r){t.__proto__=r}:function(t,r){for(var i in r)t[i]=r[i]};function V(t){return N(t,H),t}var U=function(t,r){return r.querySelector(t)},q=function(t,r){return r.querySelectorAll(t)},G=function(t,r){var i=t.matches||t[I(t,"matchesSelector")];return(G=function(t,r){return i.call(t,r)})(t,r)};"function"==typeof Sizzle&&(U=function(t,r){return Sizzle(t,r)[0]||null},q=Sizzle,G=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var H=t.selection.prototype=[];function $(t){return"function"==typeof t?t:function(){return U(t,this)}}function W(t){return"function"==typeof t?t:function(){return q(t,this)}}H.select=function(t){var r,i,n,a,o=[];t=$(t);for(var s=-1,l=this.length;++s=0&&"xmlns"!==(i=t.slice(0,r))&&(t=t.slice(r+1)),Z.hasOwnProperty(i)?{space:Z[i],local:t}:t}},H.attr=function(r,i){if(arguments.length<2){if("string"==typeof r){var n=this.node();return(r=t.ns.qualify(r)).local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}for(i in r)this.each(X(i,r[i]));return this}return this.each(X(r,i))},H.classed=function(t,r){if(arguments.length<2){if("string"==typeof t){var i=this.node(),n=(t=Q(t)).length,a=-1;if(r=i.classList){for(;++a=0;)(i=n[a])&&(o&&o!==i.nextSibling&&o.parentNode.insertBefore(i,o),o=i);return this},H.sort=function(t){t=el.apply(this,arguments);for(var r=-1,i=this.length;++r0&&(r=r.slice(0,s));var u=ef.get(r);function c(){var t=this[o];t&&(this.removeEventListener(r,t,t.$),delete this[o])}return u&&(r=u,l=em),s?i?function(){var t=l(i,n(arguments));c.call(this),this.addEventListener(r,this[o]=t,t.$=a),t._=i}:c:i?P:function(){var i,n=RegExp("^__on([^.]+)"+t.requote(r)+"$");for(var a in this)if(i=a.match(n)){var o=this[a];this.removeEventListener(i[1],o,o.$),delete this[a]}}}t.selection.enter=ec,t.selection.enter.prototype=eh,eh.append=H.append,eh.empty=H.empty,eh.node=H.node,eh.call=H.call,eh.size=H.size,eh.select=function(t){for(var r,i,n,a,o,s=[],l=-1,u=this.length;++l=n&&(n=r+1);!(s=l[n])&&++n1?ek:t<-1?-ek:Math.asin(t)}function eC(t){return((t=Math.exp(t))+1/t)/2}var eI=Math.SQRT2;t.interpolateZoom=function(t,r){var i,n,a=t[0],o=t[1],s=t[2],l=r[0],u=r[1],c=r[2],h=l-a,d=u-o,f=h*h+d*d;if(f0&&(r=r.transition().duration(g)),r.call(T.event)}function E(){c&&c.domain(u.range().map(function(t){return(t-f.x)/f.k}).map(u.invert)),d&&d.domain(h.range().map(function(t){return(t-f.y)/f.k}).map(h.invert))}function D(t){y++||t({type:"zoomstart"})}function C(t){E(),t({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function I(t){--y||(t({type:"zoomend"}),i=null)}function L(){var r=this,i=w.of(r,arguments),n=0,a=t.select(s(r)).on(x,function(){n=1,k(t.mouse(r),o),C(i)}).on(b,function(){a.on(x,null).on(b,null),l(n),I(i)}),o=A(t.mouse(r)),l=ev(r);iW.call(r),D(i)}function P(){var r,i=this,n=w.of(i,arguments),a={},o=0,s=".zoom-"+t.event.changedTouches[0].identifier,u="touchmove"+s,c="touchend"+s,h=[],d=t.select(i),p=ev(i);function m(){var n=t.touches(i);return r=f.k,n.forEach(function(t){t.identifier in a&&(a[t.identifier]=A(t))}),n}function g(){var r=t.event.target;t.select(r).on(u,y).on(c,x),h.push(r);for(var n=t.event.changedTouches,s=0,d=n.length;s1){var v=p[0],b=p[1],_=v[0]-b[0],w=v[1]-b[1];o=_*_+w*w}}function y(){var s,u,c,h,d=t.touches(i);iW.call(i);for(var f=0,p=d.length;f360?r-=360:r<0&&(r+=360),r<60?n+(a-n)*r/60:r<180?a:r<240?n+(a-n)*(240-r)/60:n))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,r=isNaN(r)||r<0?0:r>1?1:r,a=(i=i<0?0:i>1?1:i)<=.5?i*(1+r):i+r-i*r,n=2*i-a,new eX(o(t+120),o(t),o(t-120))}function ej(r,i,n){return this instanceof ej?(this.h=+r,this.c=+i,void(this.l=+n)):arguments.length<2?r instanceof ej?new ej(r.h,r.c,r.l):r instanceof eU?e$(r.l,r.a,r.b):e$((r=e3((r=t.rgb(r)).r,r.g,r.b)).l,r.a,r.b):new ej(r,i,n)}eR.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new eO(this.h,this.s,this.l/t)},eR.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new eO(this.h,this.s,t*this.l)},eR.rgb=function(){return eB(this.h,this.s,this.l)},t.hcl=ej;var eN=ej.prototype=new eF;function eV(t,r,i){return isNaN(t)&&(t=0),isNaN(r)&&(r=0),new eU(i,Math.cos(t*=eS)*r,Math.sin(t)*r)}function eU(t,r,i){return this instanceof eU?(this.l=+t,this.a=+r,void(this.b=+i)):arguments.length<2?t instanceof eU?new eU(t.l,t.a,t.b):t instanceof ej?eV(t.h,t.c,t.l):e3((t=eX(t)).r,t.g,t.b):new eU(t,r,i)}eN.brighter=function(t){return new ej(this.h,this.c,Math.min(100,this.l+eq*(arguments.length?t:1)))},eN.darker=function(t){return new ej(this.h,this.c,Math.max(0,this.l-eq*(arguments.length?t:1)))},eN.rgb=function(){return eV(this.h,this.c,this.l).rgb()},t.lab=eU;var eq=18,eG=eU.prototype=new eF;function eH(t,r,i){var n=(t+16)/116,a=n+r/500,o=n-i/200;return a=.95047*eW(a),new eX(eZ(3.2404542*a-1.5371385*(n=+eW(n))-.4985314*(o=1.08883*eW(o))),eZ(-.969266*a+1.8760108*n+.041556*o),eZ(.0556434*a-.2040259*n+1.0572252*o))}function e$(t,r,i){return t>0?new ej(Math.atan2(i,r)*eE,Math.sqrt(r*r+i*i),t):new ej(NaN,NaN,t)}function eW(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function eY(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function eZ(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function eX(t,r,i){return this instanceof eX?(this.r=~~t,this.g=~~r,void(this.b=~~i)):arguments.length<2?t instanceof eX?new eX(t.r,t.g,t.b):e1(""+t,eX,eB):new eX(t,r,i)}function eK(t){return new eX(t>>16,t>>8&255,255&t)}function eJ(t){return eK(t)+""}eG.brighter=function(t){return new eU(Math.min(100,this.l+eq*(arguments.length?t:1)),this.a,this.b)},eG.darker=function(t){return new eU(Math.max(0,this.l-eq*(arguments.length?t:1)),this.a,this.b)},eG.rgb=function(){return eH(this.l,this.a,this.b)},t.rgb=eX;var eQ=eX.prototype=new eF;function e0(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function e1(t,r,i){var n,a,o,s=0,l=0,u=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return i(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return r(e4(a[0]),e4(a[1]),e4(a[2]))}return(o=e6.get(t))?r(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(s=(s=(3840&o)>>4)>>4|s,l=(l=240&o)>>4|l,u=(u=15&o)<<4|u):7===t.length&&(s=(0xff0000&o)>>16,l=(65280&o)>>8,u=255&o)),r(s,l,u))}function e2(t,r,i){var n,a,o=Math.min(t/=255,r/=255,i/=255),s=Math.max(t,r,i),l=s-o,u=(s+o)/2;return l?(a=u<.5?l/(s+o):l/(2-s-o),n=(t==s?(r-i)/l+6*(r0&&u<1?0:n),new eO(n,a,u)}function e3(t,r,i){t=e5(t);var n=eY((.4124564*t+.3575761*(r=e5(r))+.1804375*(i=e5(i)))/.95047),a=eY((.2126729*t+.7151522*r+.072175*i)/1);return eU(116*a-16,500*(n-a),200*(a-eY((.0193339*t+.119192*r+.9503041*i)/1.08883)))}function e5(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function e4(t){var r=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*r):r}eQ.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var r=this.r,i=this.g,n=this.b;return r||i||n?(r&&r<30&&(r=30),i&&i<30&&(i=30),n&&n<30&&(n=30),new eX(Math.min(255,r/t),Math.min(255,i/t),Math.min(255,n/t))):new eX(30,30,30)},eQ.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new eX(t*this.r,t*this.g,t*this.b)},eQ.hsl=function(){return e2(this.r,this.g,this.b)},eQ.toString=function(){return"#"+e0(this.r)+e0(this.g)+e0(this.b)};var e6=t.map({aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32});function e8(t){return"function"==typeof t?t:function(){return t}}function e7(t){return function(r,i,n){return 2==arguments.length&&"function"==typeof i&&(n=i,i=null),e9(r,i,t,n)}}function e9(r,i,a,o){var s,l={},u=t.dispatch("beforesend","progress","load","error"),c={},h=new XMLHttpRequest,d=null;function f(){var t,r,i,n=h.status;if(!n&&((r=(t=h).responseType)&&"text"!==r?t.response:t.responseText)||n>=200&&n<300||304===n){try{i=a.call(l,h)}catch(t){u.error.call(l,t);return}u.load.call(l,i)}else u.error.call(l,h)}return self.XDomainRequest&&!("withCredentials"in h)&&/^(http(s)?:)?\/\//.test(r)&&(h=new XDomainRequest),"onload"in h?h.onload=h.onerror=f:h.onreadystatechange=function(){h.readyState>3&&f()},h.onprogress=function(r){var i=t.event;t.event=r;try{u.progress.call(l,h)}finally{t.event=i}},l.header=function(t,r){return t=(t+"").toLowerCase(),arguments.length<2?c[t]:(null==r?delete c[t]:c[t]=r+"",l)},l.mimeType=function(t){return arguments.length?(i=null==t?null:t+"",l):i},l.responseType=function(t){return arguments.length?(d=t,l):d},l.response=function(t){return a=t,l},["get","post"].forEach(function(t){l[t]=function(){return l.send.apply(l,[t].concat(n(arguments)))}}),l.send=function(t,n,a){if(2==arguments.length&&"function"==typeof n&&(a=n,n=null),h.open(t,r,!0),null==i||"accept"in c||(c.accept=i+",*/*"),h.setRequestHeader)for(var o in c)h.setRequestHeader(o,c[o]);return null!=i&&h.overrideMimeType&&h.overrideMimeType(i),null!=d&&(h.responseType=d),null!=a&&l.on("error",a).on("load",function(t){a(null,t)}),u.beforesend.call(l,h),h.send(n??null),l},l.abort=function(){return h.abort(),l},t.rebind(l,u,"on"),null==o?l:l.get(1===(s=o).length?function(t,r){s(null==t?r:null)}:s)}e6.forEach(function(t,r){e6.set(t,eK(r))}),t.functor=e8,t.xhr=e7(C),t.dsv=function(t,r){var i=RegExp('["'+t+` -]`),n=t.charCodeAt(0);function a(t,i,n){arguments.length<3&&(n=i,i=null);var a=e9(t,r,null==i?o:s(i),n);return a.row=function(t){return arguments.length?a.response(null==(i=t)?o:s(t)):i},a}function o(t){return a.parse(t.responseText)}function s(t){return function(r){return a.parse(r.responseText,t)}}function l(r){return r.map(u).join(t)}function u(t){return i.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,r){var i;return a.parseRows(t,function(t,n){if(i)return i(t,n-1);var a=function(r){for(var i={},n=t.length,a=0;a=u)return s;if(a)return a=!1,o;var r=c;if(34===t.charCodeAt(r)){for(var i=r;i++24?(isFinite(r)&&(clearTimeout(ti),ti=setTimeout(to,r)),tr=0):(tr=1,tn(to))}function ts(){for(var t=Date.now(),r=te;r;)t>=r.t&&r.c(t-r.t)&&(r.c=null),r=r.n;return t}function tl(){for(var t,r=te,i=1/0;r;)r.c?(r.t1&&0>=(r=t[o[s-2]],i=t[o[s-1]],n=t[l],(i[0]-r[0])*(n[1]-r[1])-(i[1]-r[1])*(n[0]-r[0]));)--s;o[s++]=l}return o.slice(0,s)}function td(t,r){return t[0]-r[0]||t[1]-r[1]}t.timer=function(){ta.apply(this,arguments)},t.timer.flush=function(){ts(),tl()},t.round=function(t,r){return r?Math.round(t*(r=Math.pow(10,r)))/r:Math.round(t)},t.geom={},t.geom.hull=function(t){var r=tu,i=tc;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,a=e8(r),o=e8(i),s=t.length,l=[],u=[];for(n=0;n=0;--n)p.push(t[l[c[n]][2]]);for(n=+d;n=-ew)){var p=u*u+c*c,m=h*h+d*d,g=(d*p-c*m)/f,y=(u*m-h*p)/f,d=y+l,v=tT.pop()||new tC;v.arc=t,v.site=a,v.x=g+s,v.y=d+Math.sqrt(g*g+y*y),v.cy=d,t.circle=v;for(var x=null,b=t_._;b;)if(v.y1e-6)l=l.L;else if((a=o-function(t,r){var i=t.N;if(i)return tS(i,r);var n=t.site;return n.y===r?n.x:1/0}(l,s))>1e-6){if(!l.R){r=l;break}l=l.R}else{n>-1e-6?(r=l.P,i=l):a>-1e-6?(r=l,i=l.N):r=i=l;break}var u=tM(t);if(tx.insert(r,u),!(!r&&!i)){if(r===i){tL(r),i=tM(r.site),tx.insert(u,i),u.edge=i.edge=tz(r.site,u.site),tI(r),tI(i);return}if(!i){u.edge=tz(r.site,u.site);return}tL(r),tL(i);var c=r.site,h=c.x,d=c.y,f=t.x-h,p=t.y-d,m=i.site,g=m.x-h,y=m.y-d,v=2*(f*y-p*g),x=f*f+p*p,b=g*g+y*y,_={x:(y*x-p*b)/v+h,y:(f*b-g*x)/v+d};tF(i.edge,c,m,_),u.edge=tz(c,t,null,_),i.edge=tz(t,m,null,_),tI(r),tI(i)}}(o),i=o.x,n=o.y),o=t.pop();else if(a)!function(t){var r=t.circle,i=r.x,n=r.cy,a={x:i,y:n},o=t.P,s=t.N,l=[t];tk(t);for(var u=o;u.circle&&1e-6>x(i-u.circle.x)&&1e-6>x(n-u.circle.cy);)o=u.P,l.unshift(u),tk(u),u=o;l.unshift(u),tL(u);for(var c=s;c.circle&&1e-6>x(i-c.circle.x)&&1e-6>x(n-c.circle.cy);)s=c.N,l.push(c),tk(c),c=s;l.push(c),tL(c);var h,d=l.length;for(h=1;h0)){if(o/=m,m<0){if(o0){if(o>p)return;o>f&&(f=o)}if(o=n-u,!(!m&&o<0)){if(o/=m,m<0){if(o>p)return;o>f&&(f=o)}else if(m>0){if(o0)){if(o/=g,g<0){if(o0){if(o>p)return;o>f&&(f=o)}if(o=a-c,!(!g&&o<0)){if(o/=g,g<0){if(o>p)return;o>f&&(f=o)}else if(g>0){if(o0&&(t.a={x:u+f*m,y:c+f*g}),p<1&&(t.b={x:u+p*m,y:c+p*g}),t}}}}}),u=s.length;u--;)(!function(t,r){var i=t.b;if(i)return!0;var n,a,o=t.a,s=r[0][0],l=r[1][0],u=r[0][1],c=r[1][1],h=t.l,d=t.r,f=h.x,p=h.y,m=d.x,g=d.y,y=(f+m)/2;if(g===p){if(y=l)return;if(f>m){if(o){if(o.y>=c)return}else o={x:y,y:u};i={x:y,y:c}}else{if(o){if(o.y1)if(f>m){if(o){if(o.y>=c)return}else o={x:(u-a)/n,y:u};i={x:(c-a)/n,y:c}}else{if(o){if(o.y=l)return}else o={x:s,y:n*s+a};i={x:l,y:n*l+a}}else{if(o){if(o.xx(o.a.x-o.b.x)&&1e-6>x(o.a.y-o.b.y))&&(o.a=o.b=null,s.splice(u,1))}(r),function(t){for(var r,i,n,a,o,s,l,u,c,h,d=t[0][0],f=t[1][0],p=t[0][1],m=t[1][1],g=tv,y=g.length;y--;)if(!(!(o=g[y])||!o.prepare()))for(u=(l=o.edges).length,s=0;s1e-6||x(a-i)>1e-6)&&(l.splice(s,0,new tO(function(t,r,i){var n=new tP(t,null);return n.a=r,n.b=i,ty.push(n),n}(o.site,h,1e-6>x(n-d)&&m-a>1e-6?{x:d,y:1e-6>x(r-d)?i:m}:1e-6>x(a-m)&&f-n>1e-6?{x:1e-6>x(i-m)?r:f,y:m}:1e-6>x(n-f)&&a-p>1e-6?{x:f,y:1e-6>x(r-f)?i:p}:1e-6>x(a-p)&&n-d>1e-6?{x:1e-6>x(i-p)?r:d,y:p}:null),o.site,null)),++u)}(r));var s={cells:tv,edges:ty};return tx=t_=ty=tv=null,s}function tq(t,r){return r.y-t.y||r.x-t.x}tE.prototype.prepare=function(){for(var t,r=this.edges,i=r.length;i--;)(t=r[i].edge).b&&t.a||r.splice(i,1);return r.sort(tD),r.length},tO.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},tR.prototype={insert:function(t,r){var i,n,a;if(t){if(r.P=t,r.N=t.N,t.N&&(t.N.P=r),t.N=r,t.R){for(t=t.R;t.L;)t=t.L;t.L=r}else t.R=r;i=t}else this._?(t=tV(this._),r.P=null,r.N=t,t.P=t.L=r,i=t):(r.P=r.N=null,this._=r,i=null);for(r.L=r.R=null,r.U=i,r.C=!0,t=r;i&&i.C;)n=i.U,i===n.L?(a=n.R)&&a.C?(i.C=a.C=!1,n.C=!0,t=n):(t===i.R&&(tj(this,i),i=(t=i).U),i.C=!1,n.C=!0,tN(this,n)):(a=n.L)&&a.C?(i.C=a.C=!1,n.C=!0,t=n):(t===i.L&&(tN(this,i),i=(t=i).U),i.C=!1,n.C=!0,tj(this,n)),i=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var r,i,n,a=t.U,o=t.L,s=t.R;if(i=o?s?tV(s):o:s,a?a.L===t?a.L=i:a.R=i:this._=i,o&&s?(n=i.C,i.C=t.C,i.L=o,o.U=i,i!==s?(a=i.U,i.U=t.U,t=i.R,a.L=t,i.R=s,s.U=i):(i.U=a,a=i,t=i.R)):(n=t.C,t=i),t&&(t.U=a),!n){if(t&&t.C){t.C=!1;return}do{if(t===this._)break;if(t===a.L){if((r=a.R).C&&(r.C=!1,a.C=!0,tj(this,a),r=a.R),r.L&&r.L.C||r.R&&r.R.C){r.R&&r.R.C||(r.L.C=!1,r.C=!0,tN(this,r),r=a.R),r.C=a.C,a.C=r.R.C=!1,tj(this,a),t=this._;break}}else if((r=a.L).C&&(r.C=!1,a.C=!0,tN(this,a),r=a.L),r.L&&r.L.C||r.R&&r.R.C){r.L&&r.L.C||(r.R.C=!1,r.C=!0,tj(this,r),r=a.L),r.C=a.C,a.C=r.L.C=!1,tN(this,a),t=this._;break}r.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var r=tu,i=tc,n=r,a=i,o=tG;if(t)return s(t);function s(t){var r=Array(t.length),i=o[0][0],n=o[0][1],a=o[1][0],s=o[1][1];return tU(l(t),o).cells.forEach(function(o,l){var u=o.edges,c=o.site;(r[l]=u.length?u.map(function(t){var r=t.start();return[r.x,r.y]}):c.x>=i&&c.x<=a&&c.y>=n&&c.y<=s?[[i,s],[a,s],[a,n],[i,n]]:[]).point=t[l]}),r}function l(t){return t.map(function(t,r){return{x:1e-6*Math.round(n(t,r)/1e-6),y:1e-6*Math.round(a(t,r)/1e-6),i:r}})}return s.links=function(t){return tU(l(t)).edges.filter(function(t){return t.l&&t.r}).map(function(r){return{source:t[r.l.i],target:t[r.r.i]}})},s.triangles=function(t){var r=[];return tU(l(t)).cells.forEach(function(i,n){for(var a,o,s,l,u=i.site,c=i.edges.sort(tD),h=-1,d=c.length,f=c[d-1].edge,p=f.l===u?f.r:f.l;++h(a=u,o=l,s=p,(a.x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y))&&r.push([t[n],t[l.i],t[p.i]])}}),r},s.x=function(t){return arguments.length?(n=e8(r=t),s):r},s.y=function(t){return arguments.length?(a=e8(i=t),s):i},s.clipExtent=function(t){return arguments.length?(o=t??tG,s):o===tG?null:o},s.size=function(t){return arguments.length?s.clipExtent(t&&[[0,0],t]):o===tG?null:o&&o[1]},s};var tG=[[-1e6,-1e6],[1e6,1e6]];function tH(t){return t.x}function t$(t){return t.y}function tW(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function tY(r,i){r=t.rgb(r),i=t.rgb(i);var n=r.r,a=r.g,o=r.b,s=i.r-n,l=i.g-a,u=i.b-o;return function(t){return"#"+e0(Math.round(n+s*t))+e0(Math.round(a+l*t))+e0(Math.round(o+u*t))}}function tZ(t,r){var i,n={},a={};for(i in t)i in r?n[i]=t0(t[i],r[i]):a[i]=t[i];for(i in r)i in t||(a[i]=r[i]);return function(t){for(i in n)a[i]=n[i](t);return a}}function tX(t,r){return t*=1,r*=1,function(i){return t*(1-i)+r*i}}function tK(t,r){var i,n,a,o=tJ.lastIndex=tQ.lastIndex=0,s=-1,l=[],u=[];for(t+="",r+="";(i=tJ.exec(t))&&(n=tQ.exec(r));)(a=n.index)>o&&(a=r.slice(o,a),l[s]?l[s]+=a:l[++s]=a),(i=i[0])===(n=n[0])?l[s]?l[s]+=n:l[++s]=n:(l[++s]=null,u.push({i:s,x:tX(i,n)})),o=tQ.lastIndex;return og&&(g=u.x),u.y>y&&(y=u.y),c.push(u.x),h.push(u.y);else for(d=0;dg&&(g=_),w>y&&(y=w),c.push(_),h.push(w)}var T=g-p,A=y-m;function M(t,r,i,n,a,o,s,l){if(!(isNaN(i)||isNaN(n)))if(t.leaf){var u=t.x,c=t.y;if(null!=u)if(x(u-i)+x(c-n)<.01)k(t,r,i,n,a,o,s,l);else{var h=t.point;t.x=t.y=t.point=null,k(t,h,u,c,a,o,s,l),k(t,r,i,n,a,o,s,l)}else t.x=i,t.y=n,t.point=r}else k(t,r,i,n,a,o,s,l)}function k(t,r,i,n,a,o,s,l){var u=(a+s)*.5,c=(o+l)*.5,h=i>=u,d=n>=c,f=d<<1|h;t.leaf=!1,t=t.nodes[f]||(t.nodes[f]=tW()),h?a=u:s=u,d?o=c:l=c,M(t,r,i,n,a,o,s,l)}T>A?y=m+T:g=p+A;var S=tW();if(S.add=function(t){M(S,t,+v(t,++d),+b(t,d),p,m,g,y)},S.visit=function(t){!function t(r,i,n,a,o,s){if(!r(i,n,a,o,s)){var l=(n+o)*.5,u=(a+s)*.5,c=i.nodes;c[0]&&t(r,c[0],n,a,l,u),c[1]&&t(r,c[1],l,a,o,u),c[2]&&t(r,c[2],n,u,l,s),c[3]&&t(r,c[3],l,u,o,s)}}(t,S,p,m,g,y)},S.find=function(t){var r,i,n,a,o,s,l,u,c;return r=S,i=t[0],n=t[1],c=1/0,function t(r,h,d,f,p){if(!(h>s||d>l||f=_,A=n>=w,M=A<<1|T,k=M+4;M=0&&!(n=t.interpolators[a](r,i)););return n}function t1(t,r){var i,n=[],a=[],o=t.length,s=r.length,l=Math.min(t.length,r.length);for(i=0;i=1)return 1;var r=t*t,i=r*t;return 4*(t<.5?i:3*(t-r)+i-.75)}function re(t){return 1-Math.cos(t*ek)}function rt(t){return Math.pow(2,10*(t-1))}function rr(t){return 1-Math.sqrt(1-t*t)}function ri(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function rn(t,r){return r-=t,function(i){return Math.round(t+r*i)}}function ra(t){var r,i,n,a=[t.a,t.b],o=[t.c,t.d],s=rs(a),l=ro(a,o),u=rs((r=o,i=a,n=-l,r[0]+=n*i[0],r[1]+=n*i[1],r))||0;a[0]*o[1]=0?t.slice(0,n):t,o=n>=0?t.slice(n+1):"in";return a=t3.get(a)||t2,r=(o=t5.get(o)||C)(a.apply(null,i.call(arguments,1))),function(t){return t<=0?0:t>=1?1:r(t)}},t.interpolateHcl=function(r,i){r=t.hcl(r),i=t.hcl(i);var n=r.h,a=r.c,o=r.l,s=i.h-n,l=i.c-a,u=i.l-o;return isNaN(l)&&(l=0,a=isNaN(a)?i.c:a),isNaN(s)?(s=0,n=isNaN(n)?i.h:n):s>180?s-=360:s<-180&&(s+=360),function(t){return eV(n+s*t,a+l*t,o+u*t)+""}},t.interpolateHsl=function(r,i){r=t.hsl(r),i=t.hsl(i);var n=r.h,a=r.s,o=r.l,s=i.h-n,l=i.s-a,u=i.l-o;return isNaN(l)&&(l=0,a=isNaN(a)?i.s:a),isNaN(s)?(s=0,n=isNaN(n)?i.h:n):s>180?s-=360:s<-180&&(s+=360),function(t){return eB(n+s*t,a+l*t,o+u*t)+""}},t.interpolateLab=function(r,i){r=t.lab(r),i=t.lab(i);var n=r.l,a=r.a,o=r.b,s=i.l-n,l=i.a-a,u=i.b-o;return function(t){return eH(n+s*t,a+l*t,o+u*t)+""}},t.interpolateRound=rn,t.transform=function(r){var i=a.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){i.setAttribute("transform",t);var r=i.transform.baseVal.consolidate()}return new ra(r?r.matrix:rl)})(r)},ra.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var rl={a:1,b:0,c:0,d:1,e:0,f:0};function ru(t){return t.length?t.pop()+",":""}function rc(r,i){var n,a,o,s,l=[],u=[];return r=t.transform(r),i=t.transform(i),function(t,r,i,n){if(t[0]!==r[0]||t[1]!==r[1]){var a=i.push("translate(",null,",",null,")");n.push({i:a-4,x:tX(t[0],r[0])},{i:a-2,x:tX(t[1],r[1])})}else(r[0]||r[1])&&i.push("translate("+r+")")}(r.translate,i.translate,l,u),n=r.rotate,a=i.rotate,n!==a?(n-a>180?a+=360:a-n>180&&(n+=360),u.push({i:l.push(ru(l)+"rotate(",null,")")-2,x:tX(n,a)})):a&&l.push(ru(l)+"rotate("+a+")"),o=r.skew,s=i.skew,o!==s?u.push({i:l.push(ru(l)+"skewX(",null,")")-2,x:tX(o,s)}):s&&l.push(ru(l)+"skewX("+s+")"),function(t,r,i,n){if(t[0]!==r[0]||t[1]!==r[1]){var a=i.push(ru(i)+"scale(",null,",",null,")");n.push({i:a-4,x:tX(t[0],r[0])},{i:a-2,x:tX(t[1],r[1])})}else(1!==r[0]||1!==r[1])&&i.push(ru(i)+"scale("+r+")")}(r.scale,i.scale,l,u),r=i=null,function(t){for(var r,i=-1,n=u.length;++i0?n=t:(r.c=null,r.t=NaN,r=null,u.end({type:"end",alpha:n=0})):t>0&&(u.start({type:"start",alpha:n=t}),r=ta(l.tick)),l):n},l.start=function(){var t,r,i,n=v.length,u=x.length,h=c[0],m=c[1];for(t=0;t=0;)a.push(n[i])}function rT(t,r){for(var i=[t],n=[];null!=(t=i.pop());)if(n.push(t),(o=t.children)&&(a=o.length))for(var a,o,s=-1;++s=0;)c.push(l=s[o]),l.parent=u,l.depth=u.depth+1;i&&(u.value=0),u.children=s}else i&&(u.value=+i.call(n,u,u.depth)||0),delete u.children;return rT(a,function(r){var n,a;t&&(n=r.children)&&n.sort(t),i&&(a=r.parent)&&(a.value+=r.value)}),h}return n.sort=function(r){return arguments.length?(t=r,n):t},n.children=function(t){return arguments.length?(r=t,n):r},n.value=function(t){return arguments.length?(i=t,n):i},n.revalue=function(t){return i&&(rw(t,function(t){t.children&&(t.value=0)}),rT(t,function(t){var r;t.children||(t.value=+i.call(n,t,t.depth)||0),(r=t.parent)&&(r.value+=t.value)})),t},n},t.layout.partition=function(){var r=t.layout.hierarchy(),i=[1,1];function n(t,n){var a=r.call(this,t,n);return function t(r,i,n,a){var o=r.children;if(r.x=i,r.y=r.depth*a,r.dx=n,r.dy=a,o&&(s=o.length)){var s,l,u,c=-1;for(n=r.value?n/r.value:0;++cl&&(l=n),s.push(n)}for(i=0;ia&&(n=i,a=r);return n}function rR(t){return t.reduce(rB,0)}function rB(t,r){return t+r[1]}function rj(t,r){return rN(t,Math.ceil(Math.log(r.length)/Math.LN2+1))}function rN(t,r){for(var i=-1,n=+t[0],a=(t[1]-n)/r,o=[];++i<=r;)o[i]=a*i+n;return o}function rV(r){return[t.min(r),t.max(r)]}function rU(t,r){return t.value-r.value}function rq(t,r){var i=t._pack_next;t._pack_next=r,r._pack_prev=t,r._pack_next=i,i._pack_prev=r}function rG(t,r){t._pack_next=r,r._pack_prev=t}function rH(t,r){var i=r.x-t.x,n=r.y-t.y,a=t.r+r.r;return .999*a*a>i*i+n*n}function r$(t){if((r=t.children)&&(u=r.length)){var r,i,n,a,o,s,l,u,c=1/0,h=-1/0,d=1/0,f=-1/0;if(r.forEach(rW),(i=r[0]).x=-i.r,i.y=0,b(i),u>1&&((n=r[1]).x=n.r,n.y=0,b(n),u>2))for(rZ(i,n,a=r[2]),b(a),rq(i,a),i._pack_prev=a,rq(a,n),n=i._pack_next,o=3;o0)for(s=-1;++s=d[0]&&u<=d[1]&&(l=c[t.bisect(f,u,1,m)-1],l.y+=g,l.push(o[s]));return c}return o.value=function(t){return arguments.length?(i=t,o):i},o.range=function(t){return arguments.length?(n=e8(t),o):n},o.bins=function(t){return arguments.length?(a="number"==typeof t?function(r){return rN(r,t)}:e8(t),o):a},o.frequency=function(t){return arguments.length?(r=!!t,o):r},o},t.layout.pack=function(){var r,i=t.layout.hierarchy().sort(rU),n=0,a=[1,1];function o(t,o){var s=i.call(this,t,o),l=s[0],u=a[0],c=a[1],h=null==r?Math.sqrt:"function"==typeof r?r:function(){return r};if(l.x=l.y=0,rT(l,function(t){t.r=+h(t.value)}),rT(l,r$),n){var d=n*(r?1:Math.max(2*l.r/u,2*l.r/c))/2;rT(l,function(t){t.r+=d}),rT(l,r$),rT(l,function(t){t.r-=d})}return function t(r,i,n,a){var o=r.children;if(r.x=i+=a*r.x,r.y=n+=a*r.y,r.r*=a,o)for(var s=-1,l=o.length;++sp.x&&(p=t),t.depth>m.depth&&(m=t)});var g=i(f,p)/2-f.x,y=n[0]/(p.x+i(p,f)/2+g),v=n[1]/(m.depth||1);rw(h,function(t){t.x=(t.x+g)*y,t.y=t.depth*v})}return c}function s(t){var r=t.children,n=t.parent.children,a=t.i?n[t.i-1]:null;if(r.length){!function(t){for(var r,i=0,n=0,a=t.children,o=a.length;--o>=0;)r=a[o],r.z+=i,r.m+=i,i+=r.s+(n+=r.c)}(t);var o=(r[0].z+r[r.length-1].z)/2;a?(t.z=a.z+i(t._,a._),t.m=t.z-o):t.z=o}else a&&(t.z=a.z+i(t._,a._));t.parent.A=function(t,r,n){if(r){for(var a,o,s,l,u=t,c=t,h=r,d=u.parent.children[0],f=u.m,p=c.m,m=h.m,g=d.m;h=rJ(h),u=rK(u),h&&u;){d=rK(d),(c=rJ(c)).a=t,(l=h.z+m-u.z-f+i(h._,u._))>0&&(function(t,r,i){var n=i/(r.i-t.i);r.c-=n,r.s+=i,t.c+=n,r.z+=i,r.m+=i}((a=h,o=t,s=n,a.a.parent===o.parent?a.a:s),t,l),f+=l,p+=l),m+=h.m,f+=u.m,g+=d.m,p+=c.m}h&&!rJ(c)&&(c.t=h,c.m+=m-p),u&&!rK(d)&&(d.t=u,d.m+=f-g,n=t)}return n}(t,a,t.parent.A||n[0])}function l(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n[0],t.y=t.depth*n[1]}return o.separation=function(t){return arguments.length?(i=t,o):i},o.size=function(t){return arguments.length?(a=null==(n=t)?u:null,o):a?null:n},o.nodeSize=function(t){return arguments.length?(a=null==(n=t)?null:u,o):a?n:null},r_(o,r)},t.layout.cluster=function(){var r=t.layout.hierarchy().sort(null).value(null),i=rX,n=[1,1],a=!1;function o(o,s){var l,u=r.call(this,o,s),c=u[0],h=0;rT(c,function(r){var n,a,o=r.children;o&&o.length?(r.x=(n=o).reduce(function(t,r){return t+r.x},0)/n.length,a=o,r.y=1+t.max(a,function(t){return t.y})):(r.x=l?h+=i(r,l):0,r.y=0,l=r)});var d=function t(r){var i=r.children;return i&&i.length?t(i[0]):r}(c),f=function t(r){var i,n=r.children;return n&&(i=n.length)?t(n[i-1]):r}(c),p=d.x-i(d,f)/2,m=f.x+i(f,d)/2;return rT(c,a?function(t){t.x=(t.x-c.x)*n[0],t.y=(c.y-t.y)*n[1]}:function(t){t.x=(t.x-p)/(m-p)*n[0],t.y=(1-(c.y?t.y/c.y:1))*n[1]}),u}return o.separation=function(t){return arguments.length?(i=t,o):i},o.size=function(t){return arguments.length?(a=null==(n=t),o):a?null:n},o.nodeSize=function(t){return arguments.length?(a=null!=(n=t),o):a?n:null},r_(o,r)},t.layout.treemap=function(){var r,i=t.layout.hierarchy(),n=Math.round,a=[1,1],o=null,s=rQ,l=!1,u="squarify",c=.5*(1+Math.sqrt(5));function h(t,r){for(var i,n,a=-1,o=t.length;++ai.dy)&&(h=i.dy);++si.dx)&&(h=i.dx);++s0;)f.push(n=p[o-1]),f.area+=n.area,"squarify"!==u||(a=function(t,r){for(var i,n=t.area,a=0,o=1/0,s=-1,l=t.length;++sa&&(a=i));return n*=n,r*=r,n?Math.max(r*a*c/n,n/(r*o*c)):1/0}(f,g))<=m?(p.pop(),m=a):(f.area-=f.pop().area,d(f,g,l,!1),g=Math.min(l.dx,l.dy),f.length=f.area=0,m=1/0);f.length&&(d(f,g,l,!0),f.length=f.area=0),i.forEach(t)}})(o),l&&(r=n),n}return f.size=function(t){return arguments.length?(a=t,f):a},f.padding=function(t){var r;return arguments.length?(s=null==(o=t)?rQ:"function"==(r=typeof t)?function(r){var i=t.call(f,r,r.depth);return null==i?rQ(r):r0(r,"number"==typeof i?[i,i,i,i]:i)}:("number"===r&&(t=[t,t,t,t]),function(r){return r0(r,t)}),f):o},f.round=function(t){return arguments.length?(n=t?Math.round:Number,f):n!=Number},f.sticky=function(t){return arguments.length?(l=t,r=null,f):l},f.ratio=function(t){return arguments.length?(c=t,f):c},f.mode=function(t){return arguments.length?(u=t+"",f):u},r_(f,i)},t.random={normal:function(t,r){var i=arguments.length;return i<2&&(r=1),i<1&&(t=0),function(){var i,n,a;do a=(i=2*Math.random()-1)*i+(n=2*Math.random()-1)*n;while(!a||a>1);return t+r*i*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var r=t.random.normal.apply(t,arguments);return function(){return Math.exp(r())}},bates:function(r){var i=t.random.irwinHall(r);return function(){return i()/r}},irwinHall:function(t){return function(){for(var r=0,i=0;i2?r8:r3,l=a?rd:rh;return o=t(r,i,l,n),s=t(i,r,l,t0),u}function u(t){return o(t)}return u.invert=function(t){return s(t)},u.domain=function(t){return arguments.length?(r=t.map(Number),l()):r},u.range=function(t){return arguments.length?(i=t,l()):i},u.rangeRound=function(t){return u.range(t).interpolate(rn)},u.clamp=function(t){return arguments.length?(a=t,l()):a},u.interpolate=function(t){return arguments.length?(n=t,l()):n},u.ticks=function(t){return it(r,t)},u.tickFormat=function(t,i){return d3_scale_linearTickFormat(r,t,i)},u.nice=function(t){return r9(r,t),l()},u.copy=function(){return t(r,i,n,a)},l()}([0,1],[0,1],t0,!1)},t.scale.log=function(){return function t(r,i,n,a){function o(t){return(n?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(i)}function s(t){return n?Math.pow(i,t):-Math.pow(i,-t)}function l(t){return r(o(t))}return l.invert=function(t){return s(r.invert(t))},l.domain=function(t){return arguments.length?(n=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a},l.base=function(t){return arguments.length?(i=+t,r.domain(a.map(o)),l):i},l.nice=function(){var t=r5(a.map(o),n?Math:ir);return r.domain(t),a=t.map(s),l},l.ticks=function(){var t=r1(a),r=[],l=t[0],u=t[1],c=Math.floor(o(l)),h=Math.ceil(o(u)),d=i%1?2:i;if(isFinite(h-c)){if(n){for(;c0;f--)r.push(s(c)*f);for(c=0;r[c]u;h--);r=r.slice(c,h)}return r},l.copy=function(){return t(r.copy(),i,n,a)},r7(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var ir={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function ii(t){return function(r){return r<0?-Math.pow(-r,t):Math.pow(r,t)}}t.scale.pow=function(){return function t(r,i,n){var a=ii(i),o=ii(1/i);function s(t){return r(a(t))}return s.invert=function(t){return o(r.invert(t))},s.domain=function(t){return arguments.length?(r.domain((n=t.map(Number)).map(a)),s):n},s.ticks=function(t){return it(n,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(n,t,r)},s.nice=function(t){return s.domain(r9(n,t))},s.exponent=function(t){return arguments.length?(a=ii(i=t),o=ii(1/i),r.domain(n.map(a)),s):i},s.copy=function(){return t(r.copy(),i,n)},r7(s,r)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function r(i,n){var a,o,s;function l(t){return o[((a.get(t)||("range"===n.t?a.set(t,i.push(t)):NaN))-1)%o.length]}function u(r,n){return t.range(i.length).map(function(t){return r+n*t})}return l.domain=function(t){if(!arguments.length)return i;i=[],a=new _;for(var r,o=-1,s=t.length;++o0?a[t-1]:i[0],td?0:1;if(c=eM)return u(c,p)+(l?u(l,1-p):"")+"Z";var m,g,y,v,x,b,_,w,T,A,M,k,S=0,E=0,D=[];if((v=(+s.apply(this,arguments)||0)/2)&&(y=n===ic?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(E*=-1),c&&(E=eD(y/c*Math.sin(v))),l&&(S=eD(y/l*Math.sin(v)))),c){x=c*Math.cos(h+E),b=c*Math.sin(h+E),_=c*Math.cos(d-E),w=c*Math.sin(d-E);var C=Math.abs(d-h-2*E)<=eT?0:1;if(E&&iy(x,b,_,w)===p^C){var I=(h+d)/2;x=c*Math.cos(I),b=c*Math.sin(I),_=w=null}}else x=b=0;if(l){T=l*Math.cos(d-S),A=l*Math.sin(d-S),M=l*Math.cos(h+S),k=l*Math.sin(h+S);var L=Math.abs(h-d+2*S)<=eT?0:1;if(S&&iy(T,A,M,k)===1-p^L){var P=(h+d)/2;T=l*Math.cos(P),A=l*Math.sin(P),M=k=null}}else T=A=0;if(f>1e-6&&(m=Math.min(Math.abs(c-l)/2,+i.apply(this,arguments)))>.001){g=l0?0:1}function iv(t,r,i,n,a){var o=t[0]-r[0],s=t[1]-r[1],l=(a?n:-n)/Math.sqrt(o*o+s*s),u=l*s,c=-l*o,h=t[0]+u,d=t[1]+c,f=r[0]+u,p=r[1]+c,m=(h+f)/2,g=(d+p)/2,y=f-h,v=p-d,x=y*y+v*v,b=i-n,_=h*p-f*d,w=(v<0?-1:1)*Math.sqrt(Math.max(0,b*b*x-_*_)),T=(_*v-y*w)/x,A=(-_*y-v*w)/x,M=(_*v+y*w)/x,k=(-_*y+v*w)/x,S=T-m,E=A-g,D=M-m,C=k-g;return S*S+E*E>D*D+C*C&&(T=M,A=k),[[T-u,A-c],[T*i/b,A*i/b]]}function ix(){return!0}function ib(t){var r=tu,i=tc,n=ix,a=iw,o=a.key,s=.7;function l(o){var l,u=[],c=[],h=-1,d=o.length,f=e8(r),p=e8(i);function m(){u.push("M",a(t(c),s))}for(;++h1&&a.push("H",n[0]),a.join("")},"step-before":iA,"step-after":iM,basis:iE,"basis-open":function(t){if(t.length<4)return iw(t);for(var r,i=[],n=-1,a=t.length,o=[0],s=[0];++n<3;)r=t[n],o.push(r[0]),s.push(r[1]);for(i.push(iD(iL,o)+","+iD(iL,s)),--n;++nx(r=iz(t[l],t[l+1]))?s[l]=s[l+1]=0:(a=(i=s[l]/r)*i+(n=s[l+1]/r)*n)>9&&(a=3*r/Math.sqrt(a),s[l]=a*i,s[l+1]=a*n);for(l=-1;++l<=u;)o.push([(a=(t[Math.min(u,l+1)][0]-t[Math.max(0,l-1)][0])/(6*(1+s[l]*s[l])))||0,s[l]*a||0]);return o}(t))}});function iw(t){return t.length>1?t.join("L"):t+"Z"}function iT(t){return t.join("L")+"Z"}function iA(t){for(var r=0,i=t.length,n=t[0],a=[n[0],",",n[1]];++r1){l=r[1],o=t[u],u++,n+="C"+(a[0]+s[0])+","+(a[1]+s[1])+","+(o[0]-l[0])+","+(o[1]-l[1])+","+o[0]+","+o[1];for(var c=2;ceT)+",1 "+r}return o.radius=function(t){return arguments.length?(i=e8(t),o):i},o.source=function(r){return arguments.length?(t=e8(r),o):t},o.target=function(t){return arguments.length?(r=e8(t),o):r},o.startAngle=function(t){return arguments.length?(n=e8(t),o):n},o.endAngle=function(t){return arguments.length?(a=e8(t),o):a},o},t.svg.diagonal=function(){var t=iR,r=iB,i=iN;function n(n,a){var o=t.call(this,n,a),s=r.call(this,n,a),l=(o.y+s.y)/2,u=[o,{x:o.x,y:l},{x:s.x,y:l},s];return"M"+(u=u.map(i))[0]+"C"+u[1]+" "+u[2]+" "+u[3]}return n.source=function(r){return arguments.length?(t=e8(r),n):t},n.target=function(t){return arguments.length?(r=e8(t),n):r},n.projection=function(t){return arguments.length?(i=t,n):i},n},t.svg.diagonal.radial=function(){var r=t.svg.diagonal(),i=iN,n=r.projection;return r.projection=function(t){var r;return arguments.length?n((r=i=t,function(){var t=r.apply(this,arguments),i=t[0],n=t[1]-ek;return[i*Math.cos(n),i*Math.sin(n)]})):i},r},t.svg.symbol=function(){var t=iU,r=iV;function i(i,n){return(iG.get(t.call(this,i,n))||iq)(r.call(this,i,n))}return i.type=function(r){return arguments.length?(t=e8(r),i):t},i.size=function(t){return arguments.length?(r=e8(t),i):r},i};var iG=t.map({circle:iq,cross:function(t){var r=Math.sqrt(t/5)/2;return"M"+-3*r+","+-r+"H"+-r+"V"+-3*r+"H"+r+"V"+-r+"H"+3*r+"V"+r+"H"+r+"V"+3*r+"H"+-r+"V"+r+"H"+-3*r+"Z"},diamond:function(t){var r=Math.sqrt(t/(2*i$)),i=r*i$;return"M0,"+-r+"L"+i+",0 0,"+r+" "+-i+",0Z"},square:function(t){var r=Math.sqrt(t)/2;return"M"+-r+","+-r+"L"+r+","+-r+" "+r+","+r+" "+-r+","+r+"Z"},"triangle-down":function(t){var r=Math.sqrt(t/iH),i=r*iH/2;return"M0,"+i+"L"+r+","+-i+" "+-r+","+-i+"Z"},"triangle-up":function(t){var r=Math.sqrt(t/iH),i=r*iH/2;return"M0,"+-i+"L"+r+","+i+" "+-r+","+i+"Z"}});t.svg.symbolTypes=iG.keys();var iH=Math.sqrt(3),i$=Math.tan(30*eS);H.transition=function(t){for(var r,i,n=iX||++iQ,a=i2(t),o=[],s=iK||{time:Date.now(),ease:t9,delay:0,duration:250},l=-1,u=this.length;++l0;)c[--f].call(t,s);if(o>=1)return d.event&&d.event.end.call(t,t.__data__,r),--h.count?delete h[n]:delete t[i],1}d||(s=ta(function(t){var r=d.delay;if(s.t=r+o,r<=t)return f(t-r);s.c=f},0,o=a.time),d=h[n]={tween:new _,time:o,timer:s,delay:a.delay,duration:a.duration,ease:a.ease,index:r},a=null,++h.count)}iJ.call=H.call,iJ.empty=H.empty,iJ.node=H.node,iJ.size=H.size,t.transition=function(r,i){return r&&r.transition?iX?r.transition(i):r:t.selection().transition(r)},t.transition.prototype=iJ,iJ.select=function(t){var r,i,n,a=this.id,o=this.namespace,s=[];t=$(t);for(var l=-1,u=this.length;++lrect,.s>rect").attr("width",l[1]-l[0])}function g(t){t.select(".extent").attr("y",u[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",u[1]-u[0])}function y(){var d,y,v=this,x=t.select(t.event.target),b=n.of(v,arguments),_=t.select(v),w=x.datum(),T=!/^(n|s)$/.test(w)&&a,A=!/^(e|w)$/.test(w)&&o,M=x.classed("extent"),k=ev(v),S=t.mouse(v),E=t.select(s(v)).on("keydown.brush",function(){32==t.event.keyCode&&(M||(d=null,S[0]-=l[1],S[1]-=u[1],M=2),O())}).on("keyup.brush",function(){32==t.event.keyCode&&2==M&&(S[0]+=l[1],S[1]+=u[1],M=0,O())});if(t.event.changedTouches?E.on("touchmove.brush",I).on("touchend.brush",P):E.on("mousemove.brush",I).on("mouseup.brush",P),_.interrupt().selectAll("*").interrupt(),M)S[0]=l[0]-S[0],S[1]=u[0]-S[1];else if(w){var D=+/w$/.test(w),C=+/^n/.test(w);y=[l[1-D]-S[0],u[1-C]-S[1]],S[0]=l[D],S[1]=u[C]}else t.event.altKey&&(d=S.slice());function I(){var r=t.mouse(v),i=!1;y&&(r[0]+=y[0],r[1]+=y[1]),M||(t.event.altKey?(d||(d=[(l[0]+l[1])/2,(u[0]+u[1])/2]),S[0]=l[+(r[0]0))return s;do s.push(o=new Date(+r)),a(r,n),t(r);while(o=i)for(;t(i),!r(i);)i.setTime(i-1)},function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;a(t,-1),!r(t););else for(;--i>=0;)for(;a(t,1),!r(t););})},o&&(l.count=function(n,a){return r.setTime(+n),i.setTime(+a),t(r),t(i),Math.floor(o(r,i))},l.every=function(t){return isFinite(t=Math.floor(t))&&t>0?t>1?l.filter(s?function(r){return s(r)%t==0}:function(r){return l.count(0,r)%t==0}):l:null}),l}var a=n(function(){},function(t,r){t.setTime(+t+r)},function(t,r){return r-t});a.every=function(t){return isFinite(t=Math.floor(t))&&t>0?t>1?n(function(r){r.setTime(Math.floor(r/t)*t)},function(r,i){r.setTime(+r+i*t)},function(r,i){return(i-r)/t}):a:null};var o=a.range,s=n(function(t){t.setTime(t-t.getMilliseconds())},function(t,r){t.setTime(+t+1e3*r)},function(t,r){return(r-t)/1e3},function(t){return t.getUTCSeconds()}),l=s.range,u=n(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,r){t.setTime(+t+6e4*r)},function(t,r){return(r-t)/6e4},function(t){return t.getMinutes()}),c=u.range,h=n(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},function(t,r){t.setTime(+t+36e5*r)},function(t,r){return(r-t)/36e5},function(t){return t.getHours()}),d=h.range,f=n(function(t){t.setHours(0,0,0,0)},function(t,r){t.setDate(t.getDate()+r)},function(t,r){return(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5},function(t){return t.getDate()-1}),p=f.range;function m(t){return n(function(r){r.setDate(r.getDate()-(r.getDay()+7-t)%7),r.setHours(0,0,0,0)},function(t,r){t.setDate(t.getDate()+7*r)},function(t,r){return(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5})}var g=m(0),y=m(1),v=m(2),x=m(3),b=m(4),_=m(5),w=m(6),T=g.range,A=y.range,M=v.range,k=x.range,S=b.range,E=_.range,D=w.range,C=n(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,r){t.setMonth(t.getMonth()+r)},function(t,r){return r.getMonth()-t.getMonth()+(r.getFullYear()-t.getFullYear())*12},function(t){return t.getMonth()}),I=C.range,L=n(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,r){t.setFullYear(t.getFullYear()+r)},function(t,r){return r.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});L.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n(function(r){r.setFullYear(Math.floor(r.getFullYear()/t)*t),r.setMonth(0,1),r.setHours(0,0,0,0)},function(r,i){r.setFullYear(r.getFullYear()+i*t)}):null};var P=L.range,z=n(function(t){t.setUTCSeconds(0,0)},function(t,r){t.setTime(+t+6e4*r)},function(t,r){return(r-t)/6e4},function(t){return t.getUTCMinutes()}),F=z.range,O=n(function(t){t.setUTCMinutes(0,0,0)},function(t,r){t.setTime(+t+36e5*r)},function(t,r){return(r-t)/36e5},function(t){return t.getUTCHours()}),R=O.range,B=n(function(t){t.setUTCHours(0,0,0,0)},function(t,r){t.setUTCDate(t.getUTCDate()+r)},function(t,r){return(r-t)/864e5},function(t){return t.getUTCDate()-1}),j=B.range;function N(t){return n(function(r){r.setUTCDate(r.getUTCDate()-(r.getUTCDay()+7-t)%7),r.setUTCHours(0,0,0,0)},function(t,r){t.setUTCDate(t.getUTCDate()+7*r)},function(t,r){return(r-t)/6048e5})}var V=N(0),U=N(1),q=N(2),G=N(3),H=N(4),$=N(5),W=N(6),Y=V.range,Z=U.range,X=q.range,K=G.range,J=H.range,Q=$.range,ee=W.range,et=n(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,r){t.setUTCMonth(t.getUTCMonth()+r)},function(t,r){return r.getUTCMonth()-t.getUTCMonth()+(r.getUTCFullYear()-t.getUTCFullYear())*12},function(t){return t.getUTCMonth()}),er=et.range,ei=n(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r)},function(t,r){return r.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});ei.every=function(t){return isFinite(t=Math.floor(t))&&t>0?n(function(r){r.setUTCFullYear(Math.floor(r.getUTCFullYear()/t)*t),r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},function(r,i){r.setUTCFullYear(r.getUTCFullYear()+i*t)}):null};var en=ei.range;t.timeDay=f,t.timeDays=p,t.timeFriday=_,t.timeFridays=E,t.timeHour=h,t.timeHours=d,t.timeInterval=n,t.timeMillisecond=a,t.timeMilliseconds=o,t.timeMinute=u,t.timeMinutes=c,t.timeMonday=y,t.timeMondays=A,t.timeMonth=C,t.timeMonths=I,t.timeSaturday=w,t.timeSaturdays=D,t.timeSecond=s,t.timeSeconds=l,t.timeSunday=g,t.timeSundays=T,t.timeThursday=b,t.timeThursdays=S,t.timeTuesday=v,t.timeTuesdays=M,t.timeWednesday=x,t.timeWednesdays=k,t.timeWeek=g,t.timeWeeks=T,t.timeYear=L,t.timeYears=P,t.utcDay=B,t.utcDays=j,t.utcFriday=$,t.utcFridays=Q,t.utcHour=O,t.utcHours=R,t.utcMillisecond=a,t.utcMilliseconds=o,t.utcMinute=z,t.utcMinutes=F,t.utcMonday=U,t.utcMondays=Z,t.utcMonth=et,t.utcMonths=er,t.utcSaturday=W,t.utcSaturdays=ee,t.utcSecond=s,t.utcSeconds=l,t.utcSunday=V,t.utcSundays=Y,t.utcThursday=H,t.utcThursdays=J,t.utcTuesday=q,t.utcTuesdays=X,t.utcWednesday=G,t.utcWednesdays=K,t.utcWeek=V,t.utcWeeks=Y,t.utcYear=ei,t.utcYears=en,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&"u">typeof r?t:(i=i||self).d3=i.d3||{})}}),D=g({"node_modules/d3-time-format/dist/d3-time-format.js"(t,r){var i,n;i=t,n=function(t,r){function i(t){if(0<=t.y&&t.y<100){var r=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return r.setFullYear(t.y),r}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function n(t){if(0<=t.y&&t.y<100){var r=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return r.setUTCFullYear(t.y),r}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t,r,i){return{y:t,m:r,d:i,H:0,M:0,S:0,L:0}}function o(t){var o=t.dateTime,s=t.date,u=t.time,c=t.periods,h=t.days,d=t.shortDays,f=t.months,W=t.shortMonths,ef=p(c),eM=m(c),ek=p(h),eS=m(h),eE=p(d),eD=m(d),eC=p(f),eI=m(f),eL=p(W),eP=m(W),ez={a:function(t){return d[t.getDay()]},A:function(t){return h[t.getDay()]},b:function(t){return W[t.getMonth()]},B:function(t){return f[t.getMonth()]},c:null,d:O,e:O,f:V,g:J,G:ee,H:R,I:B,j:j,L:N,m:U,M:q,p:function(t){return c[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:eT,s:eA,S:G,u:H,U:$,V:Y,w:Z,W:X,x:null,X:null,y:K,Y:Q,Z:et,"%":ew},eF={a:function(t){return d[t.getUTCDay()]},A:function(t){return h[t.getUTCDay()]},b:function(t){return W[t.getUTCMonth()]},B:function(t){return f[t.getUTCMonth()]},c:null,d:er,e:er,f:es,g:ev,G:eb,H:ei,I:en,j:ea,L:eo,m:el,M:eu,p:function(t){return c[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:eT,s:eA,S:ec,u:eh,U:ed,V:ep,w:em,W:eg,x:null,X:null,y:ey,Y:ex,Z:e_,"%":ew},eO={a:function(t,r,i){var n=eE.exec(r.slice(i));return n?(t.w=eD[n[0].toLowerCase()],i+n[0].length):-1},A:function(t,r,i){var n=ek.exec(r.slice(i));return n?(t.w=eS[n[0].toLowerCase()],i+n[0].length):-1},b:function(t,r,i){var n=eL.exec(r.slice(i));return n?(t.m=eP[n[0].toLowerCase()],i+n[0].length):-1},B:function(t,r,i){var n=eC.exec(r.slice(i));return n?(t.m=eI[n[0].toLowerCase()],i+n[0].length):-1},c:function(t,r,i){return ej(t,o,r,i)},d:k,e:k,f:L,g:w,G:_,H:E,I:E,j:S,L:I,m:M,M:D,p:function(t,r,i){var n=ef.exec(r.slice(i));return n?(t.p=eM[n[0].toLowerCase()],i+n[0].length):-1},q:A,Q:z,s:F,S:C,u:y,U:v,V:x,w:g,W:b,x:function(t,r,i){return ej(t,s,r,i)},X:function(t,r,i){return ej(t,u,r,i)},y:w,Y:_,Z:T,"%":P};function eR(t,r){return function(i){var n,a,o,s=[],u=-1,c=0,h=t.length;for(i instanceof Date||(i=new Date(+i));++u53)return null;"w"in c||(c.w=1),"Z"in c?(l=(u=(l=n(a(c.y,0,1))).getUTCDay())>4||0===u?r.utcMonday.ceil(l):r.utcMonday(l),l=r.utcDay.offset(l,(c.V-1)*7),c.y=l.getUTCFullYear(),c.m=l.getUTCMonth(),c.d=l.getUTCDate()+(c.w+6)%7):(l=(u=(l=i(a(c.y,0,1))).getDay())>4||0===u?r.timeMonday.ceil(l):r.timeMonday(l),l=r.timeDay.offset(l,(c.V-1)*7),c.y=l.getFullYear(),c.m=l.getMonth(),c.d=l.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:+("W"in c)),u="Z"in c?n(a(c.y,0,1)).getUTCDay():i(a(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(u+5)%7:c.w+7*c.U-(u+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):i(c)}}function ej(t,r,i,n){for(var a,o,s=0,u=r.length,c=i.length;s=c)return -1;if(37===(a=r.charCodeAt(s++))){if(!(o=eO[(a=r.charAt(s++))in l?r.charAt(s++):a])||(n=o(t,i,n))<0)return -1}else if(a!=i.charCodeAt(n++))return -1}return n}return ez.x=eR(s,ez),ez.X=eR(u,ez),ez.c=eR(o,ez),eF.x=eR(s,eF),eF.X=eR(u,eF),eF.c=eR(o,eF),{format:function(t){var r=eR(t+="",ez);return r.toString=function(){return t},r},parse:function(t){var r=eB(t+="",!1);return r.toString=function(){return t},r},utcFormat:function(t){var r=eR(t+="",eF);return r.toString=function(){return t},r},utcParse:function(t){var r=eB(t+="",!0);return r.toString=function(){return t},r}}}var s,l={"-":"",_:" ",0:"0"},u=/^\s*\d+/,c=/^%/,h=/[\\^$*+?|[\]().{}]/g;function d(t,r,i){var n=t<0?"-":"",a=(n?-t:t)+"",o=a.length;return n+(o68?1900:2e3),i+n[0].length):-1}function T(t,r,i){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(r.slice(i,i+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),i+n[0].length):-1}function A(t,r,i){var n=u.exec(r.slice(i,i+1));return n?(t.q=3*n[0]-3,i+n[0].length):-1}function M(t,r,i){var n=u.exec(r.slice(i,i+2));return n?(t.m=n[0]-1,i+n[0].length):-1}function k(t,r,i){var n=u.exec(r.slice(i,i+2));return n?(t.d=+n[0],i+n[0].length):-1}function S(t,r,i){var n=u.exec(r.slice(i,i+3));return n?(t.m=0,t.d=+n[0],i+n[0].length):-1}function E(t,r,i){var n=u.exec(r.slice(i,i+2));return n?(t.H=+n[0],i+n[0].length):-1}function D(t,r,i){var n=u.exec(r.slice(i,i+2));return n?(t.M=+n[0],i+n[0].length):-1}function C(t,r,i){var n=u.exec(r.slice(i,i+2));return n?(t.S=+n[0],i+n[0].length):-1}function I(t,r,i){var n=u.exec(r.slice(i,i+3));return n?(t.L=+n[0],i+n[0].length):-1}function L(t,r,i){var n=u.exec(r.slice(i,i+6));return n?(t.L=Math.floor(n[0]/1e3),i+n[0].length):-1}function P(t,r,i){var n=c.exec(r.slice(i,i+1));return n?i+n[0].length:-1}function z(t,r,i){var n=u.exec(r.slice(i));return n?(t.Q=+n[0],i+n[0].length):-1}function F(t,r,i){var n=u.exec(r.slice(i));return n?(t.s=+n[0],i+n[0].length):-1}function O(t,r){return d(t.getDate(),r,2)}function R(t,r){return d(t.getHours(),r,2)}function B(t,r){return d(t.getHours()%12||12,r,2)}function j(t,i){return d(1+r.timeDay.count(r.timeYear(t),t),i,3)}function N(t,r){return d(t.getMilliseconds(),r,3)}function V(t,r){return N(t,r)+"000"}function U(t,r){return d(t.getMonth()+1,r,2)}function q(t,r){return d(t.getMinutes(),r,2)}function G(t,r){return d(t.getSeconds(),r,2)}function H(t){var r=t.getDay();return 0===r?7:r}function $(t,i){return d(r.timeSunday.count(r.timeYear(t)-1,t),i,2)}function W(t){var i=t.getDay();return i>=4||0===i?r.timeThursday(t):r.timeThursday.ceil(t)}function Y(t,i){return t=W(t),d(r.timeThursday.count(r.timeYear(t),t)+(4===r.timeYear(t).getDay()),i,2)}function Z(t){return t.getDay()}function X(t,i){return d(r.timeMonday.count(r.timeYear(t)-1,t),i,2)}function K(t,r){return d(t.getFullYear()%100,r,2)}function J(t,r){return d((t=W(t)).getFullYear()%100,r,2)}function Q(t,r){return d(t.getFullYear()%1e4,r,4)}function ee(t,i){var n=t.getDay();return d((t=n>=4||0===n?r.timeThursday(t):r.timeThursday.ceil(t)).getFullYear()%1e4,i,4)}function et(t){var r=t.getTimezoneOffset();return(r>0?"-":(r*=-1,"+"))+d(r/60|0,"0",2)+d(r%60,"0",2)}function er(t,r){return d(t.getUTCDate(),r,2)}function ei(t,r){return d(t.getUTCHours(),r,2)}function en(t,r){return d(t.getUTCHours()%12||12,r,2)}function ea(t,i){return d(1+r.utcDay.count(r.utcYear(t),t),i,3)}function eo(t,r){return d(t.getUTCMilliseconds(),r,3)}function es(t,r){return eo(t,r)+"000"}function el(t,r){return d(t.getUTCMonth()+1,r,2)}function eu(t,r){return d(t.getUTCMinutes(),r,2)}function ec(t,r){return d(t.getUTCSeconds(),r,2)}function eh(t){var r=t.getUTCDay();return 0===r?7:r}function ed(t,i){return d(r.utcSunday.count(r.utcYear(t)-1,t),i,2)}function ef(t){var i=t.getUTCDay();return i>=4||0===i?r.utcThursday(t):r.utcThursday.ceil(t)}function ep(t,i){return t=ef(t),d(r.utcThursday.count(r.utcYear(t),t)+(4===r.utcYear(t).getUTCDay()),i,2)}function em(t){return t.getUTCDay()}function eg(t,i){return d(r.utcMonday.count(r.utcYear(t)-1,t),i,2)}function ey(t,r){return d(t.getUTCFullYear()%100,r,2)}function ev(t,r){return d((t=ef(t)).getUTCFullYear()%100,r,2)}function ex(t,r){return d(t.getUTCFullYear()%1e4,r,4)}function eb(t,i){var n=t.getUTCDay();return d((t=n>=4||0===n?r.utcThursday(t):r.utcThursday.ceil(t)).getUTCFullYear()%1e4,i,4)}function e_(){return"+0000"}function ew(){return"%"}function eT(t){return+t}function eA(t){return Math.floor(t/1e3)}function eM(r){return t.timeFormat=(s=o(r)).format,t.timeParse=s.parse,t.utcFormat=s.utcFormat,t.utcParse=s.utcParse,s}eM({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ek="%Y-%m-%dT%H:%M:%S.%LZ",eS=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(ek),eE=+new Date("2000-01-01T00:00:00.000Z")?function(t){var r=new Date(t);return isNaN(r)?null:r}:t.utcParse(ek);t.isoFormat=eS,t.isoParse=eE,t.timeFormatDefaultLocale=eM,t.timeFormatLocale=o,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&"u">typeof r?n(t,S()):n((i=i||self).d3=i.d3||{},i.d3)}}),C=g({"node_modules/d3-format/dist/d3-format.js"(t,r){var i;i=t,function(t){function r(t,r){if((i=(t=r?t.toExponential(r-1):t.toExponential()).indexOf("e"))<0)return null;var i,n=t.slice(0,i);return[n.length>1?n[0]+n.slice(2):n,+t.slice(i+1)]}function i(t){return(t=r(Math.abs(t)))?t[1]:NaN}var n,a,o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function s(t){var r;if(!(r=o.exec(t)))throw Error("invalid format: "+t);return new l({fill:r[1],align:r[2],sign:r[3],symbol:r[4],zero:r[5],width:r[6],comma:r[7],precision:r[8]&&r[8].slice(1),trim:r[9],type:r[10]})}function l(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function u(t,i){var n=r(t,i);if(!n)return t+"";var a=n[0],o=n[1];return o<0?"0."+Array(-o).join("0")+a:a.length>o+1?a.slice(0,o+1)+"."+a.slice(o+1):a+Array(o-a.length+2).join("0")}s.prototype=l.prototype,l.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var c={"%":function(t,r){return(100*t).toFixed(r)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,r){return t.toExponential(r)},f:function(t,r){return t.toFixed(r)},g:function(t,r){return t.toPrecision(r)},o:function(t){return Math.round(t).toString(8)},p:function(t,r){return u(100*t,r)},r:u,s:function(t,i){var a=r(t,i);if(!a)return t+"";var o=a[0],s=a[1],l=s-(n=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,u=o.length;return l===u?o:l>u?o+Array(l-u+1).join("0"):l>0?o.slice(0,l)+"."+o.slice(l):"0."+Array(1-l).join("0")+r(t,Math.max(0,i+l-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function h(t){return t}var d=Array.prototype.map,f=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function p(t){var r,a,o,l=void 0===t.grouping||void 0===t.thousands?h:(r=d.call(t.grouping,Number),a=t.thousands+"",function(t,i){for(var n=t.length,o=[],s=0,l=r[0],u=0;n>0&&l>0&&(u+l+1>i&&(l=Math.max(1,i-u)),o.push(t.substring(n-=l,n+l)),!((u+=l+1)>i));)l=r[s=(s+1)%r.length];return o.reverse().join(a)}),u=void 0===t.currency?"":t.currency[0]+"",p=void 0===t.currency?"":t.currency[1]+"",m=void 0===t.decimal?".":t.decimal+"",g=void 0===t.numerals?h:(o=d.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return o[+t]})}),y=void 0===t.percent?"%":t.percent+"",v=void 0===t.minus?"-":t.minus+"",x=void 0===t.nan?"NaN":t.nan+"";function b(t){var r=(t=s(t)).fill,i=t.align,a=t.sign,o=t.symbol,h=t.zero,d=t.width,b=t.comma,_=t.precision,w=t.trim,T=t.type;"n"===T?(b=!0,T="g"):c[T]||(void 0===_&&(_=12),w=!0,T="g"),(h||"0"===r&&"="===i)&&(h=!0,r="0",i="=");var A="$"===o?u:"#"===o&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",M="$"===o?p:/[%p]/.test(T)?y:"",k=c[T],S=/[defgprs%]/.test(T);function E(t){var o,s,u,c=A,p=M;if("c"===T)p=k(t)+p,t="";else{var y=(t*=1)<0||1/t<0;if(t=isNaN(t)?x:k(Math.abs(t),_),w&&(t=function(t){e:for(var r,i=t.length,n=1,a=-1;n0&&(a=0)}return a>0?t.slice(0,a)+t.slice(r+1):t}(t)),y&&0==+t&&"+"!==a&&(y=!1),c=(y?"("===a?a:v:"-"===a||"("===a?"":a)+c,p=("s"===T?f[8+n/3]:"")+p+(y&&"("===a?")":""),S){for(o=-1,s=t.length;++o(u=t.charCodeAt(o))||u>57){p=(46===u?m+t.slice(o+1):t.slice(o))+p,t=t.slice(0,o);break}}}b&&!h&&(t=l(t,1/0));var E=c.length+t.length+p.length,D=E>1)+c+t+p+D.slice(E);break;default:t=D+c+t+p}return g(t)}return _=void 0===_?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),E.toString=function(){return t+""},E}return{format:b,formatPrefix:function(t,r){var n=b(((t=s(t)).type="f",t)),a=3*Math.max(-8,Math.min(8,Math.floor(i(r)/3))),o=Math.pow(10,-a),l=f[8+a/3];return function(t){return n(o*t)+l}}}}function m(r){return t.format=(a=p(r)).format,t.formatPrefix=a.formatPrefix,a}m({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=l,t.formatDefaultLocale=m,t.formatLocale=p,t.formatSpecifier=s,t.precisionFixed=function(t){return Math.max(0,-i(Math.abs(t)))},t.precisionPrefix=function(t,r){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(i(r)/3)))-i(Math.abs(t)))},t.precisionRound=function(t,r){return Math.max(0,i(r=Math.abs(r)-(t=Math.abs(t)))-i(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&"u">typeof r?t:(i="u">typeof globalThis?globalThis:i||self).d3=i.d3||{})}}),I=g({"node_modules/is-string-blank/index.js"(t,r){r.exports=function(t){for(var r,i=t.length,n=0;n13)&&32!==r&&133!==r&&160!==r&&5760!==r&&6158!==r&&(r<8192||r>8205)&&8232!==r&&8233!==r&&8239!==r&&8287!==r&&8288!==r&&12288!==r&&65279!==r)return!1;return!0}}}),L=g({"node_modules/fast-isnumeric/index.js"(t,r){var i=I();r.exports=function(t){var r=typeof t;if("string"===r){var n=t;if(0==(t*=1)&&i(n))return!1}else if("number"!==r)return!1;return t-t<1}}}),P=g({"src/constants/numerical.js"(t,r){r.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}}),z=g({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(t,r){var i;i=t,function(t){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n>4,d[c++]=(15&a)<<4|o>>2,d[c++]=(3&o)<<6|63&s;return h},t.encode=function(t){var i,n=new Uint8Array(t),a=n.length,o="";for(i=0;i>2],o+=r[(3&n[i])<<4|n[i+1]>>4],o+=r[(15&n[i+1])<<2|n[i+2]>>6],o+=r[63&n[i+2]];return a%3==2?o=o.substring(0,o.length-1)+"=":a%3==1&&(o=o.substring(0,o.length-2)+"=="),o},Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&"u">typeof r?t:(i="u">typeof globalThis?globalThis:i||self)["base64-arraybuffer"]={})}}),F=g({"src/lib/is_plain_object.js"(t,r){r.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty")}}}),O=g({"src/lib/array.js"(t){var r=z().decode,i=F(),n=Array.isArray,a=ArrayBuffer,o=DataView;function s(t){return a.isView(t)&&!(t instanceof o)}function l(t){return n(t)||s(t)}t.isTypedArray=s,t.isArrayOrTypedArray=l,t.isArray1D=function(t){return!l(t[0])},t.ensureArray=function(t,r){return n(t)||(t=[]),t.length=r,t};var u={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};function c(t){return t.constructor===ArrayBuffer}function h(t,r,i){if(l(t))if(!l(t[0]))return t.length;else{for(var n=i,a=0;a2)return c[r]=2|c[r],f.set(t,null);if(d){for(s=r;s0)return Math.log(t)/Math.LN10;var n=Math.log(Math.min(r[0],r[1]))/Math.LN10;return i(n)||(n=Math.log(Math.max(r[0],r[1]))/Math.LN10-6),n}}}),V=g({"src/lib/relink_private.js"(t,r){var i=O().isArrayOrTypedArray,n=F();r.exports=function t(r,a){for(var o in a){var s=a[o],l=r[o];if(l!==s)if("_"===o.charAt(0)||"function"==typeof s){if(o in r)continue;r[o]=s}else if(i(s)&&i(l)&&n(s[0])){if("customdata"===o||"ids"===o)continue;for(var u=Math.min(s.length,l.length),c=0;cr/2?t-Math.round(t/r)*r:t}y(U,{mod:()=>q,modHalf:()=>G});var H=m({"src/lib/mod.ts"(){}}),$=g({"src/lib/extend.js"(t){var r=F(),i=Array.isArray;function n(t,a,o,s){var l,u,c,h,d,f,p=t[0],m=t.length;if(2===m&&i(p)&&i(t[1])&&0===p.length){if(function(t,r){var i,n;for(i=0;itypeof h||o)&&(p[u]=h);return p}t.extendFlat=function(...t){return n(t,!1,!1,!1)},t.extendDeep=function(...t){return n(t,!0,!1,!1)},t.extendDeepAll=function(...t){return n(t,!0,!0,!1)},t.extendDeepNoArrays=function(...t){return n(t,!0,!1,!0)}}}),W=g({"src/plots/font_attributes.js"(t,r){r.exports=function(t){var r=t.variantValues,i=t.editType,n=t.colorEditType;void 0===n&&(n=i);var a={editType:i,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};t.noNumericWeightValues&&(a.valType="enumerated",a.values=a.extras,a.extras=void 0,a.min=void 0,a.max=void 0);var o={family:{valType:"string",noBlank:!0,strict:!0,editType:i},size:{valType:"number",min:1,editType:i},color:{valType:"color",editType:n},weight:a,style:{editType:i,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:t.noFontVariant?void 0:{editType:i,valType:"enumerated",values:r||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:t.noFontTextcase?void 0:{editType:i,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:t.noFontLineposition?void 0:{editType:i,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:t.noFontShadow?void 0:{editType:i,valType:"string",dflt:t.autoShadowDflt?"auto":"none"},editType:i};return t.autoSize&&(o.size.dflt="auto"),t.autoColor&&(o.color.dflt="auto"),t.arrayOk&&(o.family.arrayOk=!0,o.weight.arrayOk=!0,o.style.arrayOk=!0,t.noFontVariant||(o.variant.arrayOk=!0),t.noFontTextcase||(o.textcase.arrayOk=!0),t.noFontLineposition||(o.lineposition.arrayOk=!0),t.noFontShadow||(o.shadow.arrayOk=!0),o.size.arrayOk=!0,o.color.arrayOk=!0),o}}}),Y=g({"src/components/fx/constants.js"(t,r){r.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}}),Z=g({"src/components/fx/layout_attributes.js"(t,r){var i=Y(),n=W(),a=n({editType:"none"});a.family.dflt=i.HOVERFONT,a.size.dflt=i.HOVERFONTSIZE,r.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversort:{valType:"enumerated",values:["trace","value descending","value ascending"],dflt:"trace",editType:"none"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoveranywhere:{valType:"boolean",dflt:!1,editType:"none"},clickanywhere:{valType:"boolean",dflt:!1,editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:n({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}}),X=g({"src/components/fx/attributes.js"(t,r){var i=W(),n=Z().hoverlabel,a=$().extendFlat;r.exports={hoverlabel:{bgcolor:a({},n.bgcolor,{arrayOk:!0}),bordercolor:a({},n.bordercolor,{arrayOk:!0}),font:i({arrayOk:!0,editType:"none"}),align:a({},n.align,{arrayOk:!0}),namelength:a({},n.namelength,{arrayOk:!0}),showarrow:a({},n.showarrow),editType:"none"}}}}),K=g({"src/plots/attributes.js"(t,r){var i=W(),n=X();r.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:i({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,uirevision:{valType:"any",editType:"none"}}}}),J=g({"node_modules/culori/bundled/culori.cjs"(t,r){let i,n,a;var o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,c={};((t,r)=>{for(var i in r)o(t,i,{get:r[i],enumerable:!0})})(c,{a98:()=>i7,average:()=>e$,averageAngle:()=>eG,averageNumber:()=>eH,blend:()=>r7,blerp:()=>ea,clampChroma:()=>iO,clampGamut:()=>iF,clampRgb:()=>iz,colorsNamed:()=>d,convertA98ToXyz65:()=>ed,convertCubehelixToRgb:()=>eL,convertDlchToLab65:()=>e7,convertHsiToRgb:()=>tn,convertHslToRgb:()=>ts,convertHsvToRgb:()=>tf,convertHwbToRgb:()=>tg,convertItpToXyz65:()=>tT,convertJabToJch:()=>tF,convertJabToRgb:()=>tP,convertJabToXyz65:()=>tI,convertJchToJab:()=>tO,convertLab65ToDlch:()=>e9,convertLab65ToRgb:()=>e0,convertLab65ToXyz65:()=>eQ,convertLabToLch:()=>eY,convertLabToRgb:()=>tV,convertLabToXyz50:()=>tj,convertLchToLab:()=>eZ,convertLchuvToLuv:()=>tQ,convertLrgbToOklab:()=>rt,convertLrgbToRgb:()=>ex,convertLuvToLchuv:()=>tJ,convertLuvToXyz50:()=>t8,convertOkhslToOklab:()=>rh,convertOkhsvToOklab:()=>rp,convertOklabToLrgb:()=>ri,convertOklabToOkhsl:()=>rc,convertOklabToOkhsv:()=>rf,convertOklabToRgb:()=>rn,convertP3ToXyz65:()=>rb,convertProphotoToXyz50:()=>rk,convertRec2020ToXyz65:()=>rI,convertRgbToCubehelix:()=>eI,convertRgbToHsi:()=>ta,convertRgbToHsl:()=>tl,convertRgbToHsv:()=>tp,convertRgbToHwb:()=>ty,convertRgbToJab:()=>tL,convertRgbToLab:()=>tH,convertRgbToLab65:()=>e3,convertRgbToLrgb:()=>eg,convertRgbToOklab:()=>rr,convertRgbToXyb:()=>rF,convertRgbToXyz50:()=>tU,convertRgbToXyz65:()=>ey,convertRgbToYiq:()=>rq,convertXybToRgb:()=>rR,convertXyz50ToLab:()=>tG,convertXyz50ToLuv:()=>t5,convertXyz50ToProphoto:()=>rA,convertXyz50ToRgb:()=>tN,convertXyz50ToXyz65:()=>rV,convertXyz65ToA98:()=>ep,convertXyz65ToItp:()=>tM,convertXyz65ToJab:()=>tD,convertXyz65ToLab65:()=>e2,convertXyz65ToP3:()=>r_,convertXyz65ToRec2020:()=>rD,convertXyz65ToRgb:()=>eb,convertXyz65ToXyz50:()=>rN,convertYiqToRgb:()=>rG,converter:()=>E,cubehelix:()=>i9,differenceCie76:()=>eR,differenceCie94:()=>eB,differenceCiede2000:()=>ej,differenceCmc:()=>eN,differenceEuclidean:()=>eO,differenceHueChroma:()=>eF,differenceHueNaive:()=>ez,differenceHueSaturation:()=>eP,differenceHyab:()=>eV,differenceItp:()=>eq,differenceKotsarenkoRamos:()=>eU,displayable:()=>iL,dlab:()=>ne,dlch:()=>nt,easingGamma:()=>ik,easingInOutSine:()=>i4,easingMidpoint:()=>io,easingSmootherstep:()=>i5,easingSmoothstep:()=>i2,easingSmoothstepInverse:()=>i3,filterBrightness:()=>iV,filterContrast:()=>iU,filterDeficiencyDeuter:()=>i0,filterDeficiencyProt:()=>iQ,filterDeficiencyTrit:()=>i1,filterGrayscale:()=>iH,filterHueRotate:()=>iW,filterInvert:()=>i$,filterSaturate:()=>iG,filterSepia:()=>iq,fixupAlpha:()=>eu,fixupHueDecreasing:()=>eS,fixupHueIncreasing:()=>ek,fixupHueLonger:()=>eM,fixupHueShorter:()=>eA,formatCss:()=>r2,formatHex:()=>r3,formatHex8:()=>r5,formatHsl:()=>r6,formatRgb:()=>r4,getMode:()=>F,hsi:()=>nr,hsl:()=>ni,hsv:()=>nn,hwb:()=>na,inGamut:()=>iP,interpolate:()=>il,interpolateWith:()=>iu,interpolateWithPremultipliedAlpha:()=>ic,interpolatorLinear:()=>el,interpolatorPiecewise:()=>es,interpolatorSplineBasis:()=>id,interpolatorSplineBasisClosed:()=>ip,interpolatorSplineMonotone:()=>iT,interpolatorSplineMonotone2:()=>iA,interpolatorSplineMonotoneClosed:()=>iM,interpolatorSplineNatural:()=>ig,interpolatorSplineNaturalClosed:()=>iy,itp:()=>no,jab:()=>ns,jch:()=>nl,lab:()=>nu,lab65:()=>nc,lch:()=>nh,lch65:()=>nd,lchuv:()=>nf,lerp:()=>ei,lrgb:()=>np,luv:()=>nm,mapAlphaDivide:()=>ir,mapAlphaMultiply:()=>it,mapTransferGamma:()=>ia,mapTransferLinear:()=>ii,mapper:()=>ie,modeA98:()=>e_,modeCubehelix:()=>eW,modeDlab:()=>tr,modeDlch:()=>ti,modeHsi:()=>to,modeHsl:()=>td,modeHsv:()=>tm,modeHwb:()=>tx,modeItp:()=>tk,modeJab:()=>tz,modeJch:()=>tR,modeLab:()=>tW,modeLab65:()=>tY,modeLch:()=>tX,modeLch65:()=>tK,modeLchuv:()=>t7,modeLrgb:()=>t9,modeLuv:()=>re,modeOkhsl:()=>rd,modeOkhsv:()=>rm,modeOklab:()=>ry,modeOklch:()=>rx,modeP3:()=>rw,modeProphoto:()=>rS,modeRec2020:()=>rL,modeRgb:()=>ec,modeXyb:()=>rB,modeXyz50:()=>rj,modeXyz65:()=>rU,modeYiq:()=>rH,nearest:()=>iB,okhsl:()=>ng,okhsv:()=>ny,oklab:()=>nv,oklch:()=>nx,p3:()=>nb,parse:()=>ee,parseHex:()=>y,parseHsl:()=>th,parseHslLegacy:()=>tc,parseHwb:()=>tv,parseLab:()=>t$,parseLch:()=>tZ,parseNamed:()=>m,parseOklab:()=>rg,parseOklch:()=>rv,parseRgb:()=>et,parseRgbLegacy:()=>k,parseTransparent:()=>er,prophoto:()=>n_,random:()=>r9,rec2020:()=>nw,removeParser:()=>R,rgb:()=>nT,round:()=>r$,samples:()=>iS,serializeHex:()=>rJ,serializeHex8:()=>rQ,serializeHsl:()=>r1,serializeRgb:()=>r0,toGamut:()=>iR,trilerp:()=>eo,unlerp:()=>en,useMode:()=>z,useParser:()=>O,wcagContrast:()=>i8,wcagLuminance:()=>i6,xyb:()=>nA,xyz50:()=>nM,xyz65:()=>nk,yiq:()=>nS}),r.exports=((t,r,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let n of l(r))u.call(t,n)||void 0===n||o(t,n,{get:()=>r[n],enumerable:!(i=s(r,n))||i.enumerable});return t})(o({},"__esModule",{value:!0}),c);var h=(t,r)=>{if("number"==typeof t){if(3===r)return{mode:"rgb",r:(t>>8&15|t>>4&240)/255,g:(t>>4&15|240&t)/255,b:(15&t|t<<4&240)/255};if(4===r)return{mode:"rgb",r:(t>>12&15|t>>8&240)/255,g:(t>>8&15|t>>4&240)/255,b:(t>>4&15|240&t)/255,alpha:(15&t|t<<4&240)/255};if(6===r)return{mode:"rgb",r:(t>>16&255)/255,g:(t>>8&255)/255,b:(255&t)/255};if(8===r)return{mode:"rgb",r:(t>>24&255)/255,g:(t>>16&255)/255,b:(t>>8&255)/255,alpha:(255&t)/255}}},d={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},m=t=>h(d[t.toLowerCase()],6),g=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,y=t=>{let r;return(r=t.match(g))?h(parseInt(r[1],16),r[1].length):void 0},v="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",x=`${v}%`,b=`(?:${v}%|${v})`,_=`(?:${v}%|${v}|none)`,w=`(?:${v}(deg|grad|rad|turn)|${v})`,T="\\s*,\\s*",A=(RegExp("^"+_+"$"),RegExp(`^rgba?\\(\\s*${v}${T}${v}${T}${v}\\s*(?:,\\s*${b}\\s*)?\\)$`)),M=RegExp(`^rgba?\\(\\s*${x}${T}${x}${T}${x}\\s*(?:,\\s*${b}\\s*)?\\)$`),k=t=>{let r={mode:"rgb"},i;if(i=t.match(A))void 0!==i[1]&&(r.r=i[1]/255),void 0!==i[2]&&(r.g=i[2]/255),void 0!==i[3]&&(r.b=i[3]/255);else{if(!(i=t.match(M)))return;void 0!==i[1]&&(r.r=i[1]/100),void 0!==i[2]&&(r.g=i[2]/100),void 0!==i[3]&&(r.b=i[3]/100)}return void 0!==i[4]?r.alpha=Math.max(0,Math.min(1,i[4]/100)):void 0!==i[5]&&(r.alpha=Math.max(0,Math.min(1,+i[5]))),r},S=(t,r)=>void 0===t?void 0:"object"!=typeof t?ee(t):void 0!==t.mode?t:r?p(f({},t),{mode:r}):void 0,E=(t="rgb")=>r=>void 0!==(r=S(r,t))?r.mode===t?r:D[r.mode][t]?D[r.mode][t](r):"rgb"===t?D[r.mode].rgb(r):D.rgb[t](D[r.mode].rgb(r)):void 0,D={},C={},I=[],L={},P=t=>t,z=t=>(D[t.mode]=f(f({},D[t.mode]),t.toMode),Object.keys(t.fromMode||{}).forEach(r=>{D[r]||(D[r]={}),D[r][t.mode]=t.fromMode[r]}),t.ranges||(t.ranges={}),t.difference||(t.difference={}),t.channels.forEach(r=>{if(void 0===t.ranges[r]&&(t.ranges[r]=[0,1]),!t.interpolate[r])throw Error(`Missing interpolator for: ${r}`);"function"==typeof t.interpolate[r]&&(t.interpolate[r]={use:t.interpolate[r]}),t.interpolate[r].fixup||(t.interpolate[r].fixup=P)}),C[t.mode]=t,(t.parse||[]).forEach(r=>{O(r,t.mode)}),E(t.mode)),F=t=>C[t],O=(t,r)=>{if("string"==typeof t){if(!r)throw Error("'mode' required when 'parser' is a string");L[t]=r}else"function"==typeof t&&0>I.indexOf(t)&&I.push(t)},R=t=>{if("string"==typeof t)delete L[t];else if("function"==typeof t){let r=I.indexOf(t);r>0&&I.splice(r,1)}},B=/[^\x00-\x7F]|[a-zA-Z_]/,j=/[^\x00-\x7F]|[-\w]/,N="function",V="ident",U="number",q="percentage",G="none",H="alpha",$=0;function W(t){let r=t[$],i=t[$+1];return"-"===r||"+"===r?/\d/.test(i)||"."===i&&/\d/.test(t[$+2]):"."===r?/\d/.test(i):/\d/.test(r)}function Y(t){if($>=t.length)return!1;let r=t[$];if(B.test(r))return!0;if("-"===r){if(t.length-$<2)return!1;let r=t[$+1];return!!("-"===r||B.test(r))}return!1}var Z={deg:1,rad:180/Math.PI,grad:.9,turn:360};function X(t){let r="";if(("-"===t[$]||"+"===t[$])&&(r+=t[$++]),r+=K(t),"."===t[$]&&/\d/.test(t[$+1])&&(r+=t[$++]+K(t)),("e"===t[$]||"E"===t[$])&&(("-"===t[$+1]||"+"===t[$+1])&&/\d/.test(t[$+2])?r+=t[$++]+t[$++]+K(t):/\d/.test(t[$+1])&&(r+=t[$++]+K(t))),Y(t)){let i=J(t);return"deg"===i||"rad"===i||"turn"===i||"grad"===i?{type:"hue",value:r*Z[i]}:void 0}return"%"===t[$]?($++,{type:q,value:+r}):{type:U,value:+r}}function K(t){let r="";for(;/\d/.test(t[$]);)r+=t[$++];return r}function J(t){let r="";for(;$4)){if(4===i.length){if(i[3].type!==H)return;i[3]=i[3].value}return 3===i.length&&i.push({type:G,value:void 0}),i.every(t=>t.type!==H)?i:void 0}}var ee=t=>{if("string"!=typeof t)return;let r=function(t=""){let r=t.trim(),i=[],n;for($=0;$"transparent"===t?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,ei=(t,r,i)=>t+i*(r-t),en=(t,r,i)=>(i-t)/(r-t),ea=(t,r,i,n,a,o)=>ei(ei(t,r,a),ei(i,n,a),o),eo=(t,r,i,n,a,o,s,l,u,c,h)=>ei(ea(t,r,i,n,u,c),ea(a,o,s,l,u,c),h),es=t=>r=>{let i=(t=>{let r=[];for(let i=0;i{let n=r*i.length,a=r>=1?i.length-1:Math.max(Math.floor(n),0),o=i[a];return void 0===o?void 0:t(o[0],o[1],n-a)}},el=es(ei),eu=t=>{let r=!1,i=t.map(t=>void 0!==t?(r=!0,t):1);return r?i:t},ec={mode:"rgb",channels:["r","g","b","alpha"],parse:[et,y,k,m,er,"srgb"],serialize:"srgb",interpolate:{r:el,g:el,b:el,alpha:{use:el,fixup:eu}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},eh=(t=0)=>Math.pow(Math.abs(t),563/256)*Math.sign(t),ed=t=>{let r=eh(t.r),i=eh(t.g),n=eh(t.b),a={mode:"xyz65",x:.5766690429101305*r+.1855582379065463*i+.1882286462349947*n,y:.297344975250536*r+.6273635662554661*i+.0752914584939979*n,z:.0270313613864123*r+.0706888525358272*i+.9913375368376386*n};return void 0!==t.alpha&&(a.alpha=t.alpha),a},ef=t=>Math.pow(Math.abs(t),256/563)*Math.sign(t),ep=({x:t,y:r,z:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"a98",r:ef(2.0415879038107465*t-.5650069742788597*r-.3447313507783297*i),g:ef(-.9692436362808798*t+1.8759675015077206*r+.0415550574071756*i),b:ef(.0134442806320312*t-.1183623922310184*r+1.0151749943912058*i)};return void 0!==n&&(a.alpha=n),a},em=(t=0)=>{let r=Math.abs(t);return r<=.04045?t/12.92:(Math.sign(t)||1)*Math.pow((r+.055)/1.055,2.4)},eg=({r:t,g:r,b:i,alpha:n})=>{let a={mode:"lrgb",r:em(t),g:em(r),b:em(i)};return void 0!==n&&(a.alpha=n),a},ey=t=>{let{r:r,g:i,b:n,alpha:a}=eg(t),o={mode:"xyz65",x:.4123907992659593*r+.357584339383878*i+.1804807884018343*n,y:.2126390058715102*r+.715168678767756*i+.0721923153607337*n,z:.0193308187155918*r+.119194779794626*i+.9505321522496607*n};return void 0!==a&&(o.alpha=a),o},ev=(t=0)=>{let r=Math.abs(t);return r>.0031308?(Math.sign(t)||1)*(1.055*Math.pow(r,1/2.4)-.055):12.92*t},ex=({r:t,g:r,b:i,alpha:n},a="rgb")=>{let o={mode:a,r:ev(t),g:ev(r),b:ev(i)};return void 0!==n&&(o.alpha=n),o},eb=({x:t,y:r,z:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=ex({r:3.2409699419045226*t-1.537383177570094*r-.4986107602930034*i,g:-.9692436362808796*t+1.8759675015077204*r+.0415550574071756*i,b:.0556300796969936*t-.2039769588889765*r+1.0569715142428784*i});return void 0!==n&&(a.alpha=n),a},e_=p(f({},ec),{mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:t=>ep(ey(t)),xyz65:ep},toMode:{rgb:t=>eb(ed(t)),xyz65:ed}}),ew=t=>(t%=360)<0?t+360:t,eT=(t,r)=>t.map((i,n,a)=>{if(void 0===i)return i;let o=ew(i);return 0===n||void 0===t[n-1]?o:r(o-ew(a[n-1]))}).reduce((t,r)=>(t.length&&void 0!==r&&void 0!==t[t.length-1]?t.push(r+t[t.length-1]):t.push(r),t),[]),eA=t=>eT(t,t=>180>=Math.abs(t)?t:t-360*Math.sign(t)),eM=t=>eT(t,t=>Math.abs(t)>=180||0===t?t:t-360*Math.sign(t)),ek=t=>eT(t,t=>t>=0?t:t+360),eS=t=>eT(t,t=>t<=0?t:t-360),eE=Math.PI/180,eD=180/Math.PI,eC=-1.78277*.29227-.1347134789,eI=({r:t,g:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=(eC*i+-1.7884503806*t-3.5172982438*r)/(eC+-1.7884503806-3.5172982438),o=i-a,s=-((1.97294*(r-a)- -.29227*o)/.90649),l={mode:"cubehelix",l:a,s:0===a||1===a?void 0:Math.sqrt(o*o+s*s)/(1.97294*a*(1-a))};return l.s&&(l.h=Math.atan2(s,o)*eD-120),void 0!==n&&(l.alpha=n),l},eL=({h:t,s:r,l:i,alpha:n})=>{let a={mode:"rgb"};t=(void 0===t?0:t+120)*eE,void 0===i&&(i=0);let o=void 0===r?0:r*i*(1-i),s=Math.cos(t),l=Math.sin(t);return a.r=i+o*(-.14861*s+1.78277*l),a.g=i+o*(-.29227*s+-.90649*l),a.b=i+o*(1.97294*s+0*l),void 0!==n&&(a.alpha=n),a},eP=(t,r)=>{if(void 0===t.h||void 0===r.h||!t.s||!r.s)return 0;let i=ew(t.h),n=Math.sin((ew(r.h)-i+360)/2*Math.PI/180);return 2*Math.sqrt(t.s*r.s)*n},ez=(t,r)=>{if(void 0===t.h||void 0===r.h)return 0;let i=ew(t.h),n=ew(r.h);return Math.abs(n-i)>180?i-(n-360*Math.sign(n-i)):n-i},eF=(t,r)=>{if(void 0===t.h||void 0===r.h||!t.c||!r.c)return 0;let i=ew(t.h),n=Math.sin((ew(r.h)-i+360)/2*Math.PI/180);return 2*Math.sqrt(t.c*r.c)*n},eO=(t="rgb",r=[1,1,1,0])=>{let i=F(t),n=i.channels,a=i.difference,o=E(t);return(t,i)=>{let s=o(t),l=o(i);return Math.sqrt(n.reduce((t,i,n)=>{let o=a[i]?a[i](s,l):s[i]-l[i];return t+(r[n]||0)*Math.pow(isNaN(o)?0:o,2)},0))}},eR=()=>eO("lab65"),eB=(t=1,r=.045,i=.015)=>{let n=E("lab65");return(a,o)=>{let s=n(a),l=n(o),u=s.l,c=s.a,h=s.b,d=Math.sqrt(c*c+h*h),f=l.l,p=l.a,m=l.b,g=Math.pow(d-Math.sqrt(p*p+m*m),2),y=Math.pow(c-p,2)+Math.pow(h-m,2)-g;return Math.sqrt(Math.pow(u-f,2)/Math.pow(t,2)+g/Math.pow(1+r*d,2)+y/Math.pow(1+i*d,2))}},ej=(t=1,r=1,i=1)=>{let n=E("lab65");return(a,o)=>{let s=n(a),l=n(o),u=s.l,c=s.a,h=s.b,d=Math.sqrt(c*c+h*h),f=l.l,p=l.a,m=l.b,g=(d+Math.sqrt(p*p+m*m))/2,y=.5*(1-Math.sqrt(Math.pow(g,7)/(Math.pow(g,7)+0x16bcc41e9))),v=c*(1+y),x=p*(1+y),b=Math.sqrt(v*v+h*h),_=Math.sqrt(x*x+m*m),w=Math.abs(v)+Math.abs(h)===0?0:Math.atan2(h,v);w+=(w<0)*2*Math.PI;let T=Math.abs(x)+Math.abs(m)===0?0:Math.atan2(m,x);T+=(T<0)*2*Math.PI;let A=_-b,M=b*_==0?0:T-w;M-=(M>Math.PI)*2*Math.PI,M+=(M<-Math.PI)*2*Math.PI;let k=2*Math.sqrt(b*_)*Math.sin(M/2),S=(b+_)/2,E;b*_==0?E=w+T:(E=(w+T)/2-(Math.abs(w-T)>Math.PI)*Math.PI,E+=(E<0)*2*Math.PI);let D=Math.pow((u+f)/2-50,2),C=1-.17*Math.cos(E-Math.PI/6)+.24*Math.cos(2*E)+.32*Math.cos(3*E+Math.PI/30)-.2*Math.cos(4*E-63*Math.PI/180),I=1+.015*D/Math.sqrt(20+D),L=1+.045*S,P=1+.015*S*C,z=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*E-275)/25,2)),F=2*Math.sqrt(Math.pow(S,7)/(Math.pow(S,7)+0x16bcc41e9)),O=-1*Math.sin(2*z)*F;return Math.sqrt(Math.pow((f-u)/(t*I),2)+Math.pow(A/(r*L),2)+Math.pow(k/(i*P),2)+O*A/(r*L)*k/(i*P))}},eN=(t=1,r=1)=>{let i=E("lab65");return(n,a)=>{let o=i(n),s=o.l,l=o.a,u=o.b,c=Math.sqrt(l*l+u*u),h=Math.atan2(u,l);h+=2*Math.PI*(h<0);let d=i(a),f=d.l,p=d.a,m=d.b,g=Math.sqrt(p*p+m*m),y=Math.pow(s-f,2),v=Math.pow(c-g,2),x=Math.pow(l-p,2)+Math.pow(u-m,2)-v,b=Math.sqrt(Math.pow(c,4)/(Math.pow(c,4)+1900)),_=h>=164/180*Math.PI&&h<=345/180*Math.PI?.56+Math.abs(.2*Math.cos(h+168/180*Math.PI)):.36+Math.abs(.4*Math.cos(h+35/180*Math.PI)),w=.0638*c/(1+.0131*c)+.638;return Math.sqrt(y/Math.pow(t*(s<16?.511:.040975*s/(1+.01765*s)),2)+v/Math.pow(r*w,2)+x/Math.pow(w*(b*_+1-b),2))}},eV=()=>{let t=E("lab65");return(r,i)=>{let n=t(r),a=t(i),o=n.l-a.l,s=n.a-a.a,l=n.b-a.b;return Math.abs(o)+Math.sqrt(s*s+l*l)}},eU=()=>eO("yiq",[.5053,.299,.1957]),eq=()=>eO("itp",[518400,129600,518400]),eG=t=>{let r=t.reduce((t,r)=>{if(void 0!==r){let i=r*Math.PI/180;t.sin+=Math.sin(i),t.cos+=Math.cos(i)}return t},{sin:0,cos:0}),i=180*Math.atan2(r.sin,r.cos)/Math.PI;return i<0?360+i:i},eH=t=>{let r=t.filter(t=>void 0!==t);return r.length?r.reduce((t,r)=>t+r,0)/r.length:void 0};function e$(t,r="rgb",i){let n=F(r),a=t.map(E(r));return n.channels.reduce((t,r)=>{let o=a.map(t=>t[r]).filter(t=>void 0!==t);if(o.length){let a;a="function"==typeof i?i:i&&"function"==typeof i[r]?i[r]:n.average&&"function"==typeof n.average[r]?n.average[r]:eH,t[r]=a(o,r)}return t},{mode:r})}var eW={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:eI},toMode:{rgb:eL},interpolate:{h:{use:el,fixup:eA},s:el,l:el,alpha:{use:el,fixup:eu}},difference:{h:eP},average:{h:eG}},eY=({l:t,a:r,b:i,alpha:n},a="lch")=>{void 0===r&&(r=0),void 0===i&&(i=0);let o=Math.sqrt(r*r+i*i),s={mode:a,l:t,c:o};return o&&(s.h=ew(180*Math.atan2(i,r)/Math.PI)),void 0!==n&&(s.alpha=n),s},eZ=({l:t,c:r,h:i,alpha:n},a="lab")=>{void 0===i&&(i=0);let o={mode:a,l:t,a:r?r*Math.cos(i/180*Math.PI):0,b:r?r*Math.sin(i/180*Math.PI):0};return void 0!==n&&(o.alpha=n),o},eX={X:.3457/.3585,Y:1,Z:.8251046025104602},eK={X:.3127/.329,Y:1,Z:.3583/.329},eJ=t=>Math.pow(t,3)>.008856451679035631?Math.pow(t,3):(116*t-16)/903.2962962962963,eQ=({l:t,a:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=(t+16)/116,o=r/500+a,s=a-i/200,l={mode:"xyz65",x:eJ(o)*eK.X,y:eJ(a)*eK.Y,z:eJ(s)*eK.Z};return void 0!==n&&(l.alpha=n),l},e0=t=>eb(eQ(t)),e1=t=>t>.008856451679035631?Math.cbrt(t):(903.2962962962963*t+16)/116,e2=({x:t,y:r,z:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=e1(t/eK.X),o=e1(r/eK.Y),s={mode:"lab65",l:116*o-16,a:500*(a-o),b:200*(o-e1(i/eK.Z))};return void 0!==n&&(s.alpha=n),s},e3=t=>{let r=e2(ey(t));return t.r===t.b&&t.b===t.g&&(r.a=r.b=0),r},e5=26/180*Math.PI,e4=Math.cos(e5),e6=Math.sin(e5),e8=100/Math.log(1.39),e7=({l:t,c:r,h:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"lab65",l:(Math.exp(t/e8)-1)/.0039},o=(Math.exp(.0435*r*1)-1)/.075,s=o*Math.cos(i/180*Math.PI-e5),l=o*Math.sin(i/180*Math.PI-e5);return a.a=s*e4-l/.83*e6,a.b=s*e6+l/.83*e4,void 0!==n&&(a.alpha=n),a},e9=({l:t,a:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=r*e4+i*e6,o=.83*(i*e4-r*e6),s={mode:"dlch",l:e8/1*Math.log(1+.0039*t),c:Math.log(1+.075*Math.sqrt(a*a+o*o))/.0435};return s.c&&(s.h=ew((Math.atan2(o,a)+e5)/Math.PI*180)),void 0!==n&&(s.alpha=n),s},te=t=>e7(eY(t,"dlch")),tt=t=>eZ(e9(t),"dlab"),tr={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:te,rgb:t=>e0(te(t))},fromMode:{lab65:tt,rgb:t=>tt(e3(t))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:el,a:el,b:el,alpha:{use:el,fixup:eu}}},ti={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:e7,dlab:t=>eZ(t,"dlab"),rgb:t=>e0(e7(t))},fromMode:{lab65:e9,dlab:t=>eY(t,"dlch"),rgb:t=>e9(e3(t))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:el,c:el,h:{use:el,fixup:eA},alpha:{use:el,fixup:eu}},difference:{h:eF},average:{h:eG}};function tn({h:t,s:r,i:i,alpha:n}){t=ew(void 0!==t?t:0),void 0===r&&(r=0),void 0===i&&(i=0);let a=Math.abs(t/60%2-1),o;switch(Math.floor(t/60)){case 0:o={r:i*(1+r*(3/(2-a)-1)),g:i*(1+r*(3*(1-a)/(2-a)-1)),b:i*(1-r)};break;case 1:o={r:i*(1+r*(3*(1-a)/(2-a)-1)),g:i*(1+r*(3/(2-a)-1)),b:i*(1-r)};break;case 2:o={r:i*(1-r),g:i*(1+r*(3/(2-a)-1)),b:i*(1+r*(3*(1-a)/(2-a)-1))};break;case 3:o={r:i*(1-r),g:i*(1+r*(3*(1-a)/(2-a)-1)),b:i*(1+r*(3/(2-a)-1))};break;case 4:o={r:i*(1+r*(3*(1-a)/(2-a)-1)),g:i*(1-r),b:i*(1+r*(3/(2-a)-1))};break;case 5:o={r:i*(1+r*(3/(2-a)-1)),g:i*(1-r),b:i*(1+r*(3*(1-a)/(2-a)-1))};break;default:o={r:i*(1-r),g:i*(1-r),b:i*(1-r)}}return o.mode="rgb",void 0!==n&&(o.alpha=n),o}function ta({r:t,g:r,b:i,alpha:n}){void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=Math.max(t,r,i),o=Math.min(t,r,i),s={mode:"hsi",s:t+r+i===0?0:1-3*o/(t+r+i),i:(t+r+i)/3};return a-o!=0&&(s.h=(a===t?(r-i)/(a-o)+(r{let r=t.match(tu);if(!r)return;let i={mode:"hsl"};return void 0!==r[3]?i.h=+r[3]:void 0!==r[1]&&void 0!==r[2]&&(i.h=((t,r)=>{switch(r){case"deg":return+t;case"rad":return t/Math.PI*180;case"grad":return t/10*9;case"turn":return 360*t}})(r[1],r[2])),void 0!==r[4]&&(i.s=Math.min(Math.max(0,r[4]/100),1)),void 0!==r[5]&&(i.l=Math.min(Math.max(0,r[5]/100),1)),void 0!==r[6]?i.alpha=Math.max(0,Math.min(1,r[6]/100)):void 0!==r[7]&&(i.alpha=Math.max(0,Math.min(1,+r[7]))),i},th=function(t,r){if(!r||"hsl"!==r[0]&&"hsla"!==r[0])return;let i={mode:"hsl"},[,n,a,o,s]=r;if(n.type!==G){if(n.type===q)return;i.h=n.value}if(a.type!==G){if("hue"===a.type)return;i.s=a.value/100}if(o.type!==G){if("hue"===o.type)return;i.l=o.value/100}return s.type!==G&&(i.alpha=Math.min(1,Math.max(0,s.type===U?s.value:s.value/100))),i},td={mode:"hsl",toMode:{rgb:ts},fromMode:{rgb:tl},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[th,tc],serialize:t=>`hsl(${void 0!==t.h?t.h:"none"} ${void 0!==t.s?100*t.s+"%":"none"} ${void 0!==t.l?100*t.l+"%":"none"}${t.alpha<1?` / ${t.alpha}`:""})`,interpolate:{h:{use:el,fixup:eA},s:el,l:el,alpha:{use:el,fixup:eu}},difference:{h:eP},average:{h:eG}};function tf({h:t,s:r,v:i,alpha:n}){t=ew(void 0!==t?t:0),void 0===r&&(r=0),void 0===i&&(i=0);let a=Math.abs(t/60%2-1),o;switch(Math.floor(t/60)){case 0:o={r:i,g:i*(1-r*a),b:i*(1-r)};break;case 1:o={r:i*(1-r*a),g:i,b:i*(1-r)};break;case 2:o={r:i*(1-r),g:i,b:i*(1-r*a)};break;case 3:o={r:i*(1-r),g:i*(1-r*a),b:i};break;case 4:o={r:i*(1-r*a),g:i*(1-r),b:i};break;case 5:o={r:i,g:i*(1-r),b:i*(1-r*a)};break;default:o={r:i*(1-r),g:i*(1-r),b:i*(1-r)}}return o.mode="rgb",void 0!==n&&(o.alpha=n),o}function tp({r:t,g:r,b:i,alpha:n}){void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=Math.max(t,r,i),o=Math.min(t,r,i),s={mode:"hsv",s:0===a?0:1-o/a,v:a};return a-o!=0&&(s.h=(a===t?(r-i)/(a-o)+(r1){let t=r+i;r/=t,i/=t}return tf({h:t,s:1===i?1:1-r/(1-i),v:1-i,alpha:n})}function ty(t){let r=tp(t);if(void 0===r)return;let i=void 0!==r.s?r.s:0,n=void 0!==r.v?r.v:0,a={mode:"hwb",w:(1-i)*n,b:1-n};return void 0!==r.h&&(a.h=r.h),void 0!==r.alpha&&(a.alpha=r.alpha),a}var tv=function(t,r){if(!r||"hwb"!==r[0])return;let i={mode:"hwb"},[,n,a,o,s]=r;if(n.type!==G){if(n.type===q)return;i.h=n.value}if(a.type!==G){if("hue"===a.type)return;i.w=a.value/100}if(o.type!==G){if("hue"===o.type)return;i.b=o.value/100}return s.type!==G&&(i.alpha=Math.min(1,Math.max(0,s.type===U?s.value:s.value/100))),i},tx={mode:"hwb",toMode:{rgb:tg},fromMode:{rgb:ty},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[tv],serialize:t=>`hwb(${void 0!==t.h?t.h:"none"} ${void 0!==t.w?100*t.w+"%":"none"} ${void 0!==t.b?100*t.b+"%":"none"}${t.alpha<1?` / ${t.alpha}`:""})`,interpolate:{h:{use:el,fixup:eA},w:el,b:el,alpha:{use:el,fixup:eu}},difference:{h:ez},average:{h:eG}};function tb(t){if(t<0)return 0;let r=Math.pow(t,.012683313515655966);return 1e4*Math.pow(Math.max(0,r-.8359375)/(18.8515625-18.6875*r),6.277394636015326)}function t_(t){if(t<0)return 0;let r=Math.pow(t/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*r)/(1+18.6875*r),78.84375)}var tw=t=>Math.max(t/203,0),tT=({i:t,t:r,p:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=tb(t+.008609037037932761*r+.11102962500302593*i),o=tb(t-.00860903703793275*r-.11102962500302599*i),s=tb(t+.5600313357106791*r-.32062717498731885*i),l={mode:"xyz65",x:tw(2.070152218389422*a-1.3263473389671556*o+.2066510476294051*s),y:tw(.3647385209748074*a+.680566024947227*o-.0453045459220346*s),z:tw(-.049747207535812*a-.0492609666966138*o+1.1880659249923042*s)};return void 0!==n&&(l.alpha=n),l},tA=(t=0)=>Math.max(203*t,0),tM=({x:t,y:r,z:i,alpha:n})=>{let a=tA(t),o=tA(r),s=tA(i),l=t_(.3592832590121217*a+.6976051147779502*o-.0358915932320289*s),u=t_(-.1920808463704995*a+1.1004767970374323*o+.0753748658519118*s),c=t_(.0070797844607477*a+.0748396662186366*o+.8433265453898765*s),h={mode:"itp",i:.5*l+.5*u,t:1.61376953125*l-3.323486328125*u+1.709716796875*c,p:4.378173828125*l-4.24560546875*u-.132568359375*c};return void 0!==n&&(h.alpha=n),h},tk={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:tT,rgb:t=>eb(tT(t))},fromMode:{xyz65:tM,rgb:t=>tM(ey(t))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:el,t:el,p:el,alpha:{use:el,fixup:eu}}},tS=t=>{if(t<0)return 0;let r=Math.pow(t/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*r)/(1+18.6875*r),134.03437499999998)},tE=(t=0)=>Math.max(203*t,0),tD=({x:t,y:r,z:i,alpha:n})=>{t=tE(t),r=tE(r);let a=1.15*t-.15*(i=tE(i)),o=.66*r+.34*t,s=tS(.41478972*a+.579999*o+.014648*i),l=tS(-.20151*a+1.120649*o+.0531008*i),u=tS(-.0166008*a+.2648*o+.6684799*i),c=(s+l)/2,h={mode:"jab",j:.44*c/(1-.56*c)-16295499532821565e-27,a:3.524*s-4.066708*l+.542708*u,b:.199076*s+1.096799*l-1.295875*u};return void 0!==n&&(h.alpha=n),h},tC=t=>{if(t<0)return 0;let r=Math.pow(t,.007460772656268216);return 1e4*Math.pow((.8359375-r)/(18.6875*r-18.8515625),6.277394636015326)},tI=({j:t,a:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=(t+16295499532821565e-27)/(.44+.56*(t+16295499532821565e-27)),o=tC(a+.13860504*r+.058047316*i),s=tC(a-.13860504*r-.058047316*i),l=tC(a-.096019242*r-.8118919*i),u={mode:"xyz65",x:(1.661373024652174*o-.914523081304348*s+.23136208173913045*l)/203,y:(-.3250758611844533*o+1.571847026732543*s-.21825383453227928*l)/203,z:(-.090982811*o-.31272829*s+1.5227666*l)/203};return void 0!==n&&(u.alpha=n),u},tL=t=>{let r=tD(ey(t));return t.r===t.b&&t.b===t.g&&(r.a=r.b=0),r},tP=t=>eb(tI(t)),tz={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:tL,xyz65:tD},toMode:{rgb:tP,xyz65:tI},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:el,a:el,b:el,alpha:{use:el,fixup:eu}}},tF=({j:t,a:r,b:i,alpha:n})=>{void 0===r&&(r=0),void 0===i&&(i=0);let a=Math.sqrt(r*r+i*i),o={mode:"jch",j:t,c:a};return a&&(o.h=ew(180*Math.atan2(i,r)/Math.PI)),void 0!==n&&(o.alpha=n),o},tO=({j:t,c:r,h:i,alpha:n})=>{void 0===i&&(i=0);let a={mode:"jab",j:t,a:r?r*Math.cos(i/180*Math.PI):0,b:r?r*Math.sin(i/180*Math.PI):0};return void 0!==n&&(a.alpha=n),a},tR={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:tO,rgb:t=>tP(tO(t))},fromMode:{rgb:t=>tF(tL(t)),jab:tF},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:el,fixup:eA},c:el,j:el,alpha:{use:el,fixup:eu}},difference:{h:eF},average:{h:eG}},tB=t=>Math.pow(t,3)>.008856451679035631?Math.pow(t,3):(116*t-16)/903.2962962962963,tj=({l:t,a:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=(t+16)/116,o=r/500+a,s=a-i/200,l={mode:"xyz50",x:tB(o)*eX.X,y:tB(a)*eX.Y,z:tB(s)*eX.Z};return void 0!==n&&(l.alpha=n),l},tN=({x:t,y:r,z:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=ex({r:3.1341359569958707*t-1.6173863321612538*r-.4906619460083532*i,g:-.978795502912089*t+1.916254567259524*r+.03344273116131949*i,b:.07195537988411677*t-.2289768264158322*r+1.405386058324125*i});return void 0!==n&&(a.alpha=n),a},tV=t=>tN(tj(t)),tU=t=>{let{r:r,g:i,b:n,alpha:a}=eg(t),o={mode:"xyz50",x:.436065742824811*r+.3851514688337912*i+.14307845442264197*n,y:.22249319175623702*r+.7168870538238823*i+.06061979053616537*n,z:.013923904500943465*r+.09708128566574634*i+.7140993584005155*n};return void 0!==a&&(o.alpha=a),o},tq=t=>t>.008856451679035631?Math.cbrt(t):(903.2962962962963*t+16)/116,tG=({x:t,y:r,z:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=tq(t/eX.X),o=tq(r/eX.Y),s={mode:"lab",l:116*o-16,a:500*(a-o),b:200*(o-tq(i/eX.Z))};return void 0!==n&&(s.alpha=n),s},tH=t=>{let r=tG(tU(t));return t.r===t.b&&t.b===t.g&&(r.a=r.b=0),r},t$=function(t,r){if(!r||"lab"!==r[0])return;let i={mode:"lab"},[,n,a,o,s]=r;if("hue"!==n.type&&"hue"!==a.type&&"hue"!==o.type)return n.type!==G&&(i.l=Math.min(Math.max(0,n.value),100)),a.type!==G&&(i.a=a.type===U?a.value:125*a.value/100),o.type!==G&&(i.b=o.type===U?o.value:125*o.value/100),s.type!==G&&(i.alpha=Math.min(1,Math.max(0,s.type===U?s.value:s.value/100))),i},tW={mode:"lab",toMode:{xyz50:tj,rgb:tV},fromMode:{xyz50:tG,rgb:tH},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[t$],serialize:t=>`lab(${void 0!==t.l?t.l:"none"} ${void 0!==t.a?t.a:"none"} ${void 0!==t.b?t.b:"none"}${t.alpha<1?` / ${t.alpha}`:""})`,interpolate:{l:el,a:el,b:el,alpha:{use:el,fixup:eu}}},tY=p(f({},tW),{mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:eQ,rgb:e0},fromMode:{xyz65:e2,rgb:e3},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}}),tZ=function(t,r){if(!r||"lch"!==r[0])return;let i={mode:"lch"},[,n,a,o,s]=r;if(n.type!==G){if("hue"===n.type)return;i.l=Math.min(Math.max(0,n.value),100)}if(a.type!==G&&(i.c=Math.max(0,a.type===U?a.value:150*a.value/100)),o.type!==G){if(o.type===q)return;i.h=o.value}return s.type!==G&&(i.alpha=Math.min(1,Math.max(0,s.type===U?s.value:s.value/100))),i},tX={mode:"lch",toMode:{lab:eZ,rgb:t=>tV(eZ(t))},fromMode:{rgb:t=>eY(tH(t)),lab:eY},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[tZ],serialize:t=>`lch(${void 0!==t.l?t.l:"none"} ${void 0!==t.c?t.c:"none"} ${void 0!==t.h?t.h:"none"}${t.alpha<1?` / ${t.alpha}`:""})`,interpolate:{h:{use:el,fixup:eA},c:el,l:el,alpha:{use:el,fixup:eu}},difference:{h:eF},average:{h:eG}},tK=p(f({},tX),{mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:t=>eZ(t,"lab65"),rgb:t=>e0(eZ(t,"lab65"))},fromMode:{rgb:t=>eY(e3(t),"lch65"),lab65:t=>eY(t,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}}),tJ=({l:t,u:r,v:i,alpha:n})=>{void 0===r&&(r=0),void 0===i&&(i=0);let a=Math.sqrt(r*r+i*i),o={mode:"lchuv",l:t,c:a};return a&&(o.h=ew(180*Math.atan2(i,r)/Math.PI)),void 0!==n&&(o.alpha=n),o},tQ=({l:t,c:r,h:i,alpha:n})=>{void 0===i&&(i=0);let a={mode:"luv",l:t,u:r?r*Math.cos(i/180*Math.PI):0,v:r?r*Math.sin(i/180*Math.PI):0};return void 0!==n&&(a.alpha=n),a},t0=(t,r,i)=>4*t/(t+15*r+3*i),t1=(t,r,i)=>9*r/(t+15*r+3*i),t2=t0(eX.X,eX.Y,eX.Z),t3=t1(eX.X,eX.Y,eX.Z),t5=({x:t,y:r,z:i,alpha:n})=>{let a;void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let o=(a=r/eX.Y)<=.008856451679035631?903.2962962962963*a:116*Math.cbrt(a)-16,s=t0(t,r,i),l=t1(t,r,i);isFinite(s)&&isFinite(l)?(s=13*o*(s-t2),l=13*o*(l-t3)):o=s=l=0;let u={mode:"luv",l:o,u:s,v:l};return void 0!==n&&(u.alpha=n),u},t4=(i=eX.X,4*i/(i+15*eX.Y+3*eX.Z)),t6=(n=eX.X,9*(a=eX.Y)/(n+15*a+3*eX.Z)),t8=({l:t,u:r,v:i,alpha:n})=>{if(void 0===t&&(t=0),0===t)return{mode:"xyz50",x:0,y:0,z:0};void 0===r&&(r=0),void 0===i&&(i=0);let a=r/(13*t)+t4,o=i/(13*t)+t6,s=eX.Y*(t<=8?t/903.2962962962963:Math.pow((t+16)/116,3)),l={mode:"xyz50",x:9*a*s/(4*o),y:s,z:s*(12-3*a-20*o)/(4*o)};return void 0!==n&&(l.alpha=n),l},t7={mode:"lchuv",toMode:{luv:tQ,rgb:t=>tN(t8(tQ(t)))},fromMode:{rgb:t=>tJ(t5(tU(t))),luv:tJ},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:el,fixup:eA},c:el,l:el,alpha:{use:el,fixup:eu}},difference:{h:eF},average:{h:eG}},t9=p(f({},ec),{mode:"lrgb",toMode:{rgb:ex},fromMode:{rgb:eg},parse:["srgb-linear"],serialize:"srgb-linear"}),re={mode:"luv",toMode:{xyz50:t8,rgb:t=>tN(t8(t))},fromMode:{xyz50:t5,rgb:t=>t5(tU(t))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:el,u:el,v:el,alpha:{use:el,fixup:eu}}},rt=({r:t,g:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=Math.cbrt(.412221469470763*t+.5363325372617348*r+.0514459932675022*i),o=Math.cbrt(.2119034958178252*t+.6806995506452344*r+.1073969535369406*i),s=Math.cbrt(.0883024591900564*t+.2817188391361215*r+.6299787016738222*i),l={mode:"oklab",l:.210454268309314*a+.7936177747023054*o-.0040720430116193*s,a:1.9779985324311684*a-2.42859224204858*o+.450593709617411*s,b:.0259040424655478*a+.7827717124575296*o-.8086757549230774*s};return void 0!==n&&(l.alpha=n),l},rr=t=>{let r=rt(eg(t));return t.r===t.b&&t.b===t.g&&(r.a=r.b=0),r},ri=({l:t,a:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=Math.pow(t+.3963377773761749*r+.2158037573099136*i,3),o=Math.pow(t-.1055613458156586*r-.0638541728258133*i,3),s=Math.pow(t-.0894841775298119*r-1.2914855480194092*i,3),l={mode:"lrgb",r:4.076741636075957*a-3.3077115392580616*o+.2309699031821044*s,g:-1.2684379732850317*a+2.6097573492876887*o-.3413193760026573*s,b:-.0041960761386756*a-.7034186179359362*o+1.7076146940746117*s};return void 0!==n&&(l.alpha=n),l},rn=t=>ex(ri(t));function ra(t){return .5*(1.170873786407767*t-.206+Math.sqrt((1.170873786407767*t-.206)*(1.170873786407767*t-.206)+.14050485436893204*t))}function ro(t){return(t*t+.206*t)/(1.170873786407767*(t+.03))}function rs(t,r){let i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b=(-1.88170328*t-.80936493*r>1?(i=1.19086277,n=1.76576728,a=.59662641,o=.75515197,s=.56771245,l=4.0767416621,u=-3.3077115913,c=.2309699292):1.81444104*t-1.19445276*r>1?(i=.73956515,n=-.45954404,a=.08285427,o=.1254107,s=.14503204,l=-1.2684380046,u=2.6097574011,c=-.3413193965):(i=1.35733652,n=-.00915799,a=-1.1513021,o=-.50559606,s=.00692167,l=-.0041960863,u=-.7034186147,c=1.707614701),h=i+n*t+a*r+o*t*t+s*t*r,d=.3963377774*t+.2158037573*r,f=-.1055613458*t-.0638541728*r,p=-.0894841775*t-1.291485548*r,v=l*((m=1+h*d)*m*m)+u*((g=1+h*f)*g*g)+c*((y=1+h*p)*y*y),h-=v*(x=3*d*m*m*l+3*f*g*g*u+3*p*y*y*c)/(x*x-.5*v*(6*d*d*m*l+6*f*f*g*u+6*p*p*y*c))),_=ri({l:1,a:b*t,b:b*r}),w=Math.cbrt(1/Math.max(_.r,_.g,_.b));return[w,w*b]}function rl(t,r,i=null){i||(i=rs(t,r));let n=i[0],a=i[1];return[a/n,a/(1-n)]}function ru(t,r,i){let n=rs(r,i),a=function(t,r,i,n,a=null){let o;if(a||(a=rs(t,r)),(i-n)*a[1]-(a[0]-n)*1<=0)o=a[1]*n/(+a[0]+a[1]*(n-i));else{o=a[1]*(n-1)/(+(a[0]-1)+a[1]*(n-i));{let a=i-n,s=.3963377774*t+.2158037573*r,l=-.1055613458*t-.0638541728*r,u=-.0894841775*t-1.291485548*r,c=a+ +s,h=a+ +l,d=a+ +u;{let t=n*(1-o)+o*i,r=+o,a=t+r*s,f=t+r*l,p=t+r*u,m=a*a*a,g=f*f*f,y=p*p*p,v=3*c*a*a,x=3*h*f*f,b=3*d*p*p,_=6*c*c*a,w=6*h*h*f,T=6*d*d*p,A=4.0767416621*m-3.3077115913*g+.2309699292*y-1,M=4.0767416621*v-3.3077115913*x+.2309699292*b,k=M/(M*M-.5*A*(4.0767416621*_-3.3077115913*w+.2309699292*T)),S=-A*k,E=-1.2684380046*m+2.6097574011*g-.3413193965*y-1,D=-1.2684380046*v+2.6097574011*x-.3413193965*b,C=D/(D*D-.5*E*(-1.2684380046*_+2.6097574011*w-.3413193965*T)),I=-E*C,L=-.0041960863*m-.7034186147*g+1.707614701*y-1,P=-.0041960863*v-.7034186147*x+1.707614701*b,z=P/(P*P-.5*L*(-.0041960863*_-.7034186147*w+1.707614701*T)),F=-L*z;o+=Math.min(S=k>=0?S:1e6,Math.min(I=C>=0?I:1e6,F=z>=0?F:1e6))}}}return o}(r,i,t,t,n),o=rl(r,i,n),s=.11516993+1/(7.4477897+4.1590124*i+r*(-2.19557347+1.75198401*i+r*(-2.13704948-10.02301043*i+r*(-4.24894561+5.38770819*i+4.69891013*r)))),l=.11239642+1/(1.6132032-.68124379*i+r*(.40370612+.90148123*i+r*(-.27087943+.6122399*i+r*(.00299215-.45399568*i-.14661872*r)))),u=a/Math.min(t*o[0],(1-t)*o[1]),c=t*s,h=(1-t)*l,d=.9*u*Math.sqrt(Math.sqrt(1/(1/(c*c*c*c)+1/(h*h*h*h))));return[Math.sqrt(1/(1/((c=.4*t)*c)+1/((h=(1-t)*.8)*h))),d,a]}function rc(t){let r=void 0!==t.l?t.l:0,i=void 0!==t.a?t.a:0,n=void 0!==t.b?t.b:0,a={mode:"okhsl",l:ra(r)};void 0!==t.alpha&&(a.alpha=t.alpha);let o=Math.sqrt(i*i+n*n);if(!o)return a.s=0,a;let[s,l,u]=ru(r,i/o,n/o),c;if(orc(rr(t))},toMode:{oklab:rh,rgb:t=>rn(rh(t))}});function rf(t){let r=void 0!==t.l?t.l:0,i=void 0!==t.a?t.a:0,n=void 0!==t.b?t.b:0,a=Math.sqrt(i*i+n*n),o=a?i/a:1,s=a?n/a:1,[l,u]=rl(o,s),c=u/(a+r*u),h=c*r,d=c*a,f=ro(h),p=d*f/h,m=ri({l:f,a:o*p,b:s*p}),g=Math.cbrt(1/Math.max(m.r,m.g,m.b,0));r/=g;let y={mode:"okhsv",s:(a=a/g*ra(r)/r)?(.5+u)*d/(.5*u+u*(1-.5/l)*d):0,v:(r=ra(r))?r/h:0};return y.s&&(y.h=ew(180*Math.atan2(n,i)/Math.PI)),void 0!==t.alpha&&(y.alpha=t.alpha),y}function rp(t){let r={mode:"oklab"};void 0!==t.alpha&&(r.alpha=t.alpha);let i=void 0!==t.h?t.h:0,n=void 0!==t.s?t.s:0,a=void 0!==t.v?t.v:0,o=Math.cos(i/180*Math.PI),s=Math.sin(i/180*Math.PI),[l,u]=rl(o,s),c=1-.5/l,h=1-.5*n/(.5+u-u*c*n),d=n*u*.5/(.5+u-u*c*n),f=ro(h),p=d*f/h,m=ri({l:f,a:o*p,b:s*p}),g=Math.cbrt(1/Math.max(m.r,m.g,m.b,0)),y=ro(a*h),v=d*y/h;return r.l=y*g,r.a=v*o*g,r.b=v*s*g,r}var rm=p(f({},tm),{mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:rf,rgb:t=>rf(rr(t))},toMode:{oklab:rp,rgb:t=>rn(rp(t))}}),rg=function(t,r){if(!r||"oklab"!==r[0])return;let i={mode:"oklab"},[,n,a,o,s]=r;if("hue"!==n.type&&"hue"!==a.type&&"hue"!==o.type)return n.type!==G&&(i.l=Math.min(Math.max(0,n.type===U?n.value:n.value/100),1)),a.type!==G&&(i.a=a.type===U?a.value:.4*a.value/100),o.type!==G&&(i.b=o.type===U?o.value:.4*o.value/100),s.type!==G&&(i.alpha=Math.min(1,Math.max(0,s.type===U?s.value:s.value/100))),i},ry=p(f({},tW),{mode:"oklab",toMode:{lrgb:ri,rgb:rn},fromMode:{lrgb:rt,rgb:rr},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[rg],serialize:t=>`oklab(${void 0!==t.l?t.l:"none"} ${void 0!==t.a?t.a:"none"} ${void 0!==t.b?t.b:"none"}${t.alpha<1?` / ${t.alpha}`:""})`}),rv=function(t,r){if(!r||"oklch"!==r[0])return;let i={mode:"oklch"},[,n,a,o,s]=r;if(n.type!==G){if("hue"===n.type)return;i.l=Math.min(Math.max(0,n.type===U?n.value:n.value/100),1)}if(a.type!==G&&(i.c=Math.max(0,a.type===U?a.value:.4*a.value/100)),o.type!==G){if(o.type===q)return;i.h=o.value}return s.type!==G&&(i.alpha=Math.min(1,Math.max(0,s.type===U?s.value:s.value/100))),i},rx=p(f({},tX),{mode:"oklch",toMode:{oklab:t=>eZ(t,"oklab"),rgb:t=>rn(eZ(t,"oklab"))},fromMode:{rgb:t=>eY(rr(t),"oklch"),oklab:t=>eY(t,"oklch")},parse:[rv],serialize:t=>`oklch(${void 0!==t.l?t.l:"none"} ${void 0!==t.c?t.c:"none"} ${void 0!==t.h?t.h:"none"}${t.alpha<1?` / ${t.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}}),rb=t=>{let{r:r,g:i,b:n,alpha:a}=eg(t),o={mode:"xyz65",x:.486570948648216*r+.265667693169093*i+.1982172852343625*n,y:.2289745640697487*r+.6917385218365062*i+.079286914093745*n,z:0*r+.0451133818589026*i+1.043944368900976*n};return void 0!==a&&(o.alpha=a),o},r_=({x:t,y:r,z:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=ex({r:2.4934969119414263*t-.9313836179191242*r-.402710784450717*i,g:-.8294889695615749*t+1.7626640603183465*r+.0236246858419436*i,b:.0358458302437845*t-.0761723892680418*r+.9568845240076871*i},"p3");return void 0!==n&&(a.alpha=n),a},rw=p(f({},ec),{mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:t=>r_(ey(t)),xyz65:r_},toMode:{rgb:t=>eb(rb(t)),xyz65:rb}}),rT=t=>{let r=Math.abs(t);return r>=1/512?Math.sign(t)*Math.pow(r,1/1.8):16*t},rA=({x:t,y:r,z:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"prophoto",r:rT(1.3457868816471585*t-.2555720873797946*r-.0511018649755453*i),g:rT(-.5446307051249019*t+1.5082477428451466*r+.0205274474364214*i),b:rT(0*t+0*r+1.2119675456389452*i)};return void 0!==n&&(a.alpha=n),a},rM=(t=0)=>{let r=Math.abs(t);return r>=16/512?Math.sign(t)*Math.pow(r,1.8):t/16},rk=t=>{let r=rM(t.r),i=rM(t.g),n=rM(t.b),a={mode:"xyz50",x:.7977666449006423*r+.1351812974005331*i+.0313477341283922*n,y:.2880748288194013*r+.7118352342418731*i+899369387256e-16*n,z:0*r+0*i+.8251046025104602*n};return void 0!==t.alpha&&(a.alpha=t.alpha),a},rS=p(f({},ec),{mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:rA,rgb:t=>rA(tU(t))},toMode:{xyz50:rk,rgb:t=>tN(rk(t))}}),rE=t=>{let r=Math.abs(t);return r>.018053968510807?(Math.sign(t)||1)*(1.09929682680944*Math.pow(r,.45)-(1.09929682680944-1)):4.5*t},rD=({x:t,y:r,z:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"rec2020",r:rE(1.7166511879712683*t-.3556707837763925*r-.2533662813736599*i),g:rE(-.6666843518324893*t+1.6164812366349395*r+.0157685458139111*i),b:rE(.0176398574453108*t-.0427706132578085*r+.9421031212354739*i)};return void 0!==n&&(a.alpha=n),a},rC=(t=0)=>{let r=Math.abs(t);return r<.08124285829863151?t/4.5:(Math.sign(t)||1)*Math.pow((r+1.09929682680944-1)/1.09929682680944,1/.45)},rI=t=>{let r=rC(t.r),i=rC(t.g),n=rC(t.b),a={mode:"xyz65",x:.6369580483012911*r+.1446169035862083*i+.1688809751641721*n,y:.262700212011267*r+.6779980715188708*i+.059301716469862*n,z:0*r+.0280726930490874*i+1.0609850577107909*n};return void 0!==t.alpha&&(a.alpha=t.alpha),a},rL=p(f({},ec),{mode:"rec2020",fromMode:{xyz65:rD,rgb:t=>rD(ey(t))},toMode:{xyz65:rI,rgb:t=>eb(rI(t))},parse:["rec2020"],serialize:"rec2020"}),rP=Math.cbrt(.0037930732552754493),rz=t=>Math.cbrt(t)-rP,rF=t=>{let{r:r,g:i,b:n,alpha:a}=eg(t),o=rz(.3*r+.622*i+.078*n+.0037930732552754493),s=rz(.23*r+.692*i+.078*n+.0037930732552754493),l={mode:"xyb",x:(o-s)/2,y:(o+s)/2,b:rz(.2434226892454782*r+.2047674442449682*i+.5518098665095535*n+.0037930732552754493)-(o+s)/2};return void 0!==a&&(l.alpha=a),l},rO=t=>Math.pow(t+rP,3),rR=({x:t,y:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a=rO(t+r)-.0037930732552754493,o=rO(r-t)-.0037930732552754493,s=rO(i+r)-.0037930732552754493,l=ex({r:11.031566904639861*a-9.866943908131562*o-.16462299650829934*s,g:-3.2541473810744237*a+4.418770377582723*o-.16462299650829934*s,b:-3.6588512867136815*a+2.7129230459360922*o+1.9459282407775895*s});return void 0!==n&&(l.alpha=n),l},rB={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:rR},fromMode:{rgb:rF},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:el,y:el,b:el,alpha:{use:el,fixup:eu}}},rj={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:tN,lab:tG},fromMode:{rgb:tU,lab:tj},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:el,y:el,z:el,alpha:{use:el,fixup:eu}}},rN=t=>{let{x:r,y:i,z:n,alpha:a}=t;void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0);let o={mode:"xyz50",x:1.0479298208405488*r+.0229467933410191*i-.0501922295431356*n,y:.0296278156881593*r+.990434484573249*i-.0170738250293851*n,z:-.0092430581525912*r+.0150551448965779*i+.7518742899580008*n};return void 0!==a&&(o.alpha=a),o},rV=t=>{let{x:r,y:i,z:n,alpha:a}=t;void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0);let o={mode:"xyz65",x:.9554734527042182*r-.0230985368742614*i+.0632593086610217*n,y:-.0283697069632081*r+1.0099954580058226*i+.021041398966943*n,z:.0123140016883199*r-.0205076964334779*i+1.3303659366080753*n};return void 0!==a&&(o.alpha=a),o},rU={mode:"xyz65",toMode:{rgb:eb,xyz50:rN},fromMode:{rgb:ey,xyz50:rV},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:el,y:el,z:el,alpha:{use:el,fixup:eu}}},rq=({r:t,g:r,b:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"yiq",y:.29889531*t+.58662247*r+.11448223*i,i:.59597799*t-.2741761*r-.32180189*i,q:.21147017*t-.52261711*r+.31114694*i};return void 0!==n&&(a.alpha=n),a},rG=({y:t,i:r,q:i,alpha:n})=>{void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0);let a={mode:"rgb",r:t+.95608445*r+.6208885*i,g:t-.27137664*r-.6486059*i,b:t-1.10561724*r+1.70250126*i};return void 0!==n&&(a.alpha=n),a},rH={mode:"yiq",toMode:{rgb:rG},fromMode:{rgb:rq},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:el,i:el,q:el,alpha:{use:el,fixup:eu}}},r$=(t=4)=>r=>{let i;return"number"==typeof r?Math.round(r*(i=Math.pow(10,i=t)))/i:r},rW=r$(2),rY=t=>Math.max(0,Math.min(1,t||0)),rZ=t=>Math.round(255*rY(t)),rX=E("rgb"),rK=E("hsl"),rJ=t=>{if(void 0!==t)return"#"+(0x1000000|rZ(t.r)<<16|rZ(t.g)<<8|rZ(t.b)).toString(16).slice(1)},rQ=t=>{if(void 0===t)return;let r=rZ(void 0!==t.alpha?t.alpha:1);return rJ(t)+(256|r).toString(16).slice(1)},r0=t=>{if(void 0===t)return;let r=rZ(t.r),i=rZ(t.g),n=rZ(t.b);return void 0===t.alpha||1===t.alpha?`rgb(${r}, ${i}, ${n})`:`rgba(${r}, ${i}, ${n}, ${rW(rY(t.alpha))})`},r1=t=>{if(void 0===t)return;let r=rW(t.h||0),i=rW(100*rY(t.s))+"%",n=rW(100*rY(t.l))+"%";return void 0===t.alpha||1===t.alpha?`hsl(${r}, ${i}, ${n})`:`hsla(${r}, ${i}, ${n}, ${rW(rY(t.alpha))})`},r2=t=>{let r=S(t);if(!r)return;let i=F(r.mode);if(!i.serialize||"string"==typeof i.serialize){let t=`color(${i.serialize||`--${r.mode}`} `;return i.channels.forEach((i,n)=>{"alpha"!==i&&(t+=(n?" ":"")+(void 0!==r[i]?r[i]:"none"))}),void 0!==r.alpha&&r.alpha<1&&(t+=` / ${r.alpha}`),t+")"}if("function"==typeof i.serialize)return i.serialize(r)},r3=t=>rJ(rX(t)),r5=t=>rQ(rX(t)),r4=t=>r0(rX(t)),r6=t=>r1(rK(t)),r8={normal:(t,r)=>r,multiply:(t,r)=>t*r,screen:(t,r)=>t+r-t*r,"hard-light":(t,r)=>r<.5?2*t*r:2*r*(1-t)-1,overlay:(t,r)=>t<.5?2*r*t:2*t*(1-r)-1,darken:(t,r)=>Math.min(t,r),lighten:(t,r)=>Math.max(t,r),"color-dodge":(t,r)=>0===t?0:1===r?1:Math.min(1,t/(1-r)),"color-burn":(t,r)=>1===t?1:0===r?0:1-Math.min(1,(1-t)/r),"soft-light":(t,r)=>r<.5?t-(1-2*r)*t*(1-t):t+(2*r-1)*((t<.25?((16*t-12)*t+4)*t:Math.sqrt(t))-t),difference:(t,r)=>Math.abs(t-r),exclusion:(t,r)=>t+r-2*t*r},r7=(t,r="normal",i="rgb")=>{let n="function"==typeof r?r:r8[r],a=E(i),o=F(i).channels;return t.map(t=>{let r=a(t);return void 0===r.alpha&&(r.alpha=1),r}).reduce((t,r)=>{if(void 0===t)return r;let a=r.alpha+t.alpha*(1-r.alpha);return o.reduce((i,o)=>("alpha"!==o&&(0===a?i[o]=0:(i[o]=r.alpha*(1-t.alpha)*r[o]+r.alpha*t.alpha*n(t[o],r[o])+(1-r.alpha)*t.alpha*t[o],i[o]=Math.max(0,Math.min(1,i[o]/a)))),i),{mode:i,alpha:a})})},r9=(t="rgb",r={})=>{let i=F(t),n=Object.keys(r).reduce((t,i)=>{let n=r[i];return t[i]=Array.isArray(n)?n:[n,n],t},{});return i.channels.reduce((t,r)=>((n.alpha||"alpha"!==r)&&(t[r]=(([t,r])=>t+Math.random()*(r-t))(n[r]||i.ranges[r])),t),{mode:t})},ie=(t,r="rgb",i=!1)=>{let n=r?F(r).channels:null,a=r?E(r):S;return o=>{let s=a(o);if(!s)return;let l=(n||F(s.mode).channels).reduce((i,n)=>{let a=t(s[n],n,s,r);return void 0===a||isNaN(a)||(i[n]=a),i},{mode:s.mode});if(!i)return l;let u=S(o);return u&&u.mode!==l.mode?E(u.mode)(l):l}},it=(t,r,i)=>"alpha"!==r?(t||0)*(void 0!==i.alpha?i.alpha:1):t,ir=(t,r,i)=>"alpha"!==r&&0!==i.alpha?(t||0)/(void 0!==i.alpha?i.alpha:1):t,ii=(t=1,r=0)=>(i,n)=>"alpha"!==n?i*t+r:i,ia=(t=1,r=1,i=0)=>(n,a)=>"alpha"!==a?t*Math.pow(n,r)+i:n,io=(t=.5)=>r=>t<=0?1:t>=1?0:Math.pow(r,Math.log(.5)/Math.log(t)),is=(t,r="rgb",i,n)=>{let a=F(r),o=E(r),s=[],l=[],u={};t.forEach(t=>{Array.isArray(t)?(s.push(o(t[0])),l.push(t[1])):"number"==typeof t||"function"==typeof t?u[l.length]=t:(s.push(o(t)),l.push(void 0))}),(t=>{void 0===t[0]&&(t[0]=0),void 0===t[t.length-1]&&(t[t.length-1]=1);let r=1,i,n,a,o;for(;r{let n,o,l;return n=i&&"object"==typeof i&&(o=i[r])&&"object"==typeof o&&i[r].fixup?i[r].fixup:(l=a.interpolate[r])&&"object"==typeof l&&a.interpolate[r].fixup?a.interpolate[r].fixup:t=>t,t[r]=n(s.map(t=>t[r])),t},{});if(n){let t=s.map((t,i)=>a.channels.reduce((t,r)=>(t[r]=c[r][i],t),{mode:r}));c=a.channels.reduce((i,a)=>(i[a]=t.map(t=>{let i=n(t[a],a,t,r);return isNaN(i)?void 0:i}),i),{})}let h=a.channels.reduce((t,r)=>{let n,o,s;return"function"==typeof i?n=i:i&&"object"==typeof i&&"function"==typeof i[r]?n=i[r]:i&&"object"==typeof i&&(o=i[r])&&"object"==typeof o&&i[r].use?n=i[r].use:"function"==typeof a.interpolate[r]?n=a.interpolate[r]:(s=a.interpolate[r])&&"object"==typeof s&&(n=a.interpolate[r].use),t[r]=n(c[r]),t},{}),d=s.length-1;return t=>{if((t=Math.min(Math.max(0,t),1))<=l[0])return s[0];if(t>l[d])return s[d];let i=0;for(;l[i]{let i=h[r](p);return void 0!==i&&(t[r]=i),t},{mode:r})}},il=(t,r="rgb",i)=>is(t,r,i),iu=(t,r)=>(i,n="rgb",a)=>{let o=r?ie(r,n):void 0,s=is(i,n,a,t);return o?t=>o(s(t)):s},ic=iu(it,ir),ih=(t,r,i,n,a)=>{let o=a*a,s=o*a;return((1-3*a+3*o-s)*t+(4-6*o+3*s)*r+(1+3*a+3*o-3*s)*i+s*n)/6},id=t=>r=>{let i=t.length-1,n=r>=1?i-1:Math.max(0,Math.floor(r*i));return ih(n>0?t[n-1]:2*t[n]-t[n+1],t[n],t[n+1],nr=>{let i,n,a,o,s=t.length-1,l=Math.floor(r*s);return ih(t[(l-1+(i=t.length))%i],t[(l+(n=t.length))%n],t[(l+1+(a=t.length))%a],t[(l+2+(o=t.length))%o],(r-l/s)*s)},im=t=>{let r,i=t.length-1,n=Array(i),a=Array(i),o=Array(i);for(n[1]=1/4,a[1]=(6*t[1]-t[0])/4,r=2;r0&&(o[i-1]=a[i-1]),r=i-2;r>0;--r)o[r]=a[r]-n[r]*o[r+1];return o},ig=t=>id(im(t)),iy=t=>ip(im(t)),iv=Math.sign,ix=Math.min,ib=Math.abs,i_=t=>{let r=t.length-1,i=[],n=[],a=[];for(let o=0;o0?.5*(t[o+1]-t[o-1])*r:void 0),a.push(o>0?(iv(i[o-1])+iv(i[o]))*ix(ib(i[o-1]),ib(i[o]),.5*ib(n[o])):void 0);return[i,n,a]},iw=(t,r,i)=>{let n=t.length-1,a=n*n;return o=>{let s;s=o>=1?n-1:Math.max(0,Math.floor(o*n));let l=o-s/n,u=l*l;return(r[s]+r[s+1]-2*i[s])*a*(u*l)+(3*i[s]-2*r[s]-r[s+1])*n*u+r[s]*l+t[s]}},iT=t=>{if(t.length<3)return el(t);let r=t.length-1,[i,,n]=i_(t);return n[0]=i[0],n[r]=i[r-1],iw(t,n,i)},iA=t=>{if(t.length<3)return el(t);let r=t.length-1,[i,n,a]=i_(t);return n[0]=(2*t[1]-1.5*t[0]-.5*t[2])*r,n[r]=(1.5*t[r]-2*t[r-1]+.5*t[r-2])*r,a[0]=n[0]*i[0]<=0?0:ib(n[0])>2*ib(i[0])?2*i[0]:n[0],a[r]=n[r]*i[r-1]<=0?0:ib(n[r])>2*ib(i[r-1])?2*i[r-1]:n[r],iw(t,a,i)},iM=t=>{let r=t.length-1,[i,n,a]=i_(t);n[0]=.5*(t[1]-t[r])*r,n[r]=.5*(t[0]-t[r-1])*r;let o=(t[0]-t[r])*r;return a[0]=(iv(o)+iv(i[0]))*ix(ib(o),ib(i[0]),.5*ib(n[0])),a[r]=(iv(i[r-1])+iv(o))*ix(ib(i[r-1]),ib(o),.5*ib(n[r])),iw(t,a,i)},ik=(t=1)=>1===t?t=>t:r=>Math.pow(r,t),iS=(t=2,r=1)=>{let i=ik(r);if(t<2)return t<1?[]:[i(.5)];let n=[];for(let r=0;r{let r={mode:t.mode,r:Math.max(0,Math.min(void 0!==t.r?t.r:0,1)),g:Math.max(0,Math.min(void 0!==t.g?t.g:0,1)),b:Math.max(0,Math.min(void 0!==t.b?t.b:0,1))};return void 0!==t.alpha&&(r.alpha=t.alpha),r},iC=t=>iD(iE(t)),iI=t=>void 0!==t&&(void 0===t.r||t.r>=0&&t.r<=1)&&(void 0===t.g||t.g>=0&&t.g<=1)&&(void 0===t.b||t.b>=0&&t.b<=1);function iL(t){return iI(iE(t))}function iP(t="rgb"){let{gamut:r}=F(t);if(!r)return t=>!0;let i=E("string"==typeof r?r:t);return t=>iI(i(t))}function iz(t){return void 0===(t=S(t))||iL(t)?t:E(t.mode)(iC(t))}function iF(t="rgb"){let{gamut:r}=F(t);if(!r)return t=>S(t);let i="string"==typeof r?r:t,n=E(i),a=iP(i);return t=>{let r=S(t);if(!r)return;let i=n(r);if(a(i))return r;let o=iD(i);return r.mode===o.mode?o:E(r.mode)(o)}}function iO(t,r="lch",i="rgb"){t=S(t);let n="rgb"===i?iL:iP(i),a="rgb"===i?iC:iF(i);if(void 0===t||n(t))return t;let o=E(t.mode),s=p(f({},t=E(r)(t)),{c:0});if(!n(s))return o(a(s));let l=0,u=void 0!==t.c?t.c:0,c=F(r).ranges.c,h=(c[1]-c[0])/8192,d=s.c;for(;u-l>h;)s.c=l+(u-l)*.5,n(s)?(d=s.c,l=s.c):u=s.c;return o(n(s)?s:p(f({},s),{c:d}))}function iR(t="rgb",r="oklch",i=eO("oklch"),n=.02){let a=E(t),o=F(t);if(!o.gamut)return t=>a(t);let s=iP(t),l=iF(t),u=E(r),{ranges:c}=F(r);if(!c.l||!c.c)throw Error("LCH-like space expected");return r=>{if(void 0===(r=S(r)))return;let h=f({},u(r));if(void 0===h.l&&(h.l=0),void 0===h.c&&(h.c=0),h.l>=c.l[1]){let i=p(f({},o.white),{mode:t});return void 0!==r.alpha&&(i.alpha=r.alpha),i}if(h.l<=c.l[0]){let i=p(f({},o.black),{mode:t});return void 0!==r.alpha&&(i.alpha=r.alpha),i}if(s(h))return a(h);let d=0,m=h.c,g=(c.c[1]-c.c[0])/4e3,y=l(h);for(;m-d>g;)h.c=(d+m)*.5,y=l(h),s(h)||i&&n>0&&i(h,y)<=n?d=h.c:m=h.c;return a(s(h)?h:y)}}var iB=(t,r=eO(),i=t=>t)=>{let n=t.map((t,r)=>({color:i(t),i:r}));return(i,a=1,o=1/0)=>(isFinite(a)&&(a=Math.max(1,Math.min(a,n.length-1))),n.forEach(t=>{t.d=r(i,t.color)}),n.sort((t,r)=>t.d-r.d).slice(0,a).filter(t=>t.dt[r.i]))},ij=t=>Math.max(Math.min(t,1),0),iN=(t,r,i=!1)=>{let n=E(r),a=F(r).channels;return o=>{let s=n(o);if(!s)return;let l={mode:r},u,c=a.length;for(let r=0;rie(ii(Math.max(t,0)),r,!0),iU=(t=1,r="rgb")=>{let i=Math.max(t,0);return ie(ii(i,(1-i)/2),r,!0)},iq=(t=1,r="rgb")=>{let i;return iN([.393+.607*(i=1-ij(t)),.769-.769*i,.189-.189*i,0,.349-.349*i,.686+.314*i,.168-.168*i,0,.272-.272*i,.534-.534*i,.131+.869*i,0,0,0,0,1],r,!0)},iG=(t=1,r="rgb")=>{let i;return iN([.213+.787*(i=Math.max(t,0)),.715-.715*i,.072-.072*i,0,.213-.213*i,.715+.285*i,.072-.072*i,0,.213-.213*i,.715-.715*i,.072+.928*i,0,0,0,0,1],r,!0)},iH=(t=1,r="rgb")=>{let i;return iN([.2126+.7874*(i=1-ij(t)),.7152-.7152*i,.0722-.0722*i,0,.2126-.2126*i,.7152+.2848*i,.0722-.0722*i,0,.2126-.2126*i,.7152-.7152*i,.0722+.9278*i,0,0,0,0,1],r,!0)},i$=(t=1,r="rgb")=>{let i=ij(t);return ie((t,r)=>{let n;return"alpha"===r?t:(n=1-i,void 0===i||void 0===n?void 0:i+t*(n-i))},r,!0)},iW=(t=0,r="rgb")=>{let i,n,a;return iN([.213+.787*(n=Math.cos(i=Math.PI*t/180))-.213*(a=Math.sin(i)),.715-.715*n-.715*a,.072-.072*n+.928*a,0,.213-.213*n+.143*a,.715+.285*n+.14*a,.072-.072*n-.283*a,0,.213-.213*n-.787*a,.715-.715*n+.715*a,.072+.928*n+.072*a,0,0,0,0,1],r,!0)},iY=E("rgb"),iZ=[[1,0,-0,0,1,0,-0,-0,1],[.856167,.182038,-.038205,.029342,.955115,.015544,-.00288,-.001563,1.004443],[.734766,.334872,-.069637,.05184,.919198,.028963,-.004928,-.004209,1.009137],[.630323,.465641,-.095964,.069181,.890046,.040773,-.006308,-.007724,1.014032],[.539009,.579343,-.118352,.082546,.866121,.051332,-.007136,-.011959,1.019095],[.458064,.679578,-.137642,.092785,.846313,.060902,-.007494,-.016807,1.024301],[.38545,.769005,-.154455,.100526,.829802,.069673,-.007442,-.02219,1.029632],[.319627,.849633,-.169261,.106241,.815969,.07779,-.007025,-.028051,1.035076],[.259411,.923008,-.18242,.110296,.80434,.085364,-.006276,-.034346,1.040622],[.203876,.990338,-.194214,.112975,.794542,.092483,-.005222,-.041043,1.046265],[.152286,1.052583,-.204868,.114503,.786281,.099216,-.003882,-.048116,1.051998]],iX=[[1,0,-0,0,1,0,-0,-0,1],[.866435,.177704,-.044139,.049567,.939063,.01137,-.003453,.007233,.99622],[.760729,.319078,-.079807,.090568,.889315,.020117,-.006027,.013325,.992702],[.675425,.43385,-.109275,.125303,.847755,.026942,-.00795,.018572,.989378],[.605511,.52856,-.134071,.155318,.812366,.032316,-.009376,.023176,.9862],[.547494,.607765,-.155259,.181692,.781742,.036566,-.01041,.027275,.983136],[.498864,.674741,-.173604,.205199,.754872,.039929,-.011131,.030969,.980162],[.457771,.731899,-.18967,.226409,.731012,.042579,-.011595,.034333,.977261],[.422823,.781057,-.203881,.245752,.709602,.044646,-.011843,.037423,.974421],[.392952,.82361,-.216562,.263559,.69021,.046232,-.01191,.040281,.97163],[.367322,.860646,-.227968,.280085,.672501,.047413,-.01182,.04294,.968881]],iK=[[1,0,-0,0,1,0,-0,-0,1],[.92667,.092514,-.019184,.021191,.964503,.014306,.008437,.054813,.93675],[.89572,.13333,-.02905,.029997,.9454,.024603,.013027,.104707,.882266],[.905871,.127791,-.033662,.026856,.941251,.031893,.01341,.148296,.838294],[.948035,.08949,-.037526,.014364,.946792,.038844,.010853,.193991,.795156],[1.017277,.027029,-.044306,-.006113,.958479,.047634,.006379,.248708,.744913],[1.104996,-.046633,-.058363,-.032137,.971635,.060503,.001336,.317922,.680742],[1.193214,-.109812,-.083402,-.058496,.97941,.079086,-.002346,.403492,.598854],[1.257728,-.139648,-.118081,-.078003,.975409,.102594,-.003316,.501214,.502102],[1.278864,-.125333,-.153531,-.084748,.957674,.127074,-989e-6,.601151,.399838],[1.255528,-.076749,-.178779,-.078411,.930809,.147602,.004733,.691367,.3039]],iJ=(t,r)=>{let i=Math.max(0,Math.min(1,r)),n=Math.round(i/.1),a=Math.round(i%.1),o=t[n];if(a>0&&nei(o[i],r[i],a))}return t=>{let r=S(t);if(void 0===r)return;let{r:i,g:n,b:a}=iY(r),s={mode:"rgb",r:o[0]*i+o[1]*n+o[2]*a,g:o[3]*i+o[4]*n+o[5]*a,b:o[6]*i+o[7]*n+o[8]*a};return void 0!==r.alpha&&(s.alpha=r.alpha),E(r.mode)(s)}},iQ=(t=1)=>iJ(iZ,t),i0=(t=1)=>iJ(iX,t),i1=(t=1)=>iJ(iK,t),i2=t=>t*t*(3-2*t),i3=t=>.5-Math.sin(Math.asin(1-2*t)/3),i5=t=>t*t*t*(t*(6*t-15)+10),i4=t=>(1-Math.cos(t*Math.PI))/2;function i6(t){let r=E("lrgb")(t);return .2126*r.r+.7152*r.g+.0722*r.b}function i8(t,r){let i=i6(t),n=i6(r);return(Math.max(i,n)+.05)/(Math.min(i,n)+.05)}var i7=z(e_),i9=z(eW),ne=z(tr),nt=z(ti),nr=z(to),ni=z(td),nn=z(tm),na=z(tx),no=z(tk),ns=z(tz),nl=z(tR),nu=z(tW),nc=z(tY),nh=z(tX),nd=z(tK),nf=z(t7),np=z(t9),nm=z(re),ng=z(rd),ny=z(rm),nv=z(ry),nx=z(rx),nb=z(rw),n_=z(rS),nw=z(rL),nT=z(ec),nA=z(rB),nM=z(rj),nk=z(rU),nS=z(rH)}}),Q=g({"src/plot_api/plot_config.js"(t,r){var i={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:"https://cloud.plotly.com/newchart"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:500,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},displayNotifier:{valType:"boolean",dflt:!0},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!0},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},n={};(function t(r,i){for(var n in r){var a=r[n];a.valType?i[n]=a.dflt:(i[n]||(i[n]={}),t(a,i[n]))}})(i,n),r.exports={configAttributes:i,dfltConfig:n}}}),ee=g({"src/lib/notifier.js"(t,r){var i=k(),n=L(),a=[];r.exports=function(t,r,o){if((null==(s=o?._context)?void 0:s.displayNotifier)!==!1&&-1===a.indexOf(t)){a.push(t);var s,l=1e3;n(r)?l=r:"long"===r&&(l=3e3);var u=i.select("body").selectAll(".plotly-notifier").data([0]);u.enter().append("div").classed("plotly-notifier",!0),u.selectAll(".notifier-note").data(a).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var n=i.select(this);n.append("button").classed("notifier-close",!0).html("×").on("click",function(){n.transition().call(c)});for(var a=n.append("p"),o=t.split(//g),s=0;s1){var r=["LOG:"];for(t=0;t1){var a=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(i.logging>0){var r=["WARN:"];for(t=0;t0){var a=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(i.logging>0){var r=["ERROR:"];for(t=0;t0){var a=[];for(t=0;t"),"stick")}}}}),er=g({"src/components/color/attributes.js"(t){t.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],t.defaultLine="#444",t.lightLine="#eee",t.background="#fff",t.borderLine="#BEC8D9",t.lightFraction=1e3/11}}),ei=g({"src/components/color/index.js"(t,r){var{converter:i,formatHex:n,formatRgb:a,wcagContrast:o,wcagLuminance:s}=J(),{isArrayOrTypedArray:l}=O(),{warn:u}=et(),{background:c,defaultLine:h,defaults:d,lightLine:m}=er(),g=i("rgb"),y=i("hsl"),v=t=>{if("string"!=typeof t)return;let r=t.trim().toLowerCase();if(!/^[0-9a-f]+$/.test(r))try{return g(r)}catch{return}},x=t=>t>0?t>1?1:t:0,b={mode:"rgb",r:0,g:0,b:0,alpha:1},_=t=>Math.round(255e6*t)/255e6,w=t=>p(f({},t),{r:_(t.r),g:_(t.g),b:_(t.b)}),T=t=>a(w(t)),A=(t,r)=>{var i,n,a,o;let s=v(t);return s?(null!=s.alpha||(s.alpha=1),s):(r||null==t||u(`Invalid color specifier: ${"string"==typeof t?`"${t}"`:l(t)?`${null!=(n=null==(i=t.constructor)?void 0:i.name)?n:"Array"}(${t.length})`:"object"==typeof t?null!=(o=null==(a=t.constructor)?void 0:a.name)?o:"Object":`${typeof t} ${t}`}. Defaulting to "#000"`),b)},M=t=>T(p(f({},A(t)),{alpha:1})),k=t=>l(t)&&t.length>2&&Number.isFinite(t[0])&&Number.isFinite(t[1])&&Number.isFinite(t[2]),S=(t,r)=>{let i=A(t),n=i.alpha;if(1===n)return T(i);let a=A(r||c),o=a.alpha,s=(t,r)=>(1===o?r:1-o+r*o)*(1-n)+t*n;return T({mode:"rgb",r:s(i.r,a.r),g:s(i.g,a.g),b:s(i.b,a.b)})},E=(t,r)=>{let i=A(t),n=y(i)||{mode:"hsl",h:0,s:0,l:0};return T(g(p(f({},n),{l:x((100*n.l+r)/100),alpha:i.alpha})))},D=(t,r)=>o(A(t),A(r)),C=t=>D(t,c)>D(t,h),I=T(A(c)),L=T(A(h));r.exports={addOpacity:(t,r)=>T(p(f({},A(t)),{alpha:x(r)})),adjustLightness:E,background:c,brighten:(t,r)=>{r=0===r?0:r||10;let i=A(t),n=r/100;return T(p(f({},i),{r:x(i.r+n),g:x(i.g+n),b:x(i.b+n)}))},combine:S,contrast:(t,r,i)=>(1!==A(t).alpha&&(t=S(t,c)),C(t)?r?E(t,r):I:i?E(t,-i):L),defaultLine:h,defaults:d,equals:(t,r)=>!!(t&&r&&M(t)===M(r)),fill:(t,r)=>{t.style({fill:M(r),"fill-opacity":A(r).alpha})},hexString:t=>n(w(A(t))).toUpperCase(),interpolate:(t,r,i)=>{let n=A(t),a=A(r),o=(t,r)=>i*t+(1-i)*r;return T({mode:"rgb",r:o(n.r,a.r),g:o(n.g,a.g),b:o(n.b,a.b)})},isChannelArray:k,isDark:C,isValid:t=>void 0!==v(t),lightLine:m,luminosity:t=>{let r=A(t);return s({mode:"rgb",r:x(r.r),g:x(r.g),b:x(r.b)})},mix:(t,r,i)=>{let n=A(t),a=A(r),o=i/100,s=a.alpha-n.alpha,l=2*o-1,u=((l*s==-1?l:(l+s)/(1+l*s))+1)/2,c=1-u,h=(t,r)=>c*t+u*r;return T({mode:"rgb",r:h(n.r,a.r),g:h(n.g,a.g),b:h(n.b,a.b),alpha:n.alpha*(1-o)+a.alpha*o})},mostReadable:(t,r=["#000","#fff"])=>{let i,n=-1/0;for(let a of r){let r=D(t,a);r>n&&(n=r,i=T(A(a)))}return i},normalize:(t,r)=>{let i=k(t)?(t=>{let[r,i,n,a]=t,o=Math.max(r,i,n)>1?1/255:1,s=a??1;return{mode:"rgb",r:r*o,g:i*o,b:n*o,alpha:s>1?s/255:s}})(t):A(t,!0),n=[x(i.r),x(i.g),x(i.b),x(i.alpha)];return"uint8"===r||"uint8_clamped"===r?Uint8Array.from(n,t=>Math.round(255*t)):"float32"===r?Float32Array.from(n):"float64"===r?Float64Array.from(n):n},opacity:t=>t?A(t).alpha:0,parse:A,rgb:M,rgbaArray:t=>{let r=A(t);return[255*x(r.r),255*x(r.g),255*x(r.b),x(r.alpha)]},rgbaArrayToString:([t,r,i,n])=>T({mode:"rgb",r:t/255,g:r/255,b:i/255,alpha:n}),rgbaString:t=>T(A(t)),stroke:(t,r)=>{t.style({stroke:M(r),"stroke-opacity":A(r).alpha})},wcagContrast:D}}}),en=g({"src/components/colorscale/scales.js"(t,r){var i=ei(),n={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},a=n.RdBu;function o(t){var r=0;if(!Array.isArray(t)||t.length<2||!t[0]||!t[t.length-1]||0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var n=0;nes});var el,eu=m({"src/lib/regex.ts"(){el="([2-9]|[1-9][0-9]+)?"}}),ec=g({"src/lib/coerce.js"(t){var r=L(),i=$().extendFlat,n=K(),a=en(),o=ei(),s=ea().DESELECTDIM,l=R(),u=(eu(),b(eo)).counter,c=(H(),b(U)).modHalf,h=O().isArrayOrTypedArray,d=O().isTypedArraySpec,f=O().decodeTypedArraySpec;function p(r,i){var n=t.valObjectMeta[i.valType];if(i.arrayOk&&h(r))return!0;if(n.validateFunction)return n.validateFunction(r,i);var a={},o=a;return n.coerceFunction(r,{set:function(t){o=t}},a,i),o!==a}t.valObjectMeta={data_array:{coerceFunction:function(t,r,i){r.set(h(t)?t:d(t)?f(t):i)}},enumerated:{coerceFunction:function(t,r,i,n){n.coerceNumber&&(t*=1),-1===n.values.indexOf(t)?r.set(i):r.set(t)},validateFunction:function(t,r){r.coerceNumber&&(t*=1);for(var i=r.values,n=0;n!0===t||!1===t;a(t)||n.arrayOk&&Array.isArray(t)&&t.length>0&&t.every(a)?r.set(t):r.set(i)}},number:{coerceFunction:function(t,i,n,a){d(t)&&(t=f(t)),!r(t)||void 0!==a.min&&ta.max?i.set(n):i.set(+t)}},integer:{coerceFunction:function(t,i,n,a){-1!==(a.extras||[]).indexOf(t)?i.set(t):(d(t)&&(t=f(t)),t%1||!r(t)||void 0!==a.min&&ta.max?i.set(n):i.set(+t))}},string:{coerceFunction:function(t,r,i,n){if("string"!=typeof t){var a="number"==typeof t;!0!==n.strict&&a?r.set(String(t)):r.set(i)}else n.noBlank&&!t?r.set(i):r.set(t)}},color:{coerceFunction:function(t,r,i){d(t)&&(t=f(t)),o.isValid(t)?r.set(t):r.set(i)}},colorlist:{coerceFunction:function(t,r,i){Array.isArray(t)&&t.length&&t.every(t=>o.isValid(t))?r.set(t):r.set(i)}},colorscale:{coerceFunction:function(t,r,i){r.set(a.get(t,i))}},angle:{coerceFunction:function(t,i,n){d(t)&&(t=f(t)),"auto"===t?i.set("auto"):r(t)?i.set(c(+t,360)):i.set(n)}},subplotid:{coerceFunction:function(t,r,i,n){var a=n.regex||u(i);let o=t=>"string"==typeof t&&a.test(t);o(t)||n.arrayOk&&h(t)&&t.length>0&&t.every(o)?r.set(t):r.set(i)},validateFunction:function(t,r){var i=r.dflt;return t===i||"string"==typeof t&&!!u(i).test(t)}},flaglist:{coerceFunction:function(t,r,i,n){if(-1!==(n.extras||[]).indexOf(t))return void r.set(t);if("string"!=typeof t)return void r.set(i);for(var a=t.split("+"),o=0;oMath.abs(L)?null:(D*=L=1/L,C*=L,I*=L,a=Math.sin(i),s=1-(o=Math.cos(i)),l=r[0],u=r[1],c=r[2],h=r[3],d=r[4],f=r[5],p=r[6],m=r[7],g=r[8],y=r[9],v=r[10],x=r[11],b=D*D*s+o,_=C*D*s+I*a,w=I*D*s-C*a,T=D*C*s-I*a,A=C*C*s+o,M=I*C*s+D*a,k=D*I*s+C*a,S=C*I*s-D*a,E=I*I*s+o,t[0]=l*b+d*_+g*w,t[1]=u*b+f*_+y*w,t[2]=c*b+p*_+v*w,t[3]=h*b+m*_+x*w,t[4]=l*T+d*A+g*M,t[5]=u*T+f*A+y*M,t[6]=c*T+p*A+v*M,t[7]=h*T+m*A+x*M,t[8]=l*k+d*S+g*E,t[9]=u*k+f*S+y*E,t[10]=c*k+p*S+v*E,t[11]=h*k+m*S+x*E,r!==t&&(t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t)}}}),eM=g({"node_modules/gl-mat4/rotateX.js"(t,r){r.exports=function(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[4],s=r[5],l=r[6],u=r[7],c=r[8],h=r[9],d=r[10],f=r[11];return r!==t&&(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[4]=o*a+c*n,t[5]=s*a+h*n,t[6]=l*a+d*n,t[7]=u*a+f*n,t[8]=c*a-o*n,t[9]=h*a-s*n,t[10]=d*a-l*n,t[11]=f*a-u*n,t}}}),ek=g({"node_modules/gl-mat4/rotateY.js"(t,r){r.exports=function(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[0],s=r[1],l=r[2],u=r[3],c=r[8],h=r[9],d=r[10],f=r[11];return r!==t&&(t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[0]=o*a-c*n,t[1]=s*a-h*n,t[2]=l*a-d*n,t[3]=u*a-f*n,t[8]=o*n+c*a,t[9]=s*n+h*a,t[10]=l*n+d*a,t[11]=u*n+f*a,t}}}),eS=g({"node_modules/gl-mat4/rotateZ.js"(t,r){r.exports=function(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[0],s=r[1],l=r[2],u=r[3],c=r[4],h=r[5],d=r[6],f=r[7];return r!==t&&(t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[0]=o*a+c*n,t[1]=s*a+h*n,t[2]=l*a+d*n,t[3]=u*a+f*n,t[4]=c*a-o*n,t[5]=h*a-s*n,t[6]=d*a-l*n,t[7]=f*a-u*n,t}}}),eE=g({"node_modules/gl-mat4/fromRotation.js"(t,r){r.exports=function(t,r,i){var n,a,o,s=i[0],l=i[1],u=i[2],c=Math.sqrt(s*s+l*l+u*u);return 1e-6>Math.abs(c)?null:(s*=c=1/c,l*=c,u*=c,n=Math.sin(r),o=1-(a=Math.cos(r)),t[0]=s*s*o+a,t[1]=l*s*o+u*n,t[2]=u*s*o-l*n,t[3]=0,t[4]=s*l*o-u*n,t[5]=l*l*o+a,t[6]=u*l*o+s*n,t[7]=0,t[8]=s*u*o+l*n,t[9]=l*u*o-s*n,t[10]=u*u*o+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}}}),eD=g({"node_modules/gl-mat4/fromRotationTranslation.js"(t,r){r.exports=function(t,r,i){var n=r[0],a=r[1],o=r[2],s=r[3],l=n+n,u=a+a,c=o+o,h=n*l,d=n*u,f=n*c,p=a*u,m=a*c,g=o*c,y=s*l,v=s*u,x=s*c;return t[0]=1-(p+g),t[1]=d+x,t[2]=f-v,t[3]=0,t[4]=d-x,t[5]=1-(h+g),t[6]=m+y,t[7]=0,t[8]=f+v,t[9]=m-y,t[10]=1-(h+p),t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t}}}),eC=g({"node_modules/gl-mat4/fromScaling.js"(t,r){r.exports=function(t,r){return t[0]=r[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=r[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),eI=g({"node_modules/gl-mat4/fromTranslation.js"(t,r){r.exports=function(t,r){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}}}),eL=g({"node_modules/gl-mat4/fromXRotation.js"(t,r){r.exports=function(t,r){var i=Math.sin(r),n=Math.cos(r);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=i,t[7]=0,t[8]=0,t[9]=-i,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),eP=g({"node_modules/gl-mat4/fromYRotation.js"(t,r){r.exports=function(t,r){var i=Math.sin(r),n=Math.cos(r);return t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=i,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),ez=g({"node_modules/gl-mat4/fromZRotation.js"(t,r){r.exports=function(t,r){var i=Math.sin(r),n=Math.cos(r);return t[0]=n,t[1]=i,t[2]=0,t[3]=0,t[4]=-i,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),eF=g({"node_modules/gl-mat4/fromQuat.js"(t,r){r.exports=function(t,r){var i=r[0],n=r[1],a=r[2],o=r[3],s=i+i,l=n+n,u=a+a,c=i*s,h=n*s,d=n*l,f=a*s,p=a*l,m=a*u,g=o*s,y=o*l,v=o*u;return t[0]=1-d-m,t[1]=h+v,t[2]=f-y,t[3]=0,t[4]=h-v,t[5]=1-c-m,t[6]=p+g,t[7]=0,t[8]=f+y,t[9]=p-g,t[10]=1-c-d,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}}}),eO=g({"node_modules/gl-mat4/frustum.js"(t,r){r.exports=function(t,r,i,n,a,o,s){var l=1/(i-r),u=1/(a-n),c=1/(o-s);return t[0]=2*o*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(i+r)*l,t[9]=(a+n)*u,t[10]=(s+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*c,t[15]=0,t}}}),eR=g({"node_modules/gl-mat4/perspective.js"(t,r){r.exports=function(t,r,i,n,a){var o=1/Math.tan(r/2),s=1/(n-a);return t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+n)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*n*s,t[15]=0,t}}}),eB=g({"node_modules/gl-mat4/perspectiveFromFieldOfView.js"(t,r){r.exports=function(t,r,i,n){var a=Math.tan(r.upDegrees*Math.PI/180),o=Math.tan(r.downDegrees*Math.PI/180),s=Math.tan(r.leftDegrees*Math.PI/180),l=Math.tan(r.rightDegrees*Math.PI/180),u=2/(s+l),c=2/(a+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((s-l)*u*.5),t[9]=(a-o)*c*.5,t[10]=n/(i-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*i/(i-n),t[15]=0,t}}}),ej=g({"node_modules/gl-mat4/ortho.js"(t,r){r.exports=function(t,r,i,n,a,o,s){var l=1/(r-i),u=1/(n-a),c=1/(o-s);return t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(r+i)*l,t[13]=(a+n)*u,t[14]=(s+o)*c,t[15]=1,t}}}),eN=g({"node_modules/gl-mat4/lookAt.js"(t,r){var i=eg();r.exports=function(t,r,n,a){var o,s,l,u,c,h,d,f,p,m,g=r[0],y=r[1],v=r[2],x=a[0],b=a[1],_=a[2],w=n[0],T=n[1],A=n[2];return 1e-6>Math.abs(g-w)&&1e-6>Math.abs(y-T)&&1e-6>Math.abs(v-A)?i(t):(m=1/Math.sqrt((d=g-w)*d+(f=y-T)*f+(p=v-A)*p),d*=m,f*=m,p*=m,(m=Math.sqrt((o=b*p-_*f)*o+(s=_*d-x*p)*s+(l=x*f-b*d)*l))?(o*=m=1/m,s*=m,l*=m):(o=0,s=0,l=0),(m=Math.sqrt((u=f*l-p*s)*u+(c=p*o-d*l)*c+(h=d*s-f*o)*h))?(u*=m=1/m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=d,t[3]=0,t[4]=s,t[5]=c,t[6]=f,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=-(o*g+s*y+l*v),t[13]=-(u*g+c*y+h*v),t[14]=-(d*g+f*y+p*v),t[15]=1,t)}}}),eV=g({"node_modules/gl-mat4/str.js"(t,r){r.exports=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}}}),eU=g({"node_modules/gl-mat4/index.js"(t,r){r.exports={create:ef(),clone:ep(),copy:em(),identity:eg(),transpose:ey(),invert:ev(),adjoint:ex(),determinant:eb(),multiply:e_(),translate:ew(),scale:eT(),rotate:eA(),rotateX:eM(),rotateY:ek(),rotateZ:eS(),fromRotation:eE(),fromRotationTranslation:eD(),fromScaling:eC(),fromTranslation:eI(),fromXRotation:eL(),fromYRotation:eP(),fromZRotation:ez(),fromQuat:eF(),frustum:eO(),perspective:eR(),perspectiveFromFieldOfView:eB(),ortho:ej(),lookAt:eN(),str:eV()}}}),eq=g({"src/lib/matrix.js"(t){var r=eU();t.init2dArray=function(t,r){for(var i=Array(t),n=0;nf({valType:"string",dflt:"",editType:t},!1!==r?{arrayOk:!0}:{}),t.texttemplateAttrs=({editType:t="calc",arrayOk:r}={},i={})=>f({valType:"string",dflt:"",editType:t},!1!==r?{arrayOk:!0}:{}),t.shapeTexttemplateAttrs=({editType:t="arraydraw",newshape:r}={},i={})=>({valType:"string",dflt:"",editType:t}),t.templatefallbackAttrs=({editType:t="none"}={})=>({valType:"any",dflt:"-",editType:t})}}),eX=g({"src/components/shapes/label_texttemplate.js"(t,r){function i(t,r){return r?r.d2l(t):t}function n(t){return t.x0shift||0}function a(t){return t.x1shift||0}function o(t){return t.y0shift||0}function s(t){return t.y1shift||0}function l(t,r){return i(t.x1,r)+a(t)-i(t.x0,r)-n(t)}function u(t,r,n){return i(t.y1,n)+s(t)-i(t.y0,n)-o(t)}r.exports={x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},slope:function(t,r,i){return"line"!==t.type?void 0:u(t,r,i)/l(t,r)},dx:l,dy:u,width:function(t,r){return Math.abs(l(t,r))},height:function(t,r,i){return Math.abs(u(t,r,i))},length:function(t,r,i){return"line"!==t.type?void 0:Math.sqrt(Math.pow(l(t,r),2)+Math.pow(u(t,r,i),2))},xcenter:function(t,r){var o;return o=(i(t.x1,r)+a(t)+i(t.x0,r)+n(t))/2,r?r.l2d(o):o},ycenter:function(t,r,n){var a;return a=(i(t.y1,n)+s(t)+i(t.y0,n)+o(t))/2,n?n.l2d(a):a},simpleXVariables:["x0","x1","y0","y1","dy","height","ycenter"],simpleYVariables:["x0","x1","y0","y1","dx","width","xcenter"]}}}),eK=g({"src/components/shapes/draw_newshape/attributes.js"(t,r){var i=e$().overrideAll,n=K(),a=W(),o=eW().dash,s=$().extendFlat,{shapeTexttemplateAttrs:l,templatefallbackAttrs:u}=eZ(),c=eX();r.exports=i({newshape:{visible:s({},n.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:s({},n.legend,{}),legendgroup:s({},n.legendgroup,{}),legendgrouptitle:{text:s({},n.legendgrouptitle.text,{}),font:a({})},legendrank:s({},n.legendrank,{}),legendwidth:s({},n.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:s({},o,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:s({},n.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:l({newshape:!0},{keys:Object.keys(c)}),texttemplatefallback:u({editType:"arraydraw"}),font:a({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),eJ=g({"src/components/selections/draw_newselection/attributes.js"(t,r){var i=eW().dash;r.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:(0,$().extendFlat)({},i,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),eQ=g({"src/plots/pad_attributes.js"(t,r){r.exports=function(t){var r=t.editType;return{t:{valType:"number",dflt:0,editType:r},r:{valType:"number",dflt:0,editType:r},b:{valType:"number",dflt:0,editType:r},l:{valType:"number",dflt:0,editType:r},editType:r}}}}),e0=g({"src/plots/layout_attributes.js"(t,r){var i=W(),n=eH(),a=er(),o=eK(),s=eJ(),l=eQ(),u=$().extendFlat,c=i({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=a.defaultLine,r.exports={font:c,title:{text:{valType:"string",editType:"layoutstyle"},font:i({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:i({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:u(l({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:a.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:a.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:a.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:o.newshape,activeshape:o.activeshape,newselection:s.newselection,activeselection:s.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:u({},n.transition,{editType:"none"})}}}),e1=g({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){if(!document.getElementById("9f215cf04c5486422605d13261cb87401f4e7763b6296af81e98efbc0130da53")){var t=document.createElement("style");t.id="9f215cf04c5486422605d13261cb87401f4e7763b6296af81e98efbc0130da53",t.textContent='.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media (hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M10%2013c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h9c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M14.5%208.5c-.75%200-1.5.75-1.5%201.5v3h-3c-.75%200-1.5.75-1.5%201.5S9.25%2016%2010%2016h3v3c0%20.75.75%201.5%201.5%201.5S16%2019.75%2016%2019v-3h3c.75%200%201.5-.75%201.5-1.5S19.75%2013%2019%2013h-3v-3c0-.75-.75-1.5-1.5-1.5%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M24%2016v5.5c0%201.75-.75%202.5-2.5%202.5H16v-1l3-1.5-4-5.5%201-1%205.5%204%201.5-3zM6%2016l1.5%203%205.5-4%201%201-4%205.5%203%201.5v1H7.5C5.75%2024%205%2023.25%205%2021.5V16zm7-11v1l-3%201.5%204%205.5-1%201-5.5-4L6%2013H5V7.5C5%205.75%205.75%205%207.5%205zm11%202.5c0-1.75-.75-2.5-2.5-2.5H16v1l3%201.5-4%205.5%201%201%205.5-4%201.5%203h1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22M18.5%2016c-1.75%200-2.5.75-2.5%202.5V24h1l1.5-3%205.5%204%201-1-4-5.5%203-1.5v-1zM13%2018.5c0-1.75-.75-2.5-2.5-2.5H5v1l3%201.5L4%2024l1%201%205.5-4%201.5%203h1zm3-8c0%201.75.75%202.5%202.5%202.5H24v-1l-3-1.5L25%205l-1-1-5.5%204L17%205h-1zM10.5%2013c1.75%200%202.5-.75%202.5-2.5V5h-1l-1.5%203L5%204%204%205l4%205.5L5%2012v1z%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2029%2029%22%3E%3Cpath%20d%3D%22m10.5%2014%204-8%204%208z%22%2F%3E%3Cpath%20fill%3D%22%23ccc%22%20d%3D%22m10.5%2016%204%208%204-8z%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22none%22%20stroke%3D%22%23333%22%20viewBox%3D%220%200%2022%2022%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M17.5%2011c0%204.819-3.02%208.5-6.5%208.5S4.5%2015.819%204.5%2011%207.52%202.5%2011%202.5s6.5%203.681%206.5%208.5Z%22%2F%3E%3Cpath%20d%3D%22M13.5%2011c0%202.447-.331%204.64-.853%206.206-.262.785-.562%201.384-.872%201.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831%2015.64%208.5%2013.446%208.5%2011s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872%201.777.522%201.565.853%203.76.853%206.206Z%22%2F%3E%3Cpath%20d%3D%22M11%207.5c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138q.07-.058.224-.138c.299-.151.763-.302%201.379-.434C7.378%205.666%209.091%205.5%2011%205.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0%209c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138%201.3%201.3%200%200%201%20.224-.138c.299-.151.763-.302%201.379-.434C7.378%2014.666%209.091%2014.5%2011%2014.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138a1.3%201.3%200%200%201-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0-4c-2.46%200-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5%201.5%200%200%201-.39-.272.3.3%200%200%201-.047-.064.3.3%200%200%201%20.048-.064c.066-.073.189-.167.389-.272.399-.21%201.009-.413%201.805-.59C6.328%209.722%208.54%209.5%2011%209.5s4.672.222%206.256.574c.795.177%201.405.38%201.804.59.2.105.323.2.39.272a.3.3%200%200%201%20.047.064.3.3%200%200%201-.048.064%201.4%201.4%200%200%201-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0%20.018v.002zm17.002.002v-.002zm0-.018v-.002z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22none%22%20stroke%3D%22%2333b5e5%22%20viewBox%3D%220%200%2022%2022%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M17.5%2011c0%204.819-3.02%208.5-6.5%208.5S4.5%2015.819%204.5%2011%207.52%202.5%2011%202.5s6.5%203.681%206.5%208.5Z%22%2F%3E%3Cpath%20d%3D%22M13.5%2011c0%202.447-.331%204.64-.853%206.206-.262.785-.562%201.384-.872%201.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831%2015.64%208.5%2013.446%208.5%2011s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872%201.777.522%201.565.853%203.76.853%206.206Z%22%2F%3E%3Cpath%20d%3D%22M11%207.5c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138q.07-.058.224-.138c.299-.151.763-.302%201.379-.434C7.378%205.666%209.091%205.5%2011%205.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0%209c-1.909%200-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3%201.3%200%200%201-.224-.138%201.3%201.3%200%200%201%20.224-.138c.299-.151.763-.302%201.379-.434C7.378%2014.666%209.091%2014.5%2011%2014.5s3.622.166%204.845.428c.616.132%201.08.283%201.379.434.105.053.177.1.224.138a1.3%201.3%200%200%201-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm0-4c-2.46%200-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5%201.5%200%200%201-.39-.272.3.3%200%200%201-.047-.064.3.3%200%200%201%20.048-.064c.066-.073.189-.167.389-.272.399-.21%201.009-.413%201.805-.59C6.328%209.722%208.54%209.5%2011%209.5s4.672.222%206.256.574c.795.177%201.405.38%201.804.59.2.105.323.2.39.272a.3.3%200%200%201%20.047.064.3.3%200%200%201-.048.064%201.4%201.4%200%200%201-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0%20.018v.002zm17.002.002v-.002zm0-.018v-.002z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cpath%20d%3D%22m1.754%2013.406%204.453-4.851%203.09%203.09%203.281%203.277.969-.969-3.309-3.312%203.844-4.121%206.148%206.886h1.082v-.855l-7.207-8.07-4.84%205.187L6.169%206.57l-5.48%205.965v.871ZM.688%2016.844h20.625v1.375H.688Zm0%200%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2222%22%20height%3D%2222%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2022%2022%22%3E%3Cpath%20d%3D%22m1.754%2013.406%204.453-4.851%203.09%203.09%203.281%203.277.969-.969-3.309-3.312%203.844-4.121%206.148%206.886h1.082v-.855l-7.207-8.07-4.84%205.187L6.169%206.57l-5.48%205.965v.871ZM.688%2016.844h20.625v1.375H.688Zm0%200%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23333%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23aaa%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e58978%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e54e33%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23fff%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23999%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e58978%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%2333b5e5%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23e54e33%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2229%22%20height%3D%2229%22%20fill%3D%22%23666%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M10%204C9%204%209%205%209%205v.1A5%205%200%200%200%205.1%209H5s-1%200-1%201%201%201%201%201h.1A5%205%200%200%200%209%2014.9v.1s0%201%201%201%201-1%201-1v-.1a5%205%200%200%200%203.9-3.9h.1s1%200%201-1-1-1-1-1h-.1A5%205%200%200%200%2011%205.1V5s0-1-1-1m0%202.5a3.5%203.5%200%201%201%200%207%203.5%203.5%200%201%201%200-7%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3Cpath%20fill%3D%22red%22%20d%3D%22m14%205%201%201-9%209-1-1z%22%2F%3E%3C%2Fsvg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2288%22%20height%3D%2223%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.4%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.408%2016.796h-1.827l2.501-12.095h.198l3.324%206.533.988%202.19.988-2.19%203.258-6.533h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.929%205.644h-.098l-2.914-5.644-.757-1.71-.345%201.71zm1.958-3.42-.726%203.663a1.255%201.255%200%200%201-1.232%201.011h-1.827a1.255%201.255%200%200%201-1.229-1.509l2.501-12.095a1.255%201.255%200%200%201%201.23-1.001h.197a1.25%201.25%200%200%201%201.12.685l3.19%206.273%203.125-6.263a1.25%201.25%200%200%201%201.123-.695h.181a1.255%201.255%200%200%201%201.227.991l1.443%206.71a5%205%200%200%201%20.314-.787l.009-.016a4.6%204.6%200%200%201%201.777-1.887c.782-.46%201.668-.667%202.611-.667a4.6%204.6%200%200%201%201.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255%201.255%200%200%201%201.212.925%201.255%201.255%200%200%201%201.212-.925h1.711c.284%200%20.545.094.755.252.613-.3%201.312-.45%202.075-.45%201.356%200%202.557.445%203.482%201.4q.47.48.763%201.064V4.701a1.255%201.255%200%200%201%201.255-1.255h1.86A1.255%201.255%200%200%201%2054.44%204.7v9.194h2.217c.19%200%20.37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42%202.42%200%200%201-.682-1.71c0-.665.267-1.253.735-1.7a2.45%202.45%200%200%201%201.722-.674%202.43%202.43%200%200%201%201.705.675q.318.302.504.683V4.7a1.255%201.255%200%200%201%201.255-1.255h1.744A1.255%201.255%200%200%201%2065.812%204.7v3.335a4.8%204.8%200%200%201%201.526-.246c.938%200%201.817.214%202.59.69a4.47%204.47%200%200%201%201.67%201.743v-.98a1.255%201.255%200%200%201%201.256-1.256h1.777c.233%200%20.451.064.639.174a3.4%203.4%200%200%201%201.567-.372c.346%200%20.861.02%201.285.232a1.25%201.25%200%200%201%20.689%201.004%204.7%204.7%200%200%201%20.853-.588c.795-.44%201.675-.647%202.61-.647%201.385%200%202.65.39%203.525%201.396.836.938%201.168%202.173%201.168%203.528q-.001.515-.056%201.051a1.255%201.255%200%200%201-.947%201.09l.408.952a1.255%201.255%200%200%201-.477%201.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06%200-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8%205.8%200%200%201-.548-2.512q0-.429.053-.843a1.3%201.3%200%200%201-.333-.086l-.166-.004c-.223%200-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255%201.255%200%200%201-1.256%201.256h-1.777a1.255%201.255%200%200%201-1.256-1.256V15.69l-.032.057a4.8%204.8%200%200%201-1.86%201.833%205.04%205.04%200%200%201-2.484.634%204.5%204.5%200%200%201-1.935-.424%201.25%201.25%200%200%201-.764.258h-1.71a1.255%201.255%200%200%201-1.256-1.255V7.687a2.4%202.4%200%200%201-.428.625c.253.23.412.561.412.93v7.553a1.255%201.255%200%200%201-1.256%201.255h-1.843a1.25%201.25%200%200%201-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255%201.255%200%200%201-1.256-1.255v-1.251l-.061.117a4.7%204.7%200%200%201-1.782%201.884%204.77%204.77%200%200%201-2.485.67%205.6%205.6%200%200%201-1.485-.188l.009%202.764a1.255%201.255%200%200%201-1.255%201.259h-1.729a1.255%201.255%200%200%201-1.255-1.255v-3.537a1.255%201.255%200%200%201-1.167.793h-1.679a1.25%201.25%200%200%201-.77-.263%204.5%204.5%200%200%201-1.945.429c-.885%200-1.724-.21-2.495-.632l-.017-.01a5%205%200%200%201-1.081-.836%201.255%201.255%200%200%201-1.254%201.312h-1.81a1.255%201.255%200%200%201-1.228-.99l-.782-3.625-2.044%203.939a1.25%201.25%200%200%201-1.115.676h-.098a1.25%201.25%200%200%201-1.116-.68l-2.061-3.994zM35.92%2016.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033%201.332h1.678V9.242h-1.694l-.033%201.267q-.133-.329-.526-.658l-.032-.028a3.2%203.2%200%200%200-.668-.428l-.27-.12a3.3%203.3%200%200%200-1.235-.23q-1.136-.001-1.974.493a3.36%203.36%200%200%200-1.3%201.382q-.445.89-.444%202.074%200%201.2.51%202.107a3.8%203.8%200%200%200%201.382%201.381%203.9%203.9%200%200%200%201.893.477q.795%200%201.455-.33zm-2.789-5.38q-.576.675-.575%201.762%200%201.102.559%201.794.576.675%201.645.675a2.25%202.25%200%200%200%20.934-.19%202.2%202.2%200%200%200%20.468-.29l.178-.161a2.2%202.2%200%200%200%20.397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2%202.2%200%200%200-.633-.709l-.13-.086-.047-.028a2.1%202.1%200%200%200-1.073-.285q-1.052%200-1.629.692zm2.316%202.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96%200%200%200-.353-.389.85.85%200%200%200-.464-.127c-.4%200-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945%200%20.506.122.801.27.99.097.11.266.224.68.224.303%200%20.504-.09.687-.269zm7.545%201.705a2.6%202.6%200%200%200%20.331.423q.319.33.755.548l.173.074q.65.255%201.49.255%201.02%200%201.844-.493a3.45%203.45%200%200%200%201.316-1.4q.493-.904.493-2.089%200-1.909-.988-2.913-.988-1.02-2.584-1.02-.898%200-1.575.347a3%203%200%200%200-.415.262l-.199.166a3.4%203.4%200%200%200-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296%201.119.297%201.07%200%201.645-.675.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.435%200-.835.16a2%202%200%200%200-.284.136%202%202%200%200%200-.363.254%202.2%202.2%200%200%200-.46.569l-.082.162a2.6%202.6%200%200%200-.213%201.072v.115q0%20.707.296%201.267l.135.211zm.964-.818a1.1%201.1%200%200%200%20.367.385.94.94%200%200%200%20.476.118c.423%200%20.59-.117.687-.23.159-.194.28-.478.28-.95%200-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1%201%200%200%200-.503.135l-.012.007a.86.86%200%200%200-.335.343c-.073.133-.132.324-.132.614v.115a1.4%201.4%200%200%200%20.14.66zm15.7-6.222q.347-.346.346-.856a1.05%201.05%200%200%200-.345-.79%201.18%201.18%200%200%200-.84-.329q-.51%200-.855.33a1.05%201.05%200%200%200-.346.79q0%20.51.346.855.345.346.856.346.51%200%20.839-.346zm4.337%209.314.033-1.332q.191.403.59.747l.098.081a4%204%200%200%200%20.316.224l.223.122a3.2%203.2%200%200%200%201.44.322%203.8%203.8%200%200%200%201.875-.477%203.5%203.5%200%200%200%201.382-1.366q.527-.89.526-2.09%200-1.184-.444-2.073a3.24%203.24%200%200%200-1.283-1.399q-.823-.51-1.942-.51a3.5%203.5%200%200%200-1.527.344l-.086.043-.165.09a3%203%200%200%200-.33.214q-.432.315-.656.707a2%202%200%200%200-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5%202.5%200%200%200%20.566.7q.117.098.245.18l.144.08a2.1%202.1%200%200%200%20.975.232q1.07%200%201.645-.675.576-.69.576-1.778%200-1.102-.576-1.777-.56-.691-1.645-.692a2.2%202.2%200%200%200-1.015.235q-.22.113-.415.282l-.15.142a2.1%202.1%200%200%200-.42.594q-.223.479-.223%201.1v.115q0%20.705.293%201.26zm2.616-.293c.157-.191.28-.479.28-.967%200-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87%200%200%200-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0%20.285.057.499.144.669a1.1%201.1%200%200%200%20.367.405c.137.082.28.123.455.123.423%200%20.59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493%200%20.642.099l.247-1.794q-.196-.099-.717-.099a2.3%202.3%200%200%200-.545.063%202%202%200%200%200-.411.148%202.2%202.2%200%200%200-.4.249%202.5%202.5%200%200%200-.485.499%202.7%202.7%200%200%200-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5%201.5%200%200%201%20.466-.636%202.5%202.5%200%200%201%20.399-.253%202%202%200%200%201%20.224-.099zm9.784%202.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46%203.46%200%200%200-1.4%201.382q-.493.906-.493%202.106%200%201.07.428%201.975.428.89%201.332%201.432.906.526%202.255.526.973%200%201.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954%200-1.497-.444a1.6%201.6%200%200%201-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1%201%200%200%200-.156-.176q-.46-.428-1.316-.428-.986%200-1.494.604-.379.45-.494%201.234zm-27.053%202.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22m19.63%2011.151-.757-1.71-.345%201.71-1.12%205.644h-1.827L18.083%204.7h.197l3.325%206.533.988%202.19.988-2.19L26.839%204.7h.181l2.6%2012.095h-1.81l-1.218-5.644-.362-1.71-.658%201.71-2.93%205.644h-.098l-2.913-5.644zm14.836%205.81q-1.02%200-1.893-.478a3.8%203.8%200%200%201-1.381-1.382q-.51-.906-.51-2.106%200-1.185.444-2.074a3.36%203.36%200%200%201%201.3-1.382q.839-.494%201.974-.494a3.3%203.3%200%200%201%201.234.231%203.3%203.3%200%200%201%20.97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02%201.053a3.17%203.17%200%200%201-1.662.444zm.296-1.482q.938%200%201.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2%202.2%200%200%200-.807-.872%202.1%202.1%200%200%200-1.119-.313q-1.053%200-1.629.692-.575.675-.575%201.76%200%201.103.559%201.795.577.675%201.645.675zm6.521-6.237h1.711v1.4q.906-1.597%202.83-1.597%201.596%200%202.584%201.02.988%201.005.988%202.914%200%201.185-.493%202.09a3.46%203.46%200%200%201-1.316%201.399%203.5%203.5%200%200%201-1.844.493q-.954%200-1.662-.329a2.67%202.67%200%200%201-1.086-.97l.017%205.134h-1.728zm4.048%206.22q1.07%200%201.645-.674.577-.69.576-1.762%200-1.119-.576-1.777-.558-.675-1.645-.675-.592%200-1.12.296-.51.28-.822.823-.296.527-.296%201.234v.115q0%20.708.296%201.267.313.543.823.855.51.296%201.119.297z%22%2F%3E%3Cpath%20fill%3D%22%23e1e3e9%22%20d%3D%22M51.325%204.7h1.86v10.45h3.473v1.646h-5.333zm7.12%204.542h1.843v7.553h-1.843zm.905-1.415a1.16%201.16%200%200%201-.856-.346%201.17%201.17%200%200%201-.346-.856%201.05%201.05%200%200%201%20.346-.79q.346-.329.856-.329.494%200%20.839.33a1.05%201.05%200%200%201%20.345.79%201.16%201.16%200%200%201-.345.855q-.33.346-.84.346zm7.875%209.133a3.17%203.17%200%200%201-1.662-.444q-.723-.46-1.004-1.053l-.033%201.332h-1.71V4.701h1.743v4.657l-.082%201.283q.279-.658%201.086-1.119a3.5%203.5%200%200%201%201.778-.477q1.119%200%201.942.51a3.24%203.24%200%200%201%201.283%201.4q.445.888.444%202.072%200%201.201-.526%202.09a3.5%203.5%200%200%201-1.382%201.366%203.8%203.8%200%200%201-1.876.477zm-.296-1.481q1.069%200%201.645-.675.577-.69.577-1.778%200-1.102-.577-1.776-.56-.691-1.645-.692a2.12%202.12%200%200%200-1.58.659q-.642.641-.642%201.694v.115q0%20.71.296%201.267a2.4%202.4%200%200%200%20.807.872%202.1%202.1%200%200%200%201.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14%202.14%200%200%201%201.349-.46q.527%200%20.724.098l-.247%201.794q-.149-.099-.642-.099-.774%200-1.416.494-.626.493-.626%201.58v3.883h-1.777V9.242zm9.534%207.718q-1.35%200-2.255-.526-.904-.543-1.332-1.432a4.6%204.6%200%200%201-.428-1.975q0-1.2.493-2.106a3.46%203.46%200%200%201%201.4-1.382q.889-.495%202.007-.494%201.744%200%202.584.97.855.956.856%202.7%200%20.444-.05.92h-5.43q.18%201.005.708%201.45.542.443%201.497.443.79%200%201.3-.131a4%204%200%200%200%20.938-.362l.542%201.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728%200-1.991%201.86z%22%2F%3E%3Cpath%20d%3D%22M5.074%2015.948a.484.657%200%200%200-.486.659v1.84a.484.657%200%200%200%20.486.659h4.101a.484.657%200%200%200%20.486-.659v-1.84a.484.657%200%200%200-.486-.659zm3.56%201.16H5.617v.838h3.017z%22%20style%3D%22fill%3A%23fff%3Bfill-rule%3Aevenodd%3Bstroke-width%3A1.03600001%22%2F%3E%3Cg%20style%3D%22stroke-width%3A1.12603545%22%3E%3Cpath%20d%3D%22M-9.408-1.416c-3.833-.025-7.056%202.912-7.08%206.615-.02%203.08%201.653%204.832%203.107%206.268.903.892%201.721%201.74%202.32%202.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87%201.87%200%200%200-.362%201.121l-.011%201.877c-.003.402.104.787.347%201.125.244.338.688.653%201.23.656l4.142.028c.542.003.99-.306%201.238-.641a1.87%201.87%200%200%200%20.363-1.121l.012-1.875a1.87%201.87%200%200%200-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145%201.425-1.983%202.348-2.87%201.473-1.414%203.18-3.149%203.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006%201.1v.002c3.274.02%205.92%202.532%205.9%205.6-.017%202.706-1.39%204.026-2.863%205.44-1.034.994-2.118%202.033-2.814%203.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34%200%200%201-.226.084.34.34%200%200%201-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067%202.7-5.545%205.975-5.523m-.02%202.826c-1.62-.01-2.944%201.315-2.955%202.96-.01%201.646%201.295%202.988%202.916%202.999h.002c1.621.01%202.943-1.316%202.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005%201.1c1.017.006%201.829.83%201.822%201.89s-.83%201.874-1.848%201.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874%201.848-1.868m-2.155%2011.857%204.14.025c.271.002.49.305.487.676l-.013%201.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%22%20style%3D%22color%3A%23000%3Bfont-style%3Anormal%3Bfont-variant%3Anormal%3Bfont-weight%3A400%3Bfont-stretch%3Anormal%3Bfont-size%3Amedium%3Bline-height%3Anormal%3Bfont-family%3Asans-serif%3Bfont-variant-ligatures%3Anormal%3Bfont-variant-position%3Anormal%3Bfont-variant-caps%3Anormal%3Bfont-variant-numeric%3Anormal%3Bfont-variant-alternates%3Anormal%3Bfont-feature-settings%3Anormal%3Btext-indent%3A0%3Btext-align%3Astart%3Btext-decoration%3Anone%3Btext-decoration-line%3Anone%3Btext-decoration-style%3Asolid%3Btext-decoration-color%3A%23000%3Bletter-spacing%3Anormal%3Bword-spacing%3Anormal%3Btext-transform%3Anone%3Bwriting-mode%3Alr-tb%3Bdirection%3Altr%3Btext-orientation%3Amixed%3Bdominant-baseline%3Aauto%3Bbaseline-shift%3Abaseline%3Btext-anchor%3Astart%3Bwhite-space%3Anormal%3Bshape-padding%3A0%3Bclip-rule%3Aevenodd%3Bdisplay%3Ainline%3Boverflow%3Avisible%3Bvisibility%3Avisible%3Bopacity%3A1%3Bisolation%3Aauto%3Bmix-blend-mode%3Anormal%3Bcolor-interpolation%3AsRGB%3Bcolor-interpolation-filters%3AlinearRGB%3Bsolid-color%3A%23000%3Bsolid-opacity%3A1%3Bvector-effect%3Anone%3Bfill%3A%23000%3Bfill-opacity%3A.4%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-linecap%3Abutt%3Bstroke-linejoin%3Amiter%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-dashoffset%3A0%3Bstroke-opacity%3A1%3Bcolor-rendering%3Aauto%3Bimage-rendering%3Aauto%3Bshape-rendering%3Aauto%3Btext-rendering%3Aauto%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-9.415-.316C-12.69-.338-15.37%202.14-15.39%205.207c-.017%202.716%201.326%204.041%202.78%205.477%201.013%201%202.081%202.055%202.78%203.67l.092.076a.34.34%200%200%200%20.225.086.34.34%200%200%200%20.227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6%201.78-2.64%202.814-3.634%201.473-1.414%202.847-2.733%202.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057%208.784c1.621.011%202.944-1.315%202.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945%201.315-2.955%202.96s1.295%202.989%202.916%203%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23e1e3e9%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3Cpath%20d%3D%22M-11.594%2015.465c-.27-.002-.492.297-.494.668l-.012%201.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%22%20style%3D%22clip-rule%3Aevenodd%3Bfill%3A%23fff%3Bfill-opacity%3A1%3Bfill-rule%3Aevenodd%3Bstroke%3Anone%3Bstroke-width%3A2.47727823%3Bstroke-miterlimit%3A4%3Bstroke-dasharray%3Anone%3Bstroke-opacity%3A.4%22%20transform%3D%22translate(15.553%202.85)scale(.88807)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20fill-rule%3D%22evenodd%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20d%3D%22M4%2010a6%206%200%201%200%2012%200%206%206%200%201%200-12%200m5-3a1%201%200%201%200%202%200%201%201%200%201%200-2%200m0%203a1%201%200%201%201%202%200v3a1%201%200%201%201-2%200%22%2F%3E%3C%2Fsvg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@media (prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:rgba(0,0,0,.4);position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}',document.head.appendChild(t)}}}),e2=g({"src/registry.js"(t){var r=et(),i=eh(),n=ed(),a=(eG().addStyleRule,$()),o=K(),s=e0(),l=a.extendFlat,u=a.extendDeepAll;function c(r){if(r.layoutAttributes){var i=r.layoutAttributes._arrayAttrRegexps;if(i)for(var a=0;a=r&&n<=i?n:u}if("string"!=typeof n&&"number"!=typeof n)return u;n=String(n);var b=_(a),w=n.charAt(0);b&&("G"===w||"g"===w)&&(n=n.slice(1),a="");var T=b&&"chinese"===a.slice(0,7),A=n.match(T?v:y);if(!A)return u;var M=A[1],k=A[3]||"1",S=Number(A[5]||1),E=Number(A[7]||0),D=Number(A[9]||0),C=Number(A[11]||0);if(b){if(2===M.length)return u;M=Number(M);try{var I,L=m.getComponentMethod("calendars","getCal")(a);if(T){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),I=L.newDate(M,L.toMonthIndex(M,k,P),S)}else I=L.newDate(M,Number(k),S)}catch{return u}return I?(I.toJD()-p)*c+E*h+D*d+C*f:u}M=2===M.length?(Number(M)+2e3-x)%100+x:Number(M);var z=new Date(Date.UTC(2e3,k-=1,S,E,D));return z.setUTCFullYear(M),z.getUTCMonth()!==k||z.getUTCDate()!==S?u:z.getTime()+C*f},r=t.MIN_MS=t.dateTime2ms("-9999"),i=t.MAX_MS=t.dateTime2ms("9999-12-31 23:59:59.9999"),t.isDateTime=function(r,i){return t.dateTime2ms(r,i)!==u};var T=90*c,A=3*h,M=5*d;function k(t,r,i,n,a){if((r||i||n||a)&&(t+=" "+w(r,2)+":"+w(i,2),(n||a)&&(t+=":"+w(n,2),a))){for(var o=4;a%10==0;)o-=1,a/=10;t+="."+w(a,o)}return t}t.ms2DateTime=function(t,n,a){if("number"!=typeof t||!(t>=r&&t<=i))return u;n||(n=0);var o,l,y,v,x,b,w=Math.floor(10*s(t+.05,1)),S=Math.round(t-w/10);if(_(a)){var E=Math.floor(S/c)+p,D=Math.floor(s(t,c));try{o=m.getComponentMethod("calendars","getCal")(a).fromJD(E).formatDate("yyyy-mm-dd")}catch{o=g("G%Y-%m-%d")(new Date(S))}if("-"===o.charAt(0))for(;o.length<11;)o="-0"+o.slice(1);else for(;o.length<10;)o="0"+o;l=n=r+c&&t<=i-c))return u;var a=Math.floor(10*s(t+.05,1)),o=new Date(Math.round(t-a/10));return k(n("%Y-%m-%d")(o),o.getHours(),o.getMinutes(),o.getSeconds(),10*o.getUTCMilliseconds()+a)},t.cleanDate=function(r,i,n){if(r===u)return i;if(t.isJSDate(r)||"number"==typeof r&&isFinite(r)){if(_(n))return o.error("JS Dates and milliseconds are incompatible with world calendars",r),i;if(!(r=t.ms2DateTimeLocal(+r))&&void 0!==i)return i}else if(!t.isDateTime(r,n))return o.error("unrecognized date",r),i;return r};var S=/%\d?f/g,E=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function I(t,r,i,n){t=t.replace(S,function(t){var i=Math.min(+t.charAt(1)||6,6);return(r/1e3%1+2).toFixed(i).slice(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(r+.05));if(t=t.replace(E,function(){return C[i("%q")(a)]}),_(n))try{t=m.getComponentMethod("calendars","worldCalFmt")(t,r,n)}catch{return"Invalid"}return i(t)(a)}var z=[59,59.9,59.99,59.999,59.9999];t.formatDate=function(t,r,i,n,o,l){if(o=_(o)&&o,!r)if("y"===i)r=l.year;else if("m"===i)r=l.month;else{if("d"!==i)return function(t,r){var i=s(t+.05,c),n=w(Math.floor(i/h),2)+":"+w(s(Math.floor(i/d),60),2);if("M"!==r){a(r)||(r=0);var o=(100+Math.min(s(t/f,60),z[r])).toFixed(r).slice(1);r>0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}(t,i)+` -`+I(l.dayMonthYear,t,n,o);r=l.dayMonth+` -`+l.year}return I(r,t,n,o)};var F=3*c;t.incrementMonth=function(t,r,i){i=_(i)&&i;var n=s(t,c);if(t=Math.round(t-n),i)try{var a=Math.round(t/c)+p,l=m.getComponentMethod("calendars","getCal")(i),u=l.fromJD(a);return r%12?l.add(u,r,"m"):l.add(u,r/12,"y"),(u.toJD()-p)*c+n}catch{o.error("invalid ms "+t+" in calendar "+i)}var h=new Date(t+F);return h.setUTCMonth(h.getUTCMonth()+r)+n-F},t.findExactDates=function(t,r){for(var i,n,o=0,s=0,l=0,u=0,h=_(r)&&m.getComponentMethod("calendars","getCal")(r),d=0;dr}function u(t,r){return t>=r}t.findBin=function(t,n,a){if(r(n.start))return a?Math.ceil((t-n.start)/n.size-1e-9)-1:Math.floor((t-n.start)/n.size+1e-9);var c,h,d=0,f=n.length,p=0,m=f>1?(n[f-1]-n[0])/(f-1):1;for(h=m>=0?a?o:s:a?u:l,t+=1e-9*m*(a?-1:1)*(m>=0?1:-1);d90&&i.log("Long binary search..."),d-1},t.sorterAsc=function(t,r){return t-r},t.sorterDes=function(t,r){return r-t},t.distinctVals=function(r){var i=r.slice();for(i.sort(t.sorterAsc),n=i.length-1;n>-1&&i[n]===a;n--);for(var n,o,s=i[n]-i[0]||1,l=s/(n||1)/1e4,u=[],c=0;c<=n;c++){var h=i[c],d=h-o;void 0===o?(u.push(h),o=h):d>l&&(s=Math.min(s,d),u.push(h),o=h)}return{vals:u,minDiff:s}},t.roundUp=function(t,r,i){for(var n,a=0,o=r.length-1,s=0,l=+!i,u=+!!i,c=i?Math.ceil:Math.floor;a0&&(n=1),i&&n)return t.sort(r)}return n?t:t.reverse()},t.findIndexOfMin=function(t,r){r=r||n;for(var i,a=1/0,o=0;oe7});var e7,e9=m({"src/lib/sort_object_keys.ts"(){e7=e8}}),te=g({"src/lib/stats.js"(t){var r=L(),i=O().isArrayOrTypedArray;t.aggNums=function(n,a,o,s){var l,u;if((!s||s>o.length)&&(s=o.length),r(a)||(a=!1),i(o[0])){for(u=Array(s),l=0;lt.length-1)return t[t.length-1];var n=i%1;return n*t[Math.ceil(i)]+(1-n)*t[Math.floor(i)]}}}),tt=g({"src/lib/angles.js"(t,r){var i=(H(),b(U)),n=i.mod,a=i.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,r){return a(r-t,s)}function c(t,r){if(l(r))return!0;r[0](a=n(a,s))&&(a+=s);var i,a,o=n(t,s),u=o+s;return o>=i&&o<=a||u>=i&&u<=a}function h(t,r,i,n,a,u,c){a=a||0,u=u||0;var h,d,f,p,m,g,y=l([i,n]);function v(t,r){return[t*Math.cos(r)+a,u-t*Math.sin(r)]}y?(d=0,f=o,p=s):i=a&&t<=o)},pathArc:function(t,r,i,n,a){return h(null,t,r,i,n,a,0)},pathSector:function(t,r,i,n,a){return h(null,t,r,i,n,a,1)},pathAnnulus:function(t,r,i,n,a,o){return h(t,r,i,n,a,o,1)}}}}),tr=g({"src/lib/anchor_utils.js"(t){t.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},t.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},t.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},t.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},t.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},t.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}}}),ti=g({"src/lib/geometry2d.js"(t){var r,i,n,a=(H(),b(U)).mod;function o(t,r,i,n,a,o,s,l){var u=i-t,c=a-t,h=s-a,d=n-r,f=o-r,p=l-o,m=u*p-h*d;if(0===m)return null;var g=(c*p-h*f)/m,y=(c*d-u*f)/m;return y<0||y>1||g<0||g>1?null:{x:t+u*g,y:r+d*g}}function s(t,r,i,n,a){var o=n*t+a*r;if(o<0)return n*n+a*a;if(o>i){var s=n-t,l=a-r;return s*s+l*l}var u=n*r-a*t;return u*u/i}t.segmentsIntersect=o,t.segmentDistance=function(t,r,i,n,a,l,u,c){if(o(t,r,i,n,a,l,u,c))return 0;var h=i-t,d=n-r,f=u-a,p=c-l,m=h*h+d*d,g=f*f+p*p;return Math.sqrt(Math.min(s(h,d,m,a-t,l-r),s(h,d,m,u-t,c-r),s(f,p,g,t-a,r-l),s(f,p,g,i-a,n-l)))},t.getTextLocation=function(t,o,s,l){if((t!==i||l!==n)&&(r={},i=t,n=l),r[s])return r[s];var u=t.getPointAtLength(a(s-l/2,o)),c=t.getPointAtLength(a(s+l/2,o)),h=Math.atan((c.y-u.y)/(c.x-u.x)),d=t.getPointAtLength(a(s,o)),f={x:(4*d.x+u.x+c.x)/6,y:(4*d.y+u.y+c.y)/6,theta:h};return r[s]=f,f},t.clearLocationCache=function(){i=null},t.getVisibleSegment=function(t,r,i){var n,a,o=r.left,s=r.right,l=r.top,u=r.bottom,c=0,h=t.getTotalLength(),d=h;function f(r){var i=t.getPointAtLength(r);0===r?n=i:r===h&&(a=i);var c=i.xs?i.x-s:0,d=i.yu?i.y-u:0;return Math.sqrt(c*c+d*d)}for(var p=f(c);p;){if((c+=p+i)>d)return;p=f(c)}for(p=f(d);p;){if(c>(d-=p+i))return;p=f(d)}return{min:c,max:d,len:d-c,total:h,isClosed:0===c&&d===h&&.1>Math.abs(n.x-a.x)&&.1>Math.abs(n.y-a.y)}},t.findPointOnPath=function(t,r,i,n){n=n||{};for(var a,o,s,l=n.pathLength||t.getTotalLength(),u=n.tolerance||.001,c=n.iterationLimit||30,h=t.getPointAtLength(0)[i]>t.getPointAtLength(l)[i]?-1:1,d=0,f=0,p=l;d0?p=a:f=a,d++;return o}}}),tn=g({"src/lib/throttle.js"(t){var r={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}t.throttle=function(t,n,a){var o=r[t],s=Date.now();if(!o){for(var l in r)r[l].tso.ts+n)?u():o.timer=setTimeout(function(){u(),o.timer=null},n)},t.done=function(t){var i=r[t];return i&&i.timer?new Promise(function(t){var r=i.onDone;i.onDone=function(){r&&r(),t(),i.onDone=null}}):Promise.resolve()},t.clear=function(n){if(n)i(r[n]),delete r[n];else for(var a in r)t.clear(a)}}}),ta=g({"src/lib/clear_responsive.js"(t,r){r.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}}}),to=g({"node_modules/is-mobile/index.js"(t,r){r.exports=o,r.exports.isMobile=o,r.exports.default=o;var i=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,n=/CrOS/,a=/android|ipad|playbook|silk/i;function o(t){t||(t={});let r=t.ua;if(!r&&"u">typeof navigator&&(r=navigator.userAgent),r&&r.headers&&"string"==typeof r.headers["user-agent"]&&(r=r.headers["user-agent"]),"string"!=typeof r)return!1;let o=i.test(r)&&!n.test(r)||!!t.tablet&&a.test(r);return!o&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==r.indexOf("Macintosh")&&-1!==r.indexOf("Safari")&&(o=!0),o}}}),ts=g({"src/lib/preserve_drawing_buffer.js"(t,r){var i=L(),n=to();r.exports=function(t){if("string"!=typeof(a=t&&t.hasOwnProperty("userAgent")?t.userAgent:("u">typeof navigator&&(r=navigator.userAgent),r&&r.headers&&"string"==typeof r.headers["user-agent"]&&(r=r.headers["user-agent"]),r)))return!0;var r,a,o=n({ua:{headers:{"user-agent":a}},tablet:!0,featureDetect:!1});if(!o){for(var s=a.split(" "),l=1;l-1;u--){var c=s[u];if("Version/"===c.slice(0,8)){var h=c.slice(8).split(".")[0];if(i(h)&&(h*=1),h>=13)return!0}}}return o}}}),tl=g({"src/lib/make_trace_groups.js"(t,r){var i=k();r.exports=function(t,r,n){var a=t.selectAll("g."+n.replace(/\s/g,".")).data(r,function(t){return t[0].trace.uid});a.exit().remove(),a.enter().append("g").attr("class",n),a.order();var o=t.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each(function(t){t[0][o]=i.select(this)}),a}}}),tu=g({"src/lib/localize.js"(t,r){var i=e2();r.exports=function(t,r){for(var n=t._context.locale,a=0;a<2;a++){for(var o=t._context.locales,s=0;s<2;s++){var l=(o[n]||{}).dictionary;if(l){var u=l[r];if(u)return u}o=i.localeRegistry}var c=n.split("-")[0];if(c===n)break;n=c}return r}}}),tc=g({"src/lib/filter_unique.js"(t,r){r.exports=function(t){for(var r={},i=[],n=0,a=0;a1?(i*t+i*r)/i:t+r,a=String(n).length;if(a>16){var o=String(r).length;if(a>=String(t).length+o){var s=parseFloat(n).toPrecision(12);-1===s.indexOf("e+")&&(n=+s)}}return n}}}),tf={};function tp(t){return"string"==typeof t&&(t=t.replace(ty,"")),(0,tm.default)(t)?Number(t):tg.BADNUM}y(tf,{default:()=>tv});var tm,tg,ty,tv,tx=m({"src/lib/clean_number.ts"(){tm=x(L()),tg=x(P()),ty=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,tv=tp}}),tb=g({"src/lib/slugify.js"(t,r){var i=/<[^>]*>/g,n=/[\p{S}\p{P}]/gu,a=/[\p{Cc}\p{Cf}\uFE00-\uFE0F\u20E3]/gu,o=/�/g,s=/\s+/g,l="-".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),u=RegExp(l+"{3,}","g"),c=RegExp(l+"$","g");r.exports=function(t,r=60){var l,h=("function"==typeof(l=t??"").toWellFormed?l.toWellFormed():new TextDecoder().decode(new TextEncoder().encode(l))).replace(o,"").replace(i," ").replace(n,t=>"-"===t?t:"").toLowerCase().trim().replace(s,"-").replace(a,"").replace(u,"-");return h.length<=r?h:Array.from(h).slice(0,r).join("").replace(c,"")}}}),t_=g({"src/lib/index.js"(t,r){var i=k(),n=D().utcFormat,a=C().format,o=L(),s=P(),l=s.FP_SAFE,u=-l,c=s.BADNUM,h=r.exports={};h.adjustFormat=function(t){if(!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t))return t;if("0.f"===t)return"~f";if(/^\d%/.test(t))return"~%";if(/^\ds/.test(t))return"~s";var r=(t.match(/^[+\-( ]?/)||[""])[0],i=t.slice(r.length);return!/^[~,.0$#]/.test(i)&&/[&fps]/.test(i)?r+"~"+i:t};var d={};h.warnBadFormat=function(t){var r=String(t);d[r]||(d[r]=1,h.warn('encountered bad format: "'+r+'"'))},h.noFormat=function(t){return String(t)},h.numberFormat=function(t){var r;try{r=a(h.adjustFormat(t))}catch{return h.warnBadFormat(t),h.noFormat}return r},h.nestedProperty=R(),h.keyedContainer=B(),h.relativeAttr=j(),h.isPlainObject=F(),h.toLogRange=N(),h.relinkPrivateKeys=V();var m=O();h.isArrayBuffer=m.isArrayBuffer,h.isTypedArray=m.isTypedArray,h.isArrayOrTypedArray=m.isArrayOrTypedArray,h.isArray1D=m.isArray1D,h.ensureArray=m.ensureArray,h.concat=m.concat,h.maxRowLength=m.maxRowLength,h.minRowLength=m.minRowLength;var g=(H(),b(U));h.mod=g.mod,h.modHalf=g.modHalf;var y=ec();h.valObjectMeta=y.valObjectMeta,h.coerce=y.coerce,h.coerce2=y.coerce2,h.coerceFont=y.coerceFont,h.coercePattern=y.coercePattern,h.coerceHoverinfo=y.coerceHoverinfo,h.coerceSelectionMarkerOpacity=y.coerceSelectionMarkerOpacity,h.validate=y.validate;var v=e3();h.dateTime2ms=v.dateTime2ms,h.isDateTime=v.isDateTime,h.ms2DateTime=v.ms2DateTime,h.ms2DateTimeLocal=v.ms2DateTimeLocal,h.cleanDate=v.cleanDate,h.isJSDate=v.isJSDate,h.formatDate=v.formatDate,h.incrementMonth=v.incrementMonth,h.dateTick0=v.dateTick0,h.dfltRange=v.dfltRange,h.findExactDates=v.findExactDates,h.MIN_MS=v.MIN_MS,h.MAX_MS=v.MAX_MS;var x=e4();h.findBin=x.findBin,h.sorterAsc=x.sorterAsc,h.sorterDes=x.sorterDes,h.distinctVals=x.distinctVals,h.roundUp=x.roundUp,h.sort=x.sort,h.findIndexOfMin=x.findIndexOfMin,h.sortObjectKeys=(e9(),b(e6)).default;var _=te();h.aggNums=_.aggNums,h.len=_.len,h.mean=_.mean,h.geometricMean=_.geometricMean,h.median=_.median,h.midRange=_.midRange,h.variance=_.variance,h.stdev=_.stdev,h.interp=_.interp;var w=eq();h.init2dArray=w.init2dArray,h.transposeRagged=w.transposeRagged,h.dot=w.dot,h.translationMatrix=w.translationMatrix,h.rotationMatrix=w.rotationMatrix,h.rotationXYMatrix=w.rotationXYMatrix,h.apply3DTransform=w.apply3DTransform,h.apply2DTransform=w.apply2DTransform,h.apply2DTransform2=w.apply2DTransform2,h.convertCssMatrix=w.convertCssMatrix,h.inverseTransformMatrix=w.inverseTransformMatrix;var T=tt();h.deg2rad=T.deg2rad,h.rad2deg=T.rad2deg,h.angleDelta=T.angleDelta,h.angleDist=T.angleDist,h.isFullCircle=T.isFullCircle,h.isAngleInsideSector=T.isAngleInsideSector,h.isPtInsideSector=T.isPtInsideSector,h.pathArc=T.pathArc,h.pathSector=T.pathSector,h.pathAnnulus=T.pathAnnulus;var A=tr();h.isLeftAnchor=A.isLeftAnchor,h.isCenterAnchor=A.isCenterAnchor,h.isRightAnchor=A.isRightAnchor,h.isTopAnchor=A.isTopAnchor,h.isMiddleAnchor=A.isMiddleAnchor,h.isBottomAnchor=A.isBottomAnchor;var M=ti();h.segmentsIntersect=M.segmentsIntersect,h.segmentDistance=M.segmentDistance,h.getTextLocation=M.getTextLocation,h.clearLocationCache=M.clearLocationCache,h.getVisibleSegment=M.getVisibleSegment,h.findPointOnPath=M.findPointOnPath;var S=$();h.extendFlat=S.extendFlat,h.extendDeep=S.extendDeep,h.extendDeepAll=S.extendDeepAll,h.extendDeepNoArrays=S.extendDeepNoArrays;var E=et();h.log=E.log,h.warn=E.warn,h.error=E.error,h.counterRegex=(eu(),b(eo)).counter;var I=tn();h.throttle=I.throttle,h.throttleDone=I.done,h.clearThrottle=I.clear;var z=eG();h.getGraphDiv=z.getGraphDiv,h.isPlotDiv=z.isPlotDiv,h.removeElement=z.removeElement,h.addStyleRule=z.addStyleRule,h.addRelatedStyleRule=z.addRelatedStyleRule,h.deleteRelatedStyleRule=z.deleteRelatedStyleRule,h.setStyleOnHover=z.setStyleOnHover,h.getFullTransformMatrix=z.getFullTransformMatrix,h.getElementTransformMatrix=z.getElementTransformMatrix,h.getElementAndAncestors=z.getElementAndAncestors,h.equalDomRects=z.equalDomRects,h.clearResponsive=ta(),h.preserveDrawingBuffer=ts(),h.makeTraceGroups=tl(),h._=tu(),h.notifier=ee(),h.filterUnique=tc(),h.filterVisible=th(),h.pushUnique=ed(),h.increment=td(),h.cleanNumber=(tx(),b(tf)).default,h.slugify=tb(),h.ensureNumber=function(t){return o(t)?(t=Number(t))>l||t=r))&&o(t)&&t>=0&&t%1==0},h.noop=eh(),h.identity=e5(),h.repeat=function(t,r){for(var i=Array(r),n=0;ni?Math.max(i,Math.min(r,t)):Math.max(r,Math.min(i,t))},h.bBoxIntersect=function(t,r,i){return i=i||0,t.left<=r.right+i&&r.left<=t.right+i&&t.top<=r.bottom+i&&r.top<=t.bottom+i},h.simpleMap=function(t,r,i,n,a){for(var o=t.length,s=Array(o),l=0;l=Math.pow(2,i)?a>10?(h.warn("randstr failed uniqueness"),l):t(r,i,n,(a||0)+1):l},h.OptionControl=function(t,r){t||(t={}),r||(r="opt");var i={};return i.optionList=[],i._newoption=function(n){n[r]=t,i[n.name]=n,i.optionList.push(n)},i["_"+r]=t,i},h.smooth=function(t,r){if((r=Math.round(r)||0)<2)return t;var i,n,a,o,s=t.length,l=2*s,u=2*r-1,c=Array(u),h=Array(s);for(i=0;i=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=s&&(a=l-1-a),o+=t[a]*c[n];h[i]=o}return h},h.syncOrAsync=function(t,r,i){var n;function a(){return h.syncOrAsync(t,r,i)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(r))&&n.then)return n.then(a);return i&&i(r)},h.stripTrailingSlash=function(t){return"/"===t.slice(-1)?t.slice(0,-1):t},h.noneOrAll=function(t,r,i){if(t){var n,a=!1,o=!0;for(n=0;n0?r:0})},h.fillArray=function(t,r,i,n){if(n=n||h.identity,h.isArrayOrTypedArray(t))for(var a=0;aW.test(window.navigator.userAgent);var Y=/Firefox\/(\d+)\.\d+/;h.getFirefoxVersion=function(){var t=Y.exec(window.navigator.userAgent);if(t&&2===t.length){var r=parseInt(t[1]);if(!isNaN(r))return r}return null},h.isD3Selection=function(t){return t instanceof i.selection},h.ensureSingle=function(t,r,i,n){var a=t.select(r+(i?"."+i:""));if(a.size())return a;var o=t.append(r);return i&&o.classed(i,!0),n&&o.call(n),o},h.ensureSingleById=function(t,r,i,n){var a=t.select(r+"#"+i);if(a.size())return a;var o=t.append(r).attr("id",i);return n&&o.call(n),o},h.objectFromPath=function(t,r){for(var i,n=t.split("."),a=i={},o=0;o1?a+s[1]:"";if(o&&(s.length>1||l.length>4||i))for(;n.test(l);)l=l.replace(n,"$1"+o+"$2");return l+u},h.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var J=/^\w*$/;h.templateString=function(t,r){var i={};return t.replace(h.TEMPLATE_STRING_REGEX,function(t,n){var a;return J.test(n)?a=r[n]:(i[n]=i[n]||h.nestedProperty(r,n).get,a=i[n](!0)),void 0!==a?a:""})};var Q={max:10,count:0,name:"hovertemplate"};h.hovertemplateString=t=>es(p(f({},t),{opts:Q}));var er={max:10,count:0,name:"texttemplate"};h.texttemplateString=t=>es(p(f({},t),{opts:er}));var ei=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,en={max:10,count:0,name:"texttemplate",parseMultDiv:!0};h.texttemplateStringForShapes=t=>es(p(f({},t),{opts:en}));var ea=/^[:|\|]/;function es({data:t=[],locale:r,fallback:i,labels:a={},opts:o,template:s}){return s.replace(h.TEMPLATE_STRING_REGEX,(s,l,u)=>{let c,d=["xother","yother"].includes(l),f=["_xother","_yother"].includes(l),p=["_xother_","_yother_"].includes(l),m=["xother_","yother_"].includes(l),g=d||f||m||p;(f||p)&&(l=l.substring(1)),(m||p)&&(l=l.substring(0,l.length-1));let y=null,v=null;if(o.parseMultDiv){var x,b,_,w=(b=(x=l).match(ei))?{key:b[1],op:b[2],number:Number(b[3])}:{key:x,op:null,number:null};l=w.key,y=w.op,v=w.number}if(g){if(void 0===a[l])return"";c=a[l]}else for(let r of t)if(r){if(r.hasOwnProperty(l)){c=r[l];break}if(J.test(l)||(c=h.nestedProperty(r,l).get(!0)),void 0!==c)break}if(void 0===c){let{count:t,max:r,name:n}=o,a=!1===i?s:i;return t=48&&s<=57,c=l>=48&&l<=57;if(u&&(n=10*n+s-48),c&&(a=10*a+l-48),!u||!c){if(n!==a)return n-a;if(s!==l)return s-l}}return a-n};var el=2e9;h.seedPseudoRandom=function(){el=2e9},h.pseudoRandom=function(){var t=el;return 0x19999999>Math.abs((el=(69069*el+1)%0x100000000)-t)?h.pseudoRandom():el/0x100000000},h.fillText=function(t,r,i){var n=Array.isArray(i)?function(t){i.push(t)}:function(t){i.text=t},a=h.extractOption(t,r,"htx","hovertext");if(h.isValidTextValue(a))return n(a);var o=h.extractOption(t,r,"tx","text");if(h.isValidTextValue(o))return n(o)},h.isValidTextValue=function(t){return t||0===t},h.formatPercent=function(t,r){r=r||0;for(var i=(Math.round(100*t*Math.pow(10,r))*Math.pow(.1,r)).toFixed(r)+"%",n=0;n1&&(c=1):c=0,h.strTranslate(a-c*(i+s),o-c*(n+l))+h.strScale(c)+(u?"rotate("+u+(r?"":" "+i+" "+n)+")":"")},h.setTransormAndDisplay=function(t,r){t.attr("transform",h.getTextTransform(r)),t.style("display",r.scale?null:"none")},h.ensureUniformFontSize=function(t,r){var i=h.extendFlat({},r);return i.size=Math.max(r.size,t._fullLayout.uniformtext.minsize||0),i},h.join2=function(t,r,i){var n=t.length;return n>1?t.slice(0,-1).join(r)+i+t[n-1]:t.join(r)},h.bigFont=function(t){return Math.round(1.2*t)};var ef=h.getFirefoxVersion(),ep=null!==ef&&ef<86;h.getPositionFromD3Event=function(){return ep?[i.event.layerX,i.event.layerY]:[i.event.offsetX,i.event.offsetY]}}}),tw=g({"build/plotcss.js"(){var t,r,i=t_(),n={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .plotly-cloud-dialog":'font-family:"Open Sans",verdana,arial,sans-serif;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1001;display:flex;align-items:center;justify-content:center;background-color:rgba(0,0,0,.4);',"X .plotly-cloud-dialog .plotly-cloud-dialog-box":"box-sizing:border-box;min-width:300px;max-width:420px;padding:20px 24px;background-color:#fff;border:1px solid #e0e2e5;border-radius:4px;box-shadow:0 4px 16px rgba(0,0,0,.25);font-size:13px;color:#2a3f5f;","X .plotly-cloud-dialog .plotly-cloud-dialog-title":"font-size:16px;font-weight:bold;margin-bottom:12px;","X .plotly-cloud-dialog .plotly-cloud-dialog-message":"line-height:1.5;overflow-wrap:break-word;word-wrap:break-word;","X .plotly-cloud-dialog .plotly-cloud-dialog-message--hostname":"font-weight:bold;text-decoration:underline;","X .plotly-cloud-dialog .plotly-cloud-dialog-message--account":"margin-top:16px;padding:8px;border-radius:3px;font-size:.9em;background-color:#edf1f8;","X .plotly-cloud-dialog .plotly-cloud-dialog-buttons":"display:flex;justify-content:flex-end;margin-top:20px;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn":"font-family:inherit;font-size:13px;padding:7px 16px;margin-left:8px;border-radius:3px;border:1px solid rgba(0,0,0,0);cursor:pointer;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn:focus-visible":"outline:2px solid #447adb;outline-offset:1px;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel":"background-color:#f3f3f3;margin-left:auto;color:#777;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--cancel:hover":"background-color:#e0e2e5;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm":"background-color:#447adb;color:#fff;","X .plotly-cloud-dialog .plotly-cloud-dialog-btn--confirm:hover":"background-color:#1d3b84;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(r in n)t=r.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),i.addStyleRule(t,n[r])}}),tT=g({"node_modules/is-browser/client.js"(t,r){r.exports=!0}}),tA=g({"node_modules/has-hover/index.js"(t,r){var i=tT();r.exports="function"==typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:i}}),tM=g({"node_modules/events/events.js"(t,r){var i,n="object"==typeof Reflect?Reflect:null,a=n&&"function"==typeof n.apply?n.apply:function(t,r,i){return Function.prototype.apply.call(t,r,i)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}r.exports=s,r.exports.once=function(t,r){return new Promise(function(i,n){var a,o,s;function l(i){t.removeListener(r,u),n(i)}function u(){"function"==typeof t.removeListener&&t.removeListener("error",l),i([].slice.call(arguments))}y(t,r,u,{once:!0}),"error"!==r&&(a=t,o=l,s={once:!0},"function"==typeof a.on&&y(a,"error",o,s))})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function u(t){if("function"!=typeof t)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function h(t,r,i,n){var a,o,s;if(u(i),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",r,i.listener?i.listener:i),o=t._events),s=o[r]),void 0===s)s=o[r]=i,++t._eventsCount;else if("function"==typeof s?s=o[r]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),(a=c(t))>0&&s.length>a&&!s.warned){s.warned=!0;var l=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(r)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=r,l.count=s.length,console&&console.warn&&console.warn(l)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,r,i){var n={fired:!1,wrapFn:void 0,target:t,type:r,listener:i},a=d.bind(n);return a.listener=i,n.wrapFn=a,a}function p(t,r,i){var n=t._events;if(void 0===n)return[];var a=n[r];return void 0===a?[]:"function"==typeof a?i?[a.listener||a]:[a]:i?function(t){for(var r=Array(t.length),i=0;i0&&(s=r[0]),s instanceof Error)throw s;var s,l=Error("Unhandled error."+(s?" ("+s.message+")":""));throw l.context=s,l}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)a(u,this,r);else for(var c=u.length,h=g(u,c),i=0;i=0;o--)if(i[o]===r||i[o].listener===r){s=i[o].listener,a=o;break}if(a<0)return this;0===a?i.shift():function(t,r){for(;r+1=0;n--)this.removeListener(t,r[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,r){return"function"==typeof t.listenerCount?t.listenerCount(r):m.call(t,r)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}}}),tk=g({"src/lib/events.js"(t,r){var i=tM().EventEmitter;r.exports={init:function(t){if(t._ev instanceof i)return t;var r=new i,n=new i;return t._ev=r,t._internalEv=n,t.on=r.on.bind(r),t.once=r.once.bind(r),t.removeListener=r.removeListener.bind(r),t.removeAllListeners=r.removeAllListeners.bind(r),t._internalOn=n.on.bind(n),t._internalOnce=n.once.bind(n),t._removeInternalListener=n.removeListener.bind(n),t._removeAllInternalListeners=n.removeAllListeners.bind(n),t.emit=function(t,i){r.emit(t,i),n.emit(t,i)},"function"==typeof t.addEventListener&&t.addEventListener("wheel",()=>{},{passive:!0}),t},triggerHandler:function(t,r,i){var n,a=t._ev;if(a){var o=a._events[r];if(o){for(o=Array.isArray(o)?o:[o],n=0;nn.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var r,i;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,i=0;i=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,i=0;i=o.length)return!1;if(2===t.dimensions){if(i++,r.length===i)return t;var s=r[i];if(!b(s))return!1;t=o[a][s]}else t=o[a]}else t=o}}return t}function b(t){return t===Math.round(t)&&t>=0}function _(r){var i,n;return i=r,t.crawl(i,function(r,i,n){!t.isValObject(r)&&h(r)&&(r.role="object")}),n=r,t.crawl(n,function(t,r,i){if(t){var n=t[g];n&&(delete t[g],i[r]={items:{}},i[r].items[n]=t,i[r].role="object")}}),!function t(r){for(var i in r)if(h(r[i]))t(r[i]);else if(Array.isArray(r[i]))for(var n=0;n=o&&(a._input||{})._templateitemname;l&&(s=o);var u,c=i+"["+s+"]";function h(){u={},l&&(u[c]={},u[c][n]=l)}function d(t,i){l?r.nestedProperty(u[c],t).set(i):u[c+"."+t]=i}function f(){var t=u;return h(),t}return h(),{modifyBase:function(t,r){u[t]=r},modifyItem:d,getUpdateObj:f,applyUpdate:function(i,n){i&&d(i,n);var a=f();for(var o in a)r.nestedProperty(t,o).set(a[o])}}}}}),tI=g({"src/plots/cartesian/constants.js"(t,r){var i=(eu(),b(eo)).counter;r.exports={idRegex:{x:i("x","( domain)?"),y:i("y","( domain)?")},attrRegex:i("[xy]axis"),xAxisMatch:i("xaxis"),yAxisMatch:i("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),tL=g({"src/plots/cartesian/axis_ids.js"(t){var r=e2(),i=tI();function n(t,r){if(r&&r.length){for(var i=0;in?1:-1:(t.slice(1)||1)-(r.slice(1)||1)},t.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},t.isLinked=function(t,r){return n(r,t._axisMatchGroups)||n(r,t._axisConstraintGroups)}}}),tP=g({"src/components/shapes/handle_outline.js"(t,r){r.exports={clearOutlineControllers:function(t){var r=t._fullLayout._zoomlayer;r&&r.selectAll(".outline-controllers").remove()},clearOutline:function(t){var r=t._fullLayout._zoomlayer;r&&r.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}}}}),tz=g({"src/traces/scatter/layout_attributes.js"(t,r){r.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),tF=g({"src/plots/get_data.js"(t){var r=e2();tI().SUBPLOT_PATTERN,t.getSubplotCalcData=function(t,i,n){var a=r.subplotsRegistry[i];if(!a)return[];for(var o=a.attr,s=[],l=0;l0?".":"")+o;i.isPlainObject(l)?s(l,r,u,a+1):r(u,o,l)}})}t.manageCommandObserver=function(r,a,o,s){var l={},u=!0;a&&a._commandObserver&&(l=a._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=t.hasSimpleAPICommandBindings(r,o,l.lookupTable);if(a&&a._commandObserver){if(c)return l;if(a._commandObserver.remove)return a._commandObserver.remove(),a._commandObserver=null,l}if(c){n(r,c,l.cache),l.check=function(){if(u){var t=n(r,c,l.cache);return t.changed&&s&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(s({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var h=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],d=0;d1&&z.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,u),s=0;s15&&z.length>15&&0===u.shapes.length&&0===u.images.length,w.linkSubplots(f,u,d,o),w.cleanPlot(f,u,d,o);var N=!!(o._has&&o._has("cartesian")),V=!!(u._has&&u._has("cartesian"));N&&!V?o._bgLayer.remove():V&&!N&&(u._shouldCreateBgLayer=!0),o._zoomlayer&&!t._dragging&&m({_fullLayout:o}),function(t,r){var i,n=[];r.meta&&(i=r._meta={meta:r.meta,layout:{meta:r.meta}});for(var a=0;a0){var d=1-2*l;n=Math.round(d*n),o=Math.round(d*o)}}var f=w.layoutAttributes.width.min,p=w.layoutAttributes.height.min;n1,g=!r.height&&Math.abs(i.height-o)>1;(g||m)&&(m&&(i.width=n),g&&(i.height=o)),t._initialAutoSize||(t._initialAutoSize={width:n,height:o}),w.sanitizeMargins(i)},w.supplyLayoutModuleDefaults=function(t,r,i,n){var a,o,s,u=l.componentsRegistry,c=r._basePlotModules,d=l.subplotsRegistry.cartesian;for(a in u)(s=u[a]).includeBasePlot&&s.includeBasePlot(t,r);for(var f in c.length||c.push(d),r._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(t,r),d.finalizeSubplots(t,r)),r._subplots)r._subplots[f].sort(h.subplotSort);for(o=0;o1&&(i.l/=v,i.r/=v)}if(p){var x=(i.t+i.b)/p;x>1&&(i.t/=x,i.b/=x)}var b=void 0!==i.xl?i.xl:i.x,_=void 0!==i.xr?i.xr:i.x,T=void 0!==i.yt?i.yt:i.y,A=void 0!==i.yb?i.yb:i.y;m[r]={l:{val:b,size:i.l+y},r:{val:_,size:i.r+y},b:{val:A,size:i.b+y},t:{val:T,size:i.t+y}},g[r]=1}else delete m[r],delete g[r];if(!n._replotting)return w.doAutoMargin(t)}},w.doAutoMargin=function(t){var r,i,n=t._fullLayout,o=n.width,s=n.height;n._size||(n._size={}),F(n);var u=n._size,c=n.margin,d={t:0,b:0,l:0,r:0},f=h.extendFlat({},u),m=c.l,g=c.r,y=c.t,v=c.b,x=n._pushmargin,b=n._pushmarginIds,_=n.minreducedwidth,T=n.minreducedheight;if(!1!==c.autoexpand){for(var A in x)b[A]||delete x[A];var M=t._fullLayout._reservedMargin;for(var k in M)for(var S in M[k]){var E=M[k][S];d[S]=Math.max(d[S],E)}for(var D in x.base={l:{val:0,size:m},r:{val:1,size:g},t:{val:1,size:y},b:{val:0,size:v}},d){var C=0;for(var I in x)"base"!==I&&a(x[I][D].size)&&(C=x[I][D].size>C?x[I][D].size:C);var L=Math.max(0,c[D]-C);d[D]=Math.max(0,d[D]-L)}for(var P in x){var z=x[P].l||{},O=x[P].b||{},R=z.val,B=z.size,j=O.val,N=O.size,V=o-d.r-d.l,U=s-d.t-d.b;for(var q in x){if(a(B)&&x[q].r){var G=x[q].r.val,H=x[q].r.size;if(G>R){var $=(B*G+(H-V)*R)/(G-R),W=(H*(1-R)+(B-V)*(1-G))/(G-R);$+W>m+g&&(m=$,g=W)}}if(a(N)&&x[q].t){var Y=x[q].t.val,Z=x[q].t.size;if(Y>j){var X=(N*Y+(Z-U)*j)/(Y-j),K=(Z*(1-j)+(N-U)*(1-Y))/(Y-j);X+K>v+y&&(v=X,y=K)}}}}}var J=h.constrain(o-c.l-c.r,2,_),Q=h.constrain(s-c.t-c.b,2,T),ee=Math.max(0,o-J),et=Math.max(0,s-Q);if(ee){var er=(m+g)/ee;er>1&&(m/=er,g/=er)}if(et){var ei=(v+y)/et;ei>1&&(v/=ei,y/=ei)}if(u.l=Math.round(m)+d.l,u.r=Math.round(g)+d.r,u.t=Math.round(y)+d.t,u.b=Math.round(v)+d.b,u.p=Math.round(c.pad),u.w=Math.round(o)-u.l-u.r,u.h=Math.round(s)-u.t-u.b,!n._replotting&&(w.didMarginChange(f,u)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var r=p.list(t,"",!0);for(var i in r)if(r[i].autoshift||r[i].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in n?n._redrawFromAutoMarginCount++:n._redrawFromAutoMarginCount=1;var en=3*(1+Object.keys(b).length);if(n._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){n=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return l.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o=0,s=0;function u(){return o++,function(){var r;s++,n||s!==o||(r=a,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return l.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(r)))}}i.runFn(u),setTimeout(u())})}],o=h.syncOrAsync(a,t);return o&&o.then||(o=Promise.resolve()),o.then(function(){return t})}w.didMarginChange=function(t,r){for(var i=0;i1)return!0}return!1},w.graphJson=function(t,r=!1,i="json",n=!1,a=!1){(n&&r&&!t._fullData||n&&!r&&!t._fullLayout)&&w.supplyDefaults(t);var s=n?t._fullData:t.data,l=n?t._fullLayout:t.layout,u=(t._transitionData||{})._frames;function c(t,r){if("function"==typeof t)return r?"_function_":null;if(h.isPlainObject(t)){var i={};return Object.keys(t).sort().forEach(function(n){if(-1===["_","["].indexOf(n.charAt(0))){if("function"==typeof t[n]){r&&(i[n]="_function");return}i[n]=c(t[n],r)}}),i}var n=Array.isArray(t),a=h.isTypedArray(t);if((n||a)&&t.dtype&&t.shape){var s=t.bdata;return c({dtype:t.dtype,shape:t.shape,bdata:h.isArrayBuffer(s)?o.encode(s):s},r)}return n?t.map(function(t){return c(t,r)}):a?h.simpleMap(t,h.identity):h.isJSDate(t)?h.ms2DateTimeLocal(+t):t}var d={data:(s||[]).map(function(t){var i=c(t);return r&&delete i.fit,i})};if(!r&&(d.layout=c(l),n)){var f=l._size;d.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return u&&(d.frames=c(u)),a&&(d.config=c(t._context,!0)),"object"===i?d:JSON.stringify(d)},w.modifyFrames=function(t,r){var i,n,a,o=t._transitionData._frames,s=t._transitionData._frameHash;for(i=0;it?t.match(s):null;t.matchTex=l,t.convertToTspans=function(s,v,k){let C;var I=s.text(),z=!s.attr("data-notex")&&v&&v._context.typesetMath&&l(I);z&&!(3===(C=d())||4===C||(null===C?f||(f=!0,i.warn("MathJax is not loaded. Math equations will not be rendered.")):p||(p=!0,i.warn("Unsupported MathJax version:",MathJax.version)),0))&&(z=null);var F=r.select(s.node().parentNode);if(!F.empty()){var O=s.attr("class")?s.attr("class").split(" ")[0]:"text";return O+="-math",F.selectAll("svg."+O).remove(),F.selectAll("g."+O+"-group").remove(),s.style("display",null).attr({"data-unformatted":I,"data-math":"N"}),z?(v&&v._promises||[]).push(new Promise(function(t){let a;s.style("display","none");var o,l,f,p,m=parseInt(s.node().style.fontSize,10),g={fontSize:m},y=s.attr("text-anchor");o=z[2],l=g,f=function(r,i,a){F.selectAll("svg."+O).remove(),F.selectAll("g."+O+"-group").remove();var o=r&&r.select("svg");if(!o||!o.node()){R(),t();return}s.style("display","none");var l=F.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":I,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild);var u=a.width,c=a.height;o.attr({class:O,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none","font-size":g.fontSize+"px"});var h=s.node().style.fill||"black",d=o.select("g");d.attr({fill:h,stroke:h});var f=d.node().getBoundingClientRect(),p=f.width,v=f.height;(p>u||v>c)&&(o.style("overflow","hidden"),p=(f=o.node().getBoundingClientRect()).width,v=f.height);var x=+s.attr("x"),b=+s.attr("y"),_=-(m||s.node().getBoundingClientRect().height)/4;"y"===O[0]?l.attr({transform:"rotate("+[-90,x,b]+")"+n(-p/2,_-v/2)}):"l"===O[0]?b=_-v/2:"a"===O[0]&&0!==O.indexOf("atitle")?(x=0,b=_):(x-=p*("middle"===y?.5:+("end"===y)),b=b+_-v/2),o.attr({x:x,y:b}),k&&k.call(s,l),t(l)},a=d(),Promise.resolve().then(function(){if(!h){let t=MathJax._.output.svg_ts.SVG,r=i.extendFlat({},MathJax.config.svg,{fontCache:"local"});4===a&&(r.linebreaks=i.extendFlat({},r.linebreaks,{inline:!1})),h=MathJax._.mathjax.mathjax.document(document,i.extendFlat({},MathJax.config.options,{InputJax:MathJax.startup.input,OutputJax:new t(r)}))}let t="math-output-"+i.randstr({},64);p=r.select("body").append("div").attr({id:t}).style({visibility:"hidden",position:"absolute","font-size":l.fontSize+"px"});let n=o.replace(u,"\\lt ").replace(c,"\\gt ").replace(/^\$+|\$+$/g,"");return MathJax._.mathjax.mathjax.handleRetriesFor(function(){return h.convert(n,{display:!1})}).then(function(t){p.node().appendChild(t)})}).then(function(){let t=p.select(".MathJax"),r=!t.empty()&&p.select("svg").node();if(r){let i=r.getBoundingClientRect(),n=t.select("defs");f(t,n,i)}else i.log("There was an error in the tex syntax.",o),f();p.remove()}).catch(t=>{i.log("MathJax typesetting failed.",o,t),p&&p.remove(),f()})})):R(),s}function R(){F.empty()||(O=s.attr("class")+"-math",F.select("svg."+O).remove()),s.text("").style("white-space","pre"),function(t,n){n=n.replace(x," ");var s,l=!1,u=[],c=-1;function h(){c++;var i=document.createElementNS(a.svg,"tspan");r.select(i).attr({class:"line",dy:c*o+"em"}),t.appendChild(i),s=i;var n=u;if(u=[{node:i}],n.length>1)for(var l=1;l.",n);var r=u.pop();t!==r.type&&i.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",n),s=u[u.length-1].node}(I);else{var F=C[4],O={type:I},R=E(F,T);if(R?(R=R.replace(D,"$1 fill:"),z&&(R+=";"+z)):z&&(R=z),R&&(O.style=R),"a"===I){l=!0;var B=E(F,A);if(B){var j=P(B);j&&(O.href=j,O.target=E(F,M)||"_blank",O.popup=E(F,S))}}d(O)}}return l}(s.node(),I)&&s.style("pointer-events","all"),t.positionText(s),k&&k.call(s)}};var u=/(<|<|<)/g,c=/(>|>|>)/g,h=null,d=()=>"u">typeof MathJax&&MathJax.version?parseInt(MathJax.version.split(".")[0]):null,f=!1,p=!1,m={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},g={sub:"0.3em",sup:"-0.6em"},y={sub:"-0.21em",sup:"0.42em"},v=["http:","https:","mailto:","",void 0,":"],x=t.NEWLINES=/(\r\n?|\n)/g,b=/(<[^<>]*>)/,_=/<(\/?)([^ >]*)(\s+(.*))?>/i,w=//i;t.BR_TAG_ALL=//gi;var T=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,A=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,S=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function E(t,r){if(!t)return null;var i=t.match(r),n=i&&(i[3]||i[4]);return n&&L(n)}var D=/(^|;)\s*color:/;t.plainText=function(t,r){r=r||{};for(var i=void 0!==r.len&&-1!==r.len?r.len:1/0,n=void 0!==r.allowedTags?r.allowedTags:["br"],a=t.split(b),o=[],s="",l=0,u=0;u3?o.push(c.slice(0,Math.max(0,p-3))+"..."):o.push(c.slice(0,p));break}s=""}}return o.join("")};var C={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},I=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(t){return t.replace(I,function(t,r){return("#"===r.charAt(0)?function(t){if(!(t>1114111)){var r=String.fromCodePoint;if(r)return r(t);var i=String.fromCharCode;return t<=65535?i(t):i((t>>10)+55232,t%1024+56320)}}("x"===r.charAt(1)?parseInt(r.slice(2),16):parseInt(r.slice(1),10)):C[r])||t})}function P(t){var r=encodeURI(decodeURI(t)),i=document.createElement("a"),n=document.createElement("a");i.href=t,n.href=r;var a=i.protocol,o=n.protocol;return -1!==v.indexOf(a)&&-1!==v.indexOf(o)?r:""}function z(t,r,n){var a,o,s,l=n.horizontalAlign,u=n.verticalAlign||"top",c=t.node().getBoundingClientRect(),h=r.node().getBoundingClientRect();return o="bottom"===u?function(){return c.bottom-a.height}:"middle"===u?function(){return c.top+(c.height-a.height)/2}:function(){return c.top},s="right"===l?function(){return c.right-a.width}:"center"===l?function(){return c.left+(c.width-a.width)/2}:function(){return c.left},function(){a=this.node().getBoundingClientRect();var t=s()-h.left,r=o()-h.top,l=n.gd||{};if(n.gd){l._fullLayout._calcInverseTransform(l);var u=i.apply3DTransform(l._fullLayout._invTransform)(t,r);t=u[0],r=u[1]}return this.style({top:r+"px",left:t+"px","z-index":1e3}),this}}t.convertEntities=L,t.sanitizeHTML=function(t){t=t.replace(x," ");for(var i=document.createElement("p"),n=i,a=[],o=t.split(b),s=0;s=0;n--,a++){var o=t[n];i[a]=[1-o[0],o[1]]}return i}function f(t,r){r=r||{};for(var a=t.domain,s=t.range,l=s.length,u=Array(l),c=0;cg-p?p=g-(m-g):m-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,d._sync("colorscale",s))}}}),t6=g({"src/components/colorscale/index.js"(t,r){var i=en(),n=tV();r.exports={moduleType:"component",name:"colorscale",attributes:tH(),layoutAttributes:t$(),supplyLayoutDefaults:t3(),handleDefaults:t2(),crossTraceDefaults:t5(),calc:t4(),scales:i.scales,defaultScale:i.defaultScale,getScale:i.get,isValidScale:i.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}}),t8=g({"src/traces/scatter/subtypes.js"(t,r){var i=t_(),n=O().isTypedArraySpec;r.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){var r=t.marker;return i.isPlainObject(r)&&(i.isArrayOrTypedArray(r.size)||n(r.size))}}}}),t7=g({"src/traces/scatter/make_bubble_size_func.js"(t,r){var i=L();r.exports=function(t,r){r||(r=2);var n=t.marker,a=n.sizeref||1,o=n.sizemin||0,s="area"===n.sizemode?function(t){return Math.sqrt(t/a)}:function(t){return t/a};return function(t){var n=s(t/r);return i(n)&&n>0?Math.max(n,o):0}}}}),t9=g({"src/components/fx/helpers.js"(t){var r=t_();t.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},t.isTraceInSubplots=function(r,i){if("splom"===r.type){for(var n=r.xaxes||[],a=r.yaxes||[],o=0;o=0&&i.index{let s,l=n.toLowerCase(),u=n,c=(s=o.match(a))?s.map(Number):[];for("m"===l&&c.length>2&&(r.push([u,...c.splice(0,2)]),l="l",u="m"===u?"l":"L");;){if(c.length===i[l])return r.push([u,...c]),"";if(c.length=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}S.symbolNumber=function(t){if(p(t))t*=1;else if("string"==typeof t){var r=0;t.indexOf("-open")>0&&(r=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(r+=200,t=t.replace("-dot","")),(t=S.symbolNames.indexOf(t))>=0&&(t+=r)}return t%100>=P||t>=400?0:Math.floor(Math.max(t,0))};var F=f("~f"),O={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function R(t,r,i,n,a,o,s,l,u,c){var f,p=a.length;"linear"===n?f={node:"linearGradient",attrs:{x1:s.x,y1:s.y,x2:l.x,y2:l.y,gradientUnits:u?"userSpaceOnUse":"objectBoundingBox"},reversed:c}:"radial"===n&&(f={node:"radialGradient",reversed:c});for(var m=Array(p),y=0;y=0&&void 0===t.i&&(t.i=o.i),r.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),n.ms2mrc){u="various"===t.ms||"various"===s.size?3:n.ms2mrc(t.ms),t.mrc=u,n.selectedSizeFn&&(u=t.mrc=n.selectedSizeFn(t));var u,c=S.symbolNumber(t.mx||s.symbol)||0;t.om=c%200>=100;var h=eo(t,i),f=Q(t,i);r.attr("d",z(c,u,h,f))}var p,m,y,v=!1;if(t.so)y=l.outlierwidth,m=l.outliercolor,p=s.outliercolor;else{var x=(l||{}).width;y=(t.mlw+1||x+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in t?t.mlcc=n.lineScale(t.mlc):d.isArrayOrTypedArray(l.color)?g.defaultLine:l.color,d.isArrayOrTypedArray(s.color)&&(p=g.defaultLine,v=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}let b=t.mld||(l||{}).dash;if(b&&S.dashLine(r,b,y),t.om)r.call(g.stroke,p).style({"stroke-width":(y||1)+"px",fill:"none"});else{r.style("stroke-width",(t.isBlank?0:y)+"px");var _=s.gradient,w=t.mgt;w?v=!0:w=_&&_.type,d.isArrayOrTypedArray(w)&&(O[w=w[0]]||(w=0));var T=s.pattern,A=S.getPatternAttr,M=T&&(A(T.shape,t.i,"")||A(T.path,t.i,""));if(w&&"none"!==w){var k=t.mgc;k?v=!0:k=_.color;var E=i.uid;v&&(E+="-"+t.i),S.gradient(r,a,E,w,[[0,k],[1,p]],"fill")}else if(M){var D=!1,C=T.fgcolor;!C&&o&&o.color&&(C=o.color,D=!0);var I=A(C,t.i,o&&o.color||null),L=A(T.bgcolor,t.i,null),P=T.fgopacity,F=A(T.size,t.i,8),R=A(T.solidity,t.i,.3);D=D||t.mcc||d.isArrayOrTypedArray(T.shape)||d.isArrayOrTypedArray(T.path)||d.isArrayOrTypedArray(T.bgcolor)||d.isArrayOrTypedArray(T.fgcolor)||d.isArrayOrTypedArray(T.size)||d.isArrayOrTypedArray(T.solidity);var B=i.uid;D&&(B+="-"+t.i),S.pattern(r,"point",a,B,M,F,R,t.mcc,T.fillmode,L,I,P)}else d.isArrayOrTypedArray(p)?g.fill(r,p[t.i]):g.fill(r,p);y&&g.stroke(r,m)}},S.makePointStyleFns=function(t){var r={},i=t.marker;return r.markerScale=S.tryColorscale(i,""),r.lineScale=S.tryColorscale(i,"line"),m.traceIs(t,"symbols")&&(r.ms2mrc=T.isBubble(t)?A(t):function(){return(i.size||6)/2}),t.selectedpoints&&d.extendFlat(r,S.makeSelectedPointStyleFns(t)),r},S.makeSelectedPointStyleFns=function(t){var r={},i=t.selected||{},n=t.unselected||{},a=t.marker||{},o=i.marker||{},s=n.marker||{},l=a.opacity,u=o.opacity,c=s.opacity,h=void 0!==u,f=void 0!==c;(d.isArrayOrTypedArray(l)||h||f)&&(r.selectedOpacityFn=function(t){var r=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:r:f?c:w*r});var p=a.color,g=o.color,y=s.color;(g||y)&&(r.selectedColorFn=function(t){var r=t.mcc||p;return t.selected?g||r:y||r});var v=a.size,x=o.size,b=s.size,_=void 0!==x,T=void 0!==b;return m.traceIs(t,"symbols")&&(_||T)&&(r.selectedSizeFn=function(t){var r=t.mrc||v/2;return t.selected?_?x/2:r:T?b/2:r}),r},S.makeSelectedTextStyleFns=function(t){var r={},i=t.selected||{},n=t.unselected||{},a=t.textfont||{},o=i.textfont||{},s=n.textfont||{},l=a.color,u=o.color,c=s.color;return r.selectedTextColorFn=function(t){var r=t.tc||l;return t.selected?u||r:c||(u?r:g.addOpacity(r,w))},r},S.selectedPointStyle=function(t,r){if(!(!t.size()||!r.selectedpoints)){var i=S.makeSelectedPointStyleFns(r),n=r.marker||{},a=[];i.selectedOpacityFn&&a.push(function(t,r){t.style("opacity",i.selectedOpacityFn(r))}),i.selectedColorFn&&a.push(function(t,r){g.fill(t,i.selectedColorFn(r))}),i.selectedSizeFn&&a.push(function(t,a){var o=a.mx||n.symbol||0,s=i.selectedSizeFn(a);t.attr("d",z(S.symbolNumber(o),s,eo(a,r),Q(a,r))),a.mrc2=s}),a.length&&t.each(function(t){for(var r=h.select(this),i=0;i0?i:0}function V(t,r,i){return i&&(t=W(t)),r?q(t[1]):U(t[0])}function U(t){var r=h.round(t,2);return i=r,r}function q(t){var r=h.round(t,2);return n=r,r}function G(t,r,i,n){var a=t[0]-r[0],o=t[1]-r[1],s=i[0]-r[0],l=i[1]-r[1],u=Math.pow(a*a+o*o,.25),c=Math.pow(s*s+l*l,.25),h=(c*c*a-u*u*s)*n,d=(c*c*o-u*u*l)*n,f=3*c*(u+c),p=3*u*(u+c);return[[U(r[0]+(f&&h/f)),q(r[1]+(f&&d/f))],[U(r[0]-(p&&h/p)),q(r[1]-(p&&d/p))]]}S.textPointStyle=function(t,r,i){if(t.size()){if(r.selectedpoints){var n;n=S.makeSelectedTextStyleFns(r).selectedTextColorFn}var a=r.texttemplate,o=i._fullLayout;t.each(function(t){var s=h.select(this),l=a?d.extractOption(t,r,"txt","texttemplate"):d.extractOption(t,r,"tx","text");if(!l&&0!==l)return void s.remove();if(a){var u=r._module.formatLabels,c=u?u(t,r,o):{},f={};M(f,r,t.i),l=d.texttemplateString({data:[f,t,r._meta],fallback:r.texttemplatefallback,labels:c,locale:o._d3locale,template:l})}var p=t.tp||r.textposition,m=N(t,r),g=n?n(t):t.tc||r.textfont.color;s.call(S.font,{family:t.tf||r.textfont.family,weight:t.tw||r.textfont.weight,style:t.ty||r.textfont.style,variant:t.tv||r.textfont.variant,textcase:t.tC||r.textfont.textcase,lineposition:t.tE||r.textfont.lineposition,shadow:t.tS||r.textfont.shadow,size:m,color:g}).text(l).call(x.convertToTspans,i).call(j,p,m,t.mrc)})}},S.selectedTextStyle=function(t,r){if(!(!t.size()||!r.selectedpoints)){var i=S.makeSelectedTextStyleFns(r);t.each(function(t){var n=h.select(this),a=i.selectedTextColorFn(t),o=t.tp||r.textposition,s=N(t,r);g.fill(n,a);var l=m.traceIs(r,"bar-like");j(n,o,s,t.mrc2||t.mrc,l)})}},S.smoothopen=function(t,r){if(t.length<3)return"M"+t.join("L");var i,n="M"+t[0],a=[];for(i=1;i=h||w>=p&&w<=h)&&(T<=m&&T>=f||T>=m&&T<=f)&&(t=[w,T])}return t}S.steps=function(t){var r=H[t]||$;return function(t){for(var i="M"+U(t[0][0])+","+q(t[0][1]),n=t.length,a=1;a=1e4&&(S.savedBBoxes={},Y=0),i&&(S.savedBBoxes[i]=g),Y++,d.extendFlat({},g)},S.setClipUrl=function(t,r,i){t.attr("clip-path",X(r,i))},S.getTranslate=function(t){var r=t.attr?"attr":"getAttribute",i=(t[r]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,r,i){return[r,i].join(" ")}).split(" ");return{x:+i[0]||0,y:+i[1]||0}},S.setTranslate=function(t,r,i){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return r=r||0,i=i||0,o=(o=o.replace(/(\btranslate\(.*?\);?)/,"").trim()+v(r,i)).trim(),t[a]("transform",o),o},S.getScale=function(t){var r=t.attr?"attr":"getAttribute",i=(t[r]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,r,i){return[r,i].join(" ")}).split(" ");return{x:+i[0]||1,y:+i[1]||1}},S.setScale=function(t,r,i){var n=t.attr?"attr":"getAttribute",a=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return r=r||1,i=i||1,o=(o=o.replace(/(\bscale\(.*?\);?)/,"").trim()+("scale("+r+","+i)+")").trim(),t[a]("transform",o),o};var K=/\s*sc.*/;S.setPointGroupScale=function(t,r,i){if(r=r||1,i=i||1,t){var n=1===r&&1===i?"":"scale("+r+","+i+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(K,"");t+=n,t=t.trim(),this.setAttribute("transform",t)})}};var J=/translate\([^)]*\)\s*$/;function Q(t,r){var i;return t&&(i=t.mf),void 0===i&&(i=r.marker&&r.marker.standoff||0),r._geo||r._xA?i:-i}S.setTextPointsScale=function(t,r,i){t&&t.each(function(){var t,n=h.select(this),a=n.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(n.attr("transform")||"").match(J);t=1===r&&1===i?[]:[v(o,s),"scale("+r+","+i+")",v(-o,-s)],l&&t.push(l),n.attr("transform",t.join(""))}})},S.getMarkerStandoff=Q;var ee=Math.atan2,et=Math.cos,er=Math.sin;function en(t,r){var i=r[0],n=r[1];return[i*et(t)-n*er(t),i*er(t)+n*et(t)]}function eo(t,r){var i=t.ma;void 0===i&&(!p(i=r.marker.angle)||d.isArrayOrTypedArray(i))&&(i=0);var n,h,f=r.marker.angleref;if("previous"===f||"north"===f){if(r._geo){var m=r._geo.project(t.lonlat);n=m[0],h=m[1]}else{var g=r._xA,y=r._yA;if(!g||!y)return 90;n=g.c2p(t.x),h=y.c2p(t.y)}if(r._geo){var v,x=t.lonlat[0],b=t.lonlat[1],_=r._geo.project([x,b+1e-5]),w=r._geo.project([x+1e-5,b]),T=ee(w[1]-h,w[0]-n),A=ee(_[1]-h,_[0]-n);if("north"===f)v=i/180*Math.PI;else if("previous"===f){var M=b/180*Math.PI,k=o/180*Math.PI,S=a/180*Math.PI-x/180*Math.PI;v=-ee(et(k)*er(S),er(k)*et(M)-et(k)*er(M)*et(S))-Math.PI,a=x,o=b}var E=en(T,[et(v),0]),D=en(A,[er(v),0]);i=ee(E[1]+D[1],E[0]+D[0])/Math.PI*180,"previous"===f&&(c!==r.uid||t.i!==u+1)&&(i=null)}if("previous"===f&&!r._geo)if(c===r.uid&&t.i===u+1&&p(n)&&p(h)){var C=n-s,I=h-l,L=r.line&&r.line.shape||"",P=L.slice(L.length-1);"h"===P&&(I=0),"v"===P&&(C=0),i+=ee(I,C)/Math.PI*180+90}else i=null}return s=n,l=h,u=t.i,c=r.uid,i}S.getMarkerAngle=eo}}),ri=g({"src/components/titles/index.js"(t,r){var i=k(),n=L(),a=tR(),o=e2(),s=t_(),l=s.strTranslate,u=rr(),c=ei(),h=tN(),d=ea(),f=tj().OPPOSITE_SIDE,p=/ [XY][0-9]* /;r.exports={draw:function(t,r,m){var g,y=t._fullLayout,v=m.propContainer,x=m.propName,b=m.placeholder,_=m.traceIndex,w=m.avoid||{},T=m.attributes,A=m.transform,M=m.containerGroup,k=1,S=v.title,E=(S&&S.text?S.text:"").trim(),D=!1,C=S&&S.font?S.font:{},I=C.family,L=C.size,P=C.color,z=C.weight,F=C.style,O=C.variant,R=C.textcase,B=C.lineposition,j=C.shadow,N=!!m.subtitlePropName,V=m.subtitlePlaceholder,U=(v.title||{}).subtitle||{text:"",font:{}},q=(U.text||"").trim(),G=!1,H=1,$=U.font,W=$.family,Y=$.size,Z=$.color,X=$.weight,K=$.style,J=$.variant,Q=$.textcase,ee=$.lineposition,et=$.shadow;"title.text"===x?g="titleText":-1!==x.indexOf("axis")?g="axisTitleText":-1!==x.indexOf("colorbar")&&(g="colorbarTitleText");var er=t._context.edits[g];function ei(t,r){return void 0!==t&&void 0!==r&&t.replace(p," % ")===r.replace(p," % ")}""===E?k=0:ei(E,b)&&(er||(E=""),k=.2,D=!0),N&&(""===q?H=0:ei(q,V)&&(er||(q=""),H=.2,G=!0)),m._meta?E=s.templateString(E,m._meta):y._meta&&(E=s.templateString(E,y._meta));var en,ea=E||q||er;M||(M=s.ensureSingle(y._infolayer,"g","g-"+r),en=y._hColorbarMoveTitle);var eo=M.selectAll("text."+r).data(ea?[0]:[]);eo.enter().append("text"),eo.text(E).attr("class",r),eo.exit().remove();var es=null,el=r+"-subtitle",eu=q||er;if(N&&((es=M.selectAll("text."+el).data(eu?[0]:[])).enter().append("text"),es.text(q).attr("class",el),es.exit().remove()),!ea)return M;function ec(t,r){s.syncOrAsync([eh,ed],{title:t,subtitle:r})}function eh(n){var o,d=n.title,f=n.subtitle;if(!A&&en&&(A={}),A?(o="",A.rotate&&(o+="rotate("+[A.rotate,T.x,T.y]+")"),(A.offset||en)&&(o+=l(0,(A.offset||0)-(en||0)))):o=null,d.attr("transform",o),d.style("opacity",k*c.opacity(P)).call(u.font,{color:c.rgb(P),size:i.round(L,2),family:I,weight:z,style:F,variant:O,textcase:R,shadow:j,lineposition:B}).attr(T).call(h.convertToTspans,t,function(t){if(t){var r=i.select(t.node().parentNode).select("."+el);if(!r.empty()){var n=t.node().getBBox();if(n.height){var a=n.y+n.height+1.6*Y;r.attr("y",a)}}}}),f&&!f.empty()){var p=M.select("."+r+"-math-group"),m=d.node().getBBox(),g=p.node()?p.node().getBBox():void 0,y=g?g.y+g.height+1.6*Y:m.y+m.height+1.6*Y,v=s.extendFlat({},T,{y:y});f.attr("transform",o),f.style("opacity",H*c.opacity(Z)).call(u.font,{color:c.rgb(Z),size:i.round(Y,2),family:W,weight:X,style:K,variant:J,textcase:Q,shadow:et,lineposition:ee}).attr(v).call(h.convertToTspans,t)}return a.previousPromises(t)}function ed(r){var a=r.title,o=i.select(a.node().parentNode);if(w&&w.selection&&w.side&&E){o.attr("transform",null);var c=f[w.side],h="left"===w.side||"top"===w.side?-1:1,d=n(w.pad)?w.pad:2,p=u.bBox(o.node()),m={t:0,b:0,l:0,r:0},g=t._fullLayout._reservedMargin;for(var x in g)for(var b in g[x]){var _=g[x][b];m[b]=Math.max(m[b],_)}var T={left:m.l,top:m.t,right:y.width-m.r,bottom:y.height-m.b},A=w.maxShift||h*(T[w.side]-p[w.side]),M=0;if(A<0)M=A;else{var k=w.offsetLeft||0,S=w.offsetTop||0;p.left-=k,p.right-=k,p.top-=S,p.bottom-=S,w.selection.each(function(){var t=u.bBox(this);s.bBoxIntersect(p,t,d)&&(M=Math.max(M,h*(t[w.side]-p[c])+d))}),v._titleScoot=Math.abs(M=Math.min(A,M))}if(M>0||A<0){var D={left:[-M,0],right:[M,0],top:[0,-M],bottom:[0,M]}[w.side];o.attr("transform",l(D[0],D[1]))}}}function ef(t,r){t.text(r).on("mouseover.opacity",function(){i.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){i.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)})}if(eo.call(ec,es),er&&(E?eo.on(".opacity",null):(ef(eo,b),D=!0),eo.call(h.makeEditable,{gd:t}).on("edit",function(r){void 0!==_?o.call("_guiRestyle",t,x,r,_):o.call("_guiRelayout",t,x,r)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ec)}).on("input",function(t){this.text(t||" ").call(h.positionText,T.x,T.y)}),N)){if(N&&!E){var ep=eo.node().getBBox(),em=ep.y+ep.height+1.6*Y;es.attr("y",em)}q?es.on(".opacity",null):(ef(es,V),G=!0),es.call(h.makeEditable,{gd:t}).on("edit",function(r){o.call("_guiRelayout",t,"title.subtitle.text",r)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ec)}).on("input",function(t){this.text(t||" ").call(h.positionText,es.attr("x"),es.attr("y"))})}return eo.classed("js-placeholder",D),es&&!es.empty()&&es.classed("js-placeholder",G),M},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),rn=g({"src/plots/cartesian/set_convert.js"(t,r){var i=k(),n=D().utcFormat,a=t_(),o=a.numberFormat,s=L(),l=a.cleanNumber,u=a.ms2DateTime,c=a.dateTime2ms,h=a.ensureNumber,d=a.isArrayOrTypedArray,f=P(),p=f.FP_SAFE,m=f.BADNUM,g=f.LOG_CLIP,y=f.ONEWEEK,v=f.ONEDAY,x=f.ONEHOUR,b=f.ONEMIN,_=f.ONESEC,w=tL(),T=tI(),A=T.HOUR_PATTERN,M=T.WEEKDAY_PATTERN;function S(t){return Math.pow(10,t)}r.exports=function(t,r){r=r||{};var f=t._id||"x",k=f.charAt(0);function E(r,i){if(r>0)return Math.log(r)/Math.LN10;if(!(r<=0)||!i||!t.range||2!==t.range.length)return m;var n=t.range[0],a=t.range[1];return .5*(n+a-2*g*Math.abs(n-a))}function D(r,i,n,o){if((o||{}).msUTC&&s(r))return+r;var l=c(r,n||t.calendar);if(l===m)if(!s(r))return m;else{r*=1;var u=Math.floor(10*a.mod(r+.05,1));l=c(new Date(Math.round(r-u/10)))+u/10}return l}function C(r,i,n){return u(r,i,n||t.calendar)}function I(r){return t._categories[Math.round(r)]}function L(r){if(null!=r){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[r])return t._categoriesMap[r];t._categories.push("number"==typeof r?String(r):r);var i=t._categories.length-1;return t._categoriesMap[r]=i,i}return m}function P(r){if(t._categoriesMap)return t._categoriesMap[r]}function z(t){var r=P(t);return void 0!==r?r:s(t)?+t:void 0}function F(t){return s(t)?+t:P(t)}function O(t,r,n){return i.round(n+r*t,2)}var R=function(r){return s(r)?O(r,t._m,t._b):m},B=function(r){var i;return i=t._m,(r-t._b)/i};if(t.rangebreaks){var j="y"===k;R=function(r){if(!s(r))return m;var i=t._rangebreaks.length;if(!i)return O(r,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,o=a*r,l=0,u=0;uh)l=u+1;else{l=o<(c+h)/2?u:u+1;break}}var d=t._B[l]||0;return isFinite(d)?O(r,t._m2,d):0},B=function(r){var i,n,a=t._rangebreaks.length;if(!a)return i=t._m,(r-t._b)/i;for(var o=0,s=0;st._rangebreaks[s].pmax&&(o=s+1);return n=t._m2,(r-t._B[o])/n}}t.c2l="log"===t.type?E:h,t.l2c="log"===t.type?S:h,t.l2p=R,t.p2l=B,t.c2p="log"===t.type?function(t,r){return R(E(t,r))}:R,t.p2c="log"===t.type?function(t){return S(B(t))}:B,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=h,t.d2p=t.r2p=function(r){return t.l2p(l(r))},t.p2d=t.p2r=B,t.cleanPos=h):"log"===t.type?(t.d2r=t.d2l=function(t,r){return E(l(t),r)},t.r2d=t.r2c=function(t){return S(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=h,t.c2r=E,t.l2d=S,t.d2p=function(r,i){return t.l2p(t.d2r(r,i))},t.p2d=function(t){return S(B(t))},t.r2p=function(r){return t.l2p(l(r))},t.p2r=B,t.cleanPos=h):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=D,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(r,i,n){return t.l2p(D(r,0,n))},t.p2d=t.p2r=function(t,r,i){return C(B(t),r,i)},t.cleanPos=function(r){return a.cleanDate(r,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=L,t.r2d=t.c2d=t.l2d=I,t.d2r=t.d2l_noadd=z,t.r2c=function(r){var i=F(r);return void 0!==i?i:t.fraction2r(.5)},t.l2r=t.c2r=h,t.r2l=F,t.d2p=function(r){return t.l2p(t.r2c(r))},t.p2d=function(t){return I(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:h(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=I,t.d2r=t.d2l_noadd=z,t.r2c=function(r){var i=z(r);return void 0!==i?i:t.fraction2r(.5)},t.r2c_just_indices=P,t.l2r=t.c2r=h,t.r2l=z,t.d2p=function(r){return t.l2p(t.r2c(r))},t.p2d=function(t){return I(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:h(t)},t.setupMultiCategory=function(i){var n,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length){for(var u in l)if(u!==f){var c=r[w.id2name(u)];s=s.concat(c._traceIndices)}}var h=[[0,{}],[0,{}]],p=[];for(n=0;nu[1]&&(o[+!l]=n,s[1]=u[1]),s[0]>=s[1])if(void 0!==i){var c=u[0]+1;void 0!==n&&(c=Math.min(c,u[1])),o[+!l]=t.l2r(c)}else void 0!==n&&(o[+!!l]=t.l2r(u[1]-1))}},t.cleanRange=function(r,i){t._cleanRange(r,i),t.limitRange(r)},t._cleanRange=function(r,i){i||(i={}),r||(r="range");var n,o,l=a.nestedProperty(t,r).get();if(o=(o="date"===t.type?a.dfltRange(t.calendar):"y"===k?T.DFLTRANGEY:"realaxis"===t._name?[0,1]:i.dfltRange||T.DFLTRANGEX).slice(),("tozero"===t.rangemode||"nonnegative"===t.rangemode)&&(o[0]=0),!l||2!==l.length)return void a.nestedProperty(t,r).set(o);var u=null===l[0],c=null===l[1];for("date"!==t.type||t.autorange||(l[0]=a.cleanDate(l[0],m,t.calendar),l[1]=a.cleanDate(l[1],m,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!a.isDateTime(l[n],t.calendar)){t[r]=o;break}if(t.r2l(l[0])===t.r2l(l[1])){var h=a.constrain(t.r2l(l[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);l[0]=t.l2r(h-1e3),l[1]=t.l2r(h+1e3);break}}else{if(!s(l[n]))if(!(u||c)&&s(l[1-n]))l[n]=l[1-n]*(n?10:.1);else{t[r]=o;break}if(l[n]<-p?l[n]=-p:l[n]>p&&(l[n]=p),l[0]===l[1]){var d=Math.max(1,Math.abs(1e-6*l[0]));l[0]-=d,l[1]+=d}}},t.setScale=function(i){var n,a,o=r._size;if(t.overlaying){var s=w.getFromId({_fullLayout:r},t.overlaying);t.domain=s.domain}var l=i&&t._r?"_r":"range",u=t.calendar;t.cleanRange(l);var c=t.r2l(t[l][0],u),h=t.r2l(t[l][1],u),d="y"===k;if(d?(t._offset=o.t+(1-t.domain[1])*o.h,t._length=o.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-h),t._b=-t._m*h):(t._offset=o.l+t.domain[0]*o.w,t._length=o.w*(t.domain[1]-t.domain[0]),t._m=t._length/(h-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(c,h),Math.max(c,h)),t._rangebreaks.length)){for(n=0;nh&&(f=!f),f&&t._rangebreaks.reverse();var p=f?-1:1;for(t._m2=p*t._length/(Math.abs(h-c)-t._lBreaks),t._B.push(-t._m2*(d?h:c)),n=0;no&&(o+=7,so&&(o+=24,s=n&&s=n&&r=l.min&&(tl.max&&(l.max=n),o=!1)}o&&c.push({min:t,max:n})}};for(n=0;n2*l}(d,r))return"date";var y="strict"!==n.autotypenumbers;return!function(t,r){for(var i=t.length,n=c(i),o=0,s=0,h={},d=0;d2*o}(d,y)?!function(t,r){for(var n,a=t.length,o=0;o0&&((k=I-l(w)-u(T))>L?S/k>P&&(A=w,M=T,P=S/k):S/I>P&&(A={val:w.val,nopad:1},M={val:T.val,nopad:1},P=S/I));if(g===y){var z=g-1,F=g+1;if(D)if(0===g)o=[0,1];else{var O=(g>0?d:h).reduce(function(t,r){return Math.max(t,u(r))},0),R=g/(1-Math.min(.5,O/I));o=g>0?[0,R]:[R,0]}else o=C?[Math.max(0,z),Math.max(1,F)]:[z,F]}else D?(A.val>=0&&(A={val:0,nopad:1}),M.val<=0&&(M={val:0,nopad:1})):C&&(A.val-P*l(A)<0&&(A={val:0,nopad:1}),M.val<=0&&(M={val:1,nopad:1})),P=(M.val-A.val-f(r,w.val,T.val))/(I-l(A)-u(M)),o=[A.val-P*l(A),M.val+P*u(M)];return o=_(o,r),r.limitRange&&r.limitRange(),x&&o.reverse(),a.simpleMap(o,r.l2r||Number)}function f(t,r,i){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(r,i),o=0;o0?i.ppadplus:i.ppadminus)||i.ppad||0),D=S((t._m>0?i.ppadminus:i.ppadplus)||i.ppad||0),C=S(i.vpadplus||i.vpad),I=S(i.vpadminus||i.vpad);if(!M){if(f=1/0,p=-1/0,A)for(a=0;a<_;a++)(s=r[a])0&&(f=s),s>p&&s-o&&(f=s),s>p&&s=z;a--)P(a);return{min:m,max:b,opts:i}},concatExtremes:m};function g(t,r,i,n,a){for(var o=n.tozero,s=n.extrapad,l=!0,u=0;u=i&&(c.extrapad||!s)){l=!1;break}a(r,c.val)&&c.pad<=i&&(s||!c.extrapad)&&(t.splice(u,1),u--)}if(l){var h=o&&0===r;t.push({val:r,pad:h?0:i,extrapad:!h&&s})}}function y(t){return n(t)&&Math.abs(t)=r}function b(t,r,i){return void 0===r||void 0===i||(r=t.d2l(r))<(i=t.d2l(i))}function _(t,r){if(!r||!r.autorangeoptions)return t;var i,n,o,s,l=t[0],u=t[1],c=r.autorangeoptions.include;if(void 0!==c){var h=r.d2l(l),d=r.d2l(u);a.isArrayOrTypedArray(c)||(c=[c]);for(var f=0;f=p&&(h=p,l=p),d<=p&&(d=p,u=p)}}return i=l,l=(n=r.autorangeoptions)&&void 0!==n.minallowed&&b(r,n.minallowed,n.maxallowed)?n.minallowed:n&&void 0!==n.clipmin&&b(r,n.clipmin,n.clipmax)?Math.max(i,r.d2l(n.clipmin)):i,o=u,[l,u=(s=r.autorangeoptions)&&void 0!==s.maxallowed&&b(r,s.minallowed,s.maxallowed)?s.maxallowed:s&&void 0!==s.clipmax&&b(r,s.clipmin,s.clipmax)?Math.min(o,r.d2l(s.clipmax)):o]}}}),rs=g({"src/plots/cartesian/axes.js"(t,r){var i=k(),n=L(),a=tR(),o=e2(),s=t_(),l=s.strTranslate,u=tN(),c=ri(),h=ei(),d=rr(),f=tq(),p=tY(),m=(tI(),P()),g=m.ONEMAXYEAR,y=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,A=m.ONEMINMONTH,M=m.ONEWEEK,S=m.ONEDAY,E=S/2,D=m.ONEHOUR,C=m.ONEMIN,I=m.ONESEC,z=m.ONEMILLI,F=m.ONEMICROSEC,O=m.MINUS_SIGN,R=m.BADNUM,B={K:"zeroline"},j={K:"gridline",L:"path"},N={K:"minor-gridline",L:"path"},V={K:"tick",L:"path"},U={K:"tick",L:"text"},q={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},G=tj(),H=G.MID_SHIFT,$=G.CAP_SHIFT,W=G.LINE_SPACING,Y=G.OPPOSITE_SIDE,Z=r.exports={};Z.setConvert=rn();var X=ra(),K=tL(),J=K.idSort,Q=K.isLinked;Z.id2name=K.id2name,Z.name2id=K.name2id,Z.cleanId=K.cleanId,Z.list=K.list,Z.listIds=K.listIds,Z.getFromId=K.getFromId,Z.getFromTrace=K.getFromTrace;var ee=ro();function et(t){var r=(t[1]-t[0])*1e-4;return[t[0]-r,t[1]+r]}Z.getAutoRange=ee.getAutoRange,Z.findExtremes=ee.findExtremes,Z.coerceRef=function(t,r,i,n,a,o){var l=n.charAt(n.length-1),u=i._fullLayout._subplots[l+"axis"],c=n+"ref",h={};return a||(a=u[0]||("string"==typeof o?o:o[0])),o||(o=a),u=u.concat(u.map(function(t){return t+" domain"})),h[c]={valType:"enumerated",values:u.concat(o?"string"==typeof o?[o]:o:[]),dflt:a},s.coerce(t,r,h,c)},Z.coerceRefArray=function(t,r,i,n,a,o,l){let u=n.charAt(n.length-1);var c=i._fullLayout._subplots[u+"axis"];let h=n+"ref";var d=t[h];a||(a=c[0]||("string"==typeof o?o:o[0])),c=(c=c.concat(c.map(t=>t+" domain"))).concat(o||[]),d.length>l?(s.warn("Array attribute "+h+" has more entries than expected, truncating to "+l),d=d.slice(0,l)):d.lengthMath.abs((t/r+.5)%1-.5)}function es(t,r){return .001>Math.abs(t/r-1)}function el(t){return+t.substring(1)}function eu(t,r){return t.rangebreaks&&(r=r.filter(function(r){return t.maskBreaks(r.x)!==R})),r}function ec(t,r){var i=et(s.simpleMap(t.range,t.r2l)),n=Math.min(i[0],i[1]),a=Math.max(i[0],i[1]),o="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var l=[],u=0;u<=1;u++)if(!(void 0!==r&&(r&&u||!1===r&&!u))&&!(u&&!t.minor)){var c=u?t.minor.tickvals:t.tickvals,h=u?[]:t.ticktext;if(c){s.isArrayOrTypedArray(h)||(h=[]);var d=-1,f=-1;if(!u)for(var p=0;pn&&mn&&y2e-6||((i-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},Z.saveRangeInitial=function(t,r){for(var i=Z.list(t,"",!0),n=!1,a=0;a.3*f||h(a)||h(o))){var p=i.dtick/2;t+=t+p.8){var l=Number(i.slice(1));o.exactYears>.8&&l%12==0?t=Z.tickIncrement(t,"M6","reverse")+1.5*S:o.exactMonths>.8?t=Z.tickIncrement(t,"M1","reverse")+15.5*S:t-=E;var u=Z.tickIncrement(t,i);if(u<=n)return u}return t}(x,t,v,u,o)),g=x,y=0;g<=c;)g=Z.tickIncrement(g,v,!1,o),y++;return{start:r.c2r(x,0,o),end:r.c2r(g,0,o),size:v,_dataSpan:c-u}},Z.prepMinorTicks=function(t,r,i){var a,o;if(!(null!=(a=r.minor)&&a.dtick)){delete t.dtick;var l,u=r.dtick&&n(r._tmin);if(u){var c=Z.tickIncrement(r._tmin,r.dtick,!0);l=[r._tmin,.99*c+.01*r._tmin]}else{var h=s.simpleMap(r.range,r.r2l);l=[h[0],.8*h[0]+.2*h[1]]}if(t.range=s.simpleMap(l,r.l2r),t._isMinor=!0,Z.prepTicks(t,i),u){var d=n(r.dtick),f=n(t.dtick),p=d?r.dtick:+r.dtick.substring(1),m=f?t.dtick:+t.dtick.substring(1);d&&f?eo(p,m)?p===2*M&&m===2*S&&(t.dtick=M):p===2*M&&m===3*S?t.dtick=M:p!==M||(r._input.minor||{}).nticks?es(p/m,2.5)?t.dtick=p/2:t.dtick=p:t.dtick=S:"M"===String(r.dtick).charAt(0)?f?t.dtick="M1":eo(p,m)?p>=12&&2===m&&(t.dtick="M3"):t.dtick=r.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(r.dtick).charAt(0)?eo(p,m)||(t.dtick=es(p/m,2.5)?r.dtick/2:r.dtick):t.dtick="D1":"D2"===t.dtick&&+r.dtick>1&&(t.dtick=1)}t.range=r.range}(null==(o=r.minor)?void 0:o._tick0Init)===void 0&&(t.tick0=r.tick0)},Z.prepTicks=function(t,r){var i=s.simpleMap(t.range,t.r2l,void 0,void 0,r);if("auto"===t.tickmode||!t.dtick){var a,o=t.nticks;o||("category"===t.type||"multicategory"===t.type?(a=t.tickfont?s.bigFont(t.tickfont.size||12):15,o=t._length/a):(a="y"===t._id.charAt(0)?40:80,o=s.constrain(t._length/a,4,9)+1),"radialaxis"===t._name&&(o*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(o*=100),t._roughDTick=Math.abs(i[1]-i[0])/o,Z.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){function r(){return!(n(t.dtick)||"M"!==t.dtick.charAt(0))}var i,a=r(),o=Z.getTickFormat(t);if(o){var s=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(o)||(/%[HI]/.test(o)?(i=D,s&&!a&&t.dtickel(t.dtick):t.dtickel(t.dtick):t.dtick<_)&&(t.dtick="M3")):/%[Yy]/.test(o)&&(i=y,s&&(a?12>el(t.dtick):t.dtickt.range[1],h=!t.ticklabelindex||s.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],d=s.simpleMap(t.range,t.r2l,void 0,void 0,r),f=d[1]=+!V;U--){var q,G=!U;U?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):V&&(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var H=U?t:s.extendFlat({},t,V?t.minor:{minor:{}});if(G?Z.prepMinorTicks(H,t,r):Z.prepTicks(H,r),"array"===H.tickmode){U?(O=[],L=ec(t,!G)):(B=[],P=ec(t,!G));continue}if("sync"===H.tickmode){O=[],L=function(t){var r=t._mainAxis,i=[];if(r._vals){for(var n=-1,a=-1,o=0;o=Y:er<=Y;er=Z.tickIncrement(er,ei,f,o)){if(U&&Q++,H.rangebreaks&&!f){if(er=m)break}if(O.length>k||er===ee)break;ee=er;var ea={value:function(t,r,i){if(![i,t,r].every(n)||0===i)return t;let a=Math.round((t-r)/i),o=r+a*i;return t!==o&&Math.abs(t-o)<1e-6*Math.abs(i)?o:t}(er,en,ei)};U?(er===J&&(ea.first=!0),K&&er!==(0|er)&&(ea.simpleLabel=!0),l>1&&Q%l&&(ea.skipLabel=!0),O.push(ea)):(ea.minor=!0,B.push(ea))}}if(!B||B.length<3?h=!1:(eb=(B[2].value-B[1].value)*(c?-1:1),e_=t.tickformat,(/%f/.test(e_)?eb>=F:/%L/.test(e_)?eb>=z:/%[SX]/.test(e_)?eb>=I:/%M/.test(e_)?eb>=C:/%[HI]/.test(e_)?eb>=D:/%p/.test(e_)?eb>=E:/%[Aadejuwx]/.test(e_)?eb>=S:/%[UVW]/.test(e_)?eb>=M:/%[Bbm]/.test(e_)?eb>=A:/%[q]/.test(e_)?eb>=_:!/%[Yy]/.test(e_)||eb>=v)||(h=!1,B=B.slice(1))),h){var eo=O.concat(B);u&&O.length&&(eo=eo.slice(1)),(eo=eo.sort(function(t,r){return t.value-r.value}).filter(function(t,r,i){return 0===r||t.value!==i[r-1].value})).map(function(t,r){return void 0!==t.minor||t.skipLabel?null:r}).filter(function(t){return null!==t}).forEach(function(t){h.map(function(r){var i=t+r;i>=0&&i0?n-1:n,l=n);var u=t[s].value,c=Math.abs(t[l].value-u),h=i||c,d=0;h>=v?d=c>=v&&c<=g?c:y:i===b&&h>=_?d=c>=_&&c<=x?c:b:h>=A?d=c>=A&&c<=w?c:T:i===M&&h>=M?d=M:h>=S?d=S:i===E&&h>=E?d=E:i===D&&h>=D&&(d=D),d>=c&&(d=c,a=!0);var f=o+d;if(r.rangebreaks&&d>0){for(var p=0,m=0;m<84;m++){var k=(m+.5)/84;r.maskBreaks(o*(1-k)+k*f)!==R&&p++}(d*=p/84)||(t[n].drop=!0),a&&c>M&&(d=c)}(d>0||0===n)&&(t[n].periodX=o+d/2)}}(j,t,t._definedDelta),t.rangebreaks){var eg="y"===t._id.charAt(0),ey=1;"auto"===t.tickmode&&(ey=t.tickfont?t.tickfont.size:12);var ev=NaN;for(ew=O.length-1;ew>-1;ew--){if(O[ew].drop){O.splice(ew,1);continue}O[ew].value=eB(O[ew].value,t);var ex=t.c2p(O[ew].value);(eg?ev>ex-ey:evm||nm&&(i.periodX=m),n10||"01-01"!==a.slice(5)?t._tickround="d":t._tickround=r.slice(1)%12==0?"y":"m";else if(r>=S&&o<=10||r>=15*S)t._tickround="d";else if(r>=C&&o<=16||r>=D)t._tickround="M";else if(r>=I&&o<=19||r>=C)t._tickround="S";else{var s=t.l2r(i+r).replace(/^-/,"").length;t._tickround=Math.max(o,s)-20,t._tickround<0&&(t._tickround=4)}}else if(n(r)||"L"===r.charAt(0)){var l=t.range.map(t.r2d||Number);n(r)||(r=Number(r.slice(1))),t._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01);var u=Math.floor(Math.log(Math.max(Math.abs(l[0]),Math.abs(l[1])))/Math.LN10+.01);Math.abs(u)>(void 0===t.minexponent?3:t.minexponent)&&(eT(t.exponentformat)&&"SI extended"!==t.exponentformat&&!eA(u)||eT(t.exponentformat)&&"SI extended"===t.exponentformat&&!eM(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function eb(t,r,i){var n=t.tickfont||{};return{x:r,dx:0,dy:0,text:i||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}Z.autoTicks=function(t,r,i){var a;function o(t){return Math.pow(t,Math.floor(Math.log(r)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var l=2*r;if(l>y)r/=y,a=o(10),t.dtick="M"+12*ev(r,a,eh);else if(l>T)t.dtick="M"+ev(r/=T,1,ed);else if(l>S){if(t.dtick=ev(r,S,t._hasDayOfWeekBreaks?[1,2,7,14]:ep),!i){var u=Z.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(u)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else l>D?t.dtick=ev(r,D,ed):l>C?t.dtick=ev(r,C,ef):l>I?t.dtick=ev(r,I,ef):(a=o(10),t.dtick=ev(r,a,eh))}else if("log"===t.type){t.tick0=0;var h=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(r*=1.5),r>.7)t.dtick=Math.ceil(r);else if(1>Math.abs(h[1]-h[0])){var d=1.5*Math.abs((h[1]-h[0])/r);r=Math.abs(Math.pow(10,h[1])-Math.pow(10,h[0]))/d,a=o(10),t.dtick="L"+ev(r,a,eh)}else t.dtick=r>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(r,1))):eR(t)?(t.tick0=0,t.dtick=ev(r,a=1,ey)):(t.tick0=0,a=o(10),t.dtick=ev(r,a,eh));if(0===t.dtick&&(t.dtick=1),!n(t.dtick)&&"string"!=typeof t.dtick){var f=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(f)}},Z.tickIncrement=function(t,r,a,o){var l=a?-1:1;if(n(r))return s.increment(t,l*r);var u=r.charAt(0),c=l*Number(r.slice(1));if("M"===u)return s.incrementMonth(t,c,o);if("L"===u)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===u){var h="D2"===r?eg:em,d=t+.01*l,f=s.roundUp(s.mod(d,1),h,a);return Math.floor(d)+Math.log(i.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(r)},Z.tickFirst=function(t,r){var a=t.r2l||Number,o=s.simpleMap(t.range,a,void 0,void 0,r),l=o[1]=0&&i<=t._length?r:null};if(k&&s.isArrayOrTypedArray(t.ticktext)){var I=s.simpleMap(t.range,t.r2l),L=(Math.abs(I[1]-I[0])-(t._lBreaks||0))/1e4;for(w=0;w ")}else t._prevDateHead=u,c+="
"+u;r.text=c}(t,M,i,S):"log"===E?function(t,r,i,a){var o=t.dtick,l=r.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);if("never"===a&&(a=""),i&&"L"!==c&&(o="L3",c="L"),u||"L"===c)r.text=ek(Math.pow(10,l),t,a,i);else if(n(o)||"D"===c&&("complete"===t.minorloglabels||.1>s.mod(l+.01,1))){"complete"!==t.minorloglabels||.1>s.mod(l+.01,1)||(r.fontSize*=.75);var h=Math.pow(10,l).toExponential(0).split("e"),d=+h[1],f=Math.abs(d),p=t.exponentformat;"power"===p||eT(p)&&"SI extended"!==p&&eA(d)||eT(p)&&"SI extended"===p&&eM(d)?(r.text=h[0],f>0&&(r.text+="x10"),"1x10"===r.text&&(r.text="10"),0!==d&&1!==d&&(r.text+=""+(d>0?"":O)+f+""),r.fontSize*=1.25):("e"===p||"E"===p)&&f>2?r.text=h[0]+p+(d>0?"+":O)+f:(r.text=ek(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(r.dy-=r.fontSize/6))}else if("D"===c)r.text="none"===t.minorloglabels?"":String(Math.round(Math.pow(10,s.mod(l,1)))),r.fontSize*=.75;else throw"unrecognized dtick "+String(o);if("D1"===t.dtick){var m=String(r.text).charAt(0);("0"===m||"1"===m)&&("y"===t._id.charAt(0)?r.dx-=r.fontSize/4:(r.dy+=r.fontSize/2,r.dx+=(t.range[1]>t.range[0]?1:-1)*r.fontSize*(l<0?.5:.25)))}}(t,M,S,z):"category"===E?(l=t,u=M,void 0===(c=l._categories[Math.round(u.x)])&&(c=""),u.text=String(c)):"multicategory"===E?(h=t,d=M,f=i,p=Math.round(d.x),g=void 0===(m=h._categories[p]||[])[1]?"":String(m[1]),y=void 0===m[0]?"":String(m[0]),f?d.text=y+" - "+g:(d.text=g,d.text2=y)):eR(t)?function(t,r,i,n,a){if("radians"!==t.thetaunit||i)r.text=ek(r.x,t,a,n);else{var o=r.x/180;if(0===o)r.text="0";else{var l=function(t){function r(t,r){return 1e-6>=Math.abs(t-r)}var i=function(t){for(var i=1;!r(Math.round(t*i)/i,t);)i*=10;return i}(t),n=t*i,a=Math.abs(function t(i,n){return r(n,0)?i:t(n,i%n)}(n,i));return[Math.round(n/a),Math.round(i/a)]}(o);if(l[1]>=100)r.text=ek(s.deg2rad(r.x),t,a,n);else{var u=r.x<0;1===l[1]?1===l[0]?r.text="π":r.text=l[0]+"π":r.text=["",l[0],"","⁄","",l[1],"","π"].join(""),u&&(r.text=O+r.text)}}}}(t,M,i,S,z):(v=t,x=M,b=S,"never"===(_=z)?_="":"all"===v.showexponent&&1e-6>Math.abs(x.x/v.dtick)&&(_="hide"),x.text=ek(x.x,v,_,b)),a||(t.tickprefix&&!P(t.showtickprefix)&&(M.text=t.tickprefix+M.text),t.ticksuffix&&!P(t.showticksuffix)&&(M.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(M.text)){var F=t.labelalias[M.text];"string"==typeof F&&(M.text=F)}return("boundaries"===t.tickson||t.showdividers)&&(M.xbnd=[C(M.x-.5),C(M.x+t.dtick-.5)]),M},Z.hoverLabelText=function(t,r,i){i&&(t=s.extendFlat({},t,{hoverformat:i}));var n=s.isArrayOrTypedArray(r)?r[0]:r,a=s.isArrayOrTypedArray(r)?r[1]:void 0;if(void 0!==a&&a!==n)return Z.hoverLabelText(t,n,i)+" - "+Z.hoverLabelText(t,a,i);var o="log"===t.type&&n<=0,l=Z.tickText(t,t.c2l(o?-n:n),"hover").text;return o?0===n?"0":O+l:l};var e_=["f","p","n","μ","m","","k","M","G","T"],ew=["q","r","y","z","a",...e_,"P","E","Z","Y","R","Q"],eT=t=>["SI","SI extended","B"].includes(t);function eA(t){return t>14||t<-15}function eM(t){return t>32||t<-30}function ek(t,r,i,a){var o,l,u,c=t<0,h=r._tickround,d=i||r.exponentformat||"B",f=r._tickexponent,p=Z.getTickFormat(r),m=r.separatethousands;if(a){var g={exponentformat:d,minexponent:r.minexponent,dtick:"none"===r.showexponent?r.dtick:n(t)&&Math.abs(t)||1,range:"none"===r.showexponent?r.range.map(r.r2d):[0,t||1]};ex(g),h=(Number(g._tickround)||0)+4,f=g._tickexponent,r.hoverformat&&(p=r.hoverformat)}if(p)return r._numFormat(p)(t).replace(/-/g,O);"none"===d&&(f=0);let y=Math.pow(10,-h)/2;if((t=Math.abs(t))"+u+"":"B"===d&&9===f?t+="B":eT(d)&&(t+="SI extended"===d?ew[f/3+10]:e_[f/3+5])),c?O+t:t}function eS(t,r){if(t){var i=Object.keys(q).reduce(function(t,i){return -1!==r.indexOf(i)&&q[i].forEach(function(r){t[r]=1}),t},{});Object.keys(t).forEach(function(r){i[r]||(1===r.length?t[r]=0:delete t[r])})}}function eE(t){return void 0!==t.periodX?t.periodX:t.x}function eD(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function eC(t){var r=t.title.font.size,i=(t.title.text.match(u.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?r*($+i*W):i?r*(i+1)*W:r}function eI(t,r){var i=t.l2p(r);return i>1&&i=a.min&&t0)switch(t.type){case"date":case"linear":for(r=0;r=n(t))}(t.dtick,n.dtickrange,a)){i=n;break}break;case"log":for(r=0;r=0,s=0>=o(t,r[1]);return(i||a)&&(n||s)}(t.dtick,n.dtickrange)){i=n;break}}return i?i.value:t.tickformat},Z.getSubplots=function(t,r){var i=t._fullLayout._subplots,n=i.cartesian.concat(i.gl2d||[]),a=r?Z.findSubplotsWithAxis(n,r):n;return a.sort(function(t,r){var i=t.slice(1).split("y"),n=r.slice(1).split("y");return i[0]===n[0]?i[1]-n[1]:i[0]-n[0]}),a},Z.findSubplotsWithAxis=function(t,r){for(var i=new RegExp("x"===r._id.charAt(0)?"^"+r._id+"y":r._id+"$"),n=[],a=0;a=0&&a.unshift(a.splice(n,1).shift())}});var l={false:{left:0,right:0}};return s.syncOrAsync(a.map(function(r){return function(){if(r){var n=Z.getFromId(t,r);i||(i={}),i.axShifts=l,i.overlayingShiftedAx=o;var a=Z.drawOne(t,n,i);return n._shiftPusher&&eV(n,n._fullDepth||0,l,!0),n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),a}}}))},Z.drawOne=function(t,r,i){var n,l,f,p=(i=i||{}).axShifts||{},m=i.overlayingShiftedAx||[];r.setScale();var g=t._fullLayout,y=r._id,v=y.charAt(0),x=Z.counterLetter(y),b=g._plots[r._mainSubplot],_="above traces"===r.zerolinelayer;if(b){if(r._shiftPusher=r.autoshift||-1!==m.indexOf(r._id)||-1!==m.indexOf(r.overlaying),r._shiftPusher&"free"===r.anchor){var w=r.linewidth/2||0;"inside"===r.ticks&&(w+=r.ticklen),eV(r,w,p,!0),eV(r,r.shift||0,p,!1)}(!0!==i.skipTitle||void 0===r._shift)&&(C=r,I=p,r._shift=C.autoshift?I[C.overlaying][C.side]:C.shift||0);var T=b[v+"axislayer"],A=r._mainLinePosition,M=A+=r._shift,k=r._mainMirrorPosition,S=r._vals=Z.calcTicks(r),E=[r.mirror,M,k].join("_");for(n=0;n0?i.bottom-h:0,d))));var f=0,p=0;if(r._shiftPusher&&(f=Math.max(d,i.height>0?"l"===u?h-i.left:i.right-h:0),r.title.text!==g._dfltTitle[v]&&(p=(r._titleStandoff||0)+(r._titleScoot||0),"l"===u&&(p+=eC(r))),r._fullDepth=Math.max(f,p)),r.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var m=[0,1],y="number"==typeof r._shift?r._shift:0;if("x"===v){if("b"===u?n[u]=r._depth:(n[u]=r._depth=Math.max(i.width>0?h-i.top:0,d),m.reverse()),i.width>0){var b=i.right-(r._offset+r._length);b>0&&(n.xr=1,n.r=b);var _=r._offset-i.left;_>0&&(n.xl=0,n.l=_)}}else if("l"===u?(r._depth=Math.max(i.height>0?h-i.left:0,d),n[u]=r._depth-y):(r._depth=Math.max(i.height>0?i.right-h:0,d),n[u]=r._depth+y,m.reverse()),i.height>0){var w=i.bottom-(r._offset+r._length);w>0&&(n.yb=0,n.b=w);var T=r._offset-i.top;T>0&&(n.yt=1,n.t=T)}n[x]="free"===r.anchor?r.position:r._anchorAxis.domain[m[0]],r.title.text!==g._dfltTitle[v]&&(n[u]+=eC(r)+(r.title.standoff||0)),r.mirror&&"free"!==r.anchor&&((s={x:0,y:0,r:0,l:0,t:0,b:0})[c]=r.linewidth,r.mirror&&!0!==r.mirror&&(s[c]+=d),!0===r.mirror||"ticks"===r.mirror?s[x]=r._anchorAxis.domain[m[1]]:("all"===r.mirror||"allticks"===r.mirror)&&(s[x]=[r._counterDomainMin,r._counterDomainMax][m[1]]))}em&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(t,r)),"string"==typeof r.automargin&&(eS(n,r.automargin),eS(s,r.automargin)),a.autoMargin(t,eP(r),n),a.autoMargin(t,ez(r),s),a.autoMargin(t,eF(r),l)}),s.syncOrAsync(ef)}}function eg(t){var i=y+(t||"tick");return D[i]||(D[i]=function(t,r,i){var n,a,o,s;if(t._selections[r].size())n=1/0,a=-1/0,o=1/0,s=-1/0,t._selections[r].each(function(){var t=eL(this);if("none"!==t.node().style.display){var r=d.bBox(t.node().parentNode);n=Math.min(n,r.top),a=Math.max(a,r.bottom),o=Math.min(o,r.left),s=Math.max(s,r.right)}});else{var l=Z.makeLabelFns(t,i);n=a=l.yFn({dx:0,dy:0,fontSize:0}),o=s=l.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:a,left:o,right:s,height:a-n,width:s-o}}(r,i,M)),D[i]}},Z.getTickSigns=function(t,r){var i=t._id.charAt(0),n=t.side===({x:"top",y:"right"})[i]?1:-1,a=[-1,1,n,-n];return"inside"!==(r?(t.minor||{}).ticks:t.ticks)==("x"===i)&&(a=a.map(function(t){return-t})),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},Z.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(r){return l(t._offset+t.l2p(r.x),0)}:function(r){return l(0,t._offset+t.l2p(r.x))}},Z.makeTransTickLabelFn=function(t){var r=function(t){var r=t.ticklabelposition||"",i=t.tickson||"",n=function(t){return -1!==r.indexOf(t)},a=n("top"),o=n("left"),s=n("right"),l=n("bottom"),u=n("inside"),c="boundaries"!==i&&(l||o||a||s);if(!c&&!u)return[0,0];var h=t.side,d=c?(t.tickwidth||0)/2:0,f=3,p=t.tickfont?t.tickfont.size:12;return(l||a)&&(d+=p*$,f+=(t.linewidth||0)/2),(o||s)&&(d+=(t.linewidth||0)/2,f+=3),u&&"top"===h&&(f-=p*(1-$)),(o||a)&&(d=-d),("bottom"===h||"right"===h)&&(f=-f),[c?d:0,u?f:0]}(t),i=t.ticklabelshift||0,n=t.ticklabelstandoff||0,a=r[0],o=r[1],s=t.range[0]>t.range[1],u=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf("inside");if(i&&(i*=s?-1:1),n){var c=t.side;n*=u&&("top"===c||"left"===c)||!u&&("bottom"===c||"right"===c)?1:-1}return"x"===t._id.charAt(0)?function(r){return l(a+t._offset+t.l2p(eE(r))+i,o+n)}:function(r){return l(o+n,a+t._offset+t.l2p(eE(r))+i)}},Z.makeTickPath=function(t,r,i,n){n||(n={});var a=n.minor;if(a&&!t.minor)return"";var o=void 0!==n.len?n.len:a?t.minor.ticklen:t.ticklen,s=t._id.charAt(0),l=(t.linewidth||1)/2;return"x"===s?"M0,"+(r+l*i)+"v"+o*i:"M"+(r+l*i)+",0h"+o*i},Z.makeLabelFns=function(t,r,i){var a=t.ticklabelposition||"",o=t.tickson||"",l=function(t){return -1!==a.indexOf(t)},u=l("top"),c=l("left"),h=l("right"),d=l("bottom"),f="boundaries"!==o&&(d||c||u||h),p=l("inside"),m="inside"===a&&"inside"===t.ticks||!p&&"outside"===t.ticks&&"boundaries"!==o,g=0,y=0,v=m?t.ticklen:0;if(p?v*=-1:f&&(v=0),m&&(g+=v,i)){var x=s.deg2rad(i);g=v*Math.cos(x)+1,y=v*Math.sin(x)}t.showticklabels&&(m||t.showline)&&(g+=.2*t.tickfont.size);var b,_,w,T,A,M={labelStandoff:g+=(t.linewidth||1)/2*(p?-1:1),labelShift:y},k=0,S=t.side,E=t._id.charAt(0),D=t.tickangle;if("x"===E)T=(A=!p&&"bottom"===S||p&&"top"===S)?1:-1,p&&(T*=-1),b=y*T,_=r+g*T,w=A?1:-.2,90===Math.abs(D)&&(p?w+=H:w=-90===D&&"bottom"===S?$:90===D&&"top"===S?H:.5,k=H/2*(D/90)),M.xFn=function(t){return t.dx+b+k*t.fontSize},M.yFn=function(t){return t.dy+_+t.fontSize*w},M.anchorFn=function(t,r){if(f){if(c)return"end";if(h)return"start"}return n(r)&&0!==r&&180!==r?r*T<0!==p?"end":"start":"middle"},M.heightFn=function(r,i,n){return i<-60||i>60?-.5*n:"top"===t.side!==p?-n:0};else if("y"===E){if(T=(A=!p&&"left"===S||p&&"right"===S)?1:-1,p&&(T*=-1),b=g,_=y*T,w=0,p||90!==Math.abs(D)||(w=-90===D&&"left"===S||90===D&&"right"===S?$:.5),p){var C=n(D)?+D:0;0!==C&&(k=Math.abs(Math.sin(s.deg2rad(C)))*$*T,w=0)}M.xFn=function(t){return t.dx+r-(b+t.fontSize*w)*T+k*t.fontSize},M.yFn=function(t){return t.dy+_+t.fontSize*H},M.anchorFn=function(t,r){return n(r)&&90===Math.abs(r)?"middle":A?"end":"start"},M.heightFn=function(r,i,n){return"right"===t.side&&(i*=-1),i<-30?-n:i<30?-.5*n:0}}return M},Z.drawTicks=function(t,r,n){n=n||{};var a=r._id+"tick",o=[].concat(r.minor&&r.minor.ticks?n.vals.filter(function(t){return t.minor&&!t.noTick}):[]).concat(r.ticks?n.vals.filter(function(t){return!t.minor&&!t.noTick}):[]),s=n.layer.selectAll("path."+a).data(o,eD);s.exit().remove(),s.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each(function(t){return h.stroke(i.select(this),t.minor?r.minor.tickcolor:r.tickcolor)}).style("stroke-width",function(i){return d.crispRound(t,i.minor?r.minor.tickwidth:r.tickwidth,1)+"px"}).attr("d",n.path).style("display",null),eN(r,[V]),s.attr("transform",n.transFn)},Z.drawGrid=function(t,r,n){if(n=n||{},"sync"!==r.tickmode){var a=r._id+"grid",o=r.minor&&r.minor.showgrid,s=o?n.vals.filter(function(t){return t.minor}):[],l=r.showgrid?n.vals.filter(function(t){return!t.minor}):[],u=n.counterAxis;if(u&&Z.shouldShowZeroLine(t,r,u))for(var c="array"===r.tickmode,f=0;f=0;v--){var x=v?g:y;if(x){var b=x.selectAll("path."+a).data(v?l:s,eD);b.exit().remove(),b.enter().append("path").classed(a,1).classed("crisp",!1!==n.crisp),b.attr("transform",n.transFn).attr("d",n.path).each(function(t){return h.stroke(i.select(this),t.minor?r.minor.gridcolor:r.gridcolor||"#ddd")}).style("stroke-dasharray",function(t){return d.dashStyle(t.minor?r.minor.griddash:r.griddash,t.minor?r.minor.gridwidth:r.gridwidth)}).style("stroke-width",function(t){return(t.minor?m:r._gw)+"px"}).style("display",null),"function"==typeof n.path&&b.attr("d",n.path)}}eN(r,[j,N])}},Z.drawZeroLine=function(t,r,i){i=i||i;var n=r._id+"zl",a=Z.shouldShowZeroLine(t,r,i.counterAxis),o=i.layer.selectAll("path."+n).data(a?[{x:0,id:r._id}]:[]);o.exit().remove(),o.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==i.crisp).each(function(){i.layer.selectAll("path").sort(function(t,r){return J(t.id,r.id)})}),o.attr("transform",i.transFn).attr("d",i.path).call(h.stroke,r.zerolinecolor||h.defaultLine).style("stroke-width",d.crispRound(t,r.zerolinewidth,r._gw||1)+"px").style("display",null),eN(r,[B])},Z.drawLabels=function(t,r,a){a=a||{};var o=t._fullLayout,c=r._id,h="above traces"===r.zerolinelayer,f=a.cls||c+"tick",p=a.vals.filter(function(t){return t.text}),m=a.labelFns,g=a.secondary?0:r.tickangle,y=(r._prevTickAngles||{})[f],v=a.layer.selectAll("g."+f).data(r.showticklabels?p:[],eD),x=[];function b(t,o){t.each(function(t){var s=i.select(this),c=s.select(".text-math-group"),h=m.anchorFn(t,o),f=a.transFn.call(s.node(),t)+(n(o)&&0!=+o?" rotate("+o+","+m.xFn(t)+","+(m.yFn(t)-t.fontSize/2)+")":""),p=u.lineCount(s),g=W*t.fontSize,y=m.heightFn(t,n(o)?+o:0,(p-1)*g);if(y&&(f+=l(0,y)),c.empty()){var v=s.select("text");v.attr({transform:f,"text-anchor":h}),v.style("display",null),r._adjustTickLabelsOverflow&&r._adjustTickLabelsOverflow()}else{var x=d.bBox(c.node()).width;c.attr("transform",f+l(x*({end:-.5,start:.5})[h],0))}})}v.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each(function(r){var n=i.select(this),a=t._promises.length;n.call(u.positionText,m.xFn(r),m.yFn(r)).call(d.font,{family:r.font,size:r.fontSize,color:r.fontColor,weight:r.fontWeight,style:r.fontStyle,variant:r.fontVariant,textcase:r.fontTextcase,lineposition:r.fontLineposition,shadow:r.fontShadow}).text(r.text).call(u.convertToTspans,t),t._promises[a]?x.push(t._promises.pop().then(function(){b(n,g)})):b(n,g)}),eN(r,[U]),v.exit().remove(),a.repositionOnUpdate&&v.each(function(t){i.select(this).select("text").call(u.positionText,m.xFn(t),m.yFn(t))}),r._adjustTickLabelsOverflow=function(){var n=r.ticklabeloverflow;if(!(!n||"allow"===n)){var a=-1!==n.indexOf("hide"),l="x"===r._id.charAt(0),u=0,c=l?t._fullLayout.width:t._fullLayout.height;if(-1!==n.indexOf("domain")){var h=s.simpleMap(r.range,r.r2l);u=r.l2p(h[0])+r._offset,c=r.l2p(h[1])+r._offset}var f=Math.min(u,c),p=Math.max(u,c),m=r.side,g=1/0,y=-1/0;for(var x in v.each(function(t){var n=i.select(this);if(n.select(".text-math-group").empty()){var o=d.bBox(n.node()),s=0;l?(o.right>p||o.leftp||o.top+(r.tickangle?0:t.fontSize/4)r["_visibleLabelMin_"+n._id]?u.style("display","none"):"tick"!==t.K||a||"none"===u.node().style.display||u.style("display",null)})})})})},b(v,y+1?y:g);var _=null;r._selections&&(r._selections[f]=v);var w=[function(){return x.length&&Promise.all(x)}];r.automargin&&o._redrawFromAutoMarginCount&&90===y?(_=y,w.push(function(){b(v,y)})):w.push(function(){if(b(v,g),p.length&&r.autotickangles&&("log"!==r.type||"D"!==String(r.dtick).charAt(0))){_=r.autotickangles[0];var t,i=0,n=[],o=1;v.each(function(t){i=Math.max(i,t.fontSize);var a=r.l2p(t.x),s=eL(this),l=d.bBox(s.node());o=Math.max(o,u.lineCount(s)),n.push({top:0,bottom:10,height:10,left:a-l.width/2,right:a+l.width/2+2,width:l.width+2})});var l=("boundaries"===r.tickson||r.showdividers)&&!a.secondary,c=p.length,h=Math.abs((p[c-1].x-p[0].x)*r._m)/(c-1),f=l?h/2:h,m=Math.sqrt(Math.pow(f,2)+Math.pow(l?r.ticklen:1.25*i*o,2)),y=f/m,x=r.autotickangles.map(function(t){return t*Math.PI/180}),w=x.find(function(t){return Math.abs(Math.cos(t))<=y});void 0===w&&(w=x.reduce(function(t,r){return Math.abs(Math.cos(t))R*O&&(P=O,C[D]=I[D]=z[D])}var q=Math.abs(P-L);q-k>0?(q-=k,k*=1+k/q):k=0,"y"!==r._id.charAt(0)&&(k=-k),C[E]=A.p2r(A.r2p(I[E])+S*k),"min"===A.autorange||"max reversed"===A.autorange?(C[0]=null,A._rangeInitial0=void 0,A._rangeInitial1=void 0):("max"===A.autorange||"min reversed"===A.autorange)&&(C[1]=null,A._rangeInitial0=void 0,A._rangeInitial1=void 0),o._insideTickLabelsUpdaterange[A._name+".range"]=C}var G=s.syncOrAsync(w);return G&&G.then&&t._promises.push(G),G},Z.getPxPosition=function(t,r){var i,n=t._fullLayout._size,a=r._id.charAt(0),o=r.side;return("free"!==r.anchor?i=r._anchorAxis:"x"===a?i={_offset:n.t+(1-(r.position||0))*n.h,_length:0}:"y"===a&&(i={_offset:n.l+(r.position||0)*n.w+r._shift,_length:0}),"top"===o||"left"===o)?i._offset:"bottom"===o||"right"===o?i._offset+i._length:void 0},Z.shouldShowZeroLine=function(t,r,i){var n=s.simpleMap(r.range,r.r2l);return n[0]*n[1]<=0&&r.zeroline&&("linear"===r.type||"-"===r.type)&&!(r.rangebreaks&&r.maskBreaks(0)===R)&&(eI(r,0)||!function(t,r,i,n){var a=i._mainAxis;if(a){var o=t._fullLayout,s=r._id.charAt(0),l=Z.counterLetter(r._id),u=r._offset+(Math.abs(n[0])1)for(n=1;n4/3-l?s:l}}}),rf=g({"src/components/dragelement/cursor.js"(t,r){var i=t_(),n=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];r.exports=function(t,r,a,o){return t="left"===a?0:"center"===a?1:"right"===a?2:i.constrain(Math.floor(3*t),0,2),n[r="bottom"===o?0:"middle"===o?1:"top"===o?2:i.constrain(Math.floor(3*r),0,2)][t]}}}),rp=g({"src/components/dragelement/unhover.js"(t,r){var i=tk(),n=tn(),a=eG().getGraphDiv,o=Y(),s=r.exports={};s.wrapped=function(t,r,i){var l;(t=a(t))._fullLayout&&n.clear(t._fullLayout._uid+o.HOVERID);let u=t._hoverdata;s.raw(t,r,i)&&t._hoverAnywhereActive&&(t._hoverAnywhereActive=!1,null!=(l=t._fullLayout)&&l.hoveranywhere&&r?.target&&!u&&t.emit("plotly_unhover",{event:r,points:[]}))},s.raw=function(t,r){var n=t._fullLayout,a=t._hoverdata;return r||(r={}),(!r.target||!!t._dragged||!1!==i.triggerHandler(t,"plotly_beforehover",r))&&(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,r.target&&a&&t.emit("plotly_unhover",{event:r,points:a}),!0)}}}),rm=g({"src/components/dragelement/index.js"(t,r){var i=rc(),n=tA(),a=rh(),o=t_().removeElement,s=tI(),l=r.exports={};l.align=rd(),l.getCursor=rf();var u=rp();function c(){var t=document.createElement("div");t.className="dragcover";var r=t.style;return r.position="fixed",r.left=0,r.right=0,r.top=0,r.bottom=0,r.zIndex=0x3b9ac9ff,r.background="none",document.body.appendChild(t),t}function h(t){return i(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var r,i,u,d,f,p,m,g,y=t.gd,v=1,x=y._context.doubleClickDelay,b=t.element;y._mouseDownTime||(y._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=w,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=w,b.addEventListener("touchstart",w,{passive:!1})):b.ontouchstart=w;var _=t.clampFn||function(t,r,i){return Math.abs(t)"u"&&typeof a.clientY>"u"&&(a.clientX=r,a.clientY=i),(u=new Date().getTime())-y._mouseDownTimex&&(v=Math.max(v-1,1)),y._dragged)t.doneFn&&t.doneFn();else{var i;p.target===m?i=p:(i={target:m,srcElement:m,toElement:m},Object.keys(p).concat(Object.keys(p.__proto__)).forEach(t=>{var r=p[t];i[t]||"function"==typeof r||(i[t]=r)})),t.clickFn&&t.clickFn(v,i),g||m.dispatchEvent(new MouseEvent("click",r))}y._dragging=!1,y._dragged=!1}},l.coverSlip=c}}),rg=g({"src/lib/setcursor.js"(t,r){r.exports=function(t,r){(t.attr("class")||"").split(" ").forEach(function(r){0===r.indexOf("cursor-")&&t.classed(r,!1)}),r&&t.classed("cursor-"+r,!0)}}}),ry=g({"src/lib/override_cursor.js"(t,r){var i=rg(),n="data-savedcursor";r.exports=function(t,r){var a=t.attr(n);if(r){if(!a){for(var o=(t.attr("class")||"").split(" "),s=0;sr.legend.length)for(var n=r.legend.length;n+("legend"===t));if(!1===D&&(c[t]=void 0),!1===D&&!f.uirevision||(m("uirevision",c.uirevision),!1===D))return;m("borderwidth");var C,I,L,P=m("orientation"),z=m("yref"),F=m("xref"),O="h"===P,R="paper"===z,B="paper"===F,j="left";O?(C=0,i.getComponentMethod("rangeslider","isVisible")(r.xaxis)?R?(I=1.1,L="bottom"):(I=1,L="top"):R?(I=-.1,L="top"):(I=0,L="bottom")):(I=1,L="auto",B?C=1.02:(C=1,j="right")),n.coerce(f,p,{x:{valType:"number",editType:"legend",min:B?-2:0,max:B?3:1,dflt:C}},"x"),n.coerce(f,p,{y:{valType:"number",editType:"legend",min:R?-2:0,max:R?3:1,dflt:I}},"y"),m("traceorder",T),u.isGrouped(c[t])&&m("tracegroupgap"),m("entrywidth"),m("entrywidthmode"),m("indentation"),m("itemsizing"),m("itemwidth"),m("itemclick"),m("itemdoubleclick");let N=m("groupclick");if(m("groupdoubleclick",N),m("xanchor",j),m("yanchor",L),m("maxheight"),m("valign"),n.noneOrAll(f,p,["x","y"]),m("title.text")){m("title.side",O?"left":"top");var V=n.extendFlat({},g,{size:n.bigFont(g.size)});n.coerceFont(m,"title.font",V);let t=d>1;m("titleclick",!!t&&"toggle"),m("titledoubleclick",!!t&&"toggleothers")}})(y,t,r,d,g.length),r[y]&&(r[y]._id=y),r._legends.push(y)}}}}),r_=g({"src/components/legend/handle_click.js"(t){var r=e2(),i=t_(),n=i.pushUnique,a=rx(),o=!0;t.handleItemClick=function(t,a,s,l,u){var c=a._fullLayout;if(a._dragged||a._editing)return;var h=t.data()[0][0];if(h.groupTitle&&h.noClick)return;let d=2===u?s.groupdoubleclick:s.groupclick;"toggle"===l&&"toggleothers"===s.itemdoubleclick&&o&&a.data&&a._context.showTips&&(i.notifier(i._(a,"Double-click on legend to isolate one trace"),"long",a),o=!1);var f="togglegroup"===d,p=c.hiddenlabels?c.hiddenlabels.slice():[],m=a._fullData;let g=(c.shapes||[]).filter(t=>t.showlegend||t.legendgroup);var y=m.concat(g),v=h.trace;v._isShape&&(v=c.shapes[v.index]);var x,b,_,w,T,A=v.legendgroup,M={},k=[],S=[],E=[],D=(c.shapes||[]).map(function(t){return t._input}),C=!1;function I(t,r){if(!(h.groupTitle&&!f)){var i,n,a,o=t._isShape,s=t.index;void 0===s&&(s=t._index);var l=!1!==t.visible&&r;o?(D[s].visible=l,C=!0):(i=s,n=k.indexOf(i),(a=M.visible)||(a=M.visible=[]),-1===k.indexOf(i)&&(k.push(i),n=k.length-1),a[n]=l)}}var L=v.legend;if(!v._isShape&&r.traceIs(v,"pie-like")){var P=h.label,z=p.indexOf(P);if("toggle"===l)-1===z?p.push(P):p.splice(z,1);else if("toggleothers"===l){var F=-1!==z,O=[];for(x=0;xt.showlegend||t.legendgroup),c=s.concat(u);function h(t){return(t.legend||"legend")===l}"toggle"===n?(m=!c.some(function(t){return h(t)&&!0===t.visible}),g=!1):(m=!0,g=!c.some(function(t){return!h(t)&&!0===t.visible&&!1!==t.showlegend}));let d={visible:[]},f=[],p=(o.shapes||[]).map(function(t){return t._input});for(var m,g,y=!1,v=0;vL&&(C=L)}E[s][0]._groupMinRank=C,E[s][0]._preGroupSort=s}var P=function(t,r){return(i(t.trace.legendrank)?t.trace.legendrank[t.i]:t.trace.legendrank)-(i(r.trace.legendrank)?r.trace.legendrank[r.i]:r.trace.legendrank)||t._preSort-r._preSort};for(E.forEach(function(t,r){t[0]._preGroupSort=r}),E.sort(function(t,r){return t[0]._groupMinRank-r[0]._groupMinRank||t[0]._preGroupSort-r[0]._preGroupSort}),s=0;si?i:t}r.exports=function(t,r,y){var v=r._fullLayout;y||(y=v.legend);var x="constant"===y.itemsizing,b=y.itemwidth,_=o((b+2*f.itemGap)/2,0),w=function(t,r,i,n){var a;if(t+1)a=t;else{if(!r||!(r.width>0))return 0;a=r.width}return x?n:Math.min(a,i)};function T(t,a,o){var c=t[0].trace,h=c.marker||{},d=h.line||{},f=h.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",p=o?c.visible&&c.type===o:n.traceIs(c,"bar"),m=i.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[t]:[]);m.enter().append("path").classed("legend"+o,!0).attr("d",f).attr("transform",_),m.exit().remove(),m.each(function(t){var n=i.select(this),a=t[0],o=w(a.mlw,h.line,5,2);n.style("stroke-width",o+"px");var f=a.mcc;if(!y._inHover&&"mc"in a){var p=u(h),m=p.mid;void 0===m&&(m=(p.max+p.min)/2),f=s.tryColorscale(h,"")(m)}var v=f||a.mc||h.color,x=h.pattern,b=s.getPatternAttr,_=x&&(b(x.shape,0,"")||b(x.path,0,""));if(_){var T=b(x.bgcolor,0,null),A=b(x.fgcolor,0,null),M=x.fgopacity,k=g(x.size,8,10),S=g(x.solidity,.5,1),E="legend-"+c.uid;n.call(s.pattern,"legend",r,E,_,k,S,f,x.fillmode,T,A,M)}else n.call(l.fill,v);o&&l.stroke(n,a.mlc||d.color)})}function A(t,o,s){var l=t[0],u=l.trace,c=s?u.visible&&u.type===s:n.traceIs(u,s),f=i.select(o).select("g.legendpoints").selectAll("path.legend"+s).data(c?[t]:[]);if(f.enter().append("path").classed("legend"+s,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),f.exit().remove(),f.size()){var p=u.marker||{},m=w(d(p.line.width,l.pts),p.line,5,2),g="pieLike",y=a.minExtend(u,{marker:{line:{width:m}}},g);h(f,a.minExtend(l,{trace:y},g),y,r)}}t.each(function(t){var r=i.select(this),n=a.ensureSingle(r,"g","layers");n.style("opacity",t[0].trace.opacity);var s=y.indentation,l=y.valign,u=t[0].lineHeight,c=t[0].height;if(("middle"!==l||0!==s)&&u&&c){var h=y.indentation;n.attr("transform",o(h,.5*(u-c+3)*({top:1,bottom:-1})[l]||0))}else n.attr("transform",null);n.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var d=n.selectAll("g.legendsymbols").data([t]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var n,o=t[0].trace,c=[];if(o.visible)switch(o.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],n=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],n=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],n=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var h=i.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);h.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),h.exit().remove(),h.each(function(t,c){var h,d=i.select(this),f=u(o),m=f.colorscale,g=f.reversescale;if(m){if(!n){var y=m.length;h=0===c?m[g?y-1:0][1]:1===c?m[g?0:y-1][1]:m[Math.floor((y-1)/2)][1]}}else{var v=o.vertexcolor||o.facecolor||o.color;h=a.isArrayOrTypedArray(v)?v[c]||v[0]:v}d.attr("d",t[0]),h?d.call(l.fill,h):d.call(function(t){if(t.size()){var i="legendfill-"+o.uid;s.gradient(t,r,i,p(g,"radial"===n),m,"fill")}})})}).each(function(t){var r=t[0].trace,n="waterfall"===r.type;if(t[0]._distinct&&n){var a=t[0].trace[t[0].dir].marker;return t[0].mc=a.color,t[0].mlw=a.line.width,t[0].mlc=a.line.color,T(t,this,"waterfall")}var o=[];r.visible&&n&&(o=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var s=i.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(o);s.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),s.exit().remove(),s.each(function(t){var n=i.select(this),a=r[t[0]].marker,o=w(void 0,a.line,5,2);n.attr("d",t[1]).style("stroke-width",o+"px").call(l.fill,a.color),o&&n.call(l.stroke,a.line.color)})}).each(function(t){T(t,this,"funnel")}).each(function(t){T(t,this)}).each(function(t){var o=t[0].trace,u=i.select(this).select("g.legendpoints").selectAll("path.legendbox").data(o.visible&&n.traceIs(o,"box-violin")?[t]:[]);u.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),u.exit().remove(),u.each(function(){var t=i.select(this);if(("all"===o.boxpoints||"all"===o.points)&&0===l.opacity(o.fillcolor)&&0===l.opacity((o.line||{}).color)){var n=a.minExtend(o,{marker:{size:x?12:a.constrain(o.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});u.call(s.pointStyle,n,r)}else{var c=w(void 0,o.line,5,2);t.style("stroke-width",c+"px").call(l.fill,o.fillcolor),c&&l.stroke(t,o.line.color)}})}).each(function(t){A(t,this,"funnelarea")}).each(function(t){A(t,this,"pie")}).each(function(t){var n,o,l=m(t),h=l.showFill,d=l.showLine,f=l.showGradientLine,g=l.showGradientFill,y=l.anyFill,v=l.anyLine,x=t[0],_=x.trace,T=u(_),A=T.colorscale,M=T.reversescale,k=c.hasMarkers(_)||!y?"M5,0":v?"M5,-2":"M5,-3",S=i.select(this),E=S.select(".legendfill").selectAll("path").data(h||g?[t]:[]);if(E.enter().append("path").classed("js-fill",!0),E.exit().remove(),E.attr("d",k+"h"+b+"v6h-"+b+"z").call(function(t){if(t.size())if(h)s.fillGroupStyle(t,r,!0);else{var i="legendfill-"+_.uid;s.gradient(t,r,i,p(M),A,"fill")}}),d||f){var D=w(void 0,_.line,10,5);o=a.minExtend(_,{line:{width:D}}),n=[a.minExtend(x,{trace:o})]}var C=S.select(".legendlines").selectAll("path").data(d||f?[n]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",k+(f?"l"+b+",0.0001":"h"+b)).call(d?s.lineGroupStyle:function(t){if(t.size()){var i="legendline-"+_.uid;s.lineGroupStyle(t),s.gradient(t,r,i,p(M),A,"stroke")}})}).each(function(t){var n,o,l=m(t),u=l.anyFill,h=l.anyLine,d=l.showLine,f=l.showMarker,p=t[0],g=p.trace,y=!f&&!h&&!u&&c.hasText(g);function v(t,r,i,n){var o=a.nestedProperty(g,t).get(),s=a.isArrayOrTypedArray(o)&&r?r(o):o;if(x&&s&&void 0!==n&&(s=n),i){if(si[1])return i[1]}return s}function b(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(f||y||d){var w={},T={};if(f){w.mc=v("marker.color",b),w.mx="scattermap"===g.type?"circle":v("marker.symbol",b),w.mo=v("marker.opacity",a.mean,[.2,1]),w.mlc=v("marker.line.color",b),w.mlw=v("marker.line.width",a.mean,[0,5],2),w.mld=v("marker.line.dash",b),T.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var A=v("marker.size",a.mean,[2,16],12);w.ms=A,T.marker.size=A}d&&(T.line={width:v("line.width",b,[0,10],5)}),y&&(w.tx="Aa",w.tp=v("textposition",b),w.ts=10,w.tc=v("textfont.color",b),w.tf=v("textfont.family",b),w.tw=v("textfont.weight",b),w.ty=v("textfont.style",b),w.tv=v("textfont.variant",b),w.tC=v("textfont.textcase",b),w.tE=v("textfont.lineposition",b),w.tS=v("textfont.shadow",b)),n=[a.minExtend(p,w)],(o=a.minExtend(g,T)).selectedpoints=null,o.texttemplate=null}var M=i.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(f?n:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(s.pointStyle,o,r),f&&(n[0].mrc=3);var S=M.selectAll("g.pointtext").data(y?n:[]);S.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),S.exit().remove(),S.selectAll("text").call(s.textPointStyle,o,r)}).each(function(t){var r=t[0].trace,n=i.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(r.visible&&"candlestick"===r.type?[t,t]:[]);n.enter().append("path").classed("legendcandle",!0).attr("d",function(t,r){return r?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",_).style("stroke-miterlimit",1),n.exit().remove(),n.each(function(t,n){var a=i.select(this),o=r[n?"increasing":"decreasing"],s=w(void 0,o.line,5,2);a.style("stroke-width",s+"px").call(l.fill,o.fillcolor),s&&l.stroke(a,o.line.color)})}).each(function(t){var r=t[0].trace,n=i.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(r.visible&&"ohlc"===r.type?[t,t]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",function(t,r){return r?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",_).style("stroke-miterlimit",1),n.exit().remove(),n.each(function(t,n){var a=i.select(this),o=r[n?"increasing":"decreasing"],u=w(void 0,o.line,5,2);a.style("fill","none").call(s.dashLine,o.line.dash,u),u&&l.stroke(a,o.line.color)})})}}}),rE=g({"src/components/legend/draw.js"(t,r){var i=k(),n=t_(),a=tR(),o=e2(),s=tk(),l=rm(),u=rr(),c=ei(),h=tN(),d=r_().handleItemClick,f=r_().handleTitleClick,p=rw(),m=tj(),g=m.LINE_SPACING,y=m.FROM_TL,v=m.FROM_BR,x=rT(),b=rS(),_=rx(),w=/^legend[0-9]*$/;function T(t,r){var d,m,w=r||{},T=t._fullLayout,k=_.getId(w),E=w._inHover;if(E?(m=w.layer,d="hover"):(m=T._infolayer,d=k),m){if(d+=T._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),E){if(!w.entries)return;P=x(w.entries,w)}else{for(var P,z,F=(t.calcdata||[]).slice(),O=T.shapes,R=0;R1)}var N=T.hiddenlabels||[];if(!E&&(!T.showlegend||!P.length))return m.selectAll("."+k).remove(),T._topdefs.select("#"+d).remove(),a.autoMargin(t,k);var V=n.ensureSingle(m,"g",k,function(t){E||t.attr("pointer-events","all")}),U=n.ensureSingleById(T._topdefs,"clipPath",d,function(t){t.append("rect")}),q=n.ensureSingle(V,"rect","bg",function(t){t.attr("shape-rendering","crispEdges")});q.call(c.stroke,w.bordercolor).call(c.fill,w.bgcolor).style("stroke-width",w.borderwidth+"px");var G=n.ensureSingle(V,"g","scrollbox"),H=w.title;w._titleWidth=0,w._titleHeight=0,H.text?((z=n.ensureSingle(G,"text",k+"titletext")).attr("text-anchor","start").call(u.font,H.font).text(H.text),C(z,G,t,w,1),!E&&(w.titleclick||w.titledoubleclick)&&function(t,r,a,l){if(r._fullData.some(function(t){let r=t.legend||"legend";return(Array.isArray(r)?r.includes(l):r===l)&&o.traceIs(t,"pie-like")}))return;let u=r._context.doubleClickDelay;var h,d=1;let p=n.ensureSingle(t,"rect",l+"titletoggle",function(t){r._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")});r._context.staticPlot||(p.on("mousedown",function(){(h=new Date().getTime())-r._legendMouseDownTimeu&&(d=Math.max(d-1,1));let t={event:i.event,legendId:l,data:r.data,layout:r.layout,fullData:r._fullData,fullLayout:r._fullLayout};if(1===d&&a.titleclick){if(!1===s.triggerHandler(r,"plotly_legendtitleclick",t))return;a._titleClickTimeout=setTimeout(function(){r._fullLayout&&f(r,a,a.titleclick)},u)}else 2===d&&(a._titleClickTimeout&&clearTimeout(a._titleClickTimeout),r._legendMouseDownTime=0,!1!==s.triggerHandler(r,"plotly_legendtitledoubleclick",t)&&a.titledoubleclick&&f(r,a,a.titledoubleclick))}))}(G,t,w,k)):(G.selectAll("."+k+"titletext").remove(),G.selectAll("."+k+"titletoggle").remove());var $=n.ensureSingle(V,"rect","scrollbar",function(t){t.attr(p.scrollBarEnterAttrs).call(c.fill,p.scrollBarColor)}),W=G.selectAll("g.groups").data(P);W.enter().append("g").attr("class","groups"),W.exit().remove();var Y=W.selectAll("g.traces").data(n.identity);Y.enter().append("g").attr("class","traces"),Y.exit().remove(),Y.style("opacity",function(r){let i=r[0],n=i.trace;if(i.groupTitle){let r=n.legendgroup,i=(T.shapes||[]).filter(function(t){return t.showlegend});return t._fullData.concat(i).some(function(t){return t.legendgroup===r&&(t.legend||"legend")===k&&!0===t.visible})?1:.5}return o.traceIs(n,"pie-like")?-1!==N.indexOf(r[0].label)?.5:1:"legendonly"===n.visible?.5:1}).each(function(){i.select(this).call(S,t,w)}).call(b,t,w).each(function(r){E||r[0].groupTitle&&"toggleitem"===w.groupclick||i.select(this).call(D,t,k)}),n.syncOrAsync([a.previousPromises,function(){return function(t,r,n,a,o){var s,l,c,d,f=t._fullLayout,m=_.getId(a);a||(a=f[m]);var y=f._size,v=_.isVertical(a),x=_.isGrouped(a),b="fraction"===a.entrywidthmode,w=a.borderwidth,T=2*w,M=p.itemGap,k=a.indentation+a.itemwidth+2*M,S=2*(w+M),E=L(a),D=a.y<0||0===a.y&&"top"===E,C=a.y>1||1===a.y&&"bottom"===E,P=a.tracegroupgap,z={};let{orientation:F,yref:O}=a,{maxheight:R}=a,B=D||C||"v"!==F||"paper"!==O;R||(R=B?.5:1);let j=B?f.height:y.h;a._maxHeight=Math.max(R>1?R:R*j,30);var N=0;a._width=0,a._height=0;var V=(l=0,c=0,(d=(s=a).title.side)&&(-1!==d.indexOf("left")&&(l=s._titleWidth),-1!==d.indexOf("top")&&(c=s._titleHeight)),[l,c]);if(v)n.each(function(t){var r=t[0].height;u.setTranslate(this,w+V[0],w+V[1]+a._height+r/2+M),a._height+=r,a._width=Math.max(a._width,t[0].width)}),N=k+a._width,a._width+=M+k+T,a._height+=S,x&&(r.each(function(t,r){u.setTranslate(this,0,r*a.tracegroupgap)}),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var U=I(a),q=a.x<0||0===a.x&&"right"===U,G=a.x>1||1===a.x&&"left"===U,H=C||D,$=f.width/2;a._maxWidth=Math.max(q?H&&"left"===U?y.l+y.w:$:G?H&&"right"===U?y.r+y.w:$:y.w,2*k);var W=0,Y=0;n.each(function(t){var r=A(t,a,k);W=Math.max(W,r),Y+=r}),N=null;var Z=0;if(x){var X=0,K=0,J=0;r.each(function(){var t=0,r=0;i.select(this).selectAll("g.traces").each(function(i){var n=A(i,a,k),o=i[0].height;u.setTranslate(this,V[0],V[1]+w+M+o/2+r),r+=o,t=Math.max(t,n),z[i[0].trace.legendgroup]=t});var n=t+M;K>0&&n+w+K>a._maxWidth?(Z=Math.max(Z,K),K=0,J+=X+P,X=r):X=Math.max(X,r),u.setTranslate(this,K,J),K+=n}),a._width=Math.max(Z,K)+w,a._height=J+X+S}else{var Q=n.size(),ee=Y+T+(Q-1)*M=a._maxWidth&&(Z=Math.max(Z,en),er=0,ei+=et,a._height+=et,et=0),u.setTranslate(this,V[0]+w+er,V[1]+w+ei+r/2+M),en=er+i+M,er+=n,et=Math.max(et,r)}),ee?(a._width=er+T,a._height=et+S):(a._width=Math.max(Z,en)+T,a._height+=et+S)}}a._width=Math.ceil(Math.max(a._width+V[0],a._titleWidth+2*(w+p.titlePad))),a._height=Math.ceil(Math.max(a._height+V[1],a._titleHeight+2*(w+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var ea=t._context.edits,eo=ea.legendText||ea.legendPosition;n.each(function(t){var r=i.select(this).select("."+m+"toggle"),n=t[0].height,o=t[0].trace.legendgroup,s=A(t,a,k);x&&""!==o&&(s=z[o]);var l=eo?k:N||s;v||b||(l+=M/2),u.setRect(r,0,-n/2,l,n)});var es=o.select("."+m+"titletext");es.node()&&function(t,r,i){if("top center"===r.title.side||"top right"===r.title.side){var n=r.title.font.size*g,a=0,o=t.node(),s=u.bBox(o).width;"top center"===r.title.side?a=.5*(r._width-2*i-2*p.titlePad-s):"top right"===r.title.side&&(a=r._width-2*i-2*p.titlePad-s),h.positionText(t,i+p.titlePad+a,i+n)}}(es,a,w);var el=o.select("."+m+"titletoggle");if(el.size()&&es.node()){var eu=es.attr("x")||0,ec=p.titlePad;u.setRect(el,eu-ec,w,a._titleWidth+2*ec,a._titleHeight+2*ec)}}(t,W,Y,w,G)},function(){var r,s,c,h,f=T._size,g=w.borderwidth,x="paper"===w.xref,b="paper"===w.yref;if(H.text){let r=(T.shapes||[]).filter(function(t){return t.showlegend}),i=t._fullData.concat(r).some(function(t){let r=t.legend||"legend";return(Array.isArray(r)?r.includes(k):r===k)&&!0===t.visible});z.style("opacity",i?1:.5)}if(!E){if(function(t,r,i,n){var o=t._fullLayout,s=o[r],l=I(s),u=L(s),c="paper"===s.xref,h="paper"===s.yref;t._fullLayout._reservedMargin[r]={};var d=s.y<.5?"b":"t",f=s.x<.5?"l":"r",p={r:o.width-i,l:i+s._width,b:o.height-n,t:n+s._effHeight};if(c&&h)return a.autoMargin(t,r,{x:s.x,y:s.y,l:s._width*y[l],r:s._width*v[l],b:s._effHeight*v[u],t:s._effHeight*y[u]});c?t._fullLayout._reservedMargin[r][d]=p[d]:h||"v"===s.orientation?t._fullLayout._reservedMargin[r][f]=p[f]:t._fullLayout._reservedMargin[r][d]=p[d]}(t,k,R=x?f.l+f.w*w.x-y[I(w)]*w._width:T.width*w.x-y[I(w)]*w._width,B=b?f.t+f.h*(1-w.y)-y[L(w)]*w._effHeight:T.height*(1-w.y)-y[L(w)]*w._effHeight))return;if(T.margin.autoexpand){var _=R,A=B;R=x?n.constrain(R,0,T.width-w._width):_,B=b?n.constrain(B,0,T.height-w._effHeight):A,R!==_&&n.log("Constrain "+k+".x to make legend fit inside graph"),B!==A&&n.log("Constrain "+k+".y to make legend fit inside graph")}u.setTranslate(V,R,B)}if($.on(".drag",null),V.on("wheel",null),E||w._height<=w._maxHeight||t._context.staticPlot){var S=w._effHeight;E&&(S=w._height),q.attr({width:w._width-g,height:S-g,x:g/2,y:g/2}),u.setTranslate(G,0,0),U.select("rect").attr({width:w._width-2*g,height:S-2*g,x:g,y:g}),u.setClipUrl(G,d,t),u.setRect($,0,0,0,0),delete w._scrollY}else{var D=Math.max(p.scrollBarMinHeight,w._effHeight*w._effHeight/w._height),C=w._effHeight-D-2*p.scrollBarMargin,P=w._height-w._effHeight,F=C/P,O=Math.min(w._scrollY||0,P);q.attr({width:w._width-2*g+p.scrollBarWidth+p.scrollBarMargin,height:w._effHeight-g,x:g/2,y:g/2}),U.select("rect").attr({width:w._width-2*g+p.scrollBarWidth+p.scrollBarMargin,height:w._effHeight-2*g,x:g,y:g+O}),u.setClipUrl(G,d,t),J(O,D,F),V.on("wheel",function(){J(O=n.constrain(w._scrollY+i.event.deltaY/P*C,0,P),D,F),0!==O&&O!==P&&i.event.preventDefault()});var R,B,j,N,W,Y=function(t,r,i){var a=(i-r)/F+t;return n.constrain(a,0,P)},Z=function(t,r,i){var a=(r-i)/F+t;return n.constrain(a,0,P)},X=i.behavior.drag().on("dragstart",function(){var t=i.event.sourceEvent;j="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,W=O}).on("drag",function(){var t=i.event.sourceEvent;2===t.buttons||t.ctrlKey||(N="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,J(O=Y(W,j,N),D,F))});$.call(X);var K=i.behavior.drag().on("dragstart",function(){var t=i.event.sourceEvent;"touchstart"===t.type&&(j=t.changedTouches[0].clientY,W=O)}).on("drag",function(){var t=i.event.sourceEvent;"touchmove"===t.type&&(N=t.changedTouches[0].clientY,J(O=Z(W,j,N),D,F))});G.call(K)}function J(r,i,n){w._scrollY=t._fullLayout[k]._scrollY=r,u.setTranslate(G,0,-r),u.setRect($,w._width,p.scrollBarMargin+r*n,p.scrollBarWidth,i),U.select("rect").attr("y",g+r)}t._context.edits.legendPosition&&(V.classed("cursor-move",!0),l.init({element:V.node(),gd:t,prepFn:function(t){if(t.target!==$.node()){var r=u.getTranslate(V);c=r.x,h=r.y}},moveFn:function(t,i){if(void 0!==c&&void 0!==h){var n=c+t,a=h+i;u.setTranslate(V,n,a),r=l.align(n,w._width,f.l,f.l+f.w,w.xanchor),s=l.align(a+w._height,-w._height,f.t+f.h,f.t,w.yanchor)}},doneFn:function(){if(void 0!==r&&void 0!==s){var i={};i[k+".x"]=r,i[k+".y"]=s,o.call("_guiRelayout",t,i)}},clickFn:function(r,i){var n=m.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});n.size()>0&&M(t,w,n,r,i)}}))}],t)}}function A(t,r,i){var n=t[0],a=n.width,o=r.entrywidthmode,s=n.trace.legendwidth||r.entrywidth;return"fraction"===o?r._maxWidth*s:i+(s||a)}function M(t,r,i,n,a){var l=t._fullLayout,u=i.data()[0][0].trace,c=r.itemclick,h=r.itemdoubleclick,f={event:a,node:i.node(),curveNumber:u.index,expandedIndex:u.index,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:l};u._group&&(f.group=u._group),o.traceIs(u,"pie-like")&&(f.label=i.datum()[0].label);var p=s.triggerHandler(t,"plotly_legendclick",f);if(1===n){if(!1===p)return;r._clickTimeout=setTimeout(function(){t._fullLayout&&c&&d(i,t,r,c,n)},t._context.doubleClickDelay)}else 2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",f)&&!1!==p&&h&&d(i,t,r,h,n))}function S(t,r,i){var a,s,l=_.getId(i),c=t.data()[0][0],d=c.trace,f=o.traceIs(d,"pie-like"),m=!i._inHover&&r._context.edits.legendText&&!f,g=i._maxNameLength;c.groupTitle?(a=c.groupTitle.text,s=c.groupTitle.font):(s=i.font,i.entries?a=c.text:(a=f?c.label:d.name,d._meta&&(a=n.templateString(a,d._meta))));var y=n.ensureSingle(t,"text",l+"text");y.attr("text-anchor","start").call(u.font,s).text(m?E(a,g):a);var v=i.indentation+i.itemwidth+2*p.itemGap;h.positionText(y,v,0),m?y.call(h.makeEditable,{gd:r,text:a}).call(C,t,r,i).on("edit",function(n){this.text(E(n,g)).call(C,t,r,i);var a={};return a.name=n,c.trace._isShape?o.call("_guiRelayout",r,"shapes["+d.index+"].name",a.name):o.call("_guiRestyle",r,a,d.index)}):C(y,t,r,i)}function E(t,r){var i=Math.max(4,r);if(t&&t.trim().length>=i/2)return t;t=t||"";for(var n=i-t.length;n>0;n--)t+=" ";return t}function D(t,r,a){var o,s=r._context.doubleClickDelay,l=1,u=n.ensureSingle(t,"rect",a+"toggle",function(t){r._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")});r._context.staticPlot||(u.on("mousedown",function(){(o=new Date().getTime())-r._legendMouseDownTimes&&(l=Math.max(l-1,1)),M(r,n,t,l,i.event)}}))}function C(t,r,i,n,a){n._inHover&&t.attr("data-notex",!0),h.convertToTspans(t,i,function(){!function(t,r,i,n){var a=t.data()[0][0],o=a&&a.trace.showlegend;if(Array.isArray(o)&&(o=!1!==o[a.i]),!i._inHover&&a&&!o)return t.remove();var s=t.select("g[class*=math-group]"),l=s.node(),c=_.getId(i);i||(i=r._fullLayout[c]);var d,f,m=i.borderwidth,y=(1===n?i.title.font:a.groupTitle?a.groupTitle.font:i.font).size*g;if(l){var v=u.bBox(l);d=v.height,f=v.width,1===n?u.setTranslate(s,m,m+.75*d):u.setTranslate(s,0,.25*d)}else{var x=t.select("."+c+(1===n?"title":"")+"text"),b=h.lineCount(x),w=x.node();if(d=y*b,f=w?u.bBox(w).width:0,1===n)"left"===i.title.side&&(f+=2*p.itemGap),h.positionText(x,m+p.titlePad,m+y);else{var T=2*p.itemGap+i.indentation+i.itemwidth;a.groupTitle&&(T=p.itemGap,f-=i.indentation+i.itemwidth),h.positionText(x,T,-y*((b-1)/2-.3))}}1===n?(i._titleWidth=f,i._titleHeight=d):(a.lineHeight=y,a.height=Math.max(d,16)+3,a.width=f)}(r,i,n,a)})}function I(t){return n.isRightAnchor(t)?"right":n.isCenterAnchor(t)?"center":"left"}function L(t){return n.isBottomAnchor(t)?"bottom":n.isMiddleAnchor(t)?"middle":"top"}r.exports=function(t,r){if(r)T(t,r);else{var n=t._fullLayout,a=n._legends;n._infolayer.selectAll('[class^="legend"]').each(function(){var t=i.select(this),r=t.attr("class").split(" ")[0];r.match(w)&&-1===a.indexOf(r)&&t.remove()});for(var o=0;oX[0]._length||e_<0||e_>K[0]._length)return f.unhoverRaw(t,o)}else eb="xpx"in o?o.xpx:X[0]._length/2,e_="ypx"in o?o.ypx:K[0]._length/2;if(o.pointerX=eb+X[0]._offset,o.pointerY=e_+K[0]._offset,ei="xval"in o?y.flat(_,o.xval):y.p2c(X,eb),en="yval"in o?y.flat(_,o.yval):y.p2c(K,e_),t._hoverPointerX=o.pointerX,t._hoverPointerY=o.pointerY,!i(ei[0])||!i(en[0]))return n.warn("Fx.hover failed",o,t),f.unhoverRaw(t,o)}w.clickanywhere&&(t._hoverXVals=ei,t._hoverYVals=en,t._hoverXAxes=X,t._hoverYAxes=K);var eM=1/0;function ek(r,a){for(eo=0;eoem&&(eg.splice(0,em),eM=eg[0].distance),E&&0!==er&&0===eg.length){ep.distance=er,ep.index=!1;var h=el._module.hoverPoints(ep,ed,ef,"closest",{hoverLayer:w._hoverlayer});if(h&&(h=h.filter(function(t){return t.spikeDistance<=er})),h&&h.length){var f,m=h.filter(function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap});if(m.length){var g=m[0];i(g.x0)&&i(g.y0)&&(f=eE(g),(!ev.vLinePoint||ev.vLinePoint.spikeDistance>f.spikeDistance)&&(ev.vLinePoint=f))}var v=h.filter(function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap});if(v.length){var x=v[0];i(x.x0)&&i(x.y0)&&(f=eE(x),(!ev.hLinePoint||ev.hLinePoint.spikeDistance>f.spikeDistance)&&(ev.hLinePoint=f))}}}}}function eS(t,r,i){for(var n,a=null,o=1/0,s=0;st.trace.index===eF.trace.index):[eF]).length;ek(U("x",eF,w),U("y",eF,w));var eR,eB=[],ej={},eN=0,eV=function(t){var r=D[t.trace.type]?P(t):t.trace.index;if(ej[r]){var i=ej[r]-1,n=eB[i];i>0&&Math.abs(t.distance)eO-1;eR--)eV(eg[eR]);eg=eB,eI()}var eU=t._hoverdata,eq=[],eG=q(t),eH=G(t);for(let t of eg){var e$=y.makeEventData(t,t.trace,t.cd);if(!1!==t.hovertemplate){var eW=!1;t.cd[t.index]&&t.cd[t.index].ht&&(eW=t.cd[t.index].ht),t.hovertemplate=eW||t.trace.hovertemplate||!1}if(t.xa&&t.ya){var eY=t.x0+t.xa._offset,eZ=t.x1+t.xa._offset,eX=t.y0+t.ya._offset,eK=t.y1+t.ya._offset;e$.bbox={x0:Math.min(eY,eZ)+eH,x1:Math.max(eY,eZ)+eH,y0:Math.min(eX,eK)+eG,y1:Math.max(eX,eK)+eG},e$.xPixel=(eY+eZ)/2,e$.yPixel=(eX+eK)/2}t.eventData=[e$],eq.push(e$)}t._hoverdata=eq;var eJ="y"===L&&(ey.length>1||eg.length>1)||"closest"===L&&ex&&eg.length>1,eQ=d.combine(w.plot_bgcolor||d.background,w.paper_bgcolor),e0=F(eg,{gd:t,hovermode:L,rotateLabels:eJ,bgColor:eQ,container:w._hoverlayer,outerContainer:w._paper.node(),commonLabelOpts:w.hoverlabel,hoverdistance:w.hoverdistance}),e1=e0.hoverLabels;if(y.isUnifiedHover(L)||(function(t,r,i,n){var a,o,s,l,u,c,h,d=r?"xa":"ya",f=r?"ya":"xa",p=0,m=1,g=t.size(),y=Array(g),v=0,x=n.minX,b=n.maxX,_=n.minY,w=n.maxY,A=function(t){return t*i._invScaleX},M=function(t){return t*i._invScaleY};function k(t){var r=t[0],i=t[t.length-1];if(o=r.pmin-r.pos-r.dp+r.size,s=i.pos+i.dp+i.size-r.pmax,o>.01){for(u=t.length-1;u>=0;u--)t[u].dp+=o;a=!1}if(!(s<.01)){if(o<-.01){for(u=t.length-1;u>=0;u--)t[u].dp-=s;a=!1}if(a){var n=0;for(l=0;lr.pmax&&n++;for(l=t.length-1;l>=0&&!(n<=0);l--)(c=t[l]).pos>r.pmax-1&&(c.del=!0,n--);for(l=0;l=0;u--)t[u].dp-=s;for(l=t.length-1;l>=0&&!(n<=0);l--)(c=t[l]).pos+c.dp+c.size>r.pmax&&(c.del=!0,n--)}}}for(t.each(function(t){var n=t[d],a=t[f],o="x"===n._id.charAt(0),s=n.range;0===v&&s&&s[0]>s[1]!==o&&(m=-1);var l=0,u=o?i.width:i.height;if("x"===i.hovermode||"y"===i.hovermode){var c,h,p=R(t,r),g=t.anchor,k="end"===g?-1:1;if("middle"===g)h=(c=t.crossPos+(o?M(p.y-t.by/2):A(t.bx/2+t.tx2width/2)))+(o?M(t.by):A(t.bx));else if(o)h=(c=t.crossPos+M(S+p.y)-M(t.by/2-S))+M(t.by);else{var E=A(k*S+p.x),D=E+A(k*t.bx);c=t.crossPos+Math.min(E,D),h=t.crossPos+Math.max(E,D)}o?void 0!==_&&void 0!==w&&Math.min(h,w)-Math.max(c,_)>1&&("left"===a.side?(l=a._mainLinePosition,u=i.width):u=a._mainLinePosition):void 0!==x&&void 0!==b&&Math.min(h,b)-Math.max(c,x)>1&&("top"===a.side?(l=a._mainLinePosition,u=i.height):u=a._mainLinePosition)}y[v++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(o?T:1)/2,pmin:l,pmax:u}]}),y.sort(function(t,r){return t[0].posref-r[0].posref||m*(r[0].traceIndex-t[0].traceIndex)});!a&&p<=g;){for(p++,a=!0,l=0;l.01){for(u=D.length-1;u>=0;u--)D[u].dp+=o;for(E.push.apply(E,D),y.splice(l+1,1),h=0,u=E.length-1;u>=0;u--)h+=E[u].dp;for(s=h/E.length,u=E.length-1;u>=0;u--)E[u].dp-=s;a=!1}else l++}y.forEach(k)}for(l=y.length-1;l>=0;l--){var L=y[l];for(u=L.length-1;u>=0;u--){var P=L[u],z=P.datum;z.offset=P.dp,z.del=P.del}}}(e1,eJ,w,e0.commonLabelBoundingBox),B(e1,eJ,w._invScaleX,w._invScaleY)),h&&h.tagName){var e2=g.getComponentMethod("annotations","hasClickToShow")(t,eq);c(r.select(h),e2?"pointer":"")}var e3=function(t,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var i=r.length-1;i>=0;i--){var n=r[i],a=t._hoverdata[i];if(n.curveNumber!==a.curveNumber||String(n.pointNumber)!==String(a.pointNumber)||String(n.pointNumbers)!==String(a.pointNumbers)||n.binNumber!==a.binNumber)return!0}return!1}(t,eU);function e5(r){t.emit("plotly_hover",{event:o,points:r,xaxes:X,yaxes:K,xvals:y.c2dApply(X,ei),yvals:y.c2dApply(K,en),xPixel:o.pointerX,yPixel:o.pointerY})}h&&!u&&(e3||w.hoveranywhere)&&(eU&&e3&&t.emit("plotly_unhover",{event:o,points:eU}),e5(t._hoverdata))}(t,o,s,u,h)})},t.loneHover=function(t,i){var n=!0;Array.isArray(t)||(n=!1,t=[t]);var a=i.gd,o=q(a),s=G(a),l=F(t.map(function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,l=t._y0||t.y0||t.y||0,u=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var h=Math.min(r,n),f=Math.max(r,n),p=Math.min(l,u),m=Math.max(l,u),y=t.trace;if(g.traceIs(y,"gl3d")){var v=a._fullLayout[y.scene]._scene.container,x=v.offsetLeft,b=v.offsetTop;h+=x,f+=x,p+=b,m+=b}c.bbox={x0:h+s,x1:f+s,y0:p+o,y1:m+o},c.xPixel=(r+n)/2,c.yPixel=(l+u)/2,i.inOut_bbox&&i.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||d.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}}),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:i.bgColor||d.background,container:r.select(i.container),outerContainer:i.outerContainer||i.container}).hoverLabels,u=0,c=0;return l.sort(function(t,r){return t.y0-r.y0}).each(function(t,r){var n=t.y0-t.by/2;n-5([\s\S]*)<\/extra>/;function F(t,i){var a=i.gd,l=a._fullLayout,c=i.hovermode,f=i.rotateLabels,p=i.bgColor,m=i.container,w=i.outerContainer,T=i.commonLabelOpts||{};if(0===t.length)return[[]];var A=i.fontFamily||v.HOVERFONT,M=i.fontSize||v.HOVERFONTSIZE,k=i.fontWeight||l.font.weight,D=i.fontStyle||l.font.style,C=i.fontVariant||l.font.variant,I=i.fontTextcase||l.font.textcase,L=i.fontLineposition||l.font.lineposition,z=i.fontShadow||l.font.shadow,F=t[0],R=F.xa,B=F.ya,j=c.charAt(0),N=j+"Label",V=F[N];if(void 0===V&&"multicategory"===R.type)for(var U=0;Ul.width-w&&(P=l.width-w),i.attr("d","M"+(v-P)+",0L"+(v-P+S)+","+_+S+"H"+w+"v"+_+(2*E+b.height)+"H"+-w+"V"+_+S+"H"+(v-P-S)+"Z"),ee.minX=(v=P)-w,ee.maxX=v+w,"top"===R.side?(ee.minY=x-(2*E+b.height),ee.maxY=x-E):(ee.minY=x+E,ee.maxY=x+(2*E+b.height))}else{"right"===B.side?(O="start",j=1,N="",v=R._offset+R._length):(O="end",j=-1,N="-",v=R._offset),x=B._offset+(F.y0+F.y1)/2,s.attr("text-anchor",O),i.attr("d","M0,0L"+N+S+","+S+"V"+(E+b.height/2)+"h"+N+(2*E+b.width)+"V-"+(E+b.height/2)+"H"+N+S+"V-"+S+"Z"),ee.minY=x-(E+b.height/2),ee.maxY=x+(E+b.height/2),"right"===B.side?(ee.minX=v+S,ee.maxX=v+S+(2*E+b.width)):(ee.minX=v-S-(2*E+b.width),ee.maxX=v-S);var O,j,N,U,q=b.height/2,$=G-b.top-q,W="clip"+l._uid+"commonlabel"+B._id;if(v"none"!==t.hoverinfo);if(0===r.length)return[];var et,er,ei,en,ea=l.hoverlabel,eo=ea.font,es=r[0],el=(("x unified"===c?es.xa:es.ya).unifiedhovertitle||{}).text,eu={showlegend:!0,legend:{title:{text:el?n.hovertemplateString({data:"x unified"===c?[{xa:es.xa,x:es.xVal}]:[{ya:es.ya,y:es.yVal}],fallback:es.trace.hovertemplatefallback,locale:l._d3locale,template:el}):V,font:eo},font:eo,bgcolor:ea.bgcolor,bordercolor:ea.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:l.legend?l.legend.traceorder:void 0,orientation:"v"}},ec={font:eo};x(eu,ec,a._fullData);var eh=ec.legend;eh.entries=[];for(var ed=0;ed=0?et:er+ew<$&&er>=0?er:eE+ew<$?eE:et-eM=0?ev:ex+eT=0?ex:eD+eT=0,("top"===t.idealAlign||!J)&&Q?(N-=q/2,t.anchor="end"):J?(N+=q/2,t.anchor="start"):t.anchor="middle",t.crossPos=N;else{if(t.pos=N,J=j+U/2+ee<=$,Q=j-U/2-ee>=0,("left"===t.idealAlign||!J)&&Q)j-=U/2,t.anchor="end";else if(J)j+=U/2,t.anchor="start";else{t.anchor="middle";var et=ee/2,er=j+et-$,ei=j-et;er>0&&(j-=er),ei<0&&(j+=-ei)}t.crossPos=j}T.attr("text-anchor",t.anchor),F&&P.attr("text-anchor",t.anchor),i.attr("transform",o(j,N)+(f?s(_):""))}),{hoverLabels:eC,commonLabelBoundingBox:ee}}function O(t,r,i,a,o,s){var l,u,c="",h="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=n.templateString(t.name,t.trace._meta)),c=V(t.name,t.nameLength));var d=i.charAt(0);void 0!==t.zLabel?(void 0!==t.xLabel&&(h+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(h+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmap"!==t.trace.type&&(h+=(h?"z: ":"")+t.zLabel)):r&&t[d+"Label"]===o?h=t[("x"===d?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(h=t.yLabel):h=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",(t.text||0===t.text)&&!Array.isArray(t.text)&&(h+=(h?"
":"")+t.text),void 0!==t.extraText&&(h+=(h?"
":"")+t.extraText),s&&""===h&&!t.hovertemplate&&(""===c&&s.remove(),h=c),null!=(u=null==(l=t.trace)?void 0:l.hoverlabel)&&u.split&&(t.hovertemplate="");let{hovertemplate:f=!1}=t;if(f){let r=t.hovertemplateLabels||t;t[d+"Label"]!==o&&(r[d+"other"]=r[d+"Val"],r[d+"otherLabel"]=r[d+"Label"]),h=(h=n.hovertemplateString({data:[t.eventData[0]||{},t.trace._meta],fallback:t.trace.hovertemplatefallback,labels:r,locale:a._d3locale,template:f})).replace(z,(r,i)=>(c=V(i,t.nameLength),""))}return[h,c]}function R(t,r){var i=0,n=t.offset;return r&&(n*=-M,i=t.offset*A),{x:i,y:n}}function B(t,i,n,a){var o=function(t){return t*n},s=function(t){return t*a};t.each(function(t){var n=r.select(this);if(t.del)return n.remove();var a,l,c,d,f=n.select("text.nums"),p=t.anchor,m="end"===p?-1:1,g=(c=(l=(a=({start:1,end:-1,middle:0})[t.anchor])*(S+E))+a*(t.txwidth+E),"middle"===t.anchor&&(l-=t.tx2width/2,c+=t.txwidth/2+E),{alignShift:a,textShiftX:l,text2ShiftX:c}),y=R(t,i),v=y.x,x=y.y,b="middle"===p,_=!("hoverlabel"in t.trace)||t.trace.hoverlabel.showarrow;d=b?"M-"+o(t.bx/2+t.tx2width/2)+","+s(x-t.by/2)+"h"+o(t.bx)+"v"+s(t.by)+"h-"+o(t.bx)+"Z":_?"M0,0L"+o(m*S+v)+","+s(S+x)+"v"+s(t.by/2-S)+"h"+o(m*t.bx)+"v-"+s(t.by)+"H"+o(m*S+v)+"V"+s(x-S)+"Z":"M"+o(m*S+v)+","+s(x-t.by/2)+"h"+o(m*t.bx)+"v"+s(t.by)+"h"+o(-m*t.bx)+"Z",n.select("path").attr("d",d);var w=v+g.textShiftX,T=x+t.ty0-t.by/2+E,A=t.textAlign||"auto";"auto"!==A&&("left"===A&&"start"!==p?(f.attr("text-anchor","start"),w=b?-t.bx/2-t.tx2width/2+E:-t.bx-E):"right"===A&&"end"!==p&&(f.attr("text-anchor","end"),w=b?t.bx/2-t.tx2width/2-E:t.bx+E)),f.call(u.positionText,o(w),s(T)),t.tx2width&&(n.select("text.name").call(u.positionText,o(g.text2ShiftX+g.alignShift*E+v),s(x+t.ty0-t.by/2+E)),n.select("rect").call(h.setRect,o(g.text2ShiftX+(g.alignShift-1)*t.tx2width/2+v),s(x-t.by/2-1),o(t.tx2width),s(t.by+2)))})}function j(t,r,i){var n,a,o=i.container,s=i.fullLayout,l=s._size,u=i.event,c=!!r.hLinePoint,f=!!r.vLinePoint;if(o.selectAll(".spikeline").remove(),f||c){var m=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var g,y,v=r.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=u.pointerX,y=u.pointerY):(g=n._offset+v.x,y=a._offset+v.y);var x,b,_=1.5>d.wcagContrast(v.color,m)?d.contrast(m):v.color,w=a.spikemode,T=a.spikethickness,A=a.spikecolor||_,M=p.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=M,b=g),-1!==w.indexOf("across")){var k=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(k=Math.min(k,a.position),S=Math.max(S,a.position)),x=l.l+k*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":T,stroke:A,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":T+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:y,r:T,fill:A}).classed("spikeline",!0)}if(f){var E,D,C=r.vLinePoint;n=C&&C.xa,a=C&&C.ya,"cursor"===n.spikesnap?(E=u.pointerX,D=u.pointerY):(E=n._offset+C.x,D=a._offset+C.y);var I,L,P=1.5>d.wcagContrast(C.color,m)?d.contrast(m):C.color,z=n.spikemode,F=n.spikethickness,O=n.spikecolor||P,R=p.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(I=R,L=D),-1!==z.indexOf("across")){var B=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),j=Math.max(j,n.position)),I=l.t+(1-j)*l.h,L=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:I,y2:L,"stroke-width":F,stroke:O,"stroke-dasharray":h.dashStyle(n.spikedash,F)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:I,y2:L,"stroke-width":F+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:R-("top"!==n.side?F:-F),r:F,fill:O}).classed("spikeline",!0)}}}function N(t,r){return!r||r.vLinePoint!==t._spikepoints.vLinePoint||r.hLinePoint!==t._spikepoints.hLinePoint}function V(t,r){return u.plainText(t||"",{len:r,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function U(t,r,i){var n=r[t+"a"],a=r[t+"Val"],o=r.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var s=r.trace[t+"periodalignment"];if(s){var l=r.cd[r.index],u=l[t+"Start"];void 0===u&&(u=l[t]);var c=l[t+"End"];void 0===c&&(c=l[t]);var h=c-u;"end"===s?a+=h:"middle"===s&&(a+=h/2)}a=n.d2c(a)}return o&&o.t&&o.t.posLetter===n._id&&("group"===i.boxmode||"group"===i.violinmode)&&(a+=o.t.dPos),a}var q=t=>t.offsetTop+t.clientTop,G=t=>t.offsetLeft+t.clientLeft;function H(t,r){var i=t._fullLayout,a=r.getBoundingClientRect(),o=a.left,s=a.top,l=o+a.width,u=s+a.height,c=n.apply3DTransform(i._invTransform)(o,s),h=n.apply3DTransform(i._invTransform)(l,u),d=c[0],f=c[1],p=h[0],m=h[1];return{x:d,y:f,width:p-d,height:m-f,top:Math.min(f,m),left:Math.min(d,p),right:Math.max(d,p),bottom:Math.max(f,m)}}}}),rC=g({"src/components/fx/hoverlabel_defaults.js"(t,r){var i=t_(),n=ei(),a=t9().isUnifiedHover;r.exports=function(t,r,o,s){s=s||{};var l=r.legend;function u(t){s.font[t]||(s.font[t]=l?r.legend.font[t]:r.font[t])}r&&a(r.hovermode)&&(s.font||(s.font={}),u("size"),u("family"),u("color"),u("weight"),u("style"),u("variant"),l?(s.bgcolor||(s.bgcolor=n.combine(r.legend.bgcolor,r.paper_bgcolor)),s.bordercolor||(s.bordercolor=r.legend.bordercolor)):s.bgcolor||(s.bgcolor=r.paper_bgcolor)),o("hoverlabel.bgcolor",s.bgcolor),o("hoverlabel.bordercolor",s.bordercolor),o("hoverlabel.namelength",s.namelength),o("hoverlabel.showarrow",s.showarrow),i.coerceFont(o,"hoverlabel.font",s.font),o("hoverlabel.align",s.align)}}}),rI=g({"src/components/fx/layout_global_defaults.js"(t,r){var i=t_(),n=rC(),a=Z();r.exports=function(t,r){n(t,r,function(n,o){return i.coerce(t,r,a,n,o)})}}}),rL=g({"src/components/fx/defaults.js"(t,r){var i=t_(),n=X(),a=rC();r.exports=function(t,r,o,s){var l=i.extendFlat({},s.hoverlabel);r.hovertemplate&&(l.namelength=-1),a(t,r,function(a,o){return i.coerce(t,r,n,a,o)},l)}}}),rP=g({"src/components/fx/hovermode_defaults.js"(t,r){var i=t_(),n=Z();r.exports=function(t,r){function a(a,o){return void 0!==r[a]?r[a]:i.coerce(t,r,n,a,o)}return a("clickmode"),a("hoversubplots"),a("hoveranywhere"),a("clickanywhere"),a("hovermode")}}}),rz=g({"src/components/fx/layout_defaults.js"(t,r){var i=t_(),n=Z(),a=rP(),o=rC();r.exports=function(t,r){function s(a,o){return i.coerce(t,r,n,a,o)}var l=a(t,r);l&&(s("hoverdistance"),s("spikedistance"),-1!==l.indexOf("unified")&&s("hoversort")),"select"===s("dragmode")&&s("selectdirection");var u=r._has("map"),c=r._has("geo"),h=r._basePlotModules.length;"zoom"===r.dragmode&&((u||c)&&1===h||u&&c&&2===h)&&(r.dragmode="pan"),o(t,r,s),i.coerceFont(s,"hoverlabel.grouptitlefont",r.hoverlabel.font)}}}),rF=g({"src/components/fx/calc.js"(t,r){var i=t_(),n=e2();function a(t,r,n,a){a=a||i.identity,Array.isArray(t)&&(r[0][n]=a(t))}r.exports=function(t){for(var r=t.calcdata,o=t._fullLayout,s=0;s plotly-logomark "}}}}),rV=g({"src/components/shapes/draw_newshape/constants.js"(t,r){r.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),rU=g({"src/components/selections/helpers.js"(t,r){var i=t_().strTranslate;function n(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}r.exports={p2r:n,r2p:function(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}},axValue:function(t){var r=+("y"===t._id.charAt(0));return function(i){return n(t,i[r])}},getTransform:function(t){return i(t.xaxis._offset,t.yaxis._offset)}}}}),rq=g({"src/components/shapes/draw_newshape/helpers.js"(t){var r=re(),i=rV(),n=i.CIRCLE_SIDES,a=i.SQRT2,o=rU(),s=o.p2r,l=o.r2p,u=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function h(t,r){return 1e-6>=Math.abs(t-r)}function d(t,r){var i=r[1]-t[1],n=r[2]-t[2];return Math.sqrt(i*i+n*n)}t.writePaths=function(t){var r=t.length;if(!r)return"M0,0Z";for(var i="",n=0;n0&&ht+ +(void 0!==o[r.charAt(0)].drawn),0)},t.getDataToPixel=function(r,i,n,o,s){var l,u=r._fullLayout._size;if(i)if("domain"===s)l=function(t){return i._length*(o?1-t:t)+i._offset};else{var c=t.shapePositionToRange(i);l=function(t){var r=a(i,n);return i._offset+i.r2p(c(t,!0))+r},"date"===i.type&&(l=t.decodeDate(l))}else l=o?function(t){return u.t+u.h*(1-t)}:function(t){return u.l+u.w*t};return l},t.getPixelToData=function(r,i,n,a){var o,s=r._fullLayout._size;if(i)if("domain"===a)o=function(t){var r=(t-i._offset)/i._length;return n?1-r:r};else{var l=t.rangeToShapePosition(i);o=function(t){return l(i.p2r(t-i._offset))}}else o=n?function(t){return 1-(t-s.t)/s.h}:function(t){return(t-s.l)/s.w};return o},t.roundPositionForSharpStrokeRendering=function(t,r){var i=Math.round(t);return 1===Math.round(r%2)?i+.5:i},t.makeShapesOptionsAndPlotinfo=function(t,r){var i=t._fullLayout.shapes[r]||{},n=t._fullLayout._plots[i.xref+i.yref];return n?n._hadPlotinfo=!0:(n={},i.xref&&"paper"!==i.xref&&(n.xaxis=t._fullLayout[i.xref+"axis"]),i.yref&&"paper"!==i.yref&&(n.yaxis=t._fullLayout[i.yref+"axis"])),n.xsizemode=i.xsizemode,n.ysizemode=i.ysizemode,n.xanchor=i.xanchor,n.yanchor=i.yanchor,{options:i,plotinfo:n}},t.makeSelectionsOptionsAndPlotinfo=function(t,r){var i=t._fullLayout.selections[r]||{},n=t._fullLayout._plots[i.xref+i.yref];return n?n._hadPlotinfo=!0:(n={},i.xref&&(n.xaxis=t._fullLayout[i.xref+"axis"]),i.yref&&(n.yaxis=t._fullLayout[i.yref+"axis"])),{options:i,plotinfo:n}},t.getPathString=function(o,s){let l=s.type,u=n.getRefType(s.xref),c=n.getRefType(s.yref),h=o._fullLayout._size;function d(r,i,n,a){var o;if(r)if("domain"===i)o=a?function(t){return r._offset+r._length*(1-t)}:function(t){return r._offset+r._length*t};else{let i=t.shapePositionToRange(r);o=function(t){return r._offset+r.r2p(i(t,!0))},"path"===n&&"date"===r.type&&(o=t.decodeDate(o))}else o=a?function(t){return h.t+h.h*(1-t)}:function(t){return h.l+h.w*t};return o}if("array"===u?(A=[],v=s.xref.map(function(t){return n.getFromId(o,t)}),A=s.xref.map(function(t,r){return d(v[r],n.getRefType(t),l,!1)})):A=d(v=n.getFromId(o,s.xref),u,l,!1),"array"===c?(M=[],x=s.yref.map(function(t){return n.getFromId(o,t)}),M=s.yref.map(function(t,r){return d(x[r],n.getRefType(t),l,!0)})):M=d(x=n.getFromId(o,s.yref),c,l,!0),"path"===l){var f,p,m,g,y;let t,n,a,o,l,u,c;return f=s,p=A,m=M,t=f.path,n=f.xsizemode,a=f.ysizemode,o=f.xanchor,l=f.yanchor,u=Array.isArray(f.xref),c=Array.isArray(f.yref),g=0,y=0,t.replace(r.segmentRE,function(t){var s=0,h=t.charAt(0),d=r.paramIsX[h],f=r.paramIsY[h],v=r.numParams[h];let x=void 0!==d.drawn,b=void 0!==f.drawn,_=u?p[g]:p,w=c?m[y]:m;var T=t.slice(1).replace(r.paramRE,function(t){return d[s]?t="pixel"===n?_(o)+Number(t):_(t):f[s]&&(t="pixel"===a?w(l)-Number(t):w(t)),++s>v&&(t="X"),t});return s>v&&(T=T.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),x&&g++,b&&y++,h+T})}if("array"===u)b=a(v[0],s.x0shift),_=a(v[1],s.x1shift),k=A[0](s.x0)+b,S=A[1](s.x1)+_;else if(b=a(v,s.x0shift),_=a(v,s.x1shift),"pixel"===s.xsizemode){let t=A(s.xanchor);k=t+s.x0+b,S=t+s.x1+_}else k=A(s.x0)+b,S=A(s.x1)+_;if("array"===c)w=a(x[0],s.y0shift),T=a(x[1],s.y1shift),E=M[0](s.y0)+w,D=M[1](s.y1)+T;else if(w=a(x,s.y0shift),T=a(x,s.y1shift),"pixel"===s.ysizemode){let t=M(s.yanchor);E=t-s.y0+w,D=t-s.y1+T}else E=M(s.y0)+w,D=M(s.y1)+T;if("line"===l)return"M"+k+","+E+"L"+S+","+D;if("rect"===l)return"M"+k+","+E+"H"+S+"V"+D+"H"+k+"Z";var v,x,b,_,w,T,A,M,k,S,E,D,C=(k+S)/2,I=(E+D)/2,L=Math.abs(C-k),P=Math.abs(I-E),z="A"+L+","+P,F=C+L+","+I;return"M"+F+z+" 0 1,1 "+C+","+(I-P)+z+" 0 0,1 "+F+"Z"},t.getPixelShift=a}}),rY=g({"src/components/shapes/display_labels.js"(t,r){var i=t_(),n=rs(),a=tN(),o=rr(),s=rq().readPaths,l=rW(),u=l.getPathString,c=eX(),h=tj().FROM_TL;r.exports=function(t,r,d,f){if(f.selectAll(".shape-label").remove(),d.label.text||d.label.texttemplate){if(d.label.texttemplate){var p={};if("path"!==d.type){var m=n.getFromId(t,d.xref),g=n.getFromId(t,d.yref);let r=Array.isArray(d.xref),i=Array.isArray(d.yref);for(var y in c){var v="function"==typeof c[y],x=!r||c.simpleXVariables.includes(y),b=!i||c.simpleYVariables.includes(y);if(v&&x&&b){var _=c[y](d,m,g);void 0!==_&&(p[y]=_)}}}w=i.texttemplateStringForShapes({data:[p],fallback:d.label.texttemplatefallback,locale:t._fullLayout._d3locale,template:d.label.texttemplate})}else w=d.label.text;var w,T,A,M,k,S=d.label.font,E=f.append("g").attr({"data-index":r}).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(w);if(d.path){var D=s(u(t,d),t);T=1/0,M=1/0,A=-1/0,k=-1/0;for(var C=0;Cl.getDataToPixel(t,n,i,!1,a)(r),g=(r,i,n,a)=>l.getDataToPixel(t,n,i,!0,a)(r);if("pixel"===d.xsizemode){let t=m(d.xanchor,void 0,a,c),r=l.getPixelShift(a,d.x0shift),i=l.getPixelShift(a,d.x1shift);T=t+d.x0+r,A=t+d.x1+i}else T=m(d.x0,d.x0shift,a,c),A=m(d.x1,d.x1shift,o,h);if("pixel"===d.ysizemode){let t=g(d.yanchor,void 0,s,f),r=l.getPixelShift(s,d.y0shift),i=l.getPixelShift(s,d.y1shift);M=t-d.y0+r,k=t-d.y1+i}else M=g(d.y0,d.y0shift,s,f),k=g(d.y1,d.y1shift,u,p)}var O=d.label.textangle;"auto"===O&&(O="line"===d.type?function(t,r,i,n){var a;return a=Math.abs(i-t),-180/Math.PI*Math.atan2(i>=t?r-n:n-r,a)}(T,M,A,k):0),E.call(function(r){return r.call(o.font,S).attr({}),a.convertToTspans(r,t),r});var R=function(t,r,i,n,a,o,s){var l,u,c,d,f=a.label.textposition,p=a.label.textangle,m=a.label.padding,g=a.type,y=Math.PI/180*o,v=Math.sin(y),x=Math.cos(y),b=a.label.xanchor,_=a.label.yanchor;if("line"===g){"start"===f?(l=t,u=r):"end"===f?(l=i,u=n):(l=(t+i)/2,u=(r+n)/2),"auto"===b&&(b="start"===f?"auto"===p?i>t?"left":it?"right":it?"right":it?"left":i1&&(2!==t.length||"Z"!==t[1][0])&&(0===E&&(t[0][0]="M"),r[S]=t,I(),L())}}()}}function U(t,i){(function(t,i){if(r.length)for(var n=0;nE?(I=k,F="y0",L=E,O="y1"):(I=E,F="y1",L=k,O="y0"),es(i),ec(c,s),n=r,a=s,l=t,u=a.xref,h=a.yref,f=o.getFromId(l,u),p=o.getFromId(l,h),m="","paper"===u||f.autorange||(m+=u),"paper"===h||p.autorange||(m+=h),d.setClipUrl(n,m?"clip"+l._fullLayout._uid+m:null,l),eo.moveFn="move"===N?el:eu,eo.altKey=i.altKey)},doneFn:function(){_(t)||(g(r),eh(c),A(r,t,s),n.call("_guiRelayout",t,h.getUpdateObj()))},clickFn:function(){_(t)||eh(c)}};function es(i){if(_(t)){N=null;return}if(q)N="path"===i.target.tagName?"move":"start-point"===i.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=eo.element.getBoundingClientRect(),a=n.right-n.left,o=n.bottom-n.top,s=i.clientX-n.left,l=i.clientY-n.top,u=!G&&a>10&&o>10&&!i.shiftKey?p.getCursor(s/a,1-l/o):"move";g(r,u),N=u.split("-")[0]}}function el(i,n){if("path"===s.type){var a=function(t){return t},o=a,h=a;V?H("xanchor",s.xanchor=ei(D+i)):(o=function(t){return ei(et(t)+i)},W&&"date"===W.type&&(o=v.encodeDate(o))),U?H("yanchor",s.yanchor=en(C+n)):(h=function(t){return en(er(t)+n)},Z&&"date"===Z.type&&(h=v.encodeDate(h))),H("path",s.path=M(j,o,h))}else V?H("xanchor",s.xanchor=ei(D+i)):(H("x0",s.x0=ei(T+i)),H("x1",s.x1=ei(S+i))),U?H("yanchor",s.yanchor=en(C+n)):(H("y0",s.y0=en(k+n)),H("y1",s.y1=en(E+n)));r.attr("d",x(t,s)),ec(c,s),u(t,l,s,$)}function eu(i,n){if(G){var a=function(t){return t},o=a,h=a;V?H("xanchor",s.xanchor=ei(D+i)):(o=function(t){return ei(et(t)+i)},W&&"date"===W.type&&(o=v.encodeDate(o))),U?H("yanchor",s.yanchor=en(C+n)):(h=function(t){return en(er(t)+n)},Z&&"date"===Z.type&&(h=v.encodeDate(h))),H("path",s.path=M(j,o,h))}else if(q){if("resize-over-start-point"===N){var d=T+i,f=U?k-n:k+n;H("x0",s.x0=V?d:ei(d)),H("y0",s.y0=U?f:en(f))}else if("resize-over-end-point"===N){var p=S+i,m=U?E-n:E+n;H("x1",s.x1=V?p:ei(p)),H("y1",s.y1=U?m:en(m))}}else{var g=function(t){return -1!==N.indexOf(t)},y=g("n"),b=g("s"),_=g("w"),w=g("e"),A=y?I+n:I,Y=b?L+n:L,X=_?P+i:P,K=w?z+i:z;U&&(y&&(A=I-n),b&&(Y=L-n)),(!U&&Y-A>10||U&&A-Y>10)&&(H(F,s[F]=U?A:en(A)),H(O,s[O]=U?Y:en(Y))),K-X>10&&(H(R,s[R]=V?X:ei(X)),H(B,s[B]=V?K:ei(K)))}r.attr("d",x(t,s)),ec(c,s),u(t,l,s,$)}function ec(t,r){(V||U)&&function(){var i="path"!==r.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var o=et(V?r.xanchor:a.midRange(i?[r.x0,r.x1]:v.extractPathCoords(r.path,y.paramIsX))),s=er(U?r.yanchor:a.midRange(i?[r.y0,r.y1]:v.extractPathCoords(r.path,y.paramIsY)));if(o=v.roundPositionForSharpStrokeRendering(o,1),s=v.roundPositionForSharpStrokeRendering(s,1),V&&U){var l="M"+(o-1-1)+","+(s-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(V){var u="M"+(o-1-1)+","+(s-9-1)+"v18 h2 v-18 Z";n.attr("d",u)}else{var c="M"+(o-9-1)+","+(s-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function eh(t){t.selectAll(".visual-cue").remove()}p.init(eo),ea.node().onmousemove=es}(t,j,T,r,c,E):!0===T.editable&&j.style("pointer-events",O||h.opacity(L)*I<=.5?"stroke":"all");j.node().addEventListener("click",function(){var r=t,i=j;if(w(r)){var n=+i.node().getAttribute("data-index");if(n>=0){if(n===r._fullLayout._activeShapeIndex)return void S(r);r._fullLayout._activeShapeIndex=n,r._fullLayout._deactivateShape=S,b(r)}}}),function(t,r,i){if(!i?.id)return;let n=r.node();function a(t){var r;let n=i.mainplotinfo||i,a=null==(r=n?.draglayer)?void 0:r.select(".nsewdrag").node();return a?{clientX:t.clientX,clientY:t.clientY,target:a}:null}n.addEventListener("mousemove",r=>{if(!t._dragging&&t._fullLayout.hoveranywhere){let n=a(r);n&&m.hover(t,n,i.id)}}),n.addEventListener("click",r=>{if(!t._dragged&&t._fullLayout.clickanywhere){let n=a(r);n&&m.click(t,n,i.id)}})}(t,j,k)}("above"===T.layer?t._fullLayout._shapeUpperLayer:T.xref.includes("paper")||T.yref.includes("paper")?t._fullLayout._shapeLowerLayer:"between"!==T.layer||E?k._hadPlotinfo?(k.mainplotinfo||k).shapelayer:t._fullLayout._shapeLowerLayer:k.shapelayerBetween)}function A(t,r,i){let n=i.xref,s=i.yref;if(Array.isArray(n)||Array.isArray(s)){let l="clip"+r._fullLayout._uid+"shape"+i._index,u=function(t,r,i){let n=t._fullLayout._size;function a(r,i){let a=(Array.isArray(r)?r:[r]).map(r=>o.getFromId(t,r)).filter(Boolean);return a.length?[Math.min(...a.map(function(t){return t._offset})),Math.max(...a.map(function(t){return t._offset+t._length}))]:i?[n.t,n.t+n.h]:[n.l,n.l+n.w]}let s=a(r,!1),l=a(i,!0);return{x:s[0],y:l[0],width:s[1]-s[0],height:l[1]-l[0]}}(r,n,s);a.ensureSingleById(r._fullLayout._clips,"clipPath",l,function(t){t.append("rect")}).select("rect").attr(u),d.setClipUrl(t,l,r)}else{let i=(n+s).replace(/paper/g,"").replace(/[xyz][0-9]* *domain/g,"");d.setClipUrl(t,i?"clip"+r._fullLayout._uid+i:null,r)}}function M(t,r,i){return t.replace(y.segmentRE,function(t){var n=0,a=t.charAt(0),o=y.paramIsX[a],s=y.paramIsY[a],l=y.numParams[a];return a+t.slice(1).replace(y.paramRE,function(t){return n>=l||(o[n]?t=r(t):s[n]&&(t=i(t)),n++),t})})}function S(t){w(t)&&t._fullLayout._activeShapeIndex>=0&&(c(t),delete t._fullLayout._activeShapeIndex,b(t))}r.exports={draw:b,drawOne:T,eraseActiveShape:function(t){if(w(t)){c(t);var r=t._fullLayout._activeShapeIndex,i=(t.layout||{}).shapes||[];if(r{let s=i.select(t._fullLayout._paperdiv.node());s.selectAll(".plotly-cloud-dialog").remove();let l=s.append("div").classed("plotly-cloud-dialog",!0),u=()=>{l.remove(),document.removeEventListener("keydown",c)},c=t=>{("Escape"===t.key||27===t.keyCode)&&u()};document.addEventListener("keydown",c),l.on("click",()=>{i.event.target===l.node()&&u()}),((t,r,i,o,s)=>{let l=a(t),u=r.append("div").classed("plotly-cloud-dialog-box",!0);if(u.append("div").classed("plotly-cloud-dialog-title",!0).text(l.DIALOG_TITLE),i===n.plotlyServerURL){let t=u.append("div").classed("plotly-cloud-dialog-message",!0),r=new URL(i).origin,n=l.DIALOG_MESSAGE_CLOUD.split(/(\{|\})/),a=n[0],o=n[2],s=n[4];t.append("span").text(a),t.append("a").classed("plotly-cloud-dialog-message--hostname",!0).attr("href",r).attr("target","_blank").text(o),t.append("span").text(s),t.append("div").classed("plotly-cloud-dialog-message--account",!0).text(l.DIALOG_MESSAGE_CLOUD_ACCOUNT)}else{let t=new URL(i),r=t.hostname,n=t.origin,a=l.DIALOG_MESSAGE_OTHER.split(/(\{|\})/),o=a[0],s=a[4],c=u.append("div").classed("plotly-cloud-dialog-message",!0);c.append("span").text(o),c.append("a").classed("plotly-cloud-dialog-message--hostname",!0).attr("href",n).attr("target","_blank").text(r),c.append("span").text(s)}let c=u.append("div").classed("plotly-cloud-dialog-buttons",!0);c.append("button").classed("plotly-cloud-dialog-btn",!0).classed("plotly-cloud-dialog-btn--cancel",!0).text(l.DIALOG_CANCEL).on("click",s),c.append("button").classed("plotly-cloud-dialog-btn",!0).classed("plotly-cloud-dialog-btn--confirm",!0).text(l.DIALOG_CONFIRM).on("click",o)})(t,l,r,()=>{u(),o()},u)}}}),rQ=g({"src/components/modebar/buttons.js"(t,r){var i=e2(),n=tR(),a=tL(),o=rN(),s=rX().eraseActiveShape,l=rJ(),u=t_(),c=u._,h=r.exports={};function d(t,r){var n,o,s=r.currentTarget,l=s.getAttribute("data-attr"),u=s.getAttribute("data-val")||!0,c=t._fullLayout,h={},d=a.list(t,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===l){var p,m="in"===u?.5:2,g=(1+m)/2,y=(1-m)/2;for(o=0;o-t),[d,f]=o.invert(u.midPt),{minscale:p}=a.projection,m=null!=(n=a.projection.maxscale)?n:1/0,g=Math.min(p,m),y=Math.max(p,m),v="in"===s?2*l:.5*l;v>y?v=y:vr3});var r2,r3,r5=m({"src/components/modebar/attributes.ts"(){r2=x(r0()),r3={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar",description:"Sets the orientation of the modebar."},bgcolor:{valType:"color",editType:"modebar",description:"Sets the background color of the modebar."},color:{valType:"color",editType:"modebar",description:"Sets the color of the icons in the modebar."},activecolor:{valType:"color",editType:"modebar",description:"Sets the color of the active or hovered on icons in the modebar."},uirevision:{valType:"any",editType:"none",description:"Controls persistence of user-driven changes related to the modebar, including `hovermode`, `dragmode`, and `showspikes` at both the root level and inside subplots. Defaults to `layout.uirevision`."},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:`Determines which predefined modebar buttons to add. Please note that these buttons will only be shown if they are compatible with all trace types used in a graph. Similar to \`config.modeBarButtonsToAdd\` option. This may include *${r2.default.backButtons.join("*, *")}*.`},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:`Determines which predefined modebar buttons to remove. Similar to \`config.modeBarButtonsToRemove\` option. This may include *${r2.default.foreButtons.join("*, *")}*.`}}}}),r4=g({"src/components/modebar/defaults.js"(t,r){var i=t_(),n=ei(),a=tC(),o=(r5(),b(r1)).default;r.exports=function(t,r){var s=t.modebar||{},l=a.newContainer(r,"modebar");function u(t,r){return i.coerce(s,l,o,t,r)}u("orientation"),u("bgcolor",n.addOpacity(r.paper_bgcolor,.5));var c=n.contrast(n.rgb(r.modebar.bgcolor));u("color",n.addOpacity(c,.3)),u("activecolor",n.addOpacity(c,.7)),u("uirevision",r.uirevision),u("add"),u("remove")}}}),r6=g({"src/components/modebar/modebar.js"(t,r){var i=k(),n=L(),a=t_(),o=rN(),s=A().version,l=new DOMParser;function u(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var c=u.prototype;c.update=function(t,r){this.graphInfo=t;var i=this.graphInfo._context,n=this.graphInfo._fullLayout,o="modebar-"+n._uid;this.element.setAttribute("id",o),this.element.setAttribute("role","toolbar"),this._uid=o,this.element.className="modebar modebar--custom","hover"===i.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",r=r.reverse());var s=n.modebar;document.querySelectorAll("#"+o+" .modebar-group").forEach(function(t){t.style.backgroundColor=s.bgcolor});var l=!this.hasButtons(r),u=this.hasLogo!==i.displaylogo,c=this.locale!==i.locale;if(this.locale=i.locale,(l||u||c)&&(this.removeAllButtons(),this.updateButtons(r),i.watermark||i.displaylogo)){var h=this.getLogo();i.watermark&&(h.className=h.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(h,this.element.childNodes[0]):this.element.appendChild(h),this.hasLogo=!0}this.updateActiveButton(),a.setStyleOnHover("#"+o+" .modebar-btn",".active",".icon path","fill: "+s.activecolor,"fill: "+s.color,this.element)},c.updateButtons=function(t){var r=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var i=r.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw Error("must provide button 'name' in button config");if(-1!==r.buttonsNames.indexOf(n))throw Error("button name '"+n+"' is taken");r.buttonsNames.push(n);var a=r.createButton(t);r.buttonElements.push(a),i.appendChild(a)}),r.element.appendChild(i)})},c.createGroup=function(){var t=document.createElement("div");t.className="modebar-group";var r=this.graphInfo._fullLayout.modebar;return t.style.backgroundColor=r.bgcolor,t},c.createButton=function(t){var r=this,n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("rel","tooltip"),n.className="modebar-btn";var a=t.title;void 0===a?a=t.name:"function"==typeof a&&(a=a(this.graphInfo)),(a||0===a)&&(n.setAttribute("data-title",a),n.setAttribute("aria-label",a)),void 0!==t.attr&&n.setAttribute("data-attr",t.attr);var s=t.val;if(void 0!==s&&("function"==typeof s&&(s=s(this.graphInfo)),n.setAttribute("data-val",s)),"function"!=typeof t.click)throw Error("must provide button 'click' function in button config");n.addEventListener("click",function(i){t.click(r.graphInfo,i),r.updateActiveButton(i.currentTarget)}),n.setAttribute("data-toggle",t.toggle||!1),t.toggle&&i.select(n).classed("active",!0);var l=t.icon;return"function"==typeof l?n.appendChild(l()):n.appendChild(this.createIcon(l||o.question)),n.setAttribute("data-gravity",t.gravity||"n"),n},c.createIcon=function(t){var r,i=n(t.height)?Number(t.height):t.ascent-t.descent,a="http://www.w3.org/2000/svg";if(t.path){(r=document.createElementNS(a,"svg")).setAttribute("viewBox",["0 0",t.width,i].join(" ")),r.setAttribute("class","icon");var o=document.createElementNS(a,"path");o.setAttribute("d",t.path),t.transform?o.setAttribute("transform",t.transform):void 0!==t.ascent&&o.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),r.appendChild(o)}return t.svg&&(r=l.parseFromString(t.svg,"application/xml").childNodes[0]),r.setAttribute("height","1em"),r.setAttribute("width","1em"),r},c.updateActiveButton=function(t){var r=this.graphInfo._fullLayout,n=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var o=t.getAttribute("data-val")||!0,s=t.getAttribute("data-attr"),l="true"===t.getAttribute("data-toggle"),u=i.select(t),c=function(t,i){var n=r.modebar,a=t.querySelector(".icon path");a&&(i||t.matches(":hover")?a.style.fill=n.activecolor:a.style.fill=n.color)};if(l){if(s===n){var h=!u.classed("active");u.classed("active",h),c(t,h)}}else{var d=null===s?s:a.nestedProperty(r,s).get();u.classed("active",d===o),c(t,d===o)}})},c.hasButtons=function(t){var r=this.buttons;if(!r||t.length!==r.length)return!1;for(var i=0;i1?(L=["toggleHover"],P=["resetViews"]):v?(I=["zoomInGeo","zoomOutGeo"],L=["hoverClosestGeo"],P=["resetGeo"]):y?(L=["hoverClosest3d"],P=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(I=["zoomInMap","zoomOutMap"],L=["toggleHover"],P=["resetViewMap"]):x?L=["hoverClosestPie"]:M?(L=["hoverClosestCartesian","hoverCompareCartesian"],P=["resetViewSankey"]):L=["toggleHover"],g&&L.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(t){for(var r=0;rn?a.slice(n):o.slice(i))+s:a+o+t*r:s}function p(t,r){var i=t._inputDomain,n=u[t.constraintoward],a=i[0]+(i[1]-i[0])*n;t.domain=t._input.domain=[a+(i[0]-a)/r,a+(i[1]-a)/r],t.setScale()}t.handleDefaults=function(t,i,o){var l,u,f,p,m,g,y,v,x=o.axIds,b=o.axHasImage,_=i._axisConstraintGroups=[],w=i._axisMatchGroups=[];for(l=0;ll*x&&!T)){for(a=0;aP&&RI&&(I=R);f/=(I-C)/(2*L),C=c.l2r(C),I=c.l2r(I),c.range=c._input.range=S=t[1]||a[1]<=t[0])&&o[0]r[0])return!0}return!1}(q,G,V)&&-1===E.indexOf(x)){var $=H.node(),W=D.bg=a.ensureSingle(H,"rect","bg");$.insertBefore(W.node(),$.childNodes[0]),N.push(E)}else H.select("rect.bg").remove(),V.push([q,G]),U||(j.push(E),N.push(E))}var Y=P._bgLayer.selectAll(".bg").data(j);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each(function(t){P._plots[t].bg=r.select(this)}),S=0;S.5?"t":"b",u=t._fullLayout.margin[l],c=0;return"paper"===r.yref?c=i+r.pad.t+r.pad.b:"container"===r.yref&&(n=t._fullLayout.height,a=0,"middle"===s&&(a+=i/2),"t"===l?("top"===s&&(a+=i),a+=n-o*n):("bottom"===s&&(a+=i),a+=o*n),c=a+r.pad.t+r.pad.b),c>u?c:0}(t,M,L);if(P>0){(function(t,r,i,o){var s,l,u="title.automargin",c=t._fullLayout.title,h=c.y>.5?"t":"b",d={x:c.x,y:c.y,t:0,b:0},f={};"paper"===c.yref&&(s="paper"===c.yref?t._fullLayout._size.h:t._fullLayout.height,l=a.isTopAnchor(c)?r:r-o,!(a.isTopAnchor(c)&&"t"===h||a.isBottomAnchor(c)&&"b"===h)&&("b"===h?s-l:l)=0;A--){var M=a.append("path").attr(g).style("opacity",A?.1:y).call(o.stroke,x).call(o.fill,v).call(s.dashLine,A?"solid":_,A?4+b:b);if(function(t,r,i){var n=i.xref+i.yref;s.setClipUrl(t,"clip"+r._fullLayout._uid+n,r)}(M,t,f),w){var k=l(t.layout,"selections",f);M.style({cursor:"move"});var S={element:M.node(),plotinfo:m,gd:t,editHelpers:k,isActiveSelection:!0};n(i(u,t),M,S)}else M.style("pointer-events",A?"all":"none");T[A]=M}var E=T[0];T[1].node().addEventListener("click",function(){var r=t,i=E;if(d(r)){var n=+i.node().getAttribute("data-index");if(n>=0){if(n===r._fullLayout._activeSelectionIndex)return void p(r);r._fullLayout._activeSelectionIndex=n,r._fullLayout._deactivateSelection=p,h(r)}}})}(t._fullLayout._selectionLayer)}function p(t){d(t)&&t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,h(t))}r.exports={draw:h,drawOne:f,activateLastSelection:function(t){if(d(t)){var r=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=p,h(t)}}}}}),ii=g({"node_modules/polybooljs/lib/build-log.js"(t,r){r.exports=function(){var t,r=0,i=!1;function n(r,i){return t.list.push({type:r,data:i?JSON.parse(JSON.stringify(i)):void 0}),t}return t={list:[],segmentId:function(){return r++},checkIntersection:function(t,r){return n("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return n("div_seg",{seg:t,pt:r}),n("chop",{seg:t,pt:r})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,r){return n("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,r,i){return n("temp_status",{seg:t,above:r,below:i})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,r,i){return n("status",{seg:t,above:r,below:i})},vert:function(r){return r===i?t:(i=r,n("vert",{x:r}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,r){return n("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return n("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return n("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,r){return n("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return n("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return n("chain_con",{index1:t,index2:r})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,r){return n("chain_join",{index1:t,index2:r})},done:function(){return n("done")}}}}}),ia=g({"node_modules/polybooljs/lib/epsilon.js"(t,r){r.exports=function(t){"number"!=typeof t&&(t=1e-10);var r={epsilon:function(r){return"number"==typeof r&&(t=r),t},pointAboveOrOnLine:function(r,i,n){var a=i[0],o=i[1],s=n[0],l=n[1],u=r[0];return(s-a)*(r[1]-o)-(l-o)*(u-a)>=-t},pointBetween:function(r,i,n){var a=r[1]-i[1],o=n[0]-i[0],s=r[0]-i[0],l=n[1]-i[1],u=s*o+a*l;return!(u-t)},pointsSameX:function(r,i){return Math.abs(r[0]-i[0])t!=s-a>t&&(o-c)*(a-h)/(s-h)+c-n>t&&(l=!l),o=c,s=h}return l}};return r}}}),io=g({"node_modules/polybooljs/lib/linked-list.js"(t,r){r.exports={create:function(){var t={root:{root:!0,next:null},exists:function(r){return null!==r&&r!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(r,i){for(var n=t.root,a=t.root.next;null!==a;){if(i(a)){r.prev=a.prev,r.next=a,a.prev.next=r,a.prev=r;return}n=a,a=a.next}n.next=r,r.prev=n,r.next=null},findTransition:function(r){for(var i=t.root,n=t.root.next;null!==n&&!r(n);)i=n,n=n.next;return{before:i===t.root?null:i,after:n,insert:function(t){return t.prev=i,t.next=n,i.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}}}),is=g({"node_modules/polybooljs/lib/intersecter.js"(t,r){var i=io();r.exports=function(t,r,n){function a(t,r,i){return{id:n?n.segmentId():-1,start:t,end:r,myFill:{above:i.myFill.above,below:i.myFill.below},otherFill:null}}var o=i.create();function s(t,i){o.insertBefore(t,function(n){var a,o,s,l,u,c;return a=t.isStart,o=t.pt,s=n.isStart,l=n.pt,u=n.other.pt,(0!==(c=r.pointsCompare(o,l))?c:r.pointsSame(i,u)?0:a!==s?a?1:-1:r.pointAboveOrOnLine(i,s?l:u,s?u:l)?1:-1)<0})}function l(t,r){var n,a,o=(s(n=i.node({isStart:!0,pt:t.start,seg:t,primary:r,other:null,status:null}),t.end),n);return a=i.node({isStart:!1,pt:t.end,seg:t,primary:r,other:o,status:null}),o.other=a,s(a,o.pt),o}function u(t,r){var i=a(r,t.seg.end,t.seg);return n&&n.segmentChop(t.seg,r),t.other.remove(),t.seg.end=r,t.other.pt=r,s(t.other,t.pt),l(i,t.primary)}function c(a,s){var l=i.create();function c(t,i){var a=t.seg,o=i.seg,s=a.start,l=a.end,c=o.start,h=o.end;n&&n.checkIntersection(a,o);var d=r.linesIntersect(s,l,c,h);if(!1===d){if(!r.pointsCollinear(s,l,c)||r.pointsSame(s,h)||r.pointsSame(l,c))return!1;var f=r.pointsSame(s,c),p=r.pointsSame(l,h);if(f&&p)return i;var m=!f&&r.pointBetween(s,c,h),g=!p&&r.pointBetween(l,c,h);if(f)return g?u(i,l):u(t,h),i;m&&(p||(g?u(i,l):u(t,h)),u(i,s))}else 0===d.alongA&&(-1===d.alongB?u(t,c):0===d.alongB?u(t,d.pt):1===d.alongB&&u(t,h)),0===d.alongB&&(-1===d.alongA?u(i,s):0===d.alongA?u(i,d.pt):1===d.alongA&&u(i,l));return!1}for(var h=[];!o.isEmpty();){var d=o.getHead();if(n&&n.vert(d.pt[0]),d.isStart){n&&n.segmentNew(d.seg,d.primary);var f,p,m=function(t){return l.findTransition(function(i){var n,a,o,s,l;return n=i.ev,a=t.seg.start,o=t.seg.end,s=n.seg.start,l=n.seg.end,(r.pointsCollinear(a,s,l)?r.pointsCollinear(o,s,l)||r.pointAboveOrOnLine(o,s,l)?1:-1:r.pointAboveOrOnLine(a,s,l)?1:-1)>0})}(d),g=m.before?m.before.ev:null,y=m.after?m.after.ev:null;n&&n.tempStatus(d.seg,!!g&&g.seg,!!y&&y.seg);var v=function(){if(g){var t=c(d,g);if(t)return t}return!!y&&c(d,y)}();if(v&&(t?(f=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above):v.seg.otherFill=d.seg.myFill,n&&n.segmentUpdate(v.seg),d.other.remove(),d.remove()),o.getHead()!==d){n&&n.rewind(d.seg);continue}t?(f=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,y?d.seg.myFill.below=y.seg.myFill.above:d.seg.myFill.below=a,f?d.seg.myFill.above=!d.seg.myFill.below:d.seg.myFill.above=d.seg.myFill.below):null===d.seg.otherFill&&(p=y?d.primary===y.primary?y.seg.otherFill.above:y.seg.myFill.above:d.primary?s:a,d.seg.otherFill={above:p,below:p}),n&&n.status(d.seg,!!g&&g.seg,!!y&&y.seg),d.other.status=m.insert(i.node({ev:d}))}else{var x=d.status;if(null===x)throw Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(x.prev)&&l.exists(x.next)&&c(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!d.primary){var b=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=b}h.push(d.seg)}o.getHead().remove()}return n&&n.done(),h}return t?{addRegion:function(t){for(var i,a=t[t.length-1],o=0;oo!=p>o&&a<(f-h)*(o-d)/(p-d)+h&&(s=!s)}return s}}}),ip=g({"src/lib/polygon.js"(t,r){var i=eq().dot,n=P().BADNUM,a=r.exports={};a.tester=function(t){var r,i=t.slice(),a=i[0][0],o=a,s=i[0][1],l=s;for((i[i.length-1][0]!==i[0][0]||i[i.length-1][1]!==i[0][1])&&i.push(i[0]),r=1;ro||c===n||cl||r&&u(t))}:function(t,r){var u=t[0],c=t[1];if(u===n||uo||c===n||cl)return!1;var h,d,f,p,m,g=i.length,y=i[0][0],v=i[0][1],x=0;for(h=1;hMath.max(d,y)||c>Math.max(f,v)))if(ch||Math.abs(i(s,f))>a)return!0;return!1},a.filter=function(t,r){var i=[t[0]],n=0,o=0;function s(s){t.push(s);var l=i.length,u=n;i.splice(o+1);for(var c=u+1;c1&&s(t.pop()),{addPt:s,raw:t,filtered:i}}}}),im=g({"src/components/selections/constants.js"(t,r){r.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),ig=g({"src/components/selections/select.js"(t,r){var i=ih(),n=id(),a=e2(),o=rr().dashStyle,s=ei(),l=rR(),u=t9().makeEventData,c=rB(),h=c.freeMode,d=c.rectMode,f=c.drawMode,p=c.openMode,m=c.selectMode,g=rW(),y=r$(),v=rZ(),x=tP().clearOutline,b=rq(),_=b.handleEllipse,w=b.readPaths,T=rG().newShapes,A=rH(),M=ir().activateLastSelection,k=t_(),S=k.sorterAsc,E=ip(),D=tn(),C=tL().getFromId,I=rj(),L=it().redrawReglTraces,P=im(),z=P.MINSELECT,F=E.filter,O=E.tester,R=rU(),B=R.p2r,j=R.axValue,N=R.getTransform;function V(t){return void 0!==t.subplot}function U(t,r,i,n,a,o,s){var l,u,c,h,d,f,m,g,y,x=r._hoverdata,b=r._fullLayout.clickmode.indexOf("event")>-1,_=[];if((w=x)&&Array.isArray(w)&&!0!==w[0].hoverOnBox){H(t,r,o);var w,T,A=function(t,r){var i,n,a=t[0],o=-1,s=[];for(n=0;n0?function(t,r){var i,n,a,o=[];for(a=0;a0&&o.push(i);if(1===o.length&&o[0]===r.searchInfo&&(n=r.searchInfo.cd[0].trace).selectedpoints.length===r.pointNumbers.length){for(a=0;an.selectedpoints.indexOf(r.pointNumbers[a]))return!1;return!0}return!1}(l,A):function(t){var r,i,n=0;for(i=0;i1||(n+=r.selectedpoints.length)>1))return!1;return 1===n}(l)&&(f=X(A))){for(s&&s.remove(),y=0;y=0&&o._fullLayout._deactivateShape(o),o._fullLayout._activeSelectionIndex>=0&&o._fullLayout._deactivateSelection(o);var s=o._fullLayout._zoomlayer,l=f(i),u=m(i);if(l||u){var c,h,d=s.selectAll(".select-outline-"+n.id);d&&o._fullLayout._outlining&&(l&&(c=T(d,t)),c&&a.call("_guiRelayout",o,{shapes:c}),u&&!V(t)&&(h=A(d,t)),h&&(o._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",o,{selections:h}).then(function(){r&&M(o)})),o._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function W(t){return t._id}function Y(t,r,i,n){if(!t.calcdata)return[];var a,o,s,l=[],u=r.map(W),c=i.map(W);for(s=0;s0?n[0]:i;return!!r.selectedpoints&&r.selectedpoints.indexOf(a)>-1}function K(t,r,i){var n,o;for(n=0;n-1&&r;if(!o&&r){var em=ea(t,!0);if(em.length){var eg=em[0].xref,ey=em[0].yref;if(eg&&ey){var ev=el(em);eu([C(t,eg,"x"),C(t,ey,"y")])(ef,ev)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:ep&&ec(t,ef),p._reselect=!1}if(!o&&p._deselect){var ex=p._deselect;(function(t,r,i){for(var n=0;n=0)return void E._fullLayout._deactivateShape(E);if(!w){var i=C.clickmode;D.done(eD).then(function(){if(D.clear(eD),2===t){for(eT.remove(),eo=0;eo-1&&U(r,E,n.xaxes,n.yaxes,n.subplot,n,eT),"event"===i&&ec(E,void 0);l.click(E,r,B.id)}).catch(k.error)}},n.doneFn=function(){eS.remove(),D.done(eD).then(function(){D.clear(eD),!I&&ea&&n.selectionDefs&&(ea.subtract=ew,n.selectionDefs.push(ea),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,ei)),(I||w)&&$(n,I),n.doneFnCompleted&&n.doneFnCompleted(eC),T&&ec(E,ed)}).catch(k.error)}},clearOutline:x,clearSelectionsCache:$,selectOnClick:U}}}),iy=g({"src/components/annotations/arrow_paths.js"(t,r){r.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),iv=g({"src/constants/axis_placeable_objects.js"(t,r){r.exports={axisRefDescription:function(t,r,i){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",r,"of the plotting area in normalized coordinates where *0* (*1*) corresponds to the",r,"("+i+"). If set to a",t,"axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the",r,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t,"axis and a",t,"position of 0.5 refers to the point between the",r,"and the",i,"of the domain of the second",t,"axis."].join(" ")}}}}),ix=g({"src/components/annotations/attributes.js"(t,r){var i=iy(),n=W(),a=tI(),o=tC().templatedArray;iv(),r.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:i.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:i.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),ib=g({"src/traces/scatter/constants.js"(t,r){r.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),i_=g({"src/traces/scatter/fillcolor_attribute.js"(t,r){r.exports=function(t){return{valType:"color",editType:"style",anim:!0}}}}),iw=g({"src/traces/scatter/attributes.js"(t,r){var i=tU().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:a,templatefallbackAttrs:o}=eZ(),s=tH(),l=W(),u=eW().dash,c=eW().pattern,h=rr(),d=ib(),f=$().extendFlat,p=i_();function m(t){return{valType:"any",dflt:0,editType:"calc"}}function g(t){return{valType:"any",editType:"calc"}}function y(t){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}r.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:m("x"),yperiod:m("y"),xperiod0:g("x0"),yperiod0:g("y0"),xperiodalignment:y("x"),yperiodalignment:y("y"),xhoverformat:i("x"),yhoverformat:i("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:a(),texttemplatefallback:o({editType:"calc"}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:n({},{keys:d.eventDataKeys}),hovertemplatefallback:o(),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:f({},u,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:p(!0),fillgradient:f({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:c,marker:f({symbol:{valType:"enumerated",values:h.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:f({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},dash:f({},u,{arrayOk:!0}),editType:"calc"},s("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},s("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:l({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),iT=g({"src/components/selections/attributes.js"(t,r){var i=ix(),n=iw().line,a=eW().dash,o=$().extendFlat,s=e$().overrideAll,l=tC().templatedArray;iv(),r.exports=s(l("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:o({},i.xref,{}),yref:o({},i.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:n.color,width:o({},n.width,{min:1,dflt:1}),dash:o({},a,{dflt:"dot"})}}),"arraydraw","from-root")}}),iA=g({"src/components/selections/defaults.js"(t,r){var i=t_(),n=rs(),a=tJ(),o=iT(),s=rW();function l(t,r,a){function l(n,a){return i.coerce(t,r,o,n,a)}var u=l("path"),c="path"!==l("type",u?"path":"rect");c&&delete r.path,l("opacity"),l("line.color"),l("line.width"),l("line.dash");for(var h=["x","y"],d=0;d<2;d++){var f,p,m,g=h[d],y={_fullLayout:a},v=n.coerceRef(t,r,y,g);if((f=n.getFromId(y,v))._selectionIndices.push(r._index),m=s.rangeToShapePosition(f),p=s.shapePositionToRange(f),c){var x=g+"0",b=g+"1",_=t[x],w=t[b];t[x]=p(t[x],!0),t[b]=p(t[b],!0),n.coercePosition(r,y,l,v,x),n.coercePosition(r,y,l,v,b);var T=r[x],A=r[b];void 0!==T&&void 0!==A&&(r[x]=m(T),r[b]=m(A),t[x]=_,t[b]=w)}}c&&i.noneOrAll(t,r,["x0","x1","y0","y1"])}r.exports=function(t,r){a(t,r,{name:"selections",handleItemDefaults:l});for(var i=r.selections,n=0;n.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(i,n)).attr("d",a+"Z")}function j(t,r,i){return t.append("path").attr("class","zoombox-corners").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(r,i)).attr("d","M0,0Z")}function N(t,r,i,n,a,o){t.attr("d",n+"M"+i.l+","+i.t+"v"+i.h+"h"+i.w+"v-"+i.h+"h-"+i.w+"Z"),V(t,r,a,o)}function V(t,r,i,n){i||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),r.transition().style("opacity",1).duration(200))}function U(t){i.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(t){L&&t.data&&t._context.showTips&&(n.notifier(n._(t,"Double-click to zoom back out"),"long",t),L=!1)}function G(t){var r=Math.floor(Math.min(t.b-t.t,t.r-t.l,I)/2);return"M"+(t.l-3.5)+","+(t.t-.5+r)+"h3v"+-r+"h"+r+"v-3h-"+(r+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+r)+"h-3v"+-r+"h"+-r+"v-3h"+(r+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-r)+"h-3v"+r+"h"+-r+"v3h"+(r+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-r)+"h3v"+r+"h"+r+"v3h-"+(r+3)+"Z"}function H(t,r,i,a,o){for(var s,l,u,c,h=!1,d={},f={},p=(o||{}).xaHash,m=(o||{}).yaHash,g=0;g=0)return void l._fullLayout._deactivateShape(l);var c=l._fullLayout.clickmode;if(U(l),2!==n||eC||function(){if(!t._transitioningWithDuration){var r=t._context.doubleClick,i=[];ey&&(i=i.concat(eu)),ev&&(i=i.concat(ec)),eg.xaxes&&(i=i.concat(eg.xaxes)),eg.yaxes&&(i=i.concat(eg.yaxes));var n,a,o={};if("reset+autosize"===r)for(r="autosize",a=0;a-1&&S(o,l,eu,ec,r.id,eP),c.indexOf("event")>-1&&d.click(l,o,r.id);else if(1===n&&eC){var h,f,p,m,g=k?eo:ea,y=+("s"!==k&&"w"!==L),v=g._name+".range["+y+"]",x=(h=g,f=y,m=Math.abs((p=h.range[f])-h.range[1-f]),"date"===h.type?p:"log"===h.type?a("."+(Math.ceil(Math.max(0,-Math.log(m)/Math.LN10))+3)+"g")(Math.pow(10,p)):a("."+String(Math.floor(Math.log(Math.abs(p))/Math.LN10)-Math.floor(Math.log(m)/Math.LN10)+4)+"g")(p)),b="left",_="middle";if(g.fixedrange)return;k?(_="n"===k?"top":"bottom","right"===g.side&&(b="right")):"e"===L&&(b="right"),l._context.showAxisRangeEntryBoxes&&i.select(eL).call(u.makeEditable,{gd:l,immediate:!0,background:l._fullLayout.paper_bgcolor,text:String(x),fill:g.tickfont?g.tickfont.color:"#444",horizontalAlign:b,verticalAlign:_}).on("edit",function(t){var r=g.d2r(t);void 0!==r&&s.call("_guiRelayout",l,v,r)})}}function eO(r,i){if(t._transitioningWithDuration)return!1;var n,a,o,s,l=Math.max(0,Math.min(ef,ek*r+Z)),u=Math.max(0,Math.min(ep,eS*i+X)),c=Math.abs(l-Z),h=Math.abs(u-X);function d(){et="",K.r=K.l,K.t=K.b,ei.attr("d","M0,0Z")}if(K.l=Math.min(Z,l),K.r=Math.max(Z,l),K.t=Math.min(X,u),K.b=Math.max(X,u),em.isSubplotConstrained)c>I||h>I?(et="xy",c/ef>h/ep?(h=c*ep/ef,X>u?K.t=X-h:K.b=X+h):(c=h*ef/ep,Z>l?K.l=Z-c:K.r=Z+c),ei.attr("d",G(K))):d();else if(eg.isSubplotConstrained)if(c>I||h>I){et="xy";var f=Math.min(K.l/ef,(ep-K.b)/ep),p=Math.max(K.r/ef,(ep-K.t)/ep);K.l=f*ef,K.r=p*ef,K.b=(1-f)*ep,K.t=(1-p)*ep,ei.attr("d",G(K))}else d();else{!ev||h0){if(eg.isSubplotConstrained||!ey&&1===ev.length){for(o=0;o=0?Math.min(u,.9):1/(1/Math.max(u,-.3)+3.222)));var u,c=l.l2r(a);!1!==c&&void 0!==c&&(l.range[r]=c)}}return n._length*(n._rl[r]-a)/(n._rl[r]-n._rl[o])}}function eG(t,r){for(var i=eg.isSubplotConstrained?({x:ec,y:eu})[t]:eg[t+"axes"],n=eg.isSubplotConstrained?({x:eu,y:ec})[t]:[],a=0;a1&&(void 0!==o.maxallowed&&eb===(o.range[0]1&&(void 0!==l.maxallowed&&e_===(l.range[0]1&&n.warn("Full array edits are incompatible with other edits",f);var b=u[""][""];if(l(b))r.set(null);else{if(!Array.isArray(b))return n.warn("Unrecognized full array edit value",f,b),!0;r.set(b)}return!y&&(p(v,x),m(t),!0)}var _,w,T,A,M,k,S,E,D=Object.keys(u).map(Number).sort(a),C=r.get(),I=C||[],L=h(x,f).get(),P=[],z=-1,F=I.length;for(_=0;_I.length-!S){n.warn("index out of range",f,T);continue}if(void 0!==k)M.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",f,T),l(k)?P.push(T):S?("add"===k&&(k={}),I.splice(T,0,k),L&&L.splice(T,0,{})):n.warn("Unrecognized full object edit value",f,T,k),-1===z&&(z=T);else for(w=0;w=0;_--)I.splice(P[_],1),L&&L.splice(P[_],1);if(I.length?C||r.set(I):r.set(null),y)return!1;if(p(v,x),g!==i){if(-1===z)d=D;else{for(F=Math.max(I.length,F),d=[],_=0;_=z);_++)d.push(T);for(_=z;_0&&n.log("Clearing previous rejected promises from queue."),t._promises=[]},t.cleanLayout=function(r){r||(r={}),r.xaxis1&&(r.xaxis||(r.xaxis=r.xaxis1),delete r.xaxis1),r.yaxis1&&(r.yaxis||(r.yaxis=r.yaxis1),delete r.yaxis1),r.scene1&&(r.scene||(r.scene=r.scene1),delete r.scene1);var i,o=(a.subplotsRegistry.cartesian||{}).attrRegex,l=((a.subplotsRegistry.polar||{}).attrRegex,(a.subplotsRegistry.ternary||{}).attrRegex,(a.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(r));for(i=0;i3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===r.dragmode&&(r.dragmode="orbit"),r.template&&r.template.layout&&t.cleanLayout(r.template.layout),r},t.cleanData=function(r){for(var o=0;o0)return t.slice(0,r)}t.hasParent=function(t,r){for(var i=g(r);i;){if(i in t)return!0;i=g(i)}return!1},t.clearAxisTypes=function(t,r,i){for(var a=0;a{let i=(...t)=>t.every(t=>n.isPlainObject(t))||t.every(t=>Array.isArray(t));if([t,r].every(t=>Array.isArray(t))){if(t.length!==r.length)return!1;for(let n=0;nn.isPlainObject(t))){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(let n in t){if(n.startsWith("_"))continue;let a=t[n],o=r[n];if(a!==o&&!(i(a,o)&&y(a,o)))return!1}return!0}return!1};t.collectionsAreEqual=y}}),iP=g({"src/plot_api/plot_api.js"(t){var r=k(),i=L(),n=tA(),a=t_(),o=a.nestedProperty,s=tk(),l=tS(),u=e2(),c=tD(),h=tR(),d=rs(),f=ru(),p=tq(),m=rr(),g=ei(),y=iD().initInteractions,v=tB(),x=iS().clearOutline,b=Q().dfltConfig,_=iI(),w=iL(),T=it(),A=e$(),M=tI().AX_NAME_PATTERN,S=0;function E(t){var r=t._fullLayout;r._redrawFromAutoMarginCount?r._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function D(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){a.error(t)}}function C(t,r){D(t,g.combine(r,"white"))}function I(t,i){if(!t._context){t._context=a.extendDeep({},b);var o=r.select("base");t._context._baseUrl=o.size()&&o.attr("href")?window.location.href.split("#")[0]:""}var s,l,u,c=t._context;if(i){for(l=Object.keys(i),s=0;s=t.data.length||a<-t.data.length)throw Error(i+" must be valid indices for gd.data.");if(r.indexOf(a,n+1)>-1||a>=0&&r.indexOf(-t.data.length+a)>-1||a<0&&r.indexOf(t.data.length+a)>-1)throw Error("each index in "+i+" must be unique.")}}function F(t,r,i){if(!Array.isArray(t.data))throw Error("gd.data must be an array.");if(typeof r>"u")throw Error("currentIndices is a required argument.");if(Array.isArray(r)||(r=[r]),z(t,r,"currentIndices"),"u">typeof i&&!Array.isArray(i)&&(i=[i]),"u">typeof i&&z(t,i,"newIndices"),"u">typeof i&&r.length!==i.length)throw Error("current and new indices must be of equal length.")}function O(t,r,n,s,l){var u=a.isPlainObject(s);if(!Array.isArray(t.data))throw Error("gd.data must be an array");if(!a.isPlainObject(r))throw Error("update must be a key:value object");if(typeof n>"u")throw Error("indices must be an integer or array of integers");for(var c in z(t,n,"indices"),r){if(!Array.isArray(r[c])||r[c].length!==n.length)throw Error("attribute "+c+" must be an array of length equal to indices array length");if(u&&(!(c in s)||!Array.isArray(s[c])||s[c].length!==r[c].length))throw Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}for(var h=function(t,r,n,s){var l,u,c,h,d=a.isPlainObject(s),f=[];for(var p in Array.isArray(n)||(n=[n]),n=P(n,t.data.length-1),r)for(var m=0;m0&&"string"!=typeof z.parts[R];)R--;var B=z.parts[R],V=z.parts[R-1]+"."+B,U=z.parts.slice(0,R).join("."),q=o(t.layout,U).get(),G=o(h,U).get(),H=z.get();if(void 0!==F){S[P]=F,E[P]="reverse"===B?F:j(H);var Z=c.getLayoutValObject(h,z.parts);if(Z&&Z.impliedEdits&&null!==F)for(var K in Z.impliedEdits)D(a.relativeAttr(P,K),Z.impliedEdits[K]);if(-1!==["width","height"].indexOf(P))if(F){D("autosize",null);var J="height"===P?"width":"height";D(J,h[J])}else h[P]=t._initialAutoSize[P];else if("autosize"===P)D("width",F?null:h.width),D("height",F?null:h.height);else if(V.match($))L(V),o(h,U+"._inputRange").set(null);else if(V.match(W)){L(V),o(h,U+"._inputRange").set(null);var Q=o(h,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else V.match(Y)&&o(h,U+"._inputDomain").set(null);if("type"===B){C=q;var ee="linear"===G.type&&"log"===F,et="log"===G.type&&"linear"===F;if(ee||et){if(C&&C.range)if(G.autorange)ee&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var er=C.range[0],ei=C.range[1];ee?(er<=0&&ei<=0&&D(U+".autorange",!0),er<=0?er=ei/1e6:ei<=0&&(ei=er/1e6),D(U+".range[0]",Math.log(er)/Math.LN10),D(U+".range[1]",Math.log(ei)/Math.LN10)):(D(U+".range[0]",Math.pow(10,er)),D(U+".range[1]",Math.pow(10,ei)))}else D(U+".autorange",!0);Array.isArray(h._subplots.polar)&&h._subplots.polar.length&&h[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete h[z.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,G,F,D),u.getComponentMethod("images","convertCoords")(t,G,F,D)}else D(U+".autorange",!0),D(U+".range",null);o(h,U+"._inputRange").set(null)}else if(B.match(M)){var en=o(h,P).get(),ea=(F||{}).type;ea&&"-"!==ea||(ea="linear"),u.getComponentMethod("annotations","convertCoords")(t,en,ea,D),u.getComponentMethod("images","convertCoords")(t,en,ea,D)}var eo=_.containerArrayMatch(P);if(eo){i=eo.array,n=eo.index;var es=eo.property,el=Z||{editType:"calc"};""!==n&&""===es&&(_.isAddVal(F)?E[P]=null:_.isRemoveVal(F)?E[P]=(o(l,i).get()||[])[n]:a.warn("unrecognized full object value",r)),A.update(k,el),v[i]||(v[i]={});var eu=v[i][n];eu||(eu=v[i][n]={}),eu[es]=F,delete r[P]}else"reverse"===B?(q.range?q.range.reverse():(D(U+".autorange",!0),q.range=[1,0]),G.autorange?k.calc=!0:k.plot=!0):("dragmode"===P&&(!1===F&&!1!==H||!1!==F&&!1===H)||h._has("scatter-like")&&h._has("regl")&&"dragmode"===P&&("lasso"===F||"select"===F)&&"lasso"!==H&&"select"!==H?k.plot=!0:Z?A.update(k,Z):k.calc=!0,z.set(F))}}for(i in v)_.applyContainerArrayChanges(t,p(l,i),v[i],k,p)||(k.plot=!0);for(var ec in I){var eh=(C=d.getFromId(t,ec))&&C._constraintGroup;if(eh)for(var ed in k.calc=!0,eh)I[ed]||(d.getFromId(t,ed)._constraintShrinkable=!0)}(X(t)||r.height||r.width)&&(k.plot=!0);var ef=h.shapes;for(n=0;n1;)if(n.pop(),void 0!==(i=o(r,n.join(".")+".uirevision").get()))return i;return r.uirevision}function ea(t,r){var i=a.isPlainObject(t),n=Array.isArray(t);return i||n?(i&&a.isPlainObject(r)||n&&Array.isArray(r))&&JSON.stringify(t)===JSON.stringify(r):t===r}function eo(t,r,i,n){var o,s,l,u=n.getValObject,c=n.flags,h=n.immutable,d=n.inArray,f=n.arrayIndex;function p(){var t=o.editType;d&&-1!==t.indexOf("arraydraw")?a.pushUnique(c.arrays[d],f):(A.update(c,o),"none"!==t&&c.nChanges++,n.transition&&o.anim&&c.nChangesAnim++,($.test(l)||W.test(l))&&(c.rangesAltered[i[0]]=1),"datarevision"===s&&(c.newDataRevision=1))}function m(t){return"data_array"===t.valType||t.arrayOk}for(s in t){if(c.calc&&!n.transition)return;var g=t[s],y=r[s],v=i.concat(s);if(l=v.join("."),"_"!==s.charAt(0)&&"function"!=typeof g&&g!==y){if(("tick0"===s||"dtick"===s)&&"geo"!==i[0]){var x=r.tickmode;if("auto"===x||"array"===x||!x)continue}if(!("range"===s&&r.autorange)&&("zmin"!==s&&"zmax"!==s||"contourcarpet"!==r.type)&&(o=u(v))&&!(o._compareAsJSON&&JSON.stringify(g)===JSON.stringify(y))){var b,_=o.valType,w=m(o),T=Array.isArray(g),M=Array.isArray(y);if(T&&M){var k="_input_"+s,S=t[k],E=r[k];if(Array.isArray(S)&&S===E)continue}if(void 0===y)w&&T?c.calc=!0:p();else if(o._isLinkedToArray){var D=[],C=!1;d||(c.arrays[s]=D);var I=Math.min(g.length,y.length),L=Math.max(g.length,y.length);if(I!==L)if("arraydraw"===o.editType)C=!0;else{p();continue}for(b=0;b=o.length?t.transitionOpts=o[c]:t.transitionOpts=o[0]:t.transitionOpts=o,c++,t}var f,p,m=[],g=null==r,y=Array.isArray(r);if(!g&&!y&&a.isPlainObject(r))m.push({type:"object",data:d(a.extendFlat({},r))});else if(g||-1!==["string","number"].indexOf(typeof r))for(f=0;f0&&bb)&&_.push(p);m=_}}m.length>0?function(r){if(0!==r.length){for(var a,c=0;c=s.length?s[0]:s[d]:s),g=(f=c,Array.isArray(o)?f>=o.length?o[0]:o[f]:o);g.duration=Math.min(g.duration,m.duration);var y={frame:p,name:r[c].name,frameOpts:m,transitionOpts:g};c===r.length-1&&(y.onComplete=function(t){var r=0;return function(){if(t&&2==++r)return t()}}(l),y.onInterrupt=u),n._frameQueue.push(y)}"immediate"===i.mode&&(n._lastFrameAt=-1/0),n._animationRaf||(t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null,(a=function(){n._animationRaf=window.requestAnimationFrame(a),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var r=n._currentFrame=n._frameQueue.shift();if(r){var i=r.name?r.name.toString():null;t._fullLayout._currentFrame=i,n._lastFrameAt=Date.now(),n._timeToNext=r.frameOpts.duration,h.transition(t,r.frame.data,r.frame.layout,w.coerceTraceIndices(t,r.frame.traces),r.frameOpts,r.transitionOpts).then(function(){r.onComplete&&r.onComplete()}),t.emit("plotly_animatingframe",{name:i,frame:r.frame,animation:{frame:r.frameOpts,transition:r.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()})())}}(m):(t.emit("plotly_animated"),l())})},t.addFrames=function(t,r,i){if(t=a.getGraphDiv(t),null==r)return Promise.resolve();if(!a.isPlotDiv(t))throw Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,o,s,u,c=t._transitionData._frames,d=t._transitionData._frameHash;if(!Array.isArray(r))throw Error("addFrames failure: frameList must be an Array of frame definitions"+r);var f=c.length+2*r.length,p=[],m={};for(n=r.length-1;n>=0;n--)if(a.isPlainObject(r[n])){var g=r[n].name,y=(d[g]||m[g]||{}).name,v=r[n].name,x=d[y]||m[y];y&&v&&"number"==typeof v&&x&&S<5&&(S++,a.warn('addFrames: overwriting frame "'+(d[y]||m[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&a.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),m[g]={name:g},p.push({frame:h.supplyFrameDefaults(r[n]),index:i&&void 0!==i[n]&&null!==i[n]?i[n]:f+n})}p.sort(function(t,r){return t.index>r.index?-1:+(t.index=0;n--){if("number"==typeof(o=p[n].frame).name&&a.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!o.name)for(;d[o.name="frame "+t._transitionData._counter++];);if(d[o.name]){for(s=0;s=0;i--)n=r[i],s.push({type:"delete",index:n}),u.unshift({type:"insert",index:n,value:o[n]});var c=h.modifyFrames,d=h.modifyFrames,f=[t,u],p=[t,s];return l&&l.add(t,c,f,d,p),h.modifyFrames(t,s)},t.addTraces=function r(i,n,o){i=a.getGraphDiv(i);var s,u,c=[],h=t.deleteTraces,d=[i,c],f=[i,n];for(function(t,r,i){var n,a;if(!Array.isArray(t.data))throw Error("gd.data must be an array.");if(typeof r>"u")throw Error("traces must be defined.");for(Array.isArray(r)||(r=[r]),n=0;ntypeof i&&!Array.isArray(i)&&(i=[i]),"u">typeof i&&i.length!==r.length)throw Error("if indices is specified, traces.length must equal indices.length")}(i,n,o),Array.isArray(n)||(n=[n]),n=n.map(function(t){return a.extendFlat({},t)}),w.cleanData(n),s=0;s"u")return u=t.redraw(i),l.add(i,h,d,r,f),u;Array.isArray(o)||(o=[o]);try{F(i,c,o)}catch(t){throw i.data.splice(i.data.length-n.length,n.length),t}return l.startSequence(i),l.add(i,h,d,r,f),u=t.moveTraces(i,c,o),l.stopSequence(i),u},t.deleteTraces=function r(i,n){i=a.getGraphDiv(i);var o,s,u=[],c=t.addTraces,h=[i,u,n],d=[i,n];if(typeof n>"u")throw Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),z(i,n,"indices"),(n=P(n,i.data.length-1)).sort(a.sorterDes),o=0;o=0&&i"u")for(o=[],s=0;s=0&&i[t,r._ev.listeners(t)]);d=t.newPlot(r,i,n,s).then(()=>{for(let[t,i]of a)i.forEach(i=>r.on(t,i));return t.react(r,i,n,s)})}else{r.data=i||[],w.cleanData(r.data),r.layout=n||{},w.cleanLayout(r.layout),function(t,r,i,n){var s,l,u,c,h,d,f,p,m,g,y=n._preGUI,v=[],x={},b={};for(s in y){if(h=er(s,ee)){if(m=h.head,g=h.tail,(c=(u=o(n,l=h.attr||m+".uirevision").get())&&en(l,r))&&c===u){if(null===(d=y[s])&&(d=void 0),ea(p=(f=o(r,s)).get(),d)){void 0===p&&"autorange"===g&&v.push(m),f.set(j(o(n,s).get()));continue}else if("autorange"===g||"range["===g.slice(0,6)){var _=y[m+".range[0]"],w=y[m+".range[1]"],T=y[m+".autorange"];if(T||null===T&&null===_&&null===w){if(!(m in x)){var A=o(r,m).get();x[m]=A&&(A.autorange||!1!==A.autorange&&(!A.range||2!==A.range.length))}if(x[m]){f.set(j(o(n,s).get()));continue}}}}}else a.warn("unrecognized GUI edit: "+s);delete y[s],h&&"range["===h.tail.slice(0,6)&&(b[h.head]=1)}for(var M=0;M(g||r.emit("plotly_react",{config:s,data:i,layout:n}),r))},t.redraw=function(r){if(r=a.getGraphDiv(r),!a.isPlotDiv(r))throw Error("This element is not a Plotly plot: "+r);return w.cleanData(r.data),w.cleanLayout(r.layout),r.calcdata=void 0,t._doPlot(r).then(function(){return r.emit("plotly_redraw"),r})},t.relayout=q,t.restyle=B,t.setPlotConfig=function(t){return a.extendFlat(b,t)},t.update=K,t._guiRelayout=J(q),t._guiRestyle=J(B),t._guiUpdate=J(K),t._storeDirectGUIEdit=function(t,r,i){for(var n in i){var a=o(t,n);V(n,a.get(),i[n],r)}}}}),iz=g({"src/snapshot/helpers.js"(t){var r=e2();t.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("map"))?500:0},t.getRedrawFunc=function(t){return function(){r.getComponentMethod("colorbar","draw")(t)}},t.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)},t.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var i=window.URL||window.webkitURL;t.createObjectURL=function(t){return i.createObjectURL(t)},t.revokeObjectURL=function(t){return i.revokeObjectURL(t)},t.createBlob=function(t,r){if("svg"===r)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if("full-json"===r)return new window.Blob([t],{type:"application/json;charset=utf-8"});var i=function(t){for(var r=t.length,i=new ArrayBuffer(r),n=new Uint8Array(i),a=0;a{let r=t.toLowerCase();return u.includes(r)?t:c.includes(r)?"<":h.includes(r)?">":t.includes("<")||t.includes(">")?"":f.html(t).text()}),f.remove(),S=(S=(S=p).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(l,"'")}}}),iO=g({"src/snapshot/svgtoimg.js"(t,r){var i=t_(),n=tM().EventEmitter,a=iz();r.exports=function(t){var r=t.emitter||new n,o=new Promise(function(n,o){var s,l,u=window.Image,c=t.svg,h=t.format||"png",d=t.canvas,f=t.scale||1,p=t.width||300,m=t.height||150,g=f*p,y=f*m,v=d.getContext("2d",{willReadFrequently:!0}),x=new u;"svg"===h||i.isSafari()?l=a.encodeSVG(c):(s=a.createBlob(c,"svg"),l=a.createObjectURL(s)),d.width=g,d.height=y,x.onload=function(){var i;switch(s=null,a.revokeObjectURL(l),"svg"!==h&&v.drawImage(x,0,0,g,y),h){case"jpeg":i=d.toDataURL("image/jpeg");break;case"png":i=d.toDataURL("image/png");break;case"webp":i=d.toDataURL("image/webp");break;case"svg":i=l;break;default:var u="Image format is not jpeg, png, svg or webp.";if(o(Error(u)),!t.promise)return r.emit("error",u)}n(i),t.promise||r.emit("success",i)},x.onerror=function(i){if(s=null,a.revokeObjectURL(l),o(i),!t.promise)return r.emit("error",i)},x.src=l});return t.promise?o:r}}}),iR=g({"src/plot_api/to_image.js"(t,r){var i=L(),n=iP(),a=tR(),o=t_(),s=iz(),l=iF(),u=iO(),c=A().version,h={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};r.exports=function(t,r){function d(t){return!(t in r)||o.validate(r[t],h[t])}if(r=r||{},o.isPlainObject(t)?(f=t.data||[],p=t.layout||{},m=t.config||{},g={}):(t=o.getGraphDiv(t),f=o.extendDeep([],t.data),p=o.extendDeep({},t.layout),m=t._context,g=t._fullLayout||{}),!d("width")&&null!==r.width||!d("height")&&null!==r.height)throw Error("Height and width should be pixel values.");if(!d("format"))throw Error("Export format is not "+o.join2(h.format.values,", "," or ")+".");var f,p,m,g,y={};function v(t,i){return o.coerce(r,y,h,t,i)}var x=v("format"),b=v("width"),_=v("height"),w=v("scale"),T=v("setBackground"),A=v("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},p);b?k.width=b:null===r.width&&i(g.width)&&(k.width=g.width),_?k.height=_:null===r.height&&i(g.height)&&(k.height=g.height);var S=o.extendFlat({},m,{_exportedPlot:!0,staticPlot:!0,setBackground:T}),E=s.getRedrawFunc(M);function D(){return new Promise(function(t){setTimeout(t,s.getDelay(M._fullLayout))})}function C(){return new Promise(function(t,r){var i=l(M,x,w),h=M._fullLayout.width,d=M._fullLayout.height;function f(){n.purge(M),document.body.removeChild(M)}if("full-json"===x){var p=a.graphJson(M,!1,"object",!0,!0);return p.version=c,p=JSON.stringify(p),f(),t(A?p:s.encodeJSON(p))}if(f(),"svg"===x)return t(A?i:s.encodeSVG(i));var m=document.createElement("canvas");m.id=o.randstr(),u({format:x,width:h,height:d,scale:w,canvas:m,svg:i,promise:!0}).then(t).catch(r)})}return new Promise(function(t,r){n.newPlot(M,f,k,S).then(E).then(D).then(C).then(function(r){t(A?r.replace(s.IMAGE_URL_PREFIX,""):r)}).catch(function(t){r(t)})})}}}),iB=g({"src/plot_api/validate.js"(t,r){var i=t_(),n=tR(),a=tD(),o=Q().dfltConfig,s=i.isPlainObject,l=Array.isArray,u=i.isArrayOrTypedArray;function c(t,r,n,a,o,h){h=h||[];for(var d=Object.keys(t),p=0;px.length&&a.push(f("unused",o,y.concat(x.length)));var M,k,S,E,D,C,I,L=x.length,P=Array.isArray(A);if(P&&(L=Math.min(L,A.length)),2===b.dimensions)for(E=0;Ex[E].length&&a.push(f("unused",o,y.concat(E,x[E].length)));var z=x[E].length;for(S=0;S<(P?Math.min(z,A[E].length):z);S++)D=P?A[E][S]:A,C=v[E][S],I=x[E][S],i.validate(C,D)?I!==C&&I!==+C&&a.push(f("dynamic",o,y.concat(E,S),C,I)):a.push(f("value",o,y.concat(E,S),C))}else a.push(f("array",o,y.concat(E),v[E]));else for(E=0;E1&&p.push(f("object","layout"))),n.supplyDefaults(m);for(var g=m._fullData,y=u.length,v=0;vT?d.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&d.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else d.push({code:"data"});if(function t(r,n){for(var a in r)if("_"!==a.charAt(0)){var o=r[a],s=p(r,a,n);i(o)?(Array.isArray(r)&&!1===o._template&&o.templateitemname&&d.push({code:"missing",path:s,templateitemname:o.templateitemname}),t(o,s)):Array.isArray(o)&&function(t){for(var r=0;r=0;d--){var f=t[d];if("scatter"===f.type&&f.xaxis===c.xaxis&&f.yaxis===c.yaxis){f.opacity=void 0;break}}}}}}}),i0=g({"src/traces/scatter/layout_defaults.js"(t,r){var i=t_(),n=tz();r.exports=function(t,r){var a,o="group"===r.barmode;"group"===r.scattermode&&(a=o?r.bargap:.2,i.coerce(t,r,n,"scattergap",a))}}}),i1=g({"src/plots/cartesian/align_period.js"(t,r){var i=L(),n=t_(),a=n.dateTime2ms,o=n.incrementMonth,s=P().ONEAVGMONTH;r.exports=function(t,r,n,l){if("date"!==r.type)return{vals:l};var u=t[n+"periodalignment"];if(!u)return{vals:l};var c,h=t[n+"period"];if(i(h)){if((h*=1)<=0)return{vals:l}}else if("string"==typeof h&&"M"===h.charAt(0)){var d=+h.substring(1);if(!(d>0)||Math.round(d)!==d)return{vals:l};c=d}for(var f=r.calendar,p="start"===u,m="end"===u,g=t[n+"period0"],y=a(g,f)||0,v=[],x=[],b=[],_=l.length,w=0;w<_;w++){var T,A,M,k=l[w];if(c){for(T=Math.round((k-y)/(c*s)),M=o(y,c*T,f);M>k;)M=o(M,-c,f);for(;M<=k;)M=o(M,c,f);A=o(M,-c,f)}else{for(T=Math.round((k-y)/h),M=y+T*h;M>k;)M-=h;for(;M<=k;)M+=h;A=M-h}v[w]=p?A:m?M:(A+M)/2,x[w]=A,b[w]=M}return{vals:v,starts:x,ends:b}}}}),i2=g({"src/traces/scatter/colorscale_calc.js"(t,r){var i=tV().hasColorscale,n=t4(),a=t8();r.exports=function(t,r){a.hasLines(r)&&i(r,"line")&&n(t,r,{vals:r.line.color,containerStr:"line",cLetter:"c"}),a.hasMarkers(r)&&(i(r,"marker")&&n(t,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),i(r,"marker.line")&&n(t,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),i3=g({"src/traces/scatter/arrays_to_calcdata.js"(t,r){var i=t_();r.exports=function(t,r){for(var n=0;nm&&I[v].gap;)v--;for(b=I[v].s,y=I.length-1;y>v;y--)I[y].s=b;for(;md+c||!i(h))}for(var p=0;pa(t))):a(t.text);let o=t.outsidetextfont.size*h*i+c;return{ppadplus:r.some(t=>t.s<0)?o:0,ppadminus:r.some(t=>t.s>=0)?o:0}}return{ppadplus:void 0,ppadminus:void 0}}function _(t){return t._id.charAt(0)}r.exports={crossTraceCalc:function(t,r){for(var i=r.xaxis,n=r.yaxis,a=t._fullLayout,s=t._fullData,l=t.calcdata,u=[],c=[],h=0;hE[d]&&d0?s:l)/(C._m*P*(C._m>0?s:l)))),o*=1e3}if(u===a){if(L&&(u=C.c2p(n.y,!0)),u===a)return!1;u*=1e3}return[o,u]}function Y(t,r,i,n){var a=i-t,o=n-r,s=.5-t,l=.5-r,u=a*a+o*o,c=a*s+o*l;if(c>0&&ces||t[1]eu)return[h(t[0],eo,es),h(t[1],el,eu)]}function ed(t,r){if(t[0]===r[0]&&(t[0]===eo||t[0]===es)||t[1]===r[1]&&(t[1]===el||t[1]===eu))return!0}function ef(t,r,i){return function(n,a){var o,s=eh(n),l=eh(a),c=[];if(s&&l&&ed(s,l))return c;s&&c.push(s),l&&c.push(l);var h=2*u.constrain((n[t]+a[t])/2,r,i)-((s||n)[t]+(l||a)[t]);return h&&(o=s&&l?h>0==s[t]>l[t]?s:l:s||l,o[t]+=h),c}}function ep(t){var r=t[0],i=t[1],n=r===H[$-1][0],a=i===H[$-1][1];if(!(n&&a))if($>1){var o=r===H[$-2][0],s=i===H[$-2][1];n&&(r===eo||r===es)&&o?s?$--:H[$-1]=t:a&&(i===el||i===eu)&&s?o?$--:H[$-1]=t:H[$++]=t}else H[$++]=t}function em(t){H[$-1][0]!==t[0]&&H[$-1][1]!==t[1]&&ep([et,er]),ep(t),ei=null,et=er=0}"linear"===j||"spline"===j?n=function(t,r){for(var i=[],n=0,a=0;a<4;a++){var o=ec[a],s=c(t[0],t[1],r[0],r[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-i[0][0])>1||Math.abs(s.y-i[0][1])>1)&&(s=[s.x,s.y],n&&X(s,t)es?es:0,ee=r[1]eu?eu:0,Q||ee){if($)if(ei){var i,a,s,l=n(ei,r);l.length>1&&(em(l[0]),H[$++]=l[1])}else en=n(H[$-1],r)[0],H[$++]=en;else H[$++]=[Q||r[0],ee||r[1]];var u=H[$-1];Q&&ee&&(u[0]!==Q||u[1]!==ee)?(ei&&(et!==Q&&er!==ee?ep(et&&er?(i=ei,a=r[0]-i[0],s=(r[1]-i[1])/a,(i[1]*r[0]-r[1]*i[0])/a>0?[s>0?eo:es,eu]:[s>0?es:eo,el]):[et||Q,er||ee]):et&&er&&ep([et,er])),ep([Q,ee])):et-Q&&er-ee&&ep([Q||et,ee||er]),ei=r,et=Q,er=ee}else ei&&em(n(ei,r)[0]),H[$++]=r}for(o=0;oZ(y,ev))break;p=y,(A=b[0]*x[0]+b[1]*x[1])>w?(w=A,m=y,v=!1):A=t.length||!y)break;ey(y),f=y}}ei&&ep([et||ei[0],er||ei[1]]),U.push(H.slice(0,$))}var ex=j.slice(j.length-1);if(F&&"h"!==ex&&"v"!==ex){for(var eb=!1,e_=-1,ew=[],eT=0;eT=0?u=p:(u=p=f,f++),u=c[0]&&t.x<=c[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/f),g=0;o.forEach(function(r,i){var n=r[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&i0;function b(t){return x?t.transition():t}var _=h.xaxis,w=h.yaxis,T=f[0].trace,A=T.line,M=i.select(m),k=o(M,"g","errorbars"),S=o(M,"g","lines"),E=o(M,"g","points"),D=o(M,"g","text");if(n.getComponentMethod("errorbars","plot")(t,k,h,g),!0===T.visible){b(M).style("opacity",T.opacity);var C,I,L=T.fill.charAt(T.fill.length-1);"x"!==L&&"y"!==L&&(L=""),"y"===L?(B=1,j=w.c2p(0,!0)):"x"===L&&(B=0,j=_.c2p(0,!0)),f[0][h.isRangePlot?"nodeRangePlot3":"node3"]=M;var P="",z=[],F=T._prevtrace,O=null,R=null;F&&(P=F._prevRevpath||"",I=F._nextFill,z=F._ownPolygons,O=F._fillsegments,R=F._fillElement);var B,j,N,V,U,q,G,H,$,W="",Y="",Z=[];T._polygons=[];var X=[],K=[],J=a.noop;if(C=T._ownFill,u.hasLines(T)||"none"!==T.fill){I&&I.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(A.shape)?(U=l.steps(A.shape),q=l.steps(A.shape.split("").reverse().join(""))):U=q="spline"===A.shape?function(t){var r=t[t.length-1];return t.length>1&&t[0][0]===r[0]&&t[0][1]===r[1]?l.smoothclosed(t.slice(1),A.smoothing):l.smoothopen(t,A.smoothing)}:function(t){return"M"+t.join("L")},X=Array((K=c(f,{xaxis:_,yaxis:w,trace:T,connectGaps:T.connectgaps,baseTolerance:Math.max(A.width||1,3)/4,shape:A.shape,backoff:A.backoff,simplify:A.simplify,fill:T.fill})).length);var Q=0;for(y=0;y0,b=h(t,r,n);((g=a.selectAll("g.trace").data(b,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),g.order(),d=t,p=g,m=r,p.each(function(t){var r=o(i.select(this),"g","fills");l.setClipUrl(r,m.layerClipId,d);var n=t[0].trace;n._ownFill=null,n._nextFill=null;var a=[];n._ownfill&&a.push("_ownFill"),n._nexttrace&&a.push("_nextFill");var u=r.selectAll("g").data(a,s);u.enter().append("g"),u.exit().remove(),u.order().each(function(t){n[t]=o(i.select(this),"path","js-fill")})}),x)?(c&&(y=c()),i.transition().duration(u.duration).ease(u.easing).each("end",function(){y&&y()}).each("interrupt",function(){y&&y()}).each(function(){a.selectAll("g.trace").each(function(i,n){f(t,n,r,i,b,this,u)})})):g.each(function(i,n){f(t,n,r,i,b,this,u)}),v&&g.exit().remove(),a.selectAll("path:not([d])").remove()}}}),ni=g({"src/traces/scatter/marker_colorbar.js"(t,r){r.exports={container:"marker",min:"cmin",max:"cmax"}}}),nn=g({"src/traces/scatter/format_labels.js"(t,r){var i=rs();r.exports=function(t,r,n){var a={},o={_fullLayout:n},s=i.getFromTrace(o,r,"x"),l=i.getFromTrace(o,r,"y"),u=t.orig_x;void 0===u&&(u=t.x);var c=t.orig_y;return void 0===c&&(c=t.y),a.xLabel=i.tickText(s,s.c2l(u),!0).text,a.yLabel=i.tickText(l,l.c2l(c),!0).text,a}}}),na=g({"src/traces/scatter/style.js"(t,r){var i=k(),n=rr(),a=e2();function o(t,r,i){n.pointStyle(t.selectAll("path.point"),r,i)}function s(t,r,i){n.textPointStyle(t.selectAll("text"),r,i)}r.exports={style:function(t){var r=i.select(t).selectAll("g.trace.scatter");r.style("opacity",function(t){return t[0].trace.opacity}),r.selectAll("g.points").each(function(r){o(i.select(this),r.trace||r[0].trace,t)}),r.selectAll("g.text").each(function(r){s(i.select(this),r.trace||r[0].trace,t)}),r.selectAll("g.trace path.js-line").call(n.lineGroupStyle),r.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,t,!1),a.getComponentMethod("errorbars","style")(r)},stylePoints:o,styleText:s,styleOnSelect:function(t,r,i){var a=r[0].trace;a.selectedpoints?(n.selectedPointStyle(i.selectAll("path.point"),a),n.selectedTextStyle(i.selectAll("text"),a)):(o(i,a,t),s(i,a,t))}}}}),no=g({"src/traces/scatter/get_trace_color.js"(t,r){var i=ei(),n=t8();r.exports=function(t,r){if("lines"===t.mode)return(a=t.line.color)&&i.opacity(a)?a:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var a,o,s=r.mcc||r.mc||(t.marker||{}).color,l=r.mlcc||((t.marker||{}).line||{}).color;return(o=s&&i.opacity(s)?s:l&&i.opacity(l)&&(r.mlw||((t.marker||{}).line||{}).width)?l:"")?.3>i.opacity(o)?i.addOpacity(o,.3):o:(a=(t.line||{}).color)&&i.opacity(a)&&n.hasLines(t)&&t.line.width?a:t.fillcolor}}}),ns=g({"src/traces/scatter/hover.js"(t,r){var i=t_(),n=rR(),a=e2(),o=no(),s=ei(),l=i.fillText;r.exports=function(t,r,u,c){var h=t.cd,d=h[0].trace,f=t.xa,p=t.ya,m=f.c2p(r),g=p.c2p(u),y=[m,g],v=d.hoveron||"",x=-1!==d.mode.indexOf("markers")?3:.5,b=!!d.xperiodalignment,_=!!d.yperiodalignment;if(-1!==v.indexOf("points")){var w=function(t){var r=Math.max(x,t.mrc||0),i=f.c2p(t.x)-m,n=p.c2p(t.y)-g;return Math.max(Math.sqrt(i*i+n*n)-r,1-x/r)},T=n.getDistanceFunction(c,function(t){if(b){var r=f.c2p(t.xStart),i=f.c2p(t.xEnd);return m>=Math.min(r,i)&&m<=Math.max(r,i)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,o=Math.abs(f.c2p(t.x)-m);return o=Math.min(r,i)&&g<=Math.max(r,i)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,o=Math.abs(p.c2p(t.y)-g);return oc!=(l=i[r][1])>=c&&(a=i[r-1][0],o=i[r][0],l-s&&(d=Math.min(d,n=a+(o-a)*(c-s)/(l-s)),m=Math.max(m,n)));return{x0:d=Math.max(d,0),x1:m=Math.min(m,f._length),y0:c,y1:c}}(d._polygons);null===P&&(P={x0:y[0],x1:y[0],y0:y[1],y1:y[1]});var z=s.defaultLine;return s.opacity(d.fillcolor)?z=d.fillcolor:s.opacity((d.line||{}).color)&&(z=d.line.color),i.extendFlat(t,{distance:t.maxHoverDistance,x0:P.x0,x1:P.x1,y0:P.y0,y1:P.y1,color:z,hovertemplate:!1}),delete t.index,d.text&&!i.isArrayOrTypedArray(d.text)?t.text=String(d.text):t.text=d.name,[t]}}}}),nl=g({"src/traces/scatter/select.js"(t,r){var i=t8();r.exports=function(t,r){var n,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[],d=l[0].trace;if(d.mode&&!i.hasMarkers(d)&&!i.hasText(d))return[];if(!1===r)for(n=0;n0&&(a["_"+i+"axes"]||{})[r]||(a[i+"axis"]||i)===r&&(o(a,i)||(a[i]||[]).length||a[i+"0"]))return a}}(r,l,u);if(c){if("histogram"===c.type&&u===({v:"y",h:"x"})[c.orientation||"v"]){t.type="linear";return}var h=u+"calendar",d=c[h],f={noMultiCategory:!i(c,"cartesian")||i(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&u===({h:"x",v:"y"})[c.orientation||"v"]&&(f.noMultiCategory=!0),f.autotypenumbers=t.autotypenumbers,o(c,u)){var p=a(c),m=[];for(s=0;s0||i(s);l&&(o="array");var u,c=n("categoryorder",o);"array"===c&&(u=n("categoryarray")),l||"array"!==c||(c=r.categoryorder="trace"),"trace"===c?r._initialCategories=[]:"array"===c?r._initialCategories=u.slice():(u=(function(t,r){var i,n,a,o=r.dataAttr||t._id.charAt(0),s={};if(r.axData)i=r.axData;else for(i=[],n=0;n=2){var u,c,h="";if(2===s.length){for(u=0;u<2;u++)if(c=_(s[u])){h=y;break}}var d=o("pattern",h);if(d===y)for(u=0;u<2;u++)(c=_(s[u]))&&(r.bounds[u]=s[u]=c-1);if(d)for(u=0;u<2;u++)switch(c=s[u],d){case y:if(!i(c)||(c*=1)!==Math.floor(c)||c<0||c>=7){r.enabled=!1;return}r.bounds[u]=s[u]=c;break;case v:if(!i(c)||(c*=1)<0||c>24){r.enabled=!1;return}r.bounds[u]=s[u]=c}if(!1===n.autorange){var f=n.range;if(f[0]f[1]){r.enabled=!1;return}}else if(s[0]>f[0]&&s[1]_[1]-1/4096&&(r.domain=l),n.noneOrAll(t.domain,r.domain,l),"sync"===r.tickmode&&(r.tickmode="auto")}return a("layer"),r}}}),nm=g({"src/plots/cartesian/layout_defaults.js"(t,r){var i=t_(),n=ei(),a=t9().isUnifiedHover,o=rP(),s=tC(),l=e0(),u=tq(),c=nc(),h=nf(),d=ie(),f=np(),p=tL(),m=p.id2name,g=p.name2id,y=tI().AX_ID_PATTERN,v=e2(),x=v.traceIs,b=v.getComponentMethod;function _(t,r,i){Array.isArray(t[r])?t[r].push(i):t[r]=[i]}r.exports=function(t,r,v){var w,T,A=r.autotypenumbers,M={},k={},S={},E={},D={},C={},I={},L={},P={},z={};for(w=0;w rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,r._offset,i._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}u&&(d=u());var d,f,p,m,g=i.ease(l.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(m),m=null,function(){for(var i={},a=0;al.duration?(function(){for(var i={},a=0;a1,g=r.mainplotinfo;if(!r.mainplot||m)if(p)r.xlines=h(n,"path","xlines-above"),r.ylines=h(n,"path","ylines-above"),r.xaxislayer=h(n,"g","xaxislayer-above"),r.yaxislayer=h(n,"g","yaxislayer-above");else{if(!o){var y=h(n,"g","layer-subplot");r.shapelayer=h(y,"g","shapelayer"),r.imagelayer=h(y,"g","imagelayer"),g&&m?(r.minorGridlayer=g.minorGridlayer,r.gridlayer=g.gridlayer,r.zerolinelayer=g.zerolinelayer):(r.minorGridlayer=h(n,"g","minor-gridlayer"),r.gridlayer=h(n,"g","gridlayer"),r.zerolinelayer=h(n,"g","zerolinelayer"));var v=h(n,"g","layer-between");r.shapelayerBetween=h(v,"g","shapelayer"),r.imagelayerBetween=h(v,"g","imagelayer"),h(n,"path","xlines-below"),h(n,"path","ylines-below"),r.overlinesBelow=h(n,"g","overlines-below"),h(n,"g","xaxislayer-below"),h(n,"g","yaxislayer-below"),r.overaxesBelow=h(n,"g","overaxes-below")}r.overplot=h(n,"g","overplot"),r.plot=h(r.overplot,"g",a),g&&m?r.zerolinelayerAbove=g.zerolinelayerAbove:r.zerolinelayerAbove=h(n,"g","zerolinelayer-above"),o||(r.xlines=h(n,"path","xlines-above"),r.ylines=h(n,"path","ylines-above"),r.overlinesAbove=h(n,"g","overlines-above"),h(n,"g","xaxislayer-above"),h(n,"g","yaxislayer-above"),r.overaxesAbove=h(n,"g","overaxes-above"),r.xlines=n.select(".xlines-"+s),r.ylines=n.select(".ylines-"+c),r.xaxislayer=n.select(".xaxislayer-"+s),r.yaxislayer=n.select(".yaxislayer-"+c))}else{var x=g.plotgroup,b=a+"-x",_=a+"-y";r.minorGridlayer=g.minorGridlayer,r.gridlayer=g.gridlayer,r.zerolinelayer=g.zerolinelayer,r.zerolinelayerAbove=g.zerolinelayerAbove,h(g.overlinesBelow,"path",b),h(g.overlinesBelow,"path",_),h(g.overaxesBelow,"g",b),h(g.overaxesBelow,"g",_),r.plot=h(g.overplot,"g",a),h(g.overlinesAbove,"path",b),h(g.overlinesAbove,"path",_),h(g.overaxesAbove,"g",b),h(g.overaxesAbove,"g",_),r.xlines=x.select(".overlines-"+s).select("."+b),r.ylines=x.select(".overlines-"+c).select("."+_),r.xaxislayer=x.select(".overaxes-"+s).select("."+b),r.yaxislayer=x.select(".overaxes-"+c).select("."+_)}o||(p||(d(r.minorGridlayer,"g",r.xaxis._id),d(r.minorGridlayer,"g",r.yaxis._id),r.minorGridlayer.selectAll("g").map(function(t){return t[0]}).sort(l.idSort),d(r.gridlayer,"g",r.xaxis._id),d(r.gridlayer,"g",r.yaxis._id),r.gridlayer.selectAll("g").map(function(t){return t[0]}).sort(l.idSort)),r.xlines.style("fill","none").classed("crisp",!0),r.ylines.style("fill","none").classed("crisp",!0))}function g(t,i){if(t){var n={};for(var a in t.each(function(t){var a=t[0];r.select(this).remove(),y(a,i),n[a]=!0}),i._plots)for(var o=i._plots[a],s=o.overlays||[],l=0;l0){var y=g.id;if(-1!==y.indexOf(f))continue;y+=f+(h+1),g=n.extendFlat({},g,{id:y,plot:s._cartesianlayer.selectAll(".subplot").select("."+y)})}for(var v,x=[],b=0;b1&&(T+=f+w),_.push(n+T),i=0;i=0,b=r.indexOf("end")>=0,_=m.backoff*y+o.standoff,w=g.backoff*v+o.startstandoff;if("line"===p.nodeName){c={x:+t.attr("x1"),y:+t.attr("y1")},h={x:+t.attr("x2"),y:+t.attr("y2")};var T=c.x-h.x,A=c.y-h.y;if(f=(d=Math.atan2(A,T))+Math.PI,_&&w&&_+w>Math.sqrt(T*T+A*A))return void O();if(_){if(_*_>T*T+A*A)return void O();var M=_*Math.cos(d),k=_*Math.sin(d);h.x+=M,h.y+=k,t.attr({x2:h.x,y2:h.y})}if(w){if(w*w>T*T+A*A)return void O();var S=w*Math.cos(d),E=w*Math.sin(d);c.x-=S,c.y-=E,t.attr({x1:c.x,y1:c.y})}}else if("path"===p.nodeName){var D=p.getTotalLength(),C="";if(D<_+w)return void O();var I=p.getPointAtLength(0),L=p.getPointAtLength(.1);d=Math.atan2(I.y-L.y,I.x-L.x),c=p.getPointAtLength(Math.min(w,D)),C="0px,"+w+"px,";var P=p.getPointAtLength(D),z=p.getPointAtLength(D-.1);f=Math.atan2(P.y-z.y,P.x-z.x),h=p.getPointAtLength(Math.max(0,D-_));var F=C?w+_:_;C+=D-F+"px,"+D+"px",t.style("stroke-dasharray",C)}function O(){t.style("stroke-dasharray","0px,100px")}function R(r,a,c,h){r.path&&(r.noRotate&&(c=0),i.select(p.parentNode).append("path").attr({class:t.attr("class"),d:r.path,transform:u(a.x,a.y)+l(180*c/Math.PI)+s(h)}).style({fill:n.rgb(o.arrowcolor),"stroke-width":0}))}x&&R(g,c,d,v),b&&R(m,h,f,y)}}}),nb=g({"src/components/annotations/draw.js"(t,r){var i=k(),n=e2(),a=tR(),o=t_(),s=o.strTranslate,l=rs(),u=ei(),c=rr(),h=rR(),d=tN(),f=rg(),p=rm(),m=tC().arrayEditor,g=nx();function y(t,r){var i=t._fullLayout.annotations[r]||{},n=l.getFromId(t,i.xref),a=l.getFromId(t,i.yref);n&&n.setScale(),a&&a.setScale(),x(t,i,r,!1,n,a)}function v(t,r,i,n,a){var o=a[i],s=a[i+"ref"],u=-1!==i.indexOf("y"),c="domain"===l.getRefType(s),h=u?n.h:n.w;return t?c?o+(u?-r:r)/t._length:t.p2r(t.r2p(o)+r):o+(u?-r:r)/h}function x(t,r,a,y,x,b){var _,w,T=t._fullLayout,A=t._fullLayout._size,M=t._context.edits;y?(_="annotation-"+y,w=y+".annotations"):(_="annotation",w="annotations");var k=m(t.layout,w,r),S=k.modifyBase,E=k.modifyItem,D=k.getUpdateObj;T._infolayer.selectAll("."+_+'[data-index="'+a+'"]').remove();var C="clip"+T._uid+"_ann"+a;if(!r._input||!1===r.visible)return void i.selectAll("#"+C).remove();var I={x:{},y:{}},L=+r.textangle||0,P=T._infolayer.append("g").classed(_,!0).attr("data-index",String(a)).style("opacity",r.opacity),z=P.append("g").classed("annotation-text-g",!0),F=M[r.showarrow?"annotationTail":"annotationPosition"],O=r.captureevents||M.annotationText||F;function R(t){var i={index:a,annotation:r._input,fullAnnotation:r,event:t};return y&&(i.subplotId=y),i}var B=z.append("g").style("pointer-events",O?"all":null).call(f,"pointer").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",R(i.event))});r.hovertext&&B.on("mouseover",function(){var i=r.hoverlabel,n=i.font,a=this.getBoundingClientRect(),o=t.getBoundingClientRect();h.loneHover({x0:a.left-o.left,x1:a.right-o.left,y:(a.top+a.bottom)/2-o.top,text:r.hovertext,color:i.bgcolor,borderColor:i.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:T._hoverlayer.node(),outerContainer:T._paper.node(),gd:t})}).on("mouseout",function(){h.loneUnhover(T._hoverlayer.node())});var j=r.borderwidth,N=j+r.borderpad,V=B.append("rect").attr("class","bg").style("stroke-width",j+"px").call(u.stroke,r.bordercolor).call(u.fill,r.bgcolor),U=r.width||r.height,q=T._topclips.selectAll("#"+C).data(U?[0]:[]);q.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),q.exit().remove();var G=r.font,H=T._meta?o.templateString(r.text,T._meta):r.text,$=B.append("text").classed("annotation-text",!0).text(H);function W(i){return i.call(c.font,G).attr({"text-anchor":{left:"start",right:"end"}[r.align]||"middle"}),d.convertToTspans(i,t,Y),i}function Y(){var i,a=$.selectAll("a");1===a.size()&&a.text()===$.text()&&B.insert("a",":first-child").attr({"xlink:xlink:href":a.attr("xlink:href"),"xlink:xlink:show":a.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(V.node());var h=B.select(".annotation-text-math-group"),m=!h.empty(),_=c.bBox((m?h:$).node()),w=_.width,k=_.height,O=r.width||w,G=r.height||k,H=Math.round(O+2*N),W=Math.round(G+2*N);function Y(t,r){return"auto"===r&&(r=t<1/3?"left":t>2/3?"right":"center"),({center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5})[r]}for(var Z=!1,X=["x","y"],K=0;K1)&&(ea===en?((em=eo.r2fraction(r["a"+ei]))<0||em>1)&&(Z=!0):Z=!0),J=eo._offset+eo.r2p(r[ei]),et=.5}else{var eg="domain"===ep;"x"===ei?(ee=r[ei],J=eg?eo._offset+eo._length*ee:J=A.l+A.w*ee):(ee=1-r[ei],J=eg?eo._offset+eo._length*ee:J=A.t+A.h*ee),et=r.showarrow?.5:ee}if(r.showarrow){ef.head=J;var ey=r["a"+ei];if(er=el*Y(.5,r.xanchor)-eu*Y(.5,r.yanchor),ea===en){var ev=l.getRefType(ea);"domain"===ev?("y"===ei&&(ey=1-ey),ef.tail=eo._offset+eo._length*ey):"paper"===ev?"y"===ei?(ey=1-ey,ef.tail=A.t+A.h*ey):ef.tail=A.l+A.w*ey:ef.tail=eo._offset+eo.r2p(ey),Q=er}else ef.tail=J+ey,Q=er+ey;ef.text=ef.tail+er;var ex=T["x"===ei?"width":"height"];if("paper"===en&&(ef.head=o.constrain(ef.head,1,ex-1)),"pixel"===ea){var eb=-Math.max(ef.tail-3,ef.text),e_=Math.min(ef.tail+3,ef.text)-ex;eb>0?(ef.tail+=eb,ef.text+=eb):e_>0&&(ef.tail-=e_,ef.text-=e_)}ef.tail+=ed,ef.head+=ed}else Q=er=ec*Y(et,eh),ef.text=J+er;ef.text+=ed,er+=ed,Q+=ed,r["_"+ei+"padplus"]=ec/2+Q,r["_"+ei+"padminus"]=ec/2-Q,r["_"+ei+"size"]=ec,r["_"+ei+"shift"]=er}if(Z)return void B.remove();var ew=0,eT=0;if("left"!==r.align&&(ew=(O-w)*("center"===r.align?.5:1)),"top"!==r.valign&&(eT=(G-k)*("middle"===r.valign?.5:1)),m)h.select("svg").attr({x:N+ew-1,y:N+eT}).call(c.setClipUrl,U?C:null,t);else{var eA=N+eT-_.top,eM=N+ew-_.left;$.call(d.positionText,eM,eA).call(c.setClipUrl,U?C:null,t)}q.select("rect").call(c.setRect,N,N,O,G),V.call(c.setRect,j/2,j/2,H-j,W-j),B.call(c.setTranslate,Math.round(I.x.text-H/2),Math.round(I.y.text-W/2)),z.attr({transform:"rotate("+L+","+I.x.text+","+I.y.text+")"});var ek=function(i,a){P.selectAll(".annotation-arrow-g").remove();var l=I.x.head,h=I.y.head,d=I.x.tail+i,f=I.y.tail+a,m=I.x.text+i,_=I.y.text+a,w=o.rotationXYMatrix(L,m,_),T=o.apply2DTransform(w),k=o.apply2DTransform2(w),C=+V.attr("width"),F=+V.attr("height"),O=m-.5*C,R=O+C,j=_-.5*F,N=j+F,U=[[O,j,O,N],[O,N,R,N],[R,N,R,j],[R,j,O,j]].map(k);if(!U.reduce(function(t,r){return!!o.segmentsIntersect(l,h,l+1e6,h+1e6,r[0],r[1],r[2],r[3])^t},!1)){U.forEach(function(t){var r=o.segmentsIntersect(d,f,l,h,t[0],t[1],t[2],t[3]);r&&(d=r.x,f=r.y)});var q=r.arrowwidth,G=r.arrowcolor,H=r.arrowside,$=P.append("g").style({opacity:u.opacity(G)}).classed("annotation-arrow-g",!0),W=$.append("path").attr("d","M"+d+","+f+"L"+l+","+h).style("stroke-width",q+"px").call(u.stroke,u.rgb(G));if(g(W,H,r),M.annotationPosition&&W.node().parentNode&&!y){var Y=l,Z=h;if(r.standoff){var X=Math.sqrt(Math.pow(l-d,2)+Math.pow(h-f,2));Y+=r.standoff*(d-l)/X,Z+=r.standoff*(f-h)/X}var K,J,Q=$.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Y)+","+(f-Z),transform:s(Y,Z)}).style("stroke-width",q+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(B);K=t.x,J=t.y,x&&x.autorange&&S(x._name+".autorange",!0),b&&b.autorange&&S(b._name+".autorange",!0)},moveFn:function(t,i){var n=T(K,J),a=n[0]+t,o=n[1]+i;B.call(c.setTranslate,a,o),E("x",v(x,t,"x",A,r)),E("y",v(b,i,"y",A,r)),r.axref===r.xref&&E("ax",v(x,t,"ax",A,r)),r.ayref===r.yref&&E("ay",v(b,i,"ay",A,r)),$.attr("transform",s(t,i)),z.attr({transform:"rotate("+L+","+a+","+o+")"})},doneFn:function(){n.call("_guiRelayout",t,D());var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}})}}};r.showarrow&&ek(0,0),F&&p.init({element:B.node(),gd:t,prepFn:function(){i=z.attr("transform")},moveFn:function(t,n){var a="pointer";if(r.showarrow)r.axref===r.xref?E("ax",v(x,t,"ax",A,r)):E("ax",r.ax+t),r.ayref===r.yref?E("ay",v(b,n,"ay",A.w,r)):E("ay",r.ay+n),ek(t,n);else{if(y)return;if(x)o=v(x,t,"x",A,r);else{var o,l,u=r._xsize/A.w,c=r.x+(r._xshift-r.xshift)/A.w-u/2;o=p.align(c+t/A.w,u,0,1,r.xanchor)}if(b)l=v(b,n,"y",A,r);else{var h=r._ysize/A.h,d=r.y-(r._yshift+r.yshift)/A.h-h/2;l=p.align(d-n/A.h,h,0,1,r.yanchor)}E("x",o),E("y",l),x&&b||(a=p.getCursor(x?.5:o,b?.5:l,r.xanchor,r.yanchor))}z.attr({transform:s(t,n)+i}),f(B,a)},clickFn:function(i,n){r.captureevents&&t.emit("plotly_clickannotation",R(n))},doneFn:function(){f(B),n.call("_guiRelayout",t,D());var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}})}M.annotationText?$.call(d.makeEditable,{delegate:B,gd:t}).call(W).on("edit",function(i){r.text=i,this.call(W),E("text",i),x&&x.autorange&&S(x._name+".autorange",!0),b&&b.autorange&&S(b._name+".autorange",!0),n.call("_guiRelayout",t,D())}):$.call(W)}r.exports={draw:function(t){var r=t._fullLayout;r._infolayer.selectAll(".annotation").remove();for(var i=0;i0||i.explicitOff.length>0},onClick:function(t,r){var s,l,u=o(t,r),c=u.on,h=u.off.concat(u.explicitOff),d={},f=t._fullLayout.annotations;if(c.length||h.length){for(s=0;s1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+l+'"]').remove():(u._pdata=n(t.glplot.cameraParams,[r.xaxis.r2l(u.x)*o[0],r.yaxis.r2l(u.y)*o[1],r.zaxis.r2l(u.z)*o[2]]),i(t.graphDiv,u,l,t.id,u._xa,u._ya))}}}}),nL=g({"src/components/annotations3d/index.js"(t,r){var i=e2(),n=t_();r.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:nS()}}},layoutAttributes:nS(),handleDefaults:nE(),includeBasePlot:function(t,r){var a=i.subplotsRegistry.gl3d;if(a)for(var o=a.attrRegex,s=Object.keys(t),l=0;l{var u,y,v,x,b=o+"anchor",_="x"===o?f:p,w={_fullLayout:a};let T=t[o+"ref"];if(Array.isArray(T)&&T.length>0){let i=s.countDefiningCoords(h,c,o);x=n.coerceRefArray(t,r,w,o,void 0,"paper",i),r["_"+o+"refArray"]=!0}else x=n.coerceRef(t,r,w,o,void 0,"paper");if(Array.isArray(x))x.forEach(function(t){"range"===n.getRefType(t)&&(u=n.getFromId(w,t))&&-1===u._shapeIndices.indexOf(r._index)&&u._shapeIndices.push(r._index)}),d&&[0,1].forEach(function(a){let c=x[a];"range"===n.getRefType(c)?(u=n.getFromId(w,c),y=s.shapePositionToRange(u),v=s.rangeToShapePosition(u),("category"===u.type||"multicategory"===u.type)&&l(o+a+"shift")):y=v=i.identity;let h=o+a,d=t[h];if(t[h]=y(t[h],!0),"pixel"===_?l(h,g[a]):n.coercePosition(r,w,l,c,h,m[a]),r[h]=v(r[h]),t[h]=d,0===a&&"pixel"===_){let i=t[b];t[b]=y(t[b],!0),n.coercePosition(r,w,l,c,b,.25),r[b]=v(r[b]),t[b]=i}});else{if("range"===n.getRefType(x)?((u=n.getFromId(w,x))._shapeIndices.push(r._index),v=s.rangeToShapePosition(u),y=s.shapePositionToRange(u),d&&("category"===u.type||"multicategory"===u.type)&&(l(o+"0shift"),l(o+"1shift"))):y=v=i.identity,d){let i=o+"0",a=o+"1",s=t[i],u=t[a];t[i]=y(t[i],!0),t[a]=y(t[a],!0),"pixel"===_?(l(i,g[0]),l(a,g[1])):(n.coercePosition(r,w,l,x,i,m[0]),n.coercePosition(r,w,l,x,a,m[1])),r[i]=v(r[i]),r[a]=v(r[a]),t[i]=s,t[a]=u}if("pixel"===_){let i=t[b];t[b]=y(t[b],!0),n.coercePosition(r,w,l,x,b,.25),r[b]=v(r[b]),t[b]=i}}}),d&&i.noneOrAll(t,r,["x0","x1","y0","y1"]);var y,v,x="line"===h;if(d&&(y=l("label.texttemplate"),l("label.texttemplatefallback")),y||(v=l("label.text")),v||y){l("label.textangle");var b=l("label.textposition",x?"middle":"middle center");l("label.xanchor"),l("label.yanchor",x?"bottom":-1!==b.indexOf("top")?"top":-1!==b.indexOf("bottom")?"bottom":"middle"),l("label.padding"),i.coerceFont(l,"label.font",a.font)}}r.exports=function(t,r){a(t,r,{name:"shapes",handleItemDefaults:l})}}}),nF=g({"src/components/shapes/draw_newshape/defaults.js"(t,r){var i=ei(),n=t_();r.exports=function(t,r,a){if(a("newshape.visible"),a("newshape.name"),a("newshape.showlegend"),a("newshape.legend"),a("newshape.legendwidth"),a("newshape.legendgroup"),a("newshape.legendgrouptitle.text"),n.coerceFont(a,"newshape.legendgrouptitle.font"),a("newshape.legendrank"),a("newshape.drawdirection"),a("newshape.layer"),a("newshape.fillcolor"),a("newshape.fillrule"),a("newshape.opacity"),a("newshape.line.width")){var o=(t||{}).plot_bgcolor||"#FFF";a("newshape.line.color",i.contrast(o)),a("newshape.line.dash")}var s="drawline"===t.dragmode,l=a("newshape.label.text"),u=a("newshape.label.texttemplate");if(a("newshape.label.texttemplatefallback"),l||u){a("newshape.label.textangle");var c=a("newshape.label.textposition",s?"middle":"middle center");a("newshape.label.xanchor"),a("newshape.label.yanchor",s?"bottom":-1!==c.indexOf("top")?"top":-1!==c.indexOf("bottom")?"bottom":"middle"),a("newshape.label.padding"),n.coerceFont(a,"newshape.label.font",r.font)}a("activeshape.fillcolor"),a("activeshape.opacity")}}}),nO=g({"src/components/shapes/calc_autorange.js"(t,r){var i=t_(),n=rs(),a=r$(),o=rW();function s(t,r,i){let s=r[i+"ref"],l="x"===i?a.paramIsX:a.paramIsY;function u(t,r){"paper"===t||"domain"===n.getRefType(t)||(c[t]||(c[t]=[]),c[t].push(r))}let c={};if("path"===r.type&&r.path){let t=r.path.match(a.segmentRE)||[];for(var h=0,d=0;di&&(u(s[h],n[i]),h++)}}else u(s[0],r[i+"0"]),u(s[1],r[i+"1"]);let f={};for(let r in c){let i=n.getFromId(t,r);if(i){var p="category"===i.type||"multicategory"===i.type?i.r2c:i.d2c;"date"===i.type&&(p=o.decodeDate(p)),f[i._id]=c[r].map(p)}}return f}function l(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function u(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,r,n,s,l,u){var c=t/2;if("pixel"!==r)return{ppad:c};var h=l?o.extractPathCoords(l,u?a.paramIsY:a.paramIsX):[n,s],d=i.aggNums(Math.max,null,h),f=i.aggNums(Math.min,null,h),p=f<0?Math.abs(f)+c:c,m=d>0?d+c:c;return{ppad:c,ppadplus:u?p:m,ppadminus:u?m:p}}function h(t,r,i){var n,s,l="x"===t._id.charAt(0)?"x":"y",u="category"===t.type||"multicategory"===t.type,c=0,h=0,d=u?t.r2c:t.d2c;if("scaled"===r[l+"sizemode"]?(n=r[l+"0"],s=r[l+"1"],u&&(c=r[l+"0shift"],h=r[l+"1shift"])):(n=r[l+"anchor"],s=r[l+"anchor"]),void 0!==n)return[d(n)+c,d(s)+h];if(r.path){var f,p,m,g,y=1/0,v=-1/0,x=r.path.match(a.segmentRE);for("date"===t.type&&(d=o.decodeDate(d)),f=0;fv&&(v=g));if(v>=y)return[y,v]}}r.exports=function(t){var r=t._fullLayout,o=i.filterVisible(r.shapes);if(!(!o.length||!t._fullData.length))for(var c=0;c{f=n.getFromId(t,r),d._extremes[f._id]=n.findExtremes(f,i,l(d))}):"paper"!==d.xref&&"domain"!==m&&(p=h(f=n.getFromId(t,d.xref),d,a.paramIsX))&&(d._extremes[f._id]=n.findExtremes(f,p,l(d))),"array"===g?Object.entries(s(t,d,"y")).forEach(([r,i])=>{f=n.getFromId(t,r),d._extremes[f._id]=n.findExtremes(f,i,u(d))}):"paper"!==d.yref&&"domain"!==g&&(p=h(f=n.getFromId(t,d.yref),d,a.paramIsY))&&(d._extremes[f._id]=n.findExtremes(f,p,u(d)))}}}}),nR=g({"src/components/shapes/index.js"(t,r){var i=rX();r.exports={moduleType:"component",name:"shapes",layoutAttributes:nP(),supplyLayoutDefaults:nz(),supplyDrawNewShapeDefaults:nF(),includeBasePlot:ik()("shapes"),calcAutorange:nO(),draw:i.draw,drawOne:i.drawOne}}}),nB=g({"src/components/images/attributes.js"(t,r){var i=tI(),n=tC().templatedArray;iv(),r.exports=n("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),nj=g({"src/components/images/defaults.js"(t,r){var i=t_(),n=rs(),a=tJ(),o=nB();function s(t,r,a){function s(n,a){return i.coerce(t,r,o,n,a)}var l=s("source");if(!s("visible",!!l))return r;s("layer"),s("xanchor"),s("yanchor"),s("sizex"),s("sizey"),s("sizing"),s("opacity");for(var u={_fullLayout:a},c=["x","y"],h=0;h<2;h++){var d=c[h],f=n.coerceRef(t,r,u,d,"paper",void 0);"paper"!==f&&n.getFromId(u,f)._imgIndices.push(r._index),n.coercePosition(r,u,s,f,d,0)}return r}r.exports=function(t,r){a(t,r,{name:"images",handleItemDefaults:s})}}}),nN=g({"src/components/images/draw.js"(t,r){var i=k(),n=rr(),a=rs(),o=tL(),s=tB();r.exports=function(t){var r,l,u=t._fullLayout,c=[],h={},d=[];for(l=0;l0)&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),i.noneOrAll(t,r,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),i.coerceFont(s,"font",o.font),s("bgcolor",o.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function u(t,r){function n(n,a){return i.coerce(t,r,s,n,a)}n("visible","skip"===t.method||Array.isArray(t.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}r.exports=function(t,r){n(t,r,{name:o,handleItemDefaults:l})}}}),n$=g({"src/components/updatemenus/scrollbox.js"(t,r){r.exports=s;var i=k(),n=ei(),a=rr(),o=t_();function s(t,r,i){this.gd=t,this.container=r,this.id=i,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(t,r,o){var l=this.gd._fullLayout,u=l.width,c=l.height;this.position=t;var h,d,f,p,m=this.position.l,g=this.position.w,y=this.position.t,v=this.position.h,x=this.position.direction,b="down"===x,_="left"===x,w="up"===x,T=g,A=v;b||_||"right"===x||w||(this.position.direction="down",b=!0),b||w?(d=(h=m)+T,b?A=(p=Math.min((f=y)+A,c))-f:(f=Math.max((p=y+A)-A,0),A=p-f)):(p=(f=y)+A,_?(h=Math.max((d=m+T)-T,0),T=d-h):T=(d=Math.min((h=m)+T,u))-h),this._box={l:h,t:f,w:T,h:A};var M=g>T,k=s.barLength+2*s.barPad,S=s.barWidth+2*s.barPad,E=y+v;E+S>c&&(E=c-S);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,s.barColor),M?(this.hbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:m,y:E,width:k,height:S}),this._hbarXMin=m+k/2,this._hbarTranslateMax=T-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>A,I=s.barWidth+2*s.barPad,L=s.barLength+2*s.barPad,P=m+g;P+I>u&&(P=u-I);var z=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,s.barColor),C?(this.vbar=z.attr({rx:s.barRadius,ry:s.barRadius,x:P,y:y,width:I,height:L}),this._vbarYMin=y+L/2,this._vbarTranslateMax=A-L):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,O=h-.5,R=C?d+I+.5:d+.5,B=f-.5,j=M?p+S+.5:p+.5,N=l._topdefs.selectAll("#"+F).data(M||C?[0]:[]);if(N.exit().remove(),N.enter().append("clipPath").attr("id",F).append("rect"),M||C?(this._clipRect=N.select("rect").attr({x:Math.floor(O),y:Math.floor(B),width:Math.ceil(R)-Math.floor(O),height:Math.ceil(j)-Math.floor(B)}),this.container.call(a.setClipUrl,F,this.gd),this.bg.attr({x:m,y:y,width:g,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),M||C){var V=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var U=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(U),C&&this.vbar.on(".drag",null).call(U)}this.setTranslate(r,o)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,r=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(r-=i.event.dy),this.setTranslate(t,r)},s.prototype._onBoxWheel=function(){var t=this.translateX,r=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(r+=i.event.deltaY),this.setTranslate(t,r)},s.prototype._onBarDrag=function(){var t=this.translateX,r=this.translateY;if(this.hbar){var n=t+this._hbarXMin,a=n+this._hbarTranslateMax;t=(o.constrain(i.event.x,n,a)-n)/(a-n)*(this.position.w-this._box.w)}if(this.vbar){var s=r+this._vbarYMin,l=s+this._vbarTranslateMax;r=(o.constrain(i.event.y,s,l)-s)/(l-s)*(this.position.h-this._box.h)}this.setTranslate(t,r)},s.prototype.setTranslate=function(t,r){var i=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,i),r=o.constrain(r||0,0,n),this.translateX=t,this.translateY=r,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-r),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+r-.5)}),this.hbar){var s=t/i;this.hbar.call(a.setTranslate,t+s*this._hbarTranslateMax,r)}if(this.vbar){var l=r/n;this.vbar.call(a.setTranslate,t,r+l*this._vbarTranslateMax)}}}}),nW=g({"src/components/updatemenus/draw.js"(t,r){var i=k(),n=tR(),a=ei(),o=rr(),s=t_(),l=tN(),u=tC().arrayEditor,c=tj().LINE_SPACING,h=nq(),d=n$();function f(t){return t._index}function p(t,r){return+t.attr(h.menuIndexAttrName)===r._index}function m(t,r,i,n,a,o,s,l){r.active=s,u(t.layout,h.name,r).applyUpdate("active",s),"buttons"===r.type?y(t,n,null,null,r):"dropdown"===r.type&&(a.attr(h.menuIndexAttrName,"-1"),g(t,n,a,o,r),l||y(t,n,a,o,r))}function g(t,r,i,n,a){var l=s.ensureSingle(r,"g",h.headerClassName,function(t){t.style("pointer-events","all")}),u=a._dims,c=a.active,d=a.buttons[c]||h.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},m={width:u.headerWidth,height:u.headerHeight};l.call(v,a,d,t).call(M,a,f,m),s.ensureSingle(r,"text",h.headerArrowClassName,function(t){t.attr("text-anchor","end").call(o.font,a.font).text(h.arrowSymbol[a.direction])}).attr({x:u.headerWidth-h.arrowOffsetX+a.pad.l,y:u.headerHeight/2+h.textOffsetY+a.pad.t}),l.on("click",function(){i.call(S,String(p(i,a)?-1:a._index)),y(t,r,i,n,a)}),l.on("mouseover",function(){l.call(w)}),l.on("mouseout",function(){l.call(T,a)}),o.setTranslate(r,u.lx,u.ly)}function y(t,r,a,o,l){a||(a=r).attr("pointer-events","all");var u,c,d,f=-1==+a.attr(h.menuIndexAttrName)&&"buttons"!==l.type?[]:l.buttons,p="dropdown"===l.type?h.dropdownButtonClassName:h.buttonClassName,g=a.selectAll("g."+p).data(s.filterVisible(f)),y=g.enter().append("g").classed(p,!0),x=g.exit();"dropdown"===l.type?(y.attr("opacity","0").transition().attr("opacity","1"),x.transition().attr("opacity","0").remove()):x.remove();var b=0,A=0,k=l._dims,S=-1!==["up","down"].indexOf(l.direction);"dropdown"===l.type&&(S?A=k.headerHeight+h.gapButtonHeader:b=k.headerWidth+h.gapButtonHeader),"dropdown"===l.type&&"up"===l.direction&&(A=-h.gapButtonHeader+h.gapButton-k.openHeight),"dropdown"===l.type&&"left"===l.direction&&(b=-h.gapButtonHeader+h.gapButton-k.openWidth);var E={x:k.lx+b+l.pad.l,y:k.ly+A+l.pad.t,yPad:h.gapButton,xPad:h.gapButton,index:0},D={l:E.x+l.borderwidth,t:E.y+l.borderwidth};g.each(function(s,u){var c=i.select(this);c.call(v,l,s,t).call(M,l,E),c.on("click",function(){i.event.defaultPrevented||(s.execute&&(s.args2&&l.active===u?(m(t,l,s,r,a,o,-1),n.executeAPICommand(t,s.method,s.args2)):(m(t,l,s,r,a,o,u),n.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:l,button:s,active:l.active}))}),c.on("mouseover",function(){c.call(w)}),c.on("mouseout",function(){c.call(T,l),g.call(_,l)})}),g.call(_,l),S?(D.w=Math.max(k.openWidth,k.headerWidth),D.h=E.y-D.t):(D.w=E.x-D.l,D.h=Math.max(k.openHeight,k.headerHeight)),D.direction=l.direction,o&&(g.size()?function(t,r,i){var n,a,o,s=r.direction,l=r._dims,u=r.active;if("up"===s||"down"===s)for(a=0,o=0;o0?[0]:[]);if(x.enter().append("g").classed(h.containerClassName,!0).style("cursor","pointer"),x.exit().each(function(){i.select(this).selectAll("g."+h.headerGroupClassName).each(u)}).remove(),0!==a.length){var b=x.selectAll("g."+h.headerGroupClassName).data(a,f);b.enter().append("g").classed(h.headerGroupClassName,!0);for(var _=s.ensureSingle(x,"g",h.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),w=0;w0&&(u=u.transition().duration(r.transition.duration).ease(r.transition.easing)),u.attr("transform",l(s-.5*h.gripWidth,r._dims.currentValueTotalHeight))}}function E(t,r){var i=t._dims;return i.inputAreaStart+h.stepInset+(i.inputAreaLength-2*h.stepInset)*Math.min(1,Math.max(0,r))}function D(t,r){var i=t._dims;return Math.min(1,Math.max(0,(r-h.stepInset-i.inputAreaStart)/(i.inputAreaLength-2*h.stepInset-2*i.inputAreaStart)))}function C(t,r,i){var n=i._dims,l=s.ensureSingle(t,"rect",h.railTouchRectClass,function(n){n.call(A,r,t,i).style("pointer-events","all")});l.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,h.tickOffset+i.ticklen+n.labelHeight)}).call(a.fill,i.bgcolor).attr("opacity",0),o.setTranslate(l,0,n.currentValueTotalHeight)}function I(t,r){var i=r._dims,n=i.inputAreaLength-2*h.railInset,l=s.ensureSingle(t,"rect",h.railRectClass);l.attr({width:n,height:h.railWidth,rx:h.railRadius,ry:h.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,r.bordercolor).call(a.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px"),o.setTranslate(l,h.railInset,(i.inputAreaWidth-h.railWidth)*.5+i.currentValueTotalHeight)}r.exports=function(t){var r=t._context.staticPlot,a=t._fullLayout,l=function(t,r){for(var i=t[h.name],n=[],a=0;a0?[0]:[]);function d(r){r._commandObserver&&(r._commandObserver.remove(),delete r._commandObserver),n.autoMargin(t,g(r))}if(c.enter().append("g").classed(h.containerClassName,!0).style("cursor",r?null:"ew-resize"),c.exit().each(function(){i.select(this).selectAll("g."+h.groupClassName).each(d)}).remove(),0!==l.length){var f=c.selectAll("g."+h.groupClassName).data(l,y);f.enter().append("g").classed(h.groupClassName,!0),f.exit().each(d).remove();for(var w=0;w0?t.touches[0].clientX:0}function y(t,r,i,n){var a=o.ensureSingle(t,"rect",m.bgClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),c=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,h=-n._offsetShift,d=l.crispRound(r,n.borderwidth);a.attr({width:n._width+c,height:n._height+c,transform:s(h,h),"stroke-width":d}).call(u.stroke,n.bordercolor).call(u.fill,n.bgcolor)}function v(t,r,i,n){var a=r._fullLayout;o.ensureSingleById(a._topdefs,"clipPath",n._clipId,function(t){t.append("rect").attr({x:0,y:0})}).select("rect").attr({width:n._width,height:n._height})}function x(t,r,n,s){var u,c=r.calcdata,f=t.selectAll("g."+m.rangePlotClassName).data(n._subplotsWith,o.identity);f.enter().append("g").attr("class",function(t){return m.rangePlotClassName+" "+t}).call(l.setClipUrl,s._clipId,r),f.order(),f.exit().remove(),f.each(function(t,o){var l=i.select(this),f=d.getFromId(r,t,"y"),p=f._name,m=s[p],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:s.range.slice(),calendar:n.calendar},width:s._width,height:s._height,margin:{t:0,b:0,l:0,r:0}},_context:r._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[p]={type:f.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():f.range.slice(),calendar:f.calendar},f.rangebreaks&&(g.layout[p].rangebreaks=f.rangebreaks),a.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[p];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:t,plotgroup:l,xaxis:y,yaxis:v,isRangePlot:!0};0===o?u=x:(x.mainplot="xy",x.mainplotinfo=u),h.rangePlot(r,x,function(t,r){for(var i=[],n=0;n=n.max)r=j[i+1];else if(t=n.pmax)r=j[i+1];else if(ta._length||x+w<0)return;h=v+w,f=x+w;break;case u:if(_="col-resize",v+w>a._length)return;h=v+w,f=x;break;case c:if(_="col-resize",x+w<0)return;h=v,f=x+w;break;default:_="ew-resize",h=y,f=y+w}if(f0)){var g=function(t,r,i){for(var n=i.filter(function(i){return r[i].anchor===t._id}),a=0,o=0;o1))return void delete r.grid;f||p||m||"independent"===M("pattern")&&(f=!0),y._hasSubplotGrid=f;var b,_,w=M("roworder"),T=f?.2:.1,A=f?.3:.1;g&&r._splomGridDflt&&(b=r._splomGridDflt.xside,_=r._splomGridDflt.yside),y._domains={x:c("x",M,T,b,x),y:c("y",M,A,_,v,"top to bottom"===w)}}function M(t,r){return i.coerce(n,y,l,t,r)}},contentDefaults:function(t,r){var i=r.grid;if(!(!i||!i._domains)){var n,a,o,s,l,c,d,f=t.grid||{},p=r._subplots,m=i._hasSubplotGrid,g=i.rows,y=i.columns,v="independent"===i.pattern,x=i._axisMap={};if(m){var b=f.subplots||[];c=i.subplots=Array(g);var _=1;for(n=0;n0,d=t._context.staticPlot;r.each(function(r){var f,p=r[0].trace,m=p.error_x||{},g=p.error_y||{};p.ids&&(f=function(t){return t.id});var y=o.hasMarkers(p)&&p.marker.maxdisplayed>0;g.visible||m.visible||(r=[]);var v=i.select(this).selectAll("g.errorbar").data(r,f);if(v.exit().remove(),r.length){m.visible||v.selectAll("path.xerror").remove(),g.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var x=v.enter().append("g").classed("errorbar",!0);h&&x.style("opacity",0).transition().duration(l.duration).style("opacity",1),a.setClipUrl(v,s.layerClipId,t),v.each(function(t){var r=i.select(this),a=(o=t,s=u,f=c,p={x:s.c2p(o.x),y:f.c2p(o.y)},void 0!==o.yh&&(p.yh=f.c2p(o.yh),p.ys=f.c2p(o.ys),n(p.ys)||(p.noYS=!0,p.ys=f.c2p(o.ys,!0))),void 0!==o.xh&&(p.xh=s.c2p(o.xh),p.xs=s.c2p(o.xs),n(p.xs)||(p.noXS=!0,p.xs=s.c2p(o.xs,!0))),p);if(!(y&&!t.vis)){var o,s,f,p,v,x=r.select("path.yerror");if(g.visible&&n(a.x)&&n(a.yh)&&n(a.ys)){var b=g.width;v="M"+(a.x-b)+","+a.yh+"h"+2*b+"m-"+b+",0V"+a.ys,a.noYS||(v+="m-"+b+",0h"+2*b),x.size()?h&&(x=x.transition().duration(l.duration).ease(l.easing)):x=r.append("path").style("vector-effect",d?"none":"non-scaling-stroke").classed("yerror",!0),x.attr("d",v)}else x.remove();var _=r.select("path.xerror");if(m.visible&&n(a.y)&&n(a.xh)&&n(a.xs)){var w=(m.copy_ystyle?g:m).width;v="M"+a.xh+","+(a.y-w)+"v"+2*w+"m0,-"+w+"H"+a.xs,a.noXS||(v+="m0,-"+w+"v"+2*w),_.size()?h&&(_=_.transition().duration(l.duration).ease(l.easing)):_=r.append("path").style("vector-effect",d?"none":"non-scaling-stroke").classed("xerror",!0),_.attr("d",v)}else _.remove()}})}})}}}),ah=g({"src/components/errorbars/style.js"(t,r){var i=k(),n=ei();r.exports=function(t){t.each(function(t){var r=t[0].trace,a=r.error_y||{},o=r.error_x||{},s=i.select(this);s.selectAll("path.yerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color),o.copy_ystyle&&(o=a),s.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(n.stroke,o.color)})}}}),ad=g({"src/components/errorbars/index.js"(t,r){var i=t_(),n=e$().overrideAll,a=ao(),o={error_x:i.extendFlat({},a),error_y:i.extendFlat({},a)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var s={error_x:i.extendFlat({},a),error_y:i.extendFlat({},a),error_z:i.extendFlat({},a)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,r.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:n(s,"calc","nested"),scattergl:n(o,"calc","nested")}},supplyDefaults:as(),calc:au(),makeComputeError:al(),plot:ac(),style:ah(),hoverInfo:function(t,r,i){(r.error_y||{}).visible&&(i.yerr=t.yh-t.y,r.error_y.symmetric||(i.yerrneg=t.y-t.ys)),(r.error_x||{}).visible&&(i.xerr=t.xh-t.x,r.error_x.symmetric||(i.xerrneg=t.x-t.xs))}}}}),af=g({"src/components/colorbar/constants.js"(t,r){r.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),ap=g({"src/components/colorbar/draw.js"(t,r){var i=k(),n=tR(),a=e2(),o=rs(),s=rm(),l=t_(),u=l.strTranslate,c=$().extendFlat,h=rg(),d=rr(),f=ei(),p=ri(),m=tN(),g=tV().flipScale,y=nf(),v=np(),x=tq(),b=tj(),_=b.LINE_SPACING,w=b.FROM_TL,T=b.FROM_BR,A=af().cn,M=(t,r)=>[Math.min(t[0]+r,t[1]),t[1]],S=(t,r)=>[t[0],Math.max(t[1]-r,t[0])];r.exports={draw:function(t){var r=t._fullLayout._infolayer.selectAll("g."+A.colorbar).data(function(t){var r,i,n,a,o=t._fullLayout,s=t.calcdata,l=[];function u(t){return c(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function h(){"function"==typeof a.calc?a.calc(t,n,r):(r._fillgradient=i.reversescale?g(i.colorscale):i.colorscale,r._zrange=[i[a.min],i[a.max]])}for(var d=0;d0?i>=l:i<=l));n++)i>c&&i0?i>=l:i<=l));n++)i>r[0]&&i1){var em=Math.pow(10,Math.floor(Math.log(ep)/Math.LN10));ed*=em*l.roundUp(ep/em,[2,5,10]),(Math.abs(Y.start)/Y.size+1e-6)%1<2e-6&&(ec.tick0=0)}ec.dtick=ed}var eg=s?z/N.h:P/N.w;ec.domain=S(M([el,el+et],eg),eg),ec.setScale(),t.attr("transform",u(Math.round(N.l),Math.round(N.t)));var ey,ev=t.select("."+A.cbtitleunshift).attr("transform",u(-Math.round(N.l),-Math.round(N.t))),ex=ec.ticklabelposition,eb=ec.title.font.size,e_=t.select("."+A.cbaxis),ew=0,eT=0;function eA(i,n){var o={propContainer:ec,propName:r._propPrefix+"title.text",traceIndex:r._traceIndex,_meta:r._meta,placeholder:j._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},s="h"===i.charAt(0)?i.slice(1):"h"+i;t.selectAll("."+s+",."+s+"-math-group").remove(),p.draw(a,i,c(o,n||{}))}return l.syncOrAsync([n.previousPromises,function(){if(s&&eh||!s&&!eh){var t,r;"top"===G&&(t=P+N.l+er*F,r=z+N.t+ei*(1-el-et)+3+.75*eb),"bottom"===G&&(t=P+N.l+er*F,r=z+N.t+ei*(1-el)-3-.25*eb),"right"===G&&(r=z+N.t+ei*O+3+.75*eb,t=P+N.l+er*el),eA(ec._id+"title",{attributes:{x:t,y:r,"text-anchor":s?"start":"middle"}})}},function(){if(!s&&!eh||s&&eh){var n,c=t.select("."+A.cbtitle),h=c.select("text"),p=[-E/2,E/2],g=c.select(".h"+ec._id+"title-math-group").node(),y=15.6;if(h.node()&&(y=parseInt(h.node().style.fontSize,10)*_),g?(eT=(n=d.bBox(g)).width,(ew=n.height)>y&&(p[1]-=(ew-y)/2)):h.node()&&!h.classed(A.jsPlaceholder)&&(eT=(n=d.bBox(h.node())).width,ew=n.height),s){if(ew){if(ew+=5,"top"===G)ec.domain=S(ec.domain,ew/N.h),p[1]*=-1;else{ec.domain=M(ec.domain,ew/N.h);var v=m.lineCount(h);p[1]+=(1-v)*y}c.attr("transform",u(p[0],p[1])),ec.setScale()}}else eT&&("right"===G&&(ec.domain=M(ec.domain,(eT+eb/2)/N.w)),c.attr("transform",u(p[0],p[1])),ec.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",s?u(0,Math.round(N.h*(1-ec.domain[1]))):u(Math.round(N.w*ec.domain[0]),0)),e_.attr("transform",s?u(0,Math.round(-N.t)):u(Math.round(-N.l),0));var x=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(X);x.enter().append("rect").classed(A.cbfill,!0).attr("style",""),x.exit().remove();var b=H.map(ec.c2p).map(Math.round).sort(function(t,r){return t-r});x.each(function(t,n){var o=[0===n?H[0]:(X[n]+X[n-1])/2,n===X.length-1?H[1]:(X[n]+X[n+1])/2].map(ec.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,b[0],b[1]));var u=i.select(this).attr(s?"x":"y",en).attr(s?"y":"x",i.min(o)).attr(s?"width":"height",Math.max(J,2)).attr(s?"height":"width",Math.max(i.max(o)-i.min(o),2));if(r._fillgradient)d.gradient(u,a,r._id,s?"vertical":"horizontalreversed",r._fillgradient,"fill");else{var c=W(t).replace("e-","");u.attr("fill",f.hexString(c))}});var w=t.select("."+A.cblines).selectAll("path."+A.cbline).data(U.color&&U.width?K:[]);w.enter().append("path").classed(A.cbline,!0),w.exit().remove(),w.each(function(t){var r=Math.round(ec.c2p(t))+U.width/2%1;i.select(this).attr("d","M"+(s?en+","+r:r+","+en)+(s?"h":"v")+J).call(d.lineGroupStyle,U.width,$(t),U.dash)}),e_.selectAll("g."+ec._id+"tick,path").remove();var T=en+J+(E||0)/2-("outside"===r.ticks),k=o.calcTicks(ec),D=o.getTickSigns(ec)[2];return o.drawTicks(a,ec,{vals:"inside"===ec.ticks?o.clipEnds(ec,k):k,layer:e_,path:o.makeTickPath(ec,T,D),transFn:o.makeTransTickFn(ec)}),o.drawLabels(a,ec,{vals:k,layer:e_,transFn:o.makeTransTickLabelFn(ec),labelFns:o.makeLabelFns(ec,T)})},function(){if(s&&!eh||!s&&eh){var t,n,o=ec.position||0,l=ec._offset+ec._length/2;if("right"===G)n=l,t=N.l+er*o+10+eb*(ec.showticklabels?1:.5);else if(t=l,"bottom"===G&&(n=N.t+ei*o+10+(-1===ex.indexOf("inside")?ec.tickfont.size:0)+("inside"!==ec.ticks&&r.ticklen||0)),"top"===G){var u=q.text.split("
").length;n=N.t+ei*o+10-J-_*eb*u}eA((s?"h":"v")+ec._id+"title",{avoid:{selection:i.select(a).selectAll("g."+ec._id+"tick"),side:G,offsetTop:s?0:N.t,offsetLeft:s?N.l:0,maxShift:s?j.width:j.height},attributes:{x:t,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}},n.previousPromises,function(){var i,o=J+E/2;-1===ex.indexOf("inside")&&(i=d.bBox(e_.node()),o+=s?i.width:i.height),ey=ev.select("text");var l=0,c=s&&"top"===G,p=!s&&"right"===G,m=0;if(ey.node()&&!ey.classed(A.jsPlaceholder)){var y,v=ev.select(".h"+ec._id+"title-math-group").node();v&&(s&&eh||!s&&!eh)?(l=(i=d.bBox(v)).width,y=i.height):(l=(i=d.bBox(ev.node())).right-N.l-(s?en:eu),y=i.bottom-N.t-(s?eu:en),s||"top"!==G||(o+=i.height,m=i.height)),p&&(ey.attr("transform",u(l/2+eb/2,0)),l*=2),o=Math.max(o,s?l:y)}var x=(s?P:z)*2+o+D+E/2,_=0;!s&&q.text&&"bottom"===L&&O<=0&&(_=x/2,x+=_,m+=_),j._hColorbarMoveTitle=_,j._hColorbarMoveCBTitle=m;var M=D+E,S=(s?en:eu)-M/2-(s?P:0),V=(s?eu:en)-(s?ee:z+m-_);t.select("."+A.cbbg).attr("x",S).attr("y",V).attr(s?"width":"height",Math.max(x-_,2)).attr(s?"height":"width",Math.max(ee+M,2)).call(f.fill,C).call(f.stroke,r.bordercolor).style("stroke-width",D);var U=p?Math.max(l-10,0):0;t.selectAll("."+A.cboutline).attr("x",(s?en:eu+P)+U).attr("y",(s?eu+z-ee:en)+(c?ew:0)).attr(s?"width":"height",Math.max(J,2)).attr(s?"height":"width",Math.max(ee-(s?2*z+ew:2*P+U),2)).call(f.stroke,r.outlinecolor).style({fill:"none","stroke-width":E});var H=s?ea*x:0,$=s?0:(1-eo)*x-m;if(H=B?N.l-H:-H,$=R?N.t-$:-$,t.attr("transform",u(H,$)),!s&&(D||f.opacity(C)&&!f.equals(j.paper_bgcolor,C))){var W=e_.selectAll("text"),Y=W[0].length,Z=t.select("."+A.cbbg).node(),X=d.bBox(Z),K=d.getTranslate(t);W.each(function(t,r){var i=Y-1;if(0===r||r===i){var n,a=d.bBox(this),o=d.getTranslate(this);if(r===i){var s=a.right+o.x;(n=X.right+K.x+eu-D-2+F-s)>0&&(n=0)}else if(0===r){var l=a.left+o.x;(n=X.left+K.x+eu+D+2-l)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Q={},et=w[I],er=T[I],ei=w[L],es=T[L],el=x-J;s?("pixels"===g?(Q.y=O,Q.t=ee*ei,Q.b=ee*es):(Q.t=Q.b=0,Q.yt=O+h*ei,Q.yb=O-h*es),"pixels"===k?(Q.x=F,Q.l=x*et,Q.r=x*er):(Q.l=el*et,Q.r=el*er,Q.xl=F-b*et,Q.xr=F+b*er)):("pixels"===g?(Q.x=F,Q.l=ee*et,Q.r=ee*er):(Q.l=Q.r=0,Q.xl=F+h*et,Q.xr=F-h*er),"pixels"===k?(Q.y=1-O,Q.t=x*ei,Q.b=x*es):(Q.t=el*ei,Q.b=el*es,Q.yt=O-b*ei,Q.yb=O+b*es));var ed=r.y<.5?"b":"t",ef=r.x<.5?"l":"r";a._fullLayout._reservedMargin[r._id]={};var ep={r:j.width-S-H,l:S+Q.r,b:j.height-V-$,t:V+Q.b};B&&R?n.autoMargin(a,r._id,Q):B?a._fullLayout._reservedMargin[r._id][ed]=ep[ed]:R||s?a._fullLayout._reservedMargin[r._id][ef]=ep[ef]:a._fullLayout._reservedMargin[r._id][ed]=ep[ed]}],a)}(P,r,t);z&&z.then&&(t._promises||[]).push(z),t._context.edits.colorbarPosition&&(g=P,b=r,k=t,I="v"===b.orientation,L=k._fullLayout._size,s.init({element:g.node(),gd:k,prepFn:function(){E=g.attr("transform"),h(g)},moveFn:function(t,r){g.attr("transform",E+u(t,r)),D=s.align((I?b._uFrac:b._vFrac)+t/L.w,I?b._thickFrac:b._lenFrac,0,1,b.xanchor),C=s.align((I?b._vFrac:1-b._uFrac)-r/L.h,I?b._lenFrac:b._thickFrac,0,1,b.yanchor),h(g,s.getCursor(D,C,b.xanchor,b.yanchor))},doneFn:function(){if(h(g),void 0!==D&&void 0!==C){var t={};t[b._propPrefix+"x"]=D,t[b._propPrefix+"y"]=C,void 0!==b._traceIndex?a.call("_guiRestyle",k,t,b._traceIndex):a.call("_guiRelayout",k,t)}}}))}),r.exit().each(function(r){n.autoMargin(t,r._id)}).remove(),r.order()}}}}),am=g({"src/components/colorbar/index.js"(t,r){r.exports={moduleType:"component",name:"colorbar",attributes:tG(),supplyDefaults:t1(),draw:ap().draw,hasColorbar:tW()}}}),ag=g({"src/components/legend/index.js"(t,r){r.exports={moduleType:"component",name:"legend",layoutAttributes:rv(),supplyLayoutDefaults:rb(),draw:rE(),style:rS()}}}),ay=g({"src/locale-en.js"(t,r){r.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),av=g({"src/locale-en-us.js"(t,r){r.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),ax=g({"src/snapshot/cloneplot.js"(t,r){var i=e2(),n=t_(),a=n.extendFlat,o=n.extendDeep;function s(t){var r;switch(t){case"themes__thumb":r={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":r={title:{text:""},showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:r={}}return r}r.exports=function(t,r){var n,l=t.data,u=t.layout,c=o([],l),h=o({},u,s(r.tileClass));if(t._context,r.width&&(h.width=r.width),r.height&&(h.height=r.height),"thumbnail"===r.tileClass||"themes__thumb"===r.tileClass){h.annotations=[];var d=Object.keys(h);for(n=0;n-1&&(h[d[n]].title={text:""});for(n=0;n=0)return t}else if("string"==typeof t&&"%"===(t=t.trim()).slice(-1)&&i(t.slice(0,-1))&&(t=+t.slice(0,-1))>=0)return t+"%"}function p(t,r,i,a,o,s){var l=!1!==(s=s||{}).moduleHasSelected,u=!1!==s.moduleHasUnselected,c=!1!==s.moduleHasConstrain,h=!1!==s.moduleHasCliponaxis,f=!1!==s.moduleHasTextangle,p=!1!==s.moduleHasInsideanchor,m=!!s.hasPathbar,g=Array.isArray(o)||"auto"===o,y=g||"inside"===o,v=g||"outside"===o;if(y||v){var x=d(a,"textfont",i.font),b=n.extendFlat({},x),_=!(t.textfont&&t.textfont.color);if(_&&delete b.color,d(a,"insidetextfont",b),m){var w=n.extendFlat({},x);_&&delete w.color,d(a,"pathbar.textfont",w)}v&&d(a,"outsidetextfont",x),l&&a("selected.textfont.color"),u&&a("unselected.textfont.color"),c&&a("constraintext"),h&&a("cliponaxis"),f&&a("textangle"),a("texttemplate"),a("texttemplatefallback")}y&&p&&a("insidetextanchor")}r.exports={supplyDefaults:function(t,r,i,c){function d(i,a){return n.coerce(t,r,h,i,a)}if(!s(t,r,c,d)){r.visible=!1;return}l(t,r,c,d),d("xhoverformat"),d("yhoverformat"),d("zorder"),d("orientation",r.x&&!r.y?"h":"v"),d("base"),d("offset"),d("width"),d("text"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback");var f=d("textposition");p(t,r,c,d,f,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u(t,r,d,i,c);var m=(r.marker.line||{}).color,g=o.getComponentMethod("errorbars","supplyDefaults");g(t,r,m||a.defaultLine,{axis:"y"}),g(t,r,m||a.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(r,d)},crossTraceDefaults:function(t,r){var i,a;function o(t,r){return n.coerce(a._input,a,h,t,r)}for(var s=0;s0&&!f[v]&&(d=!0)),f[v]=!0,y.visible&&"histogram"===y.type&&"category"!==n.getFromId({_fullLayout:r},y["v"===y.orientation?"xaxis":"yaxis"]).type&&(h=!0)}}c?("overlay"!==p&&u("barnorm"),u("bargap",h&&!d?0:.2),u("bargroupgap"),r.barcornerradius=s(u("barcornerradius"))):delete r.barmode}}}),aD=g({"src/traces/bar/arrays_to_calcdata.js"(t,r){var i=t_();r.exports=function(t,r){for(var n=0;no))return r}return void 0!==n?n:t.dflt},t.coerceColor=function(t,i,n){return r.isValid(i)?i:void 0!==n?n:t.dflt},t.coerceEnumerated=function(t,r,i){return t.coerceNumber&&(r*=1),-1!==t.values.indexOf(r)?r:void 0!==i?i:t.dflt},t.getValue=function(t,r){var i;return n(t)?r1||0===a.bargap&&0===a.bargroupgap&&!t[0].trace.marker.line.width)&&i.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(r){p(i.select(this),r[0].trace,t)}),s.getComponentMethod("errorbars","style")(r)},styleTextPoints:m,styleOnSelect:function(t,r,n){var l,u,c,h,d,f,m=r[0].trace;m.selectedpoints?(l=n,u=m,c=t,a.selectedPointStyle(l.selectAll("path"),u),h=l.selectAll("text"),d=u,f=c,h.each(function(t){var r,n=i.select(this);if(t.selected){r=o.ensureUniformFontSize(f,g(n,t,d,f));var s=d.selected.textfont&&d.selected.textfont.color;s&&(r.color=s),a.font(n,r)}else a.selectedTextStyle(n,d)})):(p(n,m,t),s.getComponentMethod("errorbars","style")(n))},getInsideTextFont:v,getOutsideTextFont:x,getBarColor:_,resizeText:l}}}),az=g({"src/traces/bar/plot.js"(t,r){var i=k(),n=L(),a=t_(),o=tN(),s=ei(),l=rr(),u=e2(),c=rs().tickText,h=aI(),d=h.recordMinTextSize,f=h.clearMinTextSize,p=aP(),m=aL(),g=i8(),y=aA(),v=y.text,x=y.textposition,b=t9().appendArrayPointValue,_=g.TEXTPAD;function w(t){return t.id}function T(t,r,i,n){var a;return!r.uniformtext.mode&&A(i)?(n&&(a=n()),t.transition().duration(i.duration).ease(i.easing).each("end",function(){a&&a()}).each("interrupt",function(){a&&a()})):t}function A(t){return t&&t.duration>0}function M(t,r,i,n,a){return!(t<0)&&!(r<0)&&(i<=t&&n<=r||i<=r&&n<=t||(a?t>=r/n*i:r>=t/i*n))}function S(t){return"auto"===t?0:t}function E(t,r){var i=Math.PI/180*r,n=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));return{x:t.width*a+t.height*n,y:t.width*n+t.height*a}}function D(t,r,i,n,a,o){var s=!!o.isHorizontal,l=!!o.constrained,u=o.angle||0,c=o.anchor,h="end"===c,d="start"===c,f=((o.leftToRight||0)+1)/2,p=1-f,m=o.hasB,g=o.r,y=o.overhead,v=a.width,x=a.height,b=Math.abs(r-t),w=Math.abs(n-i),T=b>2*_&&w>2*_?_:0;b-=2*T,w-=2*T;var A=S(u);"auto"===u&&!(v<=b&&x<=w)&&(v>b||x>w)&&(!(v>w||x>b)||v_){var C,I,L,P,z,F,O,R,B,j,N,V,U,q,G,H,$,W=(C=t,I=r,L=i,P=n,z=D,F=g,O=y,R=s,B=m,q=Math.max(0,Math.abs(I-C)-2*_),G=Math.max(0,Math.abs(P-L)-2*_),H=F-_,$=O?H-Math.sqrt(H*H-(H-O)*(H-O)):H,z.y/z.x>=G/(q-(B?2*H:R?H-O:2*$))?V=G/z.y:z.y/z.x<=(G-(B?2*H:R?2*$:H-O))/q?V=q/z.x:!B&&R?(j=z.x*z.x+z.y*z.y/4,V=(-(N=-2*z.x*(q-H)-z.y*(G/2-H))+Math.sqrt(N*N-4*j*((q-H)*(q-H)+(G/2-H)*(G/2-H)-H*H)))/(2*j)):B?(j=(z.x*z.x+z.y*z.y)/4,V=(-(N=-z.x*(q/2-H)-z.y*(G/2-H))+Math.sqrt(N*N-4*j*((q/2-H)*(q/2-H)+(G/2-H)*(G/2-H)-H*H)))/(2*j)):(j=z.x*z.x/4+z.y*z.y,V=(-(N=-z.x*(q/2-H)-2*z.y*(G-H))+Math.sqrt(N*N-4*j*((q/2-H)*(q/2-H)+(G-H)*(G-H)-H*H)))/(2*j)),V=Math.min(1,V),U=R?Math.max(0,H-Math.sqrt(Math.max(0,H*H-(H-(G-z.y*V)/2)*(H-(G-z.y*V)/2)))-O):Math.max(0,H-Math.sqrt(Math.max(0,H*H-(H-(q-z.x*V)/2)*(H-(q-z.x*V)/2)))-O),{scale:V,pad:U});M=W.scale,k=W.pad}else M=1,l&&(M=Math.min(1,b/D.x,w/D.y)),k=0;var Y=a.left*p+a.right*f,Z=(a.top+a.bottom)/2,X=(t+_)*p+(r-_)*f,K=(i+n)/2,J=0,Q=0;if(d||h){var ee=(s?D.x:D.y)/2;g&&(h||m)&&(T+=k);var et=s?ts.opacity(ee)||Q>.01?W:function(t,r,i){return i&&t===r?t:Math.abs(t-r)>=2?W(t):t>r?Math.ceil(t):Math.floor(t)};t._context.staticPlot||(F=Y(F,U,N),U=Y(U,F,N),q=Y(q,G,!N),G=Y(G,q,!N));var Z,X,K,J,Q,ee,et,er=N?C.c2p:I.c2p;et=h.s0>0?h._sMax:h.s0<0?h._sMin:h.s1>0?h._sMax:h._sMin;var ei,en,ea=R||O?function(t,r){if(!t)return 0;var i=Math.abs(N?G-q:U-F),n=Math.abs(N?U-F:G-q),a=Y(Math.abs(er(et,!0)-er(0,!0))),o=h.hasB?Math.min(i/2,n/2):Math.min(i/2,a);return Y(Math.max(Math.min("%"===r?Math.min(50,t)/100*i:t,o),0))}(g.cornerradiusvalue,g.cornerradiusform):0,eo="M"+F+","+q+"V"+G+"H"+U+"V"+q+"Z",es=0;if(ea&&h.s){var el,eu,ec,eh=0==((el=h.s0)>0)-(el<0)||((eu=h.s)>0)-(eu<0)==((ec=h.s0)>0)-(ec<0)?h.s1:h.s0;if((es=Y(h.hasB?0:Math.abs(er(et,!0)-er(eh,!0))))0?Math.sqrt(es*(2*ea-es)):0,ey=ed>0?Math.max:Math.min;ei="M"+F+","+q+"V"+(G-em*ef)+"H"+ey(U-(ea-es)*ed,F)+"A "+ea+","+ea+" 0 0 "+ep+" "+U+","+(G-ea*ef-eg)+"V"+(q+ea*ef+eg)+"A "+ea+","+ea+" 0 0 "+ep+" "+ey(U-(ea-es)*ed,F)+","+(q+em*ef)+"Z"}else if(h.hasB)ei="M"+(F+ea*ed)+","+q+"A "+ea+","+ea+" 0 0 "+ep+" "+F+","+(q+ea*ef)+"V"+(G-ea*ef)+"A "+ea+","+ea+" 0 0 "+ep+" "+(F+ea*ed)+","+G+"H"+(U-ea*ed)+"A "+ea+","+ea+" 0 0 "+ep+" "+U+","+(G-ea*ef)+"V"+(q+ea*ef)+"A "+ea+","+ea+" 0 0 "+ep+" "+(U-ea*ed)+","+q+"Z";else{var ev=(en=Math.abs(G-q)+es)0?Math.sqrt(es*(2*ea-es)):0,eb=ef>0?Math.max:Math.min;ei="M"+(F+ev*ed)+","+q+"V"+eb(G-(ea-es)*ef,q)+"A "+ea+","+ea+" 0 0 "+ep+" "+(F+ea*ed-ex)+","+G+"H"+(U-ea*ed+ex)+"A "+ea+","+ea+" 0 0 "+ep+" "+(U-ev*ed)+","+eb(G-(ea-es)*ef,q)+"V"+q+"Z"}}else ei=eo}else ei=eo;var e_=T(a.ensureSingle(A,"path"),L,y,k);if(e_.style("vector-effect",P?"none":"non-scaling-stroke").attr("d",isNaN((U-F)*(G-q))||H&&t._context.staticPlot?"M0,0Z":ei).call(l.setClipUrl,r.layerClipId,t),!L.uniformtext.mode&&V){var ew=l.makePointStyleFns(f);l.singlePointStyle(h,e_,f,ew,t)}(function(t,r,i,n,s,u,h,f,g,y,w,A,k){var C,I,L,P,z,F,O,R,B,j,N,V,U,q,G,H,$,W,Y,Z,X,K,J,Q,ee,et,er=r.xaxis,ei=r.yaxis,en=t._fullLayout;function ea(r,i,n){return a.ensureSingle(r,"text").text(i).attr({class:"bartext bartext-"+et,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var eo=n[0].trace,es="h"===eo.orientation,el=function(t,r,i,n){for(var a=!1,o=!1,s=0;s0?a=!0:l<0&&(o=!0),a&&o)return 0}var u=r?i:n,c=-(u.range[0]1;y("percent initial")&&(d=a.formatPercent(p.begR),_&&(d+=" of initial"),g.push(d)),y("percent previous")&&(d=a.formatPercent(p.difR),_&&(d+=" of previous"),g.push(d)),y("percent total")&&(d=a.formatPercent(p.sumR),_&&(d+=" of total"),g.push(d))}return g.join("
")}(ew,eT,eA,eM):m.getValue(eS.text,eT),m.coerceString(v,ek));eE=eo,eD=s,eC=m.getValue(eE.textposition,eD),et=m.coerceEnumerated(x,eC);var ec="stack"===A.mode||"relative"===A.mode,eh=n[s],ed=!ec||eh._outmost,ef=eh.hasB,ep=y&&y-w>_;if(!eu||"none"===et||(eh.isBlank||u===h||f===g)&&("auto"===et||"inside"===et))return i.select("text").remove();var em=en.font,eg=p.getBarColor(n[s],eo),ey=p.getInsideTextFont(eo,s,em,eg),ev=p.getOutsideTextFont(eo,s,em),ex=eo.insidetextanchor||"end",eb=i.datum();es?"log"===er.type&&eb.s0<=0&&(u=er.range[0]0&&ez>0;eB=ep?ef?M(eO-2*y,eR,eP,ez,es)||M(eO,eR-2*y,eP,ez,es):es?M(eO-(y-w),eR,eP,ez,es)||M(eO,eR-2*(y-w),eP,ez,es):M(eO,eR-(y-w),eP,ez,es)||M(eO-2*(y-w),eR,eP,ez,es):M(eO,eR,eP,ez,es),ej&&eB?et="inside":(et="outside",eI.remove(),eI=null)}else et="inside";if(!eI){var eN=(eI=ea(i,eu,eF=a.ensureUniformFontSize(t,"outside"===et?ev:ey))).attr("transform");if(eI.attr("transform",""),eP=(eL=l.bBox(eI.node())).width,ez=eL.height,eI.attr("transform",eN),eP<=0||ez<=0)return eI.remove()}var eV,eU=eo.textangle;(eV="outside"===et?(C=u,I=h,L=f,P=g,z=eL,R=!!(F={isHorizontal:es,constrained:"both"===eo.constraintext||"outside"===eo.constraintext,angle:eU,zeroBarDir:el}).isHorizontal,B=!!F.constrained,j=F.angle||0,N=z.width,V=z.height,U=Math.abs(I-C),q=Math.abs(P-L),O=R?q>2*_?_:0:U>2*_?_:0,G=1,B&&(G=R?Math.min(1,q/V):Math.min(1,U/N)),W=E(z,$=S(j)),Y=(R?W.x:W.y)/2,Z=(z.left+z.right)/2,X=(z.top+z.bottom)/2,K=(C+I)/2,J=(L+P)/2,Q=0,ee=0,H=(R?C===I:L===P)&&F.zeroBarDir?F.zeroBarDir:R?I0?r+=i:h<0&&(r-=i)}return r}function z(t){var r=h,n=t.b,a=P(t);return i.inbox(n-r,a-r,w+(a-r)/(a-n)-1)}var F=t[d+"a"],O=t[f+"a"];g=Math.abs(F.r2c(F.range[1])-F.r2c(F.range[0]));var R=i.getDistanceFunction(a,p,m,function(t){return(p(t)+m(t))/2});if(i.getClosest(y,R,t),!1!==t.index&&y[t.index].p!==u){b||A||(D=function(t){return Math.min(M(t),t.p-x.bargroupwidth/2)},C=function(t){return Math.max(k(t),t.p+x.bargroupwidth/2)});var B,j,N,V=y[t.index],U=v.base?V.b+V.s:V.s;t[f+"0"]=t[f+"1"]=O.c2p(V[f],!0),t[f+"LabelVal"]=U;var q=x.extents[x.extents.round(V.p)];t[d+"0"]=F.c2p(b?D(V):q[0],!0),t[d+"1"]=F.c2p(b?C(V):q[1],!0);var G=void 0!==V.orig_p;return t[d+"LabelVal"]=G?V.orig_p:V.p,t.labelLabel=l(F,t[d+"LabelVal"],v[d+"hoverformat"]),t.valueLabel=l(O,t[f+"LabelVal"],v[f+"hoverformat"]),t.baseLabel=l(O,V.b,v[f+"hoverformat"]),B=h,j=V.b,N=P(V),t.spikeDistance=(i.inbox(j-B,N-B,T+(N-B)/(N-j)-1)+I(M(V),k(V),T))/2,t[d+"Spike"]=F.c2p(V.p,!0),o(V,v,t),t.hovertemplate=v.hovertemplate,t}}function h(t,r){var i=r.mcc||t.marker.color,n=r.mlcc||t.marker.line.color,o=s(t,r);return a.opacity(i)?i:a.opacity(n)&&o?n:void 0}r.exports={hoverPoints:function(t,r,i,a,o){var s=c(t,r,i,a,o);if(s){var l=s.cd,u=l[0].trace,d=l[s.index];return s.color=h(u,d),n.getComponentMethod("errorbars","hoverInfo")(d,u,s),[s]}},hoverOnBars:c,getTraceColor:h}}}),aO=g({"src/traces/bar/event_data.js"(t,r){r.exports=function(t,r,i){return t.x="xVal"in r?r.xVal:r.x,t.y="yVal"in r?r.yVal:r.y,r.xa&&(t.xaxis=r.xa),r.ya&&(t.yaxis=r.ya),"h"===i.orientation?(t.label=t.y,t.value=t.x):(t.label=t.x,t.value=t.y),t}}}),aR=g({"src/traces/bar/select.js"(t,r){r.exports=function(t,r){var i,n=t.cd,a=t.xaxis,o=t.yaxis,s=n[0].trace,l="funnel"===s.type,u="h"===s.orientation,c=[];if(!1===r)for(i=0;i0?(y="v",v=b>0?Math.min(w,_):Math.min(_)):b>0?(y="h",v=Math.min(w)):v=0;if(!v){r.visible=!1;return}r._length=v;var E=a("orientation",y);r._hasPreCompStats?"v"===E&&0===b?(a("x0",0),a("dx",1)):"h"===E&&0===x&&(a("y0",0),a("dy",1)):"v"===E&&0===b?a("x0"):"h"===E&&0===x&&a("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(t,r,["x","y"],o)}function h(t,r,n,a){var o=a.prefix,s=i.coerce2(t,r,u,"marker.outliercolor"),l=n("marker.line.outliercolor"),c="outliers";r._hasPreCompStats?c="all":(s||l)&&(c="suspectedoutliers");var h=n(o+"points",c);h?(n("jitter",.3*("all"===h)),n("pointpos","all"===h?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",r.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===h&&(n("marker.line.outliercolor",r.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete r.marker;var d=n("hoveron");("all"===d||-1!==d.indexOf("points"))&&(n("hovertemplate"),n("hovertemplatefallback")),i.coerceSelectionMarkerOpacity(r,n)}r.exports={supplyDefaults:function(t,r,n,s){function l(n,a){return i.coerce(t,r,u,n,a)}if(c(t,r,l,s),!1!==r.visible){o(t,r,s,l),l("xhoverformat"),l("yhoverformat");var d=r._hasPreCompStats;d&&(l("lowerfence"),l("upperfence")),l("line.color",(t.marker||{}).color||n),l("line.width"),l("fillcolor",a.addOpacity(r.line.color,.5));var f=!1;if(d){var p=l("mean"),m=l("sd");p&&p.length&&(f=!0,m&&m.length&&(f="sd"))}l("whiskerwidth");var g,y=l("sizemode");"quartiles"===y&&(g=l("boxmean",f)),l("showwhiskers","quartiles"===y),("sd"===y||"sd"===g)&&l("sdmultiple"),l("width"),l("quartilemethod");var v=!1;if(d){var x=l("notchspan");x&&x.length&&(v=!0)}else i.validate(t.notchwidth,u.notchwidth)&&(v=!0);l("notched",v)&&l("notchwidth"),h(t,r,l,{prefix:"box"}),l("zorder")}},crossTraceDefaults:function(t,r){var n,a;function o(t){return i.coerce(a._input,a,u,t)}for(var l=0;lD.uf};if(r._hasPreCompStats){var U=r[b],q=function(t){return x.d2c((r[t]||[])[u])},G=1/0,H=-1/0;for(u=0;u=D.q1&&D.q3>=D.med){var W,Y=q("lowerfence");D.lf=Y!==s&&Y<=D.q1?Y:f(D,I,L);var Z=q("upperfence");D.uf=Z!==s&&Z>=D.q3?Z:p(D,I,L);var X=q("mean");D.mean=X!==s?X:L?o.mean(I,L):(D.q1+D.q3)/2;var K=q("sd");D.sd=X!==s&&K>=0?K:L?o.stdev(I,L,D.mean):D.q3-D.q1,D.lo=m(D),D.uo=g(D);var J=q("notchspan");J=J!==s&&J>0?J:y(D,L),D.ln=D.med-J,D.un=D.med+J;var Q=D.lf,ee=D.uf;r.boxpoints&&I.length&&(Q=Math.min(Q,I[0]),ee=Math.max(ee,I[L-1])),r.notched&&(Q=Math.min(Q,D.ln),ee=Math.max(ee,D.un)),D.min=Q,D.max=ee}else o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+D.q1,"median = "+D.med,"q3 = "+D.q3].join(` -`)),W=D.med!==s?D.med:D.q1!==s?D.q3!==s?(D.q1+D.q3)/2:D.q1:D.q3!==s?D.q3:0,D.med=W,D.q1=D.q3=W,D.lf=D.uf=W,D.mean=D.sd=W,D.ln=D.un=W,D.min=D.max=W;G=Math.min(G,D.min),H=Math.max(H,D.max),D.pts2=C.filter(V),S.push(D)}}r._extremes[x._id]=n.findExtremes(x,[G,H],{padded:!0})}else{var et,er,ei=x.makeCalcdata(r,b),en=function(t,r){for(var i=t.length,n=Array(i+1),a=0;a=0&&es0){((D={}).pos=D[w]=j[u],C=D.pts=eo[u].sort(h),L=(I=D[b]=C.map(d)).length,D.min=I[0],D.max=I[L-1],D.mean=o.mean(I,L),D.sd=o.stdev(I,L,D.mean)*r.sdmultiple,D.med=o.interp(I,.5),L%2&&(eh||ed))?(eh?(et=I.slice(0,L/2),er=I.slice(L/2+1)):ed&&(et=I.slice(0,L/2+1),er=I.slice(L/2)),D.q1=o.interp(et,.5),D.q3=o.interp(er,.5)):(D.q1=o.interp(I,.25),D.q3=o.interp(I,.75)),D.lf=f(D,I,L),D.uf=p(D,I,L),D.lo=m(D),D.uo=g(D);var ef=y(D,L);D.ln=D.med-ef,D.un=D.med+ef,el=Math.min(el,D.ln),eu=Math.max(eu,D.un),D.pts2=C.filter(V),S.push(D)}r.notched&&o.isTypedArray(ei)&&(ei=Array.from(ei)),r._extremes[x._id]=n.findExtremes(x,r.notched?ei.concat([el,eu]):ei,{padded:!0})}return function(t,r){if(o.isArrayOrTypedArray(r.selectedpoints))for(var i=0;i0?(S[0].t={num:A[E],dPos:N,posLetter:w,valLetter:b,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===r.boxmean||"sd"===r.sizemode?l(t,"mean \xb1 σ:").replace("σ",1===r.sdmultiple?"σ":r.sdmultiple+"σ"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},A[E]++,S):[{t:{empty:!0}}]};var u={text:"tx",hovertext:"htx"};function c(t,r,i){for(var n in u)o.isArrayOrTypedArray(r[n])&&(Array.isArray(i)?o.isArrayOrTypedArray(r[n][i[0]])&&(t[u[n]]=r[n][i[0]][i[1]]):t[u[n]]=r[n][i])}function h(t,r){return t.v-r.v}function d(t){return t.v}function f(t,r,i){return 0===i?t.q1:Math.min(t.q1,r[Math.min(o.findBin(2.5*t.q1-1.5*t.q3,r,!0)+1,i-1)])}function p(t,r,i){return 0===i?t.q3:Math.max(t.q3,r[Math.max(o.findBin(2.5*t.q3-1.5*t.q1,r),0)])}function m(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function y(t,r){return 0===r?0:1.57*(t.q3-t.q1)/Math.sqrt(r)}}}),aH=g({"src/traces/box/cross_trace_calc.js"(t,r){var i=rs(),n=t_(),a=ie().getAxisGroup,o=["v","h"];function s(t,r,o,s){var l,u,c,h=r.calcdata,d=r._fullLayout,f=s._id,p=f.charAt(0),m=[],g=0;for(l=0;l1,_=1-d[t+"gap"],w=1-d[t+"groupgap"];for(l=0;l0;if("positive"===C?(F=T*(D?1:.5),R=q,O=R=M):"negative"===C?(F=R=M,O=T*(D?1:.5),B=q):(F=O=T,R=B=q),H){var $=S.pointpos,W=S.jitter,Y=S.marker.size/2,Z=0;$+W>=0&&((Z=q*($+W))>F?(G=!0,V=Y,j=Z):Z>R&&(V=Y,j=F)),Z<=F&&(j=F);var X=0;$-W<=0&&((X=-q*($-W))>O?(G=!0,U=Y,N=X):X>B&&(U=Y,N=O)),X<=O&&(N=O)}else j=F,N=O;var K=Array(c.length);for(u=0;ut.lo&&(b.so=!0)}return o});f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(a.translatePoints,s,l)}function l(t,r,a,o){var s,l,u=r.val,c=r.pos,h=!!c.rangebreaks,d=o.bPos,f=o.bPosPxOffset||0,p=a.boxmean||(a.meanline||{}).visible;Array.isArray(o.bdPos)?(s=o.bdPos[0],l=o.bdPos[1]):(s=o.bdPos,l=o.bdPos);var m=t.selectAll("path.mean").data("box"===a.type&&a.boxmean||"violin"===a.type&&a.box.visible&&a.meanline.visible?n.identity:[]);m.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),m.exit().remove(),m.each(function(t){var r=c.c2l(t.pos+d,!0),n=c.l2p(r-s)+f,o=c.l2p(r+l)+f,m=h?(n+o)/2:c.l2p(r)+f,g=u.c2p(t.mean,!0),y=u.c2p(t.mean-t.sd,!0),v=u.c2p(t.mean+t.sd,!0);"h"===a.orientation?i.select(this).attr("d","M"+g+","+n+"V"+o+("sd"===p?"m0,0L"+y+","+m+"L"+g+","+n+"L"+v+","+m+"Z":"")):i.select(this).attr("d","M"+n+","+g+"H"+o+("sd"===p?"m0,0L"+m+","+y+"L"+n+","+g+"L"+m+","+v+"Z":""))})}r.exports={plot:function(t,r,a,u){var c=t._context.staticPlot,h=r.xaxis,d=r.yaxis;n.makeTraceGroups(u,a,"trace boxes").each(function(t){var r,n,a=i.select(this),u=t[0],f=u.t,p=u.trace;(f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty)?a.remove():("h"===p.orientation?(r=d,n=h):(r=h,n=d),o(a,{pos:r,val:n},p,f,c),s(a,{x:h,y:d},p,f),l(a,{pos:r,val:n},p,f))})},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}}}),aW=g({"src/traces/box/style.js"(t,r){var i=k(),n=ei(),a=rr();r.exports={style:function(t,r,o){var s=o||i.select(t).selectAll("g.trace.boxes");s.style("opacity",function(t){return t[0].trace.opacity}),s.each(function(r){var o=i.select(this),s=r[0].trace,l=s.line.width;function u(t,r,i,a){t.style("stroke-width",r+"px").call(n.stroke,i).call(n.fill,a)}var c=o.selectAll("path.box");if("candlestick"===s.type)c.each(function(t){if(!t.empty){var r=i.select(this),n=s[t.dir];u(r,n.line.width,n.line.color,n.fillcolor),r.style("opacity",s.selectedpoints&&!t.selected?.3:1)}});else{u(c,l,s.line.color,s.fillcolor),o.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(n.stroke,s.line.color);var h=o.selectAll("path.point");a.pointStyle(h,s,t)}})},styleOnSelect:function(t,r,i){var n=r[0].trace,o=i.selectAll("path.point");n.selectedpoints?a.selectedPointStyle(o,n):a.pointStyle(o,n,t)}}}}),aY=g({"src/traces/box/hover.js"(t,r){var i=rs(),n=t_(),a=rR(),o=ei(),s=n.fillText;function l(t,r,s,l){var u,c,h,d,f,p,m,g,y,v,x,b,_,w,T=t.cd,A=t.xa,M=t.ya,k=T[0].trace,S=T[0].t,E="violin"===k.type,D=S.bdPos,C=S.wHover,I=function(t){return d.c2l(t.pos)+S.bPos-d.c2l(m)};E&&"both"!==k.side?("positive"===k.side&&(v=function(t){var r=I(t);return a.inbox(r,r+C,x)},_=D,w=0),"negative"===k.side&&(v=function(t){var r=I(t);return a.inbox(r-C,r,x)},_=0,w=D)):(v=function(t){var r=I(t);return a.inbox(r-C,r+C,x)},_=w=D),u=E?function(t){return a.inbox(t.span[0]-p,t.span[1]-p,x)}:function(t){return a.inbox(t.min-p,t.max-p,x)},"h"===k.orientation?(p=r,m=s,g=u,y=v,c="y",d=M,h="x",f=A):(p=s,m=r,g=v,y=u,c="x",d=A,h="y",f=M);var L=Math.min(1,D/Math.abs(d.r2c(d.range[1])-d.r2c(d.range[0])));function P(t){return(g(t)+y(t))/2}x=t.maxHoverDistance-L,b=t.maxSpikeDistance-L;var z=a.getDistanceFunction(l,g,y,P);if(a.getClosest(T,z,t),!1===t.index)return[];var F=T[t.index],O=k.line.color,R=(k.marker||{}).color;o.opacity(O)&&k.line.width?t.color=O:o.opacity(R)&&k.boxpoints?t.color=R:t.color=k.fillcolor,t[c+"0"]=d.c2p(F.pos+S.bPos-w,!0),t[c+"1"]=d.c2p(F.pos+S.bPos+_,!0),t[c+"LabelVal"]=void 0!==F.orig_p?F.orig_p:F.pos;var B=c+"Spike";t.spikeDistance=P(F)*b/x,t[B]=d.c2p(F.pos,!0);var j=k.boxmean||"sd"===k.sizemode||(k.meanline||{}).visible,N=k.boxpoints||k.points,V=N&&j?["max","uf","q3","med","mean","q1","lf","min"]:N&&!j?["max","uf","q3","med","q1","lf","min"]:!N&&j?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=f.range[1]0&&(o=!0);for(var u=0;uo){var s=o-n[t];return n[t]=o,s}}return 0},max:function(t,r,n,a){var o=a[r];if(i(o)){if(o=Number(o),!i(n[t]))return n[t]=o,o;else if(n[t]o){var u=f(r,s,l),c=f(i,s,l),h=+(t!==n);return u[h]!==c[h]}return Math.floor(i/t)-Math.floor(r/t)>.1}(h,t,r,l,i,a))u=h;else break}return u}function d(t,r){return r&&t>u?t>o?t>1.1*n?n:t>1.1*a?a:o:t>s?s:t>l?l:u:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function f(t,r,i){var a=r.c2d(t,n,i).split("-");return""===a[0]&&(a.unshift(),a[0]="-"+a[0]),a}r.exports=function(t,r,i,a,s){var l,u,d=-1.1*r,f=-.1*r,p=t-f,m=i[0],g=i[1],y=Math.min(h(m+f,m+p,a,s),h(g+f,g+p,a,s)),v=Math.min(h(m+d,m+f,a,s),h(g+d,g+f,a,s));if(y>v&&vo){var x=l===n?1:6,b=l===n?"M12":"M1";return function(r,i){var o=a.c2d(r,n,s),l=o.indexOf("-",x);l>0&&(o=o.slice(0,l));var h=a.d2c(o,0,s);if(hs.r2l(j)&&(V=o.tickIncrement(V,w.size,!0,m)),F.start=s.l2r(V),B||n.nestedProperty(r,x+".start").set(F.start)}var U=w.end,q=s.r2l(z.end),G=void 0!==q;if((w.endFound||G)&&q!==s.r2l(U)){var H=G?q:n.aggNums(Math.max,null,g);F.end=s.l2r(H),G||n.nestedProperty(r,x+".start").set(F.end)}var $="autobin"+l;return!1===r._input[$]&&(r._input[x]=n.extendFlat({},r[x]||{}),delete r._input[$],delete r[$]),[F,g]}r.exports={calc:function(t,r){var a,m,g,y,v,x=[],b=[],_="h"===r.orientation,w=o.getFromId(t,_?r.yaxis:r.xaxis),T=_?"y":"x",A={x:"y",y:"x"}[T],M=r[T+"calendar"],k=r.cumulative,S=p(t,r,w,T),E=S[0],D=S[1],C="string"==typeof E.size,I=[],L=C?I:E,P=[],z=[],F=[],O=0,R=r.histnorm,B=r.histfunc,j=-1!==R.indexOf("density");k.enabled&&j&&(R=R.replace(/ ?density$/,""),j=!1);var N,V="max"===B||"min"===B?null:0,U=c.count,q=h[R],G=!1,H=function(t){return w.r2c(t,0,M)};for(n.isArrayOrTypedArray(r[A])&&"count"!==B&&(N=r[A],G="avg"===B,U=c[B]),m=H(E.start),y=H(E.end)+(m-o.tickIncrement(m,E.size,!1,M))/1e6;m=0&&v=0;n--)l(n);else if("increasing"===r){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===i&&(t.push(0),t.shift())}}(b,k.direction,k.currentbin);var ee=Math.min(x.length,b.length),et=[],er=0,ei=ee-1;for(m=0;m=er;m--)if(b[m]){ei=m;break}for(m=er;m<=ei;m++)if(i(x[m])&&i(b[m])){var en={p:x[m],s:b[m],b:0};k.enabled||(en.pts=F[m],Z?en.ph0=en.ph1=F[m].length?D[F[m][0]]:x[m]:(r._computePh=!0,en.ph0=a(I[m]),en.ph1=a(I[m+1],!0))),et.push(en)}return 1===et.length&&(et[0].width1=o.tickIncrement(et[0].p,E.size,!1,M)-et[0].p),s(r,"marker")&&l(t,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),s(r,"marker.line")&&l(t,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}),u(et,r),n.isArrayOrTypedArray(r.selectedpoints)&&n.tagSelected(et,r,J),et},calcAllAutoBins:p}}}),a9=g({"src/traces/histogram2d/calc.js"(t,r){var i=t_(),n=rs(),a=a5(),o=a4(),s=a6(),l=a8(),u=a7().calcAllAutoBins;function c(t,r,i,n){var a,o=Array(t);if(n)for(a=0;aC&&k.splice(C,k.length-C),D.length>C&&D.splice(C,D.length-C);var I=[],L=[],P=[],z="string"==typeof M.size,F="string"==typeof E.size,O=[],R=[],B=z?O:M,j=F?R:E,N=0,V=[],U=[],q=r.histnorm,G=r.histfunc,H=-1!==q.indexOf("density"),$="max"===G||"min"===G?null:0,W=a.count,Y=o[q],Z=!1,X=[],K=[],J="z"in r?r.z:"marker"in r&&Array.isArray(r.marker.color)?r.marker.color:"";J&&"count"!==G&&(Z="avg"===G,W=a[G]);var Q=M.size,ee=w(M.start),et=w(M.end)+(ee-n.tickIncrement(ee,Q,!1,b))/1e6;for(p=ee;p=0&&g=0&&yg&&(v=Math.max(v,Math.abs(t[o][s]-m)/(y-g))))}return v}r.exports=function(t,r){var n,o=1;for(a(t,r),n=0;n.01;n++)o=a(t,r,.5-.25*Math.min(1,.5*o));return o>.01&&i.log("interp2d didn't converge quickly",o),t}}}),oi=g({"src/traces/heatmap/find_empties.js"(t,r){var i=t_().maxRowLength;r.exports=function(t){var r,n,a,o,s,l,u,c,h=[],d={},f=[],p=t[0],m=[],g=[0,0,0],y=i(t);for(n=0;n=0;s--)(l=((d[[(n=(o=f[s])[0])-1,a=o[1]]]||g)[2]+(d[[n+1,a]]||g)[2]+(d[[n,a-1]]||g)[2]+(d[[n,a+1]]||g)[2])/20)&&(u[o]=[n,a,l],f.splice(s,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(o in u)d[o]=u[o],h.push(u[o])}return h.sort(function(t,r){return r[2]-t[2]})}}}),on=g({"src/traces/heatmap/make_bound_array.js"(t,r){var i=e2(),n=t_().isArrayOrTypedArray;r.exports=function(t,r,a,o,s,l){var u,c,h,d=[],f=i.traceIs(t,"contour"),p=i.traceIs(t,"histogram");if(n(r)&&r.length>1&&!p&&"category"!==l.type){var m=r.length;if(!(m<=s))return f?r.slice(0,s):r.slice(0,s+1);if(f)d=Array.from(r).slice(0,s);else if(1===s)d="log"===l.type?[.5*r[0],2*r[0]]:[r[0]-.5,r[0]+.5];else if("log"===l.type){for(d=[Math.pow(r[0],1.5)/Math.pow(r[1],.5)],h=1;h1){var r=(t[t.length-1]-t[0])/(t.length-1),i=Math.abs(r/100);for(M=0;Mi)return!1}return!0}(S.rangebreaks||E.rangebreaks)&&(A=function(t,r,i){for(var n=[],a=-1,o=0;o0;)A=M.c2p(j[C]),C--;for(A0;)D=k.c2p(N[C]),C--;D=M._length||A<=0||E>=k._length||D<=0){P.selectAll("image").data([]).exit().remove(),x(P);return}"fast"===Z?(ee=$,et=H):(ee=K,et=J);var Q=document.createElement("canvas");Q.width=ee,Q.height=et;var ee,et,er,ei,en=Q.getContext("2d",{willReadFrequently:!0}),ea=d(F,{noNumericCheck:!0,returnArray:!0});"fast"===Z?(er=W?function(t){return $-1-t}:s.identity,ei=Y?function(t){return H-1-t}:s.identity):(er=function(t){return s.constrain(Math.round(M.c2p(j[t])-T),0,K)},ei=function(t){return s.constrain(Math.round(k.c2p(N[t])-E),0,J)});var eo,es,el,eu,ec=ei(0),eh=[ec,ec],ed=+!W,ef=+!Y,ep=0,em=0,eg=0,ey=0;function ev(t,r=0){if(void 0===t)return[0,0,0,0];var i=ea(t);return i[0]=Math.round(i[0]),i[1]=Math.round(i[1]),i[2]=Math.round(i[2]),ep+=r,em+=i[0]*r,eg+=i[1]*r,ey+=i[2]*r,i}if("default"!==Z){var ex,eb=0;try{ex=new Uint8Array(ee*et*4)}catch{ex=Array(ee*et*4)}if("smooth"===Z){var e_,ew,eT,eA=V||j,eM=U||N,ek=Array(eA.length),eS=Array(eM.length),eE=Array(K),eD=V?_:b,eC=U?_:b;for(C=0;CeW||eW>k._length))for(I=eG;IeX||eX>M._length)){var eK=u({x:eZ,y:eY},F,t._fullLayout);eK.x=eZ,eK.y=eY;var eJ=z.z[C][I];void 0===eJ?(eK.z="",eK.zLabel=""):(eK.z=eJ,eK.zLabel=o.tickText(ej,eJ,"hover").text);var eQ=z.text&&z.text[C]&&z.text[C][I];(void 0===eQ||!1===eQ)&&(eQ=""),eK.text=eQ;var e0=s.texttemplateString({data:[eK,F._meta],fallback:F.texttemplatefallback,labels:eK,locale:t._fullLayout._d3locale,template:eR});if(e0){var e1=e0.split("
"),e2=e1.length,e3=0;for(L=0;L=w[0].length||p<0||p>w.length)return}else{if(i.inbox(r-b[0],r-b[b.length-1],0)>0||i.inbox(l-_[0],l-_[_.length-1],0)>0)return;if(m){for(S=[2*b[0]-b[1]],D=1;D=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),oC=g({"src/traces/contour/attributes.js"(t,r){var i=aQ(),n=iw(),a=tU(),o=a.axisHoverFormat,s=a.descriptionOnlyNumbers,l=tH(),u=eW().dash,c=W(),h=$().extendFlat,d=oD(),f=d.COMPARISON_OPS2,p=d.INTERVAL_OPS,m=n.line;r.exports=h({z:i.z,x:i.x,x0:i.x0,dx:i.dx,y:i.y,y0:i.y0,dy:i.dy,xperiod:i.xperiod,yperiod:i.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:i.xperiodalignment,yperiodalignment:i.yperiodalignment,text:i.text,hovertext:i.hovertext,transpose:i.transpose,xtype:i.xtype,ytype:i.ytype,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:i.hovertemplate,hovertemplatefallback:i.hovertemplatefallback,texttemplate:h({},i.texttemplate,{}),texttemplatefallback:i.texttemplatefallback,textfont:h({},i.textfont,{}),hoverongaps:i.hoverongaps,connectgaps:h({},i.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:s("contour label")},operation:{valType:"enumerated",values:[].concat(f).concat(p),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:h({},m.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:u,smoothing:h({},m.smoothing,{}),editType:"plot"},zorder:n.zorder},l("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),oI=g({"src/traces/histogram2dcontour/attributes.js"(t,r){var i=oT(),n=oC(),a=tH(),o=tU().axisHoverFormat,s=$().extendFlat;r.exports=s({x:i.x,y:i.y,z:i.z,marker:i.marker,histnorm:i.histnorm,histfunc:i.histfunc,nbinsx:i.nbinsx,xbins:i.xbins,nbinsy:i.nbinsy,ybins:i.ybins,autobinx:i.autobinx,autobiny:i.autobiny,bingroup:i.bingroup,xbingroup:i.xbingroup,ybingroup:i.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:s({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:i.hovertemplate,hovertemplatefallback:i.hovertemplatefallback,texttemplate:n.texttemplate,texttemplatefallback:n.texttemplatefallback,textfont:n.textfont},a("",{cLetter:"z",editTypeOverride:"calc"}))}}),oL=g({"src/traces/contour/contours_defaults.js"(t,r){r.exports=function(t,r,i,n){var a=n("contours.start"),o=n("contours.end"),s=i("contours.size");((!1===a||!1===o?r.autocontour=!0:i("autocontour",!1))||!s)&&i("ncontours")}}}),oP=g({"src/traces/contour/label_defaults.js"(t,r){var i=t_();r.exports=function(t,r,n,a){if(a||(a={}),t("contours.showlabels")){var o=r.font;i.coerceFont(t,"contours.labelfont",o,{overrideDflt:{color:n}}),t("contours.labelformat")}!1!==a.hasHover&&t("zhoverformat")}}}),oz=g({"src/traces/contour/style_defaults.js"(t,r){var i=t2(),n=oP();r.exports=function(t,r,a,o,s){var l,u=a("contours.coloring"),c="";"fill"===u&&(l=a("contours.showlines")),!1!==l&&("lines"!==u&&(c=a("line.color","#000")),a("line.width",.5),a("line.dash")),"none"!==u&&(!0!==t.showlegend&&(r.showlegend=!1),r._dfltShowLegend=!1,i(t,r,o,a,{prefix:"",cLetter:"z"})),a("line.smoothing"),n(a,o,c,s)}}}),oF=g({"src/traces/histogram2dcontour/defaults.js"(t,r){var i=t_(),n=oA(),a=oL(),o=oz(),s=a1(),l=oI();r.exports=function(t,r,u,c){function h(n,a){return i.coerce(t,r,l,n,a)}n(t,r,h,c),!1!==r.visible&&(a(t,r,h,function(n){return i.coerce2(t,r,l,n)}),o(t,r,h,c),h("xhoverformat"),h("yhoverformat"),h("hovertemplate"),h("hovertemplatefallback"),r.contours&&"heatmap"===r.contours.coloring&&s(h,c))}}}),oO=g({"src/traces/contour/set_contours.js"(t,r){var i=rs(),n=t_();function a(t,r,n){var a={type:"linear",range:[t,r]};return i.autoTicks(a,(r-t)/(n||15)),a}r.exports=function(t,r){var o=t.contours;if(t.autocontour){var s=t.zmin,l=t.zmax;(t.zauto||void 0===s)&&(s=n.aggNums(Math.min,null,r)),(t.zauto||void 0===l)&&(l=n.aggNums(Math.max,null,r));var u=a(s,l,t.ncontours);o.size=u.dtick,o.start=i.tickFirst(u),u.range.reverse(),o.end=i.tickFirst(u),o.start===s&&(o.start+=o.size),o.end===l&&(o.end-=o.size),o.start>o.end&&(o.start=o.end=(o.start+o.end)/2),t._input.contours||(t._input.contours={}),n.extendFlat(t._input.contours,{start:o.start,end:o.end,size:o.size}),t._input.autocontour=!0}else if("constraint"!==o.type){var c=o.start,h=o.end,d=t._input.contours;c>h&&(o.start=d.start=h,h=o.end=d.end=c,c=o.start),o.size>0||(d.size=o.size=c===h?1:a(c,h,t.ncontours).dtick)}}}}),oR=g({"src/traces/contour/end_plus.js"(t,r){r.exports=function(t){return t.end+t.size/1e6}}}),oB=g({"src/traces/contour/calc.js"(t,r){var i=t6(),n=oa(),a=oO(),o=oR();r.exports=function(t,r){var s=n(t,r),l=s[0].z;a(r,l);var u,c=r.contours,h=i.extractOpts(r);if("heatmap"===c.coloring&&h.auto&&!1===r.autocontour){var d=c.start,f=o(c),p=c.size||1,m=Math.floor((f-d)/p)+1;isFinite(p)||(p=1,m=1);var g=d-p/2,y=g+m*p;u=[g,y]}else u=l;return i.calc(t,r,{vals:u,cLetter:"z"}),s}}}),oj=g({"src/traces/contour/constants.js"(t,r){r.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),oN=g({"src/traces/contour/make_crossings.js"(t,r){var i=oj();r.exports=function(t){var r,n,a,o,s,l,u,c,h,d=t[0].z,f=d.length,p=d[0].length,m=2===f||2===p;for(n=0;nt?0:1)+(r[0][1]>t?0:2)+(r[1][1]>t?0:4)+(r[1][0]>t?0:8);return 5===i||10===i?t>(r[0][0]+r[0][1]+r[1][0]+r[1][1])/4?5===i?713:1114:5===i?104:208:15===i?0:i}((c=t[h]).level,l))&&(c.crossings[s]=u,-1!==a.indexOf(u)&&(c.starts.push([r,n]),m&&-1!==a.indexOf(u,a.indexOf(u)+1)&&c.starts.push([r,n])))}}}),oV=g({"src/traces/contour/find_all_paths.js"(t,r){var i=t_(),n=oj();function a(t,r,i,n){return Math.abs(t[0]-r[0])20&&h?208===c||1114===c?f=0===d[0]?1:-1:p=0===d[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(c)?p=1:-1!==n.LEFTSTART.indexOf(c)?f=1:-1!==n.TOPSTART.indexOf(c)?p=-1:f=-1,[f,p]),x=[s(t,r,[-v[0],-v[1]])],b=t.z.length,_=t.z[0].length,w=r.slice(),T=v.slice();for(m=0;m<1e4;m++){if(y>20?(y=n.CHOOSESADDLE[y][0>(v[0]||v[1])?0:1],t.crossings[g]=n.SADDLEREMAINDER[y]):delete t.crossings[g],!(v=n.NEWDELTA[y])){i.log("Found bad marching index:",y,r,t.level);break}x.push(s(t,r,v)),r[0]+=v[0],r[1]+=v[1],g=r.join(","),a(x[x.length-1],x[x.length-2],l,u)&&x.pop();var A=v[0]&&(r[0]<0||r[0]>_-2)||v[1]&&(r[1]<0||r[1]>b-2);if(r[0]===w[0]&&r[1]===w[1]&&v[0]===T[0]&&v[1]===T[1]||o&&A)break;y=t.crossings[g]}1e4===m&&i.log("Infinite loop in contour?");var M,k,S,E,D,C,I,L,P,z,F,O=a(x[0],x[x.length-1],l,u),R=0,B=.2*t.smoothing,j=[],N=0;for(m=1;m=N;m--)if((M=j[m])=N&&M+j[k]L&&P--,t.edgepaths[P]=F.concat(x,z));break}G||(t.edgepaths[L]=x.concat(z))}for(L=0;L":s(">"),"<":s("<"),"=":s("=")}}}),oq=g({"src/traces/contour/empty_pathinfo.js"(t,r){var i=t_(),n=oU(),a=oR();r.exports=function(t,r,o){for(var s="constraint"===t.type?n[t._operation](t.value):t,l=s.size,u=[],c=a(s),h=o.trace._carpetTrace,d=h?{xaxis:h.aaxis,yaxis:h.baxis,x:o.a,y:o.b}:{xaxis:r.xaxis,yaxis:r.yaxis,x:o.x,y:o.y},f=s.start;f1e3){i.warn("Too many contours, clipping at 1000",t);break}return u}}}),oG=g({"src/traces/contour/convert_to_constraints.js"(t,r){var i=t_();function n(t){return i.extendFlat({},t,{edgepaths:i.extendDeep([],t.edgepaths),paths:i.extendDeep([],t.paths),starts:i.extendDeep([],t.starts)})}r.exports=function(t,r){var a,o,s,l=function(t){return t.reverse()},u=function(t){return t};switch(r){case"=":case"<":return t;case">":for(1!==t.length&&i.warn("Contour data invalid for the specified inequality operation."),o=t[0],a=0;as.level||s.starts.length&&o===s.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var l=n.x.length,u=n.y.length,c=-1/0,h=1/0;for(i=0;i":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&f===h)&&(n.prefixBoundary=!0);break;case"][":d=Math.min(p[0],p[1]),f=Math.max(p[0],p[1]),dc&&(n.prefixBoundary=!0)}}}}}),o$=g({"src/traces/contour/plot.js"(t){var r=k(),i=t_(),n=rr(),a=t6(),o=tN(),s=rs(),l=rn(),u=ol(),c=oN(),h=oV(),d=oq(),f=oG(),p=oH(),m=oj(),g=m.LABELOPTIMIZER;function y(t,r){var a,o,s,l,u,c,h="",d=0,f=t.edgepaths.map(function(t,r){return r}),p=!0;function m(t){return .01>Math.abs(t[0]-r[2][0])}for(;f.length;){for(c=n.smoothopen(t.edgepaths[d],t.smoothing),h+=p?c:c.replace(/^M/,"L"),f.splice(f.indexOf(d),1),a=t.edgepaths[d][t.edgepaths[d].length-1],l=-1,s=0;s<4;s++){if(!a){i.log("Missing end?",d,t);break}for(.01>Math.abs(a[1]-r[0][1])&&!m(a)?o=r[1]:.01>Math.abs(a[0]-r[0][0])?o=r[0]:.01>Math.abs(a[1]-r[2][1])?o=r[3]:m(a)&&(o=r[2]),u=0;uMath.abs(a[0]-o[0])?.01>Math.abs(a[0]-g[0])&&(g[1]-a[1])*(o[1]-g[1])>=0&&(o=g,l=u):.01>Math.abs(a[1]-o[1])?.01>Math.abs(a[1]-g[1])&&(g[0]-a[0])*(o[0]-g[0])>=0&&(o=g,l=u):i.log("endpt to newendpt is not vert. or horz.",a,o,g)}if(a=o,l>=0)break;h+="L"+o}if(l===t.edgepaths.length){i.log("unclosed perimeter path");break}d=l,(p=-1===f.indexOf(d))&&(d=f[0],h+="Z")}for(d=0;da.center?a.right-l:l-a.left)/(h+Math.abs(Math.sin(c)*s)),p=(u>a.middle?a.bottom-u:u-a.top)/(Math.abs(d)+Math.cos(c)*s);if(f<1||p<1)return 1/0;var m=g.EDGECOST*(1/(f-1)+1/(p-1));m+=g.ANGLECOST*c*c;for(var y=l-h,v=u-d,x=l+h,b=u+d,_=0;_2*g.MAXCOST)break;p&&(l/=2),u=(s=c-l/2)+1.5*l}if(f<=g.MAXCOST)return h},t.addLabelData=function(t,r,i,n){var a=r.fontSize,o=r.width+a/3,s=Math.max(0,r.height-a/3),l=t.x,u=t.y,c=t.theta,h=Math.sin(c),d=Math.cos(c),f=function(t,r){return[l+t*d-r*h,u+t*h+r*d]},p=[f(-o/2,-s/2),f(-o/2,s/2),f(o/2,s/2),f(o/2,-s/2)];i.push({text:r.text,x:l,y:u,dy:r.dy,theta:c,level:r.level,width:o,height:s}),n.push(p)},t.drawLabels=function(t,n,a,s,l){var u=t.selectAll("text").data(n,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(u.exit().remove(),u.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var i=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;r.select(this).text(t.text).attr({x:i,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+i+" "+n+")"}).call(o.convertToTspans,a)}),l){for(var c="",h=0;h=x)&&(o<=v&&(o=v),s>=x&&(s=x),u=Math.floor((s-o)/l)+1,c=0),f=0;fv&&(g.unshift(v),y.unshift(y[0])),g[g.length-1]2?m.value=m.value.slice(2):0===m.length?m.value=[0,1]:m.length<2?(g=parseFloat(m.value[0]),m.value=[g,g+1]):m.value=[parseFloat(m.value[0]),parseFloat(m.value[1])]:i(m.value)&&(g=parseFloat(m.value),m.value=[g,g+1])):(p("contours.value",0),i(m.value)||(u(m.value)?m.value=parseFloat(m.value[0]):m.value=0)),"="===_?y=b.showlines=!0:(y=a("contours.showlines"),x=a("fillcolor",o((t.line||{}).color||d,.5))),y&&(v=a("line.color",x&&s(x)?o(r.fillcolor,1):d),a("line.width",2),a("line.dash")),a("line.smoothing"),n(a,l,v,f)}}}),o0=g({"src/traces/contour/defaults.js"(t,r){var i=t_(),n=a0(),a=iG(),o=oQ(),s=oL(),l=oz(),u=a1(),c=oC();r.exports=function(t,r,h,d){function f(n,a){return i.coerce(t,r,c,n,a)}if(!n(t,r,f,d)){r.visible=!1;return}a(t,r,d,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate"),f("hovertemplatefallback");var p="constraint"===f("contours.type");f("connectgaps",i.isArray1D(r.z)),p?o(t,r,f,d,h):(s(t,r,f,function(n){return i.coerce2(t,r,c,n)}),l(t,r,f,d)),r.contours&&"heatmap"===r.contours.coloring&&u(f,d),f("zorder")}}}),o1=g({"src/traces/contour/index.js"(t,r){r.exports={attributes:oC(),supplyDefaults:o0(),calc:oB(),plot:o$().plot,style:oY(),colorbar:oZ(),hoverPoints:oX(),moduleType:"trace",name:"contour",basePlotModule:ny(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),o2=g({"lib/contour.js"(t,r){r.exports=o1()}}),o3=g({"src/traces/scatterternary/attributes.js"(t,r){var{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=eZ(),o=i_(),s=iw(),l=K(),u=tH(),c=eW().dash,h=$().extendFlat,d=s.marker,f=s.line,p=d.line;r.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:h({},s.mode,{dflt:"markers"}),text:h({},s.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:a({editType:"plot"}),hovertext:h({},s.hovertext,{}),line:{color:f.color,width:f.width,dash:c,backoff:f.backoff,shape:h({},f.shape,{values:["linear","spline"]}),smoothing:f.smoothing,editType:"calc"},connectgaps:s.connectgaps,cliponaxis:s.cliponaxis,fill:h({},s.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o(),marker:h({symbol:d.symbol,opacity:d.opacity,angle:d.angle,angleref:d.angleref,standoff:d.standoff,maxdisplayed:d.maxdisplayed,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode,line:h({width:p.width,dash:p.dash,editType:"calc"},u("marker.line")),gradient:d.gradient,editType:"calc"},u("marker")),textfont:s.textfont,textposition:s.textposition,selected:s.selected,unselected:s.unselected,hoverinfo:h({},l.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:s.hoveron,hovertemplate:i(),hovertemplatefallback:a()}}}),o5=g({"src/traces/scatterternary/defaults.js"(t,r){var i=t_(),n=ib(),a=t8(),o=i$(),s=iW(),l=iY(),u=iZ(),c=iX(),h=o3();r.exports=function(t,r,d,f){function p(n,a){return i.coerce(t,r,h,n,a)}var m,g=p("a"),y=p("b"),v=p("c");if(g?(m=g.length,y?(m=Math.min(m,y.length),v&&(m=Math.min(m,v.length))):m=v?Math.min(m,v.length):0):y&&v&&(m=Math.min(y.length,v.length)),!m){r.visible=!1;return}r._length=m,p("sum"),p("text"),p("hovertext"),"fills"!==r.hoveron&&(p("hovertemplate"),p("hovertemplatefallback")),p("mode",m"),s.hovertemplate=f.hovertemplate,o}function b(t,r){v.push(t._hovertitle+": "+r)}}}}),o9=g({"src/traces/scatterternary/event_data.js"(t,r){r.exports=function(t,r,i,n,a){if(r.xa&&(t.xaxis=r.xa),r.ya&&(t.yaxis=r.ya),n[a]){var o=n[a];t.a=o.a,t.b=o.b,t.c=o.c}else t.a=r.a,t.b=r.b,t.c=r.c;return t}}}),se=g({"src/plots/ternary/ternary.js"(t,r){var i=k(),n=e2(),a=t_(),o=a.strTranslate,s=a._,l=ei(),u=rr(),c=rn(),h=$().extendFlat,d=tR(),f=rs(),p=rm(),m=rR(),g=rB(),y=g.freeMode,v=g.rectMode,x=ri(),b=iS().prepSelect,_=iS().selectOnClick,w=iS().clearOutline,T=iS().clearSelectionsCache,A=tI();function M(t,r){this.id=t.id,this.graphDiv=t.graphDiv,this.init(r),this.makeFramework(r),this.updateFx(r),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}r.exports=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,r){var i=r[this.id],n=r._size;this._hasClipOnAxisFalse=!1;for(var a=0;aE*_?a=(s=_)*E:s=(a=b)/E,d=v*a/b,f=x*s/_,i=r.l+r.w*g-a/2,n=r.t+r.h*(1-y)-s/2,p.x0=i,p.y0=n,p.w=a,p.h=s,p.sum=w,p.xaxis={type:"linear",range:[T+2*M-w,w-T-2*A],domain:[g-d/2,g+d/2],_id:"x"},c(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(t){return t.a>=p.aaxis.range[0]&&t.a<=p.aaxis.range[1]&&t.b>=p.baxis.range[1]&&t.b<=p.baxis.range[0]&&t.c>=p.caxis.range[1]&&t.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[T,w-A-M],domain:[y-f/2,y+f/2],_id:"y"},c(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var k=p.yaxis.domain[0],S=p.aaxis=h({},t.aaxis,{range:[T,w-A-M],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+f*E],anchor:"free",position:0,_id:"y",_length:a});c(S,p.graphDiv._fullLayout),S.setScale();var D=p.baxis=h({},t.baxis,{range:[w-T-M,A],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});c(D,p.graphDiv._fullLayout),D.setScale();var C=p.caxis=h({},t.caxis,{range:[w-T-A,M],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+f*E],anchor:"free",position:0,_id:"y",_length:a});c(C,p.graphDiv._fullLayout),C.setScale();var I="M"+i+","+(n+s)+"h"+a+"l-"+a/2+",-"+s+"Z";p.clipDef.select("path").attr("d",I),p.layers.plotbg.select("path").attr("d",I);var L="M0,"+s+"h"+a+"l-"+a/2+",-"+s+"Z";p.clipDefRelative.select("path").attr("d",L);var P=o(i,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),p.clipDefRelative.select("path").attr("transform",null);var z=o(i-D._offset,n+s);p.layers.baxis.attr("transform",z),p.layers.bgrid.attr("transform",z);var F=o(i+a/2,n)+"rotate(30)"+o(0,-S._offset);p.layers.aaxis.attr("transform",F),p.layers.agrid.attr("transform",F);var O=o(i+a/2,n)+"rotate(-30)"+o(0,-C._offset);p.layers.caxis.attr("transform",O),p.layers.cgrid.attr("transform",O),p.drawAxes(!0),p.layers.aline.select("path").attr("d",S.showline?"M"+i+","+(n+s)+"l"+a/2+",-"+s:"M0,0").call(l.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",D.showline?"M"+i+","+(n+s)+"h"+a:"M0,0").call(l.stroke,D.linecolor||"#000").style("stroke-width",(D.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",C.showline?"M"+(i+a/2)+","+n+"l"+a/2+","+s:"M0,0").call(l.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var r=this.graphDiv,i=this.id.slice(7)+"title",n=this.layers,a=this.aaxis,o=this.baxis,l=this.caxis;if(this.drawAx(a),this.drawAx(o),this.drawAx(l),t){var u=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),c=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;n["a-title"]=x.draw(r,"a"+i,{propContainer:a,propName:this.id+".aaxis.title.text",placeholder:s(r,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-a.title.font.size/3-u,"text-anchor":"middle"}}),n["b-title"]=x.draw(r,"b"+i,{propContainer:o,propName:this.id+".baxis.title.text",placeholder:s(r,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*o.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=x.draw(r,"c"+i,{propContainer:l,propName:this.id+".caxis.title.text",placeholder:s(r,"Click to enter Component C title"),attributes:{x:this.x0+this.w+c,y:this.y0+this.h+.83*l.title.font.size+c,"text-anchor":"middle"}})}},S.drawAx=function(t){var r,i=this.graphDiv,n=t._name,o=n.charAt(0),s=t._id,l=this.layers[n],u=o+"tickLayout",c=(r=t).ticks+String(r.ticklen)+String(r.showticklabels);this[u]!==c&&(l.selectAll("."+s+"tick").remove(),this[u]=c),t.setScale();var h=f.calcTicks(t),d=f.clipEnds(t,h),p=f.makeTransTickFn(t),m=f.getTickSigns(t)[2],g=a.deg2rad(30),y=m*(t.linewidth||1)/2,v=m*t.ticklen,x=this.w,b=this.h,_="b"===o?"M0,"+y+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+y+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,w={a:"M0,0l"+b+",-"+x/2,b:"M0,0l-"+x/2+",-"+b,c:"M0,0l-"+b+","+x/2}[o];f.drawTicks(i,t,{vals:"inside"===t.ticks?d:h,layer:l,path:_,transFn:p,crisp:!1}),f.drawGrid(i,t,{vals:d,layer:this.layers[o+"grid"],path:w,transFn:p,crisp:!1}),f.drawLabels(i,t,{vals:h,layer:l,transFn:p,labelFns:f.makeLabelFns(t,0,30)})};var D=A.MINZOOM/2+.87,C="m-0.87,.5h"+D+"v3h-"+(D+5.2)+"l"+(D/2+2.6)+",-"+(.87*D+4.5)+"l2.6,1.5l-"+D/2+","+.87*D+"Z",I="m0.87,.5h-"+D+"v3h"+(D+5.2)+"l-"+(D/2+2.6)+",-"+(.87*D+4.5)+"l-2.6,1.5l"+D/2+","+.87*D+"Z",L="m0,1l"+D/2+","+.87*D+"l2.6,-1.5l-"+(D/2+2.6)+",-"+(.87*D+4.5)+"l-"+(D/2+2.6)+","+(.87*D+4.5)+"l2.6,1.5l"+D/2+",-"+.87*D+"Z",P=!0;function z(t){i.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){T(this.dragOptions),w(this.dragOptions.gd)},S.initInteractions=function(){var t,r,i,c,h,d,f,g,x,w,T,M,k=this,S=k.layers.plotbg.select("path").node(),D=k.graphDiv,F=D._fullLayout._zoomlayer;function O(t){var r={};return r[k.id+".aaxis.min"]=t.a,r[k.id+".baxis.min"]=t.b,r[k.id+".caxis.min"]=t.c,r}function R(t,r){var i=D._fullLayout.clickmode;z(D),2===t&&(D.emit("plotly_doubleclick",null),n.call("_guiRelayout",D,O({a:0,b:0,c:0}))),i.indexOf("select")>-1&&1===t&&_(r,D,[k.xaxis],[k.yaxis],k.id,k.dragOptions),i.indexOf("event")>-1&&m.click(D,r,k.id)}this.dragOptions={element:S,gd:D,plotinfo:{id:k.id,domain:D._fullLayout[k.id].domain,xaxis:k.xaxis,yaxis:k.yaxis},subplot:k.id,prepFn:function(n,s,u){k.dragOptions.xaxes=[k.xaxis],k.dragOptions.yaxes=[k.yaxis],T=D._fullLayout._invScaleX,M=D._fullLayout._invScaleY;var p,m,_,A,E,C=k.dragOptions.dragmode=D._fullLayout.dragmode;y(C)?k.dragOptions.minDrag=1:k.dragOptions.minDrag=void 0,"zoom"===C?(k.dragOptions.moveFn=N,k.dragOptions.clickFn=R,k.dragOptions.doneFn=V,p=s,m=u,t=p-(_=S.getBoundingClientRect()).left,r=m-_.top,D._fullLayout._calcInverseTransform(D),A=D._fullLayout._invTransform,t=(E=a.apply3DTransform(A)(t,r))[0],r=E[1],h=i={a:k.aaxis.range[0],b:k.baxis.range[1],c:k.caxis.range[1]},c=k.aaxis.range[1]-i.a,d=l.luminosity(k.graphDiv._fullLayout[k.id].bgcolor),f="M0,"+k.h+"L"+k.w/2+", 0L"+k.w+","+k.h+"Z",g=!1,x=F.append("path").attr("class","zoombox").attr("transform",o(k.x0,k.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",f),w=F.append("path").attr("class","zoombox-corners").attr("transform",o(k.x0,k.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),k.clearOutline(D)):"pan"===C?(k.dragOptions.moveFn=U,k.dragOptions.clickFn=R,k.dragOptions.doneFn=q,h=i={a:k.aaxis.range[0],b:k.baxis.range[1],c:k.caxis.range[1]},k.clearOutline(D)):(v(C)||y(C))&&b(n,s,u,k.dragOptions,C)}};function B(t,r){return 1-(t+(k.h-r)/Math.sqrt(3))/k.w}function j(t,r){return(t-(k.h-r)/Math.sqrt(3))/k.w}function N(n,a){var o=t+n*T,s=r+a*M,l=Math.max(0,Math.min(1,1-r/k.h,1-s/k.h)),u=Math.max(0,Math.min(1,B(t,r),B(o,s))),p=Math.max(0,Math.min(1,j(t,r),j(o,s))),m=(l/2+p)*k.w,y=(1-l/2-u)*k.w,v=(m+y)/2,b=y-m,_=(1-l)*k.h,S=_-b/E;b.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),w.transition().style("opacity",1).duration(200),g=!0),D.emit("plotly_relayouting",O(h))}function V(){z(D),h!==i&&(n.call("_guiRelayout",D,O(h)),P&&D.data&&D._context.showTips&&(a.notifier(s(D,"Double-click to zoom back out"),"long",D),P=!1))}function U(t,r){var n=t/k.xaxis._m,s=r/k.yaxis._m,l=[(h={a:i.a-s,b:i.b+(n+s)/2,c:i.c-(n-s)/2}).a,h.b,h.c].sort(a.sorterAsc),c={a:l.indexOf(h.a),b:l.indexOf(h.b),c:l.indexOf(h.c)};l[0]<0&&(l[1]+l[0]/2<0?(l[2]+=l[0]+l[1],l[0]=l[1]=0):(l[2]+=l[0]/2,l[1]+=l[0]/2,l[0]=0),h={a:l[c.a],b:l[c.b],c:l[c.c]},r=(i.a-h.a)*k.yaxis._m,t=(i.c-h.c-i.b+h.b)*k.xaxis._m);var d=o(k.x0+t,k.y0+r);k.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var f=o(-t,-r);k.clipDefRelative.select("path").attr("transform",f),k.aaxis.range=[h.a,k.sum-h.b-h.c],k.baxis.range=[k.sum-h.a-h.c,h.b],k.caxis.range=[k.sum-h.a-h.b,h.c],k.drawAxes(!1),k._hasClipOnAxisFalse&&k.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,k),D.emit("plotly_relayouting",O(h))}function q(){n.call("_guiRelayout",D,O(h))}S.onmousemove=function(t){m.hover(D,t,k.id),D._fullLayout._lasthover=S,D._fullLayout._hoversubplot=k.id},S.onmouseout=function(t){D._dragging||p.unhover(D,t)},p.init(this.dragOptions)}}}),st=g({"src/plots/ternary/layout_attributes.js"(t,r){var i=er(),n=an().attributes,a=tq(),o=e$().overrideAll,s=$().extendFlat,l={title:{text:a.title.text,font:a.title.font},color:a.color,tickmode:a.minor.tickmode,nticks:s({},a.nticks,{dflt:6,min:1}),tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:a.ticks,ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,ticklabelstep:a.ticklabelstep,showticklabels:a.showticklabels,labelalias:a.labelalias,showtickprefix:a.showtickprefix,tickprefix:a.tickprefix,showticksuffix:a.showticksuffix,ticksuffix:a.ticksuffix,showexponent:a.showexponent,exponentformat:a.exponentformat,minexponent:a.minexponent,separatethousands:a.separatethousands,tickfont:a.tickfont,tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,hoverformat:a.hoverformat,showline:s({},a.showline,{dflt:!0}),linecolor:a.linecolor,linewidth:a.linewidth,showgrid:s({},a.showgrid,{dflt:!0}),gridcolor:a.gridcolor,gridwidth:a.gridwidth,griddash:a.griddash,layer:a.layer,min:{valType:"number",dflt:0,min:0}},u=r.exports=o({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:i.background},sum:{valType:"number",dflt:1,min:0},aaxis:l,baxis:l,caxis:l},"plot","from-root");u.uirevision={valType:"any",editType:"none"},u.aaxis.uirevision=u.baxis.uirevision=u.caxis.uirevision={valType:"any",editType:"none"}}}),sr=g({"src/plots/subplot_defaults.js"(t,r){var i=t_(),n=tC(),a=an().defaults;r.exports=function(t,r,o,s){var l,u,c=s.type,h=s.attributes,d=s.handleDefaults,f=s.partition||"x",p=r._subplots[c],m=p.length,g=m&&p[0].replace(/\d+$/,"");function y(t,r){return i.coerce(l,u,h,t,r)}for(var v=0;v=g&&(_.min=0,w.min=0,T.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}r.exports=function(t,r,i){o(t,r,i,{type:"ternary",attributes:d,handleDefaults:p,font:r.font,paper_bgcolor:r.paper_bgcolor})}}}),sn=g({"src/plots/ternary/index.js"(t){var r=se(),i=tF().getSubplotCalcData,n=t_().counterRegex,a="ternary";t.name=a;var o=t.attr="subplot";t.idRoot=a,t.idRegex=t.attrRegex=n(a),(t.attributes={})[o]={valType:"subplotid",dflt:"ternary",editType:"calc"},t.layoutAttributes=st(),t.supplyLayoutDefaults=si(),t.plot=function(t){for(var n=t._fullLayout,o=t.calcdata,s=n._subplots[a],l=0;l0){var _,w,T,A,M,k=t.xa,S=t.ya;"h"===m.orientation?(M=r,_="y",T=S,w="x",A=k):(M=l,_="x",T=k,w="y",A=S);var E=p[t.index];if(M>=E.span[0]&&M<=E.span[1]){var D=n.extendFlat({},t),C=A.c2p(M,!0),I=s.getKdeValue(E,m,M),L=s.getPositionOnKdePath(E,m,C),P=T._offset,z=T._length;D[_+"0"]=L[0],D[_+"1"]=L[1],D[w+"0"]=D[w+"1"]=C,D[w+"Label"]=w+": "+a.hoverLabelText(A,M,m[w+"hoverformat"])+", "+p[0].t.labels.kde+" "+I.toFixed(3);for(var F=0,O=0;O path").each(function(t){if(!t.isBlank){var r=l.marker;i.select(this).call(a.fill,t.mc||r.color).call(a.stroke,t.mlc||r.line.color).call(n.dashLine,r.line.dash,t.mlw||r.line.width).style("opacity",l.selectedpoints&&!t.selected?o:1)}}),u(s,l,t),s.selectAll(".regions").each(function(){i.select(this).selectAll("path").style("stroke-width",0).call(a.fill,l.connector.fillcolor)}),s.selectAll(".lines").each(function(){var t=l.connector.line;n.lineGroupStyle(i.select(this).selectAll("path"),t.width,t.color,t.dash)})})}}}}),sD=g({"src/traces/funnel/hover.js"(t,r){var i=ei().opacity,n=aF().hoverOnBars,a=t_().formatPercent;r.exports=function(t,r,o,s,l){var u=n(t,r,o,s,l);if(u){var c,h,d,f,p,m,g=u.cd,y=g[0].trace,v="h"===y.orientation,x=g[u.index];u[(v?"x":"y")+"LabelVal"]=x.s,u.percentInitial=x.begR,u.percentInitialLabel=a(x.begR,1),u.percentPrevious=x.difR,u.percentPreviousLabel=a(x.difR,1),u.percentTotal=x.sumR,u.percentTotalLabel=a(x.sumR,1);var b=x.hi||y.hoverinfo,_=[];if(b&&"none"!==b&&"skip"!==b){var w="all"===b,T=b.split("+"),A=function(t){return w||-1!==T.indexOf(t)};A("percent initial")&&_.push(u.percentInitialLabel+" of initial"),A("percent previous")&&_.push(u.percentPreviousLabel+" of previous"),A("percent total")&&_.push(u.percentTotalLabel+" of total")}return u.extraText=_.join("
"),c=y,h=x,d=c.marker,f=h.mc||d.color,p=h.mlc||d.line.color,m=h.mlw||d.line.width,u.color=i(f)?f:i(p)&&m?p:void 0,[u]}}}}),sC=g({"src/traces/funnel/event_data.js"(t,r){r.exports=function(t,r){return t.x="xVal"in r?r.xVal:r.x,t.y="yVal"in r?r.yVal:r.y,"percentInitial"in r&&(t.percentInitial=r.percentInitial),"percentPrevious"in r&&(t.percentPrevious=r.percentPrevious),"percentTotal"in r&&(t.percentTotal=r.percentTotal),r.xa&&(t.xaxis=r.xa),r.ya&&(t.yaxis=r.ya),t}}}),sI=g({"src/traces/funnel/index.js"(t,r){r.exports={attributes:sb(),layoutAttributes:s_(),supplyDefaults:sw().supplyDefaults,crossTraceDefaults:sw().crossTraceDefaults,supplyLayoutDefaults:sT(),calc:sM(),crossTraceCalc:sk(),plot:sS(),style:sE().style,hoverPoints:sD(),eventData:sC(),selectPoints:aR(),moduleType:"trace",name:"funnel",basePlotModule:ny(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),sL=g({"lib/funnel.js"(t,r){r.exports=sI()}}),sP=g({"src/traces/waterfall/constants.js"(t,r){r.exports={eventDataKeys:["initial","delta","final"]}}}),sz=g({"src/traces/waterfall/attributes.js"(t,r){var i=aA(),n=iw().line,a=K(),o=tU().axisHoverFormat,{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:u}=eZ(),c=sP(),h=$().extendFlat,d=ei();function f(t){return{marker:{color:h({},i.marker.color,{arrayOk:!1,editType:"style"}),line:{color:h({},i.marker.line.color,{arrayOk:!1,editType:"style"}),width:h({},i.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}r.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:i.x,x0:i.x0,dx:i.dx,y:i.y,y0:i.y0,dy:i.dy,xperiod:i.xperiod,yperiod:i.yperiod,xperiod0:i.xperiod0,yperiod0:i.yperiod0,xperiodalignment:i.xperiodalignment,yperiodalignment:i.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),hovertext:i.hovertext,hovertemplate:s({},{keys:c.eventDataKeys}),hovertemplatefallback:u(),hoverinfo:h({},a.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:l({editType:"plot"},{keys:c.eventDataKeys.concat(["label"])}),texttemplatefallback:u({editType:"plot"}),text:i.text,textposition:i.textposition,insidetextanchor:i.insidetextanchor,textangle:i.textangle,textfont:i.textfont,insidetextfont:i.insidetextfont,outsidetextfont:i.outsidetextfont,constraintext:i.constraintext,cliponaxis:i.cliponaxis,orientation:i.orientation,offset:i.offset,width:i.width,increasing:f("increasing"),decreasing:f("decreasing"),totals:f("intermediate sums and total"),connector:{line:{color:h({},n.color,{dflt:d.defaultLine}),width:h({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,zorder:i.zorder}}}),sF=g({"src/traces/waterfall/layout_attributes.js"(t,r){r.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),sO=g({"src/constants/delta.js"(t,r){r.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),sR=g({"src/traces/waterfall/defaults.js"(t,r){var i=t_(),n=iJ(),a=aS().handleText,o=iq(),s=iG(),l=sz(),u=ei(),c=sO(),h=c.INCREASING.COLOR,d=c.DECREASING.COLOR;function f(t,r,i){t(r+".marker.color",i),t(r+".marker.line.color",u.defaultLine),t(r+".marker.line.width")}r.exports={supplyDefaults:function(t,r,n,u){function c(n,a){return i.coerce(t,r,l,n,a)}if(!o(t,r,u,c)){r.visible=!1;return}s(t,r,u,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",r.x&&!r.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback");var p=c("textposition");a(t,r,u,c,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==r.textposition&&(c("texttemplate"),c("texttemplatefallback"),r.texttemplate||c("textinfo")),f(c,"increasing",h),f(c,"decreasing",d),f(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")},crossTraceDefaults:function(t,r){var a;function o(t){return i.coerce(a._input,a,l,t)}if("group"===r.waterfallmode)for(var s=0;s0&&(u?M+="M"+T[0]+","+A[1]+"V"+A[0]:M+="M"+T[1]+","+A[0]+"H"+T[0]),"between"!==c&&(t.isSum||r path").each(function(t){if(!t.isBlank){var r=l[t.dir].marker;i.select(this).call(a.fill,r.color).call(a.stroke,r.line.color).call(n.dashLine,r.line.dash,r.line.width).style("opacity",l.selectedpoints&&!t.selected?o:1)}}),u(s,l,t),s.selectAll(".lines").each(function(){var t=l.connector.line;n.lineGroupStyle(i.select(this).selectAll("path"),t.width,t.color,t.dash)})})}}}}),sq=g({"src/traces/waterfall/hover.js"(t,r){var i=rs().hoverLabelText,n=ei().opacity,a=aF().hoverOnBars,o=sO(),s={increasing:o.INCREASING.SYMBOL,decreasing:o.DECREASING.SYMBOL};r.exports=function(t,r,o,l,u){var c=a(t,r,o,l,u);if(c){var h,d,f,p,m=c.cd,g=m[0].trace,y="h"===g.orientation,v=y?"x":"y",x=y?t.xa:t.ya,b=m[c.index],_=b.isSum?b.b+b.s:b.rawS;c.initial=b.b+b.s-_,c.delta=_,c.final=c.initial+c.delta;var w=E(Math.abs(c.delta));c.deltaLabel=_<0?"("+w+")":w,c.finalLabel=E(c.final),c.initialLabel=E(c.initial);var T=b.hi||g.hoverinfo,A=[];if(T&&"none"!==T&&"skip"!==T){var M="all"===T,k=T.split("+"),S=function(t){return M||-1!==k.indexOf(t)};b.isSum||(!S("final")||S(y?"x":"y")||A.push(c.finalLabel),S("delta")&&(_<0?A.push(c.deltaLabel+" "+s.decreasing):A.push(c.deltaLabel+" "+s.increasing)),S("initial")&&A.push("Initial: "+c.initialLabel))}return A.length&&(c.extraText=A.join("
")),d=(h=g[b.dir].marker).color,f=h.line.color,p=h.line.width,c.color=n(d)?d:n(f)&&p?f:void 0,[c]}function E(t){return i(x,t,g[v+"hoverformat"])}}}}),sG=g({"src/traces/waterfall/event_data.js"(t,r){r.exports=function(t,r){return t.x="xVal"in r?r.xVal:r.x,t.y="yVal"in r?r.yVal:r.y,"initial"in r&&(t.initial=r.initial),"delta"in r&&(t.delta=r.delta),"final"in r&&(t.final=r.final),r.xa&&(t.xaxis=r.xa),r.ya&&(t.yaxis=r.ya),t}}}),sH=g({"src/traces/waterfall/index.js"(t,r){r.exports={attributes:sz(),layoutAttributes:sF(),supplyDefaults:sR().supplyDefaults,crossTraceDefaults:sR().crossTraceDefaults,supplyLayoutDefaults:sB(),calc:sj(),crossTraceCalc:sN(),plot:sV(),style:sU().style,hoverPoints:sq(),eventData:sG(),selectPoints:aR(),moduleType:"trace",name:"waterfall",basePlotModule:ny(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),s$=g({"lib/waterfall.js"(t,r){r.exports=sH()}}),sW=g({"src/traces/image/constants.js"(t,r){r.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(t){return t.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(t){return t.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(t){var r=t.slice(0,3);return r[1]=r[1]+"%",r[2]=r[2]+"%",r},suffix:["\xb0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(t){var r=t.slice(0,4);return r[1]=r[1]+"%",r[2]=r[2]+"%",r},suffix:["\xb0","%","%",""]}}}}}),sY={};y(sY,{default:()=>s3});var sZ,sX,sK,sJ,sQ,s0,s1,s2,s3,s5=m({"src/traces/image/attributes.ts"(){for(let t of(sZ=x($()),sX=x(K()),sK=x(eZ()),sJ=x(iw()),sQ=x(sW()),s1=[],s2=[],s0=["rgb","rgba","rgba256","hsl","hsla"])){let r=sQ.colormodel[t];s1.push(`For the \`${t}\` colormodel, it is [${(r.zminDflt||r.min).join(", ")}].`),s2.push(`For the \`${t}\` colormodel, it is [${(r.zmaxDflt||r.max).join(", ")}].`)}s3={source:{valType:"string",editType:"calc",description:'Specifies the data URI of the image to be visualized. The URI consists of "data:image/[][;base64\\\\],"'},z:{valType:"data_array",editType:"calc",description:"A 2-dimensional array in which each element is an array of 3 or 4 numbers representing a color."},colormodel:{valType:"enumerated",values:s0,editType:"calc",description:"Color model used to map the numerical color components described in `z` into colors. If `source` is specified, this attribute will be set to `rgba256` otherwise it defaults to `rgb`."},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot",description:"Picks a smoothing algorithm used to smooth `z` data. This only applies for image traces that use the `source` attribute."},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["Array defining the lower bound for each color component. Note that the default value will depend on the colormodel.",s1.join(" ")].join(" ")},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc",description:["Array defining the higher bound for each color component. Note that the default value will depend on the colormodel.",s2.join(" ")].join(" ")},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",description:"Set the image's x position. The left edge of the image (or the right edge if the x axis is reversed or dx is negative) will be found at xmin=x0-dx/2"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",description:"Set the image's y position. The top edge of the image (or the bottom edge if the y axis is NOT reversed or if dy is negative) will be found at ymin=y0-dy/2. By default when an image trace is included, the y axis will be reversed so that the image is right-side-up, but you can disable this by setting yaxis.autorange=true or by providing an explicit y axis range."},dx:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's horizontal size."},dy:{valType:"number",dflt:1,editType:"calc",description:"Set the pixel's vertical size"},text:{valType:"data_array",editType:"plot",description:"Sets the text elements associated with each z value."},hovertext:{valType:"data_array",editType:"plot",description:"Same as `text`."},hoverinfo:(0,sZ.extendFlat)({},sX.default.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:(0,sK.hovertemplateAttrs)({},{keys:["z","color","colormodel"]}),hovertemplatefallback:(0,sK.templatefallbackAttrs)(),zorder:sJ.zorder}}}),s4=g({"src/traces/image/defaults.js"(t,r){var i=t_(),n=(s5(),b(sY)).default,a=sW(),o=iz().IMAGE_URL_PREFIX;r.exports=function(t,r){function s(a,o){return i.coerce(t,r,n,a,o)}s("source"),r.source&&!r.source.match(o)&&delete r.source,r._hasSource=!!r.source;var l,u=s("z");if(r._hasZ=!(void 0===u||!u.length||!u[0]||!u[0].length),!r._hasZ&&!r._hasSource){r.visible=!1;return}s("x0"),s("y0"),s("dx"),s("dy"),r._hasZ?(s("colormodel","rgb"),s("zmin",(l=a.colormodel[r.colormodel]).zminDflt||l.min),s("zmax",l.zmaxDflt||l.max)):r._hasSource&&(r.colormodel="rgba256",l=a.colormodel[r.colormodel],r.zmin=l.zminDflt,r.zmax=l.zmaxDflt),s("zsmooth"),s("text"),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),r._length=null,s("zorder")}}}),s6=g({"node_modules/inherits/inherits_browser.js"(t,r){"function"==typeof Object.create?r.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}}}),s8=g({"node_modules/readable-stream/lib/internal/streams/stream-browser.js"(t,r){r.exports=tM().EventEmitter}}),s7=g({"node_modules/base64-js/index.js"(t){t.byteLength=function(t){var r=l(t),i=r[0],n=r[1];return(i+n)*3/4-n},t.toByteArray=function(t){var r,i,n=l(t),s=n[0],u=n[1],c=new o((s+u)*3/4-u),h=0,d=u>0?s-4:s;for(i=0;i>16&255,c[h++]=r>>8&255,c[h++]=255&r;return 2===u&&(r=a[t.charCodeAt(i)]<<2|a[t.charCodeAt(i+1)]>>4,c[h++]=255&r),1===u&&(r=a[t.charCodeAt(i)]<<10|a[t.charCodeAt(i+1)]<<4|a[t.charCodeAt(i+2)]>>2,c[h++]=r>>8&255,c[h++]=255&r),c},t.fromByteArray=function(t){for(var r,i=t.length,a=i%3,o=[],s=0,l=i-a;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}(t,s,s+16383>l?l:s+16383));return 1===a?o.push(n[(r=t[i-1])>>2]+n[r<<4&63]+"=="):2===a&&o.push(n[(r=(t[i-2]<<8)+t[i-1])>>10]+n[r>>4&63]+n[r<<2&63]+"="),o.join("")};var r,i,n=[],a=[],o="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(r=0,i=s.length;r0)throw Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");-1===i&&(i=r);var n=i===r?0:4-i%4;return[i,n]}a[45]=62,a[95]=63}}),s9=g({"node_modules/ieee754/index.js"(t){t.read=function(t,r,i,n,a){var o,s,l=8*a-n-1,u=(1<>1,h=-7,d=i?a-1:0,f=i?-1:1,p=t[r+d];for(d+=f,o=p&(1<<-h)-1,p>>=-h,h+=l;h>0;o=256*o+t[r+d],d+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[r+d],d+=f,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(t,r,i,n,a,o){var s,l,u,c=8*o-a-1,h=(1<>1,f=5960464477539062e-23*(23===a),p=n?0:o-1,m=n?1:-1,g=+(r<0||0===r&&1/r<0);for(isNaN(r=Math.abs(r))||r===1/0?(l=+!!isNaN(r),s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+d>=1?r+=f/u:r+=f*Math.pow(2,1-d),r*u>=2&&(s++,u/=2),s+d>=h?(l=0,s=h):s+d>=1?(l=(r*u-1)*Math.pow(2,a),s+=d):(l=r*Math.pow(2,d-1)*Math.pow(2,a),s=0));a>=8;t[i+p]=255&l,p+=m,l/=256,a-=8);for(s=s<0;t[i+p]=255&s,p+=m,s/=256,c-=8);t[i+p-m]|=128*g}}}),le=g({"node_modules/buffer/index.js"(t){var r=s7(),i=s9(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');let r=new Uint8Array(t);return Object.setPrototypeOf(r,o.prototype),r}function o(t,r,i){if("number"==typeof t){if("string"==typeof r)throw TypeError('The "string" argument must be of type string. Received type number');return u(t)}return s(t,r,i)}function s(t,r,i){if("string"==typeof t){var n=t,s=r;if(("string"!=typeof s||""===s)&&(s="utf8"),!o.isEncoding(s))throw TypeError("Unknown encoding: "+s);let i=0|f(n,s),l=a(i),u=l.write(n,s);return u!==i&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(t)){var l=t;if(O(l,Uint8Array)){let t=new Uint8Array(l);return h(t.buffer,t.byteOffset,t.byteLength)}return c(l)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(O(t,ArrayBuffer)||t&&O(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(O(t,SharedArrayBuffer)||t&&O(t.buffer,SharedArrayBuffer)))return h(t,r,i);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let u=t.valueOf&&t.valueOf();if(null!=u&&u!==t)return o.from(u,r,i);let p=function(t){if(o.isBuffer(t)){let r=0|d(t.length),i=a(r);return 0===i.length||t.copy(i,0,0,r),i}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?a(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),r,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return l(t),a(t<0?0:0|d(t))}function c(t){let r=t.length<0?0:0|d(t.length),i=a(r);for(let n=0;n=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function f(t,r){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||O(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;let a=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return z(t).length;default:if(a)return n?-1:P(t).length;r=(""+r).toLowerCase(),a=!0}}function p(t,i,n){let a=!1;if((void 0===i||i<0)&&(i=0),i>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(i>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,r,i){let n=t.length;(!r||r<0)&&(r=0),(!i||i<0||i>n)&&(i=n);let a="";for(let n=r;n0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),(s=i*=1)!=s&&(i=a?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(a)return -1;i=t.length-1}else if(i<0)if(!a)return -1;else i=0;if("string"==typeof r&&(r=o.from(r,n)),o.isBuffer(r))return 0===r.length?-1:y(t,r,i,n,a);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,r,i):Uint8Array.prototype.lastIndexOf.call(t,r,i):y(t,[r],i,n,a);throw TypeError("val must be string, number or Buffer")}function y(t,r,i,n,a){let o,s=1,l=t.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return -1;s=2,l/=2,u/=2,i/=2}function c(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(a){let n=-1;for(o=i;ol&&(i=l-u),o=i;o>=0;o--){let i=!0;for(let n=0;n239?4:r>223?3:r>191?2:1;if(a+s<=i){let i,n,l,u;switch(s){case 1:r<128&&(o=r);break;case 2:(192&(i=t[a+1]))==128&&(u=(31&r)<<6|63&i)>127&&(o=u);break;case 3:i=t[a+1],n=t[a+2],(192&i)==128&&(192&n)==128&&(u=(15&r)<<12|(63&i)<<6|63&n)>2047&&(u<55296||u>57343)&&(o=u);break;case 4:i=t[a+1],n=t[a+2],l=t[a+3],(192&i)==128&&(192&n)==128&&(192&l)==128&&(u=(15&r)<<18|(63&i)<<12|(63&n)<<6|63&l)>65535&&u<1114112&&(o=u)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),a+=s}var o=n;let s=o.length;if(s<=4096)return String.fromCharCode.apply(String,o);let l="",u=0;for(;ui)throw RangeError("Trying to access beyond buffer length")}function b(t,r,i,n,a,s){if(!o.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(r>a||rt.length)throw RangeError("Index out of range")}function _(t,r,i,n,a){D(r,n,a,t,i,7);let o=Number(r&BigInt(0xffffffff));t[i++]=o,o>>=8,t[i++]=o,o>>=8,t[i++]=o,o>>=8,t[i++]=o;let s=Number(r>>BigInt(32)&BigInt(0xffffffff));return t[i++]=s,s>>=8,t[i++]=s,s>>=8,t[i++]=s,s>>=8,t[i++]=s,i}function w(t,r,i,n,a){D(r,n,a,t,i,7);let o=Number(r&BigInt(0xffffffff));t[i+7]=o,o>>=8,t[i+6]=o,o>>=8,t[i+5]=o,o>>=8,t[i+4]=o;let s=Number(r>>BigInt(32)&BigInt(0xffffffff));return t[i+3]=s,s>>=8,t[i+2]=s,s>>=8,t[i+1]=s,s>>=8,t[i]=s,i+8}function T(t,r,i,n,a,o){if(i+n>t.length||i<0)throw RangeError("Index out of range")}function A(t,r,n,a,o){return r*=1,n>>>=0,o||T(t,r,n,4,34028234663852886e22,-34028234663852886e22),i.write(t,r,n,a,23,4),n+4}function M(t,r,n,a,o){return r*=1,n>>>=0,o||T(t,r,n,8,17976931348623157e292,-17976931348623157e292),i.write(t,r,n,a,52,8),n+8}t.Buffer=o,t.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),42===t.foo()}catch{return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,r,i){return s(t,r,i)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,r,i){return l(t),t<=0?a(t):void 0!==r?"string"==typeof i?a(t).fill(r,i):a(t).fill(r):a(t)},o.allocUnsafe=function(t){return u(t)},o.allocUnsafeSlow=function(t){return u(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,r){if(O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),!o.isBuffer(t)||!o.isBuffer(r))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let i=t.length,n=r.length;for(let a=0,o=Math.min(i,n);an.length?(o.isBuffer(r)||(r=o.from(r)),r.copy(n,a)):Uint8Array.prototype.set.call(n,r,a);else if(o.isBuffer(r))r.copy(n,a);else throw TypeError('"list" argument must be an Array of Buffers');a+=r.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;ri&&(r+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(t,r,i,n,a){if(O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),r<0||i>t.length||n<0||a>this.length)throw RangeError("out of range index");if(n>=a&&r>=i)return 0;if(n>=a)return -1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,a>>>=0,this===t)return 0;let s=a-n,l=i-r,u=Math.min(s,l),c=this.slice(n,a),h=t.slice(r,i);for(let t=0;t>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let f=this.length-r;if((void 0===i||i>f)&&(i=f),t.length>0&&(i<0||r<0)||r>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let p=!1;for(;;)switch(n){case"hex":return function(t,r,i,n){let a;i=Number(i)||0;let o=t.length-i;n?(n=Number(n))>o&&(n=o):n=o;let s=r.length;for(n>s/2&&(n=s/2),a=0;a>8,a.push(i%256),a.push(n);return a}(t,this.length-h),this,h,d);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(t,r){let i=this.length;t=~~t,r=void 0===r?i:~~r,t<0?(t+=i)<0&&(t=0):t>i&&(t=i),r<0?(r+=i)<0&&(r=0):r>i&&(r=i),r>>=0,r>>>=0,i||x(t,r,this.length);let n=this[t],a=1,o=0;for(;++o>>=0,r>>>=0,i||x(t,r,this.length);let n=this[t+--r],a=1;for(;r>0&&(a*=256);)n+=this[t+--r]*a;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,r){return t>>>=0,r||x(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,r){return t>>>=0,r||x(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,r){return t>>>=0,r||x(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,r){return t>>>=0,r||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,r){return t>>>=0,r||x(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=B(function(t){C(t>>>=0,"offset");let r=this[t],i=this[t+7];(void 0===r||void 0===i)&&I(t,this.length-8);let n=r+256*this[++t]+65536*this[++t]+0x1000000*this[++t],a=this[++t]+256*this[++t]+65536*this[++t]+0x1000000*i;return BigInt(n)+(BigInt(a)<>>=0,"offset");let r=this[t],i=this[t+7];(void 0===r||void 0===i)&&I(t,this.length-8);let n=0x1000000*r+65536*this[++t]+256*this[++t]+this[++t],a=0x1000000*this[++t]+65536*this[++t]+256*this[++t]+i;return(BigInt(n)<>>=0,r>>>=0,i||x(t,r,this.length);let n=this[t],a=1,o=0;for(;++o=(a*=128)&&(n-=Math.pow(2,8*r)),n},o.prototype.readIntBE=function(t,r,i){t>>>=0,r>>>=0,i||x(t,r,this.length);let n=r,a=1,o=this[t+--n];for(;n>0&&(a*=256);)o+=this[t+--n]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*r)),o},o.prototype.readInt8=function(t,r){return t>>>=0,r||x(t,1,this.length),128&this[t]?-((255-this[t]+1)*1):this[t]},o.prototype.readInt16LE=function(t,r){t>>>=0,r||x(t,2,this.length);let i=this[t]|this[t+1]<<8;return 32768&i?0xffff0000|i:i},o.prototype.readInt16BE=function(t,r){t>>>=0,r||x(t,2,this.length);let i=this[t+1]|this[t]<<8;return 32768&i?0xffff0000|i:i},o.prototype.readInt32LE=function(t,r){return t>>>=0,r||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,r){return t>>>=0,r||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=B(function(t){C(t>>>=0,"offset");let r=this[t],i=this[t+7];return(void 0===r||void 0===i)&&I(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(i<<24))<>>=0,"offset");let r=this[t],i=this[t+7];return(void 0===r||void 0===i)&&I(t,this.length-8),(BigInt((r<<24)+65536*this[++t]+256*this[++t]+this[++t])<>>=0,r||x(t,4,this.length),i.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,r){return t>>>=0,r||x(t,4,this.length),i.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,r){return t>>>=0,r||x(t,8,this.length),i.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,r){return t>>>=0,r||x(t,8,this.length),i.read(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,r,i,n){if(t*=1,r>>>=0,i>>>=0,!n){let n=Math.pow(2,8*i)-1;b(this,t,r,i,n,0)}let a=1,o=0;for(this[r]=255&t;++o>>=0,i>>>=0,!n){let n=Math.pow(2,8*i)-1;b(this,t,r,i,n,0)}let a=i-1,o=1;for(this[r+a]=255&t;--a>=0&&(o*=256);)this[r+a]=t/o&255;return r+i},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,1,255,0),this[r]=255&t,r+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,2,65535,0),this[r]=255&t,this[r+1]=t>>>8,r+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=255&t,r+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,4,0xffffffff,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t,r+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,4,0xffffffff,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},o.prototype.writeBigUInt64LE=B(function(t,r=0){return _(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=B(function(t,r=0){return w(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(t,r,i,n){if(t*=1,r>>>=0,!n){let n=Math.pow(2,8*i-1);b(this,t,r,i,n-1,-n)}let a=0,o=1,s=0;for(this[r]=255&t;++a>>=0,!n){let n=Math.pow(2,8*i-1);b(this,t,r,i,n-1,-n)}let a=i-1,o=1,s=0;for(this[r+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[r+a+1]&&(s=1),this[r+a]=(t/o|0)-s&255;return r+i},o.prototype.writeInt8=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=255&t,r+1},o.prototype.writeInt16LE=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,2,32767,-32768),this[r]=255&t,this[r+1]=t>>>8,r+2},o.prototype.writeInt16BE=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=255&t,r+2},o.prototype.writeInt32LE=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,4,0x7fffffff,-0x80000000),this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},o.prototype.writeInt32BE=function(t,r,i){return t*=1,r>>>=0,i||b(this,t,r,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},o.prototype.writeBigInt64LE=B(function(t,r=0){return _(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=B(function(t,r=0){return w(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeFloatLE=function(t,r,i){return A(this,t,r,!0,i)},o.prototype.writeFloatBE=function(t,r,i){return A(this,t,r,!1,i)},o.prototype.writeDoubleLE=function(t,r,i){return M(this,t,r,!0,i)},o.prototype.writeDoubleBE=function(t,r,i){return M(this,t,r,!1,i)},o.prototype.copy=function(t,r,i,n){if(!o.isBuffer(t))throw TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(a=r;a=n+4;i-=3)r=`_${t.slice(i-3,i)}${r}`;return`${t.slice(0,i)}${r}`}function D(t,r,i,n,a,o){if(t>i||t3?0===r||r===BigInt(0)?`>= 0${n} and < 2${n} ** ${(o+1)*8}${n}`:`>= -(2${n} ** ${(o+1)*8-1}${n}) and < 2 ** ${(o+1)*8-1}${n}`:`>= ${r}${n} and <= ${i}${n}`,new k.ERR_OUT_OF_RANGE("value",a,t)}C(a,"offset"),(void 0===n[a]||void 0===n[a+o])&&I(a,n.length-(o+1))}function C(t,r){if("number"!=typeof t)throw new k.ERR_INVALID_ARG_TYPE(r,"number",t)}function I(t,r,i){throw Math.floor(t)!==t?(C(t,i),new k.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):r<0?new k.ERR_BUFFER_OUT_OF_BOUNDS:new k.ERR_OUT_OF_RANGE(i||"offset",`>= ${+!!i} and <= ${r}`,t)}S("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(t,r){return`The "${t}" argument must be of type number. Received type ${typeof r}`},TypeError),S("ERR_OUT_OF_RANGE",function(t,r,i){let n=`The value of "${t}" is out of range.`,a=i;return Number.isInteger(i)&&Math.abs(i)>0x100000000?a=E(String(i)):"bigint"==typeof i&&(a=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(a=E(a)),a+="n"),n+=` It must be ${r}. Received ${a}`},RangeError);var L=/[^+/0-9A-Za-z-_]/g;function P(t,r){r=r||1/0;let i,n=t.length,a=null,o=[];for(let s=0;s55295&&i<57344){if(!a){if(i>56319||s+1===n){(r-=3)>-1&&o.push(239,191,189);continue}a=i;continue}if(i<56320){(r-=3)>-1&&o.push(239,191,189),a=i;continue}i=(a-55296<<10|i-56320)+65536}else a&&(r-=3)>-1&&o.push(239,191,189);if(a=null,i<128){if((r-=1)<0)break;o.push(i)}else if(i<2048){if((r-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((r-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((r-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return o}function z(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,r,i,n){let a;for(a=0;a=r.length||a>=t.length);++a)r[a+i]=t[a];return a}function O(t,r){return t instanceof r||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===r.name}var R=function(){let t="0123456789abcdef",r=Array(256);for(let i=0;i<16;++i){let n=16*i;for(let a=0;a<16;++a)r[n+a]=t[i]+t[a]}return r}();function B(t){return typeof BigInt>"u"?j:t}function j(){throw Error("BigInt not supported")}}}),lt=g({"node_modules/has-symbols/shams.js"(t,r){r.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},r=Symbol("test"),i=Object(r);if("string"==typeof r||"[object Symbol]"!==Object.prototype.toString.call(r)||"[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var n in t[r]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var a=Object.getOwnPropertySymbols(t);if(1!==a.length||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,r);if(42!==o.value||!0!==o.enumerable)return!1}return!0}}}),lr=g({"node_modules/has-tostringtag/shams.js"(t,r){var i=lt();r.exports=function(){return i()&&!!Symbol.toStringTag}}}),li=g({"node_modules/es-object-atoms/index.js"(t,r){r.exports=Object}}),ln=g({"node_modules/es-errors/index.js"(t,r){r.exports=Error}}),la=g({"node_modules/es-errors/eval.js"(t,r){r.exports=EvalError}}),lo=g({"node_modules/es-errors/range.js"(t,r){r.exports=RangeError}}),ls=g({"node_modules/es-errors/ref.js"(t,r){r.exports=ReferenceError}}),ll=g({"node_modules/es-errors/syntax.js"(t,r){r.exports=SyntaxError}}),lu=g({"node_modules/es-errors/type.js"(t,r){r.exports=TypeError}}),lc=g({"node_modules/es-errors/uri.js"(t,r){r.exports=URIError}}),lh=g({"node_modules/math-intrinsics/abs.js"(t,r){r.exports=Math.abs}}),ld=g({"node_modules/math-intrinsics/floor.js"(t,r){r.exports=Math.floor}}),lf=g({"node_modules/math-intrinsics/max.js"(t,r){r.exports=Math.max}}),lp=g({"node_modules/math-intrinsics/min.js"(t,r){r.exports=Math.min}}),lm=g({"node_modules/math-intrinsics/pow.js"(t,r){r.exports=Math.pow}}),lg=g({"node_modules/math-intrinsics/round.js"(t,r){r.exports=Math.round}}),ly=g({"node_modules/math-intrinsics/isNaN.js"(t,r){r.exports=Number.isNaN||function(t){return t!=t}}}),lv=g({"node_modules/math-intrinsics/sign.js"(t,r){var i=ly();r.exports=function(t){return i(t)||0===t?t:t<0?-1:1}}}),lx=g({"node_modules/gopd/gOPD.js"(t,r){r.exports=Object.getOwnPropertyDescriptor}}),lb=g({"node_modules/gopd/index.js"(t,r){var i=lx();if(i)try{i([],"length")}catch{i=null}r.exports=i}}),l_=g({"node_modules/es-define-property/index.js"(t,r){var i=Object.defineProperty||!1;if(i)try{i({},"a",{value:1})}catch{i=!1}r.exports=i}}),lw=g({"node_modules/has-symbols/index.js"(t,r){var i="u">typeof Symbol&&Symbol,n=lt();r.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&n()}}}),lT=g({"node_modules/get-proto/Reflect.getPrototypeOf.js"(t,r){r.exports="u">typeof Reflect&&Reflect.getPrototypeOf||null}}),lA=g({"node_modules/get-proto/Object.getPrototypeOf.js"(t,r){r.exports=li().getPrototypeOf||null}}),lM=g({"node_modules/function-bind/implementation.js"(t,r){var i=Object.prototype.toString,n=Math.max,a=function(t,r){for(var i=[],n=0;ntypeof Reflect&&Reflect&&Reflect.apply}}),lC=g({"node_modules/call-bind-apply-helpers/actualApply.js"(t,r){var i=lk(),n=lE(),a=lS();r.exports=lD()||i.call(a,n)}}),lI=g({"node_modules/call-bind-apply-helpers/index.js"(t,r){var i=lk(),n=lu(),a=lS(),o=lC();r.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new n("a function is required");return o(i,a,t)}}}),lL=g({"node_modules/dunder-proto/get.js"(t,r){var i,n=lI(),a=lb();try{i=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var o=!!i&&a&&a(Object.prototype,"__proto__"),s=Object,l=s.getPrototypeOf;r.exports=o&&"function"==typeof o.get?n([o.get]):"function"==typeof l&&function(t){return l(null==t?t:s(t))}}}),lP=g({"node_modules/get-proto/index.js"(t,r){var i=lT(),n=lA(),a=lL();r.exports=i?function(t){return i(t)}:n?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("getProto: not an object");return n(t)}:a?function(t){return a(t)}:null}}),lz=g({"node_modules/hasown/index.js"(t,r){var i=Function.prototype.call,n=Object.prototype.hasOwnProperty;r.exports=lk().call(i,n)}}),lF=g({"node_modules/get-intrinsic/index.js"(t,r){var i,n=li(),a=ln(),o=la(),s=lo(),l=ls(),u=ll(),c=lu(),h=lc(),d=lh(),f=ld(),p=lf(),m=lp(),g=lm(),y=lg(),v=lv(),x=Function,b=function(t){try{return x('"use strict"; return ('+t+").constructor;")()}catch{}},_=lb(),w=l_(),T=function(){throw new c},A=_?function(){try{return arguments.callee,T}catch{try{return _(arguments,"callee").get}catch{return T}}}():T,M=lw()(),k=lP(),S=lA(),E=lT(),D=lE(),C=lS(),I={},L=typeof Uint8Array>"u"||!k?i:k(Uint8Array),P={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?i:ArrayBuffer,"%ArrayIteratorPrototype%":M&&k?k([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?i:Atomics,"%BigInt%":typeof BigInt>"u"?i:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?i:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?i:Float16Array,"%Float32Array%":typeof Float32Array>"u"?i:Float32Array,"%Float64Array%":typeof Float64Array>"u"?i:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?i:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?i:Int8Array,"%Int16Array%":typeof Int16Array>"u"?i:Int16Array,"%Int32Array%":typeof Int32Array>"u"?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&k?k(k([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":typeof Map>"u"?i:Map,"%MapIteratorPrototype%":!(typeof Map>"u")&&M&&k?k(new Map()[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?i:Promise,"%Proxy%":typeof Proxy>"u"?i:Proxy,"%RangeError%":s,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?i:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?i:Set,"%SetIteratorPrototype%":!(typeof Set>"u")&&M&&k?k(new Set()[Symbol.iterator]()):i,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&k?k(""[Symbol.iterator]()):i,"%Symbol%":M?Symbol:i,"%SyntaxError%":u,"%ThrowTypeError%":A,"%TypedArray%":L,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?i:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?i:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?i:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?i:Uint32Array,"%URIError%":h,"%WeakMap%":typeof WeakMap>"u"?i:WeakMap,"%WeakRef%":typeof WeakRef>"u"?i:WeakRef,"%WeakSet%":typeof WeakSet>"u"?i:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":D,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":S,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":E};if(k)try{null.error}catch(t){z=k(k(t)),P["%Error.prototype%"]=z}var z,F=function t(r){var i;if("%AsyncFunction%"===r)i=b("async function () {}");else if("%GeneratorFunction%"===r)i=b("function* () {}");else if("%AsyncGeneratorFunction%"===r)i=b("async function* () {}");else if("%AsyncGenerator%"===r){var n=t("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===r){var a=t("%AsyncGenerator%");a&&k&&(i=k(a.prototype))}return P[r]=i,i},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=lk(),B=lz(),j=R.call(C,Array.prototype.concat),N=R.call(D,Array.prototype.splice),V=R.call(C,String.prototype.replace),U=R.call(C,String.prototype.slice),q=R.call(C,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,$=function(t){var r=U(t,0,1),i=U(t,-1);if("%"===r&&"%"!==i)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==r)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return V(t,G,function(t,r,i,a){n[n.length]=i?V(a,H,"$1"):r||t}),n},W=function(t,r){var i,n=t;if(B(O,n)&&(n="%"+(i=O[n])[0]+"%"),B(P,n)){var a=P[n];if(a===I&&(a=F(n)),typeof a>"u"&&!r)throw new c("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new u("intrinsic "+t+" does not exist!")};r.exports=function(t,r){if("string"!=typeof t||0===t.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof r)throw new c('"allowMissing" argument must be a boolean');if(null===q(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=$(t),n=i.length>0?i[0]:"",a=W("%"+n+"%",r),o=a.name,s=a.value,l=!1,h=a.alias;h&&(n=h[0],N(i,j([0,1],h)));for(var d=1,f=!0;d=i.length){var y=_(s,p);s=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:s[p]}else f=B(s,p),s=s[p];f&&!l&&(P[o]=s)}}return s}}}),lO=g({"node_modules/call-bound/index.js"(t,r){var i=lF(),n=lI(),a=n([i("%String.prototype.indexOf%")]);r.exports=function(t,r){var o=i(t,!!r);return"function"==typeof o&&a(t,".prototype.")>-1?n([o]):o}}}),lR=g({"node_modules/is-arguments/index.js"(t,r){var i=lr()(),n=lO()("Object.prototype.toString"),a=function(t){return(!i||!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===n(t)},o=function(t){return!!a(t)||null!==t&&"object"==typeof t&&"length"in t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n(t)&&"callee"in t&&"[object Function]"===n(t.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,r.exports=s?a:o}}),lB=g({"node_modules/is-regex/index.js"(t,r){var i,n,a,o,s,l,u=lO(),c=lr()(),h=lz(),d=lb();c?(i=u("RegExp.prototype.exec"),n={},o={toString:a=function(){throw n},valueOf:a},"symbol"==typeof Symbol.toPrimitive&&(o[Symbol.toPrimitive]=a),l=function(t){if(!t||"object"!=typeof t)return!1;var r=d(t,"lastIndex");if(!(r&&h(r,"value")))return!1;try{i(t,o)}catch(t){return t===n}}):(s=u("Object.prototype.toString"),l=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"[object RegExp]"===s(t)}),r.exports=l}}),lj=g({"node_modules/safe-regex-test/index.js"(t,r){var i=lO(),n=lB(),a=i("RegExp.prototype.exec"),o=lu();r.exports=function(t){if(!n(t))throw new o("`regex` must be a RegExp");return function(r){return null!==a(t,r)}}}}),lN=g({"node_modules/generator-function/index.js"(t,r){var i=(function*(){}).constructor;r.exports=()=>i}}),lV=g({"node_modules/is-generator-function/index.js"(t,r){var i=lO(),n=lj()(/^\s*(?:function)?\*/),a=lr()(),o=lP(),s=i("Object.prototype.toString"),l=i("Function.prototype.toString"),u=lN();r.exports=function(t){if("function"!=typeof t)return!1;if(n(l(t)))return!0;if(!a)return"[object GeneratorFunction]"===s(t);if(!o)return!1;var r=u();return r&&o(t)===r.prototype}}}),lU=g({"node_modules/is-callable/index.js"(t,r){var i,n,a,o=Function.prototype.toString,s="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof s&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw a}}),a={},s(function(){throw 42},null,n)}catch(t){t!==a&&(s=null)}else s=null;var l=/^\s*class\b/,u=function(t){try{var r=o.call(t);return l.test(r)}catch{return!1}},c=function(t){try{return!u(t)&&(o.call(t),!0)}catch{return!1}},h=Object.prototype.toString,d="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),p=function(){return!1};"object"==typeof document&&(i=document.all,h.call(i)===h.call(document.all)&&(p=function(t){if((f||!t)&&(typeof t>"u"||"object"==typeof t))try{var r=h.call(t);return("[object HTMLAllCollection]"===r||"[object HTML document.all class]"===r||"[object HTMLCollection]"===r||"[object Object]"===r)&&null==t("")}catch{}return!1})),r.exports=s?function(t){if(p(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;try{s(t,null,n)}catch(t){if(t!==a)return!1}return!u(t)&&c(t)}:function(t){if(p(t))return!0;if(!t||"function"!=typeof t&&"object"!=typeof t)return!1;if(d)return c(t);if(u(t))return!1;var r=h.call(t);return("[object Function]"===r||"[object GeneratorFunction]"===r||!!/^\[object HTML/.test(r))&&c(t)}}}),lq=g({"node_modules/for-each/index.js"(t,r){var i=lU(),n=Object.prototype.toString,a=Object.prototype.hasOwnProperty,o=function(t,r,i){for(var n=0,o=t.length;n=3&&(u=a),"[object Array]"===n.call(t)?o(t,r,u):"string"==typeof t?s(t,r,u):l(t,r,u)}}}),lG=g({"node_modules/possible-typed-array-names/index.js"(t,r){r.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}}),lH=g({"node_modules/available-typed-arrays/index.js"(t,r){var i=lG(),n=typeof globalThis>"u"?window:globalThis;r.exports=function(){for(var t=[],r=0;r3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,h=arguments.length>6&&arguments[6],d=!!o&&o(t,r);if(i)i(t,r,{configurable:null===c&&d?d.configurable:!c,enumerable:null===l&&d?d.enumerable:!l,value:s,writable:null===u&&d?d.writable:!u});else if(!h&&(l||u||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else t[r]=s}}}),lW=g({"node_modules/has-property-descriptors/index.js"(t,r){var i=l_(),n=function(){return!!i};n.hasArrayLengthDefineBug=function(){if(!i)return null;try{return 1!==i([],"length",{value:1}).length}catch{return!0}},r.exports=n}}),lY=g({"node_modules/set-function-length/index.js"(t,r){var i=lF(),n=l$(),a=lW()(),o=lb(),s=lu(),l=i("%Math.floor%");r.exports=function(t,r){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof r||r<0||r>0xffffffff||l(r)!==r)throw new s("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],u=!0,c=!0;if("length"in t&&o){var h=o(t,"length");h&&!h.configurable&&(u=!1),h&&!h.writable&&(c=!1)}return(u||c||!i)&&(a?n(t,"length",r,!0,!0):n(t,"length",r)),t}}}),lZ=g({"node_modules/call-bind-apply-helpers/applyBind.js"(t,r){var i=lk(),n=lE(),a=lC();r.exports=function(){return a(i,n,arguments)}}}),lX=g({"node_modules/call-bind/index.js"(t,r){var i=lY(),n=l_(),a=lI(),o=lZ();r.exports=function(t){var r=a(arguments),n=1+t.length-(arguments.length-1);return i(r,n>0?n:0,!0)},n?n(r.exports,"apply",{value:o}):r.exports.apply=o}}),lK=g({"node_modules/which-typed-array/index.js"(t,r){var i=lq(),n=lH(),a=lX(),o=lO(),s=lb(),l=lP(),u=o("Object.prototype.toString"),c=lr()(),h=typeof globalThis>"u"?window:globalThis,d=n(),f=o("String.prototype.slice"),p=o("Array.prototype.indexOf",!0)||function(t,r){for(var i=0;i-1?a:"Object"===a&&(n=!1,i(m,function(r,i){if(!n)try{r(t),n=f(i,1)}catch{}}),n)}return s?(r=!1,i(m,function(i,n){if(!r)try{"$"+i(t)===n&&(r=f(n,1))}catch{}}),r):null}}}),lJ=g({"node_modules/is-typed-array/index.js"(t,r){var i=lK();r.exports=function(t){return!!i(t)}}}),lQ=g({"node_modules/util/support/types.js"(t){var r,i,n=lR(),a=lV(),o=lK(),s=lJ();function l(t){return t.call.bind(t)}var u="u">typeof BigInt,c="u">typeof Symbol,h=l(Object.prototype.toString),d=l(Number.prototype.valueOf),f=l(String.prototype.valueOf),p=l(Boolean.prototype.valueOf);function m(t,r){if("object"!=typeof t)return!1;try{return r(t),!0}catch{return!1}}function g(t){return"[object Map]"===h(t)}function y(t){return"[object Set]"===h(t)}function v(t){return"[object WeakMap]"===h(t)}function x(t){return"[object WeakSet]"===h(t)}function b(t){return"[object ArrayBuffer]"===h(t)}function _(t){return!(typeof ArrayBuffer>"u")&&(b.working?b(t):t instanceof ArrayBuffer)}function w(t){return"[object DataView]"===h(t)}function T(t){return!(typeof DataView>"u")&&(w.working?w(t):t instanceof DataView)}u&&(r=l(BigInt.prototype.valueOf)),c&&(i=l(Symbol.prototype.valueOf)),t.isArgumentsObject=n,t.isGeneratorFunction=a,t.isTypedArray=s,t.isPromise=function(t){return"u">typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},t.isArrayBufferView=function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},t.isUint8Array=function(t){return"Uint8Array"===o(t)},t.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},t.isUint16Array=function(t){return"Uint16Array"===o(t)},t.isUint32Array=function(t){return"Uint32Array"===o(t)},t.isInt8Array=function(t){return"Int8Array"===o(t)},t.isInt16Array=function(t){return"Int16Array"===o(t)},t.isInt32Array=function(t){return"Int32Array"===o(t)},t.isFloat32Array=function(t){return"Float32Array"===o(t)},t.isFloat64Array=function(t){return"Float64Array"===o(t)},t.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},t.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},g.working="u">typeof Map&&g(new Map),t.isMap=function(t){return!(typeof Map>"u")&&(g.working?g(t):t instanceof Map)},y.working="u">typeof Set&&y(new Set),t.isSet=function(t){return!(typeof Set>"u")&&(y.working?y(t):t instanceof Set)},v.working="u">typeof WeakMap&&v(new WeakMap),t.isWeakMap=function(t){return!(typeof WeakMap>"u")&&(v.working?v(t):t instanceof WeakMap)},x.working="u">typeof WeakSet&&x(new WeakSet),t.isWeakSet=function(t){return x(t)},b.working="u">typeof ArrayBuffer&&b(new ArrayBuffer),t.isArrayBuffer=_,w.working="u">typeof ArrayBuffer&&"u">typeof DataView&&w(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=T;var A="u">typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function M(t){return"[object SharedArrayBuffer]"===h(t)}function k(t){return!(typeof A>"u")&&(typeof M.working>"u"&&(M.working=M(new A)),M.working?M(t):t instanceof A)}function S(t){return m(t,d)}function E(t){return m(t,f)}function D(t){return m(t,p)}function C(t){return u&&m(t,r)}function I(t){return c&&m(t,i)}t.isSharedArrayBuffer=k,t.isAsyncFunction=function(t){return"[object AsyncFunction]"===h(t)},t.isMapIterator=function(t){return"[object Map Iterator]"===h(t)},t.isSetIterator=function(t){return"[object Set Iterator]"===h(t)},t.isGeneratorObject=function(t){return"[object Generator]"===h(t)},t.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===h(t)},t.isNumberObject=S,t.isStringObject=E,t.isBooleanObject=D,t.isBigIntObject=C,t.isSymbolObject=I,t.isBoxedPrimitive=function(t){return S(t)||E(t)||D(t)||C(t)||I(t)},t.isAnyArrayBuffer=function(t){return"u">typeof Uint8Array&&(_(t)||k(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){throw Error(r+" is not supported in userland")}})})}}),l0=g({"node_modules/util/support/isBufferBrowser.js"(t,r){r.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}}}),l1=g({"(disabled):node_modules/util/util.js"(t){var r=Object.getOwnPropertyDescriptors||function(t){for(var r=Object.keys(t),i={},n=0;n=s)return t;switch(t){case"%s":return String(a[n++]);case"%d":return Number(a[n++]);case"%j":try{return JSON.stringify(a[n++])}catch{return"[Circular]"}default:return t}}),u=a[n];ntypeof E&&!0===E.noDeprecation)return r;if(typeof E>"u")return function(){return t.deprecate(r,i).apply(this,arguments)};var n=!1;return function(){if(!n){if(E.throwDeprecation)throw Error(i);E.traceDeprecation?console.trace(i):console.error(i),n=!0}return r.apply(this,arguments)}};var n={},a=/^$/;function o(r,i){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(i)?n.showHidden=i:i&&t._extend(n,i),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,r,n.depth)}function s(t,r){var i=o.styles[r];return i?"\x1b["+o.colors[i][0]+"m"+t+"\x1b["+o.colors[i][1]+"m":t}function l(t,r){return t}function u(r,i,n){if(r.customInspect&&i&&w(i.inspect)&&i.inspect!==t.inspect&&!(i.constructor&&i.constructor.prototype===i)){var a,o,s,l,x,T,A=i.inspect(n,r);return g(A)||(A=u(r,A,n)),A}var M=function(t,r){if(y(r))return t.stylize("undefined","undefined");if(g(r)){var i="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(i,"string")}return m(r)?t.stylize(""+r,"number"):f(r)?t.stylize(""+r,"boolean"):p(r)?t.stylize("null","null"):void 0}(r,i);if(M)return M;var S=Object.keys(i),E=(x={},S.forEach(function(t,r){x[t]=!0}),x);if(r.showHidden&&(S=Object.getOwnPropertyNames(i)),_(i)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return c(i);if(0===S.length){if(w(i)){var D=i.name?": "+i.name:"";return r.stylize("[Function"+D+"]","special")}if(v(i))return r.stylize(RegExp.prototype.toString.call(i),"regexp");if(b(i))return r.stylize(Date.prototype.toString.call(i),"date");if(_(i))return c(i)}var C="",I=!1,L=["{","}"];return(d(i)&&(I=!0,L=["[","]"]),w(i)&&(C=" [Function"+(i.name?": "+i.name:"")+"]"),v(i)&&(C=" "+RegExp.prototype.toString.call(i)),b(i)&&(C=" "+Date.prototype.toUTCString.call(i)),_(i)&&(C=" "+c(i)),0!==S.length||I&&0!=i.length)?n<0?v(i)?r.stylize(RegExp.prototype.toString.call(i),"regexp"):r.stylize("[Object]","special"):(r.seen.push(i),T=I?function(t,r,i,n,a){for(var o=[],s=0,l=r.length;s=0&&l++,t+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?s[0]+(""===o?"":o+` - `)+" "+a.join(`, - `)+" "+s[1]:s[0]+o+" "+a.join(", ")+" "+s[1]):L[0]+C+L[1]}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,r,i,n,a,o){var s,l,c;if((c=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),k(n,a)||(s="["+a+"]"),l||(0>t.seen.indexOf(c.value)?(l=p(i)?u(t,c.value,null):u(t,c.value,i-1)).indexOf(` -`)>-1&&(l=o?l.split(` -`).map(function(t){return" "+t}).join(` -`).slice(2):` -`+l.split(` -`).map(function(t){return" "+t}).join(` -`)):l=t.stylize("[Circular]","special")),y(s)){if(o&&a.match(/^\d+$/))return l;(s=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+l}function d(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function p(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function b(t){return x(t)&&"[object Date]"===T(t)}function _(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}a=RegExp("^"+"false".replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()+"$","i"),t.debuglog=function(r){if(!n[r=r.toUpperCase()])if(a.test(r)){var i=E.pid;n[r]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",r,i,n)}}else n[r]=function(){};return n[r]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=lQ(),t.isArray=d,t.isBoolean=f,t.isNull=p,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=b,t.types.isDate=b,t.isError=_,t.types.isNativeError=_,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||typeof t>"u"},t.isBuffer=l0();var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(t,r){return Object.prototype.hasOwnProperty.call(t,r)}t.log=function(){var r,i;console.log("%s - %s",(i=[A((r=new Date).getHours()),A(r.getMinutes()),A(r.getSeconds())].join(":"),[r.getDate(),M[r.getMonth()],i].join(" ")),t.format.apply(t,arguments))},t.inherits=s6(),t._extend=function(t,r){if(!r||!x(r))return t;for(var i=Object.keys(r),n=i.length;n--;)t[i[n]]=r[i[n]];return t};var S="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function D(t,r){if(!t){var i=Error("Promise was rejected with a falsy value");i.reason=t,t=i}return r(t)}t.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(S&&t[S]){var i=t[S];if("function"!=typeof i)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(i,S,{value:i,enumerable:!1,writable:!1,configurable:!0}),i}function i(){for(var r,i,n=new Promise(function(t,n){r=t,i=n}),a=[],o=0;o0?this.tail.next=r:this.head=r,this.tail=r,++this.length}},{key:"unshift",value:function(t){var r={data:t,next:this.head};0===this.length&&(this.tail=r),this.head=r,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var r=this.head,i=""+r.data;r=r.next;)i+=t+r.data;return i}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var r,i,n=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)r=a.data,i=s,o.prototype.copy.call(r,n,i),s+=a.data.length,a=a.next;return n}},{key:"consume",value:function(t,r){var i;return ta.length?a.length:t;if(o===a.length?n+=a:n+=a.slice(0,t),0==(t-=o)){o===a.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(o));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(t){var r=o.allocUnsafe(t),i=this.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var a=i.data,s=t>a.length?a.length:t;if(a.copy(r,r.length-t,0,s),0==(t-=s)){s===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++n}return this.length-=n,r}},{key:l,value:function(t,r){return s(this,n(n({},r),{},{depth:0,customInspect:!1}))}}],function(t,r){for(var i=0;i2?"one of ".concat(r," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(r," ").concat(t[0]," or ").concat(t[1]):"of ".concat(r," ").concat(t[0])}n("ERR_INVALID_OPT_VALUE",function(t,r){return'The value "'+r+'" is invalid for option "'+t+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(t,r,i){if("string"==typeof r&&(n="not ",r.substr(0,n.length)===n)?(u="must not be",r=r.replace(/^not /,"")):u="must be",o=" argument",(void 0===s||s>t.length)&&(s=t.length),t.substring(s-o.length,s)===o)c="The ".concat(t," ").concat(u," ").concat(a(r,"type"));else{var n,o,s,l,u,c,h=("number"!=typeof l&&(l=0),l+1>t.length||-1===t.indexOf(".",l))?"argument":"property";c='The "'.concat(t,'" ').concat(h," ").concat(u," ").concat(a(r,"type"))}return c+". Received type ".concat(typeof i)},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),r.exports.codes=i}}),l4=g({"node_modules/readable-stream/lib/internal/streams/state.js"(t,r){var i=l5().codes.ERR_INVALID_OPT_VALUE;r.exports={getHighWaterMark:function(t,r,n,a){var o=null!=r.highWaterMark?r.highWaterMark:a?r[n]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new i(a?n:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}}}),l6=g({"node_modules/util-deprecate/browser.js"(t,r){r.exports=function(t,r){if(i("noDeprecation"))return t;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw Error(r);i("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return t.apply(this,arguments)}};function i(t){try{if(!window.localStorage)return!1}catch{return!1}var r=window.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}}}),l8=g({"node_modules/readable-stream/lib/_stream_writable.js"(t,r){function i(t){var r=this;this.next=null,this.entry=null,this.finish=function(){var i=r,n=t,a=i.entry;for(i.entry=null;a;){var o=a.callback;n.pendingcb--,o(void 0),a=a.next}n.corkedRequestsFree.next=i}}r.exports=A,A.WritableState=T;var n,a,o={deprecate:l6()},s=s8(),l=le().Buffer,u=("u">typeof window||"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},c=l3(),h=l4().getHighWaterMark,d=l5().codes,f=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,m=d.ERR_MULTIPLE_CALLBACK,g=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,x=d.ERR_STREAM_WRITE_AFTER_END,b=d.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function w(){}function T(t,r,a){n=n||l7(),t=t||{},"boolean"!=typeof a&&(a=r instanceof n),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var i=t._writableState,n=i.sync,a=i.writecb;if("function"!=typeof a)throw new m;if(i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,r)--i.pendingcb,n?(E.nextTick(a,r),E.nextTick(I,t,i),t._writableState.errorEmitted=!0,_(t,r)):(a(r),t._writableState.errorEmitted=!0,_(t,r),I(t,i));else{var o=D(i)||t.destroyed;o||i.corked||i.bufferProcessing||!i.bufferedRequest||S(t,i),n?E.nextTick(k,t,i,o,a):k(t,i,o,a)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(t){var r=this instanceof(n=n||l7());if(!r&&!a.call(A,this))return new A(t);this._writableState=new T(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function M(t,r,i,n,a,o,s){r.writelen=n,r.writecb=s,r.writing=!0,r.sync=!0,r.destroyed?r.onwrite(new y("write")):i?t._writev(a,r.onwrite):t._write(a,o,r.onwrite),r.sync=!1}function k(t,r,i,n){var a,o;i||(a=t,0===(o=r).length&&o.needDrain&&(o.needDrain=!1,a.emit("drain"))),r.pendingcb--,n(),I(t,r)}function S(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var a=Array(r.bufferedRequestCount),o=r.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,M(t,r,!0,r.length,a,"",o.finish),r.pendingcb++,r.lastBufferedRequest=null,o.next?(r.corkedRequestsFree=o.next,o.next=null):r.corkedRequestsFree=new i(r),r.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,c=n.encoding,h=n.callback,d=r.objectMode?1:u.length;if(M(t,r,!1,d,u,c,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function D(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function C(t,r){t._final(function(i){r.pendingcb--,i&&_(t,i),r.prefinished=!0,t.emit("prefinish"),I(t,r)})}function I(t,r){var i=D(r);if(i&&(r.prefinished||r.finalCalled||("function"!=typeof t._final||r.destroyed?(r.prefinished=!0,t.emit("prefinish")):(r.pendingcb++,r.finalCalled=!0,E.nextTick(C,t,r))),0===r.pendingcb&&(r.finished=!0,t.emit("finish"),r.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return i}s6()(A,s),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r},function(){try{Object.defineProperty(T.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!a.call(this,t)||this===A&&t&&t._writableState instanceof T}})):a=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new g)},A.prototype.write=function(t,r,i){var n,a,o,s,c,h,d,p=this._writableState,m=!1,g=!p.objectMode&&(n=t,l.isBuffer(n)||n instanceof u);return g&&!l.isBuffer(t)&&(a=t,t=l.from(a)),"function"==typeof r&&(i=r,r=null),g?r="buffer":r||(r=p.defaultEncoding),"function"!=typeof i&&(i=w),p.ending?(o=i,_(this,s=new x),E.nextTick(o,s)):(g||(c=t,h=i,null===c?d=new v:"string"==typeof c||p.objectMode||(d=new f("chunk",["string","Buffer"],c)),!d||(_(this,d),E.nextTick(h,d),0)))&&(p.pendingcb++,m=function(t,r,i,n,a,o){if(!i){var s,u,c=(s=n,u=a,r.objectMode||!1===r.decodeStrings||"string"!=typeof s||(s=l.from(s,u)),s);n!==c&&(i=!0,a="buffer",n=c)}var h=r.objectMode?1:n.length;r.length+=h;var d=r.length-1))throw new b(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,r,i){i(new p("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,r,i){var n,a,o,s=this._writableState;return"function"==typeof t?(i=t,t=null,r=null):"function"==typeof r&&(i=r,r=null),null!=t&&this.write(t,r),s.corked&&(s.corked=1,this.uncork()),s.ending||(n=this,a=s,o=i,a.ending=!0,I(n,a),o&&(a.finished?E.nextTick(o):n.once("finish",o)),a.ended=!0,n.writable=!1),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(t,r){r(t)}}}),l7=g({"node_modules/readable-stream/lib/_stream_duplex.js"(t,r){var i,n,a,o=Object.keys||function(t){var r=[];for(var i in t)r.push(i);return r};r.exports=u;var s=un(),l=l8();for(s6()(u,s),i=o(l.prototype),a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function o(t){var r=this.lastTotal-this.lastNeed,i=function(t,r){if((192&r[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&r.length>1){if((192&r[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&r.length>2&&(192&r[2])!=128)return t.lastNeed=2,"�"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(t.copy(this.lastChar,r,0,t.length),this.lastNeed-=t.length)}function s(t,r){if((t.length-r)%2==0){var i=t.toString("utf16le",r);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",r,t.length-1)}function l(t){var r=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,i)}return r}function u(t,r){var i=(t.length-r)%3;return 0===i?t.toString("base64",r):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",r,t.length-i))}function c(t){var r=t&&t.length?this.write(t):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}t.StringDecoder=n,n.prototype.write=function(t){var r,i;if(0===t.length)return"";if(this.lastNeed){if(void 0===(r=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0?(o>0&&(t.lastNeed=o-1),o):--n=0?(o>0&&(t.lastNeed=o-2),o):--n=0?(o>0&&(2===o?o=0:t.lastNeed=o-3),o):0}(this,t,r);if(!this.lastNeed)return t.toString("utf8",r);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",r,n)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}}),ut=g({"node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(t,r){var i=l5().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}r.exports=function t(r,a,o){if("function"==typeof a)return t(r,null,a);a||(a={}),s=o||n,l=!1,o=function(){if(!l){l=!0;for(var t=arguments.length,r=Array(t),i=0;itypeof window||"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},u=l1();n=u&&u.debuglog?u.debuglog("stream"):function(){};var c,h,d,f=l2(),p=l3(),m=l4().getHighWaterMark,g=l5().codes,y=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,x=g.ERR_METHOD_NOT_IMPLEMENTED,b=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;s6()(A,o);var _=p.errorOrDestroy,w=["error","close","destroy","pause","resume"];function T(t,r,n){i=i||l7(),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",n),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=ue().StringDecoder),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||l7(),!(this instanceof A))return new A(t);var r=this instanceof i;this._readableState=new T(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function M(t,r,i,a,o){n("readableAddChunk",r);var u,c,h=t._readableState;if(null===r)h.reading=!1,function(t,r){if(n("onEofChunk"),!r.ended){if(r.decoder){var i=r.decoder.end();i&&i.length&&(r.buffer.push(i),r.length+=r.objectMode?1:i.length)}r.ended=!0,r.sync?D(t):(r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,C(t)))}}(t,h);else if(o||(c=function(t,r){var i;return s.isBuffer(r)||r instanceof l||"string"==typeof r||void 0===r||t.objectMode||(i=new y("chunk",["string","Buffer","Uint8Array"],r)),i}(h,r)),c)_(t,c);else if(h.objectMode||r&&r.length>0)if("string"==typeof r||h.objectMode||Object.getPrototypeOf(r)===s.prototype||(u=r,r=s.from(u)),a)h.endEmitted?_(t,new b):k(t,h,r,!0);else if(h.ended)_(t,new v);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!i?(r=h.decoder.write(r),h.objectMode||0!==r.length?k(t,h,r,!1):I(t,h)):k(t,h,r,!1)}else a||(h.reading=!1,I(t,h));return!h.ended&&(h.lengthr.highWaterMark&&((i=t)>=0x40000000?i=0x40000000:(i--,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i++),r.highWaterMark=i),t<=r.length?t:r.ended?r.length:(r.needReadable=!0,0))}function D(t){var r=t._readableState;n("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(n("emitReadable",r.flowing),r.emittedReadable=!0,E.nextTick(C,t))}function C(t){var r=t._readableState;n("emitReadable_",r.destroyed,r.length,r.ended),!r.destroyed&&(r.length||r.ended)&&(t.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,O(t)}function I(t,r){r.readingMore||(r.readingMore=!0,E.nextTick(L,t,r))}function L(t,r){for(;!r.reading&&!r.ended&&(r.length0,r.resumeScheduled&&!r.paused?r.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){n("readable nexttick read 0"),t.read(0)}function F(t,r){n("resume",r.reading),r.reading||t.read(0),r.resumeScheduled=!1,t.emit("resume"),O(t),r.flowing&&!r.reading&&t.read(0)}function O(t){var r=t._readableState;for(n("flow",r.flowing);r.flowing&&null!==t.read(););}function R(t,r){var i;return 0===r.length?null:(r.objectMode?i=r.buffer.shift():!t||t>=r.length?(i=r.decoder?r.buffer.join(""):1===r.buffer.length?r.buffer.first():r.buffer.concat(r.length),r.buffer.clear()):i=r.buffer.consume(t,r.decoder),i)}function B(t){var r=t._readableState;n("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,E.nextTick(j,r,t))}function j(t,r){if(n("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,r.readable=!1,r.emit("end"),t.autoDestroy)){var i=r._writableState;(!i||i.autoDestroy&&i.finished)&&r.destroy()}}function N(t,r){for(var i=0,n=t.length;i=i.highWaterMark:i.length>0)||i.ended))return n("read: emitReadable",i.length,i.ended),0===i.length&&i.ended?B(this):D(this),null;if(0===(t=S(t,i))&&i.ended)return 0===i.length&&B(this),null;var o=i.needReadable;return n("need readable",o),(0===i.length||i.length-t0?R(t,i):null)?(i.needReadable=i.length<=i.highWaterMark,t=0):(i.length-=t,i.awaitDrain=0),0===i.length&&(i.ended||(i.needReadable=!0),a!==t&&i.ended&&B(this)),null!==r&&this.emit("data",r),r},A.prototype._read=function(t){_(this,new x("_read()"))},A.prototype.pipe=function(t,r){var i,o=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,n("pipe count=%d opts=%j",s.pipesCount,r);var l=r&&!1===r.end||t===E.stdout||t===E.stderr?g:u;function u(){n("onend"),t.end()}s.endEmitted?E.nextTick(l):o.once("end",l),t.on("unpipe",function r(i,a){n("onunpipe"),i===o&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,n("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",c),t.removeListener("error",f),t.removeListener("unpipe",r),o.removeListener("end",u),o.removeListener("end",g),o.removeListener("data",d),h=!0,s.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&c())});var c=(i=o,function(){var t=i._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(i,"data")&&(t.flowing=!0,O(i))});t.on("drain",c);var h=!1;function d(r){n("ondata");var i=t.write(r);n("dest.write",i),!1===i&&((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==N(s.pipes,t))&&!h&&(n("false write response, pause",s.awaitDrain),s.awaitDrain++),o.pause())}function f(r){n("onerror",r),g(),t.removeListener("error",f),0===a(t,"error")&&_(t,r)}function p(){t.removeListener("finish",m),g()}function m(){n("onfinish"),t.removeListener("close",p),g()}function g(){n("unpipe"),o.unpipe(t)}return o.on("data",d),!function(t,r,i){if("function"==typeof t.prependListener)return t.prependListener(r,i);t._events&&t._events[r]?Array.isArray(t._events[r])?t._events[r].unshift(i):t._events[r]=[i,t._events[r]]:t.on(r,i)}(t,"error",f),t.once("close",p),t.once("finish",m),t.emit("pipe",o),s.flowing||(n("pipe resume"),o.resume()),t},A.prototype.unpipe=function(t){var r=this._readableState,i={hasUnpiped:!1};if(0===r.pipesCount)return this;if(1===r.pipesCount)return t&&t!==r.pipes||(t||(t=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var n=r.pipes,a=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var o=0;o0,!1!==a.flowing&&this.resume()):"readable"!==t||a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,n("on readable",a.length,a.reading),a.length?D(this):a.reading||E.nextTick(z,this)),i},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,r){var i=o.prototype.removeListener.call(this,t,r);return"readable"===t&&E.nextTick(P,this),i},A.prototype.removeAllListeners=function(t){var r=o.prototype.removeAllListeners.apply(this,arguments);return("readable"===t||void 0===t)&&E.nextTick(P,this),r},A.prototype.resume=function(){var t,r,i=this._readableState;return i.flowing||(n("resume"),i.flowing=!i.readableListening,t=this,(r=i).resumeScheduled||(r.resumeScheduled=!0,E.nextTick(F,t,r))),i.paused=!1,this},A.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var r=this,i=this._readableState,a=!1;for(var o in t.on("end",function(){if(n("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&r.push(t)}r.push(null)}),t.on("data",function(o){n("wrapped data"),i.decoder&&(o=i.decoder.write(o)),i.objectMode&&null==o||!i.objectMode&&(!o||!o.length)||r.push(o)||(a=!0,t.pause())}),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(r){return function(){return t[r].apply(t,arguments)}}(o));for(var s=0;s0,u=s=function(t){d||(d=t),t&&f.forEach(l),g||(f.forEach(l),c(d))},h=!1,s=function(){h||(h=!0,u.apply(void 0,arguments))},p=!1,t.on("close",function(){p=!0}),void 0===i&&(i=ut()),i(t,{readable:g,writable:a},function(t){if(t)return s(t);p=!0,s()}),m=!1,function(r){if(!p&&!m){if(m=!0,t.setHeader&&"function"==typeof t.abort)return t.abort();if("function"==typeof t.destroy)return t.destroy();s(r||new o("pipe"))}}});return r.reduce(u)}}}),ul=g({"node_modules/stream-browserify/index.js"(t,r){r.exports=n;var i=tM().EventEmitter;function n(){i.call(this)}s6()(n,i),n.Readable=un(),n.Writable=l8(),n.Duplex=l7(),n.Transform=ua(),n.PassThrough=uo(),n.finished=ut(),n.pipeline=us(),n.Stream=n,n.prototype.pipe=function(t,r){var n=this;function a(r){t.writable&&!1===t.write(r)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",a),t.on("drain",o),t._isStdio||r&&!1===r.end||(n.on("end",l),n.on("close",u));var s=!1;function l(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(h(),0===i.listenerCount(this,"error"))throw t}function h(){n.removeListener("data",a),t.removeListener("drain",o),n.removeListener("end",l),n.removeListener("close",u),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",h),n.removeListener("close",h),t.removeListener("close",h)}return n.on("error",c),t.on("error",c),n.on("end",h),n.on("close",h),t.on("close",h),t.emit("pipe",n),t}}}),uu=g({"node_modules/util/util.js"(t){var r=Object.getOwnPropertyDescriptors||function(t){for(var r=Object.keys(t),i={},n=0;n=s)return t;switch(t){case"%s":return String(a[n++]);case"%d":return Number(a[n++]);case"%j":try{return JSON.stringify(a[n++])}catch{return"[Circular]"}default:return t}}),u=a[n];ntypeof E&&!0===E.noDeprecation)return r;if(typeof E>"u")return function(){return t.deprecate(r,i).apply(this,arguments)};var n=!1;return function(){if(!n){if(E.throwDeprecation)throw Error(i);E.traceDeprecation?console.trace(i):console.error(i),n=!0}return r.apply(this,arguments)}};var n={},a=/^$/;function o(r,i){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(i)?n.showHidden=i:i&&t._extend(n,i),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,r,n.depth)}function s(t,r){var i=o.styles[r];return i?"\x1b["+o.colors[i][0]+"m"+t+"\x1b["+o.colors[i][1]+"m":t}function l(t,r){return t}function u(r,i,n){if(r.customInspect&&i&&w(i.inspect)&&i.inspect!==t.inspect&&!(i.constructor&&i.constructor.prototype===i)){var a,o,s,l,x,T,A=i.inspect(n,r);return g(A)||(A=u(r,A,n)),A}var M=function(t,r){if(y(r))return t.stylize("undefined","undefined");if(g(r)){var i="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(i,"string")}return m(r)?t.stylize(""+r,"number"):f(r)?t.stylize(""+r,"boolean"):p(r)?t.stylize("null","null"):void 0}(r,i);if(M)return M;var S=Object.keys(i),E=(x={},S.forEach(function(t,r){x[t]=!0}),x);if(r.showHidden&&(S=Object.getOwnPropertyNames(i)),_(i)&&(S.indexOf("message")>=0||S.indexOf("description")>=0))return c(i);if(0===S.length){if(w(i)){var D=i.name?": "+i.name:"";return r.stylize("[Function"+D+"]","special")}if(v(i))return r.stylize(RegExp.prototype.toString.call(i),"regexp");if(b(i))return r.stylize(Date.prototype.toString.call(i),"date");if(_(i))return c(i)}var C="",I=!1,L=["{","}"];return(d(i)&&(I=!0,L=["[","]"]),w(i)&&(C=" [Function"+(i.name?": "+i.name:"")+"]"),v(i)&&(C=" "+RegExp.prototype.toString.call(i)),b(i)&&(C=" "+Date.prototype.toUTCString.call(i)),_(i)&&(C=" "+c(i)),0!==S.length||I&&0!=i.length)?n<0?v(i)?r.stylize(RegExp.prototype.toString.call(i),"regexp"):r.stylize("[Object]","special"):(r.seen.push(i),T=I?function(t,r,i,n,a){for(var o=[],s=0,l=r.length;s=0&&l++,t+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?s[0]+(""===o?"":o+` - `)+" "+a.join(`, - `)+" "+s[1]:s[0]+o+" "+a.join(", ")+" "+s[1]):L[0]+C+L[1]}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,r,i,n,a,o){var s,l,c;if((c=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),k(n,a)||(s="["+a+"]"),l||(0>t.seen.indexOf(c.value)?(l=p(i)?u(t,c.value,null):u(t,c.value,i-1)).indexOf(` -`)>-1&&(l=o?l.split(` -`).map(function(t){return" "+t}).join(` -`).slice(2):` -`+l.split(` -`).map(function(t){return" "+t}).join(` -`)):l=t.stylize("[Circular]","special")),y(s)){if(o&&a.match(/^\d+$/))return l;(s=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+l}function d(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function p(t){return null===t}function m(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function v(t){return x(t)&&"[object RegExp]"===T(t)}function x(t){return"object"==typeof t&&null!==t}function b(t){return x(t)&&"[object Date]"===T(t)}function _(t){return x(t)&&("[object Error]"===T(t)||t instanceof Error)}function w(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}a=RegExp("^"+"false".replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()+"$","i"),t.debuglog=function(r){if(!n[r=r.toUpperCase()])if(a.test(r)){var i=E.pid;n[r]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",r,i,n)}}else n[r]=function(){};return n[r]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=lQ(),t.isArray=d,t.isBoolean=f,t.isNull=p,t.isNullOrUndefined=function(t){return null==t},t.isNumber=m,t.isString=g,t.isSymbol=function(t){return"symbol"==typeof t},t.isUndefined=y,t.isRegExp=v,t.types.isRegExp=v,t.isObject=x,t.isDate=b,t.types.isDate=b,t.isError=_,t.types.isNativeError=_,t.isFunction=w,t.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||typeof t>"u"},t.isBuffer=l0();var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(t,r){return Object.prototype.hasOwnProperty.call(t,r)}t.log=function(){var r,i;console.log("%s - %s",(i=[A((r=new Date).getHours()),A(r.getMinutes()),A(r.getSeconds())].join(":"),[r.getDate(),M[r.getMonth()],i].join(" ")),t.format.apply(t,arguments))},t.inherits=s6(),t._extend=function(t,r){if(!r||!x(r))return t;for(var i=Object.keys(r),n=i.length;n--;)t[i[n]]=r[i[n]];return t};var S="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function D(t,r){if(!t){var i=Error("Promise was rejected with a falsy value");i.reason=t,t=i}return r(t)}t.promisify=function(t){if("function"!=typeof t)throw TypeError('The "original" argument must be of type Function');if(S&&t[S]){var i=t[S];if("function"!=typeof i)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(i,S,{value:i,enumerable:!1,writable:!1,configurable:!0}),i}function i(){for(var r,i,n=new Promise(function(t,n){r=t,i=n}),a=[],o=0;o"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var t,r=a(u);return t=s?Reflect.construct(r,arguments,a(this).constructor):r.apply(this,arguments),function(t,r){if(r&&("object"===i(r)||"function"==typeof r))return r;if(void 0!==r)throw TypeError("Derived constructors may only return object or undefined");var n=t;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,t)});function u(i,n,a){var o;return function(t,r){if(!(t instanceof r))throw TypeError("Cannot call a class as a function")}(this,u),(o=l.call(this,"string"==typeof r?r:r(i,n,a))).code=t,o}return Object.defineProperty(u,"prototype",{writable:!1}),u}(o);l[t]=s}function c(t,r){if(!Array.isArray(t))return"of ".concat(r," ").concat(String(t));var i=t.length;return t=t.map(function(t){return String(t)}),i>2?"one of ".concat(r," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(r," ").concat(t[0]," or ").concat(t[1]):"of ".concat(r," ").concat(t[0])}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(t,r,n){if(void 0===o&&(o=uE()),o("string"==typeof t,"'name' must be a string"),"string"==typeof r&&(a="not ",r.substr(0,a.length)===a)?(h="must not be",r=r.replace(/^not /,"")):h="must be",s=" argument",(void 0===l||l>t.length)&&(l=t.length),t.substring(l-s.length,l)===s)d="The ".concat(t," ").concat(h," ").concat(c(r,"type"));else{var a,s,l,u,h,d,f=("number"!=typeof u&&(u=0),u+1>t.length||-1===t.indexOf(".",u))?"argument":"property";d='The "'.concat(t,'" ').concat(f," ").concat(h," ").concat(c(r,"type"))}return d+". Received type ".concat(i(n))},TypeError),u("ERR_INVALID_ARG_VALUE",function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=uu());var n=s.inspect(r);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(i,". Received ").concat(n)},TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",function(t,r,n){var a;return a=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(i(n)),"Expected ".concat(t,' to be returned from the "').concat(r,'"')+" function but got ".concat(a,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var t=arguments.length,r=Array(t),i=0;i0,"At least one arg needs to be specified");var n="The ",a=r.length;switch(r=r.map(function(t){return'"'.concat(t,'"')}),a){case 1:n+="".concat(r[0]," argument");break;case 2:n+="".concat(r[0]," and ").concat(r[1]," arguments");break;default:n+=r.slice(0,a-1).join(", "),n+=", and ".concat(r[a-1]," arguments")}return"".concat(n," must be specified")},TypeError),r.exports.codes=l}}),uh=g({"node_modules/assert/build/internal/assert/assertion_error.js"(t,r){function i(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),i.push.apply(i,n)}return i}function n(t){for(var r=1;rtypeof r){if(r.has(t))return r.get(t);r.set(t,n)}function n(){return u(t,arguments,d(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,t)})(t)}function u(t,r,i){return(u=c()?Reflect.construct.bind():function(t,r,i){var n=[null];n.push.apply(n,r);var a=new(Function.bind.apply(t,n));return i&&h(a,i.prototype),a}).apply(null,arguments)}function c(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(t,r){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t})(t,r)}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var p=uu().inspect,m=uc().codes.ERR_INVALID_ARG_TYPE;function g(t,r,i){return(void 0===i||i>t.length)&&(i=t.length),t.substring(i-r.length,i)===r}var y="",v="",x="",b="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(t){var r=Object.keys(t),i=Object.create(Object.getPrototypeOf(t));return r.forEach(function(r){i[r]=t[r]}),Object.defineProperty(i,"message",{value:t.message}),i}function T(t){return p(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}r.exports=function(t,r){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");A.prototype=Object.create(t&&t.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),t&&h(A,t);var i,l,u=(i=c(),function(){var t,r=d(A);return t=i?Reflect.construct(r,arguments,d(this).constructor):r.apply(this,arguments),o(this,t)});function A(t){if(function(t,r){if(!(t instanceof r))throw TypeError("Cannot call a class as a function")}(this,A),"object"!==f(t)||null===t)throw new m("options","Object",t);var r,i=t.message,n=t.operator,a=t.stackStartFn,l=t.actual,c=t.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=u.call(this,String(i));else if(E.stderr&&E.stderr.isTTY&&(E.stderr&&E.stderr.getColorDepth&&1!==E.stderr.getColorDepth()?(y="\x1b[34m",v="\x1b[32m",b="\x1b[39m",x="\x1b[31m"):(y="",v="",b="",x="")),"object"===f(l)&&null!==l&&"object"===f(c)&&null!==c&&"stack"in l&&l instanceof Error&&"stack"in c&&c instanceof Error&&(l=w(l),c=w(c)),"deepStrictEqual"===n||"strictEqual"===n)r=u.call(this,function(t,r,i){var n="",a="",o=0,s="",l=!1,u=T(t),c=u.split(` -`),h=T(r).split(` -`),d=0,p="";if("strictEqual"===i&&"object"===f(t)&&"object"===f(r)&&null!==t&&null!==r&&(i="strictEqualObject"),1===c.length&&1===h.length&&c[0]!==h[0]){var m=c[0].length+h[0].length;if(m<=10){if(("object"!==f(t)||null===t)&&("object"!==f(r)||null===r)&&(0!==t||0!==r))return"".concat(_[i],` - -`)+"".concat(c[0]," !== ").concat(h[0],` -`)}else if("strictEqualObject"!==i&&m<(E.stderr&&E.stderr.isTTY?E.stderr.columns:80)){for(;c[0][d]===h[0][d];)d++;d>2&&(p=` - `.concat(function(t,r){if(r=Math.floor(r),0==t.length||0==r)return"";var i=t.length*r;for(r=Math.floor(Math.log(r)/Math.log(2));r;)t+=t,r--;return t+t.substring(0,i-t.length)}(" ",d),"^"),d=0)}}for(var w=c[c.length-1],A=h[h.length-1];w===A&&(d++<2?s=` - `.concat(w).concat(s):n=w,c.pop(),h.pop(),0!==c.length&&0!==h.length);)w=c[c.length-1],A=h[h.length-1];var M=Math.max(c.length,h.length);if(0===M){var k=u.split(` -`);if(k.length>30)for(k[26]="".concat(y,"...").concat(b);k.length>27;)k.pop();return"".concat(_.notIdentical,` - -`).concat(k.join(` -`),` -`)}d>3&&(s=` -`.concat(y,"...").concat(b).concat(s),l=!0),""!==n&&(s=` - `.concat(n).concat(s),n="");var S=0,D=_[i]+` -`.concat(v,"+ actual").concat(b," ").concat(x,"- expected").concat(b),C=" ".concat(y,"...").concat(b," Lines skipped");for(d=0;d1&&d>2&&(I>4?(a+=` -`.concat(y,"...").concat(b),l=!0):I>3&&(a+=` - `.concat(h[d-2]),S++),a+=` - `.concat(h[d-1]),S++),o=d,n+=` -`.concat(x,"-").concat(b," ").concat(h[d]),S++;else if(h.length1&&d>2&&(I>4?(a+=` -`.concat(y,"...").concat(b),l=!0):I>3&&(a+=` - `.concat(c[d-2]),S++),a+=` - `.concat(c[d-1]),S++),o=d,a+=` -`.concat(v,"+").concat(b," ").concat(c[d]),S++;else{var L=h[d],P=c[d],z=P!==L&&(!g(P,",")||P.slice(0,-1)!==L);z&&g(L,",")&&L.slice(0,-1)===P&&(z=!1,P+=","),z?(I>1&&d>2&&(I>4?(a+=` -`.concat(y,"...").concat(b),l=!0):I>3&&(a+=` - `.concat(c[d-2]),S++),a+=` - `.concat(c[d-1]),S++),o=d,a+=` -`.concat(v,"+").concat(b," ").concat(P),n+=` -`.concat(x,"-").concat(b," ").concat(L),S+=2):(a+=n,n="",(1===I||0===d)&&(a+=` - `.concat(P),S++))}if(S>20&&d30)for(p[26]="".concat(y,"...").concat(b);p.length>27;)p.pop();r=1===p.length?u.call(this,"".concat(d," ").concat(p[0])):u.call(this,"".concat(d,` - -`).concat(p.join(` -`),` -`))}else{var M=T(l),k="",S=_[n];"notDeepEqual"===n||"notEqual"===n?(M="".concat(_[n],` - -`).concat(M)).length>1024&&(M="".concat(M.slice(0,1021),"...")):(k="".concat(T(c)),M.length>512&&(M="".concat(M.slice(0,509),"...")),k.length>512&&(k="".concat(k.slice(0,509),"...")),"deepEqual"===n||"equal"===n?M="".concat(S,` - -`).concat(M,` - -should equal - -`):k=" ".concat(n," ").concat(k)),r=u.call(this,"".concat(M).concat(k))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=l,r.expected=c,r.operator=n,Error.captureStackTrace&&Error.captureStackTrace(s(r),a),r.stack,r.name="AssertionError",o(r)}return l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:r,value:function(t,r){return p(this,n(n({},r),{},{customInspect:!1,depth:0}))}}],function(t,r){for(var i=0;i=0&&"[object Function]"===i.call(t.callee)),n}}}),uf=g({"node_modules/object-keys/implementation.js"(t,r){var i,n,a,o,s,l,u,c,h,d,f,p;Object.keys||(n=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=ud(),l=!(s=Object.prototype.propertyIsEnumerable).call({toString:null},"toString"),u=s.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var r=t.constructor;return r&&r.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!d["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch{return!0}}catch{return!0}return!1}(),p=function(t){if(typeof window>"u"||!f)return h(t);try{return h(t)}catch{return!1}},i=function(t){var r=null!==t&&"object"==typeof t,i="[object Function]"===a.call(t),s=o(t),h=r&&"[object String]"===a.call(t),d=[];if(!r&&!i&&!s)throw TypeError("Object.keys called on a non-object");var f=u&&i;if(h&&t.length>0&&!n.call(t,0))for(var m=0;m0)for(var g=0;g-1?n(o):o}}}),ub=g({"node_modules/define-properties/index.js"(t,r){var i=up(),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,o=Array.prototype.concat,s=l$(),l=lW()(),u=function(t,r,i,n){if(r in t){if(!0===n){if(t[r]===i)return}else if("function"!=typeof n||"[object Function]"!==a.call(n)||!n())return}l?s(t,r,i,!0):s(t,r,i)},c=function(t,r){var a=arguments.length>2?arguments[2]:{},s=i(r);n&&(s=o.call(s,Object.getOwnPropertySymbols(r)));for(var l=0;ltypeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,a,o,s,l=[],u=!0,c=!1;try{if(o=(i=i.call(t)).next,0===r){if(Object(i)!==i)return;u=!1}else for(;!(u=(n=o.call(i)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(t){c=!0,a=t}finally{try{if(!u&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw a}}return l}}(t,r)||function(t,r){if(t){if("string"==typeof t)return n(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(t,r)}}(t,r)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function n(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,n=Array(r);i10)return!0;for(var r=0;r57)return!0}return 10===t.length&&t>=0x100000000}function P(t){return Object.keys(t).filter(L).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function z(t,r){if(t===r)return 0;for(var i=t.length,n=r.length,a=0,o=Math.min(i,n);a1?i-1:0),a=1;a1?i-1:0),a=1;a1?i-1:0),a=1;a1?i-1:0),a=1;a0){var s=t;if(!((s=String(s)).length>100)){var l=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(s);if(l){var u=parseFloat(l[1]);switch((l[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:break}}}return}if("number"===o&&!1===isNaN(t)){return r.long?i(n=t,864e5,"day")||i(n,36e5,"hour")||i(n,6e4,"minute")||i(n,1e3,"second")||n+" ms":(a=t)>=864e5?Math.round(a/864e5)+"d":a>=36e5?Math.round(a/36e5)+"h":a>=6e4?Math.round(a/6e4)+"m":a>=1e3?Math.round(a/1e3)+"s":a+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}}),uC=g({"node_modules/debug/src/debug.js"(t,r){var i;function n(r){function n(){if(n.enabled){var r=+new Date;n.diff=r-(i||r),n.prev=i,n.curr=r,i=r;for(var a=Array(arguments.length),o=0;otypeof E&&"env"in E&&(r=E.env.DEBUG),r}(t=r.exports=uC()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(r){var i=this.useColors;if(r[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+r[0]+(i?"%c ":" ")+"+"+t.humanize(this.diff),i){var n="color: "+this.color;r.splice(1,0,n,"color: inherit");var a=0,o=0;r[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(a++,"%c"===t&&(o=a))}),r.splice(o,0,n)}},t.save=function(r){try{null==r?t.storage.removeItem("debug"):t.storage.debug=r}catch{}},t.load=i,t.useColors=function(){return"u">typeof window&&!!window.process&&"renderer"===window.process.type||"u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="u">typeof chrome&&"u">typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(i())}}),uL=g({"node_modules/stream-parser/index.js"(t,r){var i=uE(),n=uI()("stream-parser");function a(t){n("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,r){i(!this._parserCallback,'there is already a "callback" set!'),i(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||a(this),n("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=r,this._parserState=0}function s(t,r){i(!this._parserCallback,'there is already a "callback" set!'),i(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||a(this),n("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=r,this._parserState=1}function l(t,r){i(!this._parserCallback,'There is already a "callback" set!'),i(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||a(this),n("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=r,this._parserState=2}function u(t,r,i){this._parserInit||a(this),n("write(%o bytes)",t.length),"function"==typeof r&&(i=r),d(this,t,null,i)}function c(t,r,i){this._parserInit||a(this),n("transform(%o bytes)",t.length),"function"!=typeof r&&(r=this._parserOutput),d(this,t,r,i)}function h(t,r,i,a){if(t._parserBytesLeft-=r.length,n("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(r),t._parserBuffered+=r.length):2===t._parserState&&i(r),0!==t._parserBytesLeft)return a;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(r=Buffer.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(r=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];r&&s.push(r),i&&s.push(i);var l=o.length>s.length;l&&s.push(f(a));var u=o.apply(t,s);if(!l||a===u)return a}}r.exports=function(t){var r=t&&"function"==typeof t._transform,i=t&&"function"==typeof t._write;if(!r&&!i)throw Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),t._bytes=o,t._skipBytes=s,r&&(t._passthrough=l),r?t._transform=c:t._write=u};var d=f(function t(r,i,n,a){return r._parserBytesLeft<=0?a(Error("got data but not currently parsing anything")):i.length<=r._parserBytesLeft?function(){return h(r,i,n,a)}:function(){var o=i.slice(0,r._parserBytesLeft);return h(r,o,n,function(s){return s?a(s):i.length>o.length?function(){return t(r,i.slice(o.length),n,a)}:void 0})}});function f(t){return function(){for(var r=t.apply(this,arguments);"function"==typeof r;)r=r();return r}}}}),uP=g({"node_modules/probe-image-size/lib/common.js"(t){var r=ul().Transform,i=uL();function n(){r.call(this,{readableObjectMode:!0})}function a(t,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||"",this.name=this.constructor.name,this.message=t,r&&(this.code=r),i&&(this.statusCode=i)}n.prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n.prototype),t.ParserStream=n,t.sliceEq=function(t,r,i){for(var n=r,a=0;a>16},t.readInt16BE=function(r,i){return t.readUInt16BE(r,i)<<16>>16},t.readUInt32LE=function(t,r){return(t[r]|t[r+1]<<8|t[r+2]<<16)+0x1000000*t[r+3]},t.readUInt32BE=function(t,r){return 0x1000000*t[r]+(t[r+1]<<16|t[r+2]<<8|t[r+3])},t.readInt32LE=function(r,i){return 0|t.readUInt32LE(r,i)},t.readInt32BE=function(r,i){return 0|t.readUInt32BE(r,i)},a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,t.ProbeError=a}}),uz=g({"node_modules/probe-image-size/lib/miaf_utils.js"(t,r){var i=uP().readUInt16BE,n=uP().readUInt32BE;function a(t,r){if(t.length<4+r)return null;var i=n(t,r);return t.length>4&15,a=15&t[4],s=t[5]>>4&15,l=i(t,6),u=8,c=0;cr.width||t.width===r.width&&t.height>r.height?t:r}),u=s.reduce(function(t,r){return t.height>r.height||t.height===r.height&&t.width>r.width?t:r}),l.width>u.height||l.width===u.height&&l.height>u.width?l:u),h=1;r.transforms.forEach(function(t){var r={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},i={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(0===t.value?h=i[h]:(h=r[h=i[h]],h=r[h])),"irot"===t.type)for(var n=0;n0&&!this.aborted;){var i=this.ifds_to_read.shift();i.offset&&this.scan_ifd(i.id,i.offset,t)}},n.prototype.read_uint16=function(t){var r=this.input;if(t+2>r.length)throw i("unexpected EOF","EBADDATA");return this.big_endian?256*r[t]+r[t+1]:r[t]+256*r[t+1]},n.prototype.read_uint32=function(t){var r=this.input;if(t+4>r.length)throw i("unexpected EOF","EBADDATA");return this.big_endian?0x1000000*r[t]+65536*r[t+1]+256*r[t+2]+r[t+3]:r[t]+256*r[t+1]+65536*r[t+2]+0x1000000*r[t+3]},n.prototype.is_subifd_link=function(t,r){return 0===t&&34665===r||0===t&&34853===r||34665===t&&40965===r},n.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},n.prototype.exif_format_read=function(t,r){var i;switch(t){case 1:case 2:return this.input[r];case 6:return(i=this.input[r])|(128&i)*0x1fffffe;case 3:return this.read_uint16(r);case 8:return(i=this.read_uint16(r))|(32768&i)*131070;case 4:return this.read_uint32(r);case 9:return 0|(i=this.read_uint32(r));default:return null}},n.prototype.scan_ifd=function(t,r,n){var a=this.read_uint16(r);r+=2;for(var o=0;othis.input.length)throw i("unexpected EOF","EBADDATA");for(var p=[],m=d,g=0;g0&&(this.ifds_to_read.push({id:s,offset:p[0]}),f=!0),!1===n({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:u,entry_offset:r+this.start,data_length:h,data_offset:d+this.start,value:p,is_subifd_link:f})){this.aborted=!0;return}r+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(r)})},r.exports.ExifParser=n,r.exports.get_orientation=function(t){var r=0;try{return new n(t,0,t.length).each(function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return r=t.value[0],!1}),r}catch{return -1}}}}),uO=g({"node_modules/probe-image-size/lib/parse_sync/avif.js"(t,r){var i=uP().str2arr,n=uP().sliceEq,a=uP().readUInt32BE,o=uz(),s=uF(),l=i("ftyp");r.exports=function(t){if(n(t,4,l)){var r=o.unbox(t,0);if(r){var i=o.getMimeType(r.data);if(i){for(var u,c=r.end;;){var h=o.unbox(t,c);if(!h)break;if(c=h.end,"mdat"===h.boxtype)return;if("meta"===h.boxtype){u=h.data;break}}if(u){var d=o.readSizeFromMeta(u);if(d){var f={width:d.width,height:d.height,type:i.type,mime:i.mime,wUnits:"px",hUnits:"px"};if(d.variants.length>1&&(f.variants=d.variants),d.orientation&&(f.orientation=d.orientation),d.exif_location&&d.exif_location.offset+d.exif_location.length<=t.length){var p=a(t,d.exif_location.offset),m=t.slice(d.exif_location.offset+p+4,d.exif_location.offset+d.exif_location.length),g=s.get_orientation(m);g>0&&(f.orientation=g)}return f}}}}}}}}),uR=g({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(t,r){var i=uP().str2arr,n=uP().sliceEq,a=uP().readInt16LE,o=uP().readInt32LE,s=uP().readUInt32LE,l=i("BM");r.exports=function(t){if(!(t.length<26)&&n(t,0,l)){var r,i,u=s(t,14);if(12===u)i=a(t,18),r=a(t,20);else{if(!(u>12))return;i=o(t,18),r=o(t,22)}return{width:i,height:Math.abs(r),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}}),uB=g({"node_modules/probe-image-size/lib/parse_sync/gif.js"(t,r){var i=uP().str2arr,n=uP().sliceEq,a=uP().readUInt16LE,o=i("GIF87a"),s=i("GIF89a");r.exports=function(t){if(!(t.length<10)&&!(!n(t,0,o)&&!n(t,0,s)))return{width:a(t,6),height:a(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),uj=g({"node_modules/probe-image-size/lib/parse_sync/ico.js"(t,r){var i=uP().readUInt16LE;r.exports=function(t){var r=i(t,0),n=i(t,2),a=i(t,4);if(!(0!==r||1!==n||!a)&&!(t.length<6+16*a)){for(var o=[],s={width:0,height:0},l=0;ls.width||c>s.height)&&(s=h)}return{width:s.width,height:s.height,variants:o,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),uN=g({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(t,r){var i=uP().readUInt16BE,n=uP().str2arr,a=uP().sliceEq,o=uF(),s=n("Exif\0\0");r.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var r=2;;){for(;;){if(t.length-r<2)return;if(255===t[r++])break}for(var n,l,u=t[r++];255===u;)u=t[r++];if(u>=208&&u<=217||1===u)l=0;else{if(!(u>=192)||!(u<=254)||t.length-r<2)return;l=i(t,r)-2,r+=2}if(217===u||218===u)return;if(225===u&&l>=10&&a(t,r,s)&&(n=o.get_orientation(t.slice(r+6,r+l))),l>=5&&u>=192&&u<=207&&196!==u&&200!==u&&204!==u){if(t.length-r0&&(c.orientation=n),c}r+=l}}}}),uV=g({"node_modules/probe-image-size/lib/parse_sync/png.js"(t,r){var i=uP().str2arr,n=uP().sliceEq,a=uP().readUInt32BE,o=i(`\x89PNG\r - -`),s=i("IHDR");r.exports=function(t){if(!(t.length<24)&&n(t,0,o)&&n(t,12,s))return{width:a(t,16),height:a(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),uU=g({"node_modules/probe-image-size/lib/parse_sync/psd.js"(t,r){var i=uP().str2arr,n=uP().sliceEq,a=uP().readUInt32BE,o=i("8BPS\0\x01");r.exports=function(t){if(!(t.length<22)&&n(t,0,o))return{width:a(t,18),height:a(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),uq=g({"node_modules/probe-image-size/lib/parse_sync/svg.js"(t,r){function i(t){return"number"==typeof t&&isFinite(t)&&t>0}var n=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,u=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(t){return u.test(t)?t.match(u)[0]:"px"}r.exports=function(t){if(function(t){var r,i=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(i=3);it.length)){for(;r+8=10?i=i||function(t,r){if(157===t[r+3]&&1===t[r+4]&&42===t[r+5])return{width:16383&a(t,r+6),height:16383&a(t,r+8),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}(t,r+8):"VP8L"===f&&p>=5?i=i||function(t,r){if(47===t[r]){var i=o(t,r+1);return{width:(16383&i)+1,height:(i>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}(t,r+8):"VP8X"===f&&p>=10?i=i||{width:(t[(d=r+8)+6]<<16|t[d+5]<<8|t[d+4])+1,height:(t[d+9]<<16|t[d+8]<<8|t[d+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}:"EXIF"===f&&(c=s.get_orientation(t.slice(r+8,r+8+p)),r=1/0),r+=8+p}if(i)return c>0&&(i.orientation=c),i}}}}}),u$=g({"node_modules/probe-image-size/lib/parsers_sync.js"(t,r){r.exports={avif:uO(),bmp:uR(),gif:uB(),ico:uj(),jpeg:uN(),png:uV(),psd:uU(),svg:uq(),tiff:uG(),webp:uH()}}}),uW=g({"node_modules/probe-image-size/sync.js"(t,r){var i=u$();r.exports=function(t){for(var r=Object.keys(i),n=0;n0&&a.height>0?a:null}return null},r.exports.parsers=i}}),uY=g({"src/traces/image/helpers.js"(t){var r=uW(),i=iz().IMAGE_URL_PREFIX,n=le().Buffer;t.getImageSize=function(t){return r(new n(t.replace(i,""),"base64"))}}}),uZ=g({"src/traces/image/calc.js"(t,r){var i=t_(),n=sW(),a=L(),o=rs(),s=t_().maxRowLength,l=uY().getImageSize;r.exports=function(t,r){if(r._hasZ)c=r.z.length,h=s(r.z);else if(r._hasSource){var u=l(r.source);c=u.height,h=u.width}var c,h,d,f=o.getFromId(t,r.xaxis||"x"),p=o.getFromId(t,r.yaxis||"y"),m=f.d2c(r.x0)-r.dx/2,g=p.d2c(r.y0)-r.dy/2,y=[m,m+h*r.dx],v=[g,g+c*r.dy];if(f&&"log"===f.type)for(d=0;d0;)y=d.c2p(T+_*S),_--;for(_=0;void 0===x&&_0;)b=f.c2p(A+_*E),_--;yF[0];if(O||R){var B=g+D/2,j=x+C/2;P+="transform:"+a(B+"px",j+"px")+"scale("+(O?-1:1)+","+(R?-1:1)+")"+a(-B+"px",-j+"px")+";"}}L.attr("style",P);var N=new Promise(function(t){if(h._hasZ)t();else if(h._hasSource)if(h._canvas&&h._canvas.el.width===M&&h._canvas.el.height===k&&h._canvas.source===h.source)t();else{var r=document.createElement("canvas");r.width=M,r.height=k;var i=r.getContext("2d",{willReadFrequently:!0});h._image=h._image||new Image;var n=h._image;n.onload=function(){i.drawImage(n,0,0),h._canvas={el:r,source:h.source},t()},n.setAttribute("src",h.source)}}).then(function(){var t;if(h._hasZ)t=I(function(t,r){var i=w[r][t];return n.isTypedArray(i)&&(i=Array.from(i)),i}).toDataURL("image/png");else if(h._hasSource)if(m)t=h.source;else{var r=h._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,M,k).data;t=I(function(t,i){var n=4*(i*M+t);return[r[n],r[n+1],r[n+2],r[n+3]]}).toDataURL("image/png")}L.attr({"xlink:href":t,height:C,width:D,x:g,y:x})});t._promises.push(N)})}}}),uK=g({"src/traces/image/style.js"(t,r){var i=k();r.exports=function(t){i.select(t).selectAll(".im image").style("opacity",function(t){return t[0].trace.opacity})}}}),uJ=g({"src/traces/image/hover.js"(t,r){var i=rR(),n=t_(),a=n.isArrayOrTypedArray,o=sW();r.exports=function(t,r,s){var l=t.cd[0],u=l.trace,c=t.xa,h=t.ya;if(!(i.inbox(r-l.x0,r-(l.x0+l.w*u.dx),0)>0||i.inbox(s-l.y0,s-(l.y0+l.h*u.dy),0)>0)){var d,f=Math.floor((r-l.x0)/u.dx),p=Math.floor(Math.abs(s-l.y0)/u.dy);if(u._hasZ?d=l.z[p][f]:u._hasSource&&(d=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,p,1,1).data),d){var m,g,y=l.hi||u.hoverinfo;if(y){var v=y.split("+");-1!==v.indexOf("all")&&(v=["color"]),-1!==v.indexOf("color")&&(g=!0)}var x=o.colormodel[u.colormodel],b=x.colormodel||u.colormodel,_=b.length,w=u._scaler(d),T=x.suffix,A=[];(u.hovertemplate||g)&&(A.push("["+[w[0]+T[0],w[1]+T[1],w[2]+T[2]].join(", ")),4===_&&A.push(", "+w[3]+T[3]),A.push("]"),A=A.join(""),t.extraText=b.toUpperCase()+": "+A),a(u.hovertext)&&a(u.hovertext[p])?m=u.hovertext[p][f]:a(u.text)&&a(u.text[p])&&(m=u.text[p][f]);var M=h.c2p(l.y0+(p+.5)*u.dy),k=l.x0+(f+.5)*u.dx,S=l.y0+(p+.5)*u.dy,E="["+d.slice(0,u.colormodel.length).join(", ")+"]";return[n.extendFlat(t,{index:[p,f],x0:c.c2p(l.x0+f*u.dx),x1:c.c2p(l.x0+(f+1)*u.dx),y0:M,y1:M,color:w,xVal:k,xLabelVal:k,yVal:S,yLabelVal:S,zLabelVal:E,text:m,hovertemplateLabels:{zLabel:E,colorLabel:A,"color[0]Label":w[0]+T[0],"color[1]Label":w[1]+T[1],"color[2]Label":w[2]+T[2],"color[3]Label":w[3]+T[3]}})]}}}}}),uQ=g({"src/traces/image/event_data.js"(t,r){r.exports=function(t,r){return"xVal"in r&&(t.x=r.xVal),"yVal"in r&&(t.y=r.yVal),r.xa&&(t.xaxis=r.xa),r.ya&&(t.yaxis=r.ya),t.color=r.color,t.colormodel=r.trace.colormodel,t.z||(t.z=r.color),t}}}),u0=g({"src/traces/image/index.js"(t,r){r.exports={attributes:(s5(),b(sY)).default,supplyDefaults:s4(),calc:uZ(),plot:uX(),style:uK(),hoverPoints:uJ(),eventData:uQ(),moduleType:"trace",name:"image",basePlotModule:ny(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),u1=g({"lib/image.js"(t,r){r.exports=u0()}}),u2=g({"src/traces/pie/attributes.js"(t,r){var i=K(),n=an().attributes,a=W(),o=er(),{hovertemplateAttrs:s,texttemplateAttrs:l,templatefallbackAttrs:u}=eZ(),c=$().extendFlat,h=eW().pattern,d=a({editType:"plot",arrayOk:!0,colorEditType:"plot"});r.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:h,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:c({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:s({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:u(),texttemplate:l({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:u({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:c({},d,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:c({},d,{}),outsidetextfont:c({},d,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:c({},i.showlegend,{arrayOk:!0}),legend:c({},i.legend,{arrayOk:!0}),legendrank:c({},i.legendrank,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:c({},d,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),u3=g({"src/traces/pie/defaults.js"(t,r){var i=L(),n=t_(),a=u2(),o=an().defaults,s=aS().handleText,l=t_().coercePattern;function u(t,r){var a=n.isArrayOrTypedArray(t),o=n.isArrayOrTypedArray(r),s=Math.min(a?t.length:1/0,o?r.length:1/0);if(isFinite(s)||(s=0),s&&o){for(var l,u=0;u0){l=!0;break}}l||(s=0)}return{hasLabels:a,hasValues:o,len:s}}function c(t,r,i,n,a){n("marker.line.width")&&n("marker.line.color",a?void 0:i.paper_bgcolor);var o=n("marker.colors");l(n,"marker.pattern",o),t.marker&&!r.marker.pattern.fgcolor&&(r.marker.pattern.fgcolor=t.marker.colors),r.marker.pattern.bgcolor||(r.marker.pattern.bgcolor=i.paper_bgcolor)}r.exports={handleLabelsAndValues:u,handleMarkerDefaults:c,supplyDefaults:function(t,r,i,l){function h(i,o){return n.coerce(t,r,a,i,o)}var d,f=u(h("labels"),h("values")),p=f.len;if(r._hasLabels=f.hasLabels,r._hasValues=f.hasValues,!r._hasLabels&&r._hasValues&&(h("label0"),h("dlabel")),!p){r.visible=!1;return}r._length=p,c(t,r,l,h,!0),h("scalegroup");var m=h("text"),g=h("texttemplate");if(h("texttemplatefallback"),g||(d=h("textinfo",n.isArrayOrTypedArray(m)?"text+percent":"percent")),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),g||d&&"none"!==d){var y=h("textposition");s(t,r,l,h,y,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(y)||"auto"===y||"outside"===y)&&h("automargin"),("inside"===y||"auto"===y||Array.isArray(y))&&h("insidetextorientation")}else"none"===d&&h("textposition","none");o(r,l,h);var v=h("hole");if(h("title.text")){var x=h("title.position",v?"middle center":"top center");v||"middle center"!==x||(r.title.position="top center"),n.coerceFont(h,"title.font",l.font)}h("sort"),h("direction"),h("rotation"),h("pull")}}}}),u5=g({"src/traces/pie/layout_attributes.js"(t,r){r.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),u4=g({"src/traces/pie/layout_defaults.js"(t,r){var i=t_(),n=u5();r.exports=function(t,r){function a(a,o){return i.coerce(t,r,n,a,o)}a("hiddenlabels"),a("piecolorway",r.colorway),a("extendpiecolors")}}}),u6=g({"src/traces/pie/calc.js"(t,r){var i=L(),n=ei(),a={};function o(t){return function(r,i){if(!r||!n.isValid(r))return!1;let a=n.rgbaString(r);return t[i]||(t[i]=a),a}}function s(t,r){var i,a=JSON.stringify(t),o=r[a];if(!o){for(o=t.slice(),i=0;i=0}),("funnelarea"===r.type?v:r.sort)&&s.sort(function(t,r){return r.v-t.v}),s[0]&&(s[0].vTotal=y),s},crossTraceCalc:function(t,r){var i=(r||{}).type;i||(i="pie");var n=t._fullLayout,o=t.calcdata,l=n[i+"colorway"],u=n["_"+i+"colormap"];n["extend"+i+"colors"]&&(l=s(l,a));for(var c=0,h=0;h"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:g.castOption(w.bgcolor,t.pts)||t.color,borderColor:g.castOption(w.bordercolor,t.pts),fontFamily:g.castOption(T.family,t.pts),fontSize:g.castOption(T.size,t.pts),fontColor:g.castOption(T.color,t.pts),nameLength:g.castOption(w.namelength,t.pts),textAlign:g.castOption(w.align,t.pts),hovertemplate:g.castOption(d.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[y(t,d)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:r,inOut_bbox:A}),t.bbox=A[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,r.emit("plotly_hover",{points:[y(t,d)],event:i.event})}}),t.on("mouseout",function(t){var n=r._fullLayout,o=r._fullData[c.index],s=i.select(this).datum();c._hasHoverEvent&&(t.originalEvent=i.event,r.emit("plotly_unhover",{points:[y(s,o)],event:i.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)}),t.on("click",function(t){var n=r._fullLayout,o=r._fullData[c.index];r._dragging||!1===n.hovermode||(r._hoverdata=[y(t,o)],a.click(r,i.event))})}function b(t,r,i){var n=g.castOption(t.insidetextfont.color,r.pts);!n&&t._input.textfont&&(n=g.castOption(t._input.textfont.color,r.pts));var a=g.castOption(t.insidetextfont.family,r.pts)||g.castOption(t.textfont.family,r.pts)||i.family,s=g.castOption(t.insidetextfont.size,r.pts)||g.castOption(t.textfont.size,r.pts)||i.size,l=g.castOption(t.insidetextfont.weight,r.pts)||g.castOption(t.textfont.weight,r.pts)||i.weight,u=g.castOption(t.insidetextfont.style,r.pts)||g.castOption(t.textfont.style,r.pts)||i.style,c=g.castOption(t.insidetextfont.variant,r.pts)||g.castOption(t.textfont.variant,r.pts)||i.variant,h=g.castOption(t.insidetextfont.textcase,r.pts)||g.castOption(t.textfont.textcase,r.pts)||i.textcase,d=g.castOption(t.insidetextfont.lineposition,r.pts)||g.castOption(t.textfont.lineposition,r.pts)||i.lineposition,f=g.castOption(t.insidetextfont.shadow,r.pts)||g.castOption(t.textfont.shadow,r.pts)||i.shadow;return{color:n||o.contrast(r.color),family:a,size:s,weight:l,style:u,variant:c,textcase:h,lineposition:d,shadow:f}}function _(t,r){for(var i,n,a=0;au&&u>h||c=-4;y-=2)v(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)v(Math.PI*(y+1),"tan")}if(d||p){for(y=4;y>=-4;y-=2)v(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)v(Math.PI*(y+.5),"rad")}}if(l||m||d){if((o={scale:a*n*2/Math.sqrt(t.width*t.width+t.height*t.height),rCenter:1-a,rotate:0}).textPosAngle=(r.startangle+r.stopangle)/2,o.scale>=1)return o;g.push(o)}(m||p)&&((o=T(t,n,s,u,c)).textPosAngle=(r.startangle+r.stopangle)/2,g.push(o)),(m||f)&&((o=A(t,n,s,u,c)).textPosAngle=(r.startangle+r.stopangle)/2,g.push(o));for(var x=0,b=0,_=0;_=1)break}return g[x]}function T(t,r,i,n,a){r=Math.max(0,r-2*m);var o=t.width/t.height,s=E(o,n,r,i);return{scale:2*s/t.height,rCenter:M(o,s/r),rotate:S(a)}}function A(t,r,i,n,a){r=Math.max(0,r-2*m);var o=t.height/t.width,s=E(o,n,r,i);return{scale:2*s/t.width,rCenter:M(o,s/r),rotate:S(a+Math.PI/2)}}function M(t,r){return Math.cos(r)-t*r}function S(t){return(180/Math.PI*t+720)%180-90}function E(t,r,i,n){var a=t+1/(2*Math.tan(r));return i*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(t*t+n/2)+t))}function D(t,r){var i=r.pxmid[0],n=r.pxmid[1],a=t.width/2,o=t.height/2;return i<0&&(a*=-1),n<0&&(o*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(o)*(a>0?1:-1)/2,y:o/(1+i*i/(n*n)),outside:!0}}function C(t,r){var i,n,a,o=1,s=1,l=t.trace,u={x:t.cx,y:t.cy},c={tx:0,ty:0};c.ty+=l.title.font.size,a=L(l),-1!==l.title.position.indexOf("top")?(u.y-=(1+a)*t.r,c.ty-=t.titleBox.height):-1!==l.title.position.indexOf("bottom")&&(u.y+=(1+a)*t.r);var h=(i=t.r,i/(void 0===(n=t.trace.aspectratio)?1:n)),d=r.w*(l.domain.x[1]-l.domain.x[0])/2;return -1!==l.title.position.indexOf("left")?(d+=h,u.x-=(1+a)*h,c.tx+=t.titleBox.width/2):-1!==l.title.position.indexOf("center")?d*=2:-1!==l.title.position.indexOf("right")&&(d+=h,u.x+=(1+a)*h,c.tx-=t.titleBox.width/2),o=d/t.titleBox.width,s=I(t,r)/t.titleBox.height,{x:u.x,y:u.y,scale:Math.min(o,s),tx:c.tx,ty:c.ty}}function I(t,r){var i=t.trace,n=r.h*(i.domain.y[1]-i.domain.y[0]);return Math.min(t.titleBox.height,n/2)}function L(t){var r,i=t.pull;if(!i)return 0;if(l.isArrayOrTypedArray(i))for(i=0,r=0;ri&&(i=t.pull[r]);return i}function P(t,r){for(var i=[],n=0;n1?u=(l=i.r)/a.aspectratio:l=(u=i.r)*a.aspectratio,l*=(1+a.baseratio)/2,s=l*u),c=Math.min(c,s/i.vTotal));for(n=0;n")}if(o){var b=l.castOption(a,r.i,"texttemplate");if(b){var _={label:r.label,value:r.v,valueLabel:g.formatPieValue(r.v,n.separators),percent:r.v/i.vTotal,percentLabel:g.formatPiePercent(r.v/i.vTotal,n.separators),color:r.color,text:r.text,customdata:l.castOption(a,r.i,"customdata")},w=g.getFirstFilled(a.text,r.pts);(v(w)||""===w)&&(_.text=w),r.text=l.texttemplateString({data:[_,a._meta],fallback:a.texttemplatefallback,labels:_,locale:t._fullLayout._d3locale,template:b})}else r.text=""}}function O(t,r){var i=t.rotate*Math.PI/180,n=Math.cos(i),a=Math.sin(i),o=(r.left+r.right)/2,s=(r.top+r.bottom)/2;t.textX=o*n-s*a,t.textY=o*a+s*n,t.noCenter=!0}r.exports={plot:function(t,r){var a=t._context.staticPlot,d=t._fullLayout,m=d._size;p("pie",d),_(r,t),P(r,m);var y=l.makeTraceGroups(d._pielayer,r,"trace").each(function(r){var p=i.select(this),y=r[0],v=y.trace;(function(t){var r,i,n,a=t[0],o=a.r,s=a.trace,l=g.getRotationAngle(s.rotation),u=2*Math.PI/a.vTotal,c="px0",h="px1";if("counterclockwise"===s.direction){for(r=0;ra.vTotal/2),i.halfangle=Math.PI*Math.min(i.v/a.vTotal,.5),i.ring=1-s.hole,i.rInscribed=i.v!==a.vTotal||a.trace.hole?Math.min(1/(1+1/Math.sin(i.halfangle)),i.ring/2):1)})(r),p.attr("stroke-linejoin","round"),p.each(function(){var _,T,A=i.select(this).selectAll("g.slice").data(r);A.enter().append("g").classed("slice",!0),A.exit().remove();var M=[[[],[]],[[],[]]],k=!1;A.each(function(n,o){if(n.hidden)return void i.select(this).selectAll("path,g").remove();n.pointNumber=n.i,n.curveNumber=v.index,M[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var u=y.cx,c=y.cy,p=i.select(this),m=p.selectAll("path.surface").data([n]);if(m.enter().append("path").classed("surface",!0).style({"pointer-events":a?"none":"all"}),p.call(x,t,r),v.pull){var _=+g.castOption(v.pull,n.pts)||0;_>0&&(u+=_*n.pxmid[0],c+=_*n.pxmid[1])}function T(t,r,i,a){var o=a*(r[0]-t[0]),s=a*(r[1]-t[1]);return"a"+a*y.r+","+a*y.r+" 0 "+n.largeArc+(i?" 1 ":" 0 ")+o+","+s}n.cxFinal=u,n.cyFinal=c;var A=v.hole;if(n.v===y.vTotal){var S="M"+(u+n.px0[0])+","+(c+n.px0[1])+T(n.px0,n.pxmid,!0,1)+T(n.pxmid,n.px0,!0,1)+"Z";A?m.attr("d","M"+(u+A*n.px0[0])+","+(c+A*n.px0[1])+T(n.px0,n.pxmid,!1,A)+T(n.pxmid,n.px0,!1,A)+"Z"+S):m.attr("d",S)}else{var E=T(n.px0,n.px1,!0,1);if(A){var C=1-A;m.attr("d","M"+(u+A*n.px1[0])+","+(c+A*n.px1[1])+T(n.px1,n.px0,!1,A)+"l"+C*n.px0[0]+","+C*n.px0[1]+E+"Z")}else m.attr("d","M"+u+","+c+"l"+n.px0[0]+","+n.px0[1]+E+"Z")}F(t,n,y);var I=g.castOption(v.textposition,n.pts),L=p.selectAll("g.slicetext").data(n.text&&"none"!==I?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each(function(){var a=l.ensureSingle(i.select(this),"text","",function(t){t.attr("data-notex",1)}),p=l.ensureUniformFontSize(t,"outside"===I?(m=v,x=n,_=d.font,{color:g.castOption(m.outsidetextfont.color,x.pts)||g.castOption(m.textfont.color,x.pts)||_.color,family:g.castOption(m.outsidetextfont.family,x.pts)||g.castOption(m.textfont.family,x.pts)||_.family,size:g.castOption(m.outsidetextfont.size,x.pts)||g.castOption(m.textfont.size,x.pts)||_.size,weight:g.castOption(m.outsidetextfont.weight,x.pts)||g.castOption(m.textfont.weight,x.pts)||_.weight,style:g.castOption(m.outsidetextfont.style,x.pts)||g.castOption(m.textfont.style,x.pts)||_.style,variant:g.castOption(m.outsidetextfont.variant,x.pts)||g.castOption(m.textfont.variant,x.pts)||_.variant,textcase:g.castOption(m.outsidetextfont.textcase,x.pts)||g.castOption(m.textfont.textcase,x.pts)||_.textcase,lineposition:g.castOption(m.outsidetextfont.lineposition,x.pts)||g.castOption(m.textfont.lineposition,x.pts)||_.lineposition,shadow:g.castOption(m.outsidetextfont.shadow,x.pts)||g.castOption(m.textfont.shadow,x.pts)||_.shadow}):b(v,n,d.font));a.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,p).call(h.convertToTspans,t);var m,x,_,T,A=s.bBox(a.node());if("outside"===I)T=D(A,n);else if(T=w(A,n,y),"auto"===I&&T.scale<1){var M=l.ensureUniformFontSize(t,v.outsidetextfont);a.call(s.font,M),T=D(A=s.bBox(a.node()),n)}var S=T.textPosAngle,E=void 0===S?n.pxmid:z(y.r,S);if(T.targetX=u+E[0]*T.rCenter+(T.x||0),T.targetY=c+E[1]*T.rCenter+(T.y||0),O(T,A),T.outside){var C=T.targetY;n.yLabelMin=C-A.height/2,n.yLabelMid=C,n.yLabelMax=C+A.height/2,n.labelExtraX=0,n.labelExtraY=0,k=!0}T.fontSize=p.size,f(v.type,T,d),r[o].transform=T,l.setTransormAndDisplay(a,T)})});var S=i.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);if(S.enter().append("g").classed("titletext",!0),S.exit().remove(),S.each(function(){var r,n,a,o=l.ensureSingle(i.select(this),"text","",function(t){t.attr("data-notex",1)}),d=v.title.text;v._meta&&(d=l.templateString(d,v._meta)),o.text(d).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,v.title.font).call(h.convertToTspans,t),a="middle center"===v.title.position?(n=Math.sqrt((r=y).titleBox.width*r.titleBox.width+r.titleBox.height*r.titleBox.height),{x:r.cx,y:r.cy,scale:r.trace.hole*r.r*2/n,tx:0,ty:-r.titleBox.height/2+r.trace.title.font.size}):C(y,m),o.attr("transform",c(a.x,a.y)+u(Math.min(1,a.scale))+c(a.tx,a.ty))}),k&&function(t,r){var i,n,a,o,s,u,c,h,d,f,p,m,y;function v(t,r){return t.pxmid[1]-r.pxmid[1]}function x(t,r){return r.pxmid[1]-t.pxmid[1]}for(n=0;n<2;n++)for(a=n?v:x,s=n?Math.max:Math.min,c=n?1:-1,i=0;i<2;i++){for(o=i?Math.max:Math.min,u=i?1:-1,(h=t[n][i]).sort(a),f=(d=t[1-n][i]).concat(h),m=[],p=0;p0&&(t.labelExtraY=b),l.isArrayOrTypedArray(r.pull))for(h=0;h=(g.castOption(r.pull,d.pts)||0))&&((t.pxmid[1]-d.pxmid[1])*c>0?(b=d.cyFinal+s(d.px0[1],d.px1[1])-y-t.labelExtraY)*c>0&&(t.labelExtraY+=b):(v+t.labelExtraY-x)*c>0&&(a=3*u*Math.abs(h-f.indexOf(t)),(p=d.cxFinal+o(d.px0[0],d.px1[0])+a-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*u>0&&(t.labelExtraX+=p)))}(m[p],b)}}}(M,v),_=A,T=v,_.each(function(t){var r=i.select(this);if(!t.labelExtraX&&!t.labelExtraY)return void r.select("path.textline").remove();var n=r.select("g.slicetext text");t.transform.targetX+=t.labelExtraX,t.transform.targetY+=t.labelExtraY,l.setTransormAndDisplay(n,t.transform);var a=t.cxFinal+t.pxmid[0],s="M"+a+","+(t.cyFinal+t.pxmid[1]),u=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var c=t.labelExtraX*t.pxmid[1]/t.pxmid[0],h=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(c)>Math.abs(h)?s+="l"+h*t.pxmid[0]/t.pxmid[1]+","+h+"H"+(a+t.labelExtraX+u):s+="l"+t.labelExtraX+","+c+"v"+(h-c)+"h"+u}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+u;l.ensureSingle(r,"path","textline").call(o.stroke,T.outsidetextfont.color).attr({"stroke-width":Math.min(2,T.outsidetextfont.size/8),d:s,fill:"none"})}),k&&v.automargin){var E=s.bBox(p.node()),I=v.domain,L=m.w*(I.x[1]-I.x[0]),P=m.h*(I.y[1]-I.y[0]),R=(.5*L-y.r)/m.w,B=(.5*P-y.r)/m.h;n.autoMargin(t,"pie."+v.uid+".automargin",{xl:I.x[0]-R,xr:I.x[1]+R,yb:I.y[0]-B,yt:I.y[1]+B,l:Math.max(y.cx-y.r-E.left,0),r:Math.max(E.right-(y.cx+y.r),0),b:Math.max(E.bottom-(y.cy+y.r),0),t:Math.max(y.cy-y.r-E.top,0),pad:5})}})});setTimeout(function(){y.selectAll("tspan").each(function(){var t=i.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)},formatSliceLabel:F,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:P,attachFxHandlers:x,computeTransform:O}}}),u9=g({"src/traces/pie/style.js"(t,r){var i=k(),n=rk(),a=aI().resizeText;r.exports=function(t){var r=t._fullLayout._pielayer.selectAll(".trace");a(t,r,"pie"),r.each(function(r){var a=r[0].trace,o=i.select(this);o.style({opacity:a.opacity}),o.selectAll("path.surface").each(function(r){i.select(this).call(n,r,a,t)})})}}}),ce=g({"src/traces/pie/base_plot.js"(t){var r=tR();t.name="pie",t.plot=function(i,n,a,o){r.plotBasePlot(t.name,i,n,a,o)},t.clean=function(i,n,a,o){r.cleanBasePlot(t.name,i,n,a,o)}}}),ct=g({"src/traces/pie/index.js"(t,r){r.exports={attributes:u2(),supplyDefaults:u3().supplyDefaults,supplyLayoutDefaults:u4(),layoutAttributes:u5(),calc:u6().calc,crossTraceCalc:u6().crossTraceCalc,plot:u7().plot,style:u9(),styleOne:rk(),moduleType:"trace",name:"pie",basePlotModule:ce(),categories:["pie-like","pie","showLegend"],meta:{}}}}),cr=g({"lib/pie.js"(t,r){r.exports=ct()}}),ci=g({"src/traces/sunburst/base_plot.js"(t){var r=tR();t.name="sunburst",t.plot=function(i,n,a,o){r.plotBasePlot(t.name,i,n,a,o)},t.clean=function(i,n,a,o){r.cleanBasePlot(t.name,i,n,a,o)}}}),cn=g({"src/traces/sunburst/constants.js"(t,r){r.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),ca=g({"src/traces/sunburst/attributes.js"(t,r){var i=K(),{hovertemplateAttrs:n,texttemplateAttrs:a,templatefallbackAttrs:o}=eZ(),s=tH(),l=an().attributes,u=u2(),c=cn(),h=$().extendFlat,d=eW().pattern;r.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:h({colors:{valType:"data_array",editType:"calc"},line:{color:h({},u.marker.line.color,{dflt:null}),width:h({},u.marker.line.width,{dflt:1}),editType:"calc"},pattern:d,editType:"calc"},s("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:u.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:a({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),texttemplatefallback:o({editType:"plot"}),hovertext:u.hovertext,hoverinfo:h({},i.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:c.eventDataKeys}),hovertemplatefallback:o(),textfont:u.textfont,insidetextorientation:u.insidetextorientation,insidetextfont:u.insidetextfont,outsidetextfont:h({},u.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:u.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:l({name:"sunburst",trace:!0,editType:"calc"})}}}),co=g({"src/traces/sunburst/layout_attributes.js"(t,r){r.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),cs=g({"src/traces/sunburst/defaults.js"(t,r){var i=t_(),n=ca(),a=an().defaults,o=aS().handleText,s=u3().handleMarkerDefaults,l=t6(),u=l.hasColorscale,c=l.handleDefaults;r.exports=function(t,r,l,h){function d(a,o){return i.coerce(t,r,n,a,o)}var f=d("labels"),p=d("parents");if(!f||!f.length||!p||!p.length){r.visible=!1;return}var m=d("values");d(m&&m.length?"branchvalues":"count"),d("level"),d("maxdepth"),s(t,r,h,d);var g=r._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis;g&&c(t,r,h,d,{prefix:"marker.",cLetter:"c"}),d("leaf.opacity",g?1:.7);var y=d("text");d("texttemplate"),d("texttemplatefallback"),r.texttemplate||d("textinfo",i.isArrayOrTypedArray(y)?"text+label":"label"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback"),o(t,r,h,d,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("insidetextorientation"),d("sort"),d("rotation"),d("root.color"),a(r,h,d),r._length=null}}}),cl=g({"src/traces/sunburst/layout_defaults.js"(t,r){var i=t_(),n=co();r.exports=function(t,r){function a(a,o){return i.coerce(t,r,n,a,o)}a("sunburstcolorway",r.colorway),a("extendsunburstcolors")}}}),cu=g({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(t,r){var i;i=t,function(t){function r(t,r){return t.parent===r.parent?1:2}function i(t,r){return t+r.x}function n(t,r){return Math.max(t,r.y)}function a(t){var r=0,i=t.children,n=i&&i.length;if(n)for(;--n>=0;)r+=i[n].value;else r=1;t.value=r}function o(t,r){var i,n,a,o,l,h=new c(t),d=+t.value&&(h.value=t.value),f=[h];for(null==r&&(r=s);i=f.pop();)if(d&&(i.value=+i.data.value),(a=r(i.data))&&(l=a.length))for(i.children=Array(l),o=l-1;o>=0;--o)f.push(n=i.children[o]=new c(a[o])),n.parent=i,n.depth=i.depth+1;return h.eachBefore(u)}function s(t){return t.children}function l(t){t.data=t.data.data}function u(t){var r=0;do t.height=r;while((t=t.parent)&&t.height<++r)}function c(t){this.data=t,this.depth=this.height=0,this.parent=null}c.prototype=o.prototype={constructor:c,count:function(){return this.eachAfter(a)},each:function(t){var r,i,n,a,o=this,s=[o];do for(r=s.reverse(),s=[];o=r.pop();)if(t(o),i=o.children)for(n=0,a=i.length;n=0;--i)a.push(r[i]);return this},sum:function(t){return this.eachAfter(function(r){for(var i=+t(r.data)||0,n=r.children,a=n&&n.length;--a>=0;)i+=n[a].value;r.value=i})},sort:function(t){return this.eachBefore(function(r){r.children&&r.children.sort(t)})},path:function(t){for(var r=this,i=function(t,r){if(t===r)return t;var i=t.ancestors(),n=r.ancestors(),a=null;for(t=i.pop(),r=n.pop();t===r;)a=t,t=i.pop(),r=n.pop();return a}(r,t),n=[r];r!==i;)n.push(r=r.parent);for(var a=n.length;t!==i;)n.splice(a,0,t),t=t.parent;return n},ancestors:function(){for(var t=this,r=[t];t=t.parent;)r.push(t);return r},descendants:function(){var t=[];return this.each(function(r){t.push(r)}),t},leaves:function(){var t=[];return this.eachBefore(function(r){r.children||t.push(r)}),t},links:function(){var t=this,r=[];return t.each(function(i){i!==t&&r.push({source:i.parent,target:i})}),r},copy:function(){return o(this).eachBefore(l)}};var h=Array.prototype.slice;function d(t){for(var r,i,n=0,a=(t=function(t){for(var r,i,n=t.length;n;)i=Math.random()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}(h.call(t))).length,o=[];n0&&i*i>n*n+a*a}function m(t,r){for(var i=0;i(s*=s)?(n=(c+s-a)/(2*c),o=Math.sqrt(Math.max(0,s/c-n*n)),i.x=t.x-n*l-o*u,i.y=t.y-n*u+o*l):(n=(c+a-s)/(2*c),o=Math.sqrt(Math.max(0,a/c-n*n)),i.x=r.x+n*l-o*u,i.y=r.y+n*u+o*l)):(i.x=r.x+i.r,i.y=r.y)}function x(t,r){var i=t.r+r.r-1e-6,n=r.x-t.x,a=r.y-t.y;return i>0&&i*i>n*n+a*a}function b(t){var r=t._,i=t.next._,n=r.r+i.r,a=(r.x*i.r+i.x*r.r)/n,o=(r.y*i.r+i.y*r.r)/n;return a*a+o*o}function _(t){this._=t,this.next=null,this.previous=null}function w(t){var r,i,n,a,o,s,l,u,c,h,f;if(!(a=t.length))return 0;if((r=t[0]).x=0,r.y=0,!(a>1))return r.r;if(i=t[1],r.x=-i.r,i.x=r.r,i.y=0,!(a>2))return r.r+i.r;v(i,r,n=t[2]),r=new _(r),i=new _(i),n=new _(n),r.next=n.previous=i,i.next=r.previous=n,n.next=i.previous=r;e:for(l=3;lf&&(f=l),(p=Math.max(f/(y=h*h*g),y/d))>m){h-=l;break}m=p}v.push(s={value:h,dice:u1?r:1)},i}(V),G=function t(r){function i(t,i,n,a,o){if((s=t._squarify)&&s.ratio===r)for(var s,l,u,c,h,d=-1,f=s.length,p=t.value;++d1?r:1)},i}(V);t.cluster=function(){var t=r,a=1,o=1,s=!1;function l(r){var l,u=0;r.eachAfter(function(r){var a=r.children;a?(r.x=a.reduce(i,0)/a.length,r.y=1+a.reduce(n,0)):(r.x=l?u+=t(r,l):0,r.y=0,l=r)});var c=function(t){for(var r;r=t.children;)t=r[0];return t}(r),h=function(t){for(var r;r=t.children;)t=r[r.length-1];return t}(r),d=c.x-t(c,h)/2,f=h.x+t(h,c)/2;return r.eachAfter(s?function(t){t.x=(t.x-r.x)*a,t.y=(r.y-t.y)*o}:function(t){t.x=(t.x-d)/(f-d)*a,t.y=(1-(r.y?t.y/r.y:1))*o})}return l.separation=function(r){return arguments.length?(t=r,l):t},l.size=function(t){return arguments.length?(s=!1,a=+t[0],o=+t[1],l):s?null:[a,o]},l.nodeSize=function(t){return arguments.length?(s=!0,a=+t[0],o=+t[1],l):s?[a,o]:null},l},t.hierarchy=o,t.pack=function(){var t=null,r=1,i=1,n=A;function a(a){return a.x=r/2,a.y=i/2,t?a.eachBefore(S(t)).eachAfter(E(n,.5)).eachBefore(D(1)):a.eachBefore(S(k)).eachAfter(E(A,1)).eachAfter(E(n,a.r/Math.min(r,i))).eachBefore(D(Math.min(r,i)/(2*a.r))),a}return a.radius=function(r){return arguments.length?(t=null==r?null:T(r),a):t},a.size=function(t){return arguments.length?(r=+t[0],i=+t[1],a):[r,i]},a.padding=function(t){return arguments.length?(n="function"==typeof t?t:M(+t),a):n},a},t.packEnclose=d,t.packSiblings=function(t){return w(t),t},t.partition=function(){var t=1,r=1,i=0,n=!1;function a(a){var o,s,l=a.height+1;return a.x0=a.y0=i,a.x1=t,a.y1=r/l,a.eachBefore((o=r,s=l,function(t){t.children&&I(t,t.x0,o*(t.depth+1)/s,t.x1,o*(t.depth+2)/s);var r=t.x0,n=t.y0,a=t.x1-i,l=t.y1-i;a0)throw Error("cycle");return o}return i.id=function(r){return arguments.length?(t=T(r),i):t},i.parentId=function(t){return arguments.length?(r=T(t),i):r},i},t.tree=function(){var t=O,r=1,i=1,n=null;function a(a){var u=function(t){for(var r,i,n,a,o,s=new j(t,0),l=[s];r=l.pop();)if(n=r._.children)for(r.children=Array(o=n.length),a=o-1;a>=0;--a)l.push(i=r.children[a]=new j(n[a],a)),i.parent=r;return(s.parent=new j(null,0)).children=[s],s}(a);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),n)a.eachBefore(l);else{var c=a,h=a,d=a;a.eachBefore(function(t){t.xh.x&&(h=t),t.depth>d.depth&&(d=t)});var f=c===h?1:t(c,h)/2,p=f-c.x,m=r/(h.x+f+p),g=i/(d.depth||1);a.eachBefore(function(t){t.x=(t.x+p)*m,t.y=t.depth*g})}return a}function o(r){var i=r.children,n=r.parent.children,a=r.i?n[r.i-1]:null;if(i){!function(t){for(var r,i=0,n=0,a=t.children,o=a.length;--o>=0;)r=a[o],r.z+=i,r.m+=i,i+=r.s+(n+=r.c)}(r);var o=(i[0].z+i[i.length-1].z)/2;a?(r.z=a.z+t(r._,a._),r.m=r.z-o):r.z=o}else a&&(r.z=a.z+t(r._,a._));r.parent.A=function(r,i,n){if(i){for(var a,o,s,l=r,u=r,c=i,h=l.parent.children[0],d=l.m,f=u.m,p=c.m,m=h.m;c=B(c),l=R(l),c&&l;)h=R(h),(u=B(u)).a=r,(s=c.z+p-l.z-d+t(c._,l._))>0&&(function(t,r,i){var n=i/(r.i-t.i);r.c-=n,r.s+=i,t.c+=n,r.z+=i,r.m+=i}((a=c,o=n,a.a.parent===r.parent?a.a:o),r,s),d+=s,f+=s),p+=c.m,d+=l.m,m+=h.m,f+=u.m;c&&!B(u)&&(u.t=c,u.m+=p-f),l&&!R(h)&&(h.t=l,h.m+=d-m,n=r)}return n}(r,a,r.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=r,t.y=t.depth*i}return a.separation=function(r){return arguments.length?(t=r,a):t},a.size=function(t){return arguments.length?(n=!1,r=+t[0],i=+t[1],a):n?null:[r,i]},a.nodeSize=function(t){return arguments.length?(n=!0,r=+t[0],i=+t[1],a):n?[r,i]:null},a},t.treemap=function(){var t=q,r=!1,i=1,n=1,a=[0],o=A,s=A,l=A,u=A,c=A;function h(t){return t.x0=t.y0=0,t.x1=i,t.y1=n,t.eachBefore(d),a=[0],r&&t.eachBefore(C),t}function d(r){var i=a[r.depth],n=r.x0+i,h=r.y0+i,d=r.x1-i,f=r.y1-i;d=i-1){var h=l[r];h.x0=a,h.y0=o,h.x1=s,h.y1=u;return}for(var d=c[r],f=n/2+d,p=r+1,m=i-1;p>>1;c[g]u-o){var x=(a*v+s*y)/n;t(r,p,y,a,o,x,u),t(p,i,v,x,o,s,u)}else{var b=(o*v+u*y)/n;t(r,p,y,a,o,s,b),t(p,i,v,a,b,s,u)}}(0,u,t.value,r,i,n,a)},t.treemapDice=I,t.treemapResquarify=G,t.treemapSlice=N,t.treemapSliceDice=function(t,r,i,n,a){(1&t.depth?N:I)(t,r,i,n,a)},t.treemapSquarify=q,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&"u">typeof r?t:(i=i||self).d3=i.d3||{})}}),cc=g({"src/traces/sunburst/calc.js"(t){var r=cu(),i=L(),n=t_(),a=t6().makeColorScaleFuncFromTrace,o=u6().makePullColorFn,s=u6().generateExtendedColors,l=t6().calc,u=P().ALMOST_EQUAL,c={},h={},d={};t.calc=function(t,s){var c,h,d,f=t._fullLayout,p=s.ids,m=n.isArrayOrTypedArray(p),g=s.labels,y=s.parents,v=s.values,x=n.isArrayOrTypedArray(v),b=[],_={},w={},T=function(t){return t||"number"==typeof t},A=function(t){return!x||i(v[t])&&v[t]>=0};m?(c=Math.min(p.length,y.length),h=function(t){return T(p[t])&&A(t)},d=function(t){return String(p[t])}):(c=Math.min(g.length,y.length),h=function(t){return T(g[t])&&A(t)},d=function(t){return String(g[t])}),x&&(c=Math.min(c,v.length));for(var M=0;M1){for(var D=n.randstr(),C=0;C>8&15|r>>4&240,r>>4&15|240&r,(15&r)<<4|15&r,1):8===i?c_(r>>24&255,r>>16&255,r>>8&255,(255&r)/255):4===i?c_(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|240&r,((15&r)<<4|15&r)/255):null):(r=cG.exec(t))?new cA(r[1],r[2],r[3],1):(r=cH.exec(t))?new cA(255*r[1]/100,255*r[2]/100,255*r[3]/100,1):(r=c$.exec(t))?c_(r[1],r[2],r[3],r[4]):(r=cW.exec(t))?c_(255*r[1]/100,255*r[2]/100,255*r[3]/100,r[4]):(r=cY.exec(t))?cI(r[1],r[2]/100,r[3]/100,1):(r=cZ.exec(t))?cI(r[1],r[2]/100,r[3]/100,r[4]):cX.hasOwnProperty(t)?cb(cX[t]):"transparent"===t?new cA(NaN,NaN,NaN,0):null}function cb(t){return new cA(t>>16&255,t>>8&255,255&t,1)}function c_(t,r,i,n){return n<=0&&(t=r=i=NaN),new cA(t,r,i,n)}function cw(t){return t instanceof cp||(t=cx(t)),t?new cA((t=t.rgb()).r,t.g,t.b,t.opacity):new cA}function cT(t,r,i,n){return 1==arguments.length?cw(t):new cA(t,r,i,n??1)}function cA(t,r,i,n){this.r=+t,this.g=+r,this.b=+i,this.opacity=+n}function cM(){return`#${cC(this.r)}${cC(this.g)}${cC(this.b)}`}function ck(){return`#${cC(this.r)}${cC(this.g)}${cC(this.b)}${cC((isNaN(this.opacity)?1:this.opacity)*255)}`}function cS(){let t=cE(this.opacity);return`${1===t?"rgb(":"rgba("}${cD(this.r)}, ${cD(this.g)}, ${cD(this.b)}${1===t?")":`, ${t})`}`}function cE(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function cD(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function cC(t){return((t=cD(t))<16?"0":"")+t.toString(16)}function cI(t,r,i,n){return n<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new cz(t,r,i,n)}function cL(t){if(t instanceof cz)return new cz(t.h,t.s,t.l,t.opacity);if(t instanceof cp||(t=cx(t)),!t)return new cz;if(t instanceof cz)return t;var r=(t=t.rgb()).r/255,i=t.g/255,n=t.b/255,a=Math.min(r,i,n),o=Math.max(r,i,n),s=NaN,l=o-a,u=(o+a)/2;return l?(s=r===o?(i-n)/l+(i0&&u<1?0:s,new cz(s,l,u,t.opacity)}function cP(t,r,i,n){return 1==arguments.length?cL(t):new cz(t,r,i,n??1)}function cz(t,r,i,n){this.h=+t,this.s=+r,this.l=+i,this.opacity=+n}function cF(t){return(t=(t||0)%360)<0?t+360:t}function cO(t){return Math.max(0,Math.min(1,t||0))}function cR(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}var cB,cj,cN,cV,cU,cq,cG,cH,c$,cW,cY,cZ,cX,cK,cJ,cQ=m({"node_modules/d3-color/src/color.js"(){cf(),cj=1/(cB=.7),cN="\\s*([+-]?\\d+)\\s*",cV="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cU="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cq=/^#([0-9a-f]{3,8})$/,cG=RegExp(`^rgb\\(${cN},${cN},${cN}\\)$`),cH=RegExp(`^rgb\\(${cU},${cU},${cU}\\)$`),c$=RegExp(`^rgba\\(${cN},${cN},${cN},${cV}\\)$`),cW=RegExp(`^rgba\\(${cU},${cU},${cU},${cV}\\)$`),cY=RegExp(`^hsl\\(${cV},${cU},${cU}\\)$`),cZ=RegExp(`^hsla\\(${cV},${cU},${cU},${cV}\\)$`),cX={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},ch(cp,cx,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:cm,formatHex:cm,formatHex8:cg,formatHsl:cy,formatRgb:cv,toString:cv}),ch(cA,cT,cd(cp,{brighter(t){return t=null==t?cj:Math.pow(cj,t),new cA(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?cB:Math.pow(cB,t),new cA(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new cA(cD(this.r),cD(this.g),cD(this.b),cE(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cM,formatHex:cM,formatHex8:ck,formatRgb:cS,toString:cS})),ch(cz,cP,cd(cp,{brighter(t){return t=null==t?cj:Math.pow(cj,t),new cz(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?cB:Math.pow(cB,t),new cz(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*r,a=2*i-n;return new cA(cR(t>=240?t-240:t+120,a,n),cR(t,a,n),cR(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new cz(cF(this.h),cO(this.s),cO(this.l),cE(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=cE(this.opacity);return`${1===t?"hsl(":"hsla("}${cF(this.h)}, ${100*cO(this.s)}%, ${100*cO(this.l)}%${1===t?")":`, ${t})`}`}}))}}),c0=m({"node_modules/d3-color/src/math.js"(){cK=Math.PI/180,cJ=180/Math.PI}});function c1(t){if(t instanceof c3)return new c3(t.l,t.a,t.b,t.opacity);if(t instanceof c9)return he(t);t instanceof cA||(t=cw(t));var r,i,n=c8(t.r),a=c8(t.g),o=c8(t.b),s=c5((.2225045*n+.7168786*a+.0606169*o)/hr);return n===a&&a===o?r=i=s:(r=c5((.4360747*n+.3850649*a+.1430804*o)/ht),i=c5((.0139322*n+.0971045*a+.7141733*o)/hi)),new c3(116*s-16,500*(r-s),200*(s-i),t.opacity)}function c2(t,r,i,n){return 1==arguments.length?c1(t):new c3(t,r,i,n??1)}function c3(t,r,i,n){this.l=+t,this.a=+r,this.b=+i,this.opacity=+n}function c5(t){return t>hs?Math.pow(t,.3333333333333333):t/ho+hn}function c4(t){return t>ha?t*t*t:ho*(t-hn)}function c6(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,.4166666666666667)-.055)}function c8(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function c7(t,r,i,n){return 1==arguments.length?function(t){if(t instanceof c9)return new c9(t.h,t.c,t.l,t.opacity);if(t instanceof c3||(t=c1(t)),0===t.a&&0===t.b)return new c9(NaN,0=1?(i=1,r-1):Math.floor(i*r),a=t[n],o=t[n+1],s=n>0?t[n-1]:2*a-o,l=n()=>t}});function hk(t,r){return function(i){return t+i*r}}function hS(t,r){var i=r-t;return i?hk(t,i>180||i<-180?i-360*Math.round(i/360):i):hT(isNaN(t)?r:t)}function hE(t,r){var i=r-t;return i?hk(t,i):hT(isNaN(t)?r:t)}var hD=m({"node_modules/d3-interpolate/src/color.js"(){hM()}});function hC(t){return function(r){var i,n,a=r.length,o=Array(a),s=Array(a),l=Array(a);for(i=0;il&&(s=r.slice(l,s),c[u]?c[u]+=s:c[++u]=s),(a=a[0])===(o=o[0])?c[u]?c[u]+=o:c[++u]=o:(c[++u]=null,h.push({i:u,x:hq(a,o)})),l=hZ.lastIndex;return l180?u+=360:u-l>180&&(l+=360),f.push({i:d.push(a(d)+"rotate(",null,n)-2,x:hq(l,u)})):u&&d.push(a(d)+"rotate("+u+n),c=o.skewX,h=s.skewX,c!==h?f.push({i:d.push(a(d)+"skewX(",null,n)-2,x:hq(c,h)}):h&&d.push(a(d)+"skewX("+h+n),function(t,r,i,n,o,s){if(t!==i||r!==n){var l=o.push(a(o)+"scale(",null,",",null,")");s.push({i:l-4,x:hq(t,i)},{i:l-2,x:hq(r,n)})}else(1!==i||1!==n)&&o.push(a(o)+"scale("+i+","+n+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,d,f),o=s=null,function(t){for(var r,i=-1,n=f.length;++ihK,interpolateArray:()=>hB,interpolateBasis:()=>hb,interpolateBasisClosed:()=>hw,interpolateCubehelix:()=>dw,interpolateCubehelixLong:()=>dT,interpolateDate:()=>hV,interpolateDiscrete:()=>hQ,interpolateHcl:()=>dv,interpolateHclLong:()=>dx,interpolateHsl:()=>dd,interpolateHslLong:()=>df,interpolateHue:()=>h1,interpolateLab:()=>dm,interpolateNumber:()=>hq,interpolateNumberArray:()=>hF,interpolateObject:()=>hH,interpolateRgb:()=>hI,interpolateRgbBasis:()=>hL,interpolateRgbBasisClosed:()=>hP,interpolateRound:()=>h3,interpolateString:()=>hW,interpolateTransformCss:()=>dn,interpolateTransformSvg:()=>da,interpolateZoom:()=>du,piecewise:()=>dM,quantize:()=>dS});var dC=m({"node_modules/d3-interpolate/src/index.js"(){hJ(),hN(),h_(),hA(),hU(),h0(),h2(),hG(),hR(),h$(),h5(),hX(),ds(),dc(),hz(),dp(),dg(),db(),dA(),dk(),dE()}}),dI=g({"src/traces/sunburst/fill_one.js"(t,r){var i=rr(),n=ei();r.exports=function(t,r,a,o,s){var l=r.data.data,u=l.i,c=s||l.color;if(u>=0){r.i=l.i;var h=a.marker;h.pattern&&h.colors&&h.pattern.shape||(h.color=c,r.color=c),i.pointStyle(t,a,o,r)}else n.fill(t,c)}}}),dL=g({"src/traces/sunburst/style.js"(t,r){var i=k(),n=ei(),a=t_(),o=aI().resizeText,s=dI();function l(t,r,i,o){var l=r.data.data,u=!r.children,c=l.i,h=a.castOption(i,c,"marker.line.color")||n.defaultLine,d=a.castOption(i,c,"marker.line.width")||0;t.call(s,r,i,o).style("stroke-width",d).call(n.stroke,h).style("opacity",u?i.leaf.opacity:null)}r.exports={style:function(t){var r=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,r,"sunburst"),r.each(function(r){var n=i.select(this),a=r[0].trace;n.style("opacity",a.opacity),n.selectAll("path.surface").each(function(r){i.select(this).call(l,r,a,t)})})},styleOne:l}}}),dP=g({"src/traces/sunburst/helpers.js"(t){var r=t_(),i=ei(),n=rg(),a=rA();function o(t){return t.data.data.pid}t.findEntryWithLevel=function(r,i){var n;return i&&r.eachAfter(function(r){if(t.getPtId(r)===i)return n=r.copy()}),n||r},t.findEntryWithChild=function(r,i){var n;return r.eachAfter(function(r){for(var a=r.children||[],o=0;o0)},t.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},t.isHeader=function(r,i){return!(t.isLeaf(r)||r.depth===i._maxDepth-1)},t.getParent=function(r,i){return t.findEntryWithLevel(r,o(i))},t.listPath=function(r,i){var n=r.parent;if(!n)return[];var a=i?[n.data[i]]:[n];return t.listPath(n,i).concat(a)},t.getPath=function(r){return t.listPath(r,"label").join("/")+"/"},t.formatValue=a.formatPieValue,t.formatPercent=function(t,i){var n=r.formatPercent(t,0);return"0%"===n&&(n=a.formatPiePercent(t,i)),n}}}),dz=g({"src/traces/sunburst/fx.js"(t,r){var i=k(),n=e2(),a=t9().appendArrayPointValue,o=rR(),s=t_(),l=tk(),u=dP(),c=rA().formatPieValue;function h(t,r,i){for(var n=t.data.data,o={curveNumber:r.index,pointNumber:n.i,data:r._input,fullData:r},s=0;s"),name:k||L("name")?x.name:void 0,color:M("hoverlabel.bgcolor")||b.color,borderColor:M("hoverlabel.bordercolor"),fontFamily:M("hoverlabel.font.family"),fontSize:M("hoverlabel.font.size"),fontColor:M("hoverlabel.font.color"),fontWeight:M("hoverlabel.font.weight"),fontStyle:M("hoverlabel.font.style"),fontVariant:M("hoverlabel.font.variant"),nameLength:M("hoverlabel.namelength"),textAlign:M("hoverlabel.align"),hovertemplate:k,hovertemplateLabels:D,eventData:d};y&&(B.x0=P-n.rInscribed*n.rpx1,B.x1=P+n.rInscribed*n.rpx1,B.idealAlign=n.pxmid[0]<0?"left":"right"),v&&(B.x=P,B.idealAlign=P<0?"left":"right");var j=[];o.loneHover(B,{container:l._hoverlayer.node(),outerContainer:l._paper.node(),gd:a,inOut_bbox:j}),d[0].bbox=j[0],m._hasHoverLabel=!0}if(v){var N=t.select("path.surface");f.styleOne(N,n,x,a,{hovered:!0})}m._hasHoverEvent=!0,a.emit("plotly_hover",{points:d||[h(n,x,f.eventDataKeys)],event:i.event})}}),t.on("mouseout",function(r){var n=a._fullLayout,s=a._fullData[m.index],l=i.select(this).datum();if(m._hasHoverEvent&&(r.originalEvent=i.event,a.emit("plotly_unhover",{points:[h(l,s,f.eventDataKeys)],event:i.event}),m._hasHoverEvent=!1),m._hasHoverLabel&&(o.loneUnhover(n._hoverlayer.node()),m._hasHoverLabel=!1),v){var u=t.select("path.surface");f.styleOne(u,l,s,a,{hovered:!1})}}),t.on("click",function(t){var r=a._fullLayout,s=a._fullData[m.index],c=y&&(u.isHierarchyRoot(t)||u.isLeaf(t)),d=u.getPtId(t),p=u.isEntry(t)?u.findEntryWithChild(g,d):u.findEntryWithLevel(g,d),v=u.getPtId(p),x={points:[h(t,s,f.eventDataKeys)],event:i.event};c||(x.nextLevel=v);var b=l.triggerHandler(a,"plotly_"+m.type+"click",x);if(!1!==b&&r.hovermode&&(a._hoverdata=[h(t,s,f.eventDataKeys)],o.click(a,i.event)),!c&&!1!==b&&!a._dragging&&!a._transitioning){n.call("_storeDirectGUIEdit",s,r._tracePreGUI[s.uid],{level:s.level});var _={data:[{level:v}],traces:[m.index]},w={frame:{redraw:!1,duration:f.transitionTime},transition:{duration:f.transitionTime,easing:f.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(r._hoverlayer.node()),n.call("animate",a,_,w)}})}}}),dF=g({"src/traces/sunburst/plot.js"(t){var r=k(),i=cu(),n=(dC(),b(dD)).interpolate,a=rr(),o=t_(),s=tN(),l=aI(),u=l.recordMinTextSize,c=l.clearMinTextSize,h=u7(),d=rA().getRotationAngle,f=h.computeTransform,p=h.transformInsideText,m=dL().styleOne,g=aP().resizeText,y=dz(),v=cn(),x=dP();function _(l,c,h,g){var b,_=l._context.staticPlot,T=l._fullLayout,A=!T.uniformtext.mode&&x.hasTransition(g),M=r.select(h).selectAll("g.slice"),k=c[0],S=k.trace,E=k.hierarchy,D=x.findEntryWithLevel(E,S.level),C=x.getMaxDepth(S),I=T._size,L=S.domain,P=I.w*(L.x[1]-L.x[0]),z=I.h*(L.y[1]-L.y[0]),F=.5*Math.min(P,z),O=k.cx=I.l+I.w*(L.x[1]+L.x[0])/2,R=k.cy=I.t+I.h*(1-L.y[0])-z/2;if(!D)return M.remove();var B=null,j={};A&&M.each(function(t){j[x.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!B&&x.isEntry(t)&&(B=t)});var N=(b=D,i.partition().size([2*Math.PI,b.height+1])(b)).descendants(),V=D.height+1,U=0,q=C;k.hasMultipleRoots&&x.isHierarchyRoot(D)&&(N=N.slice(1),V-=1,U=1,q+=1),N=N.filter(function(t){return t.y1<=q});var G=d(S.rotation);G&&N.forEach(function(t){t.x0+=G,t.x1+=G});var H=Math.min(V,C),$=function(t){return(t-U)/H*F},W=function(t,r){return[t*Math.cos(r),-t*Math.sin(r)]},Y=function(t){return o.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,O,R)},Z=function(t){return O+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},X=function(t){return R+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(M=M.data(N,x.getPtId)).enter().append("g").classed("slice",!0),A?M.exit().transition().each(function(){var t=r.select(this);t.select("path.surface").transition().attrTween("d",function(t){var r=function(t){var r,i=x.getPtId(t),a=j[i],o=j[x.getPtId(D)];if(o){var s=(t.x1>o.x1?2*Math.PI:0)+G;r=t.rpx1K?2*Math.PI:0)+G;r={x0:s,x1:s}}else r={rpx0:F,rpx1:F},o.extendFlat(r,ee(t));else r={rpx0:0,rpx1:0};else r={x0:G,x1:G};return n(r,a)}(t);return function(t){return Y(r(t))}}):g.attr("d",Y),d.call(y,D,l,c,{eventDataKeys:v.eventDataKeys,transitionTime:v.CLICK_TRANSITION_TIME,transitionEasing:v.CLICK_TRANSITION_EASING}).call(x.setSliceCursor,l,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:l._transitioning}),g.call(m,i,S,l);var b=o.ensureSingle(d,"g","slicetext"),w=o.ensureSingle(b,"text","",function(t){t.attr("data-notex",1)}),M=o.ensureUniformFontSize(l,x.determineTextFont(S,i,T.font));w.text(t.formatSliceLabel(i,D,S,c,T)).classed("slicetext",!0).attr("text-anchor","middle").call(a.font,M).call(s.convertToTspans,l);var E=a.bBox(w.node());i.transform=p(E,i,k),i.transform.targetX=Z(i),i.transform.targetY=X(i);var C=function(t,r){var i=t.transform;return f(i,r),i.fontSize=M.size,u(S.type,i,T),o.getTextTransform(i)};A?w.transition().attrTween("transform",function(t){var r=function(t){var r,i=j[x.getPtId(t)],a=t.transform;if(i)r=i;else if(r={rpx1:t.rpx1,transform:{textPosAngle:a.textPosAngle,scale:0,rotate:a.rotate,rCenter:a.rCenter,x:a.x,y:a.y}},B)if(t.parent)if(K){var s=t.x1>K?2*Math.PI:0;r.x0=r.x1=s}else o.extendFlat(r,ee(t));else r.x0=r.x1=G;else r.x0=r.x1=G;var l=n(r.transform.textPosAngle,t.transform.textPosAngle),c=n(r.rpx1,t.rpx1),h=n(r.x0,t.x0),d=n(r.x1,t.x1),f=n(r.transform.scale,a.scale),p=n(r.transform.rotate,a.rotate),m=0===a.rCenter?3:0===r.transform.rCenter?1/3:1,g=n(r.transform.rCenter,a.rCenter);return function(t){var r=c(t),i=h(t),n=d(t),o=g(Math.pow(t,m)),s={pxmid:W(r,(i+n)/2),rpx1:r,transform:{textPosAngle:l(t),rCenter:o,x:a.x,y:a.y}};return u(S.type,a,T),{transform:{targetX:Z(s),targetY:X(s),scale:f(t),rotate:p(t),rCenter:o}}}}(t);return function(t){return C(r(t),E)}}):w.attr("transform",C(i,E))})}function w(t){var r,i;return r=t.rpx1,[r*Math.sin(i=t.transform.textPosAngle),-r*Math.cos(i)]}t.plot=function(t,i,n,a){var o,s,l=t._fullLayout,u=l._sunburstlayer,h=!n,d=!l.uniformtext.mode&&x.hasTransition(n);(c("sunburst",l),(o=u.selectAll("g.trace.sunburst").data(i,function(t){return t[0].trace.uid})).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),o.order(),d)?(a&&(s=a()),r.transition().duration(n.duration).ease(n.easing).each("end",function(){s&&s()}).each("interrupt",function(){s&&s()}).each(function(){u.selectAll("g.trace").each(function(r){_(t,r,this,n)})})):(o.each(function(r){_(t,r,this,n)}),l.uniformtext.mode&&g(t,l._sunburstlayer.selectAll(".trace"),"sunburst")),h&&o.exit().remove()},t.formatSliceLabel=function(t,r,i,n,a){var s=i.texttemplate,l=i.textinfo;if(!s&&(!l||"none"===l))return"";var u=a.separators,c=n[0],h=t.data.data,d=c.hierarchy,f=x.isHierarchyRoot(t),p=x.getParent(d,t),m=x.getValue(t);if(!s){var g,y=l.split("+"),v=function(t){return -1!==y.indexOf(t)},b=[];if(v("label")&&h.label&&b.push(h.label),h.hasOwnProperty("v")&&v("value")&&b.push(x.formatValue(h.v,u)),!f){v("current path")&&b.push(x.getPath(t.data));var _=0;v("percent parent")&&_++,v("percent entry")&&_++,v("percent root")&&_++;var w=_>1;if(_){var T,A=function(t){g=x.formatPercent(T,u),w&&(g+=" of "+t),b.push(g)};v("percent parent")&&!f&&(T=m/x.getValue(p),A("parent")),v("percent entry")&&(T=m/x.getValue(r),A("entry")),v("percent root")&&(T=m/x.getValue(d),A("root"))}}return v("text")&&(g=o.castOption(i,h.i,"text"),o.isValidTextValue(g)&&b.push(g)),b.join("
")}var M=o.castOption(i,h.i,"texttemplate");if(!M)return"";var k={};h.label&&(k.label=h.label),h.hasOwnProperty("v")&&(k.value=h.v,k.valueLabel=x.formatValue(h.v,u)),k.currentPath=x.getPath(t.data),f||(k.percentParent=m/x.getValue(p),k.percentParentLabel=x.formatPercent(k.percentParent,u),k.parent=x.getPtLabel(p)),k.percentEntry=m/x.getValue(r),k.percentEntryLabel=x.formatPercent(k.percentEntry,u),k.entry=x.getPtLabel(r),k.percentRoot=m/x.getValue(d),k.percentRootLabel=x.formatPercent(k.percentRoot,u),k.root=x.getPtLabel(d),h.hasOwnProperty("color")&&(k.color=h.color);var S=o.castOption(i,h.i,"text");return(o.isValidTextValue(S)||""===S)&&(k.text=S),k.customdata=o.castOption(i,h.i,"customdata"),o.texttemplateString({data:[k,i._meta],fallback:i.texttemplatefallback,labels:k,locale:a._d3locale,template:M})}}}),dO=g({"src/traces/sunburst/index.js"(t,r){r.exports={moduleType:"trace",name:"sunburst",basePlotModule:ci(),categories:[],animatable:!0,attributes:ca(),layoutAttributes:co(),supplyDefaults:cs(),supplyLayoutDefaults:cl(),calc:cc().calc,crossTraceCalc:cc().crossTraceCalc,plot:dF().plot,style:dL().style,colorbar:ni(),meta:{}}}}),dR=g({"lib/sunburst.js"(t,r){r.exports=dO()}}),dB=g({"src/traces/treemap/base_plot.js"(t){var r=tR();t.name="treemap",t.plot=function(i,n,a,o){r.plotBasePlot(t.name,i,n,a,o)},t.clean=function(i,n,a,o){r.cleanBasePlot(t.name,i,n,a,o)}}}),dj=g({"src/traces/treemap/constants.js"(t,r){r.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),dN=g({"src/traces/treemap/attributes.js"(t,r){var{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=eZ(),o=tH(),s=an().attributes,l=u2(),u=ca(),c=dj(),h=$().extendFlat,d=eW().pattern;r.exports={labels:u.labels,parents:u.parents,values:u.values,branchvalues:u.branchvalues,count:u.count,level:u.level,maxdepth:u.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:h({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:u.marker.colors,pattern:d,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:u.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:h({},l.textfont,{}),editType:"calc"},text:l.text,textinfo:u.textinfo,texttemplate:n({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),hovertext:l.hovertext,hoverinfo:u.hoverinfo,hovertemplate:i({},{keys:c.eventDataKeys}),hovertemplatefallback:a(),textfont:l.textfont,insidetextfont:l.insidetextfont,outsidetextfont:h({},l.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:l.sort,root:u.root,domain:s({name:"treemap",trace:!0,editType:"calc"})}}}),dV=g({"src/traces/treemap/layout_attributes.js"(t,r){r.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),dU=g({"src/traces/treemap/defaults.js"(t,r){var i=t_(),n=dN(),a=ei(),o=an().defaults,s=aS().handleText,l=i8().TEXTPAD,u=u3().handleMarkerDefaults,c=t6(),h=c.hasColorscale,d=c.handleDefaults;r.exports=function(t,r,c,f){function p(a,o){return i.coerce(t,r,n,a,o)}var m=p("labels"),g=p("parents");if(!m||!m.length||!g||!g.length){r.visible=!1;return}var y=p("values");p(y&&y.length?"branchvalues":"count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var v=p("text");p("texttemplate"),p("texttemplatefallback"),r.texttemplate||p("textinfo",i.isArrayOrTypedArray(v)?"text+label":"label"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback");var x=p("pathbar.visible");s(t,r,f,p,"auto",{hasPathbar:x,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var b=-1!==r.textposition.indexOf("bottom");u(t,r,f,p),(r._hasColorscale=h(t,"marker","colors")||(t.marker||{}).coloraxis)?d(t,r,f,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(r.marker.colors||[]).length);var _=2*r.textfont.size;p("marker.pad.t",b?_/4:_),p("marker.pad.l",_/4),p("marker.pad.r",_/4),p("marker.pad.b",b?_:_/4),p("marker.cornerradius"),r._hovered={marker:{line:{width:2,color:a.contrast(f.paper_bgcolor)}}},x&&(p("pathbar.thickness",r.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(r,f,p),r._length=null}}}),dq=g({"src/traces/treemap/layout_defaults.js"(t,r){var i=t_(),n=dV();r.exports=function(t,r){function a(a,o){return i.coerce(t,r,n,a,o)}a("treemapcolorway",r.colorway),a("extendtreemapcolors")}}}),dG=g({"src/traces/treemap/calc.js"(t){var r=cc();t.calc=function(t,i){return r.calc(t,i)},t.crossTraceCalc=function(t){return r._runCrossTraceCalc("treemap",t)}}}),dH=g({"src/traces/treemap/flip_tree.js"(t,r){r.exports=function t(r,i,n){n.swapXY&&(a=r.x0,r.x0=r.y0,r.y0=a,a=r.x1,r.x1=r.y1,r.y1=a),n.flipX&&(a=r.x0,r.x0=i[0]-r.x1,r.x1=i[0]-a),n.flipY&&(a=r.y0,r.y0=i[1]-r.y1,r.y1=i[1]-a);var a,o=r.children;if(o)for(var s=0;s0)for(var _=0;_").join(" ")||"";var m=n.ensureSingle(f,"g","slicetext"),A=n.ensureSingle(m,"text","",function(t){t.attr("data-notex",1)}),C=n.ensureUniformFontSize(t,c.determineTextFont(I,s,D.font,{onPathbar:!0}));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,C).call(o.convertToTspans,t),s.textBB=a.bBox(A.node()),s.transform=_(s,{fontSize:C.size,onPathbar:!0}),s.transform.fontSize=C.size,T?A.transition().attrTween("transform",function(t){var r=k(t,!0,S,[g,y]);return function(t){return w(r(t))}}):A.attr("transform",w(s))})}}}),dZ=g({"src/traces/treemap/plot_one.js"(t,r){var i=k(),n=(dC(),b(dD)).interpolate,a=dP(),o=t_(),s=i8().TEXTPAD,l=az().toMoveInsideBar,u=aI().recordMinTextSize,c=dj(),h=dY();function d(t){return a.isHierarchyRoot(t)?"":a.getPtId(t)}r.exports=function(t,r,f,p,m){var g=t._fullLayout,y=r[0],v=y.trace,x="icicle"===v.type,b=y.hierarchy,_=a.findEntryWithLevel(b,v.level),w=i.select(f),T=w.selectAll("g.pathbar"),A=w.selectAll("g.slice");if(!_){T.remove(),A.remove();return}var M=a.isHierarchyRoot(_),k=!g.uniformtext.mode&&a.hasTransition(p),S=a.getMaxDepth(v),E=g._size,D=v.domain,C=E.w*(D.x[1]-D.x[0]),I=E.h*(D.y[1]-D.y[0]),L=v.pathbar.thickness,P=v.marker.line.width+c.gapWithPathbar,z=v.pathbar.visible?v.pathbar.side.indexOf("bottom")>-1?I+P:-(L+P):0,F={x0:C,x1:C,y0:z,y1:z+L},O=function(t,r,i){var n=v.tiling.pad,a=function(t){return t-n<=r.x0},o=function(t){return t+n>=r.x1},s=function(t){return t-n<=r.y0},l=function(t){return t+n>=r.y1};return t.x0===r.x0&&t.x1===r.x1&&t.y0===r.y0&&t.y1===r.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:a(t.x0-n)?0:o(t.x0-n)?i[0]:t.x0,x1:a(t.x1+n)?0:o(t.x1+n)?i[0]:t.x1,y0:s(t.y0-n)?0:l(t.y0-n)?i[1]:t.y0,y1:s(t.y1+n)?0:l(t.y1+n)?i[1]:t.y1}},R=null,B={},j={},N=null,V=function(t,r){return r?B[d(t)]:j[d(t)]},U=function(t,r,i,n){if(r)return B[d(b)]||F;var a=j[v.level]||i;return t.data.depth-_.data.depth=(n-=(x?ee:ee.r)-s)){var p,m=(i+n)/2;i=m,n=m}ea?a<(p=o-(x?ee:ee.b))&&p"===Q?(u.x-=o,c.x-=o,h.x-=o,d.x-=o):"/"===Q?(h.x-=o,d.x-=o,s.x-=o/2,l.x-=o/2):"\\"===Q?(u.x-=o,c.x-=o,s.x-=o/2,l.x-=o/2):"<"===Q&&(s.x-=o,l.x-=o),J(u),J(d),J(s),J(c),J(h),J(l),"M"+(u.x+",")+u.y+"L"+(c.x+",")+c.y+"L"+(l.x+",")+l.y+"L"+(h.x+",")+h.y+"L"+(d.x+",")+d.y+"L"+(s.x+",")+s.y+"Z"},toMoveInsideSlice:eo,makeUpdateSliceInterpolator:eu,makeUpdateTextInterpolator:ec,handleSlicesExit:eh,hasTransition:k,strTransform:ed}):T.remove()}}}),dX=g({"src/traces/treemap/draw.js"(t,r){var i=k(),n=dP(),a=aI().clearMinTextSize,o=aP().resizeText,s=dZ();r.exports=function(t,r,l,u,c){var h,d,f=c.type,p=c.drawDescendants,m=t._fullLayout,g=m["_"+f+"layer"],y=!l;(a(f,m),(h=g.selectAll("g.trace."+f).data(r,function(t){return t[0].trace.uid})).enter().append("g").classed("trace",!0).classed(f,!0),h.order(),!m.uniformtext.mode&&n.hasTransition(l))?(u&&(d=u()),i.transition().duration(l.duration).ease(l.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){g.selectAll("g.trace").each(function(r){s(t,r,this,l,p)})})):(h.each(function(r){s(t,r,this,l,p)}),m.uniformtext.mode&&o(t,g.selectAll(".trace"),f)),y&&h.exit().remove()}}}),dK=g({"src/traces/treemap/draw_descendants.js"(t,r){var i=k(),n=t_(),a=rr(),o=tN(),s=d$(),l=dW().styleOne,u=dj(),c=dP(),h=dz(),d=dF().formatSliceLabel;r.exports=function(t,r,f,p,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,b=m.pathSlice,_=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,A=m.handleSlicesExit,M=m.makeUpdateSliceInterpolator,k=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,D=t._fullLayout,C=r[0].trace,I=-1!==C.textposition.indexOf("left"),L=-1!==C.textposition.indexOf("right"),P=-1!==C.textposition.indexOf("bottom"),z=!P&&!C.marker.pad.t||P&&!C.marker.pad.b,F=s(f,[g,y],{packing:C.tiling.packing,squarifyratio:C.tiling.squarifyratio,flipX:C.tiling.flip.indexOf("x")>-1,flipY:C.tiling.flip.indexOf("y")>-1,pad:{inner:C.tiling.pad,top:C.marker.pad.t,left:C.marker.pad.l,right:C.marker.pad.r,bottom:C.marker.pad.b}}).descendants(),O=1/0,R=-1/0;F.forEach(function(t){var r=t.depth;r>=C._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(O=Math.min(O,r),R=Math.max(R,r))}),p=p.data(F,c.getPtId),C._maxVisibleLayers=isFinite(R)?R-O+1:0,p.enter().append("g").classed("slice",!0),A(p,!1,{},[g,y],b),p.order();var B=null;if(T&&S){var j=c.getPtId(S);p.each(function(t){null===B&&c.getPtId(t)===j&&(B={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})})}var N=function(){return B||{x0:0,x1:g,y0:0,y1:y}},V=p;return T&&(V=V.transition().each("end",function(){var r=i.select(this);c.setSliceCursor(r,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),V.each(function(s){var p=c.isHeader(s,C);s._x0=v(s.x0),s._x1=v(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=v(s.x1-C.marker.pad.r),s._hoverY=x(P?s.y1-C.marker.pad.b/2:s.y0+C.marker.pad.t/2);var m=i.select(this),A=n.ensureSingle(m,"path","surface",function(t){t.style("pointer-events",E?"none":"all")});T?A.transition().attrTween("d",function(t){var r=M(t,!1,N(),[g,y]);return function(t){return b(r(t))}}):A.attr("d",b),m.call(h,f,t,r,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),A.call(l,s,C,t,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":p?s._text=z?"":c.getPtLabel(s)||"":s._text=d(s,f,C,r,D)||"";var S=n.ensureSingle(m,"g","slicetext"),F=n.ensureSingle(S,"text","",function(t){t.attr("data-notex",1)}),O=n.ensureUniformFontSize(t,c.determineTextFont(C,s,D.font)),R=s._text||" ",B=p&&-1===R.indexOf("
");F.text(R).classed("slicetext",!0).attr("text-anchor",L?"end":I||B?"start":"middle").call(a.font,O).call(o.convertToTspans,t),s.textBB=a.bBox(F.node()),s.transform=_(s,{fontSize:O.size,isHeader:p}),s.transform.fontSize=O.size,T?F.transition().attrTween("transform",function(t){var r=k(t,!1,N(),[g,y]);return function(t){return w(r(t))}}):F.attr("transform",w(s))}),B}}}),dJ=g({"src/traces/treemap/plot.js"(t,r){var i=dX(),n=dK();r.exports=function(t,r,a,o){return i(t,r,a,o,{type:"treemap",drawDescendants:n})}}}),dQ=g({"src/traces/treemap/index.js"(t,r){r.exports={moduleType:"trace",name:"treemap",basePlotModule:dB(),categories:[],animatable:!0,attributes:dN(),layoutAttributes:dV(),supplyDefaults:dU(),supplyLayoutDefaults:dq(),calc:dG().calc,crossTraceCalc:dG().crossTraceCalc,plot:dJ(),style:dW().style,colorbar:ni(),meta:{}}}}),d0=g({"lib/treemap.js"(t,r){r.exports=dQ()}}),d1=g({"src/traces/icicle/base_plot.js"(t){var r=tR();t.name="icicle",t.plot=function(i,n,a,o){r.plotBasePlot(t.name,i,n,a,o)},t.clean=function(i,n,a,o){r.cleanBasePlot(t.name,i,n,a,o)}}}),d2=g({"src/traces/icicle/attributes.js"(t,r){var{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=eZ(),o=tH(),s=an().attributes,l=u2(),u=ca(),c=dN(),h=dj(),d=$().extendFlat,f=eW().pattern;r.exports={labels:u.labels,parents:u.parents,values:u.values,branchvalues:u.branchvalues,count:u.count,level:u.level,maxdepth:u.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:c.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:d({colors:u.marker.colors,line:u.marker.line,pattern:f,editType:"calc"},o("marker",{colorAttr:"colors",anim:!1})),leaf:u.leaf,pathbar:c.pathbar,text:l.text,textinfo:u.textinfo,texttemplate:n({editType:"plot"},{keys:h.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),hovertext:l.hovertext,hoverinfo:u.hoverinfo,hovertemplate:i({},{keys:h.eventDataKeys}),hovertemplatefallback:a(),textfont:l.textfont,insidetextfont:l.insidetextfont,outsidetextfont:c.outsidetextfont,textposition:c.textposition,sort:l.sort,root:u.root,domain:s({name:"icicle",trace:!0,editType:"calc"})}}}),d3=g({"src/traces/icicle/layout_attributes.js"(t,r){r.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),d5=g({"src/traces/icicle/defaults.js"(t,r){var i=t_(),n=d2(),a=ei(),o=an().defaults,s=aS().handleText,l=i8().TEXTPAD,u=u3().handleMarkerDefaults,c=t6(),h=c.hasColorscale,d=c.handleDefaults;r.exports=function(t,r,c,f){function p(a,o){return i.coerce(t,r,n,a,o)}var m=p("labels"),g=p("parents");if(!m||!m.length||!g||!g.length){r.visible=!1;return}var y=p("values");p(y&&y.length?"branchvalues":"count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var v=p("text");p("texttemplate"),p("texttemplatefallback"),r.texttemplate||p("textinfo",i.isArrayOrTypedArray(v)?"text+label":"label"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback");var x=p("pathbar.visible");s(t,r,f,p,"auto",{hasPathbar:x,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),u(t,r,f,p);var b=r._hasColorscale=h(t,"marker","colors")||(t.marker||{}).coloraxis;b&&d(t,r,f,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",b?1:.7),r._hovered={marker:{line:{width:2,color:a.contrast(f.paper_bgcolor)}}},x&&(p("pathbar.thickness",r.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(r,f,p),r._length=null}}}),d4=g({"src/traces/icicle/layout_defaults.js"(t,r){var i=t_(),n=d3();r.exports=function(t,r){function a(a,o){return i.coerce(t,r,n,a,o)}a("iciclecolorway",r.colorway),a("extendiciclecolors")}}}),d6=g({"src/traces/icicle/calc.js"(t){var r=cc();t.calc=function(t,i){return r.calc(t,i)},t.crossTraceCalc=function(t){return r._runCrossTraceCalc("icicle",t)}}}),d8=g({"src/traces/icicle/partition.js"(t,r){var i=cu(),n=dH();r.exports=function(t,r,a){var o=a.flipX,s=a.flipY,l="h"===a.orientation,u=a.maxDepth,c=r[0],h=r[1];u&&(c=(t.height+1)*r[0]/Math.min(t.height+1,u),h=(t.height+1)*r[1]/Math.min(t.height+1,u));var d=i.partition().padding(a.pad.inner).size(l?[r[1],c]:[r[0],h])(t);return(l||o||s)&&n(d,r,{swapXY:l,flipX:o,flipY:s}),d}}}),d7=g({"src/traces/icicle/style.js"(t,r){var i=k(),n=ei(),a=t_(),o=aI().resizeText,s=dI();function l(t,r,i,o){var l=r.data.data,u=!r.children,c=l.i,h=a.castOption(i,c,"marker.line.color")||n.defaultLine,d=a.castOption(i,c,"marker.line.width")||0;t.call(s,r,i,o).style("stroke-width",d).call(n.stroke,h).style("opacity",u?i.leaf.opacity:null)}r.exports={style:function(t){var r=t._fullLayout._iciclelayer.selectAll(".trace");o(t,r,"icicle"),r.each(function(r){var n=i.select(this),a=r[0].trace;n.style("opacity",a.opacity),n.selectAll("path.surface").each(function(r){i.select(this).call(l,r,a,t)})})},styleOne:l}}}),d9=g({"src/traces/icicle/draw_descendants.js"(t,r){var i=k(),n=t_(),a=rr(),o=tN(),s=d8(),l=d7().styleOne,u=dj(),c=dP(),h=dz(),d=dF().formatSliceLabel;r.exports=function(t,r,f,p,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,b=m.pathSlice,_=m.toMoveInsideSlice,w=m.strTransform,T=m.hasTransition,A=m.handleSlicesExit,M=m.makeUpdateSliceInterpolator,k=m.makeUpdateTextInterpolator,S=m.prevEntry,E=t._context.staticPlot,D=t._fullLayout,C=r[0].trace,I=-1!==C.textposition.indexOf("left"),L=-1!==C.textposition.indexOf("right"),P=-1!==C.textposition.indexOf("bottom"),z=s(f,[g,y],{flipX:C.tiling.flip.indexOf("x")>-1,flipY:C.tiling.flip.indexOf("y")>-1,orientation:C.tiling.orientation,pad:{inner:C.tiling.pad},maxDepth:C._maxDepth}).descendants(),F=1/0,O=-1/0;z.forEach(function(t){var r=t.depth;r>=C._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(F=Math.min(F,r),O=Math.max(O,r))}),p=p.data(z,c.getPtId),C._maxVisibleLayers=isFinite(O)?O-F+1:0,p.enter().append("g").classed("slice",!0),A(p,!1,{},[g,y],b),p.order();var R=null;if(T&&S){var B=c.getPtId(S);p.each(function(t){null===R&&c.getPtId(t)===B&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})})}var j=function(){return R||{x0:0,x1:g,y0:0,y1:y}},N=p;return T&&(N=N.transition().each("end",function(){var r=i.select(this);c.setSliceCursor(r,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),N.each(function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=x(s.y0),s._y1=x(s.y1),s._hoverX=v(s.x1-C.tiling.pad),s._hoverY=x(P?s.y1-C.tiling.pad/2:s.y0+C.tiling.pad/2);var p=i.select(this),m=n.ensureSingle(p,"path","surface",function(t){t.style("pointer-events",E?"none":"all")});T?m.transition().attrTween("d",function(t){var r=M(t,!1,j(),[g,y],{orientation:C.tiling.orientation,flipX:C.tiling.flip.indexOf("x")>-1,flipY:C.tiling.flip.indexOf("y")>-1});return function(t){return b(r(t))}}):m.attr("d",b),p.call(h,f,t,r,{styleOne:l,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,t,{isTransitioning:t._transitioning}),m.call(l,s,C,t,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=d(s,f,C,r,D)||"";var A=n.ensureSingle(p,"g","slicetext"),S=n.ensureSingle(A,"text","",function(t){t.attr("data-notex",1)}),z=n.ensureUniformFontSize(t,c.determineTextFont(C,s,D.font));S.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",L?"end":I?"start":"middle").call(a.font,z).call(o.convertToTspans,t),s.textBB=a.bBox(S.node()),s.transform=_(s,{fontSize:z.size}),s.transform.fontSize=z.size,T?S.transition().attrTween("transform",function(t){var r=k(t,!1,j(),[g,y]);return function(t){return w(r(t))}}):S.attr("transform",w(s))}),R}}}),fe=g({"src/traces/icicle/plot.js"(t,r){var i=dX(),n=d9();r.exports=function(t,r,a,o){return i(t,r,a,o,{type:"icicle",drawDescendants:n})}}}),ft=g({"src/traces/icicle/index.js"(t,r){r.exports={moduleType:"trace",name:"icicle",basePlotModule:d1(),categories:[],animatable:!0,attributes:d2(),layoutAttributes:d3(),supplyDefaults:d5(),supplyLayoutDefaults:d4(),calc:d6().calc,crossTraceCalc:d6().crossTraceCalc,plot:fe(),style:d7().style,colorbar:ni(),meta:{}}}}),fr=g({"lib/icicle.js"(t,r){r.exports=ft()}}),fi=g({"src/traces/funnelarea/base_plot.js"(t){var r=tR();t.name="funnelarea",t.plot=function(i,n,a,o){r.plotBasePlot(t.name,i,n,a,o)},t.clean=function(i,n,a,o){r.cleanBasePlot(t.name,i,n,a,o)}}}),fn=g({"src/traces/funnelarea/attributes.js"(t,r){var i=u2(),n=K(),a=an().attributes,{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=eZ(),u=$().extendFlat;r.exports={labels:i.labels,label0:i.label0,dlabel:i.dlabel,values:i.values,marker:{colors:i.marker.colors,line:{color:u({},i.marker.line.color,{dflt:null}),width:u({},i.marker.line.width,{dflt:1}),editType:"calc"},pattern:i.marker.pattern,editType:"calc"},text:i.text,hovertext:i.hovertext,scalegroup:u({},i.scalegroup,{}),textinfo:u({},i.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:l({editType:"plot"}),hoverinfo:u({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:l(),textposition:u({},i.textposition,{values:["inside","none"],dflt:"inside"}),textfont:i.textfont,insidetextfont:i.insidetextfont,title:{text:i.title.text,font:i.title.font,position:u({},i.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),fa=g({"src/traces/funnelarea/layout_attributes.js"(t,r){r.exports={hiddenlabels:u5().hiddenlabels,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),fo=g({"src/traces/funnelarea/defaults.js"(t,r){var i=t_(),n=fn(),a=an().defaults,o=aS().handleText,s=u3().handleLabelsAndValues,l=u3().handleMarkerDefaults;r.exports=function(t,r,u,c){function h(a,o){return i.coerce(t,r,n,a,o)}var d,f=s(h("labels"),h("values")),p=f.len;if(r._hasLabels=f.hasLabels,r._hasValues=f.hasValues,!r._hasLabels&&r._hasValues&&(h("label0"),h("dlabel")),!p){r.visible=!1;return}r._length=p,l(t,r,c,h),h("scalegroup");var m=h("text"),g=h("texttemplate");if(h("texttemplatefallback"),g||(d=h("textinfo",Array.isArray(m)?"text+percent":"percent")),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),g||d&&"none"!==d){var y=h("textposition");o(t,r,c,h,y,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===d&&h("textposition","none");a(r,c,h),h("title.text")&&(h("title.position"),i.coerceFont(h,"title.font",c.font)),h("aspectratio"),h("baseratio")}}}),fs=g({"src/traces/funnelarea/layout_defaults.js"(t,r){var i=t_(),n=fa();r.exports=function(t,r){function a(a,o){return i.coerce(t,r,n,a,o)}a("hiddenlabels"),a("funnelareacolorway",r.colorway),a("extendfunnelareacolors")}}}),fl=g({"src/traces/funnelarea/calc.js"(t,r){var i=u6();r.exports={calc:function(t,r){return i.calc(t,r)},crossTraceCalc:function(t){i.crossTraceCalc(t,{type:"funnelarea"})}}}}),fu=g({"src/traces/funnelarea/plot.js"(t,r){var i=k(),n=rr(),a=t_(),o=a.strScale,s=a.strTranslate,l=tN(),u=az().toMoveInsideBar,c=aI(),h=c.recordMinTextSize,d=c.clearMinTextSize,f=rA(),p=u7(),m=p.attachFxHandlers,g=p.determineInsideTextFont,y=p.layoutAreas,v=p.prerenderTitles,x=p.positionTitleOutside,b=p.formatSliceLabel;function _(t,r){return"l"+(r[0]-t[0])+","+(r[1]-t[1])}r.exports=function(t,r){var c=t._context.staticPlot,p=t._fullLayout;d("funnelarea",p),v(r,t),y(r,p._size),a.makeTraceGroups(p._funnelarealayer,r,"trace").each(function(r){var d=i.select(this),y=r[0],v=y.trace;(function(t){if(t.length){var r,i,n=t[0],a=n.trace,o=a.aspectratio,s=a.baseratio;s>.999&&(s=.999);var l,u=Math.pow(s,2),c=n.vTotal,h=c*u/(1-u)/c,d=[];for(d.push(E()),r=t.length-1;r>-1;r--)if(!(i=t[r]).hidden){var f=i.v/c;h+=f,d.push(E())}var p=1/0,m=-1/0;for(r=0;r-1;r--)if(!(i=t[r]).hidden){var A,M,k=d[T+=1][0],S=d[T][1];i.TL=[-k,S],i.TR=[k,S],i.BL=_,i.BR=w,i.pxmid=(A=i.TR,M=i.BR,[.5*(A[0]+M[0]),.5*(A[1]+M[1])]),_=i.TL,w=i.TR}}function E(){var t,r={x:t=Math.sqrt(h),y:-t};return[r.x,r.y]}})(r),d.each(function(){var d=i.select(this).selectAll("g.slice").data(r);d.enter().append("g").classed("slice",!0),d.exit().remove(),d.each(function(o,s){if(o.hidden)return void i.select(this).selectAll("path,g").remove();o.pointNumber=o.i,o.curveNumber=v.index;var d=y.cx,x=y.cy,w=i.select(this),T=w.selectAll("path.surface").data([o]);T.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),w.call(m,t,r);var A="M"+(d+o.TR[0])+","+(x+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";T.attr("d",A),b(t,o,y);var M=f.castOption(v.textposition,o.pts),k=w.selectAll("g.slicetext").data(o.text&&"none"!==M?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each(function(){var c=a.ensureSingle(i.select(this),"text","",function(t){t.attr("data-notex",1)}),f=a.ensureUniformFontSize(t,g(v,o,p.font));c.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,f).call(l.convertToTspans,t);var m,y=n.bBox(c.node()),b=Math.min(o.BL[1],o.BR[1])+x,_=Math.max(o.TL[1],o.TR[1])+x;(m=u(Math.max(o.TL[0],o.BL[0])+d,Math.min(o.TR[0],o.BR[0])+d,b,_,y,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=f.size,h(v.type,m,p),r[s].transform=m,a.setTransormAndDisplay(c,m)})});var w=i.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);w.enter().append("g").classed("titletext",!0),w.exit().remove(),w.each(function(){var r=a.ensureSingle(i.select(this),"text","",function(t){t.attr("data-notex",1)}),u=v.title.text;v._meta&&(u=a.templateString(u,v._meta)),r.text(u).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,v.title.font).call(l.convertToTspans,t);var c=x(y,p._size);r.attr("transform",s(c.x,c.y)+o(Math.min(1,c.scale))+s(c.tx,c.ty))})})})}}}),fc=g({"src/traces/funnelarea/style.js"(t,r){var i=k(),n=rk(),a=aI().resizeText;r.exports=function(t){var r=t._fullLayout._funnelarealayer.selectAll(".trace");a(t,r,"funnelarea"),r.each(function(r){var a=r[0].trace,o=i.select(this);o.style({opacity:a.opacity}),o.selectAll("path.surface").each(function(r){i.select(this).call(n,r,a,t)})})}}}),fh=g({"src/traces/funnelarea/index.js"(t,r){r.exports={moduleType:"trace",name:"funnelarea",basePlotModule:fi(),categories:["pie-like","funnelarea","showLegend"],attributes:fn(),layoutAttributes:fa(),supplyDefaults:fo(),supplyLayoutDefaults:fs(),calc:fl().calc,crossTraceCalc:fl().crossTraceCalc,plot:fu(),style:fc(),styleOne:rk(),meta:{}}}}),fd=g({"lib/funnelarea.js"(t,r){r.exports=fh()}}),ff=g({"stackgl_modules/index.js"(t,r){var i={3065(t,r,i){t.exports={alpha_shape:i(3502),convex_hull:i(7352),delaunay_triangulate:i(7642),gl_cone3d:i(6405),gl_error3d:i(9165),gl_line3d:i(5714),gl_mesh3d:i(7201),gl_plot3d:i(4100),gl_scatter3d:i(8418),gl_streamtube3d:i(7815),gl_surface3d:i(9499),ndarray:i(9618),ndarray_linear_interpolate:i(4317)}},6296(t,r,i){t.exports=function(t){var r=(t=t||{}).eye||[0,0,1],i=t.center||[0,0,0],l=t.up||[0,1,0],u=t.distanceLimits||[0,1/0],c=t.mode||"turntable",h=n(),d=a(),f=o();return h.setDistanceLimits(u[0],u[1]),h.lookAt(0,r,i,l),d.setDistanceLimits(u[0],u[1]),d.lookAt(0,r,i,l),f.setDistanceLimits(u[0],u[1]),f.lookAt(0,r,i,l),new s({turntable:h,orbit:d,matrix:f},c)};var n=i(7261),a=i(9977),o=i(1811);function s(t,r){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(r){return t[r]}),this._mode=r,this._active=t[r],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var l=s.prototype;l.flush=function(t){for(var r=this._controllerList,i=0;i"u"?i(1538):WeakMap,a=i(2762),o=i(8116),s=new n;t.exports=function(t){var r=s.get(t),i=r&&(r._triangleBuffer.handle||r._triangleBuffer.buffer);if(!i||!t.isBuffer(i)){var n=a(t,new Float32Array([-1,-1,-1,4,4,-1]));(r=o(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,s.set(t,r)}r.bind(),t.drawArrays(t.TRIANGLES,0,3),r.unbind()}},1085(t,r,i){var n=i(1371);t.exports=function(t,r,i){r="number"==typeof r?r:1,i=i||": ";var a=t.split(/\r?\n/),o=String(a.length+r-1).length;return a.map(function(t,a){var s=a+r,l=String(s).length;return n(s,o-l)+i+t}).join(` -`)}},3952(t,r,i){t.exports=function(t){var r=t.length;if(0===r)return[];if(1===r)return[0];for(var i=t[0].length,a=[t[0]],o=[0],s=1;s0?s-4:s;for(i=0;i>16&255,c[h++]=r>>8&255,c[h++]=255&r;return 2===l&&(r=n[t.charCodeAt(i)]<<2|n[t.charCodeAt(i+1)]>>4,c[h++]=255&r),1===l&&(r=n[t.charCodeAt(i)]<<10|n[t.charCodeAt(i+1)]<<4|n[t.charCodeAt(i+2)]>>2,c[h++]=r>>8&255,c[h++]=255&r),c},r.fromByteArray=function(t){for(var r,n=t.length,a=n%3,o=[],s=0,l=n-a;s>18&63]+i[a>>12&63]+i[a>>6&63]+i[63&a]);return o.join("")}(t,s,s+16383>l?l:s+16383));return 1===a?o.push(i[(r=t[n-1])>>2]+i[r<<4&63]+"=="):2===a&&o.push(i[(r=(t[n-2]<<8)+t[n-1])>>10]+i[r>>4&63]+i[r<<2&63]+"="),o.join("")};for(var i=[],n=[],a="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");-1===i&&(i=r);var n=i===r?0:4-i%4;return[i,n]}n[45]=62,n[95]=63},3865(t,r,i){var n=i(869);t.exports=function(t,r){return n(t[0].mul(r[1]).add(r[0].mul(t[1])),t[1].mul(r[1]))}},1318(t){t.exports=function(t,r){return t[0].mul(r[1]).cmp(r[0].mul(t[1]))}},8697(t,r,i){var n=i(869);t.exports=function(t,r){return n(t[0].mul(r[1]),t[1].mul(r[0]))}},7842(t,r,i){var n=i(6330),a=i(1533),o=i(2651),s=i(6768),l=i(869),u=i(8697);t.exports=function t(r,i){if(n(r))return i?u(r,t(i)):[r[0].clone(),r[1].clone()];var c,h,d=0;if(a(r))c=r.clone();else if("string"==typeof r)c=s(r);else{if(0===r)return[o(0),o(1)];if(r===Math.floor(r))c=o(r);else{for(;r!==Math.floor(r);)r*=1157920892373162e62,d-=256;c=o(r)}}if(n(i))c.mul(i[1]),h=i[0].clone();else if(a(i))h=i.clone();else if("string"==typeof i)h=s(i);else if(i)if(i===Math.floor(i))h=o(i);else{for(;i!==Math.floor(i);)i*=1157920892373162e62,d+=256;h=o(i)}else h=o(1);return d>0?c=c.ushln(d):d<0&&(h=h.ushln(-d)),l(c,h)}},6330(t,r,i){var n=i(1533);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},5716(t,r,i){var n=i(6859);t.exports=function(t){return t.cmp(new n(0))}},1369(t,r,i){var n=i(5716);t.exports=function(t){var r=t.length,i=t.words,a=0;if(1===r)a=i[0];else if(2===r)a=i[0]+0x4000000*i[1];else for(var o=0;o20?52:i+32}},1533(t,r,i){i(6859),t.exports=function(t){return t&&"object"==typeof t&&!!t.words}},2651(t,r,i){var n=i(6859),a=i(2361);t.exports=function(t){var r=a.exponent(t);return r<52?new n(t):new n(t*Math.pow(2,52-r)).ushln(r-52)}},869(t,r,i){var n=i(2651),a=i(5716);t.exports=function(t,r){var i=a(t),o=a(r);if(0===i)return[n(0),n(1)];if(0===o)return[n(0),n(0)];o<0&&(t=t.neg(),r=r.neg());var s=t.gcd(r);return s.cmpn(1)?[t.div(s),r.div(s)]:[t,r]}},6768(t,r,i){var n=i(6859);t.exports=function(t){return new n(t)}},6504(t,r,i){var n=i(869);t.exports=function(t,r){return n(t[0].mul(r[0]),t[1].mul(r[1]))}},7721(t,r,i){var n=i(5716);t.exports=function(t){return n(t[0])*n(t[1])}},5572(t,r,i){var n=i(869);t.exports=function(t,r){return n(t[0].mul(r[1]).sub(t[1].mul(r[0])),t[1].mul(r[1]))}},946(t,r,i){var n=i(1369),a=i(4025);t.exports=function(t){var r=t[0],i=t[1];if(0===r.cmpn(0))return 0;var o=r.abs().divmod(i.abs()),s=n(o.div),l=o.mod,u=r.negative!==i.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,h=n(l.ushln(c).divRound(i));return u*(s+h*Math.pow(2,-c))}var d=i.bitLength()-l.bitLength()+53,h=n(l.ushln(d).divRound(i));return d<1023?u*h*Math.pow(2,-d):u*(h*=11125369292536007e-324)*Math.pow(2,1023-d)}},2478(t){function r(t,r,i,n,a){for(var o=a+1;n<=a;){var s=n+a>>>1,l=t[s];(void 0!==i?i(l,r):l-r)>=0?(o=s,a=s-1):n=s+1}return o}function i(t,r,i,n,a){for(var o=a+1;n<=a;){var s=n+a>>>1,l=t[s];(void 0!==i?i(l,r):l-r)>0?(o=s,a=s-1):n=s+1}return o}function n(t,r,i,n,a){for(var o=n-1;n<=a;){var s=n+a>>>1,l=t[s];(void 0!==i?i(l,r):l-r)<0?(o=s,n=s+1):a=s-1}return o}function a(t,r,i,n,a){for(var o=n-1;n<=a;){var s=n+a>>>1,l=t[s];(void 0!==i?i(l,r):l-r)<=0?(o=s,n=s+1):a=s-1}return o}function o(t,r,i,n,a){for(;n<=a;){var o=n+a>>>1,s=t[o],l=void 0!==i?i(s,r):s-r;if(0===l)return o;l<=0?n=o+1:a=o-1}return -1}function s(t,r,i,n,a,o){return"function"==typeof i?o(t,r,i,void 0===n?0:0|n,void 0===a?t.length-1:0|a):o(t,r,void 0,void 0===i?0:0|i,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,i,n,a,o){return s(t,i,n,a,o,r)},gt:function(t,r,n,a,o){return s(t,r,n,a,o,i)},lt:function(t,r,i,a,o){return s(t,r,i,a,o,n)},le:function(t,r,i,n,o){return s(t,r,i,n,o,a)},eq:function(t,r,i,n,a){return s(t,r,i,n,a,o)}}},8828(t,r){function i(t){var r=32;return(t&=-t)&&r--,65535&t&&(r-=16),0xff00ff&t&&(r-=8),0xf0f0f0f&t&&(r-=4),0x33333333&t&&(r-=2),0x55555555&t&&(r-=1),r}r.INT_BITS=32,r.INT_MAX=0x7fffffff,r.INT_MIN=-0x80000000,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var r=t>>31;return(t^r)-r},r.min=function(t,r){return r^(t^r)&-(t65535)<<4,t>>>=r,i=(t>255)<<3,t>>>=i,r|=i,i=(t>15)<<2,t>>>=i,r|=i,i=(t>3)<<1,t>>>=i,(r|=i)|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:+(t>=10)},r.popCount=function(t){return t-=t>>>1&0x55555555,((t=(0x33333333&t)+(t>>>2&0x33333333))+(t>>>4)&0xf0f0f0f)*0x1010101>>>24},r.countTrailingZeros=i,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=Array(256);(function(t){for(var r=0;r<256;++r){var i=r,n=r,a=7;for(i>>>=1;i;i>>>=1)n<<=1,n|=1&i,--a;t[r]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},r.interleave2=function(t,r){return t&=65535,r&=65535,(t=((t=((t=((t=(t|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(r=((r=((r=((r=(r|r<<8)&0xff00ff)|r<<4)&0xf0f0f0f)|r<<2)&0x33333333)|r<<1)&0x55555555)<<1},r.deinterleave2=function(t,r){return(t=((t=((t=((t=((t=t>>>r&0x55555555)|t>>>1)&0x33333333)|t>>>2)&0xf0f0f0f)|t>>>4)&0xff00ff)|t>>>16)&65535)<<16>>16},r.interleave3=function(t,r,i){return t&=1023,r&=1023,i&=1023,i=((i=((i=((i=(i|i<<16)&0xff0000ff)|i<<8)&0xf00f00f)|i<<4)&0xc30c30c3)|i<<2)&0x49249249,(t=((t=((t=((t=(t|t<<16)&0xff0000ff)|t<<8)&0xf00f00f)|t<<4)&0xc30c30c3)|t<<2)&0x49249249|(r=((r=((r=((r=(r|r<<16)&0xff0000ff)|r<<8)&0xf00f00f)|r<<4)&0xc30c30c3)|r<<2)&0x49249249)<<1)|i<<2},r.deinterleave3=function(t,r){return(t=((t=((t=((t=((t=t>>>r&0x49249249)|t>>>2)&0xc30c30c3)|t>>>4)&0xf00f00f)|t>>>8)&0xff0000ff)|t>>>16)&1023)<<22>>22},r.nextCombination=function(t){var r=t|t-1;return r+1|(~r&-~r)-1>>>i(t)+1}},6859(t,r,i){!function(t,r){function n(t,r){if(!t)throw Error(r||"Assertion failed")}function a(t,r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}function o(t,r,i){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===r||"be"===r)&&(i=r,r=10),this._init(t||0,r||10,i||"be"))}"object"==typeof t?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{c="u">typeof window&&"u">typeof window.Buffer?window.Buffer:i(7790).Buffer}catch{}function s(t,r){var i=t.charCodeAt(r);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function l(t,r,i){var n=s(t,i);return i-1>=r&&(n|=s(t,i-1)<<4),n}function u(t,r,i,n){for(var a=0,o=Math.min(t.length,i),s=r;s=49?a+=l-49+10:l>=17?a+=l-17+10:a+=l}return a}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,r){return t.cmp(r)>0?t:r},o.min=function(t,r){return 0>t.cmp(r)?t:r},o.prototype._init=function(t,r,i){if("number"==typeof t)return this._initNumber(t,r,i);if("object"==typeof t)return this._initArray(t,r,i);"hex"===r&&(r=16),n(r===(0|r)&&r>=2&&r<=36);var a=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a=0;a-=3)s=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[o]|=s<>>26-l&0x3ffffff,(l+=24)>=26&&(l-=26,o++);else if("le"===i)for(a=0,o=0;a>>26-l&0x3ffffff,(l+=24)>=26&&(l-=26,o++);return this.strip()},o.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=Array(this.length);for(var n=0;n=r;n-=2)a=l(t,r,n)<=18?(o-=18,s+=1,this.words[s]|=a>>>26):o+=8;else for(n=(t.length-r)%2==0?r+1:r;n=18?(o-=18,s+=1,this.words[s]|=a>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var n=0,a=1;a<=0x3ffffff;a*=r)n++;n--,a=a/r|0;for(var o=t.length-i,s=o%n,l=Math.min(o,o-s)+i,c=0,h=i;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c,h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function p(t,r,i){i.negative=r.negative^t.negative;var n=t.length+r.length|0;i.length=n,n=n-1|0;var a=0|t.words[0],o=0|r.words[0],s=a*o,l=0x3ffffff&s,u=s/0x4000000|0;i.words[0]=l;for(var c=1;c>>26,d=0x3ffffff&u,f=Math.min(c,r.length-1),p=Math.max(0,c-t.length+1);p<=f;p++){var m=c-p|0;h+=(s=(a=0|t.words[m])*(o=0|r.words[p])+d)/0x4000000|0,d=0x3ffffff&s}i.words[c]=0|d,u=0|h}return 0!==u?i.words[c]=0|u:i.length--,i.strip()}o.prototype.toString=function(t,r){if(r=0|r||1,16===(t=t||10)||"hex"===t){i="";for(var i,a=0,o=0,s=0;s>>24-a&0xffffff,(a+=2)>=26&&(a-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%r!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],p=f[t];i="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(t);i=(m=m.idivn(p)).isZero()?g+i:h[c-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%r!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?t+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,r){return n("u">typeof c),this.toArrayLike(c,t,r)},o.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},o.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),o=i||Math.max(1,a);n(a<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,l,u=new t(o),c=this.clone();if("le"===r){for(l=0;!c.isZero();l++)s=c.andln(255),c.iushrn(8),u[l]=s;for(;l=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},o.prototype._zeroBits=function(t){if(0===t)return 26;var r=t,i=0;return(8191&r)==0&&(i+=13,r>>>=13),(127&r)==0&&(i+=7,r>>>=7),(15&r)==0&&(i+=4,r>>>=4),(3&r)==0&&(i+=2,r>>>=2),(1&r)==0&&i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;rt.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var r;r=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var r=0|Math.ceil(t/26),i=t%26;this._expand(r),i>0&&r--;for(var a=0;a0&&(this.words[a]=~this.words[a]&0x3ffffff>>26-i,a++);a=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<t.length?(i=this,n=t):(i=t,n=this);for(var r,i,n,a=0,o=0;o>>26;for(;0!==a&&o>>26;if(this.length=i.length,0!==a)this.words[this.length]=a,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var r,i,n=this.iadd(t);return t.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var a=this.cmp(t);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=0x3ffffff&n;for(;0!==o&&s>26,this.words[s]=0x3ffffff&n;if(0===o&&s>>13,p=0|s[1],m=8191&p,g=p>>>13,y=0|s[2],v=8191&y,x=y>>>13,b=0|s[3],_=8191&b,w=b>>>13,T=0|s[4],A=8191&T,M=T>>>13,k=0|s[5],S=8191&k,E=k>>>13,D=0|s[6],C=8191&D,I=D>>>13,L=0|s[7],P=8191&L,z=L>>>13,F=0|s[8],O=8191&F,R=F>>>13,B=0|s[9],j=8191&B,N=B>>>13,V=0|l[0],U=8191&V,q=V>>>13,G=0|l[1],H=8191&G,$=G>>>13,W=0|l[2],Y=8191&W,Z=W>>>13,X=0|l[3],K=8191&X,J=X>>>13,Q=0|l[4],ee=8191&Q,et=Q>>>13,er=0|l[5],ei=8191&er,en=er>>>13,ea=0|l[6],eo=8191&ea,es=ea>>>13,el=0|l[7],eu=8191&el,ec=el>>>13,eh=0|l[8],ed=8191&eh,ef=eh>>>13,ep=0|l[9],em=8191&ep,eg=ep>>>13;i.negative=t.negative^r.negative,i.length=19,n=Math.imul(d,U),a=(a=Math.imul(d,q))+Math.imul(f,U)|0,o=Math.imul(f,q);var ey=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,n=Math.imul(m,U),a=(a=Math.imul(m,q))+Math.imul(g,U)|0,o=Math.imul(g,q),n=n+Math.imul(d,H)|0,a=(a=a+Math.imul(d,$)|0)+Math.imul(f,H)|0,o=o+Math.imul(f,$)|0;var ev=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,n=Math.imul(v,U),a=(a=Math.imul(v,q))+Math.imul(x,U)|0,o=Math.imul(x,q),n=n+Math.imul(m,H)|0,a=(a=a+Math.imul(m,$)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(d,Y)|0,a=(a=a+Math.imul(d,Z)|0)+Math.imul(f,Y)|0,o=o+Math.imul(f,Z)|0;var ex=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,n=Math.imul(_,U),a=(a=Math.imul(_,q))+Math.imul(w,U)|0,o=Math.imul(w,q),n=n+Math.imul(v,H)|0,a=(a=a+Math.imul(v,$)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(m,Y)|0,a=(a=a+Math.imul(m,Z)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,Z)|0,n=n+Math.imul(d,K)|0,a=(a=a+Math.imul(d,J)|0)+Math.imul(f,K)|0,o=o+Math.imul(f,J)|0;var eb=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,n=Math.imul(A,U),a=(a=Math.imul(A,q))+Math.imul(M,U)|0,o=Math.imul(M,q),n=n+Math.imul(_,H)|0,a=(a=a+Math.imul(_,$)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,$)|0,n=n+Math.imul(v,Y)|0,a=(a=a+Math.imul(v,Z)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,Z)|0,n=n+Math.imul(m,K)|0,a=(a=a+Math.imul(m,J)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(d,ee)|0,a=(a=a+Math.imul(d,et)|0)+Math.imul(f,ee)|0,o=o+Math.imul(f,et)|0;var e_=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,n=Math.imul(S,U),a=(a=Math.imul(S,q))+Math.imul(E,U)|0,o=Math.imul(E,q),n=n+Math.imul(A,H)|0,a=(a=a+Math.imul(A,$)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(_,Y)|0,a=(a=a+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(v,K)|0,a=(a=a+Math.imul(v,J)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(m,ee)|0,a=(a=a+Math.imul(m,et)|0)+Math.imul(g,ee)|0,o=o+Math.imul(g,et)|0,n=n+Math.imul(d,ei)|0,a=(a=a+Math.imul(d,en)|0)+Math.imul(f,ei)|0,o=o+Math.imul(f,en)|0;var ew=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,n=Math.imul(C,U),a=(a=Math.imul(C,q))+Math.imul(I,U)|0,o=Math.imul(I,q),n=n+Math.imul(S,H)|0,a=(a=a+Math.imul(S,$)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(A,Y)|0,a=(a=a+Math.imul(A,Z)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(_,K)|0,a=(a=a+Math.imul(_,J)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(v,ee)|0,a=(a=a+Math.imul(v,et)|0)+Math.imul(x,ee)|0,o=o+Math.imul(x,et)|0,n=n+Math.imul(m,ei)|0,a=(a=a+Math.imul(m,en)|0)+Math.imul(g,ei)|0,o=o+Math.imul(g,en)|0,n=n+Math.imul(d,eo)|0,a=(a=a+Math.imul(d,es)|0)+Math.imul(f,eo)|0,o=o+Math.imul(f,es)|0;var eT=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,n=Math.imul(P,U),a=(a=Math.imul(P,q))+Math.imul(z,U)|0,o=Math.imul(z,q),n=n+Math.imul(C,H)|0,a=(a=a+Math.imul(C,$)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(S,Y)|0,a=(a=a+Math.imul(S,Z)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,J)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(_,ee)|0,a=(a=a+Math.imul(_,et)|0)+Math.imul(w,ee)|0,o=o+Math.imul(w,et)|0,n=n+Math.imul(v,ei)|0,a=(a=a+Math.imul(v,en)|0)+Math.imul(x,ei)|0,o=o+Math.imul(x,en)|0,n=n+Math.imul(m,eo)|0,a=(a=a+Math.imul(m,es)|0)+Math.imul(g,eo)|0,o=o+Math.imul(g,es)|0,n=n+Math.imul(d,eu)|0,a=(a=a+Math.imul(d,ec)|0)+Math.imul(f,eu)|0,o=o+Math.imul(f,ec)|0;var eA=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,n=Math.imul(O,U),a=(a=Math.imul(O,q))+Math.imul(R,U)|0,o=Math.imul(R,q),n=n+Math.imul(P,H)|0,a=(a=a+Math.imul(P,$)|0)+Math.imul(z,H)|0,o=o+Math.imul(z,$)|0,n=n+Math.imul(C,Y)|0,a=(a=a+Math.imul(C,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(S,K)|0,a=(a=a+Math.imul(S,J)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(A,ee)|0,a=(a=a+Math.imul(A,et)|0)+Math.imul(M,ee)|0,o=o+Math.imul(M,et)|0,n=n+Math.imul(_,ei)|0,a=(a=a+Math.imul(_,en)|0)+Math.imul(w,ei)|0,o=o+Math.imul(w,en)|0,n=n+Math.imul(v,eo)|0,a=(a=a+Math.imul(v,es)|0)+Math.imul(x,eo)|0,o=o+Math.imul(x,es)|0,n=n+Math.imul(m,eu)|0,a=(a=a+Math.imul(m,ec)|0)+Math.imul(g,eu)|0,o=o+Math.imul(g,ec)|0,n=n+Math.imul(d,ed)|0,a=(a=a+Math.imul(d,ef)|0)+Math.imul(f,ed)|0,o=o+Math.imul(f,ef)|0;var eM=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,n=Math.imul(j,U),a=(a=Math.imul(j,q))+Math.imul(N,U)|0,o=Math.imul(N,q),n=n+Math.imul(O,H)|0,a=(a=a+Math.imul(O,$)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(P,Y)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(z,Y)|0,o=o+Math.imul(z,Z)|0,n=n+Math.imul(C,K)|0,a=(a=a+Math.imul(C,J)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(S,ee)|0,a=(a=a+Math.imul(S,et)|0)+Math.imul(E,ee)|0,o=o+Math.imul(E,et)|0,n=n+Math.imul(A,ei)|0,a=(a=a+Math.imul(A,en)|0)+Math.imul(M,ei)|0,o=o+Math.imul(M,en)|0,n=n+Math.imul(_,eo)|0,a=(a=a+Math.imul(_,es)|0)+Math.imul(w,eo)|0,o=o+Math.imul(w,es)|0,n=n+Math.imul(v,eu)|0,a=(a=a+Math.imul(v,ec)|0)+Math.imul(x,eu)|0,o=o+Math.imul(x,ec)|0,n=n+Math.imul(m,ed)|0,a=(a=a+Math.imul(m,ef)|0)+Math.imul(g,ed)|0,o=o+Math.imul(g,ef)|0,n=n+Math.imul(d,em)|0,a=(a=a+Math.imul(d,eg)|0)+Math.imul(f,em)|0,o=o+Math.imul(f,eg)|0;var ek=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,n=Math.imul(j,H),a=(a=Math.imul(j,$))+Math.imul(N,H)|0,o=Math.imul(N,$),n=n+Math.imul(O,Y)|0,a=(a=a+Math.imul(O,Z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(P,K)|0,a=(a=a+Math.imul(P,J)|0)+Math.imul(z,K)|0,o=o+Math.imul(z,J)|0,n=n+Math.imul(C,ee)|0,a=(a=a+Math.imul(C,et)|0)+Math.imul(I,ee)|0,o=o+Math.imul(I,et)|0,n=n+Math.imul(S,ei)|0,a=(a=a+Math.imul(S,en)|0)+Math.imul(E,ei)|0,o=o+Math.imul(E,en)|0,n=n+Math.imul(A,eo)|0,a=(a=a+Math.imul(A,es)|0)+Math.imul(M,eo)|0,o=o+Math.imul(M,es)|0,n=n+Math.imul(_,eu)|0,a=(a=a+Math.imul(_,ec)|0)+Math.imul(w,eu)|0,o=o+Math.imul(w,ec)|0,n=n+Math.imul(v,ed)|0,a=(a=a+Math.imul(v,ef)|0)+Math.imul(x,ed)|0,o=o+Math.imul(x,ef)|0,n=n+Math.imul(m,em)|0,a=(a=a+Math.imul(m,eg)|0)+Math.imul(g,em)|0,o=o+Math.imul(g,eg)|0;var eS=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,n=Math.imul(j,Y),a=(a=Math.imul(j,Z))+Math.imul(N,Y)|0,o=Math.imul(N,Z),n=n+Math.imul(O,K)|0,a=(a=a+Math.imul(O,J)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(P,ee)|0,a=(a=a+Math.imul(P,et)|0)+Math.imul(z,ee)|0,o=o+Math.imul(z,et)|0,n=n+Math.imul(C,ei)|0,a=(a=a+Math.imul(C,en)|0)+Math.imul(I,ei)|0,o=o+Math.imul(I,en)|0,n=n+Math.imul(S,eo)|0,a=(a=a+Math.imul(S,es)|0)+Math.imul(E,eo)|0,o=o+Math.imul(E,es)|0,n=n+Math.imul(A,eu)|0,a=(a=a+Math.imul(A,ec)|0)+Math.imul(M,eu)|0,o=o+Math.imul(M,ec)|0,n=n+Math.imul(_,ed)|0,a=(a=a+Math.imul(_,ef)|0)+Math.imul(w,ed)|0,o=o+Math.imul(w,ef)|0,n=n+Math.imul(v,em)|0,a=(a=a+Math.imul(v,eg)|0)+Math.imul(x,em)|0,o=o+Math.imul(x,eg)|0;var eE=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,n=Math.imul(j,K),a=(a=Math.imul(j,J))+Math.imul(N,K)|0,o=Math.imul(N,J),n=n+Math.imul(O,ee)|0,a=(a=a+Math.imul(O,et)|0)+Math.imul(R,ee)|0,o=o+Math.imul(R,et)|0,n=n+Math.imul(P,ei)|0,a=(a=a+Math.imul(P,en)|0)+Math.imul(z,ei)|0,o=o+Math.imul(z,en)|0,n=n+Math.imul(C,eo)|0,a=(a=a+Math.imul(C,es)|0)+Math.imul(I,eo)|0,o=o+Math.imul(I,es)|0,n=n+Math.imul(S,eu)|0,a=(a=a+Math.imul(S,ec)|0)+Math.imul(E,eu)|0,o=o+Math.imul(E,ec)|0,n=n+Math.imul(A,ed)|0,a=(a=a+Math.imul(A,ef)|0)+Math.imul(M,ed)|0,o=o+Math.imul(M,ef)|0,n=n+Math.imul(_,em)|0,a=(a=a+Math.imul(_,eg)|0)+Math.imul(w,em)|0,o=o+Math.imul(w,eg)|0;var eD=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eD>>>26)|0,eD&=0x3ffffff,n=Math.imul(j,ee),a=(a=Math.imul(j,et))+Math.imul(N,ee)|0,o=Math.imul(N,et),n=n+Math.imul(O,ei)|0,a=(a=a+Math.imul(O,en)|0)+Math.imul(R,ei)|0,o=o+Math.imul(R,en)|0,n=n+Math.imul(P,eo)|0,a=(a=a+Math.imul(P,es)|0)+Math.imul(z,eo)|0,o=o+Math.imul(z,es)|0,n=n+Math.imul(C,eu)|0,a=(a=a+Math.imul(C,ec)|0)+Math.imul(I,eu)|0,o=o+Math.imul(I,ec)|0,n=n+Math.imul(S,ed)|0,a=(a=a+Math.imul(S,ef)|0)+Math.imul(E,ed)|0,o=o+Math.imul(E,ef)|0,n=n+Math.imul(A,em)|0,a=(a=a+Math.imul(A,eg)|0)+Math.imul(M,em)|0,o=o+Math.imul(M,eg)|0;var eC=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,n=Math.imul(j,ei),a=(a=Math.imul(j,en))+Math.imul(N,ei)|0,o=Math.imul(N,en),n=n+Math.imul(O,eo)|0,a=(a=a+Math.imul(O,es)|0)+Math.imul(R,eo)|0,o=o+Math.imul(R,es)|0,n=n+Math.imul(P,eu)|0,a=(a=a+Math.imul(P,ec)|0)+Math.imul(z,eu)|0,o=o+Math.imul(z,ec)|0,n=n+Math.imul(C,ed)|0,a=(a=a+Math.imul(C,ef)|0)+Math.imul(I,ed)|0,o=o+Math.imul(I,ef)|0,n=n+Math.imul(S,em)|0,a=(a=a+Math.imul(S,eg)|0)+Math.imul(E,em)|0,o=o+Math.imul(E,eg)|0;var eI=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,n=Math.imul(j,eo),a=(a=Math.imul(j,es))+Math.imul(N,eo)|0,o=Math.imul(N,es),n=n+Math.imul(O,eu)|0,a=(a=a+Math.imul(O,ec)|0)+Math.imul(R,eu)|0,o=o+Math.imul(R,ec)|0,n=n+Math.imul(P,ed)|0,a=(a=a+Math.imul(P,ef)|0)+Math.imul(z,ed)|0,o=o+Math.imul(z,ef)|0,n=n+Math.imul(C,em)|0,a=(a=a+Math.imul(C,eg)|0)+Math.imul(I,em)|0,o=o+Math.imul(I,eg)|0;var eL=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eL>>>26)|0,eL&=0x3ffffff,n=Math.imul(j,eu),a=(a=Math.imul(j,ec))+Math.imul(N,eu)|0,o=Math.imul(N,ec),n=n+Math.imul(O,ed)|0,a=(a=a+Math.imul(O,ef)|0)+Math.imul(R,ed)|0,o=o+Math.imul(R,ef)|0,n=n+Math.imul(P,em)|0,a=(a=a+Math.imul(P,eg)|0)+Math.imul(z,em)|0,o=o+Math.imul(z,eg)|0;var eP=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,n=Math.imul(j,ed),a=(a=Math.imul(j,ef))+Math.imul(N,ed)|0,o=Math.imul(N,ef),n=n+Math.imul(O,em)|0,a=(a=a+Math.imul(O,eg)|0)+Math.imul(R,em)|0,o=o+Math.imul(R,eg)|0;var ez=(c+n|0)+((8191&a)<<13)|0;c=(o+(a>>>13)|0)+(ez>>>26)|0,ez&=0x3ffffff,n=Math.imul(j,em),a=(a=Math.imul(j,eg))+Math.imul(N,em)|0,o=Math.imul(N,eg);var eF=(c+n|0)+((8191&a)<<13)|0;return c=(o+(a>>>13)|0)+(eF>>>26)|0,eF&=0x3ffffff,u[0]=ey,u[1]=ev,u[2]=ex,u[3]=eb,u[4]=e_,u[5]=ew,u[6]=eT,u[7]=eA,u[8]=eM,u[9]=ek,u[10]=eS,u[11]=eE,u[12]=eD,u[13]=eC,u[14]=eI,u[15]=eL,u[16]=eP,u[17]=ez,u[18]=eF,0!==c&&(u[19]=c,i.length++),i};function g(t,r,i){return(new y).mulp(t,r,i)}function y(t,r){this.x=t,this.y=r}Math.imul||(m=p),o.prototype.mulTo=function(t,r){var i=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,r):i<63?p(this,t,r):i<1024?function(t,r,i){i.negative=r.negative^t.negative,i.length=t.length+r.length;for(var n=0,a=0,o=0;o>>26)|0)>>>26,s&=0x3ffffff}i.words[o]=l,n=s,s=a}return 0!==n?i.words[o]=n:i.length--,i.strip()}(this,t,r):g(this,t,r)},y.prototype.makeRBT=function(t){for(var r=Array(t),i=o.prototype._countBits(t)-1,n=0;n>=1;return n},y.prototype.permute=function(t,r,i,n,a,o){for(var s=0;s>>=1)a++;return 1<>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*r;s>=26,r+=(a/0x4000000|0)+(o>>>26),this.words[i]=0x3ffffff&o}return 0!==r&&(this.words[i]=r,this.length++),0===t&&(this.length=1,this._normSign()),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var r=function(t){for(var r=Array(t.bitLength()),i=0;i>>a}return r}(t);if(0===r.length)return new o(1);for(var i=this,n=0;n=0);var r,i=t%26,a=(t-i)/26,o=0x3ffffff>>>26-i<<26-i;if(0!==i){var s=0;for(r=0;r>>26-i}s&&(this.words[r]=s,this.length++)}if(0!==a){for(r=this.length-1;r>=0;r--)this.words[r+a]=this.words[r];for(r=0;r=0);var a=r?(r-r%26)/26:0,o=t%26,s=Math.min((t-o)/26,this.length),l=0x3ffffff^0x3ffffff>>>o<s)for(this.length-=s,u=0;u=0&&(0!==c||u>=a);u--){var h=0|this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&l}return i&&0!==c&&(i.words[i.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,r,i){return n(0===this.negative),this.iushrn(t,r,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var r=t%26,i=(t-r)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var r=t%26,i=(t-r)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==r&&i++,this.length=Math.min(i,this.length),0!==r&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>r<=0x4000000;r++)this.words[r]-=0x4000000,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<0x4000000),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r>26)-(u/0x4000000|0),this.words[a+i]=0x3ffffff&s}for(;a>26,this.words[a+i]=0x3ffffff&s;if(0===l)return this.strip();for(n(-1===l),l=0,a=0;a>26,this.words[a]=0x3ffffff&s;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,r){var i=this.length-t.length,n=this.clone(),a=t,s=0|a.words[a.length-1];0!=(i=26-this._countBits(s))&&(a=a.ushln(i),n.iushln(i),s=0|a.words[a.length-1]);var l,u=n.length-a.length;if("mod"!==r){(l=new o(null)).length=u+1,l.words=Array(l.length);for(var c=0;c=0;d--){var f=(0|n.words[a.length+d])*0x4000000+(0|n.words[a.length+d-1]);for(f=Math.min(f/s|0,0x3ffffff),n._ishlnsubmul(a,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);l&&(l.words[d]=f)}return l&&l.strip(),n.strip(),"div"!==r&&0!==i&&n.iushrn(i),{div:l||null,mod:n}},o.prototype.divmod=function(t,r,i){var a,s,l;return(n(!t.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(l=this.neg().divmod(t,r),"mod"!==r&&(a=l.div.neg()),"div"!==r&&(s=l.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:a,mod:s}):0===this.negative&&0!==t.negative?(l=this.divmod(t.neg(),r),"mod"!==r&&(a=l.div.neg()),{div:a,mod:l.mod}):(this.negative&t.negative)!=0?(l=this.neg().divmod(t.neg(),r),"div"!==r&&(s=l.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:l.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new o(0),mod:this}:1===t.length?"div"===r?{div:this.divn(t.words[0]),mod:null}:"mod"===r?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,r)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.mod.abs(),n=t.abs().iushrn(1),a=1&t.words[0],s=i.cmp(n);if(s<0||1===a&&0===s)return r.div;var l=new o(1);return l.negative=this.negative^t.negative,r.div.iadd(l)},o.prototype.modn=function(t){n(t<=0x3ffffff);for(var r=0x4000000%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(0|this.words[a]))%t;return i},o.prototype.idivn=function(t){n(t<=0x3ffffff);for(var r=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+0x4000000*r;this.words[i]=a/t|0,r=a%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var r=this,i=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var a=new o(1),s=new o(0),l=new o(0),u=new o(1),c=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++c;for(var h=i.clone(),d=r.clone();!r.isZero();){for(var f=0,p=1;(r.words[0]&p)==0&&f<26;++f,p<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(h),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var m=0,g=1;(i.words[0]&g)==0&&m<26;++m,g<<=1);if(m>0)for(i.iushrn(m);m-- >0;)(l.isOdd()||u.isOdd())&&(l.iadd(h),u.isub(d)),l.iushrn(1),u.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(l),s.isub(u)):(i.isub(r),l.isub(a),u.isub(s))}return{a:l,b:u,gcd:i.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var r,i=this,a=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var s=new o(1),l=new o(0),u=a.clone();i.cmpn(1)>0&&a.cmpn(1)>0;){for(var c=0,h=1;(i.words[0]&h)==0&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,f=1;(a.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(a.iushrn(d);d-- >0;)l.isOdd()&&l.iadd(u),l.iushrn(1);i.cmp(a)>=0?(i.isub(a),s.isub(l)):(a.isub(i),l.isub(s))}return 0>(r=0===i.cmpn(1)?s:l).cmpn(0)&&r.iadd(t),r},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var n=0;r.isEven()&&i.isEven();n++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var a=r.cmp(i);if(a<0){var o=r;r=i,i=o}else if(0===a||0===i.cmpn(1))break;r.isub(i)}return i.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var r=t%26,i=(t-r)/26,a=1<>>26,l&=0x3ffffff,this.words[s]=l}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var r,i=t<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)r=1;else{i&&(t=-t),n(t<=0x3ffffff,"Number is too big");var a=0|this.words[0];r=a===t?0:at.length)return 1;if(this.length=0;i--){var n=0|this.words[i],a=0|t.words[i];if(n!==a){na&&(r=1);break}}return r},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return -1===this.cmpn(t)},o.prototype.lt=function(t){return -1===this.cmp(t)},o.prototype.lten=function(t){return 0>=this.cmpn(t)},o.prototype.lte=function(t){return 0>=this.cmp(t)},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new A(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function x(t,r){this.name=t,this.p=new o(r,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var r=o._prime(t);this.m=r.p,this.prime=r}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var t=new o(null);return t.words=Array(Math.ceil(this.n/13)),t},x.prototype.ireduce=function(t){var r,i=t;do this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength();while(r>this.n);var n=r0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},x.prototype.split=function(t,r){t.iushrn(this.n,0,r)},x.prototype.imulK=function(t){return t.imul(this.k)},a(b,x),b.prototype.split=function(t,r){for(var i=Math.min(t.length,9),n=0;n>>22,a=o}a>>>=22,t.words[n-10]=a,0===a&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i>>=26,t.words[i]=a,r=n}return 0!==r&&(t.words[t.length++]=r),t},o._prime=function(t){var r;if(v[t])return v[t];if("k256"===t)r=new b;else if("p224"===t)r=new _;else if("p192"===t)r=new w;else if("p25519"===t)r=new T;else throw Error("Unknown prime "+t);return v[t]=r,r},A.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,r){n((t.negative|r.negative)==0,"red works only with positives"),n(t.red&&t.red===r.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},A.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},A.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return 0>i.cmpn(0)&&i.iadd(this.m),i._forceRed(this)},A.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return 0>i.cmpn(0)&&i.iadd(this.m),i},A.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},A.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},A.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(n(r%2==1),3===r){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);n(!a.isZero());var l=new o(1).toRed(this),u=l.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var d=this.pow(h,a),f=this.pow(t,a.addn(1).iushrn(1)),p=this.pow(t,a),m=s;0!==p.cmp(l);){for(var g=p,y=0;0!==g.cmp(l);y++)g=g.redSqr();n(y=0;n--){for(var c=r.words[n],h=u-1;h>=0;h--){var d=c>>h&1;if(a!==i[0]&&(a=this.sqr(a)),0===d&&0===s){l=0;continue}s<<=1,s|=d,(4==++l||0===n&&0===h)&&(a=this.mul(a,i[s]),l=0,s=0)}u=26}return a},A.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},A.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},o.mont=function(t){return new M(t)},a(M,A),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},M.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=i.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):0>a.cmpn(0)&&(o=a.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new o(0)._forceRed(this);var i=t.mul(r),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=i.isub(n).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):0>a.cmpn(0)&&(s=a.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=i.nmd(t),this)},6204(t){t.exports=function(t){var r,i,n,a=t.length,o=0;for(r=0;r>>1;if(!(h<=0)){var d,f=a.mallocDouble(2*h*u),p=a.mallocInt32(u);if((u=l(t,h,f,p))>0){if(1===h&&n)o.init(u),d=o.sweepComplete(h,i,0,u,f,p,0,u,f,p);else{var m=a.mallocDouble(2*h*c),g=a.mallocInt32(c);(c=l(r,h,m,g))>0&&(o.init(u+c),d=1===h?o.sweepBipartite(h,i,0,u,f,p,0,c,m,g):s(h,i,n,u,f,p,c,m,g),a.free(m),a.free(g))}a.free(f),a.free(p)}return d}}}function c(t,r){n.push([t,r])}},2455(t,r){function i(t){return t?function(t,r,i,n,a,o,s,l,u,c,h){return a-n>u-l?function(t,r,i,n,a,o,s,l,u,c,h){for(var d=2*t,f=n,p=d*n;fc-u?n?function(t,r,i,n,a,o,s,l,u,c,h){for(var d=2*t,f=n,p=d*n;f0;){var L=6*(C-=1),P=v[L],z=v[L+1],F=v[L+2],O=v[L+3],R=v[L+4],B=v[L+5],j=2*C,N=x[j],V=x[j+1],U=1&B,q=!!(16&B),G=h,H=_,$=T,W=A;if(U&&(G=T,H=A,$=h,W=_),!(2&B&&(F=p(t,P,z,F,G,H,V),z>=F))&&!(4&B&&(z=m(t,P,z,F,G,H,N))>=F)){var Y=F-z,Z=R-O;if(q){if(t*Y*(Y+Z)<4194304){if(void 0!==(D=u.scanComplete(t,P,r,z,F,G,H,O,R,$,W)))return D;continue}}else if(t*Math.min(Y,Z)<128){if(void 0!==(D=s(t,P,r,U,z,F,G,H,O,R,$,W)))return D;continue}else if(t*Y*Z<4194304){if(void 0!==(D=u.scanBipartite(t,P,r,U,z,F,G,H,O,R,$,W)))return D;continue}var X=d(t,P,z,F,G,H,N,V);if(z=p0)&&!(p1>=hi)"),f=h("lo===p0"),p=h("lo>>1,h=2*t,d=c,f=o[h*c+r];li&&a[d+r]>c;--h,d-=s){for(var f=d,p=d+s,m=0;m=v?(d=y,f=v):g>=b?(d=m,f=g):(d=x,f=b):v>=b?(d=y,f=v):b>=g?(d=m,f=g):(d=x,f=b);for(var _=h*(u-1),w=h*d,T=0;Td;++d,u+=l)if(a[u+r]===s)if(h===d)h+=1,c+=l;else{for(var f=0;l>f;++f){var p=a[u+f];a[u+f]=a[c],a[c++]=p}var m=o[d];o[d]=o[h],o[h++]=m}return h},"lod;++d,u+=l)if(a[u+r]f;++f){var p=a[u+f];a[u+f]=a[c],a[c++]=p}var m=o[d];o[d]=o[h],o[h++]=m}return h},"lo<=p0":function(t,r,i,n,a,o,s){for(var l=2*t,u=l*i,c=u,h=i,d=t+r,f=i;n>f;++f,u+=l)if(a[u+d]<=s)if(h===f)h+=1,c+=l;else{for(var p=0;l>p;++p){var m=a[u+p];a[u+p]=a[c],a[c++]=m}var g=o[f];o[f]=o[h],o[h++]=g}return h},"hi<=p0":function(t,r,i,n,a,o,s){for(var l=2*t,u=l*i,c=u,h=i,d=t+r,f=i;n>f;++f,u+=l)if(a[u+d]<=s)if(h===f)h+=1,c+=l;else{for(var p=0;l>p;++p){var m=a[u+p];a[u+p]=a[c],a[c++]=m}var g=o[f];o[f]=o[h],o[h++]=g}return h},"lof;++f,u+=l){var p=a[u+r],m=a[u+d];if(pg;++g){var y=a[u+g];a[u+g]=a[c],a[c++]=y}var v=o[f];o[f]=o[h],o[h++]=v}}return h},"lo<=p0&&p0<=hi":function(t,r,i,n,a,o,s){for(var l=2*t,u=l*i,c=u,h=i,d=t+r,f=i;n>f;++f,u+=l){var p=a[u+r],m=a[u+d];if(p<=s&&s<=m)if(h===f)h+=1,c+=l;else{for(var g=0;l>g;++g){var y=a[u+g];a[u+g]=a[c],a[c++]=y}var v=o[f];o[f]=o[h],o[h++]=v}}return h},"!(lo>=p0)&&!(p1>=hi)":function(t,r,i,n,a,o,s,l){for(var u=2*t,c=u*i,h=c,d=i,f=t+r,p=i;n>p;++p,c+=u){var m=a[c+r],g=a[c+f];if(!(m>=s)&&!(l>=g))if(d===p)d+=1,h+=u;else{for(var y=0;u>y;++y){var v=a[c+y];a[c+y]=a[h],a[h++]=v}var x=o[p];o[p]=o[d],o[d++]=x}}return d}}},4192(t){function r(t,r,i){for(var n=2*(t+1),a=t+1;a<=r;++a){for(var o=i[n++],s=i[n++],l=a,u=n-2;l-- >t;){var c=i[u-2],h=i[u-1];if(ci[r+1])}function s(t,r,i,n){var a=n[t*=2];return a>1,m=p-h,g=p+h,y=d,v=m,x=p,b=g,_=f,w=l+1,T=u-1,A=0;o(y,v,c)&&(A=y,y=v,v=A),o(b,_,c)&&(A=b,b=_,_=A),o(y,x,c)&&(A=y,y=x,x=A),o(v,x,c)&&(A=v,v=x,x=A),o(y,b,c)&&(A=y,y=b,b=A),o(x,b,c)&&(A=x,x=b,b=A),o(v,_,c)&&(A=v,v=_,_=A),o(v,x,c)&&(A=v,v=x,x=A),o(b,_,c)&&(A=b,b=_,_=A);for(var M=c[2*v],k=c[2*v+1],S=c[2*b],E=c[2*b+1],D=2*y,C=2*x,I=2*_,L=2*d,P=2*p,z=2*f,F=0;F<2;++F){var O=c[D+F],R=c[C+F],B=c[I+F];c[L+F]=O,c[P+F]=R,c[z+F]=B}n(m,l,c),n(g,u,c);for(var j=w;j<=T;++j)if(s(j,M,k,c))j!==w&&i(j,w,c),++w;else if(!s(j,S,E,c))for(;;)if(s(T,S,E,c)){s(T,M,k,c)?(function(t,r,i,n){t*=2,r*=2,i*=2;var a=n[t],o=n[t+1];n[t]=n[r],n[t+1]=n[r+1],n[r]=n[i],n[r+1]=n[i+1],n[i]=a,n[i+1]=o}(j,w,T,c),++w):i(j,T,c),--T;break}else{if(--T>>1;o(f,S);for(var E=0,D=0,T=0;T=0x10000000)C=C-0x10000000|0,p(u,c,D--,C);else if(C>=0)p(s,l,E--,C);else if(C<=-0x10000000){C=-C-0x10000000|0;for(var I=0;I>>1;o(f,D);for(var C=0,I=0,L=0,M=0;M>1==f[2*M+3]>>1&&(z=2,M+=1),P<0){for(var F=-(P>>1)-1,O=0;O>1)-1;0===z?p(s,l,C--,F):1===z?p(u,c,I--,F):2===z&&p(h,d,L--,F)}}},scanBipartite:function(t,r,i,n,a,u,c,h,d,g,y,v){var x=0,b=2*t,_=r+t,w=1,T=1;n?T=0x10000000:w=0x10000000;for(var A=a;A>>1;o(f,E);for(var D=0,A=0;A=0x10000000?(I=!n,M-=0x10000000):(I=!!n,M-=1),I)m(s,l,D++,M);else{var L=v[M],P=b*M,z=y[P+r+1],F=y[P+r+1+t];e:for(var O=0;O>>1;o(f,w);for(var T=0,v=0;v=0x10000000)s[T++]=x-0x10000000;else{var M=p[x-=1],k=g*x,S=d[k+r+1],E=d[k+r+1+t];e:for(var D=0;D=0;--D)if(s[D]===x){for(var P=D+1;P0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,l.prototype),r}function l(t,r,i){if("number"==typeof t){if("string"==typeof r)throw TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,r,i)}function u(t,r,i){if("string"==typeof t){var n=t,a=r;if(("string"!=typeof a||""===a)&&(a="utf8"),!l.isEncoding(a))throw TypeError("Unknown encoding: "+a);var o=0|m(n,a),u=s(o),c=u.write(n,a);return c!==o&&(u=u.slice(0,c)),u}if(ArrayBuffer.isView(t)){var h=t;if(C(h,Uint8Array)){var g=new Uint8Array(h);return f(g.buffer,g.byteOffset,g.byteLength)}return d(h)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(C(t,ArrayBuffer)||t&&C(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(C(t,SharedArrayBuffer)||t&&C(t.buffer,SharedArrayBuffer)))return f(t,r,i);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var y=t.valueOf&&t.valueOf();if(null!=y&&y!==t)return l.from(y,r,i);var v=function(t){if(l.isBuffer(t)){var r=0|p(t.length),i=s(r);return 0===i.length||t.copy(i,0,0,r),i}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?s(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(v)return v;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),r,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),s(t<0?0:0|p(t))}function d(t){for(var r=t.length<0?0:0|p(t.length),i=s(r),n=0;n=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function m(t,r){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||C(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var a=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return E(t).length;default:if(a)return n?-1:S(t).length;r=(""+r).toLowerCase(),a=!0}}function g(t,r,i){var a,o,s,l=!1;if((void 0===r||r<0)&&(r=0),r>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0)||(i>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,r,i){var n=t.length;(!r||r<0)&&(r=0),(!i||i<0||i>n)&&(i=n);for(var a="",o=r;o0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),(o=i*=1)!=o&&(i=a?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(a)return -1;i=t.length-1}else if(i<0)if(!a)return -1;else i=0;if("string"==typeof r&&(r=l.from(r,n)),l.isBuffer(r))return 0===r.length?-1:x(t,r,i,n,a);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,r,i):Uint8Array.prototype.lastIndexOf.call(t,r,i):x(t,[r],i,n,a);throw TypeError("val must be string, number or Buffer")}function x(t,r,i,n,a){var o,s=1,l=t.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return -1;s=2,l/=2,u/=2,i/=2}function c(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(a){var h=-1;for(o=i;ol&&(i=l-u),o=i;o>=0;o--){for(var d=!0,f=0;f239?4:c>223?3:c>191?2:1;if(a+d<=i)switch(d){case 1:c<128&&(h=c);break;case 2:(192&(o=t[a+1]))==128&&(u=(31&c)<<6|63&o)>127&&(h=u);break;case 3:o=t[a+1],s=t[a+2],(192&o)==128&&(192&s)==128&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[a+1],s=t[a+2],l=t[a+3],(192&o)==128&&(192&s)==128&&(192&l)==128&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&l)>65535&&u<1114112&&(h=u)}null===h?(h=65533,d=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),a+=d}var f=n,p=f.length;if(p<=4096)return String.fromCharCode.apply(String,f);for(var m="",g=0;gi)throw RangeError("Trying to access beyond buffer length")}function w(t,r,i,n,a,o){if(!l.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(r>a||rt.length)throw RangeError("Index out of range")}function T(t,r,i,n,a,o){if(i+n>t.length||i<0)throw RangeError("Index out of range")}function A(t,r,i,n,o){return r*=1,i>>>=0,o||T(t,r,i,4,34028234663852886e22,-34028234663852886e22),a.write(t,r,i,n,23,4),i+4}function M(t,r,i,n,o){return r*=1,i>>>=0,o||T(t,r,i,8,17976931348623157e292,-17976931348623157e292),a.write(t,r,i,n,52,8),i+8}r.hp=l,r.IS=50,l.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),42===t.foo()}catch{return!1}}(),!l.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(t,r,i){return u(t,r,i)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(t,r,i){return c(t),t<=0?s(t):void 0!==r?"string"==typeof i?s(t).fill(r,i):s(t).fill(r):s(t)},l.allocUnsafe=function(t){return h(t)},l.allocUnsafeSlow=function(t){return h(t)},l.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==l.prototype},l.compare=function(t,r){if(C(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),C(r,Uint8Array)&&(r=l.from(r,r.offset,r.byteLength)),!l.isBuffer(t)||!l.isBuffer(r))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var i=t.length,n=r.length,a=0,o=Math.min(i,n);an.length?l.from(o).copy(n,a):Uint8Array.prototype.set.call(n,o,a);else if(l.isBuffer(o))o.copy(n,a);else throw TypeError('"list" argument must be an Array of Buffers');a+=o.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;ri&&(t+=" ... "),""},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(t,r,i,n,a){if(C(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),r<0||i>t.length||n<0||a>this.length)throw RangeError("out of range index");if(n>=a&&r>=i)return 0;if(n>=a)return -1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=i-r,u=Math.min(o,s),c=this.slice(n,a),h=t.slice(r,i),d=0;d>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a,o,s,l,u,c,h,d,f=this.length-r;if((void 0===i||i>f)&&(i=f),t.length>0&&(i<0||r<0)||r>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(t,r,i,n){i=Number(i)||0;var a=t.length-i;n?(n=Number(n))>a&&(n=a):n=a;var o=r.length;n>o/2&&(n=o/2);for(var s=0;s>8,a.push(i%256),a.push(n);return a}(t,this.length-h),this,h,d);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(t,r){var i=this.length;t=~~t,r=void 0===r?i:~~r,t<0?(t+=i)<0&&(t=0):t>i&&(t=i),r<0?(r+=i)<0&&(r=0):r>i&&(r=i),r>>=0,r>>>=0,i||_(t,r,this.length);for(var n=this[t],a=1,o=0;++o>>=0,r>>>=0,i||_(t,r,this.length);for(var n=this[t+--r],a=1;r>0&&(a*=256);)n+=this[t+--r]*a;return n},l.prototype.readUint8=l.prototype.readUInt8=function(t,r){return t>>>=0,r||_(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,r){return t>>>=0,r||_(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,r){return t>>>=0,r||_(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,r){return t>>>=0,r||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,r){return t>>>=0,r||_(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,r,i){t>>>=0,r>>>=0,i||_(t,r,this.length);for(var n=this[t],a=1,o=0;++o=(a*=128)&&(n-=Math.pow(2,8*r)),n},l.prototype.readIntBE=function(t,r,i){t>>>=0,r>>>=0,i||_(t,r,this.length);for(var n=r,a=1,o=this[t+--n];n>0&&(a*=256);)o+=this[t+--n]*a;return o>=(a*=128)&&(o-=Math.pow(2,8*r)),o},l.prototype.readInt8=function(t,r){return t>>>=0,r||_(t,1,this.length),128&this[t]?-((255-this[t]+1)*1):this[t]},l.prototype.readInt16LE=function(t,r){t>>>=0,r||_(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?0xffff0000|i:i},l.prototype.readInt16BE=function(t,r){t>>>=0,r||_(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?0xffff0000|i:i},l.prototype.readInt32LE=function(t,r){return t>>>=0,r||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,r){return t>>>=0,r||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,r){return t>>>=0,r||_(t,4,this.length),a.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,r){return t>>>=0,r||_(t,4,this.length),a.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,r){return t>>>=0,r||_(t,8,this.length),a.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,r){return t>>>=0,r||_(t,8,this.length),a.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,r,i,n){if(t*=1,r>>>=0,i>>>=0,!n){var a=Math.pow(2,8*i)-1;w(this,t,r,i,a,0)}var o=1,s=0;for(this[r]=255&t;++s>>=0,i>>>=0,!n){var a=Math.pow(2,8*i)-1;w(this,t,r,i,a,0)}var o=i-1,s=1;for(this[r+o]=255&t;--o>=0&&(s*=256);)this[r+o]=t/s&255;return r+i},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,1,255,0),this[r]=255&t,r+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,2,65535,0),this[r]=255&t,this[r+1]=t>>>8,r+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=255&t,r+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,4,0xffffffff,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t,r+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,4,0xffffffff,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},l.prototype.writeIntLE=function(t,r,i,n){if(t*=1,r>>>=0,!n){var a=Math.pow(2,8*i-1);w(this,t,r,i,a-1,-a)}var o=0,s=1,l=0;for(this[r]=255&t;++o>>=0,!n){var a=Math.pow(2,8*i-1);w(this,t,r,i,a-1,-a)}var o=i-1,s=1,l=0;for(this[r+o]=255&t;--o>=0&&(s*=256);)t<0&&0===l&&0!==this[r+o+1]&&(l=1),this[r+o]=(t/s|0)-l&255;return r+i},l.prototype.writeInt8=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=255&t,r+1},l.prototype.writeInt16LE=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,2,32767,-32768),this[r]=255&t,this[r+1]=t>>>8,r+2},l.prototype.writeInt16BE=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=255&t,r+2},l.prototype.writeInt32LE=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,4,0x7fffffff,-0x80000000),this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},l.prototype.writeInt32BE=function(t,r,i){return t*=1,r>>>=0,i||w(this,t,r,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},l.prototype.writeFloatLE=function(t,r,i){return A(this,t,r,!0,i)},l.prototype.writeFloatBE=function(t,r,i){return A(this,t,r,!1,i)},l.prototype.writeDoubleLE=function(t,r,i){return M(this,t,r,!0,i)},l.prototype.writeDoubleBE=function(t,r,i){return M(this,t,r,!1,i)},l.prototype.copy=function(t,r,i,n){if(!l.isBuffer(t))throw TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(a=r;a55295&&i<57344){if(!a){if(i>56319||s+1===n){(r-=3)>-1&&o.push(239,191,189);continue}a=i;continue}if(i<56320){(r-=3)>-1&&o.push(239,191,189),a=i;continue}i=(a-55296<<10|i-56320)+65536}else a&&(r-=3)>-1&&o.push(239,191,189);if(a=null,i<128){if((r-=1)<0)break;o.push(i)}else if(i<2048){if((r-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((r-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((r-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return o}function E(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function D(t,r,i,n){for(var a=0;a=r.length||a>=t.length);++a)r[a+i]=t[a];return a}function C(t,r){return t instanceof r||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===r.name}var I=function(){for(var t="0123456789abcdef",r=Array(256),i=0;i<16;++i)for(var n=16*i,a=0;a<16;++a)r[n+a]=t[i]+t[a];return r}()},2538(t,r,i){var n=i(8902),a=i(5542),o=i(2272),s=i(5023);function l(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function u(t,r){return t[0]-r[0]||t[1]-r[1]}function c(t,r,i){return r in t?t[r]:i}t.exports=function(t,r,i){Array.isArray(r)?(i=i||{},r=r||[]):(i=r||{},r=[]);var h=!!c(i,"delaunay",!0),d=!!c(i,"interior",!0),f=!!c(i,"exterior",!0),p=!!c(i,"infinity",!1);if(!d&&!f||0===t.length)return[];var m=n(t,r);if(!h&&d===f&&!p)return m;for(var g=a(t.length,r.map(l).sort(u)),y=0;yn(t[a],t[o],t[s],t[l])&&i.push(a,o)}}i(2478),t.exports=function(t,r){for(var i=[],o=t.length,s=r.stars,l=0;ln(t[l],t[h],t[d],t[f])&&i.push(l,h)}}for(;i.length>0;){for(var h=i.pop(),l=i.pop(),d=-1,f=-1,u=s[l],m=1;m=0||(r.flip(l,h),a(t,r,i,d,l,f),a(t,r,i,l,f,d),a(t,r,i,f,h,d),a(t,r,i,h,d,f))}}},5023(t,r,i){var n,a=i(2478);function o(t,r,i,n,a,o,s){this.cells=t,this.neighbor=r,this.flags=n,this.constraint=i,this.active=a,this.next=o,this.boundary=s}function s(t,r){return t[0]-r[0]||t[1]-r[1]||t[2]-r[2]}t.exports=function(t,r,i){var n=function(t,r){for(var i=t.cells(),n=i.length,a=0;a0||u.length>0;){for(;l.length>0;){var p=l.pop();if(c[p]!==-a){c[p]=a,h[p];for(var m=0;m<3;++m){var g=f[3*p+m];g>=0&&0===c[g]&&(d[3*p+m]?u.push(g):(l.push(g),c[g]=a))}}}var y=u;u=l,l=y,u.length=0,a=-a}var v=function(t,r,i){for(var n=0,a=0;ag[0]&&d.push(new s(g,m,2,f),new s(m,g,1,f))}d.sort(l);for(var y=d[0].a[0]-(1+Math.abs(d[0].a[0]))*2220446049250313e-31,v=[new o([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,b=d.length;f1&&a(i[f[p-2]],i[f[p-1]],o)>0;)t.push([f[p-1],f[p-2],s]),p-=1;f.length=p,f.push(s);for(var m=d.upperIds,p=m.length;p>1&&0>a(i[m[p-2]],i[m[p-1]],o);)t.push([m[p-2],m[p-1],s]),p-=1;m.length=p,m.push(s)}}(x,v,t,_.a,_.idx):2===w?function(t,r){var i=n.le(t,r,c),a=t[i],s=a.upperIds,l=s[s.length-1];a.upperIds=[l],t.splice(i+1,0,new o(r.a,r.b,r.idx,[l],s))}(v,_):function(t,r){var i=r.a;r.a=r.b,r.b=i;var a=n.eq(t,r,c),o=t[a];t[a-1].upperIds=o.upperIds,t.splice(a,1)}(v,_)}return x}},5542(t,r,i){var n=i(2478);function a(t,r){this.stars=t,this.edges=r}t.exports=function(t,r){for(var i=Array(t),n=0;n=0}}(),o.removeTriangle=function(t,r,i){var n=this.stars;s(n[t],r,i),s(n[r],i,t),s(n[i],t,r)},o.addTriangle=function(t,r,i){var n=this.stars;n[t].push(r,i),n[r].push(i,t),n[i].push(t,r)},o.opposite=function(t,r){for(var i=this.stars[r],n=1,a=i.length;n=0;--o){var b=n[o],_=r[h=b[0]],w=_[0],T=_[1],A=t[w],M=t[T];if(0>(A[0]-M[0]||A[1]-M[1])){var k=w;w=T,T=k}_[0]=w;var S,E=_[1]=b[1];for(a&&(S=_[2]);o>0&&n[o-1][0]===h;){var b=n[--o],D=b[1];a?r.push([E,D,S]):r.push([E,D]),E=D}a?r.push([E,T,S]):r.push([E,T])}return f}(t,x,A,k=w,b),v(x,E=m(t,S,M),b),E||A.length>0||k.length>0;)L=!0;if(i&&L){n.length=0,i.length=0;for(var C=0;Cr[2]))}function v(t,r,i){if(0!==t.length){if(r)for(var n=0;np+1)throw Error(d+" map requires nshades to be at least size "+h.length);g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],r=h.map(function(t){return Math.round(t.index*p)}),g[0]=Math.min(Math.max(g[0],0),1),g[1]=Math.min(Math.max(g[1],0),1);var r,i,u,c,h,d,f,p,m,g,y,v=h.map(function(t,r){var i=h[r].index,n=h[r].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=g[0]+(g[1]-g[0])*i),n}),m=[];for(y=0;y0||u(t,r,o)?-1:1:0===l?c>0||u(t,r,i)?1:-1:a(c-l)}var d=n(t,r,i);return d>0?s>0&&n(t,r,o)>0?1:-1:d<0?s>0||n(t,r,o)>0?1:-1:n(t,r,o)>0||u(t,r,i)?1:-1};var n=i(3250),a=i(8572),o=i(9362),s=i(5382),l=i(8210);function u(t,r,i){var n=o(t[0],-r[0]),a=o(t[1],-r[1]),u=o(i[0],-r[0]),c=o(i[1],-r[1]),h=l(s(n,u),s(a,c));return h[h.length-1]>=0}},8572(t){t.exports=function(t){return t<0?-1:+(t>0)}},8507(t){t.exports=function(t,n){var a=t.length,o=t.length-n.length;if(o)return o;switch(a){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||r(t[0],t[1])-r(n[0],n[1]);case 3:var s=t[0]+t[1],l=n[0]+n[1];if(o=s+t[2]-(l+n[2]))return o;var u=r(t[0],t[1]),c=r(n[0],n[1]);return r(u,t[2])-r(c,n[2])||r(u+t[2],s)-r(c+n[2],l);case 4:var h=t[0],d=t[1],f=t[2],p=t[3],m=n[0],g=n[1],y=n[2],v=n[3];return h+d+f+p-(m+g+y+v)||r(h,d,f,p)-r(m,g,y,v,m)||r(h+d,h+f,h+p,d+f,d+p,f+p)-r(m+g,m+y,m+v,g+y,g+v,y+v)||r(h+d+f,h+d+p,h+f+p,d+f+p)-r(m+g+y,m+g+v,m+y+v,g+y+v);default:for(var x=t.slice().sort(i),b=n.slice().sort(i),_=0;_t[i][0]&&(i=n);return ri?[[i],[r]]:[[r]]}},4750(t,r,i){t.exports=function(t){var r=n(t),i=r.length;if(i<=2)return[];for(var a=Array(i),o=r[i-1],s=0;s=r[u]&&(l+=1);o[s]=l}}return t}(n(function(t,r){for(var i=t.length,n=Array(i),a=0;ar.indexOf(a)&&(n[o++]=t[a]);return n}(t,i),!0),i)}};var n=i(8954),a=i(3952)},4769(t){t.exports=function(t,r,i,n,a,o){var s=a-1,l=a*a,u=s*s,c=(1+2*a)*u,h=a*u,d=l*(3-2*a),f=l*s;if(t.length){o||(o=Array(t.length));for(var p=t.length-1;p>=0;--p)o[p]=c*t[p]+h*r[p]+d*i[p]+f*n[p];return o}return c*t+h*r+d*i+f*n},t.exports.derivative=function(t,r,i,n,a,o){var s=6*a*a-6*a,l=3*a*a-4*a+1,u=-6*a*a+6*a,c=3*a*a-2*a;if(t.length){o||(o=Array(t.length));for(var h=t.length-1;h>=0;--h)o[h]=s*t[h]+l*r[h]+u*i[h]+c*n[h];return o}return s*t+l*r+u*i[h]+c*n}},7642(t,r,i){var n=i(8954),a=i(1682);function o(t,r){this.point=t,this.index=r}function s(t,r){for(var i=t.point,n=r.point,a=i.length,o=0;o=2)return!1;t[i]=n}return!0}):w.filter(function(t){for(var r=0;r<=l;++r){var i=v[t[r]];if(i<0)return!1;t[r]=i}return!0}),1&l)for(var h=0;htypeof Float64Array){var i=new Float64Array(1),n=new Uint32Array(i.buffer);(i[0]=1,r=!0,0x3ff00000===n[1])?(t.exports=function(t){return i[0]=t,[n[0],n[1]]},t.exports.pack=function(t,r){return n[0]=t,n[1]=r,i[0]},t.exports.lo=function(t){return i[0]=t,n[0]},t.exports.hi=function(t){return i[0]=t,n[1]}):0x3ff00000===n[0]?(t.exports=function(t){return i[0]=t,[n[1],n[0]]},t.exports.pack=function(t,r){return n[1]=t,n[0]=r,i[0]},t.exports.lo=function(t){return i[0]=t,n[1]},t.exports.hi=function(t){return i[0]=t,n[0]}):r=!1}if(!r){var a=new Buffer(8);t.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},t.exports.pack=function(t,r){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(r,4,!0),a.readDoubleLE(0,!0)},t.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},t.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}t.exports.sign=function(r){return t.exports.hi(r)>>>31},t.exports.exponent=function(r){return(t.exports.hi(r)<<1>>>21)-1023},t.exports.fraction=function(r){var i=t.exports.lo(r),n=t.exports.hi(r),a=1048575&n;return 0x7ff00000&n&&(a+=1048576),[i,a]},t.exports.denormalized=function(r){return!(0x7ff00000&t.exports.hi(r))}},1338(t){t.exports=function(t,r){switch(typeof r>"u"&&(r=0),typeof t){case"number":if(t>0){var i,n,a=0|t,o=r;for(i=Array(a),n=0;n=i-1)for(var f=u.length-1,m=t-r[i-1],p=0;p=i-1)for(var h=l.length-1,d=(r[i-1],0);d=0;--i)if(t[--r])return!1;return!0},l.jump=function(t){var r=this.lastT(),i=this.dimension;if(!(t0;--d)n.push(o(u[d-1],c[d-1],arguments[d])),a.push(0)}},l.push=function(t){var r=this.lastT(),i=this.dimension;if(!(t1e-6?1/l:0;this._time.push(t);for(var f=i;f>0;--f){var p=o(c[f-1],h[f-1],arguments[f]);n.push(p),a.push((p-n[s++])*d)}}},l.set=function(t){var r=this.dimension;if(!(t0;--u)i.push(o(s[u-1],l[u-1],arguments[u])),n.push(0)}},l.move=function(t){var r=this.lastT(),i=this.dimension;if(!(t<=r||arguments.length!==i+1)){var n=this._state,a=this._velocity,s=n.length-this.dimension,l=this.bounds,u=l[0],c=l[1],h=t-r,d=h>1e-6?1/h:0;this._time.push(t);for(var f=i;f>0;--f){var p=arguments[f];n.push(o(u[f-1],c[f-1],n[s++]+p)),a.push(p*d)}}},l.idle=function(t){var r=this.lastT();if(!(t=0;--d)n.push(o(u[d],c[d],n[s]+h*a[s])),a.push(0),s+=1}}},3840(t){function r(t,r,i,n,a,o){this._color=t,this.key=r,this.value=i,this.left=n,this.right=a,this._count=o}function i(t){return new r(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,i){return new r(t,i.key,i.value,i.left,i.right,i._count)}function a(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function o(t,r){this._compare=t,this.root=r}t.exports=function(t){return new o(t||h,null)};var s=o.prototype;function l(t,r){this.tree=t,this._stack=r}Object.defineProperty(s,"keys",{get:function(){var t=[];return this.forEach(function(r,i){t.push(r)}),t}}),Object.defineProperty(s,"values",{get:function(){var t=[];return this.forEach(function(r,i){t.push(i)}),t}}),Object.defineProperty(s,"length",{get:function(){return this.root?this.root._count:0}}),s.insert=function(t,i){for(var s=this._compare,l=this.root,u=[],c=[];l;){var h=s(t,l.key);u.push(l),c.push(h),l=h<=0?l.left:l.right}u.push(new r(0,t,i,null,null,1));for(var d=u.length-2;d>=0;--d){var l=u[d];c[d]<=0?u[d]=new r(l._color,l.key,l.value,u[d+1],l.right,l._count+1):u[d]=new r(l._color,l.key,l.value,l.left,u[d+1],l._count+1)}for(var d=u.length-1;d>1;--d){var f=u[d-1],l=u[d];if(1===f._color||1===l._color)break;var p=u[d-2];if(p.left===f)if(f.left===l){var m=p.right;if(m&&0===m._color)f._color=1,p.right=n(1,m),p._color=0,d-=1;else{if(p._color=0,p.left=f.right,f._color=1,f.right=p,u[d-2]=f,u[d-1]=l,a(p),a(f),d>=3){var g=u[d-3];g.left===p?g.left=f:g.right=f}break}}else{var m=p.right;if(m&&0===m._color)f._color=1,p.right=n(1,m),p._color=0,d-=1;else{if(f.right=l.left,p._color=0,p.left=l.right,l._color=1,l.left=f,l.right=p,u[d-2]=l,u[d-1]=f,a(p),a(f),a(l),d>=3){var g=u[d-3];g.left===p?g.left=l:g.right=l}break}}else if(f.right===l){var m=p.left;if(m&&0===m._color)f._color=1,p.left=n(1,m),p._color=0,d-=1;else{if(p._color=0,p.right=f.left,f._color=1,f.left=p,u[d-2]=f,u[d-1]=l,a(p),a(f),d>=3){var g=u[d-3];g.right===p?g.right=f:g.left=f}break}}else{var m=p.left;if(m&&0===m._color)f._color=1,p.left=n(1,m),p._color=0,d-=1;else{if(f.left=l.right,p._color=0,p.right=l.left,l._color=1,l.right=f,l.left=p,u[d-2]=l,u[d-1]=f,a(p),a(f),a(l),d>=3){var g=u[d-3];g.right===p?g.right=l:g.left=l}break}}}return u[0]._color=1,new o(s,u[0])},s.forEach=function(t,r,i){if(this.root)switch(arguments.length){case 1:return function t(r,i){if(i.left){var n=t(r,i.left);if(n)return n}var n=r(i.key,i.value);return n||(i.right?t(r,i.right):void 0)}(t,this.root);case 2:return function t(r,i,n,a){if(0>=i(r,a.key)){if(a.left){var o=t(r,i,n,a.left);if(o)return o}var o=n(a.key,a.value);if(o)return o}if(a.right)return t(r,i,n,a.right)}(r,this._compare,t,this.root);case 3:return this._compare(r,i)>=0?void 0:function t(r,i,n,a,o){var s,l=n(r,o.key),u=n(i,o.key);return l<=0&&(o.left&&(s=t(r,i,n,a,o.left))||u>0&&(s=a(o.key,o.value)))?s:u>0&&o.right?t(r,i,n,a,o.right):void 0}(r,i,this._compare,t,this.root)}},Object.defineProperty(s,"begin",{get:function(){for(var t=[],r=this.root;r;)t.push(r),r=r.left;return new l(this,t)}}),Object.defineProperty(s,"end",{get:function(){for(var t=[],r=this.root;r;)t.push(r),r=r.right;return new l(this,t)}}),s.at=function(t){if(t<0)return new l(this,[]);for(var r=this.root,i=[];;){if(i.push(r),r.left){if(t=r.right._count)break;r=r.right}else break}return new l(this,[])},s.ge=function(t){for(var r=this._compare,i=this.root,n=[],a=0;i;){var o=r(t,i.key);n.push(i),o<=0&&(a=n.length),i=o<=0?i.left:i.right}return n.length=a,new l(this,n)},s.gt=function(t){for(var r=this._compare,i=this.root,n=[],a=0;i;){var o=r(t,i.key);n.push(i),o<0&&(a=n.length),i=o<0?i.left:i.right}return n.length=a,new l(this,n)},s.lt=function(t){for(var r=this._compare,i=this.root,n=[],a=0;i;){var o=r(t,i.key);n.push(i),o>0&&(a=n.length),i=o<=0?i.left:i.right}return n.length=a,new l(this,n)},s.le=function(t){for(var r=this._compare,i=this.root,n=[],a=0;i;){var o=r(t,i.key);n.push(i),o>=0&&(a=n.length),i=o<0?i.left:i.right}return n.length=a,new l(this,n)},s.find=function(t){for(var r=this._compare,i=this.root,n=[];i;){var a=r(t,i.key);if(n.push(i),0===a)return new l(this,n);i=a<=0?i.left:i.right}return new l(this,[])},s.remove=function(t){var r=this.find(t);return r?r.remove():this},s.get=function(t){for(var r=this._compare,i=this.root;i;){var n=r(t,i.key);if(0===n)return i.value;i=n<=0?i.left:i.right}};var u=l.prototype;function c(t,r){t.key=r.key,t.value=r.value,t.left=r.left,t.right=r.right,t._color=r._color,t._count=r._count}function h(t,r){return tr)}Object.defineProperty(u,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(u,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),u.clone=function(){return new l(this.tree,this._stack.slice())},u.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var s=Array(t.length),l=t[t.length-1];s[s.length-1]=new r(l._color,l.key,l.value,l.left,l.right,l._count);for(var u=t.length-2;u>=0;--u){var l=t[u];l.left===t[u+1]?s[u]=new r(l._color,l.key,l.value,s[u+1],l.right,l._count):s[u]=new r(l._color,l.key,l.value,l.left,s[u+1],l._count)}if((l=s[s.length-1]).left&&l.right){var h=s.length;for(l=l.left;l.right;)s.push(l),l=l.right;var d=s[h-1];s.push(new r(l._color,d.key,d.value,l.left,l.right,l._count)),s[h-1].key=l.key,s[h-1].value=l.value;for(var u=s.length-2;u>=h;--u)l=s[u],s[u]=new r(l._color,l.key,l.value,l.left,s[u+1],l._count);s[h-1].left=s[h]}if(0===(l=s[s.length-1])._color){var f=s[s.length-2];f.left===l?f.left=null:f.right===l&&(f.right=null),s.pop();for(var u=0;u=0;--u){if(r=t[u],0===u){r._color=1;return}if((o=t[u-1]).left===r){if((s=o.right).right&&0===s.right._color){if(l=(s=o.right=i(s)).right=i(s.right),o.right=s.left,s.left=o,s.right=l,s._color=o._color,r._color=1,o._color=1,l._color=1,a(o),a(s),u>1){var c=t[u-2];c.left===o?c.left=s:c.right=s}t[u-1]=s;return}if(s.left&&0===s.left._color){if(l=(s=o.right=i(s)).left=i(s.left),o.right=l.left,s.left=l.right,l.left=o,l.right=s,l._color=o._color,o._color=1,s._color=1,r._color=1,a(o),a(s),a(l),u>1){var c=t[u-2];c.left===o?c.left=l:c.right=l}t[u-1]=l;return}if(1===s._color)if(0===o._color){o._color=1,o.right=n(0,s);return}else{o.right=n(0,s);continue}if(o.right=(s=i(s)).left,s.left=o,s._color=o._color,o._color=0,a(o),a(s),u>1){var c=t[u-2];c.left===o?c.left=s:c.right=s}t[u-1]=s,t[u]=o,u+11){var c=t[u-2];c.right===o?c.right=s:c.left=s}t[u-1]=s;return}if(s.right&&0===s.right._color){if(l=(s=o.left=i(s)).right=i(s.right),o.left=l.right,s.right=l.left,l.right=o,l.left=s,l._color=o._color,o._color=1,s._color=1,r._color=1,a(o),a(s),a(l),u>1){var c=t[u-2];c.right===o?c.right=l:c.left=l}t[u-1]=l;return}if(1===s._color)if(0===o._color){o._color=1,o.left=n(0,s);return}else{o.left=n(0,s);continue}if(o.left=(s=i(s)).right,s.right=o,s._color=o._color,o._color=0,a(o),a(s),u>1){var c=t[u-2];c.right===o?c.right=s:c.left=s}t[u-1]=s,t[u]=o,u+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(u,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(u,"index",{get:function(){var t=0,r=this._stack;if(0===r.length){var i=this.tree.root;return i?i._count:0}r[r.length-1].left&&(t=r[r.length-1].left._count);for(var n=r.length-2;n>=0;--n)r[n+1]===r[n].right&&(++t,r[n].left&&(t+=r[n].left._count));return t},enumerable:!0}),u.next=function(){var t=this._stack;if(0!==t.length){var r=t[t.length-1];if(r.right)for(r=r.right;r;)t.push(r),r=r.left;else for(t.pop();t.length>0&&t[t.length-1].right===r;)r=t[t.length-1],t.pop()}},Object.defineProperty(u,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var r=t.length-1;r>0;--r)if(t[r-1].left===t[r])return!0;return!1}}),u.update=function(t){var i=this._stack;if(0===i.length)throw Error("Can't update empty node!");var n=Array(i.length),a=i[i.length-1];n[n.length-1]=new r(a._color,a.key,t,a.left,a.right,a._count);for(var s=i.length-2;s>=0;--s)(a=i[s]).left===i[s+1]?n[s]=new r(a._color,a.key,a.value,n[s+1],a.right,a._count):n[s]=new r(a._color,a.key,a.value,a.left,n[s+1],a._count);return new o(this.tree._compare,n[0])},u.prev=function(){var t=this._stack;if(0!==t.length){var r=t[t.length-1];if(r.left)for(r=r.left;r;)t.push(r),r=r.right;else for(t.pop();t.length>0&&t[t.length-1].left===r;)r=t[t.length-1],t.pop()}},Object.defineProperty(u,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var r=t.length-1;r>0;--r)if(t[r-1].right===t[r])return!0;return!1}})},3837(t,r,i){t.exports=function(t,r){var i=new p(t);return i.update(r),i};var n=i(4935),a=i(501),o=i(5304),s=i(6429),l=i(6444),u=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,h=DataView;function d(t){return Array.isArray(t)||c.isView(t)&&!(t instanceof h)}function f(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function p(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=o(t)}var m=p.prototype;function g(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}m.update=function(t){function r(r,i,n){if(n in t){var a,o=t[n],s=this[n];(r?d(o)&&d(o[0]):d(o))?this[n]=a=[i(o[0]),i(o[1]),i(o[2])]:this[n]=a=[i(o),i(o),i(o)];for(var l=0;l<3;++l)if(a[l]!==s[l])return!0}return!1}t=t||{};var i,o=r.bind(this,!1,Number),s=r.bind(this,!1,Boolean),u=r.bind(this,!1,String),c=r.bind(this,!0,function(t){if(d(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),h=!1,f=!1;if("bounds"in t)for(var p=t.bounds,m=0;m<2;++m)for(var g=0;g<3;++g)p[m][g]!==this.bounds[m][g]&&(f=!0),this.bounds[m][g]=p[m][g];if("ticks"in t){i=t.ticks,h=!0,this.autoTicks=!1;for(var m=0;m<3;++m)this.tickSpacing[m]=0}else o("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),f=!0,h=!0,this._firstInit=!1),f&&this.autoTicks&&(i=l.create(this.bounds,this.tickSpacing),h=!0),h){for(var m=0;m<3;++m)i[m].sort(function(t,r){return t.x-r.x});l.equal(i,this.ticks)?h=!1:this.ticks=i}s("tickEnable"),u("tickFont")&&(h=!0),u("tickFontStyle")&&(h=!0),u("tickFontWeight")&&(h=!0),u("tickFontVariant")&&(h=!0),o("tickSize"),o("tickAngle"),o("tickPad"),c("tickColor");var y=u("labels");u("labelFont")&&(y=!0),u("labelFontStyle")&&(y=!0),u("labelFontWeight")&&(y=!0),u("labelFontVariant")&&(y=!0),s("labelEnable"),o("labelSize"),o("labelPad"),c("labelColor"),s("lineEnable"),s("lineMirror"),o("lineWidth"),c("lineColor"),s("lineTickEnable"),s("lineTickMirror"),o("lineTickLength"),o("lineTickWidth"),c("lineTickColor"),s("gridEnable"),o("gridWidth"),c("gridColor"),s("zeroEnable"),c("zeroLineColor"),o("zeroLineWidth"),s("backgroundEnable"),c("backgroundColor");var v=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],x=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(y||h)&&this._text.update(this.bounds,this.labels,v,this.ticks,x):this._text=n(this.gl,this.bounds,this.labels,v,this.ticks,x),this._lines&&h&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};var y=[new g,new g,new g],v=[0,0,0],x={model:u,view:u,projection:u,_ortho:!1};m.isOpaque=function(){return!0},m.isTransparent=function(){return!1},m.drawTransparent=function(t){};var b=[0,0,0],_=[0,0,0],w=[0,0,0];m.draw=function(t){t=t||x;for(var r,i,n,a=this.gl,o=t.model||u,l=t.view||u,c=t.projection||u,h=this.bounds,d=t._ortho||!1,p=s(o,l,c,h,d),m=p.cubeEdges,g=p.axis,T=l[12],A=l[13],M=l[14],k=l[15],S=d?2:1,E=S*this.pixelRatio*(c[3]*T+c[7]*A+c[11]*M+c[15]*k)/a.drawingBufferHeight,D=0;D<3;++D)this.lastCubeProps.cubeEdges[D]=m[D],this.lastCubeProps.axis[D]=g[D];for(var D=0;D<3;++D)!function(t,r,i,n,a){for(var o=t.primalOffset,s=t.primalMinor,l=t.mirrorOffset,u=t.mirrorMinor,c=n[r],h=0;h<3;++h)if(r!==h){var d=o,f=l,p=s,m=u;c&1<0?(p[h]=-1,m[h]=0):(p[h]=0,m[h]=1)}}(y[D],D,this.bounds,m,g);for(var a=this.gl,D=0;D<3;++D)this.backgroundEnable[D]?v[D]=g[D]:v[D]=0;this._background.draw(o,l,c,h,v,this.backgroundColor),this._lines.bind(o,l,c,this);for(var D=0;D<3;++D){var C=[0,0,0];g[D]>0?C[D]=h[1][D]:C[D]=h[0][D];for(var I=0;I<2;++I){var L=(D+1+I)%3,P=(D+1+(1^I))%3;this.gridEnable[L]&&this._lines.drawGrid(L,P,this.bounds,C,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(var I=0;I<2;++I){var L=(D+1+I)%3,P=(D+1+(1^I))%3;this.zeroEnable[P]&&0>=Math.min(h[0][P],h[1][P])&&Math.max(h[0][P],h[1][P])>=0&&this._lines.drawZero(L,P,this.bounds,C,this.zeroLineColor[P],this.zeroLineWidth[P]*this.pixelRatio)}}for(var D=0;D<3;++D){this.lineEnable[D]&&this._lines.drawAxisLine(D,this.bounds,y[D].primalOffset,this.lineColor[D],this.lineWidth[D]*this.pixelRatio),this.lineMirror[D]&&this._lines.drawAxisLine(D,this.bounds,y[D].mirrorOffset,this.lineColor[D],this.lineWidth[D]*this.pixelRatio);for(var z=f(b,y[D].primalMinor),F=f(_,y[D].mirrorMinor),O=this.lineTickLength,I=0;I<3;++I){var R=E/o[5*I];z[I]*=O[I]*R,F[I]*=O[I]*R}this.lineTickEnable[D]&&this._lines.drawAxisTicks(D,y[D].primalOffset,z,this.lineTickColor[D],this.lineTickWidth[D]*this.pixelRatio),this.lineTickMirror[D]&&this._lines.drawAxisTicks(D,y[D].mirrorOffset,F,this.lineTickColor[D],this.lineTickWidth[D]*this.pixelRatio)}function B(t){(n=[0,0,0])[t]=1}this._lines.unbind(),this._text.bind(o,l,c,this.pixelRatio);for(var D=0;D<3;++D){for(var j=y[D].primalMinor,N=y[D].mirrorMinor,V=f(w,y[D].primalOffset),I=0;I<3;++I)this.lineTickEnable[D]&&(V[I]+=E*j[I]*Math.max(this.lineTickLength[I],0)/o[5*I]);var U=[0,0,0];if(U[D]=1,this.tickEnable[D]){-3600===this.tickAngle[D]?(this.tickAngle[D]=0,this.tickAlign[D]="auto"):this.tickAlign[D]=-1,i=1,"auto"===(r=[this.tickAlign[D],.5,i])[0]?r[0]=0:r[0]=parseInt(""+r[0]),n=[0,0,0],function(t,r,i){var n=(t+1)%3,a=(t+2)%3,o=r[n],s=r[a],l=i[n],u=i[a];if(o>0&&u>0||o>0&&u<0)return B(n);o<0&&u>0||o<0&&u<0?B(n):s>0&&l>0||s>0&&l<0||s<0&&l>0?B(a):s<0&&l<0&&B(a)}(D,j,N);for(var I=0;I<3;++I)V[I]+=E*j[I]*this.tickPad[I]/o[5*I];this._text.drawTicks(D,this.tickSize[D],this.tickAngle[D],V,this.tickColor[D],U,n,r)}if(this.labelEnable[D]){i=0,n=[0,0,0],this.labels[D].length>4&&(B(D),i=1),"auto"===(r=[this.labelAlign[D],.5,i])[0]?r[0]=0:r[0]=parseInt(""+r[0]);for(var I=0;I<3;++I)V[I]+=E*j[I]*this.labelPad[I]/o[5*I];V[D]+=.5*(h[0][D]+h[1][D]),this._text.drawLabel(D,this.labelSize[D],this.labelAngle[D],V,this.labelColor[D],[0,0,0],n,r)}}this._text.unbind()},m.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304(t,r,i){t.exports=function(t){for(var r=[],i=[],l=0,u=0;u<3;++u)for(var c=(u+1)%3,h=(u+2)%3,d=[0,0,0],f=[0,0,0],p=-1;p<=1;p+=2){i.push(l,l+2,l+1,l+1,l+2,l+3),d[u]=p,f[u]=p;for(var m=-1;m<=1;m+=2){d[c]=m;for(var g=-1;g<=1;g+=2)d[h]=g,r.push(d[0],d[1],d[2],f[0],f[1],f[2]),l+=1}var y=c;c=h,h=y}var v=n(t,new Float32Array(r)),x=n(t,new Uint16Array(i),t.ELEMENT_ARRAY_BUFFER),b=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],x),_=o(t);return _.attributes.position.location=0,_.attributes.normal.location=1,new s(t,v,b,_)};var n=i(2762),a=i(8116),o=i(1879).bg;function s(t,r,i,n){this.gl=t,this.buffer=r,this.vao=i,this.shader=n}var l=s.prototype;l.draw=function(t,r,i,n,a,o){for(var s=!1,l=0;l<3;++l)s=s||a[l];if(s){var u=this.gl;u.enable(u.POLYGON_OFFSET_FILL),u.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:r,projection:i,bounds:n,enable:a,colors:o},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),u.disable(u.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429(t,r,i){t.exports=function(t,r,i,f,v){a(l,r,t),a(l,i,l);for(var x=0,b=0;b<2;++b){h[2]=f[b][2];for(var _=0;_<2;++_){h[1]=f[_][1];for(var w=0;w<2;++w)h[0]=f[w][0],function(t,r,i){for(var n=0;n<4;++n){t[n]=i[12+n];for(var a=0;a<3;++a)t[n]+=r[a]*i[4*a+n]}}(u[x],h,l),x+=1}}for(var T=-1,b=0;b<8;++b){for(var A=u[b][3],M=0;M<3;++M)c[b][M]=u[b][M]/A;v&&(c[b][2]*=-1),A<0&&(T<0||c[b][2]s(c[L],c[P],c[z],d)||(I?D=1:C=1)}if(D<0||C<0){C>D&&(T|=1<D){T|=1<c[b][1])&&(R=b);for(var B=-1,b=0;b<3;++b){var j=R^1<c[N][0]&&(N=j)}}m[0]=m[1]=m[2]=0,m[n.log2(B^R)]=R&B,m[n.log2(R^N)]=R&N;var V=7^N;V===T||V===O?(V=7^B,m[n.log2(N^V)]=V&N):m[n.log2(B^V)]=V&B;for(var U=T,k=0;k<3;++k)U&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ? - b - PI : - b; -} - -float look_horizontal_or_vertical(float a, float ratio) { - // ratio controls the ratio between being horizontal to (vertical + horizontal) - // if ratio is set to 0.5 then it is 50%, 50%. - // when using a higher ratio e.g. 0.75 the result would - // likely be more horizontal than vertical. - - float b = positive_angle(a); - - return - (b < ( ratio) * HALF_PI) ? 0.0 : - (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI : - (b < (2.0 + ratio) * HALF_PI) ? 0.0 : - (b < (4.0 - ratio) * HALF_PI) ? HALF_PI : - 0.0; -} - -float roundTo(float a, float b) { - return float(b * floor((a + 0.5 * b) / b)); -} - -float look_round_n_directions(float a, int n) { - float b = positive_angle(a); - float div = TWO_PI / float(n); - float c = roundTo(b, div); - return look_upwards(c); -} - -float applyAlignOption(float rawAngle, float delta) { - return - (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions - (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical - (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis - (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards - (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal - rawAngle; // otherwise return back raw input angle -} - -bool isAxisTitle = (axis.x == 0.0) && - (axis.y == 0.0) && - (axis.z == 0.0); - -void main() { - //Compute world offset - float axisDistance = position.z; - vec3 dataPosition = axisDistance * axis + offset; - - float beta = angle; // i.e. user defined attributes for each tick - - float axisAngle; - float clipAngle; - float flip; - - if (enableAlign) { - axisAngle = (isAxisTitle) ? HALF_PI : - computeViewAngle(dataPosition, dataPosition + axis); - clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir); - - axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0; - clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0; - - flip = (dot(vec2(cos(axisAngle), sin(axisAngle)), - vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0; - - beta += applyAlignOption(clipAngle, flip * PI); - } - - //Compute plane offset - vec2 planeCoord = position.xy * pixelScale; - - mat2 planeXform = scale * mat2( - cos(beta), sin(beta), - -sin(beta), cos(beta) - ); - - vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution; - - //Compute clip position - vec3 clipPosition = project(dataPosition); - - //Apply text offset in clip coordinates - clipPosition += vec3(viewOffset, 0.0); - - //Done - gl_Position = vec4(clipPosition, 1.0); -} -`]),u=n([`precision highp float; -#define GLSLIFY 1 - -uniform vec4 color; -void main() { - gl_FragColor = color; -}`]);r.Q=function(t){return a(t,l,u,null,[{name:"position",type:"vec3"}])};var c=n([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; -attribute vec3 normal; - -uniform mat4 model, view, projection; -uniform vec3 enable; -uniform vec3 bounds[2]; - -varying vec3 colorChannel; - -void main() { - - vec3 signAxis = sign(bounds[1] - bounds[0]); - - vec3 realNormal = signAxis * normal; - - if(dot(realNormal, enable) > 0.0) { - vec3 minRange = min(bounds[0], bounds[1]); - vec3 maxRange = max(bounds[0], bounds[1]); - vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); - gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); - } else { - gl_Position = vec4(0,0,0,0); - } - - colorChannel = abs(realNormal); -} -`]),h=n([`precision highp float; -#define GLSLIFY 1 - -uniform vec4 colors[3]; - -varying vec3 colorChannel; - -void main() { - gl_FragColor = colorChannel.x * colors[0] + - colorChannel.y * colors[1] + - colorChannel.z * colors[2]; -}`]);r.bg=function(t){return a(t,c,h,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935(t,r,i){t.exports=function(t,r,i,o,l,u){var h=n(t),d=a(t,[{buffer:h,size:3}]),f=s(t);f.attributes.position.location=0;var p=new c(t,f,h,d);return p.update(r,i,o,l,u),p};var n=i(2762),a=i(8116),o=i(4359),s=i(1879).Q,l=window||E.global||{},u=l.__TEXT_CACHE||{};function c(t,r,i,n){this.gl=t,this.shader=r,this.buffer=i,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}l.__TEXT_CACHE={};var h=c.prototype,d=[0,0];h.bind=function(t,r,i,n){this.vao.bind(),this.shader.bind();var a=this.shader.uniforms;a.model=t,a.view=r,a.projection=i,a.pixelScale=n,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},h.unbind=function(){this.vao.unbind()},h.update=function(t,r,i,n,a){var s=[];function l(t,r,i,n,a,l){var c=[i.style,i.weight,i.variant,i.family].join("_"),h=u[c];h||(h=u[c]={});var d=h[r];d||(d=h[r]=function(t,r){try{return o(t,r)}catch(r){return console.warn('error vectorizing text:"'+t+'" error:',r),{cells:[],positions:[]}}}(r,{triangles:!0,font:i.family,fontStyle:i.style,fontWeight:i.weight,fontVariant:i.variant,textAlign:"center",textBaseline:"middle",lineSpacing:a,styletags:l}));for(var f=(n||12)/12,p=d.positions,m=d.cells,g=0,y=m.length;g=0;--x){var b=p[v[x]];s.push(f*b[0],-f*b[1],t)}}for(var c=[0,0,0],h=[0,0,0],d=[0,0,0],f=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},m=0;m<3;++m){d[m]=s.length/3|0,l(.5*(t[0][m]+t[1][m]),r[m],i[m],12,1.25,p),f[m]=(s.length/3|0)-d[m],c[m]=s.length/3|0;for(var g=0;g=0&&(a=i.length-n-1);var o=Math.pow(10,a),s=Math.round(t*r*o),l=s+"";if(l.indexOf("e")>=0)return l;var u=s/o,c=s%o;s<0?(u=0|-Math.ceil(u),c=0|-c):(u=0|Math.floor(u),c|=0);var h=""+u;if(s<0&&(h="-"+h),!a)return h;for(var d=""+c;d.length=t[0][a];--s)o.push({x:s*r[a],text:i(r[a],s)});n.push(o)}return n},r.equal=function(t,r){for(var i=0;i<3;++i){if(t[i].length!==r[i].length)return!1;for(var n=0;ni)throw Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(r,o,a),i}function h(t,r){for(var i=n.malloc(t.length,r),a=t.length,o=0;otypeof t.shape){var i,l=t.dtype;if(0>s.indexOf(l)&&(l="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(l=gl.getExtension("OES_element_index_uint")&&"uint16"!==l?"uint32":"uint16"),l===t.dtype&&function(t,r){for(var i=1,n=r.length-1;n>=0;--n){if(r[n]!==i)return!1;i*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,r):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),r);else{var u=n.malloc(t.size,l),d=o(u,t.shape);a.assign(d,t),r<0?this.length=c(this.gl,this.type,this.length,this.usage,u,r):this.length=c(this.gl,this.type,this.length,this.usage,u.subarray(0,t.size),r),n.free(u)}}else if(Array.isArray(t))i=this.type===this.gl.ELEMENT_ARRAY_BUFFER?h(t,"uint16"):h(t,"float32"),r<0?this.length=c(this.gl,this.type,this.length,this.usage,i,r):this.length=c(this.gl,this.type,this.length,this.usage,i.subarray(0,t.length),r),n.free(i);else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,r);else if("number"==typeof t||void 0===t){if(r>=0)throw Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}else throw Error("gl-buffer: Invalid data type")},t.exports=function(t,r,i,n){if(i=i||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,i!==t.ARRAY_BUFFER&&i!==t.ELEMENT_ARRAY_BUFFER)throw Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=t.createBuffer(),o=new l(t,i,a,0,n);return o.update(r),o}},6405(t,r,i){var n=i(2931);t.exports=function(t,r){var i=t.positions,a=t.vectors,o={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return r&&(r[0]=[0,0,0],r[1]=[0,0,0]),o;for(var s=0,l=1/0,u=-1/0,c=1/0,h=-1/0,d=1/0,f=-1/0,p=null,m=null,g=[],y=1/0,v=!1,x="raw"===t.coneSizemode,b=0;bs&&(s=n.length(w)),b&&!x){var T=2*n.distance(p,_)/(n.length(m)+n.length(w));T?(y=Math.min(y,T),v=!1):v=!0}v||(p=_,m=w),g.push(w)}var A=[l,c,d],M=[u,h,f];r&&(r[0]=A,r[1]=M),0===s&&(s=1);var k=1/s;isFinite(y)||(y=1),o.vectorScale=y;var S=t.coneSize||(x?1:.5);t.absoluteConeSize&&(S=t.absoluteConeSize*k),o.coneScale=S;for(var b=0,E=0;b=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var r=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=r.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=r.LINEAR,this.texture.setPixels(function(t){for(var r=h({colormap:t,nshades:256,format:"rgba"}),i=new Uint8Array(1024),n=0;n<256;++n){for(var a=r[n],o=0;o<3;++o)i[4*n+o]=a[o];i[4*n+3]=255*a[3]}return c(i,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var i=t.cells,n=t.positions,a=t.vectors;if(!(!n||!i||!a)){var o=[],s=[],l=[],u=[],d=[];this.cells=i,this.positions=n,this.vectors=a;var f=t.meshColor||[1,1,1,1],p=t.vertexIntensity,m=1/0,g=-1/0;if(p)if(t.vertexIntensityBounds)m=+t.vertexIntensityBounds[0],g=+t.vertexIntensityBounds[1];else for(var y=0;y0){var g=this.triShader;g.bind(),g.uniforms=c,this.triangleVAO.bind(),r.drawArrays(r.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var r=this.gl,i=t.model||d,n=t.view||d,a=t.projection||d,o=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],s=0;s<3;++s)o[0][s]=Math.max(o[0][s],this.clipBounds[0][s]),o[1][s]=Math.min(o[1][s],this.clipBounds[1][s]);this._model=[].slice.call(i),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[r.drawingBufferWidth,r.drawingBufferHeight];var l={model:i,view:n,projection:a,clipBounds:o,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},u=this.pickShader;u.bind(),u.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),r.drawArrays(r.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t||t.id!==this.pickId)return null;var r=t.value[0]+256*t.value[1]+65536*t.value[2],i=this.cells[r],n=this.positions[i[1]].slice(0,3),a={position:n,dataCoordinate:n,index:Math.floor(i[1]/48)};return"cone"===this.traceType?a.index=Math.floor(i[1]/48):"streamtube"===this.traceType&&(a.intensity=this.intensity[i[1]],a.velocity=this.vectors[i[1]].slice(0,3),a.divergence=this.vectors[i[1]][3],a.index=r),a},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,r,i){var l,u,h=i.shaders;1==arguments.length&&(t=(r=t).gl);var d=((l=n(t,h.meshShader.vertex,h.meshShader.fragment,null,h.meshShader.attributes)).attributes.position.location=0,l.attributes.color.location=2,l.attributes.uv.location=3,l.attributes.vector.location=4,l),p=((u=n(t,h.pickShader.vertex,h.pickShader.fragment,null,h.pickShader.attributes)).attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u),m=s(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));m.generateMipmap(),m.minFilter=t.LINEAR_MIPMAP_LINEAR,m.magFilter=t.LINEAR;var g=a(t),y=a(t),v=a(t),x=a(t),b=a(t),_=o(t,[{buffer:g,type:t.FLOAT,size:4},{buffer:b,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:v,type:t.FLOAT,size:4},{buffer:x,type:t.FLOAT,size:2},{buffer:y,type:t.FLOAT,size:4}]),w=new f(t,m,d,p,g,y,b,v,x,_,i.traceType||"cone");return w.update(r),w}},614(t,r,i){var n=i(3236),a=n([`precision highp float; - -precision highp float; -#define GLSLIFY 1 - -vec3 getOrthogonalVector(vec3 v) { - // Return up-vector for only-z vector. - // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). - // From the above if-statement we have ||a|| > 0 U ||b|| > 0. - // Assign z = 0, x = -b, y = a: - // a*-b + b*a + c*0 = -ba + ba + 0 = 0 - if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { - return normalize(vec3(-v.y, v.x, 0.0)); - } else { - return normalize(vec3(0.0, v.z, -v.y)); - } -} - -// Calculate the cone vertex and normal at the given index. -// -// The returned vertex is for a cone with its top at origin and height of 1.0, -// pointing in the direction of the vector attribute. -// -// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. -// These vertices are used to make up the triangles of the cone by the following: -// segment + 0 top vertex -// segment + 1 perimeter vertex a+1 -// segment + 2 perimeter vertex a -// segment + 3 center base vertex -// segment + 4 perimeter vertex a -// segment + 5 perimeter vertex a+1 -// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. -// To go from index to segment, floor(index / 6) -// To go from segment to angle, 2*pi * (segment/segmentCount) -// To go from index to segment index, index - (segment*6) -// -vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { - - const float segmentCount = 8.0; - - float index = rawIndex - floor(rawIndex / - (segmentCount * 6.0)) * - (segmentCount * 6.0); - - float segment = floor(0.001 + index/6.0); - float segmentIndex = index - (segment*6.0); - - normal = -normalize(d); - - if (segmentIndex > 2.99 && segmentIndex < 3.01) { - return mix(vec3(0.0), -d, coneOffset); - } - - float nextAngle = ( - (segmentIndex > 0.99 && segmentIndex < 1.01) || - (segmentIndex > 4.99 && segmentIndex < 5.01) - ) ? 1.0 : 0.0; - float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); - - vec3 v1 = mix(d, vec3(0.0), coneOffset); - vec3 v2 = v1 - d; - - vec3 u = getOrthogonalVector(d); - vec3 v = normalize(cross(u, d)); - - vec3 x = u * cos(angle) * length(d)*0.25; - vec3 y = v * sin(angle) * length(d)*0.25; - vec3 v3 = v2 + x + y; - if (segmentIndex < 3.0) { - vec3 tx = u * sin(angle); - vec3 ty = v * -cos(angle); - vec3 tangent = tx + ty; - normal = normalize(cross(v3 - v1, tangent)); - } - - if (segmentIndex == 0.0) { - return mix(d, vec3(0.0), coneOffset); - } - return v3; -} - -attribute vec3 vector; -attribute vec4 color, position; -attribute vec2 uv; - -uniform float vectorScale, coneScale, coneOffset; -uniform mat4 model, view, projection, inverseModel; -uniform vec3 eyePosition, lightPosition; - -varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - // Scale the vector magnitude to stay constant with - // model & view changes. - vec3 normal; - vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); - vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); - - //Lighting geometry parameters - vec4 cameraCoordinate = view * conePosition; - cameraCoordinate.xyz /= cameraCoordinate.w; - f_lightDirection = lightPosition - cameraCoordinate.xyz; - f_eyeDirection = eyePosition - cameraCoordinate.xyz; - f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); - - // vec4 m_position = model * vec4(conePosition, 1.0); - vec4 t_position = view * conePosition; - gl_Position = projection * t_position; - - f_color = color; - f_data = conePosition.xyz; - f_position = position.xyz; - f_uv = uv; -} -`]),o=n([`#extension GL_OES_standard_derivatives : enable - -precision highp float; -#define GLSLIFY 1 - -float beckmannDistribution(float x, float roughness) { - float NdotH = max(x, 0.0001); - float cos2Alpha = NdotH * NdotH; - float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; - float roughness2 = roughness * roughness; - float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; - return exp(tan2Alpha / roughness2) / denom; -} - -float cookTorranceSpecular( - vec3 lightDirection, - vec3 viewDirection, - vec3 surfaceNormal, - float roughness, - float fresnel) { - - float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); - float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); - - //Half angle vector - vec3 H = normalize(lightDirection + viewDirection); - - //Geometric term - float NdotH = max(dot(surfaceNormal, H), 0.0); - float VdotH = max(dot(viewDirection, H), 0.000001); - float LdotH = max(dot(lightDirection, H), 0.000001); - float G1 = (2.0 * NdotH * VdotN) / VdotH; - float G2 = (2.0 * NdotH * LdotN) / LdotH; - float G = min(1.0, min(G1, G2)); - - //Distribution term - float D = beckmannDistribution(NdotH, roughness); - - //Fresnel term - float F = pow(1.0 - VdotN, fresnel); - - //Multiply terms and done - return G * F * D / max(3.14159265 * VdotN, 0.000001); -} - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; -uniform sampler2D texture; - -varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - vec3 N = normalize(f_normal); - vec3 L = normalize(f_lightDirection); - vec3 V = normalize(f_eyeDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - vec4 surfaceColor = f_color * texture2D(texture, f_uv); - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = litColor * opacity; -} -`]),s=n([`precision highp float; - -precision highp float; -#define GLSLIFY 1 - -vec3 getOrthogonalVector(vec3 v) { - // Return up-vector for only-z vector. - // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). - // From the above if-statement we have ||a|| > 0 U ||b|| > 0. - // Assign z = 0, x = -b, y = a: - // a*-b + b*a + c*0 = -ba + ba + 0 = 0 - if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { - return normalize(vec3(-v.y, v.x, 0.0)); - } else { - return normalize(vec3(0.0, v.z, -v.y)); - } -} - -// Calculate the cone vertex and normal at the given index. -// -// The returned vertex is for a cone with its top at origin and height of 1.0, -// pointing in the direction of the vector attribute. -// -// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. -// These vertices are used to make up the triangles of the cone by the following: -// segment + 0 top vertex -// segment + 1 perimeter vertex a+1 -// segment + 2 perimeter vertex a -// segment + 3 center base vertex -// segment + 4 perimeter vertex a -// segment + 5 perimeter vertex a+1 -// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. -// To go from index to segment, floor(index / 6) -// To go from segment to angle, 2*pi * (segment/segmentCount) -// To go from index to segment index, index - (segment*6) -// -vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { - - const float segmentCount = 8.0; - - float index = rawIndex - floor(rawIndex / - (segmentCount * 6.0)) * - (segmentCount * 6.0); - - float segment = floor(0.001 + index/6.0); - float segmentIndex = index - (segment*6.0); - - normal = -normalize(d); - - if (segmentIndex > 2.99 && segmentIndex < 3.01) { - return mix(vec3(0.0), -d, coneOffset); - } - - float nextAngle = ( - (segmentIndex > 0.99 && segmentIndex < 1.01) || - (segmentIndex > 4.99 && segmentIndex < 5.01) - ) ? 1.0 : 0.0; - float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); - - vec3 v1 = mix(d, vec3(0.0), coneOffset); - vec3 v2 = v1 - d; - - vec3 u = getOrthogonalVector(d); - vec3 v = normalize(cross(u, d)); - - vec3 x = u * cos(angle) * length(d)*0.25; - vec3 y = v * sin(angle) * length(d)*0.25; - vec3 v3 = v2 + x + y; - if (segmentIndex < 3.0) { - vec3 tx = u * sin(angle); - vec3 ty = v * -cos(angle); - vec3 tangent = tx + ty; - normal = normalize(cross(v3 - v1, tangent)); - } - - if (segmentIndex == 0.0) { - return mix(d, vec3(0.0), coneOffset); - } - return v3; -} - -attribute vec4 vector; -attribute vec4 position; -attribute vec4 id; - -uniform mat4 model, view, projection; -uniform float vectorScale, coneScale, coneOffset; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - vec3 normal; - vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); - vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); - gl_Position = projection * (view * conePosition); - f_id = id; - f_position = position.xyz; -} -`]),l=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - - gl_FragColor = vec4(pickId, f_id.xyz); -}`]);r.meshShader={vertex:a,fragment:o,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171(t,r,i){var n=i(737);t.exports=function(t){return n[t]}},9165(t,r,i){t.exports=function(t){var r=t.gl,i=n(r),s=a(r,[{buffer:i,type:r.FLOAT,size:3,offset:0,stride:40},{buffer:i,type:r.FLOAT,size:4,offset:12,stride:40},{buffer:i,type:r.FLOAT,size:3,offset:28,stride:40}]),u=o(r);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.offset.location=2;var c=new l(r,i,s,u);return c.update(t),c};var n=i(2762),a=i(8116),o=i(3436),s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function l(t,r,i,n){this.gl=t,this.shader=n,this.buffer=r,this.vao=i,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var u=l.prototype;function c(t,r){for(var i=0;i<3;++i)t[0][i]=Math.min(t[0][i],r[i]),t[1][i]=Math.max(t[1][i],r[i])}u.isOpaque=function(){return!this.hasAlpha},u.isTransparent=function(){return this.hasAlpha},u.drawTransparent=u.draw=function(t){var r=this.gl,i=this.shader.uniforms;this.shader.bind();var n=i.view=t.view||s,a=i.projection=t.projection||s;i.model=t.model||s,i.clipBounds=this.clipBounds,i.opacity=this.opacity;var o=n[12],l=n[13],u=n[14],c=n[15],h=(t._ortho?2:1)*this.pixelRatio*(a[3]*o+a[7]*l+a[11]*u+a[15]*c)/r.drawingBufferHeight;this.vao.bind();for(var d=0;d<3;++d)r.lineWidth(this.lineWidth[d]*this.pixelRatio),i.capSize=this.capSize[d]*h,this.lineCount[d]&&r.drawArrays(r.LINES,this.lineOffset[d],this.lineCount[d]);this.vao.unbind()};var h=function(){for(var t=[,,,],r=0;r<3;++r){for(var i=[],n=1;n<=2;++n)for(var a=-1;a<=1;a+=2){var o=[0,0,0];o[(n+r)%3]=a,i.push(o)}t[r]=i}return t}();function d(t,r,i,n){for(var a=h[n],o=0;o0){var g=h.slice();g[l]+=p[1][l],a.push(h[0],h[1],h[2],m[0],m[1],m[2],m[3],0,0,0,g[0],g[1],g[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,g),s+=2+d(a,g,m,l)}}}this.lineCount[l]=s-this.lineOffset[l]}this.buffer.update(a)}},u.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436(t,r,i){var n=i(3236),a=i(9405),o=n([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position, offset; -attribute vec4 color; -uniform mat4 model, view, projection; -uniform float capSize; -varying vec4 fragColor; -varying vec3 fragPosition; - -void main() { - vec4 worldPosition = model * vec4(position, 1.0); - worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); - gl_Position = projection * (view * worldPosition); - fragColor = color; - fragPosition = position; -}`]),s=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float opacity; -varying vec3 fragPosition; -varying vec4 fragColor; - -void main() { - if ( - outOfRange(clipBounds[0], clipBounds[1], fragPosition) || - fragColor.a * opacity == 0. - ) discard; - - gl_FragColor = opacity * fragColor; -}`]);t.exports=function(t){return a(t,o,s,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260(t,r,i){var n=i(7766);t.exports=function(t,r,i,n){a||(a=t.FRAMEBUFFER_UNSUPPORTED,o=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,s=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,l=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");if(!u&&c&&function(t,r){var i=t.getParameter(r.MAX_COLOR_ATTACHMENTS_WEBGL);u=Array(i+1);for(var n=0;n<=i;++n){for(var a=Array(i),o=0;oh||i<0||i>h)throw Error("gl-fbo: Parameters are too large for FBO");var d=1;if("color"in(n=n||{})){if((d=Math.max(0|n.color,0))<0)throw Error("gl-fbo: Must specify a nonnegative number of colors");if(d>1)if(c){if(d>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw Error("gl-fbo: Context does not support "+d+" draw buffers")}else throw Error("gl-fbo: Multiple draw buffer extension not supported")}var f=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&d>0){if(!p)throw Error("gl-fbo: Context does not support floating point textures");f=t.FLOAT}else n.preferFloat&&d>0&&p&&(f=t.FLOAT);var g=!0;"depth"in n&&(g=!!n.depth);var y=!1;return"stencil"in n&&(y=!!n.stencil),new m(t,r,i,f,d,g,y,c)};var a,o,s,l,u=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function h(t,r){t.bindFramebuffer(t.FRAMEBUFFER,r[0]),t.bindRenderbuffer(t.RENDERBUFFER,r[1]),t.bindTexture(t.TEXTURE_2D,r[2])}function d(t){switch(t){case a:throw Error("gl-fbo: Framebuffer unsupported");case o:throw Error("gl-fbo: Framebuffer incomplete attachment");case s:throw Error("gl-fbo: Framebuffer incomplete dimensions");case l:throw Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw Error("gl-fbo: Framebuffer failed for unspecified reason")}}function f(t,r,i,a,o,s){if(!a)return null;var l=n(t,r,i,o,a);return l.magFilter=t.NEAREST,l.minFilter=t.NEAREST,l.mipSamples=1,l.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,s,t.TEXTURE_2D,l.handle,0),l}function p(t,r,i,n,a){var o=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,o),t.renderbufferStorage(t.RENDERBUFFER,n,r,i),t.framebufferRenderbuffer(t.FRAMEBUFFER,a,t.RENDERBUFFER,o),o}function m(t,r,i,n,a,o,s,l){this.gl=t,this._shape=[0|r,0|i],this._destroyed=!1,this._ext=l,this.color=Array(a);for(var m=0;m1&&l.drawBuffersWEBGL(u[s]);var x=i.getExtension("WEBGL_depth_texture");x?m?t.depth=f(i,a,o,x.UNSIGNED_INT_24_8_WEBGL,i.DEPTH_STENCIL,i.DEPTH_STENCIL_ATTACHMENT):g&&(t.depth=f(i,a,o,i.UNSIGNED_SHORT,i.DEPTH_COMPONENT,i.DEPTH_ATTACHMENT)):g&&m?t._depth_rb=p(i,a,o,i.DEPTH_STENCIL,i.DEPTH_STENCIL_ATTACHMENT):g?t._depth_rb=p(i,a,o,i.DEPTH_COMPONENT16,i.DEPTH_ATTACHMENT):m&&(t._depth_rb=p(i,a,o,i.STENCIL_INDEX,i.STENCIL_ATTACHMENT));var b=i.checkFramebufferStatus(i.FRAMEBUFFER);if(b!==i.FRAMEBUFFER_COMPLETE){t._destroyed=!0,i.bindFramebuffer(i.FRAMEBUFFER,null),i.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(i.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var v=0;va||i<0||i>a)throw Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=r,t._shape[1]=i;for(var o=c(n),s=0;s max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform sampler2D dashTexture; -uniform float dashScale; -uniform float opacity; - -varying vec3 worldPosition; -varying float pixelArcLength; -varying vec4 fragColor; - -void main() { - if ( - outOfRange(clipBounds[0], clipBounds[1], worldPosition) || - fragColor.a * opacity == 0. - ) discard; - - float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; - if(dashWeight < 0.5) { - discard; - } - gl_FragColor = fragColor * opacity; -} -`]),l=n([`precision highp float; -#define GLSLIFY 1 - -#define FLOAT_MAX 1.70141184e38 -#define FLOAT_MIN 1.17549435e-38 - -// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl -vec4 packFloat(float v) { - float av = abs(v); - - //Handle special cases - if(av < FLOAT_MIN) { - return vec4(0.0, 0.0, 0.0, 0.0); - } else if(v > FLOAT_MAX) { - return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; - } else if(v < -FLOAT_MAX) { - return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; - } - - vec4 c = vec4(0,0,0,0); - - //Compute exponent and mantissa - float e = floor(log2(av)); - float m = av * pow(2.0, -e) - 1.0; - - //Unpack mantissa - c[1] = floor(128.0 * m); - m -= c[1] / 128.0; - c[2] = floor(32768.0 * m); - m -= c[2] / 32768.0; - c[3] = floor(8388608.0 * m); - - //Unpack exponent - float ebias = e + 127.0; - c[0] = floor(ebias / 2.0); - ebias -= c[0] * 2.0; - c[1] += floor(ebias) * 128.0; - - //Unpack sign bit - c[0] += 128.0 * step(0.0, -v); - - //Scale back to range - return c / 255.0; -} - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform float pickId; -uniform vec3 clipBounds[2]; - -varying vec3 worldPosition; -varying float pixelArcLength; -varying vec4 fragColor; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; - - gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); -}`]),u=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return a(t,o,s,null,u)},r.createPickShader=function(t){return a(t,o,l,null,u)}},5714(t,r,i){t.exports=function(t){var r=t.gl||t.scene&&t.scene.gl,i=d(r);i.attributes.position.location=0,i.attributes.nextPosition.location=1,i.attributes.arcLength.location=2,i.attributes.lineWidth.location=3,i.attributes.color.location=4;var s=f(r);s.attributes.position.location=0,s.attributes.nextPosition.location=1,s.attributes.arcLength.location=2,s.attributes.lineWidth.location=3,s.attributes.color.location=4;for(var l=n(r),u=a(r,[{buffer:l,size:3,offset:0,stride:48},{buffer:l,size:3,offset:12,stride:48},{buffer:l,size:1,offset:24,stride:48},{buffer:l,size:1,offset:28,stride:48},{buffer:l,size:4,offset:32,stride:48}]),h=c(Array(1024),[256,1,4]),p=0;p<1024;++p)h.data[p]=255;var m=o(r,h);m.wrap=r.REPEAT;var g=new y(r,i,s,l,u,m);return g.update(t),g};var n=i(2762),a=i(8116),o=i(7766),s=new Uint8Array(4),l=new Float32Array(s.buffer),u=i(2478),c=i(9618),h=i(7319),d=h.createShader,f=h.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function m(t){for(var r=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],i=0;i<3;++i)r[0][i]=Math.max(t[0][i],r[0][i]),r[1][i]=Math.min(t[1][i],r[1][i]);return r}function g(t,r,i,n){this.arcLength=t,this.position=r,this.index=i,this.dataCoordinate=n}function y(t,r,i,n,a,o){this.gl=t,this.shader=r,this.pickShader=i,this.buffer=n,this.vao=a,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=o,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){if(this.vertexCount){var r=this.gl,i=this.shader,n=this.vao;i.bind(),i.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[r.drawingBufferWidth,r.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(r.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(t){if(this.vertexCount){var r=this.gl,i=this.pickShader,n=this.vao;i.bind(),i.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[r.drawingBufferWidth,r.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(r.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(t){this.dirty=!0;var r=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],n=[],a=[],o=0,s=0,l=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var d=t.color||t.colors||[0,0,0,1],f=t.lineWidth||1,p=!1;e:for(m=1;m0){for(var w=0;w<24;++w)i.push(i[i.length-12]);s+=2,p=!0}continue e}l[0][g]=Math.min(l[0][g],b[g],_[g]),l[1][g]=Math.max(l[1][g],b[g],_[g])}Array.isArray(d[0])?(y=d.length>m-1?d[m-1]:d.length>0?d[d.length-1]:[0,0,0,1],v=d.length>m?d[m]:d.length>0?d[d.length-1]:[0,0,0,1]):y=v=d,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(f)?f.length>m-1?f[m-1]:f.length>0?f[f.length-1]:[0,0,0,1]:f;var T=o;if(o+=function(t,r){for(var i=0,n=0;n<3;++n){var a=t[n]-r[n];i+=a*a}return Math.sqrt(i)}(b,_),p){for(g=0;g<2;++g)i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,y[0],y[1],y[2],y[3]);s+=2,p=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],o,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],o,x,v[0],v[1],v[2],v[3]),s+=4}}if(this.buffer.update(i),n.push(o),a.push(h[h.length-1].slice()),this.bounds=l,this.vertexCount=s,this.points=a,this.arcLength=n,"dashes"in t){var A=t.dashes.slice();for(A.unshift(0),m=1;mMath.abs(g-w)&&1e-6>Math.abs(y-T)&&1e-6>Math.abs(v-A)?n(t):(m=1/Math.sqrt((d=g-w)*d+(f=y-T)*f+(p=v-A)*p),d*=m,f*=m,p*=m,(m=Math.sqrt((o=b*p-_*f)*o+(s=_*d-x*p)*s+(l=x*f-b*d)*l))?(o*=m=1/m,s*=m,l*=m):(o=0,s=0,l=0),(m=Math.sqrt((u=f*l-p*s)*u+(c=p*o-d*l)*c+(h=d*s-f*o)*h))?(u*=m=1/m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=d,t[3]=0,t[4]=s,t[5]=c,t[6]=f,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=-(o*g+s*y+l*v),t[13]=-(u*g+c*y+h*v),t[14]=-(d*g+f*y+p*v),t[15]=1,t)}},6760(t){t.exports=function(t,r,i){var n=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],d=r[8],f=r[9],p=r[10],m=r[11],g=r[12],y=r[13],v=r[14],x=r[15],b=i[0],_=i[1],w=i[2],T=i[3];return t[0]=b*n+_*l+w*d+T*g,t[1]=b*a+_*u+w*f+T*y,t[2]=b*o+_*c+w*p+T*v,t[3]=b*s+_*h+w*m+T*x,b=i[4],_=i[5],w=i[6],T=i[7],t[4]=b*n+_*l+w*d+T*g,t[5]=b*a+_*u+w*f+T*y,t[6]=b*o+_*c+w*p+T*v,t[7]=b*s+_*h+w*m+T*x,b=i[8],_=i[9],w=i[10],T=i[11],t[8]=b*n+_*l+w*d+T*g,t[9]=b*a+_*u+w*f+T*y,t[10]=b*o+_*c+w*p+T*v,t[11]=b*s+_*h+w*m+T*x,b=i[12],_=i[13],w=i[14],T=i[15],t[12]=b*n+_*l+w*d+T*g,t[13]=b*a+_*u+w*f+T*y,t[14]=b*o+_*c+w*p+T*v,t[15]=b*s+_*h+w*m+T*x,t}},4040(t){t.exports=function(t,r,i,n,a,o,s){var l=1/(r-i),u=1/(n-a),c=1/(o-s);return t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(r+i)*l,t[13]=(a+n)*u,t[14]=(s+o)*c,t[15]=1,t}},4772(t){t.exports=function(t,r,i,n,a){var o=1/Math.tan(r/2),s=1/(n-a);return t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+n)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*n*s,t[15]=0,t}},6079(t){t.exports=function(t,r,i,n){var a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D=n[0],C=n[1],I=n[2],L=Math.sqrt(D*D+C*C+I*I);return 1e-6>Math.abs(L)?null:(D*=L=1/L,C*=L,I*=L,a=Math.sin(i),s=1-(o=Math.cos(i)),l=r[0],u=r[1],c=r[2],h=r[3],d=r[4],f=r[5],p=r[6],m=r[7],g=r[8],y=r[9],v=r[10],x=r[11],b=D*D*s+o,_=C*D*s+I*a,w=I*D*s-C*a,T=D*C*s-I*a,A=C*C*s+o,M=I*C*s+D*a,k=D*I*s+C*a,S=C*I*s-D*a,E=I*I*s+o,t[0]=l*b+d*_+g*w,t[1]=u*b+f*_+y*w,t[2]=c*b+p*_+v*w,t[3]=h*b+m*_+x*w,t[4]=l*T+d*A+g*M,t[5]=u*T+f*A+y*M,t[6]=c*T+p*A+v*M,t[7]=h*T+m*A+x*M,t[8]=l*k+d*S+g*E,t[9]=u*k+f*S+y*E,t[10]=c*k+p*S+v*E,t[11]=h*k+m*S+x*E,r!==t&&(t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t)}},5567(t){t.exports=function(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[4],s=r[5],l=r[6],u=r[7],c=r[8],h=r[9],d=r[10],f=r[11];return r!==t&&(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[4]=o*a+c*n,t[5]=s*a+h*n,t[6]=l*a+d*n,t[7]=u*a+f*n,t[8]=c*a-o*n,t[9]=h*a-s*n,t[10]=d*a-l*n,t[11]=f*a-u*n,t}},2408(t){t.exports=function(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[0],s=r[1],l=r[2],u=r[3],c=r[8],h=r[9],d=r[10],f=r[11];return r!==t&&(t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[0]=o*a-c*n,t[1]=s*a-h*n,t[2]=l*a-d*n,t[3]=u*a-f*n,t[8]=o*n+c*a,t[9]=s*n+h*a,t[10]=l*n+d*a,t[11]=u*n+f*a,t}},7089(t){t.exports=function(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[0],s=r[1],l=r[2],u=r[3],c=r[4],h=r[5],d=r[6],f=r[7];return r!==t&&(t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[0]=o*a+c*n,t[1]=s*a+h*n,t[2]=l*a+d*n,t[3]=u*a+f*n,t[4]=c*a-o*n,t[5]=h*a-s*n,t[6]=d*a-l*n,t[7]=f*a-u*n,t}},2504(t){t.exports=function(t,r,i){var n=i[0],a=i[1],o=i[2];return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=r[3]*n,t[4]=r[4]*a,t[5]=r[5]*a,t[6]=r[6]*a,t[7]=r[7]*a,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=r[11]*o,t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}},7656(t){t.exports=function(t,r,i){var n,a,o,s,l,u,c,h,d,f,p,m,g=i[0],y=i[1],v=i[2];return r===t?(t[12]=r[0]*g+r[4]*y+r[8]*v+r[12],t[13]=r[1]*g+r[5]*y+r[9]*v+r[13],t[14]=r[2]*g+r[6]*y+r[10]*v+r[14],t[15]=r[3]*g+r[7]*y+r[11]*v+r[15]):(n=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],d=r[8],f=r[9],p=r[10],m=r[11],t[0]=n,t[1]=a,t[2]=o,t[3]=s,t[4]=l,t[5]=u,t[6]=c,t[7]=h,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=n*g+l*y+d*v+r[12],t[13]=a*g+u*y+f*v+r[13],t[14]=o*g+c*y+p*v+r[14],t[15]=s*g+h*y+m*v+r[15]),t}},5665(t){t.exports=function(t,r){if(t===r){var i=r[1],n=r[2],a=r[3],o=r[6],s=r[7],l=r[11];t[1]=r[4],t[2]=r[8],t[3]=r[12],t[4]=i,t[6]=r[9],t[7]=r[13],t[8]=n,t[9]=o,t[11]=r[14],t[12]=a,t[13]=s,t[14]=l}else t[0]=r[0],t[1]=r[4],t[2]=r[8],t[3]=r[12],t[4]=r[1],t[5]=r[5],t[6]=r[9],t[7]=r[13],t[8]=r[2],t[9]=r[6],t[10]=r[10],t[11]=r[14],t[12]=r[3],t[13]=r[7],t[14]=r[11],t[15]=r[15];return t}},7626(t,r,i){var n=i(2642),a=i(9346);function o(t,r){for(var i=[0,0,0,0],n=0;n<4;++n)for(var a=0;a<4;++a)i[a]+=t[4*n+a]*r[n];return i}t.exports=function(t,r,i,s,l,u){if(1===t.length)return[0,t[0].slice()];for(var c=Array(t.length),h=0;h1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[d,function(t,r){for(var i=[0,0,0],n=0;n max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float roughness - , fresnel - , kambient - , kdiffuse - , kspecular; -uniform sampler2D texture; - -varying vec3 f_normal - , f_lightDirection - , f_eyeDirection - , f_data; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - if (f_color.a == 0.0 || - outOfRange(clipBounds[0], clipBounds[1], f_data) - ) discard; - - vec3 N = normalize(f_normal); - vec3 L = normalize(f_lightDirection); - vec3 V = normalize(f_eyeDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); - //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d - - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = litColor * f_color.a; -} -`]),s=n([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; -attribute vec4 color; -attribute vec2 uv; - -uniform mat4 model, view, projection; - -varying vec4 f_color; -varying vec3 f_data; -varying vec2 f_uv; - -void main() { - gl_Position = projection * (view * (model * vec4(position, 1.0))); - f_color = color; - f_data = position; - f_uv = uv; -}`]),l=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform sampler2D texture; -uniform float opacity; - -varying vec4 f_color; -varying vec3 f_data; -varying vec2 f_uv; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; - - gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; -}`]),u=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute vec4 color; -attribute vec2 uv; -attribute float pointSize; - -uniform mat4 model, view, projection; -uniform vec3 clipBounds[2]; - -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); - } else { - gl_Position = projection * (view * (model * vec4(position, 1.0))); - } - gl_PointSize = pointSize; - f_color = color; - f_uv = uv; -}`]),c=n([`precision highp float; -#define GLSLIFY 1 - -uniform sampler2D texture; -uniform float opacity; - -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); - if(dot(pointR, pointR) > 0.25) { - discard; - } - gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; -}`]),h=n([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; -attribute vec4 id; - -uniform mat4 model, view, projection; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - gl_Position = projection * (view * (model * vec4(position, 1.0))); - f_id = id; - f_position = position; -}`]),d=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - - gl_FragColor = vec4(pickId, f_id.xyz); -}`]),f=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute float pointSize; -attribute vec4 id; - -uniform mat4 model, view, projection; -uniform vec3 clipBounds[2]; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0.0, 0.0, 0.0, 0.0); - } else { - gl_Position = projection * (view * (model * vec4(position, 1.0))); - gl_PointSize = pointSize; - } - f_id = id; - f_position = position; -}`]),p=n([`precision highp float; -#define GLSLIFY 1 - -attribute vec3 position; - -uniform mat4 model, view, projection; - -void main() { - gl_Position = projection * (view * (model * vec4(position, 1.0))); -}`]),m=n([`precision highp float; -#define GLSLIFY 1 - -uniform vec3 contourColor; - -void main() { - gl_FragColor = vec4(contourColor, 1.0); -} -`]);r.meshShader={vertex:a,fragment:o,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:u,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:h,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:f,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:m,attributes:[{name:"position",type:"vec3"}]}},7201(t,r,i){var n=i(9405),a=i(2762),o=i(8116),s=i(7766),l=i(8406),u=i(6760),c=i(7608),h=i(9618),d=i(6729),f=i(7765),p=i(1888),m=i(840),g=i(7626),y=m.meshShader,v=m.wireShader,x=m.pointShader,b=m.pickShader,_=m.pointPickShader,w=m.contourShader,T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function A(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,A,M,k,S,E){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=r,this.dirty=!0,this.triShader=i,this.lineShader=n,this.pointShader=a,this.pickShader=o,this.pointPickShader=s,this.contourShader=l,this.trianglePositions=u,this.triangleColors=h,this.triangleNormals=f,this.triangleUVs=d,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=m,this.edgeColors=y,this.edgeUVs=v,this.edgeIds=g,this.edgeVAO=x,this.edgeCount=0,this.pointPositions=b,this.pointColors=w,this.pointUVs=A,this.pointSizes=M,this.pointIds=_,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=S,this.contourVAO=E,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=T,this._view=T,this._projection=T,this._resolution=[1,1]}var M=A.prototype;function k(t,r){if(!r||!r.length)return 1;for(var i=0;it&&i>0){var n=(r[i][0]-t)/(r[i][0]-r[i-1][0]);return r[i][1]*(1-n)+n*r[i-1][1]}}return 1}M.isOpaque=function(){return!this.hasAlpha},M.isTransparent=function(){return this.hasAlpha},M.pickSlots=1,M.setPickBase=function(t){this.pickId=t},M.highlight=function(t){if(!t||!this.contourEnable){this.contourCount=0;return}for(var r=f(this.cells,this.intensity,t.intensity),i=r.cells,n=r.vertexIds,a=r.vertexWeights,o=i.length,s=p.mallocFloat32(6*o),l=0,u=0;u0){var m=this.triShader;m.bind(),m.uniforms=l,this.triangleVAO.bind(),r.drawArrays(r.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var m=this.lineShader;m.bind(),m.uniforms=l,this.edgeVAO.bind(),r.lineWidth(this.lineWidth*this.pixelRatio),r.drawArrays(r.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var m=this.pointShader;m.bind(),m.uniforms=l,this.pointVAO.bind(),r.drawArrays(r.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var m=this.contourShader;m.bind(),m.uniforms=l,this.contourVAO.bind(),r.drawArrays(r.LINES,0,this.contourCount),this.contourVAO.unbind()}},M.drawPick=function(t){t=t||{};for(var r=this.gl,i=t.model||T,n=t.view||T,a=t.projection||T,o=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],s=0;s<3;++s)o[0][s]=Math.max(o[0][s],this.clipBounds[0][s]),o[1][s]=Math.min(o[1][s],this.clipBounds[1][s]);this._model=[].slice.call(i),this._view=[].slice.call(n),this._projection=[].slice.call(a),this._resolution=[r.drawingBufferWidth,r.drawingBufferHeight];var l={model:i,view:n,projection:a,clipBounds:o,pickId:this.pickId/255},u=this.pickShader;if(u.bind(),u.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),r.drawArrays(r.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),r.lineWidth(this.lineWidth*this.pixelRatio),r.drawArrays(r.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var u=this.pointPickShader;u.bind(),u.uniforms=l,this.pointVAO.bind(),r.drawArrays(r.POINTS,0,this.pointCount),this.pointVAO.unbind()}},M.pick=function(t){if(!t||t.id!==this.pickId)return null;for(var r=t.value[0]+256*t.value[1]+65536*t.value[2],i=this.cells[r],n=this.positions,a=Array(i.length),o=0;oMath.abs(r))c.rotate(o,0,0,-t*i*Math.PI*m.rotateSpeed/window.innerWidth);else if(!m._ortho){var s=-m.zoomSpeed*a*r/window.innerHeight*(o-c.lastT())/20;c.pan(o,0,0,d*(Math.exp(s)-1))}}},!0)},m.enableMouseListeners(),m};var n=i(3025),a=i(6296),o=i(351),s=i(8512),l=i(24),u=i(7520)},799(t,r,i){var n=i(3236),a=i(9405),o=n([`precision mediump float; -#define GLSLIFY 1 -attribute vec2 position; -varying vec2 uv; -void main() { - uv = position; - gl_Position = vec4(position, 0, 1); -}`]),s=n([`precision mediump float; -#define GLSLIFY 1 - -uniform sampler2D accumBuffer; -varying vec2 uv; - -void main() { - vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); - gl_FragColor = min(vec4(1,1,1,1), accum); -}`]);t.exports=function(t){return a(t,o,s,null,[{name:"position",type:"vec2"}])}},4100(t,r,i){var n=i(4437),a=i(3837),o=i(5445),s=i(4449),l=i(3589),u=i(2260),c=i(7169),h=i(351),d=i(4772),f=i(4040),p=i(799),m=i(2431)({tablet:!0,featureDetect:!0});function g(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function y(t){return"boolean"!=typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var r=t.canvas;r||((r=document.createElement("canvas"),t.container)?t.container.appendChild(r):document.body.appendChild(r));var i=t.gl;if(i||(t.glOptions&&(m=!!t.glOptions.preserveDrawingBuffer),i=function(t,r){var i=null;try{(i=t.getContext("webgl",r))||(i=t.getContext("experimental-webgl",r))}catch{return null}return i}(r,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:m})),!i)throw Error("webgl not supported");var v=t.bounds||[[-10,-10,-10],[10,10,10]],x=new g,b=u(i,i.drawingBufferWidth,i.drawingBufferHeight,{preferFloat:!m}),_=p(i),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},A=t.axes||{},M=a(i,A);M.enable=!A.disable;var k=t.spikes||{},S=s(i,k),E=[],D=[],C=[],I=[],L=!0,P=!0,z={view:null,projection:Array(16),model:Array(16),_ortho:!1},P=!0,F=[i.drawingBufferWidth,i.drawingBufferHeight],O=t.cameraObject||n(r,T),R={gl:i,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:r,selection:x,camera:O,axes:M,axesPixels:null,spikes:S,bounds:v,objects:E,shape:F,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:y(t.autoResize),autoBounds:y(t.autoBounds),autoScale:!!t.autoScale,autoCenter:y(t.autoCenter),clipToBounds:y(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:z,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,P=!0},setBounds:function(t,r){this.bounds[0][t]=r.min,this.bounds[1][t]=r.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},B=[i.drawingBufferWidth/R.pixelRatio|0,i.drawingBufferHeight/R.pixelRatio|0];function j(){if(!R._stopped&&R.autoResize){var t=r.parentNode,i=1,n=1;t&&t!==document.body?(i=t.clientWidth,n=t.clientHeight):(i=window.innerWidth,n=window.innerHeight);var a=0|Math.ceil(i*R.pixelRatio),o=0|Math.ceil(n*R.pixelRatio);if(a!==r.width||o!==r.height){r.width=a,r.height=o;var s=r.style;s.position=s.position||"absolute",s.left="0px",s.top="0px",s.width=i+"px",s.height=n+"px",L=!0}}}function N(){for(var t=E.length,r=I.length,n=0;n0&&0===C[r-1];)C.pop(),I.pop().dispose()}function V(){if(R.contextLost)return!0;i.isContextLost()&&(R.contextLost=!0,R.mouseListener.enabled=!1,R.selection.object=null,R.oncontextloss&&R.oncontextloss())}R.autoResize&&j(),window.addEventListener("resize",j),R.update=function(t){R._stopped||(t=t||{},L=!0,P=!0)},R.add=function(t){R._stopped||(t.axes=M,E.push(t),D.push(-1),L=!0,P=!0,N())},R.remove=function(t){if(!R._stopped){var r=E.indexOf(t);r<0||(E.splice(r,1),D.pop(),L=!0,P=!0,N())}},R.dispose=function(){if(!R._stopped&&(R._stopped=!0,window.removeEventListener("resize",j),r.removeEventListener("webglcontextlost",V),R.mouseListener.enabled=!1,!R.contextLost)){M.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c0){var i=Math.round(Math.pow(10,r));return Math.ceil(t/i)*i}return Math.ceil(t)}((g[1][s]-g[0][s])/10);M.autoTicks?M.update({bounds:g,tickSpacing:T}):M.update({bounds:g})}var A=i.drawingBufferWidth,k=i.drawingBufferHeight;F[0]=A,F[1]=k,B[0]=0|Math.max(A/R.pixelRatio,1),B[1]=0|Math.max(k/R.pixelRatio,1),function(t,r){var i=t.bounds,n=t.cameraParams,a=n.projection,o=n.model,s=t.gl.drawingBufferWidth,l=t.gl.drawingBufferHeight,u=t.zNear,c=t.zFar,h=t.fovy,p=s/l;r?(f(a,-p,p,-1,1,u,c),n._ortho=!0):(d(a,h,p,u,c),n._ortho=!1);for(var m=0;m<16;++m)o[m]=0;o[15]=1;for(var g=0,m=0;m<3;++m)g=Math.max(g,i[1][m]-i[0][m]);for(var m=0;m<3;++m)t.autoScale?o[5*m]=t.aspect[m]/(i[1][m]-i[0][m]):o[5*m]=1/g,t.autoCenter&&(o[12+m]=-(.5*o[5*m])*(i[0][m]+i[1][m]))}(R,w);for(var s=0;s1e-6?(s=Math.sin(a=Math.acos(o)),l=Math.sin((1-n)*a)/s,u=Math.sin(n*a)/s):(l=1-n,u=n),t[0]=l*c+u*p,t[1]=l*h+u*m,t[2]=l*d+u*g,t[3]=l*f+u*y,t}},5964(t){t.exports=function(t){return t||0===t?t.toString():""}},9366(t,r,i){var n=i(4359);t.exports=function(t,r,i){var o=[r.style,r.weight,r.variant,r.family].join("_"),s=a[o];if(s||(s=a[o]={}),t in s)return s[t];var l={textAlign:"center",textBaseline:"middle",lineHeight:1,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};l.triangles=!0;var u=n(t,l);l.triangles=!1;var c,h,d=n(t,l);if(i&&1!==i){for(c=0;c max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute vec4 color; -attribute vec2 glyph; -attribute vec4 id; - -uniform vec4 highlightId; -uniform float highlightScale; -uniform mat4 model, view, projection; -uniform vec3 clipBounds[2]; - -varying vec4 interpColor; -varying vec4 pickId; -varying vec3 dataCoordinate; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0,0,0,0); - } else { - float scale = 1.0; - if(distance(highlightId, id) < 0.0001) { - scale = highlightScale; - } - - vec4 worldPosition = model * vec4(position, 1); - vec4 viewPosition = view * worldPosition; - viewPosition = viewPosition / viewPosition.w; - vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0)); - - gl_Position = clipPosition; - interpColor = color; - pickId = id; - dataCoordinate = position; - } -}`]),s=a([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute vec4 color; -attribute vec2 glyph; -attribute vec4 id; - -uniform mat4 model, view, projection; -uniform vec2 screenSize; -uniform vec3 clipBounds[2]; -uniform float highlightScale, pixelRatio; -uniform vec4 highlightId; - -varying vec4 interpColor; -varying vec4 pickId; -varying vec3 dataCoordinate; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0,0,0,0); - } else { - float scale = pixelRatio; - if(distance(highlightId.bgr, id.bgr) < 0.001) { - scale *= highlightScale; - } - - vec4 worldPosition = model * vec4(position, 1.0); - vec4 viewPosition = view * worldPosition; - vec4 clipPosition = projection * viewPosition; - clipPosition /= clipPosition.w; - - gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0); - interpColor = color; - pickId = id; - dataCoordinate = position; - } -}`]),l=a([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -attribute vec3 position; -attribute vec4 color; -attribute vec2 glyph; -attribute vec4 id; - -uniform float highlightScale; -uniform vec4 highlightId; -uniform vec3 axes[2]; -uniform mat4 model, view, projection; -uniform vec2 screenSize; -uniform vec3 clipBounds[2]; -uniform float scale, pixelRatio; - -varying vec4 interpColor; -varying vec4 pickId; -varying vec3 dataCoordinate; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], position)) { - - gl_Position = vec4(0,0,0,0); - } else { - float lscale = pixelRatio * scale; - if(distance(highlightId, id) < 0.0001) { - lscale *= highlightScale; - } - - vec4 clipCenter = projection * (view * (model * vec4(position, 1))); - vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y; - vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1))); - - gl_Position = clipPosition; - interpColor = color; - pickId = id; - dataCoordinate = dataPosition; - } -} -`]),u=a([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 fragClipBounds[2]; -uniform float opacity; - -varying vec4 interpColor; -varying vec3 dataCoordinate; - -void main() { - if ( - outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) || - interpColor.a * opacity == 0. - ) discard; - gl_FragColor = interpColor * opacity; -} -`]),c=a([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 fragClipBounds[2]; -uniform float pickGroup; - -varying vec4 pickId; -varying vec3 dataCoordinate; - -void main() { - if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard; - - gl_FragColor = vec4(pickGroup, pickId.bgr); -}`]),h=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],d={vertex:o,fragment:u,attributes:h},f={vertex:s,fragment:u,attributes:h},p={vertex:l,fragment:u,attributes:h},m={vertex:o,fragment:c,attributes:h},g={vertex:s,fragment:c,attributes:h},y={vertex:l,fragment:c,attributes:h};function v(t,r){var i=n(t,r),a=i.attributes;return a.position.location=0,a.color.location=1,a.glyph.location=2,a.id.location=3,i}r.createPerspective=function(t){return v(t,d)},r.createOrtho=function(t){return v(t,f)},r.createProject=function(t){return v(t,p)},r.createPickPerspective=function(t){return v(t,m)},r.createPickOrtho=function(t){return v(t,g)},r.createPickProject=function(t){return v(t,y)}},8418(t,r,i){var n=i(5219),a=i(2762),o=i(8116),s=i(1888),l=i(6760),u=i(1283),c=i(9366),h=i(5964),d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],f=ArrayBuffer,p=DataView;function m(t){return Array.isArray(t)||f.isView(t)&&!(t instanceof p)}function g(t,r){var i=t[0],n=t[1],a=t[2],o=t[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,t}function y(t,r,i,n){return g(n,n),g(n,n),g(n,n)}function v(t,r){this.index=t,this.dataCoordinate=this.position=r}function x(t){return!0===t||t>1?1:t}function b(t,r,i,n,a,o,s,l,u,c,h,d){this.gl=t,this.pixelRatio=1,this.shader=r,this.orthoShader=i,this.projectShader=n,this.pointBuffer=a,this.colorBuffer=o,this.glyphBuffer=s,this.idBuffer=l,this.vao=u,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=h,this.pickProjectShader=d,this.points=[],this._selectResult=new v(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(t){var r=t.gl,i=u.createPerspective(r),n=u.createOrtho(r),s=u.createProject(r),l=u.createPickPerspective(r),c=u.createPickOrtho(r),h=u.createPickProject(r),d=a(r),f=a(r),p=a(r),m=a(r),g=o(r,[{buffer:d,size:3,type:r.FLOAT},{buffer:f,size:4,type:r.FLOAT},{buffer:p,size:2,type:r.FLOAT},{buffer:m,size:4,type:r.UNSIGNED_BYTE,normalized:!0}]),y=new b(r,i,n,s,d,f,p,m,g,l,c,h);return y.update(t),y};var _=b.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},_.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var w=[0,0],T=[0,0,0],A=[0,0,0],M=[0,0,0,1],k=[0,0,0,1],S=d.slice(),E=[0,0,0],D=[[0,0,0],[0,0,0]];function C(t){return t[0]=t[1]=t[2]=0,t}function I(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=1,t}function L(t,r,i,n){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[i]=n,t}var P=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function z(t,r,i,n,a,o,s){var u=i.gl;if((o===i.projectHasAlpha||s)&&function(t,r,i,n){var a,o=r.axesProject,s=r.gl,u=t.uniforms,c=i.model||d,h=i.view||d,f=i.projection||d,p=r.axesBounds,m=function(t){for(var r=0;r<2;++r)for(var i=0;i<3;++i)D[r][i]=Math.max(Math.min(t[r][i],1e8),-1e8);return D}(r.clipBounds);a=r.axes&&r.axes.lastCubeProps?r.axes.lastCubeProps.axis:[1,1,1],w[0]=2/s.drawingBufferWidth,w[1]=2/s.drawingBufferHeight,t.bind(),u.view=h,u.projection=f,u.screenSize=w,u.highlightId=r.highlightId,u.highlightScale=r.highlightScale,u.clipBounds=m,u.pickGroup=r.pickId/255,u.pixelRatio=n;for(var g=0;g<3;++g)if(o[g]){u.scale=r.projectScale[g],u.opacity=r.projectOpacity[g];for(var v=0;v<16;++v)S[v]=0;for(var v=0;v<4;++v)S[5*v]=1;S[5*g]=0,a[g]<0?S[12+g]=p[0][g]:S[12+g]=p[1][g],l(S,c,S),u.model=S;var x=(g+1)%3,b=(g+2)%3,_=C(T),P=C(A);_[x]=1,P[b]=1;var z=y(f,h,c,I(M,_)),F=y(f,h,c,I(k,P));if(Math.abs(z[1])>Math.abs(F[1])){var O=z;z=F,F=O,O=_,_=P,P=O;var R=x;x=b,b=R}z[0]<0&&(_[x]=-1),F[1]>0&&(P[b]=-1);for(var B=0,j=0,v=0;v<4;++v)B+=Math.pow(c[4*x+v],2),j+=Math.pow(c[4*b+v],2);_[x]/=Math.sqrt(B),P[b]/=Math.sqrt(j),u.axes[0]=_,u.axes[1]=P,u.fragClipBounds[0]=L(E,m[0],g,-1e8),u.fragClipBounds[1]=L(E,m[1],g,1e8),r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*n),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}(r,i,n,a),o===i.hasAlpha||s){t.bind();var c=t.uniforms;c.model=n.model||d,c.view=n.view||d,c.projection=n.projection||d,w[0]=2/u.drawingBufferWidth,w[1]=2/u.drawingBufferHeight,c.screenSize=w,c.highlightId=i.highlightId,c.highlightScale=i.highlightScale,c.fragClipBounds=P,c.clipBounds=i.axes.bounds,c.opacity=i.opacity,c.pickGroup=i.pickId/255,c.pixelRatio=a,i.vao.bind(),i.vao.draw(u.TRIANGLES,i.vertexCount),i.lineWidth>0&&(u.lineWidth(i.lineWidth*a),i.vao.draw(u.LINES,i.lineVertexCount,i.vertexCount)),i.vao.unbind()}}function F(t,r,i,a){var o=h(o=m(t)?r=this.pointCount||r<0)return null;var i=this.points[r],n=this._selectResult;n.index=r;for(var a=0;a<3;++a)n.position[a]=n.dataCoordinate[a]=i[a];return n},_.highlight=function(t){if(t){var r=t.index;this.highlightId=[(255&r)/255,(r>>8&255)/255,(r>>16&255)/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(m(t.project))this.axesProject=t.project;else{var r=!!t.project;this.axesProject=[r,r,r]}if("projectScale"in t)if(m(t.projectScale))this.projectScale=t.projectScale.slice();else{var i=+t.projectScale;this.projectScale=[i,i,i]}if(this.projectHasAlpha=!1,"projectOpacity"in t){if(m(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var i=+t.projectOpacity;this.projectOpacity=[i,i,i]}for(var n=0;n<3;++n)this.projectOpacity[n]=x(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=x(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var a,o,l=t.position,u={family:t.font||"normal",style:t.fontStyle||"normal",weight:t.fontWeight||"normal",variant:t.fontVariant||"normal"},c=t.alignment||[0,0];if(2===c.length)a=c[0],o=c[1];else{a=[],o=[];for(var n=0;n0){var O=0,R=_,B=[0,0,0,1],j=[0,0,0,1],N=m(p)&&m(p[0]),V=m(v)&&m(v[0]);e:for(var n=0;n0?1-D[0][0]:Z<0?1+D[1][0]:1,Y*=Y>0?1-D[0][1]:Y<0?1+D[1][1]:1;for(var X=[Z,Y],K=S.cells||[],J=S.positions||[],M=0;Mthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(s(i*r*4)),o=0;oi)for(t=i;tr)for(t=r;t=0){for(var A=0|T.type.charAt(T.type.length-1),M=Array(A),k=0;k=0;)S+=1;w[x]=S}var E=Array(i.length);function D(){f.program=s.program(p,f._vref,f._fref,_,w);for(var t=0;t=0){var p=d.charCodeAt(d.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type for attribute "+h+": "+d);l(t,r,f[0],a,p,o,h)}else if(d.indexOf("mat")>=0){var p=d.charCodeAt(d.length-1)-48;if(p<2||p>4)throw new n("","Invalid data type for attribute "+h+": "+d);!function(t,r,i,n,a,o,s){for(var u=Array(a),c=Array(a),h=0;h4)throw new a("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+y+"iv"](l[h],d);break;case"v":t["uniform"+y+"fv"](l[h],d);break;default:throw new a("","Unrecognized data type for vector "+name+": "+v)}}else if(0===v.indexOf("mat")&&4===v.length){if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+y+"fv"](l[h],!1,d);break}else throw new a("","Unknown uniform data type for "+name+": "+v)}}}}}function c(t,r,n){if("object"==typeof n)Object.defineProperty(t,r,{get:o(h(n)),set:u(n),enumerable:!0,configurable:!1});else l[n]?Object.defineProperty(t,r,{get:function(t,r,i){return t.getUniform(r.program,i[n])},set:u(n),enumerable:!0,configurable:!1}):t[r]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var r=t.indexOf("vec");if(0<=r&&r<=1&&t.length===4+r){var i=t.charCodeAt(t.length-1)-48;if(i<2||i>4)throw new a("","Invalid data type");return"b"===t.charAt(0)?s(i,!1):s(i,0)}if(0===t.indexOf("mat")&&4===t.length){var i=t.charCodeAt(t.length-1)-48;if(i<2||i>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+t);return s(i*i,0)}throw new a("","Unknown uniform data type for "+name+": "+t)}}(i[n].type)}function h(t){var r;if(Array.isArray(t)){r=Array(t.length);for(var i=0;i1){u[0]in s||(s[u[0]]=[]),s=s[u[0]];for(var c=1;c1)for(var u=0;u"u"?i(606):WeakMap),s=0;function l(t,r,i,n,a,o,s){this.id=t,this.src=r,this.type=i,this.shader=n,this.count=o,this.programs=[],this.cache=s}function u(t){this.gl=t,this.shaders=[{},{}],this.programs={}}l.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,r=t.gl,i=this.programs,n=0,a=i.length;n 0 U ||b|| > 0. - // Assign z = 0, x = -b, y = a: - // a*-b + b*a + c*0 = -ba + ba + 0 = 0 - if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { - return normalize(vec3(-v.y, v.x, 0.0)); - } else { - return normalize(vec3(0.0, v.z, -v.y)); - } -} - -// Calculate the tube vertex and normal at the given index. -// -// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. -// -// Each tube segment is made up of a ring of vertices. -// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. -// The indexes of tube segments run from 0 to 8. -// -vec3 getTubePosition(vec3 d, float index, out vec3 normal) { - float segmentCount = 8.0; - - float angle = 2.0 * 3.14159 * (index / segmentCount); - - vec3 u = getOrthogonalVector(d); - vec3 v = normalize(cross(u, d)); - - vec3 x = u * cos(angle) * length(d); - vec3 y = v * sin(angle) * length(d); - vec3 v3 = x + y; - - normal = normalize(v3); - - return v3; -} - -attribute vec4 vector; -attribute vec4 color, position; -attribute vec2 uv; - -uniform float vectorScale, tubeScale; -uniform mat4 model, view, projection, inverseModel; -uniform vec3 eyePosition, lightPosition; - -varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - // Scale the vector magnitude to stay constant with - // model & view changes. - vec3 normal; - vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); - vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); - - //Lighting geometry parameters - vec4 cameraCoordinate = view * tubePosition; - cameraCoordinate.xyz /= cameraCoordinate.w; - f_lightDirection = lightPosition - cameraCoordinate.xyz; - f_eyeDirection = eyePosition - cameraCoordinate.xyz; - f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); - - // vec4 m_position = model * vec4(tubePosition, 1.0); - vec4 t_position = view * tubePosition; - gl_Position = projection * t_position; - - f_color = color; - f_data = tubePosition.xyz; - f_position = position.xyz; - f_uv = uv; -} -`]),o=n([`#extension GL_OES_standard_derivatives : enable - -precision highp float; -#define GLSLIFY 1 - -float beckmannDistribution(float x, float roughness) { - float NdotH = max(x, 0.0001); - float cos2Alpha = NdotH * NdotH; - float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; - float roughness2 = roughness * roughness; - float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; - return exp(tan2Alpha / roughness2) / denom; -} - -float cookTorranceSpecular( - vec3 lightDirection, - vec3 viewDirection, - vec3 surfaceNormal, - float roughness, - float fresnel) { - - float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); - float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); - - //Half angle vector - vec3 H = normalize(lightDirection + viewDirection); - - //Geometric term - float NdotH = max(dot(surfaceNormal, H), 0.0); - float VdotH = max(dot(viewDirection, H), 0.000001); - float LdotH = max(dot(lightDirection, H), 0.000001); - float G1 = (2.0 * NdotH * VdotN) / VdotH; - float G2 = (2.0 * NdotH * LdotN) / LdotH; - float G = min(1.0, min(G1, G2)); - - //Distribution term - float D = beckmannDistribution(NdotH, roughness); - - //Fresnel term - float F = pow(1.0 - VdotN, fresnel); - - //Multiply terms and done - return G * F * D / max(3.14159265 * VdotN, 0.000001); -} - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; -uniform sampler2D texture; - -varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; -varying vec4 f_color; -varying vec2 f_uv; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - vec3 N = normalize(f_normal); - vec3 L = normalize(f_lightDirection); - vec3 V = normalize(f_eyeDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - vec4 surfaceColor = f_color * texture2D(texture, f_uv); - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = litColor * opacity; -} -`]),s=n([`precision highp float; - -precision highp float; -#define GLSLIFY 1 - -vec3 getOrthogonalVector(vec3 v) { - // Return up-vector for only-z vector. - // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). - // From the above if-statement we have ||a|| > 0 U ||b|| > 0. - // Assign z = 0, x = -b, y = a: - // a*-b + b*a + c*0 = -ba + ba + 0 = 0 - if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { - return normalize(vec3(-v.y, v.x, 0.0)); - } else { - return normalize(vec3(0.0, v.z, -v.y)); - } -} - -// Calculate the tube vertex and normal at the given index. -// -// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. -// -// Each tube segment is made up of a ring of vertices. -// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. -// The indexes of tube segments run from 0 to 8. -// -vec3 getTubePosition(vec3 d, float index, out vec3 normal) { - float segmentCount = 8.0; - - float angle = 2.0 * 3.14159 * (index / segmentCount); - - vec3 u = getOrthogonalVector(d); - vec3 v = normalize(cross(u, d)); - - vec3 x = u * cos(angle) * length(d); - vec3 y = v * sin(angle) * length(d); - vec3 v3 = x + y; - - normal = normalize(v3); - - return v3; -} - -attribute vec4 vector; -attribute vec4 position; -attribute vec4 id; - -uniform mat4 model, view, projection; -uniform float tubeScale; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - vec3 normal; - vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); - vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); - - gl_Position = projection * (view * tubePosition); - f_id = id; - f_position = position.xyz; -} -`]),l=n([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying vec3 f_position; -varying vec4 f_id; - -void main() { - if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; - - gl_FragColor = vec4(pickId, f_id.xyz); -}`]);r.meshShader={vertex:a,fragment:o,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:s,fragment:l,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815(t,r,i){var n=i(2931),a=i(9970),o=["xyz","xzy","yxz","yzx","zxy","zyx"],s=function(t,r,i,o){for(var s=t.points,l=t.velocities,u=t.divergences,c=[],h=[],d=[],f=[],p=[],m=[],g=0,y=0,v=a.create(),x=a.create(),b=0;b0)for(var A=0;A<8;A++){var M=(A+1)%8;c.push(f[A],p[A],p[M],p[M],f[M],f[A]),d.push(x,v,v,v,x,x),m.push(g,y,y,y,g,g);var k=c.length;h.push([k-6,k-5,k-4],[k-3,k-2,k-1])}var S=f;f=p,p=S;var E=x;x=v,v=E;var D=g;g=y,y=D}return{positions:c,cells:h,vectors:d,vertexIntensity:m}},l=function(t,r,i,a){for(var o=0,l=0;lr)return i-1}return i},c=function(t,r,i){return ti?i:t},h=function(t,r,i){var a,o,s,l,h,d,f=r.vectors,p=r.meshgrid,m=t[0],g=t[1],y=t[2],v=p[0].length,x=p[1].length,b=p[2].length,_=u(p[0],m),w=u(p[1],g),T=u(p[2],y),A=_+1,M=w+1,k=T+1;if(_=c(_,0,v-1),A=c(A,0,v-1),w=c(w,0,x-1),M=c(M,0,x-1),T=c(T,0,b-1),k=c(k,0,b-1),_<0||w<0||T<0||A>v-1||M>x-1||k>b-1)return n.create();var S=p[0][_],E=p[0][A],D=p[1][w],C=p[1][M],I=p[2][T],L=p[2][k],P=(m-S)/(E-S),z=(g-D)/(C-D),F=(y-I)/(L-I);switch(isFinite(P)||(P=.5),isFinite(z)||(z=.5),isFinite(F)||(F=.5),i.reversedX&&(_=v-1-_,A=v-1-A),i.reversedY&&(w=x-1-w,M=x-1-M),i.reversedZ&&(T=b-1-T,k=b-1-k),i.filled){case 5:h=T,d=k,s=w*b,l=M*b,a=_*b*x,o=A*b*x;break;case 4:h=T,d=k,a=_*b,o=A*b,s=w*b*v,l=M*b*v;break;case 3:s=w,l=M,h=T*x,d=k*x,a=_*x*b,o=A*x*b;break;case 2:s=w,l=M,a=_*x,o=A*x,h=T*x*v,d=k*x*v;break;case 1:a=_,o=A,h=T*v,d=k*v,s=w*v*b,l=M*v*b;break;default:a=_,o=A,s=w*v,l=M*v,h=T*v*x,d=k*v*x}var O=f[a+s+h],R=f[a+s+d],B=f[a+l+h],j=f[a+l+d],N=f[o+s+h],V=f[o+s+d],U=f[o+l+h],q=f[o+l+d],G=n.create(),H=n.create(),$=n.create(),W=n.create();n.lerp(G,O,N,P),n.lerp(H,R,V,P),n.lerp($,B,U,P),n.lerp(W,j,q,P);var Y=n.create(),Z=n.create();n.lerp(Y,G,$,z),n.lerp(Z,H,W,z);var X=n.create();return n.lerp(X,Y,Z,F),X},d=function(t){var r=1/0;t.sort(function(t,r){return t-r});for(var i=t.length,n=1;n1&&(M=f(i));for(var E=0;Ek&&(k=O),z.push(O),g.push({points:C,velocities:I,divergences:z});for(var R=0;R<100*a&&C.lengthb||i_||nw)}(D);){R++;var B=n.clone(L),j=n.squaredLength(B);if(0===j)break;if(j>A&&n.scale(B,B,T/Math.sqrt(j)),n.add(B,B,D),L=p(B),n.squaredDistance(P,B)-A>-1e-4*A){C.push(B),P=B,I.push(L);var F=m(B,L),O=n.length(F);isFinite(O)&&O>k&&(k=O),z.push(O)}D=B}}var N=l(g,t.colormap,k,M);return u?N.tubeScale=u:(0===k&&(k=1),N.tubeScale=.5*s*M/k),N};var p=i(6740),m=i(6405).createMesh;t.exports.createTubeMesh=function(t,r){return m(t,r,{shaders:p,traceType:"streamtube"})}},990(t,r,i){var n=i(9405),a=i(3236),o=a([`precision highp float; -#define GLSLIFY 1 - -attribute vec4 uv; -attribute vec3 f; -attribute vec3 normal; - -uniform vec3 objectOffset; -uniform mat4 model, view, projection, inverseModel; -uniform vec3 lightPosition, eyePosition; -uniform sampler2D colormap; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec2 planeCoordinate; -varying vec3 lightDirection, eyeDirection, surfaceNormal; -varying vec4 vColor; - -void main() { - vec3 localCoordinate = vec3(uv.zw, f.x); - worldCoordinate = objectOffset + localCoordinate; - mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); - vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0); - vec4 clipPosition = projection * (view * worldPosition); - gl_Position = clipPosition; - kill = f.y; - value = f.z; - planeCoordinate = uv.xy; - - vColor = texture2D(colormap, vec2(value, value)); - - //Lighting geometry parameters - vec4 cameraCoordinate = view * worldPosition; - cameraCoordinate.xyz /= cameraCoordinate.w; - lightDirection = lightPosition - cameraCoordinate.xyz; - eyeDirection = eyePosition - cameraCoordinate.xyz; - surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz); -} -`]),s=a([`precision highp float; -#define GLSLIFY 1 - -float beckmannDistribution(float x, float roughness) { - float NdotH = max(x, 0.0001); - float cos2Alpha = NdotH * NdotH; - float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; - float roughness2 = roughness * roughness; - float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; - return exp(tan2Alpha / roughness2) / denom; -} - -float beckmannSpecular( - vec3 lightDirection, - vec3 viewDirection, - vec3 surfaceNormal, - float roughness) { - return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness); -} - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec3 lowerBound, upperBound; -uniform float contourTint; -uniform vec4 contourColor; -uniform sampler2D colormap; -uniform vec3 clipBounds[2]; -uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; -uniform float vertexColor; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec3 lightDirection, eyeDirection, surfaceNormal; -varying vec4 vColor; - -void main() { - if ( - kill > 0.0 || - vColor.a == 0.0 || - outOfRange(clipBounds[0], clipBounds[1], worldCoordinate) - ) discard; - - vec3 N = normalize(surfaceNormal); - vec3 V = normalize(eyeDirection); - vec3 L = normalize(lightDirection); - - if(gl_FrontFacing) { - N = -N; - } - - float specular = max(beckmannSpecular(L, V, N, roughness), 0.); - float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); - - //decide how to interpolate color \u2014 in vertex or in fragment - vec4 surfaceColor = - step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + - step(.5, vertexColor) * vColor; - - vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); - - gl_FragColor = mix(litColor, contourColor, contourTint) * opacity; -} -`]),l=a([`precision highp float; -#define GLSLIFY 1 - -attribute vec4 uv; -attribute float f; - -uniform vec3 objectOffset; -uniform mat3 permutation; -uniform mat4 model, view, projection; -uniform float height, zOffset; -uniform sampler2D colormap; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec2 planeCoordinate; -varying vec3 lightDirection, eyeDirection, surfaceNormal; -varying vec4 vColor; - -void main() { - vec3 dataCoordinate = permutation * vec3(uv.xy, height); - worldCoordinate = objectOffset + dataCoordinate; - mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); - vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0); - - vec4 clipPosition = projection * (view * worldPosition); - clipPosition.z += zOffset; - - gl_Position = clipPosition; - value = f + objectOffset.z; - kill = -1.0; - planeCoordinate = uv.zw; - - vColor = texture2D(colormap, vec2(value, value)); - - //Don't do lighting for contours - surfaceNormal = vec3(1,0,0); - eyeDirection = vec3(0,1,0); - lightDirection = vec3(0,0,1); -} -`]),u=a([`precision highp float; -#define GLSLIFY 1 - -bool outOfRange(float a, float b, float p) { - return ((p > max(a, b)) || - (p < min(a, b))); -} - -bool outOfRange(vec2 a, vec2 b, vec2 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y)); -} - -bool outOfRange(vec3 a, vec3 b, vec3 p) { - return (outOfRange(a.x, b.x, p.x) || - outOfRange(a.y, b.y, p.y) || - outOfRange(a.z, b.z, p.z)); -} - -bool outOfRange(vec4 a, vec4 b, vec4 p) { - return outOfRange(a.xyz, b.xyz, p.xyz); -} - -uniform vec2 shape; -uniform vec3 clipBounds[2]; -uniform float pickId; - -varying float value, kill; -varying vec3 worldCoordinate; -varying vec2 planeCoordinate; -varying vec3 surfaceNormal; - -vec2 splitFloat(float v) { - float vh = 255.0 * v; - float upper = floor(vh); - float lower = fract(vh); - return vec2(upper / 255.0, floor(lower * 16.0) / 16.0); -} - -void main() { - if ((kill > 0.0) || - (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard; - - vec2 ux = splitFloat(planeCoordinate.x / shape.x); - vec2 uy = splitFloat(planeCoordinate.y / shape.y); - gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0)); -} -`]);r.createShader=function(t){var r=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return r.attributes.uv.location=0,r.attributes.f.location=1,r.attributes.normal.location=2,r},r.createPickShader=function(t){var r=n(t,o,u,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return r.attributes.uv.location=0,r.attributes.f.location=1,r.attributes.normal.location=2,r},r.createContourShader=function(t){var r=n(t,l,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return r.attributes.uv.location=0,r.attributes.f.location=1,r},r.createPickContourShader=function(t){var r=n(t,l,u,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return r.attributes.uv.location=0,r.attributes.f.location=1,r}},9499(t,r,i){t.exports=function(t){var r=t.gl,i=x(r),n=_(r),l=b(r),u=w(r),c=a(r),h=o(r,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),d=a(r),f=o(r,[{buffer:d,size:4,stride:20,offset:0},{buffer:d,size:1,stride:20,offset:16}]),p=a(r),m=o(r,[{buffer:p,size:2,type:r.FLOAT}]),g=s(r,1,256,r.RGBA,r.UNSIGNED_BYTE);g.minFilter=r.LINEAR,g.magFilter=r.LINEAR;var y=new I(r,[0,0],[[0,0,0],[0,0,0]],i,n,c,h,g,l,u,d,f,p,m,[0,0,0]),v={levels:[[],[],[]]};for(var T in t)v[T]=t[T];return v.colormap=v.colormap||"jet",y.update(v),y};for(var n=i(8828),a=i(2762),o=i(8116),s=i(7766),l=i(1888),u=i(6729),c=i(5298),h=i(9994),d=i(9618),f=i(3711),p=i(6760),m=i(7608),g=i(2478),y=i(6199),v=i(990),x=v.createShader,b=v.createContourShader,_=v.createPickShader,w=v.createPickContourShader,T=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],M=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],k=0;k<3;++k){var S=M[k],E=(k+1)%3,D=(k+2)%3;S[E+0]=1,S[D+3]=1,S[k+6]=1}function C(t,r,i,n,a){this.position=t,this.index=r,this.uv=i,this.level=n,this.dataCoordinate=a}function I(t,r,i,n,a,o,s,u,c,h,f,p,m,g,y){this.gl=t,this.shape=r,this.bounds=i,this.objectOffset=y,this.intensityBounds=[],this._shader=n,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=u,this._contourShader=c,this._contourPickShader=h,this._contourBuffer=f,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new C([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=m,this._dynamicVAO=g,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[d(l.mallocFloat(1024),[0,0]),d(l.mallocFloat(1024),[0,0]),d(l.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var L=I.prototype;L.genColormap=function(t,r){var i=!1,n=h([u({colormap:t,nshades:256,format:"rgba"}).map(function(t,n){var a=r?function(t,r){if(!r||!r.length)return 1;for(var i=0;it&&i>0){var n=(r[i][0]-t)/(r[i][0]-r[i-1][0]);return r[i][1]*(1-n)+n*r[i-1][1]}}return 1}(n/255,r):t[3];return a<1&&(i=!0),[t[0],t[1],t[2],255*a]})]);return c.divseq(n,255),this.hasAlphaScale=i,n},L.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},L.isOpaque=function(){return!this.isTransparent()},L.pickSlots=1,L.setPickBase=function(t){this.pickId=t};var P=[0,0,0],z={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function F(t,r){var i,n,a,o=r.axes&&r.axes.lastCubeProps.axis||P,s=r.showSurface,l=r.showContour;for(i=0;i<3;++i)for(s=s||r.surfaceProject[i],n=0;n<3;++n)l=l||r.contourProject[i][n];for(i=0;i<3;++i){var u=z.projections[i];for(n=0;n<16;++n)u[n]=0;for(n=0;n<4;++n)u[5*n]=1;u[5*i]=0,u[12+i]=r.axesBounds[+(o[i]>0)][i],p(u,t.model,u);var c=z.clipBounds[i];for(a=0;a<2;++a)for(n=0;n<3;++n)c[a][n]=t.clipBounds[a][n];c[0][i]=-1e8,c[1][i]=1e8}return z.showSurface=s,z.showContour=l,z}var O={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},R=T.slice(),B=[1,0,0,0,1,0,0,0,1];function j(t,r){t=t||{};var i=this.gl;i.disable(i.CULL_FACE),this._colorMap.bind(0),O.model=t.model||T,O.view=t.view||T,O.projection=t.projection||T,O.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],O.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],O.objectOffset=this.objectOffset,O.contourColor=this.contourColor[0],O.inverseModel=m(O.inverseModel,O.model);for(var n=0;n<2;++n)for(var a=O.clipBounds[n],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);for(O.kambient=this.ambientLight,O.kdiffuse=this.diffuseLight,O.kspecular=this.specularLight,O.roughness=this.roughness,O.fresnel=this.fresnel,O.opacity=this.opacity,O.height=0,O.permutation=B,O.vertexColor=this.vertexColor,p(R,O.view,O.model),p(R,O.projection,R),m(R,R),n=0;n<3;++n)O.eyePosition[n]=R[12+n]/R[15];var s=R[15];for(n=0;n<3;++n)s+=this.lightPosition[n]*R[4*n+3];for(n=0;n<3;++n){var l=R[12+n];for(o=0;o<3;++o)l+=R[4*o+n]*this.lightPosition[o];O.lightPosition[n]=l/s}var u=F(O,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=O,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(i.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[n],this._shader.uniforms.clipBounds=u.clipBounds[n],this._vao.draw(i.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var c=this._contourShader;O.kambient=1,O.kdiffuse=0,O.kspecular=0,O.opacity=1,c.bind(),c.uniforms=O;var h=this._contourVAO;for(h.bind(),n=0;n<3;++n)for(c.uniforms.permutation=M[n],i.lineWidth(this.contourWidth[n]*this.pixelRatio),o=0;o>4)/16)/255,a=Math.floor(n),o=n-a,s=r[1]*(t.value[1]+(15&t.value[2])/16)/255,l=Math.floor(s),u=s-l;a+=1,l+=1;var c=i.position;c[0]=c[1]=c[2]=0;for(var h=0;h<2;++h)for(var d=h?o:1-o,f=0;f<2;++f)for(var p=f?u:1-u,m=a+h,y=l+f,v=d*p,x=0;x<3;++x)c[x]+=this._field[x].get(m,y)*v;for(var b=this._pickResult.level,_=0;_<3;++_)if(b[_]=g.le(this.contourLevels[_],c[_]),b[_]<0)this.contourLevels[_].length>0&&(b[_]=0);else if(b[_]Math.abs(T-c[_])&&(b[_]+=1)}for(i.index[0]=o<.5?a:a+1,i.index[1]=u<.5?l:l+1,i.uv[0]=n/r[0],i.uv[1]=s/r[1],x=0;x<3;++x)i.dataCoordinate[x]=this._field[x].get(i.index[0],i.index[1]);return i},L.padField=function(t,r){var i=r.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(i[0],i[1]),r),c.assign(t.lo(1).hi(i[0],1),r.hi(i[0],1)),c.assign(t.lo(1,n[1]-1).hi(i[0],1),r.lo(0,i[1]-1).hi(i[0],1)),c.assign(t.lo(0,1).hi(1,i[1]),r.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,i[1]),r.lo(i[0]-1)),t.set(0,0,r.get(0,0)),t.set(0,n[1]-1,r.get(0,i[1]-1)),t.set(n[0]-1,0,r.get(i[0]-1,0)),t.set(n[0]-1,n[1]-1,r.get(i[0]-1,i[1]-1))},L.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=V(t.contourWidth,Number)),"showContour"in t&&(this.showContour=V(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=V(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=q(t.contourColor)),"contourProject"in t&&(this.contourProject=V(t.contourProject,function(t){return V(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=q(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=V(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=V(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=+!!t.vertexColor),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var r=t.field||t.coords&&t.coords[2]||null,i=!1;if(r||(r=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var a=(r.shape[0]+2)*(r.shape[1]+2);a>this._field[2].data.length&&(l.freeFloat(this._field[2].data),this._field[2].data=l.mallocFloat(n.nextPow2(a))),this._field[2]=d(this._field[2].data,[r.shape[0]+2,r.shape[1]+2]),this.padField(this._field[2],r),this.shape=r.shape.slice();for(var o=this.shape,s=0;s<2;++s)this._field[2].size>this._field[s].data.length&&(l.freeFloat(this._field[s].data),this._field[s].data=l.mallocFloat(this._field[2].size)),this._field[s]=d(this._field[s].data,[o[0]+2,o[1]+2]);if(t.coords){var u=t.coords;if(!Array.isArray(u)||3!==u.length)throw Error("gl-surface: invalid coordinates for x/y");for(s=0;s<2;++s){var c=u[s];for(v=0;v<2;++v)if(c.shape[v]!==o[v])throw Error("gl-surface: coords have incorrect shape");this.padField(this._field[s],c)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw Error("gl-surface: invalid ticks");for(s=0;s<2;++s){var p=h[s];if((Array.isArray(p)||p.length)&&(p=d(p)),p.shape[0]!==o[s])throw Error("gl-surface: invalid tick length");var m=d(p.data,o);m.stride[s]=p.stride[0],m.stride[1^s]=0,this.padField(this._field[s],m)}}else{for(s=0;s<2;++s){var g=[0,0];g[s]=1,this._field[s]=d(this._field[s].data,[o[0]+2,o[1]+2],g,0)}this._field[0].set(0,0,0);for(var v=0;v0){for(var eb=0;eb<5;++eb)Q.pop();N-=1}continue e}Q.push(en[0],en[1],es[0],es[1],en[2]),N+=1}}ei.push(N)}this._contourOffsets[ee]=er,this._contourCounts[ee]=ei}var e_=l.mallocFloat(Q.length);for(s=0;sl||s[1]<0||s[1]>l)throw Error("gl-texture2d: Invalid texture size");var u=m(s,r.stride.slice()),c=0;"float32"===i?c=t.FLOAT:"float64"===i?(c=t.FLOAT,u=!1,i="float32"):"uint8"===i?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,u=!1,i="uint8");var d=0;if(2===s.length)d=t.LUMINANCE,s=[s[0],s[1],1],r=n(r.data,s,[r.stride[0],r.stride[1],1],r.offset);else if(3===s.length)if(1===s[2])d=t.ALPHA;else if(2===s[2])d=t.LUMINANCE_ALPHA;else if(3===s[2])d=t.RGB;else if(4===s[2])d=t.RGBA;else throw Error("gl-texture2d: Invalid shape for pixel coords");else throw Error("gl-texture2d: Invalid shape for texture");c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,u=!1);var p,y,v=r.size;if(u)p=0===r.offset&&r.data.length===v?r.data:r.data.subarray(r.offset,r.offset+v);else{var x=[s[2],s[2]*s[0],1],b=n(y=o.malloc(v,i),s,x,0);("float32"===i||"float64"===i)&&c===t.UNSIGNED_BYTE?h(b,r):a.assign(b,r),p=y.subarray(0,v)}var _=g(t);return t.texImage2D(t.TEXTURE_2D,0,d,s[0],s[1],0,d,c,p),u||o.free(y),new f(t,_,s[0],s[1],d,c)}(t,x)}throw Error("gl-texture2d: Invalid arguments for texture2d constructor")};var s=null,l=null,u=null;function c(t){return"u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"u">typeof HTMLImageElement&&t instanceof HTMLImageElement||"u">typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"u">typeof ImageData&&t instanceof ImageData}var h=function(t,r){a.muls(t,r,255)};function d(t,r,i){var n=t.gl,a=n.getParameter(n.MAX_TEXTURE_SIZE);if(r<0||r>a||i<0||i>a)throw Error("gl-texture2d: Invalid texture size");return t._shape=[r,i],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,r,i,0,t.format,t.type,null),t._mipLevels=[0],t}function f(t,r,i,n,a,o){this.gl=t,this.handle=r,this.format=a,this.type=o,this._shape=[i,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var s=this,l=[this._wrapS,this._wrapT];Object.defineProperties(l,[{get:function(){return s._wrapS},set:function(t){return s.wrapS=t}},{get:function(){return s._wrapT},set:function(t){return s.wrapT=t}}]),this._wrapVector=l;var u=[this._shape[0],this._shape[1]];Object.defineProperties(u,[{get:function(){return s._shape[0]},set:function(t){return s.width=t}},{get:function(){return s._shape[1]},set:function(t){return s.height=t}}]),this._shapeVector=u}var p=f.prototype;function m(t,r){return 3===t.length?1===r[2]&&r[1]===t[0]*t[2]&&r[0]===t[2]:1===r[0]&&r[1]===t[0]}function g(t){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r}function y(t,r,i,n,a){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(r<0||r>o||i<0||i>o)throw Error("gl-texture2d: Invalid texture shape");if(a===t.FLOAT&&!t.getExtension("OES_texture_float"))throw Error("gl-texture2d: Floating point textures not supported on this platform");var s=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,r,i,0,n,a,null),new f(t,s,r,i,n,a)}Object.defineProperties(p,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var r=this.gl;if(this.type===r.FLOAT&&s.indexOf(t)>=0&&(r.getExtension("OES_texture_float_linear")||(t=r.NEAREST)),0>l.indexOf(t))throw Error("gl-texture2d: Unknown filter mode "+t);return r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var r=this.gl;if(this.type===r.FLOAT&&s.indexOf(t)>=0&&(r.getExtension("OES_texture_float_linear")||(t=r.NEAREST)),0>l.indexOf(t))throw Error("gl-texture2d: Unknown filter mode "+t);return r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var r=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),r!==this._anisoSamples){var i=this.gl.getExtension("EXT_texture_filter_anisotropic");i&&this.gl.texParameterf(this.gl.TEXTURE_2D,i.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),0>u.indexOf(t))throw Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),0>u.indexOf(t))throw Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var r=0;r<2;++r)if(0>u.indexOf(t[r]))throw Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var i=this.gl;return this.bind(),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,this._wrapS),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return d(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return d(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,d(this,this._shape[0],t),t}}}),p.bind=function(t){var r=this.gl;return void 0!==t&&r.activeTexture(r.TEXTURE0+(0|t)),r.bindTexture(r.TEXTURE_2D,this.handle),void 0!==t?0|t:r.getParameter(r.ACTIVE_TEXTURE)-r.TEXTURE0},p.dispose=function(){this.gl.deleteTexture(this.handle)},p.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),r=0;t>0;++r,t>>>=1)0>this._mipLevels.indexOf(r)&&this._mipLevels.push(r)},p.setPixels=function(t,r,i,s){var l=this.gl;this.bind(),Array.isArray(r)?(s=i,i=0|r[1],r=0|r[0]):(r=r||0,i=i||0),s=s||0;var u=c(t)?t:t.raw;if(u)0>this._mipLevels.indexOf(s)?(l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,this.type,u),this._mipLevels.push(s)):l.texSubImage2D(l.TEXTURE_2D,s,r,i,this.format,this.type,u);else if(t.shape&&t.stride&&t.data){if(t.shape.length<2||r+t.shape[1]>this._shape[1]>>>s||i+t.shape[0]>this._shape[0]>>>s||r<0||i<0)throw Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,r,i,s,l,u,c,d){var f=d.dtype,p=d.shape.slice();if(p.length<2||p.length>3)throw Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var g=0,y=0,v=m(p,d.stride.slice());"float32"===f?g=t.FLOAT:"float64"===f?(g=t.FLOAT,v=!1,f="float32"):"uint8"===f?g=t.UNSIGNED_BYTE:(g=t.UNSIGNED_BYTE,v=!1,f="uint8");if(2===p.length)y=t.LUMINANCE,p=[p[0],p[1],1],d=n(d.data,p,[d.stride[0],d.stride[1],1],d.offset);else if(3===p.length){if(1===p[2])y=t.ALPHA;else if(2===p[2])y=t.LUMINANCE_ALPHA;else if(3===p[2])y=t.RGB;else if(4===p[2])y=t.RGBA;else throw Error("gl-texture2d: Invalid shape for pixel coords");p[2]}else throw Error("gl-texture2d: Invalid shape for texture");if((y===t.LUMINANCE||y===t.ALPHA)&&(l===t.LUMINANCE||l===t.ALPHA)&&(y=l),y!==l)throw Error("gl-texture2d: Incompatible texture format for setPixels");var x=d.size,b=0>c.indexOf(s);if(b&&c.push(s),g===u&&v)0===d.offset&&d.data.length===x?b?t.texImage2D(t.TEXTURE_2D,s,l,p[0],p[1],0,l,u,d.data):t.texSubImage2D(t.TEXTURE_2D,s,r,i,p[0],p[1],l,u,d.data):b?t.texImage2D(t.TEXTURE_2D,s,l,p[0],p[1],0,l,u,d.data.subarray(d.offset,d.offset+x)):t.texSubImage2D(t.TEXTURE_2D,s,r,i,p[0],p[1],l,u,d.data.subarray(d.offset,d.offset+x));else{var _=u===t.FLOAT?o.mallocFloat32(x):o.mallocUint8(x),w=n(_,p,[p[2],p[2]*p[0],1]);g===t.FLOAT&&u===t.UNSIGNED_BYTE?h(w,d):a.assign(w,d),b?t.texImage2D(t.TEXTURE_2D,s,l,p[0],p[1],0,l,u,_.subarray(0,x)):t.texSubImage2D(t.TEXTURE_2D,s,r,i,p[0],p[1],l,u,_.subarray(0,x)),u===t.FLOAT?o.freeFloat32(_):o.freeUint8(_)}}(l,r,i,s,this.format,this.type,this._mipLevels,t)}else throw Error("gl-texture2d: Unsupported data type")}},1433(t){t.exports=function(t,r,i){r?r.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(i){if(i.length>n)throw Error("gl-vao: Too many vertex attributes");for(var a=0;a1?0:Math.acos(l)};var n=i(2825),a=i(3536),o=i(244)},9226(t){t.exports=function(t,r){return t[0]=Math.ceil(r[0]),t[1]=Math.ceil(r[1]),t[2]=Math.ceil(r[2]),t}},3126(t){t.exports=function(t){var r=new Float32Array(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}},3990(t){t.exports=function(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}},1091(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},5911(t){t.exports=function(t,r,i){var n=r[0],a=r[1],o=r[2],s=i[0],l=i[1],u=i[2];return t[0]=a*u-o*l,t[1]=o*s-n*u,t[2]=n*l-a*s,t}},5455(t,r,i){t.exports=i(7056)},7056(t){t.exports=function(t,r){var i=r[0]-t[0],n=r[1]-t[1],a=r[2]-t[2];return Math.sqrt(i*i+n*n+a*a)}},4008(t,r,i){t.exports=i(6690)},6690(t){t.exports=function(t,r,i){return t[0]=r[0]/i[0],t[1]=r[1]/i[1],t[2]=r[2]/i[2],t}},244(t){t.exports=function(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]}},2613(t){t.exports=1e-6},9922(t,r,i){t.exports=function(t,r){var i=t[0],a=t[1],o=t[2],s=r[0],l=r[1],u=r[2];return Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-u)<=n*Math.max(1,Math.abs(o),Math.abs(u))};var n=i(2613)},9265(t){t.exports=function(t,r){return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]}},2681(t){t.exports=function(t,r){return t[0]=Math.floor(r[0]),t[1]=Math.floor(r[1]),t[2]=Math.floor(r[2]),t}},5137(t,r,i){t.exports=function(t,r,i,a,o,s){var l,u;for(r||(r=3),i||(i=0),u=a?Math.min(a*r+i,t.length):t.length,l=i;l0&&(o=1/Math.sqrt(o),t[0]=r[0]*o,t[1]=r[1]*o,t[2]=r[2]*o),t}},7636(t){t.exports=function(t,r){var i=2*Math.random()*Math.PI,n=2*Math.random()-1,a=Math.sqrt(1-n*n)*(r=r||1);return t[0]=Math.cos(i)*a,t[1]=Math.sin(i)*a,t[2]=n*r,t}},6894(t){t.exports=function(t,r,i,n){var a=i[1],o=i[2],s=r[1]-a,l=r[2]-o,u=Math.sin(n),c=Math.cos(n);return t[0]=r[0],t[1]=a+s*c-l*u,t[2]=o+s*u+l*c,t}},109(t){t.exports=function(t,r,i,n){var a=i[0],o=i[2],s=r[0]-a,l=r[2]-o,u=Math.sin(n),c=Math.cos(n);return t[0]=a+l*u+s*c,t[1]=r[1],t[2]=o+l*c-s*u,t}},8692(t){t.exports=function(t,r,i,n){var a=i[0],o=i[1],s=r[0]-a,l=r[1]-o,u=Math.sin(n),c=Math.cos(n);return t[0]=a+s*c-l*u,t[1]=o+s*u+l*c,t[2]=r[2],t}},2447(t){t.exports=function(t,r){return t[0]=Math.round(r[0]),t[1]=Math.round(r[1]),t[2]=Math.round(r[2]),t}},6621(t){t.exports=function(t,r,i){return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t}},8489(t){t.exports=function(t,r,i,n){return t[0]=r[0]+i[0]*n,t[1]=r[1]+i[1]*n,t[2]=r[2]+i[2]*n,t}},1463(t){t.exports=function(t,r,i,n){return t[0]=r,t[1]=i,t[2]=n,t}},6141(t,r,i){t.exports=i(2953)},5486(t,r,i){t.exports=i(3066)},2953(t){t.exports=function(t,r){var i=r[0]-t[0],n=r[1]-t[1],a=r[2]-t[2];return i*i+n*n+a*a}},3066(t){t.exports=function(t){var r=t[0],i=t[1],n=t[2];return r*r+i*i+n*n}},2229(t,r,i){t.exports=i(6843)},6843(t){t.exports=function(t,r,i){return t[0]=r[0]-i[0],t[1]=r[1]-i[1],t[2]=r[2]-i[2],t}},492(t){t.exports=function(t,r,i){var n=r[0],a=r[1],o=r[2];return t[0]=n*i[0]+a*i[3]+o*i[6],t[1]=n*i[1]+a*i[4]+o*i[7],t[2]=n*i[2]+a*i[5]+o*i[8],t}},5673(t){t.exports=function(t,r,i){var n=r[0],a=r[1],o=r[2],s=i[3]*n+i[7]*a+i[11]*o+i[15];return s=s||1,t[0]=(i[0]*n+i[4]*a+i[8]*o+i[12])/s,t[1]=(i[1]*n+i[5]*a+i[9]*o+i[13])/s,t[2]=(i[2]*n+i[6]*a+i[10]*o+i[14])/s,t}},264(t){t.exports=function(t,r,i){var n=r[0],a=r[1],o=r[2],s=i[0],l=i[1],u=i[2],c=i[3],h=l*o-u*a,d=u*n-s*o,f=s*a-l*n;return h*=2,d*=2,f*=2,t[0]=n+c*h+l*f-u*d,t[1]=a+c*d+u*h-s*f,t[2]=o+c*f+s*d-l*h,t}},4361(t){t.exports=function(t,r,i){return t[0]=r[0]+i[0],t[1]=r[1]+i[1],t[2]=r[2]+i[2],t[3]=r[3]+i[3],t}},2335(t){t.exports=function(t){var r=new Float32Array(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}},2933(t){t.exports=function(t,r){return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}},7536(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},4691(t){t.exports=function(t,r){var i=r[0]-t[0],n=r[1]-t[1],a=r[2]-t[2],o=r[3]-t[3];return Math.sqrt(i*i+n*n+a*a+o*o)}},1373(t){t.exports=function(t,r,i){return t[0]=r[0]/i[0],t[1]=r[1]/i[1],t[2]=r[2]/i[2],t[3]=r[3]/i[3],t}},3750(t){t.exports=function(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]+t[3]*r[3]}},3390(t){t.exports=function(t,r,i,n){var a=new Float32Array(4);return a[0]=t,a[1]=r,a[2]=i,a[3]=n,a}},9970(t,r,i){t.exports={create:i(7536),clone:i(2335),fromValues:i(3390),copy:i(2933),set:i(4578),add:i(4361),subtract:i(6860),multiply:i(3576),divide:i(1373),min:i(2334),max:i(160),scale:i(9288),scaleAndAdd:i(4844),distance:i(4691),squaredDistance:i(7960),length:i(6808),squaredLength:i(483),negate:i(1498),inverse:i(4494),normalize:i(5177),dot:i(3750),lerp:i(2573),random:i(9131),transformMat4:i(5352),transformQuat:i(4041)}},4494(t){t.exports=function(t,r){return t[0]=1/r[0],t[1]=1/r[1],t[2]=1/r[2],t[3]=1/r[3],t}},6808(t){t.exports=function(t){var r=t[0],i=t[1],n=t[2],a=t[3];return Math.sqrt(r*r+i*i+n*n+a*a)}},2573(t){t.exports=function(t,r,i,n){var a=r[0],o=r[1],s=r[2],l=r[3];return t[0]=a+n*(i[0]-a),t[1]=o+n*(i[1]-o),t[2]=s+n*(i[2]-s),t[3]=l+n*(i[3]-l),t}},160(t){t.exports=function(t,r,i){return t[0]=Math.max(r[0],i[0]),t[1]=Math.max(r[1],i[1]),t[2]=Math.max(r[2],i[2]),t[3]=Math.max(r[3],i[3]),t}},2334(t){t.exports=function(t,r,i){return t[0]=Math.min(r[0],i[0]),t[1]=Math.min(r[1],i[1]),t[2]=Math.min(r[2],i[2]),t[3]=Math.min(r[3],i[3]),t}},3576(t){t.exports=function(t,r,i){return t[0]=r[0]*i[0],t[1]=r[1]*i[1],t[2]=r[2]*i[2],t[3]=r[3]*i[3],t}},1498(t){t.exports=function(t,r){return t[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=-r[3],t}},5177(t){t.exports=function(t,r){var i=r[0],n=r[1],a=r[2],o=r[3],s=i*i+n*n+a*a+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=i*s,t[1]=n*s,t[2]=a*s,t[3]=o*s),t}},9131(t,r,i){var n=i(5177),a=i(9288);t.exports=function(t,r){return r=r||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),a(t,t,r),t}},9288(t){t.exports=function(t,r,i){return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=r[3]*i,t}},4844(t){t.exports=function(t,r,i,n){return t[0]=r[0]+i[0]*n,t[1]=r[1]+i[1]*n,t[2]=r[2]+i[2]*n,t[3]=r[3]+i[3]*n,t}},4578(t){t.exports=function(t,r,i,n,a){return t[0]=r,t[1]=i,t[2]=n,t[3]=a,t}},7960(t){t.exports=function(t,r){var i=r[0]-t[0],n=r[1]-t[1],a=r[2]-t[2],o=r[3]-t[3];return i*i+n*n+a*a+o*o}},483(t){t.exports=function(t){var r=t[0],i=t[1],n=t[2],a=t[3];return r*r+i*i+n*n+a*a}},6860(t){t.exports=function(t,r,i){return t[0]=r[0]-i[0],t[1]=r[1]-i[1],t[2]=r[2]-i[2],t[3]=r[3]-i[3],t}},5352(t){t.exports=function(t,r,i){var n=r[0],a=r[1],o=r[2],s=r[3];return t[0]=i[0]*n+i[4]*a+i[8]*o+i[12]*s,t[1]=i[1]*n+i[5]*a+i[9]*o+i[13]*s,t[2]=i[2]*n+i[6]*a+i[10]*o+i[14]*s,t[3]=i[3]*n+i[7]*a+i[11]*o+i[15]*s,t}},4041(t){t.exports=function(t,r,i){var n=r[0],a=r[1],o=r[2],s=i[0],l=i[1],u=i[2],c=i[3],h=c*n+l*o-u*a,d=c*a+u*n-s*o,f=c*o+s*a-l*n,p=-s*n-l*a-u*o;return t[0]=h*c+-(p*s)+-(d*u)- -(f*l),t[1]=d*c+-(p*l)+-(f*s)- -(h*u),t[2]=f*c+-(p*u)+-(h*l)- -(d*s),t[3]=r[3],t}},1848(t,r,i){var n=i(4905),a=i(6468);t.exports=function(t){for(var r=Array.isArray(t)?t:n(t),i=0;i0)continue;i=t.slice(0,1).join("")}return k(i),v+=i.length,(p=p.slice(i.length)).length}}};var n=i(620),a=i(7827),o=i(6852),s=i(7932),l=i(3508),u=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508(t,r,i){var n=i(6852);t.exports=(n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)})).concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932(t,r,i){t.exports=i(620).slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905(t,r,i){var n=i(5874);t.exports=function(t,r){var i=n(r),a=[];return(a=a.concat(i(t))).concat(i(null))}},3236(t){t.exports=function(t){"string"==typeof t&&(t=[t]);for(var r=[].slice.call(arguments,1),i=[],n=0;n>1,h=-7,d=i?a-1:0,f=i?-1:1,p=t[r+d];for(d+=f,o=p&(1<<-h)-1,p>>=-h,h+=l;h>0;o=256*o+t[r+d],d+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[r+d],d+=f,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,r,i,n,a,o){var s,l,u,c=8*o-a-1,h=(1<>1,f=5960464477539062e-23*(23===a),p=n?0:o-1,m=n?1:-1,g=+(r<0||0===r&&1/r<0);for(isNaN(r=Math.abs(r))||r===1/0?(l=+!!isNaN(r),s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+d>=1?r+=f/u:r+=f*Math.pow(2,1-d),r*u>=2&&(s++,u/=2),s+d>=h?(l=0,s=h):s+d>=1?(l=(r*u-1)*Math.pow(2,a),s+=d):(l=r*Math.pow(2,d-1)*Math.pow(2,a),s=0));a>=8;t[i+p]=255&l,p+=m,l/=256,a-=8);for(s=s<0;t[i+p]=255&s,p+=m,s/=256,c-=8);t[i+p-m]|=128*g}},8954(t,r,i){t.exports=function(t,r){var i=t.length;if(0===i)throw Error("Must have at least d+1 points");var a=t[0].length;if(i<=a)throw Error("Must input at least d+1 points");var s=t.slice(0,a+1),l=n.apply(void 0,s);if(0===l)throw Error("Input not in general position");for(var u=Array(a+1),h=0;h<=a;++h)u[h]=h;l<0&&(u[0]=1,u[1]=0);for(var d=new o(u,Array(a+1),!1),f=d.adjacent,p=Array(a+2),h=0;h<=a;++h){for(var m=u.slice(),g=0;g<=a;++g)g===h&&(m[g]=-1);var y=m[0];m[0]=m[1],m[1]=y;var v=new o(m,Array(a+1),!0);f[h]=v,p[h]=v}p[a+1]=d;for(var h=0;h<=a;++h)for(var m=f[h].vertices,x=f[h].adjacent,g=0;g<=a;++g){var b=m[g];if(b<0){x[g]=d;continue}for(var _=0;_<=a;++_)0>f[_].vertices.indexOf(b)&&(x[g]=f[_])}for(var w=new c(a,s,p),T=!!r,h=a+1;h0;){t=s.pop();for(var l=t.adjacent,u=0;u<=i;++u){var c=l[u];if(!(!c.boundary||c.lastVisited<=-n)){for(var h=c.vertices,d=0;d<=i;++d){var f=h[d];f<0?a[d]=r:a[d]=o[f]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&s.push(c)}}}return null},h.walk=function(t,r){var i=this.vertices.length-1,n=this.dimension,a=this.vertices,o=this.tuple,s=r?this.interior.length*Math.random()|0:this.interior.length-1,l=this.interior[s];e:for(;!l.boundary;){for(var u=l.vertices,c=l.adjacent,h=0;h<=n;++h)o[h]=a[u[h]];l.lastVisited=i;for(var h=0;h<=n;++h){var d=c[h];if(!(d.lastVisited>=i)){var f=o[h];o[h]=t;var p=this.orient();if(o[h]=f,p<0){l=d;continue e}d.boundary?d.lastVisited=-i:d.lastVisited=i}}return}return l},h.addPeaks=function(t,r){var i=this.vertices.length-1,n=this.dimension,a=this.vertices,u=this.tuple,c=this.interior,h=this.simplices,d=[r];r.lastVisited=i,r.vertices[r.vertices.indexOf(-1)]=i,r.boundary=!1,c.push(r);for(var f=[];d.length>0;){var r=d.pop(),p=r.vertices,m=r.adjacent,g=p.indexOf(i);if(!(g<0)){for(var y=0;y<=n;++y)if(y!==g){var v=m[y];if(!(!v.boundary||v.lastVisited>=i)){var x=v.vertices;if(v.lastVisited!==-i){for(var b=0,_=0;_<=n;++_)x[_]<0?(b=_,u[_]=t):u[_]=a[x[_]];if(this.orient()>0){x[b]=i,v.boundary=!1,c.push(v),d.push(v),v.lastVisited=i;continue}v.lastVisited=-i}var w=v.adjacent,T=p.slice(),A=m.slice(),M=new o(T,A,!0);h.push(M);var k=w.indexOf(r);if(!(k<0)){w[k]=M,A[g]=v,T[y]=-1,A[y]=r,m[y]=M,M.flip();for(var _=0;_<=n;++_){var S=T[_];if(!(S<0||S===i)){for(var E=Array(n-1),D=0,C=0;C<=n;++C){var I=T[C];I<0||C===_||(E[D++]=I)}f.push(new s(E,M,_))}}}}}}}f.sort(l);for(var y=0;y+1=0?s[u++]=l[h]:c=1&h;if(c===(1&t)){var d=s[0];s[0]=s[1],s[1]=d}r.push(s)}}return r}},3352(t,r,i){var n=i(2478);function a(t,r,i,n,a){this.mid=t,this.left=r,this.right=i,this.leftPoints=n,this.rightPoints=a,this.count=(r?r.count:0)+(i?i.count:0)+n.length}t.exports=function(t){return new v(t&&0!==t.length?y(t):null)};var o=a.prototype;function s(t,r){t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,r){var i=y(r);t.mid=i.mid,t.left=i.left,t.right=i.right,t.leftPoints=i.leftPoints,t.rightPoints=i.rightPoints,t.count=i.count}function u(t,r){var i=t.intervals([]);i.push(r),l(t,i)}function c(t,r){var i=t.intervals([]),n=i.indexOf(r);return n<0?0:(i.splice(n,1),l(t,i),1)}function h(t,r,i){for(var n=0;n=0&&t[n][1]>=r;--n){var a=i(t[n]);if(a)return a}}function f(t,r){for(var i=0;i>1],o=[],s=[],l=[],i=0;i3*(r+1)?u(this,t):this.left.insert(t):this.left=y([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(r+1)?u(this,t):this.right.insert(t):this.right=y([t]);else{var i=n.ge(this.leftPoints,t,m),a=n.ge(this.rightPoints,t,g);this.leftPoints.splice(i,0,t),this.rightPoints.splice(a,0,t)}},o.remove=function(t){var r=this.count-this.leftPoints;if(t[1]3*(r-1))return c(this,t);var i=this.left.remove(t);return 2===i?(this.left=null,this.count-=1,1):(1===i&&(this.count-=1),i)}if(t[0]>this.mid){if(!this.right)return 0;if(4*(this.left?this.left.count:0)>3*(r-1))return c(this,t);var i=this.right.remove(t);return 2===i?(this.right=null,this.count-=1,1):(1===i&&(this.count-=1),i)}if(1===this.count)return 2*(this.leftPoints[0]===t);if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var a=this,o=this.left;o.right;)a=o,o=o.right;if(a===this)o.right=this.right;else{var l=this.left,i=this.right;a.count-=o.count,a.right=o.left,o.left=l,o.right=i}s(this,o),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?s(this,this.left):s(this,this.right);return 1}for(var l=n.ge(this.leftPoints,t,m);lthis.mid))return f(this.leftPoints,r);if(this.right){var i=this.right.queryPoint(t,r);if(i)return i}return d(this.rightPoints,t,r)},o.queryInterval=function(t,r,i){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,r,i);if(n)return n}return rthis.mid?d(this.rightPoints,t,i):f(this.leftPoints,i)};var x=v.prototype;x.insert=function(t){this.root?this.root.insert(t):this.root=new a(t[0],null,null,[t],[t])},x.remove=function(t){if(this.root){var r=this.root.remove(t);return 2===r&&(this.root=null),0!==r}return!1},x.queryPoint=function(t,r){if(this.root)return this.root.queryPoint(t,r)},x.queryInterval=function(t,r,i){if(t<=r&&this.root)return this.root.queryInterval(t,r,i)},Object.defineProperty(x,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(x,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507(t){t.exports=!0},7163(t){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}t.exports=function(t){var i;return null!=t&&(r(t)||"function"==typeof(i=t).readFloatLE&&"function"==typeof i.slice&&r(i.slice(0,0))||!!t._isBuffer)}},2431(t){t.exports=a,t.exports.isMobile=a,t.exports.default=a;let r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/CrOS/,n=/android|ipad|playbook|silk/i;function a(t){t||(t={});let a=t.ua;if(!a&&"u">typeof navigator&&(a=navigator.userAgent),a&&a.headers&&"string"==typeof a.headers["user-agent"]&&(a=a.headers["user-agent"]),"string"!=typeof a)return!1;let o=r.test(a)&&!i.test(a)||!!t.tablet&&n.test(a);return!o&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==a.indexOf("Macintosh")&&-1!==a.indexOf("Safari")&&(o=!0),o}},5219(t){t.exports=function(t){for(var r,i=t.length,n=0;n13)&&32!==r&&133!==r&&160!==r&&5760!==r&&6158!==r&&(r<8192||r>8205)&&8232!==r&&8233!==r&&8239!==r&&8287!==r&&8288!==r&&12288!==r&&65279!==r)return!1;return!0}},395(t){t.exports=function(t,r,i){return t*(1-i)+r*i}},2652(t,r,i){var n=i(4335),a=i(6864),o=i(1903),s=i(9921),l=i(7608),u=i(5665),c={length:i(1387),normalize:i(3536),dot:i(244),cross:i(5911)},h=a(),d=a(),f=[0,0,0,0],p=[[0,0,0],[0,0,0],[0,0,0]],m=[0,0,0];function g(t,r,i,n,a){t[0]=r[0]*n+i[0]*a,t[1]=r[1]*n+i[1]*a,t[2]=r[2]*n+i[2]*a}t.exports=function(t,r,i,a,y,v){if(r||(r=[0,0,0]),i||(i=[0,0,0]),a||(a=[0,0,0]),y||(y=[0,0,0,1]),v||(v=[0,0,0,1]),!n(h,t)||(o(d,h),d[3]=0,d[7]=0,d[11]=0,d[15]=1,Math.abs(1e-8>s(d))))return!1;var x,b,_,w,T,A,M,k,S,E=h[3],D=h[7],C=h[11],I=h[12],L=h[13],P=h[14],z=h[15];if(0!==E||0!==D||0!==C){if(f[0]=E,f[1]=D,f[2]=C,f[3]=z,!l(d,d))return!1;u(d,d),x=y,b=f,_=d,w=b[0],T=b[1],A=b[2],M=b[3],x[0]=_[0]*w+_[4]*T+_[8]*A+_[12]*M,x[1]=_[1]*w+_[5]*T+_[9]*A+_[13]*M,x[2]=_[2]*w+_[6]*T+_[10]*A+_[14]*M,x[3]=_[3]*w+_[7]*T+_[11]*A+_[15]*M}else y[0]=y[1]=y[2]=0,y[3]=1;if(r[0]=I,r[1]=L,r[2]=P,k=p,S=h,k[0][0]=S[0],k[0][1]=S[1],k[0][2]=S[2],k[1][0]=S[4],k[1][1]=S[5],k[1][2]=S[6],k[2][0]=S[8],k[2][1]=S[9],k[2][2]=S[10],i[0]=c.length(p[0]),c.normalize(p[0],p[0]),a[0]=c.dot(p[0],p[1]),g(p[1],p[1],p[0],1,-a[0]),i[1]=c.length(p[1]),c.normalize(p[1],p[1]),a[0]/=i[1],a[1]=c.dot(p[0],p[2]),g(p[2],p[2],p[0],1,-a[1]),a[2]=c.dot(p[1],p[2]),g(p[2],p[2],p[1],1,-a[2]),i[2]=c.length(p[2]),c.normalize(p[2],p[2]),a[1]/=i[2],a[2]/=i[2],c.cross(m,p[1],p[2]),0>c.dot(p[0],m))for(var F=0;F<3;F++)i[F]*=-1,p[F][0]*=-1,p[F][1]*=-1,p[F][2]*=-1;return v[0]=.5*Math.sqrt(Math.max(1+p[0][0]-p[1][1]-p[2][2],0)),v[1]=.5*Math.sqrt(Math.max(1-p[0][0]+p[1][1]-p[2][2],0)),v[2]=.5*Math.sqrt(Math.max(1-p[0][0]-p[1][1]+p[2][2],0)),v[3]=.5*Math.sqrt(Math.max(1+p[0][0]+p[1][1]+p[2][2],0)),p[2][1]>p[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},4335(t){t.exports=function(t,r){var i=r[15];if(0===i)return!1;for(var n=1/i,a=0;a<16;a++)t[a]=r[a]*n;return!0}},7442(t,r,i){var n=i(6658),a=i(7182),o=i(2652),s=i(9921),l=i(8648),u=d(),c=d(),h=d();function d(){return{translate:f(),scale:f(1),skew:f(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function f(t){return[t||0,t||0,t||0]}t.exports=function(t,r,i,d){if(0===s(r)||0===s(i))return!1;var f=o(r,u.translate,u.scale,u.skew,u.perspective,u.quaternion),p=o(i,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!!f&&!!p&&(n(h.translate,u.translate,c.translate,d),n(h.skew,u.skew,c.skew,d),n(h.scale,u.scale,c.scale,d),n(h.perspective,u.perspective,c.perspective,d),l(h.quaternion,u.quaternion,c.quaternion,d),a(t,h.translate,h.scale,h.skew,h.perspective,h.quaternion),!0)}},7182(t,r,i){var n={identity:i(7894),translate:i(7656),multiply:i(6760),create:i(6864),scale:i(2504),fromRotationTranslation:i(6743)},a=(n.create(),n.create());t.exports=function(t,r,i,o,s,l){return n.identity(t),n.fromRotationTranslation(t,l,r),t[3]=s[0],t[7]=s[1],t[11]=s[2],t[15]=s[3],n.identity(a),0!==o[2]&&(a[9]=o[2],n.multiply(t,t,a)),0!==o[1]&&(a[9]=0,a[8]=o[1],n.multiply(t,t,a)),0!==o[0]&&(a[8]=0,a[4]=o[0],n.multiply(t,t,a)),n.scale(t,t,i),t}},1811(t,r,i){var n=i(2478),a=i(7442),o=i(7608),s=i(5567),l=i(2408),u=i(7089),c=i(6582),h=i(7656),d=(i(2504),i(3536)),f=[0,0,0];function p(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(t){return new p((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var m=p.prototype;m.recalcMatrix=function(t){var r=this._time,i=n.le(r,t),s=this.computedMatrix;if(!(i<0)){var l=this._components;if(i===r.length-1)for(var u=16*i,c=0;c<16;++c)s[c]=l[u++];else{for(var h=r[i+1]-r[i],u=16*i,f=this.prevMatrix,p=!0,c=0;c<16;++c)f[c]=l[u++];for(var m=this.nextMatrix,c=0;c<16;++c)m[c]=l[u++],p=p&&f[c]===m[c];if(h<1e-6||p)for(var c=0;c<16;++c)s[c]=f[c];else a(s,f,m,(t-r[i])/h)}var g=this.computedUp;g[0]=s[1],g[1]=s[5],g[2]=s[9],d(g,g);var y=this.computedInverse;o(y,s);var v=this.computedEye,x=y[15];v[0]=y[12]/x,v[1]=y[13]/x,v[2]=y[14]/x;for(var b=this.computedCenter,_=Math.exp(this.computedRadius[0]),c=0;c<3;++c)b[c]=v[c]-s[2+4*c]*_}},m.idle=function(t){if(!(t1&&0>=n(t[s[h-2]],t[s[h-1]],c);)h-=1,s.pop();for(s.push(u),h=l.length;h>1&&n(t[l[h-2]],t[l[h-1]],c)>=0;)h-=1,l.pop();l.push(u)}for(var i=Array(l.length+s.length-2),d=0,a=0,f=s.length;a0;--p)i[d++]=l[p];return i};var n=i(3250)[3]},351(t,r,i){t.exports=function(t,r){r||(r=t,t=window);var i=0,a=0,o=0,s={shift:!1,alt:!1,control:!1,meta:!1},l=!1;function u(t){var r=!1;return"altKey"in t&&(r=r||t.altKey!==s.alt,s.alt=!!t.altKey),"shiftKey"in t&&(r=r||t.shiftKey!==s.shift,s.shift=!!t.shiftKey),"ctrlKey"in t&&(r=r||t.ctrlKey!==s.control,s.control=!!t.ctrlKey),"metaKey"in t&&(r=r||t.metaKey!==s.meta,s.meta=!!t.metaKey),r}function c(t,l){var c=n.x(l),h=n.y(l);"buttons"in l&&(t=0|l.buttons),(t!==i||c!==a||h!==o||u(l))&&(i=0|t,a=c||0,o=h||0,r&&r(i,a,o,s))}function h(t){c(0,t)}function d(){(i||a||o||s.shift||s.alt||s.meta||s.control)&&(a=o=0,i=0,s.shift=s.alt=s.control=s.meta=!1,r&&r(0,0,0,s))}function f(t){u(t)&&r&&r(i,a,o,s)}function p(t){0===n.buttons(t)?c(0,t):c(i,t)}function m(t){c(i|n.buttons(t),t)}function g(t){c(i&~n.buttons(t),t)}function y(){l||(l=!0,t.addEventListener("mousemove",p),t.addEventListener("mousedown",m),t.addEventListener("mouseup",g),t.addEventListener("mouseleave",h),t.addEventListener("mouseenter",h),t.addEventListener("mouseout",h),t.addEventListener("mouseover",h),t.addEventListener("blur",d),t.addEventListener("keyup",f),t.addEventListener("keydown",f),t.addEventListener("keypress",f),t!==window&&(window.addEventListener("blur",d),window.addEventListener("keyup",f),window.addEventListener("keydown",f),window.addEventListener("keypress",f)))}y();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return l},set:function(r){r?y():l&&(l=!1,t.removeEventListener("mousemove",p),t.removeEventListener("mousedown",m),t.removeEventListener("mouseup",g),t.removeEventListener("mouseleave",h),t.removeEventListener("mouseenter",h),t.removeEventListener("mouseout",h),t.removeEventListener("mouseover",h),t.removeEventListener("blur",d),t.removeEventListener("keyup",f),t.removeEventListener("keydown",f),t.removeEventListener("keypress",f),t!==window&&(window.removeEventListener("blur",d),window.removeEventListener("keyup",f),window.removeEventListener("keydown",f),window.removeEventListener("keypress",f)))},enumerable:!0},buttons:{get:function(){return i},enumerable:!0},x:{get:function(){return a},enumerable:!0},y:{get:function(){return o},enumerable:!0},mods:{get:function(){return s},enumerable:!0}}),v};var n=i(4687)},24(t){var r={left:0,top:0};t.exports=function(t,i,n){i=i||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var a,o=t.clientX||0,s=t.clientY||0,l=(a=i)===window||a===document||a===document.body?r:a.getBoundingClientRect();return n[0]=o-l.left,n[1]=s-l.top,n}},4687(t,r){function i(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var r=t.which;if(2===r)return 4;if(3===r)return 2;if(r>0)return 1<=0)return 1<(t.scalarArguments||0)&&r("Scalar arg count must be > 0"),"function"!=typeof t.vertex&&r("Must specify vertex creation function"),"function"!=typeof t.cell&&r("Must specify cell creation function"),"function"!=typeof t.phase&&r("Must specify phase function");for(var c=t.getters||[],h=Array(u),d=0;d=0?h[d]=!0:h[d]=!1;return i=t.vertex,o=t.cell,s=t.phase,(0,a[[h,l].join(",")])(i,o,s,n.mallocUint32,n.freeUint32)};var a={"false,0,1":function(t,r,i,n,a){return function(o,s,l,u){var c,h=0|o.shape[0],d=0|o.shape[1],f=o.data,p=0|o.offset,m=0|o.stride[0],g=0|o.stride[1],y=p,v=0|-m,x=0,b=0|-g,_=0,w=-m-g|0,T=0,A=0|m,M=g-m*h|0,k=0,S=0,E=0,D=2*h|0,C=n(D),I=n(D),L=0,P=0,z=-1,F=-1,O=0,R=0|-h,B=0|h,j=0,N=-h-1|0,V=h-1|0,U=0,q=0,G=0;for(k=0;k0){if(S=1,C[L++]=i(f[y],s,l,u),y+=A,h>0)for(k=1,c=f[y],P=C[L]=i(c,s,l,u),O=C[L+z],j=C[L+R],U=C[L+N],(P!==O||P!==j||P!==U)&&(x=f[y+v],t(k,S,c,x,_=f[y+b],T=f[y+w],P,O,j,U,s,l,u),q=I[L]=E++),L+=1,y+=A,k=2;k0)for(k=1,c=f[y],P=C[L]=i(c,s,l,u),O=C[L+z],j=C[L+R],U=C[L+N],(P!==O||P!==j||P!==U)&&(x=f[y+v],t(k,S,c,x,_=f[y+b],T=f[y+w],P,O,j,U,s,l,u),q=I[L]=E++,U!==j&&r(I[L+R],q,_,T,j,U,s,l,u)),L+=1,y+=A,k=2;k0){if(k=1,C[L++]=i(f[y],s,l,u),y+=A,d>0)for(S=1,c=f[y],P=C[L]=i(c,s,l,u),j=C[L+R],O=C[L+z],U=C[L+N],(P!==j||P!==O||P!==U)&&(x=f[y+v],t(k,S,c,x,_=f[y+b],T=f[y+w],P,j,O,U,s,l,u),q=I[L]=E++),L+=1,y+=A,S=2;S0)for(S=1,c=f[y],P=C[L]=i(c,s,l,u),j=C[L+R],O=C[L+z],U=C[L+N],(P!==j||P!==O||P!==U)&&(x=f[y+v],t(k,S,c,x,_=f[y+b],T=f[y+w],P,j,O,U,s,l,u),q=I[L]=E++,U!==j&&r(I[L+R],q,T,x,U,j,s,l,u)),L+=1,y+=A,S=2;S2&&o[1]>2&&n(a.pick(-1,-1).lo(1,1).hi(o[0]-2,o[1]-2),t.pick(-1,-1,0).lo(1,1).hi(o[0]-2,o[1]-2),t.pick(-1,-1,1).lo(1,1).hi(o[0]-2,o[1]-2)),o[1]>2&&(i(a.pick(0,-1).lo(1).hi(o[1]-2),t.pick(0,-1,1).lo(1).hi(o[1]-2)),r(t.pick(0,-1,0).lo(1).hi(o[1]-2))),o[1]>2&&(i(a.pick(o[0]-1,-1).lo(1).hi(o[1]-2),t.pick(o[0]-1,-1,1).lo(1).hi(o[1]-2)),r(t.pick(o[0]-1,-1,0).lo(1).hi(o[1]-2))),o[0]>2&&(i(a.pick(-1,0).lo(1).hi(o[0]-2),t.pick(-1,0,0).lo(1).hi(o[0]-2)),r(t.pick(-1,0,1).lo(1).hi(o[0]-2))),o[0]>2&&(i(a.pick(-1,o[1]-1).lo(1).hi(o[0]-2),t.pick(-1,o[1]-1,0).lo(1).hi(o[0]-2)),r(t.pick(-1,o[1]-1,1).lo(1).hi(o[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(o[0]-1,0,0,0),t.set(o[0]-1,0,1,0),t.set(0,o[1]-1,0,0),t.set(0,o[1]-1,1,0),t.set(o[0]-1,o[1]-1,0,0),t.set(o[0]-1,o[1]-1,1,0),t}}t.exports=function(t,r,i){return(Array.isArray(i)||(i="string"==typeof i?n(r.dimension,i):n(r.dimension,"clamp")),0===r.size)?t:0===r.dimension?(t.set(0),t):(function(t){var r,i=t.join(),n=c[i];if(n)return n;for(var a=t.length,o=[h,d],s=1;s<=a;++s)o.push((r=s)in u?u[r]:u[r]=l({funcName:"fdTemplate"+r}));var n=f.apply(void 0,o);return c[i]=n,n})(i)(t,r)}},4317(t){function r(t,r){var i=Math.floor(r),n=r-i,a=0<=i&&i0;){b<64?(u=b,b=0):(u=64,b-=64);for(var _=0|t[1];_>0;){_<64?(c=_,_=0):(c=64,_-=64),n=v+b*d+_*f,s=x+b*m+_*g;var w=0,T=0,A=0,M=d-h*p,k=f-u*d,S=m-h*y,E=g-u*m;for(A=0;A0;){g<64?(u=g,g=0):(u=64,g-=64);for(var y=0|t[0];y>0;){y<64?(l=y,y=0):(l=64,y-=64),n=p+g*h+y*c,s=m+g*f+y*d;var v=0,x=0,b=c-u*h,_=d-u*f;for(x=0;x0;){x<64?(c=x,x=0):(c=64,x-=64);for(var b=0|t[0];b>0;){b<64?(l=b,b=0):(l=64,b-=64);for(var _=0|t[1];_>0;){_<64?(u=_,_=0):(u=64,_-=64),n=y+x*f+b*h+_*d,s=v+x*g+b*p+_*m;var w=0,T=0,A=0,M=h-c*f,k=d-l*h,S=p-c*g,E=m-l*p;for(A=0;Ai;){for(v=0,x=g-s,y=0;y_)break;x+=d,v+=f}for(v=g,x=g-s,y=0;y>1,H=G-V,$=G+V,W=U,Y=H,Z=G,X=$,K=q,J=a+1,Q=o-1,ee=!0,et=0,er=0,ei=0,en=r(d),ea=r(d);for(k=u*W,S=u*Y,N=l,M=0;M0){y=W,W=Y,Y=y;break}if(ei<0)break;N+=p}for(k=u*X,S=u*K,N=l,M=0;M0){y=X,X=K,K=y;break}if(ei<0)break;N+=p}for(k=u*W,S=u*Z,N=l,M=0;M0){y=W,W=Z,Z=y;break}if(ei<0)break;N+=p}for(k=u*Y,S=u*Z,N=l,M=0;M0){y=Y,Y=Z,Z=y;break}if(ei<0)break;N+=p}for(k=u*W,S=u*X,N=l,M=0;M0){y=W,W=X,X=y;break}if(ei<0)break;N+=p}for(k=u*Z,S=u*X,N=l,M=0;M0){y=Z,Z=X,X=y;break}if(ei<0)break;N+=p}for(k=u*Y,S=u*K,N=l,M=0;M0){y=Y,Y=K,K=y;break}if(ei<0)break;N+=p}for(k=u*Y,S=u*Z,N=l,M=0;M0){y=Y,Y=Z,Z=y;break}if(ei<0)break;N+=p}for(k=u*X,S=u*K,N=l,M=0;M0){y=X,X=K,K=y;break}if(ei<0)break;N+=p}for(k=u*W,S=u*Y,E=u*Z,D=u*X,C=u*K,I=u*U,L=u*G,P=u*q,j=0,N=l,M=0;M0)Q--;else if(ei<0){for(k=u*_,S=u*J,E=u*Q,N=l,M=0;M0)for(;;){for(w=l+Q*u,j=0,M=0;M0){if(--Q<_)break;continue}for(w=l+Q*u,j=0,M=0;Mq){e:for(;;){for(w=l+J*u,j=0,N=l,M=0;M1&&u?c(d,u[0],u[1]):c(d));return h(d,f)}},446(t,r,i){var n=i(7640),a={};t.exports=function(t){var r=t.order,i=t.dtype,o=[r,i].join(":"),s=a[o];return s||(a[o]=s=n(r,i)),s(t),t}},9618(t,r,i){var n=i(7163),a="u">typeof Float64Array;function o(t,r){return t[0]-r[0]}function s(){var t,r=this.stride,i=Array(r.length);for(t=0;t=0&&(r+=o*(i=0|t),a-=i),new n(this.data,a,o,r)},a.step=function(t){var r=this.shape[0],i=this.stride[0],a=this.offset,o=0,s=Math.ceil;return"number"==typeof t&&((o=0|t)<0?(a+=i*(r-1),r=s(-r/o)):r=s(r/o),i*=o),new n(this.data,r,i,a)},a.transpose=function(t){t=void 0===t?0:0|t;var r=this.shape,i=this.stride;return new n(this.data,r[t],i[t],this.offset)},a.pick=function(t){var i=[],n=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(i.push(this.shape[0]),n.push(this.stride[0])),(0,r[i.length+1])(this.data,i,n,a)},function(t,r,i,a){return new n(t,r[0],i[0],a)}},2:function(t,r,i){function n(t,r,i,n,a,o){this.data=t,this.shape=[r,i],this.stride=[n,a],this.offset=0|o}var a=n.prototype;return a.dtype=t,a.dimension=2,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(a,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),a.set=function(r,i,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*r+this.stride[1]*i,n):this.data[this.offset+this.stride[0]*r+this.stride[1]*i]=n},a.get=function(r,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*r+this.stride[1]*i):this.data[this.offset+this.stride[0]*r+this.stride[1]*i]},a.index=function(t,r){return this.offset+this.stride[0]*t+this.stride[1]*r},a.hi=function(t,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof r||r<0?this.shape[1]:0|r,this.stride[0],this.stride[1],this.offset)},a.lo=function(t,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.stride[0],u=this.stride[1];return"number"==typeof t&&t>=0&&(i+=l*(a=0|t),o-=a),"number"==typeof r&&r>=0&&(i+=u*(a=0|r),s-=a),new n(this.data,o,s,l,u,i)},a.step=function(t,r){var i=this.shape[0],a=this.shape[1],o=this.stride[0],s=this.stride[1],l=this.offset,u=0,c=Math.ceil;return"number"==typeof t&&((u=0|t)<0?(l+=o*(i-1),i=c(-i/u)):i=c(i/u),o*=u),"number"==typeof r&&((u=0|r)<0?(l+=s*(a-1),a=c(-a/u)):a=c(a/u),s*=u),new n(this.data,i,a,o,s,l)},a.transpose=function(t,r){t=void 0===t?0:0|t,r=void 0===r?1:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[t],i[r],a[t],a[r],this.offset)},a.pick=function(t,i){var n=[],a=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(n.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof i&&i>=0?o=o+this.stride[1]*i|0:(n.push(this.shape[1]),a.push(this.stride[1])),(0,r[n.length+1])(this.data,n,a,o)},function(t,r,i,a){return new n(t,r[0],r[1],i[0],i[1],a)}},3:function(t,r,i){function n(t,r,i,n,a,o,s,l){this.data=t,this.shape=[r,i,n],this.stride=[a,o,s],this.offset=0|l}var a=n.prototype;return a.dtype=t,a.dimension=3,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(a,"order",{get:function(){var t=Math.abs(this.stride[0]),r=Math.abs(this.stride[1]),i=Math.abs(this.stride[2]);return t>r?r>i?[2,1,0]:t>i?[1,2,0]:[1,0,2]:t>i?[2,0,1]:i>r?[0,1,2]:[0,2,1]}}),a.set=function(r,i,n,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n,a):this.data[this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n]=a},a.get=function(r,i,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n):this.data[this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n]},a.index=function(t,r,i){return this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i},a.hi=function(t,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof r||r<0?this.shape[1]:0|r,"number"!=typeof i||i<0?this.shape[2]:0|i,this.stride[0],this.stride[1],this.stride[2],this.offset)},a.lo=function(t,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.stride[0],h=this.stride[1],d=this.stride[2];return"number"==typeof t&&t>=0&&(a+=c*(o=0|t),s-=o),"number"==typeof r&&r>=0&&(a+=h*(o=0|r),l-=o),"number"==typeof i&&i>=0&&(a+=d*(o=0|i),u-=o),new n(this.data,s,l,u,c,h,d,a)},a.step=function(t,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.stride[0],u=this.stride[1],c=this.stride[2],h=this.offset,d=0,f=Math.ceil;return"number"==typeof t&&((d=0|t)<0?(h+=l*(a-1),a=f(-a/d)):a=f(a/d),l*=d),"number"==typeof r&&((d=0|r)<0?(h+=u*(o-1),o=f(-o/d)):o=f(o/d),u*=d),"number"==typeof i&&((d=0|i)<0?(h+=c*(s-1),s=f(-s/d)):s=f(s/d),c*=d),new n(this.data,a,o,s,l,u,c,h)},a.transpose=function(t,r,i){t=void 0===t?0:0|t,r=void 0===r?1:0|r,i=void 0===i?2:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[t],a[r],a[i],o[t],o[r],o[i],this.offset)},a.pick=function(t,i,n){var a=[],o=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof i&&i>=0?s=s+this.stride[1]*i|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),(0,r[a.length+1])(this.data,a,o,s)},function(t,r,i,a){return new n(t,r[0],r[1],r[2],i[0],i[1],i[2],a)}},4:function(t,r,i){function n(t,r,i,n,a,o,s,l,u,c){this.data=t,this.shape=[r,i,n,a],this.stride=[o,s,l,u],this.offset=0|c}var a=n.prototype;return a.dtype=t,a.dimension=4,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(a,"order",{get:i}),a.set=function(r,i,n,a,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n+this.stride[3]*a,o):this.data[this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n+this.stride[3]*a]=o},a.get=function(r,i,n,a){return"generic"===t?this.data.get(this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n+this.stride[3]*a):this.data[this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n+this.stride[3]*a]},a.index=function(t,r,i,n){return this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n},a.hi=function(t,r,i,a){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof r||r<0?this.shape[1]:0|r,"number"!=typeof i||i<0?this.shape[2]:0|i,"number"!=typeof a||a<0?this.shape[3]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},a.lo=function(t,r,i,a){var o=this.offset,s=0,l=this.shape[0],u=this.shape[1],c=this.shape[2],h=this.shape[3],d=this.stride[0],f=this.stride[1],p=this.stride[2],m=this.stride[3];return"number"==typeof t&&t>=0&&(o+=d*(s=0|t),l-=s),"number"==typeof r&&r>=0&&(o+=f*(s=0|r),u-=s),"number"==typeof i&&i>=0&&(o+=p*(s=0|i),c-=s),"number"==typeof a&&a>=0&&(o+=m*(s=0|a),h-=s),new n(this.data,l,u,c,h,d,f,p,m,o)},a.step=function(t,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],u=this.shape[3],c=this.stride[0],h=this.stride[1],d=this.stride[2],f=this.stride[3],p=this.offset,m=0,g=Math.ceil;return"number"==typeof t&&((m=0|t)<0?(p+=c*(o-1),o=g(-o/m)):o=g(o/m),c*=m),"number"==typeof r&&((m=0|r)<0?(p+=h*(s-1),s=g(-s/m)):s=g(s/m),h*=m),"number"==typeof i&&((m=0|i)<0?(p+=d*(l-1),l=g(-l/m)):l=g(l/m),d*=m),"number"==typeof a&&((m=0|a)<0?(p+=f*(u-1),u=g(-u/m)):u=g(u/m),f*=m),new n(this.data,o,s,l,u,c,h,d,f,p)},a.transpose=function(t,r,i,a){t=void 0===t?0:0|t,r=void 0===r?1:0|r,i=void 0===i?2:0|i,a=void 0===a?3:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[t],o[r],o[i],o[a],s[t],s[r],s[i],s[a],this.offset)},a.pick=function(t,i,n,a){var o=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof i&&i>=0?l=l+this.stride[1]*i|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof a&&a>=0?l=l+this.stride[3]*a|0:(o.push(this.shape[3]),s.push(this.stride[3])),(0,r[o.length+1])(this.data,o,s,l)},function(t,r,i,a){return new n(t,r[0],r[1],r[2],r[3],i[0],i[1],i[2],i[3],a)}},5:function(t,r,i){function n(t,r,i,n,a,o,s,l,u,c,h,d){this.data=t,this.shape=[r,i,n,a,o],this.stride=[s,l,u,c,h],this.offset=0|d}var a=n.prototype;return a.dtype=t,a.dimension=5,Object.defineProperty(a,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(a,"order",{get:i}),a.set=function(r,i,n,a,o,s){return"generic"===t?this.data.set(this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n+this.stride[3]*a+this.stride[4]*o,s):this.data[this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n+this.stride[3]*a+this.stride[4]*o]=s},a.get=function(r,i,n,a,o){return"generic"===t?this.data.get(this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n+this.stride[3]*a+this.stride[4]*o):this.data[this.offset+this.stride[0]*r+this.stride[1]*i+this.stride[2]*n+this.stride[3]*a+this.stride[4]*o]},a.index=function(t,r,i,n,a){return this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*i+this.stride[3]*n+this.stride[4]*a},a.hi=function(t,r,i,a,o){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof r||r<0?this.shape[1]:0|r,"number"!=typeof i||i<0?this.shape[2]:0|i,"number"!=typeof a||a<0?this.shape[3]:0|a,"number"!=typeof o||o<0?this.shape[4]:0|o,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},a.lo=function(t,r,i,a,o){var s=this.offset,l=0,u=this.shape[0],c=this.shape[1],h=this.shape[2],d=this.shape[3],f=this.shape[4],p=this.stride[0],m=this.stride[1],g=this.stride[2],y=this.stride[3],v=this.stride[4];return"number"==typeof t&&t>=0&&(s+=p*(l=0|t),u-=l),"number"==typeof r&&r>=0&&(s+=m*(l=0|r),c-=l),"number"==typeof i&&i>=0&&(s+=g*(l=0|i),h-=l),"number"==typeof a&&a>=0&&(s+=y*(l=0|a),d-=l),"number"==typeof o&&o>=0&&(s+=v*(l=0|o),f-=l),new n(this.data,u,c,h,d,f,p,m,g,y,v,s)},a.step=function(t,r,i,a,o){var s=this.shape[0],l=this.shape[1],u=this.shape[2],c=this.shape[3],h=this.shape[4],d=this.stride[0],f=this.stride[1],p=this.stride[2],m=this.stride[3],g=this.stride[4],y=this.offset,v=0,x=Math.ceil;return"number"==typeof t&&((v=0|t)<0?(y+=d*(s-1),s=x(-s/v)):s=x(s/v),d*=v),"number"==typeof r&&((v=0|r)<0?(y+=f*(l-1),l=x(-l/v)):l=x(l/v),f*=v),"number"==typeof i&&((v=0|i)<0?(y+=p*(u-1),u=x(-u/v)):u=x(u/v),p*=v),"number"==typeof a&&((v=0|a)<0?(y+=m*(c-1),c=x(-c/v)):c=x(c/v),m*=v),"number"==typeof o&&((v=0|o)<0?(y+=g*(h-1),h=x(-h/v)):h=x(h/v),g*=v),new n(this.data,s,l,u,c,h,d,f,p,m,g,y)},a.transpose=function(t,r,i,a,o){t=void 0===t?0:0|t,r=void 0===r?1:0|r,i=void 0===i?2:0|i,a=void 0===a?3:0|a,o=void 0===o?4:0|o;var s=this.shape,l=this.stride;return new n(this.data,s[t],s[r],s[i],s[a],s[o],l[t],l[r],l[i],l[a],l[o],this.offset)},a.pick=function(t,i,n,a,o){var s=[],l=[],u=this.offset;return"number"==typeof t&&t>=0?u=u+this.stride[0]*t|0:(s.push(this.shape[0]),l.push(this.stride[0])),"number"==typeof i&&i>=0?u=u+this.stride[1]*i|0:(s.push(this.shape[1]),l.push(this.stride[1])),"number"==typeof n&&n>=0?u=u+this.stride[2]*n|0:(s.push(this.shape[2]),l.push(this.stride[2])),"number"==typeof a&&a>=0?u=u+this.stride[3]*a|0:(s.push(this.shape[3]),l.push(this.stride[3])),"number"==typeof o&&o>=0?u=u+this.stride[4]*o|0:(s.push(this.shape[4]),l.push(this.stride[4])),(0,r[s.length+1])(this.data,s,l,u)},function(t,r,i,a){return new n(t,r[0],r[1],r[2],r[3],r[4],i[0],i[1],i[2],i[3],i[4],a)}}},u={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,r,i,o){if(void 0===t){var c=u.array[0];return c([])}"number"==typeof t&&(t=[t]),void 0===r&&(r=[t.length]);var h=r.length;if(void 0===i){i=Array(h);for(var d=h-1,f=1;d>=0;--d)i[d]=f,f*=r[d]}if(void 0===o){o=0;for(var d=0;dt==t>0?0xffffffff===a?(i+=1,a=0):a+=1:0===a?(a=0xffffffff,i-=1):a-=1,n.pack(a,i)}},8406(t,r){r.vertexNormals=function(t,r,i){for(var n=r.length,a=Array(n),o=void 0===i?1e-6:i,s=0;so)for(var _=a[c],w=1/Math.sqrt(y*x),b=0;b<3;++b){var T=(b+1)%3,A=(b+2)%3;_[b]+=w*(v[T]*g[A]-v[A]*g[T])}}for(var s=0;so)for(var w=1/Math.sqrt(M),b=0;b<3;++b)_[b]*=w;else for(var b=0;b<3;++b)_[b]=0}return a},r.faceNormals=function(t,r,i){for(var n=t.length,a=Array(n),o=void 0===i?1e-6:i,s=0;so?1/Math.sqrt(p):0;for(var c=0;c<3;++c)f[c]*=p;a[s]=f}return a}},4081(t){t.exports=function(t,r,i,n,a,o,s,l,u,c){var h=r+o+c;if(d>0){var d=Math.sqrt(h+1);t[0]=.5*(s-u)/d,t[1]=.5*(l-n)/d,t[2]=.5*(i-o)/d,t[3]=.5*d}else{var f=Math.max(r,o,c),d=Math.sqrt(2*f-h+1);r>=f?(t[0]=.5*d,t[1]=.5*(a+i)/d,t[2]=.5*(l+n)/d,t[3]=.5*(s-u)/d):o>=f?(t[0]=.5*(i+a)/d,t[1]=.5*d,t[2]=.5*(u+s)/d,t[3]=.5*(l-n)/d):(t[0]=.5*(n+l)/d,t[1]=.5*(s+u)/d,t[2]=.5*d,t[3]=.5*(i-a)/d)}return t}},9977(t,r,i){t.exports=function(t){var r=(t=t||{}).center||[0,0,0],i=t.rotation||[0,0,0,1],n=t.radius||1;r=[].slice.call(r,0,3),h(i=[].slice.call(i,0,4),i);var a=new d(i,r,Math.log(n));return a.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&a.lookAt(0,t.eye,t.center,t.up),a};var n=i(9215),a=i(6582),o=i(7399),s=i(7608),l=i(4081);function u(t,r,i){return Math.sqrt(Math.pow(t,2)+Math.pow(r,2)+Math.pow(i,2))}function c(t,r,i,n){return Math.sqrt(Math.pow(t,2)+Math.pow(r,2)+Math.pow(i,2)+Math.pow(n,2))}function h(t,r){var i=r[0],n=r[1],a=r[2],o=r[3],s=c(i,n,a,o);s>1e-6?(t[0]=i/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function d(t,r,i){this.radius=n([i]),this.center=n(r),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var f=d.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var r=this.computedRotation;h(r,r);var i=this.computedMatrix;o(i,r);var n=this.computedCenter,a=this.computedEye,s=this.computedUp,l=Math.exp(this.computedRadius[0]);a[0]=n[0]+l*i[2],a[1]=n[1]+l*i[6],a[2]=n[2]+l*i[10],s[0]=i[1],s[1]=i[5],s[2]=i[9];for(var u=0;u<3;++u){for(var c=0,d=0;d<3;++d)c+=i[u+4*d]*a[d];i[12+u]=-c}},f.getMatrix=function(t,r){this.recalcMatrix(t);var i=this.computedMatrix;if(r){for(var n=0;n<16;++n)r[n]=i[n];return r}return i},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,r,i,n){r=r||0,i=i||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=u(o,s,l);o/=c,s/=c,l/=c;var h=a[0],d=a[4],f=a[8],p=h*o+d*s+f*l;h-=o*p;var m=u(h,d-=s*p,f-=l*p);h/=m,d/=m,f/=m;var g=a[2],y=a[6],v=a[10],x=g*o+y*s+v*l,b=g*h+y*d+v*f;g-=x*o+b*h;var _=u(g,y-=x*s+b*d,v-=x*l+b*f);g/=_,y/=_,v/=_;var w=h*r+o*i,T=d*r+s*i,A=f*r+l*i;this.center.move(t,w,T,A);var M=Math.exp(this.computedRadius[0]);M=Math.max(1e-4,M+n),this.radius.set(t,Math.log(M))},f.rotate=function(t,r,i,n){this.recalcMatrix(t),r=r||0,i=i||0;var a=this.computedMatrix,o=a[0],s=a[4],l=a[8],h=a[1],d=a[5],f=a[9],p=a[2],m=a[6],g=a[10],y=r*o+i*h,v=r*s+i*d,x=r*l+i*f,b=-(m*x-g*v),_=-(g*y-p*x),w=-(p*v-m*y),T=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(_,2)-Math.pow(w,2))),A=c(b,_,w,T);A>1e-6?(b/=A,_/=A,w/=A,T/=A):(b=_=w=0,T=1);var M=this.computedRotation,k=M[0],S=M[1],E=M[2],D=M[3],C=k*T+D*b+S*w-E*_,I=S*T+D*_+E*b-k*w,L=E*T+D*w+k*_-S*b,P=D*T-k*b-S*_-E*w;if(n){b=p;var z=Math.sin(n)/u(b,_=m,w=g);b*=z,_*=z,w*=z,C=C*(T=Math.cos(r))+P*b+I*w-L*_,I=I*T+P*_+L*b-C*w,L=L*T+P*w+C*_-I*b,P=P*T-C*b-I*_-L*w}var F=c(C,I,L,P);F>1e-6?(C/=F,I/=F,L/=F,P/=F):(C=I=L=0,P=1),this.rotation.set(t,C,I,L,P)},f.lookAt=function(t,r,i,n){this.recalcMatrix(t),i=i||this.computedCenter,r=r||this.computedEye,n=n||this.computedUp;var o=this.computedMatrix;a(o,r,i,n);var s=this.computedRotation;l(s,o[0],o[1],o[2],o[4],o[5],o[6],o[8],o[9],o[10]),h(s,s),this.rotation.set(t,s[0],s[1],s[2],s[3]);for(var u=0,c=0;c<3;++c)u+=Math.pow(i[c]-r[c],2);this.radius.set(t,.5*Math.log(Math.max(u,1e-6))),this.center.set(t,i[0],i[1],i[2])},f.translate=function(t,r,i,n){this.center.move(t,r||0,i||0,n||0)},f.setMatrix=function(t,r){var i=this.computedRotation;l(i,r[0],r[1],r[2],r[4],r[5],r[6],r[8],r[9],r[10]),h(i,i),this.rotation.set(t,i[0],i[1],i[2],i[3]);var n=this.computedMatrix;s(n,r);var a=n[15];if(Math.abs(a)>1e-6){var o=n[12]/a,u=n[13]/a,c=n[14]/a;this.recalcMatrix(t);var d=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*d,u-n[6]*d,c-n[10]*d),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,r){r>0&&this.radius.set(t,Math.log(r))},f.setDistanceLimits=function(t,r){t=t>0?Math.log(t):-1/0,r=Math.max(r=r>0?Math.log(r):1/0,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=r},f.getDistanceLimits=function(t){var r=this.radius.bounds;return t?(t[0]=Math.exp(r[0][0]),t[1]=Math.exp(r[1][0]),t):[Math.exp(r[0][0]),Math.exp(r[1][0])]},f.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},f.fromJSON=function(t){var r=this.lastT(),i=t.center;i&&this.center.set(r,i[0],i[1],i[2]);var n=t.rotation;n&&this.rotation.set(r,n[0],n[1],n[2],n[3]);var a=t.distance;a&&a>0&&this.radius.set(r,Math.log(a)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},1371(t,r,i){var n=i(3233);t.exports=function(t,r,i){return n(i="u">typeof i?i+"":" ",r)+t}},3202(t){t.exports=function(t,r){r||(r=[0,""]);var i=parseFloat(t=String(t),10);return r[0]=i,r[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",r}},3088(t,r,i){t.exports=function(t,r){for(var i=0|r.length,a=t.length,o=[Array(i),Array(i)],s=0;s0){s=o[h][i][0],u=h;break}l=s[1^u];for(var d=0;d<2;++d)for(var f=o[d][i],p=0;p0&&(s=m,l=g,u=d)}return a||s&&c(s,u),l}for(var s=0;s0;){o[0][s].length;var p=function(t,i){var a=o[i][t][0],s=[t];c(a,i);for(var l=a[1^i];;){for(;l!==t;)s.push(l),l=h(s[s.length-2],l,!1);if(o[0][t].length+o[1][t].length===0)break;var u=s[s.length-1],d=s[1],f=h(u,t,!0);if(0>n(r[u],r[t],r[d],r[f]))break;s.push(t),l=h(u,t)}return s}(s,d);p[1]===p[p.length-1]?f.push.apply(f,p):(f.length>0&&u.push(f),f=p)}f.length>0&&u.push(f)}return u};var n=i(3140)},5609(t,r,i){t.exports=function(t,r){for(var i=n(t,r.length),a=Array(r.length),o=Array(r.length),s=[],l=0;l0;){var c=s.pop();a[c]=!1;for(var h=i[c],l=0;l0});for(var g=m.length,y=Array(g),v=Array(g),p=0;p0;){var j=R.pop(),N=D[j];u(N,function(t,r){return t-r});var V,U=N.length,q=B[j];if(0===q){var T=m[j];V=[T]}for(var p=0;p=0)&&(B[G]=1^q,R.push(G),0===q)){var T=m[G];O(T)||(T.reverse(),V.push(T))}}0===q&&i.push(V)}return i};var n=i(3134),a=i(3088),o=i(5085),s=i(5250),l=i(8210),u=i(1682),c=i(5609);function h(t,r){for(var i=Array(t),n=0;n0)||o[r]!==t[0])return 1;else a=i[r-1];for(var l=1;a;){var u=a.key,c=n(t,u[0],u[1]);if(u[0][0]0))return 0;l=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;l=1,a=a.right}}return l});return 0===f.length?w:(l=u(f),function(t){return l(t[0],t[1])?0:w(t)})};var n=i(3250)[3],a=i(4209),o=i(3352),s=i(2478);function l(){return!0}function u(t){for(var r={},i=0;i=p?(M=1,T=p+2*y+x):(M=-y/p,T=y*M+x)):(M=0,v>=0?(k=0,T=x):-v>=g?(k=1,T=g+2*v+x):(k=-v/g,T=v*k+x));else if(k<0)k=0,y>=0?(M=0,T=x):-y>=p?(M=1,T=p+2*y+x):(M=-y/p,T=y*M+x);else{var S=1/A;M*=S,k*=S,T=M*(p*M+m*k+2*y)+k*(m*M+g*k+2*v)+x}else M<0?(u=m+y,(c=g+v)>u?(h=c-u)>=(d=p-2*m+g)?(M=1,k=0,T=p+2*y+x):(k=1-(M=h/d),T=M*(p*M+m*k+2*y)+k*(m*M+g*k+2*v)+x):(M=0,c<=0?(k=1,T=g+2*v+x):v>=0?(k=0,T=x):(k=-v/g,T=v*k+x))):k<0?(u=m+v,(c=p+y)>u?(h=c-u)>=(d=p-2*m+g)?(k=1,M=0,T=g+2*v+x):T=(M=1-(k=h/d))*(p*M+m*k+2*y)+k*(m*M+g*k+2*v)+x:(k=0,c<=0?(M=1,T=p+2*y+x):y>=0?(M=0,T=x):(M=-y/p,T=y*M+x))):(h=g+v-m-y)<=0?(M=0,k=1,T=g+2*v+x):h>=(d=p-2*m+g)?(M=1,k=0,T=p+2*y+x):(k=1-(M=h/d),T=M*(p*M+m*k+2*y)+k*(m*M+g*k+2*v)+x);for(var E=1-M-k,f=0;f0){var c=t[i-1];if(0===n(l,c)&&o(c)!==u){i-=1;continue}}t[i++]=l}}return t.length=i,t}},3233(t){var r,i="";t.exports=function(t,n){if("string"!=typeof t)throw TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var a=t.length*n;if(r!==t||typeof r>"u")r=t,i="";else if(i.length>=a)return i.substr(0,a);for(;a>i.length&&n>1;)1&n&&(i+=t),n>>=1,t+=t;return i+=t,i=i.substr(0,a)}},3025(t,r,i){t.exports=i.g.performance&&i.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004(t){t.exports=function(t){for(var r=t.length,i=t[t.length-1],n=r,a=r-2;a>=0;--a){var o=i,s=t[a],l=(i=o+s)-o,u=s-l;u&&(t[--n]=i,i=u)}for(var c=0,a=n;a0){if(o<=0)return s;n=a+o}else{if(!(a<0)||o>=0)return s;n=-(a+o)}var u=l*n;return s>=u||s<=-u?s:h(t,r,i)},function(t,r,i,n){var a=t[0]-n[0],o=r[0]-n[0],s=i[0]-n[0],l=t[1]-n[1],c=r[1]-n[1],h=i[1]-n[1],f=t[2]-n[2],p=r[2]-n[2],m=i[2]-n[2],g=o*h,y=s*c,v=s*l,x=a*h,b=a*c,_=o*l,w=f*(g-y)+p*(v-x)+m*(b-_),T=u*((Math.abs(g)+Math.abs(y))*Math.abs(f)+(Math.abs(v)+Math.abs(x))*Math.abs(p)+(Math.abs(b)+Math.abs(_))*Math.abs(m));return w>T||-w>T?w:d(t,r,i,n)}];f.length<=5;)f.push(c(f.length));t.exports=(function(t,r,i,n,a,o,s){return function(r,i,l,u,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(r,i);case 3:return a(r,i,l);case 4:return o(r,i,l,u);case 5:return s(r,i,l,u,c)}for(var h=Array(arguments.length),d=0;d0&&s>0||o<0&&s<0)return!1;var l=n(i,t,r),u=n(a,t,r);return(!(l>0)||!(u>0))&&(!(l<0)||!(u<0))&&(0!==o||0!==s||0!==l||0!==u||function(t,r,i,n){for(var a=0;a<2;++a){var o=t[a],s=r[a],l=Math.min(o,s),u=Math.max(o,s),c=i[a],h=n[a],d=Math.min(c,h);if(Math.max(c,h)=n?(c=y,(p+=1)=n?(c=y,(p+=1)"u"&&(l=function(t){for(var r=t.length,i=0,n=0;n>1,c=r[2*u+1];if(c===o)return u;o>1,c=r[2*u+1];if(c===o)return u;o>1,c=r[2*u+1];if(c===o)return u;o0)-(t<0)},r.abs=function(t){var r=t>>31;return(t^r)-r},r.min=function(t,r){return r^(t^r)&-(t65535)<<4,t>>>=r,i=(t>255)<<3,t>>>=i,r|=i,i=(t>15)<<2,t>>>=i,r|=i,i=(t>3)<<1,t>>>=i,(r|=i)|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:+(t>=10)},r.popCount=function(t){return t-=t>>>1&0x55555555,((t=(0x33333333&t)+(t>>>2&0x33333333))+(t>>>4)&0xf0f0f0f)*0x1010101>>>24},r.countTrailingZeros=i,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=Array(256);(function(t){for(var r=0;r<256;++r){var i=r,n=r,a=7;for(i>>>=1;i;i>>>=1)n<<=1,n|=1&i,--a;t[r]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},r.interleave2=function(t,r){return t&=65535,r&=65535,(t=((t=((t=((t=(t|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(r=((r=((r=((r=(r|r<<8)&0xff00ff)|r<<4)&0xf0f0f0f)|r<<2)&0x33333333)|r<<1)&0x55555555)<<1},r.deinterleave2=function(t,r){return(t=((t=((t=((t=((t=t>>>r&0x55555555)|t>>>1)&0x33333333)|t>>>2)&0xf0f0f0f)|t>>>4)&0xff00ff)|t>>>16)&65535)<<16>>16},r.interleave3=function(t,r,i){return t&=1023,r&=1023,i&=1023,i=((i=((i=((i=(i|i<<16)&0xff0000ff)|i<<8)&0xf00f00f)|i<<4)&0xc30c30c3)|i<<2)&0x49249249,(t=((t=((t=((t=(t|t<<16)&0xff0000ff)|t<<8)&0xf00f00f)|t<<4)&0xc30c30c3)|t<<2)&0x49249249|(r=((r=((r=((r=(r|r<<16)&0xff0000ff)|r<<8)&0xf00f00f)|r<<4)&0xc30c30c3)|r<<2)&0x49249249)<<1)|i<<2},r.deinterleave3=function(t,r){return(t=((t=((t=((t=((t=t>>>r&0x49249249)|t>>>2)&0xc30c30c3)|t>>>4)&0xf00f00f)|t>>>8)&0xff0000ff)|t>>>16)&1023)<<22>>22},r.nextCombination=function(t){var r=t|t-1;return r+1|(~r&-~r)-1>>>i(t)+1}},2014(t,r,i){var n=i(3105),a=i(4623);function o(t,r){var i=t.length,n=t.length-r.length,a=Math.min;if(n)return n;switch(i){case 0:return 0;case 1:return t[0]-r[0];case 2:var o=t[0]+t[1]-r[0]-r[1];return o||a(t[0],t[1])-a(r[0],r[1]);case 3:var s=t[0]+t[1],l=r[0]+r[1];if(o=s+t[2]-(l+r[2]))return o;var u=a(t[0],t[1]),c=a(r[0],r[1]),o=a(u,t[2])-a(c,r[2]);return o||a(u+t[2],s)-a(c+r[2],l);default:var h=t.slice(0);h.sort();var d=r.slice(0);d.sort();for(var f=0;f>1,l=o(t[s],r);l<=0?(0===l&&(a=s),i=s+1):l>0&&(n=s-1)}return a}function h(t,r){for(var i=Array(t.length),a=0,s=i.length;a=t.length||0!==o(t[y],l)););}return i}function d(t,r){if(r<0)return[];for(var i=[],a=(1<>>h&1&&c.push(a[h]);r.push(c)}return l(r)},r.skeleton=d,r.boundary=function(t){for(var r=[],i=0,n=t.length;i0;){var i,n=1&(i=t)?i-1>>1:(i>>1)-1;if(n>=0&&r0){var t=T[0];return y(0,M-1),M-=1,x(0),t}return -1}function w(t,r){var i=T[t];return c[i]===r?t:(c[i]=-1/0,b(t),_(),c[i]=r,b((M+=1)-1))}for(var T=[],A=Array(o),d=0;d>1;d>=0;--d)x(d);for(;;){var k=_();if(k<0||c[k]>i)break;!function(t){if(!h[t]){h[t]=!0;var r=l[t],i=u[t];l[i]>=0&&(l[i]=r),u[r]>=0&&(u[r]=i),A[r]>=0&&w(A[r],g(r)),A[i]>=0&&w(A[i],g(i))}}(k)}for(var S=[],d=0;d=0&&i>=0&&r!==i){var n=A[r],a=A[i];n!==a&&D.push([n,a])}}),a.unique(a.normalize(D)),{positions:S,edges:D}};var n=i(3250),a=i(2014)},1303(t,r,i){t.exports=function(t,r){if(r[0][0]r[1][0]))return a(r,t);i=r[1],o=r[0]}if(t[0][0]t[1][0]))return-a(t,r);s=t[1],l=t[0]}var i,o,s,l,u=n(i,o,l),c=n(i,o,s);if(u<0){if(c<=0)return u}else if(u>0){if(c>=0)return u}else if(c)return c;if(u=n(l,s,o),c=n(l,s,i),u<0){if(c<=0)return u}else if(u>0){if(c>=0)return u}else if(c)return c;return o[0]-l[0]};var n=i(3250);function a(t,r){if(r[0][0]r[1][0])i=r[1],a=r[0];else{var i,a,o,s,l=Math.min(t[0][1],t[1][1]),u=Math.max(t[0][1],t[1][1]),c=Math.min(r[0][1],r[1][1]),h=Math.max(r[0][1],r[1][1]);return uh?l-h:u-h}t[0][1]0)if(r[0]!==s[1][0])i=t,t=t.right;else{var u=c(t.right,r);if(u)return u;t=t.left}else{if(r[0]!==s[1][0])return t;var u=c(t.right,r);if(u)return u;t=t.left}}return i}function h(t,r,i,n){this.y=t,this.index=r,this.start=i,this.closed=n}function d(t,r,i,n){this.x=t,this.segment=r,this.create=i,this.index=n}l.prototype.castUp=function(t){var r=n.le(this.coordinates,t[0]);if(r<0)return -1;this.slabs[r];var i=c(this.slabs[r],t),a=-1;if(i&&(a=i.value),this.coordinates[r]===t[0]){var l=null;if(i&&(l=i.key),r>0){var h=c(this.slabs[r-1],t);h&&(l?s(h.key,l)>0&&(l=h.key,a=h.value):(a=h.value,l=h.key))}var d=this.horizontal[r];if(d.length>0){var f=n.ge(d,t[1],u);if(f=d.length)return a;p=d[f]}}if(p.start)if(l){var m=o(l[0],l[1],[t[0],p.y]);l[0][0]>l[1][0]&&(m=-m),m>0&&(a=p.index)}else a=p.index;else p.y!==t[1]&&(a=p.index)}}}return a}},5202(t,r,i){var n=i(1944),a=i(8210);function o(t,r){var i=a(n(t,r),[r[r.length-1]]);return i[i.length-1]}function s(t,r,i,n){var a=-r/(n-r);a<0?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=Array(s),u=0;u0||a>0&&h<0){var d=s(l,h,u,a);i.push(d),n.push(d.slice())}h<0?n.push(u.slice()):h>0?i.push(u.slice()):(i.push(u.slice()),n.push(u.slice())),a=h}return{positive:i,negative:n}},t.exports.positive=function(t,r){for(var i=[],n=o(t[t.length-1],r),a=t[t.length-1],l=t[0],u=0;u0||n>0&&c<0)&&i.push(s(a,c,l,n)),c>=0&&i.push(l.slice()),n=c}return i},t.exports.negative=function(t,r){for(var i=[],n=o(t[t.length-1],r),a=t[t.length-1],l=t[0],u=0;u0||n>0&&c<0)&&i.push(s(a,c,l,n)),c<=0&&i.push(l.slice()),n=c}return i}},3387(t,r,i){var n;!function(){var a=/[^T]/,o=/[^v]/,s=/[diefg]/,l=/[bcdiefguxX]/,u=/[j]/,c=/^[^\x25]+/,h=/^\x25{2}/,d=/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,f=/^([a-z_][a-z_\d]*)/i,p=/^\.([a-z_][a-z_\d]*)/i,m=/^\[(\d+)\]/,g=/^[+-]/;function y(t){return function(t,r){var i,n,c,h,d,f,p,m,v,x=1,b=t.length,_="";for(n=0;n=0),h.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,h.width?parseInt(h.width):0);break;case"e":i=h.precision?parseFloat(i).toExponential(h.precision):parseFloat(i).toExponential();break;case"f":i=h.precision?parseFloat(i).toFixed(h.precision):parseFloat(i);break;case"g":i=h.precision?String(Number(i.toPrecision(h.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=h.precision?i.substring(0,h.precision):i;break;case"t":i=String(!!i),i=h.precision?i.substring(0,h.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=h.precision?i.substring(0,h.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=h.precision?i.substring(0,h.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}u.test(h.type)?_+=i:(s.test(h.type)&&(!m||h.sign)?(v=m?"+":"-",i=i.toString().replace(g,"")):v="",f=h.pad_char?"0"===h.pad_char?"0":h.pad_char.charAt(1):" ",p=h.width-(v+i).length,d=h.width&&p>0?f.repeat(p):"",_+=h.align?v+i+d:"0"===f?v+d+i:d+v+i)}return _}(function(t){if(x[t])return x[t];for(var r,i=t,n=[],a=0;i;){if(null!==(r=c.exec(i)))n.push(r[0]);else if(null!==(r=h.exec(i)))n.push("%");else if(null!==(r=d.exec(i))){if(r[2]){a|=1;var o=[],s=r[2],l=[];if(null!==(l=f.exec(s)))for(o.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=p.exec(s)))o.push(l[1]);else if(null!==(l=m.exec(s)))o.push(l[1]);else throw SyntaxError("[sprintf] failed to parse named argument key");else throw SyntaxError("[sprintf] failed to parse named argument key");r[2]=o}else a|=2;if(3===a)throw Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}else throw SyntaxError("[sprintf] unexpected placeholder");i=i.substring(r[0].length)}return x[t]=n}(t),arguments)}function v(t,r){return y.apply(null,[t].concat(r||[]))}var x=Object.create(null);r.sprintf=y,r.vsprintf=v,"u">typeof window&&(window.sprintf=y,window.vsprintf=v,void 0!==(n=(function(){return{sprintf:y,vsprintf:v}}).call(r,i,r,t))&&(t.exports=n))}()},3711(t,r,i){t.exports=function(t,r){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,r){for(var i=a(t,r),n=i.length,o=Array(n),s=Array(n),l=0;ln|0},vertex:function(t,r,i,n,a,o,s,l,u,c,h,d,f){var p=(0|s)+(l<<1)+(u<<2)+(c<<3)|0;if(0!==p&&15!==p)switch(p){case 0:case 15:h.push([t-.5,r-.5]);break;case 1:h.push([t-.25-.25*(n+i-2*f)/(i-n),r-.25-.25*(a+i-2*f)/(i-a)]);break;case 2:h.push([t-.75-.25*(-n-i+2*f)/(n-i),r-.25-.25*(o+n-2*f)/(n-o)]);break;case 3:h.push([t-.5,r-.5-.5*(a+i+o+n-4*f)/(i-a+n-o)]);break;case 4:h.push([t-.25-.25*(o+a-2*f)/(a-o),r-.75-.25*(-a-i+2*f)/(a-i)]);break;case 5:h.push([t-.5-.5*(n+i+o+a-4*f)/(i-n+a-o),r-.5]);break;case 6:h.push([t-.5-.25*(-n-i+o+a)/(n-i+a-o),r-.5-.25*(-a-i+o+n)/(a-i+n-o)]);break;case 7:h.push([t-.75-.25*(o+a-2*f)/(a-o),r-.75-.25*(o+n-2*f)/(n-o)]);break;case 8:h.push([t-.75-.25*(-o-a+2*f)/(o-a),r-.75-.25*(-o-n+2*f)/(o-n)]);break;case 9:h.push([t-.5-.25*(n+i+-o-a)/(i-n+o-a),r-.5-.25*(a+i+-o-n)/(i-a+o-n)]);break;case 10:h.push([t-.5-.5*(-n-i+-o-a+4*f)/(n-i+o-a),r-.5]);break;case 11:h.push([t-.25-.25*(-o-a+2*f)/(o-a),r-.75-.25*(a+i-2*f)/(i-a)]);break;case 12:h.push([t-.5,r-.5-.5*(-a-i+-o-n+4*f)/(a-i+o-n)]);break;case 13:h.push([t-.75-.25*(n+i-2*f)/(i-n),r-.25-.25*(-o-n+2*f)/(o-n)]);break;case 14:h.push([t-.25-.25*(-n-i+2*f)/(n-i),r-.25-.25*(-a-i+2*f)/(a-i)])}},cell:function(t,r,i,n,a,o,s,l,u){a?l.push([t,r]):l.push([r,t])}});return function(t,r){var i=[],a=[];return n(t,i,a,r),{positions:i,cells:a}}}},s={}},7261(t,r,i){t.exports=function(t){var r=(t=t||{}).center||[0,0,0],i=t.up||[0,1,0],n=t.right||d(i),a=t.radius||1,o=t.theta||0,h=t.phi||0;if(r=[].slice.call(r,0,3),l(i=[].slice.call(i,0,3),i),l(n=[].slice.call(n,0,3),n),"eye"in t){var p=t.eye,m=[p[0]-r[0],p[1]-r[1],p[2]-r[2]];s(n,m,i),1e-6>c(n[0],n[1],n[2])?n=d(i):l(n,n),a=c(m[0],m[1],m[2]);var g=u(i,m)/a,y=u(n,m)/a;h=Math.acos(g),o=Math.acos(y)}return a=Math.log(a),new f(t.zoomMin,t.zoomMax,r,i,n,a,o,h)};var n=i(9215),a=i(7608),o=i(6079),s=i(5911),l=i(3536),u=i(244);function c(t,r,i){return Math.sqrt(Math.pow(t,2)+Math.pow(r,2)+Math.pow(i,2))}function h(t){return Math.min(1,Math.max(-1,t))}function d(t){var r=Math.abs(t[0]),i=Math.abs(t[1]),n=Math.abs(t[2]),a=[0,0,0];r>Math.max(i,n)?a[2]=1:i>Math.max(r,n)?a[0]=1:a[1]=1;for(var o=0,s=0,u=0;u<3;++u)o+=t[u]*t[u],s+=a[u]*t[u];for(var u=0;u<3;++u)a[u]-=s/o*t[u];return l(a,a),a}function f(t,r,i,a,o,s,l,u){this.center=n(i),this.up=n(a),this.right=n(o),this.radius=n([s]),this.angle=n([l,u]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,r),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var p=f.prototype;p.setDistanceLimits=function(t,r){t=t>0?Math.log(t):-1/0,r=Math.max(r=r>0?Math.log(r):1/0,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=r},p.getDistanceLimits=function(t){var r=this.radius.bounds[0];return t?(t[0]=Math.exp(r[0][0]),t[1]=Math.exp(r[1][0]),t):[Math.exp(r[0][0]),Math.exp(r[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var r=this.computedUp,i=this.computedRight,n=0,a=0,o=0;o<3;++o)a+=r[o]*i[o],n+=r[o]*r[o];for(var u=Math.sqrt(n),h=0,o=0;o<3;++o)i[o]-=r[o]*a/n,h+=i[o]*i[o],r[o]/=u;for(var d=Math.sqrt(h),o=0;o<3;++o)i[o]/=d;var f=this.computedToward;s(f,r,i),l(f,f);for(var p=Math.exp(this.computedRadius[0]),m=this.computedAngle[0],g=this.computedAngle[1],y=Math.cos(m),v=Math.sin(m),x=Math.cos(g),b=Math.sin(g),_=this.computedCenter,w=y*x,T=v*x,A=-y*b,M=-v*b,k=this.computedEye,S=this.computedMatrix,o=0;o<3;++o){var E=w*i[o]+T*f[o]+b*r[o];S[4*o+1]=A*i[o]+M*f[o]+x*r[o],S[4*o+2]=E,S[4*o+3]=0}var D=S[1],C=S[5],I=S[9],L=S[2],P=S[6],z=S[10],F=C*z-I*P,O=I*L-D*z,R=D*P-C*L,B=c(F,O,R);F/=B,O/=B,R/=B,S[0]=F,S[4]=O,S[8]=R;for(var o=0;o<3;++o)k[o]=_[o]+S[2+4*o]*p;for(var o=0;o<3;++o){for(var h=0,j=0;j<3;++j)h+=S[o+4*j]*k[j];S[12+o]=-h}S[15]=1},p.getMatrix=function(t,r){this.recalcMatrix(t);var i=this.computedMatrix;if(r){for(var n=0;n<16;++n)r[n]=i[n];return r}return i};var m=[0,0,0];p.rotate=function(t,r,i,n){if(this.angle.move(t,r,i),n){this.recalcMatrix(t);var a=this.computedMatrix;m[0]=a[2],m[1]=a[6],m[2]=a[10];for(var s=this.computedUp,l=this.computedRight,u=this.computedToward,c=0;c<3;++c)a[4*c]=s[c],a[4*c+1]=l[c],a[4*c+2]=u[c];o(a,a,n,m);for(var c=0;c<3;++c)s[c]=a[4*c],l[c]=a[4*c+1];this.up.set(t,s[0],s[1],s[2]),this.right.set(t,l[0],l[1],l[2])}},p.pan=function(t,r,i,n){r=r||0,i=i||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(this.computedRadius[0],a[1]),s=a[5],l=a[9],u=c(o,s,l);o/=u,s/=u,l/=u;var h=a[0],d=a[4],f=a[8],p=h*o+d*s+f*l;h-=o*p;var m=c(h,d-=s*p,f-=l*p);h/=m,d/=m,f/=m;var g=h*r+o*i,y=d*r+s*i,v=f*r+l*i;this.center.move(t,g,y,v);var x=Math.exp(this.computedRadius[0]);x=Math.max(1e-4,x+n),this.radius.set(t,Math.log(x))},p.translate=function(t,r,i,n){this.center.move(t,r||0,i||0,n||0)},p.setMatrix=function(t,r,i,n){var o,s,l=1;"number"==typeof i&&(l=0|i),(l<0||l>3)&&(l=1);var u=(l+2)%3;r||(this.recalcMatrix(t),r=this.computedMatrix);var d=r[l],f=r[l+4],p=r[l+8];if(n){var m=Math.abs(d),g=Math.abs(p),y=Math.max(m,Math.abs(f),g);m===y?(d=d<0?-1:1,f=p=0):g===y?(p=p<0?-1:1,d=f=0):(f=f<0?-1:1,d=p=0)}else{var v=c(d,f,p);d/=v,f/=v,p/=v}var x=r[u],b=r[u+4],_=r[u+8],w=x*d+b*f+_*p;x-=d*w;var T=c(x,b-=f*w,_-=p*w);x/=T,b/=T;var A=f*(_/=T)-p*b,M=p*x-d*_,k=d*b-f*x,S=c(A,M,k);if(A/=S,M/=S,k/=S,this.center.jump(t,G,H,$),this.radius.idle(t),this.up.jump(t,d,f,p),this.right.jump(t,x,b,_),2===l){var E=r[1],D=r[5],C=r[9],I=E*x+D*b+C*_,L=E*A+D*M+C*k;o=O<0?-Math.PI/2:Math.PI/2,s=Math.atan2(L,I)}else{var P=r[2],z=r[6],F=r[10],O=P*d+z*f+F*p,R=P*x+z*b+F*_,B=P*A+z*M+F*k;o=Math.asin(h(O)),s=Math.atan2(B,R)}this.angle.jump(t,s,o),this.recalcMatrix(t);var j=r[2],N=r[6],V=r[10],U=this.computedMatrix;a(U,r);var q=U[15],G=U[12]/q,H=U[13]/q,$=U[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,G-j*W,H-N*W,$-V*W)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,r){r>0&&this.radius.set(t,Math.log(r))},p.lookAt=function(t,r,i,n){this.recalcMatrix(t),r=r||this.computedEye,i=i||this.computedCenter;var a=(n=n||this.computedUp)[0],o=n[1],s=n[2],l=c(a,o,s);if(!(l<1e-6)){a/=l,o/=l,s/=l;var u=r[0]-i[0],d=r[1]-i[1],f=r[2]-i[2],p=c(u,d,f);if(!(p<1e-6)){u/=p,d/=p,f/=p;var m=this.computedRight,g=m[0],y=m[1],v=m[2],x=a*g+o*y+s*v;g-=x*a;var b=c(g,y-=x*o,v-=x*s);if(!(b<.01&&(b=c(g=o*f-s*d,y=s*u-a*f,v=a*d-o*u))<1e-6)){g/=b,y/=b,v/=b,this.up.set(t,a,o,s),this.right.set(t,g,y,v),this.center.set(t,i[0],i[1],i[2]),this.radius.set(t,Math.log(p));var _=o*v-s*y,w=s*g-a*v,T=a*y-o*g,A=c(_,w,T);_/=A;var M=a*u+o*d+s*f,k=g*u+y*d+v*f,S=_*u+(w/=A)*d+(T/=A)*f,E=Math.asin(h(M)),D=Math.atan2(S,k),C=this.angle._state,I=C[C.length-1],L=C[C.length-2],P=Math.abs((I%=2*Math.PI)+2*Math.PI-D),z=Math.abs(I-D),F=Math.abs(I-2*Math.PI-D);Ptypeof Uint8ClampedArray,l="u">typeof BigUint64Array,u="u">typeof BigInt64Array,c=i.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=a([32,0])),c.BIGUINT64||(c.BIGUINT64=a([32,0])),c.BIGINT64||(c.BIGINT64=a([32,0])),c.BUFFER||(c.BUFFER=a([32,0]));var h=c.DATA,d=c.BUFFER;function f(t){if(t){var r=t.length||t.byteLength;h[n.log2(r)].push(t)}}function p(t){var t=n.nextPow2(t),r=h[n.log2(t)];return r.length>0?r.pop():new ArrayBuffer(t)}function m(t){return new Uint8Array(p(t),0,t)}function g(t){return new Uint16Array(p(2*t),0,t)}function y(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function x(t){return new Int16Array(p(2*t),0,t)}function b(t){return new Int32Array(p(4*t),0,t)}function _(t){return new Float32Array(p(4*t),0,t)}function w(t){return new Float64Array(p(8*t),0,t)}function T(t){return s?new Uint8ClampedArray(p(t),0,t):m(t)}function A(t){return l?new BigUint64Array(p(8*t),0,t):null}function M(t){return u?new BigInt64Array(p(8*t),0,t):null}function k(t){return new DataView(p(t),0,t)}function S(t){t=n.nextPow2(t);var r=d[n.log2(t)];return r.length>0?r.pop():new o(t)}r.free=function(t){if(o.isBuffer(t))d[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var r=t.length||t.byteLength;h[0|n.log2(r)].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){f(t.buffer)},r.freeArrayBuffer=f,r.freeBuffer=function(t){d[n.log2(t.length)].push(t)},r.malloc=function(t,r){if(void 0===r||"arraybuffer"===r)return p(t);switch(r){case"uint8":return m(t);case"uint16":return g(t);case"uint32":return y(t);case"int8":return v(t);case"int16":return x(t);case"int32":return b(t);case"float":case"float32":return _(t);case"double":case"float64":return w(t);case"uint8_clamped":return T(t);case"bigint64":return M(t);case"biguint64":return A(t);case"buffer":return S(t);case"data":case"dataview":return k(t);default:return null}},r.mallocArrayBuffer=p,r.mallocUint8=m,r.mallocUint16=g,r.mallocUint32=y,r.mallocInt8=v,r.mallocInt16=x,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=_,r.mallocFloat64=r.mallocDouble=w,r.mallocUint8Clamped=T,r.mallocBigUint64=A,r.mallocBigInt64=M,r.mallocDataView=k,r.mallocBuffer=S,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,h[t].length=0,d[t].length=0}},1755(t){function r(t){this.roots=Array(t),this.ranks=Array(t);for(var r=0;rtypeof document&&((a=document.createElement("canvas")).width=8192,a.height=1024,o=a.getContext("2d"))},7718(t,r,i){t.exports=function(t,r,i,n){var o=64,s=1.25,l={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return n&&(n.size&&n.size>0&&(o=n.size),n.lineSpacing&&n.lineSpacing>0&&(s=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(l.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(l.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(l.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(l.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(l.superscripts=!!n.styletags.superscripts)),i.font=[n.fontStyle,n.fontVariant,n.fontWeight,o+"px",n.font].filter(function(t){return t}).join(" "),i.textAlign="start",i.textBaseline="alphabetic",i.direction="ltr",d(function(t,r,i,n,o,s){i=i.replace(/\n/g,""),i=!0===s.breaklines?i.replace(/\/g,` -`):i.replace(/\/g," ");var l="",u=[];for(b=0;b-1?parseInt(t[1+a]):0,u=o>-1?parseInt(i[1+o]):0;l!==u&&(n=n.replace(S(),"?px "),T*=Math.pow(.75,u-l),n=n.replace("?px ",S())),w+=.25*m*(u-l)}if(!0===s.superscripts){var c=t.indexOf("+"),h=i.indexOf("+"),d=c>-1?parseInt(t[1+c]):0,f=h>-1?parseInt(i[1+h]):0;d!==f&&(n=n.replace(S(),"?px "),T*=Math.pow(.75,f-d),n=n.replace("?px ",S())),w-=.25*m*(f-d)}if(!0===s.bolds){var p=t.indexOf("b|")>-1,g=i.indexOf("b|")>-1;!p&&g&&(n=y?n.replace("italic ","italic bold "):"bold "+n),p&&!g&&(n=n.replace("bold ",""))}if(!0===s.italics){var y=t.indexOf("i|")>-1,v=i.indexOf("i|")>-1;!y&&v&&(n="italic "+n),y&&!v&&(n=n.replace("italic ",""))}r.font=n}(l,D),l=D))}k(),A+=E.length;var C=0|Math.round(_+2*n);y",o="",s=a.length,l=o.length,u="+"===r[0]||"-"===r[0],c=0,h=-l;c>-1&&!(-1===(c=i.indexOf(a,c))||-1===(h=i.indexOf(o,c+s))||h<=c);){for(var d=c;d=h)n[d]=null,i=i.substr(0,d)+" "+i.substr(d+1);else if(null!==n[d]){var f=n[d].indexOf(r[0]);-1===f?n[d]+=r:u&&(n[d]=n[d].substr(0,f+1)+(1+parseInt(n[d][f+1]))+n[d].substr(f+2))}var p=c+s,m=i.substr(p,h-p).indexOf(a);c=-1!==m?m:h+l}return n}function h(t,r,i,a){var c,h=(c=n(t,128),a?o(c.cells,c.positions,.25):{edges:c.cells,positions:c.positions}),d=function(t,r,i){for(var n=r.textAlign||"start",a=r.textBaseline||"alphabetic",o=[0x40000000,0x40000000],s=[0,0],l=t.length,u=0;utypeof ses)||!ses.ok||ses.ok()){"u">typeof ses&&(ses.weakMapPermitHostObjects=x);var r,i,n,a=!1;if("function"==typeof WeakMap){var o=WeakMap;if(!("u">typeof navigator&&/Firefox/.test(navigator.userAgent))){var s=new o,l=Object.freeze({});if(s.set(l,1),1!==s.get(l))a=!0;else{t.exports=WeakMap;return}}}Object.prototype.hasOwnProperty;var u=Object.getOwnPropertyNames,c=Object.defineProperty,h=Object.isExtensible,d="weakmap:",f=d+"ident:"+Math.random()+"___";if("u">typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var p=new Uint8Array(new ArrayBuffer(25));crypto.getRandomValues(p),f=d+"rand:"+Array.prototype.map.call(p,function(t){return(t%36).toString(36)}).join("")+"___"}if(c(Object,"getOwnPropertyNames",{value:function(t){return u(t).filter(b)}}),"getPropertyNames"in Object){var m=Object.getPropertyNames;c(Object,"getPropertyNames",{value:function(t){return m(t).filter(b)}})}r=Object.freeze,c(Object,"freeze",{value:function(t){return _(t),r(t)}}),i=Object.seal,c(Object,"seal",{value:function(t){return _(t),i(t)}}),n=Object.preventExtensions,c(Object,"preventExtensions",{value:function(t){return _(t),n(t)}});var g=!1,y=0,v=function(){this instanceof v||T();var t=[],r=[],i=y++;return Object.create(v.prototype,{get___:{value:w(function(n,a){var o,s=_(n);return s?i in s?s[i]:a:(o=t.indexOf(n))>=0?r[o]:a})},has___:{value:w(function(r){var n=_(r);return n?i in n:t.indexOf(r)>=0})},set___:{value:w(function(n,a){var o,s=_(n);return s?s[i]=a:(o=t.indexOf(n))>=0?r[o]=a:(r[o=t.length]=a,t[o]=n),this})},delete___:{value:w(function(n){var a,o,s=_(n);return s?i in s&&delete s[i]:!((a=t.indexOf(n))<0)&&(o=t.length-1,t[a]=void 0,r[a]=r[o],t[a]=t[o],t.length=o,r.length=o,!0)})}})};v.prototype=Object.create(Object.prototype,{get:{value:function(t,r){return this.get___(t,r)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,r){return this.set___(t,r)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof o?function(){function r(){this instanceof v||T();var t,r=new o,i=void 0,n=!1;return t=a?function(t,n){return r.set(t,n),r.has(t)||(i||(i=new v),i.set(t,n)),this}:function(t,a){if(n)try{r.set(t,a)}catch{i||(i=new v),i.set___(t,a)}else r.set(t,a);return this},Object.create(v.prototype,{get___:{value:w(function(t,n){return i?r.has(t)?r.get(t):i.get___(t,n):r.get(t,n)})},has___:{value:w(function(t){return r.has(t)||!!i&&i.has___(t)})},set___:{value:w(t)},delete___:{value:w(function(t){var n=!!r.delete(t);return i&&i.delete___(t)||n})},permitHostObjects___:{value:w(function(t){if(t===x)n=!0;else throw Error("bogus call to permitHostObjects___")})}})}a&&"u">typeof Proxy&&(Proxy=void 0),r.prototype=v.prototype,t.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("u">typeof Proxy&&(Proxy=void 0),t.exports=v)}function x(t){t.permitHostObjects___&&t.permitHostObjects___(x)}function b(t){return t.substr(0,d.length)!=d||"___"!==t.substr(t.length-3)}function _(t){if(t!==Object(t))throw TypeError("Not an object: "+t);var r=t[f];if(r&&r.key===t)return r;if(h(t)){r={key:t};try{return c(t,f,{value:r,writable:!1,enumerable:!1,configurable:!1}),r}catch{return}}}function w(t){return t.prototype=null,Object.freeze(t)}function T(){!g&&"u">typeof console&&(g=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236(t,r,i){var n=i(8284);t.exports=function(){var t={};return function(r){if(("object"!=typeof r||null===r)&&"function"!=typeof r)throw Error("Weakmap-shim: Key must be object");var i=r.valueOf(t);return i&&i.identity===t?i:n(r,t)}}},8284(t){t.exports=function(t,r){var i={identity:r},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==r?n.apply(this,arguments):i},writable:!0}),i}},606(t,r,i){var n=i(236);t.exports=function(){var t=n();return{get:function(r,i){var n=t(r);return n.hasOwnProperty("value")?n.value:i},set:function(r,i){return t(r).value=i,this},has:function(r){return"value"in t(r)},delete:function(r){return delete t(r).value}}}},3349(t){var r,i;r=(function(){return function(t,r,i,n,a,o){var s=t[0],l=i[0],u=[0];n|=0;var c=0;for(c=0;c=0!=d>=0&&a.push(u[0]+.5+.5*(h+d)/(h-d)),n+=l,++u[0]}}}).bind(void 0,{funcName:"zeroCrossings"}),i={},t.exports=function(t,n,a){var o=t.dtype,s=t.order,l=[o,s.join()].join(),u=i[l];return u||(i[l]=u=r([o,s])),u(t.shape.slice(0),t.data,t.stride,0|t.offset,n,a)}},781(t,r,i){t.exports=function(t,r){var i=[];return r=+r||0,n(t.hi(t.shape[0]-1),i,r),i};var n=i(3349)},7790(){}};let n={};function a(t){let r=n[t];if(void 0!==r)return r.exports;let o=n[t]={id:t,loaded:!1,exports:{}};return i[t].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch{if("object"==typeof window)return window}}(),a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r.exports=a(3065)}}),fp=g({"src/lib/str2rgbarray.js"(t,r){var{normalize:i}=ei();r.exports=function(t){return t?i(t):[0,0,0,1]}}}),fm=g({"src/lib/gl_format_color.js"(t,r){var i=L(),n=t6(),a=ei(),o=er().defaultLine,s=O().isArrayOrTypedArray,l=a.normalize(o);function u(t,r){return[t[0],t[1],t[2],t[3]*r]}function c(t){return!i(t)&&(a.isChannelArray(t)||a.isValid(t))?a.normalize(t):l}function h(t){return i(t)?t:1}r.exports={formatColor:function(t,r,i){var o=t.color;o&&o._inputArray&&(o=o._inputArray);var d,f,p,m,g,y=s(o),v=s(r),x=n.extractOpts(t),b=[];if(d=void 0!==x.colorscale?n.makeColorScaleFuncFromTrace(t):c,f=y?(t,r)=>void 0===t[r]?l:void 0===x.colorscale?d(t[r]):a.normalize(d(t[r])):c,p=v?function(t,r){return void 0===t[r]?1:h(t[r])}:h,y||v)for(var _=0;_0){var f=a.c2l(h);a._lowerLogErrorBound||(a._lowerLogErrorBound=f),a._lowerErrorBound=Math.min(a._lowerLogErrorBound,f)}}else s[l]=[-u[0]*n,u[1]*n]}return s}r.exports=function(t,r,i){var a=[n(t.x,t.error_x,r[0],i.xaxis),n(t.y,t.error_y,r[1],i.yaxis),n(t.z,t.error_z,r[2],i.zaxis)],o=function(t){for(var r=0;r-1?-1:+(t.indexOf("right")>-1)}function b(t){return null==t?0:t.indexOf("top")>-1?-1:+(t.indexOf("bottom")>-1)}function _(t,r){return r(4*t)}function w(t){return f[t]}function T(t,r,i,n,a){var o=null;if(l.isArrayOrTypedArray(t)){o=[];for(var s=0;s=0){var D=function(t,r,i){var n,a=(i+1)%3,o=(i+2)%3,l=[],u=[];for(n=0;n=0&&d("surfacecolor",_||w);for(var T=["x","y","z"],A=0;A<3;++A){var M="projection."+T[A];d(M+".show")&&(d(M+".opacity"),d(M+".scale"))}var k=i.getComponentMethod("errorbars","supplyDefaults");k(t,r,_||w||c,{axis:"z"}),k(t,r,_||w||c,{axis:"y",inherit:"z"}),k(t,r,_||w||c,{axis:"x",inherit:"z"})}}}),fw=g({"src/traces/scatter3d/calc.js"(t,r){var i=i3(),n=i2();r.exports=function(t,r){var a=[{x:!1,y:!1,trace:r,t:{}}];return i(a,r),n(t,r),a}}}),fT=g({"node_modules/get-canvas-context/index.js"(t,r){r.exports=function(t,r){if("string"!=typeof t)throw TypeError("must specify type string");if(r=r||{},typeof document>"u"&&!r.canvas)return null;var i=r.canvas||document.createElement("canvas");"number"==typeof r.width&&(i.width=r.width),"number"==typeof r.height&&(i.height=r.height);var n,a=r;try{var o=[t];0===t.indexOf("webgl")&&o.push("experimental-"+t);for(var s=0;s/g," "));u[c]=p,h.tickmode=d}}r.ticks=u;for(var c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(var m=0;m<2;++m)r.bounds[m][c]=t.glplot.bounds[m][c]}t.contourLevels=function(t){for(var r=[,,,],i=0;i<3;++i){for(var n=t[i],a=Array(n.length),o=0;oi.deltaY?1.1:.9090909090909091,o=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*o.x,y:n*o.y,z:n*o.z})}a(t)}},!!u&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var r=n();t.graphDiv.emit("plotly_relayouting",r)}}),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",function(i){r&&r.emit&&r.emit("plotly_webglcontextlost",{event:i,layer:t.id})},!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},A.render=function(){var t,r=this,i=r.graphDiv,n=r.svgContainer,a=r.container.getBoundingClientRect();i._fullLayout._calcInverseTransform(i);var o=i._fullLayout._invScaleX,s=i._fullLayout._invScaleY,l=a.width*o,u=a.height*s;n.setAttributeNS(null,"viewBox","0 0 "+l+" "+u),n.setAttributeNS(null,"width",l),n.setAttributeNS(null,"height",u),b(r),r.glplot.axes.update(r.axesOptions);for(var c=Object.keys(r.traces),d=null,m=r.glplot.selection,g=0;g")):"isosurface"===t.type||"volume"===t.type?(A.valueLabel=f.hoverLabelText(r._mockAxis,r._mockAxis.d2l(m.traceCoordinate[3]),t.valuehoverformat),D.push("value: "+A.valueLabel),m.textLabel&&D.push(m.textLabel),E=D.join("
")):E=m.textLabel;var C={x:m.traceCoordinate[0],y:m.traceCoordinate[1],z:m.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:T};p.appendArrayPointValue(C,_,T),t._module.eventData&&(C=_._module.eventData(C,m,_,{},T));var I={points:[C]};if(r.fullSceneLayout.hovermode){var L=[];p.loneHover({trace:_,x:(.5+.5*x[0]/x[3])*l,y:(.5-.5*x[1]/x[3])*u,xLabel:A.xLabel,yLabel:A.yLabel,zLabel:A.zLabel,text:E,name:d.name,color:p.castHoverOption(_,T,"bgcolor")||d.color,borderColor:p.castHoverOption(_,T,"bordercolor"),fontFamily:p.castHoverOption(_,T,"font.family"),fontSize:p.castHoverOption(_,T,"font.size"),fontColor:p.castHoverOption(_,T,"font.color"),nameLength:p.castHoverOption(_,T,"namelength"),textAlign:p.castHoverOption(_,T,"align"),hovertemplate:h.castOption(_,T,"hovertemplate"),hovertemplateLabels:h.extendFlat({},C,A),eventData:[C]},{container:n,gd:i,inOut_bbox:L}),C.bbox=L[0]}m.distance<5&&(m.buttons||w)?i.emit("plotly_click",I):i.emit("plotly_hover",I),this.oldEventData=I}else p.loneUnhover(n),this.oldEventData&&i.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;r.drawAnnotations(r)},A.recoverContext=function(){var t=this;t.glplot.dispose();var r=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(r):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):h.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(r)};var k=["xaxis","yaxis","zaxis"];A.plot=function(t,r,i){if(this.plotArgs=[t,r,i],!this.glplot.contextLost){var n,a,o,s,l,u,c=r[this.id],d=i[this.id];this.fullLayout=r,this.fullSceneLayout=c,this.axesOptions.merge(r,c),this.spikeOptions.merge(c),this.setViewport(c),this.updateFx(c.dragmode,c.hovermode),this.camera.enableWheel=this.graphDiv._context._scrollZoom.gl3d,this.glplot.setClearColor(m(c.bgcolor)),this.setConvert(l),t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(o=0;oy[1][o])y[0][o]=-1,y[1][o]=1;else{var I=y[1][o]-y[0][o];y[0][o]-=I/32,y[1][o]+=I/32}if(b=_(b=[y[0][o],y[1][o]],l),y[0][o]=b[0],y[1][o]=b[1],l.isReversed()){var L=y[0][o];y[0][o]=y[1][o],y[1][o]=L}}else b=l.range,y[0][o]=l.r2l(b[0]),y[1][o]=l.r2l(b[1]);y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),v[o]=y[1][o]-y[0][o],l.range=[y[0][o],y[1][o]],l.limitRange(),this.glplot.setBounds(o,{min:l.range[0]*p[o],max:l.range[1]*p[o]})}var P,z=c.aspectmode;if("cube"===z)P=[1,1,1];else if("manual"===z){var F=c.aspectratio;P=[F.x,F.y,F.z]}else if("auto"===z||"data"===z){var O=[1,1,1];for(o=0;o<3;++o){var R=x[u=(l=c[k[o]]).type];O[o]=Math.pow(R.acc,1/R.count)/p[o]}P="data"===z||Math.max.apply(null,O)/Math.min.apply(null,O)<=4?O:[1,1,1]}else throw Error("scene.js aspectRatio was not one of the enumerated types");c.aspectratio.x=d.aspectratio.x=P[0],c.aspectratio.y=d.aspectratio.y=P[1],c.aspectratio.z=d.aspectratio.z=P[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var B=c.domain||null,j=r._size||null;if(B&&j){var N=this.container.style;N.position="absolute",N.left=j.l+B.x[0]*j.w+"px",N.top=j.t+(1-B.y[1])*j.h+"px",N.width=j.w*(B.x[1]-B.x[0])+"px",N.height=j.h*(B.y[1]-B.y[0])+"px"}this.glplot.redraw()}},A.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},A.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},A.setViewport=function(t){var r=t.camera;this.camera.lookAt.apply(this,[[r.eye.x,r.eye.y,r.eye.z],[r.center.x,r.center.y,r.center.z],[r.up.x,r.up.y,r.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},A.isCameraChanged=function(t){var r=this.getCamera(),i=h.nestedProperty(t,this.id+".camera").get(),n=!1;if(void 0===i)n=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!function(t,r,i,n){var a=["up","center","eye"],o=["x","y","z"];return r[a[i]]&&t[a[i]][o[n]]===r[a[i]][o[n]]}(r,i,a,o)){n=!0;break}(!i.projection||r.projection&&r.projection.type!==i.projection.type)&&(n=!0)}return n},A.isAspectChanged=function(t){var r=this.glplot.getAspectratio(),i=h.nestedProperty(t,this.id+".aspectratio").get();return void 0===i||i.x!==r.x||i.y!==r.y||i.z!==r.z},A.saveLayout=function(t){var r,i,n,a,o,s,l=this.fullLayout,u=this.isCameraChanged(t),d=this.isAspectChanged(t),f=u||d;if(f){var p={};u&&(r=this.getCamera(),n=(i=h.nestedProperty(t,this.id+".camera")).get(),p[this.id+".camera"]=n),d&&(a=this.glplot.getAspectratio(),s=(o=h.nestedProperty(t,this.id+".aspectratio")).get(),p[this.id+".aspectratio"]=s),c.call("_storeDirectGUIEdit",t,l._preGUI,p),u&&(i.set(r),h.nestedProperty(l,this.id+".camera").set(r)),d&&(o.set(a),h.nestedProperty(l,this.id+".aspectratio").set(a),this.glplot.redraw())}return f},A.updateFx=function(t,r){var i=this.camera;if(i)if("orbit"===t)i.mode="orbit",i.keyBindingMode="rotate";else if("turntable"===t){i.up=[0,0,1],i.mode="turntable",i.keyBindingMode="rotate";var n=this.graphDiv,a=n._fullLayout,o=this.fullSceneLayout.camera,s=o.up.x,l=o.up.y,u=o.up.z;if(u/Math.sqrt(s*s+l*l+u*u)<.999){var d=this.id+".camera.up",f={x:0,y:0,z:1},p={};p[d]=f;var m=n.layout;c.call("_storeDirectGUIEdit",m,a._preGUI,p),o.up=f,h.nestedProperty(m,d).set(f)}}else i.keyBindingMode=t;this.fullSceneLayout.hovermode=r},A.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(i),this.glplot.redraw();var r,n=this.glplot.gl,a=n.drawingBufferWidth,o=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var s=new Uint8Array(a*o*4);n.readPixels(0,0,a,o,n.RGBA,n.UNSIGNED_BYTE,s),function(t,r,i){for(var n=0,a=i-1;n0)for(var l=255/s,u=0;u<3;++u)t[o+u]=Math.min(l*t[o+u],255)}}(s,a,o);var l=document.createElement("canvas");l.width=a,l.height=o;var u=l.getContext("2d",{willReadFrequently:!0}),c=u.createImageData(a,o);switch(c.data.set(s),u.putImageData(c,0,0),t){case"jpeg":r=l.toDataURL("image/jpeg");break;case"webp":r=l.toDataURL("image/webp");break;default:r=l.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(i),r},A.setConvert=function(){for(var t=0;t<3;t++){var r=this.fullSceneLayout[k[t]];f.setConvert(r,this.fullLayout),r.setScale=h.noop}},A.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(this._mockAxis,t)},r.exports=T}}),fC=g({"src/plots/gl3d/layout/attributes.js"(t,r){r.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),fI=g({"src/plots/gl3d/layout/axis_attributes.js"(t,r){var i=ei(),n=tq(),a=$().extendFlat;r.exports=(0,e$().overrideAll)({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:i.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:a({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:a({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:a({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}}),fL=g({"src/plots/gl3d/layout/layout_attributes.js"(t,r){var i=fI(),n=an().attributes,a=$().extendFlat;function o(t,r,i){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:i,editType:"camera"},editType:"camera"}}r.exports={_arrayAttrRegexps:[(0,t_().counterRegex)("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(o(0,0,1),{}),center:a(o(0,0,0),{}),eye:a(o(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:n({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),fP=g({"src/plots/gl3d/layout/axis_defaults.js"(t,r){var i=ei(),n=t_(),a=tC(),o=fI(),s=nc(),l=nf(),u=["xaxis","yaxis","zaxis"],c=13600/187;r.exports=function(t,r,h){var d,f;function p(t,r){return n.coerce(d,f,o,t,r)}for(var m=0;m.999)&&(y="turntable")}else y="turntable";i("dragmode",y),i("hovermode",o.getDfltFromLayout("hovermode"))}r.exports=function(t,r,n){var a=r._basePlotModules.length>1;o(t,r,n,{type:c,attributes:l,handleDefaults:h,fullLayout:r,font:r.font,fullData:n,getDfltFromLayout:function(r){if(!a&&i.validate(t[r],l[r]))return t[r]},autotypenumbersDflt:r.autotypenumbers,paper_bgcolor:r.paper_bgcolor,calendar:r.calendar})}}}),fF=g({"src/plots/gl3d/index.js"(t){var r=e$().overrideAll,i=Z(),n=fD(),a=tF().getSubplotData,o=t_(),s=tB(),l="gl3d",u="scene";t.name=l,t.attr=u,t.idRoot=u,t.idRegex=t.attrRegex=o.counterRegex("scene"),t.attributes=fC(),t.layoutAttributes=fL(),t.baseLayoutAttrOverrides=r({hoverlabel:i.hoverlabel},"plot","nested"),t.supplyLayoutDefaults=fz(),t.plot=function(t){for(var r=t._fullLayout,i=t._fullData,o=r._subplots[l],s=0;s720;)n--,n/=function(t){for(var r=m(t),i=t,n=0;n0){i=p[n];break}return i}(n),++n<120&&(n=720);var a=Math.round(n/t);return a>1?a:1},f.refineCoords=function(t){for(var r=this.dataScaleX,i=this.dataScaleY,o=t[0].shape[0],s=t[0].shape[1],l=0|Math.floor(t[0].shape[0]*r+1),u=0|Math.floor(t[0].shape[1]*i+1),c=1+o+1,h=1+s+1,d=n(new Float32Array(c*h),[c,h]),f=[1/r,0,0,0,1/i,0,0,0,1],p=0;p0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(a[t]=!0,r=this.contourStart[t];r_&&(this.minValues[v]=_),this.maxValues[v]<_&&(this.maxValues[v]=_));for(v=0;v<3;v++)this.objectOffset[v]=.5*(this.minValues[v]+this.maxValues[v]);for(v=0;v<3;v++)for(x=0;xu&&(r.isomin=null,r.isomax=null);var c=s("x"),h=s("y"),d=s("z"),f=s("value");if(!c||!c.length||!h||!h.length||!d||!d.length||!f||!f.length){r.visible=!1;return}n.getComponentMethod("calendars","handleTraceDefaults")(t,r,["x","y","z"],a),s("valuehoverformat"),["x","y","z"].forEach(function(t){s(t+"hoverformat");var r="caps."+t;s(r+".show")&&s(r+".fill");var i="slices."+t;s(i+".show")&&(s(i+".fill"),s(i+".locations"))}),s("spaceframe.show")&&s("spaceframe.fill"),s("surface.show")&&(s("surface.count"),s("surface.fill"),s("surface.pattern")),s("contour.show")&&(s("contour.color"),s("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(t){s(t)}),o(t,r,a,s,{prefix:"",cLetter:"c"}),r._length=null}r.exports={supplyDefaults:function(t,r,n,o){s(t,r,n,o,function(n,o){return i.coerce(t,r,a,n,o)})},supplyIsoDefaults:s}}}),fW=g({"src/traces/streamtube/calc.js"(t,r){var i=t_(),n=t4();function a(t){var r,n,a,s,l,u,c,h,d,f,p,m,g=t._x,y=t._y,v=t._z,x=t._len,b=-1/0,_=1/0,w=-1/0,T=1/0,A=-1/0,M=1/0,k="";for(x&&(c=g[0],d=y[0],p=v[0]),x>1&&(h=g[x-1],f=y[x-1],m=v[x-1]),r=0;rh?"-":"+")+"x")).replace("y",(d>f?"-":"+")+"y")).replace("z",(p>m?"-":"+")+"z");var C=function(){x=0,S=[],E=[],D=[]};(!x||x0;i--){var n=Math.min(r[i],r[i-1]),a=Math.max(r[i],r[i-1]);if(a>n&&n-1}function z(u,c,h){n=i;var d=[c],f=[h];if(r>=1)d=[c],f=[h];else if(r>0){var p,m,g,v,x,b,_,w,T,A,M,k,S,E=(p=c,m=h,g=p[0],w=L(b=function(t,r,i){for(var n=[],a=0;a-1?h[O]:function(t,r,i){for(var u=l.length,c=n;c-1?F[O]=V:F[O]=I(R,B,j,null===u?N:u)}C=F[0],P=F[1],z=F[2],t._meshI.push(C),t._meshJ.push(P),t._meshK.push(z),++y}}function F(t,r,i,n){var a=t[3];an&&(a=n);for(var o=(t[3]-a)/(t[3]-r[3]+1e-9),s=[],l=0;l<4;l++)s[l]=(1-o)*t[l]+o*r[l];return s}function O(t){var r=.001*(D-E);return t>=E-r&&t<=D+r}function R(r){for(var i=[],n=0;n<4;n++){var a=r[n];i.push([t._x[a],t._y[a],t._z[a],t._value[a]])}return i}function B(t,r,i,n,a,o){o||(o=1),i=[-1,-1,-1];var s,l,u,c=!1,h=[(s=r[0][3],s>=n&&s<=a),(l=r[1][3],l>=n&&l<=a),(u=r[2][3],u>=n&&u<=a)];if(!h[0]&&!h[1]&&!h[2])return!1;var d=function(t,r,i){return O(r[0][3])&&O(r[1][3])&&O(r[2][3])?(z(t,r,i),!0):o<3&&B(t,r,i,E,D,++o)};if(h[0]&&h[1]&&h[2])return d(t,r,i)||c;var f=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(o){if(h[o[0]]&&h[o[1]]&&!h[o[2]]){var s=r[o[0]],l=r[o[1]],u=r[o[2]],p=F(u,s,n,a),m=F(u,l,n,a);c=d(t,[m,p,s],[-1,-1,i[o[0]]])||c,c=d(t,[s,l,m],[i[o[0]],i[o[1]],-1])||c,f=!0}}),f||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(o){if(h[o[0]]&&!h[o[1]]&&!h[o[2]]){var s=r[o[0]],l=r[o[1]],u=r[o[2]],p=F(l,s,n,a);c=d(t,[F(u,s,n,a),p,s],[-1,-1,i[o[0]]])||c,f=!0}}),c}function j(t,r,i,n){var a,o,s,l,u,c=!1,h=R(r),d=[(a=h[0][3],a>=i&&a<=n),(o=h[1][3],o>=i&&o<=n),(s=h[2][3],s>=i&&s<=n),(l=h[3][3],l>=i&&l<=n)];if(!d[0]&&!d[1]&&!d[2]&&!d[3])return c;if(d[0]&&d[1]&&d[2]&&d[3])return g&&((u=function(i,n,a){z(t,[h[i],h[n],h[a]],[r[i],r[n],r[a]])})(0,1,2),u(3,0,1),u(2,3,0),u(1,2,3)),c;var f=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(a){if(d[a[0]]&&d[a[1]]&&d[a[2]]&&!d[a[3]]){var o=h[a[0]],s=h[a[1]],l=h[a[2]],u=h[a[3]];c=g?z(t,[o,s,l],[r[a[0]],r[a[1]],r[a[2]]])||c:z(null,[F(u,o,i,n),F(u,s,i,n),F(u,l,i,n)],[-1,-1,-1])||c,f=!0}}),f||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function(a){if(d[a[0]]&&d[a[1]]&&!d[a[2]]&&!d[a[3]]){var o,s,l,u=h[a[0]],p=h[a[1]],m=h[a[2]],y=h[a[3]],v=F(m,u,i,n),x=F(m,p,i,n),b=F(y,p,i,n),_=F(y,u,i,n);g?(c=z(t,[u,_,v],[r[a[0]],-1,-1])||c,c=z(t,[p,x,b],[r[a[1]],-1,-1])||c):(o=[v,x,b,_],s=[-1,-1,-1,-1],(l=function(t,r,i){z(null,[o[t],o[r],o[i]],[s[t],s[r],s[i]])})(0,1,2),l(2,3,0)),f=!0}}),f)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(a){if(d[a[0]]&&!d[a[1]]&&!d[a[2]]&&!d[a[3]]){var o=h[a[0]],s=h[a[1]],l=h[a[2]],u=h[a[3]],p=F(s,o,i,n),m=F(l,o,i,n),y=F(u,o,i,n);g?(c=z(t,[o,p,m],[r[a[0]],-1,-1])||c,c=z(t,[o,m,y],[r[a[0]],-1,-1])||c,c=z(t,[o,y,p],[r[a[0]],-1,-1])||c):c=z(null,[p,m,y],[-1,-1,-1])||c,f=!0}}),c}function N(t,r,i,n,a,o,s,l,u,c,h){var d=!1;return m&&(P(t,"A")&&(d=j(null,[r,i,n,o],c,h)||d),P(t,"B")&&(d=j(null,[i,n,a,u],c,h)||d),P(t,"C")&&(d=j(null,[i,o,s,u],c,h)||d),P(t,"D")&&(d=j(null,[n,o,l,u],c,h)||d),P(t,"E")&&(d=j(null,[i,n,o,u],c,h)||d)),g&&(d=j(t,[i,n,o,u],c,h)||d),d}function V(t,r,i,n,a,o,s,l){return[!0===l[0]||B(t,R([r,i,n]),[r,i,n],o,s),!0===l[1]||B(t,R([n,a,r]),[n,a,r],o,s)]}function U(t,r,i,n,a,o,s,l,u){return l?V(t,r,i,a,n,o,s,u):V(t,i,a,n,r,o,s,u)}function q(t,r,i,n,a,o,s){var l,u,c,h,d=!1,f=function(){d=B(t,[l,u,c],[-1,-1,-1],a,o)||d,d=B(t,[c,h,l],[-1,-1,-1],a,o)||d},p=s[0],m=s[1],g=s[2];return p&&(l=L(R([M(r,i-0,n-0)])[0],R([M(r-1,i-0,n-0)])[0],p),u=L(R([M(r,i-0,n-1)])[0],R([M(r-1,i-0,n-1)])[0],p),c=L(R([M(r,i-1,n-1)])[0],R([M(r-1,i-1,n-1)])[0],p),h=L(R([M(r,i-1,n-0)])[0],R([M(r-1,i-1,n-0)])[0],p),f()),m&&(l=L(R([M(r-0,i,n-0)])[0],R([M(r-0,i-1,n-0)])[0],m),u=L(R([M(r-0,i,n-1)])[0],R([M(r-0,i-1,n-1)])[0],m),c=L(R([M(r-1,i,n-1)])[0],R([M(r-1,i-1,n-1)])[0],m),h=L(R([M(r-1,i,n-0)])[0],R([M(r-1,i-1,n-0)])[0],m),f()),g&&(l=L(R([M(r-0,i-0,n)])[0],R([M(r-0,i-0,n-1)])[0],g),u=L(R([M(r-0,i-1,n)])[0],R([M(r-0,i-1,n-1)])[0],g),c=L(R([M(r-1,i-1,n)])[0],R([M(r-1,i-1,n-1)])[0],g),h=L(R([M(r-1,i-0,n)])[0],R([M(r-1,i-0,n-1)])[0],g),f()),d}function G(t,r,i,n,a){for(var o=[],s=0,l=0;lMath.abs(z-S)?[k,z]:[z,S];A=F[0],L=F[1],m=!0,W(i,A,L),m=!1}}var O=[[Math.min(E,S),Math.max(E,S)],[Math.min(k,D),Math.max(k,D)]];["x","y","z"].forEach(function(i){for(var n=[],a=0;a0&&(d.push(m.id),"x"===i?f.push([m.distRatio,0,0]):"y"===i?f.push([0,m.distRatio,0]):f.push([0,0,m.distRatio]))}else h="x"===i?Y(1,_-1):"y"===i?Y(1,w-1):Y(1,T-1);d.length>0&&("x"===i?n[o]=function(t,r,i,n,a){for(var o=[],s=0,l=0;l0&&("x"===i?n[o]=G(null,h,s,l,n[o]):"y"===i?n[o]=H(null,h,s,l,n[o]):n[o]=$(null,h,s,l,n[o]),o++)}var g=t.caps[i];g.show&&g.fill&&(r=g.fill,"x"===i?n[o]=G(null,[0,_-1],s,l,n[o]):"y"===i?n[o]=H(null,[0,w-1],s,l,n[o]):n[o]=$(null,[0,T-1],s,l,n[o]),o++)}}),0===y&&C(),t._meshX=a,t._meshY=o,t._meshZ=s,t._meshIntensity=l,t._Xs=v,t._Ys=x,t._Zs=b}(),t}r.exports={findNearestOnAxis:u,generateIsoMeshes:f,createIsosurfaceTrace:function(t,r){var n=i({gl:t.glplot.gl}),a=new c(t,n,r.uid);return n._trace=a,a.update(r),t.glplot.add(n),a}}}}),fK=g({"src/traces/isosurface/index.js"(t,r){r.exports={attributes:fH(),supplyDefaults:f$().supplyDefaults,calc:fY(),colorbar:{min:"cmin",max:"cmax"},plot:fX().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:fF(),categories:["gl3d","showLegend"],meta:{}}}}),fJ=g({"lib/isosurface.js"(t,r){r.exports=fK()}}),fQ=g({"src/traces/volume/attributes.js"(t,r){var i=tH(),n=fH(),a=fB(),o=K(),s=$().extendFlat,l=r.exports=(0,e$().overrideAll)(s({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate,hovertemplatefallback:n.hovertemplatefallback},i("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:a.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}}),f0=g({"src/traces/volume/defaults.js"(t,r){var i=t_(),n=fQ(),a=f$().supplyIsoDefaults,o=fj().opacityscaleDefaults;r.exports=function(t,r,s,l){function u(a,o){return i.coerce(t,r,n,a,o)}a(t,r,s,l,u),o(t,r,l,u)}}}),f1=g({"src/traces/volume/convert.js"(t,r){var i=ff().gl_mesh3d,n=fm().parseColorScale,a=t_().isArrayOrTypedArray,o=fp(),s=t6().extractOpts,l=fZ(),u=fX().findNearestOnAxis,c=fX().generateIsoMeshes;function h(t,r,i){this.scene=t,this.uid=i,this.mesh=r,this.name="",this.data=null,this.showContour=!1}var d=h.prototype;d.handlePick=function(t){if(t.object===this.mesh){var r=t.data.index,i=this.data._meshX[r],n=this.data._meshY[r],o=this.data._meshZ[r],s=this.data._Ys.length,l=this.data._Zs.length,c=u(i,this.data._Xs).id,h=u(n,this.data._Ys).id,d=t.index=u(o,this.data._Zs).id+l*h+l*s*c;t.traceCoordinate=[this.data._meshX[d],this.data._meshY[d],this.data._meshZ[d],this.data._value[d]];var f=this.data.hovertext||this.data.text;return a(f)&&void 0!==f[d]?t.textLabel=f[d]:f&&(t.textLabel=f),!0}},d.update=function(t){var r=this.scene,i=r.fullSceneLayout;function a(t,r,i,n){return r.map(function(r){return t.d2l(r,0,n)*i})}this.data=c(t);var u={positions:l(a(i.xaxis,t._meshX,r.dataScale[0],t.xcalendar),a(i.yaxis,t._meshY,r.dataScale[1],t.ycalendar),a(i.zaxis,t._meshZ,r.dataScale[2],t.zcalendar)),cells:l(t._meshI,t._meshJ,t._meshK),lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,opacityscale:t.opacityscale,contourEnable:t.contour.show,contourColor:o(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading},h=s(t);u.vertexIntensity=t._meshIntensity,u.vertexIntensityBounds=[h.min,h.max],u.colormap=n(t),this.mesh.update(u)},d.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},r.exports=function(t,r){var n=i({gl:t.glplot.gl}),a=new h(t,n,r.uid);return n._trace=a,a.update(r),t.glplot.add(n),a}}}),f2=g({"src/traces/volume/index.js"(t,r){r.exports={attributes:fQ(),supplyDefaults:f0(),calc:fY(),colorbar:{min:"cmin",max:"cmax"},plot:f1(),moduleType:"trace",name:"volume",basePlotModule:fF(),categories:["gl3d","showLegend"],meta:{}}}}),f3=g({"lib/volume.js"(t,r){r.exports=f2()}}),f5=g({"src/traces/mesh3d/defaults.js"(t,r){var i=e2(),n=t_(),a=t2(),o=fG();r.exports=function(t,r,s,l){function u(i,a){return n.coerce(t,r,o,i,a)}function c(t){var r=t.map(function(t){var r=u(t);return r&&n.isArrayOrTypedArray(r)?r:null});return r.every(function(t){return t&&t.length===r[0].length})&&r}if(!c(["x","y","z"])||(c(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j))){r.visible=!1;return}i.getComponentMethod("calendars","handleTraceDefaults")(t,r,["x","y","z"],l),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(t){u(t)}),u("contour.show")&&(u("contour.color"),u("contour.width")),"intensity"in t?(u("intensity"),u("intensitymode"),a(t,r,l,u,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?u("facecolor"):"vertexcolor"in t?u("vertexcolor"):u("color",s)),u("text"),u("hovertext"),u("hovertemplate"),u("hovertemplatefallback"),u("xhoverformat"),u("yhoverformat"),u("zhoverformat"),r._length=null}}}),f4=g({"src/traces/mesh3d/calc.js"(t,r){var i=t4();r.exports=function(t,r){r.intensity&&i(t,r,{vals:r.intensity,containerStr:"",cLetter:"c"})}}}),f6=g({"src/traces/mesh3d/convert.js"(t,r){var i=ff().gl_mesh3d,n=ff().delaunay_triangulate,a=ff().alpha_shape,o=ff().convex_hull,s=fm().parseColorScale,l=t_().isArrayOrTypedArray,u=fp(),c=t6().extractOpts,h=fZ();function d(t,r,i){this.scene=t,this.uid=i,this.mesh=r,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var f=d.prototype;function p(t){for(var r=[],i=t.length,n=0;n=r-.5)return!1;return!0}f.handlePick=function(t){if(t.object===this.mesh){var r=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[r],this.data.y[r],this.data.z[r]];var i=this.data.hovertext||this.data.text;return l(i)&&void 0!==i[r]?t.textLabel=i[r]:i&&(t.textLabel=i),!0}},f.update=function(t){var r=this.scene,i=r.fullSceneLayout;this.data=t;var l,d=t.x.length,f=h(m(i.xaxis,t.x,r.dataScale[0],t.xcalendar),m(i.yaxis,t.y,r.dataScale[1],t.ycalendar),m(i.zaxis,t.z,r.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!y(t.i,d)||!y(t.j,d)||!y(t.k,d))return;l=h(g(t.i),g(t.j),g(t.k))}else l=0===t.alphahull?o(f):t.alphahull>0?a(t.alphahull,f):function(t,r){for(var i=["x","y","z"].indexOf(t),a=[],o=r.length,s=0;s2?t.slice(1,r-1):2===r?[(t[0]+t[1])/2]:t}function f(t){var r=t.length;return 1===r?[.5,.5]:[t[1]-t[0],t[r-1]-t[r-2]]}function p(t,r){var n=t.fullSceneLayout,c=t.dataScale,h=r._len,p={};function m(t,r){var i=n[r],o=c[u[r]];return a.simpleMap(t,function(t){return i.d2l(t)*o})}if(p.vectors=l(m(r._u,"xaxis"),m(r._v,"yaxis"),m(r._w,"zaxis"),h),!h)return{positions:[],cells:[]};var g=m(r._Xs,"xaxis"),y=m(r._Ys,"yaxis"),v=m(r._Zs,"zaxis");if(p.meshgrid=[g,y,v],p.gridFill=r._gridFill,r._slen)p.startingPositions=l(m(r._startsX,"xaxis"),m(r._startsY,"yaxis"),m(r._startsZ,"zaxis"));else{for(var x=y[0],b=d(g),_=d(v),w=Array(b.length*_.length),T=0,A=0;As&&(s=t[0]),t[1]l&&(l=t[1])}for(r in t.arcs.forEach(function(t){for(var r,i=-1,u=t.length;++is&&(s=r[0]),r[1]l&&(l=r[1])}),t.objects)!function t(r){switch(r.type){case"GeometryCollection":r.geometries.forEach(t);break;case"Point":u(r.coordinates);break;case"MultiPoint":r.coordinates.forEach(u)}}(t.objects[r]);return[a,o,s,l]}function a(t,r){var i=r.id,n=r.bbox,a=null==r.properties?{}:r.properties,s=o(t,r);return null==i&&null==n?{type:"Feature",properties:a,geometry:s}:null==n?{type:"Feature",id:i,properties:a,geometry:s}:{type:"Feature",id:i,bbox:n,properties:a,geometry:s}}function o(t,r){var n=i(t.transform),a=t.arcs;function o(t){return n(t)}function s(t){for(var r=[],i=0,o=t.length;i1)n=function(t,r){var i,n=[],a=[];function o(t){var r=t<0?~t:t;(a[r]||(a[r]=[])).push({i:t,g:i})}function s(t){t.forEach(o)}function l(t){t.forEach(s)}return function t(r){switch(i=r,r.type){case"GeometryCollection":r.geometries.forEach(t);break;case"LineString":s(r.arcs);break;case"MultiLineString":case"Polygon":l(r.arcs);break;case"MultiPolygon":r.arcs.forEach(l)}}(t),a.forEach(null==r?function(t){n.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&n.push(t[0].i)}),n}(r,i);else for(a=0,n=Array(o=t.arcs.length);a1)for(var o,l,c=1,h=u(a[0]);ch&&(l=a[0],a[0]=a[c],a[c]=l,h=o);return a}).filter(function(t){return t.length>0})}}function c(t,r){for(var i=0,n=t.length;i>>1;t[a]=2))throw Error("n must be ≥2");var i,a=(u=t.bbox||n(t))[0],o=u[1],s=u[2],l=u[3];r={scale:[s-a?(s-a)/(i-1):1,l-o?(l-o)/(i-1):1],translate:[a,o]}}var u,c,d=h(r),f=t.objects,p={};function m(t){return d(t)}for(c in f)p[c]=function t(r){var i;switch(r.type){case"GeometryCollection":i={type:"GeometryCollection",geometries:r.geometries.map(t)};break;case"Point":i={type:"Point",coordinates:m(r.coordinates)};break;case"MultiPoint":i={type:"MultiPoint",coordinates:r.coordinates.map(m)};break;default:return r}return null!=r.id&&(i.id=r.id),null!=r.bbox&&(i.bbox=r.bbox),null!=r.properties&&(i.properties=r.properties),i}(f[c]);return{type:"Topology",bbox:u,transform:r,objects:p,arcs:t.arcs.map(function(t){var r,i=0,n=1,a=t.length,o=Array(a);for(o[0]=d(t[0],0);++itypeof r?t:(i=i||self).topojson=i.topojson||{})}}),pg=g({"src/lib/topojson_utils.js"(t,r){var i=r.exports={},n=pp().locationmodeToLayer,a=pm().feature;i.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},i.getTopojsonPath=function(t,r){return t+=t.endsWith("/")?"":"/",`${t}${r}.json`},i.getTopojsonFeatures=function(t,r){var i=n[t.locationmode],o=r.objects[i];return a(r,o).features}}}),py=g({"src/lib/geojson_utils.js"(t){var r=P().BADNUM;t.calcTraceToLineCoords=function(t){for(var i=t[0].trace,n=i.connectgaps,a=[],o=[],s=0;s0&&(a.push(o),o=[])}return o.length>0&&a.push(o),a},t.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},t.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var r=Array(t.length),i=0;i{for(var n in r)i(t,n,{get:r[n],enumerable:!0})})(s,{COUNTRIES:()=>l,byAlpha2:()=>m,byAlpha3:()=>p,byM49:()=>g,createLookup:()=>c,lookup:()=>d,lookupAlpha3:()=>f,sanitize:()=>u}),r.exports=((t,r,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let l of a(r))o.call(t,l)||void 0===l||i(t,l,{get:()=>r[l],enumerable:!(s=n(r,l))||s.enumerable});return t})(i({},"__esModule",{value:!0}),s);var l=[{iso3:"ABW",iso2:"AW",m49:"533",name:"Aruba",aliases:["\uD83C\uDDE6\uD83C\uDDFC","country of aruba","land aruba","pais aruba"]},{iso3:"AFG",iso2:"AF",m49:"004",name:"Afghanistan",aliases:["\uD83C\uDDE6\uD83C\uDDEB","affghanistan","affghanisthan","affghaunistan","afghania","afghanisthan","afghaunistan","afghaunistaun","afgoniston","de afghanistan islami jumhuriyat","owganystan","афғонистон","أفغانستان","افغانستان","د افغانستان اسلامی جمهوریت"]},{iso3:"AGO",iso2:"AO",m49:"024",name:"Angola",aliases:["\uD83C\uDDE6\uD83C\uDDF4","republic of angola","republica de angola"]},{iso3:"AIA",iso2:"AI",m49:"660",name:"Anguilla",aliases:["\uD83C\uDDE6\uD83C\uDDEE","malliouhana"]},{iso3:"ALA",iso2:"AX",m49:"248",name:"\xc5land Islands",aliases:["\uD83C\uDDE6\uD83C\uDDFD","aaland","aaland islands","ahvenanmaa","aland","aland isles","aland region","alands lan","landskapet aland"]},{iso3:"ALB",iso2:"AL",m49:"008",name:"Albania",aliases:["\uD83C\uDDE6\uD83C\uDDF1","peoples republic of albania","peoples socialist republic of albania","republic of albania","republika e shqiperise","shqiperi","shqiperia","shqiperise","socialist republic of albania"]},{iso3:"AND",iso2:"AD",m49:"020",name:"Andorra",aliases:["\uD83C\uDDE6\uD83C\uDDE9","el pais dels pirineus","les valls dandorra","principality of andorra","principality of the valleys of andorra","principat dandorra","valls dandorra"]},{iso3:"ARE",iso2:"AE",m49:"784",name:"United Arab Emirates",aliases:["\uD83C\uDDE6\uD83C\uDDEA","emirates","uae","الإمارات","الإمارات العربية المتحدة","الامارات","الامارات العربية المتحدة","دولة الإمارات العربية المتحدة"]},{iso3:"ARG",iso2:"AR",m49:"032",name:"Argentina",aliases:["\uD83C\uDDE6\uD83C\uDDF7","argentine republic","nacion argentina","republic of argentina","republica argentina"]},{iso3:"ARM",iso2:"AM",m49:"051",name:"Armenia",aliases:["\uD83C\uDDE6\uD83C\uDDF2","hayastan","hayastani hanrapetutyun","republic of armenia","հայաստան","հայաստանի հանրապետություն","հայք","հհ"]},{iso3:"ASM",iso2:"AS",m49:"016",name:"American Samoa",aliases:["\uD83C\uDDE6\uD83C\uDDF8","amerika samoa","east samoa","samoa american","samoa united states","territory of american samoa","us samoa"]},{iso3:"ATA",iso2:"AQ",m49:"010",name:"Antarctica",aliases:["\uD83C\uDDE6\uD83C\uDDF6","antarctica treaty area"]},{iso3:"ATF",iso2:"TF",m49:"260",name:"French Southern Territories",aliases:["\uD83C\uDDF9\uD83C\uDDEB","taaf","terres australes et antarctiques francaises","terres australes francaises","terres australes francaises les","territoire des terres australes et antarctiques francaises"]},{iso3:"ATG",iso2:"AG",m49:"028",name:"Antigua and Barbuda",aliases:["\uD83C\uDDE6\uD83C\uDDEC","antigua","antigua barbuda","barbuda"]},{iso3:"AUS",iso2:"AU",m49:"036",name:"Australia",aliases:["\uD83C\uDDE6\uD83C\uDDFA","commonwealth of australia","new holland","new hollandia","nova hollandia"]},{iso3:"AUT",iso2:"AT",m49:"040",name:"Austria",aliases:["\uD83C\uDDE6\uD83C\uDDF9","osterreich","republic of austria","republik osterreich","zweite republik"]},{iso3:"AZE",iso2:"AZ",m49:"031",name:"Azerbaijan",aliases:["\uD83C\uDDE6\uD83C\uDDFF","azərbaycan","azərbaycan respublikası","republic of azerbaijan"]},{iso3:"BDI",iso2:"BI",m49:"108",name:"Burundi",aliases:["\uD83C\uDDE7\uD83C\uDDEE","gouvernement du burundi","la republique du burundi","republic of burundi","republika yu burundi","republika yuburundi","republique du burundi","repuburika yuburundi","uburundi"]},{iso3:"BEL",iso2:"BE",m49:"056",name:"Belgium",aliases:["\uD83C\uDDE7\uD83C\uDDEA","belg","belgie","belgien","belgique","kingdom of belgium","konigreich belgien","koninkrijk belgie","royaume de belgique"]},{iso3:"BEN",iso2:"BJ",m49:"204",name:"Benin",aliases:["\uD83C\uDDE7\uD83C\uDDEF","dahomey","la republique du benin","republic of benin","republique du benin"]},{iso3:"BES",iso2:"BQ",m49:"535",name:"Bonaire, Sint Eustatius and Saba",aliases:["\uD83C\uDDE7\uD83C\uDDF6","bes eilanden","bes islands","bijzondere gemeente","bonaire","bonaire saint eustatius and saba","bonaire sint eustatius en saba","caraibisch nederland","caribbean netherlands","caribisch nederland","hulanda karibense","islanan bes","netherlands antilles","saba","sint eustatius"]},{iso3:"BFA",iso2:"BF",m49:"854",name:"Burkina Faso",aliases:["\uD83C\uDDE7\uD83C\uDDEB","republic of burkina faso","republic of upper volta"]},{iso3:"BGD",iso2:"BD",m49:"050",name:"Bangladesh",aliases:["\uD83C\uDDE7\uD83C\uDDE9","bangla desh","east pakistan","gonaoprojatontri bangladesh","peoples republic of bangladesh","গণপ্রজাতন্ত্রী বাংলাদেশ","বাংলা দেশ","বাংলাদেশ","বিডি"]},{iso3:"BGR",iso2:"BG",m49:"100",name:"Bulgaria",aliases:["\uD83C\uDDE7\uD83C\uDDEC","bulgarian republic","republic of bulgaria","republika bulgaria","republika bulgariya","бг","българия","република българия"]},{iso3:"BHR",iso2:"BH",m49:"048",name:"Bahrain",aliases:["\uD83C\uDDE7\uD83C\uDDED","bahrein islands","kingdom of bahrain","البحرين","دولة البحرين","مملكة البحرين"]},{iso3:"BHS",iso2:"BS",m49:"044",name:"Bahamas",aliases:["\uD83C\uDDE7\uD83C\uDDF8","bahama islands","bahamas the","commonwealth of the bahamas"]},{iso3:"BIH",iso2:"BA",m49:"070",name:"Bosnia and Herzegovina",aliases:["\uD83C\uDDE7\uD83C\uDDE6","bosna","bosna i hercegovina","bosnia","bosnia and hercegovina","bosnia herzegovina","hercegovina","herzegovina","бих","босна","босна и херцеговина","бх"]},{iso3:"BLM",iso2:"BL",m49:"652",name:"Saint Barth\xe9lemy",aliases:["\uD83C\uDDE7\uD83C\uDDF1","collectivite doutre mer de saint barthelemy","collectivite territoriale de saint barthelemy","collectivity of saint barthelemy","saint barth","saint barths","saint barts","saint bartz"]},{iso3:"BLR",iso2:"BY",m49:"112",name:"Belarus",aliases:["\uD83C\uDDE7\uD83C\uDDFE","republic of belarus","respublika belarus","respublika byelarus","беларуская рэспубліка","беларусь","белая русь","белоруссия","рб","республика беларусь","рэспубліка беларусь"]},{iso3:"BLZ",iso2:"BZ",m49:"084",name:"Belize",aliases:["\uD83C\uDDE7\uD83C\uDDFF"]},{iso3:"BMU",iso2:"BM",m49:"060",name:"Bermuda",aliases:["\uD83C\uDDE7\uD83C\uDDF2","barmuda","barmuda i","barmuda isl","barmuda islands","barmudas","bermoothes","bermuda islands","bermudas","bermudian islands","colony of bermuda","devils isles","isle of devils","somers islands","somers isles","summers isles","territory of bermuda","virgineola"]},{iso3:"BOL",iso2:"BO",m49:"068",name:"Bolivia (Plurinational State of)",aliases:["\uD83C\uDDE7\uD83C\uDDF4","bolivia","bulibiya","estado plurinacional de bolivia","plurinational state of bolivia","puliwya","republic of bolivia","republica de bolivia","volivia","wuliwiya","wuliwya"]},{iso3:"BRA",iso2:"BR",m49:"076",name:"Brazil",aliases:["\uD83C\uDDE7\uD83C\uDDF7","brasil","federative republic of brazil","pindorama","republica federativa do brasil"]},{iso3:"BRB",iso2:"BB",m49:"052",name:"Barbados",aliases:["\uD83C\uDDE7\uD83C\uDDE7","barbadoes"]},{iso3:"BRN",iso2:"BN",m49:"096",name:"Brunei Darussalam",aliases:["\uD83C\uDDE7\uD83C\uDDF3","brunei","nation of brunei the abode of peace","negara brunei darussalam"]},{iso3:"BTN",iso2:"BT",m49:"064",name:"Bhutan",aliases:["\uD83C\uDDE7\uD83C\uDDF9","kingdom of bhutan","འབྲུག","འབྲུག་ཡུལ་","འབྲུགཡུལ་་"]},{iso3:"BVT",iso2:"BV",m49:"074",name:"Bouvet Island",aliases:["\uD83C\uDDE7\uD83C\uDDFB"]},{iso3:"BWA",iso2:"BW",m49:"072",name:"Botswana",aliases:["\uD83C\uDDE7\uD83C\uDDFC","lefatshe la botswana","republic of botswana"]},{iso3:"CAF",iso2:"CF",m49:"140",name:"Central African Republic",aliases:["\uD83C\uDDE8\uD83C\uDDEB","centrafricaine republique","centrafrique","central africa","kodorosese ti beafrika","la republique","rep centrafrique","republique centrafricaine"]},{iso3:"CAN",iso2:"CA",m49:"124",name:"Canada",aliases:["\uD83C\uDDE8\uD83C\uDDE6","le canada"]},{iso3:"CCK",iso2:"CC",m49:"166",name:"Cocos (Keeling) Islands",aliases:["\uD83C\uDDE8\uD83C\uDDE8","cocos islands","keeling islands","territory of the cocos keeling islands"]},{iso3:"CHE",iso2:"CH",m49:"756",name:"Switzerland",aliases:["\uD83C\uDDE8\uD83C\uDDED","confederation helvetique","confederation suisse","confederazione elvetica","confederazione svizzera","confederaziun svizra","confoederatio helvetica","confœderatio helvetica","eidgenossenschaft","elvezia","helvetie","la confederation suisse","schweiz","schweizerische eidgenossenschaft","suisse","svizra","svizzera","swiss","swiss confederation"]},{iso3:"CHL",iso2:"CL",m49:"152",name:"Chile",aliases:["\uD83C\uDDE8\uD83C\uDDF1","republic of chile","republica de chile"]},{iso3:"CHN",iso2:"CN",m49:"156",name:"China",aliases:["\uD83C\uDDE8\uD83C\uDDF3","china pr","peoples republic of china","pr china","prc","中华人民共和国","中国"]},{iso3:"CIV",iso2:"CI",m49:"384",name:"C\xf4te d'Ivoire",aliases:["\uD83C\uDDE8\uD83C\uDDEE","cote ivoire","ivory coast","republic of cote divoire","republic of ivory coast","republic of the ivory coast","republique de cote divoire"]},{iso3:"CMR",iso2:"CM",m49:"120",name:"Cameroon",aliases:["\uD83C\uDDE8\uD83C\uDDF2","cameroun","la republique du cameroun","republic of cameroon","republique du cameroun"]},{iso3:"COD",iso2:"CD",m49:"180",name:"Democratic Republic of the Congo",aliases:["\uD83C\uDDE8\uD83C\uDDE9","congo belge","congo democratic republic of the","congo kinshasa","dem rep congo","dem republic of congo","dem republic of the congo","democratic republic of congo","dr congo","drc","rd congo","rep demcongo","republic of the congo","republique democratique du congo","republique du zaire","zaire"]},{iso3:"COG",iso2:"CG",m49:"178",name:"Congo",aliases:["\uD83C\uDDE8\uD83C\uDDEC","congo brazza","congo brazzaville","congo republic","rep congo","republic of congo","republique du congo"]},{iso3:"COK",iso2:"CK",m49:"184",name:"Cook Islands",aliases:["\uD83C\uDDE8\uD83C\uDDF0","cook group","hervey islands"]},{iso3:"COL",iso2:"CO",m49:"170",name:"Colombia",aliases:["\uD83C\uDDE8\uD83C\uDDF4","republic of colombia","republica de colombia"]},{iso3:"COM",iso2:"KM",m49:"174",name:"Comoros",aliases:["\uD83C\uDDF0\uD83C\uDDF2","comores","comores archipel","etat comorien","lunion des comores","republique des comores","republique federale et islamique des comores","republique federale islamique des comores","territoire des comores","union des comores","union of the comoros","إتحاد القمر","اتحاد جزر القمر","الاتحاد القمري","القمر","جزر القمر","جمهورية القمر المتحدة","جمهورية جزر القمر الاتحادية الإسلامية","جمهورية جزرالقمر المتحدة"]},{iso3:"CPV",iso2:"CV",m49:"132",name:"Cabo Verde",aliases:["\uD83C\uDDE8\uD83C\uDDFB","cape verde","cape verde islands","kab verd","kabu verdi","kauberdi","republic of cabo verde","republic of cape verde","republica de cabo verde"]},{iso3:"CRI",iso2:"CR",m49:"188",name:"Costa Rica",aliases:["\uD83C\uDDE8\uD83C\uDDF7","republic of costa rica","republica de costa rica"]},{iso3:"CUB",iso2:"CU",m49:"192",name:"Cuba",aliases:["\uD83C\uDDE8\uD83C\uDDFA","isla juana","republic of cuba","republica de cuba"]},{iso3:"CUW",iso2:"CW",m49:"531",name:"Cura\xe7ao",aliases:["\uD83C\uDDE8\uD83C\uDDFC","corsou","corsouw","corsow","country of curacao","curacau","curacoa","curazao","curaςao","curocao","island territory of curacao","korsou","land curacao","pais korsou"]},{iso3:"CXR",iso2:"CX",m49:"162",name:"Christmas Island",aliases:["\uD83C\uDDE8\uD83C\uDDFD","christmas island other territories","christmas island other territories australia","territory of christmas island"]},{iso3:"CYM",iso2:"KY",m49:"136",name:"Cayman Islands",aliases:["\uD83C\uDDF0\uD83C\uDDFE","caymans"]},{iso3:"CYP",iso2:"CY",m49:"196",name:"Cyprus",aliases:["\uD83C\uDDE8\uD83C\uDDFE","greek administration of southern cyprus","greek cypriot state","guney kıbrıs","guney kıbrıs rum cumhuriyeti","guney kıbrıs rum kesimi","guney kıbrıs rum yonetimi","kipriaki dhimokratia","kıbrıs","kıbrıs cumhuriyeti","kıbrıs rum kesimi","kypriaki dimokratia","kypros","republic of cyprus","κυπριακη δημοκρατια","κυπρος"]},{iso3:"CZE",iso2:"CZ",m49:"203",name:"Czechia",aliases:["\uD83C\uDDE8\uD83C\uDDFF","ceska republika","ceske kraje","ceske uzemi","ceske zeme","cesko","cr","czech republic"]},{iso3:"DEU",iso2:"DE",m49:"276",name:"Germany",aliases:["\uD83C\uDDE9\uD83C\uDDEA","br deutschland","bundesrepublik","bundesrepublik deutschland","deutschland","federal republic of germany"]},{iso3:"DJI",iso2:"DJ",m49:"262",name:"Djibouti",aliases:["\uD83C\uDDE9\uD83C\uDDEF","la republique de djibouti","republic of djibouti","republique de djibouti","جمهورية جيبوتي","جيبوتي"]},{iso3:"DMA",iso2:"DM",m49:"212",name:"Dominica",aliases:["\uD83C\uDDE9\uD83C\uDDF2","commonwealth of dominica","island of dominica","waitu kubuli"]},{iso3:"DNK",iso2:"DK",m49:"208",name:"Denmark",aliases:["\uD83C\uDDE9\uD83C\uDDF0","dania","danmark","denmark proper","kongeriget danmark","metropolitan denmark"]},{iso3:"DOM",iso2:"DO",m49:"214",name:"Dominican Republic",aliases:["\uD83C\uDDE9\uD83C\uDDF4","dominicana","domrep","haiti espanol","quisqueya","republica de santo domingo","republica dominicana","santo domingo"]},{iso3:"DZA",iso2:"DZ",m49:"012",name:"Algeria",aliases:["\uD83C\uDDE9\uD83C\uDDFF","peoples democratic republic of algeria","الجزائر","الجزاير","الجمهورية الجزائرية الديمقراطية الشعبية","الدزاير","دزاير"]},{iso3:"ECU",iso2:"EC",m49:"218",name:"Ecuador",aliases:["\uD83C\uDDEA\uD83C\uDDE8","ecuadorian state","el ecuador","estado ecuatoriano","republic of ecuador","republic of equator","republic of the equator","republica del ecuador"]},{iso3:"EGY",iso2:"EG",m49:"818",name:"Egypt",aliases:["\uD83C\uDDEA\uD83C\uDDEC","arab rep egypt","arab republic of egypt","rep egypt","republic of egypt","جمهورية مصر العربية","مصر"]},{iso3:"ERI",iso2:"ER",m49:"232",name:"Eritrea",aliases:["\uD83C\uDDEA\uD83C\uDDF7","ertra","hagere ertra","hagere iertra","iertra","iritriya","state of eritrea","إرتريا","إريتريا","ارتريا","ارتيريا","اريتريا","دولة إرتريا","دولة إريتريا","ሃገረ ኤርትራ","ኤርትራ"]},{iso3:"ESH",iso2:"EH",m49:"732",name:"Western Sahara",aliases:["\uD83C\uDDEA\uD83C\uDDED","southern provinces","spanish sahara","west sahara"]},{iso3:"ESP",iso2:"ES",m49:"724",name:"Spain",aliases:["\uD83C\uDDEA\uD83C\uDDF8","espana","estado espanol","kingdom of spain","reino de espana"]},{iso3:"EST",iso2:"EE",m49:"233",name:"Estonia",aliases:["\uD83C\uDDEA\uD83C\uDDEA","eesti","eesti noukogude sotsialistlik vabariik","eesti vabariik","estland","republic of estonia"]},{iso3:"ETH",iso2:"ET",m49:"231",name:"Ethiopia",aliases:["\uD83C\uDDEA\uD83C\uDDF9","federal democratic republic of ethiopia","ityopiya","yeityopiya federalawi demokrasiyawi ripeblik","yeityopiya hizbawi dimokrasiyawi ripublik","ኢትዮጵያ","የኢትዮጵያ ፌዴራላዊ ዴሞክራሲያዊ ሪፐብሊክ"]},{iso3:"FIN",iso2:"FI",m49:"246",name:"Finland",aliases:["\uD83C\uDDEB\uD83C\uDDEE","republic of finland","republiken finland","suomen tasavalta","suomi"]},{iso3:"FJI",iso2:"FJ",m49:"242",name:"Fiji",aliases:["\uD83C\uDDEB\uD83C\uDDEF","fiji ganarajya","matanitu ko viti","matanitu tugalala o viti","republic of fiji","republic of the fiji islands","viti"]},{iso3:"FLK",iso2:"FK",m49:"238",name:"Falkland Islands (Malvinas)",aliases:["\uD83C\uDDEB\uD83C\uDDF0","colony of the falkland islands","falkland islands","falklands","islas malvinas","malvinas","malvinas islands"]},{iso3:"FRA",iso2:"FR",m49:"250",name:"France",aliases:["\uD83C\uDDEB\uD83C\uDDF7","fr","french republic","la france","la republique francaise","lhexagone","republique francaise"]},{iso3:"FRO",iso2:"FO",m49:"234",name:"Faroe Islands",aliases:["\uD83C\uDDEB\uD83C\uDDF4","faer oer","f\xe6r\xf8","faeroe is","faeroe islands","faeroe isles","f\xe6r\xf8erne","faeroes","far oer","faroe island","faroe isles","faroes","faroese islands","f\xf8roya","f\xf8royar","f\xf8royum"]},{iso3:"FSM",iso2:"FM",m49:"583",name:"Micronesia (Federated States of)",aliases:["\uD83C\uDDEB\uD83C\uDDF2","fed sts micronesia","fed sts of micronesia","federated states of micronesia","federated states of micronesia fsm","micronesia"]},{iso3:"GAB",iso2:"GA",m49:"266",name:"Gabon",aliases:["\uD83C\uDDEC\uD83C\uDDE6","gabonese republic","la republique gabonaise","le gabon","republique du gabon","republique gabonaise"]},{iso3:"GBR",iso2:"GB",m49:"826",name:"United Kingdom of Great Britain and Northern Ireland",aliases:["\uD83C\uDDEC\uD83C\uDDE7","britain","england","great britain","great britain and northern ireland","northern ireland","scotland","uk","united kingdom","wales"]},{iso3:"GEO",iso2:"GE",m49:"268",name:"Georgia",aliases:["\uD83C\uDDEC\uD83C\uDDEA","georgia country","republic of georgia","sakartvelo","қырҭтәыла","საქართველო","საქართველოს რესპუბლიკა"]},{iso3:"GGY",iso2:"GG",m49:"831",name:"Guernsey",aliases:["\uD83C\uDDEC\uD83C\uDDEC","bailiwick of guernsey","bailliage de guernesey","bailliage de guernesi","giernesi","great britain guernsey","guernesey","lisia"]},{iso3:"GHA",iso2:"GH",m49:"288",name:"Ghana",aliases:["\uD83C\uDDEC\uD83C\uDDED","republic of ghana"]},{iso3:"GIB",iso2:"GI",m49:"292",name:"Gibraltar",aliases:["\uD83C\uDDEC\uD83C\uDDEE","rock of gibraltar"]},{iso3:"GIN",iso2:"GN",m49:"324",name:"Guinea",aliases:["\uD83C\uDDEC\uD83C\uDDF3","guinee","guinee conakry","republic of guinea","republique de guinee"]},{iso3:"GLP",iso2:"GP",m49:"312",name:"Guadeloupe",aliases:["\uD83C\uDDEC\uD83C\uDDF5"]},{iso3:"GMB",iso2:"GM",m49:"270",name:"Gambia",aliases:["\uD83C\uDDEC\uD83C\uDDF2","islamic republic of the gambia","republic of the gambia"]},{iso3:"GNB",iso2:"GW",m49:"624",name:"Guinea-Bissau",aliases:["\uD83C\uDDEC\uD83C\uDDFC","guine bissau","republic of guinea bissau","republica da guine bissau"]},{iso3:"GNQ",iso2:"GQ",m49:"226",name:"Equatorial Guinea",aliases:["\uD83C\uDDEC\uD83C\uDDF6","guine equatorial","guinea ecuatorial","guinea espanola","guinee equat","guinee equatoriale","la republique de guinee equatoriale","posesiones espanolas del golfo de guinea","provincia de la guinea ecuatorial","republic of equatorial guinea","republica da guine equatorial","republica de guinea ecuatorial","territorios espanoles del golfo de guinea"]},{iso3:"GRC",iso2:"GR",m49:"300",name:"Greece",aliases:["\uD83C\uDDEC\uD83C\uDDF7","ellada","ellas","elliniki dhimokratia","elliniki dimokratia","greek republic","hellas","hellas greece","hellenic republic","vasilion tis ellados","δημοκρατια της ελλαδας","δημοκρατια της ελλαδος","ελλαδα","ελλας","ελλας ελλαδα","ελληνικη δημοκρατια"]},{iso3:"GRD",iso2:"GD",m49:"308",name:"Grenada",aliases:["\uD83C\uDDEC\uD83C\uDDE9"]},{iso3:"GRL",iso2:"GL",m49:"304",name:"Greenland",aliases:["\uD83C\uDDEC\uD83C\uDDF1","kalaallit nunaat"]},{iso3:"GTM",iso2:"GT",m49:"320",name:"Guatemala",aliases:["\uD83C\uDDEC\uD83C\uDDF9","republic of guatemala","republica de guatemala"]},{iso3:"GUF",iso2:"GF",m49:"254",name:"French Guiana",aliases:["\uD83C\uDDEC\uD83C\uDDEB","fr 973","guiana","guiana france","guyane","guyane francaise","gwiyann","gwiyann franse","lagwiyann"]},{iso3:"GUM",iso2:"GU",m49:"316",name:"Guam",aliases:["\uD83C\uDDEC\uD83C\uDDFA","guahan","guam usa","islan guahan","island of guam","territory of guam"]},{iso3:"GUY",iso2:"GY",m49:"328",name:"Guyana",aliases:["\uD83C\uDDEC\uD83C\uDDFE","co operative republic of guyana","republic of guyana"]},{iso3:"HKG",iso2:"HK",m49:"344",name:"Hong Kong",aliases:["\uD83C\uDDED\uD83C\uDDF0","hksar","hong kong sar","hong kong special administrative region","hong kong special administrative region of the peoples republic of china","hongkong"]},{iso3:"HMD",iso2:"HM",m49:"334",name:"Heard Island and McDonald Islands",aliases:["\uD83C\uDDED\uD83C\uDDF2","heard","heard & mcdonald islands","heard and macdonald islands","heard island","himi","mcdonald","mcdonald island","territory of heard island and mcdonald islands"]},{iso3:"HND",iso2:"HN",m49:"340",name:"Honduras",aliases:["\uD83C\uDDED\uD83C\uDDF3","guaymuras","higueras","honduran republic","republic of honduras","republica de honduras"]},{iso3:"HRV",iso2:"HR",m49:"191",name:"Croatia",aliases:["\uD83C\uDDED\uD83C\uDDF7","hrvatska","republic of croatia","republika hrvatska"]},{iso3:"HTI",iso2:"HT",m49:"332",name:"Haiti",aliases:["\uD83C\uDDED\uD83C\uDDF9","ayiti","haitian republic","la republique dhaiti","repiblik d ayiti","republic of haiti","republique dhaiti"]},{iso3:"HUN",iso2:"HU",m49:"348",name:"Hungary",aliases:["\uD83C\uDDED\uD83C\uDDFA","a magyar koztarsasag","a magyar nepkoztarsasag","harmadik magyar koztarsasag","magyar koztarsasag","magyar nepkoztarsasag","magyarorszag","mo"]},{iso3:"IDN",iso2:"ID",m49:"360",name:"Indonesia",aliases:["\uD83C\uDDEE\uD83C\uDDE9","negara kesatuan republik indonesia","nkri","republic of indonesia","republik indonesia"]},{iso3:"IMN",iso2:"IM",m49:"833",name:"Isle of Man",aliases:["\uD83C\uDDEE\uD83C\uDDF2","ellan vannin","i man","i mann","i mannin","isle of mann","mann","mannin","manx"]},{iso3:"IND",iso2:"IN",m49:"356",name:"India",aliases:["\uD83C\uDDEE\uD83C\uDDF3","al hind","bharat","bharat ganarajya","bharata","bharatvarsh","hindoostan","hindustan","indostan","republic of india","tenjiku","tianzhu","आर्यवर्त","इंडिया","इण्डिया","भारत","भारत गणराज्य","भारतवर्ष","हिंदुस्तान","हिन्दुस्तान","हिन्दोस्तान"]},{iso3:"IOT",iso2:"IO",m49:"086",name:"British Indian Ocean Territory",aliases:["\uD83C\uDDEE\uD83C\uDDF4","biot"]},{iso3:"IRL",iso2:"IE",m49:"372",name:"Ireland",aliases:["\uD83C\uDDEE\uD83C\uDDEA","eire","hibernia","irish republic","poblacht na heireann","republic of ireland","southern ireland"]},{iso3:"IRN",iso2:"IR",m49:"364",name:"Iran (Islamic Republic of)",aliases:["\uD83C\uDDEE\uD83C\uDDF7","iran","islamic rep iran","islamic republic of iran","persia","ایران","ایرانزمین","پارس","جمهوری اسلامی ايران","جمهوری اسلامی ایران","كشور شاهنشاهی ايران"]},{iso3:"IRQ",iso2:"IQ",m49:"368",name:"Iraq",aliases:["\uD83C\uDDEE\uD83C\uDDF6","eraq","iraqe","komar i eraq","republic of iraq","الجمهورية العراقية","العراق","جمهورية العراق","عراق","عێراق"]},{iso3:"ISL",iso2:"IS",m49:"352",name:"Iceland",aliases:["\uD83C\uDDEE\uD83C\uDDF8","icelandic republic","island","ly\xf0veldi\xf0 island","republic of iceland","ysland"]},{iso3:"ISR",iso2:"IL",m49:"376",name:"Israel",aliases:["\uD83C\uDDEE\uD83C\uDDF1","erez yisrael","medinat yisrael","state of israel","yisrael","ישראל","מדינת ישראל"]},{iso3:"ITA",iso2:"IT",m49:"380",name:"Italy",aliases:["\uD83C\uDDEE\uD83C\uDDF9","il bel paese","italia","italian republic","repubblica italiana","republic of italy"]},{iso3:"JAM",iso2:"JM",m49:"388",name:"Jamaica",aliases:["\uD83C\uDDEF\uD83C\uDDF2","commonwealth of jamaica","jamieka","jomieka","jumieka"]},{iso3:"JEY",iso2:"JE",m49:"832",name:"Jersey",aliases:["\uD83C\uDDEF\uD83C\uDDEA","bailliage de jerri","bailliage de jersey","balliwick of jersey","i iersey","i jersey","iersey","iersey i","isle of jersey","jerri","jersey i","jersey island"]},{iso3:"JOR",iso2:"JO",m49:"400",name:"Jordan",aliases:["\uD83C\uDDEF\uD83C\uDDF4","giordania","hashemite kingdom of jordan","kingdom of jordan","state of jordan","yarden","الأردن","الاردن","المملكة الأردنية الهاشمية","المملكة الاردنية الهاشمية"]},{iso3:"JPN",iso2:"JP",m49:"392",name:"Japan",aliases:["\uD83C\uDDEF\uD83C\uDDF5","state of japan","あきつしま","おおやしま","しきしま","ジャパン","しんしゅう","にっぽん","にっぽんこく","にほん","にほんこく","ひいずるくに","ふそう","大八州","扶木之地","扶桑","扶桑国","敷島","日出る国","日本","榑木之地","瑞穂国","神州","秋津島","葦原中国"]},{iso3:"KAZ",iso2:"KZ",m49:"398",name:"Kazakhstan",aliases:["\uD83C\uDDF0\uD83C\uDDFF","qazaqstan","qazaqstan respublikasy","republic of kazakhstan","казахстан","қазақстан","қазақстан республикасы","республика казахстан","рк"]},{iso3:"KEN",iso2:"KE",m49:"404",name:"Kenya",aliases:["\uD83C\uDDF0\uD83C\uDDEA","jamhuri ya kenya","republic of kenya"]},{iso3:"KGZ",iso2:"KG",m49:"417",name:"Kyrgyzstan",aliases:["\uD83C\uDDF0\uD83C\uDDEC","kyrgyz republic","kyrgyz respublikasy","kyrgyzstan respublikasy","кр","кыргыз республикасы","кыргызстан"]},{iso3:"KHM",iso2:"KH",m49:"116",name:"Cambodia",aliases:["\uD83C\uDDF0\uD83C\uDDED","camboya","campuchia","kambodzha","kamboja","kampuchea","kingdom of cambodia","កម្ពុជា","ព្រះរាជាណាចក្រកម្ពុជា"]},{iso3:"KIR",iso2:"KI",m49:"296",name:"Kiribati",aliases:["\uD83C\uDDF0\uD83C\uDDEE","republic of kiribati"]},{iso3:"KNA",iso2:"KN",m49:"659",name:"Saint Kitts and Nevis",aliases:["\uD83C\uDDF0\uD83C\uDDF3","federation of saint christopher and nevis","federation of saint kitts and nevis","kitts & nevis","nevis","saint christopher","saint christopher and nevis","saint kitts"]},{iso3:"KOR",iso2:"KR",m49:"410",name:"Republic of Korea",aliases:["\uD83C\uDDF0\uD83C\uDDF7","korea","korea republic","korea republic of","korea south","rep korea","s korea","south korea","taehan minguk","남조선","남한","대한","대한민국","코리아","한국"]},{iso3:"KWT",iso2:"KW",m49:"414",name:"Kuwait",aliases:["\uD83C\uDDF0\uD83C\uDDFC","state of kuwait","الكويت","دولة الكويت"]},{iso3:"LAO",iso2:"LA",m49:"418",name:"Lao People's Democratic Republic",aliases:["\uD83C\uDDF1\uD83C\uDDE6","laos","sathalanalat paxathipatai paxaxon lao","ສາທາລະນະລັດ ປະຊາທິປະໄຕ ປະຊາຊົນລາວ","ປະເທດລາວ","ລາວ"]},{iso3:"LBN",iso2:"LB",m49:"422",name:"Lebanon",aliases:["\uD83C\uDDF1\uD83C\uDDE7","lebanese republic","republic of lebanon","state of lebanon","الجمهورية اللبنانية","لبنان"]},{iso3:"LBR",iso2:"LR",m49:"430",name:"Liberia",aliases:["\uD83C\uDDF1\uD83C\uDDF7","liber","republic of liberia"]},{iso3:"LBY",iso2:"LY",m49:"434",name:"Libya",aliases:["\uD83C\uDDF1\uD83C\uDDFE","state of libya","الجماهيرية العربية الليبية الشعبية الإشتراكية","الجمهورية الليبية","الليبي","الليبية","الليبين","دولة ليبيا","ليببيا","ليبي","ليبيا","ليبية"]},{iso3:"LCA",iso2:"LC",m49:"662",name:"Saint Lucia",aliases:["\uD83C\uDDF1\uD83C\uDDE8","hewanorra","iyonola"]},{iso3:"LIE",iso2:"LI",m49:"438",name:"Liechtenstein",aliases:["\uD83C\uDDF1\uD83C\uDDEE","furstentum lichtenstein","furstentum liechtenstein","principality of liechtenstein"]},{iso3:"LKA",iso2:"LK",m49:"144",name:"Sri Lanka",aliases:["\uD83C\uDDF1\uD83C\uDDF0","ceylan","ceylon","democratic socialist republic of sri lanka","ilankaic cananayaka cocalicak kutiyarcu","lankava","prajatantravadi samajavadi janarajaya sri lanka","serendib","srilanka","taprobane","இலங்கை","இலங்கை சனநாயக சோசலிசக் குடியரசு","இலங்கை சனநாயக சோஷலிசக் குடியரசு","ஈழம்","சிலோன்","ලංකාව","ශ්රී ලංකා ප්රජාතන්ත්රවාදී සමාජවාදී ජනරජය","ශ්රී ලංකාව","ශ්‍රී ලංකාව"]},{iso3:"LSO",iso2:"LS",m49:"426",name:"Lesotho",aliases:["\uD83C\uDDF1\uD83C\uDDF8","kingdom of lesotho","mmuso wa lesotho","mountain kingdom"]},{iso3:"LTU",iso2:"LT",m49:"440",name:"Lithuania",aliases:["\uD83C\uDDF1\uD83C\uDDF9","lietuva","lietuvos respublika","republic of lithuania"]},{iso3:"LUX",iso2:"LU",m49:"442",name:"Luxembourg",aliases:["\uD83C\uDDF1\uD83C\uDDFA","grand duche","grand duche de luxembourg","grand duchy of luxembourg","gro\xdfherzogtum luxemburg","groussherzogtum letzebuerg","le grand duche de luxembourg","letzebuerg","letzebuerger land","lux","luxemburg"]},{iso3:"LVA",iso2:"LV",m49:"428",name:"Latvia",aliases:["\uD83C\uDDF1\uD83C\uDDFB","latveja","latvejas republika","latvian republic","latvija","latvijas republika","letmо","letmо vabamо","republic of latvia"]},{iso3:"MAC",iso2:"MO",m49:"446",name:"Macao",aliases:["\uD83C\uDDF2\uD83C\uDDF4","aomen","macao sar","macao special administrative region","macao special administrative region of the peoples republic of china","macau","macau rae da china","macau sar","macau special administrative region","macau special administrative region of the peoples republic of china","raem","regiao administrativa especial de macau","regiao administrativa especial de macau da republica popular da china","中國澳門特別行政區","澳門"]},{iso3:"MAF",iso2:"MF",m49:"663",name:"Saint Martin (French Part)",aliases:["\uD83C\uDDF2\uD83C\uDDEB","collectivite de saint martin","collectivity of saint martin","saint martin","saint martin antilles francaises","saint martin france"]},{iso3:"MAR",iso2:"MA",m49:"504",name:"Morocco",aliases:["\uD83C\uDDF2\uD83C\uDDE6","kingdom of morocco","المغرب","المملكة المغربية","ⴰⵎⵓⵔ ⵏ ⵡⴰⴽⵓⵛ","ⴰⵎⵕⵕⵓⴽ","ⵍⵎⵕⵕⵓⴽ","ⵍⵎⵖⵔⵉⴱ","ⵜⴰⴳⵍⴷⵉⵜ ⵏ ⵍⵎⵖⵔⵉⴱ"]},{iso3:"MCO",iso2:"MC",m49:"492",name:"Monaco",aliases:["\uD83C\uDDF2\uD83C\uDDE8","fort hercule","la principaute de monaco","monaco rattachee au district de menton en 1793","munegu","principality and diocese of monaco","principality of monaco","principatu de munegu","principaute de monaco"]},{iso3:"MDA",iso2:"MD",m49:"498",name:"Republic of Moldova",aliases:["\uD83C\uDDF2\uD83C\uDDE9","moldavia","moldova","moldova republic of","moldova republica","r moldova","rep moldova","republica moldova","молдова"]},{iso3:"MDG",iso2:"MG",m49:"450",name:"Madagascar",aliases:["\uD83C\uDDF2\uD83C\uDDEC","la republique de madagascar","madagasikara","repoblikani madagasikara","republic of madagascar","republique de madagascar"]},{iso3:"MDV",iso2:"MV",m49:"462",name:"Maldives",aliases:["\uD83C\uDDF2\uD83C\uDDFB","dhivehi raajjeyge jumhooriyyaa","republic of maldives","ދިވެހި ރާއްޖެ","ދިވެހިރާއްޖެ","ދިވެހިރާއްޖޭގެ ޖުމުހޫރިއްޔާ","ދިވެހިރާއްޖޭގެ ޖުމްހޫރިއްޔާ"]},{iso3:"MEX",iso2:"MX",m49:"484",name:"Mexico",aliases:["\uD83C\uDDF2\uD83C\uDDFD","estados unidos mejicanos","estados unidos mexicanos","mejico","mexican republic","mexican united states","mexihco","mexihko","mexika sentik wexteyowalko","mexiko","mexko","mexko axkayotl","mexko tlalli","nueva espana","republica mejicana","republica mexicana","united mexican states","united states of mexico"]},{iso3:"MHL",iso2:"MH",m49:"584",name:"Marshall Islands",aliases:["\uD83C\uDDF2\uD83C\uDDED","aelon kein ad","aolepan aorokin majel","jolet jen anij","majel","majol","republic of the marshall islands"]},{iso3:"MKD",iso2:"MK",m49:"807",name:"North Macedonia",aliases:["\uD83C\uDDF2\uD83C\uDDF0","former yugoslav republic of macedonia","fyr macedonia","fyrom","irjm","ish republika jugosllave e maqedonise","macedonia","macedonia former yugoslav republic of","macedonia fyr","maqedoni","maqedonia","maqedonia e veriut","republic of macedonia","republic of north macedonia","republika e maqedonise","republika e maqedonise se veriut","македонија","република македонија","република северна македонија","рм","рсм","северна македонија"]},{iso3:"MLI",iso2:"ML",m49:"466",name:"Mali",aliases:["\uD83C\uDDF2\uD83C\uDDF1","maali","republic of mali"]},{iso3:"MLT",iso2:"MT",m49:"470",name:"Malta",aliases:["\uD83C\uDDF2\uD83C\uDDF9","malta island","repubblika ta malta","republic of malta"]},{iso3:"MMR",iso2:"MM",m49:"104",name:"Myanmar",aliases:["\uD83C\uDDF2\uD83C\uDDF2","burma","pyidaungzu myanma naingngandaw","pyidaungzu thammada myanma naingngandaw","republic of the union of myanmar","union of burma","ပြည်ထောင်စု မြန်မာနိုင်ငံ","ပြည်ထောင်စု မြန်မာနိုင်ငံတော်","ပြည်ထောင်စု သမ္မတ မြန်မာနိုင်ငံ","ပြည်ထောင်စု သမ္မတ မြန်မာနိုင်ငံတော်","ပြည်ထောင်စုမြန်မာနိုင်ငံတော်","ပြည်ထောင်စုသမ္မတမြန်မာနိုင်ငံ","ပြ‌ည်ထောင်စုသမ္မတမြန်မာနိုင်ငံ","ပြည်ထောင်စုသမ္မတမြန်မာနိုင်ငံတော်","ဗမာပြည်","မြန်မာ","မြန်မာနိုင်ငံ","မြန်မာနိုင်ငံတော်","မြန်မာပြည်"]},{iso3:"MNE",iso2:"ME",m49:"499",name:"Montenegro",aliases:["\uD83C\uDDF2\uD83C\uDDEA","crna cora","црна гора"]},{iso3:"MNG",iso2:"MN",m49:"496",name:"Mongolia",aliases:["\uD83C\uDDF2\uD83C\uDDF3","bugd nayramdah mongol ard uls","mongol uls","state of mongolia","монгол","монгол улс","ᠮᠤᠩᠭᠤᠯ ᠤᠯᠤᠰ"]},{iso3:"MNP",iso2:"MP",m49:"580",name:"Northern Mariana Islands",aliases:["\uD83C\uDDF2\uD83C\uDDF5","cnmi","commonwealth of the northern maria islands","commonwealth of the northern mariana islands","northern marianas","notte marianas","sankattan siha na islas marianas"]},{iso3:"MOZ",iso2:"MZ",m49:"508",name:"Mozambique",aliases:["\uD83C\uDDF2\uD83C\uDDFF","mocambique","republic of mozambique","republica de mocambique"]},{iso3:"MRT",iso2:"MR",m49:"478",name:"Mauritania",aliases:["\uD83C\uDDF2\uD83C\uDDF7","islamic republic of mauritania","الجمهورية الإسلامية الموريتانية","موريتانيا"]},{iso3:"MSR",iso2:"MS",m49:"500",name:"Montserrat",aliases:["\uD83C\uDDF2\uD83C\uDDF8","island of montserrat"]},{iso3:"MTQ",iso2:"MQ",m49:"474",name:"Martinique",aliases:["\uD83C\uDDF2\uD83C\uDDF6","territorial collectivity of martinique"]},{iso3:"MUS",iso2:"MU",m49:"480",name:"Mauritius",aliases:["\uD83C\uDDF2\uD83C\uDDFA","ile maurice","la republique de maurice","maurice","moris","republic of mauritius","republique de maurice"]},{iso3:"MWI",iso2:"MW",m49:"454",name:"Malawi",aliases:["\uD83C\uDDF2\uD83C\uDDFC","republic of malawi"]},{iso3:"MYS",iso2:"MY",m49:"458",name:"Malaysia",aliases:["\uD83C\uDDF2\uD83C\uDDFE","federation of malaysia","malaysia federation","negara seberang tambak","persekutuan malaysia"]},{iso3:"MYT",iso2:"YT",m49:"175",name:"Mayotte",aliases:["\uD83C\uDDFE\uD83C\uDDF9","departement de mayotte","departement region de mayotte","department of mayotte"]},{iso3:"NAM",iso2:"NA",m49:"516",name:"Namibia",aliases:["\uD83C\uDDF3\uD83C\uDDE6","republic of namibia"]},{iso3:"NCL",iso2:"NC",m49:"540",name:"New Caledonia",aliases:["\uD83C\uDDF3\uD83C\uDDE8","caledonie","kanaky","kanaky nouvelle caledonie","nouvelle caledonie","territoire de la nouvelle caledonie et dependances","territoire des nouvelle caledonie et dependances","territory of new caledonia and dependencies"]},{iso3:"NER",iso2:"NE",m49:"562",name:"Niger",aliases:["\uD83C\uDDF3\uD83C\uDDEA","jamhuriyar nijar","nijar","republic niger","republic of niger","republic of the niger"]},{iso3:"NFK",iso2:"NF",m49:"574",name:"Norfolk Island",aliases:["\uD83C\uDDF3\uD83C\uDDEB","norfolk island australia","norfolk island other territories","norfolk island other territories australia","territory of norfolk island"]},{iso3:"NGA",iso2:"NG",m49:"566",name:"Nigeria",aliases:["\uD83C\uDDF3\uD83C\uDDEC","federal republic of nigeria","naija"]},{iso3:"NIC",iso2:"NI",m49:"558",name:"Nicaragua",aliases:["\uD83C\uDDF3\uD83C\uDDEE","republic of nicaragua","republica de nicaragua"]},{iso3:"NIU",iso2:"NU",m49:"570",name:"Niue",aliases:["\uD83C\uDDF3\uD83C\uDDFA"]},{iso3:"NLD",iso2:"NL",m49:"528",name:"Kingdom of the Netherlands",aliases:["\uD83C\uDDF3\uD83C\uDDF1","hollandt","kingdom of netherlands","koninkrijk der nederlanden","nederland","nederlanden","nederlandt","netherlands","netherlands kingdom of the"]},{iso3:"NOR",iso2:"NO",m49:"578",name:"Norway",aliases:["\uD83C\uDDF3\uD83C\uDDF4","kingdom of norway","kongeriket noreg","kongeriket norge","noreg","norge"]},{iso3:"NPL",iso2:"NP",m49:"524",name:"Nepal",aliases:["\uD83C\uDDF3\uD83C\uDDF5","bal bo","bal poi yul","bal yul","balbo","balpo","balpo yul","nipal","sanghiya loktantrik ganatantra nepal","नेपाल","संघिय लोकतान्त्रिक गणतन्त्र नेपाल","संघिय लोकतान्त्रिक गणतन्त्रात्मक नेपाल","संघीय लोकतान्त्रिक गणतन्त्र नेपाल"]},{iso3:"NRU",iso2:"NR",m49:"520",name:"Naoero",aliases:["\uD83C\uDDF3\uD83C\uDDF7","nauru","pleasant island","republic of naoero","republic of nauru"]},{iso3:"NZL",iso2:"NZ",m49:"554",name:"New Zealand",aliases:["\uD83C\uDDF3\uD83C\uDDFF","aotearoa","aotearoa new zealand","dominion of new zealand"]},{iso3:"OMN",iso2:"OM",m49:"512",name:"Oman",aliases:["\uD83C\uDDF4\uD83C\uDDF2","sultanate of oman","uman","سلطنة عمان","عمان"]},{iso3:"PAK",iso2:"PK",m49:"586",name:"Pakistan",aliases:["\uD83C\uDDF5\uD83C\uDDF0","hoi quoc","islamic republic of pakistan","republic of pakistan","tay hoi","اسلامی جمہوریہ پاکستان","باکستان","پاکستان"]},{iso3:"PAN",iso2:"PA",m49:"591",name:"Panama",aliases:["\uD83C\uDDF5\uD83C\uDDE6","republic of panama","republica de panama"]},{iso3:"PCN",iso2:"PN",m49:"612",name:"Pitcairn",aliases:["\uD83C\uDDF5\uD83C\uDDF3","occas island","pisskern aliеn","pitcairn henderson ducie and oeno islands","pitcairn island","pitcairn islands","pitkern ailen"]},{iso3:"PER",iso2:"PE",m49:"604",name:"Peru",aliases:["\uD83C\uDDF5\uD83C\uDDEA","piruw","piruw ripuwlika","republic of peru","republica del peru"]},{iso3:"PHL",iso2:"PH",m49:"608",name:"Philippines",aliases:["\uD83C\uDDF5\uD83C\uDDED","philippine islands","republic of the philippines"]},{iso3:"PLW",iso2:"PW",m49:"585",name:"Palau",aliases:["\uD83C\uDDF5\uD83C\uDDFC","belau","peeloo","pelew","pelew islands","pellew","republic of belau","republic of palau","パラオ","パラオ共和国"]},{iso3:"PNG",iso2:"PG",m49:"598",name:"Papua New Guinea",aliases:["\uD83C\uDDF5\uD83C\uDDEC","independent state of papua new guinea","papua niugini"]},{iso3:"POL",iso2:"PL",m49:"616",name:"Poland",aliases:["\uD83C\uDDF5\uD83C\uDDF1","polska","republic of poland","rzeczpospolita polska"]},{iso3:"PRI",iso2:"PR",m49:"630",name:"Puerto Rico",aliases:["\uD83C\uDDF5\uD83C\uDDF7","boriken","borinquen","boriquen","commonwealth of puerto rico","estado libre asociado de puerto rico","free associated state of puerto rico","isla del encanto","island of enchantment","isle of enchantment","mancomunidad de puerto rico","porto rico","territorio de puerto rico","territorio estadounidense de puerto rico","territory of porto rico","territory of puerto rico"]},{iso3:"PRK",iso2:"KP",m49:"408",name:"Democratic People's Republic of Korea",aliases:["\uD83C\uDDF0\uD83C\uDDF5","choson minjujuui inmin konghwaguk","dpr korea","dprk","korea democratic peoples republic of","n korea","north korea","공화국","북조선","북한","조선","조선민주주의인민공화국"]},{iso3:"PRT",iso2:"PT",m49:"620",name:"Portugal",aliases:["\uD83C\uDDF5\uD83C\uDDF9","republica portuguesa"]},{iso3:"PRY",iso2:"PY",m49:"600",name:"Paraguay",aliases:["\uD83C\uDDF5\uD83C\uDDFE","paraguai","republic of paraguay","republica del paraguay","teta paraguai"]},{iso3:"PSE",iso2:"PS",m49:"275",name:"State of Palestine",aliases:["\uD83C\uDDF5\uD83C\uDDF8","palestine","palestine state of","palestinian authority","palestinian national authority","palestinian territory","west bank and gaza","أراضي فلسطينية","الأراضي الفلسطينية","الدولة الفلسطينية","السلطة الفلسطينية","السلطة الوطنية الفلسطينية","الضفة الغربية وقطاع غزة","دولة فلسطين","فلسطين"]},{iso3:"PYF",iso2:"PF",m49:"258",name:"French Polynesia",aliases:["\uD83C\uDDF5\uD83C\uDDEB","f oh","french establishments in oceania","french oceania","french settlements in oceania","polynesie francaise","territoire de la polynesie francaise","territory of french polynesia"]},{iso3:"QAT",iso2:"QA",m49:"634",name:"Qatar",aliases:["\uD83C\uDDF6\uD83C\uDDE6","state of qatar","إمارة قطر","دولة قطر","قطر"]},{iso3:"REU",iso2:"RE",m49:"638",name:"R\xe9union",aliases:["\uD83C\uDDF7\uD83C\uDDEA","ile bourbon","ile de la reunion","la reunion","re","region reunion","reunion island"]},{iso3:"ROU",iso2:"RO",m49:"642",name:"Romania",aliases:["\uD83C\uDDF7\uD83C\uDDF4"]},{iso3:"RUS",iso2:"RU",m49:"643",name:"Russian Federation",aliases:["\uD83C\uDDF7\uD83C\uDDFA","federation of russia","russia","россииская федерация","россия","рф"]},{iso3:"RWA",iso2:"RW",m49:"646",name:"Rwanda",aliases:["\uD83C\uDDF7\uD83C\uDDFC","igihugu cyimisozi igihumbi","jamhuri ya rwanda","la republique du rwanda","land of a thousand hills","republic of rwanda","republika yu rwanda","republique du rwanda","republique rwandaise","repubulika yu rwanda","u rwanda"]},{iso3:"SAU",iso2:"SA",m49:"682",name:"Saudi Arabia",aliases:["\uD83C\uDDF8\uD83C\uDDE6","kingdom of saudi arabia","الدولة السعودية","الدوله السعوديه","السعودية","السعوديه","العربية السعودية","المملكة","المملكة السعودية","المملكة العربية","المملكة العربية السعودية","المملكه","المملكه العربيه السعوديه","بلاد الحرمين الشريفين","دولة آل سعود","سعودية","سعوديه","منبع الرسالة","مهبط الوحي"]},{iso3:"SDN",iso2:"SD",m49:"729",name:"Sudan",aliases:["\uD83C\uDDF8\uD83C\uDDE9","al sudan","as sudan","north sudan","republic of sudan","republic of the sudan","soudan","السودان","جمهورية السودان"]},{iso3:"SEN",iso2:"SN",m49:"686",name:"Senegal",aliases:["\uD83C\uDDF8\uD83C\uDDF3","la republique du senegal","republic of senegal","republique du senegal","sen","senegaal"]},{iso3:"SGP",iso2:"SG",m49:"702",name:"Singapore",aliases:["\uD83C\uDDF8\uD83C\uDDEC","garden city","lion city","republic of singapore","republik singapura","singapore city","singapura","spore","சிங்கப்பூர்","சிங்கப்பூர் குடியரசு","சிங்கை","ஸிங்கபூர்"]},{iso3:"SGS",iso2:"GS",m49:"239",name:"South Georgia and the South Sandwich Islands",aliases:["\uD83C\uDDEC\uD83C\uDDF8","falkland islands dependencies","sgssi","south georgia","south georgia & south sandwich islands","south sandwich islands"]},{iso3:"SHN",iso2:"SH",m49:"654",name:"Saint Helena",aliases:["\uD83C\uDDF8\uD83C\uDDED","ascension","saint helena and dependencies","saint helena ascension and tristan da cunha","tristan da cunha"]},{iso3:"SJM",iso2:"SJ",m49:"744",name:"Svalbard and Jan Mayen Islands",aliases:["\uD83C\uDDF8\uD83C\uDDEF","jan mayen","svalbard","svalbard and jan mayen","svalbard og jan mayen"]},{iso3:"SLB",iso2:"SB",m49:"090",name:"Solomon Islands",aliases:["\uD83C\uDDF8\uD83C\uDDE7"]},{iso3:"SLE",iso2:"SL",m49:"694",name:"Sierra Leone",aliases:["\uD83C\uDDF8\uD83C\uDDF1","republic of sierra leone"]},{iso3:"SLV",iso2:"SV",m49:"222",name:"El Salvador",aliases:["\uD83C\uDDF8\uD83C\uDDFB","republic of el salvador","republica de el salvador","salvador"]},{iso3:"SMR",iso2:"SM",m49:"674",name:"San Marino",aliases:["\uD83C\uDDF8\uD83C\uDDF2","most serene republic of san marino","repubblica di san marino","serenissima repubblica di san marino"]},{iso3:"SOM",iso2:"SO",m49:"706",name:"Somalia",aliases:["\uD83C\uDDF8\uD83C\uDDF4","as sumal","federal republic of somalia","jamhuuriyadda federaalka soomaaliya","jamhuuriyadda soomaaliyeed","soomaaliya","soomaaliyeey toosoo","الصومال","جمهورية الصومال","جمهورية الصومال الديموقراطية","جمهورية الصومال الفيدرالية","صومال"]},{iso3:"SPM",iso2:"PM",m49:"666",name:"Saint Pierre and Miquelon",aliases:["\uD83C\uDDF5\uD83C\uDDF2","collectivite territoriale de saint pierre et miquelon","miquelon","saint pierre","saint pierre et miquelon","territorial collectivity of saint pierre and miquelon"]},{iso3:"SRB",iso2:"RS",m49:"688",name:"Serbia",aliases:["\uD83C\uDDF7\uD83C\uDDF8","republic of serbia","republika srbija","република србија","србија"]},{iso3:"SSD",iso2:"SS",m49:"728",name:"South Sudan",aliases:["\uD83C\uDDF8\uD83C\uDDF8","republic of south sudan","southern sudan"]},{iso3:"STP",iso2:"ST",m49:"678",name:"Sao Tome and Principe",aliases:["\uD83C\uDDF8\uD83C\uDDF9","democratic republic of sao tome and principe","principe","republica democratica de sao tome e principe","sao tome","sao tome e principe","sao tome og principe"]},{iso3:"SUR",iso2:"SR",m49:"740",name:"Suriname",aliases:["\uD83C\uDDF8\uD83C\uDDF7","dutch guiana","republic of surinam","republic of suriname","republiek suriname","surinam","surrinam"]},{iso3:"SVK",iso2:"SK",m49:"703",name:"Slovakia",aliases:["\uD83C\uDDF8\uD83C\uDDF0","slovak republic","slovenska republika","slovensko"]},{iso3:"SVN",iso2:"SI",m49:"705",name:"Slovenia",aliases:["\uD83C\uDDF8\uD83C\uDDEE","republic of slovenia","republika slovenija","slovenija"]},{iso3:"SWE",iso2:"SE",m49:"752",name:"Sweden",aliases:["\uD83C\uDDF8\uD83C\uDDEA","kingdom of sweden","konungadomet sverige","konungariket sverige","kungadomet sverige","kungariket sverige","sverige","swedish kingdom"]},{iso3:"SWZ",iso2:"SZ",m49:"748",name:"Eswatini",aliases:["\uD83C\uDDF8\uD83C\uDDFF","kingdom of eswatini","kingdom of swaziland","swaziland","umbuso weswatini"]},{iso3:"SXM",iso2:"SX",m49:"534",name:"Sint Maarten (Dutch part)",aliases:["\uD83C\uDDF8\uD83C\uDDFD","country of sint maarten","eilandgebied sint maarten","land sint maarten","saint maarten","saint martin dutch part","sint maarten","sint martin"]},{iso3:"SYC",iso2:"SC",m49:"690",name:"Seychelles",aliases:["\uD83C\uDDF8\uD83C\uDDE8","la republique des seychelles","repiblik sesel","republic of seychelles","republique des seychelles"]},{iso3:"SYR",iso2:"SY",m49:"760",name:"Syrian Arab Republic",aliases:["\uD83C\uDDF8\uD83C\uDDFE","surya","syria","الجمهورية العربية السورية","الشام","سوريا","سورية"]},{iso3:"TCA",iso2:"TC",m49:"796",name:"Turks and Caicos Islands",aliases:["\uD83C\uDDF9\uD83C\uDDE8","caicos","caicos islands","turks","turks & caicos","turks islands"]},{iso3:"TCD",iso2:"TD",m49:"148",name:"Chad",aliases:["\uD83C\uDDF9\uD83C\uDDE9","la republique du tchad","republic of chad","republique du tchad","tchad","تشاد","جمهورية تشاد"]},{iso3:"TGO",iso2:"TG",m49:"768",name:"Togo",aliases:["\uD83C\uDDF9\uD83C\uDDEC","la republique togolaise","republique togolaise","togolese republic"]},{iso3:"THA",iso2:"TH",m49:"764",name:"Thailand",aliases:["\uD83C\uDDF9\uD83C\uDDED","kingdom of siam","kingdom of thailand","siam","thai","ไทย","ประเทศไทย","ประเทศสยาม","เมืองไทย","ราชอาณาจักรไทย","ราชอาณาจักรสยาม","สยาม"]},{iso3:"TJK",iso2:"TJ",m49:"762",name:"Tajikistan",aliases:["\uD83C\uDDF9\uD83C\uDDEF","jumhurii tojikiston","republic of tajikistan","тоҷикистон","тҷ","тҷк","ҷт","ҷумҳурии тоҷикистон"]},{iso3:"TKL",iso2:"TK",m49:"772",name:"Tokelau",aliases:["\uD83C\uDDF9\uD83C\uDDF0","tokelau islands","union islands"]},{iso3:"TKM",iso2:"TM",m49:"795",name:"Turkmenistan",aliases:["\uD83C\uDDF9\uD83C\uDDF2"]},{iso3:"TLS",iso2:"TL",m49:"626",name:"Timor-Leste",aliases:["\uD83C\uDDF9\uD83C\uDDF1","democratic republic of timor leste","east timor","republica democratica de timor leste","republika demokratika timor lorosae","timor loro sae","timor lorosae"]},{iso3:"TON",iso2:"TO",m49:"776",name:"Tonga",aliases:["\uD83C\uDDF9\uD83C\uDDF4","friendly islands","kingdom of tonga","puleanga fakatui o tonga","tonga islands"]},{iso3:"TTO",iso2:"TT",m49:"780",name:"Trinidad and Tobago",aliases:["\uD83C\uDDF9\uD83C\uDDF9","republic of trinidad and tobago","tobago","trinidad"]},{iso3:"TUN",iso2:"TN",m49:"788",name:"Tunisia",aliases:["\uD83C\uDDF9\uD83C\uDDF3","republic of tunisia","tunisian republic","الجمهورية التونسية","تونس","تونس الخضراء"]},{iso3:"TUR",iso2:"TR",m49:"792",name:"T\xfcrkiye",aliases:["\uD83C\uDDF9\uD83C\uDDF7","republic of turkey","republic of turkiye","turkey","turkiye cumhuriyeti"]},{iso3:"TUV",iso2:"TV",m49:"798",name:"Tuvalu",aliases:["\uD83C\uDDF9\uD83C\uDDFB","ellice islands"]},{iso3:"TWN",iso2:"TW",m49:"158",name:"Taiwan",aliases:["\uD83C\uDDF9\uD83C\uDDFC","chinese republic","chinese taipei","chunghwa minkuo","chunghwa minkwo","conghwaminku","cunghwa minkwo","cyukamingkok","formosa","nanasian","nationalist china","republic of china","republic of china taiwan","roc","taivang","taiwan province of china","taiwan roc","taywan","taywang","teywan","中華民國","中華民國(臺灣)","中華臺北","台灣","臺澎金馬","臺灣"]},{iso3:"TZA",iso2:"TZ",m49:"834",name:"United Republic of Tanzania",aliases:["\uD83C\uDDF9\uD83C\uDDFF","jamhuri ya muungano wa tanganyika na zanzibar","jamhuri ya muungano wa tanzania","tanzania","tanzania jamhuri ya muungano wa","tanzania united republic of","united republic of tanganyika and zanzibar"]},{iso3:"UGA",iso2:"UG",m49:"800",name:"Uganda",aliases:["\uD83C\uDDFA\uD83C\uDDEC","jamhuri ya uganda","lulu ya afrika","ouganda","pearl of africa","republic of uganda","ugandah"]},{iso3:"UKR",iso2:"UA",m49:"804",name:"Ukraine",aliases:["\uD83C\uDDFA\uD83C\uDDE6","ukr","ukraina","ukrainia","ukrayina","вкраіна","украіна"]},{iso3:"UMI",iso2:"UM",m49:"581",name:"United States Minor Outlying Islands",aliases:["\uD83C\uDDFA\uD83C\uDDF2","us minor outlying islands","us outlying islands","usmoi"]},{iso3:"URY",iso2:"UY",m49:"858",name:"Uruguay",aliases:["\uD83C\uDDFA\uD83C\uDDFE","eastern republic of uruguay","oriental republic of uruguay"]},{iso3:"USA",iso2:"US",m49:"840",name:"United States of America",aliases:["\uD83C\uDDFA\uD83C\uDDF8","amelika","amelika hui pu ia","amelika huipuia","amelika mokuaina hui pu ia","america","eeuu","eeuu de america","estados unidos","estados unidos de america","los estados","los estados unidos","los estados unidos de america","mokuaina hui pu ia","union americana","united states","us","us of a","us of america","usa"]},{iso3:"UZB",iso2:"UZ",m49:"860",name:"Uzbekistan",aliases:["\uD83C\uDDFA\uD83C\uDDFF","ozbek","ozbekiston","ozbekiston respublikasi","republic of uzbekistan","uzbekiston respublikasi"]},{iso3:"VAT",iso2:"VA",m49:"336",name:"Holy See",aliases:["\uD83C\uDDFB\uD83C\uDDE6","citta del vaticano","civitas vaticana","colle vaticano","papal state","santa sede citta del vaticano","state of vatican city","stato della citta del vaticano","status civitatis vaticanae","status civitatis vatican\xe6","vatican","vatican city","vatican city state","vaticano"]},{iso3:"VCT",iso2:"VC",m49:"670",name:"Saint Vincent and the Grenadines",aliases:["\uD83C\uDDFB\uD83C\uDDE8","grenadines","saint vincent","saint vincent and grenadines"]},{iso3:"VEN",iso2:"VE",m49:"862",name:"Venezuela (Bolivarian Republic of)",aliases:["\uD83C\uDDFB\uD83C\uDDEA","bolivarian republic of venezuela","br venezuela","estados unidos de venezuela","rb venezuela","republic of venezuela","republica bolivariana de venezuela","republica de venezuela","venezuela"]},{iso3:"VGB",iso2:"VG",m49:"092",name:"British Virgin Islands",aliases:["\uD83C\uDDFB\uD83C\uDDEC","bvi","virgin islands british","virgin islands of the united kingdom","virgin islands united kingdom"]},{iso3:"VIR",iso2:"VI",m49:"850",name:"United States Virgin Islands",aliases:["\uD83C\uDDFB\uD83C\uDDEE","american virgin islands","us virgin islands","virgin islands of the united states","virgin islands us"]},{iso3:"VNM",iso2:"VN",m49:"704",name:"Viet Nam",aliases:["\uD83C\uDDFB\uD83C\uDDF3","chxhcn viet nam","chxhcnvn","cong hoa xa hoi chu nghia viet nam","socialist republic of viet nam","socialist republic of vietnam","vietnam"]},{iso3:"VUT",iso2:"VU",m49:"548",name:"Vanuatu",aliases:["\uD83C\uDDFB\uD83C\uDDFA","la republique du vanuatu","republic of vanuatu","republique de vanuatu","ripablik blong vanuatu"]},{iso3:"WLF",iso2:"WF",m49:"876",name:"Wallis and Futuna Islands",aliases:["\uD83C\uDDFC\uD83C\uDDEB","collectivite des iles wallis et futuna","emeni simete","futuna","iles wallis et futuna","makape papilio","territoire de wallis et futuna","territoire des iles wallis et futuna","wallis","wallis & futuna","wallis et futuna"]},{iso3:"WSM",iso2:"WS",m49:"882",name:"Samoa",aliases:["\uD83C\uDDFC\uD83C\uDDF8","independent state of samoa","malo saoloto tutoatasi o samoa","samoa i sisifo","western samoa"]},{iso3:"YEM",iso2:"YE",m49:"887",name:"Yemen",aliases:["\uD83C\uDDFE\uD83C\uDDEA","rep yemen","republic of yemen","الجمهورية اليمنية","اليمن","دولة اليمن"]},{iso3:"ZAF",iso2:"ZA",m49:"710",name:"South Africa",aliases:["\uD83C\uDDFF\uD83C\uDDE6","aferika borwa","aforika borwa","afrika boroa","afrika borwa","afrika dzonga","afurika tshipembe","emzantsi afrika","iningizimu afrika","iriphabhulikhi ye ningizimu afrika","iriphabhulikhi yeningizimu afrika","iriphabhuliki yase ningizimu afrika","iriphabliki yasemzantsi afrika","iriphabliki yaseningizimu afrika","iriphabliki yom zantsi afrika","isewula afrika","repabliki ya afrika borwa","rephaboliki ya aforika borwa","rephaboliki ya afrika borwa","republic of south africa","republiek van suid afrika","riphabliki ra afrika dzonga","rsa","suid afrika","umzansi","umzantsi afrika","unie van suid afrika","union of south africa"]},{iso3:"ZMB",iso2:"ZM",m49:"894",name:"Zambia",aliases:["\uD83C\uDDFF\uD83C\uDDF2","northern rhodesia","republic of zambia"]},{iso3:"ZWE",iso2:"ZW",m49:"716",name:"Zimbabwe",aliases:["\uD83C\uDDFF\uD83C\uDDFC","ezimbabwe","izimbabwe","republic of zimbabwe","rhodesia","southern rhodesia","zimbabwe rhodesia","zimbagwe"]}];function u(t){return t.normalize("NFD").replace(/[\u0300-\u036F]/g,"").normalize("NFC").toLowerCase().replace(/[\u064B-\u065F]/g,"").replace(/['\u2018\u2019\u02BB\u02BC\u02BD\u02C8\u2032`]/g,"").replace(/&/g," and ").replace(/([,(])\s*the\b/g,"$1").replace(/[.(),[\]]/g,"").replace(/[-\u2013\u2014]/g," ").replace(/\bst\b/g,"saint").trim().replace(/\s+/g," ").replace(/^the\s+/,"")}function c(t){let r=new Map,i=new Map,n=new Map;for(let a of t)r.set(a.iso3,a),a.iso2&&i.set(a.iso2,a),a.m49&&n.set(a.m49,a);let a=new Map;for(let r of t)for(let t of[r.name,...r.aliases]){let i=u(t),n=a.get(i);if(void 0!==n&&n!==r.iso3)throw Error(`Duplicate name/alias "${i}": ${n} vs ${r.iso3}`);a.set(i,r.iso3)}function o(t){if(null==t)return;let o=String(t).trim();if(!o)return;if(/^\d+$/.test(o)){let t=n.get(String(parseInt(o,10)).padStart(3,"0"));if(t)return t}if(/^[A-Za-z]{2}$/.test(o)){let t=i.get(o.toUpperCase());if(t)return t}if(/^[A-Za-z]{3}$/.test(o)){let t=r.get(o.toUpperCase());if(t)return t}let s=a.get(u(o));return void 0===s?void 0:r.get(s)}return{lookup:o,lookupAlpha3:function(t){var r;return null==(r=o(t))?void 0:r.iso3},byAlpha3:r,byAlpha2:i,byM49:n}}var h=c(l),d=h.lookup,f=h.lookupAlpha3,p=h.byAlpha3,m=h.byAlpha2,g=h.byM49}}),px=g({"node_modules/@turf/helpers/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var r={centimeters:0x25f96350,centimetres:0x25f96350,degrees:360/(2*Math.PI),feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:0x17bbde120,millimetres:0x17bbde120,nauticalmiles:6371008.8/1852,radians:1,yards:6967335.223679999},i={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function n(t,r,i={}){let a={type:"Feature"};return(0===i.id||i.id)&&(a.id=i.id),i.bbox&&(a.bbox=i.bbox),a.properties=r||{},a.geometry=t,a}function a(t,r,i={}){if(!t)throw Error("coordinates is required");if(!Array.isArray(t))throw Error("coordinates must be an Array");if(t.length<2)throw Error("coordinates must be at least 2 numbers long");if(!m(t[0])||!m(t[1]))throw Error("coordinates must contain numbers");return n({type:"Point",coordinates:t},r,i)}function o(t,r,i={}){for(let r of t){if(r.length<4)throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(r[r.length-1].length!==r[0].length)throw Error("First and last Position are not equivalent.");for(let t=0;t180?t-360:t<-180?t+360:t},t.bearingToAzimuth=function(t){let r=t%360;return r<0&&(r+=360),r},t.convertArea=function(t,r="meters",n="kilometers"){if(!(t>=0))throw Error("area must be a positive number");let a=i[r];if(!a)throw Error("invalid original units");let o=i[n];if(!o)throw Error("invalid final units");return t/a*o},t.convertLength=function(t,r="kilometers",i="kilometers"){if(!(t>=0))throw Error("length must be a positive number");return d(f(t,r),i)},t.degreesToRadians=function(t){return t%360*Math.PI/180},t.earthRadius=6371008.8,t.factors=r,t.feature=n,t.featureCollection=l,t.geometry=function(t,r,i={}){switch(t){case"Point":return a(r).geometry;case"LineString":return s(r).geometry;case"Polygon":return o(r).geometry;case"MultiPoint":return c(r).geometry;case"MultiLineString":return u(r).geometry;case"MultiPolygon":return h(r).geometry;default:throw Error(t+" is invalid")}},t.geometryCollection=function(t,r,i={}){return n({type:"GeometryCollection",geometries:t},r,i)},t.isNumber=m,t.isObject=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)},t.lengthToDegrees=function(t,r){return p(f(t,r))},t.lengthToRadians=f,t.lineString=s,t.lineStrings=function(t,r,i={}){return l(t.map(t=>s(t,r)),i)},t.multiLineString=u,t.multiPoint=c,t.multiPolygon=h,t.point=a,t.points=function(t,r,i={}){return l(t.map(t=>a(t,r)),i)},t.polygon=o,t.polygons=function(t,r,i={}){return l(t.map(t=>o(t,r)),i)},t.radiansToDegrees=p,t.radiansToLength=d,t.round=function(t,r=0){if(r&&!(r>=0))throw Error("precision must be a positive number");let i=Math.pow(10,r||0);return Math.round(t*i)/i},t.validateBBox=function(t){if(!t)throw Error("bbox is required");if(!Array.isArray(t))throw Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw Error("bbox must be an Array of 4 or 6 numbers");t.forEach(t=>{if(!m(t))throw Error("bbox must only contain numbers")})},t.validateId=function(t){if(!t)throw Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw Error("id must be a number or a string")}}}),pb=g({"node_modules/@turf/meta/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var r=px();function i(t,r,n){if(null!==t)for(var a,o,s,l,u,c,h,d,f=0,p=0,m=t.type,g="FeatureCollection"===m,y="Feature"===m,v=g?t.features.length:1,x=0;xc||p>h||m>d){u=i,c=a,h=p,d=m,s=0;return}if(!1===n(r.lineString.call(void 0,[u,i],t.properties),a,o,m,s))return!1;s++,u=i}))return!1}}})}function u(t,i){if(!t)throw Error("geojson is required");s(t,function(t,n,a){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===i(t,n,a,0,0))return!1;break;case"Polygon":for(var l=0;lt+function(t){let r=0,i;switch(t.type){case"Polygon":return a(t.coordinates);case"MultiPolygon":for(i=0;i0){r+=Math.abs(l(t[0]));for(let i=1;i=r?(n+2)%r:n+2],u=a[0]*s,c=o[1]*s;i+=(l[0]*s-u)*Math.sin(c),n++}return i*o}t.area=n,t.default=n}}),pw=g({"node_modules/@turf/centroid/dist/cjs/index.cjs"(t){Object.defineProperty(t,"__esModule",{value:!0});var r=px(),i=pb();function n(t,a={}){let o=0,s=0,l=0;return i.coordEach.call(void 0,t,function(t){o+=t[0],s+=t[1],l++},!0),r.point.call(void 0,[o/l,s/l],a.properties)}t.centroid=n,t.default=n}}),pT=g({"node_modules/d3-geo/node_modules/d3-array/dist/d3-array.js"(t,r){(function(t){function r(t,r){return tr?1:t>=r?0:NaN}function i(t){var i;return 1===t.length&&(i=t,t=function(t,n){return r(i(t),n)}),{left:function(r,i,n,a){for(null==n&&(n=0),null==a&&(a=r.length);n>>1;0>t(r[o],i)?n=o+1:a=o}return n},right:function(r,i,n,a){for(null==n&&(n=0),null==a&&(a=r.length);n>>1;t(r[o],i)>0?a=o:n=o+1}return n}}}var n=i(r),a=n.right,o=n.left;function s(t,r){return[t,r]}function l(t){return null===t?NaN:+t}function u(t,r){var i,n,a=t.length,o=0,s=-1,u=0,c=0;if(null==r)for(;++s1)return c/(o-1)}function c(t,r){var i=u(t,r);return i&&Math.sqrt(i)}function h(t,r){var i,n,a,o=t.length,s=-1;if(null==r){for(;++s=i)for(n=a=i;++si&&(n=i),a=i)for(n=a=i;++si&&(n=i),a=0?(o>=v?10:o>=x?5:o>=b?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=v?10:o>=x?5:o>=b?2:1)}function w(t,r,i){var n=Math.abs(r-t)/Math.max(0,i),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/a;return o>=v?a*=10:o>=x?a*=5:o>=b&&(a*=2),r=1)return+i(t[n-1],n-1,t);var n,a=(n-1)*r,o=Math.floor(a),s=+i(t[o],o,t);return s+(i(t[o+1],o+1,t)-s)*(a-o)}}function M(t,r){var i,n,a=t.length,o=-1;if(null==r){for(;++o=i)for(n=i;++oi&&(n=i)}else for(;++o=i)for(n=i;++oi&&(n=i);return n}function k(t){if(!(a=t.length))return[];for(var r=-1,i=M(t,S),n=Array(i);++rt?1:r>=t?0:NaN},t.deviation=c,t.extent=h,t.histogram=function(){var t=g,r=h,i=T;function n(n){var o,s,l=n.length,u=Array(l);for(o=0;od;)f.pop(),--p;var m,g=Array(p+1);for(o=0;o<=p;++o)(m=g[o]=[]).x0=o>0?f[o-1]:h,m.x1=o=i)for(n=i;++on&&(n=i)}else for(;++o=i)for(n=i;++on&&(n=i);return n},t.mean=function(t,r){var i,n=t.length,a=n,o=-1,s=0;if(null==r)for(;++o=0;)for(r=(n=t[a]).length;--r>=0;)i[--s]=n[r];return i},t.min=M,t.pairs=function(t,r){null==r&&(r=s);for(var i=0,n=t.length-1,a=t[0],o=Array(n<0?0:n);ii(a=t[o],l)||0!==i(l,l))&&(l=a,s=o);if(0===i(l,l))return s}},t.shuffle=function(t,r,i){for(var n,a,o=(i??t.length)-(r=null==r?0:+r);o;)a=Math.random()*o--|0,n=t[o+r],t[o+r]=t[a+r],t[a+r]=n;return t},t.sum=function(t,r){var i,n=t.length,a=-1,o=0;if(null==r)for(;++a0)return[t];if((n=r0)for(t=Math.ceil(t/s),o=Array(a=Math.ceil((r=Math.floor(r/s))-t+1));++ltypeof r?t:t.d3=t.d3||{})}}),pA=g({"node_modules/d3-geo/dist/d3-geo.js"(t,r){var i,n;i=t,n=function(t,r){function i(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(t){o(a,t,this.t),o(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new n;function o(t,r,i){var n=t.s=r+i,a=n-r;t.t=r-(n-a)+(i-a)}var s=Math.PI,l=s/2,u=s/4,c=2*s,h=180/s,d=s/180,f=Math.abs,p=Math.atan,m=Math.atan2,g=Math.cos,y=Math.ceil,v=Math.exp,x=Math.log,b=Math.pow,_=Math.sin,w=Math.sign||function(t){return t>0?1:t<0?-1:0},T=Math.sqrt,A=Math.tan;function M(t){return t>1?0:t<-1?s:Math.acos(t)}function k(t){return t>1?l:t<-1?-l:Math.asin(t)}function S(){}function E(t,r){t&&C.hasOwnProperty(t.type)&&C[t.type](t,r)}var D={Feature:function(t,r){E(t.geometry,r)},FeatureCollection:function(t,r){for(var i=t.features,n=-1,a=i.length;++n=0?1:-1,a=n*i,o=g(r),s=_(r),l=B*s,c=R*o+l*g(a),h=l*n*_(a);j.add(m(h,c)),O=t,R=o,B=s}function $(t){return[m(t[1],t[0]),k(t[2])]}function W(t){var r=t[0],i=t[1],n=g(i);return[n*g(r),n*_(r),_(i)]}function Y(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]}function Z(t,r){return[t[1]*r[2]-t[2]*r[1],t[2]*r[0]-t[0]*r[2],t[0]*r[1]-t[1]*r[0]]}function X(t,r){t[0]+=r[0],t[1]+=r[1],t[2]+=r[2]}function K(t,r){return[t[0]*r,t[1]*r,t[2]*r]}function J(t){var r=T(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=r,t[1]/=r,t[2]/=r}var Q,ee,et,er,ei,en,ea,eo,es,el,eu=i(),ec={point:eh,lineStart:ef,lineEnd:ep,polygonStart:function(){ec.point=em,ec.lineStart=eg,ec.lineEnd=ey,eu.reset(),V.polygonStart()},polygonEnd:function(){V.polygonEnd(),ec.point=eh,ec.lineStart=ef,ec.lineEnd=ep,j<0?(Q=-(et=180),ee=-(er=90)):eu>1e-6?er=90:eu<-1e-6&&(ee=-90),el[0]=Q,el[1]=et},sphere:function(){Q=-(et=180),ee=-(er=90)}};function eh(t,r){es.push(el=[Q=t,et=t]),rer&&(er=r)}function ed(t,r){var i=W([t*d,r*d]);if(eo){var n=Z(eo,i),a=Z([n[1],-n[0],0],n);J(a),a=$(a);var o,s=t-ei,l=s>0?1:-1,u=a[0]*h*l,c=f(s)>180;c^(l*eier&&(er=o):c^(l*ei<(u=(u+360)%360-180)&&uer&&(er=r)),c?tev(Q,et)&&(et=t):ev(t,et)>ev(Q,et)&&(Q=t):et>=Q?(tet&&(et=t)):t>ei?ev(Q,t)>ev(Q,et)&&(et=t):ev(t,et)>ev(Q,et)&&(Q=t)}else es.push(el=[Q=t,et=t]);rer&&(er=r),eo=i,ei=t}function ef(){ec.point=ed}function ep(){el[0]=Q,el[1]=et,ec.point=eh,eo=null}function em(t,r){if(eo){var i=t-ei;eu.add(f(i)>180?i+(i>0?360:-360):i)}else en=t,ea=r;V.point(t,r),ed(t,r)}function eg(){V.lineStart()}function ey(){em(en,ea),V.lineEnd(),f(eu)>1e-6&&(Q=-(et=180)),el[0]=Q,el[1]=et,eo=null}function ev(t,r){return(r-=t)<0?r+360:r}function ex(t,r){return t[0]-r[0]}function eb(t,r){return t[0]<=t[1]?t[0]<=r&&r<=t[1]:rs?t+Math.round(-t/c)*c:t,r]}function eK(t,r,i){return(t%=c)?r||i?eZ(eQ(t),e0(r,i)):eQ(t):r||i?e0(r,i):eX}function eJ(t){return function(r,i){return[(r+=t)>s?r-c:r<-s?r+c:r,i]}}function eQ(t){var r=eJ(t);return r.invert=eJ(-t),r}function e0(t,r){var i=g(t),n=_(t),a=g(r),o=_(r);function s(t,r){var s=g(r),l=g(t)*s,u=_(t)*s,c=_(r),h=c*i+l*n;return[m(u*a-h*o,l*i-c*n),k(h*a+u*o)]}return s.invert=function(t,r){var s=g(r),l=g(t)*s,u=_(t)*s,c=_(r),h=c*a-u*o;return[m(u*a+c*o,l*i+h*n),k(h*i-l*n)]},s}function e1(t){function r(r){return r=t(r[0]*d,r[1]*d),r[0]*=h,r[1]*=h,r}return t=eK(t[0]*d,t[1]*d,t.length>2?t[2]*d:0),r.invert=function(r){return r=t.invert(r[0]*d,r[1]*d),r[0]*=h,r[1]*=h,r},r}function e2(t,r,i,n,a,o){if(i){var s=g(r),l=_(r),u=n*i;null==a?(a=r+n*c,o=r-u/2):(a=e3(s,a),o=e3(s,o),(n>0?ao)&&(a+=n*c));for(var h,d=a;n>0?d>o:d-r[2]?-i:i)+c-1e-6)%c}function e5(){var t,r=[];return{point:function(r,i,n){t.push([r,i,n])},lineStart:function(){r.push(t=[])},lineEnd:S,rejoin:function(){r.length>1&&r.push(r.pop().concat(r.shift()))},result:function(){var i=r;return r=[],t=null,i}}}function e4(t,r){return 1e-6>f(t[0]-r[0])&&1e-6>f(t[1]-r[1])}function e6(t,r,i,n){this.x=t,this.z=r,this.o=i,this.e=n,this.v=!1,this.n=this.p=null}function e8(t,r,i,n,a){var o,s,l=[],u=[];if(t.forEach(function(t){if(!((r=t.length-1)<=0)){var r,i,n=t[0],s=t[r];if(e4(n,s)){if(!n[2]&&!s[2]){for(a.lineStart(),o=0;o=0;--o)a.point((h=c[o])[0],h[1]);else n(f.x,f.p.x,-1,a);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);a.lineEnd()}}}function e7(t){if(r=t.length){for(var r,i,n=0,a=t[0];++n=0?1:-1,z=P*L,F=z>s,O=T*C;if(e9.add(m(O*P*_(z),A*I+O*g(z))),h+=F?L+P*c:L,F^b>=i^E>=i){var R=Z(W(x),W(S));J(R);var B=Z(o,R);J(B);var j=(F^L>=0?-1:1)*k(B[2]);(n>j||n===j&&(R[0]||R[1]))&&(d+=F^L>=0?1:-1)}}return(h<-1e-6||h<1e-6&&e9<-1e-6)^1&d}function tr(t,i,n,a){return function(o){var s,l,u,c=i(o),h=e5(),d=i(h),f=!1,p={point:m,lineStart:y,lineEnd:v,polygonStart:function(){p.point=x,p.lineStart=b,p.lineEnd=_,l=[],s=[]},polygonEnd:function(){p.point=m,p.lineStart=y,p.lineEnd=v,l=r.merge(l);var t=tt(s,a);l.length?(f||(o.polygonStart(),f=!0),e8(l,tn,t,n,o)):t&&(f||(o.polygonStart(),f=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),f&&(o.polygonEnd(),f=!1),l=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function m(r,i){t(r,i)&&o.point(r,i)}function g(t,r){c.point(t,r)}function y(){p.point=g,c.lineStart()}function v(){p.point=m,c.lineEnd()}function x(t,r){u.push([t,r]),d.point(t,r)}function b(){d.lineStart(),u=[]}function _(){x(u[0][0],u[0][1]),d.lineEnd();var t,r,i,n,a=d.clean(),c=h.result(),p=c.length;if(u.pop(),s.push(u),u=null,p){if(1&a){if((r=(i=c[0]).length-1)>0){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t1&&2&a&&c.push(c.pop().concat(c.shift())),l.push(c.filter(ti))}}return p}}function ti(t){return t.length>1}function tn(t,r){return((t=t.x)[0]<0?t[1]-l-1e-6:l-t[1])-((r=r.x)[0]<0?r[1]-l-1e-6:l-r[1])}var ta=tr(function(){return!0},function(t){var r,i=NaN,n=NaN,a=NaN;return{lineStart:function(){t.lineStart(),r=1},point:function(o,u){var c,h,d,m,y,v,x,b=o>0?s:-s,w=f(o-i);1e-6>f(w-s)?(t.point(i,n=(n+u)/2>0?l:-l),t.point(a,n),t.lineEnd(),t.lineStart(),t.point(b,n),t.point(o,n),r=0):a!==b&&w>=s&&(1e-6>f(i-a)&&(i-=1e-6*a),1e-6>f(o-b)&&(o-=1e-6*b),c=i,h=n,d=o,m=u,n=f(x=_(c-d))>1e-6?p((_(h)*(v=g(m))*_(d)-_(m)*(y=g(h))*_(c))/(y*v*x)):(h+m)/2,t.point(a,n),t.lineEnd(),t.lineStart(),t.point(b,n),r=0),t.point(i=o,n=u),a=b},lineEnd:function(){t.lineEnd(),i=n=NaN},clean:function(){return 2-r}}},function(t,r,i,n){var a;if(null==t)a=i*l,n.point(-s,a),n.point(0,a),n.point(s,a),n.point(s,0),n.point(s,-a),n.point(0,-a),n.point(-s,-a),n.point(-s,0),n.point(-s,a);else if(f(t[0]-r[0])>1e-6){var o=t[0]0,a=f(r)>1e-6;function o(t,i){return g(t)*g(i)>r}function l(t,i,n){var a=W(t),o=W(i),l=[1,0,0],u=Z(a,o),c=Y(u,u),h=u[0],d=c-h*h;if(!d)return!n&&t;var p=Z(l,u),m=K(l,r*c/d);X(m,K(u,-r*h/d));var g=Y(m,p),y=Y(p,p),v=g*g-y*(Y(m,m)-1);if(!(v<0)){var x=T(v),b=K(p,(-g-x)/y);if(X(b,m),b=$(b),!n)return b;var _,w=t[0],A=i[0],M=t[1],k=i[1];Af(S-s);if(!E&&k0^b[1]<(1e-6>f(b[0]-w)?M:k):M<=b[1]&&b[1]<=k:S>s^(w<=b[0]&&b[0]<=A)){var D=K(p,(-g+x)/y);return X(D,m),[b,$(D)]}}}function u(r,i){var a=n?t:s-t,o=0;return r<-a?o|=1:r>a&&(o|=2),i<-a?o|=4:i>a&&(o|=8),o}return tr(o,function(t){var r,i,c,h,d;return{lineStart:function(){h=c=!1,d=1},point:function(f,p){var m,g,y=[f,p],v=o(f,p),x=n?v?0:u(f,p):v?u(f+(f<0?s:-s),p):0;(!r&&(h=c=v)&&t.lineStart(),v!==c&&(!(g=l(r,y))||e4(r,g)||e4(y,g))&&(y[2]=1),v!==c)?(d=0,v?(t.lineStart(),g=l(y,r),t.point(g[0],g[1])):(g=l(r,y),t.point(g[0],g[1],2),t.lineEnd()),r=g):a&&r&&n^v&&!(x&i)&&(m=l(y,r,!0))&&(d=0,n?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3))),!v||r&&e4(r,y)||t.point(y[0],y[1]),r=y,c=v,i=x},lineEnd:function(){c&&t.lineEnd(),r=null},clean:function(){return d|(h&&c)<<1}}},function(r,n,a,o){e2(o,t,i,a,r,n)},n?[0,-t]:[-s,t-s])}function ts(t,i,n,a){function o(r,o){return t<=r&&r<=n&&i<=o&&o<=a}function s(r,o,s,u){var h=0,d=0;if(null==r||(h=l(r,s))!==(d=l(o,s))||0>c(r,o)^s>0)do u.point(0===h||3===h?t:n,h>1?a:i);while((h=(h+s+4)%4)!==d);else u.point(o[0],o[1])}function l(r,a){return 1e-6>f(r[0]-t)?a>0?0:3:1e-6>f(r[0]-n)?a>0?2:1:1e-6>f(r[1]-i)?+(a>0):a>0?3:2}function u(t,r){return c(t.x,r.x)}function c(t,r){var i=l(t,1),n=l(r,1);return i!==n?i-n:0===i?r[1]-t[1]:1===i?t[0]-r[0]:2===i?t[1]-r[1]:r[0]-t[0]}return function(l){var c,h,d,f,p,m,g,y,v,x,b,_=l,w=e5(),T={point:A,lineStart:function(){T.point=M,h&&h.push(d=[]),x=!0,v=!1,g=y=NaN},lineEnd:function(){c&&(M(f,p),m&&v&&w.rejoin(),c.push(w.result())),T.point=A,v&&_.lineEnd()},polygonStart:function(){_=w,c=[],h=[],b=!0},polygonEnd:function(){var i=function(){for(var r=0,i=0,n=h.length;ia&&(f-o)*(a-s)>(p-s)*(t-o)&&++r:p<=a&&(f-o)*(a-s)<(p-s)*(t-o)&&--r;return r}(),n=b&&i,o=(c=r.merge(c)).length;(n||o)&&(l.polygonStart(),n&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),o&&e8(c,u,i,s,l),l.polygonEnd()),_=l,c=h=d=null}};function A(t,r){o(t,r)&&_.point(t,r)}function M(r,s){var l=o(r,s);if(h&&d.push([r,s]),x)f=r,p=s,m=l,x=!1,l&&(_.lineStart(),_.point(r,s));else if(l&&v)_.point(r,s);else{var u=[g=Math.max(-1e9,Math.min(1e9,g)),y=Math.max(-1e9,Math.min(1e9,y))],c=[r=Math.max(-1e9,Math.min(1e9,r)),s=Math.max(-1e9,Math.min(1e9,s))];!function(t,r,i,n,a,o){var s,l=t[0],u=t[1],c=r[0],h=r[1],d=0,f=1,p=c-l,m=h-u;if(s=i-l,!(!p&&s>0)){if(s/=p,p<0){if(s0){if(s>f)return;s>d&&(d=s)}if(s=a-l,!(!p&&s<0)){if(s/=p,p<0){if(s>f)return;s>d&&(d=s)}else if(p>0){if(s0)){if(s/=m,m<0){if(s0){if(s>f)return;s>d&&(d=s)}if(s=o-u,!(!m&&s<0)){if(s/=m,m<0){if(s>f)return;s>d&&(d=s)}else if(m>0){if(s0&&(t[0]=l+d*p,t[1]=u+d*m),f<1&&(r[0]=l+f*p,r[1]=u+f*m),!0}}}}}(u,c,t,i,n,a)?l&&(_.lineStart(),_.point(r,s),b=!1):(v||(_.lineStart(),_.point(u[0],u[1])),_.point(c[0],c[1]),l||_.lineEnd(),b=!1)}g=r,y=s,v=l}return T}}var tl,tu,tc,th=i(),td={sphere:S,point:S,lineStart:function(){td.point=tp,td.lineEnd=tf},lineEnd:S,polygonStart:S,polygonEnd:S};function tf(){td.point=td.lineEnd=S}function tp(t,r){t*=d,r*=d,tl=t,tu=_(r),tc=g(r),td.point=tm}function tm(t,r){t*=d;var i=_(r*=d),n=g(r),a=f(t-tl),o=g(a),s=n*_(a),l=tc*i-tu*n*o,u=tu*i+tc*n*o;th.add(m(T(s*s+l*l),u)),tl=t,tu=i,tc=n}function tg(t){return th.reset(),P(t,td),+th}var ty=[null,null],tv={type:"LineString",coordinates:ty};function tx(t,r){return ty[0]=t,ty[1]=r,tg(tv)}var tb={Feature:function(t,r){return tw(t.geometry,r)},FeatureCollection:function(t,r){for(var i=t.features,n=-1,a=i.length;++n0&&(a=tx(t[o],t[o-1]))>0&&i<=a&&n<=a&&(i+n-a)*(1-Math.pow((i-n)/a,2))<1e-12*a)return!0;i=n}return!1}function tA(t,r){return!!tt(t.map(tM),tk(r))}function tM(t){return(t=t.map(tk)).pop(),t}function tk(t){return[t[0]*d,t[1]*d]}function tS(t,i,n){var a=r.range(t,i-1e-6,n).concat(i);return function(t){return a.map(function(r){return[t,r]})}}function tE(t,i,n){var a=r.range(t,i-1e-6,n).concat(i);return function(t){return a.map(function(r){return[r,t]})}}function tD(){var t,i,n,a,o,s,l,u,c,h,d,p,m=10,g=10,v=90,x=360,b=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return r.range(y(a/v)*v,n,v).map(d).concat(r.range(y(u/x)*x,l,x).map(p)).concat(r.range(y(i/m)*m,t,m).filter(function(t){return f(t%v)>1e-6}).map(c)).concat(r.range(y(s/g)*g,o,g).filter(function(t){return f(t%x)>1e-6}).map(h))}return _.lines=function(){return w().map(function(t){return{type:"LineString",coordinates:t}})},_.outline=function(){return{type:"Polygon",coordinates:[d(a).concat(p(l).slice(1),d(n).reverse().slice(1),p(u).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(a=+t[0][0],n=+t[1][0],u=+t[0][1],l=+t[1][1],a>n&&(t=a,a=n,n=t),u>l&&(t=u,u=l,l=t),_.precision(b)):[[a,u],[n,l]]},_.extentMinor=function(r){return arguments.length?(i=+r[0][0],t=+r[1][0],s=+r[0][1],o=+r[1][1],i>t&&(r=i,i=t,t=r),s>o&&(r=s,s=o,o=r),_.precision(b)):[[i,s],[t,o]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(v=+t[0],x=+t[1],_):[v,x]},_.stepMinor=function(t){return arguments.length?(m=+t[0],g=+t[1],_):[m,g]},_.precision=function(r){return arguments.length?(b=+r,c=tS(s,o,90),h=tE(i,t,b),d=tS(u,l,90),p=tE(a,n,b),_):b},_.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function tC(t){return t}var tI,tL,tP,tz,tF=i(),tO=i(),tR={point:S,lineStart:S,lineEnd:S,polygonStart:function(){tR.lineStart=tB,tR.lineEnd=tV},polygonEnd:function(){tR.lineStart=tR.lineEnd=tR.point=S,tF.add(f(tO)),tO.reset()},result:function(){var t=tF/2;return tF.reset(),t}};function tB(){tR.point=tj}function tj(t,r){tR.point=tN,tI=tP=t,tL=tz=r}function tN(t,r){tO.add(tz*t-tP*r),tP=t,tz=r}function tV(){tN(tI,tL)}var tU,tq,tG,tH,t$=1/0,tW=1/0,tY=-1/0,tZ=tY,tX={point:function(t,r){ttY&&(tY=t),rtZ&&(tZ=r)},lineStart:S,lineEnd:S,polygonStart:S,polygonEnd:S,result:function(){var t=[[t$,tW],[tY,tZ]];return tY=tZ=-(tW=t$=1/0),t}},tK=0,tJ=0,tQ=0,t0=0,t1=0,t2=0,t3=0,t5=0,t4=0,t6={point:t8,lineStart:t7,lineEnd:rt,polygonStart:function(){t6.lineStart=rr,t6.lineEnd=ri},polygonEnd:function(){t6.point=t8,t6.lineStart=t7,t6.lineEnd=rt},result:function(){var t=t4?[t3/t4,t5/t4]:t2?[t0/t2,t1/t2]:tQ?[tK/tQ,tJ/tQ]:[NaN,NaN];return tK=tJ=tQ=t0=t1=t2=t3=t5=t4=0,t}};function t8(t,r){tK+=t,tJ+=r,++tQ}function t7(){t6.point=t9}function t9(t,r){t6.point=re,t8(tG=t,tH=r)}function re(t,r){var i=t-tG,n=r-tH,a=T(i*i+n*n);t0+=a*(tG+t)/2,t1+=a*(tH+r)/2,t2+=a,t8(tG=t,tH=r)}function rt(){t6.point=t8}function rr(){t6.point=rn}function ri(){ra(tU,tq)}function rn(t,r){t6.point=ra,t8(tU=tG=t,tq=tH=r)}function ra(t,r){var i=t-tG,n=r-tH,a=T(i*i+n*n);t0+=a*(tG+t)/2,t1+=a*(tH+r)/2,t2+=a,t3+=(a=tH*t-tG*r)*(tG+t),t5+=a*(tH+r),t4+=3*a,t8(tG=t,tH=r)}function ro(t){this._context=t}ro.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,r){switch(this._point){case 0:this._context.moveTo(t,r),this._point=1;break;case 1:this._context.lineTo(t,r);break;default:this._context.moveTo(t+this._radius,r),this._context.arc(t,r,this._radius,0,c)}},result:S};var rs,rl,ru,rc,rh,rd=i(),rf={point:S,lineStart:function(){rf.point=rp},lineEnd:function(){rs&&rm(rl,ru),rf.point=S},polygonStart:function(){rs=!0},polygonEnd:function(){rs=null},result:function(){var t=+rd;return rd.reset(),t}};function rp(t,r){rf.point=rm,rl=rc=t,ru=rh=r}function rm(t,r){rc-=t,rh-=r,rd.add(T(rc*rc+rh*rh)),rc=t,rh=r}function rg(){this._string=[]}function ry(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function rv(t){return function(r){var i=new rx;for(var n in t)i[n]=t[n];return i.stream=r,i}}function rx(){}function rb(t,r,i){var n=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=n&&t.clipExtent(null),P(i,t.stream(tX)),r(tX.result()),null!=n&&t.clipExtent(n),t}function r_(t,r,i){return rb(t,function(i){var n=r[1][0]-r[0][0],a=r[1][1]-r[0][1],o=Math.min(n/(i[1][0]-i[0][0]),a/(i[1][1]-i[0][1])),s=+r[0][0]+(n-o*(i[1][0]+i[0][0]))/2,l=+r[0][1]+(a-o*(i[1][1]+i[0][1]))/2;t.scale(150*o).translate([s,l])},i)}function rw(t,r,i){return r_(t,[[0,0],r],i)}function rT(t,r,i){return rb(t,function(i){var n=+r,a=n/(i[1][0]-i[0][0]),o=(n-a*(i[1][0]+i[0][0]))/2,s=-a*i[0][1];t.scale(150*a).translate([o,s])},i)}function rA(t,r,i){return rb(t,function(i){var n=+r,a=n/(i[1][1]-i[0][1]),o=-a*i[0][0],s=(n-a*(i[1][1]+i[0][1]))/2;t.scale(150*a).translate([o,s])},i)}rg.prototype={_radius:4.5,_circle:ry(4.5),pointRadius:function(t){return(t*=1)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,r){switch(this._point){case 0:this._string.push("M",t,",",r),this._point=1;break;case 1:this._string.push("L",t,",",r);break;default:null==this._circle&&(this._circle=ry(this._radius)),this._string.push("M",t,",",r,this._circle)}},result:function(){if(!this._string.length)return null;var t=this._string.join("");return this._string=[],t}},rx.prototype={constructor:rx,point:function(t,r){this.stream.point(t,r)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var rM=g(30*d);function rk(t,r){var i;return+r?function(t,r){function i(n,a,o,s,l,u,c,h,d,p,g,y,v,x){var b=c-n,_=h-a,w=b*b+_*_;if(w>4*r&&v--){var A=s+p,M=l+g,S=u+y,E=T(A*A+M*M+S*S),D=k(S/=E),C=1e-6>f(f(S)-1)||1e-6>f(o-d)?(o+d)/2:m(M,A),I=t(C,D),L=I[0],P=I[1],z=L-n,F=P-a,O=_*z-b*F;(O*O/w>r||f((b*z+_*F)/w-.5)>.3||s*p+l*g+u*y2?t[2]%360*d:0,P()):[x*h,b*h,_*h]},I.angle=function(t){return arguments.length?(w=t%360*d,P()):w*h},I.reflectX=function(t){return arguments.length?(A=t?-1:1,P()):A<0},I.reflectY=function(t){return arguments.length?(M=t?-1:1,P()):M<0},I.precision=function(t){return arguments.length?(s=rk(l,C=t*t),z()):T(C)},I.fitExtent=function(t,r){return r_(I,t,r)},I.fitSize=function(t,r){return rw(I,t,r)},I.fitWidth=function(t,r){return rT(I,t,r)},I.fitHeight=function(t,r){return rA(I,t,r)},function(){return r=t.apply(this,arguments),I.invert=r.invert&&L,P()}}function rI(t){var r=0,i=s/3,n=rC(t),a=n(r,i);return a.parallels=function(t){return arguments.length?n(r=t[0]*d,i=t[1]*d):[r*h,i*h]},a}function rL(t,r){var i=_(t),n=(i+_(r))/2;if(1e-6>f(n)){var a=g(t);function o(t,r){return[t*a,_(r)/a]}return o.invert=function(t,r){return[t/a,k(r*a)]},o}var l=1+i*(2*n-i),u=T(l)/n;function c(t,r){var i=T(l-2*n*_(r))/n;return[i*_(t*=n),u-i*g(t)]}return c.invert=function(t,r){var i=u-r,a=m(t,f(i))*w(i);return i*n<0&&(a-=s*w(t)*w(i)),[a/n,k((l-(t*t+i*i)*n*n)/(2*n))]},c}function rP(){return rI(rL).scale(155.424).center([0,33.6442])}function rz(){return rP().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function rF(t){return function(r,i){var n=g(r),a=g(i),o=t(n*a);return[o*a*_(r),o*_(i)]}}function rO(t){return function(r,i){var n=T(r*r+i*i),a=t(n),o=_(a);return[m(r*o,n*g(a)),k(n&&i*o/n)]}}var rR=rF(function(t){return T(2/(1+t))});rR.invert=rO(function(t){return 2*k(t/2)});var rB=rF(function(t){return(t=M(t))&&t/_(t)});function rj(t,r){return[t,x(A((l+r)/2))]}function rN(t){var r,i,n,a=rD(t),o=a.center,l=a.scale,u=a.translate,c=a.clipExtent,h=null;function d(){var o=s*l(),u=a(e1(a.rotate()).invert([0,0]));return c(null==h?[[u[0]-o,u[1]-o],[u[0]+o,u[1]+o]]:t===rj?[[Math.max(u[0]-o,h),r],[Math.min(u[0]+o,i),n]]:[[h,Math.max(u[1]-o,r)],[i,Math.min(u[1]+o,n)]])}return a.scale=function(t){return arguments.length?(l(t),d()):l()},a.translate=function(t){return arguments.length?(u(t),d()):u()},a.center=function(t){return arguments.length?(o(t),d()):o()},a.clipExtent=function(t){return arguments.length?(null==t?h=r=i=n=null:(h=+t[0][0],r=+t[0][1],i=+t[1][0],n=+t[1][1]),d()):null==h?null:[[h,r],[i,n]]},d()}function rV(t){return A((l+t)/2)}function rU(t,r){var i=g(t),n=t===r?_(t):x(i/g(r))/x(rV(r)/rV(t)),a=i*b(rV(t),n)/n;if(!n)return rj;function o(t,r){a>0?r<-l+1e-6&&(r=-l+1e-6):r>l-1e-6&&(r=l-1e-6);var i=a/b(rV(r),n);return[i*_(n*t),a-i*g(n*t)]}return o.invert=function(t,r){var i=a-r,o=w(n)*T(t*t+i*i),u=m(t,f(i))*w(i);return i*n<0&&(u-=s*w(t)*w(i)),[u/n,2*p(b(a/o,1/n))-l]},o}function rq(t,r){return[t,r]}function rG(t,r){var i=g(t),n=t===r?_(t):(i-g(r))/(r-t),a=i/n+t;if(1e-6>f(n))return rq;function o(t,r){var i=a-r,o=n*t;return[i*_(o),a-i*g(o)]}return o.invert=function(t,r){var i=a-r,o=m(t,f(i))*w(i);return i*n<0&&(o-=s*w(t)*w(i)),[o/n,a-w(n)*T(t*t+i*i)]},o}rB.invert=rO(function(t){return t}),rj.invert=function(t,r){return[t,2*p(v(r))-l]},rq.invert=rq;var rH=T(3)/2;function r$(t,r){var i=k(rH*_(r)),n=i*i,a=n*n*n;return[t*g(i)/(rH*(1.340264+-.24331799999999998*n+a*(.0062510000000000005+.034164*n))),i*(1.340264+-.081106*n+a*(893e-6+.003796*n))]}function rW(t,r){var i=g(r),n=g(t)*i;return[i*_(t)/n,_(r)/n]}function rY(t,r){var i=r*r,n=i*i;return[t*(.8707-.131979*i+n*(-.013791+n*(.003971*i-.001529*n))),r*(1.007226+i*(.015085+n*(-.044475+.028874*i-.005916*n)))]}function rZ(t,r){return[g(r)*_(t),_(r)]}function rX(t,r){var i=g(r),n=1+g(t)*i;return[i*_(t)/n,_(r)/n]}function rK(t,r){return[x(A((l+r)/2)),-t]}r$.invert=function(t,r){for(var i,n,a=r,o=a*a,s=o*o*o,l=0;l<12&&(n=a*(1.340264+-.081106*o+s*(893e-6+.003796*o))-r,a-=i=n/(1.340264+-.24331799999999998*o+s*(.0062510000000000005+.034164*o)),s=(o=a*a)*o*o,!(1e-12>f(i)));++l);return[rH*t*(1.340264+-.24331799999999998*o+s*(.0062510000000000005+.034164*o))/g(a),k(_(a)/rH)]},rW.invert=rO(p),rY.invert=function(t,r){var i,n=r,a=25;do{var o=n*n,s=o*o;n-=i=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-r)/(1.007226+o*(.045255+s*(-.311325+.259866*o-.005916*11*s)))}while(f(i)>1e-6&&--a>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]},rZ.invert=rO(k),rX.invert=rO(function(t){return 2*p(t)}),rK.invert=function(t,r){return[-r,2*p(v(t))-l]},t.geoAlbers=rz,t.geoAlbersUsa=function(){var t,r,i,n,a,o,s=rz(),l=rP().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=rP().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,r){o=[t,r]}};function h(t){var r=t[0],s=t[1];return o=null,i.point(r,s),o||(n.point(r,s),o)||(a.point(r,s),o)}function d(){return t=r=null,h}return h.invert=function(t){var r=s.scale(),i=s.translate(),n=(t[0]-i[0])/r,a=(t[1]-i[1])/r;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?l:a>=.166&&a<.234&&n>=-.214&&n<-.115?u:s).invert(t)},h.stream=function(i){var n,a;return t&&r===i?t:(a=(n=[s.stream(r=i),l.stream(i),u.stream(i)]).length,t={point:function(t,r){for(var i=-1;++iev(n[0],n[1])&&(n[1]=a[1]),ev(a[0],n[1])>ev(n[0],n[1])&&(n[0]=a[0])):o.push(n=a);for(s=-1/0,i=o.length-1,r=0,n=o[i];r<=i;n=a,++r)a=o[r],(l=ev(n[1],a[0]))>s&&(s=l,Q=a[0],et=n[1])}return es=el=null,Q===1/0||ee===1/0?[[NaN,NaN],[NaN,NaN]]:[[Q,ee],[et,er]]},t.geoCentroid=function(t){e_=ew=eT=eA=eM=ek=eS=eE=eD=eC=eI=0,P(t,eR);var r=eD,i=eC,n=eI,a=r*r+i*i+n*n;return a<1e-12&&(r=ek,i=eS,n=eE,ew<1e-6&&(r=eT,i=eA,n=eM),(a=r*r+i*i+n*n)<1e-12)?[NaN,NaN]:[m(i,r)*h,k(n/T(a))*h]},t.geoCircle=function(){var t,r,i=eY([0,0]),n=eY(90),a=eY(6),o={point:function(i,n){t.push(i=r(i,n)),i[0]*=h,i[1]*=h}};function s(){var s=i.apply(this,arguments),l=n.apply(this,arguments)*d,u=a.apply(this,arguments)*d;return t=[],r=eK(-s[0]*d,-s[1]*d,0).invert,e2(o,l,u,1),s={type:"Polygon",coordinates:[t]},t=r=null,s}return s.center=function(t){return arguments.length?(i="function"==typeof t?t:eY([+t[0],+t[1]]),s):i},s.radius=function(t){return arguments.length?(n="function"==typeof t?t:eY(+t),s):n},s.precision=function(t){return arguments.length?(a="function"==typeof t?t:eY(+t),s):a},s},t.geoClipAntimeridian=ta,t.geoClipCircle=to,t.geoClipExtent=function(){var t,r,i,n=0,a=0,o=960,s=500;return i={stream:function(i){return t&&r===i?t:t=ts(n,a,o,s)(r=i)},extent:function(l){return arguments.length?(n=+l[0][0],a=+l[0][1],o=+l[1][0],s=+l[1][1],t=r=null,i):[[n,a],[o,s]]}}},t.geoClipRectangle=ts,t.geoConicConformal=function(){return rI(rU).scale(109.5).parallels([30,30])},t.geoConicConformalRaw=rU,t.geoConicEqualArea=rP,t.geoConicEqualAreaRaw=rL,t.geoConicEquidistant=function(){return rI(rG).scale(131.154).center([0,13.9389])},t.geoConicEquidistantRaw=rG,t.geoContains=function(t,r){return(t&&tb.hasOwnProperty(t.type)?tb[t.type]:tw)(t,r)},t.geoDistance=tx,t.geoEqualEarth=function(){return rD(r$).scale(177.158)},t.geoEqualEarthRaw=r$,t.geoEquirectangular=function(){return rD(rq).scale(152.63)},t.geoEquirectangularRaw=rq,t.geoGnomonic=function(){return rD(rW).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=rW,t.geoGraticule=tD,t.geoGraticule10=function(){return tD()()},t.geoIdentity=function(){var t,r,i,n,a,o,s,l=1,u=0,c=0,f=1,p=1,m=0,y=null,v=1,x=1,b=rv({point:function(t,r){var i=A([t,r]);this.stream.point(i[0],i[1])}}),w=tC;function T(){return v=l*f,x=l*p,o=s=null,A}function A(i){var n=i[0]*v,a=i[1]*x;if(m){var o=a*t-n*r;n=n*t+a*r,a=o}return[n+u,a+c]}return A.invert=function(i){var n=i[0]-u,a=i[1]-c;if(m){var o=a*t+n*r;n=n*t-a*r,a=o}return[n/v,a/x]},A.stream=function(t){return o&&s===t?o:o=b(w(s=t))},A.postclip=function(t){return arguments.length?(w=t,y=i=n=a=null,T()):w},A.clipExtent=function(t){return arguments.length?(w=null==t?(y=i=n=a=null,tC):ts(y=+t[0][0],i=+t[0][1],n=+t[1][0],a=+t[1][1]),T()):null==y?null:[[y,i],[n,a]]},A.scale=function(t){return arguments.length?(l=+t,T()):l},A.translate=function(t){return arguments.length?(u=+t[0],c=+t[1],T()):[u,c]},A.angle=function(i){return arguments.length?(r=_(m=i%360*d),t=g(m),T()):m*h},A.reflectX=function(t){return arguments.length?(f=t?-1:1,T()):f<0},A.reflectY=function(t){return arguments.length?(p=t?-1:1,T()):p<0},A.fitExtent=function(t,r){return r_(A,t,r)},A.fitSize=function(t,r){return rw(A,t,r)},A.fitWidth=function(t,r){return rT(A,t,r)},A.fitHeight=function(t,r){return rA(A,t,r)},A},t.geoInterpolate=function(t,r){var i,n,a=t[0]*d,o=t[1]*d,s=r[0]*d,l=r[1]*d,u=g(o),c=_(o),f=g(l),p=_(l),y=u*g(a),v=u*_(a),x=f*g(s),b=f*_(s),w=2*k(T((i=_((i=l-o)/2))*i+u*f*((n=_((n=s-a)/2))*n))),A=_(w),M=w?function(t){var r=_(t*=w)/A,i=_(w-t)/A,n=i*y+r*x,a=i*v+r*b;return[m(a,n)*h,m(i*c+r*p,T(n*n+a*a))*h]}:function(){return[a*h,o*h]};return M.distance=w,M},t.geoLength=tg,t.geoMercator=function(){return rN(rj).scale(961/c)},t.geoMercatorRaw=rj,t.geoNaturalEarth1=function(){return rD(rY).scale(175.295)},t.geoNaturalEarth1Raw=rY,t.geoOrthographic=function(){return rD(rZ).scale(249.5).clipAngle(90.000001)},t.geoOrthographicRaw=rZ,t.geoPath=function(t,r){var i,n,a=4.5;function o(t){return t&&("function"==typeof a&&n.pointRadius(+a.apply(this,arguments)),P(t,i(n))),n.result()}return o.area=function(t){return P(t,i(tR)),tR.result()},o.measure=function(t){return P(t,i(rf)),rf.result()},o.bounds=function(t){return P(t,i(tX)),tX.result()},o.centroid=function(t){return P(t,i(t6)),t6.result()},o.projection=function(r){return arguments.length?(i=null==r?(t=null,tC):(t=r).stream,o):t},o.context=function(t){return arguments.length?(n=null==t?(r=null,new rg):new ro(r=t),"function"!=typeof a&&n.pointRadius(a),o):r},o.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(n.pointRadius(+t),+t),o):a},o.projection(t).context(r)},t.geoProjection=rD,t.geoProjectionMutator=rC,t.geoRotation=e1,t.geoStereographic=function(){return rD(rX).scale(250).clipAngle(142)},t.geoStereographicRaw=rX,t.geoStream=P,t.geoTransform=function(t){return{stream:rv(t)}},t.geoTransverseMercator=function(){var t=rN(rK),r=t.center,i=t.rotate;return t.center=function(t){return arguments.length?r([-t[1],t[0]]):[(t=r())[1],-t[0]]},t.rotate=function(t){return arguments.length?i([t[0],t[1],t.length>2?t[2]+90:90]):[(t=i())[0],t[1],t[2]-90]},i([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=rK,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&"u">typeof r?n(t,pT()):n((i=i||self).d3=i.d3||{},i.d3)}}),pM=g({"src/lib/usa_location_names.js"(t,r){var i={alabama:"AL",alaska:"AK",arizona:"AZ",arkansas:"AR",california:"CA",colorado:"CO",connecticut:"CT",delaware:"DE","district of columbia":"DC",florida:"FL",georgia:"GA",hawaii:"HI",idaho:"ID",illinois:"IL",indiana:"IN",iowa:"IA",kansas:"KS",kentucky:"KY",louisiana:"LA",maine:"ME",maryland:"MD",massachusetts:"MA",michigan:"MI",minnesota:"MN",mississippi:"MS",missouri:"MO",montana:"MT",nebraska:"NE",nevada:"NV","new hampshire":"NH","new jersey":"NJ","new mexico":"NM","new york":"NY","north carolina":"NC","north dakota":"ND",ohio:"OH",oklahoma:"OK",oregon:"OR",pennsylvania:"PA","rhode island":"RI","south carolina":"SC","south dakota":"SD",tennessee:"TN",texas:"TX",utah:"UT",vermont:"VT",virginia:"VA",washington:"WA","washington dc":"DC","washington d.c.":"DC","west virginia":"WV",wisconsin:"WI",wyoming:"WY"};r.exports={usaLocationAbbreviations:new Set(Object.values(i)),usaLocationList:i}}}),pk={};y(pk,{COUNTRIES_X:()=>pS});var pS,pE=m({"src/lib/custom_country_codes.ts"(){pS=[{iso3:"XAC",iso2:"",m49:"",name:"Aksai Chin",aliases:[]},{iso3:"XAP",iso2:"",m49:"",name:"Arunachal Pradesh",aliases:[]},{iso3:"XBT",iso2:"",m49:"",name:"Bir Tawil",aliases:[]},{iso3:"XHT",iso2:"",m49:"",name:"Halaib Triangle",aliases:[]},{iso3:"XIT",iso2:"",m49:"",name:"Ilemi Triangle",aliases:[]},{iso3:"XJK",iso2:"",m49:"",name:"Jammu and Kashmir",aliases:[]}]}}),pD=g({"src/lib/geo_location_utils.js"(t,r){var i=k(),{COUNTRIES:n,createLookup:a}=pv(),{area:o}=p_(),{centroid:s}=pw(),{coordAll:l}=pb(),{geoBounds:u}=pA(),c=e5(),h=et(),d=F(),f=R(),p=ip(),{usaLocationAbbreviations:m,usaLocationList:g}=pM(),{COUNTRIES_X:y}=(pE(),b(pk)),{lookupAlpha3:v}=a([...n,...y]),x={"ISO-3":c,"USA-states":function(t){return t=t.trim(),(m.has(t.toUpperCase())?t.toUpperCase():g[t.toLowerCase()])||(h.log("Unrecognized US location: "+t+"."),!1)},"country names":function(t){return v(t)||(h.log("Unrecognized country name: "+t+"."),!1)}};function _(t){for(let r=0;r0&&t[r+1][0]<0)return r;return null}function w(t){var r=t.geojson,i=window.PlotlyGeoAssets||{},n="string"==typeof r?i[r]:r;return d(n)?n:(h.error("Oops ... something went wrong when fetching "+r),!1)}function T(t){try{return l(t)}catch{return[]}}function A(t){if(0===t.length)return null;if(1===t.length){let[r,i]=t[0];return[r,i,r,i]}let[[r,i],[n,a]]=u({type:"MultiPoint",coordinates:t});return[r,i,S([r,n])[1],a]}var M=(t,r)=>"geojson"===r.fitbounds&&"geojson-id"===t.locationmode?T(w(t)):[];function S([t,r]){return[t,t>r?r+360:r]}r.exports={locationToFeature:function(t,r,i){var n;if(!r||"string"!=typeof r)return!1;let a=x[t](r);if(a){let r;if("USA-states"===t)for(let t of(r=[],i))(null==(n=t?.properties)?void 0:n.gu)==="USA"&&r.push(t);else r=i;for(let t of r)if(t.id===a)return t;h.log(`Location with id ${a} does not have a matching topojson feature at this resolution.`)}return!1},feature2polygons:function(t){var r,i,n,a,o=t.geometry,s=o.coordinates,l=t.id,u=[];switch(r="RUS"===l||"FJI"===l?function(t){var r;if(null===_(t))r=t;else for(r=Array(t.length),a=0;ar?i[n++]=[t[a][0]+360,t[a][1]]:a===r?(i[n++]=t[a],i[n++]=[t[a][0],-90]):i[n++]=t[a];var o=p.tester(i);o.pts.pop(),u.push(o)}:function(t){u.push(p.tester(t))},o.type){case"MultiPolygon":for(i=0;ia&&(a=c,r=u)}else r=i;return r&&r.coordinates.some(t=>t.length>0)?s(r).geometry.coordinates:[NaN,NaN]}(c),isNaN(c.properties.ct[0])&&h.log(["Location",n.loc,"has no polygon with positive area. Its centroid could not be computed, so hover and selection will not work for it."].join(" ")),n.fIn=t,n.fOut=c,l.push(c)}else h.log(["Location",n.loc,"does not have a valid GeoJSON geometry. Traces with locationmode *geojson-id* only support *Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[i]}switch(i.type){case"FeatureCollection":var d=i.features;for(n=0;n100?(clearInterval(o),n("Unexpected error while fetching from "+t)):void a++},50)})}(o)):(r[o]="pending",n.push(function(t){return new Promise(function(n,a){i.json(t,function(i,o){return i?(delete r[t],a(Error(404===i.status?'GeoJSON at URL "'+t+'" does not exist.':"Unexpected error while fetching from "+t))):(r[t]=o,n(o))})})}(o))))}return n},boundsOfCoords:A,computeBbox:t=>A(T(t)),coordsOf:T,doesCrossAntiMeridian:_,fitGeojsonBbox:(t,r)=>A(M(t,r)),fitGeojsonCoords:M,unwrapLonRange:S,ANTIMERIDIAN_LON_SHIFT:360}}}),pC=g({"src/traces/scattergeo/style.js"(t,r){var i=k(),n=rr(),a=ei(),o=na(),s=o.stylePoints,l=o.styleText;r.exports=function(t,r){var o,u,c,h;r&&(o=t,c=(u=r)[0].trace,(h=u[0].node3).style("opacity",u[0].trace.opacity),s(h,c,o),l(h,c,o),h.selectAll("path.js-line").style("fill","none").each(function(t){var r=i.select(this),o=t.trace,s=o.line||{};r.call(a.stroke,s.color).call(n.dashLine,s.dash||"",s.width||0),"none"!==o.fill&&r.call(a.fill,o.fillcolor)}))}}}),pI=g({"src/traces/scattergeo/plot.js"(t,r){var i=k(),n=t_(),a=pg().getTopojsonFeatures,o=py(),s=pD(),l=ro().findExtremes,u=P().BADNUM,c=i4().calcMarkerSize,h=t8(),d=pC();r.exports={calcGeoJSON:function(t,r){var i,o,h=t[0].trace,d=r[h.geo],f=d._subplot,p=h._length;if(n.isArrayOrTypedArray(h.locations)){var m=h.locationmode,g="geojson-id"===m?s.extractTraceFeature(t):a(h,f.topojson);for(i=0;i")}}(c,g,t,u[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}}}),pP=g({"src/traces/scattergeo/event_data.js"(t,r){r.exports=function(t,r,i,n,a){t.lon=r.lon,t.lat=r.lat,t.location=r.loc?r.loc:null;var o=n[a];return o.fIn&&o.fIn.properties&&(t.properties=o.fIn.properties),t}}}),pz=g({"src/traces/scattergeo/select.js"(t,r){var i=t8(),n=P().BADNUM;r.exports=function(t,r){var a,o,s,l,u,c=t.cd,h=t.xaxis,d=t.yaxis,f=[],p=c[0].trace;if(!i.hasMarkers(p)&&!i.hasText(p))return[];if(!1===r)for(u=0;ur?1:t>=r?0:NaN}function i(t){var i;return 1===t.length&&(i=t,t=function(t,n){return r(i(t),n)}),{left:function(r,i,n,a){for(null==n&&(n=0),null==a&&(a=r.length);n>>1;0>t(r[o],i)?n=o+1:a=o}return n},right:function(r,i,n,a){for(null==n&&(n=0),null==a&&(a=r.length);n>>1;t(r[o],i)>0?a=o:n=o+1}return n}}}var n=i(r),a=n.right,o=n.left;function s(t,r){return[t,r]}function l(t){return null===t?NaN:+t}function u(t,r){var i,n,a=t.length,o=0,s=-1,u=0,c=0;if(null==r)for(;++s1)return c/(o-1)}function c(t,r){var i=u(t,r);return i&&Math.sqrt(i)}function h(t,r){var i,n,a,o=t.length,s=-1;if(null==r){for(;++s=i)for(n=a=i;++si&&(n=i),a=i)for(n=a=i;++si&&(n=i),a=0?(o>=v?10:o>=x?5:o>=b?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=v?10:o>=x?5:o>=b?2:1)}function w(t,r,i){var n=Math.abs(r-t)/Math.max(0,i),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/a;return o>=v?a*=10:o>=x?a*=5:o>=b&&(a*=2),r=1)return+i(t[n-1],n-1,t);var n,a=(n-1)*r,o=Math.floor(a),s=+i(t[o],o,t);return s+(i(t[o+1],o+1,t)-s)*(a-o)}}function M(t,r){var i,n,a=t.length,o=-1;if(null==r){for(;++o=i)for(n=i;++oi&&(n=i)}else for(;++o=i)for(n=i;++oi&&(n=i);return n}function k(t){if(!(a=t.length))return[];for(var r=-1,i=M(t,S),n=Array(i);++rt?1:r>=t?0:NaN},t.deviation=c,t.extent=h,t.histogram=function(){var t=g,r=h,i=T;function n(n){var o,s,l=n.length,u=Array(l);for(o=0;od;)f.pop(),--p;var m,g=Array(p+1);for(o=0;o<=p;++o)(m=g[o]=[]).x0=o>0?f[o-1]:h,m.x1=o=i)for(n=i;++on&&(n=i)}else for(;++o=i)for(n=i;++on&&(n=i);return n},t.mean=function(t,r){var i,n=t.length,a=n,o=-1,s=0;if(null==r)for(;++o=0;)for(r=(n=t[a]).length;--r>=0;)i[--s]=n[r];return i},t.min=M,t.pairs=function(t,r){null==r&&(r=s);for(var i=0,n=t.length-1,a=t[0],o=Array(n<0?0:n);ii(a=t[o],l)||0!==i(l,l))&&(l=a,s=o);if(0===i(l,l))return s}},t.shuffle=function(t,r,i){for(var n,a,o=(i??t.length)-(r=null==r?0:+r);o;)a=Math.random()*o--|0,n=t[o+r],t[o+r]=t[a+r],t[a+r]=n;return t},t.sum=function(t,r){var i,n=t.length,a=-1,o=0;if(null==r)for(;++a0)return[t];if((n=r0)for(t=Math.ceil(t/s),o=Array(a=Math.ceil((r=Math.floor(r/s))-t+1));++ltypeof r?t:t.d3=t.d3||{})}}),pO=g({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(t,r){var i;i=function(t,r,i){var n=Math.abs,a=Math.atan,o=Math.atan2,s=Math.cos,l=Math.exp,u=Math.floor,c=Math.log,h=Math.max,d=Math.min,f=Math.pow,p=Math.round,m=Math.sign||function(t){return t>0?1:t<0?-1:0},g=Math.sin,y=Math.tan,v=Math.PI,x=v/2,b=v/4,_=Math.SQRT1_2,w=D(2),T=D(v),A=2*v,M=180/v,k=v/180;function S(t){return t>1?x:t<-1?-x:Math.asin(t)}function E(t){return t>1?0:t<-1?v:Math.acos(t)}function D(t){return t>0?Math.sqrt(t):0}function C(t){return(l(t)-l(-t))/2}function I(t){return(l(t)+l(-t))/2}function L(t){var r=y(t/2),i=2*c(s(t/2))/(r*r);function a(t,r){var n=s(t),a=s(r),o=g(r),l=a*n,u=-((1-l?c((1+l)/2)/(1-l):-.5)+i/(1+l));return[u*a*g(t),u*o]}return a.invert=function(r,a){var l,u=D(r*r+a*a),h=-t/2,d=50;if(!u)return[0,0];do{var f=h/2,p=s(f),m=g(f),y=m/p,v=-c(n(p));h-=l=(2/y*v-i*y-u)/(-v/(m*m)+1-i/(2*p*p))*(p<0?.7:1)}while(n(l)>1e-6&&--d>0);var x=g(h);return[o(r*x,u*s(h)),S(a*x/u)]},a}function P(t,r){var i,n=s(r),a=(i=E(n*s(t/=2)))?i/Math.sin(i):1;return[2*n*g(t)*a,g(r)*a]}function z(t){var r=g(t),i=s(t),a=t>=0?1:-1,l=y(a*t),u=(1+r-i)/2;function c(t,n){var c=s(n),h=s(t/=2);return[(1+c)*g(t),(a*n>-o(h,l)-.001?0:-(10*a))+u+g(n)*i-(1+c)*r*h]}return c.invert=function(t,c){var h=0,d=0,f=50;do{var p=s(h),m=g(h),y=s(d),v=g(d),x=1+y,b=x*m-t,_=u+v*i-x*r*p-c,w=x*p/2,T=-m*v,A=r*x*m/2,M=i*y+r*p*v,k=T*A-M*w,S=(_*T-b*M)/k/2,E=(b*A-_*w)/k;n(E)>2&&(E/=2),h-=S,d-=E}while((n(S)>1e-6||n(E)>1e-6)&&--f>0);return a*d>-o(s(h),l)-.001?[2*h,d]:null},c}function F(t,r){var i=y(r/2),n=D(1-i*i),a=1+n*s(t/=2),o=g(t)*n/a,l=i/a,u=o*o,c=l*l;return[4/3*o*(3+u-3*c),4/3*l*(3+3*u-c)]}P.invert=function(t,r){if(!(t*t+4*r*r>v*v+1e-6)){var i=t,a=r,o=25;do{var l,u=g(i),c=g(i/2),h=s(i/2),d=g(a),f=s(a),p=g(2*a),m=d*d,y=f*f,x=c*c,b=1-y*h*h,_=b?E(f*h)*D(l=1/b):l=0,w=2*_*f*c-t,T=_*d-r,A=l*(y*x+_*f*h*m),M=l*(.5*u*p-2*_*d*c),k=.25*l*(p*c-_*d*y*u),S=l*(m*h+_*x*f),C=M*k-S*A;if(!C)break;var I=(T*M-w*S)/C,L=(w*k-T*A)/C;i-=I,a-=L}while((n(I)>1e-6||n(L)>1e-6)&&--o>0);return[i,a]}},F.invert=function(t,r){if(r*=3/8,!(t*=3/8)&&n(r)>1)return null;var i,a,l=1+t*t+r*r,u=D((l-D(l*l-4*r*r))/2),h=S(u)/3,d=u?c((i=n(r/u))+D(i*i-1))/3:c((a=n(t))+D(a*a+1))/3,f=s(h),p=I(d),y=p*p-f*f;return[2*m(t)*o(C(d)*f,.25-y),2*m(r)*o(p*g(h),.25+y)]};var O=D(8),R=c(1+w);function B(t,r){var i=n(r);return ix){var u=o(l[1],l[0]),c=D(l[0]*l[0]+l[1]*l[1]),h=i*p((u-x)/i)+x,d=o(g(u-=h),2-s(u));u=h+S(v/c*g(d))-d,l[0]=c*s(u),l[1]=c*g(u)}return l}return l.invert=function(t,n){var l=D(t*t+n*n);if(l>x){var u=o(n,t),c=i*p((u-x)/i)+x,h=u>c?-1:1,d=l*s(c-u),f=1/y(h*E((d-v)/D(v*(v-2*d)+l*l)));t=l*s(u=c+2*a((f+h*D(f*f-3))/3)),n=l*g(u)}return r.geoAzimuthalEquidistantRaw.invert(t,n)},l}function N(t,i){if(arguments.length<2&&(i=t),1===i)return r.geoAzimuthalEqualAreaRaw;if(i===1/0)return V;function n(n,a){var o=r.geoAzimuthalEqualAreaRaw(n/i,a);return o[0]*=t,o}return n.invert=function(n,a){var o=r.geoAzimuthalEqualAreaRaw.invert(n/t,a);return o[0]*=i,o},n}function V(t,r){return[t*s(r)/s(r/=2),2*g(r)]}function U(t,r,i){var a,o,s,l=100;i=void 0===i?0:+i,r*=1;do(o=t(i))===(s=t(i+1e-6))&&(s=o+1e-6),i-=a=-1e-6*(o-r)/(o-s);while(l-- >0&&n(a)>1e-6);return l<0?NaN:i}function q(t,r,i){return void 0===r&&(r=40),void 0===i&&(i=1e-12),function(a,o,s,l){var u,c,h;s=void 0===s?0:+s,l=void 0===l?0:+l;for(var d=0;du){s-=c/=2,l-=h/=2;continue}u=g;var y=(s>0?-1:1)*i,v=(l>0?-1:1)*i,x=t(s+y,l),b=t(s,l+v),_=(x[0]-f[0])/y,w=(x[1]-f[1])/y,T=(b[0]-f[0])/v,A=(b[1]-f[1])/v,M=A*_-w*T,k=(.5>n(M)?.5:1)/M;if(c=(m*T-p*A)*k,h=(p*w-m*_)*k,s+=c,l+=h,n(c)0&&(a[1]*=1+o/1.5*a[0]*a[0]),a}return r.invert=q(r),r}function H(t,r){var i,a=t*g(r),o=30;do r-=i=(r+g(r)-a)/(1+s(r));while(n(i)>1e-6&&--o>0);return r/2}function $(t,r,i){function n(n,a){return[t*n*s(a=H(i,a)),r*g(a)]}return n.invert=function(n,a){return[n/(t*s(a=S(a/r))),S((2*a+g(2*a))/i)]},n}B.invert=function(t,r){if((o=n(r))1e-12&&--h>0);return[t/(s(u)*(O-1/g(u))),m(r)*u]},V.invert=function(t,r){var i=2*S(r/2);return[t*s(i/2)/s(i),i]};var W=$(w/x,w,v);function Y(t,r){var i=H(v,r);return[2.00276*t/(1/s(r)+1.11072/s(i)),(r+w*g(i))/2.00276]}function Z(t){var i=0,n=r.geoProjectionMutator(t),a=n(i);return a.parallel=function(t){return arguments.length?n(i=t*k):i*M},a}function X(t,r){return[t*s(r),r]}function K(t){if(!t)return X;var r=1/y(t);function i(i,n){var a=r+t-n,o=a&&i*s(n)/a;return[a*g(o),r-a*s(o)]}return i.invert=function(i,n){var a=D(i*i+(n=r-n)*n),l=r+t-a;return[a/s(l)*o(i,n),l]},i}function J(t){function r(r,i){var n=x-i,a=n&&r*t*g(n)/n;return[n*g(a)/t,x-n*s(a)]}return r.invert=function(r,i){var n=r*t,a=x-i,s=D(n*n+a*a),l=o(n,a);return[(s?s/g(s):1)*l/t,x-s]},r}Y.invert=function(t,r){var i,a,o=2.00276*r,l=r<0?-b:b,u=25;do a=o-w*g(l),l-=i=(g(2*l)+2*l-v*g(a))/(2*s(2*l)+2+v*s(a)*w*s(l));while(n(i)>1e-6&&--u>0);return[t*(1/s(a=o-w*g(l))+1.11072/s(l))/2.00276,a]},X.invert=function(t,r){return[t/s(r),r]};var Q=$(1,4/v,v);function ee(t,r,i,a,l,u){var c,h=s(u);if(n(t)>1||n(u)>1)c=E(i*l+r*a*h);else{var d=g(t/2),f=g(u/2);c=2*S(D(d*d+r*a*f*f))}return n(c)>1e-6?[c,o(a*g(u),r*l-i*a*h)]:[0,0]}function et(t,r,i){return E((t*t+r*r-i*i)/(2*t*r))}function er(t,r,i){for(var n,a=[[t[0],t[1],g(t[1]),s(t[1])],[r[0],r[1],g(r[1]),s(r[1])],[i[0],i[1],g(i[1]),s(i[1])]],o=a[2],l=0;l<3;++l,o=n)n=a[l],o.v=ee(n[1]-o[1],o[3],o[2],n[3],n[2],n[0]-o[0]),o.point=[0,0];var c=et(a[0].v[0],a[2].v[0],a[1].v[0]),h=et(a[0].v[0],a[1].v[0],a[2].v[0]),d=v-c;a[2].point[1]=0,a[0].point[0]=-(a[1].point[0]=a[0].v[0]/2);var f=[a[2].point[0]=a[0].point[0]+a[2].v[0]*s(c),2*(a[0].point[1]=a[1].point[1]=a[2].v[0]*g(c))];return function(t,r){var i,n=g(r),o=s(r),l=[,,,];for(i=0;i<3;++i){var c,p=a[i];if(l[i]=ee(r-p[1],p[3],p[2],o,n,t-p[0]),!l[i][0])return p.point;l[i][1]=(c=l[i][1]-p.v[1])-2*v*u((c+v)/(2*v))}var m=f.slice();for(i=0;i<3;++i){var y=2==i?0:i+1,x=et(a[i].v[0],l[i][0],l[y][0]);l[i][1]<0&&(x=-x),i?1==i?(x=h-x,m[0]-=l[i][0]*s(x),m[1]-=l[i][0]*g(x)):(x=d-x,m[0]+=l[i][0]*s(x),m[1]+=l[i][0]*g(x)):(m[0]+=l[i][0]*s(x),m[1]-=l[i][0]*g(x))}return m[0]/=3,m[1]/=3,m}}function ei(t){return t[0]*=k,t[1]*=k,t}function en(t,i,n){var a=r.geoCentroid({type:"MultiPoint",coordinates:[t,i,n]}),o=[-a[0],-a[1]],s=r.geoRotation(o),l=er(ei(s(t)),ei(s(i)),ei(s(n)));l.invert=q(l);var u=r.geoProjection(l).rotate(o),c=u.center;return delete u.rotate,u.center=function(t){return arguments.length?c(s(t)):s.invert(c())},u.clipAngle(90)}function ea(t,r){var i=D(1-g(r));return[2/T*t*i,T*(1-i)]}function eo(t){var r=y(t);function i(t,i){return[t,(t?t/g(t):1)*(g(i)*s(t)-r*s(i))]}return i.invert=r?function(t,i){t&&(i*=g(t)/t);var n=s(t);return[t,2*o(D(n*n+r*r-i*i)-n,r-i)]}:function(t,r){return[t,S(t?r*y(t)/t:r)]},i}ea.invert=function(t,r){var i=(i=r/T-1)*i;return[i>0?t*D(v/i)/2:0,S(1-i)]};var es=D(3);function el(t,r){return[es*t*(2*s(2*r/3)-1)/T,es*T*g(r/3)]}function eu(t){var r=s(t);function i(t,i){return[t*r,g(i)/r]}return i.invert=function(t,i){return[t/r,S(i*r)]},i}function ec(t){var r=s(t);function i(t,i){return[t*r,(1+r)*y(i/2)]}return i.invert=function(t,i){return[t/r,2*a(i/(1+r))]},i}function eh(t,r){var i=D(8/(3*v));return[i*t*(1-n(r)/v),i*r]}function ed(t,r){var i=D(4-3*g(n(r)));return[2/D(6*v)*t*i,m(r)*D(2*v/3)*(2-i)]}function ef(t,r){var i=D(v*(4+v));return[2/i*t*(1+D(1-4*r*r/(v*v))),4/i*r]}function ep(t,r){var i=(2+x)*g(r);r/=2;for(var a=0,o=1/0;a<10&&n(o)>1e-6;a++){var l=s(r);r-=o=(r+g(r)*(l+2)-i)/(2*l*(1+l))}return[2/D(v*(4+v))*t*(1+s(r)),2*D(v/(4+v))*g(r)]}function em(t,r){return[t*(1+s(r))/D(2+v),2*r/D(2+v)]}function eg(t,r){for(var i=(1+x)*g(r),a=0,o=1/0;a<10&&n(o)>1e-6;a++)r-=o=(r+g(r)-i)/(1+s(r));return i=D(2+v),[t*(1+s(r))/i,2*r/i]}el.invert=function(t,r){var i=3*S(r/(es*T));return[T*t/(es*(2*s(2*i/3)-1)),i]},eh.invert=function(t,r){var i=D(8/(3*v)),a=r/i;return[t/(i*(1-n(a)/v)),a]},ed.invert=function(t,r){var i=2-n(r)/D(2*v/3);return[t*D(6*v)/(2*i),m(r)*S((4-i*i)/3)]},ef.invert=function(t,r){var i=D(v*(4+v))/2;return[t*i/(1+D(1-r*r*(4+v)/(4*v))),r*i/2]},ep.invert=function(t,r){var i=r*D((4+v)/v)/2,n=S(i),a=s(n);return[t/(2/D(v*(4+v))*(1+a)),S((n+i*(a+2))/(2+x))]},em.invert=function(t,r){var i=D(2+v),n=r*i/2;return[i*t/(1+s(n)),n]},eg.invert=function(t,r){var i=1+x,n=D(i/2);return[2*t*n/(1+s(r*=n)),S((r+g(r))/i)]};var ey=3+2*w;function ev(t,r){var i=g(t/=2),n=s(t),o=D(s(r)),l=s(r/=2),u=g(r)/(l+w*n*o),h=D(2/(1+u*u)),d=D((w*l+(n+i)*o)/(w*l+(n-i)*o));return[ey*(h*(d-1/d)-2*c(d)),ey*(h*u*(d+1/d)-2*a(u))]}ev.invert=function(t,r){if(!(i=F.invert(t/1.2,1.065*r)))return null;var i,o=i[0],l=i[1],u=20;t/=ey,r/=ey;do{var f=o/2,p=l/2,m=g(f),y=s(f),v=g(p),b=s(p),T=s(l),A=D(T),M=v/(b+w*y*A),k=M*M,S=D(2/(1+k)),E=(w*b+(y+m)*A)/(w*b+(y-m)*A),C=D(E),I=C-1/C,L=C+1/C,P=S*I-2*c(C)-t,z=S*M*L-2*a(M)-r,O=v&&_*A*m*k/v,R=(w*y*b+A)/(2*(b+w*y*A)*(b+w*y*A)*A),B=-.5*M*S*S*S,j=B*O,N=B*R,V=(V=2*b+w*A*(y-m))*V*C,U=(w*y*b*A+T)/V,q=-(w*m*v)/(A*V),G=I*j-2*U/C+S*(U+U/E),H=I*N-2*q/C+S*(q+q/E),$=M*L*j-2*O/(1+k)+S*L*O+S*M*(U-U/E),W=M*L*N-2*R/(1+k)+S*L*R+S*M*(q-q/E),Y=H*$-W*G;if(!Y)break;var Z=(z*H-P*W)/Y,X=(P*$-z*G)/Y;o-=Z,l=h(-x,d(x,l-X))}while((n(Z)>1e-6||n(X)>1e-6)&&--u>0);return 1e-6>n(n(l)-x)?[0,l]:u&&[o,l]};var ex=s(35*k);function eb(t,r){var i=y(r/2);return[t*ex*D(1-i*i),(1+ex)*i]}function e_(t,r){var i=r/2,n=s(i);return[2*t/T*s(r)*n*n,T*y(i)]}function ew(t){var r=1-t,i=a(v,0)[0]-a(-v,0)[0],n=D(2*(a(0,x)[1]-a(0,-x)[1])/i);function a(i,n){var a=s(n),o=g(n);return[a/(r+t*a)*i,r*n+t*o]}function o(t,r){var i=a(t,r);return[i[0]*n,i[1]/n]}function l(t){return o(0,t)[1]}return o.invert=function(i,a){var o=U(l,a);return[i/n*(t+r/s(o)),o]},o}function eT(t){return[t[0]/2,S(y(t[1]/2*k))*M]}function eA(t){return[2*t[0],2*a(g(t[1]*k))*M]}function eM(t,i){var a=2*v/i,l=t*t;function u(i,u){var c=r.geoAzimuthalEquidistantRaw(i,u),h=c[0],d=c[1],f=h*h+d*d;if(f>l){var m=D(f),y=o(d,h),b=a*p(y/a),_=y-b,w=t*s(_),T=(t*g(_)-_*g(w))/(x-w),A=ek(_,T),M=(v-t)/eS(A,w,v);h=m;var k,S=50;do h-=k=(t+eS(A,w,h)*M-m)/(A(h)*M);while(n(k)>1e-6&&--S>0);d=_*g(h),hl){var h=D(c),d=o(u,i),f=a*p(d/a),m=d-f;i=h*s(m),u=h*g(m);for(var y=i-x,b=g(i),_=u/b,w=in(w)||!--T)break;_-=w=(_*b-E*y-u)/(b-2*y*(S*(M+_*A*s(M)-k)-A*(A-_*k))/(S*S))}i=(h=t+eS(C,M,i)*(v-t)/eS(C,M,v))*s(d=f+_),u=h*g(d)}return r.geoAzimuthalEquidistantRaw.invert(i,u)},u}function ek(t,r){return function(i){var n=t*s(i);return i1e-6||n(p)>1e-6)&&--x>0);return[m,y]},h}eb.invert=function(t,r){var i=r/(1+ex);return[t&&t/(ex*D(1-i*i)),2*a(i)]},e_.invert=function(t,r){var i=a(r/T),n=s(i),o=2*i;return[t*T/2/(s(o)*n*n),o]};var eD=eE(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),eC=eE(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),eI=eE(5/6*v,-.62636,-.0344,0,1.3493,-.05524,0,.045);function eL(t,r){var i=t*t,n=r*r;return[t*(1-.162388*n)*(.87-952426e-9*i*i),r*(1+n/12)]}eL.invert=function(t,r){var i,a=t,o=r,s=50;do{var l=o*o;o-=i=(o*(1+l/12)-r)/(1+l/4)}while(n(i)>1e-6&&--s>0);s=50,t/=1-.162388*l;do{var u=(u=a*a)*u;a-=i=(a*(.87-952426e-9*u)-t)/(.87-.00476213*u)}while(n(i)>1e-6&&--s>0);return[a,o]};var eP=eE(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function ez(t){var r=t(x,0)[0]-t(-x,0)[0];function i(i,n){var a=i>0?-.5:.5,o=t(i+a*v,n);return o[0]-=a*r,o}return t.invert&&(i.invert=function(i,n){var a=i>0?-.5:.5,o=t.invert(i+a*r,n),s=o[0]-a*v;return s<-v?s+=2*v:s>v&&(s-=2*v),o[0]=s,o}),i}function eF(t,r){var i=m(t),a=m(r),l=s(r),u=s(t)*l,c=g(t)*l,h=g(a*r);t=n(o(c,h)),r=S(u),n(t-x)>1e-6&&(t%=x);var d=function(t,r){if(r===x)return[0,0];var i,a,o=g(r),l=o*o,u=l*l,c=1+u,h=1+3*u,d=1-u,f=S(1/D(c)),p=d+l*c*f,m=(1-o)/p,y=D(m),b=m*c,_=D(b),w=y*d;if(0===t)return[0,-(w+l*_)];var T,A=s(r),M=1/A,k=2*o*A,E=(-p*A-(-3*l+f*h)*k*(1-o))/(p*p),C=l*c*E+m*h*k,I=-M*k,L=-M*C,P=-2*M*(.5*E/y*d-2*l*y*k),z=4*t/v;if(t>.222*v||r.175*v){if(i=(w+l*D(b*(1+u)-w*w))/(1+u),t>v/4)return[i,i];var F=i,O=.5*i;i=.5*(O+F),a=50;do{var R=D(b-i*i),B=i*(P+I*R)+L*S(i/_)-z;if(!B)break;B<0?O=i:F=i,i=.5*(O+F)}while(n(F-O)>1e-6&&--a>0)}else{i=1e-6,a=25;do{var j=i*i,N=D(b-j),V=P+I*N,U=i*V+L*S(i/_)-z,q=V+(L-I*j)/N;i-=T=N?U/q:0}while(n(T)>1e-6&&--a>0)}return[i,-w-l*D(b-i*i)]}(t>v/4?x-t:t,r);return t>v/4&&(h=d[0],d[0]=-d[1],d[1]=-h),d[0]*=i,d[1]*=-a,d}function eO(t,r){if(r<1e-6)return h=g(t),u=s(t),o=r*(t-h*u)/4,[h-o*u,u+o*h,1-r*h*h/2,t-o];if(r>=.999999){var i;return o=(1-r)/4,u=I(t),h=((i=l(2*(i=t)))-1)/(i+1),c=1/u,[h+o*((d=u*C(t))-t)/(u*u),c-o*h*c*(d-t),c+o*h*c*(d+t),2*a(l(t))-x+o*(d-t)/u]}var o,u,c,h,d,f=[1,0,0,0,0,0,0,0,0],p=[D(r),0,0,0,0,0,0,0,0],m=0;for(u=D(1-r),d=1;n(p[m]/f[m])>1e-6&&m<8;)o=f[m++],p[m]=(o-u)/2,f[m]=(o+u)/2,u=D(o*u),d*=2;c=d*f[m]*t;do c=(S(h=p[m]*g(u=c)/f[m])+c)/2;while(--m);return[g(c),h=s(c),h/s(c-u),c]}function eR(t,r){if(!r)return t;if(1===r)return c(y(t/2+b));for(var i=1,o=D(1-r),s=D(r),l=0;n(s)>1e-6;l++){if(t%v){var u=a(o*y(t)/i);u<0&&(u+=v),t+=u+~~(t/v)*v}else t+=t;s=(i+o)/2,o=D(i*o),s=((i=s)-o)/2}return t/(f(2,l)*i)}function eB(t,r){var i,u,h,d,f,p=(w-1)/(w+1),b=D(1-p*p),_=eR(x,b*b),T=l(-1*c(y(v/4+n(r)/2)))/D(p),A=(i=T*s(-1*t),u=T*g(-1*t),h=i*i,d=u+1,[.5*((i>=0?x:-x)-o(f=1-h-u*u,2*i)),-.25*c(f*f+4*h)+.5*c(d*d+h)]),M=function(t,r,i){var o=n(t),s=C(n(r));if(o){var l=1/g(o),u=1/(y(o)*y(o)),c=-(u+s*s*l*l*i-1+i),h=(-c+D(c*c-(i-1)*u*4))/2;return[eR(a(1/D(h)),i)*m(t),eR(a(D((h/u-1)/i)),1-i)*m(r)]}return[0,eR(a(s),1-i)*m(r)]}(A[0],A[1],b*b);return[-M[1],(r>=0?1:-1)*(.5*_-M[0])]}function ej(t){var r=g(t),i=s(t),a=eN(t);function l(t,o){var l=a(t,o);t=l[0];var u=g(o=l[1]),c=s(o),h=s(t),d=E(r*u+i*c*h),f=g(d),p=n(f)>1e-6?d/f:1;return[p*i*g(t),(n(t)>x?p:-p)*(r*c-i*u*h)]}return a.invert=eN(-t),l.invert=function(t,i){var n=D(t*t+i*i),l=-g(n),u=s(n),c=n*u,h=-i*l,d=n*r,f=D(c*c+h*h-d*d),p=o(c*d+h*f,h*d-c*f),m=(n>x?-1:1)*o(t*l,n*s(p)*u+i*g(p)*l);return a.invert(m,p)},l}function eN(t){var r=g(t),i=s(t);return function(t,n){var a=s(n),l=s(t)*a,u=g(t)*a,c=g(n);return[o(u,l*i-c*r),S(c*i+l*r)]}}eF.invert=function(t,r){n(t)>1&&(t=2*m(t)-t),n(r)>1&&(r=2*m(r)-r);var i=m(t),a=m(r),l=-i*t,u=-a*r,c=u/l<1,h=function(t,r){for(var i=0,a=1,o=.5,l=50;;){var u=o*o,c=D(o),h=S(1/D(1+u)),d=1-u+o*(1+u)*h,f=(1-c)/d,p=D(f),m=f*(1+u),g=p*(1-u),y=D(m-t*t),x=r+g+o*y;if(1e-12>n(a-i)||0==--l||0===x)break;x>0?i=o:a=o,o=.5*(i+a)}if(!l)return null;var b=S(c),_=s(b),w=1/_,T=2*c*_,A=(-d*_-(-3*o+h*(1+3*u))*T*(1-c))/(d*d),M=.5*A/p*(1-u)-2*o*p*T,k=-w*(o*(1+u)*A+f*(1+3*u)*T);return[v/4*(t*(-2*w*M+-w*T*y)+k*S(t/D(m))),b]}(c?u:l,c?l:u),d=h[0],f=h[1],p=s(f);return c&&(d=-x-d),[i*(o(g(d)*p,-g(f))+v),a*S(s(d)*p)]},eB.invert=function(t,r){var i,n,s,u,h,d,f,p,m,g=(w-1)/(w+1),y=D(1-g*g),v=(i=.5*eR(x,y*y)-r,n=-t,s=y*y,i?(u=eO(i,s),n?(d=(h=eO(n,1-s))[1]*h[1]+s*u[0]*u[0]*h[0]*h[0],[[u[0]*h[2]/d,u[1]*u[2]*h[0]*h[1]/d],[u[1]*h[1]/d,-u[0]*u[2]*h[0]*h[2]/d],[u[2]*h[1]*h[2]/d,-s*u[0]*u[1]*h[0]/d]]):[[u[0],0],[u[1],0],[u[2],0]]):[[0,(h=eO(n,1-s))[0]/h[1]],[1/h[1],0],[h[2]/h[1],0]]),b=(f=v[0],m=(p=v[1])[0]*p[0]+p[1]*p[1],[(f[0]*p[0]+f[1]*p[1])/m,(f[1]*p[0]-f[0]*p[1])/m]);return[-(o(b[1],b[0])/1),2*a(l(-.5*c(g*b[0]*b[0]+g*b[1]*b[1])))-x]};var eV=S(1-.3333333333333333)*M,eU=eu(0);function eq(t){var r=eV*k,i=ea(v,r)[0]-ea(-v,r)[0],a=eU(0,r)[1],o=ea(0,r)[1],s=T-o,l=A/t,c=4/A,f=a+s*s*4/A;function p(p,m){var g,y=n(m);if(y>r){var x=d(t-1,h(0,u((p+v)/l)));p+=v*(t-1)/t-x*l,(g=ea(p,y))[0]=g[0]*A/i-A*(t-1)/(2*t)+x*A/t,g[1]=a+(g[1]-o)*4*s/A,m<0&&(g[1]=-g[1])}else g=eU(p,m);return g[0]*=c,g[1]/=f,g}return p.invert=function(r,p){r/=c;var m=n(p*=f);if(m>a){var g=d(t-1,h(0,u((r+v)/l)));r=(r+v*(t-1)/t-g*l)*i/A;var y=ea.invert(r,.25*(m-a)*A/s+o);return y[0]-=v*(t-1)/t-g*l,p<0&&(y[1]=-y[1]),y}return eU.invert(r,p)},p}function eG(t,r){return[t,1&r?89.999999:eV]}function eH(t,r){return[t,1&r?-89.999999:-eV]}function e$(t){return[.999999*t[0],t[1]]}function eW(t){var r,i=1+t,a=S(g(1/i)),l=2*D(v/(r=v+4*a*i)),u=.5*l*(i+D(t*(2+t))),c=t*t,h=i*i;function d(d,f){var p,m,y=1-g(f);if(y&&y<2){var b,_=x-f,w=25;do{var T=g(_),A=s(_),M=a+o(T,i-A),k=1+h-2*i*A;_-=b=(_-c*a-i*T+k*M-.5*y*r)/(2*i*T*M)}while(n(b)>1e-12&&--w>0);p=l*D(k),m=d*M/v}else p=l*(t+y),m=d*a/v;return[p*g(m),u-p*s(m)]}return d.invert=function(t,n){var s=t*t+(n-=u)*n,d=(1+h-s/(l*l))/(2*i),f=E(d),p=g(f),m=a+o(p,i-d);return[S(t/D(s))*v/m,S(1-2*(f-c*a-i*p+(1+h-2*i*d)*m)/r)]},d}function eY(t,r){return r>-.7109889596207567?(t=W(t,r),t[1]+=.0528035274542,t):X(t,r)}function eZ(t,r){return n(r)>.7109889596207567?(t=W(t,r),t[1]-=r>0?.0528035274542:-.0528035274542,t):X(t,r)}function eX(t,r,i,n){var a=D(4*v/(2*i+(1+t-r/2)*g(2*i)+(t+r)/2*g(4*i)+r/2*g(6*i))),o=D(n*g(i)*D((1+t*s(2*i)+r*s(4*i))/(1+t+r))),l=i*c(1);function u(i){return D(1+t*s(2*i)+r*s(4*i))}function c(n){var a=n*i;return(2*a+(1+t-r/2)*g(2*a)+(t+r)/2*g(4*a)+r/2*g(6*a))/i}function h(t){return u(t)*g(t)}var d=function(t,r){var n=i*U(c,l*g(r)/i,r/v);isNaN(n)&&(n=i*m(r));var h=a*u(n);return[h*o*t/v*s(n),h/o*g(n)]};return d.invert=function(t,r){var n=U(h,r*o/a);return[t*v/(s(n)*a*o*u(n)),S(i*c(n/i)/l)]},0===i&&(a=D(n/v),(d=function(t,r){return[t*a,g(r)/a]}).invert=function(t,r){return[t/a,S(r*a)]}),d}function eK(t,r,i){function a(i){return t+(1-t)*f(1-f(i,r),1/r)}function o(t){var r,i,n,o,s;return void 0===r&&(r=20),i=a(0),s=(i+4*(n=a(.5*(0+t)))+(o=a(t)))*(t-0)/6,function t(r,i,n,a,o,s,l,u,c,h,d){var f,p,m,g,y,v,x,b,_,w;if(d.nanEncountered)return NaN;if(f=n-i,p=r(i+.25*f),m=r(n-.25*f),isNaN(p)||isNaN(m)){d.nanEncountered=!0;return}return w=((v=(g=f*(a+4*p+o)/12)+(y=f*(o+4*m+s)/12))-l)/15,h>c?(d.maxDepthCount++,v+w):Math.abs(w)t?i=n:r=n,n=r+i>>1;while(n>r);var a=u[n+1]-u[n];return a&&(a=(t-u[n+1])/a),(n+1+a)/1e3}var d=2*h(1)/v*s/i,p=function(t,r){var i=h(n(g(r))),o=a(i)*t;return i/=d,[o,r>=0?i:-i]};return p.invert=function(t,r){var i;return 1>n(r*=d)&&(i=m(r)*S(o(n(r))*s)),[t/a(n(r)),i]},p}function eJ(t,r){for(var i,n,a,o=-1,s=t.length,l=t[0],u=[];++oo[s][2][0];++s);var u=t(r-o[s][1][0],i);return u[0]+=t(o[s][1][0],n*i>n*o[s][0][1]?o[s][0][1]:i)[0],u}o?s.invert=o(s):t.invert&&(s.invert=function(r,i){for(var o=u[+(i<0)],l=a[+(i<0)],c=0,h=o.length;cn(f[0]-p[0])&&1e-6>n(f[1]-p[1]))?m:null}}});var l,u,c=r.geoProjection(s),h=c.stream;return c.stream=function(t){var i=c.rotate(),n=h(t),a=(c.rotate([0,0]),h(t));return c.rotate(i),n.sphere=function(){r.geoStream(l,a)},n},c.lobes=function(r){return arguments.length?(l=function(t){var r,n,a,o,s,l,u,c=[],h=t[0].length;for(u=0;u=0;--u)n=(r=t[1][u])[0][0],a=r[0][1],o=r[1][1],s=r[2][0],l=r[2][1],c.push(eJ([[s-1e-6,l-1e-6],[s-1e-6,o+1e-6],[n+1e-6,o+1e-6],[n+1e-6,a-1e-6]],30));return{type:"Polygon",coordinates:[i.merge(c)]}}(r),u=(a=r.map(function(t){return t.map(function(t){return[[t[0][0]*k,t[0][1]*k],[t[1][0]*k,t[1][1]*k],[t[2][0]*k,t[2][1]*k]]})})).map(function(r){return r.map(function(r){var i,n=t(r[0][0],r[0][1])[0],a=t(r[2][0],r[2][1])[0],o=t(r[1][0],r[0][1])[1],s=t(r[1][0],r[1][1])[1];return o>s&&(i=o,o=s,s=i),[[n,o],[a,s]]})}),c):a.map(function(t){return t.map(function(t){return[[t[0][0]*M,t[0][1]*M],[t[1][0]*M,t[1][1]*M],[t[2][0]*M,t[2][1]*M]]})})},null!=a&&c.lobes(a),c}eY.invert=function(t,r){return r>-.7109889596207567?W.invert(t,r-.0528035274542):X.invert(t,r)},eZ.invert=function(t,r){return n(r)>.7109889596207567?W.invert(t,r+(r>0?.0528035274542:-.0528035274542)):X.invert(t,r)};var e0=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],e1=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],e2=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],e3=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],e5=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],e4=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function e6(t,r){return[3/A*t*D(v*v/3-r*r),r]}function e8(t){function r(r,i){if(1e-6>n(n(i)-x))return[0,i<0?-2:2];var a=g(i),o=f((1+a)/(1-a),t/2),l=.5*(o+1/o)+s(r*=t);return[2*g(r)/l,(o-1/o)/l]}return r.invert=function(r,i){var a=n(i);if(1e-6>n(a-2))return r?null:[0,m(i)*x];if(a>2)return null;r/=2,i/=2;var s=r*r,l=i*i,u=2*i/(1+s+l);return u=f((1+u)/(1-u),1/t),[o(2*r,1-s-l)/t,S((u-1)/(u+1))]},r}e6.invert=function(t,r){return[A/3*t/D(v*v/3-r*r),r]};var e7=v/w;function e9(t,r){return[t*(1+D(s(r)))/2,r/(s(r/2)*s(t/6))]}function te(t,r){var i=t*t,n=r*r;return[t*(.975534+n*(-.119161+-.0143059*i+-.0547009*n)),r*(1.00384+i*(.0802894+-.02855*n+199025e-9*i)+n*(.0998909+-.0491032*n))]}function tt(t,r){return[g(t)/s(r),y(r)*s(t)]}function tr(t){var r=s(t),i=y(b+t/2);function a(a,o){var s=o-t,l=1e-6>n(s)?a*r:1e-6>n(l=b+o/2)||1e-6>n(n(l)-x)?0:a*s/c(y(l)/i);return[l,s]}return a.invert=function(a,o){var s,l=o+t;return[1e-6>n(o)?a/r:1e-6>n(s=b+l/2)||1e-6>n(n(s)-x)?0:a*c(y(s)/i)/o,l]},a}function ti(t,r){return[t,1.25*c(y(b+.4*r))]}function tn(t){var r=t.length-1;function i(i,n){for(var a,o=s(n),l=2/(1+o*s(i)),u=l*o*g(i),c=l*g(n),h=r,d=t[h],f=d[0],p=d[1];--h>=0;)f=(d=t[h])[0]+u*(a=f)-c*p,p=d[1]+u*p+c*a;return[f=u*(a=f)-c*p,p=u*p+c*a]}return i.invert=function(i,l){var u=20,c=i,h=l;do{for(var d,f=r,p=t[f],m=p[0],y=p[1],v=0,x=0;--f>=0;)p=t[f],v=m+c*(d=v)-h*x,x=y+c*x+h*d,m=p[0]+c*(d=m)-h*y,y=p[1]+c*y+h*d;v=m+c*(d=v)-h*x,x=y+c*x+h*d,m=c*(d=m)-h*y-i,y=c*y+h*d-l;var b,_,w=v*v+x*x;c-=b=(m*v+y*x)/w,h-=_=(y*v-m*x)/w}while(n(b)+n(_)>1e-6*1e-6&&--u>0);if(u){var T=D(c*c+h*h),A=2*a(.5*T),M=g(A);return[o(c*M,T*s(A)),T?S(h*M/T):0]}},i}e9.invert=function(t,r){var i=n(t),a=n(r),o=1e-6,l=x;an(M)&&1e-6>n(k))break}return[t<0?-o:o,r<0?-l:l]},te.invert=function(t,r){var i=m(t)*v,a=r/2,o=50;do{var s=i*i,l=a*a,u=i*a,c=i*(.975534+l*(-.119161+-.0143059*s+-.0547009*l))-t,h=a*(1.00384+s*(.0802894+-.02855*l+199025e-9*s)+l*(.0998909+-.0491032*l))-r,d=.975534-l*(.119161+3*s*.0143059+.0547009*l),f=-u*(.238322+.2188036*l+.0286118*s),p=u*(.1605788+7961e-7*s+-.0571*l),g=1.00384+s*(.0802894+199025e-9*s)+l*(3*(.0998909-.02855*s)-.245516*l),y=f*p-g*d,x=(h*f-c*g)/y,b=(c*p-h*d)/y;i-=x,a-=b}while((n(x)>1e-6||n(b)>1e-6)&&--o>0);return o&&[i,a]},tt.invert=function(t,r){var i=t*t,n=r*r+1,a=i+n,o=t?_*D((a-D(a*a-4*i))/i):1/D(n);return[S(t*o),m(r)*E(o)]},ti.invert=function(t,r){return[t,2.5*a(l(.8*r))-.625*v]};var ta=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],to=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],ts=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],tl=[[.9245,0],[0,0],[.01943,0]],tu=[[.721316,0],[0,0],[-.00881625,-.00617325]];function tc(t,i){var n=r.geoProjection(tn(t)).rotate(i).clipAngle(90),a=r.geoRotation(i),o=n.center;return delete n.rotate,n.center=function(t){return arguments.length?o(a(t)):a.invert(o())},n}var th=D(6),td=D(7);function tf(t,r){var i=S(7*g(r)/(3*th));return[th*t*(2*s(2*i/3)-1)/td,9*g(i/3)/td]}function tp(t,r){for(var i,a=(1+_)*g(r),o=r,l=0;l<25&&(o-=i=(g(o/2)+g(o)-a)/(.5*s(o/2)+s(o)),!(1e-6>n(i)));l++);return[t*(1+2*s(o)/s(o/2))/(3*w),2*D(3)*g(o/2)/D(2+w)]}function tm(t,r){for(var i,a=D(6/(4+v)),o=(1+v/4)*g(r),l=r/2,u=0;u<25&&(l-=i=(l/2+g(l)-o)/(.5+s(l)),!(1e-6>n(i)));u++);return[a*(.5+s(l))*t/1.5,a*l]}function tg(t,r){var i=r*r,n=i*i,a=i*n;return[t*(.84719-.13063*i+a*a*(-.04515+.05494*i-.02326*n+.00331*a)),r*(1.01183+n*n*(-.02625+.01926*i-.00396*n))]}function ty(t,r){return[t*(1+s(r))/2,2*(r-y(r/2))]}tf.invert=function(t,r){var i=3*S(r*td/9);return[t*td/(th*(2*s(2*i/3)-1)),S(3*g(i)*th/7)]},tp.invert=function(t,r){var i=r*D(2+w)/(2*D(3)),n=2*S(i);return[3*w*t/(1+2*s(n)/s(n/2)),S((i+g(n))/(1+_))]},tm.invert=function(t,r){var i=D(6/(4+v)),a=r/i;return 1e-6>n(n(a)-x)&&(a=a<0?-x:x),[1.5*t/(i*(.5+s(a))),S((a/2+g(a))/(1+v/4))]},tg.invert=function(t,r){var i,a,o,s,l=r,u=25;do o=(a=l*l)*a,l-=i=(l*(1.01183+o*o*(-.02625+.01926*a-.00396*o))-r)/(1.01183+o*o*(-.23625+.21186*a+-.05148*o));while(n(i)>1e-12&&--u>0);return o=(a=l*l)*a,s=a*o,[t/(.84719-.13063*a+s*s*(-.04515+.05494*a-.02326*o+.00331*s)),l]},ty.invert=function(t,r){for(var i=r/2,a=0,o=1/0;a<10&&n(o)>1e-6;++a){var l=s(r/2);r-=o=(r-y(r/2)-i)/(1-.5/(l*l))}return[2*t/(1+s(r)),r]};var tv=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function tx(t,r){var i=g(r),a=s(r),o=m(t);if(0===t||n(r)===x)return[0,r];if(0===r)return[t,0];if(n(t)===x)return[t*a,x*i];var l=v/(2*t)-2*t/v,u=2*r/v,c=(1-u*u)/(i-u),h=l*l,d=c*c,f=1+h/d,p=1+d/h,y=(l*i/c-l/2)/f,b=(d*i/h+c/2)/p,_=b*b-(d*i*i/h+c*i-1)/p;return[x*(y+D(y*y+a*a/f)*o),x*(b+D(_<0?0:_)*m(-r*l)*o)]}tx.invert=function(t,r){t/=x,r/=x;var i=t*t,n=i+r*r,a=v*v;return[t?(n-1+D((1-n)*(1-n)+4*i))/(2*t)*x:0,U(function(t){return n*(v*g(t)-2*t)*v+4*t*t*(r-g(t))+2*v*t-a*r},0)]};function tb(t,r){var i=r*r;return[t,r*(1.0148+i*i*(.23185+i*(-.14499+.02406*i)))]}function t_(t,r){if(1e-6>n(r))return[t,0];var i=y(r),a=t*g(r);return[g(a)/i,r+(1-s(a))/i]}function tw(t,r){return[t[0]*r[0]+t[1]*r[3],t[0]*r[1]+t[1]*r[4],t[0]*r[2]+t[1]*r[5]+t[2],t[3]*r[0]+t[4]*r[3],t[3]*r[1]+t[4]*r[4],t[3]*r[2]+t[4]*r[5]+t[5]]}function tT(t,r){return[t[0]-r[0],t[1]-r[1]]}function tA(t){return D(t[0]*t[0]+t[1]*t[1])}function tM(t,i,a){function l(t,r){var n,a=i(t,r),o=a.project([t*M,r*M]);return(n=a.transform)?[n[0]*o[0]+n[1]*o[1]+n[2],-(n[3]*o[0]+n[4]*o[1]+n[5])]:(o[1]=-o[1],o)}!function t(r,i){if(r.edges=function(t){for(var r=t.length,i=[],n=t[r-1],a=0;a=0;)if(n=r[l],i[0]===n[0]&&i[1]===n[1]){if(o)return[o,i];o=i}}}(r.face,i.face),m=(l=p.map(i.project),u=p.map(r.project),n=c=tT(l[1],l[0]),a=h=tT(u[1],u[0]),d=o(n[0]*a[1]-n[1]*a[0],n[0]*a[0]+n[1]*a[1]),f=tA(c)/tA(h),tw([1,0,l[0][0],0,1,l[0][1]],tw([f,0,0,0,f,0],tw([s(d),g(d),0,-g(d),s(d),0],[1,0,-u[0][0],0,1,-u[0][1]]))));r.transform=i.transform?tw(i.transform,m):m;for(var y=i.edges,v=0,x=y.length;v1.790857183?r=1.790857183:r<-1.790857183&&(r=-1.790857183);var i,a=r;do{var o=a*a;a-=i=(a*(1.0148+o*o*(.23185+o*(-.14499+.02406*o)))-r)/(1.0148+o*o*(1.1592500000000001+o*(-1.01493+.21654*o)))}while(n(i)>1e-6);return[t,a]},t_.invert=function(t,r){if(1e-6>n(r))return[t,0];var i,a=t*t+r*r,o=.5*r,l=10;do{var u=y(o),c=1/s(o),h=a-2*r*o+o*o;o-=i=(u*h+2*(o-r))/(2+h*c*c+2*(o-r)*u)}while(n(i)>1e-6&&--l>0);return u=y(o),[(n(r)n^p>n&&i<(f-c)*(n-h)/(p-h)+c&&(a=!a)}return a}(t[0],i))return t.push(r),!0})||t.push([r])}),tj=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}};function tq(t){var i=t(x,0)[0]-t(-x,0)[0];function a(r,a){var o=n(r)0?r-v:r+v,a),l=(s[0]-s[1])*_,u=(s[0]+s[1])*_;if(o)return[l,u];var c=i*_,h=l>0^u>0?-1:1;return[h*l-m(u)*c,h*u-m(l)*c]}return t.invert&&(a.invert=function(r,a){var o=(r+a)*_,s=(a-r)*_,l=n(o)<.5*i&&n(s)<.5*i;if(!l){var u=i*_,c=o>0^s>0?-1:1,h=-c*r+(s>0?1:-1)*u,d=-c*a+(o>0?1:-1)*u;o=(-h-d)*_,s=(h-d)*_}var f=t.invert(o,s);return l||(f[0]+=o>0?v:-v),f}),r.geoProjection(a).rotate([-90,-90,45]).clipAngle(179.999)}function tG(){return tq(eB).scale(111.48)}function tH(t){var r=g(t);function i(i,n){var o=r?y(i*r/2)/r:i/2;if(!n)return[2*o,-t];var l=2*a(o*g(n)),u=1/y(n);return[g(l)*u,n+(1-s(l))*u-t]}return i.invert=function(i,o){if(1e-6>n(o+=t))return[r?2*a(r*i/2)/r:i,0];var l,u=i*i+o*o,c=0,h=10;do{var d=y(c),f=1/s(c),p=u-2*o*c+c*c;c-=l=(d*p+2*(c-o))/(2+p*f*f+2*(c-o)*d)}while(n(l)>1e-6&&--h>0);var m=i*(d=y(c)),x=y(n(o)0?x:-x)*(f+s*(m-c)/2+s*s*(m-2*f+c)/2)]}function tY(t,r){var i=function(t){function r(r,i){var n=s(i),a=(t-1)/(t-n*s(r));return[a*n*g(r),a*g(i)]}return r.invert=function(r,i){var n=r*r+i*i,a=D(n),s=(t-D(1-n*(t+1)/(t-1)))/((t-1)/a+a/(t-1));return[o(r*s,a*D(1-s*s)),a?S(i*s/a):0]},r}(t);if(!r)return i;var n=s(r),a=g(r);function l(r,o){var s=i(r,o),l=s[1],u=l*a/(t-1)+n;return[s[0]*n/u,l/u]}return l.invert=function(r,o){var s=(t-1)/(t-1-o*a);return i.invert(s*r,s*o*n)},l}t$.forEach(function(t){t[1]*=1.0144}),tW.invert=function(t,r){var i=r/x,a=90*i,o=d(18,n(a/5)),s=h(0,u(o));do{var l=t$[s][1],c=t$[s+1][1],f=t$[d(19,s+2)][1],p=f-l,m=f-2*c+l,g=2*(n(i)-c)/p,y=m/p,v=g*(1-y*g*(1-2*y*g));if(v>=0||1===s){a=(r>=0?5:-5)*(v+o);var b,_=50;do s=u(o=d(18,n(a)/5)),v=o-s,l=t$[s][1],a-=(b=(r>=0?x:-x)*((c=t$[s+1][1])+v*((f=t$[d(19,s+2)][1])-l)/2+v*v*(f-2*c+l)/2)-r)*M;while(n(b)>1e-12&&--_>0);break}}while(--s>=0);var w=t$[s][0],T=t$[s+1][0],A=t$[d(19,s+2)][0];return[t/(T+v*(A-w)/2+v*v*(A-2*T+w)/2),a*k]};function tZ(t){return t.length>0}function tX(t){return -90===t||90===t?[0,t]:[-180,Math.floor(1e4*t)/1e4]}function tK(t){var r=t[0],i=t[1],n=!1;return r<=-179.9999?(r=-180,n=!0):r>=179.9999&&(r=180,n=!0),i<=-89.9999?(i=-90,n=!0):i>=89.9999&&(i=90,n=!0),n?[r,i]:t}function tJ(t){return t.map(tK)}function tQ(t,r,i){for(var n=0,a=t.length;n=179.9999||h<=-89.9999||h>=89.9999){o[s]=tK(u);for(var d=s+1;d-179.9999&&p<179.9999&&m>-89.9999&&m<89.9999)break}if(d===s+1)continue;if(s){var g={index:-1,polygon:r,ring:o.slice(0,s+1)};g.ring[g.ring.length-1]=tX(h),i[i.length-1]=g}else i.pop();if(d>=l)break;i.push({index:-1,polygon:r,ring:o=o.slice(d-1)}),o[0]=tX(o[0][1]),s=-1,l=o.length}}}}function t0(t){var r,i,n,a,o,s,l=t.length,u={},c={};for(r=0;r0?v-u:u)*M],h=r.geoProjection(t(l)).rotate(c),d=r.geoRotation(c),f=h.center;return delete h.rotate,h.center=function(t){return arguments.length?f(d(t)):d.invert(f())},h.clipAngle(90)}function t4(t){var i=s(t);function n(t,n){var a=r.geoGnomonicRaw(t,n);return a[0]*=i,a}return n.invert=function(t,n){return r.geoGnomonicRaw.invert(t/i,n)},n}function t6(t,r){return t5(t4,t,r)}function t8(t){if(!(t*=2))return r.geoAzimuthalEquidistantRaw;var i=-t/2,n=-i,a=t*t,l=y(n),u=.5/g(n);function c(r,o){var l=E(s(o)*s(r-i)),u=E(s(o)*s(r-n)),c=o<0?-1:1;return l*=l,u*=u,[(l-u)/(2*t),c*D(4*a*u-(a-l+u)*(a-l+u))/(2*t)]}return c.invert=function(t,r){var a,c,h=r*r,d=s(D(h+(a=t+i)*a)),f=s(D(h+(a=t+n)*a));return[o(c=d-f,a=(d+f)*l),(r<0?-1:1)*E(D(a*a+c*c)*u)]},c}function t7(t,r){return t5(t8,t,r)}function t9(t,r){if(1e-6>n(r))return[t,0];var i=n(r/x),a=S(i);if(1e-6>n(t)||1e-6>n(n(r)-x))return[0,m(r)*v*y(a/2)];var o=s(a),l=n(v/t-t/v)/2,u=l*l,c=o/(i+o-1),h=c*(2/i-1),d=h*h,f=d+u,p=c-d,g=u+c;return[m(t)*v*(l*p+D(u*p*p-f*(c*c-d)))/f,m(r)*v*(h*g-l*D((u+1)*f-g*g))/f]}function re(t,r){if(1e-6>n(r))return[t,0];var i=n(r/x),a=S(i);if(1e-6>n(t)||1e-6>n(n(r)-x))return[0,m(r)*v*y(a/2)];var o=s(a),l=n(v/t-t/v)/2,u=l*l,c=o*(D(1+u)-l*o)/(1+u*i*i);return[m(t)*v*c,m(r)*v*D(1-c*(2*l+c))]}function rt(t,r){if(1e-6>n(r))return[t,0];var i=r/x,a=S(i);if(1e-6>n(t)||1e-6>n(n(r)-x))return[0,v*y(a/2)];var o=(v/t-t/v)/2,l=i/(1+s(a));return[v*(m(t)*D(o*o+1-l*l)-o),v*l]}function rr(t,r){if(!r)return[t,0];var i=n(r);if(!t||i===x)return[0,r];var a=i/x,o=a*a,s=(8*a-o*(o+2)-5)/(2*o*(a-1)),l=s*s,u=a*s,c=o+l+2*u,h=a+3*s,d=t/x,f=d+1/d,p=m(n(t)-x)*D(f*f-4),g=p*p,y=c*(o+l*g-1)+(1-o)*(o*(h*h+4*l)+12*u*l+4*l*l),v=(p*(c+l-1)+2*D(y))/(4*c+g);return[m(t)*x*v,m(r)*x*D(1+p*n(v)-v*v)]}function ri(t,r,i,n){var a=v/3;t=h(t,1e-6),r=h(r,1e-6),t=d(t,x),r=d(r,v-1e-6),i=d(i=h(i,0),99.999999);var l=(n=h(n,1e-6))/100,u=E((i/100+1)*s(a))/a,c=g(t)/g(u*x),f=r/v,p=D(l*g(t/2)/g(r/2)),m=p/D(f*c*u),b=1/(p*D(f*c*u));function _(t,r){var i=c*g(u*r),n=D(1-i*i),a=D(2/(1+n*s(t*=f)));return[m*n*a*g(t),b*i*a]}return _.invert=function(t,r){var i=t/m,n=r/b,a=D(i*i+n*n),s=2*S(a/2);return[o(t*y(s),m*a)/f,a&&S(r*g(s)/(b*c*a))/u]},_}function rn(){var t=65*k,i=60*k,n=20,a=200,o=r.geoProjectionMutator(ri),s=o(t,i,n,a);return s.poleline=function(r){return arguments.length?o(t=r*k,i,n,a):t*M},s.parallels=function(r){return arguments.length?o(t,i=r*k,n,a):i*M},s.inflation=function(r){return arguments.length?o(t,i,n=+r,a):n},s.ratio=function(r){return arguments.length?o(t,i,n,a=+r):a},s.scale(163.775)}t3.invert=function(t,r){var i=r/1.70711,n=g(b*i);return[t/(.74482-.34588*n*n),2*a(i)]},t9.invert=function(t,r){if(1e-6>n(r))return[t,0];if(1e-6>n(t))return[0,x*g(2*a(r/v))];var i=(t/=v)*t,o=(r/=v)*r,l=i+o,u=l*l,c=-n(r)*(1+l),h=c-2*o+i,d=-2*c+1+2*o+u,f=o/d+(2*h*h*h/(d*d*d)-9*c*h/(d*d))/27,p=(c-h*h/(3*d))/d,y=2*D(-p/3),b=E(3*f/(p*y))/3;return[v*(l-1+D(1+2*(i-o)+u))/(2*t),m(r)*v*(-y*s(b+v/3)-h/(3*d))]},re.invert=function(t,r){if(!t)return[0,x*g(2*a(r/v))];var i=n(t/v),s=(1-i*i-(r/=v)*r)/(2*i),l=D(s*s+1);return[m(t)*v*(l-s),m(r)*x*g(2*o(D((1-2*s*i)*(s+l)-i),D(l+s+i)))]},rt.invert=function(t,r){if(!r)return[t,0];var i=r/v,n=(v*v*(1-i*i)-t*t)/(2*v*t);return[t?v*(m(t)*D(n*n+1)-n):0,x*g(2*a(i))]},rr.invert=function(t,r){if(!t||!r)return[t,r];r/=v;var i,a=m(t)*t/x,o=(a*a-1+4*r*r)/n(a),s=o*o,l=2*r,u=50;do{var c=l*l,h=(8*l-c*(c+2)-5)/(2*c*(l-1)),d=(3*l-c*l-10)/(2*c*l),f=h*h,p=l*h,g=l+h,y=g*g,b=l+3*h,_=y*(c+f*s-1)+(1-c)*(c*(b*b+4*f)+f*(12*p+4*f)),w=-2*g*(4*p*f+(1-4*c+3*c*c)*(1+d)+f*(-6+14*c-s+(-8+8*c-2*s)*d)+p*(-8+12*c+(-10+10*c-s)*d)),T=D(_);l-=i=(o*(y+f-1)+2*T-a*(4*y+s))/(o*(2*h*d+2*g*(1+d))+w/T-8*g*(o*(-1+f+y)+2*T)*(1+d)/(s+4*y))}while(i>1e-6&&--u>0);return[m(t)*(D(o*o+4)+o)*v/4,x*l]};var ra=4*v+3*D(3),ro=2*D(2*v*D(3)/ra),rs=$(ro*D(3)/v,ro,ra/6);function rl(t,r){return[t*D(1-3*r*r/(v*v)),r]}function ru(t,r){var i=s(r),n=s(t)*i,a=1-n,l=s(t=o(g(t)*i,-g(r))),u=g(t);return[u*(i=D(1-n*n))-l*a,-l*i-u*a]}function rc(t,r){var i=P(t,r);return[(i[0]+t/x)/2,(i[1]+r)/2]}rl.invert=function(t,r){return[t/D(1-3*r*r/(v*v)),r]},ru.invert=function(t,r){var i=-((t*t+r*r)/2),n=D(-i*(2+i)),a=r*i+t*n,s=t*i-r*n,l=D(s*s+a*a);return[o(n*a,l*(1+i)),l?-S(n*s/l):0]},rc.invert=function(t,r){var i=t,a=r,o=25;do{var l,u=s(a),c=g(a),h=g(2*a),d=c*c,f=u*u,p=g(i),m=s(i/2),y=g(i/2),v=y*y,b=1-f*m*m,_=b?E(u*m)*D(l=1/b):l=0,w=.5*(2*_*u*y+i/x)-t,T=.5*(_*c+a)-r,A=.5*l*(f*v+_*u*m*d)+.5/x,M=l*(p*h/4-_*c*y),k=.125*l*(h*y-_*c*f*p),S=.5*l*(d*m+_*v*u)+.5,C=M*k-S*A,I=(T*M-w*S)/C,L=(w*k-T*A)/C;i-=I,a-=L}while((n(I)>1e-6||n(L)>1e-6)&&--o>0);return[i,a]},t.geoNaturalEarth=r.geoNaturalEarth1,t.geoNaturalEarthRaw=r.geoNaturalEarth1Raw,t.geoAiry=function(){var t=x,i=r.geoProjectionMutator(L),n=i(t);return n.radius=function(r){return arguments.length?i(t=r*k):t*M},n.scale(179.976).clipAngle(147)},t.geoAiryRaw=L,t.geoAitoff=function(){return r.geoProjection(P).scale(152.63)},t.geoAitoffRaw=P,t.geoArmadillo=function(){var t=20*k,i=t>=0?1:-1,n=y(i*t),a=r.geoProjectionMutator(z),l=a(t),u=l.stream;return l.parallel=function(r){return arguments.length?(n=y((i=(t=r*k)>=0?1:-1)*t),a(t)):t*M},l.stream=function(r){var a=l.rotate(),c=u(r),h=(l.rotate([0,0]),u(r)),d=l.precision();return l.rotate(a),c.sphere=function(){h.polygonStart(),h.lineStart();for(var r=-180*i;i*r<180;r+=90*i)h.point(r,90*i);if(t)for(;i*(r-=3*i*d)>=-180;)h.point(r,-(i*o(s(r*k/2),n))*M);h.lineEnd(),h.polygonEnd()},c},l.scale(218.695).center([0,28.0974])},t.geoArmadilloRaw=z,t.geoAugust=function(){return r.geoProjection(F).scale(66.1603)},t.geoAugustRaw=F,t.geoBaker=function(){return r.geoProjection(B).scale(112.314)},t.geoBakerRaw=B,t.geoBerghaus=function(){var t=5,i=r.geoProjectionMutator(j),n=i(t),a=n.stream,l=-s(.01*k),u=g(.01*k);return n.lobes=function(r){return arguments.length?i(t=+r):t},n.stream=function(r){var i=n.rotate(),c=a(r),h=(n.rotate([0,0]),a(r));return n.rotate(i),c.sphere=function(){h.polygonStart(),h.lineStart();for(var r=0,i=360/t,n=2*v/t,a=90-180/t,c=x;r=0;)t.point((r=i[a])[0],r[1]);t.lineEnd(),t.polygonEnd()},t},n.scale(79.4187).parallel(45).clipAngle(179.999)},t.geoHammerRetroazimuthalRaw=ej,t.geoHealpix=function(){var t=4,n=r.geoProjectionMutator(eq),a=n(t),o=a.stream;return a.lobes=function(r){return arguments.length?n(t=+r):t},a.stream=function(n){var s=a.rotate(),l=o(n),u=(a.rotate([0,0]),o(n));return a.rotate(s),l.sphere=function(){var n,a;r.geoStream((n=180/t,a=[].concat(i.range(-180,180+n/2,n).map(eG),i.range(180,-180-n/2,-n).map(eH)),{type:"Polygon",coordinates:[180===n?a.map(e$):a]}),u)},l},a.scale(239.75)},t.geoHealpixRaw=eq,t.geoHill=function(){var t=1,i=r.geoProjectionMutator(eW),n=i(t);return n.ratio=function(r){return arguments.length?i(t=+r):t},n.scale(167.774).center([0,18.67])},t.geoHillRaw=eW,t.geoHomolosine=function(){return r.geoProjection(eZ).scale(152.63)},t.geoHomolosineRaw=eZ,t.geoHufnagel=function(){var t=1,i=0,n=45*k,a=2,o=r.geoProjectionMutator(eX),s=o(t,i,n,a);return s.a=function(r){return arguments.length?o(t=+r,i,n,a):t},s.b=function(r){return arguments.length?o(t,i=+r,n,a):i},s.psiMax=function(r){return arguments.length?o(t,i,n=r*k,a):n*M},s.ratio=function(r){return arguments.length?o(t,i,n,a=+r):a},s.scale(180.739)},t.geoHufnagelRaw=eX,t.geoHyperelliptical=function(){var t=0,i=2.5,n=1.183136,a=r.geoProjectionMutator(eK),o=a(t,i,n);return o.alpha=function(r){return arguments.length?a(t=+r,i,n):t},o.k=function(r){return arguments.length?a(t,i=+r,n):i},o.gamma=function(r){return arguments.length?a(t,i,n=+r):n},o.scale(152.63)},t.geoHyperellipticalRaw=eK,t.geoInterrupt=eQ,t.geoInterruptedBoggs=function(){return eQ(Y,e0).scale(160.857)},t.geoInterruptedHomolosine=function(){return eQ(eZ,e1).scale(152.63)},t.geoInterruptedMollweide=function(){return eQ(W,e2).scale(169.529)},t.geoInterruptedMollweideHemispheres=function(){return eQ(W,e3).scale(169.529).rotate([20,0])},t.geoInterruptedSinuMollweide=function(){return eQ(eY,e5,q).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoInterruptedSinusoidal=function(){return eQ(X,e4).scale(152.63).rotate([-20,0])},t.geoKavrayskiy7=function(){return r.geoProjection(e6).scale(158.837)},t.geoKavrayskiy7Raw=e6,t.geoLagrange=function(){var t=.5,i=r.geoProjectionMutator(e8),n=i(t);return n.spacing=function(r){return arguments.length?i(t=+r):t},n.scale(124.75)},t.geoLagrangeRaw=e8,t.geoLarrivee=function(){return r.geoProjection(e9).scale(97.2672)},t.geoLarriveeRaw=e9,t.geoLaskowski=function(){return r.geoProjection(te).scale(139.98)},t.geoLaskowskiRaw=te,t.geoLittrow=function(){return r.geoProjection(tt).scale(144.049).clipAngle(89.999)},t.geoLittrowRaw=tt,t.geoLoximuthal=function(){return Z(tr).parallel(40).scale(158.837)},t.geoLoximuthalRaw=tr,t.geoMiller=function(){return r.geoProjection(ti).scale(108.318)},t.geoMillerRaw=ti,t.geoModifiedStereographic=tc,t.geoModifiedStereographicRaw=tn,t.geoModifiedStereographicAlaska=function(){return tc(ta,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},t.geoModifiedStereographicGs48=function(){return tc(to,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},t.geoModifiedStereographicGs50=function(){return tc(ts,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},t.geoModifiedStereographicMiller=function(){return tc(tl,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},t.geoModifiedStereographicLee=function(){return tc(tu,[165,10]).scale(250).clipAngle(130).center([-165,-10])},t.geoMollweide=function(){return r.geoProjection(W).scale(169.529)},t.geoMollweideRaw=W,t.geoMtFlatPolarParabolic=function(){return r.geoProjection(tf).scale(164.859)},t.geoMtFlatPolarParabolicRaw=tf,t.geoMtFlatPolarQuartic=function(){return r.geoProjection(tp).scale(188.209)},t.geoMtFlatPolarQuarticRaw=tp,t.geoMtFlatPolarSinusoidal=function(){return r.geoProjection(tm).scale(166.518)},t.geoMtFlatPolarSinusoidalRaw=tm,t.geoNaturalEarth2=function(){return r.geoProjection(tg).scale(175.295)},t.geoNaturalEarth2Raw=tg,t.geoNellHammer=function(){return r.geoProjection(ty).scale(152.63)},t.geoNellHammerRaw=ty,t.geoInterruptedQuarticAuthalic=function(){return eQ(N(1/0),tv).rotate([20,0]).scale(152.63)},t.geoNicolosi=function(){return r.geoProjection(tx).scale(127.267)},t.geoNicolosiRaw=tx,t.geoPatterson=function(){return r.geoProjection(tb).scale(139.319)},t.geoPattersonRaw=tb,t.geoPolyconic=function(){return r.geoProjection(t_).scale(103.74)},t.geoPolyconicRaw=t_,t.geoPolyhedral=tM,t.geoPolyhedralButterfly=function(t){t=t||function(t){var i=r.geoCentroid({type:"MultiPoint",coordinates:t});return r.geoGnomonic().scale(1).translate([0,0]).rotate([-i[0],-i[1]])};var i=tE.map(function(r){return{face:r,project:t(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(t,r){var n=i[t];n&&(n.children||(n.children=[])).push(i[r])}),tM(i[0],function(t,r){return i[t<-v/2?r<0?6:4:t<0?2*(r<0):t0?[-i[0],0]:[180-i[0],180])};var i=tE.map(function(r){return{face:r,project:t(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(t,r){var n=i[t];n&&(n.children||(n.children=[])).push(i[r])}),tM(i[0],function(t,r){return i[t<-v/2?r<0?6:4:t<0?2*(r<0):ttI(u[0],a)?8+3*l:0>tI(u[1],a)?8+3*l+1:0>tI(u[2],a)?8+3*l+2:l]}).angle(-30).scale(110.625).center([0,45])},t.geoProject=function(t,r){var i,n=r.stream;if(!n)throw Error("invalid projection");switch(t&&t.type){case"Feature":i=tO;break;case"FeatureCollection":i=tF;break;default:i=tR}return i(t,n)},t.geoGringortenQuincuncial=function(){return tq(eF).scale(176.423)},t.geoPeirceQuincuncial=tG,t.geoPierceQuincuncial=tG,t.geoQuantize=function(t,r){if(!(0<=(r*=1)&&r<=20))throw Error("invalid digits");function i(t){var i=t.length,n=2,a=Array(i);for(a[0]=+t[0].toFixed(r),a[1]=+t[1].toFixed(r);n2||o[0]!=r[0]||o[1]!=r[1])&&(n.push(o),r=o)}return 1===n.length&&t.length>1&&n.push(i(t[t.length-1])),n}function a(t){return t.map(n)}function o(t){var r;if(null==t)return t;switch(t.type){case"GeometryCollection":r={type:"GeometryCollection",geometries:t.geometries.map(o)};break;case"Point":r={type:"Point",coordinates:i(t.coordinates)};break;case"MultiPoint":r={type:t.type,coordinates:t.coordinates.map(i)};break;case"LineString":r={type:t.type,coordinates:n(t.coordinates)};break;case"MultiLineString":case"Polygon":r={type:t.type,coordinates:a(t.coordinates)};break;case"MultiPolygon":r={type:"MultiPolygon",coordinates:t.coordinates.map(a)};break;default:return t}return null!=t.bbox&&(r.bbox=t.bbox),r}function s(t){var r={type:"Feature",properties:t.properties,geometry:o(t.geometry)};return null!=t.id&&(r.id=t.id),null!=t.bbox&&(r.bbox=t.bbox),r}if(null!=t)switch(t.type){case"Feature":return s(t);case"FeatureCollection":var l={type:"FeatureCollection",features:t.features.map(s)};return null!=t.bbox&&(l.bbox=t.bbox),l;default:return o(t)}return t},t.geoQuincuncial=tq,t.geoRectangularPolyconic=function(){return Z(tH).scale(131.215)},t.geoRectangularPolyconicRaw=tH,t.geoRobinson=function(){return r.geoProjection(tW).scale(152.63)},t.geoRobinsonRaw=tW,t.geoSatellite=function(){var t=2,i=0,n=r.geoProjectionMutator(tY),a=n(t,i);return a.distance=function(r){return arguments.length?n(t=+r,i):t},a.tilt=function(r){return arguments.length?n(t,i=r*k):i*M},a.scale(432.147).clipAngle(E(1/t)*M-1e-6)},t.geoSatelliteRaw=tY,t.geoSinuMollweide=function(){return r.geoProjection(eY).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},t.geoSinuMollweideRaw=eY,t.geoSinusoidal=function(){return r.geoProjection(X).scale(152.63)},t.geoSinusoidalRaw=X,t.geoStitch=function(t){if(null==t)return t;switch(t.type){case"Feature":return t1(t);case"FeatureCollection":var r={type:"FeatureCollection",features:t.features.map(t1)};return null!=t.bbox&&(r.bbox=t.bbox),r;default:return t2(t)}},t.geoTimes=function(){return r.geoProjection(t3).scale(146.153)},t.geoTimesRaw=t3,t.geoTwoPointAzimuthal=t6,t.geoTwoPointAzimuthalRaw=t4,t.geoTwoPointAzimuthalUsa=function(){return t6([-158,21.5],[-77,39]).clipAngle(60).scale(400)},t.geoTwoPointEquidistant=t7,t.geoTwoPointEquidistantRaw=t8,t.geoTwoPointEquidistantUsa=function(){return t7([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},t.geoVanDerGrinten=function(){return r.geoProjection(t9).scale(79.4183)},t.geoVanDerGrintenRaw=t9,t.geoVanDerGrinten2=function(){return r.geoProjection(re).scale(79.4183)},t.geoVanDerGrinten2Raw=re,t.geoVanDerGrinten3=function(){return r.geoProjection(rt).scale(79.4183)},t.geoVanDerGrinten3Raw=rt,t.geoVanDerGrinten4=function(){return r.geoProjection(rr).scale(127.16)},t.geoVanDerGrinten4Raw=rr,t.geoWagner=rn,t.geoWagner7=function(){return rn().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},t.geoWagnerRaw=ri,t.geoWagner4=function(){return r.geoProjection(rs).scale(176.84)},t.geoWagner4Raw=rs,t.geoWagner6=function(){return r.geoProjection(rl).scale(152.63)},t.geoWagner6Raw=rl,t.geoWiechel=function(){return r.geoProjection(ru).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},t.geoWiechelRaw=ru,t.geoWinkel3=function(){return r.geoProjection(rc).scale(158.837)},t.geoWinkel3Raw=rc,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&"u">typeof r?i(t,pA(),pF()):i(t.d3=t.d3||{},t.d3,t.d3)}}),pR=g({"src/plots/geo/zoom.js"(t,r){var i=k(),n=t_(),a=e2(),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},u={cursor:"auto"};function c(t,r){return i.behavior.zoom().translate(r.translate()).scaleExtent(r.scaleExtent()).scale(r.scale())}function h(t,r,i){var o=t.id,s=t.graphDiv,l=s.layout,u=l[o],c=s._fullLayout,h=c[o],d={},f={};function p(t,r){d[o+"."+t]=n.nestedProperty(u,t).get(),a.call("_storeDirectGUIEdit",l,c._preGUI,d);var i=n.nestedProperty(h,t);i.get()!==r&&(i.set(r),n.nestedProperty(u,t).set(r),f[o+"."+t]=r)}i(p),p("projection.scale",r.scale()/t.fitScale),p("fitbounds",!1),s.emit("plotly_relayout",f)}function d(t,r){var n=c(t,r);function a(i){var n=r.invert(t.midPt);i("center.lon",n[0]),i("center.lat",n[1])}return n.on("zoomstart",function(){i.select(this).style(l)}).on("zoom",function(){r.scale(i.event.scale).translate(i.event.translate),t.render(!0);var n=r.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":r.scale()/t.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})}).on("zoomend",function(){i.select(this).style(u),h(t,r,a)}),n}function f(t,r){var n,a,o,s,d,f,p,m,g,y=c(t,r);function v(t){return r.invert(t)}function x(i){var n=r.rotate(),a=r.invert(t.midPt);i("projection.rotation.lon",-n[0]),i("center.lon",a[0]),i("center.lat",a[1])}return y.on("zoomstart",function(){i.select(this).style(l);let{x:t,y:u,width:c,height:h}=this.getBBox();n=i.event.sourceEvent?i.mouse(this):[t+c/2,u+h/2],a=r.rotate(),o=r.translate(),s=a,d=v(n)}).on("zoom",function(){let{x:l,y:u,width:c,height:h}=this.getBBox();if(f=i.event.sourceEvent?i.mouse(this):[l+c/2,u+h/2],function(t){var i=v(t);if(!i)return!0;var n=r(i);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(n)){y.scale(r.scale()),y.translate(r.translate());return}r.scale(i.event.scale),r.translate([o[0],i.event.translate[1]]),d?v(f)&&(m=v(f),p=[s[0]+(m[0]-d[0]),a[1],a[2]],r.rotate(p),s=p):d=v(n=f),g=!0,t.render(!0);var x=r.rotate(),b=r.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":r.scale()/t.fitScale,"geo.center.lon":b[0],"geo.center.lat":b[1],"geo.projection.rotation.lon":-x[0]})}).on("zoomend",function(){i.select(this).style(u),g&&h(t,r,x)}),y}function p(t,r){var n,a={r:r.rotate(),k:r.scale()},d=c(t,r),f=function(t){for(var r=0,n=arguments.length,a=[];++r($=Math.sqrt(j*j+N*N))?(B=(q>0?90:-90)-H,R=0):(B=Math.asin(q/$)*s-H,R=Math.sqrt($*$-q*q)),W=180-B-2*H,Y=(Math.atan2(G,U)-Math.atan2(V,R))*s,Z=(Math.atan2(G,U)-Math.atan2(V,-R))*s,a.r=g(C[0],C[1],B,Y)<=g(C[0],C[1],W,Z)?[B,Y,C[2]]:[W,Z,C[2]]);isFinite(K[0])&&isFinite(K[1])&&isFinite(K[2])||(K=P),r.rotate(K),P=K}}else n=m(r,I=c);h=f.of(this,arguments),h({type:"zoom"})}),k=f.of(this,arguments),p++||k({type:"zoomstart"})}).on("zoomend",function(){var n;i.select(this).style(u),y.call(d,"zoom",null),n=f.of(this,arguments),--p||n({type:"zoomend"}),h(t,r,b)}).on("zoom.redraw",function(){t.render(!0);var i=r.rotate();t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":r.scale()/t.fitScale,"geo.projection.rotation.lon":-i[0],"geo.projection.rotation.lat":-i[1]})}),i.rebind(d,f,"on")}function m(t,r){var i,n,a,s,l=t.invert(r);return l&&isFinite(l[0])&&isFinite(l[1])&&(n=(i=l)[0]*o,[(s=Math.cos(a=i[1]*o))*Math.cos(n),s*Math.sin(n),Math.sin(a)])}function g(t,r,i,n){var a=y(i-t),o=y(n-r);return Math.sqrt(a*a+o*o)}function y(t){return(t%360+540)%360-180}function v(t,r,i){var n=i*o,a=t.slice(),s=+(0===r),l=2===r?1:2,u=Math.cos(n),c=Math.sin(n);return a[s]=t[s]*u-t[l]*c,a[l]=t[l]*u+t[s]*c,a}function x(t,r){for(var i=0,n=0,a=t.length;n0&&s._module.calcGeoJSON(o,r)}if(!i){if(this.updateProjection(t,r))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(r,n),this.updateDims(r,n),this.updateFx(r,n),p.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var l=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=l.selectAll(".point"),this.dataPoints.text=l.selectAll("text"),this.dataPaths.line=l.selectAll(".js-line");var u=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=u.selectAll("path"),this._render()},I.updateProjection=function(t,r){var i=this.graphDiv,l=r[this.id],c=r._size,h=l.domain,d=l.projection,f=l.lonaxis,p=l.lataxis,m=f._ax,x=p._ax,b=this.projection=function(t){var r=t.projection,i=r.type,l=A.projNames[i];l="geo"+u.titleCase(l);for(var c=n[l]||s[l],h=c(),d=t._isSatellite?180*Math.acos(1/r.distance)/Math.PI:t._isClipped?A.lonaxisSpan[i]/2:null,f=["center","rotate","parallels","clipExtent"],p=function(t){return t?h:[]},m=0;md*Math.PI/180},h.getPath=function(){return a().projection(h)},h.getBounds=function(t){return h.getPath().bounds(t)},h.precision(A.precision),t._isSatellite&&h.tilt(r.tilt).distance(r.distance),d&&h.clipAngle(d-A.clipPad),h}(l),_=[[c.l+c.w*h.x[0],c.t+c.h*(1-h.y[1])],[c.l+c.w*h.x[1],c.t+c.h*(1-h.y[0])]],w=l.center||{},T=d.rotation||{},k=f.range||[],S=p.range||[];if(l.fitbounds){m._length=_[1][0]-_[0][0],x._length=_[1][1]-_[0][1],m.range=y(i,m),x.range=y(i,x);let n=[];for(let r of t){let t=r[0].trace;!0===t.visible&&t._module.fitCoords&&n.push(t._module.fitCoords(r,l))}let a=g(i,m),o=a.min.reduce((t,{val:r})=>Math.min(t,r),1/0),s=a.max.reduce((t,{val:r})=>Math.max(t,r),-1/0)-o,u=M.boundsOfCoords(n.flat()),[c,,h]=u||[],f=h-c;if(u&&(s>360||s<360&&fMath.max(r,t(i)),0),o=a.max.reduce((t,r)=>Math.max(t,i(r)),0),s=m._length-n-o,l=s>m._length/10?f*m._length/s:f,u=(c+h)/2;m.range=[u-l/2,u+l/2]}var E=(m.range[0]+m.range[1])/2,D=(x.range[0]+x.range[1])/2;if(l._isScoped)w={lon:E,lat:D};else if(l._isClipped){w={lon:E,lat:D},T={lon:E,lat:D,roll:T.roll};var C=d.type,I=A.lonaxisSpan[C]/2||180,P=A.lataxisSpan[C]/2||90;k=[E-I,E+I],S=[D-P,D+P]}else w={lon:E,lat:D},T={lon:E,lat:T.lat,roll:T.roll}}b.center([w.lon-T.lon,w.lat-T.lat]).rotate([-T.lon,-T.lat,T.roll]).parallels(d.parallels);var z=L(k,S);b.fitExtent(_,z);var F=this.bounds=b.getBounds(z),O=this.fitScale=b.scale(),R=b.translate();if(b.scaleExtent=()=>{var t;let{minscale:r}=d,i=null!=(t=d.maxscale)?t:1/0;return[O*Math.min(r,i),O*Math.max(r,i)]},l.fitbounds){var B=b.getBounds(L(m.range,x.range)),j=Math.min((F[1][0]-F[0][0])/(B[1][0]-B[0][0]),(F[1][1]-F[0][1])/(B[1][1]-B[0][1]));isFinite(j)?b.scale(j*O):u.warn("Something went wrong during"+this.id+"fitbounds computations.")}else b.scale(d.scale*O);var N=this.midPt=[(F[0][0]+F[1][0])/2,(F[0][1]+F[1][1])/2];if(b.translate([R[0]+(N[0]-R[0]),R[1]+(N[1]-R[1])]).clipExtent(F),l._isAlbersUsa){var V=b([w.lon,w.lat]);if(V){var U=b.translate();b.translate([U[0]-(V[0]-U[0]),U[1]-(V[1]-U[1])])}}},I.updateBaseLayers=function(t,r){var n=this,a=n.topojson,o=n.layers,s=n.basePaths;function l(t){return"lonaxis"===t||"lataxis"===t}function u(t){return!!A.lineLayers[t]}function c(t){return!!A.fillLayers[t]}var f=(this.hasChoropleth?A.layersForChoropleth:A.layers).filter(function(t){return u(t)||c(t)?r["show"+t]:!l(t)||r[t].showgrid}),p=n.framework.selectAll(".layer").data(f,String);p.exit().each(function(t){delete o[t],delete s[t],i.select(this).remove()}),p.enter().append("g").attr("class",function(t){return"layer "+t}).each(function(t){var r=o[t]=i.select(this);"bg"===t?n.bgRect=r.append("rect").style("pointer-events","all"):l(t)?s[t]=r.append("path").style("fill","none"):"backplot"===t?r.append("g").classed("choroplethlayer",!0):"frontplot"===t?r.append("g").classed("scatterlayer",!0):u(t)?s[t]=r.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(s[t]=r.append("path").style("stroke","none"))}),p.order(),p.each(function(i){var n=s[i],o=A.layerNameToAdjective[i];"frame"===i?n.datum(A.sphereSVG):u(i)||c(i)?n.datum(D(a,a.objects[i])):l(i)&&n.datum(function(t,r,i){var n,a,o,s=r[t],l=A.scopeDefaults[r.scope];"lonaxis"===t?(n=l.lonaxisRange,a=l.lataxisRange,o=function(t,r){return[t,r]}):"lataxis"===t&&(n=l.lataxisRange,a=l.lonaxisRange,o=function(t,r){return[r,t]});var u={type:"linear",range:[n[0],n[1]-1e-6],tick0:s.tick0,dtick:s.dtick};m.setConvert(u,i);var c=m.calcTicks(u);r.isScoped||"lonaxis"!==t||c.pop();for(var h=c.length,d=Array(h),f=0;fa)&&t.event(o)}o.on("dblclick.zoom",function(){var t=n.viewInitial,r={};for(var i in t)r[n.id+"."+i]=t[i];l.call("_guiRelayout",a,r),a.emit("plotly_doubleclick",null)}),a._context._scrollZoom.geo||o.on("wheel.zoom",null)}else("select"===s||"lasso"===s)&&(o.on(".zoom",null),h.prepFn=function(t,r,i){b(t,r,i,h,s)},x.init(h));o.on("mousemove",function(){var t=n.projection.invert(u.getPositionFromD3Event());if(!t)return x.unhover(a,i.event);n.xaxis.p2c=function(){return t[0]},n.yaxis.p2c=function(){return t[1]},f.hover(a,i.event,n.id)}),o.on("mouseout",function(){a._dragging||x.unhover(a,i.event)}),o.on("click",function(){"select"!==s&&"lasso"!==s&&(c.indexOf("select")>-1&&w(i.event,a,[n.xaxis],[n.yaxis],n.id,h),c.indexOf("event")>-1&&f.click(a,i.event))})}function d(t){return n.projection.invert([t[0]+n.xaxis._offset,t[1]+n.yaxis._offset])}},I.makeFramework=function(){var t=this,r=t.graphDiv,n=r._fullLayout,a="clip"+n._uid+t.id;t.clipDef=n._clips.append("clipPath").attr("id",a),t.clipRect=t.clipDef.append("rect"),t.framework=i.select(t.container).append("g").attr("class","geo "+t.id).call(d.setClipUrl,a,r),t.project=function(r){var i=t.projection(r);return i?[i[0]-t.xaxis._offset,i[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(r){return t.project(r)[0]}},t.yaxis={_id:"y",c2p:function(r){return t.project(r)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(t.mockAxis,n)},I.saveViewInitial=function(t){var r,i=t.center||{},n=t.projection,a=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},r=t._isScoped?{"center.lon":i.lon,"center.lat":i.lat}:t._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat,"center.lon":i.lon,"center.lat":i.lat}:{"center.lon":i.lon,"center.lat":i.lat,"projection.rotation.lon":a.lon},u.extendFlat(this.viewInitial,r)},I.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},I._render=function(){var t,r=this.projection,i=r.getPath();function n(t){var i=r(t.lonlat);return i?c(i[0],i[1]):null}function a(t){return r.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",i);for(t in this.dataPaths)this.dataPaths[t].attr("d",function(t){return i(t.geojson)});for(t in this.dataPoints)this.dataPoints[t].attr("display",a).attr("transform",n)}}}),pj=g({"src/plots/geo/layout_attributes.js"(t,r){var i=er(),n=an().attributes,a=eW().dash,o=pp(),s=e$().overrideAll,l=(e9(),b(e6)).default,u={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:i.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:a};(r.exports=s({domain:n({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:"locations",editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:l(o.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:l(o.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1},minscale:{valType:"number",min:0,dflt:0},maxscale:{valType:"number",min:0,dflt:null}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:i.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:o.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:o.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:o.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:o.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:i.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:i.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:i.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:i.background},lonaxis:u,lataxis:u},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),pN=g({"src/plots/geo/layout_defaults.js"(t,r){var i=t_(),n=sr(),a=tF().getSubplotData,{unwrapLonRange:o}=pD(),s=pp(),l=pj(),u=s.axesNames;function c(t,r,n,l){var c,h,d=a(l.fullData,"geo",l.id).map(function(t){return t.index}),f=n("resolution"),p=n("scope"),m=s.scopeDefaults[p],g=n("projection.type",m.projType),y=r._isAlbersUsa="albers usa"===g;y&&(p=r.scope="usa");var v=r._isScoped="world"!==p,x=r._isSatellite="satellite"===g,b=r._isConic=-1!==g.indexOf("conic")||"albers"===g,_=r._isClipped=!!s.lonaxisSpan[g];if(!1===t.visible){var w=i.extendDeep({},r._template);w.showcoastlines=!1,w.showcountries=!1,w.showframe=!1,w.showlakes=!1,w.showland=!1,w.showocean=!1,w.showrivers=!1,w.showsubunits=!1,w.lonaxis&&(w.lonaxis.showgrid=!1),w.lataxis&&(w.lataxis.showgrid=!1),r._template=w}for(var T,A=n("visible"),M=0;Mnull!=t[r])||s.fitboundsIncompatible.has(g)?r.fitbounds=!1:u.forEach(({dst:t,key:r})=>t&&(t[r]=null))}}r.exports=function(t,r,i){n(t,r,i,{type:"geo",attributes:l,handleDefaults:c,fullData:i,partition:"y"})}}}),pV=g({"src/plots/geo/index.js"(t,r){var i=tF().getSubplotCalcData,n=t_().counterRegex,a=pB(),o=n("geo"),s={};s.geo={valType:"subplotid",dflt:"geo",editType:"calc"},r.exports={attr:"geo",name:"geo",idRoot:"geo",idRegex:o,attrRegex:o,attributes:s,layoutAttributes:pj(),supplyLayoutDefaults:pN(),plot:function(t){for(var r=t._fullLayout,n=t.calcdata,o=r._subplots.geo,s=0;s")}}(t,f,l),[t]}}}),pX=g({"src/traces/choropleth/event_data.js"(t,r){r.exports=function(t,r,i,n,a){t.location=r.location,t.z=r.z;var o=n[a];return o.fIn&&o.fIn.properties&&(t.properties=o.fIn.properties),t.ct=o.ct,t}}}),pK=g({"src/traces/choropleth/select.js"(t,r){r.exports=function(t,r){var i,n,a,o,s,l=t.cd,u=t.xaxis,c=t.yaxis,h=[];if(!1===r)for(i=0;i=Math.min(P,z)&&p<=Math.max(P,z)?0:1/0}if(k=Math.min(F,O)&&m<=Math.max(F,O)?0:1/0}D=Math.sqrt(k*k+S*S),w=a[M]}}}else for(M=a.length-1;M>-1;M--)T=d[_=a[M]],A=f[_],(E=Math.sqrt((k=c.c2p(T)-p)*k+(S=h.c2p(A)-m)*S))100},t.isDotSymbol=function(t){return"string"==typeof t?r.DOT_RE.test(t):t>200}}}),p5=g({"src/traces/scattergl/defaults.js"(t,r){var i=t_(),n=e2(),a=p3(),o=p2(),s=ib(),l=t8(),u=iq(),c=iG(),h=i$(),d=iW(),f=iX(),p=iZ();r.exports=function(t,r,m,g){function y(n,a){return i.coerce(t,r,o,n,a)}var v=!!t.marker&&a.isOpenSymbol(t.marker.symbol),x=l.isBubble(t),b=u(t,r,g,y);if(!b){r.visible=!1;return}c(t,r,g,y),y("xhoverformat"),y("yhoverformat");var _=b>>1,l=t[s];(void 0!==i?i(l,r):l-r)>=0?(o=s,a=s-1):n=s+1}return o}function n(t,r,i,n,a){for(var o=a+1;n<=a;){var s=n+a>>>1,l=t[s];(void 0!==i?i(l,r):l-r)>0?(o=s,a=s-1):n=s+1}return o}function a(t,r,i,n,a){for(var o=n-1;n<=a;){var s=n+a>>>1,l=t[s];(void 0!==i?i(l,r):l-r)<0?(o=s,n=s+1):a=s-1}return o}function o(t,r,i,n,a){for(var o=n-1;n<=a;){var s=n+a>>>1,l=t[s];(void 0!==i?i(l,r):l-r)<=0?(o=s,n=s+1):a=s-1}return o}function s(t,r,i,n,a){for(;n<=a;){var o=n+a>>>1,s=t[o],l=void 0!==i?i(s,r):s-r;if(0===l)return o;l<=0?n=o+1:a=o-1}return -1}function l(t,r,i,n,a,o){return"function"==typeof i?o(t,r,i,void 0===n?0:0|n,void 0===a?t.length-1:0|a):o(t,r,void 0,void 0===i?0:0|i,void 0===n?t.length-1:0|n)}r.exports={ge:function(t,r,n,a,o){return l(t,r,n,a,o,i)},gt:function(t,r,i,a,o){return l(t,r,i,a,o,n)},lt:function(t,r,i,n,o){return l(t,r,i,n,o,a)},le:function(t,r,i,n,a){return l(t,r,i,n,a,o)},eq:function(t,r,i,n,a){return l(t,r,i,n,a,s)}}}}),p8=g({"node_modules/clamp/index.js"(t,r){r.exports=function(t,r,i){return ri?i:t:tr?r:t}}}),p7=g({"node_modules/pick-by-alias/index.js"(t,r){r.exports=function(t,r,i){var a,o,s={};if("string"==typeof r&&(r=n(r)),Array.isArray(r)){var l={};for(o=0;o1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?r=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(r={x:(t=i(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:t.top||0},null==t.width?t.right?r.width=t.right-r.x:r.width=0:r.width=t.width,null==t.height?t.bottom?r.height=t.bottom-r.y:r.height=0:r.height=t.height),r}}}),me=g({"node_modules/array-bounds/index.js"(t,r){r.exports=function(t,r){if(!t||null==t.length)throw Error("Argument should be an array");r=null==r?1:Math.floor(r);for(var i=Array(2*r),n=0;na&&(a=t[s]),t[s]typeof arguments[t])return arguments[t]}}}),mr=g({"node_modules/dtype/index.js"(t,r){r.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),mi=g({"node_modules/flatten-vertex-data/index.js"(t,r){var i=mr();r.exports=function(t,r,n){if(!t)throw TypeError("must specify data as first parameter");if(n=0|(n||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var a,o,s,l,u=t[0].length,c=t.length*u;r&&"string"!=typeof r||(r=new(i(r||"float32"))(c+n));var h=r.length-n;if(c!==h)throw Error("source length "+c+" ("+u+"x"+t.length+") does not match destination length "+h);for(a=0,s=n;a>>1,y;r.dtype||(r.dtype="array"),"string"==typeof r.dtype?y=new(h(r.dtype))(g):r.dtype&&Array.isArray(y=r.dtype)&&(y.length=g);for(let t=0;tn||l>0x40000000){for(let t=0;tc||w>d||A=k||s===l)return;let f=v[o];void 0===l&&(l=f.length);for(let r=s;r=u&&n<=m&&a>=h&&a<=g&&S.push(i)}let p=x[o],b=p[4*s+0],_=p[4*s+1],T=p[4*s+2],E=p[4*s+3],D=function(t,r){let i=null,n=0;for(;null===i;)if(i=t[4*r+n],++n>t.length)return null;return i}(p,s+1),C=.5*a,I=o+1;r(i,n,C,I,b,_||T||E||D),r(i,n+C,C,I,_,T||E||D),r(i+C,n,C,I,T,E||D),r(i+C,n+C,C,I,E,D)}(0,0,1,0,0,1),S},y;function T(t,r,i){let n=1,a=.5,o=.5,s=.5;for(let l=0;l2&&(r.push([n].concat(o.splice(0,2))),l="l",n="m"==n?"l":"L");;){if(o.length==i[l])return o.unshift(n),r.push(o);if(o.length1&&(a=1),a<-1&&(a=-1),(t*n-r*i<0?-1:1)*Math.acos(a)},l=function(t,r,i,a,o,l,u,c,h,d,f,p){var m=Math.pow(o,2),g=Math.pow(l,2),y=Math.pow(f,2),v=Math.pow(p,2),x=m*g-m*v-g*y;x<0&&(x=0),x/=m*v+g*y;var b=(x=Math.sqrt(x)*(u===c?-1:1))*o/l*p,_=-(x*l)/o*f,w=(f-b)/o,T=(p-_)/l,A=s(1,0,w,T),M=s(w,T,(-f-b)/o,(-p-_)/l);return 0===c&&M>0&&(M-=n),1===c&&M<0&&(M+=n),[d*b-h*_+(t+i)/2,h*b+d*_+(r+a)/2,A,M]};t.default=function(t){var r=t.px,s=t.py,u=t.cx,c=t.cy,h=t.rx,d=t.ry,f=t.xAxisRotation,p=void 0===f?0:f,m=t.largeArcFlag,g=t.sweepFlag,y=[];if(0===h||0===d)return[];var v=Math.sin(p*n/360),x=Math.cos(p*n/360),b=x*(r-u)/2+v*(s-c)/2,_=-v*(r-u)/2+x*(s-c)/2;if(0===b&&0===_)return[];var w=Math.pow(b,2)/Math.pow(h=Math.abs(h),2)+Math.pow(_,2)/Math.pow(d=Math.abs(d),2);w>1&&(h*=Math.sqrt(w),d*=Math.sqrt(w));var T=i(l(r,s,u,c,h,d,void 0===m?0:m,void 0===g?0:g,v,x,b,_),4),A=T[0],M=T[1],k=T[2],S=T[3],E=Math.abs(S)/(n/4);1e-7>Math.abs(1-E)&&(E=1);var D=Math.max(Math.ceil(E),1);S/=D;for(var C=0;C4?(s=y[y.length-4],l=y[y.length-3]):(s=f,l=p),o.push(y)}return o};var i=mc();function n(t,r,i,n){return["C",t,r,i,n,i,n]}function a(t,r,i,n,a,o){return["C",t/3+2/3*i,r/3+2/3*n,a/3+2/3*i,o/3+2/3*n,a,o]}}}),md=g({"node_modules/is-svg-path/index.js"(t,r){r.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}}}),mf=g({"node_modules/svg-path-bounds/index.js"(t,r){var i=ml(),n=mu(),a=mh(),o=md();r.exports=function(t){if(Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]),"string"==typeof t){if(!o(t))throw Error("String is not an SVG path.");t=i(t)}if(!Array.isArray(t))throw Error("Argument should be a string or an array of path segments.");if(!(t=a(t=n(t))).length)return[0,0,0,0];for(var r=[1/0,1/0,-1/0,-1/0],s=0,l=t.length;sr[2]&&(r[2]=u[c+0]),u[c+1]>r[3]&&(r[3]=u[c+1]);return r}}}),mp=g({"node_modules/bitmap-sdf/index.js"(t,r){function i(t,r,i,a,o,s,l){for(var u=0;u0?"white":"black",m_.lineWidth=Math.abs(o)),m_.translate(.5*i,.5*n),m_.scale(u,u);let c=new Path2D(t);return m_.fill(c),o&&m_.stroke(c),m_.setTransform(1,0,0,1,0,0),(0,mx.default)(m_,{cutoff:null!=r.cutoff?r.cutoff:.5,radius:null!=r.radius?r.radius:.5*a})}y(mm,{default:()=>mg});var my,mv,mx,mb,m_,mw=m({"node_modules/svg-path-sdf/svg-path-sdf.js"(){my=x(mf()),mv=x(md()),mx=x(mp()),m_=(mb=document.createElement("canvas")).getContext("2d",{willReadFrequently:!0})}}),mT=g({"src/traces/scattergl/convert.js"(t,r){var i=L(),n=(mw(),b(mm)).default,{normalize:a}=ei(),o=e2(),s=t_(),l=s.isArrayOrTypedArray,u=rr(),c=tL(),h=fm().formatColor,d=t8(),f=t7(),p=p3(),m=p1(),g=ea().DESELECTDIM,y={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=t9().appendArrayPointValue;function x(t,r){var n,a=t._fullLayout,o=r._length,u=r.textfont,c=r.textposition,h=l(c)?c:[c],d=u.color,f=u.size,p=u.family,m=u.weight,g=u.style,y=u.variant,x={},b=t._context.plotGlPixelRatio,w=r.texttemplate;if(w){x.text=[];var T=a._d3locale,A=Array.isArray(w),M=A?Math.min(w.length,o):o,k=A?function(t){return w[t]}:function(){return w};for(n=0;n500?"bold":"normal":t}function w(t,r){var i,n,o=r._length,s=r.marker,u={},c=l(s.symbol),d=l(s.angle),m=l(s.color),g=l(s.line.color),y=l(s.opacity),v=l(s.size),x=l(s.line.width);if(c||(n=p.isOpenSymbol(s.symbol)),c||m||g||y||d){u.symbols=Array(o),u.angles=Array(o),u.colors=Array(o),u.borderColors=Array(o);var b=s.symbol,_=s.angle,w=h(s,s.opacity,o),T=h(s.line,s.opacity,o);if(!l(T[0])){var A=T;for(T=Array(o),i=0;im.TOO_MANY_POINTS||d.hasMarkers(r)?"rect":"round";if(c&&r.connectgaps){var f=n[0],p=n[1];for(a=0;a1?c[a]:c[0]:c,g=l(h)?h.length>1?h[a]:h[0]:h,v=y[m],x=y[g],b=f?f/.8+1:0,_=-x*b-.5*x;s.offset[a]=[v*b/p,_/p]}}return s}}}}),mA=g({"src/traces/scattergl/scene_update.js"(t,r){var i=t_();r.exports=function(t,r){var n=r._scene,a={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},o={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return r._scene||((n=r._scene={}).init=function(){i.extendFlat(n,o,a)},n.init(),n.update=function(t){var r=i.repeat(t,n.count);if(n.fill2d&&n.fill2d.update(r),n.scatter2d&&n.scatter2d.update(r),n.line2d&&n.line2d.update(r),n.error2d&&n.error2d.update(r.concat(r)),n.select2d&&n.select2d.update(r),n.glText)for(var a=0;a=g,A=2*w,M={},k=x.makeCalcdata(r,"x"),S=b.makeCalcdata(r,"y"),E=s(r,x,"x",k),D=s(r,b,"y",S),C=E.vals,I=D.vals;r._x=C,r._y=I,r.xperiodalignment&&(r._origX=k,r._xStarts=E.starts,r._xEnds=E.ends),r.yperiodalignment&&(r._origY=S,r._yStarts=D.starts,r._yEnds=D.ends);var L=Array(A),P=Array(w);for(l=0;l1&&n.extendFlat(s.line,f.linePositions(t,r,i)),s.errorX||s.errorY){var l=f.errorBarPositions(t,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},f.textPosition(t,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},f.textPosition(t,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},f.textPosition(t,r,s.text,s.markerUnsel))),s}(t,r,L,C,I),F=p(t,_);return h(v,r),T?z.marker&&(o=z.marker.sizeAvg||Math.max(z.marker.size,3)):o=u(r,w),c(t,r,x,b,C,I,o),z.errorX&&y(r,x,z.errorX),z.errorY&&y(r,b,z.errorY),z.fill&&!F.fill2d&&(F.fill2d=!0),z.marker&&!F.scatter2d&&(F.scatter2d=!0),z.line&&!F.line2d&&(F.line2d=!0),(z.errorX||z.errorY)&&!F.error2d&&(F.error2d=!0),z.text&&!F.glText&&(F.glText=!0),z.marker&&(z.marker.snap=w),F.lineOptions.push(z.line),F.errorXOptions.push(z.errorX),F.errorYOptions.push(z.errorY),F.fillOptions.push(z.fill),F.markerOptions.push(z.marker),F.markerSelectedOptions.push(z.markerSel),F.markerUnselectedOptions.push(z.markerUnsel),F.textOptions.push(z.text),F.textSelectedOptions.push(z.textSel),F.textUnselectedOptions.push(z.textUnsel),F.selectBatch.push([]),F.unselectBatch.push([]),M._scene=F,M.index=F.count,M.x=C,M.y=I,M.positions=L,F.count++,[{x:!1,y:!1,t:M,trace:r}]}}}),mk=g({"src/traces/scattergl/edit_style.js"(t,r){var i=t_(),n=ei(),a=ea().DESELECTDIM;r.exports={styleTextSelection:function(t){var r,o,s=t[0],l=s.trace,u=s.t,c=u._scene,h=u.index,d=c.selectBatch[h],f=c.unselectBatch[h],p=c.textOptions[h],m=c.textSelectedOptions[h]||{},g=c.textUnselectedOptions[h]||{},y=i.extendFlat({},p);if(d.length||f.length){var v=m.color,x=g.color,b=p.color,_=i.isArrayOrTypedArray(b);for(y.color=Array(l._length),r=0;r10&&/[0-9](?:\s|\/)/.test(t)&&(o=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),a=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(o=[t[0],t[1],t[2]],a="rgb",s=4===t.length?t[3]:1):t instanceof Object&&(null!=t.r||null!=t.red||null!=t.R?(a="rgb",o=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(a="hsl",o=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),s=t.a||t.alpha||t.opacity||1,null!=t.opacity&&(s/=100)):(a="rgb",o=[t>>>16,(65280&t)>>>8,255&t]);return{space:a,values:o,alpha:s}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),mI=g({"node_modules/color-rgba/index.js"(t,r){var i=mC();r.exports=function(t){Array.isArray(t)&&t.raw&&(t=String.raw.apply(null,arguments));var r,n=i(t);if(!n.space)return[];var a="h"===n.space[0]?[360,100,100]:[255,255,255];return(r=[,,,])[0]=Math.min(Math.max(n.values[0],0),a[0]),r[1]=Math.min(Math.max(n.values[1],0),a[1]),r[2]=Math.min(Math.max(n.values[2],0),a[2]),"h"===n.space[0]&&(r=function(t){var r,i,n,a,o,s=t[0]/360,l=t[1]/100,u=t[2]/100,c=0;if(0===l)return[o=255*u,o,o];for(i=u<.5?u*(1+l):u+l-u*l,r=2*u-i,a=[0,0,0];c<3;)(n=s+-(1/3*(c-1)))<0?n++:n>1&&n--,o=6*n<1?r+(i-r)*6*n:2*n<1?i:3*n<2?r+(i-r)*(2/3-n)*6:r,a[c++]=255*o;return a}(r)),r.push(Math.min(Math.max(n.alpha,0),1)),r}}}),mL=g({"node_modules/color-normalize/index.js"(t,r){var i=mI(),n=mr();r.exports=function(t,r){"float"!==r&&r||(r="array"),"uint"===r&&(r="uint8"),"uint_clamped"===r&&(r="uint8_clamped");var a,o=new(n(r))(4),s="uint8"!==r&&"uint8_clamped"!==r;return t.length&&"string"!=typeof t||(t=i(t),t[0]/=255,t[1]/=255,t[2]/=255),(a=t)instanceof Uint8Array||a instanceof Uint8ClampedArray||Array.isArray(a)&&(a[0]>1||0===a[0])&&(a[1]>1||0===a[1])&&(a[2]>1||0===a[2])&&(!a[3]||a[3]>1)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255)):s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=Math.min(Math.max(Math.floor(255*t[0]),0),255),o[1]=Math.min(Math.max(Math.floor(255*t[1]),0),255),o[2]=Math.min(Math.max(Math.floor(255*t[2]),0),255),o[3]=null==t[3]?255:Math.min(Math.max(Math.floor(255*t[3]),0),255)),o}}}),mP=g({"node_modules/color-id/index.js"(t,r){var i=p8();function n(t,r){null==r&&(r=!0);var n=t[0],a=t[1],o=t[2],s=t[3];return null==s&&(s=r?1:255),r&&(n*=255,a*=255,o*=255,s*=255),n=255&i(n,0,255),a=255&i(a,0,255),0x1000000*n+(a<<16)+((o=255&i(o,0,255))<<8)+(s=255&i(s,0,255))}r.exports=n,r.exports.to=n,r.exports.from=function(t,r){var i=(t*=1)>>>24,n=(0xff0000&t)>>>16,a=(65280&t)>>>8,o=255&t;return!1===r?[i,n,a,o]:[i/255,n/255,a/255,o/255]}}}),mz=g({"node_modules/glslify/browser.js"(t,r){r.exports=function(t){"string"==typeof t&&(t=[t]);for(var r=[].slice.call(arguments,1),i=[],n=0;n[255*!this.tooManyColors,n.height],pixelRatio:t.context("pixelRatio"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),markerTexture:t.prop("markerTexture"),paletteTexture:n},attributes:{x:(t,r)=>r.xAttr||{buffer:r.positionBuffer,stride:8,offset:0},y:(t,r)=>r.yAttr||{buffer:r.positionBuffer,stride:8,offset:4},xFract:(t,r)=>r.xAttr?{constant:[0,0]}:{buffer:r.positionFractBuffer,stride:8,offset:0},yFract:(t,r)=>r.yAttr?{constant:[0,0]}:{buffer:r.positionFractBuffer,stride:8,offset:4},size:(t,r)=>r.size.length?{buffer:r.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(255*r.size/this.maxSize)]},borderSize:(t,r)=>r.borderSize.length?{buffer:r.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*r.borderSize/this.maxSize)]},colorId:(t,r)=>r.color.length?{buffer:r.colorBuffer,stride:this.tooManyColors?8:4,offset:0}:{constant:this.tooManyColors?a.slice(4*r.color,4*r.color+4):[r.color]},borderColorId:(t,r)=>r.borderColor.length?{buffer:r.colorBuffer,stride:this.tooManyColors?8:4,offset:this.tooManyColors?4:2}:{constant:this.tooManyColors?a.slice(4*r.borderColor,4*r.borderColor+4):[r.borderColor]},isActive:(t,r)=>!0===r.activation?{constant:[1]}:r.activation?r.activation:{constant:[0]}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:t.prop("elements"),count:t.prop("count"),offset:t.prop("offset"),primitive:"points"},l=Object.assign({},o);l.frag=s([`precision highp float; -#define GLSLIFY 1 - -uniform float opacity; -uniform sampler2D markerTexture; - -varying vec4 fragColor, fragBorderColor; -varying float fragWidth, fragBorderColorLevel, fragColorLevel; - -float smoothStep(float x, float y) { - return 1.0 / (1.0 + exp(50.0*(x - y))); -} - -void main() { - float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth; - - // max-distance alpha - if (dist < 0.003) discard; - - // null-border case - if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) { - float colorAmt = smoothstep(.5 - delta, .5 + delta, dist); - gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity); - } - else { - float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist); - float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist); - - vec4 color = fragBorderColor; - color.a *= borderColorAmt; - color = mix(color, fragColor, colorAmt); - color.a *= opacity; - - gl_FragColor = color; - } - -} -`]),l.vert=s([`precision highp float; -#define GLSLIFY 1 - -attribute float x, y, xFract, yFract; -attribute float size, borderSize; -attribute vec4 colorId, borderColorId; -attribute float isActive; - -// \`invariant\` effectively turns off optimizations for the position. -// We need this because -fast-math on M1 Macs is re-ordering -// floating point operations in a way that causes floating point -// precision limits to put points in the wrong locations. -invariant gl_Position; - -uniform bool constPointSize; -uniform float pixelRatio; -uniform vec2 scale, scaleFract, translate, translateFract, paletteSize; -uniform sampler2D paletteTexture; - -const float maxSize = 100.; -const float borderLevel = .5; - -varying vec4 fragColor, fragBorderColor; -varying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel; - -float pointSizeScale = (constPointSize) ? 2. : pixelRatio; - -bool isDirect = (paletteSize.x < 1.); - -vec4 getColor(vec4 id) { - return isDirect ? id / 255. : texture2D(paletteTexture, - vec2( - (id.x + .5) / paletteSize.x, - (id.y + .5) / paletteSize.y - ) - ); -} - -void main() { - // ignore inactive points - if (isActive == 0.) return; - - vec2 position = vec2(x, y); - vec2 positionFract = vec2(xFract, yFract); - - vec4 color = getColor(colorId); - vec4 borderColor = getColor(borderColorId); - - float size = size * maxSize / 255.; - float borderSize = borderSize * maxSize / 255.; - - gl_PointSize = 2. * size * pointSizeScale; - fragPointSize = size * pixelRatio; - - vec2 pos = (position + translate) * scale - + (positionFract + translateFract) * scale - + (position + translate) * scaleFract - + (positionFract + translateFract) * scaleFract; - - gl_Position = vec4(pos * 2. - 1., 0., 1.); - - fragColor = color; - fragBorderColor = borderColor; - fragWidth = 1. / gl_PointSize; - - fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.); - fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.); -} -`]),this.drawMarker=t(l);let u=Object.assign({},o);u.frag=s([`precision highp float; -#define GLSLIFY 1 - -varying vec4 fragColor, fragBorderColor; -varying float fragBorderRadius, fragWidth; - -uniform float opacity; - -float smoothStep(float edge0, float edge1, float x) { - float t; - t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t); -} - -void main() { - float radius, alpha = 1.0, delta = fragWidth; - - radius = length(2.0 * gl_PointCoord.xy - 1.0); - - if (radius > 1.0 + delta) { - discard; - } - - alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); - - float borderRadius = fragBorderRadius; - float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); - vec4 color = mix(fragColor, fragBorderColor, ratio); - color.a *= alpha * opacity; - gl_FragColor = color; -} -`]),u.vert=s([`precision highp float; -#define GLSLIFY 1 - -attribute float x, y, xFract, yFract; -attribute float size, borderSize; -attribute vec4 colorId, borderColorId; -attribute float isActive; - -// \`invariant\` effectively turns off optimizations for the position. -// We need this because -fast-math on M1 Macs is re-ordering -// floating point operations in a way that causes floating point -// precision limits to put points in the wrong locations. -invariant gl_Position; - -uniform bool constPointSize; -uniform float pixelRatio; -uniform vec2 paletteSize, scale, scaleFract, translate, translateFract; -uniform sampler2D paletteTexture; - -const float maxSize = 100.; - -varying vec4 fragColor, fragBorderColor; -varying float fragBorderRadius, fragWidth; - -float pointSizeScale = (constPointSize) ? 2. : pixelRatio; - -bool isDirect = (paletteSize.x < 1.); - -vec4 getColor(vec4 id) { - return isDirect ? id / 255. : texture2D(paletteTexture, - vec2( - (id.x + .5) / paletteSize.x, - (id.y + .5) / paletteSize.y - ) - ); -} - -void main() { - // ignore inactive points - if (isActive == 0.) return; - - vec2 position = vec2(x, y); - vec2 positionFract = vec2(xFract, yFract); - - vec4 color = getColor(colorId); - vec4 borderColor = getColor(borderColorId); - - float size = size * maxSize / 255.; - float borderSize = borderSize * maxSize / 255.; - - gl_PointSize = (size + borderSize) * pointSizeScale; - - vec2 pos = (position + translate) * scale - + (positionFract + translateFract) * scale - + (position + translate) * scaleFract - + (positionFract + translateFract) * scaleFract; - - gl_Position = vec4(pos * 2. - 1., 0., 1.); - - fragBorderRadius = 1. - 2. * borderSize / (size + borderSize); - fragColor = color; - fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor; - fragWidth = 1. / gl_PointSize; -} -`]),this.drawCircle=t(u)}f.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},f.prototype.render=function(){return arguments.length&&this.update(...arguments),this.draw(),this},f.prototype.draw=function(){for(var t=arguments.length,r=Array(t),i=0;i{this.drawItem(r)});return this},f.prototype.drawItem=function(t,r){let{groups:i}=this,n=i[t];if("number"==typeof r&&(t=r,n=i[r],r=null),!(n&&n.count&&n.opacity))return;n.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,n,r));let a=[];for(let t=1;t{let i=a[r];if(void 0===t)return i;null===t?t={positions:null}:"function"==typeof t?t={ondraw:t}:"number"==typeof t[0]&&(t={positions:t}),null===(t=l(t,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"})).positions&&(t.positions=[]),null!=t.tooManyColors&&(this.tooManyColors=t.tooManyColors),i||(a[r]=i={id:r,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:p.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:p.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:p.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:p.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:p.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},t=Object.assign({},f.defaults,t)),!t.positions||"marker"in t||(t.marker=i.marker,delete i.marker),!t.marker||"positions"in t||(t.positions=i.positions,delete i.positions);let v=0,x=0;if(u(i,t,[{snap:!0,size:(t,r)=>(null==t&&(t=f.defaults.size),v+=t&&t.length?1:0,t),borderSize:(t,r)=>(null==t&&(t=f.defaults.borderSize),v+=t&&t.length?1:0,t),opacity:parseFloat,color:(t,r)=>(null==t&&(t=f.defaults.color),t=this.updateColor(t),x++,t),borderColor:(t,r)=>(null==t&&(t=f.defaults.borderColor),t=this.updateColor(t),x++,t),bounds:(t,r,i)=>("range"in i||(i.range=null),t),positions:(t,r,i)=>{let{snap:a}=r,{positionBuffer:s,positionFractBuffer:l,selectionBuffer:u}=r;if(t.x||t.y)return t.x.length?r.xAttr={buffer:p.buffer(t.x),offset:0,stride:4,count:t.x.length}:r.xAttr={buffer:t.x.buffer,offset:4*t.x.offset||0,stride:4*(t.x.stride||1),count:t.x.count},t.y.length?r.yAttr={buffer:p.buffer(t.y),offset:0,stride:4,count:t.y.length}:r.yAttr={buffer:t.y.buffer,offset:4*t.y.offset||0,stride:4*(t.y.stride||1),count:t.y.count},r.count=Math.max(r.xAttr.count,r.yAttr.count),t;let d=r.count=Math.floor((t=c(t,"float64")).length/2),f=r.bounds=d?n(t,2):null;if(i.range||r.range||(delete r.range,i.range=f),i.marker||r.marker||(delete r.marker,i.marker=null),a&&(!0===a||d>a)?r.tree=o(t,{bounds:f}):a&&a.length&&(r.tree=a),r.tree){let t={primitive:"points",usage:"static",data:r.tree,type:"uint32"};r.elements?r.elements(t):r.elements=p.elements(t)}var m=h.float32(t);return s({data:m,usage:"dynamic"}),l({data:h.fract32(t,m),usage:"dynamic"}),u({data:new Uint8Array(d),type:"uint8",usage:"stream"}),t}},{marker:(t,r,i)=>{let{activation:n}=r;if(n.forEach(t=>t&&t.destroy&&t.destroy()),n.length=0,t&&"number"!=typeof t[0]){let i=[];for(let n=0,a=Math.min(t.length,r.count);n{let n=r.bounds;if(n)return t||(t=n),r.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],r.translate=[-t[0],-t[1]],r.scaleFract=h.fract(r.scale),r.translateFract=h.fract(r.translate),t},viewport:t=>d(t||[s.drawingBufferWidth,s.drawingBufferHeight])}]),v){let{count:t,size:r,borderSize:n,sizeBuffer:a}=i,o=new Uint8Array(2*t);if(r.length||n.length)for(let i=0;i=0)return o;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)r=t;else{r=new Uint8Array(t.length);for(let i=0,n=t.length;i4*o&&(this.tooManyColors=!0),this.updatePalette(n),1===s.length?s[0]:s},f.prototype.updatePalette=function(t){if(this.tooManyColors)return;let{maxColors:r,paletteTexture:i}=this,n=Math.ceil(.25*t.length/r);if(n>1){t=t.slice();for(let i=.25*t.length%r;i{t.sizeBuffer.destroy(),t.positionBuffer.destroy(),t.positionFractBuffer.destroy(),t.colorBuffer.destroy(),t.activation.forEach(t=>t&&t.destroy&&t.destroy()),t.selectionBuffer.destroy(),t.elements&&t.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(t=>t&&t.destroy&&t.destroy()),this},r.exports=function(t,r){var i=new f(t,r),n=i.render.bind(i);return Object.assign(n,{render:n,update:i.update.bind(i),draw:i.draw.bind(i),destroy:i.destroy.bind(i),regl:i.regl,gl:i.gl,canvas:i.gl.canvas,groups:i.groups,markers:i.markerCache,palette:i.palette}),n}}}),mB=g({"node_modules/object-assign/index.js"(t,r){var i=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;r.exports=!function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var r={},i=0;i<10;i++)r["_"+String.fromCharCode(i)]=i;var n=Object.getOwnPropertyNames(r).map(function(t){return r[t]});if("0123456789"!==n.join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(t){a[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch{return!1}}()?function(t,r){for(var o,s,l=function(t){if(null==t)throw TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),u=1;u=o.next.y&&o.next.y!==o.y){var d=o.x+(c-o.y)*(o.next.x-o.x)/(o.next.y-o.y);if(d<=s&&d>h&&(h=d,a=o.x=o.x&&o.x>=g&&s!==o.x&&l(ca.x||o.x===a.x&&(i=a,n=o,0>u(i.prev,i,n.prev)&&0>u(n.next,i,i.next))))&&(a=o,v=f)),o=o.next}while(o!==m);return a}(t,r);if(!i)return r;var n=m(i,t);return a(n,n.next),a(i,i.next)}(y[c],i);return i}(t,r,A,i)),t.length>80*i){d=g=t[0],f=v=t[1];for(var k=i;kg&&(g=x),b>v&&(v=b);_=0!==(_=Math.max(g-d,v-f))?32767/_:0}return function t(r,i,n,o,d,f,g){if(r){!g&&f&&function(t,r,i,n){var a=t;do 0===a.z&&(a.z=s(a.x,a.y,r,i,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,function(t){var r,i,n,a,o,s,l,u,c=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,l=0,r=0;r0||u>0&&n;)0!==l&&(0===u||!n||i.z<=n.z)?(a=i,i=i.nextZ,l--):(a=n,n=n.nextZ,u--),o?o.nextZ=a:t=a,a.prevZ=o,o=a;i=n}o.nextZ=null,c*=2}while(s>1)}(a)}(r,o,d,f);for(var v,x,b=r;r.prev!==r.next;){if(v=r.prev,x=r.next,f?function(t,r,i,n){var a=t.prev,o=t.next;if(u(a,t,o)>=0)return!1;for(var c=a.x,h=t.x,d=o.x,f=a.y,p=t.y,m=o.y,g=ch?c>d?c:d:h>d?h:d,x=f>p?f>m?f:m:p>m?p:m,b=s(g,y,r,i,n),_=s(v,x,r,i,n),w=t.prevZ,T=t.nextZ;w&&w.z>=b&&T&&T.z<=_;){if(w.x>=g&&w.x<=v&&w.y>=y&&w.y<=x&&w!==a&&w!==o&&l(c,f,h,p,d,m,w.x,w.y)&&u(w.prev,w,w.next)>=0||(w=w.prevZ,T.x>=g&&T.x<=v&&T.y>=y&&T.y<=x&&T!==a&&T!==o&&l(c,f,h,p,d,m,T.x,T.y)&&u(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;w&&w.z>=b;){if(w.x>=g&&w.x<=v&&w.y>=y&&w.y<=x&&w!==a&&w!==o&&l(c,f,h,p,d,m,w.x,w.y)&&u(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=_;){if(T.x>=g&&T.x<=v&&T.y>=y&&T.y<=x&&T!==a&&T!==o&&l(c,f,h,p,d,m,T.x,T.y)&&u(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}(r,o,d,f):function(t){var r=t.prev,i=t.next;if(u(r,t,i)>=0)return!1;for(var n=r.x,a=t.x,o=i.x,s=r.y,c=t.y,h=i.y,d=na?n>o?n:o:a>o?a:o,m=s>c?s>h?s:h:c>h?c:h,g=i.next;g!==r;){if(g.x>=d&&g.x<=p&&g.y>=f&&g.y<=m&&l(n,s,a,c,o,h,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}(r)){i.push(v.i/n|0),i.push(r.i/n|0),i.push(x.i/n|0),y(r),r=x.next,b=x.next;continue}if((r=x)===b){g?1===g?t(r=function(t,r,i){var n=t;do{var o=n.prev,s=n.next.next;!c(o,s)&&h(o,n,n.next,s)&&p(o,s)&&p(s,o)&&(r.push(o.i/i|0),r.push(n.i/i|0),r.push(s.i/i|0),y(n),y(n.next),n=t=s),n=n.next}while(n!==t);return a(n)}(a(r),i,n),i,n,o,d,f,2):2===g&&function(r,i,n,o,s,l){var d=r;do{for(var f,g,y=d.next.next;y!==d.prev;){if(d.i!==y.i&&(f=d,g=y,f.next.i!==g.i&&f.prev.i!==g.i&&!function(t,r){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==r.i&&i.next.i!==r.i&&h(i,i.next,t,r))return!0;i=i.next}while(i!==t);return!1}(f,g)&&(p(f,g)&&p(g,f)&&function(t,r){var i=t,n=!1,a=(t.x+r.x)/2,o=(t.y+r.y)/2;do i.y>o!=i.next.y>o&&i.next.y!==i.y&&a<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next;while(i!==t);return n}(f,g)&&(u(f.prev,f,g.prev)||u(f,g.prev,g))||c(f,g)&&u(f.prev,f,f.next)>0&&u(g.prev,g,g.next)>0))){var v=m(d,y);d=a(d,d.next),v=a(v,v.next),t(d,i,n,o,s,l,0),t(v,i,n,o,s,l,0);return}y=y.next}d=d.next}while(d!==r)}(r,i,n,o,d,f):t(a(r),i,n,o,d,f,1);break}}}}(A,M,i,d,f,_,0),M}function n(t,r,i,n,a){var o,s;if(a===x(t,r,i,n)>0)for(o=r;o=r;o-=n)s=g(o,t[o],t[o+1],s);return s&&c(s,s.next)&&(y(s),s=s.next),s}function a(t,r){if(!t)return t;r||(r=t);var i,n=t;do if(i=!1,!n.steiner&&(c(n,n.next)||0===u(n.prev,n,n.next))){if(y(n),(n=r=n.prev)===n.next)break;i=!0}else n=n.next;while(i||n!==r);return r}function o(t,r){return t.x-r.x}function s(t,r,i,n,a){return(t=((t=((t=((t=((t=(t-i)*a|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(r=((r=((r=((r=((r=(r-n)*a|0)|r<<8)&0xff00ff)|r<<4)&0xf0f0f0f)|r<<2)&0x33333333)|r<<1)&0x55555555)<<1}function l(t,r,i,n,a,o,s,l){return(a-s)*(r-l)>=(t-s)*(o-l)&&(t-s)*(n-l)>=(i-s)*(r-l)&&(i-s)*(o-l)>=(a-s)*(n-l)}function u(t,r,i){return(r.y-t.y)*(i.x-r.x)-(r.x-t.x)*(i.y-r.y)}function c(t,r){return t.x===r.x&&t.y===r.y}function h(t,r,i,n){var a=f(u(t,r,i)),o=f(u(t,r,n)),s=f(u(i,n,t)),l=f(u(i,n,r));return!!(a!==o&&s!==l||0===a&&d(t,i,r)||0===o&&d(t,n,r)||0===s&&d(i,t,n)||0===l&&d(i,r,n))}function d(t,r,i){return r.x<=Math.max(t.x,i.x)&&r.x>=Math.min(t.x,i.x)&&r.y<=Math.max(t.y,i.y)&&r.y>=Math.min(t.y,i.y)}function f(t){return t>0?1:t<0?-1:0}function p(t,r){return 0>u(t.prev,t,t.next)?u(t,r,t.next)>=0&&u(t,t.prev,r)>=0:0>u(t,r,t.prev)||0>u(t,t.next,r)}function m(t,r){var i=new v(t.i,t.x,t.y),n=new v(r.i,r.x,r.y),a=t.next,o=r.prev;return t.next=r,r.prev=t,i.next=a,a.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function g(t,r,i,n){var a=new v(t,r,i);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function y(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function v(t,r,i){this.i=t,this.x=r,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(t,r,i,n){for(var a=0,o=r,s=i-n;o0&&(n+=t[a-1].length,i.holes.push(n))}return i}}}),mN=g({"node_modules/array-normalize/index.js"(t,r){var i=me();r.exports=function(t,r,n){if(!t||null==t.length)throw Error("Argument should be an array");null==r&&(r=1),null==n&&(n=i(t,r));for(var a=0;a-1}}}),gr=g({"node_modules/es5-ext/string/#/contains/index.js"(t,r){r.exports=ge()()?String.prototype.contains:gt()}}),gi=g({"node_modules/d/index.js"(t,r){var i=mJ(),n=m2(),a=m7(),o=m9(),s=gr();(r.exports=function(t,r){var n,l,u,c,h;return arguments.length<2||"string"!=typeof t?(c=r,r=t,t=null):c=arguments[2],i(t)?(n=s.call(t,"c"),l=s.call(t,"e"),u=s.call(t,"w")):(n=u=!0,l=!1),h={value:r,configurable:n,enumerable:l,writable:u},c?a(o(c),h):h}).gs=function(t,r,l){var u,c,h,d;return"string"!=typeof t?(h=l,l=r,r=t,t=null):h=arguments[3],i(r)?n(r)?i(l)?n(l)||(h=l,l=void 0):l=void 0:(h=r,r=l=void 0):r=void 0,i(t)?(u=s.call(t,"c"),c=s.call(t,"e")):(u=!0,c=!1),d={get:r,set:l,configurable:u,enumerable:c},h?a(o(h),d):d}}}),gn=g({"node_modules/es5-ext/function/is-arguments.js"(t,r){var i=Object.prototype.toString,n=i.call(function(){return arguments}());r.exports=function(t){return i.call(t)===n}}}),ga=g({"node_modules/es5-ext/string/is-string.js"(t,r){var i=Object.prototype.toString,n=i.call("");r.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||i.call(t)===n)||!1}}}),go=g({"node_modules/ext/global-this/is-implemented.js"(t,r){r.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}}}),gs=g({"node_modules/ext/global-this/implementation.js"(t,r){var i=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};r.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return i()}try{return __global__||i()}finally{delete Object.prototype.__global__}}()}}),gu=g({"node_modules/ext/global-this/index.js"(t,r){r.exports=go()()?globalThis:gs()}}),gc=g({"node_modules/es6-symbol/is-implemented.js"(t,r){var i=gu(),n={object:!0,symbol:!0};r.exports=function(){var t,r=i.Symbol;if("function"!=typeof r)return!1;t=r("test symbol");try{String(t)}catch{return!1}return!(!n[typeof r.iterator]||!n[typeof r.toPrimitive]||!n[typeof r.toStringTag])}}}),gh=g({"node_modules/es6-symbol/is-symbol.js"(t,r){r.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}}}),gd=g({"node_modules/es6-symbol/validate-symbol.js"(t,r){var i=gh();r.exports=function(t){if(!i(t))throw TypeError(t+" is not a symbol");return t}}}),gf=g({"node_modules/es6-symbol/lib/private/generate-name.js"(t,r){var i=gi(),n=Object.defineProperty,a=Object.prototype,o=(0,Object.create)(null);r.exports=function(t){for(var r,s,l=0;o[t+(l||"")];)++l;return o[t+=l||""]=!0,n(a,r="@@"+t,i.gs(null,function(t){s||(s=!0,n(this,r,i(t)),s=!1)})),r}}}),gp=g({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(t,r){var i=gi(),n=gu().Symbol;r.exports=function(t){return Object.defineProperties(t,{hasInstance:i("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:i("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:i("",n&&n.iterator||t("iterator")),match:i("",n&&n.match||t("match")),replace:i("",n&&n.replace||t("replace")),search:i("",n&&n.search||t("search")),species:i("",n&&n.species||t("species")),split:i("",n&&n.split||t("split")),toPrimitive:i("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:i("",n&&n.toStringTag||t("toStringTag")),unscopables:i("",n&&n.unscopables||t("unscopables"))})}}}),gm=g({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(t,r){var i=gi(),n=gd(),a=Object.create(null);r.exports=function(t){return Object.defineProperties(t,{for:i(function(r){return a[r]?a[r]:a[r]=t(String(r))}),keyFor:i(function(t){var r;for(r in n(t),a)if(a[r]===t)return r})})}}}),gg=g({"node_modules/es6-symbol/polyfill.js"(t,r){var i,n,a,o=gi(),s=gd(),l=gu().Symbol,u=gf(),c=gp(),h=gm(),d=Object.create,f=Object.defineProperties,p=Object.defineProperty;if("function"==typeof l)try{String(l()),a=!0}catch{}else l=null;n=function(t){if(this instanceof n)throw TypeError("Symbol is not a constructor");return i(t)},r.exports=i=function t(r){if(this instanceof t)throw TypeError("Symbol is not a constructor");return a?l(r):f(d(n.prototype),{__description__:o("",r=void 0===r?"":String(r)),__name__:o("",u(r))})},c(i),h(i),f(n.prototype,{constructor:o(i),toString:o("",function(){return this.__name__})}),f(i.prototype,{toString:o(function(){return"Symbol ("+s(this).__description__+")"}),valueOf:o(function(){return s(this)})}),p(i.prototype,i.toPrimitive,o("",function(){var t=s(this);return"symbol"==typeof t?t:t.toString()})),p(i.prototype,i.toStringTag,o("c","Symbol")),p(n.prototype,i.toStringTag,o("c",i.prototype[i.toStringTag])),p(n.prototype,i.toPrimitive,o("c",i.prototype[i.toPrimitive]))}}),gy=g({"node_modules/es6-symbol/index.js"(t,r){r.exports=gc()()?gu().Symbol:gg()}}),gv=g({"node_modules/es5-ext/array/#/clear.js"(t,r){var i=m$();r.exports=function(){return i(this).length=0,this}}}),gx=g({"node_modules/es5-ext/object/valid-callable.js"(t,r){r.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function");return t}}}),gb=g({"node_modules/type/string/coerce.js"(t,r){var i=mJ(),n=mQ(),a=Object.prototype.toString;r.exports=function(t){if(!i(t))return null;if(n(t)){var r=t.toString;if("function"!=typeof r||r===a)return null}try{return""+t}catch{return null}}}}),g_=g({"node_modules/type/lib/safe-to-string.js"(t,r){r.exports=function(t){try{return t.toString()}catch{try{return String(t)}catch{return null}}}}}),gw=g({"node_modules/type/lib/to-short-string.js"(t,r){var i=g_(),n=/[\n\r\u2028\u2029]/g;r.exports=function(t){var r=i(t);return null===r?"":(r.length>100&&(r=r.slice(0,99)+"…"),r=r.replace(n,function(t){switch(t){case` -`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("Unexpected character")}}))}}}),gT=g({"node_modules/type/lib/resolve-error-message.js"(t,r){var i=gb(),n=gw();r.exports=function(t,r,a){a&&a.errorMessage&&(t=i(a.errorMessage));var o=t.indexOf("%v"),s=o>-1?n(r):null;if(a&&a.name){var l,u,c,h,d=t.indexOf("%n");if(d>-1)return o>-1?(d>o?(l=s,c=o,u=a.name,h=d):(l=a.name,c=d,u=s,h=o),t.slice(0,c)+l+t.slice(c+2,h)+u+t.slice(h+2)):t.slice(0,d)+a.name+t.slice(d+2)}return o>-1?t.slice(0,o)+s+t.slice(o+2):t}}}),gA=g({"node_modules/type/lib/resolve-exception.js"(t,r){var i=mJ(),n=gT();r.exports=function(t,r,a){if(a&&!i(t)){if("default"in a)return a.default;if(a.isOptional)return null}var o=new(a&&a.Error||TypeError)(n(r,t,a));throw a&&a.errorCode&&(o.code=a.errorCode),o}}}),gM=g({"node_modules/type/value/ensure.js"(t,r){var i=gA(),n=mJ();r.exports=function(t){if(n(t))return t;var r=arguments[1];return i(t,r&&r.name?"Expected a value for %n, received %v":"Cannot use %v",r)}}}),gk=g({"node_modules/type/plain-function/ensure.js"(t,r){var i=gA(),n=m2();r.exports=function(t){if(n(t))return t;var r=arguments[1];return i(t,r&&r.name?"Expected a plain function for %n, received %v":"%v is not a plain function",r)}}}),gS=g({"node_modules/es5-ext/array/from/is-implemented.js"(t,r){r.exports=function(){var t,r,i=Array.from;return"function"==typeof i&&!!((r=i(t=["raz","dwa"]))&&r!==t&&"dwa"===r[1])}}}),gE=g({"node_modules/es5-ext/function/is-function.js"(t,r){var i=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);r.exports=function(t){return"function"==typeof t&&n(i.call(t))}}}),gD=g({"node_modules/es5-ext/math/sign/is-implemented.js"(t,r){r.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}}}),gC=g({"node_modules/es5-ext/math/sign/shim.js"(t,r){r.exports=function(t){return isNaN(t=Number(t))||0===t?t:t>0?1:-1}}}),gI=g({"node_modules/es5-ext/math/sign/index.js"(t,r){r.exports=gD()()?Math.sign:gC()}}),gL=g({"node_modules/es5-ext/number/to-integer.js"(t,r){var i=gI(),n=Math.abs,a=Math.floor;r.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?i(t)*a(n(t)):t}}}),gP=g({"node_modules/es5-ext/number/to-pos-integer.js"(t,r){var i=gL(),n=Math.max;r.exports=function(t){return n(0,i(t))}}}),gz=g({"node_modules/es5-ext/array/from/shim.js"(t,r){var i=gy().iterator,n=gn(),a=gE(),o=gP(),s=gx(),l=m$(),u=mq(),c=ga(),h=Array.isArray,d=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;r.exports=function(t){var r,m,g,y,v,x,b,_,w,T,A=arguments[1],M=arguments[2];if(t=Object(l(t)),u(A)&&s(A),this&&this!==Array&&a(this))r=this;else{if(!A){if(n(t))return 1!==(v=t.length)?Array.apply(null,t):((y=[,])[0]=t[0],y);if(h(t)){for(y=Array(v=t.length),m=0;m=55296&&x<=56319&&(T+=t[++m]),T=A?d.call(A,M,T,g):T,r?(f.value=T,p(y,g,f)):y[g]=T,++g;v=g}}if(void 0===v)for(v=o(t.length),r&&(y=new r(v)),m=0;m=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void h(this,"__redo__",l("c",[t]));this.__redo__.forEach(function(r,i){r>=t&&(this.__redo__[i]=++r)},this),this.__redo__.push(t)}}),_onDelete:l(function(t){var r;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(r=this.__redo__.indexOf(t))&&this.__redo__.splice(r,1),this.__redo__.forEach(function(r,i){r>t&&(this.__redo__[i]=--r)},this)))}),_onClear:l(function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0})}))),h(i.prototype,c.iterator,l(function(){return this}))}}),gU=g({"node_modules/es6-iterator/array.js"(t,r){var i,n=mZ(),a=gr(),o=gi(),s=gy(),l=gV(),u=Object.defineProperty;i=r.exports=function(t,r){if(!(this instanceof i))throw TypeError("Constructor requires 'new'");l.call(this,t),u(this,"__kind__",o("",r=r?a.call(r,"key+value")?"key+value":a.call(r,"key")?"key":"value":"value"))},n&&n(i,l),delete i.prototype.constructor,i.prototype=Object.create(l.prototype,{_resolve:o(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),u(i.prototype,s.toStringTag,o("c","Array Iterator"))}}),gq=g({"node_modules/es6-iterator/string.js"(t,r){var i,n=mZ(),a=gi(),o=gy(),s=gV(),l=Object.defineProperty;i=r.exports=function(t){if(!(this instanceof i))throw TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",a("",t.length))},n&&n(i,s),delete i.prototype.constructor,i.prototype=Object.create(s.prototype,{_next:a(function(){if(this.__list__){if(this.__nextIndex__=55296&&r<=56319?i+this.__list__[this.__nextIndex__++]:i})}),l(i.prototype,o.toStringTag,a("c","String Iterator"))}}),gG=g({"node_modules/es6-iterator/is-iterable.js"(t,r){var i=gn(),n=mq(),a=ga(),o=gy().iterator,s=Array.isArray;r.exports=function(t){return!!n(t)&&(!!(s(t)||a(t)||i(t))||"function"==typeof t[o])}}}),gH=g({"node_modules/es6-iterator/valid-iterable.js"(t,r){var i=gG();r.exports=function(t){if(!i(t))throw TypeError(t+" is not iterable");return t}}}),g$=g({"node_modules/es6-iterator/get.js"(t,r){var i=gn(),n=ga(),a=gU(),o=gq(),s=gH(),l=gy().iterator;r.exports=function(t){return"function"==typeof s(t)[l]?t[l]():i(t)?new a(t):n(t)?new o(t):new a(t)}}}),gW=g({"node_modules/es6-iterator/for-of.js"(t,r){var i=gn(),n=gx(),a=ga(),o=g$(),s=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;r.exports=function(t,r){var c,h,d,f,p,m,g,y,v=arguments[2];if(s(t)||i(t)?c="array":a(t)?c="string":t=o(t),n(r),d=function(){f=!0},"array"===c)return void u.call(t,function(t){return l.call(r,v,t,d),f});if("string"===c){for(m=t.length,p=0;p=55296&&y<=56319&&(g+=t[++p]),l.call(r,v,g,d),!f);++p);return}for(h=t.next();!h.done;){if(l.call(r,v,h.value,d),f)return;h=t.next()}}}}),gY=g({"node_modules/es6-weak-map/is-native-implemented.js"(t,r){r.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),gZ=g({"node_modules/es6-weak-map/polyfill.js"(t,r){var i,n=mq(),a=mZ(),o=mX(),s=m$(),l=mK(),u=gi(),c=g$(),h=gW(),d=gy().toStringTag,f=gY(),p=Array.isArray,m=Object.defineProperty,g=Object.prototype.hasOwnProperty,y=Object.getPrototypeOf;r.exports=i=function(){var t,r=arguments[0];if(!(this instanceof i))throw TypeError("Constructor requires 'new'");return t=f&&a&&WeakMap!==i?a(new WeakMap,y(this)):this,n(r)&&(p(r)||(r=c(r))),m(t,"__weakMapData__",u("c","$weakMap$"+l())),r&&h(r,function(r){s(r),t.set(r[0],r[1])}),t},f&&(a&&a(i,WeakMap),i.prototype=Object.create(WeakMap.prototype,{constructor:u(i)})),Object.defineProperties(i.prototype,{delete:u(function(t){return!!g.call(o(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)}),get:u(function(t){if(g.call(o(t),this.__weakMapData__))return t[this.__weakMapData__]}),has:u(function(t){return g.call(o(t),this.__weakMapData__)}),set:u(function(t,r){return m(o(t),this.__weakMapData__,u("c",r)),this}),toString:u(function(){return"[object WeakMap]"})}),m(i.prototype,d,u("c","WeakMap"))}}),gX=g({"node_modules/es6-weak-map/index.js"(t,r){r.exports=mV()()?WeakMap:gZ()}}),gK=g({"node_modules/array-find-index/index.js"(t,r){r.exports=function(t,r,i){if("function"==typeof Array.prototype.findIndex)return t.findIndex(r,i);if("function"!=typeof r)throw TypeError("predicate must be a function");var n=Object(t),a=n.length;if(0===a)return -1;for(var o=0;o 0. && baClipping < length(normalWidth * endBotJoin)) { - //handle miter clipping - bTopCoord -= normalWidth * endTopJoin; - bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; - } - - if (nextReverse) { - //make join rectangular - vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; - float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); - bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; - bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; - } - else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { - //handle miter clipping - aBotCoord -= normalWidth * startBotJoin; - aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; - } - - vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; - vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; - - vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; - vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; - - //position is normalized 0..1 coord on the screen - vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; - - startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; - endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; - - gl_Position = vec4(position * 2.0 - 1.0, depth, 1); - - enableStartMiter = step(dot(currTangent, prevTangent), .5); - enableEndMiter = step(dot(currTangent, nextTangent), .5); - - //bevel miter cutoffs - if (miterMode == 1.) { - if (enableStartMiter == 1.) { - vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; - startCutoff = vec4(aCoord, aCoord); - startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; - startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; - startCutoff += viewport.xyxy; - startCutoff += startMiterWidth.xyxy; - } - - if (enableEndMiter == 1.) { - vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; - endCutoff = vec4(bCoord, bCoord); - endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; - endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; - endCutoff += viewport.xyxy; - endCutoff += endMiterWidth.xyxy; - } - } - - //round miter cutoffs - else if (miterMode == 2.) { - if (enableStartMiter == 1.) { - vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; - startCutoff = vec4(aCoord, aCoord); - startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; - startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; - startCutoff += viewport.xyxy; - startCutoff += startMiterWidth.xyxy; - } - - if (enableEndMiter == 1.) { - vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; - endCutoff = vec4(bCoord, bCoord); - endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; - endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; - endCutoff += viewport.xyxy; - endCutoff += endMiterWidth.xyxy; - } - } -} -`,b=` -precision highp float; - -uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; -uniform sampler2D dashTexture; - -varying vec4 fragColor; -varying vec2 tangent; -varying vec4 startCutoff, endCutoff; -varying vec2 startCoord, endCoord; -varying float enableStartMiter, enableEndMiter; - -float distToLine(vec2 p, vec2 a, vec2 b) { - vec2 diff = b - a; - vec2 perp = normalize(vec2(-diff.y, diff.x)); - return dot(p - a, perp); -} - -void main() { - float alpha = 1., distToStart, distToEnd; - float cutoff = thickness * .5; - - //bevel miter - if (miterMode == 1.) { - if (enableStartMiter == 1.) { - distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); - if (distToStart < -1.) { - discard; - return; - } - alpha *= min(max(distToStart + 1., 0.), 1.); - } - - if (enableEndMiter == 1.) { - distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); - if (distToEnd < -1.) { - discard; - return; - } - alpha *= min(max(distToEnd + 1., 0.), 1.); - } - } - - // round miter - else if (miterMode == 2.) { - if (enableStartMiter == 1.) { - distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); - if (distToStart < 0.) { - float radius = length(gl_FragCoord.xy - startCoord); - - if(radius > cutoff + .5) { - discard; - return; - } - - alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); - } - } - - if (enableEndMiter == 1.) { - distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); - if (distToEnd < 0.) { - float radius = length(gl_FragCoord.xy - endCoord); - - if(radius > cutoff + .5) { - discard; - return; - } - - alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); - } - } - } - - float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; - float dash = texture2D(dashTexture, vec2(t, .5)).r; - - gl_FragColor = fragColor; - gl_FragColor.a *= alpha * opacity * dash; -} -`;function _(t,r){if(!(this instanceof _))return new _(t,r);if("function"==typeof t?(r||(r={}),r.regl=t):r=t,r.length&&(r.positions=r),!(t=r.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=t._gl,this.regl=t,this.passes=[],this.shaders=_.shaders.has(t)?_.shaders.get(t):_.shaders.set(t,_.createShaders(t)).get(t),this.update(r)}r.exports=_,_.dashMult=2,_.maxPatternLength=256,_.precisionThreshold=3e6,_.maxPoints=1e4,_.maxLines=2048,_.shaders=new d,_.createShaders=function(t){let r=t.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),i={primitive:"triangle strip",instances:t.prop("count"),count:4,offset:0,uniforms:{miterMode:(t,r)=>"round"===r.join?2:1,miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashTexture:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashLength:t.prop("dashLength"),viewport:(t,r)=>[r.viewport.x,r.viewport.y,t.viewportWidth,t.viewportHeight],depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(t,r)=>!r.overlay},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},n=t(a({vert:m,frag:g,attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},i)),o;try{o=t(a({cull:{enable:!0,face:"back"},vert:x,frag:b,attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},i))}catch{o=n}return{fill:t({primitive:"triangle",elements:(t,r)=>r.triangles,offset:0,vert:y,frag:v,uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:(t,r)=>[r.viewport.x,r.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:i.blend,depth:{enable:!1},scissor:i.scissor,stencil:i.stencil,viewport:i.viewport}),rect:n,miter:o}},_.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},_.prototype.render=function(...t){t.length&&this.update(...t),this.draw()},_.prototype.draw=function(...t){return(t.length?t:this.passes).forEach((t,r)=>{if(t&&Array.isArray(t))return this.draw(...t);"number"==typeof t&&(t=this.passes[t]),t&&t.count>1&&t.opacity&&(this.regl._refresh(),t.fill&&t.triangles&&t.triangles.length>2&&this.shaders.fill(t),t.thickness&&(t.scale[0]*t.viewport.width>_.precisionThreshold||t.scale[1]*t.viewport.height>_.precisionThreshold||"rect"===t.join||!t.join&&(t.thickness<=2||t.count>=_.maxPoints)?this.shaders.rect(t):this.shaders.miter(t)))}),this},_.prototype.update=function(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let{regl:r,gl:d}=this;if(t.forEach((t,m)=>{let g=this.passes[m];if(void 0!==t){if(null===t){this.passes[m]=null;return}if("number"==typeof t[0]&&(t={positions:t}),t=o(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[m]=g={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},_.defaults,t)),null!=t.thickness&&(g.thickness=parseFloat(t.thickness)),null!=t.opacity&&(g.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(g.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(g.overlay=!!t.overlay,m<_.maxLines&&(g.depth=2*(_.maxLines-1-m%_.maxLines)/_.maxLines-1)),null!=t.join&&(g.join=t.join),null!=t.hole&&(g.hole=t.hole),null!=t.fill&&(g.fill=t.fill?i(t.fill,"uint8"):null),null!=t.viewport&&(g.viewport=f(t.viewport)),g.viewport||(g.viewport=f([d.drawingBufferWidth,d.drawingBufferHeight])),null!=t.close&&(g.close=t.close),null===t.positions&&(t.positions=[]),t.positions){let r,i;if(t.positions.x&&t.positions.y){let n=t.positions.x,a=t.positions.y;r=new Float64Array(2*(i=g.count=Math.max(n.length,a.length)));for(let t=0;tt-r),r=[],a=0,o=null!=g.hole?g.hole[0]:null;if(null!=o){let r=p(t,t=>t>=o);(t=t.slice(0,r)).push(o)}for(let n=0;nr-o+(t[n]-a)));s=s.map(r=>r+a+(r+a{t.colorBuffer.destroy(),t.positionBuffer.destroy(),t.dashTexture.destroy()}),this.passes.length=0,this}}}),gQ=g({"node_modules/regl-error2d/index.js"(t,r){var i=me(),n=mL(),a=mF(),o=p7(),s=mB(),l=mi(),{float32:u,fract32:c}=mO();r.exports=function(t,r){if("function"==typeof t?(r||(r={}),r.regl=t):r=t,r.length&&(r.positions=r),!(t=r.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let d=t._gl,f,p,m,g,y,v,x={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},b=[];return g=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),p=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),y=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=t.buffer({usage:"static",type:"float",data:h}),A(r),f=t({vert:` - precision highp float; - - attribute vec2 position, positionFract; - attribute vec4 error; - attribute vec4 color; - - attribute vec2 direction, lineOffset, capOffset; - - uniform vec4 viewport; - uniform float lineWidth, capSize; - uniform vec2 scale, scaleFract, translate, translateFract; - - varying vec4 fragColor; - - void main() { - fragColor = color / 255.; - - vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; - - vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; - - vec2 position = position + dxy; - - vec2 pos = (position + translate) * scale - + (positionFract + translateFract) * scale - + (position + translate) * scaleFract - + (positionFract + translateFract) * scaleFract; - - pos += pixelOffset / viewport.zw; - - gl_Position = vec4(pos * 2. - 1., 0, 1); - } - `,frag:` - precision highp float; - - varying vec4 fragColor; - - uniform float opacity; - - void main() { - gl_FragColor = fragColor; - gl_FragColor.a *= opacity; - } - `,uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:(t,r)=>[r.viewport.x,r.viewport.y,t.viewportWidth,t.viewportHeight]},attributes:{color:{buffer:g,offset:(t,r)=>4*r.offset,divisor:1},position:{buffer:p,offset:(t,r)=>8*r.offset,divisor:1},positionFract:{buffer:m,offset:(t,r)=>8*r.offset,divisor:1},error:{buffer:y,offset:(t,r)=>16*r.offset,divisor:1},direction:{buffer:v,stride:24,offset:0},lineOffset:{buffer:v,stride:24,offset:8},capOffset:{buffer:v,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:h.length}),s(_,{update:A,draw:w,destroy:M,regl:t,gl:d,canvas:d.canvas,groups:b}),_;function _(t){t?A(t):null===t&&M(),w()}function w(r){if("number"==typeof r)return T(r);r&&!Array.isArray(r)&&(r=[r]),t._refresh(),b.forEach((t,i)=>{if(t){if(r&&(r[i]?t.draw=!0:t.draw=!1),!t.draw){t.draw=!0;return}T(i)}})}function T(t){"number"==typeof t&&(t=b[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],f(t),t.after&&t.after(t))}function A(t){if(!t)return;null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);let r=0,h=0;if(_.groups=b=t.map((t,u)=>{let f=b[u];return t&&("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),f||(b[u]=f={id:u,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},x,t)),a(f,t,[{lineWidth:t=>.5*t,capSize:t=>.5*t,opacity:parseFloat,errors:t=>(t=l(t),h+=t.length,t),positions:(t,n)=>(n.count=Math.floor((t=l(t,"float64")).length/2),n.bounds=i(t,2),n.offset=r,r+=n.count,t)},{color:(t,r)=>{let i=r.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){let r=t;t=Array(i);for(let n=0;n{let n=r.bounds;return t||(t=n),r.scale=[1/(t[2]-t[0]),1/(t[3]-t[1])],r.translate=[-t[0],-t[1]],r.scaleFract=c(r.scale),r.translateFract=c(r.translate),t},viewport:t=>{let r;return Array.isArray(t)?r={x:t[0],y:t[1],width:t[2]-t[0],height:t[3]-t[1]}:t?(r={x:t.x||t.left||0,y:t.y||t.top||0},t.right?r.width=t.right-r.x:r.width=t.w||t.width||0,t.bottom?r.height=t.bottom-r.y:r.height=t.h||t.height||0):r={x:0,y:0,width:d.drawingBufferWidth,height:d.drawingBufferHeight},r}}])),f}),r||h){let t=b.reduce((t,r,i)=>t+(r?r.count:0),0),r=new Float64Array(2*t),i=new Uint8Array(4*t),n=new Float32Array(4*t);b.forEach((t,a)=>{if(!t)return;let{positions:o,count:s,offset:l,color:u,errors:c}=t;s&&(i.set(u,4*l),n.set(c,4*l),r.set(o,2*l))});var f=u(r);p(f),m(c(r,f)),g(i),y(n)}}function M(){p.destroy(),m.destroy(),g.destroy(),y.destroy(),v.destroy()}};var h=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]}}),g0=g({"node_modules/unquote/index.js"(t,r){var i=/[\'\"]/;r.exports=function(t){return t?(i.test(t.charAt(0))&&(t=t.substr(1)),i.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}}}),g1=g({"node_modules/css-global-keywords/index.json"(t,r){r.exports=["inherit","initial","unset"]}}),g2=g({"node_modules/css-system-font-keywords/index.json"(t,r){r.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),g3=g({"node_modules/css-font-weight-keywords/index.json"(t,r){r.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),g5=g({"node_modules/css-font-style-keywords/index.json"(t,r){r.exports=["normal","italic","oblique"]}}),g4=g({"node_modules/css-font-stretch-keywords/index.json"(t,r){r.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),g6=g({"node_modules/parenthesis/index.js"(t,r){function i(t,r){if("string"!=typeof t)return[t];var i=[t];"string"==typeof r||Array.isArray(r)?r={brackets:r}:r||(r={});var n=r.brackets?Array.isArray(r.brackets)?r.brackets:[r.brackets]:["{}","[]","()"],a=r.escape||"___",o=!!r.flat;n.forEach(function(t){var r=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function o(r,o,s){var l=i.push(r.slice(t[0].length,-t[1].length))-1;return n.push(l),a+l+a}i.forEach(function(t,n){for(var a,s=0;t!=a;)if(a=t,t=t.replace(r,o),s++>1e4)throw Error("References have circular dependency. Please, check them.");i[n]=t}),n=n.reverse(),i=i.map(function(r){return n.forEach(function(i){r=r.replace(RegExp("(\\"+a+i+"\\"+a+")","g"),t[0]+"$1"+t[1])}),r})});var s=RegExp("\\"+a+"([0-9]+)\\"+a);return o?i:function t(r,i,n){for(var a,o=[],l=0;a=s.exec(r);){if(l++>1e4)throw Error("Circular references in parenthesis");o.push(r.slice(0,a.index)),o.push(t(i[a[1]],i)),r=r.slice(a.index+a[0].length)}return o.push(r),o}(i[0],i)}function n(t,r){if(r&&r.flat){var i,n=r&&r.escape||"___",a=t[0];if(!a)return"";for(var o=RegExp("\\"+n+"([0-9]+)\\"+n),s=0;a!=i;){if(s++>1e4)throw Error("Circular references in "+t);i=a,a=a.replace(o,l)}return a}return t.reduce(function t(r,i){return Array.isArray(i)&&(i=i.reduce(t,"")),r+i},"");function l(r,i){if(null==t[i])throw Error("Reference "+i+"is undefined");return t[i]}}function a(t,r){return Array.isArray(t)?n(t,r):i(t,r)}a.parse=i,a.stringify=n,r.exports=a}}),g8=g({"node_modules/string-split-by/index.js"(t,r){var i=g6();r.exports=function(t,r,n){if(null==t)throw Error("First argument should be a string");if(null==r)throw Error("Separator should be a string or a RegExp");n?("string"==typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","“”","\xab\xbb"]:("string"==typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map(function(t){return 1===t.length&&(t+=t),t}));var a=i.parse(t,{flat:!0,brackets:n.ignore}),o=a[0].split(r);if(n.escape){for(var s=[],l=0;l1&&i===a&&('"'===i||"'"===i))return['"'+n(r.substr(1,r.length-2))+'"'];var o=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(r);if(o)return t(r.substr(0,o.index)).concat(t(o[1])).concat(t(r.substr(o.index+o[0].length)));var s=r.split(".");if(1===s.length)return['"'+n(r)+'"'];for(var l=[],u=0;utypeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function c(t){return"string"==typeof t?t.split():t}function h(t){return"string"==typeof t?document.querySelector(t):t}function d(t,r){for(var i=Array(t),n=0;n65535)<<4,t>>>=r,i=(t>255)<<3,t>>>=i,r|=i,i=(t>15)<<2,t>>>=i,r|=i,i=(t>3)<<1,t>>>=i,(r|=i)|t>>1}function p(){var t=d(8,function(){return[]});function r(r){var i=function(t){for(var r=16;r<=0x10000000;r*=16)if(t<=r)return r;return 0}(r),n=t[f(i)>>2];return n.length>0?n.pop():new ArrayBuffer(i)}function i(r){t[f(r.byteLength)>>2].push(r)}return{alloc:r,free:i,allocType:function(t,i){var n=null;switch(t){case 5120:n=new Int8Array(r(i),0,i);break;case 5121:n=new Uint8Array(r(i),0,i);break;case 5122:n=new Int16Array(r(2*i),0,i);break;case 5123:n=new Uint16Array(r(2*i),0,i);break;case 5124:n=new Int32Array(r(4*i),0,i);break;case 5125:n=new Uint32Array(r(4*i),0,i);break;case 5126:n=new Float32Array(r(4*i),0,i);break;default:return null}return n.length!==i?n.subarray(0,i):n},freeType:function(t){i(t.buffer)}}}var m=p();m.zero=p();var g=function(t,r){var i=1;r.ext_texture_filter_anisotropic&&(i=t.getParameter(34047));var n=1,a=1;r.webgl_draw_buffers&&(n=t.getParameter(34852),a=t.getParameter(36063));var o=!!r.oes_texture_float;if(o){var s=t.createTexture();t.bindTexture(3553,s),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var l=t.createFramebuffer();if(t.bindFramebuffer(36160,l),t.framebufferTexture2D(36160,36064,3553,s,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=m.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,u),t.getError()?o=!1:(t.deleteFramebuffer(l),t.deleteTexture(s),o=1===u[0]),m.freeType(u)}}var c="u">typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),h=!0;if(!c){var d=t.createTexture(),f=m.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,d),t.texImage2D(34069,0,6408,3,3,0,6408,5121,f),m.freeType(f),t.bindTexture(34067,null),t.deleteTexture(d),h=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(r).filter(function(t){return!!r[t]}),maxAnisotropic:i,maxDrawbuffers:n,maxColorAttachments:a,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:h}},y=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray};function v(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||y(t.data))}var x=function(t){return Object.keys(t).map(function(r){return t[r]})},b=function(t){for(var r=[],i=t;i.length;i=i[0])r.push(i.length);return r},_=function(t,r,i,n){var a=1;if(r.length)for(var o=0;o>>31<<15,o=(n<<1>>>24)-127,s=n>>13&1023;if(o<-24)r[i]=a;else if(o<-14){var l=-14-o;r[i]=a+(s+1024>>l)}else o>15?r[i]=a+31744:r[i]=a+(o+15<<10)+s}return r}function z(t){return Array.isArray(t)||y(t)}var F=[9984,9986,9985,9987],O=[0,6409,6410,6407,6408],R={};function B(t){return"[object "+t+"]"}R[6409]=R[6406]=R[6402]=1,R[34041]=R[6410]=2,R[6407]=R[35904]=3,R[6408]=R[35906]=4;var j=B("HTMLCanvasElement"),N=B("OffscreenCanvas"),V=B("CanvasRenderingContext2D"),U=B("ImageBitmap"),q=B("HTMLImageElement"),G=B("HTMLVideoElement"),H=Object.keys(T).concat([j,N,V,U,q,G]),$=[];$[5121]=1,$[5126]=4,$[36193]=2,$[5123]=2,$[5125]=4;var W=[];function Y(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function Z(t){return!!Array.isArray(t)&&!(0===t.length||!z(t[0]))}function X(t){return Object.prototype.toString.call(t)}function K(t){if(!t)return!1;var r=X(t);return H.indexOf(r)>=0||Y(t)||Z(t)||v(t)}function J(t){return 0|T[Object.prototype.toString.call(t)]}function Q(t,r){return m.allocType(36193===t.type?5126:t.type,r)}function ee(t,r){36193===t.type?(t.data=P(r),m.freeType(r)):t.data=r}function et(t,r,i,n,a,o){var s;if(s="u">typeof W[t]?W[t]:R[t]*$[r],o&&(s*=6),!a)return s*i*n;for(var l=0,u=i;u>=1;)l+=s*u*u,u/=2;return l}W[32854]=2,W[32855]=2,W[36194]=2,W[34041]=4,W[33776]=.5,W[33777]=.5,W[33778]=1,W[33779]=1,W[35986]=.5,W[35987]=1,W[34798]=1,W[35840]=.5,W[35841]=.25,W[35842]=.5,W[35843]=.25,W[36196]=.5;var er=[];er[32854]=2,er[32855]=2,er[36194]=2,er[33189]=2,er[36168]=1,er[34041]=4,er[35907]=4,er[34836]=16,er[34842]=8,er[34843]=6;var ei=function(t,r,i,n,a){var o={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};r.ext_srgb&&(o.srgba=35907),r.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),r.webgl_color_buffer_float&&(o.rgba32f=34836);var s=[];Object.keys(o).forEach(function(t){s[o[t]]=t});var l=0,u={};function c(t){this.id=l++,this.refCount=1,this.renderbuffer=t,this.format=32854,this.width=0,this.height=0,a.profile&&(this.stats={size:0})}function h(r){var i=r.renderbuffer;t.bindRenderbuffer(36161,null),t.deleteRenderbuffer(i),r.renderbuffer=null,r.refCount=0,delete u[r.id],n.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&h(this)},a.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach(function(r){t+=u[r].stats.size}),t}),{create:function(r,i){var l=new c(t.createRenderbuffer());function h(r,i){var n,u,c,d=0,f=0,p=32854;if("object"==typeof r&&r){if("shape"in r){var m=r.shape;d=0|m[0],f=0|m[1]}else"radius"in r&&(d=f=0|r.radius),"width"in r&&(d=0|r.width),"height"in r&&(f=0|r.height);"format"in r&&(p=o[r.format])}else"number"==typeof r?(d=0|r,f="number"==typeof i?0|i:d):r||(d=f=1);if(d!==l.width||f!==l.height||p!==l.format)return h.width=l.width=d,h.height=l.height=f,l.format=p,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,p,d,f),a.profile&&(l.stats.size=(n=l.format,u=l.width,c=l.height,er[n]*u*c)),h.format=s[l.format],h}return u[l.id]=l,n.renderbufferCount++,h(r,i),h.resize=function(r,i){var n,o,s,u=0|r,c=0|i||u;return u===l.width&&c===l.height||(h.width=l.width=u,h.height=l.height=c,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,l.format,u,c),a.profile&&(l.stats.size=(n=l.format,o=l.width,s=l.height,er[n]*o*s))),h},h._reglType="renderbuffer",h._renderbuffer=l,a.profile&&(h.stats=l.stats),h.destroy=function(){l.decRef()},h},clear:function(){x(u).forEach(h)},restore:function(){x(u).forEach(function(r){r.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.renderbuffer),t.renderbufferStorage(36161,r.format,r.width,r.height)}),t.bindRenderbuffer(36161,null)}}},en=[];en[6408]=4,en[6407]=3;var ea=[];function eo(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}function es(t,r){return t>>>r|t<<32-r}ea[5121]=1,ea[5126]=4,ea[36193]=2;var el=[0x428a2f98,0x71374491,-0x4a3f0431,-0x164a245b,0x3956c25b,0x59f111f1,-0x6dc07d5c,-0x54e3a12b,-0x27f85568,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,-0x7f214e02,-0x6423f959,-0x3e640e8c,-0x1b64963f,-0x1041b87a,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,-0x67c1aeae,-0x57ce3993,-0x4ffcd838,-0x40a68039,-0x391ff40d,-0x2a586eb9,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,-0x7e3d36d2,-0x6d8dd37b,-0x5d40175f,-0x57e599b5,-0x3db47490,-0x3893ae5d,-0x2e6d17e7,-0x2966f9dc,-0xbf1ca7b,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,-0x7b3787ec,-0x7338fdf8,-0x6f410006,-0x5baf9315,-0x41065c09,-0x398e870e];function eu(t,r){var i=(65535&t)+(65535&r);return(t>>16)+(r>>16)+(i>>16)<<16|65535&i}function ec(t){return Array.prototype.slice.call(t)}function eh(t){return ec(t).join("")}var ed="xyzw".split(""),ef="dither",ep="blend.enable",em="blend.color",eg="blend.equation",ey="blend.func",ev="depth.enable",ex="depth.func",eb="depth.range",e_="depth.mask",ew="colorMask",eT="cull.enable",eA="cull.face",eM="frontFace",ek="lineWidth",eS="polygonOffset.enable",eE="polygonOffset.offset",eD="sample.alpha",eC="sample.enable",eI="sample.coverage",eL="stencil.enable",eP="stencil.mask",ez="stencil.func",eF="stencil.opFront",eO="stencil.opBack",eR="scissor.enable",eB="scissor.box",ej="viewport",eN="profile",eV="framebuffer",eU="vert",eq="frag",eG="elements",eH="primitive",e$="count",eW="offset",eY="instances",eZ="Width",eX="Height",eK=eV+eZ,eJ=eV+eX,eQ=ej+eZ,e0=ej+eX,e1="drawingBuffer",e2=e1+eZ,e3=e1+eX,e5=[ey,eg,ez,eF,eO,eI,ej,eB,eE],e4={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},e6={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},e8={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},e7={cw:2304,ccw:2305};function e9(t){return Array.isArray(t)||y(t)||v(t)}function te(t){return t.sort(function(t,r){return t===ej?-1:r===ej?1:t=1,n>=2,r)}if(4===i){var a=t.data;return new tt(a.thisDep,a.contextDep,a.propDep,r)}if(5===i)return new tt(!1,!1,!1,r);if(6!==i)return new tt(3===i,2===i,1===i,r);for(var o=!1,s=!1,l=!1,u=0;u=1&&(s=!0),h>=2&&(l=!0)}else 4===c.type&&(o=o||c.data.thisDep,s=s||c.data.contextDep,l=l||c.data.propDep)}return new tt(o,s,l,r)}var ta=new tt(!1,!1,!1,function(){}),to=function(t,r){if(!r.ext_disjoint_timer_query)return null;var i=[],n=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[],s=[];function l(t,r,i){var n=o.pop()||new a;n.startQueryIndex=t,n.endQueryIndex=r,n.sum=0,n.stats=i,s.push(n)}var u=[],c=[];return{beginQuery:function(t){var a=i.pop()||r.ext_disjoint_timer_query.createQueryEXT();r.ext_disjoint_timer_query.beginQueryEXT(35007,a),n.push(a),l(n.length-1,n.length,t)},endQuery:function(){r.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:l,update:function(){var t,a,l=n.length;if(0!==l){c.length=Math.max(c.length,l+1),u.length=Math.max(u.length,l+1),u[0]=0,c[0]=0;var h=0;for(t=0,a=0;a"u"?1:window.devicePixelRatio,p=!1,m={},g=function(t){},y=function(){};if("string"==typeof s?i=document.querySelector(s):"object"==typeof s&&("string"==typeof s.nodeName&&"function"==typeof s.appendChild&&"function"==typeof s.getBoundingClientRect?i=s:"function"==typeof s.drawArrays||"function"==typeof s.drawElements?a=(o=s).canvas:("gl"in s?o=s.gl:"canvas"in s?a=h(s.canvas):"container"in s&&(n=h(s.container)),"attributes"in s&&(l=s.attributes),"extensions"in s&&(u=c(s.extensions)),"optionalExtensions"in s&&(d=c(s.optionalExtensions)),"onDone"in s&&(g=s.onDone),"profile"in s&&(p=!!s.profile),"pixelRatio"in s&&(f=+s.pixelRatio),"cachedCode"in s&&(m=s.cachedCode))),i&&("canvas"===i.nodeName.toLowerCase()?a=i:n=i),!o){if(!a){var v=function(r,i){var n,a=document.createElement("canvas");function o(){var t=window.innerWidth,n=window.innerHeight;if(r!==document.body){var o=a.getBoundingClientRect();t=o.right-o.left,n=o.bottom-o.top}a.width=i*t,a.height=i*n}return t(a.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),r.appendChild(a),r===document.body&&(a.style.position="absolute",t(r.style,{margin:0,padding:0})),r!==document.body&&"function"==typeof ResizeObserver?(n=new ResizeObserver(function(){setTimeout(o)})).observe(r):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){n?n.disconnect():window.removeEventListener("resize",o),r.removeChild(a)}}}(n||document.body,f);if(!v)return null;a=v.canvas,y=v.onDestroy}void 0===l.premultipliedAlpha&&(l.premultipliedAlpha=!0),o=function(t,r){function i(i){try{return t.getContext(i,r)}catch{return null}}return i("webgl")||i("experimental-webgl")||i("webgl-experimental")}(a,l)}return o?{gl:o,canvas:a,container:n,extensions:u,optionalExtensions:d,pixelRatio:f,profile:p,cachedCode:m,onDone:g,onDestroy:y}:(y(),g("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}(r);if(!p)return null;var w=p.gl,T=w.getContextAttributes(),I=(w.isContextLost(),function(t,r){var i={};function n(r){var n,a=r.toLowerCase();try{n=i[a]=t.getExtension(a)}catch{}return!!n}for(var a=0;a0)if(Array.isArray(r[0])){s=b(r);for(var s,l,c=1,h=1;h0){if("number"==typeof t[0]){var a=m.allocType(d.dtype,t.length);E(a,t),p(a,n),m.freeType(a)}else if(Array.isArray(t[0])||y(t[0])){i=b(t);var o=_(t,i,d.dtype);p(o,n),m.freeType(o)}}}else if(v(t)){i=t.shape;var s=t.stride,l=0,u=0,c=0,h=0;1===i.length?(l=i[0],u=1,c=s[0],h=0):2===i.length&&(l=i[0],u=i[1],c=s[0],h=s[1]);var g=Array.isArray(t.data)?d.dtype:S(t.data),x=m.allocType(g,l*u);D(x,t.data,l,u,c,h,t.offset),p(x,n),m.freeType(x)}return f},i.profile&&(f.stats=d.stats),f.destroy=function(){h(d)},f},createStream:function(t,r){var i=l.pop();return i||(i=new s(t)),i.bind(),c(i,r,35040,0,1,!1),i},destroyStream:function(t){l.push(t)},clear:function(){x(o).forEach(h),l.forEach(h)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){x(o).forEach(function(r){r.buffer=t.createBuffer(),t.bindBuffer(r.type,r.buffer),t.bufferData(r.type,r.persistentData||r.byteLength,r.usage)})},_initBuffer:c}}(w,B,p,function(t){return tp.destroyBuffer(t)}),tf=function(t,r,i,n){var a={},o=0,s={uint8:5121,uint16:5123};function l(t){this.id=o++,a[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}r.oes_element_index_uint&&(s.uint32=5125),l.prototype.bind=function(){this.buffer.bind()};var u=[];function c(n,a,o,s,l,u,c){if(n.buffer.bind(),a){var h,d=c;!c&&(!y(a)||v(a)&&!y(a.data))&&(d=r.oes_element_index_uint?5125:5123),i._initBuffer(n.buffer,a,o,d,3)}else t.bufferData(34963,u,o),n.buffer.dtype=h||5121,n.buffer.usage=o,n.buffer.dimension=3,n.buffer.byteLength=u;if(h=c,!c){switch(n.buffer.dtype){case 5121:case 5120:h=5121;break;case 5123:case 5122:h=5123;break;case 5125:case 5124:h=5125}n.buffer.dtype=h}n.type=h;var f=l;f<0&&(f=n.buffer.byteLength,5123===h?f>>=1:5125===h&&(f>>=2)),n.vertCount=f;var p=s;if(s<0){p=4;var m=n.buffer.dimension;1===m&&(p=0),2===m&&(p=1),3===m&&(p=4)}n.primType=p}function h(t){n.elementsCount--,delete a[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(t,r){var a=i.create(null,34963,!0),o=new l(a._buffer);function u(t){if(t)if("number"==typeof t)a(t),o.primType=4,o.vertCount=0|t,o.type=5121;else{var r=null,i=35044,n=-1,l=-1,h=0,d=0;Array.isArray(t)||y(t)||v(t)?r=t:("data"in t&&(r=t.data),"usage"in t&&(i=M[t.usage]),"primitive"in t&&(n=C[t.primitive]),"count"in t&&(l=0|t.count),"type"in t&&(d=s[t.type]),"length"in t?h=0|t.length:(h=l,5123===d||5122===d?h*=2:(5125===d||5124===d)&&(h*=4))),c(o,r,i,n,l,h,d)}else a(),o.primType=4,o.vertCount=0,o.type=5121;return u}return n.elementsCount++,u(t),u._reglType="elements",u._elements=o,u.subdata=function(t,r){return a.subdata(t,r),u},u.destroy=function(){h(o)},u},createStream:function(t){var r=u.pop();return r||(r=new l(i.create(null,34963,!0,!1)._buffer)),c(r,t,35040,-1,-1,0,0),r},destroyStream:function(t){u.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof l?t._elements:null},clear:function(){x(a).forEach(h)}}}(w,$,td,B),tp=function(t,r,i,n,a,o,s){for(var l=i.maxAttributes,u=Array(l),c=0;c=p.byteLength?h.subdata(p):(h.destroy(),r.buffers[u]=null)),r.buffers[u]||(h=r.buffers[u]=a.create(d,34962,!1,!0)),f.buffer=a.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,s[u]=1):a.getBuffer(d)?(f.buffer=a.getBuffer(d),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):a.getBuffer(d.buffer)?(f.buffer=a.getBuffer(d.buffer),f.size=0|(+d.size||f.buffer.dimension),f.normalized=!!d.normalized,"type"in d?f.type=A[d.type]:f.type=f.buffer.dtype,f.offset=0|(d.offset||0),f.stride=0|(d.stride||0),f.divisor=0|(d.divisor||0),f.state=1):"x"in d&&(f.x=+d.x||0,f.y=+d.y||0,f.z=+d.z||0,f.w=+d.w||0,f.state=2)}for(var m=0;m1)for(var v=0;vt&&(t=r.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return d.forEach(function(r){r.stats.attributesCount>t&&(t=r.stats.attributesCount)}),t}),{clear:function(){var t=r.deleteShader.bind(r);x(o).forEach(t),o={},x(s).forEach(t),s={},d.forEach(function(t){r.deleteProgram(t.program)}),d.length=0,h={},n.shaderCount=0},program:function(i,a,l,u){var c=h[a];c||(c=h[a]={});var f=c[i];if(f&&(f.refCount++,!u))return f;var g=new p(a,i);return n.shaderCount++,m(g,l,u),f||(c[i]=g),d.push(g),t(g,{destroy:function(){if(g.refCount--,g.refCount<=0){r.deleteProgram(g.program);var t=d.indexOf(g);d.splice(t,1),n.shaderCount--}c[g.vertId].refCount<=0&&(r.deleteShader(s[g.vertId]),delete s[g.vertId],delete h[g.fragId][g.vertId]),Object.keys(h[g.fragId]).length||(r.deleteShader(o[g.fragId]),delete o[g.fragId],delete h[g.fragId])}})},restore:function(){o={},s={};for(var t=0;t=0&&(g[t]=r)});var A=Object.keys(g);n.textureFormats=A;var M=[];Object.keys(g).forEach(function(t){M[g[t]]=t});var k=[];Object.keys(p).forEach(function(t){k[p[t]]=t});var S=[];Object.keys(h).forEach(function(t){S[h[t]]=t});var E=[];Object.keys(d).forEach(function(t){E[d[t]]=t});var D=[];Object.keys(c).forEach(function(t){D[c[t]]=t});var C=A.reduce(function(t,r){var n=g[r];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||i.ext_srgb&&(35904===n||35906===n)?t[n]=n:32855===n||r.indexOf("rgba")>=0?t[n]=6408:t[n]=6407,t},{});function I(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function L(t,r){t.internalformat=r.internalformat,t.format=r.format,t.type=r.type,t.compressed=r.compressed,t.premultiplyAlpha=r.premultiplyAlpha,t.flipY=r.flipY,t.unpackAlignment=r.unpackAlignment,t.colorSpace=r.colorSpace,t.width=r.width,t.height=r.height,t.channels=r.channels}function B(t,r){if(!("object"!=typeof r||!r)){"premultiplyAlpha"in r&&(t.premultiplyAlpha=r.premultiplyAlpha),"flipY"in r&&(t.flipY=r.flipY),"alignment"in r&&(t.unpackAlignment=r.alignment),"colorSpace"in r&&(t.colorSpace=f[r.colorSpace]),"type"in r&&(t.type=p[r.type]);var i=t.width,n=t.height,a=t.channels,o=!1;"shape"in r?(i=r.shape[0],n=r.shape[1],3===r.shape.length&&(a=r.shape[2],o=!0)):("radius"in r&&(i=n=r.radius),"width"in r&&(i=r.width),"height"in r&&(n=r.height),"channels"in r&&(a=r.channels,o=!0)),t.width=0|i,t.height=0|n,t.channels=0|a;var s=!1;if("format"in r){var l=r.format,u=t.internalformat=g[l];t.format=C[u],l in p&&("type"in r||(t.type=p[l])),l in w&&(t.compressed=!0),s=!0}!o&&s?t.channels=R[t.format]:o&&!s&&t.channels!==O[t.format]&&(t.format=t.internalformat=O[t.channels])}}function H(t){r.pixelStorei(37440,t.flipY),r.pixelStorei(37441,t.premultiplyAlpha),r.pixelStorei(37443,t.colorSpace),r.pixelStorei(3317,t.unpackAlignment)}function $(){I.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function W(t,r){var i=null;if(K(r)?i=r:r&&(B(t,r),"x"in r&&(t.xOffset=0|r.x),"y"in r&&(t.yOffset=0|r.y),K(r.data)&&(i=r.data)),r.copy){var n=o.viewportWidth,a=o.viewportHeight;t.width=t.width||n-t.xOffset,t.height=t.height||a-t.yOffset,t.needsCopy=!0}else if(i){if(y(i))t.channels=t.channels||4,t.data=i,"type"in r||5121!==t.type||(t.type=J(i));else if(Y(i))t.channels=t.channels||4,function(t,r){var i=r.length;switch(t.type){case 5121:case 5123:case 5125:case 5126:var n=m.allocType(t.type,i);n.set(r),t.data=n;break;case 36193:t.data=P(r)}}(t,i),t.alignment=1,t.needsFree=!0;else if(v(i)){var s=i.data;Array.isArray(s)||5121!==t.type||(t.type=J(s));var l,u,c,h,d,f,p=i.shape,g=i.stride;3===p.length?(c=p[2],f=g[2]):(c=1,f=1),l=p[0],u=p[1],h=g[0],d=g[1],t.alignment=1,t.width=l,t.height=u,t.channels=c,t.format=t.internalformat=O[c],t.needsFree=!0,function(t,r,i,n,a,o){for(var s=t.width,l=t.height,u=t.channels,c=Q(t,s*l*u),h=0,d=0;d>=a,i.height>>=a,W(i,n[a]),t.mipmask|=1<=0)||"faces"in r||(t.genMipmaps=!0)),"mag"in r&&(t.magFilter=h[r.mag]);var i=t.wrapS,n=t.wrapT;if("wrap"in r){var a=r.wrap;"string"==typeof a?i=n=c[a]:Array.isArray(a)&&(i=c[a[0]],n=c[a[1]])}else"wrapS"in r&&(i=c[r.wrapS]),"wrapT"in r&&(n=c[r.wrapT]);if(t.wrapS=i,t.wrapT=n,"anisotropic"in r&&(r.anisotropic,t.anisotropic=r.anisotropic),"mipmap"in r){var o=!1;switch(typeof r.mipmap){case"string":t.mipmapHint=u[r.mipmap],t.genMipmaps=!0,o=!0;break;case"boolean":o=t.genMipmaps=r.mipmap;break;case"object":t.genMipmaps=!1,o=!0}!o||"min"in r||(t.minFilter=9984)}}function em(t,n){r.texParameteri(n,10241,t.minFilter),r.texParameteri(n,10240,t.magFilter),r.texParameteri(n,10242,t.wrapS),r.texParameteri(n,10243,t.wrapT),i.ext_texture_filter_anisotropic&&r.texParameteri(n,34046,t.anisotropic),t.genMipmaps&&(r.hint(33170,t.mipmapHint),r.generateMipmap(n))}var eg=0,ey={},ev=n.maxTextureUnits,ex=Array(ev).map(function(){return null});function eb(t){I.call(this),this.mipmask=0,this.internalformat=6408,this.id=eg++,this.refCount=1,this.target=t,this.texture=r.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new ef,l.profile&&(this.stats={size:0})}function e_(t){r.activeTexture(33984),r.bindTexture(t.target,t.texture)}function ew(){var t=ex[0];t?r.bindTexture(t.target,t.texture):r.bindTexture(3553,null)}function eT(t){var i=t.texture,n=t.unit,a=t.target;n>=0&&(r.activeTexture(33984+n),r.bindTexture(a,null),ex[n]=null),r.deleteTexture(i),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete ey[t.id],s.textureCount--}return t(eb.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var i=0;i0)continue;n.unit=-1}ex[i]=this,t=i;break}l.profile&&s.maxTextureUnits>u)-s,c.height=c.height||(n.height>>u)-l,e_(n),er(c,3553,s,l,u),ew(),ea(c),a},a.resize=function(t,i){var o=0|t,s=0|i||o;if(o===n.width&&s===n.height)return a;a.width=n.width=o,a.height=n.height=s,e_(n);for(var u=0;n.mipmask>>u;++u){var c=o>>u,h=s>>u;if(!c||!h)break;r.texImage2D(3553,u,n.format,c,h,0,n.format,n.type,null)}return ew(),l.profile&&(n.stats.size=et(n.internalformat,n.type,o,s,!1,!1)),a},a._reglType="texture2d",a._texture=n,l.profile&&(a.stats=n.stats),a.destroy=function(){n.decRef()},a},createCube:function(t,i,n,a,o,u){var c=new eb(34067);ey[c.id]=c,s.cubeCount++;var h=Array(6);function d(t,r,i,n,a,o){var s,u=c.texInfo;for(ef.call(u),s=0;s<6;++s)h[s]=eh();if("number"!=typeof t&&t){if("object"==typeof t)if(r)el(h[0],t),el(h[1],r),el(h[2],i),el(h[3],n),el(h[4],a),el(h[5],o);else if(ep(u,t),B(c,t),"faces"in t){var f=t.faces;for(s=0;s<6;++s)L(h[s],c),el(h[s],f[s])}else for(s=0;s<6;++s)el(h[s],t)}else{var p=0|t||1;for(s=0;s<6;++s)es(h[s],p,p)}for(L(c,h[0]),u.genMipmaps?c.mipmask=(h[0].width<<1)-1:c.mipmask=h[0].mipmask,c.internalformat=h[0].internalformat,d.width=h[0].width,d.height=h[0].height,e_(c),s=0;s<6;++s)eu(h[s],34069+s);for(em(u,34067),ew(),l.profile&&(c.stats.size=et(c.internalformat,c.type,d.width,d.height,u.genMipmaps,!0)),d.format=M[c.internalformat],d.type=k[c.type],d.mag=S[u.magFilter],d.min=E[u.minFilter],d.wrapS=D[u.wrapS],d.wrapT=D[u.wrapT],s=0;s<6;++s)ed(h[s]);return d}return d(t,i,n,a,o,u),d.subimage=function(t,r,i,n,a){var o=0|i,s=0|n,l=0|a,u=en();return L(u,c),u.width=0,u.height=0,W(u,r),u.width=u.width||(c.width>>l)-o,u.height=u.height||(c.height>>l)-s,e_(c),er(u,34069+t,o,s,l),ew(),ea(u),d},d.resize=function(t){var i=0|t;if(i!==c.width){d.width=c.width=i,d.height=c.height=i,e_(c);for(var n=0;n<6;++n)for(var a=0;c.mipmask>>a;++a)r.texImage2D(34069+n,a,c.format,i>>a,i>>a,0,c.format,c.type,null);return ew(),l.profile&&(c.stats.size=et(c.internalformat,c.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=c,l.profile&&(d.stats=c.stats),d.destroy=function(){c.decRef()},d},clear:function(){for(var t=0;t>i,t.height>>i,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)r.texImage2D(34069+n,i,t.internalformat,t.width>>i,t.height>>i,0,t.internalformat,t.type,null);em(t.texInfo,t.target)})},refresh:function(){for(var t=0;t=0?f=!0:c.indexOf(m)>=0&&(f=!1))),("depthTexture"in t||"depthStencilTexture"in t)&&(M=!!(t.depthTexture||t.depthStencilTexture)),"depth"in t&&("boolean"==typeof t.depth?l=t.depth:(_=t.depth,h=!1)),"stencil"in t&&("boolean"==typeof t.stencil?h=t.stencil:(w=t.stencil,l=!1)),"depthStencil"in t&&("boolean"==typeof t.depthStencil?l=h=t.depthStencil:(T=t.depthStencil,l=!1,h=!1))}else o=s=1;var E=null,D=null,C=null,I=null;if(Array.isArray(d))E=d.map(g);else if(d)E=[g(d)];else for(E=Array(b),i=0;i0&&(l.depth=i[0].depth,l.stencil=i[0].stencil,l.depthStencil=i[0].depthStencil),i[s]?i[s](l):i[s]=S(l)}return t(n,{width:u,height:u,color:o})}return n(r),t(n,{faces:i,resize:function(t){var r,a=0|t;if(a===n.width)return n;var o=n.color;for(r=0;r0&&(r.push(t,"="),r.push.apply(r,ec(arguments)),r.push(";")),t},toString:function(){return eh([i.length>0?"var "+i.join(",")+";":"",eh(r)])}})}function u(){var r=l(),i=l(),n=r.toString,a=i.toString;function o(t,n){i(t,n,"=",r.def(t,n),";")}return t(function(){r.apply(r,ec(arguments))},{def:r.def,entry:r,exit:i,save:o,set:function(t,i,n){o(t,i),r(t,i,"=",n,";")},toString:function(){return n()+a()}})}var c=l(),h={};return{global:c,link:function(t,r){var i=r&&r.stable;if(!i){for(var l=0;l>>4&15)+i.charAt(15&r);return n}(function(t){for(var r=function(t,r){var i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T=[0x6a09e667,-0x4498517b,0x3c6ef372,-0x5ab00ac6,0x510e527f,-0x64fa9774,0x1f83d9ab,0x5be0cd19],A=Array(64);for(t[r>>5]|=128<<24-r%32,t[(r+64>>9<<4)+15]=r,x=0;x>>10,A[b-7]),es(n=A[b-15],7)^es(n,18)^n>>>3),A[b-16]),_=eu(eu(eu(eu(v,es(a=m,6)^es(a,11)^es(a,25)),(o=m)&g^~o&y),el[b]),A[b]),w=eu(es(s=h,2)^es(s,13)^es(s,22),(l=h)&(u=d)^l&(c=f)^u&c),v=y,y=g,g=m,m=eu(p,_),p=f,f=d,d=h,h=eu(_,w)}T[0]=eu(h,T[0]),T[1]=eu(d,T[1]),T[2]=eu(f,T[2]),T[3]=eu(p,T[3]),T[4]=eu(m,T[4]),T[5]=eu(g,T[5]),T[6]=eu(y,T[6]),T[7]=eu(v,T[7])}return T}(function(t){for(var r=Array(t.length>>2),i=0;i>5]|=(255&t.charCodeAt(i/8))<<24-i%32;return r}(t),8*t.length),i="",n=0;n<32*r.length;n+=8)i+=String.fromCharCode(r[n>>5]>>>24-n%32&255);return i}(function(t){for(var r,i,n="",a=-1;++a>>6&31,128|63&r):r<=65535?n+=String.fromCharCode(224|r>>>12&15,128|r>>>6&63,128|63&r):r<=2097151&&(n+=String.fromCharCode(240|r>>>18&7,128|r>>>12&63,128|r>>>6&63,128|63&r));return n}(n)))])return i[r].apply(null,o);var s=Function.apply(null,a.concat(n));return i&&(i[r]=s),s.apply(null,o)}}}({cache:x}),i=r.link,a=r.global;r.id=Q++,r.batchId="0";var o=i(K),s=r.shared={props:"a0"};Object.keys(K).forEach(function(t){s[t]=a.def(o,".",t)});var l=r.next={},u=r.current={};Object.keys($).forEach(function(t){Array.isArray(U[t])&&(l[t]=a.def(s.next,".",t),u[t]=a.def(s.current,".",t))});var c=r.constants={};Object.keys(J).forEach(function(t){c[t]=a.def(JSON.stringify(J[t]))}),r.invoke=function(t,n){switch(n.type){case 0:var a=["this",s.context,s.props,r.batchId];return t.def(i(n.data),".call(",a.slice(0,Math.max(n.data.length+1,4)),")");case 1:return t.def(s.props,n.data);case 2:return t.def(s.context,n.data);case 3:return t.def("this",n.data);case 4:return n.data.append(r,t),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map(function(i){return r.invoke(t,i)})}},r.attribCache={};var h={};return r.scopeAttrib=function(t){var r=n.id(t);if(r in h)return h[r];var a=p.scope[r];return a||(a=p.scope[r]=new R),h[r]=i(a)},r}function et(t,r,i){var n=t.shared.context,a=t.scope();Object.keys(i).forEach(function(o){r.save(n,"."+o);var s=i[o].append(t,r);Array.isArray(s)?a(n,".",o,"=[",s.join(),"];"):a(n,".",o,"=",s,";")}),r(a)}function er(t,r,i,n){var a,o=t.shared,s=o.gl,l=o.framebuffer;N&&(a=r.def(o.extensions,".webgl_draw_buffers"));var u,c=t.constants,h=c.drawBuffer,d=c.backBuffer;u=i?i.append(t,r):r.def(l,".next"),n||r("if(",u,"!==",l,".cur){"),r("if(",u,"){",s,".bindFramebuffer(",36160,",",u,".framebuffer);"),N&&r(a,".drawBuffersWEBGL(",h,"[",u,".colorAttachments.length]);"),r("}else{",s,".bindFramebuffer(",36160,",null);"),N&&r(a,".drawBuffersWEBGL(",d,");"),r("}",l,".cur=",u,";"),n||r("}")}function ei(t,r,i){var n=t.shared,a=n.gl,o=t.current,s=t.next,l=n.current,u=n.next,c=t.cond(l,".dirty");G.forEach(function(r){var n,h,f=W(r);if(!(f in i.state))if(f in s){n=s[f],h=o[f];var p=d(U[f].length,function(t){return c.def(n,"[",t,"]")});c(t.cond(p.map(function(t,r){return t+"!=="+h+"["+r+"]"}).join("||")).then(a,".",$[f],"(",p,");",p.map(function(t,r){return h+"["+r+"]="+t}).join(";"),";"))}else{n=c.def(u,".",f);var m=t.cond(n,"!==",l,".",f);c(m),f in H?m(t.cond(n).then(a,".enable(",H[f],");").else(a,".disable(",H[f],");"),l,".",f,"=",n,";"):m(a,".",$[f],"(",n,");",l,".",f,"=",n,";")}}),0===Object.keys(i.state).length&&c(l,".dirty=false;"),r(c)}function en(t,r,i,n){var a,o=t.shared,s=t.current,l=o.current,u=o.gl;te(Object.keys(i)).forEach(function(o){var c=i[o];if(!(n&&!n(c))){var h=c.append(t,r);if(H[o]){var d=H[o];tr(c)?(a=t.link(h,{stable:!0}),r(t.cond(a).then(u,".enable(",d,");").else(u,".disable(",d,");")),r(l,".",o,"=",a,";")):(r(t.cond(h).then(u,".enable(",d,");").else(u,".disable(",d,");")),r(l,".",o,"=",h,";"))}else if(z(h)){var f=s[o];r(u,".",$[o],"(",h,");",h.map(function(t,r){return f+"["+r+"]="+t}).join(";"),";")}else tr(c)?(a=t.link(h,{stable:!0}),r(u,".",$[o],"(",a,");",l,".",o,"=",a,";")):r(u,".",$[o],"(",h,");",l,".",o,"=",h,";")}})}function ea(t,r){j&&(t.instancing=r.def(t.shared.extensions,".angle_instanced_arrays"))}function eo(t,r,i,n,a){var o,s,l,u=t.shared,c=t.stats,h=u.current,d=u.timer,f=i.profile;function p(){return typeof performance>"u"?"Date.now()":"performance.now()"}function m(t){t(o=r.def(),"=",p(),";"),"string"==typeof a?t(c,".count+=",a,";"):t(c,".count++;"),v&&(n?t(s=r.def(),"=",d,".getNumPendingQueries();"):t(d,".beginQuery(",c,");"))}function g(t){t(c,".cpuTime+=",p(),"-",o,";"),v&&(n?t(d,".pushScopeStats(",s,",",d,".getNumPendingQueries(),",c,");"):t(d,".endQuery();"))}function y(t){var i=r.def(h,".profile");r(h,".profile=",t,";"),r.exit(h,".profile=",i,";")}if(f){if(tr(f))return void(f.enable?(m(r),g(r.exit),y("true")):y("false"));y(l=f.append(t,r))}else l=r.def(h,".profile");var x=t.block();m(x),r("if(",l,"){",x,"}");var b=t.block();g(b),r.exit("if(",l,"){",b,"}")}function eZ(t,r,i,n,a){var o=t.shared;n.forEach(function(n){var s,l=n.name,u=i.attributes[l];if(u){if(!a(u))return;s=u.append(t,r)}else{if(!a(ta))return;var c=t.scopeAttrib(l);s={},Object.keys(new R).forEach(function(t){s[t]=r.def(c,".",t)})}!function(i,n,a){var s=o.gl,l=r.def(i,".location"),u=r.def(o.attributes,"[",l,"]"),c=a.state,h=a.buffer,d=[a.x,a.y,a.z,a.w],f=["buffer","normalized","offset","stride"];function p(){r("if(!",u,".buffer){",s,".enableVertexAttribArray(",l,");}");var i,o=a.type;if(i=a.size?r.def(a.size,"||",n):n,r("if(",u,".type!==",o,"||",u,".size!==",i,"||",f.map(function(t){return u+"."+t+"!=="+a[t]}).join("||"),"){",s,".bindBuffer(",34962,",",h,".buffer);",s,".vertexAttribPointer(",[l,i,o,a.normalized,a.stride,a.offset],");",u,".type=",o,";",u,".size=",i,";",f.map(function(t){return u+"."+t+"="+a[t]+";"}).join(""),"}"),j){var c=a.divisor;r("if(",u,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[l,c],");",u,".divisor=",c,";}")}}function m(){r("if(",u,".buffer){",s,".disableVertexAttribArray(",l,");",u,".buffer=null;","}if(",ed.map(function(t,r){return u+"."+t+"!=="+d[r]}).join("||"),"){",s,".vertexAttrib4f(",l,",",d,");",ed.map(function(t,r){return u+"."+t+"="+d[r]+";"}).join(""),"}")}1===c?p():2===c?m():(r("if(",c,"===",1,"){"),p(),r("}else{"),m(),r("}"))}(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),s)})}function eX(t,r,i,a,o,s){for(var l,u=t.shared,c=u.gl,h=0;h1){for(var S=[],E=[],D=0;D>1)",h],");")}function r(){i(d,".drawArraysInstancedANGLE(",[x,b,_,h],");")}y&&"null"!==y?T?t():(i("if(",y,"){"),t(),i("}else{"),r(),i("}")):r()}function M(){function t(){i(p+".drawElements("+[x,_,w,b+"<<(("+w+"-5121)>>1)"]+");")}function r(){i(p+".drawArrays("+[x,b,_]+");")}y&&"null"!==y?T?t():(i("if(",y,"){"),t(),i("}else{"),r(),i("}")):r()}j&&("number"!=typeof h||h>=0)?"string"==typeof h?(i("if(",h,">0){"),A(),i("}else if(",h,"<0){"),M(),i("}")):A():M()}function to(t,r,i,n,a){var o=ee(),s=o.proc("body",a);return j&&(o.instancing=s.def(o.shared.extensions,".angle_instanced_arrays")),t(o,s,i,n),o.compile().body}function ts(t,r,i,n){ea(t,r),i.useVAO?i.drawVAO?r(t.shared.vao,".setVAO(",i.drawVAO.append(t,r),");"):r(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(r(t.shared.vao,".setVAO(null);"),eZ(t,r,i,n.attributes,function(){return!0})),eX(t,r,i,n.uniforms,function(){return!0},!1),e1(t,r,r,i)}function tl(t,r,i,n){function a(){return!0}t.batchId="a1",ea(t,r),eZ(t,r,i,n.attributes,a),eX(t,r,i,n.uniforms,a,!1),e1(t,r,r,i)}function tu(t,r,i,n){ea(t,r);var a=i.contextDep,o=r.def(),s=r.def();t.shared.props=s,t.batchId=o;var l=t.scope(),u=t.scope();function c(t){return t.contextDep&&a||t.propDep}function h(t){return!c(t)}if(r(l.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",s,"=","a0","[",o,"];",u,"}",l.exit),i.needsContext&&et(t,u,i.context),i.needsFramebuffer&&er(t,u,i.framebuffer),en(t,u,i.state,c),i.profile&&c(i.profile)&&eo(t,u,i,!1,!0),n)i.useVAO?i.drawVAO?c(i.drawVAO)?u(t.shared.vao,".setVAO(",i.drawVAO.append(t,u),");"):l(t.shared.vao,".setVAO(",i.drawVAO.append(t,l),");"):l(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(l(t.shared.vao,".setVAO(null);"),eZ(t,l,i,n.attributes,h),eZ(t,u,i,n.attributes,c)),eX(t,l,i,n.uniforms,h,!1),eX(t,u,i,n.uniforms,c,!0),e1(t,l,u,i);else{var d=t.global.def("{}"),f=i.shader.progVar.append(t,u),p=u.def(f,".id"),m=u.def(d,"[",p,"]");u(t.shared.gl,".useProgram(",f,".program);","if(!",m,"){",m,"=",d,"[",p,"]=",t.link(function(r){return to(tl,t,i,r,2)}),"(",f,");}",m,".call(this,a0[",o,"],",o,");")}}function tc(t,r,n){var a=r.static[n];if(a&&function(t){if(!("object"!=typeof t||z(t))){for(var r=Object.keys(t),i=0;i0)return null;var n=r.static,a=Object.keys(n);if(a.length>0&&"number"==typeof n[a[0]]){for(var o=[],s=0;s0,O={framebuffer:S,draw:D,shader:L,state:I,dirty:F,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(O.profile=function(t){var r,i=t.static,n=t.dynamic;if(eN in i){var a=!!i[eN];(r=ti(function(t,r){return a})).enable=a}else if(eN in n){var o=n[eN];r=tn(o,function(t,r){return t.invoke(r,o)})}return r}(t),g=i.static,y=i.dynamic,v={},Object.keys(g).forEach(function(t){var r,i=g[t];if("number"==typeof i||"boolean"==typeof i)r=ti(function(){return i});else if("function"==typeof i){var n=i._reglType;"texture2d"===n||"textureCube"===n?r=ti(function(t){return t.link(i)}):("framebuffer"===n||"framebufferCube"===n)&&(r=ti(function(t){return t.link(i.color[0])}))}else z(i)&&(r=ti(function(t){return t.global.def("[",d(i.length,function(t){return i[t]}),"]")}));r.value=i,v[t]=r}),Object.keys(y).forEach(function(t){var r=y[t];v[t]=tn(r,function(t,i){return t.invoke(i,r)})}),O.uniforms=v,O.drawVAO=O.scopeVAO=D.vao,!O.drawVAO&&L.program&&!k&&a.angle_instanced_arrays&&D.static.elements){var j=!0,N=L.program.attributes.map(function(t){var i=r.static[t];return j=j&&!!i,i});if(j&&N.length>0){var V=p.getVAO(p.createVAO({attributes:N,elements:D.static.elements}));O.drawVAO=new tt(null,null,null,function(t,r){return t.link(V)}),O.useVAO=!0}}return k?O.useVAO=!0:(x=r.static,b=r.dynamic,_={},Object.keys(x).forEach(function(t){var r=x[t],i=n.id(t),a=new R;if(e9(r))a.state=1,a.buffer=u.getBuffer(u.create(r,34962,!1,!0)),a.type=0;else{var o=u.getBuffer(r);if(o)a.state=1,a.buffer=o,a.type=0;else if("constant"in r){var s=r.constant;a.buffer="null",a.state=2,"number"==typeof s?a.x=s:ed.forEach(function(t,r){r"+r+"?"+n+".constant["+r+"]:0;"}).join(""),"}}else{","if(",s,"(",n,".buffer)){",h,"=",l,".createStream(",34962,",",n,".buffer);","}else{",h,"=",l,".getBuffer(",n,".buffer);","}",d,'="type" in ',n,"?",o.glTypes,"[",n,".type]:",h,".dtype;",u.normalized,"=!!",n,".normalized;"),f("size"),f("offset"),f("stride"),f("divisor"),i("}}"),i.exit("if(",u.isStream,"){",l,".destroyStream(",h,");","}"),u})}),O.attributes=_),w=o.static,T=o.dynamic,M={},Object.keys(w).forEach(function(t){var r=w[t];M[t]=ti(function(t,i){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(T).forEach(function(t){var r=T[t];M[t]=tn(r,function(t,i){return t.invoke(i,r)})}),O.context=M,O}(r,i,o,s);return g.shader.program&&(g.shader.program.attributes.sort(function(t,r){return t.name0&&i(t.shared.current,".dirty=true;"),t.shared.vao&&i(t.shared.vao,".setVAO(null);")}(f,g),function(t,r){var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;if(et(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),te(Object.keys(r.state)).forEach(function(n){var o=r.state[n],s=o.append(t,i);z(s)?s.forEach(function(r,a){X(r)?i.set(t.next[n],"["+a+"]",r):i.set(t.next[n],"["+a+"]",t.link(r,{stable:!0}))}):tr(o)?i.set(a.next,"."+n,t.link(s,{stable:!0})):i.set(a.next,"."+n,s)}),eo(t,i,r,!0,!0),[eG,eW,e$,eY,eH].forEach(function(n){var o=r.draw[n];if(o){var s=o.append(t,i);X(s)?i.set(a.draw,"."+n,s):i.set(a.draw,"."+n,t.link(s),{stable:!0})}}),Object.keys(r.uniforms).forEach(function(o){var s=r.uniforms[o].append(t,i);Array.isArray(s)&&(s="["+s.map(function(r){return X(r)?r:t.link(r,{stable:!0})})+"]"),i.set(a.uniforms,"["+t.link(n.id(o),{stable:!0})+"]",s)}),Object.keys(r.attributes).forEach(function(n){var a=r.attributes[n].append(t,i),o=t.scopeAttrib(n);Object.keys(new R).forEach(function(t){i.set(o,"."+t,a[t])})}),r.scopeVAO){var s=r.scopeVAO.append(t,i);X(s)?i.set(a.vao,".targetVAO",s):i.set(a.vao,".targetVAO",t.link(s,{stable:!0}))}function l(n){var o=r.shader[n];if(o){var s=o.append(t,i);X(s)?i.set(a.shader,"."+n,s):i.set(a.shader,"."+n,t.link(s,{stable:!0}))}}l(eU),l(eq),Object.keys(r.state).length>0&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}(f,g),function(t,r){var i=t.proc("batch",2);t.batchId="0",ea(t,i);var n=!1,a=!0;Object.keys(r.context).forEach(function(t){n=n||r.context[t].propDep}),n||(et(t,i,r.context),a=!1);var o=r.framebuffer,s=!1;function l(t){return t.contextDep&&n||t.propDep}o?(o.propDep?n=s=!0:o.contextDep&&n&&(s=!0),s||er(t,i,o)):er(t,i,null),r.state.viewport&&r.state.viewport.propDep&&(n=!0),ei(t,i,r),en(t,i,r.state,function(t){return!l(t)}),r.profile&&l(r.profile)||eo(t,i,r,!1,"a1"),r.contextDep=n,r.needsContext=a,r.needsFramebuffer=s;var u=r.shader.progVar;if(u.contextDep&&n||u.propDep)tu(t,i,r,null);else{var c=u.append(t,i);if(i(t.shared.gl,".useProgram(",c,".program);"),r.shader.program)tu(t,i,r,r.shader.program);else{i(t.shared.vao,".setVAO(null);");var h=t.global.def("{}"),d=i.def(c,".id"),f=i.def(h,"[",d,"]");i(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",h,"[",d,"]=",t.link(function(i){return to(tu,t,r,i,2)}),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(r.state).length>0&&i(t.shared.current,".dirty=true;"),t.shared.vao&&i(t.shared.vao,".setVAO(null);")}(f,g),t(f.compile(),{destroy:function(){g.shader.program.destroy()}})}}}(w,L,$,th,td,tf,tv,{},tp,tm,tc,e1,W,H,p),tb=function(t,r,i,n){function a(a){var o=null===r.next?5121:r.next.colorAttachments[0].texture._texture.type,s=0,l=0,u=n.framebufferWidth,c=n.framebufferHeight,h=null;y(a)?h=a:a&&(s=0|a.x,l=0|a.y,u=0|(a.width||n.framebufferWidth-s),c=0|(a.height||n.framebufferHeight-l),h=a.data||null),i();var d=u*c*4;return h||(5121===o?h=new Uint8Array(d):5126===o&&(h=h||new Float32Array(d))),t.pixelStorei(3333,4),t.readPixels(s,l,u,c,6408,o,h),h}return function(t){var i;return t&&"framebuffer"in t?(r.setFBO({framebuffer:t.framebuffer},function(){i=a(t)}),i):a(t)}}(w,tv,tx.procs.poll,e1),t_=tx.next,tw=w.canvas,tT=[],tA=[],tM=[],tk=[p.onDestroy],tS=null;function tE(){if(0===tT.length){W&&W.update(),tS=null;return}tS=l.next(tE),tB();for(var t=tT.length-1;t>=0;--t){var r=tT[t];r&&r(e1,null,0)}w.flush(),W&&W.update()}function tD(){!tS&&tT.length>0&&(tS=l.next(tE))}function tC(){tS&&(l.cancel(tE),tS=null)}function tI(t){t.preventDefault(),tC(),tA.forEach(function(t){t()})}function tL(t){w.getError(),I.restore(),tm.restore(),td.restore(),tg.restore(),ty.restore(),tv.restore(),tp.restore(),W&&W.restore(),tx.procs.refresh(),tD(),tM.forEach(function(t){t()})}function tP(r){function i(t,r){var i={},n={};return Object.keys(t).forEach(function(a){var l=t[a];if(o(l)){n[a]=s(l,a);return}if(r&&Array.isArray(l)){for(var u=0;u0)return f.call(this,function(t){for(;m.length=0},read:tb,destroy:function(){tT.length=0,tC(),tw&&(tw.removeEventListener(ts,tI),tw.removeEventListener(tl,tL)),tm.clear(),tv.clear(),ty.clear(),tp.clear(),tg.clear(),tf.clear(),td.clear(),W&&W.clear(),tk.forEach(function(t){t()})},_gl:w,_refresh:tj,poll:function(){tB(),W&&W.update()},now:tN,stats:B,getCachedCode:function(){return H},preloadCachedCode:function(t){Object.entries(t).forEach(function(t){H[t[0]]=t[1]})}});return p.onDone(null,tV),tV}},"object"==typeof t&&"u">typeof r?r.exports=i():t.createREGL=i()}}),yn=g({"node_modules/gl-util/context.js"(t,r){var i=p7();function n(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*window.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*window.innerHeight);else{var r=t.container.getBoundingClientRect();t.canvas.width=t.width||r.right-r.left,t.canvas.height=t.height||r.bottom-r.top}}function a(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function o(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}r.exports=function(t){if(t?"string"==typeof t&&(t={container:t}):t={},(t=a(t)||"string"==typeof(r=t).nodeName&&"function"==typeof r.appendChild&&"function"==typeof r.getBoundingClientRect?{container:t}:"function"==typeof(s=t).drawArrays||"function"==typeof s.drawElements?{gl:t}:i(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=window.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var r,s,l=document.querySelector(t.container);if(!l)throw Error("Element "+t.container+" is not found");t.container=l}a(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=o(),t.container.appendChild(t.canvas),n(t))}else if(!t.canvas)if("u">typeof document)t.container=document.body||document.documentElement,t.canvas=o(),t.container.appendChild(t.canvas),n(t);else throw Error("Not DOM environment. Use headless-gl.");return t.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(r){try{t.gl=t.canvas.getContext(r,t.attrs)}catch{}return t.gl}),t.gl}}}),ya=g({"node_modules/font-atlas/index.js"(t,r){var i=yt(),n=[32,126];r.exports=function(t){var r=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],a=t.canvas||document.createElement("canvas"),o=t.font,s="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],l=t.chars||n;if(o&&"string"!=typeof o&&(o=i(o)),Array.isArray(l)){if(2===l.length&&"number"==typeof l[0]&&"number"==typeof l[1]){for(var u=[],c=l[0],h=0;c<=l[1];c++)u[h++]=String.fromCharCode(c);l=u}}else l=String(l).split("");a.width=(r=r.slice())[0],a.height=r[1];var d=a.getContext("2d");d.fillStyle="#000",d.fillRect(0,0,a.width,a.height),d.font=o,d.textAlign="center",d.textBaseline="middle",d.fillStyle="#fff";for(var f=s[0]/2,p=s[1]/2,c=0;cr[0]-s[0]/2&&(f=s[0]/2,p+=s[1]);return a}}}),yo=g({"node_modules/bit-twiddle/twiddle.js"(t){function r(t){var r=32;return(t&=-t)&&r--,65535&t&&(r-=16),0xff00ff&t&&(r-=8),0xf0f0f0f&t&&(r-=4),0x33333333&t&&(r-=2),0x55555555&t&&(r-=1),r}t.INT_BITS=32,t.INT_MAX=0x7fffffff,t.INT_MIN=-0x80000000,t.sign=function(t){return(t>0)-(t<0)},t.abs=function(t){var r=t>>31;return(t^r)-r},t.min=function(t,r){return r^(t^r)&-(t65535)<<4,t>>>=r,i=(t>255)<<3,t>>>=i,r|=i,i=(t>15)<<2,t>>>=i,r|=i,i=(t>3)<<1,t>>>=i,(r|=i)|t>>1},t.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:+(t>=10)},t.popCount=function(t){return t-=t>>>1&0x55555555,((t=(0x33333333&t)+(t>>>2&0x33333333))+(t>>>4)&0xf0f0f0f)*0x1010101>>>24},t.countTrailingZeros=r,t.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},t.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},t.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=Array(256);(function(t){for(var r=0;r<256;++r){var i=r,n=r,a=7;for(i>>>=1;i;i>>>=1)n<<=1,n|=1&i,--a;t[r]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},t.interleave2=function(t,r){return t&=65535,r&=65535,(t=((t=((t=((t=(t|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(r=((r=((r=((r=(r|r<<8)&0xff00ff)|r<<4)&0xf0f0f0f)|r<<2)&0x33333333)|r<<1)&0x55555555)<<1},t.deinterleave2=function(t,r){return(t=((t=((t=((t=((t=t>>>r&0x55555555)|t>>>1)&0x33333333)|t>>>2)&0xf0f0f0f)|t>>>4)&0xff00ff)|t>>>16)&65535)<<16>>16},t.interleave3=function(t,r,i){return t&=1023,r&=1023,i&=1023,i=((i=((i=((i=(i|i<<16)&0xff0000ff)|i<<8)&0xf00f00f)|i<<4)&0xc30c30c3)|i<<2)&0x49249249,(t=((t=((t=((t=(t|t<<16)&0xff0000ff)|t<<8)&0xf00f00f)|t<<4)&0xc30c30c3)|t<<2)&0x49249249|(r=((r=((r=((r=(r|r<<16)&0xff0000ff)|r<<8)&0xf00f00f)|r<<4)&0xc30c30c3)|r<<2)&0x49249249)<<1)|i<<2},t.deinterleave3=function(t,r){return(t=((t=((t=((t=((t=t>>>r&0x49249249)|t>>>2)&0xc30c30c3)|t>>>4)&0xf00f00f)|t>>>8)&0xff0000ff)|t>>>16)&1023)<<22>>22},t.nextCombination=function(t){var i=t|t-1;return i+1|(~i&-~i)-1>>>r(t)+1}}}),ys=g({"node_modules/dup/dup.js"(t,r){r.exports=function(t,r){switch(typeof r>"u"&&(r=0),typeof t){case"number":if(t>0){var i,n,a=0|t,o=r;for(i=Array(a),n=0;ntypeof Uint8ClampedArray,o="u">typeof BigUint64Array,s="u">typeof BigInt64Array,l=window.__TYPEDARRAY_POOL;l.UINT8C||(l.UINT8C=i([32,0])),l.BIGUINT64||(l.BIGUINT64=i([32,0])),l.BIGINT64||(l.BIGINT64=i([32,0])),l.BUFFER||(l.BUFFER=i([32,0]));var u=l.DATA,c=l.BUFFER;function h(t){if(t){var i=t.length||t.byteLength;u[r.log2(i)].push(t)}}function d(t){var t=r.nextPow2(t),i=u[r.log2(t)];return i.length>0?i.pop():new ArrayBuffer(t)}function f(t){return new Uint8Array(d(t),0,t)}function p(t){return new Uint16Array(d(2*t),0,t)}function m(t){return new Uint32Array(d(4*t),0,t)}function g(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function v(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function b(t){return new Float64Array(d(8*t),0,t)}function _(t){return a?new Uint8ClampedArray(d(t),0,t):f(t)}function w(t){return o?new BigUint64Array(d(8*t),0,t):null}function T(t){return s?new BigInt64Array(d(8*t),0,t):null}function A(t){return new DataView(d(t),0,t)}function M(t){t=r.nextPow2(t);var i=c[r.log2(t)];return i.length>0?i.pop():new n(t)}t.free=function(t){if(n.isBuffer(t))c[r.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var i=t.length||t.byteLength;u[0|r.log2(i)].push(t)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(t){h(t.buffer)},t.freeArrayBuffer=h,t.freeBuffer=function(t){c[r.log2(t.length)].push(t)},t.malloc=function(t,r){if(void 0===r||"arraybuffer"===r)return d(t);switch(r){case"uint8":return f(t);case"uint16":return p(t);case"uint32":return m(t);case"int8":return g(t);case"int16":return y(t);case"int32":return v(t);case"float":case"float32":return x(t);case"double":case"float64":return b(t);case"uint8_clamped":return _(t);case"bigint64":return T(t);case"biguint64":return w(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}},t.mallocArrayBuffer=d,t.mallocUint8=f,t.mallocUint16=p,t.mallocUint32=m,t.mallocInt8=g,t.mallocInt16=y,t.mallocInt32=v,t.mallocFloat32=t.mallocFloat=x,t.mallocFloat64=t.mallocDouble=b,t.mallocUint8Clamped=_,t.mallocBigUint64=w,t.mallocBigInt64=T,t.mallocDataView=A,t.mallocBuffer=M,t.clearCache=function(){for(var t=0;t<32;++t)l.UINT8[t].length=0,l.UINT16[t].length=0,l.UINT32[t].length=0,l.INT8[t].length=0,l.INT16[t].length=0,l.INT32[t].length=0,l.FLOAT[t].length=0,l.DOUBLE[t].length=0,l.BIGUINT64[t].length=0,l.BIGINT64[t].length=0,l.UINT8C[t].length=0,u[t].length=0,c[t].length=0}}}),yu=g({"node_modules/is-plain-obj/index.js"(t,r){var i=Object.prototype.toString;r.exports=function(t){var r;return"[object Object]"===i.call(t)&&(null===(r=Object.getPrototypeOf(t))||r===Object.getPrototypeOf({}))}}}),yc=g({"node_modules/parse-unit/index.js"(t,r){r.exports=function(t,r){r||(r=[0,""]);var i=parseFloat(t=String(t),10);return r[0]=i,r[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",r}}}),yh=g({"node_modules/gl-text/node_modules/to-px/topx.js"(t,r){var i=yc();function n(t,r){var n=i(getComputedStyle(t).getPropertyValue(r));return n[0]*a(n[1],t)}function a(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":var i,a,o,s;return i=t,a=r,(o=document.createElement("div")).style["font-size"]="128"+i,a.appendChild(o),s=n(o,"font-size")/128,a.removeChild(o),s;case"em":return n(r,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}r.exports=a}}),yd=g({"node_modules/detect-kerning/index.js"(t,r){r.exports=a;var i=(a.canvas=document.createElement("canvas")).getContext("2d"),n=o([32,126]);function a(t,r){Array.isArray(t)&&(t=t.join(", "));var a,s={},l=16,u=.05;r&&(2===r.length&&"number"==typeof r[0]?a=o(r):Array.isArray(r)?a=r:(r.o?a=o(r.o):r.pairs&&(a=r.pairs),r.fontSize&&(l=r.fontSize),null!=r.threshold&&(u=r.threshold))),a||(a=n),i.font=l+"px "+t;for(var c=0;cl*u){var p=(f-d)/l;s[h]=1e3*p}}return s}function o(t){for(var r=[],i=t[0];i<=t[1];i++)for(var n=String.fromCharCode(i),a=t[0];a0;n-=4)if(0!==i[n])return Math.floor((n-3)*.25/r)}r.exports=i,i.canvas=document.createElement("canvas"),i.cache={}}}),yp=g({"node_modules/gl-text/dist.js"(t,r){var i=yr(),n=p7(),a=yi(),o=yn(),s=gX(),l=mL(),u=ya(),c=yl(),h=p9(),d=yu(),f=yc(),p=yh(),m=yd(),g=mB(),y=yf(),v=mi(),x=yo().nextPow2,b=new s,_=!1;document.body&&((w=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(w).fontStretch&&(_=!0),document.body.removeChild(w));var w,T=function(t){var r;"function"==typeof(r=t)&&r._gl&&r.prop&&r.texture&&r.buffer?(t={regl:t},this.gl=t.regl._gl):this.gl=o(t),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),b.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(d(t)?t:{})};T.prototype.createShader=function(){var t=this.regl,r=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,r){return[r.atlas.width,r.atlas.height]},atlasDim:function(t,r){return[r.atlas.cols,r.atlas.rows]},atlas:function(t,r){return r.atlas.texture},charStep:function(t,r){return r.atlas.step},em:function(t,r){return r.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:` - precision highp float; - attribute float width, charOffset, char; - attribute vec2 position; - uniform float fontSize, charStep, em, align, baseline; - uniform vec4 viewport; - uniform vec4 color; - uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; - varying vec2 charCoord, charId; - varying float charWidth; - varying vec4 fontColor; - void main () { - vec2 offset = floor(em * (vec2(align + charOffset, baseline) - + vec2(positionOffset.x, -positionOffset.y))) - / (viewport.zw * scale.xy); - - vec2 position = (position + translate) * scale; - position += offset * scale; - - charCoord = position * viewport.zw + viewport.xy; - - gl_Position = vec4(position * 2. - 1., 0, 1); - - gl_PointSize = charStep; - - charId.x = mod(char, atlasDim.x); - charId.y = floor(char / atlasDim.x); - - charWidth = width * em; - - fontColor = color / 255.; - }`,frag:` - precision highp float; - uniform float fontSize, charStep, opacity; - uniform vec2 atlasSize; - uniform vec4 viewport; - uniform sampler2D atlas; - varying vec4 fontColor; - varying vec2 charCoord, charId; - varying float charWidth; - - float lightness(vec4 color) { - return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; - } - - void main () { - vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; - float halfCharStep = floor(charStep * .5 + .5); - - // invert y and shift by 1px (FF expecially needs that) - uv.y = charStep - uv.y; - - // ignore points outside of character bounding box - float halfCharWidth = ceil(charWidth * .5); - if (floor(uv.x) > halfCharStep + halfCharWidth || - floor(uv.x) < halfCharStep - halfCharWidth) return; - - uv += charId * charStep; - uv = uv / atlasSize; - - vec4 color = fontColor; - vec4 mask = texture2D(atlas, uv); - - float maskY = lightness(mask); - // float colorY = lightness(color); - color.a *= maskY; - color.a *= opacity; - - // color.a += .1; - - // antialiasing, see yiq color space y-channel formula - // color.rgb += (1. - color.rgb) * (1. - mask.rgb); - - gl_FragColor = color; - }`});return{regl:t,draw:r,atlas:{}}},T.prototype.update=function(t){var r,a,o=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=n(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map(function(t){return parseFloat(t)}):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=h(t.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=v(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=T.baseFontSize+"px sans-serif");var s=!1,d=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach(function(t,r){if("string"==typeof t)try{t=i.parse(t)}catch{t=i.parse(T.baseFontSize+"px "+t)}else{var n=t.style,a=t.weight,l=t.stretch,u=t.variant;t=i.parse(i.stringify(t)),n&&(t.style=n),a&&(t.weight=a),l&&(t.stretch=l),u&&(t.variant=u)}var c=i.stringify({size:T.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),h=f(t.size),m=Math.round(h[0]*p(h[1]));if(m!==o.fontSize[r]&&(d=!0,o.fontSize[r]=m),(!o.font[r]||c!=o.font[r].baseString)&&(s=!0,o.font[r]=T.fonts[c],!o.font[r])){var g=t.family.join(", "),v=[t.style];t.style!=t.variant&&v.push(t.variant),t.variant!=t.weight&&v.push(t.weight),_&&t.weight!=t.stretch&&v.push(t.stretch),o.font[r]={baseString:c,family:g,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:y(g,{origin:"top",fontSize:T.baseFontSize,fontStyle:v.join(" ")})},T.fonts[c]=o.font[r]}}),(s||d)&&this.font.forEach(function(r,n){var a=i.stringify({size:o.fontSize[n],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(o.fontAtlas[n]=o.shader.atlas[a],!o.fontAtlas[n]){var s=r.metrics;o.shader.atlas[a]=o.fontAtlas[n]={fontString:a,step:2*Math.ceil(o.fontSize[n]*s.bottom*.5),em:o.fontSize[n],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:o.regl.texture()}}null==t.text&&(t.text=o.text)}),"string"==typeof t.text&&t.position&&t.position.length>2){for(var b=Array(.5*t.position.length),w=0;w2){for(var M=!t.position[0].length,k=c.mallocFloat(2*this.count),S=0,E=0;S1?o.align[r]:o.align[0]:o.align;if("number"==typeof i)return i;switch(i){case"right":case"end":return-t;case"center":case"centre":case"middle":return-(.5*t)}return 0})),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(t,r){var i,n=(o.font[r]||o.font[0]).metrics;return i=0+.5*n.bottom,"number"==typeof t?i+=t-n.baseline:i+=-n[t],i*=-1})),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var $=t.color.length;a=c.mallocUint8($);for(var W=(t.color.subarray||t.color.slice).bind(t.color),Y=0;Y<$;Y+=4)a.set(l(W(Y,Y+4),"uint8"),Y)}else{var Z=t.color.length;a=c.mallocUint8(4*Z);for(var X=0;X4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var K=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(K);for(var J=0;J1?this.counts[J]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[J]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*J,4*J+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[J]:this.opacity,baseline:null!=this.baselineOffset[J]?this.baselineOffset[J]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[J]?this.alignOffset[J]:this.alignOffset[0]:0,atlas:this.fontAtlas[J]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*J,2*J+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},T.prototype.destroy=function(){},T.prototype.kerning=!0,T.prototype.position={constant:new Float32Array(2)},T.prototype.translate=null,T.prototype.scale=null,T.prototype.font=null,T.prototype.text="",T.prototype.positionOffset=[0,0],T.prototype.opacity=1,T.prototype.color=new Uint8Array([0,0,0,255]),T.prototype.alignOffset=[0,0],T.maxAtlasSize=1024,T.atlasCanvas=document.createElement("canvas"),T.atlasContext=T.atlasCanvas.getContext("2d",{alpha:!1}),T.baseFontSize=64,T.fonts={},r.exports=T}}),ym=g({"src/lib/prepare_regl.js"(t,r){var i=fM(),n=yi();r.exports=function(t,r,a){var o=t._fullLayout,s=!0;return o._glcanvas.each(function(i){if(i.regl)return void i.regl.preloadCachedCode(a);if(!(i.pick&&!o._has("parcoords"))){try{i.regl=n({canvas:this,attributes:{antialias:!i.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||window.devicePixelRatio,extensions:r||[],cachedCode:a||{}})}catch{s=!1}i.regl||(s=!1),s&&this.addEventListener("webglcontextlost",function(r){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:r,layer:i.key})},!1)}}),s||i({container:o._glcontainer.node()}),s}}}),yg=g({"src/traces/scattergl/plot.js"(t,r){var i=mR(),n=gJ(),a=gQ(),o=yp(),s=t_(),l=rB().selectMode,u=ym(),c=t8(),h=nt(),d=mk().styleTextSelection,f={},t=r.exports=function(t,r,p){if(p.length){var m,g,y=t._fullLayout,v=r._scene,x=r.xaxis,b=r.yaxis;if(v){if(!u(t,["ANGLE_instanced_arrays","OES_element_index_uint"],f))return void v.init();var _,w,T,A,M,k,S,E,D,C,I=v.count,L=y._glcanvas.data()[0].regl;if(h(t,r,p),v.dirty){if((v.line2d||v.error2d)&&!(v.scatter2d||v.fill2d||v.glText)&&L.clear({color:!0,depth:!0}),!0===v.error2d&&(v.error2d=a(L)),!0===v.line2d&&(v.line2d=n(L)),!0===v.scatter2d&&(v.scatter2d=i(L)),!0===v.fill2d&&(v.fill2d=n(L)),!0===v.glText)for(v.glText=Array(I),m=0;mv.glText.length){var P=I-v.glText.length;for(m=0;mi&&(isNaN(r[n])||isNaN(r[n+1]));)n-=2;t.positions=r.slice(i,n+2)}return t}),v.line2d.update(v.lineOptions)),v.error2d){var F=(v.errorXOptions||[]).concat(v.errorYOptions||[]).map(function(t){return t||{positions:[],errors:[]}});v.error2d.update(F)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=s.repeat(null,I),v.fill2d&&(v.fillOptions=v.fillOptions.map(function(t,r){var i=p[r];if(!(!t||!i||!i[0]||!i[0].trace)){var n,a,o=i[0],s=o.trace,l=o.t,u=v.lineOptions[r],c=[];s._ownfill&&c.push(r),s._nexttrace&&c.push(r+1),c.length&&(v.fillOrder[r]=c);var h,d,f=[],m=u&&u.positions||l.positions;if("tozeroy"===s.fill){for(h=0;hh&&isNaN(m[d+1]);)d-=2;0!==m[h+1]&&(f=[m[h],0]),f=f.concat(m.slice(h,d+2)),0!==m[d+1]&&(f=f.concat([m[d],0]))}else if("tozerox"===s.fill){for(h=0;hh&&isNaN(m[d]);)d-=2;0!==m[h]&&(f=[0,m[h+1]]),f=f.concat(m.slice(h,d+2)),0!==m[d]&&(f=f.concat([0,m[d+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(f=[],n=0,t.splitNull=!0,a=0;a-1;for(let[t]of p)if(t){var B=t.trace,j=t.t,N=j.index,V=B._length,U=j.x,q=j.y;if(B.selectedpoints||O||R){if(O||(O=!0),B.selectedpoints){var G=v.selectBatch[N]=B.selectedpoints,H={};for(g=0;ga&&l||nd?_.sizeAvg||Math.max(_.size,3):a(r,b),m=0;mtypeof performance&&null!==performance&&performance.now?r.exports=function(){return performance.now()}:"u">typeof E&&null!==E&&E.hrtime?(r.exports=function(){return(t()-a)/1e6},i=E.hrtime,a=(t=function(){var t;return 1e9*(t=i())[0]+t[1]})()-1e9*E.uptime()):Date.now?(r.exports=function(){return Date.now()-n},n=Date.now()):(r.exports=function(){return new Date().getTime()-n},n=new Date().getTime())}).call(t)}}),yM=g({"node_modules/raf/index.js"(t,r){var i,n,a,o,s,l=yA(),u=window,c=["moz","webkit"],h="AnimationFrame",d=u["request"+h],f=u["cancel"+h]||u["cancelRequest"+h];for(i=0;!d&&i2?(l[0],l[2],n=l[1],a=l[3]):l.length?(n=l[0],a=l[1]):(l.x,n=l.y,l.x+l.width,a=l.y+l.height),u.length>2?(o=u[0],s=u[2],u[1],u[3]):u.length?(o=u[0],s=u[1]):(o=u.x,u.y,s=u.x+u.width,u.y+u.height),[o,n,s,a]}function d(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];{let r=l(t);return[r.x,r.y,r.x+r.width,r.y+r.height]}}r.exports=c,c.prototype.render=function(...t){return t.length&&this.update(...t),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,o(()=>{this.dirty=!1})),this)},c.prototype.update=function(...t){if(!t.length)return;for(let r=0;rr||!c.lower&&t{r[o+i]=n})}this.scatter.draw(...r)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach(t=>{t.buffer&&t.buffer.destroy&&t.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this}}}),yE=g({"src/traces/splom/plot.js"(t,r){var i=yS(),n=t_(),a=tL(),o=rB().selectMode;r.exports=function(t,r,s){if(s.length)for(var l=0;l-1,C=o(b)||!!p.selectedpoints||D,I=!0;if(C){var L=p._length;if(p.selectedpoints){g.selectBatch=p.selectedpoints;var P=p.selectedpoints,z={};for(u=0;u=r[i][0]&&t<=r[i][1])return!0;return!1}(i,n))return i;var a=t?-1:1,o=0,s=r.length-1;if(a<0){var l=o;o=s,s=l}for(var h=r[o],d=h,f=o;a*fr){p=n;break}}if(isNaN(s=d)&&(s=isNaN(f)||isNaN(p)?isNaN(f)?p:f:r-h[f][1]t[1]+n||r=.9*t[1]+.1*t[0]?"n":r<=.9*t[0]+.1*t[1]?"s":"ns"}(y,r);v&&(l.interval=c[s],l.intervalPix=y,l.region=v)}}if(t.ordinal&&!l.region){var x=t.unitTickvals,b=t.unitToPaddedPx.invert(r);for(n=0;n=_[0]&&b<=_[1]){l.clickableOrdinalRange=_;break}}}return l}function b(t,r){n.event.sourceEvent.stopPropagation();var a=r.height-n.mouse(t)[1]-2*i.verticalPadding,o=r.brush.svgBrush;o.wasDragged=!0,o._dragging=!0,o.grabbingBar?o.newExtent=[a-o.grabPoint,a+o.barLength-o.grabPoint].map(r.unitToPaddedPx.invert):o.newExtent=[o.startExtent,r.unitToPaddedPx.invert(a)].sort(s),r.brush.filterSpecified=!0,o.extent=o.stayingIntervals.concat([o.newExtent]),o.brushCallback(r),v(t.parentNode)}function _(t,r){var a=r.height-n.mouse(t)[1]-2*i.verticalPadding,o=x(r,a),s="crosshair";o.clickableOrdinalRange?s="pointer":o.region&&(s=o.region+"-resize"),n.select(document.body).style("cursor",s)}function w(t){t.on("mousemove",function(t){n.event.preventDefault(),t.parent.inBrushDrag||_(this,t)}).on("mouseleave",function(t){t.parent.inBrushDrag||g()}).call(n.behavior.drag().on("dragstart",function(t){!function(t,r){n.event.sourceEvent.stopPropagation();var a=r.height-n.mouse(t)[1]-2*i.verticalPadding,o=r.unitToPaddedPx.invert(a),s=r.brush,l=x(r,a),u=l.interval,c=s.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===l.region,c.grabbingBar){var h=u.map(r.unitToPaddedPx);c.grabPoint=a-h[0]-i.verticalPadding,c.barLength=h[1]-h[0]}c.clickableOrdinalRange=l.clickableOrdinalRange,c.stayingIntervals=r.multiselect&&s.filterSpecified?s.filter.getConsolidated():[],u&&(c.stayingIntervals=c.stayingIntervals.filter(function(t){return t[0]!==u[0]&&t[1]!==u[1]})),c.startExtent=l.region?u[+("s"===l.region)]:o,r.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)}).on("drag",function(t){b(this,t)}).on("dragend",function(t){!function(t,r){var i=r.brush,a=i.filter,o=i.svgBrush;o._dragging||(_(t,r),b(t,r),r.brush.svgBrush.wasDragged=!1),o._dragging=!1,n.event.sourceEvent.stopPropagation();var s=o.grabbingBar;if(o.grabbingBar=!1,o.grabLocation=void 0,r.parent.inBrushDrag=!1,g(),!o.wasDragged){o.wasDragged=void 0,o.clickableOrdinalRange?i.filterSpecified&&r.multiselect?o.extent.push(o.clickableOrdinalRange):(o.extent=[o.clickableOrdinalRange],i.filterSpecified=!0):s?(o.extent=o.stayingIntervals,0===o.extent.length&&A(i)):A(i),o.brushCallback(r),v(t.parentNode),o.brushEndCallback(i.filterSpecified?a.getConsolidated():[]);return}var l=function(){a.set(a.getConsolidated())};if(r.ordinal){var u=r.unitTickvals;u[u.length-1]o.newExtent[0];o.extent=o.stayingIntervals.concat(c?[o.newExtent]:[]),o.extent.length||A(i),o.brushCallback(r),c?v(t.parentNode,l):(l(),v(t.parentNode))}else l();o.brushEndCallback(i.filterSpecified?a.getConsolidated():[])}(this,t)}))}function T(t,r){return t[0]-r[0]}function A(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function M(t){for(var r,i=t.slice(),n=[],a=i.shift();a;){for(r=a.slice();(a=i.shift())&&a[0]<=r[1];)r[1]=Math.max(r[1],a[1]);n.push(r)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}r.exports={makeBrush:function(t,r,i,n,a,o){var l,u,c,h=(c=[],{set:function(t){1===(c=t.map(function(t){return t.slice().sort(s)}).sort(T)).length&&c[0][0]===-1/0&&c[0][1]===1/0&&(c=[[0,-1]]),l=M(c),u=c.reduce(function(t,r){return[Math.min(t[0],r[0]),Math.max(t[1],r[1])]},[1/0,-1/0])},get:function(){return c.slice()},getConsolidated:function(){return l},getBounds:function(){return u}});return h.set(i),{filter:h,filterSpecified:r,svgBrush:{extent:[],brushStartCallback:n,brushCallback:function(t){var r=t.brush,i=r.svgBrush.extent.map(function(t){return t.slice()}).slice();r.filter.set(i),a()},brushEndCallback:o}}},ensureAxisBrush:function(t,r,n){var s,u,c,h,p=t.selectAll("."+i.cn.axisBrush).data(o,a);p.enter().append("g").classed(i.cn.axisBrush,!0),s=n._context.staticPlot,(u=p.selectAll(".background").data(o)).enter().append("rect").classed("background",!0).call(d).call(f).style("pointer-events",s?"none":"auto").attr("transform",l(0,i.verticalPadding)),u.call(w).attr("height",function(t){return t.height-i.verticalPadding}),(c=p.selectAll(".highlight-shadow").data(o)).enter().append("line").classed("highlight-shadow",!0).attr("x",-i.bar.width/2).attr("stroke-width",i.bar.width+i.bar.strokeWidth).attr("stroke",r).attr("opacity",i.bar.strokeOpacity).attr("stroke-linecap","butt"),c.attr("y1",function(t){return t.height}).call(y),(h=p.selectAll(".highlight").data(o)).enter().append("line").classed("highlight",!0).attr("x",-i.bar.width/2).attr("stroke-width",i.bar.width-i.bar.strokeWidth).attr("stroke",i.bar.fillColor).attr("opacity",i.bar.fillOpacity).attr("stroke-linecap","butt"),h.attr("y1",function(t){return t.height}).call(y)},cleanRanges:function(t,r){if(Array.isArray(t[0])?(t=t.map(function(t){return t.sort(s)}),t=r.multiselect?M(t.sort(T)):[t[0]]):t=[t.sort(s)],r.tickvals){var i=r.tickvals.slice().sort(s);if(!(t=t.map(function(t){var r=[h(0,i,t[0],[]),h(1,i,t[1],[])];if(r[1]>r[0])return r}).filter(function(t){return t})).length)return}return t.length>1?t:t[0]}}}}),yV=g({"src/traces/parcoords/defaults.js"(t,r){var i=t_(),n=tV().hasColorscale,a=t2(),o=an().defaults,s=tJ(),l=rs(),u=yR(),c=yN(),h=yB().maxDimensionCount,d=yb();function f(t,r,n,a){function o(n,a){return i.coerce(t,r,u.dimensions,n,a)}var s=o("values"),h=o("visible");if(s&&s.length||(h=r.visible=!1),h){o("label"),o("tickvals"),o("ticktext"),o("tickformat"),r._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:o("range")},l.setConvert(r._ax,a.layout),o("multiselect");var d=o("constraintrange");d&&(r.constraintrange=c.cleanRanges(d,r))}}r.exports=function(t,r,l,c){function p(n,a){return i.coerce(t,r,u,n,a)}var m=t.dimensions;Array.isArray(m)&&m.length>h&&(i.log("parcoords traces support up to "+h+" dimensions at the moment"),m.splice(h));var g=s(t,r,{name:"dimensions",layout:c,handleItemDefaults:f}),y=function(t,r,o,s,l){var u=l("line.color",o);if(n(t,"line")&&i.isArrayOrTypedArray(u)){if(u.length)return l("line.colorscale"),a(t,r,s,l,{prefix:"line.",cLetter:"c"}),u.length;r.line.color=o}return 1/0}(t,r,l,c,p);o(r,c,p),Array.isArray(g)&&g.length||(r.visible=!1),d(r,g,"values",y);var v=i.extendFlat({},c.font,{size:Math.round(c.font.size/1.2)});i.coerceFont(p,"labelfont",v),i.coerceFont(p,"tickfont",v,{autoShadowDflt:!0}),i.coerceFont(p,"rangefont",v),p("labelangle"),p("labelside"),p("unselected.line.color"),p("unselected.line.opacity")}}}),yU=g({"src/traces/parcoords/calc.js"(t,r){var i=t_().isArrayOrTypedArray,n=t6(),a=yj().wrap;r.exports=function(t,r){var o,s;return n.hasColorscale(r,"line")&&i(r.line.color)?(o=r.line.color,s=n.extractOpts(r.line).colorscale,n.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=function(t){for(var r=Array(t),i=0;i 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` -`),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` -`),a=yB().maxDimensionCount,o=t_(),s=new Uint8Array(4),l=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function c(t,r,i,n,a){var o=t._gl;o.enable(o.SCISSOR_TEST),o.scissor(r,i,n,a),t.clear({color:[0,0,0,0],depth:1})}function h(t,r){return(t>>>8*r)%256/255}function d(t){return("0"+t).slice(-2)}function f(t){return tf&&(f=t[n].dim1.canvasX,l=n);0===u&&c(b,0,0,d.canvasWidth,d.canvasHeight);var _=function(t){var r,i,n,a=[[],[]];for(n=0;n<64;n++){var o=!t&&nl._length&&(P=P.slice(0,l._length));var z,F=l.tickvals;function O(t,r){return{val:t,text:z[r]}}function R(t,r){return t.val-r.val}if(a(F)&&F.length){n.isTypedArray(F)&&(F=Array.from(F)),a(z=l.ticktext)&&z.length?z.length>F.length?z=z.slice(0,F.length):F.length>z.length&&(F=F.slice(0,z.length)):z=F.map(o(l.tickformat));for(var B=1;B=n)&&!(u>=a)){var c=t.lineLayer.readPixel(l,a-1-u),h=0!==c[3],d=h?c[2]+256*(c[1]+256*c[0]):null,f={x:l,y:u,clientX:r.clientX,clientY:r.clientY,dataIndex:t.model.key,curveNumber:d};d!==N&&(h?o.hover(f):o.unhover&&o.unhover(f),N=d)}}}),j.style("opacity",function(t){return+!t.pick}),A.style("background","rgba(255, 255, 255, 0)");var V=A.selectAll("."+x.cn.parcoords).data(B,m);V.exit().remove(),V.enter().append("g").classed(x.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),V.attr("transform",function(t){return c(t.model.translateX,t.model.translateY)});var U=V.selectAll("."+x.cn.parcoordsControlView).data(g,m);U.enter().append("g").classed(x.cn.parcoordsControlView,!0),U.attr("transform",function(t){return c(t.model.pad.l,t.model.pad.t)});var q=U.selectAll("."+x.cn.yAxis).data(function(t){return t.dimensions},m);q.enter().append("g").classed(x.cn.yAxis,!0),U.each(function(t){L(q,t,F)}),j.each(function(t){if(t.viewModel){!t.lineLayer||o?t.lineLayer=_(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var r=!t.context||o;t.lineLayer.render(t.viewModel.panels,r)}}),q.attr("transform",function(t){return c(t.xScale(t.xIndex),0)}),q.call(i.behavior.drag().origin(function(t){return t}).on("drag",function(t){var r=t.parent;R.linePickActive(!1),t.x=Math.max(-x.overdrag,Math.min(t.model.width+x.overdrag,i.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,q.sort(function(t,r){return t.x-r.x}).each(function(r,i){r.xIndex=i,r.x=t===r?r.x:r.xScale(r.xIndex),r.canvasX=r.x*r.model.canvasPixelRatio}),L(q,r,F),q.filter(function(r){return 0!==Math.abs(t.xIndex-r.xIndex)}).attr("transform",function(t){return c(t.xScale(t.xIndex),0)}),i.select(this).attr("transform",c(t.x,0)),q.each(function(i,n,a){a===t.parent.key&&(r.dimensions[n]=i)}),r.contextLayer&&r.contextLayer.render(r.panels,!1,!S(r)),r.focusLayer.render&&r.focusLayer.render(r.panels)}).on("dragend",function(t){var r=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,L(q,r,F),i.select(this).attr("transform",function(t){return c(t.x,0)}),r.contextLayer&&r.contextLayer.render(r.panels,!1,!S(r)),r.focusLayer&&r.focusLayer.render(r.panels),r.pickLayer&&r.pickLayer.render(r.panels,!0),R.linePickActive(!0),o&&o.axesMoved&&o.axesMoved(r.key,r.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),q.exit().remove();var G=q.selectAll("."+x.cn.axisOverlays).data(g,m);G.enter().append("g").classed(x.cn.axisOverlays,!0),G.selectAll("."+x.cn.axis).remove();var H=G.selectAll("."+x.cn.axis).data(g,m);H.enter().append("g").classed(x.cn.axis,!0),H.each(function(t){var r=t.model.height/t.model.tickDistance,n=t.domainScale,a=n.domain();i.select(this).call(i.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(r,t.tickFormat).tickValues(t.ordinal?a:null).tickFormat(function(r){return v.isOrdinal(t)?r:P(t.model.dimensions[t.visibleIndex],r)}).scale(n)),d.font(H.selectAll("text"),t.model.tickFont)}),H.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),H.selectAll("text").style("cursor","default");var $=G.selectAll("."+x.cn.axisHeading).data(g,m);$.enter().append("g").classed(x.cn.axisHeading,!0);var W=$.selectAll("."+x.cn.axisTitle).data(g,m);W.enter().append("text").classed(x.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",p?"none":"auto"),W.text(function(t){return t.label}).each(function(r){var n=i.select(this);d.font(n,r.model.labelFont),h.convertToTspans(n,t)}).attr("transform",function(t){var r=I(t.model.labelAngle,t.model.labelSide),i=x.axisTitleOffset;return(r.dir>0?"":c(0,2*i+t.model.height))+u(r.degrees)+c(-i*r.dx,-i*r.dy)}).attr("text-anchor",function(t){var r=I(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(r.dx)>Math.abs(r.dy)?r.dir*r.dx<0?"start":"end":"middle"});var Y=G.selectAll("."+x.cn.axisExtent).data(g,m);Y.enter().append("g").classed(x.cn.axisExtent,!0);var Z=Y.selectAll("."+x.cn.axisExtentTop).data(g,m);Z.enter().append("g").classed(x.cn.axisExtentTop,!0),Z.attr("transform",c(0,-x.axisExtentOffset));var X=Z.selectAll("."+x.cn.axisExtentTopText).data(g,m);X.enter().append("text").classed(x.cn.axisExtentTopText,!0).call(C),X.text(function(t){return z(t,!0)}).each(function(t){d.font(i.select(this),t.model.rangeFont)});var K=Y.selectAll("."+x.cn.axisExtentBottom).data(g,m);K.enter().append("g").classed(x.cn.axisExtentBottom,!0),K.attr("transform",function(t){return c(0,t.model.height+x.axisExtentOffset)});var J=K.selectAll("."+x.cn.axisExtentBottomText).data(g,m);J.enter().append("text").classed(x.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(C),J.text(function(t){return z(t,!1)}).each(function(t){d.font(i.select(this),t.model.rangeFont)}),b.ensureAxisBrush(G,O,t)}}}),y$=g({"src/traces/parcoords/plot.js"(t,r){var i=yH(),n=ym(),a=yq().isVisible,o={};function s(t,r,i){var n=r.indexOf(i),a=t.indexOf(n);return -1===a&&(a+=r.length),a}var t=r.exports=function(t,r){var l=t._fullLayout;if(n(t,[],o)){var u={},c={},h={},d=l._size;r.forEach(function(r,i){var n=r[0].trace,a=h[i]=n.index;u[i]=t.data[a].dimensions,c[i]=t.data[a].dimensions.slice()}),i(t,r,{width:d.w,height:d.h,margin:{t:d.t,r:d.r,b:d.b,l:d.l}},{filterChanged:function(r,i,n){var a=c[r][i],o=n.map(function(t){return t.slice()}),s="dimensions["+i+"].constraintrange",u=l._tracePreGUI[t._fullData[h[r]].uid];if(void 0===u[s]){var d=a.constraintrange;u[s]=d||null}var f=t._fullData[h[r]].dimensions[i];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,f.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete f.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[h[r]]])},hover:function(r){t.emit("plotly_hover",r)},unhover:function(r){t.emit("plotly_unhover",r)},axesMoved:function(r,i){var n,o=(n=c[r].filter(a),function(t,r){return s(i,n,t)-s(i,n,r)});u[r].sort(o),c[r].filter(function(t){return!a(t)}).sort(function(t){return c[r].indexOf(t)}).forEach(function(t){u[r].splice(u[r].indexOf(t),1),u[r].splice(c[r].indexOf(t),0,t)}),t.emit("plotly_restyle",[{dimensions:[u[r]]},[h[r]]])}})}};t.reglPrecompiled=o}}),yW=g({"src/traces/parcoords/base_plot.js"(t){var r=k(),i=tF().getModuleCalcData,n=y$(),a=tB();t.name="parcoords",t.plot=function(t){var r=i(t.calcdata,"parcoords")[0];r.length&&n(t,r)},t.clean=function(t,r,i,n){var a=n._has&&n._has("parcoords"),o=r._has&&r._has("parcoords");a&&!o&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},t.toSVG=function(t){var i=t._fullLayout._glimages,n=r.select(t).selectAll(".svg-container");n.filter(function(t,r){return r===n.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this.toDataURL("image/png");i.append("svg:image").attr({xmlns:a.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})}),window.setTimeout(function(){r.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),yY=g({"src/traces/parcoords/base_index.js"(t,r){r.exports={attributes:yR(),supplyDefaults:yV(),calc:yU(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:yW(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),yZ=g({"src/traces/parcoords/index.js"(t,r){var i=yY();i.plot=y$(),r.exports=i}}),yX=g({"lib/parcoords.js"(t,r){r.exports=yZ()}}),yK=g({"src/traces/parcats/attributes.js"(t,r){var i=$().extendFlat,n=K(),a=W(),o=tH(),{hovertemplateAttrs:s,templatefallbackAttrs:l}=eZ(),u=an().attributes,c=i({editType:"calc"},o("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:l({editType:"plot"})});r.exports={domain:u({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:i({},n.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:s({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:l({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:a({editType:"calc"}),tickfont:a({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:c,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),yJ=g({"src/traces/parcats/defaults.js"(t,r){var i=t_(),n=tV().hasColorscale,a=t2(),o=an().defaults,s=tJ(),l=yK(),u=yb(),c=O().isTypedArraySpec;function h(t,r){function n(n,a){return i.coerce(t,r,l.dimensions,n,a)}var a=n("values"),o=n("visible");if(a&&a.length||(o=r.visible=!1),o){n("label"),n("displayindex",r._index);var s,u=t.categoryarray,h=i.isArrayOrTypedArray(u)&&u.length>0||c(u);h&&(s="array");var d=n("categoryorder",s);"array"===d?(n("categoryarray"),n("ticktext")):(delete t.categoryarray,delete t.ticktext),h||"array"!==d||(r.categoryorder="trace")}}r.exports=function(t,r,c,d){function f(n,a){return i.coerce(t,r,l,n,a)}var p=s(t,r,{name:"dimensions",handleItemDefaults:h}),m=function(t,r,o,s,l){l("line.shape"),l("line.hovertemplate"),l("line.hovertemplatefallback");var u=l("line.color",s.colorway[0]);if(n(t,"line")&&i.isArrayOrTypedArray(u)){if(u.length)return l("line.colorscale"),a(t,r,s,l,{prefix:"line.",cLetter:"c"}),u.length;r.line.color=o}return 1/0}(t,r,c,d,f);o(r,d,f),Array.isArray(p)&&p.length||(r.visible=!1),u(r,p,"values",m),f("hoveron"),f("hovertemplate"),f("hovertemplatefallback"),f("arrangement"),f("bundlecolors"),f("sortpaths"),f("counts");var g=d.font;i.coerceFont(f,"labelfont",g,{overrideDflt:{size:Math.round(g.size)}}),i.coerceFont(f,"tickfont",g,{autoShadowDflt:!0,overrideDflt:{size:Math.round(g.size/1.2)}})}}}),yQ=g({"src/traces/parcats/calc.js"(t,r){var i=yj().wrap,n=tV().hasColorscale,a=t4(),o=tc(),s=rr(),l=t_(),u=L();r.exports=function(t,r){var c,h,d,f,p,m,g=l.filterVisible(r.dimensions);if(0===g.length)return[];var y,v,x,b=g.map(function(t){var r;if("trace"===t.categoryorder)r=null;else if("array"===t.categoryorder)r=t.categoryarray;else{r=o(t.values);for(var i=!0,n=0;n=t.length||void 0!==r[t[i]])return!1;r[t[i]]=!0}return!0}(t.map(function(t){return t.displayindex})))for(r=0;rr.model.rawColor?1:t.model.rawColor"),C=i.mouse(d)[0];s.loneHover({trace:f,x:_-m.left+g.left,y:T-m.top+g.top,text:D,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:A,idealAlign:C<_?"right":"left",hovertemplate:(f.line||{}).hovertemplate,hovertemplateLabels:S,eventData:[{data:f._input,fullData:f,count:M,probability:k}]},{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:d})}}}function g(t){if(!t.parcatsViewModel.dragDimension&&(_(i.select(this)),s.loneUnhover(t.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),t.parcatsViewModel.pathSelection.sort(p),-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var r=y(t),n=v(t);t.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:r,event:i.event,constraints:n})}}function y(t){for(var r=[],i=F(t.parcatsViewModel),n=0;no.mostReadable(t.model.color)).attr("stroke-width",.3)}function T(t){t.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function A(t){t.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function M(t){var r=t.parcatsViewModel.pathSelection,i=t.categoryViewModel.model.dimensionInd,n=t.categoryViewModel.model.categoryInd;return r.filter(function(r){return r.model.categoryInds[i]===n&&r.model.color===t.color})}function S(t,r,n){var a=i.select(t).datum(),o=a.categoryViewModel.model,s=a.parcatsViewModel.graphDiv,l=i.select(t.parentNode).selectAll("rect.bandrect"),u=[];l.each(function(t){M(t).each(function(t){Array.prototype.push.apply(u,y(t))})});var c={};c[o.dimensionInd]=o.categoryValue,s.emit(r,{points:u,event:n,constraints:c})}function E(t,r,n){var a=i.select(t).datum(),o=a.categoryViewModel.model,s=a.parcatsViewModel.graphDiv,l=M(a),u=[];l.each(function(t){Array.prototype.push.apply(u,y(t))});var c={};c[o.dimensionInd]=o.categoryValue,void 0!==a.rawColor&&(c.color=a.rawColor),s.emit(r,{points:u,event:n,constraints:c})}function D(t,r,n){t._fullLayout._calcInverseTransform(t);var a,o,s=t._fullLayout._invScaleX,l=t._fullLayout._invScaleY,u=i.select(n.parentNode).select("rect.catrect"),c=u.node().getBoundingClientRect(),h=u.datum(),d=h.parcatsViewModel,f=d.model.dimensions[h.model.dimensionInd],p=d.trace,m=c.top+c.height/2;d.dimensions.length>1&&f.displayInd===d.dimensions.length-1?(a=c.left,o="left"):(a=c.left+c.width,o="right");var g=h.model.count,y=h.model.categoryLabel,v=g/h.parcatsViewModel.model.count,x={countLabel:g,categoryLabel:y,probabilityLabel:v.toFixed(3)},b=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&b.push(["Count:",x.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&b.push(["P("+x.categoryLabel+"):",x.probabilityLabel].join(" "));var _=b.join("
");return{trace:p,x:s*(a-r.left),y:l*(m-r.top),text:_,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:o,hovertemplate:p.hovertemplate,hovertemplateLabels:x,eventData:[{data:p._input,fullData:p,count:g,category:y,probability:v}]}}function C(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){var r;if(!(i.mouse(this)[1]<-1)){var n,a,u,c,h,d,f,p,m,g,y,v,x,b,_,T,A,k,C,I,L,P,z,F,O,R,B,j=t.parcatsViewModel.graphDiv,N=j._fullLayout,V=N._paperdiv.node().getBoundingClientRect(),U=t.parcatsViewModel.hoveron;("color"===U?(w(u=M(a=i.select(this).datum())),u.each(function(){l.raiseToTop(this)}),i.select(this.parentNode).selectAll("rect.bandrect").filter(function(t){return t.color===a.color}).each(function(){l.raiseToTop(this),i.select(this).attr("stroke","black").attr("stroke-width",1.5)}),E(this,"plotly_hover",i.event)):(n=this,i.select(n.parentNode).selectAll("rect.bandrect").each(function(t){var r=M(t);w(r),r.each(function(){l.raiseToTop(this)})}),i.select(n.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5),S(this,"plotly_hover",i.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))&&("category"===U?r=D(j,V,this):"color"===U?(j._fullLayout._calcInverseTransform(j),d=j._fullLayout._invScaleX,f=j._fullLayout._invScaleY,p=this.getBoundingClientRect(),v=(y=(g=(m=i.select(this).datum()).categoryViewModel).parcatsViewModel).model.dimensions[g.model.dimensionInd],x=y.trace,b=p.y+p.height/2,y.dimensions.length>1&&v.displayInd===y.dimensions.length-1?(c=p.left,h="left"):(c=p.left+p.width,h="right"),_=g.model.categoryLabel,T=m.parcatsViewModel.model.count,A=0,m.categoryViewModel.bands.forEach(function(t){t.color===m.color&&(A+=t.count)}),k=g.model.count,C=0,y.pathSelection.each(function(t){t.model.color===m.color&&(C+=t.model.count)}),I=A/T,L=A/C,P=A/k,z={countLabel:A,categoryLabel:_,probabilityLabel:I.toFixed(3)},F=[],-1!==g.parcatsViewModel.hoverinfoItems.indexOf("count")&&F.push(["Count:",z.countLabel].join(" ")),-1!==g.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(F.push("P(color ∩ "+_+"): "+z.probabilityLabel),F.push("P("+_+" | color): "+L.toFixed(3)),F.push("P(color | "+_+"): "+P.toFixed(3))),O=F.join("
"),R=o.mostReadable(m.color),r={trace:x,x:d*(c-V.left),y:f*(b-V.top),text:O,color:m.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:R,fontSize:10,idealAlign:h,hovertemplate:x.hovertemplate,hovertemplateLabels:z,eventData:[{data:x._input,fullData:x,category:_,count:T,probability:I,categorycount:k,colorcount:C,bandcolorcount:A}]}):"dimension"===U&&(B=[],i.select(this.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){B.push(D(j,V,this))}),r=B),r&&s.loneHover(r,{container:N._hoverlayer.node(),outerContainer:N._paper.node(),gd:j}))}}}function I(t){var r=t.parcatsViewModel;r.dragDimension||(_(r.pathSelection),T(r.dimensionSelection.selectAll("g.category")),A(r.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),s.loneUnhover(r.graphDiv._fullLayout._hoverlayer.node()),r.pathSelection.sort(p),-1!==r.hoverinfoItems.indexOf("skip"))||("color"===t.parcatsViewModel.hoveron?E(this,"plotly_unhover",i.event):S(this,"plotly_unhover",i.event))}function L(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map(function(t){return t.displayInd}),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,i.select(this).selectAll("g.category").select("rect.catrect").each(function(r){var n=i.mouse(this)[0],a=i.mouse(this)[1];-2<=n&&n<=r.width+2&&-2<=a&&a<=r.height+2&&(t.dragCategoryDisplayInd=r.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map(function(t){return t.displayInd}),r.model.dragY=r.y,l.raiseToTop(this.parentNode),i.select(this.parentNode).selectAll("rect.bandrect").each(function(r){r.yc.y+c.height/2&&(a.model.displayInd=c.model.displayInd,c.model.displayInd=s),t.dragCategoryDisplayInd=a.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){n.model.dragX=i.event.x;var h=t.parcatsViewModel.dimensions[r-1],d=t.parcatsViewModel.dimensions[r+1];void 0!==h&&n.model.dragXd.x&&(n.model.displayInd=d.model.displayInd,d.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=n.model.displayInd}V(t.parcatsViewModel),N(t.parcatsViewModel),R(t.parcatsViewModel),O(t.parcatsViewModel)}}function z(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){i.select(this).selectAll("text").attr("font-weight","normal");var r={},n=F(t.parcatsViewModel),o=t.parcatsViewModel.model.dimensions.map(function(t){return t.displayInd}),s=t.initialDragDimensionDisplayInds.some(function(t,r){return t!==o[r]});s&&o.forEach(function(i,n){r["dimensions["+t.parcatsViewModel.model.dimensions[n].containerInd+"].displayindex"]=i});var l=!1;if(null!==t.dragCategoryDisplayInd){var u=t.model.categories.map(function(t){return t.displayInd});if(l=t.initialDragCategoryDisplayInds.some(function(t,r){return t!==u[r]})){var c=t.model.categories.slice().sort(function(t,r){return t.displayInd-r.displayInd}),h=c.map(function(t){return t.categoryValue}),d=c.map(function(t){return t.categoryLabel});r["dimensions["+t.model.containerInd+"].categoryarray"]=[h],r["dimensions["+t.model.containerInd+"].ticktext"]=[d],r["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?E(t.potentialClickBand,"plotly_click",i.event.sourceEvent):S(t.potentialClickBand,"plotly_click",i.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd&&(t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null),t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,V(t.parcatsViewModel),N(t.parcatsViewModel),i.transition().duration(300).ease("cubic-in-out").each(function(){R(t.parcatsViewModel,!0),O(t.parcatsViewModel,!0)}).each("end",function(){(s||l)&&a.restyle(t.parcatsViewModel.graphDiv,r,[n])})}}function F(t){for(var r,i=t.graphDiv._fullData,n=0;n=0;l--)h+="C"+c[l]+","+(r[l+1]+a)+" "+u[l]+","+(r[l]+a)+" "+(t[l]+i[l])+","+(r[l]+a)+("l-"+i[l])+",0 ";return h+"Z"}function N(t){var r=t.dimensions,i=t.model,n=r.map(function(t){return t.categories.map(function(t){return t.y})}),a=t.model.dimensions.map(function(t){return t.categories.map(function(t){return t.displayInd})}),o=t.model.dimensions.map(function(t){return t.displayInd}),s=t.dimensions.map(function(t){return t.model.dimensionInd}),l=r.map(function(t){return t.x}),u=r.map(function(t){return t.width}),c=[];for(var h in i.paths)i.paths.hasOwnProperty(h)&&c.push(i.paths[h]);function d(t){var r=t.categoryInds.map(function(t,r){return a[r][t]});return s.map(function(t){return r[t]})}c.sort(function(r,i){var n=d(r),a=d(i);return"backward"===t.sortpaths&&(n.reverse(),a.reverse()),n.push(r.valueInds[0]),a.push(i.valueInds[0]),t.bundlecolors&&(n.unshift(r.rawColor),a.unshift(i.rawColor)),function(t,r){for(var i=0;ia)return 1;if(n!==a){var o=isNaN(n);if(o!==isNaN(a))return o?1:-1}}return t.length-r.length}(n,a)});for(var f=Array(c.length),p=r[0].model.count,m=r[0].categories.map(function(t){return t.height}).reduce(function(t,r){return t+r}),g=0;g0?m*(x.count/p):0;for(var b=Array(n.length),_=0;_1?(t.width-80-16)/(n-1):0)*a;var o,s,l,u,c,h=[],d=t.model.maxCats,f=r.categories.length,p=r.count,m=t.height-8*(d-1),g=(d-f)*8/2,y=r.categories.map(function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}});for(y.sort(function(t,r){return t.displayInd-r.displayInd}),c=0;c0?s.count/p*m:0,l={key:s.valueInds[0],model:s,width:16,height:o,y:null!==s.dragY?s.dragY:g,bands:[],parcatsViewModel:t},g=g+o+8,h.push(l);return{key:r.dimensionInd,x:null!==r.dragX?r.dragX:i,y:0,width:16,model:r,categories:h,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}(t,o))}t.dimensions=i}r.exports=function(t,r,n,a){var o,s,y,v,b,w,M,k,S,E,D,F;o=t._context.staticPlot,s=n.map(B.bind(0,t,a)),(y=r.selectAll("g.parcatslayer").data([null])).enter().append("g").attr("class","parcatslayer").style("pointer-events",o?"none":"all"),b=(v=y.selectAll("g.trace.parcats").data(s,d)).enter().append("g").attr("class","trace parcats"),v.attr("transform",function(t){return u(t.x,t.y)}),b.append("g").attr("class","paths"),(w=v.select("g.paths").selectAll("path.path").data(function(t){return t.paths},d)).attr("fill",function(t){return t.model.color}),_(M=w.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(t){return t.model.color}).attr("fill-opacity",0)),w.attr("d",function(t){return t.svgD}),M.empty()||w.sort(p),w.exit().remove(),w.on("mouseover",m).on("mouseout",g).on("click",x),b.append("g").attr("class","dimensions"),(k=v.select("g.dimensions").selectAll("g.dimension").data(function(t){return t.dimensions},d)).enter().append("g").attr("class","dimension"),k.attr("transform",function(t){return u(t.x,0)}),k.exit().remove(),E=(S=k.selectAll("g.category").data(function(t){return t.categories},d)).enter().append("g").attr("class","category"),S.attr("transform",function(t){return u(0,t.y)}),E.append("rect").attr("class","catrect").attr("pointer-events","none"),S.select("rect.catrect").attr("fill","none").attr("width",function(t){return t.width}).attr("height",function(t){return t.height}),T(E),(D=S.selectAll("rect.bandrect").data(function(t){return t.bands},d)).each(function(){l.raiseToTop(this)}),D.attr("fill",function(t){return t.color}),F=D.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(t){return t.color}).attr("fill-opacity",0),D.attr("fill",function(t){return t.color}).attr("width",function(t){return t.width}).attr("height",function(t){return t.height}).attr("y",function(t){return t.y}).attr("cursor",function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"}),A(F),D.exit().remove(),E.append("text").attr("class","catlabel").attr("pointer-events","none"),S.select("text.catlabel").attr("text-anchor",function(t){return f(t)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(t){return f(t)?t.width+5:-5}).attr("y",function(t){return t.height/2}).text(function(t){return t.model.categoryLabel}).each(function(r){c.font(i.select(this),r.parcatsViewModel.categorylabelfont),h.convertToTspans(i.select(this),t)}),E.append("text").attr("class","dimlabel"),S.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"}).attr("x",function(t){return t.width/2}).attr("y",-5).text(function(t,r){return 0===r?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null}).each(function(t){c.font(i.select(this),t.parcatsViewModel.labelfont)}),S.selectAll("rect.bandrect").on("mouseover",C).on("mouseout",I),S.exit().remove(),k.call(i.behavior.drag().origin(function(t){return{x:t.x,y:0}}).on("dragstart",L).on("drag",P).on("dragend",z)),v.each(function(t){t.traceSelection=i.select(this),t.pathSelection=i.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=i.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),v.exit().remove()}}}),y1=g({"src/traces/parcats/plot.js"(t,r){var i=y0();r.exports=function(t,r,n,a){var o=t._fullLayout,s=o._paper,l=o._size;i(t,s,r,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},n,a)}}}),y2=g({"src/traces/parcats/base_plot.js"(t){var r=tF().getModuleCalcData,i=y1(),n="parcats";t.name=n,t.plot=function(t,a,o,s){var l=r(t.calcdata,n);l.length&&i(t,l[0],o,s)},t.clean=function(t,r,i,n){var a=n._has&&n._has("parcats"),o=r._has&&r._has("parcats");a&&!o&&n._paperdiv.selectAll(".parcats").remove()}}}),y3=g({"src/traces/parcats/index.js"(t,r){r.exports={attributes:yK(),supplyDefaults:yJ(),calc:yQ(),plot:y1(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:y2(),categories:["noOpacity"],meta:{}}}}),y5=g({"lib/parcats.js"(t,r){r.exports=y3()}}),y4=g({"src/plots/map/styles/arcgis-sat-hybrid.js"(t,r){r.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI ©
ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} -{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} -{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} -{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} -{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} -{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),y6=g({"src/plots/map/styles/arcgis-sat.js"(t,r){r.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),y8=g({"src/plots/map/constants.js"(t,r){var i=(e9(),b(e6)).default,n=y4(),a=y6(),o="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",s="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",l="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",u={basic:l,streets:l,outdoors:l,light:o,dark:s,satellite:a,"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'\xa9 OpenStreetMap contributors',tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":o,"carto-darkmatter":s,"carto-voyager":l,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},c=i(u);r.exports={styleValueDflt:"basic",stylesMap:u,styleValuesMap:c,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",c.join(", "),"or use a tile service."].join(` -`),mapOnErrorMsg:"Map error.",fitBoundsPadding:20}}}),y7=g({"src/plots/map/layout_attributes.js"(t,r){var i=t_(),n=ei().defaultLine,a=an().attributes,o=W(),s=iw().textposition,l=e$().overrideAll,u=tC().templatedArray,c=y8(),h=o({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});h.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(r.exports=l({_arrayAttrRegexps:[i.counterRegex("map",".layers",!0)],domain:a({name:"map"}),style:{valType:"any",values:c.styleValuesMap,dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},fitbounds:{valType:"enumerated",values:[!1,"locations"],dflt:"locations"},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:u("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:h,textposition:i.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),y9=g({"src/traces/scattermap/attributes.js"(t,r){var{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=eZ(),o=i_(),s=pc(),l=iw(),u=y7(),c=K(),h=tH(),d=$().extendFlat,f=e$().overrideAll,p=y7(),m=s.line,g=s.marker;r.exports=f({lon:s.lon,lat:s.lat,cluster:{enabled:{valType:"boolean"},maxzoom:d({},p.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:d({},g.opacity,{dflt:1})},mode:d({},l.mode,{dflt:"markers"}),text:d({},l.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:a({editType:"plot"}),hovertext:d({},l.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:l.connectgaps,marker:d({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:g.opacity,size:g.size,sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode},h("marker")),fill:s.fill,fillcolor:o(),textfont:u.layers.symbol.textfont,textposition:u.layers.symbol.textposition,below:{valType:"string"},selected:{marker:l.selected.marker},unselected:{marker:l.unselected.marker},hoverinfo:d({},c.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:i(),hovertemplatefallback:a()},"calc","nested")}}),ve=g({"src/traces/scattermap/constants.js"(t,r){var i=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];r.exports={isSupportedFont:function(t){return -1!==i.indexOf(t)}}}}),vt=g({"src/traces/scattermap/defaults.js"(t,r){var i=t_(),n=t8(),a=i$(),o=iW(),s=iZ(),l=iX(),u=y9(),c=ve().isSupportedFont;r.exports=function(t,r,h,d){function f(n,a){return i.coerce(t,r,u,n,a)}function p(n,a){return i.coerce2(t,r,u,n,a)}if(m=r,y=(g=f)("lon")||[],v=g("lat")||[],m._length=x=Math.min(y.length,v.length),!x){r.visible=!1;return}if(f("text"),f("texttemplate"),f("texttemplatefallback"),f("hovertext"),f("hovertemplate"),f("hovertemplatefallback"),f("mode"),f("below"),n.hasMarkers(r)){a(t,r,h,d,f,{noLine:!0,noAngle:!0}),f("marker.allowoverlap"),f("marker.angle");var m,g,y,v,x,b=r.marker;"circle"!==b.symbol&&(i.isArrayOrTypedArray(b.size)&&(b.size=b.size[0]),i.isArrayOrTypedArray(b.color)&&(b.color=b.color[0]))}n.hasLines(r)&&(o(t,r,h,d,f,{noDash:!0}),f("connectgaps"));var _=p("cluster.maxzoom"),w=p("cluster.step"),T=p("cluster.color",r.marker&&r.marker.color||h),A=p("cluster.size"),M=p("cluster.opacity");if(f("cluster.enabled",!1!==_||!1!==w||!1!==T||!1!==A||!1!==M)||n.hasText(r)){var k=d.font.family;s(t,r,d,f,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(k)?k:"Open Sans Regular",weight:d.font.weight,style:d.font.style,size:d.font.size,color:d.font.color}})}f("fill"),"none"!==r.fill&&l(t,r,h,f),i.coerceSelectionMarkerOpacity(r,f)}}}),vr=g({"src/traces/scattermap/format_labels.js"(t,r){var i=rs();r.exports=function(t,r,n){var a={},o=n[r.subplot]._subplot.mockAxis,s=t.lonlat;return a.lonLabel=i.tickText(o,o.c2l(s[0]),!0).text,a.latLabel=i.tickText(o,o.c2l(s[1]),!0).text,a}}}),vi=g({"src/plots/map/convert_text_opts.js"(t,r){var i=t_();r.exports=function(t,r){var n=t.split(" "),a=n[0],o=n[1],s=i.isArrayOrTypedArray(r)?i.mean(r):r,l=.5+s/100,u=1.5+s/100,c=["",""],h=[0,0];switch(a){case"top":c[0]="top",h[1]=-u;break;case"bottom":c[0]="bottom",h[1]=u}switch(o){case"left":c[1]="right",h[0]=-l;break;case"right":c[1]="left",h[0]=l}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:h}}}}),vn=g({"src/traces/scattermap/convert.js"(t,r){var i=L(),n=t_(),a=P().BADNUM,o=py(),s=t6(),l=rr(),u=t7(),c=t8(),h=ve().isSupportedFont,d=vi(),f=t9().appendArrayPointValue,p=tN().NEWLINES,m=tN().BR_TAG_ALL;function g(t){return{type:t,geojson:o.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function y(t,r){return n.isArrayOrTypedArray(t)?r?function(r){return i(t[r])?+t[r]:0}:function(r){return t[r]}:t?function(){return t}:v}function v(){return""}function x(t,r){var i;if(n.isArrayOrTypedArray(t)&&n.isArrayOrTypedArray(r)){i=["step",["get","point_count"],t[0]];for(var a=1;a850?l+=" Black":a>750?l+=" Extra Bold":a>650?l+=" Bold":a>550?l+=" Semi Bold":a>450?l+=" Medium":a>350?l+=" Regular":a>250?l+=" Light":a>150?l+=" Extra Light":l+=" Thin"):"Open Sans"===o.slice(0,2).join(" ")?(l="Open Sans",a>750?l+=" Extrabold":a>650?l+=" Bold":a>550?l+=" Semibold":a>350?l+=" Regular":l+=" Light"):"Klokantech Noto Sans"===o.slice(0,3).join(" ")&&(l="Klokantech Noto Sans","CJK"===o[3]&&(l+=" CJK"),l+=a>500?" Bold":" Regular")),s&&(l+=" Italic"),"Open Sans Regular Italic"===l?l="Open Sans Italic":"Open Sans Regular Bold"===l?l="Open Sans Bold":"Open Sans Regular Bold Italic"===l?l="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===l&&(l="Klokantech Noto Sans Italic"),h(l)||(l=i),l.split(", ")}r.exports=function(t,r){var h,_=r[0].trace,w=!0===_.visible&&0!==_._length,T="none"!==_.fill,A=c.hasLines(_),M=c.hasMarkers(_),k=c.hasText(_),S=M&&"circle"===_.marker.symbol,E=M&&"circle"!==_.marker.symbol,D=_.cluster&&_.cluster.enabled,C=g("fill"),I=g("line"),L=g("circle"),P=g("symbol"),z={fill:C,line:I,circle:L,symbol:P};if(!w)return z;if((T||A)&&(h=o.calcTraceToLineCoords(r)),T&&(C.geojson=o.makePolygon(h),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":_.fillcolor})),A&&(I.geojson=o.makeLine(h),I.layout.visibility="visible",n.extendFlat(I.paint,{"line-width":_.line.width,"line-color":_.line.color,"line-opacity":_.opacity})),S){var F=function(t){var r,o,c,h,d,f=t[0].trace,p=f.marker,m=f.selectedpoints,g=n.isArrayOrTypedArray(p.color),y=n.isArrayOrTypedArray(p.size),v=n.isArrayOrTypedArray(p.opacity);function x(t){return f.opacity*t}g&&(r=s.hasColorscale(f,"marker")?s.makeColorScaleFuncFromTrace(p):n.identity),y&&(o=u(f)),v&&(c=function(t){return x(i(t)?+n.constrain(t,0,1):0)});var b=[];for(d=0;d=0;r--){var i=o[r];a.removeLayer(d.layerIds[i])}t||a.removeSource(d.sourceIds.circle)}(t):function(t){for(var r=s.length-1;r>=0;r--){var i=s[r];a.removeLayer(d.layerIds[i]),t||a.removeSource(d.sourceIds[i])}}(t)}function p(t){c?function(t){t||d.addSource("circle",l.circle,r.cluster);for(var i=0;i=0;i--){var n=r[i];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},r.exports=function(t,r){var i,a,u,c=r[0].trace,h=c.cluster&&c.cluster.enabled,d=!0!==c.visible,f=new l(t,c.uid,h,d),p=n(t.gd,r),m=f.below=t.belowLookup["trace-"+c.uid];if(h)for(f.addSource("circle",p.circle,c.cluster),i=0;i")}}r.exports={hoverPoints:function(t,r,o){var c=t.cd,h=c[0].trace,d=t.xa,f=t.ya,p=t.subplot,m=[],g=l+h.uid+"-circle",y=h.cluster&&h.cluster.enabled;y&&(m=p.map.queryRenderedFeatures(null,{layers:[g]}).map(function(t){return t.id}));var v=360*(r>=0?Math.floor((r+180)/360):Math.ceil((r-180)/360)),x=r-v;if(i.getClosest(c,function(t){var r=t.lonlat;if(r[0]===s||y&&-1===m.indexOf(t.i+1))return 1/0;var i=n.modHalf(r[0],360),a=r[1],l=p.project([i,a]),u=l.x-d.c2p([x,a]),c=l.y-f.c2p([i,o]),h=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(u*u+c*c)-h,1-3/h)},t),!1!==t.index){var b=c[t.index],_=b.lonlat,w=[n.modHalf(_[0],360)+v,_[1]],T=d.c2p(w),A=f.c2p(w),M=b.mrc||1;t.x0=T-M,t.x1=T+M,t.y0=A-M,t.y1=A+M;var k={};k[h.subplot]={_subplot:p};var S=h._module.formatLabels(b,h,k);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=a(h,b),t.extraText=u(h,b,c[0].t.labels),t.hovertemplate=h.hovertemplate,[t]}},getExtraText:u}}}),vs=g({"src/traces/scattermap/event_data.js"(t,r){r.exports=function(t,r){return t.lon=r.lon,t.lat=r.lat,t}}}),vl=g({"src/traces/scattermap/select.js"(t,r){var i=t_(),n=t8(),{BADNUM:a}=P(),o=(t,r,i,n)=>[t.c2p([i,n]),r.c2p([i,n])];r.exports=function(t,r){var s;let{cd:l,xaxis:u,yaxis:c}=t,{trace:h}=l[0];if(!n.hasMarkers(h))return[];if(!1===r){for(let t of l)t.selected=0;return[]}let d=null==(s=u._subplot)?void 0:s.map,f=!!d?.getRenderWorldCopies()&&r.xmax>r.xmin,p=[];for(let n=0;nMath.abs(u-(a[0]-l[0]))&&.001>Math.abs(c-(a[1]-l[1]));return{dx:u,dy:c,uniform:h}}(u,c,m,d,g),a=function(t,r,i){let n=-1/0,a=1/0,o=(t,r,i)=>{if(.001>Math.abs(t))return;let o=r/t,s=i/t;n=Math.max(n,Math.min(o,s)),a=Math.min(a,Math.max(o,s))};return o(t.dx,i.xmin-r[0],i.xmax-r[0]),o(t.dy,i.ymin-r[1],i.ymax-r[1]),isFinite(n)&&isFinite(a)&&!(n>a)?[Math.floor(n)-1,Math.ceil(a)+1]:null}(i,g,r);for(let s=a?a[0]:0;a&&s<=a[1]&&!y;s++){let a=i.uniform?[g[0]+s*i.dx,g[1]+s*i.dy]:o(u,c,m+360*s,d);y=r.contains(a,null,n,t)}}else y=r.contains(g,null,n,t);y?(p.push({pointNumber:n,lon:h,lat:d}),s.selected=1):s.selected=0}return p}}});function vu(t,r){this.x=t,this.y=r}function vc(){return Mi??(Mi="u">typeof OffscreenCanvas&&!!new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),Mi}function vh(){if(null==Mn&&(Mn=!1,vc())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=4*r;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let r=t.getImageData(0,0,5,5).data;for(let t=0;t<100;t++)if(t%4!=3&&r[t]!==t){Mn=!0;break}}}return Mn||!1}function vd(){var t=new Ma(9);return Ma!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function vf(){var t=new Ma(16);return Ma!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function vp(t){var r=new Ma(16);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function vm(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vg(t,r){var i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],l=r[5],u=r[6],c=r[7],h=r[8],d=r[9],f=r[10],p=r[11],m=r[12],g=r[13],y=r[14],v=r[15],x=i*l-n*s,b=i*u-a*s,_=i*c-o*s,w=n*u-a*l,T=n*c-o*l,A=a*c-o*u,M=h*g-d*m,k=h*y-f*m,S=h*v-p*m,E=d*y-f*g,D=d*v-p*g,C=f*v-p*y,I=x*C-b*D+_*E+w*S-T*k+A*M;return I?(I=1/I,t[0]=(l*C-u*D+c*E)*I,t[1]=(a*D-n*C-o*E)*I,t[2]=(g*A-y*T+v*w)*I,t[3]=(f*T-d*A-p*w)*I,t[4]=(u*S-s*C-c*k)*I,t[5]=(i*C-a*S+o*k)*I,t[6]=(y*_-m*A-v*b)*I,t[7]=(h*A-f*_+p*b)*I,t[8]=(s*D-l*S+c*M)*I,t[9]=(n*S-i*D-o*M)*I,t[10]=(m*T-g*_+v*x)*I,t[11]=(d*_-h*T-p*x)*I,t[12]=(l*k-s*E-u*M)*I,t[13]=(i*E-n*k+a*M)*I,t[14]=(g*b-m*w-y*x)*I,t[15]=(h*w-d*b+f*x)*I,t):null}function vy(t,r,i){var n=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],d=r[8],f=r[9],p=r[10],m=r[11],g=r[12],y=r[13],v=r[14],x=r[15],b=i[0],_=i[1],w=i[2],T=i[3];return t[0]=b*n+_*l+w*d+T*g,t[1]=b*a+_*u+w*f+T*y,t[2]=b*o+_*c+w*p+T*v,t[3]=b*s+_*h+w*m+T*x,b=i[4],_=i[5],w=i[6],T=i[7],t[4]=b*n+_*l+w*d+T*g,t[5]=b*a+_*u+w*f+T*y,t[6]=b*o+_*c+w*p+T*v,t[7]=b*s+_*h+w*m+T*x,b=i[8],_=i[9],w=i[10],T=i[11],t[8]=b*n+_*l+w*d+T*g,t[9]=b*a+_*u+w*f+T*y,t[10]=b*o+_*c+w*p+T*v,t[11]=b*s+_*h+w*m+T*x,b=i[12],_=i[13],w=i[14],T=i[15],t[12]=b*n+_*l+w*d+T*g,t[13]=b*a+_*u+w*f+T*y,t[14]=b*o+_*c+w*p+T*v,t[15]=b*s+_*h+w*m+T*x,t}function vv(t,r,i){var n,a,o,s,l,u,c,h,d,f,p,m,g=i[0],y=i[1],v=i[2];return r===t?(t[12]=r[0]*g+r[4]*y+r[8]*v+r[12],t[13]=r[1]*g+r[5]*y+r[9]*v+r[13],t[14]=r[2]*g+r[6]*y+r[10]*v+r[14],t[15]=r[3]*g+r[7]*y+r[11]*v+r[15]):(n=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],d=r[8],f=r[9],p=r[10],m=r[11],t[0]=n,t[1]=a,t[2]=o,t[3]=s,t[4]=l,t[5]=u,t[6]=c,t[7]=h,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=n*g+l*y+d*v+r[12],t[13]=a*g+u*y+f*v+r[13],t[14]=o*g+c*y+p*v+r[14],t[15]=s*g+h*y+m*v+r[15]),t}function vx(t,r,i){var n=i[0],a=i[1],o=i[2];return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=r[3]*n,t[4]=r[4]*a,t[5]=r[5]*a,t[6]=r[6]*a,t[7]=r[7]*a,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=r[11]*o,t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function vb(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[4],s=r[5],l=r[6],u=r[7],c=r[8],h=r[9],d=r[10],f=r[11];return r!==t&&(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[4]=o*a+c*n,t[5]=s*a+h*n,t[6]=l*a+d*n,t[7]=u*a+f*n,t[8]=c*a-o*n,t[9]=h*a-s*n,t[10]=d*a-l*n,t[11]=f*a-u*n,t}function v_(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[0],s=r[1],l=r[2],u=r[3],c=r[8],h=r[9],d=r[10],f=r[11];return r!==t&&(t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[0]=o*a-c*n,t[1]=s*a-h*n,t[2]=l*a-d*n,t[3]=u*a-f*n,t[8]=o*n+c*a,t[9]=s*n+h*a,t[10]=l*n+d*a,t[11]=u*n+f*a,t}function vw(t,r,i){var n=Math.sin(i),a=Math.cos(i),o=r[0],s=r[1],l=r[2],u=r[3],c=r[4],h=r[5],d=r[6],f=r[7];return r!==t&&(t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[0]=o*a+c*n,t[1]=s*a+h*n,t[2]=l*a+d*n,t[3]=u*a+f*n,t[4]=c*a-o*n,t[5]=h*a-s*n,t[6]=d*a-l*n,t[7]=f*a-u*n,t}function vT(t,r,i,n,a){var o=1/Math.tan(r/2);if(t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=a&&a!==1/0){var s=1/(n-a);t[10]=(a+n)*s,t[14]=2*a*n*s}else t[10]=-1,t[14]=-2*n;return t}function vA(t,r,i,n,a,o,s){var l=1/(r-i),u=1/(n-a),c=1/(o-s);return t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(r+i)*l,t[13]=(a+n)*u,t[14]=(s+o)*c,t[15]=1,t}function vM(){var t=new Ma(3);return Ma!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function vk(t){var r=new Ma(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function vS(t){var r=t[0],i=t[1],n=t[2];return Math.sqrt(r*r+i*i+n*n)}function vE(t,r,i){var n=new Ma(3);return n[0]=t,n[1]=r,n[2]=i,n}function vD(t,r,i){return t[0]=r[0]+i[0],t[1]=r[1]+i[1],t[2]=r[2]+i[2],t}function vC(t,r,i){return t[0]=r[0]-i[0],t[1]=r[1]-i[1],t[2]=r[2]-i[2],t}function vI(t,r,i){return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t}function vL(t,r,i,n){return t[0]=r[0]+i[0]*n,t[1]=r[1]+i[1]*n,t[2]=r[2]+i[2]*n,t}function vP(t,r){var i=r[0],n=r[1],a=r[2],o=i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=r[0]*o,t[1]=r[1]*o,t[2]=r[2]*o,t}function vz(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]}function vF(t,r,i){var n=r[0],a=r[1],o=r[2],s=i[0],l=i[1],u=i[2];return t[0]=a*u-o*l,t[1]=o*s-n*u,t[2]=n*l-a*s,t}function vO(t,r,i){var n=i[0],a=i[1],o=i[2],s=i[3],l=r[0],u=r[1],c=r[2],h=a*c-o*u,d=o*l-n*c,f=n*u-a*l;return h+=h,d+=d,f+=f,t[0]=l+s*h+a*f-o*d,t[1]=u+s*d+o*h-n*f,t[2]=c+s*f+n*d-a*h,t}function vR(t,r,i,n){var a=[],o=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],a[2]=r[2]-i[2],o[0]=a[0],o[1]=a[1]*Math.cos(n)-a[2]*Math.sin(n),o[2]=a[1]*Math.sin(n)+a[2]*Math.cos(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function vB(t,r,i,n){var a=[],o=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],a[2]=r[2]-i[2],o[0]=a[2]*Math.sin(n)+a[0]*Math.cos(n),o[1]=a[1],o[2]=a[2]*Math.cos(n)-a[0]*Math.sin(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function vj(t,r,i,n){var a=[],o=[];return a[0]=r[0]-i[0],a[1]=r[1]-i[1],a[2]=r[2]-i[2],o[0]=a[0]*Math.cos(n)-a[1]*Math.sin(n),o[1]=a[0]*Math.sin(n)+a[1]*Math.cos(n),o[2]=a[2],t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function vN(t,r,i,n){var a=new Ma(4);return a[0]=t,a[1]=r,a[2]=i,a[3]=n,a}function vV(t,r,i){return t[0]=r[0]*i[0],t[1]=r[1]*i[1],t[2]=r[2]*i[2],t[3]=r[3]*i[3],t}function vU(t,r,i){var n=r[0],a=r[1],o=r[2],s=r[3];return t[0]=i[0]*n+i[4]*a+i[8]*o+i[12]*s,t[1]=i[1]*n+i[5]*a+i[9]*o+i[13]*s,t[2]=i[2]*n+i[6]*a+i[10]*o+i[14]*s,t[3]=i[3]*n+i[7]*a+i[11]*o+i[15]*s,t}function vq(){var t=new Ma(4);return Ma!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function vG(t,r,i,n){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",o=Math.PI/360;r*=o,n*=o,i*=o;var s=Math.sin(r),l=Math.cos(r),u=Math.sin(i),c=Math.cos(i),h=Math.sin(n),d=Math.cos(n);switch(a){case"xyz":t[0]=s*c*d+l*u*h,t[1]=l*u*d-s*c*h,t[2]=l*c*h+s*u*d,t[3]=l*c*d-s*u*h;break;case"xzy":t[0]=s*c*d-l*u*h,t[1]=l*u*d-s*c*h,t[2]=l*c*h+s*u*d,t[3]=l*c*d+s*u*h;break;case"yxz":t[0]=s*c*d+l*u*h,t[1]=l*u*d-s*c*h,t[2]=l*c*h-s*u*d,t[3]=l*c*d+s*u*h;break;case"yzx":t[0]=s*c*d+l*u*h,t[1]=l*u*d+s*c*h,t[2]=l*c*h-s*u*d,t[3]=l*c*d-s*u*h;break;case"zxy":t[0]=s*c*d-l*u*h,t[1]=l*u*d+s*c*h,t[2]=l*c*h+s*u*d,t[3]=l*c*d-s*u*h;break;case"zyx":t[0]=s*c*d-l*u*h,t[1]=l*u*d+s*c*h,t[2]=l*c*h-s*u*d,t[3]=l*c*d+s*u*h;break;default:throw Error("Unknown angle order "+a)}return t}function vH(){var t=new Ma(2);return Ma!=Float32Array&&(t[0]=0,t[1]=0),t}function v$(t,r){var i=new Ma(2);return i[0]=t,i[1]=r,i}function vW(t,r,i){return t[0]=r[0]*i,t[1]=r[1]*i,t}function vY(t){var r=t[0],i=t[1];return Math.sqrt(r*r+i*i)}function vZ(t){var r=t[0],i=t[1];return r*r+i*i}function vX(t){return t[0]=0,t[1]=0,t}function vK(t,r,i){return r*(Mf/(t.tileSize*2**(i-t.tileID.overscaledZ)))}function vJ(t){return t instanceof Error?t:Error("string"==typeof t?t:String(t))}function vQ(){return new Float64Array(4)}function v0(){return new Float64Array(3)}function v1(){return new Float64Array(16)}function v2(){let t=new Float64Array(16);return vm(t),t}function v3(){let t=new Float32Array(16);return vm(t),t}function v5(t,r,i,n,a=!1){if(!i[0]&&!i[1])return[0,0];let o=a?"map"===n?-t.bearingInRadians:0:"viewport"===n?t.bearingInRadians:0;if(o){let t=Math.sin(o),r=Math.cos(o);i=[i[0]*r-i[1]*t,i[0]*t+i[1]*r]}return[a?i[0]:vK(r,i[0],t.zoom),a?i[1]:vK(r,i[1],t.zoom)]}function v4(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]+t[3]}function v6(t,r,i){var n,a,o,s,l,u,c,h,d,f;let p=(a=(n=[t[0],t[1],t[2],r[0],r[1],r[2],i[0],i[1],i[2]])[0],o=n[1],s=n[2],l=n[3],u=n[4],c=n[5],h=n[6],d=n[7],a*((f=n[8])*u-c*d)+o*(-f*l+c*h)+s*(d*l-u*h));if(0===p)return null;let m=vF([],[r[0],r[1],r[2]],[i[0],i[1],i[2]]),g=vF([],[i[0],i[1],i[2]],[t[0],t[1],t[2]]),y=vF([],[t[0],t[1],t[2]],[r[0],r[1],r[2]]),v=vI([],m,-t[3]);return vD(v,v,vI([],g,-r[3])),vD(v,v,vI([],y,-i[3])),vI(v,v,1/p),v}function v8(t,r,i,n){let a=Math.sqrt(t*t+r*r),o=Math.sqrt(i*i+n*n);t/=a,r/=a;let s=Math.acos(t*(i/=o)+r*(n/=o));return-r*i+t*n>0?s:-s}function v7(t,r){let i=(t%360+360)%360,n=(r%360+360)%360,a=n-i,o=n>i?a-360:a+360;return Math.abs(a)=1)return 1;let i=t;for(let n=0;n<8;n++){let n=((s*i+o)*i+a)*i-t;if(Math.abs(n)Math.abs(h))break;i-=n/h}let n=0,h=1;i=t;for(let l=0;l<20;l++){let l=((s*i+o)*i+a)*i;if(Math.abs(l-t)l?n=i:h=i,i=(n+h)*.5}return((c*i+u)*i+l)*i}}function xr(t,r,i){return Math.min(i,Math.max(r,t))}function xi(t,r,i){let n=i-r,a=((t-r)%n+n)%n+r;return a===r?i:a}function xn(t,...r){for(let i of r)for(let r in i)t[r]=i[r];return t}function xa(t,r){let i={};for(let n of r)n in t&&(i[n]=t[n]);return i}function xo(t){return 2**t}function xs(t){return Math.log(t)/Math.LN2}function xl(t,r,i){if(r<=0)return t;let n=1/r;return void 0===i||1e-10>Math.abs(i)?Math.round(t*n)/n:(i>0?Math.ceil(t*n-1e-9):Math.floor(t*n+1e-10))/n}function xu(t,r,i){let n={};for(let a in t)n[a]=r.call(i||this,t[a],a,t);return n}function xc(t,r,i){let n={};for(let a in t)r.call(i||this,t[a],a,t)&&(n[a]=t[a]);return n}function xh(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let i=0;itypeof console&&console.warn(t),Mg[t]=!0)}function xp(t,r,i){return(i.y-t.y)*(r.x-t.x)>(r.y-t.y)*(i.x-t.x)}function xm(t){return"u">typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}function xg(t){return"u">typeof ImageBitmap&&t instanceof ImageBitmap}function xy(t,r,i,n){return t.addEventListener(r,i,n),{unsubscribe:()=>{t.removeEventListener(r,i,n)}}}function xv(t){return t*Math.PI/180}function xx(t){return t/Math.PI*180}function xb(t,r){return t.roll==r.roll&&t.pitch==r.pitch&&t.bearing==r.bearing}function x_(t,r,i){let n=v$(r.x-i.x,r.y-i.y),a=v$(t.x-i.x,t.y-i.y);return xx(Math.atan2(n[0]*a[1]-n[1]*a[0],n[0]*a[0]+n[1]*a[1]))}function xw(t,r,i){let n=new Float64Array(4);return vG(n,t,r-90,i),n}function xT(t){return t instanceof Error&&"AbortError"===t.name}function xA(t){if(t.aborted)throw new MT(t.reason)}function xM(t){return MA.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function xk(t,r){MA.REGISTERED_PROTOCOLS[t]=r}function xS(t){delete MA.REGISTERED_PROTOCOLS[t]}function xE(){var t;if(xm(self))return null==(t=self.worker)?void 0:t.referrer;if("blob:"===window.location.protocol)try{return window.parent.location.href}catch{}return window.location.href}function xD(t){if(!t||t.startsWith("data:image/"))return!0;if(t.startsWith("blob:")&&(t=t.slice(5)).startsWith("null"))return!1;if(0>=t.indexOf("://"))return!0;let r=new URL(t),i=window.location;return r.protocol===i.protocol&&r.host===i.host}function xC(t,r,i){var n;null!=(n=i[t])&&n.includes(r)||(i[t]||(i[t]=[]),i[t].push(r))}function xI(t,r,i){if(i?.[t]){let n=i[t].indexOf(r);-1!==n&&i[t].splice(n,1)}}function xL(t,r){return{kind:"array",itemType:t,N:r}}function xP(t){if("array"===t.kind){let r=xP(t.itemType);return"number"==typeof t.N?`array<${r}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${r}>`}return t.kind}function xz(t,r){if("error"===r.kind)return null;if("array"===t.kind){if("array"===r.kind&&(0===r.N&&"value"===r.itemType.kind||!xz(t.itemType,r.itemType))&&("number"!=typeof t.N||t.N===r.N))return null}else{if(t.kind===r.kind)return null;if("value"===t.kind){for(let t of M0)if(!xz(t,r))return null}}return`Expected ${xP(t)} but found ${xP(r)} instead.`}function xF(t,r){return r.some(r=>r.kind===t.kind)}function xO(t,r){return r.some(r=>"null"===r?null===t:"array"===r?Array.isArray(t):"object"===r?t&&!Array.isArray(t)&&"object"==typeof t:r===typeof t)}function xR(t,r){return"array"===t.kind&&"array"===r.kind?t.itemType.kind===r.itemType.kind&&"number"==typeof t.N:t.kind===r.kind}function xB(t){return(t%=360)<0&&(t+=360),t}function xj([t,r,i,n]){t=xN(t);let a,o,s=xV((.2225045*t+.7168786*(r=xN(r))+.0606169*(i=xN(i)))/1);t===r&&r===i?a=o=s:(a=xV((.4360747*t+.3850649*r+.1430804*i)/M1),o=xV((.0139322*t+.0971045*r+.7141733*i)/M2));let l=116*s-16;return[l<0?0:l,500*(a-s),200*(s-o),n]}function xN(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function xV(t){return t>.008856451679035631?t**.3333333333333333:t/M4+M3}function xU([t,r,i,n]){let a=(t+16)/116,o=isNaN(r)?a:a+r/500,s=isNaN(i)?a:a-i/200;return a=+xG(a),[xq(3.1338561*(o=M1*xG(o))-1.6168667*a-.4906146*(s=M2*xG(s))),xq(-.9787684*o+1.9161415*a+.033454*s),xq(.0719453*o-.2289914*a+1.4052427*s),n]}function xq(t){return(t=t<=.00304?12.92*t:1.055*t**.4166666666666667-.055)<0?0:t>1?1:t}function xG(t){return t>M5?t*t*t:M4*(t-M3)}function xH(t,r){return M7(t,r)?t[r]:void 0}function x$(t){return parseInt(t.padEnd(2,t),16)/255}function xW(t,r){return xY(r?t/100:t,0,1)}function xY(t,r,i){return Math.min(Math.max(r,t),i)}function xZ(t){return!t.some(Number.isNaN)}function xX(t,r,i){return t+i*(r-t)}function xK(t,r,i){return t.map((t,n)=>t+i*(r[n]-t))}function xJ(t,r,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,r,i,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,r,i,n]:[t,r,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function xQ(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof kd||t instanceof kt||t instanceof kf||t instanceof kn||t instanceof ka||t instanceof ko||t instanceof ks||t instanceof kc||t instanceof kh)return!0;if(Array.isArray(t)){for(let r of t)if(!xQ(r))return!1;return!0}if("object"==typeof t){for(let r in t)if(!xQ(t[r]))return!1;return!0}return!1}function x0(t){if(null===t)return MB;if("string"==typeof t)return MN;if("boolean"==typeof t)return MV;if("number"==typeof t)return Mj;if(t instanceof kt)return MU;if(t instanceof kd)return Mq;if(t instanceof kf)return MW;if(t instanceof kn)return MY;if(t instanceof ka)return MZ;if(t instanceof ko)return MK;if(t instanceof ks)return MX;if(t instanceof kc)return MQ;if(t instanceof kh)return MJ;if(Array.isArray(t)){let r=t.length,i;for(let r of t){let t=x0(r);if(i){if(i===t)continue;i=MH;break}i=t}return xL(i||MH,r)}return MG}function x1(t){let r=typeof t;return null===t?"":"string"===r||"number"===r||"boolean"===r?String(t):t instanceof kt||t instanceof kd||t instanceof kn||t instanceof ka||t instanceof ko||t instanceof ks||t instanceof kc||t instanceof kh?t.toString():JSON.stringify(t)}function x2(t,r,i){let n=t.length-1,a=0,o=n,s=0,l,u;for(;a<=o;)if(l=t[s=Math.floor((a+o)/2)],u=t[s+1],l<=r){if(s===n||rr)o=s-1;else throw new kl("Input is not a number.",i);return 0}function x3(t,r,i,n){let a=n-i,o=t-i;return 0===a?0:1===r?o/a:(r**o-1)/(r**a-1)}function x5(t,r,i){let n=t[r];t[r]=t[i],t[i]=n}function x4(t,r){if(t.length<=1)return[t];let i=[],n,a;for(let r of t){let t=function(t){let r=0;for(let i=0,n=t.length,a=n-1,o,s;i1)for(let t=0;tr)}){for(;a>n;){if(a-n>600){let s=a-n+1,l=i-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(r,i,Math.max(n,Math.floor(i-l*c/s+h)),Math.min(a,Math.floor(i+(s-l)*c/s+h)),o)}let s=r[i],l=n,u=a;for(x5(r,n,i),o(r[a],s)>0&&x5(r,n,a);lo(r[l],s);)l++;for(;o(r[u],s)>0;)u--}0===o(r[n],s)?x5(r,n,u):x5(r,++u,a),u<=i&&(n=u+1),i<=u&&(a=u-1)}}(i[t],r,1,i[t].length-1,x6),i[t]=i[t].slice(0,r));return i}function x6(t,r){return r.area-t.area}function x8(t,r){return"=="===t||"!="===t?"boolean"===r.kind||"string"===r.kind||"number"===r.kind||"null"===r.kind||"value"===r.kind:"string"===r.kind||"number"===r.kind||"value"===r.kind}function x7(t,r,i){return r===i}function x9(t,r,i){return r!==i}function be(t,r,i){return ri}function br(t,r,i){return r<=i}function bi(t,r,i){return r>=i}function bn(t,r,i,n){return 0===n.compare(r,i)}function ba(t,r,i,n){return!bn(t,r,i,n)}function bo(t,r,i,n){return 0>n.compare(r,i)}function bs(t,r,i,n){return n.compare(r,i)>0}function bl(t,r,i,n){return 0>=n.compare(r,i)}function bu(t,r,i,n){return n.compare(r,i)>=0}function bc(t,r,i){let n="=="!==t&&"!="!==t;return class a{constructor(t,r,i,n){this.lhs=t,this.rhs=r,this.key=i,this.collator=n,this.type=MV,this.hasUntypedArgument="value"===t.type.kind||"value"===r.type.kind}static parse(t,r){if(3!==t.length&&4!==t.length)return r.error("Expected two or three arguments.");let i=t[0],o=r.parse(t[1],1,MH);if(!o)return null;if(!x8(i,o.type))return r.concat(1).error(`"${i}" comparisons are not supported for type '${xP(o.type)}'.`);let s=r.parse(t[2],2,MH);if(!s)return null;if(!x8(i,s.type))return r.concat(2).error(`"${i}" comparisons are not supported for type '${xP(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return r.error(`Cannot compare types '${xP(o.type)}' and '${xP(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new kw(s.type,[o],r.key):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new kw(o.type,[s],r.key)));let l=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return r.error("Cannot use collator to compare non-string types.");if(!(l=r.parse(t[3],3,MW)))return null}return new a(o,s,r.key,l)}evaluate(a){let o=this.lhs.evaluate(a),s=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){let r=x0(o),i=x0(s);if(r.kind!==i.kind||"string"!==r.kind&&"number"!==r.kind)throw new kl(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${r.kind}, ${i.kind}) instead.`,this.key)}if(this.collator&&!n&&this.hasUntypedArgument){let t=x0(o),i=x0(s);if("string"!==t.kind||"string"!==i.kind)return r(a,o,s)}return this.collator?i(a,o,s,this.collator.evaluate(a)):r(a,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}function bh(t,r){let i=2**r.z;return[360*((t[0]/kG+r.x)/i)-180,360/Math.PI*Math.atan(Math.exp((180-360*((t[1]/kG+r.y)/i))*Math.PI/180))-90]}function bd(t,r){t[0]=Math.min(t[0],r[0]),t[1]=Math.min(t[1],r[1]),t[2]=Math.max(t[2],r[0]),t[3]=Math.max(t[3],r[1])}function bf(t,r){return!(t[0]<=r[0]||t[2]>=r[2]||t[1]<=r[1]||t[3]>=r[3])}function bp(t,r,i,n){var a,o;let s=[r[0]-t[0],r[1]-t[1]];return 0!=(a=[n[0]-i[0],n[1]-i[1]],a[0]*(o=s)[1]-a[1]*o[0])&&!!(by(t,r,i,n)&&by(i,n,t,r))}function bm(t,r,i=!1){let n=!1;for(let s of r)for(let r=0;rt[1]!=o[1]>t[1]&&t[0]<(o[0]-a[0])*(t[1]-a[1])/(o[1]-a[1])+a[0]&&(n=!n)}return n}function bg(t,r){for(let i of t)if(!bm(i,r))return!1;for(let i=0;i0&&d<0||h<0&&d>0}function bv(t,r,i){let n=[];for(let a=0;ai[2]){let r=.5*n,a=t[0]-i[0]>r?-n:i[0]-t[0]>r?n:0;0===a&&(a=t[0]-i[2]>r?-n:i[2]-t[0]>r?n:0),t[0]+=a}bd(r,t)}function b_(t,r,i,n){let a=2**n.z*kG,o=[n.x*kG,n.y*kG],s=[];for(let n of t)for(let t of n){let n=[t.x+o[0],t.y+o[1]];bb(n,r,i,a),s.push(n)}return s}function bw(t,r,i,n){let a=2**n.z*kG,o=[n.x*kG,n.y*kG],s=[];for(let i of t){let t=[];for(let n of i){let i=[n.x+o[0],n.y+o[1]];bd(r,i),t.push(i)}s.push(t)}if(r[2]-r[0]<=a/2){for(let t of(r[0]=r[1]=1/0,r[2]=r[3]=-1/0,s))for(let n of t)bb(n,r,i,a)}return s}function bT(t,r){return r[0]-t[0]}function bA(t){return t[1]-t[0]+1}function bM(t,r){return t[1]>=t[0]&&t[1]t[1])return[null,null];let i=bA(t);if(r){if(2===i)return[t,null];let r=Math.floor(i/2);return[[t[0],t[0]+r],[t[0]+r,t[1]]]}if(1===i)return[t,null];let n=Math.floor(i/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}function bS(t,r){if(!bM(r,t.length))return[1/0,1/0,-1/0,-1/0];let i=[1/0,1/0,-1/0,-1/0];for(let n=r[0];n<=r[1];++n)bd(i,t[n]);return i}function bE(t){let r=[1/0,1/0,-1/0,-1/0];for(let i of t)for(let t of i)bd(r,t);return r}function bD(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function bC(t,r,i){if(!bD(t)||!bD(r))return NaN;let n=0,a=0;return t[2]r[2]&&(n=t[0]-r[2]),t[1]>r[3]&&(a=t[1]-r[3]),t[3]0;){let a=s.pop();if(a[0]>=o)continue;let u=a[1],c=r?50:100;if(bA(u)<=c){if(!bM(u,t.length))return NaN;if(r){let r=function(t,r,i,n){if(!bM(r,t.length))return NaN;for(let n=r[0];n<=r[1];++n)if(bm(t[n],i,!0))return 0;let a=1/0;for(let o=r[0];o0;){let o=l.pop();if(o[0]>=s)continue;let u=o[1],c=o[2],h=r?50:100,d=n?50:100;if(bA(u)<=h&&bA(c)<=d){if(!bM(u,t.length)&&bM(c,i.length))return NaN;if(r&&n)s=Math.min(s,function(t,r,i,n,a){if(!(bM(r,t.length)&&bM(n,i.length)))return 1/0;let o=1/0;for(let s=r[0];s({type:"Polygon",coordinates:t})):"MultiLineString"===t.type?t.coordinates.map(t=>({type:"LineString",coordinates:t})):"MultiPoint"===t.type?t.coordinates.map(t=>({type:"Point",coordinates:t})):[t]}function bj(t,[r,i,n,a],o){r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);let s=a?a.evaluate(t):1,l=xJ(r,i,n,s);if(l)throw new kl(l,o);return new kt(r/255,i/255,n/255,s,!1)}function bN(t,r){return t in r&&void 0!==r[t]}function bV(t,r){let i=r[t];return void 0===i?null:i}function bU(t){return{type:t}}function bq(t){if(t instanceof kk)return bq(t.boundExpression);if(t instanceof k2&&"error"===t.name||t instanceof kN||t instanceof kH||t instanceof kZ||t instanceof kK)return!1;let r=t instanceof kA||t instanceof kw,i=!0;return t.eachChild(t=>{i&&(i=r?bq(t):t instanceof kp)}),!!i&&bG(t)&&b$(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function bG(t){if(t instanceof k2&&("get"===t.name&&1===t.args.length||"feature-state"===t.name||"has"===t.name&&1===t.args.length||"properties"===t.name||"geometry-type"===t.name||"id"===t.name||/^filter-/.test(t.name))||t instanceof kH||t instanceof kZ)return!1;let r=!0;return t.eachChild(t=>{r&&!bG(t)&&(r=!1)}),r}function bH(t){if(t instanceof k2&&"feature-state"===t.name)return!1;let r=!0;return t.eachChild(t=>{r&&!bH(t)&&(r=!1)}),r}function b$(t,r){if(t instanceof k2&&r.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(t=>{i&&!b$(t,r)&&(i=!1)}),i}function bW(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function bY(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function bZ(t){return!!t.expression&&t.expression.interpolated}function bX(t,...r){for(let i of r)for(let r in i)t[r]=i[r];return t}function bK(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function bJ(t){return"object"==typeof t&&!!t&&!Array.isArray(t)&&x0(t)===MG}function bQ(t){return t}function b0(t,r,i){return void 0!==t?t:void 0!==r?r:void 0!==i?i:void 0}function b1(t,r,i,n,a){return b0(typeof i===a?n[i]:void 0,t.default,r.default)}function b2(t,r,i){if("number"!==bK(i))return b0(t.default,r.default);let n=t.stops.length;if(1===n||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];let a=x2(t.stops.map(t=>t[0]),i,"");return t.stops[a][1]}function b3(t,r,i){var n,a,o;let s,l,u=void 0===t.base?1:t.base;if("number"!==bK(i))return b0(t.default,r.default);let c=t.stops.length;if(1===c||i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[c-1][0])return t.stops[c-1][1];let h=x2(t.stops.map(t=>t[0]),i,""),d=(n=i,a=u,o=t.stops[h][0],s=t.stops[h+1][0]-o,l=n-o,0===s?0:1===a?l/s:(a**l-1)/(a**s-1)),f=t.stops[h][1],p=t.stops[h+1][1],m=kx[r.type]||bQ;return"function"==typeof f.evaluate?{evaluate(...r){let i=f.evaluate.apply(void 0,r),n=p.evaluate.apply(void 0,r);if(void 0!==i&&void 0!==n)return m(i,n,d,t.colorSpace)}}:m(f,p,d,t.colorSpace)}function b5(t,r,i){switch(r.type){case"color":i=kt.parse(i);break;case"formatted":i=kn.fromString(i.toString());break;case"resolvedImage":i=kh.fromString(i.toString());break;case"padding":i=ka.parse(i);break;case"colorArray":i=ks.parse(i);break;case"numberArray":i=ko.parse(i);break;default:bK(i)===r.type||"enum"===r.type&&r.values[i]||(i=void 0)}return b0(i,t.default,r.default)}function b4(t){return{result:"success",value:t}}function b6(t){return{result:"error",value:t}}function b8(t,r,i,n){return`${t}${r}: ${i}${null==n?"":` Falling back to ${String(n)}.`}`}function b7(t){if(!t)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function b9(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in kJ}function _e(t,r,i,n){var a;let o;b7(r);let s=new k1(kJ,bq,[],i?(a=i,o={color:MU,string:MN,number:Mj,enum:MN,boolean:MV,formatted:MY,padding:MZ,numberArray:MK,colorArray:MX,projectionDefinition:Mq,resolvedImage:MJ,variableAnchorOffsetCollection:MQ},"array"===a.type?xL(o[a.value]||MH,a.length):o[a.type]):void 0),l=s.parse(t,void 0,void 0,void 0,i&&"string"===i.type?{typeAnnotation:"coerce"}:void 0);return l?b4(new k5(l,r,i,n)):b6(s.errors)}function _t(t,r,i,n){let a=_e(t,r,i,n);if("error"===a.result)return a;let o=a.value.expression,s=bG(o);if(!s&&!bW(i))return b6([new kQ("","data expressions not supported")]);let l=b$(o,["zoom"]);if(!l&&!bY(i))return b6([new kQ("","zoom expressions not supported")]);let u=function t(r){let i=null;if(r instanceof kM)i=t(r.result);else if(r instanceof kP){for(let n of r.args)if(i=t(n))break}else(r instanceof ky||r instanceof kv)&&r.input instanceof k2&&"zoom"===r.input.name&&(i=r);return i instanceof kQ||r.eachChild(r=>{let n=t(r);n instanceof kQ?i=n:!i&&n?i=new kQ("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&n&&i!==n&&(i=new kQ("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i}(o);if(!u&&!l)return b6([new kQ("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(u instanceof kQ)return b6([u]);if(u instanceof kv&&!bZ(i))return b6([new kQ("",'"interpolate" expressions cannot be used with this property')]);if(!u)return b4(s?new k4("constant",a.value,n):new k4("source",a.value,n));let c=u instanceof kv?u.interpolation:void 0;return b4(s?new k6("camera",a.value,u.labels,c,n):new k6("composite",a.value,u.labels,c,n))}function _r(t,r=new Set){return t instanceof kK&&r.add(t.key),t.eachChild(t=>{_r(t,r)}),r}function _i(t){if("color"===t.type&&bJ(t.default))return new kt(0,0,0,0);switch(t.type){case"color":return kt.parse(t.default)||null;case"padding":return ka.parse(t.default)||null;case"numberArray":return ko.parse(t.default)||null;case"colorArray":return ks.parse(t.default)||null;case"variableAnchorOffsetCollection":return kc.parse(t.default)||null;case"projectionDefinition":return kd.parse(t.default)||null;default:return void 0===t.default?null:t.default}}function _n(t,r){let{zoom:i,heatmapDensity:n,elevation:a,lineProgress:o,isSupportedScript:s,accumulated:l}=t??{};return{zoom:i,heatmapDensity:n,elevation:a,lineProgress:o,isSupportedScript:s,accumulated:l,globalState:r}}function _a(t){return"legacy"!==function t(r){if("boolean"==typeof r)return"neutral";if(!Array.isArray(r)||0===r.length)return"legacy";switch(r[0]){case"has":return r.length<2||"$id"===r[1]||"$type"===r[1]?"legacy":2===r.length?"neutral":"expression";case"in":return r.length>=3&&("string"!=typeof r[1]||Array.isArray(r[2]))?"expression":"legacy";case"!in":case"!has":case"none":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==r.length||Array.isArray(r[1])||Array.isArray(r[2])?"expression":"legacy";case"any":case"all":var i=r.slice(1);let n=!1;for(let r of i){let i=t(r);if("expression"===i)return"expression";"legacy"===i&&(n=!0)}return n?"legacy":"neutral";default:return"expression"}}(t)}function _o(t){return"$type"===t?["geometry-type"]:"$id"===t?["id"]:["get",t]}function _s(t){if(("<"===t[0]||"<="===t[0]||">"===t[0]||">="===t[0])&&"$type"===t[1])return`"$type" cannot be use with operator "${t[0]}"`;let r=function(t){switch(t[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return 3!==t.length||"string"!=typeof t[1]?null:[t[0],_o(t[1]),t[2]];case"in":case"!in":{if(t.length<2||"string"!=typeof t[1])return null;let r=["in",_o(t[1]),["literal",t.slice(2)]];return"!in"===t[0]?["!",r]:r}case"has":case"!has":{if(2!==t.length||"string"!=typeof t[1]||"$type"===t[1]||"$id"===t[1])return null;let r=["has",t[1]];return"!has"===t[0]?["!",r]:r}default:return null}}(t);return r?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(r)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function _l(t,r,i){let n=i[t];return Array.isArray(n)?_a(n)?_u(n,r.concat(t)):{path:r.concat(t),legacyFilter:n}:null}function _u(t,r=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case"all":case"any":case"none":for(let i=1;i!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};_a(t)?function(t,r){let i=_u(t);if(!i||typeof console>"u")return;let n=i.path.map(t=>`[${t}]`).join("");console.warn(`${r}${n}: ${_s(i.legacyFilter)}`)}(t,r):t=function t(r){if(!r)return!0;let i=r[0];return r.length<=1?"any"!==i:"=="===i?_d(r[1],r[2],"=="):"!="===i?_m(_d(r[1],r[2],"==")):"<"===i||">"===i||"<="===i||">="===i?_d(r[1],r[2],i):"any"===i?["any"].concat(r.slice(1).map(t)):"all"===i?["all"].concat(r.slice(1).map(t)):"none"===i?["all"].concat(r.slice(1).map(t).map(_m)):"in"===i?_f(r[1],r.slice(2)):"!in"===i?_m(_f(r[1],r.slice(2))):"has"===i?_p(r[1]):"!has"!==i||_m(_p(r[1]))}(t);let n=_e(t,r,k7,i);if("error"===n.result)throw Error(n.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,r,i)=>n.value.evaluate(t,r,{},i),needGeometry:function t(r){if(!Array.isArray(r))return!1;if("within"===r[0]||"distance"===r[0])return!0;for(let i=1;i_r(n.value.expression)}}function _h(t,r){return tr)}function _d(t,r,i){switch(t){case"$type":return[`filter-type-${i}`,r];case"$id":return[`filter-id-${i}`,r];default:return[`filter-${i}`,t,r]}}function _f(t,r){if(0===r.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",r]];case"$id":return["filter-id-in",["literal",r]];default:return r.length>200&&!r.some(t=>typeof t!=typeof r[0])?["filter-in-large",t,["literal",r.sort(_h)]]:["filter-in-small",t,["literal",r]]}}function _p(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function _m(t){return["!",t]}function _g(t){let r=t.key,i=t.value;return i?[new MR(r,i,"constants have been deprecated as of v8")]:[]}function _y(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function _v(t){if(Array.isArray(t))return t.map(_v);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let r={};for(let i in t)r[i]=_v(t[i]);return r}return _y(t)}function _x(t){let r=t.key,i=t.value,n=t.valueSpec||{},a=t.objectElementValidators||{},o=t.style,s=t.styleSpec,l=t.validateSpec,u=[],c=bK(i);if("object"!==c)return[new MR(r,i,`object expected, ${c} found`)];for(let t in i){let c=t.split(".")[0],h=xH(n,c)||n["*"],d;if(xH(a,c))d=a[c];else if(xH(n,c)){if(void 0===i[t])continue;d=l}else if(a["*"])d=a["*"];else if(n["*"])d=l;else{u.push(new MR(r,i[t],`unknown property "${t}"`));continue}u=u.concat(d({key:(r&&`${r}.`)+t,value:i[t],valueSpec:h,style:o,styleSpec:s,object:i,objectKey:t,validateSpec:l},i))}for(let t in n)a[t]||n[t].required&&void 0===n[t].default&&void 0===i[t]&&u.push(new MR(r,i,`missing required property "${t}"`));return u}function _b(t){let r=t.value,i=t.valueSpec,n=t.validateSpec,a=t.style,o=t.styleSpec,s=t.key,l=t.arrayElementValidator||n;if("array"!==bK(r))return[new MR(s,r,`array expected, ${bK(r)} found`)];if(i.length&&r.length!==i.length)return[new MR(s,r,`array length ${i.length} expected, length ${r.length} found`)];let u={type:i.value,values:i.values};o.$version<7&&(u.function=i.function),"object"===bK(i.value)&&(u=i.value);let c=[];for(let i=0;in.maximum?[new MR(r,i,`${i} is greater than the maximum value ${n.maximum}`)]:[]:[new MR(r,i,`number expected, ${a} found`)]}function _w(t){let r=t.valueSpec,i=_y(t.value.type),n,a={},o,s,l="categorical"!==i&&void 0===t.value.property,u="array"===bK(t.value.stops)&&"array"===bK(t.value.stops[0])&&"object"===bK(t.value.stops[0][0]),c=_x({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new MR(t.key,t.value,'identity function may not have a "stops" property')];let r=[],n=t.value;return r=r.concat(_b({key:t.key,value:n,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===bK(n)&&0===n.length&&r.push(new MR(t.key,n,"array must have at least one stop")),r},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:r,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&l&&c.push(new MR(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||c.push(new MR(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!bZ(t.valueSpec)&&c.push(new MR(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l||bW(t.valueSpec)?l&&!bY(t.valueSpec)&&c.push(new MR(t.key,t.value,"zoom functions not supported")):c.push(new MR(t.key,t.value,"property functions not supported"))),("categorical"===i||u)&&void 0===t.value.property&&c.push(new MR(t.key,t.value,'"property" property is required')),c;function h(t){let i=[],n=t.value,l=t.key;if("array"!==bK(n))return[new MR(l,n,`array expected, ${bK(n)} found`)];if(2!==n.length)return[new MR(l,n,`array length 2 expected, length ${n.length} found`)];if(u){if("object"!==bK(n[0]))return[new MR(l,n,`object expected, ${bK(n[0])} found`)];if(void 0===n[0].zoom)return[new MR(l,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new MR(l,n,"object stop key must have value")];if(s&&s>_y(n[0].zoom))return[new MR(l,n[0].zoom,"stop zoom values must appear in ascending order")];_y(n[0].zoom)!==s&&(s=_y(n[0].zoom),o=void 0,a={}),i=i.concat(_x({key:`${l}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:__,value:d}}))}else i=i.concat(d({key:`${l}[0]`,value:n[0],valueSpec:{},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},n));return b9(_v(n[1]))?i.concat([new MR(`${l}[1]`,n[1],"expressions are not allowed in function stops.")]):i.concat(t.validateSpec({key:`${l}[1]`,value:n[1],valueSpec:r,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function d(t,s){let l=bK(t.value),u=_y(t.value),c=null===t.value?s:t.value;if(n){if(l!==n)return[new MR(t.key,c,`${l} stop domain type must match previous stop domain type ${n}`)]}else n=l;if("number"!==l&&"string"!==l&&"boolean"!==l)return[new MR(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==i){let n=`number expected, ${l} found`;return bW(r)&&void 0===i&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new MR(t.key,c,n)]}return"categorical"!==i||"number"!==l||isFinite(u)&&Math.floor(u)===u?"categorical"!==i&&"number"===l&&void 0!==o&&unew MR(`${t.key}${r.key}`,t.value,r.message));let i=r.value.expression||r.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new MR(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&&!bH(i))return[new MR(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!bH(i))return[new MR(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!b$(i,["zoom","feature-state"]))return[new MR(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!bG(i))return[new MR(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function _A(t){let r=t.value,i=t.key,n=bK(r);return"boolean"===n?[]:[new MR(i,r,`boolean expected, ${n} found`)]}function _M(t){let r=t.key,i=t.value,n=bK(i);return"string"===n?kt.parse(String(i))?[]:[new MR(r,i,`color expected, "${i}" found`)]:[new MR(r,i,`color expected, ${n} found`)]}function _k(t){let r=t.key,i=t.value,n=t.valueSpec,a=[];return Array.isArray(n.values)?-1===n.values.indexOf(_y(i))&&a.push(new MR(r,i,`expected one of [${n.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(n.values).indexOf(_y(i))&&a.push(new MR(r,i,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(i)} found`)),a}function _S(t){let r,i=_v(t.value);return _a(i)?[...(r=_u(i))?[new MR(`${t.key}${r.path.map(t=>`[${t}]`).join("")}`,function(t,r){let i=t;for(let t of r)i=i[t];return i}(t.value,r.path),_s(r.legacyFilter),null,"warning")]:[],..._T(bX({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:function t(r){let i=r.value,n=r.key;if("array"!==bK(i))return[new MR(n,i,`array expected, ${bK(i)} found`)];let a=r.styleSpec,o,s=[];if(i.length<1)return[new MR(n,i,"filter array must have at least 1 element")];switch(s=s.concat(_k({key:`${n}[0]`,value:i[0],valueSpec:a.filter_operator,style:r.style,styleSpec:r.styleSpec})),_y(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===_y(i[1])&&s.push(new MR(n,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":3!==i.length&&s.push(new MR(n,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&"string"!==(o=bK(i[1]))&&s.push(new MR(`${n}[1]`,i[1],`string expected, ${o} found`));for(let t=2;t{t in a&&n.push(new MR(o,a[t],`"${t}" is prohibited for ref layers`))}),s.layers.forEach(r=>{_y(r.id)===c&&(t=r)}),t?t.ref?n.push(new MR(o,a.ref,"ref cannot reference another ref layer")):u=_y(t.type):n.push(new MR(o,a.ref,`ref layer "${c}" not found`))}else if("background"!==u)if(a.source){let t=s.sources&&s.sources[a.source],r=t&&_y(t.type);t?"vector"===r&&"raster"===u?n.push(new MR(o,a.source,`layer "${a.id}" requires a raster source`)):"raster-dem"!==r&&"hillshade"===u||"raster-dem"!==r&&"color-relief"===u?n.push(new MR(o,a.source,`layer "${a.id}" requires a raster-dem source`)):"raster"===r&&"raster"!==u?n.push(new MR(o,a.source,`layer "${a.id}" requires a vector source`)):"vector"!==r||a["source-layer"]?"raster-dem"===r&&"hillshade"!==u&&"color-relief"!==u?n.push(new MR(o,a.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"===u&&a.paint&&a.paint["line-gradient"]&&("geojson"!==r||!t.lineMetrics)&&n.push(new MR(o,a,`layer "${a.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):n.push(new MR(o,a,`layer "${a.id}" must specify a "source-layer"`)):n.push(new MR(o,a.source,`source "${a.source}" not found`))}else n.push(new MR(o,a,'missing required property "source"'));return"raster"===u&&null!=(r=a.paint)&&r.resampling&&null!=(i=a.paint)&&i["raster-resampling"]&&n.push(new MR(o,a.paint,`layer "${a.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),n=n.concat(_x({key:o,value:a,valueSpec:l.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${o}.type`,value:a.type,valueSpec:l.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:a,objectKey:"type"}),filter:_S,layout:t=>_x({layer:a,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>_C(bX({layerType:u},t))}}),paint:t=>_x({layer:a,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>_D(bX({layerType:u},t))}})}}))}function _L(t){let r=t.value,i=t.key,n=bK(r);return"string"===n?[]:[new MR(i,r,`string expected, ${n} found`)]}function _P(t){let r=t.value,i=t.key,n=t.styleSpec,a=t.style,o=t.validateSpec;if(!r.type)return[new MR(i,r,'"type" is required')];let s=_y(r.type),l;switch(s){case"vector":case"raster":return _x({key:i,value:r,valueSpec:n[`source_${s.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:k9,validateSpec:o});case"raster-dem":return function(t){var r;let i=null!=(r=t.sourceName)?r:"",n=t.value,a=t.styleSpec,o=a.source_raster_dem,s=t.style,l=[],u=bK(n);if(void 0===n)return l;if("object"!==u)return l.push(new MR("source_raster_dem",n,`object expected, ${u} found`)),l;let c="custom"===_y(n.encoding),h=["redFactor","greenFactor","blueFactor","baseShift"],d=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let r in n)!c&&h.includes(r)?l.push(new MR(r,n[r],`In "${i}": "${r}" is only valid when "encoding" is set to "custom". ${d} encoding found`)):o[r]?l=l.concat(t.validateSpec({key:r,value:n[r],valueSpec:o[r],validateSpec:t.validateSpec,style:s,styleSpec:a})):l.push(new MR(r,n[r],`unknown property "${r}"`));return l}({sourceName:i,value:r,style:t.style,styleSpec:n,validateSpec:o});case"geojson":if(l=_x({key:i,value:r,valueSpec:n.source_geojson,style:a,styleSpec:n,validateSpec:o,objectElementValidators:k9}),r.cluster)for(let t in r.clusterProperties){let[n,a]=r.clusterProperties[t],s="string"==typeof n?[n,["accumulated"],["get",t]]:n;l.push(..._T({key:`${i}.${t}.map`,value:a,validateSpec:o,expressionContext:"cluster-map"})),l.push(..._T({key:`${i}.${t}.reduce`,value:s,validateSpec:o,expressionContext:"cluster-reduce"}))}return l;case"video":return _x({key:i,value:r,valueSpec:n.source_video,style:a,validateSpec:o,styleSpec:n});case"image":return _x({key:i,value:r,valueSpec:n.source_image,style:a,validateSpec:o,styleSpec:n});case"canvas":return[new MR(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return _k({key:`${i}.type`,value:r.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,validateSpec:o,styleSpec:n})}}function _z({key:t,value:r}){if("string"===bK(r))return _L({key:t,value:r});{let i=[];for(let n in r)i.push(..._L({key:`${t}.${n}`,value:r[n]}));return i}}function _F(t){let r=t.value,i=t.styleSpec,n=i.light,a=t.style,o=[],s=bK(r);if(void 0===r)return o;if("object"!==s)return o.concat([new MR("light",r,`object expected, ${s} found`)]);for(let s in r){let l=s.match(k3);o=l&&n[l[1]]&&n[l[1]].transition?o.concat(t.validateSpec({key:s,value:r[s],valueSpec:i.transition,validateSpec:t.validateSpec,style:a,styleSpec:i})):n[s]?o.concat(t.validateSpec({key:s,value:r[s],valueSpec:n[s],validateSpec:t.validateSpec,style:a,styleSpec:i})):o.concat([new MR(s,r[s],`unknown property "${s}"`)])}return o}function _O(t){let r=t.value,i=t.styleSpec,n=i.sky,a=t.style,o=bK(r);if(void 0===r)return[];if("object"!==o)return[new MR("sky",r,`object expected, ${o} found`)];let s=[];for(let o in r){let l=o.match(k3);s=l&&n[l[1]]&&n[l[1]].transition?s.concat(t.validateSpec({key:o,value:r[o],valueSpec:i.transition,style:a,styleSpec:i})):n[o]?s.concat(t.validateSpec({key:o,value:r[o],valueSpec:n[o],style:a,styleSpec:i})):s.concat([new MR(o,r[o],`unknown property "${o}"`)])}return s}function _R(t){let r=t.value,i=t.styleSpec,n=i.terrain,a=t.style,o=[],s=bK(r);if(void 0===r)return o;if("object"!==s)return o.concat([new MR("terrain",r,`object expected, ${s} found`)]);for(let s in r)o=n[s]?o.concat(t.validateSpec({key:s,value:r[s],valueSpec:n[s],validateSpec:t.validateSpec,style:a,styleSpec:i})):o.concat([new MR(s,r[s],`unknown property "${s}"`)]);return o}function _B(t){return 0===_L(t).length?[]:_T(t)}function _j(t){return 0===_L(t).length?[]:_T(t)}function _N(t){let r=t.key,i=t.value;if("array"===bK(i)){if(i.length<1||i.length>4)return[new MR(r,i,`padding requires 1 to 4 values; ${i.length} values found`)];let n={type:"number"},a=[];for(let o=0;o[new MR(t,r,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],a=i.match(St);if(!a)return n();let[,o,s,l]=a;if(void 0!==l)return l.length>6?n():[];let u=parseInt(o,16),c=void 0===s?u:parseInt(s,16);return u>Se||c>Se?[new MR(t,r,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:u>c?[new MR(t,r,`unicode range start must not be greater than its end, but ${i} is`)]:[]}(`${r}.unicode-range[${t}]`,i))}}else u.push(new MR(`${n}.${t}`,r,`string or array expected, ${i} found`))}return u}function _X(t){let r=t.value,i=t.valueSpec,n=t.styleSpec;return t.validateSpec=_X,i.expression&&bJ(_y(r))?_w(t):i.expression&&b9(_v(r))?_T(t):i.type&&Sr[i.type]?Sr[i.type](t):_x(bX({},t,{valueSpec:i.type?n[i.type]:i}))}function _K(t){let r=t.value,i=t.key,n=_L(t);return n.length||(-1===r.indexOf("{fontstack}")&&n.push(new MR(i,r,'"glyphs" url must include a "{fontstack}" token')),-1===r.indexOf("{range}")&&n.push(new MR(i,r,'"glyphs" url must include a "{range}" token'))),n}function _J(t,r=MF){let i=[];return i=i.concat(_X({key:"",value:t,valueSpec:r.$root,styleSpec:r,style:t,validateSpec:_X,objectElementValidators:{glyphs:_K,"*":()=>[]}})),t.constants&&(i=i.concat(_g({key:"constants",value:t.constants,style:t,styleSpec:r,validateSpec:_X}))),_0(i)}function _Q(t){return function(r){return t(Object.assign({},r,{validateSpec:_X}))}}function _0(t){return[].concat(t).sort((t,r)=>t.line-r.line)}function _1(t){return function(...r){return _0(t.apply(this,r))}}function _2(t,r){var i;let n=Object.entries(null!=(i=r.sources)?i:{}).filter(([,t])=>!So.has(t.type)).map(([t])=>`sources.${t}`);return _3(t,Sa(r).filter(({message:t})=>!n.some(r=>t.startsWith(`${r}:`)||t.startsWith(`${r}.`))))}function _3(t,r){let i=!1;for(let n of r){if("warning"===n.severity){xf(n.message);continue}t.fire(new ML(Error(n.message))),i=!0}return i}function _5(t,r,i,n){return n?.validate!==!1&&_3(t,r(f({styleSpec:MF},i)))}function _4(t,r,i={}){if(Sl[t])throw Error(`${t} is already registered.`);Object.defineProperty(r,"_classRegistryKey",{value:t,writeable:!1}),Sl[t]={klass:r,omit:i.omit||[],shallow:i.shallow||[]}}function _6(t){var r;return t&&"u">typeof ArrayBuffer&&(t instanceof ArrayBuffer||(null==(r=t.constructor)?void 0:r.name)==="ArrayBuffer")}function _8(t){let r=t.constructor;return t.$name||r._classRegistryKey}function _7(t){return!function(t){if("object"!=typeof t||!t)return!1;let r=_8(t);return r&&"Object"!==r}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||_6(t)||xg(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function _9(t,r){if(_7(t))return(_6(t)||xg(t))&&r&&r.push(t),ArrayBuffer.isView(t)&&r&&r.push(t.buffer),t instanceof ImageData&&r&&r.push(t.data.buffer),t;if(Array.isArray(t)){let i=[];for(let n of t)i.push(_9(n,r));return i}if("object"!=typeof t)throw Error(`can't serialize object of type ${typeof t}`);let i=_8(t);if(!i)throw Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!Sl[i])throw Error(`${i} is not registered.`);let{klass:n}=Sl[i],a=n.serialize?n.serialize(t,r):{};if(n.serialize){if(a===r?.[r.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let n in t){if(!t.hasOwnProperty(n)||Sl[i].omit.includes(n))continue;let o=t[n];void 0!==o&&(a[n]=Sl[i].shallow.includes(n)?o:_9(o,r))}t instanceof Error&&(a.message=t.message)}if(a.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(a.$name=i),a}function we(t){if(_7(t))return t;if(Array.isArray(t))return t.map(we);if("object"!=typeof t)throw Error(`can't deserialize object of type ${typeof t}`);let r=_8(t)||"Object";if(!Sl[r])throw Error(`can't deserialize unregistered class ${r}`);let{klass:i}=Sl[r];if(!i)throw Error(`can't deserialize unregistered class ${r}`);if(i.deserialize)return i.deserialize(t);let n=Object.create(i.prototype);for(let i of Object.keys(t)){if("$name"===i)continue;let a=t[i];n[i]=Sl[r].shallow.includes(i)?a:we(a)}return n}function wt(t){if(Array.isArray(t))return t.length;let r=t?.values;return Array.isArray(r)?r.length:void 0}function wr(t,r){let i=wt(t),n=wt(r);return void 0!==i&&void 0!==n&&i!==n}function wi(t,r=1){let i=0,n=0;return{members:t.map(t=>{let a=SL[t.type].BYTES_PER_ELEMENT,o=i=wn(i,Math.max(r,a)),s=t.components||1;return n=Math.max(n,a),i+=a*s,{name:t.name,type:t.type,components:s,offset:o}}),size:wn(i,Math.max(n,r)),alignment:r}}function wn(t,r){return Math.ceil(t/r)*r}function wa(t,r){return 256*(t=xr(Math.floor(t),0,255))+(r=xr(Math.floor(r),0,255))}function wo(t){let r=+t;return!isNaN(r)&&r<=0x1fffffffffffff?r:(0,Ez.default)(String(t))}function ws(t,r,i){let n=t[r];t[r]=t[i],t[i]=n}function wl(t){return[wa(255*t.r,255*t.g),wa(255*t.b,255*t.a)]}function wu(t,r,i){var n;let a={color:{source:SN,composite:S5},number:{source:SQ,composite:SN}};return(null==(n=({"line-pattern":{source:Em,composite:Em},"fill-pattern":{source:Em,composite:Em},"fill-extrusion-pattern":{source:Em,composite:Em},"line-dasharray":{source:Eg,composite:Eg}})[t])?void 0:n[i])||a[r][i]}function wc(t){let r=Mf/t.extent,i=t.loadGeometry();for(let t of i)for(let i of t){let t=Math.round(i.x*r),n=Math.round(i.y*r);i.x=xr(t,E3,E2),i.y=xr(n,E3,E2),(ti.x+1||ni.y+1)&&xf("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function wh(t,r){return{type:t.type,id:t.id,properties:t.properties,geometry:r?wc(t):[]}}function wd(t,r){for(let i of t)if(wx(r,i))return!0;for(let i of r)if(wx(t,i))return!0;return wm(t,r)}function wf(t,r,i){return!!wx(t,r)||wg(r,t,i)}function wp(t,r){if(1===t.length)return wv(r,t[0]);for(let i of r)for(let r of i)if(wx(t,r))return!0;for(let i of t)if(wv(r,i))return!0;for(let i of r)if(wm(t,i))return!0;return!1}function wm(t,r){if(0===t.length||0===r.length)return!1;for(let s=0;s1?t.distSqr(i):t.distSqr(i.sub(r)._mult(a)._add(r))}function wv(t,r){let i=!1,n,a;for(let o of t)for(let t=0,s=o.length-1;tr.y!=a.y>r.y&&r.x<(a.x-n.x)*(r.y-n.y)/(a.y-n.y)+n.x&&(i=!i);return i}function wx(t,r){let i=!1;for(let n=0,a=t.length-1;nr.y!=s.y>r.y&&r.x<(s.x-o.x)*(r.y-o.y)/(s.y-o.y)+o.x&&(i=!i)}return i}function wb(t,r,i){let n=r.paint.get(t).value;return"constant"===n.kind?n.value:i.programConfigurations.get(r.id).getMaxValue(t)}function w_(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ww(t,r,i,n,a){if(!r[0]&&!r[1])return t;let o=vu.convert(r)._mult(a);"viewport"===i&&o._rotate(-n);let s=[];for(let r of t)s.push(r.sub(o));return s}function wT({queryGeometry:t,size:r},i){return wf(t,i,r)}function wA({queryGeometry:t,size:r,transform:i,unwrappedTileID:n,getElevation:a},o){return wf(t,o,r*(i.projectTileCoordinates(o.x,o.y,n,a?.(o.x,o.y)).signedDistanceFromCamera/i.cameraToCenterDistance))}function wM({queryGeometry:t,size:r,transform:i,unwrappedTileID:n,getElevation:a},o){let s=i.projectTileCoordinates(o.x,o.y,n,a?.(o.x,o.y)).signedDistanceFromCamera,l=r*(i.cameraToCenterDistance/s);return wf(t,wE(o,i,n,a),l)}function wk({queryGeometry:t,size:r,transform:i,unwrappedTileID:n,getElevation:a},o){return wf(t,wE(o,i,n,a),r)}function wS({queryGeometry:t,size:r,transform:i,unwrappedTileID:n,getElevation:a,pitchAlignment:o="map",pitchScale:s="map"},l){let u="map"===o?"map"===s?wT:wA:"map"===s?wM:wk,c={queryGeometry:t,size:r,transform:i,unwrappedTileID:n,getElevation:a};for(let t of l)for(let r of t)if(u(c,r))return!0;return!1}function wE(t,r,i,n){let a=r.projectTileCoordinates(t.x,t.y,i,n?.(t.x,t.y)).point;return new vu((.5*a.x+.5)*r.width,(-(.5*a.y)+.5)*r.height)}function wD(t,{width:r,height:i},n,a){if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==r*i*n)throw RangeError(`mismatched image size. expected: ${a.length} but got: ${r*i*n}`)}else a=new Uint8Array(r*i*n);return t.width=r,t.height=i,t.data=a,t}function wC(t,{width:r,height:i},n){if(r===t.width&&i===t.height)return;let a=wD({},{width:r,height:i},n);wI(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,i)},n),t.width=r,t.height=i,t.data=a.data}function wI(t,r,i,n,a,o){if(0===a.width||0===a.height)return r;if(a.width>t.width||a.height>t.height||i.x>t.width-a.width||i.y>t.height-a.height)throw RangeError("out of range source coordinates for image copy");if(a.width>r.width||a.height>r.height||n.x>r.width-a.width||n.y>r.height-a.height)throw RangeError("out of range destination coordinates for image copy");let s=t.data,l=r.data;if(s===l)throw Error("srcData equals dstData, so image is already copied");for(let u=0;u{r[t.evaluationKey]=s;let l=t.expression.evaluate(r);a.setPixel(n/4/i,o/4,l)};if(t.clips)for(let r=0,a=0;r0)for(let a=r;a=r;a-=n)o=wQ(a/n|0,t[a],t[a+1],o);return o&&wY(o,o.next)&&(w0(o),o=o.next),o}function wj(t,r=t){let i=r===t,n=t,a;do a=!1,n!==n.next&&(0===Db.size||!Db.has(n))&&(wY(n,n.next)||0===wW(n.prev,n,n.next))?((i||n===r)&&(r=n.prev),D_=!0,w0(n),n=n.prev,a=!0):(i||n!==r)&&(n=n.next,a=!i);while(a||n!==r);return r}function wN(t,r){return t.x-r.x||t.y-r.y||(t.next.y-t.y)/(t.next.x-t.x)-(r.next.y-r.y)/(r.next.x-r.x)}function wV(t,r){let i=t;do{let t=DA++;DM[t]=i;let n=1/0,a=1/0,o=-1/0,s=-1/0,l=0;do{let r=i.next;i.z=t,i.xo&&(o=i.x),i.ys&&(s=i.y),r.xo&&(o=r.x),r.ys&&(s=r.y),i=r}while(++l<16&&i!==r);Dk[t]=i;let u=4*t;DT[u]=n,DT[u+1]=a,DT[u+2]=o,DT[u+3]=s}while(i!==r)}function wU(t){let r=Dk[t];for(;r.prev.next!==r;)r=r.next;return Dk[t]=r,r}function wq(t){let r=DM[t];for(;r.prev.next!==r;)r=r.next;return DM[t]=r,r}function wG(t,r,i,n,a,o){DI.fill(0);for(let r=0;r>>o&255]++;let s=0;for(let t=0;t<256;t++){let r=DI[t];DI[t]=s,s+=r}for(let s=0;s>>o&255]++;n[l]=r[s],a[l]=t}}function wH(t,r,i,n,a){return(t=((t=((t=((t=((t=(t-i)*a|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)|(r=((r=((r=((r=((r=(r-n)*a|0)|r<<8)&0xff00ff)|r<<4)&0xf0f0f0f)|r<<2)&0x33333333)|r<<1)&0x55555555)<<1}function w$(t,r,i,n,a,o,s,l){return(a-s)*(r-l)>=(t-s)*(o-l)&&(t-s)*(n-l)>=(i-s)*(r-l)&&(i-s)*(o-l)>=(a-s)*(n-l)}function wW(t,r,i){return(r.y-t.y)*(i.x-r.x)-(r.x-t.x)*(i.y-r.y)}function wY(t,r){return t.x===r.x&&t.y===r.y}function wZ(t,r,i,n,a=!0){let o=wW(t,r,i),s=wW(t,r,n),l=wW(i,n,t),u=wW(i,n,r);return(o>0&&s<0||o<0&&s>0)&&(l>0&&u<0||l<0&&u>0)||!!a&&!!(0===o&&wX(t,i,r)||0===s&&wX(t,n,r)||0===l&&wX(i,t,n)||0===u&&wX(i,r,n))}function wX(t,r,i){return r.x<=Math.max(t.x,i.x)&&r.x>=Math.min(t.x,i.x)&&r.y<=Math.max(t.y,i.y)&&r.y>=Math.min(t.y,i.y)}function wK(t,r){return 0>wW(t.prev,t,t.next)?wW(t,r,t.next)>=0&&wW(t,t.prev,r)>=0:0>wW(t,r,t.prev)||0>wW(t,t.next,r)}function wJ(t,r){let i=w1(t.i,t.x,t.y),n=w1(r.i,r.x,r.y),a=t.next,o=r.prev;return t.next=r,r.prev=t,i.next=a,a.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function wQ(t,r,i,n){let a=w1(t,r,i);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function w0(t){var r,i;let n;t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),Dw&&(r=t.prev,i=t.next,n=4*r.z,i.xDT[n+2]&&(DT[n+2]=i.x),i.y>DT[n+3]&&(DT[n+3]=i.y))}function w1(t,r,i){return{i:t,x:r,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function w2(t,r,i,n=!0){return new DR(i,r).subdividePolygonInternal(t,n)}function w3(t,r,i=!1){if(!t||t.length<1||t.length<2)return[];let n=t[0],a=t[t.length-1],o=i&&(n.x!==a.x||n.y!==a.y);if(r<2)return o?[...t,t[0]]:[...t];let s=Math.floor(Mf/r),l=[];l.push(new vu(t[0].x,t[0].y));let u=t.length,c=o?u:u-1;for(let r=0;r0?(Math.floor(v/s)+1)*s:(Math.ceil(v/s)-1)*s,r=m>0?(Math.floor(x/s)+1)*s:(Math.ceil(x/s)-1)*s,i=Math.abs(v-t),n=Math.abs(x-r),a=Math.abs(x-h),o=d?i/g:1/0,u=f?n/y:1/0;if((Math.abs(v-c)<=i||!d)&&(a<=n||!f))break;if(oED.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(r,i),u=l.count,g=!0,y=!0,v=!0,h=0);let b=w4(s,n,o,l,f,g,c),_=w4(s,n,o,l,p,y,c),w=w4(s,n,o,l,m,v,c);i.emplaceBack(h+b-u,h+_-u,h+w-u),c.primitiveLength++}})(r,i,n,a,o,t),h&&function(t,r,i,n,a,o){let s=[];for(let t=0;tED.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(r,i),u=l.count,m=!0,g=!0,h=0);let v=w4(s,n,o,l,f,m,c),x=w4(s,n,o,l,p,g,c);i.emplaceBack(h+v-u,h+x-u),c.primitiveLength++}}(s,i,l,a,u,t),r.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function w4(t,r,i,n,a,o,s){if(o){let o=n.count;return i(r[2*a],r[2*a+1]),t[a]=n.count,n.count++,s.vertexLength++,o}return t[a]}function w6(t,r){return t.x===r.x&&(t.x<0||t.x>8192)||t.y===r.y&&(t.y<0||t.y>8192)}function w8(t){return t.every(t=>t.x<0)||t.every(t=>t.x>8192)||t.every(t=>t.y<0)||t.every(t=>t.y>8192)}function w7(t){let r=t.length;if(r<=1)return[t];let i=[],n,a;for(let o=0;o(function(t,r){if(!t||t.length<3)return t;let i=t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y,n=i?t.length-1:t.length;if(n<3)return t;let a=[];for(let i=0;iMath.cos(5*Math.PI/180))return t.push(i.clone());let h=Math.min(a,.2*l,.2*u),d=i.add(o.mult(h)),f=i.add(s.mult(h)),p=Math.sqrt((1+c)/2),m=i.add(o.add(s)._unit()._mult(h/p)),g=d.sub(m).angleWith(f.sub(m)),y=Math.max(2,Math.ceil(Math.abs(g)/(Math.PI/6)-1e-6));for(let r=0;r<=y;r++)t.push(d.rotateAround(r/y*g,m))}(a,o,s,l,r)}let o=function(t){let r=[];for(let i of t){let t=i.round(),n=r[r.length-1];(n?.x!==t.x||n?.y!==t.y)&&r.push(t)}for(;r.length>1&&r[0].x===r[r.length-1].x&&r[0].y===r[r.length-1].y;)r.pop();return r}(a);return o.length<3?t:(i&&o.push(o[0].clone()),o)})(t,s))}function Td(t,r,i,n,a,o,s,l){t.emplaceBack(r,i,2*Math.floor(n*D3)+s,a*D3*2,o*D3*2,Math.round(l))}function Tf(t,r){return t.x*r.x+t.y*r.y}function Tp(t,r){if(1===t.length){let i=0,n=r[i++],a;for(;!a||n.equals(a);)if(!(a=r[i++]))return 1/0;for(;i=0&&(r=i[t],/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(r)||RegExp("^\\p{gc=Mc}","u").test(n))?i[t]+=n:i.push(n)}return i}function Tv(t){let r=t.codePointAt(0);return t.length>(r>65535?2:1)}function Tx(t){return/\s/u.test(String.fromCodePoint(t))}function Tb(t){for(let r of t)if(Tm(r.codePointAt(0)))return!0;return!1}function T_(t){return!(Tm(t)||/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(t)))}function Tw(t){return RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(t))}function TT(t){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(t))}function TA(t){for(let r of t)if(TT(r.codePointAt(0)))return!0;return!1}function TM(t,r,i,n,a,o){if("fontStack"in r){let n=i[r.fontStack],o=n?.[t];if(o)return o.metrics.advance*r.scale+a;let s=0;for(let i of t){let t=n?.[i];t&&(s+=t.metrics.advance*r.scale+a)}return s}{let t=n[r.imageName];return t?t.displaySize[0]*r.scale*24/o+a:0}}function Tk(t,r,i,n){let a=(t-r)**2;return n?tr>0&&rt-r),n=[];for(let t=0;t+1t.start))).map(([r,a])=>{var o,s;return function(t,r,i,n,a){let o=function(t,r,i,n){let a=[],o=i;for(let s of Ty(t.slice(i,n)))a.push({index:o,text:s,level:r[o]}),o+=s.length;return a}(t,r,n,a),s=!0;for(let t=o.length-1;t>=0;t--){let r=CI.getBidiCharTypeName(o[t].text[0]);Cz.has(r)?(o[t].level=i,s=!0):s&&CP.has(r)?o[t].level=i:s=!1}let l="",u=[];for(let t of function(t,r){let i=r,n=1/0;for(let{level:r}of t)r>i&&(i=r),(1|r)=n;t--)for(let r=0;r=t;)i++;for(let t=r,n=i;tr>=t.start&&r<=t.end))?void 0:o.level)?s:0,r,a)})}function TC(t,r,i){1===t&&i.readMessage(TI,r)}function TI(t,r,i){if(3===t){let{id:t,bitmap:n,width:a,height:o,left:s,top:l,advance:u}=i.readMessage(TL,{});r.push({id:t,bitmap:new Di({width:a+6,height:o+6},n),metrics:{width:a,height:o,left:s,top:l,advance:u}})}}function TL(t,r,i){1===t?r.id=i.readVarint():2===t?r.bitmap=i.readBytes():3===t?r.width=i.readVarint():4===t?r.height=i.readVarint():5===t?r.left=i.readSVarint():6===t?r.top=i.readSVarint():7===t&&(r.advance=i.readVarint())}function TP(t){return"function"==typeof t?.renderWithWebGL}function Tz(t){let r=0,i=0;for(let n of t)r+=n.w*n.h,i=Math.max(i,n.w);t.sort((t,r)=>r.h-t.h);let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(r/.95)),i),h:1/0}],a=0,o=0;for(let r of t)for(let t=n.length-1;t>=0;t--){let i=n[t];if(!(r.w>i.w||r.h>i.h)){if(r.x=i.x,r.y=i.y,o=Math.max(o,r.y+r.h),a=Math.max(a,r.x+r.w),r.w===i.w&&r.h===i.h){let r=n.pop();r&&t=i;t--)r.push(t);i=n+1}else{for(let t=i;tn[t]),r,o.map(t=>{var r;return null!=(r=i[a[t]])?r:0}))}function TB(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m){let g=CC.fromFeature(t,a);2===d&&g.verticalizePunctuation();let y=g.determineLineBreaks(c,o,r,n,p),v=TA(g.text)?function(t,r){var i;let n=r.map(r=>t.toCodeUnitIndex(r)),a=Cv.isParsed()?Cv:null;if(1===t.sections.length)return a?a.processBidirectionalText(t.toString(),n).map(r=>TR(r,t.sections,[...r].map(()=>0))):TD(t.toString(),n).map(t=>t.text).map(r=>TF([...r],t.sections,[...r].map(()=>0)));let o=function(t){let r=[],i=0;for(let n of t.graphemes())r.push(...Array(n.length).fill(t.sectionIndex[i])),i++;return r}(t);return a?a.processStyledBidirectionalText(t.text,o,n).map(([r,i])=>TR(r,t.sections,i)):(i=t.text,TD(i,n).map(t=>[t.text,t.sourceIndices.map(t=>{var r;return null!=(r=o[t])?r:0})])).map(([r,i])=>{let n=[...r];return TF(n,t.sections,TO(n).map(t=>{var r;return null!=(r=i[t])?r:0}))})}(g,y):function(t,r){let i=[],n=0;for(let a of r)i.push(t.substring(n,a)),n=a;return nt.codePointAt(0)),n=i.map(Tm),a=r=>!n[r]&&!Tx(i[r])&&!("imageName"in t.getSection(r));for(let t=0;tTV(t)||/[\p{P}\p{S}]/u.test(String.fromCodePoint(t))),i=t.length<=3&&t.every(t=>TU(t)||TV(t));return r||i}(i.slice(t,r+1)))for(let a=t;a<=r;a++){var o;n[a]=(TV(o=i[a])||TU(o))&&!Tw(o)}t=r}return function(t,r){let i=!1;for(let n=0;nd){let t=Math.ceil(o/d);a*=t/s,s=t}return{x1:n,y1:a,x2:n+o,y2:a+s}}function TG(t,r,i,n,a,o){let s=t.image,l;if(s.content){let t=s.content,r=s.pixelRatio||1;l=[t[0]/r,t[1]/r,s.displaySize[0]-t[2]/r,s.displaySize[1]-t[3]/r]}let u=r.left*o,c=r.right*o,h,d,f,p;"width"===i||"both"===i?(p=a[0]+u-n[3],d=a[0]+c+n[1]):d=(p=a[0]+(u+c-s.displaySize[0])/2)+s.displaySize[0];let m=r.top*o,g=r.bottom*o;return"height"===i||"both"===i?(h=a[1]+m-n[0],f=a[1]+g+n[2]):f=(h=a[1]+(m+g-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:h,right:d,bottom:f,left:p,collisionPadding:l}}function TH(t,r){let{expression:i}=r;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Sc(t+1))};if("source"===i.kind)return{kind:"source"};if("composite"===i.kind){let{minZoom:r,maxZoom:n}=function(t,r){let i=0;for(;in.evaluate(new Sc(t===-1/0?n.zoomStops[1]-1:t))),a=i.evaluate(new Sc(t+1));return{kind:"camera",zoomStops:i.zoomStops,sizes:r,layoutSize:a,interpolationType:i.interpolationType}}}function T$(t,{uSize:r,uSizeT:i},{lowerSize:n,upperSize:a}){return"source"===t.kind?n/128:"composite"===t.kind?kx.number(n/128,a/128,i):r}function TW(t,r){let i=0,n=0;return"constant"===t.kind?n=t.layoutSize:"camera"===t.kind?n=function({zoomStops:t,sizes:r,layoutSize:i,interpolationType:n},a){let o=t.length-1;for(;o>0&&t[o]>a;)o--;let s=Math.min(o+1,t.length-1),l=n?xr(kv.interpolationFactor(n,a,t[o],t[s]),0,1):0;return Math.min(kx.number(r[o],r[s],l),i)}(t,r):"composite"===t.kind&&(i=function({interpolationType:t,minZoom:r,maxZoom:i},n){return t?xr(kv.interpolationFactor(t,n,r,i),0,1):0}(t,r)),{uSizeT:i,uSize:n}}function TY(t,r,i,n,a){if(void 0===r.segment||0===i)return!0;let o=r,s=r.segment+1,l=0;for(;l>-i/2;){if(--s<0)return!1;l-=t[s].dist(o),o=t[s]}l+=t[s].dist(t[s+1]),s++;let u=[],c=0;for(;ln;)c-=u.shift().angleDelta;if(c>a)return!1;s++,l+=i.dist(o)}return!0}function TZ(t){let r=0;for(let i=0;i=n&&c.x>=n)&&(u.x>=n?u=new vu(n,u.y+(c.y-u.y)*((n-u.x)/(c.x-u.x)))._round():c.x>=n&&(c=new vu(n,u.y+(c.y-u.y)*((n-u.x)/(c.x-u.x)))._round()),u.y>=a&&c.y>=a||(u.y>=a?u=new vu(u.x+(c.x-u.x)*((a-u.y)/(c.y-u.y)),a)._round():c.y>=a&&(c=new vu(u.x+(c.x-u.x)*((a-u.y)/(c.y-u.y)),a)._round()),t&&u.equals(t[t.length-1])||(t=[u],o.push(t)),t.push(c)))))}}return o}function TJ(t,r,i,n){let a=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,u=o.paddedRect.h-2,c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=o.stretchX||[[0,l]],d=o.stretchY||[[0,u]],f=(t,r)=>t+r[1]-r[0],p=h.reduce(f,0),m=d.reduce(f,0),g=l-p,y=u-m,v=0,x=p,b=0,_=m,w=0,T=g,A=0,M=y;if(o.content&&n){let r=o.content,i=r[2]-r[0],n=r[3]-r[1];(o.textFitWidth||o.textFitHeight)&&(c=Tq(t)),v=TQ(h,0,r[0]),b=TQ(d,0,r[1]),x=TQ(h,r[0],r[2]),_=TQ(d,r[1],r[3]),w=r[0]-v,A=r[1]-b,T=i-x,M=n-_}let k=c.x1,S=c.y1,E=c.x2-k,D=c.y2-S,C=(t,n,a,l)=>{var u,c,h,d,f,g,y,C,I,L,P,z,F,O,R,B;let j=(u=t.stretch-v,u/x*E+k),N=(c=t.fixed-w,h=T,d=t.stretch,c-h*d/p),V=(f=n.stretch-b,f/_*D+S),U=(g=n.fixed-A,y=M,C=n.stretch,g-y*C/m),q=(I=a.stretch-v,I/x*E+k),G=(L=a.fixed-w,P=T,z=a.stretch,L-P*z/p),H=(F=l.stretch-b,F/_*D+S),$=(O=l.fixed-A,R=M,B=l.stretch,O-R*B/m),W=new vu(j,V),Y=new vu(q,V),Z=new vu(q,H),X=new vu(j,H),K=new vu(N/s,U/s),J=new vu(G/s,$/s),Q=r*Math.PI/180;if(Q){let t=Math.sin(Q),r=Math.cos(Q),i=[r,-t,t,r];W._matMult(i),Y._matMult(i),X._matMult(i),Z._matMult(i)}let ee=t.stretch+t.fixed,et=a.stretch+a.fixed,er=n.stretch+n.fixed,ei=l.stretch+l.fixed;return{tl:W,tr:Y,bl:X,br:Z,tex:{x:o.paddedRect.x+1+ee,y:o.paddedRect.y+1+er,w:et-ee,h:ei-er},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:K,pixelOffsetBR:J,minFontScaleX:T/s/E,minFontScaleY:M/s/D,isSDF:i}};if(n&&(o.stretchX||o.stretchY)){let t=T0(h,g,p),r=T0(d,y,m);for(let i=0;i24*t);n.startsWith("top")?a[1]-=7:n.startsWith("bottom")&&(a[1]+=7),r[i+1]=a}return new kc(r)}let s=a.get("text-variable-anchor");if(s){let n;n=void 0===t._unevaluatedLayout.getValue("text-radial-offset")?a.get("text-offset").evaluate(r,{},i).map(t=>24*t):[24*a.get("text-radial-offset").evaluate(r,{},i),CW];let o=[];for(let t of s)o.push(t,T2(t,n));return new kc(o)}return null}function T5(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function T4(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g){let y=function(t,r,i,n,a,o,s){let l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let i of t.positionedLines)for(let a of i.positionedGlyphs){if(!a.rect)continue;let c=a.rect||{},h=4,d=!0,f=1,p=0,m=(n||s)&&a.vertical,g=a.metrics.advance*a.scale/2;if(s&&t.verticalizable){let t=(a.scale-1)*24,r=(24-a.metrics.width*a.scale)/2;p=i.lineOffset/2-(a.imageName?-r:t)}if(a.imageName){let t=o[a.imageName];d=t.sdf,h=1/(f=t.pixelRatio)}let y=n?[a.x+g,a.y]:[0,0],v=n?[0,0]:[a.x+g+r[0],a.y+r[1]-p],x=[0,0];m&&(x=v,v=[0,0]);let b=a.metrics.isDoubleResolution?2:1,_=(a.metrics.left-h)*a.scale-g+v[0],w=(-a.metrics.top-h)*a.scale+v[1],T=_+c.w/b*a.scale/f,A=w+c.h/b*a.scale/f,M=new vu(_,w),k=new vu(T,w),S=new vu(_,A),E=new vu(T,A);if(m){let t=new vu(-g,g- -17),r=-Math.PI/2,i=12-g,n=a.imageName?i:0,o=new vu(22-i,-n),s=new vu(...x);M._rotateAround(r,t)._add(o)._add(s),k._rotateAround(r,t)._add(o)._add(s),S._rotateAround(r,t)._add(o)._add(s),E._rotateAround(r,t)._add(o)._add(s)}if(l){let t=Math.sin(l),r=Math.cos(l),i=[r,-t,t,r];M._matMult(i),k._matMult(i),S._matMult(i),E._matMult(i)}let D=new vu(0,0),C=new vu(0,0);u.push({tl:M,tr:k,bl:S,br:E,tex:c,writingMode:t.writingMode,glyphOffset:y,sectionIndex:a.sectionIndex,isSDF:d,pixelOffsetTL:D,pixelOffsetBR:C,minFontScaleX:0,minFontScaleY:0})}return u}(i,l,a,o,s,n,t.allowVerticalPlacement),v=t.textSizeData,x=null;for(let i of("source"===v.kind?(x=[128*a.layout.get("text-size").evaluate(s,{})])[0]>32640&&xf(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`):"composite"===v.kind&&((x=[128*m.compositeTextSizes[0].evaluate(s,{},g),128*m.compositeTextSizes[1].evaluate(s,{},g)])[0]>32640||x[1]>32640)&&xf(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`),t.addSymbols(t.text,y,x,l,o,s,h,r,c.lineStartIndex,c.lineLength,p,g,u),d))f[i]=t.text.placedSymbolArray.length-1;return 4*y.length}function T6(t){for(let r in t)return t[r];return null}function T8(t,r,i){let n="never",a=t.get(r);return a?n=a:t.get(i)&&(n="always"),n}function T7(t,r,i,n,a,o,s,l,u,c,h,d,f,p){let m=l?Math.min(CV,Math.round(l[0])):0,g=l?Math.min(CV,Math.round(l[1])):0;t.emplaceBack(r,i,Math.round(32*n),Math.round(32*a),o,s,(m<<1)+ +!!u,g,16*c,16*h,256*d,256*f,p)}function T9(t,r,i){t.emplaceBack(r.x,r.y,i),t.emplaceBack(r.x,r.y,i),t.emplaceBack(r.x,r.y,i),t.emplaceBack(r.x,r.y,i)}function Ae(t,r){if("custom"===t.type)return new C9(t,r);switch(t.type){case"background":return new C8(t,r);case"circle":return new E9(t,r);case"color-relief":return new Dy(t,r);case"fill":return new Dq(t,r);case"fill-extrusion":return new D9(t,r);case"heatmap":return new Ds(t,r);case"hillshade":return new Dh(t,r);case"line":return new Cd(t,r);case"raster":return new SI(t,r);case"symbol":return new C3(t,r)}}function At(t,r){let{x:i,y:n}=D1.fromLngLat(r);return!(t<0||t>25||n<0||n>=1||i<0||i>=1)}function Ar(t,r,i,n,a){(t*=2)<0&&(t=-1*t-1);let o=1<>>2),exceptionSizes:new Int32Array(33)}}function Ao(t,r,i){let n=new Uint32Array(i),a=0,o=r.get();for(let r=0;r=64)throw Error("Varint too long")}return r.set(a),i}(t,r);return n}function Al(t){return t>>>1^-(1&t)}function Au(t){return t>>BigInt("1")^-(t&BigInt("1"))}function Ac(t){return t%2==1?-((t+1)/2):t/2}function Ah(t,r,i){if(void 0===i){i=0;for(let n=0;n=4)for(;n=4)for(;n=4)for(let n=t[0];i=4)for(;u>>0;for(let i=1;i>>0;return r}function Ab(t){let r=new BigUint64Array(t.length);r[0]=BigInt.asUintN(64,Au(t[0]));for(let i=1;i>4],a={};switch(n){case IC.DATA:a={dictionaryType:IR[15&i]};break;case IC.OFFSET:a={offsetType:IB[15&i]};break;case IC.LENGTH:a={lengthType:Ij[15&i]}}r.increment();let o=t[r.get()],s=IF[o>>5],l=IF[o>>2&7],u=IO[3&o];r.increment();let c=Ao(t,r,2),h=c[0];return{physicalStreamType:n,logicalStreamType:a,logicalLevelTechnique1:s,logicalLevelTechnique2:l,physicalLevelTechnique:u,numValues:h,byteLength:c[1],decompressedCount:h}}(t,r);return s.logicalLevelTechnique1===IT.MORTON?(i=s,a=Ao(t,r,2),{physicalStreamType:i.physicalStreamType,logicalStreamType:i.logicalStreamType,logicalLevelTechnique1:i.logicalLevelTechnique1,logicalLevelTechnique2:i.logicalLevelTechnique2,physicalLevelTechnique:i.physicalLevelTechnique,numValues:i.numValues,byteLength:i.byteLength,decompressedCount:i.decompressedCount,numBits:a[0],coordinateShift:a[1]}):(IT.RLE===s.logicalLevelTechnique1||IT.RLE===s.logicalLevelTechnique2)&&IA.NONE!==s.physicalLevelTechnique?(n=s,o=Ao(t,r,2),{physicalStreamType:n.physicalStreamType,logicalStreamType:n.logicalStreamType,logicalLevelTechnique1:n.logicalLevelTechnique1,logicalLevelTechnique2:n.logicalLevelTechnique2,physicalLevelTechnique:n.physicalLevelTechnique,numValues:n.numValues,byteLength:n.byteLength,decompressedCount:o[1],runs:o[0],numRleValues:o[1]}):s}function Aw(t,r,i){if(!r)return t;let n=r.size(),a=new t.constructor(n),o=0;for(let s=0;s=s);){let i=t[n.increment()];if(i<=127){let s=i+3,l=t[n.increment()],u=Math.min(o+s,r);a.fill(l,o,u),o=u}else{let s=256-i;for(let i=0;i=12?IU.decode(t.subarray(r,i)):function(t,r,i){let n="",a=r;for(;a239?4:l>223?3:l>191?2:1;if(a+c>i)break;1===c?l<128&&(u=l):2===c?(192&(r=t[a+1]))==128&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===c?(r=t[a+1],o=t[a+2],(192&r)==128&&(192&o)==128&&((u=(15&l)<<12|(63&r)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(r=t[a+1],o=t[a+2],s=t[a+3],(192&r)==128&&(192&o)==128&&(192&s)==128&&((u=(15&l)<<18|(63&r)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),a+=c}return n}(t,r,i)}function AE(t,r,i,n,a){let o;var s=AI(t,r,i),l=i,u=n,c=a;switch(l.logicalLevelTechnique1){case IT.DELTA:if(l.logicalLevelTechnique2===IT.RLE){if(!c)return function(t,r,i){let n=new Int32Array(i),a=0,o=0;for(let i=0;i=4)for(;n>>0,r[1]=Al(t[1])>>>0;for(let i=2;i>>0,r[i+1]=r[i-1]+Al(t[i+1])>>>0;return r}(t);break;case IT.NONE:a=t;break;default:throw Error(`The specified Logical level technique is not supported: ${r.logicalLevelTechnique1}`)}return n?Aw(a,n,0):a}(AI(t,r,i),i,n,a)}function AC(t,r,i){return function(t,r){if(r.logicalLevelTechnique1===IT.DELTA&&r.logicalLevelTechnique2===IT.NONE){let r=new Int32Array(t.length+1);r[0]=0,r[1]=Al(t[0]);let i=r[1];for(let n=2;n!==r.length;++n)i+=Al(t[n-1]),r[n]=r[n-1]+i;return new Uint32Array(r)}if(r.logicalLevelTechnique1===IT.RLE&&r.logicalLevelTechnique2===IT.NONE)return function(t,r,i){let n=new Uint32Array(i+1);n[0]=0;let a=1,o=n[0];for(let i=0;i>>2,l=function(t,r){if(r<=t.encodedWords.length)return t.encodedWords;let i=new Uint32Array(Math.max(16,2*r));return t.encodedWords=i,i}(a,s);!function(t,r,i,n){if(r<0||i<0||r+i>t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${r}, byteLength=${i}, bytes.length=${t.length})`);let a=Math.floor(i/4),o=i%4!=0,s=o?a+1:a;if(n.length0){let i=t.byteOffset+r;if(3&i)for(let i=0;i>>0;return((255&r)<<24|(65280&r)<<8|r>>>8&65280|r>>>24&255)>>>0}(r[t])}}if(o){let o=r+4*a,s=i-4*a,l=0;for(let r=0;r0){let r=0|t[n];if(n=n+1|0,255&r)throw Error(`FastPFOR decode: invalid alignedLength=${r} (expected multiple of 256)`);if(a+r>o.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${a}, alignedLength=${r}, out.length=${o.length})`);n=function(t,r,i,n,a,o){let s=n+(a-a%256),l=n,u=i;for(;l!==s;){let i=Math.min(IE,s-l);u=function(t,r,i,n,a,o){let s=0|i,l=0|t[s];if(l<=0||s+l>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${l} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let u=s+l|0,c=t[u]>>>0,h=c+3>>>2,d=u+1,f=d+h;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${c} (metaInts=${h}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${d}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let p=function(t,r,i,n){n.byteContainer.length>>2;if(3&a.byteOffset)for(let i=0;i>>8&255,a[o+2|0]=n>>>16&255,a[o+3|0]=n>>>24&255}else{let i=n.byteContainerI32;(!i||i.buffer!==a.buffer||i.byteOffset!==a.byteOffset||i.length>>2)),i.set(t.subarray(r,r+o))}let s=3&i;if(s>0){let i=0|t[r+o|0],n=o<<2;for(let t=0;t>>(t<<3)&255}return a}(t,d,c,o),m=function(t,r,i){let n=0|t[r++],a=i.dataToBePacked;for(let o=2;o<=32;o=o+1|0){if(!(n>>>o-1&1))continue;if(r>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${o}, streamWordIndex=${r}, needWords=1, availableWords=${t.length-r}, encodedWords=${t.length})`);let s=t[r++]>>>0,l=function(t){var r;return(r=t+31)-r%32}(s),u=s*o+31>>>5;if(r+u>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${o}, size=${s}, streamWordIndex=${r}, needWords=${u}, availableWords=${t.length-r}, encodedWords=${t.length})`);let c=a[o];(!c||c.length>>0,l=t[r+1]>>>0,i[o++]=s>>>0&3,i[o++]=s>>>2&3,i[o++]=s>>>4&3,i[o++]=s>>>6&3,i[o++]=s>>>8&3,i[o++]=s>>>10&3,i[o++]=s>>>12&3,i[o++]=s>>>14&3,i[o++]=s>>>16&3,i[o++]=s>>>18&3,i[o++]=s>>>20&3,i[o++]=s>>>22&3,i[o++]=s>>>24&3,i[o++]=s>>>26&3,i[o++]=s>>>28&3,i[o++]=s>>>30&3,i[o++]=l>>>0&3,i[o++]=l>>>2&3,i[o++]=l>>>4&3,i[o++]=l>>>6&3,i[o++]=l>>>8&3,i[o++]=l>>>10&3,i[o++]=l>>>12&3,i[o++]=l>>>14&3,i[o++]=l>>>16&3,i[o++]=l>>>18&3,i[o++]=l>>>20&3,i[o++]=l>>>22&3,i[o++]=l>>>24&3,i[o++]=l>>>26&3,i[o++]=l>>>28&3,i[o]=l>>>30&3;return;case 3:let u,c,h,d;u=n,c=t[r]>>>0,h=t[r+1]>>>0,d=t[r+2]>>>0,i[u++]=c>>>0&7,i[u++]=c>>>3&7,i[u++]=c>>>6&7,i[u++]=c>>>9&7,i[u++]=c>>>12&7,i[u++]=c>>>15&7,i[u++]=c>>>18&7,i[u++]=c>>>21&7,i[u++]=c>>>24&7,i[u++]=c>>>27&7,i[u++]=(c>>>30|(1&h)<<2)&7,i[u++]=h>>>1&7,i[u++]=h>>>4&7,i[u++]=h>>>7&7,i[u++]=h>>>10&7,i[u++]=h>>>13&7,i[u++]=h>>>16&7,i[u++]=h>>>19&7,i[u++]=h>>>22&7,i[u++]=h>>>25&7,i[u++]=h>>>28&7,i[u++]=(h>>>31|(3&d)<<1)&7,i[u++]=d>>>2&7,i[u++]=d>>>5&7,i[u++]=d>>>8&7,i[u++]=d>>>11&7,i[u++]=d>>>14&7,i[u++]=d>>>17&7,i[u++]=d>>>20&7,i[u++]=d>>>23&7,i[u++]=d>>>26&7,i[u]=d>>>29&7;return;case 4:let f,p,m,g,y;f=n,p=t[r]>>>0,m=t[r+1]>>>0,g=t[r+2]>>>0,y=t[r+3]>>>0,i[f++]=p>>>0&15,i[f++]=p>>>4&15,i[f++]=p>>>8&15,i[f++]=p>>>12&15,i[f++]=p>>>16&15,i[f++]=p>>>20&15,i[f++]=p>>>24&15,i[f++]=p>>>28&15,i[f++]=m>>>0&15,i[f++]=m>>>4&15,i[f++]=m>>>8&15,i[f++]=m>>>12&15,i[f++]=m>>>16&15,i[f++]=m>>>20&15,i[f++]=m>>>24&15,i[f++]=m>>>28&15,i[f++]=g>>>0&15,i[f++]=g>>>4&15,i[f++]=g>>>8&15,i[f++]=g>>>12&15,i[f++]=g>>>16&15,i[f++]=g>>>20&15,i[f++]=g>>>24&15,i[f++]=g>>>28&15,i[f++]=y>>>0&15,i[f++]=y>>>4&15,i[f++]=y>>>8&15,i[f++]=y>>>12&15,i[f++]=y>>>16&15,i[f++]=y>>>20&15,i[f++]=y>>>24&15,i[f]=y>>>28&15;return;case 5:let v,x,b,_,w,T;v=n,x=t[r]>>>0,b=t[r+1]>>>0,_=t[r+2]>>>0,w=t[r+3]>>>0,T=t[r+4]>>>0,i[v++]=x>>>0&31,i[v++]=x>>>5&31,i[v++]=x>>>10&31,i[v++]=x>>>15&31,i[v++]=x>>>20&31,i[v++]=x>>>25&31,i[v++]=(x>>>30|(7&b)<<2)&31,i[v++]=b>>>3&31,i[v++]=b>>>8&31,i[v++]=b>>>13&31,i[v++]=b>>>18&31,i[v++]=b>>>23&31,i[v++]=(b>>>28|(1&_)<<4)&31,i[v++]=_>>>1&31,i[v++]=_>>>6&31,i[v++]=_>>>11&31,i[v++]=_>>>16&31,i[v++]=_>>>21&31,i[v++]=_>>>26&31,i[v++]=(_>>>31|(15&w)<<1)&31,i[v++]=w>>>4&31,i[v++]=w>>>9&31,i[v++]=w>>>14&31,i[v++]=w>>>19&31,i[v++]=w>>>24&31,i[v++]=(w>>>29|(3&T)<<3)&31,i[v++]=T>>>2&31,i[v++]=T>>>7&31,i[v++]=T>>>12&31,i[v++]=T>>>17&31,i[v++]=T>>>22&31,i[v]=T>>>27&31;return;case 6:let A,M,k,S,E,D,C;A=n,M=t[r]>>>0,k=t[r+1]>>>0,S=t[r+2]>>>0,E=t[r+3]>>>0,D=t[r+4]>>>0,C=t[r+5]>>>0,i[A++]=M>>>0&63,i[A++]=M>>>6&63,i[A++]=M>>>12&63,i[A++]=M>>>18&63,i[A++]=M>>>24&63,i[A++]=(M>>>30|(15&k)<<2)&63,i[A++]=k>>>4&63,i[A++]=k>>>10&63,i[A++]=k>>>16&63,i[A++]=k>>>22&63,i[A++]=(k>>>28|(3&S)<<4)&63,i[A++]=S>>>2&63,i[A++]=S>>>8&63,i[A++]=S>>>14&63,i[A++]=S>>>20&63,i[A++]=S>>>26&63,i[A++]=E>>>0&63,i[A++]=E>>>6&63,i[A++]=E>>>12&63,i[A++]=E>>>18&63,i[A++]=E>>>24&63,i[A++]=(E>>>30|(15&D)<<2)&63,i[A++]=D>>>4&63,i[A++]=D>>>10&63,i[A++]=D>>>16&63,i[A++]=D>>>22&63,i[A++]=(D>>>28|(3&C)<<4)&63,i[A++]=C>>>2&63,i[A++]=C>>>8&63,i[A++]=C>>>14&63,i[A++]=C>>>20&63,i[A]=C>>>26&63;return;case 7:let I,L,P,z,F,O,R,B;I=n,L=t[r]>>>0,P=t[r+1]>>>0,z=t[r+2]>>>0,F=t[r+3]>>>0,O=t[r+4]>>>0,R=t[r+5]>>>0,B=t[r+6]>>>0,i[I++]=L>>>0&127,i[I++]=L>>>7&127,i[I++]=L>>>14&127,i[I++]=L>>>21&127,i[I++]=(L>>>28|(7&P)<<4)&127,i[I++]=P>>>3&127,i[I++]=P>>>10&127,i[I++]=P>>>17&127,i[I++]=P>>>24&127,i[I++]=(P>>>31|(63&z)<<1)&127,i[I++]=z>>>6&127,i[I++]=z>>>13&127,i[I++]=z>>>20&127,i[I++]=(z>>>27|(3&F)<<5)&127,i[I++]=F>>>2&127,i[I++]=F>>>9&127,i[I++]=F>>>16&127,i[I++]=F>>>23&127,i[I++]=(F>>>30|(31&O)<<2)&127,i[I++]=O>>>5&127,i[I++]=O>>>12&127,i[I++]=O>>>19&127,i[I++]=(O>>>26|(1&R)<<6)&127,i[I++]=R>>>1&127,i[I++]=R>>>8&127,i[I++]=R>>>15&127,i[I++]=R>>>22&127,i[I++]=(R>>>29|(15&B)<<3)&127,i[I++]=B>>>4&127,i[I++]=B>>>11&127,i[I++]=B>>>18&127,i[I]=B>>>25&127;return;case 8:let j,N,V,U,q,G,H,$,W;j=n,N=t[r]>>>0,V=t[r+1]>>>0,U=t[r+2]>>>0,q=t[r+3]>>>0,G=t[r+4]>>>0,H=t[r+5]>>>0,$=t[r+6]>>>0,W=t[r+7]>>>0,i[j++]=N>>>0&255,i[j++]=N>>>8&255,i[j++]=N>>>16&255,i[j++]=N>>>24&255,i[j++]=V>>>0&255,i[j++]=V>>>8&255,i[j++]=V>>>16&255,i[j++]=V>>>24&255,i[j++]=U>>>0&255,i[j++]=U>>>8&255,i[j++]=U>>>16&255,i[j++]=U>>>24&255,i[j++]=q>>>0&255,i[j++]=q>>>8&255,i[j++]=q>>>16&255,i[j++]=q>>>24&255,i[j++]=G>>>0&255,i[j++]=G>>>8&255,i[j++]=G>>>16&255,i[j++]=G>>>24&255,i[j++]=H>>>0&255,i[j++]=H>>>8&255,i[j++]=H>>>16&255,i[j++]=H>>>24&255,i[j++]=$>>>0&255,i[j++]=$>>>8&255,i[j++]=$>>>16&255,i[j++]=$>>>24&255,i[j++]=W>>>0&255,i[j++]=W>>>8&255,i[j++]=W>>>16&255,i[j]=W>>>24&255;return;case 9:let Y,Z,X,K,J,Q,ee,et,er,ei;Y=n,Z=t[r]>>>0,X=t[r+1]>>>0,K=t[r+2]>>>0,J=t[r+3]>>>0,Q=t[r+4]>>>0,ee=t[r+5]>>>0,et=t[r+6]>>>0,er=t[r+7]>>>0,ei=t[r+8]>>>0,i[Y++]=Z>>>0&511,i[Y++]=Z>>>9&511,i[Y++]=Z>>>18&511,i[Y++]=(Z>>>27|(15&X)<<5)&511,i[Y++]=X>>>4&511,i[Y++]=X>>>13&511,i[Y++]=X>>>22&511,i[Y++]=(X>>>31|(255&K)<<1)&511,i[Y++]=K>>>8&511,i[Y++]=K>>>17&511,i[Y++]=(K>>>26|(7&J)<<6)&511,i[Y++]=J>>>3&511,i[Y++]=J>>>12&511,i[Y++]=J>>>21&511,i[Y++]=(J>>>30|(127&Q)<<2)&511,i[Y++]=Q>>>7&511,i[Y++]=Q>>>16&511,i[Y++]=(Q>>>25|(3&ee)<<7)&511,i[Y++]=ee>>>2&511,i[Y++]=ee>>>11&511,i[Y++]=ee>>>20&511,i[Y++]=(ee>>>29|(63&et)<<3)&511,i[Y++]=et>>>6&511,i[Y++]=et>>>15&511,i[Y++]=(et>>>24|(1&er)<<8)&511,i[Y++]=er>>>1&511,i[Y++]=er>>>10&511,i[Y++]=er>>>19&511,i[Y++]=(er>>>28|(31&ei)<<4)&511,i[Y++]=ei>>>5&511,i[Y++]=ei>>>14&511,i[Y]=ei>>>23&511;return;case 10:let en,ea,eo,es,el,eu,ec,eh,ed,ef,ep;en=n,ea=t[r]>>>0,eo=t[r+1]>>>0,es=t[r+2]>>>0,el=t[r+3]>>>0,eu=t[r+4]>>>0,ec=t[r+5]>>>0,eh=t[r+6]>>>0,ed=t[r+7]>>>0,ef=t[r+8]>>>0,ep=t[r+9]>>>0,i[en++]=ea>>>0&1023,i[en++]=ea>>>10&1023,i[en++]=ea>>>20&1023,i[en++]=(ea>>>30|(255&eo)<<2)&1023,i[en++]=eo>>>8&1023,i[en++]=eo>>>18&1023,i[en++]=(eo>>>28|(63&es)<<4)&1023,i[en++]=es>>>6&1023,i[en++]=es>>>16&1023,i[en++]=(es>>>26|(15&el)<<6)&1023,i[en++]=el>>>4&1023,i[en++]=el>>>14&1023,i[en++]=(el>>>24|(3&eu)<<8)&1023,i[en++]=eu>>>2&1023,i[en++]=eu>>>12&1023,i[en++]=eu>>>22&1023,i[en++]=ec>>>0&1023,i[en++]=ec>>>10&1023,i[en++]=ec>>>20&1023,i[en++]=(ec>>>30|(255&eh)<<2)&1023,i[en++]=eh>>>8&1023,i[en++]=eh>>>18&1023,i[en++]=(eh>>>28|(63&ed)<<4)&1023,i[en++]=ed>>>6&1023,i[en++]=ed>>>16&1023,i[en++]=(ed>>>26|(15&ef)<<6)&1023,i[en++]=ef>>>4&1023,i[en++]=ef>>>14&1023,i[en++]=(ef>>>24|(3&ep)<<8)&1023,i[en++]=ep>>>2&1023,i[en++]=ep>>>12&1023,i[en]=ep>>>22&1023;return;case 11:let em,eg,ey,ev,ex,eb,e_,ew,eT,eA,eM,ek;em=n,eg=t[r]>>>0,ey=t[r+1]>>>0,ev=t[r+2]>>>0,ex=t[r+3]>>>0,eb=t[r+4]>>>0,e_=t[r+5]>>>0,ew=t[r+6]>>>0,eT=t[r+7]>>>0,eA=t[r+8]>>>0,eM=t[r+9]>>>0,ek=t[r+10]>>>0,i[em++]=eg>>>0&2047,i[em++]=eg>>>11&2047,i[em++]=(eg>>>22|(1&ey)<<10)&2047,i[em++]=ey>>>1&2047,i[em++]=ey>>>12&2047,i[em++]=(ey>>>23|(3&ev)<<9)&2047,i[em++]=ev>>>2&2047,i[em++]=ev>>>13&2047,i[em++]=(ev>>>24|(7&ex)<<8)&2047,i[em++]=ex>>>3&2047,i[em++]=ex>>>14&2047,i[em++]=(ex>>>25|(15&eb)<<7)&2047,i[em++]=eb>>>4&2047,i[em++]=eb>>>15&2047,i[em++]=(eb>>>26|(31&e_)<<6)&2047,i[em++]=e_>>>5&2047,i[em++]=e_>>>16&2047,i[em++]=(e_>>>27|(63&ew)<<5)&2047,i[em++]=ew>>>6&2047,i[em++]=ew>>>17&2047,i[em++]=(ew>>>28|(127&eT)<<4)&2047,i[em++]=eT>>>7&2047,i[em++]=eT>>>18&2047,i[em++]=(eT>>>29|(255&eA)<<3)&2047,i[em++]=eA>>>8&2047,i[em++]=eA>>>19&2047,i[em++]=(eA>>>30|(511&eM)<<2)&2047,i[em++]=eM>>>9&2047,i[em++]=eM>>>20&2047,i[em++]=(eM>>>31|(1023&ek)<<1)&2047,i[em++]=ek>>>10&2047,i[em]=ek>>>21&2047;return;case 12:let eS,eE,eD,eC,eI,eL,eP,ez,eF,eO,eR,eB,ej;eS=n,eE=t[r]>>>0,eD=t[r+1]>>>0,eC=t[r+2]>>>0,eI=t[r+3]>>>0,eL=t[r+4]>>>0,eP=t[r+5]>>>0,ez=t[r+6]>>>0,eF=t[r+7]>>>0,eO=t[r+8]>>>0,eR=t[r+9]>>>0,eB=t[r+10]>>>0,ej=t[r+11]>>>0,i[eS++]=eE>>>0&4095,i[eS++]=eE>>>12&4095,i[eS++]=(eE>>>24|(15&eD)<<8)&4095,i[eS++]=eD>>>4&4095,i[eS++]=eD>>>16&4095,i[eS++]=(eD>>>28|(255&eC)<<4)&4095,i[eS++]=eC>>>8&4095,i[eS++]=eC>>>20&4095,i[eS++]=eI>>>0&4095,i[eS++]=eI>>>12&4095,i[eS++]=(eI>>>24|(15&eL)<<8)&4095,i[eS++]=eL>>>4&4095,i[eS++]=eL>>>16&4095,i[eS++]=(eL>>>28|(255&eP)<<4)&4095,i[eS++]=eP>>>8&4095,i[eS++]=eP>>>20&4095,i[eS++]=ez>>>0&4095,i[eS++]=ez>>>12&4095,i[eS++]=(ez>>>24|(15&eF)<<8)&4095,i[eS++]=eF>>>4&4095,i[eS++]=eF>>>16&4095,i[eS++]=(eF>>>28|(255&eO)<<4)&4095,i[eS++]=eO>>>8&4095,i[eS++]=eO>>>20&4095,i[eS++]=eR>>>0&4095,i[eS++]=eR>>>12&4095,i[eS++]=(eR>>>24|(15&eB)<<8)&4095,i[eS++]=eB>>>4&4095,i[eS++]=eB>>>16&4095,i[eS++]=(eB>>>28|(255&ej)<<4)&4095,i[eS++]=ej>>>8&4095,i[eS]=ej>>>20&4095;return;case 16:let eN,eV,eU,eq,eG,eH,e$,eW,eY,eZ,eX,eK,eJ,eQ,e0,e1,e2;eN=n,eV=t[r]>>>0,eU=t[r+1]>>>0,eq=t[r+2]>>>0,eG=t[r+3]>>>0,eH=t[r+4]>>>0,e$=t[r+5]>>>0,eW=t[r+6]>>>0,eY=t[r+7]>>>0,eZ=t[r+8]>>>0,eX=t[r+9]>>>0,eK=t[r+10]>>>0,eJ=t[r+11]>>>0,eQ=t[r+12]>>>0,e0=t[r+13]>>>0,e1=t[r+14]>>>0,e2=t[r+15]>>>0,i[eN++]=eV>>>0&65535,i[eN++]=eV>>>16&65535,i[eN++]=eU>>>0&65535,i[eN++]=eU>>>16&65535,i[eN++]=eq>>>0&65535,i[eN++]=eq>>>16&65535,i[eN++]=eG>>>0&65535,i[eN++]=eG>>>16&65535,i[eN++]=eH>>>0&65535,i[eN++]=eH>>>16&65535,i[eN++]=e$>>>0&65535,i[eN++]=e$>>>16&65535,i[eN++]=eW>>>0&65535,i[eN++]=eW>>>16&65535,i[eN++]=eY>>>0&65535,i[eN++]=eY>>>16&65535,i[eN++]=eZ>>>0&65535,i[eN++]=eZ>>>16&65535,i[eN++]=eX>>>0&65535,i[eN++]=eX>>>16&65535,i[eN++]=eK>>>0&65535,i[eN++]=eK>>>16&65535,i[eN++]=eJ>>>0&65535,i[eN++]=eJ>>>16&65535,i[eN++]=eQ>>>0&65535,i[eN++]=eQ>>>16&65535,i[eN++]=e0>>>0&65535,i[eN++]=e0>>>16&65535,i[eN++]=e1>>>0&65535,i[eN++]=e1>>>16&65535,i[eN++]=e2>>>0&65535,i[eN]=e2>>>16&65535;return;case 32:for(let a=0;a<32;a=a+1|0)i[n+a|0]=0|t[r+a|0];return}let e3=Ik[a]>>>0,e5=r,e4=0,e6=t[e5]>>>0;for(let r=0;r<32;r++)if(e4+a<=32){let o=e6>>>e4&e3;i[n+r]=0|o,32===(e4+=a)&&(e4=0,e5++,31!==r&&(e6=t[e5]>>>0))}else{let o=32-e4,s=(e6>>>e4|((e6=t[++e5]>>>0)&Ik[a-o]>>>0)<>>5)|0,i.exceptionSizes[o]=s}return r}(t,f,o);return o.dataPointers.fill(0),function(t,r,i,n,a,o,s,l,u,c){let h=0|i,d=0;for(let r=0;rr)throw Error(`FastPFOR decode: byteContainer underflow at block=${n} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${i}, byteSize=${r})`);let a=t[i++],o=t[i++];if(a>32)throw Error(`FastPFOR decode: invalid bitWidth=${a} at block=${n} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:a,exceptionCount:o,bytePosIn:i}}(l,u,d,r);d=i.bytePosIn;let n=i.bitWidth,s=i.exceptionCount,f=o+256*r|0;switch(n){case 0:a.fill(0,f,f+256);break;case 32:for(let r=0;r<256;r=r+1|0)a[f+r|0]=0|t[h+r|0];h=h+256|0;break;default:h=function(t,r,i,n,a){switch(a){case 1:let o=n,s=r;for(let r=0;r<8;r++){let r=t[s++]>>>0;i[o++]=r>>>0&1,i[o++]=r>>>1&1,i[o++]=r>>>2&1,i[o++]=r>>>3&1,i[o++]=r>>>4&1,i[o++]=r>>>5&1,i[o++]=r>>>6&1,i[o++]=r>>>7&1,i[o++]=r>>>8&1,i[o++]=r>>>9&1,i[o++]=r>>>10&1,i[o++]=r>>>11&1,i[o++]=r>>>12&1,i[o++]=r>>>13&1,i[o++]=r>>>14&1,i[o++]=r>>>15&1,i[o++]=r>>>16&1,i[o++]=r>>>17&1,i[o++]=r>>>18&1,i[o++]=r>>>19&1,i[o++]=r>>>20&1,i[o++]=r>>>21&1,i[o++]=r>>>22&1,i[o++]=r>>>23&1,i[o++]=r>>>24&1,i[o++]=r>>>25&1,i[o++]=r>>>26&1,i[o++]=r>>>27&1,i[o++]=r>>>28&1,i[o++]=r>>>29&1,i[o++]=r>>>30&1,i[o++]=r>>>31&1}break;case 2:!function(t,r,i,n){let a=n,o=r;for(let r=0;r<8;r++){let r=t[o++]>>>0,n=t[o++]>>>0;i[a++]=r>>>0&3,i[a++]=r>>>2&3,i[a++]=r>>>4&3,i[a++]=r>>>6&3,i[a++]=r>>>8&3,i[a++]=r>>>10&3,i[a++]=r>>>12&3,i[a++]=r>>>14&3,i[a++]=r>>>16&3,i[a++]=r>>>18&3,i[a++]=r>>>20&3,i[a++]=r>>>22&3,i[a++]=r>>>24&3,i[a++]=r>>>26&3,i[a++]=r>>>28&3,i[a++]=r>>>30&3,i[a++]=n>>>0&3,i[a++]=n>>>2&3,i[a++]=n>>>4&3,i[a++]=n>>>6&3,i[a++]=n>>>8&3,i[a++]=n>>>10&3,i[a++]=n>>>12&3,i[a++]=n>>>14&3,i[a++]=n>>>16&3,i[a++]=n>>>18&3,i[a++]=n>>>20&3,i[a++]=n>>>22&3,i[a++]=n>>>24&3,i[a++]=n>>>26&3,i[a++]=n>>>28&3,i[a++]=n>>>30&3}}(t,r,i,n);break;case 3:!function(t,r,i,n){let a=n,o=r;for(let r=0;r<8;r++){let r=t[o++]>>>0,n=t[o++]>>>0,s=t[o++]>>>0;i[a++]=r>>>0&7,i[a++]=r>>>3&7,i[a++]=r>>>6&7,i[a++]=r>>>9&7,i[a++]=r>>>12&7,i[a++]=r>>>15&7,i[a++]=r>>>18&7,i[a++]=r>>>21&7,i[a++]=r>>>24&7,i[a++]=r>>>27&7,i[a++]=(r>>>30|(1&n)<<2)&7,i[a++]=n>>>1&7,i[a++]=n>>>4&7,i[a++]=n>>>7&7,i[a++]=n>>>10&7,i[a++]=n>>>13&7,i[a++]=n>>>16&7,i[a++]=n>>>19&7,i[a++]=n>>>22&7,i[a++]=n>>>25&7,i[a++]=n>>>28&7,i[a++]=(n>>>31|(3&s)<<1)&7,i[a++]=s>>>2&7,i[a++]=s>>>5&7,i[a++]=s>>>8&7,i[a++]=s>>>11&7,i[a++]=s>>>14&7,i[a++]=s>>>17&7,i[a++]=s>>>20&7,i[a++]=s>>>23&7,i[a++]=s>>>26&7,i[a++]=s>>>29&7}}(t,r,i,n);break;case 4:!function(t,r,i,n){let a=n,o=r;for(let r=0;r<8;r++){let r=t[o++]>>>0,n=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0;i[a++]=r>>>0&15,i[a++]=r>>>4&15,i[a++]=r>>>8&15,i[a++]=r>>>12&15,i[a++]=r>>>16&15,i[a++]=r>>>20&15,i[a++]=r>>>24&15,i[a++]=r>>>28&15,i[a++]=n>>>0&15,i[a++]=n>>>4&15,i[a++]=n>>>8&15,i[a++]=n>>>12&15,i[a++]=n>>>16&15,i[a++]=n>>>20&15,i[a++]=n>>>24&15,i[a++]=n>>>28&15,i[a++]=s>>>0&15,i[a++]=s>>>4&15,i[a++]=s>>>8&15,i[a++]=s>>>12&15,i[a++]=s>>>16&15,i[a++]=s>>>20&15,i[a++]=s>>>24&15,i[a++]=s>>>28&15,i[a++]=l>>>0&15,i[a++]=l>>>4&15,i[a++]=l>>>8&15,i[a++]=l>>>12&15,i[a++]=l>>>16&15,i[a++]=l>>>20&15,i[a++]=l>>>24&15,i[a++]=l>>>28&15}}(t,r,i,n);break;case 5:!function(t,r,i,n){let a=n,o=r;for(let r=0;r<8;r++){let r=t[o++]>>>0,n=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0,u=t[o++]>>>0;i[a++]=r>>>0&31,i[a++]=r>>>5&31,i[a++]=r>>>10&31,i[a++]=r>>>15&31,i[a++]=r>>>20&31,i[a++]=r>>>25&31,i[a++]=(r>>>30|(7&n)<<2)&31,i[a++]=n>>>3&31,i[a++]=n>>>8&31,i[a++]=n>>>13&31,i[a++]=n>>>18&31,i[a++]=n>>>23&31,i[a++]=(n>>>28|(1&s)<<4)&31,i[a++]=s>>>1&31,i[a++]=s>>>6&31,i[a++]=s>>>11&31,i[a++]=s>>>16&31,i[a++]=s>>>21&31,i[a++]=s>>>26&31,i[a++]=(s>>>31|(15&l)<<1)&31,i[a++]=l>>>4&31,i[a++]=l>>>9&31,i[a++]=l>>>14&31,i[a++]=l>>>19&31,i[a++]=l>>>24&31,i[a++]=(l>>>29|(3&u)<<3)&31,i[a++]=u>>>2&31,i[a++]=u>>>7&31,i[a++]=u>>>12&31,i[a++]=u>>>17&31,i[a++]=u>>>22&31,i[a++]=u>>>27&31}}(t,r,i,n);break;case 6:!function(t,r,i,n){let a=n,o=r;for(let r=0;r<8;r++){let r=t[o++]>>>0,n=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0,u=t[o++]>>>0,c=t[o++]>>>0;i[a++]=r>>>0&63,i[a++]=r>>>6&63,i[a++]=r>>>12&63,i[a++]=r>>>18&63,i[a++]=r>>>24&63,i[a++]=(r>>>30|(15&n)<<2)&63,i[a++]=n>>>4&63,i[a++]=n>>>10&63,i[a++]=n>>>16&63,i[a++]=n>>>22&63,i[a++]=(n>>>28|(3&s)<<4)&63,i[a++]=s>>>2&63,i[a++]=s>>>8&63,i[a++]=s>>>14&63,i[a++]=s>>>20&63,i[a++]=s>>>26&63,i[a++]=l>>>0&63,i[a++]=l>>>6&63,i[a++]=l>>>12&63,i[a++]=l>>>18&63,i[a++]=l>>>24&63,i[a++]=(l>>>30|(15&u)<<2)&63,i[a++]=u>>>4&63,i[a++]=u>>>10&63,i[a++]=u>>>16&63,i[a++]=u>>>22&63,i[a++]=(u>>>28|(3&c)<<4)&63,i[a++]=c>>>2&63,i[a++]=c>>>8&63,i[a++]=c>>>14&63,i[a++]=c>>>20&63,i[a++]=c>>>26&63}}(t,r,i,n);break;case 7:!function(t,r,i,n){let a=n,o=r;for(let r=0;r<8;r++){let r=t[o++]>>>0,n=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0,u=t[o++]>>>0,c=t[o++]>>>0,h=t[o++]>>>0;i[a++]=r>>>0&127,i[a++]=r>>>7&127,i[a++]=r>>>14&127,i[a++]=r>>>21&127,i[a++]=(r>>>28|(7&n)<<4)&127,i[a++]=n>>>3&127,i[a++]=n>>>10&127,i[a++]=n>>>17&127,i[a++]=n>>>24&127,i[a++]=(n>>>31|(63&s)<<1)&127,i[a++]=s>>>6&127,i[a++]=s>>>13&127,i[a++]=s>>>20&127,i[a++]=(s>>>27|(3&l)<<5)&127,i[a++]=l>>>2&127,i[a++]=l>>>9&127,i[a++]=l>>>16&127,i[a++]=l>>>23&127,i[a++]=(l>>>30|(31&u)<<2)&127,i[a++]=u>>>5&127,i[a++]=u>>>12&127,i[a++]=u>>>19&127,i[a++]=(u>>>26|(1&c)<<6)&127,i[a++]=c>>>1&127,i[a++]=c>>>8&127,i[a++]=c>>>15&127,i[a++]=c>>>22&127,i[a++]=(c>>>29|(15&h)<<3)&127,i[a++]=h>>>4&127,i[a++]=h>>>11&127,i[a++]=h>>>18&127,i[a++]=h>>>25&127}}(t,r,i,n);break;case 8:!function(t,r,i,n){let a=n,o=r;for(let r=0;r<8;r++){let r=t[o++]>>>0,n=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0,u=t[o++]>>>0,c=t[o++]>>>0,h=t[o++]>>>0,d=t[o++]>>>0;i[a++]=r>>>0&255,i[a++]=r>>>8&255,i[a++]=r>>>16&255,i[a++]=r>>>24&255,i[a++]=n>>>0&255,i[a++]=n>>>8&255,i[a++]=n>>>16&255,i[a++]=n>>>24&255,i[a++]=s>>>0&255,i[a++]=s>>>8&255,i[a++]=s>>>16&255,i[a++]=s>>>24&255,i[a++]=l>>>0&255,i[a++]=l>>>8&255,i[a++]=l>>>16&255,i[a++]=l>>>24&255,i[a++]=u>>>0&255,i[a++]=u>>>8&255,i[a++]=u>>>16&255,i[a++]=u>>>24&255,i[a++]=c>>>0&255,i[a++]=c>>>8&255,i[a++]=c>>>16&255,i[a++]=c>>>24&255,i[a++]=h>>>0&255,i[a++]=h>>>8&255,i[a++]=h>>>16&255,i[a++]=h>>>24&255,i[a++]=d>>>0&255,i[a++]=d>>>8&255,i[a++]=d>>>16&255,i[a++]=d>>>24&255}}(t,r,i,n);break;case 16:let l=n,u=r;for(let r=0;r<128;r++){let r=t[u++]>>>0;i[l++]=65535&r,i[l++]=r>>>16&65535}break;default:!function(t,r,i,n,a){let o=Ik[a]>>>0,s=r,l=0,u=t[s]>>>0,c=n;for(let r=0;r<8;r++){for(let r=0;r<32;r++)if(l+a<=32){let n=u>>>l&o;i[c+r]=0|n,32===(l+=a)&&(l=0,s++,31!==r&&(u=t[s]>>>0))}else{let n=32-l,h=u>>>l;u=t[++s]>>>0;let d=a-n,f=(h|(u&-1>>>32-d>>>0)<>>0)}}(t,r,i,n,a)}return r+(a<<3)|0}(t,h,a,f,n)}s>0&&(d=function(t,r,i,n,a,o,s,l,u){let{maxBits:c,exceptionBitWidth:h,bytePosIn:d}=function(t,r,i,n,a,o){if(i+1>r)throw Error(`FastPFOR decode: exception header underflow at block=${o} (need 1 byte for maxBits, bytePos=${i}, byteSize=${r})`);let s=t[i++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${o} (bitWidth=${n}, expected ${n}..32)`);let l=s-n|0;if(l<1||l>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${l} at block=${o} (bitWidth=${n}, maxBits=${s})`);if(i+a>r)throw Error(`FastPFOR decode: exception positions underflow at block=${o} (need=${a}, have=${r-i})`);return{maxBits:s,exceptionBitWidth:l,bytePosIn:i}}(a,o,s,i,n,u);if(s=d,1===h){let o=1<g)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${m}, need ${n}, size=${g}) at block ${u}`);for(let o=0;o>>s&255;if(s+=8,l+=s>>>5,s&=31,d|=(127&r)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${d}, decoded=${c-a}/${o}, inPos=${l}, inEnd=${u})`)}if(c!==h)throw Error(`FastPFOR VByte: truncated stream (decoded=${c-a}, expected=${o}, consumedWords=${l-r}/${i}, vbyteStart=${r}, vbyteEnd=${u})`)}(t,n,l,o,a,u),o}(l.subarray(0,s),r,a.decoderWorkspace);return n.add(i),u}(t,a,o=i.byteLength,r,function(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);return{encodedWords:new Uint32Array(Math.max(16,0|t)),decoderWorkspace:Aa()}}(o>>>2));case IA.VARINT:return Ao(t,r,i.numValues);case IA.NONE:return function(t,r,i){let n=r.get(),a=i*Uint32Array.BYTES_PER_ELEMENT,o=new DataView(t.buffer,t.byteOffset,t.byteLength),s=new Uint32Array(i);for(let t=0;t>1,r)-i}}function AU(t,r){let i=0;for(let n=0;n>n;return i}function Aq(t,r,i,n,a,o,s){return t===IW.MORTON?function(t,r,i,n,a,o){let s=Array(a?n+1:n);for(let a=0;ai?r[o++]:1);return n}function AW(t,r,i,n){let a=new Uint32Array(r[r.length-1]+1),o=0;a[0]=o;let s=1,l=0;for(let u=0;u=i)throw Error("Unexpected end of map value stream");let a=t[r];if(a===I9.FALSE)return{value:!1,nextIndex:r+1};if(a===I9.TRUE)return{value:!0,nextIndex:r+1};if(a===I9.START_MAP){let a=AK(t,r,i);return{value:AZ(t,r+2,a,n).value,nextIndex:a}}if(a===I9.START_LIST){let a=AK(t,r,i),o=[],s=r+2;for(;s=i)throw Error("Missing length for nested map/list payload");let n=t[r+1];if(n<2)throw Error(`Invalid nested payload length: ${n}`);let a=r+n;if(a>i)throw Error("Nested payload exceeds containing payload bounds");return a}function AJ(t,r){let i=t-I9.COUNT;if(i<0||i>=r.length)throw Error(`Scalar dictionary index out of range: ${t}`);return r[i]}function AQ(t,r){for(let i of r)t.push(i)}function A0(t){return t instanceof IV}function A1(t){switch(t){case Le.ID:case Le.ID|Le.ID_NULLABLE:case Le.ID|Le.ID_LONG:case Le.ID|Le.ID_LONG|Le.ID_NULLABLE:return{nullable:(t&Le.ID_NULLABLE)!=0,columnScope:Iv.FEATURE,type:"scalarType",scalarType:{longID:(t&Le.ID_LONG)!=0,type:"logicalType",logicalType:I_.ID}};case Le.GEOMETRY:return{nullable:!1,columnScope:Iv.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Ib.GEOMETRY,children:[]}};case Le.STRUCT:return{nullable:!1,columnScope:Iv.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Ib.STRUCT,children:[]}};case Le.MAP:return{nullable:!0,columnScope:Iv.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Ib.MAP,children:[]}};default:let r;var i=t;switch(i){case 10:case 11:r=Ix.BOOLEAN;break;case 12:case 13:r=Ix.INT_8;break;case 14:case 15:r=Ix.UINT_8;break;case 16:case 17:r=Ix.INT_32;break;case 18:case 19:r=Ix.UINT_32;break;case 20:case 21:r=Ix.INT_64;break;case 22:case 23:r=Ix.UINT_64;break;case 24:case 25:r=Ix.FLOAT;break;case 26:case 27:r=Ix.DOUBLE;break;case 28:case 29:r=Ix.STRING;break;default:return null}return{nullable:!!(1&i),columnScope:Iv.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:r}}}}function A2(t){return t===Le.STRUCT||t===Le.MAP}function A3(t,r){let i=Ao(t,r,1)[0];if(0===i)return"";let n=r.get(),a=t.subarray(n,n+i);return r.add(i),Lt.decode(a)}function A5(t,r,i,n,a){return xu(t,(t,o)=>{let s=r instanceof Sx?r.get(o):null;return"object"==typeof s&&s&&"evaluate"in s?s.evaluate(i,n,void 0,a):s})}function A4(t,r){return r-t}var A6,A8,A7,A9,Me,Mt,Mr,Mi,Mn,Ma,Mo,Ms,Ml,Mu,Mc,Mh,Md,Mf,Mp,Mm,Mg,My,Mv,Mx,Mb,M_,Mw,MT,MA,MM,Mk,MS,ME,MD,MC,MI,ML,MP,Mz,MF,MO,MR,MB,Mj,MN,MV,MU,Mq,MG,MH,M$,MW,MY,MZ,MX,MK,MJ,MQ,M0,M1,M2,M3,M5,M4,M6,M8,M7,M9,ke,kt,kr,ki,kn,ka,ko,ks,kl,ku,kc,kh,kd,kf,kp,km,kg,ky,kv,kx,kb,k_,kw,kT,kA,kM,kk,kS,kE,kD,kC,kI,kL,kP,kz,kF,kO,kR,kB,kj,kN,kV,kU,kq,kG,kH,k$,kW,kY,kZ,kX,kK,kJ,kQ,k0,k1,k2,k3,k5,k4,k6,k8,k7,k9,Se,St,Sr,Si,Sn,Sa,So,Ss,Sl,Su,Sc,Sh,Sd,Sf,Sp,Sm,Sg,Sy,Sv,Sx,Sb,S_,Sw,ST,SA,SM,Sk,SS,SE,SD,SC,SI,SL,SP,Sz,SF,SO,SR,SB,Sj,SN,SV,SU,Sq,SG,SH,S$,SW,SY,SZ,SX,SK,SJ,SQ,S0,S1,S2,S3,S5,S4,S6,S8,S7,S9,Ee,Et,Er,Ei,En,Ea,Eo,Es,El,Eu,Ec,Eh,Ed,Ef,Ep,Em,Eg,Ey,Ev,Ex,Eb,E_,Ew,ET,EA,EM,Ek,ES,EE,ED,EC,EI,EL,EP,Ez,EF,EO,ER,EB,Ej,EN,EV,EU,Eq,EG,EH,E$,EW,EY,EZ,EX,EK,EJ,EQ,E0,E1,E2,E3,E5,E4,E6,E8,E7,E9,De,Dt,Dr,Di,Dn,Da,Do,Ds,Dl,Du,Dc,Dh,Dd,Df,Dp,Dm,Dg,Dy,Dv,Dx,Db,D_,Dw,DT,DA,DM,Dk,DS,DE,DD,DC,DI,DL,DP,Dz,DF,DO,DR,DB,Dj,DN,DV,DU,Dq,DG,DH,D$,DW,DY,DZ,DX,DK,DJ,DQ,D0,D1,D2,D3,D5,D4,D6,D8,D7,D9,Ce,Ct,Cr,Ci,Cn,Ca,Co,Cs,Cl,Cu,Cc,Ch,Cd,Cf,Cp,Cm,Cg,Cy,Cv,Cx,Cb,C_,Cw,CT,CA,CM,Ck,CS,CE,CD,CC,CI,CL,CP,Cz,CF,CO,CR,CB,Cj,CN,CV,CU,Cq,CG,CH,C$,CW,CY,CZ,CX,CK,CJ,CQ,C0,C1,C2,C3,C5,C4,C6,C8,C7,C9,Ie,It,Ir,Ii,In,Ia,Io,Is,Il,Iu,Ic,Ih,Id,If,Ip,Im,Ig,Iy,Iv,Ix,Ib,I_,Iw,IT,IA,IM,Ik,IS,IE,ID,IC,II,IL,IP,Iz,IF,IO,IR,IB,Ij,IN,IV,IU,Iq,IG,IH,I$,IW,IY,IZ,IX,IK,IJ,IQ,I0,I1,I2,I3,I5,I4,I6,I8,I7,I9,Le,Lt,Lr,Li,Ln,La,Lo=m({"node_modules/maplibre-gl/dist/maplibre-gl-shared.mjs"(){var t,r,i,n,a,o,s,l,u,c,h,d,m,g,y;let v,x;for(let r in A6=Object.create,A8=Object.defineProperty,A7=Object.getOwnPropertyDescriptor,A9=Object.getOwnPropertyNames,Me=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty,Mr=(t,r)=>()=>(r||(t((r={exports:{}}).exports,r),t=null),r.exports),vu.prototype={clone(){return new vu(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,r){return this.clone()._rotateAround(t,r)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let r=t.x-this.x,i=t.y-this.y;return r*r+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,r){return Math.atan2(this.x*r-this.y*t,this.x*t+this.y*r)},_matMult(t){let r=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=r,this.y=i,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let r=Math.cos(t),i=Math.sin(t),n=r*this.x-i*this.y,a=i*this.x+r*this.y;return this.x=n,this.y=a,this},_rotateAround(t,r){let i=Math.cos(t),n=Math.sin(t),a=r.x+i*(this.x-r.x)-n*(this.y-r.y),o=r.y+n*(this.x-r.x)+i*(this.y-r.y);return this.x=a,this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:vu},vu.convert=function(t){if(t instanceof vu)return t;if(Array.isArray(t))return new vu(+t[0],+t[1]);if(void 0!==t.x&&void 0!==t.y)return new vu(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")},Ma="u">typeof Float32Array?Float32Array:Array,Mo=vT,Ms=vA,Ml=vC,Mu=vS,vM(),Mc=vV,t=new Ma(4),Ma!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),Mh=vN,vM(),vE(1,0,0),vE(0,1,0),vq(),vq(),vd(),Md=vZ,vH(),Mf=8192,Mp=xt(.25,.1,.25,1),Mm=1,Mg={},My=null,Mv=(t,r)=>_(null,null,function*(){let i=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(i,r)}catch(t){throw Error(`Could not load image because of ${vJ(t).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),Mx=t=>new Promise((r,i)=>{let n=new Image;n.onload=()=>{r(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame(()=>n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=")},n.onerror=()=>i(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let a=new Blob([new Uint8Array(t)],{type:"image/png"});n.src=URL.createObjectURL(a)}),Mb=85.051129,M_={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},Mw={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},MT=class extends Error{constructor(t="AbortError"){super(t instanceof Error?t.message:t),this.name="AbortError",t instanceof Error&&t.stack&&(this.stack=t.stack)}},MA={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""},MM="global-dispatcher",Mk=class extends Error{constructor(t,r,i,n){super(`AJAXError: ${r} (${t}): ${i}`),this.status=t,this.statusText=r,this.url=i,this.body=n}},MS=function(t,r){return _(this,null,function*(){var i,n,a,o,s,l;if(t.url.includes("://")&&!/^https?:|^file:/.test(t.url)){let n=xM(t.url);if(n){let i=yield n(t,r);return i.data||"arrayBuffer"!==t.type?i:xn(i,{data:new ArrayBuffer(0)})}if(xm(self)&&null!=(i=self.worker)&&i.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:MM},r)}if(!((s=t.url).startsWith("file:")||(null==(l=xE())?void 0:l.startsWith("file:"))&&!/^\w+:/.test(s))){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return function(t,r){return _(this,null,function*(){let i,n,a=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:xE(),referrerPolicy:t.referrerPolicy,signal:r.signal});"json"!==t.type||a.headers.has("Accept")||a.headers.set("Accept","application/json");try{i=yield fetch(a)}catch(r){throw xT(r)?r:new Mk(0,vJ(r).message,t.url,new Blob)}if(!i.ok){let r=yield i.blob();throw new Mk(i.status,i.statusText,t.url,r)}n="arrayBuffer"===t.type||"image"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text();let o=yield n;return xA(r.signal),{data:o,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}})}(t,r);if(xm(self)&&null!=(n=self.worker)&&n.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:MM},r)}return a=t,o=r,new Promise((t,r)=>{var i;let n=new XMLHttpRequest;for(let t in n.open(a.method||"GET",a.url,!0),("arrayBuffer"===a.type||"image"===a.type)&&(n.responseType="arraybuffer"),a.headers)n.setRequestHeader(t,a.headers[t]);"json"===a.type&&(n.responseType="text",null!=(i=a.headers)&&i.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===a.credentials,n.onerror=()=>{r(Error(n.statusText))},n.onload=()=>{if(!o.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let i=n.response;if("json"===a.type)try{i=JSON.parse(n.response)}catch(t){r(t);return}t({data:i,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let t=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});r(new Mk(n.status,n.statusText,a.url,t))}},o.signal.addEventListener("abort",()=>{n.abort(),r(new MT(o.signal.reason))}),n.send(a.body)})})},ME=(t,r)=>MS(xn(t,{type:"json"}),r),MD=(t,r)=>MS(xn(t,{type:"arrayBuffer"}),r),MC=t=>{let r=window.document.createElement("video");return r.muted=!0,new Promise(i=>{for(let n of(r.onloadstart=()=>{i(r)},t)){let t=window.document.createElement("source");xD(n)||(r.crossOrigin="Anonymous"),t.src=n,r.appendChild(t)}})},MI=class{constructor(t,r={}){xn(this,r),this.type=t}},ML=class extends MI{constructor(t,r={}){super("error",xn({error:t},r))}},MP=class{on(t,r){return this._listeners||(this._listeners={}),xC(t,r,this._listeners),{unsubscribe:()=>{this.off(t,r)}}}off(t,r){return xI(t,r,this._listeners),xI(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners||(this._oneTimeListeners={}),xC(t,r,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,r){var i,n,a,o,s,l;let u="string"==typeof t?new MI(t,r||{}):t,c=u.type;if(this.listens(c)){for(let t of(u.target=this,null!=(a=null==(n=null==(i=this._listeners)?void 0:i[c])?void 0:n.slice())?a:[]))t.call(this,u);for(let t of null!=(l=null==(s=null==(o=this._oneTimeListeners)?void 0:o[c])?void 0:s.slice())?l:[])xI(c,t,this._oneTimeListeners),t.call(this,u);let t=this._eventedParent;t&&(xn(u,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),t.fire(u))}else u instanceof ML&&console.error(u.error);return this}listens(t){var r,i,n,a,o;return!!(null!=(i=null==(r=this._listeners)?void 0:r[t])&&i.length||null!=(a=null==(n=this._oneTimeListeners)?void 0:n[t])&&a.length||null!=(o=this._eventedParent)&&o.listens(t))}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}},MF=Mz={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},MO=["type","source","source-layer","minzoom","maxzoom","filter","layout"],MR=class{constructor(t,r,i,n,a="error"){this.message=(t?`${t}: `:"")+i,n&&(this.identifier=n),this.severity=a,null!=r&&r.__line__&&(this.line=r.__line__)}},M$={kind:"error"},MW={kind:"collator"},MZ={kind:"padding"},MX={kind:"colorArray"},MK={kind:"numberArray"},MJ={kind:"resolvedImage"},MQ={kind:"variableAnchorOffsetCollection"},M0=[MB={kind:"null"},Mj={kind:"number"},MN={kind:"string"},MV={kind:"boolean"},MU={kind:"color"},Mq={kind:"projectionDefinition"},MY={kind:"formatted"},MG={kind:"object"},xL(MH={kind:"value"}),MZ,MK,MX,MJ,MQ],M1=.96422,M2=.82521,M3=4/29,M4=3*(M5=6/29)*M5,M6=Math.PI/180,M8=180/Math.PI,M7=Object.hasOwn||function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},M9={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},(ke=class{constructor(t,r,i,n=1,a=!0){this.r=t,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[t,r,i,n]))}static parse(t){if(t instanceof ke)return t;if("string"!=typeof t)return;let r=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];let r=xH(M9,t);if(r){let[t,i,n]=r;return[t/255,i/255,n/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let r=t.length<6?1:2,i=1;return[x$(t.slice(i,i+=r)),x$(t.slice(i,i+=r)),x$(t.slice(i,i+=r)),x$(t.slice(i,i+r)||"ff")]}if(t.startsWith("rgb")){let r=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[t,i,n,a,o,s,l,u,c,h,d,f]=r,p=[a||" ",l||" ",h].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){let t=[n,s,c].join(""),r="%%%"===t?100:255*(""===t);if(r){let t=[xY(i/r,0,1),xY(o/r,0,1),xY(u/r,0,1),d?xW(+d,f):1];if(xZ(t))return t}}return}}let i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){let[t,r,n,a,o,s,l,u,c]=i,h=[n||" ",o||" ",l].join("");if(" "===h||" /"===h||",,"===h||",,,"===h){let t=[+r,xY(+a,0,100),xY(+s,0,100),u?xW(+u,c):1];if(xZ(t))return function([t,r,i,n]){function a(n){let a=(n+t/30)%12,o=r*Math.min(i,1-i);return i-o*Math.max(-1,Math.min(a-3,9-a,1))}return t=xB(t),r/=100,i/=100,[a(0),a(8),a(4),n]}(t)}}}(t);if(r)return new ke(...r,!1)}get rgb(){let{r:t,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[t/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",function(t){let[r,i,n,a]=xj(t),o=Math.sqrt(i*i+n*n);return[Math.round(1e4*o)?xB(Math.atan2(n,i)*M8):NaN,o,r,a]}(this.rgb))}get lab(){return this.overwriteGetter("lab",xj(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){let[t,r,i,n]=this.rgb;return`rgba(${[t,r,i].map(t=>Math.round(255*t)).join(",")},${n})`}static interpolate(t,r,i,n="rgb"){switch(n){case"rgb":{let[n,a,o,s]=xK(t.rgb,r.rgb,i);return new ke(n,a,o,s,!1)}case"hcl":{var a,o,s;let[n,l,u,c]=t.hcl,[h,d,f,p]=r.hcl,m,g;if(isNaN(n)||isNaN(h))isNaN(n)?isNaN(h)?m=NaN:(m=h,(1===u||0===u)&&(g=d)):(m=n,(1===f||0===f)&&(g=l));else{let t=h-n;h>n&&t>180?t-=360:h180&&(t+=360),m=n+i*t}let[y,v,x,b]=function([t,r,i,n]){return xU([i,Math.cos(t=isNaN(t)?0:t*M6)*r,Math.sin(t)*r,n])}([m,g??(a=l)+i*(d-a),(o=u)+i*(f-o),(s=c)+i*(p-s)]);return new ke(y,v,x,b,!1)}case"lab":{let[n,a,o,s]=xU(xK(t.lab,r.lab,i));return new ke(n,a,o,s,!1)}}}}).black=new ke(0,0,0,1),ke.white=new ke(1,1,1,1),ke.transparent=new ke(0,0,0,0),ke.red=new ke(1,0,0,1),kt=ke,kr=["bottom","center","top"],ki=class{constructor(t,r,i,n,a,o){this.text=t,this.image=r,this.scale=i,this.fontStack=n,this.textColor=a,this.verticalAlign=o}},kn=class t{constructor(t){this.sections=t}static fromString(r){return new t([new ki(r,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(r){return r instanceof t?r:t.fromString(r)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}},ka=class t{constructor(t){this.values=t.slice()}static parse(r){if(r instanceof t)return r;if("number"==typeof r)return new t([r,r,r,r]);if(Array.isArray(r)&&!(r.length<1||r.length>4)){for(let t of r)if("number"!=typeof t)return;switch(r.length){case 1:r=[r[0],r[0],r[0],r[0]];break;case 2:r=[r[0],r[1],r[0],r[1]];break;case 3:r=[r[0],r[1],r[2],r[1]]}return new t(r)}}toString(){return JSON.stringify(this.values)}static interpolate(r,i,n){return new t(xK(r.values,i.values,n))}},ko=class t{constructor(t){this.values=t.slice()}static parse(r){if(r instanceof t)return r;if("number"==typeof r)return new t([r]);if(Array.isArray(r)){for(let t of r)if("number"!=typeof t)return;return new t(r)}}toString(){return JSON.stringify(this.values)}static interpolate(r,i,n){return new t(xK(r.values,i.values,n))}},ks=class t{constructor(t){this.values=t.slice()}static parse(r){if(r instanceof t)return r;if("string"==typeof r){let i=kt.parse(r);return i?new t([i]):void 0}if(!Array.isArray(r))return;let i=[];for(let t of r){if("string"!=typeof t)return;let r=kt.parse(t);if(!r)return;i.push(r)}return new t(i)}toString(){return JSON.stringify(this.values)}static interpolate(r,i,n,a="rgb"){let o=[];if(r.values.length!=i.values.length)throw Error(`colorArray: Arrays have mismatched length (${r.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let t=0;t=n)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);let c=i.parse(s,u,o);if(!c)return null;o||(o=c.type),a.push([n,c])}return new t(o,n,a,i.key)}evaluate(t){let r=this.labels,i=this.outputs;if(1===r.length)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(t):i[x2(r,n,this.key)].evaluate(t)}eachChild(t){for(let r of(t(this.input),this.outputs))t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}},kv=class t{constructor(t,r,i,n,a,o){for(let[s,l]of(this.type=t,this.operator=r,this.interpolation=i,this.input=n,this.key=o,this.labels=[],this.outputs=[],a))this.labels.push(s),this.outputs.push(l)}static interpolationFactor(t,r,i,n){let a=0;if("exponential"===t.name)a=x3(r,t.base,i,n);else if("linear"===t.name)a=x3(r,1,i,n);else if("cubic-bezier"===t.name){var o,s,l,u;let c,h,d,f,p,m,g=t.controlPoints;a=(o=g[0],s=g[1],l=g[2],u=g[3],c=3*o,h=3*(l-o)-c,d=1-c-h,f=3*s,p=3*(u-s)-f,m=1-f-p,function(t,r=1e-6){if(t<=0)return 0;if(t>=1)return 1;let i=t;for(let n=0;n<8;n++){let n=((d*i+h)*i+c)*i-t;if(Math.abs(n)Math.abs(a))break;i-=n/a}let n=0,a=1;i=t;for(let o=0;o<20;o++){let o=((d*i+h)*i+c)*i;if(Math.abs(o-t)o?n=i:a=i,i=(n+a)*.5}return((m*i+p)*i+f)*i})(x3(r,1,i,n))}return a}static parse(r,i){let[n,a,o,...s]=r;if(!Array.isArray(a)||0===a.length)return i.error("Expected an interpolation type expression.",1);if("linear"===a[0])a={name:"linear"};else if("exponential"===a[0]){let t=a[1];if("number"!=typeof t)return i.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:t}}else{if("cubic-bezier"!==a[0])return i.error(`Unknown interpolation type ${String(a[0])}`,1,0);let t=a.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:t}}if(r.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if((r.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(!(o=i.parse(o,2,Mj)))return null;let l=[],u=null;("interpolate-hcl"===n||"interpolate-lab"===n)&&i.expectedType!=MX?u=MU:i.expectedType&&"value"!==i.expectedType.kind&&(u=i.expectedType);for(let t=0;t=r)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',a);let c=i.parse(n,o,u);if(!c)return null;u||(u=c.type),l.push([r,c])}return xR(u,Mj)||xR(u,Mq)||xR(u,MU)||xR(u,MZ)||xR(u,MK)||xR(u,MX)||xR(u,MQ)||xR(u,xL(Mj))?new t(u,n,a,o,l,i.key):i.error(`Type ${xP(u)} is not interpolatable.`)}evaluate(r){let i=this.labels,n=this.outputs;if(1===i.length)return n[0].evaluate(r);let a=this.input.evaluate(r);if(a<=i[0])return n[0].evaluate(r);let o=i.length;if(a>=i[o-1])return n[o-1].evaluate(r);let s=x2(i,a,this.key),l=i[s],u=i[s+1],c=t.interpolationFactor(this.interpolation,a,l,u),h=n[s].evaluate(r),d=n[s+1].evaluate(r);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":var f;return(f=h)+c*(d-f);case"color":return kt.interpolate(h,d,c);case"padding":return ka.interpolate(h,d,c);case"colorArray":return ks.interpolate(h,d,c);case"numberArray":return ko.interpolate(h,d,c);case"variableAnchorOffsetCollection":return kc.interpolate(h,d,c,this.key);case"array":return xK(h,d,c);case"projectionDefinition":return kd.interpolate(h,d,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return kt.interpolate(h,d,c,"hcl");case"colorArray":return ks.interpolate(h,d,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return kt.interpolate(h,d,c,"lab");case"colorArray":return ks.interpolate(h,d,c,"lab")}}}eachChild(t){for(let r of(t(this.input),this.outputs))t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}},kx={color:kt.interpolate,number:xX,padding:ka.interpolate,numberArray:ko.interpolate,colorArray:ks.interpolate,variableAnchorOffsetCollection:kc.interpolate,array:xK},kb=class t{constructor(t){this.type=MY,this.sections=t}static parse(r,i){if(r.length<2)return i.error("Expected at least one argument.");let n=r[1];if(!Array.isArray(n)&&"object"==typeof n)return i.error("First argument must be an image or text section.");let a=[],o=!1;for(let t=1;t<=r.length-1;++t){let n=r[t];if(o&&"object"==typeof n&&!Array.isArray(n)){o=!1;let t=null;if(n["font-scale"]&&!(t=i.parse(n["font-scale"],1,Mj)))return null;let r=null;if(n["text-font"]&&!(r=i.parse(n["text-font"],1,xL(MN))))return null;let s=null;if(n["text-color"]&&!(s=i.parse(n["text-color"],1,MU)))return null;let l=null;if(n["vertical-align"]){if("string"==typeof n["vertical-align"]&&!kr.includes(n["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${n["vertical-align"]}' instead.`);if(!(l=i.parse(n["vertical-align"],1,MN)))return null}let u=a[a.length-1];u.scale=t,u.font=r,u.textColor=s,u.verticalAlign=l}else{let n=i.parse(r[t],1,MH);if(!n)return null;let s=n.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,a.push({content:n,scale:null,font:null,textColor:null,verticalAlign:null})}}return new t(a)}evaluate(t){return new kn(this.sections.map(r=>{let i=r.content.evaluate(t);return x0(i)===MJ?new ki("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(t):null):new ki(x1(i),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null,r.verticalAlign?r.verticalAlign.evaluate(t):null)}))}eachChild(t){for(let r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor),r.verticalAlign&&t(r.verticalAlign)}outputDefined(){return!1}},k_={string:MN,number:Mj,boolean:MV,object:MG},kw=class t{constructor(t,r,i){this.type=t,this.args=r,this.key=i}static parse(r,i){if(r.length<2)return i.error("Expected at least one argument.");let n=1,a,o=r[0];if("array"===o){let t,o;if(r.length>2){let a=r[1];if("string"!=typeof a||!(a in k_)||"object"===a)return i.error('The item type argument of "array" must be one of string, number, boolean',1);t=k_[a],n++}else t=MH;if(r.length>3){if(null!==r[2]&&("number"!=typeof r[2]||r[2]<0||r[2]!==Math.floor(r[2])))return i.error('The length argument to "array" must be a positive integer literal',2);o=r[2],n++}a=xL(t,o)}else{if(!k_[o])throw Error(`Types doesn't contain name = ${o}`);a=k_[o]}let s=[];for(;nt.outputDefined())}},kT={"to-boolean":MV,"to-color":MU,"to-number":Mj,"to-string":MN},kA=class t{constructor(t,r,i){this.type=t,this.args=r,this.key=i}static parse(r,i){if(r.length<2)return i.error("Expected at least one argument.");let n=r[0];if(!kT[n])throw Error(`Can't parse ${n} as it is not part of the known types`);if(("to-boolean"===n||"to-string"===n)&&2!==r.length)return i.error("Expected one argument.");let a=kT[n],o=[];for(let t=1;t4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:xJ(r[0],r[1],r[2],r[3])))return new kt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new kl(i||`Could not parse color from value '${"string"==typeof r?r:JSON.stringify(r)}'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(t);let n=ka.parse(r);if(n)return n}throw new kl(`Could not parse padding from value '${"string"==typeof r?r:JSON.stringify(r)}'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(t);let n=ko.parse(r);if(n)return n}throw new kl(`Could not parse numberArray from value '${"string"==typeof r?r:JSON.stringify(r)}'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(t);let n=ks.parse(r);if(n)return n}throw new kl(`Could not parse colorArray from value '${"string"==typeof r?r:JSON.stringify(r)}'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(t);let n=kc.parse(r);if(n)return n}throw new kl(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof r?r:JSON.stringify(r)}'`,this.key)}case"number":{let r=null;for(let i of this.args){if(null===(r=i.evaluate(t)))return 0;let n=Number(r);if(!isNaN(n))return n}throw new kl(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return kn.fromString(x1(this.args[0].evaluate(t)));case"resolvedImage":return kh.fromString(x1(this.args[0].evaluate(t)));case"projectionDefinition":{let r=this.args[0].evaluate(t);if(kd.parse(r))return r;throw new kl(`Could not parse projectionDefinition from value '${"string"==typeof r?r:JSON.stringify(r)}'`,this.key)}default:return x1(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},kM=class t{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let r of this.bindings)t(r[1]);t(this.result)}static parse(r,i){if(r.length<4)return i.error(`Expected at least 3 arguments, but found ${r.length-1} instead.`);let n=[];for(let t=1;t=i.length)throw new kl(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new kl(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}},kE=class t{constructor(t,r,i){this.needle=t,this.haystack=r,this.key=i,this.type=MV}static parse(r,i){if(3!==r.length)return i.error(`Expected 2 arguments, but found ${r.length-1} instead.`);let n=i.parse(r[1],1,MH),a=i.parse(r[2],2,MH);return n&&a?xF(n.type,[MV,MN,Mj,MB,MH])?new t(n,a,i.key):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${xP(n.type)} instead`):null}evaluate(t){let r=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!xO(r,["boolean","string","number","null"]))throw new kl(`Expected first argument to be of type boolean, string, number or null, but found ${xP(x0(r))} instead.`,this.key);if(!xO(i,["string","array"]))throw new kl(`Expected second argument to be of type array or string, but found ${xP(x0(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}},kD=class t{constructor(t,r,i,n){this.needle=t,this.haystack=r,this.key=i,this.fromIndex=n,this.type=Mj}static parse(r,i){if(r.length<=2||r.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${r.length-1} instead.`);let n=i.parse(r[1],1,MH),a=i.parse(r[2],2,MH);if(!n||!a)return null;if(!xF(n.type,[MV,MN,Mj,MB,MH]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${xP(n.type)} instead`);if(4===r.length){let o=i.parse(r[3],3,Mj);return o?new t(n,a,i.key,o):null}return new t(n,a,i.key)}evaluate(t){let r,i=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!xO(i,["boolean","string","number","null"]))throw new kl(`Expected first argument to be of type boolean, string, number or null, but found ${xP(x0(i))} instead.`,this.key);if(this.fromIndex&&(r=this.fromIndex.evaluate(t)),xO(n,["string"])){let t=n.indexOf(i,r);return -1===t?-1:[...n.slice(0,t)].length}if(xO(n,["array"]))return n.indexOf(i,r);throw new kl(`Expected second argument to be of type array or string, but found ${xP(x0(n))} instead.`,this.key)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}},kC=class t{constructor(t,r,i,n,a,o){this.inputType=t,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=o}static parse(r,i){let n,a;if(r.length<5)return i.error(`Expected at least 4 arguments, but found only ${r.length-1}.`);if(r.length%2!=1)return i.error("Expected an even number of arguments.");i.expectedType&&"value"!==i.expectedType.kind&&(a=i.expectedType);let o={},s=[];for(let t=2;t0x20000000000000-1)return c.error(`Branch labels must be integers no larger than ${0x20000000000000-1}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,x0(t)))return null}else n=x0(t);if(void 0!==o[String(t)])return c.error("Branch labels must be unique.");o[String(t)]=s.length}let h=i.parse(u,t,a);if(!h)return null;a||(a=h.type),s.push(h)}let l=i.parse(r[1],1,MH);if(!l)return null;let u=i.parse(r[r.length-1],r.length-1,a);return!u||"value"!==l.type.kind&&i.concat(1).checkSubtype(n,l.type)?null:new t(n,a,l,o,s,u)}evaluate(t){let r=this.input.evaluate(t);return(x0(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}},kI=class t{constructor(t,r,i){this.type=t,this.branches=r,this.otherwise=i}static parse(r,i){let n;if(r.length<4)return i.error(`Expected at least 3 arguments, but found only ${r.length-1}.`);if(r.length%2!=0)return i.error("Expected an odd number of arguments.");i.expectedType&&"value"!==i.expectedType.kind&&(n=i.expectedType);let a=[];for(let t=1;tr.outputDefined())&&this.otherwise.outputDefined()}},kL=class t{constructor(t,r,i,n,a){this.type=t,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(r,i){if(r.length<=2||r.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${r.length-1} instead.`);let n=i.parse(r[1],1,MH),a=i.parse(r[2],2,Mj);if(!n||!a)return null;if(!xF(n.type,[xL(MH),MN,MH]))return i.error(`Expected first argument to be of type array or string, but found ${xP(n.type)} instead`);if(4===r.length){let o=i.parse(r[3],3,Mj);return o?new t(n.type,n,a,i.key,o):null}return new t(n.type,n,a,i.key)}evaluate(t){let r=this.input.evaluate(t),i=this.beginIndex.evaluate(t),n;if(this.endIndex&&(n=this.endIndex.evaluate(t)),xO(r,["string"]))return[...r].slice(i,n).join("");if(xO(r,["array"]))return r.slice(i,n);throw new kl(`Expected first argument to be of type array or string, but found ${xP(x0(r))} instead.`,this.key)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}},kP=class t{constructor(t,r){this.type=t,this.args=r}static parse(r,i){if(r.length<2)return i.error("Expected at least one argument.");let n=null,a=i.expectedType;a&&"value"!==a.kind&&(n=a);let o=[];for(let t of r.slice(1)){let r=i.parse(t,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!r)return null;n||(n=r.type),o.push(r)}if(!n)throw Error("No output type");return a&&o.some(t=>xz(a,t.type))?new t(MH,o):new t(n,o)}evaluate(t){let r=null,i=0,n;for(let a of this.args)if(i++,(r=a.evaluate(t))&&r instanceof kh&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),null!==r)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},kz=bc("==",x7,bn),kF=bc("!=",x9,ba),kO=bc("<",be,bo),kR=bc(">",bt,bs),kB=bc("<=",br,bl),kj=bc(">=",bi,bu),kN=class t{constructor(t,r,i){this.type=MW,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=r}static parse(r,i){if(2!==r.length)return i.error("Expected one argument.");let n=r[1];if("object"!=typeof n||Array.isArray(n))return i.error("Collator options argument must be an object.");let a=i.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,MV);if(!a)return null;let o=i.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,MV);if(!o)return null;let s=null;return!n.locale||(s=i.parse(n.locale,1,MN))?new t(a,o,s):null}evaluate(t){return new kf(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}},kV=class t{constructor(t,r,i,n,a,o){this.type=MN,this.number=t,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=o}static parse(r,i){if(3!==r.length)return i.error("Expected two arguments.");let n=i.parse(r[1],1,Mj);if(!n)return null;let a=r[2];if("object"!=typeof a||Array.isArray(a))return i.error("NumberFormat options argument must be an object.");let o=null;if(a.locale&&!(o=i.parse(a.locale,1,MN)))return null;let s=null;if(a.currency&&!(s=i.parse(a.currency,1,MN)))return null;let l=null;if(a.unit&&!(l=i.parse(a.unit,1,MN)))return null;if(s&&l)return i.error("NumberFormat options `currency` and `unit` are mutually exclusive");let u=null;if(a["min-fraction-digits"]&&!(u=i.parse(a["min-fraction-digits"],1,Mj)))return null;let c=null;return!a["max-fraction-digits"]||(c=i.parse(a["max-fraction-digits"],1,Mj))?new t(n,o,s,l,u,c):null}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}},kU=class t{constructor(t){this.type=MJ,this.input=t}static parse(r,i){if(2!==r.length)return i.error("Expected two arguments.");let n=i.parse(r[1],1,MN);return n?new t(n):i.error("No image name provided.")}evaluate(t){let r=this.input.evaluate(t),i=kh.fromString(r);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(r)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}},kq=class t{constructor(t,r){this.input=t,this.key=r,this.type=Mj}static parse(r,i){if(2!==r.length)return i.error(`Expected 1 argument, but found ${r.length-1} instead.`);let n=i.parse(r[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?i.error(`Expected argument of type string or array, but found ${xP(n.type)} instead.`):new t(n,i.key):null}evaluate(t){let r=this.input.evaluate(t);if("string"==typeof r)return[...r].length;if(Array.isArray(r))return r.length;throw new kl(`Expected value to be of type string or array, but found ${xP(x0(r))} instead.`,this.key)}eachChild(t){t(this.input)}outputDefined(){return!1}},kG=8192,kH=class t{constructor(t,r){this.type=MV,this.geojson=t,this.geometries=r}static parse(r,i){if(2!==r.length)return i.error(`'within' expression requires exactly one argument, but found ${r.length-1} instead.`);if(xQ(r[1])){let i=r[1];if("FeatureCollection"===i.type){let r=[];for(let t of i.features){let{type:i,coordinates:n}=t.geometry;"Polygon"===i&&r.push(n),"MultiPolygon"===i&&r.push(...n)}if(r.length)return new t(i,{type:"MultiPolygon",coordinates:r})}else if("Feature"===i.type){let r=i.geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new t(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new t(i,i)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,r){let i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],a=t.canonicalID();if("Polygon"===r.type){let o=bv(r.coordinates,n,a),s=b_(t.geometry(),i,n,a);if(!bf(i,n))return!1;for(let t of s)if(!bm(t,o))return!1}if("MultiPolygon"===r.type){let o=bx(r.coordinates,n,a),s=b_(t.geometry(),i,n,a);if(!bf(i,n))return!1;for(let t of s)if(!function(t,r){for(let i of r)if(bm(t,i))return!0;return!1}(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,r){let i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],a=t.canonicalID();if("Polygon"===r.type){let o=bv(r.coordinates,n,a),s=bw(t.geometry(),i,n,a);if(!bf(i,n))return!1;for(let t of s)if(!bg(t,o))return!1}if("MultiPolygon"===r.type){let o=bx(r.coordinates,n,a),s=bw(t.geometry(),i,n,a);if(!bf(i,n))return!1;for(let t of s)if(!function(t,r){for(let i of r)if(bg(t,i))return!0;return!1}(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},k$=class{constructor(t=[],r=(t,r)=>tr)){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:r,compare:i}=this,n=r[t];for(;t>0;){let a=t-1>>1,o=r[a];if(i(n,o)>=0)break;r[t]=o,t=a}r[t]=n}_down(t){let{data:r,compare:i}=this,n=this.length>>1,a=r[t];for(;ti(r[o],r[n])&&(n=o),i(r[n],a)>=0)break;r[t]=r[n],t=n}r[t]=a}},kW=Math.PI/180,kY=class{constructor(t){let r=6378.137*kW*1e3,i=Math.cos(t*kW),n=1/(1-.0066943799901413165*(1-i*i)),a=Math.sqrt(n);this.kx=r*a*i,this.ky=r*a*n*.9933056200098587}distance(t,r){let i=this.wrap(t[0]-r[0])*this.kx,n=(t[1]-r[1])*this.ky;return Math.sqrt(i*i+n*n)}pointOnLine(t,r){let i=1/0,n,a,o,s;for(let l=0;l1?(u=t[l+1][0],c=t[l+1][1]):f>0&&(u+=h/this.kx*f,c+=d/this.ky*f));let p=(h=this.wrap(r[0]-u)*this.kx)*h+(d=(r[1]-c)*this.ky)*d;p180;)t-=360;return t}},kZ=class t{constructor(t,r){this.type=Mj,this.geojson=t,this.geometries=r}static parse(r,i){if(2!==r.length)return i.error(`'distance' expression requires exactly one argument, but found ${r.length-1} instead.`);if(xQ(r[1])){let i=r[1];if("FeatureCollection"===i.type)return new t(i,i.features.map(t=>bB(t.geometry)).flat());if("Feature"===i.type)return new t(i,bB(i.geometry));if("type"in i&&"coordinates"in i)return new t(i,bB(i))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,r){let i=t.geometry(),n=i.flat().map(r=>bh([r.x,r.y],t.canonical));if(0===i.length)return NaN;let a=new kY(n[0][1]),o=1/0;for(let t of r){switch(t.type){case"Point":o=Math.min(o,bR(n,!1,[t.coordinates],!1,a,o));break;case"LineString":o=Math.min(o,bR(n,!1,t.coordinates,!0,a,o));break;case"Polygon":o=Math.min(o,bO(n,!1,t.coordinates,a,o))}if(0===o)break}return o}(t,this.geometries);if("LineString"===t.geometryType())return function(t,r){let i=t.geometry(),n=i.flat().map(r=>bh([r.x,r.y],t.canonical));if(0===i.length)return NaN;let a=new kY(n[0][1]),o=1/0;for(let t of r){switch(t.type){case"Point":o=Math.min(o,bR(n,!0,[t.coordinates],!1,a,o));break;case"LineString":o=Math.min(o,bR(n,!0,t.coordinates,!0,a,o));break;case"Polygon":o=Math.min(o,bO(n,!0,t.coordinates,a,o))}if(0===o)break}return o}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,r){let i=t.geometry();if(0===i.length||0===i[0].length)return NaN;let n=x4(i,0).map(r=>r.map(r=>r.map(r=>bh([r.x,r.y],t.canonical)))),a=new kY(n[0][0][0][1]),o=1/0;for(let t of r)for(let r of n){switch(t.type){case"Point":o=Math.min(o,bO([t.coordinates],!1,r,a,o));break;case"LineString":o=Math.min(o,bO(t.coordinates,!0,r,a,o));break;case"Polygon":o=Math.min(o,function(t,r,i,n=1/0){let a=bE(t),o=bE(r);if(n!==1/0&&bC(a,o,i)>=n)return n;if(bf(a,o)){if(bP(t,r))return 0}else if(bP(r,t))return 0;let s=1/0;for(let n of t)for(let t=0,a=n.length,o=a-1;ti.parse(t,null,MH))):new kp(a,n)}evaluate(t){return this.arr.map(r=>r.evaluate(t))}eachChild(t){this.arr.forEach(t)}outputDefined(){return this.arr.every(t=>t.outputDefined())}},kJ={"==":kz,"!=":kF,">":kR,"<":kO,">=":kj,"<=":kB,array:kw,at:kS,boolean:kw,case:kI,coalesce:kP,collator:kN,format:kb,image:kU,in:kE,"index-of":kD,interpolate:kv,"interpolate-hcl":kv,"interpolate-lab":kv,length:kq,let:kM,literal:kp,match:kC,number:kw,"number-format":kV,object:kw,semiliteral:kX,slice:kL,step:ky,string:kw,"to-boolean":kA,"to-color":kA,"to-number":kA,"to-string":kA,var:kk,within:kH,distance:kZ,"global-state":kK=class t{constructor(t){this.key=t,this.type=MH}static parse(r,i){if(2!==r.length)return i.error(`Expected 1 argument, but found ${r.length-1} instead.`);let n=r[1];return null==n?i.error("Global state property must be defined."):"string"==typeof n?new t(n):i.error(`Global state property must be string, but found ${typeof r[1]} instead.`)}evaluate(t){var r,i;let n=null==(r=t.globals)?void 0:r.globalState;return n&&0!==Object.keys(n).length&&null!=(i=xH(n,this.key))?i:null}eachChild(){}outputDefined(){return!1}}},kQ=class extends Error{constructor(t,r){super(r),this.message=r,this.key=t}},k0=class t{constructor(t,r=[]){for(let[i,n]of(this.parent=t,this.bindings={},r))this.bindings[i]=n}concat(r){return new t(this,r)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}},k1=class t{constructor(t,r,i=[],n,a=new k0,o=[]){this.registry=t,this.path=i,this.key=i.map(t=>`[${t}]`).join(""),this.scope=a,this.errors=o,this.expectedType=n,this._isConstant=r}parse(t,r,i,n,a={}){return r?this.concat(r,i,n)._parse(t,a):this._parse(t,a)}_parse(t,r){(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t)&&(t=["literal",t]);let i=this.key;function n(t,r,n){return"assert"===n?new kw(r,[t],i):"coerce"===n?new kA(r,[t],i):t}if(Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let i=t[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let a=this.registry[i];if(a){let i=a.parse(t,this);if(!i)return null;if(this.expectedType){let t=this.expectedType,a=i.type;if(("string"===t.kind||"number"===t.kind||"boolean"===t.kind||"object"===t.kind||"array"===t.kind)&&"value"===a.kind)i=n(i,t,r.typeAnnotation||"assert");else if("projectionDefinition"===t.kind&&["string","array","value"].includes(a.kind)||["color","formatted","resolvedImage"].includes(t.kind)&&["value","string"].includes(a.kind)||["padding","numberArray"].includes(t.kind)&&["value","number","array"].includes(a.kind)||"colorArray"===t.kind&&["value","string","array"].includes(a.kind)||"variableAnchorOffsetCollection"===t.kind&&["value","array"].includes(a.kind))i=n(i,t,r.typeAnnotation||"coerce");else if(this.checkSubtype(t,a))return null}if(!(i instanceof kp)&&"resolvedImage"!==i.type.kind&&this._isConstant(i)){let t=new kg;try{i=new kp(i.type,i.evaluate(t))}catch(t){return this.error(t.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(r,i,n){let a="number"==typeof r?this.path.concat(r):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,this._isConstant,a,i||null,o,this.errors)}error(t,...r){let i=`${this.key}${r.map(t=>`[${t}]`).join("")}`;this.errors.push(new kQ(i,t))}checkSubtype(t,r){let i=xz(t,r);return i&&this.error(i),i}},(k2=class t{constructor(t,r,i,n,a){this.name=t,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(t){return this._evaluate(t,this.args,this.key)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(r,i){let n=r[0],a=t.definitions[n];if(!a)return i.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(a)?a[0]:a.type,s=Array.isArray(a)?[[a[1],a[2]]]:a.overloads,l=s.filter(([t])=>!Array.isArray(t)||t.length===r.length-1),u=null;for(let[a,s]of l){u=new k1(i.registry,bq,i.path,null,i.scope);let l=[],c=!1;for(let t=1;t{var r;return Array.isArray(r=t)?`(${r.map(xP).join(", ")})`:`(${xP(r.type)}...)`}).join(" | "),n=[];for(let t=1;t{throw new kl(r.evaluate(t),i)}],typeof:[MN,[MH],(t,[r])=>xP(x0(r.evaluate(t)))],"to-rgba":[xL(Mj,4),[MU],(t,[r])=>{let[i,n,a,o]=r.evaluate(t).rgb;return[255*i,255*n,255*a,o]}],rgb:[MU,[Mj,Mj,Mj],bj],rgba:[MU,[Mj,Mj,Mj,Mj],bj],has:{type:MV,overloads:[[[MN],(t,[r])=>bN(r.evaluate(t),t.properties())],[[MN,MG],(t,[r,i])=>bN(r.evaluate(t),i.evaluate(t))]]},get:{type:MH,overloads:[[[MN],(t,[r])=>bV(r.evaluate(t),t.properties())],[[MN,MG],(t,[r,i])=>bV(r.evaluate(t),i.evaluate(t))]]},"feature-state":[MH,[MN],(t,[r])=>bV(r.evaluate(t),t.featureState||{})],properties:[MG,[],t=>t.properties()],"geometry-type":[MN,[],t=>t.geometryType()],id:[MH,[],t=>t.id()],zoom:[Mj,[],t=>t.globals.zoom],"heatmap-density":[Mj,[],t=>t.globals.heatmapDensity||0],elevation:[Mj,[],t=>t.globals.elevation||0],"line-progress":[Mj,[],t=>t.globals.lineProgress||0],accumulated:[MH,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Mj,bU(Mj),(t,r)=>{let i=0;for(let n of r)i+=n.evaluate(t);return i}],"*":[Mj,bU(Mj),(t,r)=>{let i=1;for(let n of r)i*=n.evaluate(t);return i}],"-":{type:Mj,overloads:[[[Mj,Mj],(t,[r,i])=>r.evaluate(t)-i.evaluate(t)],[[Mj],(t,[r])=>-r.evaluate(t)]]},"/":[Mj,[Mj,Mj],(t,[r,i])=>r.evaluate(t)/i.evaluate(t)],"%":[Mj,[Mj,Mj],(t,[r,i])=>r.evaluate(t)%i.evaluate(t)],ln2:[Mj,[],()=>Math.LN2],pi:[Mj,[],()=>Math.PI],e:[Mj,[],()=>Math.E],"^":[Mj,[Mj,Mj],(t,[r,i])=>r.evaluate(t)**i.evaluate(t)],sqrt:[Mj,[Mj],(t,[r])=>Math.sqrt(r.evaluate(t))],log10:[Mj,[Mj],(t,[r])=>Math.log(r.evaluate(t))/Math.LN10],ln:[Mj,[Mj],(t,[r])=>Math.log(r.evaluate(t))],log2:[Mj,[Mj],(t,[r])=>Math.log(r.evaluate(t))/Math.LN2],sin:[Mj,[Mj],(t,[r])=>Math.sin(r.evaluate(t))],cos:[Mj,[Mj],(t,[r])=>Math.cos(r.evaluate(t))],tan:[Mj,[Mj],(t,[r])=>Math.tan(r.evaluate(t))],asin:[Mj,[Mj],(t,[r])=>Math.asin(r.evaluate(t))],acos:[Mj,[Mj],(t,[r])=>Math.acos(r.evaluate(t))],atan:[Mj,[Mj],(t,[r])=>Math.atan(r.evaluate(t))],min:[Mj,bU(Mj),(t,r)=>Math.min(...r.map(r=>r.evaluate(t)))],max:[Mj,bU(Mj),(t,r)=>Math.max(...r.map(r=>r.evaluate(t)))],abs:[Mj,[Mj],(t,[r])=>Math.abs(r.evaluate(t))],round:[Mj,[Mj],(t,[r])=>{let i=r.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Mj,[Mj],(t,[r])=>Math.floor(r.evaluate(t))],ceil:[Mj,[Mj],(t,[r])=>Math.ceil(r.evaluate(t))],"filter-==":[MV,[MN,MH],(t,[r,i])=>t.properties()[r.value]===i.value],"filter-id-==":[MV,[MH],(t,[r])=>t.id()===r.value],"filter-type-==":[MV,[MN],(t,[r])=>t.geometryType()===r.value],"filter-<":[MV,[MN,MH],(t,[r,i])=>{let n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n{let i=t.id(),n=r.value;return typeof i==typeof n&&i":[MV,[MN,MH],(t,[r,i])=>{let n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n>a}],"filter-id->":[MV,[MH],(t,[r])=>{let i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[MV,[MN,MH],(t,[r,i])=>{let n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n<=a}],"filter-id-<=":[MV,[MH],(t,[r])=>{let i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[MV,[MN,MH],(t,[r,i])=>{let n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n>=a}],"filter-id->=":[MV,[MH],(t,[r])=>{let i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[MV,[MH],(t,[r])=>{let i=r.value,n=t.properties();return i in n&&void 0!==n[i]}],"filter-has-id":[MV,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[MV,[xL(MN)],(t,[r])=>r.value.indexOf(t.geometryType())>=0],"filter-id-in":[MV,[xL(MH)],(t,[r])=>r.value.indexOf(t.id())>=0],"filter-in-small":[MV,[MN,xL(MH)],(t,[r,i])=>i.value.indexOf(t.properties()[r.value])>=0],"filter-in-large":[MV,[MN,xL(MH)],(t,[r,i])=>(function(t,r,i,n){for(;i<=n;){let a=i+n>>1;if(r[a]===t)return!0;r[a]>t?n=a-1:i=a+1}return!1})(t.properties()[r.value],i.value,0,i.value.length-1)],all:{type:MV,overloads:[[[MV,MV],(t,[r,i])=>r.evaluate(t)&&i.evaluate(t)],[bU(MV),(t,r)=>{for(let i of r)if(!i.evaluate(t))return!1;return!0}]]},any:{type:MV,overloads:[[[MV,MV],(t,[r,i])=>r.evaluate(t)||i.evaluate(t)],[bU(MV),(t,r)=>{for(let i of r)if(i.evaluate(t))return!0;return!1}]]},"!":[MV,[MV],(t,[r])=>!r.evaluate(t)],"is-supported-script":[MV,[MN],(t,[r])=>{let i=t.globals&&t.globals.isSupportedScript;return!i||i(r.evaluate(t))}],upcase:[MN,[MN],(t,[r])=>r.evaluate(t).toUpperCase()],downcase:[MN,[MN],(t,[r])=>r.evaluate(t).toLowerCase()],concat:[MN,bU(MH),(t,r)=>r.map(r=>x1(r.evaluate(t))).join("")],split:[xL(MN),[MN,MN],(t,[r,i])=>r.evaluate(t).split(i.evaluate(t))],join:[MN,[xL(MN),MN],(t,[r,i])=>r.evaluate(t).join(i.evaluate(t))],"resolved-locale":[MN,[MW],(t,[r])=>r.evaluate(t).resolvedLocale()]}),k3=/^(.*)-transition$/,k5=class{constructor(t,r,i,n){this.expression=t,this._warningHistory={},this._evaluator=new kg,this._defaultValue=i?_i(i):null,this._enumValues=i&&"enum"===i.type?i.values:null,this._globalState=n,this._rootKey=r}evaluateWithoutErrorHandling(t,r,i,n,a,o){return this._globalState&&(t=_n(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,r,i,n,a,o){this._globalState&&(t=_n(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o||null;try{let t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new kl(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`,"");return t}catch(i){let t=i instanceof kl?i.path:"",r=`${t}|${i.message}`;return this._warningHistory[r]||(this._warningHistory[r]=!0,"u">typeof console&&console.warn(b8(this._rootKey,t,i.message,this._defaultValue))),this._defaultValue}}},k4=class{constructor(t,r,i){this.kind=t,this._styleExpression=r,this.isStateDependent="constant"!==t&&!bH(r.expression),this.globalStateRefs=_r(r.expression),this._globalState=i}evaluateWithoutErrorHandling(t,r,i,n,a,o){return this._globalState&&(t=_n(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,r,i,n,a,o)}evaluate(t,r,i,n,a,o){return this._globalState&&(t=_n(t,this._globalState)),this._styleExpression.evaluate(t,r,i,n,a,o)}},k6=class{constructor(t,r,i,n,a){this.kind=t,this.zoomStops=i,this._styleExpression=r,this.isStateDependent="camera"!==t&&!bH(r.expression),this.globalStateRefs=_r(r.expression),this.interpolationType=n,this._globalState=a}evaluateWithoutErrorHandling(t,r,i,n,a,o){return this._globalState&&(t=_n(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,r,i,n,a,o)}evaluate(t,r,i,n,a,o){return this._globalState&&(t=_n(t,this._globalState)),this._styleExpression.evaluate(t,r,i,n,a,o)}interpolationFactor(t,r,i){return this.interpolationType?kv.interpolationFactor(this.interpolationType,t,r,i):0}},k8=class t{constructor(t,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,b7(r),this._parameters=t,this._specification=i,this._rootKey=r,this._defaultValue=_i(i),this._warningHistory={};let n=function t(r,i){var n;let a=r.stops&&"object"==typeof r.stops[0][0],o=a||void 0!==r.property,s=r.type||(bZ(i)?"exponential":"interval"),l=function(t){switch(t.type){case"color":return kt.parse;case"padding":return ka.parse;case"numberArray":return ko.parse;case"colorArray":return ks.parse;default:return null}}(i);if(l&&((r=bX({},r)).stops&&(r.stops=r.stops.map(t=>[t[0],l(t[1])])),r.default?r.default=l(r.default):r.default=l(i.default)),r.colorSpace&&"rgb"!==(n=r.colorSpace)&&"hcl"!==n&&"lab"!==n)throw Error(`Unknown color space: "${r.colorSpace}"`);let u=function(t){switch(t){case"exponential":return b3;case"interval":return b2;case"categorical":return b1;case"identity":return b5;default:throw Error(`Unknown function type "${t}"`)}}(s),c,h;if("categorical"===s){for(let t of(c=Object.create(null),r.stops))c[t[0]]=t[1];h=typeof r.stops[0][0]}if(a){let n={},a=[];for(let t=0;tt[0]),evaluate:({zoom:t},n)=>b3({stops:o,base:r.base},i,t).evaluate(t,n)}}if(a||!o){let t="exponential"===s?{name:"exponential",base:void 0===r.base?1:r.base}:null;return{kind:"camera",interpolationType:t,interpolationFactor:kv.interpolationFactor.bind(void 0,t),zoomStops:r.stops.map(t=>t[0]),evaluate:({zoom:t})=>u(r,i,t,c,h)}}return{kind:"source",evaluate(t,n){let a=n&&n.properties?n.properties[r.property]:void 0;return void 0===a?b0(r.default,i.default):u(r,i,a,c,h)}}}(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(t,r){try{return this._innerEvaluate(t,r)}catch(i){let t=i instanceof Error?i.message:String(i),r=`|${t}`;return this._warningHistory[r]||(this._warningHistory[r]=!0,"u">typeof console&&console.warn(b8(this._rootKey,"",t,this._defaultValue))),this._defaultValue}}static deserialize(r){return new t(r._parameters,r._rootKey,r._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification,_rootKey:t._rootKey}}},k7={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},k9={promoteId:_z},Se=1114111,St=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i,Sr={"*":()=>[],array:_b,boolean:_A,number:__,color:_M,constants:_g,enum:_k,filter:_S,function:_w,layer:_I,object:_x,source:_P,light:_F,sky:_O,terrain:_R,projection:_H,projectionDefinition:_$,string:_L,formatted:_B,resolvedImage:_j,padding:_N,numberArray:_V,colorArray:_U,variableAnchorOffsetCollection:_q,sprite:_G,state:_Y,fontFaces:_Z},_J.source=_1(_Q(_P)),_J.sprite=_1(_Q(_G)),_J.glyphs=_1(_Q(_K)),_J.fontFaces=_1(_Q(_Z)),_J.light=_1(_Q(_F)),_J.sky=_1(_Q(_O)),_J.terrain=_1(_Q(_R)),_J.state=_1(_Q(_Y)),_J.layer=_1(_Q(_I)),_J.filter=_1(_Q(_S)),_J.paintProperty=_1(_Q(_D)),_J.layoutProperty=_1(_Q(_C)),Si={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},Sn=class{constructor(t,r,i){this._rootKey=r,this._globalState=i,this.setValue(t)}evaluate(){var t;return null!=(t=this._literalValue)?t:this._compiledValue.evaluate({})}setValue(t){if(null==t||"visible"===t||"none"===t){this._literalValue="none"===t?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let r=_e(t,this._rootKey,Si,this._globalState);if("error"===r.result)throw this._literalValue="visible",this._compiledValue=void 0,Error(r.value.map(t=>`${t.key}: ${t.message}`).join(", "));this._literalValue=void 0,this._compiledValue=r.value,this._globalStateRefs=_r(r.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}},Sa=_J,So=new Set(Object.keys(MF).filter(t=>t.startsWith("source_")).map(t=>t.slice(7).replaceAll("_","-"))),Ss=class t{constructor(t,r,i){let n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let a=new Int32Array(this.arrayBuffer);t=a[0],r=a[1],i=a[2],this.d=r+2*i;for(let t=0;t=c[u+0]&&n>=c[u+1])?(s[h]=!0,o.push(a[h])):s[h]=!1}}}_forEachCell(t,r,i,n,a,o,s,l){let u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i),d=this._convertToCellCoord(n);for(let f=u;f<=h;f++)for(let u=c;u<=d;u++){let c=this.d*u+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(u),this._convertFromCellCoord(f+1),this._convertFromCellCoord(u+1)))&&a.call(this,t,r,i,n,c,o,s,l))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,r=3+this.cells.length+1+1,i=0;for(let t of this.cells)i+=t.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let r=0;ri?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=r):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*r}}},Sh="-transition",Sd=class{constructor(t,r,i,n){this.property=t,this.value=r,this.expression=function(t,r,i,n){if(bJ(t))return new k8(t,r,i);if(b9(t)){let a=_t(t,r,i,n);if("error"===a.result)throw Error(a.value.map(t=>`${t.key}: ${t.message}`).join(", "));return a.value}{let r=t;return"color"===i.type&&"string"==typeof t?r=kt.parse(t):"padding"===i.type&&("number"==typeof t||Array.isArray(t))?r=ka.parse(t):"numberArray"===i.type&&("number"==typeof t||Array.isArray(t))?r=ko.parse(t):"colorArray"===i.type&&("string"==typeof t||Array.isArray(t))?r=ks.parse(t):"variableAnchorOffsetCollection"===i.type&&Array.isArray(t)?r=kc.parse(t):"projectionDefinition"===i.type&&"string"==typeof t&&(r=kd.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>r}}}(void 0===r?t.specification.default:r,i,t.specification,n)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,r,i){return this.property.possiblyEvaluate(this,t,r,i)}},Sf=class{constructor(t,r,i){this.property=t,this.value=new Sd(t,void 0,r,i)}transitioned(t,r){return new Sm(this.property,this.value,r,xn({},t.transition,this.transition),t.now)}untransitioned(){return new Sm(this.property,this.value,null,{},0)}},Sp=class{constructor(t,r,i){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=i,this._rootKey=r}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return xd(this._values[t].value.value)}setValue(t,r){Object.hasOwn(this._values,t)||(this._values[t]=new Sf(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new Sd(this._values[t].property,null===r?void 0:xd(r),this._propertyRootKey(t),this._globalState)}getTransition(t){return xd(this._values[t].transition)}setTransition(t,r){Object.hasOwn(this._values,t)||(this._values[t]=new Sf(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=xd(r)||void 0}serialize(){let t={};for(let r of Object.keys(this._values)){let i=this.getValue(r);void 0!==i&&(t[r]=i);let n=this.getTransition(r);void 0!==n&&(t[`${r}${Sh}`]=n)}return t}transitioned(t,r){let i=new Sg(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(t,r._values[n]);return i}untransitioned(){let t=new Sg(this._properties);for(let r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}},Sm=class{constructor(t,r,i,n,a){this.property=t,this.value=r,this.begin=a+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(t,r,i){let n=t.now||0,a=this.value.possiblyEvaluate(t,r,i),o=this.prior;if(!o)return a;if(n>this.end||this.value.isDataDriven())return this.prior=null,a;if(n=1)return 1;let r=t*t,i=r*t;return 4*(t<.5?i:3*(t-r)+i-.75)}(s))}}},Sg=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,i){let n=new Sx(this._properties);for(let a of Object.keys(this._values))n._values[a]=this._values[a].possiblyEvaluate(t,r,i);return n}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}},Sy=class{constructor(t,r,i){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=i,this._rootKey=r}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasValue(t){return void 0!==this._values[t].value}hasProperty(t){return t in this._properties.defaultPropertyValues}getValue(t){return xd(this._values[t].value)}setValue(t,r){this._values[t]=new Sd(this._values[t].property,null===r?void 0:xd(r),this._propertyRootKey(t),this._globalState)}serialize(){let t={};for(let r of Object.keys(this._values)){let i=this.getValue(r);void 0!==i&&(t[r]=i)}return t}possiblyEvaluate(t,r,i){let n=new Sx(this._properties);for(let a of Object.keys(this._values))n._values[a]=this._values[a].possiblyEvaluate(t,r,i);return n}},Sv=class{constructor(t,r,i){this.property=t,this.value=r,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,r,i,n){return this.property.evaluate(this.value,this.parameters,t,r,i,n)}},Sx=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}},Sb=class{constructor(t,r){this.specification=t,this.name=r}possiblyEvaluate(t,r){if(t.isDataDriven())throw Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,i){if(wr(t,r))return xf(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),r;let n=kx[this.specification.type];return n?n(t,r,i):t}},S_=class{constructor(t,r,i){this.specification=t,this.name=r,this.overrides=i}possiblyEvaluate(t,r,i,n){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Sv(this,{kind:"constant",value:t.expression.evaluate(r,null,{},i,n)},r):new Sv(this,t.expression,r)}interpolate(t,r,i){if("constant"!==t.value.kind||"constant"!==r.value.kind)return t;if(void 0===t.value.value||void 0===r.value.value)return new Sv(this,{kind:"constant",value:void 0},t.parameters);if(wr(t.value.value,r.value.value))return xf(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),r;let n=kx[this.specification.type];return n?new Sv(this,{kind:"constant",value:n(t.value.value,r.value.value,i)},t.parameters):t}evaluate(t,r,i,n,a,o){return"constant"===t.kind?t.value:t.evaluate(r,i,n,a,o)}},Sw=class extends S_{possiblyEvaluate(t,r,i,n){if(void 0===t.value)return new Sv(this,{kind:"constant",value:void 0},r);if("constant"===t.expression.kind){let a=t.expression.evaluate(r,null,{},i,n),o="resolvedImage"===t.property.specification.type&&"string"!=typeof a?a.name:a;return new Sv(this,{kind:"constant",value:this._calculate(o,o,o,r)},r)}return"camera"===t.expression.kind?new Sv(this,{kind:"constant",value:this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r)},r):new Sv(this,t.expression,r)}evaluate(t,r,i,n,a,o){if("source"===t.kind){let s=t.evaluate(r,i,n,a,o);return this._calculate(s,s,s,r)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},i,n),t.evaluate({zoom:Math.floor(r.zoom)},i,n),t.evaluate({zoom:Math.floor(r.zoom)+1},i,n),r):t.value}_calculate(t,r,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:i,to:r}}interpolate(t){return t}},ST=class{constructor(t,r){this.specification=t,this.name=r}possiblyEvaluate(t,r,i,n){if(void 0!==t.value){if("constant"===t.expression.kind){let a=t.expression.evaluate(r,null,{},i,n);return this._calculate(a,a,a,r)}return this._calculate(t.expression.evaluate(new Sc(Math.floor(r.zoom-1),r)),t.expression.evaluate(new Sc(Math.floor(r.zoom),r)),t.expression.evaluate(new Sc(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:i,to:r}}interpolate(t){return t}},SA=class{constructor(t,r){this.specification=t,this.name=r}possiblyEvaluate(t,r,i,n){return!!t.expression.evaluate(r,null,{},i,n)}interpolate(){return!1}},SM=class{constructor(t){for(let r in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){let i=t[r];i.specification.overridable&&this.overridableProperties.push(r);let n=this.defaultPropertyValues[r]=new Sd(i,void 0,i.name,void 0),a=this.defaultTransitionablePropertyValues[r]=new Sf(i,i.name,void 0);this.defaultTransitioningPropertyValues[r]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=n.possiblyEvaluate({})}}},_4("DataDrivenProperty",S_),_4("DataConstantProperty",Sb),_4("CrossFadedDataDrivenProperty",Sw),_4("CrossFadedProperty",ST),_4("ColorRampProperty",SA),Sk=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",SS=class extends MP{constructor(t,r,i){if(super(),this.id=t.id,this.type=t.type,this._globalState=i,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(t,r,i){return new Sn(t,r,i)}(this.visibility,`layers[${this.id}].layout.visibility`,i),"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=_c(t.filter,`layers[${this.id}].filter`,i)),r.layout&&(this._unevaluatedLayout=new Sy(r.layout,`layers[${this.id}].layout`,i)),r.paint)){for(let n in this._transitionablePaint=new Sp(r.paint,`layers[${this.id}].paint`,i),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(let r in t.layout)this.setLayoutProperty(r,t.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Sx(r.paint)}}setFilter(t){this.filter=t,this._featureFilter=_c(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){var r;if("visibility"===t)return this.visibility;if(null!=(r=this._transitionablePaint)&&r.hasProperty(t))throw Error(t+" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?");if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let r of this._visibilityExpression.getGlobalStateRefs())t.add(r);if(this._unevaluatedLayout)for(let r in this._unevaluatedLayout._values)for(let i of this._unevaluatedLayout._values[r].getGlobalStateRefs())t.add(i);for(let r of this._featureFilter.getGlobalStateRefs())t.add(r);return t}getPaintAffectingGlobalStateRefs(){var t;let r=new globalThis.Map;if(this._transitionablePaint)for(let i in this._transitionablePaint._values){let n=this._transitionablePaint._values[i].value;for(let a of n.getGlobalStateRefs()){let o=null!=(t=r.get(a))?t:[];o.push({name:i,value:n.value}),r.set(a,o)}}return r}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,r,i={}){var n;if("visibility"===t){this.visibility=r,this._visibilityExpression.setValue(r),this.recalculateVisibility();return}null!=(n=this._transitionablePaint)&&n.hasProperty(t)?this.fire(new ML(Error(t+" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?"))):null!=r&&this._validate(Sa.layoutProperty,`layers.${this.id}.layout.${t}`,t,r,i)||this._unevaluatedLayout.setValue(t,r)}getPaintProperty(t){var r,i;if(t.endsWith("-transition")){let i=t.slice(0,-11);if("visibility"===i||null!=(r=this._unevaluatedLayout)&&r.hasProperty(i))throw Error(t+Sk);return this._transitionablePaint.getTransition(i)}if("visibility"===t||null!=(i=this._unevaluatedLayout)&&i.hasProperty(t))throw Error(t+Sk);return this._transitionablePaint.getValue(t)}setPaintProperty(t,r,i={}){var n;if("visibility"===t||null!=(n=this._unevaluatedLayout)&&n.hasProperty(t))return this.fire(new ML(Error(t+Sk))),!1;if(null!=r&&this._validate(Sa.paintProperty,`layers.${this.id}.paint.${t}`,t,r,i))return!1;if(t.endsWith("-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{let i=this._transitionablePaint._values[t],n="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),o=i.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);let s=this._transitionablePaint._values[t].value;return s.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(t,o,s)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,i){return!1}isHidden(t=this.minzoom,r=!1){return!!(this.minzoom&&t<(r?Math.floor(this.minzoom):this.minzoom))||!!this.maxzoom&&t>=this.maxzoom||"none"===this._evaluatedVisibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){var t,r;let i={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:null==(t=this._unevaluatedLayout)?void 0:t.serialize(),paint:null==(r=this._transitionablePaint)?void 0:r.serialize()};return this.visibility&&(i.layout||(i.layout={}),i.layout.visibility=this.visibility),xc(i,(t,r)=>void 0!==t&&!("layout"===r&&!Object.keys(t).length)&&!("paint"===r&&!Object.keys(t).length))}_validate(t,r,i,n,a={}){return _5(this,t,{key:r,layerType:this.type,objectKey:i,value:n},a)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let r=this.paint.get(t);if(r instanceof Sv&&bW(r.property.specification)&&("source"===r.value.kind||"composite"===r.value.kind)&&r.value.isStateDependent)return!0}return!1}},SD={get paint(){return SE||(SE=new SM({"raster-opacity":new Sb(MF.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new Sb(MF.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new Sb(MF.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new Sb(MF.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new Sb(MF.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new Sb(MF.paint_raster["raster-contrast"],"raster-contrast"),resampling:new Sb(MF.paint_raster.resampling,"resampling"),"raster-resampling":new Sb(MF.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new Sb(MF.paint_raster["raster-fade-duration"],"raster-fade-duration")}))}},SC=t=>"raster"===t.type,SI=class extends SS{constructor(t,r){super(t,SD,r)}},SL={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},SP=class{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},Sz=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}},SF=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,r)}emplace(t,r,i){let n=2*t;return this.int16[n+0]=r,this.int16[n+1]=i,t}},SF.prototype.bytesPerElement=4,_4("StructArrayLayout2i4",SF),SO=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,r,i)}emplace(t,r,i,n){let a=3*t;return this.int16[a+0]=r,this.int16[a+1]=i,this.int16[a+2]=n,t}},SO.prototype.bytesPerElement=6,_4("StructArrayLayout3i6",SO),SR=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,r,i,n)}emplace(t,r,i,n,a){let o=4*t;return this.int16[o+0]=r,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=a,t}},SR.prototype.bytesPerElement=8,_4("StructArrayLayout4i8",SR),SB=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,t,r,i,n,a,o)}emplace(t,r,i,n,a,o,s){let l=6*t;return this.int16[l+0]=r,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+3]=a,this.int16[l+4]=o,this.int16[l+5]=s,t}},SB.prototype.bytesPerElement=12,_4("StructArrayLayout2i4i12",SB),Sj=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,t,r,i,n,a,o)}emplace(t,r,i,n,a,o,s){let l=4*t,u=8*t;return this.int16[l+0]=r,this.int16[l+1]=i,this.uint8[u+4]=n,this.uint8[u+5]=a,this.uint8[u+6]=o,this.uint8[u+7]=s,t}},Sj.prototype.bytesPerElement=8,_4("StructArrayLayout2i4ub8",Sj),SN=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,r)}emplace(t,r,i){let n=2*t;return this.float32[n+0]=r,this.float32[n+1]=i,t}},SN.prototype.bytesPerElement=8,_4("StructArrayLayout2f8",SN),SV=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o,s,l,u,c){let h=this.length;return this.resize(h+1),this.emplace(h,t,r,i,n,a,o,s,l,u,c)}emplace(t,r,i,n,a,o,s,l,u,c,h){let d=10*t;return this.uint16[d+0]=r,this.uint16[d+1]=i,this.uint16[d+2]=n,this.uint16[d+3]=a,this.uint16[d+4]=o,this.uint16[d+5]=s,this.uint16[d+6]=l,this.uint16[d+7]=u,this.uint16[d+8]=c,this.uint16[d+9]=h,t}},SV.prototype.bytesPerElement=20,_4("StructArrayLayout10ui20",SV),SU=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o,s,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,r,i,n,a,o,s,l)}emplace(t,r,i,n,a,o,s,l,u){let c=8*t;return this.uint16[c+0]=r,this.uint16[c+1]=i,this.uint16[c+2]=n,this.uint16[c+3]=a,this.uint16[c+4]=o,this.uint16[c+5]=s,this.uint16[c+6]=l,this.uint16[c+7]=u,t}},SU.prototype.bytesPerElement=16,_4("StructArrayLayout8ui16",SU),Sq=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o,s,l,u,c,h,d,f){let p=this.length;return this.resize(p+1),this.emplace(p,t,r,i,n,a,o,s,l,u,c,h,d,f)}emplace(t,r,i,n,a,o,s,l,u,c,h,d,f,p){let m=14*t;return this.int16[m+0]=r,this.int16[m+1]=i,this.int16[m+2]=n,this.int16[m+3]=a,this.uint16[m+4]=o,this.uint16[m+5]=s,this.uint16[m+6]=l,this.uint16[m+7]=u,this.int16[m+8]=c,this.int16[m+9]=h,this.int16[m+10]=d,this.int16[m+11]=f,this.float32[7*t+6]=p,t}},Sq.prototype.bytesPerElement=28,_4("StructArrayLayout4i4ui4i1f28",Sq),SG=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,r,i)}emplace(t,r,i,n){let a=3*t;return this.float32[a+0]=r,this.float32[a+1]=i,this.float32[a+2]=n,t}},SG.prototype.bytesPerElement=12,_4("StructArrayLayout3f12",SG),SH=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[+t+0]=r,t}},SH.prototype.bytesPerElement=4,_4("StructArrayLayout1ul4",SH),S$=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o,s,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,t,r,i,n,a,o,s,l,u)}emplace(t,r,i,n,a,o,s,l,u,c){let h=10*t;return this.int16[h+0]=r,this.int16[h+1]=i,this.int16[h+2]=n,this.int16[h+3]=a,this.int16[h+4]=o,this.int16[h+5]=s,this.uint32[5*t+3]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t}},S$.prototype.bytesPerElement=20,_4("StructArrayLayout6i1ul2ui20",S$),SW=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,t,r,i,n,a,o)}emplace(t,r,i,n,a,o,s){let l=6*t;return this.int16[l+0]=r,this.int16[l+1]=i,this.int16[l+2]=n,this.int16[l+3]=a,this.int16[l+4]=o,this.int16[l+5]=s,t}},SW.prototype.bytesPerElement=12,_4("StructArrayLayout2i2i2i12",SW),SY=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,r,i,n,a)}emplace(t,r,i,n,a,o){let s=4*t,l=8*t;return this.float32[s+0]=r,this.float32[s+1]=i,this.float32[s+2]=n,this.int16[l+6]=a,this.int16[l+7]=o,t}},SY.prototype.bytesPerElement=16,_4("StructArrayLayout2f1f2i16",SY),SZ=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,t,r,i,n,a,o)}emplace(t,r,i,n,a,o,s){let l=16*t,u=4*t,c=8*t;return this.uint8[l+0]=r,this.uint8[l+1]=i,this.float32[u+1]=n,this.float32[u+2]=a,this.int16[c+6]=o,this.int16[c+7]=s,t}},SZ.prototype.bytesPerElement=16,_4("StructArrayLayout2ub2f2i16",SZ),SX=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,r,i)}emplace(t,r,i,n){let a=3*t;return this.uint16[a+0]=r,this.uint16[a+1]=i,this.uint16[a+2]=n,t}},SX.prototype.bytesPerElement=6,_4("StructArrayLayout3ui6",SX),SK=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v){let x=this.length;return this.resize(x+1),this.emplace(x,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v)}emplace(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x){let b=26*t,_=13*t,w=52*t;return this.int16[b+0]=r,this.int16[b+1]=i,this.uint16[b+2]=n,this.uint16[b+3]=a,this.uint32[_+2]=o,this.uint32[_+3]=s,this.uint32[_+4]=l,this.uint16[b+10]=u,this.uint16[b+11]=c,this.uint16[b+12]=h,this.float32[_+7]=d,this.float32[_+8]=f,this.uint8[w+36]=p,this.uint8[w+37]=m,this.uint8[w+38]=g,this.uint32[_+10]=y,this.int16[b+22]=v,this.float32[_+12]=x,t}},SK.prototype.bytesPerElement=52,_4("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",SK),SJ=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D){let C=this.length;return this.resize(C+1),this.emplace(C,t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D)}emplace(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D,C){let I=34*t,L=17*t;return this.int16[I+0]=r,this.int16[I+1]=i,this.int16[I+2]=n,this.int16[I+3]=a,this.int16[I+4]=o,this.int16[I+5]=s,this.int16[I+6]=l,this.int16[I+7]=u,this.uint16[I+8]=c,this.uint16[I+9]=h,this.uint16[I+10]=d,this.uint16[I+11]=f,this.uint16[I+12]=p,this.uint16[I+13]=m,this.uint16[I+14]=g,this.uint16[I+15]=y,this.uint16[I+16]=v,this.uint16[I+17]=x,this.uint16[I+18]=b,this.uint16[I+19]=_,this.uint16[I+20]=w,this.uint16[I+21]=T,this.uint16[I+22]=A,this.uint32[L+12]=M,this.float32[L+13]=k,this.float32[L+14]=S,this.uint16[I+30]=E,this.uint16[I+31]=D,this.float32[L+16]=C,t}},SJ.prototype.bytesPerElement=68,_4("StructArrayLayout8i15ui1ul2f2ui1f68",SJ),SQ=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[+t+0]=r,t}},SQ.prototype.bytesPerElement=4,_4("StructArrayLayout1f4",SQ),S0=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,r,i)}emplace(t,r,i,n){let a=3*t;return this.uint16[6*t+0]=r,this.float32[a+1]=i,this.float32[a+2]=n,t}},S0.prototype.bytesPerElement=12,_4("StructArrayLayout1ui2f12",S0),S1=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,r,i)}emplace(t,r,i,n){let a=4*t;return this.uint32[2*t+0]=r,this.uint16[a+2]=i,this.uint16[a+3]=n,t}},S1.prototype.bytesPerElement=8,_4("StructArrayLayout1ul2ui8",S1),S2=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,r)}emplace(t,r,i){let n=2*t;return this.uint16[n+0]=r,this.uint16[n+1]=i,t}},S2.prototype.bytesPerElement=4,_4("StructArrayLayout2ui4",S2),S3=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[+t+0]=r,t}},S3.prototype.bytesPerElement=2,_4("StructArrayLayout1ui2",S3),(S5=class extends Sz{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,r,i,n)}emplace(t,r,i,n,a){let o=4*t;return this.float32[o+0]=r,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=a,t}}).prototype.bytesPerElement=16,_4("StructArrayLayout4f16",S5),(S4=class extends SP{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new vu(this.anchorPointX,this.anchorPointY)}}).prototype.size=20,_4("CollisionBoxArray",S6=class extends S${get(t){return new S4(this,t)}}),(S8=class extends SP{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}}).prototype.size=52,_4("PlacedSymbolArray",S7=class extends SK{get(t){return new S8(this,t)}}),(S9=class extends SP{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}}).prototype.size=68,_4("SymbolInstanceArray",Ee=class extends SJ{get(t){return new S9(this,t)}}),_4("GlyphOffsetArray",Et=class extends SQ{getoffsetX(t){return this.float32[+t+0]}}),_4("SymbolLineVertexArray",Er=class extends SO{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}),(Ei=class extends SP{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}).prototype.size=12,_4("TextAnchorOffsetArray",En=class extends S0{get(t){return new Ei(this,t)}}),(Ea=class extends SP{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]}}).prototype.size=8,_4("FeatureIndexArray",Eo=class extends S1{get(t){return new Ea(this,t)}}),Es=class extends SF{},El=class extends SO{},Eu=class extends SR{},Ec=class extends SF{},Eh=class extends SF{},Ed=class extends SB{},Ef=class extends Sj{},Ep=class extends SN{},Em=class extends SV{},Eg=class extends SU{},Ey=class extends Sq{},Ev=class extends SG{},Ex=class extends SH{},Eb=class extends SW{},E_=class extends SY{},Ew=class extends SZ{},ET=class extends SX{},EA=class extends SX{},EM=class extends S2{},Ek=class extends S3{},EE=(ES=wi([{name:"a_pos",components:2,type:"Int16"}],4)).members,ES.size,ES.alignment,(ED=class t{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(r,i,n,a){let o=this.segments[this.segments.length-1];return r>t.MAX_VERTEX_ARRAY_LENGTH&&xf(`Max vertices per segment is ${t.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${r}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${t.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+r>t.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==a?this.createNewSegment(i,n,a):o}createNewSegment(t,r,i){let n={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==i&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(t,r,i){return this.prepareSegment(0,t,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let t of this.segments)for(let r in t.vaos)t.vaos[r].destroy()}static simpleSegment(r,i,n,a){return new t([{vertexOffset:r,primitiveOffset:i,vertexLength:n,primitiveLength:a,vaos:{},sortKey:0}])}}).MAX_VERTEX_ARRAY_LENGTH=65535,_4("SegmentVector",ED),EC=wi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),EI=wi([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),EL=Mr((t,r)=>{void 0!==r&&(r.exports=function(t,r){for(var i,n,a=3&t.length,o=t.length-a,s=r,l=0;l>>16)*0xcc9e2d51&65535)<<16)|0)<<15|n>>>17))*0x1b873593+(((n>>>16)*0x1b873593&65535)<<16)|0,s=(65535&(i=(65535&(s=s<<13|s>>>19))*5+(((s>>>16)*5&65535)<<16)|0))+27492+(((i>>>16)+58964&65535)<<16);switch(n=0,a){case 3:n^=(255&t.charCodeAt(l+2))<<16;case 2:n^=(255&t.charCodeAt(l+1))<<8;case 1:n^=255&t.charCodeAt(l),s^=n=(65535&(n=(n=(65535&n)*0xcc9e2d51+(((n>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|n>>>17))*0x1b873593+(((n>>>16)*0x1b873593&65535)<<16)|0}return s^=t.length,s^=s>>>16,s=(65535&s)*0x85ebca6b+(((s>>>16)*0x85ebca6b&65535)<<16)|0,s^=s>>>13,s=(65535&s)*0xc2b2ae35+(((s>>>16)*0xc2b2ae35&65535)<<16)|0,(s^=s>>>16)>>>0})}),EP=Mr((t,r)=>{r.exports=function(t,r){for(var i,n=t.length,a=r^n,o=0;n>=4;)i=(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))*0x5bd1e995+(((i>>>16)*0x5bd1e995&65535)<<16),i^=i>>>24,a=(65535&a)*0x5bd1e995+(((a>>>16)*0x5bd1e995&65535)<<16)^(i=(65535&i)*0x5bd1e995+(((i>>>16)*0x5bd1e995&65535)<<16)),n-=4,++o;switch(n){case 3:a^=(255&t.charCodeAt(o+2))<<16;case 2:a^=(255&t.charCodeAt(o+1))<<8;case 1:a^=255&t.charCodeAt(o),a=(65535&a)*0x5bd1e995+(((a>>>16)*0x5bd1e995&65535)<<16)}return a^=a>>>13,a=(65535&a)*0x5bd1e995+(((a>>>16)*0x5bd1e995&65535)<<16),(a^=a>>>15)>>>0}}),x=null==(v=Mr((t,r)=>{var i=EL(),n=EP();r.exports=i,r.exports.murmur3=i,r.exports.murmur2=n})())?{}:A6(Me(v)),Ez=((t,r,i)=>{if(r&&"object"==typeof r||"function"==typeof r)for(var n,a=A9(r),o=0,s=a.length;or[t]).bind(null,n),enumerable:!(i=A7(r,n))||i.enumerable});return t})(A8(x,"default",{value:v,enumerable:!0}),v),_4("FeaturePositionMap",EF=class t{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,i,n){this.ids.push(wo(t)),this.positions.push(r,i,n)}getPositions(t){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let r=wo(t),i=0,n=this.ids.length-1;for(;i>1;this.ids[t]>=r?n=t:i=t+1}let a=[];for(;this.ids[i]===r;){let t=this.positions[3*i],r=this.positions[3*i+1],n=this.positions[3*i+2];a.push({index:t,start:r,end:n}),i++}return a}static serialize(t,r){let i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(r,i,n,a){for(;n>1],s=n-1,l=a+1;for(;;){do s++;while(r[s]o);if(s>=l)break;ws(r,s,l),ws(i,3*s,3*l),ws(i,3*s+1,3*l+1),ws(i,3*s+2,3*l+2)}l-n`u_${t}`),this.type=i}setUniform(t,r,i){t.set(i.constantOr(this.value))}getBinding(t,r,i){return"color"===this.type?new EU(t,r):new EB(t,r)}},EY=class{constructor(t,r){this.uniformNames=r.map(t=>`u_${t}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,r){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,r.y,r.height,r.width]}setUniform(t,r,i,n){let a=null;"u_pattern_to"===n?a=this.patternTo:"u_pattern_from"===n?a=this.patternFrom:"u_dasharray_to"===n?a=this.dashTo:"u_dasharray_from"===n?a=this.dashFrom:"u_pixel_ratio_to"===n?a=this.pixelRatioTo:"u_pixel_ratio_from"===n&&(a=this.pixelRatioFrom),null!==a&&t.set(a)}getBinding(t,r,i){return i.startsWith("u_pattern")||i.startsWith("u_dasharray_")?new EV(t,r):new EB(t,r)}},EZ=class{constructor(t,r,i,n){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=r.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(t,r,i){let n=this.paintVertexArray.length,a=this.expression.evaluate(new Sc(0,i),r,{},i.canonical,[],i.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(n,t,a)}updatePaintArray(t,r,i,n,a){let o=this.expression.evaluate(new Sc(0,a),i,n);this._setPaintValue(t,r,o)}_setPaintValue(t,r,i){if("color"===this.type){let n=wl(i);for(let i=t;i`u_${t}_t`),this.type=i,this.useIntegerZoom=n,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=r.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0})),this.paintVertexArray=new o}populatePaintArray(t,r,i){let n=this.expression.evaluate(new Sc(this.zoom,i),r,{},i.canonical,[],i.formattedSection),a=this.expression.evaluate(new Sc(this.zoom+1,i),r,{},i.canonical,[],i.formattedSection),o=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(o,t,n,a)}updatePaintArray(t,r,i,n,a){let o=this.expression.evaluate(new Sc(this.zoom,a),i,n),s=this.expression.evaluate(new Sc(this.zoom+1,a),i,n);this._setPaintValue(t,r,o,s)}_setPaintValue(t,r,i,n){if("color"===this.type){let a=wl(i),o=wl(n);for(let i=t;i`#define HAS_UNIFORM_${t}`))}return t}getBinderAttributes(){let t=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof EZ||i instanceof EX)for(let r of i.paintVertexAttributes)t.push(r.name);else if(i instanceof EK)for(let r of i.getVertexAttributes())t.push(r.name)}return t}getBinderUniforms(){let t=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof EW||i instanceof EY||i instanceof EX)for(let r of i.uniformNames)t.push(r)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,r){let i=[];for(let n in this.binders){let a=this.binders[n];if(a instanceof EW||a instanceof EY||a instanceof EX){for(let o of a.uniformNames)if(r[o]){let s=a.getBinding(t,r[o],o);i.push({name:o,property:n,binding:s})}}}return i}setUniforms(t,r,i,n){for(let{name:t,property:a,binding:o}of r)this.binders[a].setUniform(o,n,i.get(a),t)}updatePaintBuffers(t){for(let r in this._buffers=[],this.binders){let i=this.binders[r];if(t&&i instanceof EK){let r=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;r&&this._buffers.push(r)}else(i instanceof EZ||i instanceof EX)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(let r in this.binders){let i=this.binders[r];(i instanceof EZ||i instanceof EX||i instanceof EK)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let r=this.binders[t];(r instanceof EZ||r instanceof EX||r instanceof EK)&&r.destroy()}}},E1=class{constructor(t,r,i=()=>!0){for(let n of(this.programConfigurations={},t))this.programConfigurations[n.id]=new E0(n,r,i);this.needsUpload=!1,this._featureMap=new EF,this._bufferOffset=0}populatePaintArrays(t,r,i,n){for(let i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,r,n);void 0!==r.id&&this._featureMap.add(r.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,i,n){for(let a of i)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,r,a,n)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}},_4("ConstantBinder",EW),_4("CrossFadedConstantBinder",EY),_4("SourceExpressionBinder",EZ),_4("CrossFadedPatternBinder",EJ),_4("CrossFadedDasharrayBinder",EQ),_4("CompositeExpressionBinder",EX),_4("ProgramConfiguration",E0,{omit:["_buffers"]}),_4("ProgramConfigurationSet",E1),E3=-(E2=16383)-1,E5=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Ec,this.indexArray=new EA,this.segments=new ED,this.programConfigurations=new E1(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,r,i){let n=this.layers[0],a=[],o=null,s=!1,l="heatmap"===n.type;"circle"===n.type&&(s=!(o=n.layout.get("circle-sort-key")).isConstant(),l||(l="map"===n.paint.get("circle-pitch-alignment")));let u=l?r.subdivisionGranularity.circle:1,c=new Sc(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:r,id:n,index:l,sourceLayerIndex:u}of t){let t=wh(r,h);if(!this.layers[0]._featureFilter.filter(c,t,i))continue;let d=s?o.evaluate(t,{},i):void 0,f={id:n,properties:r.properties,type:r.type,sourceLayerIndex:u,index:l,geometry:h?t.geometry:wc(r),patterns:{},sortKey:d};a.push(f)}for(let n of(s&&a.sort((t,r)=>t.sortKey-r.sortKey),a)){let{geometry:a,index:o,sourceLayerIndex:s}=n,l=t[o].feature;this.addFeature(n,a,o,i,u),r.featureIndex.insert(l,a,o,s,this.index)}}update(t,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:i})}addFeatures(t){}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,EE),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,i,n,a=1){let o;switch(a){case 1:o=[0,7];break;case 3:o=[0,2,5,7];break;case 5:o=[0,1,3,4,6,7];break;case 7:o=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${a}; valid values are 1, 3, 5, 7.`)}let s=o.length;for(let i of r)for(let r of i){let i=r.x,n=r.y;if(i<0||i>=8192||n<0||n>=8192)continue;let a=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),h=a.vertexLength;for(let t=0;t"circle"===t.type,E9=class extends SS{constructor(t,r){super(t,E8,r)}createBucket(t){return new E5(t)}queryRadius(t){return wb("circle-radius",this,t)+wb("circle-stroke-width",this,t)+w_(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:i,geometry:n,transform:a,pixelsToTileUnits:o,unwrappedTileID:s,getElevation:l}){let u=ww(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-a.bearingInRadians,o),c=this.paint.get("circle-radius").evaluate(r,i)+this.paint.get("circle-stroke-width").evaluate(r,i),h=this.paint.get("circle-pitch-scale"),d=this.paint.get("circle-pitch-alignment"),f,p;return"map"===d?(f=u,p=c*o):(f=u.map(t=>wE(t,a,s,l)),p=c),wS({queryGeometry:f,size:p,transform:a,unwrappedTileID:s,getElevation:l,pitchAlignment:d,pitchScale:h},n)}},_4("HeatmapBucket",De=class extends E5{},{omit:["layers"]}),Dr={get paint(){return Dt||(Dt=new SM({"heatmap-radius":new S_(MF.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new S_(MF.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new Sb(MF.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new SA(MF.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new Sb(MF.paint_heatmap["heatmap-opacity"],"heatmap-opacity")}))}},Di=class t{constructor(t,r){wD(this,t,1,r)}resize(t){wC(this,t,1)}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,i,n,a){wI(t,r,i,n,a,1)}},Dn=class t{constructor(t,r){wD(this,t,4,r)}resize(t){wC(this,t,4)}replace(t,r){r?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,i,n,a){wI(t,r,i,n,a,4)}setPixel(t,r,i){let n=(t*this.width+r)*4;this.data[n+0]=Math.round(255*i.r/i.a),this.data[n+1]=Math.round(255*i.g/i.a),this.data[n+2]=Math.round(255*i.b/i.a),this.data[n+3]=Math.round(255*i.a)}},_4("AlphaImage",Di),_4("RGBAImage",Dn),Da="big-fb",Do=t=>"heatmap"===t.type,Ds=class extends SS{createBucket(t){return new De(t)}constructor(t,r){super(t,Dr,r),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){let t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=wP({expression:t,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(Da)}queryRadius(t){return wb("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:i,geometry:n,transform:a,pixelsToTileUnits:o,unwrappedTileID:s,getElevation:l}){return wS({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(r,i)*o,transform:a,unwrappedTileID:s,getElevation:l},n)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}},Du={get paint(){return Dl||(Dl=new SM({"hillshade-illumination-direction":new Sb(MF.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new Sb(MF.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new Sb(MF.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new Sb(MF.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new Sb(MF.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new Sb(MF.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new Sb(MF.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new Sb(MF.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new Sb(MF.paint_hillshade.resampling,"resampling")}))}},Dc=t=>"hillshade"===t.type,Dh=class extends SS{constructor(t,r){super(t,Du,r),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,i=this.paint.get("hillshade-highlight-color").values,n=this.paint.get("hillshade-shadow-color").values,a=Math.max(t.length,r.length,i.length,n.length);t=t.concat(Array(a-t.length).fill(t.at(-1))),r=r.concat(Array(a-r.length).fill(r.at(-1))),i=i.concat(Array(a-i.length).fill(i.at(-1))),n=n.concat(Array(a-n.length).fill(n.at(-1)));let o=r.map(xv);return{directionRadians:t.map(xv),altitudeRadians:o,shadowColor:n,highlightColor:i}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}},Df={get paint(){return Dd||(Dd=new SM({"color-relief-opacity":new Sb(MF["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new SA(MF["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new Sb(MF["paint_color-relief"].resampling,"resampling")}))}},Dp=class{constructor(t,r,i,n){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(r,n)}update(t,r,i){var n;let{width:a,height:o}=t,s=((null==(n=this.size)?void 0:n[0])!==a||this.size[1]!==o)&&!i,{context:l}=this,{gl:u}=l;this.useMipmap=!!r?.useMipmap,s&&this.size&&this.format===u.RGBA&&(u.deleteTexture(this.texture),this.texture=u.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),u.bindTexture(u.TEXTURE_2D,this.texture),l.pixelStoreUnpackFlipY.set(!1),l.pixelStoreUnpack.set(1);let c=this.format===u.RGBA&&r?.premultiply!==!1;if(s)if(this.size=[a,o],this.format===u.RGBA&&a>0&&o>0){let r=this.useMipmap?Math.floor(Math.log2(Math.max(a,o)))+1:1;if(u.texStorage2D(u.TEXTURE_2D,r,u.RGBA8,a,o),wz(t)){l.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:r}=t;c&&r&&(r=wL(r)),r&&u.texSubImage2D(u.TEXTURE_2D,0,0,0,a,o,u.RGBA,u.UNSIGNED_BYTE,r)}else l.pixelStoreUnpackPremultiplyAlpha.set(c),u.texSubImage2D(u.TEXTURE_2D,0,0,0,u.RGBA,u.UNSIGNED_BYTE,t)}else wz(t)?(l.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,c,a,o,u)):(l.pixelStoreUnpackPremultiplyAlpha.set(c),this._uploadDomImage(t,u));else{let{x:r,y:n}=i||{x:0,y:0};wz(t)?(l.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,c,r,n,a,o,u)):(l.pixelStoreUnpackPremultiplyAlpha.set(c),this._updateDomImage(t,r,n,u))}this.useMipmap&&!(wz(t)&&null===t.data)&&u.generateMipmap(u.TEXTURE_2D),l.pixelStoreUnpackFlipY.setDefault(),l.pixelStoreUnpack.setDefault(),l.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,r){r.texImage2D(r.TEXTURE_2D,0,this.format,this.format,r.UNSIGNED_BYTE,t)}_uploadRawData(t,r,i,n,a){let{data:o}=t;r&&o&&(o=wL(o)),a.texImage2D(a.TEXTURE_2D,0,this.format,i,n,0,this.format,a.UNSIGNED_BYTE,o)}_updateDomImage(t,r,i,n){n.texSubImage2D(n.TEXTURE_2D,0,r,i,n.RGBA,n.UNSIGNED_BYTE,t)}_updateRawData(t,r,i,n,a,o,s){let{data:l}=t;r&&l&&(l=wL(l)),s.texSubImage2D(s.TEXTURE_2D,0,i,n,a,o,s.RGBA,s.UNSIGNED_BYTE,l)}bind(t,r,i){let{context:n}=this,{gl:a}=n;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),a.bindTexture(a.TEXTURE_2D,this.texture),i!==a.LINEAR_MIPMAP_NEAREST&&i!==a.LINEAR_MIPMAP_LINEAR||this.useMipmap||(i=a.LINEAR);let o=i||t;t!==this.magFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,t),this.magFilter=t),o!==this.minFilter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,o),this.minFilter=o),r!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,r),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,r),this.wrap=r)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},(Dm=class{constructor(t,r,i,n=1,a=1,o=1,s=0){if(this.uid=t,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i))return void xf(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Dm.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=o,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let t=-2;t=l)&&this.data.copyWithin(this._idx(0,t),r,r+l),this.data.fill(this.data[r],this._idx(-2,t),this._idx(0,t)),this.data.fill(this.data[r+l-1],this._idx(l,t),this._idx(l+1,t)+1)}let u=this._getByteView();this.min=0x20000000000000-1,this.max=-(0x20000000000000-1);for(let t=0;tthis.max&&(this.max=n),n=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),o=((n+2)*this.stride+i+2)*4,s=4*this.stride,l=t-i,u=r-n;return this._unpackAtIndex(a,o)*(1-l)*(1-u)+this._unpackAtIndex(a,o+4)*l*(1-u)+this._unpackAtIndex(a,o+s)*(1-l)*u+this._unpackAtIndex(a,o+s+4)*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,r){if(t<-2||t>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(t+2)}unpack(t,r,i){return t*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(t){return wF(t,this.getUnpackVector())}getPixels(){return new Dn({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(t,r,i){if(this.dim!==t.dim)throw Error("dem dimension mismatch");let n=r*this.dim,a=r*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(r){case -1:n=a-2;break;case 1:a=n+2}switch(i){case -1:o=s-2;break;case 1:s=o+2}let l=-r*this.dim,u=-i*this.dim;for(let r=o;r"color-relief"===t.type,Dy=class extends SS{constructor(t,r){super(t,Df,r)}_createColorRamp(t){let r={elevationStops:[],colorStops:[]},i=this._transitionablePaint._values["color-relief-color"].value.expression;if(i instanceof k4&&i._styleExpression.expression instanceof kv){this.colorRampExpression=i;let t=i._styleExpression.expression;for(let i of(r.elevationStops=t.labels,r.colorStops=[],r.elevationStops))r.colorStops.push(t.evaluate({globals:{elevation:i}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[kt.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=t)return r;let n={elevationStops:[],colorStops:[]},a=(r.elevationStops.length-1)/(t-1);for(let t=0;tt)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=r}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<32767||r>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let i=0|Math.round(t),n=0|Math.round(r),a=this._getKey(i,n);if(this._vertexDictionary.has(a))return this._vertexDictionary.get(a);let o=this._vertexBuffer.length/2;return this._vertexDictionary.set(a,o),this._vertexBuffer.push(i,n),o}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(t,r){let i=[];for(let n=0;n0?(i.push(a),i.push(s),i.push(o)):(i.push(a),i.push(o),i.push(s))}return i}(this._vertexBuffer,t);let r=[],i=t.length;for(let n=0;n=0?s-1:o-1,a=(l+1)%o,u=t[2*r[n]],c=t[2*r[n]+1],h=t[2*r[a]],d=t[2*r[a]+1],f=t[2*r[s]],p=t[2*r[s]+1],m=t[2*r[l]],g=t[2*r[l]+1],y=!1;if(uh)y=!1;else{let t=g-p,r=-(m-f),i=p((h-f)*t+(d-p)*r)*i&&(y=!0)}if(y){let t=r[n],a=r[s],u=r[l];t!==a&&t!==u&&a!==u&&i.push(u,a,t),--s<0&&(s=o-1)}else{let t=r[a],n=r[s],u=r[l];t!==n&&t!==u&&n!==u&&i.push(u,n,t),++l>=o&&(l=0)}if(n===a)break}}(this._vertexBuffer,n,r)}}return r}_scanlineGenerateVertexRingForCellRow(t,r,i){let n=t*this._granularityCellSize,a=n+this._granularityCellSize,o=[];for(let t=0;t<3;t++){let s=r[2*t],l=r[2*t+1],u=r[(t+1)*2%6],c=r[((t+1)*2+1)%6],h=r[(t+2)*2%6],d=r[((t+2)*2+1)%6],f=u-s,p=c-l,m=0===f,g=0===p,y=(n-l)/p,v=(a-l)/p,x=Math.min(y,v),b=Math.max(y,v);if(!g&&(x>=1||b<=0)||g&&(la)){c>=n&&c<=a&&o.push(i[(t+1)%3]);continue}if(!g&&x>0){let t=s+f*x,r=l+p*x;o.push(this._vertexToIndex(t,r))}let _=s+f*Math.max(x,0),w=s+f*Math.min(b,1);if(m||this._generateIntraEdgeVertices(o,s,l,u,c,_,w),!g&&b<1){let t=s+f*b,r=l+p*b;o.push(this._vertexToIndex(t,r))}(g||c>=n&&c<=a)&&o.push(i[(t+1)%3]),!g&&(c<=n||c>=a)&&this._generateInterEdgeVertices(o,s,l,u,c,h,d,w,n,a)}return o}_generateIntraEdgeVertices(t,r,i,n,a,o,s){let l=n-r,u=a-i,c=0===u,h=c?Math.min(r,n):Math.min(o,s),d=c?Math.max(r,n):Math.max(o,s),f=Math.floor(h/this._granularityCellSize)+1,p=Math.ceil(d/this._granularityCellSize)-1;if(c?r=f;n--){let a=n*this._granularityCellSize,o=i+u*(a-r)/l;t.push(this._vertexToIndex(a,o))}}_generateInterEdgeVertices(t,r,i,n,a,o,s,l,u,c){let h=s-a,d=(u-a)/h,f=(c-a)/h,p=Math.min(d,f),m=Math.max(d,f),g=n+(o-n)*p,y=Math.floor(Math.min(g,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,l)/this._granularityCellSize)-1,x=l=1||m<=0){let t=i-s,n=o+(r-o)*Math.min((u-s)/t,(c-s)/t);y=Math.floor(Math.min(n,l)/this._granularityCellSize)+1,v=Math.ceil(Math.max(n,l)/this._granularityCellSize)-1,x=l0?c:u;if(x)for(let r=y;r<=v;r++){let i=r*this._granularityCellSize;t.push(this._vertexToIndex(i,_))}else for(let r=v;r>=y;r--){let i=r*this._granularityCellSize;t.push(this._vertexToIndex(i,_))}}_generateOutline(t){let r=[];for(let i of t){let t=w3(i,this._granularity,!0),n=this._pointArrayToIndices(t),a=[];for(let t=1;ta==(-32768===o)?(t.push(i),t.push(r),t.push(this._vertexToIndex(n,o)),t.push(this._vertexToIndex(a,o)),t.push(i)):(t.push(r),t.push(i),t.push(this._vertexToIndex(n,o)),t.push(i),t.push(this._vertexToIndex(a,o))),t.push(this._vertexToIndex(n,o))}_fillPoles(t,r,i){let n=this._vertexBuffer,a=Mf,o=t.length;for(let s=2;sDT[l+3]||DT[l]>n||DT[l+2]<=o)continue;let u=wU(r);i=wq(r);do{if(i.prev.next===i){if(wY(t,i.next))return i.next;if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){let t=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>o&&(o=t,s=i.xn||DT[m+3]h)continue;let g=wU(r);i=wq(r);do{if(i.prev.next===i&&n>=i.x&&i.x>=l&&n!==i.x&&w$(an)&&(rs.x||i.x===s.x&&(f=s,p=i,0>wW(f.prev,f,p.prev)&&0>wW(p.next,f,f.next))))&&(s=i,d=r)}i=i.next}while(i!==g)}return s}(t,r);if(!i)return r;let n=wJ(i,t);return wV(i,n.next.next),wj(n,n.next),wj(i,i.next)}(l[t],i);return Dw=!1,wj(i)}(t,r,o,i)),t.length>80*i){l=t[0],u=t[1];let r=l,n=u;for(let o=i;or&&(r=i),a>n&&(n=a)}c=0===(c=Math.max(r-l,n-u))?0:32767/c}return function t(r,i,n,a,o){o&&function(t,r,i,n){let a=t,o=0;do a.z=wH(a.x,a.y,r,i,n),DS[o++]=a,a=a.next;while(a!==t);!function(t){if(t<=32){for(let r=1;r=0&&DS[n].z>i;)DS[n+1]=DS[n],n--;DS[n+1]=t}return}DD.lengthwW(u,r,c)&&(o?function(t,r,i,n){let a=t.prev,o=t.next,s=a.x,l=t.x,u=o.x,c=a.y,h=t.y,d=o.y,f=Math.min(s,l,u),p=Math.min(c,h,d),m=Math.max(s,l,u),g=Math.max(c,h,d),y=wH(f,p,r,i,n),v=wH(m,g,r,i,n),x=t.prevZ;for(;x&&x.z>=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==o&&(s!==x.x||c!==x.y)&&w$(s,c,l,h,u,d,x.x,x.y)&&wW(x.prev,x,x.next)>=0)return!1;x=x.prevZ}let b=t.nextZ;for(;b&&b.z<=v;){if(b.x>=f&&b.x<=m&&b.y>=p&&b.y<=g&&b!==o&&(s!==b.x||c!==b.y)&&w$(s,c,l,h,u,d,b.x,b.y)&&wW(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}(r,n,a,o):function(t){let r=t.prev,i=t.next,n=r.x,a=t.x,o=i.x,s=r.y,l=t.y,u=i.y,c=Math.min(n,a,o),h=Math.min(s,l,u),d=Math.max(n,a,o),f=Math.max(s,l,u),p=i.next;for(;p!==r;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&(n!==p.x||s!==p.y)&&w$(n,s,a,l,o,u,p.x,p.y)&&wW(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(r))){i.push(u.i,r.i,c.i),w0(r),r=c,s=c;continue}if((r=c)===s){if(D_=!1,r=wj(r),D_){s=r;continue}if(!l){s=r=function(t,r){let i=t,n=!1;do{let a=i.prev,o=i.next.next;wZ(a,i,i.next,o,!1)&&wK(a,o)&&wK(o,a)&&(r.push(a.i,i.i,o.i),w0(i),w0(i.next),i=t=o,n=!0),i=i.next}while(i!==t);return n?wj(i):i}(r,i),l=!0;continue}!function(r,i,n,a,o){let s=r;do{let r=s.next.next;for(;r!==s.prev;){if(s.i!==r.i&&function(t,r){let i=wY(t,r)&&wW(t.prev,t,t.next)>0&&wW(r.prev,r,r.next)>0;return t.next.i!==r.i&&(i||wK(t,r)&&wK(r,t)&&(0!==wW(t.prev,t,r.prev)||0!==wW(t,r.prev,r)))&&!function(t,r){let i=Math.min(t.x,r.x),n=Math.max(t.x,r.x),a=Math.min(t.y,r.y),o=Math.max(t.y,r.y),s=t;do{let l=s.next;if(s.x>n&&l.x>n||s.xo&&l.y>o||s.yo!=t.y>o&&a<(t.x-i.x)*(o-i.y)/(t.y-i.y)+i.x&&(n=!n),i=t}while(i!==t);return n}(t,r))}(s,r)){let l=wJ(s,r);s=wj(s,s.next),l=wj(l,l.next),t(s,i,n,a,o),t(l,i,n,a,o);return}r=r.next}s=s.next}while(s!==r)}(r,i,n,a,o);break}}}(o,s,l,u,c),s}(a,o),r=this._convertIndices(a,t);n=this._subdivideTrianglesScanline(r)}catch(t){console.error(t)}let s=[];return r&&(s=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(n),this._granularity>=2&&(null==(i=this._canonical)?void 0:i.z)===0&&(n=this._removeTrianglesOutsideTileX(n),s=s.map(t=>this._removeLinesOutsideTileX(t))),{verticesFlattened:this._vertexBuffer,indicesTriangles:n,indicesLineList:s}}_vertexOutsideTileX(t){let r=this._vertexBuffer[2*t];return r<0||r>8192}_removeTrianglesOutsideTileX(t){let r=[];for(let i=0;it.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new Eh,this.indexArray=new EA,this.indexArray2=new EM,this.programConfigurations=new E1(t.layers,t.zoom),this.segments=new ED,this.segments2=new ED,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,r,i){this.hasDependencies=wO("fill",this.layers,r);let n=this.layers[0].layout.get("fill-sort-key"),a=!n.isConstant(),o=[],s=new Sc(this.zoom),l=this.layers[0]._featureFilter.needGeometry;for(let{feature:u,id:c,index:h,sourceLayerIndex:d}of t){let t=wh(u,l);if(!this.layers[0]._featureFilter.filter(s,t,i))continue;let f=a?n.evaluate(t,{},i,r.availableImages):void 0,p={id:c,properties:u.properties,type:u.type,sourceLayerIndex:d,index:h,geometry:l?t.geometry:wc(u),patterns:{},sortKey:f};o.push(p)}for(let n of(a&&o.sort((t,r)=>t.sortKey-r.sortKey),o)){let{geometry:a,index:o,sourceLayerIndex:s}=n;if(this.hasDependencies){let t=wR("fill",this.layers,n,{zoom:this.zoom},r);this.patternFeatures.push(t)}else this.addFeature(n,a,o,i,{},r.subdivisionGranularity);let l=t[o].feature;r.featureIndex.insert(l,a,o,s,this.index)}}update(t,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:i})}addFeatures({options:t,canonical:r,patternPositions:i,patternMap:n}){for(let a of(this.detectSdfPatterns(n),this.patternFeatures))this.addFeature(a,a.geometry,a.index,r,i,t.subdivisionGranularity)}detectSdfPatterns(t){for(let r of this.patternFeatures)for(let i in r.patterns){let n=r.patterns[i];this.recordSdfPattern(i,t[n.min]),this.recordSdfPattern(i,t[n.mid]),this.recordSdfPattern(i,t[n.max])}for(let r of this.layers){let i=r.paint.get("fill-pattern").constantOr(null);i&&(this.recordSdfPattern(r.id,t[i.from.toString()]),this.recordSdfPattern(r.id,t[i.to.toString()]))}}recordSdfPattern(t,r){if(!r)return;let i=!0===r.sdf,n=this.sdfPatterns[t];void 0===n?this.sdfPatterns[t]=i:n!==i&&xf(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${t}"`)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Dx),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,i,n,a,o){for(let t of x4(r,500)){let r=w2(t,n,o.fill.getGranularityForZoomLevel(n.z)),i=this.layoutVertexArray;w5((t,r)=>{i.emplaceBack(t,r)},this.segments,this.layoutVertexArray,this.indexArray,r.verticesFlattened,r.indicesTriangles,this.segments2,this.indexArray2,r.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:a,canonical:n})}},{omit:["layers","patternFeatures"]}),DV={get paint(){return DN||(DN=new SM({"fill-antialias":new Sb(MF.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new S_(MF.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new Sb(MF.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new S_(MF.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new S_(MF.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new Sb(MF.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new Sb(MF.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new Sw(MF.paint_fill["fill-pattern"],"fill-pattern")}))},get layout(){return Dj||(Dj=new SM({"fill-sort-key":new S_(MF.layout_fill["fill-sort-key"],"fill-sort-key")}))}},DU=t=>"fill"===t.type,Dq=class extends SS{constructor(t,r){super(t,DV,r)}recalculate(t,r){super.recalculate(t,r);let i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new DB(t)}queryRadius(){return w_(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:r,transform:i,pixelsToTileUnits:n}){return wp(ww(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-i.bearingInRadians,n),r)}isTileClipped(){return!0}},DG=wi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),DH=wi([{name:"a_centroid",components:2,type:"Int16"}],4),D$=DG.members,DG.size,DG.alignment,DY=(DW=class t{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(r){let i=new t;return i.extend(r(new vu(this.minX,this.minY))),i.extend(r(new vu(this.maxX,this.minY))),i.extend(r(new vu(this.minX,this.maxY))),i.extend(r(new vu(this.maxX,this.maxY))),i}static fromPoints(r){let i=new t;for(let t of r)i.extend(t);return i}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}}).fromPoints([new vu(0,0),new vu(Mf,Mf)]),(DZ=class{constructor(t,r,i,n,a){for(this.properties=Object.create(null),this.extent=i,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=a;t.pos>3))continue}if(o--,1===a)s+=t.readSVarint(),l+=t.readSVarint(),n&&i.push(n),n=[new vu(s,l)];else if(2===a)s+=t.readSVarint(),l+=t.readSVarint(),n&&n.push(new vu(s,l));else if(7===a)n&&n.push(n[0].clone());else throw Error(`unknown command ${a}`)}return n&&i.push(n),i}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,i=1,n=0,a=0,o=0,s=1/0,l=-1/0,u=1/0,c=-1/0;for(;t.pos>3))continue}if(n--,1===i||2===i)a+=t.readSVarint(),o+=t.readSVarint(),al&&(l=a),oc&&(c=o);else if(7!==i)throw Error(`unknown command ${i}`)}return[s,u,l,c]}toGeoJSON(t,r,i){let n,a=this.extent*2**i,o=this.extent*t,s=this.extent*r,l=this.loadGeometry();function u(t){return[(t.x+o)*360/a-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+s)*2/a)*Math.PI))-90]}function c(t){return t.map(u)}if(1===this.type){let t=[];for(let r of l)t.push(r[0]);let r=c(t);n=1===t.length?{type:"Point",coordinates:r[0]}:{type:"MultiPoint",coordinates:r}}else if(2===this.type){let t=l.map(c);n=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}}else if(3===this.type){let t=w7(l),r=[];for(let i of t)r.push(i.map(c));n=1===r.length?{type:"Polygon",coordinates:r[0]}:{type:"MultiPolygon",coordinates:r}}else throw Error("unknown feature type");let h={type:"Feature",geometry:n,properties:this.properties};return null!=this.id&&(h.id=this.id),h}}).types=["Unknown","Point","LineString","Polygon"],DX=class{constructor(t,r){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],void 0===r&&(r=t.length);t.pos=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let r=this._pbf.readVarint()+this._pbf.pos;return new DZ(this._pbf,r,this.extent,this._keys,this._values)}},DK=class{constructor(t,r=t.length){let i=Object.create(null);for(;t.pos90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new t(xi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){let r=Math.PI/180,i=this.lat*r,n=t.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((t.lng-this.lng)*r);return DJ*Math.acos(Math.min(a,1))}static convert(r){if(r instanceof t)return r;if(Array.isArray(r)&&(2===r.length||3===r.length))return new t(Number(r[0]),Number(r[1]));if(!Array.isArray(r)&&"object"==typeof r&&r)return new t(Number("lng"in r?r.lng:r.lon),Number(r.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}},D0=2*Math.PI*DJ,D1=class t{constructor(t,r,i=0){this.x=+t,this.y=+r,this.z=+i}static fromLngLat(r,i=0){let n=DQ.convert(r);return new t(Te(n.lng),Tt(n.lat),i/w9(n.lat))}toLngLat(){return new DQ(Tr(this.x),Ti(this.y))}toAltitude(){return this.z*w9(Ti(this.y))}meterInMercatorCoordinateUnits(){return 1/D0*(1/Math.cos(Ti(this.y)*Math.PI/180))}},D2=89.25,D3=8192,_4("FillExtrusionBucket",D5=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Ed,this.centroidVertexArray=new Es,this.indexArray=new EA,this.programConfigurations=new E1(t.layers,t.zoom),this.segments=new ED,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,r,i){this.features=[],this.hasDependencies=wO("fill-extrusion",this.layers,r);let n=new Sc(this.zoom),a=this.layers[0],o=a.layout.get("fill-extrusion-rounded-corner-distance"),s=a._featureFilter.needGeometry;for(let{feature:l,id:u,index:c,sourceLayerIndex:h}of t){let t=wh(l,s);if(!a._featureFilter.filter(n,t,i))continue;let d=s?t.geometry:wc(l),f={id:u,sourceLayerIndex:h,index:c,geometry:o>0?Th(d,o,i):d,properties:l.properties,type:l.type,patterns:{}};this.hasDependencies?this.features.push(wR("fill-extrusion",this.layers,f,{zoom:this.zoom},r)):this.addFeature(f,f.geometry,c,i,{},r.subdivisionGranularity),r.featureIndex.insert(l,f.geometry,c,h,this.index,!0)}}addFeatures({options:t,canonical:r,patternPositions:i}){for(let n of this.features){let{geometry:a}=n;this.addFeature(n,a,n.index,r,i,t.subdivisionGranularity)}}update(t,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,D$),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,DH.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,i,n,a,o){let s=this.layers[0],l=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0;for(let i of x4(l>0?Th(r,l,n):r,500)){let r={x:0,y:0,sampleCount:0},a=this.layoutVertexArray.length;this.processPolygon(r,n,t,i,o);let s=this.layoutVertexArray.length-a,l=Math.floor(r.x/r.sampleCount),u=Math.floor(r.y/r.sampleCount);for(let t=0;t{Td(c,t,r,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,u.verticesFlattened,u.indicesTriangles)}_generateSideFaces(t,r){let i=0;for(let n=1;nED.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=a.sub(o)._perp()._unit(),l=o.dist(a);i+l>32768&&(i=0),Td(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,i),Td(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,i),i+=l,Td(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,0,i),Td(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,1,i);let u=r.segment.vertexLength;this.indexArray.emplaceBack(u,u+2,u+1),this.indexArray.emplaceBack(u+1,u+2,u+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}},{omit:["layers","features"]}),D8={get paint(){return D6||(D6=new SM({"fill-extrusion-opacity":new Sb(MF["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new S_(MF["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new Sb(MF["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new Sb(MF["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new Sw(MF["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new S_(MF["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new S_(MF["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new Sb(MF["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")}))},get layout(){return D4||(D4=new SM({"fill-extrusion-rounded-corner-distance":new Sb(MF["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")}))}},D7=t=>"fill-extrusion"===t.type,D9=class extends SS{constructor(t,r){super(t,D8,r)}createBucket(t){return new D5(t)}queryRadius(){return w_(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:i,geometry:n,transform:a,pixelsToTileUnits:o,pixelPosMatrix:s}){let l=ww(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,o),u=this.paint.get("fill-extrusion-height").evaluate(r,i),c=this.paint.get("fill-extrusion-base").evaluate(r,i),h=function(t,r){let i=[];for(let n of t){let t=[n.x,n.y,0,1];vU(t,t,r),i.push(new vu(t[0]/t[3],t[1]/t[3]))}return i}(l,s),d=function(t,r,i,n){let a=[],o=[],s=n[8]*r,l=n[9]*r,u=n[10]*r,c=n[11]*r,h=n[8]*i,d=n[9]*i,f=n[10]*i,p=n[11]*i;for(let r of t){let t=[],i=[];for(let a of r){let r=a.x,o=a.y,m=n[0]*r+n[4]*o+n[12],g=n[1]*r+n[5]*o+n[13],y=n[2]*r+n[6]*o+n[14],v=n[3]*r+n[7]*o+n[15],x=m+s,b=g+l,_=y+u,w=v+c,T=m+h,A=g+d,M=y+f,k=v+p,S=new vu(x/w,b/w);S.z=_/w,t.push(S);let E=new vu(T/k,A/k);E.z=M/k,i.push(E)}a.push(t),o.push(i)}return[a,o]}(n,c,u,s);return function(t,r,i){let n=1/0;wp(i,r)&&(n=Tp(i,r[0]));for(let a=0;at.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers))this.gradients[r.id]={};this.layoutVertexArray=new Ef,this.layoutVertexArray2=new Ep,this.indexArray=new EA,this.programConfigurations=new E1(t.layers,t.zoom),this.segments=new ED,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,r,i){this.hasDependencies=wO("line",this.layers,r)||this.hasLineDasharray(this.layers);let n=this.layers[0].layout.get("line-sort-key"),a=!n.isConstant(),o=[],s=new Sc(this.zoom),l=this.layers[0]._featureFilter.needGeometry;for(let{feature:r,id:u,index:c,sourceLayerIndex:h}of t){let t=wh(r,l);if(!this.layers[0]._featureFilter.filter(s,t,i))continue;let d=a?n.evaluate(t,{},i):void 0,f={id:u,properties:r.properties,type:r.type,sourceLayerIndex:h,index:c,geometry:l?t.geometry:wc(r),patterns:{},dashes:{},sortKey:d};o.push(f)}for(let n of(a&&o.sort((t,r)=>t.sortKey-r.sortKey),o)){let{geometry:a,index:o,sourceLayerIndex:s}=n;this.hasDependencies?(wO("line",this.layers,r)?wR("line",this.layers,n,{zoom:this.zoom},r):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,n,this.zoom,r),this.patternFeatures.push(n)):this.addFeature(n,a,o,i,{},{},r.subdivisionGranularity);let l=t[o].feature;r.featureIndex.insert(l,a,o,s,this.index)}}update(t,r,i,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,{imagePositions:i,dashPositions:n})}addFeatures({options:t,canonical:r,patternPositions:i,dashPositions:n}){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,r,i,n,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Ci)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ct),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,"geojsonvt_clip_start")&&Object.hasOwn(t.properties,"geojsonvt_clip_end"))return{start:+t.properties.geojsonvt_clip_start,end:+t.properties.geojsonvt_clip_end}}addFeature(t,r,i,n,a,o,s){let l=this.layers[0].layout,u=l.get("line-join").evaluate(t,{}),c=l.get("line-cap").evaluate(t,{}),h=l.get("line-miter-limit").evaluate(t,{}),d=l.get("line-round-limit").evaluate(t,{});for(let i of(this.lineClips=this.lineFeatureClips(t),r))this.addLine(i,t,u,c,h,d,n,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:a,dashPositions:o,canonical:n})}addLine(t,r,i,n,a,o,s,l){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let u=s?l.line.getGranularityForZoomLevel(s.z):1;if(t=w3(t,u),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let r=0;r=2&&t[h-1].equals(t[h-2]);)h--;let d=0;for(;d0;if(w&&r>d){let t=m.dist(g);if(t>2*f){let r=m.sub(m.sub(g)._mult(f/t)._round());this.updateDistance(g,r),this.addCurrentVertex(r,v,0,0,p),g=r}}let A=g&&y,M=A?i:c?"butt":n;if(A&&"round"===M&&(ba&&(M="bevel"),"bevel"===M&&(b>2&&(M="flipbevel"),b100)s=x.mult(-1);else{let t=b*v.add(x).mag()/v.sub(x).mag();s._perp()._mult(t*(T?-1:1))}this.addCurrentVertex(m,s,0,0,p),this.addCurrentVertex(m,s.mult(-1),0,0,p)}else if("bevel"===M||"fakeround"===M){let t=-Math.sqrt(b*b-1),r=T?t:0,i=T?0:t;if(g&&this.addCurrentVertex(m,v,r,i,p),"fakeround"===M){let t=Math.round(180*_/Math.PI/20);for(let r=1;r2*f){let r=m.add(y.sub(m)._mult(f/t)._round());this.updateDistance(m,r),this.addCurrentVertex(r,x,0,0,p),m=r}}}}addCurrentVertex(t,r,i,n,a,o=!1){let s=r.x+r.y*i,l=r.y-r.x*i,u=-r.x+r.y*n,c=-r.y-r.x*n;this.addHalfVertex(t,s,l,o,!1,i,a),this.addHalfVertex(t,u,c,o,!0,-n,a),this.distance>16384&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,i,n,a,o))}addHalfVertex({x:t,y:r},i,n,a,o,s,l){let u=(this.lineClips?32767*this.scaledDistance:this.scaledDistance)*.5;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!a,(r<<1)+ +!!o,Math.round(63*i)+128,Math.round(63*n)+128,(0===s?0:s<0?-1:1)+1|(63&u)<<2,u>>6),this.lineClips){let t=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(t,this.lineClipsArray.length)}let c=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,c,this.e2),l.primitiveLength++),o?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}hasLineDasharray(t){for(let r of t){let t=r.paint.get("line-dasharray");if(t&&!t.isConstant())return!0}return!1}addLineDashDependencies(t,r,i,n){for(let a of t){let t=a.paint.get("line-dasharray");if(!t||"constant"===t.value.kind)continue;let o="round"===a.layout.get("line-cap").evaluate(r,{}),s={dasharray:t.value.evaluate({zoom:i-1},r,{}),round:o},l={dasharray:t.value.evaluate({zoom:i},r,{}),round:o},u={dasharray:t.value.evaluate({zoom:i+1},r,{}),round:o},c=`${s.dasharray.join(",")},${s.round}`,h=`${l.dasharray.join(",")},${l.round}`,d=`${u.dasharray.join(",")},${u.round}`;n.dashDependencies[c]=s,n.dashDependencies[h]=l,n.dashDependencies[d]=u,r.dashes[a.id]={min:c,mid:h,max:d}}}},{omit:["layers","patternFeatures"]}),Cl={get paint(){return Cs||(Cs=new SM({"line-opacity":new S_(MF.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new Sb(MF.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new S_(MF.paint_line["line-color"],"line-color"),"line-translate":new Sb(MF.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new Sb(MF.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new S_(MF.paint_line["line-width"],"line-width"),"line-gap-width":new S_(MF.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new S_(MF.paint_line["line-offset"],"line-offset"),"line-blur":new S_(MF.paint_line["line-blur"],"line-blur"),"line-dasharray":new Sw(MF.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new Sw(MF.paint_line["line-pattern"],"line-pattern"),"line-gradient":new SA(MF.paint_line["line-gradient"],"line-gradient")}))},get layout(){return Co||(Co=new SM({"line-cap":new S_(MF.layout_line["line-cap"],"line-cap"),"line-join":new S_(MF.layout_line["line-join"],"line-join"),"line-miter-limit":new S_(MF.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new S_(MF.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new S_(MF.layout_line["line-sort-key"],"line-sort-key")}))}},Cu=class extends S_{possiblyEvaluate(t,r){return r=new Sc(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,i,n){return r=xn({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,i,n)}},Ch=t=>"line"===t.type,Cd=class extends SS{constructor(t,r){super(t,Cl,r),this.gradientVersion=0,Cc||((Cc=new Cu(Cl.paint.properties["line-width"].specification,"line-floorwidth")).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){let t=this.gradientExpression();this.stepInterpolant=void 0!==t._styleExpression&&t._styleExpression.expression instanceof ky,this.gradientVersion=(this.gradientVersion+1)%(0x20000000000000-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=Cc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Ca(t)}queryRadius(t){var r,i;return r=wb("line-width",this,t),((i=wb("line-gap-width",this,t))>0?i+2*r:r)/2+Math.abs(wb("line-offset",this,t))+w_(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:r,featureState:i,geometry:n,transform:a,pixelsToTileUnits:o}){var s,l;let u=ww(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,o),c=o/2*(s=this.paint.get("line-width").evaluate(r,i),(l=this.paint.get("line-gap-width").evaluate(r,i))>0?l+2*s:s),h=this.paint.get("line-offset").evaluate(r,i);return h&&(n=function(t,r){let i=[];for(let n of t){let t=function(t){let r=[];for(let i=0;i=3){for(let r of n)if(wx(t,r))return!0}if(function(t,r,i){if(t.length>1){if(wm(t,r))return!0;for(let n of r)if(wg(n,t,i))return!0}for(let n of t)if(wg(n,r,i))return!0;return!1}(t,n,i))return!0}return!1}(u,n,c)}isTileClipped(){return!0}},Cf=wi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),Cp=wi([{name:"a_projected_pos",components:3,type:"Float32"}],4),wi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Cm=wi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),wi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Cg=wi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Cy=wi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),wi([{name:"triangle",components:3,type:"Uint16"}]),wi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),wi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),wi([{type:"Float32",name:"offsetX"}]),wi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),wi([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]),Cv=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(Cv.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,r){return _(this,null,function*(){if(this.isParsed())return this.getState();if("loading"!==t.pluginStatus)return this.setState(t),t;let i=t.pluginURL,n=new Promise(t=>{this.loadScriptResolve=t}),a=new Promise(t=>setTimeout(()=>t(),this.TIMEOUT));if(yield r(i),yield Promise.race([n,a]),this.isParsed()){let t={pluginStatus:"loaded",pluginURL:i};return this.setState(t),t}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${i}`)})}},Cx={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},Cb={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},C_={لآ:[65269,65270],لأ:[65271,65272],لإ:[65273,65274],لا:[65275,65276]},Cw=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/,CT=new Map,Object.entries(Cx)))!function(t,r,i){let n=0;for(let a of t.split(";")){let[t,o]=a.split(",").map(t=>parseInt(t,36)),s=n+t;for(let t=s;ttypeof Intl&&"Segmenter"in Intl,CS={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","\xa2":"¢","\xa3":"£","\xa5":"¥","\xa6":"¦","\xac":"¬","\xaf":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},CE={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},CD={40:!0},CC=class t{constructor(t="",r=[],i=[]){this.text=t,this.sections=r,this.sectionIndex=i,this.imageSectionID=null,this._graphemes=null}graphemes(){return null!=this._graphemes||(this._graphemes=Ty(this.text)),this._graphemes}static fromFeature(r,i){let n=new t;for(let t of r.sections)t.image?n.addImageSection(t):n.addTextSection(t,i);return n}length(){return this.graphemes().length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}verticalizePunctuation(){this.text=function(t){let r="",i={premature:!0,value:void 0},n=t[Symbol.iterator](),a=n.next(),o=t[Symbol.iterator]();o.next();let s=o.next();for(;!a.done;)(s.done||!T_(s.value.codePointAt(0))||CS[s.value])&&(i.premature||!T_(i.value.codePointAt(0))||CS[i.value])&&CS[a.value]?r+=CS[a.value]:r+=a.value,i={value:a.value,premature:!1},a=n.next(),s=o.next();return r}(this.text),this._graphemes=null}hasZeroWidthSpaces(){return this.text.includes("​")}trim(){let t=this.graphemes(),r=0;for(;rr&&TS(t[i-1]);)i--;this.text=t.slice(r,i).join(""),this.sectionIndex=this.sectionIndex.slice(r,i),this._graphemes=null}substring(r,i){let n=this.graphemes().slice(r,i).join(""),a=this.sectionIndex.slice(r,i);return new t(n,this.sections,a)}toCodeUnitIndex(t){return this.graphemes().slice(0,t).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}getMaxImageSize(t){let r=0,i=0;for(let n=0;n0?i[i.length-1]:"",a=Ty(n+t);this.text+=t,this._graphemes=i.slice(0,n?-1:void 0).concat(a);let o=a.length-!!n;for(let t=0;t=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(t,r,i,n,a){let o=[],s=this.determineAverageLineWidth(t,r,i,n,a),l=this.hasZeroWidthSpaces(),u=this.graphemes(),c=null,h=0,d=0;for(let r=0;r0){let t=u[r-1].codePointAt(0),i=f.codePointAt(0),n=/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t)),a=Tg(t)&&Tg(i);(CE[t]||n||"imageName"in this.getSection(r-1)||void 0!==u[r+1]&&CD[i]||a&&(c??(c=function(t){let r=new Set;if(CA){for(let{index:i}of(Ck??(Ck=new Intl.Segmenter(void 0,{granularity:"word"})),Ck.segment(t)))r.add(i);return r}let i=0;for(let n of t.split(RegExp("\\b|(?=\\p{Ideo})","u")))r.add(i),i+=n.length;return r}(this.text))).has(d))&&o.push(TE(r,h,s,o,function(t,r,i){let n=0;return(10===t||13===t)&&(n-=1e4),i&&(n+=150),(40===t||65288===t)&&(n+=50),(41===r||65289===r)&&(n+=50),n}(t,i,n&&l),!1))}Tx(f.codePointAt(0))||(h+=TM(f,this.getSection(r),i,n,t,a)),d+=f.length}return function t(r){return r?t(r.priorBreak).concat(r.index):[]}(TE(this.length(),h,s,o,0,!0))}determineAverageLineWidth(t,r,i,n,a){let o=0,s=0;for(let r of this.graphemes())o+=TM(r,this.getSection(s),i,n,t,a),s++;let l=Math.max(1,Math.ceil(o/r));return o/l}},CI=function(t){var r,i,n,a,o={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},s={},l={};s.L=1,l[1]="L",Object.keys(o).forEach(function(t,r){s[t]=1<"),c=u[0],h=u[1];c=String.fromCodePoint(n+=parseInt(c,36)),h=String.fromCodePoint(n+=parseInt(h,36)),a.set(c,h),r&&o.set(h,c)}}),{map:a,reverseMap:o}}function y(){if(!r){var t=g("14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",!0),a=t.map,o=t.reverseMap;r=a,i=o,n=g("6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye",!1).map}}function v(t){return y(),r.get(t)||null}function x(t){return y(),i.get(t)||null}function b(t){return y(),n.get(t)||null}var _=s.L,w=s.R,T=s.EN,A=s.ES,M=s.ET,k=s.AN,S=s.CS,E=s.B,D=s.S,C=s.ON,I=s.BN,L=s.NSM,P=s.AL,z=s.LRO,F=s.RLO,O=s.LRE,R=s.RLE,B=s.PDF,j=s.LRI,N=s.RLI,V=s.FSI,U=s.PDI;function q(t){return function(){if(!a){var t=g("14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",!0),r=t.map;t.reverseMap.forEach(function(t,i){r.set(i,t)}),a=r}}(),a.get(t)||null}function G(t,r,i,n){var a=t.length;i=Math.max(0,null==i?0:+i),n=Math.min(a-1,null==n?a-1:+n);var o=[];return r.paragraphs.forEach(function(a){var s=Math.max(i,a.start),l=Math.min(n,a.end);if(s=s&&m(t[c])&f;c--)u[c]=a.level;for(var h=a.level,d=1/0,p=0;ph&&(h=g),g=d;y--)for(var v=0;v=y){for(var x=v;v+1=y;)v++;v>x&&o.push([x+s,v+s])}}}),o}function H(t,r,i,n){for(var a=G(t,r,i,n),o=[],s=0;s0)Z--;else if(K>0){for(X=0;!W[W.length-1]._isolate;)W.pop();var ei=W[W.length-1]._isolInitIndex;null!=ei&&(l.set(ei,J),l.set(J,ei)),W.pop(),K--}Y=W[W.length-1],s[J]=Y._level,Y._override&&o(J,Y._override)}else Q&B?(0===Z&&(X>0?X--:!Y._isolate&&W.length>1&&(W.pop(),Y=W[W.length-1])),s[J]=Y._level):Q&E&&(s[J]=g.level);else s[J]=Y._level,Y._override&&Q!==I&&o(J,Y._override)}for(var en=[],ea=null,eo=g.start;eo<=g.end;eo++){var es=i[eo];if(!(es&d)){var el=s[eo],eu=es&u,ec=es===U;ea&&el===ea._level?(ea._end=eo,ea._endsWithIsolInit=eu):en.push(ea={_start:eo,_end:eo,_level:el,_startsWithPDI:ec,_endsWithIsolInit:eu})}}for(var eh=[],ed=0;ed=0;eT--)if(!(i[eT]&d)){ew=s[eT];break}var eA=ey[ey.length-1],eM=s[eA],ek=g.level;if(!(i[eA]&u)){for(var eS=eA+1;eS<=g.end;eS++)if(!(i[eS]&d)){ek=s[eS];break}}eh.push({_seqIndices:ey,_sosType:Math.max(ew,e_)%2?w:_,_eosType:Math.max(ek,eM)%2?w:_})}}for(var eE=0;eE=0;eR--)if(!(i[eC[eR]]&d)){eO=i[eC[eR]];break}o(eF,eO&(u|U)?C:eO)}}if(a.get(T))for(var eB=0;eB=-1;eN--){var eV=-1===eN?eI:i[eC[eN]];if(eV&c){eV===P&&o(ej,k);break}}}if(a.get(P))for(var eU=0;eU=0&&(e$=i[eC[eY]])&d;eY--);for(var eZ=eG+1;eZ=0&&i[eC[eK]]&(M|d);eK--)o(eC[eK],T);for(eX++;eX=0&&i[eC[e0]]&d;e0--)o(eC[e0],C);for(var e1=eJ+1;e1=0;ti--){var tn=e9[ti].char;if(tn===tr||tn===x(b(tt))||v(b(tn))===tt){e7.push([e9[ti].seqIndex,te]),e9.length=ti;break}}}e7.sort(function(t,r){return t[0]-r[0]});for(var ta=0;ta=0;tp--){var tm=eC[tp];if(i[tm]&e8){var tg=i[tm]&e6?w:_;tc=tg===eP?eP:tg;break}}}if(tc){if(i[eC[ts]]=i[eC[tl]]=tc,tc!==eP){for(var ty=ts+1;ty=0;tT--)if(i[eC[tT]]&d)tb=tT;else{tw=i[eC[tT]]&e6?w:_;break}for(var tA=eL,tM=tx+1;tM=0&&m(t[tC])&f;tC--)s[tC]=g.level}}return{levels:s,paragraphs:p};function tI(r,n){for(var a=r;a"u"?null:new TextDecoder("utf-8"),CO=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,r,i=this.length){let n;for(;n=this.nextField(i);)t(n,r,this);return r}readMessage(t,r){return this.readFields(t,r,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getUint32(this.pos+4,!0);return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getInt32(this.pos+4,!0);return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let r=this.buf,i=r[this.pos++];if(i<128)return i;let n=127&i,a;return n|=(127&(a=r[this.pos++]))<<7,a<128||(n|=(127&(a=r[this.pos++]))<<14,a<128)||(n|=(127&(a=r[this.pos++]))<<21,a<128)?n:function(t,r,i){let n=i.buf,a,o;if(a=(112&(o=n[i.pos++]))>>4,o<128||(a|=(127&(o=n[i.pos++]))<<3,o<128)||(a|=(127&(o=n[i.pos++]))<<10,o<128)||(a|=(127&(o=n[i.pos++]))<<17,o<128)||(a|=(127&(o=n[i.pos++]))<<24,o<128)||(a|=(1&(o=n[i.pos++]))<<31,o<128)){var s,l;return s=t,l=a,r?0x100000000*l+(s>>>0):(l>>>0)*0x100000000+(s>>>0)}throw Error("Expected varint not more than 10 bytes")}(n|=(15&(a=r[this.pos]))<<28,t,this)}readSVarint(){let t=this.readVarint();return t%2==1?-((t+1)/2):t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,r=this.pos;return this.pos=t,t-r>=12&&CF?CF.decode(this.buf.subarray(r,t)):function(t,r,i){let n="",a=r;for(;a239?4:l>223?3:l>191?2:1;if(a+c>i)break;1===c?l<128&&(u=l):2===c?(192&(r=t[a+1]))==128&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===c?(r=t[a+1],o=t[a+2],(192&r)==128&&(192&o)==128&&((u=(15&l)<<12|(63&r)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(r=t[a+1],o=t[a+2],s=t[a+3],(192&r)==128&&(192&o)==128&&(192&s)==128&&((u=(15&l)<<18|(63&r)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),a+=c}return n}(this.buf,r,t)}readBytes(){let t=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,t);return this.pos=t,r}readPackedVarint(t=[],r){let i=this.readPackedEnd();for(;this.pos=t)return 0;let r=this.readVarint();return this.type=7&r,this._valueStart=this.pos,r>>>3}skip(t){let r=7&t;if(0===r)for(;this.buf[this.pos++]>127;);else if(2===r)this.pos=this.readVarint()+this.pos;else if(5===r)this.pos+=4;else if(1===r)this.pos+=8;else throw Error(`Unimplemented type: ${r}`)}},CR=class{constructor(t,{pixelRatio:r,version:i,isWebGLImage:n=!1,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:u}){this.paddedRect=t,this.pixelRatio=r,this.stretchX=a,this.stretchY=o,this.content=s,this.version=i,this.needsFirstWebGLRender=n,this.textFitWidth=l,this.textFitHeight=u}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},CB=class{constructor(t,r){let i={},n={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let a=[];this.addImages(t,i,a),this.addImages(r,n,a);let{w:o,h:s}=Tz(a),l=new Dn({width:o||1,height:s||1});for(let r in t){let n=t[r];if(n.isWebGLImage)continue;let a=i[r].paddedRect;Dn.copy(n.data,l,{x:0,y:0},{x:a.x+1,y:a.y+1},n.data)}for(let t in r){let i=r[t],a=n[t].paddedRect,o=a.x+1,s=a.y+1,u=i.data.width,c=i.data.height;Dn.copy(i.data,l,{x:0,y:0},{x:o,y:s},i.data),Dn.copy(i.data,l,{x:0,y:c-1},{x:o,y:s-1},{width:u,height:1}),Dn.copy(i.data,l,{x:0,y:0},{x:o,y:s+c},{width:u,height:1}),Dn.copy(i.data,l,{x:u-1,y:0},{x:o-1,y:s},{width:1,height:c}),Dn.copy(i.data,l,{x:0,y:0},{x:o+u,y:s},{width:1,height:c})}this.image=l,this.iconPositions=i,this.patternPositions=n}addImages(t,r,i){for(let n in t){let a=t[n],o={x:0,y:0,w:a.data.width+2,h:a.data.height+2};i.push(o),r[n]=new CR(o,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(t,r){if(t.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==t.updateVersion){for(let i in this.patchedUpdateVersion=t.updateVersion,this.iconPositions)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),r);for(let i in this.patternPositions)this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),r)}}patchUpdatedImage(t,r,i){var n;if(!t||!r||!t.needsFirstWebGLRender&&t.version===r.version)return;t.needsFirstWebGLRender=!1,t.version=r.version;let[a,o]=t.tl,s=null==(n=r.userImage)?void 0:n.data;if(!TP(s))return void i.update(r.data,void 0,{x:a,y:o});let{width:l,height:u}=r.data;i.context.setCustomLayerDefaults(),s.renderWithWebGL({gl:i.context.gl,texture:i.texture,x:a,y:o,width:l,height:u}),i.context.setDirty()}},_4("ImagePosition",CR),_4("ImageAtlas",CB),(r=Cj||{})[r.none=0]="none",r[r.horizontal=1]="horizontal",r[r.vertical=2]="vertical",r[r.horizontalOnly=3]="horizontalOnly",Cj=r,CN=RegExp("^\\p{gc=M}$","u"),CV=32640,_4("Anchor",CU=class t extends vu{constructor(t,r,i,n){super(t,r),this.angle=i,void 0!==n&&(this.segment=n)}clone(){return new t(this.x,this.y,this.angle,this.segment)}}),Cq=class{constructor(t,r,i,n,a,o,s,l,u,c){var h;if(this.boxStartIndex=t.length,u){let t=o.top,r=o.bottom,i=o.collisionPadding;i&&(t-=i[1],r+=i[3]);let n=r-t;n>0&&(n=Math.max(10,n),this.circleDiameter=n)}else{let u=null!=(h=o.image)&&h.content&&(o.image.textFitWidth||o.image.textFitHeight)?Tq(o):{x1:o.left,y1:o.top,x2:o.right,y2:o.bottom};u.y1=u.y1*s-l[0],u.y2=u.y2*s+l[2],u.x1=u.x1*s-l[3],u.x2=u.x2*s+l[1];let d=o.collisionPadding;if(d&&(u.x1-=d[0]*s,u.y1-=d[1]*s,u.x2+=d[2]*s,u.y2+=d[3]*s),c){let t=new vu(u.x1,u.y1),r=new vu(u.x2,u.y1),i=new vu(u.x1,u.y2),n=new vu(u.x2,u.y2),a=c*Math.PI/180;t._rotate(a),r._rotate(a),i._rotate(a),n._rotate(a),u.x1=Math.min(t.x,r.x,i.x,n.x),u.x2=Math.max(t.x,r.x,i.x,n.x),u.y1=Math.min(t.y,r.y,i.y,n.y),u.y2=Math.max(t.y,r.y,i.y,n.y)}t.emplaceBack(r.x,r.y,u.x1,u.y1,u.x2,u.y2,i,n,a)}this.boxEndIndex=t.length}},CG=class{constructor(t=[],r=(t,r)=>tr)){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;let t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:r,compare:i}=this,n=r[t];for(;t>0;){let a=t-1>>1,o=r[a];if(i(n,o)>=0)break;r[t]=o,t=a}r[t]=n}_down(t){let{data:r,compare:i}=this,n=this.length>>1,a=r[t];for(;ti(r[o],r[n])&&(n=o),i(r[n],a)>=0)break;r[t]=r[n],t=n}r[t]=a}},CH=class{constructor(t,r,i,n){this.p=new vu(t,r),this.h=i,this.d=function(t,r){let i=!1,n=1/0;for(let a of r)for(let r=0,o=a.length,s=o-1;rt.y!=l.y>t.y&&t.x<(l.x-o.x)*(t.y-o.y)/(l.y-o.y)+o.x&&(i=!i),n=Math.min(n,wy(t,o,l))}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}},(i={})[i.center=1]="center",i[i.left=2]="left",i[i.right=3]="right",i[i.top=4]="top",i[i.bottom=5]="bottom",i[i["top-left"]=6]="top-left",i[i["top-right"]=7]="top-right",i[i["bottom-left"]=8]="bottom-left",i[i["bottom-right"]=9]="bottom-right",C$=i,CW=1/0,CY=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}],_4("SymbolBuffers",CZ=class{constructor(t){this.layoutVertexArray=new Ey,this.indexArray=new EA,this.programConfigurations=t,this.segments=new ED,this.dynamicLayoutVertexArray=new Ev,this.opacityVertexArray=new Ex,this.hasVisibleVertices=!1,this.placedSymbolArray=new S7}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,r,i,n){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Cf.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Cp.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,CY,!0),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}),_4("CollisionBuffers",CX=class{constructor(t,r,i){this.layoutVertexArray=new t,this.layoutAttributes=r,this.indexArray=new i,this.segments=new ED,this.collisionVertexArray=new Ew}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Cm.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}),_4("SymbolBucket",CK=class{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=TH(this.zoom,r["text-size"]),this.iconSizeData=TH(this.zoom,r["icon-size"]);let i=this.layers[0].layout,n=i.get("symbol-sort-key"),a=i.get("symbol-z-order");this.canOverlap="never"!==T8(i,"text-overlap","text-allow-overlap")||"never"!==T8(i,"icon-overlap","icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!n.isConstant();let o="viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&this.canOverlap,"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map(t=>Cj[t])),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id),this.sourceID=t.sourceID}createArrays(){this.text=new CZ(new E1(this.layers,this.zoom,t=>t.startsWith("text"))),this.icon=new CZ(new E1(this.layers,this.zoom,t=>t.startsWith("icon"))),this.glyphOffsetArray=new Et,this.lineVertexArray=new Er,this.symbolInstances=new Ee,this.textAnchorOffsets=new En}calculateGlyphDependencies(t,r,i,n,a){var o;let s=(n||this.allowVerticalPlacement)&&a,l=CC.fromFeature(t,i),u=l.graphemes();for(let t=0;t0)&&("constant"!==s.value.kind||s.value.value.length>0),h="constant"!==u.value.kind||!!u.value.value||Object.keys(u.parameters).length>0,d=o.get("symbol-sort-key");if(this.features=[],!c&&!h)return;let f=r.iconDependencies,p=r.glyphDependencies,m=r.availableImages,g=new Sc(this.zoom);for(let{feature:r,id:l,index:u,sourceLayerIndex:y}of t){let t,v,x=a._featureFilter.needGeometry,b=wh(r,x);if(!a._featureFilter.filter(g,b,i))continue;if(x||(b.geometry=wc(r)),c){let r=a.getValueAndResolveTokens("text-field",b,i,m),n=kn.factory(r);this.hasRTLText||(this.hasRTLText=function(t){for(let r of t.sections)if(TA(r.text))return!0;return!1}(n)),t=function(t,r,i){for(let n of t.sections)n.text=function(t,r,i){var n;let a=r.layout.get("text-transform").evaluate(i,{});return"uppercase"===a?t=t.toLocaleUpperCase():"lowercase"===a&&(t=t.toLocaleLowerCase()),(null!=(n=Cv.applyArabicShaping)?n:function(t){if(!Cw.test(t))return t;let r=[...t].map(t=>{var r;let i=t.codePointAt(0);return{codePoint:i,type:null!=(r=CT.get(i))?r:"U",form:null}});return function(t){let r=t.filter(t=>"T"!==t.type);for(let t=0;t0&&("D"===(i=r[t-1].type)||"L"===i||"C"===i),l=t+1String.fromCodePoint(function(t){if(null===t.form)return t.codePoint;let r=Cb[t.codePoint];return r&&(r[t.form]||r[0])||t.codePoint}(t))).join("")})(t)}(n.text,r,i);return t}(n,a,b)}if(h){let t=a.getValueAndResolveTokens("icon-image",b,i,m);v=t instanceof kh?t:kh.fromString(t)}if(!t&&!v)continue;let _=this.sortFeaturesByKey?d.evaluate(b,{},i):void 0,w={id:l,text:t,icon:v,index:u,sourceLayerIndex:y,geometry:b.geometry,properties:r.properties,type:DZ.types[r.type],sortKey:_};if(this.features.push(w),v&&(f[v.name]=!0),t){let r=s.evaluate(b,{},i).join(","),a="viewport"!==o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=null==(n=this.writingModes)?void 0:n.includes(2);let l=Tb(t.toString());for(let i of(this.calculateGlyphDependencies(t,p,r,a,l),t.sections))i.image&&(f[i.image.name]=!0)}}"line"===o.get("symbol-placement")&&(this.features=function(t){let r={},i={},n=[],a=0;function o(r){n.push(t[r]),a++}function s(t,r,a){let o=i[t];return delete i[t],i[r]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(a[0]),o}function l(t,i,a){let o=r[i];return delete r[i],r[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=a[0].concat(n[o].geometry[0]),o}function u(t,r,i){let n=i?r[0][r[0].length-1]:r[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;ct.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((t,r)=>t.sortKey-r.sortKey)}update(t,r,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,{imagePositions:i}),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,{imagePositions:i}))}addFeatures({options:t,canonical:r,glyphMap:i,glyphPositions:n,iconMap:a,iconPositions:o,showCollisionBoxes:s}){!function(t){var r,i;t.bucket.createArrays();let n=512*t.bucket.overscaling;t.bucket.tilePixelRatio=Mf/n,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let a=t.bucket.layers[0],o=a.layout,s=a._unevaluatedLayout._values,l={layoutIconSize:s["icon-size"].possiblyEvaluate(new Sc(t.bucket.zoom+1),t.canonical),layoutTextSize:s["text-size"].possiblyEvaluate(new Sc(t.bucket.zoom+1),t.canonical),textMaxSize:s["text-size"].possiblyEvaluate(new Sc(18))};if("composite"===t.bucket.textSizeData.kind){let{minZoom:r,maxZoom:i}=t.bucket.textSizeData;l.compositeTextSizes=[s["text-size"].possiblyEvaluate(new Sc(r),t.canonical),s["text-size"].possiblyEvaluate(new Sc(i),t.canonical)]}if("composite"===t.bucket.iconSizeData.kind){let{minZoom:r,maxZoom:i}=t.bucket.iconSizeData;l.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new Sc(r),t.canonical),s["icon-size"].possiblyEvaluate(new Sc(i),t.canonical)]}let u=24*o.get("text-line-height"),c="viewport"!==o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement"),h=o.get("text-keep-upright"),d=o.get("text-size");for(let n of t.bucket.features){let s=o.get("text-font").evaluate(n,{},t.canonical).join(","),f=d.evaluate(n,{},t.canonical),p=l.layoutTextSize.evaluate(n,{},t.canonical),m=l.layoutIconSize.evaluate(n,{},t.canonical),g={horizontal:{},vertical:void 0},y=n.text,v=[0,0];if(y){let r=y.toString(),i=24*o.get("text-letter-spacing").evaluate(n,{},t.canonical),l=!function(t){for(let r of t)if(!function(t){return!/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(t))}(r.codePointAt(0)))return!1;return!0}(r)?0:i,d=o.get("text-anchor").evaluate(n,{},t.canonical),m=T3(a,n,t.canonical);if(!m){let r=o.get("text-radial-offset").evaluate(n,{},t.canonical);v=r?T2(d,[24*r,CW]):o.get("text-offset").evaluate(n,{},t.canonical).map(t=>24*t)}let x=c?"center":o.get("text-justify").evaluate(n,{},t.canonical),b="point"===o.get("symbol-placement")?24*o.get("text-max-width").evaluate(n,{},t.canonical):1/0,_=()=>{t.bucket.allowVerticalPlacement&&Tb(r)&&(g.vertical=TB(y,t.glyphMap,t.glyphPositions,t.imagePositions,s,b,u,d,"left",l,v,2,!0,p,f))};if(!c&&m){let r=new Set;if("auto"===x)for(let t=0;t{d.x<0||d.x>=8192||d.y<0||d.y>=8192||function(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M){let k=t.addToLineVertexArray(r,i),S=l.layout.get("symbol-height-offset").evaluate(_,{},A);S>t.maxHeightOffset&&(t.maxHeightOffset=S);let E,D,C,I,L=0,P=0,z=0,F=0,O=-1,R=-1,B={},j=(0,Ez.default)("");if(t.allowVerticalPlacement&&n.vertical){let t=l.layout.get("text-rotate").evaluate(_,{},A)+90;C=new Cq(u,r,c,h,d,n.vertical,f,p,m,t),s&&(I=new Cq(u,r,c,h,d,s,y,v,m,t))}if(a){let i=l.layout.get("icon-rotate").evaluate(_,{}),n="none"!==l.layout.get("icon-text-fit"),o=TJ(a,i,T,n),f=s?TJ(s,i,T,n):void 0;D=new Cq(u,r,c,h,d,a,y,v,!1,i),L=4*o.length;let p=t.iconSizeData,m=null;"source"===p.kind?(m=[128*l.layout.get("icon-size").evaluate(_,{})])[0]>32640&&xf(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`):"composite"===p.kind&&((m=[128*w.compositeIconSizes[0].evaluate(_,{},A),128*w.compositeIconSizes[1].evaluate(_,{},A)])[0]>32640||m[1]>32640)&&xf(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`),t.addSymbols(t.icon,o,m,b,x,_,0,r,k.lineStartIndex,k.lineLength,-1,A,S),O=t.icon.placedSymbolArray.length-1,f&&(P=4*f.length,t.addSymbols(t.icon,f,m,b,x,_,2,r,k.lineStartIndex,k.lineLength,-1,A,S),R=t.icon.placedSymbolArray.length-1)}let N=Object.keys(n.horizontal);for(let i of N){let a=n.horizontal[i];E||(j=(0,Ez.default)(a.text),E=new Cq(u,r,c,h,d,a,f,p,m,l.layout.get("text-rotate").evaluate(_,{},A)));let s=1===a.positionedLines.length;if(z+=T4(t,r,a,o,l,m,_,g,S,k,n.vertical?1:3,s?N:[i],B,O,w,A),s)break}n.vertical&&(F+=T4(t,r,n.vertical,o,l,m,_,g,S,k,2,["vertical"],B,R,w,A));let V=E?E.boxStartIndex:t.collisionBoxArray.length,U=E?E.boxEndIndex:t.collisionBoxArray.length,q=C?C.boxStartIndex:t.collisionBoxArray.length,G=C?C.boxEndIndex:t.collisionBoxArray.length,H=D?D.boxStartIndex:t.collisionBoxArray.length,$=D?D.boxEndIndex:t.collisionBoxArray.length,W=I?I.boxStartIndex:t.collisionBoxArray.length,Y=I?I.boxEndIndex:t.collisionBoxArray.length,Z=-1,X=(t,r)=>t?.circleDiameter?Math.max(t.circleDiameter,r):r;Z=X(E,-1),Z=X(C,Z),Z=X(D,Z);let K=+((Z=X(I,Z))>-1);K&&(Z*=M/24),t.glyphOffsetArray.length>=t.maxGlyphs&&xf("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey);let J=T3(l,_,A),[Q,ee]=function(t,r){let i=t.length,n=r?.values;if(n?.length>0)for(let r=0;r=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,O,R,j,V,U,q,G,H,$,W,Y,c,z,F,L,P,K,0,f,Z,Q,ee,S)}(t,d,l,i,n,a,C,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,v,[w,w,w,w],M,u,b,T,k,m,r,o,c,h,s)};if("line"===S)for(let a of TK(r.geometry,0,0,Mf,Mf)){let r=w3(a,I);for(let a of function(t,r,i,n,a,o,s,l){let u=n?.6*24*o:0,c=TX(n,a),h=c*o,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return r-h=0&&v=0&&x=0&&p+h<=d){let i=new CU(v,x,g,t);i._round(),(!a||TY(r,i,s,a,o))&&m.push(i)}}f+=u}return u||m.length||l||(m=t(r,f/2,n,a,o,s,l,!0,c)),m}(t,d?r/2*s%r:(c/2+48)*o*s%r,r,u,i,h,d,!1,l)}(r,_,A,i.vertical||g,n,x,t.overscaling,Mf))g&&function(t,r,i,n){let a=t.compareText;if(r in a){let t=a[r];for(let r=t.length-1;r>=0;r--)if(n.dist(t[r])1){let r=w3(t,I),a=function(t,r,i,n,a){let o=i?.6*24*a:0,s=TX(i,n)*a,l=0,u=TZ(t)/2;for(let i=0;iu){let h=(u-l)/c,d=new CU(kx.number(n.x,a.x,h),kx.number(n.y,a.y,h),a.angleTo(n),i);return d._round(),!o||TY(t,d,s,o,r)?d:void 0}l+=c}}(r,A,i.vertical||g,n,x);a&&L(r,a)}}else if("Polygon"===r.type)for(let t of x4(r.geometry,0)){let r=function(t,r=1){let i=DW.fromPoints(t[0]),n=Math.min(i.width(),i.height()),a=n/2,o=new CG([],T1),{minX:s,minY:l,maxX:u,maxY:c}=i;if(0===n)return new vu(s,l);for(let r=s;rd.d||!d.d)&&(d=i),i.max-d.d<=r||(a=i.h/2,o.push(new CH(i.p.x-a,i.p.y-a,a,t)),o.push(new CH(i.p.x+a,i.p.y-a,a,t)),o.push(new CH(i.p.x-a,i.p.y+a,a,t)),o.push(new CH(i.p.x+a,i.p.y+a,a,t)))}return h.d>0&&d.d-h.d<=r?h.p:d.p}(t,16);L(w3(t[0],I,!0),new CU(r.x,r.y,0))}else if("LineString"===r.type)for(let t of r.geometry){let r=w3(t,I);L(r,new CU(r[0].x,r[0].y,0))}else if("Point"===r.type)for(let t of r.geometry)for(let r of t)L([r],new CU(r.x,r.y,0))}(t.bucket,n,g,x,t.imageMap,l,p,m,v,b,t.canonical,t.subdivisionGranularity)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}({bucket:this,glyphMap:i,glyphPositions:n,imageMap:a,imagePositions:o,showCollisionBoxes:s,canonical:r,subdivisionGranularity:t.subdivisionGranularity})}isEmpty(){return 0===this.symbolInstances.length}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){let i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(r[t.segment+1]),n=t.dist(r[t.segment]),a={};for(let n=t.segment+1;n=0;i--)a[i]={x:r[i].x,y:r[i].y,tileUnitDistanceFromAnchor:n},i>0&&(n+=r[i-1].dist(r[i]));for(let t=0;t0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){let i=t.placedSymbolArray.get(r),n=i.vertexStartIndex+4*i.numGlyphs;for(let r=i.vertexStartIndex;rn[t]-n[r]||a[r]-a[t]),o}addToSortKeyRanges(t,r){let i=this.sortKeyRanges[this.sortKeyRanges.length-1];i?.sortKey===r?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){for(let r of(this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[],this.symbolInstanceIndexes)){let t=this.symbolInstances.get(r);this.featureSortOrder.push(t.featureIndex);let i=[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex];for(let t=0;t=0&&i.indexOf(r)===t&&this.addIndicesForPlacedSymbol(this.text,r)}t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}},{omit:["layers","collisionBoxArray","features","compareText"]}),C0={get paint(){return CQ||(CQ=new SM({"icon-opacity":new S_(MF.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new S_(MF.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new S_(MF.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new S_(MF.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new S_(MF.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new Sb(MF.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new Sb(MF.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new S_(MF.paint_symbol["text-opacity"],"text-opacity"),"text-color":new S_(MF.paint_symbol["text-color"],"text-color",{runtimeType:MU,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new S_(MF.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new S_(MF.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new S_(MF.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new Sb(MF.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new Sb(MF.paint_symbol["text-translate-anchor"],"text-translate-anchor")}))},get layout(){return CJ||(CJ=new SM({"symbol-placement":new Sb(MF.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new Sb(MF.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new Sb(MF.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new S_(MF.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new Sb(MF.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new Sb(MF.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new Sb(MF.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new Sb(MF.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new Sb(MF.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new S_(MF.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new S_(MF.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new Sb(MF.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new Sb(MF.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new S_(MF.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new S_(MF.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new S_(MF.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new Sb(MF.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new S_(MF.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new S_(MF.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new Sb(MF.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new Sb(MF.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new Sb(MF.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new S_(MF.layout_symbol["text-field"],"text-field"),"text-font":new S_(MF.layout_symbol["text-font"],"text-font"),"text-size":new S_(MF.layout_symbol["text-size"],"text-size"),"text-max-width":new S_(MF.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new Sb(MF.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new S_(MF.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new S_(MF.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new S_(MF.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new Sb(MF.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new S_(MF.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new S_(MF.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new Sb(MF.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new Sb(MF.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new S_(MF.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new Sb(MF.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new Sb(MF.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new S_(MF.layout_symbol["text-transform"],"text-transform"),"text-offset":new S_(MF.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new Sb(MF.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new Sb(MF.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new Sb(MF.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new Sb(MF.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new S_(MF.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new Sb(MF.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")}))}},_4("FormatSectionOverride",C1=class{constructor(t){if(void 0===t.property.overrides)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:MB,this.defaultValue=t}evaluate(t){if(t.formattedSection){let r=this.defaultValue.property.overrides;if(r?.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}},{omit:["defaultValue"]}),C2=t=>"symbol"===t.type,C3=class t extends SS{constructor(t,r){super(t,C0,r)}recalculate(t,r){super.recalculate(t,r);let i=this.layout.get("icon-rotation-alignment");if(("constant"!==i.value.kind||"auto"===i.value.value)&&(this.layout._values["icon-rotation-alignment"]=new Sv(i.property,{kind:"constant",value:"point"===this.layout.get("symbol-placement")?"viewport":"map"},i.parameters)),"auto"===this.layout.get("text-rotation-alignment")&&("point"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),"point"===this.layout.get("symbol-placement")){let t=this.layout.get("text-writing-mode");if(t){let r=[];for(let i of t)r.includes(i)||r.push(i);this.layout._values["text-writing-mode"]=r}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,i,n){var a;let o=this.layout.get(t).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[t];return s.isDataDriven()||b9(s.value)||!o?o:(a=r.properties,o.replace(/{([^{}]+)}/g,(t,r)=>a&&r in a?String(a[r]):""))}createBucket(t){return new CK(t)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let r of C0.paint.overridableProperties){if(!t.hasPaintOverride(this.layout,r))continue;let i=this.paint.get(r),n=new k5(new C1(i),`layers[${this.id}].paint.${i.property.name}`,i.property.specification),a=null;a="constant"===i.value.kind||"source"===i.value.kind?new k4("source",n):new k6("composite",n,i.value.zoomStops),this.paint._values[r]=new Sv(i.property,a,i.parameters)}}_handleOverridablePaintPropertyUpdate(r,i,n){return!(!this.layout||i.isDataDriven()||n.isDataDriven())&&t.hasPaintOverride(this.layout,r)}static hasPaintOverride(t,r){let i=t.get("text-field"),n=C0.paint.properties[r],a=!1,o=t=>{var r;for(let i of t)if(null!=(r=n.overrides)&&r.hasOverride(i)){a=!0;return}};if("constant"===i.value.kind&&i.value.value instanceof kn)o(i.value.value.sections);else if("source"===i.value.kind||"composite"===i.value.kind){let t=r=>{a||(r instanceof kp&&x0(r.value)===MY?o(r.value.sections):r instanceof kb?o(r.sections):r.eachChild(t))},r=i.value;r._styleExpression&&t(r._styleExpression.expression)}return a}},C4={get paint(){return C5||(C5=new SM({"background-color":new Sb(MF.paint_background["background-color"],"background-color"),"background-pattern":new ST(MF.paint_background["background-pattern"],"background-pattern"),"background-opacity":new Sb(MF.paint_background["background-opacity"],"background-opacity")}))}},C6=t=>"background"===t.type,C8=class extends SS{constructor(t,r){super(t,C4,r)}},C7=t=>"custom"===t.type,C9=class extends SS{constructor(t,r){super(t,{},r),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}},Ie=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var t;this._triggered||(this._triggered=!0,null==(t=this._channel)||t.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},It={once:!0},Ir=class{constructor(t,r){this.target=t,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Ie(()=>this.process()),this.subscription=xy(this.target,"message",t=>this.receive(t),!1),this.globalScope=xm(self)?t:window}registerMessageHandler(t,r){this.messageHandlers[t]=r}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,r){return new Promise((i,n)=>{let a=Math.round(1e18*Math.random()).toString(36).substring(0,10),o=r?xy(r.signal,"abort",()=>{o?.unsubscribe(),delete this.resolveRejects[a];let i={id:a,type:"",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(i),n(new MT(r.signal.reason))},It):null;this.resolveRejects[a]={resolve:t=>{o?.unsubscribe(),i(t)},reject:t=>{o?.unsubscribe(),n(t)}};let s=[],l=p(f({},t),{id:a,sourceMapId:this.mapId,origin:location.origin,data:_9(t.data,s)});this.target.postMessage(l,{transfer:s})})}receive(t){let r=t.data,i=r.id,n=["file://","resource://android","null"],a=[r.origin,location.origin],o=r.origin===location.origin,s=a.some(t=>n.includes(t));if((o||s)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(""===r.type){delete this.tasks[i];let t=this.abortControllers[i];delete this.abortControllers[i],t&&t.abort();return}if(xm(self)||r.mustQueue){this.tasks[i]=r,this.taskQueue.push(i),this.invoker.trigger();return}this.processTask(i,r)}}process(){if(0===this.taskQueue.length)return;let t=this.taskQueue.shift(),r=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(t,r)}processTask(t,r){return _(this,null,function*(){if(""===r.type){let i=this.resolveRejects[t];if(delete this.resolveRejects[t],!i)return;r.error?i.reject(vJ(we(r.error))):i.resolve(we(r.data));return}if(!this.messageHandlers[r.type])return void this.completeTask(t,null,null);let i=we(r.data),n=new AbortController;this.abortControllers[t]=n;try{let a=yield this.messageHandlers[r.type](r.sourceMapId,i,n);this.completeTask(t,null,a)}catch(r){this.completeTask(t,vJ(r))}})}completeTask(t,r,i){let n=[];delete this.abortControllers[t];let a={id:t,type:"",sourceMapId:this.mapId,origin:location.origin,error:r?_9(r):null,data:_9(i,n)};this.target.postMessage(a,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},Ii=class{constructor(t,r,i){if(!function(t,r,i){return!(t<0||t>25||i<0||i>=2**t||r<0||r>=2**t)}(t,r,i))throw Error(`x=${r}, y=${i}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=r,this.y=i,this.key=Ar(0,t,t,r,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,i){var n,a,o;let s,l,u=(n=this.x,a=this.y,o=this.z,s=Ai(256*n,256*(a=2**o-a-1),o),l=Ai((n+1)*256,(a+1)*256,o),`${s[0]},${s[1]},${l[0]},${l[1]}`),c=function(t,r,i){let n="";for(let a=t;a>0;a--){let t=1<1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,u)}isChildOf(t){let r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){let r=2**this.z;return new vu((t.x*r-this.x)*Mf,(t.y*r-this.y)*Mf)}toString(){return`${this.z}/${this.x}/${this.y}`}},In=class{constructor(t,r){this.wrap=t,this.canonical=r,this.key=Ar(t,r.z,r.z,r.x,r.y)}},Ia=class t{constructor(t,r,i,n,a){if(this.terrainRttPosMatrix32f=null,t= z; overscaledZ = ${t}; z = ${i}`);this.overscaledZ=t,this.wrap=r,this.canonical=new Ii(i,+n,+a),this.key=Ar(r,t,i,n,a)}clone(){return new t(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(r){if(r>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${r}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-r;return r>this.canonical.z?new t(r,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new t(r,this.wrap,r,this.canonical.x>>i,this.canonical.y>>i)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,r){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-t;return t>this.canonical.z?Ar(this.wrap*r,t,this.canonical.z,this.canonical.x,this.canonical.y):Ar(this.wrap*r,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap||this.overscaledZ-t.overscaledZ<=0)return!1;if(0===t.overscaledZ)return this.overscaledZ>0;let r=this.canonical.z-t.canonical.z;return!(r<0)&&t.canonical.x===this.canonical.x>>r&&t.canonical.y===this.canonical.y>>r}children(r){if(this.overscaledZ>=r)return[new t(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let i=this.canonical.z+1,n=2*this.canonical.x,a=2*this.canonical.y;return[new t(i,this.wrap,i,n,a),new t(i,this.wrap,i,n+1,a),new t(i,this.wrap,i,n,a+1),new t(i,this.wrap,i,n+1,a+1)]}isLessThan(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=0&&r=0&&i=l)return null;let c=this.canonical.x+a,h=this.wrap;return c<0?(h-=Math.ceil(-c/l),c=(c%l+l)%l):c>=l&&(h+=Math.floor(c/l),c%=l),{tileID:new t(this.overscaledZ,h,s,c,u),x:r-a*n,y:i-o*n}}},Io=6378137*Math.PI,_4("CanonicalTileID",Ii),_4("OverscaledTileID",Ia,{omit:["terrainRttPosMatrix32f"]}),Is="_geojsonTileLayer",Il=class{constructor(t){this._stringToNumber={},this._numberToString=[];for(let r=0;r=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},Iu=class{constructor(t,r,i,n,a){for(let a in this.type="Feature",this._vectorTileFeature=t,this._x=i,this._y=n,this._z=r,t.properties)"string"==typeof t.properties[a]&&t.properties[a].startsWith("__$json__:")&&(t.properties[a]=JSON.parse(t.properties[a].slice(10)));this.properties=t.properties,this.id=a}projectPoint(t,r,i,n){return[(t.x+r)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+i)*2/n)*Math.PI))-90]}projectLine(t,r,i,n){return t.map(t=>this.projectPoint(t,r,i,n))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,r=t.extent*2**this._z,i=t.extent*this._x,n=t.extent*this._y,a=t.loadGeometry();switch(t.type){case 1:{let t=[];for(let r of a)t.push(r[0]);let o=this.projectLine(t,i,n,r);this._geometry=1===t.length?{type:"Point",coordinates:o[0]}:{type:"MultiPoint",coordinates:o};break}case 2:{let t=a.map(t=>this.projectLine(t,i,n,r));this._geometry=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t};break}case 3:{let t=w7(a),o=[];for(let a of t)o.push(a.map(t=>this.projectLine(t,i,n,r)));this._geometry=1===o.length?{type:"Polygon",coordinates:o[0]}:{type:"MultiPolygon",coordinates:o};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&"_x"!==r&&"_y"!==r&&"_z"!==r&&(t[r]=this[r]);return t}},Ic=class{constructor(t,r,i){this._name=t,this.dataBuffer=r,"number"==typeof i?this._size=i:(this.nullabilityBuffer=i,this._size=i.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){var r;return(null==(r=this.nullabilityBuffer)?void 0:r.get(t))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},Ih=class extends Ic{},Id=class extends Ih{getValueFromBuffer(t){return this.dataBuffer[t]}},If=class extends Ih{getValueFromBuffer(t){return this.dataBuffer[t]}},Ip=class extends Ic{constructor(t,r,i,n){super(t,r,n),this.delta=i}},Im=class extends Ip{constructor(t,r,i,n,a){super(t,a?Int32Array.of(r):Uint32Array.of(r),i,n)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},Ig=class extends Ic{constructor(t,r,i,n){super(t,n?Int32Array.of(r):Uint32Array.of(r),i)}getValueFromBuffer(t){return this.dataBuffer[0]}},Iy=class{constructor(t,r,i,n,a=4096){if(this._name=t,this._geometryVector=r,this._idVector=i,this._propertyVectors=n,this._extent=a,0===t.length)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var t;return null!=(t=this._propertyVectors)?t:[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(t=>[t.name,t]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],r=this.geometryVector.getGeometries();for(let i=0;i>>32-t;Ik=IM,ID=3*(IE=function(t){var r;if(!Number.isFinite(t)||t<=0)return IS;let i=(r=Math.floor(t))-r%256;return 0===i?256:i}(IS=65536))/256+IE|0,(o=IC||(IC={})).PRESENT="PRESENT",o.DATA="DATA",o.OFFSET="OFFSET",o.LENGTH="LENGTH",(s=II||(II={})).NONE="NONE",s.SINGLE="SINGLE",s.SHARED="SHARED",s.VERTEX="VERTEX",s.MORTON="MORTON",s.FSST="FSST",(l=IL||(IL={})).VERTEX="VERTEX",l.INDEX="INDEX",l.STRING="STRING",l.KEY="KEY",(u=IP||(IP={})).VAR_BINARY="VAR_BINARY",u.GEOMETRIES="GEOMETRIES",u.PARTS="PARTS",u.RINGS="RINGS",u.TRIANGLES="TRIANGLES",u.SYMBOL="SYMBOL",u.DICTIONARY="DICTIONARY",Iz=[IC.PRESENT,IC.DATA,IC.OFFSET,IC.LENGTH],IF=[IT.NONE,IT.DELTA,IT.COMPONENTWISE_DELTA,IT.RLE,IT.MORTON],IO=[IA.NONE,IA.FAST_PFOR,IA.VARINT],IR=[II.NONE,II.SINGLE,II.SHARED,II.VERTEX,II.MORTON,II.FSST],IB=[IL.VERTEX,IL.INDEX,IL.STRING,IL.KEY],Ij=[IP.VAR_BINARY,IP.GEOMETRIES,IP.PARTS,IP.RINGS,IP.TRIANGLES,IP.SYMBOL,IP.DICTIONARY],(c=IN||(IN={}))[c.FLAT=0]="FLAT",c[c.CONST=1]="CONST",c[c.SEQUENCE=2]="SEQUENCE",c[c.DICTIONARY=3]="DICTIONARY",c[c.FSST_DICTIONARY=4]="FSST_DICTIONARY",IV=class{constructor(t,r){this.values=t,this._size=r}get(t){let r=Math.floor(t/8);return(this.values[r]>>t%8&1)==1}set(t,r){let i=Math.floor(t/8);this.values[i]=this.values[i]|!!r<>t%8&1}size(){return this._size}getBuffer(){return this.values}},IU=new TextDecoder,Iq=class extends Ih{getValueFromBuffer(t){return this.dataBuffer[t]}},IG=class extends Ip{constructor(t,r,i,n,a){super(t,a?BigInt64Array.of(r):BigUint64Array.of(r),i,n)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}},(h=IH||(IH={}))[h.POINT=0]="POINT",h[h.LINESTRING=1]="LINESTRING",h[h.POLYGON=2]="POLYGON",h[h.MULTIPOINT=3]="MULTIPOINT",h[h.MULTILINESTRING=4]="MULTILINESTRING",h[h.MULTIPOLYGON=5]="MULTIPOLYGON",(d=I$||(I$={}))[d.POINT=0]="POINT",d[d.LINESTRING=1]="LINESTRING",d[d.POLYGON=2]="POLYGON",(m=IW||(IW={}))[m.MORTON=0]="MORTON",m[m.VEC_2=1]="VEC_2",m[m.VEC_3=2]="VEC_3",IY=class{constructor(t,r,i,n,a){this._vertexBufferType=t,this._topologyVector=r,this._vertexOffsets=i,this._vertexBuffer=n,this._mortonSettings=a}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(t){let r=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){let r=this.vertexOffsets[t],i=AV(this.vertexBuffer[r],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[i.x,i.y]}let r=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[r],this.vertexBuffer[r+1]]}getGeometries(){return function(t){let r=Array(t.numGeometries),i=1,n=1,a=1,o=0,s=0,l=0,u=t.mortonSettings,c=t.topologyVector,h=c.geometryOffsets,d=c.partOffsets,f=c.ringOffsets,p=t.vertexOffsets,m=!p||0===p.length,g=t.containsPolygonGeometry(),y=t.vertexBuffer;for(let c=0;c[t]),i+=d,n+=d}break;case IH.LINESTRING:{let c,v;g?(c=f[n]-f[n-1],n++):c=d[i]-d[i-1],i++,m?(v=AG(y,s,c,!1),s+=2*c):(v=Aq(t.vertexBufferType,y,p,l,c,!1,u),l+=c),r[o++]=[v],h&&a++}break;case IH.POLYGON:{let c=d[i]-d[i-1];i++;let g=Array(c-1),v,x=f[n]-f[n-1];if(n++,m){v=AG(y,s,x,!0),s+=2*x;for(let t=0;t0;)a[o++]=t[s++]}}return a}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let r=new Uint32Array(t.length-1),i=t[0];for(let n=1;n>>0,o=i.get()+a;if(o>t.length)throw Error(`Block overruns tile: ${o} > ${t.length}`);let s=Ao(t,i,1)[0]>>>0;if(1!==s&&2!==s){i.set(o);continue}let[l,u]=function(t,r){let i={};i.featureTables=[];let n={};if(n.name=A3(t,r),0===n.name.length)throw Error("Missing layer name");let a=Ao(t,r,1)[0]>>>0,o=Ao(t,r,1)[0]>>>0;n.columns=Array(o);for(let i=0;i>>0,a=A1(n);if(!a)throw Error(`Unsupported column type code ${n}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)`);if(n>=Le.SCALAR_BASE)i=A3(t,r);else if(n>>0,n=o.complexType;n.children=Array(i);for(let a=0;a>>0,s=o>=Le.SCALAR_BASE?A1(o):null;if(!s)throw Error(`Unsupported field type code ${o}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let l=p(f({},s),{name:A3(r,i)});if("complexType"===l.type&&A2(o)){let n=l.complexType,a=Ao(r,i,1)[0]>>>0;n.children=Array(a);for(let o=0;o=4)for(;i>4,a<128||(a=r[i.get()],i.increment(),n|=(127&a)<<3,a<128)||(a=r[i.get()],i.increment(),n|=(127&a)<<10,a<128)||(a=r[i.get()],i.increment(),n|=(127&a)<<17,a<128)||(a=r[i.get()],i.increment(),n|=(127&a)<<24,a<128)||(a=r[i.get()],i.increment(),n|=(1&a)<<31,a<128))return 0x100000000*n+(t>>>0);throw Error("Expected varint not more than 10 bytes")}(i|=(15&(n=t[r.get()]))<<28,t,r)}(t,r);return n}(t,r,i.numValues),i,n);let a=AL(t,r,i),o=n?AB(a,i):Aj(a,i);return Float64Array.from(o,Number)}(t,i,a,!1),c?Aw(d,c,0):d),o):new Iq(n,AO(t,i,a,c),o);case IN.SEQUENCE:{let r=AF(t,i,a);return new IG(n,r[0],r[1],a.numRleValues,!1)}case IN.CONST:return new I2(n,AR(t,i,a),o,!1)}throw Error("Vector type not supported for id column.")}(t,n,i,a,s,o??g,r)}else if(function(t){var r;return"complexType"===t.type&&(null==(r=t.complexType)?void 0:r.type)==="physicalType"&&t.complexType.physicalType===Ib.GEOMETRY}(n)){let r=Ao(t,i,1)[0];if(0===g){let r=i.get();g=A_(t,i).decompressedCount,i.set(r)}d=function(t,r,i,n,a){var o,s,l,u,c,h,d,f,p,m,g;let y,v,x,b=A_(t,i),_,w,T,A;if(AN(b,n,t,i)===IN.CONST){let f=AP(t,i,b),p,m,g,y;for(let n=0;n{var i;return t.name+(null!=(i=r.name)?i:"")}):[t.name]}(i);if(0===n)return a.map(t=>new I8(t,[]));let o=function(t,r,i){let n=t[r.get()];r.add(1);let a=AD(t,r,A_(t,r)),o=i-1,s=[];n&I7.STRING&&(o-=function(t,r,i){let n=t[r.get()];r.add(1);let a=AY("",t,r,n);if(a)for(let t=0;t0&&(c=AD(t,r,A_(t,r)),o--),0!==o)throw Error(`Unexpected number of remaining streams while decoding map column: ${o}`);return{lengthStream:a,dictionary:s,presentStream:l,presentCount:u,flattenedValues:c}}(t,r,n),s=(o.presentStream?o.presentCount:o.lengthStream.length)/a.length,l=[],u=0,c=0;for(let t=0;to.length)throw Error("Merged map counts underflow while decoding child streams");let p=Array(i),m=n,g=a;for(let t=0;ts.length)throw Error("Map value stream underflow while decoding feature payload");let i=(y=s,v=g,x=r,b=u,x-v==1||y[v]===I9.START_LIST?AX(y,v,x,b):AZ(y,v,x,b));p[t]=i.value,g=i.nextIndex}let _=0;for(let t=n;t1&&!u.nullable||1===p&&u.nullable)throw Error(`The number of streams for the child field ${u.name} does not match its nullability. nullibilty: ${u.nullable}, numStreams: ${p}`);if(u.nullable){let i=A_(t,r);c=new IV(AA(t,i.numValues,i.byteLength,r),i.numValues)}let g=AD(t,r,A_(t,r),void 0,c);if(l){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${m}"`);h[f++]=new I6(m,g,a,o,s,l,c,d)}else h[f++]=new I4(m,g,a,o,c)}return h}(t,r,i,o)}(t,i,n,r,g,void 0);if(a)if(Array.isArray(a))for(let t of a)m.push(t);else m.push(a)}}let y=new Iy(c.name,d,h,m,u);n.push(y),i.set(o)}return n}(new Uint8Array(t));this.layers=r.reduce((t,r)=>p(f({},t),{[r.name]:new Li(r)}),{})}},_4("FeatureIndex",class{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ss(Mf,16,0),this.grid3D=new Ss(Mf,16,0),this.featureIndexArray=new Eo,this.promoteId=r}insert(t,r,i,n,a,o){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,a);let l=o?this.grid3D:this.grid;for(let t of r){let r=[1/0,1/0,-1/0,-1/0];for(let i of t)r[0]=Math.min(r[0],i.x),r[1]=Math.min(r[1],i.y),r[2]=Math.max(r[2],i.x),r[3]=Math.max(r[3],i.y);r[0]<8192&&r[1]<8192&&r[2]>=0&&r[3]>=0&&l.insert(s,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||("mlt"===this.encoding?this.vtLayers=new Ln(this.rawTileData).layers:this.vtLayers=new DK(new CO(this.rawTileData)).layers,this.sourceLayerCoder=new Il(this.vtLayers?Object.keys(this.vtLayers).sort():[Is])),this.vtLayers}query(t,r,i,n){this.loadVTLayers();let a=t.params,o=Mf/t.tileSize/t.scale,s=_c(a.filter,"queryRenderedFeatures filter",a.globalState),l=t.queryGeometry,u=t.queryPadding*o,c=DW.fromPoints(l),h=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),d=DW.fromPoints(t.cameraQueryGeometry).expandBy(u);for(let r of this.grid3D.query(d.minX,d.minY,d.maxX,d.maxY,(r,i,n,a)=>(function(t,r,i,n,a){for(let o of t)if(r<=o.x&&i<=o.y&&n>=o.x&&a>=o.y)return!0;let o=[new vu(r,i),new vu(r,a),new vu(n,a),new vu(n,i)];if(t.length>2){for(let r of o)if(wx(t,r))return!0}for(let r=0;ra.x&&r.x>a.x||t.ya.y&&r.y>a.y)return!1;let o=xp(t,r,i[0]);return o!==xp(t,r,i[1])||o!==xp(t,r,i[2])||o!==xp(t,r,i[3])}(t[r],t[r+1],o))return!0;return!1})(t.cameraQueryGeometry,r-u,i-u,n+u,a+u)))h.push(r);h.sort(A4);let f={},p;for(let u of h){if(u===p)continue;p=u;let c=this.featureIndexArray.get(u),h=null;this.loadMatchingFeature(f,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,s,a.layers,a.availableImages,r,i,n,(r,i,n)=>(h||(h=wc(r)),i.queryIntersectsFeature({queryGeometry:l,feature:r,featureState:n,geometry:h,zoom:this.z,transform:t.transform,pixelsToTileUnits:o,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,r,i,n,a,o,s,l,u,c,h){let d=this.bucketLayerIDs[r];if(o&&!d.some(t=>o.has(t)))return;let f=this.sourceLayerCoder.decode(i),p=this.vtLayers[f].feature(n);if(a.needGeometry){let t=wh(p,!0);if(!a.filter(new Sc(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!a.filter(new Sc(this.tileID.overscaledZ),p))return;let m=this.getId(p,f);for(let r of d){if(o&&!o.has(r))continue;let i=l[r];if(!i)continue;let a={};m&&c&&(a=c.getState(i.sourceLayer||"_geojsonTileLayer",m));let d=xn({},u[r]);d.paint=A5(d.paint,i.paint,p,a,s),d.layout=A5(d.layout,i.layout,p,a,s);let f=!h||h(p,i,a);if(!f)continue;let g=new Iu(p,this.z,this.x,this.y,m);g.layer=d;let y=t[r];void 0===y&&(y=t[r]=[]),y.push({featureIndex:n,feature:g,intersectionZ:f})}}lookupSymbolFeatures(t,r,i,n,a,o,s,l){let u={};this.loadVTLayers();let c=_c(a.filterSpec,"queryRenderedFeatures symbol filter",a.globalState);for(let a of t)this.loadMatchingFeature(u,i,n,a,c,o,s,l,r);return u}hasLayer(t){for(let r of this.bucketLayerIDs)for(let i of r)if(t===i)return!0;return!1}getId(t,r){var i;let n=t.id;if(this.promoteId){let a="string"==typeof this.promoteId?this.promoteId:this.promoteId[r];"boolean"==typeof(n=t.properties[a])&&(n=Number(n)),void 0===n&&null!=(i=t.properties)&&i.cluster&&this.promoteId&&(n=Number(t.properties.cluster_id))}return n}},{omit:["rawTileData","sourceLayerCoder"]}),La=class{constructor(t,r){this.max=t,this.onRemove=r,this.reset()}reset(){for(let t in this.data)for(let r of this.data[t])r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value);return this.data={},this.order=[],this}add(t,r,i){let n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);let a={value:r,timeout:void 0};if(void 0!==i&&(a.timeout=setTimeout(()=>{this.remove(t,a)},i)),this.data[n].push(a),this.order.push(n),this.order.length>this.max){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){let r=this.data[t].shift();return r.timeout&&clearTimeout(r.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),r.value}getByKey(t){let r=this.data[t];return r?r[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,r){if(!this.has(t))return this;let i=t.wrapped().key,n=void 0===r?0:this.data[i].indexOf(r),a=this.data[i][n];return this.data[i].splice(n,1),a.timeout&&clearTimeout(a.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(a.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){let r=[];for(let i in this.data)for(let n of this.data[i])t(n.value)||r.push(n);for(let t of r)this.remove(t.value.tileID,t)}}}}),Ls={};function Ll(){var t=new Ma(4);return Ma!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function Lu(){return z$.getCurrentTime()}function Lc(t){z$.setNow(t)}function Lh(){z$.restoreNow()}function Ld(){return z$.isFrozen()}function Lf(t){t=t.slice();let r=Object.create(null);for(let i=0;i{t in r&&(i[t]=r[t])}),i}(t[i],r[t[i].ref]));return t}function Lp(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let i=0;i0){let i=[];for(let{id:n,url:a}of t){let t=`${n}${a}`;i.includes(t)||(i.push(t),r.push({id:n,url:a}))}}return r}function Lw(t,r,i){try{let n=new URL(t);return n.pathname+=`${r}${i}`,n.toString()}catch{throw Error(`Invalid sprite URL "${t}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function LT(t,r){return t>r||t>Fi?null:{start:t,end:Math.min(r,Fi)}}function LA(t,r,i,n,a,o,s,l,u){for(let c=r;c-1);o[++u]=l,s[u]=c,s[u+1]=Fs}for(let l=0,u=0;lMS(r,i)),FT}function LI(t,r){let i=t.tileID,n=r.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}function LL(t,r){let i=t.feature,n=r.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=n}function LP(t,r,i,n){return _(this,null,function*(){let a=t;if(t.url?a=(yield ME((yield r.transformRequest(t.url,"Source")),i)).data:yield zH.frameAsync(i,n),!a)return null;let o=xa(xn(a,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(o.vectorLayerIds=a.vector_layers.map(t=>t.id)),o})}function Lz(t,r){return r?t.properties[r]:t.id}y(Ls,{AJAXError:()=>Mk,AttributionControl:()=>jw,BoxZoomHandler:()=>B1,CanvasSource:()=>FB,CooperativeGesturesHandler:()=>jm,DoubleClickZoomHandler:()=>ju,DragPanHandler:()=>jd,DragRotateHandler:()=>jf,EXTENT:()=>Mf,EdgeInsets:()=>O_,ErrorEvent:()=>ML,Event:()=>MI,Evented:()=>MP,FullscreenControl:()=>jJ,FullscreenEvent:()=>jK,GPUInitializationError:()=>BG,GeoJSONSource:()=>FD,GeolocateControl:()=>jY,GeolocateErrorEvent:()=>jW,GeolocateEvent:()=>jH,GeolocatePositionEvent:()=>j$,GlobeControl:()=>j0,Hash:()=>BH,ImageSource:()=>FO,KeyboardHandler:()=>js,LngLat:()=>DQ,LngLatBounds:()=>FA,LogoControl:()=>jT,Map:()=>jI,MapBoxZoomEvent:()=>z6,MapContextEvent:()=>z9,MapLibreEvent:()=>zJ,MapLibreMap:()=>jI,MapMouseEvent:()=>z3,MapMovementEvent:()=>zQ,MapProjectionEvent:()=>z7,MapSourceDataEvent:()=>z2,MapStyleDataEvent:()=>z1,MapStyleImageMissingEvent:()=>Fe,MapStyleLoadEvent:()=>z0,MapTerrainEvent:()=>z8,MapTouchEvent:()=>z5,MapWheelEvent:()=>z4,Marker:()=>jV,MarkerClickEvent:()=>jN,MarkerDragEvent:()=>jj,MercatorCoordinate:()=>D1,NavigationControl:()=>jP,Point:()=>vu,Popup:()=>j3,PopupEvent:()=>j2,RasterDEMTileSource:()=>FE,RasterTileSource:()=>FS,ScaleControl:()=>jX,ScrollZoomHandler:()=>jl,Style:()=>OG,TerrainControl:()=>jQ,TwoFingersTouchPitchHandler:()=>ja,TwoFingersTouchRotateHandler:()=>jn,TwoFingersTouchZoomHandler:()=>ji,TwoFingersTouchZoomRotateHandler:()=>jp,VectorTileSource:()=>Fk,VideoSource:()=>FR,addProtocol:()=>xk,addSourceType:()=>FV,clearPrewarmedResources:()=>LD,config:()=>MA,createTileMesh:()=>Lj,getGlobalDispatcher:()=>LC,getMaxParallelImageRequests:()=>zO,getRTLTextPluginStatus:()=>zL,getVersion:()=>zP,getWorkerCount:()=>zz,getWorkerUrl:()=>zB,importScriptInWorkers:()=>zN,isTimeFrozen:()=>Ld,now:()=>Lu,prewarm:()=>LE,removeProtocol:()=>xS,restoreNow:()=>Lh,setMaxParallelImageRequests:()=>zR,setNow:()=>Lc,setRTLTextPlugin:()=>zI,setWorkerCount:()=>zF,setWorkerUrl:()=>zj});function LF(t){var r,i;if(!t)return{};let n={};return n.removeAll=t.removeAll,n.remove=new Set(t.remove||[]),n.add=new Map(null==(r=t.add)?void 0:r.map(t=>[t.id,t])),n.update=new Map(null==(i=t.update)?void 0:i.map(t=>[t.id,t])),n}function LO(t){return"GeometryCollection"===t.type?t.geometries.flatMap(t=>LO(t)):function t(r){return r&&0!==r.length?"number"==typeof r[0]?[r]:r.flatMap(r=>t(r)):[]}(t.coordinates)}function LR(t){let r=new FA,i;switch(t.type){case"FeatureCollection":i=t.features.flatMap(t=>LO(t.geometry));break;case"Feature":i=LO(t.geometry);break;default:i=LO(t)}if(0===i.length)return r;for(let t of i){let[i,n]=t;r.extend([i,n])}return r}function LB(t,r){let i=Lj(r,"16bit"),n=Es.deserialize({arrayBuffer:i.vertices,length:i.vertices.byteLength/2/2}),a=EA.deserialize({arrayBuffer:i.indices,length:i.indices.byteLength/2/3});return new FP(t.createVertexBuffer(n,Fz.members),t.createIndexBuffer(a),ED.simpleSegment(0,0,n.length,a.length))}function Lj(t,r){let i=void 0===t.granularity?1:Math.max(t.granularity,1),n=i+2*!!t.generateBorders,a=i+(t.extendToNorthPole||t.generateBorders?1:0)+(t.extendToSouthPole||t.generateBorders?1:0),o=n+1,s=a+1,l=t.generateBorders?-1:0,u=t.generateBorders||t.extendToNorthPole?-1:0,c=i+ +!!t.generateBorders,h=i+(t.generateBorders||t.extendToSouthPole?1:0),d=n*a*6,f=o*s>65536;if(f&&"16bit"===r)throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let p=f||"32bit"===r,m=new Int16Array(o*s*2),g=0;for(let r=u;r<=h;r++)for(let n=l;n<=c;n++){let a=n/i*Mf;-1===n&&(a=-FF),n===i+1&&(a=Mf+FF);let o=r/i*Mf;-1===r&&(o=t.extendToNorthPole?DF:-FF),r===i+1&&(o=t.extendToSouthPole?DO:Mf+FF),m[g++]=a,m[g++]=o}let y=p?new Uint32Array(d):new Uint16Array(d),v=0;for(let t=0;t0){let i=Math.hypot(u[0],u[1],u[2]);if(i>0){let n=1+r.maxContentElevation/DJ,a=Math.cos(Math.acos(xr(-u[3]/i,-1,1))+Math.acos(1/n));u=[u[0],u[1],u[2],-a*i],l=function(t,r,i){let n=t.planes[1],a=t.points.map(t=>{if(Math.abs(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3])>1e-6)return t;let a=[t[0]-i[0],t[1]-i[1],t[2]-i[2]],o=n[0]*a[0]+n[1]*a[1]+n[2]*a[2];if(o>=-1e-9)return t;let s=-(r/o);return[t[0]+a[0]*s,t[1]+a[1]*s,t[2]+a[2]*s,t[3]]}),o=t.planes.map((t,i)=>1===i?[t[0],t[1],t[2],t[3]+r]:t),s=[1/0,1/0,1/0],l=[-1/0,-1/0,-1/0];for(let t of a)for(let r=0;r<3;r++)s[r]=Math.min(s[r],t[r]),l[r]=Math.max(l[r],t[r]);return new FY(a,o,new FW(s,l))}(l,Math.sqrt(n*n-1),t.cameraPosition)}}let c=(a=1/w9((n=t).center.lat)*n.worldSize,Tu(n.center,n.elevation,n.pitch,n.bearing,n.cameraToCenterDistance/a)),h=D1.fromLngLat(t.center,t.elevation),d=(i=r.maxContentElevation,o=xr((15-(D2-t.pitch-t.fov/2))/15,0,1),s=Math.max(500,i??0),t.elevation+o*s),f=t.getCoveringTilesDetailsProvider(),p=f.allowVariableZoom(t,r),m=LH(t,r),g=r.minzoom||0,y=void 0===r.maxzoom?t.maxZoom:r.maxzoom,v=Math.min(Math.max(0,m),y),x=2**v,b=[x*c.x,x*c.y,0],_=[x*h.x,x*h.y,0],w=Math.hypot(h.x-c.x,h.y-c.y),T=Math.abs(h.z-c.z),A=Math.hypot(w,T),M=t=>({zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),k=[],S=[];if(t.renderWorldCopies&&f.allowWorldCopies())for(let t=1;t<=3;t++)k.push(M(-t)),k.push(M(t));for(k.push(M(0));k.length>0;){let i=k.pop(),n=i.x,a=i.y,o=i.fullyVisible,s={x:n,y:a,z:i.zoom},x=f.getTileBoundingVolume(s,i.wrap,d,r);if(!o){let t=function(t,r,i){let n=r.intersectsFrustum(t);if(!i||0===n)return n;let a=r.intersectsPlane(i);return 0===a?0:2===n&&2===a?2:1}(l,x,u);if(0===t)continue;o=2===t}let w=f.distanceToTile2d(c.x,c.y,s,x),M=m;p&&(M=(r.calculateTileZoom||FZ)(t.zoom+xs(t.tileSize/r.tileSize),w,T,A,t.fov));let E=Math.min(M=Math.max(0,M=(r.roundZoom?Math.round:Math.floor)(M)),y);if(i.wrap=f.getWrap(h,s,i.wrap),i.zoom>=E){if(i.zoom>1),l=i.zoom+1;k.push({zoom:l,x:r,y:s,wrap:i.wrap,fullyVisible:o})}}return S.sort((t,r)=>t.distanceSq-r.distanceSq).map(t=>t.tileID)}function LW(t){return"raster"===t||"image"===t||"video"===t}function LY(t,r,i,n,a,o,s){if(i[0].overscaledZ>=o)return!1;let l=!1;for(let o of i){let i=t.getLoadedTile(o);if(!i)continue;let{fadingRole:u,fadingDirection:c,fadingParentID:h}=i;0===u&&0===c&&h||(i.setCrossFadeLogic({fadingRole:0,fadingDirection:0,fadingParentID:r.tileID,fadeEndTime:a+s}),r.setCrossFadeLogic({fadingRole:1,fadingDirection:1,fadeEndTime:a+s})),n[o.key]=o,l=!0}return l}function LZ(t,r){var i;t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.needsColorReliefPrepare=!0;let n=r.tileID.canonical.x-t.tileID.canonical.x,a=r.tileID.canonical.y-t.tileID.canonical.y,o=2**t.tileID.canonical.z,s=r.tileID.key;(0!==n||0!==a)&&(Math.abs(a)>1||(Math.abs(n)>1&&(1===Math.abs(n+o)?n+=o:1===Math.abs(n-o)&&(n-=o)),r.dem&&t.dem&&(t.dem.backfillBorder(r.dem,n,a),null!=(i=t.neighboringTiles)&&i[s]&&(t.neighboringTiles[s].backfilled=!0))))}function LX(t,r,i,n,a){return a?t?t(r,i)+n:0===n?void 0:n:n}function LK(t,r){let i=!0;return"always"===t||("never"===t||"never"===r)&&(i=!1),i}function LJ(t,r,i){let n=vf();if(!t){var a,o,s,l,u;let{vecSouth:t,vecEast:i}=LQ(r),c=Ll();c[0]=i[0],c[1]=i[1],c[2]=t[0],c[3]=t[1],a=c[0],o=c[1],s=c[2],(u=a*(l=c[3])-s*o)&&(u=1/u,c[0]=l*u,c[1]=-o*u,c[2]=-s*u,c[3]=a*u),n[0]=c[0],n[1]=c[1],n[4]=c[2],n[5]=c[3]}return vx(n,n,[1/i,1/i,1]),n}function LQ(t){let r=Math.cos(t.rollInRadians),i=Math.sin(t.rollInRadians),n=Math.cos(t.pitchInRadians),a=Math.cos(t.bearingInRadians),o=Math.sin(t.bearingInRadians),s=vH();s[0]=-a*n*i-o*r,s[1]=-o*n*i+a*r;let l=vY(s);l<1e-9?vX(s):vW(s,s,1/l);let u=vH();u[0]=a*n*r-o*i,u[1]=o*n*r+a*i;let c=vY(u);return c<1e-9?vX(u):vW(u,u,1/c),{vecEast:u,vecSouth:s}}function L0(t,r,i){var n,a;return LX(t.getElevation,r,i,null!=(n=t.heightOffset)?n:0,null==(a=t.heightAnchorGround)||a)}function L1(t,r,i,n){let a;null==n?Pi(a=[t,r,0,1],a,i):vU(a=[t,r,n,1],a,i);let o=a[3];return{point:new vu(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function L2(t,r,i,n,a,o,s,l){let u=o.glyphStartIndex+o.numGlyphs,c=o.lineStartIndex,h=o.lineStartIndex+o.lineLength,d=r.getoffsetX(o.glyphStartIndex),f=r.getoffsetX(u-1),p=Pt(t*d,i,n,a,o.segment,c,h,l,s);if(!p)return null;let m=Pt(t*f,i,n,a,o.segment,c,h,l,s);return!m||l.projectionCache.anyProjectionOccluded?null:{first:p,last:m}}function L3(t,r,i,n){return 1===t&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*n?{useVertical:!0}:(2===t?r.yi.x)?{needsFlipping:!0}:null}function L5(t){let{projectionContext:r,pitchedLabelPlaneMatrixInverse:i,symbol:n,fontSize:a,flip:o,keepUpright:s,glyphOffsetArray:l,dynamicLayoutVertexArray:u,aspectRatio:c,rotateToLine:h}=t,d=a/24,f=n.lineOffsetX*d,p=n.lineOffsetY*d,m;if(n.numGlyphs>1){let t=n.glyphStartIndex+n.numGlyphs,a=n.lineStartIndex,u=n.lineStartIndex+n.lineLength,g=L2(d,l,f,p,o,n,h,r);if(!g)return{notEnoughRoom:!0};let y=L7(g.first.point.x,g.first.point.y,r,i),v=L7(g.last.point.x,g.last.point.y,r,i);if(s&&!o){let t=L3(n.writingMode,y,v,c);if(t)return t}m=[g.first];for(let i=n.glyphStartIndex+1;i0?s.point:L4(r.tileAnchorPoint,o,t,1,r),u=L7(t.x,t.y,r,i),h=L7(l.x,l.y,r,i),d=L3(n.writingMode,u,h,c);if(d)return d}let t=Pt(d*l.getoffsetX(n.glyphStartIndex),f,p,o,n.segment,n.lineStartIndex,n.lineStartIndex+n.lineLength,r,h);if(!t||r.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[t]}for(let t of m)T9(u,t.point,t.angle);return{}}function L4(t,r,i,n,a){let o=t.add(t.sub(r)._unit()),s=L8(o.x,o.y,a).point,l=i.sub(s);return i.add(l._mult(n/l.mag()))}function L6(t,r,i){let n=r.projectionCache;if(n.projections[t])return n.projections[t];let a=new vu(r.lineVertexArray.getx(t),r.lineVertexArray.gety(t)),o=L8(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return n.projections[t]=o.point,n.anyProjectionOccluded||(n.anyProjectionOccluded=o.isOccluded),o.point;let s=t-i.direction,l=0===i.distanceFromAnchor?r.tileAnchorPoint:new vu(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),u=i.absOffsetX-i.distanceFromAnchor+1;return L4(l,a,i.previousVertex,u,r)}function L8(t,r,i){let n=t+i.translation[0],a=r+i.translation[1],o;return i.pitchWithMap?(o=L1(n,a,i.pitchedLabelPlaneMatrix,L0(i,n,a))).isOccluded=!1:((o=i.transform.projectTileCoordinates(n,a,i.unwrappedTileID,L0(i,n,a))).point.x=(.5*o.point.x+.5)*i.width,o.point.y=(-(.5*o.point.y)+.5)*i.height),o}function L7(t,r,i,n){if(i.pitchWithMap){let a=[t,r,0,1];vU(a,a,n);let o=a[0]/a[3],s=a[1]/a[3];return i.transform.projectTileCoordinates(o,s,i.unwrappedTileID,L0(i,o,s)).point}return{x:t/i.width*2-1,y:1-r/i.height*2}}function L9(t,r,i){return i.transform.projectTileCoordinates(t,r,i.unwrappedTileID,L0(i,t,r))}function Pe(t,r,i){return t._unit()._perp()._mult(r*i)}function Pt(t,r,i,n,a,o,s,l,u){let c=n?t-r:t+r,h=c>0?1:-1,d=0;n&&(h*=-1,d=Math.PI),h<0&&(d+=Math.PI);let f=h>0?o+a:o+a+1,p;l.projectionCache.cachedAnchorPoint?p=l.projectionCache.cachedAnchorPoint:(p=L8(l.tileAnchorPoint.x,l.tileAnchorPoint.y,l).point,l.projectionCache.cachedAnchorPoint=p);let m=p,g=p,y,v,x=0,b=0,_=Math.abs(c),w=[],T;for(;x+b<=_;){if((f+=h)=s)return null;x+=b,g=m,v=y;let t={absOffsetX:_,direction:h,distanceFromAnchor:x,previousVertex:g};if(m=L6(f,l,t),0===i)w.push(g),T=m.sub(g);else{let r,n=m.sub(g);r=0===n.mag()?Pe(L6(f+h,l,t).sub(m),i,h):Pe(n,i,h),v||(v=g.add(r)),y=function(t,r,i,n,a,o,s,l,u){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];let c=i.add(r);if(t+u.direction=a)return l.projectionCache.offsets[t]=c,c;let h=L6(t+u.direction,l,u),d=Pe(h.sub(i),s,u.direction),f=i.add(d),p=h.add(d);return l.projectionCache.offsets[t]=function(t,r,i,n){let a=r.y-t.y,o=r.x-t.x,s=n.y-i.y,l=n.x-i.x,u=s*o-l*a;if(0===u)return null;let c=(l*(t.y-i.y)-s*(t.x-i.x))/u;return new vu(t.x+c*o,t.y+c*a)}(o,c,f,p)||c,l.projectionCache.offsets[t]}(f,r,m,o,s,v,i,l,t),w.push(v),T=y.sub(v)}b=T.mag()}let A=(_-x)/b,M=T._mult(A)._add(v||g),k=d+Math.atan2(m.y-g.y,m.x-g.x);return w.push(M),{point:M,angle:u?k:0,path:w}}function Pr(t,r){for(let i=0;i(u[a]=!0,"define"===r?` -#ifndef HAS_UNIFORM_u_${a} -in ${i} ${n} ${a}; -#else -uniform ${i} ${n} u_${a}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${a} - ${i} ${n} ${a} = u_${a}; -#endif -`)),vertexSource:r=r.replace(i,(t,r,i,n,a)=>{let o="float"===n?"vec2":"vec4",s=a.match(/color/)?"color":o;return u[a]?"define"===r?` -#ifndef HAS_UNIFORM_u_${a} -uniform lowp float u_${a}_t; -layout(location = ${l++}) in ${i} ${o} a_${a}; -out ${i} ${n} ${a}; -#else -uniform ${i} ${n} u_${a}; -#endif -`:"vec4"===s?` -#ifndef HAS_UNIFORM_u_${a} - ${a} = a_${a}; -#else - ${i} ${n} ${a} = u_${a}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${a} - ${a} = unpack_mix_${s}(a_${a}, u_${a}_t); -#else - ${i} ${n} ${a} = u_${a}; -#endif -`:"define"===r?` -#ifndef HAS_UNIFORM_u_${a} -uniform lowp float u_${a}_t; -layout(location = ${l++}) in ${i} ${o} a_${a}; -#else -uniform ${i} ${n} u_${a}; -#endif -`:"vec4"===s?` -#ifndef HAS_UNIFORM_u_${a} - ${i} ${n} ${a} = a_${a}; -#else - ${i} ${n} ${a} = u_${a}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${a} - ${i} ${n} ${a} = unpack_mix_${s}(a_${a}, u_${a}_t); -#else - ${i} ${n} ${a} = u_${a}; -#endif -`}),staticAttributes:n,staticUniforms:s}}function Ph(t,r){if(!t.renderWorldCopies||t.lngRange)return;let i=r.lng-t.center.lng;r.lng+=i>180?-360:360*(i<-180)}function Pd(t){return Math.max(0,Math.floor(t))}function Pf(t,r,i,n){if(n<0||n>=1)return OE;let a=Math.floor(i),o=i-a;for(let i of t.zooms){let s=1<a;o++){let a=(i+n)/2;r(t,a)?n=a:i=a}return{lo:i,hi:n}}function Pg(t,r){return Pf(t.index,t.exaggeration,(t.near[0]+r*t.dx)/t.worldSize,(t.near[1]+r*t.dy)/t.worldSize)}function Py(t,r){return Pp(Pg(t,r),t.near[2]+r*t.dz)}function Pv(){xf("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Px(t){if(t.useSlerp)if(t.k<1){var r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D,C,I,L;let P,z,F,O,R=xw(t.startEulerAngles.roll,t.startEulerAngles.pitch,t.startEulerAngles.bearing),B=xw(t.endEulerAngles.roll,t.endEulerAngles.pitch,t.endEulerAngles.bearing),j=new Float64Array(4);r=t.k,s=R[0],l=R[1],u=R[2],c=R[3],h=B[0],d=B[1],(m=s*h+l*d+u*(f=B[2])+c*(p=B[3]))<0&&(m=-m,h=-h,d=-d,f=-f,p=-p),1-m>1e-6?(n=Math.sin(i=Math.acos(m)),a=Math.sin((1-r)*i)/n,o=Math.sin(r*i)/n):(a=1-r,o=r),j[0]=a*s+o*h,j[1]=a*l+o*d,j[2]=a*u+o*f,j[3]=a*c+o*p;let N=(g=P=new Float64Array(9),y=j[0],v=j[1],x=j[2],b=j[3],_=y+y,w=v+v,T=x+x,A=y*_,M=v*_,k=v*w,S=x*_,E=x*w,D=x*T,C=b*_,I=b*w,L=b*T,g[0]=1-k-D,g[3]=M-L,g[6]=S+I,g[1]=M+L,g[4]=1-A-D,g[7]=E-C,g[2]=S-I,g[5]=E+C,g[8]=1-A-k,z=xx(-Math.asin(xr(P[2],-1,1))),.001>Math.hypot(P[5],P[8])?(F=0,O=-xx(Math.atan2(P[3],P[4]))):(F=xx(0===P[5]&&0===P[8]?0:Math.atan2(P[5],P[8])),O=xx(0===P[1]&&0===P[0]?0:Math.atan2(P[1],P[0]))),{roll:F,pitch:z+90,bearing:O});t.tr.setRoll(N.roll),t.tr.setPitch(N.pitch),t.tr.setBearing(N.bearing)}else t.tr.setRoll(t.endEulerAngles.roll),t.tr.setPitch(t.endEulerAngles.pitch),t.tr.setBearing(t.endEulerAngles.bearing);else t.tr.setRoll(kx.number(t.startEulerAngles.roll,t.endEulerAngles.roll,t.k)),t.tr.setPitch(kx.number(t.startEulerAngles.pitch,t.endEulerAngles.pitch,t.k)),t.tr.setBearing(kx.number(t.startEulerAngles.bearing,t.endEulerAngles.bearing,t.k))}function Pb(t,r,i,n,a){let o=a.padding,s=Ta(a.worldSize,i.getNorthWest()),l=Ta(a.worldSize,i.getNorthEast()),u=Ta(a.worldSize,i.getSouthEast()),c=Ta(a.worldSize,i.getSouthWest()),h=xv(-n),d=s.rotate(h),f=l.rotate(h),p=u.rotate(h),m=c.rotate(h),g=new vu(Math.max(d.x,f.x,m.x,p.x),Math.max(d.y,f.y,m.y,p.y)),y=new vu(Math.min(d.x,f.x,m.x,p.x),Math.min(d.y,f.y,m.y,p.y)),v=g.sub(y),x=a.width-(o.left+o.right+r.left+r.right),b=a.height-(o.top+o.bottom+r.top+r.bottom),_=x/v.x,w=b/v.y;if(w<0||_<0)return void Pv();let T=Math.min(xs(a.scale*Math.min(_,w)),t.maxZoom),A=vu.convert(t.offset),M=new vu((r.left-r.right)/2,(r.top-r.bottom)/2).rotate(xv(n)),k=A.add(M).mult(a.scale/xo(T));return{center:To(a.worldSize,s.add(u).div(2).sub(k)),zoom:T,bearing:n}}function P_(t){return 2*Math.PI*PA(t.worldSize,t.center.lat)}function Pw(t,r,i,n,a){var o;let s=1/(1<1e-6){let n=t[0]/i,a=Math.acos(t[2]/i);return new DQ(xi((n>0?a:-a)/Math.PI*180,-180,180),r)}return new DQ(0,r)}function PS(t,r){let i=t.cameraPosition,n=vS(i);if(n<=1)return t.screenPointToLocation(r);let a=v0();vP(a,i);let o=t.getRayDirectionFromPixel(r),s=-vz(o,a),l=v0();vL(l,o,a,s);let u=vS(l);if(u<1e-9)return t.screenPointToLocation(r);let c=Math.atan2(u,s),h=.9*Math.asin(1/n);if(c1){let o=(Math.sign(t.lat+i)===Math.sign(t.lat)?Math.abs(t.lat):-Math.abs(t.lat))*Math.PI/180,s=Math.abs(t.lat+i)*Math.PI/180,l=PC(o+n*(s-o)),u=PC(o),c=PC(s),h=t.lng+(l-u)/(c-u)*r;return new DQ(h,a)}{let i=t.lng+r*n;return new DQ(i,a)}}function PL(t,r,i=1){let n=vz(t,r),a=i*i,o=v0(),s=v0();vI(s,r,n),Ml(o,t,s);let l=a-vz(o,o);if(l<0)return null;let u=vz(t,t)-a,c=-n+(n<0?1:-1)*Math.sqrt(l),h=u/c;return{tMin:Math.min(h,c),tMax:Math.max(h,c)}}function PP(t,r,i){let n=t-r;return n<0?-n:Math.max(0,n-i)}function Pz(t,r,i,n,a){let o=t-i;return Math.max(o<0?Math.min(-o,1+o-a):o>a?Math.min(Math.max(o-a,0),1-o):0,PP(r,n,a))}function PF(t,r){let i=1/0,n=-1/0;for(let a of r){let r=vz(t,a);i=Math.min(i,r),n=Math.max(n,r)}return{min:i,max:n}}function PO(t,r){let i=v0();vL(i,t.origin,t.direction,r);let n=vS(i),a=v0();vI(a,i,1/n);let o=Pk(a),s=D1.fromLngLat(o),l=new D1(s.x,xr(s.y,0,.999999999)),u=Pf(t.index,t.exaggeration,l.x,l.y),c=Math.abs(o.lat)>85.051129?0:u.elevation;return{sample:p(f({},u),{elevation:c}),radius:n,mercator:l}}function PR(t,r){let{sample:i,radius:n}=PO(t,r);return Pp(i,(n-1)*DJ)}function PB(t){let r={},i=0;for(let{name:n,type:a}of t){let[t,o]=OJ[a];i=Math.ceil(i/o)*o,r[n]=i,i+=t}return{offsets:r,contentWords:i,sizeWords:4*Math.ceil(i/4)}}function Pj(t){let r=[];for(let i of t){if(null===i)continue;let t=i.split(" ");r.push(t.pop())}return r}function PN(t,r,i){let n=1/vK(i,1,r.transform.tileZoom),a=2**i.tileID.overscaledZ,o=i.tileSize*2**r.transform.tileZoom/a,s=o*(i.tileID.canonical.x+i.tileID.wrap*a),l=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}function PV(t,r){return 1/vK(t,1,r.tileZoom)}function PU(t,r,i){return v5(t.transform,r,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}function Pq(t,r,i,n,a){var o,s;let l=t.context,u=t.transform,c=l.gl,h=t.useProgram("collisionBox"),d=[],f=0,p=0;for(let s of n){let n=r.getTile(s).getBucket(i);if(!n)continue;let m=a?n.textCollisionBox:n.iconCollisionBox,g=n.collisionCircleArray;g.length>0&&(d.push({circleArray:g,circleOffset:p,coord:s}),f+=g.length/4,p=f),m&&h.draw(l,c.LINES,BD.disabled,BC.disabled,t.colorModeForRenderPass(),BI.disabled,null,null==(o=t.style.map.terrain)?void 0:o.getTerrainData(s),u.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),i.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,t.transform.zoom,null,null,m.collisionVertexBuffer)}if(!a||!d.length)return;let m=t.useProgram("collisionCircle"),g=new E_;g.resize(4*f),g._trim();let y=0;for(let t of d)for(let r=0;rd.getElevation(a,t,r):void 0;!function(t,r,i,n,a,o,s,l,u,c,h,d,f){let p=t.text.placedSymbolArray,m=t.text.dynamicLayoutVertexArray,g=t.icon.dynamicLayoutVertexArray,y={};m.clear();for(let g=0;g=0&&(y[v.associatedIconIndex]={shiftedAnchor:D,angle:C})}else Pr(v.numGlyphs,m)}if(u){g.clear();let r=t.icon.placedSymbolArray;for(let t=0;tt.style.map.terrain.getElevation(l,r,i):void 0;!function(t,r,i,n,a,o,s,l,u,c,h,d,f){let p=i?t.textSizeData:t.iconSizeData,m=TW(p,r.transform.zoom),g=[256/r.width*2+1,256/r.height*2+1],y=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;y.clear();let v=t.lineVertexArray,x=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,b=r.transform.width/r.transform.height,_=!1;for(let i=0;i=-g[0]&&w.x<=g[0]&&w.y>=-g[1])||!(w.y<=g[1])){Pr(T.numGlyphs,y);continue}let S=k.signedDistanceFromCamera,E=.5+r.transform.cameraToCenterDistance/S*.5,D=T$(p,m,T),C=o?D*r.transform.getPitchedTextCorrection(T.anchorX,T.anchorY,u)/E:D*E,I=L5({projectionContext:M,pitchedLabelPlaneMatrixInverse:a,symbol:T,fontSize:C,flip:!1,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:y,aspectRatio:b,rotateToLine:l});_=I.useVertical,(I.notEnoughRoom||_||I.needsFlipping&&L5({projectionContext:M,pitchedLabelPlaneMatrixInverse:a,symbol:T,fontSize:C,flip:!0,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:y,aspectRatio:b,rotateToLine:l}).notEnoughRoom)&&Pr(T.numGlyphs,y)}i?t.text.dynamicLayoutVertexBuffer.updateData(y):t.icon.dynamicLayoutVertexBuffer.updateData(y)}(u,t,a,j,r,b,c,"map"===i.layout.get("text-rotation-alignment"),l.toUnwrapped(),v.width,v.height,V,n)}let W=a&&k||G,Y=b?j:t.transform.clipSpaceToPixelsMatrix,Z=_||W?BP:Y,X=m&&0!==i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),K={program:D,buffers:h,uniformValues:m?u.iconsInText?RB(g.kind,C,w,b,_,W,t,Z,N,V,L,P,E,H,$):RR(g.kind,C,w,b,_,W,t,Z,N,V,a,L,X,E,H,$):RO(g.kind,C,w,b,_,W,t,Z,N,V,a,L,E,H,$),projectionData:U,atlasTexture:z,atlasTextureIcon:O,atlasInterpolation:F,atlasInterpolationIcon:R,isSDF:m,hasHalo:X};if(T&&u.canOverlap)for(let t of(A=!0,h.segments.get()))S.push({segments:new ED([t]),sortKey:t.sortKey,state:K,terrainData:I});else S.push({segments:h.segments,sortKey:0,state:K,terrainData:I})}A&&S.sort((t,r)=>t.sortKey-r.sortKey);let D=null!=(m=i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(null))?m:1/0,C=24*i.layout.get("text-letter-spacing").constantOr(0)<0||D>1;for(let r of S){let n=r.state;g.activeTexture.set(y.TEXTURE0),n.atlasTexture.bind(n.atlasInterpolation,y.CLAMP_TO_EDGE),n.atlasTextureIcon&&(g.activeTexture.set(y.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,y.CLAMP_TO_EDGE));let a=n.isSDF&&n.hasHalo;if(a){let a=n.uniformValues;a.u_is_halo=1,C&&(a.u_is_plain=0,P$(n.buffers,r.segments,i,t,n.program,M,h,d,a,n.projectionData,r.terrainData),a.u_is_halo=0,a.u_is_plain=1)}P$(n.buffers,r.segments,i,t,n.program,M,h,d,n.uniformValues,n.projectionData,r.terrainData),a&&!C&&(n.uniformValues.u_is_halo=0)}}function P$(t,r,i,n,a,o,s,l,u,c,h){let d=n.context,f=d.gl;a.draw(d,f.TRIANGLES,o,s,l,BI.backCCW,u,h,c,i.id,t.layoutVertexBuffer,t.indexBuffer,r,i.paint,n.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function PW(t,r,i,n,a){var o;if("translucent"!==a.currentPass)return;let{isRenderingToTexture:s}=a,l=i.paint.get("circle-opacity"),u=i.paint.get("circle-stroke-width"),c=i.paint.get("circle-stroke-opacity"),h=!i.layout.get("circle-sort-key").isConstant();if(0===l.constantOr(1)&&(0===u.constantOr(1)||0===c.constantOr(1)))return;let d=t.context,f=d.gl,p=t.transform,m=t.getDepthModeForSublayer(0,BD.ReadOnly),g=BC.disabled,y=t.colorModeForRenderPass(),v=[],x=p.getCircleRadiusCorrection();for(let a of n){let n=r.getTile(a),l=n.getBucket(i);if(!l)continue;let u=v5(p,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),c=l.programConfigurations.get(i.id),d=t.useProgram("circle",c),f=l.layoutVertexBuffer,m=l.indexBuffer,g=null==(o=t.style.map.terrain)?void 0:o.getTerrainData(a),y={programConfiguration:c,program:d,layoutVertexBuffer:f,indexBuffer:m,uniformValues:Rl(t,n,i,u,x),terrainData:g,projectionData:p.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!s,applyTerrainMatrix:!0})};if(h)for(let t of l.segments.get())v.push({segments:new ED([t]),sortKey:t.sortKey,state:y});else v.push({segments:l.segments,sortKey:0,state:y})}for(let r of(h&&v.sort((t,r)=>t.sortKey-r.sortKey),v)){let{programConfiguration:n,program:a,layoutVertexBuffer:o,indexBuffer:s,uniformValues:l,terrainData:u,projectionData:c}=r.state,h=r.segments;a.draw(d,f.TRIANGLES,m,g,y,BI.backCCW,l,u,c,i.id,o,s,h,i.paint,t.transform.zoom,n)}}function PY(t,r,i,n,a){if(0===i.paint.get("heatmap-opacity"))return;let o=t.context,{isRenderingToTexture:s,isRenderingGlobe:l}=a;if(t.style.map.terrain){for(let o of n){let n=r.getTile(o);r.hasRenderableParent(o)||("offscreen"===a.currentPass?function(t,r,i,n,a){let o=t.context,s=o.gl,l=BC.disabled,u=new BS([s.ONE,s.ONE],kt.transparent,[!0,!0,!0,!0]),c=r.getBucket(i);if(!c)return;let h=n.key,d=i.heatmapFbos.get(h);d||(d=PZ(o,r.tileSize,r.tileSize),i.heatmapFbos.set(h,d)),o.bindFramebuffer.set(d.framebuffer),o.viewport.set([0,0,r.tileSize,r.tileSize]),o.clear({color:kt.transparent});let f=c.programConfigurations.get(i.id),p=t.useProgram("heatmap",f,!a),m=t.transform.getProjectionData({overscaledTileID:r.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=t.style.map.terrain.getTerrainData(n);p.draw(o,s.TRIANGLES,BD.disabled,l,u,BI.disabled,Rf(r,t.transform.zoom,i.paint.get("heatmap-intensity"),1),g,m,i.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,i.paint,t.transform.zoom,f)}(t,n,i,o,l):"translucent"===a.currentPass&&function(t,r,i,n,a){let o=t.context,s=o.gl,l=t.transform;o.setColorMode(t.colorModeForRenderPass());let u=PX(o,r),c=i.key,h=r.heatmapFbos.get(c);if(!h)return;o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,h.colorAttachment.get()),o.activeTexture.set(s.TEXTURE1),u.bind(s.LINEAR,s.CLAMP_TO_EDGE);let d=l.getProjectionData({overscaledTileID:i,applyTerrainMatrix:a,applyGlobeMatrix:!n});t.useProgram("heatmapTexture").draw(o,s.TRIANGLES,BD.disabled,BC.disabled,t.colorModeForRenderPass(),BI.disabled,Rp(t,r,0,1),null,d,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,r.paint,l.zoom),h.destroy(),r.heatmapFbos.delete(c)}(t,i,o,s,l))}o.viewport.set([0,0,t.width,t.height])}else{var u,c;let o,s,l;"offscreen"===a.currentPass?function(t,r,i,n){var a,o,s;let l,u,c=t.context,h=c.gl,d=t.transform,f=BC.disabled,p=new BS([h.ONE,h.ONE],kt.transparent,[!0,!0,!0,!0]);for(let m of(a=c,o=t,s=i,l=a.gl,a.activeTexture.set(l.TEXTURE1),a.viewport.set([0,0,o.width/4,o.height/4]),(u=s.heatmapFbos.get(Da))?(l.bindTexture(l.TEXTURE_2D,u.colorAttachment.get()),a.bindFramebuffer.set(u.framebuffer)):(u=PZ(a,o.width/4,o.height/4),s.heatmapFbos.set(Da,u)),c.clear({color:kt.transparent}),n)){if(r.hasRenderableParent(m))continue;let n=r.getTile(m),a=n.getBucket(i);if(!a)continue;let o=a.programConfigurations.get(i.id),s=t.useProgram("heatmap",o),l=d.getProjectionData({overscaledTileID:m,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),u=d.getCircleRadiusCorrection();s.draw(c,h.TRIANGLES,BD.disabled,f,p,BI.backCCW,Rf(n,d.zoom,i.paint.get("heatmap-intensity"),u),null,l,i.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,i.paint,d.zoom,o)}c.viewport.set([0,0,t.width,t.height])}(t,r,i,n):"translucent"===a.currentPass&&(u=t,c=i,s=(o=u.context).gl,o.setColorMode(u.colorModeForRenderPass()),(l=c.heatmapFbos.get(Da))&&(o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get()),o.activeTexture.set(s.TEXTURE1),PX(o,c).bind(s.LINEAR,s.CLAMP_TO_EDGE),u.useProgram("heatmapTexture").draw(o,s.TRIANGLES,BD.disabled,BC.disabled,u.colorModeForRenderPass(),BI.disabled,Rp(u,c,0,1),null,null,c.id,u.viewportBuffer,u.quadTriangleIndexBuffer,u.viewportSegments,c.paint,u.transform.zoom)))}}function PZ(t,r,i){let n=t.gl,a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),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),n.texStorage2D(n.TEXTURE_2D,1,n.RGBA16F,r,i);let o=t.createFramebuffer(r,i,!1,!1);return o.colorAttachment.set(a),o}function PX(t,r){return r.colorRampTexture||(r.colorRampTexture=new Dp(t,r.colorRamp,t.gl.RGBA)),r.colorRampTexture}function PK(t,r,i,n){let a=t.context,o=a.bindFramebuffer.get(),s=a.viewport.get(),[,,l,u]=s;return function(t,r,i){let n=t.context.gl;if(!t.layerOpacityFbo){let a=t.context.createFramebuffer(r,i,!0,!0),o=n.createTexture();n.bindTexture(n.TEXTURE_2D,o),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),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,r,i,0,n.RGBA,n.UNSIGNED_BYTE,null),a.colorAttachment.set(o),a.depthAttachment.set(t.context.createRenderbuffer(n.DEPTH_STENCIL,r,i)),t.layerOpacityFbo=a,t.context.bindFramebuffer.set(t.layerOpacityFbo.framebuffer);return}if(t.layerOpacityFbo.width===r&&t.layerOpacityFbo.height===i)return t.context.bindFramebuffer.set(t.layerOpacityFbo.framebuffer);let a=t.layerOpacityFbo;n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,r,i,0,n.RGBA,n.UNSIGNED_BYTE,null),t.context.bindRenderbuffer.set(a.depthAttachment.get()),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,r,i),t.context.bindRenderbuffer.set(null),a.width=r,a.height=i,t.context.bindFramebuffer.set(a.framebuffer)}(t,l,u),a.viewport.set([0,0,l,u]),a.clear({color:kt.transparent,depth:1,stencil:0}),t.currentStencilSource=void 0,t.renderTileClippingMasks(r,i,n),{compositeTarget:o,compositeViewport:s}}function PJ(t,r,i,n){let a=t.context,o=a.gl;a.bindFramebuffer.set(i.compositeTarget),a.viewport.set(i.compositeViewport),a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.layerOpacityFbo.colorAttachment.get()),t.useProgram("layerOpacity").draw(a,o.TRIANGLES,BD.disabled,BC.disabled,t.colorModeForRenderPass(),BI.disabled,RL(r,0),null,null,n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,n.paint,t.transform.zoom),t.currentStencilSource=void 0}function PQ(t,r,i,n,a,o,s,l){let u=256;if(a.stepInterpolant){var c;let n=r.getSource().maxzoom,a=s.canonical.z===n?Math.ceil(1<t.options.anisotropicFilterPitch&&m.texParameterf(m.TEXTURE_2D,p.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,p.extTextureFilterAnisotropicMax);let I=t.getTerrainDataForTile(M,h),L=y.getProjectionData({overscaledTileID:M,aligned:b,applyGlobeMatrix:!h,applyTerrainMatrix:!0}),P=FL(D,E,C.fadeMix,i,l,u),z=d??v.getMeshFromTileID(p,M.canonical,o,s,"raster"),F=a?a[M.overscaledZ]:BC.disabled;g.draw(p,m.TRIANGLES,n,F,x,c?BI.frontCCW:BI.backCCW,P,I,L,i.id,z.vertexBuffer,z.indexBuffer,z.segments)}}function za(t,r,i,n,a){let o=i.paint.get("background-color"),s=i.paint.get("background-opacity");if(0===s)return;let{isRenderingToTexture:l}=a,u=t.context,c=u.gl,h=t.style.projection,d=t.transform,f=d.tileSize,p=i.paint.get("background-pattern");if(t.isPatternMissing(p))return;let m=!p&&1===o.a&&1===s&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(a.currentPass!==m)return;let g=BC.disabled,y=t.getDepthModeForSublayer(0,"opaque"===m?BD.ReadWrite:BD.ReadOnly),v=t.colorModeForRenderPass(),x=t.useProgram(p?"backgroundPattern":"background"),b=n||L$(d,{tileSize:f,terrain:t.style.map.terrain});p&&(u.activeTexture.set(c.TEXTURE0),t.patternAtlas.bind(t.context));let _=i.getCrossfadeParameters();for(let r of b){let n=d.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),a=p?RU(s,t,p,{tileID:r,tileSize:f},_):RV(s,o),m=t.getTerrainDataForTile(r,l),b=h.getMeshFromTileID(u,r.canonical,!1,!0,"raster");x.draw(u,c.TRIANGLES,y,g,v,BI.backCCW,a,m,n,i.id,b.vertexBuffer,b.indexBuffer,b.segments)}}function zo(t){var r,i,n,a;let o=t.transform.padding;zs(t,t.transform.height-(o.top||0),3,BO),zs(t,o.bottom||0,3,BR),zl(t,o.left||0,3,BB),zl(t,t.transform.width-(o.right||0),3,Bj);let s=t.transform.centerPoint;r=t,i=s.x,n=t.transform.height-s.y,zu(r,i-1,n-10,2,20,a=BN),zu(r,i-10,n-1,20,2,a)}function zs(t,r,i,n){zu(t,0,r+i/2,t.transform.width,i,n)}function zl(t,r,i,n){zu(t,r-i/2,0,i,t.transform.height,n)}function zu(t,r,i,n,a,o){let s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*t.pixelRatio,i*t.pixelRatio,n*t.pixelRatio,a*t.pixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function zc(t,r,i){for(let n of i)!function(t,r,i){var n,a;let o=t.context,s=o.gl,l=t.useProgram("debug"),u=BD.disabled,c=BC.disabled,h=t.colorModeForRenderPass(),d="$debug",f=null==(n=t.style.map.terrain)?void 0:n.getTerrainData(i);o.activeTexture.set(s.TEXTURE0);let p=Math.floor(((null==(a=r.getTileByID(i.key).latestRawTileData)?void 0:a.byteLength)||0)/1024),m=512/Math.min(r.getTile(i).tileSize,512)*(i.overscaledZ/t.transform.zoom)*.5,g=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(g+=` => ${i.overscaledZ}`),function(t,r){t.initDebugOverlayCanvas();let i=t.debugOverlayCanvas,n=t.context.gl,a=t.debugOverlayCanvas.getContext("2d");a.clearRect(0,0,i.width,i.height),a.shadowColor="white",a.shadowBlur=2,a.lineWidth=1.5,a.strokeStyle="white",a.textBaseline="top",a.font="bold 36px Open Sans, sans-serif",a.fillText(r,5,5),a.strokeText(r,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${g} ${p}kB`);let y=t.transform.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!0,applyTerrainMatrix:!0});l.draw(o,s.TRIANGLES,u,c,BS.alphaBlended,BI.disabled,Rc(kt.transparent,m),null,y,d,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),l.draw(o,s.LINE_STRIP,u,c,h,BI.disabled,Rc(kt.red),f,y,d,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,r,n)}function zh(t,r,i,n){let{isRenderingGlobe:a}=n,o=t.context,s=i.implementation,l=t.style.projection,u=t.transform,c=u.getProjectionDataForCustomLayer(a),h={farZ:u.farZ,nearZ:u.nearZ,fov:u.fov*Math.PI/180,modelViewProjectionMatrix:u.modelViewProjectionMatrix,projectionMatrix:u.projectionMatrix,shaderData:{variantName:l.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793; -uniform mat4 u_projection_matrix; -${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionData:c,getProjectionData:t=>{var r;return u.getProjectionData({overscaledTileID:new Ia(t.tileID.canonical.z,null!=(r=t.tileID.wrap)?r:0,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),aligned:t.aligned,applyGlobeMatrix:t.applyGlobeMatrix,applyTerrainMatrix:t.applyTerrainMatrix})}},d=s.renderingMode?s.renderingMode:"2d";if("offscreen"===n.currentPass){let r=s.prerender;r&&(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),r.call(s,o.gl,h),o.setDirty(),t.setBaseState())}else if("translucent"===n.currentPass){t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(BC.disabled);let r="3d"===d?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,BD.ReadOnly);o.setDepthMode(r),s.render(o.gl,h),o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}function zd(t,r){let i=t.context,n=i.gl,a=t.transform,o=BS.unblended,s=new BD(n.LEQUAL,BD.ReadWrite,[0,1]),l=r.tileManager.getRenderableTiles(),u=t.useProgram("terrainDepth");for(let c of(i.bindFramebuffer.set(r.getFramebuffer().framebuffer),i.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),i.clear({color:kt.white,depth:1}),l)){let t=r.getTerrainMesh(c.tileID),l=r.getTerrainData(c.tileID),h=a.getProjectionData({overscaledTileID:c.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),d=OX(r.getSkirtLength(a.zoom));u.draw(i,n.TRIANGLES,s,BC.disabled,o,BI.backCCW,d,l,h,"terrain",t.vertexBuffer,t.indexBuffer,t.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,t.width,t.height])}function zf(t,r){if(!r.mesh){let i=new Es;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1);let n=new EA;n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),r.mesh=new FP(t.createVertexBuffer(i,Fz.members),t.createIndexBuffer(n),ED.simpleSegment(0,0,i.length,n.length))}return r.mesh}function zp(t,r){let i=t.context,n=i.gl,a=R$(r,t.transform,t.pixelRatio),o=new BD(n.LEQUAL,BD.ReadWrite,[0,1]),s=BC.disabled,l=t.colorModeForRenderPass(),u=t.useProgram("sky"),c=zf(i,r);u.draw(i,n.TRIANGLES,o,s,l,BI.disabled,a,null,void 0,"sky",c.vertexBuffer,c.indexBuffer,c.segments)}function zm(t,r,i){var n,a,o,s,l,u;let c,h,d=t.context,f=d.gl,p=t.useProgram("atmosphere"),m=new BD(f.LEQUAL,BD.ReadOnly,[0,1]),g=t.transform,y=(n=t.transform,a=c=i.getCartesianPosition(),a[0]=-c[0],a[1]=-c[1],a[2]=-c[2],h=vm(new Float64Array(16)),"map"===i.properties.get("anchor")&&(vw(h,h,n.rollInRadians),vb(h,h,-n.pitchInRadians),vw(h,h,n.bearingInRadians),vb(h,h,n.center.lat*Math.PI/180),v_(h,h,-n.center.lng*Math.PI/180)),o=c[0],s=c[1],l=c[2],(u=h[3]*o+h[7]*s+h[11]*l+h[15])||(u=1),c[0]=(h[0]*o+h[4]*s+h[8]*l+h[12])/u,c[1]=(h[1]*o+h[5]*s+h[9]*l+h[13])/u,c[2]=(h[2]*o+h[6]*s+h[10]*l+h[14])/u,c),v=g.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),x=r.properties.get("atmosphere-blend")*v.projectionTransition;if(0===x)return;let b=PA(g.worldSize,g.center.lat),_=PM(g),w=RG(y,x,_,b,g.inverseProjectionMatrix),T=zf(d,r);p.draw(d,f.TRIANGLES,m,BC.disabled,BS.alphaBlended,BI.disabled,w,null,null,"atmosphere",T.vertexBuffer,T.indexBuffer,T.segments)}function zg(t,r){let i=!1,n=null,a,o=()=>{n=null,i&&(t(...a),n=setTimeout(o,r),i=!1)};return(...t)=>(i=!0,a=t,n||o(),n)}function zy(t,r){(!t.duration||t.durationMath.abs(t.x)}function zA(t){return t*(2-t)}function zM(t){var r;return(null==(r=t.panDelta)?void 0:r.mag())||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}function zk(t,r,i,n=!1){if(n||!i.getCoveringTilesDetailsProvider().allowWorldCopies())return t?.wrap();let a=new DQ(t.lng,t.lat);if(t=new DQ(t.lng,t.lat),r){let n=new DQ(t.lng-360,t.lat),a=new DQ(t.lng+360,t.lat),o=i.locationToScreenPoint(t).distSqr(r);i.locationToScreenPoint(n).distSqr(r)180;){let r=i.locationToScreenPoint(t);if(r.x>=0&&r.y>=0&&r.x<=i.width&&r.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t.lng!==a.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(t))?t:a}function zS(t,r,i){let n=t.classList;for(let t in jO)n.remove(`maplibregl-${i}-anchor-${t}`);n.add(`maplibregl-${i}-anchor-${r}`)}function zE(t,r,i=[]){let n=zZ.createNS("http://www.w3.org/2000/svg",t);for(let t in r)n.setAttributeNS(null,t,r[t]);for(let t of i)n.appendChild(t);return n}function zD(t,r,i){let n=i?.maxWidth||100,a=t._container.clientHeight/2,o=t._container.clientWidth/2,s=t.unproject([o-n/2,a]),l=t.unproject([o+n/2,a]),u=Math.min(n,Math.round(t.project(l).x-t.project(s).x),t._container.clientWidth),c=s.distanceTo(l);if(i?.unit==="imperial"){let i=3.2808*c;i>5280?zC(r,u,i/5280,t._getUIString("ScaleControl.Miles")):zC(r,u,i,t._getUIString("ScaleControl.Feet"))}else i?.unit==="nautical"?zC(r,u,c/1852,t._getUIString("ScaleControl.NauticalMiles")):c>=1e3?zC(r,u,c/1e3,t._getUIString("ScaleControl.Kilometers")):zC(r,u,c,t._getUIString("ScaleControl.Meters"))}function zC(t,r,i,n){var a,o;let s,l,u,c=(a=i,l=10**(`${Math.floor(a)}`.length-1),u=a/l,l*(u=u>=10?10:u>=5?5:u>=3?3:u>=2?2:u>=1?1:(o=u,s=10**Math.ceil(-Math.log(o)/Math.LN10),Math.round(o*s)/s))),h=c/i;t.style.width=`${r*h}px`,t.innerHTML=`${c} ${n}`}function zI(t,r){return LV().setRTLTextPlugin(t,r)}function zL(){return LV().getRTLTextPluginStatus()}function zP(){return j5}function zz(){return Fx.workerCount}function zF(t){Fx.workerCount=t}function zO(){return MA.MAX_PARALLEL_IMAGE_REQUESTS}function zR(t){MA.MAX_PARALLEL_IMAGE_REQUESTS=t}function zB(){return MA.WORKER_URL}function zj(t){MA.WORKER_URL=t}function zN(t){return _(this,null,function*(){yield LC().broadcast("IS",t)})}var zV,zU,zq,zG,zH,z$,zW,zY,zZ,zX,zK,zJ,zQ,z0,z1,z2,z3,z5,z4,z6,z8,z7,z9,Fe,Ft,Fr,Fi,Fn,Fa,Fo,Fs,Fl,Fu,Fc,Fh,Fd,Ff,Fp,Fm,Fg,Fy,Fv,Fx,Fb,F_,Fw,FT,FA,FM,Fk,FS,FE,FD,FC,FI,FL,FP,Fz,FF,FO,FR,FB,Fj,FN,FV,FU,Fq,FG,FH,F$,FW,FY,FZ,FX,FK,FJ,FQ,F0,F1,F2,F3,F5,F4,F6,F8,F7,F9,Oe,Ot,Or,Oi,On,Oa,Oo,Os,Ol,Ou,Oc,Oh,Od,Of,Op,Om,Og,Oy,Ov,Ox,Ob,O_,Ow,OT,OA,OM,Ok,OS,OE,OD,OC,OI,OL,OP,Oz,OF,OO,OR,OB,Oj,ON,OV,OU,Oq,OG,OH,O$,OW,OY,OZ,OX,OK,OJ,OQ,O0,O1,O2,O3,O5,O4,O6,O8,O7,O9,Re,Rt,Rr,Ri,Rn,Ra,Ro,Rs,Rl,Ru,Rc,Rh,Rd,Rf,Rp,Rm,Rg,Ry,Rv,Rx,Rb,R_,Rw,RT,RA,RM,Rk,RS,RE,RD,RC,RI,RL,RP,Rz,RF,RO,RR,RB,Rj,RN,RV,RU,Rq,RG,RH,R$,RW,RY,RZ,RX,RK,RJ,RQ,R0,R1,R2,R3,R5,R4,R6,R8,R7,R9,Be,Bt,Br,Bi,Bn,Ba,Bo,Bs,Bl,Bu,Bc,Bh,Bd,Bf,Bp,Bm,Bg,By,Bv,Bx,Bb,B_,Bw,BT,BA,BM,Bk,BS,BE,BD,BC,BI,BL,BP,Bz,BF,BO,BR,BB,Bj,BN,BV,BU,Bq,BG,BH,B$,BW,BY,BZ,BX,BK,BJ,BQ,B0,B1,B2,B3,B5,B4,B6,B8,B7,B9,je,jt,jr,ji,jn,ja,jo,js,jl,ju,jc,jh,jd,jf,jp,jm,jg,jy,jv,jx,jb,j_,jw,jT,jA,jM,jk,jS,jE,jD,jC,jI,jL,jP,jz,jF,jO,jR,jB,jj,jN,jV,jU,jq,jG,jH,j$,jW,jY,jZ,jX,jK,jJ,jQ,j0,j1,j2,j3,j5,j4=m({"node_modules/maplibre-gl/dist/maplibre-gl.mjs"(){var t;let r,i,n,a,o,s,l;Lo(),zV={},zH={frame(t,r,i,n){let a=n||window,o=a.requestAnimationFrame(t=>{s(),r(t)}),{unsubscribe:s}=xy(t.signal,"abort",()=>{s(),a.cancelAnimationFrame(o),i(new MT(t.signal.reason))},!1)},frameAsync(t,r){return new Promise((i,n)=>{this.frame(t,i,n,r)})},getImageData(t,r=0){return this.getImageCanvasContext(t).getImageData(-r,-r,t.width+2*r,t.height+2*r)},getImageCanvasContext(t){let r;if(vc()&&!vh())r=new OffscreenCanvas(t.width,t.height).getContext("2d",{willReadFrequently:!0});else{let i=window.document.createElement("canvas");i.width=t.width,i.height=t.height,r=i.getContext("2d",{willReadFrequently:!0})}if(!r)throw Error("failed to create canvas 2d context");return r.drawImage(t,0,0,t.width,t.height),r},resolveURL:t=>(zU||(zU=document.createElement("a")),zU.href=t,zU.href),get hardwareConcurrency(){return"u">typeof navigator&&navigator.hardwareConcurrency||4},get prefersReducedMotion(){return void 0===zG?!!matchMedia&&(zq??(zq=matchMedia("(prefers-reduced-motion: reduce)")),zq.matches):zG},set prefersReducedMotion(e){zG=e}},z$=new class{constructor(){this._frozenAt=null}getCurrentTime(){return null===this._frozenAt?performance.now():this._frozenAt}setNow(t){this._frozenAt=t}restoreNow(){this._frozenAt=null}isFrozen(){return null!==this._frozenAt}},(zY=class{static create(t,r,i){let n=window.document.createElement(t);return void 0!==r&&(n.className=r),i&&i.appendChild(n),n}static createNS(t,r){return window.document.createElementNS(t,r)}static disableDrag(){zY.docStyle&&zY.selectProp&&(zY.userSelect=zY.docStyle[zY.selectProp],zY.docStyle[zY.selectProp]="none")}static enableDrag(){zY.docStyle&&zY.selectProp&&(zY.docStyle[zY.selectProp]=zY.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",zY.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",zY.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",zY.suppressClickInternal,!0)},0)}static getScale(t){let r=t.getBoundingClientRect();return{x:r.width/t.offsetWidth||1,y:r.height/t.offsetHeight||1,boundingClientRect:r}}static getPoint(t,r,i){let n=r.boundingClientRect;return new vu((i.clientX-n.left)/r.x-t.clientLeft,(i.clientY-n.top)/r.y-t.clientTop)}static mousePos(t,r){let i=zY.getScale(t);return zY.getPoint(t,i,r)}static touchPos(t,r){let i=[],n=zY.getScale(t);for(let a of r)i.push(zY.getPoint(t,n,a));return i}static sanitize(t){let r=new DOMParser().parseFromString(t,"text/html").body||document.createElement("body");for(let t of r.querySelectorAll("script, iframe"))t.remove();return zY.clean(r),r.innerHTML}static isPossiblyDangerous(t,r){let i=r.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(t)&&(i.includes("javascript:")||i.includes("data:"))||"srcdoc"===t||t.startsWith("on"))return!0}static clean(t){for(let r of t.children)zY.removeAttributes(r),zY.clean(r)}static removeAttributes(t){for(let{name:r,value:i}of Array.from(t.attributes))zY.isPossiblyDangerous(r,i)&&t.removeAttribute(r)}}).docStyle="u">typeof window&&(null==(zW=window.document)?void 0:zW.documentElement.style),zY.selectProp=!zY.docStyle||"userSelect"in zY.docStyle?"userSelect":"webkitUserSelect",zZ=zY,(t=zX||(zX={})).resetRequestQueue=()=>{r=[],i=0,n=0,a={}},t.addThrottleControl=t=>{let r=n++;return a[r]=t,r},t.removeThrottleControl=t=>{delete a[t],s()},t.transformAndGetImage=function(t,r,i,n,a=!0,o){return _(this,null,function*(){let s=yield t.transformRequest(r,i);return xA(n.signal),zX.getImage(s,n,a,o)})},t.getImage=(t,i,n=!0,a)=>new Promise((o,l)=>{t.headers||(t.headers={}),t.headers.accept="image/webp,*/*",xn(t,{type:"image"}),r.push({abortController:i,requestParameters:t,supportImageRefresh:n,imageBitmapOptions:a,state:"queued",onError:t=>{l(t)},onSuccess:t=>{o(t)}}),s()}),o=t=>_(null,null,function*(){t.state="running";let{requestParameters:r,supportImageRefresh:n,imageBitmapOptions:a,onError:o,onSuccess:u,abortController:c}=t,h=!1===n&&!a&&!xm(self)&&!xM(r.url)&&(!r.headers||Object.keys(r.headers).reduce((t,r)=>t&&"accept"===r,!0));i++;let d=h?l(r,c):MS(r,c);try{let r,i=yield d;delete t.abortController,t.state="completed",i.data instanceof HTMLImageElement||xg(i.data)?u(i):u(i.data&&0!==i.data.byteLength?{data:yield(r=i.data,"function"==typeof createImageBitmap?Mv(r,a):Mx(r)),cacheControl:i.cacheControl,expires:i.expires}:{data:null,cacheControl:i.cacheControl,expires:i.expires})}catch(r){delete t.abortController,o(vJ(r))}finally{i--,s()}}),s=()=>{let t=(()=>{for(let t of Object.keys(a))if(a[t]())return!0;return!1})()?MA.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:MA.MAX_PARALLEL_IMAGE_REQUESTS;for(let n=i;n0;n++){let t=r.shift();if(t.abortController.signal.aborted){n--;continue}o(t)}},l=(t,r)=>new Promise((i,n)=>{let a=new Image,o=t.url,s=t.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!xD(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",()=>{a.src="",n(new MT(r.signal.reason))}),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,i({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||n(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."))},a.src=o}),zX.resetRequestQueue(),zK=class{constructor(t){this._transformRequestFn=t??null}transformRequest(t,r){return this._transformRequestFn&&this._transformRequestFn(t,r)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}},zJ=class extends MI{},zQ=class extends zJ{},z0=class extends zJ{constructor(t={}){super("style.load",t)}},z1=class extends zJ{constructor(t,r={}){super(t,r),this.dataType="style"}},z2=class extends zJ{constructor(t,r={}){super(t,r),this.dataType="source"}},z3=class extends zJ{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,i,n={}){i=i instanceof MouseEvent?i:new MouseEvent(t,i);let a=zZ.mousePos(r.getCanvas(),i),o=r.unproject(a);super(t,xn({point:a,lngLat:o,originalEvent:i},n)),this._defaultPrevented=!1,this.target=r}},z5=class extends zJ{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r,i){let n="touchend"===t?i.changedTouches:i.touches,a=zZ.touchPos(r.getCanvasContainer(),n),o=a.map(t=>r.unproject(t)),s=a.reduce((t,r,i,n)=>t.add(r.div(n.length)),new vu(0,0)),l=r.unproject(s);super(t,{points:a,point:s,lngLats:o,lngLat:l,originalEvent:i}),this._defaultPrevented=!1}},z4=class extends zJ{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,r){super("wheel",{originalEvent:r}),this._defaultPrevented=!1}},z6=class extends zJ{},z8=class extends zJ{constructor(t={}){super("terrain",t)}},z7=class extends zJ{constructor(t={}){super("projectiontransition",t)}},z9=class extends zJ{},Fe=class extends zJ{constructor(t={}){super("styleimagemissing",t)}},Ft=class extends MP{constructor(){super(),this.images={},this.updateVersion=0,this.loaded=!1,this.requestors=[],this.missingImageResolver=null,this._spriteImagesIds={},this._imagesIds=null,this._renderCallbacksDispatchedThisFrame={}}destroy(){for(let t of Object.keys(this.images))this.removeImage(t);this._spriteImagesIds={}}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:t,promiseResolve:r}of this.requestors)r(this._getImagesForIds(t));this.requestors=[]}}getImage(t){let r=this.images[t];if(r&&!r.data&&r.spriteData){let t=r.spriteData;r.data=new Dn({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),r.spriteData=null}return r}addImage(t,r){if(this.images[t])throw Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,r)&&(this.images[t]=r,this._imagesIds=null,r.isWebGLImage&&this.updateImage(t,r,!1))}_validate(t,r){let i=!0,n=r.data||r.spriteData;return this._validateStretch(r.stretchX,n?.width)||(this.fire(new ML(Error(`Image "${t}" has invalid "stretchX" value`))),i=!1),this._validateStretch(r.stretchY,n?.height)||(this.fire(new ML(Error(`Image "${t}" has invalid "stretchY" value`))),i=!1),this._validateContent(r.content,r)||(this.fire(new ML(Error(`Image "${t}" has invalid "content" value`))),i=!1),i}_validateStretch(t,r){if(!t)return!0;let i=0;for(let n of t){if(n[0]=t[1]}updateImage(t,r,i=!0){var n;let a=this.images[t];if(i){let t=a.data||a.spriteData;if(t.width!==r.data.width||t.height!==r.data.height)throw Error(`size mismatch between old image (${t.width}x${t.height}) and new image (${r.data.width}x${r.data.height}).`)}r.version=(null!=(n=a.version)?n:0)+1,this.images[t]=r,this.updateVersion++}removeImage(t){var r;let i=this.images[t];i&&(delete this.images[t],this._imagesIds=null,null!=(r=i.userImage)&&r.onRemove&&i.userImage.onRemove())}listImages(){return null!=this._imagesIds||(this._imagesIds=Object.keys(this.images)),this._imagesIds}_getSpriteImageId(t,r){return"default"===t?r:`${t}:${r}`}setSpriteImages(t,r){var i;let n=null!=(i=this._spriteImagesIds[t])?i:[],a=[];for(let i in r){let n=this._getSpriteImageId(t,i);a.push(n),n in this.images?this.updateImage(n,r[i],!1):this.addImage(n,r[i])}let o=new Set(a),s=n.filter(t=>!o.has(t));for(let t of s)this.removeImage(t);return this._spriteImagesIds[t]=a,{loaded:a,removed:s}}removeSpriteImages(t){var r;let i=null!=(r=this._spriteImagesIds[t])?r:[];for(let t of i)this.removeImage(t);return delete this._spriteImagesIds[t],i}removeAllSpriteImages(){let t=Object.values(this._spriteImagesIds).flat();for(let r of t)this.removeImage(r);return this._spriteImagesIds={},t}setMissingImageResolver(t){this.missingImageResolver=t}getImages(t){return new Promise((r,i)=>{let n=!0;if(!this.isLoaded())for(let r of t)this.images[r]||(n=!1);this.isLoaded()||n?r(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:r})})}_getImagesForIds(t){return _(this,null,function*(){var r;let i=new Set(t.filter(t=>!this.getImage(t))),n=this.missingImageResolver;n&&(yield Promise.allSettled(Array.from(i,t=>n(t))));let a={};for(let n of t){let t=this.getImage(n);t&&(i.delete(n),a[n]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:!!(null!=(r=t.userImage)&&r.render),isWebGLImage:t.isWebGLImage})}for(let t of i)this.fire(new Fe({id:t})),xf(`Image "${t}" could not be loaded. Please make sure you have added the image before it is needed with map.addImage(), resolved it with map.setMissingStyleImageResolver(), or included it in a "sprite" property in your style.`);return a})}beginFrame(){this._renderCallbacksDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let r of t){if(this._renderCallbacksDispatchedThisFrame[r])continue;this._renderCallbacksDispatchedThisFrame[r]=!0;let t=this.getImage(r);t||xf(`Image with ID: "${r}" was not found`),function(t){let{userImage:r}=t;return!!r?.render&&!!r.render()&&(TP(r.data)||t.data.replace(new Uint8Array(r.data.buffer)),!0)}(t)&&this.updateImage(r,t)}}cloneImages(){let t={};for(let r in this.images){let i=this.images[r];t[r]=p(f({},i),{data:i.data?i.data.clone():null})}return t}},Fr=class{constructor(t){this._imageManager=t,this._entries={},this._image=new Dn({width:1,height:1}),this._dirty=!0}destroy(){this._texture&&(this._texture=(this._texture.destroy(),null)),this._entries={},this._image=new Dn({width:1,height:1}),this._dirty=!0}getPixelSize(){let{width:t,height:r}=this._image;return{width:t,height:r}}getPattern(t){let r=this._imageManager.getImage(t);if(!r)return null;let i=this._entries[t];if(i?.image!==r){let i={w:r.data.width+2,h:r.data.height+2,x:0,y:0};this._entries[t]={bin:i,position:new CR(i,r),image:r}}else{if(i.position.version===r.version)return i.position;i.position.version=r.version}return this._update(),this._entries[t].position}bind(t){let r=t.gl;this._texture?this._dirty&&(this._dirty=(this._texture.update(this._image),!1)):(this._texture=new Dp(t,this._image,r.RGBA),this._dirty=!1),this._texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}_update(){for(let t in this._entries)this._imageManager.getImage(t)||delete this._entries[t];let t=[];for(let r in this._entries)t.push(this._entries[r].bin);let{w:r,h:i}=Tz(t),n=this._image;for(let t in n.resize({width:r||1,height:i||1}),this._entries){let{bin:r}=this._entries[t],i=r.x+1,a=r.y+1,o=this._entries[t].image.data,s=o.width,l=o.height;Dn.copy(o,n,{x:0,y:0},{x:i,y:a},{width:s,height:l}),Dn.copy(o,n,{x:0,y:l-1},{x:i,y:a-1},{width:s,height:1}),Dn.copy(o,n,{x:0,y:0},{x:i,y:a+l},{width:s,height:1}),Dn.copy(o,n,{x:s-1,y:0},{x:i-1,y:a},{width:1,height:l}),Dn.copy(o,n,{x:0,y:0},{x:i+s,y:a},{width:1,height:l})}this._dirty=!0}},Fn={start:0,end:Fi=1114111},Fa=0,Fo=class{constructor(t){this.requestManager=t,this._faces={},this._registered=new Set}setFontFaces(t){for(let[r,i]of(this._unregisterAll(),this._faces={},Object.entries(t??{}))){let t=Array.isArray(i)?i:[i];this._faces[r]=t.map(t=>this._declareFontFace(r,t)).filter(t=>null!==t)}}hasFontFaces(){return Object.keys(this._faces).length>0}getFontFamily(t,r){return _(this,null,function*(){var i;for(let n of t.split(","))for(let t of null!=(i=this._faces[n.trim()])?i:[])if(function(t,r){return t.ranges.some(({start:t,end:i})=>r>=t&&r<=i)}(t,r)&&(null!=t.loaded||(t.loaded=this._loadFontFace(t)),yield t.loaded))return t.family;return null})}_declareFontFace(t,r){let i="string"==typeof r?{url:r}:r;if("string"!=typeof i?.url)return xf(`Ignoring the font face declared for "${t}": it has no URL.`),null;let n=`maplibre-gl-font-face-${Fa++}`,a=i["unicode-range"];if(!a?.length)return{url:i.url,ranges:[Fn],family:n};let o=[];for(let t of a){let r=function(t){let r=/^u\+([0-9a-f]*)(\?+)$/i.exec(t);if(r){let[,t,i]=r;return t.length+i.length>6?null:LT(parseInt(`${t}${"0".repeat(i.length)}`,16),parseInt(`${t}${"f".repeat(i.length)}`,16))}let i=/^u\+([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?$/i.exec(t);if(!i)return null;let n=parseInt(i[1],16);return LT(n,void 0===i[2]?n:parseInt(i[2],16))}(t);if(!r){xf(`Ignoring the unicode range "${t}" of the font face at ${i.url}: it is not a valid range.`);continue}o.push(r)}return o.length?{url:i.url,ranges:o,family:n}:null}_loadFontFace(t){return _(this,null,function*(){let r;if(typeof FontFace>"u"||typeof document>"u"||!document.fonts)return xf(`Ignoring the font face at ${t.url}: this environment has no CSS Font Loading API.`),!1;try{return r=new FontFace(t.family,(yield this._downloadFontFile(t.url))),!!Object.values(this._faces).some(r=>r.includes(t))&&(document.fonts.add(r),this._registered.add(r),yield r.load(),!0)}catch(i){return r&&this._unregister(r),xf(`Ignoring the font face at ${t.url}: ${vJ(i).message}`),!1}})}_downloadFontFile(t){return _(this,null,function*(){let r=yield this.requestManager.transformRequest(t,"Glyphs"),i=yield MD(r,new AbortController);if(!i?.data)throw Error(`the response was empty for the font file at ${t}`);return i.data})}_unregister(t){var r;null==(r=document.fonts)||r.delete(t),this._registered.delete(t)}_unregisterAll(){var t;for(let r of this._registered)null==(t=document.fonts)||t.delete(r);this._registered.clear()}destroy(){this._unregisterAll(),this._faces={}}},Fs=1e20,Fl=new Float64Array(256);for(let t=0;t<256;t++){let r=.5-(t/255)**.45454545454545453;Fl[t]=r*Math.abs(r)}Fl[255]=-1e20,Fu=class{constructor({fontSize:t=24,buffer:r=3,radius:i=8,cutoff:n=.25,fontFamily:a="sans-serif",fontWeight:o="normal",fontStyle:s="normal",lang:l=null}={}){this.buffer=r,this.radius=i,this.cutoff=n,this.lang=l;let u=this.size=t+4*r,c=this._createCanvas(u),h=this.ctx=c.getContext("2d",{willReadFrequently:!0});h.font=`${s} ${o} ${t}px ${a}`,h.textBaseline="alphabetic",h.textAlign="left",h.fillStyle="black",this.gridOuter=new Float64Array(u*u),this.gridInner=new Float64Array(u*u),this.f=new Float64Array(u),this.z=new Float64Array(u+1),this.v=new Uint16Array(u)}_createCanvas(t){if("u">typeof OffscreenCanvas)return new OffscreenCanvas(t,t);let r=document.createElement("canvas");return r.width=r.height=t,r}draw(t){let{width:r,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:o}=this.ctx.measureText(t),s=Math.ceil(i),l=Math.floor(-a),u=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o)-l)),c=Math.max(0,Math.min(this.size-this.buffer,s+Math.ceil(n))),h=u+2*this.buffer,d=c+2*this.buffer,f=Math.max(h*d,0),p=new Uint8ClampedArray(f),m={data:p,width:h,height:d,glyphWidth:u,glyphHeight:c,glyphTop:s,glyphLeft:l,glyphAdvance:r};if(0===u||0===c)return m;let{ctx:g,buffer:y,gridInner:v,gridOuter:x}=this;this.lang&&(g.lang=this.lang),g.clearRect(y,y,u,c),g.fillText(t,y-l,y+s);let b=g.getImageData(y,y,u,c);x.fill(Fs,0,f),v.fill(0,0,f);let _=3;for(let t=0;t{let i=new Fu(t);return i.buffer=r,i},Fd=class{constructor(t,r,i,n=Fh){this.requestManager=t,this.localIdeographFontFamily=r,this.entries={},this.lang=i,this.fontFaceManager=new Fo(t),this.createRasterizer=n}setURL(t){this.url=t}setFontFaces(t){this.fontFaceManager.setFontFaces(t),this.entries={}}getGlyphs(t){return _(this,null,function*(){let r=[];for(let i in t)for(let n of t[i])r.push(this._getAndCacheGlyphsPromise(i,n));let i=yield Promise.all(r),n={};for(let{stack:t,id:r,glyph:a}of i)n[t]||(n[t]={}),n[t][r]=a&&{id:a.id,bitmap:a.bitmap.clone(),metrics:a.metrics};return n})}_getAndCacheGlyphsPromise(t,r){return _(this,null,function*(){var i;null!=(i=this.entries)[t]||(i[t]={glyphs:{},requests:{},ranges:{}});let n=this.entries[t],a=n.glyphs[r];if(void 0!==a)return{stack:t,id:r,glyph:a};let o=r.codePointAt(0),s=this.fontFaceManager.hasFontFaces()?yield this.fontFaceManager.getFontFamily(t,o):null;return s?(a=n.glyphs[r]=yield this._drawGlyph(n,t,r,s),{stack:t,id:r,glyph:a}):!this.url||Tv(r)||this._charUsesLocalIdeographFontFamily(o)?(a=n.glyphs[r]=yield this._drawGlyph(n,t,r),{stack:t,id:r,glyph:a}):yield this._downloadAndCacheRangePromise(t,r)})}_downloadAndCacheRangePromise(t,r){return _(this,null,function*(){var i;let n=r.codePointAt(0),a=this.entries[t],o=Math.floor(n/256);if(a.ranges[o])return{stack:t,id:r,glyph:null};(i=a.requests)[o]||(i[o]=this._loadGlyphRange(t,o));try{let i=yield a.requests[o];for(let t in i)a.glyphs[String.fromCodePoint(+t)]=i[+t];return a.ranges[o]=!0,{stack:t,id:r,glyph:i[n]||null}}catch(s){let i=a.glyphs[r]=yield this._drawGlyph(a,t,r);return this._warnOnMissingGlyphRange(i,o,n,vJ(s)),{stack:t,id:r,glyph:i}}})}_loadGlyphRange(t,r){return _(this,null,function*(){var i;let n=256*r,a=n+255,o=yield this.requestManager.transformRequest(this.url.replace("{fontstack}",t).replace("{range}",`${n}-${a}`),"Glyphs"),s=yield MD(o,new AbortController);if(!s?.data)throw Error(`Could not load glyph range. range: ${r}, ${n}-${a}`);let l={};for(let t of(i=s.data,new CO(i).readFields(TC,[])))l[t.id]=t;return l})}_warnOnMissingGlyphRange(t,r,i,n){let a=256*r,o=i.toString(16).padStart(4,"0").toUpperCase();xf(`Unable to load glyph range ${r}, ${a}-${a+255}. Rendering codepoint U+${o} locally instead. ${n}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))}_drawGlyph(t,r,i,n){return _(this,null,function*(){let a=(yield this._getTinySDF(t,r,i,n)).draw(i),o=RegExp("^\\p{gc=Cf}+$","u").test(i);return{id:i.codePointAt(0),bitmap:new Di({width:a.width||60,height:a.height||60},a.data),metrics:{width:o?0:a.glyphWidth/2||24,height:a.glyphHeight/2||24,left:a.glyphLeft/2+.5||0,top:a.glyphTop/2-27.5||-8,advance:o?0:a.glyphAdvance/2||24,isDoubleResolution:!0}}})}_getTinySDF(t,r,i,n){var a,o;let s=Tv(i);if(n){let r=s?"clusterTinySDFs":"fontFaceTinySDFs";return null!=t[r]||(t[r]={}),(a=t[r])[n]||(a[n]=this._createTinySDF(n,!1,s?3:1)),t[r][n]}let l=r===Fc&&""!==this.localIdeographFontFamily&&this._charUsesLocalIdeographFontFamily(i.codePointAt(0)),u=l?this.localIdeographFontFamily:r;if(s)return null!=t.clusterTinySDFs||(t.clusterTinySDFs={}),(o=t.clusterTinySDFs)[u]||(o[u]=this._createTinySDF(u,!0,3)),t.clusterTinySDFs[u];let c=l?"ideographTinySDF":"tinySDF";return t[c]||(t[c]=this._createTinySDF(u)),t[c]}_createTinySDF(t,r=!0,i=1){return _(this,null,function*(){var n;let a=t?t.split(","):[];a.push("sans-serif");let o=a.map(t=>/[-\w]+/.test(t)?t:`'${CSS.escape(t)}'`).join(","),s=r?this._fontWeight(a[0]):void 0,l=r?this._fontStyle(a[0]):"normal";if("u">typeof document&&null!=(n=document.fonts)&&n.load)try{yield document.fonts.load(`${l} ${s||"normal"} 48px ${o}`)}catch(t){xf(`Failed to load font "${o}": ${vJ(t).message}`)}return this.createRasterizer({fontSize:48,buffer:Math.max(6,Math.ceil(48*(i-1)/4)),radius:16,cutoff:.25,fontFamily:o,fontWeight:s,fontStyle:l,lang:this.lang},6)})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){let r;for(let[i,n]of Object.entries({thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950}))RegExp(`\\b${i}\\b`,"i").test(t)&&(r=`${n}`);return r}destroy(){for(let t in this.entries){let r=this.entries[t];r.tinySDF=null,r.ideographTinySDF=null,r.fontFaceTinySDFs={},r.glyphs={},r.requests={},r.ranges={}}this.entries={},this.fontFaceManager.destroy()}},Fp=class extends MP{constructor(t,r){super(),this._transitionable=new Sp(Ff||(Ff=new SM({anchor:new Sb(MF.light.anchor,"anchor"),position:new Sb(MF.light.position,"position"),color:new Sb(MF.light.color,"color"),intensity:new Sb(MF.light.intensity,"intensity")})),"light",r),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}getCartesianPosition(){return function([t,r,i]){return r+=90,[t*Math.cos(r*=Math.PI/180)*Math.sin(i*=Math.PI/180),t*Math.sin(r)*Math.sin(i),t*Math.cos(i)]}(this.properties.get("position"))}setLight(t,r={}){if(!this._validate(Sa.light,t,r))for(let r in t){let i=t[r];r.endsWith("-transition")?this._transitionable.setTransition(r.slice(0,-Sh.length),i):this._transitionable.setValue(r,i)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,r,i){return _5(this,t,{value:r},i)}},Fg=class extends MP{constructor(t,r){super(),this._transitionable=new Sp(Fm||(Fm=new SM({"sky-color":new Sb(MF.sky["sky-color"],"sky-color"),"horizon-color":new Sb(MF.sky["horizon-color"],"horizon-color"),"fog-color":new Sb(MF.sky["fog-color"],"fog-color"),"fog-ground-blend":new Sb(MF.sky["fog-ground-blend"],"fog-ground-blend"),"horizon-fog-blend":new Sb(MF.sky["horizon-fog-blend"],"horizon-fog-blend"),"sky-horizon-blend":new Sb(MF.sky["sky-horizon-blend"],"sky-horizon-blend"),"atmosphere-blend":new Sb(MF.sky["atmosphere-blend"],"atmosphere-blend")})),"sky",r),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new Sc(0))}setSky(t,r={}){if(!this._validate(Sa.sky,t,r))for(let r in t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0}),t){let i=t[r];r.endsWith("-transition")?this._transitionable.setTransition(r.slice(0,-Sh.length),i):this._transitionable.setValue(r,i)}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,r,i={}){return _5(this,t,{value:r},i)}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}},Fy=class{constructor(t,r){this.width=t,this.height=r,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,r){var i;let n=t.join(",")+String(r);return(i=this.dashEntry)[n]||(i[n]=this.addDash(t,r)),this.dashEntry[n]}getDashRanges(t,r,i){let n=t.length%2==1,a=[],o=n?-t[t.length-1]*i:0,s=t[0]*i,l=!0;a.push({left:o,right:s,isDash:l,zeroLength:0===t[0]});let u=t[0];for(let r=1;r1&&(l=t[++s]);let u=Math.min(Math.abs(a-l.left),Math.abs(a-l.right)),c,h=r/i*(n+1);if(l.isDash){let t=n-Math.abs(h);c=Math.sqrt(u*u+t*t)}else c=n-Math.sqrt(u*u+h*h);this.data[o+a]=Math.max(0,Math.min(255,c+128))}}}addRegularDash(t){for(let r=t.length-1;r>=0;--r){let i=t[r],n=t[r+1];i.zeroLength?t.splice(r,1):n?.isDash===i.isDash&&(n.left=i.left,t.splice(r,1))}let r=t[0],i=t[t.length-1];r.isDash===i.isDash&&(r.left=i.left-this.width,i.right=r.right+this.width);let n=this.width*this.nextRow,a=0,o=t[0];for(let r=0;r1&&(o=t[++a]);let i=Math.min(Math.abs(r-o.left),Math.abs(r-o.right)),s=o.isDash?i:-i;this.data[n+r]=Math.max(0,Math.min(255,s+128))}}addDash(t,r){let i=7*!!r,n=2*i+1;if(this.nextRow+n>this.height)return xf("LineAtlas out of space"),null;let a=0;for(let r of t)a+=r;if(0!==a){let n=this.width/a,o=this.getDashRanges(t,this.width,n);r?this.addRoundDash(o,n,i):this.addRegularDash(o)}let o={y:this.nextRow+i,height:2*i,width:a};return this.nextRow+=n,this.dirty=!0,o}bind(t){let r=t.gl;this.texture?(r.bindTexture(r.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,r.texSubImage2D(r.TEXTURE_2D,0,0,0,this.width,this.height,r.ALPHA,r.UNSIGNED_BYTE,this.data))):(this.texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.REPEAT),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.ALPHA,this.width,this.height,0,r.ALPHA,r.UNSIGNED_BYTE,this.data))}},Fv="maplibre_preloaded_worker_pool",Fx=class t{constructor(){this.active={},this.workersPromise=null}acquire(r){return _(this,null,function*(){if(this.active[r]=!0,!this.workersPromise){let r=[];for(;r.length{for(let r of t)r.terminate()})}}isPreloaded(){return!!this.active[Fv]}numActive(){return Object.keys(this.active).length}},Fb=Math.floor(zH.hardwareConcurrency/2),Fx.workerCount=!function(t){if(null==My){let r=t.navigator?t.navigator.userAgent:null;My=!!t.safari||!!(r&&(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return My}(globalThis)?1:Math.max(Math.min(Fb,3),1),Fw=class{constructor(t,r){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=r,this.removed=!1,this.actorsPromise=this.initActors(r)}initActors(t){return _(this,null,function*(){let r=yield this.workerPool.acquire(t);if(this.removed)return[];if(this.actors=r.map((r,i)=>{let n=new Ir(r,t);return n.name=`Worker ${i}`,n}),!this.actors.length)throw Error("No actors found");return this.actors})}broadcast(t,r){return _(this,null,function*(){return Promise.all((yield this.actorsPromise).map(i=>i.sendAsync({type:t,data:r})))})}getActor(){return _(this,null,function*(){let t=yield this.actorsPromise;return this.currentActor=(this.currentActor+1)%t.length,t[this.currentActor]})}waitForInitComplete(){return _(this,null,function*(){0===this.actors.length&&(yield this.actorsPromise)})}getReadyActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){for(let t of(this.removed=!0,this.actors))t.remove();this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,r){return _(this,null,function*(){for(let i of yield this.actorsPromise)i.registerMessageHandler(t,r)})}unregisterMessageHandler(t){return _(this,null,function*(){for(let r of yield this.actorsPromise)r.unregisterMessageHandler(t)})}},FA=class t{constructor(t,r){t&&(r?this.setSouthWest(t).setNorthEast(r):Array.isArray(t)&&(4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof DQ?new DQ(t.lng,t.lat):DQ.convert(t),this}setSouthWest(t){return this._sw=t instanceof DQ?new DQ(t.lng,t.lat):DQ.convert(t),this}extend(r){let i=this._sw,n=this._ne,a,o;if(r instanceof DQ)a=r,o=r;else if(r instanceof t){if(a=r._sw,o=r._ne,!a||!o)return this}else return Array.isArray(r)?4===r.length||r.every(Array.isArray)?this.extend(t.convert(r)):this.extend(DQ.convert(r)):r&&("lng"in r||"lon"in r)&&"lat"in r?this.extend(DQ.convert(r)):this;return i||n?(i.lng=Math.min(a.lng,i.lng),i.lat=Math.min(a.lat,i.lat),n.lng=Math.max(o.lng,n.lng),n.lat=Math.max(o.lat,n.lat)):(this._sw=new DQ(a.lng,a.lat),this._ne=new DQ(o.lng,o.lat)),this}getCenter(){return new DQ((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 DQ(this.getWest(),this.getNorth())}getSouthEast(){return new DQ(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){let{lng:r,lat:i}=DQ.convert(t),n=this._sw.lat<=i&&i<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),n&&a}intersects(r){if(!((r=t.convert(r)).getNorth()>=this.getSouth()&&r.getSouth()<=this.getNorth()))return!1;let i=Math.abs(this.getEast()-this.getWest()),n=Math.abs(r.getEast()-r.getWest());if(i>=360||n>=360)return!0;let a=xi(this.getWest(),-180,180),o=xi(this.getEast(),-180,180),s=xi(r.getWest(),-180,180),l=xi(r.getEast(),-180,180),u=a>o,c=s>l;return!!u&&!!c||(u?l>=a||s<=o:c?o>=s||a<=l:s<=o&&l>=a)}static convert(r){return r instanceof t||!r?r:new t(r)}static fromLngLat(r,i=0){let n=360*i/0x2637f09,a=n/Math.cos(Math.PI/180*r.lat);return new t(new DQ(r.lng-a,r.lat-n),new DQ(r.lng+a,r.lat+n))}adjustAntiMeridian(){let r=new DQ(this._sw.lng,this._sw.lat),i=new DQ(this._ne.lng,this._ne.lat);return r.lng>i.lng?new t(r,new DQ(i.lng+360,i.lat)):new t(r,i)}},FM=class{constructor(t,r,i){this.bounds=FA.convert(this.validateBounds(t)),this.minzoom=r||0,this.maxzoom=i||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){let r=2**t.z,i={minX:Math.floor(Te(this.bounds.getWest())*r),minY:Math.floor(Tt(this.bounds.getNorth())*r),maxX:Math.ceil(Te(this.bounds.getEast())*r),maxY:Math.ceil(Tt(this.bounds.getSouth())*r)};return t.x>=i.minX&&t.x=i.minY&&t.y{this.tiles=t,this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}serialize(){return xn({},this._options)}loadTile(t){return _(this,null,function*(){let r=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:yield this.map._requestManager.transformRequest(r,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(t),etag:t.etag};i.request.collectResourceTiming=this._collectResourceTiming,yield this.dispatcher.waitForInitComplete();let n="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise((r,i)=>{t.reloadPromise={resolve:r,reject:i}})}else t.actor=this.dispatcher.getReadyActor(),n="LT";t.abortController=new AbortController;try{let r=yield t.actor.sendAsync({type:n,data:i},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,r);let a={};return r?.etagUnmodified&&(a.unmodified=!0),a}catch(r){if(delete t.abortController,t.aborted||xT(r))return;if(r&&404!==r.status)throw r;this._afterTileLoadWorkerResponse(t,null)}})}_getOverzoomParameters(t){return _(this,null,function*(){if(t.tileID.canonical.z<=this.maxzoom||void 0===this.map._zoomLevelsToOverscale)return;let r=t.tileID.scaledTo(this.maxzoom).canonical,i=r.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:r,overzoomRequest:yield this.map._requestManager.transformRequest(i,"Tile")}})}_afterTileLoadWorkerResponse(t,r){if(r?.resourceTiming&&(t.resourceTiming=r.resourceTiming),r&&this.map._refreshExpiredTiles&&t.setExpiryData(r),t.etag=r?.etag,t.loadVectorData(r,this.map.painter),t.reloadPromise){let r=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(r.resolve).catch(r.reject)}}abortTile(t){return _(this,null,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))})}unloadTile(t){return _(this,null,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}},FS=class extends MP{constructor(t,r,i,n){super(),this.id=t,this.dispatcher=i,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._premultiplyAlpha=!0,this._options=xn({type:"raster"},r),xn(this,xa(r,["url","scheme","tileSize"]))}load(t=!1){return _(this,null,function*(){this._loaded=!1,this.fire(new z2("dataloading")),this._tileJSONRequest=new AbortController;try{let r=yield LP(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,r&&(xn(this,r),r.bounds&&(this.tileBounds=new FM(r.bounds,this.minzoom,this.maxzoom)),this.fire(new z2("data",{sourceDataType:"metadata"})),this.fire(new z2("data",{sourceDataType:"content",sourceDataChanged:t})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,xT(t)||this.fire(new ML(vJ(t)))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null))}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest=(this._tileJSONRequest.abort(),null)),t(),this.load(!0)}setTiles(t){return this.setSourceProperty(()=>{this.tiles=t,this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return xn({},this._options)}setPremultiplyAlpha(t){return this._premultiplyAlpha===t||this.setSourceProperty(()=>{this._premultiplyAlpha=t}),this}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return _(this,null,function*(){var r;let i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this._premultiplyAlpha,a=n?void 0:{premultiplyAlpha:"none"};t.abortController=new AbortController;try{let o=yield zX.transformAndGetImage(this.map._requestManager,i,"Tile",t.abortController,this.map._refreshExpiredTiles,a);if(delete t.abortController,t.aborted){t.state="unloaded";return}if(o){this.map._refreshExpiredTiles&&(o.cacheControl||o.expires)&&t.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});let i=this.map.painter.context,a=i.gl,s=null!=(r=o.data)?r:new Dn({width:1,height:1},new Uint8Array(4));t.texture=this.map.painter.getTileTexture(s.width),t.texture?t.texture.update(s,{useMipmap:!0,premultiply:n}):(t.texture=new Dp(i,s,a.RGBA,{useMipmap:!0,premultiply:n}),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(r){if(delete t.abortController,t.aborted)t.state="unloaded";else if(r)throw t.state="errored",r}})}abortTile(t){return _(this,null,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return _(this,null,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}},FE=class extends FS{constructor(t,r,i,n){super(t,r,i,n),this.type="raster-dem",this.maxzoom=22,this._options=xn({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(t){return _(this,null,function*(){let r=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{let i=yield zX.transformAndGetImage(this.map._requestManager,r,"Tile",t.abortController,this.map._refreshExpiredTiles,{colorSpaceConversion:"none"});if(delete t.abortController,t.aborted){t.state="unloaded";return}if(i){if(this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires}),!i.data){t.state="loaded";return}let r=i.data,n=xg(r)&&vc()?r:yield this.readImageNow(r),a={type:this.type,uid:t.uid,source:this.id,rawImageData:n,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(t.actor&&"expired"!==t.state&&"reloading"!==t.state)return;yield this.dispatcher.waitForInitComplete(),t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getReadyActor()),t.dem=yield t.actor.sendAsync({type:"LDT",data:a}),t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.needsColorReliefPrepare=!0,t.state="loaded"}}catch(r){if(delete t.abortController,t.aborted)t.state="unloaded";else if(r)throw t.state="errored",r}})}readImageNow(t){return _(this,null,function*(){if("u">typeof VideoFrame&&vh()){let r=t.width+4,i=t.height+4;try{return new Dn({width:r,height:i},(yield function(t,r,i){return _(this,null,function*(){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let n=new VideoFrame(t,{timestamp:0});try{let a,o=n?.format;if(!o||!(o.startsWith("BGR")||o.startsWith("RGB")))throw Error(`Unrecognized format ${o}`);let s=o.startsWith("BGR"),l=new Uint8ClampedArray(r*i*4);if(yield n.copyTo(l,(a=2*r*4+8,{rect:{x:0,y:0,width:Math.min(t.width,-2+r)-0,height:Math.min(t.height,-2+i)-0},layout:[{offset:a,stride:4*r}]})),s)for(let t=0;t0&&(l[new Ia(t.overscaledZ,a,r.z,n,r.y-1).key]={backfilled:!1},l[new Ia(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new Ia(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1!i.has(t.key))}return(t.removeAllProperties||r.removeAllProperties)&&(i.removeAllProperties=!0),(t.removeProperties||r.removeProperties)&&(i.removeProperties=[...t.removeProperties||[],...r.removeProperties||[]]),(t.addOrUpdateProperties||r.addOrUpdateProperties)&&(i.addOrUpdateProperties=[...t.addOrUpdateProperties||[],...r.addOrUpdateProperties||[]]),(t.newGeometry||r.newGeometry)&&(i.newGeometry=r.newGeometry||t.newGeometry),i}(i,r)),s.update.delete(t))}let u={};if((n.removeAll||a.removeAll)&&(u.removeAll=!0),u.remove=new Set([...n.remove,...a.remove]),u.add=new Map([...n.add,...a.add]),u.update=new Map([...n.update,...a.update]),u.remove.size&&u.add.size)for(let t of u.add.keys())u.remove.delete(t);return i={},(o=u).removeAll&&(i.removeAll=o.removeAll),o.remove&&(i.remove=Array.from(o.remove)),o.add&&(i.add=Array.from(o.add.values())),o.update&&(i.update=Array.from(o.update.values())),i}(this._pendingWorkerUpdate.diff,t),this._updateWorkerData()}getData(){return _(this,null,function*(){return this._data.url&&(yield this.once("data")),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}})}getBounds(){return _(this,null,function*(){return LR((yield this.getData()))})}setClusterOptions(t){return this.workerOptions.geojsonVtOptions.cluster=t.cluster,void 0!==t.clusterRadius&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),void 0!==t.clusterMaxZoom&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData()}getClusterOptions(){let{cluster:t,clusterOptions:r}=this.workerOptions.geojsonVtOptions;return{cluster:t,clusterMaxZoom:r.maxZoom,clusterRadius:this._tileUnitsToPixels(r.radius)}}getClusterExpansionZoom(t){return _(this,null,function*(){return(yield this.actorPromise).sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})})}getClusterChildren(t){return _(this,null,function*(){return(yield this.actorPromise).sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})})}getClusterLeaves(t,r,i){return _(this,null,function*(){return(yield this.actorPromise).sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:r,offset:i}})})}_updateWorkerData(){return _(this,null,function*(){if(this._isUpdatingWorker)return this._updatePromise;if(!this._hasPendingWorkerUpdate())return void xf(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:t,diff:r,updateCluster:i}=this._pendingWorkerUpdate,n=this._getLoadGeoJSONParameters(t,r,i);void 0===t?r?this._pendingWorkerUpdate.diff=void 0:i&&(this._pendingWorkerUpdate.updateCluster=void 0):this._pendingWorkerUpdate.data=void 0,this._updatePromise=this._dispatchWorkerUpdate(n),yield this._updatePromise})}_getLoadGeoJSONParameters(t,r,i){return _(this,null,function*(){let n=xn({type:this.type,source:this.id},this.workerOptions);return"string"==typeof t?(n.request=yield this.map._requestManager.transformRequest(zH.resolveURL(t),"Source"),n.request.collectResourceTiming=this._collectResourceTiming,n):void 0!==t?(n.data=t,n):r?(n.dataDiff=r,n):i?(n.updateCluster=!0,n):void 0})}_dispatchWorkerUpdate(t){return _(this,null,function*(){this._isUpdatingWorker=!0,this.fire(new z2("dataloading"));try{let r=yield t,i=yield(yield this.actorPromise).sendAsync({type:"LD",data:r});if(this._isUpdatingWorker=!1,this._removed||i.abandoned)return void this.fire(new z2("dataabort"));i.data&&(this._data={geojson:i.data});let n=this._applyDiffToSource(r.dataDiff),a=this._getShouldReloadTileOptions(n),o={};this._applyResourceTiming(o,i),this.fire(new z2("data",p(f({},o),{sourceDataType:"metadata"}))),this.fire(new z2("data",p(f({},o),{sourceDataType:"content",shouldReloadTileOptions:a})))}catch(t){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new z2("dataabort"));this.fire(new ML(vJ(t)))}finally{this._hasPendingWorkerUpdate()&&(yield this._updateWorkerData())}})}_applyResourceTiming(t,r){var i;if(!this._collectResourceTiming)return;let n=null==(i=r.resourceTiming)?void 0:i[this.id];if(!n)return;let a=n.slice(0);a?.length&&xn(t,{resourceTiming:a})}_applyDiffToSource(t){if(!t)return;let r="string"==typeof this.promoteId?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let t=function(t,r){let i=new Map;if(null==t||null==t.type)return i;if("Feature"===t.type){let n=Lz(t,r);return null==n?void 0:(i.set(n,t),i)}if("FeatureCollection"===t.type){let n=new Set;for(let a of t.features){let t=Lz(a,r);if(null==t||n.has(t))return;n.add(t),i.set(t,a)}return i}}(this._data.geojson,r);if(!t)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:t}}if(!this._data.updateable)return;let i=function(t,r,i){var n,a;let o=[];if(r.removeAll)t.clear();else if(r.remove)for(let i of r.remove){let r=t.get(i);r&&(o.push(r.geometry),t.delete(i))}if(r.add)for(let n of r.add){let r=Lz(n,i);if(null==r)continue;let a=t.get(r);a&&o.push(a.geometry),o.push(n.geometry),t.set(r,n)}if(r.update)for(let i of r.update){let r=t.get(i.id);if(!r)continue;let s=!!i.newGeometry,l=i.removeAllProperties||(null==(n=i.removeProperties)?void 0:n.length)>0||(null==(a=i.addOrUpdateProperties)?void 0:a.length)>0;if(!s&&!l)continue;o.push(r.geometry);let u=f({},r);if(t.set(i.id,u),s&&(o.push(i.newGeometry),u.geometry=i.newGeometry),l){if(u.properties=i.removeAllProperties?{}:f({},u.properties||{}),i.removeProperties)for(let t of i.removeProperties)delete u.properties[t];if(i.addOrUpdateProperties)for(let{key:t,value:r}of i.addOrUpdateProperties)u.properties[t]=r}}return o}(this._data.updateable,t,r);if(!(t.removeAll||this._options.cluster))return i}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map(t=>LR(t))}}shouldReloadTile(t,{affectedBounds:r}){if("loading"===t.state)return!0;if("unloaded"===t.state)return!1;let{buffer:i,extent:n}=this.workerOptions.geojsonVtOptions,a=function({x:t,y:r,z:i},n=0){let a=Tr((t-n)/2**i),o=Ti((r+1+n)/2**i),s=Tr((t+1+n)/2**i),l=Ti((r-n)/2**i);return new FA([a,o],[s,l])}(t.tileID.canonical,i/n);for(let t of r)if(a.intersects(t))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return _(this,null,function*(){let r=t.actor?"RT":"LT";t.actor=yield this.actorPromise;let i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};t.abortController=new AbortController;try{let n=yield(yield this.actorPromise).sendAsync({type:r,data:i},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(n,this.map.painter,"RT"===r)}catch(r){if(delete t.abortController,t.aborted||xT(r))return;throw r}})}abortTile(t){return _(this,null,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return _(this,null,function*(){t.unloadVectorData(),yield(yield this.actorPromise).sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actorPromise.then(t=>t.sendAsync({type:"RS",data:{type:this.type,source:this.id}}))}serialize(){return xn({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}},FC=[0,0,1],FI=(t,r)=>({u_tl_parent:new Ej(t,r.u_tl_parent),u_scale_parent:new EB(t,r.u_scale_parent),u_buffer_scale:new EB(t,r.u_buffer_scale),u_image_warp:new EN(t,r.u_image_warp),u_fade_t:new EB(t,r.u_fade_t),u_opacity:new EB(t,r.u_opacity),u_image0:new ER(t,r.u_image0),u_image1:new ER(t,r.u_image1),u_brightness_low:new EB(t,r.u_brightness_low),u_brightness_high:new EB(t,r.u_brightness_high),u_saturation_factor:new EB(t,r.u_saturation_factor),u_contrast_factor:new EB(t,r.u_contrast_factor),u_spin_weights:new EN(t,r.u_spin_weights),u_coords_top:new EV(t,r.u_coords_top),u_coords_bottom:new EV(t,r.u_coords_bottom)}),FL=(t,r,i,n,a,o)=>{var s,l,u;let c,h;return{u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_image_warp:o,u_fade_t:i.mix,u_opacity:i.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:(s=n.paint.get("raster-saturation"))>0?1-1/(1.001-s):-s,u_contrast_factor:(l=n.paint.get("raster-contrast"))>0?1/(1-l):1+l,u_spin_weights:(c=Math.sin(u=n.paint.get("raster-hue-rotate")*(Math.PI/180)),[(2*(h=Math.cos(u))+1)/3,(-Math.sqrt(3)*c-h+1)/3,(Math.sqrt(3)*c-h+1)/3]),u_coords_top:[a[0].x,a[0].y,a[1].x,a[1].y],u_coords_bottom:[a[3].x,a[3].y,a[2].x,a[2].y]}},FP=class{constructor(t,r,i){this.vertexBuffer=t,this.indexBuffer=r,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}},Fz=wi([{name:"a_pos",type:"Int16",components:2}]),FF=Mf/128,FO=class extends MP{constructor(t,r,i,n){super(),this.imageWarp=FC,this.flippedWindingOrder=!1,this._warp="auto",this._imageDirty=!1,this._subdividedQuad=!1,this._subdividedMesh=null,this.id=t,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=r}load(t){return _(this,null,function*(){if(void 0===this.options.url){this._loaded=!0,this._finishLoading();return}this._loaded=!1,this.fire(new z2("dataloading")),this.url=this.options.url,this._abortController=new AbortController;try{let r=yield zX.transformAndGetImage(this.map._requestManager,this.url,"Image",this._abortController);this._abortController=null,this._loaded=!0,r?.data?(this._setImage(r.data),t&&(this.coordinates=t),this._finishLoading()):this.fire(new ML(Error(`Could not load image ${this.url}: the response is empty`)))}catch(t){if(xT(t))return;this._abortController=null,this._loaded=!0,this.fire(new ML(vJ(t)))}})}loaded(){return this._loaded}updateImage(t){return this._abortController&&(this._abortController=(this._abortController.abort(),null)),"image"in t?(this._loaded=!0,this._setImage(t.image),t.coordinates&&(this.coordinates=t.coordinates),this._finishLoading()):t.url&&(this.options.url=t.url,this.load(t.coordinates)),this}_setImage(t){this.image=t,this._imageDirty=!0}getMesh(t,r){return!this._subdividedQuad||r?null:(null!=this._subdividedMesh||(this._subdividedMesh=LB(t,{granularity:16})),this._subdividedMesh)}_disposeTexture(){var t;null==(t=this.texture)||t.destroy(),this.texture=null}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new z2("data",{sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){var t;this._abortController&&(this._abortController=(this._abortController.abort(),null)),this._disposeTexture(),null==(t=this._subdividedMesh)||t.destroy(),this._subdividedMesh=null,this.image=null,this.tiles={}}setWarp(t){return this._warp===t||(this._warp=t,this.tileCoords&&this.setCoordinates(this.coordinates)),this}getWarp(){return this._warp}setCoordinates(t){var r;let i,n,a,o,s,l;this.coordinates=t;let u=t.map(D1.fromLngLat);return this.tileID=(n=Math.max(0,Math.floor(-Math.log(Math.max((i=DW.fromPoints(u)).width(),i.height()))/Math.LN2)),a=2**n,new Ii(n,Math.floor((i.minX+i.maxX)/2*a),Math.floor((i.minY+i.maxY)/2*a))),this.terrainTileRanges=this._getOverlappingTileRanges(u),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=u.map(t=>this.tileID.getTilePoint(t)._round()),this.imageWarp=function(t,r){if("flat"===r||LN(t))return FC;let[i,n,a,o]=t,s=i.x-n.x+a.x-o.x,l=i.y-n.y+a.y-o.y,u=[n.x-a.x,n.y-a.y,o.x-a.x,o.y-a.y],[c,h,d,f]=u,p=u[0]*u[3]-u[2]*u[1],m=(s*f-d*l)/p,g=(c*l-s*h)/p,y=[1,1+m,1+m+g,1+g],v=Math.max(...y)/Math.min(...y),x="perspective"===r?0:Math.max(0,(1-4/v)/.9921875);return!(v>=1&&v<=512)||x>=1?FC:[m,g,x]}(this.tileCoords,this._warp),this._subdividedQuad=this.imageWarp[2]>0&&!LN(this.tileCoords),this.flippedWindingOrder=(o=(r=this.tileCoords)[1].x-r[0].x,s=r[1].y-r[0].y,l=r[2].x-r[0].x,o*(r[2].y-r[0].y)-s*l<0),this.fire(new z2("data",{sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;let t=this.map.painter.context,r=t.gl;this.texture?this._imageDirty&&(this.texture.update(this.image),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)):(this.texture=new Dp(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this._imageDirty=!1;let i=!1;for(let t in this.tiles){let r=this.tiles[t];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture,i=!0)}i&&this.fire(new z2("data",{sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return _(this,null,function*(){var r;null!=(r=this.tileID)&&r.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){let t={type:"image",coordinates:this.coordinates};return void 0!==this.options.url&&(t.url=this.options.url),t}hasTransition(){return!1}_getOverlappingTileRanges(t){let{minX:r,minY:i,maxX:n,maxY:a}=DW.fromPoints(t),o={};for(let t=0;t<=25;t++){let s=2**t,l=Math.floor(r*s),u=Math.floor(i*s),c=Math.floor(n*s),h=Math.floor(a*s),d=(l%s+s)%s,f=c%s,p=Math.floor(l/s),m=Math.floor(c/s);o[t]={minWrap:p,maxWrap:m,minTileXWrapped:d,maxTileXWrapped:f,minTileY:u,maxTileY:h}}return o}},FR=class extends FO{constructor(t,r,i,n){super(t,r,i,n),this._onPlayingHandler=()=>{var t;null==(t=this.map)||t.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=r}load(){return _(this,null,function*(){this._loaded=!1;let t=this.options;for(let r of(this.urls=[],t.urls))this.urls.push((yield this.map._requestManager.transformRequest(r,"Source")).url);try{let t=yield MC(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new ML(vJ(t)))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let r=this.video.seekable;tr.end(0)?this.fire(new ML(new MR(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let t=this.map.painter.context,r=t.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new Dp(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let i=!1;for(let t in this.tiles){let r=this.tiles[t];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture,i=!0)}i&&this.fire(new z2("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},FB=class extends FO{constructor(t,r,i,n){super(t,r,i,n),r.coordinates?(!Array.isArray(r.coordinates)||4!==r.coordinates.length||r.coordinates.some(t=>!Array.isArray(t)||2!==t.length||t.some(t=>"number"!=typeof t)))&&this.fire(new ML(new MR(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new ML(new MR(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new ML(new MR(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new ML(new MR(`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 ML(new MR(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return _(this,null,function*(){(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions())?this.fire(new ML(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._playing=(this.prepare(),!1))},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this._playing=!1,super.onRemove()}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()||0===Object.keys(this.tiles).length)return;let r=this.map.painter.context,i=r.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new Dp(r,this.canvas,i.RGBA,{premultiply:!0}),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let n=!1;for(let t in this.tiles){let r=this.tiles[t];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture,n=!0)}n&&this.fire(new z2("data",{sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}},Fj={},FN=t=>{switch(t){case"geojson":return FD;case"image":return FO;case"raster":return FS;case"raster-dem":return FE;case"vector":return Fk;case"video":return FR;case"canvas":return FB}return Fj[t]},FV=(t,r)=>_(null,null,function*(){var i,n;if(FN(t))throw Error(`A source type called "${t}" already exists.`);i=t,n=r,Fj[i]=n}),FU="RTLPluginLoaded",Fq=class extends MP{constructor(...t){super(...t),this.status="unavailable",this.url=null,this.dispatcher=LC()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch(t=>{throw this.status="error",t})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t,r=!1){return _(this,null,function*(){if(this.url)throw Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=zH.resolveURL(t),!this.url)throw Error(`requested url ${t} is invalid`);if("unavailable"===this.status)if(!r)return this._requestImport();else this.status="deferred",this._syncState(this.status);else if("requested"===this.status)return this._requestImport()})}_requestImport(){return _(this,null,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new MI(FU))})}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}},FG=null,FH=class{constructor(t,r){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=Mm++,this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rttObjects=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading",this.featureStateRevision=-1}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:r,fadingParentID:i,fadeEndTime:n}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=r,this.fadingParentID=i,this.fadeEndTime=n}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=Lu(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}getRTT(t){return this.rttObjects[t]}acquireRTT(t,r,i){return this.rttObjects[r]=t.acquireRTT(i)}releaseRTT(t){if(0!==this.rttObjects.length){for(let r of this.rttObjects)r&&t.releaseRTT(r);this.rttObjects.length=0}}loadVectorData(t,r,i){if(t?.etagUnmodified===!0){this.state="loaded";return}if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!t){this.collisionBoxArray=new S6;return}for(let n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestEncoding=t.encoding,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,r){let i={};if(!r)return i;for(let n of t){let t=n.layerIds.map(t=>r.getLayer(t)).filter(Boolean);if(0!==t.length)for(let r of(n.layers=t,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map(r=>t.filter(t=>t.id===r)[0])),t))i[r.id]=n}return i}(t.buckets,r?.style),this.hasSymbolBuckets=!1,this.buckets){let t=this.buckets[n];if(t instanceof CK)if(this.hasSymbolBuckets=!0,i)t.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let t in this.buckets){let r=this.buckets[t];if(r instanceof CK&&r.hasRTLText){this.hasRTLText=!0,LV().lazyLoad();break}}for(let t in this.queryPadding=0,this.buckets){let i=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(t).queryRadius(i))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}unloadVectorData(){for(let t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.imageAtlas=null,this.dashPositions=null,this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(let r in this.buckets){let i=this.buckets[r];i.uploadPending()&&i.upload(t)}let r=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Dp(t,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasImage=(this.glyphAtlasTexture=new Dp(t,this.glyphAtlasImage,r.ALPHA),null))}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,r,i,n,a,o,s,l,u,c,h){var d;return null!=(d=this.latestFeatureIndex)&&d.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:a,scale:o,tileSize:this.tileSize,pixelPosMatrix:c,transform:l,params:s,queryPadding:this.queryPadding*u,getElevation:h},t,r,i):{}}querySourceFeatures(t,r){let i=this.latestFeatureIndex;if(!i?.rawTileData)return;let n=i.loadVTLayers(),a=r?.sourceLayer?r.sourceLayer:"",o=n._geojsonTileLayer||n[a];if(!o)return;let s=_c(r?.filter,`querySourceFeatures[${a}].filter`,r?.globalState),{z:l,x:u,y:c}=this.tileID.canonical,h={z:l,x:u,y:c};for(let r=0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(t,i,n,a)=>{let o=n||a;return r[i]=!o||o.toLowerCase(),""}),r["max-age"]){let t=parseInt(r["max-age"],10);isNaN(t)?delete r["max-age"]:r["max-age"]=t}return r}(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){let t=Date.now(),i=!1;if(this.expirationTime>t)i=!1;else if(r)if(this.expirationTimethis.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]0?(r+=t[n]*this.min[n],i+=t[n]*this.max[n]):(i+=t[n]*this.min[n],r+=t[n]*this.max[n]);return r>=0?2:i<0?0:1}},FY=class t{constructor(t,r,i){this.points=t,this.planes=r,this.aabb=i}static fromInvProjectionMatrix(r,i=1,n=0,a,o){let s=o?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],l=2**n,u=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(t=>{let n,a;return a=1/(n=vU([],t,r))[3]/i*l,Mc(n,n,[a,a,1/n[3],a])});a&&function(t,r,i,n){var a,o;let s,l,u,c=4*!!n,h=4*!n,d=0,f=[],p=[];for(let r=0;r<4;r++){let i=Ml([],t[r+h],t[r+c]),n=vS(i);vI(i,i,1/n),f.push(n),p.push(i)}for(let r=0;r<4;r++){let n=function(t,r,i){let n=t[0]*i[0]+t[1]*i[1]+t[2]*i[2],a=r[0]*i[0]+r[1]*i[1]+r[2]*i[2];return 0===a?null:(-n-i[3])/a}(t[r+c],p[r],i);d=null!==n&&n>=0?Math.max(d,n):Math.max(d,f[r])}let m=(s=Ml([],(a=t)[(o=r)[0]],a[o[1]]),l=Ml([],a[o[2]],a[o[1]]),vP(u=[0,0,0,0],vF([],s,l)),u[3]=-vz(u,a[o[0]]),u),g=function(t,r){var i,n;let a=Mu(t),o=(i=[],n=1/a,i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i),s=Ml([],r,vI([],o,vz(r,o))),l=Mu(s);if(l>0){let t=Math.sqrt(1-o[3]*o[3]);return v4(r,vD([],vI([],o,-o[3]),vI([],s,t/l)))}return null}(i,m);null!==g&&(d=Math.min(d,g/vz(p[0],m)));for(let r=0;r<4;r++){let i=Math.min(d,f[r]);t[r+h]=[t[r+c][0]+p[r][0]*i,t[r+c][1]+p[r][1]*i,t[r+c][2]+p[r][2]*i,1]}}(u,s[0],a,o);let c=s.map(t=>{let r=vP([],vF([],Ml([],u[t[0]],u[t[1]]),Ml([],u[t[2]],u[t[1]]))),i=-vz(r,u[t[1]]);return r.concat(i)}),h=[1/0,1/0,1/0],d=[-1/0,-1/0,-1/0];for(let t of u)for(let r=0;r<3;r++)h[r]=Math.min(h[r],t[r]),d[r]=Math.max(d[r],t[r]);return new t(u,c,new FW(h,d))}},FZ=LG(9.314,3),FX=class{constructor(){this._tiles={}}handleWrapJump(t){let r={};for(let i in this._tiles){let n=this._tiles[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),r[n.tileID.key]=n}this._tiles=r}setFeatureState(t,r,i){for(let n in this._tiles)this._tiles[n].setFeatureState(t,r,i)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map(t=>t.tileID).sort(An).map(t=>t.key):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,r){this._tiles[t]=r}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){let r=this.getTileById(t.key);return r?.hasData()?r:null}isIdRenderable(t,r=!1){var i;return null==(i=this.getTileById(t))?void 0:i.isRenderable(r)}getRenderableIds(t=0,r){let i=[];for(let t of this.getAllIds())this.isIdRenderable(t,r)&&i.push(this.getTileById(t));return r?i.sort((r,i)=>{let n=r.tileID,a=i.tileID,o=new vu(n.canonical.x,n.canonical.y)._rotate(-t),s=new vu(a.canonical.x,a.canonical.y)._rotate(-t);return n.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x}).map(t=>t.tileID.key):i.map(t=>t.tileID).sort(An).map(t=>t.key)}},(FK=class extends MP{constructor(t,r,i){super(),this._maxContentElevationSeen=0,this.id=t,this.dispatcher=i,this.on("data",t=>{this._dataHandler(t)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((t,r,i,n)=>{let a=new(FN(r.type))(t,r,i,n);if(a.id!==t)throw Error(`Expected Source id to be ${t} instead of ${a.id}`);return a})(t,r,i,this),this._inViewTiles=new FX,this._outOfViewCache=new La(0,t=>this._unloadTile(t)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new F$,this._didEmitContent=!1,this._updated=!1}onAdd(t){var r;this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,null!=(r=this._source)&&r.onAdd&&this._source.onAdd(t)}onRemove(t){var r;for(let t of this._inViewTiles.getAllTiles())t.unloadVectorData();this.clearTiles(),null!=(r=this._source)&&r.onRemove&&this._source.onRemove(t),this._inViewTiles=new FX}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((void 0!==this.used||void 0!==this.usedForTerrain)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let t of this._inViewTiles.getAllTiles())if("loaded"!==t.state&&"errored"!==t.state)return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,r,i,n){return _(this,null,function*(){try{let a=yield this._source.loadTile(t);this._tileLoaded(t,r,i,n,a)}catch(r){t.state="errored",404===r.status?this.update(this.transform,this.terrain):this._source.fire(new ML(vJ(r),{tile:t}))}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new z2("dataabort",{tile:t,coord:t.tileID}))}serialize(){return this._source.serialize()}prepare(t){for(let r of(this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null),this._inViewTiles.getAllTiles()))r.upload(t),r.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var r;return this._inViewTiles.getRenderableIds(null==(r=this.transform)?void 0:r.bearingInRadians,t)}hasRenderableParent(t){let r=t.overscaledZ-1;if(r>=this._source.minzoom){let i=this.getLoadedTile(t.scaledTo(r));if(i)return this._inViewTiles.isIdRenderable(i.tileID.key)}return!1}reload(t,r){if(this._paused){this._shouldReloadOnResume=!0;return}for(let i of(this._outOfViewCache.reset(),this._inViewTiles.getAllIds())){let n=this._inViewTiles.getTileById(i);(!r||this._source.shouldReloadTile(n,r))&&(t?this._reloadTile(i,"errored"===n.state?"loading":"expired"):"errored"!==n.state&&this._reloadTile(i,"reloading"))}}_reloadTile(t,r){return _(this,null,function*(){let i=this._inViewTiles.getTileById(t);if(!i)return;let n=i.hasData();"loading"!==i.state&&(i.state=r),yield this._loadTile(i,t,r,n)})}_tileLoaded(t,r,i,n,a){n||(t.timeAdded=Lu(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration)),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),!a?.unmodified&&("raster-dem"===this.getSource().type&&t.dem&&function(t,r){var i,n,a;for(let o of r.getRenderableIds()){if(!(null!=(i=t.neighboringTiles)&&i[o]))continue;let s=r.getTileById(o);t.neighboringTiles[o].backfilled||LZ(t,s),null!=(a=null==(n=s.neighboringTiles)?void 0:n[t.tileID.key])&&a.backfilled||LZ(s,t)}}(t,this._inViewTiles),t.featureStateRevision=-1,this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new z2("data",{tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,r){let i=this._getLoadedDescendents(r),n=new Set;for(let a of r){let r=i[a.key];if(!r?.length){n.add(a);continue}let o=a.overscaledZ+FK.maxOverzooming,s=r.filter(t=>t.tileID.overscaledZ<=o);if(!s.length){n.add(a);continue}let l=Math.min(...s.map(t=>t.tileID.overscaledZ)),u=s.filter(t=>t.tileID.overscaledZ===l).map(t=>t.tileID);for(let r of u)t[r.key]=r;this._areDescendentsComplete(u,l,a.overscaledZ)||n.add(a)}return n}_getLoadedDescendents(t){var r;let i={};for(let n of this._inViewTiles.getAllTiles().filter(t=>t.hasData()))for(let a of t)n.tileID.isChildOf(a)&&(i[r=a.key]||(i[r]=[]),i[a.key].push(n));return i}_areDescendentsComplete(t,r,i){return 1===t.length&&t[0].isOverscaled()?t[0].overscaledZ===r:4**(r-i)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){let r=Math.floor((Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1)*(null===this._maxTileCacheZoomLevels?MA.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._outOfViewCache.setMaxSize(i)}handleWrapJump(t){let r=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);this._prevLng=t,r&&(this._inViewTiles.handleWrapJump(r),this._resetTileReloadTimers())}_updateMaxContentElevation(){var t,r;let i=this._maxContentElevationSeen,n=null==(r=null==(t=this.map)?void 0:t.style)?void 0:r._layers;if(!n)return i;let a=this._inViewTiles.getAllTiles();for(let t in n){let r=n[t];if(!("symbol"!==r.type||r.source!==this.id||r.isHidden(this.transform.zoom))&&r.layout)for(let t of(i=Math.max(i,r.layout.get("symbol-height-offset").constantOr(0)),a)){let n=t.getBucket(r);n&&n.maxHeightOffset>i&&(i=n.maxHeightOffset)}}return this._maxContentElevationSeen=i,i}update(t,r){let i;if(!this._sourceLoaded||this._paused)return;this.transform=t,this.terrain=r,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(t=>new Ia(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)):(i=L$(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:"vector"===this._source.type&&void 0!==this.map._zoomLevelsToOverscale?Math.max(this._source.maxzoom,t.maxZoom-this.map._zoomLevelsToOverscale):this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r,calculateTileZoom:this._source.calculateTileZoom,maxContentElevation:this._updateMaxContentElevation()}),this._source.hasTile&&(i=i.filter(t=>this._source.hasTile(t)))):i=[],this.usedForTerrain&&(i=this._addTerrainIdealTiles(i));let n=0===i.length&&!this._updated&&this._didEmitContent;this._updated=!0,n&&this.fire(new z2("data",{sourceDataType:"idle",sourceId:this.id}));let a=LH(t,this._source),o=this._updateRetainedTiles(i,a),s=LW(this._source.type);s&&this._rasterFadeDuration>0&&!r&&function(t,r,i,n,a,o,s){let l=Lu(),u=function(t){if(!t.length)return new Set;let r=Math.max(...t.map(t=>t.canonical.z)),i=1/0,n=-1/0,a=1/0,o=-1/0,s=[];for(let l of t){let{x:t,y:u,z:c}=l.canonical,h=2**(r-c),d=t*h,f=u*h;s.push({id:l,x:d,y:f}),dn&&(n=d),fo&&(o=f)}let l=new Set;for(let t of s)(t.x===i||t.x===n||t.y===a||t.y===o)&&l.add(t.id);return l}(r);for(let c of r){let r=t.getTileById(c.key);(0===r.fadingDirection||0===r.fadeOpacity)&&r.resetFadeLogic(),!function(t,r,i,n,a,o,s){if(!r.hasData())return!1;let{tileID:l,fadingRole:u,fadingDirection:c,fadingParentID:h}=r;if(0===u&&1===c&&h)return i[h.key]=h,!0;let d=Math.max(l.overscaledZ-a,o);for(let a=l.overscaledZ-1;a>=d;a--){let o=l.scaledTo(a),u=t.getLoadedTile(o);if(u)return r.setCrossFadeLogic({fadingRole:0,fadingDirection:1,fadingParentID:u.tileID,fadeEndTime:n+s}),u.setCrossFadeLogic({fadingRole:1,fadingDirection:0,fadeEndTime:n+s}),i[o.key]=o,!0}return!1}(t,r,i,l,n,a,s)&&(function(t,r,i,n,a,o){if(!r.hasData())return!1;let s=r.tileID.children(a),l=LY(t,r,s,i,n,a,o);if(l)return!0;for(let u of s)LY(t,r,u.children(a),i,n,a,o)&&(l=!0);return l}(t,r,i,l,o,s)||function(t,r,i,n){let a=t.tileID;return!!t.selfFading||!t.hasData()&&!!r.has(a)&&(t.setSelfFadeLogic(i+n),!0)}(r,u,l,s)||r.resetFadeLogic())}}(this._inViewTiles,i,o,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),s?this._cleanUpRasterTiles(o):this._cleanUpVectorTiles(o)}_cleanUpRasterTiles(t){for(let r of this._inViewTiles.getAllIds())t[r]||this._removeTile(r)}_cleanUpVectorTiles(t){for(let r of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(r);if(t[r]){i.clearSymbolFadeHold();continue}if(!i.hasSymbolBuckets){this._removeTile(r);continue}i.holdingForSymbolFade()?i.symbolFadeFinished()&&this._removeTile(r):i.setSymbolHoldDuration(this.map._fadeDuration)}}_addTerrainIdealTiles(t){let r=[];for(let i of t)if(i.canonical.z>this._source.minzoom){let t=i.scaledTo(i.canonical.z-1);r.push(t);let n=i.scaledTo(Math.max(this._source.minzoom,Math.min(i.canonical.z,5)));r.push(n)}return t.concat(r)}releaseSymbolFadeTiles(){for(let t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,r){var i;let n=new Set;for(let r of t)this._addTile(r).hasData()||n.add(r);let a=t.reduce((t,r)=>(t[r.key]=r,t),{}),o=this._retainLoadedChildren(a,n),s={},l=Math.max(r-FK.maxUnderzooming,this._source.minzoom);for(let t of o){let r=this._inViewTiles.getTileById(t.key),n=r?.wasRequested();for(let o=t.overscaledZ-1;o>=l;--o){let l=t.scaledTo(o);if(s[l.key])break;if(s[l.key]=!0,(r=this.getTile(l))||!n||(r=this._addTile(l)),r){let t=r.hasData();if((t||!(null!=(i=this.map)&&i.cancelPendingTileRequestsWhileZooming)||n)&&(a[l.key]=l),n=r.wasRequested(),t)break}}}return a}_addTile(t){let r=this._inViewTiles.getTileById(t.key);if(r)return r;(r=this._outOfViewCache.getAndRemove(t))&&(r.resetFadeLogic(),this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null));let i=r;return r||(r=new FH(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,t.key,r.state,!1)),r.uses++,this._inViewTiles.setTile(t.key,r),i||this._source.fire(new z2("dataloading",{tile:r,coord:r.tileID})),r}_setTileReloadTimer(t,r){this._clearTileReloadTimer(t);let i=r.getExpiryTimeout();if(i){let r=()=>{this._reloadTile(t,"expired"),delete this._timers[t]};this._timers[t]=setTimeout(r,i)}}_clearTileReloadTimer(t){let r=this._timers[t];r&&(clearTimeout(r),delete this._timers[t])}_resetTileReloadTimers(){for(let t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(let t of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,r)}}refreshTiles(t){for(let r of this._inViewTiles.getAllIds()){let i=this._inViewTiles.getTileById(r);(this._inViewTiles.isIdRenderable(r)||"errored"==i.state)&&t.some(t=>t.equals(i.tileID.canonical))&&this._reloadTile(r,"expired")}}_removeTile(t){let r=this._inViewTiles.getTileById(t);r&&(r.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),r.uses>0||(r.hasData()&&"reloading"!==r.state?this._outOfViewCache.add(r.tileID,r,r.getExpiryTimeout()):(r.aborted=!0,this._abortTile(r),this._unloadTile(r))))}_dataHandler(t){if("source"===t.dataType){if("metadata"===t.sourceDataType){this._sourceLoaded=!0;return}"content"===t.sourceDataType&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}}resetMaxContentElevation(){this._maxContentElevationSeen=0}clearTiles(){for(let t of(this._shouldReloadOnResume=!1,this._paused=!1,this.resetMaxContentElevation(),this._inViewTiles.getAllIds()))this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,r,i){let n=[],a=this.transform;if(!a)return n;let o=a.getCoveringTilesDetailsProvider().allowWorldCopies(),s=i?a.getCameraQueryGeometry(t):t,l=t=>a.screenPointToMercatorCoordinate(t,this.terrain),u=this.transformBbox(t,l,!o),c=this.transformBbox(s,l,!o),h=this.getIds(),d=DW.fromPoints(c);for(let t of h){let i=this._inViewTiles.getTileById(t);if(i.holdingForSymbolFade())continue;let s=o?[i.tileID]:[i.tileID.unwrapTo(-1),i.tileID.unwrapTo(0)],l=2**(a.zoom-i.tileID.overscaledZ),h=r*i.queryPadding*Mf/i.tileSize/l;for(let t of s){let r=d.map(r=>t.getTilePoint(new D1(r.x,r.y)));if(r.expandBy(h),r.intersects(DY)){let r=u.map(r=>t.getTilePoint(r)),a=c.map(r=>t.getTilePoint(r));n.push({tile:i,tileID:o?t:t.unwrapTo(0),queryGeometry:r,cameraQueryGeometry:a,scale:l})}}}return n}transformBbox(t,r,i){let n=t.map(r);if(i){let i=DW.fromPoints(t);i.shrinkBy(.001*Math.min(i.width(),i.height()));let a=i.map(r);DW.fromPoints(n).covers(a)||(n=n.map(t=>t.x>.5?new D1(t.x-1,t.y,t.z):t))}return n}getVisibleCoordinates(t){let r=this.getRenderableIds(t).map(t=>this._inViewTiles.getTileById(t).tileID);return this.transform&&this.transform.populateCache(r),r}hasTransition(){return!!this._source.hasTransition()||LW(this._source.type)&&function(t,r){if(r<=0)return!1;let i=Lu();for(let r of t.getAllTiles())if(r.fadeEndTime>=i)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,r,i){t||(t=Is),this._state.updateState(t,r,i)}removeFeatureState(t,r,i){t||(t=Is),this._state.removeFeatureState(t,r,i)}getFeatureState(t,r){return t||(t=Is),this._state.getState(t,r)}setDependencies(t,r,i){let n=this._inViewTiles.getTileById(t);n&&n.setDependencies(r,i)}reloadTilesForDependencies(t,r){for(let i of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(i).hasDependency(t,r)&&this._reloadTile(i,"reloading");this._outOfViewCache.filter(i=>!i.hasDependency(t,r))}areTilesLoaded(){for(let t of this._inViewTiles.getAllTiles())if("loaded"!==t.state&&"errored"!==t.state)return!1;return!0}}).maxUnderzooming=10,FK.maxOverzooming=3,FJ=FK,FQ=class{constructor(t,r){this.reset(t,r)}reset(t,r){this.points=t||[],this._distances=[0];for(let t=1;t0?(n-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}},F0=class{constructor(t,r,i){let n=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(r/i);for(let t=0;tthis.width||n<0||r>this.height)return[];let l=[];if(t<=0&&r<=0&&this.width<=i&&this.height<=n){if(a)return[{key:null,x1:t,y1:r,x2:i,y2:n}];for(let t=0;t0}hitTestCircle(t,r,i,n,a){let o=t-i,s=t+i,l=r-i,u=r+i;if(s<0||o>this.width||u<0||l>this.height)return!1;let c=[];return this._forEachCell(o,l,s,u,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:t,y:r,radius:i},seenUids:{box:{},circle:{}}},a),c.length>0}_queryCell(t,r,i,n,a,o,s,l){let{seenUids:u,hitTest:c,overlapMode:h}=s,d=this.boxCells[a];if(null!==d){let a=this.bboxes;for(let s of d)if(!u.box[s]){u.box[s]=!0;let d=4*s,f=this.boxKeys[s];if(t<=a[d+2]+1e-6&&r<=a[d+3]+1e-6&&i>=a[d+0]-1e-6&&n>=a[d+1]-1e-6&&(!l||l(f))&&(!c||!LK(h,f.overlapMode))&&(o.push({key:f,x1:a[d],y1:a[d+1],x2:a[d+2],y2:a[d+3]}),c))return!0}}let f=this.circleCells[a];if(null!==f){let a=this.circles;for(let s of f)if(!u.circle[s]){u.circle[s]=!0;let d=3*s,f=this.circleKeys[s];if(this._circleAndRectCollide(a[d],a[d+1],a[d+2],t,r,i,n)&&(!l||l(f))&&(!c||!LK(h,f.overlapMode))){let t=a[d],r=a[d+1],i=a[d+2];if(o.push({key:f,x1:t-i,y1:r-i,x2:t+i,y2:r+i}),c)return!0}}}return!1}_queryCellCircle(t,r,i,n,a,o,s,l){let{circle:u,seenUids:c,overlapMode:h}=s,d=this.boxCells[a];if(null!==d){let t=this.bboxes;for(let r of d)if(!c.box[r]){c.box[r]=!0;let i=4*r,n=this.boxKeys[r];if(this._circleAndRectCollide(u.x,u.y,u.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!l||l(n))&&!LK(h,n.overlapMode))return o.push(!0),!0}}let f=this.circleCells[a];if(null!==f){let t=this.circles;for(let r of f)if(!c.circle[r]){c.circle[r]=!0;let i=3*r,n=this.circleKeys[r];if(this._circlesCollide(t[i],t[i+1],t[i+2],u.x,u.y,u.radius)&&(!l||l(n))&&!LK(h,n.overlapMode))return o.push(!0),!0}}}_forEachCell(t,r,i,n,a,o,s,l){let u=this._convertToXCellCoord(t),c=this._convertToYCellCoord(r),h=this._convertToXCellCoord(i),d=this._convertToYCellCoord(n);for(let f=u;f<=h;f++)for(let u=c;u<=d;u++){let c=this.xCellCount*u+f;if(a.call(this,t,r,i,n,c,o,s,l))return}}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,r,i,n,a,o){let s=n-t,l=a-r,u=i+o;return u*u>s*s+l*l}_circleAndRectCollide(t,r,i,n,a,o,s){let l=(o-n)/2,u=Math.abs(t-(n+l));if(u>l+i)return!1;let c=(s-a)/2,h=Math.abs(r-(a+c));if(h>c+i)return!1;if(u<=l||h<=c)return!0;let d=u-l,f=h-c;return d*d+f*f<=i*i}},F1=vf(),F2=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]),F3=class{constructor(t,r=new F0(t.width+200,t.height+200,25),i=new F0(t.width+200,t.height+200,25)){this.transform=t,this.grid=r,this.ignoredGrid=i,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,r,i,n,a,o,s,l,u,c,h,d,f=0,p=!0){let m=t.anchorPointX+l[0],g=t.anchorPointY+l[1],y=this.projectAndGetPerspectiveRatio(m,g,a,LX(c,m,g,f,p),d),v=i*y.perspectiveRatio,x;if(o||s)x=this._projectCollisionBox(t,v,n,a,o,s,l,y,c,h,d,f,p);else{let r=y.x+(h?h.x*v:0),i=y.y+(h?h.y*v:0);x={allPointsOccluded:!1,box:[r+t.x1*v,i+t.y1*v,r+t.x2*v,i+t.y2*v]}}let[b,_,w,T]=x.box,A=o?x.allPointsOccluded:y.isOccluded,M=A;return M||(M=y.perspectiveRatio=1;t--)f.push(o.path[t]);for(let t=1;tt.signedDistanceFromCamera<=0)?[]:t.map(t=>t.point)}let g=[];if(f.length>0){let t=f[0].clone(),r=f[0].clone();for(let i=1;i=i.x&&r.x<=n.x&&t.y>=i.y&&r.y<=n.y?[f]:r.xn.x||r.yn.y?[]:TK([f],i.x,i.y,n.x,n.y)}for(let i of g){a.reset(i,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/p)+1;for(let i=0;ii&&(i=a,r=n);return t.slice(r,r+i)}((n=1/((i=r.pitchedLabelPlaneMatrix)[0]*i[5]-i[1]*i[4]),F1[0]=i[5]*n,F1[1]=-i[1]*n,F1[2]=0,F1[3]=0,F1[4]=-i[4]*n,F1[5]=i[0]*n,F1[6]=0,F1[7]=0,F1[8]=0,F1[9]=0,F1[10]=1/i[10],F1[11]=0,F1[12]=0,F1[13]=0,F1[14]=0,F1[15]=1/i[15],t.map(t=>{let i=L1(t.x,t.y,F1,L0(r,t.x,t.y)),n=r.transform.projectTileCoordinates(i.point.x,i.point.y,r.unwrappedTileID,L0(r,i.point.x,i.point.y));return n.point.x=(.5*n.point.x+.5)*r.width,n.point.y=(-(.5*n.point.y)+.5)*r.height,n})))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let r=[],i=new DW;for(let n of t){let t=new vu(n.x+100,n.y+100);i.extend(t),r.push(t)}let{minX:n,minY:a,maxX:o,maxY:s}=i,l=this.grid.query(n,a,o,s).concat(this.ignoredGrid.query(n,a,o,s)),u={},c={};for(let t of l){let i=t.key;void 0===u[i.bucketInstanceId]&&(u[i.bucketInstanceId]={}),!u[i.bucketInstanceId][i.featureIndex]&&wd(r,[new vu(t.x1,t.y1),new vu(t.x2,t.y1),new vu(t.x2,t.y2),new vu(t.x1,t.y2)])&&(u[i.bucketInstanceId][i.featureIndex]=!0,void 0===c[i.bucketInstanceId]&&(c[i.bucketInstanceId]=[]),c[i.bucketInstanceId].push(i.featureIndex))}return c}insertCollisionBox(t,r,i,n,a,o){(i?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:a,collisionGroupID:o,overlapMode:r},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,r,i,n,a,o){let s=i?this.ignoredGrid:this.grid,l={bucketInstanceId:n,featureIndex:a,collisionGroupID:o,overlapMode:r};for(let r=0;r=this.screenRightBoundary||n<100||r>this.screenBottomBoundary}isInsideGrid(t,r,i,n){return i>=0&&t=0&&rthis.projectAndGetPerspectiveRatio(t.x,t.y,n,LX(u,t.x,t.y,d,f),h));C=t.some(t=>!t.isOccluded),D=t.map(t=>new vu(t.x,t.y))}else C=!0;return{box:function(t){let r=1/0,i=1/0,n=-1/0,a=-1/0;for(let o of t)r=Math.min(r,o.x),i=Math.min(i,o.y),n=Math.max(n,o.x),a=Math.max(a,o.y);return[r,i,n,a]}(D),allPointsOccluded:!C}}},F5=class{constructor(t,r,i,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?r:-r))):n&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}},F4=class{constructor(t,r,i,n,a){this.text=new F5(t?t.text:null,r,i,a),this.icon=new F5(t?t.icon:null,r,n,a)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}},F6=class{constructor(t,r,i){this.text=t,this.icon=r,this.skipFade=i}},F8=class{constructor(t,r,i,n,a){this.bucketInstanceId=t,this.featureIndex=r,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=a}},F7=class{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){let r=++this.maxGroupID;this.collisionGroups[t]={ID:r,predicate:t=>t.collisionGroupID===r}}return this.collisionGroups[t]}},F9=class{constructor(t,r,i,n,a){this.transform=t.clone(),this.terrain=r,this.collisionIndex=new F3(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new F7(n),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){let r=this.terrain;if(r)return(i,n)=>r.getElevation(t,i,n)}getBucketParts(t,r,i,n){let a=i.getBucket(r),o=i.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;let s=i.collisionBoxArray,l=a.layers[0].layout,u=a.layers[0].paint,c=2**(this.transform.zoom-i.tileID.overscaledZ),h=i.tileSize/Mf,d=i.tileID.toUnwrapped(),f="map"===l.get("text-rotation-alignment"),p=vK(i,1,this.transform.zoom),m=v5(this.collisionIndex.transform,i,u.get("text-translate"),u.get("text-translate-anchor")),g=v5(this.collisionIndex.transform,i,u.get("icon-translate"),u.get("icon-translate-anchor")),y=LJ(f,this.transform,p);this.retainedQueryData[a.bucketInstanceId]=new F8(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,i.tileID);let v={bucket:a,layout:l,translationText:m,translationIcon:g,unwrappedTileID:d,pitchedLabelPlaneMatrix:y,scale:c,textPixelRatio:h,holdingForFade:i.holdingForSymbolFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:TW(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(n)for(let r of a.sortKeyRanges){let{sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:a}=r;t.push({sortKey:i,symbolInstanceStart:n,symbolInstanceEnd:a,parameters:v})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}attemptAnchorPlacement(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_,w){var T,A,M;let k=C$[t.textAnchor],S=[t.textOffset0,t.textOffset1],E=Pn(k,i,n,S,a),D=this.collisionIndex.placeCollisionBox(r,d,l,u,c,s,o,g,h.predicate,x,E,b,_,w);if((!v||this.collisionIndex.placeCollisionBox(v,d,l,u,c,s,o,y,h.predicate,x,E,b,_,w).placeable)&&D.placeable){let t;if(null!=(T=this.prevPlacement)&&T.variableOffsets[f.crossTileID]&&null!=(M=null==(A=this.prevPlacement)?void 0:A.placements[f.crossTileID])&&M.text&&(t=this.prevPlacement.variableOffsets[f.crossTileID].anchor),0===f.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[f.crossTileID]={textOffset:S,width:i,height:n,anchor:k,textBoxScale:a,prevAnchor:t},this.markUsedJustification(p,k,f,m),p.allowVerticalPlacement&&(this.markUsedOrientation(p,m,f),this.placedOrientations[f.crossTileID]=m),{shift:E,placedGlyphBoxes:D}}}placeLayerBucketPart(t,r,i){let{bucket:n,layout:a,translationText:o,translationIcon:s,unwrappedTileID:l,pitchedLabelPlaneMatrix:u,textPixelRatio:c,holdingForFade:h,collisionBoxArray:d,partiallyEvaluatedTextSize:f,collisionGroup:p}=t.parameters,m=a.get("text-optional"),g=a.get("icon-optional"),y=T8(a,"text-overlap","text-allow-overlap"),v="always"===y,x=T8(a,"icon-overlap","icon-allow-overlap"),b="always"===x,_="map"===a.get("text-rotation-alignment"),w="map"===a.get("text-pitch-alignment"),T="none"!==a.get("icon-text-fit"),A="viewport-y"===a.get("symbol-z-order"),M="ground"===a.get("symbol-height-anchor"),k=v&&(b||!n.hasIconData()||g),S=b&&(v||!n.hasTextData()||m);!n.collisionArrays&&d&&n.deserializeCollisionBoxes(d);let E=this.retainedQueryData[n.bucketInstanceId].tileID,D=this._getTerrainElevationFunc(E),C=this.transform.getFastPathSimpleProjectionMatrix(E),I=(t,d,b)=>{var A,I;if(r[t.crossTileID])return;if(h){this.placements[t.crossTileID]=new F6(!1,!1,!1);return}let L=t.heightOffset,P=!1,z=!1,F=!0,O=null,R={box:null,placeable:!1,offscreen:null,occluded:!1},B={box:null,placeable:!1,offscreen:null},j=null,N=null,V=null,U=0,q=0,G=0;d.textFeatureIndex?U=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(U=t.featureIndex),d.verticalTextFeatureIndex&&(q=d.verticalTextFeatureIndex);let H=d.textBox;if(H){let r=r=>{let i=1;if(n.allowVerticalPlacement&&!r&&this.prevPlacement){let r=this.prevPlacement.placedOrientations[t.crossTileID];r&&(this.placedOrientations[t.crossTileID]=r,i=r,this.markUsedOrientation(n,i,t))}return i},a=(r,i)=>{if(n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&d.verticalTextBox){for(let t of n.writingModes)if(2===t?B=R=i():R=r(),R?.placeable)break}else R=r()},u=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===u){let i=(r,i)=>{let a=this.collisionIndex.placeCollisionBox(r,y,c,E,l,w,_,o,p.predicate,D,void 0,C,L,M);return a?.placeable&&(this.markUsedOrientation(n,i,t),this.placedOrientations[t.crossTileID]=i),a};a(()=>i(H,1),()=>{let r=d.verticalTextBox;return n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?i(r,2):{box:null,offscreen:null}}),r(R?.placeable)}else{let f=C$[null==(I=null==(A=this.prevPlacement)?void 0:A.variableOffsets[t.crossTileID])?void 0:I.anchor],m=(r,a,d)=>{let m=r.x2-r.x1,g=r.y2-r.y1,v=t.textBoxScale,b=T&&"never"===x?a:null,A=null,k="never"===y?1:2,S="never";f&&k++;for(let i=0;im(H,d.iconBox,1),()=>{let r=d.verticalTextBox,i=R?.placeable;return n.allowVerticalPlacement&&!i&&t.numVerticalGlyphVertices>0&&r?m(r,d.verticalIconBox,2):{box:null,occluded:!0,offscreen:null}}),R&&(P=R.placeable,F=R.offscreen);let g=r(R?.placeable);if(!P&&this.prevPlacement){let r=this.prevPlacement.variableOffsets[t.crossTileID];r&&(this.variableOffsets[t.crossTileID]=r,this.markUsedJustification(n,r.anchor,t,g))}}}if(j=R,P=j?.placeable,F=j?.offscreen,t.useRuntimeCollisionCircles&&t.centerJustifiedTextSymbolIndex>=0){let r=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=T$(n.textSizeData,f,r),c=a.get("text-padding"),h=t.collisionCircleDiameter;(N=this.collisionIndex.placeCollisionCircles(y,r,n.lineVertexArray,n.glyphOffsetArray,s,l,u,i,w,p.predicate,h,c,o,D)).circles.length&&N.collisionDetected&&!i&&xf("Collisions detected, but collision boxes are not shown"),P=v||N.circles.length>0&&!N.collisionDetected,F&&(F=N.offscreen)}if(d.iconFeatureIndex&&(G=d.iconFeatureIndex),d.iconBox){let t=t=>this.collisionIndex.placeCollisionBox(t,x,c,E,l,w,_,s,p.predicate,D,T&&O?O:void 0,C,L,M);z=B&&B.placeable&&d.verticalIconBox?(V=t(d.verticalIconBox)).placeable:(V=t(d.iconBox)).placeable,F&&(F=V.offscreen)}let $=m||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,W=g||0===t.numIconVertices;$||W?W?$||z&&(z=P):P=z&&P:z=P=z&&P;let Y=P&&j.placeable,Z=z&&V.placeable;if(Y&&(B&&B.placeable&&q?this.collisionIndex.insertCollisionBox(j.box,y,a.get("text-ignore-placement"),n.bucketInstanceId,q,p.ID):this.collisionIndex.insertCollisionBox(j.box,y,a.get("text-ignore-placement"),n.bucketInstanceId,U,p.ID)),Z&&this.collisionIndex.insertCollisionBox(V.box,x,a.get("icon-ignore-placement"),n.bucketInstanceId,G,p.ID),N&&P&&this.collisionIndex.insertCollisionCircles(N.circles,y,a.get("text-ignore-placement"),n.bucketInstanceId,U,p.ID),i&&this.storeCollisionData(n.bucketInstanceId,b,d,j,V,N),0===t.crossTileID)throw Error("symbolInstance.crossTileID can't be 0");if(0===n.bucketInstanceId)throw Error("bucket.bucketInstanceId can't be 0");let X=(P||k)&&!j?.occluded,K=(z||S)&&!V?.occluded;this.placements[t.crossTileID]=new F6(X,K,F||n.justReloaded),r[t.crossTileID]=!0};if(A){if(0!==t.symbolInstanceStart)throw Error("bucket.bucketInstanceId should be 0");let r=n.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let t=r.length-1;t>=0;--t){let i=r[t];I(n.symbolInstances.get(i),n.collisionArrays[i],i)}}else for(let r=t.symbolInstanceStart;r=0&&(o>=0&&s!==o?t.text.placedSymbolArray.get(s).crossTileID=0:t.text.placedSymbolArray.get(s).crossTileID=i.crossTileID)}markUsedOrientation(t,r,i){let n=1===r||3===r?r:0;for(let r of[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex])t.text.placedSymbolArray.get(r).placedOrientation=n;i.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=2===r?r:0)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let r=this.prevPlacement,i=!1;this.prevZoomAdjustment=r?r.zoomAdjustment(this.transform.zoom):0;let n=r?r.symbolFadeChange(t):1,a=r?r.opacities:{},o=r?r.variableOffsets:{},s=r?r.placedOrientations:{};for(let t in this.placements){let r=this.placements[t],o=a[t];o?(this.opacities[t]=new F4(o,n,r.text,r.icon),i||(i=r.text!==o.text.placed),i||(i=r.icon!==o.icon.placed)):(this.opacities[t]=new F4(null,n,r.text,r.icon,r.skipFade),i||(i=r.text||r.icon))}for(let t in a){let r=a[t];if(!this.opacities[t]){let a=new F4(r,n,!1,!1);a.isHidden()||(this.opacities[t]=a,i||(i=r.text.placed),i||(i=r.icon.placed))}}for(let t in o)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=o[t]);for(let t in s)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=s[t]);if(r&&void 0===r.lastPlacementChangeTime)throw Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=r?r.lastPlacementChangeTime:t)}updateLayerOpacities(t,r){let i={};for(let n of r){let r=n.getBucket(t);r&&n.latestFeatureIndex&&t.id===r.layerIds[0]&&this.updateBucketOpacities(r,n.tileID,i,n.collisionBoxArray)}}updateBucketOpacities(t,r,i,n){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();let a=t.layers[0],o=a.layout,s=new F4(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),c=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),d="map"===o.get("text-pitch-alignment"),f="none"!==o.get("icon-text-fit"),p=new F4(null,0,l&&(u||!t.hasIconData()||o.get("icon-optional")),u&&(l||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);let m=(t,r,i)=>{for(let n=0;n0||o>0,x=n.numIconVertices>0,b=this.placedOrientations[n.crossTileID],_=2===b,w=1===b||3===b;if(v){let r=Po(y.text),i=_?On:r;m(t.text,a,i);let s=w?On:r;m(t.text,o,s);let l=y.text.isHidden();for(let r of[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex])r>=0&&(t.text.placedSymbolArray.get(r).hidden=l||_?1:0);n.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=l||w?1:0);let u=this.variableOffsets[n.crossTileID];u&&this.markUsedJustification(t,u.anchor,n,b);let c=this.placedOrientations[n.crossTileID];c&&(this.markUsedJustification(t,"left",n,c),this.markUsedOrientation(t,c,n))}if(x){let r=Po(y.icon),i=!(f&&n.verticalPlacedIconSymbolIndex&&_);if(n.placedIconSymbolIndex>=0){let a=i?r:On;m(t.icon,n.numIconVertices,a),t.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(n.verticalPlacedIconSymbolIndex>=0){let a=i?On:r;m(t.icon,n.numVerticalIconVertices,a),t.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}let T=g?.has(r)?g.get(r):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let i=t.collisionArrays[r];if(i){let r=new vu(0,0);if(i.textBox||i.verticalTextBox){let n=!0;if(c){let t=this.variableOffsets[l];t?(r=Pn(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),h&&r._rotate(d?-this.transform.bearingInRadians:this.transform.bearingInRadians)):n=!1}if(i.textBox||i.verticalTextBox){let a;i.textBox&&(a=_),i.verticalTextBox&&(a=w),Pa(t.textCollisionBox.collisionVertexArray,y.text.placed,!n||a,T.text,r.x,r.y)}}if(i.iconBox||i.verticalIconBox){let n=!(w||!i.verticalIconBox),a;i.iconBox&&(a=n),i.verticalIconBox&&(a=!n),Pa(t.iconCollisionBox.collisionVertexArray,y.icon.placed,a,T.icon,f?r.x:0,f?r.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}},Oe=0x2000000,Ot=0x1000000,Or=131072,Oi=65536,On=0,Oa=class{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,r,i,n,a){let o=this._bucketParts;for(;this._currentTileIndext.sortKey-r.sortKey));this._currentPartIndex!this._forceFullPlacement&&Lu()-n>2;for(;this._currentPlacementIndex>=0;){let n=r[t[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if(C2(n)&&n.layout&&(!n.minzoom||n.minzoom<=o)&&(!n.maxzoom||n.maxzoom>o)){if(this._inProgressLayer||(this._inProgressLayer=new Oa(n)),this._inProgressLayer.continuePlacement(i[n.source],this.placement,this._showCollisionBoxes,n,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}},Os=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ol=new Uint32Array(96),Ou=class t{static from(r){if(!r||void 0===r.byteLength||r.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[i,n]=new Uint8Array(r,0,2);if(219!==i)throw Error("Data does not appear to be in a KDBush format.");let a=n>>4;if(1!==a)throw Error(`Got v${a} data when expected v1.`);let o=Os[15&n];if(!o)throw Error("Unrecognized array type.");let[s]=new Uint16Array(r,2,1),[l]=new Uint32Array(r,4,1);return new t(l,s,o,void 0,r)}constructor(t,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(t)||t<0)throw Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let o=Os.indexOf(this.ArrayType),s=2*t*this.ArrayType.BYTES_PER_ELEMENT,l=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(o<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,t),this.coords=new i(a,8+l+u,2*t),this._pos=2*t,this._finished=!0;else{let a=this.data=new n(8+s+l+u);this.ids=new this.IndexArrayType(a,8,t),this.coords=new i(a,8+l+u,2*t),this._pos=0,this._finished=!1,new Uint8Array(a,0,2).set([219,16+o]),new Uint16Array(a,2,1)[0]=r,new Uint32Array(a,4,1)[0]=t}}add(t,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=r,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw Error(`Added ${t} items when expected ${this.numItems}.`);return function t(r,i,n,a,o,s){if(o-a<=n)return;let l=a+o>>1;(function t(r,i,n,a,o,s){for(;o>a;){if(o-a>600){let l=o-a+1,u=n-a+1,c=Math.log(l),h=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);t(r,i,n,Math.max(a,Math.floor(n-u*h/l+d)),Math.min(o,Math.floor(n+(l-u)*h/l+d)),s)}let l=i[2*n+s],u=a,c=o;for(Ps(r,i,a,n),i[2*o+s]>l&&Ps(r,i,a,o);ul;)c--}i[2*a+s]===l?Ps(r,i,a,c):Ps(r,i,++c,o),c<=n&&(a=c+1),n<=c&&(o=c-1)}})(r,i,l,a,o,s),t(r,i,n,a,l-1,1-s),t(r,i,n,l+1,o,1-s)}(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:o,nodeSize:s}=this;Ol[0]=0,Ol[1]=a.length-1,Ol[2]=0;let l=3,u=[];for(;l>0;){let c=Ol[--l],h=Ol[--l],d=Ol[--l];if(h-d<=s){for(let s=d;s<=h;s++){let l=o[2*s],c=o[2*s+1];l>=t&&l<=i&&c>=r&&c<=n&&u.push(a[s])}continue}let f=d+h>>1,p=o[2*f],m=o[2*f+1];p>=t&&p<=i&&m>=r&&m<=n&&u.push(a[f]),(0===c?t<=p:r<=m)&&(Ol[l++]=d,Ol[l++]=f-1,Ol[l++]=1-c),(0===c?i>=p:n>=m)&&(Ol[l++]=f+1,Ol[l++]=h,Ol[l++]=1-c)}return u}within(t,r,i){let n=[];return this.withinInto(t,r,i,n),n}withinInto(t,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:o,nodeSize:s}=this;Ol[0]=0,Ol[1]=a.length-1,Ol[2]=0;let l=3,u=0,c=i*i;for(;l>0;){let h=Ol[--l],d=Ol[--l],f=Ol[--l];if(d-f<=s){for(let i=f;i<=d;i++)Pu(o[2*i],o[2*i+1],t,r)<=c&&(n[u++]=a[i]);continue}let p=f+d>>1,m=o[2*p],g=o[2*p+1];Pu(m,g,t,r)<=c&&(n[u++]=a[p]),(0===h?t-i<=m:r-i<=g)&&(Ol[l++]=f,Ol[l++]=p-1,Ol[l++]=1-h),(0===h?t+i>=m:r+i>=g)&&(Ol[l++]=p+1,Ol[l++]=d,Ol[l++]=1-h)}return u}},Oc=512/Mf/2,Oh=class{constructor(t,r,i){this.tileID=t,this.bucketInstanceId=i,this._symbolsByKey={};let n=new Map;for(let t=0;t({x:Math.floor(t.anchorX*Oc),y:Math.floor(t.anchorY*Oc)})),crossTileIDs:r.map(t=>t.crossTileID)};if(i.positions.length>128){let t=new Ou(i.positions.length,16,Uint16Array);for(let{x:r,y:n}of i.positions)t.add(r,n);t.finish(),delete i.positions,i.index=t}this._symbolsByKey[t]=i}}getScaledCoordinates(t,r){let{x:i,y:n,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,u=Oc/2**(l-a),c=(o*Mf+t.anchorX)*u,h=(s*Mf+t.anchorY)*u;return{x:Math.floor(c-i*Mf*Oc),y:Math.floor(h-n*Mf*Oc)}}findMatches(t,r,i){let n=this.tileID.canonical.zt)}},Od=class{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}},Of=class{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let r=Math.round((t-this.lng)/360);if(0!==r)for(let t in this.indexes){let i=this.indexes[t],n={};for(let t in i){let a=i[t];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}this.indexes[t]=n}this.lng=t}addBucket(t,r,i){var n,a,o;if(null!=(n=this.indexes[t.overscaledZ])&&n[t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===r.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;tt.overscaledZ)for(let i in n){let a=n[i];a.tileID.isChildOf(t)&&a.findMatches(r.symbolInstances,t,s)}else{let a=n[t.scaledTo(Number(i)).key];a&&a.findMatches(r.symbolInstances,t,s)}}for(let t=0;t> 3)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) { -#ifdef GLOBE -vec3 center_vector=projectToSphere(circle_center); -#endif -float angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else { -#ifdef GLOBE -vec4 projected_center=interpolateProjection(circle_center,center_vector,ele); -#else -vec4 projected_center=projectTileWithElevation(circle_center,ele); -#endif -corner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);} -#ifdef GLOBE -vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele); -#else -gl_Position=projectTileWithElevation(corner_position,ele); -#endif -} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,Ox={prelude:Pc(`#ifdef GL_ES -precision mediump float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -out highp vec4 fragColor;layout(std140) uniform ProjectionUBO {highp mat4 u_projection_matrix;highp mat4 u_projection_fallback_matrix;highp vec4 u_projection_tile_mercator_coords;highp vec4 u_projection_clipping_plane;highp float u_projection_transition;highp int u_projection_clip_antimeridian;};layout(std140) uniform FrameUBO {highp vec2 u_units_to_pixels;highp vec2 u_world_size;highp float u_camera_to_center_distance;highp float u_symbol_fade_change;highp float u_aspect_ratio;highp float u_device_pixel_ratio;highp vec2 u_viewport_size;highp vec2 u_pixel_extrude_scale;highp float u_pitch;};`,`#ifdef GL_ES -precision highp float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const uint packedOpacity) {return vec2(float(packedOpacity >> 1u)/127.0,float(packedOpacity & 1u));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 -);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c -);} -#ifdef TERRAIN3D -uniform sampler2D u_terrain;uniform highp sampler2D u_depth;layout(std140) uniform TerrainUBO {highp mat4 u_terrain_matrix;highp vec4 u_terrain_unpack;highp float u_terrain_dim;highp float u_terrain_exaggeration;}; -#endif -const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { -#ifdef TERRAIN3D -highp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); -#else -return 1.0; -#endif -}float calculate_visibility(vec4 pos) { -#ifdef TERRAIN3D -vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; -#else -return 1.0; -#endif -}float ele(ivec2 pos) { -#ifdef TERRAIN3D -vec4 rgb=(texelFetch(u_terrain,pos,0)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; -#else -return 0.0; -#endif -}float get_elevation(vec2 pos) { -#ifdef TERRAIN3D -#ifdef GLOBE -if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;} -#endif -vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+2.0;vec2 f=fract(coord);ivec2 c=ivec2(floor(coord));ivec2 hi=textureSize(u_terrain,0)-1;float tl=ele(clamp(c,ivec2(0),hi));float tr=ele(clamp(c+ivec2(1,0),ivec2(0),hi));float bl=ele(clamp(c+ivec2(0,1),ivec2(0),hi));float br=ele(clamp(c+ivec2(1,1),ivec2(0),hi));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; -#else -return 0.0; -#endif -}const float PI=3.141592653589793; -#define PROJECTION_UBO -layout(std140) uniform ProjectionUBO {highp mat4 u_projection_matrix;highp mat4 u_projection_fallback_matrix;highp vec4 u_projection_tile_mercator_coords;highp vec4 u_projection_clipping_plane;highp float u_projection_transition;highp int u_projection_clip_antimeridian;};layout(std140) uniform FrameUBO {highp vec2 u_units_to_pixels;highp vec2 u_world_size;highp float u_camera_to_center_distance;highp float u_symbol_fade_change;highp float u_aspect_ratio;highp float u_device_pixel_ratio;highp vec2 u_viewport_size;highp vec2 u_pixel_extrude_scale;highp float u_pitch;};`),projectionMercator:Pc(` -void clipAntimeridian() {}`,"float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:Pc("in highp float v_projection_tile_x;void clipAntimeridian() {if (u_projection_clip_antimeridian !=0 && (v_projection_tile_x < 0.0 || v_projection_tile_x >=8192.0)) {discard;}}",`#define GLOBE_RADIUS 6371008.8 -#ifndef PROJECTION_UBO -uniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix; -#endif -out highp float v_projection_tile_x;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos -);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float t=exp(PI-(mercator_pos_y*PI*2.0));return (2.0*t)/(t*t+1.0);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY);if (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;float spherical_x=mercator_pos.x*PI*2.0+PI;float t=exp(PI-(mercator_pos.y*PI*2.0));float t2=t*t;float denom=t2+1.0;float sin_sy=(t2-1.0)/denom;float cos_sy=(2.0*t)/denom;vec3 pos=vec3(sin(spherical_x)*cos_sy,sin_sy,cos(spherical_x)*cos_sy -);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {v_projection_tile_x=posInTile.x;vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}`),background:Pc(Om,"layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Pc(Og,"uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Pc(Oy,Ov),clippingMask:Pc("void main() {fragColor=vec4(1.0);}","layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Pc(`uniform highp float u_intensity;in vec2 v_extrude; -#pragma maplibre: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma maplibre: initialize highp float weight -float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0); -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;layout(location=0) in ivec2 a_pos;out vec2 v_extrude; -#pragma maplibre: define highp float weight -#pragma maplibre: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma maplibre: initialize highp float weight -#pragma maplibre: initialize mediump float radius -ivec2 pos_raw=a_pos+32768;vec2 unscaled_extrude=vec2(pos_raw & 7)/7.0*2.0-1.0;float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=vec2(pos_raw >> 3); -#ifdef GLOBE -vec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0); -#else -gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center)); -#endif -}`),heatmapTexture:Pc(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity; -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(0.0); -#endif -}`,"uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world_size,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Pc("flat in float v_placed;flat in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","layout(location=0) in vec2 a_anchor_pos;layout(location=1) in vec2 a_placed;layout(location=2) in vec2 a_box_real;flat out float v_placed;flat out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Pc("flat in float v_radius;in vec2 v_extrude;flat in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","layout(location=0) in vec2 a_pos;layout(location=1) in float a_radius;layout(location=2) in vec2 a_flags;flat out float v_radius;out vec2 v_extrude;flat out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:Pc(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {vec4 data=texelFetch(u_elevation_stops,ivec2(stop,0),0)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else -{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0)); -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,"uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=2.0/u_dimension;float scale=(u_dimension.x-4.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:Pc("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","layout(location=0) in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:Pc("void main() {fragColor=vec4(1.0);}",`layout(location=0) in vec2 a_pos;void main() { -#ifdef GLOBE -gl_Position=projectTileFor3D(a_pos,0.0); -#else -gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0); -#endif -}`),fill:Pc(`#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp float opacity -void main() { -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize lowp float opacity -fragColor=color*opacity; -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos; -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp float opacity -void main() { -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize lowp float opacity -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:Pc(`in vec2 v_pos; -#ifdef GLOBE -in float v_depth; -#endif -#pragma maplibre: define highp vec4 outline_color -#pragma maplibre: define lowp float opacity -void main() { -#pragma maplibre: initialize highp vec4 outline_color -#pragma maplibre: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity); -#ifdef GLOBE -if (v_depth > 1.0) {discard;} -#endif -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos; -#ifdef GLOBE -out float v_depth; -#endif -#pragma maplibre: define highp vec4 outline_color -#pragma maplibre: define lowp float opacity -void main() { -#pragma maplibre: initialize highp vec4 outline_color -#pragma maplibre: initialize lowp float opacity -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world_size; -#ifdef GLOBE -v_depth=gl_Position.z/gl_Position.w; -#endif -}`),fillOutlinePattern:Pc(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;uniform bool u_sdf_pattern;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos; -#ifdef GLOBE -in float v_depth; -#endif -#pragma maplibre: define lowp float opacity -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp vec4 pattern_from -#pragma maplibre: define lowp vec4 pattern_to -void main() { -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize mediump vec4 pattern_from -#pragma maplibre: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);if (u_sdf_pattern) {highp float sdf_edge=(256.0-64.0)/256.0;highp float sdf_gamma_a=max(fwidth(color1.a)*0.5,1.0/255.0/16.0);highp float sdf_gamma_b=max(fwidth(color2.a)*0.5,1.0/255.0/16.0);float sdf_alpha_a=smoothstep(sdf_edge-sdf_gamma_a,sdf_edge+sdf_gamma_a,color1.a);float sdf_alpha_b=smoothstep(sdf_edge-sdf_gamma_b,sdf_edge+sdf_gamma_b,color2.a);fragColor=mix(color*sdf_alpha_a,color*sdf_alpha_b,u_fade)*alpha*opacity;} else {fragColor=mix(color1,color2,u_fade)*alpha*opacity;} -#ifdef GLOBE -if (v_depth > 1.0) {discard;} -#endif -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos; -#ifdef GLOBE -out float v_depth; -#endif -#pragma maplibre: define lowp float opacity -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp vec4 pattern_from -#pragma maplibre: define lowp vec4 pattern_to -#pragma maplibre: define lowp float pixel_ratio_from -#pragma maplibre: define lowp float pixel_ratio_to -void main() { -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize mediump vec4 pattern_from -#pragma maplibre: initialize mediump vec4 pattern_to -#pragma maplibre: initialize lowp float pixel_ratio_from -#pragma maplibre: initialize lowp float pixel_ratio_to -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world_size; -#ifdef GLOBE -v_depth=gl_Position.z/gl_Position.w; -#endif -}`),fillPattern:Pc(`#ifdef GL_ES -precision highp float; -#endif -uniform vec2 u_texsize;uniform float u_fade;uniform bool u_sdf_pattern;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b; -#pragma maplibre: define lowp float opacity -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp vec4 pattern_from -#pragma maplibre: define lowp vec4 pattern_to -void main() { -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize mediump vec4 pattern_from -#pragma maplibre: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);if (u_sdf_pattern) {highp float sdf_edge=(256.0-64.0)/256.0;highp float sdf_gamma_a=max(fwidth(color1.a)*0.5,1.0/255.0/16.0);highp float sdf_gamma_b=max(fwidth(color2.a)*0.5,1.0/255.0/16.0);float sdf_alpha_a=smoothstep(sdf_edge-sdf_gamma_a,sdf_edge+sdf_gamma_a,color1.a);float sdf_alpha_b=smoothstep(sdf_edge-sdf_gamma_b,sdf_edge+sdf_gamma_b,color2.a);fragColor=mix(color*sdf_alpha_a,color*sdf_alpha_b,u_fade)*opacity;} else {fragColor=mix(color1,color2,u_fade)*opacity;} -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b; -#pragma maplibre: define lowp float opacity -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp vec4 pattern_from -#pragma maplibre: define lowp vec4 pattern_to -#pragma maplibre: define lowp float pixel_ratio_from -#pragma maplibre: define lowp float pixel_ratio_to -void main() { -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize mediump vec4 pattern_from -#pragma maplibre: initialize mediump vec4 pattern_to -#pragma maplibre: initialize lowp float pixel_ratio_from -#pragma maplibre: initialize lowp float pixel_ratio_to -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Pc(`in vec4 v_color;void main() {fragColor=v_color; -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;layout(location=1) in ivec4 a_normal_ed; -#ifdef TERRAIN3D -layout(location=2) in vec2 a_centroid; -#endif -out vec4 v_color; -#pragma maplibre: define highp float base -#pragma maplibre: define highp float height -#pragma maplibre: define highp vec4 color -void main() { -#pragma maplibre: initialize highp float base -#pragma maplibre: initialize highp float height -#pragma maplibre: initialize highp vec4 color -vec3 normal=vec3(a_normal_ed.xyz); -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; -#ifdef GLOBE -vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); -#else -gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); -#endif -float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0); -#ifdef GLOBE -mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition); -#endif -directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Pc(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting; -#pragma maplibre: define lowp float base -#pragma maplibre: define lowp float height -#pragma maplibre: define lowp vec4 pattern_from -#pragma maplibre: define lowp vec4 pattern_to -#pragma maplibre: define lowp float pixel_ratio_from -#pragma maplibre: define lowp float pixel_ratio_to -void main() { -#pragma maplibre: initialize lowp float base -#pragma maplibre: initialize lowp float height -#pragma maplibre: initialize mediump vec4 pattern_from -#pragma maplibre: initialize mediump vec4 pattern_to -#pragma maplibre: initialize lowp float pixel_ratio_from -#pragma maplibre: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting; -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;layout(location=0) in vec2 a_pos;layout(location=1) in ivec4 a_normal_ed; -#ifdef TERRAIN3D -layout(location=2) in vec2 a_centroid; -#endif -#ifdef GLOBE -out vec3 v_sphere_pos; -#endif -out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting; -#pragma maplibre: define lowp float base -#pragma maplibre: define lowp float height -#pragma maplibre: define lowp vec4 pattern_from -#pragma maplibre: define lowp vec4 pattern_to -#pragma maplibre: define lowp float pixel_ratio_from -#pragma maplibre: define lowp float pixel_ratio_to -void main() { -#pragma maplibre: initialize lowp float base -#pragma maplibre: initialize lowp float height -#pragma maplibre: initialize mediump vec4 pattern_from -#pragma maplibre: initialize mediump vec4 pattern_to -#pragma maplibre: initialize lowp float pixel_ratio_from -#pragma maplibre: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=vec3(a_normal_ed.xyz);float edgedistance=float(a_normal_ed.w);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate; -#ifdef GLOBE -vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation); -#else -gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0); -#endif -vec2 pos=a_normal_ed.x==1 && a_normal_ed.y==0 && a_normal_ed.z==16384 -? a_pos -: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Pc(`#ifdef GL_ES -precision highp float; -#endif -uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(ivec2 texel) {vec4 data=texelFetch(u_image,texel,0)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {ivec2 pos=ivec2(gl_FragCoord.xy)+ivec2(1);float tileSize=u_dimension.x-4.0;float a=getElevation(pos+ivec2(-1,-1));float b=getElevation(pos+ivec2(0,-1));float c=getElevation(pos+ivec2(1,-1));float d=getElevation(pos+ivec2(-1,0));float e=getElevation(pos);float f=getElevation(pos+ivec2(1,0));float g=getElevation(pos+ivec2(-1,1));float h=getElevation(pos+ivec2(0,1));float i=getElevation(pos+ivec2(1,1));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0); -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;layout(location=0) in vec2 a_pos;layout(location=1) 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:Pc(`uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES]; -#define PI 3.141592653589793 -#define STANDARD 0 -#define COMBINED 1 -#define IGOR 2 -#define MULTIDIRECTIONAL 3 -#define BASIC 4 -float get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else -{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else -{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec2 size=vec2(textureSize(u_image,0));vec2 texturePos=(v_pos*(size-2.0)+1.0)/size;vec4 pixel=texture(u_image,texturePos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);} -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,"uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:Pc(`flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale; -#ifdef GLOBE -in float v_depth; -#endif -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -void main() { -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity); -#ifdef GLOBE -if (v_depth > 1.0) {discard;} -#endif -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar; -#ifdef GLOBE -out float v_depth; -#endif -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -#pragma maplibre: define mediump float gapwidth -#pragma maplibre: define lowp float offset -#pragma maplibre: define mediump float width -void main() { -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize mediump float gapwidth -#pragma maplibre: initialize lowp float offset -#pragma maplibre: initialize mediump float width -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);v_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*2.0;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; -#ifdef GLOBE -v_depth=gl_Position.z/gl_Position.w; -#endif -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),lineGradient:Pc(`uniform sampler2D u_image;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv; -#ifdef GLOBE -in float v_depth; -#endif -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -void main() { -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity); -#ifdef GLOBE -if (v_depth > 1.0) {discard;} -#endif -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_image_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv; -#ifdef GLOBE -out float v_depth; -#endif -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -#pragma maplibre: define mediump float gapwidth -#pragma maplibre: define lowp float offset -#pragma maplibre: define mediump float width -void main() { -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize mediump float gapwidth -#pragma maplibre: initialize lowp float offset -#pragma maplibre: initialize mediump float width -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; -#ifdef GLOBE -v_depth=gl_Position.z/gl_Position.w; -#endif -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),linePattern:Pc(`#ifdef GL_ES -precision highp float; -#endif -uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;flat in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;flat in float v_width; -#ifdef GLOBE -in float v_depth; -#endif -#pragma maplibre: define lowp vec4 pattern_from -#pragma maplibre: define lowp vec4 pattern_to -#pragma maplibre: define lowp float pixel_ratio_from -#pragma maplibre: define lowp float pixel_ratio_to -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -void main() { -#pragma maplibre: initialize mediump vec4 pattern_from -#pragma maplibre: initialize mediump vec4 pattern_to -#pragma maplibre: initialize lowp float pixel_ratio_from -#pragma maplibre: initialize lowp float pixel_ratio_to -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -clipAntimeridian();vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity; -#ifdef GLOBE -if (v_depth > 1.0) {discard;} -#endif -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;flat out float v_width; -#ifdef GLOBE -out float v_depth; -#endif -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -#pragma maplibre: define lowp float offset -#pragma maplibre: define mediump float gapwidth -#pragma maplibre: define mediump float width -#pragma maplibre: define lowp float floorwidth -#pragma maplibre: define lowp vec4 pattern_from -#pragma maplibre: define lowp vec4 pattern_to -#pragma maplibre: define lowp float pixel_ratio_from -#pragma maplibre: define lowp float pixel_ratio_to -void main() { -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize lowp float offset -#pragma maplibre: initialize mediump float gapwidth -#pragma maplibre: initialize mediump float width -#pragma maplibre: initialize lowp float floorwidth -#pragma maplibre: initialize mediump vec4 pattern_from -#pragma maplibre: initialize mediump vec4 pattern_to -#pragma maplibre: initialize lowp float pixel_ratio_from -#pragma maplibre: initialize lowp float pixel_ratio_to -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; -#ifdef GLOBE -v_depth=gl_Position.z/gl_Position.w; -#endif -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Pc(`uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale; -#ifdef GLOBE -in float v_depth; -#endif -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -#pragma maplibre: define mediump float width -#pragma maplibre: define lowp float floorwidth -#pragma maplibre: define mediump vec4 dasharray_from -#pragma maplibre: define mediump vec4 dasharray_to -void main() { -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize mediump float width -#pragma maplibre: initialize lowp float floorwidth -#pragma maplibre: initialize mediump vec4 dasharray_from -#pragma maplibre: initialize mediump vec4 dasharray_to -clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity); -#ifdef GLOBE -if (v_depth > 1.0) {discard;} -#endif -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale; -#ifdef GLOBE -out float v_depth; -#endif -#pragma maplibre: define highp vec4 color -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -#pragma maplibre: define mediump float gapwidth -#pragma maplibre: define lowp float offset -#pragma maplibre: define mediump float width -#pragma maplibre: define lowp float floorwidth -#pragma maplibre: define mediump vec4 dasharray_from -#pragma maplibre: define mediump vec4 dasharray_to -void main() { -#pragma maplibre: initialize highp vec4 color -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize mediump float gapwidth -#pragma maplibre: initialize lowp float offset -#pragma maplibre: initialize mediump float width -#pragma maplibre: initialize lowp float floorwidth -#pragma maplibre: initialize mediump vec4 dasharray_from -#pragma maplibre: initialize mediump vec4 dasharray_to -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; -#ifdef GLOBE -v_depth=gl_Position.z/gl_Position.w; -#endif -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),lineGradientSDF:Pc(`uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;flat in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv; -#ifdef GLOBE -in float v_depth; -#endif -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -#pragma maplibre: define mediump float width -#pragma maplibre: define lowp float floorwidth -#pragma maplibre: define mediump vec4 dasharray_from -#pragma maplibre: define mediump vec4 dasharray_to -void main() { -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize mediump float width -#pragma maplibre: initialize lowp float floorwidth -#pragma maplibre: initialize mediump vec4 dasharray_from -#pragma maplibre: initialize mediump vec4 dasharray_to -clipAntimeridian();float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity); -#ifdef GLOBE -if (v_depth > 1.0) {discard;} -#endif -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;layout(location=2) in float a_uv_x;layout(location=3) in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b; -#ifdef GLOBE -out float v_depth; -#endif -#pragma maplibre: define lowp float blur -#pragma maplibre: define lowp float opacity -#pragma maplibre: define mediump float gapwidth -#pragma maplibre: define lowp float offset -#pragma maplibre: define mediump float width -#pragma maplibre: define lowp float floorwidth -#pragma maplibre: define mediump vec4 dasharray_from -#pragma maplibre: define mediump vec4 dasharray_to -void main() { -#pragma maplibre: initialize lowp float blur -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize mediump float gapwidth -#pragma maplibre: initialize lowp float offset -#pragma maplibre: initialize mediump float width -#pragma maplibre: initialize lowp float floorwidth -#pragma maplibre: initialize mediump vec4 dasharray_from -#pragma maplibre: initialize mediump vec4 dasharray_to -if (opacity < 0.01) {gl_Position=vec4(-2.0,-2.0,-2.0,1.0);return;}float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(ivec2(a_data.xy)-128);float a_direction=float(int(a_data.z & 3u)-1);float a_linesofar=float((a_data.z >> 2u)+a_data.w*64u)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=vec2(a_pos_normal >> 1);mediump vec2 normal=vec2(a_pos_normal & 1);normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude; -#ifdef GLOBE -v_depth=gl_Position.z/gl_Position.w; -#endif -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -float u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}`),layerOpacity:Pc(`uniform sampler2D u_image;uniform float u_opacity;in vec2 v_pos;void main() {fragColor=texture(u_image,v_pos)*u_opacity; -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(0.0); -#endif -}`,"layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos.x*2.0-1.0,1.0-a_pos.y*2.0,0.0,1.0);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),raster:Pc(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec3 v_pos0;in vec3 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0.xy/v_pos0.z);vec4 color1=texture(u_image1,v_pos1.xy/v_pos1.z);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec3 u_image_warp;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;layout(location=0) in vec2 a_pos;out vec3 v_pos0;out vec3 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 topLeft=u_coords_top.xy;vec2 topRight=u_coords_top.zw;vec2 bottomLeft=u_coords_bottom.xy;vec2 bottomRight=u_coords_bottom.zw;vec2 bilinearPos=mix(mix(topLeft,topRight,fractionalPos.x),mix(bottomLeft,bottomRight,fractionalPos.x),fractionalPos.y);float denominator=dot(u_image_warp.xy,fractionalPos)+1.0;vec2 acrossTop=topRight-topLeft+u_image_warp.x*topRight;vec2 downLeft=bottomLeft-topLeft+u_image_warp.y*bottomLeft;vec2 projectivePos=(acrossTop*fractionalPos.x+downLeft*fractionalPos.y+topLeft)/denominator;vec2 position=mix(projectivePos,bilinearPos,u_image_warp.z);gl_Position=projectTile(position,position);vec2 texturePos=((fractionalPos-0.5)/u_buffer_scale)+0.5; -#ifdef GLOBE -if (a_pos.y <-32767.5) {texturePos.y=0.0;}if (a_pos.y > 32766.5) {texturePos.y=1.0;} -#endif -float perspectiveRatio=mix(1.0/denominator,1.0,u_image_warp.z);v_pos0=vec3(texturePos*perspectiveRatio,perspectiveRatio);vec2 parentPos=(texturePos*u_scale_parent)+u_tl_parent;v_pos1=vec3(parentPos*perspectiveRatio,perspectiveRatio);}`),symbolIcon:Pc(`uniform sampler2D u_texture;in vec2 v_tex;flat in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity; -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in uint a_fade_opacity;layout(location=5) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform bool u_rotate_symbol;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec2 v_tex;flat out float v_total_opacity; -#pragma maplibre: define lowp float opacity -void main() { -#pragma maplibre: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float visibility=calculate_visibility(projectedPoint);v_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; -#ifdef GLOBE -if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} -#endif -vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:Pc(`#define SDF_PX 8.0 -uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1; -#pragma maplibre: define highp vec4 fill_color -#pragma maplibre: define highp vec4 halo_color -#pragma maplibre: define lowp float halo_width -#pragma maplibre: define lowp float halo_blur -void main() { -#pragma maplibre: initialize highp vec4 fill_color -#pragma maplibre: initialize highp vec4 halo_color -#pragma maplibre: initialize lowp float halo_width -#pragma maplibre: initialize lowp float halo_blur -float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float total_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out_text,color_alpha_out_halo;if (u_is_plain){highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);color_alpha_out_text=total_opacity*alpha*fill_color;}if (u_is_halo) {float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);float inner_edge_halo=inner_edge+gamma_halo*gamma_scale;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(inner_edge_halo-gamma_scaled_halo,inner_edge_halo+gamma_scaled_halo,dist);highp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha_halo= min(smoothstep(halo_edge-gamma_scaled_halo,halo_edge+gamma_scaled_halo,dist),1.0-alpha_halo);color_alpha_out_halo=total_opacity*alpha_halo*halo_color;}if (u_is_plain && u_is_halo) {fragColor=color_alpha_out_text+(1.-color_alpha_out_text.a)*color_alpha_out_halo;} else if (u_is_halo){fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out_text;} -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec4 a_pixeloffset;layout(location=3) in vec3 a_projected_pos;layout(location=4) in uint a_fade_opacity;layout(location=5) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform bool u_rotate_symbol;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec2 v_data0;out vec3 v_data1; -#pragma maplibre: define highp vec4 fill_color -#pragma maplibre: define highp vec4 halo_color -#pragma maplibre: define lowp float opacity -#pragma maplibre: define lowp float halo_width -#pragma maplibre: define lowp float halo_blur -void main() { -#pragma maplibre: initialize highp vec4 fill_color -#pragma maplibre: initialize highp vec4 halo_color -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize lowp float halo_width -#pragma maplibre: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);vec2 a_pxoffset=a_pixeloffset.xy/16.0;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; -#ifdef GLOBE -if(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} -#endif -vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}`),symbolTextAndIcon:Pc(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;in vec4 v_data0;in vec3 v_data1;flat in float v_is_sdf; -#pragma maplibre: define highp vec4 fill_color -#pragma maplibre: define highp vec4 halo_color -#pragma maplibre: define lowp float halo_width -#pragma maplibre: define lowp float halo_blur -void main() { -#pragma maplibre: initialize highp vec4 fill_color -#pragma maplibre: initialize highp vec4 halo_color -#pragma maplibre: initialize lowp float halo_width -#pragma maplibre: initialize lowp float halo_blur -float total_opacity=v_data1[2];if (v_is_sdf==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity; -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;lowp float dist=texture(u_texture,tex).a;lowp vec4 color_alpha_out,color_alpha_out_halo;if (u_is_text) {highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);color_alpha_out=fill_color*(alpha*total_opacity);}if (u_is_halo) {highp float gamma_halo=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);lowp float buff_halo=(6.0-halo_width/fontScale)/SDF_PX;highp float gamma_scaled_halo=gamma_halo*gamma_scale;highp float alpha_halo=smoothstep(buff_halo-gamma_scaled_halo,buff_halo+gamma_scaled_halo,dist);color_alpha_out_halo=halo_color*(alpha_halo*total_opacity);}if (u_is_text && u_is_halo) {fragColor=color_alpha_out+(1.-color_alpha_out.a)*color_alpha_out_halo;} else if (u_is_halo) {fragColor=color_alpha_out_halo;} else {fragColor=color_alpha_out;} -#ifdef OVERDRAW_INSPECTOR -fragColor=vec4(1.0); -#endif -}`,`layout(location=0) in vec4 a_pos_offset;layout(location=1) in uvec4 a_data;layout(location=2) in vec3 a_projected_pos;layout(location=3) in uint a_fade_opacity;layout(location=4) in float a_height_offset;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;uniform bool u_is_offset;uniform bool u_height_anchor_ground;out vec4 v_data0;out vec3 v_data1;flat out float v_is_sdf; -#pragma maplibre: define highp vec4 fill_color -#pragma maplibre: define highp vec4 halo_color -#pragma maplibre: define lowp float opacity -#pragma maplibre: define lowp float halo_width -#pragma maplibre: define lowp float halo_blur -void main() { -#pragma maplibre: initialize highp vec4 fill_color -#pragma maplibre: initialize highp vec4 halo_color -#pragma maplibre: initialize lowp float opacity -#pragma maplibre: initialize lowp float halo_width -#pragma maplibre: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=vec2(a_data.xy);vec2 a_size=vec2(a_data.zw);float a_size_min=float(a_data.z >> 1u);float is_sdf=float(a_data.z & 1u);float ele=a_height_offset+(u_height_anchor_ground ? get_elevation(a_pos) : 0.0);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_symbol_fade_change :-u_symbol_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);if (!u_is_offset) {size*=perspective_ratio;}float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0; -#ifdef GLOBE -if(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);} -#endif -vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec3(gamma_scale,size,total_opacity);v_is_sdf=is_sdf;}`),terrain:Pc("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && u_fog_ground_blend_opacity > 0.0 && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","layout(location=0) in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Pc("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","layout(location=0) in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),atmosphere:Pc(`#ifdef GL_ES -precision highp float; -#endif -in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758 -);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}`,"layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Pc("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;uniform vec3 u_globe_position;uniform float u_globe_radius;in vec3 v_view_direction;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (u_sky_blend > 0.0) {vec3 ray=normalize(v_view_direction);float globe_distance=length(u_globe_position);float angle_to_globe_center=acos(clamp(dot(ray,u_globe_position)/globe_distance,-1.0,1.0));float horizon_angle=asin(min(u_globe_radius/globe_distance,1.0));blend=mix(blend,(angle_to_globe_center-horizon_angle)*u_camera_to_center_distance*u_device_pixel_ratio,u_sky_blend);}if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","layout(location=0) in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 v_view_direction;void main() {v_view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,1.0,1.0);}")},Ob=class{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return"mercator"}get shaderDefine(){return"#define PROJECTION_MERCATOR"}get shaderPreludeCode(){return Ox.projectionMercator}get vertexShaderPreludeCode(){return Ox.projectionMercator.vertexSource}get subdivisionGranularity(){return Dz.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}destroy(){}getMeshFromTileID(t,r,i,n,a){if(this._cachedMesh)return this._cachedMesh;let o=new Es;o.emplaceBack(0,0),o.emplaceBack(Mf,0),o.emplaceBack(0,Mf),o.emplaceBack(Mf,Mf);let s=t.createVertexBuffer(o,Fz.members),l=ED.simpleSegment(0,0,4,2),u=new EA;u.emplaceBack(1,0,2),u.emplaceBack(1,2,3);let c=t.createIndexBuffer(u);return this._cachedMesh=new FP(s,c,l),this._cachedMesh}recalculate(){}hasTransition(){return!1}},O_=class t{constructor(t=0,r=0,i=0,n=0){if(isNaN(t)||t<0||isNaN(r)||r<0||isNaN(i)||i<0||isNaN(n)||n<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=r,this.left=i,this.right=n}interpolate(t,r,i){return null!=r.top&&null!=t.top&&(this.top=kx.number(t.top,r.top,i)),null!=r.bottom&&null!=t.bottom&&(this.bottom=kx.number(t.bottom,r.bottom,i)),null!=r.left&&null!=t.left&&(this.left=kx.number(t.left,r.left,i)),null!=r.right&&null!=t.right&&(this.right=kx.number(t.right,r.right,i)),this}getCenter(t,r){return new vu(xr((this.left+t-this.right)/2,0,t),xr((this.top+r-this.bottom)/2,0,r))}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new t(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}},Ow=class{constructor(t,r){var i;this.applyConstrain=(t,r)=>null===this._constrainOverride?this._callbacks.defaultConstrain(t,r):this._constrainOverride(t,r),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=r?.renderWorldCopies===void 0||!!r?.renderWorldCopies,this._minZoom=r?.minZoom||0,this._maxZoom=r?.maxZoom||22,this._minPitch=r?.minPitch===void 0||r?.minPitch===null?0:r?.minPitch,this._maxPitch=r?.maxPitch===void 0||r?.maxPitch===null?60:r?.maxPitch,this._constrainOverride=null!=(i=r?.constrainOverride)?i:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new DQ(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Pd(this._zoom),this._scale=xo(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new O_,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,r,i){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=Pd(this._zoom),this._scale=xo(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new O_(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!i&&t.autoCalculateNearFarZ,r&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){if(this._minZoom===t)return;this._minZoom=t;let r=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=r}get maxZoom(){return this._maxZoom}setMaxZoom(t){if(this._maxZoom===t)return;this._maxZoom=t;let r=this._unmodified;this.setZoom(this.applyConstrain(this._center,this.zoom).zoom),this._unmodified=r}get minPitch(){return this._minPitch}setMinPitch(t){if(this._minPitch===t)return;this._minPitch=t;let r=this._unmodified;this.setPitch(Math.max(this.pitch,t)),this._unmodified=r}get maxPitch(){return this._maxPitch}setMaxPitch(t){if(this._maxPitch===t)return;this._maxPitch=t;let r=this._unmodified;this.setPitch(Math.min(this.pitch,t)),this._unmodified=r}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){void 0===t&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new vu(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){var r,i,n,a,o,s,l,u,c;let h=xi(t,-180,180)*Math.PI/180;this._bearingInRadians!==h&&(this._unmodified=!1,this._bearingInRadians=h,this._calcMatrices(),this._rotationMatrix=Ll(),r=this._rotationMatrix,i=this._rotationMatrix,n=-this._bearingInRadians,a=i[0],o=i[1],s=i[2],l=i[3],u=Math.sin(n),c=Math.cos(n),r[0]=a*c+s*u,r[1]=o*c+l*u,r[2]=-(a*u)+s*c,r[3]=-(o*u)+l*c)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){let r=xr(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==r&&(this._unmodified=!1,this._pitchInRadians=r,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){let r=t/180*Math.PI;this._rollInRadians!==r&&(this._unmodified=!1,this._rollInRadians=r,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return xx(this._fovInRadians)}setFov(t){t=xr(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=xv(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){let r=this.applyConstrain(this._center,t).zoom;this._zoom!==r&&(this._unmodified=!1,this._zoom=r,this._tileZoom=Math.max(0,Math.floor(r)),this._scale=xo(r),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){(t.lat!==this._center.lat||t.lng!==this._center.lng)&&(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,r){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=r,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,r,i){this._unmodified=!1,this._edgeInsets.interpolate(t,r,i),this.constrainInternal(),this._calcMatrices()}resize(t,r,i=!0){this._width=t,this._height=r,i&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){var t,r;return(null==(t=this._latRange)?void 0:t.length)!==2||(null==(r=this._lngRange)?void 0:r.length)!==2?null:new FA([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-Mb,Mb])}getCameraQueryGeometry(t,r){if(1===r.length)return[r[0],t];{let{minX:i,minY:n,maxX:a,maxY:o}=DW.fromPoints(r).extend(t);return[new vu(i,n),new vu(a,n),new vu(a,o),new vu(i,o),new vu(i,n)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:r,zoom:i}=this.applyConstrain(this.center,this.zoom);this.setCenter(r),this.setZoom(i),this._unmodified=t,this._constraining=!1}_calcMatrices(){if(this._pixelPerMeter=1/w9(this.center.lat)*this.worldSize,!this._width||!this._height)return;this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=vm(new Float64Array(16));vx(t,t,[this._width/2,-this._height/2,1]),vv(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,vx(t=vm(new Float64Array(16)),t,[1,-1,1]),vv(t,t,[-1,-1,0]),vx(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t;let r=this.fovInRadians/2;this._cameraToCenterDistance=.5/Math.tan(r)*this._height,this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,r,i,n){let a=void 0===i?this.bearing:i,o=n=void 0===n?this.pitch:n,{distanceToCenter:s,clampedElevation:l}=this._distanceToCenterFromAltElevationPitch(r,this.elevation,o),{x:u,y:c}=Tc(o,a),h=D1.fromLngLat(t,r),d=+w9(Ti(h.y)),f,p,m=0;do{if((m+=1)>10)break;let t=u*(p=s/d),r=c*p;d=1/(f=new D1(h.x+t,h.y+r)).meterInMercatorCoordinateUnits()}while(Math.abs(s-p*d)>1e-12);return{center:f.toLngLat(),elevation:l,zoom:xs(this.height/2/Math.tan(this.fovInRadians/2)/p/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;let r=1/this.worldSize,i=1/w9(this.center.lat)*this.worldSize,n=D1.fromLngLat(this.center,this.elevation),a=n.x/r,o=n.y/r,s=n.z/r,l=this.pitch,{x:u,y:c,z:h}=Tc(l,this.bearing),d=this.cameraToCenterDistance,{distanceToCenter:f,clampedElevation:p}=this._distanceToCenterFromAltElevationPitch((s+d*h)/i,t,l),m=f*i,g=new D1((a+-(d*u)+u*m)*r,(o+-(d*c)+c*m)*r,0).toLngLat(),y=1/w9(g.lat),v=xs(this.height/2/Math.tan(this.fovInRadians/2)/f/y/this.tileSize);this._elevation=p,this._center=g,this.setZoom(v)}_distanceToCenterFromAltElevationPitch(t,r,i){let n=-Math.cos(xv(i)),a=t-r,o,s=r;return n*a>=0||.1>Math.abs(n)?s=t+(o=1e4)*n:o=-a/n,{distanceToCenter:o,clampedElevation:s}}getCameraPoint(){let t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new vu(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];let r=t.canonical.z>=0?1<i}allowWorldCopies(){return!0}prepareNextFrame(){}},OA=wi([{name:"a_pos3d",type:"Int16",components:3}]),OM=class extends MP{constructor(t){super(),this._lastTilesetChange=Lu(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(t,r){this.tileManager.update(t,r),this._renderableTilesKeys=[];let i={},n=!1;for(let a of L$(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r,calculateTileZoom:this.tileManager._source.calculateTileZoom}))i[a.key]=!0,this._renderableTilesKeys.push(a.key),this._tiles[a.key]||(a.terrainRttPosMatrix32f=new Float32Array(16),Ms(a.terrainRttPosMatrix32f,0,Mf,Mf,0,0,1),this._tiles[a.key]=new FH(a,this.tileSize),this._lastTilesetChange=Lu(),n=!0);for(let t in this._tiles)i[t]||(this._tiles[t].releaseRTT(this.tileManager.map.painter),delete this._tiles[t],n=!0);return n}releaseRTT(t){for(let r in this._tiles){let i=this._tiles[r];(i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&i.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let t in this._tiles)this._tiles[t].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,r){return r?this._getTerrainCoordsForTileRanges(t,r):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){let r={};for(let i of this._renderableTilesKeys){let n=this._tiles[i].tileID,a=t.clone(),o=v1();if(n.canonical.equals(t.canonical))Ms(o,0,Mf,Mf,0,0,1);else if(n.canonical.isChildOf(t.canonical)){let r=n.canonical.z-t.canonical.z,i=n.canonical.x-(n.canonical.x>>r<>r<>r;Ms(o,0,s,s,0,0,1),vv(o,o,[-i*s,-a*s,0])}else{if(!t.canonical.isChildOf(n.canonical))continue;let r=t.canonical.z-n.canonical.z,i=t.canonical.x-(t.canonical.x>>r<>r<>r;Ms(o,0,Mf,Mf,0,0,1),vv(o,o,[i*s,a*s,0]),vx(o,o,[1/2**r,1/2**r,0])}a.terrainRttPosMatrix32f=new Float32Array(o),r[i]=a}return r}_getTerrainCoordsForTileRanges(t,r){let i={};for(let n of this._renderableTilesKeys){let a=this._tiles[n].tileID;if(!this._isWithinTileRanges(a,r))continue;let o=t.clone(),s=v1();if(a.canonical.z===t.canonical.z){let r=t.canonical.x-a.canonical.x+t.wrap*(1<t.canonical.z){let r=a.canonical.z-t.canonical.z,i=a.canonical.x-(a.canonical.x>>r<>r<>r),l=t.canonical.y-(a.canonical.y>>r),u=Mf>>r;Ms(s,0,u,u,0,0,1),vv(s,s,[-i*u+o*Mf,-n*u+l*Mf,0])}else{let r=t.canonical.z-a.canonical.z,i=t.canonical.x-(t.canonical.x>>r<>r<>r)-a.canonical.x,l=(t.canonical.y>>r)-a.canonical.y,u=Mf<a.maxzoom&&(o=a.maxzoom),o=a.minzoom&&!s?.dem;)s=this.findTileInCaches(t.scaledTo(o--).key);return s}findTileInCaches(t){let r=this.tileManager.getTileByID(t);return r||(r=this.tileManager._outOfViewCache.getByKey(t))}anyTilesAfterTime(t=Lu()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,r){let i=r[t.canonical.z];return!!i&&(t.wrap>i.minWrap||t.wrap=i.minTileXWrapped&&t.canonical.x<=i.maxTileXWrapped&&t.canonical.y>=i.minTileY&&t.canonical.y<=i.maxTileY)}},Ok=Mf*(1-1e-12),OS=class{constructor(t,r,i,n="auto"){this._meshCache={},this.painter=t,this.tileManager=new OM(r),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this._terrainSkirtLength=n,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this._elevationSamplerCache=new Map}destroy(){for(let t in this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null)),this._meshCache)this._meshCache[t].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(t,r,i,n=Mf){let a=t.normalizeCoordinates(r,i,n);if(!a)return 0;let o=this.getElevationSampler(a.tileID);return o?o(a.x,a.y,n):0}getElevationForLngLatZoom(t,r){if(!At(r,t.wrap()))return 0;let{tileID:i,mercatorX:n,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,r);return this.getElevation(i,n%Mf,a%Mf,Mf)}getElevationForLngLat(t,r){let i=this.getCoverageIndex();if(i){let r=D1.fromLngLat(t),n=Pf(i,this.exaggeration,r.x,r.y);if(n.demLoaded)return n.elevation}let n=L$(r,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),a=0;for(let t of n)t.canonical.z>a&&(a=Math.min(t.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,a)}getElevation(t,r,i,n=Mf){return this.getDEMElevation(t,r,i,n)*this.exaggeration}resetElevationCache(){this._elevationSamplerCache.clear(),this._coverageIndex=void 0}getCoverageIndex(){return void 0===this._coverageIndex&&(this._coverageIndex=this._buildCoverageIndex()),this._coverageIndex}_buildCoverageIndex(){let t=[],r=new Map,i=0,n=0;for(let a of this.tileManager.getRenderableTiles()){if(!a)continue;let{canonical:o,wrap:s}=a.tileID;t.includes(o.z)||t.push(o.z);let l=this.getElevationSampler(a.tileID);r.set(`${s}/${o.z}/${o.x}/${o.y}`,l);let{minElevation:u,maxElevation:c}=this.getMinMaxElevation(a.tileID);i=Math.min(i,u??0),n=Math.max(n,c??0)}return 0===r.size?null:(t.sort((t,r)=>r-t),{zooms:t,samplerPerTile:r,minElevation:i-10,maxElevation:n+10})}getElevationSampler(t){let r=t.key,i=this._elevationSamplerCache.get(r);if(i)return i;let n=this.tileManager.getSourceTile(t,!0),a=n?.dem;if(!n||!a)return null;let o=this._getDEMTileMatrix(t,n),s=o[0]*a.dim,l=o[5]*a.dim,u=o[12]*a.dim,c=o[13]*a.dim,h=(t,r,i)=>{let n=8192===i?1:Mf/i;return a.sampleBilinear(t*n*s+u,r*n*l+c)};return this._elevationSamplerCache.set(r,h),h}_getDEMTileMatrix(t,r){var i,n;let a=`${r.tileID.key}/${t.key}`,o=this._demMatrixCache.get(a);if(o)return o;let s=this.tileManager.getSource().maxzoom,l=t.canonical.z-r.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=s?l=t.canonical.z-s:xf("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let u=t.canonical.x-(t.canonical.x>>l<>l<0,n=i&&0===t.canonical.y,a=i&&t.canonical.y===(1<{r=xr(+r,this.minZoom,this.maxZoom);let i={center:new DQ(t.lng,t.lat),zoom:r},n=this._helper._lngRange;this._helper._renderWorldCopies||null!==n||(n=[-179.9999999999,180-1e-10]);let a=this.tileSize*xo(i.zoom),o=0,s=a,l=0,u=a,c=0,h=0,{x:d,y:f}=this.size;if(this._helper._latRange){let t=this._helper._latRange;o=Tt(t[1])*a,(s=Tt(t[0])*a)-os&&(y=s-t)}if(n){let t=(l+u)/2,r=p;this._helper._renderWorldCopies&&(r=xi(p,t-a/2,t+a/2));let i=d/2;r-iu&&(g=u-i)}return(void 0!==g||void 0!==y)&&(i.center=To(a,new vu(g??p,y??m)).wrap()),i},this.applyConstrain=(t,r)=>this._helper.applyConstrain(t,r),this._helper=new Ow({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,r)=>this.defaultConstrain(t,r)},t),this._coveringTilesDetailsProvider=new OT}clone(){let r=new t;return r.apply(this,!1),r}apply(t,r,i){this._helper.apply(t,r,i)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){let r=[new In(0,t)];if(this._helper._renderWorldCopies){let i=this.screenPointToMercatorCoordinate(new vu(0,0)),n=this.screenPointToMercatorCoordinate(new vu(this._helper._width,0)),a=this.screenPointToMercatorCoordinate(new vu(this._helper._width,this._helper._height)),o=this.screenPointToMercatorCoordinate(new vu(0,this._helper._height)),s=Math.floor(Math.min(i.x,n.x,a.x,o.x)),l=Math.floor(Math.max(i.x,n.x,a.x,o.x));for(let i=s-1;i<=l+1;i++)0!==i&&r.push(new In(i,t))}return r}getCameraFrustum(){return FY.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){let r=this.screenPointToLocation(this.centerPoint,t),i=t?t.getElevationForLngLat(r,this):0;this._helper.recalculateZoomAndCenter(i)}setLocationAtPoint(t,r,i=this.elevation){let n=i-this.elevation,a=this.screenPointToMercatorCoordinateAtZ(r,n),o=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,0),s=D1.fromLngLat(t),l=new D1(s.x-(a.x-o.x),s.y-(a.y-o.y));this.setCenter(l?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,r){return r?this.coordinatePoint(D1.fromLngLat(t),r.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(D1.fromLngLat(t))}screenPointToLocation(t,r){var i;return null==(i=this.screenPointToMercatorCoordinate(t,r))?void 0:i.toLngLat()}screenPointToLocationAtElevation(t,r){var i;return null==(i=this.screenPointToMercatorCoordinateAtZ(t,r-this.elevation))?void 0:i.toLngLat()}screenPointToMercatorCoordinate(t,r){if(r){let i=this.screenTerrainPointToMercatorCoordinate(t,r);if(null!=i)return i}return this.screenPointToMercatorCoordinateAtZ(t)}screenTerrainPointToMercatorCoordinate(t,r){let i=r.getCoverageIndex();if(!i)return null;let{near:n,far:a}=this.getRaySegmentFromPixel(t),o=this.worldSize,s=a[0]-n[0],l=a[1]-n[1],u=a[2]-n[2],c={index:i,exaggeration:r.exaggeration,near:n,dx:s,dy:l,dz:u,worldSize:o},h=0,d=1;if(0===u){if(n[2]>i.maxElevation||n[2](d=Math.min(d,Math.max(t,r))))return null}let f=Math.hypot(s,l),p=xr(Math.ceil(f*(d-h)/4),1,512),m=0,g=!Py(c,0);for(let t=0;t<=p;t++){let r=h+(d-h)*t/p;if(g){if(Py(c,r)){let{lo:t,hi:i}=Pm(c,Py,m,r,.001/f),a=Pg(c,t),h=Pg(c,i),d=n[2]+t*u-a.elevation,p=n[2]+i*u-h.elevation,g=a.covered&&d>p?xr(t+d*(i-t)/(d-p),t,i):i;return new D1((n[0]+g*s)/o,(n[1]+g*l)/o,Pg(c,g).elevation)}}else g=!Py(c,r);m=r}return null}getRaySegmentFromPixel(t){let r=[t.x,t.y,0,1],i=[t.x,t.y,1,1];vU(r,r,this._pixelMatrixInverse),vU(i,i,this._pixelMatrixInverse);let n=r[3],a=i[3],o=this.elevation;return{near:[r[0]/n,r[1]/n,r[2]/n+o],far:[i[0]/a,i[1]/a,i[2]/a+o]}}screenPointToMercatorCoordinateAtZ(t,r){let i=r||0,{near:n,far:a}=this.getRaySegmentFromPixel(t),o=n[2]===a[2]?0:(i+this.elevation-n[2])/(a[2]-n[2]);return new D1(kx.number(n[0],a[0],o)/this.worldSize,kx.number(n[1],a[1],o)/this.worldSize,i)}coordinatePoint(t,r=0,i=this._pixelMatrix){let n=[t.x*this.worldSize,t.y*this.worldSize,r,1];return vU(n,n,i),new vu(n[0]/n[3],n[1]/n[3])}getBounds(){let t=Math.max(0,this._helper._height/2-Ts(this));return new FA().extend(this.screenPointToLocation(new vu(0,t))).extend(this.screenPointToLocation(new vu(this._helper._width,t))).extend(this.screenPointToLocation(new vu(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new vu(0,this._helper._height)))}isPointOnMapSurface(t,r){return r?null!=this.screenTerrainPointToMercatorCoordinate(t,r):t.y>this.height/2-Ts(this)}calculatePosMatrix(t,r=!1,i=!1){var n;let a=null!=(n=t.key)?n:Ar(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),o=r?this._alignedPosMatrixCache:this._posMatrixCache;if(o.has(a)){let t=o.get(a);return i?t.f32:t.f64}let s=Tl(t,this.worldSize);vy(s,r?this._alignedProjMatrix:this._viewProjMatrix,s);let l={f64:s,f32:new Float32Array(s)};return o.set(a,l),i?l.f32:l.f64}calculateFogMatrix(t){let r=t.key,i=this._fogMatrixCacheF32;if(i.has(r))return i.get(r);let n=Tl(t,this.worldSize);return vy(n,this._fogMatrix,n),i.set(r,new Float32Array(n)),i.get(r)}calculateCenterFromCameraLngLatAlt(t,r,i,n){return this._helper.calculateCenterFromCameraLngLatAlt(t,r,i,n)}calculateCameraOptionsFromTo(t,r,i,n){let a=D1.fromLngLat(t,r),o=D1.fromLngLat(i,n),s=o.x-a.x,l=o.y-a.y,u=o.z-a.z,c=Math.hypot(s,l,u);if(0===c)throw Error("Can't calculate camera options with same From and To");let h=Math.hypot(s,l),d=xs(this.cameraToCenterDistance/c/this.tileSize),f=xx(Math.atan2(s,-l)),p=xx(Math.acos(h/c));return p=u<0?90-p:90+p,{center:o.toLngLat(),elevation:n,zoom:d,pitch:p,bearing:f}}_calculateNearFarZIfNeeded(t,r,i){if(!this._helper.autoCalculateNearFarZ)return;let n=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),a=t-n*this._helper._pixelPerMeter/Math.cos(r),o=n<0?a:t,s=Math.PI/2+this.pitchInRadians,l=xv(this.fov)*(Math.abs(Math.cos(xv(this.roll)))*this.height+Math.abs(Math.sin(xv(this.roll)))*this.width)/this.height*(.5+i.y/this.height),u=Math.sin(l)*o/Math.sin(xr(Math.PI-s-l,.01,Math.PI-.01)),c=Ts(this),h=Math.atan(c/this._helper.cameraToCenterDistance),d=xv(90-D2),f=h>d?2*h*(.5+i.y/(2*c)):d,p=Math.min(u,Math.sin(f)*o/Math.sin(xr(Math.PI-s-f,.01,Math.PI-.01)));this._helper._farZ=(Math.cos(Math.PI/2-r)*p+o)*1.01,this._helper._nearZ=this._helper._height/50}_calcMatrices(){var t,r;let i,n=this.centerOffset,a=Ta(this.worldSize,this.center),o=a.x,s=a.y,l=xv(Math.min(this.pitch,D2)),u=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(l));this._calculateNearFarZIfNeeded(u,l,n),i=new Float64Array(16),Mo(i,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),t=this._invProjMatrix,r=i,t[0]=1/r[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1/r[5],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=1/r[14],t[12]=0,t[13]=0,t[14]=-1,t[15]=r[10]/r[14],i[8]=-(2*n.x)/this._helper._width,i[9]=2*n.y/this._helper._height,this._projectionMatrix=vp(i),vx(i,i,[1,-1,1]),vv(i,i,[0,0,-this._helper.cameraToCenterDistance]),vw(i,i,-this.rollInRadians),vb(i,i,this.pitchInRadians),vw(i,i,-this.bearingInRadians),vv(i,i,[-o,-s,0]),this._mercatorMatrix=vx([],i,[this.worldSize,this.worldSize,this.worldSize]),vx(i,i,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=vy(new Float64Array(16),this.clipSpaceToPixelsMatrix,i),vv(i,i,[0,0,-this.elevation]),this._viewProjMatrix=i,this._invViewProjMatrix=vg([],i);let c=[0,0,-1,1];vU(c,c,this._invViewProjMatrix),this._cameraPosition=[c[0]/c[3],c[1]/c[3],c[2]/c[3]],this._fogMatrix=new Float64Array(16),Mo(this._fogMatrix,this.fovInRadians,this.width/this.height,u,this._helper._farZ),this._fogMatrix[8]=-(2*n.x)/this.width,this._fogMatrix[9]=2*n.y/this.height,vx(this._fogMatrix,this._fogMatrix,[1,-1,1]),vv(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),vw(this._fogMatrix,this._fogMatrix,-this.rollInRadians),vb(this._fogMatrix,this._fogMatrix,this.pitchInRadians),vw(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),vv(this._fogMatrix,this._fogMatrix,[-o,-s,0]),vx(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),vv(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=vy(new Float64Array(16),this.clipSpaceToPixelsMatrix,i);let h=this._helper._width%2/2,d=this._helper._height%2/2,f=Math.cos(this.bearingInRadians),p=Math.sin(-this.bearingInRadians),m=o-Math.round(o)+f*h+p*d,g=s-Math.round(s)+f*d+p*h,y=new Float64Array(i);if(vv(y,y,[m>.5?m-1:m,g>.5?g-1:g,0]),this._alignedProjMatrix=y,!(i=vg(new Float64Array(16),this._pixelMatrix)))throw Error("failed to invert matrix");this._pixelMatrixInverse=i,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let t=this.screenPointToMercatorCoordinate(new vu(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return vU(r,r,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this.cameraToCenterDistance/this.pixelsPerMeter+this.elevation}getCameraLngLat(){let t=1/w9(this.center.lat)*this.worldSize,r=this._helper.cameraToCenterDistance/t;return Tu(this.center,this.elevation,this.pitch,this.bearing,r).toLngLat()}lngLatToCameraDepth(t,r){let i=D1.fromLngLat(t),n=[i.x*this.worldSize,i.y*this.worldSize,r,1];return vU(n,n,this._viewProjMatrix),n[2]/n[3]}getProjectionData(t){let{overscaledTileID:r,aligned:i,applyTerrainMatrix:n}=t,a=this._helper.getMercatorTileCoordinates(r),o=r?this.calculatePosMatrix(r,i,!0):null,s;return{mainMatrix:s=r?.terrainRttPosMatrix32f&&n?r.terrainRttPosMatrix32f:o||v3(),tileMercatorCoords:a,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:s,clipAntimeridian:!1}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,r,i){return 1}transformLightDirection(t){return vk(t)}getRayDirectionFromPixel(t){throw Error("Not implemented.")}projectTileCoordinates(t,r,i,n){let a=this.calculatePosMatrix(i),o;null==n?Pi(o=[t,r,0,1],o,a):vU(o=[t,r,n,1],o,a);let s=o[3];return{point:new vu(o[0]/s,o[1]/s),signedDistanceFromCamera:s,isOccluded:!1}}populateCache(t){for(let r of t)this.calculatePosMatrix(r)}getProjectionDataForCustomLayer(t=!0){let r=new Ia(0,0,0,0,0),i=this.getProjectionData({overscaledTileID:r,applyGlobeMatrix:t}),n=Tl(r,this.worldSize);vy(n,this._viewProjMatrix,n);let a=[Mf,Mf,this.worldSize/this._helper.pixelsPerMeter],o=v1();return vx(o,n,a),p(f({},i),{tileMercatorCoords:[0,0,1,1],fallbackMatrix:o,mainMatrix:o})}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}},OC=class{get useGlobeControls(){return!1}handlePanInertia(t,r){let i=t.mag(),n=Math.abs(Ts(r));return{easingOffset:t.mult(Math.min(.75*n/i,1)),easingCenter:r.center}}handleMapControlsRollPitchBearingZoom(t,r){t.bearingDelta&&r.setBearing(r.bearing+t.bearingDelta),t.pitchDelta&&r.setPitch(r.pitch+t.pitchDelta),t.rollDelta&&r.setRoll(r.roll+t.rollDelta),t.zoomDelta&&r.setZoom(r.zoom+t.zoomDelta)}handleMapControlsPan(t,r,i){.01>t.around.distSqr(r.centerPoint)||r.setLocationAtPoint(i,t.around,t.aroundElevation)}cameraForBoxAndBearing(t,r,i,n,a){return Pb(t,r,i,n,a)}handleJumpToCenterZoom(t,r){let i=void 0===r.zoom?t.zoom:+r.zoom;t.zoom!==i&&t.setZoom(+r.zoom),void 0!==r.center&&t.setCenter(DQ.convert(r.center))}handleEaseTo(t,r){let i=t.zoom,n=t.padding,a={roll:t.roll,pitch:t.pitch,bearing:t.bearing},o={roll:void 0===r.roll?t.roll:r.roll,pitch:void 0===r.pitch?t.pitch:r.pitch,bearing:void 0===r.bearing?t.bearing:r.bearing},s=void 0!==r.zoom,l=!t.isPaddingEqual(r.padding),u=!1,c=s?+r.zoom:t.zoom,h=t.centerPoint.add(r.offsetAsPoint),d=t.screenPointToLocation(h),{center:f,zoom:p}=t.applyConstrain(DQ.convert(r.center||d),c??i);Ph(t,f);let m=Ta(t.worldSize,d),g=Ta(t.worldSize,f).sub(m),y=xo(p-i);return{easeFunc:s=>{if(u&&t.setZoom(kx.number(i,p,s)),xb(a,o)||Px({startEulerAngles:a,endEulerAngles:o,tr:t,k:s,useSlerp:a.roll!=o.roll}),l&&(t.interpolatePadding(n,r.padding,s),h=t.centerPoint.add(r.offsetAsPoint)),r.around)t.setLocationAtPoint(r.around,r.aroundPoint);else{let r=xo(t.zoom-i),n=(p>i?Math.min(2,y):Math.max(.5,y))**(1-s),a=To(t.worldSize,m.add(g.mult(s*n)).mult(r));t.setLocationAtPoint(t.renderWorldCopies?a.wrap():a,h)}},isZooming:u=p!==i,elevationCenter:f}}handleFlyTo(t,r){let i=void 0!==r.zoom,n=t.zoom,a=t.applyConstrain(DQ.convert(r.center||r.locationAtOffset),i?+r.zoom:n),o=a.center,s=a.zoom;Ph(t,o);let l=t.worldSize,u=Ta(l,r.locationAtOffset),c=Ta(l,o).sub(u),h=c.mag(),d=xo(s-n),f=Math.min(Math.max(void 0===r.minZoom?t.minZoom:+r.minZoom,t.minZoom),n,s),p=t.applyConstrain(o,f).zoom;return{easeFunc:(r,i,a,h)=>{t.setZoom(1===r?s:n+xs(i));let d=1===r?o:To(l,u.add(c.mult(a)));t.setLocationAtPoint(t.renderWorldCopies?d.wrap():d,h)},scaleOfZoom:d,targetCenter:o,scaleOfMinZoom:xo(p-n),pixelPathLength:h}}},OL=new Dz({fill:new DL(128,2),line:new DL(512,0),tile:new DL(128,32),stencil:new DL(128,1),circle:3}),OP=class{constructor(){this._tileMeshCache={}}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return Ox.projectionGlobe}get vertexShaderPreludeCode(){return Ox.projectionMercator.vertexSource}get subdivisionGranularity(){return OL}get useGlobeControls(){return!0}destroy(){}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,r,i,n,a){let o=("stencil"===a?OL.stencil:OL.tile).getGranularityForZoomLevel(r.z),s=0===r.y&&n,l=r.y===(1<0}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}getMeshFromTileID(t,r,i,n,a){return this.currentProjection.getMeshFromTileID(t,r,i,n,a)}setProjection(t){this._transitionable.setValue("type",t?.type||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}},OF=.98*Math.PI,OO=class{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;let t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,r,i,n){let a=`${t.z}_${t.x}_${t.y}_${n?.terrain?"t":""}_${Math.round(i)}`,o=this._cache.get(a);if(o)return o;let s=this._cachePrevious.get(a);if(s)return this._cache.set(a,s),s;let l=this._boundingVolumeFactory(t,r,i,n);return this._cache.set(a,l),this._hadAnyChanges=!0,l}},OR=class t{constructor(t,r,i,n){this.min=i,this.max=n,this.points=t,this.planes=r}static fromAabb(r,i){let n=[];for(let t=0;t<8;t++)n.push([(1&t)==1?i[0]:r[0],(t>>1&1)==1?i[1]:r[1],(t>>2&1)==1?i[2]:r[2]]);return new t(n,[[-1,0,0,i[0]],[1,0,0,-r[0]],[0,-1,0,i[1]],[0,1,0,-r[1]],[0,0,-1,i[2]],[0,0,1,-r[2]]],r,i)}static fromCenterSizeAngles(r,i,n){let a=vG([],n[0],n[1],n[2]),o=vO([],[i[0],0,0],a),s=vO([],[0,i[1],0],a),l=vO([],[0,0,i[2]],a),u=[...r],c=[...r];for(let t=0;t<8;t++)for(let i=0;i<3;i++){let n=r[i]+o[i]*((1&t)==1?1:-1)+s[i]*((t>>1&1)==1?1:-1)+l[i]*((t>>2&1)==1?1:-1);u[i]=Math.min(u[i],n),c[i]=Math.max(c[i],n)}let h=[];for(let t=0;t<8;t++){let i=[...r];vD(i,i,vI([],o,(1&t)==1?1:-1)),vD(i,i,vI([],s,(t>>1&1)==1?1:-1)),vD(i,i,vI([],l,(t>>2&1)==1?1:-1)),h.push(i)}return new t(h,[[...o,-vz(o,h[0])],[...s,-vz(s,h[0])],[...l,-vz(l,h[0])],[-o[0],-o[1],-o[2],-vz(o,h[7])],[-s[0],-s[1],-s[2],-vz(s,h[7])],[-l[0],-l[1],-l[2],-vz(l,h[7])]],u,c)}intersectsFrustum(t){let r=!0,i=this.points.length,n=this.planes.length,a=t.planes.length,o=t.points.length;for(let n=0;n=0&&o++}if(0===o)return 0;o=0&&n++}if(0===n)return 0}return 1}intersectsPlane(t){let r=this.points.length,i=0;for(let n=0;n=0&&i++}return i===r?2:+(0!==i)}},OB=class{constructor(){this._boundingVolumeCache=new OO(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,r,i,n){let a=1<4}allowWorldCopies(){return!1}getTileBoundingVolume(t,r,i,n){return this._boundingVolumeCache.getTileBoundingVolume(t,r,i,n)}_computeTileBoundingVolume(t,r,i,n){var a,o;let s=Math.min(0,i),l=Math.max(0,i);if(n?.terrain){let i=new Ia(t.z,r,t.z,t.x,t.y),u=n.terrain.getMinMaxElevation(i);s=null!=(a=u.minElevation)?a:s,l=Math.max(null!=(o=u.maxElevation)?o:l,l)}if(s/=DJ,l/=DJ,s+=1,l+=1,t.z<=0)return OR.fromAabb([-l,-l,-l],[l,l,l]);if(1===t.z)return OR.fromAabb([0===t.x?-l:0,0===t.y?0:-l,-l],[0===t.x?0:l,0===t.y?l:0,l]);{let r=[Pw(0,0,t.x,t.y,t.z),Pw(Mf,0,t.x,t.y,t.z),Pw(Mf,Mf,t.x,t.y,t.z),Pw(0,Mf,t.x,t.y,t.z)],i=[];for(let t of r)i.push(vI([],t,l));if(l!==s)for(let t of r)i.push(vI([],t,s));0===t.y&&i.push([0,1,0]),t.y===(1<=(1<{let i=xr(t.lat,-Mb,Mb),n=xr(+r,this.minZoom+PD(0,i),this.maxZoom);return{center:new DQ(t.lng,i),zoom:n}},this.applyConstrain=(t,r)=>this._helper.applyConstrain(t,r),this._helper=new Ow({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,r)=>this.defaultConstrain(t,r)},t),this._coveringTilesDetailsProvider=new OB}clone(){let r=new t;return r.apply(this,!1),r}apply(t,r){this._helper.apply(t,r)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixF64}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let t=v0();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){let{overscaledTileID:r,applyGlobeMatrix:i}=t,n=this._helper.getMercatorTileCoordinates(r);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:n,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!i,fallbackMatrix:this._globeViewProjMatrix32f,clipAntimeridian:r?.canonical.z===0}}_computeClippingPlane(t){let r=this.pitchInRadians,i=this.cameraToCenterDistance/t,n=Math.sin(r)*i,a=Math.cos(r)*i+1,o=1/Math.sqrt(n*n+a*a)*1,s=-n,l=a,u=Math.sqrt(s*s+l*l),c=[0,s/=u,l/=u];vj(c,c,[0,0,0],-this.bearingInRadians),vR(c,c,[0,0,0],-1*this.center.lat*Math.PI/180),vB(c,c,[0,0,0],this.center.lng*Math.PI/180);let h=1/vS(c);return vI(c,c,h),[...c,-o*h]}isLocationOccluded(t){return!this.isSurfacePointVisible(PT(t))}transformLightDirection(t){let r=this._helper._center.lng*Math.PI/180,i=this._helper._center.lat*Math.PI/180,n=Math.cos(i),a=[Math.sin(r)*n,Math.sin(i),Math.cos(r)*n],o=[a[2],0,-a[0]],s=[0,0,0];vF(s,o,a),vP(o,o),vP(s,s);let l=[o[0]*t[0]+s[0]*t[1]+a[0]*t[2],o[1]*t[0]+s[1]*t[1]+a[1]*t[2],o[2]*t[0]+s[2]*t[1]+a[2]*t[2]],u=[0,0,0];return vP(u,l),u}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,r,i){var n,a,o;let s=Tn(t,r,i.canonical),l=(n=s.x,a=s.y,[((n*Math.PI*2+Math.PI)%(o=2*Math.PI)+o)%o,2*Math.atan(Math.exp(Math.PI-a*Math.PI*2))-.5*Math.PI]);return this.getCircleRadiusCorrection()/Math.cos(l[1])}projectTileCoordinates(t,r,i,n){let a,o=i.canonical,s=Pw(t,r,o.x,o.y,o.z),l=1+(n??0)/DJ,u=s[0]*l,c=s[1]*l,h=s[2]*l,d=[u,c,h,1];if(vU(d,d,this._globeViewProjMatrixF64),l<=1){let t=this._cachedClippingPlane;a=t[0]*s[0]+t[1]*s[1]+t[2]*s[2]+t[3]<0}else a=this._isLineOfSightBlocked(u,c,h);return{point:new vu(d[0]/d[3],d[1]/d[3]),signedDistanceFromCamera:d[3],isOccluded:a}}_isLineOfSightBlocked(t,r,i){let n=this._cameraPosition,a=t-n[0],o=r-n[1],s=i-n[2],l=a*a+o*o+s*s;if(0===l)return!1;let u=xr(-(n[0]*a+n[1]*o+n[2]*s)/l,0,1),c=n[0]+u*a,h=n[1]+u*o,d=n[2]+u*s;return c*c+h*h+d*d<1}_calcMatrices(){let t=PA(this.worldSize,this.center.lat),r=v1();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),Mo(r,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let i=this.centerOffset;r[8]=-(2*i.x)/this._helper._width,r[9]=2*i.y/this._helper._height,this._projectionMatrix=vp(r),this._globeProjMatrixInverted=v1(),vg(this._globeProjMatrixInverted,r),vv(r,r,[0,0,-this.cameraToCenterDistance]),vw(r,r,this.rollInRadians),vb(r,r,-this.pitchInRadians),vw(r,r,this.bearingInRadians),vv(r,r,[0,0,-t]);let n=v0();n[0]=t,n[1]=t,n[2]=t,vb(r,r,this.center.lat*Math.PI/180),v_(r,r,-this.center.lng*Math.PI/180),vx(r,r,n),this._globeViewProjMatrixF64=r,this._globeViewProjMatrix32f=new Float32Array(r),this._globeViewProjMatrixF64Inverted=v1(),vg(this._globeViewProjMatrixF64Inverted,r);let a=v0();this._cameraPosition=v0(),this._cameraPosition[2]=this.cameraToCenterDistance/t,vj(this._cameraPosition,this._cameraPosition,a,-this.rollInRadians),vR(this._cameraPosition,this._cameraPosition,a,this.pitchInRadians),vj(this._cameraPosition,this._cameraPosition,a,-this.bearingInRadians),vD(this._cameraPosition,this._cameraPosition,[0,0,1]),vR(this._cameraPosition,this._cameraPosition,a,-this.center.lat*Math.PI/180),vB(this._cameraPosition,this._cameraPosition,a,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);let o=vp(this._globeViewProjMatrixF64Inverted);vx(o,o,[1,1,-1]),this._cachedFrustum=FY.fromInvProjectionMatrix(o,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){xf("calculateFogMatrix is not supported on globe projection.");let r=v1();return vm(r),r}getVisibleUnwrappedCoordinates(t){return[new In(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t?xf("terrain is not fully supported on vertical perspective projection."):this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return(vS(this._cameraPosition)-1)*DJ}getCameraLngLat(){let t=v0();return vP(t,this._cameraPosition),Pk(t)}lngLatToCameraDepth(t,r){let i=PT(t);vI(i,i,1+r/DJ);let n=vQ();return vU(n,[i[0],i[1],i[2],1],this._globeViewProjMatrixF64),n[2]/n[3]}populateCache(t){}getBounds(){let t=.5*this.width,r=.5*this.height,i=[new vu(0,0),new vu(t,0),new vu(this.width,0),new vu(this.width,r),new vu(this.width,this.height),new vu(t,this.height),new vu(0,this.height),new vu(0,r)],n=[];for(let t of i)n.push(this.unprojectScreenPoint(t));let a=0,o=0,s=0,l=0,u=this.center;for(let t of n){let r=v7(u.lng,t.lng),i=v7(u.lat,t.lat);ra&&(a=r),is&&(s=i)}let c=[u.lng+o,u.lat+l,u.lng+a,u.lat+s];return this.isSurfacePointOnScreen([0,1,0])&&(c[3]=90,c[0]=-180,c[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(c[1]=-90,c[0]=-180,c[2]=180),new FA(c)}calculateCenterFromCameraLngLatAlt(t,r,i,n){return this._helper.calculateCenterFromCameraLngLatAlt(t,r,i,n)}calculateCameraOptionsFromTo(t,r,i,n){var a,o,s;let l=DQ.convert(i),u=PT(DQ.convert(t));vI(u,u,1+r/DJ);let c=PT(l),h=vI(v0(),c,1+n/DJ),d=vC(v0(),u,c),f=vS(d);if(f<1e-12||(a=h[0]-u[0],1e-12>Math.sqrt(a*a+(o=h[1]-u[1])*o+(s=h[2]-u[2])*s)))throw Error("Can't calculate camera options with same From and To");let p=v0();vB(d,d,p,-xv(l.lng)),vR(d,d,p,xv(l.lat));let m=xx(Math.acos(xr(d[2]/f,-1,1))),g=Math.hypot(d[0],d[1])<1e-9*f?this.bearing:xx(Math.atan2(-d[0],-d[1]));return{center:l,elevation:n,zoom:xs(this.cameraToCenterDistance/f/PA(this.tileSize,l.lat)),pitch:m,bearing:g}}setLocationAtPoint(t,r,i){let n=PT(this.unprojectScreenPoint(r)),a=PT(t),o=v0();o[0]=0,o[1]=0,o[2]=0;let s=v0();vB(s,n,o,-this.center.lng*Math.PI/180),vR(s,s,o,this.center.lat*Math.PI/180);let l=a[0]*a[0]+a[2]*a[2],u=s[0]*s[0];if(l=-y&&p<=y,x=g>=-y&&g<=y,b,_;if(v&&x){let t=this.center.lng*Math.PI/180,r=this.center.lat*Math.PI/180;v9(h,t)+v9(p,r)=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;let r=vQ();return vU(r,[...t,1],this._globeViewProjMatrixF64),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3],r[0]>-1&&r[0]<1&&r[1]>-1&&r[1]<1&&r[2]>-1&&r[2]<1}unprojectScreenPoint(t){var r,i;let n,a,o,s=this._cameraPosition,l=this.getRayDirectionFromPixel(t),u=PL(s,l);if(u){let t=v0();vD(t,s,[l[0]*u.tMin,l[1]*u.tMin,l[2]*u.tMin]);let r=v0();return vP(r,t),Pk(r)}let c=this._cachedClippingPlane,h=c[0]*l[0]+c[1]*l[1]+c[2]*l[2],d=-v4(c,s)/h,f=v0();if(d>0)vD(f,s,[l[0]*d,l[1]*d,l[2]*d]);else{let t=v0();vD(t,s,[2*l[0],2*l[1],2*l[2]]);let r=v4(this._cachedClippingPlane,t);Ml(f,t,[this._cachedClippingPlane[0]*r,this._cachedClippingPlane[1]*r,this._cachedClippingPlane[2]*r])}let p=((n=v0())[0]=-(c[0]*c[3]),n[1]=-(c[1]*c[3]),n[2]=-(c[2]*c[3]),{center:n,radius:Math.sqrt(1-c[3]*c[3])});return Pk((r=p.center,i=p.radius,a=v0(),Ml(a,f,r),vL(o=v0(),r,a,i/Mu(a)),o))}getProjectionDataForCustomLayer(t=!0){let r=this.getProjectionData({overscaledTileID:new Ia(0,0,0,0,0),applyGlobeMatrix:t});return r.tileMercatorCoords=[0,0,1,1],r}getFastPathSimpleProjectionMatrix(t){}},ON=class t{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,r,i){this._helper.interpolatePadding(t,r,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,r,i=!0){this._helper.resize(t,r,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,r){this._helper.overrideNearFarZ(t,r)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t){this._globeness=t,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeness=1,this.defaultConstrain=(t,r)=>this.currentTransform.defaultConstrain(t,r),this.applyConstrain=(t,r)=>this._helper.applyConstrain(t,r),this._helper=new Ow({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(t,r)=>this.defaultConstrain(t,r)},t),this._globeness=1,this._mercatorTransform=new OD,this._verticalPerspectiveTransform=new Oj}clone(){let r=new t;return r._globeness=this._globeness,r.apply(this,!1),r}apply(t,r){this._helper.apply(t,r),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){let r=this._mercatorTransform.getProjectionData(t),i=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?i.mainMatrix:r.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:r.fallbackMatrix,clipAntimeridian:i.clipAntimeridian}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){var t,r,i;return t=this._mercatorTransform.getPixelScale(),r=this._verticalPerspectiveTransform.getPixelScale(),t*(1-(i=this._globeness))+r*i}getCircleRadiusCorrection(){var t,r,i;return t=this._mercatorTransform.getCircleRadiusCorrection(),r=this._verticalPerspectiveTransform.getCircleRadiusCorrection(),t*(1-(i=this._globeness))+r*i}getPitchedTextCorrection(t,r,i){var n;let a=this._mercatorTransform.getPitchedTextCorrection(t,r,i),o=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,r,i);return a*(1-(n=this._globeness))+o*n}projectTileCoordinates(t,r,i,n){return this.currentTransform.projectTileCoordinates(t,r,i,n)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this.currentTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this.currentTransform.getCameraAltitude()}getCameraLngLat(){return this.currentTransform.getCameraLngLat()}lngLatToCameraDepth(t,r){return this.currentTransform.lngLatToCameraDepth(t,r)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,r,i,n){return this._helper.calculateCenterFromCameraLngLatAlt(t,r,i,n)}calculateCameraOptionsFromTo(t,r,i,n){return this.currentTransform.calculateCameraOptionsFromTo(t,r,i,n)}setLocationAtPoint(t,r,i){if(!this.isGlobeRendering){this._mercatorTransform.setLocationAtPoint(t,r,i),this.apply(this._mercatorTransform,!1);return}this._verticalPerspectiveTransform.setLocationAtPoint(t,r,i),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,r){return this.currentTransform.locationToScreenPoint(t,r)}screenPointToMercatorCoordinate(t,r){return this.currentTransform.screenPointToMercatorCoordinate(t,r)}screenTerrainPointToMercatorCoordinate(t,r){return this.currentTransform.screenTerrainPointToMercatorCoordinate(t,r)}screenPointToLocation(t,r){return this.currentTransform.screenPointToLocation(t,r)}screenPointToLocationAtElevation(t,r){return this.currentTransform.screenPointToLocationAtElevation(t,r)}isPointOnMapSurface(t,r){return this.currentTransform.isPointOnMapSurface(t,r)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getProjectionDataForCustomLayer(t=!0){let r=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return r;let i=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return i.fallbackMatrix=r.mainMatrix,i.projectionTransition=this._globeness,i}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}},OV=class t{get useGlobeControls(){return!0}handlePanInertia(t,r){var i,n,a;let o,s,l,u,c=(o=t.rotate(r.bearingInRadians),s=r.zoom+PD(r.center.lat,0),i=1/PE(r.center.lat),n=1/PE(Math.min(Math.abs(r.center.lat),60)),l=i*(1-(a=xe(s,7,3,0,1)))+n*a,u=360/P_({worldSize:r.worldSize,center:{lat:r.center.lat}}),new DQ(r.center.lng-o.x*u*l,xr(r.center.lat+o.y*u,-Mb,Mb)));return Math.abs(c.lng-r.center.lng)>180&&(c.lng=r.center.lng+179.5*Math.sign(c.lng-r.center.lng)),{easingCenter:c,easingOffset:new vu(0,0)}}handleMapControlsRollPitchBearingZoom(t,r){let i=t.around,n=r.screenPointToLocation(i);t.bearingDelta&&r.setBearing(r.bearing+t.bearingDelta),t.pitchDelta&&r.setPitch(r.pitch+t.pitchDelta),t.rollDelta&&r.setRoll(r.roll+t.rollDelta);let a=r.zoom;t.zoomDelta&&r.setZoom(r.zoom+t.zoomDelta);let o=r.zoom-a;if(0===o)return;let s=v7(r.center.lng,n.lng),l=s/(Math.abs(s/180)+1),u=v7(r.center.lat,n.lat),c=r.getRayDirectionFromPixel(i),h=r.cameraPosition,d=-1*vz(h,c),f=v0();vD(f,h,[c[0]*d,c[1]*d,c[2]*d]);let p=vS(f),m=Math.exp(-(.5*Math.max(p-1-.3,0))),g=xe(p,.95,.999,0,1),y=Math.min(m,+(1-g)+xe(PA(r.worldSize,r.center.lat)/Math.min(r.width,r.height),.9,.5,1,.25)*g),v=(1-xo(-o))*y,x=r.center.lat,b=r.zoom,_=new DQ(r.center.lng+l*v,xr(r.center.lat+u*v,-Mb,Mb));r.setLocationAtPoint(n,i);let w=r.center,T=Math.max(xe(Math.abs(s),45,85,0,1),g)**.25,A=v7(w.lng,_.lng),M=v7(w.lat,_.lat);r.setCenter(new DQ(w.lng+A*T,w.lat+M*T).wrap()),r.setZoom(b+PD(x,r.center.lat))}handleMapControlsPan(t,r,i){t.panDelta&&function(t,r,i,n,a=!0){var o,s,l,u,c,h,d,f,p,m,g,y,v,x,b,_;let w,T,A,M,k,S,E,D,C,I,L,P,z,F,O=PS(t,i),R=r;if(n)R=PS(t,i.sub(n));else if(!t.isPointOnMapSurface(i))return;let B=PT(O),j=PT(R),N=(o=t.center,s=t.bearing,vG(vQ(),-o.lng,-o.lat,s)),V=vF(v0(),j,B),U=Math.sqrt(vz(V,V)),q=Math.acos(xr(vz(j,B),-1,1))/2,G=Math.sin(q),H=U?Mh(V[1]/U*G,-V[0]/U*G,V[2]/U*G,Math.cos(q)):Mh(0,0,0,1),{lng:$,lat:W,bearing:Y}=(L=(l=vQ(),u=N[0],c=N[1],h=N[2],d=N[3],f=H[0],p=H[1],m=H[2],g=H[3],l[0]=u*g+d*f+c*m-h*p,l[1]=c*g+d*p+h*f-u*m,l[2]=h*g+d*m+u*p-c*f,l[3]=d*g-u*f-c*p-h*m,y=l)[0],P=y[1],z=y[2],{lng:-(180*Math.atan2(2*((F=y[3])*L+P*z),1-2*(L*L+P*P)))/Math.PI,lat:-(180*Math.asin(xr(2*(F*P-z*L),-1,1)))/Math.PI,bearing:180*Math.atan2(2*(F*z+L*P),1-2*(P*P+z*z))/Math.PI}),Z=t.center.lat,X=t.zoom,K=xr(W,-90,90),J=a?(v=t,x=i,b=n,_=$,w=v.center.lng,A=(T=v.center.lat)>=0?90:-90,M=v.locationToScreenPoint(new DQ(0,A)),k=x.x-M.x,S=x.y-M.y,D=(E=xr(1-(Mb-Math.abs(T))/12,0,1))*E*(3-2*E),C=((_-w+180)%360+360)%360-180,I=0,D>0&&b&&(I=(A>0?1:-1)*((k*b.y-S*b.x)/Math.max(k*k+S*S,400))*180/Math.PI),w+(1-D)*C+D*I):$;t.setCenter(new DQ(xi(J,-180,180),K)),a||t.setBearing(Y),t.setZoom(X+PD(Z,t.center.lat))}(r,i,r.isPointOnMapSurface(t.around)?t.around:r.centerPoint,t.panDelta)}cameraForBoxAndBearing(r,i,n,a,o){let s=Pb(r,i,n,a,o),l=i.left/o.width*2-1,u=(o.width-i.right)/o.width*2-1,c=-(i.top/o.height*2)+1,h=-((o.height-i.bottom)/o.height*2)+1,d=0>v7(n.getWest(),n.getEast()),f=d?n.getEast():n.getWest(),p=d?n.getWest():n.getEast(),m=Math.max(n.getNorth(),n.getSouth()),g=Math.min(n.getNorth(),n.getSouth()),y=f+.5*v7(f,p),v=m+.5*v7(m,g),x=o.clone();x.setCenter(s.center),x.setBearing(s.bearing),x.setPitch(0),x.setRoll(0),x.setZoom(s.zoom);let b=x.modelViewProjectionMatrix,_=[PT(n.getNorthWest()),PT(n.getNorthEast()),PT(n.getSouthWest()),PT(n.getSouthEast()),PT(new DQ(p,v)),PT(new DQ(f,v)),PT(new DQ(y,m)),PT(new DQ(y,g))],w=PT(s.center),T=1/0;for(let r of _)l<0&&(T=t.getLesserNonNegativeNonNull(T,t.solveVectorScale(r,w,b,"x",l))),u>0&&(T=t.getLesserNonNegativeNonNull(T,t.solveVectorScale(r,w,b,"x",u))),c>0&&(T=t.getLesserNonNegativeNonNull(T,t.solveVectorScale(r,w,b,"y",c))),h<0&&(T=t.getLesserNonNegativeNonNull(T,t.solveVectorScale(r,w,b,"y",h)));return Number.isFinite(T)&&0!==T?(s.zoom=Math.min(x.zoom+xs(T),r.maxZoom),s):void Pv()}handleJumpToCenterZoom(t,r){let i=t.center.lat,n=t.applyConstrain(r.center?DQ.convert(r.center):t.center,t.zoom).center;t.setCenter(n.wrap());let a=void 0===r.zoom?t.zoom+PD(i,n.lat):+r.zoom;t.zoom!==a&&t.setZoom(a)}handleEaseTo(t,r){let i=t.zoom,n=t.center,a=t.padding,o={roll:t.roll,pitch:t.pitch,bearing:t.bearing},s={roll:void 0===r.roll?t.roll:r.roll,pitch:void 0===r.pitch?t.pitch:r.pitch,bearing:void 0===r.bearing?t.bearing:r.bearing},l=void 0!==r.zoom,u=!t.isPaddingEqual(r.padding),c=!1,h=r.center?DQ.convert(r.center):n,d=t.applyConstrain(h,i).center;Ph(t,d);let f=t.clone();f.setCenter(d),f.setZoom(l?+r.zoom:i+PD(n.lat,h.lat)),f.setBearing(r.bearing);let p=new vu(xr(t.centerPoint.x+r.offsetAsPoint.x,0,t.width),xr(t.centerPoint.y+r.offsetAsPoint.y,0,t.height));f.setLocationAtPoint(d,p);let m=(r.offset&&r.offsetAsPoint.mag())>0?f.center:d,g=l?+r.zoom:i+PD(n.lat,m.lat),y=i+PD(n.lat,0),v=g+PD(m.lat,0),x=v7(n.lng,m.lng),b=v7(n.lat,m.lat),_=xo(v-y);return{easeFunc:i=>{if(xb(o,s)||Px({startEulerAngles:o,endEulerAngles:s,tr:t,k:i,useSlerp:o.roll!=s.roll}),u&&t.interpolatePadding(a,r.padding,i),r.around)xf("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(r.around,r.aroundPoint);else{let r=PI(n,x,b,i*(v>y?Math.min(2,_):Math.max(.5,_))**(1-i));t.setCenter(r.wrap())}if(c){let r=kx.number(y,v,i)+PD(0,t.center.lat);t.setZoom(r)}},isZooming:c=g!==i,elevationCenter:m}}handleFlyTo(t,r){let i=void 0!==r.zoom,n=t.center,a=t.zoom,o=t.padding,s=!t.isPaddingEqual(r.padding),l=t.applyConstrain(DQ.convert(r.center||r.locationAtOffset),a).center,u=i?+r.zoom:t.zoom+PD(t.center.lat,l.lat),c=t.clone();c.setCenter(l),c.setZoom(u),c.setBearing(r.bearing);let h=new vu(xr(t.centerPoint.x+r.offsetAsPoint.x,0,t.width),xr(t.centerPoint.y+r.offsetAsPoint.y,0,t.height));c.setLocationAtPoint(l,h);let d=c.center;Ph(t,d);let f=Math.acos(vz(PT(n),PT(d)))/(2*Math.PI)*P_(t),p=a+PD(n.lat,0),m=u+PD(d.lat,0),g=xo(m-p),y=Math.min(Math.max("number"==typeof r.minZoom?+r.minZoom:t.minZoom,t.minZoom)+PD(d.lat,0),p,m)+PD(0,d.lat),v=xo(t.applyConstrain(d,y).zoom+PD(d.lat,0)-p),x=v7(n.lng,d.lng),b=v7(n.lat,d.lat);return{easeFunc:(i,a,l,c)=>{let h=PI(n,x,b,l);s&&t.interpolatePadding(o,r.padding,i);let f=1===i?d:h;t.setCenter(f.wrap());let m=p+xs(a);t.setZoom(1===i?u:m+PD(0,f.lat))},scaleOfZoom:g,targetCenter:d,scaleOfMinZoom:v,pixelPathLength:f}}static solveVectorScale(t,r,i,n,a){let o="x"===n?[i[0],i[4],i[8],i[12]]:[i[1],i[5],i[9],i[13]],s=[i[3],i[7],i[11],i[15]],l=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],u=t[0]*s[0]+t[1]*s[1]+t[2]*s[2],c=r[0]*o[0]+r[1]*o[1]+r[2]*o[2],h=r[0]*s[0]+r[1]*s[1]+r[2]*s[2],d=(c+o[3]-a*h-a*s[3])/(c-l-a*h+a*u);return c+a*u===l+a*h||s[3]*(l-c)+o[3]*(h-u)+l*h==c*u?null:d}static getLesserNonNegativeNonNull(t,r){return null!==r&&r>=0&&r{for(let t in this.tileManagers){let r=this.tileManagers[t].getSource().type;("vector"===r||"geojson"===r)&&this.tileManagers[t].reload()}},this.map=t,this.dispatcher=new Fw(LS(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(t,r)=>this.getGlyphs(t,r)),this.dispatcher.registerMessageHandler("GI",(t,r)=>this.getImages(t,r)),this.dispatcher.registerMessageHandler("GDA",(t,r)=>this.getDashes(t,r)),this.imageManager=new Ft,this.imageManager.setEventedParent(this),this.imageManager.setMissingImageResolver(t._missingStyleImageResolver),this.patternAtlas=new Fr(this.imageManager);let a=(null==(i=t._container)?void 0:i.lang)||"u">typeof document&&(null==(n=document.documentElement)?void 0:n.lang)||void 0;this.glyphManager=new Fd(t._requestManager,r.localIdeographFontFamily,a),this.lineAtlas=new Fy(256,512),this.crossTileSymbolIndex=new Op,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",xE()),LV().on(FU,this._rtlPluginLoaded),this.on("data",t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;let r=this.tileManagers[t.sourceId];if(!r)return;let i=r.getSource();if(i?.vectorLayerIds)for(let t in this._layers){let r=this._layers[t];r.source===i.id&&this._validateLayer(r)}})}_setInitialValues(){var t;this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new Su,this._imagesListDirty=!1,this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this._symbolPlacementTriggered=!1,this._placedProjectionTransition=void 0,this.crossTileSymbolIndex=new((null==(t=this.crossTileSymbolIndex)?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,r){var i,n,a;this._checkLoaded();let o=null===r?null!=(a=null==(n=null==(i=this.stylesheet.state)?void 0:i[t])?void 0:n.default)?a:null:r;if(xh(o,this._globalState[t]))return this;this._globalState[t]=o,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();let r=[];for(let i in t)xh(this._globalState[i],t[i].default)||(r.push(i),this._globalState[i]=t[i].default);this._applyGlobalStateChanges(r)}_applyGlobalStateChanges(t){if(0===t.length)return;let r=new Set,i={};for(let n of t)for(let t in i[n]=this._globalState[n],this._layers){let i=this._layers[t],a=i.getLayoutAffectingGlobalStateRefs(),o=i.getPaintAffectingGlobalStateRefs(),s=i.getVisibilityAffectingGlobalStateRefs();if(a.has(n)&&r.add(i.source),o.has(n))for(let{name:t,value:r}of o.get(n))this._updatePaintProperty(i,t,r);s?.has(n)&&(i.recalculateVisibility(),this._updateLayer(i))}for(let t in this.dispatcher.broadcast("UGS",i),this.tileManagers)r.has(t)&&(this._reloadSource(t),this._changed=!0)}loadURL(t){return _(this,arguments,function*(t,r={},i){this.fire(new z1("dataloading")),r.validate="boolean"!=typeof r.validate||r.validate,this._loadStyleRequest=new AbortController;let n=this._loadStyleRequest;try{let a=yield this.map._requestManager.transformRequest(t,"Style");xA(n.signal);let o=yield ME(a,n);this._loadStyleRequest===n&&(this._loadStyleRequest=null),this._load(o.data,r,i)}catch(t){this._loadStyleRequest===n&&(this._loadStyleRequest=null),t&&!n.signal.aborted&&this.fire(new ML(vJ(t)))}})}loadJSON(t,r={},i){this.fire(new z1("dataloading")),this._frameRequest=new AbortController,zH.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(t,r,i)}).catch(()=>{})}loadEmpty(){this.fire(new z1("dataloading")),this._load(Oq,{validate:!1})}_load(t,r,i){var n,a,o;let s=r.transformStyle?r.transformStyle(i,t):t;if(!(r.validate&&_2(this,s))){for(let t in s=f({},s),this._loaded=!0,this.stylesheet=s,s.sources)this.addSource(t,s.sources[t],{validate:!1});s.sprite?this._loadSprite(s.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(s.glyphs),this.glyphManager.setFontFaces(s["font-faces"]),this._createLayers(),this.light=new Fp(null!=(n=this.stylesheet.light)?n:{},this._globalState),this._setProjectionInternal((null==(a=this.stylesheet.projection)?void 0:a.type)||"mercator"),this.sky=new Fg(this.stylesheet.sky,this._globalState),this.map.setTerrain(null!=(o=this.stylesheet.terrain)?o:null,{validate:!1}),this.fire(new z1("data")),this.fire(new z0)}}_createLayers(){var t,r,i;let n=Lf(this.stylesheet.layers);for(let a of(this.setGlobalState(null!=(t=this.stylesheet.state)?t:null),this.dispatcher.broadcast("SL",n),this._order=n.map(t=>t.id),this._layers={},this._serializedLayers=null,n)){let t=Ae(a,this._globalState);if(t.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=t,SC(t)&&this.tileManagers[t.source]){let n=null!=(i=null==(r=a.paint)?void 0:r["raster-fade-duration"])?i:t.paint.get("raster-fade-duration");this.tileManagers[t.source].setRasterFadeDuration(n)}}}_loadSprite(t,r=!1,i){return _(this,null,function*(){let n;this.imageManager.setLoaded(!1);let a=new AbortController;this._spriteRequest=a;try{let i=yield function(t,r,i,n){return _(this,null,function*(){let a=L_(t),o=i>1?"@2x":"",s={},l={};for(let{id:t,url:i}of a){let a=yield r.transformRequest(Lw(i,o,".json"),"SpriteJSON");s[t]=ME(a,n);let u=yield r.transformRequest(Lw(i,o,".png"),"SpriteImage");l[t]=zX.getImage(u,n)}return yield Promise.all([...Object.values(s),...Object.values(l)]),function(t,r){return _(this,null,function*(){let i={};for(let n in t){i[n]={};let a=(yield r[n]).data;if(!a)throw Error(`Could not load sprite image for ${n}: the response is empty`);let o=zH.getImageCanvasContext(a),s=(yield t[n]).data;for(let t in s){let{width:r,height:a,x:l,y:u,sdf:c,pixelRatio:h,stretchX:d,stretchY:f,content:p,textFitWidth:m,textFitHeight:g}=s[t],y={width:r,height:a,x:l,y:u,context:o};i[n][t]={data:null,pixelRatio:h,sdf:c,stretchX:d,stretchY:f,content:p,textFitWidth:m,textFitHeight:g,spriteData:y}}}return i})}(s,l)})}(t,this.map._requestManager,this.map.getPixelRatio(),a);if(!i)return;for(let t in i){let{loaded:n,removed:a}=this.imageManager.setSpriteImages(t,i[t]);this._markImagesChanged(a),r&&this._markImagesChanged(n)}}catch(t){n=t,a.signal.aborted||this.fire(new ML(n))}finally{this._spriteRequest=null,this.imageManager.setLoaded(!0),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this.imageManager.listImages()),this.fire(new z1("data")),i?.(n)}})}_unloadSprite(){this._markImagesChanged(this.imageManager.removeAllSpriteImages()),this._imagesListDirty=!0,this._changed=!0,this.fire(new z1("data"))}_validateLayer(t){let r=this.tileManagers[t.source];if(!r)return;let i=t.sourceLayer;if(!i)return;let n=r.getSource();("geojson"===n.type||n.vectorLayerIds&&!n.vectorLayerIds.includes(i))&&this.fire(new ML(Error(`Source layer "${i}" does not exist on source "${n.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(t,r=!1){let i=this._serializedAllLayers();if(!t||0===t.length)return Object.values(r?xd(i):i);let n=[];for(let a of t)if(i[a]){let t=r?xd(i[a]):i[a];n.push(t)}return n}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;for(let r of(t=this._serializedLayers={},Object.keys(this._layers))){let i=this._layers[r];"custom"!==i.type&&(t[r]=i.serialize())}return t}hasTransitions(){var t,r,i;if(null!=(t=this.light)&&t.hasTransition()||null!=(r=this.sky)&&r.hasTransition()||null!=(i=this.projection)&&i.hasTransition())return!0;for(let t in this.tileManagers)if(this.tileManagers[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading.")}update(t){if(!this._loaded)return;let r=this._changed;if(r){this._imagesListDirty&&(this._imagesListDirty=(this.dispatcher.broadcast("SI",this.imageManager.listImages()),!1));let r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(let t in(r.length||i.length)&&this._updateWorkerLayers(r,i),this._updatedSources){let r=this._updatedSources[t];if("reload"===r)this._reloadSource(t);else if("clear"===r)this._clearSource(t);else throw Error(`Invalid action ${r}`)}for(let r in this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs(),this._updatedPaintProps)this._layers[r].updateTransitions(t);this._resetUpdates()}let i={};for(let t in this.tileManagers){let r=this.tileManagers[t];i[t]=r.used,r.used=!1}let n=this.imageManager.listImages();for(let r of this._order){let i=this._layers[r];i.recalculate(t,n),!i.isHidden(t.zoom)&&i.source&&(this.tileManagers[i.source].used=!0)}for(let t in i){let r=this.tileManagers[t];!!i[t]!=!!r.used&&r.fire(new z2("data",{sourceDataType:"visibility",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,r&&this.fire(new z1("data"))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let r in this.tileManagers)this.tileManagers[r].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,r){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:r})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,r={}){var i;this._checkLoaded();let n=this.serialize();if(t=r.transformStyle?r.transformStyle(n,t):t,(null==(i=r.validate)||i)&&_2(this,t))return!1;(t=xd(t)).layers=Lf(t.layers);let a=function(t,r){if(!t)return[{command:"setStyle",args:[r]}];let i=[];try{if(!Lp(t.version,r.version))return[{command:"setStyle",args:[r]}];Lp(t.center,r.center)||i.push({command:"setCenter",args:[r.center]}),Lp(t.state,r.state)||i.push({command:"setGlobalState",args:[r.state]}),Lp(t.centerAltitude,r.centerAltitude)||i.push({command:"setCenterAltitude",args:[r.centerAltitude]}),Lp(t.zoom,r.zoom)||i.push({command:"setZoom",args:[r.zoom]}),Lp(t.bearing,r.bearing)||i.push({command:"setBearing",args:[r.bearing]}),Lp(t.pitch,r.pitch)||i.push({command:"setPitch",args:[r.pitch]}),Lp(t.roll,r.roll)||i.push({command:"setRoll",args:[r.roll]}),Lp(t.sprite,r.sprite)||i.push({command:"setSprite",args:[r.sprite]}),Lp(t.glyphs,r.glyphs)||i.push({command:"setGlyphs",args:[r.glyphs]}),Lp(t["font-faces"],r["font-faces"])||i.push({command:"setFontFaces",args:[r["font-faces"]]}),Lp(t.transition,r.transition)||i.push({command:"setTransition",args:[r.transition]}),Lp(t.light,r.light)||i.push({command:"setLight",args:[r.light]}),Lp(t.terrain,r.terrain)||i.push({command:"setTerrain",args:[r.terrain]}),Lp(t.sky,r.sky)||i.push({command:"setSky",args:[r.sky]}),Lp(t.projection,r.projection)||i.push({command:"setProjection",args:[r.projection]});let n={},a=[];!function(t,r,i,n){let a;for(a in t||(t={}),r||(r={}),t)Object.prototype.hasOwnProperty.call(t,a)&&(Object.prototype.hasOwnProperty.call(r,a)||Ly(a,i,n));for(a in r){var o;Object.prototype.hasOwnProperty.call(r,a)&&(Object.prototype.hasOwnProperty.call(t,a)?Lp(t[a],r[a])||("geojson"===t[a].type&&"geojson"===r[a].type&&function(t,r,i){let n;for(n in t[i])if(Object.prototype.hasOwnProperty.call(t[i],n)&&"data"!==n&&!Lp(t[i][n],r[i][n]))return!1;for(n in r[i])if(Object.prototype.hasOwnProperty.call(r[i],n)&&"data"!==n&&!Lp(t[i][n],r[i][n]))return!1;return!0}(t,r,a)?Lm(i,{command:"setGeoJSONSourceData",args:[a,r[a].data]}):(o=r,Ly(a,i,n),Lg(a,o,i))):Lg(a,r,i))}}(t.sources,r.sources,a,n);let o=[];t.layers&&t.layers.forEach(t=>{"source"in t&&n[t.source]?i.push({command:"removeLayer",args:[t.id]}):o.push(t)}),i=i.concat(a),function(t,r,i){t||(t=[]),r||(r=[]);let n=t.map(Lx),a=r.map(Lx),o=t.reduce(Lb,{}),s=r.reduce(Lb,{}),l=n.slice(),u=Object.create(null),c,h,d,f,p;for(let t=0,r=0;t0)throw Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(let t of o.operations)t();return this.stylesheet=t,this._serializedLayers=null,this.fire(new z0({style:this})),!0}_getOperationsToPerform(t){let r=[],i=[];for(let n of t)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":r.push(()=>this.addLayer.apply(this,n.args));break;case"removeLayer":r.push(()=>this.removeLayer.apply(this,n.args));break;case"setPaintProperty":r.push(()=>this.setPaintProperty.apply(this,n.args));break;case"setLayoutProperty":r.push(()=>this.setLayoutProperty.apply(this,n.args));break;case"setFilter":r.push(()=>this.setFilter.apply(this,n.args));break;case"addSource":r.push(()=>this.addSource.apply(this,n.args));break;case"removeSource":r.push(()=>this.removeSource.apply(this,n.args));break;case"setLayerZoomRange":r.push(()=>this.setLayerZoomRange.apply(this,n.args));break;case"setLight":r.push(()=>this.setLight.apply(this,n.args));break;case"setGeoJSONSourceData":r.push(()=>this.setGeoJSONSourceData.apply(this,n.args));break;case"setGlyphs":r.push(()=>this.setGlyphs.apply(this,n.args));break;case"setFontFaces":r.push(()=>this.setFontFaces.apply(this,n.args));break;case"setSprite":r.push(()=>this.setSprite.apply(this,n.args));break;case"setTerrain":r.push(()=>this.map.setTerrain.apply(this,n.args));break;case"setSky":r.push(()=>this.setSky.apply(this,n.args));break;case"setProjection":this.setProjection.apply(this,n.args);break;case"setGlobalState":r.push(()=>this.setGlobalState.apply(this,n.args));break;case"setTransition":r.push(()=>{});break;default:i.push(n.command)}return{operations:r,unimplemented:i}}addImage(t,r){this.getImage(t)?this.fire(new ML(Error(`An image named "${t}" already exists.`))):(this.imageManager.addImage(t,r),this._afterImageUpdated(t))}updateImage(t,r){this.imageManager.updateImage(t,r)}getImage(t){return this.imageManager.getImage(t)}setMissingImageResolver(t){this.imageManager.setMissingImageResolver(t)}removeImage(t){this.getImage(t)?(this.imageManager.removeImage(t),this._afterImageUpdated(t)):this.fire(new ML(Error(`An image named "${t}" does not exist.`)))}_markImagesChanged(t){for(let r of t)this._changedImages[r]=!0}_afterImageUpdated(t){this._changedImages[t]=!0,this._imagesListDirty=!0,this._changed=!0,this.fire(new z1("data"))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,r,i={}){var n;if(this._checkLoaded(),void 0!==this.tileManagers[t])throw Error(`Source "${t}" already exists.`);if(!r.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(So.has(r.type)&&this._validate(Sa.source,`sources.${t}`,r,null,i))return;null!=(n=this.map)&&n._collectResourceTiming&&(r.collectResourceTiming=!0);let a=this.tileManagers[t]=new FJ(t,r,this.dispatcher);a.style=this,a.setEventedParent(this,()=>({isSourceLoaded:a.loaded(),source:a.serialize(),sourceId:t})),a.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.tileManagers[t])throw Error(`There is no source with this ID=${t}`);for(let r in this._layers)if(this._layers[r].source===t)return this.fire(new ML(Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));let r=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],r.fire(new z2("data",{sourceDataType:"metadata",sourceId:t})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,r){if(this._checkLoaded(),void 0===this.tileManagers[t])throw Error(`There is no source with this ID=${t}`);let i=this.tileManagers[t].getSource();if("geojson"!==i.type)throw Error(`geojsonSource.type is ${i.type}, which is !== 'geojson`);i.setData(r),this._changed=!0}getSource(t){var r;return null==(r=this.tileManagers[t])?void 0:r.getSource()}addLayer(t,r,i={}){let n;this._checkLoaded();let a=t.id;if(this.getLayer(a))return void this.fire(new ML(Error(`Layer "${a}" already exists on this map.`)));if("custom"===t.type){var o;let r,i;if(_3(this,(r=[],void 0===(i=(o=t).id)&&r.push(new MR(`layers.${i}`,null,'missing required property "id"')),void 0===o.render&&r.push(new MR(`layers.${i}`,null,'missing required method "render"')),o.renderingMode&&"2d"!==o.renderingMode&&"3d"!==o.renderingMode&&r.push(new MR(`layers.${i}`,null,'property "renderingMode" must be either "2d" or "3d"')),r)))return;n=Ae(t,this._globalState)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(a,t.source),t=xn(t=xd(t),{source:a})),this._validate(Sa.layer,`layers.${a}`,t,{arrayIndex:-1},i))return;n=Ae(t,this._globalState),this._validateLayer(n),n.setEventedParent(this,{layer:{id:a}})}let s=r?this._order.indexOf(r):this._order.length;if(r&&-1===s)return void this.fire(new ML(Error(`Cannot add layer "${a}" before non-existing layer "${r}".`)));if(this._order.splice(s,0,a),this._layerOrderChanged=!0,this._layers[a]=n,this._removedLayers[a]&&n.source&&"custom"!==n.type){let t=this._removedLayers[a];delete this._removedLayers[a],t.type===n.type?(this._updatedSources[n.source]="reload",this.tileManagers[n.source].pause()):this._updatedSources[n.source]="clear"}this._updateLayer(n),n.onAdd&&n.onAdd(this.map)}moveLayer(t,r){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new ML(Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===r)return;if(r&&!this._order.includes(r))return void this.fire(new ML(Error(`Cannot move layer "${t}" before non-existing layer "${r}".`)));let i=this._order.indexOf(t);this._order.splice(i,1);let n=r?this._order.indexOf(r):this._order.length;this._order.splice(n,0,t),this._layerOrderChanged=!0}removeLayer(t){var r;this._checkLoaded();let i=this._layers[t];if(!i)return void this.fire(new ML(Error(`Cannot remove non-existing layer "${t}".`)));i.setEventedParent(null);let n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=i,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],"symbol"===i.type&&i.source&&(null==(r=this.tileManagers[i.source])||r.resetMaxContentElevation()),i.onRemove&&i.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,r,i){this._checkLoaded();let n=this.getLayer(t);n?(n.minzoom!==r||n.maxzoom!==i)&&(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new ML(Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,r,i={}){this._checkLoaded();let n=this.getLayer(t);if(!n)return void this.fire(new ML(Error(`Cannot filter non-existing layer "${t}".`)));if(!xh(n.filter,r)){if(null==r){n.setFilter(void 0),this._updateLayer(n);return}this._validate(Sa.filter,`layers.${n.id}.filter`,r,null,i)||(n.setFilter(xd(r)),this._updateLayer(n))}}getFilter(t){return xd(this.getLayer(t).filter)}setLayoutProperty(t,r,i,n={}){this._checkLoaded();let a=this.getLayer(t);a?xh(a.getLayoutProperty(r),i)||(a.setLayoutProperty(r,i,n),this._updateLayer(a)):this.fire(new ML(Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,r){let i=this.getLayer(t);return i?i.getLayoutProperty(r):void this.fire(new ML(Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,r,i,n={}){this._checkLoaded();let a=this.getLayer(t);a?xh(a.getPaintProperty(r),i)||this._updatePaintProperty(a,r,i,n):this.fire(new ML(Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,r,i,n={}){t.setPaintProperty(r,i,n)&&this._updateLayer(t),SC(t)&&"raster-fade-duration"===r&&this.tileManagers[t.source].setRasterFadeDuration(i),this._changed=!0,this._updatedPaintProps[t.id]=!0,"symbol"===t.type&&this.triggerSymbolPlacement(),this._serializedLayers=null}getPaintProperty(t,r){return this.getLayer(t).getPaintProperty(r)}setFeatureState(t,r){this._checkLoaded();let i=t.source,n=t.sourceLayer,a=this.tileManagers[i];if(void 0===a)return void this.fire(new ML(Error(`The source '${i}' does not exist in the map's style.`)));let o=a.getSource().type;if("geojson"===o&&n)return void this.fire(new ML(Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===o&&!n)return void this.fire(new ML(Error("The sourceLayer parameter must be provided for vector source types.")));if(void 0===t.id)return void this.fire(new ML(Error("The feature id parameter must be provided.")));let s=["__proto__","constructor","prototype"];r&&Object.keys(r).some(t=>s.includes(t))?this.fire(new ML(Error(`The feature state should not include one of the following keys: ${s}`))):a.setFeatureState(n,t.id,r)}removeFeatureState(t,r){this._checkLoaded();let i=t.source,n=this.tileManagers[i];if(void 0===n)return void this.fire(new ML(Error(`The source '${i}' does not exist in the map's style.`)));let a=n.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new ML(Error("A feature id is required to remove its specific state property."))):n.removeFeatureState(o,t.id,r):this.fire(new ML(Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let r=t.source,i=t.sourceLayer,n=this.tileManagers[r];return void 0===n?void this.fire(new ML(Error(`The source '${r}' does not exist in the map's style.`))):"vector"!==n.getSource().type||i?(void 0===t.id&&this.fire(new ML(Error("The feature id parameter must be provided."))),n.getFeatureState(i,t.id)):void this.fire(new ML(Error("The sourceLayer parameter must be provided for vector source types.")))}getTransition(){var t;return xn({duration:300,delay:0},null==(t=this.stylesheet)?void 0:t.transition)}serialize(){if(!this._loaded)return;let t=xu(this.tileManagers,t=>t.serialize()),r=this._serializeByIds(this._order,!0),i=this.map.getTerrain()||void 0,n=this.stylesheet;return xc({version:n.version,name:n.name,metadata:n.metadata,light:n.light,sky:n.sky,center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,sprite:n.sprite,glyphs:n.glyphs,"font-faces":n["font-faces"],transition:n.transition,projection:n.projection,state:n.state,sources:t,layers:r,terrain:i},t=>void 0!==t)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.tileManagers[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let r=t=>"fill-extrusion"===this._layers[t].type,i={},n=[];for(let a=this._order.length-1;a>=0;a--){let o=this._order[a];if(r(o))for(let r of(i[o]=a,t)){let t=r[o];if(t)for(let r of t)n.push(r)}}n.sort((t,r)=>r.intersectionZ-t.intersectionZ);let a=[];for(let o=this._order.length-1;o>=0;o--){let s=this._order[o];if(r(s))for(let t=n.length-1;t>=0;t--){let r=n[t].feature;if(i[r.layer.id]s(n.tileID,t,r):void 0)});var d,f=function(t){let r={},i={};for(let{queryResults:n,wrappedTileID:a}of t){i[a]||(i[a]={});let t=i[a];for(let i in n){let a=n[i];t[i]||(t[i]={});let o=t[i];for(let t of(r[i]||(r[i]=[]),a))o[t.featureIndex]||(o[t.featureIndex]=!0,r[i].push(t))}}return r}(h),p=t;for(let t in f)for(let r of f[t])LL(r,p);return f}(this.tileManagers[s],this._layers,o,t,l,i,this.map.terrain?(t,r,i)=>this.map.terrain.getElevation(t,r,i):void 0));return this.placement&&a.push(function(t,r,i,n,a,o,s){let l={},u=o.queryRenderedSymbols(n),c=[];for(let t of Object.keys(u).map(Number))c.push(s[t]);for(let i of(c.sort(LI),c)){let n=i.featureIndex.lookupSymbolFeatures(u[i.bucketInstanceId],r,i.bucketIndex,i.sourceLayerIndex,{filterSpec:a.filter,globalState:a.globalState},a.layers,a.availableImages,t);for(let t in n){l[t]||(l[t]=[]);let r=n[t];for(let n of(r.sort((t,r)=>{let n=i.featureSortOrder;if(n){let i=n.indexOf(t.featureIndex);return n.indexOf(r.featureIndex)-i}return r.featureIndex-t.featureIndex}),r))l[t].push(n)}}var h=l,d=t,f=i;for(let t in h)for(let r of h[t])LL(r,f[d[t].source]);return h}(this._layers,o,this.tileManagers,t,l,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,r){r?.filter&&this._validate(Sa.filter,"querySourceFeatures.filter",r.filter,null,r);let i=this.tileManagers[t];return i?function(t,r){let i=t.getRenderableIds().map(r=>t.getTileByID(r)),n=[],a={};for(let t of i){let i=t.tileID.canonical.key;a[i]||(a[i]=!0,t.querySourceFeatures(n,r))}return n}(i,r?p(f({},r),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,r={}){this._checkLoaded();let i=this.light.getLight(),n=!1;for(let r in t)if(!xh(t[r],i[r])){n=!0;break}if(!n)return;let a={now:Lu(),transition:xn({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,r),this.light.updateTransitions(a)}getProjection(){var t;return null==(t=this.stylesheet)?void 0:t.projection}setProjection(t){this._checkLoaded();let r=t??{type:"mercator"};if(this.stylesheet.projection=t,this.projection){if(this.projection.name===r.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(r.type)}getSky(){var t;return null==(t=this.stylesheet)?void 0:t.sky}setSky(t,r={}){this._checkLoaded();let i=this.getSky(),n=!1;if(!t&&!i)return;if(t&&!i)n=!0;else if(!t&&i)n=!0;else for(let r in t)if(!xh(t[r],i[r])){n=!0;break}if(!n)return;let a={now:Lu(),transition:xn({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,r),this.sky.updateTransitions(a)}_setProjectionInternal(t){var r;let i=function(t,r,i){let n={constrainOverride:r};if(Array.isArray(t)){let r=new Oz({type:t},i);return{projection:r,transform:new ON(n),cameraHelper:new OU(r)}}switch(t){case"mercator":return{projection:new Ob,transform:new OD(n),cameraHelper:new OC};case"globe":{let t=new Oz({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]},{});return{projection:t,transform:new ON(n),cameraHelper:new OU(t)}}case"vertical-perspective":return{projection:new OP,transform:new Oj(n),cameraHelper:new OV};default:return xf(`Unknown projection name: ${t}. Falling back to mercator projection.`),{projection:new Ob,transform:new OD(n),cameraHelper:new OC}}}(t,null==(r=this.map._camera)?void 0:r.transform.constrainOverride,this._globalState);for(let t in this.projection=i.projection,this.map.migrateProjection(i.transform,i.cameraHelper),this.tileManagers)this.tileManagers[t].reload()}_validate(t,r,i,n,a={}){return!1!==a.validate&&_5(this,t,f({key:r,style:this.serialize(),value:i},n),a)}_remove(t=!0){for(let t in this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null)),LV().off(FU,this._rtlPluginLoaded),this._layers)this._layers[t].setEventedParent(null);for(let t in this.tileManagers){let r=this.tileManagers[t];r.setEventedParent(null),r.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(let r in this.tileManagers)this.tileManagers[r].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.tileManagers)this._reloadSource(t)}triggerSymbolPlacement(){this._symbolPlacementTriggered=!0}_placementInputsChanged(t,r,i){var n,a,o;let s=this.pauseablePlacement;return!s||this._symbolPlacementTriggered||this._placedProjectionTransition!==(null==(n=this.projection)?void 0:n.transitionState)||s._showCollisionBoxes!==r||s.placement.collisionGroups.crossSourceCollisions!==i||s.placement.transform.renderWorldCopies!==t.renderWorldCopies||(a=s.placement.transform.modelViewProjectionMatrix,o=t.modelViewProjectionMatrix,a[0]!==o[0]||a[1]!==o[1]||a[2]!==o[2]||a[3]!==o[3]||a[4]!==o[4]||a[5]!==o[5]||a[6]!==o[6]||a[7]!==o[7]||a[8]!==o[8]||a[9]!==o[9]||a[10]!==o[10]||a[11]!==o[11]||a[12]!==o[12]||a[13]!==o[13]||a[14]!==o[14]||a[15]!==o[15])}_updatePlacement(t,r,i,n,a=!1){var o,s;let l=!1,u=!1,c={};for(let r of this._order){let i=this._layers[r];if("symbol"!==i.type)continue;if(!c[i.source]){let t=this.tileManagers[i.source];c[i.source]=t.getRenderableIds(!0).map(r=>t.getTileByID(r)).sort((t,r)=>r.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(r.tileID)?-1:1))}let n=this.crossTileSymbolIndex.addLayer(i,c[i.source],t.center.lng);l||(l=n)}this.crossTileSymbolIndex.pruneUnusedLayers(this._order),a||(a=this._layerOrderChanged||0===i);let h=l||this._placementInputsChanged(t,r,n),d=(null==(o=this.pauseablePlacement)?void 0:o.isDone())&&!this.placement.stillRecent(Lu(),t.zoom);if((a||!this.pauseablePlacement||d&&(h||this.placement.stale))&&(this._symbolPlacementTriggered=!1,this._placedProjectionTransition=null==(s=this.projection)?void 0:s.transitionState,this.pauseablePlacement=new Oo(t,this.map.terrain,this._order,a,r,i,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?h&&this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,c),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(Lu()),u=!0),l&&this.pauseablePlacement.placement.setStale()),u||l)for(let t of this._order){let r=this._layers[t];"symbol"===r.type&&this.placement.updateLayerOpacities(r,c[r.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(Lu())}_releaseSymbolFadeTiles(){for(let t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,r){return _(this,null,function*(){let t=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();let i=this.tileManagers[r.source];return i&&i.setDependencies(r.tileID.key,r.type,r.icons),t})}getGlyphs(t,r){return _(this,null,function*(){let t=yield this.glyphManager.getGlyphs(r.stacks),i=this.tileManagers[r.source];return i&&i.setDependencies(r.tileID.key,r.type,[""]),t})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,r={}){this._checkLoaded(),t&&this._validate(Sa.glyphs,"glyphs",t,null,r)||(this._changed=!0,this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getFontFaces(){return this.stylesheet["font-faces"]||null}setFontFaces(t){this._checkLoaded(),this._changed=!0,this._glyphsDidChange=!0,this.stylesheet["font-faces"]=t,this.glyphManager.setFontFaces(t)}getDashes(t,r){return _(this,null,function*(){let t={};for(let[i,n]of Object.entries(r.dashes))t[i]=this.lineAtlas.getDash(n.dasharray,n.round);return t})}addSprite(t,r,i={},n){this._checkLoaded();let a=[{id:t,url:r}],o=[...L_(this.stylesheet.sprite),...a];this._validate(Sa.sprite,"sprite",o,null,i)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,n))}removeSprite(t){this._checkLoaded();let r=L_(this.stylesheet.sprite);if(!r.find(r=>r.id===t))return void this.fire(new ML(Error(`Sprite "${t}" doesn't exists on this map.`)));let i=this.imageManager.removeSpriteImages(t);this._markImagesChanged(i),r.splice(r.findIndex(r=>r.id===t),1),this.stylesheet.sprite=r.length>0?r:void 0,this._imagesListDirty=!0,this._changed=!0,this.fire(new z1("data"))}getSprite(){return L_(this.stylesheet.sprite)}setSprite(t,r={},i){this._checkLoaded(),!(t&&this._validate(Sa.sprite,"sprite",t,null,r))&&(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,i):(this._unloadSprite(),i&&i(null)))}destroy(){for(let t in this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._loadStyleRequest&&(this._loadStyleRequest=(this._loadStyleRequest.abort(),null)),this._spriteRequest&&(this._spriteRequest=(this._spriteRequest.abort(),null)),this.tileManagers){let r=this.tileManagers[t];r.setEventedParent(null),r.onRemove(this.map)}for(let t in this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this.patternAtlas.destroy()),this.glyphManager&&this.glyphManager.destroy(),this._layers){let r=this._layers[t];r.setEventedParent(null),r.onRemove&&r.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}},OH=wi([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),O$=class{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,r,i,n,a,o,s,l,u){this.context=t;let c=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!c&&t({u_texture:new ER(t,r.u_texture),u_ele_delta:new EB(t,r.u_ele_delta),u_fog_matrix:new E$(t,r.u_fog_matrix),u_fog_color:new EU(t,r.u_fog_color),u_fog_ground_blend:new EB(t,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new EB(t,r.u_fog_ground_blend_opacity),u_horizon_color:new EU(t,r.u_horizon_color),u_horizon_fog_blend:new EB(t,r.u_horizon_fog_blend),u_is_globe_mode:new EB(t,r.u_is_globe_mode)}),OY=(t,r)=>({u_ele_delta:new EB(t,r.u_ele_delta)}),OZ=(t,r,i,n,a)=>({u_texture:0,u_ele_delta:t,u_fog_matrix:r,u_fog_color:i?i.properties.get("fog-color"):kt.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?0:i?i.calculateFogBlendOpacity(n):0,u_horizon_color:i?i.properties.get("horizon-color"):kt.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!a}),OX=t=>({u_ele_delta:t}),OK={ProjectionUBO:0,TerrainUBO:1,FrameUBO:2},OJ={float:[1,1],int:[1,1],vec2:[2,2],vec4:[4,4],mat4:[16,4]},OQ=class{constructor(t,r,i){this.context=t,this.binding=r,this.contentWords=i.contentWords;let n=t.gl;this.buffer=n.createBuffer(),n.bindBuffer(n.UNIFORM_BUFFER,this.buffer),n.bufferData(n.UNIFORM_BUFFER,4*i.sizeWords,n.DYNAMIC_DRAW),n.bindBufferBase(n.UNIFORM_BUFFER,r,this.buffer),this.uploaded=new Float32Array(i.sizeWords),this.pending=new Float32Array(i.sizeWords),this.uploadedWords=new Uint32Array(this.uploaded.buffer),this.pendingWords=new Uint32Array(this.pending.buffer),this.hasData=!1,this.bindingDirty=!1}upload(){let t=this.context.gl,r=!this.hasData;if(!r){let t=this.pendingWords,i=this.uploadedWords;for(let n=0;n=0&&(this.attributes[t]={location:r,isInteger:M.has(t)})}for(let t of(c.deleteShader(T),c.deleteShader(w),v))if(t&&!A[t]){let r=c.getUniformLocation(this.program,t);r&&(A[t]=r)}this.fixedUniforms=n(t,A),this.terrainUniforms=((t,r)=>({u_depth:new ER(t,r.u_depth),u_terrain:new ER(t,r.u_terrain)}))(t,A),this.binderUniforms=i?i.getUniforms(t,A):[]}draw(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g,y,v,x){var b,_,w;let T,A=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(a),t.setCullFace(o),l){let r;for(let r in t.activeTexture.set(A.TEXTURE2),A.bindTexture(A.TEXTURE_2D,l.depthTexture),t.activeTexture.set(A.TEXTURE3),A.bindTexture(A.TEXTURE_2D,l.texture),this.terrainUniforms)this.terrainUniforms[r].set(l[r]);_=t.terrainUniformBuffer,(r=_.pending).set(l.u_terrain_matrix,O3.u_terrain_matrix),r.set(l.u_terrain_unpack,O3.u_terrain_unpack),r[O3.u_terrain_dim]=l.u_terrain_dim,r[O3.u_terrain_exaggeration]=l.u_terrain_exaggeration,_.upload()}if(u&&(w=t.projectionUniformBuffer,(T=w.pending).set(u.mainMatrix,O1.u_projection_matrix),T.set(u.fallbackMatrix,O1.u_projection_fallback_matrix),T.set(u.tileMercatorCoords,O1.u_projection_tile_mercator_coords),T.set(u.clippingPlane,O1.u_projection_clipping_plane),T[O1.u_projection_transition]=u.projectionTransition,w.pendingWords[O1.u_projection_clip_antimeridian]=+!!u.clipAntimeridian,w.upload()),s)for(let t in this.fixedUniforms)this.fixedUniforms[t].set(s[t]);g&&g.setUniforms(t,this.binderUniforms,p,{zoom:m});let M=0;switch(r){case A.LINES:M=2;break;case A.TRIANGLES:M=3;break;case A.LINE_STRIP:M=1}for(let i of f.get())i.vaos||(i.vaos={}),(b=i.vaos)[c]||(b[c]=new O$),i.vaos[c].bind(t,this,h,g?g.getPaintVertexBuffers():[],d,i.vertexOffset,y,v,x),A.drawElements(r,i.primitiveLength*M,A.UNSIGNED_SHORT,i.primitiveOffset*M*2)}},O4=(t,r)=>({u_lightpos:new EN(t,r.u_lightpos),u_lightpos_globe:new EN(t,r.u_lightpos_globe),u_lightintensity:new EB(t,r.u_lightintensity),u_lightcolor:new EN(t,r.u_lightcolor),u_vertical_gradient:new EB(t,r.u_vertical_gradient),u_opacity:new EB(t,r.u_opacity),u_fill_translate:new Ej(t,r.u_fill_translate)}),O6=(t,r)=>({u_lightpos:new EN(t,r.u_lightpos),u_lightpos_globe:new EN(t,r.u_lightpos_globe),u_lightintensity:new EB(t,r.u_lightintensity),u_lightcolor:new EN(t,r.u_lightcolor),u_vertical_gradient:new EB(t,r.u_vertical_gradient),u_height_factor:new EB(t,r.u_height_factor),u_opacity:new EB(t,r.u_opacity),u_fill_translate:new Ej(t,r.u_fill_translate),u_image:new ER(t,r.u_image),u_texsize:new Ej(t,r.u_texsize),u_pixel_coord_upper:new Ej(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new Ej(t,r.u_pixel_coord_lower),u_scale:new EN(t,r.u_scale),u_fade:new EB(t,r.u_fade)}),O8=(t,r,i,n)=>{var a,o,s,l,u,c;let h=t.style.light,d=h.getCartesianPosition(),f=vd();"viewport"===h.properties.get("anchor")&&(o=Math.sin(a=t.transform.bearingInRadians),s=Math.cos(a),f[0]=s,f[1]=o,f[2]=0,f[3]=-o,f[4]=s,f[5]=0,f[6]=0,f[7]=0,f[8]=1),l=d[0],u=d[1],c=d[2],d[0]=l*f[0]+u*f[3]+c*f[6],d[1]=l*f[1]+u*f[4]+c*f[7],d[2]=l*f[2]+u*f[5]+c*f[8];let p=t.transform.transformLightDirection(d),m=h.properties.get("color");return{u_lightpos:d,u_lightpos_globe:p,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[m.r,m.g,m.b],u_vertical_gradient:+r,u_opacity:i,u_fill_translate:n}},O7=(t,r,i,n,a,o,s)=>xn(O8(t,r,i,n),PN(o,t,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8}),O9=(t,r)=>({u_fill_translate:new Ej(t,r.u_fill_translate)}),Re=(t,r)=>({u_image:new ER(t,r.u_image),u_texsize:new Ej(t,r.u_texsize),u_pixel_coord_upper:new Ej(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new Ej(t,r.u_pixel_coord_lower),u_scale:new EN(t,r.u_scale),u_fade:new EB(t,r.u_fade),u_sdf_pattern:new ER(t,r.u_sdf_pattern),u_fill_translate:new Ej(t,r.u_fill_translate)}),Rt=(t,r)=>({u_fill_translate:new Ej(t,r.u_fill_translate)}),Rr=(t,r)=>({u_image:new ER(t,r.u_image),u_texsize:new Ej(t,r.u_texsize),u_pixel_coord_upper:new Ej(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new Ej(t,r.u_pixel_coord_lower),u_scale:new EN(t,r.u_scale),u_fade:new EB(t,r.u_fade),u_sdf_pattern:new ER(t,r.u_sdf_pattern),u_fill_translate:new Ej(t,r.u_fill_translate)}),Ri=(t,r,i,n,a)=>xn(PN(r,t,i),{u_fill_translate:n,u_sdf_pattern:+!!a}),Rn=t=>({u_fill_translate:t}),Ra=t=>({u_fill_translate:t}),Ro=(t,r,i,n,a)=>Ri(t,r,i,n,a),Rs=(t,r)=>({u_scale_with_map:new ER(t,r.u_scale_with_map),u_pitch_with_map:new ER(t,r.u_pitch_with_map),u_extrude_scale:new Ej(t,r.u_extrude_scale),u_globe_extrude_scale:new EB(t,r.u_globe_extrude_scale),u_translate:new Ej(t,r.u_translate)}),Rl=(t,r,i,n,a)=>{let o=t.transform,s,l,u=0;if("map"===i.paint.get("circle-pitch-alignment")){let t=vK(r,1,o.zoom);s=!0,l=[t,t],u=t/(Mf*2**r.tileID.overscaledZ)*2*Math.PI*a}else s=!1,l=o.pixelsToGLUnits;return{u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_pitch_with_map:+s,u_extrude_scale:l,u_globe_extrude_scale:u,u_translate:n}},Ru=(t,r)=>({u_color:new EU(t,r.u_color),u_overlay:new ER(t,r.u_overlay),u_overlay_scale:new EB(t,r.u_overlay_scale)}),Rc=(t,r=1)=>({u_color:t,u_overlay:0,u_overlay_scale:r}),Rh=(t,r)=>({u_extrude_scale:new EB(t,r.u_extrude_scale),u_intensity:new EB(t,r.u_intensity),u_globe_extrude_scale:new EB(t,r.u_globe_extrude_scale)}),Rd=(t,r)=>({u_matrix:new E$(t,r.u_matrix),u_image:new ER(t,r.u_image),u_color_ramp:new ER(t,r.u_color_ramp),u_opacity:new EB(t,r.u_opacity)}),Rf=(t,r,i,n)=>{let a=vK(t,1,r)/(Mf*2**t.tileID.overscaledZ)*2*Math.PI*n;return{u_extrude_scale:vK(t,1,r),u_intensity:i,u_globe_extrude_scale:a}},Rp=(t,r,i,n)=>{let a=vf();return Ms(a,0,t.width,t.height,0,0,1),{u_matrix:a,u_image:i,u_color_ramp:n,u_opacity:r.paint.get("heatmap-opacity")}},Rm=(t,r)=>({u_image:new ER(t,r.u_image),u_latrange:new Ej(t,r.u_latrange),u_exaggeration:new EB(t,r.u_exaggeration),u_altitudes:new EG(t,r.u_altitudes),u_azimuths:new EG(t,r.u_azimuths),u_accent:new EU(t,r.u_accent),u_method:new ER(t,r.u_method),u_shadows:new Eq(t,r.u_shadows),u_highlights:new Eq(t,r.u_highlights)}),Rg=(t,r)=>({u_matrix:new E$(t,r.u_matrix),u_image:new ER(t,r.u_image),u_dimension:new Ej(t,r.u_dimension),u_zoom:new EB(t,r.u_zoom),u_unpack:new EV(t,r.u_unpack)}),Ry=(t,r,i)=>{var n;let a,o,s=i.paint.get("hillshade-accent-color"),l;switch(i.paint.get("hillshade-method")){case"basic":l=4;break;case"combined":l=1;break;case"igor":l=2;break;case"multidirectional":l=3;break;default:l=0}let u=i.getIlluminationProperties();for(let r=0;r{let i=r.stride,n=vf();return Ms(n,0,Mf,-Mf,0,0,1),vv(n,n,[0,-Mf,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}},Rx=(t,r)=>({u_image:new ER(t,r.u_image),u_unpack:new EV(t,r.u_unpack),u_dimension:new Ej(t,r.u_dimension),u_elevation_stops:new ER(t,r.u_elevation_stops),u_color_stops:new ER(t,r.u_color_stops),u_color_ramp_size:new ER(t,r.u_color_ramp_size),u_opacity:new EB(t,r.u_opacity)}),Rb=(t,r,i=0)=>({u_image:0,u_unpack:r.getUnpackVector(),u_dimension:[r.stride,r.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:i,u_opacity:t.paint.get("color-relief-opacity")}),R_=(t,r)=>({u_translation:new Ej(t,r.u_translation),u_ratio:new EB(t,r.u_ratio)}),Rw=(t,r)=>({u_translation:new Ej(t,r.u_translation),u_ratio:new EB(t,r.u_ratio),u_image:new ER(t,r.u_image),u_image_height:new EB(t,r.u_image_height)}),RT=(t,r)=>({u_translation:new Ej(t,r.u_translation),u_texsize:new Ej(t,r.u_texsize),u_ratio:new EB(t,r.u_ratio),u_image:new ER(t,r.u_image),u_scale:new EN(t,r.u_scale),u_fade:new EB(t,r.u_fade)}),RA=(t,r)=>({u_translation:new Ej(t,r.u_translation),u_ratio:new EB(t,r.u_ratio),u_image:new ER(t,r.u_image),u_mix:new EB(t,r.u_mix),u_tileratio:new EB(t,r.u_tileratio),u_crossfade_from:new EB(t,r.u_crossfade_from),u_crossfade_to:new EB(t,r.u_crossfade_to),u_lineatlas_width:new EB(t,r.u_lineatlas_width),u_lineatlas_height:new EB(t,r.u_lineatlas_height)}),RM=(t,r)=>({u_translation:new Ej(t,r.u_translation),u_ratio:new EB(t,r.u_ratio),u_image:new ER(t,r.u_image),u_image_height:new EB(t,r.u_image_height),u_tileratio:new EB(t,r.u_tileratio),u_crossfade_from:new EB(t,r.u_crossfade_from),u_crossfade_to:new EB(t,r.u_crossfade_to),u_image_dash:new ER(t,r.u_image_dash),u_mix:new EB(t,r.u_mix),u_lineatlas_width:new EB(t,r.u_lineatlas_width),u_lineatlas_height:new EB(t,r.u_lineatlas_height)}),Rk=(t,r,i,n)=>{let a=t.transform;return{u_translation:PU(t,r,i),u_ratio:n/vK(r,1,a.zoom)}},RS=(t,r,i,n,a)=>xn(Rk(t,r,i,n),{u_image:0,u_image_height:a}),RE=(t,r,i,n,a)=>{let o=t.transform,s=PV(r,o);return{u_translation:PU(t,r,i),u_texsize:r.imageAtlasTexture.size,u_ratio:n/vK(r,1,o.zoom),u_image:0,u_scale:[s,a.fromScale,a.toScale],u_fade:a.t}},RD=(t,r,i,n,a)=>{let o=PV(r,t.transform);return xn(Rk(t,r,i,n),{u_tileratio:o,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})},RC=(t,r,i,n,a,o)=>{let s=PV(r,t.transform);return xn(Rk(t,r,i,n),{u_image:0,u_image_height:o,u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})},RI=(t,r)=>({u_image:new ER(t,r.u_image),u_opacity:new EB(t,r.u_opacity)}),RL=(t,r)=>({u_image:r,u_opacity:t}),RP=(t,r)=>({u_is_size_zoom_constant:new ER(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new ER(t,r.u_is_size_feature_constant),u_size_t:new EB(t,r.u_size_t),u_size:new EB(t,r.u_size),u_rotate_symbol:new ER(t,r.u_rotate_symbol),u_label_plane_matrix:new E$(t,r.u_label_plane_matrix),u_coord_matrix:new E$(t,r.u_coord_matrix),u_is_text:new ER(t,r.u_is_text),u_pitch_with_map:new ER(t,r.u_pitch_with_map),u_is_along_line:new ER(t,r.u_is_along_line),u_is_variable_anchor:new ER(t,r.u_is_variable_anchor),u_texsize:new Ej(t,r.u_texsize),u_texture:new ER(t,r.u_texture),u_translation:new Ej(t,r.u_translation),u_pitched_scale:new EB(t,r.u_pitched_scale),u_is_offset:new ER(t,r.u_is_offset),u_height_anchor_ground:new ER(t,r.u_height_anchor_ground)}),Rz=(t,r)=>({u_is_size_zoom_constant:new ER(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new ER(t,r.u_is_size_feature_constant),u_size_t:new EB(t,r.u_size_t),u_size:new EB(t,r.u_size),u_rotate_symbol:new ER(t,r.u_rotate_symbol),u_label_plane_matrix:new E$(t,r.u_label_plane_matrix),u_coord_matrix:new E$(t,r.u_coord_matrix),u_is_text:new ER(t,r.u_is_text),u_pitch_with_map:new ER(t,r.u_pitch_with_map),u_is_along_line:new ER(t,r.u_is_along_line),u_is_variable_anchor:new ER(t,r.u_is_variable_anchor),u_texsize:new Ej(t,r.u_texsize),u_texture:new ER(t,r.u_texture),u_gamma_scale:new EB(t,r.u_gamma_scale),u_is_halo:new ER(t,r.u_is_halo),u_is_plain:new ER(t,r.u_is_plain),u_translation:new Ej(t,r.u_translation),u_pitched_scale:new EB(t,r.u_pitched_scale),u_is_offset:new ER(t,r.u_is_offset),u_height_anchor_ground:new ER(t,r.u_height_anchor_ground)}),RF=(t,r)=>({u_is_size_zoom_constant:new ER(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new ER(t,r.u_is_size_feature_constant),u_size_t:new EB(t,r.u_size_t),u_size:new EB(t,r.u_size),u_rotate_symbol:new ER(t,r.u_rotate_symbol),u_label_plane_matrix:new E$(t,r.u_label_plane_matrix),u_coord_matrix:new E$(t,r.u_coord_matrix),u_is_text:new ER(t,r.u_is_text),u_pitch_with_map:new ER(t,r.u_pitch_with_map),u_is_along_line:new ER(t,r.u_is_along_line),u_is_variable_anchor:new ER(t,r.u_is_variable_anchor),u_texsize:new Ej(t,r.u_texsize),u_texsize_icon:new Ej(t,r.u_texsize_icon),u_texture:new ER(t,r.u_texture),u_texture_icon:new ER(t,r.u_texture_icon),u_gamma_scale:new EB(t,r.u_gamma_scale),u_is_halo:new ER(t,r.u_is_halo),u_translation:new Ej(t,r.u_translation),u_pitched_scale:new EB(t,r.u_pitched_scale),u_is_offset:new ER(t,r.u_is_offset),u_height_anchor_ground:new ER(t,r.u_height_anchor_ground)}),RO=(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m)=>({u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_rotate_symbol:+i,u_label_plane_matrix:l,u_coord_matrix:u,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:a,u_is_variable_anchor:o,u_texsize:d,u_texture:0,u_translation:c,u_pitched_scale:f,u_is_offset:p,u_height_anchor_ground:+m}),RR=(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m,g)=>{let y=s.transform;return xn(RO(t,r,i,n,a,o,s,l,u,c,h,d,p,m,g),{u_gamma_scale:n?Math.cos(y.pitch*Math.PI/180)*y.cameraToCenterDistance:1,u_is_halo:+!!f,u_is_plain:1})},RB=(t,r,i,n,a,o,s,l,u,c,h,d,f,p,m)=>xn(RR(t,r,i,n,a,o,s,l,u,c,!0,h,!0,f,p,m),{u_texsize_icon:d,u_texture_icon:1}),Rj=(t,r)=>({u_opacity:new EB(t,r.u_opacity),u_color:new EU(t,r.u_color)}),RN=(t,r)=>({u_opacity:new EB(t,r.u_opacity),u_image:new ER(t,r.u_image),u_pattern_tl_a:new Ej(t,r.u_pattern_tl_a),u_pattern_br_a:new Ej(t,r.u_pattern_br_a),u_pattern_tl_b:new Ej(t,r.u_pattern_tl_b),u_pattern_br_b:new Ej(t,r.u_pattern_br_b),u_texsize:new Ej(t,r.u_texsize),u_mix:new EB(t,r.u_mix),u_pattern_size_a:new Ej(t,r.u_pattern_size_a),u_pattern_size_b:new Ej(t,r.u_pattern_size_b),u_scale_a:new EB(t,r.u_scale_a),u_scale_b:new EB(t,r.u_scale_b),u_pixel_coord_upper:new Ej(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new Ej(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new EB(t,r.u_tile_units_to_pixels)}),RV=(t,r)=>({u_opacity:t,u_color:r}),RU=(t,r,i,n,a)=>xn(function(t,r,i,n){let a=i.patternAtlas.getPattern(t.from.toString()),o=i.patternAtlas.getPattern(t.to.toString()),{width:s,height:l}=i.patternAtlas.getPixelSize(),u=2**n.tileID.overscaledZ,c=n.tileSize*2**i.transform.tileZoom/u,h=c*(n.tileID.canonical.x+n.tileID.wrap*u),d=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,l],u_mix:r.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:r.fromScale,u_scale_b:r.toScale,u_tile_units_to_pixels:1/vK(n,1,i.transform.tileZoom),u_pixel_coord_upper:[h>>16,d>>16],u_pixel_coord_lower:[65535&h,65535&d]}}(i,a,r,n),{u_opacity:t}),Rq=(t,r)=>({u_sun_pos:new EN(t,r.u_sun_pos),u_atmosphere_blend:new EB(t,r.u_atmosphere_blend),u_globe_position:new EN(t,r.u_globe_position),u_globe_radius:new EB(t,r.u_globe_radius),u_inv_proj_matrix:new E$(t,r.u_inv_proj_matrix)}),RG=(t,r,i,n,a)=>({u_sun_pos:t,u_atmosphere_blend:r,u_globe_position:i,u_globe_radius:n,u_inv_proj_matrix:a}),RH=(t,r)=>({u_sky_color:new EU(t,r.u_sky_color),u_horizon_color:new EU(t,r.u_horizon_color),u_horizon:new Ej(t,r.u_horizon),u_horizon_normal:new Ej(t,r.u_horizon_normal),u_sky_horizon_blend:new EB(t,r.u_sky_horizon_blend),u_sky_blend:new EB(t,r.u_sky_blend),u_inv_proj_matrix:new E$(t,r.u_inv_proj_matrix),u_globe_position:new EN(t,r.u_globe_position),u_globe_radius:new EB(t,r.u_globe_radius)}),R$=(t,r,i)=>{let n=Math.cos(r.rollInRadians),a=Math.sin(r.rollInRadians),o=Ts(r),s=r.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:t.properties.get("sky-color"),u_horizon_color:t.properties.get("horizon-color"),u_horizon:[(r.width/2-o*a)*i,(r.height/2+o*n)*i],u_horizon_normal:[-a,n],u_sky_horizon_blend:t.properties.get("sky-horizon-blend")*r.height/2*i,u_sky_blend:s,u_inv_proj_matrix:r.inverseProjectionMatrix,u_globe_position:PM(r),u_globe_radius:PA(r.worldSize,r.center.lat)}},RY={fillExtrusion:O4,fillExtrusionPattern:O6,fill:O9,fillPattern:Re,fillOutline:Rt,fillOutlinePattern:Rr,circle:Rs,collisionBox:RW=(t,r)=>({}),collisionCircle:RW,debug:Ru,depth:RW,clippingMask:RW,heatmap:Rh,heatmapTexture:Rd,hillshade:Rm,hillshadePrepare:Rg,colorRelief:Rx,line:R_,lineGradient:Rw,linePattern:RT,lineSDF:RA,lineGradientSDF:RM,layerOpacity:RI,raster:FI,symbolIcon:RP,symbolSDF:Rz,symbolTextAndIcon:RF,background:Rj,backgroundPattern:RN,terrain:OW,terrainDepth:OY,atmosphere:Rq,sky:RH},RZ=class{constructor(t,r,i){this.context=t;let n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||r.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let r=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}},RX={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},RK=class{constructor(t,r,i,n){this.length=r.length,this.attributes=i,this.itemSize=r.bytesPerElement,this.dynamicDraw=n,this.context=t;let a=t.gl;this.buffer=a.createBuffer(),t.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||r.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,r){for(let i of this.attributes){let n=r.attributes[i.name];void 0!==n&&t.enableVertexAttribArray(n.location)}}setVertexAttribPointers(t,r,i){for(let n of this.attributes){let a=r.attributes[n.name];if(void 0!==a){let r=n.offset+this.itemSize*(i||0);a.isInteger?t.vertexAttribIPointer(a.location,n.components,t[RX[n.type]],this.itemSize,r):t.vertexAttribPointer(a.location,n.components,t[RX[n.type]],!1,this.itemSize,r)}}}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}},RJ=class{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}},RQ=class extends RJ{getDefault(){return kt.transparent}set(t){let r=this.current;(t.r!==r.r||t.g!==r.g||t.b!==r.b||t.a!==r.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}},R0=class extends RJ{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}},R1=class extends RJ{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}},R2=class extends RJ{getDefault(){return[!0,!0,!0,!0]}set(t){let r=this.current;(t[0]!==r[0]||t[1]!==r[1]||t[2]!==r[2]||t[3]!==r[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}},R3=class extends RJ{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}},R5=class extends RJ{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}},R4=class extends RJ{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let r=this.current;(t.func!==r.func||t.ref!==r.ref||t.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}},R6=class extends RJ{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let r=this.current;(t[0]!==r[0]||t[1]!==r[1]||t[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}},R8=class extends RJ{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;t?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=t,this.dirty=!1}},R7=class extends RJ{getDefault(){return[0,1]}set(t){let r=this.current;(t[0]!==r[0]||t[1]!==r[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}},R9=class extends RJ{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;t?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=t,this.dirty=!1}},Be=class extends RJ{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}},Bt=class extends RJ{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;t?r.enable(r.BLEND):r.disable(r.BLEND),this.current=t,this.dirty=!1}},Br=class extends RJ{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let r=this.current;(t[0]!==r[0]||t[1]!==r[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}},Bi=class extends RJ{getDefault(){return kt.transparent}set(t){let r=this.current;(t.r!==r.r||t.g!==r.g||t.b!==r.b||t.a!==r.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}},Bn=class extends RJ{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}},Ba=class extends RJ{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;t?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=t,this.dirty=!1}},Bo=class extends RJ{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}},Bs=class extends RJ{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}},Bl=class extends RJ{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}},Bu=class extends RJ{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}},Bc=class extends RJ{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let r=this.current;(t[0]!==r[0]||t[1]!==r[1]||t[2]!==r[2]||t[3]!==r[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}},Bh=class extends RJ{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},Bd=class extends RJ{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,t),this.current=t,this.dirty=!1}},Bf=class extends RJ{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;r.bindTexture(r.TEXTURE_2D,t),this.current=t,this.dirty=!1}},Bp=class extends RJ{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},Bm=class extends RJ{getDefault(){return null}set(t){let r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},Bg=class extends RJ{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.bindVertexArray(t),this.current=t,this.dirty=!1)}},By=class extends RJ{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},Bv=class extends RJ{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},Bx=class extends RJ{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},Bb=class extends RJ{constructor(t,r){super(t),this.context=t,this.parent=r}getDefault(){return null}},B_=class extends Bb{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},Bw=class extends Bb{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,t),this.current=t,this.dirty=!1}},BT=class extends Bb{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,t),this.current=t,this.dirty=!1}},BA=class{constructor(t,r,i,n,a){this.context=t,this.width=r,this.height=i;let o=t.gl,s=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new B_(t,s),n)this.depthAttachment=a?new BT(t,s):new Bw(t,s);else if(a)throw Error("Stencil cannot be set without depth")}destroy(){let t=this.context.gl,r=this.colorAttachment.get();if(r&&t.deleteTexture(r),this.depthAttachment){let r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r)}t.deleteFramebuffer(this.framebuffer)}},Bk=(BM=PB([{name:"u_units_to_pixels",type:"vec2"},{name:"u_world_size",type:"vec2"},{name:"u_camera_to_center_distance",type:"float"},{name:"u_symbol_fade_change",type:"float"},{name:"u_aspect_ratio",type:"float"},{name:"u_device_pixel_ratio",type:"float"},{name:"u_viewport_size",type:"vec2"},{name:"u_pixel_extrude_scale",type:"vec2"},{name:"u_pitch",type:"float"}])).offsets,(BS=class{constructor(t,r,i){this.blendFunction=t,this.blendColor=r,this.mask=i}}).Replace=[1,0],BS.disabled=new BS(BS.Replace,kt.transparent,[!1,!1,!1,!1]),BS.unblended=new BS(BS.Replace,kt.transparent,[!0,!0,!0,!0]),BS.alphaBlended=new BS([1,771],kt.transparent,[!0,!0,!0,!0]),BE=class{constructor(t){this.gl=t,this.clearColor=new RQ(this),this.clearDepth=new R0(this),this.clearStencil=new R1(this),this.colorMask=new R2(this),this.depthMask=new R3(this),this.stencilMask=new R5(this),this.stencilFunc=new R4(this),this.stencilOp=new R6(this),this.stencilTest=new R8(this),this.depthRange=new R7(this),this.depthTest=new R9(this),this.depthFunc=new Be(this),this.blend=new Bt(this),this.blendFunc=new Br(this),this.blendColor=new Bi(this),this.blendEquation=new Bn(this),this.cullFace=new Ba(this),this.cullFaceSide=new Bo(this),this.frontFace=new Bs(this),this.program=new Bl(this),this.activeTexture=new Bu(this),this.viewport=new Bc(this),this.bindFramebuffer=new Bh(this),this.bindRenderbuffer=new Bd(this),this.bindTexture=new Bf(this),this.bindVertexBuffer=new Bp(this),this.bindElementBuffer=new Bm(this),this.bindVertexArray=new Bg(this),this.pixelStoreUnpack=new By(this),this.pixelStoreUnpackPremultiplyAlpha=new Bv(this),this.pixelStoreUnpackFlipY=new Bx(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),t.getExtension("EXT_color_buffer_half_float"),t.getExtension("EXT_color_buffer_float"),this.projectionUniformBuffer=function(t){return new OQ(t,OK.ProjectionUBO,O0)}(this),this.terrainUniformBuffer=function(t){return new OQ(t,OK.TerrainUBO,O2)}(this),this.frameUniformBuffer=function(t){return new OQ(t,OK.FrameUBO,BM)}(this)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0,this.projectionUniformBuffer.bindingDirty=!0,this.terrainUniformBuffer.bindingDirty=!0,this.frameUniformBuffer.bindingDirty=!0}setCustomLayerDefaults(){this.unbindVAO(),this.cullFace.setDefault(),this.activeTexture.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}createIndexBuffer(t,r){return new RZ(this,t,r)}createVertexBuffer(t,r,i){return new RK(this,t,r,i)}createRenderbuffer(t,r,i){let n=this.gl,a=n.createRenderbuffer();return this.bindRenderbuffer.set(a),n.renderbufferStorage(n.RENDERBUFFER,t,r,i),this.bindRenderbuffer.set(null),a}createFramebuffer(t,r,i,n){return new BA(this,t,r,i,n)}clear({color:t,depth:r,stencil:i}){let n=this.gl,a=0;t&&(a|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(a|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),void 0!==i&&(a|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),n.clear(a)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){xh(t.blendFunction,BS.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){return this.gl.createVertexArray()}deleteVertexArray(t){this.gl.deleteVertexArray(t)}unbindVAO(){this.bindVertexArray.set(null)}},(BD=class{constructor(t,r,i){this.func=t,this.mask=r,this.range=i}}).ReadOnly=!1,BD.ReadWrite=!0,BD.disabled=new BD(519,BD.ReadOnly,[0,1]),(BC=class{constructor(t,r,i,n,a,o){this.test=t,this.ref=r,this.mask=i,this.fail=n,this.depthFail=a,this.pass=o}}).disabled=new BC({func:519,mask:0},0,0,7680,7680,7680),(BI=class{constructor(t,r,i){this.enable=t,this.mode=r,this.frontFace=i}}).disabled=new BI(!1,1029,2305),BI.backCCW=new BI(!0,1029,2305),BI.frontCCW=new BI(!0,1028,2305),BP=vm(new Float32Array(16)),Bz=0,BF=[new vu(0,0),new vu(Mf,0),new vu(Mf,Mf),new vu(0,Mf)],BO=new kt(1,0,0,1),BR=new kt(0,1,0,1),BB=new kt(0,0,1,1),Bj=new kt(1,0,1,1),BN=new kt(0,1,1,1),BV={symbol:PG,circle:PW,heatmap:PY,line:P0,fill:P3,fillExtrusion:P8,hillshade:P9,colorRelief:zt,raster:zi,background:za,sky:zp,atmosphere:zm,custom:zh,debug:zc,debugPadding:zo,terrainDepth:zd},(BU=class{constructor(t,r){this.drawFunctions=BV,this.context=new BE(t),this.transform=r,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:vm(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=FJ.maxOverzooming+FJ.maxUnderzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new Op}resize(t,r,i){if(this.width=Math.floor(t*i),this.height=Math.floor(r*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let t of this.style._order)this.style._layers[t].resize()}setup(){let t=this.context,r=new Es;r.emplaceBack(0,0),r.emplaceBack(Mf,0),r.emplaceBack(0,Mf),r.emplaceBack(Mf,Mf),this.tileExtentBuffer=t.createVertexBuffer(r,Fz.members),this.tileExtentSegments=ED.simpleSegment(0,0,4,2);let i=new Es;i.emplaceBack(0,0),i.emplaceBack(Mf,0),i.emplaceBack(0,Mf),i.emplaceBack(Mf,Mf),this.debugBuffer=t.createVertexBuffer(i,Fz.members),this.debugSegments=ED.simpleSegment(0,0,4,5);let n=new Eu;n.emplaceBack(0,0,0,0),n.emplaceBack(Mf,0,Mf,0),n.emplaceBack(0,Mf,0,Mf),n.emplaceBack(Mf,Mf,Mf,Mf),this.rasterBoundsBuffer=t.createVertexBuffer(n,OH.members),this.rasterBoundsSegments=ED.simpleSegment(0,0,4,2);let a=new Es;a.emplaceBack(0,0),a.emplaceBack(Mf,0),a.emplaceBack(0,Mf),a.emplaceBack(Mf,Mf),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(a,Fz.members),this.rasterBoundsSegmentsPosOnly=ED.simpleSegment(0,0,4,5);let o=new Es;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(o,Fz.members),this.viewportSegments=ED.simpleSegment(0,0,4,2);let s=new Ek;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(s);let l=new EA;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);let u=this.context.gl;this.stencilClearMode=new BC({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO),this.tileExtentMesh=new FP(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let i=vf();Ms(i,0,this.width,this.height,0,0,1),vx(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask",null,!0).draw(t,r.TRIANGLES,BD.disabled,this.stencilClearMode,BS.disabled,BI.disabled,null,null,{mainMatrix:i,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:i,clipAntimeridian:!1},"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(t,r,i){if(this.currentStencilSource===t.source||!t.isTileClipped()||!r?.length)return;this.currentStencilSource=t.source,this.nextStencilID+r.length>256&&this.clearStencil();let n=this.context;n.setColorMode(BS.disabled),n.setDepthMode(BD.disabled);let a={};for(let t of r)a[t.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(a,r,i,!0),this._renderTileMasks(a,r,i,!1),this._tileClippingMaskIDs=a}_renderTileMasks(t,r,i,n){let a=this.context,o=a.gl,s=this.style.projection,l=this.transform,u=this.useProgram("clippingMask");for(let c of r){let r=t[c.key],h=this.getTerrainDataForTile(c,i),d=s.getMeshFromTileID(this.context,c.canonical,n,!0,"stencil"),f=l.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!i,applyTerrainMatrix:!0});u.draw(a,o.TRIANGLES,BD.disabled,new BC({func:o.ALWAYS,mask:0},r,255,o.KEEP,o.KEEP,o.REPLACE),BS.disabled,i?BI.disabled:BI.backCCW,null,h,f,"$clipping",d.vertexBuffer,d.indexBuffer,d.segments)}}getTerrainDataForTile(t,r){var i,n;return r&&(null==(i=this.style.projection)?void 0:i.name)==="mercator"?null:(null==(n=this.style.map.terrain)?void 0:n.getTerrainData(t))||null}_renderTilesDepthBuffer(){var t;let r=this.context,i=r.gl,n=this.style.projection,a=this.transform,o=this.useProgram("depth"),s=this.getDepthModeFor3D();for(let l of L$(a,{tileSize:a.tileSize})){let u=null==(t=this.style.map.terrain)?void 0:t.getTerrainData(l),c=n.getMeshFromTileID(this.context,l.canonical,!0,!0,"raster"),h=a.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(r,i.TRIANGLES,s,BC.disabled,BS.disabled,BI.backCCW,null,u,h,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,r=this.context.gl;return new BC({func:r.NOTEQUAL,mask:255},t,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(t){let r=this.context.gl;return new BC({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,r.KEEP,r.KEEP,r.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let r=this.context.gl,i=t.sort((t,r)=>r.overscaledZ-t.overscaledZ),n=i[i.length-1].overscaledZ,a=i[0].overscaledZ-n+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();let t={};for(let i=0;ir.overscaledZ-t.overscaledZ),n=i[i.length-1].overscaledZ,a=i[0].overscaledZ-n+1;if(this.clearStencil(),a>1){let t={},o={};for(let i=0;i0});this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.patternAtlas=t.patternAtlas,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(Lu()),function(t,r){let i=t.pending,{transform:n}=r,a=r.context.gl;i[Bk.u_units_to_pixels]=1/n.pixelsToGLUnits[0],i[Bk.u_units_to_pixels+1]=1/n.pixelsToGLUnits[1],i[Bk.u_world_size]=a.drawingBufferWidth,i[Bk.u_world_size+1]=a.drawingBufferHeight,i[Bk.u_camera_to_center_distance]=n.cameraToCenterDistance,i[Bk.u_symbol_fade_change]=r.options.fadeDuration?r.symbolFadeChange:1,i[Bk.u_aspect_ratio]=n.width/n.height,i[Bk.u_device_pixel_ratio]=r.pixelRatio,i[Bk.u_viewport_size]=n.width,i[Bk.u_viewport_size+1]=n.height,i[Bk.u_pixel_extrude_scale]=1/n.width,i[Bk.u_pixel_extrude_scale+1]=1/n.height,i[Bk.u_pitch]=n.pitch/360*2*Math.PI,t.upload()}(this.context.frameUniformBuffer,this),this.imageManager.beginFrame();let c=this.style._order,h=this.style.tileManagers,d={},f={},p={};for(let t in h){let r=h[t];r.used&&r.prepare(this.context),d[t]=r.getVisibleCoordinates(!1),f[t]=d[t].slice().reverse(),p[t]=r.getVisibleCoordinates(!0).reverse()}u.opaquePassCutoff=1/0;for(let t=0;t=0;u.currentLayer--){let t=this.style._layers[c[u.currentLayer]];if(t.isHidden(this.transform.zoom))continue;let r=h[t.source],i=d[t.source];this.renderTileClippingMasks(t,i,!1),this.renderLayer(this,r,t,i,u)}u.currentPass="translucent";let m=!1;for(u.currentLayer=0;u.currentLayeri.source&&!i.isHidden(r)?[t.tileManagers[i.source]]:[]),a=n.filter(t=>"vector"===t.getSource().type),o=n.filter(t=>"vector"!==t.getSource().type),s=t=>{(!i||i.getSource().maxzoom0?r.pop():null}acquireRTT(t){let r=this.context.gl,i=this._rttObjectRecyclePool.pop();if(i)return i.size!==t&&(i.texture.update({width:t,height:t,data:null},{premultiply:!1,useMipmap:!0}),i.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),i.size=t),i;let n=new Dp(this.context,{width:t,height:t,data:null},r.RGBA,{premultiply:!1,useMipmap:!0});return n.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:n,size:t}}bindRTT(t){let r=this.context.gl,i=t.size;if(!this._rttSharedFbo){let t=this.context.createFramebuffer(i,i,!0,!0),n=this.context.createRenderbuffer(r.DEPTH_STENCIL,i,i);t.depthAttachment.set(n),this._rttSharedFbo={fbo:t,depthRenderbuffer:n,size:i}}this._rttSharedFbo.size!==i&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,i,i),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=i,this._rttSharedFbo.fbo.height=i,this._rttSharedFbo.size=i),this._rttSharedFbo.fbo.colorAttachment.set(t.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(t){this._rttObjectRecyclePool.push(t)}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let r=this.patternAtlas.getPattern(t.from.toString()),i=this.patternAtlas.getPattern(t.to.toString());return!r||!i}useProgram(t,r,i=!1,n=[]){var a;this.cache||(this.cache={});let o=!!this.style.map.terrain,s=this.style.projection,l=i?Ox.projectionMercator:s.shaderPreludeCode,u=i?"#define PROJECTION_MERCATOR":s.shaderDefine,c=`/${i?"mercator":s.shaderVariantName}`,h=t+(r?r.cacheKey:"")+c+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(n?`/${n.join("/")}`:"");return(a=this.cache)[h]||(a[h]=new O5(this.context,Ox[t],r,RY[t],this._showOverdrawInspector,o,l,u,n)),this.cache[h]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new Dp(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){var t,r,i;if(this._tileTextures){for(let t in this._tileTextures){let r=this._tileTextures[t];if(r)for(let t of r)t.destroy()}this._tileTextures={}}for(let t of this._rttObjectRecyclePool)t.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let t=this.context.gl;t.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),t.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}if(null==(t=this.layerOpacityFbo)||t.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&(null==(r=this.tileExtentMesh.vertexBuffer)||r.destroy()),this.tileExtentMesh&&(null==(i=this.tileExtentMesh.indexBuffer)||i.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let t in this.cache){let r=this.cache[t];r?.program&&this.context.gl.deleteProgram(r.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:r}=this.context.gl;return this.width!==t||this.height!==r}}).MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,Bq=BU,BG=class extends Error{constructor(t,r){var i;super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=t,this.statusMessage=null!=(i=r?.statusMessage)?i:null}},BH=class{constructor(t){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{var t;let r=this._getHashParams();return this._hashName?(r.get(this._hashName)||"").split("/"):(null!=(t=[...r.keys()][0])?t:"").split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let r=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:r,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getHashParams();if(this._hashName)t.delete(this._hashName);else{let r=Array.from(t.keys());r.length>0&&t.delete(r[0])}let r=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=r?`#${r}`:"",n=window.location.href.replace(/(#.+)?$/,i);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=zg(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){let r=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,n=10**Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.round(r.lng*n)/n,o=Math.round(r.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=t?`/${a}/${o}/${i}`:`${i}/${o}/${a}`,(s||l)&&(u+=`/${Math.round(10*s)/10}`),l&&(u+=`/${Math.round(l)}`),this._hashName){let t=this._getHashParams();return t.set(this._hashName,u),`#${decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${u}`}_isValidHash(t){if(t.length<3||t.some(t=>isNaN(+t)))return!1;try{new DQ(+t[2],+t[1])}catch{return!1}let r=+t[0],i=+(t[3]||0),n=+(t[4]||0);return r>=this._map.getMinZoom()&&r<=this._map.getMaxZoom()&&i>=-180&&i<=180&&n>=this._map.getMinPitch()&&n<=this._map.getMaxPitch()}},BW=xn({deceleration:2500,maxSpeed:1400},B$={linearity:.3,easing:xt(0,0,.3,1)}),BY=xn({deceleration:20,maxSpeed:1400},B$),BZ=xn({deceleration:1e3,maxSpeed:360},B$),BX=xn({deceleration:1e3,maxSpeed:90},B$),BK=xn({deceleration:1e3,maxSpeed:360},B$),BJ=class{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Lu(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,r=Lu();for(;t.length>0&&r-t[0].time>160;)t.shift()}_getVelocityEntries(){let t=this._inertiaBuffer,r=Lu()-60,i=Math.max(0,t.length-2);for(;i>0&&t[i-1].time>=r;)i--;return t.slice(i)}_onMoveEnd(t){this._drainInertiaBuffer();let r=this._getVelocityEntries();if(r.length<2)return void this.clear();let i={zoom:0,bearing:0,pitch:0,roll:0,pan:new vu(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of r)t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);for(let{settings:t}of r.slice(1))i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,i.roll+=t.rollDelta||0,t.panDelta&&i.pan._add(t.panDelta);if(!i.pan.mag()&&!i.zoom&&!i.bearing&&!i.pitch&&!i.roll)return void this.clear();let n=Lu()-r[0].time,a={};if(i.pan.mag()){let r=zv(i.pan.mag(),n,xn({},BW,t||{})),o=i.pan.mult(r.amount/i.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(o,this._map._camera.transform);a.center=s.easingCenter,a.offset=s.easingOffset,zy(a,r)}if(i.zoom){let t=zv(i.zoom,n,BY);a.zoom=xl(this._map.getZoom()+t.amount,this._map.getZoomSnap(),t.amount),zy(a,t)}if(i.bearing){let t=zv(i.bearing,n,BZ);a.bearing=this._map.getBearing()+xr(t.amount,-179,179),zy(a,t)}if(i.pitch){let t=zv(i.pitch,n,BX);a.pitch=this._map.getPitch()+t.amount,zy(a,t)}if(i.roll){let t=zv(i.roll,n,BK);a.roll=this._map.getRoll()+xr(t.amount,-179,179),zy(a,t)}if(a.zoom||a.bearing){let t=void 0===i.pinchAround?i.around:i.pinchAround;a.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),xn(a,{noMoveStart:!0})}},BQ=class{constructor(t,r){this._map=t,this._clickTolerance=r.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new z4(this._map,t))}mousedown(t,r){return this._mousedownPos=r,this._firePreventable(new z3(t.type,this._map,t))}mouseup(t){this._map.fire(new z3(t.type,this._map,t))}click(t,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||this._map.fire(new z3(t.type,this._map,t))}dblclick(t){return this._firePreventable(new z3(t.type,this._map,t))}mouseover(t){this._map.fire(new z3(t.type,this._map,t))}mouseout(t){this._map.fire(new z3(t.type,this._map,t))}touchstart(t){return this._firePreventable(new z5(t.type,this._map,t))}touchmove(t){this._map.fire(new z5(t.type,this._map,t))}touchend(t){this._map.fire(new z5(t.type,this._map,t))}touchcancel(t){this._map.fire(new z5(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},B0=class{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new z3(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new z3("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new z3(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},B1=class{constructor(t,r,i){this._map=t,this._tr=i,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=r.clickTolerance||1,r.boxZoom&&"object"==typeof r.boxZoom&&(this._boxZoomEnd=r.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,r){this.isEnabled()&&t.shiftKey&&0===t.button&&(zZ.disableDrag(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(t,r){if(!this._active||this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)t.fitScreenCoordinates(i,r,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box=(this._box.remove(),null)),zZ.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new z6(t,{originalEvent:r}))}},B2=class{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,r,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){let r=new vu(0,0);for(let i of t)r._add(i);return r.div(t.length)}(r),this.touches=zx(i,r)))}touchmove(t,r,i){if(this.aborted||!this.centroid)return;let n=zx(i,r);for(let t in this.touches){let r=this.touches[t],i=n[t];(!i||i.dist(r)>30)&&(this.aborted=!0)}}touchend(t,r,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}},B3=class{constructor(t){this.singleTap=new B2(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,r,i){this.singleTap.touchstart(t,r,i)}touchmove(t,r,i){this.singleTap.touchmove(t,r,i)}touchend(t,r,i){let n=this.singleTap.touchend(t,r,i);if(n){let r=t.timeStamp-this.lastTime<500,i=!this.lastTap||30>this.lastTap.dist(n);if(r&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}},B5=class{constructor(t,r){this._tr=r,this._zoomIn=new B3({numTouches:1,numTaps:2}),this._zoomOut=new B3({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,r,i){this._zoomIn.touchstart(t,r,i),this._zoomOut.touchstart(t,r,i)}touchmove(t,r,i){this._zoomIn.touchmove(t,r,i),this._zoomOut.touchmove(t,r,i)}touchend(t,r,i){let n=this._zoomIn.touchend(t,r,i),a=this._zoomOut.touchend(t,r,i),o=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:r=>r.easeTo({duration:300,zoom:xl(o.zoom+1,r.getZoomSnap()),around:o.unproject(n)},{originalEvent:t})}):a?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:r=>r.easeTo({duration:300,zoom:xl(o.zoom-1,r.getZoomSnap()),around:o.unproject(a)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},B4=class{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let r=this._moveFunction(...t);if(r.bearingDelta||r.pitchDelta||r.rollDelta||r.around||r.panDelta)return this._active=!0,r}dragStart(t,r){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(r)?r[0]:r,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,r){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let n=Array.isArray(r)?r[0]:r;if(!(!this._moved&&n.dist(i)!0}),r=new B7){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=r}_executeRelevantHandler(t,r,i){return t instanceof MouseEvent?r(t):"u">typeof TouchEvent&&t instanceof TouchEvent?i(t):void 0}startMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.startMove(t)},t=>{this.oneFingerTouchMoveStateManager.startMove(t)})}endMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.endMove(t)},t=>{this.oneFingerTouchMoveStateManager.endMove(t)})}isValidStartEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}},je=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},jt=class{constructor(t,r){this._clickTolerance=t.clickTolerance||1,this._map=r,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new vu(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,r,i){return this._calculateTransform(t,r,i)}touchmove(t,r,i){if(this._active)return this._shouldBePrevented(i.length)?void this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t):(t.preventDefault(),this._calculateTransform(t,r,i))}touchend(t,r,i){this._calculateTransform(t,r,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,i){i.length>0&&(this._active=!0);let n=zx(i,r),a=new vu(0,0),o=new vu(0,0),s=0;for(let t in n){let r=n[t],i=this._touches[t];i&&(a._add(r),o._add(r.sub(i)),s++,n[t]=r)}if(this._touches=n,this._shouldBePrevented(s)||!o.mag())return;let l=o.div(s);if(this._sum._add(l),!(this._sum.mag()=2,a=r.mag()>=2;if(!n&&!a)return;if(!n||!a)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let o=t.y>0==r.y>0;return zT(t)&&zT(r)&&o}},jo={panStep:100,bearingStep:15,pitchStep:10},js=class{constructor(t,r){this._tr=r,this._panStep=jo.panStep,this._bearingStep=jo.bearingStep,this._pitchStep=jo.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let r=0,i=0,n=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:zA,zoom:r?xl(l.zoom+r*(t.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+i*this._bearingStep,pitch:l.pitch+n*this._pitchStep,offset:[-a*this._panStep,-o*this._panStep],center:l.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}},jl=class{constructor(t,r,i){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=i,this._triggerRenderFrame=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let r=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=Lu(),n=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&4>Math.abs(r)?this._type="trackpad":n>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(n*r)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=zZ.mousePos(this._map.getCanvas(),t),i=this._tr;this._aroundPoint=this._aroundCenter?i.transform.locationToScreenPoint(DQ.convert(i.center)):r,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let r=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=r),"number"==typeof this._targetZoom&&(this._targetZoom+=r)}if(0!==this._delta){let r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);let n="number"==typeof this._targetZoom?xo(this._targetZoom):t.scale,a=t.applyConstrain(t.getCameraLngLat(),xs(n*i)).zoom,o=this._map.getZoomSnap();if("wheel"===this._type&&o>0){let r=xl(t.zoom,o);this._targetZoom=xl(a,o,a-r)}else this._targetZoom=a;"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let r="number"==typeof this._targetZoom?this._targetZoom:t.zoom,i=this._startZoom,n=this._easing,a=!1,o;if("wheel"===this._type&&i&&n){let t=Math.min((Lu()-this._lastWheelEventTime+5)/200,1),s=n(t);o=kx.number(i,r,s),t<1?this._needsRerender=!0:a=!0}else o=r,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=o,{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=Mp;if(this._prevEase){let t=this._prevEase,i=(Lu()-t.start)/t.duration,n=t.easing(i+.01)-t.easing(i),a=.27/Math.sqrt(n*n+1e-4)*.01,o=Math.sqrt(.0729-a*a);r=xt(a,o,.25,1)}return this._prevEase={start:Lu(),duration:t,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},ju=class{constructor(t,r){this._clickZoom=t,this._tapZoom=r}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()}},jc=class{constructor(t,r){this._tr=r,this.reset()}reset(){this._active=!1}dblclick(t,r){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:xl(this._tr.zoom+(t.shiftKey?-1:1),i.getZoomSnap()),around:this._tr.unproject(r)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},jh=class{constructor(){this._tap=new B3({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,r,i){if(!this._swipePoint)if(this._tapTime){let n=r[0],a=t.timeStamp-this._tapTime<500,o=30>this._tapPoint.dist(n);a&&o?i.length>0&&(this._swipePoint=n,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,r,i)}touchmove(t,r,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let n=r[0],a=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:a/128*this._zoomRate}}}else this._tap.touchmove(t,r,i)}touchend(t,r,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{let n=this._tap.touchend(t,r,i);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},jd=class{constructor(t,r,i){this._el=t,this._mousePan=r,this._touchPan=i}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},jf=class{constructor(t,r,i,n){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=r,this._mousePitch=i,this._mouseRoll=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},jp=class{constructor(t,r,i,n){this._el=t,this._touchZoom=r,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},jm=class{constructor(t,r){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=r,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=zZ.create("div","maplibregl-cooperative-gesture-screen",t);let r=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(r=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=r,this._container.appendChild(n);let a=document.createElement("div");a.className="maplibregl-mobile-message",a.textContent=i,this._container.appendChild(a),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,r){this._enabled&&(this._map.fire(new zJ("cooperativegestureprevented",{gestureType:t,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},jg=class{constructor(t){this._camera=t}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.screenPointToLocation(vu.convert(t),this._camera.terrain)}},jy=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate,jv=class extends MI{},jx=class{get _ownerDocument(){var t;return(null==(t=this._el)?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,r;return(null==(r=null==(t=this._el)?void 0:t.ownerDocument)?void 0:r.defaultView)||window}constructor(t,r,i){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,r)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let i="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},a={},o={};for(let{handlerName:l,handler:u,allowed:c}of this._handlers){let h;if(u.isEnabled()){if(this._blockedByActive(o,c,l))u.reset();else if(u[r||t.type]){if(function(t,r){var i,n;if(!Mw[r])return!1;let a=(null==(n=null==(i=t?.target)?void 0:i.ownerDocument)?void 0:n.defaultView)||window;return t instanceof a.MouseEvent||t instanceof a.WheelEvent}(t,r||t.type)){let i=zZ.mousePos(this._map.getCanvas(),t);h=u[r||t.type](t,i)}else{var s;if(M_[r||t.type]&&"touches"in t){let i=t.touches,n=this._getMapTouches(i),a=zZ.touchPos(this._map.getCanvas(),n);h=u[r||t.type](t,a,n)}else M_[s=r||t.type]||Mw[s]||(h=u[r||t.type](t))}this.mergeHandlerResult(n,a,h,l,i),h?.needsRenderFrame&&this._triggerRenderFrame()}(h||u.isActive())&&(o[l]=u)}}let l={};for(let t in this._previousActiveHandlers)o[t]||(l[t]=i);this._previousActiveHandlers=o,(Object.keys(l).length||zM(n))&&(this._changes.push([n,a,l]),this._triggerRenderFrame()),(Object.keys(o).length||zM(n))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:u}=n;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))},this._map=t,this._camera=r,this._transformProvider=new jg(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new BJ(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);let n=this._el;for(let[t,r,i]of(this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]],this._listeners))t.addEventListener(r,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[t,r,i]of this._listeners)t.removeEventListener(r,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let r=this._map,i=r.getCanvasContainer();this._add("mapEvent",new BQ(r,t));let n=r.boxZoom=new B1(r,t,this._transformProvider);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();let a=r.cooperativeGestures=new jm(r,t.cooperativeGestures);this._add("cooperativeGestures",a),t.cooperativeGestures&&a.enable();let o=new B5(r,this._transformProvider),s=new jc(r,this._transformProvider);r.doubleClickZoom=new ju(s,o),this._add("tapZoom",o),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&r.doubleClickZoom.enable();let l=new jh;this._add("tapDragZoom",l);let u=r.touchPitch=new ja(r);this._add("touchPitch",u),t.interactive&&t.touchPitch&&r.touchPitch.enable(t.touchPitch);let c=()=>r.project(r.getCenter()),h=function({enable:t,clickTolerance:r,aroundCenter:i=!0,minPixelCenterThreshold:n=100,rotateSpeed:a=.8},o){return new B4({clickTolerance:r,move:(t,r)=>{let s=o();if(i&&Math.abs(s.y-t.y)>n)return{bearingDelta:x_(new vu(t.x,r.y),r,s)};let l=(r.x-t.x)*a;return i&&r.y0===t.button&&t.ctrlKey||2===t.button&&!t.ctrlKey}),enable:t,assignEvents:je})}(t,c),d=function({enable:t,clickTolerance:r,pitchSpeed:i=-.5}){return new B4({clickTolerance:r,move:(t,r)=>({pitchDelta:(r.y-t.y)*i}),moveStateManager:new B8({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button}),enable:t,assignEvents:je})}(t),f=function({enable:t,clickTolerance:r,rollDegreesPerPixelMoved:i=.3},n){return new B4({clickTolerance:r,move:(t,r)=>{let a=n(),o=(r.x-t.x)*i;return r.y2===t.button&&t.ctrlKey}),enable:t,assignEvents:je})}(t,c);r.dragRotate=new jf(t,h,d,f),this._add("mouseRotate",h,["mousePitch"]),this._add("mousePitch",d,["mouseRotate","mouseRoll"]),this._add("mouseRoll",f,["mousePitch"]),t.interactive&&t.dragRotate&&r.dragRotate.enable();let p=function({enable:t,clickTolerance:r}){return new B4({clickTolerance:r,move:(t,r)=>({around:r,panDelta:r.sub(t)}),activateOnStart:!0,moveStateManager:new B8({checkCorrectEvent:t=>0===t.button&&!t.ctrlKey}),enable:t,assignEvents:je})}(t),m=new jt(t,r);r.dragPan=new jd(i,p,m),this._add("mousePan",p),this._add("touchPan",m,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&r.dragPan.enable(t.dragPan);let g=new jn,y=new ji;r.touchZoomRotate=new jp(i,y,g,l),this._add("touchRotate",g,["touchPan","touchZoom"]),this._add("touchZoom",y,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&r.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new B0(r));let v=r.scrollZoom=new jl(r,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",v,["mousePan"]),t.interactive&&t.scrollZoom&&r.scrollZoom.enable(t.scrollZoom);let x=r.keyboard=new js(r,this._transformProvider);this._add("keyboard",x),t.interactive&&t.keyboard&&r.keyboard.enable()}_add(t,r,i){this._handlers.push({handlerName:t,handler:r,allowed:i}),this._handlersById[t]=r}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!jy(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,r,i){for(let n in t)if(n!==i&&!r?.includes(n))return!0;return!1}_getMapTouches(t){let r=[];for(let i of t){let t=i.target;this._el.contains(t)&&r.push(i)}return r}mergeHandlerResult(t,r,i,n,a){if(!i)return;xn(t,i);let o={handlerName:n,originalEvent:i.originalEvent||a};void 0!==i.zoomDelta&&(r.zoom=o),void 0!==i.panDelta&&(r.drag=o),void 0!==i.rollDelta&&(r.roll=o),void 0!==i.pitchDelta&&(r.pitch=o),void 0!==i.bearingDelta&&(r.rotate=o)}_applyChanges(){let t={},r={},i={};for(let[n,a,o]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new vu(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),n.rollDelta&&(t.rollDelta=(t.rollDelta||0)+n.rollDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),xn(r,a),xn(i,o);this._updateMapTransform(t,r,i),this._changes=[]}_updateMapTransform(t,r,i){let n=this._map,a=this._camera.getTransformForUpdate(),o=n.terrain;if(!zM(t)&&!(o&&this._terrainMovement))return void this._fireEvents(r,i,!0);this._camera.stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:u,pitchDelta:c,rollDelta:h}=t,{around:d,aroundOnSurface:f}=this._resolveAround(t,o,a),p=o?this._terrainGestureElevation(o,d,f,a,r):void 0,m={panDelta:s,zoomDelta:l,rollDelta:h,pitchDelta:c,bearingDelta:u,around:d,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!a.isPointOnMapSurface(d)&&(d=a.centerPoint);let g=this._computePreZoomAroundLoc(a,d,s,p);this._handleMapControls({terrain:o,tr:a,deltasForHelper:m,preZoomAroundLoc:g,combinedEventsInProgress:r,panDelta:s}),this._camera.applyUpdatedTransform(a),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,i,!0)}_resolveAround(t,r,i){let n=void 0===t.pinchAround?t.around:t.pinchAround;return n||(n=this._camera.transform.centerPoint),r&&!i.isPointOnMapSurface(n)?{around:i.centerPoint,aroundOnSurface:!1}:{around:n,aroundOnSurface:!0}}_terrainGestureElevation(t,r,i,n,a){if(!i)return;if(!this._terrainMovement&&(a.drag||a.zoom)){let i=n.screenTerrainPointToMercatorCoordinate(r,t);this._terrainGestureAnchorElevation=i?i.z:null}if(null===this._terrainGestureAnchorElevation)return;let o=this._terrainGestureAnchorElevation;if(!(.01>r.distSqr(n.centerPoint))&&!(o-n.elevation>=.9*(n.getCameraAltitude()-n.elevation)))return o}_computePreZoomAroundLoc(t,r,i,n){if(.01>r.distSqr(t.centerPoint))return t.center;let a=i?r.sub(i):r;return void 0===n?t.screenPointToLocation(a):t.screenPointToLocationAtElevation(a,n)}_handleMapControls({terrain:t,tr:r,deltasForHelper:i,preZoomAroundLoc:n,combinedEventsInProgress:a,panDelta:o}){let s=this._camera.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(i,r),!t)return void s.handleMapControlsPan(i,r,n);if(s.useGlobeControls){!this._terrainMovement&&(a.drag||a.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),s.handleMapControlsPan(i,r,n);return}if(!this._terrainMovement&&(a.drag||a.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,s.handleMapControlsPan(i,r,n);return}void 0===i.aroundElevation&&a.drag&&this._terrainMovement&&o?r.setCenter(r.screenPointToLocation(r.centerPoint.sub(o))):s.handleMapControlsPan(i,r,n)}_fireEvents(t,r,i){let n=jy(this._eventsInProgress),a=jy(t),o={};for(let r in t){let{originalEvent:i}=t[r];this._eventsInProgress[r]||(o[`${r}start`]=i),this._eventsInProgress[r]=t[r]}for(let t in!n&&a&&this._fireEvent("movestart",a.originalEvent),o)this._fireEvent(t,o[t]);for(let r in a&&this._fireEvent("move",a.originalEvent),t){let{originalEvent:i}=t[r];this._fireEvent(r,i)}let s={},l;for(let t in this._eventsInProgress){let{handlerName:i,originalEvent:n}=this._eventsInProgress[t];this._handlersById[i].isActive()||(delete this._eventsInProgress[t],l=r[i]||n,s[`${t}end`]=l)}for(let t in s)this._fireEvent(t,s[t]);let u=jy(this._eventsInProgress),c=(n||a)&&!u;if(c&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let t=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(t)}if(i&&c){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=t=>0!==t&&-this._bearingSnap{delete this._frameId,this.handleEvent(new jv("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}},jb=class extends MP{constructor(t){var r,i,n;super(),this._renderFrameCallback=()=>{let t=Math.min((Lu()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=new OD,this.cameraHelper=new OC,void 0!==t.minZoom&&this.transform.setMinZoom(t.minZoom),void 0!==t.maxZoom&&this.transform.setMaxZoom(t.maxZoom),void 0!==t.minPitch&&this.transform.setMinPitch(t.minPitch),void 0!==t.maxPitch&&this.transform.setMaxPitch(t.maxPitch),void 0!==t.renderWorldCopies&&this.transform.setRenderWorldCopies(t.renderWorldCopies),null!==t.transformConstrain&&this.transform.setConstrainOverride(t.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=t.bearingSnap,this._zoomSnap=t.zoomSnap,this._requestRenderFrame=t.requestRenderFrame,this._cancelRenderFrame=t.cancelRenderFrame,this.terrain=t.terrain,this._centerClampedToGround=null==(r=t.centerClampedToGround)||r,this.transformCameraUpdate=null!=(i=t.transformCameraUpdate)?i:null,this._stopHandlers=null!=(n=t.stopHandlers)?n:()=>{},this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,r){if(t.apply(this.transform,!0),this.transform=t,this.cameraHelper=r,this._requestedCameraState){let r=t.clone();r.apply(this._requestedCameraState,!0),this._requestedCameraState=r}}getCenter(){return new DQ(this.transform.center.lng,this.transform.center.lat)}setCenter(t,r){return this.jumpTo({center:t},r)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,r){return this.jumpTo({elevation:t},r),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,r,i){return t=vu.convert(t).mult(-1),this.panTo(this.transform.center,xn({offset:t},r),i)}panTo(t,r,i){return this.easeTo(xn({center:t},r),i)}getZoom(){return this.transform.zoom}setZoom(t,r){return this.jumpTo({zoom:t},r),this}zoomTo(t,r,i){return this.easeTo(xn({zoom:t},r),i)}zoomIn(t,r){return this.zoomTo(xl(this.getZoom()+1,this._zoomSnap),t,r),this}zoomOut(t,r){return this.zoomTo(xl(this.getZoom()-1,this._zoomSnap),t,r),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,r){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new zQ("movestart",r)).fire(new zQ("move",r)).fire(new zQ("moveend",r))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,r){return this.jumpTo({bearing:t},r),this}getPadding(){return this.transform.padding}setPadding(t,r){return this.jumpTo({padding:t},r),this}rotateTo(t,r,i){return this.easeTo(xn({bearing:t},r),i)}resetNorth(t,r){return this.rotateTo(0,xn({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(xn({bearing:0,pitch:0,roll:0,duration:1e3},t),r),this}snapToNorth(t,r){return Math.abs(this.getBearing()){m.easeFunc(n),this.terrain&&!t.freezeElevation&&this._updateElevation(n),this.applyUpdatedTransform(i),this._fireMoveEvents(r)},i=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r,i)},t),this}_prepareEase(t,r,i={}){this._moving=!0,r||i.moving||this.fire(new zQ("movestart",t)),this._zooming&&!i.zooming&&this.fire(new zQ("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new zQ("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new zQ("pitchstart",t)),this._rolling&&!i.rolling&&this.fire(new zQ("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(t,this.transform),this.elevationFreeze=!0}_updateElevation(t){(void 0===this._elevationStart||void 0===this._elevationCenter)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let r=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(t<1&&r!==this._elevationTarget){let i=this._elevationTarget-this._elevationStart,n=(r-(i*t+this._elevationStart))/(1-t);this._elevationStart+=t*(i-n),this._elevationTarget=r}this.transform.setElevation(kx.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let r=t.getCameraLngLat(),i=t.getCameraAltitude(),n=this.terrain?this.terrain.getElevationForLngLatZoom(r,t.zoom):0;if(ithis._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&r.push(t=>this.transformCameraUpdate(t)),!r.length)return;let i=t.clone();for(let t of r){let r=i.clone(),{center:n,zoom:a,roll:o,pitch:s,bearing:l,elevation:u}=t(r);n&&r.setCenter(n),void 0!==u&&r.setElevation(u),void 0!==a&&r.setZoom(a),void 0!==o&&r.setRoll(o),void 0!==s&&r.setPitch(s),void 0!==l&&r.setBearing(l),i.apply(r,!1)}this.transform.apply(i,!1)}_fireMoveEvents(t){this.fire(new zQ("move",t)),this._zooming&&this.fire(new zQ("zoom",t)),this._rotating&&this.fire(new zQ("rotate",t)),this._pitching&&this.fire(new zQ("pitch",t)),this._rolling&&this.fire(new zQ("roll",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;let i=this._zooming,n=this._rotating,a=this._pitching,o=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,i&&this.fire(new zQ("zoomend",t)),n&&this.fire(new zQ("rotateend",t)),a&&this.fire(new zQ("pitchend",t)),o&&this.fire(new zQ("rollend",t)),this.fire(new zQ("moveend",t))}flyTo(t,r){if(!t.essential&&zH.prefersReducedMotion){let i=xa(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(i,r)}this.stop(),void 0!==(t=xn({offset:[0,0],speed:1.2,curve:1.42,easing:Mp},t)).zoom&&this._zoomSnap&&(t.zoom=xl(t.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),n=i.bearing,a=i.pitch,o=i.roll,s=i.padding,l=void 0===t.bearing?n:this._normalizeBearing(t.bearing,n),u=void 0===t.pitch?a:+t.pitch,c=void 0===t.roll?o:this._normalizeBearing(t.roll,o),h=void 0===t.padding?i.padding:t.padding,d=vu.convert(t.offset),f=i.centerPoint.add(d),p=i.screenPointToLocation(f),m=this.cameraHelper.handleFlyTo(i,{bearing:l,pitch:u,roll:c,padding:h,locationAtOffset:p,offsetAsPoint:d,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),g=t.curve,y=Math.max(i.width,i.height),v=y/m.scaleOfZoom,x=m.pixelPathLength,b=y/m.scaleOfMinZoom,_=(g=Math.min(g,Math.sqrt(b/x*2)))*g;function w(t){let r=(v*v-y*y+(t?-1:1)*_*_*x*x)/(2*(t?v:y)*_*x);return Math.log(Math.sqrt(r*r+1)-r)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}let M=w(!1),k=function(t){return A(M)/A(M+g*t)},S=function(t){var r;return y*((A(M)*(T(r=M+g*t)/A(r))-T(M))/_)/x},E=(w(!0)-M)/g;if(2e-6>Math.abs(x)||!isFinite(E)){if(1e-6>Math.abs(y-v))return this.easeTo(t,r);let i=v0,k=t=>Math.exp(i*g*t)}if(void 0!==t.duration)t.duration=+t.duration;else{let r=void 0===t.screenSpeed?+t.speed:t.screenSpeed/g;t.duration=1e3*E/r}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=n!==l,this._pitching=u!==a,this._rolling=c!==o,this._padding=!i.isPaddingEqual(h),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(m.targetCenter),this._ease(p=>{let g=p*E,y=1/k(g),v=S(g);this._rotating&&i.setBearing(kx.number(n,l,p)),this._pitching&&i.setPitch(kx.number(a,u,p)),this._rolling&&i.setRoll(kx.number(o,c,p)),this._padding&&(i.interpolatePadding(s,h,p),f=i.centerPoint.add(d)),m.easeFunc(p,y,v,f),this.terrain&&!t.freezeElevation&&this._updateElevation(p),this.applyUpdatedTransform(i),this._fireMoveEvents(r)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(r)},t),this}isEasing(){return!!this._easeFrameId}stop(t){return this._stop(t)}_stop(t,r){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,r)}return t||this._stopHandlers(),this}_ease(t,r,i){!1===i.animate||0===i.duration?(t(1),r()):(this._easeStart=Lu(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,r){let i=Math.abs((t=xi(t,-180,180))-r);return Math.abs(t-360-r)MapLibre'},jw=class{constructor(t=j_){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{t&&("terrain"===t.type||"style"===t.dataType||"source"===t.dataType&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=zZ.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=zZ.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=zZ.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,r){let i=this._map._getUIString(`AttributionControl.${r}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"==typeof t?t:"")):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let r=this._map.style.tileManagers;for(let i in r){let n=r[i];if(n.used||n.usedForTerrain){let r=n.getSource();r.attribution&&!t.includes(r.attribution)&&t.push(r.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,r)=>t.length-r.length);let i=(t=t.filter((r,i)=>{for(let n=i+1;n{let t=this._container.children;if(t.length){let r=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&r.classList.add("maplibregl-compact"):r.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){var r;this._map=t,this._compact=null==(r=this.options)?void 0:r.compact,this._container=zZ.create("div","maplibregl-ctrl");let i=zZ.create("a","maplibregl-ctrl-logo");return i.target="_blank",i.rel="noopener nofollow",i.href="https://maplibre.org/",i.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),i.setAttribute("rel","noopener nofollow"),this._container.appendChild(i),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},jA=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let r=++this._id;return this._queue.push({callback:t,id:r,cancelled:!1}),r}remove(t){let r=this._currentlyRunning;for(let i of r?this._queue.concat(r):this._queue)if(i.id===t){i.cancelled=!0;return}}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let r=this._currentlyRunning=this._queue;this._queue=[];let i=!1,n;for(let a of r)if(!a.cancelled){try{a.callback(t)}catch(t){i||(i=!0,n=t)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,i)throw n}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},jM=["none","zoom","sourceTiles","visibleLayers","revision"],jk=class{constructor(t,r,i,n){this._tileKeys=t.map(t=>t.key).sort().join(),this._revision=r,this._zoom=i,this._visibleLayerIds=n}difference(t){return this._revision===t?._revision?this._visibleLayerIds===t._visibleLayerIds?this._tileKeys===t._tileKeys?this._zoom===t._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},jS={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0},jE=class{constructor(t,r){this.needsFollowUpFrame=!1,this.painter=t,this.terrain=r,this.rttSize=r.tileManager.tileSize*r.qualityFactor}getTexture(t){return t.getRTT(this._stacks.length-1).texture}prepareForRender(t,r){let i=r!==this._lastPrepareZoom;this._lastPrepareZoom=r,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(r));let n=this._renderableLayerIds.join(),a=new Set;for(let r of this._renderableLayerIds){let i=t._layers[r],n=i.source;n&&jS[i.type]&&a.add(n)}for(let i of(this._coordsAscending={},this._rttFingerprints={},a)){let a=t.tileManagers[i];if(!a)continue;this._coordsAscending[i]={};let o=this._coordsAscending[i],s=a.getSource(),l=s instanceof FO?s.terrainTileRanges:null;for(let t of a.getVisibleCoordinates()){let r=this.terrain.tileManager.getTerrainCoords(t,l);for(let t in r)o[t]||(o[t]=[]),o[t].push(r[t])}this._rttFingerprints[i]={};let u=this._rttFingerprints[i],c=a.getState().revision;for(let t in o)u[t]=new jk(o[t],c,r,n)}this.needsFollowUpFrame=!1;let o=i||this.painter.options.moving,s=!1;for(let t of this._renderableTiles){let r=this._textureDifference(t);"none"!==r&&("zoom"===r&&o||"visibleLayers"===r&&i?this.needsFollowUpFrame=!0:"zoom"===r||"sourceTiles"===r?(s?this.needsFollowUpFrame=!0:t.releaseRTT(this.painter),s=!0):t.releaseRTT(this.painter))}}_textureDifference(t){let r="none";for(let i in this._rttFingerprints){let n=this._rttFingerprints[i][t.tileID.key];if(!n)continue;let a=n.difference(t.rttFingerprint[i]);jM.indexOf(a)>jM.indexOf(r)&&(r=a)}return r}renderLayer(t,r){if(t.isHidden(this.painter.transform.zoom))return!1;let i=p(f({},r),{isRenderingToTexture:!0}),n=t.type,a=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(jS[n]&&(this._prevType&&jS[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!o))return!0;if(jS[this._prevType]||jS[n]&&o){this._prevType=n;let t=this._stacks.length-1,r=this._stacks[t]||[];for(let n of this._renderableTiles){if(this._rttTiles.push(n),n.getRTT(t))continue;let o=n.acquireRTT(a,t,this.rttSize);for(let t of(a.bindRTT(o),a.context.clear({color:kt.transparent,stencil:0}),a.currentStencilSource=void 0,r)){let r=a.style._layers[t],o=r.source?this._coordsAscending[r.source][n.tileID.key]:[n.tileID];a.context.viewport.set([0,0,this.rttSize,this.rttSize]),a.renderTileClippingMasks(r,o,!0),a.renderLayer(a,a.style.tileManagers[r.source],r,o,i),r.source&&(n.rttFingerprint[r.source]=this._rttFingerprints[r.source][n.tileID.key])}o.texture.generateMipmap()}return function(t,r,i,n){let{isRenderingGlobe:a}=n,o=t.context,s=o.gl,l=t.transform,u=t.colorModeForRenderPass(),c=t.getDepthModeFor3D(),h=t.useProgram("terrain");for(let n of(o.bindFramebuffer.set(null),o.viewport.set([0,0,t.width,t.height]),i)){let i=r.getTerrainMesh(n.tileID),d=t.renderToTexture.getTexture(n),f=r.getTerrainData(n.tileID);o.activeTexture.set(s.TEXTURE0),d.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_LINEAR);let p=OZ(r.getSkirtLength(l.zoom),l.calculateFogMatrix(n.tileID.toUnwrapped()),t.style.sky,l.pitch,a),m=l.getProjectionData({overscaledTileID:n.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});h.draw(o,s.TRIANGLES,c,BC.disabled,u,BI.backCCW,p,f,m,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}(this.painter,this.terrain,this._rttTiles,i),this._rttTiles=[],jS[n]}return!1}},jD={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},jC={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:j_,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:MA.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},jI=class extends MP{get _ownerWindow(){var t,r;return(null==(r=null==(t=this._container)?void 0:t.ownerDocument)?void 0:r.defaultView)||window}constructor(t){var r,i,n;super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new jA,this._controls=[],this._mapId=Mm++,this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)return void this.fire(new z9("webglcontextlost",{originalEvent:t}));for(let t of Object.values(this.style._layers))if("custom"===t.type&&console.warn(`Custom layer with id '${t.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),t._listeners)for(let[r]of Object.entries(t._listeners))console.warn(`Custom layer with id '${t.id}' had event listeners for event '${r}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new z9("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style)for(let t in this.style.imageManager.images=this._lostContextStyle.images,this._lostContextStyle.images){let r=this._lostContextStyle.images[t];r.isWebGLImage&&this.style.imageManager.updateImage(t,r,!1)}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(t){this.fire(new ML(t));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new z9("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let a=p(f(f({},jC),t),{canvasContextAttributes:f(f({},jC.canvasContextAttributes),t.canvasContextAttributes)});if(null!=a.minZoom&&null!=a.maxZoom&&a.minZoom>a.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=a.minPitch&&null!=a.maxPitch&&a.minPitch>a.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=a.minPitch&&a.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=a.maxPitch&&a.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new jb({minZoom:a.minZoom,maxZoom:a.maxZoom,minPitch:a.minPitch,maxPitch:a.maxPitch,bearingSnap:a.bearingSnap,zoomSnap:a.zoomSnap,renderWorldCopies:a.renderWorldCopies,centerClampedToGround:a.centerClampedToGround,terrain:this.terrain,transformConstrain:a.transformConstrain,requestRenderFrame:t=>this._requestRenderFrame(t),cancelRenderFrame:t=>this._cancelRenderFrame(t),transformCameraUpdate:a.transformCameraUpdate,stopHandlers:()=>{var t;return null==(t=this._handlers)?void 0:t.stop(!1)}}),this._camera.setEventedParent(this),this._interactive=a.interactive,this._maxTileCacheSize=a.maxTileCacheSize,this._maxTileCacheZoomLevels=a.maxTileCacheZoomLevels,this._canvasContextAttributes=f({},a.canvasContextAttributes),this._trackResize=!0===a.trackResize,this._terrainSkirtLength=a.terrainSkirtLength,this._refreshExpiredTiles=!0===a.refreshExpiredTiles,this._fadeDuration=a.fadeDuration,this._crossSourceCollisions=!0===a.crossSourceCollisions,this._collectResourceTiming=!0===a.collectResourceTiming,this._locale=f(f({},jD),a.locale),this._clickTolerance=a.clickTolerance,this._overridePixelRatio=a.pixelRatio,this._maxCanvasSize=a.maxCanvasSize,this._zoomLevelsToOverscale=a.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=!0===a.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(a.anisotropicFilterPitch),void 0!==a.reduceMotion&&(zH.prefersReducedMotion=a.reduceMotion),this._requestManager=new zK(a.transformRequest),this._container=this._resolveContainer(a.container),a.maxBounds&&this.setMaxBounds(a.maxBounds),this._setupContainer();try{this._setupPainter()}catch(t){throw this._cleanupContainer(),t}this._imageQueueHandle=zX.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new jx(this,this._camera,a),"u">typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let o="string"==typeof a.hash&&a.hash||void 0;this._hash=a.hash?new BH(o).addTo(this):void 0,null!=(r=this._hash)&&r._onHashChange()||(this.jumpTo({center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,roll:a.roll}),a.bounds&&(this.resize(),this.fitBounds(a.bounds,xn({},a.fitBoundsOptions,{duration:0}))));let s="string"==typeof a.style||(null==(n=null==(i=a.style)?void 0:i.projection)?void 0:n.type)!=="globe";this.resize(null,s),this._localIdeographFontFamily=a.localIdeographFontFamily,this._validateStyle=a.validateStyle,a.style&&this.setStyle(a.style,{localIdeographFontFamily:a.localIdeographFontFamily}),a.attributionControl&&this.addControl(new jw("boolean"==typeof a.attributionControl?void 0:a.attributionControl)),a.maplibreLogo&&this.addControl(new jT,a.logoPosition),this.on("style.load",()=>{if(s||this._resizeTransform(),this._camera.transform.unmodified){let t=xa(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}}),this.on("data",t=>{this._update("style"===t.dataType),this.fire("style"===t.dataType?new z1("styledata",t):new z2("sourcedata",t))}),this.on("dataloading",t=>{this.fire("style"===t.dataType?new z1("styledataloading",t):new z2("sourcedataloading",t))}),this.on("dataabort",t=>{this.fire(new z2("sourcedataabort",t))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,r){return this.style.setGlobalStateProperty(t,r),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t?.onAdd)return this.fire(new ML(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let i=t.onAdd(this);this._controls.push(t);let n=this._controlPositions[r];return r.includes("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this}removeControl(t){if(!t?.onRemove)return this.fire(new ML(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(t){return this._controls.includes(t)}coveringTiles(t){return L$(this._camera.transform,t)}setTransformCameraUpdate(t){this._camera.transformCameraUpdate=t}getCenter(){return new DQ(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(t,r){return this._camera.setCenter(t,r),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(t,r){return this._camera.setCenterElevation(t,r),this}setCenterClampedToGround(t){this._camera.setCenterClampedToGround(t)}panBy(t,r,i){return this._camera.panBy(t,r,i),this}panTo(t,r,i){return this._camera.panTo(t,r,i),this}getZoom(){return this._camera.transform.zoom}setZoom(t,r){return this._camera.setZoom(t,r),this}zoomTo(t,r,i){return this._camera.zoomTo(t,r,i),this}zoomIn(t,r){return this._camera.zoomIn(t,r),this}zoomOut(t,r){return this._camera.zoomOut(t,r),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(t,r){return this._camera.setVerticalFieldOfView(t,r),this}getBearing(){return this._camera.transform.bearing}setBearing(t,r){return this._camera.setBearing(t,r),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(t){return this._camera.setZoomSnap(t),this}getPadding(){return this._camera.transform.padding}setPadding(t,r){return this._camera.setPadding(t,r),this}rotateTo(t,r,i){return this._camera.rotateTo(t,r,i),this}resetNorth(t,r){return this._camera.resetNorth(t,r),this}resetNorthPitch(t,r){return this._camera.resetNorthPitch(t,r),this}snapToNorth(t,r){return this._camera.snapToNorth(t,r),this}getPitch(){return this._camera.transform.pitch}setPitch(t,r){return this._camera.setPitch(t,r),this}getRoll(){return this._camera.transform.roll}setRoll(t,r){return this._camera.setRoll(t,r),this}cameraForBounds(t,r){return this._camera.cameraForBounds(t,r)}fitBounds(t,r,i){return this._camera.fitBounds(t,r,i),this}fitScreenCoordinates(t,r,i,n,a){return this._camera.fitScreenCoordinates(t,r,i,n,a),this}jumpTo(t,r){return this._camera.jumpTo(t,r),this}calculateCameraOptionsFromCameraLngLatAltRotation(t,r,i,n,a){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(t,r,i,n,a)}easeTo(t,r){return this._camera.easeTo(t,r),this}flyTo(t,r){return this._camera.flyTo(t,r),this}stop(){return this._camera.stop(),this}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(DQ.convert(t),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(t,r,i,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLat(i,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(t,r,i,n??0)}resize(t,r=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(r);let i=!this._camera._moving;return i&&(this.stop(),this.fire(new zQ("movestart",t)).fire(new zQ("move",t))),this.fire(new zJ("resize",t)),i&&this.fire(new zQ("moveend",t)),this}_resizeInternal(t=!0){let[r,i]=this._containerDimensions(),n=this._getClampedPixelRatio(r,i);if(this._resizeCanvas(r,i,n),this.painter.resize(r,i,n),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let n=this._getClampedPixelRatio(r,i);this._resizeCanvas(r,i,n),this.painter.resize(r,i,n)}this._resizeTransform(t)}_resizeTransform(t=!0){var r;let[i,n]=this._containerDimensions();this._camera.transform.resize(i,n,t),null==(r=this._camera._requestedCameraState)||r.resize(i,n,t)}_getClampedPixelRatio(t,r){let{0:i,1:n}=this._maxCanvasSize,a=this.getPixelRatio(),o=t*a,s=r*a,l=Math.min(o>i?i/o:1,s>n?n/s:1);return l<1&&xf("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),l*a}getPixelRatio(){var t;return null!=(t=this._overridePixelRatio)?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(t){return this._camera.transform.setMaxBounds(FA.convert(t)),this._update()}setMinZoom(t){if(t??(t=-2),t>=-2&&t<=this._camera.transform.maxZoom){let r=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMinZoom(t),this._camera.applyUpdatedTransform(i),this._update(),r!==this._camera.transform.zoom&&this.fire(new zQ("zoomstart")).fire(new zQ("zoom")).fire(new zQ("zoomend")).fire(new zQ("movestart")).fire(new zQ("move")).fire(new zQ("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(t=!1){let r=this._camera.transform;return t?r.applyConstrain(r.center,r.minZoom).zoom:r.minZoom}setMaxZoom(t){if(t??(t=22),t>=this._camera.transform.minZoom){let r=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMaxZoom(t),this._camera.applyUpdatedTransform(i),this._update(),r!==this._camera.transform.zoom&&this.fire(new zQ("zoomstart")).fire(new zQ("zoom")).fire(new zQ("zoomend")).fire(new zQ("movestart")).fire(new zQ("move")).fire(new zQ("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(t){if(t??(t=0),t<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this._camera.transform.maxPitch){let r=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMinPitch(t),this._camera.applyUpdatedTransform(i),this._update(),r!==this._camera.transform.pitch&&this.fire(new zQ("pitchstart")).fire(new zQ("pitch")).fire(new zQ("pitchend")).fire(new zQ("movestart")).fire(new zQ("move")).fire(new zQ("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(t){if(t??(t=60),t>180)throw Error("maxPitch must be less than or equal to 180");if(t>=this._camera.transform.minPitch){let r=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMaxPitch(t),this._camera.applyUpdatedTransform(i),this._update(),r!==this._camera.transform.pitch&&this.fire(new zQ("pitchstart")).fire(new zQ("pitch")).fire(new zQ("pitchend")).fire(new zQ("movestart")).fire(new zQ("move")).fire(new zQ("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if(t??(t=20),t>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(t){return this._camera.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this._camera.transform.setConstrainOverride(t),this._update()}project(t){return this._camera.transform.locationToScreenPoint(DQ.convert(t),this.style&&this.terrain)}unproject(t){return this._camera.transform.screenPointToLocation(vu.convert(t),this.terrain)}isMoving(){var t;return this._camera.isMoving()||(null==(t=this._handlers)?void 0:t.isMoving())||!1}isZooming(){var t;return this._camera.isZooming()||(null==(t=this._handlers)?void 0:t.isZooming())||!1}isRotating(){var t;return this._camera.isRotating()||(null==(t=this._handlers)?void 0:t.isRotating())||!1}_createDelegatedListener(t,r,i){if("mouseenter"===t||"mouseover"===t){let n=!1;return{layers:r,listener:i,delegates:{mousemove:a=>{let o=r.filter(t=>this.getLayer(t)),s=0===o.length?[]:this.queryRenderedFeatures(a.point,{layers:o});s.length?n||(n=!0,i.call(this,new z3(t,this,a.originalEvent,{features:s}))):n=!1},mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1;return{layers:r,listener:i,delegates:{mousemove:a=>{let o=r.filter(t=>this.getLayer(t));(0===o.length?[]:this.queryRenderedFeatures(a.point,{layers:o})).length?n=!0:n&&(n=!1,i.call(this,new z3(t,this,a.originalEvent)))},mouseout:r=>{n&&(n=!1,i.call(this,new z3(t,this,r.originalEvent)))}}}}{let n=t=>{let n=r.filter(t=>this.getLayer(t)),a=0===n.length?[]:this.queryRenderedFeatures(t.point,{layers:n});a.length&&(t.features=a,i.call(this,t),delete t.features)};return{layers:r,listener:i,delegates:{[t]:n}}}}_saveDelegatedListener(t,r){var i;this._delegatedListeners||(this._delegatedListeners={}),(i=this._delegatedListeners)[t]||(i[t]=[]),this._delegatedListeners[t].push(r)}_removeDelegatedListener(t,r,i){var n;if(!(null!=(n=this._delegatedListeners)&&n[t]))return;let a=this._delegatedListeners[t];for(let t=0;tr.includes(t))){for(let t in n.delegates)this.off(t,n.delegates[t]);a.splice(t,1);return}}}on(t,r,i){if(void 0===i)return super.on(t,r);let n="string"==typeof r?[r]:r,a=this._createDelegatedListener(t,n,i);for(let r in this._saveDelegatedListener(t,a),a.delegates)this.on(r,a.delegates[r]);return{unsubscribe:()=>{this._removeDelegatedListener(t,n,i)}}}once(t,r,i){if(void 0===i)return super.once(t,r);let n="string"==typeof r?[r]:r,a=this._createDelegatedListener(t,n,i);for(let r in a.delegates){let o=a.delegates[r];a.delegates[r]=(...r)=>{this._removeDelegatedListener(t,n,i),o(...r)}}for(let r in this._saveDelegatedListener(t,a),a.delegates)this.once(r,a.delegates[r]);return this}off(t,r,i){if(void 0===i)return super.off(t,r);let n="string"==typeof r?[r]:r;return this._removeDelegatedListener(t,n,i),this}queryRenderedFeatures(t,r){if(!this.style)return[];let i,n=t instanceof vu||Array.isArray(t),a=n?t:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(r||(r=(n?{}:t)||{}),a instanceof vu||"number"==typeof a[0])i=[vu.convert(a)];else{let t=vu.convert(a[0]),r=vu.convert(a[1]);i=[t,new vu(r.x,t.y),r,new vu(t.x,r.y),t]}return this.style.queryRenderedFeatures(i,r,this._camera.transform)}querySourceFeatures(t,r){return this.style.querySourceFeatures(t,r)}setStyle(t,r){return r=xn({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r),this._styleUrl="string"==typeof t?t:null,!1!==r.diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let r=this._locale[t];if(null==r)throw Error(`Missing UI string '${t}'`);return r}_updateStyle(t,r){var i,n,a;if(null==(i=this._diffStyleRequest)||i.abort(),this._diffStyleRequest=null,r.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,r));let o=this.style&&r.transformStyle?this.style.serialize():void 0;return(this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t)?(this.style=new OG(this,r||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,r,o):this.style.loadJSON(t,r,o)):(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),null==(a=null==(n=this.style)?void 0:n.projection)||a.destroy(),delete this.style),this}_lazyInitEmptyStyle(){this.style||(this.style=new OG(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){return _(this,null,function*(){var i;if(null==(i=this._diffStyleRequest)||i.abort(),"string"==typeof t){this._diffStyleRequest=new AbortController;let i=this._diffStyleRequest;try{let n=yield this._requestManager.transformRequest(t,"Style");if(i.signal.aborted){this._diffStyleRequest=null;return}let a=yield ME(n,i);this._diffStyleRequest=null,this._updateDiff(a.data,r)}catch(t){this._diffStyleRequest=null,xT(t)||this.fire(new ML(vJ(t)))}}else"object"==typeof t&&(this._diffStyleRequest=null,this._updateDiff(t,r))})}_updateDiff(t,r){try{this.style.setState(t,r)&&this._update(!0)}catch(i){xf(`Unable to perform style diff: ${vJ(i).message}. Rebuilding the style from scratch.`),this._updateStyle(t,r)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():void xf("There is no style added to the map.")}addSource(t,r){return this._lazyInitEmptyStyle(),this.style.addSource(t,r),this._update(!0)}isSourceLoaded(t){var r;let i=null==(r=this.style)?void 0:r.tileManagers[t];return void 0===i?void this.fire(new ML(Error(`There is no tile manager with ID '${t}'`))):i.loaded()}setTerrain(t,r={}){if(this.style._checkLoaded(),t&&_5(this,Sa.terrain,{value:t},r))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let r=this.style.tileManagers[t.source];if(!r)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let i in null===this.terrain&&r.reload(),this.style._layers){let r=this.style._layers[i];"hillshade"===r.type&&r.source===t.source&&xf("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===r.type&&r.source===t.source&&xf("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain&&this.terrain.destroy(),this.terrain=new OS(this.painter,r,t,this._terrainSkirtLength),this.painter.renderToTexture=new jE(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=r=>this._handleTerrainDataEvent(r,t.source),this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);return this.style.triggerSymbolPlacement(),this.fire(new z8({terrain:t})),this}_handleTerrainDataEvent(t,r){var i;if("style"===t.dataType)return void this.terrain.tileManager.releaseAllRTT();let n=t.sourceId===r;if(n&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),n&&t.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),t.tile){if((null==(i=t.source)?void 0:i.type)==="image")return void this.terrain.tileManager.releaseAllRTT();this.terrain.tileManager.releaseRTT(t.tile.tileID)}}getTerrain(){var t,r;return null!=(r=null==(t=this.terrain)?void 0:t.options)?r:null}areTilesLoaded(){var t;for(let r of Object.values(null==(t=this.style)?void 0:t.tileManagers))if(!r.areTilesLoaded())return!1;return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){var r;return null==(r=this.style)?void 0:r.getSource(t)}setSourceTileLodParams(t,r,i){if(i){let n=this.getSource(i);if(!n)throw Error(`There is no source with ID "${i}", cannot set LOD parameters`);n.calculateTileZoom=LG(Math.max(1,t),Math.max(1,r))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=LG(Math.max(1,t),Math.max(1,r));return this._update(!0),this}refreshTiles(t,r){let i=this.style.tileManagers[t];if(!i)throw Error(`There is no tile manager with ID "${t}", cannot refresh tile`);void 0===r?i.reload(!0):i.refreshTiles(r.map(t=>new Ii(t.z,t.x,t.y)))}addImage(t,r,i={}){var n;this._lazyInitEmptyStyle();let a=this._createStyleImage(r,i);return a&&(this.style.addImage(t,a),null!=(n=a.userImage)&&n.onAdd&&a.userImage.onAdd(this,t)),this}setMissingStyleImageResolver(t){var r;return this._missingStyleImageResolver=t,null==(r=this.style)||r.setMissingImageResolver(t),this}_createStyleImage(t,r={}){let{pixelRatio:i=1,sdf:n=!1,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:u}=r;if(t instanceof HTMLImageElement||xg(t)){let{width:r,height:c,data:h}=zH.getImageData(t);return{data:new Dn({width:r,height:c},h),pixelRatio:i,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:u,sdf:n,version:0}}if(void 0===t.width||void 0===t.height)return this.fire(new ML(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`"))),null;{let{width:r,height:c,data:h}=t,d=TP(t.data);return{data:d?new Dn({width:r,height:c}):new Dn({width:r,height:c},new Uint8Array(h)),pixelRatio:i,stretchX:a,stretchY:o,content:s,textFitWidth:l,textFitHeight:u,sdf:n,version:0,isWebGLImage:d,userImage:t}}}updateImage(t,r){let i=this.style.getImage(t);if(!i)return this.fire(new ML(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:n,height:a,data:o}=r instanceof HTMLImageElement||xg(r)?zH.getImageData(r):r;if(void 0===n||void 0===a)return this.fire(new ML(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(n!==i.data.width||a!==i.data.height)return this.fire(new ML(Error("The width and height of the updated image must be that same as the previous version of the image")));if(i.isWebGLImage=TP(o),i.isWebGLImage)i.userImage=r;else{let t=!(r instanceof HTMLImageElement||xg(r));i.data.replace(o,t)}return this.style.updateImage(t,i),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new ML(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return _(this,null,function*(){let r=yield zX.getImage((yield this._requestManager.transformRequest(t,"Image")),new AbortController);if(!r.data)throw Error(`Could not load image ${t}: the response is empty`);return r})}listImages(){var t,r;return null!=(r=null==(t=this.style)?void 0:t.listImages())?r:[]}addLayer(t,r){return this._lazyInitEmptyStyle(),this.style.addLayer(t,r),this._update(!0)}moveLayer(t,r){return this.style.moveLayer(t,r),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){var r;return null==(r=this.style)?void 0:r.getLayer(t)}getLayersOrder(){var t,r;return null!=(r=null==(t=this.style)?void 0:t.getLayersOrder())?r:[]}setLayerZoomRange(t,r,i){return this.style.setLayerZoomRange(t,r,i),this._update(!0)}setFilter(t,r,i={}){var n;return null==(n=this.style)||n.setFilter(t,r,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,r,i,n={}){var a;return null==(a=this.style)||a.setPaintProperty(t,r,i,n),this._update(!0)}getPaintProperty(t,r){return this.style.getPaintProperty(t,r)}setLayoutProperty(t,r,i,n={}){return this.style.setLayoutProperty(t,r,i,n),this._update(!0)}getLayoutProperty(t,r){return this.style.getLayoutProperty(t,r)}setGlyphs(t,r={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,r),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(t){return this._lazyInitEmptyStyle(),this.style.setFontFaces(t),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(t,r,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,r,i,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,r={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,r,t=>{t||this._update(!0)}),this}setLight(t,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,r),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,r={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,r),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,r){return this.style.setFeatureState(t,r),this._update()}removeFeatureState(t,r){return this.style.removeFeatureState(t,r),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,r=0;return this._container&&(t=this._container.clientWidth||400,r=this._container.clientHeight||300),[t,r]}_shouldHandleInitialResize(){var t;if(!(null!=(t=this._container)&&t.clientWidth)||!this._container.clientHeight)return!1;let[r,i]=this._containerDimensions();return r!==this._camera.transform.width||i!==this._camera.transform.height}_setupResizeObserver(){var t;let r=!1,i=zg(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50),n=null!=(t=this._ownerWindow.ResizeObserver)?t:ResizeObserver;this._resizeObserver=new n(t=>{(r||(r=!0,this._shouldHandleInitialResize()))&&i(t)}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if("string"==typeof t){let r=document.getElementById(t);if(!r)throw Error(`Container '${t}' not found.`);return r}if(t instanceof HTMLElement||t&&"object"==typeof t&&1===t.nodeType)return t;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let r=this._canvasContainer=zZ.create("div","maplibregl-canvas-container",t);this._interactive&&r.classList.add("maplibregl-interactive"),this._canvas=zZ.create("canvas","maplibregl-canvas",r),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let i=this._containerDimensions(),n=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],n);let a=this._controlContainer=zZ.create("div","maplibregl-control-container",t),o=this._controlPositions={};for(let t of["top-left","top-right","bottom-left","bottom-right"])o[t]=zZ.create("div",`maplibregl-ctrl-${t} `,a);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(t,r,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*r),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${r}px`}_setupPainter(){let t=p(f({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),r=null;this._canvas.addEventListener("webglcontextcreationerror",t=>{r=t},{once:!0});let i=this._canvas.getContext("webgl2",t);if(!i)throw new BG(t,r);this.painter=new Bq(i,this._camera.transform)}migrateProjection(t,r){this._camera.migrateProjection(t,r),this.painter.transform=t,this.fire(new z7({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){var r;return null!=(r=this.style)&&r._loaded&&(this._styleDirty||(this._styleDirty=t),this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){var r,i,n,a,o;let s=this._idleTriggered?this._fadeDuration:0,l=(null==(r=this.style.projection)?void 0:r.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let u=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this._camera.transform.zoom,r=Lu();this.style.zoomHistory.update(t,r);let i=new Sc(t,{now:r,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=i.crossFadingFactor();(1!==n||n!==this._crossFadingFactor)&&(u=!0,this._crossFadingFactor=n),this.style.update(i)}let c=(null==(i=this.style.projection)?void 0:i.transitionState)>0!==l;this._camera.transform.setTransitionState(null==(n=this.style.projection)?void 0:n.transitionState),this.style&&(this._sourcesDirty||c)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=null==(a=this.style)?void 0:a._updatePlacement(this._camera.transform,this.showCollisionBoxes,s,this._crossSourceCollisions,c),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new zJ("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new zJ("load"))),this.style&&(this.style.hasTransitions()||u)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let h=this._sourcesDirty||this._styleDirty||this._placementDirty||(null==(o=this.painter.renderToTexture)?void 0:o.needsFollowUpFrame);return h||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new zJ("idle")),!this._loaded||this._fullyLoaded||h||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){var t,r;for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),null==(t=this._diffStyleRequest)||t.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),"u">typeof window&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),zX.removeThrottleControl(this._imageQueueHandle),null==(r=this._resizeObserver)||r.disconnect();let i=this.painter.context.gl.getExtension("WEBGL_lose_context");i?.loseContext&&i.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new zJ("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,zH.frame(this._frameRequest,t=>{this._frameRequest=null;try{this._render(t)}catch(t){if(!xT(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return"6.9.0"}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}},jL={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0},jP=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),r=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom(!0);this._zoomInButton.disabled=r,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",r.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{let t=this._map.getPitch(),r=this._map.getRoll(),i=this._map.getBearing(),n=1/Math.cos(xv(t))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${n}) rotateZ(${-r}deg) rotateX(${t}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${n}) rotateX(${t}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-i-r}deg)`;return}this._compassIcon.style.transform=`rotate(${-i}deg)`},this._setButtonTitle=(t,r)=>{let i=this._map._getUIString(`NavigationControl.${r}`);t.title=i,t.setAttribute("aria-label",i)},this.options=xn({},jL,t),this._container=zZ.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),zZ.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),zZ.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=zZ.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new jz(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,r){let i=zZ.create("button",t,this._container);return i.type="button",i.addEventListener("click",r),i}},jz=class{constructor(t,r,i=!1){this.mousedown=t=>{this.startMove(t,zZ.mousePos(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,zZ.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1===t.targetTouches.length?(this._startPos=this._lastPos=zZ.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=t=>{1===t.targetTouches.length?(this._lastPos=zZ.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos)):this.reset()},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=r;let n=new B9;this._rotatePitchHandler=new B4({clickTolerance:3,move:(t,n)=>{let a=r.getBoundingClientRect(),o=new vu((a.bottom-a.top)/2,(a.right-a.left)/2);return{bearingDelta:x_(new vu(t.x,n.y),n,o),pitchDelta:i?-((n.y-t.y)*.5):void 0}},moveStateManager:n,enable:!0,assignEvents:()=>{}}),this.map=t,r.addEventListener("mousedown",this.mousedown),r.addEventListener("touchstart",this.touchstart,{passive:!1}),r.addEventListener("touchcancel",this.reset)}startMove(t,r){this._rotatePitchHandler.dragStart(t,r),zZ.disableDrag()}move(t,r){let i=this.map,{bearingDelta:n,pitchDelta:a}=this._rotatePitchHandler.dragMove(t,r)||{};n&&i.setBearing(i.getBearing()+n),a&&i.setPitch(i.getPitch()+a)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){zZ.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}},jO={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%)"},jR={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},jj=class extends MI{},jN=class extends MI{},jV=class extends MP{constructor(t){if(super(),this._onClick=t=>{this.fire(new jN("click",{originalEvent:t}))},this._onKeyPress=t=>{("Space"===t.code||"Enter"===t.code)&&this.togglePopup()},this._onKeyDown=t=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||t.composedPath()[0]!==this._element||t.altKey||t.ctrlKey||t.metaKey)return;let r=jR[t.key];if(!r)return;t.preventDefault(),t.stopPropagation();let i=t.shiftKey?10:1,n=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new vu(n.x+r[0]*i,n.y+r[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new jj("dragstart"))),this.fire(new jj("drag"))},this._onKeyUp=t=>{jR[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let r=t.originalEvent.target,i=this._element;this._popup&&(r===i||i.contains(r))&&this.togglePopup()},this._update=t=>{if(!this._map)return;let r=this._map.loaded()&&!this._map.isMoving();t?.type!=="terrain"&&(t?.type!=="render"||r)||this._map.once("render",this._update),this._lngLat=zk(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),this._element.style.transform=`${jO[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${n} ${i}`,zH.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(t?.type==="moveend")}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let r=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new jj("dragstart"))),this.fire(new jj("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new jj("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t?.anchor||"center",this._color=t?.color||"#3FB1CE",this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=vu.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=zZ.create("div");let r=(jB||(jB=zE("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[zE("g",{"fill-rule":"nonzero"},[zE("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([t,r])=>zE("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:t,ry:r}))),zE("g",{fill:"#3FB1CE"},[zE("path",{d:"M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"})]),zE("g",{opacity:"0.25",fill:"#000000"},[zE("path",{d:"M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"})]),zE("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),zE("g",{transform:"translate(8.0, 8.0)"},[zE("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),zE("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]))).cloneNode(!0);r.setAttributeNS(null,"height",`${41*this._scale}px`),r.setAttributeNS(null,"width",`${27*this._scale}px`),(function(t){return t.firstElementChild.children[1]})(r).setAttributeNS(null,"fill",this._color),this._element.appendChild(r),this._offset=vu.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),zS(this._element,this._anchor,"marker"),t?.className)for(let r of t.className.split(" "))this._element.classList.add(r);this._popup=null}addTo(t){return this.remove(),this._map=t,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._updateAccessibilityRole(),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=DQ.convert(t),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),t){if(!("offset"in t.options)){let r=13.5/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-((24.6+r)*1)],"bottom-right":[-r,-((24.6+r)*1)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new jj("dragend")))}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered||t&&(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map))),this}_updateOpacity(t=!1){var r,i;let n=null==(r=this._map)?void 0:r.terrain,a=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!n||a){let t=a?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==t&&(this._element.style.opacity=t,this._element.classList.toggle("maplibregl-marker-covered",a));return}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let o=this._map,s=o.terrain.depthAtPoint(this._pos),l=o.terrain.getElevationForLngLat(this._lngLat,o._camera.transform);if(o._camera.transform.lngLatToCameraDepth(this._lngLat,l)-s<.006){this._element.style.opacity=this._opacity,this._element.classList.remove("maplibregl-marker-covered");return}let u=-this._offset.y/o._camera.transform.pixelsPerMeter,c=Math.sin(o.getPitch()*Math.PI/180)*u,h=o.terrain.depthAtPoint(new vu(this._pos.x,this._pos.y-this._offset.y)),d=o._camera.transform.lngLatToCameraDepth(this._lngLat,l+c)-h>.006;null!=(i=this._popup)&&i.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",d)}getOffset(){return this._offset}setOffset(t){return this._offset=vu.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=("0"===this._element.getAttribute("tabindex")&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let t=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",t),this._roleManaged=!0}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,r){return(void 0===this._opacity||void 0===t&&void 0===r)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=String(t)),void 0!==r&&(this._opacityWhenCovered=String(r)),this._map&&this._updateOpacity(!0),this}},jU={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},jq=0,jG=!1,jH=class extends MI{},j$=class extends MI{},jW=class extends MI{},jY=class extends MP{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t)){this._setErrorState(),this.fire(new j$("outofmaxbounds",t)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new j$("geolocate",t)),this._finish()}},this._updateCamera=t=>{let r=new DQ(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,n=xn({bearing:this._map.getBearing()},this.options.fitBoundsOptions),a=FA.fromLngLat(r,i);this._map.fitBounds(a,n,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let r=new DQ(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&jG)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new jW("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let r=t?.[0]instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||r||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new jH("trackuserlocationend")),this.fire(new jH("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>{t.preventDefault()}),this._geolocateButton=zZ.create("button","maplibregl-ctrl-geolocate",this._container),zZ.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){xf("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=zZ.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new jV({element:this._dotElement}),this._circleElement=zZ.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new jV({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=xn({},jU,t)}onAdd(t){return this._map=t,this._container=zZ.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(t=!1){return _(this,null,function*(){if(void 0!==jF&&!t)return jF;if(void 0===window.navigator.permissions)return jF=!!window.navigator.geolocation;try{jF="denied"!==(yield window.navigator.permissions.query({name:"geolocation"})).state}catch{jF=!!window.navigator.geolocation}return jF})})().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,jq=0,jG=!1}_isOutOfMapMaxBounds(t){let r=this._map.getMaxBounds(),i=t.coords;return r&&(i.longituder.getEast()||i.latituder.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let t=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!t)return;let r=this._map.project(t),i=this._map.unproject([r.x+100,r.y]),n=t.distanceTo(i)/100,a=2*this._accuracy/n;this._circleElement.style.width=`${a.toFixed(2)}px`,this._circleElement.style.height=`${a.toFixed(2)}px`}trigger(){if(!this._setup)return xf("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 jH("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":jq--,jG=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new jH("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new jH("trackuserlocationstart")),this.fire(new jH("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++jq>1?(t={maximumAge:6e5,timeout:0},jG=!0):(t=this.options.positionOptions,jG=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},jZ={maxWidth:100,unit:"metric"},jX=class{constructor(t){this._onMove=()=>{zD(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,zD(this._map,this._container,this.options)},this.options=f(f({},jZ),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=zZ.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}},jK=class extends MI{},jJ=class extends MP{constructor(t={}){var r;super(),this._onFullscreenChange=()=>{var t;let r=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;null!=(t=r?.shadowRoot)&&t.fullscreenElement;)r=r.shadowRoot.fullscreenElement;r===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=null!=(r=t.pseudo)&&r,t?.container&&(t.container instanceof HTMLElement?this._container=t.container:xf("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=zZ.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=zZ.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);zZ.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new jK("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new jK("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},jQ=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=zZ.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=zZ.create("button","maplibregl-ctrl-terrain",this._container),zZ.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},j0=class{constructor(){this._toggleProjection=()=>{var t;let r=null==(t=this._map.getProjection())?void 0:t.type;"mercator"!==r&&r?this._map.setProjection({type:"mercator"}):this._map.setProjection({type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var t;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),(null==(t=this._map.getProjection())?void 0:t.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=zZ.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=zZ.create("button","maplibregl-ctrl-globe",this._container),zZ.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},j1={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},j2=class extends MI{},j3=class extends MP{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new j2("close"))),this),this._update=t=>{let r,i=this._lngLat||this._trackPointer;if(!this._map||!i||!this._content)return;if(!this._container){if(this._container=zZ.create("div","maplibregl-popup",this._map.getContainer()),this._tip=zZ.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=zk(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer),t&&"point"in t&&t.point&&(r=t.point),this._trackPointer&&!r)return;let n=this._flatPos=this._pos=this._trackPointer&&r?r:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&r?r:this._map._camera.transform.locationToScreenPoint(this._lngLat));let a=this.options.anchor,o=function t(r){if(!r)return t(new vu(0,0));if("number"==typeof r){let t=Math.round(Math.abs(r)/Math.SQRT2);return{center:new vu(0,0),top:new vu(0,r),"top-left":new vu(t,t),"top-right":new vu(-t,t),bottom:new vu(0,-r),"bottom-left":new vu(t,-t),"bottom-right":new vu(-t,-t),left:new vu(r,0),right:new vu(-r,0)}}if(r instanceof vu||Array.isArray(r)){let t=vu.convert(r);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:vu.convert(r.center||[0,0]),top:vu.convert(r.top||[0,0]),"top-left":vu.convert(r["top-left"]||[0,0]),"top-right":vu.convert(r["top-right"]||[0,0]),bottom:vu.convert(r.bottom||[0,0]),"bottom-left":vu.convert(r["bottom-left"]||[0,0]),"bottom-right":vu.convert(r["bottom-right"]||[0,0]),left:vu.convert(r.left||[0,0]),right:vu.convert(r.right||[0,0])}}(this.options.offset);if(!a){var s,l,u,c,h;let t=this._container.offsetWidth,r=this._container.offsetHeight,i=(s=this.options.padding)?{top:null!=(l=s.top)?l:0,right:null!=(u=s.right)?u:0,bottom:null!=(c=s.bottom)?c:0,left:null!=(h=s.left)?h:0}:{top:0,right:0,bottom:0,left:0},d;d=n.y+o.bottom.ythis._map._camera.transform.height-r-i.bottom?["bottom"]:[],n.xthis._map._camera.transform.width-t/2-i.right&&d.push("right"),a=0===d.length?"bottom":d.join("-")}let d=n.add(o[a]);this.options.subpixelPositioning||(d=d.round()),this._container.style.transform=`${jO[a]} translate(${d.x}px,${d.y}px)`,zS(this._container,a,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=xn(Object.create(j1),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new j2("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=DQ.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let r=document.createDocumentFragment(),i=document.createElement("body"),n;for(i.innerHTML=t;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)}getMaxWidth(){var t;return null==(t=this._container)?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=zZ.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}setPadding(t){this.options.padding=t,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=zZ.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let t=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");t&&t.focus()}},j5="6.9.0"}}),j6=g({"build/maplibre_worker.js"(t,r){r.exports='var t1=Object.defineProperty,e1=Object.defineProperties;var r1=Object.getOwnPropertyDescriptors;var nh=Object.getOwnPropertySymbols;var i1=Object.prototype.hasOwnProperty,n1=Object.prototype.propertyIsEnumerable;var ah=(t,e,r)=>e in t?t1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,je=(t,e)=>{for(var r in e||(e={}))i1.call(e,r)&&ah(t,r,e[r]);if(nh)for(var r of nh(e))n1.call(e,r)&&ah(t,r,e[r]);return t},Si=(t,e)=>e1(t,r1(e));var rt=(t,e,r)=>new Promise((i,n)=>{var a=l=>{try{o(r.next(l))}catch(u){n(u)}},s=l=>{try{o(r.throw(l))}catch(u){n(u)}},o=l=>l.done?i(l.value):Promise.resolve(l.value).then(a,s);o((r=r.apply(t,e)).next())});var a1=Object.create,ep=Object.defineProperty,s1=Object.getOwnPropertyDescriptor,o1=Object.getOwnPropertyNames,l1=Object.getPrototypeOf,rp=Object.prototype.hasOwnProperty,fl=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),u1=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=o1(e),a=0,s=n.length,o;ae[l]).bind(null,o),enumerable:!(i=s1(e,o))||i.enumerable});return t},h1=(t,e,r)=>(r=t==null?{}:a1(l1(t)),u1(e||!t||!t.__esModule||!rp.call(t,"default")?ep(r,"default",{value:t,enumerable:!0}):r,t));function B(t,e){this.x=t,this.y=e}B.prototype={clone(){return new B(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){let e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){let e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){let t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){let e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround(t,e){let r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:B},B.convert=function(t){if(t instanceof B)return t;if(Array.isArray(t))return new B(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new B(+t.x,+t.y);throw Error("Expected [x, y] or {x, y} point format")};function c1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var Nn;function p1(){return Nn!=null||(Nn=typeof OffscreenCanvas<"u"&&!!new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Nn}var Un;function f1(){if(Un==null&&(Un=!1,p1())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let r=0;r<25;r++){let i=r*4;t.fillStyle=`rgb(${i},${i+1},${i+2})`,t.fillRect(r%5,Math.floor(r/5),1,1)}let e=t.getImageData(0,0,5,5).data;for(let r=0;r<100;r++)if(r%4!=3&&e[r]!==r){Un=!0;break}}}return Un||!1}var pe=typeof Float32Array<"u"?Float32Array:Array;Math.PI/180,180/Math.PI;function d1(){var t=new pe(9);return pe!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ip(){var t=new pe(3);return pe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function y1(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function sh(t,e,r){var i=new pe(3);return i[0]=t,i[1]=e,i[2]=r,i}function m1(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function g1(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ks(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],l=r[2];return t[0]=n*l-a*o,t[1]=a*s-i*l,t[2]=i*o-n*s,t}var x1=y1;(function(){var t=ip();return function(e,r,i,n,a,s){var o,l;for(r||(r=3),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o0&&(s=1/Math.sqrt(s)),t[0]=r*s,t[1]=i*s,t[2]=n*s,t[3]=a*s,t}function w1(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}(function(){var t=v1();return function(e,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o1e-6?(p=Math.acos(f),d=Math.sin(p),y=Math.sin((1-i)*p)/d,m=Math.sin(i*p)/d):(y=1-i,m=i),t[0]=y*n+m*l,t[1]=y*a+m*u,t[2]=y*s+m*h,t[3]=y*o+m*c,t}function _1(t,e){var r=e[0]+e[4]+e[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[n*3+n]&&(n=2);var a=(n+1)%3,s=(n+2)%3;i=Math.sqrt(e[n*3+n]-e[a*3+a]-e[s*3+s]+1),t[n]=.5*i,i=.5/i,t[3]=(e[a*3+s]-e[s*3+a])*i,t[a]=(e[a*3+n]+e[n*3+a])*i,t[s]=(e[s*3+n]+e[n*3+s])*i}return t}var lh=b1;(function(){var t=ip(),e=sh(1,0,0),r=sh(0,1,0);return function(i,n,a){var s=g1(n,a);return s<-.999999?(ks(t,e,n),x1(t)<1e-6&&ks(t,r,n),m1(t,t),D1(i,t,Math.PI),i):s>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(ks(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+s,lh(i,i))}})(),(function(){var t=oh(),e=oh();return function(r,i,n,a,s,o){return Ts(t,i,s,o),Ts(e,n,a,o),Ts(r,t,e,2*o*(1-o)),r}})(),(function(){var t=d1();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],lh(e,_1(e,t))}})();function A1(){var t=new pe(2);return pe!=Float32Array&&(t[0]=0,t[1]=0),t}(function(){var t=A1();return function(e,r,i,n,a,s){var o,l;for(r||(r=2),i||(i=0),l=n?Math.min(n*r+i,e.length):e.length,o=i;o=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function E1(t,e,r,i){return c1(t,e,r,i)}var d5=E1(.25,.1,.25,1);function Ji(t,e,r){return Math.min(r,Math.max(e,t))}function F1(t,e,r){let i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function Gt(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function k1(t){return Math.log(t)/Math.LN2%1==0}function Ia(t,e,r){let i={};for(let n in t)i[n]=e.call(r||this,t[n],n,t);return i}function T1(t,e,r){let i={};for(let n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function He(t){return Array.isArray(t)?t.map(He):typeof t=="object"&&t?Ia(t,He):t}var uh={};function Bt(t){uh[t]||(typeof console<"u"&&console.warn(t),uh[t]=!0)}function Ke(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function mr(t){return typeof WorkerGlobalScope<"u"&&t!==void 0&&t instanceof WorkerGlobalScope}function Ca(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}function I1(t,e,r,i,n){let a=Math.max(-e,0)*4,s=(Math.max(0,r)-r)*i*4+a,o=i*4,l=Math.max(0,e),u=Math.max(0,r),h=Math.min(t.width,e+i),c=Math.min(t.height,r+n);return{rect:{x:l,y:u,width:h-l,height:c-u},layout:[{offset:s,stride:o}]}}function C1(t,e,r,i,n){return rt(this,null,function*(){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(t,{timestamp:0});try{let s=a==null?void 0:a.format;if(!s||!(s.startsWith("BGR")||s.startsWith("RGB")))throw Error(`Unrecognized format ${s}`);let o=s.startsWith("BGR"),l=new Uint8ClampedArray(i*n*4);if(yield a.copyTo(l,I1(t,e,r,i,n)),o)for(let u=0;u{t.removeEventListener(e,r,i)}}}function ch(t){return t*Math.PI/180}var ph="AbortError",dl=class extends Error{constructor(t=ph){super(t instanceof Error?t.message:t),this.name=ph,t instanceof Error&&t.stack&&(this.stack=t.stack)}};function yl(t){return t instanceof Error&&t.name==="AbortError"}function B1(t){if(t.aborted)throw new dl(t.reason)}var ml={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function P1(t){return ml.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}function sp(t,e){ml.REGISTERED_PROTOCOLS[t]=e}function op(t){delete ml.REGISTERED_PROTOCOLS[t]}var fh="global-dispatcher",ya=class extends Error{constructor(t,e,r,i){super(`AJAXError: ${e} (${t}): ${r}`),this.status=t,this.statusText=e,this.url=r,this.body=i}};function lp(){var t;if(mr(self))return(t=self.worker)==null?void 0:t.referrer;if(window.location.protocol==="blob:")try{return window.parent.location.href}catch(e){}return window.location.href}var z1=t=>{var e;return t.startsWith("file:")||((e=lp())==null?void 0:e.startsWith("file:"))&&!/^\\w+:/.test(t)};function L1(t,e){return rt(this,null,function*(){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:lp(),referrerPolicy:t.referrerPolicy,signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let i;try{i=yield fetch(r)}catch(s){throw yl(s)?s:new ya(0,Ki(s).message,t.url,new Blob)}if(!i.ok){let s=yield i.blob();throw new ya(i.status,i.statusText,t.url,s)}let n;n=t.type==="arrayBuffer"||t.type==="image"?i.arrayBuffer():t.type==="json"?i.json():i.text();let a=yield n;return B1(e.signal),{data:a,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),etag:i.headers.get("ETag")}})}function V1(t,e){return new Promise((r,i)=>{var a;let n=new XMLHttpRequest;n.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(n.responseType="arraybuffer");for(let s in t.headers)n.setRequestHeader(s,t.headers[s]);t.type==="json"&&(n.responseType="text",(a=t.headers)!=null&&a.Accept||n.setRequestHeader("Accept","application/json")),n.withCredentials=t.credentials==="include",n.onerror=()=>{i(Error(n.statusText))},n.onload=()=>{if(!e.signal.aborted)if((n.status>=200&&n.status<300||n.status===0)&&n.response!==null){let s=n.response;if(t.type==="json")try{s=JSON.parse(n.response)}catch(o){i(o);return}r({data:s,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires"),etag:n.getResponseHeader("ETag")})}else{let s=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});i(new ya(n.status,n.statusText,t.url,s))}},e.signal.addEventListener("abort",()=>{n.abort(),i(new dl(e.signal.reason))}),n.send(t.body)})}var Ma=function(t,e){return rt(this,null,function*(){var r,i;if(t.url.includes("://")&&!/^https?:|^file:/.test(t.url)){let n=P1(t.url);if(n){let a=yield n(t,e);return!a.data&&t.type==="arrayBuffer"?Gt(a,{data:new ArrayBuffer(0)}):a}if(mr(self)&&((r=self.worker)!=null&&r.actor))return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:fh},e)}if(!z1(t.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return L1(t,e);if(mr(self)&&((i=self.worker)!=null&&i.actor))return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:fh},e)}return V1(t,e)})},up=(t,e)=>Ma(Gt(t,{type:"json"}),e),hp=(t,e)=>Ma(Gt(t,{type:"arrayBuffer"}),e);function dh(t,e,r){var i;(i=r[t])!=null&&i.includes(e)||(r[t]||(r[t]=[]),r[t].push(e))}function Is(t,e,r){if(r!=null&&r[t]){let i=r[t].indexOf(e);i!==-1&&r[t].splice(i,1)}}var cp=class{constructor(t,e={}){Gt(this,e),this.type=t}},ma=class extends cp{constructor(t,e={}){super("error",Gt({error:t},e))}},O1=class{on(t,e){return this._listeners||(this._listeners={}),dh(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return Is(t,e,this._listeners),Is(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners||(this._oneTimeListeners={}),dh(t,e,this._oneTimeListeners),this):new Promise(r=>this.once(t,r))}fire(t,e){var n,a,s,o,l,u;let r=typeof t=="string"?new cp(t,e||{}):t,i=r.type;if(this.listens(i)){r.target=this;let h=(s=(a=(n=this._listeners)==null?void 0:n[i])==null?void 0:a.slice())!=null?s:[];for(let f of h)f.call(this,r);let c=(u=(l=(o=this._oneTimeListeners)==null?void 0:o[i])==null?void 0:l.slice())!=null?u:[];for(let f of c)Is(i,f,this._oneTimeListeners),f.call(this,r);let p=this._eventedParent;p&&(Gt(r,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(r))}else r instanceof ma&&console.error(r.error);return this}listens(t){var e,r,i,n,a;return!!((r=(e=this._listeners)==null?void 0:e[t])!=null&&r.length||(n=(i=this._oneTimeListeners)==null?void 0:i[t])!=null&&n.length||(a=this._eventedParent)!=null&&a.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}},pp={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}},w=pp,fp=["type","source","source-layer","minzoom","maxzoom","filter","layout"],E=class{constructor(t,e,r,i,n="error"){this.message=(t?`${t}: `:"")+r,i&&(this.identifier=i),this.severity=n,e!=null&&e.__line__&&(this.line=e.__line__)}},dn={kind:"null"},I={kind:"number"},Y={kind:"string"},tt={kind:"boolean"},ce={kind:"color"},Ba={kind:"projectionDefinition"},fr={kind:"object"},Z={kind:"value"},R1={kind:"error"},Pa={kind:"collator"},yn={kind:"formatted"},za={kind:"padding"},Qi={kind:"colorArray"},La={kind:"numberArray"},mn={kind:"resolvedImage"},Va={kind:"variableAnchorOffsetCollection"};function Ut(t,e){return{kind:"array",itemType:t,N:e}}function yt(t){if(t.kind==="array"){let e=yt(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}var $1=[dn,I,Y,tt,ce,Ba,yn,fr,Ut(Z),za,La,Qi,mn,Va];function tn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!tn(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of $1)if(!tn(r,e))return null}}return`Expected ${yt(t)} but found ${yt(e)} instead.`}function gl(t,e){return e.some(r=>r.kind===t.kind)}function dr(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}function Ge(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}var dp=.96422,yp=.82521,mp=4/29,Ks=6/29,gp=3*Ks*Ks,N1=Math.PI/180,U1=180/Math.PI;function xp(t){return t%=360,t<0&&(t+=360),t}function vp([t,e,r,i]){t=Cs(t),e=Cs(e),r=Cs(r);let n,a,s=Ms((.2225045*t+.7168786*e+.0606169*r)/1);t===e&&e===r?n=a=s:(n=Ms((.4360747*t+.3850649*e+.1430804*r)/dp),a=Ms((.0139322*t+.0971045*e+.7141733*r)/yp));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Cs(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ms(t){return t>.008856451679035631?t**(1/3):t/gp+mp}function bp([t,e,r,i]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,s=isNaN(r)?n:n-r/200;return n=1*Ps(n),a=dp*Ps(a),s=yp*Ps(s),[Bs(3.1338561*a-1.6168667*n-.4906146*s),Bs(-.9787684*a+1.9161415*n+.033454*s),Bs(.0719453*a-.2289914*n+1.4052427*s),i]}function Bs(t){return t=t<=.00304?12.92*t:1.055*t**(1/2.4)-.055,t<0?0:t>1?1:t}function Ps(t){return t>Ks?t*t*t:gp*(t-mp)}function q1(t){let[e,r,i,n]=vp(t),a=Math.sqrt(r*r+i*i);return[Math.round(a*1e4)?xp(Math.atan2(i,r)*U1):NaN,a,e,n]}function j1([t,e,r,i]){return t=isNaN(t)?0:t*N1,bp([r,Math.cos(t)*e,Math.sin(t)*e,i])}function G1([t,e,r,i]){t=xp(t),e/=100,r/=100;function n(a){let s=(a+t/30)%12,o=e*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(s-3,9-s,1))}return[n(0),n(8),n(4),i]}var X1=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function ji(t,e){return X1(t,e)?t[e]:void 0}function Y1(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=ji(W1,t);if(e){let[i,n,a]=e;return[i/255,n/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let i=t.length<6?1:2,n=1;return[qn(t.slice(n,n+=i)),qn(t.slice(n,n+=i)),qn(t.slice(n,n+=i)),qn(t.slice(n,n+i)||"ff")]}if(t.startsWith("rgb")){let i=t.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(i){let[n,a,s,o,l,u,h,c,p,f,d,y]=i,m=[o||" ",h||" ",f].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let g=[s,u,p].join(""),x=g==="%%%"?100:g===""?255:0;if(x){let v=[Rr(+a/x,0,1),Rr(+l/x,0,1),Rr(+c/x,0,1),d?yh(+d,y):1];if(mh(v))return v}}return}}let r=t.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(r){let[i,n,a,s,o,l,u,h,c]=r,p=[a||" ",o||" ",u].join("");if(p===" "||p===" /"||p===",,"||p===",,,"){let f=[+n,Rr(+s,0,100),Rr(+l,0,100),h?yh(+h,c):1];if(mh(f))return G1(f)}}}function qn(t){return parseInt(t.padEnd(2,t),16)/255}function yh(t,e){return Rr(e?t/100:t,0,1)}function Rr(t,e,r){return Math.min(Math.max(e,t),r)}function mh(t){return!t.some(Number.isNaN)}var W1={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Je(t,e,r){return t+r*(e-t)}function ti(t,e,r){return t.map((i,n)=>Je(i,e[n],r))}function Z1(t){return t==="rgb"||t==="hcl"||t==="lab"}var Pt,gt=(Pt=class{constructor(e,r,i,n=1,a=!0){this.r=e,this.g=r,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,r,i,n]))}static parse(e){if(e instanceof Pt)return e;if(typeof e!="string")return;let r=Y1(e);if(r)return new Pt(...r,!1)}get rgb(){let{r:e,g:r,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[e/a,r/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",q1(this.rgb))}get lab(){return this.overwriteGetter("lab",vp(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,i,n]=this.rgb;return`rgba(${[e,r,i].map(a=>Math.round(a*255)).join(",")},${n})`}static interpolate(e,r,i,n="rgb"){switch(n){case"rgb":{let[a,s,o,l]=ti(e.rgb,r.rgb,i);return new Pt(a,s,o,l,!1)}case"hcl":{let[a,s,o,l]=e.hcl,[u,h,c,p]=r.hcl,f,d;if(!isNaN(a)&&!isNaN(u)){let v=u-a;u>a&&v>180?v-=360:u180&&(v+=360),f=a+i*v}else isNaN(a)?isNaN(u)?f=NaN:(f=u,(o===1||o===0)&&(d=h)):(f=a,(c===1||c===0)&&(d=s));let[y,m,g,x]=j1([f,d!=null?d:Je(s,h,i),Je(o,c,i),Je(l,p,i)]);return new Pt(y,m,g,x,!1)}case"lab":{let[a,s,o,l]=bp(ti(e.lab,r.lab,i));return new Pt(a,s,o,l,!1)}}}},Pt.black=new Pt(0,0,0,1),Pt.white=new Pt(1,1,1,1),Pt.transparent=new Pt(0,0,0,0),Pt.red=new Pt(1,0,0,1),Pt),H1=["bottom","center","top"],Js=class{constructor(t,e,r,i,n,a){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}},ze=class la{constructor(e){this.sections=e}static fromString(e){return new la([new Js(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof la?e:la.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Ae=class Li{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Li)return e;if(typeof e=="number")return new Li([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Li(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Li(ti(e.values,r.values,i))}},Se=class Vi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Vi)return e;if(typeof e=="number")return new Vi([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new Vi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i){return new Vi(ti(e.values,r.values,i))}},oe=class Oi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Oi)return e;if(typeof e=="string"){let i=gt.parse(e);return i?new Oi([i]):void 0}if(!Array.isArray(e))return;let r=[];for(let i of e){if(typeof i!="string")return;let n=gt.parse(i);if(!n)return;r.push(n)}return new Oi(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,i,n="rgb"){let a=[];if(e.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let s=0;s=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?i===void 0||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[t,e,r,i]:[t,e,r]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function ei(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Dr||t instanceof gt||t instanceof xl||t instanceof ze||t instanceof Ae||t instanceof Se||t instanceof oe||t instanceof De||t instanceof _e)return!0;if(Array.isArray(t)){for(let e of t)if(!ei(e))return!1;return!0}if(typeof t=="object"){for(let e in t)if(!ei(t[e]))return!1;return!0}return!1}function _t(t){if(t===null)return dn;if(typeof t=="string")return Y;if(typeof t=="boolean")return tt;if(typeof t=="number")return I;if(t instanceof gt)return ce;if(t instanceof Dr)return Ba;if(t instanceof xl)return Pa;if(t instanceof ze)return yn;if(t instanceof Ae)return za;if(t instanceof Se)return La;if(t instanceof oe)return Qi;if(t instanceof De)return Va;if(t instanceof _e)return mn;if(Array.isArray(t)){let e=t.length,r;for(let i of t){let n=_t(i);if(!r)r=n;else{if(r===n)continue;r=Z;break}}return Ut(r||Z,e)}return fr}function Gi(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof gt||t instanceof Dr||t instanceof ze||t instanceof Ae||t instanceof Se||t instanceof oe||t instanceof De||t instanceof _e?t.toString():JSON.stringify(t)}var ri=class _p{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`\'literal\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=_t(i),a=r.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new _p(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},J1=["Unknown","Point","LineString","Polygon"],Ap=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?J1[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=gt.parse(t),this._parseColorCache.set(t,e)),e}};function Oa(t,e,r){let i=t.length-1,n=0,a=i,s=0,o,l;for(;n<=a;)if(s=Math.floor((n+a)/2),o=t[s],l=t[s+1],o<=e){if(s===i||ee)a=s-1;else throw new ft("Input is not a number.",r);return 0}var vl=class Sp{constructor(e,r,i,n){this.type=e,this.input=r,this.key=n,this.labels=[],this.outputs=[];for(let[a,s]of i)this.labels.push(a),this.outputs.push(s)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(e[1],1,I);if(!i)return null;let n=[],a=null;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);for(let s=1;s=o)return r.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',u);let c=r.parse(l,h,a);if(!c)return null;a||(a=c.type),n.push([o,c])}return new Sp(a,i,n,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;return n>=r[a-1]?i[a-1].evaluate(e):i[Oa(r,n,this.key)].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Q1(t,e,r,i){let n=3*t,a=3*(r-t)-n,s=1-n-a,o=3*e,l=3*(i-e)-o,u=1-o-l;return function(h,c=1e-6){if(h<=0)return 0;if(h>=1)return 1;let p=h;for(let y=0;y<8;y++){let m=((s*p+a)*p+n)*p-h;if(Math.abs(m)m?f=p:d=p,p=(f+d)*.5}return((u*p+l)*p+o)*p}}var be=class Qs{constructor(e,r,i,n,a,s){this.type=e,this.operator=r,this.interpolation=i,this.input=n,this.key=s,this.labels=[],this.outputs=[];for(let[o,l]of a)this.labels.push(o),this.outputs.push(l)}static interpolationFactor(e,r,i,n){let a=0;if(e.name==="exponential")a=zs(r,e.base,i,n);else if(e.name==="linear")a=zs(r,1,i,n);else if(e.name==="cubic-bezier"){let s=e.controlPoints;a=Q1(s[0],s[1],s[2],s[3])(zs(r,1,i,n))}return a}static parse(e,r){let[i,n,a,...s]=e;if(!Array.isArray(n)||n.length===0)return r.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let u=n[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:u}}else if(n[0]==="cubic-bezier"){let u=n.slice(1);if(u.length!==4||u.some(h=>typeof h!="number"||h<0||h>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:u}}else return r.error(`Unknown interpolation type ${String(n[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,I),!a)return null;let o=[],l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&r.expectedType!=Qi?l=ce:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u=h)return r.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',p);let d=r.parse(c,f,l);if(!d)return null;l||(l=d.type),o.push([h,d])}return!Ge(l,I)&&!Ge(l,Ba)&&!Ge(l,ce)&&!Ge(l,za)&&!Ge(l,La)&&!Ge(l,Qi)&&!Ge(l,Va)&&!Ge(l,Ut(I))?r.error(`Type ${yt(l)} is not interpolatable.`):new Qs(l,i,n,a,o,r.key)}evaluate(e){let r=this.labels,i=this.outputs;if(r.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=r[0])return i[0].evaluate(e);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(e);let s=Oa(r,n,this.key),o=r[s],l=r[s+1],u=Qs.interpolationFactor(this.interpolation,n,o,l),h=i[s].evaluate(e),c=i[s+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Je(h,c,u);case"color":return gt.interpolate(h,c,u);case"padding":return Ae.interpolate(h,c,u);case"colorArray":return oe.interpolate(h,c,u);case"numberArray":return Se.interpolate(h,c,u);case"variableAnchorOffsetCollection":return De.interpolate(h,c,u,this.key);case"array":return ti(h,c,u);case"projectionDefinition":return Dr.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return gt.interpolate(h,c,u,"hcl");case"colorArray":return oe.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return gt.interpolate(h,c,u,"lab");case"colorArray":return oe.interpolate(h,c,u,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function zs(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}var gr={color:gt.interpolate,number:Je,padding:Ae.interpolate,numberArray:Se.interpolate,colorArray:oe.interpolate,variableAnchorOffsetCollection:De.interpolate,array:ti},Ep=class Fp{constructor(e){this.type=yn,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[1];if(!Array.isArray(i)&&typeof i=="object")return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let s=1;s<=e.length-1;++s){let o=e[s];if(a&&typeof o=="object"&&!Array.isArray(o)){a=!1;let l=null;if(o["font-scale"]&&(l=r.parse(o["font-scale"],1,I),!l))return null;let u=null;if(o["text-font"]&&(u=r.parse(o["text-font"],1,Ut(Y)),!u))return null;let h=null;if(o["text-color"]&&(h=r.parse(o["text-color"],1,ce),!h))return null;let c=null;if(o["vertical-align"]){if(typeof o["vertical-align"]=="string"&&!H1.includes(o["vertical-align"]))return r.error(`\'vertical-align\' must be one of: \'bottom\', \'center\', \'top\' but found \'${o["vertical-align"]}\' instead.`);if(c=r.parse(o["vertical-align"],1,Y),!c)return null}let p=n[n.length-1];p.scale=l,p.font=u,p.textColor=h,p.verticalAlign=c}else{let l=r.parse(e[s],1,Z);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Fp(n)}evaluate(e){return new ze(this.sections.map(r=>{let i=r.content.evaluate(e);return _t(i)===mn?new Js("",i,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(e):null):new Js(Gi(i),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null,r.verticalAlign?r.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}};function kp(t,e,r=0,i=t.length-1,n=t0){for(;i>r;){if(i-r>600){let l=i-r+1,u=e-r+1,h=Math.log(l),c=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1);kp(t,e,Math.max(r,Math.floor(e-u*c/l+p)),Math.min(i,Math.floor(e+(l-u)*c/l+p)),n)}let a=t[e],s=r,o=i;for(ki(t,r,e),n(t[i],a)>0&&ki(t,r,i);s0;)o--}n(t[r],a)===0?ki(t,r,o):(o++,ki(t,o,i)),o<=e&&(r=o+1),e<=o&&(i=o-1)}}function ki(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function t0(t,e){return te)}function Ra(t,e){if(t.length<=1)return[t];let r=[],i,n;for(let a of t){let s=r0(a);s!==0&&(a.area=Math.abs(s),n===void 0&&(n=s<0),n===s<0?(i&&r.push(i),i=[a]):i.push(a))}if(i&&r.push(i),e>1)for(let a=0;a2){let u=e[1];if(typeof u!="string"||!(u in jn)||u==="object")return r.error(\'The item type argument of "array" must be one of string, number, boolean\',1);o=jn[u],i++}else o=Z;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error(\'The length argument to "array" must be a positive integer literal\',2);l=e[2],i++}n=Ut(o,l)}else{if(!jn[a])throw Error(`Types doesn\'t contain name = ${a}`);n=jn[a]}let s=[];for(;ie.outputDefined())}},gh={"to-boolean":tt,"to-color":ce,"to-number":I,"to-string":Y},jr=class Ip{constructor(e,r,i){this.type=e,this.args=r,this.key=i}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=e[0];if(!gh[i])throw Error(`Can\'t parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&e.length!==2)return r.error("Expected one argument.");let n=gh[i],a=[];for(let s=1;s4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Dp(r[0],r[1],r[2],r[3]),!i))return new gt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ft(i||`Could not parse color from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"padding":{let r;for(let i of this.args){r=i.evaluate(e);let n=Ae.parse(r);if(n)return n}throw new ft(`Could not parse padding from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"numberArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=Se.parse(r);if(n)return n}throw new ft(`Could not parse numberArray from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"colorArray":{let r;for(let i of this.args){r=i.evaluate(e);let n=oe.parse(r);if(n)return n}throw new ft(`Could not parse colorArray from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"variableAnchorOffsetCollection":{let r;for(let i of this.args){r=i.evaluate(e);let n=De.parse(r);if(n)return n}throw new ft(`Could not parse variableAnchorOffsetCollection from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}case"number":{let r=null;for(let i of this.args){if(r=i.evaluate(e),r===null)return 0;let n=Number(r);if(!isNaN(n))return n}throw new ft(`Could not convert ${JSON.stringify(r)} to number.`,this.key)}case"formatted":return ze.fromString(Gi(this.args[0].evaluate(e)));case"resolvedImage":return _e.fromString(Gi(this.args[0].evaluate(e)));case"projectionDefinition":{let r=this.args[0].evaluate(e);if(Dr.parse(r))return r;throw new ft(`Could not parse projectionDefinition from value \'${typeof r=="string"?r:JSON.stringify(r)}\'`,this.key)}default:return Gi(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Cp=class Mp{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let i=[];for(let a=1;a=i.length)throw new ft(`Array index out of bounds: ${r} > ${i.length-1}.`,this.key);if(r!==Math.floor(r))throw new ft(`Array index must be an integer, but found ${r} instead.`,this.key);return i[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},n0=class Lp{constructor(e,r,i){this.needle=e,this.haystack=r,this.key=i,this.type=tt}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);return!i||!n?null:gl(i.type,[tt,Y,I,dn,Z])?new Lp(i,n,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!dr(r,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(_t(r))} instead.`,this.key);if(!dr(i,["string","array"]))throw new ft(`Expected second argument to be of type array or string, but found ${yt(_t(i))} instead.`,this.key);return i.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},a0=class to{constructor(e,r,i,n){this.needle=e,this.haystack=r,this.key=i,this.fromIndex=n,this.type=I}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,Z);if(!i||!n)return null;if(!gl(i.type,[tt,Y,I,dn,Z]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new to(i,n,r.key,a):null}return new to(i,n,r.key)}evaluate(e){let r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!dr(r,["boolean","string","number","null"]))throw new ft(`Expected first argument to be of type boolean, string, number or null, but found ${yt(_t(r))} instead.`,this.key);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),dr(i,["string"])){let a=i.indexOf(r,n);return a===-1?-1:[...i.slice(0,a)].length}if(dr(i,["array"]))return i.indexOf(r,n);throw new ft(`Expected second argument to be of type array or string, but found ${yt(_t(i))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},s0=class Vp{constructor(e,r,i,n,a,s){this.inputType=e,this.type=r,this.input=i,this.cases=n,this.outputs=a,this.otherwise=s}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let a={},s=[];for(let u=2;u2**53-1)return p.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof d=="number"&&Math.floor(d)!==d)return p.error("Numeric branch labels must be integer values.");if(!i)i=_t(d);else if(p.checkSubtype(i,_t(d)))return null;if(a[String(d)]!==void 0)return p.error("Branch labels must be unique.");a[String(d)]=s.length}let f=r.parse(c,u,n);if(!f)return null;n||(n=f.type),s.push(f)}let o=r.parse(e[1],1,Z);if(!o)return null;let l=r.parse(e[e.length-1],e.length-1,n);return!l||o.type.kind!=="value"&&r.concat(1).checkSubtype(i,o.type)?null:new Vp(i,n,o,a,s,l)}evaluate(e){let r=this.input.evaluate(e);return(_t(r)===this.inputType&&this.outputs[this.cases[r]]||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()}},o0=class Op{constructor(e,r,i){this.type=e,this.branches=r,this.otherwise=i}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let n=[];for(let s=1;sr.outputDefined())&&this.otherwise.outputDefined()}},l0=class eo{constructor(e,r,i,n,a){this.type=e,this.input=r,this.beginIndex=i,this.key=n,this.endIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let i=r.parse(e[1],1,Z),n=r.parse(e[2],2,I);if(!i||!n)return null;if(!gl(i.type,[Ut(Z),Y,Z]))return r.error(`Expected first argument to be of type array or string, but found ${yt(i.type)} instead`);if(e.length===4){let a=r.parse(e[3],3,I);return a?new eo(i.type,i,n,r.key,a):null}return new eo(i.type,i,n,r.key)}evaluate(e){let r=this.input.evaluate(e),i=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),dr(r,["string"]))return[...r].slice(i,n).join("");if(dr(r,["array"]))return r.slice(i,n);throw new ft(`Expected first argument to be of type array or string, but found ${yt(_t(r))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},Rp=class ro{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let i=null,n=r.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let s of e.slice(1)){let o=r.parse(s,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!o)return null;i||(i=o.type),a.push(o)}if(!i)throw Error("No output type");return n&&a.some(s=>tn(n,s.type))?new ro(Z,a):new ro(i,a)}evaluate(e){let r=null,i=0,n;for(let a of this.args)if(i++,r=a.evaluate(e),r&&r instanceof _e&&!r.available&&(n||(n=r.name),r=null,i===this.args.length&&(r=n)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function xh(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function u0(t,e,r){return e===r}function h0(t,e,r){return e!==r}function c0(t,e,r){return er}function f0(t,e,r){return e<=r}function d0(t,e,r){return e>=r}function $p(t,e,r,i){return i.compare(e,r)===0}function y0(t,e,r,i){return!$p(t,e,r,i)}function m0(t,e,r,i){return i.compare(e,r)<0}function g0(t,e,r,i){return i.compare(e,r)>0}function x0(t,e,r,i){return i.compare(e,r)<=0}function v0(t,e,r,i){return i.compare(e,r)>=0}function li(t,e,r){let i=t!=="=="&&t!=="!=";return class Np{constructor(a,s,o,l){this.lhs=a,this.rhs=s,this.key=o,this.collator=l,this.type=tt,this.hasUntypedArgument=a.type.kind==="value"||s.type.kind==="value"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error("Expected two or three arguments.");let o=a[0],l=s.parse(a[1],1,Z);if(!l)return null;if(!xh(o,l.type))return s.concat(1).error(`"${o}" comparisons are not supported for type \'${yt(l.type)}\'.`);let u=s.parse(a[2],2,Z);if(!u)return null;if(!xh(o,u.type))return s.concat(2).error(`"${o}" comparisons are not supported for type \'${yt(u.type)}\'.`);if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error(`Cannot compare types \'${yt(l.type)}\' and \'${yt(u.type)}\'.`);i&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Ie(u.type,[l],s.key):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Ie(l.type,[u],s.key)));let h=null;if(a.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(h=s.parse(a[3],3,Pa),!h)return null}return new Np(l,u,s.key,h)}evaluate(a){let s=this.lhs.evaluate(a),o=this.rhs.evaluate(a);if(i&&this.hasUntypedArgument){let l=_t(s),u=_t(o);if(l.kind!==u.kind||l.kind!=="string"&&l.kind!=="number")throw new ft(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${u.kind}) instead.`,this.key)}if(this.collator&&!i&&this.hasUntypedArgument){let l=_t(s),u=_t(o);if(l.kind!=="string"||u.kind!=="string")return e(a,s,o)}return this.collator?r(a,s,o,this.collator.evaluate(a)):e(a,s,o)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}}}var b0=li("==",u0,$p),w0=li("!=",h0,y0),D0=li("<",c0,m0),_0=li(">",p0,g0),A0=li("<=",f0,x0),S0=li(">=",d0,v0),Up=class qp{constructor(e,r,i){this.type=Pa,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let i=e[1];if(typeof i!="object"||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(i["case-sensitive"]!==void 0&&i["case-sensitive"],1,tt);if(!n)return null;let a=r.parse(i["diacritic-sensitive"]!==void 0&&i["diacritic-sensitive"],1,tt);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,Y),!s)?null:new qp(n,a,s)}evaluate(e){return new xl(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},E0=class jp{constructor(e,r,i,n,a,s){this.type=Y,this.number=e,this.locale=r,this.currency=i,this.unit=n,this.minFractionDigits=a,this.maxFractionDigits=s}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let i=r.parse(e[1],1,I);if(!i)return null;let n=e[2];if(typeof n!="object"||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,Y),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,Y),!s))return null;let o=null;if(n.unit&&(o=r.parse(n.unit,1,Y),!o))return null;if(s&&o)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(n["min-fraction-digits"]&&(l=r.parse(n["min-fraction-digits"],1,I),!l))return null;let u=null;return n["max-fraction-digits"]&&(u=r.parse(n["max-fraction-digits"],1,I),!u)?null:new jp(i,a,s,o,l,u)}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}},F0=class Gp{constructor(e){this.type=mn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let i=r.parse(e[1],1,Y);return i?new Gp(i):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),i=_e.fromString(r);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(r)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},k0=class Xp{constructor(e,r){this.input=e,this.key=r,this.type=I}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=r.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${yt(i.type)} instead.`):new Xp(i,r.key):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new ft(`Expected value to be of type string or array, but found ${yt(_t(r))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}},we=8192;function T0(t,e){let r=I0(t[0]),i=M0(t[1]),n=2**e.z;return[Math.round(r*n*we),Math.round(i*n*we)]}function bl(t,e){let r=2**e.z,i=(t[0]/we+e.x)/r,n=(t[1]/we+e.y)/r;return[C0(i),B0(n)]}function I0(t){return(180+t)/360}function C0(t){return t*360-180}function M0(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function B0(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}function gn(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function en(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function P0(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function z0(t,e,r){let i=t[0]-e[0],n=t[1]-e[1],a=t[0]-r[0],s=t[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function $a(t,e,r,i){let n=[e[0]-t[0],e[1]-t[1]];return R0([i[0]-r[0],i[1]-r[1]],n)!==0&&!!(vh(t,e,r,i)&&vh(r,i,t,e))}function L0(t,e,r){for(let i of r)for(let n=0;n0&&c<0||h<0&&c>0}function wl(t,e,r){let i=[];for(let n=0;nr[2]){let n=i*.5,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;a===0&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a}gn(e,t)}function $0(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}function bh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t)for(let l of o){let u=[l.x+a[0],l.y+a[1]];Zp(u,e,r,n),s.push(u)}return s}function wh(t,e,r,i){let n=2**i.z*we,a=[i.x*we,i.y*we],s=[];for(let o of t){let l=[];for(let u of o){let h=[u.x+a[0],u.y+a[1]];gn(e,h),l.push(h)}s.push(l)}if(e[2]-e[0]<=n/2){$0(e);for(let o of s)for(let l of o)Zp(l,e,r,n)}return s}function N0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=wl(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!ui(o,a))return!1}if(e.type==="MultiPolygon"){let a=Wp(e.coordinates,i,n),s=bh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!V0(o,a))return!1}return!0}function U0(t,e){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if(e.type==="Polygon"){let a=wl(e.coordinates,i,n),s=wh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!Yp(o,a))return!1}if(e.type==="MultiPolygon"){let a=Wp(e.coordinates,i,n),s=wh(t.geometry(),r,i,n);if(!en(r,i))return!1;for(let o of s)if(!O0(o,a))return!1}return!0}var Dl=class ha{constructor(e,r){this.type=tt,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'within\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type==="FeatureCollection"){let n=[];for(let a of i.features){let{type:s,coordinates:o}=a.geometry;s==="Polygon"&&n.push(o),s==="MultiPolygon"&&n.push(...o)}if(n.length)return new ha(i,{type:"MultiPolygon",coordinates:n})}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new ha(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new ha(i,i)}return r.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return N0(e,this.geometries);if(e.geometryType()==="LineString")return U0(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Hp=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}},Dh=Math.PI/180,_l=class{constructor(t){let e=Dh*6378.137*1e3,r=Math.cos(t*Dh),i=1/(1-.0066943799901413165*(1-r*r)),n=Math.sqrt(i);this.kx=e*n*r,this.ky=e*n*i*.9933056200098587}distance(t,e){let r=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(t,e){let r=1/0,i,n,a,s;for(let o=0;o1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-u)*this.ky;let f=h*h+c*c;f180;)t-=360;return t}};function Kp(t,e){return e[0]-t[0]}function ga(t){return t[1]-t[0]+1}function Le(t,e){return t[1]>=t[0]&&t[1]t[1])return[null,null];let r=ga(t);if(e){if(r===2)return[t,null];let n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(r===1)return[t,null];let i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function no(t,e){if(!Le(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)gn(r,t[i]);return r}function ao(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let i of r)gn(e,i);return e}function _h(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Al(t,e,r){if(!_h(t)||!_h(e))return NaN;let i=0,n=0;return t[2]e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]=i)return i;if(en(n,a)){if(Ah(t,e))return 0}else if(Ah(e,t))return 0;let s=1/0;for(let o of t)for(let l=0,u=o.length,h=u-1;l0;){let l=s.pop();if(l[0]>=a)continue;let u=l[1],h=e?50:100;if(ga(u)<=h){if(!Le(u,t.length))return NaN;if(e){let c=X0(t,u,r,i);if(isNaN(c)||c===0)return c;a=Math.min(a,c)}else for(let c=u[0];c<=u[1];++c){let p=G0(t[c],r,i);if(a=Math.min(a,p),a===0)return 0}}else{let c=io(u,e);Sh(s,a,i,t,o,c[0]),Sh(s,a,i,t,o,c[1])}}return a}function va(t,e,r,i,n,a=1/0){let s=Math.min(a,n.distance(t[0],r[0]));if(s===0)return s;let o=new Hp([[0,[0,t.length-1],[0,r.length-1]]],Kp);for(;o.length>0;){let l=o.pop();if(l[0]>=s)continue;let u=l[1],h=l[2],c=e?50:100,p=i?50:100;if(ga(u)<=c&&ga(h)<=p){if(!Le(u,t.length)&&Le(h,r.length))return NaN;let f;if(e&&i)f=q0(t,u,r,h,n),s=Math.min(s,f);else if(e&&!i){let d=t.slice(u[0],u[1]+1);for(let y=h[0];y<=h[1];++y)if(f=hr(r[y],d,n),s=Math.min(s,f),s===0)return s}else if(!e&&i){let d=r.slice(h[0],h[1]+1);for(let y=u[0];y<=u[1];++y)if(f=hr(t[y],d,n),s=Math.min(s,f),s===0)return s}else f=j0(t,u,r,h,n),s=Math.min(s,f)}else{let f=io(u,e),d=io(h,i);Gn(o,s,n,t,r,f[0],d[0]),Gn(o,s,n,t,r,f[0],d[1]),Gn(o,s,n,t,r,f[1],d[0]),Gn(o,s,n,t,r,f[1],d[1])}}return s}function W0(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,va(i,!1,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,va(i,!1,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,xa(i,!1,s.coordinates,n,a))}if(a===0)return a}return a}function Z0(t,e){let r=t.geometry(),i=r.flat().map(s=>bl([s.x,s.y],t.canonical));if(r.length===0)return NaN;let n=new _l(i[0][1]),a=1/0;for(let s of e){switch(s.type){case"Point":a=Math.min(a,va(i,!0,[s.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,va(i,!0,s.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,xa(i,!0,s.coordinates,n,a))}if(a===0)return a}return a}function H0(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let i=Ra(r,0).map(s=>s.map(o=>o.map(l=>bl([l.x,l.y],t.canonical)))),n=new _l(i[0][0][0][1]),a=1/0;for(let s of e)for(let o of i){switch(s.type){case"Point":a=Math.min(a,xa([s.coordinates],!1,o,n,a));break;case"LineString":a=Math.min(a,xa(s.coordinates,!0,o,n,a));break;case"Polygon":a=Math.min(a,Y0(o,s.coordinates,n,a))}if(a===0)return a}return a}function Ls(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}var El=class ca{constructor(e,r){this.type=I,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`\'distance\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ei(e[1])){let i=e[1];if(i.type==="FeatureCollection")return new ca(i,i.features.map(n=>Ls(n.geometry)).flat());if(i.type==="Feature")return new ca(i,Ls(i.geometry));if("type"in i&&"coordinates"in i)return new ca(i,Ls(i))}return r.error("\'distance\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return W0(e,this.geometries);if(e.geometryType()==="LineString")return Z0(e,this.geometries);if(e.geometryType()==="Polygon")return H0(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},K0=class Jp{constructor(e){let r=null;for(let i of e)if(!r)r=i.type;else{if(r===i.type)continue;r=Z;break}this.type=Ut(r!=null?r:Z,e.length),this.arr=e}static parse(e,r){if(e.length!==2)return r.error(`\'semiliteral\' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ei(e[1]))return r.error(`invalid value of type "${typeof e[1]}"`);let i=e[1],n=_t(i);if(n.kind==="array"){let a=i.map(s=>r.parse(s,null,Z));return new Jp(a)}return new ri(n,i)}evaluate(e){return this.arr.map(r=>r.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},Fl=class Qp{constructor(e){this.key=e,this.type=Z}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let i=e[1];return i==null?r.error("Global state property must be defined."):typeof i=="string"?new Qp(i):r.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){var i,n;let r=(i=e.globals)==null?void 0:i.globalState;return!r||Object.keys(r).length===0?null:(n=ji(r,this.key))!=null?n:null}eachChild(){}outputDefined(){return!1}},Yr={"==":b0,"!=":w0,">":_0,"<":D0,">=":S0,"<=":A0,array:Ie,at:i0,boolean:Ie,case:o0,coalesce:Rp,collator:Up,format:Ep,image:F0,in:n0,"index-of":a0,interpolate:be,"interpolate-hcl":be,"interpolate-lab":be,length:k0,let:Cp,literal:ri,match:s0,number:Ie,"number-format":E0,object:Ie,semiliteral:K0,slice:l0,step:vl,string:Ie,"to-boolean":jr,"to-color":jr,"to-number":jr,"to-string":jr,var:Bp,within:Dl,distance:El,"global-state":Fl},ve=class extends Error{constructor(t,e){super(e),this.message=e,this.key=t}},J0=class tf{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[i,n]of r)this.bindings[i]=n}concat(e){return new tf(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},ef=class rf{constructor(e,r,i=[],n,a=new J0,s=[]){this.registry=e,this.path=i,this.key=i.map(o=>`[${o}]`).join(""),this.scope=a,this.errors=s,this.expectedType=n,this._isConstant=r}parse(e,r,i,n,a={}){return r?this.concat(r,i,n)._parse(e,a):this._parse(e,a)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);let i=this.key;function n(a,s,o){return o==="assert"?new Ie(s,[a],i):o==="coerce"?new jr(s,[a],i):a}if(Array.isArray(e)){if(e.length===0)return this.error(\'Expected an array with at least one element. If you wanted a literal array, use ["literal", []].\');let a=e[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let s=this.registry[a];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){let l=this.expectedType,u=o.type;if((l.kind==="string"||l.kind==="number"||l.kind==="boolean"||l.kind==="object"||l.kind==="array")&&u.kind==="value")o=n(o,l,r.typeAnnotation||"assert");else if(l.kind==="projectionDefinition"&&["string","array","value"].includes(u.kind)||["color","formatted","resolvedImage"].includes(l.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(l.kind)&&["value","number","array"].includes(u.kind)||l.kind==="colorArray"&&["value","string","array"].includes(u.kind)||l.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))o=n(o,l,r.typeAnnotation||"coerce");else if(this.checkSubtype(l,u))return null}if(!(o instanceof ri)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let l=new Ap;try{o=new ri(o.type,o.evaluate(l))}catch(u){return this.error(u.message),null}}return o}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return e===void 0?this.error("\'undefined\' value invalid. Use null instead."):typeof e=="object"?this.error(\'Bare objects invalid. Use ["literal", {...}] instead.\'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,i){let n=typeof e=="number"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new rf(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...r){let i=`${this.key}${r.map(n=>`[${n}]`).join("")}`;this.errors.push(new ve(i,e))}checkSubtype(e,r){let i=tn(e,r);return i&&this.error(i),i}},_r=class Ri{constructor(e,r,i,n,a){this.name=e,this.type=r,this._evaluate=i,this.args=n,this.key=a}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let i=e[0],n=Ri.definitions[i];if(!n)return r.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter(([u])=>!Array.isArray(u)||u.length===e.length-1),l=null;for(let[u,h]of o){l=new ef(r.registry,ba,r.path,null,r.scope);let c=[],p=!1;for(let f=1;ftm(c)).join(" | "),h=[];for(let c=1;c>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}function sr(t){return{type:t}}_r.register(Yr,{error:[R1,[Y],(t,[e],r)=>{throw new ft(e.evaluate(t),r)}],typeof:[Y,[Z],(t,[e])=>yt(_t(e.evaluate(t)))],"to-rgba":[Ut(I,4),[ce],(t,[e])=>{let[r,i,n,a]=e.evaluate(t).rgb;return[r*255,i*255,n*255,a]}],rgb:[ce,[I,I,I],Eh],rgba:[ce,[I,I,I,I],Eh],has:{type:tt,overloads:[[[Y],(t,[e])=>Fh(e.evaluate(t),t.properties())],[[Y,fr],(t,[e,r])=>Fh(e.evaluate(t),r.evaluate(t))]]},get:{type:Z,overloads:[[[Y],(t,[e])=>Vs(e.evaluate(t),t.properties())],[[Y,fr],(t,[e,r])=>Vs(e.evaluate(t),r.evaluate(t))]]},"feature-state":[Z,[Y],(t,[e])=>Vs(e.evaluate(t),t.featureState||{})],properties:[fr,[],t=>t.properties()],"geometry-type":[Y,[],t=>t.geometryType()],id:[Z,[],t=>t.id()],zoom:[I,[],t=>t.globals.zoom],"heatmap-density":[I,[],t=>t.globals.heatmapDensity||0],elevation:[I,[],t=>t.globals.elevation||0],"line-progress":[I,[],t=>t.globals.lineProgress||0],accumulated:[Z,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[I,sr(I),(t,e)=>{let r=0;for(let i of e)r+=i.evaluate(t);return r}],"*":[I,sr(I),(t,e)=>{let r=1;for(let i of e)r*=i.evaluate(t);return r}],"-":{type:I,overloads:[[[I,I],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[I],(t,[e])=>-e.evaluate(t)]]},"/":[I,[I,I],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[I,[I,I],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[I,[],()=>Math.LN2],pi:[I,[],()=>Math.PI],e:[I,[],()=>Math.E],"^":[I,[I,I],(t,[e,r])=>e.evaluate(t)**+r.evaluate(t)],sqrt:[I,[I],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[I,[I],(t,[e])=>Math.log(e.evaluate(t))],log2:[I,[I],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[I,[I],(t,[e])=>Math.sin(e.evaluate(t))],cos:[I,[I],(t,[e])=>Math.cos(e.evaluate(t))],tan:[I,[I],(t,[e])=>Math.tan(e.evaluate(t))],asin:[I,[I],(t,[e])=>Math.asin(e.evaluate(t))],acos:[I,[I],(t,[e])=>Math.acos(e.evaluate(t))],atan:[I,[I],(t,[e])=>Math.atan(e.evaluate(t))],min:[I,sr(I),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[I,sr(I),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[I,[I],(t,[e])=>Math.abs(e.evaluate(t))],round:[I,[I],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[I,[I],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[I,[I],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[tt,[Y,Z],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[tt,[Z],(t,[e])=>t.id()===e.value],"filter-type-==":[tt,[Y],(t,[e])=>t.geometryType()===e.value],"filter-<":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{let r=t.id(),i=e.value;return typeof r==typeof i&&r":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[tt,[Y,Z],(t,[e,r])=>{let i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[tt,[Z],(t,[e])=>{let r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[tt,[Z],(t,[e])=>{let r=e.value,i=t.properties();return r in i&&i[r]!==void 0}],"filter-has-id":[tt,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[tt,[Ut(Y)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[tt,[Ut(Z)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[tt,[Y,Ut(Z)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[tt,[Y,Ut(Z)],(t,[e,r])=>Q0(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[sr(tt),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:tt,overloads:[[[tt,tt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[sr(tt),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[tt,[tt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[tt,[Y],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[Y,[Y],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Y,[Y],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Y,sr(Z),(t,e)=>e.map(r=>Gi(r.evaluate(t))).join("")],split:[Ut(Y),[Y,Y],(t,[e,r])=>e.evaluate(t).split(r.evaluate(t))],join:[Y,[Ut(Y),Y],(t,[e,r])=>e.evaluate(t).join(r.evaluate(t))],"resolved-locale":[Y,[Pa],(t,[e])=>e.evaluate(t).resolvedLocale()]});function tm(t){return Array.isArray(t)?`(${t.map(yt).join(", ")})`:`(${yt(t.type)}...)`}function ba(t){if(t instanceof Bp)return ba(t.boundExpression);if(t instanceof _r&&t.name==="error"||t instanceof Up||t instanceof Dl||t instanceof El||t instanceof Fl)return!1;let e=t instanceof jr||t instanceof Ie,r=!0;return t.eachChild(i=>{r&&(r=e?ba(i):i instanceof ri)}),r?Na(t)&&Ua(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function Na(t){if(t instanceof _r&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof Dl||t instanceof El)return!1;let e=!0;return t.eachChild(r=>{e&&!Na(r)&&(e=!1)}),e}function rn(t){if(t instanceof _r&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!rn(r)&&(e=!1)}),e}function Ua(t,e){if(t instanceof _r&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(i=>{r&&!Ua(i,e)&&(r=!1)}),r}function ii(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function nf(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function kl(t){return!!t.expression&&t.expression.interpolated}var Tl=/^(.*)-transition$/;function nn(t,...e){for(let r of e)for(let i in r)t[i]=r[i];return t}function Q(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function qa(t){return typeof t=="object"&&!!t&&!Array.isArray(t)&&_t(t)===fr}function em(t){return t}function rm(t){switch(t.type){case"color":return gt.parse;case"padding":return Ae.parse;case"numberArray":return Se.parse;case"colorArray":return oe.parse;default:return null}}function im(t){switch(t){case"exponential":return sf;case"interval":return am;case"categorical":return nm;case"identity":return sm;default:throw Error(`Unknown function type "${t}"`)}}function af(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",i=r||t.property!==void 0,n=r||!i,a=t.type||(kl(e)?"exponential":"interval"),s=rm(e);if(s&&(t=nn({},t),t.stops&&(t.stops=t.stops.map(h=>[h[0],s(h[1])])),t.default?t.default=s(t.default):t.default=s(e.default)),t.colorSpace&&!Z1(t.colorSpace))throw Error(`Unknown color space: "${t.colorSpace}"`);let o=im(a),l,u;if(a==="categorical"){l=Object.create(null);for(let h of t.stops)l[h[0]]=h[1];u=typeof t.stops[0][0]}if(r){let h={},c=[];for(let d=0;dd[0]),evaluate({zoom:d},y){return sf({stops:p,base:t.base},e,d).evaluate(d,y)}}}if(n){let h=a==="exponential"?{name:"exponential",base:t.base===void 0?1:t.base}:null;return{kind:"camera",interpolationType:h,interpolationFactor:be.interpolationFactor.bind(void 0,h),zoomStops:t.stops.map(c=>c[0]),evaluate:({zoom:c})=>o(t,e,c,l,u)}}return{kind:"source",evaluate(h,c){let p=c&&c.properties?c.properties[t.property]:void 0;return p===void 0?xn(t.default,e.default):o(t,e,p,l,u)}}}function xn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}function nm(t,e,r,i,n){return xn(typeof r===n?i[r]:void 0,t.default,e.default)}function am(t,e,r){if(Q(r)!=="number")return xn(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let n=Oa(t.stops.map(a=>a[0]),r,"");return t.stops[n][1]}function sf(t,e,r){let i=t.base===void 0?1:t.base;if(Q(r)!=="number")return xn(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let a=Oa(t.stops.map(h=>h[0]),r,""),s=om(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],l=t.stops[a+1][1],u=gr[e.type]||em;return typeof o.evaluate=="function"?{evaluate(...h){let c=o.evaluate.apply(void 0,h),p=l.evaluate.apply(void 0,h);if(c!==void 0&&p!==void 0)return u(c,p,s,t.colorSpace)}}:u(o,l,s,t.colorSpace)}function sm(t,e,r){switch(e.type){case"color":r=gt.parse(r);break;case"formatted":r=ze.fromString(r.toString());break;case"resolvedImage":r=_e.fromString(r.toString());break;case"padding":r=Ae.parse(r);break;case"colorArray":r=oe.parse(r);break;case"numberArray":r=Se.parse(r);break;default:Q(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return xn(r,t.default,e.default)}function om(t,e,r,i){let n=i-r,a=t-r;return n===0?0:e===1?a/n:(e**+a-1)/(e**+n-1)}function so(t){return{result:"success",value:t}}function Nr(t){return{result:"error",value:t}}var Il=class{constructor(t,e,r,i){this.expression=t,this._warningHistory={},this._evaluator=new Ap,this._defaultValue=r?pf(r):null,this._enumValues=r&&r.type==="enum"?r.values:null,this._globalState=i,this._rootKey=e}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,a){this._globalState&&(t=ni(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ft(`Expected value to be one of ${Object.keys(this._enumValues).map(o=>JSON.stringify(o)).join(", ")}, but found ${JSON.stringify(s)} instead.`,"");return s}catch(s){let o=s instanceof ft?s.path:"",l=`${o}|${s.message}`;return this._warningHistory[l]||(this._warningHistory[l]=!0,typeof console<"u"&&console.warn(of(this._rootKey,o,s.message,this._defaultValue))),this._defaultValue}}};function of(t,e,r,i){return`${t}${e}: ${r}${i==null?"":` Falling back to ${String(i)}.`}`}function lf(t){if(!t)throw Error(\'rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".\')}function ja(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Yr}function er(t,e,r,i){lf(e);let n=new ef(Yr,ba,[],r?hm(r):void 0),a=n.parse(t,void 0,void 0,void 0,r&&r.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?so(new Il(a,e,r,i)):Nr(n.errors)}var an=class{constructor(t,e,r){this.kind=t,this._styleExpression=e,this.isStateDependent=t!=="constant"&&!rn(e.expression),this.globalStateRefs=vn(e.expression),this._globalState=r}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}},wa=class{constructor(t,e,r,i,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent=t!=="camera"&&!rn(e.expression),this.globalStateRefs=vn(e.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)}evaluate(t,e,r,i,n,a){return this._globalState&&(t=ni(t,this._globalState)),this._styleExpression.evaluate(t,e,r,i,n,a)}interpolationFactor(t,e,r){return this.interpolationType?be.interpolationFactor(this.interpolationType,t,e,r):0}};function lm(t){return t._styleExpression!==void 0}function uf(t,e,r,i){let n=er(t,e,r,i);if(n.result==="error")return n;let a=n.value.expression,s=Na(a);if(!s&&!ii(r))return Nr([new ve("","data expressions not supported")]);let o=Ua(a,["zoom"]);if(!o&&!nf(r))return Nr([new ve("","zoom expressions not supported")]);let l=pa(a);if(!l&&!o)return Nr([new ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(l instanceof ve)return Nr([l]);if(l instanceof be&&!kl(r))return Nr([new ve("",\'"interpolate" expressions cannot be used with this property\')]);if(!l)return so(s?new an("constant",n.value,i):new an("source",n.value,i));let u=l instanceof be?l.interpolation:void 0;return so(s?new wa("camera",n.value,l.labels,u,i):new wa("composite",n.value,l.labels,u,i))}var hf=class cf{constructor(e,r,i){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,lf(r),this._parameters=e,this._specification=i,this._rootKey=r,this._defaultValue=pf(i),this._warningHistory={};let n=af(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,r){try{return this._innerEvaluate(e,r)}catch(i){let n=i instanceof Error?i.message:String(i),a=`|${n}`;return this._warningHistory[a]||(this._warningHistory[a]=!0,typeof console<"u"&&console.warn(of(this._rootKey,"",n,this._defaultValue))),this._defaultValue}}static deserialize(e){return new cf(e._parameters,e._rootKey,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};function um(t,e,r,i){if(qa(t))return new hf(t,e,r);if(ja(t)){let n=uf(t,e,r,i);if(n.result==="error")throw Error(n.value.map(a=>`${a.key}: ${a.message}`).join(", "));return n.value}{let n=t;return r.type==="color"&&typeof t=="string"?n=gt.parse(t):r.type==="padding"&&(typeof t=="number"||Array.isArray(t))?n=Ae.parse(t):r.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?n=Se.parse(t):r.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?n=oe.parse(t):r.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?n=De.parse(t):r.type==="projectionDefinition"&&typeof t=="string"&&(n=Dr.parse(t)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>n}}}function pa(t){let e=null;if(t instanceof Cp)e=pa(t.result);else if(t instanceof Rp){for(let r of t.args)if(e=pa(r),e)break}else(t instanceof vl||t instanceof be)&&t.input instanceof _r&&t.input.name==="zoom"&&(e=t);return e instanceof ve||t.eachChild(r=>{let i=pa(r);i instanceof ve?e=i:!e&&i?e=new ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):e&&i&&e!==i&&(e=new ve("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),e}function vn(t,e=new Set){return t instanceof Fl&&e.add(t.key),t.eachChild(r=>{vn(r,e)}),e}function hm(t){let e={color:ce,string:Y,number:I,enum:Y,boolean:tt,formatted:yn,padding:za,numberArray:La,colorArray:Qi,projectionDefinition:Ba,resolvedImage:mn,variableAnchorOffsetCollection:Va};return t.type==="array"?Ut(e[t.value]||Z,t.length):e[t.type]}function pf(t){if(t.type==="color"&&qa(t.default))return new gt(0,0,0,0);switch(t.type){case"color":return gt.parse(t.default)||null;case"padding":return Ae.parse(t.default)||null;case"numberArray":return Se.parse(t.default)||null;case"colorArray":return oe.parse(t.default)||null;case"variableAnchorOffsetCollection":return De.parse(t.default)||null;case"projectionDefinition":return Dr.parse(t.default)||null;default:return t.default===void 0?null:t.default}}function ni(t,e){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=t!=null?t:{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:e}}function cm(t){let e=!1;for(let r of t){let i=ff(r);if(i==="expression")return"expression";i==="legacy"&&(e=!0)}return e?"legacy":"neutral"}function ff(t){if(typeof t=="boolean")return"neutral";if(!Array.isArray(t)||t.length===0)return"legacy";switch(t[0]){case"has":return t.length<2||t[1]==="$id"||t[1]==="$type"?"legacy":t.length===2?"neutral":"expression";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"none":return"legacy";case"any":case"all":return cm(t.slice(1));default:return"expression"}}function Cl(t){return ff(t)!=="legacy"}function kh(t){return t==="$type"?["geometry-type"]:t==="$id"?["id"]:["get",t]}function pm(t){switch(t[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return t.length!==3||typeof t[1]!="string"?null:[t[0],kh(t[1]),t[2]];case"in":case"!in":{if(t.length<2||typeof t[1]!="string")return null;let e=["in",kh(t[1]),["literal",t.slice(2)]];return t[0]==="!in"?["!",e]:e}case"has":case"!has":{if(t.length!==2||typeof t[1]!="string"||t[1]==="$type"||t[1]==="$id")return null;let e=["has",t[1]];return t[0]==="!has"?["!",e]:e}default:return null}}function df(t){if((t[0]==="<"||t[0]==="<="||t[0]===">"||t[0]===">=")&&t[1]==="$type")return`"$type" cannot be use with operator "${t[0]}"`;let e=pm(t);return e?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(t)} with ${JSON.stringify(e)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(t)} to expression syntax.`}function Os(t,e,r){let i=r[t];return Array.isArray(i)?Cl(i)?Ml(i,e.concat(t)):{path:e.concat(t),legacyFilter:i}:null}function Ml(t,e=[]){if(!Array.isArray(t)||t.length<1)return null;switch(t[0]){case"all":case"any":case"none":for(let r=1;r"u")return;let i=r.path.map(n=>`[${n}]`).join("");console.warn(`${e}${i}: ${df(r.legacyFilter)}`)}var dm={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ai(t,e,r){if(t==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Cl(t)?fm(t,e):t=Da(t);let i=er(t,e,dm,r);if(i.result==="error")throw Error(i.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,a,s)=>i.value.evaluate(n,a,{},s),needGeometry:yf(t),getGlobalStateRefs:()=>vn(i.value.expression)}}function ym(t,e){return te)}function yf(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e"||e==="<="||e===">="?Rs(t[1],t[2],e):e==="any"?mm(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(Da)):e==="none"?["all"].concat(t.slice(1).map(Da).map(Xn)):e==="in"?Th(t[1],t.slice(2)):e==="!in"?Xn(Th(t[1],t.slice(2))):e==="has"?Ih(t[1]):e!=="!has"||Xn(Ih(t[1]))}function Rs(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function mm(t){return["any"].concat(t.map(Da))}function Th(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(ym)]]:["filter-in-small",t,["literal",e]]}}function Ih(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Xn(t){return["!",t]}function mf(t){let e=t.key,r=t.value;return r?[new E(e,r,"constants have been deprecated as of v8")]:[]}function Dt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function xr(t){if(Array.isArray(t))return t.map(xr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=xr(t[r]);return e}return Dt(t)}function te(t){let e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=t.validateSpec,l=[],u=Q(r);if(u!=="object")return[new E(e,r,`object expected, ${u} found`)];for(let h in r){let c=h.split(".")[0],p=ji(i,c)||i["*"],f;if(ji(n,c))f=n[c];else if(ji(i,c)){if(r[h]===void 0)continue;f=o}else if(n["*"])f=n["*"];else if(i["*"])f=o;else{l.push(new E(e,r[h],`unknown property "${h}"`));continue}l=l.concat(f({key:(e&&`${e}.`)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h,validateSpec:o},r))}for(let h in i)n[h]||i[h].required&&i[h].default===void 0&&r[h]===void 0&&l.push(new E(e,r,`missing required property "${h}"`));return l}function Bl(t){let e=t.value,r=t.valueSpec,i=t.validateSpec,n=t.style,a=t.styleSpec,s=t.key,o=t.arrayElementValidator||i;if(Q(e)!=="array")return[new E(s,e,`array expected, ${Q(e)} found`)];if(r.length&&e.length!==r.length)return[new E(s,e,`array length ${r.length} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),Q(r.value)==="object"&&(l=r.value);let u=[];for(let h=0;hi.maximum?[new E(e,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]:[new E(e,r,`number expected, ${n} found`)]}function gf(t){let e=t.valueSpec,r=Dt(t.value.type),i,n={},a,s,o=r!=="categorical"&&t.value.property===void 0,l=!o,u=Q(t.value.stops)==="array"&&Q(t.value.stops[0])==="array"&&Q(t.value.stops[0][0])==="object",h=te({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:c,default:d}});return r==="identity"&&o&&h.push(new E(t.key,t.value,\'missing required property "property"\')),r!=="identity"&&!t.value.stops&&h.push(new E(t.key,t.value,\'missing required property "stops"\')),r==="exponential"&&t.valueSpec.expression&&!kl(t.valueSpec)&&h.push(new E(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!ii(t.valueSpec)?h.push(new E(t.key,t.value,"property functions not supported")):o&&!nf(t.valueSpec)&&h.push(new E(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||u)&&t.value.property===void 0&&h.push(new E(t.key,t.value,\'"property" property is required\')),h;function c(y){if(r==="identity")return[new E(y.key,y.value,\'identity function may not have a "stops" property\')];let m=[],g=y.value;return m=m.concat(Bl({key:y.key,value:g,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:p})),Q(g)==="array"&&g.length===0&&m.push(new E(y.key,g,"array must have at least one stop")),m}function p(y){let m=[],g=y.value,x=y.key;if(Q(g)!=="array")return[new E(x,g,`array expected, ${Q(g)} found`)];if(g.length!==2)return[new E(x,g,`array length 2 expected, length ${g.length} found`)];if(u){if(Q(g[0])!=="object")return[new E(x,g,`object expected, ${Q(g[0])} found`)];if(g[0].zoom===void 0)return[new E(x,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new E(x,g,"object stop key must have value")];if(s&&s>Dt(g[0].zoom))return[new E(x,g[0].zoom,"stop zoom values must appear in ascending order")];Dt(g[0].zoom)!==s&&(s=Dt(g[0].zoom),a=void 0,n={}),m=m.concat(te({key:`${x}[0]`,value:g[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:Ga,value:f}}))}else m=m.concat(f({key:`${x}[0]`,value:g[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},g));return ja(xr(g[1]))?m.concat([new E(`${x}[1]`,g[1],"expressions are not allowed in function stops.")]):m.concat(y.validateSpec({key:`${x}[1]`,value:g[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}function f(y,m){let g=Q(y.value),x=Dt(y.value),v=y.value===null?m:y.value;if(!i)i=g;else if(g!==i)return[new E(y.key,v,`${g} stop domain type must match previous stop domain type ${i}`)];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new E(y.key,v,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let b=`number expected, ${g} found`;return ii(e)&&r===void 0&&(b+=\'\\nIf you intended to use a categorical function, specify `"type": "categorical"`.\'),[new E(y.key,v,b)]}return r==="categorical"&&g==="number"&&(!isFinite(x)||Math.floor(x)!==x)?[new E(y.key,v,`integer expected, found ${x}`)]:r!=="categorical"&&g==="number"&&a!==void 0&&xnew E(`${t.key}${i.key}`,t.value,i.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new E(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!rn(r))return[new E(t.key,t.value,\'"feature-state" data expressions are not supported with layout properties.\')];if(t.expressionContext==="filter"&&!rn(r))return[new E(t.key,t.value,\'"feature-state" data expressions are not supported with filters.\')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Ua(r,["zoom","feature-state"]))return[new E(t.key,t.value,\'"zoom" and "feature-state" expressions are not supported with cluster properties.\')];if(t.expressionContext==="cluster-initial"&&!Na(r))return[new E(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function gm(t){let e=t.value,r=t.key,i=Q(e);return i==="boolean"?[]:[new E(r,e,`boolean expected, ${i} found`)]}function oo(t){let e=t.key,r=t.value,i=Q(r);return i==="string"?gt.parse(String(r))?[]:[new E(e,r,`color expected, "${r}" found`)]:[new E(e,r,`color expected, ${i} found`)]}function sn(t){let e=t.key,r=t.value,i=t.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Dt(r))===-1&&n.push(new E(e,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(i.values).indexOf(Dt(r))===-1&&n.push(new E(e,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function xm(t,e){let r=t;for(let i of e)r=r[i];return r}function vm(t,e){let r=Ml(e);return r?[new E(`${t.key}${r.path.map(i=>`[${i}]`).join("")}`,xm(t.value,r.path),df(r.legacyFilter),null,"warning")]:[]}function Pl(t){let e=xr(t.value);return Cl(e)?[...vm(t,e),...si(nn({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:xf(t)}function xf(t){let e=t.value,r=t.key;if(Q(e)!=="array")return[new E(r,e,`array expected, ${Q(e)} found`)];let i=t.styleSpec,n,a=[];if(e.length<1)return[new E(r,e,"filter array must have at least 1 element")];switch(a=a.concat(sn({key:`${r}[0]`,value:e[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),Dt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Dt(e[1])==="$type"&&a.push(new E(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&a.push(new E(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=Q(e[1]),n!=="string"&&a.push(new E(`${r}[1]`,e[1],`string expected, ${n} found`)));for(let s=2;s{c in r&&e.push(new E(i,r[c],`"${c}" is prohibited for ref layers`))});let h;n.layers.forEach(c=>{Dt(c.id)===o&&(h=c)}),h?h.ref?e.push(new E(i,r.ref,"ref cannot reference another ref layer")):s=Dt(h.type):e.push(new E(i,r.ref,`ref layer "${o}" not found`))}else if(s!=="background")if(!r.source)e.push(new E(i,r,\'missing required property "source"\'));else{let h=n.sources&&n.sources[r.source],c=h&&Dt(h.type);h?c==="vector"&&s==="raster"?e.push(new E(i,r.source,`layer "${r.id}" requires a raster source`)):c!=="raster-dem"&&s==="hillshade"||c!=="raster-dem"&&s==="color-relief"?e.push(new E(i,r.source,`layer "${r.id}" requires a raster-dem source`)):c==="raster"&&s!=="raster"?e.push(new E(i,r.source,`layer "${r.id}" requires a vector source`)):c==="vector"&&!r["source-layer"]?e.push(new E(i,r,`layer "${r.id}" must specify a "source-layer"`)):c==="raster-dem"&&s!=="hillshade"&&s!=="color-relief"?e.push(new E(i,r.source,"raster-dem source can only be used with layer type \'hillshade\' or \'color-relief\'.")):s==="line"&&r.paint&&r.paint["line-gradient"]&&(c!=="geojson"||!h.lineMetrics)&&e.push(new E(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):e.push(new E(i,r.source,`source "${r.source}" not found`))}return s==="raster"&&((l=r.paint)!=null&&l.resampling)&&((u=r.paint)!=null&&u["raster-resampling"])&&e.push(new E(i,r.paint,`layer "${r.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),e=e.concat(te({key:i,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Pl,layout(h){return te({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{"*"(c){return wf(nn({layerType:s},c))}}})},paint(h){return te({layer:r,key:h.key,value:h.value,style:h.style,styleSpec:h.styleSpec,validateSpec:h.validateSpec,objectElementValidators:{"*"(c){return bf(nn({layerType:s},c))}}})}}})),e}function tr(t){let e=t.value,r=t.key,i=Q(e);return i==="string"?[]:[new E(r,e,`string expected, ${i} found`)]}function bm(t){var c;let e=(c=t.sourceName)!=null?c:"",r=t.value,i=t.styleSpec,n=i.source_raster_dem,a=t.style,s=[],o=Q(r);if(r===void 0)return s;if(o!=="object")return s.push(new E("source_raster_dem",r,`object expected, ${o} found`)),s;let l=Dt(r.encoding)==="custom",u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let p in r)!l&&u.includes(p)?s.push(new E(p,r[p],`In "${e}": "${p}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):n[p]?s=s.concat(t.validateSpec({key:p,value:r[p],valueSpec:n[p],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new E(p,r[p],`unknown property "${p}"`));return s}var Ch={promoteId:wm};function _f(t){let e=t.value,r=t.key,i=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new E(r,e,\'"type" is required\')];let s=Dt(e.type),o;switch(s){case"vector":case"raster":return o=te({key:r,value:e,valueSpec:i[`source_${s.replace("-","_")}`],style:t.style,styleSpec:i,objectElementValidators:Ch,validateSpec:a}),o;case"raster-dem":return o=bm({sourceName:r,value:e,style:t.style,styleSpec:i,validateSpec:a}),o;case"geojson":if(o=te({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Ch}),e.cluster)for(let l in e.clusterProperties){let[u,h]=e.clusterProperties[l],c=typeof u=="string"?[u,["accumulated"],["get",l]]:u;o.push(...si({key:`${r}.${l}.map`,value:h,validateSpec:a,expressionContext:"cluster-map"})),o.push(...si({key:`${r}.${l}.reduce`,value:c,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return te({key:r,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return te({key:r,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new E(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return sn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function wm({key:t,value:e}){if(Q(e)==="string")return tr({key:t,value:e});{let r=[];for(let i in e)r.push(...tr({key:`${t}.${i}`,value:e[i]}));return r}}function Af(t){let e=t.value,r=t.styleSpec,i=r.light,n=t.style,a=[],s=Q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new E("light",e,`object expected, ${s} found`)]),a;for(let o in e){let l=o.match(Tl);a=l&&i[l[1]]&&i[l[1]].transition?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,validateSpec:t.validateSpec,style:n,styleSpec:r})):i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property "${o}"`)])}return a}function Sf(t){let e=t.value,r=t.styleSpec,i=r.sky,n=t.style,a=Q(e);if(e===void 0)return[];if(a!=="object")return[new E("sky",e,`object expected, ${a} found`)];let s=[];for(let o in e){let l=o.match(Tl);s=l&&i[l[1]]&&i[l[1]].transition?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:r.transition,style:n,styleSpec:r})):i[o]?s.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],style:n,styleSpec:r})):s.concat([new E(o,e[o],`unknown property "${o}"`)])}return s}function Ef(t){let e=t.value,r=t.styleSpec,i=r.terrain,n=t.style,a=[],s=Q(e);if(e===void 0)return a;if(s!=="object")return a=a.concat([new E("terrain",e,`object expected, ${s} found`)]),a;for(let o in e)a=i[o]?a.concat(t.validateSpec({key:o,value:e[o],valueSpec:i[o],validateSpec:t.validateSpec,style:n,styleSpec:r})):a.concat([new E(o,e[o],`unknown property "${o}"`)]);return a}function Dm(t){return tr(t).length===0?[]:si(t)}function _m(t){return tr(t).length===0?[]:si(t)}function Am(t){let e=t.key,r=t.value;if(Q(r)==="array"){if(r.length<1||r.length>4)return[new E(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a[new E(t,e,\'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"\')],n=r.match(Mm);if(!n)return i();let[,a,s,o]=n;if(o!==void 0)return o.length>6?i():[];let l=parseInt(a,16),u=s===void 0?l:parseInt(s,16);return l>Mh||u>Mh?[new E(t,e,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new E(t,e,`unicode range start must not be greater than its end, but ${r} is`)]:[]}function Tf(t){var o,l;let e=(o=t.key)!=null?o:"font-faces",r=t.value,i=t.validateSpec,n=(l=t.styleSpec)!=null?l:pp,a=t.style;if(!lo(r))return[new E(e,r,`object expected, ${Q(r)} found`)];let s=[];for(let u in r){let h=r[u],c=Q(h);if(c==="string")s.push(...tr({key:`${e}.${u}`,value:h}));else if(c==="array"){let p={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[f,d]of h.entries()){let y=`${e}.${u}[${f}]`;s.push(...te({key:y,value:d,valueSpec:p,styleSpec:n,style:a,validateSpec:i}));let m=lo(d)?d["unicode-range"]:void 0;if(Q(m)==="array")for(let[g,x]of m.entries())s.push(...Bm(`${y}.unicode-range[${g}]`,x))}}else s.push(new E(`${e}.${u}`,h,`string or array expected, ${c} found`))}return s}var Bh={"*"(){return[]},array:Bl,boolean:gm,number:Ga,color:oo,constants:mf,enum:sn,filter:Pl,function:gf,layer:Df,object:te,source:_f,light:Af,sky:Sf,terrain:Ef,projection:km,projectionDefinition:Tm,string:tr,formatted:Dm,resolvedImage:_m,padding:Am,numberArray:Sm,colorArray:Em,variableAnchorOffsetCollection:Fm,sprite:Ff,state:kf,fontFaces:Tf};function Xi(t){let e=t.value,r=t.valueSpec,i=t.styleSpec;return t.validateSpec=Xi,r.expression&&qa(Dt(e))?gf(t):r.expression&&ja(xr(e))?si(t):r.type&&Bh[r.type]?Bh[r.type](t):te(nn({},t,{valueSpec:r.type?i[r.type]:r}))}function If(t){let e=t.value,r=t.key,i=tr(t);return i.length||(e.indexOf("{fontstack}")===-1&&i.push(new E(r,e,\'"glyphs" url must include a "{fontstack}" token\')),e.indexOf("{range}")===-1&&i.push(new E(r,e,\'"glyphs" url must include a "{range}" token\'))),i}function Qt(t,e=w){let r=[];return r=r.concat(Xi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Xi,objectElementValidators:{glyphs:If,"*"(){return[]}}})),t.constants&&(r=r.concat(mf({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:Xi}))),Cf(r)}Qt.source=ie(re(_f)),Qt.sprite=ie(re(Ff)),Qt.glyphs=ie(re(If)),Qt.fontFaces=ie(re(Tf)),Qt.light=ie(re(Af)),Qt.sky=ie(re(Sf)),Qt.terrain=ie(re(Ef)),Qt.state=ie(re(kf)),Qt.layer=ie(re(Df)),Qt.filter=ie(re(Pl)),Qt.paintProperty=ie(re(bf)),Qt.layoutProperty=ie(re(wf));function re(t){return function(e){return t(Object.assign({},e,{validateSpec:Xi}))}}function Cf(t){return[].concat(t).sort((e,r)=>e.line-r.line)}function ie(t){return function(...e){return Cf(t.apply(this,e))}}var Pm={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"},zm=class{constructor(t,e,r){this._rootKey=e,this._globalState=r,this.setValue(t)}evaluate(){var t;return(t=this._literalValue)!=null?t:this._compiledValue.evaluate({})}setValue(t){if(t==null||t==="visible"||t==="none"){this._literalValue=t==="none"?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let e=er(t,this._rootKey,Pm,this._globalState);if(e.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=vn(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};function Lm(t,e,r){return new zm(t,e,r)}var Ph=Qt,y5=new Set(Object.keys(w).filter(t=>t.startsWith("source_")).map(t=>t.slice(7).replaceAll("_","-")));function Vm(t,e){let r=!1;for(let i of e){if(i.severity==="warning"){Bt(i.message);continue}t.fire(new ma(Error(i.message))),r=!0}return r}function Om(t,e,r,i){return(i==null?void 0:i.validate)!==!1&&Vm(t,e(je({styleSpec:w},r)))}var uo=class Mf{constructor(e,r,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let s=new Int32Array(this.arrayBuffer);e=s[0],r=s[1],i=s[2],this.d=r+2*i;for(let u=0;u=c[f+0]&&n>=c[f+1])?(o[p]=!0,s.push(h[p])):o[p]=!1}}}_forEachCell(e,r,i,n,a,s,o,l){let u=this._convertToCellCoord(e),h=this._convertToCellCoord(r),c=this._convertToCellCoord(i),p=this._convertToCellCoord(n);for(let f=u;f<=c;f++)for(let d=h;d<=p;d++){let y=this.d*d+f;if((!l||l(this._convertFromCellCoord(f),this._convertFromCellCoord(d),this._convertFromCellCoord(f+1),this._convertFromCellCoord(d+1)))&&a.call(this,e,r,i,n,y,s,o,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,i=0;for(let s of this.cells)i+=s.length;let n=new Int32Array(r+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=r;for(let s=0;sr?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoomthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}},$m="-transition",Xa=class{constructor(t,e,r,i){this.property=t,this.value=e,this.expression=um(e===void 0?t.specification.default:e,r,t.specification,i)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}},ho=class{constructor(t,e,r){this.property=t,this.value=new Xa(t,void 0,e,r)}transitioned(t,e){return new Lh(this.property,this.value,e,Gt({},t.transition,this.transition),t.now)}untransitioned(){return new Lh(this.property,this.value,null,{},0)}},Nm=class{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=e}_propertyRootKey(t){return`${this._rootKey}.${String(t)}`}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return He(this._values[t].value.value)}setValue(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].value=new Xa(this._values[t].property,e===null?void 0:He(e),this._propertyRootKey(t),this._globalState)}getTransition(t){return He(this._values[t].transition)}setTransition(t,e){Object.hasOwn(this._values,t)||(this._values[t]=new ho(this._values[t].property,this._propertyRootKey(t),this._globalState)),this._values[t].transition=He(e)||void 0}serialize(){let t={};for(let e of Object.keys(this._values)){let r=this.getValue(e);r!==void 0&&(t[e]=r);let i=this.getTransition(e);i!==void 0&&(t[`${e}${$m}`]=i)}return t}transitioned(t,e){let r=new Vh(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(t,e._values[i]);return r}untransitioned(){let t=new Vh(this._properties);for(let e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}},Lh=class{constructor(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(t,e,r){let i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),a=this.prior;if(!a)return n;if(i>this.end||this.value.isDataDriven())return this.prior=null,n;if(ii.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Lf=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){if(t.value!==void 0){if(t.expression.kind==="constant"){let n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new st(Math.floor(e.zoom-1),e)),t.expression.evaluate(new st(Math.floor(e.zoom),e)),t.expression.evaluate(new st(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}},Wa=class{constructor(t,e){this.specification=t,this.name=e}possiblyEvaluate(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)}interpolate(){return!1}},Xt=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let e in t){let r=t[e];r.specification.overridable&&this.overridableProperties.push(e);let i=this.defaultPropertyValues[e]=new Xa(r,void 0,r.name,void 0),n=this.defaultTransitionablePropertyValues[e]=new ho(r,r.name,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({})}}};C("DataDrivenProperty",N),C("DataConstantProperty",V),C("CrossFadedDataDrivenProperty",on),C("CrossFadedProperty",Lf),C("ColorRampProperty",Wa);var Rh=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",$s=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?",de=class extends O1{constructor(t,e,r){if(super(),this.id=t.id,this.type=t.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=Lm(this.visibility,`layers[${this.id}].layout.visibility`,r),t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=ai(t.filter,`layers[${this.id}].filter`,r)),e.layout&&(this._unevaluatedLayout=new Um(e.layout,`layers[${this.id}].layout`,r)),e.paint)){this._transitionablePaint=new Nm(e.paint,`layers[${this.id}].paint`,r);for(let i in t.paint)this.setPaintProperty(i,t.paint[i],{validate:!1});for(let i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ya(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=ai(t,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){var e;if(t==="visibility")return this.visibility;if((e=this._transitionablePaint)!=null&&e.hasProperty(t))throw Error(t+Rh);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){let t=new Set;for(let e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(let e in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[e];for(let i of r.getGlobalStateRefs())t.add(i)}for(let e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){var e;let t=new globalThis.Map;if(this._transitionablePaint)for(let r in this._transitionablePaint._values){let i=this._transitionablePaint._values[r].value;for(let n of i.getGlobalStateRefs()){let a=(e=t.get(n))!=null?e:[];a.push({name:r,value:i.value}),t.set(n,a)}}return t}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,r={}){var i;if(t==="visibility"){this.visibility=e,this._visibilityExpression.setValue(e),this.recalculateVisibility();return}if((i=this._transitionablePaint)!=null&&i.hasProperty(t)){this.fire(new ma(Error(t+Rh)));return}e!=null&&this._validate(Ph.layoutProperty,`layers.${this.id}.layout.${t}`,t,e,r)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){var e,r;if(t.endsWith("-transition")){let i=t.slice(0,-11);if(i==="visibility"||(e=this._unevaluatedLayout)!=null&&e.hasProperty(i))throw Error(t+$s);return this._transitionablePaint.getTransition(i)}if(t==="visibility"||(r=this._unevaluatedLayout)!=null&&r.hasProperty(t))throw Error(t+$s);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){var i;if(t==="visibility"||(i=this._unevaluatedLayout)!=null&&i.hasProperty(t))return this.fire(new ma(Error(t+$s))),!1;if(e!=null&&this._validate(Ph.paintProperty,`layers.${this.id}.paint.${t}`,t,e,r))return!1;if(t.endsWith("-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{let n=this._transitionablePaint._values[t],a=n.property.specification["property-type"]==="cross-faded-data-driven",s=n.value.isDataDriven(),o=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);let l=this._transitionablePaint._values[t].value;return l.isDataDriven()||s||a||this._handleOverridablePaintPropertyUpdate(t,o,l)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return!1}isHidden(t=this.minzoom,e=!1){return this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom)||this.maxzoom&&t>=this.maxzoom?!0:this._evaluatedVisibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){var e,r;let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(e=this._unevaluatedLayout)==null?void 0:e.serialize(),paint:(r=this._transitionablePaint)==null?void 0:r.serialize()};return this.visibility&&(t.layout||(t.layout={}),t.layout.visibility=this.visibility),T1(t,(i,n)=>i!==void 0&&!(n==="layout"&&!Object.keys(i).length)&&!(n==="paint"&&!Object.keys(i).length))}_validate(t,e,r,i,n={}){return Om(this,t,{key:e,layerType:this.type,objectKey:r,value:i},n)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let e=this.paint.get(t);if(e instanceof se&&ii(e.property.specification)&&(e.value.kind==="source"||e.value.kind==="composite")&&e.value.isStateDependent)return!0}return!1}},qm,jm=()=>qm||(qm=new Xt({"raster-opacity":new V(w.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new V(w.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new V(w.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new V(w.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new V(w.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new V(w.paint_raster["raster-contrast"],"raster-contrast"),resampling:new V(w.paint_raster.resampling,"resampling"),"raster-resampling":new V(w.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new V(w.paint_raster["raster-fade-duration"],"raster-fade-duration")})),Gm={get paint(){return jm()}};var Xm=class extends de{constructor(t,e){super(t,Gm,e)}},Ym={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},bn=class{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},xt=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*5),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function At(t,e=1){let r=0,i=0;return{members:t.map(n=>{let a=Wm(n.type),s=r=$h(r,Math.max(e,a)),o=n.components||1;return i=Math.max(i,a),r+=a*o,{name:n.name,type:n.type,components:o,offset:s}}),size:$h(r,Math.max(i,e)),alignment:e}}function Wm(t){return Ym[t].BYTES_PER_ELEMENT}function $h(t,e){return Math.ceil(t/e)*e}var ln=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.int16[i+0]=e,this.int16[i+1]=r,t}};ln.prototype.bytesPerElement=4,C("StructArrayLayout2i4",ln);var co=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t}};co.prototype.bytesPerElement=6,C("StructArrayLayout3i6",co);var Nh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t}};Nh.prototype.bytesPerElement=8,C("StructArrayLayout4i8",Nh);var po=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};po.prototype.bytesPerElement=12,C("StructArrayLayout2i4i12",po);var fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*4,l=t*8;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,t}};fo.prototype.bytesPerElement=8,C("StructArrayLayout2i4ub8",fo);var un=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.float32[i+0]=e,this.float32[i+1]=r,t}};un.prototype.bytesPerElement=8,C("StructArrayLayout2f8",un);var yo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,l,u)}emplace(t,e,r,i,n,a,s,o,l,u,h){let c=t*10;return this.uint16[c+0]=e,this.uint16[c+1]=r,this.uint16[c+2]=i,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,t}};yo.prototype.bytesPerElement=20,C("StructArrayLayout10ui20",yo);var mo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o)}emplace(t,e,r,i,n,a,s,o,l){let u=t*8;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,t}};mo.prototype.bytesPerElement=16,C("StructArrayLayout8ui16",mo);var go=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,i,n,a,s,o,l,u,h,c,p)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f){let d=t*14,y=t*7;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[y+6]=f,t}};go.prototype.bytesPerElement=28,C("StructArrayLayout4i4ui4i1f28",go);var xo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t}};xo.prototype.bytesPerElement=12,C("StructArrayLayout3f12",xo);var vo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint32[r+0]=e,t}};vo.prototype.bytesPerElement=4,C("StructArrayLayout1ul4",vo);var bo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,i,n,a,s,o,l)}emplace(t,e,r,i,n,a,s,o,l,u){let h=t*10,c=t*5;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=i,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[c+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,t}};bo.prototype.bytesPerElement=20,C("StructArrayLayout6i1ul2ui20",bo);var wo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*6;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t}};wo.prototype.bytesPerElement=12,C("StructArrayLayout2i2i2i12",wo);var Uh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)}emplace(t,e,r,i,n,a){let s=t*4,o=t*8;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t}};Uh.prototype.bytesPerElement=16,C("StructArrayLayout2f1f2i16",Uh);var Do=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)}emplace(t,e,r,i,n,a,s){let o=t*16,l=t*4,u=t*8;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[u+6]=a,this.int16[u+7]=s,t}};Do.prototype.bytesPerElement=16,C("StructArrayLayout2ub2f2i16",Do);var _o=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*3;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t}};_o.prototype.bytesPerElement=6,C("StructArrayLayout3ui6",_o);var Ao=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let v=t*26,b=t*13,D=t*52;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=i,this.uint16[v+3]=n,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=h,this.float32[b+7]=c,this.float32[b+8]=p,this.uint8[D+36]=f,this.uint8[D+37]=d,this.uint8[D+38]=y,this.uint32[b+10]=m,this.int16[v+22]=g,this.float32[b+12]=x,t}};Ao.prototype.bytesPerElement=52,C("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",Ao);var So=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P){let L=this.length;return this.resize(L+1),this.emplace(L,t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P)}emplace(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S,k,z,O,P,L){let F=t*34,$=t*17;return this.int16[F+0]=e,this.int16[F+1]=r,this.int16[F+2]=i,this.int16[F+3]=n,this.int16[F+4]=a,this.int16[F+5]=s,this.int16[F+6]=o,this.int16[F+7]=l,this.uint16[F+8]=u,this.uint16[F+9]=h,this.uint16[F+10]=c,this.uint16[F+11]=p,this.uint16[F+12]=f,this.uint16[F+13]=d,this.uint16[F+14]=y,this.uint16[F+15]=m,this.uint16[F+16]=g,this.uint16[F+17]=x,this.uint16[F+18]=v,this.uint16[F+19]=b,this.uint16[F+20]=D,this.uint16[F+21]=A,this.uint16[F+22]=_,this.uint32[$+12]=S,this.float32[$+13]=k,this.float32[$+14]=z,this.uint16[F+30]=O,this.uint16[F+31]=P,this.float32[$+16]=L,t}};So.prototype.bytesPerElement=68,C("StructArrayLayout8i15ui1ul2f2ui1f68",So);var _a=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.float32[r+0]=e,t}};_a.prototype.bytesPerElement=4,C("StructArrayLayout1f4",_a);var Eo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*6,a=t*3;return this.uint16[n+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,t}};Eo.prototype.bytesPerElement=12,C("StructArrayLayout1ui2f12",Eo);var Fo=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,r){let i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)}emplace(t,e,r,i){let n=t*2,a=t*4;return this.uint32[n+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=i,t}};Fo.prototype.bytesPerElement=8,C("StructArrayLayout1ul2ui8",Fo);var ko=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){let r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){let i=t*2;return this.uint16[i+0]=e,this.uint16[i+1]=r,t}};ko.prototype.bytesPerElement=4,C("StructArrayLayout2ui4",ko);var qh=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){let r=t*1;return this.uint16[r+0]=e,t}};qh.prototype.bytesPerElement=2,C("StructArrayLayout1ui2",qh);var To=class extends xt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)}emplace(t,e,r,i,n){let a=t*4;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t}};To.prototype.bytesPerElement=16,C("StructArrayLayout4f16",To);var Vf=class extends bn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new B(this.anchorPointX,this.anchorPointY)}};Vf.prototype.size=20;var Ll=class extends bo{get(t){return new Vf(this,t)}};C("CollisionBoxArray",Ll);var Of=class extends bn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};Of.prototype.size=52;var Rf=class extends Ao{get(t){return new Of(this,t)}};C("PlacedSymbolArray",Rf);var $f=class extends bn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};$f.prototype.size=68;var Nf=class extends So{get(t){return new $f(this,t)}};C("SymbolInstanceArray",Nf);var Uf=class extends _a{getoffsetX(t){return this.float32[t*1+0]}};C("GlyphOffsetArray",Uf);var qf=class extends co{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};C("SymbolLineVertexArray",qf);var jf=class extends bn{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};jf.prototype.size=12;var Gf=class extends Eo{get(t){return new jf(this,t)}};C("TextAnchorOffsetArray",Gf);var Xf=class extends bn{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]}};Xf.prototype.size=8;var Yf=class extends Fo{get(t){return new Xf(this,t)}};C("FeatureIndexArray",Yf);var Zm=class extends ln{};var Hm=class extends ln{},Km=class extends ln{},Jm=class extends po{},Qm=class extends fo{},tg=class extends un{},Vr=class extends yo{},jh=class extends mo{},eg=class extends go{},rg=class extends xo{},ig=class extends vo{},Gh=class extends wo{};var ng=class extends Do{};var wn=class extends _o{},Io=class extends ko{};var Co=At([{name:"a_pos",components:2,type:"Int16"}],4),ag=Co.members;Co.size,Co.alignment;var ee=class Ur{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,r,i,n){let a=this.segments[this.segments.length-1];return e>Ur.MAX_VERTEX_ARRAY_LENGTH&&Bt(`Max vertices per segment is ${Ur.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${Ur.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+e>Ur.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n?this.createNewSegment(r,i,n):a}createNewSegment(e,r,i){let n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return i!==void 0&&(n.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,r,i){return this.prepareSegment(0,e,r,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,i,n){return new Ur([{vertexOffset:e,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};ee.MAX_VERTEX_ARRAY_LENGTH=2**16-1,C("SegmentVector",ee);function Xh(t,e){return t=Ji(Math.floor(t),0,255),e=Ji(Math.floor(e),0,255),256*t+e}var sg=At([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),og=At([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]),lg=fl(((t,e)=>{function r(i,n){for(var a=i.length&3,s=i.length-a,o=n,l,u=3432918353,h=461845907,c,p=0;p>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c,o=o<<13|o>>>19,l=(o&65535)*5+(((o>>>16)*5&65535)<<16)&4294967295,o=(l&65535)+27492+(((l>>>16)+58964&65535)<<16);switch(c=0,a){case 3:c^=(i.charCodeAt(p+2)&255)<<16;case 2:c^=(i.charCodeAt(p+1)&255)<<8;case 1:c^=i.charCodeAt(p)&255,c=(c&65535)*u+(((c>>>16)*u&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*h+(((c>>>16)*h&65535)<<16)&4294967295,o^=c}return o^=i.length,o^=o>>>16,o=(o&65535)*2246822507+(((o>>>16)*2246822507&65535)<<16)&4294967295,o^=o>>>13,o=(o&65535)*3266489909+(((o>>>16)*3266489909&65535)<<16)&4294967295,o^=o>>>16,o>>>0}e!==void 0&&(e.exports=r)})),ug=fl(((t,e)=>{function r(i,n){for(var a=i.length,s=n^a,o=0,l;a>=4;)l=i.charCodeAt(o)&255|(i.charCodeAt(++o)&255)<<8|(i.charCodeAt(++o)&255)<<16|(i.charCodeAt(++o)&255)<<24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),l^=l>>>24,l=(l&65535)*1540483477+(((l>>>16)*1540483477&65535)<<16),s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)^l,a-=4,++o;switch(a){case 3:s^=(i.charCodeAt(o+2)&255)<<16;case 2:s^=(i.charCodeAt(o+1)&255)<<8;case 1:s^=i.charCodeAt(o)&255,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16)}return s^=s>>>13,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>15,s>>>0}e.exports=r})),Mo=h1(fl(((t,e)=>{var r=lg(),i=ug();e.exports=r,e.exports.murmur3=r,e.exports.murmur2=i}))(),1),Wf=class Zf{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,i,n){this.ids.push(Yh(e)),this.positions.push(r,i,n)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let r=Yh(e),i=0,n=this.ids.length-1;for(;i>1;this.ids[s]>=r?n=s:i=s+1}let a=[];for(;this.ids[i]===r;){let s=this.positions[3*i],o=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:s,start:o,end:l}),i++}return a}static serialize(e,r){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Bo(i,n,0,i.length-1),r&&r.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let r=new Zf;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function Yh(t){let e=+t;return!isNaN(e)&&e<=2**53-1?e:(0,Mo.default)(String(t))}function Bo(t,e,r,i){for(;r>1],a=r-1,s=i+1;for(;;){do a++;while(t[a]n);if(a>=s)break;Yn(t,a,s),Yn(e,3*a,3*s),Yn(e,3*a+1,3*s+1),Yn(e,3*a+2,3*s+2)}s-r`u_${i}`),this.type=r}setUniform(t,e,r){t.set(r.constantOr(this.value))}getBinding(t,e,r){return this.type==="color"?new cg(t,e):new Ol(t,e)}},ur=class{constructor(t,e){this.uniformNames=e.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,r,i){let n=null;i==="u_pattern_to"?n=this.patternTo:i==="u_pattern_from"?n=this.patternFrom:i==="u_dasharray_to"?n=this.dashTo:i==="u_dasharray_from"?n=this.dashFrom:i==="u_pixel_ratio_to"?n=this.pixelRatioTo:i==="u_pixel_ratio_from"&&(n=this.pixelRatioFrom),n!==null&&t.set(n)}getBinding(t,e,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new hg(t,e):new Ol(t,e)}},ke=class{constructor(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map(n=>({name:`a_${n}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,e,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new st(0,r),e,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(i,t,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(0,n),r,i);this._setPaintValue(t,e,a)}_setPaintValue(t,e,r){if(this.type==="color"){let i=Po(r);for(let n=t;n`u_${s}_t`),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(s=>({name:`a_${s}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,r){let i=this.expression.evaluate(new st(this.zoom,r),e,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new st(this.zoom+1,r),e,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,i,n)}updatePaintArray(t,e,r,i,n){let a=this.expression.evaluate(new st(this.zoom,n),r,i),s=this.expression.evaluate(new st(this.zoom+1,n),r,i);this._setPaintValue(t,e,a,s)}_setPaintValue(t,e,r,i){if(this.type==="color"){let n=Po(r),a=Po(i);for(let s=t;s`#define HAS_UNIFORM_${i}`))}return t}getBinderAttributes(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof ke||r instanceof he)for(let i of r.paintVertexAttributes)t.push(i.name);else if(r instanceof Ye){let i=r.getVertexAttributes();for(let n of i)t.push(n.name)}}return t}getBinderUniforms(){let t=[];for(let e in this.binders){let r=this.binders[e];if(r instanceof $i||r instanceof ur||r instanceof he)for(let i of r.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof $i||n instanceof ur||n instanceof he){for(let a of n.uniformNames)if(e[a]){let s=n.getBinding(t,e[a],a);r.push({name:a,property:i,binding:s})}}}return r}setUniforms(t,e,r,i){for(let{name:n,property:a,binding:s}of e)this.binders[a].setUniform(s,i,r.get(a),n)}updatePaintBuffers(t){this._buffers=[];for(let e in this.binders){let r=this.binders[e];if(t&&r instanceof Ye){let i=t.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(r instanceof ke||r instanceof he)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(t){for(let e in this.binders){let r=this.binders[e];(r instanceof ke||r instanceof he||r instanceof Ye)&&r.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let e=this.binders[t];(e instanceof ke||e instanceof he||e instanceof Ye)&&e.destroy()}}},vr=class{constructor(t,e,r=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new Jf(i,e,r);this.needsUpload=!1,this._featureMap=new Wf,this._bufferOffset=0}populatePaintArrays(t,e,r,i){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,i);e.id!==void 0&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function pg(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function fg(t){return{"line-pattern":{source:Vr,composite:Vr},"fill-pattern":{source:Vr,composite:Vr},"fill-extrusion-pattern":{source:Vr,composite:Vr},"line-dasharray":{source:jh,composite:jh}}[t]}function Wh(t,e,r){var n;let i={color:{source:un,composite:To},number:{source:_a,composite:un}};return((n=fg(t))==null?void 0:n[r])||i[e][r]}C("ConstantBinder",$i),C("CrossFadedConstantBinder",ur),C("SourceExpressionBinder",ke),C("CrossFadedPatternBinder",Hf),C("CrossFadedDasharrayBinder",Kf),C("CompositeExpressionBinder",he),C("ProgramConfiguration",Jf,{omit:["_buffers"]}),C("ProgramConfigurationSet",vr);var zo=2**14-1,Zh=-zo-1;function Ar(t){let e=mt/t.extent,r=t.loadGeometry();for(let i of r)for(let n of i){let a=Math.round(n.x*e),s=Math.round(n.y*e);n.x=Ji(a,Zh,zo),n.y=Ji(s,Zh,zo),(an.x+1||sn.y+1)&&Bt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function hi(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ar(t):[]}}var Hh=-32768;function dg(t,e,r,i,n){t.emplaceBack(Hh+e*8+i,Hh+r*8+n)}var Rl=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Hm,this.indexArray=new wn,this.segments=new ee,this.programConfigurations=new vr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){let i=this.layers[0],n=[],a=null,s=!1,o=i.type==="heatmap";if(i.type==="circle"){let c=i;a=c.layout.get("circle-sort-key"),s=!a.isConstant(),o||(o=c.paint.get("circle-pitch-alignment")==="map")}let l=o?e.subdivisionGranularity.circle:1,u=new st(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:c,id:p,index:f,sourceLayerIndex:d}of t){let y=hi(c,h);if(!this.layers[0]._featureFilter.filter(u,y,r))continue;let m=s?a.evaluate(y,{},r):void 0,g={id:p,properties:c.properties,type:c.type,sourceLayerIndex:d,index:f,geometry:h?y.geometry:Ar(c),patterns:{},sortKey:m};n.push(g)}s&&n.sort((c,p)=>c.sortKey-p.sortKey);for(let c of n){let{geometry:p,index:f,sourceLayerIndex:d}=c,y=t[f].feature;this.addFeature(c,p,f,r,l),e.featureIndex.insert(y,p,f,d,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures(t){}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ag),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let o of e)for(let l of o){let u=l.x,h=l.y;if(u<0||u>=8192||h<0||h>=8192)continue;let c=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;for(let f=0;f=3){for(let n of i)if(oi(t,n))return!0}if(gg(t,i,r))return!0}return!1}function gg(t,e,r){if(t.length>1){if($l(t,e))return!0;for(let i of e)if(Lo(i,t,r))return!0}for(let i of t)if(Lo(i,e,r))return!0;return!1}function $l(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r1?t.distSqr(r):t.distSqr(r.sub(e)._mult(n)._add(e))}function Kh(t,e){let r=!1,i,n,a;for(let s of t){i=s;for(let o=0,l=i.length-1;oe.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(r=!r)}return r}function oi(t,e){let r=!1;for(let i=0,n=t.length-1;ie.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function vg(t,e,r,i,n){for(let s of t)if(e<=s.x&&r<=s.y&&i>=s.x&&n>=s.y)return!0;let a=[new B(e,r),new B(e,n),new B(i,n),new B(i,r)];if(t.length>2){for(let s of a)if(oi(t,s))return!0}for(let s=0;sn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return!1;let a=Ke(t,e,r[0]);return a!==Ke(t,e,r[1])||a!==Ke(t,e,r[2])||a!==Ke(t,e,r[3])}function Wr(t,e,r){let i=e.paint.get(t).value;return i.kind==="constant"?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ha(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ka(t,e,r,i,n){if(!e[0]&&!e[1])return t;let a=B.convert(e)._mult(n);r==="viewport"&&a._rotate(-i);let s=[];for(let o of t)s.push(o.sub(a));return s}function wg(t){let e=[];for(let r=0;rNl(n,e,r,i))}var kg,Tg=()=>kg||(kg=new Xt({"circle-sort-key":new N(w.layout_circle["circle-sort-key"],"circle-sort-key")})),Ig,Cg=()=>Ig||(Ig=new Xt({"circle-radius":new N(w.paint_circle["circle-radius"],"circle-radius"),"circle-color":new N(w.paint_circle["circle-color"],"circle-color"),"circle-blur":new N(w.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new N(w.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new V(w.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new V(w.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new V(w.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new V(w.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new N(w.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new N(w.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new N(w.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})),Mg={get paint(){return Cg()},get layout(){return Tg()}};var Bg=class extends de{constructor(t,e){super(t,Mg,e)}createBucket(t){return new Rl(t)}queryRadius(t){let e=t;return Wr("circle-radius",this,e)+Wr("circle-stroke-width",this,e)+Ha(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=Ka(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),h=this.paint.get("circle-pitch-scale"),c=this.paint.get("circle-pitch-alignment"),p,f;return c==="map"?(p=l,f=u*a):(p=Fg(l,n,s,o),f=u),ed({queryGeometry:p,size:f,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},i)}},rd=class extends Rl{};C("HeatmapBucket",rd,{omit:["layers"]});var Pg,zg=()=>Pg||(Pg=new Xt({"heatmap-radius":new N(w.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new N(w.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new V(w.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new Wa(w.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new V(w.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})),Lg={get paint(){return zg()}};function Ul(t,{width:e,height:r},i,n){if(!n)n=new Uint8Array(e*r*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*r*i)throw RangeError(`mismatched image size. expected: ${n.length} but got: ${e*r*i}`);return t.width=e,t.height=r,t.data=n,t}function id(t,{width:e,height:r},i){if(e===t.width&&r===t.height)return;let n=Ul({},{width:e,height:r},i);ql(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},i),t.width=e,t.height=r,t.data=n.data}function ql(t,e,r,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw RangeError("out of range destination coordinates for image copy");let s=t.data,o=e.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l{e[t.evaluationKey]=l;let u=t.expression.evaluate(e);n.setPixel(s/4/r,o/4,u)};if(t.clips)for(let s=0,o=0;s$g||($g=new Xt({"hillshade-illumination-direction":new V(w.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new V(w.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new V(w.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new V(w.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new V(w.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new V(w.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new V(w.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new V(w.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new V(w.paint_hillshade.resampling,"resampling")})),Ug={get paint(){return Ng()}};var qg=class extends de{constructor(t,e){super(t,Ug,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(t.length,e.length,r.length,i.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=e.map(ch);return{directionRadians:t.map(ch),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}},jg,Gg=()=>jg||(jg=new Xt({"color-relief-opacity":new V(w["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new Wa(w["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new V(w["paint_color-relief"].resampling,"resampling")})),Xg={get paint(){return Gg()}};function Wn(t){return"data"in t}var Jh=class{constructor(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,i)}update(t,e,r){var u;let{width:i,height:n}=t,a=(((u=this.size)==null?void 0:u[0])!==i||this.size[1]!==n)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!(e!=null&&e.useMipmap),a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&(e==null?void 0:e.premultiply)!==!1;if(a)if(this.size=[i,n],this.format===o.RGBA&&i>0&&n>0){let h=this.useMipmap?Math.floor(Math.log2(Math.max(i,n)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,h,o.RGBA8,i,n),Wn(t)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:c}=t;l&&c&&(c=Ns(c)),c&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,i,n,o.RGBA,o.UNSIGNED_BYTE,c)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t)}else Wn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,o));else{let{x:h,y:c}=r||{x:0,y:0};Wn(t)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,h,c,i,n,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,h,c,o))}this.useMipmap&&!(Wn(t)&&t.data===null)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,r,i,n){let{data:a}=t;e&&a&&(a=Ns(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,r,i,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,r,i){i.texSubImage2D(i.TEXTURE_2D,0,e,r,i.RGBA,i.UNSIGNED_BYTE,t)}_updateRawData(t,e,r,i,n,a,s){let{data:o}=t;e&&o&&(o=Ns(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,i,n,a,s.RGBA,s.UNSIGNED_BYTE,o)}bind(t,e,r){let{context:i}=this,{gl:n}=i;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),(r===n.LINEAR_MIPMAP_NEAREST||r===n.LINEAR_MIPMAP_LINEAR)&&!this.useMipmap&&(r=n.LINEAR);let a=r||t;t!==this.magFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),this.magFilter=t),a!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,a),this.minFilter=a),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}generateMipmap(){if(!this.useMipmap)return;let{gl:t}=this.context;t.bindTexture(t.TEXTURE_2D,this.texture),t.generateMipmap(t.TEXTURE_2D)}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}},Pe,jl=(Pe=class{constructor(e,r,i,n=1,a=1,s=1,o=0){if(this.uid=e,r.height!==r.width)throw RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i)){Bt(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),Pe.byteViewCache.set(this,new Uint8Array(this.data.buffer)),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let h=-2;h=l)&&this.data.copyWithin(this._idx(0,h),c,c+l),this.data.fill(this.data[c],this._idx(-2,h),this._idx(0,h)),this.data.fill(this.data[c+l-1],this._idx(l,h),this._idx(l+1,h)+1)}let u=this._getByteView();this.min=2**53-1,this.max=-(2**53-1);for(let h=0;hthis.max&&(this.max=f),f=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);let a=this._getByteView(),s=((n+2)*this.stride+i+2)*4,o=this.stride*4,l=e-i,u=r-n,h=this._unpackAtIndex(a,s),c=this._unpackAtIndex(a,s+4),p=this._unpackAtIndex(a,s+o),f=this._unpackAtIndex(a,s+o+4);return h*(1-l)*(1-u)+c*l*(1-u)+p*(1-l)*u+f*l*u}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-2||e>=this.dim+2||r<-2||r>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${r}, dim: ${this.dim}`);return(r+2)*this.stride+(e+2)}unpack(e,r,i){return e*this.redFactor+r*this.greenFactor+i*this.blueFactor-this.baseShift}pack(e){return sd(e,this.getUnpackVector())}getPixels(){return new Zt({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,r,i){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let n=r*this.dim,a=r*this.dim+this.dim,s=i*this.dim,o=i*this.dim+this.dim;switch(r){case-1:n=a-2;break;case 1:a=n+2}switch(i){case-1:s=o-2;break;case 1:o=s+2}let l=-r*this.dim,u=-i*this.dim;for(let h=s;h80*r){o=t[0],l=t[1];let h=o,c=l;for(let p=r;ph&&(h=f),d>c&&(c=d)}u=Math.max(h-o,c-l),u=u===0?0:32767/u}return Ro(a,s,o,l,u),s}function od(t,e,r,i,n){let a=null;if(n===fx(t,e,r,i)>0)for(let s=e;s=e;s-=i)a=ec(s/i|0,t[s],t[s+1],a);return a&&cn(a,a.next)&&(fn(a),a=a.next),a}function br(t,e=t){let r=e===t,i=t,n;do n=!1,i!==i.next&&(hn.size===0||!hn.has(i))&&(cn(i,i.next)||Ft(i.prev,i,i.next)===0)?((r||i===e)&&(e=i.prev),Oo=!0,fn(i),i=i.prev,n=!0):(r||i!==e)&&(i=i.next,n=!r);while(n||i!==e);return e}function Ro(t,e,r,i,n){n&&ox(t,r,i,n);let a=t,s=!1;for(;t.prev!==t.next;){let o=t.prev,l=t.next;if(Ft(o,t,l)<0&&(n?Kg(t,r,i,n):Hg(t))){e.push(o.i,t.i,l.i),fn(t),t=l,a=l;continue}if(t=l,t===a){if(Oo=!1,t=br(t),Oo){a=t;continue}if(!s){t=Jg(t,e),a=t,s=!0;continue}Qg(t,e,r,i,n);break}}}function Hg(t){let e=t.prev,r=t,i=t.next,n=e.x,a=r.x,s=i.x,o=e.y,l=r.y,u=i.y,h=Math.min(n,a,s),c=Math.min(o,l,u),p=Math.max(n,a,s),f=Math.max(o,l,u),d=i.next;for(;d!==e;){if(d.x>=h&&d.x<=p&&d.y>=c&&d.y<=f&&(n!==d.x||o!==d.y)&&Ea(n,o,a,l,s,u,d.x,d.y)&&Ft(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Kg(t,e,r,i){let n=t.prev,a=t,s=t.next,o=n.x,l=a.x,u=s.x,h=n.y,c=a.y,p=s.y,f=Math.min(o,l,u),d=Math.min(h,c,p),y=Math.max(o,l,u),m=Math.max(h,c,p),g=qo(f,d,e,r,i),x=qo(y,m,e,r,i),v=t.prevZ;for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=d&&v.y<=m&&v!==s&&(o!==v.x||h!==v.y)&&Ea(o,h,l,c,u,p,v.x,v.y)&&Ft(v.prev,v,v.next)>=0)return!1;v=v.prevZ}let b=t.nextZ;for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=d&&b.y<=m&&b!==s&&(o!==b.x||h!==b.y)&&Ea(o,h,l,c,u,p,b.x,b.y)&&Ft(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Jg(t,e){let r=t,i=!1;do{let n=r.prev,a=r.next.next;ud(n,r,r.next,a,!1)&&pn(n,a)&&pn(a,n)&&(e.push(n.i,r.i,a.i),fn(r),fn(r.next),r=t=a,i=!0),r=r.next}while(r!==t);return i?br(r):r}function Qg(t,e,r,i,n){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&hx(a,s)){let o=hd(a,s);a=br(a,a.next),o=br(o,o.next),Ro(a,e,r,i,n),Ro(o,e,r,i,n);return}s=s.next}a=a.next}while(a!==t)}var $o=!1;function tx(t,e,r,i){let n=[];for(let a=0,s=e.length;as&&(s=r.x),r.yo&&(o=r.y),h.xs&&(s=h.x),h.yo&&(o=h.y),r=h}while(++l<16&&r!==e);Uo[i]=r;let u=i*4;wt[u]=n,wt[u+1]=a,wt[u+2]=s,wt[u+3]=o}while(r!==e)}function nx(t,e){let r=t.z*4;e.xwt[r+2]&&(wt[r+2]=e.x),e.y>wt[r+3]&&(wt[r+3]=e.y)}function Qh(t){let e=Uo[t];for(;e.prev.next!==e;)e=e.next;return Uo[t]=e,e}function tc(t){let e=No[t];for(;e.prev.next!==e;)e=e.next;return No[t]=e,e}function ax(t,e){let r=e,i=t.x,n=t.y,a=-1/0,s;if(cn(t,r))return r;for(let p=0,f=0;pwt[f+3]||wt[f]>i||wt[f+2]<=a)continue;let d=Qh(p);r=tc(p);do{if(r.prev.next===r){if(cn(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){let y=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=i&&y>a&&(a=y,s=r.xi||wt[f+3]h)continue;let d=Qh(p);r=tc(p);do{if(r.prev.next===r&&i>=r.x&&r.x>=o&&i!==r.x&&Ea(ni)&&(ys.x||r.x===s.x&&sx(s,r)))&&(s=r,c=y)}r=r.next}while(r!==d)}return s}function sx(t,e){return Ft(t.prev,t,e.prev)<0&&Ft(e.next,t,t.next)<0}var ae=[],Ti=[],or=new Uint32Array,Ii=new Uint32Array,Ci=new Uint32Array(256);function ox(t,e,r,i){let n=t,a=0;do n.z=qo(n.x,n.y,e,r,i),ae[a++]=n,n=n.next;while(n!==t);lx(a);let s=null;for(let o=0;o=0&&ae[n].z>i;)ae[n+1]=ae[n],n--;ae[n+1]=r}return}or.length>>a&255]++;let s=0;for(let o=0;o<256;o++){let l=Ci[o];Ci[o]=s,s+=l}for(let o=0;o>>a&255]++;i[u]=e[o],n[u]=l}}function qo(t,e,r,i,n){return t=(t-r)*n|0,e=(e-i)*n|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function ux(t){let e=t,r=t;do(e.x=(t-s)*(a-o)&&(t-s)*(i-o)>=(r-s)*(e-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function hx(t,e){let r=cn(t,e)&&Ft(t.prev,t,t.next)>0&&Ft(e.prev,e,e.next)>0;return t.next.i!==e.i&&(r||pn(t,e)&&pn(e,t)&&(Ft(t.prev,t,e.prev)!==0||Ft(t,e.prev,e)!==0))&&!cx(t,e)&&(r||px(t,e))}function Ft(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function cn(t,e){return t.x===e.x&&t.y===e.y}function ud(t,e,r,i,n=!0){let a=Ft(t,e,r),s=Ft(t,e,i),o=Ft(r,i,t),l=Ft(r,i,e);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)?!0:n?!!(a===0&&Hn(t,r,e)||s===0&&Hn(t,i,e)||o===0&&Hn(r,t,i)||l===0&&Hn(r,e,i)):!1}function Hn(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function cx(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s=t;do{let o=s.next;if(s.x>i&&o.x>i||s.xa&&o.y>a||s.y=0&&Ft(t,t.prev,e)>=0:Ft(t,e,t.prev)<0||Ft(t,t.next,e)<0}function px(t,e){let r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{let s=r.next;r.y>a!=s.y>a&&n<(s.x-r.x)*(a-r.y)/(s.y-r.y)+r.x&&(i=!i),r=s}while(r!==t);return i}function hd(t,e){let r=jo(t.i,t.x,t.y),i=jo(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function ec(t,e,r,i){let n=jo(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function fn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),$o&&nx(t.prev,t.next)}function jo(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function fx(t,e,r,i){let n=0;for(let a=e,s=r-i;at)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){let e=1<32767||e>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=Math.round(t)|0,i=Math.round(e)|0,n=this._getKey(r,i);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,a),this._vertexBuffer.push(r,i),a}_subdivideTrianglesScanline(t){if(this._granularity<2)return gx(this._vertexBuffer,t);let e=[],r=t.length;for(let i=0;i=1||b<=0)||m&&(ln)){h>=i&&h<=n&&a.push(r[(s+1)%3]);continue}if(!m&&v>0){let _=o+f*v,S=l+d*v;a.push(this._vertexToIndex(_,S))}let D=o+f*Math.max(v,0),A=o+f*Math.min(b,1);if(y||this._generateIntraEdgeVertices(a,o,l,u,h,D,A),!m&&b<1){let _=o+f*b,S=l+d*b;a.push(this._vertexToIndex(_,S))}(m||h>=i&&h<=n)&&a.push(r[(s+1)%3]),!m&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,o,l,u,h,c,p,A,i,n)}return a}_generateIntraEdgeVertices(t,e,r,i,n,a,s){let o=i-e,l=n-r,u=l===0,h=u?Math.min(e,i):Math.min(a,s),c=u?Math.max(e,i):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(u?e=p;d--){let y=d*this._granularityCellSize,m=r+l*(y-e)/o;t.push(this._vertexToIndex(y,m))}}_generateInterEdgeVertices(t,e,r,i,n,a,s,o,l,u){let h=n-r,c=a-i,p=s-n,f=(l-n)/p,d=(u-n)/p,y=Math.min(f,d),m=Math.max(f,d),g=i+c*y,x=Math.floor(Math.min(g,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(g,o)/this._granularityCellSize)-1,b=o=1||m<=0){let _=e-a,S=r-s,k=(l-s)/S,z=(u-s)/S,O=a+_*Math.min(k,z);x=Math.floor(Math.min(O,o)/this._granularityCellSize)+1,v=Math.ceil(Math.max(O,o)/this._granularityCellSize)-1,b=o0?u:l;if(b)for(let _=x;_<=v;_++){let S=_*this._granularityCellSize;t.push(this._vertexToIndex(S,A))}else for(let _=v;_>=x;_--){let S=_*this._granularityCellSize;t.push(this._vertexToIndex(S,A))}}_generateOutline(t){let e=[];for(let r of t){let i=cr(r,this._granularity,!0),n=this._pointArrayToIndices(i),a=[];for(let s=1;sn==(a===-32768)?(t.push(r),t.push(e),t.push(this._vertexToIndex(i,a)),t.push(this._vertexToIndex(n,a)),t.push(r),t.push(this._vertexToIndex(i,a))):(t.push(e),t.push(r),t.push(this._vertexToIndex(i,a)),t.push(r),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(i,a)))}_fillPoles(t,e,r){let i=this._vertexBuffer,n=mt,a=t.length;for(let s=2;s=2&&((s=this._canonical)==null?void 0:s.z)===0&&(n=this._removeTrianglesOutsideTileX(n),a=a.map(o=>this._removeLinesOutsideTileX(o))),{verticesFlattened:this._vertexBuffer,indicesTriangles:n,indicesLineList:a}}_vertexOutsideTileX(t){let e=this._vertexBuffer[t*2];return e<0||e>8192}_removeTrianglesOutsideTileX(t){let e=[];for(let r=0;r0?(Math.floor(_/s)+1)*s:(Math.ceil(_/s)-1)*s,O=b>0?(Math.floor(S/s)+1)*s:(Math.ceil(S/s)-1)*s,P=Math.abs(_-z),L=Math.abs(S-O),F=Math.abs(_-y),$=Math.abs(S-m),U=g?P/D:1/0,T=x?L/A:1/0;if((F<=P||!g)&&($<=L||!x))break;if(U0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}function xx(t,e,r){if(e.length===0)throw Error("Subdivision vertex ring is empty.");let i=0,n=t[e[0]*2];for(let l=1;l=0?s-1:a-1,u=(o+1)%a,h=t[e[l]*2],c=t[e[l]*2+1],p=t[e[u]*2],f=t[e[u]*2+1],d=t[e[s]*2],y=t[e[s]*2+1],m=t[e[o]*2],g=t[e[o]*2+1],x=!1;if(hp)x=!1;else{let v=g-y,b=-(m-d),D=y((p-d)*v+(f-y)*b)*D&&(x=!0)}if(x){let v=e[l],b=e[s],D=e[o];v!==b&&v!==D&&b!==D&&r.push(D,b,v),s--,s<0&&(s=a-1)}else{let v=e[u],b=e[s],D=e[o];v!==b&&v!==D&&b!==D&&r.push(D,b,v),o++,o>=a&&(o=0)}if(l===u)break}}function pd(t,e,r,i,n,a,s,o,l){let u=n.length/2,h=s&&o&&l;if(uee.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=Zi(s,i,a,o,p,y,u),b=Zi(s,i,a,o,f,m,u),D=Zi(s,i,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+D-l),u.primitiveLength++}}function bx(t,e,r,i,n,a){let s=[];for(let c=0;cee.MAX_VERTEX_ARRAY_LENGTH&&(u=t.createNewSegment(e,r),l=o.count,y=!0,m=!0,h=0);let x=Zi(s,i,a,o,f,y,u),v=Zi(s,i,a,o,d,m,u);r.emplaceBack(h+x-l,h+v-l),u.primitiveLength++}}var fd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new Km,this.indexArray=new wn,this.indexArray2=new Io,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.segments2=new ee,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Aa("fill",this.layers,e);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r,e.availableImages):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Ar(l),patterns:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;if(this.hasDependencies){let f=Gl("fill",this.layers,l,{zoom:this.zoom},e);this.patternFeatures.push(f)}else this.addFeature(l,u,h,r,{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:t,canonical:e,patternPositions:r,patternMap:i}){this.detectSdfPatterns(i);for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,t.subdivisionGranularity)}detectSdfPatterns(t){for(let e of this.patternFeatures)for(let r in e.patterns){let i=e.patterns[r];this.recordSdfPattern(r,t[i.min]),this.recordSdfPattern(r,t[i.mid]),this.recordSdfPattern(r,t[i.max])}for(let e of this.layers){let r=e.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(e.id,t[r.from.toString()]),this.recordSdfPattern(e.id,t[r.to.toString()]))}}recordSdfPattern(t,e){if(!e)return;let r=e.sdf===!0,i=this.sdfPatterns[t];i===void 0?this.sdfPatterns[t]=r:i!==r&&Bt(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${t}"`)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Wg),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,r,i,n,a){for(let s of Ra(e,500)){let o=cd(s,i,a.fill.getGranularityForZoomLevel(i.z)),l=this.layoutVertexArray;pd((u,h)=>{l.emplaceBack(u,h)},this.segments,this.layoutVertexArray,this.indexArray,o.verticesFlattened,o.indicesTriangles,this.segments2,this.indexArray2,o.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,canonical:i})}};C("FillBucket",fd,{omit:["layers","patternFeatures"]});var wx,Dx=()=>wx||(wx=new Xt({"fill-sort-key":new N(w.layout_fill["fill-sort-key"],"fill-sort-key")})),_x,Ax=()=>_x||(_x=new Xt({"fill-antialias":new V(w.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new N(w.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new V(w.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new N(w.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new N(w.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new V(w.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new V(w.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new on(w.paint_fill["fill-pattern"],"fill-pattern")})),Sx={get paint(){return Ax()},get layout(){return Dx()}};var Ex=class extends de{constructor(t,e){super(t,Sx,e)}recalculate(t,e){super.recalculate(t,e);let r=this.paint._values["fill-outline-color"];r.value.kind==="constant"&&r.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new fd(t)}queryRadius(){return Ha(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:r,pixelsToTileUnits:i}){return Qf(Ka(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),e)}isTileClipped(){return!0}},Go=At([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Fx=At([{name:"a_centroid",components:2,type:"Int16"}],4),kx=Go.members;Go.size,Go.alignment;var Fa=class Xo{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new Xo;return r.extend(e(new B(this.minX,this.minY))),r.extend(e(new B(this.maxX,this.minY))),r.extend(e(new B(this.minX,this.maxY))),r.extend(e(new B(this.maxX,this.maxY))),r}static fromPoints(e){let r=new Xo;for(let i of e)r.extend(i);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}},g5=Fa.fromPoints([new B(0,0),new B(mt,mt)]);function Yo(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}function rc(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}var Dn=class{constructor(t,e,r,i,n){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n;t.pos>3,a===0)continue}if(a--,n===1)s+=t.readSVarint(),o+=t.readSVarint(),i&&r.push(i),i=[new B(s,o)];else if(n===2)s+=t.readSVarint(),o+=t.readSVarint(),i&&i.push(new B(s,o));else if(n===7)i&&i.push(i[0].clone());else throw Error(`unknown command ${n}`)}return i&&r.push(i),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let t=this._pbf;t.pos=this._geometry;let e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;t.pos>3,i===0)continue}if(i--,r===1||r===2)n+=t.readSVarint(),a+=t.readSVarint(),no&&(o=n),au&&(u=a);else if(r!==7)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(t,e,r){let i=this.extent*2**r,n=this.extent*t,a=this.extent*e,s=this.loadGeometry();function o(c){return[(c.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(c.y+a)*2/i)*Math.PI))-90]}function l(c){return c.map(o)}let u;if(this.type===1){let c=[];for(let f of s)c.push(f[0]);let p=l(c);u=c.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){let c=s.map(l);u=c.length===1?{type:"LineString",coordinates:c[0]}:{type:"MultiLineString",coordinates:c}}else if(this.type===3){let c=dd(s),p=[];for(let f of c)p.push(f.map(l));u=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw Error("unknown feature type");let h={type:"Feature",geometry:u,properties:this.properties};return this.id!=null&&(h.id=this.id),h}};Dn.types=["Unknown","Point","LineString","Polygon"];function dd(t){let e=t.length;if(e<=1)return[t];let r=[],i,n;for(let a=0;a=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[t];let e=this._pbf.readVarint()+this._pbf.pos;return new Dn(this._pbf,e,this.extent,this._keys,this._values)}};function Cx(t){let e=null,r=t.readVarint()+t.pos;for(;t.pos90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ui(F1(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,i=this.lat*r,n=e.lat*r,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*r);return yd*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof Ui)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ui(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e)return new Ui(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}},md=2*Math.PI*yd;function gd(t){return md*Math.cos(t*Math.PI/180)}function Mx(t){return(180+t)/360}function Bx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Px(t,e){return t/gd(e)}function zx(t){return t*360-180}function Wo(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Lx(t,e){return t*gd(Wo(e))}function Vx(t){return 1/Math.cos(t*Math.PI/180)}var Yl=class xd{constructor(e,r,i=0){this.x=+e,this.y=+r,this.z=+i}static fromLngLat(e,r=0){let i=ic.convert(e);return new xd(Mx(i.lng),Bx(i.lat),Px(r,i.lat))}toLngLat(){return new ic(zx(this.x),Wo(this.y))}toAltitude(){return Lx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/md*Vx(Wo(this.y))}};function Ox(t,e,r){let i=1/(1<Nx(n,i))}function $x(t,e){let r=Rx(mt/2,mt/2,e),i=Yl.fromLngLat(r).meterInMercatorCoordinateUnits(),n=(1<1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y;)e.pop();return e}function qx(t,e,r,i,n){let a=e.sub(r),s=i.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6){t.push(r.clone());return}a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180)){t.push(r.clone());return}let h=.2,c=Math.min(n,o*h,l*h),p=r.add(a.mult(c)),f=r.add(s.mult(c)),d=Math.sqrt((1+u)/2),y=r.add(a.add(s)._unit()._mult(c/d)),m=p.sub(y).angleWith(f.sub(y)),g=Math.max(2,Math.ceil(Math.abs(m)/(Math.PI/6)-1e-6));for(let x=0;x<=g;x++)t.push(p.rotateAround(x/g*m,y))}var js=8192;function Mi(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,Math.floor(i*js)*2+s,n*js*2,a*js*2,Math.round(o))}var vd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Jm,this.centroidVertexArray=new Zm,this.indexArray=new wn,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.features=[],this.hasDependencies=Aa("fill-extrusion",this.layers,e);let i=new st(this.zoom),n=this.layers[0],a=n.layout.get("fill-extrusion-rounded-corner-distance"),s=n._featureFilter.needGeometry;for(let{feature:o,id:l,index:u,sourceLayerIndex:h}of t){let c=hi(o,s);if(!n._featureFilter.filter(i,c,r))continue;let p=s?c.geometry:Ar(o),f={id:l,sourceLayerIndex:h,index:u,geometry:a>0?nc(p,a,r):p,properties:o.properties,type:o.type,patterns:{}};this.hasDependencies?this.features.push(Gl("fill-extrusion",this.layers,f,{zoom:this.zoom},e)):this.addFeature(f,f.geometry,u,r,{},e.subdivisionGranularity),e.featureIndex.insert(o,f.geometry,u,h,this.index,!0)}}addFeatures({options:t,canonical:e,patternPositions:r}){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,e,r,t.subdivisionGranularity)}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,kx),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Fx.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,r,i,n,a){let s=this.layers[0],o=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0,l=o>0?nc(e,o,i):e;for(let u of Ra(l,500)){let h={x:0,y:0,sampleCount:0},c=this.layoutVertexArray.length;this.processPolygon(h,i,t,u,a);let p=this.layoutVertexArray.length-c,f=Math.floor(h.x/h.sampleCount),d=Math.floor(h.y/h.sampleCount);for(let y=0;y{Mi(u,h,c,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let r=0;for(let i=1;iee.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=n.sub(a)._perp()._unit(),o=a.dist(n);r+o>32768&&(r=0),Mi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,0,r),Mi(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,1,r),r+=o,Mi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,r),Mi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,r);let l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}};function jx(t,e){for(let r=0;rGx||(Gx=new Xt({"fill-extrusion-rounded-corner-distance":new V(w["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})),Yx,Wx=()=>Yx||(Yx=new Xt({"fill-extrusion-opacity":new V(w["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new N(w["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new V(w["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new V(w["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new on(w["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new N(w["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new N(w["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new V(w["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})),Zx={get paint(){return Wx()},get layout(){return Xx()}};var Hx=class extends de{constructor(t,e){super(t,Zx,e)}createBucket(t){return new vd(t)}queryRadius(){return Ha(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=Ka(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-n.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(e,r),u=this.paint.get("fill-extrusion-base").evaluate(e,r),h=Qx(o,s,0),c=Jx(i,u,l,s),p=c[0],f=c[1];return Kx(p,f,h)}};function Bi(t,e){return t.x*e.x+t.y*e.y}function ac(t,e){if(t.length===1){let r=0,i=e[r++],n;for(;!n||i.equals(n);)if(n=e[r++],!n)return 1/0;for(;r>1),s=r-e,o,l=t[e],u=t[e+1],h=t[r],c=t[r+1];for(let p=e+3;pn){o=p,n=f;continue}if(f===n){let d=Math.abs(p-a);di&&(o-e>3&&Zo(t,e,o,i),t[o+2]=n,r-o>3&&Zo(t,o,r,i))}function t2(t,e,r,i,n,a){let s=n-r,o=a-i;if(s!==0||o!==0){let l=((t-r)*s+(e-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=t-r,o=e-i,s*s+o*o}function Mt(t,e,r,i){let n={type:e,geom:r},a={id:t!=null?t:null,type:n.type,geometry:n.geom,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case"Point":case"MultiPoint":Pi(a,n.geom);break;case"LineString":Pi(a,n.geom.points);break;case"Polygon":Pi(a,n.geom[0].points);break;case"MultiLineString":for(let s of n.geom)Pi(a,s.points);break;case"MultiPolygon":for(let s of n.geom)Pi(a,s[0].points)}return a}function Wl(t){let e=t;t.points.length>64&&(e.points=new Float64Array(t.points))}function Pi(t,e){for(let r=0;r1024)throw Error("GeometryCollection nesting exceeds supported depth: 1024");if(e.geometry.type==="GeometryCollection"){r2(t,e,e.geometry,r,i,n+1);return}if(!((o=e.geometry.coordinates)!=null&&o.length))return;let a=e2(e,r,i),s=(r.tolerance/((1<0&&(s+=i?(n*h-u*a)/2:Math.sqrt((u-n)**2+(h-a)**2)),n=u,a=h}let o=e.points.length-3;e.points[2]=1,r>0&&Zo(e.points,0,o,r),e.points[o+2]=1,Wl(e),e.size=Math.abs(s),e.start=0,e.end=e.size}function Kl(t,e,r,i){for(let n=0;n1?1:r}function u2(t){return{type:"FeatureCollection",features:t.map(e=>ka(e))}}function ka(t){let e={type:"Feature",geometry:h2(t),properties:t.tags};return t.id!=null&&(e.id=t.id),e}function h2(t){let{type:e,geometry:r}=t;switch(e){case"Point":return{type:e,coordinates:bd(r[0],r[1])};case"MultiPoint":return{type:e,coordinates:Kn(r)};case"LineString":return{type:e,coordinates:Kn(r.points)};case"MultiLineString":case"Polygon":return{type:e,coordinates:r.map(i=>Kn(i.points))};case"MultiPolygon":return{type:e,coordinates:r.map(i=>i.map(n=>Kn(n.points)))}}}function Kn(t){let e=[];for(let r=0;r=r&&s=i)return null;let l=[];for(let u of t){let h=n===0?u.minX:u.minY,c=n===0?u.maxX:u.maxY;if(h>=r&&c=i))switch(u.type){case"Point":case"MultiPoint":c2(u,l,r,i,n);continue;case"LineString":p2(u,l,r,i,n,o);continue;case"MultiLineString":f2(u,l,r,i,n);continue;case"Polygon":d2(u,l,r,i,n);continue;case"MultiPolygon":y2(u,l,r,i,n);continue}}return l.length?l:null}function c2(t,e,r,i,n){let a=[];if(m2(t.geometry,a,r,i,n),!a.length)return;let s=a.length===3?"Point":"MultiPoint";e.push(Mt(t.id,s,a,t.tags))}function p2(t,e,r,i,n,a){let s=[];if(_d(t.geometry,s,r,i,n,!1,a.lineMetrics),s.length){if(a.lineMetrics){for(let o of s)e.push(Mt(t.id,"LineString",o,t.tags));return}if(s.length>1){e.push(Mt(t.id,"MultiLineString",s,t.tags));return}e.push(Mt(t.id,"LineString",s[0],t.tags))}}function f2(t,e,r,i,n){let a=[];if(Jl(t.geometry,a,r,i,n,!1),a.length){if(a.length===1){e.push(Mt(t.id,"LineString",a[0],t.tags));return}e.push(Mt(t.id,"MultiLineString",a,t.tags))}}function d2(t,e,r,i,n){let a=[];Jl(t.geometry,a,r,i,n,!0),a.length&&e.push(Mt(t.id,"Polygon",a,t.tags))}function y2(t,e,r,i,n){let a=[];for(let s of t.geometry){let o=[];Jl(s,o,r,i,n,!0),o.length&&a.push(o)}a.length&&e.push(Mt(t.id,"MultiPolygon",a,t.tags))}function m2(t,e,r,i,n){for(let a=0;a=r&&s<=i&&Kr(e,t[a],t[a+1],t[a+2])}}function _d(t,e,r,i,n,a,s){let o=sc(t),l=n===0?g2:x2,u=t.start,h,c;for(let g=0;gr&&(c=l(o,x,v,D,A,r),s&&(o.start=u+h*c)):_>i?S=r&&(c=l(o,x,v,D,A,r),k=!0),S>i&&_<=i&&(c=l(o,x,v,D,A,i),k=!0),!a&&k&&(s&&(o.end=u+h*c),e.push(o),o=sc(t)),s&&(u+=h)}let p=t.points.length-3,f=t.points[p],d=t.points[p+1],y=t.points[p+2],m=n===0?f:d;m>=r&&m<=i&&Kr(o.points,f,d,y),p=o.points.length-3,a&&p>=3&&(o.points[p]!==o.points[0]||o.points[p+1]!==o.points[1])&&Kr(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Wl(o),e.push(o))}function sc(t){return{points:[],size:t.size,start:t.start,end:t.end}}function Jl(t,e,r,i,n,a){for(let s of t)_d(s,e,r,i,n,a,!1)}function Kr(t,e,r,i){t.push(e,r,i)}function g2(t,e,r,i,n,a){let s=(a-e)/(i-e);return Kr(t.points,a,r+(n-r)*s,1),s}function x2(t,e,r,i,n,a){let s=(a-r)/(n-r);return Kr(t.points,e+(i-e)*s,a,1),s}function Ql(t,e){let r=e.buffer/e.extent,i=t,n=Te(t,1,-1-r,r,0,-1,2,e),a=Te(t,1,1-r,2+r,0,-1,2,e);return!n&&!a||(i=Te(t,1,-r,1+r,0,-1,2,e)||[],n&&(i=oc(n,1).concat(i)),a&&(i=i.concat(oc(a,-1)))),i}function oc(t,e){let r=[];for(let i of t)switch(i.type){case"Point":case"MultiPoint":{let n=v2(i.geometry,e);r.push(Mt(i.id,i.type,n,i.tags));continue}case"LineString":{let n=Gs(i.geometry,e);r.push(Mt(i.id,i.type,n,i.tags));continue}case"MultiLineString":case"Polygon":{let n=[];for(let a of i.geometry)n.push(Gs(a,e));r.push(Mt(i.id,i.type,n,i.tags));continue}case"MultiPolygon":{let n=[];for(let a of i.geometry){let s=[];for(let o of a)s.push(Gs(o,e));n.push(s)}r.push(Mt(i.id,i.type,n,i.tags));continue}}return r}function v2(t,e){let r=[];for(let i=0;io.id));t=t.filter(o=>!s.has(o.id))}if(i.add.size){let s=Zl({type:"FeatureCollection",features:Array.from(i.add.values())},r);s=Ql(s,r),n=n.concat(s),t=t.concat(s)}}if(i.update.size){let a=new Map,s=[];for(let o of t)i.update.has(o.id)?a.set(o.id,[...a.get(o.id)||[],o]):s.push(o);for(let[o,l]of i.update){let u=a.get(o);if(!u||u.length===0)continue;let h=w2(u,l,r);n=n.concat(u,h),s=s.concat(h)}t=s}return{affected:n,source:t}}function w2(t,e,r){var a,s;let i=!!e.newGeometry,n=e.removeAllProperties||((a=e.removeProperties)==null?void 0:a.length)>0||((s=e.addOrUpdateProperties)==null?void 0:s.length)>0;if(i){let o=t[0],l=Zl({type:"FeatureCollection",features:[{type:"Feature",id:o.id,geometry:e.newGeometry,properties:n?lc(o.tags,e):o.tags}]},r);return l=Ql(l,r),l}if(n){let o=[];for(let l of t){let u=je({},l);u.tags=lc(u.tags,e),o.push(u)}return o}return t}function lc(t,e){if(e.removeAllProperties)return{};let r=je({},t||{});if(e.removeProperties)for(let i of e.removeProperties)delete r[i];if(e.addOrUpdateProperties)for(let{key:i,value:n}of e.addOrUpdateProperties)r[i]=n;return r}function D2(t,e){var r,i;return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map((r=t.add)==null?void 0:r.map(n=>[e.promoteId?n.properties[e.promoteId]:n.id,n])),update:new Map((i=t.update)==null?void 0:i.map(n=>[n.id,n]))}:{remove:new Set,add:new Map,update:new Map}}var uc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],dt=new Uint32Array(96),_2=class Ad{static from(e){if(!e||e.byteLength===void 0||e.buffer)throw Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[r,i]=new Uint8Array(e,0,2);if(r!==219)throw Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(n!==1)throw Error(`Got v${n} data when expected v1.`);let a=uc[i&15];if(!a)throw Error("Unrecognized array type.");let[s]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Ad(o,s,a,void 0,e)}constructor(e,r=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let s=uc.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-l%8)%8;if(s<0)throw Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+l+u,e*2),this._pos=e*2,this._finished=!0;else{let h=this.data=new n(8+o+l+u);this.ids=new this.IndexArrayType(h,8,e),this.coords=new i(h,8+l+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(h,0,2).set([219,16+s]),new Uint16Array(h,2,1)[0]=r,new Uint32Array(h,4,1)[0]=e}}add(e,r){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=r,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Ho(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=[];for(;l>0;){let h=dt[--l],c=dt[--l],p=dt[--l];if(c-p<=o){for(let m=p;m<=c;m++){let g=s[2*m],x=s[2*m+1];g>=e&&g<=i&&x>=r&&x<=n&&u.push(a[m])}continue}let f=p+c>>1,d=s[2*f],y=s[2*f+1];d>=e&&d<=i&&y>=r&&y<=n&&u.push(a[f]),(h===0?e<=d:r<=y)&&(dt[l++]=p,dt[l++]=f-1,dt[l++]=1-h),(h===0?i>=d:n>=y)&&(dt[l++]=f+1,dt[l++]=c,dt[l++]=1-h)}return u}within(e,r,i){let n=[];return this.withinInto(e,r,i,n),n}withinInto(e,r,i,n){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:s,nodeSize:o}=this;dt[0]=0,dt[1]=a.length-1,dt[2]=0;let l=3,u=0,h=i*i;for(;l>0;){let c=dt[--l],p=dt[--l],f=dt[--l];if(p-f<=o){for(let g=f;g<=p;g++)hc(s[2*g],s[2*g+1],e,r)<=h&&(n[u++]=a[g]);continue}let d=f+p>>1,y=s[2*d],m=s[2*d+1];hc(y,m,e,r)<=h&&(n[u++]=a[d]),(c===0?e-i<=y:r-i<=m)&&(dt[l++]=f,dt[l++]=d-1,dt[l++]=1-c),(c===0?e+i>=y:r+i>=m)&&(dt[l++]=d+1,dt[l++]=p,dt[l++]=1-c)}return u}};function Ho(t,e,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Sd(t,e,s,i,n,a),Ho(t,e,r,i,s-1,1-a),Ho(t,e,r,s+1,n,1-a)}function Sd(t,e,r,i,n,a){for(;n>i;){if(n-i>600){let u=n-i+1,h=r-i+1,c=Math.log(u),p=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*p*(u-p)/u)*(h-u/2<0?-1:1);Sd(t,e,r,Math.max(i,Math.floor(r-h*p/u+f)),Math.min(n,Math.floor(r+(u-h)*p/u+f)),a)}let s=e[2*r+a],o=i,l=n;for(zi(t,e,i,r),e[2*n+a]>s&&zi(t,e,i,n);os;)l--}e[2*i+a]===s?zi(t,e,i,l):(l++,zi(t,e,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function zi(t,e,r,i){Xs(t,r,i),Xs(e,2*r,2*i),Xs(e,2*r+1,2*i+1)}function Xs(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}function hc(t,e,r,i){let n=t-r,a=e-i;return n*n+a*a}var Ko={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},A2=class{constructor(t){this.options=Object.assign(Object.create(Ko),t),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(t){let e=[];for(let r of t){if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,[a,s]=[Zr(i),Hr(n)],o={id:r.id,type:"Point",geometry:[a,s],tags:r.properties};e.push(o)}this.createIndex(e)}initialize(t){let e=[];for(let r of t)r.type==="Point"&&e.push(r);this.createIndex(e)}updateIndex(t,e,r){this.options=Object.assign(Object.create(Ko),r.clusterOptions),this.initialize(t)}createIndex(t){let{log:e,minZoom:r,maxZoom:i}=this.options;e&&console.time("total time");let n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;let a=[];for(let o=0;o=r;o--){let l=Date.now();s=this.trees[o]=this.createTree(this.cluster(s,o)),e&&console.log("z%d: %d clusters in %dms",o,s.numItems,Date.now()-l)}e&&console.timeEnd("total time")}getClusters(t,e){return this.getClustersInternal(t,e).map(r=>ka(r))}getClustersInternal(t,e){let r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,n=180;else if(r>n){let h=this.getClustersInternal([r,i,180,a],e),c=this.getClustersInternal([-180,i,n,a],e);return h.concat(c)}let s=this.trees[this.limitZoom(e)],o=s.range(Zr(r),Hr(a),Zr(n),Hr(i)),l=s.flatData,u=[];for(let h of o){let c=this.stride*h;u.push(l[c+5]>1?S2(l,c,this.clusterProps):this.points[l[c+3]])}return u}getChildren(t){let e=this.getOriginId(t),r=this.getOriginZoom(t),i=Error("No cluster with the specified id: "+t),n=this.trees[r];if(!n)throw i;let a=n.flatData;if(e*this.stride>=a.length)throw i;let s=this.options.radius/(this.options.extent*2**(r-1)),o=a[e*this.stride],l=a[e*this.stride+1],u=n.within(o,l,s),h=[];for(let c of u){let p=c*this.stride;a[p+4]===t&&h.push(a[p+5]>1?E2(a,p,this.clusterProps):ka(this.points[a[p+3]]))}if(h.length===0)throw i;return h}getLeaves(t,e,r){e||(e=10),r||(r=0);let i=[];return this.appendLeaves(i,t,e,r,0),i}getTile(t,e,r){let i=this.trees[this.limitZoom(t)];if(!i)return null;let n=2**t,{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,h={transformed:!0,features:[],source:null,x:e,y:r,z:t};return this.addTileFeatures(i.range((e-o)/n,l,(e+1+o)/n,u),i.flatData,e,r,n,h),e===0&&this.addTileFeatures(i.range(1-o/n,l,1,u),i.flatData,n,r,n,h),e===n-1&&this.addTileFeatures(i.range(0,l,o/n,u),i.flatData,-1,r,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,r,i,n){let a=this.getChildren(e);for(let s of a){let o=s.properties;if(o!=null&&o.cluster?n+o.point_count<=i?n+=o.point_count:n=this.appendLeaves(t,o.cluster_id,r,i,n):n1,u,h,c;if(l)u=tu(e,o,this.clusterProps),h=e[o],c=e[o+1];else{let d=this.points[e[o+3]];u=d.tags,[h,c]=d.geometry}let p={type:1,geometry:[[Math.round(this.options.extent*(h*n-r)),Math.round(this.options.extent*(c*n-i))]],tags:u},f;f=l||this.options.generateId?e[o+3]:this.points[e[o+3]].id,f!==void 0&&(p.id=f),a.features.push(p)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*2**e),o=t.flatData,l=[],u=this.stride;for(let h=0;he&&(y+=o[g+5])}if(y>d&&y>=a){let m=c*d,g=p*d,x,v=-1,b=((h/u|0)<<5)+(e+1)+this.points.length;for(let D of f){let A=D*u;if(o[A+2]<=e)continue;o[A+2]=e;let _=o[A+5];m+=o[A]*_,g+=o[A+1]*_,o[A+4]=b,n&&(x||(x=this.map(o,h,!0),v=this.clusterProps.length,this.clusterProps.push(x)),n(x,this.map(o,A)))}o[h+4]=b,l.push(m/y,g/y,1/0,b,-1,y),n&&l.push(v)}else{for(let m=0;m1)for(let m of f){let g=m*u;if(!(o[g+2]<=e)){o[g+2]=e;for(let x=0;x>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,r){if(t[e+5]>1){let a=this.clusterProps[t[e+6]];return r?Object.assign({},a):a}let i=this.points[t[e+3]].tags,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};function S2(t,e,r){return{id:t[e+3],type:"Point",tags:tu(t,e,r),geometry:[t[e],t[e+1]]}}function E2(t,e,r){return{type:"Feature",id:t[e+3],properties:tu(t,e,r),geometry:{type:"Point",coordinates:[wd(t[e]),Dd(t[e+1])]}}}function tu(t,e,r){let i=t[e+5],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,a=t[e+6],s=a===-1?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+3],point_count:i,point_count_abbreviated:n})}var Ed="geojsonvt_clip_start",Fd="geojsonvt_clip_end";function cc(t,e,r,i,n){let a=e===n.maxZoom?0:n.tolerance/((1<0&&e.size<(n?s:i)){r.numPoints+=e.points.length/3;return}let o=[];for(let l=0;ls)&&(r.numSimplified++,o.push(e.points[l],e.points[l+1])),r.numPoints++;n&&M2(o,a),t.push(o)}function M2(t,e){let r=0;for(let i=0,n=t.length,a=n-2;i0===e)for(let i=0,n=t.length;i1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(e),r.debug>1&&console.timeEnd("invalidating");let[i,n,a]=[0,0,0],s=cc(t,i,n,a,r);s.source=t;let o=Jn(i,n,a);if(this.tiles[o]=s,this.tileCoords.push({z:i,x:n,y:a,id:o}),r.debug){let l=`z${i}`;this.stats[l]=(this.stats[l]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,r){return null}getTile(t,e,r){let{extent:i,debug:n}=this.options,a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);let o=t,l=e,u=r,h;for(;!h&&o>0;)o--,l>>=1,u>>=1,h=this.tiles[Jn(o,l,u)];return!(h!=null&&h.source)||(n>1&&(console.log("found parent tile z%d-%d-%d",o,l,u),console.time("drilling down")),this.splitTile(h.source,o,l,u,t,e,r),n>1&&console.timeEnd("drilling down"),!this.tiles[s])?null:pc(this.tiles[s],i)}splitTile(t,e,r,i,n,a,s){let o=[t,e,r,i],l=this.options,u=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),e=o.pop(),t=o.pop();let h=1<1&&console.time("creation"),p=this.tiles[c]=cc(t,e,r,i,l),this.tileCoords.push({z:e,x:r,y:i,id:c}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));let _=`z${e}`;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(p.source=t,n==null){if(e===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(n!=null){let _=n-e;if(r!==a>>_||i!==s>>_)continue}}if(p.source=null,!t.length)continue;u>1&&console.time("clipping");let f=.5*l.buffer/l.extent,d=.5-f,y=.5+f,m=1+f,g=null,x=null,v=null,b=null,D=Te(t,h,r-f,r+y,0,p.minX,p.maxX,l),A=Te(t,h,r+d,r+m,0,p.minX,p.maxX,l);D&&(g=Te(D,h,i-f,i+y,1,p.minY,p.maxY,l),x=Te(D,h,i+d,i+m,1,p.minY,p.maxY,l)),A&&(v=Te(A,h,i-f,i+y,1,p.minY,p.maxY,l),b=Te(A,h,i+d,i+m,1,p.minY,p.maxY,l)),u>1&&console.timeEnd("clipping"),o.push(g||[],e+1,r*2,i*2),o.push(x||[],e+1,r*2,i*2+1),o.push(v||[],e+1,r*2+1,i*2),o.push(b||[],e+1,r*2+1,i*2+1)}}invalidateTiles(t){if(!t.length)return;let e=this.options,{debug:r}=e,i=1/0,n=-1/0,a=1/0,s=-1/0;for(let u of t)i=Math.min(i,u.minX),n=Math.max(n,u.maxX),a=Math.min(a,u.minY),s=Math.max(s,u.maxY);let o=e.buffer/e.extent,l=new Set;for(let u in this.tiles){let h=this.tiles[u],c=1<=f||s=y)continue;let m=!1;for(let g of t)if(g.maxX>=p&&g.minX=d&&g.minY1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",h.z,h.x,h.y,h.numFeatures,h.numPoints,h.numSimplified);let g=`z${h.z}`;this.stats[g]=(this.stats[g]||0)-1,this.total--}delete this.tiles[u],l.add(u)}}l.size&&(this.tileCoords=this.tileCoords.filter(u=>!l.has(u.id)))}};function Jn(t,e,r){return((1<24)throw Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw Error("promoteId and generateId cannot be used together.");let i=Zl(t,e);r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),i=Ql(i,e),e.updateable&&(this.source=i),this.initializeIndex(i,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new A2(e.clusterOptions):new z2(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,r){return t=+t,e=+e,r=+r,t<0||t>24?null:this.tileIndex.getTile(t,e,r)}updateData(t,e){let r=this.options;if(!r.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:i,source:n}=b2(this.source,t,r);e&&({affected:i,source:n}=this.filterUpdate(n,i,e)),i.length&&(this.source=n,this.tileIndex.updateIndex(n,i,r))}filterUpdate(t,e,r){let i=new Set;for(let n of t)n.id!=null&&(r(ka(n))||(e.push(n),i.add(n.id)));return t=t.filter(n=>!i.has(n.id)),{affected:e,source:t}}getData(){if(!this.options.updateable)throw Error("to retrieve data the `updateable` option must be set to true");return u2(this.source)}updateClusterOptions(t,e){let r=this.options.cluster;if(this.options.cluster=t,this.options.clusterOptions=e,r==t){this.tileIndex.updateIndex(this.source,[],this.options);return}this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,r){return this.tileIndex.getLeaves(t,e,r)}},Jo=At([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),V2=Jo.members;Jo.size,Jo.alignment;var Qo=At([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),O2=Qo.members;Qo.size,Qo.alignment;var R2=Math.cos(75/2*(Math.PI/180)),Id=1/2,fc=2**14/Id,Cd=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(e=>e.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new Qm,this.layoutVertexArray2=new tg,this.indexArray=new wn,this.programConfigurations=new vr(t.layers,t.zoom),this.segments=new ee,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(t,e,r){this.hasDependencies=Aa("line",this.layers,e)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[],s=new st(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of t){let p=hi(l,o);if(!this.layers[0]._featureFilter.filter(s,p,r))continue;let f=n?i.evaluate(p,{},r):void 0,d={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?p.geometry:Ar(l),patterns:{},dashes:{},sortKey:f};a.push(d)}n&&a.sort((l,u)=>l.sortKey-u.sortKey);for(let l of a){let{geometry:u,index:h,sourceLayerIndex:c}=l;this.hasDependencies?(Aa("line",this.layers,e)?Gl("line",this.layers,l,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,l,this.zoom,e),this.patternFeatures.push(l)):this.addFeature(l,u,h,r,{},{},e.subdivisionGranularity);let p=t[h].feature;e.featureIndex.insert(p,u,h,c,this.index)}}update(t,e,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures({options:t,canonical:e,patternPositions:r,dashPositions:i}){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,r,i,t.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,O2)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,V2),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.hasOwn(t.properties,"geojsonvt_clip_start")&&Object.hasOwn(t.properties,"geojsonvt_clip_end"))return{start:+t.properties[Ed],end:+t.properties[Fd]}}addFeature(t,e,r,i,n,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(t,{}),u=o.get("line-cap").evaluate(t,{}),h=o.get("line-miter-limit").evaluate(t,{}),c=o.get("line-round-limit").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(let p of e)this.addLine(p,t,l,u,h,c,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(t,e,r,i,n,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(t=cr(t,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let v=0;v=2&&t[h-1].equals(t[h-2]);)h--;let c=0;for(;c0;if(k&&v>c){let L=d.dist(y);if(L>2*p){let F=d.sub(d.sub(y)._mult(p/L)._round());this.updateDistance(y,F),this.addCurrentVertex(F,g,0,0,f),y=F}}let O=y&&m,P=O?r:u?"butt":i;if(O&&P==="round"&&(_n&&(P="bevel"),P==="bevel"&&(_>2&&(P="flipbevel"),_100)b=x.mult(-1);else{let L=_*g.add(x).mag()/g.sub(x).mag();b._perp()._mult(L*(z?-1:1))}this.addCurrentVertex(d,b,0,0,f),this.addCurrentVertex(d,b.mult(-1),0,0,f)}else if(P==="bevel"||P==="fakeround"){let L=-Math.sqrt(_*_-1),F=z?L:0,$=z?0:L;if(y&&this.addCurrentVertex(d,g,F,$,f),P==="fakeround"){let U=Math.round(S*180/Math.PI/20);for(let T=1;T2*p){let F=d.add(m.sub(d)._mult(p/L)._round());this.updateDistance(d,F),this.addCurrentVertex(F,x,0,0,f),d=F}}}}addCurrentVertex(t,e,r,i,n,a=!1){let s=e.x+e.y*r,o=e.y-e.x*r,l=-e.x+e.y*i,u=-e.y-e.x*i;this.addHalfVertex(t,s,o,a,!1,r,n),this.addHalfVertex(t,l,u,a,!0,-i,n),this.distance>fc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,r,i,n,a))}addHalfVertex({x:t,y:e},r,i,n,a,s,o){let l=(this.lineClips?this.scaledDistance*(fc-1):this.scaledDistance)*Id;if(this.layoutVertexArray.emplaceBack((t<<1)+ +!!n,(e<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*i)+128,(s===0?0:s<0?-1:1)+1|(l&63)<<2,l>>6),this.lineClips){let h=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(let e of t){let r=e.paint.get("line-dasharray");if(r&&!r.isConstant())return!0}return!1}addLineDashDependencies(t,e,r,i){for(let n of t){let a=n.paint.get("line-dasharray");if(!a||a.value.kind==="constant")continue;let s=n.layout.get("line-cap").evaluate(e,{})==="round",o={dasharray:a.value.evaluate({zoom:r-1},e,{}),round:s},l={dasharray:a.value.evaluate({zoom:r},e,{}),round:s},u={dasharray:a.value.evaluate({zoom:r+1},e,{}),round:s},h=`${o.dasharray.join(",")},${o.round}`,c=`${l.dasharray.join(",")},${l.round}`,p=`${u.dasharray.join(",")},${u.round}`;i.dashDependencies[h]=o,i.dashDependencies[c]=l,i.dashDependencies[p]=u,e.dashes[n.id]={min:h,mid:c,max:p}}}};C("LineBucket",Cd,{omit:["layers","patternFeatures"]});var $2,N2=()=>$2||($2=new Xt({"line-cap":new N(w.layout_line["line-cap"],"line-cap"),"line-join":new N(w.layout_line["line-join"],"line-join"),"line-miter-limit":new N(w.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new N(w.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new N(w.layout_line["line-sort-key"],"line-sort-key")})),U2,q2=()=>U2||(U2=new Xt({"line-opacity":new N(w.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new V(w.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new N(w.paint_line["line-color"],"line-color"),"line-translate":new V(w.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new V(w.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new N(w.paint_line["line-width"],"line-width"),"line-gap-width":new N(w.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new N(w.paint_line["line-offset"],"line-offset"),"line-blur":new N(w.paint_line["line-blur"],"line-blur"),"line-dasharray":new on(w.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new on(w.paint_line["line-pattern"],"line-pattern"),"line-gradient":new Wa(w.paint_line["line-gradient"],"line-gradient")})),dc={get paint(){return q2()},get layout(){return N2()}},j2=class extends N{possiblyEvaluate(t,e){return e=new st(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,i){return e=Gt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,i)}},Qn;var G2=class extends de{constructor(t,e){super(t,dc,e),this.gradientVersion=0,Qn||(Qn=new j2(dc.paint.properties["line-width"].specification,"line-floorwidth"),Qn.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let e=this.gradientExpression();this.stepInterpolant=lm(e)?e._styleExpression.expression instanceof vl:!1,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Qn.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Cd(t)}queryRadius(t){let e=t,r=yc(Wr("line-width",this,e),Wr("line-gap-width",this,e)),i=Wr("line-offset",this,e);return r/2+Math.abs(i)+Ha(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a}){let s=Ka(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-n.bearingInRadians,a),o=a/2*yc(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(i=Dg(i,l*a)),mg(s,i,o)}isTileClipped(){return!0}};function yc(t,e){return e>0?e+2*t:t}var X2=At([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),Y2=At([{name:"a_projected_pos",components:3,type:"Float32"}],4);At([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);var W2=At([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);At([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);var mc=At([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),x5=At([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);At([{name:"triangle",components:3,type:"Uint16"}]),At([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Float32",name:"heightOffset"}]),At([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"},{type:"Float32",name:"heightOffset"}]),At([{type:"Float32",name:"offsetX"}]),At([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),At([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wr=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(wr.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,e){return rt(this,null,function*(){if(this.isParsed())return this.getState();if(t.pluginStatus!=="loading")return this.setState(t),t;let r=t.pluginURL,i=new Promise(a=>{this.loadScriptResolve=a}),n=new Promise(a=>setTimeout(()=>a(),this.TIMEOUT));if(yield e(r),yield Promise.race([i,n]),this.isParsed()){let a={pluginStatus:"loaded",pluginURL:r};return this.setState(a),a}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)})}};function Z2(t){return/[\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u077F\\u07C0-\\u07FA\\u07FD-\\u07FF\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\u1800\\u1801\\u1804\\u1806-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\uA840-\\uA877\\uFB50-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF80-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE60-\\uDE7E\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDEFF\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB]|\\uD805[\\uDE60-\\uDE6C]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9C-\\uDC9F]|\\uD83A[\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function H2(t){return/[\\u0591-\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F4\\u0600-\\u0604\\u0606-\\u060B\\u060D-\\u061A\\u061C-\\u061E\\u0620-\\u063F\\u0641-\\u064A\\u0656-\\u066F\\u0671-\\u06DC\\u06DE-\\u070D\\u070F-\\u074A\\u074D-\\u07B1\\u07C0-\\u07FA\\u07FD-\\u082D\\u0830-\\u083E\\u0840-\\u085B\\u085E\\u0860-\\u086A\\u0870-\\u0891\\u0897-\\u08E1\\u08E3-\\u08FF\\uFB1D-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFD3D\\uFD40-\\uFDCF\\uFDF0-\\uFDFF\\uFE70-\\uFE74\\uFE76-\\uFEFC]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC57-\\uDC9E\\uDCA7-\\uDCAF\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDCFB-\\uDD1B\\uDD1F-\\uDD39\\uDD3F-\\uDD59\\uDD80-\\uDDB7\\uDDBC-\\uDDCF\\uDDD2-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F-\\uDE48\\uDE50-\\uDE58\\uDE60-\\uDE9F\\uDEC0-\\uDEE6\\uDEEB-\\uDEF6\\uDF00-\\uDF35\\uDF39-\\uDF55\\uDF58-\\uDF72\\uDF78-\\uDF91\\uDF99-\\uDF9C\\uDFA9-\\uDFAF]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDCFA-\\uDD27\\uDD30-\\uDD39\\uDD40-\\uDD65\\uDD69-\\uDD85\\uDD8E\\uDD8F\\uDE60-\\uDE7E\\uDE80-\\uDEA9\\uDEAB-\\uDEAD\\uDEB0\\uDEB1\\uDEC2-\\uDEC7\\uDED0-\\uDED8\\uDEFA-\\uDF27\\uDF30-\\uDF59\\uDF70-\\uDF89\\uDFB0-\\uDFCB\\uDFE0-\\uDFF6]|\\uD83A[\\uDC00-\\uDCC4\\uDCC7-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59\\uDD5E\\uDD5F]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB\\uDEF0\\uDEF1]/gim.test(String.fromCodePoint(t))}function K2(t){return/[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(t))}function Qa(t){return/[\\u02EA\\u02EB\\u1100-\\u11FF\\u1401-\\u167F\\u18B0-\\u18FF\\u2065\\u20DD-\\u20E0\\u20E2-\\u20E4\\u2B97\\u2BF0-\\u2BFF\\u2E50\\u2E51\\u2E80-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u30FB\\u30FD-\\uA4CF\\uA960-\\uA97F\\uAC00-\\uD7FF\\uF900-\\uFAFF\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7\\uFFF0-\\uFFF8]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|[\\uD80C-\\uD810\\uD81C-\\uD822\\uD83C\\uD83D\\uD840-\\uD87E\\uD880-\\uD8BE][\\uDC00-\\uDFFF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFFF]|\\uD823[\\uDC00-\\uDDFF]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFF]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83E[\\uDD00-\\uDEFF]|[\\uD87F\\uD8BF][\\uDC00-\\uDFFD]/gim.test(String.fromCodePoint(t))}function J2(t){return/[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(t))}function Q2(t){return/[\\r\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0600-\\u0605\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DD\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u070F\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0890\\u0891\\u0897-\\u089F\\u08CA-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D62\\u0D63\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E33-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB3-\\u0EBC\\u0EC8-\\u0ECE\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1037\\u1039-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1084-\\u1086\\u108D\\u109D\\u1100-\\u11FF\\u135D-\\u135F\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u180F\\u1885\\u1886\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A7C\\u1A7F\\u1AB0-\\u1ADD\\u1AE0-\\u1AEB\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8E0-\\uA8F1\\uA8FF\\uA926-\\uA92D\\uA947-\\uA953\\uA960-\\uA97C\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFF9E\\uFF9F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD69-\\uDD6D\\uDEAB\\uDEAC\\uDEFA-\\uDEFF\\uDF46-\\uDF50\\uDF82-\\uDF85]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC70\\uDC73\\uDC74\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCBD\\uDCC2\\uDCCD\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC2\\uDDC3\\uDDC9-\\uDDCC\\uDDCE\\uDDCF\\uDE2C-\\uDE37\\uDE3E\\uDE41\\uDEDF-\\uDEEA\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74\\uDFB8-\\uDFC0\\uDFC2\\uDFC5\\uDFC7-\\uDFCA\\uDFCC-\\uDFD2\\uDFE1\\uDFE2]|\\uD805[\\uDC35-\\uDC46\\uDC5E\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDEAB-\\uDEB7\\uDF1D-\\uDF1F\\uDF22-\\uDF2B]|\\uD806[\\uDC2C-\\uDC3A\\uDD30-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDDD1-\\uDDD7\\uDDDA-\\uDDE0\\uDDE4\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE84-\\uDE99\\uDF60-\\uDF67]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDEF3-\\uDEF6\\uDF00-\\uDF03\\uDF34-\\uDF3A\\uDF3E-\\uDF42\\uDF5A]|\\uD80D[\\uDC40\\uDC47-\\uDC55]|\\uD818[\\uDD1E-\\uDD2F]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDD63\\uDD67-\\uDD6A\\uDF4F\\uDF51-\\uDF87\\uDF8F-\\uDF92\\uDFE4\\uDFF0\\uDFF1]|\\uD82F[\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDC8F\\uDD30-\\uDD36\\uDEAE\\uDEEC-\\uDEEF]|\\uD839[\\uDCEC-\\uDCEF\\uDDEE\\uDDEF\\uDEE3\\uDEE6\\uDEEE\\uDEEF\\uDEF5]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A]|\\uD83C[\\uDDE6-\\uDDFF\\uDFFB-\\uDFFF]|\\uDB40[\\uDC20-\\uDC7F\\uDD00-\\uDDEF]/.test(t)}function gc(t){return/[\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECE\\u0EDC-\\u0EDF\\u0F00-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F97\\u0F99-\\u0FBC\\u0FBE-\\u0FCC\\u0FCE-\\u0FD4\\u0FD9\\u0FDA\\u1000-\\u103F\\u1050-\\u108F\\u109A-\\u109F\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19DE\\u19DF\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1AA0-\\u1AAD\\u1B00-\\u1B4C\\u1B4E-\\u1B7F\\uA980-\\uA9CD\\uA9D0-\\uA9D9\\uA9DE-\\uA9EF\\uA9FA-\\uA9FE\\uAA60-\\uAAC2\\uAADB-\\uAADF]|\\uD805[\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF3A\\uDF3B\\uDF3F-\\uDF46]/gim.test(String.fromCodePoint(t))}function tv(t,e){return/(?:[\\u1039\\u17D2\\u1A60\\u1BAB\\u200D\\uAAF6]|\\uD802\\uDE3F|\\uD804[\\uDD33\\uDFD0]|\\uD806[\\uDD3E\\uDE47\\uDE99]|\\uD807[\\uDD45\\uDD97\\uDF42])$/.test(t)||new RegExp("^\\\\p{gc=Mc}","u").test(e)}var ev={C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"},rv={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},iv={\\u0644\\u0622:[65269,65270],\\u0644\\u0623:[65271,65272],\\u0644\\u0625:[65273,65274],\\u0644\\u0627:[65275,65276]},xc=1604,nv=/[\\u0600-\\u06ff\\u0750-\\u077f\\u0870-\\u089f\\u08a0-\\u08ff\\ufb50-\\ufdff\\ufe70-\\ufeff]/;function av(t,e,r){let i=0;for(let n of t.split(";")){let[a,s]=n.split(",").map(l=>parseInt(l,36)),o=i+a;for(let l=o;l{let r=e.codePointAt(0);return{codePoint:r,type:sv(r),form:null}})}function cv(t){let e=t.filter(r=>r.type!=="T");for(let r=0;r0&&ov(e[r-1].type),a=r+1String.fromCodePoint(dv(r))).join("")}function mv(t,e,r){var n;let i=e.layout.get("text-transform").evaluate(r,{});return i==="uppercase"?t=t.toLocaleUpperCase():i==="lowercase"&&(t=t.toLocaleLowerCase()),((n=wr.applyArabicShaping)!=null?n:yv)(t)}function gv(t,e,r){for(let i of t.sections)i.text=mv(i.text,e,r);return t}function xv(t){let e={},r={},i=[],n=0;function a(u){i.push(t[u]),n++}function s(u,h,c){let p=r[u];return delete r[u],r[h]=p,i[p].geometry[0].pop(),i[p].geometry[0]=i[p].geometry[0].concat(c[0]),p}function o(u,h,c){let p=e[h];return delete e[h],e[u]=p,i[p].geometry[0].shift(),i[p].geometry[0]=c[0].concat(i[p].geometry[0]),p}function l(u,h,c){let p=c?h[0][h[0].length-1]:h[0][0];return`${u}:${p.x}:${p.y}`}for(let u=0;uu.geometry)}var Bd=typeof Intl<"u"&&"Segmenter"in Intl,ta,ea;function tl(t){if(!Bd||!Q2(t))return[...t];ta!=null||(ta=new Intl.Segmenter(void 0,{granularity:"grapheme"}));let e=[];for(let{segment:r}of ta.segment(t)){let i=e.length-1;i>=0&&tv(e[i],r)?e[i]+=r:e.push(r)}return e}function vv(t){let e=new Set;if(Bd){ea!=null||(ea=new Intl.Segmenter(void 0,{granularity:"word"}));for(let{index:i}of ea.segment(t))e.add(i);return e}let r=0;for(let i of t.split(new RegExp("\\\\b|(?=\\\\p{Ideo})","u")))e.add(r),r+=i.length;return e}function Pd(t){let e=t.codePointAt(0);return t.length>(e>65535?2:1)}function ru(t){return/\\s/u.test(String.fromCodePoint(t))}function el(t){for(let e of t)if(Qa(e.codePointAt(0)))return!0;return!1}function bv(t){for(let e of t)if(!wv(e.codePointAt(0)))return!1;return!0}function wv(t){return!Z2(t)}function vc(t){return!(Qa(t)||J2(t))}function zd(t){return new RegExp("\\\\p{sc=Arab}","u").test(String.fromCodePoint(t))}function Ld(t){return H2(t)}function Vd(t){for(let e of t)if(Ld(e.codePointAt(0)))return!0;return!1}var Gr={"!":"\\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","\\u22EF":"\\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"};function Dv(t){let e="",r={premature:!0,value:void 0},i=t[Symbol.iterator](),n=i.next(),a=t[Symbol.iterator]();a.next();let s=a.next();for(;!n.done;)(s.done||!vc(s.value.codePointAt(0))||Gr[s.value])&&(r.premature||!vc(r.value.codePointAt(0))||Gr[r.value])&&Gr[n.value]?e+=Gr[n.value]:e+=n.value,r={value:n.value,premature:!1},n=i.next(),s=a.next();return e}var _v={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Av={40:!0};function bc(t,e,r,i,n,a){if("fontStack"in e){let s=r[e.fontStack],o=s==null?void 0:s[t];if(o)return o.metrics.advance*e.scale+n;let l=0;for(let u of t){let h=s==null?void 0:s[u];h&&(l+=h.metrics.advance*e.scale+n)}return l}{let s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}}function wc(t,e,r,i){let n=(t-e)**2;return i?tr&&Dc(e[i-1]);)i--;this.text=e.slice(r,i).join(""),this.sectionIndex=this.sectionIndex.slice(r,i),this._graphemes=null}substring(e,r){let i=this.graphemes().slice(e,r).join(""),n=this.sectionIndex.slice(e,r);return new rl(i,this.sections,n)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,i=0;for(let n=0;n0?i[i.length-1]:"",a=tl(n+e);this.text+=e,this._graphemes=i.slice(0,n?-1:void 0).concat(a);let s=a.length-+!!n;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,r,i,n,a){let s=[],o=this.determineAverageLineWidth(e,r,i,n,a),l=this.hasZeroWidthSpaces(),u=this.graphemes(),h=null,c=0,p=0;for(let f=0;f0){let y=u[f-1].codePointAt(0),m=d.codePointAt(0),g=K2(y),x=gc(y)&&gc(m);(_v[y]||g||"imageName"in this.getSection(f-1)||u[f+1]!==void 0&&Av[m]||x&&(h!=null?h:h=vv(this.text)).has(p))&&s.push(_c(f,c,o,s,Sv(y,m,g&&l),!1))}ru(d.codePointAt(0))||(c+=bc(d,this.getSection(f),i,n,e,a)),p+=d.length}return Od(_c(this.length(),c,o,s,0,!0))}determineAverageLineWidth(e,r,i,n,a){let s=0,o=0;for(let u of this.graphemes()){let h=this.getSection(o);s+=bc(u,h,i,n,e,a),o++}let l=Math.max(1,Math.ceil(s/r));return s/l}};function Ev(){return(function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},i={};r.L=1,i[1]="L",Object.keys(e).forEach(function(R,J){r[R]=1<1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function d(R,J){var W=0,M=new Map,ut=J&&new Map,X;return R.split(",").forEach(function G(K){if(K.indexOf("+")!==-1)for(var Nt=+K;Nt--;)G(X);else{X=K;var vt=K.split(">"),nt=vt[0],Tt=vt[1];nt=String.fromCodePoint(W+=parseInt(nt,36)),Tt=String.fromCodePoint(W+=parseInt(Tt,36)),M.set(nt,Tt),J&&ut.set(Tt,nt)}}),{map:M,reverseMap:ut}}var y,m,g;function x(){if(!y){var R=d(f.pairs,!0),J=R.map,W=R.reverseMap;y=J,m=W,g=d(f.canonical,!1).map}}function v(R){return x(),y.get(R)||null}function b(R){return x(),m.get(R)||null}function D(R){return x(),g.get(R)||null}var A=r.L,_=r.R,S=r.EN,k=r.ES,z=r.ET,O=r.AN,P=r.CS,L=r.B,F=r.S,$=r.ON,U=r.BN,T=r.NSM,q=r.AL,at=r.LRO,ot=r.RLO,pt=r.LRE,Et=r.RLE,qt=r.PDF,Ht=r.LRI,Ve=r.RLI,ye=r.FSI,Kt=r.PDI;function Oe(R,J){for(var W=125,M=new Uint32Array(R.length),ut=0;ut0)Fe--;else if(rs>0){for(Ne=0;!lt[lt.length-1]._isolate;)lt.pop();var is=lt[lt.length-1]._isolInitIndex;is!=null&&(Nt.set(is,zt),Nt.set(zt,is)),lt.pop(),rs--}bt=lt[lt.length-1],K[zt]=bt._level,bt._override&&G(zt,bt._override)}else Lt&qt?(Fe===0&&(Ne>0?Ne--:!bt._isolate&<.length>1&&(lt.pop(),bt=lt[lt.length-1])),K[zt]=bt._level):Lt&L&&(K[zt]=nt.level);else K[zt]=bt._level,bt._override&&Lt!==U&&G(zt,bt._override)}for(var Cr=[],me=null,ar=nt.start;ar<=nt.end;ar++){var ns=M[ar];if(!(ns&o)){var Bu=K[ar],Pu=ns&n,Wy=ns===Kt;me&&Bu===me._level?(me._end=ar,me._endsWithIsolInit=Pu):Cr.push(me={_start:ar,_end:ar,_level:Bu,_startsWithPDI:Wy,_endsWithIsolInit:Pu})}}for(var as=[],Sn=0;Sn=0;kn--)if(!(M[kn]&o)){Vu=K[kn];break}var us=Mr[Mr.length-1],Hy=K[us],Ou=nt.level;if(!(M[us]&n)){for(var Tn=us+1;Tn<=nt.end;Tn++)if(!(M[Tn]&o)){Ou=K[Tn];break}}as.push({_seqIndices:Mr,_sosType:Math.max(Vu,Zy)%2?_:A,_eosType:Math.max(Ou,Hy)%2?_:A})}}for(var hs=0;hs=0;Cn--)if(!(M[j[Cn]]&o)){ps=M[j[Cn]];break}G(Ru,ps&(n|Kt)?$:ps)}}if(X.get(S))for(var Mn=0;Mn=-1;Bn--){var Nu=Bn===-1?yi:M[j[Bn]];if(Nu&a){Nu===q&&G($u,O);break}}}if(X.get(q))for(var fs=0;fs=0&&(Pr=M[j[ms]],Pr&o);ms--);for(var gs=mi+1;gs=0&&M[j[Pn]]&(z|o);Pn--)G(j[Pn],S);for(ge++;ge=0&&M[j[zn]]&o;zn--)G(j[zn],$);for(var Ln=gi+1;Ln=0;bi--){var bs=zr[bi].char;if(bs===Yu||bs===b(D(vi))||v(D(bs))===vi){Vn.push([zr[bi].seqIndex,Lr]),zr.length=bi;break}}}Vn.sort(function(Yt,ue){return Yt[0]-ue[0]});for(var ws=0;ws=0;As--){var Ju=j[As];if(M[Ju]&Xu){var Qu=M[Ju]&xi?_:A;xe=Qu===Br?Br:Qu;break}}}if(xe){if(M[j[On]]=M[j[Ds]]=xe,xe!==Br){for(var wi=On+1;wi=0;_i--)if(M[j[_i]]&o)th=_i;else{Es=M[j[_i]]&xi?_:A;break}for(var eh=Ky,Ai=Ue+1;Ai=0&&c(R[$n])&l;$n--)K[$n]=nt.level}}return{levels:K,paragraphs:vt};function rh(Yt,ue){for(var Wt=Yt;Wt=K&&c(R[nt])&l;nt--)vt[nt]=G.level;for(var Tt=G.level,di=1/0,nr=0;nrTt&&(Tt=Re),Re=di;$e--)for(var lt=0;lt=$e){for(var bt=lt;lt+1=$e;)lt++;lt>bt&&X.push([bt+K,lt+K])}}}),X}function Tr(R,J,W,M){var ut=Ir(R,J,W,M),X=[].concat(R);return ut.forEach(function(G,K){X[K]=(J.levels[G]&1?kt(R[G]):null)||R[G]}),X.join("")}function Ir(R,J,W,M){for(var ut=ir(R,J,W,M),X=[],G=0;G=0;i--){let n=nu.getBidiCharTypeName(t[i].text[0]);Tv.has(n)?(t[i].level=e,r=!0):r&&kv.has(n)?t[i].level=e:r=!1}}function Mv(t,e){let r=e,i=1/0;for(let{level:a}of t)a>r&&(r=a),(a|1)=i;a--)for(let s=0;s=a;)o++;for(let l=s,u=o;le>=n.start&&e<=n.end))==null?void 0:r.level)!=null?i:0}function zv(t,e,r,i,n){let a=Iv(t,e,i,n);Cv(a,r);let s="",o=[];for(let l of Mv(a,r)){if(Fv.test(l.text))continue;let u=Bv(l);s+=u,o.push(...Array(u.length).fill(l.index))}return{text:s,sourceIndices:o}}function Lv(t,e){let r=e.filter(a=>a>0&&aa-s),n=[];for(let a=0;a+1n.start))).map(([n,a])=>zv(t,r,Pv(i,n),n,a))}function Vv(t,e){return Rd(t,e).map(r=>r.text)}function Ov(t,e,r){return Rd(t,r).map(i=>[i.text,i.sourceIndices.map(n=>{var a;return(a=e[n])!=null?a:0})])}var il=4294967296,Ac=1/il,Sc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),au=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,e,r=this.length){let i;for(;i=this.nextField(r);)t(i,e,this);return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*il;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*il;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let e=this.buf,r=e[this.pos++];if(r<128)return r;let i=r&127,n;return n=e[this.pos++],i|=(n&127)<<7,n<128||(n=e[this.pos++],i|=(n&127)<<14,n<128)||(n=e[this.pos++],i|=(n&127)<<21,n<128)?i:(n=e[this.pos],i|=(n&15)<<28,$v(i,t,this))}readSVarint(){let t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Sc?Sc.decode(this.buf.subarray(e,t)):tb(this.buf,e,t)}readBytes(){let t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){let r=this.readPackedEnd();for(;this.pos=t)return 0;let e=this.readVarint();return this.type=e&7,this._valueStart=this.pos,e>>>3}skip(t){let e=t&7;if(e===0)for(;this.buf[this.pos++]>127;);else if(e===2)this.pos=this.readVarint()+this.pos;else if(e===5)this.pos+=4;else if(e===1)this.pos+=8;else throw Error(`Unimplemented type: ${e}`)}},Rv=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e=0&&t<128){this.pos>=this.length&&this.realloc(1),this.buf[this.pos++]=t;return}if(t>268435455||t<0){Uv(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let e=this.pos;this.pos=eb(this.buf,t,this.pos);let r=this.pos-e;r>=128&&Ec(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let e=t.length;this.writeVarint(e),this.realloc(e),this.buf.set(t,this.pos),this.pos+=e}writeRawMessage(t,e){this.pos++;let r=this.pos;t(e,this);let i=this.pos-r;i>=128&&Ec(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,r){this.writeTag(t,2),this.writeRawMessage(e,r)}writePackedVarint(t,e){e.length&&this.writeMessage(t,Gv,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,Xv,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,Zv,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,Yv,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,Wv,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,Hv,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Kv,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,Jv,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,Qv,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}};function $v(t,e,r){let i=r.buf,n,a;if(a=i[r.pos++],n=(a&112)>>4,a<128||(a=i[r.pos++],n|=(a&127)<<3,a<128)||(a=i[r.pos++],n|=(a&127)<<10,a<128)||(a=i[r.pos++],n|=(a&127)<<17,a<128)||(a=i[r.pos++],n|=(a&127)<<24,a<128)||(a=i[r.pos++],n|=(a&1)<<31,a<128))return Nv(t,n,e);throw Error("Expected varint not more than 10 bytes")}function Nv(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Uv(t,e){let r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(r=~(-t%4294967296),i=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),qv(r,i,e),jv(i,e)}function qv(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}function jv(t,e){let r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function Ec(t,e,r){let i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(i),r.buf.copyWithin(t+i,t,r.pos)}function Gv(t,e){let r=t.length,i=e.buf,n=e.pos,a=e.length;for(let s=0;sa){e.pos=n,e.writeVarint(o),i=e.buf,n=e.pos,a=e.length;continue}for(;o>127;)i[n++]=o%128|128,o=Math.floor(o/128);i[n++]=o}e.pos=n}function Xv(t,e){for(let r=0;r239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function eb(t,e,r){for(let i=0,n,a;i55295&&n<57344)if(a){if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else{n>56319||i+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):a=n;continue}else a&&(a=(t[r++]=239,t[r++]=191,t[r++]=189,null));n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=n&63|128)}return r}function rb(t){return typeof(t==null?void 0:t.renderWithWebGL)=="function"}function su(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,o)=>o.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],n=0,a=0;for(let s of t)for(let o=i.length-1;o>=0;o--){let l=i[o];if(!(s.w>l.w||s.h>l.h)){if(s.x=l.x,s.y=l.y,a=Math.max(a,s.y+s.h),n=Math.max(n,s.x+s.w),s.w===l.w&&s.h===l.h){let u=i.pop();u&&o=r;a--)e.push(a);r=i+1}else{for(let a=r;at.toCodeUnitIndex(a)),i=wr.isParsed()?wr:null;if(t.sections.length===1)return i?i.processBidirectionalText(t.toString(),r).map(a=>kc(a,t.sections,[...a].map(()=>0))):Vv(t.toString(),r).map(a=>nl([...a],t.sections,[...a].map(()=>0)));let n=sb(t);return i?i.processStyledBidirectionalText(t.text,n,r).map(([a,s])=>kc(a,t.sections,s)):Ov(t.text,n,r).map(([a,s])=>{let o=[...a];return nl(o,t.sections,Ud(o).map(l=>{var u;return(u=s[l])!=null?u:0}))})}function nl(t,e,r){var a;let i=new iu(t.join(""),e,[]),n=0;for(let s of i.graphemes())i.sectionIndex.push((a=r[n])!=null?a:0),n+=[...s].length;return i}function Ud(t){let e=[],r=0;for(let i of t)e.push(r),r+=i.length;return e}function kc(t,e,r){let i=[...t],n=Ud(i),a=ab(i);return nl(a.map(s=>i[s]),e,a.map(s=>{var o;return(o=r[n[s]])!=null?o:0}))}function ra(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d){let y=iu.fromFeature(t,n);c===2&&y.verticalizePunctuation();let m=y.determineLineBreaks(u,a,e,i,f),g=Vd(y.text)?ob(y,m):nb(y,m),x=[],v={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return mb(v,e,r,i,g,s,o,l,c,u,p,d),!ib(x)&&v}function qd(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function lb(t,e,r){let i=e.getMaxScale()*24,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function jd(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}function ub(t,e,r,i){var a;if(t!=null&&t.rect)return t;let n=(a=e[r.fontStack])==null?void 0:a[i];return n?{rect:null,metrics:n.metrics}:null}function hb(t,e,r){return!(t===1||!e&&!Qa(r)||e&&(ru(r)||zd(r)))}function da(t){return new RegExp("\\\\p{Nd}","u").test(String.fromCodePoint(t))}function Gd(t){return new RegExp("\\\\p{Lu}","u").test(String.fromCodePoint(t))}function cb(t){return/[\\p{P}\\p{S}]/u.test(String.fromCodePoint(t))}function pb(t){let e=t.some(da)&&t.every(i=>da(i)||cb(i)),r=t.length<=3&&t.every(i=>Gd(i)||da(i));return e||r}function fb(t){return(da(t)||Gd(t))&&!zd(t)}function db(t,e){let r=!1;for(let i=0;ia.codePointAt(0)),i=r.map(Qa),n=a=>!i[a]&&!ru(r[a])&&!("imageName"in t.getSection(a));for(let a=0;au){let p=Math.ceil(i/u);r*=p/n,n=p}return{x1:e,y1:r,x2:e+i,y2:r+n}}function Tc(t,e,r,i,n,a){let s=t.image,o;if(s.content){let m=s.content,g=s.pixelRatio||1;o=[m[0]/g,m[1]/g,s.displaySize[0]-m[2]/g,s.displaySize[1]-m[3]/g]}let l=e.left*a,u=e.right*a,h,c,p,f;r==="width"||r==="both"?(f=n[0]+l-i[3],c=n[0]+u+i[1]):(f=n[0]+(l+u-s.displaySize[0])/2,c=f+s.displaySize[0]);let d=e.top*a,y=e.bottom*a;return r==="height"||r==="both"?(h=n[1]+d-i[0],p=n[1]+y+i[2]):(h=n[1]+(d+y-s.displaySize[1])/2,p=h+s.displaySize[1]),{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}var Ic=32640;function Cc(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new st(t+1))};if(r.kind==="source")return{kind:"source"};if(r.kind==="composite"){let{minZoom:i,maxZoom:n}=Db(r.zoomStops,t);return{kind:"composite",minZoom:i,maxZoom:n,interpolationType:r.interpolationType}}{let i=_b(r),n=r.evaluate(new st(t+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:i,layoutSize:n,interpolationType:r.interpolationType}}}function Db(t,e){let r=0;for(;rt.evaluate(new st(e===-1/0?t.zoomStops[1]-1:e)))}var Jr=class Yd extends B{constructor(e,r,i,n){super(e,r),this.angle=i,n!==void 0&&(this.segment=n)}clone(){return new Yd(this.x,this.y,this.angle,this.segment)}};C("Anchor",Jr);function Wd(t,e,r,i,n){if(e.segment===void 0||r===0)return!0;let a=e,s=e.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=t[s].dist(a),a=t[s]}o+=t[s].dist(t[s+1]),s++;let l=[],u=0;for(;oi;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=c.dist(p)}return!0}function Zd(t){let e=0;for(let r=0;ru){let d=(u-l)/f,y=new Jr(gr.number(c.x,p.x,d),gr.number(c.y,p.y,d),p.angleTo(c),h);return y._round(),!s||Wd(t,y,o,s,e)?y:void 0}l+=f}}function Sb(t,e,r,i,n,a,s,o,l){let u=Hd(i,a,s),h=Kd(i,n),c=h*s,p=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;e-c=0&&b=0&&D=0&&p+u<=h){let A=new Jr(b,D,x,d);A._round(),(!i||Wd(t,A,a,i,n))&&f.push(A)}}c+=g}return!o&&!f.length&&!s&&(f=Jd(t,c/2,r,i,n,a,s,!0,l)),f}function Eb(t,e,r,i,n){let a=[];for(let s of t){let o;for(let l=0;l=i&&h.x>=i)&&(u.x>=i?u=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round():h.x>=i&&(h=new B(i,u.y+(h.y-u.y)*((i-u.x)/(h.x-u.x)))._round()),!(u.y>=n&&h.y>=n)&&(u.y>=n?u=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round():h.y>=n&&(h=new B(u.x+(h.x-u.x)*((n-u.y)/(h.y-u.y)),n)._round()),(!o||!u.equals(o[o.length-1]))&&(o=[u],a.push(o)),o.push(h)))))}}return a}function Qd(t,e,r,i,n,a){let s=Mc(t,e,r,n,0);return s=Mc(s,e,i,a,1),s}function Mc(t,e,r,i,n){switch(e){case 1:return Fb(t,r,i,n);case 2:return Bc(t,r,i,n,!1);case 3:return Bc(t,r,i,n,!0)}return[]}function Fb(t,e,r,i){let n=[];for(let a of t)for(let s of a){let o=i===0?s.x:s.y;o>=e&&o<=r&&n.push([s])}return n}function kb(t,e,r,i,n){let a=i===0?Tb:Ib,s=[],o=[];for(let h=0;he&&s.push(a(c,p,e)):f>r?d=e&&(s.push(a(c,p,e)),y=!0),d>r&&f<=r&&(s.push(a(c,p,r)),y=!0),!n&&y&&(o.push(s),s=[])}let l=t.length-1,u=i===0?t[l].x:t[l].y;return u>=e&&u<=r&&s.push(t[l]),n&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new B(s[0].x,s[0].y)),s.length>0&&o.push(s),o}function Bc(t,e,r,i,n){let a=[];for(let s of t){let o=kb(s,e,r,i,n);o.length>0&&a.push(...o)}return a}function Tb(t,e,r){let i=(r-t.x)/(e.x-t.x);return new B(r,t.y+(e.y-t.y)*i)}function Ib(t,e,r){let i=(r-t.y)/(e.y-t.y);return new B(t.x+(e.x-t.x)*i,r)}function Pc(t,e,r,i){let n=[],a=t.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(F,$)=>F+$[1]-$[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,v=0,b=d,D=0,A=y,_=0,S=m;if(a.content&&i){let F=a.content,$=F[2]-F[0],U=F[3]-F[1];(a.textFitWidth||a.textFitHeight)&&(u=Xd(t)),g=ia(h,0,F[0]),v=ia(c,0,F[1]),x=ia(h,F[0],F[2]),b=ia(c,F[1],F[3]),D=F[0]-g,_=F[1]-v,A=$-x,S=U-b}let k=u.x1,z=u.y1,O=u.x2-k,P=u.y2-z,L=(F,$,U,T)=>{let q=na(F.stretch-g,x,O,k),at=aa(F.fixed-D,A,F.stretch,f),ot=na($.stretch-v,b,P,z),pt=aa($.fixed-_,S,$.stretch,d),Et=na(U.stretch-g,x,O,k),qt=aa(U.fixed-D,A,U.stretch,f),Ht=na(T.stretch-v,b,P,z),Ve=aa(T.fixed-_,S,T.stretch,d),ye=new B(q,ot),Kt=new B(Et,ot),Oe=new B(Et,Ht),kr=new B(q,Ht),rr=new B(at/s,pt/s),fi=new B(qt/s,Ve/s),kt=e*Math.PI/180;if(kt){let R=Math.sin(kt),J=Math.cos(kt),W=[J,-R,R,J];ye._matMult(W),Kt._matMult(W),kr._matMult(W),Oe._matMult(W)}let Ee=F.stretch+F.fixed,ir=U.stretch+U.fixed,Tr=$.stretch+$.fixed,Ir=T.stretch+T.fixed;return{tl:ye,tr:Kt,bl:kr,br:Oe,tex:{x:a.paddedRect.x+1+Ee,y:a.paddedRect.y+1+Tr,w:ir-Ee,h:Ir-Tr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:rr,pixelOffsetBR:fi,minFontScaleX:A/s/O,minFontScaleY:S/s/P,isSDF:r}};if(!i||!a.stretchX&&!a.stretchY)n.push(L({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));else{let F=zc(h,y,f),$=zc(c,m,d);for(let U=0;U0&&(d=Math.max(10,d),this.circleDiameter=d)}else{let c=(h=a.image)!=null&&h.content&&(a.image.textFitWidth||a.image.textFitHeight)?Xd(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-o[0],c.y2=c.y2*s+o[2],c.x1=c.x1*s-o[3],c.x2=c.x2*s+o[1];let p=a.collisionPadding;if(p&&(c.x1-=p[0]*s,c.y1-=p[1]*s,c.x2+=p[2]*s,c.y2+=p[3]*s),u){let f=new B(c.x1,c.y1),d=new B(c.x2,c.y1),y=new B(c.x1,c.y2),m=new B(c.x2,c.y2),g=u*Math.PI/180;f._rotate(g),d._rotate(g),y._rotate(g),m._rotate(g),c.x1=Math.min(f.x,d.x,y.x,m.x),c.x2=Math.max(f.x,d.x,y.x,m.x),c.y1=Math.min(f.y,d.y,y.y,m.y),c.y2=Math.max(f.y,d.y,y.y,m.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,i,n)}this.boxEndIndex=t.length}},Mb=class{constructor(t=[],e=(r,i)=>ri)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;let t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:e,compare:r}=this,i=e[t];for(;t>0;){let n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n}e[t]=i}_down(t){let{data:e,compare:r}=this,i=this.length>>1,n=e[t];for(;t=0)break;e[t]=e[a],t=a}e[t]=n}};function Bb(t,e=1){let r=Fa.fromPoints(t[0]),i=Math.min(r.width(),r.height()),n=i/2,a=new Mb([],Pb),{minX:s,minY:o,maxX:l,maxY:u}=r;if(i===0)return new B(s,o);for(let p=s;pc.d||!c.d)&&(c=p),!(p.max-c.d<=e)&&(n=p.h/2,a.push(new qr(p.p.x-n,p.p.y-n,n,t)),a.push(new qr(p.p.x+n,p.p.y-n,n,t)),a.push(new qr(p.p.x-n,p.p.y+n,n,t)),a.push(new qr(p.p.x+n,p.p.y+n,n,t)))}return h.d>0&&c.d-h.d<=e?h.p:c.p}function Pb(t,e){return e.max-t.max}var qr=class{constructor(t,e,r,i){this.p=new B(t,e),this.h=r,this.d=zb(this.p,i),this.max=this.d+this.h*Math.SQRT2}};function zb(t,e){let r=!1,i=1/0;for(let n of e)for(let a=0,s=n.length,o=s-1;at.y!=u.y>t.y&&t.x<(u.x-l.x)*(t.y-l.y)/(u.y-l.y)+l.x&&(r=!r),i=Math.min(i,td(t,l,u))}return(r?1:-1)*Math.sqrt(i)}function Lb(t){let e=0,r=0,i=0,n=t[0];for(let a=0,s=n.length,o=s-1;ap*24);h.startsWith("top")?c[1]-=7:h.startsWith("bottom")&&(c[1]+=7),l[u+1]=c}return new De(l)}let a=i.get("text-variable-anchor");if(a){let o;o=t._unevaluatedLayout.getValue("text-radial-offset")===void 0?i.get("text-offset").evaluate(e,{},r).map(u=>u*24):[i.get("text-radial-offset").evaluate(e,{},r)*24,lu];let l=[];for(let u of a)l.push(u,ty(u,o));return new De(l)}return null}function Ob(t){var h,c;t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=mt/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new st(t.bucket.zoom+1),t.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new st(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new st(p),t.canonical),n["text-size"].possiblyEvaluate(new st(f),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new st(p),t.canonical),n["icon-size"].possiblyEvaluate(new st(f),t.canonical)]}let s=i.get("text-line-height")*24,o=i.get("text-rotation-alignment")!=="viewport"&&i.get("symbol-placement")!=="point",l=i.get("text-keep-upright"),u=i.get("text-size");for(let p of t.bucket.features){let f=i.get("text-font").evaluate(p,{},t.canonical).join(","),d=u.evaluate(p,{},t.canonical),y=a.layoutTextSize.evaluate(p,{},t.canonical),m=a.layoutIconSize.evaluate(p,{},t.canonical),g={horizontal:{},vertical:void 0},x=p.text,v=[0,0];if(x){let _=x.toString(),S=i.get("text-letter-spacing").evaluate(p,{},t.canonical)*24,k=bv(_)?S:0,z=i.get("text-anchor").evaluate(p,{},t.canonical),O=ey(r,p,t.canonical);if(!O){let $=i.get("text-radial-offset").evaluate(p,{},t.canonical);v=$?ty(z,[$*24,lu]):i.get("text-offset").evaluate(p,{},t.canonical).map(U=>U*24)}let P=o?"center":i.get("text-justify").evaluate(p,{},t.canonical),L=i.get("symbol-placement")==="point"?i.get("text-max-width").evaluate(p,{},t.canonical)*24:1/0,F=()=>{t.bucket.allowVerticalPlacement&&el(_)&&(g.vertical=ra(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,L,s,z,"left",k,v,2,!0,y,d))};if(!o&&O){let $=new Set;if(P==="auto")for(let T=0;T{T.x<0||T.x>=8192||T.y<0||T.y>=8192||Nb(t,T,U,r,i,n,L,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,[D,D,D,D],S,l,v,A,k,d,e,a,u,h,s)};if(z==="line")for(let U of Eb(e.geometry,0,0,mt,mt)){let T=cr(U,F),q=Sb(T,b,_,r.vertical||y,i,24,x,t.overscaling,mt);for(let at of q){let ot=y;(!ot||!Ub(t,ot.text,O,at))&&$(T,at)}}else if(z==="line-center"){for(let U of e.geometry)if(U.length>1){let T=cr(U,F),q=Ab(T,_,r.vertical||y,i,24,x);q&&$(T,q)}}else if(e.type==="Polygon")for(let U of Ra(e.geometry,0)){let T=Bb(U,16);$(cr(U[0],F,!0),new Jr(T.x,T.y,0))}else if(e.type==="LineString")for(let U of e.geometry){let T=cr(U,F);$(T,new Jr(T[0].x,T[0].y,0))}else if(e.type==="Point")for(let U of e.geometry)for(let T of U)$([T],new Jr(T.x,T.y,0))}function $b(t,e){let r=t.length,i=e==null?void 0:e.values;if((i==null?void 0:i.length)>0)for(let n=0;n32640&&Bt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):g.kind==="composite"&&(x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)],(x[0]>32640||x[1]>32640)&&Bt(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,m,x,o,a,s,h,e,u.lineStartIndex,u.lineLength,f,y,l);for(let v of c)p[v]=t.text.placedSymbolArray.length-1;return m.length*4}function ry(t){for(let e in t)return t[e];return null}function Nb(t,e,r,i,n,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,D,A,_,S){let k=t.addToLineVertexArray(e,r),z=o.layout.get("symbol-height-offset").evaluate(b,{},_);z>t.maxHeightOffset&&(t.maxHeightOffset=z);let O,P,L,F,$=0,U=0,T=0,q=0,at=-1,ot=-1,pt={},Et=(0,Mo.default)("");if(t.allowVerticalPlacement&&i.vertical){let J=o.layout.get("text-rotate").evaluate(b,{},_)+90,W=i.vertical;L=new sa(l,e,u,h,c,W,p,f,d,J),s&&(F=new sa(l,e,u,h,c,s,m,g,d,J))}if(n){let J=o.layout.get("icon-rotate").evaluate(b,{}),W=o.layout.get("icon-text-fit")!=="none",M=Pc(n,J,A,W),ut=s?Pc(s,J,A,W):void 0;P=new sa(l,e,u,h,c,n,m,g,!1,J),$=M.length*4;let X=t.iconSizeData,G=null;X.kind==="source"?(G=[128*o.layout.get("icon-size").evaluate(b,{})],G[0]>32640&&Bt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):X.kind==="composite"&&(G=[128*D.compositeIconSizes[0].evaluate(b,{},_),128*D.compositeIconSizes[1].evaluate(b,{},_)],(G[0]>32640||G[1]>32640)&&Bt(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,M,G,v,x,b,0,e,k.lineStartIndex,k.lineLength,-1,_,z),at=t.icon.placedSymbolArray.length-1,ut&&(U=ut.length*4,t.addSymbols(t.icon,ut,G,v,x,b,2,e,k.lineStartIndex,k.lineLength,-1,_,z),ot=t.icon.placedSymbolArray.length-1)}let qt=Object.keys(i.horizontal);for(let J of qt){let W=i.horizontal[J];O||(O=(Et=(0,Mo.default)(W.text),new sa(l,e,u,h,c,W,p,f,d,o.layout.get("text-rotate").evaluate(b,{},_))));let M=W.positionedLines.length===1;if(T+=Vc(t,e,W,a,o,d,b,y,z,k,i.vertical?1:3,M?qt:[J],pt,at,D,_),M)break}i.vertical&&(q+=Vc(t,e,i.vertical,a,o,d,b,y,z,k,2,["vertical"],pt,ot,D,_));let Ht=O?O.boxStartIndex:t.collisionBoxArray.length,Ve=O?O.boxEndIndex:t.collisionBoxArray.length,ye=L?L.boxStartIndex:t.collisionBoxArray.length,Kt=L?L.boxEndIndex:t.collisionBoxArray.length,Oe=P?P.boxStartIndex:t.collisionBoxArray.length,kr=P?P.boxEndIndex:t.collisionBoxArray.length,rr=F?F.boxStartIndex:t.collisionBoxArray.length,fi=F?F.boxEndIndex:t.collisionBoxArray.length,kt=-1,Ee=(J,W)=>J!=null&&J.circleDiameter?Math.max(J.circleDiameter,W):W;kt=Ee(O,kt),kt=Ee(L,kt),kt=Ee(P,kt),kt=Ee(F,kt);let ir=+(kt>-1);ir&&(kt*=S/24),t.glyphOffsetArray.length>=t.maxGlyphs&&Bt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),b.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey);let Tr=ey(o,b,_),[Ir,R]=$b(t.textAnchorOffsets,Tr);t.symbolInstances.emplaceBack(e.x,e.y,pt.right>=0?pt.right:-1,pt.center>=0?pt.center:-1,pt.left>=0?pt.left:-1,pt.vertical||-1,at,ot,Et,Ht,Ve,ye,Kt,Oe,kr,rr,fi,u,T,q,$,U,ir,0,p,kt,Ir,R,z)}function Ub(t,e,r,i){let n=t.compareText;if(!(e in n))n[e]=[];else{let a=n[e];for(let s=a.length-1;s>=0;s--)if(i.dist(a[s])s.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Cc(this.zoom,e["text-size"]),this.iconSizeData=Cc(this.zoom,e["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap=Oc(r,"text-overlap","text-allow-overlap")!=="never"||Oc(r,"icon-overlap","icon-allow-overlap")!=="never"||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=n!=="viewport-y"&&!i.isConstant();let a=n==="viewport-y"||n==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(s=>Nd[s])),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id),this.sourceID=t.sourceID}createArrays(){this.text=new al(new vr(this.layers,this.zoom,t=>t.startsWith("text"))),this.icon=new al(new vr(this.layers,this.zoom,t=>t.startsWith("icon"))),this.glyphOffsetArray=new Uf,this.lineVertexArray=new qf,this.symbolInstances=new Nf,this.textAnchorOffsets=new Gf}calculateGlyphDependencies(t,e,r,i,n){var l;let a=(i||this.allowVerticalPlacement)&&n,s=iu.fromFeature(t,r),o=s.graphemes();for(let u=0;u0)&&(a.value.kind!=="constant"||a.value.value.length>0),u=o.value.kind!=="constant"||!!o.value.value||Object.keys(o.parameters).length>0,h=n.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let c=e.iconDependencies,p=e.glyphDependencies,f=e.availableImages,d=new st(this.zoom);for(let{feature:m,id:g,index:x,sourceLayerIndex:v}of t){let b=i._featureFilter.needGeometry,D=hi(m,b);if(!i._featureFilter.filter(d,D,r))continue;b||(D.geometry=Ar(m));let A;if(l){let z=i.getValueAndResolveTokens("text-field",D,r,f),O=ze.factory(z);this.hasRTLText||(this.hasRTLText=Gb(O)),A=gv(O,i,D)}let _;if(u){let z=i.getValueAndResolveTokens("icon-image",D,r,f);_=z instanceof _e?z:_e.fromString(z)}if(!A&&!_)continue;let S=this.sortFeaturesByKey?h.evaluate(D,{},r):void 0,k={id:g,text:A,icon:_,index:x,sourceLayerIndex:v,geometry:D.geometry,properties:m.properties,type:Dn.types[m.type],sortKey:S};if(this.features.push(k),_&&(c[_.name]=!0),A){let z=a.evaluate(D,{},r).join(","),O=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point";this.allowVerticalPlacement=(y=this.writingModes)==null?void 0:y.includes(2);let P=el(A.toString());this.calculateGlyphDependencies(A,p,z,O,P);for(let L of A.sections)L.image&&(c[L.image.name]=!0)}}n.get("symbol-placement")==="line"&&(this.features=xv(this.features)),this.sortFeaturesByKey&&this.features.sort((m,g)=>m.sortKey-g.sortKey)}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:r}))}addFeatures({options:t,canonical:e,glyphMap:r,glyphPositions:i,iconMap:n,iconPositions:a,showCollisionBoxes:s}){Ob({bucket:this,glyphMap:r,glyphPositions:i,imageMap:n,imagePositions:a,showCollisionBoxes:s,canonical:e,subdivisionGranularity:t.subdivisionGranularity})}isEmpty(){return this.symbolInstances.length===0}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){let r=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),a={};for(let s=t.segment+1;s=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=e[s-1].dist(e[s]));for(let s=0;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}addIndicesForPlacedSymbol(t,e){let r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+r.numGlyphs*4;for(let n=r.vertexStartIndex;ni[s]-i[o]||n[o]-n[s]),a}addToSortKeyRanges(t,e){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];(r==null?void 0:r.sortKey)===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let r=this.symbolInstances.get(e);this.featureSortOrder.push(r.featureIndex);let i=[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex];for(let n=0;n=0&&i.indexOf(a)===n&&this.addIndicesForPlacedSymbol(this.text,a)}r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};C("SymbolBucket",iy,{omit:["layers","collisionBoxArray","features","compareText"]});function Xb(t,e){return e.replace(/{([^{}]+)}/g,(r,i)=>t&&i in t?String(t[i]):"")}var Yb,Wb=()=>Yb||(Yb=new Xt({"symbol-placement":new V(w.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new V(w.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new V(w.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new N(w.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new V(w.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new V(w.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new V(w.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new V(w.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new V(w.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new N(w.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new N(w.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new V(w.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new V(w.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new N(w.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new N(w.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new N(w.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new V(w.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new N(w.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new N(w.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new V(w.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new V(w.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new V(w.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new N(w.layout_symbol["text-field"],"text-field"),"text-font":new N(w.layout_symbol["text-font"],"text-font"),"text-size":new N(w.layout_symbol["text-size"],"text-size"),"text-max-width":new N(w.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new V(w.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new N(w.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new N(w.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new N(w.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new V(w.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new N(w.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new N(w.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new V(w.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new V(w.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new N(w.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new V(w.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new V(w.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new N(w.layout_symbol["text-transform"],"text-transform"),"text-offset":new N(w.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new V(w.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new V(w.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new V(w.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new V(w.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new N(w.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new V(w.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})),Zb,Hb=()=>Zb||(Zb=new Xt({"icon-opacity":new N(w.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new N(w.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new N(w.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new N(w.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new N(w.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new V(w.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new V(w.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new N(w.paint_symbol["text-opacity"],"text-opacity"),"text-color":new N(w.paint_symbol["text-color"],"text-color",{runtimeType:ce,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new N(w.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new N(w.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new N(w.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new V(w.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new V(w.paint_symbol["text-translate-anchor"],"text-translate-anchor")})),Ys={get paint(){return Hb()},get layout(){return Wb()}},ny=class{constructor(t){if(t.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:dn,this.defaultValue=t}evaluate(t){if(t.formattedSection){let e=this.defaultValue.property.overrides;if(e!=null&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let e=this.defaultValue.value;t(e._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};C("FormatSectionOverride",ny,{omit:["defaultValue"]});var Kb=class ol extends de{constructor(e,r){super(e,Ys,r)}recalculate(e,r){super.recalculate(e,r);let i=this.layout.get("icon-rotation-alignment");if((i.value.kind!=="constant"||i.value.value==="auto")&&(this.layout._values["icon-rotation-alignment"]=new se(i.property,{kind:"constant",value:this.layout.get("symbol-placement")==="point"?"viewport":"map"},i.parameters)),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")==="point"?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let a=[];for(let s of n)a.includes(s)||a.push(s);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,i,n){let a=this.layout.get(e).evaluate(r,{},i,n),s=this._unevaluatedLayout._values[e];return!s.isDataDriven()&&!ja(s.value)&&a?Xb(r.properties,a):a}createBucket(e){return new iy(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Ys.paint.overridableProperties){if(!ol.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),i=new Il(new ny(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),n=null;n=r.value.kind==="constant"||r.value.kind==="source"?new an("source",i):new wa("composite",i,r.value.zoomStops),this.paint._values[e]=new se(r.property,n,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,i){return!this.layout||r.isDataDriven()||i.isDataDriven()?!1:ol.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let i=e.get("text-field"),n=Ys.paint.properties[r],a=!1,s=o=>{var l;for(let u of o)if((l=n.overrides)!=null&&l.hasOverride(u)){a=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof ze)s(i.value.value.sections);else if(i.value.kind==="source"||i.value.kind==="composite"){let o=u=>{if(!a)if(u instanceof ri&&_t(u.value)===yn){let h=u.value;s(h.sections)}else u instanceof Ep?s(u.sections):u.eachChild(o)},l=i.value;l._styleExpression&&o(l._styleExpression.expression)}return a}};function Jb(t,e,r,i=1){var a;let n=(a=t.get("icon-padding").evaluate(e,{},r))==null?void 0:a.values;return[n[0]*i,n[1]*i,n[2]*i,n[3]*i]}var Qb,tw=()=>Qb||(Qb=new Xt({"background-color":new V(w.paint_background["background-color"],"background-color"),"background-pattern":new Lf(w.paint_background["background-pattern"],"background-pattern"),"background-opacity":new V(w.paint_background["background-opacity"],"background-opacity")})),ew={get paint(){return tw()}};var rw=class extends de{constructor(t,e){super(t,ew,e)}};var iw=class extends de{constructor(t,e){super(t,{},e),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function ay(t,e){if(t.type==="custom")return new iw(t,e);switch(t.type){case"background":return new rw(t,e);case"circle":return new Bg(t,e);case"color-relief":return new Yg(t,e);case"fill":return new Ex(t,e);case"fill-extrusion":return new Hx(t,e);case"heatmap":return new Rg(t,e);case"hillshade":return new qg(t,e);case"line":return new G2(t,e);case"raster":return new Xm(t,e);case"symbol":return new Kb(t,e)}}var nw=class{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var t;this._triggered||(this._triggered=!0,(t=this._channel)==null||t.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}},aw={once:!0},sy=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new nw(()=>this.process()),this.subscription=hh(this.target,"message",r=>this.receive(r),!1),this.globalScope=mr(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((r,i)=>{let n=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=e?hh(e.signal,"abort",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[n];let l={id:n,type:"",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l),i(new dl(e.signal.reason))},aw):null;this.resolveRejects[n]={resolve:l=>{a==null||a.unsubscribe(),r(l)},reject:l=>{a==null||a.unsubscribe(),i(l)}};let s=[],o=Si(je({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:Yi(t.data,s)});this.target.postMessage(o,{transfer:s})})}receive(t){let e=t.data,r=e.id,i=["file://","resource://android","null"],n=[e.origin,location.origin],a=e.origin===location.origin,s=n.some(o=>i.includes(o));if((a||s)&&!(e.targetMapId&&this.mapId!==e.targetMapId)){if(e.type===""){delete this.tasks[r];let o=this.abortControllers[r];delete this.abortControllers[r],o&&o.abort();return}if(mr(self)||e.mustQueue){this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,e)}}process(){if(this.taskQueue.length===0)return;let t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,e){return rt(this,null,function*(){if(e.type===""){let n=this.resolveRejects[t];if(delete this.resolveRejects[t],!n)return;e.error?n.reject(Ki(Wi(e.error))):n.resolve(Wi(e.data));return}if(!this.messageHandlers[e.type]){this.completeTask(t,null,null);return}let r=Wi(e.data),i=new AbortController;this.abortControllers[t]=i;try{let n=yield this.messageHandlers[e.type](e.sourceMapId,r,i);this.completeTask(t,null,n)}catch(n){this.completeTask(t,Ki(n))}})}completeTask(t,e,r){let i=[];delete this.abortControllers[t];let n={id:t,type:"",sourceMapId:this.mapId,origin:location.origin,error:e?Yi(e):null,data:Yi(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function sw(t,e,r){return!(t<0||t>25||r<0||r>=2**t||e<0||e>=2**t)}var oy=class{constructor(t,e,r){if(!sw(t,e,r))throw Error(`x=${e}, y=${r}, z=${t} outside of bounds. 0<=x<${2**t}, 0<=y<${2**t} 0<=z<=25 `);this.z=t,this.x=e,this.y=r,this.key=Hi(0,t,t,e,r)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,r){let i=lw(this.x,this.y,this.z),n=uw(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(r==="tms"?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,i)}isChildOf(t){let e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){let e=2**this.z;return new B((t.x*e-this.x)*mt,(t.y*e-this.y)*mt)}toString(){return`${this.z}/${this.x}/${this.y}`}},ow=class{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Hi(t,e.z,e.z,e.x,e.y)}},uu=class ne{constructor(e,r,i,n,a){if(this.terrainRttPosMatrix32f=null,e= z; overscaledZ = ${e}; z = ${i}`);this.overscaledZ=e,this.wrap=r,this.canonical=new oy(i,+n,+a),this.key=Hi(r,e,i,n,a)}clone(){return new ne(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new ne(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ne(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,r){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let i=this.canonical.z-e;return e>this.canonical.z?Hi(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Hi(this.wrap*+r,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let r=this.canonical.z-e.canonical.z;return r<0?!1:e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new ne(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new ne(r,this.wrap,r,i,n),new ne(r,this.wrap,r,i+1,n),new ne(r,this.wrap,r,i,n+1),new ne(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrape.wrap?!1:this.overscaledZe.overscaledZ?!1:this.canonical.xe.canonical.x?!1:this.canonical.y=0&&e=0&&r=u)return null;let c=this.canonical.x+n,p=this.wrap;return c<0?(p-=Math.ceil(-c/u),c=(c%u+u)%u):c>=u&&(p+=Math.floor(c/u),c%=u),{tileID:new ne(this.overscaledZ,p,l,c,h),x:s,y:o}}};function Hi(t,e,r,i,n){t*=2,t<0&&(t=t*-1-1);let a=1<0;n--){let a=1<pw(n,a,r),t.layers[i])}function pw(t,e,r=""){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);let i={jsonPrefix:r,keys:[],values:[],keycache:{},valuecache:{}};for(let s=0;s>31}function yw(t,e){let r=t.loadGeometry(),i=t.type,n=0,a=0;for(let s of r){let o=1;i===1&&(o=s.length),e.writeVarint(Zs(1,o));let l=i===3?s.length-1:s.length;for(let u=0;u=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${t} can\'t be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}},gw=class{constructor(t,e,r,i,n){this.type="Feature",this._vectorTileFeature=t,this._x=r,this._y=i,this._z=e;for(let a in t.properties)typeof t.properties[a]=="string"&&t.properties[a].startsWith("__$json__:")&&(t.properties[a]=JSON.parse(t.properties[a].slice(10)));this.properties=t.properties,this.id=n}projectPoint(t,e,r,i){return[(t.x+e)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(t.y+r)*2/i)*Math.PI))-90]}projectLine(t,e,r,i){return t.map(n=>this.projectPoint(n,e,r,i))}get geometry(){if(this._geometry)return this._geometry;let t=this._vectorTileFeature,e=t.extent*2**this._z,r=t.extent*this._x,i=t.extent*this._y,n=t.loadGeometry();switch(t.type){case 1:{let a=[];for(let o of n)a.push(o[0]);let s=this.projectLine(a,r,i,e);this._geometry=a.length===1?{type:"Point",coordinates:s[0]}:{type:"MultiPoint",coordinates:s};break}case 2:{let a=n.map(s=>this.projectLine(s,r,i,e));this._geometry=a.length===1?{type:"LineString",coordinates:a[0]}:{type:"MultiLineString",coordinates:a};break}case 3:{let a=dd(n),s=[];for(let o of a)s.push(o.map(l=>this.projectLine(l,r,i,e)));this._geometry=s.length===1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s};break}default:throw Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let e in this)e!=="_geometry"&&e!=="_vectorTileFeature"&&e!=="_x"&&e!=="_y"&&e!=="_z"&&(t[e]=this[e]);return t}},Sr=class{constructor(t,e,r){this._name=t,this.dataBuffer=e,typeof r=="number"?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){var e;return((e=this.nullabilityBuffer)==null?void 0:e.get(t))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},ts=class extends Sr{},pu=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},fu=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},uy=class extends Sr{constructor(t,e,r,i){super(t,e,i),this.delta=r}},du=class extends uy{constructor(t,e,r,i,n){super(t,n?Int32Array.of(e):Uint32Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}},yu=class extends Sr{constructor(t,e,r,i){super(t,i?Int32Array.of(e):Uint32Array.of(e),r)}getValueFromBuffer(t){return this.dataBuffer[0]}},xw=class{constructor(t,e,r,i,n=4096){if(this._name=t,this._geometryVector=e,this._idVector=r,this._propertyVectors=i,this._extent=n,t.length===0)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){var t;return(t=this._propertyVectors)!=null?t:[]}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this.propertyVectors.map(e=>[e.name,e]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let t=[],e=this.geometryVector.getGeometries();for(let r=0;r>>32-t;var ul=mu,py=65536;function gu(t,e){return t-t%e}function vw(t){return gu(t+31,32)}function bw(t){if(!Number.isFinite(t)||t<=0)return py;let e=gu(Math.floor(t),256);return e===0?256:e}function ww(t){let e=t>>>0;return((e&255)<<24|(e&65280)<<8|e>>>8&65280|e>>>24&255)>>>0}function Dw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0;r[n++]=a>>>0&3,r[n++]=a>>>2&3,r[n++]=a>>>4&3,r[n++]=a>>>6&3,r[n++]=a>>>8&3,r[n++]=a>>>10&3,r[n++]=a>>>12&3,r[n++]=a>>>14&3,r[n++]=a>>>16&3,r[n++]=a>>>18&3,r[n++]=a>>>20&3,r[n++]=a>>>22&3,r[n++]=a>>>24&3,r[n++]=a>>>26&3,r[n++]=a>>>28&3,r[n++]=a>>>30&3,r[n++]=s>>>0&3,r[n++]=s>>>2&3,r[n++]=s>>>4&3,r[n++]=s>>>6&3,r[n++]=s>>>8&3,r[n++]=s>>>10&3,r[n++]=s>>>12&3,r[n++]=s>>>14&3,r[n++]=s>>>16&3,r[n++]=s>>>18&3,r[n++]=s>>>20&3,r[n++]=s>>>22&3,r[n++]=s>>>24&3,r[n++]=s>>>26&3,r[n++]=s>>>28&3,r[n]=s>>>30&3}function _w(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0;r[n++]=a>>>0&7,r[n++]=a>>>3&7,r[n++]=a>>>6&7,r[n++]=a>>>9&7,r[n++]=a>>>12&7,r[n++]=a>>>15&7,r[n++]=a>>>18&7,r[n++]=a>>>21&7,r[n++]=a>>>24&7,r[n++]=a>>>27&7,r[n++]=(a>>>30|(s&1)<<2)&7,r[n++]=s>>>1&7,r[n++]=s>>>4&7,r[n++]=s>>>7&7,r[n++]=s>>>10&7,r[n++]=s>>>13&7,r[n++]=s>>>16&7,r[n++]=s>>>19&7,r[n++]=s>>>22&7,r[n++]=s>>>25&7,r[n++]=s>>>28&7,r[n++]=(s>>>31|(o&3)<<1)&7,r[n++]=o>>>2&7,r[n++]=o>>>5&7,r[n++]=o>>>8&7,r[n++]=o>>>11&7,r[n++]=o>>>14&7,r[n++]=o>>>17&7,r[n++]=o>>>20&7,r[n++]=o>>>23&7,r[n++]=o>>>26&7,r[n]=o>>>29&7}function Aw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0;r[n++]=a>>>0&15,r[n++]=a>>>4&15,r[n++]=a>>>8&15,r[n++]=a>>>12&15,r[n++]=a>>>16&15,r[n++]=a>>>20&15,r[n++]=a>>>24&15,r[n++]=a>>>28&15,r[n++]=s>>>0&15,r[n++]=s>>>4&15,r[n++]=s>>>8&15,r[n++]=s>>>12&15,r[n++]=s>>>16&15,r[n++]=s>>>20&15,r[n++]=s>>>24&15,r[n++]=s>>>28&15,r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n]=l>>>28&15}function Sw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0;r[n++]=a>>>0&31,r[n++]=a>>>5&31,r[n++]=a>>>10&31,r[n++]=a>>>15&31,r[n++]=a>>>20&31,r[n++]=a>>>25&31,r[n++]=(a>>>30|(s&7)<<2)&31,r[n++]=s>>>3&31,r[n++]=s>>>8&31,r[n++]=s>>>13&31,r[n++]=s>>>18&31,r[n++]=s>>>23&31,r[n++]=(s>>>28|(o&1)<<4)&31,r[n++]=o>>>1&31,r[n++]=o>>>6&31,r[n++]=o>>>11&31,r[n++]=o>>>16&31,r[n++]=o>>>21&31,r[n++]=o>>>26&31,r[n++]=(o>>>31|(l&15)<<1)&31,r[n++]=l>>>4&31,r[n++]=l>>>9&31,r[n++]=l>>>14&31,r[n++]=l>>>19&31,r[n++]=l>>>24&31,r[n++]=(l>>>29|(u&3)<<3)&31,r[n++]=u>>>2&31,r[n++]=u>>>7&31,r[n++]=u>>>12&31,r[n++]=u>>>17&31,r[n++]=u>>>22&31,r[n]=u>>>27&31}function Ew(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0;r[n++]=a>>>0&63,r[n++]=a>>>6&63,r[n++]=a>>>12&63,r[n++]=a>>>18&63,r[n++]=a>>>24&63,r[n++]=(a>>>30|(s&15)<<2)&63,r[n++]=s>>>4&63,r[n++]=s>>>10&63,r[n++]=s>>>16&63,r[n++]=s>>>22&63,r[n++]=(s>>>28|(o&3)<<4)&63,r[n++]=o>>>2&63,r[n++]=o>>>8&63,r[n++]=o>>>14&63,r[n++]=o>>>20&63,r[n++]=o>>>26&63,r[n++]=l>>>0&63,r[n++]=l>>>6&63,r[n++]=l>>>12&63,r[n++]=l>>>18&63,r[n++]=l>>>24&63,r[n++]=(l>>>30|(u&15)<<2)&63,r[n++]=u>>>4&63,r[n++]=u>>>10&63,r[n++]=u>>>16&63,r[n++]=u>>>22&63,r[n++]=(u>>>28|(h&3)<<4)&63,r[n++]=h>>>2&63,r[n++]=h>>>8&63,r[n++]=h>>>14&63,r[n++]=h>>>20&63,r[n]=h>>>26&63}function Fw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0;r[n++]=a>>>0&127,r[n++]=a>>>7&127,r[n++]=a>>>14&127,r[n++]=a>>>21&127,r[n++]=(a>>>28|(s&7)<<4)&127,r[n++]=s>>>3&127,r[n++]=s>>>10&127,r[n++]=s>>>17&127,r[n++]=s>>>24&127,r[n++]=(s>>>31|(o&63)<<1)&127,r[n++]=o>>>6&127,r[n++]=o>>>13&127,r[n++]=o>>>20&127,r[n++]=(o>>>27|(l&3)<<5)&127,r[n++]=l>>>2&127,r[n++]=l>>>9&127,r[n++]=l>>>16&127,r[n++]=l>>>23&127,r[n++]=(l>>>30|(u&31)<<2)&127,r[n++]=u>>>5&127,r[n++]=u>>>12&127,r[n++]=u>>>19&127,r[n++]=(u>>>26|(h&1)<<6)&127,r[n++]=h>>>1&127,r[n++]=h>>>8&127,r[n++]=h>>>15&127,r[n++]=h>>>22&127,r[n++]=(h>>>29|(c&15)<<3)&127,r[n++]=c>>>4&127,r[n++]=c>>>11&127,r[n++]=c>>>18&127,r[n]=c>>>25&127}function kw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0;r[n++]=a>>>0&255,r[n++]=a>>>8&255,r[n++]=a>>>16&255,r[n++]=a>>>24&255,r[n++]=s>>>0&255,r[n++]=s>>>8&255,r[n++]=s>>>16&255,r[n++]=s>>>24&255,r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n]=p>>>24&255}function Tw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0;r[n++]=a>>>0&511,r[n++]=a>>>9&511,r[n++]=a>>>18&511,r[n++]=(a>>>27|(s&15)<<5)&511,r[n++]=s>>>4&511,r[n++]=s>>>13&511,r[n++]=s>>>22&511,r[n++]=(s>>>31|(o&255)<<1)&511,r[n++]=o>>>8&511,r[n++]=o>>>17&511,r[n++]=(o>>>26|(l&7)<<6)&511,r[n++]=l>>>3&511,r[n++]=l>>>12&511,r[n++]=l>>>21&511,r[n++]=(l>>>30|(u&127)<<2)&511,r[n++]=u>>>7&511,r[n++]=u>>>16&511,r[n++]=(u>>>25|(h&3)<<7)&511,r[n++]=h>>>2&511,r[n++]=h>>>11&511,r[n++]=h>>>20&511,r[n++]=(h>>>29|(c&63)<<3)&511,r[n++]=c>>>6&511,r[n++]=c>>>15&511,r[n++]=(c>>>24|(p&1)<<8)&511,r[n++]=p>>>1&511,r[n++]=p>>>10&511,r[n++]=p>>>19&511,r[n++]=(p>>>28|(f&31)<<4)&511,r[n++]=f>>>5&511,r[n++]=f>>>14&511,r[n]=f>>>23&511}function Iw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0;r[n++]=a>>>0&1023,r[n++]=a>>>10&1023,r[n++]=a>>>20&1023,r[n++]=(a>>>30|(s&255)<<2)&1023,r[n++]=s>>>8&1023,r[n++]=s>>>18&1023,r[n++]=(s>>>28|(o&63)<<4)&1023,r[n++]=o>>>6&1023,r[n++]=o>>>16&1023,r[n++]=(o>>>26|(l&15)<<6)&1023,r[n++]=l>>>4&1023,r[n++]=l>>>14&1023,r[n++]=(l>>>24|(u&3)<<8)&1023,r[n++]=u>>>2&1023,r[n++]=u>>>12&1023,r[n++]=u>>>22&1023,r[n++]=h>>>0&1023,r[n++]=h>>>10&1023,r[n++]=h>>>20&1023,r[n++]=(h>>>30|(c&255)<<2)&1023,r[n++]=c>>>8&1023,r[n++]=c>>>18&1023,r[n++]=(c>>>28|(p&63)<<4)&1023,r[n++]=p>>>6&1023,r[n++]=p>>>16&1023,r[n++]=(p>>>26|(f&15)<<6)&1023,r[n++]=f>>>4&1023,r[n++]=f>>>14&1023,r[n++]=(f>>>24|(d&3)<<8)&1023,r[n++]=d>>>2&1023,r[n++]=d>>>12&1023,r[n]=d>>>22&1023}function Cw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0;r[n++]=a>>>0&2047,r[n++]=a>>>11&2047,r[n++]=(a>>>22|(s&1)<<10)&2047,r[n++]=s>>>1&2047,r[n++]=s>>>12&2047,r[n++]=(s>>>23|(o&3)<<9)&2047,r[n++]=o>>>2&2047,r[n++]=o>>>13&2047,r[n++]=(o>>>24|(l&7)<<8)&2047,r[n++]=l>>>3&2047,r[n++]=l>>>14&2047,r[n++]=(l>>>25|(u&15)<<7)&2047,r[n++]=u>>>4&2047,r[n++]=u>>>15&2047,r[n++]=(u>>>26|(h&31)<<6)&2047,r[n++]=h>>>5&2047,r[n++]=h>>>16&2047,r[n++]=(h>>>27|(c&63)<<5)&2047,r[n++]=c>>>6&2047,r[n++]=c>>>17&2047,r[n++]=(c>>>28|(p&127)<<4)&2047,r[n++]=p>>>7&2047,r[n++]=p>>>18&2047,r[n++]=(p>>>29|(f&255)<<3)&2047,r[n++]=f>>>8&2047,r[n++]=f>>>19&2047,r[n++]=(f>>>30|(d&511)<<2)&2047,r[n++]=d>>>9&2047,r[n++]=d>>>20&2047,r[n++]=(d>>>31|(y&1023)<<1)&2047,r[n++]=y>>>10&2047,r[n]=y>>>21&2047}function Mw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0;r[n++]=a>>>0&4095,r[n++]=a>>>12&4095,r[n++]=(a>>>24|(s&15)<<8)&4095,r[n++]=s>>>4&4095,r[n++]=s>>>16&4095,r[n++]=(s>>>28|(o&255)<<4)&4095,r[n++]=o>>>8&4095,r[n++]=o>>>20&4095,r[n++]=l>>>0&4095,r[n++]=l>>>12&4095,r[n++]=(l>>>24|(u&15)<<8)&4095,r[n++]=u>>>4&4095,r[n++]=u>>>16&4095,r[n++]=(u>>>28|(h&255)<<4)&4095,r[n++]=h>>>8&4095,r[n++]=h>>>20&4095,r[n++]=c>>>0&4095,r[n++]=c>>>12&4095,r[n++]=(c>>>24|(p&15)<<8)&4095,r[n++]=p>>>4&4095,r[n++]=p>>>16&4095,r[n++]=(p>>>28|(f&255)<<4)&4095,r[n++]=f>>>8&4095,r[n++]=f>>>20&4095,r[n++]=d>>>0&4095,r[n++]=d>>>12&4095,r[n++]=(d>>>24|(y&15)<<8)&4095,r[n++]=y>>>4&4095,r[n++]=y>>>16&4095,r[n++]=(y>>>28|(m&255)<<4)&4095,r[n++]=m>>>8&4095,r[n]=m>>>20&4095}function Bw(t,e,r,i){let n=i,a=t[e]>>>0,s=t[e+1]>>>0,o=t[e+2]>>>0,l=t[e+3]>>>0,u=t[e+4]>>>0,h=t[e+5]>>>0,c=t[e+6]>>>0,p=t[e+7]>>>0,f=t[e+8]>>>0,d=t[e+9]>>>0,y=t[e+10]>>>0,m=t[e+11]>>>0,g=t[e+12]>>>0,x=t[e+13]>>>0,v=t[e+14]>>>0,b=t[e+15]>>>0;r[n++]=a>>>0&65535,r[n++]=a>>>16&65535,r[n++]=s>>>0&65535,r[n++]=s>>>16&65535,r[n++]=o>>>0&65535,r[n++]=o>>>16&65535,r[n++]=l>>>0&65535,r[n++]=l>>>16&65535,r[n++]=u>>>0&65535,r[n++]=u>>>16&65535,r[n++]=h>>>0&65535,r[n++]=h>>>16&65535,r[n++]=c>>>0&65535,r[n++]=c>>>16&65535,r[n++]=p>>>0&65535,r[n++]=p>>>16&65535,r[n++]=f>>>0&65535,r[n++]=f>>>16&65535,r[n++]=d>>>0&65535,r[n++]=d>>>16&65535,r[n++]=y>>>0&65535,r[n++]=y>>>16&65535,r[n++]=m>>>0&65535,r[n++]=m>>>16&65535,r[n++]=g>>>0&65535,r[n++]=g>>>16&65535,r[n++]=x>>>0&65535,r[n++]=x>>>16&65535,r[n++]=v>>>0&65535,r[n++]=v>>>16&65535,r[n++]=b>>>0&65535,r[n]=b>>>16&65535}function Pw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0;r[n++]=o>>>0&1,r[n++]=o>>>1&1,r[n++]=o>>>2&1,r[n++]=o>>>3&1,r[n++]=o>>>4&1,r[n++]=o>>>5&1,r[n++]=o>>>6&1,r[n++]=o>>>7&1,r[n++]=o>>>8&1,r[n++]=o>>>9&1,r[n++]=o>>>10&1,r[n++]=o>>>11&1,r[n++]=o>>>12&1,r[n++]=o>>>13&1,r[n++]=o>>>14&1,r[n++]=o>>>15&1,r[n++]=o>>>16&1,r[n++]=o>>>17&1,r[n++]=o>>>18&1,r[n++]=o>>>19&1,r[n++]=o>>>20&1,r[n++]=o>>>21&1,r[n++]=o>>>22&1,r[n++]=o>>>23&1,r[n++]=o>>>24&1,r[n++]=o>>>25&1,r[n++]=o>>>26&1,r[n++]=o>>>27&1,r[n++]=o>>>28&1,r[n++]=o>>>29&1,r[n++]=o>>>30&1,r[n++]=o>>>31&1}}function zw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0;r[n++]=o>>>0&3,r[n++]=o>>>2&3,r[n++]=o>>>4&3,r[n++]=o>>>6&3,r[n++]=o>>>8&3,r[n++]=o>>>10&3,r[n++]=o>>>12&3,r[n++]=o>>>14&3,r[n++]=o>>>16&3,r[n++]=o>>>18&3,r[n++]=o>>>20&3,r[n++]=o>>>22&3,r[n++]=o>>>24&3,r[n++]=o>>>26&3,r[n++]=o>>>28&3,r[n++]=o>>>30&3,r[n++]=l>>>0&3,r[n++]=l>>>2&3,r[n++]=l>>>4&3,r[n++]=l>>>6&3,r[n++]=l>>>8&3,r[n++]=l>>>10&3,r[n++]=l>>>12&3,r[n++]=l>>>14&3,r[n++]=l>>>16&3,r[n++]=l>>>18&3,r[n++]=l>>>20&3,r[n++]=l>>>22&3,r[n++]=l>>>24&3,r[n++]=l>>>26&3,r[n++]=l>>>28&3,r[n++]=l>>>30&3}}function Lw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0;r[n++]=o>>>0&7,r[n++]=o>>>3&7,r[n++]=o>>>6&7,r[n++]=o>>>9&7,r[n++]=o>>>12&7,r[n++]=o>>>15&7,r[n++]=o>>>18&7,r[n++]=o>>>21&7,r[n++]=o>>>24&7,r[n++]=o>>>27&7,r[n++]=(o>>>30|(l&1)<<2)&7,r[n++]=l>>>1&7,r[n++]=l>>>4&7,r[n++]=l>>>7&7,r[n++]=l>>>10&7,r[n++]=l>>>13&7,r[n++]=l>>>16&7,r[n++]=l>>>19&7,r[n++]=l>>>22&7,r[n++]=l>>>25&7,r[n++]=l>>>28&7,r[n++]=(l>>>31|(u&3)<<1)&7,r[n++]=u>>>2&7,r[n++]=u>>>5&7,r[n++]=u>>>8&7,r[n++]=u>>>11&7,r[n++]=u>>>14&7,r[n++]=u>>>17&7,r[n++]=u>>>20&7,r[n++]=u>>>23&7,r[n++]=u>>>26&7,r[n++]=u>>>29&7}}function Vw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0;r[n++]=o>>>0&15,r[n++]=o>>>4&15,r[n++]=o>>>8&15,r[n++]=o>>>12&15,r[n++]=o>>>16&15,r[n++]=o>>>20&15,r[n++]=o>>>24&15,r[n++]=o>>>28&15,r[n++]=l>>>0&15,r[n++]=l>>>4&15,r[n++]=l>>>8&15,r[n++]=l>>>12&15,r[n++]=l>>>16&15,r[n++]=l>>>20&15,r[n++]=l>>>24&15,r[n++]=l>>>28&15,r[n++]=u>>>0&15,r[n++]=u>>>4&15,r[n++]=u>>>8&15,r[n++]=u>>>12&15,r[n++]=u>>>16&15,r[n++]=u>>>20&15,r[n++]=u>>>24&15,r[n++]=u>>>28&15,r[n++]=h>>>0&15,r[n++]=h>>>4&15,r[n++]=h>>>8&15,r[n++]=h>>>12&15,r[n++]=h>>>16&15,r[n++]=h>>>20&15,r[n++]=h>>>24&15,r[n++]=h>>>28&15}}function Ow(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0;r[n++]=o>>>0&31,r[n++]=o>>>5&31,r[n++]=o>>>10&31,r[n++]=o>>>15&31,r[n++]=o>>>20&31,r[n++]=o>>>25&31,r[n++]=(o>>>30|(l&7)<<2)&31,r[n++]=l>>>3&31,r[n++]=l>>>8&31,r[n++]=l>>>13&31,r[n++]=l>>>18&31,r[n++]=l>>>23&31,r[n++]=(l>>>28|(u&1)<<4)&31,r[n++]=u>>>1&31,r[n++]=u>>>6&31,r[n++]=u>>>11&31,r[n++]=u>>>16&31,r[n++]=u>>>21&31,r[n++]=u>>>26&31,r[n++]=(u>>>31|(h&15)<<1)&31,r[n++]=h>>>4&31,r[n++]=h>>>9&31,r[n++]=h>>>14&31,r[n++]=h>>>19&31,r[n++]=h>>>24&31,r[n++]=(h>>>29|(c&3)<<3)&31,r[n++]=c>>>2&31,r[n++]=c>>>7&31,r[n++]=c>>>12&31,r[n++]=c>>>17&31,r[n++]=c>>>22&31,r[n++]=c>>>27&31}}function Rw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0;r[n++]=o>>>0&63,r[n++]=o>>>6&63,r[n++]=o>>>12&63,r[n++]=o>>>18&63,r[n++]=o>>>24&63,r[n++]=(o>>>30|(l&15)<<2)&63,r[n++]=l>>>4&63,r[n++]=l>>>10&63,r[n++]=l>>>16&63,r[n++]=l>>>22&63,r[n++]=(l>>>28|(u&3)<<4)&63,r[n++]=u>>>2&63,r[n++]=u>>>8&63,r[n++]=u>>>14&63,r[n++]=u>>>20&63,r[n++]=u>>>26&63,r[n++]=h>>>0&63,r[n++]=h>>>6&63,r[n++]=h>>>12&63,r[n++]=h>>>18&63,r[n++]=h>>>24&63,r[n++]=(h>>>30|(c&15)<<2)&63,r[n++]=c>>>4&63,r[n++]=c>>>10&63,r[n++]=c>>>16&63,r[n++]=c>>>22&63,r[n++]=(c>>>28|(p&3)<<4)&63,r[n++]=p>>>2&63,r[n++]=p>>>8&63,r[n++]=p>>>14&63,r[n++]=p>>>20&63,r[n++]=p>>>26&63}}function $w(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0;r[n++]=o>>>0&127,r[n++]=o>>>7&127,r[n++]=o>>>14&127,r[n++]=o>>>21&127,r[n++]=(o>>>28|(l&7)<<4)&127,r[n++]=l>>>3&127,r[n++]=l>>>10&127,r[n++]=l>>>17&127,r[n++]=l>>>24&127,r[n++]=(l>>>31|(u&63)<<1)&127,r[n++]=u>>>6&127,r[n++]=u>>>13&127,r[n++]=u>>>20&127,r[n++]=(u>>>27|(h&3)<<5)&127,r[n++]=h>>>2&127,r[n++]=h>>>9&127,r[n++]=h>>>16&127,r[n++]=h>>>23&127,r[n++]=(h>>>30|(c&31)<<2)&127,r[n++]=c>>>5&127,r[n++]=c>>>12&127,r[n++]=c>>>19&127,r[n++]=(c>>>26|(p&1)<<6)&127,r[n++]=p>>>1&127,r[n++]=p>>>8&127,r[n++]=p>>>15&127,r[n++]=p>>>22&127,r[n++]=(p>>>29|(f&15)<<3)&127,r[n++]=f>>>4&127,r[n++]=f>>>11&127,r[n++]=f>>>18&127,r[n++]=f>>>25&127}}function Nw(t,e,r,i){let n=i,a=e;for(let s=0;s<8;s++){let o=t[a++]>>>0,l=t[a++]>>>0,u=t[a++]>>>0,h=t[a++]>>>0,c=t[a++]>>>0,p=t[a++]>>>0,f=t[a++]>>>0,d=t[a++]>>>0;r[n++]=o>>>0&255,r[n++]=o>>>8&255,r[n++]=o>>>16&255,r[n++]=o>>>24&255,r[n++]=l>>>0&255,r[n++]=l>>>8&255,r[n++]=l>>>16&255,r[n++]=l>>>24&255,r[n++]=u>>>0&255,r[n++]=u>>>8&255,r[n++]=u>>>16&255,r[n++]=u>>>24&255,r[n++]=h>>>0&255,r[n++]=h>>>8&255,r[n++]=h>>>16&255,r[n++]=h>>>24&255,r[n++]=c>>>0&255,r[n++]=c>>>8&255,r[n++]=c>>>16&255,r[n++]=c>>>24&255,r[n++]=p>>>0&255,r[n++]=p>>>8&255,r[n++]=p>>>16&255,r[n++]=p>>>24&255,r[n++]=f>>>0&255,r[n++]=f>>>8&255,r[n++]=f>>>16&255,r[n++]=f>>>24&255,r[n++]=d>>>0&255,r[n++]=d>>>8&255,r[n++]=d>>>16&255,r[n++]=d>>>24&255}}function Uw(t,e,r,i){let n=i,a=e;for(let s=0;s<128;s++){let o=t[a++]>>>0;r[n++]=o&65535,r[n++]=o>>>16&65535}}function qw(t,e,r,i,n){let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0,u=i;for(let h=0;h<8;h++){for(let c=0;c<32;c++)if(o+n<=32){let p=l>>>o&a;r[u+c]=p|0,o+=n,o===32&&(o=0,s++,c!==31&&(l=t[s]>>>0))}else{let p=32-o,f=l>>>o;s++,l=t[s]>>>0;let d=n-p,y=-1>>>32-d>>>0,m=(f|(l&y)<>>0)}}var hl=bw(py),jw=3*hl/256+hl|0;function fy(){let t=new Uint8Array(jw);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function Gw(t=16){if(t<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);let e=Math.max(16,t|0);return{encodedWords:new Uint32Array(e),decoderWorkspace:fy()}}function Xw(t,e){if(e<=t.encodedWords.length)return t.encodedWords;let r=new Uint32Array(Math.max(16,e*2));return t.encodedWords=r,r}function Yw(t,e,r,i){i.byteContainer.length>>2;if(n.byteOffset&3)for(let o=0;o>>8&255,n[u+2|0]=l>>>16&255,n[u+3|0]=l>>>24&255}else{let o=i.byteContainerI32;(!o||o.buffer!==n.buffer||o.byteOffset!==n.byteOffset||o.length>>2)),o.set(t.subarray(e,e+a))}let s=r&3;if(s>0){let o=t[e+a|0]|0,l=a<<2;for(let u=0;u>>(u<<3)&255}return n}function Ww(t,e,r){let i=t[e++]|0,n=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(i>>>a-1&1))continue;if(e>=t.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);let s=t[e++]>>>0,o=vw(s),l=s*a+31>>>5;if(e+l>t.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let u=n[a];(!u||u.length>>5)|0,r.exceptionSizes[a]=s}return e}function Zw(t,e,r,i,n){switch(n){case 1:Pw(t,e,r,i);break;case 2:zw(t,e,r,i);break;case 3:Lw(t,e,r,i);break;case 4:Vw(t,e,r,i);break;case 5:Ow(t,e,r,i);break;case 6:Rw(t,e,r,i);break;case 7:$w(t,e,r,i);break;case 8:Nw(t,e,r,i);break;case 16:Uw(t,e,r,i);break;default:qw(t,e,r,i,n)}return e+(n<<3)|0}function Hw(t,e,r,i){if(r+2>e)throw Error(`FastPFOR decode: byteContainer underflow at block=${i} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${e})`);let n=t[r++],a=t[r++];if(n>32)throw Error(`FastPFOR decode: invalid bitWidth=${n} at block=${i} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:r}}function Kw(t,e,r,i,n,a){if(r+1>e)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${e})`);let s=t[r++];if(s32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${i}, expected ${i}..32)`);let o=s-i|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${i}, maxBits=${s})`);if(r+n>e)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}function Jw(t,e,r,i,n,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=Kw(n,a,s,r,i,l);if(s=c,h===1){let m=1<y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${i}, size=${y}) at block ${l}`);for(let m=0;m0&&(c=Jw(n,m,d,y,o,l,c,u,p))}if(h!==i)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${i}, packedWords=${i-r}, encoded.length=${t.length})`)}function t3(t,e,r,i,n,a){let s=r|0,o=t[s]|0;if(o<=0||s+o>t.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);let l=s+1|0,u=s+o|0,h=t[u]>>>0,c=h+3>>>2,p=u+1,f=p+c;if(f>=t.length)throw Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${c}, pageStart=${s}, packedEnd=${u}, byteContainerStart=${p}) causes bitmapPos=${f} out of bounds (encoded.length=${t.length})`);let d=Yw(t,p,h,a),y=h,m=Ww(t,f,a);return a.dataPointers.fill(0),Qw(t,s,l,u,e,i|0,n/256|0,d,y,a),m}function e3(t,e,r,i,n,a){let s=i+gu(n,256),o=i,l=r;for(;o!==s;){let u=Math.min(hl,s-o);l=t3(t,e,l,o,u,a),o=o+u|0}return l}function r3(t,e,r,i,n,a){if(a===0)return e;let s=0,o=e,l=e+r,u=n,h=n,c=n+a,p=0,f=0;for(;o>>s&255;if(s+=8,o+=s>>>5,s&=31,p|=(d&127)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${f}, partial=${p}, decoded=${h-u}/${a}, inPos=${o}, inEnd=${l})`)}if(h!==c)throw Error(`FastPFOR VByte: truncated stream (decoded=${h-u}, expected=${a}, consumedWords=${o-e}/${r}, vbyteStart=${e}, vbyteEnd=${l})`);return o}function i3(t,e,r){let i=0,n=0,a=new Uint32Array(e),s=r!=null?r:fy();if(t.length>0){let u=t[i]|0;if(i=i+1|0,u&255)throw Error(`FastPFOR decode: invalid alignedLength=${u} (expected multiple of 256)`);if(n+u>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${u}, out.length=${a.length})`);i=e3(t,a,i,n,u,s),n=n+u|0}let o=t.length-i|0,l=e-n|0;return r3(t,i,o,a,n,l),a}function n3(t,e,r,i,n){switch(n){case 2:Dw(t,e,r,i);return;case 3:_w(t,e,r,i);return;case 4:Aw(t,e,r,i);return;case 5:Sw(t,e,r,i);return;case 6:Ew(t,e,r,i);return;case 7:Fw(t,e,r,i);return;case 8:kw(t,e,r,i);return;case 9:Tw(t,e,r,i);return;case 10:Iw(t,e,r,i);return;case 11:Cw(t,e,r,i);return;case 12:Mw(t,e,r,i);return;case 16:Bw(t,e,r,i);return;case 32:for(let u=0;u<32;u=u+1|0)r[i+u|0]=t[e+u|0]|0;return}let a=ul[n]>>>0,s=e,o=0,l=t[s]>>>0;for(let u=0;u<32;u++)if(o+n<=32){let h=l>>>o&a;r[i+u]=h|0,o+=n,o===32&&(o=0,s++,u!==31&&(l=t[s]>>>0))}else{let h=32-o,c=l>>>o;s++,l=t[s]>>>0;let p=ul[n-h]>>>0,f=(c|(l&p)<t.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${r}, bytes.length=${t.length})`);let n=Math.floor(r/4),a=r%4!=0,s=a?n+1:n;if(i.length0){let o=t.byteOffset+e;if(o&3)for(let l=0;l=64)throw Error("Varint too long")}return e.set(n),r}function o3(t,e,r){let i=new Float64Array(r);for(let n=0;n>4,n<128||(n=e[r.get()],r.increment(),i|=(n&127)<<3,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<10,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<17,n<128)||(n=e[r.get()],r.increment(),i|=(n&127)<<24,n<128)||(n=e[r.get()],r.increment(),i|=(n&1)<<31,n<128))return i*4294967296+(t>>>0);throw Error("Expected varint not more than 10 bytes")}function h3(t,e,r,i){return c3(t,e,r,i,Gw(r>>>2))}function c3(t,e,r,i,n){let a=i.get();if(r&3)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=Xw(n,s);a3(t,a,r,o);let l=i3(o.subarray(0,s),e,n.decoderWorkspace);return i.add(r),l}function et(t){return t>>>1^-(t&1)}function Ot(t){return t>>BigInt(1)^-(t&BigInt(1))}function We(t){return t%2==1?(t+1)/-2:t/2}function p3(t){let e=new Int32Array(t.length);for(let r=0;r=4)for(;i=4)for(;i=4)for(;r=4)for(let i=t[0];r=4)for(;i=4)for(;l>>0;for(let r=1;r>>0;return e}function jc(t){let e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Ot(t[0]));for(let r=1;r>>0,e[1]=et(t[1])>>>0;for(let r=2;r>>0,e[r+1]=e[r-1]+et(t[r+1])>>>0;return e}function F3(t,e,r,i){let n=yy(t,e,r,i);return new Uint32Array(n)}function k3(t){return t[1]}function T3(t){return et(t[1])}function I3(t){if(t.length===2){let e=et(t[1]);return[e,e]}return[et(t[2]),et(t[3])]}function C3(t){return t[1]}function M3(t){return Ot(t[1])}function B3(t){if(t.length===2){let e=Ot(t[1]);return[e,e]}return[Ot(t[2]),Ot(t[3])]}var St;(function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"})(St||(St={}));var jt;(function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"})(jt||(jt={}));var Me;(function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"})(Me||(Me={}));var Ct;(function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"})(Ct||(Ct={}));var P3=[St.PRESENT,St.DATA,St.OFFSET,St.LENGTH],Gc=[H.NONE,H.DELTA,H.COMPONENTWISE_DELTA,H.RLE,H.MORTON],z3=[le.NONE,le.FAST_PFOR,le.VARINT],L3=[jt.NONE,jt.SINGLE,jt.SHARED,jt.VERTEX,jt.MORTON,jt.FSST],V3=[Me.VERTEX,Me.INDEX,Me.STRING,Me.KEY],O3=[Ct.VAR_BINARY,Ct.GEOMETRIES,Ct.PARTS,Ct.RINGS,Ct.TRIANGLES,Ct.SYMBOL,Ct.DICTIONARY];function ct(t,e){let r=N3(t,e);return r.logicalLevelTechnique1===H.MORTON?R3(r,t,e):(H.RLE===r.logicalLevelTechnique1||H.RLE===r.logicalLevelTechnique2)&&le.NONE!==r.physicalLevelTechnique?$3(r,t,e):r}function R3(t,e,r){let i=$t(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:i[0],coordinateShift:i[1]}}function $3(t,e,r){let i=$t(e,r,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:i[1],runs:i[0],numRleValues:i[1]}}function N3(t,e){let r=t[e.get()],i=P3[r>>4],n={};switch(i){case St.DATA:n={dictionaryType:L3[r&15]};break;case St.OFFSET:n={offsetType:V3[r&15]};break;case St.LENGTH:n={lengthType:O3[r&15]}}e.increment();let a=t[e.get()],s=Gc[a>>5],o=Gc[a>>2&7],l=z3[a&3];e.increment();let u=$t(t,e,2),h=u[0],c=u[1];return{physicalStreamType:i,logicalStreamType:n,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:c,decompressedCount:h}}var ht;(function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"})(ht||(ht={}));var fe=class{constructor(t,e){this.values=t,this._size=e}get(t){let e=Math.floor(t/8),r=t%8;return(this.values[e]>>r&1)==1}set(t,e){let r=Math.floor(t/8),i=t%8;this.values[r]=this.values[r]|+!!e<>r&1}size(){return this._size}getBuffer(){return this.values}};function Er(t,e,r){if(!e)return t;let i=e.size(),n=t.constructor,a=new n(i),s=0;for(let o=0;o=s);){let o=t[i.increment()];if(o<=127){let l=o+3,u=t[i.increment()],h=Math.min(a+l,e);n.fill(u,a,h),a=h}else{let l=256-o;for(let u=0;u=12?X3.decode(t.subarray(e,r)):Y3(t,e,r)}function Y3(t,e,r){let i="",n=e;for(;n239?4:a>223?3:a>191?2:1;if(n+o>r)break;let l,u,h;o===1?a<128&&(s=a):o===2?(l=t[n+1],(l&192)==128&&(s=(a&31)<<6|l&63,s<=127&&(s=null))):o===3?(l=t[n+1],u=t[n+2],(l&192)==128&&(u&192)==128&&(s=(a&15)<<12|(l&63)<<6|u&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):o===4&&(l=t[n+1],u=t[n+2],h=t[n+3],(l&192)==128&&(u&192)==128&&(h&192)==128&&(s=(a&15)<<18|(l&63)<<12|(u&63)<<6|h&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,o=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),n+=o}return i}function Ta(t,e,r,i,n){return J3(pi(t,e,r),r,i,n)}function Vt(t,e,r,i,n){return Q3(pi(t,e,r),r,i,n)}function Ze(t,e,r){return e6(pi(t,e,r),r)}function pi(t,e,r){let i=r.physicalLevelTechnique;switch(i){case le.FAST_PFOR:return h3(t,r.numValues,r.byteLength,e);case le.VARINT:return $t(t,e,r.numValues);case le.NONE:return j3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function _n(t,e,r){let i=r.physicalLevelTechnique;switch(i){case le.VARINT:return xu(t,e,r.numValues);case le.NONE:return G3(t,e,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${i} is not supported (yet).`)}}function W3(t,e,r){let i=pi(t,e,r);return i.length===1?et(i[0]):T3(i)}function wu(t,e,r){let i=pi(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?et(i[0]):i[0]:k3(i)}function vy(t,e,r){return I3(pi(t,e,r))}function by(t,e,r){return B3(xu(t,e,r.numValues))}function wy(t,e,r,i){return _y(_n(t,e,r),r,i)}function Du(t,e,r,i){return Ay(_n(t,e,r),r,i)}function Z3(t,e,r,i){let n=H3(t,e,r,!1);return i?Er(n,i,0):n}function H3(t,e,r,i){if(r.physicalLevelTechnique===le.VARINT)return t6(o3(t,e,r.numValues),r,i);let n=_n(t,e,r),a=i?_y(n,r):Ay(n,r);return Float64Array.from(a,Number)}function K3(t,e,r){let i=_n(t,e,r);return i.length===1?Ot(i[0]):M3(i)}function Dy(t,e,r){let i=_n(t,e,r);return i.length===1?r.logicalLevelTechnique1===H.DELTA?Ot(i[0]):i[0]:C3(i)}function J3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;if(!i)return A3(t,a.runs,a.numRleValues);t=cl(t,a.runs,a.numRleValues),n=Nc(t)}else n=Nc(t);break;case H.RLE:n=m3(t,e.runs,e.numRleValues);break;case H.MORTON:vu(t),n=new Int32Array(t);break;case H.COMPONENTWISE_DELTA:if(r&&!i)return yy(t,r.scale,r.min,r.max);n=b3(t);break;case H.NONE:n=p3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Er(n,i,0):n}function Q3(t,e,r,i){let n;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let a=e;n=qc(cl(t,a.runs,a.numRleValues))}else n=qc(t);break;case H.RLE:n=cl(t,e.runs,e.numRleValues);break;case H.MORTON:vu(t),n=t;break;case H.COMPONENTWISE_DELTA:n=r&&!i?F3(t,r.scale,r.min,r.max):E3(t);break;case H.NONE:n=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Er(n,i,0):n}function _y(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;if(!r)return S3(t,n.runs,n.numRleValues);t=pl(t,n.runs,n.numRleValues),i=Uc(t)}else i=Uc(t);break;case H.RLE:i=g3(t,e.runs,e.numRleValues);break;case H.NONE:i=f3(t);break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Er(i,r,BigInt(0)):i}function Ay(t,e,r){let i;switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let n=e;i=jc(pl(t,n.runs,n.numRleValues))}else i=jc(t);break;case H.RLE:i=pl(t,e.runs,e.numRleValues);break;case H.NONE:i=t;break;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Er(i,r,BigInt(0)):i}function t6(t,e,r){switch(e.logicalLevelTechnique1){case H.DELTA:if(e.logicalLevelTechnique2===H.RLE){let i=e;t=dy(t,i.runs,i.numRleValues)}return y3(t),t;case H.RLE:return i6(t,e,r);case H.NONE:return r&&d3(t),t;default:throw Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}function e6(t,e){if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.NONE)return w3(t);if(e.logicalLevelTechnique1===H.RLE&&e.logicalLevelTechnique2===H.NONE){let r=e;return _3(t,r.runs,r.numRleValues)}if(e.logicalLevelTechnique1===H.NONE&&e.logicalLevelTechnique2===H.NONE){v3(t);let r=new Uint32Array(e.numValues+1);return r[0]=0,r.set(t,1),r}if(e.logicalLevelTechnique1===H.DELTA&&e.logicalLevelTechnique2===H.RLE){let r=e,i=D3(t,r.runs,r.numRleValues);return vu(i),new Uint32Array(i)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}function es(t,e,r,i,n="int32"){let a=t.logicalLevelTechnique1;if(a===H.RLE)return t.runs===1?ht.CONST:ht.FLAT;if(a!==H.DELTA||t.logicalLevelTechnique2!==H.RLE)return t.numValues===1?ht.CONST:ht.FLAT;let s=e instanceof fe?e.size():e,o=t;if(o.numRleValues!==s)return ht.FLAT;if(o.runs===1)return ht.SEQUENCE;if(o.runs!==2)return t.numValues===1?ht.CONST:ht.FLAT;let l=i.get();if(t.physicalLevelTechnique===le.VARINT)return r6(r,i,n)?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT;let u=i.get(),h=new Int32Array(r.buffer,r.byteOffset+u,4);return i.set(l),h[2]===2&&h[3]===2?ht.SEQUENCE:t.numValues===1?ht.CONST:ht.FLAT}function r6(t,e,r){let i=new cy(e.get());if(r==="int64"){let a=xu(t,i,4);return a[2]===BigInt(2)&&a[3]===BigInt(2)}let n=$t(t,i,4);return n[2]===2&&n[3]===2}function i6(t,e,r){return r?x3(t,e.runs,e.numRleValues):dy(t,e.runs,e.numRleValues)}var Sy=class extends ts{getValueFromBuffer(t){return this.dataBuffer[t]}},Ey=class extends uy{constructor(t,e,r,i,n){super(t,n?BigInt64Array.of(e):BigUint64Array.of(e),r,i)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}};function _u(t,e,r){return{x:Xc(t,e)-r,y:Xc(t>>1,e)-r}}function Xc(t,e){let r=0;for(let i=0;i>i;return r}var Rt;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"})(Rt||(Rt={}));var n6;(function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"})(n6||(n6={}));var Fr;(function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"})(Fr||(Fr={}));function a6(t){let e=Array(t.numGeometries),r=1,i=1,n=1,a=0,s=0,o=0,l=t.mortonSettings,u=t.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=t.vertexOffsets,d=!f||f.length===0,y=t.containsPolygonGeometry(),m=t.vertexBuffer;for(let g=0;g[D]),r+=v,i+=v}break;case Rt.LINESTRING:{let v;y?(v=p[i]-p[i-1],i++):v=c[r]-c[r-1],r++;let b;d?(b=Or(m,s,v,!1),s+=v*2):(b=lr(t.vertexBufferType,m,f,o,v,!1,l),o+=v),e[a++]=[b],h&&n++}break;case Rt.POLYGON:{let v=c[r]-c[r-1];r++;let b=Array(v-1),D,A=p[i]-p[i-1];if(i++,d){D=Or(m,s,A,!0),s+=A*2;for(let _=0;_r?e[a++]:1);return i}function Zc(t,e,r,i){let n=new Uint32Array(e[e.length-1]+1),a=0;n[0]=a;let s=1,o=0;for(let l=0;l0;)n[a++]=t[u++]}}return n}var By=class extends Au{constructor(t,e,r,i,n,a,s,o){super(t,r,i,s!=null?s:e.length),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(t){var n,a,s;(s=this.decodedDictionary)!=null||(this.decodedDictionary=(n=this.sharedDictionaryCache)==null?void 0:n.decodedDictionary,(a=this.decodedDictionary)!=null||(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let e=this.indexBuffer[t],r=this.offsetBuffer[e],i=this.offsetBuffer[e+1];return bu(this.decodedDictionary,r,i)}decodeDictionary(){var t;return(t=this.symbolLengthBuffer)!=null||(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),v6(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(t){let e=new Uint32Array(t.length-1),r=t[0];for(let i=1;i1&&!f.nullable||d===1&&f.nullable)throw Error(`The number of streams for the child field ${f.name} does not match its nullability. nullibilty: ${f.nullable}, numStreams: ${d}`);let m;if(f.nullable){let x=ct(t,e);m=new fe(ci(t,x.numValues,x.byteLength,e),x.numValues)}let g=Vt(t,e,ct(t,e),void 0,m);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${y}"`);h[p++]=new By(y,g,n,a,s,o,m,c)}else h[p++]=new Qr(y,g,n,a,m)}return h}var Kc=class extends Sr{constructor(t,e,r){super(t,new Uint8Array,r!=null?r:e.length),this.values=e}getValueFromBuffer(t){return this.values[t]}},Be;(function(t){t[t.STRING=1]="STRING",t[t.INT32=2]="INT32",t[t.UINT32=4]="UINT32",t[t.INT64=8]="INT64",t[t.UINT64=16]="UINT64",t[t.FLOAT=32]="FLOAT",t[t.DOUBLE=64]="DOUBLE",t[t.PRESENCE=128]="PRESENCE"})(Be||(Be={}));var pr;(function(t){t[t.FALSE=0]="FALSE",t[t.TRUE=1]="TRUE",t[t.START_MAP=2]="START_MAP",t[t.START_LIST=3]="START_LIST",t[t.COUNT=4]="COUNT"})(pr||(pr={}));function A6(t,e,r,i){let n=S6(r);if(i===0)return n.map(h=>new Kc(h,[]));let a=E6(t,e,i),s=(a.presentStream?a.presentCount:a.lengthStream.length)/n.length,o=[],l=0,u=0;for(let h=0;h{var i;return t.name+((i=r.name)!=null?i:"")})}function E6(t,e,r){let i=t[e.get()];e.add(1);let n=Vt(t,e,ct(t,e)),a=r-1,s=[];i&Be.STRING&&(a-=F6(t,e,s)),a-=k6(t,e,i,s),a-=T6(t,e,i,s);let o,l=0;if(i&Be.PRESENCE){let h=I6(t,e);o=h.value,l=h.count,a--}let u=new Uint32Array;if(a>0&&(u=Vt(t,e,ct(t,e)),a--),a!==0)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:n,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}function F6(t,e,r){let i=t[e.get()];e.add(1);let n=Py("",t,e,i);if(n)for(let a=0;aa.length)throw Error("Merged map counts underflow while decoding child streams");let f=Array(r),d=i,y=n;for(let x=0;xs.length)throw Error("Map value stream underflow while decoding feature payload");let b=M6(s,y,v,l);f[x]=b.value,y=b.nextIndex}let m=0;for(let x=i;x=r)throw Error("Unexpected end of map value stream");let n=t[e];if(n===pr.FALSE)return{value:!1,nextIndex:e+1};if(n===pr.TRUE)return{value:!0,nextIndex:e+1};if(n===pr.START_MAP){let a=Jc(t,e,r);return{value:zy(t,e+2,a,i).value,nextIndex:a}}if(n===pr.START_LIST){let a=Jc(t,e,r),s=[],o=e+2;for(;o=r)throw Error("Missing length for nested map/list payload");let i=t[e+1];if(i<2)throw Error(`Invalid nested payload length: ${i}`);let n=e+i;if(n>r)throw Error("Nested payload exceeds containing payload bounds");return n}function Ly(t,e){let r=t-pr.COUNT;if(r<0||r>=e.length)throw Error(`Scalar dictionary index out of range: ${t}`);return e[r]}function Xr(t,e){for(let r of e)t.push(r)}function B6(t,e,r,i,n,a){var s;return r.type==="scalarType"?a&&!a.has(r.name)?(my(i,t,e),null):P6(i,t,e,n,r.scalarType,r):((s=r.complexType)==null?void 0:s.physicalType)===Qe.MAP?A6(t,e,r,i):i===0?null:_6(t,e,r,a)}function P6(t,e,r,i,n,a){var l;let s;if(t===0)return null;if(a.nullable){let u=ct(e,r),h=u.numValues,c=r.get(),p=ci(e,h,u.byteLength,r);r.set(c+u.byteLength),s=new fe(p,u.numValues)}let o=s!=null?s:i;switch(n.physicalType){case it.UINT_32:case it.INT_32:return R6(e,r,a,n,o);case it.STRING:{let u=a.nullable?t-1:t;return(l=Py(a.name,e,r,u,s))!=null?l:null}case it.BOOLEAN:return z6(e,r,a,i,o);case it.UINT_64:case it.INT_64:return O6(e,r,a,o,n);case it.FLOAT:return L6(e,r,a,o);case it.DOUBLE:return V6(e,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${n}`)}}function z6(t,e,r,i,n){let a=ct(t,e),s=a.numValues,o=e.get(),l=An(n)?n:void 0,u=ci(t,s,a.byteLength,e,l);e.set(o+a.byteLength);let h=new fe(u,s);return new m6(r.name,h,n)}function L6(t,e,r,i){let n=ct(t,e),a=An(i)?i:void 0,s=gy(t,e,n.numValues,a);return new g6(r.name,s,i)}function V6(t,e,r,i){let n=ct(t,e),a=An(i)?i:void 0,s=xy(t,e,n.numValues,a);return new fu(r.name,s,i)}function O6(t,e,r,i,n){let a=ct(t,e),s=es(a,i,t,e,"int64"),o=n.physicalType===it.INT_64;if(s===ht.FLAT){let u=An(i)?i:void 0,h=o?wy(t,e,a,u):Du(t,e,a,u);return new Sy(r.name,h,i)}if(s===ht.SEQUENCE){let u=by(t,e,a);return new Ey(r.name,u[0],u[1],a.numRleValues,o)}let l=o?K3(t,e,a):Dy(t,e,a);return new My(r.name,l,i,o)}function R6(t,e,r,i,n){let a=ct(t,e),s=es(a,n,t,e),o=i.physicalType===it.INT_32;if(s===ht.FLAT){let u=An(n)?n:void 0,h=o?Ta(t,e,a,void 0,u):Vt(t,e,a,void 0,u);return new pu(r.name,h,n)}if(s===ht.SEQUENCE){let u=vy(t,e,a);return new du(r.name,u[0],u[1],a.numRleValues,o)}let l=o?W3(t,e,a):wu(t,e,a);return new yu(r.name,l,n,o)}function An(t){return t instanceof fe}var It={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function Vy(t){switch(t){case It.ID:case It.ID|It.ID_NULLABLE:case It.ID|It.ID_LONG:case It.ID|It.ID_LONG|It.ID_NULLABLE:return{nullable:(t&It.ID_NULLABLE)!==0,columnScope:qi.FEATURE,type:"scalarType",scalarType:{longID:(t&It.ID_LONG)!==0,type:"logicalType",logicalType:hy.ID}};case It.GEOMETRY:return{nullable:!1,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.GEOMETRY,children:[]}};case It.STRUCT:return{nullable:!1,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.STRUCT,children:[]}};case It.MAP:return{nullable:!0,columnScope:qi.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:Qe.MAP,children:[]}};default:return j6(t)}}function $6(t){return t>=It.SCALAR_BASE}function Oy(t){return t===It.STRUCT||t===It.MAP}function N6(t){if(t.type==="scalarType"){let e=t.scalarType;if(e.type==="physicalType")switch(e.physicalType){case it.BOOLEAN:case it.INT_8:case it.UINT_8:case it.INT_32:case it.UINT_32:case it.INT_64:case it.UINT_64:case it.FLOAT:case it.DOUBLE:return!1;case it.STRING:return!0;default:return!1}if(e.type==="logicalType")return!1}else if(t.type==="complexType"){let e=t.complexType;if(e.type==="physicalType")switch(e.physicalType){case Qe.GEOMETRY:case Qe.STRUCT:case Qe.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}function U6(t){var e;return t.type==="scalarType"&&((e=t.scalarType)==null?void 0:e.type)==="logicalType"&&t.scalarType.logicalType===hy.ID}function q6(t){var e;return t.type==="complexType"&&((e=t.complexType)==null?void 0:e.type)==="physicalType"&&t.complexType.physicalType===Qe.GEOMETRY}function j6(t){let e;switch(t){case 10:case 11:e=it.BOOLEAN;break;case 12:case 13:e=it.INT_8;break;case 14:case 15:e=it.UINT_8;break;case 16:case 17:e=it.INT_32;break;case 18:case 19:e=it.UINT_32;break;case 20:case 21:e=it.INT_64;break;case 22:case 23:e=it.UINT_64;break;case 24:case 25:e=it.FLOAT;break;case 26:case 27:e=it.DOUBLE;break;case 28:case 29:e=it.STRING;break;default:return null}return{nullable:!!(t&1),columnScope:qi.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:e}}}var G6=new TextDecoder,Qc="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function Eu(t,e){let r=$t(t,e,1)[0];if(r===0)return"";let i=e.get(),n=i+r,a=t.subarray(i,n);return e.add(r),G6.decode(a)}function X6(t){let e=t.name,r=t.nullable;return t.type==="scalarType"?{type:"scalarField",scalarField:t.scalarType,name:e,nullable:r}:{type:"complexField",complexField:t.complexType,name:e,nullable:r}}function Ry(t,e){let r=$t(t,e,1)[0]>>>0,i=r>=It.SCALAR_BASE?Vy(r):null;if(!i)throw Error(`Unsupported field type code ${r}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let n=Si(je({},i),{name:Eu(t,e)});if(n.type==="complexType"&&Oy(r)){let a=n.complexType,s=$t(t,e,1)[0]>>>0;a.children=Array(s);for(let o=0;o>>0,i=Vy(r);if(!i)throw Error(`Unsupported column type code ${r}. Supported: ${Qc}`);let n;if($6(r))n=Eu(t,e);else if(r>>0,o=a.complexType;o.children=Array(s);for(let l=0;l>>0,a=$t(t,e,1)[0]>>>0;i.columns=Array(a);for(let s=0;s>>0,s=i.get()+a;if(s>t.length)throw Error(`Block overruns tile: ${s} > ${t.length}`);let o=$t(t,i,1)[0]>>>0;if(o!==1&&o!==2){i.set(s);continue}let[l,u]=W6(t,i),h=l.featureTables[0],c=null,p=null,f=[],d=0;for(let m of h.columns){let g=m.name;if(U6(m)){let x=null;if(m.nullable){let b=ct(t,i),D=i.get(),A=ci(t,b.numValues,b.byteLength,i);i.set(D+b.byteLength),x=new fe(A,b.numValues)}let v=ct(t,i);d=x?x.size():v.decompressedCount,c=H6(t,m,i,g,v,x!=null?x:d,r)}else if(q6(m)){let x=$t(t,i,1)[0];if(d===0){let v=i.get();d=ct(t,i).decompressedCount,i.set(v)}e&&(e.scale=e.extent/u),p=f6(t,x,i,d,e)}else{let x=N6(m)?$t(t,i,1)[0]:1;if(x===0)continue;let v=B6(t,i,m,x,d,void 0);if(v)if(Array.isArray(v))for(let b of v)f.push(b);else f.push(v)}}let y=new xw(h.name,p,c,f,u);n.push(y),i.set(s)}return n}function H6(t,e,r,i,n,a,s=!1){var h;let o=(h=e.scalarType)!=null&&h.longID?it.UINT_64:it.UINT_32,l=typeof a=="number"?void 0:a,u=es(n,a,t,r,o===it.UINT_64?"int64":"int32");if(o===it.UINT_32)switch(u){case ht.FLAT:return new pu(i,Vt(t,r,n,void 0,l),a);case ht.SEQUENCE:{let c=vy(t,r,n);return new du(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new yu(i,wu(t,r,n),a,!1)}switch(u){case ht.FLAT:return s?new fu(i,Z3(t,r,n,l),a):new Sy(i,Du(t,r,n,l),a);case ht.SEQUENCE:{let c=by(t,r,n);return new Ey(i,c[0],c[1],n.numRleValues,!1)}case ht.CONST:return new My(i,Dy(t,r,n),a,!1)}throw Error("Vector type not supported for id column.")}var K6=class{constructor(t,e){var r;switch(this._featureData=t,this.properties=this._featureData.properties||{},(r=this._featureData.geometry)==null?void 0:r.type){case Rt.POINT:case Rt.MULTIPOINT:this.type=1;break;case Rt.LINESTRING:case Rt.MULTILINESTRING:this.type=2;break;case Rt.POLYGON:case Rt.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){let t=[];for(let e of this._featureData.geometry.coordinates){let r=[];for(let i of e)r.push(new B(i.x,i.y));t.push(r)}return t}},J6=class{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new K6(this.features[t],this.extent)}},Fu=class{constructor(t){this.layers={};let e=Z6(new Uint8Array(t));this.layers=e.reduce((r,i)=>Si(je({},r),{[i.name]:new J6(i)}),{})}},ku=class{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new uo(mt,16,0),this.grid3D=new uo(mt,16,0),this.featureIndexArray=new Yf,this.promoteId=e}insert(t,e,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let l of e){let u=[1/0,1/0,-1/0,-1/0];for(let h of l)u[0]=Math.min(u[0],h.x),u[1]=Math.min(u[1],h.y),u[2]=Math.max(u[2],h.x),u[3]=Math.max(u[3],h.y);u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&o.insert(s,u[0],u[1],u[2],u[3])}}loadVTLayers(){return this.vtLayers||(this.encoding==="mlt"?this.vtLayers=new Fu(this.rawTileData).layers:this.vtLayers=new Xl(new au(this.rawTileData)).layers,this.sourceLayerCoder=new cu(this.vtLayers?Object.keys(this.vtLayers).sort():[ll])),this.vtLayers}query(t,e,r,i){this.loadVTLayers();let n=t.params,a=mt/t.tileSize/t.scale,s=ai(n.filter,"queryRenderedFeatures filter",n.globalState),o=t.queryGeometry,l=t.queryPadding*a,u=Fa.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=Fa.fromPoints(t.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(y,m,g,x)=>vg(t.cameraQueryGeometry,y-l,m-l,g+l,x+l));for(let y of p)h.push(y);h.sort(t5);let f={},d;for(let y of h){if(y===d)continue;d=y;let m=this.featureIndexArray.get(y),g=null;this.loadMatchingFeature(f,m.bucketIndex,m.sourceLayerIndex,m.featureIndex,s,n.layers,n.availableImages,e,r,i,(x,v,b)=>(g||(g=Ar(x)),v.queryIntersectsFeature({queryGeometry:o,feature:x,featureState:b,geometry:g,zoom:this.z,transform:t.transform,pixelsToTileUnits:a,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return f}loadMatchingFeature(t,e,r,i,n,a,s,o,l,u,h){let c=this.bucketLayerIDs[e];if(a&&!c.some(y=>a.has(y)))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(i);if(n.needGeometry){let y=hi(f,!0);if(!n.filter(new st(this.tileID.overscaledZ),y,this.tileID.canonical))return}else if(!n.filter(new st(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let y of c){if(a&&!a.has(y))continue;let m=o[y];if(!m)continue;let g={};d&&u&&(g=u.getState(m.sourceLayer||"_geojsonTileLayer",d));let x=Gt({},l[y]);x.paint=tp(x.paint,m.paint,f,g,s),x.layout=tp(x.layout,m.layout,f,g,s);let v=!h||h(f,m,g);if(!v)continue;let b=new gw(f,this.z,this.x,this.y,d);b.layer=x;let D=t[y];D===void 0&&(D=t[y]=[]),D.push({featureIndex:i,feature:b,intersectionZ:v})}}lookupSymbolFeatures(t,e,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=ai(n.filterSpec,"queryRenderedFeatures symbol filter",n.globalState);for(let h of t)this.loadMatchingFeature(l,r,i,h,u,a,s,o,e);return l}hasLayer(t){for(let e of this.bucketLayerIDs)for(let r of e)if(t===r)return!0;return!1}getId(t,e){var i;let r=t.id;if(this.promoteId){let n=typeof this.promoteId=="string"?this.promoteId:this.promoteId[e];r=t.properties[n],typeof r=="boolean"&&(r=Number(r)),r===void 0&&((i=t.properties)!=null&&i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))}return r}};C("FeatureIndex",ku,{omit:["rawTileData","sourceLayerCoder"]});function Q6(t){return typeof t=="object"&&!!t&&"evaluate"in t}function tp(t,e,r,i,n){return Ia(t,(a,s)=>{let o=e instanceof Ya?e.get(s):null;return Q6(o)?o.evaluate(r,i,void 0,n):o})}function t5(t,e){return e-t}var $y=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){let e=this.map.get(t);return e!==void 0&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){let r=this.map.keys().next().value;this.map.delete(r)}this.map.set(t,e)}clear(){this.map.clear()}};function Tu(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t==null)return JSON.stringify(t);if(Array.isArray(t)){let n="[";for(let a of t)n+=`${Tu(a)},`;return`${n}]`}let r=Object.keys(t).sort(),i="{";for(let n=0;nthis._layers[c.id]),s=a[0];if(s.isHidden())continue;let o=s.source||"",l=this.familiesBySource[o];l||(l=this.familiesBySource[o]={});let u=s.sourceLayer||"_geojsonTileLayer",h=l[u];h||(h=l[u]=[]),h.push(a)}}},qy=class{constructor(t){let e={},r=[];for(let s in t){let o=t[s],l=e[s]={};for(let u in o){let h=o[u];if(!h||h.bitmap.width===0||h.bitmap.height===0)continue;let c={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};r.push(c),l[u]={rect:c,metrics:h.metrics}}}let{w:i,h:n}=su(r),a=new Ja({width:i||1,height:n||1});for(let s in t){let o=t[s];for(let l in o){let u=o[l];if(!u||u.bitmap.width===0||u.bitmap.height===0)continue;let h=e[s][l].rect;Ja.copy(u.bitmap,a,{x:0,y:0},{x:h.x+1,y:h.y+1},u.bitmap)}}this.image=a,this.positions=e}};C("GlyphAtlas",qy);var jy=class{constructor(t){this.tileID=new uu(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,e,r,i,n){return rt(this,null,function*(){this.data=t,this.collisionBoxArray=new Ll;let a=new cu(Object.keys(t.layers).sort()),s=new ku(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},l={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:r,subdivisionGranularity:n},u=e.familiesBySource[this.source];for(let S in u){let k=t.layers[S];if(!k)continue;k.version===1&&Bt(`Vector tile source "${this.source}" layer "${S}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let z=a.encode(S),O=[];for(let P=0;PF.id)))}}let h=Ia(l.glyphDependencies,S=>Object.keys(S));for(let S of this.inFlightDependencies)S==null||S.abort();this.inFlightDependencies=[];let c=Promise.resolve({});if(Object.keys(h).length){let S=new AbortController;this.inFlightDependencies.push(S),c=i.sendAsync({type:"GG",data:{stacks:h,source:this.source,tileID:this.tileID,type:"glyphs"}},S)}let p=Object.keys(l.iconDependencies),f=Promise.resolve({});if(p.length){let S=new AbortController;this.inFlightDependencies.push(S),f=i.sendAsync({type:"GI",data:{icons:p,source:this.source,tileID:this.tileID,type:"icons"}},S)}let d=Object.keys(l.patternDependencies),y=Promise.resolve({});if(d.length){let S=new AbortController;this.inFlightDependencies.push(S),y=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},S)}let m=l.dashDependencies,g=Promise.resolve({});if(Object.keys(m).length){let S=new AbortController;this.inFlightDependencies.push(S),g=i.sendAsync({type:"GDA",data:{dashes:m}},S)}let[x,v,b,D]=yield Promise.all([c,f,y,g]),A=new qy(x),_=new ou(v,b);for(let S in o){let k=o[S];k.hasDependencies&&(Ny(k.layers,this.zoom,r),k.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:x,glyphPositions:A.positions,iconMap:v,iconPositions:_.iconPositions,patternMap:b,patternPositions:_.patternPositions,dashPositions:D,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(o).filter(S=>!S.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:A.image,imageAtlas:_,dashPositions:D,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?A.positions:null}})}};function Ny(t,e,r){let i=new st(e);for(let n of t)n.recalculate(i,r)}var Gy=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){let e=this.loading[t];e!=null&&e.abort&&(e.abort.abort(),delete this.loading[t])}getParsing(t){return this.parsing[t]}setParsing(t,e){this.parsing[t]=e}removeParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){let e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}},Xy=class{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return t.length===0&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},n5=class{constructor(t,e,r,i,n){this.type=t,this.properties=r||{},this.extent=n,this.pointsArray=e,this.id=i}loadGeometry(){return this.pointsArray.map(t=>t.map(e=>new B(e.x,e.y)))}},a5=class{constructor(t,e,r){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=r}feature(t){return this._myFeatures[t]}},s5=class{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}};function o5(t,e,r){let{extent:i}=t,n=2**(r.z-e.z),a=(r.x-e.x*n)*i,s=(r.y-e.y*n)*i,o=[];for(let l=0;l0&&l.addLayer(d)}let h={vectorTile:l,rawData:hu(l).buffer};return this.overzoomedTileResultCache.set(s,h),h}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)throw Error("Should not be trying to reload a tile that was never loaded or has been removed");if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}},u5=class{constructor(){this.loaded={}}loadTile(t){return rt(this,null,function*(){let{uid:e,encoding:r,rawImageData:i,redFactor:n,greenFactor:a,blueFactor:s,baseShift:o}=t,l=i.width+4,u=i.height+4,h=Ca(i)?new Zt({width:l,height:u},yield ap(i,-2,-2,l,u)):i,c=new jl(e,h,r,n,a,s,o);return this.loaded||(this.loaded={}),this.loaded[e]=c,c})}removeTile(t){let e=this.loaded,r=t.uid;e!=null&&e[r]&&delete e[r]}},h5=class{constructor(t,e,r,i=c5){this.actor=t,this.layerIndex=e,this.availableImages=r,this.tileState=new Gy,this._createGeoJSONIndex=i}loadVectorTile(t){if(!this._geoJSONIndex)throw Error("Unable to parse the data into a cluster or geojson");let{z:e,x:r,y:i}=t.tileID.canonical,n=this._geoJSONIndex.getTile(e,r,i);if(!n)return null;let a=new ly(n.features,{version:2,extent:mt});return{vectorTile:a,rawData:hu(a,np).buffer}}loadTile(t){return rt(this,null,function*(){let{uid:e}=t,r=new jy(t);r.abort=new AbortController;try{let i=this.loadVectorTile(t);if(!i)return null;let{vectorTile:n,rawData:a}=i;r.vectorTile=n,this.tileState.markLoaded(e,r);let s={rawData:a};return this.tileState.setParsing(e,s),yield this._parseWorkerTile(r,t)}catch(i){throw this.tileState.markLoaded(e,r),i}})}_parseWorkerTile(t,e){return rt(this,null,function*(){let r=this.tileState.getParsing(t.uid),i=yield t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);if(r){let{rawData:n}=r;i=Gt({rawTileData:n.slice(0),encoding:"mvt"},i),this.tileState.removeParsing(t.uid)}return i})}abortTile(t){return rt(this,null,function*(){this.tileState.abort(t.uid)})}removeTile(t){return rt(this,null,function*(){this.tileState.removeLoaded(t.uid)})}loadData(t){return rt(this,null,function*(){var r;(r=this._pendingRequest)==null||r.abort();let e=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let i={};return t.request&&(i.data=t.data),this._finishRequestTiming(e,t,i),i}catch(i){if(delete this._pendingRequest,!yl(i))throw i;return{abandoned:!0}}})}_startRequestTiming(t){var e;if((e=t.request)!=null&&e.collectResourceTiming)return new Xy(t.request.url)}_finishRequestTiming(t,e,r){let i=t==null?void 0:t.finish();i&&(r.resourceTiming={[e.source]:JSON.parse(JSON.stringify(i))})}reloadTile(t){return rt(this,null,function*(){let e=t.uid,r=this.tileState.getLoaded(e);if(!r)return yield this.loadTile(t);if(r.vectorTile)return r.showCollisionBoxes=t.showCollisionBoxes,yield this._parseWorkerTile(r,t)})}loadAndProcessGeoJSON(t,e){return rt(this,null,function*(){var r;if(t.request&&(t.data=(yield up(t.request,e)).data),t.data){t.data=this._filterGeoJSON(t.data,t.filter,t.source),this._geoJSONIndex=this._createGeoJSONIndex(t.data,t);return}if(t.dataDiff){(r=this._geoJSONIndex)!=null||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},t)),this._geoJSONIndex.updateData(t.dataDiff,this._getFilterPredicate(t.filter,t.source));return}if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,Yy(t)),this._geoJSONIndex==null)throw Error(`Input data given to \'${t.source}\' is not a valid GeoJSON object.`)})}_filterGeoJSON(t,e,r){if(t.type!=="FeatureCollection")return t;let i=this._getFilterPredicate(e,r);return i?{type:"FeatureCollection",features:t.features.filter(n=>i(n))}:t}_getFilterPredicate(t,e){if(typeof t!="boolean"&&!(t!=null&&t.length))return;let r=er(t,`sources.${e}.filter`,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(r.result==="error")throw Error(r.value.map(i=>`${i.key}: ${i.message}`).join(", "));return i=>r.value.evaluate({zoom:0},i)}removeSource(t){return rt(this,null,function*(){var e;(e=this._pendingRequest)==null||e.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getClusterChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset)}};function c5(t,e){let r=Gt(e.geojsonVtOptions||{},{updateable:!0,clusterOptions:Yy(e)});return new Td(t,r)}function Yy({geojsonVtOptions:t,clusterProperties:e,source:r}){if(!e||!t.clusterOptions)return t.clusterOptions;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(e);for(let l of o){let[u,h]=e[l],c=er(h,`sources.${r}.clusterProperties.${l}[1]`),p=er(typeof u=="string"?[u,["accumulated"],["get",l]]:u,`sources.${r}.clusterProperties.${l}[0]`);i[l]=c.value,n[l]=p.value}return t.clusterOptions.map=l=>{s.properties=l;let u={};for(let h of o)u[h]=i[h].evaluate(a,s);return u},t.clusterOptions.reduce=(l,u)=>{s.properties=u;for(let h of o)a.accumulated=l[h],l[h]=n[h].evaluate(a,s)},t.clusterOptions}function Uy(t){return rt(this,null,function*(){if(t.endsWith(".mjs")){yield import(t);return}let e=yield fetch(t,{credentials:"same-origin"});if(!e.ok)throw Error(`Failed to load ${t}: ${e.status}`);let r=yield e.text();if(/^[ \\t]*(import|export)\\s/m.test(r)){let i=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{yield import(i)}finally{URL.revokeObjectURL(i)}return}globalThis.eval(r)})}var p5=class{constructor(t){this.self=t,this.actor=new sy(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,r)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=r},this.self.addProtocol=sp,this.self.removeProtocol=op,this.self.registerRTLTextPlugin=e=>{wr.setMethods(e)},this.self.makeRequest=Ma,this.actor.registerMessageHandler("LDT",(e,r)=>this._getDEMWorkerSource(e,r.source).loadTile(r)),this.actor.registerMessageHandler("RDT",(e,r)=>rt(this,null,function*(){this._getDEMWorkerSource(e,r.source).removeTile(r)})),this.actor.registerMessageHandler("GCEZ",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterExpansionZoom(r)})),this.actor.registerMessageHandler("GCC",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterChildren(r)})),this.actor.registerMessageHandler("GCL",(e,r)=>rt(this,null,function*(){return this._getWorkerSource(e,r.type,r.source).getClusterLeaves(r)})),this.actor.registerMessageHandler("LD",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadData(r)),this.actor.registerMessageHandler("LT",(e,r)=>this._getWorkerSource(e,r.type,r.source).loadTile(r)),this.actor.registerMessageHandler("RT",(e,r)=>this._getWorkerSource(e,r.type,r.source).reloadTile(r)),this.actor.registerMessageHandler("AT",(e,r)=>this._getWorkerSource(e,r.type,r.source).abortTile(r)),this.actor.registerMessageHandler("RMT",(e,r)=>this._getWorkerSource(e,r.type,r.source).removeTile(r)),this.actor.registerMessageHandler("RS",(e,r)=>rt(this,null,function*(){var n,a;if(!((a=(n=this.workerSources[e])==null?void 0:n[r.type])!=null&&a[r.source]))return;let i=this.workerSources[e][r.type][r.source];delete this.workerSources[e][r.type][r.source],i.removeSource!==void 0&&i.removeSource(r)})),this.actor.registerMessageHandler("RM",e=>rt(this,null,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)})),this.actor.registerMessageHandler("SR",(e,r)=>rt(this,null,function*(){this.referrer=r})),this.actor.registerMessageHandler("SRPS",(e,r)=>this._syncRTLPluginState(e,r)),this.actor.registerMessageHandler("IS",(e,r)=>rt(this,null,function*(){yield Uy(r)})),this.actor.registerMessageHandler("SI",(e,r)=>this._setImages(e,r)),this.actor.registerMessageHandler("UL",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).update(r.layers,r.removedIds,this._getGlobalState(e))})),this.actor.registerMessageHandler("UGS",(e,r)=>rt(this,null,function*(){let i=this._getGlobalState(e);for(let n in r)i[n]=r[n]})),this.actor.registerMessageHandler("SL",(e,r)=>rt(this,null,function*(){this._getLayerIndex(e).replace(r,this._getGlobalState(e))}))}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}_setImages(t,e){return rt(this,null,function*(){this.availableImages[t]=e;for(let r in this.workerSources[t]){let i=this.workerSources[t][r];for(let n in i)i[n].availableImages=e}})}_syncRTLPluginState(t,e){return rt(this,null,function*(){return yield wr.syncState(e,Uy)})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new i5),e}_getWorkerSource(t,e,r){var i,n;if((i=this.workerSources)[t]||(i[t]={}),(n=this.workerSources[t])[e]||(n[e]={}),!this.workerSources[t][e][r]){let a={sendAsync:(s,o)=>(s.targetMapId=t,this.actor.sendAsync(s,o))};switch(e){case"vector":this.workerSources[t][e][r]=new l5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][r]=new h5(a,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][r]=new this.externalWorkerSourceTypes[e](a,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][r]}_getDEMWorkerSource(t,e){var r,i;return(r=this.demWorkerSources)[t]||(r[t]={}),(i=this.demWorkerSources[t])[e]||(i[e]=new u5),this.demWorkerSources[t][e]}};mr(self)&&(self.worker=new p5(self));export{p5 as default};\n/*! Bundled license information:\n\nmaplibre-gl/dist/maplibre-gl-shared.mjs:\nmaplibre-gl/dist/maplibre-gl-worker.mjs:\n (**\n * MapLibre GL JS\n * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.9.0/LICENSE.txt\n *)\n*/\n'}}),j8=g({"src/plots/map/layers.js"(t,r){var i=t_(),n=tN().sanitizeHTML,a=vi(),o=y8();function s(t,r){this.subplot=t,this.uid=t.uid+"-"+r,this.index=r,this.idSource="source-"+this.uid,this.idLayer=o.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var l=s.prototype;function u(t){if(!t.visible)return!1;var r=t.source;if(Array.isArray(r)&&r.length>0){for(var n=0;n0}function c(t){var r={},n={};switch(t.type){case"circle":i.extendFlat(n,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":i.extendFlat(n,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":i.extendFlat(n,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var o=t.symbol,s=a(o.textposition,o.iconsize);i.extendFlat(r,{"icon-image":o.icon,"icon-size":o.iconsize/10,"text-field":o.text,"text-size":o.textfont.size,"text-anchor":s.anchor,"text-offset":s.offset,"symbol-placement":o.placement}),i.extendFlat(n,{"icon-color":t.color,"text-color":o.textfont.color,"text-opacity":t.opacity});break;case"raster":i.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:r,paint:n}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var r=this.findFollowingMapLayerId(this.lookupBelow());null!==r&&this.subplot.map.moveLayer(this.idLayer,r)},l.updateSource=function(t){var r=this.subplot.map;if(r.getSource(this.idSource)&&r.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var i,a,o,s,l,c=(o=(i=t).sourcetype,s=i.source,l={type:o},"geojson"===o?a="data":"vector"===o?a="string"==typeof s?"url":"tiles":"raster"===o?(a="tiles",l.tileSize=256):"image"===o&&(a="url",l.coordinates=i.coordinates),l[a]=s,i.sourceattribution&&(l.attribution=n(i.sourceattribution)),l);r.addSource(this.idSource,c)}},l.findFollowingMapLayerId=function(t){if("traces"===t)for(var r=this.subplot.getMapLayers(),i=0;i(!y[t]&&/^[a-zA-Z0-9-]+$/.test(t)&&(y[t]=new Promise(r=>{let i=new Image(15,15);i.onload=()=>{g.addImage(t,i,{sdf:!0}),r()},i.onerror=()=>r(),i.crossOrigin="Anonymous",i.src=`https://cdn.jsdelivr.net/npm/@mapbox/maki@8.2.0/icons/${t}.svg`})),y[t])),g.setTransformRequest(function(t){return{url:t=(t=(t=t.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular")}}),g._canvas.style.left="0px",g._canvas.style.top="0px",u.rejectOnError(l),u.isStatic||u.initFx(t,r);var v=[];v.push(new Promise(function(t){g.once("load",t)})),Promise.all(v=v.concat(s.fetchTraceGeoData(t))).then(function(){m&&M(u,c),k(u,c),u.fillBelowLookup(t,r),u.updateData(t),u.updateLayout(r),u.resolveOnRender(o)}).catch(l)},A.updateMap=function(t,r,i,n){var a=this,o=a.map,l=r[this.id];a.rejectOnError(n);var u=[],c=E(l.style);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.style),a.traceHash={},u.push(new Promise(function(t){o.once("styledata",t)}))),Promise.all(u=u.concat(s.fetchTraceGeoData(t))).then(function(){a.fillBelowLookup(t,r),a.updateData(t);let n=l._fitBounds;n&&(o.fitBounds([[n.west,n.south],[n.east,n.north]],{padding:_.fitBoundsPadding,animate:!1}),M(a,l),k(a,l)),a.updateLayout(r),a.resolveOnRender(i)}).catch(n)},A.fillBelowLookup=function(t,r){var i,n,a=r[this.id].layers,o=this.belowLookup={},s=!1;for(i=0;i1)for(i=0;ir.project(t).x,_subplot:r},r.yaxis={_id:"y",c2p:t=>r.project(t).y,_subplot:r},r.updateFramework(t),r.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},u.setConvert(r.mockAxis,t)},A.initFx=function(t,r){var i=this,n=i.gd,a=i.map;function o(){h.loneUnhover(r._hoverlayer)}function s(){var t=i.getView();n.emit("plotly_relayouting",i.getViewEditsWithDerived(t))}a.on("moveend",function(t){if(i.map){var r=n._fullLayout;if(t.originalEvent||i.wheeling){var a=r[i.id];l.call("_storeDirectGUIEdit",n.layout,r._preGUI,i.getViewEdits(a));var o=i.getView();a._input.center=a.center=o.center,a._input.zoom=a.zoom=o.zoom,a._input.bearing=a.bearing=o.bearing,a._input.pitch=a.pitch=o.pitch,n.emit("plotly_relayout",i.getViewEditsWithDerived(o))}t.originalEvent&&"mouseup"===t.originalEvent.type?i.dragging=!1:i.wheeling&&(i.wheeling=!1),r&&r._rehover&&r._rehover()}}),a.on("wheel",function(){i.wheeling=!0}),a.on("mousemove",function(t){var r=i.div.getBoundingClientRect(),o=[t.originalEvent.offsetX,t.originalEvent.offsetY];t.target.getBoundingClientRect=function(){return r},i.xaxis.p2c=function(){return a.unproject(o).lng},i.yaxis.p2c=function(){return a.unproject(o).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===i.id&&n._fullLayout[i.id]&&h.hover(n,t,i.id)},h.hover(n,t,i.id),n._fullLayout._hoversubplot=i.id}),a.on("dragstart",function(){i.dragging=!0,o()}),a.on("zoomstart",o),a.on("mouseout",function(){n._fullLayout._hoversubplot=null}),a.on("drag",s),a.on("zoom",s),a.on("dblclick",function(){var t=n._fullLayout[i.id];l.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,i.getViewEdits(t));var r=i.viewInitial;a.setCenter(D(r.center)),a.setZoom(r.zoom),a.setBearing(r.bearing),a.setPitch(r.pitch);var o=i.getView();t._input.center=t.center=o.center,t._input.zoom=t.zoom=o.zoom,t._input.bearing=t.bearing=o.bearing,t._input.pitch=t.pitch=o.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",i.getViewEditsWithDerived(o))}),i.clearOutline=function(){v(i.dragOptions),y(i.dragOptions.gd)},i.onClickInPanFn=function(t){return function(r){var a=n._fullLayout.clickmode;a.indexOf("select")>-1&&x(r.originalEvent,n,[i.xaxis],[i.yaxis],i.id,t),a.indexOf("event")>-1&&h.click(n,r.originalEvent)}}},A.updateFx=function(t){var r=this,i=r.map,n=r.gd;if(!r.isStatic){var a=t.dragmode,s=r.dragOptions;r.dragOptions=o.extendDeep(s||{},{dragmode:t.dragmode,element:r.div,gd:n,plotinfo:{id:r.id,domain:t[r.id].domain,xaxis:r.xaxis,yaxis:r.yaxis,fillRangeItems:function(t,i){i.isRect?(t.range={})[r.id]=[l([i.xmin,i.ymin]),l([i.xmax,i.ymax])]:(t.lassoPoints={})[r.id]=i.map(l)}},xaxes:[r.xaxis],yaxes:[r.yaxis],subplot:r.id}),i.off("click",r.onClickInPanHandler),m(a)||p(a)?(i.dragPan.disable(),i.on("zoomstart",r.clearOutline),r.dragOptions.prepFn=function(t,i,n){g(t,i,n,r.dragOptions,a)},c.init(r.dragOptions)):(i.dragPan.enable(),i.off("zoomstart",r.clearOutline),r.div.onmousedown=null,r.div.ontouchstart=null,r.div.removeEventListener("touchstart",r.div._ontouchstart),r.onClickInPanHandler=r.onClickInPanFn(r.dragOptions),i.on("click",r.onClickInPanHandler))}function l(t){var i=r.map.unproject(t);return[i.lng,i.lat]}},A.updateFramework=function(t){var r=t[this.id].domain,i=t._size,n=this.div.style;n.width=i.w*(r.x[1]-r.x[0])+"px",n.height=i.h*(r.y[1]-r.y[0])+"px",n.left=i.l+r.x[0]*i.w+"px",n.top=i.t+(1-r.y[1])*i.h+"px",this.xaxis._offset=i.l+r.x[0]*i.w,this.xaxis._length=i.w*(r.x[1]-r.x[0]),this.yaxis._offset=i.t+(1-r.y[1])*i.h,this.yaxis._length=i.h*(r.y[1]-r.y[0])},A.updateLayers=function(t){var r,i=t[this.id].layers,n=this.layerList;if(i.length!==n.length){for(r=0;rNe});var Nt,Nr=m({"src/plots/map/get_map_fit_bounds.ts"(){Nt=x(pD())}}),Ni=g({"src/plots/map/layout_defaults.js"(t,r){var i=t_(),n=sr(),a=tJ(),o=y7(),{getMapFitBounds:s}=(Nr(),b(j9));function l(t,r,i,n){i("style"),i("center.lon"),i("center.lat"),i("zoom"),i("bearing"),i("pitch");let o=i("fitbounds");var l=i("bounds.west"),c=i("bounds.east"),h=i("bounds.south"),d=i("bounds.north");(void 0===l||void 0===c||void 0===h||void 0===d)&&delete r.bounds,a(t,r,{name:"layers",handleItemDefaults:u}),r._fitBounds=null;let{_fitView:{center:f,zoom:p}={},center:m,zoom:g}=t,y=m?.lon===f?.lon&&m?.lat===f?.lat&&g===p;if(o&&y){let t=s(n.fullData,n.id);t&&(r._fitBounds=t)}r._input=t}function u(t,r){function n(n,a){return i.coerce(t,r,o.layers,n,a)}if(n("visible")){var a,s=n("sourcetype"),l="raster"===s||"image"===s;n("source"),n("sourceattribution"),"vector"===s&&n("sourcelayer"),"image"===s&&n("coordinates"),l&&(a="raster");var u=n("type",a);l&&"raster"!==u&&(u=r.type="raster",i.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===u&&n("circle.radius"),"line"===u&&(n("line.width"),n("line.dash")),"fill"===u&&n("fill.outlinecolor"),"symbol"===u&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),i.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}r.exports=function(t,r,i){n(t,r,i,{type:"map",attributes:o,handleDefaults:l,partition:"y",fullData:i})}}}),Nn=g({"src/plots/map/index.js"(t){var r=t_(),i=r.strTranslate,n=r.strScale,a=tF().getSubplotCalcData,o=tB(),s=k(),l=rr(),u=tN(),c=j7();t.name="map",t.attr="subplot",t.idRoot="map",t.idRegex=t.attrRegex=r.counterRegex("map"),t.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},t.layoutAttributes=y7(),t.supplyLayoutDefaults=Ni(),t.plot=function(t){for(var r=t._fullLayout,i=t.calcdata,n=r._subplots.map,o=0;ox/2){var b=m.split("|").join("
");y.text(b).attr("data-unformatted",b).call(u.convertToTspans,t),v=l.bBox(y.node())}y.attr("transform",i(-3,-v.height+8)),g.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var _=1;v.width+6>x&&(_=x/(v.width+6));var w=[c.l+c.w*f.x[1],c.t+c.h*(1-f.y[0])];g.attr("transform",i(w[0],w[1])+n(_))}},t.updateFx=function(t){for(var r=t._fullLayout,i=r._subplots.map,n=0;n=0;i--)t.removeLayer(r[i][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},r.exports=function(t,r){var n=r[0].trace,a=new o(t,n.uid),s=a.sourceId,l=i(r),u=a.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(s,{type:"geojson",data:l.geojson}),a._addLayers(l,u),r[0].trace._glTrace=a,a}}}),Nh=g({"src/traces/choroplethmap/index.js"(t,r){r.exports={attributes:Ns(),supplyDefaults:Nl(),colorbar:ou(),calc:p$(),plot:Nc(),hoverPoints:pZ(),eventData:pX(),selectPoints:pK(),styleOnSelect:function(t,r){r&&r[0].trace._glTrace.updateOnSelect(r)},getBelow:function(t,r){for(var i=r.getMapLayers(),n=i.length-2;n>=0;n--){var a=i[n].id;if("string"==typeof a&&0===a.indexOf("water")){for(var o=n+1;o0?+p[h]:0),d.push({type:"Feature",geometry:{type:"Point",coordinates:v},properties:x})}}var _=o.extractOpts(r),w=_.reversescale?o.flipScale(_.colorscale):_.colorscale,T=w[0][1],A=["interpolate",["linear"],["heatmap-density"],0,1>a.opacity(T)?T:a.addOpacity(T,0)];for(h=1;h=0;i--)t.removeLayer(r[i][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},r.exports=function(t,r){var n=r[0].trace,o=new a(t,n.uid),s=o.sourceId,l=i(r),u=o.below=t.belowLookup["trace-"+n.uid];return t.map.addSource(s,{type:"geojson",data:l.geojson}),o._addLayers(l,u),o}}}),Nv=g({"src/traces/densitymap/hover.js"(t,r){var i=rs(),n=vo().hoverPoints,a=vo().getExtraText;r.exports=function(t,r,o){var s=n(t,r,o);if(s){var l=s[0],u=l.cd,c=u[0].trace,h=u[l.index];if(delete l.color,"z"in h){var d=l.subplot.mockAxis;l.z=h.z,l.zLabel=i.tickText(d,d.c2l(h.z),"hover").text}return l.extraText=a(c,h,u[0].t.labels),[l]}}}}),Nx=g({"src/traces/densitymap/event_data.js"(t,r){r.exports=function(t,r){return t.lon=r.lon,t.lat=r.lat,t.z=r.z,t}}}),Nb=g({"src/traces/densitymap/index.js"(t,r){r.exports={attributes:Nf(),supplyDefaults:Np(),colorbar:ou(),formatLabels:vr(),calc:Nm(),plot:Ny(),hoverPoints:Nv(),eventData:Nx(),getBelow:function(t,r){for(var i=r.getMapLayers(),n=0;na.addOpacity(v[r%v.length],.8))),y("customdata");var x=t.link||{},b=l.newContainer(r,"link");function _(t,r){return i.coerce(x,b,n.link,t,r)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),s(x,b,_,p),_("hovertemplate"),_("sort");var w=.333>a.luminosity(d.paper_bgcolor),T=_("color",w?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function A(t){if(!a.isValid(t))return t;let r=a.opacity(t);return r<=.8?a.addOpacity(t,r+.2):w?a.brighten(t,10):a.adjustLightness(t,-10)}_("hovercolor",Array.isArray(T)?T.map(A):A(T)),_("customdata"),u(x,b,{name:"colorscales",handleItemDefaults:c}),o(r,d,f),f("orientation"),f("direction"),f("valueformat"),f("valuesuffix"),f("arrangement",g.x.length&&g.y.length?"freeform":void 0),i.coerceFont(f,"textfont",d.font,{autoShadowDflt:!0}),r._length=null}}}),NA=g({"node_modules/strongly-connected-components/scc.js"(t,r){r.exports=function(t){for(var r=t.length,i=Array(r),n=Array(r),a=Array(r),o=Array(r),s=Array(r),l=Array(r),u=0;u0;){var p=t[r=f[f.length-1]];if(o[r]=0&&l[r].push(s[g])}o[r]=m}else{if(n[r]===i[r]){for(var y=[],v=[],x=0,m=u.length-1;m>=0;--m){var b=u[m];if(a[b]=!1,y.push(b),v.push(l[b]),x+=l[b].length,s[b]=h.length,b===r){u.length=m;break}}h.push(y);for(var _=Array(x),m=0;mb&&(b=u.source[r]),u.target[r]>b&&(b=u.target[r]);var _=b+1;t.node._count=_;var w,T=t.node.groups,A={};for(r=0;r0&&s(I,_)&&s(L,_)&&!(A.hasOwnProperty(I)&&A.hasOwnProperty(L)&&A[I]===A[L])){A.hasOwnProperty(L)&&(L=A[L]),A.hasOwnProperty(I)&&(I=A[I]),L*=1,p[I*=1]=p[L]=!0;var P="";u.label&&u.label[r]&&(P=u.label[r]);var z=null;P&&m.hasOwnProperty(P)&&(z=m[P]),c.push({pointNumber:r,label:P,color:h?u.color[r]:u.color,hovercolor:d?u.hovercolor[r]:u.hovercolor,customdata:f?u.customdata[r]:u.customdata,concentrationscale:z,source:I,target:L,value:+C}),E.push(I),D.push(L)}}var F=_+T.length,O=o(a.color),R=o(a.customdata),B=[];for(r=0;r_-1,childrenNodes:[],pointNumber:r,label:j,color:O?a.color[r]:a.color,customdata:R?a.customdata[r]:a.customdata})}var N=!1;return function(t,r,a){for(var o=n.init2dArray(t,0),s=0;s1})}(F,E,D)&&(N=!0),{circular:N,links:c,nodes:B,groups:T,groupLookup:A}}(r);return a({circular:u.circular,_nodes:u.nodes,_links:u.links,_groups:u.groups,_groupLookup:u.groupLookup})}}}),Nk=g({"node_modules/d3-quadtree/dist/d3-quadtree.js"(t,r){var i;i=t,function(t){function r(t,r,i,n){if(isNaN(r)||isNaN(i))return t;var a,o,s,l,u,c,h,d,f,p=t._root,m={data:n},g=t._x0,y=t._y0,v=t._x1,x=t._y1;if(!p)return t._root=m,t;for(;p.length;)if((c=r>=(o=(g+v)/2))?g=o:v=o,(h=i>=(s=(y+x)/2))?y=s:x=s,a=p,!(p=p[d=h<<1|c]))return a[d]=m,t;if(l=+t._x.call(null,p.data),u=+t._y.call(null,p.data),r===l&&i===u)return m.next=p,a?a[d]=m:t._root=m,t;do a=a?a[d]=[,,,,]:t._root=[,,,,],(c=r>=(o=(g+v)/2))?g=o:v=o,(h=i>=(s=(y+x)/2))?y=s:x=s;while((d=h<<1|c)==(f=(u>=s)<<1|l>=o));return a[f]=p,a[d]=m,t}function i(t,r,i,n,a){this.node=t,this.x0=r,this.y0=i,this.x1=n,this.y1=a}function n(t){return t[0]}function a(t){return t[1]}function o(t,r,i){var o=new s(r??n,i??a,NaN,NaN,NaN,NaN);return null==t?o:o.addAll(t)}function s(t,r,i,n,a,o){this._x=t,this._y=r,this._x0=i,this._y0=n,this._x1=a,this._y1=o,this._root=void 0}function l(t){for(var r={data:t.data},i=r;t=t.next;)i=i.next={data:t.data};return r}var u=o.prototype=s.prototype;u.copy=function(){var t,r,i=new s(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return i;if(!n.length)return i._root=l(n),i;for(t=[{source:n,target:i._root=[,,,,]}];n=t.pop();)for(var a=0;a<4;++a)(r=n.source[a])&&(r.length?t.push({source:r,target:n.target[a]=[,,,,]}):n.target[a]=l(r));return i},u.add=function(t){var i=+this._x.call(null,t),n=+this._y.call(null,t);return r(this.cover(i,n),i,n,t)},u.addAll=function(t){var i,n,a,o,s=t.length,l=Array(s),u=Array(s),c=1/0,h=1/0,d=-1/0,f=-1/0;for(n=0;nd&&(d=a),of&&(f=o));if(c>d||h>f)return this;for(this.cover(c,h).cover(d,f),n=0;nt||t>=a||n>r||r>=o;)switch((s=[,,,,])[l=(rp||(s=c.y0)>m||(l=c.x1)=x)<<1|t>=v)&&(c=g[g.length-1],g[g.length-1]=g[g.length-1-h],g[g.length-1-h]=c)}else{var b=t-this._x.call(null,y.data),_=r-this._y.call(null,y.data),w=b*b+_*_;if(w=(l=(m+y)/2))?m=l:y=l,(h=s>=(u=(g+v)/2))?g=u:v=u,r=p,!(p=p[d=h<<1|c]))return this;if(!p.length)break;(r[d+1&3]||r[d+2&3]||r[d+3&3])&&(i=r,f=d)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(a=p.next)&&delete p.next,n?a?n.next=a:delete n.next:r?(a?r[d]=a:delete r[d],(p=r[0]||r[1]||r[2]||r[3])&&p===(r[3]||r[2]||r[1]||r[0])&&!p.length&&(i?i[f]=p:this._root=p)):this._root=a,this},u.removeAll=function(t){for(var r=0,i=t.length;rtypeof r?t:(i=i||self).d3=i.d3||{})}}),NS=g({"node_modules/d3-collection/dist/d3-collection.js"(t,r){(function(t){function r(){}function i(t,i){var n=new r;if(t instanceof r)t.each(function(t,r){n.set(r,t)});else if(Array.isArray(t)){var a,o=-1,s=t.length;if(null==i)for(;++o=u.length)return null!=t&&n.sort(t),null!=r?r(n):n;for(var l,c,d,f=-1,p=n.length,m=u[a++],g=i(),y=o();++fu.length)return i;var a,o=c[n-1];return null!=r&&n>=u.length?a=i.entries():(a=[],i.each(function(r,i){a.push({key:i,values:t(r,n)})})),null!=o?a.sort(function(t,r){return o(t.key,r.key)}):a}(h(t,0,o,s),0)},key:function(t){return u.push(t),l},sortKeys:function(t){return c[u.length-1]=t,l},sortValues:function(r){return t=r,l},rollup:function(t){return r=t,l}}},t.set=c,t.map=i,t.keys=function(t){var r=[];for(var i in t)r.push(i);return r},t.values=function(t){var r=[];for(var i in t)r.push(t[i]);return r},t.entries=function(t){var r=[];for(var i in t)r.push({key:i,value:t[i]});return r},Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof t&&"u">typeof r?t:t.d3=t.d3||{})}}),NE=g({"node_modules/d3-dispatch/dist/d3-dispatch.js"(t,r){var i;i=t,function(t){var r={value:function(){}};function i(){for(var t,r=0,i=arguments.length,a={};r=0&&(r=t.slice(i+1),t=t.slice(0,i)),t&&!n.hasOwnProperty(t))throw Error("unknown type: "+t);return{type:t,name:r}}),s=-1,l=o.length;if(arguments.length<2){for(;++s0)for(var i,n,a=Array(i),o=0;otypeof r?t:(i=i||self).d3=i.d3||{})}}),ND=g({"node_modules/d3-timer/dist/d3-timer.js"(t,r){var i;i=t,function(t){var r,i,n=0,a=0,o=0,s=0,l=0,u=0,c="object"==typeof performance&&performance.now?performance:Date,h="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function d(){return l||(h(f),l=c.now()+u)}function f(){l=0}function p(){this._call=this._time=this._next=null}function m(t,r,i){var n=new p;return n.restart(t,r,i),n}function g(){d(),++n;for(var t,i=r;i;)(t=l-i._time)>=0&&i._call.call(null,t),i=i._next;--n}function y(){l=(s=c.now())+u,n=a=0;try{g()}finally{n=0,function(){for(var t,n,a=r,o=1/0;a;)a._call?(o>a._time&&(o=a._time),t=a,a=a._next):(n=a._next,a._next=null,a=t?t._next=n:r=n);i=t,x(o)}(),l=0}}function v(){var t=c.now(),r=t-s;r>1e3&&(u-=r,s=t)}function x(t){!n&&(a&&(a=clearTimeout(a)),t-l>24?(t<1/0&&(a=setTimeout(y,t-c.now()-u)),o&&(o=clearInterval(o))):(o||(s=c.now(),o=setInterval(v,1e3)),n=1,h(y)))}p.prototype=m.prototype={constructor:p,restart:function(t,n,a){if("function"!=typeof t)throw TypeError("callback is not a function");a=(null==a?d():+a)+(null==n?0:+n),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=a,x()},stop:function(){this._call&&(this._call=null,this._time=1/0,x())}},t.interval=function(t,r,i){var n=new p,a=r;return null==r?n.restart(t,r,i):(r*=1,i=null==i?d():+i,n.restart(function o(s){s+=a,n.restart(o,a+=r,i),t(s)},r,i)),n},t.now=d,t.timeout=function(t,r,i){var n=new p;return r=null==r?0:+r,n.restart(function(i){n.stop(),t(i+r)},r,i),n},t.timer=m,t.timerFlush=g,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&"u">typeof r?t:(i=i||self).d3=i.d3||{})}}),NC=g({"node_modules/d3-force/dist/d3-force.js"(t,r){var i;i=function(t,r,i,n,a){function o(t){return function(){return t}}function s(){return(Math.random()-.5)*1e-6}function l(t){return t.x+t.vx}function u(t){return t.y+t.vy}function c(t){return t.index}function h(t,r){var i=t.get(r);if(!i)throw Error("missing: "+r);return i}function d(t){return t.x}function f(t){return t.y}var p=Math.PI*(3-Math.sqrt(5));t.forceCenter=function(t,r){var i;function n(){var n,a,o=i.length,s=0,l=0;for(n=0;nh.index){var d=f-l.x-l.vx,y=p-l.y-l.vy,v=d*d+y*y;vf+c||np+c||ot.r&&(t.r=t[r].r)}function f(){if(i){var r,a,o=i.length;for(n=Array(o),r=0;r=c)){(t.data!==i||t.next)&&(0===d&&(m+=(d=s())*d),0===f&&(m+=(f=s())*f),m1?(null==i?h.remove(t):h.set(t,v(i)),r):h.get(t)},find:function(r,i,n){var a,o,s,l,u,c=0,h=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(f.on(t,i),r):f.on(t)}}},t.forceX=function(t){var r,i,n,a=o(.1);function s(t){for(var a,o=0,s=r.length;otypeof r?i(t,Nk(),NS(),NE(),ND()):i(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3)}}),NI=g({"node_modules/d3-array/dist/d3-array.js"(t,r){var i;i=t,function(t){function r(t,r){return tr?1:t>=r?0:NaN}function i(t){var i;let n=t,a=t;function o(t,r,i,n){for(null==i&&(i=0),null==n&&(n=t.length);i>>1;0>a(t[o],r)?i=o+1:n=o}return i}return 1===t.length&&(n=(r,i)=>t(r)-i,i=t,a=(t,n)=>r(i(t),n)),{left:o,center:function(t,r,i,a){null==i&&(i=0),null==a&&(a=t.length);let s=o(t,r,i,a-1);return s>i&&n(t[s-1],r)>-n(t[s],r)?s-1:s},right:function(t,r,i,n){for(null==i&&(i=0),null==n&&(n=t.length);i>>1;a(t[o],r)>0?n=o:i=o+1}return i}}}function n(t){return null===t?NaN:+t}let a=i(r),o=a.right,s=a.left,l=i(n).center;function u(t,r){let i=0;if(void 0===r)for(let r of t)null!=r&&(r*=1)>=r&&++i;else{let n=-1;for(let a of t)null!=(a=r(a,++n,t))&&(a*=1)>=a&&++i}return i}function c(t){return 0|t.length}function h(t){return!(t>0)}function d(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function f(t,r){let i=0,n,a=0,o=0;if(void 0===r)for(let r of t)null!=r&&(r*=1)>=r&&(n=r-a,a+=n/++i,o+=n*(r-a));else{let s=-1;for(let l of t)null!=(l=r(l,++s,t))&&(l*=1)>=l&&(n=l-a,a+=n/++i,o+=n*(l-a))}if(i>1)return o/(i-1)}function p(t,r){let i=f(t,r);return i&&Math.sqrt(i)}function m(t,r){let i,n;if(void 0===r)for(let r of t)null!=r&&(void 0===i?r>=r&&(i=n=r):(i>r&&(i=r),n=o&&(i=n=o):(i>o&&(i=o),n0){for(o=t[--r];r>0&&(o=(i=o)+(n=t[--r]),!(a=n-(o-i))););r>0&&(a<0&&t[r-1]<0||a>0&&t[r-1]>0)&&(i=o+(n=2*a),n==i-o&&(o=i))}return o}}class y extends Map{constructor(t,r=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),null!=t)for(let[r,i]of t)this.set(r,i)}get(t){return super.get(x(this,t))}has(t){return super.has(x(this,t))}set(t,r){return super.set(b(this,t),r)}delete(t){return super.delete(_(this,t))}}class v extends Set{constructor(t,r=w){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),null!=t)for(let r of t)this.add(r)}has(t){return super.has(x(this,t))}add(t){return super.add(b(this,t))}delete(t){return super.delete(_(this,t))}}function x({_intern:t,_key:r},i){let n=r(i);return t.has(n)?t.get(n):i}function b({_intern:t,_key:r},i){let n=r(i);return t.has(n)?t.get(n):(t.set(n,i),i)}function _({_intern:t,_key:r},i){let n=r(i);return t.has(n)&&(i=t.get(i),t.delete(n)),i}function w(t){return null!==t&&"object"==typeof t?t.valueOf():t}function A(t){return t}function M(t,...r){return E(t,A,A,r)}function k(t,r,...i){return E(t,A,r,i)}function S(t){if(1!==t.length)throw Error("duplicate key");return t[0]}function E(t,r,i,n){return function t(a,o){if(o>=n.length)return i(a);let s=new y,l=n[o++],u=-1;for(let t of a){let r=l(t,++u,a),i=s.get(r);i?i.push(t):s.set(r,[t])}for(let[r,i]of s)s.set(r,t(i,o));return r(s)}(t,0)}function D(t,r){return Array.from(r,r=>t[r])}function C(t,...i){if("function"!=typeof t[Symbol.iterator])throw TypeError("values is not iterable");t=Array.from(t);let[n=r]=i;if(1===n.length||i.length>1){let a=Uint32Array.from(t,(t,r)=>r);return i.length>1?(i=i.map(r=>t.map(r)),a.sort((t,n)=>{for(let a of i){let i=r(a[t],a[n]);if(i)return i}})):(n=t.map(n),a.sort((t,i)=>r(n[t],n[i]))),D(t,a)}return t.sort(n)}var I=Array.prototype.slice;function L(t){return function(){return t}}var P=Math.sqrt(50),z=Math.sqrt(10),F=Math.sqrt(2);function O(t,r,i){var n,a,o,s,l=-1;if(i*=1,(t*=1)==(r*=1)&&i>0)return[t];if((n=r0){let i=Math.round(t/s),n=Math.round(r/s);for(i*sr&&--n,o=Array(a=n-i+1);++lr&&--n,o=Array(a=n-i+1);++l=0?(o>=P?10:o>=z?5:o>=F?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=P?10:o>=z?5:o>=F?2:1)}function B(t,r,i){let n;for(;;){let a=R(t,r,i);if(a===n||0===a||!isFinite(a))return[t,r];a>0?(t=Math.floor(t/a)*a,r=Math.ceil(r/a)*a):a<0&&(t=Math.ceil(t*a)/a,r=Math.floor(r*a)/a),n=a}}function j(t){return Math.ceil(Math.log(u(t))/Math.LN2)+1}function N(){var t=A,r=m,i=j;function n(n){Array.isArray(n)||(n=Array.from(n));var a,s,l=n.length,u=Array(l);for(a=0;a=d)if(t>=d&&r===m){let t=R(h,d,i);isFinite(t)&&(t>0?d=(Math.floor(d/t)+1)*t:t<0&&(d=-((Math.ceil(-(d*t))+1)/t)))}else f.pop()}for(var p=f.length;f[0]<=h;)f.shift(),--p;for(;f[p-1]>d;)f.pop(),--p;var g,y=Array(p+1);for(a=0;a<=p;++a)(g=y[a]=[]).x0=a>0?f[a-1]:h,g.x1=a=r)&&(i=r);else{let n=-1;for(let a of t)null!=(a=r(a,++n,t))&&(i=a)&&(i=a)}return i}function U(t,r){let i;if(void 0===r)for(let r of t)null!=r&&(i>r||void 0===i&&r>=r)&&(i=r);else{let n=-1;for(let a of t)null!=(a=r(a,++n,t))&&(i>a||void 0===i&&a>=a)&&(i=a)}return i}function q(t,i,n=0,a=t.length-1,o=r){for(;a>n;){if(a-n>600){let r=a-n+1,s=i-n+1,l=Math.log(r),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(r-u)/r)*(s-r/2<0?-1:1),h=Math.max(n,Math.floor(i-s*u/r+c)),d=Math.min(a,Math.floor(i+(r-s)*u/r+c));q(t,i,h,d,o)}let r=t[i],s=n,l=a;for(G(t,n,i),o(t[a],r)>0&&G(t,n,a);so(t[s],r);)++s;for(;o(t[l],r)>0;)--l}0===o(t[n],r)?G(t,n,l):G(t,++l,a),l<=i&&(n=l+1),i<=l&&(a=l-1)}return t}function G(t,r,i){let n=t[r];t[r]=t[i],t[i]=n}function H(t,r,i){if(n=(t=Float64Array.from(function*(t,r){if(void 0===r)for(let r of t)null!=r&&(r*=1)>=r&&(yield r);else{let i=-1;for(let n of t)null!=(n=r(n,++i,t))&&(n*=1)>=n&&(yield n)}}(t,i))).length){if((r*=1)<=0||n<2)return U(t);if(r>=1)return V(t);var n,a=(n-1)*r,o=Math.floor(a),s=V(q(t,o).subarray(0,o+1));return s+(U(t.subarray(o+1))-s)*(a-o)}}function $(t,r){let i,n=-1,a=-1;if(void 0===r)for(let r of t)++a,null!=r&&(i=r)&&(i=r,n=a);else for(let o of t)null!=(o=r(o,++a,t))&&(i=o)&&(i=o,n=a);return n}function W(t,r){let i,n=-1,a=-1;if(void 0===r)for(let r of t)++a,null!=r&&(i>r||void 0===i&&r>=r)&&(i=r,n=a);else for(let o of t)null!=(o=r(o,++a,t))&&(i>o||void 0===i&&o>=o)&&(i=o,n=a);return n}function Y(t,r){return[t,r]}function Z(t,i=r){if(1===i.length)return W(t,i);let n,a=-1,o=-1;for(let r of t)++o,(a<0?0===i(r,r):0>i(r,n))&&(n=r,a=o);return a}var X=K(Math.random);function K(t){return function(r,i=0,n=r.length){let a=n-(i*=1);for(;a;){let n=t()*a--|0,o=r[a+i];r[a+i]=r[n+i],r[n+i]=o}return r}}function J(t){if(!(a=t.length))return[];for(var r=-1,i=U(t,Q),n=Array(i);++rr(...t)),n=(t=t.map(d)).map(c),a=t.length-1,o=Array(a+1).fill(0),s=[];if(a<0||n.some(h))return s;for(;;){s.push(o.map((r,i)=>t[i][r]));let r=a;for(;++o[r]===n[r];){if(0===r)return i?s.map(i):s;o[r--]=0}}},t.cumsum=function(t,r){var i=0,n=0;return Float64Array.from(t,void 0===r?t=>i+=+t||0:a=>i+=+r(a,n++,t)||0)},t.descending=function(t,r){return rt?1:r>=t?0:NaN},t.deviation=p,t.difference=function(t,...r){for(let i of(t=new Set(t),r))for(let r of i)t.delete(r);return t},t.disjoint=function(t,r){let i=r[Symbol.iterator](),n=new Set;for(let r of t){let t,a;if(n.has(r))return!1;for(;({value:t,done:a}=i.next())&&!a;){if(Object.is(r,t))return!1;n.add(t)}}return!0},t.every=function(t,r){if("function"!=typeof r)throw TypeError("test is not a function");let i=-1;for(let n of t)if(!r(n,++i,t))return!1;return!0},t.extent=m,t.fcumsum=function(t,r){let i=new g,n=-1;return Float64Array.from(t,void 0===r?t=>i.add(+t||0):a=>i.add(+r(a,++n,t)||0))},t.filter=function(t,r){if("function"!=typeof r)throw TypeError("test is not a function");let i=[],n=-1;for(let a of t)r(a,++n,t)&&i.push(a);return i},t.fsum=function(t,r){let i=new g;if(void 0===r)for(let r of t)(r*=1)&&i.add(r);else{let n=-1;for(let a of t)(a=+r(a,++n,t))&&i.add(a)}return+i},t.greatest=function(t,i=r){let n,a=!1;if(1===i.length){let o;for(let s of t){let t=i(s);(a?r(t,o)>0:0===r(t,t))&&(n=s,o=t,a=!0)}}else for(let r of t)(a?i(r,n)>0:0===i(r,r))&&(n=r,a=!0);return n},t.greatestIndex=function(t,i=r){if(1===i.length)return $(t,i);let n,a=-1,o=-1;for(let r of t)++o,(a<0?0===i(r,r):i(r,n)>0)&&(n=r,a=o);return a},t.group=M,t.groupSort=function(t,i,n){return(1===i.length?C(k(t,i,n),([t,i],[n,a])=>r(i,a)||r(t,n)):C(M(t,n),([t,n],[a,o])=>i(n,o)||r(t,a))).map(([t])=>t)},t.groups=function(t,...r){return E(t,Array.from,A,r)},t.histogram=N,t.index=function(t,...r){return E(t,A,S,r)},t.indexes=function(t,...r){return E(t,Array.from,S,r)},t.intersection=function(t,...r){t=new Set(t),r=r.map(ee);e:for(let i of t)for(let n of r)if(!n.has(i)){t.delete(i);continue e}return t},t.least=function(t,i=r){let n,a=!1;if(1===i.length){let o;for(let s of t){let t=i(s);(a?0>r(t,o):0===r(t,t))&&(n=s,o=t,a=!0)}}else for(let r of t)(a?0>i(r,n):0===i(r,r))&&(n=r,a=!0);return n},t.leastIndex=Z,t.map=function(t,r){if("function"!=typeof t[Symbol.iterator])throw TypeError("values is not iterable");if("function"!=typeof r)throw TypeError("mapper is not a function");return Array.from(t,(i,n)=>r(i,n,t))},t.max=V,t.maxIndex=$,t.mean=function(t,r){let i=0,n=0;if(void 0===r)for(let r of t)null!=r&&(r*=1)>=r&&(++i,n+=r);else{let a=-1;for(let o of t)null!=(o=r(o,++a,t))&&(o*=1)>=o&&(++i,n+=o)}if(i)return n/i},t.median=function(t,r){return H(t,.5,r)},t.merge=function(t){return Array.from(function*(t){for(let r of t)yield*T(r)}(t))},t.min=U,t.minIndex=W,t.nice=B,t.pairs=function(t,r=Y){let i=[],n,a=!1;for(let o of t)a&&i.push(r(n,o)),n=o,a=!0;return i},t.permute=D,t.quantile=H,t.quantileSorted=function(t,r,i=n){if(a=t.length){if((r*=1)<=0||a<2)return+i(t[0],0,t);if(r>=1)return+i(t[a-1],a-1,t);var a,o=(a-1)*r,s=Math.floor(o),l=+i(t[s],s,t);return l+(i(t[s+1],s+1,t)-l)*(o-s)}},t.quickselect=q,t.range=function(t,r,i){t*=1,r*=1,i=(a=arguments.length)<2?(r=t,t=0,1):a<3?1:+i;for(var n=-1,a=0|Math.max(0,Math.ceil((r-t)/i)),o=Array(a);++n=P?a*=10:o>=z?a*=5:o>=F&&(a*=2),rtypeof r?t:(i="u">typeof globalThis?globalThis:i||self).d3=i.d3||{})}}),NL=g({"node_modules/d3-path/dist/d3-path.js"(t,r){var i;i=t,function(t){var r=Math.PI,i=2*r,n=i-1e-6;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function o(){return new a}a.prototype=o.prototype={constructor:a,moveTo:function(t,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+r)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,r){this._+="L"+(this._x1=+t)+","+(this._y1=+r)},quadraticCurveTo:function(t,r,i,n){this._+="Q"+ +t+","+ +r+","+(this._x1=+i)+","+(this._y1=+n)},bezierCurveTo:function(t,r,i,n,a,o){this._+="C"+ +t+","+ +r+","+ +i+","+ +n+","+(this._x1=+a)+","+(this._y1=+o)},arcTo:function(t,i,n,a,o){t*=1,i*=1,n*=1,a*=1,o*=1;var s=this._x1,l=this._y1,u=n-t,c=a-i,h=s-t,d=l-i,f=h*h+d*d;if(o<0)throw Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(f>1e-6)if(Math.abs(d*u-c*h)>1e-6&&o){var p=n-s,m=a-l,g=u*u+c*c,y=Math.sqrt(g),v=Math.sqrt(f),x=o*Math.tan((r-Math.acos((g+f-(p*p+m*m))/(2*y*v)))/2),b=x/v,_=x/y;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*h)+","+(i+b*d)),this._+="A"+o+","+o+",0,0,"+ +(d*p>h*m)+","+(this._x1=t+_*u)+","+(this._y1=i+_*c)}else this._+="L"+(this._x1=t)+","+(this._y1=i)},arc:function(t,a,o,s,l,u){t*=1,a*=1,o*=1,u=!!u;var c=o*Math.cos(s),h=o*Math.sin(s),d=t+c,f=a+h,p=1^u,m=u?s-l:l-s;if(o<0)throw Error("negative radius: "+o);null===this._x1?this._+="M"+d+","+f:(Math.abs(this._x1-d)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+d+","+f),o&&(m<0&&(m=m%i+i),m>n?this._+="A"+o+","+o+",0,1,"+p+","+(t-c)+","+(a-h)+"A"+o+","+o+",0,1,"+p+","+(this._x1=d)+","+(this._y1=f):m>1e-6&&(this._+="A"+o+","+o+",0,"+ +(m>=r)+","+p+","+(this._x1=t+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(t,r,i,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+r)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},toString:function(){return this._}},t.path=o,Object.defineProperty(t,"__esModule",{value:!0})}("object"==typeof t&&"u">typeof r?t:(i=i||self).d3=i.d3||{})}}),NP=g({"node_modules/d3-shape/dist/d3-shape.js"(t,r){var i,n;i=t,n=function(t,r){function i(t){return function(){return t}}var n=Math.abs,a=Math.atan2,o=Math.cos,s=Math.max,l=Math.min,u=Math.sin,c=Math.sqrt,h=Math.PI,d=h/2,f=2*h;function p(t){return t>=1?d:t<=-1?-d:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function v(t){return t.endAngle}function x(t){return t&&t.padAngle}function b(t,r,i,n,a,o,l){var u=t-i,h=r-n,d=(l?o:-o)/c(u*u+h*h),f=d*h,p=-d*u,m=t+f,g=r+p,y=i+f,v=n+p,x=(m+y)/2,b=(g+v)/2,_=y-m,w=v-g,T=_*_+w*w,A=a-o,M=m*v-y*g,k=(w<0?-1:1)*c(s(0,A*A*T-M*M)),S=(M*w-_*k)/T,E=(-M*_-w*k)/T,D=(M*w+_*k)/T,C=(-M*_+w*k)/T,I=S-x,L=E-b,P=D-x,z=C-b;return I*I+L*L>P*P+z*z&&(S=D,E=C),{cx:S,cy:E,x01:-f,y01:-p,x11:S*(a/A-1),y11:E*(a/A-1)}}function _(t){this._context=t}function w(t){return new _(t)}function T(t){return t[0]}function A(t){return t[1]}function M(){var t=T,n=A,a=i(!0),o=null,s=w,l=null;function u(i){var u,c,h,d=i.length,f=!1;for(null==o&&(l=s(h=r.path())),u=0;u<=d;++u)!(u=d;--f)c.point(v[f],x[f]);c.lineEnd(),c.areaEnd()}y&&(v[h]=+t(p,h,i),x[h]=+a(p,h,i),c.point(n?+n(p,h,i):v[h],o?+o(p,h,i):x[h]))}if(m)return c=null,m+""||null}function d(){return M().defined(s).curve(u).context(l)}return h.x=function(r){return arguments.length?(t="function"==typeof r?r:i(+r),n=null,h):t},h.x0=function(r){return arguments.length?(t="function"==typeof r?r:i(+r),h):t},h.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:i(+t),h):n},h.y=function(t){return arguments.length?(a="function"==typeof t?t:i(+t),o=null,h):a},h.y0=function(t){return arguments.length?(a="function"==typeof t?t:i(+t),h):a},h.y1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:i(+t),h):o},h.lineX0=h.lineY0=function(){return d().x(t).y(a)},h.lineY1=function(){return d().x(t).y(o)},h.lineX1=function(){return d().x(n).y(a)},h.defined=function(t){return arguments.length?(s="function"==typeof t?t:i(!!t),h):s},h.curve=function(t){return arguments.length?(u=t,null!=l&&(c=u(l)),h):u},h.context=function(t){return arguments.length?(null==t?l=c=null:c=u(l=t),h):l},h}function S(t,r){return rt?1:r>=t?0:NaN}function E(t){return t}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,r){switch(t*=1,r*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 1:this._point=2;default:this._context.lineTo(t,r)}}};var D=I(w);function C(t){this._curve=t}function I(t){function r(r){return new C(t(r))}return r._curve=t,r}function L(t){var r=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?r(I(t)):r()._curve},t}function P(){return L(M().curve(D))}function z(){var t=k().curve(D),r=t.curve,i=t.lineX0,n=t.lineX1,a=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return L(i())},delete t.lineX0,t.lineEndAngle=function(){return L(n())},delete t.lineX1,t.lineInnerRadius=function(){return L(a())},delete t.lineY0,t.lineOuterRadius=function(){return L(o())},delete t.lineY1,t.curve=function(t){return arguments.length?r(I(t)):r()._curve},t}function F(t,r){return[(r*=1)*Math.cos(t-=Math.PI/2),r*Math.sin(t)]}C.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,r){this._curve.point(r*Math.sin(t),-(r*Math.cos(t)))}};var O=Array.prototype.slice;function R(t){return t.source}function B(t){return t.target}function j(t){var n=R,a=B,o=T,s=A,l=null;function u(){var i,u=O.call(arguments),c=n.apply(this,u),h=a.apply(this,u);if(l||(l=i=r.path()),t(l,+o.apply(this,(u[0]=c,u)),+s.apply(this,u),+o.apply(this,(u[0]=h,u)),+s.apply(this,u)),i)return l=null,i+""||null}return u.source=function(t){return arguments.length?(n=t,u):n},u.target=function(t){return arguments.length?(a=t,u):a},u.x=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),u):o},u.y=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),u):s},u.context=function(t){return arguments.length?(l=t??null,u):l},u}function N(t,r,i,n,a){t.moveTo(r,i),t.bezierCurveTo(r=(r+n)/2,i,r,a,n,a)}function V(t,r,i,n,a){t.moveTo(r,i),t.bezierCurveTo(r,i=(i+a)/2,n,i,n,a)}function U(t,r,i,n,a){var o=F(r,i),s=F(r,i=(i+a)/2),l=F(n,i),u=F(n,a);t.moveTo(o[0],o[1]),t.bezierCurveTo(s[0],s[1],l[0],l[1],u[0],u[1])}var q={draw:function(t,r){var i=Math.sqrt(r/h);t.moveTo(i,0),t.arc(0,0,i,0,f)}},G={draw:function(t,r){var i=Math.sqrt(r/5)/2;t.moveTo(-3*i,-i),t.lineTo(-i,-i),t.lineTo(-i,-3*i),t.lineTo(i,-3*i),t.lineTo(i,-i),t.lineTo(3*i,-i),t.lineTo(3*i,i),t.lineTo(i,i),t.lineTo(i,3*i),t.lineTo(-i,3*i),t.lineTo(-i,i),t.lineTo(-3*i,i),t.closePath()}},H=Math.sqrt(1/3),$=2*H,W={draw:function(t,r){var i=Math.sqrt(r/$),n=i*H;t.moveTo(0,-i),t.lineTo(n,0),t.lineTo(0,i),t.lineTo(-n,0),t.closePath()}},Y=Math.sin(h/10)/Math.sin(7*h/10),Z=Math.sin(f/10)*Y,X=-Math.cos(f/10)*Y,K={draw:function(t,r){var i=Math.sqrt(.8908130915292852*r),n=Z*i,a=X*i;t.moveTo(0,-i),t.lineTo(n,a);for(var o=1;o<5;++o){var s=f*o/5,l=Math.cos(s),u=Math.sin(s);t.lineTo(u*i,-l*i),t.lineTo(l*n-u*a,u*n+l*a)}t.closePath()}},J={draw:function(t,r){var i=Math.sqrt(r),n=-i/2;t.rect(n,n,i,i)}},Q=Math.sqrt(3),ee={draw:function(t,r){var i=-Math.sqrt(r/(3*Q));t.moveTo(0,2*i),t.lineTo(-Q*i,-i),t.lineTo(Q*i,-i),t.closePath()}},et=Math.sqrt(3)/2,er=1/Math.sqrt(12),ei=(er/2+1)*3,en={draw:function(t,r){var i=Math.sqrt(r/ei),n=i/2,a=i*er,o=i*er+i,s=-n;t.moveTo(n,a),t.lineTo(n,o),t.lineTo(s,o),t.lineTo(-.5*n-et*a,et*n+-.5*a),t.lineTo(-.5*n-et*o,et*n+-.5*o),t.lineTo(-.5*s-et*o,et*s+-.5*o),t.lineTo(-.5*n+et*a,-.5*a-et*n),t.lineTo(-.5*n+et*o,-.5*o-et*n),t.lineTo(-.5*s+et*o,-.5*o-et*s),t.closePath()}},ea=[q,G,W,J,K,ee,en];function eo(){}function es(t,r,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+r)/6,(t._y0+4*t._y1+i)/6)}function el(t){this._context=t}function eu(t){this._context=t}function ec(t){this._context=t}function eh(t,r){this._basis=new el(t),this._beta=r}el.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:es(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,r){switch(t*=1,r*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:es(this,t,r)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=r}},eu.prototype={areaStart:eo,areaEnd:eo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,r){switch(t*=1,r*=1,this._point){case 0:this._point=1,this._x2=t,this._y2=r;break;case 1:this._point=2,this._x3=t,this._y3=r;break;case 2:this._point=3,this._x4=t,this._y4=r,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+r)/6);break;default:es(this,t,r)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=r}},ec.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,r){switch(t*=1,r*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+r)/6;this._line?this._context.lineTo(i,n):this._context.moveTo(i,n);break;case 3:this._point=4;default:es(this,t,r)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=r}},eh.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,r=this._y,i=t.length-1;if(i>0)for(var n,a=t[0],o=r[0],s=t[i]-a,l=r[i]-o,u=-1;++u<=i;)n=u/i,this._basis.point(this._beta*t[u]+(1-this._beta)*(a+n*s),this._beta*r[u]+(1-this._beta)*(o+n*l));this._x=this._y=null,this._basis.lineEnd()},point:function(t,r){this._x.push(+t),this._y.push(+r)}};var ed=function t(r){function i(t){return 1===r?new el(t):new eh(t,r)}return i.beta=function(r){return t(+r)},i}(.85);function ef(t,r,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-r),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function ep(t,r){this._context=t,this._k=(1-r)/6}ep.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ef(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,r){switch(t*=1,r*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 1:this._point=2,this._x1=t,this._y1=r;break;case 2:this._point=3;default:ef(this,t,r)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=r}};var em=function t(r){function i(t){return new ep(t,r)}return i.tension=function(r){return t(+r)},i}(0);function eg(t,r){this._context=t,this._k=(1-r)/6}eg.prototype={areaStart:eo,areaEnd:eo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,r){switch(t*=1,r*=1,this._point){case 0:this._point=1,this._x3=t,this._y3=r;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=r);break;case 2:this._point=3,this._x5=t,this._y5=r;break;default:ef(this,t,r)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=r}};var ey=function t(r){function i(t){return new eg(t,r)}return i.tension=function(r){return t(+r)},i}(0);function ev(t,r){this._context=t,this._k=(1-r)/6}ev.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,r){switch(t*=1,r*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ef(this,t,r)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=r}};var ex=function t(r){function i(t){return new ev(t,r)}return i.tension=function(r){return t(+r)},i}(0);function eb(t,r,i){var n=t._x1,a=t._y1,o=t._x2,s=t._y2;if(t._l01_a>1e-12){var l=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*l-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,a=(a*l-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>1e-12){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-r*t._l12_2a)/h,s=(s*c+t._y1*t._l23_2a-i*t._l12_2a)/h}t._context.bezierCurveTo(n,a,o,s,t._x2,t._y2)}function e_(t,r){this._context=t,this._alpha=r}e_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,r){if(t*=1,r*=1,this._point){var i=this._x2-t,n=this._y2-r;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 1:this._point=2;break;case 2:this._point=3;default:eb(this,t,r)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=r}};var ew=function t(r){function i(t){return r?new e_(t,r):new ep(t,0)}return i.alpha=function(r){return t(+r)},i}(.5);function eT(t,r){this._context=t,this._alpha=r}eT.prototype={areaStart:eo,areaEnd:eo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,r){if(t*=1,r*=1,this._point){var i=this._x2-t,n=this._y2-r;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=r;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=r);break;case 2:this._point=3,this._x5=t,this._y5=r;break;default:eb(this,t,r)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=r}};var eA=function t(r){function i(t){return r?new eT(t,r):new eg(t,0)}return i.alpha=function(r){return t(+r)},i}(.5);function eM(t,r){this._context=t,this._alpha=r}eM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,r){if(t*=1,r*=1,this._point){var i=this._x2-t,n=this._y2-r;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eb(this,t,r)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=r}};var ek=function t(r){function i(t){return r?new eM(t,r):new ev(t,0)}return i.alpha=function(r){return t(+r)},i}(.5);function eS(t){this._context=t}eS.prototype={areaStart:eo,areaEnd:eo,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,r){t*=1,r*=1,this._point?this._context.lineTo(t,r):(this._point=1,this._context.moveTo(t,r))}};function eE(t,r,i){var n=t._x1-t._x0,a=r-t._x1,o=(t._y1-t._y0)/(n||a<0&&-0),s=(i-t._y1)/(a||n<0&&-0);return((o<0?-1:1)+(s<0?-1:1))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs((o*a+s*n)/(n+a)))||0}function eD(t,r){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-r)/2:r}function eC(t,r,i){var n=t._x0,a=t._y0,o=t._x1,s=t._y1,l=(o-n)/3;t._context.bezierCurveTo(n+l,a+l*r,o-l,s-l*i,o,s)}function eI(t){this._context=t}function eL(t){this._context=new eP(t)}function eP(t){this._context=t}function ez(t){this._context=t}function eF(t){var r,i,n=t.length-1,a=Array(n),o=Array(n),s=Array(n);for(a[0]=0,o[0]=2,s[0]=t[0]+2*t[1],r=1;r=0;--r)a[r]=(s[r]-a[r+1])/o[r];for(o[n-1]=(t[n]+a[n-1])/2,r=0;r1)for(var i,n,a,o=1,s=t[r[0]],l=s.length;o=0;)i[r]=r;return i}function ej(t,r){return t[r]}function eN(t){var r=t.map(eV);return eB(t).sort(function(t,i){return r[t]-r[i]})}function eV(t){for(var r,i=-1,n=0,a=t.length,o=-1/0;++io&&(o=r,n=i);return n}function eU(t){var r=t.map(eq);return eB(t).sort(function(t,i){return r[t]-r[i]})}function eq(t){for(var r,i=0,n=-1,a=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,r){switch(t*=1,r*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,r),this._context.lineTo(t,r);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,r)}}this._x=t,this._y=r}},t.arc=function(){var t=m,s=g,_=i(0),w=null,T=y,A=v,M=x,k=null;function S(){var i,m,g=+t.apply(this,arguments),y=+s.apply(this,arguments),v=T.apply(this,arguments)-d,x=A.apply(this,arguments)-d,S=n(x-v),E=x>v;if(k||(k=i=r.path()),y1e-12)if(S>f-1e-12)k.moveTo(y*o(v),y*u(v)),k.arc(0,0,y,v,x,!E),g>1e-12&&(k.moveTo(g*o(x),g*u(x)),k.arc(0,0,g,x,v,E));else{var D,C,I=v,L=x,P=v,z=x,F=S,O=S,R=M.apply(this,arguments)/2,B=R>1e-12&&(w?+w.apply(this,arguments):c(g*g+y*y)),j=l(n(y-g)/2,+_.apply(this,arguments)),N=j,V=j;if(B>1e-12){var U=p(B/g*u(R)),q=p(B/y*u(R));(F-=2*U)>1e-12?(U*=E?1:-1,P+=U,z-=U):(F=0,P=z=(v+x)/2),(O-=2*q)>1e-12?(q*=E?1:-1,I+=q,L-=q):(O=0,I=L=(v+x)/2)}var G=y*o(I),H=y*u(I),$=g*o(z),W=g*u(z);if(j>1e-12){var Y,Z=y*o(L),X=y*u(L),K=g*o(P),J=g*u(P);if(S1?0:Q<-1?h:Math.acos(Q))/2),ea=c(Y[0]*Y[0]+Y[1]*Y[1]);N=l(j,(g-ea)/(en-1)),V=l(j,(y-ea)/(en+1))}}O>1e-12?V>1e-12?(D=b(K,J,G,H,y,V,E),C=b(Z,X,$,W,y,V,E),k.moveTo(D.cx+D.x01,D.cy+D.y01),V1e-12&&F>1e-12?N>1e-12?(D=b($,W,Z,X,g,-N,E),C=b(G,H,K,J,g,-N,E),k.lineTo(D.cx+D.x01,D.cy+D.y01),N0&&(m+=d);for(null!=r?g.sort(function(t,i){return r(y[t],y[i])}):null!=n&&g.sort(function(t,r){return n(i[t],i[r])}),l=0,c=m?(x-p*_)/m:0;l0?d*c:0)+_,y[u]={data:i[u],index:l,value:d,startAngle:v,endAngle:h,padAngle:b};return y}return l.value=function(r){return arguments.length?(t="function"==typeof r?r:i(+r),l):t},l.sortValues=function(t){return arguments.length?(r=t,n=null,l):r},l.sort=function(t){return arguments.length?(n=t,r=null,l):n},l.startAngle=function(t){return arguments.length?(a="function"==typeof t?t:i(+t),l):a},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),l):o},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:i(+t),l):s},l},t.pointRadial=F,t.radialArea=z,t.radialLine=P,t.stack=function(){var t=i([]),r=eB,n=eR,a=ej;function o(i){var o,s,l=t.apply(this,arguments),u=i.length,c=l.length,h=Array(c);for(o=0;o0)for(var i,n,a,o,s,l,u=0,c=t[r[0]].length;u0?(n[0]=o,n[1]=o+=a):a<0?(n[1]=s,n[0]=s+=a):(n[0]=0,n[1]=a)},t.stackOffsetExpand=function(t,r){if((n=t.length)>0){for(var i,n,a,o=0,s=t[0].length;o0){for(var i,n=0,a=t[r[0]],o=a.length;n0&&(n=(i=t[r[0]]).length)>0){for(var i,n,a,o=0,s=1;stypeof r?n(t,NL()):n((i=i||self).d3=i.d3||{},i.d3)}}),Nz=g({"node_modules/@plotly/d3-sankey/dist/@plotly/d3-sankey.js"(t,r){var i,n;i=t,n=function(t,r,i){function n(t){return t.target.depth}function a(t,r){return t.sourceLinks.length?t.depth:r-1}function o(t){return function(){return t}}function s(t,r){return u(t.source,r.source)||t.index-r.index}function l(t,r){return u(t.target,r.target)||t.index-r.index}function u(t,r){return t.y0-r.y0}function c(t){return t.value}function h(t){return t.index}function d(t){return t.nodes}function f(t){return t.links}function p(t,r){let i=t.get(r);if(!i)throw Error("missing: "+r);return i}function m({nodes:t}){for(let r of t){let t=r.y0,i=t;for(let i of r.sourceLinks)i.y0=t+i.width/2,t+=i.width;for(let t of r.targetLinks)t.y1=i+t.width/2,i+=t.width}}function g(t){return[t.source.x1,t.y0]}function y(t){return[t.target.x0,t.y1]}t.sankey=function(){let t=0,i=0,n=1,g=1,y=24,v=8,x,b=h,_=a,w,T,A=d,M=f,k=6,S=2/3;function E(){let a={nodes:A.apply(null,arguments),links:M.apply(null,arguments)};return function({nodes:t,links:r}){for(let[r,i]of t.entries())i.index=r,i.sourceLinks=[],i.targetLinks=[];let i=new Map(t.map((r,i)=>[b(r,i,t),r]));for(let[t,n]of r.entries()){n.index=t;let{source:r,target:a}=n;"object"!=typeof r&&(r=n.source=p(i,r)),"object"!=typeof a&&(a=n.target=p(i,a)),r.sourceLinks.push(n),a.targetLinks.push(n)}if(null!=T)for(let{sourceLinks:r,targetLinks:i}of t)r.sort(T),i.sort(T)}(a),function({nodes:t}){for(let i of t)i.value=void 0===i.fixedValue?Math.max(r.sum(i.sourceLinks,c),r.sum(i.targetLinks,c)):i.fixedValue}(a),function({nodes:t}){let r=t.length,i=new Set(t),n=new Set,a=0;for(;i.size;){for(let t of i)for(let{target:r}of(t.depth=a,t.sourceLinks))n.add(r);if(++a>r)throw Error("circular link");i=n,n=new Set}}(a),function({nodes:t}){let r=t.length,i=new Set(t),n=new Set,a=0;for(;i.size;){for(let t of i)for(let{source:r}of(t.height=a,t.targetLinks))n.add(r);if(++a>r)throw Error("circular link");i=n,n=new Set}}(a),function(a){let o=function({nodes:i}){let a=r.max(i,t=>t.depth)+1,o=(n-t-y)/(a-1),s=Array(a);for(let r of i){let i=Math.max(0,Math.min(a-1,Math.floor(_.call(null,r,a))));r.layer=i,r.x0=t+i*o,r.x1=r.x0+y,s[i]?s[i].push(r):s[i]=[r]}if(w)for(let t of s)t.sort(w);return s}(a);x=Math.min(v,S*(g-i)/(r.max(o,t=>t.length)-1)),function(t){let n=r.min(t,t=>(g-i-(t.length-1)*x)/r.sum(t,c));for(let r of t){let t=i;for(let i of r)for(let r of(i.y0=t,i.y1=t+i.value*n,t=i.y1+x,i.sourceLinks))r.width=r.value*n;t=(g-t+x)/(r.length+1);for(let i=0;i=0;--a){let n=t[a];for(let t of n){let i=0,n=0;for(let{target:r,value:a}of t.sourceLinks){let o=a*(r.layer-t.layer);i+=function(t,r){let i=r.y0-(r.targetLinks.length-1)*x/2;for(let{source:n,width:a}of r.targetLinks){if(n===t)break;i+=a+x}for(let{target:n,width:a}of t.sourceLinks){if(n===r)break;i-=a}return i}(t,r)*o,n+=o}if(!(n>0))continue;let a=(i/n-t.y0)*r;t.y0+=a,t.y1+=a,L(t)}void 0===w&&n.sort(u),D(n,i)}})(o,r,i),function(t,r,i){for(let n=1,a=t.length;n0))continue;let a=(i/n-t.y0)*r;t.y0+=a,t.y1+=a,L(t)}void 0===w&&a.sort(u),D(a,i)}}(o,r,i)}}(a),m(a),a}function D(t,r){let n=t.length>>1,a=t[n];I(t,a.y0-x,n-1,r),C(t,a.y1+x,n+1,r),I(t,g,t.length-1,r),C(t,i,0,r)}function C(t,r,i,n){for(;i1e-6&&(a.y0+=o,a.y1+=o),r=a.y1+x}}function I(t,r,i,n){for(;i>=0;--i){let a=t[i],o=(a.y1-r)*n;o>1e-6&&(a.y0-=o,a.y1-=o),r=a.y0-x}}function L({sourceLinks:t,targetLinks:r}){if(void 0===T){for(let{source:{sourceLinks:t}}of r)t.sort(l);for(let{target:{targetLinks:r}}of t)r.sort(s)}}return E.update=function(t){return m(t),t},E.nodeId=function(t){return arguments.length?(b="function"==typeof t?t:o(t),E):b},E.nodeAlign=function(t){return arguments.length?(_="function"==typeof t?t:o(t),E):_},E.nodeSort=function(t){return arguments.length?(w=t,E):w},E.nodeWidth=function(t){return arguments.length?(y=+t,E):y},E.nodePadding=function(t){return arguments.length?(v=x=+t,E):v},E.nodes=function(t){return arguments.length?(A="function"==typeof t?t:o(t),E):A},E.links=function(t){return arguments.length?(M="function"==typeof t?t:o(t),E):M},E.linkSort=function(t){return arguments.length?(T=t,E):T},E.size=function(r){return arguments.length?(t=i=0,n=+r[0],g=+r[1],E):[n-t,g-i]},E.extent=function(r){return arguments.length?(t=+r[0][0],n=+r[1][0],i=+r[0][1],g=+r[1][1],E):[[t,i],[n,g]]},E.iterations=function(t){return arguments.length?(k=+t,E):k},E},t.sankeyCenter=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?r.min(t.sourceLinks,n)-1:0},t.sankeyJustify=a,t.sankeyLeft=function(t){return t.depth},t.sankeyLinkHorizontal=function(){return i.linkHorizontal().source(g).target(y)},t.sankeyRight=function(t,r){return r-1-t.height},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&"u">typeof r?n(t,NI(),NP()):n((i=i||self).d3=i.d3||{},i.d3,i.d3)}}),NF=g({"node_modules/@plotly/d3-sankey-circular/node_modules/d3-array/dist/d3-array.js"(t,r){(function(t){function r(t,r){return tr?1:t>=r?0:NaN}function i(t){var i;return 1===t.length&&(i=t,t=function(t,n){return r(i(t),n)}),{left:function(r,i,n,a){for(null==n&&(n=0),null==a&&(a=r.length);n>>1;0>t(r[o],i)?n=o+1:a=o}return n},right:function(r,i,n,a){for(null==n&&(n=0),null==a&&(a=r.length);n>>1;t(r[o],i)>0?a=o:n=o+1}return n}}}var n=i(r),a=n.right,o=n.left;function s(t,r){return[t,r]}function l(t){return null===t?NaN:+t}function u(t,r){var i,n,a=t.length,o=0,s=-1,u=0,c=0;if(null==r)for(;++s1)return c/(o-1)}function c(t,r){var i=u(t,r);return i&&Math.sqrt(i)}function h(t,r){var i,n,a,o=t.length,s=-1;if(null==r){for(;++s=i)for(n=a=i;++si&&(n=i),a=i)for(n=a=i;++si&&(n=i),a=0?(o>=v?10:o>=x?5:o>=b?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=v?10:o>=x?5:o>=b?2:1)}function w(t,r,i){var n=Math.abs(r-t)/Math.max(0,i),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/a;return o>=v?a*=10:o>=x?a*=5:o>=b&&(a*=2),r=1)return+i(t[n-1],n-1,t);var n,a=(n-1)*r,o=Math.floor(a),s=+i(t[o],o,t);return s+(i(t[o+1],o+1,t)-s)*(a-o)}}function M(t,r){var i,n,a=t.length,o=-1;if(null==r){for(;++o=i)for(n=i;++oi&&(n=i)}else for(;++o=i)for(n=i;++oi&&(n=i);return n}function k(t){if(!(a=t.length))return[];for(var r=-1,i=M(t,S),n=Array(i);++rt?1:r>=t?0:NaN},t.deviation=c,t.extent=h,t.histogram=function(){var t=g,r=h,i=T;function n(n){var o,s,l=n.length,u=Array(l);for(o=0;od;)f.pop(),--p;var m,g=Array(p+1);for(o=0;o<=p;++o)(m=g[o]=[]).x0=o>0?f[o-1]:h,m.x1=o=i)for(n=i;++on&&(n=i)}else for(;++o=i)for(n=i;++on&&(n=i);return n},t.mean=function(t,r){var i,n=t.length,a=n,o=-1,s=0;if(null==r)for(;++o=0;)for(r=(n=t[a]).length;--r>=0;)i[--s]=n[r];return i},t.min=M,t.pairs=function(t,r){null==r&&(r=s);for(var i=0,n=t.length-1,a=t[0],o=Array(n<0?0:n);ii(a=t[o],l)||0!==i(l,l))&&(l=a,s=o);if(0===i(l,l))return s}},t.shuffle=function(t,r,i){for(var n,a,o=(i??t.length)-(r=null==r?0:+r);o;)a=Math.random()*o--|0,n=t[o+r],t[o+r]=t[a+r],t[a+r]=n;return t},t.sum=function(t,r){var i,n=t.length,a=-1,o=0;if(null==r)for(;++a0)return[t];if((n=r0)for(t=Math.ceil(t/s),o=Array(a=Math.ceil((r=Math.floor(r/s))-t+1));++ltypeof r?t:t.d3=t.d3||{})}}),NO=g({"node_modules/elementary-circuits-directed-graph/johnson.js"(t,r){var i=NA();r.exports=function(t,r){var n,a=[],o=[],s=[],l={},u=[];n=0;for(var c=t.length;n=r});for(var a,o=i(t),s=o.components.filter(function(t){return t.length>1}),l=1/0,u=0;u1||a>1)}function M(t,r,i){return t.sort(S),t.forEach(function(n,a){var o=0;if(N(n,i)&&A(n))n.circularPathData.verticalBuffer=o+n.width/2;else{for(var s,l,u=0;ul.source.column)){var c=t[u].circularPathData.verticalBuffer+t[u].width/2+r;o=c>o?c:o}n.circularPathData.verticalBuffer=o+n.width/2}}),t}function k(t,i,a,o){var s=r.min(t.links,function(t){return t.source.y0});t.links.forEach(function(t){t.circular&&(t.circularPathData={})}),M(t.links.filter(function(t){return"top"==t.circularLinkType}),i,o),M(t.links.filter(function(t){return"bottom"==t.circularLinkType}),i,o),t.links.forEach(function(r){if(r.circular){if(r.circularPathData.arcRadius=r.width+10,r.circularPathData.leftNodeBuffer=5,r.circularPathData.rightNodeBuffer=5,r.circularPathData.sourceWidth=r.source.x1-r.source.x0,r.circularPathData.sourceX=r.source.x0+r.circularPathData.sourceWidth,r.circularPathData.targetX=r.target.x0,r.circularPathData.sourceY=r.y0,r.circularPathData.targetY=r.y1,N(r,o)&&A(r))r.circularPathData.leftSmallArcRadius=10+r.width/2,r.circularPathData.leftLargeArcRadius=10+r.width/2,r.circularPathData.rightSmallArcRadius=10+r.width/2,r.circularPathData.rightLargeArcRadius=10+r.width/2,"bottom"==r.circularLinkType?(r.circularPathData.verticalFullExtent=r.source.y1+25+r.circularPathData.verticalBuffer,r.circularPathData.verticalLeftInnerExtent=r.circularPathData.verticalFullExtent-r.circularPathData.leftLargeArcRadius,r.circularPathData.verticalRightInnerExtent=r.circularPathData.verticalFullExtent-r.circularPathData.rightLargeArcRadius):(r.circularPathData.verticalFullExtent=r.source.y0-25-r.circularPathData.verticalBuffer,r.circularPathData.verticalLeftInnerExtent=r.circularPathData.verticalFullExtent+r.circularPathData.leftLargeArcRadius,r.circularPathData.verticalRightInnerExtent=r.circularPathData.verticalFullExtent+r.circularPathData.rightLargeArcRadius);else{var l,u=r.source.column,c=r.circularLinkType,h=t.links.filter(function(t){return t.source.column==u&&t.circularLinkType==c});"bottom"==r.circularLinkType?h.sort(D):h.sort(E);var d=0;h.forEach(function(t,n){t.circularLinkID==r.circularLinkID&&(r.circularPathData.leftSmallArcRadius=10+r.width/2+d,r.circularPathData.leftLargeArcRadius=10+r.width/2+n*i+d),d+=t.width}),u=r.target.column,h=t.links.filter(function(t){return t.target.column==u&&t.circularLinkType==c}),"bottom"==r.circularLinkType?h.sort(I):h.sort(C),d=0,h.forEach(function(t,n){t.circularLinkID==r.circularLinkID&&(r.circularPathData.rightSmallArcRadius=10+r.width/2+d,r.circularPathData.rightLargeArcRadius=10+r.width/2+n*i+d),d+=t.width}),"bottom"==r.circularLinkType?(r.circularPathData.verticalFullExtent=Math.max(a,r.source.y1,r.target.y1)+25+r.circularPathData.verticalBuffer,r.circularPathData.verticalLeftInnerExtent=r.circularPathData.verticalFullExtent-r.circularPathData.leftLargeArcRadius,r.circularPathData.verticalRightInnerExtent=r.circularPathData.verticalFullExtent-r.circularPathData.rightLargeArcRadius):(r.circularPathData.verticalFullExtent=s-25-r.circularPathData.verticalBuffer,r.circularPathData.verticalLeftInnerExtent=r.circularPathData.verticalFullExtent+r.circularPathData.leftLargeArcRadius,r.circularPathData.verticalRightInnerExtent=r.circularPathData.verticalFullExtent+r.circularPathData.rightLargeArcRadius)}r.circularPathData.leftInnerExtent=r.circularPathData.sourceX+r.circularPathData.leftNodeBuffer,r.circularPathData.rightInnerExtent=r.circularPathData.targetX-r.circularPathData.rightNodeBuffer,r.circularPathData.leftFullExtent=r.circularPathData.sourceX+r.circularPathData.leftLargeArcRadius+r.circularPathData.leftNodeBuffer,r.circularPathData.rightFullExtent=r.circularPathData.targetX-r.circularPathData.rightLargeArcRadius-r.circularPathData.rightNodeBuffer}r.circular?r.path="top"==(l=r).circularLinkType?"M"+l.circularPathData.sourceX+" "+l.circularPathData.sourceY+" L"+l.circularPathData.leftInnerExtent+" "+l.circularPathData.sourceY+" A"+l.circularPathData.leftLargeArcRadius+" "+l.circularPathData.leftSmallArcRadius+" 0 0 0 "+l.circularPathData.leftFullExtent+" "+(l.circularPathData.sourceY-l.circularPathData.leftSmallArcRadius)+" L"+l.circularPathData.leftFullExtent+" "+l.circularPathData.verticalLeftInnerExtent+" A"+l.circularPathData.leftLargeArcRadius+" "+l.circularPathData.leftLargeArcRadius+" 0 0 0 "+l.circularPathData.leftInnerExtent+" "+l.circularPathData.verticalFullExtent+" L"+l.circularPathData.rightInnerExtent+" "+l.circularPathData.verticalFullExtent+" A"+l.circularPathData.rightLargeArcRadius+" "+l.circularPathData.rightLargeArcRadius+" 0 0 0 "+l.circularPathData.rightFullExtent+" "+l.circularPathData.verticalRightInnerExtent+" L"+l.circularPathData.rightFullExtent+" "+(l.circularPathData.targetY-l.circularPathData.rightSmallArcRadius)+" A"+l.circularPathData.rightLargeArcRadius+" "+l.circularPathData.rightSmallArcRadius+" 0 0 0 "+l.circularPathData.rightInnerExtent+" "+l.circularPathData.targetY+" L"+l.circularPathData.targetX+" "+l.circularPathData.targetY:"M"+l.circularPathData.sourceX+" "+l.circularPathData.sourceY+" L"+l.circularPathData.leftInnerExtent+" "+l.circularPathData.sourceY+" A"+l.circularPathData.leftLargeArcRadius+" "+l.circularPathData.leftSmallArcRadius+" 0 0 1 "+l.circularPathData.leftFullExtent+" "+(l.circularPathData.sourceY+l.circularPathData.leftSmallArcRadius)+" L"+l.circularPathData.leftFullExtent+" "+l.circularPathData.verticalLeftInnerExtent+" A"+l.circularPathData.leftLargeArcRadius+" "+l.circularPathData.leftLargeArcRadius+" 0 0 1 "+l.circularPathData.leftInnerExtent+" "+l.circularPathData.verticalFullExtent+" L"+l.circularPathData.rightInnerExtent+" "+l.circularPathData.verticalFullExtent+" A"+l.circularPathData.rightLargeArcRadius+" "+l.circularPathData.rightLargeArcRadius+" 0 0 1 "+l.circularPathData.rightFullExtent+" "+l.circularPathData.verticalRightInnerExtent+" L"+l.circularPathData.rightFullExtent+" "+(l.circularPathData.targetY+l.circularPathData.rightSmallArcRadius)+" A"+l.circularPathData.rightLargeArcRadius+" "+l.circularPathData.rightSmallArcRadius+" 0 0 1 "+l.circularPathData.rightInnerExtent+" "+l.circularPathData.targetY+" L"+l.circularPathData.targetX+" "+l.circularPathData.targetY:r.path=n.linkHorizontal().source(function(t){return[t.source.x0+(t.source.x1-t.source.x0),t.y0]}).target(function(t){return[t.target.x0,t.y1]})(r)})}function S(t,r){return L(t)==L(r)?"bottom"==t.circularLinkType?D(t,r):E(t,r):L(r)-L(t)}function E(t,r){return t.y0-r.y0}function D(t,r){return r.y0-t.y0}function C(t,r){return t.y1-r.y1}function I(t,r){return r.y1-t.y1}function L(t){return t.target.column-t.source.column}function P(t){return t.target.x0-t.source.x1}function z(t,r){var i=w(t),n=P(r)/Math.tan(i);return"up"==j(t)?t.y1+n:t.y1-n}function F(t,r){var i=w(t),n=P(r)/Math.tan(i);return"up"==j(t)?t.y1-n:t.y1+n}function O(t,r,i,n){return t.y0+r>=i&&t.y1+r<=n&&(t.y0=t.y0+r,t.y1=t.y1+r,t.targetLinks.forEach(function(t){t.y1=t.y1+r}),t.sourceLinks.forEach(function(t){t.y0=t.y0+r})),t}function R(t,r,i,n){t.nodes.forEach(function(a){n&&a.y+(a.y1-a.y0)>r&&(a.y=a.y-(a.y+(a.y1-a.y0)-r));var o=t.links.filter(function(t){return i(t.source)==i(a)}),s=o.length;s>1&&o.sort(function(t,r){if(!t.circular&&!r.circular){if(t.target.column==r.target.column)return t.y1-r.y1;if(i=t,n=r,j(i)!=j(n))return t.y1-r.y1;if(t.target.column>r.target.column){var i,n,a=F(r,t);return t.y1-a}if(r.target.column>t.target.column)return F(t,r)-r.y1}return t.circular&&!r.circular?"top"==t.circularLinkType?-1:1:r.circular&&!t.circular?"top"==r.circularLinkType?1:-1:t.circular&&r.circular?t.circularLinkType===r.circularLinkType&&"top"==t.circularLinkType?t.target.column===r.target.column?t.target.y1-r.target.y1:r.target.column-t.target.column:t.circularLinkType===r.circularLinkType&&"bottom"==t.circularLinkType?t.target.column===r.target.column?r.target.y1-t.target.y1:t.target.column-r.target.column:"top"==t.circularLinkType?-1:1:void 0});var l=a.y0;o.forEach(function(t){t.y0=l+t.width/2,l+=t.width}),o.forEach(function(t,r){if("bottom"==t.circularLinkType){for(var i=r+1,n=0;i1&&n.sort(function(t,r){if(!t.circular&&!r.circular){if(t.source.column==r.source.column)return t.y0-r.y0;if(i=t,n=r,j(i)!=j(n))return t.y0-r.y0;if(r.source.column0?"up":"down"}function N(t,r){return r(t.source)==r(t.target)}t.sankeyCircular=function(){var t,n,o=0,w=0,A=1,M=1,S=24,E=y,D=s,C=v,I=x,L=32,P=2,z=null;function F(){var s,l,c={nodes:C.apply(null,arguments),links:I.apply(null,arguments)};(s=c).nodes.forEach(function(t,r){t.index=r,t.sourceLinks=[],t.targetLinks=[]}),l=i.map(s.nodes,E),s.links.forEach(function(t,r){t.index=r;var i=t.source,n=t.target;(typeof i>"u"?"undefined":u(i))!=="object"&&(i=t.source=b(l,i)),(typeof n>"u"?"undefined":u(n))!=="object"&&(n=t.target=b(l,n)),i.sourceLinks.push(t),n.targetLinks.push(t)}),function(t,r){var i=0;if(null===r){for(var n=[],o=0;oi.indexOf(t.target)&&!t.circular&&i.push(t.target)})});for(r=t.nodes,i=[],n=0;r.length;++n,r=i,i=[])r.forEach(function(t){t.height=n,t.targetLinks.forEach(function(t){0>i.indexOf(t.source)&&!t.circular&&i.push(t.source)})});t.nodes.forEach(function(t){t.column=Math.floor(D.call(null,t,n))})}(c),_(c,E),function(a,s,l){var u=i.nest().key(function(t){return t.column}).sortKeys(r.ascending).entries(a.nodes).map(function(t){return t.values});(function(i){if(n){var s,l,c,h,d,p,m,g,y,v,x,b,_=1/0;u.forEach(function(t){var r=M*n/(t.length+1);_=r<_?r:_}),t=_}var k=r.min(u,function(i){return(M-w-(i.length-1)*t)/r.sum(i,f)});k*=.3,a.links.forEach(function(t){t.width=t.value*k});var E=(s=0,l=0,c=0,h=0,d=r.max(a.nodes,function(t){return t.column}),a.links.forEach(function(t){t.circular&&("top"==t.circularLinkType?s+=t.width:l+=t.width,0==t.target.column&&(h+=t.width),t.source.column==d&&(c+=t.width))}),{top:s=s>0?s+25+10:s,bottom:l=l>0?l+25+10:l,left:h=h>0?h+25+10:h,right:c=c>0?c+25+10:c}),D=(p=r.max(a.nodes,function(t){return t.column}),m=A-o,g=M-w,y=m+E.right+E.left,v=g+E.top+E.bottom,x=m/y,b=g/v,o=o*x+E.left,A=0==E.right?A:A*x,w=w*b+E.top,M*=b,a.nodes.forEach(function(t){t.x0=o+t.column*((A-o-S)/p),t.x1=t.x0+S}),b);k*=D,a.links.forEach(function(t){t.width=t.value*k}),u.forEach(function(t){var r=t.length;t.forEach(function(t,n){t.depth==u.length-1&&1==r||0==t.depth&&1==r?t.y0=M/2-t.value*k:t.partOfCycle?0==T(t,i)?t.y0=M/2+n:"top"==t.circularLinkType?t.y0=w+n:t.y0=M-t.value*k-n:0==E.top||0==E.bottom?t.y0=(M-w)/r*n:t.y0=(M-w)/2-r/2+n,t.y1=t.y0+t.value*k})})})(l),y();for(var c=1,h=s;h>0;--h)(function(t,i){var n=u.length;u.forEach(function(a){var o=a.length,s=a[0].depth;a.forEach(function(a){var l;if((a.sourceLinks.length||a.targetLinks.length)&&!(a.partOfCycle&&T(a,i)>0))if(0==s&&1==o)l=a.y1-a.y0,a.y0=M/2-l/2,a.y1=M/2+l/2;else if(s==n-1&&1==o)l=a.y1-a.y0,a.y0=M/2-l/2,a.y1=M/2+l/2;else{var u=r.mean(a.sourceLinks,g),c=r.mean(a.targetLinks,m),h=((u&&c?(u+c)/2:u||c)-p(a))*t;a.y0+=h,a.y1+=h}})})})(c*=.99,l),y();function y(){u.forEach(function(r){var i,n,a,o=w,s=r.length;for(r.sort(d),a=0;a0&&(i.y0+=n,i.y1+=n),o=i.y1+t;if((n=o-t-M)>0)for(o=i.y0-=n,i.y1-=n,a=s-2;a>=0;--a)(n=(i=r[a]).y1+t-o)>0&&(i.y0-=n,i.y1-=n),o=i.y0})}}(c,L,E),j(c);for(var h=0;h<4;h++)R(c,M,E),B(c,M,E),function(t,r,i,n){t.links.forEach(function(a){if(!a.circular&&a.target.column-a.source.column>1){var o=a.source.column+1,s=a.target.column-1,l=1,u=s-o+1;for(l=1;o<=s;o++,l++)t.nodes.forEach(function(s){if(s.column==o){var c,h=l/(u+1),d=Math.pow(1-h,3),f=3*h*Math.pow(1-h,2),p=3*Math.pow(h,2)*(1-h),m=Math.pow(h,3),g=d*a.y0+f*a.y0+p*a.y1+m*a.y1,y=g-a.width/2,v=g+a.width/2;y>s.y0&&yo.y0&&a.y0o.y0&&a.y1o.y1)&&O(t,c,r,i))})):v>s.y0&&vs.y1&&O(t,c,r,i)})):ys.y1&&(c=v-s.y0+10,s=O(s,c,r,i),t.nodes.forEach(function(t){n(t)==n(s)||t.column!=s.column||t.y0s.y1&&O(t,c,r,i)}))}})}})}(c,w,M,E),R(c,M,E),B(c,M,E);return function(t,i,n){var a=t.nodes,o=t.links,s=!1,l=!1;if(o.forEach(function(t){"top"==t.circularLinkType?s=!0:"bottom"==t.circularLinkType&&(l=!0)}),!1==s||!1==l){var u=r.min(a,function(t){return t.y0}),c=(n-i)/(r.max(a,function(t){return t.y1})-u);a.forEach(function(t){var r=(t.y1-t.y0)*c;t.y0=(t.y0-u)*c,t.y1=t.y0+r}),o.forEach(function(t){t.y0=(t.y0-u)*c,t.y1=(t.y1-u)*c,t.width=t.width*c})}}(c,w,M),k(c,P,M,E),c}function j(t){t.nodes.forEach(function(t){t.sourceLinks.sort(h),t.targetLinks.sort(c)}),t.nodes.forEach(function(t){var r=t.y0,i=r,n=t.y1,a=n;t.sourceLinks.forEach(function(t){t.circular?(t.y0=n-t.width/2,n-=t.width):(t.y0=r+t.width/2,r+=t.width)}),t.targetLinks.forEach(function(t){t.circular?(t.y1=a-t.width/2,a-=t.width):(t.y1=i+t.width/2,i+=t.width)})})}return F.nodeId=function(t){return arguments.length?(E="function"==typeof t?t:l(t),F):E},F.nodeAlign=function(t){return arguments.length?(D="function"==typeof t?t:l(t),F):D},F.nodeWidth=function(t){return arguments.length?(S=+t,F):S},F.nodePadding=function(r){return arguments.length?(t=+r,F):t},F.nodes=function(t){return arguments.length?(C="function"==typeof t?t:l(t),F):C},F.links=function(t){return arguments.length?(I="function"==typeof t?t:l(t),F):I},F.size=function(t){return arguments.length?(o=w=0,A=+t[0],M=+t[1],F):[A-o,M-w]},F.extent=function(t){return arguments.length?(o=+t[0][0],A=+t[1][0],w=+t[0][1],M=+t[1][1],F):[[o,w],[A,M]]},F.iterations=function(t){return arguments.length?(L=+t,F):L},F.circularLinkGap=function(t){return arguments.length?(P=+t,F):P},F.nodePaddingRatio=function(t){return arguments.length?(n=+t,F):n},F.sortNodes=function(t){return arguments.length?(z=t,F):z},F.update=function(t){return _(t,E),j(t),t.links.forEach(function(t){t.circular&&(t.circularLinkType=t.y0+t.y1typeof r?i(t,NF(),NS(),NP(),NO()):i(t.d3=t.d3||{},t.d3,t.d3,t.d3,null)}}),NB=g({"src/traces/sankey/constants.js"(t,r){r.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),Nj=g({"src/traces/sankey/render.js"(t,r){var i=NC(),n=(dC(),b(dD)).interpolateNumber,a=k(),o=Nz(),s=NR(),l=NB(),u=ei(),c=rr(),h=t_(),d=h.strTranslate,f=h.strRotate,p=yj(),m=p.keyFun,g=p.repeat,y=p.unwrap,v=tN(),x=e2(),_=tj(),w=_.CAP_SHIFT,T=_.LINE_SPACING;function A(t,r,i){var n,a=y(r),u=a.trace,c=u.domain,d="h"===u.orientation,f="reversed"===u.direction,p=u.node.pad,m=u.node.thickness,g={justify:o.sankeyJustify,left:o.sankeyLeft,right:o.sankeyRight,center:o.sankeyCenter}[u.node.align],v=t.width*(c.x[1]-c.x[0]),x=t.height*(c.y[1]-c.y[0]),b=a._nodes,_=a._links,w=a.circular;function T(t){"input"===u[t].sort&&(w?h.warn(`Circular Sankey diagrams do not support the "input" ${t}.sort mode; falling back to the default sort.`):n[`${t}Sort`](null))}(n=w?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(d?[v,x]:[x,v]).nodeWidth(m).nodePadding(p).nodeId(function(t){return t.pointNumber}).nodeAlign(g).nodes(b).links(_),T("link"),T("node");var A=n();for(var M in n.nodePadding()s+m&&(o+=1,r=l.x0),s=l.x0,a[o]||(a[o]=[]),a[o].push(l),i=r-l.x0,l.x0+=i,l.x1+=i}return a})(b=A.nodes).forEach(function(t){var r,i,n,a=0,o=t.length;for(t.sort(function(t,r){return t.y0-r.y0}),n=0;n=a||(i=a-r.y0)>1e-6&&(r.y0+=i,r.y1+=i),a=r.y1+p}),n.update(A)}return{circular:w,key:i,trace:u,guid:h.randstr(),horizontal:d,reversed:f,width:v,height:x,nodePad:u.node.pad,nodeLineColor:u.node.line.color,nodeLineWidth:u.node.line.width,linkLineColor:u.link.line.color,linkLineWidth:u.link.line.width,linkArrowLength:u.link.arrowlen,valueFormat:u.valueformat,valueSuffix:u.valuesuffix,textFont:u.textfont,translateX:c.x[0]*t.width+t.margin.l,translateY:t.height-c.y[1]*t.height+t.margin.t,dragParallel:d?x:v,dragPerpendicular:d?v:x,arrangement:u.arrangement,sankey:n,graph:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function M(t,r,i){var n=r.source.label+"|"+r.target.label;return r.trace=t.trace,r.curveNumber=t.trace.index,{circular:t.circular,key:n+"__"+i,traceId:t.key,pointNumber:r.pointNumber,link:r,rgb:u.rgb(r.color),alpha:u.parse(r.color).alpha,hoverRgb:u.rgb(r.hovercolor),hoverAlpha:u.parse(r.hovercolor).alpha,linkPath:S,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:r.flow}}function S(){return function(t){var r,i,a,o,s,l,u,c=t.linkArrowLength;if(t.link.circular)return r=t.link,i=c,a="",o=r.width/2,l=(s=r.circularPathData).sourceX+s.verticalBuffer0?" L "+s.targetX+" "+s.targetY:"")+"Z"):(a="M "+(s.targetX-i)+" "+(s.targetY-o)+" L "+(s.rightInnerExtent-i)+" "+(s.targetY-o)+" A "+(s.rightLargeArcRadius+o)+" "+(s.rightSmallArcRadius+o)+" 0 0 0 "+(s.rightFullExtent-o-i)+" "+(s.targetY+s.rightSmallArcRadius)+" L "+(s.rightFullExtent-o-i)+" "+s.verticalRightInnerExtent,l&&u?a+=" A "+(s.rightLargeArcRadius+o)+" "+(s.rightLargeArcRadius+o)+" 0 0 0 "+(s.rightInnerExtent-o-i)+" "+(s.verticalFullExtent+o)+" L "+(s.rightFullExtent+o-i-(s.rightLargeArcRadius-o))+" "+(s.verticalFullExtent+o)+" A "+(s.rightLargeArcRadius+o)+" "+(s.rightLargeArcRadius+o)+" 0 0 0 "+(s.leftFullExtent+o)+" "+s.verticalLeftInnerExtent:l?a+=" A "+(s.rightLargeArcRadius-o)+" "+(s.rightSmallArcRadius-o)+" 0 0 1 "+(s.rightFullExtent-i-o-(s.rightLargeArcRadius-o))+" "+(s.verticalFullExtent-o)+" L "+(s.leftFullExtent+o+(s.rightLargeArcRadius-o))+" "+(s.verticalFullExtent-o)+" A "+(s.rightLargeArcRadius-o)+" "+(s.rightSmallArcRadius-o)+" 0 0 1 "+(s.leftFullExtent+o)+" "+s.verticalLeftInnerExtent:a+=" A "+(s.rightLargeArcRadius+o)+" "+(s.rightLargeArcRadius+o)+" 0 0 0 "+(s.rightInnerExtent-i)+" "+(s.verticalFullExtent+o)+" L "+s.leftInnerExtent+" "+(s.verticalFullExtent+o)+" A "+(s.leftLargeArcRadius+o)+" "+(s.leftLargeArcRadius+o)+" 0 0 0 "+(s.leftFullExtent+o)+" "+s.verticalLeftInnerExtent,a+=" L "+(s.leftFullExtent+o)+" "+(s.sourceY+s.leftSmallArcRadius)+" A "+(s.leftLargeArcRadius+o)+" "+(s.leftSmallArcRadius+o)+" 0 0 0 "+s.leftInnerExtent+" "+(s.sourceY-o)+" L "+s.sourceX+" "+(s.sourceY-o)+" L "+s.sourceX+" "+(s.sourceY+o)+" L "+s.leftInnerExtent+" "+(s.sourceY+o)+" A "+(s.leftLargeArcRadius-o)+" "+(s.leftSmallArcRadius-o)+" 0 0 1 "+(s.leftFullExtent-o)+" "+(s.sourceY+s.leftSmallArcRadius)+" L "+(s.leftFullExtent-o)+" "+s.verticalLeftInnerExtent,l&&u?a+=" A "+(s.rightLargeArcRadius-o)+" "+(s.rightSmallArcRadius-o)+" 0 0 1 "+(s.leftFullExtent-o-(s.rightLargeArcRadius-o))+" "+(s.verticalFullExtent-o)+" L "+(s.rightFullExtent+o-i+(s.rightLargeArcRadius-o))+" "+(s.verticalFullExtent-o)+" A "+(s.rightLargeArcRadius-o)+" "+(s.rightSmallArcRadius-o)+" 0 0 1 "+(s.rightFullExtent+o-i)+" "+s.verticalRightInnerExtent:l?a+=" A "+(s.rightLargeArcRadius+o)+" "+(s.rightLargeArcRadius+o)+" 0 0 0 "+(s.leftFullExtent+o)+" "+(s.verticalFullExtent+o)+" L "+(s.rightFullExtent-i-o)+" "+(s.verticalFullExtent+o)+" A "+(s.rightLargeArcRadius+o)+" "+(s.rightLargeArcRadius+o)+" 0 0 0 "+(s.rightFullExtent+o-i)+" "+s.verticalRightInnerExtent:a+=" A "+(s.leftLargeArcRadius-o)+" "+(s.leftLargeArcRadius-o)+" 0 0 1 "+s.leftInnerExtent+" "+(s.verticalFullExtent-o)+" L "+(s.rightInnerExtent-i)+" "+(s.verticalFullExtent-o)+" A "+(s.rightLargeArcRadius-o)+" "+(s.rightLargeArcRadius-o)+" 0 0 1 "+(s.rightFullExtent+o-i)+" "+s.verticalRightInnerExtent,a+=" L "+(s.rightFullExtent+o-i)+" "+(s.targetY+s.rightSmallArcRadius)+" A "+(s.rightLargeArcRadius-o)+" "+(s.rightSmallArcRadius-o)+" 0 0 1 "+(s.rightInnerExtent-i)+" "+(s.targetY+o)+" L "+(s.targetX-i)+" "+(s.targetY+o)+(i>0?" L "+s.targetX+" "+s.targetY:"")+"Z"),a;var h=Math.abs((t.link.target.x0-t.link.source.x1)/2);c>h&&(c=h);var d=t.link.source.x1,f=t.link.target.x0-c,p=n(d,f),m=p(.5),g=p(.5),y=t.link.y0-t.link.width/2,v=t.link.y0+t.link.width/2,x=t.link.y1-t.link.width/2,b=t.link.y1+t.link.width/2,_="M"+d+","+y,w="C"+m+","+y+" "+g+","+x+" "+f+","+x,T="C"+g+","+b+" "+m+","+v+" "+d+","+v,A=c>0?"L"+(f+c)+","+(x+t.link.width/2):"";return _+w+(A+="L"+f+","+b)+T+"Z"}}function E(t,r){var i=l.nodePadAcross,n=t.nodePad/2;r.dx=r.x1-r.x0,r.dy=r.y1-r.y0;var a=r.dx,o=Math.max(.5,r.dy),s="node_"+r.pointNumber;return r.group&&(s=h.randstr()),r.trace=t.trace,r.curveNumber=t.trace.index,{index:r.pointNumber,key:s,partOfGroup:r.partOfGroup||!1,group:r.group,traceId:t.key,trace:t.trace,node:r,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-i,zoneY:-n,zoneWidth:a+2*i,zoneHeight:o+2*n,labelY:t.horizontal?r.dy/2+1:r.dx/2+1,left:1===r.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,reversed:t.reversed,rgb:u.rgb(r.color),alpha:u.parse(r.color).alpha,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function D(t){t.attr("transform",function(t){return d(t.node.x0.toFixed(3),t.node.y0.toFixed(3))})}function C(t){t.call(D)}function I(t,r){t.call(C),r.attr("d",S())}function L(t){t.attr("width",function(t){return t.node.x1-t.node.x0}).attr("height",function(t){return t.visibleHeight})}function P(t){return t.link.width>1||t.linkLineWidth>0}function z(t){return t.horizontal?t.reversed?d(t.translateX+t.width,t.translateY)+"matrix(-1 0 0 1 0 0)":d(t.translateX,t.translateY)+"matrix(1 0 0 1 0 0)":t.reversed?d(t.translateX,t.translateY+t.height)+"matrix(0 -1 1 0 0 0)":d(t.translateX,t.translateY)+"matrix(0 1 1 0 0 0)"}function F(t,r,i){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(i.hover(this,t,r),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(i.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||t.partOfGroup||(i.unhover(this,t,r),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(i.unhover(this,t,r),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||i.select(this,t,r)})}function O(t,r,n,o){var s=a.behavior.drag().origin(function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(o._fullLayout._infolayer,"g","dragcover",function(t){o._fullLayout._dragCover=t}),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,B(a.node),a.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var s,u,c,d,f,p=a.traceId+"|"+a.key;a.forceLayouts[p]?a.forceLayouts[p].alpha(1):function(t,r,n){for(var a,o,s,u=n.graph.nodes,c=0;c0&&s.forceLayouts[a].alpha(0)})).stop()}(t,p,a),s=t,u=r,c=a,d=p,f=o,window.requestAnimationFrame(function t(){for(r=0;r0)window.requestAnimationFrame(t);else{var r,i=c.node.originalX;c.node.x0=i-c.visibleWidth/2,c.node.x1=i+c.visibleWidth/2,R(c,f)}})}}).on("drag",function(i){if("fixed"!==i.arrangement){var n=a.event.x,o=a.event.y;"snap"===i.arrangement?(i.node.x0=n-i.visibleWidth/2,i.node.x1=n+i.visibleWidth/2):("freeform"===i.arrangement&&(i.node.x0=n-i.visibleWidth/2,i.node.x1=n+i.visibleWidth/2),o=Math.max(0,Math.min(i.size-i.visibleHeight/2,o))),i.node.y0=o-i.visibleHeight/2,i.node.y1=o+i.visibleHeight/2,B(i.node),"snap"!==i.arrangement&&(i.sankey.update(i.graph),I(t.filter(j(i)),r))}}).on("dragend",function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var r=0;rP(t)?u.rgb(t.linkLineColor):t.rgb).style("stroke-opacity",t=>P(t)?u.opacity(t.linkLineColor):t.alpha).style("fill",t=>t.rgb).style("fill-opacity",t=>t.alpha).style("stroke-width",t=>P(t)?t.linkLineWidth:1).attr("d",S()),C.style("opacity",function(){return t._context.staticPlot||p||x?1:0}).transition().ease(l.ease).duration(l.duration).style("opacity",1),C.exit().transition().ease(l.ease).duration(l.duration).style("opacity",0).remove();var I=_.selectAll("."+l.cn.sankeyNodeSet).data(g,m);I.enter().append("g").classed(l.cn.sankeyNodeSet,!0),I.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var R=I.selectAll("."+l.cn.sankeyNode).data(function(t){var r=t.graph.nodes;return function(t){var r,i=[];for(r=0;rt.rgb).style("fill-opacity",t=>t.alpha),B.transition().ease(l.ease).duration(l.duration).call(L);var j=R.selectAll("."+l.cn.nodeLabel).data(g);j.enter().append("text").classed(l.cn.nodeLabel,!0).style("cursor","default"),j.attr("data-notex",1).text(function(t){return t.node.label}).each(function(r){var i=a.select(this);c.font(i,r.textFont),v.convertToTspans(i,t)}).attr("text-anchor",function(t){return t.horizontal&&t.left!==t.reversed?"end":"start"}).attr("transform",function(t){var r=a.select(this),i=v.lineCount(r),n=t.textFont.size*((i-1)*T-w),o=t.nodeLineWidth/2+3;if(!t.horizontal){var s=t.reversed?(t.visibleWidth+n)/2:(t.visibleWidth-n)/2,l=t.reversed?f(90):"scale(-1,1)"+f(90);return d(s,o)+l}var u=o,s=(t.visibleHeight-n)/2;return t.left?u=-u:u+=t.visibleWidth,d(u,s)+(t.reversed?"scale(-1,1)":"")}),j.transition().ease(l.ease).duration(l.duration)}}}),NN=g({"src/traces/sankey/plot.js"(t,r){var i=k(),n=t_(),a=n.numberFormat,o=Nj(),s=rR(),l=ei(),u=NB().cn,c=n._;function h(t){return""!==t}function d(t,r){return t.filter(function(t){return t.key===r.traceId})}function f(t,r){i.select(t).select("path").style("fill-opacity",r),i.select(t).select("rect").style("fill-opacity",r)}function p(t){i.select(t).select("text.name").style("fill","black")}function m(t){return function(r){return -1!==t.node.sourceLinks.indexOf(r.link)||-1!==t.node.targetLinks.indexOf(r.link)}}function g(t){return function(r){return -1!==r.node.sourceLinks.indexOf(t.link)||-1!==r.node.targetLinks.indexOf(t.link)}}function y(t,r,i){r&&i&&d(i,r).selectAll("."+u.sankeyLink).filter(m(r)).call(x.bind(0,r,i,!1))}function v(t,r,i){r&&i&&d(i,r).selectAll("."+u.sankeyLink).filter(m(r)).call(b.bind(0,r,i,!1))}function x(t,r,i,n){n.style("fill",function(t){if(!t.link.concentrationscale)return t.hoverRgb}).style("fill-opacity",function(t){if(!t.link.concentrationscale)return t.hoverAlpha}),n.each(function(i){var n=i.link.label;""!==n&&d(r,t).selectAll("."+u.sankeyLink).filter(function(t){return t.link.label===n}).style("fill",function(t){if(!t.link.concentrationscale)return t.hoverRgb}).style("fill-opacity",function(t){if(!t.link.concentrationscale)return t.hoverAlpha})}),i&&d(r,t).selectAll("."+u.sankeyNode).filter(g(t)).call(y)}function b(t,r,i,n){n.style("fill",function(t){return t.rgb}).style("fill-opacity",function(t){return t.alpha}),n.each(function(i){var n=i.link.label;""!==n&&d(r,t).selectAll("."+u.sankeyLink).filter(function(t){return t.link.label===n}).style("fill",t=>t.rgb).style("fill-opacity",t=>t.alpha)}),i&&d(r,t).selectAll(u.sankeyNode).filter(g(t)).call(v)}function _(t,r){var i=t.hoverlabel||{},a=n.nestedProperty(i,r).get();return!Array.isArray(a)&&a}r.exports=function(t,r){for(var n=t._fullLayout,d=n._paper,m=n._size,g=0;g"),color:_(u,"bgcolor")||l.addOpacity(g.color,1),borderColor:_(u,"bordercolor"),fontFamily:_(u,"font.family"),fontSize:_(u,"font.size"),fontColor:_(u,"font.color"),fontWeight:_(u,"font.weight"),fontStyle:_(u,"font.style"),fontVariant:_(u,"font.variant"),fontTextcase:_(u,"font.textcase"),fontLineposition:_(u,"font.lineposition"),fontShadow:_(u,"font.shadow"),nameLength:_(u,"namelength"),textAlign:_(u,"align"),idealAlign:i.event.x"),color:_(l,"bgcolor")||o.rgb,borderColor:_(l,"bordercolor"),fontFamily:_(l,"font.family"),fontSize:_(l,"font.size"),fontColor:_(l,"font.color"),fontWeight:_(l,"font.weight"),fontStyle:_(l,"font.style"),fontVariant:_(l,"font.variant"),fontTextcase:_(l,"font.textcase"),fontLineposition:_(l,"font.lineposition"),fontShadow:_(l,"font.shadow"),nameLength:_(l,"namelength"),textAlign:_(l,"align"),idealAlign:"left",hovertemplate:l.hovertemplate,hovertemplateLabels:x,eventData:[o.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t});f(T,.85),p(T)}}},unhover:function(r,a,o){!1!==t._fullLayout.hovermode&&(i.select(r).call(v,a,o),"skip"!==a.node.trace.node.hoverinfo&&(a.node.fullData=a.node.trace,t.emit("plotly_unhover",{event:i.event,points:[a.node]})),s.loneUnhover(n._hoverlayer.node()))},select:function(r,n,a){var o=n.node;o.originalEvent=i.event,t._hoverdata=[o],i.select(r).call(v,n,a),s.click(t,{target:!0})}}})}}}),NV=g({"src/traces/sankey/base_plot.js"(t){var r=e$().overrideAll,i=tF().getModuleCalcData,n=NN(),a=Z(),o=rg(),s=rm(),l=iS().prepSelect,u=t_(),c=e2(),h="sankey";t.name=h,t.baseLayoutAttrOverrides=r({hoverlabel:a.hoverlabel},"plot","nested"),t.plot=function(r){var a=i(r.calcdata,h)[0];n(r,a),t.updateFx(r)},t.clean=function(t,r,i,n){var a=n._has&&n._has(h),o=r._has&&r._has(h);a&&!o&&(n._paperdiv.selectAll(".sankey").remove(),n._paperdiv.selectAll(".bgsankey").remove())},t.updateFx=function(t){for(var r=0;r0}function A(t){t.each(function(t){v.stroke(i.select(this),t.line.color)}).each(function(t){v.fill(i.select(this),t.color)}).style("stroke-width",function(t){return t.line.width})}function M(t,r,i){var n=t._fullLayout,a=o.extendFlat({type:"linear",ticks:"outside",range:i,showline:!0},r),s={type:"linear",_id:"x"+r._id},l={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function u(t,r){return o.coerce(a,s,y,t,r)}return m(a,s,u,l,n),g(a,s,u,l),s}function S(t,r,i){return[Math.min(r/t.width,i/t.height),t,r+"x"+i]}function E(t,r,n,a){var o=document.createElementNS("http://www.w3.org/2000/svg","text"),s=i.select(o);return s.text(t).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",t).call(f.convertToTspans,a).call(h.font,r),h.bBox(s.node())}function D(t,r,i,n,a,s){var l="_cache"+r;t[l]&&t[l].key===a||(t[l]={key:a,value:i});var u=o.aggNums(s,null,[t[l].value,n],2);return t[l].value=u,u}r.exports=function(t,r,m,g){var y,b=t._fullLayout;T(m)&&g&&(y=g()),o.makeTraceGroups(b._indicatorlayer,r,"trace").each(function(r){var g,k,C,I,L,P=r[0].trace,z=i.select(this),F=P._hasGauge,O=P._isAngular,R=P._isBullet,B=P.domain,j={w:b._size.w*(B.x[1]-B.x[0]),h:b._size.h*(B.y[1]-B.y[0]),l:b._size.l+b._size.w*B.x[0],r:b._size.r+b._size.w*(1-B.x[1]),t:b._size.t+b._size.h*(1-B.y[1]),b:b._size.b+b._size.h*B.y[0]},N=j.l+j.w/2,V=j.t+j.h/2,U=Math.min(j.w/2,j.h),q=d.innerRadius*U,G=P.align||"center";if(I=V,F){if(O&&(C=N,I=V+U/2,L=function(t){var r,i;return r=t,[(i=.9*q)/Math.sqrt(r.width/2*(r.width/2)+r.height*r.height),r,i]}),R){var H=d.bulletPadding,$=1-d.bulletNumberDomainSize+H;C=j.l+($+(1-$)*_[G])*j.w,L=function(t){return S(t,(d.bulletNumberDomainSize-H)*j.w,j.h)}}}else C=j.l+_[G]*j.w,L=function(t){return S(t,j.w,j.h)};(function(t,r,n,u){var c,d,m,g=n[0].trace,y=u.numbersX,b=u.numbersY,A=g.align||"center",k=x[A],S=u.transitionOpts,C=u.onComplete,I=o.ensureSingle(r,"g","numbers"),L=[];g._hasNumber&&L.push("number"),g._hasDelta&&(L.push("delta"),"left"===g.delta.position&&L.reverse());var P=I.selectAll("text").data(L);function z(r,i,n,a){if(!r.match("s")||n>=0==a>=0||i(n).slice(-1).match(w)||i(a).slice(-1).match(w))return i;var o=M(t,{tickformat:r.slice().replace("s","f").replace(/\d+/,function(t){return parseInt(t)-1})});return function(t){return 1>Math.abs(t)?p.tickText(o,t).text:i(t)}}P.enter().append("text"),P.attr("text-anchor",function(){return k}).attr("class",function(t){return t}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var F,O=g.mode+g.align;if(g._hasDelta&&(F=function(){var r=M(t,{tickformat:g.delta.valueformat},g._range);r.setScale(),p.prepTicks(r);var o=function(t){return p.tickText(r,t).text},s=g.delta.suffix,l=g.delta.prefix,u=function(t){return g.delta.relative?t.relativeDelta:t.delta},c=function(t,r){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?g.delta.increasing.symbol:g.delta.decreasing.symbol)+l+r(t)+s},m=function(t){return t.delta>=0?g.delta.increasing.color:g.delta.decreasing.color};void 0===g._deltaLastValue&&(g._deltaLastValue=u(n[0]));var y=I.select("text.delta");function x(){y.text(c(u(n[0]),o)).call(v.fill,m(n[0])).call(f.convertToTspans,t)}return y.call(h.font,g.delta.font).call(v.fill,m({delta:g._deltaLastValue})),T(S)?y.transition().duration(S.duration).ease(S.easing).tween("text",function(){var t=i.select(this),r=u(n[0]),s=g._deltaLastValue,l=z(g.delta.valueformat,o,s,r),h=a(s,r);return g._deltaLastValue=r,function(r){t.text(c(h(r),l)),t.call(v.fill,m({delta:h(r)}))}}).each("end",function(){x(),C&&C()}).each("interrupt",function(){x(),C&&C()}):x(),d=E(c(u(n[0]),o),g.delta.font,k,t),y}(),O+=g.delta.position+g.delta.font.size+g.delta.font.family+g.delta.valueformat,O+=g.delta.increasing.symbol+g.delta.decreasing.symbol,m=d),g._hasNumber&&(function(){var r=M(t,{tickformat:g.number.valueformat},g._range);r.setScale(),p.prepTicks(r);var o=function(t){return p.tickText(r,t).text},s=g.number.suffix,l=g.number.prefix,u=I.select("text.number");function d(){var r="number"==typeof n[0].y?l+o(n[0].y)+s:"-";u.text(r).call(h.font,g.number.font).call(f.convertToTspans,t)}T(S)?u.transition().duration(S.duration).ease(S.easing).each("end",function(){d(),C&&C()}).each("interrupt",function(){d(),C&&C()}).attrTween("text",function(){var t=i.select(this),r=a(n[0].lastY,n[0].y);g._lastValue=n[0].y;var u=z(g.number.valueformat,o,n[0].lastY,n[0].y);return function(i){t.text(l+u(r(i))+s)}}):d(),c=E(l+o(n[0].y)+s,g.number.font,k,t)}(),O+=g.number.font.size+g.number.font.family+g.number.valueformat+g.number.suffix+g.number.prefix,m=c),g._hasDelta&&g._hasNumber){var R,B,j=[(c.left+c.right)/2,(c.top+c.bottom)/2],N=[(d.left+d.right)/2,(d.top+d.bottom)/2],V=.75*g.delta.font.size;"left"===g.delta.position&&(R=D(g,"deltaPos",0,-1*(c.width*_[g.align]+d.width*(1-_[g.align])+V),O,Math.min),B=j[1]-N[1],m={width:c.width+d.width+V,height:Math.max(c.height,d.height),left:d.left+R,right:c.right,top:Math.min(c.top,d.top+B),bottom:Math.max(c.bottom,d.bottom+B)}),"right"===g.delta.position&&(R=D(g,"deltaPos",0,c.width*(1-_[g.align])+d.width*_[g.align]+V,O,Math.max),B=j[1]-N[1],m={width:c.width+d.width+V,height:Math.max(c.height,d.height),left:c.left,right:d.right+R,top:Math.min(c.top,d.top+B),bottom:Math.max(c.bottom,d.bottom+B)}),"bottom"===g.delta.position&&(R=null,B=d.height,m={width:Math.max(c.width,d.width),height:c.height+d.height,left:Math.min(c.left,d.left),right:Math.max(c.right,d.right),top:c.bottom-c.height,bottom:c.bottom+d.height}),"top"===g.delta.position&&(R=null,B=c.top,m={width:Math.max(c.width,d.width),height:c.height+d.height,left:Math.min(c.left,d.left),right:Math.max(c.right,d.right),top:c.bottom-c.height-d.height,bottom:c.bottom}),F.attr({dx:R,dy:B})}(g._hasNumber||g._hasDelta)&&I.attr("transform",function(){var t=u.numbersScaler(m);O+=t[2];var r,i=D(g,"numbersScale",1,t[0],O,Math.min);g._scaleNumbers||(i=1),r=g._isAngular?b-i*m.bottom:b-i*(m.top+m.bottom)/2,g._numbersTop=i*m.top+r;var n=m[A];"center"===A&&(n=(m.left+m.right)/2);var a=y-i*n;return l(a=D(g,"numbersTranslate",0,a,O,Math.max),r)+s(i)})})(t,z,r,{numbersX:C,numbersY:I,numbersScaler:L,transitionOpts:m,onComplete:y}),F&&(g={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},k={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var W=z.selectAll("g.angular").data(O?r:[]);W.exit().remove();var Y=z.selectAll("g.angularaxis").data(O?r:[]);Y.exit().remove(),O&&function(t,r,a){var o,s,h,d,f,m,g=r[0].trace,y=a.size,v=a.radius,x=a.innerRadius,b=a.gaugeBg,_=a.gaugeOutline,w=[y.l+y.w/2,y.t+y.h/2+v/2],k=a.gauge,S=a.layer,E=a.transitionOpts,D=a.onComplete,C=Math.PI/2;function I(t){var r=g.gauge.axis.range[0],i=(t-r)/(g.gauge.axis.range[1]-r)*Math.PI-C;return i<-C?-C:i>C?C:i}function L(t){return i.svg.arc().innerRadius((x+v)/2-t/2*(v-x)).outerRadius((x+v)/2+t/2*(v-x)).startAngle(-C)}function P(t){t.attr("d",function(t){return L(t.thickness).startAngle(I(t.range[0])).endAngle(I(t.range[1]))()})}k.enter().append("g").classed("angular",!0),k.attr("transform",l(w[0],w[1])),S.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),S.selectAll("g.xangularaxistick,path,text").remove(),(d=M(t,g.gauge.axis)).type="linear",d.range=g.gauge.axis.range,d._id="xangularaxis",d.ticklabeloverflow="allow",d.setScale();var z=function(t){return(d.range[0]-t.x)/(d.range[1]-d.range[0])*Math.PI+Math.PI},F={},O=p.makeLabelFns(d,0).labelStandoff;F.xFn=function(t){return Math.cos(z(t))*O},F.yFn=function(t){var r=z(t),i=Math.sin(r)>0?.2:1;return-Math.sin(r)*(O+t.fontSize*i)+Math.abs(Math.cos(r))*(t.fontSize*c)},F.anchorFn=function(t){var r=Math.cos(z(t));return .1>Math.abs(r)?"middle":r>0?"start":"end"},F.heightFn=function(t,r,i){return -.5*(1+Math.sin(z(t)))*i};var R=function(t){return l(w[0]+v*Math.cos(t),w[1]-v*Math.sin(t))};if(f=p.calcTicks(d),m=p.getTickSigns(d)[2],d.visible){m="inside"===d.ticks?-1:1;var B=(d.linewidth||1)/2;p.drawTicks(t,d,{vals:f,layer:S,path:"M"+m*B+",0h"+m*d.ticklen,transFn:function(t){var r=z(t);return R(r)+"rotate("+-u(r)+")"}}),p.drawLabels(t,d,{vals:f,layer:S,transFn:function(t){return R(z(t))},labelFns:F})}var j=[b].concat(g.gauge.steps),N=k.selectAll("g.bg-arc").data(j);N.enter().append("g").classed("bg-arc",!0).append("path"),N.select("path").call(P).call(A),N.exit().remove();var V=L(g.gauge.bar.thickness),U=k.selectAll("g.value-arc").data([g.gauge.bar]);U.enter().append("g").classed("value-arc",!0).append("path");var q=U.select("path");T(E)?(q.transition().duration(E.duration).ease(E.easing).each("end",function(){D&&D()}).each("interrupt",function(){D&&D()}).attrTween("d",(o=V,s=I(r[0].lastY),h=I(r[0].y),function(){var t=n(s,h);return function(r){return o.endAngle(t(r))()}})),g._lastValue=r[0].y):q.attr("d","number"==typeof r[0].y?V.endAngle(I(r[0].y)):"M0,0Z"),q.call(A),U.exit().remove(),j=[];var G=g.gauge.threshold.value;(G||0===G)&&j.push({range:[G,G],color:g.gauge.threshold.color,line:{color:g.gauge.threshold.line.color,width:g.gauge.threshold.line.width},thickness:g.gauge.threshold.thickness});var H=k.selectAll("g.threshold-arc").data(j);H.enter().append("g").classed("threshold-arc",!0).append("path"),H.select("path").call(P).call(A),H.exit().remove();var $=k.selectAll("g.gauge-outline").data([_]);$.enter().append("g").classed("gauge-outline",!0).append("path"),$.select("path").call(P).call(A),$.exit().remove()}(t,r,{radius:U,innerRadius:q,gauge:W,layer:Y,size:j,gaugeBg:g,gaugeOutline:k,transitionOpts:m,onComplete:y});var Z=z.selectAll("g.bullet").data(R?r:[]);Z.exit().remove();var X=z.selectAll("g.bulletaxis").data(R?r:[]);X.exit().remove(),R&&function(t,r,i){var n,a,o,s,u,c=r[0].trace,h=i.gauge,f=i.layer,m=i.gaugeBg,g=i.gaugeOutline,y=i.size,x=c.domain,b=i.transitionOpts,_=i.onComplete;h.enter().append("g").classed("bullet",!0),h.attr("transform",l(y.l,y.t)),f.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),f.selectAll("g.xbulletaxistick,path,text").remove();var w=y.h,k=c.gauge.bar.thickness*w,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(c._hasNumber||c._hasDelta?1-d.bulletNumberDomainSize:1);function D(t){t.attr("width",function(t){return Math.max(0,n.c2p(t.range[1])-n.c2p(t.range[0]))}).attr("x",function(t){return n.c2p(t.range[0])}).attr("y",function(t){return .5*(1-t.thickness)*w}).attr("height",function(t){return t.thickness*w})}(n=M(t,c.gauge.axis))._id="xbulletaxis",n.domain=[S,E],n.setScale(),a=p.calcTicks(n),o=p.makeTransTickFn(n),s=p.getTickSigns(n)[2],u=y.t+y.h,n.visible&&(p.drawTicks(t,n,{vals:"inside"===n.ticks?p.clipEnds(n,a):a,layer:f,path:p.makeTickPath(n,u,s),transFn:o}),p.drawLabels(t,n,{vals:a,layer:f,transFn:o,labelFns:p.makeLabelFns(n,u)}));var C=[m].concat(c.gauge.steps),I=h.selectAll("g.bg-bullet").data(C);I.enter().append("g").classed("bg-bullet",!0).append("rect"),I.select("rect").call(D).call(A),I.exit().remove();var L=h.selectAll("g.value-bullet").data([c.gauge.bar]);L.enter().append("g").classed("value-bullet",!0).append("rect"),L.select("rect").attr("height",k).attr("y",(w-k)/2).call(A),T(b)?L.select("rect").transition().duration(b.duration).ease(b.easing).each("end",function(){_&&_()}).each("interrupt",function(){_&&_()}).attr("width",Math.max(0,n.c2p(Math.min(c.gauge.axis.range[1],r[0].y)))):L.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,n.c2p(Math.min(c.gauge.axis.range[1],r[0].y))):0),L.exit().remove();var P=r.filter(function(){return c.gauge.threshold.value||0===c.gauge.threshold.value}),z=h.selectAll("g.threshold-bullet").data(P);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",n.c2p(c.gauge.threshold.value)).attr("x2",n.c2p(c.gauge.threshold.value)).attr("y1",(1-c.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-c.gauge.threshold.thickness)/2)*w).call(v.stroke,c.gauge.threshold.line.color).style("stroke-width",c.gauge.threshold.line.width),z.exit().remove();var F=h.selectAll("g.gauge-outline").data([g]);F.enter().append("g").classed("gauge-outline",!0).append("rect"),F.select("rect").call(D).call(A),F.exit().remove()}(t,r,{gauge:Z,layer:X,size:j,gaugeBg:g,gaugeOutline:k,transitionOpts:m,onComplete:y});var K=z.selectAll("text.title").data(r);K.exit().remove(),K.enter().append("text").classed("title",!0),K.attr("text-anchor",function(){return R?x.right:x[P.title.align]}).text(P.title.text).call(h.font,P.title.font).call(f.convertToTspans,t),K.attr("transform",function(){var t,r=j.l+j.w*_[P.title.align],i=d.titlePadding,n=h.bBox(K.node());return F?(O&&(t=P.gauge.axis.visible?h.bBox(Y.node()).top-i-n.bottom:j.t+j.h/2-U/2-n.bottom-i),R&&(t=I-(n.top+n.bottom)/2,r=j.l-d.bulletPadding*j.w)):t=P._numbersTop-i-n.bottom,l(r,t)})})}}}),NK=g({"src/traces/indicator/index.js"(t,r){r.exports={moduleType:"trace",name:"indicator",basePlotModule:NH(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:N$(),supplyDefaults:NY().supplyDefaults,calc:NZ().calc,plot:NX(),meta:{}}}}),NJ=g({"lib/indicator.js"(t,r){r.exports=NK()}}),NQ=g({"src/traces/table/attributes.js"(t,r){var i=ix(),n=$().extendFlat,a=e$().overrideAll,o=W(),s=an().attributes,l=tU().descriptionOnlyNumbers;r.exports=a({domain:s({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:n({},i.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},o({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:l("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:n({},i.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},o({arrayOk:!0}))}},"calc","from-root")}}),N0=g({"src/traces/table/defaults.js"(t,r){var i=t_(),n=NQ(),a=an().defaults;r.exports=function(t,r,o,s){function l(a,o){return i.coerce(t,r,n,a,o)}a(r,s,l),l("columnwidth"),l("header.values"),l("header.format"),l("header.align"),l("header.prefix"),l("header.suffix"),l("header.height"),l("header.line.width"),l("header.line.color"),l("header.fill.color"),i.coerceFont(l,"header.font",s.font),function(t,r){for(var i=t.columnorder||[],n=t.header.values.length,a=i.slice(0,n),o=a.slice().sort(function(t,r){return t-r}),s=a.map(function(t){return o.indexOf(t)}),l=s.length;l",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),N3=g({"src/traces/table/data_preparation_helper.js"(t,r){var i=N2(),n=$().extendFlat,a=L(),o=O().isTypedArray,s=O().isArrayOrTypedArray;function l(t){if(s(t)){for(var r=0,i=0;i=r||c===t.length-1)&&(n[a]=s,s.key=u++,s.firstRowIndex=l,s.lastRowIndex=c,s=m(),a+=o,l=c+1,o=0);return n}function m(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}r.exports=function(t,r){var o=c(r.cells.values),m=function(t){return t.slice(r.header.values.length,t.length)},g=c(r.header.values);g.length&&!g[0].length&&(g[0]=[""],g=c(g));var y=g.concat(m(o).map(function(){return h((g[0]||[""]).length)})),v=r.domain,x=Math.floor(t._fullLayout._size.w*(v.x[1]-v.x[0])),b=Math.floor(t._fullLayout._size.h*(v.y[1]-v.y[0])),_=r.header.values.length?y[0].map(function(){return r.header.height}):[i.emptyHeaderHeight],w=o.length?o[0].map(function(){return r.cells.height}):[],T=_.reduce(u,0),A=p(w,b-T+i.uplift),M=f(p(_,T),[]),k=f(A,M),S={},E=r.columnorder;s(E)&&(E=Array.from(E)),E=E.concat(m(o.map(function(t,r){return r})));var D=y.map(function(t,i){var n=s(r.columnwidth)?r.columnwidth[Math.min(i,r.columnwidth.length-1)]:r.columnwidth;return a(n)?Number(n):1}),C=D.reduce(u,0);D=D.map(function(t){return t/C*x});var I=Math.max(l(r.header.line.width),l(r.cells.line.width)),L={key:r.uid+t._context.staticPlot,translateX:v.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-v.y[1]),size:t._fullLayout._size,width:x,maxLineWidth:I,height:b,columnOrder:E,groupHeight:b,rowBlocks:k,headerRowBlocks:M,scrollY:0,cells:n({},r.cells,{values:o}),headerCells:n({},r.header,{values:y}),gdColumns:y.map(function(t){return t[0]}),gdColumnsOriginalOrder:y.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:y.map(function(t,r){var i=S[t];return S[t]=(i||0)+1,{key:t+"__"+S[t],label:t,specIndex:r,xIndex:E[r],xScale:d,x:void 0,calcdata:void 0,columnWidth:D[r]}})};return L.columns.forEach(function(t){t.calcdata=L,t.x=d(t)}),L}}}),N5=g({"src/traces/table/data_split_helpers.js"(t){var r=$().extendFlat;t.splitToPanels=function(t){var i=[0,0],n=r({},t,{key:"header",type:"header",page:0,prevPages:i,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:r({},t.calcdata,{cells:t.calcdata.headerCells})});return[r({},t,{key:"cells1",type:"cells",page:0,prevPages:i,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r({},t,{key:"cells2",type:"cells",page:1,prevPages:i,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n]},t.splitToCells=function(t){var r,i,n,a,o=(n=(i=(r=t).rowBlocks[r.page])?i.rows[0].rowIndex:0,a=i?n+i.rows.length:0,[n,a]);return(t.values||[]).slice(o[0],o[1]).map(function(r,i){return{keyWithinBlock:i+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:o[0]+i,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}}}),N4=g({"src/traces/table/plot.js"(t,r){var i=N2(),n=k(),a=t_(),o=a.numberFormat,s=yj(),l=rr(),u=tN(),c=t_().raiseToTop,h=t_().strTranslate,d=t_().cancelTransition,f=N3(),p=N5(),m=ei();function g(t){return Math.ceil(t.calcdata.maxLineWidth/2)}function y(t,r){return"clip"+t._fullLayout._uid+"_scrollAreaBottomClip_"+r.key}function v(t,r){return"clip"+t._fullLayout._uid+"_columnBoundaryClippath_"+r.calcdata.key+"_"+r.specIndex}function x(t){return[].concat.apply([],t.map(function(t){return t})).map(function(t){return t.__data__})}function b(t,r,a){var o=t.selectAll("."+i.cn.scrollbarKit).data(s.repeat,s.keyFun);o.enter().append("g").classed(i.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),o.each(function(t){var r,n=t.scrollbarState;n.totalHeight=R(r=t.rowBlocks,r.length-1)+(r.length?B(r[r.length-1],1/0):1),n.scrollableAreaHeight=t.groupHeight-D(t),n.currentlyVisibleHeight=Math.min(n.totalHeight,n.scrollableAreaHeight),n.ratio=n.currentlyVisibleHeight/n.totalHeight,n.barLength=Math.max(n.ratio*n.currentlyVisibleHeight,i.goldenRatio*i.scrollbarWidth),n.barWiggleRoom=n.currentlyVisibleHeight-n.barLength,n.wiggleRoom=Math.max(0,n.totalHeight-n.scrollableAreaHeight),n.topY=0===n.barWiggleRoom?0:t.scrollY/n.wiggleRoom*n.barWiggleRoom,n.bottomY=n.topY+n.barLength,n.dragMultiplier=n.wiggleRoom/n.barWiggleRoom}).attr("transform",function(t){return h(t.width+i.scrollbarWidth/2+i.scrollbarOffset,D(t))});var l=o.selectAll("."+i.cn.scrollbar).data(s.repeat,s.keyFun);l.enter().append("g").classed(i.cn.scrollbar,!0);var u=l.selectAll("."+i.cn.scrollbarSlider).data(s.repeat,s.keyFun);u.enter().append("g").classed(i.cn.scrollbarSlider,!0),u.attr("transform",function(t){return h(0,t.scrollbarState.topY||0)});var c=u.selectAll("."+i.cn.scrollbarGlyph).data(s.repeat,s.keyFun);c.enter().append("line").classed(i.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",i.scrollbarWidth).attr("stroke-linecap","round").attr("y1",i.scrollbarWidth/2),c.attr("y2",function(t){return t.scrollbarState.barLength-i.scrollbarWidth/2}).attr("stroke-opacity",function(t){return t.columnDragInProgress||!t.scrollbarState.barWiggleRoom||a?0:.4}),c.transition().delay(0).duration(0),c.transition().delay(i.scrollbarHideDelay).duration(i.scrollbarHideDuration).attr("stroke-opacity",0);var d=l.selectAll("."+i.cn.scrollbarCaptureZone).data(s.repeat,s.keyFun);d.enter().append("line").classed(i.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",i.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(i){var a=n.event.y,o=this.getBoundingClientRect(),s=i.scrollbarState,l=a-o.top,u=n.scale.linear().domain([0,s.scrollableAreaHeight]).range([0,s.totalHeight]).clamp(!0);s.topY<=l&&l<=s.bottomY||I(r,t,null,u(l-s.barLength/2))(i)}).call(n.behavior.drag().origin(function(t){return n.event.stopPropagation(),t.scrollbarState.scrollbarScrollInProgress=!0,t}).on("drag",I(r,t)).on("dragend",function(){})),d.attr("y2",function(t){return t.scrollbarState.scrollableAreaHeight}),r._context.staticPlot&&(c.remove(),d.remove())}function _(t,r,a,o){var u,c,h,d,f,g=((c=((u=a.selectAll("."+i.cn.columnCells).data(s.repeat,s.keyFun)).enter().append("g").classed(i.cn.columnCells,!0),u.exit().remove(),u).selectAll("."+i.cn.columnCell).data(p.splitToCells,function(t){return t.keyWithinBlock})).enter().append("g").classed(i.cn.columnCell,!0),c.exit().remove(),c);g.each(function(t,r){var i=t.calcdata.cells.font,n=t.column.specIndex,a={size:A(i.size,n,r),color:A(i.color,n,r),family:A(i.family,n,r),weight:A(i.weight,n,r),style:A(i.style,n,r),variant:A(i.variant,n,r),textcase:A(i.textcase,n,r),lineposition:A(i.lineposition,n,r),shadow:A(i.shadow,n,r)};t.rowNumber=t.key,t.align=A(t.calcdata.cells.align,n,r),t.cellBorderWidth=A(t.calcdata.cells.line.width,n,r),t.font=a}),((h=g.selectAll("."+i.cn.cellRect).data(s.repeat,function(t){return t.keyWithinBlock})).enter().append("rect").classed(i.cn.cellRect,!0),h).attr("width",function(t){return t.column.columnWidth}).attr("stroke-width",function(t){return t.cellBorderWidth}).each(function(t){var r=n.select(this);m.stroke(r,A(t.calcdata.cells.line.color,t.column.specIndex,t.rowNumber)),m.fill(r,A(t.calcdata.cells.fill.color,t.column.specIndex,t.rowNumber))});var y=((f=((d=g.selectAll("."+i.cn.cellTextHolder).data(s.repeat,function(t){return t.keyWithinBlock})).enter().append("g").classed(i.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),d).selectAll("."+i.cn.cellText).data(s.repeat,function(t){return t.keyWithinBlock})).enter().append("text").classed(i.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){n.event.stopPropagation()}),f);y.each(function(t){l.font(n.select(this),t.font)}),w(y,r,o,t),O(g)}function w(t,r,a,s){t.text(function(t){var r,n=t.column.specIndex,a=t.rowNumber,s=t.value,l="string"==typeof s,u=l&&s.match(/
/i),c=!l||u;t.mayHaveMarkup=l&&s.match(/[<&>]/);var h="string"==typeof(d=s)&&d.match(i.latexCheck);t.latex=h;var d,f,p=h?"":A(t.calcdata.cells.prefix,n,a)||"",m=h?"":A(t.calcdata.cells.suffix,n,a)||"",g=h?null:A(t.calcdata.cells.format,n,a)||null,y=p+(g?o(g)(t.value):t.value)+m;if(t.wrappingNeeded=!t.wrapped&&!c&&!h&&(f=T(y)),t.cellHeightMayIncrease=u||h||t.mayHaveMarkup||(void 0===f?T(y):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===i.wrapSplitCharacter?y.replace(/a&&n.push(o),a+=u}return n}(a,u,l);1===c.length&&(c[0]===a.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),r.each(function(t,r){t.page=c[r],t.scrollY=u}),r.attr("transform",function(t){return h(0,R(t.rowBlocks,t.page)-t.scrollY)}),t&&(L(t,i,r,c,n.prevPages,n,0),L(t,i,r,c,n.prevPages,n,1),b(i,t))}}function I(t,r,a,o){return function(s){var l=s.calcdata?s.calcdata:s,u=r.filter(function(t){return l.key===t.key}),c=a||l.scrollbarState.dragMultiplier,h=l.scrollY;return l.scrollY=void 0===o?l.scrollY+c*n.event.dy:o,C(t,u.selectAll("."+i.cn.yColumn).selectAll("."+i.cn.columnBlock).filter(S),u),l.scrollY===h}}function L(t,r,i,n,a,o,s){n[s]!==a[s]&&(clearTimeout(o.currentRepaint[s]),o.currentRepaint[s]=setTimeout(function(){_(t,r,i.filter(function(t,r){return r===s&&n[r]!==a[r]}),i),a[s]=n[s]}))}function P(t,r,a,o){return function(){var s=n.select(r.parentNode);s.each(function(t){var r=t.fragments;s.selectAll("tspan.line").each(function(t,i){r[i].width=this.getComputedTextLength()});var n,a,o=r[r.length-1].width,l=r.slice(0,-1),u=[],c=0,h=t.column.columnWidth-2*i.cellPad;for(t.value="";l.length;)c+(a=(n=l.shift()).width+o)>h&&(t.value+=u.join(i.wrapSpacer)+i.lineBreaker,u=[],c=0),u.push(n.text),c+=a;c&&(t.value+=u.join(i.wrapSpacer)),t.wrapped=!0}),s.selectAll("tspan.line").remove(),w(s.select("."+i.cn.cellText),a,t,o),n.select(r.parentNode.parentNode).call(O)}}function z(t,r,a,o,s){return function(){if(!s.settledY){var l=n.select(r.parentNode),u=j(s),c=s.key-u.firstRowIndex,d=u.rows[c].rowHeight,f=Math.max(s.cellHeightMayIncrease?r.parentNode.getBoundingClientRect().height+2*i.cellPad:d,d);f-u.rows[c].rowHeight&&(u.rows[c].rowHeight=f,t.selectAll("."+i.cn.columnCell).call(O),C(null,t.filter(S),0),b(a,o,!0)),l.attr("transform",function(){var t=this.parentNode.getBoundingClientRect(),r=n.select(this.parentNode).select("."+i.cn.cellRect).node().getBoundingClientRect(),a=this.transform.baseVal.consolidate(),o=r.top-t.top+(a?a.matrix.f:i.cellPad);return h(F(s,n.select(this.parentNode).select("."+i.cn.cellTextHolder).node().getBoundingClientRect().width),o)}),s.settledY=!0}}}function F(t,r){switch(t.align){case"left":default:return i.cellPad;case"right":return t.column.columnWidth-(r||0)-i.cellPad;case"center":return(t.column.columnWidth-(r||0))/2}}function O(t){t.attr("transform",function(t){var r=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,r){return t+B(r,1/0)},0);return h(0,B(j(t),t.key)+r)}).selectAll("."+i.cn.cellRect).attr("height",function(t){var r,i;return(r=j(t),i=t.key,r.rows[i-r.firstRowIndex]).rowHeight})}function R(t,r){for(var i=0,n=r-1;n>=0;n--)i+=function(t){var r=t.allRowsHeight;if(void 0!==r)return r;for(var i=0,n=0;nr.length&&(t=t.slice(0,r.length)):t=[],a=0;a90&&(f-=180,u=-u),{angle:f,flip:u,p:t.c2p(n,r,i),offsetMultplier:c}}}}),Vl=g({"src/traces/carpet/plot.js"(t,r){var i=k(),n=rr(),a=Va(),o=Vo(),s=Vs(),l=tN(),u=t_(),c=u.strRotate,h=u.strTranslate,d=tj();function f(t,r,s,l,u,c,h){var d="const-"+u+"-lines",f=s.selectAll("."+d).data(c);f.enter().append("path").classed(d,!0).style("vector-effect",h?"none":"non-scaling-stroke"),f.each(function(s){var l=s.x,u=s.y,c="M"+o(a([],l,t.c2p),a([],u,r.c2p),s.smoothing);i.select(this).attr("d",c).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")}),f.exit().remove()}function p(t,r,a,o,u,d,f,p){var m=d.selectAll("text."+p).data(f);m.enter().append("text").classed(p,!0);var g=0,y={};return m.each(function(u,d){if("auto"===u.axis.tickangle)f=s(o,r,a,u.xy,u.dxy);else{var f,p=(u.axis.tickangle+180)*Math.PI/180;f=s(o,r,a,u.xy,[Math.cos(p),Math.sin(p)])}d||(y={angle:f.angle,flip:f.flip});var m=(u.endAnchor?-1:1)*f.flip,v=i.select(this).attr({"text-anchor":m>0?"start":"end","data-notex":1}).call(n.font,u.font).text(u.text).call(l.convertToTspans,t),x=n.bBox(this);v.attr("transform",h(f.p[0],f.p[1])+c(f.angle)+h(u.axis.labelpadding*m,.3*x.height)),g=Math.max(g,x.width+u.axis.labelpadding)}),m.exit().remove(),y.maxExtent=g,y}r.exports=function(t,r,n,l){var c=t._context.staticPlot,h=r.xaxis,d=r.yaxis,m=t._fullLayout._clips;u.makeTraceGroups(l,n,"trace").each(function(r){var n,l,g,v,x,b,_,w,T,A,M,k,S,E,D,C,I=i.select(this),L=r[0],P=L.trace,z=P.aaxis,F=P.baxis,O=u.ensureSingle(I,"g","minorlayer"),R=u.ensureSingle(I,"g","majorlayer"),B=u.ensureSingle(I,"g","boundarylayer"),j=u.ensureSingle(I,"g","labellayer");I.style("opacity",P.opacity),f(h,d,R,z,"a",z._gridlines,!0),f(h,d,R,F,"b",F._gridlines,!0),f(h,d,O,z,"a",z._minorgridlines,!0),f(h,d,O,F,"b",F._minorgridlines,!0),f(h,d,B,z,"a-boundary",z._boundarylines,c),f(h,d,B,F,"b-boundary",F._boundarylines,c);var N=p(t,h,d,P,L,j,z._labels,"a-label"),V=p(t,h,d,P,L,j,F._labels,"b-label");n=t,l=j,g=P,v=L,x=h,b=d,_=N,w=V,S=u.aggNums(Math.min,null,g.a),E=u.aggNums(Math.max,null,g.a),D=u.aggNums(Math.min,null,g.b),C=u.aggNums(Math.max,null,g.b),T=.5*(S+E),A=D,M=g.ab2xy(T,A,!0),k=g.dxyda_rough(T,A),void 0===_.angle&&u.extendFlat(_,s(g,x,b,M,g.dxydb_rough(T,A))),y(n,l,g,v,M,k,g.aaxis,x,b,_,"a-title"),T=S,A=.5*(D+C),M=g.ab2xy(T,A,!0),k=g.dxydb_rough(T,A),void 0===w.angle&&u.extendFlat(w,s(g,x,b,M,g.dxyda_rough(T,A))),y(n,l,g,v,M,k,g.baxis,x,b,w,"b-title"),function(t,r,i,n,s){var l,c,h=i.select("#"+t._clipPathId);h.size()||(h=i.append("clipPath").classed("carpetclip",!0));var d=u.ensureSingle(h,"path","carpetboundary"),f=r.clipsegments,p=[];for(c=0;c90&&x<270&&(w=(-l.lineCount(b)+g)*m*o-w),b.attr("transform",h(r.p[0],r.p[1])+c(r.angle)+h(0,w)).attr("text-anchor","middle").call(n.font,f.title.font)}),_.exit().remove()}}}),Vu=g({"src/traces/carpet/cheater_basis.js"(t,r){var i=t_().isArrayOrTypedArray;r.exports=function(t,r,n){var a,o,s,l,u,c=[],h=i(t)?t.length:t,d=i(r)?r.length:r,f=i(t)?t:null,p=i(r)?r:null;f&&(s=(f.length-1)/(f[f.length-1]-f[0])/(h-1)),p&&(l=(p.length-1)/(p[p.length-1]-p[0])/(d-1));var m,g=1/0,y=-1/0;for(o=0;o=10)return null;for(var a=1/0,o=-1/0,s=r.length,l=0;l0&&(p=t.dxydi([],n-1,s,0,l),v.push(u[0]+p[0]/3),x.push(u[1]+p[1]/3),m=t.dxydi([],n-1,s,1,l),v.push(d[0]-m[0]/3),x.push(d[1]-m[1]/3)),v.push(d[0]),x.push(d[1]),u=d;else for(c=Math.floor(Math.max(0,Math.min(I-2,n=t.a2i(i)))),h=n-c,b.length=I,b.crossLength=L,b.xy=function(r){return t.evalxy([],n,r)},b.dxy=function(r,i){return t.dxydj([],c,r,h,i)},o=0;o0&&(g=t.dxydj([],c,o-1,h,0),v.push(u[0]+g[0]/3),x.push(u[1]+g[1]/3),y=t.dxydj([],c,o-1,h,1),v.push(d[0]-y[0]/3),x.push(d[1]-y[1]/3)),v.push(d[0]),x.push(d[1]),u=d;return b.axisLetter=r,b.axis=_,b.crossAxis=k,b.value=i,b.constvar=a,b.index=f,b.x=v,b.y=x,b.smoothing=k.smoothing,b}function F(i){var n,o,s,l,u,c=[],h=[],d={};if(d.length=b.length,d.crossLength=M.length,"b"===r)for(s=Math.max(0,Math.min(L-2,i)),u=Math.min(1,Math.max(0,i-s)),d.xy=function(r){return t.evalxy([],r,i)},d.dxy=function(r,i){return t.dxydi([],r,s,i,u)},n=0;nb.length-1||w.push(n(F(s),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=h;fb.length-1)&&!(g<0||g>b.length-1))for(y=b[l],v=b[g],o=0;o<_.minorgridcount;o++)!((x=g-l)<=0)&&((m=y+(v-y)*(o+1)/(_.minorgridcount+1)*(_.arraydtick/x))b[b.length-1]||T.push(n(z(m),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash})));_.startline&&A.push(n(F(0),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&A.push(n(F(b.length-1),{color:_.endlinecolor,width:_.endlinewidth}))}else{for(u=5e-15,h=(c=[Math.floor((b[b.length-1]-_.tick0)/_.dtick*(1+u)),Math.ceil((b[0]-_.tick0)/_.dtick/(1+u))].sort(function(t,r){return t-r}))[0],d=c[1],f=h;f<=d;f++)p=_.tick0+_.dtick*f,w.push(n(z(p),{color:_.gridcolor,width:_.gridwidth,dash:_.griddash}));for(f=h-1;fb[b.length-1]||T.push(n(z(m),{color:_.minorgridcolor,width:_.minorgridwidth,dash:_.minorgriddash}));_.startline&&A.push(n(z(b[0]),{color:_.startlinecolor,width:_.startlinewidth})),_.endline&&A.push(n(z(b[b.length-1]),{color:_.endlinecolor,width:_.endlinewidth}))}}}}),Vd=g({"src/traces/carpet/calc_labels.js"(t,r){var i=rs(),n=$().extendFlat;r.exports=function(t,r){var a,o,s,l,u,c=r._labels=[],h=r._gridlines;for(a=0;a=0;a--)o[h-a]=t[d][a],s[h-a]=r[d][a];for(l.push({x:o,y:s,bicubic:u}),a=d,o=[],s=[];a>=0;a--)o[d-a]=t[a][0],s[d-a]=r[a][0];return l.push({x:o,y:s,bicubic:c}),l}}}),Vp=g({"src/traces/carpet/smooth_fill_2d_array.js"(t,r){var i=t_();r.exports=function(t,r,n){var a,o,s,l=[],u=[],c=t[0].length,h=t.length,d=0;for(a=0;a0&&void 0!==(n=t[i][r-1])&&(o++,a+=n),r0&&void 0!==(n=t[i-1][r])&&(o++,a+=n),i0&&o0&&a1e-5);return i.log("Smoother converged to",A,"after",M,"iterations"),t}}}),Vm=g({"src/traces/carpet/constants.js"(t,r){r.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Vg=g({"src/traces/carpet/catmull_rom.js"(t,r){r.exports=function(t,r,i,n){var a=t[0]-r[0],o=t[1]-r[1],s=i[0]-r[0],l=i[1]-r[1],u=Math.pow(a*a+o*o,.25),c=Math.pow(s*s+l*l,.25),h=(c*c*a-u*u*s)*n,d=(c*c*o-u*u*l)*n,f=c*(u+c)*3,p=u*(u+c)*3;return[[r[0]+(f&&h/f),r[1]+(f&&d/f)],[r[0]-(p&&h/p),r[1]-(p&&d/p)]]}}}),Vy=g({"src/traces/carpet/compute_control_points.js"(t,r){var i=Vg(),n=t_().ensureArray;function a(t,r,i){var n=-.5*i[0]+1.5*r[0],a=-.5*i[1]+1.5*r[1];return[(2*n+t[0])/3,(2*a+t[1])/3]}r.exports=function(t,r,o,s,l,u){var c,h,d,f,p,m,g,y,v,x,b=o[0].length,_=o.length,w=l?3*b-2:b,T=u?3*_-2:_;for(t=n(t,T),r=n(r,T),d=0;dp&&tg&&rm||ry},t.setScale=function(){var r=t._x,i=t._y,n=a(t._xctrl,t._yctrl,r,i,d.smoothing,f.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,h,d.smoothing,f.smoothing),t.dxydi=s([t._xctrl,t._yctrl],d.smoothing,f.smoothing),t.dxydj=l([t._xctrl,t._yctrl],d.smoothing,f.smoothing)},t.i2a=function(t){var i=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-i;return(1-n)*r[i]+n*r[i+1]},t.j2b=function(t){var r=Math.max(0,Math.floor(t[1]),c-2),i=t[1]-r;return(1-i)*u[r]+i*u[r+1]},t.ij2ab=function(r){return[t.i2a(r[0]),t.j2b(r[1])]},t.a2i=function(t){var i=Math.max(0,Math.min(n(t,r),c-2)),a=r[i],o=r[i+1];return Math.max(0,Math.min(c-1,i+(t-a)/(o-a)))},t.b2j=function(t){var r=Math.max(0,Math.min(n(t,u),h-2)),i=u[r],a=u[r+1];return Math.max(0,Math.min(h-1,r+(t-i)/(a-i)))},t.ab2ij=function(r){return[t.a2i(r[0]),t.b2j(r[1])]},t.i2c=function(r,i){return t.evalxy([],r,i)},t.ab2xy=function(i,n,a){if(!a&&(ir[c-1]|nu[h-1]))return[!1,!1];var o=t.a2i(i),s=t.b2j(n),l=t.evalxy([],o,s);if(a){var d,f,p,m,g=0,y=0,v=[];ir[c-1]?(d=c-2,f=1,g=(i-r[c-1])/(r[c-1]-r[c-2])):(d=Math.max(0,Math.min(c-2,Math.floor(o))),f=o-d),nu[h-1]?(p=h-2,m=1,y=(n-u[h-1])/(u[h-1]-u[h-2])):(p=Math.max(0,Math.min(h-2,Math.floor(s))),m=s-p),g&&(t.dxydi(v,d,p,f,m),l[0]+=v[0]*g,l[1]+=v[1]*g),y&&(t.dxydj(v,d,p,f,m),l[0]+=v[0]*y,l[1]+=v[1]*y)}return l},t.c2p=function(t,r,i){return[r.c2p(t[0]),i.c2p(t[1])]},t.p2x=function(t,r,i){return[r.p2c(t[0]),i.p2c(t[1])]},t.dadi=function(t){var i=Math.max(0,Math.min(r.length-2,t));return r[i+1]-r[i]},t.dbdj=function(t){var r=Math.max(0,Math.min(u.length-2,t));return u[r+1]-u[r]},t.dxyda=function(r,i,n,a){var o=t.dxydi(null,r,i,n,a),s=t.dadi(r,n);return[o[0]/s,o[1]/s]},t.dxydb=function(r,i,n,a){var o=t.dxydj(null,r,i,n,a),s=t.dbdj(i,a);return[o[0]/s,o[1]/s]},t.dxyda_rough=function(r,i,n){var a=v*(n||.1),o=t.ab2xy(r+a,i,!0),s=t.ab2xy(r-a,i,!0);return[(o[0]-s[0])*.5/a,(o[1]-s[1])*.5/a]},t.dxydb_rough=function(r,i,n){var a=x*(n||.1),o=t.ab2xy(r,i+a,!0),s=t.ab2xy(r,i-a,!0);return[(o[0]-s[0])*.5/a,(o[1]-s[1])*.5/a]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}}}),Vw=g({"src/traces/carpet/calc.js"(t,r){var i=rs(),n=t_().isArray1D,a=Vu(),o=Vc(),s=Vh(),l=Vd(),u=Vf(),c=ot(),h=Vp(),d=oe(),f=V_();r.exports=function(t,r){var p=i.getFromId(t,r.xaxis),m=i.getFromId(t,r.yaxis),g=r.aaxis,y=r.baxis,v=r.x,x=r.y,b=[];v&&n(v)&&b.push("x"),x&&n(x)&&b.push("y"),b.length&&d(r,g,y,"a","b",b);var _=r._a=r._a||r.a,w=r._b=r._b||r.b;v=r._x||r.x,x=r._y||r.y;var T={};r._cheater&&(v=a("index"===g.cheatertype?_.length:_,"index"===y.cheatertype?w.length:w,r.cheaterslope)),r._x=v=c(v),r._y=x=c(x),h(v,_,w),h(x,_,w),f(r),r.setScale();var A=o(v),M=o(x),k=.5*(A[1]-A[0]),S=.5*(A[1]+A[0]),E=.5*(M[1]-M[0]),D=.5*(M[1]+M[0]);return A=[S-1.3*k,S+1.3*k],M=[D-1.3*E,D+1.3*E],r._extremes[p._id]=i.findExtremes(p,A,{padded:!0}),r._extremes[m._id]=i.findExtremes(m,M,{padded:!0}),s(r,"a","b"),s(r,"b","a"),l(r,g),l(r,y),T.clipsegments=u(r._xctrl,r._yctrl,g,y),T.x=v,T.y=x,T.a=_,T.b=w,[T]}}}),VT=g({"src/traces/carpet/index.js"(t,r){r.exports={attributes:Ve(),supplyDefaults:Vn(),plot:Vl(),calc:Vw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:ny(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),VA=g({"lib/carpet.js"(t,r){r.exports=VT()}}),VM=g({"src/traces/scattercarpet/attributes.js"(t,r){var i=i_(),n=iw(),a=K(),{hovertemplateAttrs:o,texttemplateAttrs:s,templatefallbackAttrs:l}=eZ(),u=tH(),c=$().extendFlat,h=n.marker,d=n.line,f=h.line;r.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:c({},n.mode,{dflt:"markers"}),text:c({},n.text,{}),texttemplate:s({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:l({editType:"plot"}),hovertext:c({},n.hovertext,{}),line:{color:d.color,width:d.width,dash:d.dash,backoff:d.backoff,shape:c({},d.shape,{values:["linear","spline"]}),smoothing:d.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:c({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:c({symbol:h.symbol,opacity:h.opacity,maxdisplayed:h.maxdisplayed,angle:h.angle,angleref:h.angleref,standoff:h.standoff,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,line:c({width:f.width,dash:f.dash,editType:"calc"},u("marker.line")),gradient:h.gradient,editType:"calc"},u("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:c({},a.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:o(),hovertemplatefallback:l(),zorder:n.zorder}}}),Vk=g({"src/traces/scattercarpet/defaults.js"(t,r){var i=t_(),n=ib(),a=t8(),o=i$(),s=iW(),l=iY(),u=iZ(),c=iX(),h=VM();r.exports=function(t,r,d,f){function p(n,a){return i.coerce(t,r,h,n,a)}p("carpet"),r.xaxis="x",r.yaxis="y";var m=p("a"),g=p("b"),y=Math.min(m.length,g.length);if(!y){r.visible=!1;return}r._length=y,p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("mode",y")}return s}function v(t,r){var i;i=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(i+": "+r.toFixed(3)+t.labelsuffix)}}}}),VL=g({"src/traces/scattercarpet/event_data.js"(t,r){r.exports=function(t,r,i,n,a){var o=n[a];return t.a=o.a,t.b=o.b,t.y=o.y,t}}}),VP=g({"src/traces/scattercarpet/index.js"(t,r){r.exports={attributes:VM(),supplyDefaults:Vk(),colorbar:ni(),formatLabels:VS(),calc:VD(),plot:VC(),style:na().style,styleOnSelect:na().styleOnSelect,hoverPoints:VI(),selectPoints:nl(),eventData:VL(),moduleType:"trace",name:"scattercarpet",basePlotModule:ny(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Vz=g({"lib/scattercarpet.js"(t,r){r.exports=VP()}}),VF=g({"src/traces/contourcarpet/attributes.js"(t,r){var i=aQ(),n=oC(),a=tH(),o=$().extendFlat,s=n.contours;r.exports=o({carpet:{valType:"string",editType:"calc"},z:i.z,a:i.x,a0:i.x0,da:i.dx,b:i.y,b0:i.y0,db:i.dy,text:i.text,hovertext:i.hovertext,transpose:i.transpose,atype:i.xtype,btype:i.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},a("",{cLetter:"z",autoColorDflt:!1}))}}),VO=g({"src/traces/contourcarpet/defaults.js"(t,r){var i=t_(),n=a0(),a=VF(),o=oQ(),s=oL(),l=oz();r.exports=function(t,r,u,c){function h(n,o){return i.coerce(t,r,a,n,o)}if(h("carpet"),t.a&&t.b){if(!n(t,r,h,c,"a","b")){r.visible=!1;return}h("text"),"constraint"===h("contours.type")?o(t,r,h,c,u,{hasHover:!1}):(s(t,r,h,function(n){return i.coerce2(t,r,a,n)}),l(t,r,h,c,{hasHover:!1}))}else r._defaultColor=u,r._length=null;h("zorder")}}}),VR=g({"src/traces/contourcarpet/calc.js"(t,r){var i=t4(),n=t_(),a=oe(),o=ot(),s=or(),l=oi(),u=on(),c=VO(),h=VE(),d=oO();r.exports=function(t,r){var f=r._carpetTrace=h(t,r);if(!(!f||!f.visible||"legendonly"===f.visible)){if(!r.a||!r.b){var p,m,g,y,v,x,b,_,w,T,A,M,k,S,E,D,C,I=t.data[f.index],L=t.data[r.index];L.a||(L.a=I.a),L.b||(L.b=I.b),c(L,r,r._defaultColor,t._fullLayout)}var P=(p=t,A=(T=(m=r)._carpetTrace).aaxis,M=T.baxis,A._minDtick=0,M._minDtick=0,n.isArray1D(m.z)&&a(m,A,M,"a","b",["z"]),g=m._a=m._a||m.a,x=m._b=m._b||m.b,g=g?A.makeCalcdata(m,"_a"):[],x=x?M.makeCalcdata(m,"_b"):[],y=m.a0||0,v=m.da||1,b=m.b0||0,_=m.db||1,w=m._z=o(m._z||m.z,m.transpose),m._emptypoints=l(w),s(w,m._emptypoints),k=n.maxRowLength(w),S="scaled"===m.xtype?"":g,E=u(m,S,y,v,k,A),D="scaled"===m.ytype?"":x,C=u(m,D,b,_,w.length,M),"levels"===m.contours.type&&"none"!==m.contours.coloring&&i(p,m,{vals:w,containerStr:"",cLetter:"z"}),[{a:E,b:C,z:w}]);return d(r,r._z),P}}}}),VB=g({"src/traces/carpet/axis_aligned_line.js"(t,r){var i=t_().isArrayOrTypedArray;r.exports=function(t,r,n,a){var o,s,l,u,c,h,d,f,p,m,g,y,v,x=i(n)?"a":"b",b=("a"===x?t.aaxis:t.baxis).smoothing,_="a"===x?t.a2i:t.b2j,w="a"===x?n:a,T="a"===x?a:n,A="a"===x?r.a.length:r.b.length,M="a"===x?r.b.length:r.a.length,k=Math.floor("a"===x?t.b2j(T):t.a2i(T)),S="a"===x?function(r){return t.evalxy([],r,k)}:function(r){return t.evalxy([],k,r)};b&&(l=Math.max(0,Math.min(M-2,k)),u=k-l,s="a"===x?function(r,i){return t.dxydi([],r,l,i,u)}:function(r,i){return t.dxydj([],l,r,u,i)});var E=_(w[0]),D=_(w[1]),C=E0?Math.floor:Math.ceil,P=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,F=C>0?Math.max:Math.min,O=L(E+I),R=P(D-I),B=[[d=S(E)]];for(o=O;o*C=0;Q--)K=n([],(X=S.clipsegments[Q]).x,w.c2p),J=n([],X.y,T.c2p),K.reverse(),J.reverse(),ee.push(a(K,J,X.bicubic));var et="M"+ee.join("L")+"Z";(function(t,r,i,o,l,u){var c,h,d=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==u||l?[]:[0]);d.enter().append("path"),d.exit().remove();var f=[];for(h=0;h=0&&(d=D,p=m):Math.abs(h[1]-d[1])=0&&(d=D,p=m):s.log("endpt to newendpt is not vert. or horz.",h,d,D)}if(p>=0)break;v+=S(h,d),h=d}if(p===t.edgepaths.length){s.log("unclosed perimeter path");break}c=p,(b=-1===x.indexOf(c))&&(c=x[0],v+=S(h,d)+"Z",h=null)}for(c=0;cg&&(n.max=g),n.len=n.max-n.min}function b(t,r){var i=0;return(.1>Math.abs(t[0]-u)||.1>Math.abs(t[0]-c))&&(i=Math.max(i,o*x(r,v(a.dxydb_rough(t[0],t[1],.1)))/2)),(.1>Math.abs(t[1]-h)||.1>Math.abs(t[1]-d))&&(i=Math.max(i,o*x(r,v(a.dxyda_rough(t[0],t[1],.1)))/2)),i}}(this,i,t,n,d,r.height),!(n.len<(r.width+r.height)*h.LABELMIN)))for(var a=Math.min(Math.ceil(n.len/z),h.LABELMAX),o=0;ov):y=k>T,v=k;var S=c(T,A,M,k);S.pos=w,S.yc=(T+k)/2,S.i=_,S.dir=y?"increasing":"decreasing",S.x=S.pos,S.y=[M,A],x&&(S.orig_p=o[_]),m&&(S.tx=r.text[_]),g&&(S.htx=r.hovertext[_]),b.push(S)}else b.push({pos:w,empty:!0})}return r._extremes[u._id]=a.findExtremes(u,i.concat(f,d),{padded:!0}),b.length&&(b[0].t={labels:{open:n(t,"open:")+" ",high:n(t,"high:")+" ",low:n(t,"low:")+" ",close:n(t,"close:")+" "}}),b}r.exports={calc:function(t,r){var n=a.getFromId(t,r.xaxis),s=a.getFromId(t,r.yaxis),c=function(t,r,n){var a=n._minDiff;if(!a){var s,l=t._fullData,u=[];for(s=0,a=1/0;s"+h.labels[x]+i.hoverLabelText(l,b,u.yhoverformat)):((v=n.extendFlat({},f)).y0=v.y1=_,v.yLabelVal=b,v.yLabel=h.labels[x]+i.hoverLabelText(l,b,u.yhoverformat),v.name="",d.push(v),g[b]=v)}return d}function d(t,r,n,a){var o=t.cd,l=t.ya,h=o[0].trace,d=o[0].t,f=c(t,r,n,a);if(!f)return[];var p=o[f.index],m=f.index=p.i,g=p.dir;function y(t){return d.labels[t]+i.hoverLabelText(l,h[t][m],h.yhoverformat)}var v=p.hi||h.hoverinfo||"",x=v.split("+"),b="all"===v,_=b||-1!==x.indexOf("y"),w=b||-1!==x.indexOf("text"),T=_?[y("open"),y("high"),y("low"),y("close")+" "+u[g]]:[];return w&&s(p,h,T),f.extraText=T.join("
"),f.y0=f.y1=l.c2p(p.yc,!0),[f]}r.exports={hoverPoints:function(t,r,i,n){return t.cd[0].trace.hoverlabel.split?h(t,r,i,n):d(t,r,i,n)},hoverSplit:h,hoverOnPoints:d}}}),VZ=g({"src/traces/ohlc/select.js"(t,r){r.exports=function(t,r){var i,n=t.cd,a=t.xaxis,o=t.yaxis,s=[],l=n[0].t.bPos||0;if(!1===r)for(i=0;ir?function(t){return t<=0}:function(t){return t>=0};l.c2g=function(r){var i=l.c2l(r)-t;return(o(i)?i:0)+a},l.g2c=function(r){return l.l2c(r+t-a)},l.g2p=function(t){return t*n},l.c2p=function(t){return l.g2p(l.c2g(t))}};break;case"angularaxis":var c=t,h=r,d=c.type;if("linear"===d){var f=c.d2c,p=c.c2d;c.d2c=function(t,r){var i;return i=f(t),"degrees"===r?a(i):i},c.c2d=function(t,r){return p("degrees"===r?o(t):t)}}c.makeCalcdata=function(t,r){var i,n,a=t[r],o=t._length,s=function(r){return c.d2c(r,t.thetaunit)};if(a)for(i=Array(o),n=0;n1e-10?t:0}function d(t,r,i){r=r||0,i=i||0;for(var n=t.length,a=Array(n),o=0;o0?i:1/0}),o=i.mod(n+1,r.length);return[r[n],r[o]]},findIntersectionXY:u,findXYatLength:function(t,r,i,n){var a=-r*i,o=r*r+1,s=2*(r*a-i),l=Math.sqrt(s*s-4*o*(a*a+i*i-t*t)),u=(-s+l)/(2*o),c=(-s-l)/(2*o);return[[u,r*u+a+n],[c,r*c+a+n]]},clampTiny:h,pathPolygon:function(t,r,i,n,a,o){return"M"+d(c(t,r,i,n),a,o).join("L")},pathPolygonAnnulus:function(t,r,i,n,a,o,s){t0))!=(o<0?-1:+(o>0))){var p=n(t,i([r,0]));return["M"+u+","+c,"A"+s+","+s+" 0 0,"+(0=90||x>90&&b>=450?1:w<=0&&A<=0?0:Math.max(w,A),[x<=180&&b>=180||x>180&&b>=540?-1:_>=0&&T>=0?0:Math.min(_,T),x<=270&&b>=270||x>270&&b>=630?-1:w>=0&&A>=0?0:Math.min(w,A),b>=360?1:_<=0&&T<=0?0:Math.max(_,T),g]),I=C[2]-C[0],L=Math.abs((C[3]-C[1])/I);f/d>L?(M=d,D=(f-(k=d*L))/n.h/2,S=[c[0],c[1]],E=[h[0]+D,h[1]-D]):(M=f/L,k=f,D=(d-M)/n.w/2,S=[c[0]+D,c[1]-D],E=[h[0],h[1]]),this.xLength2=M,this.yLength2=k,this.xDomain2=S,this.yDomain2=E;var P,z=this.xOffset2=n.l+n.w*S[0],R=this.yOffset2=n.t+n.h*(1-E[1]),B=this.radius=M/I,j=this.innerRadius=this.getHole(r)*B,N=this.cx=z-B*C[0],V=this.cy=R+B*C[3],U=this.cxx=N-z,q=this.cyy=V-R,G=a.side;"counterclockwise"===G?(P=G,G="top"):"clockwise"===G&&(P=G,G="bottom"),this.radialAxis=this.mockAxis(t,r,a,{_id:"x",side:G,_trueSide:P,domain:[j/n.w,B/n.w]}),this.angularAxis=this.mockAxis(t,r,o,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,r),this.updateAngularAxis(t,r),this.updateRadialAxis(t,r),this.updateRadialAxisTitle(t,r),this.xaxis=this.mockCartesianAxis(t,r,{_id:"x",domain:S}),this.yaxis=this.mockCartesianAxis(t,r,{_id:"y",domain:E});var H=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",H).attr("transform",s(U,q)),i.frontplot.attr("transform",s(z,R)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),i.bg.attr("d",H).attr("transform",s(N,V)).call(l.fill,r.bgcolor)},j.mockAxis=function(t,r,i,n){var o=a.extendFlat({},i,n);return f(o,r,t),o},j.mockCartesianAxis=function(t,r,i){var n=this,o=n.isSmith,s=i._id,l=a.extendFlat({type:"linear"},i);d(l,t);var u={x:[0,2],y:[1,3]};return l.setRange=function(){var t=n.sectorBBox,i=u[s],a=n.radialAxis._rl,o=(a[1]-a[0])/(1-n.getHole(r));l.range=[t[i[0]]*o,t[i[1]]*o]},l.isPtWithinRange="x"!==s||o?function(){return!0}:function(t){return n.isPtInside(t)},l.setRange(),l.setScale(),l},j.doAutoRange=function(t,r){var i=this.gd,n=this.radialAxis,a=this.getRadial(r);p(i,n);var o=n.range;if(a.range=o.slice(),a._input.range=o.slice(),n._rl=[n.r2l(o[0],null,"gregorian"),n.r2l(o[1],null,"gregorian")],void 0!==n.minallowed){var s=n.r2l(n.minallowed);n._rl[0]>n._rl[1]?n._rl[1]=Math.max(n._rl[1],s):n._rl[0]=Math.max(n._rl[0],s)}if(void 0!==n.maxallowed){var l=n.r2l(n.maxallowed);n._rl[0]90&&g<=270&&(y.tickangle=180);var b=x?function(t){var r=P(i,C([t.x,0]));return s(r[0]-f,r[1]-p)}:function(t){return s(y.l2p(t.x)+d,0)},_=x?function(t){return L(i,t.x,-1/0,1/0)}:function(t){return i.pathArc(y.r2p(t.x)+d)},w=N(m);if(i.radialTickLayout!==w&&(u["radial-axis"].selectAll(".xtick").remove(),i.radialTickLayout=w),v){y.setScale();var T=0,A=x?(y.tickvals||[]).filter(function(t){return t>=0}).map(function(t){return h.tickText(y,t,!0,!1)}):h.calcTicks(y),M=x?A:h.clipEnds(y,A),k=h.getTickSigns(y)[2];x&&(("top"===y.ticks&&"bottom"===y.side||"bottom"===y.ticks&&"top"===y.side)&&(k=-k),"top"===y.ticks&&"top"===y.side&&(T=-y.ticklen),"bottom"===y.ticks&&"bottom"===y.side&&(T=y.ticklen)),h.drawTicks(n,y,{vals:A,layer:u["radial-axis"],path:h.makeTickPath(y,0,k),transFn:b,crisp:!1}),h.drawGrid(n,y,{vals:M,layer:u["radial-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,y,{vals:A,layer:u["radial-axis"],transFn:b,labelFns:h.makeLabelFns(y,T)})}var S=i.radialAxisAngle=i.vangles?R(V(O(m.angle),i.vangles)):m.angle,E=s(f,p),D=E+o(-S);U(u["radial-axis"],v&&(m.showticklabels||m.ticks),{transform:D}),U(u["radial-grid"],v&&m.showgrid,{transform:x?"":E}),U(u["radial-line"].select("line"),v&&m.showline,{x1:x?-c:d,y1:0,x2:c,y2:0,transform:D}).attr("stroke-width",m.linewidth).call(l.stroke,m.linecolor)},j.updateRadialAxisTitle=function(t,r,i){if(!this.isSmith){var n=this.gd,a=this.radius,o=this.cx,s=this.cy,l=this.getRadial(r),c=this.id+"title",h=0;if(l.title){var d=u.bBox(this.layers["radial-axis"].node()).height,f=l.title.font.size,p=l.side;h="top"===p?f:"counterclockwise"===p?-(d+.4*f):d+.8*f}var m=void 0!==i?i:this.radialAxisAngle,g=O(m),y=Math.cos(g),x=Math.sin(g),b=o+a/2*y+h*x,_=s-a/2*x+h*y;this.layers["radial-axis-title"]=v.draw(n,c,{propContainer:l,propName:this.id+".radialaxis.title.text",placeholder:z(n,"Click to enter radial axis title"),attributes:{x:b,y:_,"text-anchor":"middle"},transform:{rotate:-m}})}},j.updateAngularAxis=function(t,r){var i,n=this,u=n.gd,c=n.layers,d=n.radius,f=n.innerRadius,p=n.cx,m=n.cy,g=n.getAngular(r),y=n.angularAxis,v=n.isSmith;v||(n.fillViewInitialKey("angularaxis.rotation",g.rotation),y.setGeometry(),y.setScale());var x=v?function(t){var r=P(n,C([0,t.x]));return Math.atan2(r[0]-p,r[1]-m)-Math.PI/2}:function(t){return y.t2g(t.x)};"linear"===y.type&&"radians"===y.thetaunit&&(y.tick0=R(y.tick0),y.dtick=R(y.dtick));var b=function(t){return s(p+d*Math.cos(t),m-d*Math.sin(t))},_=v?function(t){var r=P(n,C([0,t.x]));return s(r[0],r[1])}:function(t){return b(x(t))},w=v?function(t){var r=P(n,C([0,t.x])),i=Math.atan2(r[0]-p,r[1]-m)-Math.PI/2;return s(r[0],r[1])+o(-R(i))}:function(t){var r=x(t);return b(r)+o(-R(r))},T=v?function(t){return I(n,t.x,0,1/0)}:function(t){var r=x(t),i=Math.cos(r),n=Math.sin(r);return"M"+[p+f*i,m-f*n]+"L"+[p+d*i,m-d*n]},A=h.makeLabelFns(y,0).labelStandoff,k={};k.xFn=function(t){return Math.cos(x(t))*A},k.yFn=function(t){var r=x(t),i=Math.sin(r)>0?.2:1;return-Math.sin(r)*(A+t.fontSize*i)+Math.abs(Math.cos(r))*(t.fontSize*M)},k.anchorFn=function(t){var r=Math.cos(x(t));return .1>Math.abs(r)?"middle":r>0?"start":"end"},k.heightFn=function(t,r,i){return -.5*(1+Math.sin(x(t)))*i};var S=N(g);n.angularTickLayout!==S&&(c["angular-axis"].selectAll("."+y._id+"tick").remove(),n.angularTickLayout=S);var E=v?[1/0].concat(y.tickvals||[]).map(function(t){return h.tickText(y,t,!0,!1)}):h.calcTicks(y);if(v&&(E[0].text="∞",E[0].fontSize*=1.75),"linear"===r.gridshape?(i=E.map(x),0>a.angleDelta(i[0],i[1])&&(i=i.slice().reverse())):i=null,n.vangles=i,"category"===y.type&&(E=E.filter(function(t){return a.isAngleInsideSector(x(t),n.sectorInRad)})),y.visible){var D="inside"===y.ticks?-1:1,L=(y.linewidth||1)/2;h.drawTicks(u,y,{vals:E,layer:c["angular-axis"],path:"M"+D*L+",0h"+D*y.ticklen,transFn:w,crisp:!1}),h.drawGrid(u,y,{vals:E,layer:c["angular-grid"],path:T,transFn:a.noop,crisp:!1}),h.drawLabels(u,y,{vals:E,layer:c["angular-axis"],repositionOnUpdate:!0,transFn:_,labelFns:k})}U(c["angular-line"].select("path"),g.showline,{d:n.pathSubplot(),transform:s(p,m)}).attr("stroke-width",g.linewidth).call(l.stroke,g.linecolor)},j.updateFx=function(t,r){this.gd._context.staticPlot||(this.isSmith||(this.updateAngularDrag(t),this.updateRadialDrag(t,r,0),this.updateRadialDrag(t,r,1)),this.updateHoverAndMainDrag(t))},j.updateHoverAndMainDrag=function(t){var r,o,u=this,c=u.isSmith,h=u.gd,d=u.layers,f=t._zoomlayer,p=S.MINZOOM,v=S.OFFEDGE,w=u.radius,T=u.innerRadius,A=u.cx,M=u.cy,k=u.cxx,D=u.cyy,C=u.sectorInRad,I=u.vangles,L=u.radialAxis,P=E.clampTiny,z=E.findXYatLength,F=E.findEnclosingVertexAngles,O=S.cornerHalfWidth,R=S.cornerLen/2,B=m.makeDragger(d,"path","maindrag",!1===t.dragmode?"none":"crosshair");i.select(B).attr("d",u.pathSubplot()).attr("transform",s(A,M)),B.onmousemove=function(t){y.hover(h,t,u.id),h._fullLayout._lasthover=B,h._fullLayout._hoversubplot=u.id},B.onmouseout=function(t){h._dragging||g.unhover(h,t)};var j,N,V,U,q,G,H,$,W,Y={element:B,gd:h,subplot:u.id,plotinfo:{id:u.id,xaxis:u.xaxis,yaxis:u.yaxis},xaxes:[u.xaxis],yaxes:[u.yaxis]};function Z(t,r){return Math.sqrt(t*t+r*r)}function X(t,r){return Math.atan2(D-r,t-k)}function K(t,r){return[t*Math.cos(r),t*Math.sin(-r)]}function J(t,r){if(0===t)return u.pathSector(2*O);var i=R/t,n=r-i,a=r+i,o=Math.max(0,Math.min(t,w)),s=o-O,l=o+O;return"M"+K(s,n)+"A"+[s,s]+" 0,0,0 "+K(s,a)+"L"+K(l,a)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function Q(t,r,i){if(0===t)return u.pathSector(2*O);var n,a,o,s,l=K(t,r),c=K(t,i),h=P((l[0]+c[0])/2),d=P((l[1]+c[1])/2);if(h&&d){var f=d/h,p=-1/f,m=z(O,f,h,d);o=z(R,p,m[0][0],m[0][1]),s=z(R,p,m[1][0],m[1][1])}else d?(n=R,a=O):(n=O,a=R),o=[[h-n,d-a],[h+n,d-a]],s=[[h-n,d+a],[h+n,d+a]];return"M"+o.join("L")+"L"+s.reverse().join("L")+"Z"}function ee(t,r){return r=Math.max(Math.min(r,w),T),tp?(t-1&&1===t&&b(r,h,[u.xaxis],[u.yaxis],u.id,Y),i.indexOf("event")>-1&&y.click(h,r,u.id)}Y.prepFn=function(t,i,n){var s,d=h._fullLayout.dragmode,p=B.getBoundingClientRect();h._fullLayout._calcInverseTransform(h);var g=h._fullLayout._invTransform;r=h._fullLayout._invScaleX,o=h._fullLayout._invScaleY;var y=a.apply3DTransform(g)(i-p.left,n-p.top);if(j=y[0],N=y[1],I){var v=E.findPolygonOffset(w,C[0],C[1],I);j+=k+v[0],N+=D+v[1]}switch(d){case"zoom":Y.clickFn=es,c||(I?Y.moveFn=en:Y.moveFn=er,Y.doneFn=ea,V=null,U=null,q=u.pathSubplot(),G=!1,s=h._fullLayout[u.id],H=l.luminosity(s.bgcolor),($=m.makeZoombox(f,H,A,M,q)).attr("fill-rule","evenodd"),W=m.makeCorners(f,A,M),_(h));break;case"select":case"lasso":x(t,i,n,Y,d)}},g.init(Y)},j.updateRadialDrag=function(t,r,l){var u,c,h,d=this,f=d.gd,p=d.layers,y=d.radius,v=d.innerRadius,x=d.cx,b=d.cy,w=d.radialAxis,M=S.radialDragBoxSize,k=M/2;if(w.visible){var E,D,C,I=O(d.radialAxisAngle),L=w._rl,P=L[0],z=L[1],F=L[l],B=.75*(L[1]-L[0])/(1-d.getHole(r))/y;l?(E=x+(y+k)*Math.cos(I),D=b-(y+k)*Math.sin(I),C="radialdrag"):(E=x+(v-k)*Math.cos(I),D=b-(v-k)*Math.sin(I),C="radialdrag-inner");var j=m.makeRectDragger(p,C,"crosshair",-k,-k,M,M),N={element:j,gd:f};!1===t.dragmode&&(N.dragmode=!1),U(i.select(j),w.visible&&v0!=(l?h>P:h")}}r.exports={hoverPoints:function(t,r,a,o){var s=i(t,r,a,o);if(!(!s||!1===s[0].index)){var l=s[0];if(void 0===l.index)return s;var u=t.subplot,c=l.cd[l.index],h=l.trace;if(u.isPtInside(c))return l.xLabelVal=void 0,l.yLabelVal=void 0,n(c,h,u,l),l.hovertemplate=h.hovertemplate,s}},makeHoverPointText:n}}}),Us=g({"src/traces/scatterpolar/index.js"(t,r){r.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:Ue(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Ut(),supplyDefaults:Ur().supplyDefaults,colorbar:ni(),formatLabels:Ui(),calc:Un(),plot:Ua(),style:na().style,styleOnSelect:na().styleOnSelect,hoverPoints:Uo().hoverPoints,selectPoints:nl(),meta:{}}}}),Ul=g({"lib/scatterpolar.js"(t,r){r.exports=Us()}}),Uu=g({"src/traces/scatterpolargl/attributes.js"(t,r){var i=Ut(),{cliponaxis:n,hoveron:a}=i,o=((t,r)=>{var i={};for(var n in t)u.call(t,n)&&0>r.indexOf(n)&&(i[n]=t[n]);if(null!=t&&s)for(var n of s(t))0>r.indexOf(n)&&c.call(t,n)&&(i[n]=t[n]);return i})(i,["cliponaxis","hoveron"]),{connectgaps:l,line:{color:h,dash:d,width:m},fill:g,fillcolor:y,marker:v,textfont:x,textposition:b}=p2();r.exports=p(f({},o),{connectgaps:l,fill:g,fillcolor:y,line:{color:h,dash:d,editType:"calc",width:m},marker:v,textfont:x,textposition:b})}}),Uc=g({"src/traces/scatterpolargl/defaults.js"(t,r){var i=t_(),n=t8(),a=Ur().handleRThetaDefaults,o=i$(),s=iW(),l=iZ(),u=iX(),c=ib().PTS_LINESONLY,h=Uu();r.exports=function(t,r,d,f){function p(n,a){return i.coerce(t,r,h,n,a)}var m=a(t,r,f,p);if(!m){r.visible=!1;return}p("thetaunit"),p("mode",m=u&&(x.marker.cluster=m.tree),x.marker&&(x.markerSel.positions=x.markerUnsel.positions=x.marker.positions=w),x.line&&w.length>1&&l.extendFlat(x.line,s.linePositions(t,p,w)),x.text&&(l.extendFlat(x.text,{positions:w},s.textPosition(t,p,x.text,x.marker)),l.extendFlat(x.textSel,{positions:w},s.textPosition(t,p,x.text,x.markerSel)),l.extendFlat(x.textUnsel,{positions:w},s.textPosition(t,p,x.text,x.markerUnsel))),x.fill&&!f.fill2d&&(f.fill2d=!0),x.marker&&!f.scatter2d&&(f.scatter2d=!0),x.line&&!f.line2d&&(f.line2d=!0),x.text&&!f.glText&&(f.glText=!0),f.lineOptions.push(x.line),f.fillOptions.push(x.fill),f.markerOptions.push(x.marker),f.markerSelectedOptions.push(x.markerSel),f.markerUnselectedOptions.push(x.markerUnsel),f.textOptions.push(x.text),f.textSelectedOptions.push(x.textSel),f.textUnselectedOptions.push(x.textUnsel),f.selectBatch.push([]),f.unselectBatch.push([]),m.x=T,m.y=A,m.rawx=T,m.rawy=A,m.r=y,m.theta=v,m.positions=w,m._scene=f,m.index=f.count,f.count++}}),a(t,r,c)}},r.exports.reglPrecompiled={}}}),Ug=g({"src/traces/scatterpolargl/index.js"(t,r){var i=Up();i.plot=Um(),r.exports=i}}),Uy=g({"lib/scatterpolargl.js"(t,r){r.exports=Ug()}}),Uv=g({"src/traces/barpolar/attributes.js"(t,r){var i,{hovertemplateAttrs:n,templatefallbackAttrs:a}=eZ(),o=$().extendFlat,s=Ut(),l=aA();r.exports={r:s.r,theta:s.theta,r0:s.r0,dr:s.dr,theta0:s.theta0,dtheta:s.dtheta,thetaunit:s.thetaunit,base:o({},l.base,{}),offset:o({},l.offset,{}),width:o({},l.width,{}),text:o({},l.text,{}),hovertext:o({},l.hovertext,{}),marker:(i=o({},l.marker),delete i.cornerradius,i),hoverinfo:s.hoverinfo,hovertemplate:n(),hovertemplatefallback:a(),selected:l.selected,unselected:l.unselected}}}),Ux=g({"src/traces/barpolar/layout_attributes.js"(t,r){r.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),Ub=g({"src/traces/barpolar/defaults.js"(t,r){var i=t_(),n=Ur().handleRThetaDefaults,a=ak(),o=Uv();r.exports=function(t,r,s,l){function u(n,a){return i.coerce(t,r,o,n,a)}if(!n(t,r,l,u)){r.visible=!1;return}u("thetaunit"),u("base"),u("offset"),u("width"),u("text"),u("hovertext"),u("hovertemplate"),u("hovertemplatefallback"),a(t,r,u,s,l),i.coerceSelectionMarkerOpacity(r,u)}}}),U_=g({"src/traces/barpolar/layout_defaults.js"(t,r){var i=t_(),n=Ux();r.exports=function(t,r,a){var o,s={};function l(a,s){return i.coerce(t[o]||{},r[o],n,a,s)}for(var u=0;u0?(o=i,l=n):(o=n,l=i);var o,l,d=s.findEnclosingVertexAngles(o,u.vangles)[0],f=s.findEnclosingVertexAngles(l,u.vangles)[1],p=[d,(o+l)/2,f];return s.pathPolygonAnnulus(t,r,o,l,p,c,h)}:function(t,r,i,n){return a.pathAnnulus(t,r,i,n,c,h)}),v=r.layers.frontplot.select("g.barlayer");a.makeTraceGroups(v,l,"trace bars").each(function(){var s=i.select(this),l=a.ensureSingle(s,"g","points").selectAll("g.point").data(a.identity);l.enter().append("g").style("vector-effect",d?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),l.exit().remove(),l.each(function(t){var r,o=i.select(this),s=t.rp0=m.c2p(t.s0),l=t.rp1=m.c2p(t.s1),u=t.thetag0=g.c2g(t.p0),c=t.thetag1=g.c2g(t.p1);if(n(s)&&n(l)&&n(u)&&n(c)&&s!==l&&u!==c){var h=m.c2g(t.s1),d=(u+c)/2;t.ct=[f.c2p(h*Math.cos(d)),p.c2p(h*Math.sin(d))],r=y(s,l,u,c)}else r="M0,0Z";a.ensureSingle(o,"path").attr("d",r)}),o.setClipUrl(s,r._hasClipOnAxisFalse?r.clipIds.forTraces:null,t)})}}}),UA=g({"src/traces/barpolar/hover.js"(t,r){var i=rR(),n=t_(),a=aF().getTraceColor,o=n.fillText,s=Uo().makeHoverPointText,l=V4().isPtInsidePolygon;r.exports=function(t,r,u){var c=t.cd,h=c[0].trace,d=t.subplot,f=d.radialAxis,p=d.angularAxis,m=d.vangles,g=m?l:n.isPtInsideSector,y=t.maxHoverDistance,v=p._period||2*Math.PI,x=Math.abs(f.g2p(Math.sqrt(r*r+u*u))),b=Math.atan2(u,r);if(f.range[0]>f.range[1]&&(b+=Math.PI),i.getClosest(c,function(t){return g(x,b,[t.rp0,t.rp1],[t.thetag0,t.thetag1],m)?y+Math.min(1,Math.abs(t.thetag1-t.thetag0)/v)-1+(t.rp1-x)/(t.rp1-t.rp0)-1:1/0},t),!1!==t.index){var _=c[t.index];t.x0=t.x1=_.ct[0],t.y0=t.y1=_.ct[1];var w=n.extendFlat({},_,{r:_.s,theta:_.p});return o(_,h,t),s(w,h,d,t),t.hovertemplate=h.hovertemplate,t.color=a(h,_),t.xLabelVal=t.yLabelVal=void 0,_.s<0&&(t.idealAlign="left"),[t]}}}}),UM=g({"src/traces/barpolar/index.js"(t,r){r.exports={moduleType:"trace",name:"barpolar",basePlotModule:Ue(),categories:["polar","bar","showLegend"],attributes:Uv(),layoutAttributes:Ux(),supplyDefaults:Ub(),supplyLayoutDefaults:U_(),calc:Uw().calc,crossTraceCalc:Uw().crossTraceCalc,plot:UT(),colorbar:ni(),formatLabels:Ui(),style:aP().style,styleOnSelect:aP().styleOnSelect,hoverPoints:UA(),selectPoints:aR(),meta:{}}}}),Uk=g({"lib/barpolar.js"(t,r){r.exports=UM()}}),US=g({"src/plots/smith/constants.js"(t,r){r.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),UE=g({"src/plots/smith/layout_attributes.js"(t,r){var i=er(),n=tq(),a=an().attributes,o=t_().extendFlat,s=e$().overrideAll,l=s({color:n.color,showline:o({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:o({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),u=s({ticklen:n.ticklen,tickwidth:o({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),c=o({visible:o({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:o({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},l,u),h=o({visible:o({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},l,u);r.exports={domain:a({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:i.background},realaxis:c,imaginaryaxis:h,editType:"calc"}}}),UD=g({"src/plots/smith/layout_defaults.js"(t,r){var i,n,a,o=t_(),s=ei(),l=tC(),u=sr(),c=tF().getSubplotData,h=t0(),d=tQ(),f=nd(),p=rn(),m=UE(),g=US(),y=g.axisNames,v=(i=function(t){return o.isTypedArray(t)&&(t=Array.from(t)),t.slice().reverse().map(function(t){return-t}).concat([0]).concat(t)},n=String,a={},function(t){var r=n?n(t):t;if(r in a)return a[r];var o=i(t);return a[r]=o,o});function x(t,r,i,n){var a=i("bgcolor");n.bgColor=s.combine(a,n.paper_bgcolor);var u,x=c(n.fullData,g.name,n.id),b=n.layoutOut;function _(t,r){return i(u+"."+t,r)}for(var w=0;w")}}r.exports={hoverPoints:function(t,r,a,o){var s=i(t,r,a,o);if(!(!s||!1===s[0].index)){var l=s[0];if(void 0===l.index)return s;var u=t.subplot,c=l.cd[l.index],h=l.trace;if(u.isPtInside(c))return l.xLabelVal=void 0,l.yLabelVal=void 0,n(c,h,u,l),l.hovertemplate=h.hovertemplate,s}},makeHoverPointText:n}}}),UR=g({"src/traces/scattersmith/index.js"(t,r){r.exports={moduleType:"trace",name:"scattersmith",basePlotModule:UC(),categories:["smith","symbols","showLegend","scatter-like"],attributes:UI(),supplyDefaults:UL(),colorbar:ni(),formatLabels:UP(),calc:Uz(),plot:UF(),style:na().style,styleOnSelect:na().styleOnSelect,hoverPoints:UO().hoverPoints,selectPoints:nl(),meta:{}}}}),UB=g({"lib/scattersmith.js"(t,r){r.exports=UR()}}),Uj=g({"src/traces/quiver/attributes.js"(t,r){var i=K(),n=eZ().hovertemplateAttrs,a=tU().axisHoverFormat,o=$().extendFlat,s=tH(),l=eW().dash,u=ix(),c=iw();r.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:c.x0,dx:c.dx,y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:c.y0,dy:c.dy,u:{valType:"data_array",editType:"calc",anim:!0},v:{valType:"data_array",editType:"calc",anim:!0},arrowref:{valType:"enumerated",values:["paper","data"],dflt:"data",editType:"calc"},lengthmode:{valType:"enumerated",values:["scaled","raw"],editType:"calc",dflt:"scaled"},lengthfactor:{valType:"number",min:0,editType:"calc",dflt:1},anchor:{valType:"enumerated",values:["tip","tail","center"],dflt:"tail",editType:"calc"},xhoverformat:a("x"),yhoverformat:a("y"),uhoverformat:a("u","noDate"),vhoverformat:a("v","noDate"),hoverinfo:o({},i.hoverinfo,{flags:["x","y","u","v","text","name"],dflt:"all"}),hovertemplate:n({},{keys:["x","y","u","v","text","name"]}),text:c.text,textposition:c.textposition,textfont:c.textfont,marker:o({arrowsize:o({},u.arrowsize,{editType:"calc"}),line:{width:{valType:"number",min:0,dflt:2,editType:"style"},dash:l,editType:"style"},editType:"calc"},s("marker",{showScaleDflt:!0,editTypeOverride:"calc"})),selected:{marker:{color:{valType:"color",editType:"style"},line:{width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{color:{valType:"color",editType:"style"},line:{width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"}}}}),UN=g({"src/traces/quiver/defaults.js"(t,r){var i=t_(),n=Uj(),a=iq(),o=tV().hasColorscale,s=t2();r.exports=function(t,r,l,u){function c(a,o){return i.coerce(t,r,n,a,o)}var h=a(t,r,u,c);if(!h){r.visible=!1;return}var d=c("u"),f=c("v");if(!i.isArrayOrTypedArray(d)||0===d.length){r.u=Array(h);for(var p=0;pD&&(D=h[R]),d[R]I&&(I=d[R]),BP&&(P=B),jF&&(F=j);var q=Math.sqrt(B*B+j*j);if(q>g&&(g=q),qv&&(v=G))}}else N.x=o,N.y=o}if(r._maxNorm=g,"scaled"===A||"paper"===M){let t=D-E,i=I-C;r._scaleFactor=(0===t&&0===i?1:(t+i+Math.sqrt((t-i)*(t-i)+4*O*t*i))/(2*(O-1)))*.97/r._maxNorm}else r._scaleFactor=1;r._scaleFactor*=r.lengthfactor;let H=Array(f),$=Array(f),W=Array(f),Y=Array(f);for(var Z,X,K,R=0;Rt.i&&isFinite(s[t.i]))o=s[t.i];else{var l=r.u&&r.u[t.i]||0,u=r.v&&r.v[t.i]||0;o=Math.sqrt(l*l+u*u)}return t.mcc=a(o),t.mcc})}function u(t,r,o){var u=r[0].trace,c=u.marker||{},h=c.line||{},d=n.isArrayOrTypedArray(c.color)?void 0:c.color,f=u._hasColorscale;if(o)if(u.selectedpoints){var p=(u.selected||{}).marker||{},m=(u.unselected||{}).marker||{},g=p.line||{},y=m.line||{};o.selectAll("path.js-line").each(function(t){var r=i.select(this),n=!t.selected,o=n?m.color:p.color,c=n?void 0!==y.width?y.width:h.width:void 0!==g.width?g.width:h.width;o?(a.lineGroupStyle(r,c,o,h.dash),r.style("stroke-opacity",1)):(a.lineGroupStyle(r,c,d,h.dash),f&&l(r,u),r.style("stroke-opacity",n?s:1))}),a.selectedTextStyle(o.selectAll("text"),u)}else{var v=o.selectAll("path.js-line");v.call(a.lineGroupStyle,h.width,d,h.dash),f&&l(v,u),v.style("stroke-opacity",1),a.textPointStyle(o.selectAll("text"),u,t)}}r.exports={style:function(t){i.select(t).selectAll("g.trace.quiver").each(function(r){u(t,r,i.select(this))})},styleOnSelect:function(t,r,i){u(t,r,i)},colorscaleStroke:l}}}),UG=g({"src/traces/quiver/plot.js"(t,r){var i=k(),n=t_(),a=rr(),o=Uq().colorscaleStroke,s=Math.PI/12;function l(t,r,l,u,c,h,d){var f=u[0].trace,p=l.xaxis,m=l.yaxis;u[0][l.isRangePlot?"nodeRangePlot3":"node3"]=i.select(h);var g=i.select(h).selectAll("g.lines").data([u]);g.enter().append("g").classed("lines",!0),a.setClipUrl(g,l.layerClipId,t);var y=g.selectAll("path.js-line").data(u);y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke"),y.exit().remove();let{anchor:v,maxNorm:x=0,arrowref:b}=f,_="paper"===b?f._scaleFactor*Math.sqrt(Math.abs(p._m*m._m)):f._scaleFactor,w=f.marker.arrowsize;y.each(function(t){let r=i.select(this);if(void 0===t.x||void 0===t.y)return void r.attr("d",null);let n=("paper"===b?t._u*Math.sign(p._m):i.round(p._m*t._u))*_,a=("paper"===b?t._v*Math.sign(m._m):i.round(m._m*t._v))*_,o=void 0!==(f._input.marker||{}).arrowsize;"tip"===v?(l=p.c2p(t.x)-n,c=m.c2p(t.y)-a,u=p.c2p(t.x),h=m.c2p(t.y)):"center"===v?(l=p.c2p(t.x)-n/2,c=m.c2p(t.y)-a/2,u=p.c2p(t.x)+n/2,h=m.c2p(t.y)+a/2):(l=p.c2p(t.x),c=m.c2p(t.y),u=p.c2p(t.x)+n,h=m.c2p(t.y)+a),t._px0=l,t._py0=c,t._px1=u,t._py1=h;var l,u,c,h,d=f.marker.line.width;o||(d=Math.max(d,1.5));let g=Math.min(5.8*w*d,.7*Math.sqrt((u-l)*(u-l)+(h-c)*(h-c))),y=Math.atan2(h-c,u-l),x=u-g*Math.cos(y-s),T=h-g*Math.sin(y-s),A=u-g*Math.cos(y+s),M=h-g*Math.sin(y+s),k="M"+l+","+c+"L"+u+","+h+"L"+x+","+T+"L"+u+","+h+"L"+A+","+M;r.attr("d",k)});var T=f.marker||{},A=T.line||{},M=n.isArrayOrTypedArray(T.color)?void 0:T.color;a.lineGroupStyle(y,A.width,M,A.dash),f._hasColorscale&&o(y,f);var k=i.select(h).selectAll("g.text").data([u]);k.enter().append("g").classed("text",!0),a.setClipUrl(k,l.layerClipId,t);var S=k.selectAll("g.textpoint").data(u);if(S.enter().append("g").classed("textpoint",!0).append("text"),S.exit().remove(),S.each(function(t){var r=i.select(this);a.translatePoint(t,r.select("text"),p,m)||r.remove()}),S.selectAll("text").call(a.textPointStyle,f,t).each(function(t){var r=p.c2p(t.x),n=m.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){i.select(this).attr({x:r,y:n})})}),d&&d.duration>0){var E=i.transition().duration(d.duration).ease(d.easing);y.transition(E).style("opacity",1)}}r.exports=function(t,r,n,a,o,s){var u,c,h=!o,d=!!o&&o.duration>0;((u=a.selectAll("g.trace").data(n,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace quiver trace"+t[0].trace.uid}).style("stroke-miterlimit",2),u.order(),d)?(s&&(c=s()),i.transition().duration(o.duration).ease(o.easing).each("end",function(){c&&c()}).each("interrupt",function(){c&&c()}).each(function(){a.selectAll("g.trace").each(function(i,a){l(t,a,r,i,n,this,o)})})):u.each(function(i,a){l(t,a,r,i,n,this,o)}),h&&u.exit().remove()}}}),UH=g({"src/traces/quiver/hover.js"(t,r){var i=t_(),n=rR(),a=no();r.exports=function(t,r,o,s){var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,d=c.c2p(r),f=h.c2p(o);if(n.getClosest(l,function(t){return void 0===t._px0?1/0:function(t,r,i,n,a,o){let s=a-i,l=o-n,u=s*s+l*l;if(!u)return Math.sqrt((t-i)*(t-i)+(r-n)*(r-n));var c=((t-i)*s+(r-n)*l)/u;let h=i+(c=Math.max(0,Math.min(1,c)))*s,d=n+c*l;return Math.sqrt((t-h)*(t-h)+(r-d)*(r-d))}(d,f,t._px0,t._py0,t._px1,t._py1)},t),!1!==t.index){var p=l[t.index],m=c.c2p(p.x,!0),g=h.c2p(p.y,!0),y=Math.sqrt((d-m)*(d-m)+(f-g)*(f-g));t.index=p.i;var v=u.u?u.u[p.i]:0,x=u.v?u.v[p.i]:0;return i.extendFlat(t,{color:a(u,p),x0:m-3,x1:m+3,xLabelVal:p.x,y0:g-3,y1:g+3,yLabelVal:p.y,uLabelVal:v,vLabelVal:x,extraText:"u: "+v+", v: "+x,spikeDistance:y,hovertemplate:u.hovertemplate}),i.fillText(p,u,t),[t]}}}}),U$=g({"src/traces/quiver/format_labels.js"(t,r){var i=rs(),n=t_();r.exports=function(t,r,a){var o={},s={_fullLayout:a},l=i.getFromTrace(s,r,"x"),u=i.getFromTrace(s,r,"y"),c=t.x,h=t.y;o.xLabel=i.tickText(l,l.c2l(c),!0).text,o.yLabel=i.tickText(u,u.c2l(h),!0).text;var d=r.u?r.u[t.i]:0,f=r.v?r.v[t.i]:0,p=r.uhoverformat,m=r.vhoverformat;return o.uLabel=p?n.numberFormat(p)(d):String(d),o.vLabel=m?n.numberFormat(m)(f):String(f),o}}}),UW=g({"src/traces/quiver/event_data.js"(t,r){r.exports=function(t,r,i,n,a){return t.x=r.x,t.y=r.y,t.u=i.u?i.u[a]:void 0,t.v=i.v?i.v[a]:void 0,t}}}),UY=g({"src/traces/quiver/index.js"(t,r){r.exports={moduleType:"trace",name:"quiver",basePlotModule:ny(),categories:["cartesian","svg","showLegend","scatter-like","zoomScale"],attributes:Uj(),supplyDefaults:UN(),calc:UV(),crossTraceCalc:UU(),plot:UG(),style:Uq().style,styleOnSelect:Uq().styleOnSelect,hoverPoints:UH(),formatLabels:U$(),eventData:UW(),selectPoints:nl(),colorbar:ni(),animatable:!0,meta:{}}}}),UZ=g({"lib/quiver.js"(t,r){r.exports=UY()}}),UX=g({"node_modules/world-calendars/dist/main.js"(t,r){var i=mB();function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,r,i,n){if(this._calendar=t,this._year=r,this._month=i,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,r){return t=""+t,"000000".substring(0,r-t.length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}i(n.prototype,{instance:function(t,r){t=(t||"gregorian").toLowerCase(),r=r||"";var i=this._localCals[t+"-"+r];if(!i&&this.calendars[t]&&(i=new this.calendars[t](r),this._localCals[t+"-"+r]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return i},newDate:function(t,r,i,n,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(t,r,i)},substituteDigits:function(t){return function(r){return(r+"").replace(/[0-9]/g,function(r){return t[r]})}},substituteChineseDigits:function(t,r){return function(i){for(var n="",a=0;i>0;){var o=i%10;n=(0===o?"":t[o]+r[a])+n,a++,i=Math.floor(i/10)}return 0===n.indexOf(t[1]+r[1])&&(n=n.substr(1)),n||t[0]}}}),i(a.prototype,{newDate:function(t,r,i){return this._calendar.newDate(t??this,r,i)},year:function(t){return 0==arguments.length?this._year:this.set(t,"y")},month:function(t){return 0==arguments.length?this._month:this.set(t,"m")},day:function(t){return 0==arguments.length?this._day:this.set(t,"d")},date:function(t,r,i){if(!this._calendar.isValid(t,r,i))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=r,this._day=i,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,r){return this._calendar.add(this,t,r)},set:function(t,r){return this._calendar.set(this,t,r)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var r=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===r?0:r<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(0>this.year()?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),i(s.prototype,{_validateLevel:0,newDate:function(t,r,i){return null==t?this.today():(t.year&&(this._validate(t,r,i,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=t.day(),r=t.month(),t=t.year()),new a(this,t,r,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return 0>this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(0>r.year()?"-":"")+o(Math.abs(r.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,r){var i=this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(t,r){var i=(r+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,i,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),i},daysInYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(r)?366:365},dayOfYear:function(t,r,i){var n=this._validate(t,r,i,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,r,i){var n=this._validate(t,r,i,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,r,i){return this._validate(t,r,i,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,r,i){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,r,i),r,i)},_add:function(t,r,i){if(this._validateLevel++,"d"===i||"w"===i){var n=t.toJD()+r*("w"===i?this.daysInWeek():1),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var o=t.year()+("y"===i?r:0),s=t.monthOfYear()+("m"===i?r:0),a=t.day();"y"===i?(t.month()!==this.fromMonthOfYear(o,s)&&(s=this.newDate(o,t.month(),this.minDay).monthOfYear()),s=Math.min(s,this.monthsInYear(o)),a=Math.min(a,this.daysInMonth(o,this.fromMonthOfYear(o,s)))):"m"===i&&(function(t){for(;sr-1+t.minMonth;)o++,s-=r,r=t.monthsInYear(o)}(this),a=Math.min(a,this.daysInMonth(o,this.fromMonthOfYear(o,s))));var l=[o,this.fromMonthOfYear(o,s),a];return this._validateLevel--,l}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,r,i,n){if(!this.hasYearZero&&("y"===n||"m"===n)&&(0===r[0]||t.year()>0!=r[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n];r=this._add(t,i*a[0]+(i<0?-1:1)*a[1],a[2])}return t.date(r[0],r[1],r[2])},set:function(t,r,i){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===i?r:t.year(),a="m"===i?r:t.month(),o="d"===i?r:t.day();return("y"===i||"m"===i)&&(o=Math.min(o,this.daysInMonth(n,a))),t.date(n,a,o)},isValid:function(t,r,i){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,r,this.minDay);n=r>=this.minMonth&&r-this.minMonth=this.minDay&&i-this.minDayr.year());return t%4==0&&(t%100!=0||t%400==0)},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var i=this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return this.daysPerMonth[i.month()-1]+(2===i.month()&&this.leapYear(i.year())?1:0)},weekDay:function(t,r,i){return 6>(this.dayOfWeek(t,r,i)||7)},toJD:function(t,r,i){var n=this._validate(t,r,i,u.local.invalidDate||u.regionalOptions[""].invalidDate);t=n.year(),r=n.month(),i=n.day(),t<0&&t++,r<3&&(r+=12,t--);var a=Math.floor(t/100);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(r+1))+i+(2-a+Math.floor(a/4))-1524.5},fromJD:function(t){var r=Math.floor(t+.5),i=Math.floor((r-1867216.25)/36524.25),n=(i=r+1+i-Math.floor(i/4))+1524,a=Math.floor((n-122.1)/365.25),o=Math.floor(365.25*a),s=Math.floor((n-o)/30.6001),l=n-o-Math.floor(30.6001*s),u=s-(s>13.5?13:1),c=a-(u>2.5?4716:4715);return c<=0&&c--,this.newDate(c,u,l)},toJSDate:function(t,r,i){var n=this._validate(t,r,i,u.local.invalidDate||u.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=r.exports=new n;u.cdate=a,u.baseCalendar=s,u.calendars.gregorian=l}}),UK=g({"node_modules/world-calendars/dist/plus.js"(){var t=mB(),r=UX();t(r.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),r.local=r.regionalOptions[""],t(r.cdate.prototype,{formatDate:function(t,r){return"string"!=typeof t&&(r=t,t=""),this._calendar.formatDate(t||"",this,r)}}),t(r.baseCalendar.prototype,{UNIX_EPOCH:r.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:r.instance().jdEpoch,TICKS_PER_DAY:86400*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,i,n){if("string"!=typeof t&&(n=i,i=t,t=""),!i)return"";if(i.calendar()!==this)throw r.local.invalidFormat||r.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat,n=n||{};for(var a,o,s,l=n.dayNamesShort||this.local.dayNamesShort,u=n.dayNames||this.local.dayNames,c=n.monthNumbers||this.local.monthNumbers,h=n.monthNamesShort||this.local.monthNamesShort,d=n.monthNames||this.local.monthNames,f=(n.calculateWeek||this.local.calculateWeek,function(r,i){for(var n=1;x+n1}),p=function(t,r,i,n){var a=""+r;if(f(t,n))for(;a.length1},b=function(t,n){var a=x(t,n),o=RegExp("^-?\\d{1,"+[2,3,a?4:2,a?4:2,10,11,20]["oyYJ@!".indexOf(t)+1]+"}"),s=i.substring(A).match(o);if(!s)throw(r.local.missingNumberAt||r.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},_=this,w=function(t,n,a,o){for(var s=x(t,o)?a:n,l=0;l-1){p=1,m=g;for(var S=this.daysInMonth(f,p);m>S;S=this.daysInMonth(f,p))p++,m-=S}return d>-1?this.fromJD(d):this.newDate(f,p,m)},determineDate:function(t,r,i,n,a){i&&"object"!=typeof i&&(a=n,n=i,i=null),"string"!=typeof n&&(a=n,n="");var o=this;return r=r?r.newDate():null,t=null==t?r:"string"==typeof t?function(t){try{return o.parseDate(n,t,a)}catch{}t=t.toLowerCase();for(var r=(t.match(/^c/)&&i?i.newDate():null)||o.today(),s=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=s.exec(t);l;)r.add(parseInt(l[1],10),l[2]||"d"),l=s.exec(t);return r}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?r:o.today().add(t,"d"):o.newDate(t)}})}}),UJ=g({"node_modules/world-calendars/dist/calendars/chinese.js"(){var t=UX(),r=mB(),i=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,r(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,r){if("string"==typeof t){var i=t.match(o);return i?i[0]:""}var n=this._validateYear(t),a=t.month(),s=""+this.toChineseMonth(n,a);return r&&s.length<2&&(s="0"+s),this.isIntercalaryMonth(n,a)&&(s+="i"),s},monthNames:function(t){if("string"==typeof t){var r=t.match(s);return r?r[0]:""}var i=this._validateYear(t),n=t.month(),a=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(i,n)-1];return this.isIntercalaryMonth(i,n)&&(a="闰"+a),a},monthNamesShort:function(t){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var i=this._validateYear(t),n=t.month(),a=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(i,n)-1];return this.isIntercalaryMonth(i,n)&&(a="闰"+a),a},parseMonth:function(t,r){t=this._validateYear(t);var i,n=parseInt(r);if(isNaN(n))"闰"===r[0]&&(i=!0,r=r.substring(1)),"月"===r[r.length-1]&&(r=r.substring(0,r.length-1)),n=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(r);else{var a=r[r.length-1];i="i"===a||"I"===a}return this.toMonthIndex(t,n,i)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,r){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw r.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(r,i,n){var a=this.intercalaryMonth(r);if(n&&i!==a||i<1||i>12)throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!n&&i<=a?i-1:i:i-1},toChineseMonth:function(r,i){r.year&&(i=(r=r.year()).month());var n=this.intercalaryMonth(r);if(i<0||i>(n?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?i>13},isIntercalaryMonth:function(t,r){t.year&&(r=(t=t.year()).month());var i=this.intercalaryMonth(t);return!!i&&i===r},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(r,n,a){var o,s=c[this._validateYear(r,t.local.invalidyear)-c[0]];return(o=i.newDate(s>>9&4095,s>>5&15,31&s)).add(4-(o.dayOfWeek()||7),"d"),1+Math.floor((this.toJD(r,n,a)-o.toJD())/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(r,i){r.year&&(i=r.month(),r=r.year());var n=u[(r=this._validateYear(r))-u[0]];if(i>(n>>13?12:11))throw t.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-i?30:29},weekDay:function(t,r,i){return 6>(this.dayOfWeek(t,r,i)||7)},toJD:function(r,n,a){var o=this._validate(r,l,a,t.local.invalidDate);r=this._validateYear(o.year()),n=o.month(),a=o.day();var s=this.isIntercalaryMonth(r,n),l=this.toChineseMonth(r,n),h=function(t,r,i,n){if("object"==typeof t)o=t,a=r||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw Error("Lunar year outside range 1888-2111");if(!("number"==typeof r&&r>=1&&r<=12))throw Error("Lunar month outside range 1 - 12");if(!("number"==typeof i&&i>=1&&i<=30))throw Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,a=n):(s=!!n,a={}),o={year:t,month:r,day:i,isIntercalary:s}}var a,o,s,l,h=o.day-1,d=u[o.year-u[0]],f=d>>13;l=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(m>>5&15)-1,(31&m)+h);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(r,l,a,s);return i.toJD(h.year,h.month,h.day)},fromJD:function(t){var r=i.fromJD(t),n=function(t,r,i){if("object"==typeof t)o=t,s=r||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw Error("Solar year outside range 1888-2111");if(!("number"==typeof r&&r>=1&&r<=12))throw Error("Solar month outside range 1 - 12");if(!("number"==typeof i&&i>=1&&i<=31))throw Error("Solar day outside range 1 - 31");o={year:t,month:r,day:i},s={}}var n=c[o.year-c[0]],a=o.year<<9|o.month<<5|o.day;s.year=a>=n?o.year:o.year-1;var o,s,l,h=new Date((n=c[s.year-c[0]])>>9&4095,(n>>5&15)-1,31&n);l=Math.round((new Date(o.year,o.month-1,o.day)-h)/864e5);var d,f=u[s.year-u[0]];for(d=0;d<13;d++){var p=f&1<<12-d?30:29;if(l>13;return!m||di.year());return r%4==3||r%4==-1},monthsInYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,r,i){return 6>(this.dayOfWeek(t,r,i)||7)},toJD:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);return(r=a.year())<0&&r++,a.day()+(a.month()-1)*30+(r-1)*365+Math.floor(r/4)+this.jdEpoch-1},fromJD:function(t){var r=Math.floor(t)+.5-this.jdEpoch,i=Math.floor((r-Math.floor((r+366)/1461))/365)+1;i<=0&&i--;var n=Math.floor((r=Math.floor(t)+.5-this.newDate(i,1,1).toJD())/30)+1,a=r-(n-1)*30+1;return this.newDate(i,n,a)}}),t.calendars.coptic=i}}),U0=g({"node_modules/world-calendars/dist/calendars/discworld.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new t.baseCalendar,r(i.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),!1},monthsInYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),13},daysInYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),400},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(r,i,n){return(this._validate(r,i,n,t.local.invalidDate).day()+1)%8},weekDay:function(t,r,i){var n=this.dayOfWeek(t,r,i);return n>=2&&n<=6},extraInfo:function(r,i,a){return{century:n[Math.floor((this._validate(r,i,a,t.local.invalidDate).year()-1)/100)+1]||""}},toJD:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);return r=a.year()+ +(0>a.year()),i=a.month(),(n=a.day())+16*(i>1)+(i>2?(i-2)*32:0)+(r-1)*400+this.jdEpoch-1},fromJD:function(t){var r=Math.floor((t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1)/400)+1;t-=(r-1)*400;var i=Math.floor((t+=16*(t>15))/32)+1,n=t-(i-1)*32+1;return this.newDate(r<=0?r-1:r,i,n)}});var n={20:"Fruitbat",21:"Anchovy"};t.calendars.discworld=i}}),U1=g({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new t.baseCalendar,r(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var i=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),r=i.year()+ +(0>i.year());return r%4==3||r%4==-1},monthsInYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear),13},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,r,i){return 6>(this.dayOfWeek(t,r,i)||7)},toJD:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);return(r=a.year())<0&&r++,a.day()+(a.month()-1)*30+(r-1)*365+Math.floor(r/4)+this.jdEpoch-1},fromJD:function(t){var r=Math.floor(t)+.5-this.jdEpoch,i=Math.floor((r-Math.floor((r+366)/1461))/365)+1;i<=0&&i--;var n=Math.floor((r=Math.floor(t)+.5-this.newDate(i,1,1).toJD())/30)+1,a=r-(n-1)*30+1;return this.newDate(i,n,a)}}),t.calendars.ethiopian=i}}),U2=g({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,r){return t-r*Math.floor(t/r)}i.prototype=new t.baseCalendar,r(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var i=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear);return this._leapYear(i.year())},_leapYear:function(t){return 7>n(7*(t=t<0?t+1:t)+1,19)},monthsInYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),this._leapYear(r.year?r.year():r)?13:12},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(r){return r=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear).year(),this.toJD(-1===r?1:r+1,7,1)-this.toJD(r,7,1)},daysInMonth:function(r,i){return r.year&&(i=r.month(),r=r.year()),this._validate(r,i,this.minDay,t.local.invalidMonth),12===i&&this.leapYear(r)||8===i&&5===n(this.daysInYear(r),10)?30:9===i&&3===n(this.daysInYear(r),10)?29:this.daysPerMonth[i-1]},weekDay:function(t,r,i){return 6!==this.dayOfWeek(t,r,i)},extraInfo:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);r=a.year(),i=a.month(),n=a.day();var o=r<=0?r+1:r,s=this.jdEpoch+this._delay1(o)+this._delay2(o)+n+1;if(i<7){for(var l=7;l<=this.monthsInYear(r);l++)s+=this.daysInMonth(r,l);for(var l=1;ln(3*(i+1),7)&&i++,i},_delay2:function(t){var r=this._delay1(t-1),i=this._delay1(t);return this._delay1(t+1)-i==356?2:+(i-r==382)},fromJD:function(t){t=Math.floor(t)+.5;for(var r=Math.floor((t-this.jdEpoch)*98496/0x224f0b7)-1;t>=this.toJD(-1===r?1:r+1,7,1);)r++;for(var i=tthis.toJD(r,i,this.daysInMonth(r,i));)i++;var n=t-this.toJD(r,i,1)+1;return this.newDate(r,i,n)}}),t.calendars.hebrew=i}}),U3=g({"node_modules/world-calendars/dist/calendars/islamic.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new t.baseCalendar,r(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(r){return(11*this._validate(r,this.minMonth,this.minDay,t.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,r,i){return 5!==this.dayOfWeek(t,r,i)},toJD:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);return r=a.year(),i=a.month(),(n=a.day())+Math.ceil(29.5*(i-1))+((r=r<=0?r+1:r)-1)*354+Math.floor((3+11*r)/30)+this.jdEpoch-1},fromJD:function(t){var r=Math.floor((30*((t=Math.floor(t)+.5)-this.jdEpoch)+10646)/10631);r=r<=0?r-1:r;var i=Math.min(12,Math.ceil((t-29-this.toJD(r,1,1))/29.5)+1),n=t-this.toJD(r,i,1)+1;return this.newDate(r,i,n)}}),t.calendars.islamic=i}}),U5=g({"node_modules/world-calendars/dist/calendars/julian.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new t.baseCalendar,r(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var i=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),r=0>i.year()?i.year()+1:i.year();return r%4==0},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,r,i){return 6>(this.dayOfWeek(t,r,i)||7)},toJD:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);return r=a.year(),i=a.month(),n=a.day(),r<0&&r++,i<=2&&(r--,i+=12),Math.floor(365.25*(r+4716))+Math.floor(30.6001*(i+1))+n-1524.5},fromJD:function(t){var r=Math.floor(t+.5)+1524,i=Math.floor((r-122.1)/365.25),n=Math.floor(365.25*i),a=Math.floor((r-n)/30.6001),o=a-Math.floor(a<14?1:13),s=i-Math.floor(o>2?4716:4715),l=r-n-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}}),t.calendars.julian=i}}),U4=g({"node_modules/world-calendars/dist/calendars/mayan.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t,r){return t-r*Math.floor(t/r)}i.prototype=new t.baseCalendar,r(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),!1},formatYear:function(r){var i=Math.floor((r=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear).year())/400);return r%=400,i+"."+Math.floor((r+=400*(r<0))/20)+"."+r%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var r=0,i=0;i19||i>0&&n<0)throw"Invalid Mayan year";r=20*r+n}return r},monthsInYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),18},weekOfYear:function(r,i,n){return this._validate(r,i,n,t.local.invalidDate),0},daysInYear:function(r){return this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),360},daysInMonth:function(r,i){return this._validate(r,i,this.minDay,t.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(r,i,n){return this._validate(r,i,n,t.local.invalidDate).day()},weekDay:function(r,i,n){return this._validate(r,i,n,t.local.invalidDate),!0},extraInfo:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate).toJD(),o=this._toHaab(a),s=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[o[0]-1],haabMonth:o[0],haabDay:o[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(t){var r=n((t-=this.jdEpoch)+8+340,365);return[Math.floor(r/20)+1,n(r,20)]},_toTzolkin:function(t){return[n((t-=this.jdEpoch)+20-1,20)+1,n(t+4-1,13)+1]},toJD:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(t){var r=Math.floor((t=Math.floor(t)+.5-this.jdEpoch)/360);t%=360;var i=Math.floor((t+=360*(t<0))/20),n=t%20;return this.newDate(r,i,n)}}),t.calendars.mayan=i}}),U6=g({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new t.baseCalendar;var n=t.instance("gregorian");r(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var i=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear||t.regionalOptions[""].invalidYear);return n.leapYear(i.year()+ +(1>i.year())+1469)},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,r,i){return 6>(this.dayOfWeek(t,r,i)||7)},toJD:function(r,i,a){var o=this._validate(r,i,a,t.local.invalidMonth),r=o.year();r<0&&r++;for(var s=o.day(),l=1;l=this.toJD(r+1,1,1);)r++;for(var i=t-Math.floor(this.toJD(r,1,1)+.5)+1,n=1;i>this.daysInMonth(r,n);)i-=this.daysInMonth(r,n),n++;return this.newDate(r,n,i)}}),t.calendars.nanakshahi=i}}),U8=g({"node_modules/world-calendars/dist/calendars/nepali.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new t.baseCalendar,r(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(r){if(r=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear).year(),typeof this.NEPALI_CALENDAR_DATA[r]>"u")return this.daysPerYear;for(var i=0,n=this.minMonth;n<=12;n++)i+=this.NEPALI_CALENDAR_DATA[r][n];return i},daysInMonth:function(r,i){return r.year&&(i=r.month(),r=r.year()),this._validate(r,i,this.minDay,t.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[r]>"u"?this.daysPerMonth[i-1]:this.NEPALI_CALENDAR_DATA[r][i]},weekDay:function(t,r,i){return 6!==this.dayOfWeek(t,r,i)},toJD:function(r,i,n){var a=this._validate(r,i,n,t.local.invalidDate);r=a.year(),i=a.month(),n=a.day();var o=t.instance(),s=0,l=i,u=r;this._createMissingCalendarData(r);var c=r-(l>9||9===l&&n>=this.NEPALI_CALENDAR_DATA[u][0]?56:57);for(9!==i&&(s=n,l--);9!==l;)l<=0&&(l=12,u--),s+=this.NEPALI_CALENDAR_DATA[u][l],l--;return 9===i?(s+=n-this.NEPALI_CALENDAR_DATA[u][0])<0&&(s+=o.daysInYear(c)):s+=this.NEPALI_CALENDAR_DATA[u][9]-this.NEPALI_CALENDAR_DATA[u][0],o.newDate(c,1,1).add(s,"d").toJD()},fromJD:function(r){var i=t.instance().fromJD(r),n=i.year(),a=i.dayOfYear(),o=n+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],u=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>u;)++s>12&&(s=1,o++),u+=this.NEPALI_CALENDAR_DATA[o][s];var c=this.NEPALI_CALENDAR_DATA[o][s]-(u-a);return this.newDate(o,s,c)},_createMissingCalendarData:function(t){var r=this.daysPerMonth.slice(0);r.unshift(17);for(var i=t-1;i"u"&&(this.NEPALI_CALENDAR_DATA[i]=r)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),t.calendars.nepali=i}}),U7=g({"node_modules/world-calendars/dist/calendars/persian.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function n(t){var r=t-475;t<0&&r++;var i=.242197*r,n=.242197*(r+1);return i-Math.floor(i)>n-Math.floor(n)}i.prototype=new t.baseCalendar,r(i.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(r){return n(this._validate(r,this.minMonth,this.minDay,t.local.invalidYear).year())},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(-((n.dayOfWeek()+1)%7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,r,i){return 5!==this.dayOfWeek(t,r,i)},toJD:function(r,i,a){var o=this._validate(r,i,a,t.local.invalidDate);r=o.year(),i=o.month(),a=o.day();var s=0;if(r>0)for(var l=1;l0?r-1:r)*365+s+this.jdEpoch-1},fromJD:function(t){var r=Math.floor(475+((t=Math.floor(t)+.5)-this.toJD(475,1,1))/365.242197);r<=0&&r--,t>this.toJD(r,12,n(r)?30:29)&&0==++r&&r++;var i=t-this.toJD(r,1,1)+1,a=i<=186?Math.ceil(i/31):Math.ceil((i-6)/30),o=t-this.toJD(r,a,1)+1;return this.newDate(r,a,o)}}),t.calendars.persian=i,t.calendars.jalali=i}}),U9=g({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var t=UX(),r=mB(),i=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,r(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(r){var n=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),r=this._t2gYear(n.year());return i.leapYear(r)},weekOfYear:function(r,n,a){var o=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),r=this._t2gYear(o.year());return i.weekOfYear(r,o.month(),o.day())},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,r,i){return 6>(this.dayOfWeek(t,r,i)||7)},toJD:function(r,n,a){var o=this._validate(r,n,a,t.local.invalidDate),r=this._t2gYear(o.year());return i.toJD(r,o.month(),o.day())},fromJD:function(t){var r=i.fromJD(t),n=this._g2tYear(r.year());return this.newDate(n,r.month(),r.day())},_t2gYear:function(t){return t+this.yearsOffset+ +(t>=-this.yearsOffset&&t<=-1)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset)}}),t.calendars.taiwan=n}}),qe=g({"node_modules/world-calendars/dist/calendars/thai.js"(){var t=UX(),r=mB(),i=t.instance();function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}n.prototype=new t.baseCalendar,r(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(r){var n=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),r=this._t2gYear(n.year());return i.leapYear(r)},weekOfYear:function(r,n,a){var o=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear),r=this._t2gYear(o.year());return i.weekOfYear(r,o.month(),o.day())},daysInMonth:function(r,i){var n=this._validate(r,i,this.minDay,t.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(t,r,i){return 6>(this.dayOfWeek(t,r,i)||7)},toJD:function(r,n,a){var o=this._validate(r,n,a,t.local.invalidDate),r=this._t2gYear(o.year());return i.toJD(r,o.month(),o.day())},fromJD:function(t){var r=i.fromJD(t),n=this._g2tYear(r.year());return this.newDate(n,r.month(),r.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset)},_g2tYear:function(t){return t+this.yearsOffset+ +(t>=-this.yearsOffset&&t<=-1)}}),t.calendars.thai=n}}),qt=g({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var t=UX(),r=mB();function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new t.baseCalendar,r(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(r){var i=this._validate(r,this.minMonth,this.minDay,t.local.invalidYear);return 355===this.daysInYear(i.year())},weekOfYear:function(t,r,i){var n=this.newDate(t,r,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var r=0,i=1;i<=12;i++)r+=this.daysInMonth(t,i);return r},daysInMonth:function(r,i){for(var a=this._validate(r,i,this.minDay,t.local.invalidMonth),o=a.toJD()-24e5+.5,s=0,l=0;lo)return n[s]-n[s-1];s++}return 30},weekDay:function(t,r,i){return 5!==this.dayOfWeek(t,r,i)},toJD:function(r,i,a){var o=this._validate(r,i,a,t.local.invalidDate),s=12*(o.year()-1)+o.month()-15292;return o.day()+n[s-1]-1+24e5-.5},fromJD:function(t){for(var r=t-24e5+.5,i=0,a=0;ar);a++)i++;var o=i+15292,s=Math.floor((o-1)/12),l=r-n[i-1]+1;return this.newDate(s+1,o-12*s,l)},isValid:function(r,i,n){var a=t.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(r=null!=r.year?r.year:r)>=1276&&r<=1500),a},_validate:function(r,i,n,a){var o=t.baseCalendar.prototype._validate.apply(this,arguments);if(o.year<1276||o.year>1500)throw a.replace(/\{0\}/,this.local.name);return o}}),t.calendars.ummalqura=i;var n=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),qr=g({"src/components/calendars/calendars.js"(t,r){r.exports=UX(),UK(),UJ(),UQ(),U0(),U1(),U2(),U3(),U5(),U4(),U6(),U8(),U7(),U9(),qe(),qt()}}),qi=g({"src/components/calendars/index.js"(t,r){var i=qr(),n=t_(),a=P(),o=a.EPOCHJD,s=a.ONEDAY,l={valType:"enumerated",values:n.sortObjectKeys(i.calendars),editType:"calc",dflt:"gregorian"},u=function(t,r,i,a){var o={};return o[i]=l,n.coerce(t,r,o,i,a)},c={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:"##",w:"##",c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},h={};function d(t){var r=h[t];return r||(r=h[t]=i.instance(t))}function f(t){return n.extendFlat({},l,{description:t})}function p(t){return"Sets the calendar system to use with `"+t+"` date data."}var m={xcalendar:f(p("x"))},g=n.extendFlat({},m,{ycalendar:f(p("y"))}),y=n.extendFlat({},g,{zcalendar:f(p("z"))}),v=f("Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar`");r.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:f("Sets the default calendar system to use for interpreting and displaying dates throughout the plot.")},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:l,handleDefaults:u,handleTraceDefaults:function(t,r,i,n){for(var a=0;a{n.preventDefault(),n.stopPropagation(),n.clipboardData.setData("text",t),r.removeEventListener("copy",i,!0)};r.addEventListener("copy",i,!0),document.execCommand("copy")},(G=X||(X={})).boxSizing=function(t){let r=window.getComputedStyle(t),i=parseFloat(r.borderTopWidth)||0,n=parseFloat(r.borderLeftWidth)||0,a=parseFloat(r.borderRightWidth)||0,o=parseFloat(r.borderBottomWidth)||0,s=parseFloat(r.paddingTop)||0,l=parseFloat(r.paddingLeft)||0,u=parseFloat(r.paddingRight)||0,c=parseFloat(r.paddingBottom)||0;return{borderTop:i,borderLeft:n,borderRight:a,borderBottom:o,paddingTop:s,paddingLeft:l,paddingRight:u,paddingBottom:c,horizontalSum:n+l+u+a,verticalSum:i+s+c+o}},G.sizeLimits=function(t){let r=window.getComputedStyle(t),i=parseFloat(r.minWidth)||0,n=parseFloat(r.minHeight)||0,a=parseFloat(r.maxWidth)||1/0,o=parseFloat(r.maxHeight)||1/0;return a=Math.max(i,a),o=Math.max(n,o),{minWidth:i,minHeight:n,maxWidth:a,maxHeight:o}},G.hitTest=function(t,r,i){let n=t.getBoundingClientRect();return r>=n.left&&r=n.top&&i=i.bottom)){if(n.topi.bottom&&n.height>=i.height){t.scrollTop-=i.top-n.top;return}if(n.topi.height||n.bottom>i.bottom&&n.height0;){if(f(a)){r++;continue}if(f(o)||f(s)){i++;continue}if(f(u)){n++;continue}if(f(c)){i++;continue}if(f(l)){n++;continue}if(!f(h))return 0}return(r=Math.min(r,255))<<16|(i=Math.min(i,255))<<8|(n=Math.min(n,255))},a=/^#[^\s\+>~#\.\[:]+/,o=/^\.[^\s\+>~#\.\[:]+/,s=/^\[[^\]]+\]/,l=/^[^\s\+>~#\.\[:]+/,u=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,c=/^:[^\s\+>~#\.\[:]+/,h=/^[\s\+>~\*]+/,d=/:not\(([^\)]+)\)/g;var U=O(R()),q=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return 0===this._size}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let t=this._first;for(;t;)yield t.value,t=t.next}*retro(){let t=this._last;for(;t;)yield t.value,t=t.prev}*nodes(){let t=this._first;for(;t;)yield t,t=t.next}*retroNodes(){let t=this._last;for(;t;)yield t,t=t.prev}assign(t){for(let r of(this.clear(),t))this.addLast(r)}push(t){this.addLast(t)}pop(){return this.removeLast()}shift(t){this.addFirst(t)}unshift(){return this.removeFirst()}addFirst(t){let r=new ee.LinkedListNode(this,t);return this._first?(r.next=this._first,this._first.prev=r,this._first=r):(this._first=r,this._last=r),this._size++,r}addLast(t){let r=new ee.LinkedListNode(this,t);return this._last?(r.prev=this._last,this._last.next=r):this._first=r,this._last=r,this._size++,r}insertBefore(t,r){if(!r||r===this._first)return this.addFirst(t);if(!(r instanceof ee.LinkedListNode)||r.list!==this)throw Error("Reference node is not owned by the list.");let i=new ee.LinkedListNode(this,t),n=r.prev;return i.next=r,i.prev=n,r.prev=i,n.next=i,this._size++,i}insertAfter(t,r){if(!r||r===this._last)return this.addLast(t);if(!(r instanceof ee.LinkedListNode)||r.list!==this)throw Error("Reference node is not owned by the list.");let i=new ee.LinkedListNode(this,t),n=r.next;return i.next=n,i.prev=r,r.next=i,n.prev=i,this._size++,i}removeFirst(){let t=this._first;if(t)return t===this._last?(this._first=null,this._last=null):(this._first=t.next,this._first.prev=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value}removeLast(){let t=this._last;if(t)return t===this._first?(this._first=null,this._last=null):(this._last=t.prev,this._last.next=null),t.list=null,t.next=null,t.prev=null,this._size--,t.value}removeNode(t){if(!(t instanceof ee.LinkedListNode)||t.list!==this)throw Error("Node is not owned by the list.");t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let t=this._first;for(;t;){let r=t.next;t.list=null,t.prev=null,t.next=null,t=r}this._first=null,this._last=null,this._size=0}};(Y=q||(q={})).from=function(t){let r=new Y;return r.assign(t),r},(ee||(ee={})).LinkedListNode=class{constructor(t,r){this.list=null,this.next=null,this.prev=null,this.list=t,this.value=r}};var G,H,$,W,Y,Z,X,K,J,Q,ee,et,er=class{constructor(t){this.type=t}get isConflatable(){return!1}conflate(t){return!1}},ei=class extends er{get isConflatable(){return!0}conflate(t){return!0}};!function(t){let r,i=null,n=(r=Promise.resolve(),t=>{let i=!1;return r.then(()=>!i&&t()),()=>{i=!0}});function a(t,r){let i=s.get(t);i&&0!==i.length?(0,U.every)((0,U.retro)(i),i=>!i||function(t,r,i){let n=!0;try{n="function"==typeof t?t(r,i):t.messageHook(r,i)}catch(t){u(t)}return n}(i,t,r))&&h(t,r):h(t,r)}t.sendMessage=a,t.postMessage=function(t,r){r.isConflatable&&(0,U.some)(o,i=>i.handler===t&&!!i.msg&&i.msg.type===r.type&&!!i.msg.isConflatable&&i.msg.conflate(r))||d(t,r)},t.installMessageHook=function(t,r){let i=s.get(t);i&&-1!==i.indexOf(r)||(i?i.push(r):s.set(t,[r]))},t.removeMessageHook=function(t,r){let i=s.get(t);if(!i)return;let n=i.indexOf(r);-1!==n&&(i[n]=null,p(i))},t.clearData=function(t){let r=s.get(t);for(let i of(r&&r.length>0&&(U.ArrayExt.fill(r,null),p(r)),o))i.handler===t&&(i.handler=null,i.msg=null)},t.flush=function(){c||null===i||(i(),i=null,c=!0,f(),c=!1)},t.getExceptionHandler=function(){return u},t.setExceptionHandler=function(t){let r=u;return u=t,r};let o=new q,s=new WeakMap,l=new Set,u=t=>{console.error(t)},c=!1;function h(t,r){try{t.processMessage(r)}catch(t){u(t)}}function d(t,r){o.addLast({handler:t,msg:r}),null===i&&(i=n(f))}function f(){if(i=null,o.isEmpty)return;let t={handler:null,msg:null};for(o.addLast(t);;){let r=o.removeFirst();if(r===t)return;r.handler&&r.msg&&a(r.handler,r.msg)}}function p(t){0===l.size&&n(m),l.add(t)}function m(){l.forEach(g),l.clear()}function g(t){U.ArrayExt.removeAllWhere(t,y)}function y(t){return null===t}}(et||(et={}));var en=class{constructor(t){this._pid=ew.nextPID(),this.name=t.name,this._create=t.create,this._coerce=t.coerce||null,this._compare=t.compare||null,this._changed=t.changed||null}get(t){let r=ew.ensureMap(t);return this._pid in r?r[this._pid]:r[this._pid]=this._createValue(t)}set(t,r){let i,n=ew.ensureMap(t);i=this._pid in n?n[this._pid]:n[this._pid]=this._createValue(t);let a=this._coerceValue(t,r);this._maybeNotify(t,i,n[this._pid]=a)}coerce(t){let r,i=ew.ensureMap(t);r=this._pid in i?i[this._pid]:i[this._pid]=this._createValue(t);let n=this._coerceValue(t,r);this._maybeNotify(t,r,i[this._pid]=n)}_createValue(t){return(0,this._create)(t)}_coerceValue(t,r){let i=this._coerce;return i?i(t,r):r}_compareValue(t,r){let i=this._compare;return i?i(t,r):t===r}_maybeNotify(t,r,i){let n=this._changed;n&&!this._compareValue(r,i)&&n(t,r,i)}};(en||(en={})).clearData=function(t){ew.ownerData.delete(t)},(ey=ew||(ew={})).ownerData=new WeakMap,f=0,ey.nextPID=()=>`pid-${`${Math.random()}`.slice(2)}-${f++}`,ey.ensureMap=function(t){let r=ey.ownerData.get(t);return r||(r=Object.create(null),ey.ownerData.set(t,r),r)};var ea=O(R()),eo=(O(B()),class{constructor(t){this.sender=t}connect(t,r){return eT.connect(this,t,r)}disconnect(t,r){return eT.disconnect(this,t,r)}emit(t){eT.emit(this,t)}});(ev=eo||(eo={})).disconnectBetween=function(t,r){eT.disconnectBetween(t,r)},ev.disconnectSender=function(t){eT.disconnectSender(t)},ev.disconnectReceiver=function(t){eT.disconnectReceiver(t)},ev.disconnectAll=function(t){eT.disconnectAll(t)},ev.clearData=function(t){eT.disconnectAll(t)},ev.getExceptionHandler=function(){return eT.exceptionHandler},ev.setExceptionHandler=function(t){let r=eT.exceptionHandler;return eT.exceptionHandler=t,r},function(t){function r(t){let r=n.get(t);if(!(!r||0===r.length)){for(let t of r){if(!t.signal)continue;let r=t.thisArg||t.slot;t.signal=null,u(a.get(r))}u(r)}}function i(t){let r=a.get(t);if(!(!r||0===r.length)){for(let t of r){if(!t.signal)continue;let r=t.signal.sender;t.signal=null,u(n.get(r))}u(r)}}t.exceptionHandler=t=>{console.error(t)},t.connect=function(t,r,i){i=i||void 0;let o=n.get(t.sender);if(o||(o=[],n.set(t.sender,o)),l(o,t,r,i))return!1;let s=i||r,u=a.get(s);u||(u=[],a.set(s,u));let c={signal:t,slot:r,thisArg:i};return o.push(c),u.push(c),!0},t.disconnect=function(t,r,i){i=i||void 0;let o=n.get(t.sender);if(!o||0===o.length)return!1;let s=l(o,t,r,i);if(!s)return!1;let c=i||r,h=a.get(c);return s.signal=null,u(o),u(h),!0},t.disconnectBetween=function(t,r){let i=n.get(t);if(!i||0===i.length)return;let o=a.get(r);if(!(!o||0===o.length)){for(let r of o)r.signal&&r.signal.sender===t&&(r.signal=null);u(i),u(o)}},t.disconnectSender=r,t.disconnectReceiver=i,t.disconnectAll=function(t){r(t),i(t)},t.emit=function(r,i){let a=n.get(r.sender);if(!(!a||0===a.length))for(let n=0,o=a.length;nt.signal===r&&t.slot===i&&t.thisArg===n)}function u(t){0===o.size&&s(c),o.add(t)}function c(){o.forEach(h),o.clear()}function h(t){ea.ArrayExt.removeAllWhere(t,d)}function d(t){return null===t.signal}}(eT||(eT={}));var es=class{constructor(t){this._fn=t}get isDisposed(){return!this._fn}dispose(){if(!this._fn)return;let t=this._fn;this._fn=null,t()}},el=class{constructor(){this._isDisposed=!1,this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(t=>{t.dispose()}),this._items.clear())}contains(t){return this._items.has(t)}add(t){this._items.add(t)}remove(t){this._items.delete(t)}clear(){this._items.clear()}};(ex=el||(el={})).from=function(t){let r=new ex;for(let i of t)r.add(i);return r};var eu=class extends el{constructor(){super(...arguments),this._disposed=new eo(this)}get disposed(){return this._disposed}dispose(){this.isDisposed||(super.dispose(),this._disposed.emit(void 0),eo.clearData(this))}};(eb=eu||(eu={})).from=function(t){let r=new eb;for(let i of t)r.add(i);return r};var ec=class t{constructor(t){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:r,distance:i}=this._scrollTarget,n=Math.max(1,Math.round(Math.pow((eA.SCROLL_EDGE_SIZE-i)/eA.SCROLL_EDGE_SIZE,2)*eA.SCROLL_EDGE_SIZE));switch(r){case"top":t.scrollTop-=n;break;case"left":t.scrollLeft-=n;break;case"right":t.scrollLeft+=n;break;case"bottom":t.scrollTop+=n}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=t.document||document,this.mimeData=t.mimeData,this.dragImage=t.dragImage||null,this.proposedAction=t.proposedAction||"copy",this.supportedActions=t.supportedActions||"all",this.source=t.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let t=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});eA.dispatchDragLeave(this,this._currentTarget,null,t)}this._finalize("none")}}get isDisposed(){return this._disposed}start(t,r){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(t,r),this._promise=new Promise(t=>{this._resolve=t});let i=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:t,clientY:r});return document.dispatchEvent(i),this._promise}handleEvent(t){switch(t.type){case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;default:t.preventDefault(),t.stopPropagation()}}moveDragImage(t,r){this.dragImage&&(this.dragImage.style.transform=`translate(${t}px, ${r}px)`)}_evtPointerMove(t){t.preventDefault(),t.stopPropagation(),this._updateCurrentTarget(t),this._updateDragScroll(t),this.moveDragImage(t.clientX,t.clientY)}_evtPointerUp(t){if(t.preventDefault(),t.stopPropagation(),0!==t.button)return;if(this._updateCurrentTarget(t),!this._currentTarget)return void this._finalize("none");if("none"===this._dropAction){eA.dispatchDragLeave(this,this._currentTarget,null,t),this._finalize("none");return}let r=eA.dispatchDrop(this,this._currentTarget,t);this._finalize(r)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(t){let r=eA.findScrollTarget(t);(this._scrollTarget||r)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=r)}_updateCurrentTarget(t){let r=this._currentTarget,i=this._currentTarget,n=this._currentElement,a=eA.findElementBehindBackdrop(t,this.document);this._currentElement=a,a!==n&&a!==i&&eA.dispatchDragExit(this,i,a,t),a!==n&&a!==i&&(i=eA.dispatchDragEnter(this,a,i,t)),i!==r&&(this._currentTarget=i,eA.dispatchDragLeave(this,r,i,t));let o=eA.dispatchDragOver(this,i,t);this._setDropAction(o)}_attachDragImage(t,r){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let i=this.dragImage.style;i.pointerEvents="none",i.position="fixed",i.transform=`translate(${t}px, ${r}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let t=this.dragImage.parentNode;t&&t.removeChild(this.dragImage)}_setDropAction(r){if(r=eA.validateAction(r,this.supportedActions),!(this._override&&this._dropAction===r))switch(r){case"none":this._dropAction=r,this._override=t.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=r,this._override=t.overrideCursor("copy",this.document);break;case"link":this._dropAction=r,this._override=t.overrideCursor("alias",this.document);break;case"move":this._dropAction=r,this._override=t.overrideCursor("move",this.document)}}_finalize(t){let r=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,r&&r(t)}},eh=ec||(ec={});class ed extends DragEvent{constructor(t,r){super(r.type,{bubbles:!0,cancelable:!0,altKey:t.altKey,button:t.button,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,detail:0,metaKey:t.metaKey,relatedTarget:r.related,screenX:t.screenX,screenY:t.screenY,shiftKey:t.shiftKey,view:window});let{drag:i}=r;this.dropAction="none",this.mimeData=i.mimeData,this.proposedAction=i.proposedAction,this.supportedActions=i.supportedActions,this.source=i.source}}eh.Event=ed,eh.overrideCursor=function(t,r=document){return eA.overrideCursor(t,r)},function(t){let r;function i(r,o=document){if(r){if(n&&r==n.event)return n.element;t.cursorBackdrop.style.zIndex="-1000";let i=o.elementFromPoint(r.clientX,r.clientY);return t.cursorBackdrop.style.zIndex="",n={event:r,element:i},i}{let r=t.cursorBackdrop.style.transform;if(a&&r===a.transform)return a.element;let i=t.cursorBackdrop.getBoundingClientRect();t.cursorBackdrop.style.zIndex="-1000";let n=o.elementFromPoint(i.left+i.width/2,i.top+i.height/2);return t.cursorBackdrop.style.zIndex="",a={transform:r,element:n},n}}t.SCROLL_EDGE_SIZE=20,t.validateAction=function(t,r){return o[t]&s[r]?t:"none"},t.findElementBehindBackdrop=i;let n=null,a=null;t.findScrollTarget=function(r){let n=r.clientX,a=r.clientY,o=i(r);for(;o;o=o.parentElement){let r;if(!o.hasAttribute("data-lm-dragscroll"))continue;let i=0,s=0;o===document.body&&(i=window.pageXOffset,s=window.pageYOffset);let l=o.getBoundingClientRect(),u=l.top+s,c=l.left+i,h=c+l.width,d=u+l.height;if(n=h||a=d)continue;let f=n-c+1,p=a-u+1,m=h-n,g=d-a,y=Math.min(f,p,m,g);if(y>t.SCROLL_EDGE_SIZE)continue;switch(y){case g:r="bottom";break;case p:r="top";break;case m:r="right";break;case f:r="left";break;default:throw"unreachable"}let v=o.scrollWidth-o.clientWidth,x=o.scrollHeight-o.clientHeight,b;switch(r){case"top":b=x>0&&o.scrollTop>0;break;case"left":b=v>0&&o.scrollLeft>0;break;case"right":b=v>0&&o.scrollLeft0&&o.scrollTop{n===d&&t.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",l,!0),t.cursorBackdrop.removeEventListener("scroll",u,!0),a.removeChild(t.cursorBackdrop))})};let h=500,d=0;(r=document.createElement("div")).classList.add("lm-cursor-backdrop"),t.cursorBackdrop=r}(eA||(eA={}));var ef=O(R()),ep=O(B());function em(){return eM.keyboardLayout}var eg=class t{constructor(r,i,n=[]){this.name=r,this._codes=i,this._keys=t.extractKeys(i),this._modifierKeys=t.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(t){return t in this._keys}isModifierKey(t){return t in this._modifierKeys}keyForKeydownEvent(t){return this._codes[t.keyCode]||""}};(e_=eg||(eg={})).extractKeys=function(t){let r=Object.create(null);for(let i in t)r[t[i]]=!0;return r},e_.convertToKeySet=function(t){let r=Object(null);for(let i=0,n=t.length;i{this._commands.delete(t),this._commandChanged.emit({id:t,type:"removed"})})}notifyCommandChanged(t){if(void 0!==t&&!this._commands.has(t))throw Error(`Command '${t}' is not registered.`);this._commandChanged.emit({id:t,type:t?"changed":"many-changed"})}describedBy(t,r=ep.JSONExt.emptyObject){var i;let n=this._commands.get(t);return Promise.resolve(null!=(i=n?.describedBy.call(void 0,r))?i:{args:null})}label(t,r=ep.JSONExt.emptyObject){var i;let n=this._commands.get(t);return null!=(i=n?.label.call(void 0,r))?i:""}mnemonic(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return i?i.mnemonic.call(void 0,r):-1}icon(t,r=ep.JSONExt.emptyObject){var i;return null==(i=this._commands.get(t))?void 0:i.icon.call(void 0,r)}iconClass(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return i?i.iconClass.call(void 0,r):""}iconLabel(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return i?i.iconLabel.call(void 0,r):""}caption(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return i?i.caption.call(void 0,r):""}usage(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return i?i.usage.call(void 0,r):""}className(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return i?i.className.call(void 0,r):""}dataset(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return i?i.dataset.call(void 0,r):{}}isEnabled(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return!!i&&i.isEnabled.call(void 0,r)}isToggled(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return!!i&&i.isToggled.call(void 0,r)}isToggleable(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return!!i&&i.isToggleable}isVisible(t,r=ep.JSONExt.emptyObject){let i=this._commands.get(t);return!!i&&i.isVisible.call(void 0,r)}execute(t,r=ep.JSONExt.emptyObject){let i,n=this._commands.get(t);if(!n)return Promise.reject(Error(`Command '${t}' not registered.`));try{i=n.execute.call(void 0,r)}catch(t){i=Promise.reject(t)}let a=Promise.resolve(i);return this._commandExecuted.emit({id:t,args:r,result:a}),a}addKeyBinding(t){let r=eN.createKeyBinding(t);return this._keyBindings.push(r),this._keyBindingChanged.emit({binding:r,type:"added"}),new es(()=>{ef.ArrayExt.removeFirstOf(this._keyBindings,r),this._keyBindingChanged.emit({binding:r,type:"removed"})})}processKeydownEvent(r){if(r.defaultPrevented||this._replaying)return;let i=t.keystrokeForKeydownEvent(r);if(!i){this._replayKeydownEvents(),this._clearPendingState();return}if(t.isModifierKeyPressed(r)){let{exact:t}=eN.matchKeyBinding(this._keyBindings,[i],r);t?(r.preventDefault(),r.stopPropagation(),this._startModifierTimer(t)):this._clearModifierTimer();return}this._keystrokes.push(i);let{exact:n,partial:a}=eN.matchKeyBinding(this._keyBindings,this._keystrokes,r),o=0!==a.length;if(!n&&!o){this._replayKeydownEvents(),this._clearPendingState();return}if((n?.preventDefault||a.some(t=>t.preventDefault))&&(r.preventDefault(),r.stopPropagation()),this._keydownEvents.push(r),n&&!o){this._executeKeyBinding(n),this._clearPendingState();return}n&&(this._exactKeyMatch=n),this._startTimer()}holdKeyBindingExecution(t,r){this._holdKeyBindingPromises.set(t,r)}processKeyupEvent(t){this._clearModifierTimer()}_startModifierTimer(t){this._clearModifierTimer(),this._timerModifierID=window.setTimeout(()=>{this._executeKeyBinding(t)},eN.modifierkeyTimeOut)}_clearModifierTimer(){0!==this._timerModifierID&&(clearTimeout(this._timerModifierID),this._timerModifierID=0)}_startTimer(){this._clearTimer(),this._timerID=window.setTimeout(()=>{this._onPendingTimeout()},eN.CHORD_TIMEOUT)}_clearTimer(){0!==this._timerID&&(clearTimeout(this._timerID),this._timerID=0)}_replayKeydownEvents(){0!==this._keydownEvents.length&&(this._replaying=!0,this._keydownEvents.forEach(eN.replayKeyEvent),this._replaying=!1)}async _executeKeyBinding(t){if(0!==this._holdKeyBindingPromises.size){let t=[...this._keydownEvents],r=(await Promise.race([Promise.all(t.map(async t=>{var r;return null!=(r=this._holdKeyBindingPromises.get(t))?r:Promise.resolve(!0)})),new Promise(t=>{setTimeout(()=>t([!1]),eN.KEYBINDING_HOLD_TIMEOUT)})])).every(Boolean);if(this._holdKeyBindingPromises.clear(),!r)return}let{command:r,args:i}=t,n={_luminoEvent:{type:"keybinding",keys:t.keys},...i};if(!this.hasCommand(r)||!this.isEnabled(r,n)){let i=this.hasCommand(r)?"enabled":"registered",n=`Cannot execute key binding '${t.keys.join(", ")}':`,a=`command '${r}' is not ${i}.`;console.warn(`${n} ${a}`);return}await this.execute(r,n)}_clearPendingState(){this._clearTimer(),this._clearModifierTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()}},eE=eS||(eS={});function eD(t){let r="",i=!1,n=!1,a=!1,o=!1;for(let s of t.split(/\s+/))"Accel"===s?K.IS_MAC?n=!0:a=!0:"Alt"===s?i=!0:"Cmd"===s?n=!0:"Ctrl"===s?a=!0:"Shift"===s?o=!0:s.length>0&&(r=s);return{cmd:n,ctrl:a,alt:i,shift:o,key:r}}function eC(t){let r="",i=eD(t);return i.ctrl&&(r+="Ctrl "),i.alt&&(r+="Alt "),i.shift&&(r+="Shift "),i.cmd&&K.IS_MAC&&(r+="Cmd "),i.key?r+i.key:r.trim()}eE.parseKeystroke=eD,eE.normalizeKeystroke=eC,eE.normalizeKeys=function(t){return(K.IS_WIN?t.winKeys||t.keys:K.IS_MAC?t.macKeys||t.keys:t.linuxKeys||t.keys).map(eC)},eE.formatKeystroke=function(t){return"string"==typeof t?r(t):t.map(r).join(", ");function r(t){let r=[],i=K.IS_MAC?" ":"+",n=eD(t);return n.ctrl&&r.push("Ctrl"),n.alt&&r.push("Alt"),n.shift&&r.push("Shift"),K.IS_MAC&&n.cmd&&r.push("Cmd"),r.push(n.key),r.map(eN.formatKey).join(i)}},eE.isModifierKeyPressed=function(t){let r=em(),i=r.keyForKeydownEvent(t);return r.isModifierKey(i)},eE.keystrokeForKeydownEvent=function(t){let r=em(),i=r.keyForKeydownEvent(t),n=[];return t.ctrlKey&&n.push("Ctrl"),t.altKey&&n.push("Alt"),t.shiftKey&&n.push("Shift"),t.metaKey&&K.IS_MAC&&n.push("Cmd"),r.isModifierKey(i)||n.push(i),n.join(" ")},function(t){t.CHORD_TIMEOUT=1e3,t.KEYBINDING_HOLD_TIMEOUT=1e3,t.modifierkeyTimeOut=500,t.createCommand=function(t){return{execute:t.execute,describedBy:c("function"==typeof t.describedBy?t.describedBy:{args:null,...t.describedBy},()=>({args:null})),label:c(t.label,n),mnemonic:c(t.mnemonic,a),icon:c(t.icon,u),iconClass:c(t.iconClass,n),iconLabel:c(t.iconLabel,n),caption:c(t.caption,n),usage:c(t.usage,n),className:c(t.className,n),dataset:c(t.dataset,l),isEnabled:t.isEnabled||o,isToggled:t.isToggled||s,isToggleable:t.isToggleable||!!t.isToggled,isVisible:t.isVisible||o}},t.createKeyBinding=function(t){var r;return{keys:eS.normalizeKeys(t),selector:function(t){if(-1!==t.selector.indexOf(","))throw Error(`Selector cannot contain commas: ${t.selector}`);if(!J.isValid(t.selector))throw Error(`Invalid selector: ${t.selector}`);return t.selector}(t),command:t.command,args:t.args||ep.JSONExt.emptyObject,preventDefault:null==(r=t.preventDefault)||r}},t.matchKeyBinding=function(t,r,i){let n=null,a=[],o=1/0,s=0;for(let l=0,u=t.length;lr.length?2:1}(u.keys,r);if(0===c)continue;if(2===c){-1!==h(u.selector,i)&&a.push(u);continue}let d=h(u.selector,i);if(-1===d||d>o)continue;let f=J.calculateSpecificity(u.selector);(!n||d=s)&&(n=u,o=d,s=f)}return{exact:n,partial:a}},t.replayKeyEvent=function(t){var r;let i,n,a;t.target.dispatchEvent((r=t,i=document.createEvent("Event"),n=r.bubbles||!0,a=r.cancelable||!0,i.initEvent(r.type||"keydown",n,a),i.key=r.key||"",i.keyCode=r.keyCode||0,i.which=r.keyCode||0,i.ctrlKey=r.ctrlKey||!1,i.altKey=r.altKey||!1,i.shiftKey=r.shiftKey||!1,i.metaKey=r.metaKey||!1,i.view=r.view||window,i))},t.formatKey=function(t){return K.IS_MAC?r.hasOwnProperty(t)?r[t]:t:i.hasOwnProperty(t)?i[t]:t};let r={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},i={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},n=()=>"",a=()=>-1,o=()=>!0,s=()=>!1,l=()=>({}),u=()=>{};function c(t,r){return void 0===t?r:"function"==typeof t?t:()=>t}function h(t,r){let i=r.target,n=r.currentTarget;for(let r=0;null!==i&&!i.hasAttribute("data-lm-suppress-shortcuts");i=i.parentElement,++r){if(J.matches(i,t))return r;if(i===n)break}return -1}}(eN||(eN={}));var eI=O(R()),eL=class{constructor(t){this.type="text",this.content=t}},eP=class{constructor(t,r,i,n){this.type="element",this.tag=t,this.attrs=r,this.children=i,this.renderer=n}};function ez(t){let r={},i,n=[];for(let t=1,a=arguments.length;t=o.length){eO(n[i],r);continue}let l=o[i],u=n[i];if(l===u){s=s.nextSibling;continue}if("text"===l.type&&"text"===u.type){s.textContent!==u.content&&(s.textContent=u.content),s=s.nextSibling;continue}if("text"===l.type||"text"===u.type||!l.renderer!=!u.renderer){eI.ArrayExt.insert(o,i,u),eO(u,r,s);continue}let c=u.attrs.key;if(c&&c in a){let t=a[c];t.vNode!==l&&(eI.ArrayExt.move(o,o.indexOf(t.vNode,i+1),i),r.insertBefore(t.element,s),l=t.vNode,s=t.element)}if(l===u){s=s.nextSibling;continue}let h=l.attrs.key;if(h&&h!==c||l.tag!==u.tag){eI.ArrayExt.insert(o,i,u),eO(u,r,s);continue}(function(t,r,i){let n;if(r!==i){for(n in r)n in eR||n in i||("on"===n.substr(0,2)?t[n]=null:t.removeAttribute(n));for(n in i)n in eR||r[n]===i[n]||("on"===n.substr(0,2)?t[n]=i[n]:t.setAttribute(n,i[n]));r.className!==i.className&&(void 0!==i.className?t.setAttribute("class",i.className):t.removeAttribute("class")),r.htmlFor!==i.htmlFor&&(void 0!==i.htmlFor?t.setAttribute("for",i.htmlFor):t.removeAttribute("for")),r.dataset!==i.dataset&&function(t,r,i){for(let n in r)n in i||t.removeAttribute(`data-${n}`);for(let n in i)r[n]!==i[n]&&t.setAttribute(`data-${n}`,i[n])}(t,r.dataset||{},i.dataset||{}),r.style!==i.style&&function(t,r,i){let n=t.style,a;for(a in r)a in i||(n[a]="");for(a in i)r[a]!==i[a]&&(n[a]=i[a])}(t,r.style||{},i.style||{})}})(s,l.attrs,u.attrs),u.renderer?u.renderer.render(s,{attrs:u.attrs,children:u.children}):t(s,l.children,u.children),s=s.nextSibling}!function t(r,i,n,a){for(let o=i.length-1;o>=n;--o){let n=i[o],s=a?r.lastChild:r.childNodes[o];"text"===n.type||(n.renderer&&n.renderer.unrender?n.renderer.unrender(s,{attrs:n.attrs,children:n.children}):t(s,n.children,0,!1)),a&&r.removeChild(s)}}(r,o,l,!0)};let eR={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};var eB,ej,eN,eV,eU,eq,eG=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}};(eY=eq||(eq={})).calc=function(t,r){let i=t.length;if(0===i)return r;let n=0,a=0,o=0,s=0,l=0;for(let r=0;r0&&(s+=i.stretch,l++)}if(r===o)return 0;if(r<=n){for(let r=0;r=a){for(let r=0;r0&&n>.01;){let r=n,a=s;for(let o=0;o0&&n>.01;){let r=n/u;for(let a=0;a0&&n>.01;){let r=n,a=s;for(let o=0;o=i.maxSize?(n-=i.maxSize-i.size,s-=i.stretch,i.size=i.maxSize,i.done=!0,u--,l--):(n-=c,i.size+=c)}}for(;u>0&&n>.01;){let r=n/u;for(let a=0;a=i.maxSize?(n-=i.maxSize-i.size,i.size=i.maxSize,i.done=!0,u--):(n-=r,i.size+=r))}}}return 0},eY.adjust=function(t,r,i){0===t.length||0===i||(i>0?function(t,r,i){let n=0;for(let i=0;i<=r;++i){let r=t[i];n+=r.maxSize-r.size}let a=0;for(let i=r+1,n=t.length;i=0&&o>0;--i){let r=t[i],n=r.maxSize-r.size;n>=o?(r.sizeHint=r.size+o,o=0):(r.sizeHint=r.size+n,o-=n)}let s=i;for(let i=r+1,n=t.length;i0;++i){let r=t[i],n=r.size-r.minSize;n>=s?(r.sizeHint=r.size-s,s=0):(r.sizeHint=r.size-n,s-=n)}}(t,r,i):function(t,r,i){let n=0;for(let i=r+1,a=t.length;i0;++i){let r=t[i],n=r.maxSize-r.size;n>=o?(r.sizeHint=r.size+o,o=0):(r.sizeHint=r.size+n,o-=n)}let s=i;for(let i=r;i>=0&&s>0;--i){let r=t[i],n=r.size-r.minSize;n>=s?(r.sizeHint=r.size-s,s=0):(r.sizeHint=r.size-n,s-=n)}}(t,r,-i))};var eH=class{constructor(t){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new eo(this),this._isDisposed=!1,this.owner=t.owner,void 0!==t.label&&(this._label=t.label),void 0!==t.mnemonic&&(this._mnemonic=t.mnemonic),void 0!==t.icon&&(this._icon=t.icon),void 0!==t.iconClass&&(this._iconClass=t.iconClass),void 0!==t.iconLabel&&(this._iconLabel=t.iconLabel),void 0!==t.caption&&(this._caption=t.caption),void 0!==t.className&&(this._className=t.className),void 0!==t.closable&&(this._closable=t.closable),this._dataset=t.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(t){this._label!==t&&(this._label=t,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(t){this._mnemonic!==t&&(this._mnemonic=t,this._changed.emit(void 0))}get icon(){return this._icon}set icon(t){this._icon!==t&&(this._icon=t,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(t){this._iconClass!==t&&(this._iconClass=t,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(t){this._iconLabel!==t&&(this._iconLabel=t,this._changed.emit(void 0))}get caption(){return this._caption}set caption(t){this._caption!==t&&(this._caption=t,this._changed.emit(void 0))}get className(){return this._className}set className(t){this._className!==t&&(this._className=t,this._changed.emit(void 0))}get closable(){return this._closable}set closable(t){this._closable!==t&&(this._closable=t,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(t){this._dataset!==t&&(this._dataset=t,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,eo.clearData(this))}},e$=class t{constructor(r={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new eo(this),this._hiddenMode=t.HiddenMode.Display,this.node=eK.createNode(r),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(t.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&t.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),eo.clearData(this),et.clearData(this),en.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(t.Flag.IsDisposed)}get isAttached(){return this.testFlag(t.Flag.IsAttached)}get isHidden(){return this.testFlag(t.Flag.IsHidden)}get isVisible(){let t=this;do{if(t.isHidden||!t.isAttached)return!1;t=t.parent}while(null!=t);return!0}get title(){return eK.titleProperty.get(this)}get id(){return this.node.id}set id(t){this.node.id=t}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(r){this._hiddenMode!==r&&(this.isHidden&&this._toggleHidden(!1),r==t.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=r,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(r){if(this._parent!==r){if(r&&this.contains(r))throw Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let r=new t.ChildMessage("child-removed",this);et.sendMessage(this._parent,r)}if(this._parent=r,this._parent&&!this._parent.isDisposed){let r=new t.ChildMessage("child-added",this);et.sendMessage(this._parent,r)}this.isDisposed||et.sendMessage(this,t.Msg.ParentChanged)}}get layout(){return this._layout}set layout(r){if(this._layout!==r){if(this.testFlag(t.Flag.DisallowLayout))throw Error("Cannot set widget layout.");if(this._layout)throw Error("Cannot change widget layout.");if(r.parent)throw Error("Cannot change layout parent.");this._layout=r,r.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(t){for(let r=t;r;r=r._parent)if(r===this)return!0;return!1}hasClass(t){return this.node.classList.contains(t)}addClass(t){this.node.classList.add(t)}removeClass(t){this.node.classList.remove(t)}toggleClass(t,r){return!0===r?(this.node.classList.add(t),!0):!1===r?(this.node.classList.remove(t),!1):this.node.classList.toggle(t)}update(){et.postMessage(this,t.Msg.UpdateRequest)}fit(){et.postMessage(this,t.Msg.FitRequest)}activate(){et.postMessage(this,t.Msg.ActivateRequest)}close(){et.sendMessage(this,t.Msg.CloseRequest)}show(){if(this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&et.sendMessage(this,t.Msg.BeforeShow),this.clearFlag(t.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&et.sendMessage(this,t.Msg.AfterShow),this.parent)){let r=new t.ChildMessage("child-shown",this);et.sendMessage(this.parent,r)}}hide(){if(!this.testFlag(t.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&et.sendMessage(this,t.Msg.BeforeHide),this.setFlag(t.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&et.sendMessage(this,t.Msg.AfterHide),this.parent)){let r=new t.ChildMessage("child-hidden",this);et.sendMessage(this.parent,r)}}setHidden(t){t?this.hide():this.show()}testFlag(t){return(this._flags&t)!=0}setFlag(t){this._flags|=t}clearFlag(t){this._flags&=~t}processMessage(r){switch(r.type){case"resize":this.notifyLayout(r),this.onResize(r);break;case"update-request":this.notifyLayout(r),this.onUpdateRequest(r);break;case"fit-request":this.notifyLayout(r),this.onFitRequest(r);break;case"before-show":this.notifyLayout(r),this.onBeforeShow(r);break;case"after-show":this.setFlag(t.Flag.IsVisible),this.notifyLayout(r),this.onAfterShow(r);break;case"before-hide":this.notifyLayout(r),this.onBeforeHide(r);break;case"after-hide":this.clearFlag(t.Flag.IsVisible),this.notifyLayout(r),this.onAfterHide(r);break;case"before-attach":this.notifyLayout(r),this.onBeforeAttach(r);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(t.Flag.IsVisible),this.setFlag(t.Flag.IsAttached),this.notifyLayout(r),this.onAfterAttach(r);break;case"before-detach":this.notifyLayout(r),this.onBeforeDetach(r);break;case"after-detach":this.clearFlag(t.Flag.IsVisible),this.clearFlag(t.Flag.IsAttached),this.notifyLayout(r),this.onAfterDetach(r);break;case"activate-request":this.notifyLayout(r),this.onActivateRequest(r);break;case"close-request":this.notifyLayout(r),this.onCloseRequest(r);break;case"child-added":this.notifyLayout(r),this.onChildAdded(r);break;case"child-removed":this.notifyLayout(r),this.onChildRemoved(r);break;default:this.notifyLayout(r)}}notifyLayout(t){this._layout&&this._layout.processParentMessage(t)}onCloseRequest(r){this.parent?this.parent=null:this.isAttached&&t.detach(this)}onResize(t){}onUpdateRequest(t){}onFitRequest(t){}onActivateRequest(t){}onBeforeShow(t){}onAfterShow(t){}onBeforeHide(t){}onAfterHide(t){}onBeforeAttach(t){}onAfterAttach(t){}onBeforeDetach(t){}onAfterDetach(t){}onChildAdded(t){}onChildRemoved(t){}_toggleHidden(r){if(r)switch(this._hiddenMode){case t.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1",this.node.style.opacity="0"}else switch(this._hiddenMode){case t.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case t.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case t.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="",this.node.style.opacity=""}}};!function(t){var r,i,n,a;(r=t.HiddenMode||(t.HiddenMode={}))[r.Display=0]="Display",r[r.Scale=1]="Scale",r[r.ContentVisibility=2]="ContentVisibility",(i=t.Flag||(t.Flag={}))[i.IsDisposed=1]="IsDisposed",i[i.IsAttached=2]="IsAttached",i[i.IsHidden=4]="IsHidden",i[i.IsVisible=8]="IsVisible",i[i.DisallowLayout=16]="DisallowLayout",(n=t.Msg||(t.Msg={})).BeforeShow=new er("before-show"),n.AfterShow=new er("after-show"),n.BeforeHide=new er("before-hide"),n.AfterHide=new er("after-hide"),n.BeforeAttach=new er("before-attach"),n.AfterAttach=new er("after-attach"),n.BeforeDetach=new er("before-detach"),n.AfterDetach=new er("after-detach"),n.ParentChanged=new er("parent-changed"),n.UpdateRequest=new ei("update-request"),n.FitRequest=new ei("fit-request"),n.ActivateRequest=new ei("activate-request"),n.CloseRequest=new ei("close-request"),t.ChildMessage=class extends er{constructor(t,r){super(t),this.child=r}};class o extends er{constructor(t,r){super("resize"),this.width=t,this.height=r}}t.ResizeMessage=o,(a=o=t.ResizeMessage||(t.ResizeMessage={})).UnknownSize=new a(-1,-1),t.attach=function(r,i,n=null){if(r.parent)throw Error("Cannot attach a child widget.");if(r.isAttached||r.node.isConnected)throw Error("Widget is already attached.");if(!i.isConnected)throw Error("Host is not attached.");et.sendMessage(r,t.Msg.BeforeAttach),i.insertBefore(r.node,n),et.sendMessage(r,t.Msg.AfterAttach)},t.detach=function(r){if(r.parent)throw Error("Cannot detach a child widget.");if(!r.isAttached||!r.node.isConnected)throw Error("Widget is not attached.");et.sendMessage(r,t.Msg.BeforeDetach),r.node.parentNode.removeChild(r.node),et.sendMessage(r,t.Msg.AfterDetach)}}(e$||(e$={})),(eZ=eK||(eK={})).titleProperty=new en({name:"title",create:t=>new eH({owner:t})}),eZ.createNode=function(t){return t.node||document.createElement(t.tag||"div")};var eW=class{constructor(t={}){this._disposed=!1,this._parent=null,this._fitPolicy=t.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,eo.clearData(this),en.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(t){if(this._parent!==t){if(this._parent)throw Error("Cannot change parent widget.");if(t.layout!==this)throw Error("Invalid parent widget.");this._parent=t,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(t){if(this._fitPolicy!==t&&(this._fitPolicy=t,this._parent)){let t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}processParentMessage(t){switch(t.type){case"resize":this.onResize(t);break;case"update-request":this.onUpdateRequest(t);break;case"fit-request":this.onFitRequest(t);break;case"before-show":this.onBeforeShow(t);break;case"after-show":this.onAfterShow(t);break;case"before-hide":this.onBeforeHide(t);break;case"after-hide":this.onAfterHide(t);break;case"before-attach":this.onBeforeAttach(t);break;case"after-attach":this.onAfterAttach(t);break;case"before-detach":this.onBeforeDetach(t);break;case"after-detach":this.onAfterDetach(t);break;case"child-removed":this.onChildRemoved(t);break;case"child-shown":this.onChildShown(t);break;case"child-hidden":this.onChildHidden(t)}}init(){for(let t of this)t.parent=this.parent}onResize(t){for(let t of this)et.sendMessage(t,e$.ResizeMessage.UnknownSize)}onUpdateRequest(t){for(let t of this)et.sendMessage(t,e$.ResizeMessage.UnknownSize)}onBeforeAttach(t){for(let r of this)et.sendMessage(r,t)}onAfterAttach(t){for(let r of this)et.sendMessage(r,t)}onBeforeDetach(t){for(let r of this)et.sendMessage(r,t)}onAfterDetach(t){for(let r of this)et.sendMessage(r,t)}onBeforeShow(t){for(let r of this)r.isHidden||et.sendMessage(r,t)}onAfterShow(t){for(let r of this)r.isHidden||et.sendMessage(r,t)}onBeforeHide(t){for(let r of this)r.isHidden||et.sendMessage(r,t)}onAfterHide(t){for(let r of this)r.isHidden||et.sendMessage(r,t)}onChildRemoved(t){this.removeWidget(t.child)}onFitRequest(t){}onChildShown(t){}onChildHidden(t){}};(eX=eW||(eW={})).getHorizontalAlignment=function(t){return eJ.horizontalAlignmentProperty.get(t)},eX.setHorizontalAlignment=function(t,r){eJ.horizontalAlignmentProperty.set(t,r)},eX.getVerticalAlignment=function(t){return eJ.verticalAlignmentProperty.get(t)},eX.setVerticalAlignment=function(t,r){eJ.verticalAlignmentProperty.set(t,r)};var eY,eZ,eX,eK,eJ,eQ=class{constructor(t){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=t,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let t=this.widget.node.style;t.position="",t.top="",t.left="",t.width="",t.height="",t.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let t=X.sizeLimits(this.widget.node);this._minWidth=t.minWidth,this._minHeight=t.minHeight,this._maxWidth=t.maxWidth,this._maxHeight=t.maxHeight}update(t,r,i,n){let a=Math.max(this._minWidth,Math.min(i,this._maxWidth)),o=Math.max(this._minHeight,Math.min(n,this._maxHeight));if(a"center",changed:e1}),e0.verticalAlignmentProperty=new en({name:"verticalAlignment",create:()=>"top",changed:e1});var e2,e3=class extends eW{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(t){this.insertWidget(this._widgets.length,t)}insertWidget(t,r){r.parent=this.parent;let i=this._widgets.indexOf(r),n=Math.max(0,Math.min(t,this._widgets.length));if(-1===i){N.ArrayExt.insert(this._widgets,n,r),this.parent&&this.attachWidget(n,r);return}n===this._widgets.length&&n--,i!==n&&(N.ArrayExt.move(this._widgets,i,n),this.parent&&this.moveWidget(i,n,r))}removeWidget(t){this.removeWidgetAt(this._widgets.indexOf(t))}removeWidgetAt(t){let r=N.ArrayExt.removeAt(this._widgets,t);r&&this.parent&&this.detachWidget(t,r)}init(){super.init();let t=0;for(let r of this)this.attachWidget(t++,r)}attachWidget(t,r){let i=this.parent.node.children[t];this.parent.isAttached&&et.sendMessage(r,e$.Msg.BeforeAttach),this.parent.node.insertBefore(r.node,i),this.parent.isAttached&&et.sendMessage(r,e$.Msg.AfterAttach)}moveWidget(t,r,i){this.parent.isAttached&&et.sendMessage(i,e$.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&et.sendMessage(i,e$.Msg.AfterDetach);let n=this.parent.node.children[r];this.parent.isAttached&&et.sendMessage(i,e$.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,n),this.parent.isAttached&&et.sendMessage(i,e$.Msg.AfterAttach)}detachWidget(t,r){this.parent.isAttached&&et.sendMessage(r,e$.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&et.sendMessage(r,e$.Msg.AfterDetach)}};(e2||(e2={})).clampDimension=function(t){return Math.max(0,Math.floor(t))};var e5=e2,e4=class t extends e3{constructor(t){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=t.renderer,void 0!==t.orientation&&(this._orientation=t.orientation),void 0!==t.alignment&&(this._alignment=t.alignment),void 0!==t.spacing&&(this._spacing=e2.clampDimension(t.spacing))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._orientation=t,this.parent&&(this.parent.dataset.orientation=t,this.parent.fit()))}get alignment(){return this._alignment}set alignment(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))}get spacing(){return this._spacing}set spacing(t){t=e2.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(t=>t.size)}relativeSizes(){return e7.normalize(this._sizers.map(t=>t.size))}setRelativeSizes(t,r=!0){let i=this._sizers.length,n=t.slice(0,i);for(;n.length0&&(t.sizeHint=t.size);eq.adjust(this._sizers,t,i),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(t,r){let i=new eQ(r),n=e7.createHandle(this.renderer),a=e7.averageSize(this._sizers),o=e7.createSizer(a);N.ArrayExt.insert(this._items,t,i),N.ArrayExt.insert(this._sizers,t,o),N.ArrayExt.insert(this._handles,t,n),this.parent.isAttached&&et.sendMessage(r,e$.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.node.appendChild(n),this.parent.isAttached&&et.sendMessage(r,e$.Msg.AfterAttach),this.parent.fit()}moveWidget(t,r,i){N.ArrayExt.move(this._items,t,r),N.ArrayExt.move(this._sizers,t,r),N.ArrayExt.move(this._handles,t,r),this.parent.fit()}detachWidget(t,r){let i=N.ArrayExt.removeAt(this._items,t),n=N.ArrayExt.removeAt(this._handles,t);N.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&et.sendMessage(r,e$.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.node.removeChild(n),this.parent.isAttached&&et.sendMessage(r,e$.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}updateItemPosition(t,r,i,n,a,o,s){let l=this._items[t];if(l.isHidden)return;let u=this._handles[t].style;r?(i+=this.widgetOffset,l.update(i,n,s,a),i+=s,u.top=`${n}px`,u.left=`${i}px`,u.width=`${this._spacing}px`,u.height=`${a}px`):(n+=this.widgetOffset,l.update(i,n,o,s),n+=s,u.top=`${n}px`,u.left=`${i}px`,u.width=`${o}px`,u.height=`${this._spacing}px`)}_fit(){let r=0,i=-1;for(let t=0,n=this._items.length;t0&&(s.sizeHint=s.size),i.isHidden){s.minSize=0,s.maxSize=0;continue}i.fit(),s.stretch=t.getStretch(i.widget),n?(s.minSize=i.minWidth,s.maxSize=i.maxWidth,a+=i.minWidth,o=Math.max(o,i.minHeight)):(s.minSize=i.minHeight,s.maxSize=i.maxHeight,o+=i.minHeight,a=Math.max(a,i.minWidth))}let s=this._box=X.boxSizing(this.parent.node);a+=s.horizontalSum,o+=s.verticalSum;let l=this.parent.node.style;l.minWidth=`${a}px`,l.minHeight=`${o}px`,this._dirty=!0,this.parent.parent&&et.sendMessage(this.parent.parent,e$.Msg.FitRequest),this._dirty&&et.sendMessage(this.parent,e$.Msg.UpdateRequest)}_update(t,r){this._dirty=!1;let i=0;for(let t=0,r=this._items.length;t0){let t;if(t=c?Math.max(0,o-this._fixed):Math.max(0,s-this._fixed),this._hasNormedSizes){for(let r of this._sizers)r.sizeHint*=t;this._hasNormedSizes=!1}let r=eq.calc(this._sizers,t);if(r>0)switch(this._alignment){case"start":break;case"center":l=0,u=r/2;break;case"end":l=0,u=r;break;case"justify":l=r/i,u=0;break;default:throw"unreachable"}}for(let t=0,r=this._items.length;t0,coerce:(t,r)=>Math.max(0,Math.floor(r)),changed:function(t){t.parent&&t.parent.layout instanceof e4&&t.parent.fit()}}),e8.createSizer=function(t){let r=new eG;return r.sizeHint=Math.floor(t),r},e8.createHandle=function(t){let r=t.createHandle();return r.style.position="absolute",r.style.contain="style",r},e8.averageSize=function(t){return t.reduce((t,r)=>t+r.size,0)/t.length||0},e8.normalize=function(t){let r=t.length;if(0===r)return[];let i=t.reduce((t,r)=>t+Math.abs(r),0);return 0===i?t.map(t=>1/r):t.map(t=>t/i)};var e6,e8,e7,e9,te=class extends e4{constructor(t){super({...t,orientation:t.orientation||"vertical"}),this._titles=[],this.titleSpace=t.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(t){t=e5.clampDimension(t),this.widgetOffset!==t&&(this.widgetOffset=t,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(t,r){let i=this._titles[t],n=i.classList.contains("lm-mod-expanded"),a=e9.createTitle(this.renderer,r.title,n);this._titles[t]=a,this.parent.node.replaceChild(a,i)}insertWidget(t,r){r.id||(r.id=`id-${V.UUID.uuid4()}`),super.insertWidget(t,r)}attachWidget(t,r){let i=e9.createTitle(this.renderer,r.title,!r.isHidden);N.ArrayExt.insert(this._titles,t,i),this.parent.node.appendChild(i),r.node.setAttribute("role","region"),r.node.setAttribute("aria-labelledby",i.id),super.attachWidget(t,r)}moveWidget(t,r,i){N.ArrayExt.move(this._titles,t,r),super.moveWidget(t,r,i)}detachWidget(t,r){let i=N.ArrayExt.removeAt(this._titles,t);this.parent.node.removeChild(i),super.detachWidget(t,r)}updateItemPosition(t,r,i,n,a,o,s){let l=this._titles[t].style;l.top=`${n}px`,l.left=`${i}px`,l.height=`${this.widgetOffset}px`,r?l.width=`${a}px`:l.width=`${o}px`,super.updateItemPosition(t,r,i,n,a,o,s)}};(e9||(e9={})).createTitle=function(t,r,i=!0){let n=t.createSectionTitle(r);return n.style.position="absolute",n.style.contain="strict",n.setAttribute("aria-label",`${r.label} Section`),n.setAttribute("aria-expanded",i?"true":"false"),n.setAttribute("aria-controls",r.owner.id),i&&n.classList.add("lm-mod-expanded"),n};var tt,tr=class extends e${constructor(t={}){super(),this.addClass("lm-Panel"),this.layout=tt.createLayout(t)}get widgets(){return this.layout.widgets}addWidget(t){this.layout.addWidget(t)}insertWidget(t,r){this.layout.insertWidget(t,r)}};(tt||(tt={})).createLayout=function(t){return t.layout||new e3};var ti=class extends tr{constructor(t={}){super({layout:tL.createLayout(t)}),this._handleMoved=new eo(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(t){this.layout.orientation=t}get alignment(){return this.layout.alignment}set alignment(t){this.layout.alignment=t}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(t,r=!0){this.layout.setRelativeSizes(t,r)}handleEvent(t){switch(t.type){case"pointerdown":this._evtPointerDown(t);break;case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("pointerdown",this)}onAfterDetach(t){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(t){t.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(t){t.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(t){this._pressData&&(t.preventDefault(),t.stopPropagation()),27===t.keyCode&&this._releaseMouse()}_evtPointerDown(t){if(0!==t.button)return;let r=this.layout,i=N.ArrayExt.findFirstIndex(r.handles,r=>r.contains(t.target));if(-1===i)return;t.preventDefault(),t.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let n,a=r.handles[i],o=a.getBoundingClientRect();n="horizontal"===r.orientation?t.clientX-o.left:t.clientY-o.top;let s=window.getComputedStyle(a),l=ec.overrideCursor(s.cursor);this._pressData={index:i,delta:n,override:l}}_evtPointerMove(t){t.preventDefault(),t.stopPropagation();let r,i=this.layout,n=this.node.getBoundingClientRect();r="horizontal"===i.orientation?t.clientX-n.left-this._pressData.delta:t.clientY-n.top-this._pressData.delta,i.moveHandle(this._pressData.index,r)}_evtPointerUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}},tn=ti||(ti={});class ta{createHandle(){let t=document.createElement("div");return t.className="lm-SplitPanel-handle",t}}tn.Renderer=ta,tn.defaultRenderer=new ta,tn.getStretch=function(t){return e4.getStretch(t)},tn.setStretch=function(t,r){e4.setStretch(t,r)},(tL||(tL={})).createLayout=function(t){return t.layout||new e4({renderer:t.renderer||ti.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})};var to=class extends ti{constructor(t={}){super({...t,layout:tP.createLayout(t)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new eo(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(t){this.layout.titleSpace=t}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(t){super.addWidget(t),t.title.changed.connect(this._onTitleChanged,this)}collapse(t){let r=this.layout.widgets[t];r&&!r.isHidden&&this._toggleExpansion(t)}expand(t){let r=this.layout.widgets[t];r&&r.isHidden&&this._toggleExpansion(t)}insertWidget(t,r){super.insertWidget(t,r),r.title.changed.connect(this._onTitleChanged,this)}handleEvent(t){switch(super.handleEvent(t),t.type){case"click":this._evtClick(t);break;case"keydown":this._eventKeyDown(t)}}onBeforeAttach(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(t)}onAfterDetach(t){super.onAfterDetach(t),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(t){let r=N.ArrayExt.findFirstIndex(this.widgets,r=>r.contains(t.owner));r>=0&&(this.layout.updateTitle(r,t.owner),this.update())}_computeWidgetSize(t){let r=this.layout,i=r.widgets[t];if(!i)return;let n=i.isHidden,a=r.absoluteSizes(),o=(n?-1:1)*this.spacing,s=a.reduce((t,r)=>t+r),l=[...a];if(n){let r=this._widgetSizesCache.get(i);if(!r)return;l[t]+=r;let n=l.map(t=>t-r>0).lastIndexOf(!0);-1===n?l.forEach((i,n)=>{n!==t&&(l[n]-=a[n]/s*(r-o))}):l[n]-=r-o}else{let r=a[t];this._widgetSizesCache.set(i,r),l[t]=0;let n=l.map(t=>t>0).lastIndexOf(!0);if(-1===n)return;l[n]=a[n]+r+o}return l.map(t=>t/(s+o))}_evtClick(t){let r=t.target;if(r){let i=N.ArrayExt.findFirstIndex(this.titles,t=>t.contains(r));i>=0&&(t.preventDefault(),t.stopPropagation(),this._toggleExpansion(i))}}_eventKeyDown(t){if(t.defaultPrevented)return;let r=t.target,i=!1;if(r){let n=N.ArrayExt.findFirstIndex(this.titles,t=>t.contains(r));if(n>=0){let a=t.keyCode.toString();if(t.key.match(/Space|Enter/)||a.match(/13|32/))r.click(),i=!0;else if("horizontal"===this.orientation?t.key.match(/ArrowLeft|ArrowRight/)||a.match(/37|39/):t.key.match(/ArrowUp|ArrowDown/)||a.match(/38|40/)){let r=t.key.match(/ArrowLeft|ArrowUp/)||a.match(/37|38/)?-1:1,o=this.titles.length;this.titles[(n+o+r)%o].focus(),i=!0}else"End"===t.key||"35"===a?(this.titles[this.titles.length-1].focus(),i=!0):("Home"===t.key||"36"===a)&&(this.titles[0].focus(),i=!0)}i&&t.preventDefault()}}_toggleExpansion(t){let r=this.titles[t],i=this.layout.widgets[t],n=this._computeWidgetSize(t);n&&this.setRelativeSizes(n,!1),i.isHidden?(r.classList.add("lm-mod-expanded"),r.setAttribute("aria-expanded","true"),i.show()):(r.classList.remove("lm-mod-expanded"),r.setAttribute("aria-expanded","false"),i.hide()),this._expansionToggled.emit(t)}},ts=to||(to={});class tl extends ti.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++tl._nInstance}createCollapseIcon(t){return document.createElement("span")}createSectionTitle(t){let r=document.createElement("h3");for(let i in r.setAttribute("tabindex","0"),r.id=this.createTitleKey(t),r.className=this.titleClassName,t.dataset)r.dataset[i]=t.dataset[i];r.appendChild(this.createCollapseIcon(t)).className="lm-AccordionPanel-titleCollapser";let i=r.appendChild(document.createElement("span"));return i.className="lm-AccordionPanel-titleLabel",i.textContent=t.label,i.title=t.caption||t.label,r}createTitleKey(t){let r=this._titleKeys.get(t);return void 0===r&&(r=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(t,r)),r}}tl._nInstance=0,ts.Renderer=tl,ts.defaultRenderer=new tl,(tP||(tP={})).createLayout=function(t){return t.layout||new te({renderer:t.renderer||to.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})};var tu=class t extends e3{constructor(t={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",void 0!==t.direction&&(this._direction=t.direction),void 0!==t.alignment&&(this._alignment=t.alignment),void 0!==t.spacing&&(this._spacing=e5.clampDimension(t.spacing))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(t){this._direction!==t&&(this._direction=t,this.parent&&(this.parent.dataset.direction=t,this.parent.fit()))}get alignment(){return this._alignment}set alignment(t){this._alignment!==t&&(this._alignment=t,this.parent&&(this.parent.dataset.alignment=t,this.parent.update()))}get spacing(){return this._spacing}set spacing(t){t=e5.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(t,r){N.ArrayExt.insert(this._items,t,new eQ(r)),N.ArrayExt.insert(this._sizers,t,new eG),this.parent.isAttached&&et.sendMessage(r,e$.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&et.sendMessage(r,e$.Msg.AfterAttach),this.parent.fit()}moveWidget(t,r,i){N.ArrayExt.move(this._items,t,r),N.ArrayExt.move(this._sizers,t,r),this.parent.update()}detachWidget(t,r){let i=N.ArrayExt.removeAt(this._items,t);N.ArrayExt.removeAt(this._sizers,t),this.parent.isAttached&&et.sendMessage(r,e$.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&et.sendMessage(r,e$.Msg.AfterDetach),i.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){let r=0;for(let t=0,i=this._items.length;t0)switch(this._alignment){case"start":break;case"center":u=0,c=l/2;break;case"end":u=0,c=l;break;case"justify":u=l/i,c=0;break;default:throw"unreachable"}for(let t=0,r=this._items.length;t0,coerce:(t,r)=>Math.max(0,Math.floor(r)),changed:th}),tc.sizeBasisProperty=new en({name:"sizeBasis",create:()=>0,coerce:(t,r)=>Math.max(0,Math.floor(r)),changed:th}),tc.isHorizontal=function(t){return"left-to-right"===t||"right-to-left"===t},tc.clampSpacing=function(t){return Math.max(0,Math.floor(t))};var td=class extends tr{constructor(t={}){super({layout:tF.createLayout(t)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(t){this.layout.direction=t}get alignment(){return this.layout.alignment}set alignment(t){this.layout.alignment=t}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}onChildAdded(t){t.child.addClass("lm-BoxPanel-child")}onChildRemoved(t){t.child.removeClass("lm-BoxPanel-child")}};(tC=td||(td={})).getStretch=function(t){return tu.getStretch(t)},tC.setStretch=function(t,r){tu.setStretch(t,r)},tC.getSizeBasis=function(t){return tu.getSizeBasis(t)},tC.setSizeBasis=function(t,r){tu.setSizeBasis(t,r)},(tF||(tF={})).createLayout=function(t){return t.layout||new tu(t)};var tf=class t extends e${constructor(r){super({node:tO.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(e$.Flag.DisallowLayout),this.commands=r.commands,this.renderer=r.renderer||t.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(t){let r=tO.createItem(this.commands,t);return this._items.push(r),this.refresh(),r}addItems(t){let r=t.map(t=>tO.createItem(this.commands,t));return r.forEach(t=>this._items.push(t)),this.refresh(),r}removeItem(t){this.removeItemAt(this._items.indexOf(t))}removeItemAt(t){N.ArrayExt.removeAt(this._items,t)&&this.refresh()}clearItems(){0!==this._items.length&&(this._items.length=0,this.refresh())}refresh(){(this._results=null,""!==this.inputNode.value)?this.node.getElementsByClassName("lm-close-icon")[0].style.display="inherit":this.node.getElementsByClassName("lm-close-icon")[0].style.display="none",this.update()}handleEvent(t){switch(t.type){case"click":this._evtClick(t);break;case"keydown":this._evtKeyDown(t);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused()}}onBeforeAttach(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(t){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(t){this.update(),super.onAfterShow(t)}onActivateRequest(t){if(this.isAttached){let t=this.inputNode;t.focus(),t.select()}}onUpdateRequest(t){if(!this.isVisible)return void eV.render(null,this.contentNode);let r=this.inputNode.value,i=this.contentNode,n=this._results;if(n||(n=this._results=tO.search(this._items,r),this._activeIndex=r?N.ArrayExt.findFirstIndex(n,tO.canActivate):-1),!r&&0===n.length)return void eV.render(null,i);if(r&&0===n.length){let t=this.renderer.renderEmptyMessage({query:r});eV.render(t,i);return}let a=this.renderer,o=this._activeIndex,s=Array(n.length);for(let t=0,r=n.length;t=n.length)i.scrollTop=0;else{let t=i.children[o];X.scrollIntoViewIfNeeded(i,t)}}_evtClick(t){if(0!==t.button)return;if(t.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let r=N.ArrayExt.findFirstIndex(this.contentNode.children,r=>r.contains(t.target));-1!==r&&(t.preventDefault(),t.stopPropagation(),this._execute(r))}_evtKeyDown(t){if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey))switch(t.keyCode){case 13:t.preventDefault(),t.stopPropagation(),this._execute(this._activeIndex);break;case 38:t.preventDefault(),t.stopPropagation(),this._activatePreviousItem();break;case 40:t.preventDefault(),t.stopPropagation(),this._activateNextItem()}}_activateNextItem(){if(!this._results||0===this._results.length)return;let t=this._activeIndex,r=this._results.length,i=tt-r),h=s.slice(0,c),d=s.slice(c);for(let t=0,r=d.length;ti.command===t&&V.JSONExt.deepEqual(i.args,r))||null}}var tx=class t extends e${constructor(r){super({node:tR.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new eo(this),this._menuRequested=new eo(this),this.addClass("lm-Menu"),this.setFlag(e$.Flag.DisallowLayout),this.commands=r.commands,this.renderer=r.renderer||t.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let t=this;for(;t._parentMenu;)t=t._parentMenu;return t}get leafMenu(){let t=this;for(;t._childMenu;)t=t._childMenu;return t}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(t){this.activeIndex=t?this._items.indexOf(t):-1}get activeIndex(){return this._activeIndex}set activeIndex(t){(t<0||t>=this._items.length)&&(t=-1),-1===t||tR.canActivate(this._items[t])||(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let t=this._items.length,r=this._activeIndex,i=r{this.activeIndex=t}})}eV.render(o,this.contentNode)}onCloseRequest(t){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let r=this._childMenu;r&&(this._childIndex=-1,this._childMenu=null,r._parentMenu=null,r.close());let i=this._parentMenu;i&&(this._parentMenu=null,i._childIndex=-1,i._childMenu=null,i.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(t)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation();let r=t.keyCode;if(13===r)return void this.triggerActiveItem();if(27===r)return void this.close();if(37===r)return void(this._parentMenu?this.close():this._menuRequested.emit("previous"));if(38===r)return void this.activatePreviousItem();if(39===r){let t=this.activeItem;t&&"submenu"===t.type?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(40===r)return void this.activateNextItem();let i=em().keyForKeydownEvent(t);if(!i)return;let n=this._activeIndex+1,a=tR.findMnemonic(this._items,i,n);-1===a.index||a.multiple?-1!==a.index?this.activeIndex=a.index:-1!==a.auto&&(this.activeIndex=a.auto):(this.activeIndex=a.index,this.triggerActiveItem())}_evtPointerUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this.triggerActiveItem())}_evtPointerMove(t){let r=N.ArrayExt.findFirstIndex(this.contentNode.children,r=>X.hitTest(r,t.clientX,t.clientY));if(r===this._activeIndex)return;if(this.activeIndex=r,(r=this.activeIndex)===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}-1!==this._childIndex&&this._startCloseTimer(),this._cancelOpenTimer();let i=this.activeItem;i&&"submenu"===i.type&&i.submenu&&this._startOpenTimer()}_evtPointerEnter(t){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtPointerLeave(t){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:r,clientY:i}=t;X.hitTest(this._childMenu.node,r,i)?this._cancelCloseTimer():(this.activeIndex=-1,this._startCloseTimer())}_evtPointerDown(t){this._parentMenu||(tR.hitTestMenus(this,t.clientX,t.clientY)?(t.preventDefault(),t.stopPropagation()):this.close())}_openChildMenu(r=!1){let i=this.activeItem;if(!i||"submenu"!==i.type||!i.submenu)return void this._closeChildMenu();let n=i.submenu;if(n===this._childMenu)return;t.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,et.sendMessage(this,e$.Msg.UpdateRequest);let a=this.contentNode.children[this._activeIndex];tR.openSubmenu(n,a),r&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){0===this._openTimerID&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},tR.TIMER_DELAY))}_startCloseTimer(){0===this._closeTimerID&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},tR.TIMER_DELAY))}_cancelOpenTimer(){0!==this._openTimerID&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){0!==this._closeTimerID&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){tR.saveWindowData()}},tb=tx||(tx={});class t_{renderItem(t){let r=this.createItemClass(t),i=this.createItemDataset(t),n=this.createItemARIA(t);return ez.li({className:r,dataset:i,tabindex:"0",onfocus:t.onfocus,...n},this.renderIcon(t),this.renderLabel(t),this.renderShortcut(t),this.renderSubmenu(t))}renderIcon(t){let r=this.createIconClass(t);return ez.div({className:r},t.item.icon,t.item.iconLabel)}renderLabel(t){let r=this.formatLabel(t);return ez.div({className:"lm-Menu-itemLabel"},r)}renderShortcut(t){let r=this.formatShortcut(t);return ez.div({className:"lm-Menu-itemShortcut"},r)}renderSubmenu(t){return ez.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(t){let r="lm-Menu-item";t.item.isEnabled||(r+=" lm-mod-disabled"),t.item.isToggled&&(r+=" lm-mod-toggled"),t.item.isVisible||(r+=" lm-mod-hidden"),t.active&&(r+=" lm-mod-active"),t.collapsed&&(r+=" lm-mod-collapsed");let i=t.item.className;return i&&(r+=` ${i}`),r}createItemDataset(t){let{type:r,command:i,dataset:n}=t.item;return"command"===r?{...n,type:r,command:i}:{...n,type:r}}createIconClass(t){let r="lm-Menu-itemIcon",i=t.item.iconClass;return i?`${r} ${i}`:r}createItemARIA(t){let r={};switch(t.item.type){case"separator":r.role="presentation";break;case"submenu":r["aria-haspopup"]="true",t.item.isEnabled||(r["aria-disabled"]="true");break;default:t.item.isEnabled||(r["aria-disabled"]="true"),t.item.isToggled?(r.role="menuitemcheckbox",r["aria-checked"]="true"):r.role="menuitem"}return r}formatLabel(t){let{label:r,mnemonic:i}=t.item;if(i<0||i>=r.length)return r;let n=r.slice(0,i),a=r.slice(i+1),o=r[i];return[n,ez.span({className:"lm-Menu-itemMnemonic"},o),a]}formatShortcut(t){let r=t.item.keyBinding;return r?eS.formatKeystroke(r.keys):null}}tb.Renderer=t_,tb.defaultRenderer=new t_,function(t){t.TIMER_DELAY=300,t.SUBMENU_OVERLAP=3;let r=null,i=0;function n(){return i>0?(i--,r):o()}function a(t){return"separator"!==t.type&&t.isEnabled&&t.isVisible}function o(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}t.saveWindowData=function(){r=o(),i++},t.createNode=function(){let t=document.createElement("div"),r=document.createElement("ul");return r.className="lm-Menu-content",t.appendChild(r),r.setAttribute("role","menu"),t.tabIndex=0,t},t.canActivate=a,t.createItem=function(t,r){return new s(t.commands,r)},t.hitTestMenus=function(t,r,i){for(let n=t;n;n=n.childMenu)if(X.hitTest(n.node,r,i))return!0;return!1},t.computeCollapsed=function(t){let r=Array(t.length);N.ArrayExt.fill(r,!1);let i=0,n=t.length;for(;i=0;--a){let i=t[a];if(i.isVisible){if("separator"!==i.type)break;r[a]=!0}}let o=!1;for(;++ih+f&&(r=h+f-v),!o&&i+x>d+p&&(i>d+p?i=d+p-x:i-=x),y.transform=`translate(${Math.max(0,r)}px, ${Math.max(0,i)}px`,y.opacity="1"},t.openSubmenu=function(r,i){let a=n(),o=a.pageXOffset,s=a.pageYOffset,l=a.clientWidth,u=a.clientHeight;et.sendMessage(r,e$.Msg.UpdateRequest);let c=r.node,h=c.style;h.opacity="0",h.maxHeight=`${u}px`,e$.attach(r,document.body);let{width:d,height:f}=c.getBoundingClientRect(),p=X.boxSizing(r.node),m=i.getBoundingClientRect(),g=m.right-t.SUBMENU_OVERLAP;g+d>o+l&&(g=m.left+t.SUBMENU_OVERLAP-d);let y=m.top-p.borderTop-p.paddingTop;y+f>s+u&&(y=m.bottom+p.borderBottom+p.paddingBottom-f),h.transform=`translate(${Math.max(0,g)}px, ${Math.max(0,y)}px`,h.opacity="1"},t.findMnemonic=function(t,r,i){let n=-1,o=-1,s=!1,l=r.toUpperCase();for(let r=0,u=t.length;r=0&&fi.command===t&&V.JSONExt.deepEqual(i.args,r))||null}return null}}}(tR||(tR={}));var tw=tB||(tB={});function tT(t,r){let i=t.rank,n=r.rank;return i!==n?i=this._titles.length)&&(t=-1),this._currentIndex===t)return;let r=this._currentIndex,i=this._titles[r]||null,n=t,a=this._titles[n]||null;this._currentIndex=n,this._previousTitle=i,this.update(),this._currentChanged.emit({previousIndex:r,previousTitle:i,currentIndex:n,currentTitle:a})}get name(){return this._name}set name(t){this._name=t,t?this.contentNode.setAttribute("aria-label",t):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(t){this._orientation!==t&&(this._releaseMouse(),this._orientation=t,this.dataset.orientation=t,this.contentNode.setAttribute("aria-orientation",t))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(t){this._addButtonEnabled!==t&&(this._addButtonEnabled=t,t?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(t){return this.insertTab(this._titles.length,t)}insertTab(t,r){this._releaseMouse();let i=tj.asTitle(r),n=this._titles.indexOf(i),a=Math.max(0,Math.min(t,this._titles.length));return -1===n?(N.ArrayExt.insert(this._titles,a,i),i.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(a,i)):(a===this._titles.length&&a--,n===a||(N.ArrayExt.move(this._titles,n,a),this.update(),this._adjustCurrentForMove(n,a))),i}removeTab(t){this.removeTabAt(this._titles.indexOf(t))}removeTabAt(t){let r=t>=0&&t-1?this._currentIndex:0;for(let t=0,r=i.length;tX.hitTest(r,t.clientX,t.clientY));if(-1===i)return;let n=this.titles[i],a=r[i].querySelector(".lm-TabBar-tabLabel");if(a&&a.contains(t.target)){let t=n.label||"",r=a.innerHTML;a.innerHTML="";let i=document.createElement("input");i.classList.add("lm-TabBar-tabInput"),i.value=t,a.appendChild(i);let o=()=>{i.removeEventListener("blur",o),a.innerHTML=r,this.node.addEventListener("keydown",this)};i.addEventListener("dblclick",t=>t.stopPropagation()),i.addEventListener("blur",o),i.addEventListener("keydown",t=>{"Enter"===t.key?(""!==i.value&&(n.label=n.caption=i.value),o()):"Escape"===t.key&&o()}),this.node.removeEventListener("keydown",this),i.select(),i.focus(),a.children.length>0&&a.children[0].focus()}}_evtKeyDownCapturing(t){t.eventPhase===Event.CAPTURING_PHASE&&(t.preventDefault(),t.stopPropagation(),"Escape"===t.key&&this._releaseMouse())}_evtKeyDown(t){var r,i,n;if("Tab"!==t.key&&t.eventPhase!==Event.CAPTURING_PHASE){if("Enter"===t.key||"Spacebar"===t.key||" "===t.key){let r=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(r))t.preventDefault(),t.stopPropagation(),this._addRequested.emit();else{let i=N.ArrayExt.findFirstIndex(this.contentNode.children,t=>t.contains(r));i>=0&&(t.preventDefault(),t.stopPropagation(),this.currentIndex=i)}}else if(tM.includes(t.key)){let a,o=[...this.contentNode.children];if(this.addButtonEnabled&&o.push(this.addButtonNode),o.length<=1)return;t.preventDefault(),t.stopPropagation();let s=o.indexOf(document.activeElement);-1===s&&(s=this._currentIndex),"ArrowRight"===t.key&&"horizontal"===this._orientation||"ArrowDown"===t.key&&"vertical"===this._orientation?a=null!=(r=o[s+1])?r:o[0]:"ArrowLeft"===t.key&&"horizontal"===this._orientation||"ArrowUp"===t.key&&"vertical"===this._orientation?a=null!=(i=o[s-1])?i:o[o.length-1]:"Home"===t.key?a=o[0]:"End"===t.key&&(a=o[o.length-1]),a&&(null==(n=o[s])||n.setAttribute("tabindex","-1"),a?.setAttribute("tabindex","0"),a.focus())}}}_evtPointerDown(t){if(0!==t.button&&1!==t.button||this._dragData||t.target.classList.contains("lm-TabBar-tabInput"))return;let r=this.addButtonEnabled&&this.addButtonNode.contains(t.target),i=this.contentNode.children,n=N.ArrayExt.findFirstIndex(i,r=>X.hitTest(r,t.clientX,t.clientY));if(-1===n&&!r||(t.preventDefault(),t.stopPropagation(),this._dragData={tab:i[n],index:n,pressX:t.clientX,pressY:t.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),1===t.button||r))return;let a=i[n].querySelector(this.renderer.closeIconSelector);a&&a.contains(t.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===n?this.currentIndex=-1:this.currentIndex=n,-1!==this.currentIndex&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(t){let r=this._dragData;if(!r)return;t.preventDefault(),t.stopPropagation();let i=this.contentNode.children;if(!(!r.dragActive&&!tj.dragExceeded(r,t))){if(!r.dragActive){let t=r.tab.getBoundingClientRect();"horizontal"===this._orientation?(r.tabPos=r.tab.offsetLeft,r.tabSize=t.width,r.tabPressPos=r.pressX-t.left):(r.tabPos=r.tab.offsetTop,r.tabSize=t.height,r.tabPressPos=r.pressY-t.top),r.tabPressOffset={x:r.pressX-t.left,y:r.pressY-t.top},r.tabLayout=tj.snapTabLayout(i,this._orientation),r.contentRect=this.contentNode.getBoundingClientRect(),r.override=ec.overrideCursor("default"),r.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),r.dragActive=!0}if(!r.detachRequested&&tj.detachExceeded(r,t)){r.detachRequested=!0;let n=r.index,a=t.clientX,o=t.clientY,s=i[n],l=this._titles[n];if(this._tabDetachRequested.emit({index:n,title:l,tab:s,clientX:a,clientY:o,offset:r.tabPressOffset}),r.dragAborted)return}tj.layoutTabs(i,r,t,this._orientation)}}_evtPointerUp(t){if(0!==t.button&&1!==t.button)return;let r=this._dragData;if(r){if(t.preventDefault(),t.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!r.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(t.target))return void this._addRequested.emit(void 0);let i=this.contentNode.children,n=N.ArrayExt.findFirstIndex(i,r=>X.hitTest(r,t.clientX,t.clientY));if(n!==r.index)return;let a=this._titles[n];if(!a.closable)return;if(1===t.button)return void this._tabCloseRequested.emit({index:n,title:a});let o=i[n].querySelector(this.renderer.closeIconSelector);return void(o&&o.contains(t.target)&&(this._tabSizeFrozen=!0,this._tabCloseRequested.emit({index:n,title:a})))}0!==t.button||(tj.finalizeTabPosition(r,this._orientation),r.tab.classList.remove("lm-mod-dragging"),setTimeout(()=>{if(r.dragAborted)return;this._dragData=null,tj.resetTabPositions(this.contentNode.children,this._orientation),r.override.dispose(),this.removeClass("lm-mod-dragging");let t=r.index,i=r.targetIndex;-1===i||t===i||(N.ArrayExt.move(this._titles,t,i),this._adjustCurrentForMove(t,i),this._tabMoved.emit({fromIndex:t,toIndex:i,title:this._titles[i]}),et.sendMessage(this,e$.Msg.UpdateRequest))},tj.parseTransitionDuration(r.tab)))}}_releaseMouse(){let t=this._dragData;t&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),t.dragAborted=!0,t.dragActive&&(tj.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),t.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(t,r){let i=this.currentTitle,n=this._currentIndex,a=this.insertBehavior;if("select-tab"===a||"select-tab-if-needed"===a&&-1===n){this._currentIndex=t,this._previousTitle=i,this._currentChanged.emit({previousIndex:n,previousTitle:i,currentIndex:t,currentTitle:r});return}n>=t&&this._currentIndex++}_adjustCurrentForMove(t,r){this._currentIndex===t?this._currentIndex=r:this._currentIndex=r?this._currentIndex++:this._currentIndex>t&&this._currentIndex<=r&&this._currentIndex--}_adjustCurrentForRemove(t,r){let i=this._currentIndex,n=this.removeBehavior;if(i!==t){i>t&&this._currentIndex--;return}if(0===this._titles.length){this._currentIndex=-1,this._currentChanged.emit({previousIndex:t,previousTitle:r,currentIndex:-1,currentTitle:null});return}if("select-tab-after"===n){this._currentIndex=Math.min(t,this._titles.length-1),this._currentChanged.emit({previousIndex:t,previousTitle:r,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if("select-tab-before"===n){this._currentIndex=Math.max(0,t-1),this._currentChanged.emit({previousIndex:t,previousTitle:r,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if("select-previous-tab"===n){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(t,this._titles.length-1),this._currentChanged.emit({previousIndex:t,previousTitle:r,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:t,previousTitle:r,currentIndex:-1,currentTitle:null})}_onTitleChanged(t){this.update()}_evtPointerLeave(t){if(!this._tabSizeFrozen)return;this._tabSizeFrozen=!1,this._frozenTabWidths=null,this._unfreezeRunID++;let r=this._unfreezeRunID;this._clearUnfreezeTransitionState(),this.addClass("lm-mod-unfreezing");let i=this.contentNode.children;for(let t=0,r=i.length;t{let i=t.propertyName;("width"===i||"flex-basis"===i)&&this._finalizeUnfreezeRun(r)};this._unfreezeTransitionListener=t,this.node.addEventListener("transitionend",t),this.node.addEventListener("transitioncancel",t),this._unfreezeFallbackTimerID=window.setTimeout(()=>{this._finalizeUnfreezeRun(r)},2e3)}this.update()}_setFrozenTabSize(t,r){let i=`${r}px`;t.style.width=i,t.style.flexBasis=i}_finalizeUnfreezeRun(t){t===this._unfreezeRunID&&(this._clearUnfreezeTransitionState(),this.removeClass("lm-mod-unfreezing"))}_clearUnfreezeTransitionState(){this._unfreezeTransitionListener&&(this.node.removeEventListener("transitionend",this._unfreezeTransitionListener),this.node.removeEventListener("transitioncancel",this._unfreezeTransitionListener),this._unfreezeTransitionListener=null),0!==this._unfreezeFallbackTimerID&&(clearTimeout(this._unfreezeFallbackTimerID),this._unfreezeFallbackTimerID=0)}_clearTabSizeFreezeState(){this._tabSizeFrozen=!1,this._frozenTabWidths=null,this.removeClass("lm-mod-unfreezing");let t=this.contentNode.children;for(let r=0,i=t.length;r=tI.DRAG_THRESHOLD||n>=tI.DRAG_THRESHOLD},tI.detachExceeded=function(t,r){let i=t.contentRect;return r.clientX=i.right+tI.DETACH_THRESHOLD||r.clientY=i.bottom+tI.DETACH_THRESHOLD},tI.layoutTabs=function(t,r,i,n){let a,o,s,l;"horizontal"===n?(a=r.pressX,o=i.clientX-r.contentRect.left,s=i.clientX,l=r.contentRect.width):(a=r.pressY,o=i.clientY-r.contentRect.top,s=i.clientY,l=r.contentRect.height);let u=r.index,c=o-r.tabPressPos,h=c+r.tabSize;for(let i=0,o=t.length;i>1);if(ir.index&&h>f)o=`${-r.tabSize-d.margin}px`,u=Math.max(u,i);else if(i===r.index){let t=s-a,i=l-(r.tabPos+r.tabSize);o=`${Math.max(-r.tabPos,Math.min(t,i))}px`}else o="";"horizontal"===n?t[i].style.left=o:t[i].style.top=o}r.targetIndex=u},tI.finalizeTabPosition=function(t,r){let i,n;if(i="horizontal"===r?t.contentRect.width:t.contentRect.height,t.targetIndex===t.index)n=0;else if(t.targetIndex>t.index){let r=t.tabLayout[t.targetIndex];n=r.pos+r.size-t.tabSize-t.tabPos}else n=t.tabLayout[t.targetIndex].pos-t.tabPos;let a=i-(t.tabPos+t.tabSize),o=Math.max(-t.tabPos,Math.min(n,a));"horizontal"===r?t.tab.style.left=`${o}px`:t.tab.style.top=`${o}px`},tI.resetTabPositions=function(t,r){for(let i of t)"horizontal"===r?i.style.left="":i.style.top=""};var tD,tC,tI,tL,tP,tz,tF,tO,tR,tB,tj,tN,tV=class extends eW{constructor(t){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=t.renderer,void 0!==t.spacing&&(this._spacing=e5.clampDimension(t.spacing)),this._document=t.document||document,this._hiddenMode=void 0!==t.hiddenMode?t.hiddenMode:e$.HiddenMode.Display}dispose(){let t=this[Symbol.iterator]();for(let r of(this._items.forEach(t=>{t.dispose()}),this._box=null,this._root=null,this._items.clear(),t))r.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(t){if(this._hiddenMode!==t){for(let r of(this._hiddenMode=t,this.tabBars()))if(r.titles.length>1)for(let t of r.titles)t.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(t){t=e5.clampDimension(t),this._spacing!==t&&(this._spacing=t,this.parent&&this.parent.fit())}get isEmpty(){return null===this._root}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,N.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,N.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,N.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,N.empty)()}handles(){return this._root?this._root.iterHandles():(0,N.empty)()}moveHandle(t,r,i){let n,a=t.classList.contains("lm-mod-hidden");if(!this._root||a)return;let o=this._root.findSplitNode(t);o&&0!=(n="horizontal"===o.node.orientation?r-t.offsetLeft:i-t.offsetTop)&&(o.node.holdSizes(),eq.adjust(o.node.sizers,o.index,n),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(t){let r=new Set,i;i=t.main?tN.normalizeAreaConfig(t.main,r):null;let n=this.widgets(),a=this.tabBars(),o=this.handles();for(let t of(this._root=null,n))r.has(t)||(t.parent=null);for(let t of a)t.dispose();for(let t of o)t.parentNode&&t.parentNode.removeChild(t);for(let t of r)t.parent=this.parent;i?this._root=tN.realizeAreaConfig(i,{createTabBar:t=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(r.forEach(t=>{this.attachWidget(t)}),this.parent.fit())}addWidget(t,r={}){let i=r.ref||null,n=r.mode||"tab-after",a=null;if(this._root&&i&&(a=this._root.findTabNode(i)),i&&!a)throw Error("Reference widget is not in the layout.");switch(t.parent=this.parent,n){case"tab-after":this._insertTab(t,i,a,!0);break;case"tab-before":this._insertTab(t,i,a,!1);break;case"split-top":this._insertSplit(t,i,a,"vertical",!1);break;case"split-left":this._insertSplit(t,i,a,"horizontal",!1);break;case"split-right":this._insertSplit(t,i,a,"horizontal",!0);break;case"split-bottom":this._insertSplit(t,i,a,"vertical",!0);break;case"merge-top":this._insertSplit(t,i,a,"vertical",!1,!0);break;case"merge-left":this._insertSplit(t,i,a,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(t,i,a,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(t,i,a,"vertical",!0,!0)}this.parent&&(this.attachWidget(t),this.parent.fit())}removeWidget(t){this._removeWidget(t),this.parent&&(this.detachWidget(t),this.parent.fit())}hitTestTabAreas(t,r){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=X.boxSizing(this.parent.node));let i=this.parent.node.getBoundingClientRect(),n=t-i.left-this._box.borderLeft,a=r-i.top-this._box.borderTop,o=this._root.hitTestTabNodes(n,a);if(!o)return null;let{tabBar:s,top:l,left:u,width:c,height:h}=o,d=this._box.borderLeft+this._box.borderRight,f=this._box.borderTop+this._box.borderBottom,p=i.width-d-(u+c),m=i.height-f-(l+h);return{tabBar:s,x:n,y:a,top:l,left:u,right:p,bottom:m,width:c,height:h}}init(){for(let t of(super.init(),this))this.attachWidget(t);for(let t of this.handles())this.parent.node.appendChild(t);this.parent.fit()}attachWidget(t){this.parent.node!==t.node.parentNode&&(this._items.set(t,new eQ(t)),this.parent.isAttached&&et.sendMessage(t,e$.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&et.sendMessage(t,e$.Msg.AfterAttach))}detachWidget(t){if(this.parent.node!==t.node.parentNode)return;this.parent.isAttached&&et.sendMessage(t,e$.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&et.sendMessage(t,e$.Msg.AfterDetach);let r=this._items.get(t);r&&(this._items.delete(t),r.dispose())}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_removeWidget(t){if(!this._root)return;let r=this._root.findTabNode(t);if(!r)return;if(tN.removeAria(t),r.tabBar.titles.length>1){r.tabBar.removeTab(t.title),this._hiddenMode===e$.HiddenMode.Scale&&1==r.tabBar.titles.length&&(r.tabBar.titles[0].owner.hiddenMode=e$.HiddenMode.Display);return}if(r.tabBar.dispose(),this._root===r){this._root=null;return}this._root.holdAllSizes();let i=r.parent;r.parent=null;let n=N.ArrayExt.removeFirstOf(i.children,r),a=N.ArrayExt.removeAt(i.handles,n);if(N.ArrayExt.removeAt(i.sizers,n),a.parentNode&&a.parentNode.removeChild(a),i.children.length>1)return void i.syncHandles();let o=i.parent;i.parent=null;let s=i.children[0],l=i.handles[0];if(i.children.length=0,i.handles.length=0,i.sizers.length=0,l.parentNode&&l.parentNode.removeChild(l),this._root===i){s.parent=null,this._root=s;return}let u=o.children.indexOf(i);if(s instanceof tN.TabLayoutNode){s.parent=o,o.children[u]=s;return}let c=N.ArrayExt.removeAt(o.handles,u);N.ArrayExt.removeAt(o.children,u),N.ArrayExt.removeAt(o.sizers,u),c.parentNode&&c.parentNode.removeChild(c);for(let t=0,r=s.children.length;t=i.length)&&(n=0),{type:"tab-area",widgets:i,currentIndex:n}}(r,i):function(r,i){let n=r.orientation,a=[],o=[];for(let s=0,l=r.children.length;s{let n=a(t,c,h),o=r(u.sizes[i]),s=c.createHandle();d.children.push(n),d.handles.push(s),d.sizers.push(o),n.parent=d}),d.syncHandles(),d.normalizeSizes(),d)};class i{constructor(t){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let r=new eG,i=new eG;r.stretch=0,i.stretch=1,this.tabBar=t,this.sizers=[r,i]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}*iterUserWidgets(){for(let t of this.tabBar.titles)yield t.owner}*iterSelectedWidgets(){let t=this.tabBar.currentTitle;t&&(yield t.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(t){return -1!==this.tabBar.titles.indexOf(t.title)?this:null}findSplitNode(t){return null}findFirstTabNode(){return this}hitTestTabNodes(t,r){return t=this._left+this._width||r=this._top+this._height?null:this}createConfig(){return{type:"tab-area",widgets:this.tabBar.titles.map(t=>t.owner),currentIndex:this.tabBar.currentIndex}}holdAllSizes(){}fit(t,r){let i=0,n=0,a=r.get(this.tabBar),o=this.tabBar.currentTitle,s=o?r.get(o.owner):void 0,[l,u]=this.sizers;return a&&a.fit(),s&&s.fit(),a&&!a.isHidden?(i=Math.max(i,a.minWidth),n+=a.minHeight,l.minSize=a.minHeight,l.maxSize=a.maxHeight):(l.minSize=0,l.maxSize=0),s&&!s.isHidden?(i=Math.max(i,s.minWidth),n+=s.minHeight,u.minSize=s.minHeight):u.minSize=0,u.maxSize=1/0,{minWidth:i,minHeight:n,maxWidth:1/0,maxHeight:1/0}}update(t,r,i,n,a,o){this._top=r,this._left=t,this._width=i,this._height=n;let s=o.get(this.tabBar),l=this.tabBar.currentTitle,u=l?o.get(l.owner):void 0;if(eq.calc(this.sizers,n),s&&!s.isHidden){let n=this.sizers[0].size;s.update(t,r,i,n),r+=n}if(u&&!u.isHidden){let n=this.sizers[1].size;u.update(t,r,i,n)}}}t.TabLayoutNode=i;class n{constructor(t){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=t}*iterAllWidgets(){for(let t of this.children)yield*t.iterAllWidgets()}*iterUserWidgets(){for(let t of this.children)yield*t.iterUserWidgets()}*iterSelectedWidgets(){for(let t of this.children)yield*t.iterSelectedWidgets()}*iterTabBars(){for(let t of this.children)yield*t.iterTabBars()}*iterHandles(){for(let t of(yield*this.handles,this.children))yield*t.iterHandles()}findTabNode(t){for(let r=0,i=this.children.length;rt.createConfig()),sizes:r}}syncHandles(){this.handles.forEach((t,r)=>{t.setAttribute("data-orientation",this.orientation),r===this.handles.length-1?t.classList.add("lm-mod-hidden"):t.classList.remove("lm-mod-hidden")})}holdSizes(){for(let t of this.sizers)t.sizeHint=t.size}holdAllSizes(){for(let t of this.children)t.holdAllSizes();this.holdSizes()}normalizeSizes(){let t=this.sizers.length;if(0===t)return;this.holdSizes();let r=this.sizers.reduce((t,r)=>t+r.sizeHint,0);if(0===r)for(let r of this.sizers)r.size=r.sizeHint=1/t;else for(let t of this.sizers)t.size=t.sizeHint/=r;this.normalized=!0}createNormalizedSizes(){let t=this.sizers.length;if(0===t)return[];let r=this.sizers.map(t=>t.size),i=r.reduce((t,r)=>t+r,0);if(0===i)for(let i=r.length-1;i>-1;i--)r[i]=1/t;else for(let t=r.length-1;t>-1;t--)r[t]/=i;return r}fit(t,r){let i="horizontal"===this.orientation,n=Math.max(0,this.children.length-1)*t,a=i?n:0,o=i?0:n;for(let n=0,s=this.children.length;nthis._createTabBar(),createHandle:()=>this._createHandle()},spacing:r.spacing,hiddenMode:r.hiddenMode}),this.overlay=r.overlay||new t.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(t){this.layout.hiddenMode=t}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(t){this.layout.spacing=t}get mode(){return this._mode}set mode(t){if(this._mode===t)return;this._mode=t,this.dataset.mode=t;let r=this.layout;switch(t){case"multiple-document":for(let t of r.tabBars())t.show();break;case"single-document":r.restoreLayout(w.createSingleDocumentConfig(this));break;default:throw"unreachable"}et.postMessage(this,w.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(t){for(let r of(this._tabsMovable=t,this.tabBars()))r.tabsMovable=t}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(t){this._tabsConstrained=t}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(t){for(let r of(this._addButtonEnabled=t,this.tabBars()))r.addButtonEnabled=t}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(t){let r=(0,N.find)(this.tabBars(),r=>-1!==r.titles.indexOf(t.title));if(!r)throw Error("Widget is not contained in the dock panel.");r.currentTitle=t.title}activateWidget(t){this.selectWidget(t),t.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(t){this._mode="multiple-document",this.layout.restoreLayout(t),(K.IS_EDGE||K.IS_IE)&&et.flush(),et.postMessage(this,w.LayoutModified)}addWidget(t,r={}){"single-document"===this._mode?this.layout.addWidget(t):this.layout.addWidget(t,r),et.postMessage(this,w.LayoutModified)}processMessage(t){"layout-modified"===t.type?this._layoutModified.emit(void 0):super.processMessage(t)}handleEvent(t){switch(t.type){case"lm-dragenter":this._evtDragEnter(t);break;case"lm-dragleave":this._evtDragLeave(t);break;case"lm-dragover":this._evtDragOver(t);break;case"lm-drop":this._evtDrop(t);break;case"pointerdown":this._evtPointerDown(t);break;case"pointermove":this._evtPointerMove(t);break;case"pointerup":this._evtPointerUp(t);break;case"keydown":this._evtKeyDown(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(t){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(t){w.isGeneratedTabBarProperty.get(t.child)||t.child.addClass("lm-DockPanel-widget")}onChildRemoved(t){w.isGeneratedTabBarProperty.get(t.child)||(t.child.removeClass("lm-DockPanel-widget"),et.postMessage(this,w.LayoutModified))}_evtDragEnter(t){t.mimeData.hasData("application/vnd.lumino.widget-factory")&&(t.preventDefault(),t.stopPropagation())}_evtDragLeave(t){t.preventDefault(),this._tabsConstrained&&t.source!==this||(t.stopPropagation(),this.overlay.hide(1))}_evtDragOver(t){t.preventDefault(),this._tabsConstrained&&t.source!==this||"invalid"===this._showOverlay(t.clientX,t.clientY)?t.dropAction="none":(t.stopPropagation(),t.dropAction=t.proposedAction)}_evtDrop(t){if(t.preventDefault(),this.overlay.hide(0),"none"===t.proposedAction){t.dropAction="none";return}let{clientX:r,clientY:i}=t,{zone:n,target:a}=w.findDropTarget(this,r,i,this._edges);if(this._tabsConstrained&&t.source!==this||"invalid"===n){t.dropAction="none";return}let o=t.mimeData.getData("application/vnd.lumino.widget-factory");if("function"!=typeof o){t.dropAction="none";return}let s=o();if(!(s instanceof e$)||s.contains(this)){t.dropAction="none";return}let l=a?w.getDropRef(a.tabBar):null;switch(n){case"root-all":this.addWidget(s);break;case"root-top":this.addWidget(s,{mode:"split-top"});break;case"root-left":this.addWidget(s,{mode:"split-left"});break;case"root-right":this.addWidget(s,{mode:"split-right"});break;case"root-bottom":this.addWidget(s,{mode:"split-bottom"});break;case"widget-all":case"widget-tab":this.addWidget(s,{mode:"tab-after",ref:l});break;case"widget-top":this.addWidget(s,{mode:"split-top",ref:l});break;case"widget-left":this.addWidget(s,{mode:"split-left",ref:l});break;case"widget-right":this.addWidget(s,{mode:"split-right",ref:l});break;case"widget-bottom":this.addWidget(s,{mode:"split-bottom",ref:l});break;default:throw"unreachable"}t.dropAction=t.proposedAction,t.stopPropagation(),this.activateWidget(s)}_evtKeyDown(t){t.preventDefault(),t.stopPropagation(),27===t.keyCode&&(this._releaseMouse(),et.postMessage(this,w.LayoutModified))}_evtPointerDown(t){if(0!==t.button)return;let r=this.layout,i=t.target,n=(0,N.find)(r.handles(),t=>t.contains(i));if(!n)return;t.preventDefault(),t.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let a=n.getBoundingClientRect(),o=t.clientX-a.left,s=t.clientY-a.top,l=window.getComputedStyle(n),u=ec.overrideCursor(l.cursor,this._document);this._pressData={handle:n,deltaX:o,deltaY:s,override:u}}_evtPointerMove(t){if(!this._pressData)return;t.preventDefault(),t.stopPropagation();let r=this.node.getBoundingClientRect(),i=t.clientX-r.left-this._pressData.deltaX,n=t.clientY-r.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,i,n)}_evtPointerUp(t){0===t.button&&(t.preventDefault(),t.stopPropagation(),this._releaseMouse(),et.postMessage(this,w.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(t,r){let{zone:i,target:n}=w.findDropTarget(this,t,r,this._edges);if("invalid"===i)return this.overlay.hide(100),i;let a,o,s,l,u=X.boxSizing(this.node),c=this.node.getBoundingClientRect();switch(i){case"root-all":a=u.paddingTop,o=u.paddingLeft,s=u.paddingRight,l=u.paddingBottom;break;case"root-top":a=u.paddingTop,o=u.paddingLeft,s=u.paddingRight,l=c.height*w.GOLDEN_RATIO;break;case"root-left":a=u.paddingTop,o=u.paddingLeft,s=c.width*w.GOLDEN_RATIO,l=u.paddingBottom;break;case"root-right":a=u.paddingTop,o=c.width*w.GOLDEN_RATIO,s=u.paddingRight,l=u.paddingBottom;break;case"root-bottom":a=c.height*w.GOLDEN_RATIO,o=u.paddingLeft,s=u.paddingRight,l=u.paddingBottom;break;case"widget-all":a=n.top,o=n.left,s=n.right,l=n.bottom;break;case"widget-top":a=n.top,o=n.left,s=n.right,l=n.bottom+n.height/2;break;case"widget-left":a=n.top,o=n.left,s=n.right+n.width/2,l=n.bottom;break;case"widget-right":a=n.top,o=n.left+n.width/2,s=n.right,l=n.bottom;break;case"widget-bottom":a=n.top+n.height/2,o=n.left,s=n.right,l=n.bottom;break;case"widget-tab":{let t=n.tabBar.node.getBoundingClientRect().height;a=n.top,o=n.left,s=n.right,l=n.bottom+n.height-t;break}default:throw"unreachable"}return this.overlay.show({top:a,left:o,right:s,bottom:l}),i}_createTabBar(){let t=this._renderer.createTabBar(this._document);return w.isGeneratedTabBarProperty.set(t,!0),"single-document"===this._mode&&t.hide(),t.tabsMovable=this._tabsMovable,t.allowDeselect=!1,t.addButtonEnabled=this._addButtonEnabled,t.removeBehavior="select-previous-tab",t.insertBehavior="select-tab-if-needed",t.tabMoved.connect(this._onTabMoved,this),t.currentChanged.connect(this._onCurrentChanged,this),t.tabCloseRequested.connect(this._onTabCloseRequested,this),t.tabDetachRequested.connect(this._onTabDetachRequested,this),t.tabActivateRequested.connect(this._onTabActivateRequested,this),t.addRequested.connect(this._onTabAddRequested,this),t}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){et.postMessage(this,w.LayoutModified)}_onCurrentChanged(t,r){let{previousTitle:i,currentTitle:n}=r;i&&i.owner.hide(),n&&n.owner.show(),(K.IS_EDGE||K.IS_IE)&&et.flush(),et.postMessage(this,w.LayoutModified)}_onTabAddRequested(t){this._addRequested.emit(t)}_onTabActivateRequested(t,r){r.title.owner.activate()}_onTabCloseRequested(t,r){r.title.owner.close()}_onTabDetachRequested(t,r){if(this._drag)return;t.releaseMouse();let{title:i,tab:n,clientX:a,clientY:o,offset:s}=r,l=new V.MimeData;l.setData("application/vnd.lumino.widget-factory",()=>i.owner);let u=n.cloneNode(!0);s&&(u.style.top=`-${s.y}px`,u.style.left=`-${s.x}px`),this._drag=new ec({document:this._document,mimeData:l,dragImage:u,proposedAction:"move",supportedActions:"move",source:this}),n.classList.add("lm-mod-hidden");let c=()=>{this._drag=null,n.classList.remove("lm-mod-hidden")};this._drag.start(a,o).then(c)}},tq=tU||(tU={});tq.Overlay=class{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(t){let r=this.node.style;r.top=`${t.top}px`,r.left=`${t.left}px`,r.right=`${t.right}px`,r.bottom=`${t.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(t){if(!this._hidden){if(t<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}-1===this._timer&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},t))}}};class tG{createTabBar(t){let r=new tk({document:t});return r.addClass("lm-DockPanel-tabBar"),r}createHandle(){let t=document.createElement("div");return t.className="lm-DockPanel-handle",t}}tq.Renderer=tG,tq.defaultRenderer=new tG,(g=w||(w={})).GOLDEN_RATIO=.618,g.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},g.LayoutModified=new ei("layout-modified"),g.isGeneratedTabBarProperty=new en({name:"isGeneratedTabBar",create:()=>!1}),g.createSingleDocumentConfig=function(t){if(t.isEmpty)return{main:null};let r=Array.from(t.widgets()),i=t.selectedWidgets().next().value,n=i?r.indexOf(i):-1;return{main:{type:"tab-area",widgets:r,currentIndex:n}}},g.findDropTarget=function(t,r,i,n){let a;if(!X.hitTest(t.node,r,i))return{zone:"invalid",target:null};let o=t.layout;if(o.isEmpty)return{zone:"root-all",target:null};if("multiple-document"===t.mode){let a=t.node.getBoundingClientRect(),o=r-a.left+1,s=i-a.top+1,l=a.right-r,u=a.bottom-i;switch(Math.min(s,l,u,o)){case s:if(sd&&c>d&&u>f&&h>f)return{zone:"widget-all",target:s};switch(l/=d,u/=f,Math.min(l,u,c/=d,h/=f)){case l:a="widget-left";break;case u:a="widget-top";break;case c:a="widget-right";break;case h:a="widget-bottom";break;default:throw"unreachable"}return{zone:a,target:s}},g.getDropRef=function(t){return 0===t.titles.length?null:t.currentTitle?t.currentTitle.owner:t.titles[t.titles.length-1].owner};var tH=class t extends eW{constructor(t={}){super(t),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new eG],this._columnSizers=[new eG],this._box=null,void 0!==t.rowCount&&T.reallocSizers(this._rowSizers,t.rowCount),void 0!==t.columnCount&&T.reallocSizers(this._columnSizers,t.columnCount),void 0!==t.rowSpacing&&(this._rowSpacing=T.clampValue(t.rowSpacing)),void 0!==t.columnSpacing&&(this._columnSpacing=T.clampValue(t.columnSpacing))}dispose(){for(let t of this._items){let r=t.widget;t.dispose(),r.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(t){t!==this.rowCount&&(T.reallocSizers(this._rowSizers,t),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(t){t!==this.columnCount&&(T.reallocSizers(this._columnSizers,t),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(t){t=T.clampValue(t),this._rowSpacing!==t&&(this._rowSpacing=t,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(t){t=T.clampValue(t),this._columnSpacing!==t&&(this._columnSpacing=t,this.parent&&this.parent.fit())}rowStretch(t){let r=this._rowSizers[t];return r?r.stretch:-1}setRowStretch(t,r){let i=this._rowSizers[t];i&&(r=T.clampValue(r),i.stretch!==r&&(i.stretch=r,this.parent&&this.parent.update()))}columnStretch(t){let r=this._columnSizers[t];return r?r.stretch:-1}setColumnStretch(t,r){let i=this._columnSizers[t];i&&(r=T.clampValue(r),i.stretch!==r&&(i.stretch=r,this.parent&&this.parent.update()))}*[Symbol.iterator](){for(let t of this._items)yield t.widget}addWidget(t){-1===N.ArrayExt.findFirstIndex(this._items,r=>r.widget===t)&&(this._items.push(new eQ(t)),this.parent&&this.attachWidget(t))}removeWidget(t){let r=N.ArrayExt.findFirstIndex(this._items,r=>r.widget===t);if(-1===r)return;let i=N.ArrayExt.removeAt(this._items,r);this.parent&&this.detachWidget(t),i.dispose()}init(){for(let t of(super.init(),this))this.attachWidget(t)}attachWidget(t){this.parent.isAttached&&et.sendMessage(t,e$.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&et.sendMessage(t,e$.Msg.AfterAttach),this.parent.fit()}detachWidget(t){this.parent.isAttached&&et.sendMessage(t,e$.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&et.sendMessage(t,e$.Msg.AfterDetach),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){for(let t=0,r=this.rowCount;t!t.isHidden);for(let t=0,i=r.length;t({row:0,column:0,rowSpan:1,columnSpan:1}),changed:function(t){t.parent&&t.parent.layout instanceof tH&&t.parent.fit()}}),v.normalizeConfig=function(t){return{row:Math.max(0,Math.floor(t.row||0)),column:Math.max(0,Math.floor(t.column||0)),rowSpan:Math.max(1,Math.floor(t.rowSpan||0)),columnSpan:Math.max(1,Math.floor(t.columnSpan||0))}},v.clampValue=function(t){return Math.max(0,Math.floor(t))},v.rowSpanCmp=function(t,r){let i=v.cellConfigProperty.get(t.widget),n=v.cellConfigProperty.get(r.widget);return i.rowSpan-n.rowSpan},v.columnSpanCmp=function(t,r){let i=v.cellConfigProperty.get(t.widget),n=v.cellConfigProperty.get(r.widget);return i.columnSpan-n.columnSpan},v.reallocSizers=function(t,r){for(r=Math.max(1,Math.floor(r));t.lengthr&&(t.length=r)},v.distributeMin=function(t,r,i,n){if(i=n)return;let o=(n-a)/(i-r+1);for(let n=r;n<=i;++n)t[n].minSize+=o};var t$=class t extends e${constructor(r={}){super({node:A.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(e$.Flag.DisallowLayout),this.renderer=r.renderer||t.defaultRenderer,this._forceItemsPosition=r.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=r.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(t){this.activeIndex=t?this._menus.indexOf(t):-1}get activeIndex(){return this._activeIndex}set activeIndex(t){(t<0||t>=this._menus.length)&&(t=-1),t>-1&&0===this._menus[t].items.length&&(t=-1),this._activeIndex!==t&&(this._activeIndex=t,this.update())}get menus(){return this._menus}openActiveMenu(){-1!==this._activeIndex&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(t,r=!0){this.insertMenu(this._menus.length,t,r)}insertMenu(t,r,i=!0){this._closeChildMenu();let n=this._menus.indexOf(r),a=Math.max(0,Math.min(t,this._menus.length));if(-1===n){N.ArrayExt.insert(this._menus,a,r),r.addClass("lm-MenuBar-menu"),r.aboutToClose.connect(this._onMenuAboutToClose,this),r.menuRequested.connect(this._onMenuMenuRequested,this),r.title.changed.connect(this._onTitleChanged,this),i&&this.update();return}a===this._menus.length&&a--,n!==a&&(N.ArrayExt.move(this._menus,n,a),i&&this.update())}removeMenu(t,r=!0){this.removeMenuAt(this._menus.indexOf(t),r)}removeMenuAt(t,r=!0){this._closeChildMenu();let i=N.ArrayExt.removeAt(this._menus,t);i&&(i.aboutToClose.disconnect(this._onMenuAboutToClose,this),i.menuRequested.disconnect(this._onMenuMenuRequested,this),i.title.changed.disconnect(this._onTitleChanged,this),i.removeClass("lm-MenuBar-menu"),r&&this.update())}clearMenus(){if(0!==this._menus.length){for(let t of(this._closeChildMenu(),this._menus))t.aboutToClose.disconnect(this._onMenuAboutToClose,this),t.menuRequested.disconnect(this._onMenuMenuRequested,this),t.title.changed.disconnect(this._onTitleChanged,this),t.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(t){switch(t.type){case"keydown":this._evtKeyDown(t);break;case"pointerdown":this._evtPointerDown(t);break;case"pointermove":case"pointerleave":this._evtPointerMove(t);break;case"focusout":this._evtFocusOut(t);break;case"contextmenu":t.preventDefault(),t.stopPropagation()}}onBeforeAttach(t){this.node.addEventListener("keydown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("pointermove",this),this.node.addEventListener("pointerleave",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(t){this.node.removeEventListener("keydown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("pointermove",this),this.node.removeEventListener("pointerleave",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(t){this.isAttached&&this._focusItemAt(0)}onResize(t){this.update(),super.onResize(t)}onUpdateRequest(t){var r;let i=this._menus,n=this.renderer,a=this._activeIndex,o=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:i.length,l=0,u=!1,c=Array(s=null!==this._overflowMenu?s-1:s);for(let t=0;t{this._tabFocusIndex=t,this.activeIndex=t}}),l+=this._menuItemSizes[t],i[t].title.label===this._overflowMenuOptions.title&&(u=!0,s--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!u){if(null===this._overflowMenu){let t=null!=(r=this._overflowMenuOptions.title)?r:"...";this._overflowMenu=new tx({commands:new eS}),this._overflowMenu.title.label=t,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let t=i.length-2;t>=s;t--){let r=this.menus[t];r.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:r}),this.removeMenu(r,!1)}c[s]=n.renderItem({title:this._overflowMenu.title,active:s===a&&0!==i[s].items.length,tabbable:s===o,disabled:0===i[s].items.length,onfocus:()=>{this._tabFocusIndex=s,this.activeIndex=s}}),s++}else if(null!==this._overflowMenu){let t=this._overflowMenu.items,r=this.node.offsetWidth,a=this._overflowMenu.items.length;for(let u=0;uthis._menuItemSizes[a]){let r=t[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(s,r,!1),c[s]=n.renderItem({title:r.title,active:!1,tabbable:s===o,disabled:0===i[s].items.length,onfocus:()=>{this._tabFocusIndex=s,this.activeIndex=s}}),s++}}0===this._overflowMenu.items.length&&(this.removeMenu(this._overflowMenu,!1),c.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}eV.render(c,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let t=this.contentNode.childNodes,r=this.node.offsetWidth,i=0,n=-1,a=t.length;if(0==this._menuItemSizes.length)for(let o=0;or&&-1===n&&(n=o)}else for(let t=0;tr){n=t;break}this._overflowIndex=n}_evtKeyDown(t){let r=t.keyCode;if(9===r){this.activeIndex=-1;return}if(t.preventDefault(),t.stopPropagation(),13===r||32===r||38===r||40===r){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(27===r){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(37===r||39===r){let t=37===r?-1:1,i=this._tabFocusIndex+t,n=this._menus.length;for(let r=0;rX.hitTest(r,t.clientX,t.clientY));if(-1===r)return void this._closeChildMenu();if(0===t.button)if(this._childMenu)this._closeChildMenu(),this.activeIndex=r;else{t.preventDefault();let i=this._positionForMenu(r);tx.saveWindowData(),this.activeIndex=r,this._openChildMenu(i)}}_evtPointerMove(t){let r=N.ArrayExt.findFirstIndex(this.contentNode.children,r=>X.hitTest(r,t.clientX,t.clientY));if(r===this._activeIndex||-1===r&&this._childMenu)return;let i=r>=0&&this._childMenu?this._positionForMenu(r):null;tx.saveWindowData(),this.activeIndex=r,i&&this._openChildMenu(i)}_positionForMenu(t){let{left:r,bottom:i}=this.contentNode.children[t].getBoundingClientRect();return{top:i,left:r}}_evtFocusOut(t){this._childMenu||this.node.contains(t.relatedTarget)||(this.activeIndex=-1)}_focusItemAt(t){let r=this.contentNode.childNodes[t];r&&r.focus()}_openChildMenu(t={}){let r=this.activeMenu;if(!r)return void this._closeChildMenu();let i=this._childMenu;if(i===r)return;this._childMenu=r,i?i.close():document.addEventListener("pointerdown",this,!0),this._tabFocusIndex=this.activeIndex,et.sendMessage(this,e$.Msg.UpdateRequest);let{left:n,top:a}=t;(typeof n>"u"||typeof a>"u")&&({left:n,top:a}=this._positionForMenu(this._activeIndex)),i||this.addClass("lm-mod-active"),r.items.length>0&&r.open(n,a,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("pointerdown",this,!0);let t=this._childMenu;this._childMenu=null,t.close(),this.activeIndex=-1}_onMenuAboutToClose(t){t===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("pointerdown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(t,r){if(t!==this._childMenu)return;let i=this._activeIndex,n=this._menus.length;switch(r){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=0===i?n-1:i-1}this.openActiveMenu()}_onTitleChanged(){this.update()}},tW=t$||(t$={});class tY{renderItem(t){let r=this.createItemClass(t),i=this.createItemDataset(t),n=this.createItemARIA(t);return ez.li({className:r,dataset:i,...t.disabled?{}:{tabindex:t.tabbable?"0":"-1"},onfocus:t.onfocus,...n},this.renderIcon(t),this.renderLabel(t))}renderIcon(t){let r=this.createIconClass(t);return ez.div({className:r},t.title.icon,t.title.iconLabel)}renderLabel(t){let r=this.formatLabel(t);return ez.div({className:"lm-MenuBar-itemLabel"},r)}createItemClass(t){let r="lm-MenuBar-item";return t.title.className&&(r+=` ${t.title.className}`),t.active&&!t.disabled&&(r+=" lm-mod-active"),r}createItemDataset(t){return t.title.dataset}createItemARIA(t){return{role:"menuitem","aria-haspopup":"true","aria-disabled":t.disabled?"true":"false"}}createIconClass(t){let r="lm-MenuBar-itemIcon",i=t.title.iconClass;return i?`${r} ${i}`:r}formatLabel(t){let{label:r,mnemonic:i}=t.title;if(i<0||i>=r.length)return r;let n=r.slice(0,i),a=r.slice(i+1),o=r[i];return[n,ez.span({className:"lm-MenuBar-itemMnemonic"},o),a]}}tW.Renderer=tY,tW.defaultRenderer=new tY,(x=A||(A={})).createNode=function(){let t=document.createElement("div"),r=document.createElement("ul");return r.className="lm-MenuBar-content",t.appendChild(r),r.setAttribute("role","menubar"),t},x.findMnemonic=function(t,r,i){let n=-1,a=-1,o=!1,s=r.toUpperCase();for(let r=0,l=t.length;r=0&&h1&&this.widgets.forEach(t=>{t.hiddenMode=this._hiddenMode}))}dispose(){for(let t of this._items)t.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(t,r){this._hiddenMode===e$.HiddenMode.Scale&&this._items.length>0?(1===this._items.length&&(this.widgets[0].hiddenMode=e$.HiddenMode.Scale),r.hiddenMode=e$.HiddenMode.Scale):r.hiddenMode=e$.HiddenMode.Display,N.ArrayExt.insert(this._items,t,new eQ(r)),this.parent.isAttached&&et.sendMessage(r,e$.Msg.BeforeAttach),this.parent.node.appendChild(r.node),this.parent.isAttached&&et.sendMessage(r,e$.Msg.AfterAttach),this.parent.fit()}moveWidget(t,r,i){N.ArrayExt.move(this._items,t,r),this.parent.update()}detachWidget(t,r){let i=N.ArrayExt.removeAt(this._items,t);this.parent.isAttached&&et.sendMessage(r,e$.Msg.BeforeDetach),this.parent.node.removeChild(r.node),this.parent.isAttached&&et.sendMessage(r,e$.Msg.AfterDetach),i.widget.node.style.zIndex="",this._hiddenMode===e$.HiddenMode.Scale&&(r.hiddenMode=e$.HiddenMode.Display,1===this._items.length&&(this._items[0].widget.hiddenMode=e$.HiddenMode.Display)),i.dispose(),this.parent.fit()}onBeforeShow(t){super.onBeforeShow(t),this.parent.update()}onBeforeAttach(t){super.onBeforeAttach(t),this.parent.fit()}onChildShown(t){this.parent.fit()}onChildHidden(t){this.parent.fit()}onResize(t){this.parent.isVisible&&this._update(t.width,t.height)}onUpdateRequest(t){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(t){this.parent.isAttached&&this._fit()}_fit(){let t=0,r=0;for(let i=0,n=this._items.length;i{this.createGraph(this._model)})}renderModel(t){if(this.hasGraphElement())return JSON.stringify(this._model?.data[this._mimeType])===JSON.stringify(t.data[this._mimeType])?Promise.resolve():(this._model=t,this.createGraph(t));this._model=t;let r=t.data["image/png"];return null!=r?(this.updateImage(r),Promise.resolve()):this.createGraph(t)}hasGraphElement(){return null!==this.node.querySelector(".plot-container")}updateImage(t){this.hideGraph(),this._img_el.src="data:image/png;base64,"+t,this.showImage()}hideGraph(){let t=this.node.querySelector(".plot-container");null!=t&&(t.style.display="none")}showGraph(){let t=this.node.querySelector(".plot-container");null!=t&&(t.style.display="block")}hideImage(){let t=this.node.querySelector(".plot-img");null!=t&&(t.style.display="none")}showImage(){let t=this.node.querySelector(".plot-img");null!=t&&(t.style.display="block")}createGraph(r){let{data:i,layout:n,frames:a,config:o}=r.data[this._mimeType];return n.height||(n.height=360),(async()=>(null===t.Plotly&&(t.Plotly=await Promise.resolve().then(()=>O(j())),t._resolveLoadingPlotly()),t.loadingPlotly))().then(()=>t.Plotly.react(this.node,i,n,o)).then(i=>{this.showGraph(),this.hideImage(),this.update(),a&&t.Plotly.addFrames(this.node,a),this.node.offsetWidth>0&&this.node.offsetHeight>0&&t.Plotly.toImage(i,{format:"png",width:this.node.offsetWidth,height:this.node.offsetHeight}).then(t=>{let i=t.split(",")[1];r.data["image/png"]!==i&&r.setData({data:{...r.data,"image/png":i}})}),this.node.on("plotly_webglcontextlost",()=>{let t=r.data["image/png"];if(null!=t)return this.updateImage(t),Promise.resolve()})})}onAfterShow(t){this.update()}onResize(t){this.update()}onUpdateRequest(r){t.Plotly&&this.isVisible&&this.hasGraphElement()&&t.Plotly.redraw(this.node).then(()=>{t.Plotly.Plots.resize(this.node)})}static{this.Plotly=null}static{this.loadingPlotly=new Promise(r=>{t._resolveLoadingPlotly=r})}},tJ={safe:!0,mimeTypes:[tX],createRenderer:t=>new tK(t)},tQ=[{id:"@jupyterlab/plotly-extension:factory",rendererFactory:tJ,rank:2,dataType:"json",fileTypes:[{name:"plotly",mimeTypes:[tX],extensions:[".plotly",".plotly.json"],iconClass:"jp-MaterialIcon jp-PlotlyIcon"}],documentWidgetFactoryOptions:{name:"Plotly",primaryFileType:"plotly",fileTypes:["plotly","json"],defaultFor:["plotly"]}}];i.d(r,{MIME_TYPE:()=>tX,RenderedPlotly:()=>tK,default:()=>tQ,rendererFactory:()=>tJ})},3(t){var r,i,n,a=t.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}function l(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(i){try{return r.call(null,t,0)}catch(i){return r.call(this,t,0)}}}var u=[],c=!1,h=-1;function d(){c&&n&&(c=!1,n.length?u=n.concat(u):h=-1,u.length&&f())}function f(){if(!c){var t=l(d);c=!0;for(var r=u.length;r;){for(n=u,u=[];++h1)for(var i=1;i{"use strict";var e,n,r,t,o,i,u,a,c,l,f,s,p,h,d,v,g,y,m,b,S,j,w,E,k,x,T,P,A,C,O,D,M,L,N,$,_,z={0(e,n,r){var t={"./index":()=>r.e(0).then(()=>()=>r(2)),"./mimeExtension":()=>r.e(0).then(()=>()=>r(2))},o=function(e,n){return r.R=n,n=r.o(t,e)?t[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,n},i=function(e,n){if(r.S){var t="default",o=r.S[t];if(o&&o!==e)throw Error("Container initialization failed as it has already been initialized with a different share scope");return r.S[t]=e,r.I(t,n)}};r.d(n,{get:()=>o,init:()=>i})}},I={};function R(e){var n=I[e];if(void 0!==n)return n.exports;var r=I[e]={exports:{}};return z[e](r,r.exports,R),r.exports}R.m=z,R.c=I,R.d=(e,n,r)=>{var t=(n,r)=>{for(var t in n)R.o(n,t)&&!R.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,[r]:n[t]})};t(n,"get"),t(r,"value")},R.f={},R.e=e=>Promise.all(Object.keys(R.f).reduce((n,r)=>(R.f[r](e,n),n),[])),R.u=e=>""+e+".d6f08baae2d5090c.js?v=d6f08baae2d5090c",R.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),R.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),U={},R.l=function(e,n,r,t){if(U[e])return void U[e].push(n);if(void 0!==r)for(var o,i,u=document.getElementsByTagName("script"),a=0;a{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},R.S={},R.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"jupyterlab-plotly",version:"7.1.0",factory:()=>R.e(0).then(()=>()=>R(2)),eager:0,treeShakingMode:null}]},uniqueName:"jupyterlab-plotly"},q={},B={},R.I=function(e,n){n||(n=[]);var r=B[e];if(r||(r=B[e]={}),!(n.indexOf(r)>=0)){if(n.push(r),q[e])return q[e];R.o(R.S,e)||(R.S[e]={});var t=R.S[e],o=function(e){"u">typeof console&&console.warn&&console.warn(e)},i=R.initializeSharingData.uniqueName,u=function(e,n,r,o){var u=t[e]=t[e]||{},a=u[n];(!a||!a.loaded&&(!o!=!a.eager?o:i>a.from))&&(u[n]={get:r,from:i,eager:!!o})},a=function(r){var t=function(e){o("Initialization of sharing external failed: "+e)};try{var i=R(r);if(!i)return;var u=function(r){return r&&r.init&&r.init(R.S[e],n)};if(i.then)return c.push(i.then(u,t));var a=u(i);if(a&&a.then)return c.push(a.catch(t))}catch(e){t(e)}},c=[],l=R.initializeSharingData.scopeToSharingDataMapping;return(l[e]&&l[e].forEach(function(e){"object"==typeof e?u(e.name,e.version,e.factory,e.eager):a(e)}),c.length)?q[e]=Promise.all(c).then(function(){return q[e]=1}):q[e]=1}},R.g.importScripts&&(J=R.g.location+"");var U,q,B,J,Y=R.g.document;if(!J&&Y&&(Y.currentScript&&"SCRIPT"===Y.currentScript.tagName.toUpperCase()&&(J=Y.currentScript.src),!J)){var V=Y.getElementsByTagName("script");if(V.length)for(var F=V.length-1;F>-1&&(!J||!/^http(s?):/.test(J));)J=V[F--].src}if(!J)throw Error("Automatic publicPath is not supported in this browser");R.p=J=J.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),R.consumesLoadingData={chunkMapping:{},moduleIdToConsumeDataMapping:{},initialConsumes:[]},e=function(e){return e.split(".").map(function(e){return+e==e?+e:e})},n=function(n){var r=function(n){var r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(n),t=r[1]?[0].concat(e(r[1])):[0];r[2]&&(t.length++,t.push.apply(t,e(r[2])));let o=t[t.length-1];for(;t.length&&(void 0===o||/^[*xX]$/.test(o));)t.pop(),o=t[t.length-1];return t},t=function(e){return 1===e.length?[0]:2===e.length?[1].concat(e.slice(1)):3===e.length?[2].concat(e.slice(1)):[e.length].concat(e.slice(1))},o=function(e){return[-e[0]-1].concat(e.slice(1))},i=function(e){let n=/^(\^|~|<=|<|>=|>|=|v|!)/.exec(e),i=n?n[0]:"",u=r(i.length?e.slice(i.length).trim():e.trim());switch(i){case"^":if(u.length>1&&0===u[1]){if(u.length>2&&0===u[2])return[3].concat(u.slice(1));return[2].concat(u.slice(1))}return[1].concat(u.slice(1));case"~":return[2].concat(u.slice(1));case">=":return u;case"=":case"v":case"":return t(u);case"<":return o(u);case">":return[,t(u),0,u,2];case"<=":return[,t(u),o(u),1];case"!":return[,t(u),0];default:throw Error("Unexpected start value")}},u=function(e,n){if(1===e.length)return e[0];let r=[];for(let n of e.slice().reverse())0 in n?r.push(n):r.push.apply(r,n.slice(1));return[,].concat(r,e.slice(1).map(()=>n))};return u(n.split(/\s*\|\|\s*/).map(function(e){let n=e.split(/\s+-\s+/);if(1===n.length){e=e.trim();let n=[],r=/[-0-9A-Za-z]\s+/g;for(var a,c=0;a=r.exec(e);){let r=a.index+1;n.push(i(e.slice(c,r).trim())),c=r}return n.push(i(e.slice(c).trim())),u(n,2)}let l=r(n[0]),f=r(n[1]);return[,t(f),o(f),1,l,2]}),1)},r=function(n){var r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(n),t=r[1]?e(r[1]):[];return r[2]&&(t.length++,t.push.apply(t,e(r[2]))),r[3]&&(t.push([]),t.push.apply(t,e(r[3]))),t},t=function(e,n){e=r(e),n=r(n);for(var t=0;;){if(t>=e.length)return t=n.length)return"u"==i;var u=n[t],a=(typeof u)[0];if(i==a){if("o"!=i&&"u"!=i&&o!=u)return o=":-1==n?"<":1==n?"^":2==n?"~":n>0?"=":"!=";for(var t=1,i=1;i0?".":"")+(t=2,u)}return r}for(var c=[],i=1;i=n.length||"o"==(f=(typeof(l=n[u]))[0])){if(!c)return!0;if("u"==s)return a>t&&!o;return""==s!=o}if("u"==f){if(!c||"u"!=s)return!1}else if(c)if(s==f)if(a<=t){if(l!=e[a])return!1}else{if(o?l>e[a]:ltypeof console&&console.warn&&console.warn(e)},y=function(e,n,r,t){g(d(e,n,r,t))},m=function(e){return e.loaded=1,e.get()},S=(b=function(e){return function(n,r,t,o){var i=R.I(n);return i&&i.then?i.then(e.bind(e,n,R.S[n],r,t,o)):e(n,R.S[n],r,t,o)}})(function(e,n,r){return u(e,r),m(a(n,r))}),j=b(function(e,n,r,t){return n&&R.o(n,r)?m(a(n,r)):t()}),w=b(function(e,n,r,t){return u(e,r),m(h(n,r,t)||y(n,e,r,t)||a(n,r))}),E=b(function(e,n,r){return u(e,r),f(n,e,r)}),k=b(function(e,n,r,t){return u(e,r),s(n,e,r,t)}),x=b(function(e,n,r,t){return u(e,r),v(n,e,r,t)}),T=b(function(e,n,r,t){return u(e,r),p(n,e,r,t)}),P=b(function(e,n,r,t,o){return n&&R.o(n,r)?m(h(n,r,t)||y(n,e,r,t)||a(n,r)):o()}),A=b(function(e,n,r,t){return n&&R.o(n,r)?f(n,e,r):t()}),C=b(function(e,n,r,t,o){return n&&R.o(n,r)?s(n,e,r,t):o()}),O=b(function(e,n,r,t,o){var i=n&&R.o(n,r)&&h(n,r,t);return i?m(i):o()}),D=b(function(e,n,r,t,o){return n&&R.o(n,r)?p(n,e,r,t):o()}),M=function(e){var r=!1,t=!1,o=!1,i=!1,u=[e.shareScope,e.shareKey];return(e.requiredVersion?(e.strictVersion&&(r=!0),e.singleton&&(t=!0),u.push(n(e.requiredVersion)),o=!0):e.singleton&&(t=!0),e.fallback&&(i=!0,u.push(e.fallback)),r&&t&&o&&i)?function(){return D.apply(null,u)}:r&&o&&i?function(){return O.apply(null,u)}:t&&o&&i?function(){return C.apply(null,u)}:r&&t&&o?function(){return T.apply(null,u)}:t&&i?function(){return A.apply(null,u)}:o&&i?function(){return P.apply(null,u)}:r&&o?function(){return x.apply(null,u)}:t&&o?function(){return k.apply(null,u)}:t?function(){return E.apply(null,u)}:o?function(){return w.apply(null,u)}:i?function(){return j.apply(null,u)}:function(){return S.apply(null,u)}},L={},R.f.consumes=function(e,n){var r=R.consumesLoadingData.moduleIdToConsumeDataMapping,t=R.consumesLoadingData.chunkMapping;R.o(t,e)&&t[e].forEach(function(e){if(R.o(L,e))return n.push(L[e]);var t=function(n){L[e]=0,R.m[e]=function(r){delete R.c[e],r.exports=n()}},o=function(n){delete L[e],R.m[e]=function(r){throw delete R.c[e],n}};try{var i=M(r[e])();i.then?n.push(L[e]=i.then(t).catch(o)):t(i)}catch(e){o(e)}})},N={1:0},R.f.j=function(e,n){var r=R.o(N,e)?N[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var t=new Promise((n,t)=>r=N[e]=[n,t]);n.push(r[2]=t);var o=R.p+R.u(e),i=Error();R.l(o,function(n){if(R.o(N,e)&&(0!==(r=N[e])&&(N[e]=void 0),r)){var t=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+t+": "+o+")",i.name="ChunkLoadError",i.type=t,i.request=o,r[1](i)}},"chunk-"+e,e)}},$=(e,n)=>{var r,t,[o,i,u]=n,a=0;if(o.some(e=>0!==N[e])){for(r in i)R.o(i,r)&&(R.m[r]=i[r]);u&&u(R)}for(e&&e(n);a{"use strict";var e,n,r,t,o,i,u,a,c,l,f,s,p,h,d,v,g,y,m,b,S,j,w,E,k,x,T,P,A,C,O,D,M,L,N,$,_,z={0(e,n,r){var t={"./index":()=>r.e(0).then(()=>()=>r(2)),"./mimeExtension":()=>r.e(0).then(()=>()=>r(2))},o=function(e,n){return r.R=n,n=r.o(t,e)?t[e]():Promise.resolve().then(()=>{throw Error('Module "'+e+'" does not exist in container.')}),r.R=void 0,n},i=function(e,n){if(r.S){var t="default",o=r.S[t];if(o&&o!==e)throw Error("Container initialization failed as it has already been initialized with a different share scope");return r.S[t]=e,r.I(t,n)}};r.d(n,{get:()=>o,init:()=>i})}},I={};function R(e){var n=I[e];if(void 0!==n)return n.exports;var r=I[e]={exports:{}};return z[e](r,r.exports,R),r.exports}R.m=z,R.c=I,R.d=(e,n,r)=>{var t=(n,r)=>{for(var t in n)R.o(n,t)&&!R.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,[r]:n[t]})};t(n,"get"),t(r,"value")},R.f={},R.e=e=>Promise.all(Object.keys(R.f).reduce((n,r)=>(R.f[r](e,n),n),[])),R.u=e=>""+e+".449902a1d9ae1138.js?v=449902a1d9ae1138",R.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),R.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),U={},R.l=function(e,n,r,t){if(U[e])return void U[e].push(n);if(void 0!==r)for(var o,i,u=document.getElementsByTagName("script"),a=0;a{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},R.S={},R.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"jupyterlab-plotly",version:"7.1.0",factory:()=>R.e(0).then(()=>()=>R(2)),eager:0,treeShakingMode:null}]},uniqueName:"jupyterlab-plotly"},q={},B={},R.I=function(e,n){n||(n=[]);var r=B[e];if(r||(r=B[e]={}),!(n.indexOf(r)>=0)){if(n.push(r),q[e])return q[e];R.o(R.S,e)||(R.S[e]={});var t=R.S[e],o=function(e){"u">typeof console&&console.warn&&console.warn(e)},i=R.initializeSharingData.uniqueName,u=function(e,n,r,o){var u=t[e]=t[e]||{},a=u[n];(!a||!a.loaded&&(!o!=!a.eager?o:i>a.from))&&(u[n]={get:r,from:i,eager:!!o})},a=function(r){var t=function(e){o("Initialization of sharing external failed: "+e)};try{var i=R(r);if(!i)return;var u=function(r){return r&&r.init&&r.init(R.S[e],n)};if(i.then)return c.push(i.then(u,t));var a=u(i);if(a&&a.then)return c.push(a.catch(t))}catch(e){t(e)}},c=[],l=R.initializeSharingData.scopeToSharingDataMapping;return(l[e]&&l[e].forEach(function(e){"object"==typeof e?u(e.name,e.version,e.factory,e.eager):a(e)}),c.length)?q[e]=Promise.all(c).then(function(){return q[e]=1}):q[e]=1}},R.g.importScripts&&(J=R.g.location+"");var U,q,B,J,Y=R.g.document;if(!J&&Y&&(Y.currentScript&&"SCRIPT"===Y.currentScript.tagName.toUpperCase()&&(J=Y.currentScript.src),!J)){var V=Y.getElementsByTagName("script");if(V.length)for(var F=V.length-1;F>-1&&(!J||!/^http(s?):/.test(J));)J=V[F--].src}if(!J)throw Error("Automatic publicPath is not supported in this browser");R.p=J=J.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),R.consumesLoadingData={chunkMapping:{},moduleIdToConsumeDataMapping:{},initialConsumes:[]},e=function(e){return e.split(".").map(function(e){return+e==e?+e:e})},n=function(n){var r=function(n){var r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(n),t=r[1]?[0].concat(e(r[1])):[0];r[2]&&(t.length++,t.push.apply(t,e(r[2])));let o=t[t.length-1];for(;t.length&&(void 0===o||/^[*xX]$/.test(o));)t.pop(),o=t[t.length-1];return t},t=function(e){return 1===e.length?[0]:2===e.length?[1].concat(e.slice(1)):3===e.length?[2].concat(e.slice(1)):[e.length].concat(e.slice(1))},o=function(e){return[-e[0]-1].concat(e.slice(1))},i=function(e){let n=/^(\^|~|<=|<|>=|>|=|v|!)/.exec(e),i=n?n[0]:"",u=r(i.length?e.slice(i.length).trim():e.trim());switch(i){case"^":if(u.length>1&&0===u[1]){if(u.length>2&&0===u[2])return[3].concat(u.slice(1));return[2].concat(u.slice(1))}return[1].concat(u.slice(1));case"~":return[2].concat(u.slice(1));case">=":return u;case"=":case"v":case"":return t(u);case"<":return o(u);case">":return[,t(u),0,u,2];case"<=":return[,t(u),o(u),1];case"!":return[,t(u),0];default:throw Error("Unexpected start value")}},u=function(e,n){if(1===e.length)return e[0];let r=[];for(let n of e.slice().reverse())0 in n?r.push(n):r.push.apply(r,n.slice(1));return[,].concat(r,e.slice(1).map(()=>n))};return u(n.split(/\s*\|\|\s*/).map(function(e){let n=e.split(/\s+-\s+/);if(1===n.length){e=e.trim();let n=[],r=/[-0-9A-Za-z]\s+/g;for(var a,c=0;a=r.exec(e);){let r=a.index+1;n.push(i(e.slice(c,r).trim())),c=r}return n.push(i(e.slice(c).trim())),u(n,2)}let l=r(n[0]),f=r(n[1]);return[,t(f),o(f),1,l,2]}),1)},r=function(n){var r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(n),t=r[1]?e(r[1]):[];return r[2]&&(t.length++,t.push.apply(t,e(r[2]))),r[3]&&(t.push([]),t.push.apply(t,e(r[3]))),t},t=function(e,n){e=r(e),n=r(n);for(var t=0;;){if(t>=e.length)return t=n.length)return"u"==i;var u=n[t],a=(typeof u)[0];if(i==a){if("o"!=i&&"u"!=i&&o!=u)return o=":-1==n?"<":1==n?"^":2==n?"~":n>0?"=":"!=";for(var t=1,i=1;i0?".":"")+(t=2,u)}return r}for(var c=[],i=1;i=n.length||"o"==(f=(typeof(l=n[u]))[0])){if(!c)return!0;if("u"==s)return a>t&&!o;return""==s!=o}if("u"==f){if(!c||"u"!=s)return!1}else if(c)if(s==f)if(a<=t){if(l!=e[a])return!1}else{if(o?l>e[a]:ltypeof console&&console.warn&&console.warn(e)},y=function(e,n,r,t){g(d(e,n,r,t))},m=function(e){return e.loaded=1,e.get()},S=(b=function(e){return function(n,r,t,o){var i=R.I(n);return i&&i.then?i.then(e.bind(e,n,R.S[n],r,t,o)):e(n,R.S[n],r,t,o)}})(function(e,n,r){return u(e,r),m(a(n,r))}),j=b(function(e,n,r,t){return n&&R.o(n,r)?m(a(n,r)):t()}),w=b(function(e,n,r,t){return u(e,r),m(h(n,r,t)||y(n,e,r,t)||a(n,r))}),E=b(function(e,n,r){return u(e,r),f(n,e,r)}),k=b(function(e,n,r,t){return u(e,r),s(n,e,r,t)}),x=b(function(e,n,r,t){return u(e,r),v(n,e,r,t)}),T=b(function(e,n,r,t){return u(e,r),p(n,e,r,t)}),P=b(function(e,n,r,t,o){return n&&R.o(n,r)?m(h(n,r,t)||y(n,e,r,t)||a(n,r)):o()}),A=b(function(e,n,r,t){return n&&R.o(n,r)?f(n,e,r):t()}),C=b(function(e,n,r,t,o){return n&&R.o(n,r)?s(n,e,r,t):o()}),O=b(function(e,n,r,t,o){var i=n&&R.o(n,r)&&h(n,r,t);return i?m(i):o()}),D=b(function(e,n,r,t,o){return n&&R.o(n,r)?p(n,e,r,t):o()}),M=function(e){var r=!1,t=!1,o=!1,i=!1,u=[e.shareScope,e.shareKey];return(e.requiredVersion?(e.strictVersion&&(r=!0),e.singleton&&(t=!0),u.push(n(e.requiredVersion)),o=!0):e.singleton&&(t=!0),e.fallback&&(i=!0,u.push(e.fallback)),r&&t&&o&&i)?function(){return D.apply(null,u)}:r&&o&&i?function(){return O.apply(null,u)}:t&&o&&i?function(){return C.apply(null,u)}:r&&t&&o?function(){return T.apply(null,u)}:t&&i?function(){return A.apply(null,u)}:o&&i?function(){return P.apply(null,u)}:r&&o?function(){return x.apply(null,u)}:t&&o?function(){return k.apply(null,u)}:t?function(){return E.apply(null,u)}:o?function(){return w.apply(null,u)}:i?function(){return j.apply(null,u)}:function(){return S.apply(null,u)}},L={},R.f.consumes=function(e,n){var r=R.consumesLoadingData.moduleIdToConsumeDataMapping,t=R.consumesLoadingData.chunkMapping;R.o(t,e)&&t[e].forEach(function(e){if(R.o(L,e))return n.push(L[e]);var t=function(n){L[e]=0,R.m[e]=function(r){delete R.c[e],r.exports=n()}},o=function(n){delete L[e],R.m[e]=function(r){throw delete R.c[e],n}};try{var i=M(r[e])();i.then?n.push(L[e]=i.then(t).catch(o)):t(i)}catch(e){o(e)}})},N={1:0},R.f.j=function(e,n){var r=R.o(N,e)?N[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var t=new Promise((n,t)=>r=N[e]=[n,t]);n.push(r[2]=t);var o=R.p+R.u(e),i=Error();R.l(o,function(n){if(R.o(N,e)&&(0!==(r=N[e])&&(N[e]=void 0),r)){var t=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+t+": "+o+")",i.name="ChunkLoadError",i.type=t,i.request=o,r[1](i)}},"chunk-"+e,e)}},$=(e,n)=>{var r,t,[o,i,u]=n,a=0;if(o.some(e=>0!==N[e])){for(r in i)R.o(i,r)&&(R.m[r]=i[r]);u&&u(R)}for(e&&e(n);a